[
  {
    "path": ".github/workflows/codeql.yml",
    "content": "# For most projects, this workflow file will not need changing; you simply need\n# to commit it to your repository.\n#\n# You may wish to alter this file to override the set of languages analyzed,\n# or to provide custom queries or build logic.\n#\n# ******** NOTE ********\n# We have attempted to detect the languages in your repository. Please check\n# the `language` matrix defined below to confirm you have the correct set of\n# supported CodeQL languages.\n#\nname: \"CodeQL\"\n\non:\n  push:\n    branches: [ \"main\" ]\n  pull_request:\n    branches: [ \"main\" ]\n  schedule:\n    - cron: '31 19 * * 2'\n\njobs:\n  analyze:\n    name: Analyze (${{ matrix.language }})\n    # Runner size impacts CodeQL analysis time. To learn more, please see:\n    #   - https://gh.io/recommended-hardware-resources-for-running-codeql\n    #   - https://gh.io/supported-runners-and-hardware-resources\n    #   - https://gh.io/using-larger-runners (GitHub.com only)\n    # Consider using larger runners or machines with greater resources for possible analysis time improvements.\n    runs-on: ${{ 'windows-latest' }}\n    timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}\n    permissions:\n      # required for all workflows\n      security-events: write\n\n      # required to fetch internal or private CodeQL packs\n      packages: read\n\n      # only required for workflows in private repositories\n      actions: read\n      contents: read\n\n    strategy:\n      fail-fast: false\n      matrix:\n        include:\n        - language: c-cpp\n          build-mode: manual\n        - language: csharp\n          build-mode: autobuild\n        # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'\n        # Use `c-cpp` to analyze code written in C, C++ or both\n        # Use 'java-kotlin' to analyze code written in Java, Kotlin or both\n        # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both\n        # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,\n        # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.\n        # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how\n        # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages\n    steps:\n    - name: Checkout repository\n      uses: actions/checkout@v4\n      with:\n          submodules: 'recursive'\n\n    # Initializes the CodeQL tools for scanning.\n    - name: Initialize CodeQL\n      uses: github/codeql-action/init@v3\n      with:\n        languages: ${{ matrix.language }}\n        build-mode: ${{ matrix.build-mode }}\n        # If you wish to specify custom queries, you can do so here or in a config file.\n        # By default, queries listed here will override any specified in a config file.\n        # Prefix the list here with \"+\" to use these queries and those in the config file.\n\n        # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs\n        # queries: security-extended,security-and-quality\n\n    # If the analyze step fails for one of the languages you are analyzing with\n    # \"We were unable to automatically build your code\", modify the matrix above\n    # to set the build mode to \"manual\" for that language. Then modify this step\n    # to build your code.\n    # ℹ️ Command-line programs to run using the OS shell.\n    # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun\n    - if: matrix.build-mode == 'manual'\n      shell: cmd\n      run: |\n        build.cmd\n\n    - name: Perform CodeQL Analysis\n      uses: github/codeql-action/analyze@v3\n      with:\n        category: \"/language:${{matrix.language}}\"\n"
  },
  {
    "path": ".github/workflows/dotnet-desktop.yml",
    "content": "# This workflow uses actions that are not certified by GitHub.\n# They are provided by a third-party and are governed by\n# separate terms of service, privacy policy, and support\n# documentation.\n\n# This workflow will build, test, sign and package a WPF or Windows Forms desktop application\n# built on .NET Core.\n# To learn how to migrate your existing application to .NET Core,\n# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework\n#\n# To configure this workflow:\n#\n# 1. Configure environment variables\n# GitHub sets default environment variables for every workflow run.\n# Replace the variables relative to your project in the \"env\" section below.\n#\n# 2. Signing\n# Generate a signing certificate in the Windows Application\n# Packaging Project or add an existing signing certificate to the project.\n# Next, use PowerShell to encode the .pfx file using Base64 encoding\n# by running the following Powershell script to generate the output string:\n#\n# $pfx_cert = Get-Content '.\\SigningCertificate.pfx' -Encoding Byte\n# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'\n#\n# Open the output file, SigningCertificate_Encoded.txt, and copy the\n# string inside. Then, add the string to the repo as a GitHub secret\n# and name it \"Base64_Encoded_Pfx.\"\n# For more information on how to configure your signing certificate for\n# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing\n#\n# Finally, add the signing certificate password to the repo as a secret and name it \"Pfx_Key\".\n# See \"Build the Windows Application Packaging project\" below to see how the secret is used.\n#\n# For more information on GitHub Actions, refer to https://github.com/features/actions\n# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,\n# refer to https://github.com/microsoft/github-actions-for-desktop-apps\n\nname: .NET Core Desktop\n\non:\n  push:\n    branches: [ \"main\" ]\n  pull_request:\n    branches: [ \"main\" ]\n\njobs:\n\n  build:\n    strategy:\n      matrix:\n        configuration: [Debug, Release]\n\n    runs-on: windows-latest  # For a list of available runner types, refer to\n                             # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on\n\n    env:\n      Solution_Name: src/ProfileExplorer.sln                         # Replace with your solution name, i.e. MyWpfApp.sln.\n      Test_Project_Path: your-test-project-path                 # Replace with the path to your test project, i.e. MyWpfApp.Tests\\MyWpfApp.Tests.csproj.\n      Wap_Project_Directory: your-wap-project-directory-name    # Replace with the Wap project directory relative to the solution, i.e. MyWpfApp.Package.\n      Wap_Project_Path: your-wap-project-path                   # Replace with the path to your Wap project, i.e. MyWpf.App.Package\\MyWpfApp.Package.wapproj.\n\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v4\n      with:\n        fetch-depth: 0\n\n    # Install the .NET Core workload\n    - name: Install .NET Core\n      uses: actions/setup-dotnet@v4\n      with:\n        dotnet-version: 8.0.x\n\n    # Add  MSBuild to the PATH: https://github.com/microsoft/setup-msbuild\n    - name: Setup MSBuild.exe\n      uses: microsoft/setup-msbuild@v2\n\n    # Execute unit tests for Core and UI projects\n    - name: Execute unit tests\n      run: |\n        dotnet test src\\ProfileExplorerCoreTests\\ProfileExplorerCoreTests.csproj\n        dotnet test src\\ProfileExplorerUITests\\ProfileExplorerUITests.csproj\n\n    # Build the solution\n    - name: Build debug\n      run: dotnet publish -c \"Debug\"  src\\ProfileExplorerUI\\ProfileExplorerUI.csproj\n      env:\n        Configuration: ${{ matrix.configuration }}\n    - name: Build release\n      run: dotnet publish -c \"Release\"  src\\ProfileExplorerUI\\ProfileExplorerUI.csproj\n      env:\n        Configuration: ${{ matrix.configuration }}\n"
  },
  {
    "path": ".github/workflows/installer.yml",
    "content": "# This workflow uses actions that are not certified by GitHub.\n# They are provided by a third-party and are governed by\n# separate terms of service, privacy policy, and support\n# documentation.\n\n# This workflow will build, test, sign and package a WPF or Windows Forms desktop application\n# built on .NET Core.\n# To learn how to migrate your existing application to .NET Core,\n# refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework\n#\n# To configure this workflow:\n#\n# 1. Configure environment variables\n# GitHub sets default environment variables for every workflow run.\n# Replace the variables relative to your project in the \"env\" section below.\n#\n# 2. Signing\n# Generate a signing certificate in the Windows Application\n# Packaging Project or add an existing signing certificate to the project.\n# Next, use PowerShell to encode the .pfx file using Base64 encoding\n# by running the following Powershell script to generate the output string:\n#\n# $pfx_cert = Get-Content '.\\SigningCertificate.pfx' -Encoding Byte\n# [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'\n#\n# Open the output file, SigningCertificate_Encoded.txt, and copy the\n# string inside. Then, add the string to the repo as a GitHub secret\n# and name it \"Base64_Encoded_Pfx.\"\n# For more information on how to configure your signing certificate for\n# this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing\n#\n# Finally, add the signing certificate password to the repo as a secret and name it \"Pfx_Key\".\n# See \"Build the Windows Application Packaging project\" below to see how the secret is used.\n#\n# For more information on GitHub Actions, refer to https://github.com/features/actions\n# For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,\n# refer to https://github.com/microsoft/github-actions-for-desktop-apps\n\nname: Installer\n\non:\n  workflow_dispatch:\n\njobs:\n\n  build:\n    strategy:\n      matrix:\n        configuration: [Release]\n\n    runs-on: windows-latest  # For a list of available runner types, refer to\n                             # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on\n\n    env:\n      Solution_Name: src/ProfileExplorer.sln                         # Replace with your solution name, i.e. MyWpfApp.sln.\n    steps:\n    - name: Checkout\n      uses: actions/checkout@v4\n      with:\n        submodules: 'recursive'\n\n    # Install the .NET Core workload\n    - name: Install .NET Core\n      uses: actions/setup-dotnet@v4\n      with:\n        dotnet-version: 8.0.x\n\n    # Add  MSBuild to the PATH: https://github.com/microsoft/setup-msbuild\n    - name: Setup MSBuild.exe\n      uses: microsoft/setup-msbuild@v2\n\n    - name: Install Inno Setup\n      shell: cmd\n      run: choco install innosetup\n\n    # Build the project and installer\n    - name: Build x64\n      shell: cmd\n      working-directory: installer\\x64\n      run: call prepare-out.cmd\n      env:\n        Configuration: ${{ matrix.configuration }}\n\n    - name: Create x64 installer\n      shell: cmd\n      working-directory: installer\\x64\n      run: call prepare-installer.cmd\n      env:\n        Configuration: ${{ matrix.configuration }}\n\n    - name: Build ARM64\n      shell: cmd\n      working-directory: installer\\arm64\n      run: call prepare-out.cmd\n      env:\n        Configuration: ${{ matrix.configuration }}\n\n    - name: Create ARM64 installer\n      shell: cmd\n      working-directory: installer\\arm64\n      run: call prepare-installer.cmd\n      env:\n        Configuration: ${{ matrix.configuration }}\n\n    - uses: actions/upload-artifact@v4\n      with:\n        name: Upload x64 output\n        path: installer\\x64\\out\\**\\*\n\n    - uses: actions/upload-artifact@v4\n      with:\n        name: Upload ARM64 output\n        path: installer\\arm64\\out\\**\\*\n\n    - uses: actions/upload-artifact@v4\n      with:\n        name: Upload x64 installer\n        path: installer\\x64\\*.exe\n\n    - uses: actions/upload-artifact@v4\n      with:\n        name: Upload ARM64 installer\n        path: installer\\arm64\\*.exe"
  },
  {
    "path": ".gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore\n\n# User-specific files\n*.rsuser\n*.suo\n*.user\n*.userosscache\n*.sln.docstates\n*.tlog\n*.lib\n*.dll\n*.exp\n*.recipe\n*.exe\n*.gz\n.vshistory/\n\n# Setup files\ninstaller/out*\ninstaller/publish*\n\n# User-specific files (MonoDevelop/Xamarin Studio)\n*.userprefs\n\n# Mono auto generated files\nmono_crash.*\n\n# Build results\n[Dd]ebug/\n[Dd]ebugPublic/\n[Rr]elease/\n[Rr]eleases/\nx64/\nx86/\n[Aa][Rr][Mm]/\n[Aa][Rr][Mm]64/\n!installer/*/\nbld/\n[Bb]in/\n[Oo]bj/\n[Ll]og/\n[Ll]ogs/\nvcpkg/\n\n# Visual Studio 2015/2017 cache/options directory\n.vs/\n# Uncomment if you have tasks that create the project's static files in wwwroot\n#wwwroot/\n\n# Visual Studio 2017 auto generated files\nGenerated\\ Files/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n# NUnit\n*.VisualState.xml\nTestResult.xml\nnunit-*.xml\n\n# Build Results of an ATL Project\n[Dd]ebugPS/\n[Rr]eleasePS/\ndlldata.c\n\n# Benchmark Results\nBenchmarkDotNet.Artifacts/\n\n# .NET Core\nproject.lock.json\nproject.fragment.lock.json\nartifacts/\n\n# StyleCop\nStyleCopReport.xml\n\n# Files built by Visual Studio\n*_i.c\n*_p.c\n*_h.h\n*.ilk\n*.meta\n*.obj\n*.iobj\n*.pch\n*.pdb\n*.ipdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*_wpftmp.csproj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.svclog\n*.scc\n\n# Chutzpah Test files\n_Chutzpah*\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opendb\n*.opensdf\n*.sdf\n*.cachefile\n*.VC.db\n*.VC.VC.opendb\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n*.sap\n\n# Visual Studio Trace Files\n*.e2e\n\n# TFS 2012 Local Workspace\n$tf/\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n*.DotSettings.user\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# AxoCover is a Code Coverage Tool\n.axoCover/*\n!.axoCover/settings.json\n\n# Visual Studio code coverage results\n*.coverage\n*.coveragexml\n\n# NCrunch\n_NCrunch_*\n.*crunch*.local.xml\nnCrunchTemp_*\n\n# MightyMoose\n*.mm.*\nAutoTest.Net/\n\n# Web workbench (sass)\n.sass-cache/\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.[Pp]ublish.xml\n*.azurePubxml\n# Note: Comment the next line if you want to checkin your web deploy settings,\n# but database connection strings (with potential passwords) will be unencrypted\n*.pubxml\n*.publishproj\n\n# Microsoft Azure Web App publish settings. Comment the next line if you want to\n# checkin your Azure Web App publish settings, but sensitive information contained\n# in these scripts will be unencrypted\nPublishScripts/\n\n# NuGet Packages\n*.nupkg\n# NuGet Symbol Packages\n*.snupkg\n# The packages folder can be ignored because of Package Restore\n**/[Pp]ackages/*\n# except build/, which is used as an MSBuild target.\n!**/[Pp]ackages/build/\n# Uncomment if necessary however generally it will be regenerated when needed\n#!**/[Pp]ackages/repositories.config\n# NuGet v3's project.json files produces more ignorable files\n*.nuget.props\n*.nuget.targets\n\n# Microsoft Azure Build Output\ncsx/\n*.build.csdef\n\n# Microsoft Azure Emulator\necf/\nrcf/\n\n# Windows Store app package directories and files\nAppPackages/\nBundleArtifacts/\nPackage.StoreAssociation.xml\n_pkginfo.txt\n*.appx\n*.appxbundle\n*.appxupload\n\n# Visual Studio cache files\n# files ending in .cache can be ignored\n*.[Cc]ache\n# but keep track of directories ending in .cache\n!?*.[Cc]ache/\n\n# Others\nClientBin/\n~$*\n*~\n*.dbmdl\n*.dbproj.schemaview\n*.jfm\n*.pfx\n*.publishsettings\norleans.codegen.cs\n\n# Including strong name files can present a security risk\n# (https://github.com/github/gitignore/pull/2483#issue-259490424)\n#*.snk\n\n# Since there are multiple workflows, uncomment next line to ignore bower_components\n# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)\n#bower_components/\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file\n# to a newer Visual Studio version. Backup files are not needed,\n# because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\nServiceFabricBackup/\n*.rptproj.bak\n\n# SQL Server files\n*.mdf\n*.ldf\n*.ndf\n\n# Business Intelligence projects\n*.rdl.data\n*.bim.layout\n*.bim_*.settings\n*.rptproj.rsuser\n*- [Bb]ackup.rdl\n*- [Bb]ackup ([0-9]).rdl\n*- [Bb]ackup ([0-9][0-9]).rdl\n\n# Microsoft Fakes\nFakesAssemblies/\n\n# GhostDoc plugin setting file\n*.GhostDoc.xml\n\n# Node.js Tools for Visual Studio\n.ntvs_analysis.dat\nnode_modules/\n\n# Visual Studio 6 build log\n*.plg\n\n# Visual Studio 6 workspace options file\n*.opt\n\n# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)\n*.vbw\n\n# Visual Studio LightSwitch build output\n**/*.HTMLClient/GeneratedArtifacts\n**/*.DesktopClient/GeneratedArtifacts\n**/*.DesktopClient/ModelManifest.xml\n**/*.Server/GeneratedArtifacts\n**/*.Server/ModelManifest.xml\n_Pvt_Extensions\n\n# Paket dependency manager\n.paket/paket.exe\npaket-files/\n\n# FAKE - F# Make\n.fake/\n\n# CodeRush personal settings\n.cr/personal\n\n# Python Tools for Visual Studio (PTVS)\n__pycache__/\n*.pyc\n\n# Cake - Uncomment if you are using it\n# tools/**\n# !tools/packages.config\n\n# Tabs Studio\n*.tss\n\n# Telerik's JustMock configuration file\n*.jmconfig\n\n# BizTalk build output\n*.btp.cs\n*.btm.cs\n*.odx.cs\n*.xsd.cs\n\n# OpenCover UI analysis results\nOpenCover/\n\n# Azure Stream Analytics local run output\nASALocalRun/\n\n# MSBuild Binary and Structured Log\n*.binlog\n\n# NVidia Nsight GPU debugger configuration file\n*.nvuser\n\n# MFractors (Xamarin productivity tool) working folder\n.mfractor/\n\n# Local History for Visual Studio\n.localhistory/\n\n# BeatPulse healthcheck temp database\nhealthchecksdb\n\n# Backup folder for Package Reference Convert tool in Visual Studio 2017\nMigrationBackup/\n\n# Ionide (cross platform F# VS Code tools) working folder\n.ionide/\nsrc/.idea\nsrc/GrpcCppLib/ReleaseStaticLib\n\n# Include test data files (allow all file types in TestData folder)\n!/src/ProfileExplorerCoreTests/TestData/**\n\n# Include some pre-built binaries\n!/src/external/*\n!/src/external/arm64/*\n\n# Don't include MCP-generated temporary files\nsrc/tmp/*\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"src/external/capstone\"]\n\tpath = src/external/capstone\n\turl = https://github.com/capstone-engine/capstone.git\n[submodule \"src/external/graphviz\"]\n\tpath = src/external/graphviz\n\turl = https://github.com/bgn64/graphviz.git\n[submodule \"src/external/tree-sitter/csharp-tree-sitter\"]\n\tpath = src/external/tree-sitter/csharp-tree-sitter\n\turl = https://github.com/bgn64/csharp-tree-sitter.git\n[submodule \"src/external/tree-sitter/tree-sitter-c-sharp\"]\n\tpath = src/external/tree-sitter/tree-sitter-c-sharp\n\turl = https://github.com/tree-sitter/tree-sitter-c-sharp.git\n[submodule \"src/external/tree-sitter/tree-sitter-rust\"]\n\tpath = src/external/tree-sitter/tree-sitter-rust\n\turl = https://github.com/tree-sitter/tree-sitter-rust.git\n"
  },
  {
    "path": "AGENTS.md",
    "content": "# Agent Instructions for Profile Explorer\n\n## Git Policy\n\n**NEVER commit or git add without explicit user permission.** When asked for a commit message, provide the message text only - do not execute `git commit` or `git add`.\n\n## Building\n\n**IMPORTANT: Always use Release configuration (`-c Release`). The user runs Release builds, not Debug.**\n\n### Before Building\nAlways check if ProfileExplorer is running before attempting a build - it locks the DLLs:\n\n```bash\ntasklist /FI \"IMAGENAME eq ProfileExplorer.exe\" 2>nul | find /i \"ProfileExplorer\"\n```\n\nIf running, ask the user to close it before building.\n\n### Build Commands\n```bash\n# Full UI build (Release)\ndotnet build \"C:/src/profile-explorer/src/ProfileExplorerUI/ProfileExplorerUI.csproj\" -c Release\n\n# Core library only (faster, for checking compilation)\ndotnet build \"C:/src/profile-explorer/src/ProfileExplorerCore/ProfileExplorerCore.csproj\" -c Release\n```\n\n### Iterative Development\nFor faster iteration when ProfileExplorer is running:\n1. Build just the Core project first to check for compilation errors\n2. Ask user to close ProfileExplorer\n3. Build the full UI project\n4. User can relaunch and test\n\nThe Core project build is much faster (~2-3s) and doesn't require ProfileExplorer to be closed.\n\n## Diagnostic Logging\n\nEnable diagnostic logging with:\n```powershell\n$env:PROFILE_EXPLORER_DEBUG = \"1\"\n```\n\nLogs are written to `%TEMP%\\ProfileExplorer_Diagnostic_*.log`\n\n### Analyzing Logs\nUse the analysis script (don't read raw logs - they're ~12MB):\n```powershell\nC:\\src\\profile-explorer\\scripts\\Analyze-DiagnosticLog.ps1 -LogPath <path-to-log>\n```\n\nOr grep for specific patterns:\n```bash\ngrep -i \"pattern\" <log-file> | head -30\n```\n\n## Key Files\n\n### Symbol Loading Performance\n- `ETWProfileDataProvider.cs` - Main symbol loading orchestration (~lines 759-1150)\n- `SymbolFileSourceSettings.cs` - Symbol settings including timeouts, filters, caching\n- `PEBinaryInfoProvider.cs` - Binary file downloading\n- `PDBDebugInfoProvider.cs` - PDB file downloading\n\n### Important Settings (SymbolFileSourceSettings)\n- `SymbolServerTimeoutSeconds` - Normal timeout (default: 10s)\n- `BellwetherTestEnabled` - Test symbol server health before bulk downloads\n- `BellwetherTimeoutSeconds` - Timeout for bellwether test (default: 5s)\n- `DegradedTimeoutSeconds` - Reduced timeout when server is slow (default: 3s)\n- `RejectPreviouslyFailedFiles` - Negative caching for failed downloads\n- `WindowsPathFilterEnabled` - Skip non-Windows binaries\n- `CompanyFilterEnabled` - Only load symbols for specific companies (e.g., Microsoft)\n"
  },
  {
    "path": "CLAUDE.md",
    "content": "# Claude Code Instructions for Profile Explorer\n\n## Git Policy\n\n**NEVER commit or git add without explicit user permission.** When asked for a commit message, provide the message text only - do not execute `git commit` or `git add`.\n\n## Building\n\n**IMPORTANT: Always use Release configuration (`-c Release`). The user runs Release builds, not Debug.**\n\n```bash\n# Full UI build (Release)\ndotnet build \"C:/src/profile-explorer/src/ProfileExplorerUI/ProfileExplorerUI.csproj\" -c Release\n\n# Core library only (faster, for checking compilation)\ndotnet build \"C:/src/profile-explorer/src/ProfileExplorerCore/ProfileExplorerCore.csproj\" -c Release\n```\n\n### Before Building\nCheck if ProfileExplorer is running before attempting a build - it locks the DLLs:\n\n```bash\ntasklist /FI \"IMAGENAME eq ProfileExplorer.exe\" 2>nul | find /i \"ProfileExplorer\"\n```\n\nIf running, ask the user to close it before building.\n\n## See Also\nSee `AGENTS.md` for more detailed instructions including:\n- Diagnostic logging setup\n- Key files for symbol loading\n- Important settings\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Microsoft Open Source Code of Conduct\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\n\r\nResources:\r\n\r\n- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)\r\n- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\r\n- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns\r\n- Employees can reach out at [aka.ms/opensource/moderation-support](https://aka.ms/opensource/moderation-support)"
  },
  {
    "path": "CONTRIBUTING.MD",
    "content": "# Contributing\n\nThis project welcomes contributions and suggestions. Most contributions require you to\nagree to a Contributor License Agreement (CLA) declaring that you have the right to,\nand actually do, grant us the rights to use your contribution. For details, visit\nhttps://cla.microsoft.com.\n\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need\nto provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the\ninstructions provided by the bot. You will only need to do this once across all repositories using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)\nor contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments."
  },
  {
    "path": "CodeQL.yml",
    "content": "path_classifiers:\n  library:\n    - \"**/src/external\""
  },
  {
    "path": "LICENSE.TXT",
    "content": "    MIT License\n\n    Copyright (c) Microsoft Corporation.\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE\n"
  },
  {
    "path": "NOTICE.md",
    "content": "NOTICES\n\nThis software incorporates material from third parties as listed below.\n\n---------------------------------------------------------\n\nAutoupdater.NET.Official - MIT\n\nCopyright 2012-2024 RBSoft\nCopyright (c) 2012-2024 RBSoft\nCopyright 2012-2024 RBSoft AutoUpdater.NET\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nAvalonEdit - MIT\n\nCopyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nAzure.Core - MIT\n\n(c) Microsoft Corporation\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nAzure.Identity - MIT\n\n(c) Microsoft Corporation\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nClosedXML - MIT\n\nCopyright 2013 The Carlito Project\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nClosedXML.Parser - MIT\n\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nCS-Script.Core - MIT\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDiffPlex - Apache-2.0\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \n\n      \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n      \n\n      \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n      \n\n      \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n      \n\n      \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n      \n\n      \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n      \n\n      \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n      \n\n      \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n      \n\n      \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n      (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\n\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\n\nlimitations under the License.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDirkster.AvalonDock - MS-PL\n\n\n(c) Microsoft 2023\n\n\nMs-PL\nMicrosoft Public License (Ms-PL)\n\nThis license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.\n\n1. Definitions\n\nThe terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the same meaning here as under U.S. copyright law.\n\nA \"contribution\" is the original software, or any additions or changes to the software.\n\nA \"contributor\" is any person that distributes its contribution under this license.\n\n\"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n2. Grant of Rights\n\n(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n\n(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n3. Conditions and Limitations\n\n(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n\n(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n\n(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n\n(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n\n(E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDirkster.AvalonDock.Themes.Aero - MS-PL\n\n\n(c) Microsoft 2023\n\n\nMs-PL\nMicrosoft Public License (Ms-PL)\n\nThis license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.\n\n1. Definitions\n\nThe terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the same meaning here as under U.S. copyright law.\n\nA \"contribution\" is the original software, or any additions or changes to the software.\n\nA \"contributor\" is any person that distributes its contribution under this license.\n\n\"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n2. Grant of Rights\n\n(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n\n(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n3. Conditions and Limitations\n\n(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n\n(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n\n(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n\n(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n\n(E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDirkster.AvalonDock.Themes.Metro - MS-PL\n\n\n(c) Microsoft 2023\n\n\nMs-PL\nMicrosoft Public License (Ms-PL)\n\nThis license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.\n\n1. Definitions\n\nThe terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the same meaning here as under U.S. copyright law.\n\nA \"contribution\" is the original software, or any additions or changes to the software.\n\nA \"contributor\" is any person that distributes its contribution under this license.\n\n\"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n2. Grant of Rights\n\n(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n\n(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n3. Conditions and Limitations\n\n(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n\n(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n\n(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n\n(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n\n(E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDirkster.AvalonDock.Themes.VS2010 - MS-PL\n\n(c) Microsoft 2023\n\n\nMs-PL\nMicrosoft Public License (Ms-PL)\n\nThis license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.\n\n1. Definitions\n\nThe terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the same meaning here as under U.S. copyright law.\n\nA \"contribution\" is the original software, or any additions or changes to the software.\n\nA \"contributor\" is any person that distributes its contribution under this license.\n\n\"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n2. Grant of Rights\n\n(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n\n(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n3. Conditions and Limitations\n\n(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n\n(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n\n(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n\n(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n\n(E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDirkster.AvalonDock.Themes.VS2013 - MS-PL\n\n(c) Microsoft 2023\n\n\nMs-PL\nMicrosoft Public License (Ms-PL)\n\nThis license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.\n\n1. Definitions\n\nThe terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the same meaning here as under U.S. copyright law.\n\nA \"contribution\" is the original software, or any additions or changes to the software.\n\nA \"contributor\" is any person that distributes its contribution under this license.\n\n\"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n2. Grant of Rights\n\n(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n\n(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n3. Conditions and Limitations\n\n(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n\n(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n\n(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n\n(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n\n(E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDotNetProjects.Extended.Wpf.Toolkit - MS-PL\n\nMicrosoft Public License (Ms-PL)\n\nThis license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.\n\n   1. Definitions\n\n   The terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the same meaning here as under U.S. copyright law. A \"contribution\" is the original software, or any additions or changes to the software. A \"contributor\" is any person that distributes its contribution under this license. \"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n   2. Grant of Rights\n\n      (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n\n      (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n   3. Conditions and Limitations\n\n      (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n\n      (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n\n      (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n\n      (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n\n      (E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nDotNetProjects.WpfToolkit.Input - MS-PL\n\nMicrosoft Public License (Ms-PL)\n\nThis license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.\n\n   1. Definitions\n\n   The terms \"reproduce,\" \"reproduction,\" \"derivative works,\" and \"distribution\" have the same meaning here as under U.S. copyright law. A \"contribution\" is the original software, or any additions or changes to the software. A \"contributor\" is any person that distributes its contribution under this license. \"Licensed patents\" are a contributor's patent claims that read directly on its contribution.\n\n   2. Grant of Rights\n\n      (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.\n\n      (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.\n\n   3. Conditions and Limitations\n\n      (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.\n\n      (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.\n\n      (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.\n\n      (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.\n\n      (E) The software is licensed \"as-is.\" You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nprotobuf-net - Apache-2.0\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \n\n      \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n      \n\n      \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n      \n\n      \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n      \n\n      \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n      \n\n      \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n      \n\n      \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n      \n\n      \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n      \n\n      \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n      (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\n\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\n\nlimitations under the License.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nprotobuf-net.Core - Apache-2.0\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \n\n      \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n      \n\n      \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n      \n\n      \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n      \n\n      \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n      \n\n      \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n      \n\n      \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n      \n\n      \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n      \n\n      \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n      (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\n\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\n\nlimitations under the License.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nGoogle.Protobuf - BSD-3-Clause\n\nCopyright 2015, Google Inc.\nCopyright 2015, Google Inc. Protocol Buffers Binary Serialization Format Google\n\nCopyright (c) <year> <owner> . All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n   1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n   2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n   3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nGrpc - Apache-2.0\n\nCopyright 2015 The gRPC\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \n\n      \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n      \n\n      \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n      \n\n      \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n      \n\n      \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n      \n\n      \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n      \n\n      \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n      \n\n      \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n      \n\n      \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n      (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\n\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\n\nlimitations under the License.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nGrpc.Core - Apache-2.0\n\n(c) 2006 Entrust, Inc.\nCopyright 2015 The gRPC\n(c) 1999 Entrust.net Limited\n(c) 2009 Entrust, Inc. - for\n(c) 2012 Entrust, Inc. - for\n(c) 2015 Entrust, Inc. - for\nCopyright (c) by P.J. Plauger\nCopyright 1995-2022 Mark Adler\nCopyright 1995-2022 Jean-loup Gailly and Mark Adler\n(c) 2006 Entrust, Inc. Label Entrust Root Certification\n(c) 1999 Entrust.net Limited Label Entrust.net Premium 2048 Secure Server CA Serial\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \n\n      \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n      \n\n      \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n      \n\n      \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n      \n\n      \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n      \n\n      \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n      \n\n      \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n      \n\n      \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n      \n\n      \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n      (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\n\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\n\nlimitations under the License.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nGrpc.Core.Api - Apache-2.0\n\nCopyright 2019 The gRPC\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \n\n      \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n      \n\n      \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n      \n\n      \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n      \n\n      \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n      \n\n      \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n      \n\n      \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n      \n\n      \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n      \n\n      \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n      (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\n\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\n\nlimitations under the License.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nGrpc.Tools - Apache-2.0\n\nCopyright 2018 The gRPC\nCopyright 2008 Google Inc.\n\nApache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \n\n      \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.\n\n      \n\n      \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.\n\n      \n\n      \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.\n\n      \n\n      \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\n\n      \n\n      \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\n\n      \n\n      \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).\n\n      \n\n      \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n      \n\n      \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:\n\n      (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS\n\nAPPENDIX: How to apply the Apache License to your work.\n\nTo apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.\n\nCopyright [yyyy] [name of copyright owner]\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\n\nyou may not use this file except in compliance with the License.\n\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\n\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\nSee the License for the specific language governing permissions and\n\nlimitations under the License.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nHtmlAgilityPack - MIT\n\n\nCopyright ZZZ Projects Inc.\nCopyright (c) ZZZ Projects Inc.\nCopyright ZZZ Projects Inc. Html Agility Pack\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nMicrosoft.Diagnostics.Tracing.TraceEvent - MIT\n\n\nCopyright Microsoft 2010\n(c) Microsoft Corporation\nCopyright 1995-2022 Mark Adler\nCopyright Microsoft 2010 TraceEvent\nCopyright Microsoft 2010 Serialization\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nMicrosoft.Xaml.Behaviors.Wpf - MIT\n\n\n(c) Microsoft Corporation\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nOxyPlot.Core - MIT\n\n\nCopyright (c) 2014 OxyPlot\n(c) 2009 by Charles Petzold\nCopyright GetNearestHit Portrait\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nOxyPlot.Wpf - MIT\n\n\n\nMIT License\n\nCopyright (c) <year> <copyright holders>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\ntree-sitter - MIT\nhttps://github.com/tree-sitter#readme\n\nCopyright (c) 2014-2023 Max Brunsfeld, Damien Guard, Amaan Qureshi, and contributors\n\nThe MIT License (MIT)\n\nCopyright (c) 2014-2023 Max Brunsfeld, Damien Guard, Amaan Qureshi, and contributors.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\ntree-sitter-cpp - MIT\nhttps://github.com/tree-sitter/tree-sitter-cpp#readme\n\nCopyright (c) 2014 Max Brunsfeld\nCopyright (c) 2021, tree-sitter-cpp\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Max Brunsfeld\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\ntree-sitter-c-sharp - MIT\nhttps://github.com/tree-sitter/tree-sitter-c-sharp#readme\n\nCopyright (c) 2014-2023 Max Brunsfeld, Damien Guard, Amaan Qureshi, and contributors\n\nThe MIT License (MIT)\n\nCopyright (c) 2014-2023 Max Brunsfeld, Damien Guard, Amaan Qureshi, and contributors.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\ntree-sitter-rust - MIT\nhttps://github.com/tree-sitter/tree-sitter-rust#readme\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Maxim Sokolov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\ngraphviz - Eclipse Public License - v 1.0\nhttps://gitlab.com/graphviz/graphviz#readme\n\nEclipse Public License - v 1.0\n\nTHE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC\nLICENSE (\"AGREEMENT\"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM\nCONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.\n\n1. DEFINITIONS\n\n\"Contribution\" means:\n\na) in the case of the initial Contributor, the initial code and documentation\n   distributed under this Agreement, and\nb) in the case of each subsequent Contributor:\n    i) changes to the Program, and\n   ii) additions to the Program;\n\n   where such changes and/or additions to the Program originate from and are\n   distributed by that particular Contributor. A Contribution 'originates' from\n   a Contributor if it was added to the Program by such Contributor itself or\n   anyone acting on such Contributor's behalf. Contributions do not include\n   additions to the Program which: (i) are separate modules of software\n   distributed in conjunction with the Program under their own license\n   agreement, and (ii) are not derivative works of the Program.\n\n\"Contributor\" means any person or entity that distributes the Program.\n\n\"Licensed Patents\" mean patent claims licensable by a Contributor which are\nnecessarily infringed by the use or sale of its Contribution alone or when\ncombined with the Program.\n\n\"Program\" means the Contributions distributed in accordance with this Agreement.\n\n\"Recipient\" means anyone who receives the Program under this Agreement,\nincluding all Contributors.\n\n2. GRANT OF RIGHTS\n  a) Subject to the terms of this Agreement, each Contributor hereby grants\n     Recipient a non-exclusive, worldwide, royalty-free copyright license to\n     reproduce, prepare derivative works of, publicly display, publicly perform,\n     distribute and sublicense the Contribution of such Contributor, if any, and\n     such derivative works, in source code and object code form.\n  b) Subject to the terms of this Agreement, each Contributor hereby grants\n     Recipient a non-exclusive, worldwide, royalty-free patent license under\n     Licensed Patents to make, use, sell, offer to sell, import and otherwise\n     transfer the Contribution of such Contributor, if any, in source code and\n     object code form. This patent license shall apply to the combination of the\n     Contribution and the Program if, at the time the Contribution is added by\n     the Contributor, such addition of the Contribution causes such combination\n     to be covered by the Licensed Patents. The patent license shall not apply\n     to any other combinations which include the Contribution. No hardware per\n     se is licensed hereunder.\n  c) Recipient understands that although each Contributor grants the licenses to\n     its Contributions set forth herein, no assurances are provided by any\n     Contributor that the Program does not infringe the patent or other\n     intellectual property rights of any other entity. Each Contributor\n     disclaims any liability to Recipient for claims brought by any other entity\n     based on infringement of intellectual property rights or otherwise. As a\n     condition to exercising the rights and licenses granted hereunder, each\n     Recipient hereby assumes sole responsibility to secure any other\n     intellectual property rights needed, if any. For example, if a third party\n     patent license is required to allow Recipient to distribute the Program, it\n     is Recipient's responsibility to acquire that license before distributing\n     the Program.\n  d) Each Contributor represents that to its knowledge it has sufficient\n     copyright rights in its Contribution, if any, to grant the copyright\n     license set forth in this Agreement.\n\n3. REQUIREMENTS\n\nA Contributor may choose to distribute the Program in object code form under its\nown license agreement, provided that:\n\n  a) it complies with the terms and conditions of this Agreement; and\n  b) its license agreement:\n      i) effectively disclaims on behalf of all Contributors all warranties and\n         conditions, express and implied, including warranties or conditions of\n         title and non-infringement, and implied warranties or conditions of\n         merchantability and fitness for a particular purpose;\n     ii) effectively excludes on behalf of all Contributors all liability for\n         damages, including direct, indirect, special, incidental and\n         consequential damages, such as lost profits;\n    iii) states that any provisions which differ from this Agreement are offered\n         by that Contributor alone and not by any other party; and\n     iv) states that source code for the Program is available from such\n         Contributor, and informs licensees how to obtain it in a reasonable\n         manner on or through a medium customarily used for software exchange.\n\nWhen the Program is made available in source code form:\n\n  a) it must be made available under this Agreement; and\n  b) a copy of this Agreement must be included with each copy of the Program.\n     Contributors may not remove or alter any copyright notices contained within\n     the Program.\n\nEach Contributor must identify itself as the originator of its Contribution, if\nany, in a manner that reasonably allows subsequent Recipients to identify the\noriginator of the Contribution.\n\n4. COMMERCIAL DISTRIBUTION\n\nCommercial distributors of software may accept certain responsibilities with\nrespect to end users, business partners and the like. While this license is\nintended to facilitate the commercial use of the Program, the Contributor who\nincludes the Program in a commercial product offering should do so in a manner\nwhich does not create potential liability for other Contributors. Therefore, if\na Contributor includes the Program in a commercial product offering, such\nContributor (\"Commercial Contributor\") hereby agrees to defend and indemnify\nevery other Contributor (\"Indemnified Contributor\") against any losses, damages\nand costs (collectively \"Losses\") arising from claims, lawsuits and other legal\nactions brought by a third party against the Indemnified Contributor to the\nextent caused by the acts or omissions of such Commercial Contributor in\nconnection with its distribution of the Program in a commercial product\noffering. The obligations in this section do not apply to any claims or Losses\nrelating to any actual or alleged intellectual property infringement. In order\nto qualify, an Indemnified Contributor must: a) promptly notify the Commercial\nContributor in writing of such claim, and b) allow the Commercial Contributor to\ncontrol, and cooperate with the Commercial Contributor in, the defense and any\nrelated settlement negotiations. The Indemnified Contributor may participate in\nany such claim at its own expense.\n\nFor example, a Contributor might include the Program in a commercial product\noffering, Product X. That Contributor is then a Commercial Contributor. If that\nCommercial Contributor then makes performance claims, or offers warranties\nrelated to Product X, those performance claims and warranties are such\nCommercial Contributor's responsibility alone. Under this section, the\nCommercial Contributor would have to defend claims against the other\nContributors related to those performance claims and warranties, and if a court\nrequires any other Contributor to pay any damages as a result, the Commercial\nContributor must pay those damages.\n\n5. NO WARRANTY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR\nIMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,\nNON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each\nRecipient is solely responsible for determining the appropriateness of using and\ndistributing the Program and assumes all risks associated with its exercise of\nrights under this Agreement , including but not limited to the risks and costs\nof program errors, compliance with applicable laws, damage to or loss of data,\nprograms or equipment, and unavailability or interruption of operations.\n\n6. DISCLAIMER OF LIABILITY\n\nEXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY\nCONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST\nPROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\nSTRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\nOUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS\nGRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n\n7. GENERAL\n\nIf any provision of this Agreement is invalid or unenforceable under applicable\nlaw, it shall not affect the validity or enforceability of the remainder of the\nterms of this Agreement, and without further action by the parties hereto, such\nprovision shall be reformed to the minimum extent necessary to make such\nprovision valid and enforceable.\n\nIf Recipient institutes patent litigation against any entity (including a\ncross-claim or counterclaim in a lawsuit) alleging that the Program itself\n(excluding combinations of the Program with other software or hardware)\ninfringes such Recipient's patent(s), then such Recipient's rights granted under\nSection 2(b) shall terminate as of the date such litigation is filed.\n\nAll Recipient's rights under this Agreement shall terminate if it fails to\ncomply with any of the material terms or conditions of this Agreement and does\nnot cure such failure in a reasonable period of time after becoming aware of\nsuch noncompliance. If all Recipient's rights under this Agreement terminate,\nRecipient agrees to cease use and distribution of the Program as soon as\nreasonably practicable. However, Recipient's obligations under this Agreement\nand any licenses granted by Recipient relating to the Program shall continue and\nsurvive.\n\nEveryone is permitted to copy and distribute copies of this Agreement, but in\norder to avoid inconsistency the Agreement is copyrighted and may only be\nmodified in the following manner. The Agreement Steward reserves the right to\npublish new versions (including revisions) of this Agreement from time to time.\nNo one other than the Agreement Steward has the right to modify this Agreement.\nThe Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation\nmay assign the responsibility to serve as the Agreement Steward to a suitable\nseparate entity. Each new version of the Agreement will be given a\ndistinguishing version number. The Program (including Contributions) may always\nbe distributed subject to the version of the Agreement under which it was\nreceived. In addition, after a new version of the Agreement is published,\nContributor may elect to distribute the Program (including its Contributions)\nunder the new version. Except as expressly stated in Sections 2(a) and 2(b)\nabove, Recipient receives no rights or licenses to the intellectual property of\nany Contributor under this Agreement, whether expressly, by implication,\nestoppel or otherwise. All rights in the Program not expressly granted under\nthis Agreement are reserved.\n\nThis Agreement is governed by the laws of the State of New York and the\nintellectual property laws of the United States of America. No party to this\nAgreement will bring a legal action under this Agreement more than one year\nafter the cause of action arose. Each party waives its rights to a jury trial in\nany resulting litigation.\n\nPrimary contact. Please submit patches or enhancements to\nhttps://gitlab.com/graphviz/graphviz\n\n---------------\nPrimary Authors: (In alphabetical order.)\n\n    John Ellson  <john.ellson@comcast.net>\n    Emden Gansner <erg@research.att.com>\n    Yifan Hu <yifanhu@research.att.com>\n    Stephen North <north@research.att.com>\n\nAuxiliary Authors: (In alphabetical order.)\n\n    Don Caldwell <dfwc@reserach.att.com>\n    David Dobkin <dpd@cs.princeton.edu>\n    Tim Dwyer <tgdwyer@gmail.com>\n    Eleftherios Koutsofios <ek@research.att.com>\n    Kiem-Phong Vo <kpv@research.att.com>\n    Gordon Woodhull <gmcw@worldnet.att.net>\n\n---------------\n\nSee https://graphviz.org/credits/ for further information.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\ncapstone - BSD\nhttps://github.com/capstone-engine/capstone#readme\n\nThis is the software license for Capstone disassembly framework.\nCapstone has been designed & implemented by Nguyen Anh Quynh <aquynh@gmail.com>\n\nSee http://www.capstone-engine.org for further information.\n\nCopyright (c) 2013, COSEINC.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice,\n  this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n* Neither the name of the developer(s) nor the names of its\n  contributors may be used to endorse or promote products derived from this\n  software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.\n\n---------------------------------------------------------\n\n---------------------------------------------------------\n\nTreeListView - Apache-2.0\nhttps://github.com/hazzik/TreeListView#readme\n\nApache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n   \n---------------------------------------------------------\n\n---------------------------------------------------------\n\nocticons - MIT\nhttps://github.com/primer/octicons#readme\n\nMIT License\n\nCopyright (c) 2024 GitHub Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "README.md",
    "content": "## Profile Explorer\r\n[![Static Badge](https://img.shields.io/badge/Download-x64-orange)](https://github.com/microsoft/profile-explorer/releases/latest/download/profile_explorer_installer_x64.exe)\r\n[![Static Badge](https://img.shields.io/badge/Download-ARM64-orange)](https://github.com/microsoft/profile-explorer/releases/latest/download/profile_explorer_installer_arm64.exe)\r\n[![Static Badge](https://img.shields.io/badge/Documentation-blue)](https://microsoft.github.io/profile-explorer/)\r\n\r\nProfile Explorer is a tool for viewing CPU profiling traces collected through the [Event Tracing for Windows (ETW)](https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-) infrastructure on machines with x64 and ARM64 CPUs. Its focus is on presenting the slowest parts of the profiled application through an easy-to-use but detailed UI consisting of several views, such as a hot function list, flame graph, call tree, timeline, assembly code view, and source file view.  \r\n\r\nThe application can be viewed as a companion to [Windows Performance Analyzer (WPA)](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer), offering some unique features based on the binary analysis it performs and the IDE-like UI, such as easy navigation through disassembly, improved mapping to source lines, displaying the function control-flow graph, viewing of multiple functions at the same time, marking, searching, filtering and much more.  \r\n\r\nOne of the app's key advantages is its performance. It loads traces fast and offers near-instant UI interaction, even for very large traces (over 10 GB ETL files). Most profile processing steps and algorithms are multi-threaded and don't block the UI.\r\n\r\n#### Summary, Flame Graph and Timeline views of a trace:\r\n<img width=\"884\" alt=\"image\" src=\"https://github.com/user-attachments/assets/dff9ddd1-e3e1-4063-bd29-65419786527e\">\r\n\r\n#### Assembly, Source File and Flow Graph views of a function:\r\n<img width=\"886\" alt=\"image\" src=\"https://github.com/user-attachments/assets/dac21739-49ba-4274-9d12-e0a1b4937bdf\">\r\n\r\n#### Video introduction\r\n\r\nhttps://github.com/user-attachments/assets/d9a281d3-dc92-4cbe-a3e5-80c4588676a2\r\n\r\n### ⬇️ Download\r\n\r\nInstallers for the latest version:\r\n- [x64 installer](https://github.com/microsoft/profile-explorer/releases/latest/download/profile_explorer_installer_x64.exe)\r\n- [ARM64 installer](https://github.com/microsoft/profile-explorer/releases/latest/download/profile_explorer_installer_arm64.exe)\r\n\r\nUse the ARM64 installer if you have a machine with an ARM64 CPU, since it includes a native build of the app (no emulation), otherwise use the x64 installer. Note that the x64 app can open traces taken on ARM64 machines and vice versa.  \r\n\r\nThe app also has a built-in auto-update feature that will notify you when a new version is released and offer to download and install it.  \r\nThe installers for previous versions can be downloaded from the [Releases](https://github.com/microsoft/profile-explorer/releases) page.  \r\n\r\n### 📖 Documentation\r\n\r\nThe documentation pages are available here:  \r\n#### [https://microsoft.github.io/profile-explorer](https://microsoft.github.io/profile-explorer/)\r\n\r\nThe app also has a built-in *Help panel* that can display the same documentation.  \r\nMost views have a *question mark* icon in the upper-right corner that opens the *Help panel* on the view's documentation page. \r\n\r\n### 🛠️ Building\r\n\r\nTo build the application and its external dependencies, ensure the following build tools are installed on a Windows 11 machine:  \r\n- recent Visual Studio 2022 with the following workflows:\r\n\t- *.NET desktop development*\r\n\t- *Desktop development with C++*\r\n\t- *C++ ARM64/ARM64EC build tools (Latest)* - for native ARM64 builds\r\n- [.NET 8.0 SDK ](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) (should be installed by Visual Studio 2022 already)\r\n\r\nFrom a an *admin* command-line window, run:  \r\n- ```build.cmd [debug|release]``` for an x64 build.  \r\n- ```build-arm64.cmd [debug|release]``` for a native ARM64 build.  \r\n\r\nThe debug or release build mode is used for the main project; external dependencies are always built in release mode. The admin mode for the command-line is required to register msdia140.dll using regsvr32; it needs to be done once on a machine.  \r\n\r\nThe build script will update the git submodules, build the main project and external dependencies, and then copy the built dependencies and other resources to the output directory.  \r\n\r\nThe output directory with *ProfileExplorer.exe* will be found at:  \r\n ```src\\ProfileExplorerUI\\bin\\[Debug|Release]\\net8.0-windows```.  \r\n\r\nAfter the initial build, open the solution file ```src\\ProfileExplorer.sln``` and use the *ProfileExplorerUI* project as the build and startup target.\r\n\r\n### 📦 Publishing and creating the installer\r\n\r\nTo publish the application and create an installer, from a command-line window run:  \r\n- ```installer\\x64\\prepare.cmd``` for an x64 build.  \r\n- ```installer\\arm64\\prepare.cmd``` for a native arm64 build.  \r\n\r\nThis will build the main project as a self-contained application, build the external dependencies, and create the installer executable, with build output files found at:  \r\n\r\n- ```installer\\[x64|arm64]\\out```  \r\n- ```installer\\[x64|arm64]\\profile_explorer_installer_VERSION.exe```\r\n\r\nCurrently [InnoSetup](https://jrsoftware.org/isdl.php) is used to create the installer and it must be already installed on the machine and *iscc.exe* found on *PATH*.\r\n\r\n### 📑 Project structure\r\n\r\nBelow is a high-level overview of the main parts of the application.\r\n\r\n| Location | Description |\r\n| --- | --- |\r\n| src/ProfileExplorerUI | The main project and application UI, implemented using WPF. |\r\n| src/ProfileExplorerCore | The UI-independent part that defines the intermediate representation (IR), parsing functions, Graphviz and Tree Sitter support, various data structures, algorithms and utilities. |\r\n| src/ProfileExplorerUITests | Unit tests for the ProfileExplorerUI project. |\r\n| src/ProfileExplorerCoreTests | Unit tests for the ProfileExplorerCore project. |\r\n| src/ManagedProfiler | .NET JIT profiler extension for capturing JIT output assembly code. |\r\n| src/PDBViewer | A small utility displaying the contents of PDB debug info files, implemented using WinForms. |\r\n| src/VSExtension | A Visual Studio extension that connects to the application. Not used for profiling functionality. |\r\n| src/GrpcLib | Defines the GRPC protobuf format used by the Visual Studio extension to communicate with the application. Not used for profiling functionality. |\r\n\r\nThe following projects are build from source, as either x64 or native arm64 binaries.\r\n\r\n| Location | Description |\r\n| --- | --- |\r\n| src/external/capstone | [Capstone](https://github.com/capstone-engine/capstone) disassembly framework, submodule. |\r\n| src/external/graphviz | [Graphviz](https://gitlab.com/graphviz/graphviz) graph visualization tools, submodule. |\r\n| src/external/tree-sitter | [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) parser generator, with support for C/C++, C# and Rust, submodules. |\r\n| src/external/TreeListView | [TreeListView](https://github.com/hazzik/TreeListView), WPF tree list view control. |\r\n\r\n### Profiling architecture\r\n\r\n<img src=\"https://github.com/user-attachments/assets/77e00a73-4810-4155-b656-a356fff8ba3b\" width=70% height=70%>  \r\n\r\n- Profiling UI compoments are independent from the profiling trace source.  \r\n- Loading the trace produces a set of profile samples and associated call stacks – building blocks for the call tree, flame graph, function list, assembly view.  \r\n- Debuging info (PDB) files are downloaded in parallel, source line info read on-demand per function.  \r\n- Binary disassembly done on-demand per function.  \r\n- Initial trace processing and subsequent filtering is multi-threaded.  \r\n- UI updates are mostly async and multi-threaded.  \r\n- Opening binaries without a profiling trace is supported.  \r\n\r\n### History\r\n\r\nThe application started as a tool for helping compiler developers interact with and better understand a compiler's [intermediate representation (IR)](https://en.wikipedia.org/wiki/Intermediate_representation). After adding simple support for viewing profile traces, it gradually gained more profiling features and primarily became a profile viewer.  \r\n\r\nThe tool's initial focus on compilers has led to some distinctive features, such as the ability to parse assembly code into an internal IR. This enables an interactive view of assembly code and the visualization of control-flow graphs, for example.\r\n\r\n### Contributing\r\n\r\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n\r\n### Trademarks\r\n\r\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \r\ntrademarks or logos is subject to and must follow \r\n[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\r\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\r\nAny use of third-party trademarks or logos are subject to those third-party's policies.\r\n"
  },
  {
    "path": "SECURITY.md",
    "content": "<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->\r\n\r\n## Security\r\n\r\nMicrosoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).\r\n\r\nIf you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.\r\n\r\n## Reporting Security Issues\r\n\r\n**Please do not report security vulnerabilities through public GitHub issues.**\r\n\r\nInstead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).\r\n\r\nIf you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).  If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).\r\n\r\nYou should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). \r\n\r\nPlease include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:\r\n\r\n  * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)\r\n  * Full paths of source file(s) related to the manifestation of the issue\r\n  * The location of the affected source code (tag/branch/commit or direct URL)\r\n  * Any special configuration required to reproduce the issue\r\n  * Step-by-step instructions to reproduce the issue\r\n  * Proof-of-concept or exploit code (if possible)\r\n  * Impact of the issue, including how an attacker might exploit the issue\r\n\r\nThis information will help us triage your report more quickly.\r\n\r\nIf you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.\r\n\r\n## Preferred Languages\r\n\r\nWe prefer all communications to be in English.\r\n\r\n## Policy\r\n\r\nMicrosoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).\r\n\r\n<!-- END MICROSOFT SECURITY.MD BLOCK -->"
  },
  {
    "path": "build-arm64.cmd",
    "content": "@echo off\nsetlocal\n\nset _BUILD_TARGET=\"src\\ProfileExplorerUI\\ProfileExplorerUI.csproj\"\nset _FRAMEWORK_PATH=net8.0-windows\nset _PROFILER_PATH=\"src\\ManagedProfiler\"\nset _EXTERNALS_PATH=\"src\\external\"\nset _EXTERNALS_PATH_ARM64=\"..\\..\\src\\external\\arm64\"\nset _RESOURCES_PATH=\"..\\..\\resources\"\n\nif \"%1\"==\"\" (\n    echo \"Usage: build.bat [debug|release]\"\n\techo \"Defaulting to Release mode...\"\n)\n\nset _CONFIG=%1\n\nif /I \"%_CONFIG%\"==\"debug\" (\n\tset _BUILD_CONFIG=Debug\n    echo Building in Debug mode...\n) else if /I \"%_CONFIG%\"==\"release\" (\n\tset _BUILD_CONFIG=Release\n    echo Building in Release mode...\n) else (\n    set _BUILD_CONFIG=Release\n    echo Building in Release mode...\n)\n\nset _OUT_PATH=\"src\\ProfileExplorerUI\\bin\\%_BUILD_CONFIG%\\%_FRAMEWORK_PATH%\"\necho %_OUT_PATH%\n\nrem Update git submodules for external projects\ngit submodule update --init --recursive\n\nrem Build main project\ndotnet restore %_BUILD_TARGET%\ndotnet build -c %_BUILD_CONFIG% %_BUILD_TARGET% /p:Platform=AnyCPU\n\nfor /f \"delims=\" %%i in ('\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -all -prerelease -property installationPath') do set _VS=%%i\nset _VS_ENV=%_VS%\\VC\\Auxiliary\\Build\\vcvarsamd64_arm64.bat\ncall \"%_VS_ENV%\"\n\nrem Build external projects\npushd %_EXTERNALS_PATH%\ncall build-external-arm64.cmd\npopd\n\nrem Build managed profiler\nmsbuild %_PROFILER_PATH%\\ManagedProfiler.vcxproj /t:Rebuild /p:Configuration=Release /p:Platform=arm64\ncopy %_PROFILER_PATH%\\arm64\\Release\\ManagedProfiler.dll %_OUT_PATH%\n\nrem Copy over native DLLs and other resources\nxcopy %_RESOURCES_PATH% %_OUT_PATH% /i /c /e /y\nxcopy %_EXTERNALS_PATH_ARM64%\\*.dll %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH_ARM64%\\config6 %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH%\\tree-sitter\\build_arm64\\*.dll %_OUT_PATH% /i /c /y\ncopy %_EXTERNALS_PATH%\\capstone\\build_arm64\\Release\\capstone.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\cmd\\dot\\Release\\dot.exe %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\cdt\\Release\\cdt.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\cgraph\\Release\\cgraph.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\gvc\\Release\\gvc.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\pathplan\\Release\\pathplan.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\xdot\\Release\\xdot.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\plugin\\core\\Release\\gvplugin_core.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\plugin\\dot_layout\\Release\\gvplugin_dot_layout.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\zlib1.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\libexpat.dll %_OUT_PATH%\n\nrem Register msdia140.dll\nregsvr32 /s %_OUT_PATH%\\msdia140.dll"
  },
  {
    "path": "build.cmd",
    "content": "@echo off\nsetlocal\n\nset _BUILD_TARGET=\"src\\ProfileExplorerUI\\ProfileExplorerUI.csproj\"\nset _FRAMEWORK_PATH=net8.0-windows\nset _PROFILER_PATH=\"src\\ManagedProfiler\"\nset _EXTERNALS_PATH=\"src\\external\"\nset _RESOURCES_PATH=\"..\\..\\resources\"\n\nif \"%1\"==\"\" (\n    echo \"Usage: build.bat [debug|release]\"\n\techo \"Defaulting to Release mode...\"\n)\n\nset _CONFIG=%1\n\nif /I \"%_CONFIG%\"==\"debug\" (\n\tset _BUILD_CONFIG=Debug\n    echo Building in Debug mode...\n) else if /I \"%_CONFIG%\"==\"release\" (\n\tset _BUILD_CONFIG=Release\n    echo Building in Release mode...\n) else (\n    set _BUILD_CONFIG=Release\n    echo Building in Release mode...\n)\n\nset _OUT_PATH=\"src\\ProfileExplorerUI\\bin\\%_BUILD_CONFIG%\\%_FRAMEWORK_PATH%\"\necho %_OUT_PATH%\n\nrem Update git submodules for external projects\ngit submodule update --init --recursive\n\nrem Build main project\ndotnet restore %_BUILD_TARGET%\ndotnet build -c %_BUILD_CONFIG% %_BUILD_TARGET% /p:Platform=AnyCPU\n\nfor /f \"delims=\" %%i in ('\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -all -prerelease -property installationPath') do set _VS=%%i\nset _VS_ENV=%_VS%\\VC\\Auxiliary\\Build\\vcvars64.bat\ncall \"%_VS_ENV%\"\n\nrem Build external projects\npushd %_EXTERNALS_PATH%\ncall build-external.cmd\npopd\n\nrem Build managed profiler\nmsbuild %_PROFILER_PATH%\\ManagedProfiler.vcxproj /t:Rebuild /p:_CONFIG=Release /p:Platform=x64\n\nrem Copy over native DLLs and other resources\nxcopy %_RESOURCES_PATH% %_OUT_PATH% /i /c /e /y\nxcopy %_EXTERNALS_PATH%\\config6 %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH%\\*.dll %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH%\\tree-sitter\\build\\*.dll %_OUT_PATH% /i /c /y\ncopy %_EXTERNALS_PATH%\\capstone\\build\\Release\\capstone.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\cmd\\dot\\Release\\dot.exe %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\cdt\\Release\\cdt.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\cgraph\\Release\\cgraph.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\gvc\\Release\\gvc.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\pathplan\\Release\\pathplan.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\xdot\\Release\\xdot.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\plugin\\core\\Release\\gvplugin_core.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\plugin\\dot_layout\\Release\\gvplugin_dot_layout.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\zlib1.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\libexpat.dll %_OUT_PATH%\n\nrem Register msdia140.dll\nregsvr32 /s %_OUT_PATH%\\msdia140.dll"
  },
  {
    "path": "docs/build.cmd",
    "content": "pip install mkdocs\npip install mkdocs-material\nmkdocs build"
  },
  {
    "path": "docs/docs/about.md",
    "content": "#### Overview\n\nProfile Explorer is a tool for viewing CPU profiling traces collected through the [Event Tracing for Windows (ETW)]((https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw-)) infrastructure on machines with x64 and ARM64 CPUs. Its focus is on presenting the slowest parts of the profiled application through an easy-to-use but detailed UI consisting of several views, such as slow functions list, flame graph, call tree, timeline, assembly code view, and *Source File* view.  \n\nThe app offers some unique features based on the binary analysis it performs and the IDE-like UI, such as easy navigation through disassembly, improved mapping to source lines, displaying the function [control-flow graph](https://en.wikipedia.org/wiki/Control-flow_graph), viewing of multiple functions at the same time, marking, searching, filtering and much more.  \n\nOne of the app's key advantages is its performance. It loads traces fast and offers near-instant UI interaction, even for very large traces (over 10 GB ETL files). Most profile processing steps and algorithms are multi-threaded and don't block the UI.\n\n#### Automatic updates\n\nThe app includes an auto-update feature that notifies you when a new version is available and offers to download and install it.\n\nWhen the app starts, if a new version is available, an *Update Available* button is displayed in the status bar. *Click* on it to see the release notes and install the update.\n\n![](img/update-ckeck.png){:style=\"width:400px\"}\n\n#### Download\n\nInstallers for the latest version:  \n\n- [x64 installer](https://github.com/microsoft/profile-explorer/releases/latest/download/profile_explorer_installer_x64.exe)  \n- [ARM64 installer](https://github.com/microsoft/profile-explorer/releases/latest/download/profile_explorer_installer_arm64.exe)\n\nUse the ARM64 installer if you have a machine with an ARM64 CPU, since it includes a native build of the app (no emulation), otherwise use the x64 installer. Note that the x64 app can open traces recorded on ARM64 machines and vice versa.  \n\nThe installers for previous versions can be downloaded from the [Releases](https://github.com/microsoft/profile-explorer/releases) page.  "
  },
  {
    "path": "docs/docs/assembly-view.md",
    "content": "#### Overview\n\nThe Assembly view shows the function's machine code after disassembly, with syntax highlighting for x86_64/ARM64 architectures. The view is interactive, with the text being parsed into instructions with operands and higher-level constructs such as [basic blocks](https://en.wikipedia.org/wiki/Basic_block) and loops are recovered.\n\nThe assembly instructions are augmented with annotations from the debug info files, such as source line numbers and inlinees, and combined with the execution time from the profile trace.\n\n[![Profiling UI screenshot](img/assembly-view_1164x473.png)](img/assembly-view_1164x473.png){:target=\"_blank\"}\n\nThe view has four parts:  \n\n- a main toolbar at the top, with general action buttons.\n- a secondary toolbar underneath with profiling-specific info and action buttons.\n- the text view with the function's assembly.\n- several columns on the right side with the profiling data for each instruction. If CPU performance counters are found and loaded from the trace, the additional columns with metrics and the counters are appended after the last column.  \n\n???+ note\n    When a function is opened in the *Assembly* view, its corresponding source file is automatically loaded in the *Source File* view and its [control-flow graph (CFG)](https://en.wikipedia.org/wiki/Control-flow_graph) displayed in the *Flow Graph* view.<br>\n    [![Profiling UI screenshot](img/assembly-source_1073x279.png)](img/assembly-source_1073x279.png){:target=\"_blank\"}\n\n#### Assembly text view\n\nThe function assembly area can be treated a read-only code editor. Each line corresponds to one instruction, with the following values from left to right:\n\n[![Profiling UI screenshot](img/assembly-line_1018x41.png)](img/assembly-line_1018x41.png){:target=\"_blank\"}\n\n- instruction number (line number in the text).\n- optional marking icon for call targets.\n- instruction virtual address (blue text).\n- instruction opcode (bold text).\n- an optional list of instruction operands.\n- source line number associated with the instruction, obtained from the debug info (gray text).\n- inlinees (inlined functions) associated with the instruction, obtained from the debug info (green text).\n- profiling data columns, such as the execution time percentage and value.\n\n##### Source lines\n\nThe debug info files usually contain a mapping between the source line numbers and the instructions that were generated for those lines. The source line number is appended at the end of an instruction if available. Note that the accuracy of this mapping usually depends on the compiler optimization level, with higher levels being less accurate or even lacking the mapping for some instructions.  \n\n*Hovering* over the line number shows a tooltip with the name and path of the source file. To copy this info to clipboard, first *click* the line number, then press *Ctrl+C*.  \n\n[![Profiling UI screenshot](img/assemlby-line-number_816x106.png){: style=\"width:500px\"}](img/assemlby-line-number_816x106.png){:target=\"_blank\"}  \n\n???+ note\n    *Click* on an instruction selects and brings into view its corresponding source line in the *Source File* view and its basic block in the *Flow Graph* view.  \n    \n##### Inlinees\n\nWhen a function is inlined, the compiler may keep extra details about the function code that is being inlined so that the original location of an instruction can be saved into the debug info file. If available, the inlined functions are added after the source line number, separated by the \"|\" letter.\n\nFor example, if a function contains a call chain like \"foo() -> bar()\", and both calls are inlined, the final instructions will indicate that they come from \"bar\", which was inlined into \"foo\", and then \"foo\" was inlined into the function.\n\n*Hovering* over the inlined function shows a tooltip with the call path (stack trace) of the functions inlined at that point. To copy this information to the clipboard, first *click* the inlined function, then press *Ctrl+C*.\n\n[![Profiling UI screenshot](img/assembly-inlinees_926x222.png){: style=\"width:500px\"}](img/assembly-inlinees_926x222.png){:target=\"_blank\"}\n\n##### Basic blocks\n\nThe assembly is parsed and analyzed to recover the function's [control-flow graph (CFG)](https://en.wikipedia.org/wiki/Control-flow_graph), identifying [basic blocks](https://en.wikipedia.org/wiki/Basic_block) and loops. This information is used to split the assembly text into basic blocks and to display the Flow Graph view.\n\nThe example below shows a subset of a function's basic blocks, with the corresponding control-flow graph part from the *Flow Graph* view. The basic blocks B3-B6 are marked on the left side as folding sections that can be collapsed/expanded with a *click* on the -/+ buttons.\n\nNotice how B5 is recognized as forming a loop (the last instruction in the block jumps to the start of the block). The Flow Graph view uses a green arrow to mark loops - B4 is also the start block of a larger loop.\n\n[![Profiling UI screenshot](img/assembly-flow-graph_579x600.png){: style=\"width:500px\"}](img/assembly-flow-graph_579x600.png){:target=\"_blank\"}  \n\n???+ note\n    *Click* on the target address of a jump/branch instructions marks the target instruction and its basic block in the *Flow Graph* view (uses a green background color by default).  \n\n    *Double-click* on a target address operand jumps to the target instruction.\n\n##### Profiling annotations\n\nInstruction execution time is displayed and annotated on several parts of the assembly instructions, columns, basic blocks, and the control-flow graph using text, colors, and flame icons:\n\n[![Profiling UI screenshot](img/assembly-marking_1235x202.png)](img/assembly-marking_1235x202.png){:target=\"_blank\"}  \n\n- the *Time (%)* column displays the instruction's execution time percentage relative to the total function execution time. The column style can be changed in the [Assembly options](#view-options).\n- the *Time (ms)* column displays the instruction's execution time value. The time unit and column style can be changed in the [Assembly options](#view-options)..\n- the instruction background is colored based on its execution time - the slowest instruction has a red color, next slowest orange, then shades of yellow. The instruction location is also marked in the vertical text scrollbar.\n- the three slowest instructions also have a flame icon in the *Time (%)* column using the same color coding.\n\n[![Profiling UI screenshot](img/assembly-marking-blocks_793x203.png)](img/assembly-marking-blocks_793x203.png){:target=\"_blank\"}  \n\n- the basic blocks have a label with the block's execution time percentage, as a sum of its instruction's execution time (in the example above, the 55.73% label for B4). *Hovering* over the label shows the block's execution time value. The label background color uses the same color coding.\n- the basic blocks in the *Flow Graph* view have below the same execution time percentage label as in the *Assembly* view, with the corresponding background color.\n\nWhen displaying a function for the first time, by default, the slowest instruction is selected and brought into view (this can be configured in the [Assembly options](#view-options)). When the function is displayed subsequently, the last vertical scroll position is used instead.  \n\nTo jump at any time to the slowest instruction, *click* the red ![](img/flame-icon.png) from the toolbar or the *Ctrl+H* keyboard shortcut.\n\n???+ note\n    When multiple instructions are selected, the application status bar displays the sum of their execution time as a percentage and value.  \n    [![Profiling UI screenshot](img/assembly-selection_868x170.png)](img/assembly-selection_868x170.png){:target=\"_blank\"}\n\n##### Call targets\n\nCombining the parsed assembly and profiling information, call instructions are marked with their target(s) and have an arrow icon placed before the call opcode:  \n\n- A black arrow icon is used for direct calls (target is a function name/address).\n- A green arrow icon is used for indirect or virtual function calls (target is a register or memory operand).\n\n*Hovering* with the mouse over the arrow displays a list of target functions with details about their execution time. For example, the indirect call below at runtime has the *std::_Random_device* function as the only target:  \n\n[![Profiling UI screenshot](img/assembly-call-target_691x172.png){: style=\"width:500px\"}](img/assembly-call-target_691x172.png){:target=\"_blank\"} \n\n???+ note\n    Functions in the list have a right-click context menu with options to open the *Assembly* view, preview popup, and select the function in the other views.  \n    \n    *Double-click/Ctrl+Return* opens the *Assembly** view for the selected function. Combine these shortcuts with the *Shift* key to open the **Assembly* view in a new tab instead.\n\n Call instructions with a known target have the function name operand changed into a link (underlined, bold, blue text). The link makes it easy to navigate to the called function and the function history to go back to the caller.\n\n- *Double-click* on the function name (or the *Return* key with the name selected) opens the called function in the same tab.  \n- *Shift+Double-Click* (or Shift+Return) opens the called function in a new tab.  \n- *Alt+Return* shows a preview popup with the called function's assembly. Press the *Escape* key to close the popup.  \n- *Hovering* with the mouse over the function name also shows the preview popup.\n- Use the shortcuts from the *Opened function history* section below to return to the caller.\n\n[![Profiling UI screenshot](img/assembly-call-hover_922x278.png)](img/assembly-call-hover_922x278.png){:target=\"_blank\"}  \n\n##### Opened functions history\n\nWhen multiple functions were opened in the same tab, a history is kept per tab that makes it possible to go back/forward to a previous/next opened function. The history is especially useful when navigating to a called function by *double-clicking* its name in the assembly since it makes it easy to get back to the caller.  \n\n- *Click* the *Back* button in the toolbar to navigate back to the previous function in the sequence (or press the *Backspace* key or the optional *Back* button on the mouse). The back button also has a menu that lists the previous functions.  \n\n- *Click* the > button in the toolbar to navigate to the following function in the sequence (or press the optional *Forward* button on the mouse).  \n\n[![Profiling UI screenshot](img/assembly-back-menu_608x154.png){: style=\"width:450px\"}](img/assembly-back-menu_608x154.png){:target=\"_blank\"}  \n\n#### Profiling toolbar\n\nThe profiling toolbar provides more advanced functionality for identifying the slow parts of a function and filtering the profiling data based on a function instance and the threads the function executed on. The following sections document the main functionality.  \n\n##### Profile\n\nDisplays a menu with the slowest instructions, sorted by execution time in decreasing order.  \n\n- *Click* on a menu entry to select and bring the instruction into view.  \n- *Click* the ![](img/flame-icon.png) icon to jump to the slowest instruction in the function.  \n- *Click* the +/- buttons to jump to the next/previous slowest instruction in the sequence.\n\n[![Profiling UI screenshot](img/assembly-profile_782x436.png){: style=\"width:550px\"}](img/assembly-profile_782x436.png){:target=\"_blank\"}  \n\n##### Blocks\n\nDisplays a menu with the slowest blocks, sorted by execution time in decreasing order.  \n*Click* on a menu entry to select and bring the start of the block into view.\n\n[![Profiling UI screenshot](img/assembly-blocks_560x439.png){: style=\"width:400px\"}](img/assembly-blocks_560x439.png){:target=\"_blank\"}  \n\n##### Inlinees\n\nDisplays a menu with the inlinees (inlined functions) that directly contribute to slow instructions, sorted by the execution time of all instructions originating from a particular inlinee in decreasing order.  \n\n[![Profiling UI screenshot](img/assembly-inlinees_1303x459.png)](img/assembly-inlinees_1303x459.png){:target=\"_blank\"}  \n\n*Click* on a menu entry to select all instruction associated with the inlinee and brings the first one into view.  \n\nIn the example above, most of the execution time (46.79%) is taken by instructions originating in the *std::_Rng_from_...* inlinee, while only 3.60% of execution time is from non-inlined instructions.\n\n##### Instances\n\nBy default, the *Assembly** view displays the function profile accumulated across all instances of the function (see the [Flame Graph view](flame-graph-panel.md) documentation for more details about instances). Filtering the function profile based on an instance makes it possible to understand better when certain parts dominate execution time (for example, based on a parameter passed by the caller, one part or another of the function executes).  \n\nThe Instances menu displays the call paths leading to all instances of the function, with their execution time percentage and value. The menu entries use a compact form of the call path, where the first name is the caller, then its caller, and so on going up the call tree until the paths reach a common node. *Hover* over an entry to display a tooltip with the complete call path up to the entry point node.  \n\n[![Profiling UI screenshot](img/assembly-instances_1027x182.png)](img/assembly-instances_1027x182.png){:target=\"_blank\"}  \n\n*Click* on a menu entry to filter the profile data to include only the selected instance, updating the execution time and all profiling annotations for instructions and basic blocks.  \n\nThe menu entries are checkboxes which allows selecting multiple instances to be included.  \nUse the *All Instances* entry or uncheck all instances to view the entire function profile again.\n\n##### Threads\n\nBy default, the *Assembly* view displays the function profile accumulated across all threads the function executed on. Similar to instances, the profile can be filtered to consider only a subset of the threads. The Threads menu displays the threads IDs and their execution time percentage and value.  \n\nThe menu entries are checkboxes that allow multiple instances to be selected and included.  \nUse the *All Threads* entry or uncheck all instances to view the entire function profile again.\n\n[![Profiling UI screenshot](img/assembly-threads_560x214.png){: style=\"width:350px\"}](img/assembly-threads_560x214.png){:target=\"_blank\"}  \n\n???+ note\n    *Hovering* with the mouse over the *Assembly* view tab displays a tooltip with details such as the total/self execution time, module and complete function name and, if filtering is used, the name of the instances and threads included in the view. \n\n##### Export\n\nSee the [Exporting](#exporting) documentation section below.\n\n##### View\n\nDisplays a menu which allows selecting the columns that should be displayed.  \nThe settings are saved across sessions when closing the application.\n\n[![Profiling UI screenshot](img/assembly-view-menu_523x243.png){: style=\"width:350px\"}](img/assembly-view-menu_523x243.png){:target=\"_blank\"} \n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/assembly-toolbar-nav.png)| Navigate back to a previously opened function or the next one in the sequence. See the [Opened functions history](#opened-functions-history) section for more details. |\n    | ![](img/assembly-toolbar-block-nav.png){: style=\"width:200px\"} | The dropdown displays a list of all basic blocks, selecting one jumps to it. |\n    | ![](img/assemlby-toolbar-block-updown.png) | Jumps to the previous/next basic block in the function. |\n    | ![](img/assembly-toolbar-bookmarks.png) | Displays a menu with options for viewing, setting and removing bookmarks associated with instructions. The up/down arrows jump to the previous/next bookmark. |\n    | ![](img/assembly-toolbar-clear.png) | Displays a menu with options for removing markings from the selected or all instructions and operands. |\n    | ![](img/assembly-toolbar-popup.png) | Opens the current function into a new preview popup. |\n    | ![](img/assembly-toolbar-search.png) | Displays the text search panel. Press the *Escape* key to reset the search and close the panel. |\n\n???+ abstract \"Mouse shortcuts\"\n    | Action | Description |\n    | ------ | ------------|\n    | Hover | Hovering over a call target function name displays a popup with the function's assembly. Pin or drag the popup to keep it open. |\n    | Click | Selects an instruction and also selects and brings into view its corresponding source line in the *Source File* view and its basic block in the *Flow Graph* view. |\n    | Double-click | If an instruction operand is selected, jumps to its definition.<br>For jump/branch target address, jumps to the destination basic block.<br>For call target function names, it opens the target function in the active tab. |\n    | Shift+Double-click | For call target function names, it opens the target function in a new tab.  |\n    | Right-click | Shows the context menu for the selected instructions. |\n    | Back | If the mouse has a *Back* button, navigates back to the previous opened function in the tab. |\n    | Forward | If the mouse has a *Forward* button, Navigates forward to the next opened function in the tab. |\n\n???+ abstract \"Keyboard shortcuts\"\n    | Keys | Description |\n    | ------ | ------------|\n    | Return | If an instruction operand is selected, jumps to its definition.<br>For jump/branch target address, jumps to the destination basic block.<br>For call target function names, it opens the target function in the active tab. |\n    | Ctrl+Return | For direct call target function names, it opens the target function in a new tab. |\n    | Alt+Return | For direct call target function names, displays a preview popup with the target function's assembly. |\n    | Backspace | Navigates back to the previous opened function in the tab. |\n    | Shift+Backspace | Navigates forward to the next opened function in the tab. |\n    | Ctrl+H | Jumps to the slowest instruction. |\n    | F2 | Jumps to the next slowest instruction in the sequence. |\n    | Shift+F2 | Jumps to the next previous instruction in the sequence. |\n    | Ctrl+C | Copies to clipboard a HTML and Markdown table with a summary of the selected instructions. |\n    | Ctrl+Shift+C | Copies to clipboard the assembly text of the selected instructions. |\n    | Ctrl+F | Displays the text search panel. |\n    | F3 | Jumps to the next text search result. |\n    | Shift+F3 | Jumps to the previous text search result. |\n    | Escape | Resets text searching and closed the text search panel. |\n    | Ctrl+B | Add a bookmark associated with the selected instruction. |\n    | Ctrl+Arrow Up | Jumps to the previous basic block. |\n    | Ctrl+Arrow Down | Jumps to the next basic block. |\n    | Page Up/Down<br>Arrow keys | Scroll text view similar to other text editors. |\n\n#### Exporting\n\nThe function's assembly, combined with source line numbers and profiling annotations and execution time can be exported and saved into multiple formats, with the slowest instructions marked using a similar style as in the application:\n\n- Excel worksheet (*.xlsx)  \n  [![Profiling UI screenshot](img/assembly-export-excel_780x441.png){: style=\"width:480px\"}](img/assembly-export-excel_780x441.png){:target=\"_blank\"}\n- HTML table (*.html)  \n  [![Profiling UI screenshot](img/assembly-export-html_721x536.png){: style=\"width:480px\"}](img/summary-export-html_1209x287.png){:target=\"_blank\"}\n- Markdown table (*.md)  \n  [![Profiling UI screenshot](img/assembly-export-markdown_984x365.png){: style=\"width:480px\"}](img/assembly-export-markdown_984x365.png){:target=\"_blank\"}\n\nThe Export menu in the toolbar also has an option to copy to clipboard the function's assembly as a HTML/Markdown table (pasting in an application supporting HTML - such as the Microsoft Office suite and online editors - will use the HTML version, code/text editors will use Markdown version instead).  \n\nThe Ctrl+C keyboard shortcut copies to the clipboard only the selected instructions as a HTML/Markdown table.\n\n#### View options\n\n*Click* on the *Gears* icon in the top-right part of the view displays the options panel (alternatively, use the *Assembly Code* tab in the application *Settings* window.).  \n\nThe tabs below describe each page of the options panel:  \n=== \"General\"\n    [![Profiling UI screenshot](img/assembly-options-general_559x643.png){: style=\"width:400px\"}](img/details-panel-info_565x786.png){:target=\"_blank\"}  \n\n=== \"Appearance\"\n    [![Profiling UI screenshot](img/assembly-options-appearance_554x501.png){: style=\"width:400px\"}](img/assembly-options-appearance_554x501.png){:target=\"_blank\"}  \n\n=== \"Source File\"\n    [![Profiling UI screenshot](img/assembly-options-source_553x422.png){: style=\"width:400px\"}](img/assembly-options-source_553x422.png){:target=\"_blank\"}  \n\n=== \"Profiling\"\n    [![Profiling UI screenshot](img/assembly-options-profiling_555x758.png){: style=\"width:400px\"}](img/assembly-options-profiling_555x758.png){:target=\"_blank\"}  \n\n#### Column options\n\n*Right-click* on a column, such as the *Time* columns, displays the option panel that allows changing the style and displayed information by the selected column. Each column can have a different style if desired.  \n\n[![Profiling UI screenshot](img/assembly-column-options_463x393.png){: style=\"width:320px\"}](img/assembly-column-options_463x393.png){:target=\"_blank\"}  \n\n#### Documentation in progress\n- View options\n- Column options"
  },
  {
    "path": "docs/docs/call-tree-panel.md",
    "content": "#### Overview\n\nThe Call Tree view displays the tree derived from combining the call stacks associated with all profile samples in the trace, with each node representing a unique instance of a function. The node's children represent the callees (called functions), and the parent is the caller function.  \n\n*Total (inclusive) execution time* is computed by accumulating the time of all samples with the instance in the call stack.  \n*Self (exclusive) execution time* is computed by subtracting the time spent in children nodes from the total execution time.\n\n[![Profiling UI screenshot](img/call-tree-view_1081x540.png){: style=\"width:700px\"}](img/call-tree-view_1081x540.png){:target=\"_blank\"}\n\nThe view has two parts:  \n\n- a toolbar at the top, with action buttons and the *Search* input box.\n- the tree list view displaying the call tree.  \n  \nA function node has the demangled (undecorated) function name, optionally prepended with the module name, the total execution time percentage (relative to the entire trace),  followed by total/self execution time and module columns.\n\n???+ note\n    By default, several levels of the call path with the longest execution time is expanded. This can be configured in the *Call Tree options* panel.  \n\n    The columns in all list views can be resized and reorder. The new layout is saved across sessions when closing the application.\n\n#### Searching functions\n\nUse the *search input box* in the toolbar to search for functions with a specific name using a case-insensitive substring search. Matching nodes and function names are marked, and the *up/down* buttons on the right can be used to navigate between results. Press the *Escape* key to reset the search or the X button next to the input box.\n\n[![Profiling UI screenshot](img/call-tree-search_1077x402.png){: style=\"width:700px\"}](img/call-tree-search_1077x402.png){:target=\"_blank\"}\n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/flame-graph-toolbar-reset.png) | Resets the view to the initial state. |\n    | ![](img/call-tree-toobar-flame.png) | Expands several levels of the the slowest path in the call tree. |\n    | ![](img/flame-graph-toolbar-sync.png) | If enabled, selecting a node also selects the associated function in the other profiling views. |\n    | ![](img/flame-graph-toolbar-source.png) | If enabled, selecting a node also displays the associated function in the *Source File* view, with the source lines annotated with profiling data. |\n    | ![](img/flame-graph-toolbar-module.png) | If enabled, display the module name before the function name in the nodes as module!function. |\n    | Search box | Search for nodes with a specific function name using a case-insensitive substring search. Press the *Escape* key to reset the search or the *X* button next to the input box. |\n\n???+ abstract \"Mouse shortcuts\"\n    | Action | Description |\n    | ------ | ------------|\n    | Hover |  Hovering over a node briefly displays a preview popup with the complete function name and total/self execution times. *Clicking* the *Pin button* or dragging the popup expands it into a panel equivalent to the *Details panel*. Multiple such panels can be kept open at the same time. |\n    | Click | Selects a function. If *Sync* is enabled in the toolbar, the function is also selected in the other panels. Displays the associated function in the *Source File* view if *Source* is enabled in the toolbar. |\n    | Double-click | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Double-click | Opens the *Assembly* view of the selected function in a new tab. |\n    | Shift+Double-click | Opens the *Assembly* view of the selected function in the active tab, with profile data filtered to include only the selected instance. |\n    | Ctrl+Shift+Double-click | Opens the *Assembly* view of the selected function in a new tab, with profile data filtered to include only the selected instance. |\n    | Right-click | Shows the context menu for the selected function. |\n\n???+ abstract \"Keyboard shortcuts\"\n    | Keys | Description |\n    | ------ | ------------|\n    | Space | Expands (zooms-in) the pointed node to cover the view's width, adjusting child node widths accordingly. |\n    | Return | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Return | Opens the *Assembly* view of the selected function in a new tab. |\n    | Alt+Return | Opens a preview popup with the assembly of the selected function. Press the *Escape* key to close the popup.<br><br>Multiple preview popups can be can be kept open at the same time. |\n    | Shift+Return | Opens the *Assembly* view of the selected function in the active tab, with profile data filtered to include only the selected instance. |\n    | Ctrl+Shift+Return | Opens the *Assembly* view of the selected function in a new tab, with profile data filtered to include only the selected instance. |\n    | Alt+Shift+Return | Opens a preview popup with the assembly of the selected function, with profile data filtered to include only the selected instance. |\n    | Ctrl+C | Copies to clipboard a HTML and Markdown table with a summary of the selected nodes. |\n    | Ctrl+Shift+C | Copies to clipboard the function names of the selected nodes. |\n    | Ctrl+Alt+C | Copies to clipboard the mangled/decorated function names of the selected nodes. |\n    | Ctrl+= | Expands several levels of the the slowest path of children of the selected function. |\n    | Ctrl+- | Collapses all children of the selected function. |\n    | Ctrl+0<br>Ctrl+R |  Resets the view to the initial state. |\n    | Left-arrow key | Collapses the children of the selected function and goes up one level. |\n    | Right-arrow key | Expands the children of the selected function and goes down one level. |\n    \n???+ abstract \"Right-click context menu\"\n    [![Profiling UI screenshot](img/call-tree-context-menu_524x517.png){: style=\"width:380px\"}](img/call-tree-context-menu_524x517.png){:target=\"_blank\"}  \n\n#### View options\n\n*Click* on the *Gears* icon in the top-right part of the view displays the options panel (alternatively, use the *Call Tree* tab in the application *Settings* window.).  \n\nThe tabs below describe each page of the options panel:  \n=== \"General\"\n    [![Profiling UI screenshot](img/call-options-general_584x282.png){: style=\"width:400px\"}](img/call-options-general_584x282.png){:target=\"_blank\"} \n\n#### Documentation in progress\n- Marking nodes\n- View options"
  },
  {
    "path": "docs/docs/caller-panel.md",
    "content": "#### Overview\n\nThe Caller/Callee view displays the active function's list of callers and callees (function being called by it). It can be viewed as an extension of the [Call Tree view](call-tree-panel.md) focused on a single function.     \n\n[![Profiling UI screenshot](img/caller-view_1002x539.png){: style=\"width:700px\"}](img/caller-view_1002x539.png){:target=\"_blank\"}\n\nThe view has four parts:  \n\n- a toolbar at the top, with action buttons and the *Search* input box.\n- a function node representing the active function, with a 100% total execution time.\n- the *Calling* tree list view displaying the callee functions.\n- the *Callers* tree list view displaying the caller functions.\n  \nA function node has the demangled (undecorated) function name, optionally prepended with the module name, the total execution time percentage (relative to the entire trace),  followed by total/self execution time and module columns.\n\n???+ note\n    The columns in all list views can be resized and reorder. The new layout is saved across sessions when closing the application.\n\nBy default, all function instances are displayed combined, with the lists of callers and callees merged and execution time summed up. To display individual instances instead, disable *Combine* in the toolbar.\n\n[![Profiling UI screenshot](img/call-tree-instances_1005x311.png){: style=\"width:700px\"}](img/call-tree-instances_1005x311.png){:target=\"_blank\"}\n\nExpanding a caller function form the list goes up the call tree, showing a list of callers which forms a stack trace leading to the entry function. This makes it easy to see the call path that leads to a caller.\n\n[![Profiling UI screenshot](img/caller-expand-caller_804x233.png){: style=\"width:500px\"}](img/caller-expand-caller_804x233.png){:target=\"_blank\"}\n\nExpanding a callee function from the list goes down the call tree, showing a list of callees until a leaf node is reached. This makes it easy to see which functions are being called starting with a callee.\n\n[![Profiling UI screenshot](img/caller-expand-calling_724x210.png){: style=\"width:500px\"}](img/caller-expand-calling_724x210.png){:target=\"_blank\"}\n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/flame-graph-toolbar-back.png) | Navigates back to the previous viewed function in the view. |\n    | ![](img/flame-graph-toolbar-sync.png) | If enabled, selecting a node also selects the associated function in the other profiling views. |\n    | ![](img/flame-graph-toolbar-source.png) | If enabled, selecting a node also displays the associated function in the *Source File* view, with the source lines annotated with profiling data. |\n    | ![](img/call-tree-toolbar-combine.png) | If enabled, all function instances are displayed combined, with the lists of callers and callees merged and execution time summed up. |\n    | ![](img/flame-graph-toolbar-module.png) | If enabled, display the module name before the function name in the nodes as module!function. |\n    | Search box | Search for nodes with a specific function name using a case-insensitive substring search. Press the *Escape* key to reset the search or the *X* button next to the input box. |\n\n???+ abstract \"Mouse shortcuts\"\n    | Action | Description |\n    | ------ | ------------|\n    | Hover |  Hovering over a node briefly displays a preview popup with the complete function name and total/self execution times, similar to the *Flame Graph* view. |\n    | Double-click | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Double-click | Opens the *Assembly* view of the selected function in a new tab. |\n    | Shift+Double-click | Opens the *Assembly* view of the selected function in the active tab, with profile data filtered to include only the selected instance. |\n    | Ctrl+Shift+Double-click | Opens the *Assembly* view of the selected function in a new tab, with profile data filtered to include only the selected instance. |\n    | Right-click | Shows the context menu for the selected function. |\n    | Back | If the mouse has a *Back* button, navigates back to the previous viewed function in the view. |\n\n???+ abstract \"Keyboard shortcuts\"\n    | Keys | Description |\n    | ------ | ------------|\n    | Return | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Return | Opens the *Assembly* view of the selected function in a new tab. |\n    | Alt+Return | Opens a preview popup with the assembly of the selected function. Press the *Escape* key to close the popup.<br><br>Multiple preview popups can be can be kept open at the same time. |\n    | Shift+Return | Opens the *Assembly* view of the selected function in the active tab, with profile data filtered to include only the selected instance. |\n    | Ctrl+Shift+Return | Opens the *Assembly* view of the selected function in a new tab, with profile data filtered to include only the selected instance. |\n    | Alt+Shift+Return | Opens a preview popup with the assembly of the selected function, with profile data filtered to include only the selected instance. |\n    | Ctrl+C | Copies to clipboard a HTML and Markdown table with a summary of the selected nodes. |\n    | Ctrl+Shift+C | Copies to clipboard the function names of the selected nodes. |\n    | Ctrl+Alt+C | Copies to clipboard the mangled/decorated function names of the selected nodes. |\n    | Backspace | navigates back to the previous viewed function in the view. |\n    | Ctrl+= | Expands several levels of the the slowest path of children of the selected function. |\n    | Ctrl+- | Collapses all children of the selected function. |\n    | Ctrl+0<br>Ctrl+R |  Resets the view to the initial state. |\n    | Left-arrow key | Collapses the children of the selected function and goes up one level. |\n    | Right-arrow key | Expands the children of the selected function and goes down one level. |\n    \n???+ abstract \"Right-click context menu\"\n    [![Profiling UI screenshot](img/call-tree-context-menu_524x517.png){: style=\"width:380px\"}](img/call-tree-context-menu_524x517.png){:target=\"_blank\"}  \n\n#### View options\n\n*Click* on the *Gears* icon in the top-right part of the view displays the options panel (alternatively, use the *Caller/Callee* tab in the application *Settings* window.).  \n\nThe tabs below describe each page of the options panel:  \n=== \"General\"\n    [![Profiling UI screenshot](img/call-options-general_584x282.png){: style=\"width:400px\"}](img/call-options-general_584x282.png){:target=\"_blank\"} \n\n#### Documentation in progress\n- Marking nodes\n- View options"
  },
  {
    "path": "docs/docs/demos.md",
    "content": "#### UI overview, loading and navigating a trace\n\n<video controls>\n<source src=\"https://github.com/user-attachments/assets/0e0aca13-3fbf-4bf3-8983-b95ad019f853\" type=\"video/mp4\">\n</video>\n"
  },
  {
    "path": "docs/docs/flame-graph-panel.md",
    "content": "#### Overview\n\nThe Flame Graph view is the main means of identifying the parts of the application where most time is spent. The flame graph displays nodes representing functions stacked top to bottom according to the call tree paths forming the stack traces.  \n\n[![Profiling UI screenshot](img/flame-graph-panel_1435x557.png)](img/flame-graph-panel_1435x557.png){:target=\"_blank\"}\n\nThe view has three parts:\n\n- a toolbar at the top, with action buttons and the *Search* input box.\n- the interactive flame graph view.\n- the [Details panel](#details-panel) on the right side. The panel displays detailed info about the selected node(s), and its visibility can be toggled using the *Details* button in the toolbar.\n\n???+ note \"Introduction to flame graphs\"\n    A flame graph is an alternative, more compact way of viewing a call tree. In this view, function instances are nodes with a size proportional to the time spent relative to the caller (parent) function and makes it easier to identify the portions of the app that take most of the time.  \n\n    Nodes are sorted in the horizontal direction based on decreasing time relative to their parent node, while the ordering in the vertical direction forms a stack trace (a path in the call tree). The function taking the most time in the application is then found in the leftmost, bottom part of the flame graph.\n   \n    ![flame graph diagram](img/flame-graph.png){: style=\"width:320px\"}  \n    In the example above, the *main* function is considered the process entry point, calling *foo* and *bar*, with *foo* taking 60% of the time and *bar* 40%. Function *foo* spends a part of its total (inclusive) time in the calls to *baz* and *etc1*, while the rest is self (exclusive) time, meaning instructions part of *foo* which are not calls to other functions.  \n\n    Note that there are two instances of the function *baz* with different execution times, each with a unique path to it in the call tree starting from *main* (all other functions have a single instance). You can see the time of each instance by *hovering* with the mouse over it or in the *Details panel* after it's selected.\n\n    The following links provide an introduction to the flame graph visualization concept, its history, and how it's being used across the industry for performance investigations.  \n\n    - [CPU Flame Graphs (brendangregg.com)](https://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html)\n    - [Visualizing Performance - The Developers’ Guide to Flame Graphs (youtube.com)](https://www.youtube.com/watch?v=VMpTU15rIZY)\n\n##### Flame graph nodes\n\nEach node is a unique instance of a function — a function having multiple instances means there are several paths in the call tree that call the function.  \n\nEach node has the demangled (undecorated) function name, optionally prepended with the module name, followed by the execution time percentage relative to the entire trace and the execution time.  \n\nBy default, the nodes are color-coded based on the module names to which the functions belong. Nodes for functions executing in the kernel/managed context are marked with a different text and border color (blue by default). The displayed text fields and colors can be customized in the flame graph options.  \n\n???+ note\n    When the called function nodes are too small to be visible in the view, they are collapsed under a placeholder node rendered with a hatch pattern. Placeholder nodes are expanded into individual nodes when zooming in the view.  \n\n##### Navigating the flame graph\n\n*Middle-click* on a node expands it to cover the entire view and may expand collapsed child nodes. For example, the called nodes become visible after expanding the node hovered in the screenshot above. Alternatively, with a node already selected press the *Space* key to expand it. \n\n[![Profiling UI screenshot](img/flame-graph-expand_944x428.png)](img/flame-graph-expand_944x428.png){:target=\"_blank\"}\n\nExpanding a node can be repeated to go deeper down the call path. The *Back* button in the toolbar (or *Backspace* key/*Back* mouse button) undoes the operation and returns the view to its previous state.  \n\n[![Profiling UI screenshot](img/flame-graph-expand2_947x456.png)](img/flame-graph-expand2_947x456.png){:target=\"_blank\"}\n\n???+ note\n    In the screenshot above, the nodes starting with *ntoskrnl.exe!KiPageFault* use a different style to mark code executing in kernel mode. The user mode and kernel mode call stacks are automatically combined.\n\n##### Changing the root node\n\nIt can be helpful to view only a subregion of the flame graph. By changing the root node, only nodes for functions starting with the new root are displayed, and execution time percentages are computed relative to the new root, which starts at 100%.\n\nTo change the root node, from the right-click context menu, select *Set Function as Root* (alternatively, use the *Alt+Double-click* shortcut). After the switch, the toolbar displays the name of the current root node. Setting a new root node can be repeated in the new view.\n\nTo remove the root node and view the entire flame graph, *click* the *X* button next to its name in the toolbar. If multiple nested root nodes were set, removing the current node activates the previous one.\n\n[![Profiling UI screenshot](img/flame-graph-root_946x435.png)](img/flame-graph-root_946x435.png){:target=\"_blank\"}\n\n#### Searching functions\n\nUse the *search input box* in the toolbar to search for functions with a specific name using a case-insensitive substring search. Matching nodes and function names are marked, and the *up/down* buttons on the right can be used to navigate between results. Press the *Escape* key to reset the search or the X button next to the input box.\n\n[![Profiling UI screenshot](img/flame-graph-search_1078x286.png)](img/flame-graph-search_1078x286.png){:target=\"_blank\"}\n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/flame-graph-toolbar-back.png) | Undoes the previous action, such as expanding a node or changing the root node. |\n    | ![](img/flame-graph-toolbar-reset.png) | Resets the view to it's original state, displaying the entire flame graph. |\n    | ![](img/flame-graph-toolbar-minus.png) | Zooms out the view around the center point. |\n    | ![](img/flame-graph-toolbar-plus.png) | Zooms in the view around the center point. |\n    | ![](img/flame-graph-toolbar-sync.png) | If enabled, selecting a node also selects the associated function in the other profiling views. |\n    | ![](img/flame-graph-toolbar-source.png) | If enabled, selecting a node also displays the associated function in the *Source File* view, with the source lines annotated with profiling data. |\n    | ![](img/flame-graph-toolbar-module.png) | If enabled, display the module name before the function name in the nodes as module!function. |\n    | ![](img/flame-graph-toolbar-details.png) | If enabled, display the *Details panel* on the right side of the *Flame Graph* view. |\n    | Search box | Search for nodes with a specific function name using a case-insensitive substring search. Press the *Escape* key to reset the search or the *X* button next to the input box. |\n\n???+ abstract \"Mouse shortcuts\"\n    | Action | Description |\n    | ------ | ------------|\n    | Hover | Hovering over a node briefly displays a preview popup with the complete function name and total/self execution times. *Clicking* the *Pin button* or dragging the popup expands it into a panel equivalent to the *Details panel*. Multiple such panels can be kept open at the same time. |\n    | Click | Selects a node and deselects any previously selected nodes. The *Details panel* is updated and, if *Sync* is enabled in the toolbar, the function is selected in the other panels. Displays the associated function in the *Source File* view if *Source* is enabled in the toolbar. <br><br>*Clicking* an empty part of the view deselects all nodes. |\n    | Ctrl+Click | Selects the pointed node and keeps the previously selected nodes (append). The *Details panel* is updated to display a combined view of all selected nodes. |\n    | Shift+Click | When a node is selected, it expands the selection to include all nodes in the call stack between the pointed node and the selected one. The *Details panel* is updated to display a combined view of all selected nodes. |\n    | Middle-click | Expands (zooms-in) the pointed node to cover the view's width, adjusting child node widths accordingly. |\n    | Back | If the mouse has a *Back* button, this undoes the previous action, such as expanding a node (double-click) or changing the root node. An alternative is pressing the *Backspace* key or the *Back* button in the toolbar.|\n    | Double-click | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Double-click | Opens the *Assembly* view of the selected function in a new tab. |\n    | Shift+Double-click | Opens the *Assembly* view of the selected function in the active tab, with profile data filtered to include only the selected instance. |\n    | Ctrl+Shift+Double-click | Opens the *Assembly* view of the selected function in a new tab, with profile data filtered to include only the selected instance. |\n    | Alt+Double-click | Sets the selected node as the root node of the flame graph. |\n    | Right-click | Shows the context menu for the selected nodes. |\n    | Click+Drag | If the flame graph is larger than the view, *clicking* on and dragging an empty part of the view moves the view in the direction of the mouse. |\n    | Scroll wheel | Scrolls the view vertically if the flame graph is larger than the view. |\n    | Shift+Scroll wheel | Scrolls the view horizontally if the flame graph is larger than the view. |\n    | Ctrl+Scroll wheel | Zooms in or out the view around the mouse pointer position. |\n    | Click+Scroll wheel | Zooms in or out the view around the mouse pointer position. |\n\n    !!! note\n        When multiple nodes are selected, the application status bar displays the sum of their execution time as a percentage and value.  \n        [![Profiling UI screenshot](img/flame-graph-selection_619x155.png){: style=\"width:450px\"}](img/flame-graph-selection_619x155.png){:target=\"_blank\"}\n    \n???+ abstract \"Keyboard shortcuts\"\n    | Keys | Description |\n    | ------ | ------------|\n    | Space | Expands (zooms-in) the pointed node to cover the view's width, adjusting child node widths accordingly. |\n    | Return | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Return | Opens the *Assembly* view of the selected function in a new tab. |\n    | Alt+Return | Opens a preview popup with the assembly of the selected function. Press the *Escape* key to close the popup.<br><br>Multiple preview popups can be can be kept open at the same time. |\n    | Shift+Return | Opens the *Assembly* view of the selected function in the active tab, with profile data filtered to include only the selected instance. |\n    | Ctrl+Shift+Return | Opens the *Assembly* view of the selected function in a new tab, with profile data filtered to include only the selected instance. |\n    | Alt+Shift+Return | Opens a preview popup with the assembly of the selected function, with profile data filtered to include only the selected instance. |\n    | Ctrl+C | Copies to clipboard a HTML and Markdown table with a summary of the selected nodes. |\n    | Ctrl+Shift+C | Copies to clipboard the function names of the selected nodes. |\n    | Ctrl+Alt+C | Copies to clipboard the mangled/decorated function names of the selected nodes. |\n    | Backspace | Undoes the previous action, such as expanding a node (double-click) or changing the root node. |\n    | Ctrl+= | Zooms in the view around the center point. |\n    | Ctrl+- | Zooms out the view around the center point. |\n    | Ctrl+0<br>Ctrl+R | Resets the view to the initial state. |\n    | Arrow keys | Scrolls the view in the horizontal and vertical directions if the flame graph is larger than the view. |\n\n???+ abstract \"Right-click context menu\"\n    [![Profiling UI screenshot](img/flame-graph-context-menu_539x651.png){: style=\"width:380px\"}](img/flame-graph-context-menu_539x651.png){:target=\"_blank\"}  \n\n#### Details panel\n\nThe Details panel shows extended information about the selected node(s) in the flame graph. It provides a quick overview of the slowest functions and modules being called directly or through other functions starting with the selection.  \n\nThe top shows the *Total* (inclusive) execution time and *Self* (exclusive) execution time values for the selected node (function instance). The right side shows the index of the chosen instance, among all instances, with the slowest instance having the lowest index. Use the left/right arrow buttons to switch to the previous/next function instance.  \n\n???+ note\n    Functions in the lists have a right-click context menu with options to open the *Assembly* view, preview popup, and select the function in the other views.  \n\n    *Double-click/Ctrl+Return* opens the *Assembly** view for the selected function. Combine these shortcuts with the *Shift* key to open the **Assembly* view in a new tab instead.  \n    *Hovering* with the mouse over a function opens a preview popup with the function's assembly.    \n    \n    When multiple functions are selected, the application status bar displays the sum of their execution time as a percentage and value.\n\nThe information displayed in the tabs below is for the selected function instance only, except the *Info* tab which displays statistics for all instances instead.  \n\n=== \"Info\"\n    [![Profiling UI screenshot](img/details-panel-info_565x786.png){: style=\"width:380px\"}](img/details-panel-info_565x786.png){:target=\"_blank\"}  \n\n    The Info tab displays details and statistics about all instances of the selected funcion node.  \n\n    | Section | Description |\n    | ------ | ------------|\n    | Instances | Displays total execution time (sum), average, and median across all function instances, as a total/self execution time percentage relative to the entire trace and execution time value. |\n    | Histogram | The histogram displays the time distribution across all function instances. Instances with similar times are grouped, and the number of instances in each group is shown above, with more details when *hovering* over a group with the mouse.<br><br>*Clicking* on a group selects the first node from the group in the *Flame Graph* view. The *Total/Self* radio buttons switch between using the total time or self time for the histogram.<br><br>In the above example, there are 3 instances of function *genString*, one with an execution time of ~1.5ms and two, binned together, with ~1sec each. The time of the selected instance is marked with a green arrow, and the average/median times are indicated by red/blue dotted lines. |\n    | Threads | Displays the list of threads on which all function instances execute, with each thread's total/self execution time percentage and execution time value.<br><br>*Right-clicking* a thread shows a context menu with options to open the *Assembly* view with profile data filtered to include only the selected thread and multiple options for changing the thread filtering for the entire trace.<br><br>*Double-clicking* a thread filters the entire trace to show only code executing on that thread. |\n    | Module | Displays the name of the module to which the function belongs. Shortcut buttons on the right side:<br> <table>  <tbody>  <tr>  <td>![](img/details-panel-mark-module.png){: style=\"width:24px\"}</td>  <td>Marks all function nodes belonging to the module with a color.</td>  </tr> <tr>  <td>![](img/details-panel-copy.png){: style=\"width:24px\"}</td>  <td>Copies to clipboard the module name.</td>  </tr>   </tbody>  </table> |\n    | Function | Displays the complete function name, followed by the execution context as U/K/M standing for User/Kernel/Managed mode. Shortcut buttons on the right side:<br> <table>  <tbody>  <tr>  <tr>  <td>![](img/details-panel-preview.png){: style=\"width:24px\"}</td>  <td>Opens a preview popup with the function's assembly.</td>  </tr>  <tr>  <td>![](img/details-panel-tab.png){: style=\"width:24px\"}</td>  <td>Opens the function's *Assembly* view in a new tab.</td>  </tr>  <td>![](img/details-panel-mark-module.png){: style=\"width:24px\"}</td>  <td>Marks all function nodes with a color.</td>  </tr> <tr>  <td>![](img/details-panel-copy.png){: style=\"width:24px\"}</td>  <td>Copies to clipboard the function name.</td>  </tr>   </tbody>  </table> |\n\n=== \"Stack\"\n    [![Profiling UI screenshot](img/details-panel-stack_565x706.png){: style=\"width:380px\"}](img/details-panel-stack_565x706.png){:target=\"_blank\"}  \n\n    The Stack tab displays the call stack (stack trace) leading to the selected function instance node.\n=== \"Functions\"\n    [![Profiling UI screenshot](img/details-panel-functions_565x706.png){: style=\"width:380px\"}](img/details-panel-functions_565x706.png){:target=\"_blank\"}  \n\n    The Functions tab lists the slowest functions being called directly or through other functions, starting with the selected function instance node. By default, the list is sorted by self (exclusive) time in descending order. The flame graph options can change the sorting to consider total (inclusive) time instead.\n=== \"Modules\"\n    [![Profiling UI screenshot](img/details-panel-modules_565x706.png){: style=\"width:380px\"}](img/details-panel-modules_565x706.png){:target=\"_blank\"}  \n\n    The Modules tab is similar to the Functions tab, with the difference that functions are first grouped by the module they belong to, and the execution time per module is also displayed. Selecting a module shows the list of the slowest functions.\n=== \"Categories\"\n    [![Profiling UI screenshot](img/details-panel-categories_565x706.png){: style=\"width:380px\"}](img/details-panel-categories_565x706.png){:target=\"_blank\"}  \n\n    The Categories tab is similar to the Functions tab, with the difference that functions are first grouped by the category they belong to, and the execution time per category is also displayed. Selecting a category shows the list of the slowest functions.<br><br>*Right-click* on a category shows options to export a report as a HTML/Markdown file and copy the report to clipboard.\n=== \"Instances\"\n    [![Profiling UI screenshot](img/details-panel-instances_565x706.png){: style=\"width:380px\"}](img/details-panel-instances_565x706.png){:target=\"_blank\"}  \n\n    The Instances tab lists all instances of the function, sorted by total (inclusive) execution time.\n\n#### View options\n\n*Click* on the *Gears* icon in the top-right part of the view displays the options panel (alternatively, use the *Flame Graph* tab in the application *Settings* window.).  \n\nThe tabs below describe each page of the options panel:  \n=== \"General\"\n    [![Profiling UI screenshot](img/flame-graph-options-general_586x337.png){: style=\"width:400px\"}](img/flame-graph-options-general_586x337.png){:target=\"_blank\"}  \n\n=== \"Appearance\"\n    [![Profiling UI screenshot](img/flame-graph-options-appearance_592x809.png){: style=\"width:400px\"}](img/flame-graph-options-appearance_592x809.png){:target=\"_blank\"}  \n\n=== \"Details Panel\"\n    [![Profiling UI screenshot](img/flame-graph-options-details_590x690.png){: style=\"width:400px\"}](img/flame-graph-options-details_590x690.png){:target=\"_blank\"}  \n\n#### Documentation in progress\n- Marking nodes\n- View options"
  },
  {
    "path": "docs/docs/flow-graph-panel.md",
    "content": "#### Overview\n\nThe Flow Graph view displays the [control-flow graph (CFG)](https://en.wikipedia.org/wiki/Control-flow_graph) of the function viewed in the active *Assembly* view.  \n\nThe function CFG makes it easier to see the structure of a function and control-flow created by jumps, branches, and loops. The slowest [basic blocks](https://en.wikipedia.org/wiki/Basic_block) are annotated with profiling information.  \n\n[![Profiling UI screenshot](img/flow-graph-view_501x693.png){: style=\"width:320px\"}](img/flow-graph-view_501x693.png){:target=\"_blank\"}\n\nThe view has two parts:  \n\n- a main toolbar at the top, with general action buttons.\n- an interactive CFG area, supporting zooming and panning.\n\nEach basic block is represented by a rectangle, with the block number as the label. An edge between two blocks means the source and destination block are connected either through a jump/branch or fall-through code.  \n\n##### Color coding\n\nDifferent colors of the blocks and edges are used to help identify control flow. The used colors can be customized in the [Flow Graph options](#view-options).\n\nBlock border colors coding (default colors):  \n\n- blue: blocks ends with a branch instruction.\n- green: block is the target of a loop back-edge (it's a loop header).\n- red: block ends with a return instruction (it's a function exit),\n\nEdge color coding (default colors):  \n\n- blue: target block is a branch target (branch in the source block jumps to it).\n- green: loop back-edge, target block is a loop header (start of a  loop).\n- red: target block is a function exit block.\n- dotted: target block is the [immediate dominator](https://en.wikipedia.org/wiki/Dominator_(graph_theory)) of the source block.\n\n##### Selection sync\n\nWhen a block is selected, the corresponding instructions are also selected in the *Assembly* view, like in the example below where B5 is selected. Notice that B5 is a single-block, nested loop, while B4 is the loop header block of a larger loop including B5.  \n\n[![Profiling UI screenshot](img/flow-graph-select_1277x370.png)](img/flow-graph-select_1277x370.png){:target=\"_blank\"} \n\n#### Profiling annotations\n\nBlocks with a significant execution time are marked by using bold text for the block number and changing their background color (same color coding as in the *Assembly* view).  \n\nA label is displayed underneath with the block's execution time percentage relative to the function's total execution time.\n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/flame-graph-toolbar-reset.png) | Resets the view to it's original state. |\n    | ![](img/flame-graph-toolbar-minus.png) | Zooms out the view around the center point. |\n    | ![](img/flame-graph-toolbar-plus.png) | Zooms in the view around the center point. |\n    | ![](img/flow-graph-toolbar-width.png) | Resizes the view so that the width of the graph matches the available horizontal area. |\n    | ![](img/flow-graph-toolbar-all.png) | Resizes the view so that the entire graph is visible. |\n    | ![](img/flow-graph-toolbar-clear.png) | Displays a menu with options for clearing marker for the selected block or all blocks. |\n\n???+ abstract \"Mouse shortcuts\"\n    | Action | Description |\n    | ------ | ------------|\n    | Hover | Hovering over a block displays a preview popup with the corresponding instructions from the *Assembly* view. |\n    | Click | Selects a block and also selects the corresponding instructions the *Assembly* view (can be configured in the [Flow Graph options](#view-options)) |\n    | Right-click | Shows the context menu for the selected block. |\n    | Click+Drag | *Clicking* on and dragging an empty part of the view moves the view in the direction of the mouse. |\n    | Scroll wheel | Scrolls the view vertically if graph is larger than the view. |\n    | Ctrl+Scroll wheel | Zooms in or out the view around the mouse pointer position. |\n\n???+ abstract \"Keyboard shortcuts\"\n    | Keys | Description |\n    | ------ | ------------|\n    | Ctrl+= | Zooms in the view around the center point. |\n    | Ctrl+- | Zooms out the view around the center point. |\n    | Ctrl+0<br>Ctrl+R | Resets the view to the initial state. |\n    | Ctrl+W | Resizes the view so that the width of the graph matches the available horizontal area. |\n    | Ctrl+A | Resizes the view so that the entire graph is visible. |\n    | Arrow keys | Scrolls the view in the horizontal and vertical directions if the flame graph is larger than the view. |\n\n???+ abstract \"Right-click context menu\"\n    [![Profiling UI screenshot](img/flow-graph-context-menu_383x548.png){: style=\"width:380px\"}](img/flow-graph-context-menu_383x548.png){:target=\"_blank\"}  \n\n#### View options\n\n*Click* on the *Gears* icon in the top-right part of the view displays the options panel (alternatively, use the *Flow Graph* tab in the application *Settings* window.).  \n\nThe tabs below describe each page of the options panel:  \n=== \"General\"\n    [![Profiling UI screenshot](img/flow-graph-options-general_558x423.png){: style=\"width:400px\"}](img/flow-graph-options-general_558x423.png){:target=\"_blank\"}  \n\n=== \"Appearance\"\n    [![Profiling UI screenshot](img/flow-graph-options-appearance_527x594.png){: style=\"width:400px\"}](img/flow-graph-options-appearance_527x594.png){:target=\"_blank\"}\n\n#### Documentation in progress\n- View options"
  },
  {
    "path": "docs/docs/index.json",
    "content": "{\n  \"Topics\": [\n    {\n      \"Title\": \"Introduction\",\n      \"URL\": \"intro.html\",\n      \"SubTopics\": null\n    },\n    {\n      \"Title\": \"Getting started\",\n      \"URL\": \"\",\n      \"SubTopics\": [\n        {\n          \"Title\": \"About\",\n          \"URL\": \"about.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Profiling UI overview\",\n          \"URL\": \"profiling-ui.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Video Demos\",\n          \"URL\": \"demos.html\",\n          \"SubTopics\": null\n        }\n      ]\n    },\n    {\n      \"Title\": \"Trace loading and recording\",\n      \"URL\": \"\",\n      \"SubTopics\": [\n        {\n          \"Title\": \"Loading a trace\",\n          \"URL\": \"trace-loading.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Recording a trace\",\n          \"URL\": \"trace-recording.html\",\n          \"SubTopics\": null\n        }\n      ]\n    },\n    {\n      \"Title\": \"Trace profile views\",\n      \"URL\": \"\",\n      \"SubTopics\": [\n        {\n          \"Title\": \"Summary view\",\n          \"URL\": \"summary-panel.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Flame Graph view\",\n          \"URL\": \"flame-graph-panel.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Timeline view\",\n          \"URL\": \"timeline-panel.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Call Tree view\",\n          \"URL\": \"call-tree-panel.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Caller/Callee view\",\n          \"URL\": \"caller-panel.html\",\n          \"SubTopics\": null\n        }\n      ]\n    },\n    {\n      \"Title\": \"Function profile views\",\n      \"URL\": \"\",\n      \"SubTopics\": [\n        {\n          \"Title\": \"Assembly view\",\n          \"URL\": \"assembly-view.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Source File view\",\n          \"URL\": \"source-panel.html\",\n          \"SubTopics\": null\n        },\n        {\n          \"Title\": \"Flow Graph view\",\n          \"URL\": \"flow-graph-panel.html\",\n          \"SubTopics\": null\n        }\n      ]\n    }\n  ],\n  \"PanelTopics\": {\n    \"section\": {\n      \"Title\": \"Summary view\",\n      \"URL\": \"summary-panel.html\",\n      \"SubTopics\": null\n    },\n    \"flameGraph\": {\n      \"Title\": \"Flame Graph view\",\n      \"URL\": \"flame-graph-panel.html\",\n      \"SubTopics\": null\n    },\n    \"timeline\": {\n      \"Title\": \"Timeline view\",\n      \"URL\": \"timeline-panel.html\",\n      \"SubTopics\": null\n    },\n    \"callTree\": {\n      \"Title\": \"Call Tree view\",\n      \"URL\": \"call-tree-panel.html\",\n      \"SubTopics\": null\n    },\n    \"callerCallee\": {\n      \"Title\": \"Caller/Callee view\",\n      \"URL\": \"caller-panel.html\",\n      \"SubTopics\": null\n    },\n    \"other\": {\n      \"Title\": \"Assembly view\",\n      \"URL\": \"assembly-view.html\",\n      \"SubTopics\": null\n    },\n    \"source\": {\n      \"Title\": \"Source File view\",\n      \"URL\": \"source-panel.html\",\n      \"SubTopics\": null\n    },\n    \"flowGraph\": {\n      \"Title\": \"Flow Graph view\",\n      \"URL\": \"flow-graph-panel.html\",\n      \"SubTopics\": null\n    }\n  },\n  \"HomeTopic\": {\n    \"Title\": \"Home\",\n    \"URL\": \"intro.html\",\n    \"SubTopics\": null\n  }\n}"
  },
  {
    "path": "docs/docs/intro.md",
    "content": "\n#### Getting started\n\n- [About](about.md): provides an introduction to the application.\n- [Profiling UI overview](profiling-ui.md): provides an overview of the main profiling views.  \n- [Video Demos](demos.md): has several screen recording videos presenting the UI and features.  \n\n##### Trace loading and recording\n\n- [Loading a trace](trace-loading.md)  \n- [Recording a trace](trace-recording.md)  \n- [Trace overview report](trace-overview.md)  \n\n##### Profiling views\n\nTrace profiling views:  \n\n- [Summary view](summary-panel.md)  \n- [Flame Graph view](flame-graph-panel.md)  \n- [Timeline view](timeline-panel.md)  \n- [Call Tree view](call-tree-panel.md)  \n- [Caller/Callee view](caller-panel.md)  \n\nFunction profiling views (focus on an individual function):  \n\n- [Assembly view](assembly-view.md)  \n- [Source File view](source-panel.md)  \n- [Flow Graph view](flow-graph-panel.md)  \n\n???+ note\n    The documentation is currently being worked on.  \n    Several pages need to be completed or are currently missing (the *Additional functionality* section).\n\n#### Documentation tips\n\nMost app views have a *question mark* button in the upper-right corner.  \n*Click* it to view the panel's documentation page in the app's built-in *Help* panel.  \n\n**Images**\n\n*Click* on an image to enlarge it. Depending on where the documentation is viewed:  \n\n- the image is opened in a new tab if viewed in a browser.\n- the image is opened in a preview popup if viewed from the app's built-in *Help* panel.  \nTo close the preview popup, *click* again on the image (either in the preview popup or in the page) or press the *Escape* key.\n\n**Videos**\n\n*Click* on a video's full-screen button in the bottom-right corner to enlarge it.  \nTo restore to default size, *click* again on the full-screen button or press the *Escape* key.\n"
  },
  {
    "path": "docs/docs/options.md",
    "content": "???+ note\n    The documentation is currently being worked on.  \n"
  },
  {
    "path": "docs/docs/profile-marking.md",
    "content": "???+ note\n    The documentation is currently being worked on.  \n"
  },
  {
    "path": "docs/docs/profiling-ui.md",
    "content": "#### Trace views\n\nOnce a trace is loaded, the *Summary*, *Flame Graph*, and *Timeline* views provide a high-level overview of the profiled application's slowest parts. These views allow you to identify the functions where most time is spent and when they execute.\n\n[![Profiling UI screenshot](img/profiling-ui-labels.png)](img/profiling-ui_1998x1377.png){:target=\"_blank\"}\n\n- [Summary view](summary-panel.md): displays all the functions with profiling data, which are sorted by default based on their exclusive (self) duration.\n\n    The left side of the panel lists the modules (binaries) with profiling data, sorted based on the total time used by the functions part of the module.  \n\n- [Flame Graph view](flame-graph-panel.md): displays an interactive *Flame Graph* view of the call tree. The right side of the panel shows detailed information about the selected node(s).  \n\n- [Timeline view](timeline-panel.md): displays the thread activity during the entire duration of the trace and allows filtering of the displayed profiling data to specific threads and time ranges.  \n\n- [Call Tree view](call-tree-panel.md): displays nested call tree view showing the function call sequence for the entire trace.  \n\n- [Caller/Callee view](caller-panel.md): displays for the function selected in the Summary view the list of callers (functions calling the selected one) and callees (functions called by the selected one).  \n\n#### Single function views\n\nOpen a function to display the *Assembly*, *Source File*, and *Flow Graph* views and see which parts take the most time (a *double-click* or the *Return* key in any of the views opens the function's *Assembly* view).\n\n[![Profiling UI screenshot](img/profiling-ui2-labels.png)](img/profiling-ui2_1998x1377.png){:target=\"_blank\"}\n\n- [Assembly view](assembly-view.md): displays the function's assembly code, where each instruction is annotated with the corresponding source line number and inlining information.  \n\n    The right side shows the time percentage (relative to the function's time) and time taken by each instruction. The slowest instructions are marked with colors and flame icons. *Clicking* an instruction selects its corresponding source line in the *Source File* view.  \n\n- [Source File view](source-panel.md): displays the function's source file and, optionally, the assembly code generated for each line.  \n\n    The right side shows the time percentage (relative to the function's time) and time taken by each line. The slowest lines are marked with colors and flame icons. *Clicking* a line selects the corresponding instructions in the *Assembly* view.  \n\n- [Flow Graph view](source-panel.md): displays the function's [control-flow graph](https://en.wikipedia.org/wiki/Control-flow_graph){:target=\"_blank\"}, constructed by analyzing the assembly code and forming basic blocks (a sequence of instructions that starts with jump targets and ends with jumps or branch instructions).  \n\n    The slowest blocks are marked with colors and labeled with the time percentage (relative to the function's time). Blocks forming a loop are marked with a green arrow.  "
  },
  {
    "path": "docs/docs/rust.md",
    "content": "???+ note\n    The documentation is currently being worked on.  \n"
  },
  {
    "path": "docs/docs/source-panel.md",
    "content": "#### Overview\n\nThe Source File view displays the source code of the function viewed in the active *Assembly** view. When a function is opened in the **Assembly* view, using the debug info file, its corresponding source file is identified, downloaded if needed, and loaded in the view, with source lines annotated with profiling information.  \n\n[![Profiling UI screenshot](img/source-view_1000x503.png)](img/source-view_1000x503.png){:target=\"_blank\"}\n\n##### Finding source files\n\nLocating the source file to load is done with the help of the debug info file, which usually records the file path associated with each function. In some cases, additional information is available to locate and download source files from remote locations and [Source Servers](https://learn.microsoft.com/en-us/windows/win32/debug/source-server-and-source-indexing).\n\nSteps for locating a source file:  \n\n- check the local file system using the debug info file path. This check handles the case of the trace being opened on the same machine where the application was built or the source is available at the exact file system location.\n- check and download the source file from a [Source Server](https://learn.microsoft.com/en-us/windows/win32/debug/source-server-and-source-indexing) if the debug info file has additional remote file mapping information such as [SourceLink](https://github.com/dotnet/sourcelink) or built-in commands for retrieving the file. In case authentication is needed, it can be configured in the *Load Profile Trace* window [options](trace-loading.md#authentication).\n- if neither of the above steps works, ask the user to manually locate the source file on a local file system or network share. The mapping between the expected and actual source file locations is saved across sessions when the application is closed. See the [Mapping source files](#mapping-source-file-locations) section below for more details.\n\nOnce a source file is available, its signature is computed and compared with the expected signature from the debug info file. If it does not match, it means the source file was modified between the time the application was built and the trace being loaded, and the file will be rejected (a future version will allow ignoring such a mismatch).  \n\n##### Missing source files\n\nIf a source file cannot be found, the app will show a dialog asking if it should continue trying to locate the same source file in the future; if not, the file is added to an exclusion list saved across sessions.  \n\nThe same dialog also has the option to stop asking to locate source files manually during the current session altogether.\n\nUse the *Reset* button in the toolbar to remove the exclusion from the current file, all files or clear all exclusion and mapping settings. The [Source File options](#view-options) displays editable lists of exclusions and mappings.  \n\n##### Mapping source file locations\n\nWhen a local source file is manually selected, a mapping between the original debug file path and the local file path is created. This mapping is used to locate the same source file later and to help locate other source files found in the same or a nearby location.  \n\nFor example, if the original path from the build machine was saved in the debug info file as:  \n```C:\\server\\src\\subdir\\source.cpp```\n\nand the selected local file path is:  \n```D:\\local\\project\\src\\subdir\\source.cpp```\n\nseveral path mappings are created between the original and local directories such as:  \n```C:\\build\\src\\subdir  ->  D:\\local\\project\\src\\subdir```  \n```C:\\build\\src  ->  D:\\local\\project\\src```  \n```C:\\build  ->  D:\\local\\project```  \n\nWhen another source file is searched, starting with the debug info path, the mappings are used to locate it in the local file system. The mapping also works with intermediate directories between the file name and the mapped directories. For example:\n\n```C:\\build\\src\\other\\nested\\subdir\\file.cpp``` found as  \n```D:\\local\\project\\src\\other\\nested\\subdir\\file.cpp```\n\n#### Source code view\n\nThe view is similar to the *Assembly* view, having four parts:  \n\n- a main toolbar at the top, with general action buttons.\n- a secondary toolbar underneath with profiling-specific info and action buttons.\n- the text view with the source file.\n- several columns on the right side with the profiling data for each source line. If CPU performance counters are found and loaded from the trace, the additional columns with metrics and the counters are appended after the last column.  \n\nEach line corresponds to one source line, with the following values and buttons from left to right:\n\n[![Profiling UI screenshot](img/source-line_911x65.png){: style=\"width:550px\"}](img/source-line_911x65.png){:target=\"_blank\"}\n\n- source line number.\n- optional ASM section expand/collapse +/- button.\n- optional marking icons for statements and call targets.\n- source line text.\n- profiling data columns, such as the execution time percentage and value.\n\n##### Selection sync\n\nWhen a source line is selected, if *Sync* is enabled in the toolbar, the associated instructions are also selected in the *Assembly* view.  \n\nIn the example below, the start of the loop on line 21 is selected, with the instructions forming the loop header selected in the *Assembly* view; the selected instructions corresponding to the loop back-edge are not visible in the screenshot.\n\n[![Profiling UI screenshot](img/source-selection-sync_934x400.png)](img/source-selection-sync_934x400.png){:target=\"_blank\"}\n\nVice versa, selecting an instruction in the *Assembly* view also selects the corresponding source line.\n\n##### Profiling annotations\n\nSimilar to the *Assembly* view, execution time is displayed and annotated on several parts of the source lines and columns using text, colors, and flame icons:\n\n- the *Time (%)* column displays the source line's execution time percentage relative to the total function execution time. The column style can be changed in the [Source File options](#view-options).\n- the *Time (ms)* column displays the source files's execution time value. The time unit and column style can be changed in the [Source File options](#view-options).\n- the source line background is colored based on its execution time - the slowest source line has a red color, next slowest orange, then shades of yellow. The line is also marked in the vertical text scrollbar.\n- the three slowest source lines also have a flame icon in the *Time (%)* column using the same color coding.\n\nWhen loading a source file, the slowest source line is selected and brought into view by default (this can be configured in the [Source File options](#view-options)).  \n\nTo jump at any time to the slowest source line, *click* the ![](img/flame-icon.png) icon from the toolbar or the *Ctrl+H* keyboard shortcut.  \n\n???+ note\n    When multiple source lines are selected, the application status bar displays the sum of their execution time as a percentage and value.  \n    [![Profiling UI screenshot](img/source-selection_983x255.png)](img/source-selection_983x255.png){:target=\"_blank\"}\n\n##### Assembly code sections\n\nIIf enabled, each source line is followed by a section with the assembly instructions generated for it based on the debug info file. By default, the sections are collapsed and can be expanded by *clicking* the + button on the left of the source lines. Each line of assembly has the same profiling annotations as the source lines.\n\n[![Profiling UI screenshot](img/source-assembly_816x233.png)](img/source-assembly_816x233.png){:target=\"_blank\"}\n\nTo view the assembly sections, toggle the ASM button in the toolbar (enabled by default). The *Expand* and *Collapse* buttons in the toolbar can be used to toggle the visibility of all assembly sections together.\n\n##### Call targets\n\nCombining the parsed assembly code and profiling information, source lines with associated call instructions are marked with their target(s) and have an arrow icon placed before the call opcode:  \n\n- for direct calls (target is an function name/address), a black arrow is used.\n- for indirect or virtual function calls (target is a register or memory operand), a green arrow is used.\n\n*Hovering* with the mouse over the arrow displays a list of target functions with details about their execution time. Note that the list may contain a function that doesn't appear directly in the source code due to function inlining, like in the example below.\n\n[![Profiling UI screenshot](img/source-call-target_845x164.png)](img/source-call-target_845x164.png){:target=\"_blank\"}\n\n##### Source code outline\n\nOn load, source files are parsed using [tree-sitter](https://tree-sitter.github.io/tree-sitter/) in order to build an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree). The AST identifies and marks some of the high-level parts of the function's source code, such as if/else/switch statements, for/do/while loops, and call expressions. The supported languages are C, C++, C#, and Rust.  \n\nFor each such statement and expression, the execution time is computed by accumulating the time of each source line found in its range. This makes it easier, for example, to see the amount of time spent in an entire *loop* (or *nested loop*), the *then/else* branch of an *if* statement, or a specific *case* of a *switch* statement.  \n\nSource lines that start a statement are marked with an icon based on the statement kind on the left side and in the execution time percentage column (configurable in the [Source File options](#view-options)).  \n\n*Hovering* with the mouse over a statement marking shows its execution time as a percentage and value relative to the function time and highlights the source lines part of the statement.  \n\n[![Profiling UI screenshot](img/source-outline-loop_991x228.png)](img/source-outline-loop_991x228.png){:target=\"_blank\"}\n\nUse the *Outline* button from the profiling toolbar displays to display a menu summarizing the nested statements and their execution time. Each menu entry has the source line number, statement kind icon, statement start source code, execution time percentage, and value.  \n\n*Click* on a menu entry to jump to the statement start. *Hovering* with the mouse over a menu entry highlights the source lines part of the statement.\n\nThe example below shows the outline of a function having three nested loops, with if/else statements in the last level loop.\n\n[![Profiling UI screenshot](img/source-outline_953_289.png)](img/source-outline_953_289.png){:target=\"_blank\"}\n\n#### Profiling toolbar\n\nThe profiling toolbar provides more advanced functionality for identifying the slow parts of a function and filtering the profiling data based on a function instance and the threads the function executed on. The following sections document the main functionality.  \n\n##### Profile\n\nDisplays a menu with the slowest source lines, sorted by execution time in decreasing order. Even if assembly sections are enabled, instructions are not included.  \n\n- *Click* on a menu entry to select and bring the source line into view.  \n- *Click* the ![](img/flame-icon.png) icon to jump to the slowest source line in the function.  \n- *Click* the +/- buttons to jump to the next/previous slowest source line in the sequence.\n\n[![Profiling UI screenshot](img/source-profile_920x251.png){: style=\"width:550px\"}](img/source-profile_920x251.png){:target=\"_blank\"}  \n\n##### Outline\n\nDisplays a menu that summarizes  the nested statements and their execution time.  \nSee the [Source code outline](#source-code-outline) section above for documentation.\n\n##### Instances\n\nThe Instances menu displays the call paths leading to all instances of the function, with their execution time percentage and value, similar to the *Assembly* view feature.  \n\nSee the [Profiling toolbar: Instances](assembly-view.md#instances) section in the *Assembly* view page for details.\n\n##### Threads\n\nThe Threads menu displays the threads IDs and their execution time percentage and value, similar to the *Assembly* view feature.  \n\nSee the [Profiling toolbar: Threads](assembly-view.md#threads) section in the *Assembly* view page for details.\n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/source-toolbar-open.png) | Shows an *Open File* dialog to select a local source file to load in the view. |\n    | ![](img/source-toolbar-reset.png) | Displays a menu with options for resetting exclusions set on the current source file or all source files. |\n    | ![](img/source-toolbar-path.png) | Displays a menu with options for copying the source file path to clipboard, navigating to the source file in *File Explorer* and opening the source file in the default editor. |\n    | ![](img/flame-graph-toolbar-sync.png) | If enabled, selecting a source lines also selects all associated instructions in the *Assembly* view. |\n    | ![](img/source-toolbar-asm.png) | If enabled, each source line is followed by a section with the assembly instructions generated for it, based on the debug info file. See [Assembly code sections](#assembly-code-sections) above for details. |\n    | ![](img/source-toolbar-asm-collapse.png) | Hides (collapses) all assembly sections. |\n    | ![](img/source-toolbar-asm-expand.png) | Shows (expands) all assembly sections. |\n    | ![](img/assembly-toolbar-popup.png) | Opens the current source file into a new preview popup. |\n\n#### Exporting\n\nThe function's source code, combined with profiling annotations and execution time can be exported and saved into multiple formats, with the slowest source lines marked using a similar style as in the application:\n\n- Excel worksheet (*.xlsx)  \n  [![Profiling UI screenshot](img/source-export-excel_876x439.png){: style=\"width:480px\"}](img/source-export-excel_876x439.png){:target=\"_blank\"}\n- HTML table (*.html)  \n  [![Profiling UI screenshot](img/source-export-html_926x537.png){: style=\"width:480px\"}](img/source-export-html_926x537.png){:target=\"_blank\"}\n- Markdown table (*.md)  \n  [![Profiling UI screenshot](img/source-export-markdown_987x453.png){: style=\"width:480px\"}](img/source-export-markdown_987x453.png){:target=\"_blank\"}\n\nThe Export menu in the toolbar also has an option to copy to clipboard the function's source code as a HTML/Markdown table (pasting in an application supporting HTML - such as the Microsoft Office suite and online editors - will use the HTML version, code/text editors will use Markdown version instead).  \n\nThe *Ctrl+C* keyboard shortcut copies to the clipboard only the selected source lines as a HTML/Markdown table.\n\n#### View options\n\n*Click* on the *Gears* icon in the top-right part of the view displays the options panel (alternatively, use the *Source File* tab in the application *Settings* window.).  \n\nThe tabs below describe each page of the options panel:  \n=== \"General\"\n    [![Profiling UI screenshot](img/source-options-general_599x702.png){: style=\"width:400px\"}](img/source-options-general_599x702.png){:target=\"_blank\"}  \n\n=== \"Source Files\"\n    [![Profiling UI screenshot](img/source-options-files_590x441.png){: style=\"width:400px\"}](img/source-options-files_590x441.png){:target=\"_blank\"}  \n\n=== \"Profiling\"\n    [![Profiling UI screenshot](img/source-options-profiling_591x583.png){: style=\"width:400px\"}](img/source-options-profiling_591x583.png){:target=\"_blank\"}  \n\n#### More documentation in progress\n- options panel"
  },
  {
    "path": "docs/docs/style.css",
    "content": ".md-typeset h4 {\n    font-size: 18px;\n}\n\n.md-typeset h5 {\n    text-transform: none;\n    font-size: 16px;\n    font-weight: 600;\n    padding: 0;\n    margin: 0;\n}\n\n.md-typeset h1,\n  .md-content__button {\n    display: none;\n}\n\n.md-content__inner {\n    padding-top: 0;\n}\n\n.md-main__inner {\n    margin-top: 0;\n}\n\n.md-typeset__table {\n    line-height: 1;\n}\n\n.md-typeset__table table:not([class]) {\n    font-size: .8rem;\n}\n\n.md-typeset table:not([class]) th,\n.md-typeset table:not([class]) td {\n    padding: 8px 12px;\n    vertical-align:middle;\n}\n\n.md-typeset .admonition,.md-typeset details {\n    font-size: .7rem;\n}\n\n.md-typeset table:not([class]) {\n    overflow: hidden;\n}\n\n.md-typeset .admonition,\n.md-typeset details {\n  border-width: 0;\n  border-bottom-width: 1px;\n}\n\nli + li {\n    margin-top: -5px;\n}\n\n.md-typeset .tabbed-labels>label {\n    font-size: .7rem;\n    color:black;\n}\n\nhtml {\n    font-size:larger;\n}\n"
  },
  {
    "path": "docs/docs/summary-panel.md",
    "content": "#### Overview\n\nThe summary view displays all modules (binaries) and functions that have profile data in the trace, making it easy to identify the functions where most time is spent — otherwise known as application hotspots.\n\n[![Profiling UI screenshot](img/summary-panel_1233x417.png)](img/summary-panel_1233x417.png){:target=\"_blank\"}\n\nThe view has three parts:  \n\n- a toolbar at the top, with action buttons and the *Search* input box.\n- the Modules panel on the left side. Its visibility can be toggled using the *Modules* button in the toolbar.\n- the list of functions from either the entire trace or filtered to display only the functions part of a single module. By default, the list is sorted by self (exclusive) time in descending order.\n\n##### Modules list\n\nThe modules list has an entry for each module with profile data and starts with an *All* entry representing all modules combined.  \n\nEach entry has the module name, total (inclusive) execution time percentage relative to the entire trace and the time value, with a background color based on its name.  \n\nModules are sorted by their execution time in descending order. By default, the *All* entry is active and the function list displays all functions with profile data in the trace.  \n\n*Double-click* a module (or press the *Return* key) to display only its functions. Selecting a module while the *All* entry is active selects its functions in the list.\n\n##### Functions list\n\nThe function list has an entry for each function with profile data. Each entry has:  \n\n- the [demangled](https://en.wikipedia.org/wiki/Name_mangling) (undecorated) function name.  \n- module name, a background color based on its name.\n- self (exclusive) execution time percentage relative to the entire trace and the time value.  \n- total (inclusive) execution time percentage relative to the entire trace and the time value.  \n- optionally, the mangled (decorated) function name, configurable in the [Summary options](#view-options).\n\nIf CPU performance counters are found and loaded from the trace, the additional columns with metrics and the counters are appended after the last column.  \n\nThe list is filtered based on the active module. The function list is by default sorted by the self (exclusive) execution time in decreasing sorting order. The displayed columns and style can be customized in the [Summary options](#view-options).  \n\n*Click* the same column header to toggle between decreasing and  increasing sorting order.  \n*Click* on a column to sort the list based on its values.  \n\n???+ note\n    The same sorting actions apply to other list views in the application. Not all list views support sorting currently.  \n    \n    The columns in all list views can be resized and reorder. The new layout is saved across sessions when closing the application.\n\nIf marking of functions based on name or module is active, the function entries use the matching marking background color.\n\nHovering over a function displays a popup with the slowest stack trace (call path) ending at the function instance with most execution time. Pin or drag the popup to keep it open.  \n[![Profiling UI screenshot](img/summary-preview_654x551.png){: style=\"width:450px\"}](img/summary-preview_654x551.png){:target=\"_blank\"}\n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/flame-graph-toolbar-sync.png) | If enabled, selecting a function also selects it in the other profiling views. |\n    | ![](img/flame-graph-toolbar-source.png) | If enabled, selecting a function also displays the source in the *Source File* view, with the source lines annotated with profiling data. |\n    | Export | Export the current function list into one of multiple formats (Excel, HTML and Markdown) or copy to clipboard the function list as  a HTML/Markdown table. |\n    | Search box | Search for functions with a specific name using a case-insensitive substring search. Searching filters the list down to display only the matching entries. Press the *Escape* key to reset the search or the *X* button next to the input box. |\n    | ![](img/summary-toolbar-up.png) | Scrolls up the list to the start (equivalent to pressing *Ctrl+Home*). |\n\n???+ abstract \"Mouse shortcuts\"\n    | Action | Description |\n    | ------ | ------------|\n    | Hover | Hovering over a function displays a popup with the stack trace (call path) end with the slowest function's instance. Pin or drag the popup to keep it open.|\n    | Click | Selects the function in the other views if *Sync* is enabled in the toolbar and displays the source in the *Source File* view if *Source* is enabled in the toolbar.  |\n    | Double-click | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Double-click | Opens the *Assembly* view of the selected function in a new tab. |\n    | Right-click | Shows the context menu for the selected functions. |\n\n    !!! note\n        When multiple functions are selected, the application status bar displays the sum of their execution time as a percentage and value.\n\n???+ abstract \"Keyboard shortcuts\"\n    | Keys | Description |\n    | ------ | ------------|\n    | Return | Opens the *Assembly* view of the selected function in the active tab. |\n    | Ctrl+Return | Opens the *Assembly* view of the selected function in a new tab. |\n    | Ctrl+Left | Opens the *Assembly* view of the selected function in a new tab docked to the left of the active tab. |\n    | Ctrl+Right | Opens the *Assembly* view of the selected function in a new tab docked to the right of the active tab. |\n    | Alt+Return | Opens a preview popup with the assembly of the selected function. Press the *Escape* key to close the popup.<br><br>Multiple preview popups can be can be kept open at the same time. |\n    | Ctrl+C | Copies to clipboard a HTML and Markdown table with a summary of the selected functions. |\n    | Ctrl+Shift+C | Copies to clipboard the function names of the selected functions. |\n    | Ctrl+Alt+C | Copies to clipboard the mangled/decorated function names of the selected functions. |\n\n???+ abstract \"Right-click context menu\"\n    [![Profiling UI screenshot](img/summary-context-menu_569x661.png){: style=\"width:380px\"}](img/summary-context-menu_569x661.png){:target=\"_blank\"}  \n\n#### Exporting the function list\n\nThe current function list can be exported and saved into multiple formats, with the slowest functions marked using a similar style as in the application:\n\n- Excel worksheet (*.xlsx)  \n  [![Profiling UI screenshot](img/summary-export-excel_1366x327.png)](img/summary-export-excel_1366x327.png){:target=\"_blank\"}\n- HTML table (*.html)  \n  [![Profiling UI screenshot](img/summary-export-html_1209x287.png)](img/summary-export-html_1209x287.png){:target=\"_blank\"}\n- Markdown table (*.md)  \n  [![Profiling UI screenshot](img/summary-export-markdown_1003x172.png)](img/summary-export-markdown_1003x172.png){:target=\"_blank\"}\n\nThe *Export* menu in the toolbar also has an option to copy to the clipboard the current function list as an HTML/Markdown table (pasting in an application supporting HTML - such as the Microsoft Office suite and online editors - will use the HTML version, code/text editors will use Markdown version instead).  \n\nThe *Ctrl+C* keyboard shortcut copies to the clipboard only the selected functions as a HTML/Markdown table.\n\n#### View options\n\n*Click* on the *Gears* icon in the top-right part of the view displays the options panel (alternatively, use the *Summary* tab in the application *Settings* window.).  \n\nThe tabs below describe each page of the options panel:  \n=== \"General\"\n    [![Profiling UI screenshot](img/summary-options-general_575x573.png){: style=\"width:400px\"}](img/summary-options-general_575x573.png){:target=\"_blank\"}  \n\n=== \"Profiling\"\n    [![Profiling UI screenshot](img/summary-options-general_577x398.png){: style=\"width:400px\"}](img/summary-options-general_577x398.png){:target=\"_blank\"}  \n\n#### More documentation in progress\n\n- Context menu\n- Marking functions\n- Options"
  },
  {
    "path": "docs/docs/timeline-panel.md",
    "content": "#### Overview\n\nThe Timeline view displays the application's activity for the entire trace duration, with each thread having a histogram showing the CPU usage based on the number of profile samples collected over time.  \n\nThis view helps identify the threads and time ranges with CPU activity (or lack thereof due to locks and I/O). It also has features for filtering the entire profile data to consider only specific threads and time ranges.  \n\n[![Profiling UI screenshot](img/timeline-view_1028x418.png)](img/timeline-view_1028x418.png){:target=\"_blank\"}\n\nThe view has three parts:\n\n- a main toolbar at the top, with general action buttons.\n- a graph showing the activity of the entire application, with the activity across all threads combined.\n- for each thread, a graph showing the thread's activity. The thread list is sorted by the execution time in descending order.\n\nThe *All Threads* entry displays the trace duration range on top, split into time units. The maximum number of CPU cores the application uses is displayed on the left. Individual threads use, at most, one core.  \n\nEach individual thread entry has the following values and buttons:\n\n[![Profiling UI screenshot](img/timeline-threads_599x159.png){: style=\"width:500px\"}](img/timeline-threads_599x159.png){:target=\"_blank\"}\n\n- thread visibility button indicating if the samples from the thread are included in the profile data or not. *Click* to toggle between included ![](img/timeline-eye-button.png) or excluded state ![](img/timeline-eye-button-disabled.png).\n- thread context menu button ![](img/timeline-menu-button.png) that shows thread filtering actions.\n- the thread ID number.\n- the thread execution time as a sum of the duration of all samples that ran on the thread.\n- if available in the trace, the thread name.\n  \n#### Mouse actions\n\n*Moving* the mouse over the graphs shows the time position and the approximate number of cores used at that point.\n\n[![Profiling UI screenshot](img/timeline-position_570x116.png){: style=\"width:500px\"}](img/timeline-position_570x116.png){:target=\"_blank\"}\n\n*Hovering* with the mouse over the graph shows a preview popup with the slowest call path (stack trace) active at that point.  \n\n[![Profiling UI screenshot](img/timeline-hover_829x394.png){: style=\"width:600px\"}](img/timeline-hover_829x394.png){:target=\"_blank\"}\n\n*Clicking* a thread ID or name creates a time range selection for the thread covering the entire trace duration. If *Sync* is enabled in the toolbar, all functions executing on the selected thread are also selected in the other profiling views.  \n\n##### Selecting a time range\n\n- To select a time range that includes all threads, *click and drag* over the desired range in the top *All Threads* graph. The duration of the current selection is displayed in the top *All Threads* graph. Note that if some threads are excluded, the selection will not consider them.  \n  \n    [![Profiling UI screenshot](img/timeline-select_879x239.png)](img/timeline-select_879x239.png){:target=\"_blank\"}\n\n- To select a time range for a single thread, *click and drag* over the desired range in the specific thread graph. To include another thread in the same time range, from the thread action menu, **click* *Include thread* or use the ![](img/timeline-eye-button.png) icon.  \n    \n    [![Profiling UI screenshot](img/timeline-select-single_879x199.png)](img/timeline-select-single_879x199.png){:target=\"_blank\"}\n\n???+ note\n    If the *Sync* option is enabled, selecting a time range also selects the functions executing during that time in the other profiling views, considering if all threads or a subset are included.\n\n#### Filtering the profile\n\nThe entire profile can be filtered so that only specific threads and time ranges are displayed, with the profiling views updated to include only the profile samples accepted by the filter. The active filter is displayed in both the toolbar and the application menu bar.\n\n##### Filtering based on a time range\n\nSelect the desired time range, then *double-click* the selection (alternatively, *right-click* the selection and *click* \"Filter to Time Range*). If a single thread is selected, a filter that displays only the selected thread and excludes all others is also added.  \n\n[![Profiling UI screenshot](img/timeline-filter-time_878x320.png)](img/timeline-filter-time_878x320.png){:target=\"_blank\"}\n    \n##### Filtering based on a thread\n\nThere are multiple ways to filter based on one or multiple threads, optionally combined with a time range filter.  \n\n[![Profiling UI screenshot](img/timeline-thread-menu_480x317.png){: style=\"width:350px\"}](img/timeline-thread-menu_480x317.png){:target=\"_blank\"}\n\n- to include a single thread and exclude all others, *double-click* the thread ID or *click* *Filter to Thread* from the thread action menu.\n- to include another thread, *click* the ![](img/timeline-eye-button-disabled.png) icon or *click* *Include Thread*.\n- to include all threads with the same name and exclude all others, *click* *Filter to Same Name Threads*.\n- to include all threads with the same name, *click* *Filter to Same Name Threads*.\n- to exclude a thread, *click* the ![](img/timeline-eye-button.png) icon or *click* *Exclude Thread*.\n- to exclude all threads with the same name, *click* *Exclude Same Name Threads*.\n\nExample of a filter including a single thread (58540) and a time range of ~2 sec. Excluded threads and time ranges are displayed using faded colors. Use the X buttons next to *Time* and *Threads* in the toolbar to remove the filter.\n\n[![Profiling UI screenshot](img/timeline-filter-time-thread_889x317.png)](img/timeline-filter-time-thread_889x317.png){:target=\"_blank\"}\n\n#### Marking samples\n\nThe samples corresponding to a function instance can be marked from the *Flame Graph* view using the right-click context menu of a node and selecting a color from the *Mark In Timeline* menu entry. \n[![Profiling UI screenshot](img/timeline-mark-menu_907x233.png)](img/timeline-mark-menu_907x233.png){:target=\"_blank\"}\n\nThe *Markers* menu in the toolbar displays the currently marked functions.   \n*Click* on a menu entry to remove the marker.  \n\n[![Profiling UI screenshot](img/timeline-marking_929x333.png)](img/timeline-marking_929x333.png){:target=\"_blank\"}\n\n#### View interaction\n\n???+ abstract \"Toolbar\"\n    | Button | Description |\n    | ------ | ------------|\n    | ![](img/flame-graph-toolbar-reset.png) | Resets the view to it's original state, displaying the thread graphs for the entire trace duration. |\n    | ![](img/flame-graph-toolbar-minus.png) | Zooms out the thread graphs and updates the time units. |\n    | ![](img/flame-graph-toolbar-plus.png) | Zooms in the thread graphs and updates the time units. |\n    | ![](img/flame-graph-toolbar-sync.png) | If enabled, selecting a time range also selects executing during that time in the other profiling views. |\n    | Markers | Search for nodes with a specific function name using a case-insensitive substring search. Press the *Escape* key to reset the search or the *X* button next to the input box. |\n\n#### Documentation in progress\n\n- View options"
  },
  {
    "path": "docs/docs/trace-loading.md",
    "content": "#### Loading a new trace\n\nThere are several ways to open a new ETW trace file (*.etl):\n\n- Use the **Open** button in the *Start Page* displayed on startup.\n- Use the **Profiling** -> **Load Profile** menu.\n- Use the **Ctrl+O** keyboard shortcut.\n\nOnce the trace file is selected in the *Open File dialog*, the **Load profile trace** window is displayed. It lists the processes (applications) that are captured in the trace, sorted by weight (number of samples).\n\n[![Load profile window screenshot](img/load-trace_1332x738.png)](img/load-trace_1332x738.png){:target=\"_blank\"}\n\nFrom the list, select the process you want to analyze and *click* the **Load Profile** button (alternatively, *double-click* or press the *Return* key).  \n\nThe selected process is loaded from the trace file, any required binary and symbol files are downloaded and the profiling data is analyzed. Once loading is completed, the window closes and the profiling views are populated, as described in [Profiling UI overview](profiling-ui.md).\n\n???+ note\n    If the trace fails to load, the *Profiling Trace Report* windows is automatically opened. The *Modules tab* lists the modules referenced by the trace and indicates whether the binary and debug info symbols could be found and loaded. See the [Profiling Trace report](trace-overview.md) page for more details.\n\n#### Loading a previously opened trace\n\nPreviously opened traces are saved as sessions. Recent sessions can be quickly opened again for the same process using either the *Start page* or the session list on the left of the *Load profile trace* window (*double-click* an entry or press the *Return* key).\n\n[![Start page screenshot](img/start-page_825x459.png)](img/start-page_825x459.png){:target=\"_blank\"}\n\n#### Symbols configuration\n\nSymbols are the binary (EXE/DLL) and debug info (PDB) files required to analyze the processes recorded in a trace. The binaries are used to disassembly individual functions and the debug files are used to resolve function names and provide the source file and line number information.\n\n[![Load profile window options screenshot](img/symbols_1332x826.png)](img/symbols_1332x826.png){:target=\"_blank\"}\n\n##### Symbol paths\n\nSymbols are searched in the locations indicated by the **Symbol Paths** list, found in the **Symbols** tab of the *Load profile trace* window. Symbol locations can be of two types:  \n\n- Paths to local directories or network file shares.  \n- Symbol server URLs. By default, the [Microsoft public symbol server](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/microsoft-public-symbols) is added to the list, with a local download cache directory at *C:\\Symbols*.\n  \n!!! note\n    More info about symbol servers and the symbol path syntax is available here:  \n    [https://learn.microsoft.com/en-us/windows/win32/debug/using-symsrv](https://learn.microsoft.com/en-us/windows/win32/debug/using-symsrv)\n\n##### Missing debug info symbols\n\nWhen the debug info symbols (PDB file) for a module cannot be found, the names of the functions used by the app during the trace are replaced by their *Relative virtual address* (RVA) as a hexadecimal value (*127F* for example).  \n\nYou can use the logs from the [Trace view report](trace-overview.md) to understand why symbols could not be found, such as using wrong local directory paths or a symbol server being unreachable.\n\n##### Additional symbol options\n\n| Option | Description |\n| ------ | ------------|\n| Include __NT__SYMBOL__PATH environment variable | Append the environment variable's value to the list of searched symbol paths. |\n| Include subdirectories for local paths | Consider symbols in sub-directories up to 3 levels deep for the local directories in the *Symbols Paths* list. |\n| Don't load symbols for very low sample modules | Skip downloading and loading of symbols for modules with a low number of samples. This helps reduce download time for processes with many modules, where the majority have few relevant samples.<br><br> A module is skipped if it has fewer samples than a threshold. This threshold can be configured using the *Minimum samples* field as a percentage of the total number of samples. |\n| Don't load symbols that failed in previous sessions | Skip downloading and loading of symbols that could not be found in previous sessions (for example, due to offline symbol servers). The list of skipped symbols can be viewed and cleared. |\n| Cache processed symbol files | Cache the processed debug symbol files and use them to speed up loading of traces requiring the same symbols. The cache files are saved in the temporary directory and can be viewed and cleared. |\n\n#### Trace processing options\n\n[![Load profile window options screenshot](img/load-options__1332x648.png)](img/load-options__1332x648.png){:target=\"_blank\"}\n\n| Option | Description |\n| ------ | ------------|\n| Handle Kernel profile samples | Include samples executing in the kernel context and connect the call stacks between kernel and user mode code. |\n| Handle CPU performance counter samples | Process CPU performance counter (PMC) events and display them in the Summary, Assembly and *Source File* views using additional columns. |\n| Download source files from Source Server | Automatically attempt to download source files from the location indicated by the debug info file. If the download URL requires authentication, it can be configured in the Authentication section found below. |\n\n##### Authentication\n\nAuthentication using an user/email address and Personal Autehnticaion token (PAT) can be configured for both source file servers and symbol servers.\n\n##### Binary files\n\nAdditional local directory paths for searching binary files can be configured. The binary files to process in a trace can be restricted to only the ones in the accepted list."
  },
  {
    "path": "docs/docs/trace-overview.md",
    "content": "#### Overview\n\nThe *Profiling Trace Report* window provides details of the current profiling session, including the loaded trace path and process name/ID, trace recording time and duration, and the machine used to record the trace.\n\nA list of modules referenced by the profiled code is also included, with the symbol search result for both binary and debug info files. The symbol search logs can help you understand why symbols could not be found, such as using wrong local directory paths or a symbol server being unreachable.\n\nTo view the report, once a trace is loaded *click* *Profiling report* from the *Profiling* menu. The report is also automatically displayed if a trace fails to load.  \n\n##### Summary\n\n[![Profiling UI screenshot](img/report-general_931x507.png)](img/report-general_931x507.png){:target=\"_blank\"}\n\n##### Modules\n\nOnce a module is selected, the *Image file* and *Debug file* tabs are updated to show the symbol info used to look up the symbols.  \n\n[![Profiling UI screenshot](img/report-modules_969x815.png)](img/report-modules_969x815.png){:target=\"_blank\"}\n\nThe *Logs* section displays the list of symbol search paths used during the search and the steps taken by the algorithm.  \n\n???+ tip\n    If a symbol file is found, but there is a timestamp/checksum mismatch, the symbol is not used and the next search path is queried.  \n\n    If no matching symbols are found for the module, it usually means that the symbols are from a different version of the application than the one recorded in the trace.  \n\n[![Profiling UI screenshot](img/report-debug_963x428.png)](img/report-debug_963x428.png){:target=\"_blank\"}"
  },
  {
    "path": "docs/docs/trace-recording.md",
    "content": "???+ note\n    The documentation is currently being worked on.  \n\n#### Recording a trace\n\nETW traces can be recorded directly from the app in several ways:  \n\n- starting a new process.\n- attaching to a running process.\n- system-wide (default ETW recording mode).\n\nThere are several ways to start a recording:\n\n- Use the **Record** button in the *Start Page* displayed on startup.\n- Use the **Profiling** -> **Record Profile** menu.\n\n[![Profiling UI screenshot](img/record-start-app_1332x830.png)](img/record-start-app_1332x830.png){:target=\"_blank\"}"
  },
  {
    "path": "docs/docs/workspaces",
    "content": "???+ note\n    The documentation is currently being worked on.  \n"
  },
  {
    "path": "docs/mkdocs.yml",
    "content": "site_name: Profile Explorer\nuse_directory_urls: false\nnav:\n  - Introduction: intro.md\n  - Getting started:\n    - About: about.md\n    - Profiling UI overview: profiling-ui.md\n    - Video Demos: demos.md\n  - Trace loading and recording:\n    - Loading a trace: trace-loading.md\n    - Recording a trace: trace-recording.md\n    - Profiling Trace report: trace-overview.md\n  - Trace profile views:\n    - Summary view: summary-panel.md\n    - Flame Graph view: flame-graph-panel.md\n    - Timeline view: timeline-panel.md\n    - Call Tree view: call-tree-panel.md\n    - Caller/Callee view: caller-panel.md\n  - Function profile views:\n    - Assembly view: assembly-view.md\n    - Source File view: source-panel.md\n    - Flow Graph view: flow-graph-panel.md\n  - Additional functionality:\n    - Trace profile overview: profile-overview.md\n    - Function/module marking: profile-marking.md\n    - Workspaces: workspaces.md\n    - Application options: options.md\n    - Rust support: rust.md\ntheme:\n  logo: img/logo.png\n  favicon: img/favicon.png\n  name: 'material'\n  font:\n    text: Roboto\n    code: Roboto Mono\n  palette: \n    # Palette toggle for light mode\n    - scheme: default\n      primary: blue\n      toggle:\n        icon: material/brightness-7 \n        name: Switch to dark mode\n\n    # Palette toggle for dark mode\n    - scheme: slate\n      primary: black\n      toggle:\n        icon: material/brightness-4\n        name: Switch to light mode\n  features:\n    - navigation.expand\n    - navigation.instant\n    - navigation.top\n    - header.autohide\n    - navigation.footer\nextra:\n  generator: false\nextra_css:\n  - style.css\nmarkdown_extensions:\n  - admonition\n  - attr_list\n  - pymdownx.details\n  - pymdownx.superfences\n  - pymdownx.tabbed:\n      alternate_style: true"
  },
  {
    "path": "installer/arm64/installer.iss",
    "content": "; -- Example1.iss --\n; Demonstrates copying 3 files and creating an icon.\n\n; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!\n                                              \n#include \"../environment.iss\"\n\n#define MyAppName \"Profile Explorer\"\n#define MyAppExeName \"ProfileExplorer.exe\"\n\n[Setup]\nAppName=Profile Explorer\nAppVersion={#APP_VERSION}\nWizardStyle=modern\nDisableDirPage=no\nDefaultDirName={autopf}\\Profile Explorer\nDefaultGroupName=Profile Explorer\nUninstallDisplayIcon={app}\\ProfileExplorer.exe\nCompression=lzma2\nSolidCompression=yes\nOutputDir=userdocs:ProfileExplorer\nChangesAssociations = yes\nChangesEnvironment = yes\nOutputBaseFilename=profile_explorer_installer_{#APP_VERSION}_arm64\n\n[Registry]\nRoot: HKCR; Subkey: \"{#MyAppName}\";                     ValueData: \"Program {#MyAppName}\";  Flags: uninsdeletekey;   ValueType: string;  ValueName: \"\"\nRoot: HKCR; Subkey: \"{#MyAppName}\\DefaultIcon\";             ValueData: \"{app}\\{#MyAppExeName},0\";               ValueType: string;  ValueName: \"\"\nRoot: HKCR; Subkey: \"{#MyAppName}\\shell\\open\\command\";  ValueData: \"\"\"{app}\\{#MyAppExeName}\"\" \"\"%1\"\"\";  ValueType: string;  ValueName: \"\"\n\n[Files]\nSource: \".\\out\\\\*\"; DestDir: \"{app}\"; Flags: ignoreversion recursesubdirs\n\n[Icons]\nName: \"{group}\\Profile Explorer\"; Filename: \"{app}\\ProfileExplorer.exe\"\n\n[Tasks]\nName: envPath; Description: \"Add to PATH env. variable as ProfileExplorer.exe\" \n\n[Run]\nFilename: \"{sys}\\Regsvr32.exe\"; Parameters: \"/s msdia140.dll\"; WorkingDir: \"{app}\"; Flags: shellexec runhidden; \n\n[Code]\nprocedure CurStepChanged(CurStep: TSetupStep);\nbegin\n    if (CurStep = ssPostInstall) and IsTaskSelected('envPath')\n    then EnvAddPath(ExpandConstant('{app}'));\nend;\n"
  },
  {
    "path": "installer/arm64/prepare-installer.cmd",
    "content": "set %_VERSION=\"1.2.1\"\n\niscc.exe installer.iss /DAPP_VERSION=%_VERSION% /O%cd%\n"
  },
  {
    "path": "installer/arm64/prepare-out.cmd",
    "content": "set _PUBLISH_PATH=\"publish\"\nset _BUILD_TARGET=\"..\\..\\src\\ProfileExplorerUI\\ProfileExplorerUI.csproj\"\nset _PROFILER_PATH=\"..\\..\\src\\ManagedProfiler\"\nset _EXTERNALS_PATH=\"..\\..\\src\\external\"\nset _EXTERNALS_PATH_ARM64=\"..\\..\\src\\external\\arm64\"\nset _RESOURCES_PATH=\"..\\..\\resources\"\nset _REPO_PATH=\"..\\..\"\nset _OUT_PATH=\"out\"\n\nrd %_OUT_PATH% /s /q\nrd %_PUBLISH_PATH% /s /q\nmkdir %_OUT_PATH%\n\ndotnet publish -c \"Release\" -r win-arm64 --self-contained true --verbosity diagnostic --output %_PUBLISH_PATH% %_BUILD_TARGET%\n\nfor /f \"delims=\" %%i in ('\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -all -prerelease -property installationPath') do set _VS=%%i\nset _VS_ENV=%_VS%\\VC\\Auxiliary\\Build\\vcvarsamd64_arm64.bat\ncall \"%_VS_ENV%\"\n\npushd %_EXTERNALS_PATH%\ncall build-external-arm64.cmd\npopd\n\nmsbuild %_PROFILER_PATH%\\ManagedProfiler.vcxproj /t:Rebuild /p:Configuration=Release /p:Platform=arm64\ncopy %_PROFILER_PATH%\\arm64\\Release\\ManagedProfiler.dll %_OUT_PATH%\n\nxcopy %_PUBLISH_PATH% %_OUT_PATH% /i /c /e /y\nxcopy %_RESOURCES_PATH% %_OUT_PATH% /i /c /e /y\nxcopy %_EXTERNALS_PATH_ARM64%\\*.dll %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH_ARM64%\\config6 %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH%\\tree-sitter\\build_arm64\\*.dll %_OUT_PATH% /i /c /y\ncopy %_EXTERNALS_PATH%\\capstone\\build_arm64\\Release\\capstone.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\cmd\\dot\\Release\\dot.exe %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\cdt\\Release\\cdt.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\cgraph\\Release\\cgraph.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\gvc\\Release\\gvc.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\pathplan\\Release\\pathplan.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\xdot\\Release\\xdot.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\plugin\\core\\Release\\gvplugin_core.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\plugin\\dot_layout\\Release\\gvplugin_dot_layout.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\zlib1.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\libexpat.dll %_OUT_PATH%\ncopy %_REPO_PATH%\\NOTICE.md %_OUT_PATH%"
  },
  {
    "path": "installer/arm64/prepare.cmd",
    "content": "call prepare-out.cmd\ncall prepare-installer.cmd\n"
  },
  {
    "path": "installer/environment.iss",
    "content": "[Code]\nconst EnvironmentKey = 'SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment';\n\nprocedure EnvAddPath(Path: string);\nvar\n    Paths: string;\nbegin\n    { Retrieve current path (use empty string if entry not exists) }\n    if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths)\n    then Paths := '';\n\n    { Skip if string already found in path }\n    if Pos(';' + Uppercase(Path) + ';', ';' + Uppercase(Paths) + ';') > 0 then exit;\n\n    { App string to the end of the path variable }\n    Paths := Paths + ';'+ Path +';'\n\n    { Overwrite (or create if missing) path environment variable }\n    if RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths)\n    then Log(Format('The [%s] added to PATH: [%s]', [Path, Paths]))\n    else Log(Format('Error while adding the [%s] to PATH: [%s]', [Path, Paths]));\nend;\n\nprocedure EnvRemovePath(Path: string);\nvar\n    Paths: string;\n    P: Integer;\nbegin\n    { Skip if registry entry not exists }\n    if not RegQueryStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths) then\n        exit;\n\n    { Skip if string not found in path }\n    P := Pos(';' + Uppercase(Path) + ';', ';' + Uppercase(Paths) + ';');\n    if P = 0 then exit;\n\n    { Update path variable }\n    Delete(Paths, P - 1, Length(Path) + 1);\n\n    { Overwrite path environment variable }\n    if RegWriteStringValue(HKEY_LOCAL_MACHINE, EnvironmentKey, 'Path', Paths)\n    then Log(Format('The [%s] removed from PATH: [%s]', [Path, Paths]))\n    else Log(Format('Error while removing the [%s] from PATH: [%s]', [Path, Paths]));\nend;"
  },
  {
    "path": "installer/x64/installer.iss",
    "content": "; -- Example1.iss --\n; Demonstrates copying 3 files and creating an icon.\n\n; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!\n                                              \n#include \"../environment.iss\"\n\n#define MyAppName \"Profile Explorer\"\n#define MyAppExeName \"ProfileExplorer.exe\"\n\n[Setup]\nAppName=Profile Explorer\nAppVersion={#APP_VERSION}\nWizardStyle=modern\nDisableDirPage=no\nDefaultDirName={autopf}\\Profile Explorer\nDefaultGroupName=Profile Explorer\nUninstallDisplayIcon={app}\\ProfileExplorer.exe\nCompression=lzma2\nSolidCompression=yes\nOutputDir=userdocs:ProfileExplorer\nChangesAssociations = yes\nChangesEnvironment = yes\nOutputBaseFilename=profile_explorer_installer_{#APP_VERSION}_x64\n\n[Registry]\nRoot: HKCR; Subkey: \"{#MyAppName}\";                     ValueData: \"Program {#MyAppName}\";  Flags: uninsdeletekey;   ValueType: string;  ValueName: \"\"\nRoot: HKCR; Subkey: \"{#MyAppName}\\DefaultIcon\";             ValueData: \"{app}\\{#MyAppExeName},0\";               ValueType: string;  ValueName: \"\"\nRoot: HKCR; Subkey: \"{#MyAppName}\\shell\\open\\command\";  ValueData: \"\"\"{app}\\{#MyAppExeName}\"\" \"\"%1\"\"\";  ValueType: string;  ValueName: \"\"\n\n[Files]\nSource: \".\\out\\\\*\"; DestDir: \"{app}\"; Flags: ignoreversion recursesubdirs\n\n[Icons]\nName: \"{group}\\Profile Explorer\"; Filename: \"{app}\\ProfileExplorer.exe\"\n\n[Tasks]\nName: envPath; Description: \"Add to PATH env. variable as ProfileExplorer.exe\" \n\n[Run]\nFilename: \"{sys}\\Regsvr32.exe\"; Parameters: \"/s msdia140.dll\"; WorkingDir: \"{app}\"; Flags: shellexec runhidden; \n\n[Code]\nprocedure CurStepChanged(CurStep: TSetupStep);\nbegin\n    if (CurStep = ssPostInstall) and IsTaskSelected('envPath')\n    then EnvAddPath(ExpandConstant('{app}'));\nend;\n"
  },
  {
    "path": "installer/x64/prepare-installer.cmd",
    "content": "set %_VERSION=\"1.2.1\"\n\niscc.exe installer.iss /DAPP_VERSION=%_VERSION% /O%cd%\n"
  },
  {
    "path": "installer/x64/prepare-out.cmd",
    "content": "set _PUBLISH_PATH=\"publish\"\nset _BUILD_TARGET=\"..\\..\\src\\ProfileExplorerUI\\ProfileExplorerUI.csproj\"\nset _PROFILER_PATH=\"..\\..\\src\\ManagedProfiler\"\nset _EXTERNALS_PATH=\"..\\..\\src\\external\"\nset _RESOURCES_PATH=\"..\\..\\resources\"\nset _REPO_PATH=\"..\\..\"\nset _OUT_PATH=\"out\"\n\nrd %_OUT_PATH% /s /q\nrd %_PUBLISH_PATH% /s /q\nmkdir %_OUT_PATH%\n\ndotnet publish -c \"Release\" -r win-x64 --self-contained --verbosity diagnostic --output %_PUBLISH_PATH% %_BUILD_TARGET%\n\nfor /f \"delims=\" %%i in ('\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -all -prerelease -property installationPath') do set _VS=%%i\nset _VS_ENV=%_VS%\\VC\\Auxiliary\\Build\\vcvars64.bat\ncall \"%_VS_ENV%\"\n\npushd %_EXTERNALS_PATH%\ncall build-external.cmd\npopd\n\nmsbuild %_PROFILER_PATH%\\ManagedProfiler.vcxproj /t:Rebuild /p:Configuration=Release /p:Platform=x64\ncopy %_PROFILER_PATH%\\x64\\Release\\ManagedProfiler.dll %_OUT_PATH%\n\nxcopy %_PUBLISH_PATH% %_OUT_PATH% /i /c /e /y\nxcopy %_RESOURCES_PATH% %_OUT_PATH% /i /c /e /y\nxcopy %_EXTERNALS_PATH%\\config6 %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH%\\*.dll %_OUT_PATH% /i /c /y\nxcopy %_EXTERNALS_PATH%\\tree-sitter\\build\\*.dll %_OUT_PATH% /i /c /y\ncopy %_EXTERNALS_PATH%\\capstone\\build\\Release\\capstone.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\cmd\\dot\\Release\\dot.exe %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\cdt\\Release\\cdt.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\cgraph\\Release\\cgraph.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\gvc\\Release\\gvc.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\pathplan\\Release\\pathplan.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\xdot\\Release\\xdot.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\plugin\\core\\Release\\gvplugin_core.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\plugin\\dot_layout\\Release\\gvplugin_dot_layout.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\zlib1.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\libexpat.dll %_OUT_PATH%\ncopy %_REPO_PATH%\\NOTICE.md %_OUT_PATH%"
  },
  {
    "path": "installer/x64/prepare.cmd",
    "content": "call prepare-out.cmd\ncall prepare-installer.cmd"
  },
  {
    "path": "resources/asm/arm64-asm.xshd",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n\n<!-- Syntax definition for ASM IR -->\n<SyntaxDefinition name=\"ARM64 ASM IR\" xmlns=\"http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008\">\n    <Color name=\"String\" foreground=\"DarkOrange\" />\n    <Color name=\"Digits\" foreground=\"Blue\" />\n    <Color name=\"Comment\" foreground=\"Silver\" />\n    <Color name=\"Keywords\" foreground=\"DarkBlue\" fontWeight=\"bold\"/>\n    <Color name=\"Opcodes\" foreground=\"Crimson\" fontWeight=\"bold\"/>\n    <Color name=\"TransferOpcodes\" foreground=\"Teal\" fontWeight=\"bold\"/>\n    <Color name=\"CallOpcodes\" foreground=\"DarkOrchid\" fontWeight=\"bold\" />\n    <Color name=\"ArrayType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"PointerType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"StructType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"Type\" foreground=\"Maroon\" />\n    <Color name=\"Attributes\" foreground=\"DarkGreen\" fontWeight=\"bold\" />\n    <Color name=\"Annotation\" foreground=\"Silver\" />\n    <Color name=\"Variable\" foreground=\"Black\" fontWeight=\"bold\" />\n    <Color name=\"CallTarget\" foreground=\"DarkGreen\" fontWeight=\"bold\" />\n    <RuleSet ignoreCase=\"false\">\n        <Span color=\"Comment\" begin=\";\" />\n        <Span color=\"String\">\n            <Begin>\"</Begin>\n            <End>\"</End>\n            <RuleSet>\n                <!-- nested span for escape sequences -->\n                <Span begin=\"\\\\\" end=\".\" />\n            </RuleSet>\n        </Span>\n\n        <Keywords color=\"Keywords\">\n            <Word>define</Word>\n            <Word>global</Word>\n            <Word>declare</Word>\n        </Keywords>\n\t\t\n\t\t<Rule color=\"CallOpcodes\">bl\\s+.*</Rule>\n\t\t<Rule color=\"CallOpcodes\">blr\\s+.*</Rule>\n\n        <Keywords color=\"TransferOpcodes\">\n            <Word>b</Word>\n            <Word>br</Word>\n            <Word>cbz</Word>\n            <Word>cbnz</Word>\n            <Word>tbz</Word>\n            <Word>tbnz</Word>\n            <Word>b</Word>\n            <Word>br</Word>\n            <Word>beq</Word>\n            <Word>bne</Word>\n            <Word>blt</Word>\n            <Word>ble</Word>\n            <Word>bgt</Word>\n            <Word>bge</Word>\n            <Word>ret</Word>\n        </Keywords>\n\n        <Keywords color=\"Opcodes\">\n\t\t\t<Word>abs</Word>\n\t\t\t<Word>adc</Word>\n\t\t\t<Word>adclb</Word>\n\t\t\t<Word>adclt</Word>\n\t\t\t<Word>adcs</Word>\n\t\t\t<Word>add</Word>\n\t\t\t<Word>addg</Word>\n\t\t\t<Word>addha</Word>\n\t\t\t<Word>addhn</Word>\n\t\t\t<Word>addhn2</Word>\n\t\t\t<Word>addhnb</Word>\n\t\t\t<Word>addhnt</Word>\n\t\t\t<Word>addp</Word>\n\t\t\t<Word>addpl</Word>\n\t\t\t<Word>addpt</Word>\n\t\t\t<Word>addqv</Word>\n\t\t\t<Word>adds</Word>\n\t\t\t<Word>addspl</Word>\n\t\t\t<Word>addsvl</Word>\n\t\t\t<Word>addv</Word>\n\t\t\t<Word>addva</Word>\n\t\t\t<Word>addvl</Word>\n\t\t\t<Word>adr</Word>\n\t\t\t<Word>adrp</Word>\n\t\t\t<Word>aesd</Word>\n\t\t\t<Word>aese</Word>\n\t\t\t<Word>aesimc</Word>\n\t\t\t<Word>aesmc</Word>\n\t\t\t<Word>and</Word>\n\t\t\t<Word>andqv</Word>\n\t\t\t<Word>ands</Word>\n\t\t\t<Word>andv</Word>\n\t\t\t<Word>asr</Word>\n\t\t\t<Word>asrd</Word>\n\t\t\t<Word>asrr</Word>\n\t\t\t<Word>asrv</Word>\n\t\t\t<Word>at</Word>\n\t\t\t<Word>autda</Word>\n\t\t\t<Word>autdb</Word>\n\t\t\t<Word>autdza</Word>\n\t\t\t<Word>autdzb</Word>\n\t\t\t<Word>autia</Word>\n\t\t\t<Word>autia1716</Word>\n\t\t\t<Word>autiasp</Word>\n\t\t\t<Word>autiaz</Word>\n\t\t\t<Word>autib</Word>\n\t\t\t<Word>autib1716</Word>\n\t\t\t<Word>autibsp</Word>\n\t\t\t<Word>autibz</Word>\n\t\t\t<Word>autiza</Word>\n\t\t\t<Word>autizb</Word>\n\t\t\t<Word>axflag</Word>\n\t\t\t<Word>b</Word>\n\t\t\t<Word>bcax</Word>\n\t\t\t<Word>bcc</Word>\n\t\t\t<Word>b.cc</Word>\n\t\t\t<Word>bcs</Word>\n\t\t\t<Word>b.cs</Word>\n\t\t\t<Word>bdep</Word>\n\t\t\t<Word>beq</Word>\n\t\t\t<Word>b.eq</Word>\n\t\t\t<Word>bext</Word>\n\t\t\t<Word>bf1cvt</Word>\n\t\t\t<Word>bf1cvtl</Word>\n\t\t\t<Word>bf1cvtl2</Word>\n\t\t\t<Word>bf1cvtlt</Word>\n\t\t\t<Word>bf2cvt</Word>\n\t\t\t<Word>bf2cvtl</Word>\n\t\t\t<Word>bf2cvtl2</Word>\n\t\t\t<Word>bf2cvtlt</Word>\n\t\t\t<Word>bfadd</Word>\n\t\t\t<Word>bfc</Word>\n\t\t\t<Word>bfclamp</Word>\n\t\t\t<Word>bfcvt</Word>\n\t\t\t<Word>bfcvtn</Word>\n\t\t\t<Word>bfcvtn2</Word>\n\t\t\t<Word>bfcvtnt</Word>\n\t\t\t<Word>bfdot</Word>\n\t\t\t<Word>bfi</Word>\n\t\t\t<Word>bfm</Word>\n\t\t\t<Word>bfmax</Word>\n\t\t\t<Word>bfmaxnm</Word>\n\t\t\t<Word>bfmin</Word>\n\t\t\t<Word>bfminnm</Word>\n\t\t\t<Word>bfmla</Word>\n\t\t\t<Word>bfmlal</Word>\n\t\t\t<Word>bfmlalb</Word>\n\t\t\t<Word>bfmlalt</Word>\n\t\t\t<Word>bfmls</Word>\n\t\t\t<Word>bfmlsl</Word>\n\t\t\t<Word>bfmlslb</Word>\n\t\t\t<Word>bfmlslt</Word>\n\t\t\t<Word>bfmmla</Word>\n\t\t\t<Word>bfmopa</Word>\n\t\t\t<Word>bfmops</Word>\n\t\t\t<Word>bfmul</Word>\n\t\t\t<Word>bfsub</Word>\n\t\t\t<Word>bfvdot</Word>\n\t\t\t<Word>bfxil</Word>\n\t\t\t<Word>bge</Word>\n\t\t\t<Word>b.ge</Word>\n\t\t\t<Word>bgrp</Word>\n\t\t\t<Word>bgt</Word>\n\t\t\t<Word>b.gt</Word>\n\t\t\t<Word>bhi</Word>\n\t\t\t<Word>bhs</Word>\n\t\t\t<Word>b.hs</Word>\n\t\t\t<Word>bic</Word>\n\t\t\t<Word>bics</Word>\n\t\t\t<Word>bif</Word>\n\t\t\t<Word>bit</Word>\n\t\t\t<Word>bl</Word>\n\t\t\t<Word>ble</Word>\n\t\t\t<Word>b.le</Word>\n\t\t\t<Word>blo</Word>\n\t\t\t<Word>b.lo</Word>\n\t\t\t<Word>blr</Word>\n\t\t\t<Word>blraa</Word>\n\t\t\t<Word>blraaz</Word>\n\t\t\t<Word>blrab</Word>\n\t\t\t<Word>blrabz</Word>\n\t\t\t<Word>bls</Word>\n\t\t\t<Word>b.ls</Word>\n\t\t\t<Word>blt</Word>\n\t\t\t<Word>b.lt</Word>\n\t\t\t<Word>bmi</Word>\n\t\t\t<Word>b.mi</Word>\n\t\t\t<Word>bmopa</Word>\n\t\t\t<Word>bmops</Word>\n\t\t\t<Word>bne</Word>\n\t\t\t<Word>b.ne</Word>\n\t\t\t<Word>bpl</Word>\n\t\t\t<Word>b.pl</Word>\n\t\t\t<Word>br</Word>\n\t\t\t<Word>braa</Word>\n\t\t\t<Word>braaz</Word>\n\t\t\t<Word>brab</Word>\n\t\t\t<Word>brabz</Word>\n\t\t\t<Word>brb</Word>\n\t\t\t<Word>brk</Word>\n\t\t\t<Word>brka</Word>\n\t\t\t<Word>brkas</Word>\n\t\t\t<Word>brkb</Word>\n\t\t\t<Word>brkbs</Word>\n\t\t\t<Word>brkn</Word>\n\t\t\t<Word>brkns</Word>\n\t\t\t<Word>brkpa</Word>\n\t\t\t<Word>brkpas</Word>\n\t\t\t<Word>brkpb</Word>\n\t\t\t<Word>brkpbs</Word>\n\t\t\t<Word>bsl</Word>\n\t\t\t<Word>bsl1n</Word>\n\t\t\t<Word>bsl2n</Word>\n\t\t\t<Word>bti</Word>\n\t\t\t<Word>bvc</Word>\n\t\t\t<Word>b.vc</Word>\n\t\t\t<Word>bvs</Word>\n\t\t\t<Word>b.vs</Word>\n\t\t\t<Word>cadd</Word>\n\t\t\t<Word>cas</Word>\n\t\t\t<Word>casa</Word>\n\t\t\t<Word>casab</Word>\n\t\t\t<Word>casah</Word>\n\t\t\t<Word>casal</Word>\n\t\t\t<Word>casalb</Word>\n\t\t\t<Word>casalh</Word>\n\t\t\t<Word>casb</Word>\n\t\t\t<Word>cash</Word>\n\t\t\t<Word>casl</Word>\n\t\t\t<Word>caslb</Word>\n\t\t\t<Word>caslh</Word>\n\t\t\t<Word>casp</Word>\n\t\t\t<Word>caspa</Word>\n\t\t\t<Word>caspal</Word>\n\t\t\t<Word>caspl</Word>\n\t\t\t<Word>cbnz</Word>\n\t\t\t<Word>cbz</Word>\n\t\t\t<Word>ccmn</Word>\n\t\t\t<Word>ccmp</Word>\n\t\t\t<Word>cdot</Word>\n\t\t\t<Word>cfinv</Word>\n\t\t\t<Word>cfp</Word>\n\t\t\t<Word>chkfeat</Word>\n\t\t\t<Word>cinc</Word>\n\t\t\t<Word>cinv</Word>\n\t\t\t<Word>clasta</Word>\n\t\t\t<Word>clastb</Word>\n\t\t\t<Word>clearbhb</Word>\n\t\t\t<Word>clrbhb</Word>\n\t\t\t<Word>clrex</Word>\n\t\t\t<Word>cls</Word>\n\t\t\t<Word>clz</Word>\n\t\t\t<Word>cmeq</Word>\n\t\t\t<Word>cmge</Word>\n\t\t\t<Word>cmgt</Word>\n\t\t\t<Word>cmhi</Word>\n\t\t\t<Word>cmhs</Word>\n\t\t\t<Word>cmla</Word>\n\t\t\t<Word>cmle</Word>\n\t\t\t<Word>cmlt</Word>\n\t\t\t<Word>cmn</Word>\n\t\t\t<Word>cmp</Word>\n\t\t\t<Word>cmpeq</Word>\n\t\t\t<Word>cmpge</Word>\n\t\t\t<Word>cmpgt</Word>\n\t\t\t<Word>cmphi</Word>\n\t\t\t<Word>cmphs</Word>\n\t\t\t<Word>cmple</Word>\n\t\t\t<Word>cmplo</Word>\n\t\t\t<Word>cmpls</Word>\n\t\t\t<Word>cmplt</Word>\n\t\t\t<Word>cmpne</Word>\n\t\t\t<Word>cmpp</Word>\n\t\t\t<Word>cmtst</Word>\n\t\t\t<Word>cneg</Word>\n\t\t\t<Word>cnot</Word>\n\t\t\t<Word>cnt</Word>\n\t\t\t<Word>cntb</Word>\n\t\t\t<Word>cntd</Word>\n\t\t\t<Word>cnth</Word>\n\t\t\t<Word>cntp</Word>\n\t\t\t<Word>cntw</Word>\n\t\t\t<Word>compact</Word>\n\t\t\t<Word>cosp</Word>\n\t\t\t<Word>cpp</Word>\n\t\t\t<Word>cpy</Word>\n\t\t\t<Word>crc32b</Word>\n\t\t\t<Word>crc32cb</Word>\n\t\t\t<Word>crc32ch</Word>\n\t\t\t<Word>crc32cw</Word>\n\t\t\t<Word>crc32cx</Word>\n\t\t\t<Word>crc32h</Word>\n\t\t\t<Word>crc32w</Word>\n\t\t\t<Word>crc32x</Word>\n\t\t\t<Word>csdb</Word>\n\t\t\t<Word>csel</Word>\n\t\t\t<Word>cset</Word>\n\t\t\t<Word>csetm</Word>\n\t\t\t<Word>csinc</Word>\n\t\t\t<Word>csinv</Word>\n\t\t\t<Word>csneg</Word>\n\t\t\t<Word>ctermeq</Word>\n\t\t\t<Word>ctermne</Word>\n\t\t\t<Word>ctz</Word>\n\t\t\t<Word>dc</Word>\n\t\t\t<Word>dcps1</Word>\n\t\t\t<Word>dcps2</Word>\n\t\t\t<Word>dcps3</Word>\n\t\t\t<Word>decb</Word>\n\t\t\t<Word>decd</Word>\n\t\t\t<Word>dech</Word>\n\t\t\t<Word>decp</Word>\n\t\t\t<Word>decw</Word>\n\t\t\t<Word>dfb</Word>\n\t\t\t<Word>dgh</Word>\n\t\t\t<Word>dmb</Word>\n\t\t\t<Word>drps</Word>\n\t\t\t<Word>dsb</Word>\n\t\t\t<Word>dup</Word>\n\t\t\t<Word>dupm</Word>\n\t\t\t<Word>dupq</Word>\n\t\t\t<Word>dvp</Word>\n\t\t\t<Word>eon</Word>\n\t\t\t<Word>eor</Word>\n\t\t\t<Word>eor3</Word>\n\t\t\t<Word>eorbt</Word>\n\t\t\t<Word>eorqv</Word>\n\t\t\t<Word>eors</Word>\n\t\t\t<Word>eortb</Word>\n\t\t\t<Word>eorv</Word>\n\t\t\t<Word>eret</Word>\n\t\t\t<Word>eretaa</Word>\n\t\t\t<Word>eretab</Word>\n\t\t\t<Word>esb</Word>\n\t\t\t<Word>ext</Word>\n\t\t\t<Word>extq</Word>\n\t\t\t<Word>extr</Word>\n\t\t\t<Word>f1cvt</Word>\n\t\t\t<Word>f1cvtl</Word>\n\t\t\t<Word>f1cvtl2</Word>\n\t\t\t<Word>f1cvtlt</Word>\n\t\t\t<Word>f2cvt</Word>\n\t\t\t<Word>f2cvtl</Word>\n\t\t\t<Word>f2cvtl2</Word>\n\t\t\t<Word>f2cvtlt</Word>\n\t\t\t<Word>fabd</Word>\n\t\t\t<Word>fabs</Word>\n\t\t\t<Word>facge</Word>\n\t\t\t<Word>facgt</Word>\n\t\t\t<Word>facle</Word>\n\t\t\t<Word>faclt</Word>\n\t\t\t<Word>fadd</Word>\n\t\t\t<Word>fadda</Word>\n\t\t\t<Word>faddp</Word>\n\t\t\t<Word>faddqv</Word>\n\t\t\t<Word>faddv</Word>\n\t\t\t<Word>famax</Word>\n\t\t\t<Word>famin</Word>\n\t\t\t<Word>fcadd</Word>\n\t\t\t<Word>fccmp</Word>\n\t\t\t<Word>fccmpe</Word>\n\t\t\t<Word>fclamp</Word>\n\t\t\t<Word>fcmeq</Word>\n\t\t\t<Word>fcmge</Word>\n\t\t\t<Word>fcmgt</Word>\n\t\t\t<Word>fcmla</Word>\n\t\t\t<Word>fcmle</Word>\n\t\t\t<Word>fcmlt</Word>\n\t\t\t<Word>fcmne</Word>\n\t\t\t<Word>fcmp</Word>\n\t\t\t<Word>fcmpe</Word>\n\t\t\t<Word>fcmuo</Word>\n\t\t\t<Word>fcpy</Word>\n\t\t\t<Word>fcsel</Word>\n\t\t\t<Word>fcvt</Word>\n\t\t\t<Word>fcvtas</Word>\n\t\t\t<Word>fcvtau</Word>\n\t\t\t<Word>fcvtl</Word>\n\t\t\t<Word>fcvtl2</Word>\n\t\t\t<Word>fcvtlt</Word>\n\t\t\t<Word>fcvtms</Word>\n\t\t\t<Word>fcvtmu</Word>\n\t\t\t<Word>fcvtn</Word>\n\t\t\t<Word>fcvtn2</Word>\n\t\t\t<Word>fcvtnb</Word>\n\t\t\t<Word>fcvtns</Word>\n\t\t\t<Word>fcvtnt</Word>\n\t\t\t<Word>fcvtnu</Word>\n\t\t\t<Word>fcvtps</Word>\n\t\t\t<Word>fcvtpu</Word>\n\t\t\t<Word>fcvtx</Word>\n\t\t\t<Word>fcvtxn</Word>\n\t\t\t<Word>fcvtxn2</Word>\n\t\t\t<Word>fcvtxnt</Word>\n\t\t\t<Word>fcvtzs</Word>\n\t\t\t<Word>fcvtzu</Word>\n\t\t\t<Word>fdiv</Word>\n\t\t\t<Word>fdivr</Word>\n\t\t\t<Word>fdot</Word>\n\t\t\t<Word>fdup</Word>\n\t\t\t<Word>fexpa</Word>\n\t\t\t<Word>fjcvtzs</Word>\n\t\t\t<Word>flogb</Word>\n\t\t\t<Word>fmad</Word>\n\t\t\t<Word>fmadd</Word>\n\t\t\t<Word>fmax</Word>\n\t\t\t<Word>fmaxnm</Word>\n\t\t\t<Word>fmaxnmp</Word>\n\t\t\t<Word>fmaxnmqv</Word>\n\t\t\t<Word>fmaxnmv</Word>\n\t\t\t<Word>fmaxp</Word>\n\t\t\t<Word>fmaxqv</Word>\n\t\t\t<Word>fmaxv</Word>\n\t\t\t<Word>fmin</Word>\n\t\t\t<Word>fminnm</Word>\n\t\t\t<Word>fminnmp</Word>\n\t\t\t<Word>fminnmqv</Word>\n\t\t\t<Word>fminnmv</Word>\n\t\t\t<Word>fminp</Word>\n\t\t\t<Word>fminqv</Word>\n\t\t\t<Word>fminv</Word>\n\t\t\t<Word>fmla</Word>\n\t\t\t<Word>fmlal</Word>\n\t\t\t<Word>fmlal2</Word>\n\t\t\t<Word>fmlalb</Word>\n\t\t\t<Word>fmlall</Word>\n\t\t\t<Word>fmlallbb</Word>\n\t\t\t<Word>fmlallbt</Word>\n\t\t\t<Word>fmlalltb</Word>\n\t\t\t<Word>fmlalltt</Word>\n\t\t\t<Word>fmlalt</Word>\n\t\t\t<Word>fmls</Word>\n\t\t\t<Word>fmlsl</Word>\n\t\t\t<Word>fmlsl2</Word>\n\t\t\t<Word>fmlslb</Word>\n\t\t\t<Word>fmlslt</Word>\n\t\t\t<Word>fmmla</Word>\n\t\t\t<Word>fmopa</Word>\n\t\t\t<Word>fmops</Word>\n\t\t\t<Word>fmov</Word>\n\t\t\t<Word>fmsb</Word>\n\t\t\t<Word>fmsub</Word>\n\t\t\t<Word>fmul</Word>\n\t\t\t<Word>fmulx</Word>\n\t\t\t<Word>fneg</Word>\n\t\t\t<Word>fnmad</Word>\n\t\t\t<Word>fnmadd</Word>\n\t\t\t<Word>fnmla</Word>\n\t\t\t<Word>fnmls</Word>\n\t\t\t<Word>fnmsb</Word>\n\t\t\t<Word>fnmsub</Word>\n\t\t\t<Word>fnmul</Word>\n\t\t\t<Word>frecpe</Word>\n\t\t\t<Word>frecps</Word>\n\t\t\t<Word>frecpx</Word>\n\t\t\t<Word>frint32x</Word>\n\t\t\t<Word>frint32z</Word>\n\t\t\t<Word>frint64x</Word>\n\t\t\t<Word>frint64z</Word>\n\t\t\t<Word>frinta</Word>\n\t\t\t<Word>frinti</Word>\n\t\t\t<Word>frintm</Word>\n\t\t\t<Word>frintn</Word>\n\t\t\t<Word>frintp</Word>\n\t\t\t<Word>frintx</Word>\n\t\t\t<Word>frintz</Word>\n\t\t\t<Word>frsqrte</Word>\n\t\t\t<Word>frsqrts</Word>\n\t\t\t<Word>fscale</Word>\n\t\t\t<Word>fsqrt</Word>\n\t\t\t<Word>fsub</Word>\n\t\t\t<Word>fsubr</Word>\n\t\t\t<Word>ftmad</Word>\n\t\t\t<Word>ftsmul</Word>\n\t\t\t<Word>ftssel</Word>\n\t\t\t<Word>fvdot</Word>\n\t\t\t<Word>fvdotb</Word>\n\t\t\t<Word>fvdott</Word>\n\t\t\t<Word>gcsb</Word>\n\t\t\t<Word>gcspopcx</Word>\n\t\t\t<Word>gcspopm</Word>\n\t\t\t<Word>gcspopx</Word>\n\t\t\t<Word>gcspushm</Word>\n\t\t\t<Word>gcspushx</Word>\n\t\t\t<Word>gcsss1</Word>\n\t\t\t<Word>gcsss2</Word>\n\t\t\t<Word>gcsstr</Word>\n\t\t\t<Word>gcssttr</Word>\n\t\t\t<Word>gmi</Word>\n\t\t\t<Word>hint</Word>\n\t\t\t<Word>histcnt</Word>\n\t\t\t<Word>histseg</Word>\n\t\t\t<Word>hlt</Word>\n\t\t\t<Word>hvc</Word>\n\t\t\t<Word>ic</Word>\n\t\t\t<Word>incb</Word>\n\t\t\t<Word>incd</Word>\n\t\t\t<Word>inch</Word>\n\t\t\t<Word>incp</Word>\n\t\t\t<Word>incw</Word>\n\t\t\t<Word>index</Word>\n\t\t\t<Word>ins</Word>\n\t\t\t<Word>insr</Word>\n\t\t\t<Word>irg</Word>\n\t\t\t<Word>isb</Word>\n\t\t\t<Word>lasta</Word>\n\t\t\t<Word>lastb</Word>\n\t\t\t<Word>ld1</Word>\n\t\t\t<Word>ld1b</Word>\n\t\t\t<Word>ld1d</Word>\n\t\t\t<Word>ld1h</Word>\n\t\t\t<Word>ld1q</Word>\n\t\t\t<Word>ld1r</Word>\n\t\t\t<Word>ld1rb</Word>\n\t\t\t<Word>ld1rd</Word>\n\t\t\t<Word>ld1rh</Word>\n\t\t\t<Word>ld1rob</Word>\n\t\t\t<Word>ld1rod</Word>\n\t\t\t<Word>ld1roh</Word>\n\t\t\t<Word>ld1row</Word>\n\t\t\t<Word>ld1rqb</Word>\n\t\t\t<Word>ld1rqd</Word>\n\t\t\t<Word>ld1rqh</Word>\n\t\t\t<Word>ld1rqw</Word>\n\t\t\t<Word>ld1rsb</Word>\n\t\t\t<Word>ld1rsh</Word>\n\t\t\t<Word>ld1rsw</Word>\n\t\t\t<Word>ld1rw</Word>\n\t\t\t<Word>ld1sb</Word>\n\t\t\t<Word>ld1sh</Word>\n\t\t\t<Word>ld1sw</Word>\n\t\t\t<Word>ld1w</Word>\n\t\t\t<Word>ld2</Word>\n\t\t\t<Word>ld2b</Word>\n\t\t\t<Word>ld2d</Word>\n\t\t\t<Word>ld2h</Word>\n\t\t\t<Word>ld2q</Word>\n\t\t\t<Word>ld2r</Word>\n\t\t\t<Word>ld2w</Word>\n\t\t\t<Word>ld3</Word>\n\t\t\t<Word>ld3b</Word>\n\t\t\t<Word>ld3d</Word>\n\t\t\t<Word>ld3h</Word>\n\t\t\t<Word>ld3q</Word>\n\t\t\t<Word>ld3r</Word>\n\t\t\t<Word>ld3w</Word>\n\t\t\t<Word>ld4</Word>\n\t\t\t<Word>ld4b</Word>\n\t\t\t<Word>ld4d</Word>\n\t\t\t<Word>ld4h</Word>\n\t\t\t<Word>ld4q</Word>\n\t\t\t<Word>ld4r</Word>\n\t\t\t<Word>ld4w</Word>\n\t\t\t<Word>ld64b</Word>\n\t\t\t<Word>ldadd</Word>\n\t\t\t<Word>ldadda</Word>\n\t\t\t<Word>ldaddab</Word>\n\t\t\t<Word>ldaddah</Word>\n\t\t\t<Word>ldaddal</Word>\n\t\t\t<Word>ldaddalb</Word>\n\t\t\t<Word>ldaddalh</Word>\n\t\t\t<Word>ldaddb</Word>\n\t\t\t<Word>ldaddh</Word>\n\t\t\t<Word>ldaddl</Word>\n\t\t\t<Word>ldaddlb</Word>\n\t\t\t<Word>ldaddlh</Word>\n\t\t\t<Word>ldap1</Word>\n\t\t\t<Word>ldapr</Word>\n\t\t\t<Word>ldaprb</Word>\n\t\t\t<Word>ldaprh</Word>\n\t\t\t<Word>ldapur</Word>\n\t\t\t<Word>ldapurb</Word>\n\t\t\t<Word>ldapurh</Word>\n\t\t\t<Word>ldapursb</Word>\n\t\t\t<Word>ldapursh</Word>\n\t\t\t<Word>ldapursw</Word>\n\t\t\t<Word>ldar</Word>\n\t\t\t<Word>ldarb</Word>\n\t\t\t<Word>ldarh</Word>\n\t\t\t<Word>ldaxp</Word>\n\t\t\t<Word>ldaxr</Word>\n\t\t\t<Word>ldaxrb</Word>\n\t\t\t<Word>ldaxrh</Word>\n\t\t\t<Word>ldclr</Word>\n\t\t\t<Word>ldclra</Word>\n\t\t\t<Word>ldclrab</Word>\n\t\t\t<Word>ldclrah</Word>\n\t\t\t<Word>ldclral</Word>\n\t\t\t<Word>ldclralb</Word>\n\t\t\t<Word>ldclralh</Word>\n\t\t\t<Word>ldclrb</Word>\n\t\t\t<Word>ldclrh</Word>\n\t\t\t<Word>ldclrl</Word>\n\t\t\t<Word>ldclrlb</Word>\n\t\t\t<Word>ldclrlh</Word>\n\t\t\t<Word>ldclrp</Word>\n\t\t\t<Word>ldclrpa</Word>\n\t\t\t<Word>ldclrpal</Word>\n\t\t\t<Word>ldclrpl</Word>\n\t\t\t<Word>ldeor</Word>\n\t\t\t<Word>ldeora</Word>\n\t\t\t<Word>ldeorab</Word>\n\t\t\t<Word>ldeorah</Word>\n\t\t\t<Word>ldeoral</Word>\n\t\t\t<Word>ldeoralb</Word>\n\t\t\t<Word>ldeoralh</Word>\n\t\t\t<Word>ldeorb</Word>\n\t\t\t<Word>ldeorh</Word>\n\t\t\t<Word>ldeorl</Word>\n\t\t\t<Word>ldeorlb</Word>\n\t\t\t<Word>ldeorlh</Word>\n\t\t\t<Word>ldff1b</Word>\n\t\t\t<Word>ldff1d</Word>\n\t\t\t<Word>ldff1h</Word>\n\t\t\t<Word>ldff1sb</Word>\n\t\t\t<Word>ldff1sh</Word>\n\t\t\t<Word>ldff1sw</Word>\n\t\t\t<Word>ldff1w</Word>\n\t\t\t<Word>ldg</Word>\n\t\t\t<Word>ldgm</Word>\n\t\t\t<Word>ldiapp</Word>\n\t\t\t<Word>ldlar</Word>\n\t\t\t<Word>ldlarb</Word>\n\t\t\t<Word>ldlarh</Word>\n\t\t\t<Word>ldnf1b</Word>\n\t\t\t<Word>ldnf1d</Word>\n\t\t\t<Word>ldnf1h</Word>\n\t\t\t<Word>ldnf1sb</Word>\n\t\t\t<Word>ldnf1sh</Word>\n\t\t\t<Word>ldnf1sw</Word>\n\t\t\t<Word>ldnf1w</Word>\n\t\t\t<Word>ldnp</Word>\n\t\t\t<Word>ldnt1b</Word>\n\t\t\t<Word>ldnt1d</Word>\n\t\t\t<Word>ldnt1h</Word>\n\t\t\t<Word>ldnt1sb</Word>\n\t\t\t<Word>ldnt1sh</Word>\n\t\t\t<Word>ldnt1sw</Word>\n\t\t\t<Word>ldnt1w</Word>\n\t\t\t<Word>ldp</Word>\n\t\t\t<Word>ldr</Word>\n\t\t\t<Word>ldraa</Word>\n\t\t\t<Word>ldrab</Word>\n\t\t\t<Word>ldrb</Word>\n\t\t\t<Word>ldrh</Word>\n\t\t\t<Word>ldrsb</Word>\n\t\t\t<Word>ldrsh</Word>\n\t\t\t<Word>ldrsw</Word>\n\t\t\t<Word>ldset</Word>\n\t\t\t<Word>ldseta</Word>\n\t\t\t<Word>ldsetab</Word>\n\t\t\t<Word>ldsetah</Word>\n\t\t\t<Word>ldsetal</Word>\n\t\t\t<Word>ldsetalb</Word>\n\t\t\t<Word>ldsetalh</Word>\n\t\t\t<Word>ldsetb</Word>\n\t\t\t<Word>ldseth</Word>\n\t\t\t<Word>ldsetl</Word>\n\t\t\t<Word>ldsetlb</Word>\n\t\t\t<Word>ldsetlh</Word>\n\t\t\t<Word>ldsetp</Word>\n\t\t\t<Word>ldsetpa</Word>\n\t\t\t<Word>ldsetpal</Word>\n\t\t\t<Word>ldsetpl</Word>\n\t\t\t<Word>ldsmax</Word>\n\t\t\t<Word>ldsmaxa</Word>\n\t\t\t<Word>ldsmaxab</Word>\n\t\t\t<Word>ldsmaxah</Word>\n\t\t\t<Word>ldsmaxal</Word>\n\t\t\t<Word>ldsmaxalb</Word>\n\t\t\t<Word>ldsmaxalh</Word>\n\t\t\t<Word>ldsmaxb</Word>\n\t\t\t<Word>ldsmaxh</Word>\n\t\t\t<Word>ldsmaxl</Word>\n\t\t\t<Word>ldsmaxlb</Word>\n\t\t\t<Word>ldsmaxlh</Word>\n\t\t\t<Word>ldsmin</Word>\n\t\t\t<Word>ldsmina</Word>\n\t\t\t<Word>ldsminab</Word>\n\t\t\t<Word>ldsminah</Word>\n\t\t\t<Word>ldsminal</Word>\n\t\t\t<Word>ldsminalb</Word>\n\t\t\t<Word>ldsminalh</Word>\n\t\t\t<Word>ldsminb</Word>\n\t\t\t<Word>ldsminh</Word>\n\t\t\t<Word>ldsminl</Word>\n\t\t\t<Word>ldsminlb</Word>\n\t\t\t<Word>ldsminlh</Word>\n\t\t\t<Word>ldtr</Word>\n\t\t\t<Word>ldtrb</Word>\n\t\t\t<Word>ldtrh</Word>\n\t\t\t<Word>ldtrsb</Word>\n\t\t\t<Word>ldtrsh</Word>\n\t\t\t<Word>ldtrsw</Word>\n\t\t\t<Word>ldumax</Word>\n\t\t\t<Word>ldumaxa</Word>\n\t\t\t<Word>ldumaxab</Word>\n\t\t\t<Word>ldumaxah</Word>\n\t\t\t<Word>ldumaxal</Word>\n\t\t\t<Word>ldumaxalb</Word>\n\t\t\t<Word>ldumaxalh</Word>\n\t\t\t<Word>ldumaxb</Word>\n\t\t\t<Word>ldumaxh</Word>\n\t\t\t<Word>ldumaxl</Word>\n\t\t\t<Word>ldumaxlb</Word>\n\t\t\t<Word>ldumaxlh</Word>\n\t\t\t<Word>ldumin</Word>\n\t\t\t<Word>ldumina</Word>\n\t\t\t<Word>lduminab</Word>\n\t\t\t<Word>lduminah</Word>\n\t\t\t<Word>lduminal</Word>\n\t\t\t<Word>lduminalb</Word>\n\t\t\t<Word>lduminalh</Word>\n\t\t\t<Word>lduminb</Word>\n\t\t\t<Word>lduminh</Word>\n\t\t\t<Word>lduminl</Word>\n\t\t\t<Word>lduminlb</Word>\n\t\t\t<Word>lduminlh</Word>\n\t\t\t<Word>ldur</Word>\n\t\t\t<Word>ldurb</Word>\n\t\t\t<Word>ldurh</Word>\n\t\t\t<Word>ldursb</Word>\n\t\t\t<Word>ldursh</Word>\n\t\t\t<Word>ldursw</Word>\n\t\t\t<Word>ldxp</Word>\n\t\t\t<Word>ldxr</Word>\n\t\t\t<Word>ldxrb</Word>\n\t\t\t<Word>ldxrh</Word>\n\t\t\t<Word>lsl</Word>\n\t\t\t<Word>lslr</Word>\n\t\t\t<Word>lslv</Word>\n\t\t\t<Word>lsr</Word>\n\t\t\t<Word>lsrr</Word>\n\t\t\t<Word>lsrv</Word>\n\t\t\t<Word>luti2</Word>\n\t\t\t<Word>luti4</Word>\n\t\t\t<Word>mad</Word>\n\t\t\t<Word>madd</Word>\n\t\t\t<Word>maddpt</Word>\n\t\t\t<Word>madpt</Word>\n\t\t\t<Word>match</Word>\n\t\t\t<Word>mla</Word>\n\t\t\t<Word>mlapt</Word>\n\t\t\t<Word>mls</Word>\n\t\t\t<Word>mneg</Word>\n\t\t\t<Word>mov</Word>\n\t\t\t<Word>mova</Word>\n\t\t\t<Word>movaz</Word>\n\t\t\t<Word>movi</Word>\n\t\t\t<Word>movk</Word>\n\t\t\t<Word>movn</Word>\n\t\t\t<Word>movprfx</Word>\n\t\t\t<Word>movs</Word>\n\t\t\t<Word>movt</Word>\n\t\t\t<Word>movz</Word>\n\t\t\t<Word>mrrs</Word>\n\t\t\t<Word>mrs</Word>\n\t\t\t<Word>msb</Word>\n\t\t\t<Word>msr</Word>\n\t\t\t<Word>msrr</Word>\n\t\t\t<Word>msub</Word>\n\t\t\t<Word>msubpt</Word>\n\t\t\t<Word>mul</Word>\n\t\t\t<Word>mvn</Word>\n\t\t\t<Word>mvni</Word>\n\t\t\t<Word>nand</Word>\n\t\t\t<Word>nands</Word>\n\t\t\t<Word>nbsl</Word>\n\t\t\t<Word>neg</Word>\n\t\t\t<Word>negs</Word>\n\t\t\t<Word>ngc</Word>\n\t\t\t<Word>ngcs</Word>\n\t\t\t<Word>nmatch</Word>\n\t\t\t<Word>nop</Word>\n\t\t\t<Word>nor</Word>\n\t\t\t<Word>nors</Word>\n\t\t\t<Word>not</Word>\n\t\t\t<Word>nots</Word>\n\t\t\t<Word>orn</Word>\n\t\t\t<Word>orns</Word>\n\t\t\t<Word>orqv</Word>\n\t\t\t<Word>orr</Word>\n\t\t\t<Word>orrs</Word>\n\t\t\t<Word>orv</Word>\n\t\t\t<Word>pacda</Word>\n\t\t\t<Word>pacdb</Word>\n\t\t\t<Word>pacdza</Word>\n\t\t\t<Word>pacdzb</Word>\n\t\t\t<Word>pacga</Word>\n\t\t\t<Word>pacia</Word>\n\t\t\t<Word>pacia1716</Word>\n\t\t\t<Word>paciasp</Word>\n\t\t\t<Word>paciaz</Word>\n\t\t\t<Word>pacib</Word>\n\t\t\t<Word>pacib1716</Word>\n\t\t\t<Word>pacibsp</Word>\n\t\t\t<Word>pacibz</Word>\n\t\t\t<Word>paciza</Word>\n\t\t\t<Word>pacizb</Word>\n\t\t\t<Word>pext</Word>\n\t\t\t<Word>pfalse</Word>\n\t\t\t<Word>pfirst</Word>\n\t\t\t<Word>pmov</Word>\n\t\t\t<Word>pmul</Word>\n\t\t\t<Word>pmull</Word>\n\t\t\t<Word>pmull2</Word>\n\t\t\t<Word>pmullb</Word>\n\t\t\t<Word>pmullt</Word>\n\t\t\t<Word>pnext</Word>\n\t\t\t<Word>prfb</Word>\n\t\t\t<Word>prfd</Word>\n\t\t\t<Word>prfh</Word>\n\t\t\t<Word>prfm</Word>\n\t\t\t<Word>prfum</Word>\n\t\t\t<Word>prfw</Word>\n\t\t\t<Word>psb</Word>\n\t\t\t<Word>psel</Word>\n\t\t\t<Word>pssbb</Word>\n\t\t\t<Word>ptest</Word>\n\t\t\t<Word>ptrue</Word>\n\t\t\t<Word>ptrues</Word>\n\t\t\t<Word>punpkhi</Word>\n\t\t\t<Word>punpklo</Word>\n\t\t\t<Word>raddhn</Word>\n\t\t\t<Word>raddhn2</Word>\n\t\t\t<Word>raddhnb</Word>\n\t\t\t<Word>raddhnt</Word>\n\t\t\t<Word>rax1</Word>\n\t\t\t<Word>rbit</Word>\n\t\t\t<Word>rcwcas</Word>\n\t\t\t<Word>rcwcasa</Word>\n\t\t\t<Word>rcwcasal</Word>\n\t\t\t<Word>rcwcasl</Word>\n\t\t\t<Word>rcwcasp</Word>\n\t\t\t<Word>rcwcaspa</Word>\n\t\t\t<Word>rcwcaspal</Word>\n\t\t\t<Word>rcwcaspl</Word>\n\t\t\t<Word>rcwclr</Word>\n\t\t\t<Word>rcwclra</Word>\n\t\t\t<Word>rcwclral</Word>\n\t\t\t<Word>rcwclrl</Word>\n\t\t\t<Word>rcwclrp</Word>\n\t\t\t<Word>rcwclrpa</Word>\n\t\t\t<Word>rcwclrpal</Word>\n\t\t\t<Word>rcwclrpl</Word>\n\t\t\t<Word>rcwscas</Word>\n\t\t\t<Word>rcwscasa</Word>\n\t\t\t<Word>rcwscasal</Word>\n\t\t\t<Word>rcwscasl</Word>\n\t\t\t<Word>rcwscasp</Word>\n\t\t\t<Word>rcwscaspa</Word>\n\t\t\t<Word>rcwscaspal</Word>\n\t\t\t<Word>rcwscaspl</Word>\n\t\t\t<Word>rcwsclr</Word>\n\t\t\t<Word>rcwsclra</Word>\n\t\t\t<Word>rcwsclral</Word>\n\t\t\t<Word>rcwsclrl</Word>\n\t\t\t<Word>rcwsclrp</Word>\n\t\t\t<Word>rcwsclrpa</Word>\n\t\t\t<Word>rcwsclrpal</Word>\n\t\t\t<Word>rcwsclrpl</Word>\n\t\t\t<Word>rcwset</Word>\n\t\t\t<Word>rcwseta</Word>\n\t\t\t<Word>rcwsetal</Word>\n\t\t\t<Word>rcwsetl</Word>\n\t\t\t<Word>rcwsetp</Word>\n\t\t\t<Word>rcwsetpa</Word>\n\t\t\t<Word>rcwsetpal</Word>\n\t\t\t<Word>rcwsetpl</Word>\n\t\t\t<Word>rcwsset</Word>\n\t\t\t<Word>rcwsseta</Word>\n\t\t\t<Word>rcwssetal</Word>\n\t\t\t<Word>rcwssetl</Word>\n\t\t\t<Word>rcwssetp</Word>\n\t\t\t<Word>rcwssetpa</Word>\n\t\t\t<Word>rcwssetpal</Word>\n\t\t\t<Word>rcwssetpl</Word>\n\t\t\t<Word>rcwsswp</Word>\n\t\t\t<Word>rcwsswpa</Word>\n\t\t\t<Word>rcwsswpal</Word>\n\t\t\t<Word>rcwsswpl</Word>\n\t\t\t<Word>rcwsswpp</Word>\n\t\t\t<Word>rcwsswppa</Word>\n\t\t\t<Word>rcwsswppal</Word>\n\t\t\t<Word>rcwsswppl</Word>\n\t\t\t<Word>rcwswp</Word>\n\t\t\t<Word>rcwswpa</Word>\n\t\t\t<Word>rcwswpal</Word>\n\t\t\t<Word>rcwswpl</Word>\n\t\t\t<Word>rcwswpp</Word>\n\t\t\t<Word>rcwswppa</Word>\n\t\t\t<Word>rcwswppal</Word>\n\t\t\t<Word>rcwswppl</Word>\n\t\t\t<Word>rdffr</Word>\n\t\t\t<Word>rdffrs</Word>\n\t\t\t<Word>rdsvl</Word>\n\t\t\t<Word>rdvl</Word>\n\t\t\t<Word>ret</Word>\n\t\t\t<Word>retaa</Word>\n\t\t\t<Word>retab</Word>\n\t\t\t<Word>rev</Word>\n\t\t\t<Word>rev16</Word>\n\t\t\t<Word>rev32</Word>\n\t\t\t<Word>rev64</Word>\n\t\t\t<Word>revb</Word>\n\t\t\t<Word>revd</Word>\n\t\t\t<Word>revh</Word>\n\t\t\t<Word>revw</Word>\n\t\t\t<Word>rmif</Word>\n\t\t\t<Word>ror</Word>\n\t\t\t<Word>rorv</Word>\n\t\t\t<Word>rprfm</Word>\n\t\t\t<Word>rshrn</Word>\n\t\t\t<Word>rshrn2</Word>\n\t\t\t<Word>rshrnb</Word>\n\t\t\t<Word>rshrnt</Word>\n\t\t\t<Word>rsubhn</Word>\n\t\t\t<Word>rsubhn2</Word>\n\t\t\t<Word>rsubhnb</Word>\n\t\t\t<Word>rsubhnt</Word>\n\t\t\t<Word>saba</Word>\n\t\t\t<Word>sabal</Word>\n\t\t\t<Word>sabal2</Word>\n\t\t\t<Word>sabalb</Word>\n\t\t\t<Word>sabalt</Word>\n\t\t\t<Word>sabd</Word>\n\t\t\t<Word>sabdl</Word>\n\t\t\t<Word>sabdl2</Word>\n\t\t\t<Word>sabdlb</Word>\n\t\t\t<Word>sabdlt</Word>\n\t\t\t<Word>sadalp</Word>\n\t\t\t<Word>saddl</Word>\n\t\t\t<Word>saddl2</Word>\n\t\t\t<Word>saddlb</Word>\n\t\t\t<Word>saddlbt</Word>\n\t\t\t<Word>saddlp</Word>\n\t\t\t<Word>saddlt</Word>\n\t\t\t<Word>saddlv</Word>\n\t\t\t<Word>saddv</Word>\n\t\t\t<Word>saddw</Word>\n\t\t\t<Word>saddw2</Word>\n\t\t\t<Word>saddwb</Word>\n\t\t\t<Word>saddwt</Word>\n\t\t\t<Word>sb</Word>\n\t\t\t<Word>sbc</Word>\n\t\t\t<Word>sbclb</Word>\n\t\t\t<Word>sbclt</Word>\n\t\t\t<Word>sbcs</Word>\n\t\t\t<Word>sbfiz</Word>\n\t\t\t<Word>sbfm</Word>\n\t\t\t<Word>sbfx</Word>\n\t\t\t<Word>sclamp</Word>\n\t\t\t<Word>scvtf</Word>\n\t\t\t<Word>sdiv</Word>\n\t\t\t<Word>sdivr</Word>\n\t\t\t<Word>sdot</Word>\n\t\t\t<Word>sel</Word>\n\t\t\t<Word>setf16</Word>\n\t\t\t<Word>setf8</Word>\n\t\t\t<Word>setffr</Word>\n\t\t\t<Word>sev</Word>\n\t\t\t<Word>sevl</Word>\n\t\t\t<Word>sha1c</Word>\n\t\t\t<Word>sha1h</Word>\n\t\t\t<Word>sha1m</Word>\n\t\t\t<Word>sha1p</Word>\n\t\t\t<Word>sha1su0</Word>\n\t\t\t<Word>sha1su1</Word>\n\t\t\t<Word>sha256h</Word>\n\t\t\t<Word>sha256h2</Word>\n\t\t\t<Word>sha256su0</Word>\n\t\t\t<Word>sha256su1</Word>\n\t\t\t<Word>sha512h</Word>\n\t\t\t<Word>sha512h2</Word>\n\t\t\t<Word>sha512su0</Word>\n\t\t\t<Word>sha512su1</Word>\n\t\t\t<Word>shadd</Word>\n\t\t\t<Word>shl</Word>\n\t\t\t<Word>shll</Word>\n\t\t\t<Word>shll2</Word>\n\t\t\t<Word>shrn</Word>\n\t\t\t<Word>shrn2</Word>\n\t\t\t<Word>shrnb</Word>\n\t\t\t<Word>shrnt</Word>\n\t\t\t<Word>shsub</Word>\n\t\t\t<Word>shsubr</Word>\n\t\t\t<Word>sli</Word>\n\t\t\t<Word>sm3partw1</Word>\n\t\t\t<Word>sm3partw2</Word>\n\t\t\t<Word>sm3ss1</Word>\n\t\t\t<Word>sm3tt1a</Word>\n\t\t\t<Word>sm3tt1b</Word>\n\t\t\t<Word>sm3tt2a</Word>\n\t\t\t<Word>sm3tt2b</Word>\n\t\t\t<Word>sm4e</Word>\n\t\t\t<Word>sm4ekey</Word>\n\t\t\t<Word>smaddl</Word>\n\t\t\t<Word>smax</Word>\n\t\t\t<Word>smaxp</Word>\n\t\t\t<Word>smaxqv</Word>\n\t\t\t<Word>smaxv</Word>\n\t\t\t<Word>smc</Word>\n\t\t\t<Word>smin</Word>\n\t\t\t<Word>sminp</Word>\n\t\t\t<Word>sminqv</Word>\n\t\t\t<Word>sminv</Word>\n\t\t\t<Word>smlal</Word>\n\t\t\t<Word>smlal2</Word>\n\t\t\t<Word>smlalb</Word>\n\t\t\t<Word>smlall</Word>\n\t\t\t<Word>smlalt</Word>\n\t\t\t<Word>smlsl</Word>\n\t\t\t<Word>smlsl2</Word>\n\t\t\t<Word>smlslb</Word>\n\t\t\t<Word>smlsll</Word>\n\t\t\t<Word>smlslt</Word>\n\t\t\t<Word>smmla</Word>\n\t\t\t<Word>smnegl</Word>\n\t\t\t<Word>smopa</Word>\n\t\t\t<Word>smops</Word>\n\t\t\t<Word>smov</Word>\n\t\t\t<Word>smstart</Word>\n\t\t\t<Word>smstop</Word>\n\t\t\t<Word>smsubl</Word>\n\t\t\t<Word>smulh</Word>\n\t\t\t<Word>smull</Word>\n\t\t\t<Word>smull2</Word>\n\t\t\t<Word>smullb</Word>\n\t\t\t<Word>smullt</Word>\n\t\t\t<Word>splice</Word>\n\t\t\t<Word>sqabs</Word>\n\t\t\t<Word>sqadd</Word>\n\t\t\t<Word>sqcadd</Word>\n\t\t\t<Word>sqcvt</Word>\n\t\t\t<Word>sqcvtn</Word>\n\t\t\t<Word>sqcvtu</Word>\n\t\t\t<Word>sqcvtun</Word>\n\t\t\t<Word>sqdecb</Word>\n\t\t\t<Word>sqdecd</Word>\n\t\t\t<Word>sqdech</Word>\n\t\t\t<Word>sqdecp</Word>\n\t\t\t<Word>sqdecw</Word>\n\t\t\t<Word>sqdmlal</Word>\n\t\t\t<Word>sqdmlal2</Word>\n\t\t\t<Word>sqdmlalb</Word>\n\t\t\t<Word>sqdmlalbt</Word>\n\t\t\t<Word>sqdmlalt</Word>\n\t\t\t<Word>sqdmlsl</Word>\n\t\t\t<Word>sqdmlsl2</Word>\n\t\t\t<Word>sqdmlslb</Word>\n\t\t\t<Word>sqdmlslbt</Word>\n\t\t\t<Word>sqdmlslt</Word>\n\t\t\t<Word>sqdmulh</Word>\n\t\t\t<Word>sqdmull</Word>\n\t\t\t<Word>sqdmull2</Word>\n\t\t\t<Word>sqdmullb</Word>\n\t\t\t<Word>sqdmullt</Word>\n\t\t\t<Word>sqincb</Word>\n\t\t\t<Word>sqincd</Word>\n\t\t\t<Word>sqinch</Word>\n\t\t\t<Word>sqincp</Word>\n\t\t\t<Word>sqincw</Word>\n\t\t\t<Word>sqneg</Word>\n\t\t\t<Word>sqrdcmlah</Word>\n\t\t\t<Word>sqrdmlah</Word>\n\t\t\t<Word>sqrdmlsh</Word>\n\t\t\t<Word>sqrdmulh</Word>\n\t\t\t<Word>sqrshl</Word>\n\t\t\t<Word>sqrshlr</Word>\n\t\t\t<Word>sqrshr</Word>\n\t\t\t<Word>sqrshrn</Word>\n\t\t\t<Word>sqrshrn2</Word>\n\t\t\t<Word>sqrshrnb</Word>\n\t\t\t<Word>sqrshrnt</Word>\n\t\t\t<Word>sqrshru</Word>\n\t\t\t<Word>sqrshrun</Word>\n\t\t\t<Word>sqrshrun2</Word>\n\t\t\t<Word>sqrshrunb</Word>\n\t\t\t<Word>sqrshrunt</Word>\n\t\t\t<Word>sqshl</Word>\n\t\t\t<Word>sqshlr</Word>\n\t\t\t<Word>sqshlu</Word>\n\t\t\t<Word>sqshrn</Word>\n\t\t\t<Word>sqshrn2</Word>\n\t\t\t<Word>sqshrnb</Word>\n\t\t\t<Word>sqshrnt</Word>\n\t\t\t<Word>sqshrun</Word>\n\t\t\t<Word>sqshrun2</Word>\n\t\t\t<Word>sqshrunb</Word>\n\t\t\t<Word>sqshrunt</Word>\n\t\t\t<Word>sqsub</Word>\n\t\t\t<Word>sqsubr</Word>\n\t\t\t<Word>sqxtn</Word>\n\t\t\t<Word>sqxtn2</Word>\n\t\t\t<Word>sqxtnb</Word>\n\t\t\t<Word>sqxtnt</Word>\n\t\t\t<Word>sqxtun</Word>\n\t\t\t<Word>sqxtun2</Word>\n\t\t\t<Word>sqxtunb</Word>\n\t\t\t<Word>sqxtunt</Word>\n\t\t\t<Word>srhadd</Word>\n\t\t\t<Word>sri</Word>\n\t\t\t<Word>srshl</Word>\n\t\t\t<Word>srshlr</Word>\n\t\t\t<Word>srshr</Word>\n\t\t\t<Word>srsra</Word>\n\t\t\t<Word>ssbb</Word>\n\t\t\t<Word>sshl</Word>\n\t\t\t<Word>sshll</Word>\n\t\t\t<Word>sshll2</Word>\n\t\t\t<Word>sshllb</Word>\n\t\t\t<Word>sshllt</Word>\n\t\t\t<Word>sshr</Word>\n\t\t\t<Word>ssra</Word>\n\t\t\t<Word>ssubl</Word>\n\t\t\t<Word>ssubl2</Word>\n\t\t\t<Word>ssublb</Word>\n\t\t\t<Word>ssublbt</Word>\n\t\t\t<Word>ssublt</Word>\n\t\t\t<Word>ssubltb</Word>\n\t\t\t<Word>ssubw</Word>\n\t\t\t<Word>ssubw2</Word>\n\t\t\t<Word>ssubwb</Word>\n\t\t\t<Word>ssubwt</Word>\n\t\t\t<Word>st1</Word>\n\t\t\t<Word>st1b</Word>\n\t\t\t<Word>st1d</Word>\n\t\t\t<Word>st1h</Word>\n\t\t\t<Word>st1q</Word>\n\t\t\t<Word>st1w</Word>\n\t\t\t<Word>st2</Word>\n\t\t\t<Word>st2b</Word>\n\t\t\t<Word>st2d</Word>\n\t\t\t<Word>st2g</Word>\n\t\t\t<Word>st2h</Word>\n\t\t\t<Word>st2q</Word>\n\t\t\t<Word>st2w</Word>\n\t\t\t<Word>st3</Word>\n\t\t\t<Word>st3b</Word>\n\t\t\t<Word>st3d</Word>\n\t\t\t<Word>st3h</Word>\n\t\t\t<Word>st3q</Word>\n\t\t\t<Word>st3w</Word>\n\t\t\t<Word>st4</Word>\n\t\t\t<Word>st4b</Word>\n\t\t\t<Word>st4d</Word>\n\t\t\t<Word>st4h</Word>\n\t\t\t<Word>st4q</Word>\n\t\t\t<Word>st4w</Word>\n\t\t\t<Word>st64b</Word>\n\t\t\t<Word>st64bv</Word>\n\t\t\t<Word>st64bv0</Word>\n\t\t\t<Word>stadd</Word>\n\t\t\t<Word>staddb</Word>\n\t\t\t<Word>staddh</Word>\n\t\t\t<Word>staddl</Word>\n\t\t\t<Word>staddlb</Word>\n\t\t\t<Word>staddlh</Word>\n\t\t\t<Word>stclr</Word>\n\t\t\t<Word>stclrb</Word>\n\t\t\t<Word>stclrh</Word>\n\t\t\t<Word>stclrl</Word>\n\t\t\t<Word>stclrlb</Word>\n\t\t\t<Word>stclrlh</Word>\n\t\t\t<Word>steor</Word>\n\t\t\t<Word>steorb</Word>\n\t\t\t<Word>steorh</Word>\n\t\t\t<Word>steorl</Word>\n\t\t\t<Word>steorlb</Word>\n\t\t\t<Word>steorlh</Word>\n\t\t\t<Word>stg</Word>\n\t\t\t<Word>stgm</Word>\n\t\t\t<Word>stgp</Word>\n\t\t\t<Word>stilp</Word>\n\t\t\t<Word>stl1</Word>\n\t\t\t<Word>stllr</Word>\n\t\t\t<Word>stllrb</Word>\n\t\t\t<Word>stllrh</Word>\n\t\t\t<Word>stlr</Word>\n\t\t\t<Word>stlrb</Word>\n\t\t\t<Word>stlrh</Word>\n\t\t\t<Word>stlur</Word>\n\t\t\t<Word>stlurb</Word>\n\t\t\t<Word>stlurh</Word>\n\t\t\t<Word>stlxp</Word>\n\t\t\t<Word>stlxr</Word>\n\t\t\t<Word>stlxrb</Word>\n\t\t\t<Word>stlxrh</Word>\n\t\t\t<Word>stnp</Word>\n\t\t\t<Word>stnt1b</Word>\n\t\t\t<Word>stnt1d</Word>\n\t\t\t<Word>stnt1h</Word>\n\t\t\t<Word>stnt1w</Word>\n\t\t\t<Word>stp</Word>\n\t\t\t<Word>str</Word>\n\t\t\t<Word>strb</Word>\n\t\t\t<Word>strh</Word>\n\t\t\t<Word>stset</Word>\n\t\t\t<Word>stsetb</Word>\n\t\t\t<Word>stseth</Word>\n\t\t\t<Word>stsetl</Word>\n\t\t\t<Word>stsetlb</Word>\n\t\t\t<Word>stsetlh</Word>\n\t\t\t<Word>stsmax</Word>\n\t\t\t<Word>stsmaxb</Word>\n\t\t\t<Word>stsmaxh</Word>\n\t\t\t<Word>stsmaxl</Word>\n\t\t\t<Word>stsmaxlb</Word>\n\t\t\t<Word>stsmaxlh</Word>\n\t\t\t<Word>stsmin</Word>\n\t\t\t<Word>stsminb</Word>\n\t\t\t<Word>stsminh</Word>\n\t\t\t<Word>stsminl</Word>\n\t\t\t<Word>stsminlb</Word>\n\t\t\t<Word>stsminlh</Word>\n\t\t\t<Word>sttr</Word>\n\t\t\t<Word>sttrb</Word>\n\t\t\t<Word>sttrh</Word>\n\t\t\t<Word>stumax</Word>\n\t\t\t<Word>stumaxb</Word>\n\t\t\t<Word>stumaxh</Word>\n\t\t\t<Word>stumaxl</Word>\n\t\t\t<Word>stumaxlb</Word>\n\t\t\t<Word>stumaxlh</Word>\n\t\t\t<Word>stumin</Word>\n\t\t\t<Word>stuminb</Word>\n\t\t\t<Word>stuminh</Word>\n\t\t\t<Word>stuminl</Word>\n\t\t\t<Word>stuminlb</Word>\n\t\t\t<Word>stuminlh</Word>\n\t\t\t<Word>stur</Word>\n\t\t\t<Word>sturb</Word>\n\t\t\t<Word>sturh</Word>\n\t\t\t<Word>stxp</Word>\n\t\t\t<Word>stxr</Word>\n\t\t\t<Word>stxrb</Word>\n\t\t\t<Word>stxrh</Word>\n\t\t\t<Word>stz2g</Word>\n\t\t\t<Word>stzg</Word>\n\t\t\t<Word>stzgm</Word>\n\t\t\t<Word>sub</Word>\n\t\t\t<Word>subg</Word>\n\t\t\t<Word>subhn</Word>\n\t\t\t<Word>subhn2</Word>\n\t\t\t<Word>subhnb</Word>\n\t\t\t<Word>subhnt</Word>\n\t\t\t<Word>subp</Word>\n\t\t\t<Word>subps</Word>\n\t\t\t<Word>subpt</Word>\n\t\t\t<Word>subr</Word>\n\t\t\t<Word>subs</Word>\n\t\t\t<Word>sudot</Word>\n\t\t\t<Word>sumlall</Word>\n\t\t\t<Word>sumopa</Word>\n\t\t\t<Word>sumops</Word>\n\t\t\t<Word>sunpk</Word>\n\t\t\t<Word>sunpkhi</Word>\n\t\t\t<Word>sunpklo</Word>\n\t\t\t<Word>suqadd</Word>\n\t\t\t<Word>suvdot</Word>\n\t\t\t<Word>svc</Word>\n\t\t\t<Word>svdot</Word>\n\t\t\t<Word>swp</Word>\n\t\t\t<Word>swpa</Word>\n\t\t\t<Word>swpab</Word>\n\t\t\t<Word>swpah</Word>\n\t\t\t<Word>swpal</Word>\n\t\t\t<Word>swpalb</Word>\n\t\t\t<Word>swpalh</Word>\n\t\t\t<Word>swpb</Word>\n\t\t\t<Word>swph</Word>\n\t\t\t<Word>swpl</Word>\n\t\t\t<Word>swplb</Word>\n\t\t\t<Word>swplh</Word>\n\t\t\t<Word>swpp</Word>\n\t\t\t<Word>swppa</Word>\n\t\t\t<Word>swppal</Word>\n\t\t\t<Word>swppl</Word>\n\t\t\t<Word>sxtb</Word>\n\t\t\t<Word>sxth</Word>\n\t\t\t<Word>sxtl</Word>\n\t\t\t<Word>sxtl2</Word>\n\t\t\t<Word>sxtw</Word>\n\t\t\t<Word>sys</Word>\n\t\t\t<Word>sysl</Word>\n\t\t\t<Word>sysp</Word>\n\t\t\t<Word>tbl</Word>\n\t\t\t<Word>tblq</Word>\n\t\t\t<Word>tbnz</Word>\n\t\t\t<Word>tbx</Word>\n\t\t\t<Word>tbxq</Word>\n\t\t\t<Word>tbz</Word>\n\t\t\t<Word>tcancel</Word>\n\t\t\t<Word>tcommit</Word>\n\t\t\t<Word>tlbi</Word>\n\t\t\t<Word>tlbip</Word>\n\t\t\t<Word>trcit</Word>\n\t\t\t<Word>trn1</Word>\n\t\t\t<Word>trn2</Word>\n\t\t\t<Word>tsb</Word>\n\t\t\t<Word>tst</Word>\n\t\t\t<Word>tstart</Word>\n\t\t\t<Word>ttest</Word>\n\t\t\t<Word>uaba</Word>\n\t\t\t<Word>uabal</Word>\n\t\t\t<Word>uabal2</Word>\n\t\t\t<Word>uabalb</Word>\n\t\t\t<Word>uabalt</Word>\n\t\t\t<Word>uabd</Word>\n\t\t\t<Word>uabdl</Word>\n\t\t\t<Word>uabdl2</Word>\n\t\t\t<Word>uabdlb</Word>\n\t\t\t<Word>uabdlt</Word>\n\t\t\t<Word>uadalp</Word>\n\t\t\t<Word>uaddl</Word>\n\t\t\t<Word>uaddl2</Word>\n\t\t\t<Word>uaddlb</Word>\n\t\t\t<Word>uaddlp</Word>\n\t\t\t<Word>uaddlt</Word>\n\t\t\t<Word>uaddlv</Word>\n\t\t\t<Word>uaddv</Word>\n\t\t\t<Word>uaddw</Word>\n\t\t\t<Word>uaddw2</Word>\n\t\t\t<Word>uaddwb</Word>\n\t\t\t<Word>uaddwt</Word>\n\t\t\t<Word>ubfiz</Word>\n\t\t\t<Word>ubfm</Word>\n\t\t\t<Word>ubfx</Word>\n\t\t\t<Word>uclamp</Word>\n\t\t\t<Word>ucvtf</Word>\n\t\t\t<Word>udf</Word>\n\t\t\t<Word>udiv</Word>\n\t\t\t<Word>udivr</Word>\n\t\t\t<Word>udot</Word>\n\t\t\t<Word>uhadd</Word>\n\t\t\t<Word>uhsub</Word>\n\t\t\t<Word>uhsubr</Word>\n\t\t\t<Word>umaddl</Word>\n\t\t\t<Word>umax</Word>\n\t\t\t<Word>umaxp</Word>\n\t\t\t<Word>umaxqv</Word>\n\t\t\t<Word>umaxv</Word>\n\t\t\t<Word>umin</Word>\n\t\t\t<Word>uminp</Word>\n\t\t\t<Word>uminqv</Word>\n\t\t\t<Word>uminv</Word>\n\t\t\t<Word>umlal</Word>\n\t\t\t<Word>umlal2</Word>\n\t\t\t<Word>umlalb</Word>\n\t\t\t<Word>umlall</Word>\n\t\t\t<Word>umlalt</Word>\n\t\t\t<Word>umlsl</Word>\n\t\t\t<Word>umlsl2</Word>\n\t\t\t<Word>umlslb</Word>\n\t\t\t<Word>umlsll</Word>\n\t\t\t<Word>umlslt</Word>\n\t\t\t<Word>ummla</Word>\n\t\t\t<Word>umnegl</Word>\n\t\t\t<Word>umopa</Word>\n\t\t\t<Word>umops</Word>\n\t\t\t<Word>umov</Word>\n\t\t\t<Word>umsubl</Word>\n\t\t\t<Word>umulh</Word>\n\t\t\t<Word>umull</Word>\n\t\t\t<Word>umull2</Word>\n\t\t\t<Word>umullb</Word>\n\t\t\t<Word>umullt</Word>\n\t\t\t<Word>uqadd</Word>\n\t\t\t<Word>uqcvt</Word>\n\t\t\t<Word>uqcvtn</Word>\n\t\t\t<Word>uqdecb</Word>\n\t\t\t<Word>uqdecd</Word>\n\t\t\t<Word>uqdech</Word>\n\t\t\t<Word>uqdecp</Word>\n\t\t\t<Word>uqdecw</Word>\n\t\t\t<Word>uqincb</Word>\n\t\t\t<Word>uqincd</Word>\n\t\t\t<Word>uqinch</Word>\n\t\t\t<Word>uqincp</Word>\n\t\t\t<Word>uqincw</Word>\n\t\t\t<Word>uqrshl</Word>\n\t\t\t<Word>uqrshlr</Word>\n\t\t\t<Word>uqrshr</Word>\n\t\t\t<Word>uqrshrn</Word>\n\t\t\t<Word>uqrshrn2</Word>\n\t\t\t<Word>uqrshrnb</Word>\n\t\t\t<Word>uqrshrnt</Word>\n\t\t\t<Word>uqshl</Word>\n\t\t\t<Word>uqshlr</Word>\n\t\t\t<Word>uqshrn</Word>\n\t\t\t<Word>uqshrn2</Word>\n\t\t\t<Word>uqshrnb</Word>\n\t\t\t<Word>uqshrnt</Word>\n\t\t\t<Word>uqsub</Word>\n\t\t\t<Word>uqsubr</Word>\n\t\t\t<Word>uqxtn</Word>\n\t\t\t<Word>uqxtn2</Word>\n\t\t\t<Word>uqxtnb</Word>\n\t\t\t<Word>uqxtnt</Word>\n\t\t\t<Word>urecpe</Word>\n\t\t\t<Word>urhadd</Word>\n\t\t\t<Word>urshl</Word>\n\t\t\t<Word>urshlr</Word>\n\t\t\t<Word>urshr</Word>\n\t\t\t<Word>ursqrte</Word>\n\t\t\t<Word>ursra</Word>\n\t\t\t<Word>usdot</Word>\n\t\t\t<Word>ushl</Word>\n\t\t\t<Word>ushll</Word>\n\t\t\t<Word>ushll2</Word>\n\t\t\t<Word>ushllb</Word>\n\t\t\t<Word>ushllt</Word>\n\t\t\t<Word>ushr</Word>\n\t\t\t<Word>usmlall</Word>\n\t\t\t<Word>usmmla</Word>\n\t\t\t<Word>usmopa</Word>\n\t\t\t<Word>usmops</Word>\n\t\t\t<Word>usqadd</Word>\n\t\t\t<Word>usra</Word>\n\t\t\t<Word>usubl</Word>\n\t\t\t<Word>usubl2</Word>\n\t\t\t<Word>usublb</Word>\n\t\t\t<Word>usublt</Word>\n\t\t\t<Word>usubw</Word>\n\t\t\t<Word>usubw2</Word>\n\t\t\t<Word>usubwb</Word>\n\t\t\t<Word>usubwt</Word>\n\t\t\t<Word>usvdot</Word>\n\t\t\t<Word>uunpk</Word>\n\t\t\t<Word>uunpkhi</Word>\n\t\t\t<Word>uunpklo</Word>\n\t\t\t<Word>uvdot</Word>\n\t\t\t<Word>uxtb</Word>\n\t\t\t<Word>uxth</Word>\n\t\t\t<Word>uxtl</Word>\n\t\t\t<Word>uxtl2</Word>\n\t\t\t<Word>uxtw</Word>\n\t\t\t<Word>uzp</Word>\n\t\t\t<Word>uzp1</Word>\n\t\t\t<Word>uzp2</Word>\n\t\t\t<Word>uzpq1</Word>\n\t\t\t<Word>uzpq2</Word>\n\t\t\t<Word>wfe</Word>\n\t\t\t<Word>wfet</Word>\n\t\t\t<Word>wfi</Word>\n\t\t\t<Word>wfit</Word>\n\t\t\t<Word>whilege</Word>\n\t\t\t<Word>whilegt</Word>\n\t\t\t<Word>whilehi</Word>\n\t\t\t<Word>whilehs</Word>\n\t\t\t<Word>whilele</Word>\n\t\t\t<Word>whilelo</Word>\n\t\t\t<Word>whilels</Word>\n\t\t\t<Word>whilelt</Word>\n\t\t\t<Word>whilerw</Word>\n\t\t\t<Word>whilewr</Word>\n\t\t\t<Word>wrffr</Word>\n\t\t\t<Word>xaflag</Word>\n\t\t\t<Word>xar</Word>\n\t\t\t<Word>xpacd</Word>\n\t\t\t<Word>xpaci</Word>\n\t\t\t<Word>xpaclri</Word>\n\t\t\t<Word>xtn</Word>\n\t\t\t<Word>xtn2</Word>\n\t\t\t<Word>yield</Word>\n\t\t\t<Word>zero</Word>\n\t\t\t<Word>zip</Word>\n\t\t\t<Word>zip1</Word>\n\t\t\t<Word>zip2</Word>\n\t\t\t<Word>zipq1</Word>\n\t\t\t<Word>zipq2</Word>\n        </Keywords>\n\n        <Keywords color=\"Type\">\n            <Word>byte</Word>\n            <Word>word</Word>\n            <Word>dword</Word>\n            <Word>qword</Word>\n            <Word>ptr</Word>\n            <Word>xmmword</Word>\n            <Word>ymmword</Word>\n            <Word>zmmword</Word>\n        </Keywords>\n\n        <Span color=\"ArrayType\">\n            <Begin>\\[</Begin>\n            <End>\\]</End>\n        </Span>\n\n        <Span color=\"StructType\">\n            <Begin>\\{</Begin>\n            <End>\\}</End>\n        </Span>\n\n        <Rule color=\"Variable\">%\\w+(.\\w+)*</Rule>\n        <Rule color=\"CallTarget\">@\\w+(.\\w+)*</Rule>\n        <Rule color=\"Annotation\">!\\w+([a-z]|[A-Z]|[0-9]|\\(|\\))*</Rule>\n        <Rule color=\"Digits\">\\b((0x)?[0-9a-fA-F]+|[0-9]+)\\b</Rule>\n\n        <Keywords color=\"Attributes\">\n            <Word>true</Word>\n            <Word>false</Word>\n        </Keywords>\n    </RuleSet>\n</SyntaxDefinition>"
  },
  {
    "path": "resources/asm/function-markings.json",
    "content": "{\n  \"ModuleColors\": [],\n  \"FunctionColors\": [\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Memory Allocation\",\n      \"Name\": \"\\\\b(free|malloc|calloc|aligned_alloc|operator delete|operator new|realloc|RtlAllocateHeap|RtlFreeHeap|RtlpAllocateHeap|RtlpAllocateHeapInternal|RtlpFreeHeap|RtlpFreeHeapInternal|_free_base|_malloc_base)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Memory Copy/Set/Move\",\n      \"Name\": \"\\\\b(memset|memcpy|memmove|ZeroMemory|SecureZeroMemory|SecureZeroMemory2|CopyMemory|MoveMemory|FillMemory)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Page Fault\",\n      \"Name\": \"\\\\b(KiPageFault|MiCompletePrivateZeroFault|MiDispatchFault|MiResolveDemandZeroFault|MiResolvePrivateZeroFault|MiUserFault|MiZeroFault|MmAccessFault)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Virtual Memory\",\n      \"Name\": \"\\\\b(DiscardVirtualMemory|OfferVirtualMemory|PrefetchVirtualMemory|QueryVirtualMemoryInformation|ReclaimVirtualMemory|VirtualAlloc|VirtualAlloc2|VirtualAllocEx|VirtualAllocExNuma|VirtualFree|VirtualFreeEx|VirtualLock|VirtualProtect|VirtualProtectEx|VirtualProtectFromApp|VirtualQuery|VirtualQueryEx|VirtualUnlock)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Thread Synchronization\",\n      \"Name\": \"\\\\b(AcquireSRWLockExclusive|AcquireSRWLockShared|DeleteCriticalSection|EnterCriticalSection|InitializeConditionVariable|InitializeCriticalSection|InitializeCriticalSectionAndSpinCount|InitializeCriticalSectionEx|InitializeSRWLock|KeDelayExecutionThread|KeYieldExecution|LeaveCriticalSection|ReleaseSRWLockExclusive|ReleaseSRWLockShared|RtlAcquireSRWLockExclusive|RtlAcquireSRWLockShared|RtlBackoff|RtlDelayExecution|RtlEnterCriticalSection|RtlLeaveCriticalSection|RtlpEnterCriticalSectionContended|RtlpOptimizeConditionVariableWaitList|RtlpWaitOnCriticalSection|RtlpWakeSRWLock|RtlReleaseSRWLockExclusive|RtlReleaseSRWLockShared|RtlSleepConditionVariableSRW|RtlWakeConditionVariable|SetCriticalSectionSpinCount|SleepConditionVariableCS|SleepConditionVariableSRW|TryAcquireSRWLockExclusive|TryAcquireSRWLockShared|TryEnterCriticalSection|WakeAllConditionVariable|WakeConditionVariable|NtDelayExecution)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"File I\\/O\",\n      \"Name\": \"\\\\b(CreateFile|CreateFile2|DeleteFile|FindClose|FindFirstFile|FindFirstFileEx|FindNextFile|FlushFileBuffers|GetFileAttributes|GetFileAttributesEx|GetFileSize|GetFileSizeEx|GetFileTime|IopCreateFile|IopReadFile|IopWriteFile|NtCreateFile|NtReadFile|NtWriteFile|ReadFile|ReadFileEx|SetFileAttributes|SetFileInformationByHandle|SetFilePointer|SetFilePointerEx|WriteFile|WriteFileEx)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"C\\/C++ File I\\/O\",\n      \"Name\": \"\\\\b(_fgetc_nolock|_fread|_fsopen|_fwrite_nolock_internal|_read_nolock|fclose|fgetc|fread_s|fwrite|std::basic_filebuf)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Network I\\/O\",\n      \"Name\": \"\\\\b(WSARecv|WSASend|TcpTlConnectionSend|TcpReceive)\\\\b|_WSARecv|_WSASend\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"C-style Strings\",\n      \"Name\": \"\\\\b(mblen|mbstowcs|mbtowc|memchr|strcat|strcat_s|strchr|strcmp|strcoll|strcpy|strcpy_s|strcspn|strlen|strncat|strncat_s|strncmp|strncpy|strncpy_s|strpbrk|strrchr|strspn|strstr|strtok|wcscat|wcscat_s|wcschr|wcscmp|wcscoll|wcscpy|wcscpy_s|wcscspn|wcslen|wcsncat|wcsncat_s|wcsncmp|wcsncpy|wcsncpy_s|wcspbrk|wcsrchr|wcsspn|wcsstr|wcstod|wcstof|wcstok|wcstol|wcstold|wcstoll|wcstombs|wcstoul|wcstoull|wcsxfrm|wctomb|_mbscat|_mbscat_s|_mbscmp|_mbscoll|_mbscoll_l|_mbscpy|_mbscpy_s|_mbsicmp|_mbsicmp_l|_mbsicoll|_mbsicoll_l|_mbsncat|_mbsncat_l|_mbsncat_s|_mbsncat_s_l|_mbsncoll|_mbsncoll_l|_mbsncpy|_mbsncpy_l|_mbsncpy_s|_mbsncpy_s_l|_mbsnicmp|_mbsnicmp_l|_mbsnicoll|_mbsnicoll_l|_mbsrchr|_mbsrchr_l|_strcoll_l|_stricmp|_stricmp_l|_stricoll|_stricoll_l|_strncat_l|_strncat_s_l|_strncoll|_strncoll_l|_strncpy_l|_strncpy_s_l|_strnicmp|_strnicmp_l|_strnicoll|_strnicoll_l|_wcscoll_l|_wcsicmp|_wcsicmp_l|_wcsicoll|_wcsicoll_l|_wcsncat_l|_wcsncat_s_l|_wcsncoll|_wcsncoll_l|_wcsncpy_l|_wcsncpy_s_l|_wcsnicmp|_wcsnicmp_l|_wcsnicoll|_wcsnicoll_l)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Wait on Objects\",\n      \"Name\": \"\\\\b(MsgWaitForMultipleObjects|MsgWaitForMultipleObjectsEx|RegisterWaitForSingleObject|SignalObjectAndWait|UnregisterWait|UnregisterWaitEx|WaitForMultipleObjects|WaitForMultipleObjectsEx|WaitForSingleObject|WaitForSingleObjectEx|WaitOnAddress|WaitOrTimerCallback|WakeByAddressAll|WakeByAddressSingle)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    },\n    {\n      \"IsEnabled\": true,\n      \"Title\": \"Exception Handling\",\n      \"Name\": \"\\\\b(RaiseException|RtlRaiseException|RtlDispatchException|RtlpExecuteHandlerForException|__CxxFrameHandler4|RtlUnwind|RtlUnwindEx|__ExceptionPtrRethrow)\\\\b\",\n      \"Color\": \"#000000\",\n      \"IsRegex\": true\n    }\n  ],\n  \"Title\": \"Builtin\"\n}"
  },
  {
    "path": "resources/asm/x86-asm.xshd",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n\n<!-- Syntax definition for ASM IR -->\n<SyntaxDefinition name=\"x86 ASM IR\" xmlns=\"http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008\">\n    <Color name=\"String\" foreground=\"DarkOrange\" />\n    <Color name=\"Digits\" foreground=\"Blue\" />\n    <Color name=\"Comment\" foreground=\"Silver\" />\n    <Color name=\"Keywords\" foreground=\"DarkBlue\" fontWeight=\"bold\"/>\n    <Color name=\"Opcodes\" foreground=\"Crimson\" fontWeight=\"bold\"/>\n    <Color name=\"TransferOpcodes\" foreground=\"DarkGreen\" fontWeight=\"bold\"/>\n    <Color name=\"CallOpcodes\" foreground=\"DarkOrchid\" fontWeight=\"bold\" />\n    <Color name=\"ArrayType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"PointerType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"StructType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"Type\" foreground=\"Maroon\" />\n    <Color name=\"Attributes\" foreground=\"DarkGreen\" fontWeight=\"bold\" />\n    <Color name=\"Annotation\" foreground=\"Silver\" />\n    <Color name=\"Variable\" foreground=\"Black\" fontWeight=\"bold\" />\n    <Color name=\"CallTarget\" foreground=\"DarkGreen\" fontWeight=\"bold\" />\n    <RuleSet ignoreCase=\"false\">\n        <Span color=\"Comment\" begin=\";\" />\n        <Span color=\"String\">\n            <Begin>\"</Begin>\n            <End>\"</End>\n            <RuleSet>\n                <!-- nested span for escape sequences -->\n                <Span begin=\"\\\\\" end=\".\" />\n            </RuleSet>\n        </Span>\n\n        <Keywords color=\"Keywords\">\n            <Word>define</Word>\n            <Word>global</Word>\n            <Word>declare</Word>\n        </Keywords>\n\t\t\n        <Keywords color=\"TransferOpcodes\">\n\t\t\t<Word>je</Word>\n\t\t\t<Word>jne</Word>\n            <Word>jo</Word>\n\t\t\t<Word>jno</Word>\n\t\t\t<Word>jb</Word>\n\t\t\t<Word>jnb</Word>\n\t\t\t<Word>jz</Word>\n\t\t\t<Word>jnz</Word>\n\t\t\t<Word>jbe</Word>\n\t\t\t<Word>ja</Word>\n\t\t\t<Word>js</Word>\n\t\t\t<Word>jns</Word>\n\t\t\t<Word>jp</Word>\n\t\t\t<Word>jnp</Word>\n\t\t\t<Word>jmp</Word>\n\t\t\t<Word>jl</Word>\n\t\t\t<Word>jge</Word>\n\t\t\t<Word>jle</Word>\n\t\t\t<Word>jg</Word>\n            <Word>ret</Word>\n            <Word>retf</Word>\n            <Word>iret</Word>\n\t\t\t<Word>int3</Word>\n        </Keywords>\n\n\t\t<Rule color=\"CallOpcodes\">call\\s+.*</Rule>\n\n        <Keywords color=\"Opcodes\">\n\t\t\t<Word>aaa</Word>\n\t\t\t<Word>aad</Word>\n\t\t\t<Word>aam</Word>\n\t\t\t<Word>aas</Word>\n\t\t\t<Word>adc</Word>\n\t\t\t<Word>adcx</Word>\n\t\t\t<Word>add</Word>\n\t\t\t<Word>addpd</Word>\n\t\t\t<Word>vaddpd</Word>\n\t\t\t<Word>addps</Word>\n\t\t\t<Word>vaddps</Word>\n\t\t\t<Word>addsd</Word>\n\t\t\t<Word>vaddsd</Word>\n\t\t\t<Word>addss</Word>\n\t\t\t<Word>vaddss</Word>\n\t\t\t<Word>addsubpd</Word>\n\t\t\t<Word>vaddsubpd</Word>\n\t\t\t<Word>addsubps</Word>\n\t\t\t<Word>vaddsubps</Word>\n\t\t\t<Word>adox</Word>\n\t\t\t<Word>aesdec</Word>\n\t\t\t<Word>vaesdec</Word>\n\t\t\t<Word>aesdeclast</Word>\n\t\t\t<Word>vaesdeclast</Word>\n\t\t\t<Word>aesenc</Word>\n\t\t\t<Word>vaesenc</Word>\n\t\t\t<Word>aesenclast</Word>\n\t\t\t<Word>vaesenclast</Word>\n\t\t\t<Word>aesimc</Word>\n\t\t\t<Word>vaesimc</Word>\n\t\t\t<Word>aeskeygenassist</Word>\n\t\t\t<Word>vaeskeygenassist</Word>\n\t\t\t<Word>and</Word>\n\t\t\t<Word>andn</Word>\n\t\t\t<Word>andnpd</Word>\n\t\t\t<Word>vandnpd</Word>\n\t\t\t<Word>andnps</Word>\n\t\t\t<Word>vandnps</Word>\n\t\t\t<Word>andpd</Word>\n\t\t\t<Word>vandpd</Word>\n\t\t\t<Word>andps</Word>\n\t\t\t<Word>vandps</Word>\n\t\t\t<Word>arpl</Word>\n\t\t\t<Word>bextr</Word>\n\t\t\t<Word>blendpd</Word>\n\t\t\t<Word>vblendpd</Word>\n\t\t\t<Word>blendps</Word>\n\t\t\t<Word>vblendps</Word>\n\t\t\t<Word>blendvpd</Word>\n\t\t\t<Word>vblendvpd</Word>\n\t\t\t<Word>blendvps</Word>\n\t\t\t<Word>vblendvps</Word>\n\t\t\t<Word>blsi</Word>\n\t\t\t<Word>blsmsk</Word>\n\t\t\t<Word>blsr</Word>\n\t\t\t<Word>bndcl</Word>\n\t\t\t<Word>bndcu</Word>\n\t\t\t<Word>bndcn</Word>\n\t\t\t<Word>bndldx</Word>\n\t\t\t<Word>bndmk</Word>\n\t\t\t<Word>bndmov</Word>\n\t\t\t<Word>bndstx</Word>\n\t\t\t<Word>bound</Word>\n\t\t\t<Word>bsf</Word>\n\t\t\t<Word>bsr</Word>\n\t\t\t<Word>bswap</Word>\n\t\t\t<Word>bt</Word>\n\t\t\t<Word>btc</Word>\n\t\t\t<Word>btr</Word>\n\t\t\t<Word>bts</Word>\n\t\t\t<Word>bzhi</Word>\n\t\t\t<Word>call</Word>\n\t\t\t<Word>cbw</Word>\n\t\t\t<Word>cwde</Word>\n\t\t\t<Word>cdqe</Word>\n\t\t\t<Word>clac</Word>\n\t\t\t<Word>clc</Word>\n\t\t\t<Word>cld</Word>\n\t\t\t<Word>cldemote</Word>\n\t\t\t<Word>clflush</Word>\n\t\t\t<Word>clflushopt</Word>\n\t\t\t<Word>cli</Word>\n\t\t\t<Word>clts</Word>\n\t\t\t<Word>clwb</Word>\n\t\t\t<Word>cmc</Word>\n\t\t\t<Word>cmova</Word>\n\t\t\t<Word>cmovae</Word>\n\t\t\t<Word>cmovb</Word>\n\t\t\t<Word>cmovbe</Word>\n\t\t\t<Word>cmovc</Word>\n\t\t\t<Word>cmove</Word>\n\t\t\t<Word>cmovg</Word>\n\t\t\t<Word>cmovge</Word>\n\t\t\t<Word>cmovl</Word>\n\t\t\t<Word>cmovle</Word>\n\t\t\t<Word>cmovna</Word>\n\t\t\t<Word>cmovnae</Word>\n\t\t\t<Word>cmovnb</Word>\n\t\t\t<Word>cmovnbe</Word>\n\t\t\t<Word>cmovnc</Word>\n\t\t\t<Word>cmovne</Word>\n\t\t\t<Word>cmovng</Word>\n\t\t\t<Word>cmovnge</Word>\n\t\t\t<Word>cmovnl</Word>\n\t\t\t<Word>cmovnle</Word>\n\t\t\t<Word>cmovno</Word>\n\t\t\t<Word>cmovnp</Word>\n\t\t\t<Word>cmovns</Word>\n\t\t\t<Word>cmovnz</Word>\n\t\t\t<Word>cmovo</Word>\n\t\t\t<Word>cmovp</Word>\n\t\t\t<Word>cmovpe</Word>\n\t\t\t<Word>cmovpo</Word>\n\t\t\t<Word>cmovs</Word>\n\t\t\t<Word>cmovz</Word>\n\t\t\t<Word>cmp</Word>\n\t\t\t<Word>cmppd</Word>\n\t\t\t<Word>vcmppd</Word>\n\t\t\t<Word>cmpps</Word>\n\t\t\t<Word>vcmpps</Word>\n\t\t\t<Word>cmps</Word>\n\t\t\t<Word>cmpsb</Word>\n\t\t\t<Word>cmpsw</Word>\n\t\t\t<Word>cmpsd</Word>\n\t\t\t<Word>cmpsq</Word>\n\t\t\t<Word>cmpsd</Word>\n\t\t\t<Word>vcmpsd</Word>\n\t\t\t<Word>cmpss</Word>\n\t\t\t<Word>vcmpss</Word>\n\t\t\t<Word>cmpxchg</Word>\n\t\t\t<Word>cmpxchg8b</Word>\n\t\t\t<Word>cmpxchg16b</Word>\n\t\t\t<Word>comisd</Word>\n\t\t\t<Word>vcomisd</Word>\n\t\t\t<Word>comiss</Word>\n\t\t\t<Word>vcomiss</Word>\n\t\t\t<Word>cpuid</Word>\n\t\t\t<Word>crc32</Word>\n\t\t\t<Word>cvtdq2pd</Word>\n\t\t\t<Word>vcvtdq2pd</Word>\n\t\t\t<Word>cvtdq2ps</Word>\n\t\t\t<Word>vcvtdq2ps</Word>\n\t\t\t<Word>cvtpd2dq</Word>\n\t\t\t<Word>vcvtpd2dq</Word>\n\t\t\t<Word>cvtpd2pi</Word>\n\t\t\t<Word>cvtpd2ps</Word>\n\t\t\t<Word>vcvtpd2ps</Word>\n\t\t\t<Word>cvtpi2pd</Word>\n\t\t\t<Word>cvtpi2ps</Word>\n\t\t\t<Word>cvtps2dq</Word>\n\t\t\t<Word>vcvtps2dq</Word>\n\t\t\t<Word>cvtps2pd</Word>\n\t\t\t<Word>vcvtps2pd</Word>\n\t\t\t<Word>cvtps2pi</Word>\n\t\t\t<Word>cvtsd2si</Word>\n\t\t\t<Word>vcvtsd2si</Word>\n\t\t\t<Word>cvtsd2ss</Word>\n\t\t\t<Word>vcvtsd2ss</Word>\n\t\t\t<Word>cvtsi2sd</Word>\n\t\t\t<Word>vcvtsi2sd</Word>\n\t\t\t<Word>cvtsi2ss</Word>\n\t\t\t<Word>vcvtsi2ss</Word>\n\t\t\t<Word>cvtss2sd</Word>\n\t\t\t<Word>vcvtss2sd</Word>\n\t\t\t<Word>cvtss2si</Word>\n\t\t\t<Word>vcvtss2si</Word>\n\t\t\t<Word>cvttpd2dq</Word>\n\t\t\t<Word>vcvttpd2dq</Word>\n\t\t\t<Word>cvttpd2pi</Word>\n\t\t\t<Word>cvttps2dq</Word>\n\t\t\t<Word>vcvttps2dq</Word>\n\t\t\t<Word>cvttps2pi</Word>\n\t\t\t<Word>cvttsd2si</Word>\n\t\t\t<Word>vcvttsd2si</Word>\n\t\t\t<Word>cvttss2si</Word>\n\t\t\t<Word>vcvttss2si</Word>\n\t\t\t<Word>cwd</Word>\n\t\t\t<Word>cdq</Word>\n\t\t\t<Word>cqo</Word>\n\t\t\t<Word>daa</Word>\n\t\t\t<Word>das</Word>\n\t\t\t<Word>dec</Word>\n\t\t\t<Word>div</Word>\n\t\t\t<Word>divpd</Word>\n\t\t\t<Word>vdivpd</Word>\n\t\t\t<Word>divps</Word>\n\t\t\t<Word>vdivps</Word>\n\t\t\t<Word>divsd</Word>\n\t\t\t<Word>vdivsd</Word>\n\t\t\t<Word>divss</Word>\n\t\t\t<Word>vdivss</Word>\n\t\t\t<Word>dppd</Word>\n\t\t\t<Word>vdppd</Word>\n\t\t\t<Word>dpps</Word>\n\t\t\t<Word>vdpps</Word>\n\t\t\t<Word>eaccept</Word>\n\t\t\t<Word>eacceptcopy</Word>\n\t\t\t<Word>eadd</Word>\n\t\t\t<Word>eaug</Word>\n\t\t\t<Word>eblock</Word>\n\t\t\t<Word>ecreate</Word>\n\t\t\t<Word>edbgrd</Word>\n\t\t\t<Word>edbgwr</Word>\n\t\t\t<Word>edecvirtchild</Word>\n\t\t\t<Word>eenter</Word>\n\t\t\t<Word>eexit</Word>\n\t\t\t<Word>eextend</Word>\n\t\t\t<Word>egetkey</Word>\n\t\t\t<Word>eincvirtchild</Word>\n\t\t\t<Word>einit</Word>\n\t\t\t<Word>eldb</Word>\n\t\t\t<Word>eldu</Word>\n\t\t\t<Word>eldbc</Word>\n\t\t\t<Word>emms</Word>\n\t\t\t<Word>emodpe</Word>\n\t\t\t<Word>emodpr</Word>\n\t\t\t<Word>emodt</Word>\n\t\t\t<Word>encls</Word>\n\t\t\t<Word>enclu</Word>\n\t\t\t<Word>enclv</Word>\n\t\t\t<Word>enqcmd</Word>\n\t\t\t<Word>enqcmds</Word>\n\t\t\t<Word>enter</Word>\n\t\t\t<Word>epa</Word>\n\t\t\t<Word>erdinfo</Word>\n\t\t\t<Word>eremove</Word>\n\t\t\t<Word>ereport</Word>\n\t\t\t<Word>eresume</Word>\n\t\t\t<Word>esetcontext</Word>\n\t\t\t<Word>etrack</Word>\n\t\t\t<Word>etrackc</Word>\n\t\t\t<Word>ewb</Word>\n\t\t\t<Word>extractps</Word>\n\t\t\t<Word>vextractps</Word>\n\t\t\t<Word>f2xm1</Word>\n\t\t\t<Word>fabs</Word>\n\t\t\t<Word>fadd</Word>\n\t\t\t<Word>faddp</Word>\n\t\t\t<Word>fiadd</Word>\n\t\t\t<Word>fbld</Word>\n\t\t\t<Word>fbstp</Word>\n\t\t\t<Word>fchs</Word>\n\t\t\t<Word>fclex</Word>\n\t\t\t<Word>fnclex</Word>\n\t\t\t<Word>fcmovb</Word>\n\t\t\t<Word>fcmove</Word>\n\t\t\t<Word>fcmovbe</Word>\n\t\t\t<Word>fcmovu</Word>\n\t\t\t<Word>fcmovnb</Word>\n\t\t\t<Word>fcmovne</Word>\n\t\t\t<Word>fcmovnbe</Word>\n\t\t\t<Word>fcmovnu</Word>\n\t\t\t<Word>fcom</Word>\n\t\t\t<Word>fcomp</Word>\n\t\t\t<Word>fcompp</Word>\n\t\t\t<Word>fcomi</Word>\n\t\t\t<Word>fcomip</Word>\n\t\t\t<Word>fucomi</Word>\n\t\t\t<Word>fucomip</Word>\n\t\t\t<Word>fcos</Word>\n\t\t\t<Word>fdecstp</Word>\n\t\t\t<Word>fdiv</Word>\n\t\t\t<Word>fdivp</Word>\n\t\t\t<Word>fidiv</Word>\n\t\t\t<Word>fdivr</Word>\n\t\t\t<Word>fdivrp</Word>\n\t\t\t<Word>fidivr</Word>\n\t\t\t<Word>ffree</Word>\n\t\t\t<Word>ficom</Word>\n\t\t\t<Word>ficomp</Word>\n\t\t\t<Word>fild</Word>\n\t\t\t<Word>fincstp</Word>\n\t\t\t<Word>finit</Word>\n\t\t\t<Word>fninit</Word>\n\t\t\t<Word>fist</Word>\n\t\t\t<Word>fistp</Word>\n\t\t\t<Word>fisttp</Word>\n\t\t\t<Word>fld</Word>\n\t\t\t<Word>fld1</Word>\n\t\t\t<Word>fldl2t</Word>\n\t\t\t<Word>fldl2e</Word>\n\t\t\t<Word>fldpi</Word>\n\t\t\t<Word>fldlg2</Word>\n\t\t\t<Word>fldln2</Word>\n\t\t\t<Word>fldz</Word>\n\t\t\t<Word>fldcw</Word>\n\t\t\t<Word>fldenv</Word>\n\t\t\t<Word>fmul</Word>\n\t\t\t<Word>fmulp</Word>\n\t\t\t<Word>fimul</Word>\n\t\t\t<Word>fnop</Word>\n\t\t\t<Word>fpatan</Word>\n\t\t\t<Word>fprem</Word>\n\t\t\t<Word>fprem1</Word>\n\t\t\t<Word>fptan</Word>\n\t\t\t<Word>frndint</Word>\n\t\t\t<Word>frstor</Word>\n\t\t\t<Word>fsave</Word>\n\t\t\t<Word>fnsave</Word>\n\t\t\t<Word>fscale</Word>\n\t\t\t<Word>fsin</Word>\n\t\t\t<Word>fsincos</Word>\n\t\t\t<Word>fsqrt</Word>\n\t\t\t<Word>fst</Word>\n\t\t\t<Word>fstp</Word>\n\t\t\t<Word>fstcw</Word>\n\t\t\t<Word>fnstcw</Word>\n\t\t\t<Word>fstenv</Word>\n\t\t\t<Word>fnstenv</Word>\n\t\t\t<Word>fstsw</Word>\n\t\t\t<Word>fnstsw</Word>\n\t\t\t<Word>fsub</Word>\n\t\t\t<Word>fsubp</Word>\n\t\t\t<Word>fisub</Word>\n\t\t\t<Word>fsubr</Word>\n\t\t\t<Word>fsubrp</Word>\n\t\t\t<Word>fisubr</Word>\n\t\t\t<Word>ftst</Word>\n\t\t\t<Word>fucom</Word>\n\t\t\t<Word>fucomp</Word>\n\t\t\t<Word>fucompp</Word>\n\t\t\t<Word>fxam</Word>\n\t\t\t<Word>fxch</Word>\n\t\t\t<Word>fxrstor</Word>\n\t\t\t<Word>fxrstor64</Word>\n\t\t\t<Word>fxsave</Word>\n\t\t\t<Word>fxsave64</Word>\n\t\t\t<Word>fxtract</Word>\n\t\t\t<Word>fyl2x</Word>\n\t\t\t<Word>fyl2xp1</Word>\n\t\t\t<Word>exitac</Word>\n\t\t\t<Word>parameters</Word>\n\t\t\t<Word>senter</Word>\n\t\t\t<Word>sexit</Word>\n\t\t\t<Word>smctrl</Word>\n\t\t\t<Word>wakeup</Word>\n\t\t\t<Word>gf2p8affineinvqb</Word>\n\t\t\t<Word>vgf2p8affineinvqb</Word>\n\t\t\t<Word>gf2p8affineqb</Word>\n\t\t\t<Word>vgf2p8affineqb</Word>\n\t\t\t<Word>gf2p8mulb</Word>\n\t\t\t<Word>vgf2p8mulb</Word>\n\t\t\t<Word>haddpd</Word>\n\t\t\t<Word>vhaddpd</Word>\n\t\t\t<Word>haddps</Word>\n\t\t\t<Word>vhaddps</Word>\n\t\t\t<Word>hlt</Word>\n\t\t\t<Word>hsubpd</Word>\n\t\t\t<Word>vhsubpd</Word>\n\t\t\t<Word>hsubps</Word>\n\t\t\t<Word>vhsubps</Word>\n\t\t\t<Word>idiv</Word>\n\t\t\t<Word>imul</Word>\n\t\t\t<Word>in</Word>\n\t\t\t<Word>inc</Word>\n\t\t\t<Word>ins</Word>\n\t\t\t<Word>insb</Word>\n\t\t\t<Word>insw</Word>\n\t\t\t<Word>insd</Word>\n\t\t\t<Word>insertps</Word>\n\t\t\t<Word>vinsertps</Word>\n\t\t\t<Word>int3</Word>\n\t\t\t<Word>int</Word>\n\t\t\t<Word>into</Word>\n\t\t\t<Word>int1</Word>\n\t\t\t<Word>invd</Word>\n\t\t\t<Word>invlpg</Word>\n\t\t\t<Word>invpcid</Word>\n\t\t\t<Word>iret</Word>\n\t\t\t<Word>iretd</Word>\n\t\t\t<Word>iretq</Word>\n\t\t\t<Word>ja</Word>\n\t\t\t<Word>jae</Word>\n\t\t\t<Word>jb</Word>\n\t\t\t<Word>jbe</Word>\n\t\t\t<Word>jc</Word>\n\t\t\t<Word>jcxz</Word>\n\t\t\t<Word>jecxz</Word>\n\t\t\t<Word>jrcxz</Word>\n\t\t\t<Word>je</Word>\n\t\t\t<Word>jg</Word>\n\t\t\t<Word>jge</Word>\n\t\t\t<Word>jl</Word>\n\t\t\t<Word>jle</Word>\n\t\t\t<Word>jna</Word>\n\t\t\t<Word>jnae</Word>\n\t\t\t<Word>jnb</Word>\n\t\t\t<Word>jnbe</Word>\n\t\t\t<Word>jnc</Word>\n\t\t\t<Word>jne</Word>\n\t\t\t<Word>jng</Word>\n\t\t\t<Word>jnge</Word>\n\t\t\t<Word>jnl</Word>\n\t\t\t<Word>jnle</Word>\n\t\t\t<Word>jno</Word>\n\t\t\t<Word>jnp</Word>\n\t\t\t<Word>jns</Word>\n\t\t\t<Word>jnz</Word>\n\t\t\t<Word>jo</Word>\n\t\t\t<Word>jp</Word>\n\t\t\t<Word>jpe</Word>\n\t\t\t<Word>jpo</Word>\n\t\t\t<Word>js</Word>\n\t\t\t<Word>jz</Word>\n\t\t\t<Word>jmp</Word>\n\t\t\t<Word>kaddw</Word>\n\t\t\t<Word>kaddb</Word>\n\t\t\t<Word>kaddq</Word>\n\t\t\t<Word>kaddd</Word>\n\t\t\t<Word>kandnw</Word>\n\t\t\t<Word>kandnb</Word>\n\t\t\t<Word>kandnq</Word>\n\t\t\t<Word>kandnd</Word>\n\t\t\t<Word>kandw</Word>\n\t\t\t<Word>kandb</Word>\n\t\t\t<Word>kandq</Word>\n\t\t\t<Word>kandd</Word>\n\t\t\t<Word>kmovw</Word>\n\t\t\t<Word>kmovb</Word>\n\t\t\t<Word>kmovq</Word>\n\t\t\t<Word>kmovd</Word>\n\t\t\t<Word>knotw</Word>\n\t\t\t<Word>knotb</Word>\n\t\t\t<Word>knotq</Word>\n\t\t\t<Word>knotd</Word>\n\t\t\t<Word>kortestw</Word>\n\t\t\t<Word>kortestb</Word>\n\t\t\t<Word>kortestq</Word>\n\t\t\t<Word>kortestd</Word>\n\t\t\t<Word>korw</Word>\n\t\t\t<Word>korb</Word>\n\t\t\t<Word>korq</Word>\n\t\t\t<Word>kord</Word>\n\t\t\t<Word>kshiftlw</Word>\n\t\t\t<Word>kshiftlb</Word>\n\t\t\t<Word>kshiftlq</Word>\n\t\t\t<Word>kshiftld</Word>\n\t\t\t<Word>kshiftrw</Word>\n\t\t\t<Word>kshiftrb</Word>\n\t\t\t<Word>kshiftrq</Word>\n\t\t\t<Word>kshiftrd</Word>\n\t\t\t<Word>ktestw</Word>\n\t\t\t<Word>ktestb</Word>\n\t\t\t<Word>ktestq</Word>\n\t\t\t<Word>ktestd</Word>\n\t\t\t<Word>kunpckbw</Word>\n\t\t\t<Word>kunpckwd</Word>\n\t\t\t<Word>kunpckdq</Word>\n\t\t\t<Word>kxnorw</Word>\n\t\t\t<Word>kxnorb</Word>\n\t\t\t<Word>kxnorq</Word>\n\t\t\t<Word>kxnord</Word>\n\t\t\t<Word>kxorw</Word>\n\t\t\t<Word>kxorb</Word>\n\t\t\t<Word>kxorq</Word>\n\t\t\t<Word>kxord</Word>\n\t\t\t<Word>lahf</Word>\n\t\t\t<Word>lar</Word>\n\t\t\t<Word>lddqu</Word>\n\t\t\t<Word>vlddqu</Word>\n\t\t\t<Word>ldmxcsr</Word>\n\t\t\t<Word>vldmxcsr</Word>\n\t\t\t<Word>lds</Word>\n\t\t\t<Word>lss</Word>\n\t\t\t<Word>les</Word>\n\t\t\t<Word>lfs</Word>\n\t\t\t<Word>lgs</Word>\n\t\t\t<Word>lea</Word>\n\t\t\t<Word>leave</Word>\n\t\t\t<Word>lfence</Word>\n\t\t\t<Word>lgdt</Word>\n\t\t\t<Word>lidt</Word>\n\t\t\t<Word>lldt</Word>\n\t\t\t<Word>lmsw</Word>\n\t\t\t<Word>lock</Word>\n\t\t\t<Word>lods</Word>\n\t\t\t<Word>lodsb</Word>\n\t\t\t<Word>lodsw</Word>\n\t\t\t<Word>lodsd</Word>\n\t\t\t<Word>lodsq</Word>\n\t\t\t<Word>loop</Word>\n\t\t\t<Word>loope</Word>\n\t\t\t<Word>loopne</Word>\n\t\t\t<Word>lsl</Word>\n\t\t\t<Word>ltr</Word>\n\t\t\t<Word>lzcnt</Word>\n\t\t\t<Word>maskmovdqu</Word>\n\t\t\t<Word>vmaskmovdqu</Word>\n\t\t\t<Word>maskmovq</Word>\n\t\t\t<Word>maxpd</Word>\n\t\t\t<Word>vmaxpd</Word>\n\t\t\t<Word>maxps</Word>\n\t\t\t<Word>vmaxps</Word>\n\t\t\t<Word>maxsd</Word>\n\t\t\t<Word>vmaxsd</Word>\n\t\t\t<Word>maxss</Word>\n\t\t\t<Word>vmaxss</Word>\n\t\t\t<Word>mfence</Word>\n\t\t\t<Word>minpd</Word>\n\t\t\t<Word>vminpd</Word>\n\t\t\t<Word>minps</Word>\n\t\t\t<Word>vminps</Word>\n\t\t\t<Word>minsd</Word>\n\t\t\t<Word>vminsd</Word>\n\t\t\t<Word>minss</Word>\n\t\t\t<Word>vminss</Word>\n\t\t\t<Word>monitor</Word>\n\t\t\t<Word>mov</Word>\n\t\t\t<Word>movapd</Word>\n\t\t\t<Word>vmovapd</Word>\n\t\t\t<Word>movaps</Word>\n\t\t\t<Word>vmovaps</Word>\n\t\t\t<Word>movbe</Word>\n\t\t\t<Word>movd</Word>\n\t\t\t<Word>movq</Word>\n\t\t\t<Word>vmovd</Word>\n\t\t\t<Word>vmovq</Word>\n\t\t\t<Word>movddup</Word>\n\t\t\t<Word>vmovddup</Word>\n\t\t\t<Word>movdir64b</Word>\n\t\t\t<Word>movdiri</Word>\n\t\t\t<Word>movdq2q</Word>\n\t\t\t<Word>movdqa</Word>\n\t\t\t<Word>vmovdqa</Word>\n\t\t\t<Word>vmovdqa32</Word>\n\t\t\t<Word>vmovdqa64</Word>\n\t\t\t<Word>movdqu</Word>\n\t\t\t<Word>vmovdqu</Word>\n\t\t\t<Word>vmovdqu8</Word>\n\t\t\t<Word>vmovdqu16</Word>\n\t\t\t<Word>vmovdqu32</Word>\n\t\t\t<Word>vmovdqu64</Word>\n\t\t\t<Word>movhlps</Word>\n\t\t\t<Word>vmovhlps</Word>\n\t\t\t<Word>movhpd</Word>\n\t\t\t<Word>vmovhpd</Word>\n\t\t\t<Word>movhps</Word>\n\t\t\t<Word>vmovhps</Word>\n\t\t\t<Word>movlhps</Word>\n\t\t\t<Word>vmovlhps</Word>\n\t\t\t<Word>movlpd</Word>\n\t\t\t<Word>vmovlpd</Word>\n\t\t\t<Word>movlps</Word>\n\t\t\t<Word>vmovlps</Word>\n\t\t\t<Word>movmskpd</Word>\n\t\t\t<Word>vmovmskpd</Word>\n\t\t\t<Word>movmskps</Word>\n\t\t\t<Word>vmovmskps</Word>\n\t\t\t<Word>movntdq</Word>\n\t\t\t<Word>vmovntdq</Word>\n\t\t\t<Word>movntdqa</Word>\n\t\t\t<Word>vmovntdqa</Word>\n\t\t\t<Word>movnti</Word>\n\t\t\t<Word>movntpd</Word>\n\t\t\t<Word>vmovntpd</Word>\n\t\t\t<Word>movntps</Word>\n\t\t\t<Word>vmovntps</Word>\n\t\t\t<Word>movntq</Word>\n\t\t\t<Word>movq</Word>\n\t\t\t<Word>vmovq</Word>\n\t\t\t<Word>movq2dq</Word>\n\t\t\t<Word>movs</Word>\n\t\t\t<Word>movsb</Word>\n\t\t\t<Word>movsw</Word>\n\t\t\t<Word>movsd</Word>\n\t\t\t<Word>movsq</Word>\n\t\t\t<Word>movsd</Word>\n\t\t\t<Word>vmovsd</Word>\n\t\t\t<Word>movshdup</Word>\n\t\t\t<Word>vmovshdup</Word>\n\t\t\t<Word>movsldup</Word>\n\t\t\t<Word>vmovsldup</Word>\n\t\t\t<Word>movss</Word>\n\t\t\t<Word>vmovss</Word>\n\t\t\t<Word>movsx</Word>\n\t\t\t<Word>movsxd</Word>\n\t\t\t<Word>movupd</Word>\n\t\t\t<Word>vmovupd</Word>\n\t\t\t<Word>movups</Word>\n\t\t\t<Word>vmovups</Word>\n\t\t\t<Word>movzx</Word>\n\t\t\t<Word>mpsadbw</Word>\n\t\t\t<Word>vmpsadbw</Word>\n\t\t\t<Word>mul</Word>\n\t\t\t<Word>mulpd</Word>\n\t\t\t<Word>vmulpd</Word>\n\t\t\t<Word>mulps</Word>\n\t\t\t<Word>vmulps</Word>\n\t\t\t<Word>mulsd</Word>\n\t\t\t<Word>vmulsd</Word>\n\t\t\t<Word>mulss</Word>\n\t\t\t<Word>vmulss</Word>\n\t\t\t<Word>mulx</Word>\n\t\t\t<Word>mwait</Word>\n\t\t\t<Word>neg</Word>\n\t\t\t<Word>nop</Word>\n\t\t\t<Word>not</Word>\n\t\t\t<Word>or</Word>\n\t\t\t<Word>orpd</Word>\n\t\t\t<Word>vorpd</Word>\n\t\t\t<Word>orps</Word>\n\t\t\t<Word>vorps</Word>\n\t\t\t<Word>out</Word>\n\t\t\t<Word>outs</Word>\n\t\t\t<Word>outsb</Word>\n\t\t\t<Word>outsw</Word>\n\t\t\t<Word>outsd</Word>\n\t\t\t<Word>pabsb</Word>\n\t\t\t<Word>pabsw</Word>\n\t\t\t<Word>pabsd</Word>\n\t\t\t<Word>vpabsb</Word>\n\t\t\t<Word>vpabsw</Word>\n\t\t\t<Word>vpabsd</Word>\n\t\t\t<Word>vpabsq</Word>\n\t\t\t<Word>packsswb</Word>\n\t\t\t<Word>packssdw</Word>\n\t\t\t<Word>vpacksswb</Word>\n\t\t\t<Word>vpackssdw</Word>\n\t\t\t<Word>packusdw</Word>\n\t\t\t<Word>vpackusdw</Word>\n\t\t\t<Word>packuswb</Word>\n\t\t\t<Word>vpackuswb</Word>\n\t\t\t<Word>paddb</Word>\n\t\t\t<Word>paddw</Word>\n\t\t\t<Word>paddd</Word>\n\t\t\t<Word>paddq</Word>\n\t\t\t<Word>vpaddb</Word>\n\t\t\t<Word>vpaddw</Word>\n\t\t\t<Word>vpaddd</Word>\n\t\t\t<Word>vpaddq</Word>\n\t\t\t<Word>paddsb</Word>\n\t\t\t<Word>paddsw</Word>\n\t\t\t<Word>vpaddsb</Word>\n\t\t\t<Word>vpaddsw</Word>\n\t\t\t<Word>paddusb</Word>\n\t\t\t<Word>paddusw</Word>\n\t\t\t<Word>vpaddusb</Word>\n\t\t\t<Word>vpaddusw</Word>\n\t\t\t<Word>palignr</Word>\n\t\t\t<Word>vpalignr</Word>\n\t\t\t<Word>pand</Word>\n\t\t\t<Word>vpand</Word>\n\t\t\t<Word>vpandd</Word>\n\t\t\t<Word>vpandq</Word>\n\t\t\t<Word>pandn</Word>\n\t\t\t<Word>vpandn</Word>\n\t\t\t<Word>vpandnd</Word>\n\t\t\t<Word>vpandnq</Word>\n\t\t\t<Word>pause</Word>\n\t\t\t<Word>pavgb</Word>\n\t\t\t<Word>pavgw</Word>\n\t\t\t<Word>vpavgb</Word>\n\t\t\t<Word>vpavgw</Word>\n\t\t\t<Word>pblendvb</Word>\n\t\t\t<Word>vpblendvb</Word>\n\t\t\t<Word>pblendw</Word>\n\t\t\t<Word>vpblendw</Word>\n\t\t\t<Word>pclmulqdq</Word>\n\t\t\t<Word>vpclmulqdq</Word>\n\t\t\t<Word>pcmpeqb</Word>\n\t\t\t<Word>pcmpeqw</Word>\n\t\t\t<Word>pcmpeqd</Word>\n\t\t\t<Word>vpcmpeqb</Word>\n\t\t\t<Word>vpcmpeqw</Word>\n\t\t\t<Word>vpcmpeqd</Word>\n\t\t\t<Word>pcmpeqq</Word>\n\t\t\t<Word>vpcmpeqq</Word>\n\t\t\t<Word>pcmpestri</Word>\n\t\t\t<Word>vpcmpestri</Word>\n\t\t\t<Word>pcmpestrm</Word>\n\t\t\t<Word>vpcmpestrm</Word>\n\t\t\t<Word>pcmpgtb</Word>\n\t\t\t<Word>pcmpgtw</Word>\n\t\t\t<Word>pcmpgtd</Word>\n\t\t\t<Word>vpcmpgtb</Word>\n\t\t\t<Word>vpcmpgtw</Word>\n\t\t\t<Word>vpcmpgtd</Word>\n\t\t\t<Word>pcmpgtq</Word>\n\t\t\t<Word>vpcmpgtq</Word>\n\t\t\t<Word>pcmpistri</Word>\n\t\t\t<Word>vpcmpistri</Word>\n\t\t\t<Word>pcmpistrm</Word>\n\t\t\t<Word>vpcmpistrm</Word>\n\t\t\t<Word>pconfig</Word>\n\t\t\t<Word>pdep</Word>\n\t\t\t<Word>pext</Word>\n\t\t\t<Word>pextrb</Word>\n\t\t\t<Word>pextrd</Word>\n\t\t\t<Word>pextrq</Word>\n\t\t\t<Word>vpextrb</Word>\n\t\t\t<Word>vpextrd</Word>\n\t\t\t<Word>vpextrq</Word>\n\t\t\t<Word>pextrw</Word>\n\t\t\t<Word>vpextrw</Word>\n\t\t\t<Word>phaddsw</Word>\n\t\t\t<Word>vphaddsw</Word>\n\t\t\t<Word>phaddw</Word>\n\t\t\t<Word>phaddd</Word>\n\t\t\t<Word>vphaddw</Word>\n\t\t\t<Word>vphaddd</Word>\n\t\t\t<Word>phminposuw</Word>\n\t\t\t<Word>vphminposuw</Word>\n\t\t\t<Word>phsubsw</Word>\n\t\t\t<Word>vphsubsw</Word>\n\t\t\t<Word>phsubw</Word>\n\t\t\t<Word>phsubd</Word>\n\t\t\t<Word>vphsubw</Word>\n\t\t\t<Word>vphsubd</Word>\n\t\t\t<Word>pinsrb</Word>\n\t\t\t<Word>pinsrd</Word>\n\t\t\t<Word>pinsrq</Word>\n\t\t\t<Word>vpinsrb</Word>\n\t\t\t<Word>vpinsrd</Word>\n\t\t\t<Word>vpinsrq</Word>\n\t\t\t<Word>pinsrw</Word>\n\t\t\t<Word>vpinsrw</Word>\n\t\t\t<Word>pmaddubsw</Word>\n\t\t\t<Word>vpmaddubsw</Word>\n\t\t\t<Word>pmaddwd</Word>\n\t\t\t<Word>vpmaddwd</Word>\n\t\t\t<Word>pmaxsw</Word>\n\t\t\t<Word>pmaxsb</Word>\n\t\t\t<Word>pmaxsd</Word>\n\t\t\t<Word>vpmaxsb</Word>\n\t\t\t<Word>vpmaxsw</Word>\n\t\t\t<Word>vpmaxsd</Word>\n\t\t\t<Word>vpmaxsq</Word>\n\t\t\t<Word>pmaxub</Word>\n\t\t\t<Word>pmaxuw</Word>\n\t\t\t<Word>vpmaxub</Word>\n\t\t\t<Word>vpmaxuw</Word>\n\t\t\t<Word>pmaxud</Word>\n\t\t\t<Word>vpmaxud</Word>\n\t\t\t<Word>vpmaxuq</Word>\n\t\t\t<Word>pminsw</Word>\n\t\t\t<Word>pminsb</Word>\n\t\t\t<Word>vpminsb</Word>\n\t\t\t<Word>vpminsw</Word>\n\t\t\t<Word>pminsd</Word>\n\t\t\t<Word>vpminsd</Word>\n\t\t\t<Word>vpminsq</Word>\n\t\t\t<Word>pminub</Word>\n\t\t\t<Word>pminuw</Word>\n\t\t\t<Word>vpminub</Word>\n\t\t\t<Word>vpminuw</Word>\n\t\t\t<Word>pminud</Word>\n\t\t\t<Word>vpminud</Word>\n\t\t\t<Word>vpminuq</Word>\n\t\t\t<Word>pmovmskb</Word>\n\t\t\t<Word>vpmovmskb</Word>\n\t\t\t<Word>pmovsxbw</Word>\n\t\t\t<Word>pmovsxbd</Word>\n\t\t\t<Word>pmovsxbq</Word>\n\t\t\t<Word>pmovsxwd</Word>\n\t\t\t<Word>pmovsxwq</Word>\n\t\t\t<Word>pmovsxdq</Word>\n\t\t\t<Word>vpmovsxbw</Word>\n\t\t\t<Word>vpmovsxbd</Word>\n\t\t\t<Word>vpmovsxbq</Word>\n\t\t\t<Word>vpmovsxwd</Word>\n\t\t\t<Word>vpmovsxwq</Word>\n\t\t\t<Word>vpmovsxdq</Word>\n\t\t\t<Word>pmovzxbw</Word>\n\t\t\t<Word>pmovzxbd</Word>\n\t\t\t<Word>pmovzxbq</Word>\n\t\t\t<Word>pmovzxwd</Word>\n\t\t\t<Word>pmovzxwq</Word>\n\t\t\t<Word>pmovzxdq</Word>\n\t\t\t<Word>vpmovzxbw</Word>\n\t\t\t<Word>vpmovzxbd</Word>\n\t\t\t<Word>vpmovzxbq</Word>\n\t\t\t<Word>vpmovzxwd</Word>\n\t\t\t<Word>vpmovzxwq</Word>\n\t\t\t<Word>vpmovzxdq</Word>\n\t\t\t<Word>pmuldq</Word>\n\t\t\t<Word>vpmuldq</Word>\n\t\t\t<Word>pmulhrsw</Word>\n\t\t\t<Word>vpmulhrsw</Word>\n\t\t\t<Word>pmulhuw</Word>\n\t\t\t<Word>vpmulhuw</Word>\n\t\t\t<Word>pmulhw</Word>\n\t\t\t<Word>vpmulhw</Word>\n\t\t\t<Word>pmulld</Word>\n\t\t\t<Word>vpmulld</Word>\n\t\t\t<Word>vpmullq</Word>\n\t\t\t<Word>pmullw</Word>\n\t\t\t<Word>vpmullw</Word>\n\t\t\t<Word>pmuludq</Word>\n\t\t\t<Word>vpmuludq</Word>\n\t\t\t<Word>pop</Word>\n\t\t\t<Word>popa</Word>\n\t\t\t<Word>popad</Word>\n\t\t\t<Word>popcnt</Word>\n\t\t\t<Word>popf</Word>\n\t\t\t<Word>popfd</Word>\n\t\t\t<Word>popfq</Word>\n\t\t\t<Word>por</Word>\n\t\t\t<Word>vpor</Word>\n\t\t\t<Word>vpord</Word>\n\t\t\t<Word>vporq</Word>\n\t\t\t<Word>prefetcht0</Word>\n\t\t\t<Word>prefetcht1</Word>\n\t\t\t<Word>prefetcht2</Word>\n\t\t\t<Word>prefetchnta</Word>\n\t\t\t<Word>prefetchw</Word>\n\t\t\t<Word>prefetchwt1</Word>\n\t\t\t<Word>psadbw</Word>\n\t\t\t<Word>vpsadbw</Word>\n\t\t\t<Word>pshufb</Word>\n\t\t\t<Word>vpshufb</Word>\n\t\t\t<Word>pshufd</Word>\n\t\t\t<Word>vpshufd</Word>\n\t\t\t<Word>pshufhw</Word>\n\t\t\t<Word>vpshufhw</Word>\n\t\t\t<Word>pshuflw</Word>\n\t\t\t<Word>vpshuflw</Word>\n\t\t\t<Word>pshufw</Word>\n\t\t\t<Word>psignb</Word>\n\t\t\t<Word>psignw</Word>\n\t\t\t<Word>psignd</Word>\n\t\t\t<Word>vpsignb</Word>\n\t\t\t<Word>vpsignw</Word>\n\t\t\t<Word>vpsignd</Word>\n\t\t\t<Word>pslldq</Word>\n\t\t\t<Word>vpslldq</Word>\n\t\t\t<Word>psllw</Word>\n\t\t\t<Word>pslld</Word>\n\t\t\t<Word>psllq</Word>\n\t\t\t<Word>vpsllw</Word>\n\t\t\t<Word>vpslld</Word>\n\t\t\t<Word>vpsllq</Word>\n\t\t\t<Word>psraw</Word>\n\t\t\t<Word>psrad</Word>\n\t\t\t<Word>vpsraw</Word>\n\t\t\t<Word>vpsrad</Word>\n\t\t\t<Word>vpsraq</Word>\n\t\t\t<Word>psrldq</Word>\n\t\t\t<Word>vpsrldq</Word>\n\t\t\t<Word>psrlw</Word>\n\t\t\t<Word>psrld</Word>\n\t\t\t<Word>psrlq</Word>\n\t\t\t<Word>vpsrlw</Word>\n\t\t\t<Word>vpsrld</Word>\n\t\t\t<Word>vpsrlq</Word>\n\t\t\t<Word>psubb</Word>\n\t\t\t<Word>psubw</Word>\n\t\t\t<Word>psubd</Word>\n\t\t\t<Word>vpsubb</Word>\n\t\t\t<Word>vpsubw</Word>\n\t\t\t<Word>vpsubd</Word>\n\t\t\t<Word>psubq</Word>\n\t\t\t<Word>vpsubq</Word>\n\t\t\t<Word>psubsb</Word>\n\t\t\t<Word>psubsw</Word>\n\t\t\t<Word>vpsubsb</Word>\n\t\t\t<Word>vpsubsw</Word>\n\t\t\t<Word>psubusb</Word>\n\t\t\t<Word>psubusw</Word>\n\t\t\t<Word>vpsubusb</Word>\n\t\t\t<Word>vpsubusw</Word>\n\t\t\t<Word>punpckhbw</Word>\n\t\t\t<Word>punpckhwd</Word>\n\t\t\t<Word>punpckhdq</Word>\n\t\t\t<Word>punpckhqdq</Word>\n\t\t\t<Word>vpunpckhbw</Word>\n\t\t\t<Word>vpunpckhwd</Word>\n\t\t\t<Word>vpunpckhdq</Word>\n\t\t\t<Word>vpunpckhqdq</Word>\n\t\t\t<Word>punpcklbw</Word>\n\t\t\t<Word>punpcklwd</Word>\n\t\t\t<Word>punpckldq</Word>\n\t\t\t<Word>punpcklqdq</Word>\n\t\t\t<Word>vpunpcklbw</Word>\n\t\t\t<Word>vpunpcklwd</Word>\n\t\t\t<Word>vpunpckldq</Word>\n\t\t\t<Word>vpunpcklqdq</Word>\n\t\t\t<Word>push</Word>\n\t\t\t<Word>pusha</Word>\n\t\t\t<Word>pushad</Word>\n\t\t\t<Word>pushf</Word>\n\t\t\t<Word>pushfd</Word>\n\t\t\t<Word>pushfq</Word>\n\t\t\t<Word>pxor</Word>\n\t\t\t<Word>vpxor</Word>\n\t\t\t<Word>vpxord</Word>\n\t\t\t<Word>vpxorq</Word>\n\t\t\t<Word>rcl</Word>\n\t\t\t<Word>rcr</Word>\n\t\t\t<Word>rol</Word>\n\t\t\t<Word>ror</Word>\n\t\t\t<Word>rcpps</Word>\n\t\t\t<Word>vrcpps</Word>\n\t\t\t<Word>rcpss</Word>\n\t\t\t<Word>vrcpss</Word>\n\t\t\t<Word>rdfsbase</Word>\n\t\t\t<Word>rdgsbase</Word>\n\t\t\t<Word>rdmsr</Word>\n\t\t\t<Word>rdpid</Word>\n\t\t\t<Word>rdpkru</Word>\n\t\t\t<Word>rdpmc</Word>\n\t\t\t<Word>rdrand</Word>\n\t\t\t<Word>rdseed</Word>\n\t\t\t<Word>rdtsc</Word>\n\t\t\t<Word>rdtscp</Word>\n\t\t\t<Word>rep_ins</Word>\n\t\t\t<Word>rep_movs</Word>\n\t\t\t<Word>rep_outs</Word>\n\t\t\t<Word>rep_lods</Word>\n\t\t\t<Word>rep_stos</Word>\n\t\t\t<Word>repe_cmps</Word>\n\t\t\t<Word>repe_scas</Word>\n\t\t\t<Word>repne_cmps</Word>\n\t\t\t<Word>repne_scas</Word>\n\t\t\t<Word>ret</Word>\n\t\t\t<Word>rorx</Word>\n\t\t\t<Word>roundpd</Word>\n\t\t\t<Word>vroundpd</Word>\n\t\t\t<Word>roundps</Word>\n\t\t\t<Word>vroundps</Word>\n\t\t\t<Word>roundsd</Word>\n\t\t\t<Word>vroundsd</Word>\n\t\t\t<Word>roundss</Word>\n\t\t\t<Word>vroundss</Word>\n\t\t\t<Word>rsm</Word>\n\t\t\t<Word>rsqrtps</Word>\n\t\t\t<Word>vrsqrtps</Word>\n\t\t\t<Word>rsqrtss</Word>\n\t\t\t<Word>vrsqrtss</Word>\n\t\t\t<Word>sahf</Word>\n\t\t\t<Word>sal</Word>\n\t\t\t<Word>sar</Word>\n\t\t\t<Word>shl</Word>\n\t\t\t<Word>shr</Word>\n\t\t\t<Word>sarx</Word>\n\t\t\t<Word>shlx</Word>\n\t\t\t<Word>shrx</Word>\n\t\t\t<Word>sbb</Word>\n\t\t\t<Word>scas</Word>\n\t\t\t<Word>scasb</Word>\n\t\t\t<Word>scasw</Word>\n\t\t\t<Word>scasd</Word>\n\t\t\t<Word>scasq</Word>\n\t\t\t<Word>seta</Word>\n\t\t\t<Word>setae</Word>\n\t\t\t<Word>setb</Word>\n\t\t\t<Word>setbe</Word>\n\t\t\t<Word>setc</Word>\n\t\t\t<Word>sete</Word>\n\t\t\t<Word>setg</Word>\n\t\t\t<Word>setge</Word>\n\t\t\t<Word>setl</Word>\n\t\t\t<Word>setle</Word>\n\t\t\t<Word>setna</Word>\n\t\t\t<Word>setnae</Word>\n\t\t\t<Word>setnb</Word>\n\t\t\t<Word>setnbe</Word>\n\t\t\t<Word>setnc</Word>\n\t\t\t<Word>setne</Word>\n\t\t\t<Word>setng</Word>\n\t\t\t<Word>setnge</Word>\n\t\t\t<Word>setnl</Word>\n\t\t\t<Word>setnle</Word>\n\t\t\t<Word>setno</Word>\n\t\t\t<Word>setnp</Word>\n\t\t\t<Word>setns</Word>\n\t\t\t<Word>setnz</Word>\n\t\t\t<Word>seto</Word>\n\t\t\t<Word>setp</Word>\n\t\t\t<Word>setpe</Word>\n\t\t\t<Word>setpo</Word>\n\t\t\t<Word>sets</Word>\n\t\t\t<Word>setz</Word>\n\t\t\t<Word>sfence</Word>\n\t\t\t<Word>sgdt</Word>\n\t\t\t<Word>sha1msg1</Word>\n\t\t\t<Word>sha1msg2</Word>\n\t\t\t<Word>sha1nexte</Word>\n\t\t\t<Word>sha1rnds4</Word>\n\t\t\t<Word>sha256msg1</Word>\n\t\t\t<Word>sha256msg2</Word>\n\t\t\t<Word>sha256rnds2</Word>\n\t\t\t<Word>shld</Word>\n\t\t\t<Word>shrd</Word>\n\t\t\t<Word>shufpd</Word>\n\t\t\t<Word>vshufpd</Word>\n\t\t\t<Word>shufps</Word>\n\t\t\t<Word>vshufps</Word>\n\t\t\t<Word>sidt</Word>\n\t\t\t<Word>sldt</Word>\n\t\t\t<Word>smsw</Word>\n\t\t\t<Word>sqrtpd</Word>\n\t\t\t<Word>vsqrtpd</Word>\n\t\t\t<Word>sqrtps</Word>\n\t\t\t<Word>vsqrtps</Word>\n\t\t\t<Word>sqrtsd</Word>\n\t\t\t<Word>vsqrtsd</Word>\n\t\t\t<Word>sqrtss</Word>\n\t\t\t<Word>vsqrtss</Word>\n\t\t\t<Word>stac</Word>\n\t\t\t<Word>stc</Word>\n\t\t\t<Word>std</Word>\n\t\t\t<Word>sti</Word>\n\t\t\t<Word>stmxcsr</Word>\n\t\t\t<Word>vstmxcsr</Word>\n\t\t\t<Word>stos</Word>\n\t\t\t<Word>stosb</Word>\n\t\t\t<Word>stosw</Word>\n\t\t\t<Word>stosd</Word>\n\t\t\t<Word>stosq</Word>\n\t\t\t<Word>str</Word>\n\t\t\t<Word>sub</Word>\n\t\t\t<Word>subpd</Word>\n\t\t\t<Word>vsubpd</Word>\n\t\t\t<Word>subps</Word>\n\t\t\t<Word>vsubps</Word>\n\t\t\t<Word>subsd</Word>\n\t\t\t<Word>vsubsd</Word>\n\t\t\t<Word>subss</Word>\n\t\t\t<Word>vsubss</Word>\n\t\t\t<Word>swapgs</Word>\n\t\t\t<Word>syscall</Word>\n\t\t\t<Word>sysenter</Word>\n\t\t\t<Word>sysexit</Word>\n\t\t\t<Word>sysret</Word>\n\t\t\t<Word>test</Word>\n\t\t\t<Word>tpause</Word>\n\t\t\t<Word>tzcnt</Word>\n\t\t\t<Word>ucomisd</Word>\n\t\t\t<Word>vucomisd</Word>\n\t\t\t<Word>ucomiss</Word>\n\t\t\t<Word>vucomiss</Word>\n\t\t\t<Word>ud01</Word>\n\t\t\t<Word>ud1</Word>\n\t\t\t<Word>ud2</Word>\n\t\t\t<Word>umonitor</Word>\n\t\t\t<Word>umwait</Word>\n\t\t\t<Word>unpckhpd</Word>\n\t\t\t<Word>vunpckhpd</Word>\n\t\t\t<Word>unpckhps</Word>\n\t\t\t<Word>vunpckhps</Word>\n\t\t\t<Word>unpcklpd</Word>\n\t\t\t<Word>vunpcklpd</Word>\n\t\t\t<Word>unpcklps</Word>\n\t\t\t<Word>vunpcklps</Word>\n\t\t\t<Word>v4fmaddps</Word>\n\t\t\t<Word>v4fnmaddps</Word>\n\t\t\t<Word>v4fmaddss</Word>\n\t\t\t<Word>v4fnmaddss</Word>\n\t\t\t<Word>vaesdec</Word>\n\t\t\t<Word>vaesdeclast</Word>\n\t\t\t<Word>vaesenc</Word>\n\t\t\t<Word>vaesenclast</Word>\n\t\t\t<Word>valignd</Word>\n\t\t\t<Word>valignq</Word>\n\t\t\t<Word>vblendmpd</Word>\n\t\t\t<Word>vblendmps</Word>\n\t\t\t<Word>vbroadcastss</Word>\n\t\t\t<Word>vbroadcastsd</Word>\n\t\t\t<Word>vbroadcastf128</Word>\n\t\t\t<Word>vbroadcastf32x2</Word>\n\t\t\t<Word>vbroadcastf32x4</Word>\n\t\t\t<Word>vbroadcastf64x2</Word>\n\t\t\t<Word>vbroadcastf32x8</Word>\n\t\t\t<Word>vbroadcastf64x4</Word>\n\t\t\t<Word>vcompresspd</Word>\n\t\t\t<Word>vcompressps</Word>\n\t\t\t<Word>vcvtne2ps2bf16</Word>\n\t\t\t<Word>vcvtneps2bf16</Word>\n\t\t\t<Word>vcvtpd2qq</Word>\n\t\t\t<Word>vcvtpd2udq</Word>\n\t\t\t<Word>vcvtpd2uqq</Word>\n\t\t\t<Word>vcvtph2ps</Word>\n\t\t\t<Word>vcvtps2ph</Word>\n\t\t\t<Word>vcvtps2qq</Word>\n\t\t\t<Word>vcvtps2udq</Word>\n\t\t\t<Word>vcvtps2uqq</Word>\n\t\t\t<Word>vcvtqq2pd</Word>\n\t\t\t<Word>vcvtqq2ps</Word>\n\t\t\t<Word>vcvtsd2usi</Word>\n\t\t\t<Word>vcvtss2usi</Word>\n\t\t\t<Word>vcvttpd2qq</Word>\n\t\t\t<Word>vcvttpd2udq</Word>\n\t\t\t<Word>vcvttpd2uqq</Word>\n\t\t\t<Word>vcvttps2qq</Word>\n\t\t\t<Word>vcvttps2udq</Word>\n\t\t\t<Word>vcvttps2uqq</Word>\n\t\t\t<Word>vcvttsd2usi</Word>\n\t\t\t<Word>vcvttss2usi</Word>\n\t\t\t<Word>vcvtudq2pd</Word>\n\t\t\t<Word>vcvtudq2ps</Word>\n\t\t\t<Word>vcvtuqq2pd</Word>\n\t\t\t<Word>vcvtuqq2ps</Word>\n\t\t\t<Word>vcvtusi2sd</Word>\n\t\t\t<Word>vcvtusi2ss</Word>\n\t\t\t<Word>vdbpsadbw</Word>\n\t\t\t<Word>vdpbf16ps</Word>\n\t\t\t<Word>verr</Word>\n\t\t\t<Word>verw</Word>\n\t\t\t<Word>vexp2pd</Word>\n\t\t\t<Word>vexp2ps</Word>\n\t\t\t<Word>vexpandpd</Word>\n\t\t\t<Word>vexpandps</Word>\n\t\t\t<Word>vextractf128</Word>\n\t\t\t<Word>vextractf32x4</Word>\n\t\t\t<Word>vextractf64x2</Word>\n\t\t\t<Word>vextractf32x8</Word>\n\t\t\t<Word>vextractf64x4</Word>\n\t\t\t<Word>vextracti128</Word>\n\t\t\t<Word>vextracti32x4</Word>\n\t\t\t<Word>vextracti64x2</Word>\n\t\t\t<Word>vextracti32x8</Word>\n\t\t\t<Word>vextracti64x4</Word>\n\t\t\t<Word>vfixupimmpd</Word>\n\t\t\t<Word>vfixupimmps</Word>\n\t\t\t<Word>vfixupimmsd</Word>\n\t\t\t<Word>vfixupimmss</Word>\n\t\t\t<Word>vfmadd132pd</Word>\n\t\t\t<Word>vfmadd213pd</Word>\n\t\t\t<Word>vfmadd231pd</Word>\n\t\t\t<Word>vfmadd132ps</Word>\n\t\t\t<Word>vfmadd213ps</Word>\n\t\t\t<Word>vfmadd231ps</Word>\n\t\t\t<Word>vfmadd132sd</Word>\n\t\t\t<Word>vfmadd213sd</Word>\n\t\t\t<Word>vfmadd231sd</Word>\n\t\t\t<Word>vfmadd132ss</Word>\n\t\t\t<Word>vfmadd213ss</Word>\n\t\t\t<Word>vfmadd231ss</Word>\n\t\t\t<Word>vfmaddsub132pd</Word>\n\t\t\t<Word>vfmaddsub213pd</Word>\n\t\t\t<Word>vfmaddsub231pd</Word>\n\t\t\t<Word>vfmaddsub132ps</Word>\n\t\t\t<Word>vfmaddsub213ps</Word>\n\t\t\t<Word>vfmaddsub231ps</Word>\n\t\t\t<Word>vfmsub132pd</Word>\n\t\t\t<Word>vfmsub213pd</Word>\n\t\t\t<Word>vfmsub231pd</Word>\n\t\t\t<Word>vfmsub132ps</Word>\n\t\t\t<Word>vfmsub213ps</Word>\n\t\t\t<Word>vfmsub231ps</Word>\n\t\t\t<Word>vfmsub132sd</Word>\n\t\t\t<Word>vfmsub213sd</Word>\n\t\t\t<Word>vfmsub231sd</Word>\n\t\t\t<Word>vfmsub132ss</Word>\n\t\t\t<Word>vfmsub213ss</Word>\n\t\t\t<Word>vfmsub231ss</Word>\n\t\t\t<Word>vfmsubadd132pd</Word>\n\t\t\t<Word>vfmsubadd213pd</Word>\n\t\t\t<Word>vfmsubadd231pd</Word>\n\t\t\t<Word>vfmsubadd132ps</Word>\n\t\t\t<Word>vfmsubadd213ps</Word>\n\t\t\t<Word>vfmsubadd231ps</Word>\n\t\t\t<Word>vfnmadd132pd</Word>\n\t\t\t<Word>vfnmadd213pd</Word>\n\t\t\t<Word>vfnmadd231pd</Word>\n\t\t\t<Word>vfnmadd132ps</Word>\n\t\t\t<Word>vfnmadd213ps</Word>\n\t\t\t<Word>vfnmadd231ps</Word>\n\t\t\t<Word>vfnmadd132sd</Word>\n\t\t\t<Word>vfnmadd213sd</Word>\n\t\t\t<Word>vfnmadd231sd</Word>\n\t\t\t<Word>vfnmadd132ss</Word>\n\t\t\t<Word>vfnmadd213ss</Word>\n\t\t\t<Word>vfnmadd231ss</Word>\n\t\t\t<Word>vfnmsub132pd</Word>\n\t\t\t<Word>vfnmsub213pd</Word>\n\t\t\t<Word>vfnmsub231pd</Word>\n\t\t\t<Word>vfnmsub132ps</Word>\n\t\t\t<Word>vfnmsub213ps</Word>\n\t\t\t<Word>vfnmsub231ps</Word>\n\t\t\t<Word>vfnmsub132sd</Word>\n\t\t\t<Word>vfnmsub213sd</Word>\n\t\t\t<Word>vfnmsub231sd</Word>\n\t\t\t<Word>vfnmsub132ss</Word>\n\t\t\t<Word>vfnmsub213ss</Word>\n\t\t\t<Word>vfnmsub231ss</Word>\n\t\t\t<Word>vfpclasspd</Word>\n\t\t\t<Word>vfpclassps</Word>\n\t\t\t<Word>vfpclasssd</Word>\n\t\t\t<Word>vfpclassss</Word>\n\t\t\t<Word>vgatherdpd</Word>\n\t\t\t<Word>vgatherqpd</Word>\n\t\t\t<Word>vgatherdps</Word>\n\t\t\t<Word>vgatherdpd</Word>\n\t\t\t<Word>vgatherdps</Word>\n\t\t\t<Word>vgatherqps</Word>\n\t\t\t<Word>vgatherpf0dps</Word>\n\t\t\t<Word>vgatherpf0qps</Word>\n\t\t\t<Word>vgatherpf0dpd</Word>\n\t\t\t<Word>vgatherpf0qpd</Word>\n\t\t\t<Word>vgatherpf1dps</Word>\n\t\t\t<Word>vgatherpf1qps</Word>\n\t\t\t<Word>vgatherpf1dpd</Word>\n\t\t\t<Word>vgatherpf1qpd</Word>\n\t\t\t<Word>vgatherqps</Word>\n\t\t\t<Word>vgatherqpd</Word>\n\t\t\t<Word>vgetexppd</Word>\n\t\t\t<Word>vgetexpps</Word>\n\t\t\t<Word>vgetexpsd</Word>\n\t\t\t<Word>vgetexpss</Word>\n\t\t\t<Word>vgetmantpd</Word>\n\t\t\t<Word>vgetmantps</Word>\n\t\t\t<Word>vgetmantsd</Word>\n\t\t\t<Word>vgetmantss</Word>\n\t\t\t<Word>vinsertf128</Word>\n\t\t\t<Word>vinsertf32x4</Word>\n\t\t\t<Word>vinsertf64x2</Word>\n\t\t\t<Word>vinsertf32x8</Word>\n\t\t\t<Word>vinsertf64x4</Word>\n\t\t\t<Word>vinserti128</Word>\n\t\t\t<Word>vinserti32x4</Word>\n\t\t\t<Word>vinserti64x2</Word>\n\t\t\t<Word>vinserti32x8</Word>\n\t\t\t<Word>vinserti64x4</Word>\n\t\t\t<Word>vmaskmovps</Word>\n\t\t\t<Word>vmaskmovpd</Word>\n\t\t\t<Word>vp2intersectd</Word>\n\t\t\t<Word>vp2intersectq</Word>\n\t\t\t<Word>vp4dpwssd</Word>\n\t\t\t<Word>vp4dpwssds</Word>\n\t\t\t<Word>vpblendd</Word>\n\t\t\t<Word>vpblendmb</Word>\n\t\t\t<Word>vpblendmw</Word>\n\t\t\t<Word>vpblendmd</Word>\n\t\t\t<Word>vpblendmq</Word>\n\t\t\t<Word>vpbroadcastb</Word>\n\t\t\t<Word>vpbroadcastw</Word>\n\t\t\t<Word>vpbroadcastd</Word>\n\t\t\t<Word>vpbroadcastq</Word>\n\t\t\t<Word>vbroadcasti32x2</Word>\n\t\t\t<Word>vbroadcasti128</Word>\n\t\t\t<Word>vbroadcasti32x4</Word>\n\t\t\t<Word>vbroadcasti64x2</Word>\n\t\t\t<Word>vbroadcasti32x8</Word>\n\t\t\t<Word>vbroadcasti64x4</Word>\n\t\t\t<Word>vpbroadcastb</Word>\n\t\t\t<Word>vpbroadcastw</Word>\n\t\t\t<Word>vpbroadcastd</Word>\n\t\t\t<Word>vpbroadcastq</Word>\n\t\t\t<Word>vpbroadcastmb2q</Word>\n\t\t\t<Word>vpbroadcastmw2d</Word>\n\t\t\t<Word>vpclmulqdq</Word>\n\t\t\t<Word>vpcmpb</Word>\n\t\t\t<Word>vpcmpub</Word>\n\t\t\t<Word>vpcmpd</Word>\n\t\t\t<Word>vpcmpud</Word>\n\t\t\t<Word>vpcmpq</Word>\n\t\t\t<Word>vpcmpuq</Word>\n\t\t\t<Word>vpcmpw</Word>\n\t\t\t<Word>vpcmpuw</Word>\n\t\t\t<Word>vpcompressb</Word>\n\t\t\t<Word>vpcompressw</Word>\n\t\t\t<Word>vpcompressd</Word>\n\t\t\t<Word>vpcompressq</Word>\n\t\t\t<Word>vpconflictd</Word>\n\t\t\t<Word>vpconflictq</Word>\n\t\t\t<Word>vpdpbusd</Word>\n\t\t\t<Word>vpdpbusds</Word>\n\t\t\t<Word>vpdpwssd</Word>\n\t\t\t<Word>vpdpwssds</Word>\n\t\t\t<Word>vperm2f128</Word>\n\t\t\t<Word>vperm2i128</Word>\n\t\t\t<Word>vpermb</Word>\n\t\t\t<Word>vpermd</Word>\n\t\t\t<Word>vpermw</Word>\n\t\t\t<Word>vpermi2b</Word>\n\t\t\t<Word>vpermi2w</Word>\n\t\t\t<Word>vpermi2d</Word>\n\t\t\t<Word>vpermi2q</Word>\n\t\t\t<Word>vpermi2ps</Word>\n\t\t\t<Word>vpermi2pd</Word>\n\t\t\t<Word>vpermilpd</Word>\n\t\t\t<Word>vpermilps</Word>\n\t\t\t<Word>vpermpd</Word>\n\t\t\t<Word>vpermps</Word>\n\t\t\t<Word>vpermq</Word>\n\t\t\t<Word>vpermt2b</Word>\n\t\t\t<Word>vpermt2w</Word>\n\t\t\t<Word>vpermt2d</Word>\n\t\t\t<Word>vpermt2q</Word>\n\t\t\t<Word>vpermt2ps</Word>\n\t\t\t<Word>vpermt2pd</Word>\n\t\t\t<Word>vpexpandb</Word>\n\t\t\t<Word>vpexpandw</Word>\n\t\t\t<Word>vpexpandd</Word>\n\t\t\t<Word>vpexpandq</Word>\n\t\t\t<Word>vpgatherdd</Word>\n\t\t\t<Word>vpgatherdq</Word>\n\t\t\t<Word>vpgatherdd</Word>\n\t\t\t<Word>vpgatherqd</Word>\n\t\t\t<Word>vpgatherdq</Word>\n\t\t\t<Word>vpgatherqq</Word>\n\t\t\t<Word>vpgatherqd</Word>\n\t\t\t<Word>vpgatherqq</Word>\n\t\t\t<Word>vplzcntd</Word>\n\t\t\t<Word>vplzcntq</Word>\n\t\t\t<Word>vpmadd52huq</Word>\n\t\t\t<Word>vpmadd52luq</Word>\n\t\t\t<Word>vpmaskmovd</Word>\n\t\t\t<Word>vpmaskmovq</Word>\n\t\t\t<Word>vpmovb2m</Word>\n\t\t\t<Word>vpmovw2m</Word>\n\t\t\t<Word>vpmovd2m</Word>\n\t\t\t<Word>vpmovq2m</Word>\n\t\t\t<Word>vpmovdb</Word>\n\t\t\t<Word>vpmovsdb</Word>\n\t\t\t<Word>vpmovusdb</Word>\n\t\t\t<Word>vpmovdw</Word>\n\t\t\t<Word>vpmovsdw</Word>\n\t\t\t<Word>vpmovusdw</Word>\n\t\t\t<Word>vpmovm2b</Word>\n\t\t\t<Word>vpmovm2w</Word>\n\t\t\t<Word>vpmovm2d</Word>\n\t\t\t<Word>vpmovm2q</Word>\n\t\t\t<Word>vpmovqb</Word>\n\t\t\t<Word>vpmovsqb</Word>\n\t\t\t<Word>vpmovusqb</Word>\n\t\t\t<Word>vpmovqd</Word>\n\t\t\t<Word>vpmovsqd</Word>\n\t\t\t<Word>vpmovusqd</Word>\n\t\t\t<Word>vpmovqw</Word>\n\t\t\t<Word>vpmovsqw</Word>\n\t\t\t<Word>vpmovusqw</Word>\n\t\t\t<Word>vpmovwb</Word>\n\t\t\t<Word>vpmovswb</Word>\n\t\t\t<Word>vpmovuswb</Word>\n\t\t\t<Word>vpmultishiftqb</Word>\n\t\t\t<Word>vpopcntb</Word>\n\t\t\t<Word>vpopcntw</Word>\n\t\t\t<Word>vpopcntd</Word>\n\t\t\t<Word>vpopcntq</Word>\n\t\t\t<Word>vprolvd</Word>\n\t\t\t<Word>vprold</Word>\n\t\t\t<Word>vprolvq</Word>\n\t\t\t<Word>vprolq</Word>\n\t\t\t<Word>vprorvd</Word>\n\t\t\t<Word>vprord</Word>\n\t\t\t<Word>vprorvq</Word>\n\t\t\t<Word>vprorq</Word>\n\t\t\t<Word>vpscatterdd</Word>\n\t\t\t<Word>vpscatterdq</Word>\n\t\t\t<Word>vpscatterqd</Word>\n\t\t\t<Word>vpscatterqq</Word>\n\t\t\t<Word>vpshldw</Word>\n\t\t\t<Word>vpshldd</Word>\n\t\t\t<Word>vpshldq</Word>\n\t\t\t<Word>vpshldvw</Word>\n\t\t\t<Word>vpshldvd</Word>\n\t\t\t<Word>vpshldvq</Word>\n\t\t\t<Word>vpshrdw</Word>\n\t\t\t<Word>vpshrdd</Word>\n\t\t\t<Word>vpshrdq</Word>\n\t\t\t<Word>vpshrdvw</Word>\n\t\t\t<Word>vpshrdvd</Word>\n\t\t\t<Word>vpshrdvq</Word>\n\t\t\t<Word>vpshufbitqmb</Word>\n\t\t\t<Word>vpsllvd</Word>\n\t\t\t<Word>vpsllvq</Word>\n\t\t\t<Word>vpsllvw</Word>\n\t\t\t<Word>vpsravd</Word>\n\t\t\t<Word>vpsravw</Word>\n\t\t\t<Word>vpsravq</Word>\n\t\t\t<Word>vpsrlvd</Word>\n\t\t\t<Word>vpsrlvq</Word>\n\t\t\t<Word>vpsrlvw</Word>\n\t\t\t<Word>vpternlogd</Word>\n\t\t\t<Word>vpternlogq</Word>\n\t\t\t<Word>vptestmb</Word>\n\t\t\t<Word>vptestmw</Word>\n\t\t\t<Word>vptestmd</Word>\n\t\t\t<Word>vptestmq</Word>\n\t\t\t<Word>vptestnmb</Word>\n\t\t\t<Word>vptestnmw</Word>\n\t\t\t<Word>vptestnmd</Word>\n\t\t\t<Word>vptestnmq</Word>\n\t\t\t<Word>vrangepd</Word>\n\t\t\t<Word>vrangeps</Word>\n\t\t\t<Word>vrangesd</Word>\n\t\t\t<Word>vrangess</Word>\n\t\t\t<Word>vrcp14pd</Word>\n\t\t\t<Word>vrcp14ps</Word>\n\t\t\t<Word>vrcp14sd</Word>\n\t\t\t<Word>vrcp14ss</Word>\n\t\t\t<Word>vrcp28pd</Word>\n\t\t\t<Word>vrcp28ps</Word>\n\t\t\t<Word>vrcp28sd</Word>\n\t\t\t<Word>vrcp28ss</Word>\n\t\t\t<Word>vreducepd</Word>\n\t\t\t<Word>vreduceps</Word>\n\t\t\t<Word>vreducesd</Word>\n\t\t\t<Word>vreducess</Word>\n\t\t\t<Word>vrndscalepd</Word>\n\t\t\t<Word>vrndscaleps</Word>\n\t\t\t<Word>vrndscalesd</Word>\n\t\t\t<Word>vrndscaless</Word>\n\t\t\t<Word>vrsqrt14pd</Word>\n\t\t\t<Word>vrsqrt14ps</Word>\n\t\t\t<Word>vrsqrt14sd</Word>\n\t\t\t<Word>vrsqrt14ss</Word>\n\t\t\t<Word>vrsqrt28pd</Word>\n\t\t\t<Word>vrsqrt28ps</Word>\n\t\t\t<Word>vrsqrt28sd</Word>\n\t\t\t<Word>vrsqrt28ss</Word>\n\t\t\t<Word>vscalefpd</Word>\n\t\t\t<Word>vscalefps</Word>\n\t\t\t<Word>vscalefsd</Word>\n\t\t\t<Word>vscalefss</Word>\n\t\t\t<Word>vscatterdps</Word>\n\t\t\t<Word>vscatterdpd</Word>\n\t\t\t<Word>vscatterqps</Word>\n\t\t\t<Word>vscatterqpd</Word>\n\t\t\t<Word>vscatterpf0dps</Word>\n\t\t\t<Word>vscatterpf0qps</Word>\n\t\t\t<Word>vscatterpf0dpd</Word>\n\t\t\t<Word>vscatterpf0qpd</Word>\n\t\t\t<Word>vscatterpf1dps</Word>\n\t\t\t<Word>vscatterpf1qps</Word>\n\t\t\t<Word>vscatterpf1dpd</Word>\n\t\t\t<Word>vscatterpf1qpd</Word>\n\t\t\t<Word>vshuff32x4</Word>\n\t\t\t<Word>vshuff64x2</Word>\n\t\t\t<Word>vshufi32x4</Word>\n\t\t\t<Word>vshufi64x2</Word>\n\t\t\t<Word>vtestps</Word>\n\t\t\t<Word>vtestpd</Word>\n\t\t\t<Word>vzeroall</Word>\n\t\t\t<Word>vzeroupper</Word>\n\t\t\t<Word>wait</Word>\n\t\t\t<Word>fwait</Word>\n\t\t\t<Word>wbinvd</Word>\n\t\t\t<Word>wbnoinvd</Word>\n\t\t\t<Word>wrfsbase</Word>\n\t\t\t<Word>wrgsbase</Word>\n\t\t\t<Word>wrmsr</Word>\n\t\t\t<Word>wrpkru</Word>\n\t\t\t<Word>xabort</Word>\n\t\t\t<Word>xacquire</Word>\n\t\t\t<Word>xrelease</Word>\n\t\t\t<Word>xadd</Word>\n\t\t\t<Word>xbegin</Word>\n\t\t\t<Word>xchg</Word>\n\t\t\t<Word>xend</Word>\n\t\t\t<Word>xgetbv</Word>\n\t\t\t<Word>xlat</Word>\n\t\t\t<Word>xlatb</Word>\n\t\t\t<Word>xor</Word>\n\t\t\t<Word>xorpd</Word>\n\t\t\t<Word>vxorpd</Word>\n\t\t\t<Word>xorps</Word>\n\t\t\t<Word>vxorps</Word>\n\t\t\t<Word>xrstor</Word>\n\t\t\t<Word>xrstor64</Word>\n\t\t\t<Word>xrstors</Word>\n\t\t\t<Word>xrstors64</Word>\n\t\t\t<Word>xsave</Word>\n\t\t\t<Word>xsave64</Word>\n\t\t\t<Word>xsavec</Word>\n\t\t\t<Word>xsavec64</Word>\n\t\t\t<Word>xsaveopt</Word>\n\t\t\t<Word>xsaveopt64</Word>\n\t\t\t<Word>xsaves</Word>\n\t\t\t<Word>xsaves64</Word>\n\t\t\t<Word>xsetbv</Word>\n\t\t\t<Word>xtest</Word>\n        </Keywords>\n\n        <Keywords color=\"Type\">\n            <Word>byte</Word>\n            <Word>word</Word>\n            <Word>dword</Word>\n            <Word>qword</Word>\n            <Word>ptr</Word>\n            <Word>xmmword</Word>\n            <Word>ymmword</Word>\n            <Word>zmmword</Word>\n        </Keywords>\n\n        <Span color=\"ArrayType\">\n            <Begin>\\[</Begin>\n            <End>\\]</End>\n        </Span>\n\n        <Span color=\"StructType\">\n            <Begin>\\{</Begin>\n            <End>\\}</End>\n        </Span>\n\n        <Rule color=\"Variable\">%\\w+(.\\w+)*</Rule>\n        <Rule color=\"CallTarget\">@\\w+(.\\w+)*</Rule>\n        <Rule color=\"Annotation\">!\\w+([a-z]|[A-Z]|[0-9]|\\(|\\))*</Rule>\n        <Rule color=\"Digits\">\\b((0x)?[0-9a-fA-F]+|[0-9]+)\\b</Rule>\n        \n        <Keywords color=\"Attributes\">\n\t\t\t<Word>rep</Word>\n            <Word>true</Word>\n            <Word>false</Word>\n        </Keywords>\n    </RuleSet>\n</SyntaxDefinition>"
  },
  {
    "path": "resources/documentStyles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \n\n<SyntaxDefinitions>\n\t<SyntaxDefinition name=\"Default\">\n\t\t<Color name=\"BackgroundColor\" background=\"#FFFAFA\" />\n\t\t<Color name=\"AlternateBackgroundColor\" background=\"#f5f5f5\" />\n\t\t<Color name=\"TextColor\" background=\"#000000\" />\n\t\t<Color name=\"BlockSeparatorColor\" background=\"#c0c0c0\" />\n\t\t<Color name=\"MarginBackgroundColor\" background=\"#dcdcdc\" />\n\t\t<Color name=\"SelectedValueColor\" background=\"#C5DEEA\" />\n\t\t<Color name=\"DefinitionValueColor\" background=\"#F2E67C\" />\n\t\t<Color name=\"UseValueColor\" background=\"#95DBAD\" />\n\t\t<Color name=\"BorderColor\" background=\"#000000\" />\n\t</SyntaxDefinition>\n\t\n\t<SyntaxDefinition name=\"Gray\">\n\t\t<Color name=\"BackgroundColor\" background=\"#F4F4F4\" />\n\t\t<Color name=\"AlternateBackgroundColor\" background=\"#EDEDED\" />\n\t\t<Color name=\"TextColor\" background=\"#000000\" />\n\t\t<Color name=\"BlockSeparatorColor\" background=\"#B5001E\" />\n\t\t<Color name=\"MarginBackgroundColor\" background=\"#dcdcdc\" />\n\t\t<Color name=\"SelectedValueColor\" background=\"#C5DEEA\" />\n\t\t<Color name=\"DefinitionValueColor\" background=\"#F2E67C\" />\n\t\t<Color name=\"UseValueColor\" background=\"#95DBAD\" />\n\t\t<Color name=\"BorderColor\" background=\"#000000\" />\n\t</SyntaxDefinition>\n\t\n\t<SyntaxDefinition name=\"Yellow\">\n\t\t<Color name=\"BackgroundColor\" background=\"#FFF8E0\" />\n\t\t<Color name=\"AlternateBackgroundColor\" background=\"#FFF8D3\" />\n\t\t<Color name=\"TextColor\" background=\"#000000\" />\n\t\t<Color name=\"BlockSeparatorColor\" background=\"#9E8A96\" />\n\t\t<Color name=\"MarginBackgroundColor\" background=\"#dcdcdc\" />\n\t\t<Color name=\"SelectedValueColor\" background=\"#B2E6FF\" />\n\t\t<Color name=\"DefinitionValueColor\" background=\"#FFAE7F\" />\n\t\t<Color name=\"UseValueColor\" background=\"#95DBAD\" />\n\t\t<Color name=\"BorderColor\" background=\"#000000\" />\n\t</SyntaxDefinition>\n\n\t<SyntaxDefinition name=\"Orange\">\n\t\t<Color name=\"BackgroundColor\" background=\"#FFF5F0\" />\n\t\t<Color name=\"AlternateBackgroundColor\" background=\"#FFEBE6\" />\n\t\t<Color name=\"TextColor\" background=\"#000000\" />\n\t\t<Color name=\"BlockSeparatorColor\" background=\"#E5989B\" />\n\t\t<Color name=\"MarginBackgroundColor\" background=\"#dcdcdc\" />\n\t\t<Color name=\"SelectedValueColor\" background=\"#C5DEEA\" />\n\t\t<Color name=\"DefinitionValueColor\" background=\"#F2E67C\" />\n\t\t<Color name=\"UseValueColor\" background=\"#95DBAD\" />\n\t\t<Color name=\"BorderColor\" background=\"#000000\" />\n\t</SyntaxDefinition>\n\t\n\t<SyntaxDefinition name=\"Blue\">\n\t\t<Color name=\"BackgroundColor\" background=\"#F2F8FF\" />\n\t\t<Color name=\"AlternateBackgroundColor\" background=\"#E2F0FF\" />\n\t\t<Color name=\"TextColor\" background=\"#000000\" />\n\t\t<Color name=\"BlockSeparatorColor\" background=\"#85B8E6\" />\n\t\t<Color name=\"MarginBackgroundColor\" background=\"#dcdcdc\" />\n\t\t<Color name=\"SelectedValueColor\" background=\"#C5DEEA\" />\n\t\t<Color name=\"DefinitionValueColor\" background=\"#F2E67C\" />\n\t\t<Color name=\"UseValueColor\" background=\"#95DBAD\" />\n\t\t<Color name=\"BorderColor\" background=\"#000000\" />\n\t</SyntaxDefinition>\n\t\n\t<SyntaxDefinition name=\"Lavender\">\n\t\t<Color name=\"BackgroundColor\" background=\"#F8F4FF\" />\n\t\t<Color name=\"AlternateBackgroundColor\" background=\"#F5EDFF\" />\n\t\t<Color name=\"TextColor\" background=\"#000000\" />\n\t\t<Color name=\"BlockSeparatorColor\" background=\"#7955FC\" />\n\t\t<Color name=\"MarginBackgroundColor\" background=\"#dcdcdc\" />\n\t\t<Color name=\"SelectedValueColor\" background=\"#C5DEEA\" />\n\t\t<Color name=\"DefinitionValueColor\" background=\"#FFAE7F\" />\n\t\t<Color name=\"UseValueColor\" background=\"#95DBAD\" />\n\t\t<Color name=\"BorderColor\" background=\"#000000\" />\n\t</SyntaxDefinition>\n\n\t<SyntaxDefinition name=\"Dark\">\n\t\t<Color name=\"BackgroundColor\" background=\"#393939\" />\n\t\t<Color name=\"AlternateBackgroundColor\" background=\"#303030\" />\n\t\t<Color name=\"TextColor\" background=\"#F5F5DC\" />\n\t\t<Color name=\"BlockSeparatorColor\" background=\"#808080\" />\n\t\t<Color name=\"MarginBackgroundColor\" background=\"#A9A9A9\" />\n\t\t<Color name=\"SelectedValueColor\" background=\"#02027C\" />\n\t\t<Color name=\"DefinitionValueColor\" background=\"#5D2983\" />\n\t\t<Color name=\"UseValueColor\" background=\"#1E5515\" />\n\t\t<Color name=\"BorderColor\" background=\"#C0C0C0\" />\n\t</SyntaxDefinition>\n</SyntaxDefinitions>"
  },
  {
    "path": "resources/ir.xshd",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \n\n<!-- Syntax definition for IR Explorer internal IR -->\n<SyntaxDefinition name=\"IRX\" xmlns=\"http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008\">\n\t<Color name=\"Digits\" foreground=\"Blue\" />\n\t<Color name=\"Comment\" foreground=\"Silver\" />\n\t<Color name=\"Keywords\" foreground=\"MediumBlue\" fontWeight=\"bold\"/>\n\t<Color name=\"Opcodes\" foreground=\"Purple\" fontWeight=\"bold\"/>\n\t<Color name=\"TransferOpcodes\" foreground=\"Firebrick\" fontWeight=\"bold\"/>\n    <Color name=\"Indir\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n\t<Color name=\"Type\" foreground=\"Maroon\" />\n\t\n    <RuleSet ignoreCase=\"false\">\n\t\t<Keywords color=\"Keywords\">\n            <Word>func</Word>\n            <Word>block</Word>\n\t\t\t<Word>label</Word>\n        </Keywords>\n\t\t\n\t\t<Keywords color=\"Opcodes\">\n            <Word>var</Word>\n\t\t\t<Word>temp</Word>\n\t\t\t<Word>indir</Word>\n            <Word>metadata</Word>\n\t\t\t<Word>exception</Word>\n\t\t\t<Word>other</Word>\n\t\t\t<Word>intconst</Word>\n\t\t\t<Word>floatconst</Word>\n\t\t\t<Word>address</Word>\n        </Keywords>\n        \n\t\t<Keywords color=\"TransferOpcodes\">\n            <Word>branch</Word>\n            <Word>goto</Word>\n            <Word>switch</Word>\n            <Word>return</Word>\n        </Keywords>\n        \n\t\t<Keywords color=\"Type\">\n            <Word>int8></Word>\n            <Word>int16</Word>\n\t\t\t<Word>int32</Word>\n\t\t\t<Word>int64</Word>\n\t\t\t<Word>uint8></Word>\n            <Word>uint16</Word>\n\t\t\t<Word>uint32</Word>\n\t\t\t<Word>uint64</Word>\n\t\t\t<Word>float32</Word>\n\t\t\t<Word>float64</Word>\n\t\t\t<Word>unknown</Word>\n\t\t\t<Word>void</Word>\n\t\t\t<Word>bool</Word>\n\t\t\t<Word>mb4</Word>\n\t\t\t<Word>mb8</Word>\n\t\t\t<Word>mb16</Word>\n        </Keywords>\n\n\t\t<Span color=\"Indir\">\n            <Begin>\\[</Begin>\n            <End>\\]</End>\n\t\t</Span>\n\t\t\n        <Rule color=\"Digits\">\\b0[xX][0-9a-fA-F]+|(\\b(?&lt;!\\$)\\d+(\\.[0-9]+)?|\\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>\n   </RuleSet>\n</SyntaxDefinition>"
  },
  {
    "path": "resources/llvm/llvm.xshd",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\" ?> \n\n<!-- Syntax definition for LLVM IR -->\n<SyntaxDefinition name=\"LLVM IR\" xmlns=\"http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008\">\n    <Color name=\"String\" foreground=\"DarkOrange\" />\n\t<Color name=\"Digits\" foreground=\"Blue\" />\n\t<Color name=\"Comment\" foreground=\"Silver\" />\n\t<Color name=\"Keywords\" foreground=\"DarkBlue\" fontWeight=\"bold\"/>\n\t<Color name=\"Opcodes\" foreground=\"Crimson\" fontWeight=\"bold\"/>\n\t<Color name=\"TransferOpcodes\" foreground=\"DarkGreen\" fontWeight=\"bold\"/>\n\t<Color name=\"CallOpcodes\" foreground=\"DarkOrchid\" fontWeight=\"bold\" />\n    <Color name=\"ArrayType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"PointerType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n    <Color name=\"StructType\" foreground=\"DarkMagenta\" fontWeight=\"bold\" />\n\t<Color name=\"Type\" foreground=\"Maroon\" />\n\t<Color name=\"Attributes\" foreground=\"DarkGreen\" fontWeight=\"bold\" />\n\t<Color name=\"Annotation\" foreground=\"Silver\" />\n\t<Color name=\"Variable\" foreground=\"Black\" fontWeight=\"bold\" />\n\t<Color name=\"CallTarget\" foreground=\"DarkGreen\" fontWeight=\"bold\" />\n    <RuleSet ignoreCase=\"false\">\n\t\t<Span color=\"Comment\" begin=\";\" />\n        <Span color=\"String\">\n            <Begin>\"</Begin>\n            <End>\"</End>\n            <RuleSet>\n                <!-- nested span for escape sequences -->\n                <Span begin=\"\\\\\" end=\".\" />\n            </RuleSet>\n        </Span>\n        \n        <Keywords color=\"Keywords\">\n            <Word>define</Word>\n            <Word>global</Word>\n\t\t\t<Word>declare</Word>\n        </Keywords>\n\t\t\n\t\t<Keywords color=\"Opcodes\">\n            <Word>load</Word>\n            <Word>store</Word>\n            <Word>alloca</Word>\n            <Word>icmp</Word>\n            <Word>select</Word>\n            <Word>bitcast</Word>\n            <Word>add</Word>\n            <Word>sub</Word>\n            <Word>mul</Word>\n            <Word>sdiv</Word>\n            <Word>udiv</Word>\n            <Word>fdiv</Word>\n            <Word>urem</Word>\n            <Word>srem</Word>\n            <Word>frem</Word>\n            <Word>fneg</Word>\n            <Word>shl</Word>\n            <Word>lshr</Word>\n            <Word>ashr</Word>\n            <Word>and</Word>\n            <Word>or</Word>\n            <Word>xor</Word>\n            <Word>phi</Word>\n            <Word>trunc</Word>\n            <Word>zext</Word>\n            <Word>sext</Word>\n            <Word>fcmp</Word>\n            <Word>extractelement</Word>\n            <Word>insertelement</Word>\n            <Word>shufflevector</Word>\n            <Word>extractvalue</Word>\n            <Word>insertvalue</Word>\n            <Word>getelementptr</Word>\n            <Word>inttoptr</Word>\n            <Word>sitofp</Word>\n            <Word>uitofp</Word>\n            <Word>fptosi</Word>\n            <Word>fptoui</Word>\n            <Word>fpext</Word>\n            <Word>fptrunc</Word>\n            <Word>fmul</Word>\n            <Word>fadd</Word>\n            <Word>fsub</Word>\n        </Keywords>\n        \n\t\t<Keywords color=\"TransferOpcodes\">\n\t\t\t<Word>br</Word>\n\t\t\t<Word>indirectbr</Word>\n\t\t\t<Word>callbr</Word>\n\t\t\t<Word>switch</Word>\n\t\t\t<Word>ret</Word>\n\t\t\t<Word>label</Word>\n\t\t\t<Word>resume</Word>\n\t\t\t<Word>catchret</Word>\n\t\t\t<Word>cleanupret</Word>\n\t\t\t<Word>unreachable</Word>\n        </Keywords>\n\t\t\n\t\t<Keywords color=\"CallOpcodes\">\n            <Word>call</Word>\n            <Word>invoke</Word>\n            <Word>va_arg</Word>\n        </Keywords>\n\t\t\n\t\t<Keywords color=\"Type\">\n            <Word>type</Word>\n            <Word>i1</Word>\n            <Word>i8</Word>\n            <Word>i16</Word>\n\t\t\t<Word>i32</Word>\n\t\t\t<Word>i64</Word>\n\t\t\t<Word>float</Word>\n\t\t\t<Word>double</Word>\n\t\t\t<Word>void</Word>\n\t\t\t<Word>undef</Word>\n        </Keywords>\n        \n\t\t<Span color=\"ArrayType\">\n            <Begin>\\[</Begin>\n            <End>\\]</End>\n\t\t</Span>\n\t\t\n\t\t<Span color=\"StructType\">\n            <Begin>\\{</Begin>\n            <End>\\}</End>\n\t\t</Span>\n\t\t\n\t\t<Keywords color=\"Attributes\">\n            <Word>nsw</Word>\n            <Word>nuw</Word>\n\t\t\t<Word>volatile</Word>\n\t\t\t<Word>align</Word>\n\t\t\t<Word>tail</Word>\n\t\t\t<Word>zeroinitializer</Word>\n\t\t\t<Word>byval</Word>\n\t\t\t<Word>zeroext</Word>\n\t\t\t<Word>signext</Word>\n\t\t\t<Word>inreg</Word>\n\t\t\t<Word>sret</Word>\n\t\t\t<Word>noalias</Word>\n\t\t\t<Word>nocapture</Word>\n\t\t\t<Word>nonnull</Word>\n\t\t\t<Word>alwaysinline</Word>\n\t\t\t<Word>noinline</Word>\n\t\t\t<Word>noreturn</Word>\n\t\t\t<Word>nounwind</Word>\n\t\t\t<Word>optnone</Word>\n\t\t\t<Word>optsize</Word>\n\t\t\t<Word>readnone</Word>\n\t\t\t<Word>readonly</Word>\n\t\t\t<Word>writeonly</Word>\n\t\t\t<Word>argmemonly</Word>\n\t\t\t<Word>external</Word>\n\t\t\t<Word>internal</Word>\n\t\t\t<Word>linkonce</Word>\n\t\t\t<Word>weak</Word>\n\t\t\t<Word>private</Word>\n\t\t\t<Word>dllimport</Word>\n\t\t\t<Word>dllexport</Word>\n\t\t\t<Word>atomic</Word>\n\t\t\t<Word>metadata</Word>\n\t\t\t<Word>inbounds</Word>\n        </Keywords>\n\t\t\n\t\t<Rule color=\"Variable\">%\\w+(.\\w+)*</Rule>\n\t\t<Rule color=\"CallTarget\">@\\w+(.\\w+)*</Rule>\t\n\t\t<Rule color=\"Annotation\">!\\w+([a-z]|[A-Z]|[0-9]|\\(|\\))*</Rule>\n\t\t\n        <Rule color=\"Digits\">\\b0[xX][0-9a-fA-F]+|(\\b(?&lt;!\\$)\\d+(\\.[0-9]+)?|\\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>\n        \n        <Keywords color=\"Attributes\">\n            <Word>true</Word>\n            <Word>false</Word>\n        </Keywords> \n   </RuleSet>\n</SyntaxDefinition>"
  },
  {
    "path": "resources/scripts/ssa-checker.cs",
    "content": "using IRExplorerCore;\nusing IRExplorerCore.IR;\nusing IRExplorerCore.Analysis;\nusing IRExplorerUI.Query;\nusing IRExplorerUI;\nusing IRExplorerUI.Scripting;\nusing System.Collections.Generic;\nusing System;\nusing System.Windows.Media;\nusing System.ComponentModel;\n\npublic class Script {\n    class Options : IFunctionTaskOptions {\n        [DisplayName(\"Check value definition dominance\")]\n        [Description(\"Checks that the definition of each source value dominates the instruction\")]\n        public bool CheckDominance { get; set; }\n\n        [DisplayName(\"Check live range overlap\")]\n        [Description(\"Checks that there is no live range overlap of multiple SSA values of the same symbol\")]\n        public bool CheckLiveRangeOverlap { get; set; }\n\n        [DisplayName(\"Error marker color (dominance)\")]\n        [Description(\"Color to be used for marking dominance errors\")]\n        public Color MarkerColor { get; set; }\n\n        [DisplayName(\"Error marker color (live range)\")]\n        [Description(\"Color to be used for marking live range overlap errors\")]\n        public Color LiveRangeMarkerColor { get; set; }\n\n         [DisplayName(\"Error marker color (dominance)\")]\n        [Description(\"Color to be used for marking the definition operand\")]\n        public Color DefinitionMarkerColor { get; set; }\n\n        public Options() {\n            Reset();\n        }\n\n        public void Reset() {\n            CheckDominance = true;\n            CheckLiveRangeOverlap = true;\n            MarkerColor = Colors.Pink;\n            LiveRangeMarkerColor = Colors.LightSalmon;\n            DefinitionMarkerColor = Colors.Gold;\n        }\n    }\n\n    public FunctionTaskInfo GetTaskInfo() {\n        return new FunctionTaskInfo(Guid.Parse(\"C18CD53C-7BE6-4893-BCFC-B093DD5FD91C\"),\n                                    \"SSA form checks\", \"Some description\") {\n            HasOptionsPanel = true,\n            OptionsType = typeof(Options)\n        };\n    }\n\n    public bool Execute(ScriptSession s) {\n    \tvar func = s.CurrentFunction;    \t\n        var options = (Options)s.SessionObject;\n    \t\n        var domTree = s.Analysis.DominatorTree;\n        var refs = s.Analysis.References;\n        bool failed = false;\n\n        foreach(var block in func.Blocks) {\n            var visitedInstrs = new HashSet<InstructionIR>();\n\n            foreach(var instr in block.Instructions) {\n                int sourceOpIndex = -1;\n\n                foreach(var sourceOp in instr.Sources) {\n                    sourceOpIndex++;\n                    var defOp = ReferenceFinder.GetSSADefinition(sourceOp);\n                    if(defOp == null) continue; // No SSA info.\n\n                    var defInstr = defOp.ParentInstruction;\n                    \n                    if(defInstr == null) {\n\t\t\t\t\t\tcontinue; // Constants, params, etc. dominate.\n                    }\n\n                    var checkedBlock = block;\n                    var defBlock = defInstr.ParentBlock;\n                    bool isPhiIncomingBlock = false;\n\n                    if (s.IR.IsPhiInstruction(instr)) {\n                        // For a PHI, the incoming operand must dominate the corresponding predecessor.\n                        checkedBlock = s.IR.GetIncomingPhiOperandBlock(instr, sourceOpIndex);\n                        isPhiIncomingBlock = true;\n                    }\n                                            \n                    if(options.CheckDominance)\n                    {\n                        if(!CheckDominance(checkedBlock, block, instr, isPhiIncomingBlock,\n                                           defInstr, defBlock, visitedInstrs, domTree, options, s)) {\n                            ReportDomFailure(s, checkedBlock, instr, sourceOp, defOp, defBlock, options);\n                            failed = true;\n                        }\n                    }\n\n                    if (options.CheckLiveRangeOverlap) {\n                        // Walk dominator tree between def. block and current block\n                        // and check if there is any other definition of the same symbol.\n                        InstructionIR redefinitionInstr = null;\n\n                        if(defBlock == checkedBlock) {\n                            CheckRedefinition(instr, checkedBlock, defInstr, defBlock, refs, out redefinitionInstr);\n                        }\n                        else {\n                            BlockIR domBlock = checkedBlock;\n\n                            do\n                            {\n                                domBlock = domTree.GetImmediateDominator(domBlock);\n                                \n                                if(!CheckRedefinition(instr, domBlock, defInstr, defBlock, refs, out redefinitionInstr)) {\n                                    break;\n                                }\n\n                            } while (domBlock != null && domBlock != defBlock);\n                        }\n\n                        if(redefinitionInstr != null) {\n                            ReportOverlapFailure(s, checkedBlock, instr, defOp, defBlock, redefinitionInstr, options);\n                            failed = true;\n                        }\n                    }\n                }\n\n                visitedInstrs.Add(instr);\n            }\n    \t}\n\n        if(failed) {\n            s.SetSessionResult(false, \"SSA correctness errors found\");\n        }\n        else {\n            s.SetSessionResult(true, \"No problems found\");\n        }\n\n        return true;\n    }\n\n    private bool CheckDominance(BlockIR checkedBlock, BlockIR userBlock, InstructionIR userInstr,\n                                bool isPhiIncomingBlock, InstructionIR defInstr, BlockIR defBlock,   \n                                HashSet<InstructionIR> visitedInstrs, DominatorAlgorithm domTree, \n                                Options options, ScriptSession s) {\n        if (!domTree.Dominates(defBlock, checkedBlock)) {\n            //s.WriteLine($\"Dom failure for defBlock {defBlock.Number} and {checkedBlock.Number}\");\n            return false;\n        }\n        else if (defBlock == userBlock) {\n            // Check that the def is defined before the user in the same block.\n            // If the instr. being checked is a PHI, with a loop back-edge the def.\n            // would be found after the PHI at the top of the block, which is expected.\n            if(isPhiIncomingBlock) {\n                return true;\n            }\n\n            if (!visitedInstrs.Contains(defInstr)) {\n                //s.WriteLine($\"Same block failure for defBlock {defBlock.Number} and userBlock {checkedBlock.Number} and {checkedBlock.Number} \");\n                return false;\n            }\n        }\n\n        return true;\n    }\n\n    private bool CheckRedefinition(InstructionIR userInstr, BlockIR domBlock, InstructionIR defInstr, \n                                    BlockIR defBlock, ReferenceFinder refs, out InstructionIR redefinitionInstr) {\n        bool defInstrSeen = domBlock != defBlock;\n        var defDestOp = defInstr.Destinations[0];\n\n        foreach(var instr in domBlock.Instructions) {\n            if(!defInstrSeen) {\n                defInstrSeen = instr == defInstr;\n            }\n            else {\n                if(instr == userInstr) {\n                    break;\n                }\n\n                // Check if the def. operand is overwritten.\n                foreach(var destOp in instr.Destinations) {\n                    if(refs.IsSameSymbolOperand(destOp, defDestOp, checkType:false, exactCheck:true)) {\n                        redefinitionInstr = instr;\n                        return false; // Redefinition.\n                    }\n                }\n            }\n        }\n\n        redefinitionInstr = null;\n        return true;\n    }\n\n    private void ReportDomFailure(ScriptSession s, BlockIR block, InstructionIR instr, \n                                  OperandIR sourceOp, IRElement defOp, BlockIR defBlock, Options options) {\n        s.Mark(instr, options.MarkerColor);\n        s.Mark(defOp, options.DefinitionMarkerColor);\n        s.Write($\"Dominance issue for instr in block {block.Number}: \"); s.WriteLine(instr);\n        s.Write(\"    for source \"); s.WriteLine(sourceOp);\n        s.Write($\"    defined in block {defBlock.Number}: \"); s.WriteLine(defOp);\n    }\n\n      private void ReportOverlapFailure(ScriptSession s, BlockIR block, InstructionIR instr, \n                                        IRElement defOp, BlockIR defBlock, \n                                        InstructionIR redefinitionInstr, Options options) {\n        s.Mark(instr, options.LiveRangeMarkerColor);\n        s.Mark(redefinitionInstr, options.DefinitionMarkerColor);\n        s.Write($\"Live-range overlap issue for instr in block {block.Number}: \"); s.WriteLine(instr);\n        s.Write($\"    defined in block {defBlock.Number}: \"); s.WriteLine(defOp);\n        s.Write($\"    redefined in block {redefinitionInstr.ParentBlock.Number}: \"); s.WriteLine(redefinitionInstr);\n    }\n}\n"
  },
  {
    "path": "resources/workspaces/Profiling - Compact.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LayoutRoot>\n  <RootPanel Orientation=\"Vertical\">\n    <LayoutPanel Orientation=\"Horizontal\">\n      <LayoutDocumentPaneGroup Orientation=\"Horizontal\" DockWidth=\"1.0139724849527085*\" IsMaximized=\"True\">\n        <LayoutDocumentPane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flame Graph\" IsSelected=\"True\" IsLastFocusedDocument=\"True\" ContentId=\"FlameGraph\" FloatingLeft=\"2320\" FloatingTop=\"548\" FloatingWidth=\"2561\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:36:55\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"6\" />\n        </LayoutDocumentPane>\n      </LayoutDocumentPaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"385\" DockMinWidth=\"50\" FloatingWidth=\"400\">\n        <LayoutAnchorablePane Id=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\" />\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n    <LayoutPanel Orientation=\"Horizontal\" DockHeight=\"280\" DockMinHeight=\"50\" FloatingHeight=\"280\">\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"0.6454491374182034*\">\n        <LayoutAnchorablePane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Summary\" IsSelected=\"True\" ContentId=\"Sections\" FloatingWidth=\"400\" LastActivationTimeStamp=\"11/30/2023 12:26:08\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Definition\" ContentId=\"Definition\" />\n\t\t  <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Notes\" ContentId=\"Notes\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Developer\" ContentId=\"Developer\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"1.3545508625817966*\" DockMinHeight=\"200\">\n        <LayoutAnchorablePane Id=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" DockWidth=\"0.9103641456582633*\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Timeline\" IsSelected=\"True\" ContentId=\"Timeline\" LastActivationTimeStamp=\"11/30/2023 12:37:05\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Source File\" ContentId=\"SourceFile\" FloatingLeft=\"1335\" FloatingTop=\"1150\" FloatingWidth=\"1691\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:36:58\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Caller/Callee\" ContentId=\"CallerCallee\" FloatingLeft=\"1437\" FloatingTop=\"1150\" FloatingWidth=\"848\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:37:01\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Call Tree\" ContentId=\"CallTree\" FloatingLeft=\"1524\" FloatingTop=\"965\" FloatingWidth=\"848\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:37:04\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"References\" ContentId=\"ReferencesPanelHost\" LastActivationTimeStamp=\"11/28/2023 09:12:55\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Bookmarks\" ContentId=\"Bookmarks\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Search Results\" ContentId=\"SearchResults\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n  </RootPanel>\n  <TopSide />\n  <RightSide>\n    <LayoutAnchorGroup PreviousContainerId=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\">\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flow Graph\" ContentId=\"FlowGraph\" LastActivationTimeStamp=\"11/28/2023 09:13:01\" />\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Dominator Tree\" ContentId=\"DominatorTree\" />\n      <LayoutAnchorable CanHide=\"False\" CanAutoHide=\"False\" AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" CanDockAsTabbedDocument=\"False\" Title=\"Expression Graph\" ContentId=\"ExpressionGraph\" />\n    </LayoutAnchorGroup>\n  </RightSide>\n  <LeftSide />\n  <BottomSide />\n  <FloatingWindows />\n  <Hidden />\n</LayoutRoot>"
  },
  {
    "path": "resources/workspaces/Profiling - Source.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LayoutRoot>\n  <RootPanel Orientation=\"Vertical\">\n    <LayoutPanel Orientation=\"Horizontal\">\n      <LayoutDocumentPaneGroup Orientation=\"Horizontal\" DockWidth=\"8.09779405224301*\" IsMaximized=\"True\">\n        <LayoutDocumentPane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flame Graph\" IsSelected=\"True\" IsLastFocusedDocument=\"True\" ContentId=\"FlameGraph\" FloatingLeft=\"2320\" FloatingTop=\"548\" FloatingWidth=\"2561\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:58:55\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"6\" />\n        </LayoutDocumentPane>\n      </LayoutDocumentPaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"671\" FloatingWidth=\"1691\" FloatingHeight=\"290\" FloatingLeft=\"1935\" FloatingTop=\"520\">\n        <LayoutAnchorablePane DockWidth=\"671\" FloatingWidth=\"1691\" FloatingHeight=\"290\" FloatingLeft=\"1935\" FloatingTop=\"520\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Source File\" IsSelected=\"True\" ContentId=\"SourceFile\" FloatingLeft=\"1935\" FloatingTop=\"520\" FloatingWidth=\"1691\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:55:18\" PreviousContainerId=\"87eaafb6-ba9d-4475-9f8e-f1662a070b13\" PreviousContainerIndex=\"0\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"385\" DockMinWidth=\"50\" FloatingWidth=\"400\">\n        <LayoutAnchorablePane Id=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\" />\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n    <LayoutPanel Orientation=\"Horizontal\" DockHeight=\"280\" DockMinHeight=\"50\" FloatingHeight=\"280\">\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"0.6454491374182034*\">\n        <LayoutAnchorablePane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Summary\" IsSelected=\"True\" ContentId=\"Sections\" FloatingWidth=\"400\" LastActivationTimeStamp=\"11/30/2023 12:40:28\" />\n\t      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Notes\" ContentId=\"Notes\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Definition\" ContentId=\"Definition\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Developer\" ContentId=\"Developer\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"1.3545508625817966*\" DockMinHeight=\"200\">\n        <LayoutAnchorablePane Id=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" DockWidth=\"0.9103641456582633*\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Timeline\" IsSelected=\"True\" ContentId=\"Timeline\" LastActivationTimeStamp=\"11/30/2023 12:26:01\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"References\" ContentId=\"ReferencesPanelHost\" LastActivationTimeStamp=\"11/28/2023 09:12:55\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Bookmarks\" ContentId=\"Bookmarks\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Search Results\" ContentId=\"SearchResults\" />\n        </LayoutAnchorablePane>\n        <LayoutAnchorablePane Id=\"87eaafb6-ba9d-4475-9f8e-f1662a070b13\" DockWidth=\"1.0896358543417366*\" FloatingWidth=\"848\" FloatingHeight=\"290\" FloatingLeft=\"2489\" FloatingTop=\"1063\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Caller/Callee\" IsSelected=\"True\" ContentId=\"CallerCallee\" FloatingLeft=\"2489\" FloatingTop=\"1063\" FloatingWidth=\"848\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:40:22\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"1\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Call Tree\" ContentId=\"CallTree\" FloatingLeft=\"2896\" FloatingTop=\"1102\" FloatingWidth=\"567\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:26:04\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"2\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n  </RootPanel>\n  <TopSide />\n  <RightSide>\n    <LayoutAnchorGroup PreviousContainerId=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\">\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flow Graph\" ContentId=\"FlowGraph\" LastActivationTimeStamp=\"11/28/2023 09:13:01\" />\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Dominator Tree\" ContentId=\"DominatorTree\" />\n      <LayoutAnchorable CanHide=\"False\" CanAutoHide=\"False\" AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" CanDockAsTabbedDocument=\"False\" Title=\"Expression Graph\" ContentId=\"ExpressionGraph\" />\n    </LayoutAnchorGroup>\n  </RightSide>\n  <LeftSide />\n  <BottomSide />\n  <FloatingWindows />\n  <Hidden />\n</LayoutRoot>"
  },
  {
    "path": "resources/workspaces/Profiling - Wide Alt.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LayoutRoot>\n  <RootPanel Orientation=\"Vertical\">\n    <LayoutPanel Orientation=\"Horizontal\" DockHeight=\"0.966984126984127*\">\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"824.5\" FloatingWidth=\"961\" FloatingHeight=\"290\" FloatingLeft=\"766\" FloatingTop=\"450.5\">\n        <LayoutAnchorablePane Id=\"0591fedc-8df3-40da-95f4-daa204df6824\" DockWidth=\"824.5\" FloatingWidth=\"961\" FloatingHeight=\"290\" FloatingLeft=\"766\" FloatingTop=\"450.5\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Summary\" IsSelected=\"True\" ContentId=\"Sections\" FloatingLeft=\"766\" FloatingTop=\"450.5\" FloatingWidth=\"961\" FloatingHeight=\"290\" LastActivationTimeStamp=\"12/01/2023 12:55:10\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Definition\" ContentId=\"Definition\" FloatingLeft=\"766\" FloatingTop=\"450.5\" FloatingWidth=\"961\" FloatingHeight=\"290\" />\n\t\t  <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Notes\" ContentId=\"Notes\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Developer\" ContentId=\"Developer\" FloatingLeft=\"766\" FloatingTop=\"450.5\" FloatingWidth=\"961\" FloatingHeight=\"290\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n      <LayoutPanel Orientation=\"Vertical\" DockWidth=\"0.8697270471464021*\">\n        <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockHeight=\"266\" FloatingWidth=\"641\" FloatingHeight=\"290\" FloatingLeft=\"1035\" FloatingTop=\"361\">\n          <LayoutAnchorablePane DockHeight=\"266\" FloatingWidth=\"641\" FloatingHeight=\"290\" FloatingLeft=\"1035\" FloatingTop=\"361\">\n            <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Timeline\" IsSelected=\"True\" ContentId=\"Timeline\" FloatingLeft=\"1035\" FloatingTop=\"361\" FloatingWidth=\"641\" FloatingHeight=\"290\" LastActivationTimeStamp=\"12/01/2023 12:53:49\" PreviousContainerId=\"5c894cd9-041a-4af2-8160-0d903012df90\" PreviousContainerIndex=\"0\" />\n          </LayoutAnchorablePane>\n        </LayoutAnchorablePaneGroup>\n        <LayoutDocumentPaneGroup Orientation=\"Horizontal\" DockWidth=\"1.3112798264642083*\" DockHeight=\"1.0019436345966959*\" IsMaximized=\"True\">\n          <LayoutDocumentPane>\n            <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flame Graph\" IsSelected=\"True\" IsLastFocusedDocument=\"True\" ContentId=\"FlameGraph\" FloatingLeft=\"404\" FloatingTop=\"190\" FloatingWidth=\"641\" FloatingHeight=\"290\" LastActivationTimeStamp=\"12/01/2023 12:54:48\" PreviousContainerId=\"5c894cd9-041a-4af2-8160-0d903012df90\" PreviousContainerIndex=\"6\" />\n          </LayoutDocumentPane>\n        </LayoutDocumentPaneGroup>\n      </LayoutPanel>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"450\" DockMinWidth=\"50\" FloatingWidth=\"400\">\n        <LayoutAnchorablePane Id=\"205b35ed-30a1-4d7b-831a-8bfbf8ed8673\" />\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n    <LayoutPanel Orientation=\"Horizontal\" DockHeight=\"306\" DockMinHeight=\"50\" FloatingHeight=\"280\">\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockMinHeight=\"200\">\n        <LayoutAnchorablePane Id=\"5c894cd9-041a-4af2-8160-0d903012df90\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Source File\" IsSelected=\"True\" ContentId=\"SourceFile\" ToolTip=\"D:\\work\\bench\\bench\\bench.cpp\" FloatingLeft=\"693.3333333333333\" FloatingTop=\"629.6666666666666\" FloatingWidth=\"628\" FloatingHeight=\"290\" LastActivationTimeStamp=\"12/01/2023 12:55:08\" PreviousContainerId=\"5c894cd9-041a-4af2-8160-0d903012df90\" PreviousContainerIndex=\"3\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"References\" ContentId=\"ReferencesPanelHost\" LastActivationTimeStamp=\"11/26/2023 21:07:08\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Bookmarks\" ContentId=\"Bookmarks\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Search Results\" ContentId=\"SearchResults\" />\n        </LayoutAnchorablePane>\n        <LayoutAnchorablePane FloatingWidth=\"1892\" FloatingHeight=\"290\" FloatingLeft=\"998.5\" FloatingTop=\"974.5\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Caller/Callee\" IsSelected=\"True\" ContentId=\"CallerCallee\" FloatingLeft=\"998.5\" FloatingTop=\"974.5\" FloatingWidth=\"1892\" FloatingHeight=\"290\" LastActivationTimeStamp=\"12/01/2023 12:55:07\" PreviousContainerId=\"5c894cd9-041a-4af2-8160-0d903012df90\" PreviousContainerIndex=\"3\" />\n        </LayoutAnchorablePane>\n        <LayoutAnchorablePane FloatingWidth=\"948\" FloatingHeight=\"290\" FloatingLeft=\"1437\" FloatingTop=\"975\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Call Tree\" IsSelected=\"True\" ContentId=\"CallTree\" FloatingLeft=\"1437\" FloatingTop=\"975\" FloatingWidth=\"948\" FloatingHeight=\"290\" LastActivationTimeStamp=\"12/01/2023 12:53:03\" PreviousContainerId=\"5c894cd9-041a-4af2-8160-0d903012df90\" PreviousContainerIndex=\"2\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n  </RootPanel>\n  <TopSide />\n  <RightSide>\n    <LayoutAnchorGroup PreviousContainerId=\"205b35ed-30a1-4d7b-831a-8bfbf8ed8673\">\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flow Graph\" ContentId=\"FlowGraph\" />\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Dominator Tree\" ContentId=\"DominatorTree\" />\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Post-Dominator Tree\" ContentId=\"PostDominatorTree\" />\n      <LayoutAnchorable CanHide=\"False\" CanAutoHide=\"False\" AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" CanDockAsTabbedDocument=\"False\" Title=\"Expression Graph\" ContentId=\"ExpressionGraph\" />\n    </LayoutAnchorGroup>\n  </RightSide>\n  <LeftSide />\n  <BottomSide />\n  <FloatingWindows />\n  <Hidden />\n</LayoutRoot>"
  },
  {
    "path": "resources/workspaces/Profiling - Wide.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LayoutRoot>\n  <RootPanel Orientation=\"Vertical\">\n    <LayoutPanel Orientation=\"Horizontal\">\n      <LayoutDocumentPaneGroup Orientation=\"Horizontal\" DockWidth=\"1.0139724849527085*\" IsMaximized=\"True\">\n        <LayoutDocumentPane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flame Graph\" IsSelected=\"True\" IsLastFocusedDocument=\"True\" ContentId=\"FlameGraph\" FloatingLeft=\"2320\" FloatingTop=\"548\" FloatingWidth=\"2561\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:34:01\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"6\" />\n        </LayoutDocumentPane>\n      </LayoutDocumentPaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"385\" DockMinWidth=\"50\" FloatingWidth=\"400\">\n        <LayoutAnchorablePane Id=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\" />\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n    <LayoutPanel Orientation=\"Horizontal\" DockHeight=\"280\" DockMinHeight=\"50\" FloatingHeight=\"280\">\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"0.6454491374182034*\">\n        <LayoutAnchorablePane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Summary\" IsSelected=\"True\" ContentId=\"Sections\" FloatingWidth=\"400\" LastActivationTimeStamp=\"11/30/2023 12:26:08\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Definition\" ContentId=\"Definition\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Developer\" ContentId=\"Developer\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"1.3545508625817966*\" DockMinHeight=\"200\">\n        <LayoutAnchorablePane Id=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" DockWidth=\"0.9103641456582633*\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Timeline\" IsSelected=\"True\" ContentId=\"Timeline\" LastActivationTimeStamp=\"11/30/2023 12:26:01\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"References\" ContentId=\"ReferencesPanelHost\" LastActivationTimeStamp=\"11/28/2023 09:12:55\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Bookmarks\" ContentId=\"Bookmarks\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Search Results\" ContentId=\"SearchResults\" />\n        </LayoutAnchorablePane>\n        <LayoutAnchorablePane DockWidth=\"1.0896358543417366*\" FloatingWidth=\"848\" FloatingHeight=\"290\" FloatingLeft=\"2489\" FloatingTop=\"1063\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Caller/Callee\" IsSelected=\"True\" ContentId=\"CallerCallee\" FloatingLeft=\"2489\" FloatingTop=\"1063\" FloatingWidth=\"848\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:26:06\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"1\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Call Tree\" ContentId=\"CallTree\" FloatingLeft=\"2896\" FloatingTop=\"1102\" FloatingWidth=\"567\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:26:04\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"2\" />\n        </LayoutAnchorablePane>\n        <LayoutAnchorablePane FloatingWidth=\"1691\" FloatingHeight=\"290\" FloatingLeft=\"2928\" FloatingTop=\"1150\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Source File\" IsSelected=\"True\" ContentId=\"SourceFile\" FloatingLeft=\"2928\" FloatingTop=\"1150\" FloatingWidth=\"1691\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:25:26\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"1\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n  </RootPanel>\n  <TopSide />\n  <RightSide>\n    <LayoutAnchorGroup PreviousContainerId=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\">\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flow Graph\" ContentId=\"FlowGraph\" LastActivationTimeStamp=\"11/28/2023 09:13:01\" />\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Dominator Tree\" ContentId=\"DominatorTree\" />\n      <LayoutAnchorable CanHide=\"False\" CanAutoHide=\"False\" AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" CanDockAsTabbedDocument=\"False\" Title=\"Expression Graph\" ContentId=\"ExpressionGraph\" />\n    </LayoutAnchorGroup>\n  </RightSide>\n  <LeftSide />\n  <BottomSide />\n  <FloatingWindows />\n  <Hidden />\n</LayoutRoot>"
  },
  {
    "path": "resources/workspaces/Profiling.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LayoutRoot>\n  <RootPanel Orientation=\"Vertical\">\n    <LayoutPanel Orientation=\"Horizontal\">\n      <LayoutDocumentPaneGroup Orientation=\"Horizontal\" DockWidth=\"1.0139724849527085*\" IsMaximized=\"True\">\n        <LayoutDocumentPane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flame Graph\" IsSelected=\"True\" IsLastFocusedDocument=\"True\" ContentId=\"FlameGraph\" FloatingLeft=\"2320\" FloatingTop=\"548\" FloatingWidth=\"2561\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:27:23\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"6\" />\n        </LayoutDocumentPane>\n      </LayoutDocumentPaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"385\" DockMinWidth=\"50\" FloatingWidth=\"400\">\n        <LayoutAnchorablePane Id=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\" />\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n    <LayoutPanel Orientation=\"Horizontal\" DockHeight=\"280\" DockMinHeight=\"50\" FloatingHeight=\"280\">\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"0.6454491374182034*\">\n        <LayoutAnchorablePane>\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Summary\" IsSelected=\"True\" ContentId=\"Sections\" FloatingWidth=\"400\" LastActivationTimeStamp=\"11/30/2023 12:26:08\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Definition\" ContentId=\"Definition\" />\n\t\t  <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Notes\" ContentId=\"Notes\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Developer\" ContentId=\"Developer\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n      <LayoutAnchorablePaneGroup Orientation=\"Horizontal\" DockWidth=\"1.3545508625817966*\" DockMinHeight=\"200\">\n        <LayoutAnchorablePane Id=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" DockWidth=\"0.9103641456582633*\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Timeline\" IsSelected=\"True\" ContentId=\"Timeline\" LastActivationTimeStamp=\"11/30/2023 12:26:01\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"References\" ContentId=\"ReferencesPanelHost\" LastActivationTimeStamp=\"11/28/2023 09:12:55\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Bookmarks\" ContentId=\"Bookmarks\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Search Results\" ContentId=\"SearchResults\" />\n        </LayoutAnchorablePane>\n        <LayoutAnchorablePane DockWidth=\"1.0896358543417366*\" FloatingWidth=\"848\" FloatingHeight=\"290\" FloatingLeft=\"2489\" FloatingTop=\"1063\">\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Source File\" IsSelected=\"True\" ContentId=\"SourceFile\" FloatingLeft=\"2912\" FloatingTop=\"988\" FloatingWidth=\"1691\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:27:18\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Caller/Callee\" ContentId=\"CallerCallee\" FloatingLeft=\"2489\" FloatingTop=\"1063\" FloatingWidth=\"848\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:26:06\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"1\" />\n          <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Call Tree\" ContentId=\"CallTree\" FloatingLeft=\"2896\" FloatingTop=\"1102\" FloatingWidth=\"567\" FloatingHeight=\"290\" LastActivationTimeStamp=\"11/30/2023 12:26:04\" PreviousContainerId=\"40ed3bab-577b-421f-94a2-ea0190bf0ad4\" PreviousContainerIndex=\"2\" />\n        </LayoutAnchorablePane>\n      </LayoutAnchorablePaneGroup>\n    </LayoutPanel>\n  </RootPanel>\n  <TopSide />\n  <RightSide>\n    <LayoutAnchorGroup PreviousContainerId=\"730a38a0-d8e3-44f5-b64d-7bd6c6549462\">\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Flow Graph\" ContentId=\"FlowGraph\" LastActivationTimeStamp=\"11/28/2023 09:13:01\" />\n      <LayoutAnchorable AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" Title=\"Dominator Tree\" ContentId=\"DominatorTree\" />\n      <LayoutAnchorable CanHide=\"False\" CanAutoHide=\"False\" AutoHideMinWidth=\"100\" AutoHideMinHeight=\"100\" CanDockAsTabbedDocument=\"False\" Title=\"Expression Graph\" ContentId=\"ExpressionGraph\" />\n    </LayoutAnchorGroup>\n  </RightSide>\n  <LeftSide />\n  <BottomSide />\n  <FloatingWindows />\n  <Hidden />\n</LayoutRoot>"
  },
  {
    "path": "scripts/Analyze-DiagnosticLog.ps1",
    "content": "<#\n.SYNOPSIS\n    Analyzes Profile Explorer diagnostic log files to summarize symbol loading issues.\n\n.DESCRIPTION\n    This script parses Profile Explorer diagnostic logs (generated when PROFILE_EXPLORER_DEBUG=1)\n    and provides a comprehensive summary of symbol loading performance, failures, and recommendations.\n\n.PARAMETER LogPath\n    Path to the diagnostic log file. If not specified, uses the most recent log in %TEMP%.\n\n.EXAMPLE\n    .\\Analyze-DiagnosticLog.ps1\n    Analyzes the most recent diagnostic log.\n\n.EXAMPLE\n    .\\Analyze-DiagnosticLog.ps1 -LogPath \"C:\\temp\\ProfileExplorer_Diagnostic_20260109.log\"\n    Analyzes a specific log file.\n#>\n\nparam(\n    [string]$LogPath\n)\n\n# Find the most recent log if not specified\nif (-not $LogPath) {\n    $logFiles = Get-ChildItem \"$env:TEMP\\ProfileExplorer_Diagnostic_*.log\" -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending\n    if ($logFiles.Count -eq 0) {\n        Write-Host \"No diagnostic logs found in $env:TEMP\" -ForegroundColor Red\n        Write-Host \"Set PROFILE_EXPLORER_DEBUG=1 and load a trace to generate logs.\" -ForegroundColor Yellow\n        exit 1\n    }\n    $LogPath = $logFiles[0].FullName\n    Write-Host \"Using most recent log: $LogPath\" -ForegroundColor Cyan\n}\n\nif (-not (Test-Path $LogPath)) {\n    Write-Host \"Log file not found: $LogPath\" -ForegroundColor Red\n    exit 1\n}\n\nWrite-Host \"\"\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"  PROFILE EXPLORER DIAGNOSTIC LOG ANALYZER\" -ForegroundColor Cyan\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"\"\n\n$fileInfo = Get-Item $LogPath\nWrite-Host \"Log File: $LogPath\"\nWrite-Host \"Size: $([math]::Round($fileInfo.Length / 1MB, 2)) MB\"\nWrite-Host \"Created: $($fileInfo.CreationTime)\"\nWrite-Host \"\"\n\n# Read log file\nWrite-Host \"Reading log file...\" -ForegroundColor Gray\n$log = Get-Content $LogPath\n\n# ============================================================================\n# CRITICAL ERROR CHECK - DIA SDK Registration\n# ============================================================================\n$diaError = $log | Where-Object { $_ -match 'DIA SDK.*is not registered|msdia140\\.dll.*not registered|\\[CRITICAL\\].*DIA' } | Select-Object -First 1\nif ($diaError) {\n    Write-Host \"\"\n    Write-Host (\"!\" * 80) -ForegroundColor Red\n    Write-Host \"  CRITICAL ERROR: DIA SDK NOT REGISTERED\" -ForegroundColor Red\n    Write-Host (\"!\" * 80) -ForegroundColor Red\n    Write-Host \"\"\n    Write-Host \"  The DIA SDK (msdia140.dll) is not registered as a COM component.\" -ForegroundColor Red\n    Write-Host \"  This prevents ALL symbol resolution - no function names will be displayed.\" -ForegroundColor Red\n    Write-Host \"\"\n    Write-Host \"  TO FIX (run as Administrator):\" -ForegroundColor Yellow\n    Write-Host \"    regsvr32 `\"<ProfileExplorer_Install_Path>\\msdia140.dll`\"\" -ForegroundColor White\n    Write-Host \"\"\n    Write-Host \"  Or for dev builds:\" -ForegroundColor Yellow\n    Write-Host \"    regsvr32 `\"C:\\src\\profile-explorer\\src\\ProfileExplorerUI\\bin\\Release\\net8.0-windows\\msdia140.dll`\"\" -ForegroundColor White\n    Write-Host \"\"\n    Write-Host (\"!\" * 80) -ForegroundColor Red\n    Write-Host \"\"\n}\n\n# Categorize lines\n$infoLines = $log | Where-Object { $_ -match '\\[Information\\]' }\n$warningLines = $log | Where-Object { $_ -match '\\[Warning\\]' }\n$debugLines = $log | Where-Object { $_ -match '\\[Debug\\]' }\n$errorLines = $log | Where-Object { $_ -match '\\[Error\\]' }\n\n# ============================================================================\n# TRACE INFO & SYMBOL SERVER STATUS\n# ============================================================================\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  TRACE INFO & SYMBOL SERVER STATUS\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\n\n# Check for ImageID events\n$hasImageIdEvents = $log | Where-Object { $_ -match 'HasImageIdEvents=True' } | Select-Object -First 1\n$noImageIdEvents = $log | Where-Object { $_ -match 'HasImageIdEvents=False|Trace has no ImageID DbgID events' } | Select-Object -First 1\n$symbolServerDisabled = $log | Where-Object { $_ -match 'Symbol server disabled|Disabling symbol server|SourceServerEnabled=False' } | Select-Object -First 1\n$symbolServerEnabled = $log | Where-Object { $_ -match 'SourceServerEnabled=True' } | Select-Object -First 1\n\n# ImageID event counts - parse from log format:\n# \"[TraceLoad] Event counts: ImageLoad=X (Y with timestamp), ImageID=Z, ImageID_DbgID=W\"\n$imageLoadCount = 0\n$imageIdCount = 0\n$dbgIdCount = 0\n\n$eventCountLine = $log | Where-Object { $_ -match '\\[TraceLoad\\] Event counts:' } | Select-Object -First 1\nif ($eventCountLine) {\n    if ($eventCountLine -match 'ImageLoad=(\\d+)') {\n        $imageLoadCount = [int]$Matches[1]\n    }\n    if ($eventCountLine -match 'ImageID=(\\d+)') {\n        $imageIdCount = [int]$Matches[1]\n    }\n    if ($eventCountLine -match 'ImageID_DbgID=(\\d+)') {\n        $dbgIdCount = [int]$Matches[1]\n    }\n}\n\n# Parse Microsoft module info from [SymbolLoading] logs\n# Format: \"[SymbolLoading]   1. modulename.dll: 12345 samples [Microsoft]\"\n$microsoftModules = @{}\n$log | Where-Object { $_ -match '\\[SymbolLoading\\].*\\d+\\.\\s+([^:]+):\\s+\\d+\\s+samples' } | ForEach-Object {\n    if ($_ -match '\\[SymbolLoading\\].*\\d+\\.\\s+([^:]+):\\s+(\\d+)\\s+samples(.*)$') {\n        $moduleName = $Matches[1].Trim()\n        $isMicrosoft = $Matches[3] -match '\\[Microsoft\\]'\n        $microsoftModules[$moduleName.ToLower()] = $isMicrosoft\n    }\n}\n\nWrite-Host \"\"\n# Only report \"MISSING\" if we explicitly found evidence of missing events\n# (not just because we couldn't parse the count)\n$knownMissing = $noImageIdEvents -or ($eventCountLine -and $dbgIdCount -eq 0)\n$knownPresent = $hasImageIdEvents -or ($eventCountLine -and $dbgIdCount -gt 0)\n\nif ($knownMissing) {\n    Write-Host \"[!] MISSING ImageID DbgID EVENTS\" -ForegroundColor Red\n    Write-Host \"    This trace is missing ImageID DbgID (RSDS) events which contain PDB GUID/Age.\" -ForegroundColor Yellow\n    Write-Host \"    Without these events, symbol server lookups are impossible because PDB matching\" -ForegroundColor Yellow\n    Write-Host \"    requires the exact GUID+Age from the trace (not extracted from binaries).\" -ForegroundColor Yellow\n    Write-Host \"\"\n    Write-Host \"    Root cause: The trace was likely captured without the right ETW providers enabled.\" -ForegroundColor Gray\n    Write-Host \"    Solution: Re-capture using Profile Explorer's built-in capture (File -> Record Profile)\" -ForegroundColor Cyan\n    Write-Host \"              or from command line: wpr -start CPU\" -ForegroundColor Cyan\n    Write-Host \"\"\n} elseif ($knownPresent) {\n    Write-Host \"[OK] Trace has ImageID DbgID events (PDB GUID/Age available)\" -ForegroundColor Green\n    if ($dbgIdCount -gt 0) {\n        Write-Host \"     ImageID_DbgID event count: $dbgIdCount\" -ForegroundColor Gray\n    }\n} else {\n    Write-Host \"[?] Could not determine ImageID event status from log\" -ForegroundColor Yellow\n}\n\nif ($symbolServerDisabled) {\n    Write-Host \"[!] SYMBOL SERVER DISABLED\" -ForegroundColor Yellow\n    Write-Host \"    Symbol server lookups were disabled (either by user or due to missing ImageID events).\" -ForegroundColor Gray\n    Write-Host \"    Only local/cached symbols will be used.\" -ForegroundColor Gray\n    Write-Host \"\"\n} elseif ($symbolServerEnabled) {\n    Write-Host \"[OK] Symbol server enabled\" -ForegroundColor Green\n}\n\nWrite-Host \"\"\n\n# ============================================================================\n# PHASE TIMING ANALYSIS\n# ============================================================================\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  PHASE TIMING ANALYSIS\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\n\n# Find phase markers\n$loadStart = $log | Where-Object { $_ -match 'Starting LoadBinaryAndDebugFiles' } | Select-Object -First 1\n$loadComplete = $log | Where-Object { $_ -match 'LoadBinaryAndDebugFiles completed' } | Select-Object -First 1\n$binaryPhaseStart = $log | Where-Object { $_ -match 'Binary download phase: Started' } | Select-Object -First 1\n$binaryPhaseEnd = $log | Where-Object { $_ -match 'All binary downloads completed|Binary download complete' } | Select-Object -First 1\n$pdbPhaseStart = $log | Where-Object { $_ -match 'PDB download phase: Started' } | Select-Object -First 1\n$pdbPhaseEnd = $log | Where-Object { $_ -match 'All PDB downloads completed|PDB download complete' } | Select-Object -First 1\n\nfunction Get-TimestampFromLine($line) {\n    if ($line -match '^(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3})') {\n        return [datetime]::ParseExact($Matches[1], \"yyyy-MM-dd HH:mm:ss.fff\", $null)\n    }\n    return $null\n}\n\n$startTime = Get-TimestampFromLine $loadStart\n$endTime = Get-TimestampFromLine $loadComplete\n$binStartTime = Get-TimestampFromLine $binaryPhaseStart\n$binEndTime = Get-TimestampFromLine $binaryPhaseEnd\n$pdbStartTime = Get-TimestampFromLine $pdbPhaseStart\n$pdbEndTime = Get-TimestampFromLine $pdbPhaseEnd\n\n# Extract embedded time from log if available: \"LoadBinaryAndDebugFiles completed in X.Xs\"\n$loadCompleteEmbeddedTime = $null\nif ($loadComplete -match 'completed in (\\d+\\.?\\d*)s') {\n    $loadCompleteEmbeddedTime = [double]$Matches[1]\n}\n\n# Calculate total time - use embedded time, or timestamp diff, but sanity check against PDB time later\n$totalTime = $null\nif ($loadCompleteEmbeddedTime) {\n    $totalTime = $loadCompleteEmbeddedTime\n} elseif ($startTime -and $endTime) {\n    $totalTime = ($endTime - $startTime).TotalSeconds\n}\n\nif ($binStartTime -and $binEndTime) {\n    $binTime = ($binEndTime - $binStartTime).TotalSeconds\n    Write-Host \"  Binary Download Phase:   \" -NoNewline\n    Write-Host (\"{0:F1}s\" -f $binTime) -ForegroundColor $(if ($binTime -gt 60) { \"Red\" } elseif ($binTime -gt 30) { \"Yellow\" } else { \"Green\" })\n}\n\n# Calculate PDB/Symbol loading time\n# Try multiple approaches since log format may vary\n\n# Approach 1: Find time from \"Starting PDB/symbol file search\" to last PDBDebugInfo BEFORE lazy load\n$pdbStartLine = $log | Where-Object { $_ -match '\\[SymbolLoading\\].*Starting PDB' } | Select-Object -First 1\n$pdbStartTs = Get-TimestampFromLine $pdbStartLine\n\n# Find the line index where lazy load starts (if any) - we only want PDBDebugInfo before this\n$lazyLoadLineIndex = $null\nfor ($i = 0; $i -lt $log.Count; $i++) {\n    if ($log[$i] -match '\\[LazyBinaryLoad\\]') {\n        $lazyLoadLineIndex = $i\n        break\n    }\n}\n\n# Get last PDBDebugInfo line BEFORE lazy load (or last overall if no lazy load)\n$pdbEndLine = $null\nif ($lazyLoadLineIndex) {\n    $pdbEndLine = $log[0..($lazyLoadLineIndex-1)] | Where-Object { $_ -match '\\[PDBDebugInfo\\]' } | Select-Object -Last 1\n} else {\n    $pdbEndLine = $log | Where-Object { $_ -match '\\[PDBDebugInfo\\]' } | Select-Object -Last 1\n}\n$pdbEndTs = Get-TimestampFromLine $pdbEndLine\n\n# Approach 2: Try to extract embedded time from log message\n$pdbTimeLine = $log | Where-Object { $_ -match 'PDB downloads? completed? in (\\d+\\.?\\d*)s|PDB download complete:.*in (\\d+\\.?\\d*)s' } | Select-Object -First 1\n$pdbEmbeddedTime = $null\nif ($pdbTimeLine -match 'in (\\d+\\.?\\d*)s') {\n    $pdbEmbeddedTime = [double]$Matches[1]\n}\n\n$pdbTime = $null\nif ($pdbStartTs -and $pdbEndTs) {\n    $pdbTime = ($pdbEndTs - $pdbStartTs).TotalSeconds\n} elseif ($pdbEmbeddedTime) {\n    $pdbTime = $pdbEmbeddedTime\n}\n\n# Display timing - use PDB time as authoritative if total time seems wrong\nif ($pdbTime -and $pdbTime -gt 0.5) {\n    # If total time < PDB time, use PDB time as total (old logs may have wrong embedded time)\n    if ($totalTime -and $totalTime -lt $pdbTime) {\n        $totalTime = $pdbTime\n    }\n}\n\nif ($totalTime -and $totalTime -gt 0.5) {\n    Write-Host \"Total Symbol Loading Time: \" -NoNewline\n    Write-Host (\"{0:F1}s\" -f $totalTime) -ForegroundColor $(if ($totalTime -gt 120) { \"Red\" } elseif ($totalTime -gt 60) { \"Yellow\" } else { \"Green\" })\n}\n\nif ($pdbTime -and $pdbTime -gt 0.5) {\n    Write-Host \"  PDB/Symbol Loading:      \" -NoNewline\n    Write-Host (\"{0:F1}s\" -f $pdbTime) -ForegroundColor $(if ($pdbTime -gt 60) { \"Red\" } elseif ($pdbTime -gt 30) { \"Yellow\" } else { \"Green\" })\n}\n\n# Count timeouts vs successes\n$binaryTimeouts = ($log | Where-Object { $_ -match '\\[BinarySearch\\] TIMEOUT' }).Count\n$binaryFound = ($log | Where-Object { $_ -match '\\[BinarySearch\\] Found binary for' }).Count\n$binaryFailed = ($log | Where-Object { $_ -match '\\[BinarySearch\\] Failed to find binary' }).Count\n$binarySkipped = ($log | Where-Object { $_ -match '\\[BinarySearch\\] SKIPPED' }).Count\n$binarySkippedDisabled = ($log | Where-Object { $_ -match '\\[SymbolLoading\\] Symbol server disabled - skipping binary downloads' }).Count\n\n$pdbTimeouts = ($log | Where-Object { $_ -match '\\[SymbolSearch\\] TIMEOUT' }).Count\n$pdbFound = ($log | Where-Object { $_ -match '\\[SymbolSearch\\] Successfully found symbol' }).Count\n$pdbFailed = ($log | Where-Object { $_ -match '\\[SymbolSearch\\] Failed to find symbol' }).Count\n$pdbSkipped = ($log | Where-Object { $_ -match '\\[SymbolLoading\\] Skipping PDB lookup' }).Count\n$pdbSkippedDisabled = ($log | Where-Object { $_ -match '\\[SymbolLoading\\] Symbol server disabled' }).Count\n\nWrite-Host \"\"\nWrite-Host \"Binary Search Results:\" -ForegroundColor Cyan\nif ($binarySkippedDisabled -gt 0) {\n    Write-Host \"  [Symbol server disabled - all downloads skipped]\" -ForegroundColor Yellow\n} else {\n    Write-Host \"  Found:    $binaryFound\" -ForegroundColor Green\n    Write-Host \"  Failed:   $binaryFailed\" -ForegroundColor Yellow\n    Write-Host \"  Timeouts: $binaryTimeouts\" -ForegroundColor $(if ($binaryTimeouts -gt 10) { \"Red\" } else { \"Yellow\" })\n    Write-Host \"  Skipped:  $binarySkipped\" -ForegroundColor Gray\n}\n\nWrite-Host \"\"\nWrite-Host \"PDB Search Results:\" -ForegroundColor Cyan\nif ($pdbSkippedDisabled -gt 0 -and $pdbFound -eq 0) {\n    Write-Host \"  [Symbol server disabled - no PDB lookups attempted]\" -ForegroundColor Yellow\n} else {\n    Write-Host \"  Found:    $pdbFound\" -ForegroundColor Green\n    Write-Host \"  Failed:   $pdbFailed\" -ForegroundColor Yellow\n    Write-Host \"  Timeouts: $pdbTimeouts\" -ForegroundColor $(if ($pdbTimeouts -gt 10) { \"Red\" } else { \"Yellow\" })\n    Write-Host \"  Skipped (company filter): $pdbSkipped\" -ForegroundColor Gray\n}\n\nWrite-Host \"\"\n\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  LOG STATISTICS\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"Total Lines:    $($log.Count)\"\nWrite-Host \"  Information:  $($infoLines.Count)\" -ForegroundColor Green\nWrite-Host \"  Warnings:     $($warningLines.Count)\" -ForegroundColor Yellow\nWrite-Host \"  Debug:        $($debugLines.Count)\" -ForegroundColor Gray\nWrite-Host \"  Errors:       $($errorLines.Count)\" -ForegroundColor Red\nWrite-Host \"\"\n\n# Analyze NOT_RESOLVED failures\n$notResolved = $warningLines | Where-Object { $_ -match 'NOT_RESOLVED' }\n$failedModules = @{}\n$notResolved | ForEach-Object {\n    if ($_ -match 'Module: ([^,]+),') {\n        $module = $Matches[1]\n        if ($failedModules.ContainsKey($module)) {\n            $failedModules[$module]++\n        } else {\n            $failedModules[$module] = 1\n        }\n    }\n}\n\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  SYMBOL RESOLUTION FAILURES\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"Total unresolved symbols: $($notResolved.Count)\" -ForegroundColor Red\nWrite-Host \"Unique modules with failures: $($failedModules.Count)\"\nWrite-Host \"\"\n\n# Top failed modules\nWrite-Host \"Top 30 Modules Missing Symbols:\" -ForegroundColor Yellow\nWrite-Host \"\"\n$sortedFailures = $failedModules.GetEnumerator() | Sort-Object Value -Descending | Select-Object -First 30\n$totalFailures = ($failedModules.Values | Measure-Object -Sum).Sum\n\nforeach ($item in $sortedFailures) {\n    $pct = [math]::Round(($item.Value / $totalFailures) * 100, 1)\n    $bar = \"#\" * [math]::Min([int]($pct / 2), 40)\n    $color = if ($item.Value -gt 500) { \"Red\" } elseif ($item.Value -gt 100) { \"Yellow\" } else { \"White\" }\n    Write-Host (\"{0,6} ({1,5}%) {2,-30} {3}\" -f $item.Value, $pct, $item.Key, $bar) -ForegroundColor $color\n}\n\n# Analyze successful resolutions\n$resolved = $infoLines | Where-Object { $_ -match 'resolved via debug info|found in cache|found via PDB query' }\n$successModules = @{}\n$resolved | ForEach-Object {\n    if ($_ -match 'Module: ([^,]+),') {\n        $module = $Matches[1]\n        if ($successModules.ContainsKey($module)) {\n            $successModules[$module]++\n        } else {\n            $successModules[$module] = 1\n        }\n    }\n}\n\nWrite-Host \"\"\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  SUCCESSFUL SYMBOL RESOLUTION\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"Total resolved symbols: $($resolved.Count)\" -ForegroundColor Green\nWrite-Host \"\"\n\nWrite-Host \"Top 20 Modules With Symbols:\" -ForegroundColor Green\n$sortedSuccess = $successModules.GetEnumerator() | Sort-Object Value -Descending | Select-Object -First 20\nforeach ($item in $sortedSuccess) {\n    Write-Host (\"{0,6} - {1}\" -f $item.Value, $item.Key) -ForegroundColor Green\n}\n\n# Analyze binary loading times\n$slowBinaries = $log | Where-Object { $_ -match '\\[BinaryLoading\\].*Duration:' }\n$binaryTimes = @{}\n$slowBinaries | ForEach-Object {\n    if ($_ -match 'Binary: ([^,]+).*Duration: (\\d+)ms') {\n        $binary = $Matches[1]\n        $duration = [int]$Matches[2]\n        if (-not $binaryTimes.ContainsKey($binary) -or $binaryTimes[$binary] -lt $duration) {\n            $binaryTimes[$binary] = $duration\n        }\n    }\n}\n\nif ($binaryTimes.Count -gt 0) {\n    Write-Host \"\"\n    Write-Host (\"-\" * 80) -ForegroundColor DarkGray\n    Write-Host \"  SLOW BINARY LOADING (>500ms)\" -ForegroundColor Yellow\n    Write-Host (\"-\" * 80) -ForegroundColor DarkGray\n    \n    $slowest = $binaryTimes.GetEnumerator() | Where-Object { $_.Value -gt 500 } | Sort-Object Value -Descending | Select-Object -First 20\n    if ($slowest.Count -gt 0) {\n        foreach ($item in $slowest) {\n            $secs = [math]::Round($item.Value / 1000, 2)\n            $color = if ($item.Value -gt 5000) { \"Red\" } elseif ($item.Value -gt 2000) { \"Yellow\" } else { \"White\" }\n            Write-Host (\"{0,8}ms ({1,5}s) - {2}\" -f $item.Value, $secs, $item.Key) -ForegroundColor $color\n        }\n    } else {\n        Write-Host \"No slow binary loads detected.\" -ForegroundColor Green\n    }\n}\n\n# Analyze PDB loading\n$pdbLoads = $log | Where-Object { $_ -match '\\[PDBDebugInfo\\]' }\n$pdbCacheHits = ($pdbLoads | Where-Object { $_ -match 'found in cache' }).Count\n$pdbQueries = ($pdbLoads | Where-Object { $_ -match 'found via PDB query' }).Count\n$pdbAlreadyLoaded = ($pdbLoads | Where-Object { $_ -match 'already loaded' }).Count\n\nWrite-Host \"\"\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  PDB LOADING EFFICIENCY\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"PDB Cache Hits:     $pdbCacheHits\" -ForegroundColor Green\nWrite-Host \"PDB Queries:        $pdbQueries\" -ForegroundColor Cyan\nWrite-Host \"PDB Already Loaded: $pdbAlreadyLoaded\" -ForegroundColor Green\n\n$totalPdbOps = $pdbCacheHits + $pdbQueries + $pdbAlreadyLoaded\nif ($totalPdbOps -gt 0) {\n    $cacheRate = [math]::Round((($pdbCacheHits + $pdbAlreadyLoaded) / $totalPdbOps) * 100, 1)\n    Write-Host \"Cache Hit Rate:     $cacheRate%\" -ForegroundColor $(if ($cacheRate -gt 80) { \"Green\" } else { \"Yellow\" })\n}\n\n# Module initialization analysis\n$moduleInits = $log | Where-Object { $_ -match '\\[ModuleInit\\]' }\n$modulesWithDebugInfo = ($moduleInits | Where-Object { $_ -match 'HasDebugInfo=True' }).Count\n$modulesWithoutDebugInfo = ($moduleInits | Where-Object { $_ -match 'HasDebugInfo=False' }).Count\n\nWrite-Host \"\"\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  MODULE INITIALIZATION\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"Modules With Debug Info:    $modulesWithDebugInfo\" -ForegroundColor Green\nWrite-Host \"Modules Without Debug Info: $modulesWithoutDebugInfo\" -ForegroundColor Yellow\n\n# Categorize failed modules\nWrite-Host \"\"\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  MODULE CATEGORIES\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\n\n$kernelModules = @()\n$microsoftOtherModules = @()\n$driverModules = @()\n$thirdPartyModules = @()\n\nforeach ($module in $failedModules.Keys) {\n    $count = $failedModules[$module]\n    $moduleLower = $module.ToLower()\n\n    # Check if module is marked as Microsoft from trace FileVersion events\n    $isMicrosoftFromTrace = $microsoftModules.ContainsKey($moduleLower) -and $microsoftModules[$moduleLower]\n\n    # Fallback to name-based heuristics if no trace info\n    $isMicrosoftByName = $module -match '^Windows\\.|^Microsoft\\.|explorer\\.exe|shell32|combase|ExplorerFrame|dui70|duser|thumbcache|twinui|dwm|dcomp|CoreMessaging'\n\n    $isMicrosoft = $isMicrosoftFromTrace -or $isMicrosoftByName\n\n    if ($module -match 'ntoskrnl|ntkrnl|hal\\.dll') {\n        $kernelModules += [PSCustomObject]@{Name=$module; Count=$count; IsMicrosoft=$true}\n    } elseif ($module -match '\\.sys$') {\n        $driverModules += [PSCustomObject]@{Name=$module; Count=$count; IsMicrosoft=$isMicrosoft}\n    } elseif ($isMicrosoft) {\n        $microsoftOtherModules += [PSCustomObject]@{Name=$module; Count=$count; IsMicrosoft=$true}\n    } else {\n        $thirdPartyModules += [PSCustomObject]@{Name=$module; Count=$count; IsMicrosoft=$false}\n    }\n}\n\n$kernelTotal = ($kernelModules | Measure-Object -Property Count -Sum).Sum\n$microsoftTotal = ($microsoftOtherModules | Measure-Object -Property Count -Sum).Sum\n$driverTotal = ($driverModules | Measure-Object -Property Count -Sum).Sum\n$thirdPartyTotal = ($thirdPartyModules | Measure-Object -Property Count -Sum).Sum\n$msDriverCount = ($driverModules | Where-Object { $_.IsMicrosoft } | Measure-Object).Count\n\nWrite-Host \"\"\nWrite-Host \"Kernel/NT:     $kernelTotal failures in $($kernelModules.Count) modules\" -ForegroundColor Red\nWrite-Host \"Microsoft:     $microsoftTotal failures in $($microsoftOtherModules.Count) modules\" -ForegroundColor Yellow\nWrite-Host \"Drivers:       $driverTotal failures in $($driverModules.Count) modules ($msDriverCount Microsoft)\" -ForegroundColor Yellow\nWrite-Host \"Third-Party:   $thirdPartyTotal failures in $($thirdPartyModules.Count) modules\" -ForegroundColor White\n\n# Extract symbol path from log\n$symbolPathLine = $log | Where-Object { $_ -match '\\[SymbolSearch\\] Symbol search path:' } | Select-Object -First 1\n$symbolPath = \"\"\nif ($symbolPathLine -match 'Symbol search path:\\s*(.+)$') {\n    $symbolPath = $Matches[1].Trim()\n}\n\n# Recommendations\nWrite-Host \"\"\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"  SYMBOL CONFIGURATION\" -ForegroundColor Cyan\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"\"\n\nif ($symbolPath) {\n    Write-Host \"Symbol Path Used:\" -ForegroundColor Cyan\n    # Split on semicolons and display each part\n    $symbolPath -split ';' | Where-Object { $_.Trim() } | ForEach-Object {\n        Write-Host \"  - $_\" -ForegroundColor White\n    }\n    Write-Host \"\"\n} else {\n    Write-Host \"[!] Could not determine symbol path from log\" -ForegroundColor Yellow\n    Write-Host \"\"\n}\n\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"  RECOMMENDATIONS\" -ForegroundColor Cyan\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"\"\n\nif ($failedModules.ContainsKey(\"ntoskrnl.exe\") -and $failedModules[\"ntoskrnl.exe\"] -gt 100) {\n    Write-Host \"[!] \" -NoNewline -ForegroundColor Red\n    Write-Host \"High ntoskrnl.exe failures ($($failedModules['ntoskrnl.exe'])). Kernel symbols not resolving.\"\n    Write-Host \"    This binary may not have public symbols, or the symbol server is timing out.\"\n    Write-Host \"\"\n}\n\nif ($failedModules.ContainsKey(\"combase.dll\") -and $failedModules[\"combase.dll\"] -gt 100) {\n    Write-Host \"[!] \" -NoNewline -ForegroundColor Red\n    Write-Host \"High combase.dll failures ($($failedModules['combase.dll'])). COM infrastructure symbols missing.\"\n    Write-Host \"    Verify this binary version has symbols available on your configured symbol server.\"\n    Write-Host \"\"\n}\n\nif ($failedModules.ContainsKey(\"explorer.exe\") -and $failedModules[\"explorer.exe\"] -gt 50) {\n    Write-Host \"[!] \" -NoNewline -ForegroundColor Yellow\n    Write-Host \"explorer.exe symbols missing ($($failedModules['explorer.exe'])). Profile is for explorer.exe but symbols not loaded.\"\n    Write-Host \"\"\n}\n\n$thirdPartyHigh = $thirdPartyModules | Where-Object { $_.Count -gt 50 }\nif ($thirdPartyHigh.Count -gt 0) {\n    Write-Host \"[i] \" -NoNewline -ForegroundColor Cyan\n    Write-Host \"Third-party modules without symbols (PDBs not available on symbol server):\"\n    foreach ($m in $thirdPartyHigh | Sort-Object Count -Descending | Select-Object -First 5) {\n        Write-Host \"    - $($m.Name) ($($m.Count) failures)\"\n    }\n    Write-Host \"\"\n}\n\n# Also show high-failure Microsoft modules (may indicate symbol server issues)\n$microsoftHigh = $microsoftOtherModules | Where-Object { $_.Count -gt 50 }\nif ($microsoftHigh.Count -gt 0) {\n    Write-Host \"[!] \" -NoNewline -ForegroundColor Yellow\n    Write-Host \"Microsoft modules without symbols (check symbol server access):\"\n    foreach ($m in $microsoftHigh | Sort-Object Count -Descending | Select-Object -First 5) {\n        Write-Host \"    - $($m.Name) ($($m.Count) failures)\"\n    }\n    Write-Host \"\"\n}\n\n# Analyze timestamp gaps (find slow operations) - OPTIMIZED\nWrite-Host \"\"\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  TIMESTAMP GAP ANALYSIS (Slow Operations)\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\n\nWrite-Host \"Analyzing timestamps...\" -ForegroundColor Gray\n\n# Optimized: Use ArrayList and only parse timestamps, track gaps inline\n$gaps = [System.Collections.ArrayList]::new()\n$lazyLoadOps = [System.Collections.ArrayList]::new()  # Track lazy load operations (start to finish)\n$prevTimestamp = $null\n$prevLine = $null\n$prevLineNum = 0\n$lineNum = 0\n$totalTimestamped = 0\n$loadingCompleted = $false\n\n# For tracking lazy load operations\n$lazyLoadStart = $null\n$lazyLoadStartLine = $null\n$lazyLoadModule = $null\n\nforeach ($line in $log) {\n    $lineNum++\n\n    # Track when initial loading is done - gaps after this before lazy load are user think time\n    if ($line -match 'LoadBinaryAndDebugFiles completed|=== Trace loading completed') {\n        $loadingCompleted = $true\n    }\n\n    # Track lazy load operations (start to finish for each binary)\n    if ($line -match '\\[LazyBinaryLoad\\] Loading binary on-demand for ([^\\s]+)') {\n        $lazyLoadModule = $Matches[1]  # Save module name BEFORE timestamp match overwrites $Matches\n        $lazyLoadStart = Get-TimestampFromLine $line\n        $lazyLoadStartLine = $lineNum\n    }\n    if ($lazyLoadStart -and ($line -match '\\[LazyBinaryLoad\\] Successfully loaded|\\[LazyBinaryLoad\\] Could not find|\\[LazyBinaryLoad\\] Found binary')) {\n        $lazyLoadEnd = Get-TimestampFromLine $line\n        $lazyLoadSuccess = $line -match '\\[LazyBinaryLoad\\] (Successfully loaded|Found binary)'\n        if ($lazyLoadEnd) {\n            $lazyLoadMs = ($lazyLoadEnd - $lazyLoadStart).TotalMilliseconds\n            [void]$lazyLoadOps.Add([PSCustomObject]@{\n                Module = $lazyLoadModule\n                DurationMs = $lazyLoadMs\n                Success = $lazyLoadSuccess\n                StartLine = $lazyLoadStartLine\n                EndLine = $lineNum\n                StartTime = $lazyLoadStart.ToString(\"HH:mm:ss.fff\")\n                EndTime = $lazyLoadEnd.ToString(\"HH:mm:ss.fff\")\n            })\n        }\n        $lazyLoadStart = $null\n        $lazyLoadModule = $null\n    }\n\n    if ($line -match '^(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}\\.\\d{3})') {\n        $totalTimestamped++\n        $timestamp = [datetime]::ParseExact($Matches[1], \"yyyy-MM-dd HH:mm:ss.fff\", $null)\n\n        if ($null -ne $prevTimestamp) {\n            $gapMs = ($timestamp - $prevTimestamp).TotalMilliseconds\n            if ($gapMs -gt 500) {  # Only track gaps > 500ms for performance\n                $gapObj = [PSCustomObject]@{\n                    GapMs = $gapMs\n                    StartLine = $prevLineNum\n                    EndLine = $lineNum\n                    StartTime = $prevTimestamp.ToString(\"HH:mm:ss.fff\")\n                    EndTime = $timestamp.ToString(\"HH:mm:ss.fff\")\n                    BeforeLine = $prevLine\n                    AfterLine = $line\n                }\n\n                # Only track gaps during initial load (not lazy load related)\n                # Lazy load operations are tracked separately\n                $isLazyLoadRelated = ($line -match '\\[LazyBinaryLoad\\]') -or ($prevLine -match '\\[LazyBinaryLoad\\]')\n\n                if (-not $isLazyLoadRelated) {\n                    [void]$gaps.Add($gapObj)\n                }\n            }\n        }\n\n        $prevTimestamp = $timestamp\n        $prevLine = $line\n        $prevLineNum = $lineNum\n    }\n}\n\nWrite-Host \"Total timestamped lines: $totalTimestamped\"\nWrite-Host \"Initial load gaps > 500ms: $($gaps.Count)\" -ForegroundColor $(if ($gaps.Count -gt 0) { \"Yellow\" } else { \"Green\" })\nif ($lazyLoadOps.Count -gt 0) {\n    $lazyLoadTotal = ($lazyLoadOps | Measure-Object -Property DurationMs -Sum).Sum / 1000\n    $lazyLoadFailCount = @($lazyLoadOps | Where-Object { -not $_.Success }).Count\n    $lazyLoadColor = if ($lazyLoadFailCount -gt 0) { \"Red\" } else { \"Cyan\" }\n    $lazyLoadSuffix = if ($lazyLoadFailCount -gt 0) { \", $lazyLoadFailCount FAILED\" } else { \"\" }\n    Write-Host \"Lazy load operations: $($lazyLoadOps.Count) binaries ($([math]::Round($lazyLoadTotal, 1))s total$lazyLoadSuffix)\" -ForegroundColor $lazyLoadColor\n}\nWrite-Host \"\"\n\n# Sort by gap size and show top gaps\n$topGaps = $gaps | Sort-Object GapMs -Descending | Select-Object -First 25\n\nif ($topGaps.Count -gt 0) {\n    Write-Host \"Top 25 Largest Gaps (potential slow operations):\" -ForegroundColor Yellow\n    Write-Host \"\"\n    \n    $rank = 0\n    foreach ($gap in $topGaps) {\n        $rank++\n        $secs = [math]::Round($gap.GapMs / 1000, 2)\n        $color = if ($gap.GapMs -gt 5000) { \"Red\" } elseif ($gap.GapMs -gt 1000) { \"Yellow\" } else { \"White\" }\n        \n        Write-Host (\"{0,3}. \" -f $rank) -NoNewline -ForegroundColor Cyan\n        Write-Host (\"{0,8}ms ({1,6}s) \" -f [int]$gap.GapMs, $secs) -NoNewline -ForegroundColor $color\n        Write-Host \"Lines $($gap.StartLine)-$($gap.EndLine) @ $($gap.StartTime)\" -ForegroundColor Gray\n        \n        # Extract context from the lines\n        $beforeContext = \"\"\n        $afterContext = \"\"\n        \n        if ($gap.BeforeLine -match '\\[([^\\]]+)\\]\\s*\\[([^\\]]+)\\]\\s*(.*)') {\n            $beforeContext = \"[$($Matches[2])] $($Matches[3].Substring(0, [Math]::Min(60, $Matches[3].Length)))\"\n        }\n        if ($gap.AfterLine -match '\\[([^\\]]+)\\]\\s*\\[([^\\]]+)\\]\\s*(.*)') {\n            $afterContext = \"[$($Matches[2])] $($Matches[3].Substring(0, [Math]::Min(60, $Matches[3].Length)))\"\n        }\n        \n        if ($beforeContext) {\n            Write-Host \"       Before: $beforeContext...\" -ForegroundColor DarkGray\n        }\n        if ($afterContext) {\n            Write-Host \"       After:  $afterContext...\" -ForegroundColor DarkGray\n        }\n        Write-Host \"\"\n    }\n    \n    # Summary statistics\n    $totalGapTime = ($gaps | Measure-Object -Property GapMs -Sum).Sum\n    $avgGap = ($gaps | Measure-Object -Property GapMs -Average).Average\n    $gapsOver1s = ($gaps | Where-Object { $_.GapMs -gt 1000 }).Count\n    $gapsOver5s = ($gaps | Where-Object { $_.GapMs -gt 5000 }).Count\n    \n    Write-Host \"Gap Statistics:\" -ForegroundColor Cyan\n    Write-Host \"  Total gaps > 100ms:  $($gaps.Count)\"\n    Write-Host \"  Gaps > 1 second:     $gapsOver1s\" -ForegroundColor $(if ($gapsOver1s -gt 10) { \"Yellow\" } else { \"White\" })\n    Write-Host \"  Gaps > 5 seconds:    $gapsOver5s\" -ForegroundColor $(if ($gapsOver5s -gt 0) { \"Red\" } else { \"White\" })\n    Write-Host \"  Total gap time:      $([math]::Round($totalGapTime / 1000, 2))s\"\n    Write-Host \"  Average gap:         $([math]::Round($avgGap, 0))ms\"\n    \n    # Calculate total trace time\n    if ($timestampedLines.Count -gt 1) {\n        $firstTime = $timestampedLines[0].Timestamp\n        $lastTime = $timestampedLines[-1].Timestamp\n        $totalTime = ($lastTime - $firstTime).TotalSeconds\n        $gapPercent = [math]::Round(($totalGapTime / 1000) / $totalTime * 100, 1)\n        Write-Host \"\"\n        Write-Host \"  Total trace time:    $([math]::Round($totalTime, 2))s\"\n        Write-Host \"  Time in gaps:        $gapPercent%\" -ForegroundColor $(if ($gapPercent -gt 50) { \"Red\" } elseif ($gapPercent -gt 25) { \"Yellow\" } else { \"Green\" })\n    }\n} else {\n    Write-Host \"No significant performance gaps (>500ms) detected.\" -ForegroundColor Green\n}\n\n# Show lazy load operations (on-demand binary downloads)\nif ($lazyLoadOps.Count -gt 0) {\n    Write-Host \"\"\n    Write-Host (\"-\" * 80) -ForegroundColor DarkGray\n    Write-Host \"  LAZY LOAD OPERATIONS (on-demand binary downloads)\" -ForegroundColor Cyan\n    Write-Host (\"-\" * 80) -ForegroundColor DarkGray\n    Write-Host \"Time spent downloading binaries when user views assembly/graph.\" -ForegroundColor Gray\n    Write-Host \"\"\n\n    $lazyLoadSucceeded = @($lazyLoadOps | Where-Object { $_.Success })\n    $lazyLoadFailed = @($lazyLoadOps | Where-Object { -not $_.Success })\n\n    foreach ($op in $lazyLoadOps | Sort-Object DurationMs -Descending | Select-Object -First 10) {\n        $secs = [math]::Round($op.DurationMs / 1000, 2)\n        $status = if ($op.Success) { \"OK\" } else { \"FAILED\" }\n        $color = if (-not $op.Success) { \"Red\" } elseif ($op.DurationMs -gt 5000) { \"Yellow\" } elseif ($op.DurationMs -gt 2000) { \"Yellow\" } else { \"Green\" }\n        Write-Host (\"  {0,6}ms ({1,5}s) - {2} [{3}]\" -f [int]$op.DurationMs, $secs, $op.Module, $status) -ForegroundColor $color\n    }\n\n    $lazyLoadTotal = ($lazyLoadOps | Measure-Object -Property DurationMs -Sum).Sum / 1000\n    Write-Host \"\"\n    if ($lazyLoadFailed.Count -gt 0) {\n        Write-Host \"  Succeeded: $($lazyLoadSucceeded.Count), Failed: $($lazyLoadFailed.Count)\" -ForegroundColor Red\n        Write-Host \"  Failed modules: $($lazyLoadFailed.Module -join ', ')\" -ForegroundColor Red\n    } else {\n        Write-Host \"  All $($lazyLoadSucceeded.Count) lazy loads succeeded\" -ForegroundColor Green\n    }\n    Write-Host \"  Total lazy load time: $([math]::Round($lazyLoadTotal, 1))s\" -ForegroundColor Cyan\n}\n\n\n# Analyze what operations are causing the biggest gaps (excluding user think time)\nWrite-Host \"\"\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  GAP CAUSE ANALYSIS\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\n\n$gapCauses = @{}\nforeach ($gap in $gaps | Where-Object { $_.GapMs -gt 500 }) {\n    $cause = \"Unknown\"\n\n    if ($gap.AfterLine -match '\\[LazyBinaryLoad\\].*for ([^\\s]+)') {\n        # LazyBinaryLoad during loading (not user-triggered) is a real delay\n        $cause = \"LazyBinaryLoad: $($Matches[1])\"\n    } elseif ($gap.AfterLine -match '\\[ModuleInit\\].*Starting.*module: ([^\\s]+)') {\n        $cause = \"ModuleInit: $($Matches[1])\"\n    } elseif ($gap.AfterLine -match '\\[BinaryLoading\\].*Binary: ([^\\s,]+)') {\n        $cause = \"BinaryLoad: $($Matches[1])\"\n    } elseif ($gap.AfterLine -match '\\[PDBDebugInfo\\].*Binary: ([^\\s,]+)') {\n        $cause = \"PDBLoad: $($Matches[1])\"\n    } elseif ($gap.AfterLine -match '\\[SymbolSearch\\].*for ([^\\s]+)') {\n        $cause = \"SymbolSearch: $($Matches[1])\"\n    } elseif ($gap.AfterLine -match '\\[DebugInfoInit\\].*module ([^\\s]+)') {\n        $cause = \"DebugInfoInit: $($Matches[1])\"\n    } elseif ($gap.AfterLine -match '\\[FunctionResolution\\].*Module: ([^\\s,]+)') {\n        $cause = \"FuncResolve: $($Matches[1])\"\n    } elseif ($gap.BeforeLine -match '\\[ModuleInit\\].*module: ([^\\s]+)') {\n        $cause = \"After ModuleInit: $($Matches[1])\"\n    } elseif ($gap.BeforeLine -match '\\[SymbolLoading\\].*PDB download') {\n        $cause = \"PDB Downloads\"\n    }\n\n    if ($gapCauses.ContainsKey($cause)) {\n        $gapCauses[$cause] += $gap.GapMs\n    } else {\n        $gapCauses[$cause] = $gap.GapMs\n    }\n}\n\nif ($gapCauses.Count -gt 0) {\n    Write-Host \"Operations causing most delay (gaps > 500ms):\" -ForegroundColor Yellow\n    Write-Host \"\"\n    $gapCauses.GetEnumerator() | Sort-Object Value -Descending | Select-Object -First 15 | ForEach-Object {\n        $secs = [math]::Round($_.Value / 1000, 2)\n        Write-Host (\"{0,8}ms ({1,6}s) - {2}\" -f [int]$_.Value, $secs, $_.Key)\n    }\n}\n\n# Calculate overall resolution rate\n$totalAttempts = $resolved.Count + $notResolved.Count\nif ($totalAttempts -gt 0) {\n    $resolutionRate = [math]::Round(($resolved.Count / $totalAttempts) * 100, 1)\n    Write-Host \"\"\n    Write-Host \"Overall Symbol Resolution Rate: \" -NoNewline\n    if ($resolutionRate -gt 80) {\n        Write-Host \"$resolutionRate%\" -ForegroundColor Green\n    } elseif ($resolutionRate -gt 60) {\n        Write-Host \"$resolutionRate%\" -ForegroundColor Yellow\n    } else {\n        Write-Host \"$resolutionRate%\" -ForegroundColor Red\n    }\n}\n\nWrite-Host \"\"\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"  SUMMARY DIAGNOSIS\" -ForegroundColor Cyan\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\nWrite-Host \"\"\n\n# Determine the primary issue\n$primaryIssue = $null\n$issueDetails = @()\n\nif ($noImageIdEvents -or $dbgIdCount -eq 0) {\n    $primaryIssue = \"Missing ImageID DbgID Events\"\n    $issueDetails += \"The trace is missing PDB GUID/Age information required for symbol server lookups.\"\n    $issueDetails += \"This typically happens when using traces from external tools that don't capture ImageID events.\"\n    $issueDetails += \"\"\n    $issueDetails += \"FIX: Re-capture with Profile Explorer (File -> Record Profile) or 'wpr -start CPU'\"\n}\nelseif ($binaryTimeouts -gt 10 -or $pdbTimeouts -gt 10) {\n    $primaryIssue = \"Symbol Server Timeouts\"\n    $issueDetails += \"Multiple symbol server requests are timing out.\"\n    $issueDetails += \"This could indicate network issues, slow symbol server, or corporate firewall blocks.\"\n    $issueDetails += \"\"\n    $issueDetails += \"FIX: Check network connectivity, verify symbol server URL, or increase timeout settings.\"\n}\nelseif ($totalAttempts -gt 0 -and $resolutionRate -lt 50) {\n    $primaryIssue = \"Low Symbol Resolution Rate\"\n    $issueDetails += \"Only $resolutionRate% of symbols are resolving successfully.\"\n    $issueDetails += \"This may indicate missing symbols on the symbol server or version mismatch.\"\n    $issueDetails += \"\"\n    $issueDetails += \"FIX: Ensure symbol server is correctly configured and symbols exist for your binaries.\"\n}\nelse {\n    $primaryIssue = \"Symbol Loading Appears Normal\"\n    $issueDetails += \"No major issues detected in symbol loading.\"\n    if ($totalAttempts -gt 0) {\n        $issueDetails += \"Symbol resolution rate: $resolutionRate%\"\n    }\n}\n\nWrite-Host \"Primary Issue: \" -NoNewline\nif ($primaryIssue -eq \"Symbol Loading Appears Normal\") {\n    Write-Host $primaryIssue -ForegroundColor Green\n} else {\n    Write-Host $primaryIssue -ForegroundColor Red\n}\nWrite-Host \"\"\n\nforeach ($detail in $issueDetails) {\n    if ($detail -match '^FIX:') {\n        Write-Host $detail -ForegroundColor Cyan\n    } else {\n        Write-Host \"  $detail\" -ForegroundColor Gray\n    }\n}\n\nWrite-Host \"\"\n\n# ============================================================================\n# SOURCE FILE LOADING ANALYSIS\n# ============================================================================\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  SOURCE FILE LOADING ANALYSIS\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\n\n$sourceFileLines = $log | Where-Object { $_ -match '\\[SourceFile\\]' }\n$strippedPdbLines = $log | Where-Object { $_ -match 'PDB appears to be STRIPPED' }\n$privatePdbLines = $log | Where-Object { $_ -match 'PDB has source info\\.' }\n$sourceServerEnabled = $log | Where-Object { $_ -match 'SourceServerEnabled=True' } | Select-Object -First 1\n$sourceServerLookups = $log | Where-Object { $_ -match 'Attempting source server lookup' }\n$sourceFileSuccess = $log | Where-Object { $_ -match 'Downloaded and verified source file' }\n$sourceFileFailed = $log | Where-Object { $_ -match 'Failed to download|GetSourceFile returned: null|lineInfo is Unknown' }\n$pdbFileSizes = $log | Where-Object { $_ -match '\\[PDBDebugInfo\\] PDB file size:' }\n\n# Parse PDB file sizes and build lookup table\n$pdbSizeTable = @{}\n$pdbFileSizes | ForEach-Object {\n    if ($_ -match 'PDB file size: ([0-9,]+) bytes \\(([0-9.]+) MB\\) - (.+)$') {\n        $sizeMB = [double]$Matches[2]\n        $path = $Matches[3]\n        $pdbName = Split-Path $path -Leaf\n        $pdbSizeTable[$path] = @{ Name = $pdbName; SizeMB = $sizeMB }\n    }\n}\n\n# Parse stripped/private PDB lists\n$strippedPdbPaths = @()\n$strippedPdbLines | ForEach-Object {\n    if ($_ -match 'for: (.+)$') {\n        $strippedPdbPaths += $Matches[1]\n    }\n}\n\n$privatePdbPaths = @()\n$privatePdbLines | ForEach-Object {\n    # Private PDB log format: \"PDB has source info. Sample source file: <file>\"\n    # The PDB path is logged earlier, need to correlate\n}\n\nWrite-Host \"\"\n# PDB Classification Summary\n$totalPdbs = $strippedPdbLines.Count + $privatePdbLines.Count\nif ($totalPdbs -gt 0) {\n    Write-Host \"PDB CLASSIFICATION SUMMARY:\" -ForegroundColor Cyan\n    Write-Host (\"=\" * 50) -ForegroundColor DarkGray\n    $privateCount = $privatePdbLines.Count\n    $strippedCount = $strippedPdbLines.Count\n    $privatePercent = if ($totalPdbs -gt 0) { [math]::Round(($privateCount / $totalPdbs) * 100, 1) } else { 0 }\n    $strippedPercent = if ($totalPdbs -gt 0) { [math]::Round(($strippedCount / $totalPdbs) * 100, 1) } else { 0 }\n\n    Write-Host \"  Total PDBs loaded:     $totalPdbs\" -ForegroundColor White\n    Write-Host \"  PRIVATE (has source):  $privateCount ($privatePercent%)\" -ForegroundColor Green\n    Write-Host \"  PUBLIC/STRIPPED:       $strippedCount ($strippedPercent%)\" -ForegroundColor Yellow\n    Write-Host \"\"\n\n    if ($strippedCount -gt 0 -and $privateCount -gt 0) {\n        Write-Host \"  [i] Some PDBs are private (from symweb), others are public (from msdl).\" -ForegroundColor Gray\n        Write-Host \"      Private PDBs support source file viewing. Public PDBs only have function names.\" -ForegroundColor Gray\n    } elseif ($strippedCount -gt 0 -and $privateCount -eq 0) {\n        Write-Host \"  [!] ALL PDBs are PUBLIC/STRIPPED - source file viewing will NOT work.\" -ForegroundColor Red\n        Write-Host \"      Check if symweb auth is working. You may need to re-authenticate.\" -ForegroundColor Yellow\n    } elseif ($privateCount -gt 0 -and $strippedCount -eq 0) {\n        Write-Host \"  [OK] All PDBs are PRIVATE - source file viewing should work!\" -ForegroundColor Green\n    }\n    Write-Host \"\"\n}\n\nWrite-Host \"Source File Lookups:\" -ForegroundColor Cyan\nWrite-Host \"  Total [SourceFile] log entries: $($sourceFileLines.Count)\"\nWrite-Host \"  Source server lookups attempted: $($sourceServerLookups.Count)\"\nWrite-Host \"  Successful downloads: $($sourceFileSuccess.Count)\" -ForegroundColor $(if ($sourceFileSuccess.Count -gt 0) { \"Green\" } else { \"Yellow\" })\nWrite-Host \"  Failed lookups: $($sourceFileFailed.Count)\" -ForegroundColor $(if ($sourceFileFailed.Count -gt 0) { \"Red\" } else { \"Green\" })\nWrite-Host \"\"\n\nif ($strippedPdbLines.Count -gt 0) {\n    Write-Host \"STRIPPED PDBs (no source info):\" -ForegroundColor Yellow\n    $strippedPdbPaths | Select-Object -First 10 | ForEach-Object {\n        $path = $_\n        $pdbName = Split-Path $path -Leaf\n        $sizeInfo = $pdbSizeTable[$path]\n        if ($sizeInfo) {\n            Write-Host (\"  {0,8:F2} MB - {1}\" -f $sizeInfo.SizeMB, $pdbName) -ForegroundColor Yellow\n        } else {\n            Write-Host \"  - $pdbName\" -ForegroundColor Yellow\n        }\n    }\n    if ($strippedPdbPaths.Count -gt 10) {\n        Write-Host \"  ... and $($strippedPdbPaths.Count - 10) more\" -ForegroundColor Gray\n    }\n    Write-Host \"\"\n}\n\nif ($pdbFileSizes.Count -gt 0) {\n    Write-Host \"PDB File Sizes (top 10 by size):\" -ForegroundColor Cyan\n    # Sort by size descending and show top 10\n    $sortedPdbs = $pdbSizeTable.Values | Sort-Object -Property SizeMB -Descending | Select-Object -First 10\n    $sortedPdbs | ForEach-Object {\n        $sizeMB = $_.SizeMB\n        $pdbName = $_.Name\n        Write-Host (\"  {0,8:F2} MB - {1}\" -f $sizeMB, $pdbName) -ForegroundColor White\n    }\n    Write-Host \"\"\n}\n\n# ============================================================================\n# AUTH & SYMBOL SERVER ANALYSIS\n# ============================================================================\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\nWrite-Host \"  AUTH & SYMBOL SERVER ANALYSIS\" -ForegroundColor Yellow\nWrite-Host (\"-\" * 80) -ForegroundColor DarkGray\n\n# Look for explicit auth failure/success messages from our logging\n$authFailed = $log | Where-Object { $_ -match 'auth FAILED|PrimaryServerAuthFailed=True' }\n$authVerified = $log | Where-Object { $_ -match 'auth VERIFIED|PrimaryServerVerified=True' }\n$symwebHits = $log | Where-Object { $_ -match 'symweb' -and $_ -match 'TraceEvent log' }\n$msdlHits = $log | Where-Object { $_ -match 'msdl\\.microsoft\\.com|download/symbols' -and $_ -match 'TraceEvent log' }\n\nWrite-Host \"\"\nif ($authFailed.Count -gt 0) {\n    Write-Host \"[!] AUTH FAILURES DETECTED:\" -ForegroundColor Red\n    $authFailed | Select-Object -First 5 | ForEach-Object {\n        Write-Host \"  $_\" -ForegroundColor Yellow\n    }\n    Write-Host \"\"\n    Write-Host \"    If you're EXTERNAL to Microsoft, symweb auth failures are expected.\" -ForegroundColor Gray\n    Write-Host \"    The fallback to public symbols (msdl) should be automatic.\" -ForegroundColor Gray\n    Write-Host \"\"\n} elseif ($authVerified.Count -gt 0) {\n    Write-Host \"[OK] Primary server (symweb) auth verified\" -ForegroundColor Green\n    Write-Host \"\"\n} else {\n    Write-Host \"[?] Could not determine auth status from logs\" -ForegroundColor Yellow\n    Write-Host \"    Look for 401/403 errors in TraceEvent logs below\" -ForegroundColor Gray\n    Write-Host \"\"\n}\n\n# Show TraceEvent logs for symbol downloads\n$traceEventLogs = $log | Where-Object { $_ -match '\\[SymbolSearch\\] TraceEvent log for' }\nif ($traceEventLogs.Count -gt 0) {\n    Write-Host \"Symbol Download Details (first 5):\" -ForegroundColor Cyan\n    $traceEventLogs | Select-Object -First 5 | ForEach-Object {\n        if ($_ -match 'TraceEvent log for ([^:]+):') {\n            Write-Host \"  - $($Matches[1])\" -ForegroundColor White\n        }\n    }\n    Write-Host \"\"\n}\n\nWrite-Host (\"=\" * 80) -ForegroundColor Cyan\n\n\n"
  },
  {
    "path": "src/.editorconfig",
    "content": "root = true\n# Remove the line below if you want to inherit .editorconfig settings from higher directories\n\n# C# files\n[*.cs]\n\n#### Core EditorConfig Options ####\n\n# Indentation and spacing\nindent_size = 2\nindent_style = space\ntab_width = 2\n\n# New line preferences\ninsert_final_newline = false\n\n#### .NET Coding Conventions ####\n\n# Organize usings\ndotnet_separate_import_directive_groups = false\ndotnet_sort_system_directives_first = true\n\n# this. and Me. preferences\ndotnet_style_qualification_for_event = false:suggestion\ndotnet_style_qualification_for_field = false:suggestion\ndotnet_style_qualification_for_method = false:suggestion\ndotnet_style_qualification_for_property = false:suggestion\n\n# Language keywords vs BCL types preferences\ndotnet_style_predefined_type_for_locals_parameters_members = true:suggestion\ndotnet_style_predefined_type_for_member_access = true:suggestion\n\n# Parentheses preferences\ndotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none\ndotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none\ndotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent\ndotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none\n\n# Modifier preferences\ndotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion\n\n# Expression-level preferences\ndotnet_style_coalesce_expression = true:silent\ndotnet_style_collection_initializer = true:silent\ndotnet_style_explicit_tuple_names = true:silent\ndotnet_style_null_propagation = true:silent\ndotnet_style_object_initializer = true:silent\ndotnet_style_operator_placement_when_wrapping = beginning_of_line\ndotnet_style_prefer_auto_properties = true:silent\ndotnet_style_prefer_compound_assignment = true:silent\ndotnet_style_prefer_conditional_expression_over_assignment = true:silent\ndotnet_style_prefer_conditional_expression_over_return = true:silent\ndotnet_style_prefer_inferred_anonymous_type_member_names = true:silent\ndotnet_style_prefer_inferred_tuple_names = true:silent\ndotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent\ndotnet_style_prefer_simplified_boolean_expressions = true:silent\ndotnet_style_prefer_simplified_interpolation = true:suggestion\n\n# Field preferences\ndotnet_style_readonly_field = false:suggestion\n\n# Parameter preferences\ndotnet_code_quality_unused_parameters = all:suggestion\n\n#### C# Coding Conventions ####\n\n# var preferences\ncsharp_style_var_elsewhere = true:suggestion\ncsharp_style_var_for_built_in_types = true:suggestion\ncsharp_style_var_when_type_is_apparent = true:suggestion\n\n# Expression-bodied members\ncsharp_style_expression_bodied_accessors = true:silent\ncsharp_style_expression_bodied_constructors = false:silent\ncsharp_style_expression_bodied_indexers = when_on_single_line:silent\ncsharp_style_expression_bodied_lambdas = true:silent\ncsharp_style_expression_bodied_local_functions = false:silent\ncsharp_style_expression_bodied_methods = false:silent\ncsharp_style_expression_bodied_operators = false:silent\ncsharp_style_expression_bodied_properties = when_on_single_line:silent\n\n# Pattern matching preferences\ncsharp_style_pattern_matching_over_as_with_null_check = true:silent\ncsharp_style_pattern_matching_over_is_with_cast_check = true:suggestion\ncsharp_style_prefer_switch_expression = true:suggestion\n\n# Null-checking preferences\ncsharp_style_conditional_delegate_call = true:silent\n\n# Modifier preferences\ncsharp_prefer_static_local_function = false:suggestion\ncsharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async:suggestion\n\n# Code-block preferences\ncsharp_prefer_braces = true:silent\ncsharp_prefer_simple_using_statement = true:suggestion\n\n# Expression-level preferences\ncsharp_prefer_simple_default_expression = true:suggestion\ncsharp_style_deconstructed_variable_declaration = true:suggestion\ncsharp_style_inlined_variable_declaration = true:silent\ncsharp_style_pattern_local_over_anonymous_function = true:suggestion\ncsharp_style_prefer_index_operator = true:silent\ncsharp_style_prefer_range_operator = true:suggestion\ncsharp_style_throw_expression = true:silent\ncsharp_style_unused_value_assignment_preference = discard_variable:suggestion\ncsharp_style_unused_value_expression_statement_preference = discard_variable:silent\n\n# 'using' directive preferences\ncsharp_using_directive_placement = outside_namespace:silent\n\n#### C# Formatting Rules ####\n\n# New line preferences\ncsharp_new_line_before_catch = true\ncsharp_new_line_before_else = true\ncsharp_new_line_before_finally = true\ncsharp_new_line_before_members_in_anonymous_types = true\ncsharp_new_line_before_members_in_object_initializers = false\ncsharp_new_line_before_open_brace = none\ncsharp_new_line_between_query_expression_clauses = true\n\n# Indentation preferences\ncsharp_indent_block_contents = true\ncsharp_indent_braces = false\ncsharp_indent_case_contents = true\ncsharp_indent_case_contents_when_block = false\ncsharp_indent_labels = one_less_than_current\ncsharp_indent_switch_labels = true\n\n# Space preferences\ncsharp_space_after_cast = false\ncsharp_space_after_colon_in_inheritance_clause = true\ncsharp_space_after_comma = true\ncsharp_space_after_dot = false\ncsharp_space_after_keywords_in_control_flow_statements = true\ncsharp_space_after_semicolon_in_for_statement = true\ncsharp_space_around_binary_operators = before_and_after\ncsharp_space_around_declaration_statements = false\ncsharp_space_before_colon_in_inheritance_clause = true\ncsharp_space_before_comma = false\ncsharp_space_before_dot = false\ncsharp_space_before_open_square_brackets = false\ncsharp_space_before_semicolon_in_for_statement = false\ncsharp_space_between_empty_square_brackets = false\ncsharp_space_between_method_call_empty_parameter_list_parentheses = false\ncsharp_space_between_method_call_name_and_opening_parenthesis = false\ncsharp_space_between_method_call_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_empty_parameter_list_parentheses = false\ncsharp_space_between_method_declaration_name_and_open_parenthesis = false\ncsharp_space_between_method_declaration_parameter_list_parentheses = false\ncsharp_space_between_parentheses = false\ncsharp_space_between_square_brackets = false\n\n# Wrapping preferences\ncsharp_preserve_single_line_blocks = true\ncsharp_preserve_single_line_statements = false\n\n#### Naming styles ####\n\n# Naming rules\n\ndotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion\ndotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface\ndotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i\n\ndotnet_naming_rule.types_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.types_should_be_pascal_case.symbols = types\ndotnet_naming_rule.types_should_be_pascal_case.style = pascal_case\n\ndotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion\ndotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members\ndotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case\n\n# Symbol specifications\n\ndotnet_naming_symbols.interface.applicable_kinds = interface\ndotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.interface.required_modifiers =\n\ndotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum\ndotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.types.required_modifiers =\n\ndotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method\ndotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected\ndotnet_naming_symbols.non_field_members.required_modifiers =\n\n# Naming styles\n\ndotnet_naming_style.pascal_case.required_prefix =\ndotnet_naming_style.pascal_case.required_suffix =\ndotnet_naming_style.pascal_case.word_separator =\ndotnet_naming_style.pascal_case.capitalization = pascal_case\n\ndotnet_naming_style.begins_with_i.required_prefix = I\ndotnet_naming_style.begins_with_i.required_suffix =\ndotnet_naming_style.begins_with_i.word_separator =\ndotnet_naming_style.begins_with_i.capitalization = pascal_case\n\n# Microsoft .NET properties\ndotnet_naming_rule.event_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.event_rule.severity = none\ndotnet_naming_rule.event_rule.style = pascal_case\ndotnet_naming_rule.event_rule.symbols = event_symbols\ndotnet_naming_rule.interfaces_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.interfaces_rule.severity = none\ndotnet_naming_rule.interfaces_rule.style = begins_with_i\ndotnet_naming_rule.interfaces_rule.symbols = interfaces_symbols\ndotnet_naming_rule.method_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.method_rule.severity = none\ndotnet_naming_rule.method_rule.style = pascal_case\ndotnet_naming_rule.method_rule.symbols = method_symbols\ndotnet_naming_rule.private_constants_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.private_constants_rule.severity = none\ndotnet_naming_rule.private_constants_rule.style = pascal_case\ndotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols\ndotnet_naming_rule.private_instance_fields_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.private_instance_fields_rule.severity = none\ndotnet_naming_rule.private_instance_fields_rule.style = lower_camel_case_underscore_tolerant_style\ndotnet_naming_rule.private_instance_fields_rule.symbols = private_instance_fields_symbols\ndotnet_naming_rule.private_static_fields_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.private_static_fields_rule.severity = none\ndotnet_naming_rule.private_static_fields_rule.style = lower_camel_case_style\ndotnet_naming_rule.private_static_fields_rule.symbols = private_static_fields_symbols\ndotnet_naming_rule.private_static_readonly_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.private_static_readonly_rule.severity = none\ndotnet_naming_rule.private_static_readonly_rule.style = pascal_case\ndotnet_naming_rule.private_static_readonly_rule.symbols = private_static_readonly_symbols\ndotnet_naming_rule.property_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.property_rule.severity = none\ndotnet_naming_rule.property_rule.style = pascal_case\ndotnet_naming_rule.property_rule.symbols = property_symbols\ndotnet_naming_rule.types_and_namespaces_rule.import_to_resharper = as_predefined\ndotnet_naming_rule.types_and_namespaces_rule.severity = none\ndotnet_naming_rule.types_and_namespaces_rule.style = pascal_case\ndotnet_naming_rule.types_and_namespaces_rule.symbols = types_and_namespaces_symbols\ndotnet_naming_style.lower_camel_case_style.capitalization = camel_case\ndotnet_naming_style.lower_camel_case_style.required_prefix = _\ndotnet_naming_style.lower_camel_case_underscore_tolerant_style.capitalization = camel_case\ndotnet_naming_style.lower_camel_case_underscore_tolerant_style.word_separator = _\ndotnet_naming_symbols.event_symbols.applicable_accessibilities = *\ndotnet_naming_symbols.event_symbols.applicable_kinds = event\ndotnet_naming_symbols.interfaces_symbols.applicable_accessibilities = *\ndotnet_naming_symbols.interfaces_symbols.applicable_kinds = interface\ndotnet_naming_symbols.method_symbols.applicable_accessibilities = *\ndotnet_naming_symbols.method_symbols.applicable_kinds = method\ndotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private\ndotnet_naming_symbols.private_constants_symbols.applicable_kinds = field\ndotnet_naming_symbols.private_constants_symbols.required_modifiers = const\ndotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities = private\ndotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds = field\ndotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities = private\ndotnet_naming_symbols.private_static_fields_symbols.applicable_kinds = field\ndotnet_naming_symbols.private_static_fields_symbols.required_modifiers = static\ndotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private\ndotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field\ndotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static, readonly\ndotnet_naming_symbols.property_symbols.applicable_accessibilities = *\ndotnet_naming_symbols.property_symbols.applicable_kinds = property\ndotnet_naming_symbols.types_and_namespaces_symbols.applicable_accessibilities = *\ndotnet_naming_symbols.types_and_namespaces_symbols.applicable_kinds = namespace, class, struct, enum, delegate\n\n# ReSharper properties\nresharper_braces_for_for = not_required\nresharper_braces_for_foreach = not_required\nresharper_braces_for_ifelse = not_required_for_both\nresharper_braces_for_while = not_required\nresharper_braces_redundant = true\nresharper_cpp_insert_final_newline = true\nresharper_csharp_naming_rule.event = AaBb\nresharper_csharp_naming_rule.interfaces = I + AaBb\nresharper_csharp_naming_rule.method = AaBb\nresharper_csharp_naming_rule.property = AaBb\nresharper_csharp_naming_rule.types_and_namespaces = AaBb\nresharper_csharp_wrap_lines = false\nresharper_keep_existing_declaration_block_arrangement = false\nresharper_keep_existing_embedded_block_arrangement = false\nresharper_keep_existing_enum_arrangement = false\nresharper_show_autodetect_configure_formatting_tip = false\nresharper_use_heuristics_for_body_style = true\n\n# ReSharper inspection severities\nresharper_arrange_accessor_owner_body_highlighting = suggestion\nresharper_arrange_redundant_parentheses_highlighting = hint\nresharper_arrange_this_qualifier_highlighting = hint\nresharper_arrange_type_member_modifiers_highlighting = hint\nresharper_arrange_type_modifiers_highlighting = hint\nresharper_built_in_type_reference_style_for_member_access_highlighting = hint\nresharper_built_in_type_reference_style_highlighting = hint\nresharper_inconsistent_naming_highlighting = none\nresharper_redundant_base_qualifier_highlighting = warning\nresharper_suggest_var_or_type_built_in_types_highlighting = hint\nresharper_suggest_var_or_type_elsewhere_highlighting = hint\nresharper_suggest_var_or_type_simple_types_highlighting = hint\nresharper_unused_member_global_highlighting = none\n\n[*.{appxmanifest,axml,build,c,c++,cc,cginc,compute,config,cp,cpp,csproj,cu,cuh,cxx,dbml,discomap,dtd,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,jsproj,lsproj,mpp,mq4,mq5,mqh,njsproj,nuspec,proj,props,proto,resw,resx,StyleCop,targets,tasks,tpp,usf,ush,vbproj,xml,xsd}]\nindent_style = tab\nindent_size = tab\ntab_width = 4\n\n[*.{axaml,cs,paml,vb,xaml,xamlx,xoml}]\nindent_style = space\nindent_size = 2\ntab_width = 2\n\n[*]\n\n# Microsoft .NET properties\ncsharp_indent_braces = false\ncsharp_new_line_before_members_in_object_initializers = false\ncsharp_new_line_before_open_brace = none\ncsharp_preferred_modifier_order = public, protected, override, private, volatile, file, unsafe, internal, static, async, extern, virtual, sealed, abstract, readonly, new, required:suggestion\ncsharp_preserve_single_line_blocks = true\ncsharp_style_namespace_declarations = file_scoped:warning\ncsharp_style_var_elsewhere = true:suggestion\ncsharp_style_var_for_built_in_types = false:suggestion\ncsharp_style_var_when_type_is_apparent = true:suggestion\ndotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none\ndotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none\ndotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none\n\n# ReSharper properties\nresharper_align_multiline_argument = true\nresharper_align_multiline_for_stmt = true\nresharper_align_multiline_parameter = true\nresharper_align_multiline_statement_conditions = false\nresharper_align_multline_type_parameter_constrains = true\nresharper_align_multline_type_parameter_list = true\nresharper_align_tuple_components = true\nresharper_allow_comment_after_lbrace = true\nresharper_arguments_skip_single = true\nresharper_blank_lines_after_block_statements = 1\nresharper_blank_lines_after_multiline_statements = 0\nresharper_blank_lines_after_start_comment = 0\nresharper_blank_lines_around_auto_property = 0\nresharper_blank_lines_around_invocable = 1\nresharper_blank_lines_around_property = 1\nresharper_blank_lines_around_single_line_type = 0\nresharper_blank_lines_before_block_statements = 1\nresharper_blank_lines_before_control_transfer_statements = 0\nresharper_blank_lines_before_multiline_statements = 0\nresharper_braces_for_for = required_for_multiline\nresharper_braces_for_foreach = required_for_multiline\nresharper_braces_for_ifelse = not_required\nresharper_braces_for_while = required_for_multiline\nresharper_braces_redundant = false\nresharper_csharp_align_multiline_argument = true\nresharper_csharp_allow_far_alignment = true\nresharper_csharp_blank_lines_around_field = 0\nresharper_csharp_blank_lines_around_invocable = 1\nresharper_csharp_blank_lines_around_region = 0\nresharper_csharp_insert_final_newline = false\nresharper_csharp_keep_blank_lines_in_code = 1\nresharper_csharp_keep_blank_lines_in_declarations = 0\nresharper_csharp_max_line_length = 120\nresharper_csharp_remove_blank_lines_near_braces_in_code = true\nresharper_csharp_remove_blank_lines_near_braces_in_declarations = true\nresharper_csharp_wrap_before_first_type_parameter_constraint = true\nresharper_csharp_wrap_ternary_expr_style = wrap_if_long\nresharper_default_internal_modifier = implicit\nresharper_default_value_when_type_not_evident = default_expression\nresharper_for_simple_types = use_var\nresharper_indent_pars = outside\nresharper_indent_preprocessor_region = do_not_change\nresharper_instance_members_qualify_declared_in =\nresharper_int_align_switch_expressions = true\nresharper_int_align_switch_sections = true\nresharper_keep_existing_attribute_arrangement = true\nresharper_keep_existing_enum_arrangement = false\nresharper_max_enum_members_on_line = 1\nresharper_max_initializer_elements_on_line = 1\nresharper_object_creation_when_type_evident = target_typed\nresharper_parentheses_non_obvious_operations = none, bitwise_and, bitwise_exclusive_or, bitwise_inclusive_or, bitwise, conditional_and, conditional_or, conditional\nresharper_parentheses_redundancy_style = remove\nresharper_parentheses_same_type_operations = true\nresharper_place_abstract_accessorholder_on_single_line = true\nresharper_place_accessorholder_attribute_on_same_line = false\nresharper_place_accessor_attribute_on_same_line = false\nresharper_place_expr_accessor_on_single_line = true\nresharper_place_expr_property_on_single_line = true\nresharper_place_field_attribute_on_same_line = false\nresharper_place_simple_accessor_on_single_line = true\nresharper_place_simple_blocks_on_single_line = false\nresharper_place_simple_embedded_statement_on_same_line = false\nresharper_place_simple_initializer_on_single_line = true\nresharper_remove_blank_lines_near_braces_in_code = true\nresharper_remove_blank_lines_near_braces_in_declarations = true\nresharper_space_between_attribute_sections = false\nresharper_space_within_single_line_array_initializer_braces = false\nresharper_use_roslyn_logic_for_evident_types = true\nresharper_wrap_after_dot_in_method_calls = true\nresharper_wrap_for_stmt_header_style = wrap_if_long\nresharper_wrap_object_and_collection_initializer_style = chop_always\ndotnet_style_operator_placement_when_wrapping = beginning_of_line\nend_of_line = crlf\ndotnet_style_coalesce_expression = true:silent\ndotnet_style_null_propagation = true:silent\ndotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent\ndotnet_style_prefer_auto_properties = true:silent\ncsharp_style_prefer_method_group_conversion = true:silent\ncsharp_style_prefer_top_level_statements = true:silent\ncsharp_style_prefer_primary_constructors = true:suggestion\ndotnet_style_object_initializer = true:silent"
  },
  {
    "path": "src/.gitattributes",
    "content": "*.etl filter=lfs diff=lfs merge=lfs -text\n"
  },
  {
    "path": "src/GrpcLib/DebugService.proto",
    "content": "﻿// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\nsyntax = \"proto3\";\n\nservice DebugService {\n  rpc StartSession(StartSessionRequest) returns (StartSessionResult);\n  rpc EndSession(EndSessionRequest) returns (Result);\n  rpc UpdateIR(UpdateIRRequest) returns (Result);\n  rpc MarkElement(MarkElementRequest) returns (Result);\n  rpc SetCurrentElement(SetCurrentElementRequest) returns (Result);\n  rpc ExecuteCommand(ElementCommandRequest) returns (Result);\n  rpc HasActiveBreakpoint(ActiveBreakpointRequest) returns (ActiveBreakpointResult);\n  rpc ClearTemporaryHighlighting(ClearHighlightingRequest) returns (Result);\n  rpc SetSessionState(SessionStateRequest) returns (Result);\n  rpc UpdateCurrentStackFrame(CurrentStackFrameRequest) returns (Result);\n}\n\nenum SessionState {\n  Listening = 0;\n  Paused = 1;\n}\n\nmessage SessionStateRequest {\n  SessionState state = 1;\n}\n\nenum ClientKind {\n  debugger = 0;\n  runtime = 1;\n}\n\nmessage StartSessionRequest {\n  ClientKind kind = 1;\n  int64 processId = 2;\n  int64 processArgs = 3;\n}\n\nmessage StartSessionResult {\n  int32 errorCode = 1;\n  string errorMessage = 2;\n  int64 sessionId = 3;\n}\n\nmessage EndSessionRequest {\n  int64 sessionId = 1;\n}\n\nmessage StackFrame {\n  string file = 1;\n  string function = 2;\n  int32 lineNumber = 3;\n}\n\nmessage CurrentStackFrameRequest {\n  StackFrame currentFrame = 1;\n}\n\nmessage UpdateIRRequest {\n  int64 sessionId = 1;\n  string text = 2;\n}\n\nmessage Result {\n  bool success = 1;\n  int32 errorCode = 2;\n  string errorMessage = 3;\n}\n\nmessage RGBColor {\n  int32 R = 1;\n  int32 G = 2;\n  int32 B = 3;\n}\n\nenum HighlightingType {\n  temporary = 0;\n  permanent = 1;\n}\n\nmessage ClearHighlightingRequest {\n  HighlightingType highlighting = 1;\n}\n\nmessage MarkElementRequest {\n  int64 elementAddress = 1;\n  RGBColor color = 2;\n  string label = 3;\n  HighlightingType highlighting = 4;\n}\n\nenum IRElementKind {\n  Instruction = 0;\n  Operand = 1;\n  Block = 2;\n  User = 3;\n  UserParent = 4;\n}\n\nmessage SetCurrentElementRequest {\n  int32 elementId = 1;\n  int64 elementAddress = 2;\n  IRElementKind elementKind = 3;\n  string label = 4;\n}\n\nenum ElementCommand {\n   GoToDefinition = 0;\n   MarkBlock = 1;\n   ShowUses = 2;\n   MarkUses = 3;\n   ShowReferences = 4;\n   MarkReferences = 5;\n   MarkExpression = 6;\n   ShowExpression = 7;\n   ClearMarker = 8;\n}\n\nmessage ElementCommandRequest {\n  ElementCommand command = 1;\n  int64 elementAddress = 2;\n  string label = 3;\n  HighlightingType highlighting = 4;\n  StackFrame stackFrame = 5;\n}\n\nmessage ActiveBreakpointRequest {\n  int64 elementAddress = 1;\n}\n\nmessage ActiveBreakpointResult {\n  bool success = 1;\n  int32 errorCode = 2;\n  string errorMessage = 3;\n  bool hasBreakpoint = 4;\n}"
  },
  {
    "path": "src/GrpcLib/GrpcLib.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n\t<PropertyGroup>\n\t\t<TargetFramework>netstandard2.1</TargetFramework>\n\t</PropertyGroup>\n\n\t<ItemGroup>\n\t\t<None Remove=\"DebugService.proto\" />\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<PackageReference Include=\"Google.Protobuf\" Version=\"3.28.3\" />\n\t\t<PackageReference Include=\"Grpc.Core\" Version=\"2.46.6\" />\n\t\t<PackageReference Include=\"Grpc.Core.Api\" Version=\"2.66.0\" />\n\t\t<PackageReference Include=\"Grpc.Tools\" Version=\"2.67.0\">\n\t\t\t<PrivateAssets>all</PrivateAssets>\n\t\t\t<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n\t\t</PackageReference>\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<Protobuf Include=\"DebugService.proto\" />\n\t</ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/ManagedProfiler/CLRDataTarget.h",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#pragma once\n#include <windows.h>\n#include <TlHelp32.h>\n#include <assert.h>\n#include <cor.h>\n#include <cordebug.h>\n#include <corprof.h>\n#include <crosscomp.h>\n#include <dacprivate.h>\n#include <metahost.h>\n#include <stdio.h>\n#include <filesystem>\n#include <fstream>\n#include <mutex>\n#include <string>\n\n#undef min\n#undef max\n\nclass CLRDataTarget : public ICLRDataTarget {\n public:\n  HANDLE process_;\n\n  CLRDataTarget() { process_ = GetCurrentProcess(); }\n\n  virtual HRESULT STDMETHODCALLTYPE QueryInterface(THIS_ IN REFIID InterfaceId,\n                                                   OUT PVOID* Interface) {\n    if (InterfaceId == IID_IUnknown || InterfaceId == IID_ICLRDataTarget) {\n      *Interface = (ICLRDataTarget*)this;\n      // No need to refcount as this class is contained.\n      return S_OK;\n    } else {\n      *Interface = nullptr;\n      return E_NOINTERFACE;\n    }\n  }\n\n  virtual STDMETHODIMP_(ULONG) AddRef(THIS) { return 1; }\n\n  virtual STDMETHODIMP_(ULONG) Release(THIS) { return 0; }\n\n  virtual HRESULT STDMETHODCALLTYPE GetMachineType(\n      /* [out] */ ULONG32* machineType) {\n    *machineType = IMAGE_FILE_MACHINE_AMD64;\n    return S_OK;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE GetPointerSize(\n      /* [out] */ ULONG32* pointerSize) {\n    *pointerSize = 8;\n    return S_OK;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE GetImageBase(\n      /* [string][in] */ LPCWSTR imagePath,\n      /* [out] */ CLRDATA_ADDRESS* baseAddress) {\n    *baseAddress =\n        (CLRDATA_ADDRESS)GetModuleBaseAddress(GetCurrentProcessId(), imagePath);\n    return S_OK;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE ReadVirtual(\n      /* [in] */ CLRDATA_ADDRESS address,\n      /* [length_is][size_is][out] */ BYTE* buffer,\n      /* [in] */ ULONG32 bytesRequested,\n      /* [out] */ ULONG32* bytesRead) {\n    SIZE_T read;\n    ReadProcessMemory(process_, (LPCVOID)address, buffer, bytesRequested,\n                      &read);\n    *bytesRead = (ULONG32)read;\n    return S_OK;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE WriteVirtual(\n      /* [in] */ CLRDATA_ADDRESS address,\n      /* [size_is][in] */ BYTE* buffer,\n      /* [in] */ ULONG32 bytesRequested,\n      /* [out] */ ULONG32* bytesWritten) {\n    return E_NOTIMPL;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE GetTLSValue(\n      /* [in] */ ULONG32 threadID,\n      /* [in] */ ULONG32 index,\n      /* [out] */ CLRDATA_ADDRESS* value) {\n    return E_NOTIMPL;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE SetTLSValue(\n      /* [in] */ ULONG32 threadID,\n      /* [in] */ ULONG32 index,\n      /* [in] */ CLRDATA_ADDRESS value) {\n    return E_NOTIMPL;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE GetCurrentThreadID(\n      /* [out] */ ULONG32* threadID) {\n    return E_NOTIMPL;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE GetPlatform(\n      /* [out] */ CorDebugPlatform* pTargetPlatform) {\n    // CORDB_PLATFORM_WINDOWS_AMD64\n    // ORDB_PLATFORM_WINDOWS_ARM64\n\n    *pTargetPlatform = CORDB_PLATFORM_WINDOWS_AMD64;\n    return S_OK;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE GetThreadContext(\n      /* [in] */ ULONG32 threadID,\n      /* [in] */ ULONG32 contextFlags,\n      /* [in] */ ULONG32 contextSize,\n      /* [size_is][out] */ BYTE* pContext) {\n    CorDebugPlatform platform;\n    GetPlatform(&platform);\n\n    HRESULT result = E_FAIL;\n    HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, false, threadID);\n\n    if (hThread) {\n      if (platform == CORDB_PLATFORM_WINDOWS_X86) {\n        WOW64_CONTEXT context;\n        context.ContextFlags = contextFlags;\n\n        if (Wow64GetThreadContext(hThread, &context)) {\n          ZeroMemory(pContext, contextSize);\n          CopyMemory(pContext, &context,\n                     std::min(contextSize, (ULONG32)sizeof(context)));\n          result = S_OK;\n        }\n      } else if (platform == CORDB_PLATFORM_WINDOWS_AMD64) {\n        CONTEXT context;\n        context.ContextFlags = contextFlags;\n\n        if (::GetThreadContext(hThread, &context)) {\n          ZeroMemory(pContext, contextSize);\n          CopyMemory(pContext, &context,\n                     std::min(contextSize, (ULONG32)sizeof(context)));\n          result = S_OK;\n        }\n      }\n\n      CloseHandle(hThread);\n    }\n\n    return result;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE SetThreadContext(\n      /* [in] */ ULONG32 threadID,\n      /* [in] */ ULONG32 contextSize,\n      /* [size_is][in] */ BYTE* context) {\n    return E_NOTIMPL;\n  }\n\n  virtual HRESULT STDMETHODCALLTYPE Request(\n      /* [in] */ ULONG32 reqCode,\n      /* [in] */ ULONG32 inBufferSize,\n      /* [size_is][in] */ BYTE* inBuffer,\n      /* [in] */ ULONG32 outBufferSize,\n      /* [size_is][out] */ BYTE* outBuffer) {\n    return E_NOTIMPL;\n  }\n\n  static uintptr_t GetModuleBaseAddress(DWORD procId, const wchar_t* modName) {\n    uintptr_t modBaseAddr = 0;\n    HANDLE hSnap = CreateToolhelp32Snapshot(\n        TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);\n    if (hSnap != INVALID_HANDLE_VALUE) {\n      MODULEENTRY32 modEntry;\n      modEntry.dwSize = sizeof(modEntry);\n      if (Module32First(hSnap, &modEntry)) {\n        do {\n          if (!_wcsicmp(modEntry.szModule, modName)) {\n            modBaseAddr = (uintptr_t)modEntry.modBaseAddr;\n            break;\n          }\n        } while (Module32Next(hSnap, &modEntry));\n      }\n    }\n    CloseHandle(hSnap);\n    return modBaseAddr;\n  }\n\n  static std::wstring GetModulePath(DWORD procId, const wchar_t* modName) {\n    uintptr_t modBaseAddr = 0;\n    HANDLE hSnap = CreateToolhelp32Snapshot(\n        TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);\n    if (hSnap != INVALID_HANDLE_VALUE) {\n      MODULEENTRY32 modEntry;\n      modEntry.dwSize = sizeof(modEntry);\n      if (Module32First(hSnap, &modEntry)) {\n        do {\n          if (!_wcsicmp(modEntry.szModule, modName)) {\n            return modEntry.szExePath;\n          }\n        } while (Module32Next(hSnap, &modEntry));\n      }\n    }\n    CloseHandle(hSnap);\n    return L\"\";\n  }\n\n  static std::wstring GetDirectory(const std::wstring& path) {\n    size_t found = path.find_last_of(L\"/\\\\\");\n    return (path.substr(0, found));\n  }\n\n  static std::wstring FindDacBinary(ICorProfilerInfo8* _info, int machineType) {\n    USHORT pClrInstanceId;\n    COR_PRF_RUNTIME_TYPE pRuntimeType;\n    USHORT pMajorVersion;\n    USHORT pMinorVersion;\n    USHORT pBuildNumber;\n    USHORT pQFEVersion;\n    WCHAR verstr[100];\n    ULONG dummy;\n\n    _info->GetRuntimeInformation(&pClrInstanceId, &pRuntimeType, &pMajorVersion,\n                                 &pMinorVersion, &pBuildNumber, &pQFEVersion,\n                                 100, &dummy, verstr);\n\n    static const wchar_t* DesktopCLRModule = L\"clr.dll\";\n    static const wchar_t* CoreCLRModule = L\"coreclr.dll\";\n    static const wchar_t* DesktopDacModule = L\"mscordacwks.dll\";\n    static const wchar_t* CoreDacModule = L\"mscordaccore.dll\";\n\n    const wchar_t* clrModule;\n    const wchar_t* dacModule;\n\n    if (pRuntimeType == COR_PRF_CORE_CLR) {\n      clrModule = CoreCLRModule;\n      dacModule = CoreDacModule;\n    } else {\n      clrModule = DesktopCLRModule;\n      dacModule = DesktopDacModule;\n    }\n\n    auto clrPath = GetModulePath(GetCurrentProcessId(), clrModule);\n    auto clrDir = std::filesystem::path(clrPath).parent_path();\n    auto dacPath = clrDir / std::filesystem::path(dacModule);\n\n    if (std::filesystem::exists(dacPath)) {\n      return dacPath.wstring();\n    }\n\n    return L\"\";\n  }\n};"
  },
  {
    "path": "src/ManagedProfiler/CapstoneWrappers.h",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#pragma once\n#include <capstone/capstone.h>\n#include <memory>\n\n// Minimal C++ wrappers over the Capstone C API functions.\nclass CapstoneHandle : public std::shared_ptr<csh> {\n public:\n  CapstoneHandle() : std::shared_ptr<csh>(&handle_, cs_close) {}\n\n private:\n  csh handle_;\n};\n\nclass InstructionHolder {\n public:\n  InstructionHolder(CapstoneHandle handle, cs_insn* instr)\n      : handle_(handle), instr_(instr) {}\n\n  cs_insn* operator->() { return instr_; }\n\n private:\n  CapstoneHandle handle_;\n  cs_insn* instr_;\n};\n\nclass InstructionListHolder {\n public:\n  size_t Size;\n  const void* Address;\n  size_t Count;\n\n  InstructionListHolder(CapstoneHandle& handle,\n                        const void* address,\n                        size_t size,\n                        size_t startAddress)\n      : handle_(handle), Address(address), Size(size), instrs_(nullptr) {\n    Count =\n        cs_disasm(*handle_.get(), static_cast<const unsigned char*>(address),\n                  size, startAddress, 0, &instrs_);\n  }\n\n  ~InstructionListHolder() {\n    if (instrs_) {\n      cs_free(instrs_, Count);\n    }\n  }\n\n  InstructionHolder Instruction(size_t index) {\n    return *new InstructionHolder(handle_, instrs_ + index);\n  }\n\n private:\n  cs_insn* instrs_;\n  CapstoneHandle handle_;\n};\n\nclass CapstoneDisasm {\n public:\n  CapstoneDisasm(cs_arch arch, unsigned int mode) {\n    cs_open(arch, (cs_mode)mode, handle_.get());\n  }\n\n  InstructionListHolder* Disassemble(const void* code,\n                                     size_t size,\n                                     size_t startAddress = 0) {\n    return new InstructionListHolder(handle_, code, size, startAddress);\n  }\n\n  bool SetSyntax(cs_opt_value syntax) {\n    return !cs_option(*handle_.get(), cs_opt_type::CS_OPT_SYNTAX, syntax);\n  }\n\n  bool SetDetail(cs_opt_value detailedInfo) {\n    return !cs_option(*handle_.get(), cs_opt_type::CS_OPT_DETAIL, detailedInfo);\n  }\n\n private:\n  CapstoneHandle handle_;\n};"
  },
  {
    "path": "src/ManagedProfiler/Common.h",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#pragma once\n#include <stdint.h>\n#include <unknwn.h>\n\n#ifdef _WINDOWS\n#include <atlbase.h>\n#else\ntypedef int32_t HRESULT;\nstruct CAtlException {\n  HRESULT HResult;\n  CAtlException(HRESULT hr) : HResult(hr) {}\n};\n#define AtlThrow(hr) throw CAtlException(hr)\n#if defined(_DEBUG) && !defined(ATLASSERT)\n#define ATLASSERT(expr) _ASSERTE(expr)\n#endif  // ATLASSERT\n\n#include <atl.h>\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/CoreProfiler.cpp",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#include \"CoreProfiler.h\"\n#include <TlHelp32.h>\n#include <assert.h>\n#include <cordebug.h>\n#include <crosscomp.h>\n#include <dacprivate.h>\n#include <metahost.h>\n#include <stdio.h>\n#include <fstream>\n#include <mutex>\n#include <string>\n#include <unordered_set>\n#include <vector>\n#include \"CLRDataTarget.h\"\n\nstatic const wchar_t* ProfilerPipeName = L\"\\\\\\\\.\\\\pipe\\\\PEXProfilerPipe\";\n\nCComPtr<ISOSDacInterface> dac_;\nstd::unordered_set<UINT_PTR> recordedAddrs_;\nstd::mutex lock_;\nbool sessionEnded_;\n\nHRESULT __stdcall CoreProfiler::QueryInterface(REFIID riid, void** ppvObject) {\n  Log(L\"PEX: QueryInterface\");\n\n  if (ppvObject == nullptr)\n    return E_POINTER;\n\n  if (riid == __uuidof(IUnknown) || riid == __uuidof(ICorProfilerCallback) ||\n      riid == __uuidof(ICorProfilerCallback2) ||\n      riid == __uuidof(ICorProfilerCallback3) ||\n      riid == __uuidof(ICorProfilerCallback4) ||\n      riid == __uuidof(ICorProfilerCallback5) ||\n      riid == __uuidof(ICorProfilerCallback6) ||\n      riid == __uuidof(ICorProfilerCallback7) ||\n      riid == __uuidof(ICorProfilerCallback8) ||\n      riid == __uuidof(ICorProfilerCallback9) ||\n      riid == __uuidof(ICorProfilerCallback10)) {\n    AddRef();\n    *ppvObject = static_cast<ICorProfilerCallback10*>(this);\n    return S_OK;\n  }\n\n  return E_NOINTERFACE;\n}\n\nULONG __stdcall CoreProfiler::AddRef(void) {\n  return ++refCount_;\n}\n\nULONG __stdcall CoreProfiler::Release(void) {\n  auto count = --refCount_;\n  if (count == 0)\n    delete this;\n\n  return count;\n}\n\nint64_t GetMethodHandleForIP(uint64_t ip) {\n  uint64_t md = 0;\n\n  if (FAILED(dac_->GetMethodDescPtrFromIP(ip, &md)) || md == 0) {\n    DacpCodeHeaderData headerData;\n    if (FAILED(dac_->GetCodeHeaderData(ip, &headerData))) {\n      return 0;\n    }\n\n    md = headerData.MethodDescPtr;\n  }\n\n  return md;\n}\n\nvoid FindRuntimeArchitecture() {\n  HRESULT hr;\n\n  ICLRMetaHost* metaHost = nullptr;\n\n  if ((hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost,\n                              (LPVOID*)&metaHost)) != S_OK) {\n    return;\n  }\n\n  CComPtr<IEnumUnknown> runtime;\n\n  if ((hr = metaHost->EnumerateInstalledRuntimes(&runtime)) != S_OK) {\n    return;\n  }\n\n  auto frameworkName = (LPWSTR)LocalAlloc(LPTR, 2048);\n  IUnknown* enumRuntime;\n\n  while (runtime->Next(1, &enumRuntime, 0) == S_OK) {\n    CComPtr<ICLRRuntimeInfo> runtimeInfo;\n    if (enumRuntime->QueryInterface<ICLRRuntimeInfo>(&runtimeInfo) == S_OK) {\n      if (runtimeInfo != nullptr) {\n        DWORD bytes;\n        runtimeInfo->GetVersionString(frameworkName, &bytes);\n      }\n    }\n  }\n}\n\nbool IsWindowsVersionOrGreater(WORD wMajorVersion,\n                               WORD wMinorVersion = 0,\n                               WORD wBuildNumber = 0) {\n  OSVERSIONINFOEXW osvi = {};\n  osvi.dwOSVersionInfoSize = sizeof(osvi);\n  auto dwlConditionMask = VerSetConditionMask(\n      VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL),\n      VER_MINORVERSION, VER_GREATER_EQUAL);\n  if (wBuildNumber != 0) {\n    VerSetConditionMask(dwlConditionMask, VER_BUILDNUMBER, VER_GREATER_EQUAL);\n  }\n\n  osvi.dwMajorVersion = wMajorVersion;\n  osvi.dwMinorVersion = wMinorVersion;\n  osvi.wServicePackMajor = wBuildNumber;\n\n  return VerifyVersionInfoW(\n             &osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR,\n             dwlConditionMask) != FALSE;\n}\n\nbool TryGetWow64(HANDLE proc, bool& result) {\n  if (IsWindowsVersionOrGreater(5, 1)) {\n    BOOL value;\n    return IsWow64Process(proc, &value);\n  }\n\n  return false;\n}\n\nbool TryGetWow64_2(HANDLE proc, USHORT& processMachine, USHORT& nativeMachine) {\n  if (IsWindowsVersionOrGreater(11) ||\n      IsWindowsVersionOrGreater(10, 0, 10586)) {\n    return IsWow64Process2(proc, &processMachine, &nativeMachine);\n  }\n\n  return false;\n}\n\nUSHORT GetMachineType() {\n  SYSTEM_INFO sysInfo;\n  GetSystemInfo(&sysInfo);\n\n  switch (sysInfo.wProcessorArchitecture) {\n    case PROCESSOR_ARCHITECTURE_AMD64:\n      return IMAGE_FILE_MACHINE_AMD64;\n    case PROCESSOR_ARCHITECTURE_ARM:\n      return IMAGE_FILE_MACHINE_ARM;\n    case PROCESSOR_ARCHITECTURE_ARM64:\n      return IMAGE_FILE_MACHINE_ARM64;\n    default:\n      return IMAGE_FILE_MACHINE_I386;\n  }\n}\n\nUSHORT GetTargetMachine() {\n  auto handle = GetCurrentProcess();\n\n  USHORT processMachine = IMAGE_FILE_MACHINE_UNKNOWN;\n  USHORT nativeMachine = IMAGE_FILE_MACHINE_UNKNOWN;\n  USHORT targetMachine = IMAGE_FILE_MACHINE_UNKNOWN;\n\n  if (TryGetWow64_2(handle, processMachine, nativeMachine)) {\n    targetMachine = processMachine != IMAGE_FILE_MACHINE_UNKNOWN\n                        ? processMachine\n                        : nativeMachine;\n  } else {\n    bool isWow64 = false;\n    TryGetWow64(handle, isWow64);\n    targetMachine = isWow64 ? IMAGE_FILE_MACHINE_I386 : GetMachineType();\n  }\n\n  return targetMachine;\n}\n\nHRESULT CoreProfiler::Initialize(IUnknown* pICorProfilerInfoUnk) {\n  Log(\"PEX: Initialize\");\n\n  pICorProfilerInfoUnk->QueryInterface(&profilerInfo_);\n  profilerInfo_->SetEventMask2(\n      // COR_PRF_MONITOR_MODULE_LOADS |\n      // COR_PRF_MONITOR_ASSEMBLY_LOADS |\n      // COR_PRF_MONITOR_GC |\n      // COR_PRF_MONITOR_CLASS_LOADS |\n      // COR_PRF_MONITOR_THREADS |\n      // COR_PRF_MONITOR_EXCEPTIONS |\n      COR_PRF_MONITOR_JIT_COMPILATION, COR_PRF_HIGH_MONITOR_EVENT_PIPE);\n\n  /*while (!::IsDebuggerPresent())\n  {\n          Log(L\"PEX: waiting\");\n          ::Sleep(1000);\n  }*/\n\n  sessionEnded_.store(false);\n  recordedAddrs_.clear();\n\n  machineType_ = GetTargetMachine();\n  processId_ = GetCurrentProcessId();\n  pipeClient_ = new NamedPipeClient();\n\n  if (!pipeClient_->Initialize(ProfilerPipeName)) {\n    Log(\"PEX: Failed to connect to pipe\\n\");\n    return S_OK;\n  }\n\n  Log(\"PEX: Connected to pipe for proc %d\\n\", processId_);\n\n  pipeClientThread_ = new std::thread([this]() {\n    Log(\"PEX: Started pipe thread\\n\");\n    bool canceled = false;\n\n    pipeClient_->ReceiveMessages(\n        [&](PipeMessageHeader header, std::shared_ptr<char[]> messageBody) {\n          Log(\"PEX: Message %d, size %d\\n\", header.Kind, header.Size);\n\n          switch (header.Kind) {\n            case PipeMessageKind::RequestFunctionCode: {\n              auto request = (RequestFunctionCodeMessage*)messageBody.get();\n              Log(\"PEX: Request %lld id %lld\\n\", request->Address,\n                  request->FunctionId);\n\n              if (request->ProcessId == processId_) {\n                SendRequestedFunctionCode(*request);\n              }\n              break;\n            }\n            case PipeMessageKind::EndSession: {\n              sessionEnded_.store(true);\n              pipeClient_->Disconnect();\n\n              Log(\"PEX: Detaching profiler for proc %d\\n\", processId_);\n\n              /*if (FAILED(profilerInfo_->RequestProfilerDetach(10000))) {\n                      Log(\"PEX: Failed to detach proc %d\\n\",\n              processId_);\n              }\n              else {\n                      Log(\"PEX: Profiler detached for proc %d\\n\",\n              processId_);\n              }*/\n\n              return;  // Exit thread.\n            }\n          }\n        },\n        canceled);\n\n    Log(\">PEX: Stop pipe thread\\n\");\n  });\n\n  // Load DAC, used mostly to get JIT helper function names.\n  auto dacPath = CLRDataTarget::FindDacBinary(profilerInfo_, machineType_);\n  auto dacModule = LoadLibrary(dacPath.c_str());\n\n  if (dacModule) {\n    auto createProc = GetProcAddress(dacModule, \"CLRDataCreateInstance\");\n    auto createFunc = (PFN_CLRDataCreateInstance)createProc;\n    auto clrDataTarget = new CLRDataTarget();\n    IXCLRDataProcess* dataProc;\n\n    auto result = createFunc(__uuidof(IXCLRDataProcess), clrDataTarget,\n                             (void**)&dataProc);\n\n    if (SUCCEEDED(result)) {\n      auto result = dataProc->QueryInterface(&dac_);\n\n      if (SUCCEEDED(result)) {\n        Log(\"PEX: DAC initialized\");\n      } else {\n        Log(\"PEX: DAC initialization failed: %d\", result);\n      }\n    }\n  }\n\n  return S_OK;\n}\n\nbool CoreProfiler::SendRequestedFunctionCode(\n    RequestFunctionCodeMessage& request) {\n  if (sessionEnded_.load()) {\n    return true;\n  }\n\n  Log(\"PEX: SendRequestedFunctionCode: %s\",\n      GetMethodName(request.FunctionId).c_str());\n\n  ModuleID module;\n  mdToken token;\n  mdTypeDef type;\n  ClassID classId;\n  if (FAILED(profilerInfo_->GetFunctionInfo(request.FunctionId, &classId,\n                                            &module, &token))) {\n    Log(\"PEX: Failed GetFunctionInfo\\n\");\n    return false;\n  }\n\n  ULONG rejitCount;\n  if (FAILED(profilerInfo_->GetReJITIDs(request.FunctionId, 0, &rejitCount,\n                                        nullptr))) {\n    Log(\"PEX: Failed GetReJITIDs\\n\");\n    return false;\n  }\n\n  std::vector<ReJITID> rejitIds(rejitCount);  //? TODO: Use pre-allocated array\n\n  if (FAILED(profilerInfo_->GetReJITIDs(request.FunctionId, rejitCount,\n                                        &rejitCount, rejitIds.data()))) {\n    Log(\"PEX: Failed GetReJITIDs\\n\");\n    return false;\n  }\n\n  for (auto&& rejit : rejitIds) {\n    if (rejit != request.ReJITId) {\n      continue;\n    }\n\n    // Log(\"PEX: Handle RejitID %d\\n\", rejit);\n    ULONG32 addrs = 0;\n    profilerInfo_->GetNativeCodeStartAddresses(request.FunctionId, rejit, 0,\n                                               &addrs, nullptr);\n    std::vector<UINT_PTR> addr(addrs);\n    profilerInfo_->GetNativeCodeStartAddresses(request.FunctionId, rejit, addrs,\n                                               &addrs, addr.data());\n\n    for (int rejit = 0; rejit < addrs; rejit++) {\n      ULONG32 cCodeInfos2;\n      profilerInfo_->GetCodeInfo4(addr[rejit], 0, &cCodeInfos2, nullptr);\n      std::vector<COR_PRF_CODE_INFO> codeInfos2(cCodeInfos2);\n      profilerInfo_->GetCodeInfo4(addr[rejit], cCodeInfos2, &cCodeInfos2,\n                                  codeInfos2.data());\n\n      for (auto&& codeInfo : codeInfos2) {\n        //? TODO: Lock could be moved down if R/W\n        //?   also not needed after adding\n        std::lock_guard<std::mutex> lock(lock_);\n\n        if (recordedAddrs_.find(codeInfo.startAddress) !=\n            recordedAddrs_.end()) {\n          continue;\n        }\n\n        recordedAddrs_.insert(codeInfo.startAddress);\n        SendLoadedFunctionCode(request.FunctionId, codeInfo.startAddress, rejit,\n                               (uint32_t)codeInfo.size,\n                               (char*)codeInfo.startAddress);\n        SendCallTargets(request.FunctionId, rejit, (uint32_t)codeInfo.size,\n                        (char*)codeInfo.startAddress);\n      }\n    }\n  }\n\n  return true;\n}\n\nbool CoreProfiler::SendLoadedFunctionCode(uint64_t funcId,\n                                          uint64_t address,\n                                          uint32_t rejitId,\n                                          uint32_t codeSize,\n                                          char* codeByes) {\n  if (pipeClient_ != nullptr) {\n    Log(\"PEX: Sending code for funcId %llu, IP %llu, code size %d\\n\",\n        funcId, address, codeSize);\n    SendFunctionCode(*pipeClient_, funcId, address, rejitId, processId_,\n                     codeSize, codeByes);\n    Log(\"PEX: Sent code for funcId %llu, IP %llu, code size %d\\n\",\n        funcId, address, codeSize);\n  }\n\n  return true;\n}\n\nHRESULT CoreProfiler::Shutdown() {\n  Log(\"PEX: Shutdown\");\n\n  profilerInfo_.Release();\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AppDomainCreationStarted(AppDomainID appDomainId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AppDomainCreationFinished(AppDomainID appDomainId,\n                                                HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AppDomainShutdownStarted(AppDomainID appDomainId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AppDomainShutdownFinished(AppDomainID appDomainId,\n                                                HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AssemblyLoadStarted(AssemblyID assemblyId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AssemblyLoadFinished(AssemblyID assemblyId,\n                                           HRESULT hrStatus) {\n  WCHAR name[512];\n  ULONG size;\n  AppDomainID ad;\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AssemblyUnloadStarted(AssemblyID assemblyId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::AssemblyUnloadFinished(AssemblyID assemblyId,\n                                             HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ModuleLoadStarted(ModuleID moduleId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ModuleLoadFinished(ModuleID moduleId, HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ModuleUnloadStarted(ModuleID moduleId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ModuleUnloadFinished(ModuleID moduleId,\n                                           HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ModuleAttachedToAssembly(ModuleID moduleId,\n                                               AssemblyID AssemblyId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ClassLoadStarted(ClassID classId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ClassLoadFinished(ClassID classId, HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ClassUnloadStarted(ClassID classId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ClassUnloadFinished(ClassID classId, HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::FunctionUnloadStarted(FunctionID functionId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::JITCompilationStarted(FunctionID functionId,\n                                            BOOL fIsSafeToBlock) {\n  // Logger::Debug(\"JIT compilation started: %s\",\n  // GetMethodName(functionId).c_str());\n  return S_OK;\n}\n\nHRESULT CoreProfiler::JITCompilationFinished(FunctionID functionId,\n                                             HRESULT hrStatus,\n                                             BOOL fIsSafeToBlock) {\n  Log(\"PEX: JITCompilationFinished: %s\",\n      GetMethodName(functionId).c_str());\n\n  if (fIsSafeToBlock) {\n    profilerInfo_->SuspendRuntime();\n  }\n\n  HandleLoadedFunction(functionId);\n\n  if (fIsSafeToBlock) {\n    profilerInfo_->ResumeRuntime();\n  }\n\n  return S_OK;\n}\n\nbool CoreProfiler::SendCallTargetName(uint64_t ip,\n                                      uint64_t funcId,\n                                      uint32_t rejitId) {\n  auto md = GetMethodHandleForIP(ip);\n\n  if (md != 0) {\n    unsigned needed;\n    if (SUCCEEDED(dac_->GetMethodDescName(md, 0, nullptr, &needed))) {\n      auto buffer = std::make_unique<std::wstring>(needed - 1, 0);\n\n      if (SUCCEEDED(dac_->GetMethodDescName(\n              md, needed, (wchar_t*)buffer->c_str(), &needed))) {\n        //? Hacky conversion to UTF8.\n        auto result = std::make_unique<std::string>(needed - 1, 0);\n        for (size_t i = 0; i < needed; i++) {\n          (*result)[i] = (char)(*buffer)[i];\n        }\n\n        SendFunctionCallTarget(*pipeClient_, funcId, ip, rejitId, processId_,\n                               result->size() + 1, result->c_str());\n      }\n    }\n  } else {\n    unsigned needed;\n    if (SUCCEEDED(dac_->GetJitHelperFunctionName(ip, 0, nullptr, &needed))) {\n      char buffer[1024];\n\n      if (SUCCEEDED(\n              dac_->GetJitHelperFunctionName(ip, needed, buffer, &needed))) {\n        SendFunctionCallTarget(*pipeClient_, funcId, ip, rejitId, processId_,\n                               needed, buffer);\n      }\n    }\n  }\n\n  return true;\n}\n\nbool CoreProfiler::HandleLoadedFunction(uint64_t functionId) {\n  if (sessionEnded_.load()) {\n    return true;\n  }\n\n  Log(\"PEX: JITCompilationFinished: %s\",\n      GetMethodName(functionId).c_str());\n\n  ModuleID module;\n  mdToken token;\n  mdTypeDef type;\n  ClassID classId;\n  if (FAILED(profilerInfo_->GetFunctionInfo(functionId, &classId, &module,\n                                            &token))) {\n    Log(\"PEX: Failed GetFunctionInfo\\n\");\n    return false;\n  }\n\n  ULONG rejitCount;\n  if (FAILED(profilerInfo_->GetReJITIDs(functionId, 0, &rejitCount, nullptr))) {\n    Log(\"PEX: Failed GetReJITIDs\\n\");\n    return false;\n  }\n\n  std::vector<ReJITID> rejitIds(rejitCount);  //? TODO: Use pre-allocated array\n\n  if (FAILED(profilerInfo_->GetReJITIDs(functionId, rejitCount, &rejitCount,\n                                        rejitIds.data()))) {\n    Log(\"PEX: Failed GetReJITIDs\\n\");\n    return false;\n  }\n\n  for (auto&& rejit : rejitIds) {\n    ULONG32 addrs = 0;\n    profilerInfo_->GetNativeCodeStartAddresses(functionId, rejit, 0, &addrs,\n                                               nullptr);\n    std::vector<UINT_PTR> addr(addrs);\n    profilerInfo_->GetNativeCodeStartAddresses(functionId, rejit, addrs, &addrs,\n                                               addr.data());\n\n    for (int rejit = 0; rejit < addrs; rejit++) {\n      ULONG32 cCodeInfos2;\n      profilerInfo_->GetCodeInfo4(addr[rejit], 0, &cCodeInfos2, nullptr);\n      std::vector<COR_PRF_CODE_INFO> codeInfos2(cCodeInfos2);\n      profilerInfo_->GetCodeInfo4(addr[rejit], cCodeInfos2, &cCodeInfos2,\n                                  codeInfos2.data());\n\n      for (auto&& codeInfo : codeInfos2) {\n        //? TODO: Lock could be moved down if R/W\n        //?   also not needed after adding\n        std::lock_guard<std::mutex> lock(lock_);\n\n        if (recordedAddrs_.find(codeInfo.startAddress) !=\n            recordedAddrs_.end()) {\n          continue;\n        }\n\n        recordedAddrs_.insert(codeInfo.startAddress);\n        SendLoadedFunctionCode(functionId, codeInfo.startAddress, rejit,\n                               (uint32_t)codeInfo.size,\n                               (char*)codeInfo.startAddress);\n        SendCallTargets(functionId, rejit, (uint32_t)codeInfo.size,\n                        (char*)codeInfo.startAddress);\n      }\n    }\n  }\n\n  return true;\n}\n\nbool CoreProfiler::SendCallTargets(uint64_t funcId,\n                                   uint32_t rejitId,\n                                   uint32_t codeSize,\n                                   char* codeBytes) {\n  if (sessionEnded_.load()) {\n    return true;\n  }\n\n  __try {\n    switch (machineType_) {\n      case IMAGE_FILE_MACHINE_AMD64: {\n        CollectCallTargets(true, funcId, rejitId, codeBytes, codeSize);\n        break;\n      }\n      case IMAGE_FILE_MACHINE_ARM64: {\n        CollectCallTargetsArm64(funcId, rejitId, codeBytes, codeSize);\n        break;\n      }\n      case IMAGE_FILE_MACHINE_I386: {\n        CollectCallTargets(false, funcId, rejitId, codeBytes, codeSize);\n        break;\n      }\n    }\n  } __except (EXCEPTION_EXECUTE_HANDLER) {\n    // Log(\"Exception disassembling: %llx, size %d\\n\", codeInfo.startAddress,\n    // codeSize);\n    return false;\n  }\n\n  return true;\n}\n\nHRESULT CoreProfiler::JITCachedFunctionSearchStarted(\n    FunctionID functionId,\n    BOOL* pbUseCachedFunction) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::JITCachedFunctionSearchFinished(\n    FunctionID functionId,\n    COR_PRF_JIT_CACHE result) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::JITFunctionPitched(FunctionID functionId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::JITInlining(FunctionID callerId,\n                                  FunctionID calleeId,\n                                  BOOL* pfShouldInline) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ThreadCreated(ThreadID threadId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ThreadDestroyed(ThreadID threadId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ThreadAssignedToOSThread(ThreadID managedThreadId,\n                                               DWORD osThreadId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingClientInvocationStarted() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingClientSendingMessage(GUID* pCookie,\n                                                   BOOL fIsAsync) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingClientReceivingReply(GUID* pCookie,\n                                                   BOOL fIsAsync) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingClientInvocationFinished() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingServerReceivingMessage(GUID* pCookie,\n                                                     BOOL fIsAsync) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingServerInvocationStarted() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingServerInvocationReturned() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RemotingServerSendingReply(GUID* pCookie, BOOL fIsAsync) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::UnmanagedToManagedTransition(\n    FunctionID functionId,\n    COR_PRF_TRANSITION_REASON reason) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ManagedToUnmanagedTransition(\n    FunctionID functionId,\n    COR_PRF_TRANSITION_REASON reason) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RuntimeSuspendStarted(\n    COR_PRF_SUSPEND_REASON suspendReason) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RuntimeSuspendFinished() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RuntimeSuspendAborted() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RuntimeResumeStarted() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RuntimeResumeFinished() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RuntimeThreadSuspended(ThreadID threadId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RuntimeThreadResumed(ThreadID threadId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::MovedReferences(ULONG cMovedObjectIDRanges,\n                                      ObjectID* oldObjectIDRangeStart,\n                                      ObjectID* newObjectIDRangeStart,\n                                      ULONG* cObjectIDRangeLength) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ObjectAllocated(ObjectID objectId, ClassID classId) {\n  /*ModuleID module;\n  mdTypeDef type;\n  if (SUCCEEDED(_info->GetClassIDInfo(classId, &module, &type))) {\n          auto name = GetTypeName(type, module);\n  }*/\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ObjectsAllocatedByClass(ULONG cClassCount,\n                                              ClassID* classIds,\n                                              ULONG* cObjects) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ObjectReferences(ObjectID objectId,\n                                       ClassID classId,\n                                       ULONG cObjectRefs,\n                                       ObjectID* objectRefIds) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RootReferences(ULONG cRootRefs, ObjectID* rootRefIds) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionThrown(ObjectID thrownObjectId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionSearchFunctionEnter(FunctionID functionId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionSearchFunctionLeave() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionSearchFilterEnter(FunctionID functionId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionSearchFilterLeave() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionSearchCatcherFound(FunctionID functionId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionOSHandlerEnter(UINT_PTR __unused) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionOSHandlerLeave(UINT_PTR __unused) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionUnwindFunctionEnter(FunctionID functionId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionUnwindFunctionLeave() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionUnwindFinallyEnter(FunctionID functionId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionUnwindFinallyLeave() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionCatcherEnter(FunctionID functionId,\n                                            ObjectID objectId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionCatcherLeave() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::COMClassicVTableCreated(ClassID wrappedClassId,\n                                              const GUID& implementedIID,\n                                              void* pVTable,\n                                              ULONG cSlots) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::COMClassicVTableDestroyed(ClassID wrappedClassId,\n                                                const GUID& implementedIID,\n                                                void* pVTable) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionCLRCatcherFound() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ExceptionCLRCatcherExecute() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ThreadNameChanged(ThreadID threadId,\n                                        ULONG cchName,\n                                        WCHAR* name) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::GarbageCollectionStarted(int cGenerations,\n                                               BOOL* generationCollected,\n                                               COR_PRF_GC_REASON reason) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::SurvivingReferences(ULONG cSurvivingObjectIDRanges,\n                                          ObjectID* objectIDRangeStart,\n                                          ULONG* cObjectIDRangeLength) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::GarbageCollectionFinished() {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::FinalizeableObjectQueued(DWORD finalizerFlags,\n                                               ObjectID objectID) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::RootReferences2(ULONG cRootRefs,\n                                      ObjectID* rootRefIds,\n                                      COR_PRF_GC_ROOT_KIND* rootKinds,\n                                      COR_PRF_GC_ROOT_FLAGS* rootFlags,\n                                      UINT_PTR* rootIds) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::HandleCreated(GCHandleID handleId,\n                                    ObjectID initialObjectId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::HandleDestroyed(GCHandleID handleId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::InitializeForAttach(IUnknown* pCorProfilerInfoUnk,\n                                          void* pvClientData,\n                                          UINT cbClientData) {\n  Log(\"PEX: InitializeForAttach, data %d\\n\", cbClientData);\n  return Initialize(pCorProfilerInfoUnk);\n}\n\nHRESULT CoreProfiler::ProfilerAttachComplete() {\n  Log(\"PEX: ProfilerAttachComplete\\n\");\n\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ProfilerDetachSucceeded() {\n  Log(\"PEX: ProfilerDetachSucceeded\");\n\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ReJITCompilationStarted(FunctionID functionId,\n                                              ReJITID rejitId,\n                                              BOOL fIsSafeToBlock) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::GetReJITParameters(\n    ModuleID moduleId,\n    mdMethodDef methodId,\n    ICorProfilerFunctionControl* pFunctionControl) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ReJITCompilationFinished(FunctionID functionId,\n                                               ReJITID rejitId,\n                                               HRESULT hrStatus,\n                                               BOOL fIsSafeToBlock) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ReJITError(ModuleID moduleId,\n                                 mdMethodDef methodId,\n                                 FunctionID functionId,\n                                 HRESULT hrStatus) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::MovedReferences2(ULONG cMovedObjectIDRanges,\n                                       ObjectID* oldObjectIDRangeStart,\n                                       ObjectID* newObjectIDRangeStart,\n                                       SIZE_T* cObjectIDRangeLength) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::SurvivingReferences2(ULONG cSurvivingObjectIDRanges,\n                                           ObjectID* objectIDRangeStart,\n                                           SIZE_T* cObjectIDRangeLength) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ConditionalWeakTableElementReferences(\n    ULONG cRootRefs,\n    ObjectID* keyRefIds,\n    ObjectID* valueRefIds,\n    GCHandleID* rootIds) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::GetAssemblyReferences(\n    const WCHAR* wszAssemblyPath,\n    ICorProfilerAssemblyReferenceProvider* pAsmRefProvider) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::ModuleInMemorySymbolsUpdated(ModuleID moduleId) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::DynamicMethodJITCompilationStarted(FunctionID functionId,\n                                                         BOOL fIsSafeToBlock,\n                                                         LPCBYTE pILHeader,\n                                                         ULONG cbILHeader) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::DynamicMethodJITCompilationFinished(FunctionID functionId,\n                                                          HRESULT hrStatus,\n                                                          BOOL fIsSafeToBlock) {\n  return S_OK;\n}\n\nHRESULT STDMETHODCALLTYPE\nCoreProfiler::EventPipeEventDelivered(EVENTPIPE_PROVIDER provider,\n                                      DWORD eventId,\n                                      DWORD eventVersion,\n                                      ULONG cbMetadataBlob,\n                                      LPCBYTE metadataBlob,\n                                      ULONG cbEventData,\n                                      LPCBYTE eventData,\n                                      LPCGUID pActivityId,\n                                      LPCGUID pRelatedActivityId,\n                                      ThreadID eventThread,\n                                      ULONG numStackFrames,\n                                      UINT_PTR stackFrames[]) {\n  return S_OK;\n}\n\nHRESULT CoreProfiler::EventPipeProviderCreated(EVENTPIPE_PROVIDER provider) {\n  Log(\"PEX: Created provider %llu\\n\", provider);\n  return S_OK;\n}\n\nstd::string UnicodeToAnsi(const WCHAR* str) {\n#ifdef _WINDOWS\n  std::wstring ws(str);\n#else\n  std::basic_string<WCHAR> ws(str);\n#endif\n  return std::string(ws.begin(), ws.end());\n}\n\nstd::string CoreProfiler::GetTypeName(mdTypeDef type, ModuleID module) const {\n  CComPtr<IMetaDataImport> spMetadata;\n  if (SUCCEEDED(profilerInfo_->GetModuleMetaData(\n          module, ofRead, IID_IMetaDataImport,\n          reinterpret_cast<IUnknown**>(&spMetadata)))) {\n    WCHAR name[256];\n    ULONG nameSize = 256;\n    DWORD flags;\n    mdTypeDef baseType;\n    if (SUCCEEDED(spMetadata->GetTypeDefProps(type, name, 256, &nameSize,\n                                              &flags, &baseType))) {\n      return UnicodeToAnsi(name);\n    }\n  }\n  return \"\";\n}\n\nstd::string CoreProfiler::GetMethodName(FunctionID function) const {\n  ModuleID module;\n  mdToken token;\n  mdTypeDef type;\n  ClassID classId;\n  if (FAILED(\n          profilerInfo_->GetFunctionInfo(function, &classId, &module, &token)))\n    return \"\";\n\n  CComPtr<IMetaDataImport> spMetadata;\n  if (FAILED(profilerInfo_->GetModuleMetaData(\n          module, ofRead, IID_IMetaDataImport,\n          reinterpret_cast<IUnknown**>(&spMetadata))))\n    return \"\";\n  PCCOR_SIGNATURE sig;\n  ULONG blobSize, size, attributes;\n  WCHAR name[256];\n  DWORD flags;\n  ULONG codeRva;\n  if (FAILED(spMetadata->GetMethodProps(token, &type, name, 256, &size,\n                                        &attributes, &sig, &blobSize, &codeRva,\n                                        &flags)))\n    return \"\";\n\n  return GetTypeName(type, module) + \"::\" + UnicodeToAnsi(name);\n}"
  },
  {
    "path": "src/ManagedProfiler/CoreProfiler.h",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#pragma once\n#include <cor.h>\n#include <corprof.h>\n#include <atomic>\n#include <shared_mutex>\n#include <string>\n#include <thread>\n#include <unordered_set>\n#include <vector>\n#include \"CapstoneWrappers.h\"\n#include \"Common.h\"\n#include \"NamedPipeClient.h\"\n\n#undef min\n#undef max\n\ninline void Log(const std::wstring format, ...) {\n  const int TRACE_BUFFER_SIZE = 4096;\n  wchar_t buffer[TRACE_BUFFER_SIZE];\n\n  va_list args;\n  va_start(args, format);\n  _vsnwprintf_s<TRACE_BUFFER_SIZE>(\n      buffer, TRACE_BUFFER_SIZE - 2, format.c_str(),\n      args);  // Truncates if buffer is not big enough.\n  va_end(args);\n\n  ::OutputDebugStringW(buffer);\n}\n\n#ifdef DEBUG\n\ninline void Log(const std::string format, ...) {\n  const int TRACE_BUFFER_SIZE = 4096;\n  char buffer[TRACE_BUFFER_SIZE];\n\n  va_list args;\n  va_start(args, format);\n  _vsnprintf_s<TRACE_BUFFER_SIZE>(\n      buffer, TRACE_BUFFER_SIZE - 2, format.c_str(),\n      args);  // Truncates if buffer is not big enough.\n  va_end(args);\n\n  ::OutputDebugStringA(buffer);\n}\n#else\n\n#define Log\n\n#endif\n\n#pragma region ClassInfo\nstruct ClassInfo {\n  ClassInfo(mdTypeDef type, ModuleID module) : Type(type), Module(module) {}\n\n  bool operator==(const ClassInfo& other) const {\n    return Type == other.Type && Module == other.Module;\n  }\n\n  mdTypeDef Type;\n  ModuleID Module;\n};\n\ntemplate <>\nstruct std::hash<ClassInfo> {\n  size_t operator()(const ClassInfo& ci) const { return ci.Module ^ ci.Type; }\n};\n#pragma endregion\n\nclass CoreProfiler : public ICorProfilerCallback10 {\n public:\n  // Inherited via ICorProfilerCallback8\n  HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObject) override;\n  ULONG __stdcall AddRef(void) override;\n  ULONG __stdcall Release(void) override;\n  HRESULT __stdcall Initialize(IUnknown* pICorProfilerInfoUnk) override;\n  HRESULT __stdcall Shutdown(void) override;\n  HRESULT __stdcall AppDomainCreationStarted(AppDomainID appDomainId) override;\n  HRESULT __stdcall AppDomainCreationFinished(AppDomainID appDomainId,\n                                              HRESULT hrStatus) override;\n  HRESULT __stdcall AppDomainShutdownStarted(AppDomainID appDomainId) override;\n  HRESULT __stdcall AppDomainShutdownFinished(AppDomainID appDomainId,\n                                              HRESULT hrStatus) override;\n  HRESULT __stdcall AssemblyLoadStarted(AssemblyID assemblyId) override;\n  HRESULT __stdcall AssemblyLoadFinished(AssemblyID assemblyId,\n                                         HRESULT hrStatus) override;\n  HRESULT __stdcall AssemblyUnloadStarted(AssemblyID assemblyId) override;\n  HRESULT __stdcall AssemblyUnloadFinished(AssemblyID assemblyId,\n                                           HRESULT hrStatus) override;\n  HRESULT __stdcall ModuleLoadStarted(ModuleID moduleId) override;\n  HRESULT __stdcall ModuleLoadFinished(ModuleID moduleId,\n                                       HRESULT hrStatus) override;\n  HRESULT __stdcall ModuleUnloadStarted(ModuleID moduleId) override;\n  HRESULT __stdcall ModuleUnloadFinished(ModuleID moduleId,\n                                         HRESULT hrStatus) override;\n  HRESULT __stdcall ModuleAttachedToAssembly(ModuleID moduleId,\n                                             AssemblyID AssemblyId) override;\n  HRESULT __stdcall ClassLoadStarted(ClassID classId) override;\n  HRESULT __stdcall ClassLoadFinished(ClassID classId,\n                                      HRESULT hrStatus) override;\n  HRESULT __stdcall ClassUnloadStarted(ClassID classId) override;\n  HRESULT __stdcall ClassUnloadFinished(ClassID classId,\n                                        HRESULT hrStatus) override;\n  HRESULT __stdcall FunctionUnloadStarted(FunctionID functionId) override;\n  HRESULT __stdcall JITCompilationStarted(FunctionID functionId,\n                                          BOOL fIsSafeToBlock) override;\n  HRESULT __stdcall JITCompilationFinished(FunctionID functionId,\n                                           HRESULT hrStatus,\n                                           BOOL fIsSafeToBlock) override;\n  HRESULT __stdcall JITCachedFunctionSearchStarted(\n      FunctionID functionId,\n      BOOL* pbUseCachedFunction) override;\n  HRESULT __stdcall JITCachedFunctionSearchFinished(\n      FunctionID functionId,\n      COR_PRF_JIT_CACHE result) override;\n  HRESULT __stdcall JITFunctionPitched(FunctionID functionId) override;\n  HRESULT __stdcall JITInlining(FunctionID callerId,\n                                FunctionID calleeId,\n                                BOOL* pfShouldInline) override;\n  HRESULT __stdcall ThreadCreated(ThreadID threadId) override;\n  HRESULT __stdcall ThreadDestroyed(ThreadID threadId) override;\n  HRESULT __stdcall ThreadAssignedToOSThread(ThreadID managedThreadId,\n                                             DWORD osThreadId) override;\n  HRESULT __stdcall RemotingClientInvocationStarted(void) override;\n  HRESULT __stdcall RemotingClientSendingMessage(GUID* pCookie,\n                                                 BOOL fIsAsync) override;\n  HRESULT __stdcall RemotingClientReceivingReply(GUID* pCookie,\n                                                 BOOL fIsAsync) override;\n  HRESULT __stdcall RemotingClientInvocationFinished(void) override;\n  HRESULT __stdcall RemotingServerReceivingMessage(GUID* pCookie,\n                                                   BOOL fIsAsync) override;\n  HRESULT __stdcall RemotingServerInvocationStarted(void) override;\n  HRESULT __stdcall RemotingServerInvocationReturned(void) override;\n  HRESULT __stdcall RemotingServerSendingReply(GUID* pCookie,\n                                               BOOL fIsAsync) override;\n  HRESULT __stdcall UnmanagedToManagedTransition(\n      FunctionID functionId,\n      COR_PRF_TRANSITION_REASON reason) override;\n  HRESULT __stdcall ManagedToUnmanagedTransition(\n      FunctionID functionId,\n      COR_PRF_TRANSITION_REASON reason) override;\n  HRESULT __stdcall RuntimeSuspendStarted(\n      COR_PRF_SUSPEND_REASON suspendReason) override;\n  HRESULT __stdcall RuntimeSuspendFinished(void) override;\n  HRESULT __stdcall RuntimeSuspendAborted(void) override;\n  HRESULT __stdcall RuntimeResumeStarted(void) override;\n  HRESULT __stdcall RuntimeResumeFinished(void) override;\n  HRESULT __stdcall RuntimeThreadSuspended(ThreadID threadId) override;\n  HRESULT __stdcall RuntimeThreadResumed(ThreadID threadId) override;\n  HRESULT __stdcall MovedReferences(ULONG cMovedObjectIDRanges,\n                                    ObjectID oldObjectIDRangeStart[],\n                                    ObjectID newObjectIDRangeStart[],\n                                    ULONG cObjectIDRangeLength[]) override;\n  HRESULT __stdcall ObjectAllocated(ObjectID objectId,\n                                    ClassID classId) override;\n  HRESULT __stdcall ObjectsAllocatedByClass(ULONG cClassCount,\n                                            ClassID classIds[],\n                                            ULONG cObjects[]) override;\n  HRESULT __stdcall ObjectReferences(ObjectID objectId,\n                                     ClassID classId,\n                                     ULONG cObjectRefs,\n                                     ObjectID objectRefIds[]) override;\n  HRESULT __stdcall RootReferences(ULONG cRootRefs,\n                                   ObjectID rootRefIds[]) override;\n  HRESULT __stdcall ExceptionThrown(ObjectID thrownObjectId) override;\n  HRESULT __stdcall ExceptionSearchFunctionEnter(\n      FunctionID functionId) override;\n  HRESULT __stdcall ExceptionSearchFunctionLeave(void) override;\n  HRESULT __stdcall ExceptionSearchFilterEnter(FunctionID functionId) override;\n  HRESULT __stdcall ExceptionSearchFilterLeave(void) override;\n  HRESULT __stdcall ExceptionSearchCatcherFound(FunctionID functionId) override;\n  HRESULT __stdcall ExceptionOSHandlerEnter(UINT_PTR __unused) override;\n  HRESULT __stdcall ExceptionOSHandlerLeave(UINT_PTR __unused) override;\n  HRESULT __stdcall ExceptionUnwindFunctionEnter(\n      FunctionID functionId) override;\n  HRESULT __stdcall ExceptionUnwindFunctionLeave(void) override;\n  HRESULT __stdcall ExceptionUnwindFinallyEnter(FunctionID functionId) override;\n  HRESULT __stdcall ExceptionUnwindFinallyLeave(void) override;\n  HRESULT __stdcall ExceptionCatcherEnter(FunctionID functionId,\n                                          ObjectID objectId) override;\n  HRESULT __stdcall ExceptionCatcherLeave(void) override;\n  HRESULT __stdcall COMClassicVTableCreated(ClassID wrappedClassId,\n                                            REFGUID implementedIID,\n                                            void* pVTable,\n                                            ULONG cSlots) override;\n  HRESULT __stdcall COMClassicVTableDestroyed(ClassID wrappedClassId,\n                                              REFGUID implementedIID,\n                                              void* pVTable) override;\n  HRESULT __stdcall ExceptionCLRCatcherFound(void) override;\n  HRESULT __stdcall ExceptionCLRCatcherExecute(void) override;\n  HRESULT __stdcall ThreadNameChanged(ThreadID threadId,\n                                      ULONG cchName,\n                                      WCHAR name[]) override;\n  HRESULT __stdcall GarbageCollectionStarted(int cGenerations,\n                                             BOOL generationCollected[],\n                                             COR_PRF_GC_REASON reason) override;\n  HRESULT __stdcall SurvivingReferences(ULONG cSurvivingObjectIDRanges,\n                                        ObjectID objectIDRangeStart[],\n                                        ULONG cObjectIDRangeLength[]) override;\n  HRESULT __stdcall GarbageCollectionFinished(void) override;\n  HRESULT __stdcall FinalizeableObjectQueued(DWORD finalizerFlags,\n                                             ObjectID objectID) override;\n  HRESULT __stdcall RootReferences2(ULONG cRootRefs,\n                                    ObjectID rootRefIds[],\n                                    COR_PRF_GC_ROOT_KIND rootKinds[],\n                                    COR_PRF_GC_ROOT_FLAGS rootFlags[],\n                                    UINT_PTR rootIds[]) override;\n  HRESULT __stdcall HandleCreated(GCHandleID handleId,\n                                  ObjectID initialObjectId) override;\n  HRESULT __stdcall HandleDestroyed(GCHandleID handleId) override;\n  HRESULT __stdcall InitializeForAttach(IUnknown* pCorProfilerInfoUnk,\n                                        void* pvClientData,\n                                        UINT cbClientData) override;\n  HRESULT __stdcall ProfilerAttachComplete(void) override;\n  HRESULT __stdcall ProfilerDetachSucceeded(void) override;\n  HRESULT __stdcall ReJITCompilationStarted(FunctionID functionId,\n                                            ReJITID rejitId,\n                                            BOOL fIsSafeToBlock) override;\n  HRESULT __stdcall GetReJITParameters(\n      ModuleID moduleId,\n      mdMethodDef methodId,\n      ICorProfilerFunctionControl* pFunctionControl) override;\n  HRESULT __stdcall ReJITCompilationFinished(FunctionID functionId,\n                                             ReJITID rejitId,\n                                             HRESULT hrStatus,\n                                             BOOL fIsSafeToBlock) override;\n  HRESULT __stdcall ReJITError(ModuleID moduleId,\n                               mdMethodDef methodId,\n                               FunctionID functionId,\n                               HRESULT hrStatus) override;\n  HRESULT __stdcall MovedReferences2(ULONG cMovedObjectIDRanges,\n                                     ObjectID oldObjectIDRangeStart[],\n                                     ObjectID newObjectIDRangeStart[],\n                                     SIZE_T cObjectIDRangeLength[]) override;\n  HRESULT __stdcall SurvivingReferences2(\n      ULONG cSurvivingObjectIDRanges,\n      ObjectID objectIDRangeStart[],\n      SIZE_T cObjectIDRangeLength[]) override;\n  HRESULT __stdcall ConditionalWeakTableElementReferences(\n      ULONG cRootRefs,\n      ObjectID keyRefIds[],\n      ObjectID valueRefIds[],\n      GCHandleID rootIds[]) override;\n  HRESULT __stdcall GetAssemblyReferences(\n      const WCHAR* wszAssemblyPath,\n      ICorProfilerAssemblyReferenceProvider* pAsmRefProvider) override;\n  HRESULT __stdcall ModuleInMemorySymbolsUpdated(ModuleID moduleId) override;\n  HRESULT __stdcall DynamicMethodJITCompilationStarted(\n      FunctionID functionId,\n      BOOL fIsSafeToBlock,\n      LPCBYTE pILHeader,\n      ULONG cbILHeader) override;\n  HRESULT __stdcall DynamicMethodJITCompilationFinished(\n      FunctionID functionId,\n      HRESULT hrStatus,\n      BOOL fIsSafeToBlock) override;\n  HRESULT STDMETHODCALLTYPE\n  DynamicMethodUnloaded(FunctionID functionId) override {\n    return S_OK;\n  }\n\n  HRESULT STDMETHODCALLTYPE\n  EventPipeEventDelivered(EVENTPIPE_PROVIDER provider,\n                          DWORD eventId,\n                          DWORD eventVersion,\n                          ULONG cbMetadataBlob,\n                          LPCBYTE metadataBlob,\n                          ULONG cbEventData,\n                          LPCBYTE eventData,\n                          LPCGUID pActivityId,\n                          LPCGUID pRelatedActivityId,\n                          ThreadID eventThread,\n                          ULONG numStackFrames,\n                          UINT_PTR stackFrames[]) override;\n\n  HRESULT STDMETHODCALLTYPE\n  EventPipeProviderCreated(EVENTPIPE_PROVIDER provider) override;\n\n private:\n  CComPtr<ICorProfilerInfo12> profilerInfo_;\n  std::atomic<unsigned> refCount_{1};\n  int machineType_;\n  int processId_;\n  NamedPipeClient* pipeClient_;\n  std::thread* pipeClientThread_;\n  std::atomic<bool> sessionEnded_;\n\n  std::string GetTypeName(mdTypeDef type, ModuleID module) const;\n  std::string GetMethodName(FunctionID function) const;\n\n  bool HandleLoadedFunction(uint64_t functionId);\n  bool SendLoadedFunctionCode(uint64_t funcId,\n                              uint64_t address,\n                              uint32_t rejitId,\n                              uint32_t codeSize,\n                              char* codeByes);\n  bool SendCallTargets(uint64_t funcId,\n                       uint32_t rejitId,\n                       uint32_t codeSize,\n                       char* codeByes);\n  bool SendCallTargetName(uint64_t ip, uint64_t funcId, uint32_t rejitId);\n  bool SendRequestedFunctionCode(RequestFunctionCodeMessage& request);\n\n  void CollectCallTargets(bool is64BitCode,\n                          uint64_t funcId,\n                          uint32_t rejitId,\n                          void* buffer,\n                          size_t size) {\n    auto mode = cs_mode::CS_MODE_LITTLE_ENDIAN |\n                (is64BitCode ? cs_mode::CS_MODE_64 : cs_mode::CS_MODE_32);\n    auto dis = CapstoneDisasm(cs_arch::CS_ARCH_X86, mode);\n    dis.SetDetail(cs_opt_value::CS_OPT_ON);\n    dis.SetSyntax(cs_opt_value::CS_OPT_SYNTAX_INTEL);\n    int64_t startRva = (int64_t)buffer;\n\n    std::unique_ptr<InstructionListHolder> instrs(\n        dis.Disassemble(buffer, size, startRva));\n\n    if (instrs->Count == 0) {\n      return;\n    }\n\n    std::unique_ptr<std::unordered_set<uint64_t>> sentTargets;\n\n    for (size_t i = 0; i < instrs->Count; i++) {\n      auto instr = instrs->Instruction(i);\n      // Log(\"%s %s\\n\", instr->mnemonic, instr->op_str);\n      if (!instr->detail)\n        continue;\n\n      for (int i = 0; i < instr->detail->x86.op_count; i++) {\n        if (instr->detail->x86.operands[i].type == X86_OP_IMM) {\n          auto targetAddr = instr->detail->x86.operands[i].imm;\n\n          // Sent each unique call target only once.\n          if (sentTargets == nullptr) {\n            sentTargets = std::make_unique<std::unordered_set<uint64_t>>();\n          }\n\n          if (sentTargets->find(targetAddr) == sentTargets->end()) {\n            SendCallTargetName(targetAddr, funcId, rejitId);\n            sentTargets->insert(targetAddr);\n          }\n        }\n      }\n    }\n  }\n\n  void CollectCallTargetsArm64(uint64_t funcId,\n                               uint32_t rejitId,\n                               void* buffer,\n                               size_t size) {\n    auto mode = cs_mode::CS_MODE_THUMB | cs_mode::CS_MODE_LITTLE_ENDIAN;\n    auto dis = CapstoneDisasm(cs_arch::CS_ARCH_AARCH64, mode);\n    dis.SetDetail(cs_opt_value::CS_OPT_ON);\n    dis.SetSyntax(cs_opt_value::CS_OPT_SYNTAX_INTEL);\n    int64_t startRva = (int64_t)buffer;\n\n    std::unique_ptr<InstructionListHolder> instrs(\n        dis.Disassemble(buffer, size, startRva));\n\n    if (instrs->Count == 0) {\n      return;\n    }\n\n    std::unique_ptr<std::unordered_set<uint64_t>> sentTargets;\n\n    for (size_t i = 0; i < instrs->Count; i++) {\n      auto instr = instrs->Instruction(i);\n      // Log(\"%s %s\\n\", instr->mnemonic, instr->op_str);\n      if (!instr->detail)\n        continue;\n\n      // Sent each unique call target only once.\n      if (sentTargets == nullptr) {\n        sentTargets = std::make_unique<std::unordered_set<uint64_t>>();\n      }\n\n      for (int i = 0; i < instr->detail->aarch64.op_count; i++) {\n        if (instr->detail->aarch64.operands[i].type == AArch64_OP_IMM) {\n          auto targetAddr = instr->detail->aarch64.operands[i].imm;\n\n          if (sentTargets->find(targetAddr) == sentTargets->end()) {\n            SendCallTargetName(targetAddr, funcId, rejitId);\n            sentTargets->insert(targetAddr);\n          }\n        }\n      }\n    }\n  }\n};\n"
  },
  {
    "path": "src/ManagedProfiler/CoreProfilerFactory.cpp",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#include \"Common.h\"\n#include \"CoreProfilerFactory.h\"\n#include \"CoreProfiler.h\"\n#include <new>\n\nHRESULT __stdcall CoreProfilerFactory::QueryInterface(REFIID riid,\n                                                      void** ppvObject) {\n  if (ppvObject == nullptr)\n    return E_POINTER;\n\n  if (riid == __uuidof(IUnknown) || riid == __uuidof(IClassFactory)) {\n    *ppvObject = static_cast<IClassFactory*>(this);\n    return S_OK;\n  }\n  return E_NOINTERFACE;\n}\n\nULONG __stdcall CoreProfilerFactory::AddRef(void) {\n  return 2;\n}\n\nULONG __stdcall CoreProfilerFactory::Release(void) {\n  return 1;\n}\n\nHRESULT __stdcall CoreProfilerFactory::CreateInstance(IUnknown* pUnkOuter,\n                                                      REFIID riid,\n                                                      void** ppvObject) {\n  auto profiler = new (std::nothrow) CoreProfiler;\n  if (profiler == nullptr)\n    return E_OUTOFMEMORY;\n\n  auto hr = profiler->QueryInterface(riid, ppvObject);\n  profiler->Release();\n\n  return hr;\n}\n"
  },
  {
    "path": "src/ManagedProfiler/CoreProfilerFactory.h",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#pragma once\n\nclass CoreProfilerFactory : public IClassFactory {\n public:\n  // Inherited via IClassFactory\n  HRESULT __stdcall QueryInterface(REFIID riid, void** ppvObject) override;\n  ULONG __stdcall AddRef(void) override;\n  ULONG __stdcall Release(void) override;\n  HRESULT __stdcall CreateInstance(IUnknown* pUnkOuter,\n                                   REFIID riid,\n                                   void** ppvObject) override;\n  HRESULT __stdcall LockServer(BOOL fLock) override { return E_NOTIMPL; }\n};\n"
  },
  {
    "path": "src/ManagedProfiler/IRExplorerProfiler.vcxproj.filters",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup>\n    <Filter Include=\"Source Files\">\n      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\n      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\n    </Filter>\n    <Filter Include=\"Header Files\">\n      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\n      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>\n    </Filter>\n    <Filter Include=\"Resource Files\">\n      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\n      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\n    </Filter>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"CoreProfiler.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CoreProfilerFactory.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"dllmain.cpp\">\n      <Filter>Source Files</Filter>\n    </ClCompile>\n    <ClCompile Include=\"CLRDataTarget.h\">\n      <Filter>Header Files</Filter>\n    </ClCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"Common.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CoreProfilerFactory.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"NamedPipeClient.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CapstoneWrappers.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n    <ClInclude Include=\"CoreProfiler.h\">\n      <Filter>Header Files</Filter>\n    </ClInclude>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"IRExplorerProfiler.def\">\n      <Filter>Resource Files</Filter>\n    </None>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "src/ManagedProfiler/ManagedProfiler.def",
    "content": "LIBRARY\nEXPORTS\n\tDllGetClassObject PRIVATE\n"
  },
  {
    "path": "src/ManagedProfiler/ManagedProfiler.vcxproj",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <ItemGroup Label=\"ProjectConfigurations\">\n    <ProjectConfiguration Include=\"Debug|ARM64\">\n      <Configuration>Debug</Configuration>\n      <Platform>ARM64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|Win32\">\n      <Configuration>Debug</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|ARM64\">\n      <Configuration>Release</Configuration>\n      <Platform>ARM64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|Win32\">\n      <Configuration>Release</Configuration>\n      <Platform>Win32</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Debug|x64\">\n      <Configuration>Debug</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n    <ProjectConfiguration Include=\"Release|x64\">\n      <Configuration>Release</Configuration>\n      <Platform>x64</Platform>\n    </ProjectConfiguration>\n  </ItemGroup>\n  <ItemGroup>\n    <ClCompile Include=\"CLRDataTarget.h\" />\n    <ClCompile Include=\"CoreProfiler.cpp\" />\n    <ClCompile Include=\"CoreProfilerFactory.cpp\" />\n    <ClCompile Include=\"dllmain.cpp\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ClInclude Include=\"CapstoneWrappers.h\" />\n    <ClInclude Include=\"Common.h\" />\n    <ClInclude Include=\"CoreProfiler.h\" />\n    <ClInclude Include=\"CoreProfilerFactory.h\" />\n    <ClInclude Include=\"NamedPipeClient.h\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"ManagedProfiler.def\" />\n  </ItemGroup>\n  <PropertyGroup Label=\"Globals\">\n    <VCProjectVersion>17.0</VCProjectVersion>\n    <Keyword>Win32Proj</Keyword>\n    <ProjectGuid>{08ded710-2048-45c3-90f9-0d585263796d}</ProjectGuid>\n    <RootNamespace>ManagedProfiler</RootNamespace>\n    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>true</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"Configuration\">\n    <ConfigurationType>DynamicLibrary</ConfigurationType>\n    <UseDebugLibraries>false</UseDebugLibraries>\n    <PlatformToolset>v143</PlatformToolset>\n    <WholeProgramOptimization>true</WholeProgramOptimization>\n    <CharacterSet>Unicode</CharacterSet>\n  </PropertyGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\n  <ImportGroup Label=\"ExtensionSettings\">\n  </ImportGroup>\n  <ImportGroup Label=\"Shared\">\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Label=\"PropertySheets\" Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <ImportGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\" Label=\"PropertySheets\">\n    <Import Project=\"$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props\" Condition=\"exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')\" Label=\"LocalAppDataPlatform\" />\n  </ImportGroup>\n  <PropertyGroup Label=\"UserMacros\" />\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <IncludePath>$(ProjectDir)\\..\\external\\capstone\\include;$(ProjectDir)\\external\\coreclr\\inc;$(ProjectDir)\\external\\coreclr\\pal\\prebuilt\\inc;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\n    <IncludePath>$(ProjectDir)\\..\\external\\capstone\\include;$(ProjectDir)\\external\\coreclr\\inc;$(ProjectDir)\\external\\coreclr\\pal\\prebuilt\\inc;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <IncludePath>$(ProjectDir)\\..\\external\\capstone\\include;$(ProjectDir)\\external\\coreclr\\inc;$(ProjectDir)\\external\\coreclr\\pal\\prebuilt\\inc;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\n    <IncludePath>$(ProjectDir)\\..\\external\\capstone\\include;$(ProjectDir)\\external\\coreclr\\inc;$(ProjectDir)\\external\\coreclr\\pal\\prebuilt\\inc;$(IncludePath)</IncludePath>\n  </PropertyGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>WIN32;_DEBUG;MANAGEDPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|Win32'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>WIN32;NDEBUG;MANAGEDPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;MANAGEDPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <AdditionalOptions>/D_CRT_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalLibraryDirectories>$(ProjectDir)\\..\\external\\capstone\\build_static\\Release\\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>capstone.lib;corguids.lib;mscoree.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <SDLCheck>true</SDLCheck>\n      <PreprocessorDefinitions>_DEBUG;MANAGEDPROFILER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <AdditionalOptions>/D_CRT_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalLibraryDirectories>$(ProjectDir)\\..\\external\\capstone\\build_arm64_static\\Release\\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>capstone.lib;corguids.lib;mscoree.lib;%(AdditionalDependencies)</AdditionalDependencies>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>false</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;MANAGEDPROFILER_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>\n      </PrecompiledHeaderFile>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <MultiProcessorCompilation>true</MultiProcessorCompilation>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <ExceptionHandling>SyncCThrow</ExceptionHandling>\n      <AdditionalOptions>/D_CRT_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalLibraryDirectories>$(ProjectDir)\\..\\external\\capstone\\build_static\\Release\\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>capstone.lib;corguids.lib;mscoree.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <ModuleDefinitionFile>ManagedProfiler.def</ModuleDefinitionFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <ItemDefinitionGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\n    <ClCompile>\n      <WarningLevel>Level3</WarningLevel>\n      <FunctionLevelLinking>true</FunctionLevelLinking>\n      <IntrinsicFunctions>true</IntrinsicFunctions>\n      <SDLCheck>false</SDLCheck>\n      <PreprocessorDefinitions>NDEBUG;MANAGEDPROFILER_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\n      <ConformanceMode>true</ConformanceMode>\n      <PrecompiledHeader>NotUsing</PrecompiledHeader>\n      <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>\n      <ExceptionHandling>false</ExceptionHandling>\n      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\n      <LanguageStandard>stdcpp20</LanguageStandard>\n      <AdditionalOptions>/D_CRT_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>\n    </ClCompile>\n    <Link>\n      <SubSystem>Windows</SubSystem>\n      <EnableCOMDATFolding>true</EnableCOMDATFolding>\n      <OptimizeReferences>true</OptimizeReferences>\n      <GenerateDebugInformation>true</GenerateDebugInformation>\n      <EnableUAC>false</EnableUAC>\n      <AdditionalLibraryDirectories>$(ProjectDir)\\..\\external\\capstone\\build_arm64_static\\Release\\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\n      <AdditionalDependencies>capstone.lib;corguids.lib;mscoree.lib;%(AdditionalDependencies)</AdditionalDependencies>\n      <ModuleDefinitionFile>ManagedProfiler.def</ModuleDefinitionFile>\n    </Link>\n  </ItemDefinitionGroup>\n  <Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n  <ImportGroup Label=\"ExtensionTargets\">\n  </ImportGroup>\n</Project>"
  },
  {
    "path": "src/ManagedProfiler/NamedPipeClient.h",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#include <stdio.h>\n#include <windows.h>\n#include <memory>\n#include <mutex>\n#pragma once\n\nenum class PipeMessageKind : int32_t {\n  StartSession,\n  EndSession,\n  FunctionCode,\n  FunctionCallTarget,\n  RequestFunctionCode,\n};\n\n#pragma pack(push, 1)\nstruct PipeMessageHeader {\n  PipeMessageKind Kind;\n  int32_t Size;\n};\n#pragma pack(pop)\n\n#pragma pack(push, 1)\nstruct FunctionCodeMessage {\n  int64_t FunctionId;\n  int64_t Address;\n  int32_t ReJITId;\n  int32_t ProcessId;\n  int32_t CodeSize;\n  int8_t CodeBytes[];\n};\n#pragma pack(pop)\n\n#pragma pack(push, 1)\nstruct FunctionCallTargetMessage {\n  int64_t FunctionId;\n  int64_t Address;\n  int32_t ReJITId;\n  int32_t ProcessId;\n  int32_t NameLength;\n  char Name[];\n};\n#pragma pack(pop)\n\n#pragma pack(push, 1)\nstruct RequestFunctionCodeMessage {\n  int64_t FunctionId;\n  int64_t Address;\n  int32_t ReJITId;\n  int32_t ProcessId;\n};\n#pragma pack(pop)\n\nclass NamedPipeClient {\n  HANDLE handle_;\n  HANDLE readEvent_;\n  HANDLE writeEvent_;\n  std::mutex lock_;\n\n public:\n  NamedPipeClient() { handle_ = INVALID_HANDLE_VALUE; }\n\n  ~NamedPipeClient() { Disconnect(); }\n\n  bool Initialize(const wchar_t* pipeName) {\n    readEvent_ = CreateEvent(nullptr, TRUE, TRUE, nullptr);\n    writeEvent_ = CreateEvent(nullptr, TRUE, TRUE, nullptr);\n    handle_ = CreateFile(pipeName, GENERIC_WRITE | GENERIC_READ,\n                         FILE_SHARE_WRITE | FILE_SHARE_READ, nullptr,\n                         OPEN_EXISTING, FILE_FLAG_OVERLAPPED, nullptr);\n\n    return handle_ != INVALID_HANDLE_VALUE &&\n           readEvent_ != INVALID_HANDLE_VALUE &&\n           writeEvent_ != INVALID_HANDLE_VALUE;\n  }\n\n  void Disconnect() {\n    if (handle_ != INVALID_HANDLE_VALUE) {\n      CloseHandle(handle_);\n      CloseHandle(readEvent_);\n      CloseHandle(writeEvent_);\n      handle_ = readEvent_ = writeEvent_ = INVALID_HANDLE_VALUE;\n    }\n  }\n\n  bool ReadMessage(PipeMessageHeader* header,\n                   std::shared_ptr<char[]>& messageBody) {\n    if (!ReadOverlapped(sizeof(PipeMessageHeader), header)) {\n      return false;\n    }\n\n    if (header->Size > sizeof(PipeMessageHeader)) {\n      int messageSize = header->Size - sizeof(PipeMessageHeader);\n      messageBody.reset(new char[messageSize]);\n\n      if (!ReadOverlapped(messageSize, messageBody.get())) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  template <typename Action>\n  void ReceiveMessages(Action handleMessage, bool& canceled) {\n    while (!canceled) {\n      PipeMessageHeader header;\n      std::shared_ptr<char[]> messageBody;\n\n      if (!ReadMessage(&header, messageBody)) {\n        break;\n      }\n\n      // printf(\"Received %d, size %d\\n\", header.Kind, header.Size);\n      handleMessage(header, messageBody);\n    }\n  }\n\n  bool SendMessage(PipeMessageKind kind) { return WriteMessageHeader(kind, 0); }\n\n  template <class T>\n  bool SendMessage(PipeMessageKind kind, const T& data) {\n    std::unique_lock<std::mutex> lock(lock_);\n\n    if (!WriteMessageHeader(kind, sizeof(T)))\n      return false;\n\n    return WriteOverlapped(data, sizeof(T));\n  }\n\n  bool SendMessage(PipeMessageKind kind, void* data, size_t dataSize) {\n    std::unique_lock<std::mutex> lock(lock_);\n\n    if (!WriteMessageHeader(kind, dataSize))\n      return false;\n    return WriteOverlapped(data, dataSize);\n  }\n\n  bool WriteMessageHeader(PipeMessageKind kind, size_t dataSize) {\n    PipeMessageHeader header;\n    header.Kind = kind;\n    header.Size = (int32_t)dataSize + sizeof(header);\n    return WriteOverlapped(&header, sizeof(header));\n  }\n\n  bool WriteOverlapped(void* data, size_t dataSize) {\n    DWORD bytesWritten;\n    OVERLAPPED overlapped;\n    overlapped.hEvent = writeEvent_;\n    overlapped.Offset = 0;\n    overlapped.OffsetHigh = 0;\n\n    if (!WriteFile(handle_, data, dataSize, &bytesWritten, &overlapped)) {\n      if (GetLastError() != ERROR_IO_PENDING) {\n        return false;\n      }\n\n      WaitForSingleObject(writeEvent_, INFINITE);\n\n      if (!GetOverlappedResult(handle_, &overlapped, &bytesWritten, false)) {\n        return false;\n      }\n    }\n\n    return bytesWritten == dataSize;\n  }\n\n  bool ReadOverlapped(size_t dataSize, void* dataOut) {\n    DWORD bytesRead;\n    OVERLAPPED overlapped;\n    overlapped.hEvent = readEvent_;\n    overlapped.Offset = 0;\n    overlapped.OffsetHigh = 0;\n\n    if (!ReadFile(handle_, dataOut, dataSize, &bytesRead, &overlapped)) {\n      if (GetLastError() != ERROR_IO_PENDING) {\n        return false;\n      }\n\n      WaitForSingleObject(readEvent_, INFINITE);\n\n      if (!GetOverlappedResult(handle_, &overlapped, &bytesRead, false)) {\n        return false;\n      }\n    }\n\n    return bytesRead == dataSize;\n  }\n};\n\nstatic bool SendFunctionCode(NamedPipeClient& client,\n                             int64_t functionId,\n                             int64_t address,\n                             int32_t reJITId,\n                             int32_t processId,\n                             int32_t codeSize,\n                             void* codeBytes) {\n  const size_t BUFFER_SIZE = 4 * 1024;\n\n  char stackBuffer[BUFFER_SIZE];\n  std::unique_ptr<char[]> dynamicBuffer;\n  FunctionCodeMessage* message;\n  size_t messageSize = sizeof(FunctionCodeMessage) + codeSize;\n\n  if (messageSize < BUFFER_SIZE) {\n    message = (FunctionCodeMessage*)stackBuffer;\n  } else {\n    dynamicBuffer =\n        std::make_unique<char[]>(sizeof(FunctionCodeMessage) + codeSize);\n    message = (FunctionCodeMessage*)dynamicBuffer.get();\n  }\n\n  message->FunctionId = functionId;\n  message->Address = address;\n  message->ReJITId = reJITId;\n  message->ProcessId = processId;\n  message->CodeSize = codeSize;\n  memcpy(message->CodeBytes, codeBytes, codeSize);\n  return client.SendMessage(PipeMessageKind::FunctionCode, message,\n                            messageSize);\n}\n\nstatic bool SendFunctionCallTarget(NamedPipeClient& client,\n                                   int64_t functionId,\n                                   int64_t address,\n                                   int32_t reJITId,\n                                   int32_t processId,\n                                   int32_t nameLength,\n                                   const char* name) {\n  const size_t BUFFER_SIZE = 4 * 1024;\n\n  char stackBuffer[BUFFER_SIZE];\n  std::unique_ptr<char[]> dynamicBuffer;\n  FunctionCallTargetMessage* message;\n  size_t messageSize = sizeof(FunctionCallTargetMessage) + nameLength;\n\n  if (messageSize < BUFFER_SIZE) {\n    message = (FunctionCallTargetMessage*)stackBuffer;\n  } else {\n    dynamicBuffer = std::make_unique<char[]>(sizeof(FunctionCallTargetMessage) +\n                                             nameLength);\n    message = (FunctionCallTargetMessage*)dynamicBuffer.get();\n  }\n\n  message->FunctionId = functionId;\n  message->Address = address;\n  message->ReJITId = reJITId;\n  message->ProcessId = processId;\n  message->NameLength = nameLength;\n  memcpy(message->Name, name, nameLength);\n  return client.SendMessage(PipeMessageKind::FunctionCallTarget, message,\n                            messageSize);\n}\n\nstatic bool SendFunctionCallTarget(NamedPipeClient& client,\n                                   int64_t functionId,\n                                   int64_t address,\n                                   int32_t reJITId,\n                                   int32_t processId,\n                                   const char* name) {\n  return SendFunctionCallTarget(client, functionId, address, reJITId, processId,\n                                (int32_t)strlen(name) + 1, name);\n}\n"
  },
  {
    "path": "src/ManagedProfiler/dllmain.cpp",
    "content": "// Copyright (c) Microsoft Corporation\n// The Microsoft Corporation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n#include <mutex>\n#include \"Common.h\"\n#include \"CoreProfilerFactory.h\"\n#include \"CoreProfiler.h\"\n\n// COM ID required when loading the profiler DLL in the .NET runtime.\nclass __declspec(uuid(\"805A308B-061C-47F3-9B30-F785C3186E81\")) CoreProfiler;\n\nextern \"C\" BOOL __stdcall DllMain(HINSTANCE hInstDll, DWORD reason, PVOID) {\n\tswitch (reason) {\n\tcase DLL_PROCESS_ATTACH:\n\t\tLog(L\"IRX: Profiler connected\\n\");\n\t\tbreak;\n\n\tcase DLL_PROCESS_DETACH:\n\t\tbreak;\n\t}\n\treturn TRUE;\n}\n\nextern \"C\" HRESULT __stdcall DllGetClassObject(REFCLSID rclsid, REFIID riid, void** ppv) {\n\tif (rclsid == __uuidof(CoreProfiler)) {\n\t\tstatic CoreProfilerFactory factory;\n\t\treturn factory.QueryInterface(riid, ppv);\n\t}\n\treturn CLASS_E_CLASSNOTAVAILABLE;\n}\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/CrstTypeTool.cs",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// This tool exists to transform a high level description of Crst dependencies (i.e. which Crst type may be\n// acquired before or after other Crst types) into a header file that defines a enum to describe each Crst\n// type and tables that map type to numerical ranking and a string based name.\n//\n// To use the tool, run \"csc.exe CrstTypeTool.cs\" and run the resulting executable.\n//\n// The Crst type definition file is written in a very simple language. Comments begin with '//' and continue\n// to the end of the line. All remaining tokens after comment removal are simply sequences of non-whitespace\n// characters separated by whitespace. Keywords are case-insensitive and identifiers (which are always Crst\n// type names) are case sensitive. The language grammar is given below in EBNF-like form:\n//\n//      TopLevel        ::= CrstDefinition*\n//\n//      CrstDefinition  ::= 'Crst' <Crst type name> CrstDependency* 'End'\n//\n//      CrstDependency  ::= 'AcquiredBefore' <Crst type name>*\n//                      |   'AcquiredAfter' <Crst type name>*\n//                      |   'SameLevelAs' <Crst type name>*\n//                      |   'Unordered'\n//\n// Crst type names match the CrstType enums used in the source code minus the 'Crst' prefix. For example\n// CrstAppDomainCache is written as 'AppDomainCache' in the .def file.\n//\n// The dependency \"A 'AcquiredBefore' B\" indicates that CrstA may be legally held while CrstB is acquired.\n// Similarly \"A 'AcquiredAfter' B\" indicates that CrstA may be legally acquired while CrstB is held. \"A\n// 'AcquiredBefore' B\" is logically equivalent to \"B 'AcquiredAfter' A\" and authors may enter the dependency\n// is whichever seems to make the most sense to them (or add both rules if they so desire).\n//\n// 'Unordered' indicates that the Crst type does not participate in ranking (there should be very few Crsts\n// like this and those that are know how to avoid or deal with deadlocks manually).\n//\n// 'SameLevelAs' indicates the given Crst type may be acquired alongside any number of instances of the Crst\n// types indicated. \"A 'SameLevel' B\" automatically implies \"B 'SameLevel' A\" so it's not necessary to specify\n// the dependency both ways though authors can do so if they wish.\n//\n// Simple validation of the .def file (over and above syntax checking) is performed by this tool prior to\n// emitting the header file. This will catch logic errors such as referencing a Crst type that is not\n// defined or using the 'Unordered' attribute along with any other attribute within a single definition. It\n// will also catch cycles in the dependency graph (i.e. definitions that logically describe a system where the\n// Crst types can't be ranked).\n//\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\nusing System.Text.RegularExpressions;\n\n// The main application class containing the program entry point.\nclass CrstTypeTool\n{\n    // A hash containing every Crst type defined by the input .def file along with its attributes. Keyed by\n    // Crst type name (which is case sensitive and doesn't include the 'Crst' enum prefix).\n    Dictionary<string, CrstType> m_crsts = new Dictionary<string, CrstType>();\n\n    // The program entry point.\n    public static int Main()\n    {\n        try\n        {\n            // Calculate the filenames of the input and output files.\n            string inputFile = \"CrstTypes.def\";\n            string outputFile = \"crsttypes_generated.h\";\n\n            // A common error is to forget to check out the crsttypes_generated.h file first. Handle this case specially\n            // so we can give a good error message.\n            if (File.Exists(outputFile) && (File.GetAttributes(outputFile) & FileAttributes.ReadOnly) != 0)\n            {\n                Console.WriteLine(outputFile + \" is read-only, you must check it out of TFS/SD first\");\n                return 2;\n            }\n\n            // Create an instance of our application class to store state in (specifically the collection of\n            // Crst type definitions).\n            CrstTypeTool app = new CrstTypeTool();\n\n            // Create a parser for the CrstTypes.def file and run it over the input file (errors are signalled\n            // via exception, in common with all the following steps except validation).\n            new TypeFileParser().ParseFile(inputFile, app.m_crsts);\n\n            // Validate the collection of Crst type definitions we built up during parsing for common logic\n            // errors and the presence of dependency cycles. False is returned from ValidateCrsts if an error\n            // was detected (an error message will have already been output to the console at this point).\n            if (!app.ValidateCrsts())\n                return 3;\n\n            // Perform a topological sort to map each Crst type to a numeric ranking.\n            app.LevelCrsts();\n\n            // Emit the new header file containing Crst type definitions and ranking information.\n            app.WriteHeaderFile(outputFile);\n\n            // If we get here the transformation was successful; inform the user and we're done.\n            Console.WriteLine(outputFile + \" successfully updated\");\n            return 0;\n        }\n        catch (TypeFileParser.ParseError pe)\n        {\n            // Syntax errors specific to parsing the input file.\n            Console.WriteLine(\"ParseError: \" + pe.Message);\n            return 4;\n        }\n        catch (Exception e)\n        {\n            // Any other general errors (file I/O problems, out of memory etc.).\n            Console.WriteLine(\"Unexpected exception:\");\n            Console.WriteLine(e);\n            return 5;\n        }\n    }\n\n    // Emit the crsttypes_generated.h output file.\n    void WriteHeaderFile(string fileName)\n    {\n        FileStream stream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None);\n        StreamWriter writer = new StreamWriter(stream);\n\n        // Create a collection based on all the Crst types we've stored in the hash. We do this so we can sort\n        // the Crst types we emit (lexically, based on type name).\n        Dictionary<string, CrstType>.ValueCollection crstCollection = m_crsts.Values;\n        CrstType[] crsts = new CrstType[crstCollection.Count];\n        crstCollection.CopyTo(crsts, 0);\n        Array.Sort(crsts);\n\n        // Emit the header. Contains copyright information, the usual goop to avoid multiple inclusion and a\n        // header comment to discourage direct editing and point the user at the CrstTypes.def file instead\n        // (where all will be explained in greater detail).\n        writer.WriteLine(\"//\");\n        writer.WriteLine(\"// Licensed to the .NET Foundation under one or more agreements.\");\n        writer.WriteLine(\"// The .NET Foundation licenses this file to you under the MIT license.\");\n        writer.WriteLine(\"//\");\n        writer.WriteLine();\n        writer.WriteLine(\"#ifndef __CRST_TYPES_INCLUDED\");\n        writer.WriteLine(\"#define __CRST_TYPES_INCLUDED\");\n        writer.WriteLine();\n        writer.WriteLine(\"// **** THIS IS AN AUTOMATICALLY GENERATED HEADER FILE -- DO NOT EDIT!!! ****\");\n        writer.WriteLine();\n        writer.WriteLine(\"// This file describes the range of Crst types available and their mapping to a numeric level (used by the\");\n        writer.WriteLine(\"// runtime in debug mode to validate we're deadlock free). To modify these settings edit the\");\n        writer.WriteLine(\"// file:CrstTypes.def file and run the clr\\\\artifacts\\\\CrstTypeTool utility to generate a new version of this file.\");\n        writer.WriteLine();\n\n        // Emit the CrstType enum to define a value for each crst type (along with the kNumberOfCrstTypes\n        // constant).\n        writer.WriteLine(\"// Each Crst type is declared as a value in the following CrstType enum.\");\n        writer.WriteLine(\"enum CrstType\");\n        writer.WriteLine(\"{\");\n        for (int i = 0; i < crsts.Length; i++)\n            writer.WriteLine(\"    Crst\" + crsts[i].Name + \" = \" + i.ToString() + \",\");\n        writer.WriteLine(\"    kNumberOfCrstTypes = \" + crsts.Length.ToString());\n        writer.WriteLine(\"};\");\n        writer.WriteLine();\n\n        // This is the end of the regular part of the header included by most files.\n        writer.WriteLine(\"#endif // __CRST_TYPES_INCLUDED\");\n        writer.WriteLine();\n\n        // There is a second section of the header intended for inclusion only by vm\\Crst.cpp. This contains\n        // some data tables used to map crst type to rank or name. We could instead define two separate\n        // headers, but on the whole it seems simpler to do it this way.\n        writer.WriteLine(\"// Define some debug data in one module only -- vm\\\\crst.cpp.\");\n        writer.WriteLine(\"#if defined(__IN_CRST_CPP) && defined(_DEBUG)\");\n        writer.WriteLine();\n\n        // Emit the crst type to rank mapping table.\n        writer.WriteLine(\"// An array mapping CrstType to level.\");\n        writer.WriteLine(\"int g_rgCrstLevelMap[] =\");\n        writer.WriteLine(\"{\");\n        foreach (CrstType crst in crsts)\n        {\n            string crstLine = \"    \" + crst.Level + \",\";\n            crstLine = crstLine + new string(' ', 16 - crstLine.Length);\n            writer.WriteLine(crstLine + \"// Crst\" + crst.Name);\n        }\n        writer.WriteLine(\"};\");\n        writer.WriteLine();\n\n        // Emit the crst type to name mapping table.\n        writer.WriteLine(\"// An array mapping CrstType to a stringized name.\");\n        writer.WriteLine(\"LPCSTR g_rgCrstNameMap[] =\");\n        writer.WriteLine(\"{\");\n        foreach (CrstType crst in crsts)\n            writer.WriteLine(\"    \\\"Crst\" + crst.Name + \"\\\",\");\n        writer.WriteLine(\"};\");\n        writer.WriteLine();\n\n        // Emit the constant Crst.cpp uses to record an unordered rank.\n        writer.WriteLine(\"// Define a special level constant for unordered locks.\");\n        writer.WriteLine(\"#define CRSTUNORDERED (-1)\");\n        writer.WriteLine();\n\n        // Emit a couple of inline helpers to map type to rank or name (and validate the type while they're at\n        // it).\n        writer.WriteLine(\"// Define inline helpers to map Crst types to names and levels.\");\n        writer.WriteLine(\"inline static int GetCrstLevel(CrstType crstType)\");\n        writer.WriteLine(\"{\");\n        writer.WriteLine(\"    LIMITED_METHOD_CONTRACT;\");\n        writer.WriteLine(\"    _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);\");\n        writer.WriteLine(\"    return g_rgCrstLevelMap[crstType];\");\n        writer.WriteLine(\"}\");\n        writer.WriteLine(\"inline static LPCSTR GetCrstName(CrstType crstType)\");\n        writer.WriteLine(\"{\");\n        writer.WriteLine(\"    LIMITED_METHOD_CONTRACT;\");\n        writer.WriteLine(\"    _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);\");\n        writer.WriteLine(\"    return g_rgCrstNameMap[crstType];\");\n        writer.WriteLine(\"}\");\n        writer.WriteLine();\n\n        // And that's the end of the second section of the header file.\n        writer.WriteLine(\"#endif // defined(__IN_CRST_CPP) && defined(_DEBUG)\");\n\n        writer.Close();\n        stream.Close();\n    }\n\n    // Perform checking of the Crst type definitions we've read just read. Various forms of logic error are\n    // scanned for including cycles in the dependency graph. Returns true if no errors are found. If false is\n    // returned a descriptive error message will have already been written to the console.\n    bool ValidateCrsts()\n    {\n        // Look at each Crst type definition in turn.\n        foreach (CrstType crst in m_crsts.Values)\n        {\n            // Catch Crst types that are referenced but never defined.\n            if (!crst.Defined)\n            {\n                Console.WriteLine(String.Format(\"Error: CrstType 'Crst{0}' is referenced without being defined\",\n                                                crst.Name));\n                return false;\n            }\n\n            // Catch the use of the 'Unordered' attribute alongside the 'AcquiredBefore' attribute (which\n            // indicates an ordering).\n            if (crst.Level == CrstType.CrstUnordered && (crst.AcquiredBeforeList.Count > 0 ||\n                                                         crst.Group != null))\n            {\n                Console.WriteLine(String.Format(\"Error: CrstType 'Crst{0}' is declared as both unordered and acquired before 'Crst{1}'\",\n                                                crst.Name, crst.AcquiredBeforeList[0].Name));\n                return false;\n            }\n\n            // Catch the use of the 'Unordered' attribute alongside the 'SameLevelAs' attribute (which\n            // indicates an ordering).\n            if (crst.Level == CrstType.CrstUnordered && crst.Group != null)\n            {\n                Console.WriteLine(String.Format(\"Error: CrstType 'Crst{0}' is declared as both unordered and in the same level as another CrstType\",\n                                                crst.Name));\n                return false;\n            }\n\n            // Catch the simple cycle where the Crst type depends on itself.\n            if (crst.AcquiredBeforeList.Contains(crst))\n            {\n                Console.WriteLine(String.Format(\"Error: CrstType 'Crst{0}' is declared as being acquired before itself\",\n                                                crst.Name));\n                return false;\n            }\n\n            // Look for deeper cycles using a recursive algorithm in 'FindCycle()'.\n            List<CrstType> cycleList = new List<CrstType>();\n            if (FindCycle(crst, crst, cycleList))\n            {\n                Console.WriteLine(String.Format(\"Error: CrstType 'Crst{0}' is involved in a dependency cycle with the following CrstTypes:\",\n                                                crst.Name));\n                foreach (CrstType cycleCrst in cycleList)\n                    Console.WriteLine(String.Format(\"    Crst{0}\", cycleCrst.Name));\n                return false;\n            }\n        }\n\n        // Perform normalization of each set of Crst types that are included in the same group (i.e. have a\n        // 'SameLevelAs' relationship). Normalization means that each Crst type in a group will have exactly\n        // the same set of dependency rules as all the others.\n        CrstTypeGroup.NormalizeAllRules();\n\n        // The normalization process could have introduced cycles in the dependency graph so run the cycle\n        // detection pass again. We do separate passes like this since normalizing can lead to less intuitive\n        // error messages if a cycle is found: so if the cycle exists before normalization takes place we want\n        // to generate an error message then.\n        foreach (CrstType crst in m_crsts.Values)\n        {\n            List<CrstType> cycleList = new List<CrstType>();\n            if (FindCycle(crst, crst, cycleList))\n            {\n                Console.WriteLine(String.Format(\"Error: CrstType 'Crst{0}' is involved in a dependency cycle with the following CrstTypes:\",\n                                                crst.Name));\n                foreach (CrstType cycleCrst in cycleList)\n                    Console.WriteLine(String.Format(\"    Crst{0}\", cycleCrst));\n                Console.WriteLine(\"Note that the cycle was detected only after 'SameLevelAs' processing was performed so some CrstType dependencies are implied by peer CrstTypes\");\n                return false;\n            }\n        }\n\n        return true;\n    }\n\n    // Recursively determine if a cycle exists in the Crst type dependency graph rooted at the 'rootCrst'\n    // type. The 'currCrst' indicates the next dependency to be examined (it will be the same as the\n    // 'rootCrst' when we're first called). The 'cycleList' argument contains a list of Crst types we've\n    // already examined in this branch of the algorithm and serves both to avoid checking the same node twice\n    // and to provide a list of the involved Crst types should a cycle be detected.\n    // Note that this algorithm is not designed to detect general cycles in the graph, only those that involve\n    // the 'rootCrst' directly. This is somewhat inefficient but gives us a simple way to generate clear error\n    // messages.\n    bool FindCycle(CrstType rootCrst, CrstType currCrst, List<CrstType> cycleList)\n    {\n        // Add the current Crst type to the list of those we've seen.\n        cycleList.Add(currCrst);\n\n        // Look through all the dependencies of the current Crst type.\n        foreach (CrstType childCrst in currCrst.AcquiredBeforeList)\n        {\n            // If we find a reference back to the root Crst type then we've found a cycle. Start backing out\n            // from the recursion (keeping the list of nodes we visited intact) by returning true.\n            if (childCrst == rootCrst)\n                return true;\n\n            // Otherwise iterate over the dependencies of the current node and for each one that we haven't\n            // already seen and recursively extend the search.\n            if (!cycleList.Contains(childCrst))\n                if (FindCycle(rootCrst, childCrst, cycleList))\n                    return true;\n        }\n\n        // Didn't find any cycles involving the root and this node; remove this node from the potential cycle\n        // list and return up to our caller indicating such.\n        cycleList.RemoveAt(cycleList.Count - 1);\n\n        return false;\n    }\n\n    // Topologically sort all the Crsts so we can assign a total ordering to them (in the form of a numeric\n    // ranking). Ranks start from 0 (Crst types that may be acquired at any time) and increment from there\n    // (Crst types that may only be acquired if a lower type is not already held).\n    // **** NOTE: The leveling process is destructive in that we will lose all dependency information from the\n    // Crst type definitions during the course of the algorithm.\n    void LevelCrsts()\n    {\n        // Note that Crst type dependency rules have been normalized (by the input parser) so that all\n        // AcquiredBefore/AcquiredAfter relationships have been reduced to AcquiredBefore relationships (i.e.\n        // any rule of the form \"A AcquiredAfter B\" has been converted to \"B AcquiredBefore A\". Any\n        // normalization makes the algorithm easier to program, but a normaliztion to AcquiredBefore\n        // relationships was chosen since it makes it particularly easy to implement an algorithm that assigns\n        // ranks beginning with zero and moving up to an arbitrary level. Any type that doesn't have any\n        // AcquiredBefore dependencies can always be ranked at a lower level than any remaining unranked types\n        // by definition and from this we can derive a simple iterative process to rank all the crst types.\n\n        // Calculate how many Crst types we have left to rank (some are not included in this step because\n        // they've been marked as 'Unordered' in the input file).\n        int unsorted = 0;\n        foreach (CrstType crst in m_crsts.Values)\n            if (crst.Level == CrstType.CrstUnassigned)\n                unsorted++;\n\n        // The ranking level we're going to assign to Crst types on the next pass of the algorithm.\n        int currLevel = 0;\n\n        // Iterate while we still have Crst types left to rank. On each pass we'll assign a rank to those\n        // types that no longer have any dependencies forcing them to have a higher rank and then remove\n        // dependency rules involving those newly ranked types from the remaining types.\n        while (unsorted > 0)\n        {\n            // Record a flag indicating whether we manage to assign a rank to at least one Crst type on this\n            // pass. If we ever fail to do this we've hit a cycle (this is just paranoia, the Crst declaration\n            // validation performed in ValidateCrsts() should have detected such a cycle first).\n            bool madeProgress = false;\n\n            // If we spot any types that are in a group (SameLevelAs relationship) then we defer assigning a\n            // rank till we've dealt with any non-group types (we wish to always place type groups in their\n            // very own rank else the Crst rank violation detection code won't detect violations between\n            // members of the group and singleton types that happened to be assigned rank on the same pass).\n            List<CrstTypeGroup> deferredGroups = new List<CrstTypeGroup>();\n\n            // Scan through all the Crst types.\n            foreach (CrstType crst in m_crsts.Values)\n            {\n                // Skip those types that already have a rank assigned.\n                if (crst.Level != CrstType.CrstUnassigned)\n                    continue;\n\n                // We're looking for Crst types that no longer have any types that can be acquired while they\n                // are already held. This indicates that it's safe to assign the current rank to them (since\n                // there are no remaining dependencies that need to be ranked first (i.e. with a lower rank\n                // value than this type).\n                if (crst.AcquiredBeforeList.Count == 0)\n                {\n                    if (crst.Group == null)\n                    {\n                        // If this type is not part of the group we can go and assign the rank right away.\n                        crst.Level = currLevel;\n                        madeProgress = true;\n                        unsorted--;\n                    }\n                    else if (!deferredGroups.Contains(crst.Group))\n                        // Otherwise we'll defer ranking this group member until all the singletons are\n                        // processed.\n                        deferredGroups.Add(crst.Group);\n                }\n            }\n\n            // We've gone through the entire collection of Crst types and assigned the current rank level to\n            // any singleton Crst types that qualify. Now deal with any group members we detected (it's\n            // possible that more than one group qualifies for ranking at this level but we need to be careful\n            // to assign distinct rank values to each group to avoid hiding lock rank violations (since group\n            // members are always allowed to be acquired alongside any other type with the same rank value).\n            // Iterate over each distinct group that we found in this pass.\n            foreach (CrstTypeGroup group in deferredGroups)\n            {\n                // Look at our progress flag here. If it is false then we didn't have any singleton Crst types\n                // ranked at this level and we haven't processed any other groups at this level either. Thus\n                // we can rank this group at the current level. Otherwise at least one type was already ranked\n                // with this level so we need to increment to a new, distinct level to avoid ranking\n                // ambiguity.\n                if (madeProgress)\n                    currLevel++;\n\n                // Iterate through each Crst type that is a member of this group assigning them the (same)\n                // current rank.\n                foreach (CrstType crst in group.Members)\n                {\n                    // Double check that each member has the same dependencies (i.e. they should all be empty\n                    // by now). There should be no way that this error should ever occur, it's just paranoia\n                    // on my part.\n                    if (crst.AcquiredBeforeList.Count != 0)\n                        throw new Exception(\"Internal error: SameLevel CrstTypes with differing rulesets\");\n\n                    crst.Level = currLevel;\n                    unsorted--;\n                }\n\n                // Once we've processed at least one group we've made progress this iteration.\n                madeProgress = true;\n            }\n\n            // If we didn't manage to assign rank to at least one Crst type then we're not going to do any\n            // better next iteration either (because no state was updated in this iteration). This should only\n            // occur in the presence of a dependency cycle and we shouldn't get that here after a successful\n            // call to ValidateCrsts(), so this check is pure paranoia.\n            if (!madeProgress)\n            {\n                Console.WriteLine(String.Format(\"{0} unsorted remain\", unsorted));\n                throw new Exception(\"Cycle detected trying to assign level \" + currLevel.ToString());\n            }\n\n            // Loop through all the unranked Crsts types and remove any AcquiredBefore relationships that\n            // involve types we've already leveled (since those types, by definition, have already been\n            // assigned a lower rank).\n            foreach (CrstType crst in m_crsts.Values)\n            {\n                if (crst.Level != CrstType.CrstUnassigned)\n                    continue;\n                List<CrstType> prunedCrsts = crst.AcquiredBeforeList.FindAll(Unleveled);\n                crst.AcquiredBeforeList = prunedCrsts;\n            }\n\n            // Done with this rank level, move to the next.\n            currLevel++;\n        }\n    }\n\n    // Predicate method used with List<T>.FindAll() to locate Crst types that haven't had their rank assigned\n    // yet.\n    static bool Unleveled(CrstType crst)\n    {\n        return crst.Level == CrstType.CrstUnassigned;\n    }\n}\n\n// Class used to parse a CrstTypes.def file into a dictionary of Crst type definitions. It uses a simple lexer\n// that removes comments then forms tokens out of any consecutive non-whitespace characters. An equally simple\n// recursive descent parser forms Crst instances by parsing the token stream.\nclass TypeFileParser\n{\n    // Remember the input file name and the dictionary we're meant to populate.\n    string                          m_typeFileName;\n    Dictionary<string, CrstType>    m_crsts;\n\n    // Compile regular expressions for detecting comments and tokens in the parser input.\n    Regex                           m_commentRegex = new Regex(@\"//.*\");\n    Regex                           m_tokenRegex = new Regex(@\"^(\\s*(\\S+)\\s*)*\");\n\n    // Input is lexed into an array of tokens. We record the index of the token being currently parsed.\n    Token[]                         m_tokens;\n    int                             m_currToken;\n\n    // Parse the given file into Crst type definitions and place these definitions in the dictionary provided.\n    // Syntax errors are signalled via ParseError derived exceptions.\n    public void ParseFile(string typeFileName, Dictionary<string, CrstType> crsts)\n    {\n        m_typeFileName = typeFileName;\n        m_crsts = crsts;\n\n        // Lex the file into tokens.\n        InitTokenStream();\n\n        // Parse the tokens according to the grammar set out at the top of this file.\n        // Loop until we have no further tokens to process.\n        while (!IsEof())\n        {\n            // Grab the next token.\n            Token token = NextToken();\n\n            // We're at the top level, so the token had better be 'Crst'.\n            if (token.Id != KeywordId.Crst)\n                throw new UnexpectedTokenError(token, KeywordId.Crst);\n\n            // OK, parse the rest of this single Crst type definition.\n            ParseCrst();\n        }\n    }\n\n    // Parse a single Crst type definition.\n    void ParseCrst()\n    {\n        // The next token had better be an identifier (the Crst type name).\n        Token token = NextToken();\n        if (token.Id != KeywordId.Id)\n            throw new UnexpectedTokenError(token, KeywordId.Id);\n\n        // The Crst instance might already exist in the dictionary (forward references to a Crst type cause\n        // these entries to auto-vivify). But in that case the entry better not be marked as 'Defined' which\n        // would indicate a double declaration.\n        CrstType crst;\n        if (m_crsts.ContainsKey(token.Text))\n        {\n            crst = m_crsts[token.Text];\n            if (crst.Defined)\n                throw new ParseError(String.Format(\"Duplicate definition for CrstType '{0}'\", token.Text), token);\n        }\n        else\n        {\n            // Otherwise this Crst type hasn't been seen thus far so we allocate a new instance and add it to\n            // the dictionary.\n            crst = new CrstType(token.Text);\n            m_crsts.Add(crst.Name, crst);\n        }\n\n        // We're defining, not just referencing this type.\n        crst.Defined = true;\n\n        // Parse any attributes inside this definition (until we see an 'End' token).\n        bool parsingCrst = true;\n        while (parsingCrst)\n        {\n            // Get the next token. Either some attribute keyword or 'End'.\n            token = NextToken();\n            List<CrstType> list;\n\n            switch (token.Id)\n            {\n\n            case KeywordId.AcquiredBefore:\n                // Simply parse the following list of Crst types into the current type's AcquiredBefore list.\n                ParseList(crst.AcquiredBeforeList);\n                break;\n\n            case KeywordId.AcquiredAfter:\n                // AcquiredAfter is trickier. To make the ranking algorithm's life easier we actually\n                // normalize all rules to the AcquiredBefore form (see LevelCrsts() for the reasoning). So we\n                // capture the list of Crst types that follow the AcquiredAfter keyword and then append the\n                // current type to the AcquiredBefore list of each type found.\n                list = new List<CrstType>();\n                ParseList(list);\n                foreach (CrstType priorCrst in list)\n                    priorCrst.AcquiredBeforeList.Add(crst);\n                break;\n\n            case KeywordId.SameLevelAs:\n                // Parse the following list of Crst types them let the CrstTypeGroup class handle the\n                // resulting updates to the type groups we're currently maintaining. See the comments for the\n                // CrstTypeGroup class for more details.\n                list = new List<CrstType>();\n                ParseList(list);\n                foreach (CrstType sameLevelCrst in list)\n                    CrstTypeGroup.Join(crst, sameLevelCrst);\n                break;\n\n            case KeywordId.Unordered:\n                crst.Level = CrstType.CrstUnordered;\n                break;\n\n            case KeywordId.End:\n                parsingCrst = false;\n                break;\n\n            default:\n                throw new UnexpectedTokenError(token,\n                                               KeywordId.AcquiredBefore,\n                                               KeywordId.AcquiredAfter,\n                                               KeywordId.SameLevelAs,\n                                               KeywordId.Unordered);\n            }\n        }\n    }\n\n    // Parse a list of Crst type names. Any other token terminates the list (without error and without\n    // consuming that token from the stream). The list of tokens is returned as a list of corresponding\n    // CrstTypes (which are auto-vivified in the output dictionary if they haven't been declared yet).\n    void ParseList(List<CrstType> list)\n    {\n        // Parse tokens until we find a non-identifier.\n        while (true)\n        {\n            Token token = NextToken();\n            if (token.Id != KeywordId.Id)\n            {\n                // We found the list terminator. Push the non-identifier token back into the stream for our\n                // caller to parse correctly.\n                UnwindToken();\n                return;\n            }\n\n            // Look up or add a new CrstType corresponding to this type name.\n            CrstType crst;\n            if (m_crsts.ContainsKey(token.Text))\n                crst = m_crsts[token.Text];\n            else\n            {\n                crst = new CrstType(token.Text);\n                m_crsts[crst.Name] = crst;\n            }\n\n            // Add the type to the output list we're building.\n            list.Add(crst);\n        }\n    }\n\n    // Lex the input file into an array of tokens.\n    void InitTokenStream()\n    {\n        StreamReader    file = new StreamReader(m_typeFileName);\n        int             lineNumber = 1;\n        List<Token>     tokenList = new List<Token>();\n\n        // Read the file a line at a time.\n        string line;\n        while ((line = file.ReadLine()) != null)\n        {\n            // Remove comments from the current line.\n            line = m_commentRegex.Replace(line, \"\");\n\n            // Match all contiguous non-whitespace characters as individual tokens.\n            Match match = m_tokenRegex.Match(line);\n            if (match.Success)\n            {\n                // For each token captured build a token instance and record the token text and the file, line\n                // and column at which it was encountered (these latter in order to produce useful syntax\n                // error messages).\n                CaptureCollection cap = match.Groups[2].Captures;\n                for (int i = 0; i < cap.Count; i++)\n                    tokenList.Add(new Token(m_typeFileName, cap[i].Value, lineNumber, cap[i].Index));\n            }\n\n            lineNumber++;\n        }\n\n        // Record the list of tokens we captured as an array and reset the index of the next token to be\n        // handled by the parser.\n        m_tokens = tokenList.ToArray();\n        m_currToken = 0;\n    }\n\n    // Have we run out of tokens to parse?\n    bool IsEof()\n    {\n        return m_currToken >= m_tokens.Length;\n    }\n\n    // Get the next token and throw an exception if we ran out.\n    Token NextToken()\n    {\n        if (m_currToken >= m_tokens.Length)\n            throw new UnexpectedEofError();\n        return m_tokens[m_currToken++];\n    }\n\n    // Push the last token parsed back into the stream.\n    void UnwindToken()\n    {\n        if (m_currToken <= 0)\n            throw new InvalidOperationException();\n        m_currToken--;\n    }\n\n    // The various keywords we can encounter (plus Id for identifiers, which are currently always Crst type\n    // names).\n    internal enum KeywordId\n    {\n        Id,\n        Crst,\n        End,\n        AcquiredBefore,\n        AcquiredAfter,\n        Unordered,\n        SameLevelAs,\n    }\n\n    // Class encapsulating a single token captured from the input file.\n    internal class Token\n    {\n        // Hash of keyword text to enum values.\n        static Dictionary<string, KeywordId> s_keywords;\n\n        // The characters comprising the text of the token from the input file.\n        string      m_text;\n\n        // Where the token was found (for error messages).\n        string      m_file;\n        int         m_line;\n        int         m_column;\n\n        // The ID of the keyword this token represents (or KeywordId.Id).\n        KeywordId   m_id;\n\n        // Static class initialization.\n        static Token()\n        {\n            // Populate the keyword hash. No sense building complex finite state machines to improve the\n            // efficiency of keyword lexing here since the input file (and keyword set) is never going to be\n            // big enough to justify the extra work.\n            s_keywords = new Dictionary<string, KeywordId>();\n            s_keywords.Add(\"crst\", KeywordId.Crst);\n            s_keywords.Add(\"end\", KeywordId.End);\n            s_keywords.Add(\"acquiredbefore\", KeywordId.AcquiredBefore);\n            s_keywords.Add(\"acquiredafter\", KeywordId.AcquiredAfter);\n            s_keywords.Add(\"unordered\", KeywordId.Unordered);\n            s_keywords.Add(\"samelevelas\", KeywordId.SameLevelAs);\n        }\n\n        public Token(string file, string text, int line, int column)\n        {\n            m_file = file;\n            m_text = text;\n            m_line = line;\n            m_column = column;\n\n            // Map token text to keyword ID. True keywords (not identifiers) are case insensitive so normalize\n            // the text to lower case before performing the keyword hash lookup.\n            string canonName = m_text.ToLower();\n            if (s_keywords.ContainsKey(canonName))\n                m_id = s_keywords[canonName];\n            else\n                m_id = KeywordId.Id;\n        }\n\n        public string Text {get { return m_text; }}\n        public string Location {get { return String.Format(\"{0} line {1}, column {2}\", m_file, m_line, m_column); }}\n        public KeywordId Id {get { return m_id; }}\n    }\n\n    // Base class for all syntax errors reported by the parser.\n    internal class ParseError : Exception\n    {\n        // A raw error message.\n        public ParseError(string message)\n            : base(message)\n        {}\n\n        // An error message tagged with a file, line and column (coming from an error token).\n        public ParseError(string message, Token errorToken)\n            : base(String.Format(\"{0}: {1}\", errorToken.Location, message))\n        {}\n\n        // Produce a textual name for the given keyword type.\n        protected static string IdToName(KeywordId id)\n        {\n            if (id == KeywordId.Id)\n                return \"a CrstType name\";\n            return String.Format(\"'{0}'\", id.ToString());\n        }\n    }\n\n    // Syntax error used when an unexpected token is encountered which further lists the valid tokens that\n    // would otherwise have been accepted.\n    internal class UnexpectedTokenError : ParseError\n    {\n        // Produce an unexpected token message with a file, line and column coming from an error token and\n        // optionally the names of zero or more tokens that would have been accepted.\n        public UnexpectedTokenError(Token errorToken, params KeywordId[] expected)\n            : base(FormatErrorMessage(errorToken, expected))\n        {}\n\n        static string FormatErrorMessage(Token errorToken, KeywordId[] expected)\n        {\n            StringBuilder message = new StringBuilder(String.Format(\"Unexpected token '{0}' at {1}\",\n                                                                    errorToken.Text, errorToken.Location));\n            if (expected.Length == 0)\n            {\n            }\n            else if (expected.Length == 1)\n            {\n                message.Append(String.Format(\"; expected {0}\", IdToName(expected[0])));\n            }\n            else\n            {\n                message.Append(\"; expected one of \");\n                for (int i = 0; i < expected.Length - 1; i++)\n                    message.Append(String.Format(\"{0}, \", IdToName(expected[i])));\n                message.Append(IdToName(expected[expected.Length - 1]));\n\n            }\n\n            return message.ToString();\n        }\n    }\n\n    // Syntax error used when we unexpectedly ran out of tokens.\n    internal class UnexpectedEofError : ParseError\n    {\n        public UnexpectedEofError()\n            : base(\"Unexpected end of file\")\n        {}\n    }\n}\n\n// This class represents an instance of a Crst type. These are unqiuely identified by case-sensitive name (the\n// same as the enum name used in vm code, minus the 'Crst' prefix).\nclass CrstType : IComparable\n{\n    // Special level constants used to indicate unordered Crst types or those types we haven't gotten around\n    // to ranking yet.\n    public static readonly int CrstUnordered = -1;\n    public static readonly int CrstUnassigned = -2;\n\n    // Name of the type, e.g. \"AppDomainCache\" for the CrstAppDomainCache type.\n    string          m_name;\n\n    // The numeric ranking assigned to this type. Starts as CrstUnassigned and then becomes either\n    // CrstUnordered (while parsing the input file) or a number >= 0 (during LevelCrsts()).\n    int             m_level;\n\n    // List of Crst types that can be legally acquired while this one is held. (AcquiredAfter relationships\n    // are by switching the terms and adding to the second type's AcquiredBefore list).\n    List<CrstType>  m_acquiredBeforeCrsts;\n\n    // Either null if this Crst type is not in (or has not yet been determined to be in) a SameLevelAs\n    // relationship or points to a CrstTypeGroup that records all the sibling types at the same level (that\n    // have been discovered thus far during parsing).\n    CrstTypeGroup   m_group;\n\n    // Set once a definition for this type has been discovered. Used to detect double definitions and types\n    // referenced without definitions.\n    bool            m_defined;\n\n    public CrstType(string name)\n    {\n        m_name = name;\n        m_level = CrstUnassigned;\n        m_acquiredBeforeCrsts = new List<CrstType>();\n        m_group = null;\n        m_defined = false;\n    }\n\n    public string Name {get { return m_name; }}\n    public int Level {get { return m_level; } set { m_level = value; }}\n    public List<CrstType> AcquiredBeforeList {get { return m_acquiredBeforeCrsts; } set { m_acquiredBeforeCrsts = value; }}\n    public CrstTypeGroup Group {get { return m_group; } set { m_group = value; }}\n    public bool Defined {get {return m_defined; } set { m_defined = value; }}\n\n    // Helper used to sort CrstTypes. The sort order is lexical based on the type name.\n    public int CompareTo(object other)\n    {\n        return m_name.CompareTo(((CrstType)other).m_name);\n    }\n}\n\n// Every time a SameLevelAs relationship is used we need to be careful to keep track of the transitive closure\n// of all types bound in the relationship. That's because such a relationship impacts the other dependency\n// rules (each member of a SameLevelAs group must behave as though it has exactly the same dependency rules as\n// all the others). Identifying all the members is tricky because \"A SameLevelAs B\" and \"B SameLevelAs C\"\n// implies \"A SameLevelAs C\". So we use a separate tracking structure, instances of the CrstTypeGroup type, to\n// do the bookkeeping for us. Each Crst type belongs to either zero or one CrstTypeGroups. As we find new\n// SameLevelAs relationships we create new groups, add types to existing groups or merge groups (as previous\n// distinct groups are merged by the discovery of a SameLevelAs relationship that links them). By the time\n// parsing has finished we are guaranteed to have discovered all the distinct, disjoint groups and to have\n// fully populated them with the transitive closure of all related types. We can them normalize all groups\n// members so they share the same AcquiredBefore relationships.\nclass CrstTypeGroup\n{\n    // We record every group that has been formed so far. This makes normalizing all groups easier.\n    static List<CrstTypeGroup>  s_groups = new List<CrstTypeGroup>();\n\n    // Crst types that are members of the current group. There are no duplicates in this list.\n    List<CrstType>              m_members = new List<CrstType>();\n\n    // Declare a SameLevelAs relationship between the two Crst types given. Groups will be assigned, created\n    // or merged as required to maintain our guarantees (each CrstType is a member of at most one group and\n    // all CrstTypes involved in the same transitive closure of a SameLevelAs relationship are members of one\n    // group).\n    public static void Join(CrstType crst1, CrstType crst2)\n    {\n        CrstTypeGroup group;\n\n        if (crst1 == crst2)\n        {\n            // In this case the type refers to itself. Create a singleton group for this type if it doesn't\n            // already exist.\n            if (crst1.Group == null)\n            {\n                group = new CrstTypeGroup();\n                group.m_members.Add(crst1);\n\n                s_groups.Add(group);\n\n                crst1.Group = group;\n            }\n        }\n        else if (crst1.Group == null && crst2.Group == null)\n        {\n            // Neither types belong to a group already. So we can create a new one and add both types to it.\n            group = new CrstTypeGroup();\n            group.m_members.Add(crst1);\n            group.m_members.Add(crst2);\n\n            s_groups.Add(group);\n\n            crst1.Group = group;\n            crst2.Group = group;\n        }\n        else if (crst1.Group == null)\n        {\n            // The first type doesn't belong to a group yet but the second does. So we can simply add the\n            // first type to the second group.\n            group = crst2.Group;\n            group.m_members.Add(crst1);\n\n            crst1.Group = group;\n        }\n        else if (crst2.Group == null)\n        {\n            // As for the case above but the group/no-group positions are reversed.\n            group = crst1.Group;\n            group.m_members.Add(crst2);\n\n            crst2.Group = group;\n        }\n        else if (crst1.Group != crst2.Group)\n        {\n            // Both types belong to different groups so we'll have to merge them. Add the members of group 2\n            // to group 1 and throw away group 2.\n            group = crst1.Group;\n            CrstTypeGroup absorbGroup = crst2.Group;\n            foreach (CrstType crst in absorbGroup.m_members)\n            {\n                group.m_members.Add(crst);\n                crst.Group = group;\n            }\n\n            s_groups.Remove(absorbGroup);\n        }\n\n        // The only case left is when both types are already in the same group and there's no work needed in\n        // this case.\n    }\n\n    // Normalize all the groups we created during parsing. See below for the definition of normalization.\n    public static void NormalizeAllRules()\n    {\n        foreach (CrstTypeGroup group in s_groups)\n            group.NormalizeRules();\n    }\n\n    // Normalize this group. This involves adjusting the AcquiredBefore list of each member to be the union of\n    // all such rules within the group. This step allows us to detect cycles in the dependency graph that\n    // would otherwise remain hidden if we only examined the unnormalized AcquiredBefore rules.\n    void NormalizeRules()\n    {\n        // This local will contain the union of all AcquiredBefore rules.\n        List<CrstType> acquiredBeforeList = new List<CrstType>();\n\n        // Iterate through each member of the group.\n        foreach (CrstType crst in m_members)\n        {\n            // Add each AcquiredBefore rule we haven't already seen to the union.\n            foreach (CrstType afterCrst in crst.AcquiredBeforeList)\n                if (!acquiredBeforeList.Contains(afterCrst))\n                    acquiredBeforeList.Add(afterCrst);\n        }\n\n        // Reset each member's AcquiredBefore list to a copy of the union we calculated. Note it's important\n        // to make a (shallow) copy because the ranking process modifies this list and so a shared copy would\n        // cause unexpected results.\n        foreach (CrstType crst in m_members)\n            crst.AcquiredBeforeList = acquiredBeforeList.GetRange(0, acquiredBeforeList.Count);\n    }\n\n    public List<CrstType> Members {get { return m_members; }}\n}\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/CrstTypes.def",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// This file is used to describe the different types of Crst and their dependencies on other Crst types (in\n// terms of which types may be legally held while others are acquired).\n//\n// The CrstTypeTool utility is used to parse this file, verify that there are no logical inconsistencies (such\n// as a cycle in the dependencies) and generate an enum value and numerical ranking for each type. This\n// ranking is used by the runtime (in checked builds) to verify that none of the rules described below are\n// violated (which could lead to a deadlock).\n//\n// When you add a new Crst type you need to be aware of which Crst types may be already held when your Crst is\n// acquired and which other types may be subsequently acquired. You can then add a Crst definition to this\n// file and annotate it with those dependencies. Running CrstTypeTool will check to see if this introduces a\n// potential deadlock problem and if everything checks out will generate a new version of\n// file:crsttypes_generated.h.\n//\n// The format of this file is a very simple language. Comments are introduced with '//' and continue to the\n// end of the line. Keywords are case insensitive (Crst type names, however, are case sensitive since they'll\n// be translated directly to C++ enum values). Crst type names are used without the 'Crst' prefix used in C++\n// code (e.g. CrstAppDomainCache is referred to as AppDomainCache). The following words are reserved keywords\n// and may not be used as the names of Crst types:\n//      Crst\n//      End\n//      AcquiredBefore\n//      AcquiredAfter\n//      Unordered\n//      SameLevelAs\n//\n// Each Crst type definition has the following format (where [] indicates optional and ... indicates zero or\n// more repetitions):\n//      Crst <type name>\n//          [AcquiredBefore <type name>...]\n//          [AcquiredAfter <type name>...]\n//          [SameLevelAs <type name>...]\n//          [Unordered]\n//      End\n//\n// For example:\n//      Crst Foo\n//          AcquiredBefore Bar\n//          AcquiredAfter Zob Baz\n//          SameLevelAs Foo\n//      End\n//\n// This introduces a new Crst type Foo (CrstFoo inside the runtime). This type may be legally acquired when\n// the current thread holds Crst instances of type Zob, Bar or even other instances of Foo. While Foo is held\n// it is legal to acquire Crsts of type Bar. Assuming that this definition does not introduce any dependency\n// cycles, CrstTypeTool will assign a numeric rank to CrstFoo that maximizes the chance that any other Crst\n// type interaction you didn't explicitly specify (e.g. holding Foo while taking a Crst of type Wibble) will\n// generate a ranking violation assert in the checked build.\n//\n// Note that the following set of definitions:\n//      Crst A AcquiredBefore B End\n//      Crst B End\n//\n//      Crst A End\n//      Crst B AcquiredAfter A End\n//\n//      Crst A AcquiredBefore B End\n//      Crst B AcquiredAfter A End\n//\n// are all equivalent. You are free to use whichever variant seems clearest to you (CrstTypeTool will tell you\n// if you introduce conflicting rules). Similarly \"A SameLevelAs B\" implies \"B SameLevelAs A\". The initial\n// contents of this file uses AcquiredBefore in preference to AcquiredAfter purely because it was generated\n// automatically by a profiling mechanism (the initial rules were seeded from observations of Crst usage while\n// running our test suites). Feel free to add meaningful comments to existing rules if you feel they can\n// usefully clarify the reasons for particular dependencies.\n//\n// See CrstTypeTool.cs for how to consume this file.\n//\n// Each Crst type definition is currently in alphabetical order. Please maintain this convention.\n//\n\nCrst AppDomainCache\n    AcquiredBefore UniqueStack UnresolvedClassLock\nEnd\n\nCrst PinnedHeapHandleTable\n    AcquiredBefore AvailableParamTypes HandleTable IbcProfile SyncBlockCache SystemDomainDelayedUnloadList\n                   SystemDomain\nEnd\n\nCrst ArgBasedStubCache\nEnd\n\nCrst AssemblyLoader\n    AcquiredBefore DeadlockDetection UniqueStack DebuggerMutex\nEnd\n\nCrst AvailableClass\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst AvailableParamTypes\n    AcquiredBefore ModuleLookupTable IbcProfile LoaderHeap\nEnd\n\nCrst BaseDomain\n    AcquiredBefore LoaderHeap UniqueStack\nEnd\n\nCrst CCompRC\n    Unordered\nEnd\n\nCrst ClassFactInfoHash\n    AcquiredBefore SyncBlockCache ThreadStore\nEnd\n\nCrst ClassInit\n    AcquiredBefore DeadlockDetection IbcProfile\n    SameLevelAs Jit\nEnd\n\nCrst ClrNotification\n    Unordered\nEnd\n\nCrst COMWrapperCache\n    AcquiredBefore HandleTable UniqueStack\nEnd\n\nCrst DeadlockDetection\nEnd\n\nCrst DebuggerController\n    // AcquiredBefore DebuggerHeapLock DebuggerJitInfo LoaderHeap\n\n    // See bug: 581892. This has a conflict with CrstInstMethodHashTableRanking.\n    // The controller logic will be moved to OOP in V3, and so this lock will no longer be necessary.\n    // Fixing this in-proc would be difficult, and it would all be throwaway as we go oop.\n    Unordered\nEnd\n\n// This is a leaf debugger lock.\nCrst DebuggerFavorLock\n    AcquiredAfter DebuggerJitInfo DebuggerMutex\nEnd\n\n// This is the lock used by the DebuggerHeapExecutableMemoryAllocator for allocating/freeing memory.\nCrst DebuggerHeapExecMemLock\nEnd\n\n// Debugger Heap lock is the smallest of the debugger locks.\nCrst DebuggerHeapLock\n    AcquiredAfter DebuggerFavorLock DebuggerJitInfo DebuggerMutex\n    // Disabled per bug 581892\n    // AcquiredAfter DebuggerController\nEnd\n\nCrst DebuggerJitInfo\n    AcquiredBefore DebuggerHeapLock\nEnd\n\n// This is the major debugger lock.\n// It's the largest of the debugger locks.\nCrst DebuggerMutex\n    AcquiredBefore AvailableParamTypes\n                   DynamicIL LoaderHeap ModuleLookupTable\n\n    // Disabled per bug 581892\n    // AcquiredBefore DebuggerController\n    AcquiredBefore DebuggerHeapLock DebuggerJitInfo\n\nEnd\n\n// This lock is used only for testing data consistency (see code:DataTest::TestDataSafety)\n// and is released before taking any other lock except for CrstDataTest2\nCrst DataTest1\n    AcquiredAfter DebuggerMutex\nEnd\n\n// This lock is used only for testing data consistency (see code:DataTest::TestDataSafety)\n// and is released before taking any other lockCrst DataTest2\nCrst DataTest2\n    AcquiredAfter DataTest1\nEnd\n\nCrst DbgTransport\nEnd\n\nCrst DelegateToFPtrHash\nEnd\n\nCrst DomainLocalBlock\n    AcquiredBefore PinnedHeapHandleTable IbcProfile LoaderHeap SystemDomainDelayedUnloadList UniqueStack\nEnd\n\nCrst DynamicIL\nEnd\n\nCrst DynamicMT\n    AcquiredBefore IbcProfile\nEnd\n\nCrst EventStore\nEnd\n\nCrst Exception\nEnd\n\nCrst ExecutableAllocatorLock\n    AcquiredAfter LoaderHeap ArgBasedStubCache UMEntryThunkFreeListLock COMCallWrapper\nEnd\n\nCrst ExecuteManRangeLock\n    AcquiredAfter NativeImageEagerFixups\nEnd\n\nCrst FCall\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst FrozenObjectHeap\n    Unordered\nEnd\n\nCrst MethodTableExposedObject\n    Unordered\nEnd\n\nCrst RetThunkCache\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst FuncPtrStubs\n    AcquiredBefore IbcProfile LoaderHeap UniqueStack CodeFragmentHeap JumpStubCache\nEnd\n\nCrst FusionAppCtx\n    AcquiredBefore PEImage\nEnd\n\nCrst GCCover\n    AcquiredBefore LoaderHeap CodeVersioning\nEnd\n\nCrst GlobalStrLiteralMap\n    AcquiredBefore PinnedHeapHandleTable HandleTable IbcProfile SyncBlockCache SystemDomainDelayedUnloadList ThreadStore UniqueStack\nEnd\n\nCrst HandleTable\n    SameLevelAs HandleTable\nEnd\n\nCrst IbcProfile\nEnd\n\nCrst IJWFixupData\n    AcquiredBefore FuncPtrStubs IJWHash LoaderHeap\nEnd\n\nCrst IJWHash\nEnd\n\nCrst ILStubGen\n    AcquiredBefore DeadlockDetection UniqueStack\nEnd\n\nCrst InstMethodHashTable\n    AcquiredBefore LoaderHeap UniqueStack JumpStubCache\nEnd\n\nCrst Interop\n    AcquiredBefore PinnedHeapHandleTable AvailableParamTypes ClassInit DeadlockDetection DomainLocalBlock\n                   HandleTable InstMethodHashTable InteropData JitGenericHandleCache LoaderHeap SigConvert\n                   StubDispatchCache StubUnwindInfoHeapSegments SyncBlockCache TypeIDMap UnresolvedClassLock\n                   PendingTypeLoadEntry\nEnd\n\nCrst InteropData\n    AcquiredBefore LoaderHeap UniqueStack\nEnd\n\nCrst IsJMCMethod\nEnd\n\nCrst ISymUnmanagedReader\n    AcquiredBefore UniqueStack JumpStubCache\nEnd\n\nCrst Jit\n    AcquiredBefore DeadlockDetection JumpStubCache\n    SameLevelAs ClassInit\nEnd\n\nCrst JitGenericHandleCache\nEnd\n\nCrst JitPatchpoint\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst JitPerf\n    Unordered\nEnd\n\nCrst JumpStubCache\n    AcquiredBefore ExecuteManRangeLock LoaderHeap SingleUseLock\n    AcquiredAfter AppDomainCache\n                  ILStubGen\n                  TypeIDMap BaseDomain AssemblyLoader\nEnd\n\nCrst ListLock\n    Unordered\nEnd\n\n// Leaflock leveling, used for crsts that explicitly want to be a leaf lock\nCrst LeafLock\nEnd\n\nCrst LoaderAllocator\n    AcquiredBefore PinnedHeapHandleTable HandleTable UniqueStack ThreadStore\n    AcquiredAfter DomainLocalBlock\nEnd\n\nCrst LoaderAllocatorReferences\n    AcquiredBefore LoaderAllocator\n    AcquiredAfter PendingTypeLoadEntry InstMethodHashTable\nEnd\n\nCrst AssemblyList\n    AcquiredAfter LoaderAllocatorReferences ThreadStore AssemblyLoader\nEnd\n\nCrst LoaderHeap\nEnd\n\nCrst StubCache\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst ManagedObjectWrapperMap\n    AcquiredBefore HandleTable\nEnd\n\nCrst Module\n    AcquiredBefore LoaderHeap UniqueStack\nEnd\n\nCrst ModuleFixup\n    AcquiredBefore PinnedHeapHandleTable GlobalStrLiteralMap IbcProfile SyncBlockCache\nEnd\n\nCrst ModuleLookupTable\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst Nls\nEnd\n\nCrst ObjectList\n    SameLevelAs ObjectList\nEnd\n\nCrst PEImage\n    AcquiredBefore UniqueStack\nEnd\n\nCrst PendingTypeLoadEntry\n    AcquiredBefore AppDomainCache PinnedHeapHandleTable AssemblyLoader AvailableClass AvailableParamTypes\n                   BaseDomain ClassInit DeadlockDetection DebuggerController DebuggerJitInfo DebuggerMutex\n                   DomainLocalBlock Exception ExecuteManRangeLock FuncPtrStubs\n                   FusionAppCtx GlobalStrLiteralMap HandleTable IbcProfile\n                   IJWFixupData IJWHash ISymUnmanagedReader Jit JumpStubCache LoaderHeap\n                   Module ModuleLookupTable PEImage SecurityStackwalkCache\n                   SigConvert SingleUseLock StubDispatchCache StubUnwindInfoHeapSegments\n                   SyncBlockCache SystemDomain ThreadIdDispenser ThreadStore TypeIDMap UnresolvedClassLock\n    SameLevelAs PendingTypeLoadEntry\nEnd\n\n// ProfilerGCRefDataFreeList synchronizes access to the profiler API's list of\n// free, previously allocated structures that track moved references and\n// root references during a GC.\nCrst ProfilerGCRefDataFreeList\nEnd\n\n// ProfilingAPIStatus serializes attempts to transition the global status\n// from state to state, and access to the ProfilerDetachInfo structure\n// between the thread executing DetachProfiler(), and the DetachThread\n// carrying out the evacuation order.\nCrst ProfilingAPIStatus\n    AcquiredBefore ThreadStore\nEnd\n\nCrst RCWCache\n    AcquiredBefore IbcProfile LoaderHeap RCWCleanupList\nEnd\n\nCrst RCWCleanupList\nEnd\n\nCrst ExternalObjectContextCache\nEnd\n\nCrst Reflection\n    AcquiredBefore LoaderHeap UnresolvedClassLock\nEnd\n\n// Used to synchronize all rejit information stored in a given AppDomain.\nCrst CodeVersioning\n    AcquiredBefore LoaderHeap SingleUseLock DeadlockDetection JumpStubCache DebuggerController FuncPtrStubs\n    AcquiredAfter ReJITGlobalRequest ThreadStore GlobalStrLiteralMap SystemDomain DebuggerMutex MethodDescBackpatchInfoTracker\n                ReadyToRunEntryPointToMethodDescMap ClassInit AppDomainCache TypeIDMap FusionAppCtx COMWrapperCache\nEnd\n\n// Used to synchronize all global requests (which may span multiple AppDomains) which add\n// new functions to rejit tables, or request Reverts on existing functions in the rejit\n// tables.  One of these crsts exist per runtime.\nCrst ReJITGlobalRequest\n    AcquiredBefore ThreadStore CodeVersioning SystemDomain JitInlineTrackingMap\nEnd\n\n// ETW infrastructure uses this crst to protect a hash table of TypeHandles which is\n// used to remember which types have been logged (to avoid duplicate logging of the\n// same type).\nCrst EtwTypeLogHash\n    AcquiredAfter SingleUseLock\nEnd\n\nCrst SavedExceptionInfo\n    AcquiredBefore DebuggerController\nEnd\n\nCrst SaveModuleProfileData\nEnd\n\nCrst SecurityStackwalkCache\nEnd\n\nCrst SigConvert\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst SingleUseLock\n    AcquiredBefore ExecuteManRangeLock LoaderHeap UniqueStack DebuggerJitInfo\nEnd\n\nCrst UnwindInfoTableLock\n    AcquiredAfter StubUnwindInfoHeapSegments SingleUseLock\n    AcquiredBefore StressLog\nEnd\n\nCrst SpecialStatics\nEnd\n\nCrst StressLog\n    Unordered\nEnd\n\nCrst CodeFragmentHeap\n    AcquiredBefore SingleUseLock\nEnd\n\nCrst StubDispatchCache\nEnd\n\nCrst StubUnwindInfoHeapSegments\n    AcquiredAfter StubCache\nEnd\n\nCrst SyncBlockCache\n    AcquiredBefore ThreadIdDispenser\nEnd\n\nCrst SyncHashLock\nEnd\n\nCrst SystemBaseDomain\n    AcquiredBefore LoaderHeap UniqueStack\nEnd\n\nCrst SystemDomain\n    AcquiredBefore DebuggerMutex HandleTable IbcProfile SaveModuleProfileData\n                   ThreadIdDispenser ThreadStore\nEnd\n\nCrst SystemDomainDelayedUnloadList\nEnd\n\nCrst ThreadIdDispenser\nEnd\n\nCrst ThreadStore\n    AcquiredBefore AvailableParamTypes DeadlockDetection DebuggerController\n                   DebuggerHeapLock DebuggerJitInfo DynamicIL ExecuteManRangeLock HandleTable IbcProfile\n                   JitGenericHandleCache JumpStubCache LoaderHeap ModuleLookupTable ProfilerGCRefDataFreeList\n                   SingleUseLock SyncBlockCache SystemDomainDelayedUnloadList ThreadIdDispenser DebuggerMutex\nEnd\n\nCrst TypeIDMap\n    AcquiredBefore UniqueStack\nEnd\n\nCrst TypeEquivalenceMap\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst UMEntryThunkFreeListLock\nEnd\n\nCrst UniqueStack\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst UnresolvedClassLock\n    AcquiredBefore AvailableParamTypes IbcProfile JumpStubCache\nEnd\n\nCrst WrapperTemplate\n    AcquiredBefore IbcProfile\nEnd\n\nCrst UMEntryThunkCache\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst PinnedByrefValidation\nEnd\n\nCrst VSDIndirectionCellLock\n    AcquiredBefore LoaderHeap\nEnd\n\nCrst MulticoreJitHash\nEnd\n\nCrst MulticoreJitManager\n    AcquiredBefore MulticoreJitHash ThreadStore\nEnd\n\nCrst StackSampler\nEnd\n\nCrst InlineTrackingMap\n    AcquiredBefore IbcProfile\nEnd\n\nCrst JitInlineTrackingMap\n    AcquiredBefore CodeVersioning ThreadStore MethodDescBackpatchInfoTracker\nEnd\n\nCrst EventPipe\n    AcquiredAfter PendingTypeLoadEntry\n    AcquiredBefore ThreadIdDispenser ThreadStore DomainLocalBlock InstMethodHashTable\nEnd\n\nCrst NotifyGdb\nEnd\n\nCrst ReadyToRunEntryPointToMethodDescMap\n    AcquiredBefore ExecuteManRangeLock UniqueStack\nEnd\n\nCrst TieredCompilation\n    AcquiredAfter CodeVersioning\n    AcquiredBefore FuncPtrStubs\nEnd\n\nCrst COMCallWrapper\nEnd\n\nCrst MethodDescBackpatchInfoTracker\n    AcquiredBefore FuncPtrStubs\n    AcquiredAfter ReJITGlobalRequest ThreadStore SystemDomain\nEnd\n\nCrst NativeImageEagerFixups\nEnd\n\nCrst NativeImageLoad\nEnd\n\nCrst PgoData\n    AcquiredBefore LoaderHeap\nEnd\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/OpCodeGen.pl",
    "content": "# Licensed to the .NET Foundation under one or more agreements.\n# The .NET Foundation licenses this file to you under the MIT license.\n#\n# OpCodeGen.pl\n#\n# PERL script used to generate the numbering of the reference opcodes\n#\n#use strict 'vars';\n#use strict 'subs';\n#use strict 'refs';\n\n\nmy $ret = 0;\nmy %opcodeEnum;\nmy %oneByte;\nmy %twoByte;\nmy %controlFlow;\nmy @singleByteArg;\nmy %stackbehav;\nmy %opcodetype;\nmy %operandtype;\nmy %opcodes;\nmy $popstate;\nmy $pushstate;\n\n$ctrlflowcount = 0;\n\n$count = 0;\n\nmy @lowercaseAlphabet = ('a'..'z','0'..'9');\nmy %upcaseAlphabet = ();\n\nforeach $letter (@lowercaseAlphabet) {\n    $j = $letter;\n    $j=~tr/a-z/A-Z/;\n    $upcaseAlphabet{$letter}=$j;\n}\n\n$license = \"// Licensed to the .NET Foundation under one or more agreements.\\n\";\n$license .= \"// The .NET Foundation licenses this file to you under the MIT license.\\n\";\n\n$startHeaderComment = \"/*============================================================\\n**\\n\";\n$endHeaderComment = \"**\\n** THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT BY HAND!\\n\";\n$endHeaderComment .= \"** See \\$(RepoRoot)\\\\src\\\\inc\\\\OpCodeGen.pl for more information.**\\n\";\n$endHeaderComment .= \"==============================================================*/\\n\\n\";\n\n$usingAndRefEmitNmsp = \"namespace System.Reflection.Emit\\n{\\n\\n\";\n$obsoleteAttr = \"        [Obsolete(\\\"This API has been deprecated. https://go.microsoft.com/fwlink/?linkid=14202\\\")]\\n\";\n\n# Open source file and target files\n\nopen (OPCODE, \"opcode.def\") or die \"Couldn't open opcode.def: $!\\n\";\nopen (OUTPUT, \">OpCodes.cs\") or die \"Couldn't open OpCodes.cs: $!\\n\";\nopen (FCOUTPUT, \">FlowControl.cs\") or die \"Couldn't open FlowControl.cs: $!\\n\";\nopen (SOUTPUT, \">StackBehaviour.cs\") or die \"Couldn't open StackBehaviour.cs: $!\\n\";\nopen (OCOUTPUT, \">OpCodeType.cs\") or die \"Couldn't open OpCodeType.cs: $!\\n\";\nopen (OPOUTPUT, \">OperandType.cs\") or die \"Couldn't open OperandType.cs: $!\\n\";\n\nprint OUTPUT $license;\nprint OUTPUT $startHeaderComment;\nprint OUTPUT \"** Class: OpCodes\\n\";\nprint OUTPUT \"**\\n\";\nprint OUTPUT \"** Purpose: Exposes all of the IL instructions supported by the runtime.\\n\";\nprint OUTPUT $endHeaderComment;\n\nprint OUTPUT $usingAndRefEmitNmsp;\n\nprint FCOUTPUT $license;\nprint FCOUTPUT $startHeaderComment;\nprint FCOUTPUT \"** Enumeration: FlowControl\\n\";\nprint FCOUTPUT \"**\\n\";\nprint FCOUTPUT \"** Purpose: Exposes FlowControl Attribute of IL.\\n\";\nprint FCOUTPUT $endHeaderComment;\n\nprint FCOUTPUT $usingAndRefEmitNmsp;\nprint FCOUTPUT \"    public enum FlowControl\\n    {\\n\";\n\nprint SOUTPUT $license;\nprint SOUTPUT $startHeaderComment;\nprint SOUTPUT \"** Enumeration: StackBehaviour\\n\";\nprint SOUTPUT \"**\\n\";\nprint SOUTPUT \"** Purpose: Exposes StackBehaviour Attribute of IL.\\n\";\nprint SOUTPUT $endHeaderComment;\n\nprint SOUTPUT $usingAndRefEmitNmsp;\nprint SOUTPUT \"    public enum StackBehaviour\\n    {\\n\";\n\nprint OCOUTPUT $license;\nprint OCOUTPUT $startHeaderComment;\nprint OCOUTPUT \"** Enumeration: OpCodeType\\n\";\nprint OCOUTPUT \"**\\n\";\nprint OCOUTPUT \"** Purpose: Exposes OpCodeType Attribute of IL.\\n\";\nprint OCOUTPUT $endHeaderComment;\n\nprint OCOUTPUT $usingAndRefEmitNmsp;\nprint OCOUTPUT \"    public enum OpCodeType\\n    {\\n\";\n\nprint OPOUTPUT $license;\nprint OPOUTPUT $startHeaderComment;\nprint OPOUTPUT \"** Enumeration: OperandType\\n\";\nprint OPOUTPUT \"**\\n\";\nprint OPOUTPUT \"** Purpose: Exposes OperandType Attribute of IL.\\n\";\nprint OPOUTPUT $endHeaderComment;\n\nprint OPOUTPUT $usingAndRefEmitNmsp;\nprint OPOUTPUT \"    public enum OperandType\\n    {\\n\";\n\nwhile (<OPCODE>)\n{\n    # Process only OPDEF(....) lines\n    if (/OPDEF\\(\\s*/)\n    {\n\tchop;               # Strip off trailing CR\n\ts/^OPDEF\\(\\s*//;    # Strip off \"OP(\"\n\ts/,\\s*/,/g;         # Remove whitespace\n\ts/\\).*$//;          # Strip off \")\" and everything behind it at end\n\n\t# Split the line up into its basic parts\n\t($enumname, $stringname, $pop, $push, $operand, $type, $size, $s1, $s2, $ctrl) = split(/,/);\n\t$s1 =~ s/0x//;\n\t$s1 = hex($s1);\n\t$s2 =~ s/0x//;\n\t$s2 = hex($s2);\n\n\tif ($size == 0)\n\t{\n\t\tnext;\n\t}\n\n\tnext if ($enumname =~ /UNUSED/);\n\n\t#Remove the prefix\n\t$enumname=~s/CEE_//g;\n\n\t#Convert name to our casing convention\n\t$enumname=~tr/A-Z/a-z/;\n\t$enumname=~s/^(.)/\\u$1/g;\n\t$enumname=~s/_(.)/_\\u$1/g;\n\n\t#Convert pop to our casing convention\n\t$pop=~tr/A-Z/a-z/;\n\t$pop=~s/^(.)/\\u$1/g;\n\t$pop=~s/_(.)/_\\u$1/g;\n\n\t#Convert push to our casing convention\n\t$push=~tr/A-Z/a-z/;\n\t$push=~s/^(.)/\\u$1/g;\n\t$push=~s/_(.)/_\\u$1/g;\n\n\t#Convert operand to our casing convention\n\t#$operand=~tr/A-Z/a-z/;\n\t#$operand=~s/^(.)/\\u$1/g;\n\t#$operand=~s/_(.)/_\\u$1/g;\n\n\t#Remove the I prefix on type\n\t$type=~s/I//g;\n\n\t#Convert Type to our casing convention\n\t$type=~tr/A-Z/a-z/;\n\t$type=~s/^(.)/\\u$1/g;\n\t$type=~s/_(.)/_\\u$1/g;\n\n\t#Convert ctrl to our casing convention\n\t$ctrl=~tr/A-Z/a-z/;\n\t$ctrl=~s/^(.)/\\u$1/g;\n\t$ctrl=~s/_(.)/_\\u$1/g;\n\n\t# Make a list of the flow Control type\n\n\t# Make a list of the opcodes and their values\n\tif ($opcodes{$enumname})\n\t{\n\t}\n\telsif ($size == 1)\n\t{\n\t\t$opcodes{$enumname} = $s2;\n\t}\n\telsif ($size == 2)\n\t{\n        $opcodes{$enumname} = ($s2 + 256 * $s1);\n\t}\n\n\t#Make a list of the instructions which only take one-byte arguments\n\tif ($enumname =~ /^.*_S$/) {\n\t    #but exclude the deprecated expressions (sometimes spelled \"depricated\")\n\t    if (!($enumname=~/^Depr.cated.*/)) {\n\t\tmy $caseStatement = sprintf(\"        case %-20s: \\n\", $enumname);\n\t\tpush(@singleByteArg, $caseStatement);\n\t    }\n\t}\n\n\t#make a list of the control Flow Types\n\tif ($controlFlow{$ctrl})\n\t{\n\t\t#printf(\"DUPE Control Flow\\n\");\n\t}\n\telse\n\t{\n\t\t$controlFlow{$ctrl} = $ctrlflowcount;\n\t\t$ctrlflowcount++;\n\t}\n\n\t$ctrlflowcount\t= 0;\n\t#make a list of the StackBehaviour Types\n\t$pop=~s/\\+/_/g;\n\tif ($stackbehav{$pop})\n\t{\n\t\t#printf(\"DUPE stack behaviour pop\\n\");\n\t}\n\telse\n\t{\n\t\t$stackbehav{$pop} = $ctrlflowcount;\n\t\t$ctrlflowcount++;\n\t}\n\n\t#make a list of the StackBehaviour Types\n\t$push=~s/\\+/_/g;\n\tif ($stackbehav{$push})\n\t{\n\t\t#printf(\"DUPE stack behaviour push\\n\");\n\t}\n\telse\n\t{\n\t\t$stackbehav{$push} = $ctrlflowcount;\n\t\t$ctrlflowcount++;\n\t}\n\t#make a list of operand types\n\tif ($operandtype{$operand})\n\t{\n\t\t#printf(\"DUPE operand type\\n\");\n\t}\n\telse\n\t{\n\t\t$operandtype{$operand} = $ctrlflowcount;\n\t\t$ctrlflowcount++;\n\t}\n\n\n\t#make a list of opcode types\n\tif ($opcodetype{$type})\n\t{\n\t\t#printf(\"DUPE opcode type\\n\");\n\t}\n\telse\n\t{\n\t\t$opcodetype{$type} = $ctrlflowcount;\n\t\t$ctrlflowcount++;\n\t}\n\n    my $opcodeName = $enumname;\n\n\t# Tailcall OpCode enum name does not comply with convention\n\t# that all enum names are exactly the same as names in opcode.def\n\t# file less leading CEE_ and changed casing convention\n\t$enumname = substr $enumname, 0, 4 unless $enumname !~ m/Tailcall$/;\n\n\t# If string name ends with dot OpCode enum name ends with underscore\n\t$enumname .= \"_\" unless $stringname !~ m/\\.\"$/;\n\n    printf(\" OpCode name:%20s,\\t\\tEnum label:%20s,\\t\\tString name:%20s\\n\", $opcodeName, $enumname, $stringname);\n\tif ($stringname eq \"arglist\")\n\t{\n\t\tprint \"This is arglist----------\\n\";\n\t}\n\n    my $lineEnum;\n\tif ($size == 1)\n\t{\n\t    $lineEnum = sprintf(\"        %s = 0x%.2x,\\n\", $enumname, $s2);\n\t\t$opcodeEnum{$s2} = $lineEnum;\n\t}\n\telsif ($size == 2)\n\t{\n\t\t$lineEnum = sprintf(\"        %s = 0x%.4x,\\n\", $enumname, $s2 + 256 * $s1);\n\t\t$opcodeEnum{$s2 + 256 * $s1} = $lineEnum;\n\t}\n\n\tmy $line;\n\t$line = sprintf(\"        public static readonly OpCode %s = new OpCode(OpCodeValues.%s,\\n\", $opcodeName, $enumname);\n\t$line .= sprintf(\"            ((int)OperandType.%s) |\\n\", $operand);\n\t$line .= sprintf(\"            ((int)FlowControl.%s << OpCode.FlowControlShift) |\\n\", $ctrl);\n\t$line .= sprintf(\"            ((int)OpCodeType.%s << OpCode.OpCodeTypeShift) |\\n\", $type);\n\t$line .= sprintf(\"            ((int)StackBehaviour.%s << OpCode.StackBehaviourPopShift) |\\n\", $pop);\n\t$line .= sprintf(\"            ((int)StackBehaviour.%s << OpCode.StackBehaviourPushShift) |\\n\", $push);\n\n\t$popstate = 0;\n\tif($pop eq \"Pop0\" || $pop eq \"Varpop\")\n\t{\n\t\t$popstate = 0;\n\t}\n\telsif ($pop eq \"Pop1\" || $pop eq \"Popi\" || $pop eq \"Popref\")\n\t{\n\t\t$popstate = $popstate -1;\n\t}\n\telsif ($pop eq \"Pop1_pop1\" || $pop eq \"Popi_pop1\" || $pop eq \"Popi_popi\" || $pop eq \"Popi_popi8\" || $pop eq \"Popi_popr4\" || $pop eq \"Popi_popr8\" || $pop eq \"Popref_pop1\" || $pop eq \"Popref_popi\")\n\t{\n\t\t$popstate = $popstate -2;\n\t}\n\telsif ($pop eq \"Popi_popi_popi\" || $pop eq \"Popref_popi_popi\" || $pop eq \"Popref_popi_popi8\" || $pop eq \"Popref_popi_popr4\" || $pop eq \"Popref_popi_popr8\" || $pop eq \"Popref_popi_popref\" || $pop eq \"Popref_popi_pop1\")\n\t{\n\t\t$popstate = $popstate -3;\n\t}\n\n\tif ($push eq \"Push1\" || $push eq \"Pushi\" ||$push eq \"Pushi8\" ||$push eq \"Pushr4\" ||$push eq \"Pushr8\" ||$push eq \"Pushref\")\n\t{\n\t\t$popstate = $popstate + 1;\n\t}\n\telsif($push eq \"Push1_push1\")\n\t{\n\t\t$popstate = $popstate + 2;\n\t}\n\n\t$line .= sprintf(\"            (%s << OpCode.SizeShift) |\\n\", $size);\n\tif ($ctrl =~ m/Return/ || $ctrl =~ m/^Branch/ || $ctrl =~ m/^Throw/ || $enumname =~ m/Jmp/){\n\t\t$line .= sprintf(\"            OpCode.EndsUncondJmpBlkFlag |\\n\", $size);\n\t}\n\t$line .= sprintf(\"            (%d << OpCode.StackChangeShift)\\n\", $popstate);\n\t$line .= sprintf(\"        );\\n\\n\");\n\n\tif ($size == 1)\n\t{\n\t    if ($oneByte{$s2})\n\t\t{\n\t\t\tprintf(\"Error opcode 0x%x  already defined!\\n\", $s2);\n\t\t\tprint \"   Old = $oneByte{$s2}\";\n\t\t\tprint \"   New = $line\";\n\t\t\t$ret = -1;\n\t    }\n\t    $oneByte{$s2} = $line;\n\t}\n\telsif ($size == 2)\n\t{\n\t    if ($twoByte{$s2})\n\t\t{\n\t\t\tprintf(\"Error opcode 0x%x%x  already defined!\\n\", $s1, $s2);\n\t\t\tprint \"   Old = $oneByte{$s2}\";\n\t\t\tprint \"   New = $line\";\n\t\t\t$ret = -1;\n\t    }\n\n\t    $twoByte{$s2 + 256 * $s1} = $line;\n\t}\n\telse\n\t{\n\t    $line .= \"\\n\";\n\t    push(@deprecated, $line);\n\t\tprintf(\"deprecated code!\\n\");\n\t}\n\t$count++;\n\t}\n}\n\n# Generate the Flow Control enum\n$ctrlflowcount = 0;\nforeach $key (sort {$a cmp $b} keys (%controlFlow))\n{\n\tprint FCOUTPUT \"        $key\";\n\tprint FCOUTPUT \" = $ctrlflowcount,\\n\";\n\t$ctrlflowcount++;\n\tif ($key =~ m/Next/){\n\t    print FCOUTPUT $obsoleteAttr;\n\t\tprint FCOUTPUT \"        Phi\";\n\t\tprint FCOUTPUT \" = $ctrlflowcount,\\n\";\n\t\t$ctrlflowcount++;\n\t}\n}\n#end the flowcontrol enum\nprint FCOUTPUT \"    }\\n}\\n\";\n\n# Generate the StackBehaviour enum\n$ctrlflowcount = 0;\nforeach $key (sort {$a cmp $b} keys (%stackbehav))\n{\n\tif ($key !~ m/Popref_popi_pop1/){\n\t\tprint SOUTPUT \"        $key\";\n\t\tprint SOUTPUT \" = $ctrlflowcount,\\n\";\n\t\t$ctrlflowcount++;\n\t}\n}\nprint SOUTPUT \"        Popref_popi_pop1 = $ctrlflowcount,\\n\";\n#end the StackBehaviour enum\nprint SOUTPUT \"    }\\n}\\n\";\n\n# Generate OpCodeType enum\n$ctrlflowcount = 0;\nforeach $key (sort {$a cmp $b} keys (%opcodetype))\n{\n\tif ($ctrlflowcount == 0){\n\t    print OCOUTPUT $obsoleteAttr;\n\t\tprint OCOUTPUT \"        Annotation = 0,\\n\";\n\t\t$ctrlflowcount++;\n\t}\n\tprint OCOUTPUT \"        $key\";\n\tprint OCOUTPUT \" = $ctrlflowcount,\\n\";\n\t$ctrlflowcount++;\n}\n# end the OpCodeType enum\nprint OCOUTPUT \"    }\\n}\\n\";\n\n# Generate OperandType enum\n$ctrlflowcount = 0;\nforeach $key (sort {$a cmp $b} keys (%operandtype))\n{\n\tprint OPOUTPUT \"        $key\";\n\tprint OPOUTPUT \" = $ctrlflowcount,\\n\";\n\t$ctrlflowcount++;\n\tif ($key =~ m/InlineNone/){\n\t    print OPOUTPUT $obsoleteAttr;\n\t\tprint OPOUTPUT \"        InlinePhi = 6,\\n\";\n\t\t$ctrlflowcount++;\n\t}\n\tif ($key =~ m/^InlineR$/){\n\t\t$ctrlflowcount++;\n\t}\n}\n#end the OperandType enum\nprint OPOUTPUT \"    }\\n}\\n\";\n\n# Generate OpCodeValues internal enum\nprint OUTPUT \"    ///<summary>\\n\";\nprint OUTPUT \"    /// Internal enum OpCodeValues for opcode values.\\n\";\nprint OUTPUT \"    ///</summary>\\n\";\nprint OUTPUT \"    ///<remarks>\\n\";\nprint OUTPUT \"    /// Note that the value names are used to construct publicly visible\\n\";\nprint OUTPUT \"    /// ilasm-compatible opcode names, so their exact form is important!\\n\";\nprint OUTPUT \"    ///</remarks>\\n\";\nprint OUTPUT \"    internal enum OpCodeValues\\n\";\nprint OUTPUT \"    {\\n\";\n\nforeach $opcodeValue (sort {$a <=> $b} keys(%opcodeEnum)) {\n\tprint OUTPUT $opcodeEnum{$opcodeValue};\n}\n\n# End generating OpCodeValues internal enum\nprint OUTPUT \"    }\\n\\n\";\n\n\n# Generate public OpCodes class\nprint OUTPUT \"    /// <summary>\\n\";\nprint OUTPUT \"    ///    <para>\\n\";\nprint OUTPUT \"    ///       The IL instruction opcodes supported by the runtime.\\n\";\nprint OUTPUT \"    ///       The Specification of IL Instruction describes each Opcode.\\n\";\nprint OUTPUT \"    ///    </para>\\n\";\nprint OUTPUT \"    /// </summary>\\n\";\nprint OUTPUT \"    /// <seealso topic='IL Instruction Set Specification'/>\\n\";\nprint OUTPUT \"    public class OpCodes\\n\";\nprint OUTPUT \"    {\\n\\n\";;\nprint OUTPUT \"        private OpCodes()\\n        {\\n        }\\n\\n\";\n\nmy $opcode;\nmy $lastOp = -1;\nforeach $opcode (sort {$a <=> $b} keys(%oneByte)) {\n    printf(\"***** GAP %d instrs ****\\n\", $opcode - $lastOp) if ($lastOp + 1 != $opcode && $lastOp > 0);\n    print OUTPUT $oneByte{$opcode};\n    $lastOp = $opcode;\n}\n\n$lastOp = -1;\nforeach $opcode (sort {$a <=> $b} keys(%twoByte)) {\n    printf(\"***** GAP %d instrs ****\\n\", $opcode - $lastOp) if ($lastOp + 1 != $opcode && $lastOp > 0);\n    print OUTPUT $twoByte{$opcode};\n    $lastOp = $opcode;\n}\n\nprint OUTPUT \"\\n\";;\nprint OUTPUT \"        public static bool TakesSingleByteArgument(OpCode inst)\\n\";\nprint OUTPUT \"        {\\n\";\nprint OUTPUT \"            switch (inst.OperandType)\\n\";\nprint OUTPUT \"            {\\n\";\nprint OUTPUT \"                case OperandType.ShortInlineBrTarget:\\n\";\nprint OUTPUT \"                case OperandType.ShortInlineI:\\n\";\nprint OUTPUT \"                case OperandType.ShortInlineVar:\\n\";\nprint OUTPUT \"                    return true;\\n\";\nprint OUTPUT \"            }\\n\";\nprint OUTPUT \"            return false;\\n\";\nprint OUTPUT \"        }\\n\";\n\n# End Generate public OpCodes class and close namespace\nprint OUTPUT \"    }\\n}\\n\";\n\nexit($ret);\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/allocacheck.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n/*********************************************************************/\n/*                           AllocaCheck                             */\n/*********************************************************************/\n\n/* check for alloca overruns (which otherwise are hard to track down\n   and often only repro on optimized builds).\n\n   USAGE:\n\n\t\tvoid foo() {\n\t\t\tALLOCA_CHECK();\t\t\t\t// Declare at function level scope\n\n\t\t\t....\n\t\t\tvoid* mem = ALLOCA(size);\t// does an alloca,\n\n\t\t}\t// destructor of ALLOCA_CHECK for buffer overruns.\n*/\n\n/*   */\n/*********************************************************************/\n\n#ifndef AllocaCheck_h\n#define AllocaCheck_h\n#include <malloc.h>\t\t\t// for alloca itself\n\n#if defined(assert) && !defined(_ASSERTE)\n#define _ASSERTE assert\n#endif\n\n#if defined(_DEBUG) || defined(DEBUG)\n\n/*********************************************************************/\nclass AllocaCheck {\npublic:\n\tenum { CheckBytes = 0xCCCDCECF,\n\t\t };\n\n\tstruct AllocaSentinel {\n\t\tint check;\n\t\tAllocaSentinel* next;\n\t};\n\npublic:\n\t/***************************************************/\n\tAllocaCheck() {\n\t\tsentinels = 0;\n\t}\n\n\t~AllocaCheck() {\n\t\tAllocaSentinel* ptr = sentinels;\n\t\twhile (ptr != 0) {\n\t\t\tif (ptr->check != (int)CheckBytes)\n\t\t\t\t_ASSERTE(!\"alloca buffer overrun\");\n\t\t\tptr = ptr->next;\n\t\t}\n\t}\n\n\tvoid* add(void* allocaBuff, unsigned size) {\n\t\tAllocaSentinel* newSentinel = (AllocaSentinel*) ((char*) allocaBuff + size);\n\t\tnewSentinel->check = CheckBytes;\n\t\tnewSentinel->next = sentinels;\n\t\tsentinels = newSentinel;\n        memset(allocaBuff, 0xDD, size);\n\t\treturn allocaBuff;\n\t}\n\nprivate:\n\tAllocaSentinel* sentinels;\n};\n\n#define ALLOCA_CHECK() AllocaCheck __allocaChecker\n#define ALLOCA(size)  __allocaChecker.add(_alloca(size+sizeof(AllocaCheck::AllocaSentinel)), size);\n\n#else\n\n#define ALLOCA_CHECK()\n#define ALLOCA(size)  _alloca(size)\n\n#endif\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/arrayholder.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\ntemplate <class T>\nclass ArrayHolder\n{\npublic:\n    ArrayHolder(T *ptr)\n        : m_ptr(ptr)\n    {\n    }\n\n    ~ArrayHolder()\n    {\n        Clear();\n    }\n\n    ArrayHolder(const ArrayHolder &rhs)\n    {\n        m_ptr = const_cast<ArrayHolder *>(&rhs)->Detach();\n    }\n\n    ArrayHolder &operator=(T *ptr)\n    {\n        Clear();\n        m_ptr = ptr;\n        return *this;\n    }\n\n    const T &operator[](int i) const\n    {\n        return m_ptr[i];\n    }\n\n    T &operator[](int i)\n    {\n        return m_ptr[i];\n    }\n\n    operator const T *() const\n    {\n        return m_ptr;\n    }\n\n    operator T *()\n    {\n        return m_ptr;\n    }\n\n    T **operator&()\n    {\n        return &m_ptr;\n    }\n\n    T *GetPtr()\n    {\n        return m_ptr;\n    }\n\n    T *Detach()\n    {\n        T *ret = m_ptr;\n        m_ptr = NULL;\n        return ret;\n    }\n\nprivate:\n    void Clear()\n    {\n        if (m_ptr)\n        {\n            delete [] m_ptr;\n            m_ptr = NULL;\n        }\n    }\n\nprivate:\n    T *m_ptr;\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/arraylist.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef ARRAYLIST_H_\n#define ARRAYLIST_H_\n\n#include <daccess.h>\n#include <contract.h>\n#include <stddef.h> // offsetof\n\n//\n// ArrayList is a simple class which is used to contain a growable\n// list of pointers, stored in chunks.  Modification is by appending\n// only currently.  Access is by index (efficient if the number of\n// elements stays small) and iteration (efficient in all cases).\n//\n// An important property of an ArrayList is that the list remains\n// coherent while it is being modified. This means that readers\n// never need to lock when accessing it.\n//\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4200) // Disable zero-sized array warning\n#endif\n\nclass ArrayListBase\n{\n public:\n\n    enum\n    {\n        ARRAY_BLOCK_SIZE_START = 5,\n    };\n\n  private:\n\n    struct ArrayListBlock\n    {\n        SPTR(ArrayListBlock)    m_next;\n        DWORD                   m_blockSize;\n#ifdef HOST_64BIT\n        DWORD                   m_padding;\n#endif\n        PTR_VOID                m_array[0];\n\n#ifdef DACCESS_COMPILE\n        static ULONG32 DacSize(TADDR addr)\n        {\n            LIMITED_METHOD_CONTRACT;\n            return offsetof(ArrayListBlock, m_array) +\n                (*PTR_DWORD(addr + offsetof(ArrayListBlock, m_blockSize)) * sizeof(void*));\n        }\n#endif\n    };\n    typedef SPTR(ArrayListBlock) PTR_ArrayListBlock;\n\n    struct FirstArrayListBlock\n    {\n        PTR_ArrayListBlock      m_next;\n        DWORD                   m_blockSize;\n#ifdef HOST_64BIT\n        DWORD                   m_padding;\n#endif\n        void *                  m_array[ARRAY_BLOCK_SIZE_START];\n    };\n\n    typedef DPTR(FirstArrayListBlock) PTR_FirstArrayListBlock;\n\n    DWORD               m_count;\n    FirstArrayListBlock m_firstBlock;\n\n  public:\n\n    PTR_VOID *GetPtr(DWORD index) const;\n    PTR_VOID Get(DWORD index) const\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        return *GetPtr(index);\n    }\n\n    void Set(DWORD index, PTR_VOID element)\n    {\n        WRAPPER_NO_CONTRACT;\n        *GetPtr(index) = element;\n    }\n\n    DWORD GetCount() const { LIMITED_METHOD_DAC_CONTRACT; return m_count; }\n\n    HRESULT Append(void *element);\n\n    enum { NOT_FOUND = -1 };\n    DWORD FindElement(DWORD start, PTR_VOID element) const;\n\n    void Clear();\n\n    void Init()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_count = 0;\n        m_firstBlock.m_next = NULL;\n        m_firstBlock.m_blockSize = ARRAY_BLOCK_SIZE_START;\n    }\n\n    void Destroy()\n    {\n        WRAPPER_NO_CONTRACT;\n        Clear();\n    }\n\n#ifdef DACCESS_COMPILE\n    void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);\n#endif\n\n    class ConstIterator;\n\n    class Iterator\n    {\n        friend class ArrayListBase;\n        friend class ConstIterator;\n\n      public:\n        BOOL Next();\n\n        void SetEmpty()\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            m_block = NULL;\n            m_index = (DWORD)-1;\n            m_remaining = 0;\n            m_total = 0;\n        }\n\n        PTR_VOID GetElement() {LIMITED_METHOD_DAC_CONTRACT; return m_block->m_array[m_index]; }\n        PTR_VOID * GetElementPtr() {LIMITED_METHOD_CONTRACT; return m_block->m_array + m_index; }\n        DWORD GetIndex() {LIMITED_METHOD_CONTRACT; return m_index + m_total; }\n        void *GetBlock() { return m_block; }\n\n      private:\n        ArrayListBlock*     m_block;\n        DWORD               m_index;\n        DWORD               m_remaining;\n        DWORD               m_total;\n        static Iterator Create(ArrayListBlock* block, DWORD remaining)\n        {\n            LIMITED_METHOD_DAC_CONTRACT;\n            Iterator i;\n            i.m_block = block;\n            i.m_index = (DWORD) -1;\n            i.m_remaining = remaining;\n            i.m_total = 0;\n            return i;\n        }\n    };\n\n    class ConstIterator\n    {\n    public:\n        ConstIterator(ArrayListBlock *pBlock, DWORD dwRemaining) : m_iterator(Iterator::Create(pBlock, dwRemaining))\n        {\n        }\n\n        BOOL Next()\n        {\n            WRAPPER_NO_CONTRACT;\n            return m_iterator.Next();\n        }\n\n        PTR_VOID GetElement()\n        {\n            WRAPPER_NO_CONTRACT;\n            return m_iterator.GetElement();\n        }\n\n    private:\n        Iterator m_iterator;\n    };\n\n    Iterator Iterate()\n    {\n        WRAPPER_NO_CONTRACT;\n        return Iterator::Create((ArrayListBlock*)&m_firstBlock, m_count);\n    }\n\n    ConstIterator Iterate() const\n    {\n        // Const cast is safe because ConstIterator does not expose any way to modify the block\n        ArrayListBlock *pFirstBlock = const_cast<ArrayListBlock *>(reinterpret_cast<const ArrayListBlock *>(&m_firstBlock));\n        return ConstIterator(pFirstBlock, m_count);\n    }\n\n    // BlockIterator is used for only memory walking, such as prejit save/fixup.\n    // It is not appropriate for other more typical ArrayList use.\n    class BlockIterator\n    {\n      private:\n\n        ArrayListBlock *m_block;\n        DWORD           m_remaining;\n\n        friend class ArrayListBase;\n        BlockIterator(ArrayListBlock *block, DWORD remaining)\n          : m_block(block), m_remaining(remaining)\n        {\n        }\n\n      public:\n\n        BOOL Next()\n        {\n            if (m_block != NULL)\n            {\n                // Prevent m_remaining from underflowing - we can have completely empty block at the end.\n                if (m_remaining > m_block->m_blockSize)\n                    m_remaining -= m_block->m_blockSize;\n                else\n                    m_remaining = 0;\n\n                m_block = m_block->m_next;\n            }\n            return m_block != NULL;\n        }\n\n#ifndef DACCESS_COMPILE\n        void ClearUnusedMemory()\n        {\n            if (m_remaining < m_block->m_blockSize)\n                ZeroMemory(m_block->m_array + m_remaining, (m_block->m_blockSize - m_remaining) * sizeof(void*));\n#ifdef HOST_64BIT\n            m_block->m_padding = 0;\n#endif // HOST_64BIT\n        }\n#endif // DACCESS_COMPILE\n\n        void **GetNextPtr()\n        {\n            return (void **) &m_block->m_next;\n        }\n\n        void *GetBlock()\n        {\n            return m_block;\n        }\n\n        SIZE_T GetBlockSize()\n        {\n            return offsetof(ArrayListBlock, m_array) + (m_block->m_blockSize * sizeof(void*));\n        }\n    };\n\n    void **GetInitialNextPtr()\n    {\n        return (void **) &m_firstBlock.m_next;\n    }\n\n    BlockIterator IterateBlocks()\n    {\n        return BlockIterator((ArrayListBlock *) &m_firstBlock, m_count);\n    }\n\n};\n\nclass ArrayList : public ArrayListBase\n{\npublic:\n#ifndef DACCESS_COMPILE\n    ArrayList()\n    {\n        WRAPPER_NO_CONTRACT;\n        Init();\n    }\n\n    ~ArrayList()\n    {\n        WRAPPER_NO_CONTRACT;\n        Destroy();\n    }\n#endif\n};\n\n/* to be used as static variable - no constructor/destructor, assumes zero\n   initialized memory */\nclass ArrayListStatic : public ArrayListBase\n{\n};\n\ntypedef DPTR(ArrayListStatic) PTR_ArrayListStatic;\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/assemblybinderutil.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n// Contains helper types for assembly binding host infrastructure.\n\n#ifndef __ASSEMBLY_BINDER_UTIL_H__\n#define __ASSEMBLY_BINDER_UTIL_H__\n\n//=====================================================================================================================\n// Forward declarations\ntypedef DPTR(BINDER_SPACE::Assembly) PTR_BINDER_SPACE_Assembly;\ntypedef DPTR(AssemblyBinder) PTR_AssemblyBinder;\n\n//=====================================================================================================================\n#define VALIDATE_CONDITION(condition, fail_op)  \\\n    do {                                        \\\n        _ASSERTE((condition));                  \\\n        if (!(condition))                       \\\n            fail_op;                            \\\n    } while (false)\n\n#define VALIDATE_ARG_RET(condition) VALIDATE_CONDITION(condition, return E_INVALIDARG)\n\n#endif // __ASSEMBLY_BINDER_UTIL_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/bitmask.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n\n// --------------------------------------------------------------------------------\n// BitMask.h\n// --------------------------------------------------------------------------------\n\n// --------------------------------------------------------------------------------\n// BitMask is an arbitrarily large sized bitfield which has optimal storage\n// for 32 bits or less.\n// Storage is proportional to the highest index which is set.\n// --------------------------------------------------------------------------------\n\n\n#include <clrtypes.h>\n\n#ifndef _BITMASK_H_\n#define _BITMASK_H_\n\nclass BitMask\n{\n public:\n\n    BitMask();\n    ~BitMask();\n\n    BOOL TestBit(int bit);\n    void SetBit(int bit);\n    void ClearBit(int bit);\n\n    // returns true if any bit is set\n    BOOL TestAnyBit();\n\n    void ClearAllBits();\n\n    // Allocation exposed for ngen save/fixup\n    size_t GetAllocatedBlockOffset();\n    void *GetAllocatedBlock();\n    COUNT_T GetAllocatedBlockSize();\n\n private:\n\n    static const int BIT_SIZE_SHIFT = 5;\n    static const int BIT_SIZE = (1<<BIT_SIZE_SHIFT);\n    static const int BIT_SIZE_MASK = BIT_SIZE-1;\n\n    static const COUNT_T MIN_ARRAY_ALLOCATION = 3;\n\n    // The first bit is used to indicate whether we've got a flat mask or\n    // an array of mask elements\n    BOOL IsArray();\n\n    // Indexing computations\n    COUNT_T BitToIndex(int bit);\n    COUNT_T BitToShift(int bit);\n\n    // Generic mask array access.  Works for either case (array or non-array).\n    COUNT_T *GetMaskArray();\n    COUNT_T GetMaskArraySize();\n\n    // Need more bits...\n    void GrowArray(COUNT_T newSize);\n\n    union\n    {\n        COUNT_T     m_mask;\n        COUNT_T     *m_maskArray; // first array element is size of rest of array\n    };\n};\n\n// provides a wrapper around the BitMask class providing synchronized reads/writes safe for multithreaded access.\n// I've only added the public methods that were required by Module which needs a thread-safe BitMask.  add others as required.\nclass SynchronizedBitMask\n{\n public:\n    // Allow Module access so we can use Offsetof on this class's private members during native image creation (determinism)\n    friend class Module;\n    SynchronizedBitMask();\n    ~SynchronizedBitMask() {}\n\n    BOOL TestBit(int bit);\n    void SetBit(int bit);\n    void ClearBit(int bit);\n\n    BOOL TestAnyBit();\n\n    void ClearAllBits();\n\n private:\n\n    BitMask m_bitMask;\n\n    // note that this lock (at present) doesn't support promotion from reader->writer so be very careful\n    // when taking this lock else you might deadlock your own thread!\n    SimpleRWLock m_bitMaskLock;\n};\n\n#include <bitmask.inl>\n\n#endif // _BITMASK_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/bitmask.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n\n// --------------------------------------------------------------------------------\n// BitMask.inl\n// --------------------------------------------------------------------------------\n\n#include <bitmask.h>\n\n#ifndef _BITMASK_INL_\n#define _BITMASK_INL_\n\ninline BOOL BitMask::IsArray()\n{\n    LIMITED_METHOD_CONTRACT;\n    return (m_mask&1) == 0;\n}\n\n// Indexing computations\ninline COUNT_T BitMask::BitToIndex(int bit)\n{\n    LIMITED_METHOD_CONTRACT;\n    // First word has one less bit due to tag\n    return (bit+1) >> BIT_SIZE_SHIFT;\n}\n\ninline COUNT_T BitMask::BitToShift(int bit)\n{\n    LIMITED_METHOD_CONTRACT;\n    // First word has one less bit due to tag\n    return (bit+1) & BIT_SIZE_MASK;\n}\n\n// Array access.  Note the first array element is the count of the\n// rest of the elements\n\ninline COUNT_T *BitMask::GetMaskArray()\n{\n    LIMITED_METHOD_CONTRACT;\n    if (IsArray())\n    {\n        CONSISTENCY_CHECK(CheckPointer(m_maskArray));\n        return m_maskArray+1;\n    }\n    else\n        return &m_mask;\n}\n\ninline COUNT_T BitMask::GetMaskArraySize()\n{\n    LIMITED_METHOD_CONTRACT;\n    if (IsArray())\n        return *m_maskArray;\n    else\n        return 1;\n}\n\ninline void BitMask::GrowArray(COUNT_T newSize)\n{\n    CONTRACTL\n    {\n          THROWS;\n    }\n    CONTRACTL_END;\n\n    // Ensure we don't grow too often\n\n    COUNT_T oldSize = GetMaskArraySize();\n    if (newSize <= oldSize)\n        return;\n\n    if (newSize < oldSize*2)\n        newSize = oldSize*2;\n    if (newSize < MIN_ARRAY_ALLOCATION)\n        newSize = MIN_ARRAY_ALLOCATION;\n\n    // Allocate new array\n\n    COUNT_T *newArray = new COUNT_T [newSize+1];\n    *newArray = newSize;\n\n    CopyMemory(newArray+1, GetMaskArray(), oldSize * sizeof(COUNT_T));\n    ZeroMemory(newArray+oldSize+1, (newSize - oldSize) * sizeof(COUNT_T));\n\n    if (IsArray())\n        delete [] m_maskArray;\n\n    m_maskArray = newArray;\n}\n\ninline BitMask::BitMask()\n  : m_mask(1)\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ninline BitMask::~BitMask()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    if (IsArray())\n        delete [] m_maskArray;\n}\n\ninline BOOL BitMask::TestBit(int bit)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    COUNT_T index = BitToIndex(bit);\n\n    if (index >= GetMaskArraySize())\n        return FALSE;\n\n    return ( GetMaskArray()[index] >> BitToShift(bit) ) & 1;\n}\n\ninline void BitMask::SetBit(int bit)\n{\n    CONTRACTL\n    {\n        THROWS;\n    }\n    CONTRACTL_END;\n\n    COUNT_T index = BitToIndex(bit);\n\n    if (index >= GetMaskArraySize())\n        GrowArray(index+1);\n\n    GetMaskArray()[index] |= (1 << BitToShift(bit));\n}\n\ninline void BitMask::ClearBit(int bit)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    COUNT_T index = BitToIndex(bit);\n\n    if (index >= GetMaskArraySize())\n        return;\n\n    GetMaskArray()[index] &= ~(1 << BitToShift(bit));\n}\n\ninline BOOL BitMask::TestAnyBit()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    if (IsArray())\n    {\n        COUNT_T *mask = m_maskArray+1;\n        COUNT_T *maskEnd = mask + m_maskArray[0];\n\n        while (mask < maskEnd)\n        {\n            if (*mask != 0)\n                return TRUE;\n            mask++;\n        }\n\n        return FALSE;\n    }\n    else\n        return m_mask != (COUNT_T) 1;\n}\n\ninline void BitMask::ClearAllBits()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    if (IsArray())\n        delete [] m_maskArray;\n\n    m_mask = 1;\n}\n\ninline size_t BitMask::GetAllocatedBlockOffset()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return offsetof(BitMask, m_maskArray);\n}\n\ninline void *BitMask::GetAllocatedBlock()\n{\n    LIMITED_METHOD_CONTRACT;\n\n\tif (IsArray())\n        return m_maskArray;\n    else\n        return NULL;\n}\n\ninline COUNT_T BitMask::GetAllocatedBlockSize()\n{\n    LIMITED_METHOD_CONTRACT;\n\n\tif (IsArray())\n        return (GetMaskArraySize()+1) * sizeof(COUNT_T);\n    else\n        return 0;\n}\n\n/////////////////////////////////////////////////////////////////////////////////////////////\n/////////////////////////////////////////////////////////////////////////////////////////////\n\ninline SynchronizedBitMask::SynchronizedBitMask()\n  : m_bitMaskLock(PREEMPTIVE, LOCK_TYPE_DEFAULT)\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ninline BOOL SynchronizedBitMask::TestBit(int bit)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        MODE_ANY;\n        CAN_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    SimpleReadLockHolder holder(&m_bitMaskLock);\n\n    return m_bitMask.TestBit(bit);\n}\n\ninline void SynchronizedBitMask::SetBit(int bit)\n{\n    CONTRACTL\n    {\n        THROWS;\n        MODE_ANY;\n        CAN_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    SimpleWriteLockHolder holder(&m_bitMaskLock);\n\n    m_bitMask.SetBit(bit);\n}\n\ninline void SynchronizedBitMask::ClearBit(int bit)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        MODE_ANY;\n        CAN_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    SimpleWriteLockHolder holder(&m_bitMaskLock);\n\n    m_bitMask.ClearBit(bit);\n}\n\ninline BOOL SynchronizedBitMask::TestAnyBit()\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        MODE_ANY;\n        CAN_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    SimpleReadLockHolder holder(&m_bitMaskLock);\n\n    return m_bitMask.TestAnyBit();\n}\n\ninline void SynchronizedBitMask::ClearAllBits()\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        MODE_ANY;\n        CAN_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    SimpleWriteLockHolder holder(&m_bitMaskLock);\n\n    m_bitMask.ClearAllBits();\n}\n\n#endif // _BITMASK_INL_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/bitposition.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _BITPOSITION_H_\n#define _BITPOSITION_H_\n\n//------------------------------------------------------------------------\n// BitPosition: Return the position of the single bit that is set in 'value'.\n//\n// Return Value:\n//    The position (0 is LSB) of bit that is set in 'value'\n//\n// Notes:\n//    'value' must have exactly one bit set.\n//    It performs the \"TrailingZeroCount\" operation using intrinsics.\n//\ninline\nunsigned            BitPosition(unsigned value)\n{\n    _ASSERTE((value != 0) && ((value & (value-1)) == 0));\n    DWORD index;\n    BitScanForward(&index, value);\n    return index;\n}\n\n\n#ifdef HOST_64BIT\n//------------------------------------------------------------------------\n// BitPosition: Return the position of the single bit that is set in 'value'.\n//\n// Return Value:\n//    The position (0 is LSB) of bit that is set in 'value'\n//\n// Notes:\n//    'value' must have exactly one bit set.\n//    It performs the \"TrailingZeroCount\" operation using intrinsics.\n//\ninline\nunsigned            BitPosition(unsigned __int64 value)\n{\n    _ASSERTE((value != 0) && ((value & (value-1)) == 0));\n    DWORD index;\n    BitScanForward64(&index, value);\n    return index;\n}\n#endif // HOST_64BIT\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/bitvector.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n/***************************************************************************/\n/*                           BitVector.h                                   */\n/***************************************************************************/\n//  Routines to support a growable bitvector\n/***************************************************************************/\n\n#ifndef BITVECTOR_H\n#define BITVECTOR_H 1\n\n\n#ifndef LIMITED_METHOD_CONTRACT\n#define LIMITED_METHOD_CONTRACT\n#define UNDEF_LIMITED_METHOD_CONTRACT\n#endif\n\n#ifndef WRAPPER_NO_CONTRACT\n#define WRAPPER_NO_CONTRACT\n#define UNDEF_WRAPPER_NO_CONTRACT\n#endif\n\n#ifndef SUPPORTS_DAC\n#define SUPPORTS_DAC\n#define UNDEF_SUPPORTS_DAC\n#endif\n\n#ifndef _ASSERTE\n#define _ASSERTE(x)\n#define UNDEF_ASSERTE\n#endif\n\n#define USE_BITVECTOR 1\n#if USE_BITVECTOR\n\n/* The bitvector class is meant to be a drop in replacement for an integer\n   (that is you use it like an integer), however it grows as needed.\n\n   Features:\n       plug compatible with normal integers;\n       grows as needed\n       Optimized for the small case when the vector fits in machine word\n       Uses one machine word if vector fits in machine word (minus a bit)\n\n       Some caveates:\n           You should use mutator operators  &=, |= ... instead of the\n           non-mutators whenever possible to avoid creating a temps\n\n           Specifically did NOT supply automatic coercions to\n           and from short types so that the programmer is aware of\n           when code was being injected on their behalf.  The upshot of this\n           is that you have to use the  BitVector() toUnsigned() to convert\n*/\n\n/***************************************************************************/\n\nclass BitVector {\n    // Set this to be unsigned char to do testing, should be UINT_PTR for real life\n\n    typedef UINT_PTR ChunkType;  // The size of integer type that the machine can operate on directly\n//  typedef BYTE ChunkType;      // Use for testing\n\n    // Maximum number of bits in our bitvector\n#define MAX_PTRARG_OFS 1024\n\n    enum {\n        IS_BIG     = 1,                             // The low bit is used to discrimate m_val and m_vals\n        CHUNK_BITS = sizeof(ChunkType)*8,           // The number of bits that we can manipuate as a chunk\n        SMALL_BITS = CHUNK_BITS - 1,                // The number of bits we can fit in the small representation\n//      SMALL_BITS = 5,                             // TESTING ONLY: The number of bits we can fit in the small representation\n        VALS_COUNT = MAX_PTRARG_OFS / CHUNK_BITS,   // The number of ChunkType elements in the Vals array\n    };\n\npublic:\n    BitVector()\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n\n        m_val = 0;\n    }\n\n    BOOL isBig() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n\n        return ((m_val & IS_BIG) != 0);\n    }\n\n    void toBig()\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (!isBig())\n        {\n            doBigInit(smallBits());\n        }\n    }\n\n    explicit BitVector(ChunkType arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (arg > MaxVal)\n        {\n            doBigInit(arg);\n        }\n        else\n        {\n            m_val = ChunkType(arg << 1);\n        }\n    }\n\n    BitVector(ChunkType arg, UINT shift)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if ((arg > MaxVal) || (shift >= SMALL_BITS) || (arg > (MaxVal >> shift)))\n        {\n            doBigInit(arg);\n            doBigLeftShiftAssign(shift);\n        }\n        else\n        {\n            m_val = ChunkType(arg << (shift+1));\n        }\n    }\n\n#define CONSTRUCT_ptrArgTP(arg,shift)   BitVector((arg), (shift))\n\n    BitVector(const BitVector& arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (arg.isBig())\n        {\n            doBigInit(arg);\n        }\n        else\n        {\n            m_val = arg.m_val;\n        }\n    }\n\n    void operator <<=(unsigned shift)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if ((m_val == 0) || (shift == 0))     // Zero is a special case, don't need to do anything\n            return;\n\n        if (isBig() || (shift >= SMALL_BITS) || (m_val > (MaxVal >> (shift-1))))\n        {\n            doBigLeftShiftAssign(shift);\n        }\n        else\n        {\n            m_val <<= shift;\n        }\n    }\n\n    void operator >>=(unsigned shift)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (isBig())\n        {\n            doBigRightShiftAssign(shift);\n        }\n        else\n        {\n            m_val >>= shift;\n            m_val &= ~IS_BIG;  // clear the isBig bit if it got set\n        }\n    }\n\n    void operator |=(const BitVector& arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (((m_val | arg.m_val) & IS_BIG) != 0)\n        {\n            doBigOrAssign(arg);\n        }\n        else\n        {\n            m_val |= arg.m_val;\n        }\n    }\n\n    // Note that this is set difference, not subtration\n    void operator -=(const BitVector& arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (((m_val | arg.m_val) & IS_BIG) != 0)\n        {\n            doBigDiffAssign(arg);\n        }\n        else\n        {\n            m_val &= ~arg.m_val;\n        }\n    }\n\n    void operator &=(const BitVector& arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (((m_val | arg.m_val) & IS_BIG) != 0)\n        {\n            doBigAndAssign(arg);\n        }\n        else\n        {\n            m_val &= arg.m_val;\n        }\n    }\n\n    friend void setDiff(BitVector& target, const BitVector& arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        target -= arg;\n    }\n\n    friend BOOL intersect(const BitVector& arg1, const BitVector& arg2)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (((arg1.m_val | arg2.m_val) & IS_BIG) != 0)\n        {\n            return arg1.doBigIntersect(arg2);\n        }\n        else\n        {\n            return ((arg1.m_val & arg2.m_val) != 0);\n        }\n    }\n\n    BOOL operator ==(const BitVector& arg) const\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if ((m_val | arg.m_val) & IS_BIG)\n        {\n            return doBigEquals(arg);\n        }\n        else\n        {\n            return m_val == arg.m_val;\n        }\n    }\n\n    BOOL operator !=(const BitVector& arg) const\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        return !(*this == arg);\n    }\n\n    friend ChunkType toUnsigned(const BitVector& arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        if (arg.isBig())\n        {\n            return arg.m_vals.m_chunks[0];   // Note truncation\n        }\n        else\n        {\n            return arg.smallBits();\n        }\n    }\n\n    // Note that we require the invariant that zero is always stored in the\n    // small form so that this works bitvector is zero iff (m_val == 0)\n    friend BOOL isZero(const BitVector& arg)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        return arg.m_val == 0;\n    }\n\n    /* currently only used in asserts */\n    BitVector operator &(const BitVector& arg) const\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        BitVector ret = *this;\n        ret &= arg;\n        return ret;\n    }\n\n    int  NumBits() const;\n\nprivate:\n\n    static const ChunkType MaxVal = ((ChunkType)1 << SMALL_BITS) - 1;    // Maximum value that can be stored in m_val\n\n    // This is the structure that we use when the bit vector overflows.\n    // It is a simple vector.\n    struct Vals {\n        unsigned m_encodedLength;         // An encoding of the current length of the 'm_chunks' array\n        ChunkType m_chunks[VALS_COUNT];\n\n        BOOL isBig() const\n        {\n            LIMITED_METHOD_CONTRACT;\n            SUPPORTS_DAC;\n\n            return ((m_encodedLength & IS_BIG) != 0);\n        }\n\n        unsigned GetLength() const\n        {\n            LIMITED_METHOD_CONTRACT;\n            SUPPORTS_DAC;\n\n            if (isBig())\n            {\n                unsigned length = (m_encodedLength >> 1);\n                _ASSERTE(length > 0);\n                return length;\n            }\n            else\n            {\n                return 0;\n            }\n        }\n\n        void SetLength(unsigned length)\n        {\n            LIMITED_METHOD_CONTRACT;\n            SUPPORTS_DAC;\n\n            _ASSERTE(length > 0);\n            _ASSERTE(length <= VALS_COUNT);\n\n            m_encodedLength  = (ChunkType) (length << 1);\n            m_encodedLength |= (ChunkType) IS_BIG;\n         }\n    };\n\n    //\n    // This is the instance data for the bitvector\n    //\n    // We discrimininate on this\n    union {\n        ChunkType m_val;     // if m_val bit 0 is false, then bits 1-N are the bit vector\n        Vals      m_vals;    // if m_val bit 1 is true, then use Vals\n    };\n\n\n    ChunkType smallBits() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n\n        _ASSERTE(!isBig());\n        return (m_val >> 1);\n    }\n\n#ifdef STRIKE\n    void doBigInit(ChunkType arg) {}\n#else\n    void doBigInit(ChunkType arg);\n#endif\n    void doBigInit(const BitVector& arg);\n    void doBigLeftShiftAssign(unsigned arg);\n    void doBigRightShiftAssign(unsigned arg);\n    void doBigDiffAssign(const BitVector&);\n    void doBigAndAssign(const BitVector&);\n    void doBigOrAssign(const BitVector& arg);\n    BOOL doBigEquals(const BitVector&) const;\n    BOOL doBigIntersect(const BitVector&) const;\n};\n\ntypedef BitVector ptrArgTP;\n\n#else // !USE_BITVECTOR\n\ntypedef unsigned __int64 ptrArgTP;\n\n    // Maximum number of bits in our bitvector\n#define MAX_PTRARG_OFS (sizeof(ptrArgTP) * 8)\n\n#define CONSTRUCT_ptrArgTP(arg,shift)   (((ptrArgTP) (arg)) << (shift))\n\ninline BOOL isZero(const ptrArgTP& arg)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n    return (arg == 0);\n}\n\ninline ptrArgTP toUnsigned(const ptrArgTP& arg)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n    return arg;\n}\n\ninline void setDiff(ptrArgTP& target, const ptrArgTP& arg)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    target &= ~arg;\n}\n\ninline BOOL intersect(const ptrArgTP arg1, const ptrArgTP arg2)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    return ((arg1 & arg2) != 0);\n}\n\n#endif  // !USE_BITVECTOR\n\n#ifdef UNDEF_LIMITED_METHOD_CONTRACT\n#undef LIMITED_METHOD_CONTRACT\n#undef UNDEF_LIMITED_METHOD_CONTRACT\n#endif\n\n#ifdef UNDEF_WRAPPER_NO_CONTRACT\n#undef WRAPPER_NO_CONTRACT\n#undef UNDEF_WRAPPER_NO_CONTRACT\n#endif\n\n#ifdef UNDEF_SUPPORTS_DAC\n#undef SUPPORTS_DAC\n#undef UNDEF_SUPPORTS_DAC\n#endif\n\n#ifdef UNDEF_ASSERTE\n#undef _ASSERTE\n#undef UNDEF_ASSERTE\n#endif\n\n#endif // BITVECTOR_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/blobfetcher.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// CBlobFetcher - it fetches binary chunks, similar to new, but more controlled\n//\n// Fast, dynamic, memory management which doesn't relocate blocks\n// m_pIndex has array of pillars, where each pillar starts off empty and has\n// just-in-time allocation. As each pillar fills up, we move to the next pillar\n// If the entire array of pillars fill up, we need to allocate a new array and\n// copy the pillars over. But the actual data returned from GetBlock() never\n// gets moved. So everyone's happy.\n//\n//*****************************************************************************\n\n\n#ifndef __BLOB_FETCHER_H_\n#define __BLOB_FETCHER_H_\n\n#include <windef.h>\n\n\nclass  CBlobFetcher\n{\nprotected:\n\n    class CPillar {\n    public:\n        CPillar();\n        ~CPillar();\n\n        void SetAllocateSize(unsigned nSize);\n        unsigned GetAllocateSize() const;\n\n        char* MakeNewBlock(unsigned len, unsigned pad);\n        void StealDataFrom(CPillar & src);\n        unsigned GetDataLen() const;\n        char* GetRawDataStart();\n        BOOL Contains(_In_ char *ptr);\n        ULONG32 GetOffset(_In_ char *ptr);\n\n    protected:\n        unsigned m_nTargetSize; // when we allocate, make it this large\n\n    // Make these public so CBlobFetcher can do easy manipulation\n    public:\n        char* m_dataAlloc;\n        char* m_dataStart;\n        char* m_dataCur;\n        char* m_dataEnd;\n    };\n\n\n    CPillar * m_pIndex; // array of pillars\n\n    unsigned m_nIndexMax;   // actual size of m_ppIndex\n    unsigned m_nIndexUsed;  // current pillar, so start at 0\n\n    unsigned m_nDataLen;    // sum of all pillars' lengths\n\n// Don't allow these because they'll mess up the ownership\n    CBlobFetcher(const CBlobFetcher & src);\n    CBlobFetcher& operator=(const CBlobFetcher & src);\n\npublic:\n#if defined(HOST_64BIT)\n    // needs to be 64 so that we can purposefully cache align code in ngen'd images\n    enum { maxAlign = 64 }; // maximum alignment we support\n#else\n    enum { maxAlign = 32 }; // maximum alignment we support\n#endif\n    CBlobFetcher();\n    ~CBlobFetcher();\n\n// get a block to write on (use instead of write to avoid copy)\n    char * MakeNewBlock(unsigned int nSize, unsigned align=1);\n\n// Index segment as if this were linear\n    char * ComputePointer(unsigned offset) const;\n\n// Determine if pointer came from this fetcher\n    BOOL ContainsPointer(_In_ char *ptr) const;\n\n// Find an offset as if this were linear\n    unsigned ComputeOffset(_In_ char *ptr) const;\n\n// Write out the section to the stream\n    HRESULT Write(HANDLE file);\n\n// Write out the section to memory\n    HRESULT WriteMem(void ** pMem);\n\n// Get the total length of all our data (sum of all the pillar's data length's)\n// cached value, so light weight & no computations\n    unsigned GetDataLen() const;\n\n    HRESULT Merge(CBlobFetcher *destination);\n\n// Set the blob fetcher to slow growth mode. This should be done before any allocations\n    void SetInitialGrowth(unsigned growth);\n};\n\n\n//*****************************************************************************\n// Inlines\n//*****************************************************************************\n\n// Set the size that the Pillar will allocate if we call getBlock()\ninline void CBlobFetcher::CPillar::SetAllocateSize(unsigned nSize)\n{\n    LIMITED_METHOD_CONTRACT;\n    m_nTargetSize = nSize;\n}\n\n// Get the size we will allocate so we can decide if we need to change it\n// This is not the same as the GetDataLen() and is only useful\n// before we do the allocation\ninline unsigned CBlobFetcher::CPillar::GetAllocateSize() const\n{\n    LIMITED_METHOD_CONTRACT;\n    return m_nTargetSize;\n}\n\ninline char* CBlobFetcher::CPillar::GetRawDataStart()\n{\n    LIMITED_METHOD_CONTRACT;\n    return m_dataStart;\n}\n\ninline BOOL CBlobFetcher::CPillar::Contains(_In_ char *ptr)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return ptr >= m_dataStart && ptr < m_dataCur;\n}\n\ninline ULONG32 CBlobFetcher::CPillar::GetOffset(_In_ char *ptr)\n{\n    LIMITED_METHOD_CONTRACT;\n    _ASSERTE(Contains(ptr));\n\n    return (ULONG32)(ptr - m_dataStart);\n}\n\n//-----------------------------------------------------------------------------\n// Calculate the length of data being used, (not the length allocated)\n//-----------------------------------------------------------------------------\ninline unsigned CBlobFetcher::CPillar::GetDataLen() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    _ASSERTE((m_dataCur >= m_dataStart) && (m_dataCur <= m_dataEnd));\n\n    return (unsigned)(m_dataCur - m_dataStart);\n}\n\ninline unsigned CBlobFetcher::GetDataLen() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return m_nDataLen;\n}\n\n// Set the blob fetcher to slow growth mode. This should be done before any allocations\ninline void CBlobFetcher::SetInitialGrowth(unsigned growth)\n{\n    _ASSERTE(GetDataLen() == 0);\n    if (GetDataLen() == 0)\n    {\n        m_pIndex[0].SetAllocateSize(growth);\n    }\n}\n\n#endif  // __BLOB_FETCHER_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/bundle.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** bundle.h - Information about applications bundled as a single-file      **\n **                                                                         **\n *****************************************************************************/\n\n#ifndef _BUNDLE_H_\n#define _BUNDLE_H_\n\n#include <sstring.h>\n#include \"coreclrhost.h\"\n\nclass Bundle;\n\nstruct BundleFileLocation\n{\n    INT64 Size;\n    INT64 Offset;\n    INT64 UncompresedSize;\n\n    BundleFileLocation()\n    { \n        LIMITED_METHOD_CONTRACT;\n\n        Size = 0;\n        Offset = 0; \n        UncompresedSize = 0;\n    }\n\n    static BundleFileLocation Invalid() { LIMITED_METHOD_CONTRACT; return BundleFileLocation(); }\n\n    const SString &Path() const;\n\n    bool IsValid() const { LIMITED_METHOD_CONTRACT; return Offset != 0; }\n};\n\nclass Bundle\n{\npublic:\n    Bundle(LPCSTR bundlePath, BundleProbeFn *probe);\n    BundleFileLocation Probe(const SString& path, bool pathIsBundleRelative = false) const;\n\n    const SString &Path() const { LIMITED_METHOD_CONTRACT; return m_path; }\n    const SString &BasePath() const { LIMITED_METHOD_CONTRACT; return m_basePath; }\n\n    static Bundle* AppBundle; // The BundleInfo for the current app, initialized by coreclr_initialize.\n    static bool AppIsBundle() { LIMITED_METHOD_CONTRACT; return AppBundle != nullptr; }\n    static BundleFileLocation ProbeAppBundle(const SString& path, bool pathIsBundleRelative = false);\n\nprivate:\n\n    SString m_path; // The path to single-file executable\n    BundleProbeFn *m_probe;\n\n    SString m_basePath; // The prefix to denote a path within the bundle\n    COUNT_T m_basePathLength;\n};\n\n#endif // _BUNDLE_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cahlpr.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// File: CAHLPR.H\n//\n//\n//\n//*****************************************************************************\n#ifndef __CAHLPR_H__\n#define __CAHLPR_H__\n\n#include \"caparser.h\"\n\n//*****************************************************************************\n// This class assists in the parsing of CustomAttribute blobs.\n//*****************************************************************************\nstruct CaValue\n{\n    union\n    {\n        signed __int8       i1;\n        unsigned __int8     u1;\n        signed __int16      i2;\n        unsigned __int16    u2;\n        signed __int32      i4;\n        unsigned __int32    u4;\n        signed __int64      i8;\n        unsigned __int64    u8;\n        float               r4;\n        double              r8;\n        struct\n        {\n            LPCUTF8         pStr;\n            ULONG           cbStr;\n        } str;\n    };\n    unsigned __int8         tag;\n};\n\n#endif // __CAHLPR_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/caparser.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// File: caparser.h\n//\n\n\n//\n\n//\n// ============================================================================\n\n#ifndef __CAPARSER_H__\n#define __CAPARSER_H__\n\n#include \"stgpooli.h\"\n\nclass CustomAttributeParser {\npublic:\n    CustomAttributeParser(              // Constructor for CustomAttributeParser.\n        const void *pvBlob,             // Pointer to the CustomAttribute blob.\n        ULONG   cbBlob)                 // Size of the CustomAttribute blob.\n     :  m_pbCur(reinterpret_cast<const BYTE*>(pvBlob)),\n        m_pbBlob(reinterpret_cast<const BYTE*>(pvBlob)),\n        m_cbBlob(cbBlob)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\nprivate:\n    signed __int8    GetI1()\n    {\n        LIMITED_METHOD_CONTRACT;\n        signed __int8 tmp = *reinterpret_cast<const signed __int8*>(m_pbCur);\n        m_pbCur += sizeof(signed __int8);\n        return tmp;\n    }\n    unsigned __int8  GetU1()\n    {\n        LIMITED_METHOD_CONTRACT;\n        unsigned __int8 tmp = *reinterpret_cast<const unsigned __int8*>(m_pbCur);\n        m_pbCur += sizeof(unsigned __int8);\n        return tmp;\n    }\n\n    signed __int16   GetI2()\n    {\n        LIMITED_METHOD_CONTRACT;\n        signed __int16 tmp = GET_UNALIGNED_VAL16(m_pbCur);\n        m_pbCur += sizeof(signed __int16);\n        return tmp;\n    }\n    unsigned __int16 GetU2()\n    {\n        LIMITED_METHOD_CONTRACT;\n        unsigned __int16 tmp = GET_UNALIGNED_VAL16(m_pbCur);\n        m_pbCur += sizeof(unsigned __int16 );\n        return tmp;\n    }\n\n    signed __int32   GetI4()\n    {\n        LIMITED_METHOD_CONTRACT;\n        signed __int32 tmp = GET_UNALIGNED_VAL32(m_pbCur);\n        m_pbCur += sizeof(signed __int32 );\n        return tmp;\n    }\n    unsigned __int32 GetU4()\n    {\n        LIMITED_METHOD_CONTRACT;\n        unsigned __int32 tmp = GET_UNALIGNED_VAL32(m_pbCur);\n        m_pbCur += sizeof(unsigned __int32 );\n        return tmp;\n    }\n\n    signed __int64   GetI8()\n    {\n        LIMITED_METHOD_CONTRACT;\n        signed __int64 tmp = GET_UNALIGNED_VAL64(m_pbCur);\n        m_pbCur += sizeof(signed __int64 );\n        return tmp;\n    }\n    unsigned __int64 GetU8()\n    {\n        LIMITED_METHOD_CONTRACT;\n        unsigned __int64 tmp = GET_UNALIGNED_VAL64(m_pbCur);\n        m_pbCur += sizeof(unsigned __int64 );\n        return tmp;\n    }\n\npublic:\n    float            GetR4()\n    {\n        LIMITED_METHOD_CONTRACT;\n        __int32 tmp = GET_UNALIGNED_VAL32(m_pbCur);\n        _ASSERTE(sizeof(__int32) == sizeof(float));\n        m_pbCur += sizeof(float);\n        return (float &)tmp;\n    }\n\n    double           GetR8()\n    {\n        LIMITED_METHOD_CONTRACT;\n        __int64 tmp = GET_UNALIGNED_VAL64(m_pbCur);\n        _ASSERTE(sizeof(__int64) == sizeof(double));\n        m_pbCur += sizeof(double);\n        return (double &)tmp;\n    }\n\nprivate:\n    unsigned __int16 GetProlog()\n    {\n        WRAPPER_NO_CONTRACT;\n        unsigned __int16 val;\n        VERIFY(SUCCEEDED(GetProlog(&val)));\n        return val;\n    }\n\n    LPCUTF8 GetString(ULONG *pcbString)\n    {\n        WRAPPER_NO_CONTRACT;\n        LPCUTF8 val;\n        VERIFY(SUCCEEDED(GetString(&val, pcbString)));\n        return val;\n    }\n\npublic:\n    HRESULT GetI1(signed __int8 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(signed __int8))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetI1();\n        return S_OK;\n    }\n\n    HRESULT GetTag(CorSerializationType *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n        HRESULT hr;\n        signed __int8 tmp;\n        IfFailRet(GetI1(&tmp));\n        *pVal = (CorSerializationType)((unsigned __int8)tmp);\n        return hr;\n    }\n\n    HRESULT GetU1(unsigned __int8 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(unsigned __int8))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetU1();\n        return S_OK;\n    }\n\n    HRESULT GetI2(signed __int16 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(signed __int16))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetI2();\n        return S_OK;\n    }\n    HRESULT GetU2(unsigned __int16 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(unsigned __int16))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetU2();\n        return S_OK;\n    }\n\n    HRESULT GetI4(signed __int32 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(signed __int32))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetI4();\n        return S_OK;\n    }\n    HRESULT GetU4(unsigned __int32 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(unsigned __int32))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetU4();\n        return S_OK;\n    }\n\n    HRESULT GetI8(signed __int64 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(signed __int64))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetI8();\n        return S_OK;\n    }\n    HRESULT GetU8(unsigned __int64 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(unsigned __int64))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetU8();\n        return S_OK;\n    }\n\n    HRESULT GetR4(float *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(float))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetR4();\n        return S_OK;\n    }\n    HRESULT GetR8(double *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (BytesLeft() < (int) sizeof(double))\n            return META_E_CA_INVALID_BLOB;\n        *pVal = GetR8();\n        return S_OK;\n    }\n\n    HRESULT GetProlog(unsigned __int16 *pVal)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        m_pbCur = m_pbBlob;\n\n        if (BytesLeft() < (int)(sizeof(BYTE) * 2))\n            return META_E_CA_INVALID_BLOB;\n\n        return GetU2(pVal);\n    }\n\n    // Added for compatibility with anyone that may emit\n    // blobs where the prolog is the only incorrect data.\n    HRESULT SkipProlog()\n    {\n        unsigned __int16 val;\n        return GetProlog(&val);\n    }\n\n    HRESULT ValidateProlog()\n    {\n        HRESULT hr;\n        unsigned __int16 val;\n        IfFailRet(GetProlog(&val));\n\n        if (val != 0x0001)\n            return META_E_CA_INVALID_BLOB;\n\n        return hr;\n    }\n\n    //\n    // IMPORTANT: the returned string is typically not null-terminated.\n    //\n    // This can return any of three distinct valid results:\n    //   - NULL string, indicated by *pszString==NULL, *pcbString==0\n    //   - empty string, indicated by *pszString!=NULL, *pcbString==0\n    //   - non-empty string, indicated by *pdzString!=NULL, *pcbString!=0\n    //  If you expect non-null or non-empty strings in your usage scenario,\n    //  call the GetNonNullString and GetNonEmptyString helpers below.\n    //\n    HRESULT GetString(LPCUTF8 *pszString, ULONG *pcbString)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        HRESULT hr;\n\n        if (BytesLeft() == 0)\n        {   // Need to check for NULL string sentinel (see below),\n            // so need to have at least one byte to read.\n            IfFailRet(META_E_CA_INVALID_BLOB);\n        }\n\n        if (*m_pbCur == 0xFF)\n        {   // 0xFF indicates the NULL string, which is semantically\n            // different than the empty string.\n            *pszString = NULL;\n            *pcbString = 0;\n            m_pbCur++;\n            return S_OK;\n        }\n\n        // Get the length, pointer to data following the length.\n        return GetData((BYTE const **)pszString, pcbString);\n    }\n\n    //\n    // This can return any of two distinct valid results:\n    //   - empty string, indicated by *pszString!=NULL, *pcbString==0\n    //   - non-empty string, indicated by *pszString!=NULL, *pcbString!=0\n    //  If you expect non-null or non-empty strings in your usage scenario,\n    //  call the GetNonNullString and GetNonEmptyString helpers below.\n    //\n    HRESULT GetNonNullString(LPCUTF8 *pszString, ULONG *pcbString)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        HRESULT hr;\n\n        IfFailRet(GetString(pszString, pcbString));\n\n        if (*pszString == NULL)\n        {\n            return META_E_CA_INVALID_BLOB;\n        }\n\n        return S_OK;\n    }\n\n    //\n    // This function will only return success if the string is valid,\n    // non-NULL and non-empty; i.e., *pszString!=NULL, *pcbString!=0\n    //\n    HRESULT GetNonEmptyString(LPCUTF8 *pszString, ULONG *pcbString)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        HRESULT hr;\n\n        IfFailRet(GetNonNullString(pszString, pcbString));\n\n        if (*pcbString == 0)\n        {\n            return META_E_CA_INVALID_BLOB;\n        }\n\n        return S_OK;\n    }\n\n    // IMPORTANT: do not use with string fetching - use GetString instead.\n    HRESULT GetData(BYTE const **ppbData, ULONG *pcbData)\n    {\n        HRESULT hr;\n        IfFailRet(CPackedLen::SafeGetData(m_pbCur, m_pbBlob + m_cbBlob, pcbData, ppbData));\n        // Move past the data we just recovered\n        m_pbCur = *ppbData + *pcbData;\n\n        return S_OK;\n    }\n\n    // IMPORTANT: do not use with string fetching - use GetString instead.\n    HRESULT GetPackedValue(ULONG *pcbData)\n    {\n        return CPackedLen::SafeGetLength(m_pbCur, m_pbBlob + m_cbBlob, pcbData, &m_pbCur);\n    }\n\n    int BytesLeft()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (int)(m_cbBlob - (m_pbCur - m_pbBlob));\n    }\n\nprivate:\n    const BYTE  *m_pbCur;\n    const BYTE  *m_pbBlob;\n    ULONG       m_cbBlob;\n};\n\n#endif // __CAPARSER_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ceefilegenwriter.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ===========================================================================\n// File: CeeFileGenWriter.h\n//\n// ===========================================================================\n\n#ifndef _CEEFILEGENWRITER_H_\n#define _CEEFILEGENWRITER_H_\n//\n\n// CeeFileGenWriter contains all the code necessary to actually write an exe\n// while CCeeGen contains everything else. This lets CeeGen.exe and the VM\n// share more code without forcing the VM to carry the extra code to write an\n// exe.\n#include <windef.h>\n#include \"ceegen.h\"\n#include \"iceefilegen.h\"\n\nclass PEWriter;\nclass CeeFileGenWriter;\n\n// default setting for PE file\nconst UINT32 CEE_IMAGE_BASE_32 =              0x00400000;\nconst UINT64 CEE_IMAGE_BASE_64 = UI64(0x0000000140000000);\nconst int CEE_IMAGE_SUBSYSTEM_MAJOR_VERSION = 4;\nconst int CEE_IMAGE_SUBSYSTEM_MINOR_VERSION = 0;\n\nclass CeeFileGenWriter : public CCeeGen\n{\n    mdToken m_entryPoint;       // token for entry point\n    DWORD   m_comImageFlags;\n\n    LPWSTR m_outputFileName;\n    LPWSTR m_resourceFileName;\n    bool   m_dllSwitch;\n\n    ULONG m_iatOffset;\n\n    DWORD m_dwManifestRVA;\n    DWORD m_dwManifestSize;\n\n    DWORD m_dwStrongNameRVA;\n    DWORD m_dwStrongNameSize;\n\n    DWORD m_dwVTableRVA;\n    DWORD m_dwVTableSize;\n\n    bool m_linked;\n    bool m_fixed;\n\n    HRESULT checkForErrors();\n\n    struct IDataDllInfo {\n        const char *m_name;\n        int m_numMethods;\n        const char **m_methodName;\n        int m_iltOffset;\n        int m_ibnOffset;\n        int m_iatOffset;\n        int m_nameOffset;\n    } *m_iDataDlls;\n    int m_dllCount;\n\n    CeeSection *m_iDataSectionIAT;\n    int m_iDataOffsetIAT;\n    char *m_iDataIAT;\n\n    HRESULT allocateIAT();\npublic:\n    // Create with one of these two methods, not operator new\n    static HRESULT CreateNewInstance(CCeeGen *pCeeFileGenFrom, CeeFileGenWriter* & pGenWriter,\n                                        DWORD createFlags = ICEE_CREATE_FILE_PURE_IL);\n    // See ICeeFileGen.h for the definition of the bits used in createFlags\n    static HRESULT CreateNewInstanceEx(CCeeGen *pCeeFileGenFrom, CeeFileGenWriter* & pGenWriter,\n                                        DWORD createFlags, LPCWSTR seedFileName = NULL);\n\n    virtual HRESULT Cleanup();\n\n    PEWriter &getPEWriter();\n\n    HRESULT link();     // Layout the sections and assign their starting addresses\n    HRESULT fixup();    // Apply relocations to any pointer data. Also generate PE base relocs\n    HRESULT generateImage(void **ppImage);\n\n    HRESULT setImageBase(size_t imageBase);\n    HRESULT setImageBase64(ULONGLONG imageBase);\n    HRESULT setFileAlignment(ULONG fileAlignment);\n    HRESULT setSubsystem(DWORD subsystem, DWORD major, DWORD minor);\n\n    HRESULT getMethodRVA(ULONG codeOffset, ULONG *codeRVA);\n\n    HRESULT setEntryPoint(mdMethodDef method);\n    mdMethodDef getEntryPoint();\n\n    HRESULT setComImageFlags(DWORD mask);\n    HRESULT clearComImageFlags(DWORD mask);\n    DWORD getComImageFlags();\n\n    HRESULT setOutputFileName(_In_ LPWSTR outputFileName);\n    LPWSTR getOutputFileName();\n\n    HRESULT setResourceFileName(_In_ LPWSTR resourceFileName);\n    LPWSTR getResourceFileName();\n\n    HRESULT setDirectoryEntry(CeeSection &section, ULONG entry, ULONG size, ULONG offset=0);\n    HRESULT computeSectionOffset(CeeSection &section, _In_ char *ptr,\n                                 unsigned *offset);\n    HRESULT computeOffset(_In_ char *ptr, CeeSection **pSection,\n                          unsigned *offset);\n    HRESULT getCorHeader(IMAGE_COR20_HEADER **ppHeader);\n\n    HRESULT getFileTimeStamp(DWORD *pTimeStamp);\n\n    HRESULT setLibraryGuid(_In_ LPWSTR libraryGuid);\n\n    HRESULT setDllSwitch(bool dllSwitch);\n    bool getDllSwitch();\n    HRESULT setManifestEntry(ULONG size, ULONG offset);\n    HRESULT setStrongNameEntry(ULONG size, ULONG offset);\n    HRESULT setVTableEntry(ULONG size, ULONG offset);\n    HRESULT setVTableEntry64(ULONG size, void* ptr);\n\nprotected:\n    CeeFileGenWriter(); // ctor is protected\n\n    HRESULT emitResourceSection();\n    HRESULT emitExeMain();\n\n    HRESULT setAddrReloc(UCHAR *instrAddr, DWORD value);\n    HRESULT addAddrReloc(CeeSection &thisSection, UCHAR *instrAddr, DWORD offset, CeeSection *targetSection);\n\n    HRESULT MapTokens(CeeGenTokenMapper *pMapper, IMetaDataImport *pImport);\n    HRESULT MapTokensForMethod(CeeGenTokenMapper *pMapper,BYTE *pCode, LPCWSTR szMethodName);\n};\n\n\ninline PEWriter &CeeFileGenWriter::getPEWriter()\n{\n    return (PEWriter &) *m_peSectionMan;\n}\n\ninline LPWSTR CeeFileGenWriter::getOutputFileName() {\n    return m_outputFileName;\n}\n\ninline LPWSTR CeeFileGenWriter::getResourceFileName() {\n    return m_resourceFileName;\n}\n\ninline HRESULT CeeFileGenWriter::setDllSwitch(bool dllSwitch) {\n    m_dllSwitch = dllSwitch;\n    return S_OK;\n}\n\ninline bool CeeFileGenWriter::getDllSwitch() {\n    return m_dllSwitch;\n}\n\ninline mdMethodDef CeeFileGenWriter::getEntryPoint() {\n    return m_entryPoint;\n}\n\ninline HRESULT CeeFileGenWriter::setEntryPoint(mdMethodDef method) {\n    m_entryPoint = method;\n    return S_OK;\n}\n\ninline HRESULT CeeFileGenWriter::setComImageFlags(DWORD mask) {\n    m_comImageFlags |= mask; return S_OK;\n}\n\ninline HRESULT CeeFileGenWriter::clearComImageFlags(DWORD mask) {\n    m_comImageFlags &= ~mask; return S_OK;\n}\n\ninline DWORD CeeFileGenWriter::getComImageFlags() {\n    return m_comImageFlags;\n}\n\n\n//\n#if defined(_IMAGE_FILE_4K_SECTION_ALIGNMENT_)\n#define IMAGE_NT_OPTIONAL_HDR_SECTION_ALIGNMENT 0x1000\n#else\n#define IMAGE_NT_OPTIONAL_HDR_SECTION_ALIGNMENT 0x2000\n#endif\n\n// The stub is always x86 so we always mark the image as x86\n#define IMAGE_FILE_MACHINE IMAGE_FILE_MACHINE_I386\n\n\n#endif\t// _CEEFILEGENWRITER_H_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ceegen.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ===========================================================================\n// File: CEEGEN.H\n//\n// ===========================================================================\n\n#ifndef _CEEGEN_H_\n#define _CEEGEN_H_\n\n#include \"cor.h\"\n#include \"iceefilegen.h\"\n#include \"ceegentokenmapper.h\"\n\nclass CeeSection;\nclass CeeSectionString;\nclass CCeeGen;\nclass PESectionMan;\nclass PESection;\n\ntypedef DWORD StringRef;\n\n#if 0\n\n This is a description of the current implementation of these types for generating\n CLR modules.\n\n  ICeeGenInternal - interface to generate in-memory CLR module.\n\n  CCeeGen - implementation of ICeeGen. Currently it uses both CeeSections\n            as well as PESections (inside PESectionMan), and maintains a\n            1:1 relation between them. This is ugly.\n\n  CeeFileGenWriter - Provides functionality to write in-memory module to\n                     PE format file. Uses PEWriter (m_pSectionMan) for\n                     file-writing functionality\n\n  PEWriter - It can generate a PE format file. It also knows to apply\n             pointer relocs when it lays out the PESections.\n\n\n  ICeeFileGen - Interface used by compilers, ngen, etc, to generate\n                a CLR file.\n                Has a bunch of methods to emit signatures, tokens, methods,\n                etc which are not implemented. These are left over from before\n\n                                                     +----------------------------+\n                                                     | ICeeGenInternal            |\n                                                     |                            |\n                                                     |  COM-style version of      |\n                                                     |  ICeeFileGen. HCEEFILE is  |\n                                                     |  replaced with \"this\"      |\n        +-------------------------+                  |                            |\n        |     CeeSectionImpl      |                  +----------------------------+\n        +-------------------------+                                |\n           |                  |                                    |\n           |                  |                                    v\n           |                  v                      +---------------------------+\n           |             +------------+              |      CCeeGen              |\n           |             |            |              +---------------------------+\n           |             | CeeSection |  contains    |                           |\n           |             |            |<-------------| CeeSection* m_sections    |\n           |             +------------+              |                           |\n           |                                        /| PESectionMan m_pSectionMan|\n           |                                       / |                           |\n           |             +-----------------+      /  +---------------------------+\n           v             |   PESectionMan  |<----+                 |\n +-----------+           |                 |  contains             |\n | PESection |           +-----------------+                       |\n |           |  contains | PESection *     |                       v\n |           |<----------|      sectStart, |        +------------------------------+\n +-----------+           |      sectCur,   |        |       CeeFileGenWriter       |\n                         |      sectEnd    |        +------------------------------+\n                         +-----------------+        | Does meta-data specific      |\n                                  |                 | stuff and then dispatches to |\n                                  |                 | m_pSectionMan.PEWriter::***()|\n                                  |                 |                              |\n                                  v                 +------------------------------+\n                       +------------------------+                  ^\n                       |       PEWriter         |                  |wraps\n                       +------------------------+                  |\n                       | Low -level file writer |    +----------------------------+\n                       | Knows how to do        |    |        ICeeFileGen         |\n                       | pointer relocs         |    |                            |\n                       |                        |    | C-style interface. Deals    |\n                       +------------------------+    | with HCEEFILE, HCEESECTION |\n                                                     | etc. It is mostly just a   |\n                                                     | thin wrapper for a         |\n                                                     | CeeFileGenWriter           |\n                                                     +----------------------------+\n\n#endif // 0\n\n// ***** CeeSection classes\n\nclass CeeSectionImpl {\n  public:\n    virtual unsigned dataLen() = 0;\n    virtual char * getBlock(\n        unsigned len,\n        unsigned align = 1) = 0;\n    virtual HRESULT addSectReloc(\n        unsigned               offset,\n        CeeSection &           relativeTo,\n        CeeSectionRelocType    reloc = srRelocAbsolute,\n        CeeSectionRelocExtra * extra = NULL) = 0;\n    virtual HRESULT addBaseReloc(\n        unsigned               offset,\n        CeeSectionRelocType    reloc = srRelocHighLow,\n        CeeSectionRelocExtra * extra = NULL) = 0;\n    virtual HRESULT directoryEntry(unsigned num) = 0;\n    virtual unsigned char * name() = 0;\n    virtual char * computePointer(unsigned offset) const = 0;\n    virtual BOOL containsPointer(_In_ char * ptr) const = 0;\n    virtual unsigned computeOffset(_In_ char * ptr) const = 0;\n    virtual unsigned getBaseRVA() = 0;\n    virtual void SetInitialGrowth(unsigned growth) = 0;\n};\n\nclass CeeSection {\n    // m_ceeFile allows inter-section communication\n    CCeeGen &m_ceeFile;\n\n    // abstract away implementation to allow inheritance from CeeSection\n    CeeSectionImpl &m_impl;\n\n  public:\n    enum RelocFlags {\n        RELOC_NONE = 0,\n\n        // address should be fixed up to be a RVA not a normal address\n        RELOC_RVA = 1\n    };\n\n    CeeSection(CCeeGen &ceeFile, CeeSectionImpl &impl)\n        : m_ceeFile(ceeFile), m_impl(impl) { LIMITED_METHOD_CONTRACT; }\n\n    virtual ~CeeSection() {LIMITED_METHOD_CONTRACT;  }\n\n    // bytes in this section at present\n    unsigned dataLen();\n\n    // section base, after linking\n    unsigned getBaseRVA();\n\n    // get a block to write on (use instead of write to avoid copy)\n    char* getBlock(unsigned len, unsigned align=1);\n\n    // Indicates that the DWORD at 'offset' in the current section should\n    // have the base of section 'relativeTo added to it\n    HRESULT addSectReloc(unsigned offset, CeeSection& relativeTo,\n                         CeeSectionRelocType = srRelocAbsolute, CeeSectionRelocExtra *extra = 0);\n    // Add a base reloc for the given offset in the current section\n    virtual HRESULT addBaseReloc(unsigned offset, CeeSectionRelocType reloc = srRelocHighLow, CeeSectionRelocExtra *extra = 0);\n\n\n    // this section will be directory entry 'num'\n    HRESULT directoryEntry(unsigned num);\n\n    // return section name\n    unsigned char *name();\n\n    // simulate the base + offset with a more complex data storage\n    char * computePointer(unsigned offset) const;\n    BOOL containsPointer(_In_ char *ptr) const;\n    unsigned computeOffset(_In_ char *ptr) const;\n\n    CeeSectionImpl &getImpl();\n    CCeeGen &ceeFile();\n    void SetInitialGrowth(unsigned growth);\n};\n\n// ***** CCeeGen class\n// Only handles in memory stuff\n// Base class for CeeFileGenWriter (which actually generates PEFiles)\n\nclass CCeeGen : public ICeeGenInternal {\n    LONG m_cRefs;\n  protected:\n    short m_textIdx;            // m_sections[] index for the .text section\n    short m_metaIdx;            // m_sections[] index for metadata (.text, or .cormeta for obj files)\n    short m_corHdrIdx;          // m_sections[] index for the COM+ header (.text0)\n    short m_stringIdx;          // m_sections[] index for strings (.text, or .rdata for EnC)\n    short m_ilIdx;              // m_sections[] index for IL (.text)\n\n    CeeGenTokenMapper *m_pTokenMap;\n    BOOLEAN m_fTokenMapSupported;   // temporary to support both models\n    IMapToken *m_pRemapHandler;\n\n    CeeSection **m_sections;\n    short m_numSections;\n    short m_allocSections;\n\n    PESectionMan * m_peSectionMan;\n\n    IMAGE_COR20_HEADER *m_corHeader;\n    DWORD m_corHeaderOffset;\n\n    HRESULT allocateCorHeader();\n\n    HRESULT addSection(CeeSection *section, short *sectionIdx);\n\n// Init process: Call static CreateNewInstance() , not operator new\n  protected:\n    HRESULT Init();\n    CCeeGen();\n\n  public:\n\n    virtual ~CCeeGen() {}\n\n    static HRESULT CreateNewInstance(CCeeGen* & pCeeFileGen); // call this to instantiate\n\n    virtual HRESULT Cleanup();\n\n    // ICeeGenInternal interfaces\n\n    ULONG STDMETHODCALLTYPE AddRef();\n    ULONG STDMETHODCALLTYPE Release();\n    STDMETHODIMP QueryInterface(\n        REFIID riid,\n        void **ppInterface);\n\n    STDMETHODIMP EmitString (\n        _In_ LPWSTR lpString,               // [IN] String to emit\n        ULONG *RVA);\n\n    STDMETHODIMP GetString (\n        ULONG RVA,\n        __inout LPWSTR *lpString);\n\n    STDMETHODIMP AllocateMethodBuffer (\n        ULONG cchBuffer,                    // [IN] Length of string to emit\n        UCHAR **lpBuffer,                   // [OUT] Returned buffer\n        ULONG *RVA);\n\n    STDMETHODIMP GetMethodBuffer (\n        ULONG RVA,\n        UCHAR **lpBuffer);\n\n    STDMETHODIMP GetIMapTokenIface (\n        IUnknown **pIMapToken);\n\n    STDMETHODIMP GenerateCeeFile ();\n\n    STDMETHODIMP GetIlSection (\n        HCEESECTION *section);\n\n    STDMETHODIMP GetStringSection (\n        HCEESECTION *section);\n\n    STDMETHODIMP AddSectionReloc (\n        HCEESECTION section,\n        ULONG offset,\n        HCEESECTION relativeTo,\n        CeeSectionRelocType relocType);\n\n    STDMETHODIMP GetSectionCreate (\n        const char *name,\n        DWORD flags,\n        HCEESECTION *section);\n\n    STDMETHODIMP GetSectionDataLen (\n        HCEESECTION section,\n        ULONG *dataLen);\n\n    STDMETHODIMP GetSectionBlock (\n        HCEESECTION section,\n        ULONG len,\n        ULONG align=1,\n        void **ppBytes=0);\n\n   STDMETHODIMP ComputePointer (\n        HCEESECTION section,\n        ULONG RVA,                          // [IN] RVA for method to return\n        UCHAR **lpBuffer);                  // [OUT] Returned buffer\n\n\n    STDMETHODIMP AddNotificationHandler(IUnknown *pHandler);\n\n    // Write the metadata in \"emitter\" to the default metadata section is \"section\" is 0\n    // If 'section != 0, it will put the data in 'buffer'.  This\n    // buffer is assumed to be in 'section' at 'offset' and of size 'buffLen'\n    // (should use GetSaveSize to insure that buffer is big enough\n    virtual HRESULT emitMetaData(IMetaDataEmit *emitter,\n                        CeeSection* section=0, DWORD offset=0, BYTE* buffer=0, unsigned buffLen=0);\n    virtual HRESULT getMethodRVA(ULONG codeOffset, ULONG *codeRVA);\n\n    STDMETHODIMP SetInitialGrowth(DWORD growth);\n\n    CeeSection &getTextSection();\n    CeeSection &getMetaSection();\n    CeeSection &getCorHeaderSection();\n    CeeSectionString &getStringSection();\n    CeeSection &getIlSection();\n\n    virtual HRESULT getSectionCreate (const char *name, DWORD flags, CeeSection **section=NULL, short *sectionIdx = NULL);\n\n    PESectionMan* getPESectionMan() {\n        LIMITED_METHOD_CONTRACT;\n        return m_peSectionMan;\n    }\n\n    virtual HRESULT getMapTokenIface(IUnknown **pIMapToken, IMetaDataEmit *emitter=0);\n\n    CeeGenTokenMapper *getTokenMapper() {\n        LIMITED_METHOD_CONTRACT;\n        return m_pTokenMap;\n    }\n\n    virtual HRESULT addNotificationHandler(IUnknown *pHandler);\n\n    //Clone is actually a misnomer here.  This method will copy all of the\n    //instance variables and then do a deep copy (as necessary) of the sections.\n    //Section data will be appended onto any information already in the section.\n    //This is done to support the DynamicIL -> PersistedIL transform.\n    virtual HRESULT cloneInstance(CCeeGen *destination);\n};\n\n// ***** CeeSection inline methods\n\ninline unsigned CeeSection::dataLen() {\n    WRAPPER_NO_CONTRACT;\n    return m_impl.dataLen(); }\n\ninline unsigned CeeSection::getBaseRVA() {\n    WRAPPER_NO_CONTRACT;\n    return m_impl.getBaseRVA(); }\n\ninline char *CeeSection::getBlock(unsigned len, unsigned align) {\n    WRAPPER_NO_CONTRACT;\n    return m_impl.getBlock(len, align); }\n\ninline HRESULT CeeSection::addSectReloc(\n                unsigned offset, CeeSection& relativeTo, CeeSectionRelocType reloc, CeeSectionRelocExtra *extra) {\n    WRAPPER_NO_CONTRACT;\n    return(m_impl.addSectReloc(offset, relativeTo, reloc, extra));\n}\n\ninline HRESULT CeeSection::addBaseReloc(unsigned offset, CeeSectionRelocType reloc, CeeSectionRelocExtra *extra) {\n    WRAPPER_NO_CONTRACT;\n    return(m_impl.addBaseReloc(offset, reloc, extra));\n}\n\n\ninline HRESULT CeeSection::directoryEntry(unsigned num) {\n    WRAPPER_NO_CONTRACT;\n    TESTANDRETURN(num < IMAGE_NUMBEROF_DIRECTORY_ENTRIES, E_INVALIDARG);\n    m_impl.directoryEntry(num);\n    return S_OK;\n}\n\ninline CCeeGen &CeeSection::ceeFile() {\n    LIMITED_METHOD_CONTRACT;\n    return m_ceeFile; }\n\ninline CeeSectionImpl &CeeSection::getImpl() {\n    LIMITED_METHOD_CONTRACT;\n    return m_impl; }\n\ninline unsigned char *CeeSection::name() {\n    WRAPPER_NO_CONTRACT;\n    return m_impl.name();\n}\n\ninline char * CeeSection::computePointer(unsigned offset) const\n{\n    WRAPPER_NO_CONTRACT;\n    return m_impl.computePointer(offset);\n}\n\ninline BOOL CeeSection::containsPointer(_In_ char *ptr) const\n{\n    WRAPPER_NO_CONTRACT;\n    return m_impl.containsPointer(ptr);\n}\n\ninline unsigned CeeSection::computeOffset(_In_ char *ptr) const\n{\n    WRAPPER_NO_CONTRACT;\n    return m_impl.computeOffset(ptr);\n}\n\ninline void CeeSection::SetInitialGrowth(unsigned growth)\n{\n    WRAPPER_NO_CONTRACT;\n    m_impl.SetInitialGrowth(growth);\n}\n\n// ***** CCeeGen inline methods\n\ninline CeeSection &CCeeGen::getTextSection() {\n    LIMITED_METHOD_CONTRACT;\n\n    return *m_sections[m_textIdx]; }\n\ninline CeeSection &CCeeGen::getMetaSection() {\n    LIMITED_METHOD_CONTRACT;\n\n    return *m_sections[m_metaIdx]; }\n\ninline CeeSection &CCeeGen::getCorHeaderSection() {\n    LIMITED_METHOD_CONTRACT;\n    _ASSERTE(m_corHdrIdx >= 0);\n    return *m_sections[m_corHdrIdx]; }\n\ninline CeeSectionString &CCeeGen::getStringSection() {\n    LIMITED_METHOD_CONTRACT;\n\n    return *(CeeSectionString*)m_sections[m_stringIdx]; }\n\ninline CeeSection &CCeeGen::getIlSection() {\n    LIMITED_METHOD_CONTRACT;\n\n    return *m_sections[m_ilIdx]; }\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ceegentokenmapper.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// CeeGenTokenMapper.h\n//\n// This helper class tracks mapped tokens from their old value to the new value\n// which can happen when the data is optimized on save.\n//\n//*****************************************************************************\n\n#ifndef __CeeGenTokenMapper_h__\n#define __CeeGenTokenMapper_h__\n\n#include \"utilcode.h\"\n\ntypedef CDynArray<mdToken> TOKENMAP;\n\n#define INDEX_OF_TYPE(type) ((type) >> 24)\n//r#define INDEX_FROM_TYPE(type) case INDEX_OF_TYPE(mdt ## type): return (tkix ## type)\n\n// Define the list of CeeGen tracked tokens\n#define CEEGEN_TRACKED_TOKENS()             \\\n    CEEGEN_TRACKED_TOKEN(TypeDef)           \\\n    CEEGEN_TRACKED_TOKEN(InterfaceImpl)     \\\n    CEEGEN_TRACKED_TOKEN(MethodDef)         \\\n    CEEGEN_TRACKED_TOKEN(TypeRef)           \\\n    CEEGEN_TRACKED_TOKEN(MemberRef)         \\\n    CEEGEN_TRACKED_TOKEN(CustomAttribute)   \\\n    CEEGEN_TRACKED_TOKEN(FieldDef)          \\\n    CEEGEN_TRACKED_TOKEN(ParamDef)          \\\n    CEEGEN_TRACKED_TOKEN(File)              \\\n    CEEGEN_TRACKED_TOKEN(GenericParam)      \\\n\nclass CCeeGen;\n\n#define CEEGEN_TRACKED_TOKEN(x) tkix ## x,\n\nclass CeeGenTokenMapper : public IMapToken\n{\nfriend class CCeeGen;\nfriend class PESectionMan;\npublic:\n    enum\n    {\n        CEEGEN_TRACKED_TOKENS()\n        MAX_TOKENMAP\n    };\n\n    static int IndexForType(mdToken tk);\n\n    CeeGenTokenMapper() : m_pIImport(0), m_cRefs(1), m_pIMapToken(NULL)  { LIMITED_METHOD_CONTRACT; }\n    virtual ~CeeGenTokenMapper() {}\n\n//*****************************************************************************\n// IUnknown implementation.\n//*****************************************************************************\n    virtual ULONG STDMETHODCALLTYPE AddRef()\n    {LIMITED_METHOD_CONTRACT;  return ++m_cRefs; }\n\n    virtual ULONG STDMETHODCALLTYPE Release()\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n        SUPPORTS_DAC_HOST_ONLY;\n\n        ULONG cRefs = --m_cRefs;\n        if (cRefs == 0)\n        {\n            if (m_pIMapToken)\n            {\n                m_pIMapToken->Release();\n                m_pIMapToken = NULL;\n            }\n\n            delete this;\n        }\n        return cRefs;\n    }\n\n    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, PVOID *ppIUnk);\n\n//*****************************************************************************\n// Called by the meta data engine when a token is remapped to a new location.\n// This value is recorded in the m_rgMap array based on type and rid of the\n// from token value.\n//*****************************************************************************\n    virtual HRESULT STDMETHODCALLTYPE Map(mdToken tkImp, mdToken tkEmit);\n\n//*****************************************************************************\n// Check the given token to see if it has moved to a new location.  If so,\n// return true and give back the new token.\n//*****************************************************************************\n    virtual int HasTokenMoved(mdToken tkFrom, mdToken &tkTo);\n\n    int GetMaxMapSize() const\n    { LIMITED_METHOD_CONTRACT; return (MAX_TOKENMAP); }\n\n    IUnknown *GetMapTokenIface() const\n    { LIMITED_METHOD_CONTRACT; return ((IUnknown *) this); }\n\n\n//*****************************************************************************\n// Hand out a copy of the meta data information.\n//*****************************************************************************\n    virtual HRESULT GetMetaData(IMetaDataImport **ppIImport);\n\n//*****************************************************************************\n// Add another token mapper.\n//*****************************************************************************\n    virtual HRESULT AddTokenMapper(IMapToken *pIMapToken)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        // Add the token mapper, if there isn't already one.\n        if (m_pIMapToken == NULL)\n        {\n            m_pIMapToken = pIMapToken;\n            m_pIMapToken->AddRef();\n            return S_OK;\n        }\n        else\n        {\n            _ASSERTE(!\"Token mapper already set!\");\n            return E_FAIL;\n        }\n    }\n\nprotected:\n// m_rgMap is an array indexed by token type.  For each type, an array of\n// tokens is kept, indexed by from rid.  To see if a token has been moved,\n// do a lookup by type to get the right array, then use the from rid to\n// find the to rid.\n    TOKENMAP    m_rgMap[MAX_TOKENMAP];\n    IMetaDataImport *m_pIImport;\n    ULONG       m_cRefs;                // Ref count.\n    IMapToken  *m_pIMapToken;\n\n};\n\n#endif // __CeeGenTokenMapper_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ceesectionstring.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ===========================================================================\n// File: CeeSectionString.h\n//\n// ===========================================================================\n\n#ifndef CeeSectionString_H\n#define CeeSectionString_H\n\n#include <ole2.h>\n#include \"ceegen.h\"\n\n// This class is responsible for managing all the strings that have\n// been emitted for the PE file.\n\n// This class manages the strings that are added to the .rdata section.\n// It keeps track of each string that has been added using a hashtable.\n// The hash table is effectively 2-dimensional. There is a large \"virtual\n// hash space\" that is used to get a wide hash code distribution. The\n// virtual hash space is mapped into a real hash table where each n\n// hash values in the virtual space fall into a given hash bucket for\n// real hash table size n. Within the bucket, elements are stored in a linked\n// list in-order. When an virtual hash entry corresponds to a given bucket,\n// that bucket is searched for the matching hash id. If not found, it is\n// inserted, otherwise, the value is returned. The idea is that for smaller\n// apps, there won't be a large number of strings, so that collisions are\n// minimal and the length of each bucket's chain is small. For larger\n// numbers of strings, having a large hash space also reduces numbers\n// of collisions, avoiding string compares unless the hash codes match.\n\nstruct StringTableEntry;\n\nclass CeeSectionString : public CeeSection {\n\tenum { MaxRealEntries = 100, MaxVirtualEntries = 10000 };\n\tStringTableEntry *stringTable[MaxRealEntries];\n\n\tStringTableEntry *createEntry(_In_z_ LPWSTR target, ULONG hashId);\n\tStringTableEntry *findStringInsert(\n\t\t\t\tStringTableEntry *&entry, _In_z_ LPWSTR targetValue, ULONG hashId);\n\tvoid deleteEntries(StringTableEntry *e);\n#ifdef RDATA_STATS\n\tint dumpEntries(StringTableEntry *e);\n\tvoid dumpTable();\n#endif\n\n  public:\n\t~CeeSectionString();\n\tCeeSectionString(CCeeGen &ceeFile, CeeSectionImpl &impl);\n\tvirtual HRESULT getEmittedStringRef(_In_z_ LPWSTR targetValue, StringRef *ref);\n};\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cfi.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef CFI_H_\n#define CFI_H_\n\n#define DWARF_REG_ILLEGAL -1\nenum CFI_OPCODE\n{\n   CFI_ADJUST_CFA_OFFSET,    // Offset is adjusted relative to the current one.\n   CFI_DEF_CFA_REGISTER,     // New register is used to compute CFA\n   CFI_REL_OFFSET            // Register is saved at offset from the current CFA\n};\n\nstruct CFI_CODE\n{\n    unsigned char CodeOffset;// Offset from the start of code the frame covers.\n    unsigned char CfiOpCode;\n    short DwarfReg;          // Dwarf register number. 0~32 for x64.\n    int Offset;\n    CFI_CODE(unsigned char codeOffset, unsigned char cfiOpcode,\n        short dwarfReg, int offset)\n        : CodeOffset(codeOffset)\n        , CfiOpCode(cfiOpcode)\n        , DwarfReg(dwarfReg)\n        , Offset(offset)\n    {}\n};\ntypedef CFI_CODE* PCFI_CODE;\n\n#endif // CFI_H\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/check.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// Check.h\n//\n\n//\n// Assertion checking infrastructure\n// ---------------------------------------------------------------------------\n\n\n#ifndef CHECK_H_\n#define CHECK_H_\n\n#include \"static_assert.h\"\n#include \"daccess.h\"\n#include \"unreachable.h\"\n\n#ifdef _DEBUG\n\n#ifdef _MSC_VER\n// Make sure we can recurse deep enough for FORCEINLINE\n#pragma inline_recursion(on)\n#pragma inline_depth(16)\n#pragma warning(disable:4714)\n#endif // _MSC_VER\n\n#if !defined(DISABLE_CONTRACTS)\n#define CHECK_INVARIANTS 1\n#define VALIDATE_OBJECTS 1\n#endif\n\n#endif  // _DEBUG\n\n#if defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define _DEBUG_IMPL 1\n#endif\n\n#ifdef _DEBUG\n#define DEBUG_ARG(x)  , x\n#else\n#define DEBUG_ARG(x)\n#endif\n\n#define CHECK_STRESS 1\n\n//--------------------------------------------------------------------------------\n// A CHECK is an object which encapsulates a potential assertion\n// failure.  It not only contains the result of the check, but if the check fails,\n// also records information about the condition and call site.\n//\n// CHECK also serves as a holder to prevent recursive CHECKS. These can be\n// particularly common when putting preconditions inside predicates, especially\n// routines called by an invariant.\n//\n// Note that using CHECK is perfectly efficient in a free build - the CHECK becomes\n// a simple string constant pointer (typically either NULL or (LPCSTR)1, although some\n// check failures may include messages)\n//\n// NOTE: you should NEVER use the CHECK class API directly - use the macros below.\n//--------------------------------------------------------------------------------\n\nclass SString;\n\nclass CHECK\n{\nprotected:\n    // On retail, this is a pointer to a string literal, null or (LPCSTR)1.\n    // On debug, this is a pointer to dynamically allocated memory - that\n    // lets us have formatted strings in debug builds.\n    LPCSTR  m_message;\n\n#ifdef _DEBUG\n    LPCSTR  m_condition;\n    LPCSTR  m_file;\n    INT     m_line;\n    LONG    *m_pCount;\n\n    // Keep leakage counters.\n    static  size_t s_cLeakedBytes;\n    static  size_t s_cNumFailures;\n\n    static thread_local LONG t_count;\n#endif\n\n    static BOOL s_neverEnforceAsserts;\n\npublic: // !!! NOTE: Called from macros only!!!\n\n    // If we are not in a check, return TRUE and PushCheck; otherwise return FALSE\n    BOOL EnterAssert();\n\n    // Pops check count\n    void LeaveAssert();\n\n    // Just return if we are in a check\n    BOOL IsInAssert();\n\n    // Should we skip enforcing asserts\n    static BOOL EnforceAssert();\n\n    static BOOL EnforceAssert_StaticCheckOnly();\n\n    static void ResetAssert();\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4702) // Disable bogus unreachable code warning\n#endif // _MSC_VER\n    CHECK() : m_message(NULL)\n#ifdef _DEBUG\n              , m_condition (NULL)\n              , m_file(NULL)\n              , m_line(NULL)\n              , m_pCount(NULL)\n#endif\n    {}\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif // _MSC_VER\n\n    // Fail records the result of a condition check.  Can take either a\n    // boolean value or another check result\n    BOOL Fail(BOOL condition);\n    BOOL Fail(const CHECK &check);\n\n    // Setup records context info after a failure.\n    void Setup(LPCSTR message DEBUG_ARG(LPCSTR condition) DEBUG_ARG(LPCSTR file) DEBUG_ARG(INT line));\n    static LPCSTR FormatMessage(LPCSTR messageFormat, ...);\n\n    // Trigger triggers the actual check failure.  The trigger may provide a reason\n    // to include in the failure message.\n    void Trigger(LPCSTR reason);\n\n    // Finally, convert to a BOOL to allow just testing the result of a Check function\n    operator BOOL();\n\n    BOOL operator!();\n\n    CHECK &operator()() { return *this; }\n\n    static inline const CHECK OK() {\n        return CHECK();\n    }\n\n    static void SetAssertEnforcement(BOOL value);\n\n  private:\n#ifdef _DEBUG\n    static LPCSTR AllocateDynamicMessage(const SString &s);\n#endif\n};\n\n\n//--------------------------------------------------------------------------------\n// These CHECK macros are the correct way to propagate an assertion.  These\n// routines are designed for use inside \"Check\" routines.  Such routines may\n// be Invariants, Validate routines, or any other assertional predicates.\n//\n// A Check routine should return a value of type CHECK.\n//\n// It should consist of multiple CHECK or CHECK_MSG statements (along with appropritate\n// control flow) and should end with CHECK_OK() if all other checks pass.\n//\n// It may contain a CONTRACT_CHECK contract, but this is only appropriate if the\n// check is used for non-assertional purposes (otherwise the contract will never execute).\n// Note that CONTRACT_CHECK contracts do not support postconditions.\n//\n// CHECK: Check the given condition, return a CHECK failure if FALSE\n// CHECK_MSG: Same, but include a message parameter if the check fails\n// CHECK_OK: Return a successful check value;\n//--------------------------------------------------------------------------------\n\n#ifdef _DEBUG\n#define DEBUG_ONLY_MESSAGE(msg)     msg\n#else\n// On retail, we don't want to add a bunch of string literals to the image,\n// so we just use the same one everywhere.\n#define DEBUG_ONLY_MESSAGE(msg)     ((LPCSTR)1)\n#endif\n\n#define CHECK_MSG_EX(_condition, _message, _RESULT)                 \\\ndo                                                                  \\\n{                                                                   \\\n    CHECK _check;                                                   \\\n    if (_check.Fail(_condition))                                    \\\n    {                                                               \\\n        ENTER_DEBUG_ONLY_CODE;                                      \\\n        _check.Setup(DEBUG_ONLY_MESSAGE(_message)                   \\\n            DEBUG_ARG(#_condition)                                  \\\n            DEBUG_ARG(__FILE__)                                     \\\n            DEBUG_ARG(__LINE__));                                   \\\n        _RESULT(_check);                                            \\\n        LEAVE_DEBUG_ONLY_CODE;                                      \\\n    }                                                               \\\n} while (0)\n\n#define RETURN_RESULT(r) return r\n\n#define CHECK_MSG(_condition, _message)                             \\\n    CHECK_MSG_EX(_condition, _message, RETURN_RESULT)\n\n#define CHECK(_condition)                                           \\\n    CHECK_MSG(_condition, \"\")\n\n#define CHECK_MSGF(_condition, _args)                               \\\n    CHECK_MSG(_condition, CHECK::FormatMessage _args)\n\n#define CHECK_FAIL(_message)                                        \\\n    CHECK_MSG(FALSE, _message); UNREACHABLE()\n\n#define CHECK_FAILF(_args)                                          \\\n    CHECK_MSGF(FALSE, _args); UNREACHABLE()\n\n#define CHECK_OK                                                    \\\n    return CHECK::OK()\n\n//--------------------------------------------------------------------------------\n// ASSERT_CHECK is the proper way to trigger a check result.  If the CHECK\n// has failed, the diagnostic assertion routines will fire with appropriate\n// context information.\n//\n// Note that the condition may either be a raw boolean expression or a CHECK result\n// returned from a Check routine.\n//\n// Recursion note: ASSERT_CHECKs are only performed if there is no current check in\n// progress.\n//--------------------------------------------------------------------------------\n\n#ifndef ENTER_DEBUG_ONLY_CODE\n#define ENTER_DEBUG_ONLY_CODE\n#endif\n\n#ifndef LEAVE_DEBUG_ONLY_CODE\n#define LEAVE_DEBUG_ONLY_CODE\n#endif\n\n#define ASSERT_CHECK(_condition, _message, _reason)                 \\\ndo                                                                  \\\n{                                                                   \\\n    CHECK _check;                                                   \\\n    if (_check.EnterAssert())                                       \\\n    {                                                               \\\n        ENTER_DEBUG_ONLY_CODE;                                      \\\n        if (_check.Fail(_condition))                                \\\n        {                                                           \\\n            _check.Setup(_message                                   \\\n                DEBUG_ARG(#_condition)                              \\\n                DEBUG_ARG(__FILE__)                                 \\\n                DEBUG_ARG(__LINE__));                               \\\n            _check.Trigger(_reason);                                \\\n        }                                                           \\\n        LEAVE_DEBUG_ONLY_CODE;                                      \\\n        _check.LeaveAssert();                                       \\\n    }                                                               \\\n} while (0)\n\n// ex: ASSERT_CHECKF(1+2==4, \"my reason\", (\"Woah %d\", 1+3));\n// note that the double parenthesis, the 'args' param below will include one pair of parens.\n#define ASSERT_CHECKF(_condition, _reason, _args)                   \\\n    ASSERT_CHECK(_condition, CHECK::FormatMessage _args, _reason)\n\n//--------------------------------------------------------------------------------\n// INVARIANTS are descriptions of conditions which are always true at well defined\n// points of execution.  Invariants may be checked by the caller or callee at any\n// time as paranoia requires.\n//\n// There are really two flavors of invariant.  The \"public invariant\" describes\n// to the caller invariant behavior about the abstraction which is visible from\n// the public API (and of course it should be expressible in that public API).\n//\n// The \"internal invariant\" (or representation invariant), on the other hand, is\n// a description of the private implementation of the abstraction, which may examine\n// internal state of the abstraction or use private entry points.\n//\n// Classes with invariants should introduce methods called\n// void Invariant();\n// and\n// void InternalInvariant();\n// to allow invariant checks.\n//--------------------------------------------------------------------------------\n\n#if CHECK_INVARIANTS\n\ntemplate <typename TYPENAME>\nCHECK CheckInvariant(TYPENAME &obj)\n{\n#if defined(_MSC_VER) || defined(__llvm__)\n    __if_exists(TYPENAME::Invariant)\n    {\n        CHECK(obj.Invariant());\n    }\n    __if_exists(TYPENAME::InternalInvariant)\n    {\n        CHECK(obj.InternalInvariant());\n    }\n#endif\n\n    CHECK_OK;\n}\n\n#define CHECK_INVARIANT(o) \\\n    ASSERT_CHECK(CheckInvariant(o), NULL, \"Invariant failure\")\n\n#else\n\n#define CHECK_INVARIANT(o)  do { } while (0)\n\n#endif\n\n//--------------------------------------------------------------------------------\n// VALIDATE is a check to be made on an object type which identifies a pointer as\n// a valid instance of the object, by calling CheckPointer on it.  Normally a null\n// pointer is treated as an error; VALIDATE_NULL (or CheckPointer(o, NULL_OK))\n// may be used when a null pointer is acceptible.\n//\n// In addition to the null/non-null check, a type may provide a specific Check method\n// for more sophisticated identification. In general, the Check method\n// should answer the question\n// \"Is this a valid instance of its declared compile-time type?\". For instance, if\n// runtype type identification were supported for the type, it should be invoked here.\n//\n// Note that CheckPointer will also check the invariant(s) if appropriate, so the\n// invariants should NOT be explicitly invoked from the Check method.\n//--------------------------------------------------------------------------------\n\nenum IsNullOK\n{\n    NULL_NOT_OK = 0,\n    NULL_OK = 1\n};\n\n#if CHECK_INVARIANTS\ntemplate <typename TYPENAME>\nCHECK CheckPointer(TYPENAME *o, IsNullOK ok = NULL_NOT_OK)\n{\n    if (o == NULL)\n    {\n        CHECK_MSG(ok, \"Illegal null pointer\");\n    }\n    else\n    {\n#if defined(_MSC_VER) || defined(__llvm__)\n        __if_exists(TYPENAME::Check)\n        {\n            CHECK(o->Check());\n        }\n#endif\n    }\n\n    CHECK_OK;\n}\n\ntemplate <typename TYPENAME>\nCHECK CheckValue(TYPENAME &val)\n{\n#if defined(_MSC_VER) || defined(__llvm__)\n    __if_exists(TYPENAME::Check)\n    {\n        CHECK(val.Check());\n    }\n#endif\n\n    CHECK(CheckInvariant(val));\n\n    CHECK_OK;\n}\n#else // CHECK_INVARIANTS\n\n#ifdef _DEBUG_IMPL\n// Don't defined these functions to be nops for the non-debug\n// build as it may hide important checks\ntemplate <typename TYPENAME>\nCHECK CheckPointer(TYPENAME *o, IsNullOK ok = NULL_NOT_OK)\n{\n    if (o == NULL)\n    {\n        CHECK_MSG(ok, \"Illegal null pointer\");\n    }\n\n    CHECK_OK;\n}\n\ntemplate <typename TYPENAME>\nCHECK CheckValue(TYPENAME &val)\n{\n    CHECK_OK;\n}\n#endif\n\n#endif  // CHECK_INVARIANTS\n\n#if VALIDATE_OBJECTS\n\n#define VALIDATE(o) \\\n    ASSERT_CHECK(CheckPointer(o), \"Validation failure\")\n#define VALIDATE_NULL(o) \\\n    ASSERT_CHECK(CheckPointer(o, NULL_OK), \"Validation failure\")\n\n#else\n\n#define VALIDATE(o)         do { } while (0)\n#define VALIDATE_NULL(o)    do { } while (0)\n\n#endif\n\n//--------------------------------------------------------------------------------\n// CONSISTENCY_CHECKS are ad-hoc assertions about the expected state of the program\n// at a given time.  A failure in one of these indicates a bug in the code.\n//\n// Note that the condition may either be a raw boolean expression or a CHECK result\n// returned from a Check routine.\n//--------------------------------------------------------------------------------\n\n#define CONSISTENCY_CHECK(_condition) \\\n    CONSISTENCY_CHECK_MSG(_condition, \"\")\n\n#ifdef _DEBUG_IMPL\n\n#define CONSISTENCY_CHECK_MSG(_condition, _message) \\\n    ASSERT_CHECK(_condition, _message, \"Consistency check failed\")\n\n#define CONSISTENCY_CHECK_MSGF(_condition, args) \\\n    ASSERT_CHECKF(_condition, \"Consistency check failed\", args)\n\n#else\n\n#define CONSISTENCY_CHECK_MSG(_condition, _message) do { } while (0)\n#define CONSISTENCY_CHECK_MSGF(_condition, args) do { } while (0)\n\n#endif\n\n//--------------------------------------------------------------------------------\n// SIMPLIFYING_ASSUMPTIONS are workarounds which are placed in the code to allow progress\n// to be made in the case of difficult corner cases.  These should NOT be left in the\n// code; they are really just markers of things which need to be fixed.\n//\n// Note that the condition may either be a raw boolean expression or a CHECK result\n// returned from a Check routine.\n//--------------------------------------------------------------------------------\n\n// Ex usage:\n// SIMPLIFYING_ASSUMPTION(SomeExpression());\n#define SIMPLIFYING_ASSUMPTION(_condition) \\\n    SIMPLIFYING_ASSUMPTION_MSG(_condition, \"\")\n\n\n// Helper for HRs. Will provide formatted message showing the failure code.\n#define SIMPLIFYING_ASSUMPTION_SUCCEEDED(__hr) \\\n    { \\\n        HRESULT __hr2 = (__hr); \\\n        (void)__hr2; \\\n        SIMPLIFYING_ASSUMPTION_MSGF(SUCCEEDED(__hr2), (\"HRESULT failed.\\n Expected success.\\n Actual=0x%x\\n\", __hr2)); \\\n    }\n\n#ifdef _DEBUG_IMPL\n\n// Ex usage:\n// SIMPLIFYING_ASSUMPTION_MSG(SUCCEEDED(hr), \"It failed!\");\n#define SIMPLIFYING_ASSUMPTION_MSG(_condition, _message) \\\n    ASSERT_CHECK(_condition, _message, \"Unhandled special case detected\")\n\n// use a formatted string. Ex usage:\n// SIMPLIFYING_ASSUMPTION_MSGF(SUCCEEDED(hr), (\"Woah it failed! 0x%08x\", hr));\n#define SIMPLIFYING_ASSUMPTION_MSGF(_condition, args) \\\n    ASSERT_CHECKF(_condition, \"Unhandled special case detected\", args)\n\n#else   // !_DEBUG_IMPL\n\n#define SIMPLIFYING_ASSUMPTION_MSG(_condition, _message)    do { } while (0)\n#define SIMPLIFYING_ASSUMPTION_MSGF(_condition, args)       do { } while (0)\n\n#endif  // !_DEBUG_IMPL\n\n//--------------------------------------------------------------------------------\n// COMPILER_ASSUME_MSG is a statement that tells the compiler to assume the\n// condition is true.  In a checked build these turn into asserts;\n// in a free build they are passed through to the compiler to use in optimization.\n//--------------------------------------------------------------------------------\n\n#if defined(_PREFAST_) || defined(_PREFIX_) || defined(__clang_analyzer__)\n#define COMPILER_ASSUME_MSG(_condition, _message) if (!(_condition)) __UNREACHABLE();\n#define COMPILER_ASSUME_MSGF(_condition, args) if (!(_condition)) __UNREACHABLE();\n#else\n\n#if defined(DACCESS_COMPILE)\n#define COMPILER_ASSUME_MSG(_condition, _message) do { } while (0)\n#define COMPILER_ASSUME_MSGF(_condition, args)    do { } while (0)\n#else\n\n#if defined(_DEBUG)\n#define COMPILER_ASSUME_MSG(_condition, _message) \\\n    ASSERT_CHECK(_condition, _message, \"Compiler optimization assumption invalid\")\n#define COMPILER_ASSUME_MSGF(_condition, args) \\\n    ASSERT_CHECKF(_condition, \"Compiler optimization assumption invalid\", args)\n#else\n#define COMPILER_ASSUME_MSG(_condition, _message) __assume(_condition)\n#define COMPILER_ASSUME_MSGF(_condition, args) __assume(_condition)\n#endif // _DEBUG\n\n#endif // DACCESS_COMPILE\n\n#endif // _PREFAST_ || _PREFIX_\n\n\n#define COMPILER_ASSUME(_condition) \\\n    COMPILER_ASSUME_MSG(_condition, \"\")\n\n\n//--------------------------------------------------------------------------------\n// PREFIX_ASSUME_MSG and PREFAST_ASSUME_MSG are just another name\n// for COMPILER_ASSUME_MSG\n// In a checked build these turn into asserts; in a free build\n// they are passed through to the compiler to use in optimization;\n//  via an __assume(_condition) optimization hint.\n//--------------------------------------------------------------------------------\n\n#define PREFIX_ASSUME_MSG(_condition, _message) \\\n    COMPILER_ASSUME_MSG(_condition, _message)\n\n#define PREFIX_ASSUME_MSGF(_condition, args) \\\n    COMPILER_ASSUME_MSGF(_condition, args)\n\n#define PREFIX_ASSUME(_condition) \\\n    COMPILER_ASSUME_MSG(_condition, \"\")\n\n#define PREFAST_ASSUME_MSG(_condition, _message) \\\n    COMPILER_ASSUME_MSG(_condition, _message)\n\n#define PREFAST_ASSUME_MSGF(_condition, args) \\\n    COMPILER_ASSUME_MSGF(_condition, args)\n\n#define PREFAST_ASSUME(_condition) \\\n    COMPILER_ASSUME_MSG(_condition, \"\")\n\n//--------------------------------------------------------------------------------\n// UNREACHABLE points are locations in the code which should not be able to be\n// reached under any circumstances (e.g. a default in a switch which is supposed to\n// cover all cases.).  This macro tells the compiler this, and also embeds a check\n// to make sure it is always true.\n//--------------------------------------------------------------------------------\n\n#define UNREACHABLE() \\\n    UNREACHABLE_MSG(\"\")\n\n#ifdef __llvm__\n\n// LLVM complains if a function does not return what it says.\n#define UNREACHABLE_RET() do { UNREACHABLE(); return 0; } while (0)\n#define UNREACHABLE_MSG_RET(_message) UNREACHABLE_MSG(_message); return 0;\n\n#else // __llvm__\n\n#define UNREACHABLE_RET() UNREACHABLE()\n#define UNREACHABLE_MSG_RET(_message) UNREACHABLE_MSG(_message)\n\n#endif // __llvm__ else\n\n#ifdef _DEBUG_IMPL\n\n// Note that the \"do { } while (0)\" syntax trick here doesn't work, as the compiler\n// gives an error that the while(0) is unreachable code\n#define UNREACHABLE_MSG(_message)                                               \\\n{                                                                               \\\n    CHECK _check;                                                               \\\n    _check.Setup(_message, \"<unreachable>\", __FILE__, __LINE__);                \\\n    _check.Trigger(\"Reached the \\\"unreachable\\\"\");                              \\\n} __UNREACHABLE()\n\n#else\n\n#define UNREACHABLE_MSG(_message) __UNREACHABLE()\n\n#endif\n\n\n//--------------------------------------------------------------------------------\n// STRESS_CHECK represents a check which is included in a free build\n// @todo: behavior on trigger\n//\n// Note that the condition may either be a raw boolean expression or a CHECK result\n// returned from a Check routine.\n//\n// Since Retail builds don't allow formatted checks, there's no STRESS_CHECK_MSGF.\n//--------------------------------------------------------------------------------\n\n#if CHECK_STRESS\n\n#define STRESS_CHECK(_condition, _message) \\\n    ASSERT_CHECK(_condition, _message, \"Stress Assertion Failure\")\n\n#else\n\n#define STRESS_CHECK(_condition, _message)  do { } while (0)\n\n#endif\n\n//--------------------------------------------------------------------------------\n// CONTRACT_CHECK is used to put contracts on Check function.  Note that it does\n// not support postconditions.\n//--------------------------------------------------------------------------------\n\n#define CONTRACT_CHECK      CONTRACTL\n#define CONTRACT_CHECK_END  CONTRACTL_END\n\n//--------------------------------------------------------------------------------\n// CCHECK is used for Check functions which may fail due to out of memory\n// or other transient failures. These failures should be ignored when doing\n// assertions, but they cannot be ignored when the Check function is used in\n// normal code.\n// @todo: really crufty to have 2 sets of CHECK macros\n//--------------------------------------------------------------------------------\n\n#ifdef _DEBUG\n\n#define CCHECK_START                                                            \\\n    {                                                                           \\\n        BOOL ___exception = FALSE;                                              \\\n        BOOL ___transient = FALSE;                                              \\\n        CHECK ___result = CHECK::OK();                                          \\\n        EX_TRY {\n\n#define CCHECK_END                                                              \\\n        } EX_CATCH {                                                            \\\n            if (___result.IsInAssert())                                            \\\n            {                                                                   \\\n                ___exception = TRUE;                                            \\\n                ___transient = GET_EXCEPTION()->IsTransient();                  \\\n            }                                                                   \\\n            else                                                                \\\n                EX_RETHROW;                                                     \\\n        } EX_END_CATCH(RethrowTerminalExceptions);                              \\\n                                                                                \\\n        if (___exception)                                                       \\\n        {                                                                       \\\n            if (___transient)                                                   \\\n                CHECK_OK;                                                       \\\n            else                                                                \\\n                CHECK_FAIL(\"Nontransient exception occurred during check\");     \\\n        }                                                                       \\\n        CHECK(___result);                                                       \\\n    }\n\n#define CRETURN_RESULT(r) ___result =  r\n\n#define CCHECK_MSG(_condition, _message)                             \\\n    CHECK_MSG_EX(_condition, _message, CRETURN_RESULT)\n\n#define CCHECK(_condition)                                           \\\n    CCHECK_MSG(_condition, \"\")\n\n#define CCHECK_MSGF(_condition, _args)                               \\\n    CCHECK_MSG(_condition, CHECK::FormatMessage _args)\n\n#define CCHECK_FAIL(_message)                                        \\\n    CCHECK_MSG(FALSE, _message); UNREACHABLE()\n\n#define CCHECK_FAILF(_args)                                          \\\n    CCHECK_MSGF(FALSE, _args); UNREACHABLE()\n\n#else // _DEBUG\n\n#define CCHECK_START\n#define CCHECK_END\n\n#define CCHECK          CHECK\n#define CCHECK_MSG      CHECK_MSG\n#define CCHECK_MSGF     CHECK_MSGF\n#define CCHECK_FAIL     CHECK_FAIL\n#define CCHECK_FAILF    CHECK_FAILF\n\n#endif\n\n\n\n//--------------------------------------------------------------------------------\n// Common base level checks\n//--------------------------------------------------------------------------------\n\nCHECK CheckAlignment(UINT alignment);\n\nCHECK CheckAligned(UINT value, UINT alignment);\n#if defined(_MSC_VER)\nCHECK CheckAligned(ULONG value, UINT alignment);\n#endif\nCHECK CheckAligned(UINT64 value, UINT alignment);\nCHECK CheckAligned(const void *address, UINT alignment);\n\nCHECK CheckOverflow(UINT value1, UINT value2);\n#if defined(_MSC_VER)\nCHECK CheckOverflow(ULONG value1, ULONG value2);\n#endif\nCHECK CheckOverflow(UINT64 value1, UINT64 value2);\nCHECK CheckOverflow(PTR_CVOID address, UINT offset);\n#if defined(_MSC_VER)\nCHECK CheckOverflow(const void *address, ULONG offset);\n#endif\nCHECK CheckOverflow(const void *address, UINT64 offset);\n\nCHECK CheckUnderflow(UINT value1, UINT value2);\n#if defined(_MSC_VER)\nCHECK CheckUnderflow(ULONG value1, ULONG value2);\n#endif\nCHECK CheckUnderflow(UINT64 value1, UINT64 value2);\nCHECK CheckUnderflow(const void *address, UINT offset);\n#if defined(_MSC_VER)\nCHECK CheckUnderflow(const void *address, ULONG offset);\n#endif\nCHECK CheckUnderflow(const void *address, UINT64 offset);\nCHECK CheckUnderflow(const void *address, void *address2);\n\nCHECK CheckZeroedMemory(const void *memory, SIZE_T size);\n\n// These include overflow checks\nCHECK CheckBounds(const void *rangeBase, UINT32 rangeSize, UINT32 offset);\nCHECK CheckBounds(const void *rangeBase, UINT32 rangeSize, UINT32 offset, UINT32 size);\n\nvoid WINAPI ReleaseCheckTls(LPVOID pTlsData);\n\n// ================================================================================\n// Inline definitions\n// ================================================================================\n\n#include \"check.inl\"\n\n#endif // CHECK_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/check.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef CHECK_INL_\n#define CHECK_INL_\n\n#include \"check.h\"\n#include \"clrhost.h\"\n#include \"debugmacros.h\"\n#include \"clrtypes.h\"\n\nFORCEINLINE BOOL CHECK::EnterAssert()\n{\n    if (s_neverEnforceAsserts)\n        return FALSE;\n\n#ifdef _DEBUG_IMPL\n    m_pCount = &t_count;\n\n    if (!*m_pCount)\n    {\n        *m_pCount = 1;\n        return TRUE;\n    }\n    else\n        return FALSE;\n#else\n    // Don't bother doing recursive checks on a free build, since checks should\n    // be extremely isolated\n    return TRUE;\n#endif\n}\n\nFORCEINLINE void CHECK::LeaveAssert()\n{\n#ifdef _DEBUG_IMPL\n    *m_pCount = 0;\n#endif\n}\n\nFORCEINLINE BOOL CHECK::IsInAssert()\n{\n#ifdef _DEBUG_IMPL\n    if (!m_pCount)\n        m_pCount = &t_count;\n\n    return *m_pCount;\n#else\n    return FALSE;\n#endif\n}\n\nFORCEINLINE BOOL CHECK::EnforceAssert()\n{\n    if (s_neverEnforceAsserts)\n        return FALSE;\n    else\n    {\n        CHECK chk;\n        return !chk.IsInAssert();\n    }\n}\n\nFORCEINLINE void CHECK::ResetAssert()\n{\n    CHECK chk;\n    if (chk.IsInAssert())\n        chk.LeaveAssert();\n}\n\ninline void CHECK::SetAssertEnforcement(BOOL value)\n{\n    s_neverEnforceAsserts = !value;\n}\n\n// Fail records the result of a condition check.  Can take either a\n// boolean value or another check result\nFORCEINLINE BOOL CHECK::Fail(BOOL condition)\n{\n#ifdef _DEBUG\n    if (!condition)\n    {\n        m_condition = NULL;\n        m_file = NULL;\n        m_line = 0;\n    }\n#endif\n    return !condition;\n}\n\nFORCEINLINE BOOL CHECK::Fail(const CHECK &check)\n{\n    m_message = check.m_message;\n#ifdef _DEBUG\n    if (m_message != NULL)\n    {\n        m_condition = check.m_condition;\n        m_file = check.m_file;\n        m_line = check.m_line;\n    }\n#endif\n    return m_message != NULL;\n}\n\n#ifndef _DEBUG\nFORCEINLINE void CHECK::Setup(LPCSTR message)\n{\n    m_message = message;\n}\n\nFORCEINLINE LPCSTR CHECK::FormatMessage(LPCSTR messageFormat, ...)\n{\n    return messageFormat;\n}\n#endif\n\nFORCEINLINE CHECK::operator BOOL ()\n{\n    return m_message == NULL;\n}\n\nFORCEINLINE BOOL CHECK::operator!()\n{\n    return m_message != NULL;\n}\n\ninline CHECK CheckAlignment(UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    CHECK((alignment & (alignment-1)) == 0);\n    CHECK_OK;\n}\n\ninline CHECK CheckAligned(UINT value, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    CHECK(AlignmentTrim(value, alignment) == 0);\n    CHECK_OK;\n}\n\n#ifndef HOST_UNIX\n// For Unix this and the previous function get the same types.\n// So, exclude this one.\ninline CHECK CheckAligned(ULONG value, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    CHECK(AlignmentTrim(value, alignment) == 0);\n    CHECK_OK;\n}\n#endif // HOST_UNIX\n\ninline CHECK CheckAligned(UINT64 value, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    CHECK(AlignmentTrim(value, alignment) == 0);\n    CHECK_OK;\n}\n\ninline CHECK CheckAligned(const void *address, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    CHECK(AlignmentTrim((SIZE_T)address, alignment) == 0);\n    CHECK_OK;\n}\n\ninline CHECK CheckOverflow(UINT value1, UINT value2)\n{\n    CHECK(value1 + value2 >= value1);\n    CHECK_OK;\n}\n\n#if defined(_MSC_VER)\ninline CHECK CheckOverflow(ULONG value1, ULONG value2)\n{\n    CHECK(value1 + value2 >= value1);\n    CHECK_OK;\n}\n#endif\n\ninline CHECK CheckOverflow(UINT64 value1, UINT64 value2)\n{\n    CHECK(value1 + value2 >= value1);\n    CHECK_OK;\n}\n\ninline CHECK CheckOverflow(PTR_CVOID address, UINT offset)\n{\n    TADDR targetAddr = dac_cast<TADDR>(address);\n#if POINTER_BITS == 32\n    CHECK((UINT) (SIZE_T)(targetAddr) + offset >= (UINT) (SIZE_T) (targetAddr));\n#else\n    CHECK((UINT64) targetAddr + offset >= (UINT64) targetAddr);\n#endif\n\n    CHECK_OK;\n}\n\n#if defined(_MSC_VER)\ninline CHECK CheckOverflow(const void *address, ULONG offset)\n{\n#if POINTER_BITS == 32\n    CHECK((ULONG) (SIZE_T) address + offset >= (ULONG) (SIZE_T) address);\n#else\n    CHECK((UINT64) address + offset >= (UINT64) address);\n#endif\n\n    CHECK_OK;\n}\n#endif\n\ninline CHECK CheckOverflow(const void *address, UINT64 offset)\n{\n#if POINTER_BITS == 32\n    CHECK(offset >> 32 == 0);\n    CHECK((UINT) (SIZE_T) address + (UINT) offset >= (UINT) (SIZE_T) address);\n#else\n    CHECK((UINT64) address + offset >= (UINT64) address);\n#endif\n\n    CHECK_OK;\n}\n\n#ifdef __APPLE__\ninline CHECK CheckOverflow(const void *address, SIZE_T offset)\n{\n    CHECK((UINT64) address + offset >= (UINT64) address);\n\n    CHECK_OK;\n}\n#endif // __APPLE__\n\ninline CHECK CheckUnderflow(UINT value1, UINT value2)\n{\n    CHECK(value1 - value2 <= value1);\n\n    CHECK_OK;\n}\n\n#ifndef HOST_UNIX\n// For Unix this and the previous function get the same types.\n// So, exclude this one.\ninline CHECK CheckUnderflow(ULONG value1, ULONG value2)\n{\n    CHECK(value1 - value2 <= value1);\n\n    CHECK_OK;\n}\n#endif // HOST_UNIX\n\ninline CHECK CheckUnderflow(UINT64 value1, UINT64 value2)\n{\n    CHECK(value1 - value2 <= value1);\n\n    CHECK_OK;\n}\n\ninline CHECK CheckUnderflow(const void *address, UINT offset)\n{\n#if POINTER_BITS == 32\n    CHECK((UINT) (SIZE_T) address - offset <= (UINT) (SIZE_T) address);\n#else\n    CHECK((UINT64) address - offset <= (UINT64) address);\n#endif\n\n    CHECK_OK;\n}\n\n#if defined(_MSC_VER)\ninline CHECK CheckUnderflow(const void *address, ULONG offset)\n{\n#if POINTER_BITS == 32\n    CHECK((ULONG) (SIZE_T) address - offset <= (ULONG) (SIZE_T) address);\n#else\n    CHECK((UINT64) address - offset <= (UINT64) address);\n#endif\n\n    CHECK_OK;\n}\n#endif\n\ninline CHECK CheckUnderflow(const void *address, UINT64 offset)\n{\n#if POINTER_BITS == 32\n    CHECK(offset >> 32 == 0);\n    CHECK((UINT) (SIZE_T) address - (UINT) offset <= (UINT) (SIZE_T) address);\n#else\n    CHECK((UINT64) address - offset <= (UINT64) address);\n#endif\n\n    CHECK_OK;\n}\n\ninline CHECK CheckUnderflow(const void *address, void *address2)\n{\n#if POINTER_BITS == 32\n    CHECK((UINT) (SIZE_T) address - (UINT) (SIZE_T) address2 <= (UINT) (SIZE_T) address);\n#else\n    CHECK((UINT64) address - (UINT64) address2 <= (UINT64) address);\n#endif\n\n    CHECK_OK;\n}\n\ninline CHECK CheckZeroedMemory(const void *memory, SIZE_T size)\n{\n    CHECK(CheckOverflow(memory, size));\n\n    BYTE *p = (BYTE *) memory;\n    BYTE *pEnd = p + size;\n\n    while (p < pEnd)\n        CHECK(*p++ == 0);\n\n    CHECK_OK;\n}\n\ninline CHECK CheckBounds(const void *rangeBase, UINT32 rangeSize, UINT32 offset)\n{\n    CHECK(CheckOverflow(dac_cast<PTR_CVOID>(rangeBase), rangeSize));\n    CHECK(offset <= rangeSize);\n    CHECK_OK;\n}\n\ninline CHECK CheckBounds(const void *rangeBase, UINT32 rangeSize, UINT32 offset, UINT32 size)\n{\n    CHECK(CheckOverflow(dac_cast<PTR_CVOID>(rangeBase), rangeSize));\n    CHECK(CheckOverflow(offset, size));\n    CHECK(offset + size <= rangeSize);\n    CHECK_OK;\n}\n\n#endif  // CHECK_INL_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr/fs/path.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n// This header provides general path-related file system services.\n\n#ifndef _clr_fs_Path_h_\n#define _clr_fs_Path_h_\n\n#include \"clrtypes.h\"\n\n#include \"strsafe.h\"\n\n#include \"clr/str.h\"\n\nnamespace clr\n{\n    namespace fs\n    {\n        class Path\n        {\n        public:\n            //-----------------------------------------------------------------------------------------\n            // Returns true if wzPath represents a relative path.\n            static inline bool\n            IsRelative(LPCWSTR wzPath)\n            {\n                _ASSERTE(wzPath != nullptr);\n\n                // Similar to System.IO.Path.IsRelative()\n#if TARGET_UNIX\n                if(wzPath[0] == VOLUME_SEPARATOR_CHAR_W)\n                {\n                    return false;\n                }\n#else\n                // Check for a paths like \"C:\\...\" or \"\\\\...\". Additional notes:\n                // - \"\\\\?\\...\" - long format paths are considered as absolute paths due to the \"\\\\\" prefix\n                // - \"\\...\" - these paths are relative, as they depend on the current drive\n                // - \"C:...\" and not \"C:\\...\" - these paths are relative, as they depend on the current directory for drive C\n                if (wzPath[0] != W('\\0') &&\n                    wzPath[1] == VOLUME_SEPARATOR_CHAR_W &&\n                    wzPath[2] == DIRECTORY_SEPARATOR_CHAR_W &&\n                    (\n                        (wzPath[0] >= W('A') && wzPath[0] <= W('Z')) ||\n                        (wzPath[0] >= W('a') && wzPath[0] <= W('z'))\n                    ))\n                {\n                    return false;\n                }\n                if (wzPath[0] == DIRECTORY_SEPARATOR_CHAR_W && wzPath[1] == DIRECTORY_SEPARATOR_CHAR_W)\n                {\n                    return false;\n                }\n#endif\n\n                return true;\n            }\n        };\n    }\n}\n\n#endif // _clr_fs_Path_h_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr/fs.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n// This header will include all headers relating to file system functionality.\n\n#ifndef _clr_fs_h_\n#define _clr_fs_h_\n\n#include \"fs/path.h\"\n\n#endif // _clr_fs_h_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr/stack.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n// This header provides a basic stack implementation\n\n#ifndef _clr_Stack_h_\n#define _clr_Stack_h_\n\nnamespace clr\n{\n    //-------------------------------------------------------------------------------------------------\n    // A basic stack class.\n    //\n    template < typename T >\n    class Stack\n    {\n    private:\n        //---------------------------------------------------------------------------------------------\n        struct Link\n        {\n            template < typename A1 >\n            Link(A1 && a1, Link * next = nullptr)\n                : _value(std::forward<A1>(a1))\n                , _next(next)\n            {}\n\n            T       _value;\n            Link *  _next;\n        };\n\n    public:\n        //---------------------------------------------------------------------------------------------\n        // Empty stack constructor.\n        Stack()\n            : _top(nullptr)\n            , _size(0)\n        {}\n\n        //---------------------------------------------------------------------------------------------\n        // Move constructor.\n        Stack(Stack && stack)\n            : _top(nullptr)\n            , _size(0)\n        { *this = std::move(stack); }\n\n        //---------------------------------------------------------------------------------------------\n        ~Stack()\n        {\n            while (!empty())\n            {\n                pop();\n            }\n        }\n\n        //---------------------------------------------------------------------------------------------\n        // Move assignment.\n        Stack& operator=(Stack && stack)\n        { std::swap(_top, stack._top); std::swap(_size, stack._size); }\n\n        //---------------------------------------------------------------------------------------------\n        bool empty() const\n        { return _top == nullptr; }\n\n        //---------------------------------------------------------------------------------------------\n        size_t size() const\n        { return _size; }\n\n        //---------------------------------------------------------------------------------------------\n        T & top()\n        { return _top->_value; }\n\n        //---------------------------------------------------------------------------------------------\n        T const & top() const\n        { return _top->_value; }\n\n        //---------------------------------------------------------------------------------------------\n        template < typename A1 > inline\n        void push(A1 && value)\n        {\n            STATIC_CONTRACT_THROWS;\n            _top = new Link(std::forward<A1>(value), _top);\n            ++_size;\n        }\n\n        //---------------------------------------------------------------------------------------------\n        void pop()\n        { Link * del = _top; _top = _top->_next; --_size; delete del; }\n\n    private:\n        //---------------------------------------------------------------------------------------------\n        Link * _top;\n        size_t _size;\n    };\n} // namespace clr\n\n#endif // _clr_Stack_h_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr/str.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n// This header provides general standard string services.\n//\n\n#ifndef _clr_str_h_\n#define _clr_str_h_\n\nnamespace clr\n{\n    namespace str\n    {\n        //-----------------------------------------------------------------------------------------\n        // Returns true if the provided string is a null pointer or the empty string.\n        static inline bool\n        IsNullOrEmpty(LPCWSTR wzStr)\n        {\n            return wzStr == nullptr || *wzStr == W('\\0');\n        }\n    }\n}\n\n#endif // _clr_str_h_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr/win32.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// clr/win32.h\n//\n// Provides Win32-specific utility functionality.\n//\n\n//\n\n#ifndef clr_win32_h\n#define clr_win32_h\n\n#include \"winwrap.h\"\n\nnamespace clr\n{\n    namespace win32\n    {\n        // Prevents an HMODULE from being unloaded until process termination.\n        inline\n        HRESULT PreventModuleUnload(HMODULE hMod)\n        {\n            if (!WszGetModuleHandleEx(\n                GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_PIN,\n                reinterpret_cast<LPCTSTR>(hMod),\n                &hMod))\n            {\n                return HRESULT_FROM_GetLastError();\n            }\n\n            return S_OK;\n        }\n    } // namespace win\n} // namespace clr\n\n#endif // clr_win32_h\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr_std/algorithm",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// clr_std/algorithm\n//\n// Copy of some key Standard Template Library functionality\n\n#ifdef _MSC_VER\n#pragma once\n#endif\n\n#ifdef USE_STL\n#include <algorithm>\n#else\n#ifndef __clr_std_algorithm_h__\n#define __clr_std_algorithm_h__\n\nnamespace std\n{\n    template<class iter, class CompareFunc>\n    iter find_if ( iter first, iter last, CompareFunc comp )\n    {\n        for ( ; first!=last ; first++ )\n            if ( comp(*first) )\n                break;\n        return first;\n    }\n\n    template<class iter, class T>\n    iter find(iter first, iter last, const T& val)\n    {\n        for (;first != last; first++)\n        {\n            if (*first == val)\n                break;\n        }\n        return first;\n    }\n\n    template <class iter, class comp>\n    iter qsort_partition( iter first, iter last, iter pivot, comp compare )\n    {\n        iter lastMinusOne = last - 1;\n        swap(pivot, lastMinusOne);\n\n        // Pivot is at end\n        pivot = last - 1;\n\n        iter partitionLoc = first;\n\n        for (iter partitionWalk = first; partitionWalk != pivot; ++partitionWalk)\n        {\n            if (compare(*partitionWalk, *pivot))\n            {\n                swap(*partitionWalk, *partitionLoc);\n                partitionLoc++;\n            }\n        }\n        swap(*pivot, *partitionLoc);\n\n        return partitionLoc;\n    }\n\n    template <class iter, class comp>\n    void sort_worker ( iter first, iter last, comp compare )\n    {\n        typename iter::difference_type RangeSize = last - first;\n\n        // When down to a list of size 1, be done\n        if (RangeSize < 2)\n            return;\n\n        // Pick pivot\n\n        // Use simple pick middle algorithm\n        iter pivotLoc = first + (RangeSize / 2);\n\n        // Partition\n        pivotLoc = qsort_partition(first, last, pivotLoc, compare);\n\n        // Sort first array\n        sort_worker(first, pivotLoc, compare);\n\n        // Sort second array\n        sort_worker(pivotLoc + 1, last, compare);\n    }\n\n    template <class iter, class comp>\n    void sort ( iter first, iter last, comp compare )\n    {\n        sort_worker(first, last, compare);\n        if (first != last)\n        {\n            for (iter i = first; i < (last - 1); i++)\n            {\n                // Assert that the sort function works.\n                assert(!compare(*(i+1), *i));\n            }\n        }\n    }\n\n    template<class InIter, class OutIter, class Fn1>\n    OutIter transform( InIter first, InIter last, OutIter dest, Fn1 func )\n    {\n        for ( ; first!=last ; ++first, ++dest )\n            *dest = func(*first);\n        return dest;\n    }\n\n} // namespace std\n\n#endif /* __clr_std_algorithm_h__ */\n\n#endif // !USE_STL\n\n// Help the VIM editor figure out what kind of file this no-extension file is.\n// vim: filetype=cpp\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr_std/string",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// clr_std/string\n//\n// Copy of some key Standard Template Library functionality\n//\n// This was created for use with SuperPMI. It has the minimal functionality needed by SuperPMI. It hasn't\n// been tested elsewhere.\n\n#ifdef _MSC_VER\n#pragma once\n#endif\n\n#ifdef USE_STL\n#include <string>\n#else\n#ifndef __clr_std_string_h__\n#define __clr_std_string_h__\n\n#include \"clr_std/vector\"\n\nnamespace std\n{\n\ntemplate<class T>\nclass basic_string\n{\npublic:\n    typedef T value_type;\n    typedef size_t size_type;\n    typedef typename vector<T>::iterator iterator;\n    typedef typename vector<T>::const_iterator const_iterator;\n\n    basic_string()\n        : m_string(1) // start with a string of length 1 for null terminator\n    {\n        m_string[0] = T();\n    }\n\n    basic_string(const basic_string<T>& _Right)\n    {\n        assign(_Right);\n    }\n\n    // Initialize a string with _Count characters from the string pointed at by _Ptr.\n    // If you want to include the trailing null character, _Count needs to include that.\n    basic_string(const value_type* _Ptr, size_type _Count)\n        : m_string(_Count + 1) // add 1 for a null terminator\n    {\n        copy(_Ptr, _Count);\n    }\n\n    basic_string(const value_type* _Ptr) : basic_string(_Ptr, c_len(_Ptr))\n    {\n    }\n\n    void reserve(size_t newcapacity)\n    {\n        m_string.reserve(newcapacity + 1); // add 1 for the null terminator\n    }\n\n    //\n    // Assignment\n    //\n\n    basic_string<T>& operator=(const basic_string<T>& _Right)\n    {\n        if (this != &_Right)\n        {\n            assign(_Right);\n        }\n        return (*this);\n    }\n\n    basic_string<T>& assign(const basic_string<T>& _Right)\n    {\n        m_string.resize(_Right.size() + 1); // +1 for null terminator\n        copy(_Right);\n        return (*this);\n    }\n\n    //\n    // Basic data copying\n    //\n\n    void copy(const basic_string<T>& _Right)\n    {\n        assert(size() >= _Right.size());\n        size_type i;\n        for (i = 0; i < _Right.size(); i++)\n        {\n            m_string[i] = _Right.m_string[i];\n        }\n        m_string[i] = T();\n    }\n\n    void copy(const value_type* _Ptr, size_type _Count)\n    {\n        assert(size() >= _Count);\n        size_type i;\n        for (i = 0; i < _Count; i++)\n        {\n            m_string[i] = _Ptr[i];\n        }\n        m_string[i] = T();\n    }\n\n    //\n    // Appending\n    //\n\n    // Append a C-style string to the string.\n    basic_string<T>& operator+=(const value_type* _Ptr)\n    {\n        size_type oldsize = size();         // doesn't include null terminator\n        size_type addsize = c_len(_Ptr);    // doesn't include null terminator\n        size_type newsize = oldsize + addsize + 1;\n        m_string.resize(newsize);\n        size_type i;\n        for (i = oldsize; i < newsize - 1; i++)\n        {\n            m_string[i] = *_Ptr++;\n        }\n        m_string[i] = T();\n        return (*this);\n    }\n\n    basic_string<T>& operator+=(const basic_string<T>& _Right)\n    {\n        size_type oldsize = size();         // doesn't include null terminator\n        size_type addsize = _Right.size();  // doesn't include null terminator\n        size_type newsize = oldsize + addsize + 1;\n        m_string.resize(newsize);\n        size_type new_index = oldsize, right_index = 0;\n        while (right_index < addsize)\n        {\n            m_string[new_index] = _Right.m_string[right_index];\n            ++new_index;\n            ++right_index;\n        }\n        m_string[new_index] = T();\n        return (*this);\n    }\n\n    basic_string<T>& operator+=(value_type _Ch)\n    {\n        size_type oldsize = size();         // doesn't include null terminator\n        m_string[oldsize] = _Ch; // Replace the null terminator with the new symbol.\n        m_string.push_back(T()); // Return the replaced terminator again.\n        return (*this);\n    }\n\n    ~basic_string()\n    {\n        // vector destructor does all the work\n    }\n\n    size_t size() const\n    {\n        assert(m_string.size() > 0);\n        return m_string.size() - 1;      // Don't report the null terminator.\n    }\n\n    size_t length() const\n    {\n        return size();\n    }\n\n    T& operator[](size_t iIndex)\n    {\n        assert(iIndex < size() + 1);    // allow looking at the null terminator\n        return m_string[iIndex];\n    }\n\n    const T* c_str() const\n    {\n        return m_string.data();\n    }\n\n    iterator begin()\n    {\n        return m_string.begin();\n    }\n\n    iterator end()\n    {\n        return m_string.end();\n    }\n\n    const_iterator cbegin() const\n    {\n        return m_string.cbegin();\n    }\n\n    const_iterator cend() const\n    {\n        return m_string.cend();\n    }\n\n    basic_string<T> substr(size_type _Off = 0, size_type _Count = npos) const\n    {\n        size_type cursize = size();\n        if (_Off >= cursize)\n        {\n            // result will be empty\n            return basic_string<T>();\n        }\n        else\n        {\n            if ((_Count == npos) ||     // No count specified; take the whole string suffix\n                (_Off + _Count > cursize)) // Count specified is too many characters; just take the whole suffix\n            {\n                _Count = cursize - _Off;\n            }\n            return basic_string<T>(m_string.data() + _Off, _Count);\n        }\n    }\n\n    size_type find_last_of(value_type _Ch) const\n    {\n        for (size_type _Off = size(); _Off != 0; _Off--)\n        {\n            if (m_string[_Off - 1] == _Ch)\n            {\n                return _Off - 1;\n            }\n        }\n        return npos;\n    }\n\n    bool empty() const\n    {\n        return size() == 0;\n    }\n\n    int compare(const basic_string<T>& _Str) const\n    {\n        size_type i;\n        size_type compareSize = size();\n        if (_Str.size() < compareSize)\n        {\n            // This string is longer; compare character-by-character only as many characters as we have.\n            compareSize = _Str.size();\n        }\n        for (i = 0; i < compareSize; i++)\n        {\n            if (m_string[i] != _Str.m_string[i])\n            {\n                if (m_string[i] < _Str.m_string[i])\n                {\n                    return -1;\n                }\n                else\n                {\n                    return 1;\n                }\n            }\n        }\n\n        // All the characters we compared were identical, but one string might be longer than the other.\n        if (size() == _Str.size())\n        {\n            // We compared everything.\n            return 0;\n        }\n        else if (size() < _Str.size())\n        {\n            // _Str has more characters than this.\n            return -1;\n        }\n        else\n        {\n            // this has more characters than _Str\n            return 1;\n        }\n    }\n\n    static const size_type npos = size_type(-1);\n\nprivate:\n\n    // Compute the length in characters of a null-terminated C-style string, not including the trailing null character.\n    // _Ptr must not be nullptr.\n    size_type c_len(const value_type* _Ptr)\n    {\n        size_type count;\n        for (count = 0; *_Ptr != T(); _Ptr++)\n        {\n            count++;\n        }\n        return count;\n    }\n\n    vector<T>   m_string;   // use a vector<> to represent the string, to avoid reimplementing similar functionality\n\n}; // class basic_string\n\n//\n// String class instantiations\n//\n\ntypedef basic_string<char> string;\n\n//\n// Numeric conversions\n//\n\n// convert integer T to string\ntemplate<class T> inline\nstring _IntToString(const char *_Fmt, T _Val)\n{\n    const size_t MaxIntBufSize = 21; /* can hold -2^63 and 2^64 - 1, plus NUL */\n\tchar buf[MaxIntBufSize];\n\tint len = sprintf_s(buf, MaxIntBufSize, _Fmt, _Val);\n\treturn (string(buf, len));\n}\n\ninline string to_string(int _Val)\n{\n\treturn (_IntToString(\"%d\", _Val));\n}\n\ninline string to_string(unsigned int _Val)\n{\n\treturn (_IntToString(\"%u\", _Val));\n}\n\ninline string to_string(long _Val)\n{\n\treturn (_IntToString(\"%ld\", _Val));\n}\n\ninline string to_string(unsigned long _Val)\n{\n\treturn (_IntToString(\"%lu\", _Val));\n}\n\ninline string to_string(long long _Val)\n{\n\treturn (_IntToString(\"%lld\", _Val));\n}\n\ninline string to_string(unsigned long long _Val)\n{\n\treturn (_IntToString(\"%llu\", _Val));\n}\n\n//\n// Comparisons\n//\n\ntemplate<class T> inline\nbool operator==(\n    const basic_string<T>& _Left,\n    const basic_string<T>& _Right)\n{\n    return (_Left.compare(_Right) == 0);\n}\n\ntemplate<class T> inline\nbool operator!=(\n    const basic_string<T>& _Left,\n    const basic_string<T>& _Right)\n{\n    return (!(_Left == _Right));\n}\n\ntemplate<class T> inline\nbool operator<(\n    const basic_string<T>& _Left,\n    const basic_string<T>& _Right)\n{\n    return (_Left.compare(_Right) < 0);\n}\n\ntemplate<class T> inline\nbool operator>(\n    const basic_string<T>& _Left,\n    const basic_string<T>& _Right)\n{\n    return (_Right < _Left);\n}\n\ntemplate<class T> inline\nbool operator<=(\n    const basic_string<T>& _Left,\n    const basic_string<T>& _Right)\n{\n    return (!(_Right < _Left));\n}\n\ntemplate<class T> inline\nbool operator>=(\n    const basic_string<T>& _Left,\n    const basic_string<T>& _Right)\n{\n    return (!(_Left < _Right));\n}\n\n//\n// String concatenation and other string operations\n//\n\ntemplate<class T> inline\nbasic_string<T> operator+(\n    const basic_string<T>& _Left,\n    const basic_string<T>& _Right)\n{\n    basic_string<T> ret;\n    ret.reserve(_Left.size() + _Right.size());\n    ret += _Left;\n    ret += _Right;\n    return ret;\n}\n\n}; // namespace std\n\n#endif /* __clr_std_string_h__ */\n\n#endif // !USE_STL\n\n// Help the VIM editor figure out what kind of file this no-extension file is.\n// vim: filetype=cpp\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr_std/type_traits",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// clr_std/utility\n//\n// Copy of some key Standard Template Library functionality.\n// See http://msdn.microsoft.com/en-us/library/bb982077.aspx for documentation.\n//\n\n#ifdef _MSC_VER\n#pragma once\n#endif\n\n#ifndef __clr_std_type_traits_h__\n#define __clr_std_type_traits_h__\n\n#ifdef USE_STL\n\n#include <type_traits>\n\n#else\n\nnamespace std\n{\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS remove_const\n    template<class _Ty>\n    struct remove_const\n    {   // remove top level const qualifier\n        typedef _Ty type;\n    };\n\n    template<class _Ty>\n    struct remove_const<const _Ty>\n    {   // remove top level const qualifier\n        typedef _Ty type;\n    };\n\n    template<class _Ty>\n    struct remove_const<const _Ty[]>\n    {   // remove top level const qualifier\n        typedef _Ty type[];\n    };\n\n    template<class _Ty, unsigned int _Nx>\n    struct remove_const<const _Ty[_Nx]>\n    {   // remove top level const qualifier\n        typedef _Ty type[_Nx];\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS remove_volatile\n    template<class _Ty>\n    struct remove_volatile\n    {   // remove top level volatile qualifier\n        typedef _Ty type;\n    };\n\n    template<class _Ty>\n    struct remove_volatile<volatile _Ty>\n    {   // remove top level volatile qualifier\n        typedef _Ty type;\n    };\n\n    template<class _Ty>\n    struct remove_volatile<volatile _Ty[]>\n    {   // remove top level volatile qualifier\n        typedef _Ty type[];\n    };\n\n    template<class _Ty, unsigned int _Nx>\n    struct remove_volatile<volatile _Ty[_Nx]>\n    {   // remove top level volatile qualifier\n        typedef _Ty type[_Nx];\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS remove_cv\n    template<class _Ty>\n    struct remove_cv\n    {   // remove top level const and volatile qualifiers\n        typedef typename remove_const<typename remove_volatile<_Ty>::type>::type type;\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE remove_reference\n    template<class T>\n    struct remove_reference\n    {   // remove reference\n        typedef T type;\n    };\n\n    template<class T>\n    struct remove_reference<T&>\n    {   // remove reference\n        typedef T type;\n    };\n\n    template<class T>\n    struct remove_reference<T&&>\n    {   // remove rvalue reference\n        typedef T type;\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE remove_pointer\n    template<class T>\n    struct remove_pointer\n    {   // remove pointer\n        typedef T type;\n    };\n\n    template<class T>\n    struct remove_pointer<T*>\n    {   // remove pointer\n        typedef T type;\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE FUNCTION identity\n    template<class T>\n    struct identity\n    {   // map T to type unchanged\n        typedef T type;\n\n        inline\n        const T& operator()(const T& left) const\n        {   // apply identity operator to operand\n            return (left);\n        }\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS integral_constant\n    template<class _Ty, _Ty _Val>\n    struct integral_constant\n    {   // convenient template for integral constant types\n        static const _Ty value = _Val;\n\n        typedef _Ty value_type;\n        typedef integral_constant<_Ty, _Val> type;\n    };\n\n    typedef integral_constant<bool, true> true_type;\n    typedef integral_constant<bool, false> false_type;\n\n    // TEMPLATE CLASS _Cat_base\n    template<bool>\n    struct _Cat_base\n        : false_type\n    {    // base class for type predicates\n    };\n\n    template<>\n    struct _Cat_base<true>\n        : true_type\n    {    // base class for type predicates\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS enable_if\n    template<bool _Test, class _Type = void>\n    struct enable_if\n    {   // type is undefined for assumed !_Test\n    };\n\n    template<class _Type>\n    struct enable_if<true, _Type>\n    {   // type is _Type for _Test\n        typedef _Type type;\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS conditional\n    template<bool _Test, class _Ty1, class _Ty2>\n    struct conditional\n    {   // type is _Ty2 for assumed !_Test\n        typedef _Ty2 type;\n    };\n\n    template<class _Ty1, class _Ty2>\n    struct conditional<true, _Ty1, _Ty2>\n    {   // type is _Ty1 for _Test\n        typedef _Ty1 type;\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS make_unsigned\n    template<typename Type1>\n    struct make_unsigned\n    {\n    };\n\n    template<>\n    struct make_unsigned<int>\n    {\n        typedef unsigned int type;\n    };\n\n#ifndef HOST_UNIX\n\n    template<>\n    struct make_unsigned<long>\n    {\n        typedef unsigned long type;\n    };\n\n#endif // !HOST_UNIX\n\n    template<>\n    struct make_unsigned<__int64>\n    {\n        typedef unsigned __int64 type;\n    };\n\n    template<>\n    struct make_unsigned<size_t>\n    {\n        typedef size_t type;\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS make_signed\n    template<typename Type1>\n    struct make_signed\n    {\n    };\n\n    template<>\n    struct make_signed<unsigned int>\n    {\n        typedef signed int type;\n    };\n\n#ifndef HOST_UNIX\n\n    template<>\n    struct make_signed<unsigned long>\n    {\n        typedef signed long type;\n    };\n\n#endif // !HOST_UNIX\n\n    template<>\n    struct make_signed<unsigned __int64>\n    {\n        typedef signed __int64 type;\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS is_lvalue_reference\n    template<class _Ty>\n    struct is_lvalue_reference\n        : false_type\n    {   // determine whether _Ty is an lvalue reference\n    };\n\n    template<class _Ty>\n    struct is_lvalue_reference<_Ty&>\n        : true_type\n    {   // determine whether _Ty is an lvalue reference\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS is_rvalue_reference\n    template<class _Ty>\n    struct is_rvalue_reference\n        : false_type\n    {   // determine whether _Ty is an rvalue reference\n    };\n\n    template<class _Ty>\n    struct is_rvalue_reference<_Ty&&>\n        : true_type\n    {   // determine whether _Ty is an rvalue reference\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS is_reference\n    template<class _Ty>\n    struct is_reference\n        : conditional<\n            is_lvalue_reference<_Ty>::value || is_rvalue_reference<_Ty>::value,\n            true_type,\n            false_type>::type\n    {   // determine whether _Ty is a reference\n    };\n\n    // TEMPLATE CLASS is_pointer\n    template<class _Ty>\n    struct is_pointer\n        : false_type\n    {   // determine whether _Ty is a pointer\n    };\n\n    template<class _Ty>\n    struct is_pointer<_Ty *>\n        : true_type\n    {   // determine whether _Ty is a pointer\n    };\n\n    // TEMPLATE CLASS _Is_integral\n    template<class _Ty>\n    struct _Is_integral\n        : false_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<bool>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<char>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<unsigned char>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<signed char>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<unsigned short>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<signed short>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<unsigned int>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<signed int>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n// On Unix 'long' is a 64-bit type (same as __int64) and the following two definitions\n// conflict with _Is_integral<unsigned __int64> and _Is_integral<signed __int64>.\n#ifndef HOST_UNIX\n    template<>\n    struct _Is_integral<unsigned long>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<signed long>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n#endif /* HOST_UNIX */\n\n #if _HAS_CHAR16_T_LANGUAGE_SUPPORT\n    template<>\n    struct _Is_integral<char16_t>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<char32_t>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n #endif /* _HAS_CHAR16_T_LANGUAGE_SUPPORT */\n\n    template<>\n    struct _Is_integral<unsigned __int64>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    template<>\n    struct _Is_integral<signed __int64>\n        : true_type\n    {    // determine whether _Ty is integral\n    };\n\n    // TEMPLATE CLASS is_integral\n    template<class _Ty>\n    struct is_integral\n        : _Is_integral<typename remove_cv<_Ty>::type>\n    {    // determine whether _Ty is integral\n    };\n\n    // TEMPLATE CLASS _Is_floating_point\n    template<class _Ty>\n    struct _Is_floating_point\n        : false_type\n    {    // determine whether _Ty is floating point\n    };\n\n    template<>\n    struct _Is_floating_point<float>\n        : true_type\n    {    // determine whether _Ty is floating point\n    };\n\n    template<>\n    struct _Is_floating_point<double>\n        : true_type\n    {    // determine whether _Ty is floating point\n    };\n\n// In PAL, we define long as int and so this becomes int double,\n// which is a nonsense\n#ifndef HOST_UNIX\n    template<>\n    struct _Is_floating_point<long double>\n        : true_type\n    {    // determine whether _Ty is floating point\n    };\n#endif\n\n    // TEMPLATE CLASS is_floating_point\n    template<class _Ty>\n    struct is_floating_point\n        : _Is_floating_point<typename remove_cv<_Ty>::type>\n    {    // determine whether _Ty is floating point\n    };\n\n    // TEMPLATE CLASS is_arithmetic\n    template<class _Ty>\n    struct is_arithmetic\n    : _Cat_base<is_integral<_Ty>::value\n        || is_floating_point<_Ty>::value>\n    {    // determine whether _Ty is an arithmetic type\n    };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS is_signed\n    template <typename T>\n    struct is_signed : conditional<\n        static_cast<typename remove_const<T>::type>(-1) < 0, true_type, false_type>::type {};\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS is_same\n    template<class T1, class T2>\n    struct is_same : false_type { };\n\n    //-----------------------------------------------------------------------------------------\n    template<class T1>\n    struct is_same<T1, T1> : true_type { };\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE CLASS is_base_of\n#ifdef _MSC_VER\n\n    template <typename TBase, typename TDerived>\n    struct is_base_of :\n        conditional<__is_base_of( TBase, TDerived), true_type, false_type>::type {};\n\n#else\n    namespace detail\n    {\n        //-------------------------------------------------------------------------------------\n        // Helper types Small and Big - guarantee that sizeof(Small) < sizeof(Big)\n        //\n\n        template <class T, class U>\n        struct conversion_helper\n        {\n            typedef char Small;\n            struct Big { char dummy[2]; };\n            static Big   Test(...);\n            static Small Test(U);\n            static T MakeT();\n        };\n\n        //-------------------------------------------------------------------------------------\n        // class template conversion\n        // Figures out the conversion relationships between two types\n        // Invocations (T and U are types):\n        // a) conversion<T, U>::exists\n        // returns (at compile time) true if there is an implicit conversion from T\n        // to U (example: Derived to Base)\n        // b) conversion<T, U>::exists2Way\n        // returns (at compile time) true if there are both conversions from T\n        // to U and from U to T (example: int to char and back)\n        // c) conversion<T, U>::sameType\n        // returns (at compile time) true if T and U represent the same type\n        //\n        // NOTE: might not work if T and U are in a private inheritance hierarchy.\n        //\n\n        template <class T, class U>\n        struct conversion\n        {\n            typedef detail::conversion_helper<T, U> H;\n            static const bool exists = sizeof(typename H::Small) == sizeof((H::Test(H::MakeT())));\n            static const bool exists2Way = exists && conversion<U, T>::exists;\n            static const bool sameType = false;\n        };\n\n        template <class T>\n        struct conversion<T, T>\n        {\n            static const bool exists = true;\n            static const bool exists2Way = true;\n            static const bool sameType = true;\n        };\n\n        template <class T>\n        struct conversion<void, T>\n        {\n            static const bool exists = false;\n            static const bool exists2Way = false;\n            static const bool sameType = false;\n        };\n\n        template <class T>\n        struct conversion<T, void>\n        {\n            static const bool exists = false;\n            static const bool exists2Way = false;\n            static const bool sameType = false;\n        };\n\n        template <>\n        struct conversion<void, void>\n        {\n            static const bool exists = true;\n            static const bool exists2Way = true;\n            static const bool sameType = true;\n        };\n    } // detail\n\n    // Note that we need to compare pointer types here, since conversion of types by-value\n    // just tells us whether or not an implicit conversion constructor exists. We handle\n    // type parameters that are already pointers specially; see below.\n    template <typename TBase, typename TDerived>\n    struct is_base_of :\n        conditional<detail::conversion<TDerived *, TBase *>::exists, true_type, false_type>::type {};\n\n    // Specialization to handle type parameters that are already pointers.\n    template <typename TBase, typename TDerived>\n    struct is_base_of<TBase *, TDerived *> :\n        conditional<detail::conversion<TDerived *, TBase *>::exists, true_type, false_type>::type {};\n\n    // Specialization to handle invalid mixing of pointer types.\n    template <typename TBase, typename TDerived>\n    struct is_base_of<TBase *, TDerived> :\n        false_type {};\n\n    // Specialization to handle invalid mixing of pointer types.\n    template <typename TBase, typename TDerived>\n    struct is_base_of<TBase, TDerived *> :\n        false_type {};\n\n#endif\n\n    namespace detail\n    {\n        template <typename...>\n        using void_t = void;\n    }\n    // Always false dependent-value for static_asserts.\n    template <typename...>\n    struct _Always_false\n    {\n        const bool value = false;\n    };\n\n    template <class _Ty, class = void>\n    struct _Add_reference { // add reference (non-referenceable type)\n        using _Lvalue = _Ty;\n        using _Rvalue = _Ty;\n    };\n\n    template <class _Ty>\n    struct _Add_reference<_Ty, detail::void_t<_Ty&>> { // (referenceable type)\n        using _Lvalue = _Ty&;\n        using _Rvalue = _Ty&&;\n    };\n\n    template <class _Ty>\n    struct add_lvalue_reference {\n        using type = typename _Add_reference<_Ty>::_Lvalue;\n    };\n\n    template <class _Ty>\n    struct add_rvalue_reference {\n        using type = typename _Add_reference<_Ty>::_Rvalue;\n    };\n\n    template<typename _Ty>\n    typename add_rvalue_reference<_Ty>::type declval() noexcept\n    {\n        static_assert(_Always_false<_Ty>::value, \"Calling declval is ill-formed, see N4892 [declval]/2.\");\n    }\n} // namespace std\n\n#endif // !USE_STL\n\n#define REM_CONST(T)    typename std::remove_const< T >::type\n#define REM_CV(T)       typename std::remove_cv< T >::type\n#define REM_REF(T)      typename std::remove_reference< T >::type\n\n#define REF_T(T)        REM_REF(T) &\n#define REF_CT(T)       REM_REF(REM_CONST(T)) const &\n\n#endif // __clr_std_type_traits_h__\n\n// Help the VIM editor figure out what kind of file this no-extension file is.\n// vim: filetype=cpp\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr_std/utility",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// clr_std/utility\n//\n// Copy of some key Standard Template Library functionality\n// See http://msdn.microsoft.com/en-us/library/bb982077.aspx for documentation.\n//\n\n#ifdef _MSC_VER\n#pragma once\n#endif\n\n#ifdef USE_STL\n#include <utility>\n#else\n#ifndef __clr_std_utility_h__\n#define __clr_std_utility_h__\n\n#include \"clr_std/type_traits\"\n\nnamespace std\n{\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE FUNCTION move\n    template<class T> inline\n    typename remove_reference<T>::type&&\n    move(T&& arg)\n    {   // forward _Arg as movable\n        return ((typename remove_reference<T>::type&&)arg);\n    }\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE FUNCTION swap (from <algorithm>)\n    template<class T> inline\n    void swap(T& left, T& right)\n    {   // exchange values stored at left and right\n        T tmp = std::move(left);\n        left = std::move(right);\n        right = std::move(tmp);\n    }\n\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE FUNCTION forward\n    template<class T> inline\n    T&&\n    forward(typename identity<T>::type& _Arg)\n    {   // forward _Arg, given explicitly specified type parameter\n        return ((T&&)_Arg);\n    }\n}\n\nnamespace std\n{\n    //-----------------------------------------------------------------------------------------\n    // TEMPLATE STRUCT pair\n    template<class _Ty1, class _Ty2>\n    struct pair\n    {   // store a pair of values\n        typedef pair<_Ty1, _Ty2> _Myt;\n        typedef _Ty1 first_type;\n        typedef _Ty2 second_type;\n\n        pair()\n            : first(_Ty1()), second(_Ty2())\n        {   // construct from defaults\n        }\n\n        pair(const _Ty1& _Val1, const _Ty2& _Val2)\n            : first(_Val1.first), second(_Val2.second)\n        {   // construct from specified values\n        }\n\n        template<class _Other1, class _Other2>\n        pair(pair<_Other1, _Other2>& _Right)\n            : first(_Right.first), second(_Right.second)\n        {   // construct from compatible pair\n        }\n\n        template<class _Other1, class _Other2>\n        pair(const pair<_Other1, _Other2>& _Right)\n            : first(_Right.first), second(_Right.second)\n        {   // construct from compatible pair\n        }\n\n        void swap(_Myt& _Right)\n        {   // exchange contents with _Right\n            if (this != &_Right)\n            {   // different, worth swapping\n                swap(this->first, _Right.first);\n                swap(this->second, _Right.second);\n            }\n        }\n\n        _Myt& operator=(const _Myt& _Right)\n        {   // assign from copied pair\n            this->first = _Right.first;\n            this->second = _Right.second;\n            return (*this);\n        }\n\n        typedef typename remove_reference<_Ty1>::type _Ty1x;\n        typedef typename remove_reference<_Ty2>::type _Ty2x;\n\n        pair(_Ty1x&& _Val1, _Ty2x&& _Val2)\n            : first(std::move(_Val1)),\n              second(std::move(_Val2))\n        {   // construct from specified values\n        }\n\n        pair(const _Ty1x& _Val1, _Ty2x&& _Val2)\n            : first(_Val1),\n              second(std::move(_Val2))\n        {   // construct from specified values\n        }\n\n        pair(_Ty1x&& _Val1, const _Ty2x& _Val2)\n            : first(std::move(_Val1)),\n              second(_Val2)\n        {   // construct from specified values\n        }\n\n        template<class _Other1, class _Other2>\n        pair(_Other1&& _Val1, _Other2&& _Val2)\n            : first(std::move(_Val1)),\n              second(std::move(_Val2))\n        {   // construct from moved values\n        }\n\n        template<class _Other1, class _Other2>\n        pair(pair<_Other1, _Other2>&& _Right)\n            : first(std::move(_Right.first)),\n              second(std::move(_Right.second))\n        {   // construct from moved compatible pair\n        }\n\n        pair& operator=(pair<_Ty1, _Ty2>&& _Right)\n        {   // assign from moved pair\n            this->first = std::move(_Right.first);\n            this->second = std::move(_Right.second);\n            return (*this);\n        }\n\n        void swap(_Myt&& _Right)\n        {   // exchange contents with _Right\n            if (this != &_Right)\n            {   // different, worth swapping\n                this->first = std::move(_Right.first);\n                this->second = std::move(_Right.second);\n            }\n        }\n\n        _Ty1 first;     // the first stored value\n        _Ty2 second;    // the second stored value\n    }; // struct pair\n\n    //-----------------------------------------------------------------------------------------\n    // pair TEMPLATE FUNCTIONS\n\n    template<class _Ty1, class _Ty2> inline\n    void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>& _Right)\n    {   // swap _Left and _Right pairs\n        _Left.swap(_Right);\n    }\n\n    template<class _Ty1, class _Ty2> inline\n    void swap(pair<_Ty1, _Ty2>& _Left, pair<_Ty1, _Ty2>&& _Right)\n    {   // swap _Left and _Right pairs\n        typedef pair<_Ty1, _Ty2> _Myt;\n        _Left.swap(std::forward<_Myt>(_Right));\n    }\n\n    template<class _Ty1, class _Ty2> inline\n    void swap(\n        pair<_Ty1, _Ty2>&& _Left,\n        pair<_Ty1, _Ty2>& _Right)\n    {   // swap _Left and _Right pairs\n        typedef pair<_Ty1, _Ty2> _Myt;\n        _Right.swap(std::forward<_Myt>(_Left));\n    }\n\n    template<class _Ty1, class _Ty2> inline\n    bool operator==(\n        const pair<_Ty1, _Ty2>& _Left,\n        const pair<_Ty1, _Ty2>& _Right)\n    {   // test for pair equality\n        return (_Left.first == _Right.first && _Left.second == _Right.second);\n    }\n\n    template<class _Ty1, class _Ty2> inline\n        bool operator!=(\n            const pair<_Ty1, _Ty2>& _Left,\n            const pair<_Ty1, _Ty2>& _Right)\n    {   // test for pair inequality\n        return (!(_Left == _Right));\n    }\n\n    template<class _Ty1, class _Ty2> inline\n    bool operator<(\n        const pair<_Ty1, _Ty2>& _Left,\n        const pair<_Ty1, _Ty2>& _Right)\n    {   // test if _Left < _Right for pairs\n        return (_Left.first < _Right.first ||\n            (!(_Right.first < _Left.first) && _Left.second < _Right.second));\n    }\n\n    template<class _Ty1, class _Ty2> inline\n        bool operator>(\n            const pair<_Ty1, _Ty2>& _Left,\n            const pair<_Ty1, _Ty2>& _Right)\n    {   // test if _Left > _Right for pairs\n        return (_Right < _Left);\n    }\n\n    template<class _Ty1, class _Ty2> inline\n    bool operator<=(\n        const pair<_Ty1, _Ty2>& _Left,\n        const pair<_Ty1, _Ty2>& _Right)\n    {   // test if _Left <= _Right for pairs\n        return (!(_Right < _Left));\n    }\n\n    template<class _Ty1, class _Ty2> inline\n    bool operator>=(\n        const pair<_Ty1, _Ty2>& _Left,\n        const pair<_Ty1, _Ty2>& _Right)\n    {   // test if _Left >= _Right for pairs\n        return (!(_Left < _Right));\n    }\n\n    template<class _InIt> inline\n    _InIt begin(\n        const pair<_InIt, _InIt>& _Pair)\n    {   // return first element of pair\n        return (_Pair.first);\n    }\n\n    template<class _InIt> inline\n    _InIt end(\n        const pair<_InIt, _InIt>& _Pair)\n    {   // return second element of pair\n        return (_Pair.second);\n    }\n\n} // namespace std\n\n#endif /* __clr_std_utility_h__ */\n\n#endif // !USE_STL\n\n// Help the VIM editor figure out what kind of file this no-extension file is.\n// vim: filetype=cpp\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clr_std/vector",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// clr_std/vector\n//\n// Copy of some key Standard Template Library functionality\n//\n\n#ifdef _MSC_VER\n#pragma once\n#endif\n\n#ifdef USE_STL\n#include <vector>\n#else\n#ifndef __clr_std_vector_h__\n#define __clr_std_vector_h__\n\n// This is defined in the debugmacrosext.h header, but don't take a dependency on that.\n#ifndef INDEBUG\n#ifdef _DEBUG\n#define INDEBUG(x)          x\n#else\n#define INDEBUG(x)\n#endif\n#endif // !def INDEBUG\n\nnamespace std\n{\n    template <class T>\n    class vector\n    {\n        public:\n            class const_iterator;\n\n            class iterator\n            {\n                friend class std::vector<T>::const_iterator;\n            public:\n                typedef T         value_type;\n                typedef ptrdiff_t difference_type;\n                typedef T*        pointer;\n                typedef T&        reference;\n\n                typedef class vector<T>::iterator _MyIter;\n\n                _MyIter &operator++()\n                {\n                    m_ptr++;\n                    return *this;\n                }\n\n                _MyIter operator++(int)\n                {\n                    // post-increment ++\n                    _MyIter myiter(m_ptr);\n                    m_ptr++;\n                    return myiter;\n                }\n\n                _MyIter &operator--()\n                {\n                    m_ptr--;\n                    return *this;\n                }\n\n                _MyIter operator--(int)\n                {\n                    // post-decrement --\n                    _MyIter myiter(m_ptr);\n                    m_ptr--;\n                    return myiter;\n                }\n\n                _MyIter operator- (ptrdiff_t n)\n                {\n                    _MyIter myiter(m_ptr);\n                    myiter.m_ptr -= n;\n                    return myiter;\n                }\n\n                ptrdiff_t operator- (_MyIter right)\n                {\n                    _MyIter myiter(m_ptr);\n                    return myiter.m_ptr - right.m_ptr;\n                }\n\n                _MyIter operator+ (ptrdiff_t n)\n                {\n                    _MyIter myiter(m_ptr);\n                    myiter.m_ptr += n;\n                    return myiter;\n                }\n\n                T* operator->() const\n                {\n                    return m_ptr;\n                }\n\n                T & operator*() const\n                {\n                    return *m_ptr;\n                }\n\n                bool operator==(const _MyIter& _Right) const\n                {\n                    bool equals = this->m_ptr == _Right.m_ptr;\n                    return equals;\n                }\n\n                bool operator!=(const _MyIter& _Right) const\n                {\n                    bool equals = this->m_ptr == _Right.m_ptr;\n                    return !equals;\n                }\n\n                bool operator<(const _MyIter& _Right) const\n                {\n                    return this->m_ptr < _Right.m_ptr;\n                }\n\n                bool operator>(const _MyIter& _Right) const\n                {\n                    return this->m_ptr > _Right.m_ptr;\n                }\n            public:\n                explicit iterator(T* ptr)\n                {\n                    m_ptr = ptr;\n                }\n\n                private:\n                    T* m_ptr;\n            }; // class iterator\n\n            class const_iterator\n            {\n            public:\n                typedef class vector<T>::const_iterator _MyIter;\n                typedef class vector<T>::iterator _MyNonConstIter;\n\n                _MyIter &operator++()\n                {\n                    m_ptr++;\n                    return *this;\n                }\n\n                _MyIter operator++(int)\n                {\n                    // post-increment ++\n                    _MyIter myiter(m_ptr);\n                    m_ptr++;\n                    return myiter;\n                }\n\n                const T* operator->() const\n                {\n                    return m_ptr;\n                }\n\n                const T & operator*() const\n                {\n                    return *m_ptr;\n                }\n\n                bool operator==(const _MyIter& _Right) const\n                {\n                    bool equals = this->m_ptr == _Right.m_ptr;\n                    return equals;\n                }\n\n                bool operator!=(const _MyIter& _Right) const\n                {\n                    bool equals = this->m_ptr == _Right.m_ptr;\n                    return !equals;\n                }\n\n            public:\n                explicit const_iterator(T* ptr)\n                {\n                    m_ptr = ptr;\n                }\n                const_iterator(const _MyNonConstIter &nonConstIterator)\n                {\n                    m_ptr = nonConstIterator.m_ptr;\n                }\n\n            private:\n                T* m_ptr;\n            }; // class const iterator\n\n\n        public:\n            explicit vector(size_t n = 0)\n            {\n                m_size = 0;\n                m_capacity = 0;\n                m_pelements = NULL;\n                m_isBufferOwner = true;\n                resize(n);\n            }\n\n            ~vector()\n            {\n                if (m_isBufferOwner)\n                {\n                    erase(m_pelements, 0, m_size);\n                    delete [] (BYTE*)m_pelements; // cast to BYTE* as we don't want this delete to invoke T's dtor\n                }\n                else\n                {\n                    m_size = 0;\n                    m_capacity = 0;\n                }\n            }\n\n            vector(const vector<T>&) = delete;\n            vector<T>& operator=(const vector<T>&) = delete;\n\n            vector(vector<T>&& v) noexcept\n                : m_size(v.m_size)\n                , m_capacity(v.m_capacity)\n                , m_pelements(v.m_pelements)\n                , m_isBufferOwner(v.m_isBufferOwner)\n            {\n                v.m_isBufferOwner = false;\n            }\n\n            vector<T>& operator=(vector<T>&& v) noexcept\n            {\n                if (m_isBufferOwner)\n                {\n                    erase(m_pelements, 0, m_size);\n                    delete [] (BYTE*)m_pelements;\n                }\n\n                m_size = v.m_size;\n                m_capacity = v.m_capacity;\n                m_pelements = v.m_pelements;\n                m_isBufferOwner = v.m_isBufferOwner;\n                v.m_isBufferOwner = false;\n                return *this;\n            }\n\n            size_t size() const\n            {\n                return m_size;\n            }\n\n            T & operator[](size_t iIndex)\n            {\n                assert(iIndex < m_size);\n                return m_pelements[iIndex];\n            }\n\n            T & operator[](size_t iIndex) const\n            {\n                assert(iIndex < m_size);\n                return m_pelements[iIndex];\n            }\n\n            void resize(size_t newsize)\n            {\n                assert(m_isBufferOwner);\n                size_t oldsize = this->size();\n                resize_noinit(newsize);\n                if (newsize > oldsize)\n                {\n                    fill_uninitialized_with_default_value(m_pelements, oldsize, newsize);\n                }\n            }\n\n            void clear()\n            {\n                assert(m_isBufferOwner);\n                resize(0);\n            }\n\n            void resize(size_t newsize, T c)\n            {\n                assert(m_isBufferOwner);\n                size_t oldsize = this->size();\n                resize_noinit(newsize);\n                if (newsize > oldsize)\n                {\n                    for (size_t i = oldsize; i < newsize; i++)\n                    {\n                        m_pelements[i] = c;\n                    }\n                }\n            }\n\n            void wrap(size_t numElements, T* pElements)\n            {\n                m_size = numElements;\n                m_pelements = pElements;\n                m_isBufferOwner = false;\n            }\n\n            void resize_noinit(size_t newsize)\n            {\n                assert(m_isBufferOwner);\n                size_t oldsize = this->size();\n                if (newsize < oldsize)\n                {\n                    // Shrink\n                    erase(m_pelements, newsize, oldsize);\n                }\n                else if (newsize > oldsize)\n                {\n                    // Grow\n                    reserve(newsize);\n                }\n                m_size = newsize;\n            }\n\n            void push_back(const T & val)\n            {\n                assert(m_isBufferOwner);\n                if (m_size + 1 < m_size)\n                {\n                    assert(\"push_back: overflow\");\n                    // @todo: how to throw.\n                }\n                resize(m_size + 1, val);\n            }\n\n            void reserve(size_t newcapacity)\n            {\n                assert(m_isBufferOwner);\n                if (newcapacity > m_capacity)\n                {\n                    // To avoid resizing for every element that gets added to a vector, we\n                    // allocate at least twice the old capacity, or 16 elements, whichever is greater.\n                    newcapacity = max(newcapacity, max(m_capacity * 2, 16));\n\n                    size_t bytesNeeded = newcapacity * sizeof(T);\n                    if (bytesNeeded / sizeof(T) != newcapacity)\n                    {\n                        assert(\"resize: overflow\");\n                        // @todo: how to throw something here?\n                    }\n\n\n                    T *pelements = (T*)(new BYTE[bytesNeeded]);  // Allocate as BYTE array to avoid automatic construction\n                    INDEBUG(memset(pelements, 0xcc, bytesNeeded));\n                    for (size_t i = 0; i < m_size; i++)\n                    {\n                        pelements[i] = m_pelements[i];\n                    }\n\n                    erase(m_pelements, 0, m_size);\n                    delete [] (BYTE*)m_pelements; // cast to BYTE* as we don't want this delete to invoke T's dtor\n\n                    m_pelements = pelements;\n                    m_capacity = newcapacity;\n                }\n            }\n\n            iterator begin()\n            {\n                return iterator(m_pelements);\n            }\n\n            iterator end()\n            {\n                return iterator(m_pelements + m_size);\n            }\n\n            const_iterator cbegin() const\n            {\n                return const_iterator(m_pelements);\n            }\n\n            const_iterator cend() const\n            {\n                return const_iterator(m_pelements + m_size);\n            }\n\n            iterator erase(iterator position)\n            {\n                assert(m_isBufferOwner);\n                assert((position > begin() || position == begin()) && position < end());\n                ptrdiff_t index = position - begin();\n                erase(m_pelements, index, index + 1);\n                memcpy(&m_pelements[index], &m_pelements[index + 1], sizeof(T) * (m_size - index - 1));\n                --m_size;\n                return iterator(m_pelements + (position - begin()));\n            }\n\n            iterator erase(iterator position, iterator positionEnd)\n            {\n                assert(m_isBufferOwner);\n                assert((position > begin() || position == begin()) && position < end());\n                ptrdiff_t index = position - begin();\n                ptrdiff_t elements = positionEnd - position;\n                erase(m_pelements, index, index + elements);\n                memcpy(&m_pelements[index], &m_pelements[index + elements], sizeof(T) * (m_size - index - elements));\n                m_size -= elements;\n                return iterator(m_pelements + (position - begin()));\n            }\n            \n            T* data()\n            {\n                return m_pelements;\n            }\n\n            const T* data() const\n            {\n                return m_pelements;\n            }\n\n         private:\n            // Transition a subset of the array from uninitialized to initialized with default value for T.\n            static void fill_uninitialized_with_default_value(T* pelements, size_t startIdx, size_t endIdx)\n            {\n                assert(startIdx <= endIdx);\n                assert(pelements != NULL || startIdx == endIdx);\n                for (size_t i = startIdx; i < endIdx; i++)\n                {\n                    INDEBUG(assert(0xcc == *((BYTE*)&pelements[i])));\n                    pelements[i] = T();\n                }\n            }\n\n            // Transition a subset of the array from a valid value of T to uninitialized.\n            static void erase(T* pelements, size_t startIdx, size_t endIdx)\n            {\n                assert(startIdx <= endIdx);\n                assert(pelements != NULL || startIdx == endIdx);\n                for (size_t i = startIdx; i < endIdx; i++)\n                {\n                    pelements[i].~T();\n                }\n\n                INDEBUG(memset(&pelements[startIdx], 0xcc, (endIdx - startIdx) * sizeof(T)));\n            }\n\n         private:\n            size_t    m_size;       //# of elements\n            size_t    m_capacity;   //# of elements allocated\n            T        *m_pelements;  //actual array\n                                    //  invariants:\n                                    //    dimensions == m_capacity\n                                    //    elements 0 thru m_size-1 always contain constructed T values.\n                                    //    elements from m_size thru m_capacity - 1 contain memory garbage (0xcc in DEBUG).\n            bool    m_isBufferOwner; // indicate if this vector creates its own buffer, or wraps an existing buffer.\n\n\n\n\n    };  // class vector\n\n}; // namespace std\n\n#endif /* __clr_std_vector_h__ */\n\n#endif // !USE_STL\n\n// Help the VIM editor figure out what kind of file this no-extension file is.\n// vim: filetype=cpp\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrconfig.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// --------------------------------------------------------------------------------------------------\n// CLRConfig.h\n//\n\n//\n// Unified method of accessing configuration values.\n// To define a flag, add an entry in the table in file:CLRConfigValues.h.\n// --------------------------------------------------------------------------------------------------\n\n\n#include \"utilcode.h\"\n#include \"holder.h\"\n\n#ifndef __CLRConfig_h__\n#define __CLRConfig_h__\n\nclass CLRConfig\n{\npublic:\n    // Setting each option results in some change to the config value.\n    enum class LookupOptions\n    {\n        // Default options.\n        Default = 0,\n\n        // If set, do not prepend prefix when doing environment variable lookup.\n        DontPrependPrefix = 0x1,\n\n        // Remove any whitespace at beginning and end of value.  (Only applicable for\n        // *string* configuration values.)\n        TrimWhiteSpaceFromStringValue = 0x2,\n\n        // The configuration should be parsed using a 10 radix as opposed to the\n        // default of 16.\n        ParseIntegerAsBase10 = 0x4,\n    };\n\n    // Struct used to store information about where/how to find a Config DWORD.\n    // NOTE: Please do NOT create instances of this struct. Use the macros in file:CLRConfigValues.h instead.\n    typedef struct ConfigDWORDInfo\n    {\n        LPCWSTR name;\n        DWORD defaultValue;\n        LookupOptions options;\n    } ConfigDWORDInfo;\n\n    // Struct used to store information about where/how to find a Config String.\n    // NOTE: Please do NOT create instances of this struct. Use the macros in file:CLRConfigValues.h instead.\n    typedef struct ConfigStringInfo\n    {\n        LPCWSTR name;\n        LookupOptions options;\n    } ConfigStringInfo;\n\n    //\n    // Declaring structs using the macro table in CLRConfigValues.h\n    //\n\n    // These macros declare ConfigDWORDInfo structs.\n    #define RETAIL_CONFIG_DWORD_INFO(symbol, name, defaultValue, description) \\\n        static const ConfigDWORDInfo symbol;\n    #define RETAIL_CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions) \\\n        static const ConfigDWORDInfo symbol;\n\n    // These macros declare ConfigStringInfo structs.\n    #define RETAIL_CONFIG_STRING_INFO(symbol, name, description) \\\n        static const ConfigStringInfo symbol;\n    #define RETAIL_CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions) \\\n        static const ConfigStringInfo symbol;\n\n    //\n    // Debug versions of the macros\n    //\n#ifdef _DEBUG\n    #define CONFIG_DWORD_INFO(symbol, name, defaultValue, description) \\\n        static const ConfigDWORDInfo symbol;\n    #define CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions) \\\n        static const ConfigDWORDInfo symbol;\n    #define CONFIG_STRING_INFO(symbol, name, description) \\\n        static const ConfigStringInfo symbol;\n    #define CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions) \\\n        static const ConfigStringInfo symbol;\n#else\n    #define CONFIG_DWORD_INFO(symbol, name, defaultValue, description)\n    #define CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions)\n    #define CONFIG_STRING_INFO(symbol, name, description)\n    #define CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions)\n#endif // _DEBUG\n\n        // Now that we have defined what what the macros in file:CLRConfigValues.h mean, include it to generate the code.\n        #include \"clrconfigvalues.h\"\n\n    #undef RETAIL_CONFIG_DWORD_INFO\n    #undef RETAIL_CONFIG_STRING_INFO\n    #undef RETAIL_CONFIG_DWORD_INFO_EX\n    #undef RETAIL_CONFIG_STRING_INFO_EX\n    #undef CONFIG_DWORD_INFO\n    #undef CONFIG_STRING_INFO\n    #undef CONFIG_DWORD_INFO_EX\n    #undef CONFIG_STRING_INFO_EX\n\n    //\n    // Methods to do config value (DWORD and String) lookups.\n    //\n    static BOOL IsConfigEnabled(const ConfigDWORDInfo & info);\n\n    // Look up a DWORD config value.\n    static DWORD GetConfigValue(const ConfigDWORDInfo & info);\n\n    // Look up a DWORD config value.\n    static DWORD GetConfigValue(const ConfigDWORDInfo & info, /* [Out] */ bool *isDefault);\n\n    // Look up a DWORD config value.\n    static DWORD GetConfigValue(const ConfigDWORDInfo & info, DWORD defaultValue);\n\n    // Look up a string config value.\n    // You own the string that's returned.\n    static LPWSTR GetConfigValue(const ConfigStringInfo & info);\n\n    // Look up a string config value, passing it out through a pointer reference. Reports out of memory\n    // errors (HRESULT E_OUTOFMEMORY).\n    // You own the string that's returned.\n    static HRESULT GetConfigValue(const ConfigStringInfo & info, _Outptr_result_z_ LPWSTR * outVal);\n\n    //\n    // Check whether an option is specified (e.g. explicitly listed) in the CLRConfig.\n    //\n    static BOOL IsConfigOptionSpecified(LPCWSTR name);\n\n    // Free a string returned by GetConfigValue\n    static void FreeConfigString(_In_ _In_z_ LPWSTR name);\n\n    // Initialize the configuration.\n    static void Initialize();\n};\n\ninline CLRConfig::LookupOptions operator|(CLRConfig::LookupOptions lhs, CLRConfig::LookupOptions rhs)\n{\n    return static_cast<CLRConfig::LookupOptions>(static_cast<DWORD>(lhs) | static_cast<DWORD>(rhs));\n}\n\ninline CLRConfig::LookupOptions operator&(CLRConfig::LookupOptions lhs, CLRConfig::LookupOptions rhs)\n{\n    return static_cast<CLRConfig::LookupOptions>(static_cast<DWORD>(lhs) & static_cast<DWORD>(rhs));\n}\n\ntypedef Wrapper<LPWSTR, DoNothing, CLRConfig::FreeConfigString, NULL> CLRConfigStringHolder;\n\n#endif //__CLRConfig_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrconfignocache.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// --------------------------------------------------------------------------------------------------\n// clrconfignocache.h\n//\n// Logic for resolving configuration names.\n//\n\n#include<minipal/utils.h>\n\n// Config prefixes\n#define COMPLUS_PREFIX_A \"COMPlus_\"\n#define COMPLUS_PREFIX W(\"COMPlus_\")\n#define LEN_OF_COMPLUS_PREFIX STRING_LENGTH(COMPLUS_PREFIX_A)\n\n#define DOTNET_PREFIX_A \"DOTNET_\"\n#define DOTNET_PREFIX W(\"DOTNET_\")\n#define LEN_OF_DOTNET_PREFIX STRING_LENGTH(DOTNET_PREFIX_A)\n\nclass CLRConfigNoCache\n{\n    const char* _value;\n\n    CLRConfigNoCache() = default;\n    CLRConfigNoCache(LPCSTR cfg) : _value { cfg }\n    { }\n\npublic:\n    bool IsSet() const { return _value != NULL; }\n\n    LPCSTR AsString() const\n    {\n        _ASSERTE(IsSet());\n        return _value;\n    }\n\n    bool TryAsInteger(int radix, DWORD& result) const\n    {\n        _ASSERTE(IsSet());\n\n        errno = 0;\n        LPSTR endPtr;\n        result = strtoul(_value, &endPtr, radix);\n        bool fSuccess = (errno != ERANGE) && (endPtr != _value);\n        return fSuccess;\n    }\n\n    static CLRConfigNoCache Get(LPCSTR cfg, bool noPrefix = false, char*(*getEnvFptr)(const char*) = nullptr)\n    {\n        char nameBuffer[64];\n        const char* fallbackPrefix = NULL;\n        const size_t namelen = strlen(cfg);\n\n        if (noPrefix)\n        {\n            if (namelen >= ARRAY_SIZE(nameBuffer))\n            {\n                _ASSERTE(!\"Environment variable name too long.\");\n                return {};\n            }\n\n            *nameBuffer = '\\0';\n        }\n        else\n        {\n            bool dotnetValid = namelen < (size_t)(STRING_LENGTH(nameBuffer) - LEN_OF_DOTNET_PREFIX);\n            bool complusValid = namelen < (size_t)(STRING_LENGTH(nameBuffer) - LEN_OF_COMPLUS_PREFIX);\n            if (!dotnetValid || !complusValid)\n            {\n                _ASSERTE(!\"Environment variable name too long.\");\n                return {};\n            }\n\n            // Priority order is DOTNET_ and then COMPlus_.\n            strcpy_s(nameBuffer, ARRAY_SIZE(nameBuffer), DOTNET_PREFIX_A);\n            fallbackPrefix = COMPLUS_PREFIX_A;\n        }\n\n        strcat_s(nameBuffer, ARRAY_SIZE(nameBuffer), cfg);\n\n        LPCSTR val = getEnvFptr != NULL ? getEnvFptr(nameBuffer) : getenv(nameBuffer);\n        if (val == NULL && fallbackPrefix != NULL)\n        {\n            strcpy_s(nameBuffer, ARRAY_SIZE(nameBuffer), fallbackPrefix);\n            strcat_s(nameBuffer, ARRAY_SIZE(nameBuffer), cfg);\n            val = getEnvFptr != NULL ? getEnvFptr(nameBuffer) : getenv(nameBuffer);\n        }\n\n        return { val };\n    }\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrconfigvalues.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// CLRConfigValues.h\n//\n\n//\n// Unified method of accessing configuration values from environment variables,\n// registry and config file.\n//\n// Given any config knob below that looks like this example:\n//    RETAIL_CONFIG_DWORD_INFO(INTERNAL_LogEnable, W(\"LogEnable\"), 0, \"Turns on the traditional CLR log.\")\n//                                                                  ---------\n//                                                                     |\n//                                                 --------------------\n//                                                 |\n//                                                 V\n// You can set an environment variable DOTNET_LogEnable=1 to enable it.\n//\n// See below for more details\n//\n//*****************************************************************************\n\n// IMPORTANT: Before adding a new config value, please read up on naming conventions (see\n// code:#NamingConventions)\n//\n// ==========\n// CONTENTS\n// ==========\n// * How to define config values (see code:#Define)\n// * How to access config values (see code:#Access)\n// * Naming conventions (see code:#NamingConventions)\n//\n//\n// =====================================\n// #Define - Use one of the following macros to define config values. (See code:#DWORDs and code:#Strings)\n// =====================================\n//\n// By default, all macros are DEBUG ONLY. Add the \"RETAIL_\" prefix to make the config value available in retail builds.\n//\n// #DWORDs:\n// --------------------------------------------------------------------------\n// CONFIG_DWORD_INFO(symbol, name, defaultValue, description)\n// --------------------------------------------------------------------------\n// Use this macro to define a basic DWORD value. CLRConfig will look in environment variables (adding\n// DOTNET_ to the name) for this value. To customize\n// where CLRConfig looks, use the extended version of the macro below. IMPORTANT: please follow the\n// code:#NamingConventions for the symbol and the name!\n//\n// Example: CONFIG_DWORD_INFO(INTERNAL_AllowCrossModuleInlining, W(\"AllowCrossModuleInlining\"), 0, \"\")\n//\n// --------------------------------------------------------------------------\n// CONFIG_DWORD_INFO_EX(symbol, name, defaultValue, description, lookupOptions)\n// --------------------------------------------------------------------------\n// To customize where CLRConfig looks to get a DWORD, use the extended (_EX) version of the macro. For a list\n// of options and their descriptions, see code:CLRConfig.LookupOptions\n//\n// Example: CONFIG_DWORD_INFO_EX(INTERNAL_EnableInternetHREFexes, W(\"EnableInternetHREFexes\"), 0, \"\",\n// (CLRConfig::LookupOptions) (CLRConfig::LookupOptions::DontPrependPrefix))\n//\n// #Strings:\n// --------------------------------------------------------------------------\n// CONFIG_STRING_INFO(symbol, name, description)\n// --------------------------------------------------------------------------\n// Defines a string value. Same rules apply as DWORDs.\n//\n// --------------------------------------------------------------------------\n// CONFIG_STRING_INFO_EX(symbol, name, description, lookupOptions)\n// --------------------------------------------------------------------------\n// Extended version of the String macro. Again, similar to the DWORD extended macro.\n//\n//\n// ===============================================================\n// #Access - Use the following overloaded method to access config values.\n// ===============================================================\n// From anywhere, use CLRConfig::GetConfigValue(CLRConfig::<symbol>) to access any value defined in this\n// file.\n//\n//\n// ===============================================================\n// #NamingConventions\n// ===============================================================\n// ----------------\n// #Symbol - used to access values from the source. (using CLRConfig::<symbol>)\n// ----------------\n// The symbol for each config value is named as such:\n// ### <Class>_<feature area>_<name> ###\n//\n// <Class> indicates which of the following buckets the value is in:\n// * INTERNAL ? this value is for internal (CLR team) use only\n// * UNSUPPORTED ? this value is available to partners/developers, but is not officially supported\n// * EXTERNAL ? this value is available for anyone to use and is publicly documented\n//\n// Examples:\n// * INTERNAL_Security_FullAccessChecks\n// * UNSUPPORTED_Security_DisableTransparency\n// * EXTERNAL_Security_LegacyHMACMode\n//\n// ----------------\n// #Name - the name of the registry value or environment variable that CLRConfig looks up.\n// ----------------\n// The name of each value is the same as the symbol, with one exception. Names of external values do NOT\n// contain the EXTERNAL prefix.\n//\n// For compatibility reasons, current names do not follow the convention.\n//\n// Examples:\n// * W(\"INTERNAL_Security_FullAccessChecks\")\n// * W(\"UNSUPPORTED_Security_DisableTransparency\")\n// * W(\"Security_LegacyHMACMode\") <---------------------- (No EXTERNAL prefix)\n\n///\n/// AppDomain\n///\nCONFIG_DWORD_INFO(INTERNAL_EnableFullDebug, W(\"EnableFullDebug\"), 0, \"Heavy-weight checking for AD boundary violations (AD leaks)\")\n\n///\n/// Jit Pitching\n///\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchEnabled, W(\"JitPitchEnabled\"), (DWORD)0, \"Set it to 1 to enable Jit Pitching\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchMemThreshold, W(\"JitPitchMemThreshold\"), (DWORD)0, \"Do Jit Pitching when code heap usage is larger than this (in bytes)\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchMethodSizeThreshold, W(\"JitPitchMethodSizeThreshold\"), (DWORD)0, \"Do Jit Pitching for methods whose native code size larger than this (in bytes)\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchTimeInterval, W(\"JitPitchTimeInterval\"), (DWORD)0, \"Time interval between Jit Pitchings in ms\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchPrintStat, W(\"JitPitchPrintStat\"), (DWORD)0, \"Print statistics about Jit Pitching\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchMinVal, W(\"JitPitchMinVal\"), (DWORD)0, \"Do Jit Pitching if the value of the inner counter greater than this value (for debugging purpose only)\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitPitchMaxVal, W(\"JitPitchMaxVal\"), (DWORD)0xffffffff, \"Do Jit Pitching the value of the inner counter less then this value (for debuggin purpose only)\")\n\n///\n/// Assembly Loader\n///\nCONFIG_DWORD_INFO(INTERNAL_GetAssemblyIfLoadedIgnoreRidMap, W(\"GetAssemblyIfLoadedIgnoreRidMap\"), 0, \"Used to force loader to ignore assemblies cached in the rid-map\")\n\n///\n/// Conditional breakpoints\n///\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BreakOnBadExit, W(\"BreakOnBadExit\"), 0, \"\")\nCONFIG_STRING_INFO(INTERNAL_BreakOnClassBuild, W(\"BreakOnClassBuild\"), \"Very useful for debugging class layout code.\")\nCONFIG_STRING_INFO(INTERNAL_BreakOnClassLoad, W(\"BreakOnClassLoad\"), \"Very useful for debugging class loading code.\")\nCONFIG_STRING_INFO(INTERNAL_BreakOnComToClrNativeInfoInit, W(\"BreakOnComToClrNativeInfoInit\"), \"Throws an assert when native information about a COM -> CLR call are about to be gathered.\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnDebugBreak, W(\"BreakOnDebugBreak\"), 0, \"Allows an assert in debug builds when a user break is hit\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnDILoad, W(\"BreakOnDILoad\"), 0, \"Allows an assert when the DI is loaded\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnDumpToken, W(\"BreakOnDumpToken\"), 0xffffffff, \"Breaks when using internal logging on a particular token value.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BreakOnEELoad, W(\"BreakOnEELoad\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnEEShutdown, W(\"BreakOnEEShutdown\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnExceptionInGetThrowable, W(\"BreakOnExceptionInGetThrowable\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnFindMethod, W(\"BreakOnFindMethod\"), 0, \"Breaks in findMethodInternal when it searches for the specified token.\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnFirstPass, W(\"BreakOnFirstPass\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnHR, W(\"BreakOnHR\"), 0, \"Debug.cpp, IfFailxxx use this macro to stop if hr matches \")\nCONFIG_STRING_INFO(INTERNAL_BreakOnInstantiation, W(\"BreakOnInstantiation\"), \"Very useful for debugging generic class instantiation.\")\nCONFIG_STRING_INFO(INTERNAL_BreakOnInteropStubSetup, W(\"BreakOnInteropStubSetup\"), \"Throws an assert when marshaling stub for the given method is about to be built.\")\nCONFIG_STRING_INFO(INTERNAL_BreakOnInteropVTableBuild, W(\"BreakOnInteropVTableBuild\"), \"Specifies a type name for which an assert should be thrown when building interop v-table.\")\nCONFIG_STRING_INFO(INTERNAL_BreakOnMethodName, W(\"BreakOnMethodName\"), \"Very useful for debugging method override placement code.\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnNotify, W(\"BreakOnNotify\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnSecondPass, W(\"BreakOnSecondPass\"), 0, \"\")\nCONFIG_STRING_INFO(INTERNAL_BreakOnStructMarshalSetup, W(\"BreakOnStructMarshalSetup\"), \"Throws an assert when field marshalers for the given type with layout are about to be created.\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnUEF, W(\"BreakOnUEF\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_BreakOnUncaughtException, W(\"BreakOnUncaughtException\"), 0, \"\")\n\n///\n/// Debugger\n///\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableDiagnostics, W(\"EnableDiagnostics\"), 1, \"Allows the debugger, profiler, and EventPipe diagnostics to be disabled\")\nCONFIG_DWORD_INFO(INTERNAL_D__FCE, W(\"D::FCE\"), 0, \"Allows an assert when crawling the managed stack for an exception handler\")\nCONFIG_DWORD_INFO(INTERNAL_DbgBreakIfLocksUnavailable, W(\"DbgBreakIfLocksUnavailable\"), 0, \"Allows an assert when the debugger can't take a lock \")\nCONFIG_DWORD_INFO(INTERNAL_DbgBreakOnErr, W(\"DbgBreakOnErr\"), 0, \"Allows an assert when we get a failing hresult\")\nCONFIG_DWORD_INFO(INTERNAL_DbgBreakOnMapPatchToDJI, W(\"DbgBreakOnMapPatchToDJI\"), 0, \"Allows an assert when mapping a patch to an address\")\nCONFIG_DWORD_INFO(INTERNAL_DbgBreakOnRawInt3, W(\"DbgBreakOnRawInt3\"), 0, \"Allows an assert for test coverage for debug break or other int3 breaks\")\nCONFIG_DWORD_INFO(INTERNAL_DbgBreakOnSendBreakpoint, W(\"DbgBreakOnSendBreakpoint\"), 0, \"Allows an assert when sending a breakpoint to the right side\")\nCONFIG_DWORD_INFO(INTERNAL_DbgBreakOnSetIP, W(\"DbgBreakOnSetIP\"), 0, \"Allows an assert when setting the IP\")\nCONFIG_DWORD_INFO(INTERNAL_DbgCheckInt3, W(\"DbgCheckInt3\"), 0, \"Asserts if the debugger explicitly writes int3 instead of calling SetUnmanagedBreakpoint\")\nCONFIG_DWORD_INFO(INTERNAL_DbgDACAssertOnMismatch, W(\"DbgDACAssertOnMismatch\"), 0, \"Allows an assert when the mscordacwks and mscorwks dll versions don't match\")\nCONFIG_DWORD_INFO(INTERNAL_DbgDACEnableAssert, W(\"DbgDACEnableAssert\"), 0, \"Enables extra validity checking in DAC - assumes target isn't corrupt\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgDACSkipVerifyDlls, W(\"DbgDACSkipVerifyDlls\"), 0, \"Allows disabling the check to ensure mscordacwks and mscorwks dll versions match\")\nCONFIG_DWORD_INFO(INTERNAL_DbgDelayHelper, W(\"DbgDelayHelper\"), 0, \"Varies the wait in the helper thread startup for testing race between threads\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgDisableDynamicSymsCompat, W(\"DbgDisableDynamicSymsCompat\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_DbgDisableTargetConsistencyAsserts, W(\"DbgDisableTargetConsistencyAsserts\"), 0, \"Allows explicitly testing with corrupt targets\")\nCONFIG_DWORD_INFO(INTERNAL_DbgExtraThreads, W(\"DbgExtraThreads\"), 0, \"Allows extra unmanaged threads to run and throw debug events for stress testing\")\nCONFIG_DWORD_INFO(INTERNAL_DbgExtraThreadsCantStop, W(\"DbgExtraThreadsCantStop\"), 0, \"Allows extra unmanaged threads in can't stop region to run and throw debug events for stress testing\")\nCONFIG_DWORD_INFO(INTERNAL_DbgExtraThreadsIB, W(\"DbgExtraThreadsIB\"), 0, \"Allows extra in-band unmanaged threads to run and throw debug events for stress testing\")\nCONFIG_DWORD_INFO(INTERNAL_DbgExtraThreadsOOB, W(\"DbgExtraThreadsOOB\"), 0, \"Allows extra out of band unmanaged threads to run and throw debug events for stress testing\")\nCONFIG_DWORD_INFO(INTERNAL_DbgFaultInHandleIPCEvent, W(\"DbgFaultInHandleIPCEvent\"), 0, \"Allows testing the unhandled event filter\")\nCONFIG_DWORD_INFO(INTERNAL_DbgInjectFEE, W(\"DbgInjectFEE\"), 0, \"Allows injecting a fatal execution error for testing Watson\")\nCONFIG_DWORD_INFO(INTERNAL_DbgLeakCheck, W(\"DbgLeakCheck\"), 0, \"Allows checking for leaked Cordb objects\")\nCONFIG_DWORD_INFO(INTERNAL_DbgNo2ndChance, W(\"DbgNo2ndChance\"), 0, \"Allows breaking on (and catching bogus) 2nd chance exceptions\")\nCONFIG_DWORD_INFO(INTERNAL_DbgNoDebugger, W(\"DbgNoDebugger\"), 0, \"Allows breaking if we don't want to lazily initialize the debugger\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgNoForceContinue, W(\"DbgNoForceContinue\"), 1, \"Used to force a continue on longhorn\")\nCONFIG_DWORD_INFO(INTERNAL_DbgNoOpenMDByFile, W(\"DbgNoOpenMDByFile\"), 0, \"Allows opening MD by memory for perf testing\")\nCONFIG_DWORD_INFO(INTERNAL_DbgOOBinFEEE, W(\"DbgOOBinFEEE\"), 0, \"Allows forcing oob breakpoints when a fatal error occurs\")\nCONFIG_DWORD_INFO(INTERNAL_DbgPingInterop, W(\"DbgPingInterop\"), 0, \"Allows checking for deadlocks in interop debugging\")\nCONFIG_DWORD_INFO(INTERNAL_DbgRace, W(\"DbgRace\"), 0, \"Allows pausing for native debug events to get hijicked\")\nCONFIG_DWORD_INFO(INTERNAL_DbgShortcutCanary, W(\"DbgShortcutCanary\"), 0, \"Allows a way to force canary to fail to be able to test failure paths\")\nCONFIG_DWORD_INFO(INTERNAL_DbgSkipMEOnStep, W(\"DbgSkipMEOnStep\"), 0, \"Turns off MethodEnter checks\")\nCONFIG_DWORD_INFO(INTERNAL_DbgSkipVerCheck, W(\"DbgSkipVerCheck\"), 0, \"Allows different RS and LS versions (for servicing work)\")\nCONFIG_DWORD_INFO(INTERNAL_DbgTC, W(\"DbgTC\"), 0, \"Allows checking boundary compression for offset mappings\")\nCONFIG_DWORD_INFO(INTERNAL_DbgTransportFaultInject, W(\"DbgTransportFaultInject\"), 0, \"Allows injecting a fault for testing the debug transport\")\nCONFIG_DWORD_INFO(INTERNAL_DbgTransportLog, W(\"DbgTransportLog\"), 0 /* LE_None */, \"Turns on logging for the debug transport\")\nCONFIG_DWORD_INFO(INTERNAL_DbgTransportLogClass, W(\"DbgTransportLogClass\"), (DWORD)-1 /* LC_All */, \"Mask to control what is logged in DbgTransportLog\")\nRETAIL_CONFIG_STRING_INFO(UNSUPPORTED_DbgTransportProxyAddress, W(\"DbgTransportProxyAddress\"), \"Allows specifying the transport proxy address\")\nCONFIG_DWORD_INFO(INTERNAL_DbgTrapOnSkip, W(\"DbgTrapOnSkip\"), 0, \"Allows breaking when we skip a breakpoint\")\nCONFIG_DWORD_INFO(INTERNAL_DbgWaitTimeout, W(\"DbgWaitTimeout\"), 1, \"Specifies the timeout value for waits\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgWFDETimeout, W(\"DbgWFDETimeout\"), 25, \"Specifies the timeout value for wait when waiting for a debug event\")\nCONFIG_DWORD_INFO(INTERNAL_RaiseExceptionOnAssert, W(\"RaiseExceptionOnAssert\"), 0, \"Raise a first chance (if set to 1) or second chance (if set to 2) exception on asserts.\")\nCONFIG_DWORD_INFO(INTERNAL_DebugBreakOnVerificationFailure, W(\"DebugBreakOnVerificationFailure\"), 0, \"Halts the jit on verification failure\")\nCONFIG_STRING_INFO(INTERNAL_DebuggerBreakPoint, W(\"DebuggerBreakPoint\"), \"Allows counting various debug events\")\nCONFIG_STRING_INFO(INTERNAL_DebugVerify, W(\"DebugVerify\"), \"Control for tracing in peverify\")\nCONFIG_DWORD_INFO(INTERNAL_EncApplyChanges, W(\"EncApplyChanges\"), 0, \"Allows breaking when ApplyEditAndContinue is called\")\nCONFIG_DWORD_INFO(INTERNAL_EnCBreakOnRemapComplete, W(\"EnCBreakOnRemapComplete\"), 0, \"Allows breaking after N RemapCompletes\")\nCONFIG_DWORD_INFO(INTERNAL_EnCBreakOnRemapOpportunity, W(\"EnCBreakOnRemapOpportunity\"), 0, \"Allows breaking after N RemapOpportunities\")\nCONFIG_DWORD_INFO(INTERNAL_EncDumpApplyChanges, W(\"EncDumpApplyChanges\"), 0, \"Allows dumping edits in delta metadata and il files\")\nCONFIG_DWORD_INFO(INTERNAL_EncFixupFieldBreak, W(\"EncFixupFieldBreak\"), 0, \"Unlikely that this is used anymore.\")\nCONFIG_DWORD_INFO(INTERNAL_EncJitUpdatedFunction, W(\"EncJitUpdatedFunction\"), 0, \"Allows breaking when an updated function is jitted\")\nCONFIG_DWORD_INFO(INTERNAL_EnCResolveField, W(\"EnCResolveField\"), 0, \"Allows breaking when computing the address of an EnC-added field\")\nCONFIG_DWORD_INFO(INTERNAL_EncResumeInUpdatedFunction, W(\"EncResumeInUpdatedFunction\"), 0, \"Allows breaking when execution resumes in a new EnC version of a function\")\nCONFIG_DWORD_INFO(INTERNAL_DbgAssertOnDebuggeeDebugBreak, W(\"DbgAssertOnDebuggeeDebugBreak\"), 0, \"If non-zero causes the managed-only debugger to assert on unhandled breakpoints in the debuggee\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgDontResumeThreadsOnUnhandledException, W(\"UNSUPPORTED_DbgDontResumeThreadsOnUnhandledException\"), 0, \"If non-zero, then don't try to unsuspend threads after continuing a 2nd-chance native exception\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DbgSkipStackCheck, W(\"DbgSkipStackCheck\"), 0, \"Skip the stack pointer check during stackwalking\")\n#ifdef DACCESS_COMPILE\nCONFIG_DWORD_INFO(INTERNAL_DumpGeneration_IntentionallyCorruptDataFromTarget, W(\"IntentionallyCorruptDataFromTarget\"), 0, \"Intentionally fakes bad data retrieved from target to try and break dump generation.\")\n#endif\n// Note that Debugging_RequiredVersion is sometimes an 'INTERNAL' knob and sometimes an 'UNSUPPORTED' knob, but we don't change it's name.\nCONFIG_DWORD_INFO(UNSUPPORTED_Debugging_RequiredVersion, W(\"UNSUPPORTED_Debugging_RequiredVersion\"), 0, \"The lowest ICorDebug version we should attempt to emulate, or 0 for default policy.  Use 2 for CLRv2, 4 for CLRv4, etc.\")\n\n#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_MiniMdBufferCapacity, W(\"MiniMdBufferCapacity\"), 64 * 1024, \"The max size of the buffer to store mini metadata information for triage- and mini-dumps.\")\n#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS\n\nCONFIG_DWORD_INFO(INTERNAL_DbgNativeCodeBpBindsAcrossVersions, W(\"DbgNativeCodeBpBindsAcrossVersions\"), 0, \"If non-zero causes native breakpoints at offset 0 to bind in all tiered compilation versions of the given method\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_RichDebugInfo, W(\"RichDebugInfo\"), 0, \"If non-zero store some additional debug information for each jitted method\")\n\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_OutOfProcessSetContext, W(\"OutOfProcessSetContext\"), 0, \"If enabled the debugger will not modify thread contexts in-process.  Enabled by default when CET is enabled for the process.\")\n\n///\n/// Diagnostics (internal general-purpose)\n///\nCONFIG_DWORD_INFO(INTERNAL_ConditionalContracts, W(\"ConditionalContracts\"), 0, \"If ENABLE_CONTRACTS_IMPL is defined, sets whether contracts are conditional. (?)\")\nCONFIG_DWORD_INFO(INTERNAL_ConsistencyCheck, W(\"ConsistencyCheck\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_ContinueOnAssert, W(\"ContinueOnAssert\"), 0, \"If set, doesn't break on asserts.\")\nCONFIG_DWORD_INFO(INTERNAL_InjectFatalError, W(\"InjectFatalError\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_InjectFault, W(\"InjectFault\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_SuppressChecks, W(\"SuppressChecks\"),0,  \"\")\n#ifdef FEATURE_EH_FUNCLETS\nCONFIG_DWORD_INFO(INTERNAL_SuppressLockViolationsOnReentryFromOS, W(\"SuppressLockViolationsOnReentryFromOS\"), 0, \"64 bit OOM tests re-enter the CLR via RtlVirtualUnwind.  This indicates whether to suppress resulting locking violations.\")\n#endif // FEATURE_EH_FUNCLETS\n\n///\n/// Exception Handling\n///\nCONFIG_DWORD_INFO(INTERNAL_AssertOnFailFast, W(\"AssertOnFailFast\"), 1, \"\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_legacyCorruptedStateExceptionsPolicy, W(\"legacyCorruptedStateExceptionsPolicy\"), 0, \"Enabled Pre-V4 CSE behavior\")\nCONFIG_DWORD_INFO(INTERNAL_SuppressLostExceptionTypeAssert, W(\"SuppressLostExceptionTypeAssert\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_UseEntryPointFilter, W(\"UseEntryPointFilter\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_Corhost_Swallow_Uncaught_Exceptions, W(\"Corhost_Swallow_Uncaught_Exceptions\"), 0, \"\")\n\n///\n/// Garbage collector\n///\nCONFIG_DWORD_INFO(INTERNAL_FastGCCheckStack, W(\"FastGCCheckStack\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_FastGCStress, W(\"FastGCStress\"), 0, \"Reduce the number of GCs done by enabling GCStress\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCBreakOnOOM, W(\"GCBreakOnOOM\"), 0, \"Does a DebugBreak at the soonest time we detect an OOM\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcConcurrent, W(\"gcConcurrent\"), (DWORD)-1, \"Enables/Disables concurrent GC\")\n\n#ifdef FEATURE_CONSERVATIVE_GC\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcConservative, W(\"gcConservative\"), 0, \"Enables/Disables conservative GC\")\n#endif\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_gcServer, W(\"gcServer\"), 0, \"Enables server GC\")\nCONFIG_STRING_INFO(INTERNAL_GcCoverage, W(\"GcCoverage\"), \"Specify a method or regular expression of method names to run with GCStress\")\nCONFIG_STRING_INFO(INTERNAL_SkipGCCoverage, W(\"SkipGcCoverage\"), \"Specify a list of assembly names to skip with GC Coverage\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StatsUpdatePeriod, W(\"StatsUpdatePeriod\"), 60, \"Specifies the interval, in seconds, at which to update the statistics\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_GCRetainVM, W(\"GCRetainVM\"), 0, \"When set we put the segments that should be deleted on a standby list (instead of releasing them back to the OS) which will be considered to satisfy new segment requests (note that the same thing can be specified via API which is the supported way)\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCLOHThreshold, W(\"GCLOHThreshold\"), 0, \"Specifies the size that will make objects go on LOH\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_gcAllowVeryLargeObjects, W(\"gcAllowVeryLargeObjects\"), 1, \"Allow allocation of 2GB+ objects on GC heap\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCStress, W(\"GCStress\"), 0, \"Trigger GCs at regular intervals\")\nCONFIG_DWORD_INFO(INTERNAL_GcStressOnDirectCalls, W(\"GcStressOnDirectCalls\"), 0, \"Whether to trigger a GC on direct calls\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_HeapVerify, W(\"HeapVerify\"), 0, \"When set verifies the integrity of the managed heap on entry and exit of each GC\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCCpuGroup, W(\"GCCpuGroup\"), 0, \"Specifies if to enable GC to support CPU groups\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_GCName, W(\"GCName\"), \"\")\n/**\n * This flag allows us to force the runtime to use global allocation context on Windows x86/amd64 instead of thread allocation context just for testing purpose.\n * The flag is unsafe for a subtle reason. Although the access to the g_global_alloc_context is protected under a lock. The implementation of\n * that lock in the JIT helpers are not multi-core safe (in particular, it used and inc instruction without using the LOCK prefix). This is\n * only useful for ad-hoc testing.\n */\nCONFIG_DWORD_INFO(INTERNAL_GCUseGlobalAllocationContext, W(\"GCUseGlobalAllocationContext\"), 0, \"Force using the global allocation context for testing only\")\n\n///\n/// JIT\n///\nCONFIG_DWORD_INFO(INTERNAL_JitBreakEmit, W(\"JitBreakEmit\"), (DWORD)-1, \"\")\nCONFIG_DWORD_INFO(INTERNAL_JitDebuggable, W(\"JitDebuggable\"), 0, \"\")\n#if !defined(DEBUG) && !defined(_DEBUG)\n#define INTERNAL_JitEnableNoWayAssert_Default 0\n#else\n#define INTERNAL_JitEnableNoWayAssert_Default 1\n#endif\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitEnableNoWayAssert, W(\"JitEnableNoWayAssert\"), INTERNAL_JitEnableNoWayAssert_Default, \"\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_JitFramed, W(\"JitFramed\"), 0, \"Forces EBP frames\")\nCONFIG_DWORD_INFO(INTERNAL_JitThrowOnAssertionFailure, W(\"JitThrowOnAssertionFailure\"), 0, \"Throw managed exception on assertion failures during JIT instead of failfast\")\nCONFIG_DWORD_INFO(INTERNAL_JitGCStress, W(\"JitGCStress\"), 0, \"GC stress mode for jit\")\nCONFIG_DWORD_INFO(INTERNAL_JitHeartbeat, W(\"JitHeartbeat\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_JitHelperLogging, W(\"JitHelperLogging\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_JITMinOpts, W(\"JITMinOpts\"), 0, \"Forces MinOpts\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_JitName, W(\"JitName\"), \"Primary jit to use\")\nCONFIG_STRING_INFO(INTERNAL_JitPath, W(\"JitPath\"), \"Full path to primary jit to use\")\n#if defined(ALLOW_SXS_JIT)\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJitName, W(\"AltJitName\"), \"Alternative jit to use, will fall back to primary jit.\")\nCONFIG_STRING_INFO(INTERNAL_AltJitPath, W(\"AltJitPath\"), \"Full path to alternative jit to use\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJit, W(\"AltJit\"), \"Enables AltJit and selectively limits it to the specified methods.\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJitOs, W(\"AltJitOS\"), \"Sets target OS for AltJit or uses native one by default. Only applicable for ARM/AMR64 at the moment.\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_AltJitExcludeAssemblies, W(\"AltJitExcludeAssemblies\"), \"Do not use AltJit on this semicolon-delimited list of assemblies.\")\n#endif // defined(ALLOW_SXS_JIT)\n\n#if defined(FEATURE_STACK_SAMPLING)\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StackSamplingEnabled, W(\"StackSamplingEnabled\"), 0, \"Is stack sampling based tracking of evolving hot methods enabled.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StackSamplingAfter, W(\"StackSamplingAfter\"), 0, \"When to start sampling (for some sort of app steady state), i.e., initial delay for sampling start in milliseconds.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StackSamplingEvery, W(\"StackSamplingEvery\"), 100, \"How frequent should thread stacks be sampled in milliseconds.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StackSamplingNumMethods, W(\"StackSamplingNumMethods\"), 32, \"Number of evolving methods to track as hot and JIT them in the background at a given point of execution.\")\n#endif // defined(FEATURE_JIT_SAMPLING)\n\n#if defined(ALLOW_SXS_JIT_NGEN)\nRETAIL_CONFIG_STRING_INFO(INTERNAL_AltJitNgen, W(\"AltJitNgen\"), \"Enables AltJit for NGEN and selectively limits it to the specified methods.\")\n#endif // defined(ALLOW_SXS_JIT_NGEN)\n\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitHostMaxSlabCache, W(\"JitHostMaxSlabCache\"), 0x1000000, \"Sets jit host max slab cache size, 16MB default\")\n\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitOptimizeType, W(\"JitOptimizeType\"), 0 /* OPT_DEFAULT */, \"\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitPrintInlinedMethods, W(\"JitPrintInlinedMethods\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitTelemetry, W(\"JitTelemetry\"), 1, \"If non-zero, gather JIT telemetry data\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogFile, W(\"JitTimeLogFile\"), \"If set, gather JIT throughput data and write to this file.\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_JitTimeLogCsv, W(\"JitTimeLogCsv\"), \"If set, gather JIT throughput data and write to a CSV file. This mode must be used in internal retail builds.\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_JitFuncInfoLogFile, W(\"JitFuncInfoLogFile\"), \"If set, gather JIT function info and write to this file.\")\nCONFIG_DWORD_INFO(INTERNAL_JitVerificationDisable, W(\"JitVerificationDisable\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitLockWrite, W(\"JitLockWrite\"), 0, \"Force all volatile writes to be 'locked'\")\nCONFIG_STRING_INFO(INTERNAL_TailCallMax, W(\"TailCallMax\"), \"\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_TailCallOpt, W(\"TailCallOpt\"), \"\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_TailCallLoopOpt, W(\"TailCallLoopOpt\"), 1, \"Convert recursive tail calls to loops\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_Jit_NetFx40PInvokeStackResilience, W(\"NetFx40_PInvokeStackResilience\"), (DWORD)-1, \"Makes P/Invoke resilient against mismatched signature and calling convention (significant perf penalty).\")\n\n// AltJitAssertOnNYI should be 0 on targets where JIT is under development or bring up stage, so as to facilitate fallback to main JIT on hitting a NYI.\n#if defined(TARGET_X86)\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_AltJitAssertOnNYI, W(\"AltJitAssertOnNYI\"), 0, \"Controls the AltJit behavior of NYI stuff\")\n#else\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_AltJitAssertOnNYI, W(\"AltJitAssertOnNYI\"), 1, \"Controls the AltJit behavior of NYI stuff\")\n#endif\nCONFIG_DWORD_INFO(INTERNAL_JitLargeBranches, W(\"JitLargeBranches\"), 0, \"Force using the largest conditional branch format\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_JitRegisterFP, W(\"JitRegisterFP\"), 3, \"Control FP enregistration\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitELTHookEnabled, W(\"JitELTHookEnabled\"), 0, \"On ARM, setting this will emit Enter/Leave/TailCall callbacks\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitMemStats, W(\"JitMemStats\"), 0, \"Display JIT memory usage statistics\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_JitVNMapSelBudget, W(\"JitVNMapSelBudget\"), 100, \"Max # of MapSelect's considered for a particular top-level invocation.\")\n#if defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64)\n#define EXTERNAL_FeatureSIMD_Default 1\n#else // !(defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64))\n#define EXTERNAL_FeatureSIMD_Default 0\n#endif // !(defined(TARGET_AMD64) || defined(TARGET_X86) || defined(TARGET_ARM64))\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_SIMD16ByteOnly, W(\"SIMD16ByteOnly\"), 0, \"Limit maximum SIMD vector length to 16 bytes (used by x64_arm64_altjit)\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TrackDynamicMethodDebugInfo, W(\"TrackDynamicMethodDebugInfo\"), 0, \"Specifies whether debug info should be generated and tracked for dynamic methods\")\n\n#ifdef FEATURE_MULTICOREJIT\n\nRETAIL_CONFIG_STRING_INFO(INTERNAL_MultiCoreJitProfile, W(\"MultiCoreJitProfile\"), \"If set, use the file to store/control multi-core JIT.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_MultiCoreJitProfileWriteDelay, W(\"MultiCoreJitProfileWriteDelay\"), 12, \"Set the delay after which the multi-core JIT profile will be written to disk.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_MultiCoreJitMinNumCpus, W(\"MultiCoreJitMinNumCpus\"), 2, \"Minimum number of cpus that must be present to allow MultiCoreJit usage.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_MultiCoreJitNoProfileGather, W(\"MultiCoreJitNoProfileGather\"), 0, \"Set to 1 to disable profile gathering (but leave possibly enabled profile usage).\")\n\n#endif\n\n#ifdef FEATURE_INTERPRETER\n///\n/// Interpreter\n///\nRETAIL_CONFIG_STRING_INFO(INTERNAL_Interpret, W(\"Interpret\"), \"Selectively uses the interpreter to execute the specified methods\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_InterpretExclude, W(\"InterpretExclude\"), \"Excludes the specified methods from the set selected by 'Interpret'\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterMethHashMin, W(\"InterpreterMethHashMin\"), 0, \"Only interpret methods selected by 'Interpret' whose hash is at least this value. or after nth\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterMethHashMax, W(\"InterpreterMethHashMax\"), UINT32_MAX, \"If non-zero, only interpret methods selected by 'Interpret' whose hash is at most this value\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterStubMin, W(\"InterpreterStubMin\"), 0, \"Only interpret methods selected by 'Interpret' whose stub num is at least this value.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterStubMax, W(\"InterpreterStubMax\"), UINT32_MAX, \"If non-zero, only interpret methods selected by 'Interpret' whose stub number is at most this value.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterJITThreshold, W(\"InterpreterJITThreshold\"), 10, \"The number of times a method should be interpreted before being JITted\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterDoLoopMethods, W(\"InterpreterDoLoopMethods\"), 0, \"If set, don't check for loops, start by interpreting *all* methods\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterUseCaching, W(\"InterpreterUseCaching\"), 1, \"If non-zero, use the caching mechanism.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterLooseRules, W(\"InterpreterLooseRules\"), 1, \"If non-zero, allow ECMA spec violations required by managed C++.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterPrintPostMortem, W(\"InterpreterPrintPostMortem\"), 0, \"Prints summary information about the execution to the console\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_InterpreterLogFile, W(\"InterpreterLogFile\"), \"If non-null, append interpreter logging to this file, else use stdout\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_DumpInterpreterStubs, W(\"DumpInterpreterStubs\"), 0, \"Prints all interpreter stubs that are created to the console\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TraceInterpreterEntries, W(\"TraceInterpreterEntries\"), 0, \"Logs entries to interpreted methods to the console\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TraceInterpreterIL, W(\"TraceInterpreterIL\"), 0, \"Logs individual instructions of interpreted methods to the console\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TraceInterpreterOstack, W(\"TraceInterpreterOstack\"), 0, \"Logs operand stack after each IL instruction of interpreted methods to the console\")\nCONFIG_DWORD_INFO(INTERNAL_TraceInterpreterVerbose, W(\"TraceInterpreterVerbose\"), 0, \"Logs interpreter progress with detailed messages to the console\")\nCONFIG_DWORD_INFO(INTERNAL_TraceInterpreterJITTransition, W(\"TraceInterpreterJITTransition\"), 0, \"Logs when the interpreter determines a method should be JITted\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ForceInterpreter, W(\"ForceInterpreter\"), 0, \"If non-zero, force the interpreter to be used\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterHWIntrinsicsIsSupportedFalse, W(\"InterpreterHWIntrinsicsIsSupportedFalse\"), 0, \"If non-zero, force get_IsSupported to return false for hardware intrinsics\") // for internal testing purposes\n#endif\n// The JIT queries this ConfigDWORD but it doesn't know if FEATURE_INTERPRETER is enabled\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_InterpreterFallback, W(\"InterpreterFallback\"), 0, \"Fallback to the interpreter when the JIT compiler fails\")\n\n///\n/// Loader heap\n///\nCONFIG_DWORD_INFO(INTERNAL_LoaderHeapCallTracing, W(\"LoaderHeapCallTracing\"), 0, \"Loader heap troubleshooting\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_CodeHeapReserveForJumpStubs, W(\"CodeHeapReserveForJumpStubs\"), 1, \"Percentage of code heap to reserve for jump stubs\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_BreakOnOutOfMemoryWithinRange, W(\"BreakOnOutOfMemoryWithinRange\"), 0, \"Break before out of memory within range exception is thrown\")\n\n///\n/// Log\n///\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_LogEnable, W(\"LogEnable\"), 0, \"Turns on the traditional CLR log.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_LogFacility,  W(\"LogFacility\"), 0, \"Specifies a facility mask for CLR log. (See 'loglf.h'; VM interprets string value as hex number.) Also used by stresslog.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_LogFacility2, W(\"LogFacility2\"), 0, \"Specifies a facility mask for CLR log. (See 'loglf.h'; VM interprets string value as hex number.) Also used by stresslog.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_logFatalError, W(\"logFatalError\"), 1, \"Specifies whether EventReporter logs fatal errors in the Windows event log.\")\nCONFIG_STRING_INFO(INTERNAL_LogFile, W(\"LogFile\"), \"Specifies a file name for the CLR log.\")\nCONFIG_DWORD_INFO(INTERNAL_LogFileAppend, W(\"LogFileAppend\"), 0 , \"Specifies whether to append to or replace the CLR log file.\")\nCONFIG_DWORD_INFO(INTERNAL_LogFlushFile, W(\"LogFlushFile\"), 0 , \"Specifies whether to flush the CLR log file on each write.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_LogLevel, W(\"LogLevel\"), 0 , \"4=10 msgs, 9=1000000, 10=everything\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_LogToConsole, W(\"LogToConsole\"), 0 , \"Writes the CLR log to console.\")\nCONFIG_DWORD_INFO(INTERNAL_LogToDebugger, W(\"LogToDebugger\"), 0 , \"Writes the CLR log to debugger (OutputDebugStringA).\")\nCONFIG_DWORD_INFO(INTERNAL_LogToFile, W(\"LogToFile\"), 0 , \"Writes the CLR log to a file.\")\nCONFIG_DWORD_INFO(INTERNAL_LogWithPid, W(\"LogWithPid\"), FALSE, \"Appends pid to filename for the CLR log.\")\n\n///\n/// MetaData\n///\nCONFIG_DWORD_INFO(INTERNAL_MD_ApplyDeltaBreak, W(\"MD_ApplyDeltaBreak\"), 0, \"ASSERT when applying EnC\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_AssertOnBadImageFormat, W(\"AssertOnBadImageFormat\"), 0, \"ASSERT when invalid MD read\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_MD_DeltaCheck, W(\"MD_DeltaCheck\"), 1, \"Some checks of GUID when applying EnC (?)\")\nCONFIG_DWORD_INFO(INTERNAL_MD_EncDelta, W(\"MD_EncDelta\"), 0, \"Forces EnC Delta format in MD (?)\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_MD_ForceNoColDesSharing, W(\"MD_ForceNoColDesSharing\"), 0, \"Don't know - the only usage I could find is #if 0 (?)\")\nCONFIG_DWORD_INFO(INTERNAL_MD_KeepKnownCA, W(\"MD_KeepKnownCA\"), 0, \"Something with known CAs (?)\")\nCONFIG_DWORD_INFO(INTERNAL_MD_MiniMDBreak, W(\"MD_MiniMDBreak\"), 0, \"ASSERT when creating CMiniMdRw class\")\nCONFIG_DWORD_INFO(INTERNAL_MD_PreSaveBreak, W(\"MD_PreSaveBreak\"), 0, \"ASSERT when calling CMiniMdRw::PreSave\")\nCONFIG_DWORD_INFO(INTERNAL_MD_RegMetaBreak, W(\"MD_RegMetaBreak\"), 0, \"ASSERT when creating RegMeta class\")\nCONFIG_DWORD_INFO(INTERNAL_MD_RegMetaDump, W(\"MD_RegMetaDump\"), 0, \"Dump MD in 4 functions (?)\")\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_MODIFIABLE_ASSEMBLIES, W(\"MODIFIABLE_ASSEMBLIES\"), \"Enables hot reload on debug built assemblies with the 'debug' keyword\", CLRConfig::LookupOptions::TrimWhiteSpaceFromStringValue);\n\n// Metadata - mscordbi only - this flag is only intended to mitigate potential issues in bug fix 458597.\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_MD_PreserveDebuggerMetadataMemory, W(\"MD_PreserveDebuggerMetadataMemory\"), 0, \"Save all versions of metadata memory in the debugger when debuggee metadata is updated\")\n\n///\n/// Spinning heuristics\n///\n// Note that these only take effect once the runtime has been started; prior to that the values hardcoded in g_SpinConstants (vars.cpp) are used\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinInitialDuration, W(\"SpinInitialDuration\"), 0x32, \"Hex value specifying the first spin duration\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinBackoffFactor, W(\"SpinBackoffFactor\"), 0x3, \"Hex value specifying the growth of each successive spin duration\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinLimitProcCap, W(\"SpinLimitProcCap\"), 0xFFFFFFFF, \"Hex value specifying the largest value of NumProcs to use when calculating the maximum spin duration\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinLimitProcFactor, W(\"SpinLimitProcFactor\"), 0x4E20, \"Hex value specifying the multiplier on NumProcs to use when calculating the maximum spin duration\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinLimitConstant, W(\"SpinLimitConstant\"), 0x0, \"Hex value specifying the constant to add when calculating the maximum spin duration\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_SpinRetryCount, W(\"SpinRetryCount\"), 0xA, \"Hex value specifying the number of times the entire spin process is repeated (when applicable)\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_Monitor_SpinCount, W(\"Monitor_SpinCount\"), 0x1e, \"Hex value specifying the maximum number of spin iterations Monitor may perform upon contention on acquiring the lock before waiting.\")\n\n///\n/// Native Binder\n///\n\nCONFIG_DWORD_INFO(INTERNAL_SymDiffDump, W(\"SymDiffDump\"), 0, \"Used to create the map file while binding the assembly. Used by SemanticDiffer\")\n\n///\n/// Profiling API / ETW\n///\nRETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_CORECLR_ENABLE_PROFILING, W(\"CORECLR_ENABLE_PROFILING\"), 0, \"CoreCLR only: Flag to indicate whether profiling should be enabled for the currently running process.\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER, W(\"CORECLR_PROFILER\"), \"CoreCLR only: Specifies GUID of profiler to load into currently running process\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH, W(\"CORECLR_PROFILER_PATH\"), \"CoreCLR only: Specifies the path to the DLL of profiler to load into currently running process\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_32, W(\"CORECLR_PROFILER_PATH_32\"), \"CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 32 process\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_64, W(\"CORECLR_PROFILER_PATH_64\"), \"CoreCLR only: Specifies the path to the DLL of profiler to load into currently running 64 process\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_ARM32, W(\"CORECLR_PROFILER_PATH_ARM32\"), \"CoreCLR only: Specifies the path to the DLL of profiler to load into currently running ARM32 process\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_PROFILER_PATH_ARM64, W(\"CORECLR_PROFILER_PATH_ARM64\"), \"CoreCLR only: Specifies the path to the DLL of profiler to load into currently running ARM64 process\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_CORECLR_ENABLE_NOTIFICATION_PROFILERS, W(\"CORECLR_ENABLE_NOTIFICATION_PROFILERS\"), 0, \"Set to 0 to disable loading notification profilers.\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_NOTIFICATION_PROFILERS, W(\"CORECLR_NOTIFICATION_PROFILERS\"), \"A semi-colon separated list of notification profilers to load into currently running process in the form \\\"path={guid}\\\"\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_NOTIFICATION_PROFILERS_32, W(\"CORECLR_NOTIFICATION_PROFILERS_32\"), \"A semi-colon separated list of notification profilers to load into currently running 32 process in the form \\\"path={guid}\\\"\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_NOTIFICATION_PROFILERS_64, W(\"CORECLR_NOTIFICATION_PROFILERS_64\"), \"A semi-colon separated list of notification profilers to load into currently running 64 process in the form \\\"path={guid}\\\"\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_NOTIFICATION_PROFILERS_ARM32, W(\"CORECLR_NOTIFICATION_PROFILERS_ARM32\"), \"A semi-colon separated list of notification profilers to load into currently running ARM32 process in the form \\\"path={guid}\\\"\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_CORECLR_NOTIFICATION_PROFILERS_ARM64, W(\"CORECLR_NOTIFICATION_PROFILERS_ARM64\"), \"A semi-colon separated list of notification profilers to load into currently running ARM64 process in the form \\\"path={guid}\\\"\", CLRConfig::LookupOptions::DontPrependPrefix)\nRETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_ProfAPI_ProfilerCompatibilitySetting, W(\"ProfAPI_ProfilerCompatibilitySetting\"), \"Specifies the profiler loading policy (the default is not to load a V2 profiler in V4)\", CLRConfig::LookupOptions::TrimWhiteSpaceFromStringValue)\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_DetachMinSleepMs, W(\"ProfAPI_DetachMinSleepMs\"), 0, \"The minimum time, in milliseconds, the CLR will wait before checking whether a profiler that is in the process of detaching is ready to be unloaded.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_DetachMaxSleepMs, W(\"ProfAPI_DetachMaxSleepMs\"), 0, \"The maximum time, in milliseconds, the CLR will wait before checking whether a profiler that is in the process of detaching is ready to be unloaded.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_RejitOnAttach, W(\"ProfApi_RejitOnAttach\"), 1, \"Enables the ability for profilers to rejit methods on attach.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_ProfAPI_InliningTracking, W(\"ProfApi_InliningTracking\"), 1, \"Enables the runtime's tracking of inlining for profiler ReJIT.\")\nCONFIG_DWORD_INFO(INTERNAL_ProfAPI_EnableRejitDiagnostics, W(\"ProfAPI_EnableRejitDiagnostics\"), 0, \"Enable extra dumping to stdout of rejit structures\")\nCONFIG_DWORD_INFO(INTERNAL_ProfAPIFault, W(\"ProfAPIFault\"), 0, \"Test-only bitmask to inject various types of faults in the profapi code\")\nCONFIG_DWORD_INFO(INTERNAL_TestOnlyAllowedEventMask, W(\"TestOnlyAllowedEventMask\"), 0, \"Test-only bitmask to allow profiler tests to override CLR enforcement of COR_PRF_ALLOWABLE_AFTER_ATTACH and COR_PRF_MONITOR_IMMUTABLE\")\nCONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableICorProfilerInfo, W(\"ProfAPI_TestOnlyEnableICorProfilerInfo\"), 0, \"Test-only flag to allow attaching profiler tests to call ICorProfilerInfo interface, which would otherwise be disallowed for attaching profilers\")\nCONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableObjectAllocatedHook, W(\"TestOnlyEnableObjectAllocatedHook\"), 0, \"Test-only flag that forces CLR to initialize on startup as if ObjectAllocated callback were requested, to enable post-attach ObjectAllocated functionality.\")\nCONFIG_DWORD_INFO(INTERNAL_TestOnlyEnableSlowELTHooks, W(\"TestOnlyEnableSlowELTHooks\"), 0, \"Test-only flag that forces CLR to initialize on startup as if slow-ELT were requested, to enable post-attach ELT functionality.\")\n\nRETAIL_CONFIG_STRING_INFO(UNSUPPORTED_ETW_ObjectAllocationEventsPerTypePerSec, W(\"ETW_ObjectAllocationEventsPerTypePerSec\"), \"Desired number of GCSampledObjectAllocation ETW events to be logged per type per second.  If 0, then the default built in to the implementation for the enabled event (e.g., High, Low), will be used.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ProfAPI_ValidateNGENInstrumentation, W(\"ProfAPI_ValidateNGENInstrumentation\"), 0, \"This flag enables additional validations when using the IMetaDataEmit APIs for NGEN'ed images to ensure only supported edits are made.\")\n\n#ifdef FEATURE_PERFMAP\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapEnabled, W(\"PerfMapEnabled\"), 0, \"This flag is used on Linux to enable writing /tmp/perf-$pid.map. It is disabled by default\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_PerfMapJitDumpPath, W(\"PerfMapJitDumpPath\"), \"Specifies a path to write the perf jitdump file. Defaults to GetTempPathA()\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapIgnoreSignal, W(\"PerfMapIgnoreSignal\"), 0, \"When perf map is enabled, this option will configure the specified signal to be accepted and ignored as a marker in the perf logs.  It is disabled by default\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_PerfMapShowOptimizationTiers, W(\"PerfMapShowOptimizationTiers\"), 1, \"Shows optimization tiers in the perf map for methods, as part of the symbol name. Useful for seeing separate stack frames for different optimization tiers of each method.\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_NativeImagePerfMapFormat, W(\"NativeImagePerfMapFormat\"), \"Specifies the format of native image perfmap files generated by crossgen.  Valid options are RVA or OFFSET.\")\n#endif\n\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_StartupDelayMS, W(\"StartupDelayMS\"), \"\")\n\n///\n/// Stress\n///\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StressLog, W(\"StressLog\"), 0, \"Turns on the stress log.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_ForceEnc, W(\"ForceEnc\"), 0, \"Forces Edit and Continue to be on for all eligible modules.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_StressLogSize, W(\"StressLogSize\"), 0, \"Stress log size in bytes per thread.\")\nRETAIL_CONFIG_STRING_INFO(UNSUPPORTED_StressLogFilename, W(\"StressLogFilename\"), \"Stress log filename for memory mapped stress log.\")\nCONFIG_DWORD_INFO(INTERNAL_stressSynchronized, W(\"stressSynchronized\"), 0, \"Unknown if or where this is used; unless a test is specifically depending on this, it can be removed.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TotalStressLogSize, W(\"TotalStressLogSize\"), 0, \"Total stress log size in bytes.\")\n\n///\n/// Thread Suspend\n///\nCONFIG_DWORD_INFO(INTERNAL_DiagnosticSuspend, W(\"DiagnosticSuspend\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_SuspendDeadlockTimeout, W(\"SuspendDeadlockTimeout\"), 40000, \"\")\nCONFIG_DWORD_INFO(INTERNAL_SuspendThreadDeadlockTimeoutMs, W(\"SuspendThreadDeadlockTimeoutMs\"), 2000, \"\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadSuspendInjection, W(\"INTERNAL_ThreadSuspendInjection\"), 1, \"Specifies whether to inject activations for thread suspension on Unix\")\n\n///\n/// Thread (miscellaneous)\n///\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_DefaultStackSize, W(\"DefaultStackSize\"), 0, \"Stack size to use for new VM threads when thread is created with default stack size (dwStackSize == 0).\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_Thread_DeadThreadCountThresholdForGCTrigger, W(\"Thread_DeadThreadCountThresholdForGCTrigger\"), 75, \"In the heuristics to clean up dead threads, this threshold must be reached before triggering a GC will be considered. Set to 0 to disable triggering a GC based on dead threads.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_Thread_DeadThreadGCTriggerPeriodMilliseconds, W(\"Thread_DeadThreadGCTriggerPeriodMilliseconds\"), 1000 * 60 * 30, \"In the heuristics to clean up dead threads, this much time must have elapsed since the previous max-generation GC before triggering another GC will be considered\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_Thread_UseAllCpuGroups, W(\"Thread_UseAllCpuGroups\"), 0, \"Specifies whether to query and use CPU group information for determining the processor count.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_Thread_AssignCpuGroups, W(\"Thread_AssignCpuGroups\"), 1, \"Specifies whether to automatically distribute threads created by the CLR across CPU Groups. Effective only when Thread_UseAllCpuGroups and GCCpuGroup are enabled.\")\nRETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_ProcessorCount, W(\"PROCESSOR_COUNT\"), 0, \"Specifies the number of processors available for the process, which is returned by Environment.ProcessorCount\", CLRConfig::LookupOptions::ParseIntegerAsBase10)\n\n///\n/// Threadpool\n///\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_ForceMinWorkerThreads, W(\"ThreadPool_ForceMinWorkerThreads\"), 0, \"Overrides the MinThreads setting for the ThreadPool worker pool\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_ForceMaxWorkerThreads, W(\"ThreadPool_ForceMaxWorkerThreads\"), 0, \"Overrides the MaxThreads setting for the ThreadPool worker pool\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_DisableStarvationDetection, W(\"ThreadPool_DisableStarvationDetection\"), 0, \"Disables the ThreadPool feature that forces new threads to be added when workitems run for too long\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_DebugBreakOnWorkerStarvation, W(\"ThreadPool_DebugBreakOnWorkerStarvation\"), 0, \"Breaks into the debugger if the ThreadPool detects work queue starvation\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_EnableWorkerTracking, W(\"ThreadPool_EnableWorkerTracking\"), 0, \"Enables extra expensive tracking of how many workers threads are working simultaneously\")\n#ifdef TARGET_ARM64\n// Spinning scheme is currently different on ARM64\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W(\"ThreadPool_UnfairSemaphoreSpinLimit\"), 0x32, \"Maximum number of spins per processor a thread pool worker thread performs before waiting for work\")\n#else // !TARGET_ARM64\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ThreadPool_UnfairSemaphoreSpinLimit, W(\"ThreadPool_UnfairSemaphoreSpinLimit\"), 0x46, \"Maximum number of spins a thread pool worker thread performs before waiting for work\")\n#endif // TARGET_ARM64\n\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_Disable,                             W(\"HillClimbing_Disable\"),                            0, \"Disables hill climbing for thread adjustments in the thread pool\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_WavePeriod,                          W(\"HillClimbing_WavePeriod\"),                         4, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_TargetSignalToNoiseRatio,            W(\"HillClimbing_TargetSignalToNoiseRatio\"),           300, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_ErrorSmoothingFactor,                W(\"HillClimbing_ErrorSmoothingFactor\"),               1, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_WaveMagnitudeMultiplier,             W(\"HillClimbing_WaveMagnitudeMultiplier\"),            100, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_MaxWaveMagnitude,                    W(\"HillClimbing_MaxWaveMagnitude\"),                   20, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_WaveHistorySize,                     W(\"HillClimbing_WaveHistorySize\"),                    8, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_Bias,                                W(\"HillClimbing_Bias\"),                               15, \"The 'cost' of a thread.  0 means drive for increased throughput regardless of thread count; higher values bias more against higher thread counts.\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_MaxChangePerSecond,                  W(\"HillClimbing_MaxChangePerSecond\"),                 4, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_MaxChangePerSample,                  W(\"HillClimbing_MaxChangePerSample\"),                 20, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_MaxSampleErrorPercent,               W(\"HillClimbing_MaxSampleErrorPercent\"),              15, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_SampleIntervalLow,                   W(\"HillClimbing_SampleIntervalLow\"),                  10, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_SampleIntervalHigh,                  W(\"HillClimbing_SampleIntervalHigh\"),                 200, \"\");\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_HillClimbing_GainExponent,                        W(\"HillClimbing_GainExponent\"),                       200, \"The exponent to apply to the gain, times 100.  100 means to use linear gain, higher values will enhance large moves and damp small ones.\");\n\n///\n/// Tiered Compilation\n///\n#ifdef FEATURE_TIERED_COMPILATION\n#ifdef _DEBUG\n// Use lower values to exercise more paths sooner\n#define TC_BackgroundWorkerTimeoutMs (100)\n#define TC_CallCountThreshold (2)\n#define TC_CallCountingDelayMs (1)\n#define TC_DelaySingleProcMultiplier (2)\n#else // !_DEBUG\n#define TC_BackgroundWorkerTimeoutMs (4000)\n#define TC_CallCountThreshold (30)\n#define TC_CallCountingDelayMs (100)\n#define TC_DelaySingleProcMultiplier (10)\n#endif // _DEBUG\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_TieredCompilation, W(\"TieredCompilation\"), 1, \"Enables tiered compilation\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_TC_QuickJit, W(\"TC_QuickJit\"), 1, \"For methods that would be jitted, enable using quick JIT when appropriate.\")\n#if defined(TARGET_AMD64) || defined(TARGET_ARM64)\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TC_QuickJitForLoops, W(\"TC_QuickJitForLoops\"), 1, \"When quick JIT is enabled, quick JIT may also be used for methods that contain loops.\")\n#else // !(defined(TARGET_AMD64) || defined(TARGET_ARM64))\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TC_QuickJitForLoops, W(\"TC_QuickJitForLoops\"), 0, \"When quick JIT is enabled, quick JIT may also be used for methods that contain loops.\")\n#endif // defined(TARGET_AMD64) || defined(TARGET_ARM64)\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_TC_AggressiveTiering, W(\"TC_AggressiveTiering\"), 0, \"Transition through tiers aggressively.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_BackgroundWorkerTimeoutMs, W(\"TC_BackgroundWorkerTimeoutMs\"), TC_BackgroundWorkerTimeoutMs, \"How long in milliseconds the background worker thread may remain idle before exiting.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_CallCountThreshold, W(\"TC_CallCountThreshold\"), TC_CallCountThreshold, \"Number of times a method must be called in tier 0 after which it is promoted to the next tier.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_CallCountingDelayMs, W(\"TC_CallCountingDelayMs\"), TC_CallCountingDelayMs, \"A perpetual delay in milliseconds that is applied to call counting in tier 0 and jitting at higher tiers, while there is startup-like activity.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_DelaySingleProcMultiplier, W(\"TC_DelaySingleProcMultiplier\"), TC_DelaySingleProcMultiplier, \"Multiplier for TC_CallCountingDelayMs that is applied on a single-processor machine or when the process is affinitized to a single processor.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_CallCounting, W(\"TC_CallCounting\"), 1, \"Enabled by default (only activates when TieredCompilation is also enabled). If disabled immediately backpatches prestub, and likely prevents any promotion to higher tiers\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_UseCallCountingStubs, W(\"TC_UseCallCountingStubs\"), 1, \"Uses call counting stubs for faster call counting.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_TC_DeleteCallCountingStubsAfter, W(\"TC_DeleteCallCountingStubsAfter\"), 0, \"Deletes call counting stubs after this many have completed. Zero to disable deleting.\")\n#undef TC_BackgroundWorkerTimeoutMs\n#undef TC_CallCountThreshold\n#undef TC_CallCountingDelayMs\n#undef TC_DelaySingleProcMultiplier\n#undef TC_DeleteCallCountingStubsAfter\n#endif // FEATURE_TIERED_COMPILATION\n\n///\n/// On-Stack Replacement\n///\n#ifdef FEATURE_ON_STACK_REPLACEMENT\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_OSR_CounterBump, W(\"OSR_CounterBump\"), 1000, \"Counter reload value when a patchpoint is hit\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_OSR_HitLimit, W(\"OSR_HitLimit\"), 10, \"Number of times a patchpoint must call back to trigger an OSR transition\")\nCONFIG_DWORD_INFO(INTERNAL_OSR_LowId, W(\"OSR_LowId\"), (DWORD)-1, \"Low end of enabled patchpoint range (inclusive)\");\nCONFIG_DWORD_INFO(INTERNAL_OSR_HighId, W(\"OSR_HighId\"), 10000000, \"High end of enabled patchpoint range (inclusive)\");\n#endif\n\n///\n/// Profile Guided Opts\n///\n#ifdef FEATURE_PGO\nRETAIL_CONFIG_STRING_INFO(INTERNAL_PGODataPath, W(\"PGODataPath\"), \"Read/Write PGO data from/to the indicated file.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_ReadPGOData, W(\"ReadPGOData\"), 0, \"Read PGO data\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_WritePGOData, W(\"WritePGOData\"), 0, \"Write PGO data\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_TieredPGO, W(\"TieredPGO\"), 0, \"Instrument Tier0 code and make counts available to Tier1\")\n\n// TieredPGO_InstrumentOnlyHotCode values:\n//\n// 0) Instrument all IL-only code, R2R'd code is never instrumented\n// 1) Instrument only hot IL-only and hot R2R code (use optimizations in the instrumented tier for hot R2R and no optimizations for hot IL-only)\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TieredPGO_InstrumentOnlyHotCode, W(\"TieredPGO_InstrumentOnlyHotCode\"), 1, \"Strategy for TieredPGO, see comments in clrconfigvalues.h\")\n#endif\n\n///\n/// Entry point slot backpatch\n///\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_BackpatchEntryPointSlots, W(\"BackpatchEntryPointSlots\"), 1, \"Indicates whether to enable entry point slot backpatching, for instance to avoid making virtual calls through a precode and instead to patch virtual slots for a method when its entry point changes.\")\n\n///\n/// TypeLoader\n///\nCONFIG_DWORD_INFO(INTERNAL_TypeLoader_InjectInterfaceDuplicates, W(\"INTERNAL_TypeLoader_InjectInterfaceDuplicates\"), 0, \"Injects duplicates in interface map for all types.\")\n\n///\n/// Virtual call stubs\n///\nCONFIG_DWORD_INFO(INTERNAL_VirtualCallStubCollideMonoPct, W(\"VirtualCallStubCollideMonoPct\"), 0, \"Used only when STUB_LOGGING is defined, which by default is not.\")\nCONFIG_DWORD_INFO(INTERNAL_VirtualCallStubCollideWritePct, W(\"VirtualCallStubCollideWritePct\"), 100, \"Used only when STUB_LOGGING is defined, which by default is not.\")\nCONFIG_DWORD_INFO(INTERNAL_VirtualCallStubDumpLogCounter, W(\"VirtualCallStubDumpLogCounter\"), 0, \"Used only when STUB_LOGGING is defined, which by default is not.\")\nCONFIG_DWORD_INFO(INTERNAL_VirtualCallStubDumpLogIncr, W(\"VirtualCallStubDumpLogIncr\"), 0, \"Used only when STUB_LOGGING is defined, which by default is not.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_VirtualCallStubLogging, W(\"VirtualCallStubLogging\"), 0, \"Worth keeping, but should be moved into \\\"#ifdef STUB_LOGGING\\\" blocks. This goes for most (or all) of the stub logging infrastructure.\")\nCONFIG_DWORD_INFO(INTERNAL_VirtualCallStubMissCount, W(\"VirtualCallStubMissCount\"), 100, \"Used only when STUB_LOGGING is defined, which by default is not.\")\nCONFIG_DWORD_INFO(INTERNAL_VirtualCallStubResetCacheCounter, W(\"VirtualCallStubResetCacheCounter\"), 0, \"Used only when STUB_LOGGING is defined, which by default is not.\")\nCONFIG_DWORD_INFO(INTERNAL_VirtualCallStubResetCacheIncr, W(\"VirtualCallStubResetCacheIncr\"), 0, \"Used only when STUB_LOGGING is defined, which by default is not.\")\n\n///\n/// Watson\n///\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_DisableWatsonForManagedExceptions, W(\"DisableWatsonForManagedExceptions\"), 0, \"Disable Watson and debugger launching for managed exceptions\")\n\n///\n/// Dump generation\n///\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgEnableMiniDump, W(\"DbgEnableMiniDump\"), 0, \"Enable unhandled exception crash dump generation\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_DbgMiniDumpName, W(\"DbgMiniDumpName\"), \"Crash dump name\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_DbgMiniDumpType, W(\"DbgMiniDumpType\"), 0, \"Crash dump type: 1 normal, 2 withheap, 3 triage, 4 full\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_CreateDumpDiagnostics, W(\"CreateDumpDiagnostics\"), 0, \"Enable crash dump generation diagnostic logging\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EnableDumpOnSigTerm, W(\"EnableDumpOnSigTerm\"), 0, \"Enable crash dump generation on SIGTERM\")\n\n///\n/// Zap\n///\nRETAIL_CONFIG_STRING_INFO(INTERNAL_ZapBBInstr, W(\"ZapBBInstr\"), \"\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_ZapBBInstrDir, W(\"ZapBBInstrDir\"), \"\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_ZapDisable, W(\"ZapDisable\"), 0, \"\")\n\nRETAIL_CONFIG_STRING_INFO(INTERNAL_NativeImageSearchPaths, W(\"NativeImageSearchPaths\"), \"Extra search paths for native composite R2R images\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_ReadyToRun, W(\"ReadyToRun\"), 1, \"Enable/disable use of ReadyToRun native code\") // On by default for CoreCLR\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_ReadyToRunExcludeList, W(\"ReadyToRunExcludeList\"), \"List of assemblies that cannot use Ready to Run images\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_ReadyToRunLogFile, W(\"ReadyToRunLogFile\"), \"Name of file to log success/failure of using Ready to Run images\")\n\n#if defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableEventLog, W(\"EnableEventLog\"), 0, \"Enable/disable use of EnableEventLogging mechanism \") // Off by default\nRETAIL_CONFIG_STRING_INFO(INTERNAL_EventSourceFilter, W(\"EventSourceFilter\"), \"\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_EventNameFilter, W(\"EventNameFilter\"), \"\")\n#endif //defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT)\n\n///\n/// Interop\n///\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_InteropValidatePinnedObjects, W(\"InteropValidatePinnedObjects\"), 0, \"After returning from a managed-to-unmanaged interop call, validate GC heap around objects pinned by IL stubs.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_InteropLogArguments, W(\"InteropLogArguments\"), 0, \"Log all pinned arguments passed to an interop call\")\nRETAIL_CONFIG_STRING_INFO(UNSUPPORTED_LogCCWRefCountChange, W(\"LogCCWRefCountChange\"), \"Outputs debug information and calls LogCCWRefCountChange_BREAKPOINT when AddRef or Release is called on a CCW.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EnableRCWCleanupOnSTAShutdown, W(\"EnableRCWCleanupOnSTAShutdown\"), 0, \"Performs RCW cleanup when STA shutdown is detected using IInitializeSpy in classic processes.\")\n\n//\n// EventPipe\n//\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EnableEventPipe, W(\"EnableEventPipe\"), 0, \"Enable/disable event pipe.  Non-zero values enable tracing.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeNetTraceFormat, W(\"EventPipeNetTraceFormat\"), 1, \"Enable/disable using the newer nettrace file format.\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_EventPipeOutputPath, W(\"EventPipeOutputPath\"), \"The full path excluding file name for the trace file that will be written when DOTNET_EnableEventPipe=1\")\nRETAIL_CONFIG_STRING_INFO(INTERNAL_EventPipeConfig, W(\"EventPipeConfig\"), \"Configuration for EventPipe.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeRundown, W(\"EventPipeRundown\"), 1, \"Enable/disable eventpipe rundown.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeCircularMB, W(\"EventPipeCircularMB\"), 1024, \"The EventPipe circular buffer size in megabytes.\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeProcNumbers, W(\"EventPipeProcNumbers\"), 0, \"Enable/disable capturing processor numbers in EventPipe event headers\")\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeOutputStreaming, W(\"EventPipeOutputStreaming\"), 0, \"Enable/disable streaming for trace file set in DOTNET_EventPipeOutputPath.  Non-zero values enable streaming.\")\n\n#ifdef FEATURE_AUTO_TRACE\nRETAIL_CONFIG_DWORD_INFO_EX(INTERNAL_AutoTrace_N_Tracers, W(\"AutoTrace_N_Tracers\"), 0, \"\", CLRConfig::LookupOptions::ParseIntegerAsBase10)\nRETAIL_CONFIG_STRING_INFO(INTERNAL_AutoTrace_Command, W(\"AutoTrace_Command\"), \"\")\n#endif // FEATURE_AUTO_TRACE\n\n//\n// Generational Aware Analysis\n//\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCGenAnalysisGen, W(\"GCGenAnalysisGen\"), 0, \"The generation to trigger generational aware analysis\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCGenAnalysisBytes, W(\"GCGenAnalysisBytes\"), 0, \"The number of bytes to trigger generational aware analysis\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCGenAnalysisTimeUSec, W(\"GCGenAnalysisTimeUSec\"), 0, \"The number of microseconds to trigger generational aware analysis\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCGenAnalysisTimeMSec, W(\"GCGenAnalysisTimeMSec\"), 0, \"The number of milliseconds to trigger generational aware analysis\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCGenAnalysisIndex, W(\"GCGenAnalysisIndex\"), 0, \"The gc index to trigger generational aware analysis\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_GCGenAnalysisCmd, W(\"GCGenAnalysisCmd\"), \"An optional filter to match with the command line used to spawn the process\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCGenAnalysisTrace, W(\"GCGenAnalysisTrace\"), 1, \"Enable/Disable capturing a trace\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_GCGenAnalysisDump, W(\"GCGenAnalysisDump\"), 0, \"Enable/Disable capturing a dump\")\n\n//\n// Diagnostics Ports\n//\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_DOTNET_DefaultDiagnosticPortSuspend, W(\"DefaultDiagnosticPortSuspend\"), 0, \"This sets the deafult diagnostic port to suspend causing the runtime to pause during startup before major subsystems are started.  Resume using the Diagnostics IPC ResumeStartup command on the default diagnostic port.\");\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_DOTNET_DiagnosticPorts, W(\"DiagnosticPorts\"), \"A semicolon delimited list of additional Diagnostic Ports, where a Diagnostic Port is a NamedPipe path without '\\\\\\\\.\\\\pipe\\\\' on Windows or the full path of Unix Domain Socket on Linux/Unix followed by optional tags, e.g., '<path>,connect,nosuspend;<path>'\");\n\n//\n// LTTng\n//\nRETAIL_CONFIG_STRING_INFO(INTERNAL_LTTngConfig, W(\"LTTngConfig\"), \"Configuration for LTTng.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_LTTng, W(\"LTTng\"), 1, \"If DOTNET_LTTng is set to 0, this will prevent the LTTng library from being loaded at runtime\")\n\n//\n// Executable code\n//\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableWriteXorExecute, W(\"EnableWriteXorExecute\"), 1, \"Enable W^X for executable memory.\");\n\n#ifdef FEATURE_GDBJIT\n///\n/// GDBJIT\n///\nCONFIG_STRING_INFO(INTERNAL_GDBJitElfDump, W(\"GDBJitElfDump\"), \"Dump ELF for specified method\")\n#ifdef FEATURE_GDBJIT_FRAME\nRETAIL_CONFIG_DWORD_INFO(INTERNAL_GDBJitEmitDebugFrame, W(\"GDBJitEmitDebugFrame\"), TRUE, \"Enable .debug_frame generation\")\n#endif\n#endif\n\n//\n// Hardware Intrinsic ISAs; keep in sync with jitconfigvalues.h\n//\n#if defined(TARGET_LOONGARCH64)\n//TODO: should implement LoongArch64's features.\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableHWIntrinsic,  W(\"EnableHWIntrinsic\"),  0, \"Allows Base+ hardware intrinsics to be disabled\")\n#else\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableHWIntrinsic,  W(\"EnableHWIntrinsic\"),  1, \"Allows Base+ hardware intrinsics to be disabled\")\n#endif // defined(TARGET_LOONGARCH64)\n\n#if defined(TARGET_AMD64) || defined(TARGET_X86)\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAES,          W(\"EnableAES\"),          1, \"Allows AES+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX,          W(\"EnableAVX\"),          1, \"Allows AVX+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX2,         W(\"EnableAVX2\"),         1, \"Allows AVX2+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512BW,     W(\"EnableAVX512BW\"),     1, \"Allows AVX512BW+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512BW_VL,  W(\"EnableAVX512BW_VL\"),  1, \"Allows AVX512BW_VL+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512CD,     W(\"EnableAVX512CD\"),     1, \"Allows AVX512CD+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512CD_VL,  W(\"EnableAVX512CD_VL\"),  1, \"Allows AVX512CD_VL+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512DQ,     W(\"EnableAVX512DQ\"),     1, \"Allows AVX512DQ+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512DQ_VL,  W(\"EnableAVX512DQ_VL\"),  1, \"Allows AVX512DQ_VL+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512F,      W(\"EnableAVX512F\"),      1, \"Allows AVX512F+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVX512F_VL,   W(\"EnableAVX512F_VL\"),   1, \"Allows AVX512F_VL+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableAVXVNNI,      W(\"EnableAVXVNNI\"),      1, \"Allows AVX VNNI+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableBMI1,         W(\"EnableBMI1\"),         1, \"Allows BMI1+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableBMI2,         W(\"EnableBMI2\"),         1, \"Allows BMI2+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableFMA,          W(\"EnableFMA\"),          1, \"Allows FMA+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableLZCNT,        W(\"EnableLZCNT\"),        1, \"Allows LZCNT+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnablePCLMULQDQ,    W(\"EnablePCLMULQDQ\"),    1, \"Allows PCLMULQDQ+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableMOVBE,        W(\"EnableMOVBE\"),        1, \"Allows MOVBE+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnablePOPCNT,       W(\"EnablePOPCNT\"),       1, \"Allows POPCNT+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableSSE,          W(\"EnableSSE\"),          1, \"Allows SSE+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableSSE2,         W(\"EnableSSE2\"),         1, \"Allows SSE2+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableSSE3,         W(\"EnableSSE3\"),         1, \"Allows SSE3+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableSSE3_4,       W(\"EnableSSE3_4\"),       1, \"Allows SSE3+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableSSE41,        W(\"EnableSSE41\"),        1, \"Allows SSE4.1+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableSSE42,        W(\"EnableSSE42\"),        1, \"Allows SSE4.2+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableSSSE3,        W(\"EnableSSSE3\"),        1, \"Allows SSSE3+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableX86Serialize, W(\"EnableX86Serialize\"), 1, \"Allows X86Serialize+ hardware intrinsics to be disabled\")\n#elif defined(TARGET_ARM64)\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64AdvSimd, W(\"EnableArm64AdvSimd\"), 1, \"Allows Arm64 AdvSimd+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Aes,     W(\"EnableArm64Aes\"),     1, \"Allows Arm64 Aes+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Atomics, W(\"EnableArm64Atomics\"), 1, \"Allows Arm64 Atomics+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Crc32,   W(\"EnableArm64Crc32\"),   1, \"Allows Arm64 Crc32+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Dczva,   W(\"EnableArm64Dczva\"),   1, \"Allows Arm64 Dczva+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Dp,      W(\"EnableArm64Dp\"),      1, \"Allows Arm64 Dp+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Rdm,     W(\"EnableArm64Rdm\"),     1, \"Allows Arm64 Rdm+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Sha1,    W(\"EnableArm64Sha1\"),    1, \"Allows Arm64 Sha1+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Sha256,  W(\"EnableArm64Sha256\"),  1, \"Allows Arm64 Sha256+ hardware intrinsics to be disabled\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableArm64Rcpc,    W(\"EnableArm64Rcpc\"),    1, \"Allows Arm64 Rcpc+ hardware intrinsics to be disabled\")\n#endif\n\n///\n/// Uncategorized\n///\n//\n// Unknown\n//\n//---------------------------------------------------------------------------------------\n// **\n// PLEASE MOVE ANY CONFIG SWITCH YOU OWN OUT OF THIS SECTION INTO A CATEGORY ABOVE\n//\n// DO NOT ADD ANY MORE CONFIG SWITCHES TO THIS SECTION!\n// **\nCONFIG_DWORD_INFO(INTERNAL_ActivatePatchSkip, W(\"ActivatePatchSkip\"), 0, \"Allows an assert when ActivatePatchSkip is called\")\nCONFIG_DWORD_INFO(INTERNAL_AlwaysUseMetadataInterfaceMapLayout, W(\"AlwaysUseMetadataInterfaceMapLayout\"), 0, \"Used for debugging generic interface map layout.\")\nCONFIG_DWORD_INFO(INTERNAL_AssertOnUnneededThis, W(\"AssertOnUnneededThis\"), 0, \"While the ConfigDWORD is unnecessary, the contained ASSERT should be kept. This may result in some work tracking down violating MethodDescCallSites.\")\nCONFIG_DWORD_INFO(INTERNAL_AssertStacktrace, W(\"AssertStacktrace\"), 1, \"\")\nCONFIG_DWORD_INFO(INTERNAL_CPUFamily, W(\"CPUFamily\"), 0xFFFFFFFF, \"\")\nCONFIG_DWORD_INFO(INTERNAL_CPUFeatures, W(\"CPUFeatures\"), 0xFFFFFFFF, \"\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_DisableConfigCache, W(\"DisableConfigCache\"), 0, \"Used to disable the \\\"probabilistic\\\" config cache, which walks through the appropriate config registry keys on init and probabilistically keeps track of which exist.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_DisableStackwalkCache, W(\"DisableStackwalkCache\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_DoubleArrayToLargeObjectHeap, W(\"DoubleArrayToLargeObjectHeap\"), 0, \"Controls double[] placement\")\nCONFIG_STRING_INFO(INTERNAL_DumpOnClassLoad, W(\"DumpOnClassLoad\"), \"Dumps information about loaded class to log.\")\nCONFIG_DWORD_INFO(INTERNAL_ExpandAllOnLoad, W(\"ExpandAllOnLoad\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_ForceRelocs, W(\"ForceRelocs\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_GenerateLongJumpDispatchStubRatio, W(\"GenerateLongJumpDispatchStubRatio\"), 0, \"Useful for testing VSD on AMD64\")\nCONFIG_DWORD_INFO(INTERNAL_HashStack, W(\"HashStack\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_HostManagerConfig, W(\"HostManagerConfig\"), (DWORD)-1, \"\")\nCONFIG_DWORD_INFO(INTERNAL_HostTestThreadAbort, W(\"HostTestThreadAbort\"), 0, \"\")\nCONFIG_STRING_INFO(INTERNAL_InvokeHalt, W(\"InvokeHalt\"), \"Throws an assert when the given method is invoked through reflection.\")\nCONFIG_DWORD_INFO(INTERNAL_MaxStubUnwindInfoSegmentSize, W(\"MaxStubUnwindInfoSegmentSize\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_MessageDebugOut, W(\"MessageDebugOut\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_NativeImageRequire, W(\"NativeImageRequire\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_NestedEhOom, W(\"NestedEhOom\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_NoProcedureSplitting, W(\"NoProcedureSplitting\"), 0, \"\")\nCONFIG_DWORD_INFO(INTERNAL_PauseOnLoad, W(\"PauseOnLoad\"), 0, \"Stops in SystemDomain::init. I think it can be removed.\")\nCONFIG_DWORD_INFO(INTERNAL_PerfAllocsSizeThreshold, W(\"PerfAllocsSizeThreshold\"), 0x3FFFFFFF, \"Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.\")\nCONFIG_DWORD_INFO(INTERNAL_PerfNumAllocsThreshold, W(\"PerfNumAllocsThreshold\"), 0x3FFFFFFF, \"Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.\")\nCONFIG_STRING_INFO(INTERNAL_PerfTypesToLog, W(\"PerfTypesToLog\"), \"Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_Prepopulate1, W(\"Prepopulate1\"), 1, \"\")\nCONFIG_STRING_INFO(INTERNAL_PrestubGC, W(\"PrestubGC\"), \"\")\nCONFIG_STRING_INFO(INTERNAL_PrestubHalt, W(\"PrestubHalt\"), \"\")\nRETAIL_CONFIG_STRING_INFO(EXTERNAL_RestrictedGCStressExe, W(\"RestrictedGCStressExe\"), \"\")\nCONFIG_DWORD_INFO(INTERNAL_ReturnSourceTypeForTesting, W(\"ReturnSourceTypeForTesting\"), 0, \"Allows returning the (internal only) source type of an IL to Native mapping for debugging purposes\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_RSStressLog, W(\"RSStressLog\"), 0, \"Allows turning on logging for RS startup\")\nCONFIG_DWORD_INFO(INTERNAL_SBDumpOnNewIndex, W(\"SBDumpOnNewIndex\"), 0, \"Used for Syncblock debugging. It's been a while since any of those have been used.\")\nCONFIG_DWORD_INFO(INTERNAL_SBDumpOnResize, W(\"SBDumpOnResize\"), 0, \"Used for Syncblock debugging. It's been a while since any of those have been used.\")\nCONFIG_DWORD_INFO(INTERNAL_SBDumpStyle, W(\"SBDumpStyle\"), 0, \"Used for Syncblock debugging. It's been a while since any of those have been used.\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_SleepOnExit, W(\"SleepOnExit\"), 0, \"Used for lrak detection. I'd say deprecated by umdh.\")\nCONFIG_DWORD_INFO(INTERNAL_StubLinkerUnwindInfoVerificationOn, W(\"StubLinkerUnwindInfoVerificationOn\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_SuccessExit, W(\"SuccessExit\"), 0, \"\")\nRETAIL_CONFIG_DWORD_INFO(UNSUPPORTED_TestDataConsistency, W(\"TestDataConsistency\"), FALSE, \"Allows ensuring the left side is not holding locks (and may thus be in an inconsistent state) when inspection occurs\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_ThreadGuardPages, W(\"ThreadGuardPages\"), 0, \"\")\n\n#ifdef _DEBUG\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_TraceWrap, W(\"TraceWrap\"), 0, \"\")\n#endif\n\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_UseMethodDataCache, W(\"UseMethodDataCache\"), FALSE, \"Used during feature development; may now be removed.\")\nRETAIL_CONFIG_DWORD_INFO(EXTERNAL_UseParentMethodData, W(\"UseParentMethodData\"), TRUE, \"Used during feature development; may now be removed.\")\nCONFIG_DWORD_INFO(INTERNAL_VerifierOff, W(\"VerifierOff\"), 0, \"\")\n// **\n// PLEASE MOVE ANY CONFIG SWITCH YOU OWN OUT OF THIS SECTION INTO A CATEGORY ABOVE\n//\n// DO NOT ADD ANY MORE CONFIG SWITCHES TO THIS SECTION!\n// **\n//---------------------------------------------------------------------------------------\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrdata.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** clrdata.idl - Common Language Runtime data access interfaces for         **\n **              clients needing to access runtime state from outside       **\n **              runtime, such as out-of-process debuggers.                 **\n **                                                                         **\n ** The access interface defines two different types of code running:       **\n ** The host is the user of the access interface.                           **\n ** The target is the target of the access.                                 **\n **                                                                         **\n ** The host and target can be have different instruction sets,             **\n ** pointer sizes, runtime versions and so on.                              **\n **                                                                         **\n *****************************************************************************/\n\nimport \"unknwn.idl\";\n\n/* ------------------------------------------------------------------------- *\n * Forward declarations.\n * ------------------------------------------------------------------------- */\n\ninterface ICLRDataEnumMemoryRegions;\ninterface ICLRDataEnumMemoryRegionsCallback;\ninterface ICLRDataEnumMemoryRegionsCallback2;\ninterface ICLRDataEnumMemoryRegionsCallback3;\ninterface ICLRDataTarget;\ninterface ICLRDataTarget2;\ninterface ICLRMetadataLocator;\n\n/*\n * Addresses in the access interface are always the largest possible.\n * If the target uses a smaller address size then addresses are converted\n * up by sign extension.\n */\ntypedef ULONG64 CLRDATA_ADDRESS;\n\n/* ------------------------------------------------------------------------- *\n * Creation function.\n * Can create ICLRDataEnumMemoryRegions.\n * ------------------------------------------------------------------------- */\n\n#pragma midl_echo(\"STDAPI CLRDataCreateInstance(REFIID iid, ICLRDataTarget* target, void** iface);\")\n#pragma midl_echo(\"typedef HRESULT (STDAPICALLTYPE* PFN_CLRDataCreateInstance)(REFIID iid, ICLRDataTarget* target, void** iface);\")\n\n/*\n * Interface for providing access to a particular target process. The\n * data access services will call functions on this interface to\n * access memory and other data in the target process.\n *\n * The API client must implement this interface as appropriate for the\n * particular target (for example, a live process or a memory dump).\n *\n */\n[\n    object,\n    local,\n    uuid(3E11CCEE-D08B-43e5-AF01-32717A64DA03),\n    pointer_default(unique)\n]\ninterface ICLRDataTarget : IUnknown\n{\n    /*\n     * Return which kind of instruction set is in use in the\n     * target.  Value is one of the IMAGE_FILE_MACHINE_* constants.\n     */\n    HRESULT GetMachineType([out] ULONG32* machineType);\n\n    /*\n     * Return the size of a pointer on the target, in bytes.\n     */\n    HRESULT GetPointerSize([out] ULONG32* pointerSize);\n\n    /*\n     * Find the base address for a given image.\n     * Image name may or may not have a path.  If a path\n     * is given matching is done with the whole path, otherwise\n     * matching is done only on the file part.\n     * In either case, matching should be case-insensitive.\n     */\n    HRESULT GetImageBase([in, string] LPCWSTR imagePath,\n                         [out] CLRDATA_ADDRESS* baseAddress);\n\n    /*\n     * Virtual memory access.  If any bytes can be processed\n     * the call is considered successful.\n     */\n    HRESULT ReadVirtual([in] CLRDATA_ADDRESS address,\n                        [out, size_is(bytesRequested), length_is(*bytesRead)] BYTE* buffer,\n                        [in] ULONG32 bytesRequested,\n                        [out] ULONG32* bytesRead);\n    HRESULT WriteVirtual([in] CLRDATA_ADDRESS address,\n                         [in, size_is(bytesRequested)] BYTE* buffer,\n                         [in] ULONG32 bytesRequested,\n                         [out] ULONG32* bytesWritten);\n\n    /*\n     * TLS data access for the current thread.\n     */\n    HRESULT GetTLSValue([in] ULONG32 threadID,\n                        [in] ULONG32 index,\n                        [out] CLRDATA_ADDRESS* value);\n    HRESULT SetTLSValue([in] ULONG32 threadID,\n                        [in] ULONG32 index,\n                        [in] CLRDATA_ADDRESS value);\n\n    /*\n     * System ID for the current thread.\n     * If there is no \"current\" thread for the target\n     * implementation this can fail.\n     */\n    HRESULT GetCurrentThreadID([out] ULONG32* threadID);\n\n    /*\n     * Thread context.\n     */\n    HRESULT GetThreadContext([in] ULONG32 threadID,\n                             [in] ULONG32 contextFlags,\n                             [in] ULONG32 contextSize,\n                             [out, size_is(contextSize)] BYTE* context);\n    HRESULT SetThreadContext([in] ULONG32 threadID,\n                             [in] ULONG32 contextSize,\n                             [in, size_is(contextSize)] BYTE* context);\n\n    /*\n     * Generic request facility to allow addition of\n     * queries and operations without requiring an interface revision.\n     */\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n};\n\n/*\n * Interface used by the data access services layer to manipulate\n * virtual memory regions in the target. The target may not support\n * modification.\n */\n[\n    object,\n    local,\n    uuid(6d05fae3-189c-4630-a6dc-1c251e1c01ab),\n    pointer_default(unique)\n]\ninterface ICLRDataTarget2 : ICLRDataTarget\n{\n    /*\n     * Ask the target to allocate memory in its address space.\n     */\n    HRESULT AllocVirtual([in] CLRDATA_ADDRESS addr,\n                         [in] ULONG32 size,\n                         [in] ULONG32 typeFlags,\n                         [in] ULONG32 protectFlags,\n                         [out] CLRDATA_ADDRESS* virt);\n\n    /*\n     * Ask the target to free a previously allocated memory block.\n     */\n    HRESULT FreeVirtual([in] CLRDATA_ADDRESS addr,\n                        [in] ULONG32 size,\n                        [in] ULONG32 typeFlags);\n};\n\n/*\n * Interface for providing access to exception and context records.\n */\n[\n    object,\n    local,\n    uuid(a5664f95-0af4-4a1b-960e-2f3346b4214c),\n    pointer_default(unique)\n]\ninterface ICLRDataTarget3 : ICLRDataTarget2\n{\n    /*\n     * Returns an associated exception record, if any.\n     */\n    HRESULT GetExceptionRecord([in] ULONG32 bufferSize,\n    [out] ULONG32* bufferUsed,\n    [out, size_is(bufferSize)] BYTE* buffer);\n\n    /*\n     * Returns a context record associated with the exception, if any.\n     */\n    HRESULT GetExceptionContextRecord([in] ULONG32 bufferSize,\n        [out] ULONG32* bufferUsed,\n        [out, size_is(bufferSize)] BYTE* buffer);\n\n    /*\n     * Returns the ID of the thread raising the exception.\n     */\n    HRESULT GetExceptionThreadID([out] ULONG32* threadID);\n};\n\n[\n    object,\n    local,\n    uuid(b760bf44-9377-4597-8be7-58083bdc5146),\n    pointer_default(unique)\n]\ninterface ICLRRuntimeLocator : IUnknown\n{\n    /*\n     Returns the base address of the module containing the runtime.\n     */\n    HRESULT GetRuntimeBase([out] CLRDATA_ADDRESS* baseAddress);\n};\n\n/*\n * Interface used by the data access services layer to locate metadata\n * of assemblies in a target.\n *\n * The API client must implement this interface as appropriate for the\n * particular target (for example, a live process or a memory dump).\n *\n * This is an old interface you should not be using.\n * see code:ICorDebugMetaDataLocator in cordebug.idl\n *\n */\n[\n    object,\n    local,\n    uuid(aa8fa804-bc05-4642-b2c5-c353ed22fc63),\n    pointer_default(unique)\n]\ninterface ICLRMetadataLocator : IUnknown\n{\n    /*\n     * Ask the target to retrieve metadata for an image.\n     */\n    HRESULT GetMetadata([in] LPCWSTR imagePath,\n                        [in] ULONG32 imageTimestamp,\n                        [in] ULONG32 imageSize,\n                        [in] GUID* mvid,\n                        [in] ULONG32 mdRva,\n                        [in] ULONG32 flags,\n                        [in] ULONG32 bufferSize,\n                        [out, size_is(bufferSize), length_is(*dataSize)]\n                        BYTE* buffer,\n                        [out] ULONG32* dataSize);\n};\n\n\n/*\n * Callback interface for enumerating memory regions.\n */\n[\n    object,\n    local,\n    uuid(BCDD6908-BA2D-4ec5-96CF-DF4D5CDCB4A4)\n]\ninterface ICLRDataEnumMemoryRegionsCallback : IUnknown\n{\n    /*\n     * ICLRDataEnumMemoryRegions::EnumMemoryRegions will call this\n     * function for every memory region enumerated.  Regions reported\n     * through this callback may be duplicate or overlapping.  Failure\n     * return results will be noted, but will not stop the\n     * enumeration.\n     */\n    HRESULT EnumMemoryRegion([in] CLRDATA_ADDRESS address,\n                             [in] ULONG32 size);\n}\n\n/*\n * Callback interface for writing/poisoning memory regions.\n */\n[\n    object,\n    local,\n    uuid(3721A26F-8B91-4D98-A388-DB17B356FADB)\n]\ninterface ICLRDataEnumMemoryRegionsCallback2 : ICLRDataEnumMemoryRegionsCallback\n{\n    /*\n     * ICLRDataEnumMemoryRegions::EnumMemoryRegions will call this function\n     * for every memory regions it needs to overwrite/poison with the specified\n     * data buffer passed as input argument.\n     */\n    HRESULT UpdateMemoryRegion(\n        [in] CLRDATA_ADDRESS address,\n        [in] ULONG32 bufferSize,\n        [in, size_is(bufferSize)] BYTE* buffer);\n}\n\n/*\n * Optional callback interface for logging EnumMemoryRegions operations and errors.\n */\n[\n    object,\n    local,\n    uuid(F315248D-8B79-49DB-B184-37426559F703)\n]\ninterface ICLRDataLoggingCallback : IUnknown\n{\n    HRESULT LogMessage(\n        [in] LPCSTR message);\n}\n\n/*\n * Flags for controlling which memory regions are enumerated.\n */\ntypedef enum CLRDataEnumMemoryFlags\n{\n    CLRDATA_ENUM_MEM_DEFAULT = 0x0,\n    CLRDATA_ENUM_MEM_MINI = CLRDATA_ENUM_MEM_DEFAULT,   // generating skinny mini-dump\n    CLRDATA_ENUM_MEM_HEAP = 0x1,                        // generating heap dump\n    CLRDATA_ENUM_MEM_TRIAGE = 0x2,                      // generating triage mini-dump\n    /* Generate heap dumps faster with less memory usage than CLRDATA_ENUM_MEM_HEAP by adding\n       the loader heaps instead of traversing all the individual runtime data structures. */\n    CLRDATA_ENUM_MEM_HEAP2 = 0x3,\n    /* More bits to be added here later */\n} CLRDataEnumMemoryFlags;\n\n/*\n * Memory enumeration interface.\n * This is one of the top-level interfaces creatable by CLRDataCreateInstance.\n */\n[\n    object,\n    local,\n    uuid(471c35b4-7c2f-4ef0-a945-00f8c38056f1)\n]\ninterface ICLRDataEnumMemoryRegions : IUnknown\n{\n    /*\n     * EnumMemoryRegions enumerates regions of interest as specified\n     * by the flags argument by calling the\n     * ICLRDataEnumMemoryRegionsCallback::EnumMemoryRegion for every\n     * region being enumerated.  Attempts to enumerate as many regions\n     * as possible, even if the callback returns failures during\n     * enumeration.\n     */\n    HRESULT EnumMemoryRegions([in] ICLRDataEnumMemoryRegionsCallback *callback,\n                              [in] ULONG32 miniDumpFlags,\n                              [in] CLRDataEnumMemoryFlags clrFlags);\n}\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrhost.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n\n\n#ifndef __CLRHOST_H__\n#define __CLRHOST_H__\n\n#include \"windows.h\" // worth to include before mscoree.h so we are guaranteed to pick few definitions\n#ifdef CreateSemaphore\n#undef CreateSemaphore\n#endif\n#include \"mscoree.h\"\n#include \"clrinternal.h\"\n#include \"switches.h\"\n#include \"holder.h\"\n#include \"new.hpp\"\n#include \"staticcontract.h\"\n#include \"predeftlsslot.h\"\n#include \"safemath.h\"\n#include \"debugreturn.h\"\n#include \"yieldprocessornormalized.h\"\n\n#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define _DEBUG_IMPL 1\n#endif\n\n#define BEGIN_PRESERVE_LAST_ERROR \\\n    { \\\n        DWORD __dwLastError = ::GetLastError(); \\\n        DEBUG_ASSURE_NO_RETURN_BEGIN(PRESERVE_LAST_ERROR); \\\n            {\n\n#define END_PRESERVE_LAST_ERROR \\\n            } \\\n        DEBUG_ASSURE_NO_RETURN_END(PRESERVE_LAST_ERROR); \\\n        ::SetLastError(__dwLastError); \\\n    }\n\n//\n// TRASH_LASTERROR macro sets bogus last error in debug builds to help find places that fail to save it\n//\n#ifdef _DEBUG\n\n#define LAST_ERROR_TRASH_VALUE 42424 /* = 0xa5b8 */\n\n#define TRASH_LASTERROR \\\n    SetLastError(LAST_ERROR_TRASH_VALUE)\n\n#else // _DEBUG\n\n#define TRASH_LASTERROR\n\n#endif // _DEBUG\n\n\nLPVOID ClrVirtualAlloc(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);\nBOOL ClrVirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType);\nSIZE_T ClrVirtualQuery(LPCVOID lpAddress, PMEMORY_BASIC_INFORMATION lpBuffer, SIZE_T dwLength);\nBOOL ClrVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect);\n\n#ifdef HOST_WINDOWS\nHANDLE ClrGetProcessExecutableHeap();\n#endif\n\n#ifdef FAILPOINTS_ENABLED\nextern int RFS_HashStack();\n#endif\n\n// Critical section support for CLR DLLs other than the EE.\n// Include the header defining each Crst type and its corresponding level (relative rank). This is\n// auto-generated from a tool that takes a high-level description of each Crst type and its dependencies.\n#include \"crsttypes_generated.h\"\n\n// critical section api\nCRITSEC_COOKIE ClrCreateCriticalSection(CrstType type, CrstFlags flags);\nvoid ClrDeleteCriticalSection(CRITSEC_COOKIE cookie);\nvoid ClrEnterCriticalSection(CRITSEC_COOKIE cookie);\nvoid ClrLeaveCriticalSection(CRITSEC_COOKIE cookie);\n\nDWORD ClrSleepEx(DWORD dwMilliseconds, BOOL bAlertable);\n\n// Rather than use the above APIs directly, it is recommended that holder classes\n// be used.  This guarantees that the locks will be vacated when the scope is popped,\n// either on exception or on return.\n\ntypedef Holder<CRITSEC_COOKIE, ClrEnterCriticalSection, ClrLeaveCriticalSection, NULL> CRITSEC_Holder;\n\n// Use this holder to manage CRITSEC_COOKIE allocation to ensure it will be released if anything goes wrong\nFORCEINLINE void VoidClrDeleteCriticalSection(CRITSEC_COOKIE cs) { if (cs != NULL) ClrDeleteCriticalSection(cs); }\ntypedef Wrapper<CRITSEC_COOKIE, DoNothing<CRITSEC_COOKIE>, VoidClrDeleteCriticalSection, NULL> CRITSEC_AllocationHolder;\n\n#ifndef DACCESS_COMPILE\n// Suspend/resume APIs that fail-fast on errors\n#ifdef TARGET_WINDOWS\nDWORD ClrSuspendThread(HANDLE hThread);\n#endif // TARGET_WINDOWS\nDWORD ClrResumeThread(HANDLE hThread);\n#endif // !DACCESS_COMPILE\n\nDWORD GetClrModulePathName(SString& buffer);\n\nextern thread_local int t_CantAllocCount;\n\ninline void IncCantAllocCount()\n{\n    t_CantAllocCount++;\n}\n\ninline void DecCantAllocCount()\n{\n    t_CantAllocCount--;\n}\n\nclass CantAllocHolder\n{\npublic:\n    CantAllocHolder ()\n    {\n        IncCantAllocCount ();\n    }\n    ~CantAllocHolder()\n    {\n\t    DecCantAllocCount ();\n    }\n};\n\n// At places where want to allocate stress log, we need to first check if we are allowed to do so.\ninline bool IsInCantAllocRegion ()\n{\n    return t_CantAllocCount != 0;\n}\ninline BOOL IsInCantAllocStressLogRegion()\n{\n    return t_CantAllocCount != 0;\n}\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrinternal.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/**************************************************************************************\n **                                                                                  **\n ** clrinternal.idl - interface definitions for internal usage.                      **\n **                                                                                  **\n **************************************************************************************/\n\n//\n// Interface descriptions\n//\nimport \"unknwn.idl\";\n\n// import mscoree.idl for BucketParameters definition\nimport \"mscoree.idl\";\n\n// This ID is embedded in the CLRDEBUGINFO resource so that the shim can differentiate dlls which happen to be named\n// clr.dll from official Microsoft clr.dll implementations. This is not intended to authenticate a CLR in a strong\n// security sense but short of deliberate 3rd party spoofing it should provide a good identity.\n//\n// Using a different ID allows us to completely hide different CLR SKUs from each other. The recommendation is to keep\n// the ID constant between different versions of the same SKU and use mscordbi's logic to determine whether a given\n// version is compatible. This allows debuggers to give different errors for 'future version of the CLR I don't\n// support' vs. 'No CLR is loaded at all.'\n//\n// This guid first appears in version 4.0 of CLR on x86 and amd64 - earlier versions had no resource\n// GUID CLR_ID_V4_DESKTOP :   uuid{267F3989-D786-4b9a-9AF6-D19E42D557EC}\ncpp_quote(\"EXTERN_GUID(CLR_ID_V4_DESKTOP, 0x267f3989, 0xd786, 0x4b9a, 0x9a, 0xf6, 0xd1, 0x9e, 0x42, 0xd5, 0x57, 0xec);\")\n\n// This guid has been set aside for CoreCLR usage - at present CoreCLR doesn't use it though\n// GUID CLR_ID_CORECLR :   uuid{8CB8E075-0A91-408E-9228-D66E00A3BFF6}\ncpp_quote(\"EXTERN_GUID(CLR_ID_CORECLR, 0x8CB8E075, 0x0A91, 0x408E, 0x92, 0x28, 0xD6, 0x6E, 0x00, 0xA3, 0xBF, 0xF6 );\")\n\n// This guid first appears in the CoreCLR port to Windows Phone 8 - note that it is separate from the CoreCLR id because it will\n// potentially have a different versioning lineage than CoreCLR\n// GUID CLR_ID_PHONE_CLR :   uuid{E7237E9C-31C0-488C-AD48-324D3E7ED92A}\ncpp_quote(\"EXTERN_GUID(CLR_ID_PHONE_CLR, 0xE7237E9C, 0x31C0, 0x488C, 0xAD, 0x48, 0x32, 0x4D, 0x3E, 0x7E, 0xD9, 0x2A);\")\n\n// This guid first appears 8/19/14 as CoreCLR evolves to OneCore, ProjectK, and versions of Phone after PhoneBlue\n// The new guid intentionally creates a breaking change so we can simplify the file naming on mscordaccore.dll and mscordbi.dll\n// in xplat hosting scenarios. Old versions of dbgshim.dll will not be able to support this.\n// GUID CLR_ID_ONECORE_CLR :    uuid{B1EE760D-6C4A-4533-BA41-6F4F661FABAF}\ncpp_quote(\"EXTERN_GUID(CLR_ID_ONECORE_CLR, 0xb1ee760d, 0x6c4a, 0x4533, 0xba, 0x41, 0x6f, 0x4f, 0x66, 0x1f, 0xab, 0xaf);\")\n\n\n// IID_IPrivateManagedExceptionReporting :     uuid{AD76A023-332D-4298-8001-07AA9350DCA4}\ncpp_quote(\"EXTERN_GUID(IID_IPrivateManagedExceptionReporting, 0xad76a023, 0x332d, 0x4298, 0x80, 0x01, 0x07, 0xaa, 0x93, 0x50, 0xdc, 0xa4);\")\n\n\n//*****************************************************************************\n// Interface for exposing services from the EE to other DLLs of the CLR.\n//*****************************************************************************\ntypedef void * CRITSEC_COOKIE;\n\ntypedef enum {\n    CRST_DEFAULT          = 0x0,\n    CRST_REENTRANCY       = 0x1,  // allow same thread to take lock multiple times.\n    CRST_UNSAFE_SAMELEVEL = 0x2,  // AVOID THIS! Can take other locks @ same level in\n                                  //             any order.\n    CRST_UNSAFE_COOPGC    = 0x4,  // AVOID THIS! Lock must be taken in cooperative mode.\n    CRST_UNSAFE_ANYMODE   = 0x8,  // AVOID THIS! Lock can be taken in either GC mode.\n    CRST_DEBUGGER_THREAD  = 0x10, // This lock can be taken on the debugger's helper thread.\n    CRST_HOST_BREAKABLE   = 0x20, // This lock is held while running managed code.  It can be terminated by a host.\n    // CRST_UNUSED        = 0x40,\n    CRST_TAKEN_DURING_SHUTDOWN = 0x80, // This lock is taken during the shutdown sequence in EEShutdown(helper)\n    CRST_GC_NOTRIGGER_WHEN_TAKEN = 0x100,\n        // User of this lock cannot trigger GC, while it is locked.\n        // Note that Enter on this lock can trigger GC if called from COOPERATIVE mode.\n        // It is useful for locks which can be taken on GC or debugger threads.\n    CRST_DEBUG_ONLY_CHECK_FORBID_SUSPEND_THREAD = 0x200,\n        // Some rare locks should be taken only in ForbidSuspend region (i.e. profiler cannot walk the stack),\n        // this option will assert it in debug mode.\n} CrstFlags;\n\n//********************************************************************************************\n// Interface for exposing GetBucketParametersForCurrentException to Watson testing harness.\n//********************************************************************************************\n[\n    uuid(AD76A023-332D-4298-8001-07AA9350DCA4),\n    helpstring(\"Private Managed Exception Reporting Interface\"),\n    pointer_default(unique),\n    local\n]\ninterface IPrivateManagedExceptionReporting : IUnknown\n{\n    HRESULT GetBucketParametersForCurrentException([out]BucketParameters *pParams);\n}\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrnt.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef CLRNT_H_\n#define CLRNT_H_\n\n#include \"staticcontract.h\"\n#include \"cfi.h\"\n\n//\n// This file is the result of some changes to the SDK header files.\n// In particular, nt.h and some of its dependencies are no longer\n// available except as \"nonship\" files.  As a result, this file\n// was created as a simple cut and past of structures and functions\n// from NT that are either not yet documented or have been overlooked\n// as being part of the platform SDK.\n//\n\n//\n// ALL PLATFORMS\n//\n\n#define STATUS_INVALID_PARAMETER_3       ((NTSTATUS)0xC00000F1L)\n#define STATUS_INVALID_PARAMETER_4       ((NTSTATUS)0xC00000F2L)\n#define STATUS_UNSUCCESSFUL              ((NTSTATUS)0xC0000001L)\n#define STATUS_SUCCESS                   ((NTSTATUS)0x00000000L)\n\n#ifndef STATUS_UNWIND\n#define STATUS_UNWIND                    ((NTSTATUS)0x80000027L)\n#endif\n\n#ifndef DBG_PRINTEXCEPTION_C\n#define DBG_PRINTEXCEPTION_C             ((DWORD)0x40010006L)\n#endif\n\n#ifndef STATUS_UNWIND_CONSOLIDATE\n#define STATUS_UNWIND_CONSOLIDATE        ((NTSTATUS)0x80000029L)\n#endif\n\n#ifndef STATUS_LONGJUMP\n#define STATUS_LONGJUMP        ((NTSTATUS)0x80000026L)\n#endif\n\n#ifndef LOCALE_NAME_MAX_LENGTH\n#define LOCALE_NAME_MAX_LENGTH 85\n#endif // !LOCALE_NAME_MAX_LENGTH\n\n#ifndef SUBLANG_CUSTOM_DEFAULT\n#define SUBLANG_CUSTOM_DEFAULT                      0x03    // default custom language/locale\n#define SUBLANG_CUSTOM_UNSPECIFIED                  0x04    // custom language/locale\n#define LOCALE_CUSTOM_DEFAULT                                                 \\\n              (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT))\n#define LOCALE_CUSTOM_UNSPECIFIED                                             \\\n              (MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT))\n#endif // !SUBLANG_CUSTOM_DEFAULT\n\n#ifndef __out_xcount_opt\n#define __out_xcount_opt(var) __out\n#endif\n\n#ifndef __encoded_pointer\n#define __encoded_pointer\n#endif\n\n#ifndef __range\n#define __range(min, man)\n#endif\n\n#ifndef __field_bcount\n#define __field_bcount(size)\n#endif\n\n#ifndef __field_ecount_opt\n#define __field_ecount_opt(nFields)\n#endif\n\n#ifndef __field_ecount\n#define __field_ecount(EHCount)\n#endif\n\n#undef _Ret_bytecap_\n#define _Ret_bytecap_(_Size)\n\n#ifndef NT_SUCCESS\n#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)\n#endif\n\n#define ARGUMENT_PRESENT(ArgumentPointer)    (\\\n    (CHAR *)(ArgumentPointer) != (CHAR *)(NULL) )\n\n#define EXCEPTION_CHAIN_END ((PEXCEPTION_REGISTRATION_RECORD)-1)\n\ntypedef signed char SCHAR;\ntypedef SCHAR *PSCHAR;\ntypedef LONG NTSTATUS;\n\n#ifndef HOST_UNIX\n\n#define TLS_MINIMUM_AVAILABLE 64    // winnt\n#define TLS_EXPANSION_SLOTS   1024\n\ntypedef enum _THREADINFOCLASS {\n    ThreadBasicInformation,\n    ThreadTimes,\n    ThreadPriority,\n    ThreadBasePriority,\n    ThreadAffinityMask,\n    ThreadImpersonationToken,\n    ThreadDescriptorTableEntry,\n    ThreadEnableAlignmentFaultFixup,\n    ThreadEventPair_Reusable,\n    ThreadQuerySetWin32StartAddress,\n    ThreadZeroTlsCell,\n    ThreadPerformanceCount,\n    ThreadAmILastThread,\n    ThreadIdealProcessor,\n    ThreadPriorityBoost,\n    ThreadSetTlsArrayAddress,\n    ThreadIsIoPending,\n    ThreadHideFromDebugger,\n    ThreadBreakOnTermination,\n    MaxThreadInfoClass\n    } THREADINFOCLASS;\n\ntypedef enum _SYSTEM_INFORMATION_CLASS {\n    SystemBasicInformation,\n    SystemProcessorInformation,             // obsolete...delete\n    SystemPerformanceInformation,\n    SystemTimeOfDayInformation,\n    SystemPathInformation,\n    SystemProcessInformation,\n    SystemCallCountInformation,\n    SystemDeviceInformation,\n    SystemProcessorPerformanceInformation,\n    SystemFlagsInformation,\n    SystemCallTimeInformation,\n    SystemModuleInformation,\n    SystemLocksInformation,\n    SystemStackTraceInformation,\n    SystemPagedPoolInformation,\n    SystemNonPagedPoolInformation,\n    SystemHandleInformation,\n    SystemObjectInformation,\n    SystemPageFileInformation,\n    SystemVdmInstemulInformation,\n    SystemVdmBopInformation,\n    SystemFileCacheInformation,\n    SystemPoolTagInformation,\n    SystemInterruptInformation,\n    SystemDpcBehaviorInformation,\n    SystemFullMemoryInformation,\n    SystemLoadGdiDriverInformation,\n    SystemUnloadGdiDriverInformation,\n    SystemTimeAdjustmentInformation,\n    SystemSummaryMemoryInformation,\n    SystemMirrorMemoryInformation,\n    SystemPerformanceTraceInformation,\n    SystemObsolete0,\n    SystemExceptionInformation,\n    SystemCrashDumpStateInformation,\n    SystemKernelDebuggerInformation,\n    SystemContextSwitchInformation,\n    SystemRegistryQuotaInformation,\n    SystemExtendServiceTableInformation,\n    SystemPrioritySeparation,\n    SystemVerifierAddDriverInformation,\n    SystemVerifierRemoveDriverInformation,\n    SystemProcessorIdleInformation,\n    SystemLegacyDriverInformation,\n    SystemCurrentTimeZoneInformation,\n    SystemLookasideInformation,\n    SystemTimeSlipNotification,\n    SystemSessionCreate,\n    SystemSessionDetach,\n    SystemSessionInformation,\n    SystemRangeStartInformation,\n    SystemVerifierInformation,\n    SystemVerifierThunkExtend,\n    SystemSessionProcessInformation,\n    SystemLoadGdiDriverInSystemSpace,\n    SystemNumaProcessorMap,\n    SystemPrefetcherInformation,\n    SystemExtendedProcessInformation,\n    SystemRecommendedSharedDataAlignment,\n    SystemComPlusPackage,\n    SystemNumaAvailableMemory,\n    SystemProcessorPowerInformation,\n    SystemEmulationBasicInformation,\n    SystemEmulationProcessorInformation,\n    SystemExtendedHandleInformation,\n    SystemLostDelayedWriteInformation\n} SYSTEM_INFORMATION_CLASS;\n\ntypedef enum _EVENT_INFORMATION_CLASS {\n    EventBasicInformation\n    } EVENT_INFORMATION_CLASS;\n\ntypedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION {\n    LARGE_INTEGER IdleTime;\n    LARGE_INTEGER KernelTime;\n    LARGE_INTEGER UserTime;\n    LARGE_INTEGER DpcTime;          // DEVL only\n    LARGE_INTEGER InterruptTime;    // DEVL only\n    ULONG InterruptCount;\n} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;\n\ntypedef enum _EVENT_TYPE {\n    NotificationEvent,\n    SynchronizationEvent\n    } EVENT_TYPE;\n\ntypedef struct _EVENT_BASIC_INFORMATION {\n    EVENT_TYPE EventType;\n    LONG EventState;\n} EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;\n\n#define RTL_MEG                   (1024UL * 1024UL)\n#define RTLP_IMAGE_MAX_DOS_HEADER ( 256UL * RTL_MEG)\n\ntypedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION {\n    BOOLEAN KernelDebuggerEnabled;\n    BOOLEAN KernelDebuggerNotPresent;\n} SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;\n\ntypedef struct _STRING {\n    USHORT Length;\n    USHORT MaximumLength;\n#ifdef MIDL_PASS\n    [size_is(MaximumLength), length_is(Length) ]\n#endif // MIDL_PASS\n    PCHAR Buffer;\n} STRING;\ntypedef STRING *PSTRING;\n\ntypedef STRING ANSI_STRING;\ntypedef PSTRING PANSI_STRING;\n\ntypedef STRING OEM_STRING;\ntypedef PSTRING POEM_STRING;\ntypedef CONST STRING* PCOEM_STRING;\n\ntypedef struct _UNICODE_STRING {\n    USHORT Length;\n    USHORT MaximumLength;\n#ifdef MIDL_PASS\n    [size_is(MaximumLength / 2), length_is((Length) / 2) ] USHORT * Buffer;\n#else // MIDL_PASS\n    PWSTR  Buffer;\n#endif // MIDL_PASS\n} UNICODE_STRING;\ntypedef UNICODE_STRING *PUNICODE_STRING;\ntypedef const UNICODE_STRING *PCUNICODE_STRING;\n#define UNICODE_NULL ((WCHAR)0) // winnt\n\ntypedef struct _STRING32 {\n    USHORT   Length;\n    USHORT   MaximumLength;\n    ULONG  Buffer;\n} STRING32;\ntypedef STRING32 *PSTRING32;\n\ntypedef STRING32 UNICODE_STRING32;\ntypedef UNICODE_STRING32 *PUNICODE_STRING32;\n\ntypedef STRING32 ANSI_STRING32;\ntypedef ANSI_STRING32 *PANSI_STRING32;\n\n\ntypedef struct _STRING64 {\n    USHORT   Length;\n    USHORT   MaximumLength;\n    ULONGLONG  Buffer;\n} STRING64;\ntypedef STRING64 *PSTRING64;\n\ntypedef STRING64 UNICODE_STRING64;\ntypedef UNICODE_STRING64 *PUNICODE_STRING64;\n\ntypedef STRING64 ANSI_STRING64;\ntypedef ANSI_STRING64 *PANSI_STRING64;\n\n#define GDI_HANDLE_BUFFER_SIZE32  34\n#define GDI_HANDLE_BUFFER_SIZE64  60\n\n#if !defined(TARGET_AMD64)\n#define GDI_HANDLE_BUFFER_SIZE      GDI_HANDLE_BUFFER_SIZE32\n#else\n#define GDI_HANDLE_BUFFER_SIZE      GDI_HANDLE_BUFFER_SIZE64\n#endif\n\ntypedef ULONG GDI_HANDLE_BUFFER32[GDI_HANDLE_BUFFER_SIZE32];\ntypedef ULONG GDI_HANDLE_BUFFER64[GDI_HANDLE_BUFFER_SIZE64];\ntypedef ULONG GDI_HANDLE_BUFFER  [GDI_HANDLE_BUFFER_SIZE  ];\n\n\ntypedef struct _PEB_LDR_DATA {\n    ULONG Length;\n    BOOLEAN Initialized;\n    HANDLE SsHandle;\n    LIST_ENTRY InLoadOrderModuleList;\n    LIST_ENTRY InMemoryOrderModuleList;\n    LIST_ENTRY InInitializationOrderModuleList;\n    PVOID EntryInProgress;\n} PEB_LDR_DATA, *PPEB_LDR_DATA;\n\ntypedef struct _PEB_FREE_BLOCK {\n    struct _PEB_FREE_BLOCK *Next;\n    ULONG Size;\n} PEB_FREE_BLOCK, *PPEB_FREE_BLOCK;\n\ntypedef PVOID* PPVOID;\n\ntypedef\nVOID\n(*PPS_POST_PROCESS_INIT_ROUTINE) (\n    VOID\n    );\n\ntypedef struct _LDR_DATA_TABLE_ENTRY {\n    LIST_ENTRY InLoadOrderLinks;\n    LIST_ENTRY InMemoryOrderLinks;\n    LIST_ENTRY InInitializationOrderLinks;\n    PVOID DllBase;\n    PVOID EntryPoint;\n    ULONG SizeOfImage;\n    UNICODE_STRING FullDllName;\n    UNICODE_STRING BaseDllName;\n    ULONG Flags;\n    USHORT LoadCount;\n    USHORT TlsIndex;\n    union _foo {\n        LIST_ENTRY HashLinks;\n        struct _bar {\n            PVOID SectionPointer;\n            ULONG CheckSum;\n        };\n    };\n    union _foo2 {\n        struct _bar2 {\n            ULONG TimeDateStamp;\n        };\n        struct _bar3 {\n            PVOID LoadedImports;\n        };\n    };\n    PVOID EntryPointActivationContext;\n} LDR_DATA_TABLE_ENTRY, *PLDR_DATA_TABLE_ENTRY;\n\n#define TYPE3(arg) arg\n\ntypedef struct _PEB {\n    BOOLEAN InheritedAddressSpace;      // These four fields cannot change unless the\n    BOOLEAN ReadImageFileExecOptions;   //\n    BOOLEAN BeingDebugged;              //\n    BOOLEAN SpareBool;                  //\n    HANDLE Mutant;                      // INITIAL_PEB structure is also updated.\n\n    PVOID ImageBaseAddress;\n    PPEB_LDR_DATA Ldr;\n    TYPE3(struct _RTL_USER_PROCESS_PARAMETERS*) ProcessParameters;\n    PVOID SubSystemData;\n    PVOID ProcessHeap;\n    TYPE3(struct _RTL_CRITICAL_SECTION*) FastPebLock;\n    PVOID FastPebLockRoutine;\n    PVOID FastPebUnlockRoutine;\n    ULONG EnvironmentUpdateCount;\n    PVOID KernelCallbackTable;\n    ULONG SystemReserved[1];\n\n    struct _foo {\n        ULONG ExecuteOptions : 2;\n        ULONG SpareBits : 30;\n    };\n\n\n    PPEB_FREE_BLOCK FreeList;\n    ULONG TlsExpansionCounter;\n    PVOID TlsBitmap;\n    ULONG TlsBitmapBits[2];         // TLS_MINIMUM_AVAILABLE bits\n    PVOID ReadOnlySharedMemoryBase;\n    PVOID ReadOnlySharedMemoryHeap;\n    PPVOID ReadOnlyStaticServerData;\n    PVOID AnsiCodePageData;\n    PVOID OemCodePageData;\n    PVOID UnicodeCaseTableData;\n\n    //\n    // Useful information for LdrpInitialize\n    ULONG NumberOfProcessors;\n    ULONG NtGlobalFlag;\n\n    //\n    // Passed up from MmCreatePeb from Session Manager registry key\n    //\n\n    LARGE_INTEGER CriticalSectionTimeout;\n    SIZE_T HeapSegmentReserve;\n    SIZE_T HeapSegmentCommit;\n    SIZE_T HeapDeCommitTotalFreeThreshold;\n    SIZE_T HeapDeCommitFreeBlockThreshold;\n\n    //\n    // Where heap manager keeps track of all heaps created for a process\n    // Fields initialized by MmCreatePeb.  ProcessHeaps is initialized\n    // to point to the first free byte after the PEB and MaximumNumberOfHeaps\n    // is computed from the page size used to hold the PEB, less the fixed\n    // size of this data structure.\n    //\n\n    ULONG NumberOfHeaps;\n    ULONG MaximumNumberOfHeaps;\n    PPVOID ProcessHeaps;\n\n    //\n    //\n    PVOID GdiSharedHandleTable;\n    PVOID ProcessStarterHelper;\n    ULONG GdiDCAttributeList;\n    PVOID LoaderLock;\n\n    //\n    // Following fields filled in by MmCreatePeb from system values and/or\n    // image header.\n    //\n\n    ULONG OSMajorVersion;\n    ULONG OSMinorVersion;\n    USHORT OSBuildNumber;\n    USHORT OSCSDVersion;\n    ULONG OSPlatformId;\n    ULONG ImageSubsystem;\n    ULONG ImageSubsystemMajorVersion;\n    ULONG ImageSubsystemMinorVersion;\n    ULONG_PTR ImageProcessAffinityMask;\n    GDI_HANDLE_BUFFER GdiHandleBuffer;\n    PPS_POST_PROCESS_INIT_ROUTINE PostProcessInitRoutine;\n\n    PVOID TlsExpansionBitmap;\n    ULONG TlsExpansionBitmapBits[32];   // TLS_EXPANSION_SLOTS bits\n\n    //\n    // Id of the Hydra session in which this process is running\n    //\n    ULONG SessionId;\n\n    //\n    // Filled in by LdrpInstallAppcompatBackend\n    //\n    ULARGE_INTEGER AppCompatFlags;\n\n    //\n    // ntuser appcompat flags\n    //\n    ULARGE_INTEGER AppCompatFlagsUser;\n\n    //\n    // Filled in by LdrpInstallAppcompatBackend\n    //\n    PVOID pShimData;\n\n    //\n    // Filled in by LdrQueryImageFileExecutionOptions\n    //\n    PVOID AppCompatInfo;\n\n    //\n    // Used by GetVersionExW as the szCSDVersion string\n    //\n    UNICODE_STRING CSDVersion;\n\n    //\n    // Fusion stuff\n    //\n    PVOID ActivationContextData;\n    PVOID ProcessAssemblyStorageMap;\n    PVOID SystemDefaultActivationContextData;\n    PVOID SystemAssemblyStorageMap;\n\n    //\n    // Enforced minimum initial commit stack\n    //\n    SIZE_T MinimumStackCommit;\n\n} PEB, *PPEB;\n\n#define ACTIVATION_CONTEXT_STACK_FLAG_QUERIES_DISABLED (0x00000001)\n\ntypedef struct _ACTIVATION_CONTEXT_STACK {\n    ULONG Flags;\n    ULONG NextCookieSequenceNumber;\n    PVOID ActiveFrame;\n    LIST_ENTRY FrameListCache;\n\n#if NT_SXS_PERF_COUNTERS_ENABLED\n    struct _ACTIVATION_CONTEXT_STACK_PERF_COUNTERS {\n        ULONGLONG Activations;\n        ULONGLONG ActivationCycles;\n        ULONGLONG Deactivations;\n        ULONGLONG DeactivationCycles;\n    } Counters;\n#endif // NT_SXS_PERF_COUNTERS_ENABLED\n} ACTIVATION_CONTEXT_STACK, *PACTIVATION_CONTEXT_STACK;\n\ntypedef const ACTIVATION_CONTEXT_STACK *PCACTIVATION_CONTEXT_STACK;\n\n#define TEB_ACTIVE_FRAME_CONTEXT_FLAG_EXTENDED (0x00000001)\n\ntypedef struct _TEB_ACTIVE_FRAME_CONTEXT {\n    ULONG Flags;\n    PCSTR FrameName;\n} TEB_ACTIVE_FRAME_CONTEXT, *PTEB_ACTIVE_FRAME_CONTEXT;\n\ntypedef const struct _TEB_ACTIVE_FRAME_CONTEXT *PCTEB_ACTIVE_FRAME_CONTEXT;\n\ntypedef struct _TEB_ACTIVE_FRAME_CONTEXT_EX {\n    TEB_ACTIVE_FRAME_CONTEXT BasicContext;\n    PCSTR SourceLocation; // e.g. \"Z:\\foo\\bar\\baz.c\"\n} TEB_ACTIVE_FRAME_CONTEXT_EX, *PTEB_ACTIVE_FRAME_CONTEXT_EX;\n\ntypedef const struct _TEB_ACTIVE_FRAME_CONTEXT_EX *PCTEB_ACTIVE_FRAME_CONTEXT_EX;\n\n#define TEB_ACTIVE_FRAME_FLAG_EXTENDED (0x00000001)\n\ntypedef struct _TEB_ACTIVE_FRAME {\n    ULONG Flags;\n    TYPE3(struct _TEB_ACTIVE_FRAME*) Previous;\n    PCTEB_ACTIVE_FRAME_CONTEXT Context;\n} TEB_ACTIVE_FRAME, *PTEB_ACTIVE_FRAME;\n\ntypedef const struct _TEB_ACTIVE_FRAME *PCTEB_ACTIVE_FRAME;\n\ntypedef struct _TEB_ACTIVE_FRAME_EX {\n    TEB_ACTIVE_FRAME BasicFrame;\n    PVOID ExtensionIdentifier; // use address of your DLL Main or something unique to your mapping in the address space\n} TEB_ACTIVE_FRAME_EX, *PTEB_ACTIVE_FRAME_EX;\n\ntypedef const struct _TEB_ACTIVE_FRAME_EX *PCTEB_ACTIVE_FRAME_EX;\n\ntypedef struct _CLIENT_ID {\n    HANDLE UniqueProcess;\n    HANDLE UniqueThread;\n} CLIENT_ID;\ntypedef CLIENT_ID *PCLIENT_ID;\n\n#define GDI_BATCH_BUFFER_SIZE 310\n\ntypedef struct _GDI_TEB_BATCH {\n    ULONG    Offset;\n    ULONG_PTR HDC;\n    ULONG    Buffer[GDI_BATCH_BUFFER_SIZE];\n} GDI_TEB_BATCH,*PGDI_TEB_BATCH;\n\ntypedef struct _Wx86ThreadState {\n    PULONG  CallBx86Eip;\n    PVOID   DeallocationCpu;\n    BOOLEAN UseKnownWx86Dll;\n    char    OleStubInvoked;\n} WX86THREAD, *PWX86THREAD;\n\n#define STATIC_UNICODE_BUFFER_LENGTH 261\n#define WIN32_CLIENT_INFO_LENGTH 62\n\ntypedef struct _PEB* PPEB;\n\ntypedef struct _TEB {\n    NT_TIB NtTib;\n    PVOID  EnvironmentPointer;\n    CLIENT_ID ClientId;\n    PVOID ActiveRpcHandle;\n    PVOID ThreadLocalStoragePointer;\n#if defined(PEBTEB_BITS)\n    PVOID ProcessEnvironmentBlock;\n#else\n    PPEB ProcessEnvironmentBlock;\n#endif\n    ULONG LastErrorValue;\n    ULONG CountOfOwnedCriticalSections;\n    PVOID CsrClientThread;\n    PVOID Win32ThreadInfo;          // PtiCurrent\n    ULONG User32Reserved[26];       // user32.dll items\n    ULONG UserReserved[5];          // Winsrv SwitchStack\n    PVOID WOW32Reserved;            // used by WOW\n    LCID CurrentLocale;\n    ULONG FpSoftwareStatusRegister; // offset known by outsiders!\n    PVOID SystemReserved1[54];      // Used by FP emulator\n    NTSTATUS ExceptionCode;         // for RaiseUserException\n    ACTIVATION_CONTEXT_STACK ActivationContextStack;   // Fusion activation stack\n    // sizeof(PVOID) is a way to express processor-dependence, more generally than #ifdef HOST_64BIT\n    UCHAR SpareBytes1[48 - sizeof(PVOID) - sizeof(ACTIVATION_CONTEXT_STACK)];\n    GDI_TEB_BATCH GdiTebBatch;      // Gdi batching\n    CLIENT_ID RealClientId;\n    HANDLE GdiCachedProcessHandle;\n    ULONG GdiClientPID;\n    ULONG GdiClientTID;\n    PVOID GdiThreadLocalInfo;\n    ULONG_PTR Win32ClientInfo[WIN32_CLIENT_INFO_LENGTH]; // User32 Client Info\n    PVOID glDispatchTable[233];     // OpenGL\n    ULONG_PTR glReserved1[29];      // OpenGL\n    PVOID glReserved2;              // OpenGL\n    PVOID glSectionInfo;            // OpenGL\n    PVOID glSection;                // OpenGL\n    PVOID glTable;                  // OpenGL\n    PVOID glCurrentRC;              // OpenGL\n    PVOID glContext;                // OpenGL\n    ULONG LastStatusValue;\n    UNICODE_STRING StaticUnicodeString;\n    WCHAR StaticUnicodeBuffer[STATIC_UNICODE_BUFFER_LENGTH];\n    PVOID DeallocationStack;\n    PVOID TlsSlots[TLS_MINIMUM_AVAILABLE];\n    LIST_ENTRY TlsLinks;\n    PVOID Vdm;\n    PVOID ReservedForNtRpc;\n    PVOID DbgSsReserved[2];\n    ULONG HardErrorsAreDisabled;\n    PVOID Instrumentation[16];\n    PVOID WinSockData;              // WinSock\n    ULONG GdiBatchCount;\n    BOOLEAN InDbgPrint;\n    BOOLEAN FreeStackOnTermination;\n    BOOLEAN HasFiberData;\n    BOOLEAN IdealProcessor;\n    ULONG Spare3;\n    PVOID ReservedForPerf;\n    PVOID ReservedForOle;\n    ULONG WaitingOnLoaderLock;\n    WX86THREAD Wx86Thread;\n    PPVOID TlsExpansionSlots;\n    LCID ImpersonationLocale;       // Current locale of impersonated user\n    ULONG IsImpersonating;          // Thread impersonation status\n    PVOID NlsCache;                 // NLS thread cache\n    PVOID pShimData;                // Per thread data used in the shim\n    ULONG HeapVirtualAffinity;\n    HANDLE CurrentTransactionHandle;// reserved for TxF transaction context\n    PTEB_ACTIVE_FRAME ActiveFrame;\n} TEB;\ntypedef TEB *PTEB;\n\ntypedef struct _CURDIR {\n    UNICODE_STRING DosPath;\n    HANDLE Handle;\n} CURDIR, *PCURDIR;\n\n#define RTL_USER_PROC_CURDIR_CLOSE      0x00000002\n#define RTL_USER_PROC_CURDIR_INHERIT    0x00000003\n\ntypedef struct _RTL_DRIVE_LETTER_CURDIR {\n    USHORT Flags;\n    USHORT Length;\n    ULONG TimeStamp;\n    STRING DosPath;\n} RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;\n\n\n#define RTL_MAX_DRIVE_LETTERS 32\n#define RTL_DRIVE_LETTER_VALID (USHORT)0x0001\n\ntypedef struct _RTL_USER_PROCESS_PARAMETERS {\n    ULONG MaximumLength;\n    ULONG Length;\n\n    ULONG Flags;\n    ULONG DebugFlags;\n\n    HANDLE ConsoleHandle;\n    ULONG  ConsoleFlags;\n    HANDLE StandardInput;\n    HANDLE StandardOutput;\n    HANDLE StandardError;\n\n    CURDIR CurrentDirectory;        // ProcessParameters\n    UNICODE_STRING DllPath;         // ProcessParameters\n    UNICODE_STRING ImagePathName;   // ProcessParameters\n    UNICODE_STRING CommandLine;     // ProcessParameters\n    PVOID Environment;              // NtAllocateVirtualMemory\n\n    ULONG StartingX;\n    ULONG StartingY;\n    ULONG CountX;\n    ULONG CountY;\n    ULONG CountCharsX;\n    ULONG CountCharsY;\n    ULONG FillAttribute;\n\n    ULONG WindowFlags;\n    ULONG ShowWindowFlags;\n    UNICODE_STRING WindowTitle;     // ProcessParameters\n    UNICODE_STRING DesktopInfo;     // ProcessParameters\n    UNICODE_STRING ShellInfo;       // ProcessParameters\n    UNICODE_STRING RuntimeData;     // ProcessParameters\n    RTL_DRIVE_LETTER_CURDIR CurrentDirectores[ RTL_MAX_DRIVE_LETTERS ];\n} RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;\n\n\ntypedef enum _PROCESSINFOCLASS {\n    ProcessBasicInformation,\n    ProcessQuotaLimits,\n    ProcessIoCounters,\n    ProcessVmCounters,\n    ProcessTimes,\n    ProcessBasePriority,\n    ProcessRaisePriority,\n    ProcessDebugPort,\n    ProcessExceptionPort,\n    ProcessAccessToken,\n    ProcessLdtInformation,\n    ProcessLdtSize,\n    ProcessDefaultHardErrorMode,\n    ProcessIoPortHandlers,          // Note: this is kernel mode only\n    ProcessPooledUsageAndLimits,\n    ProcessWorkingSetWatch,\n    ProcessUserModeIOPL,\n    ProcessEnableAlignmentFaultFixup,\n    ProcessPriorityClass,\n    ProcessWx86Information,\n    ProcessHandleCount,\n    ProcessAffinityMask,\n    ProcessPriorityBoost,\n    ProcessDeviceMap,\n    ProcessSessionInformation,\n    ProcessForegroundInformation,\n    ProcessWow64Information,\n    ProcessImageFileName,\n    ProcessLUIDDeviceMapsEnabled,\n    ProcessBreakOnTermination,\n    ProcessDebugObjectHandle,\n    ProcessDebugFlags,\n    ProcessHandleTracing,\n    MaxProcessInfoClass             // MaxProcessInfoClass should always be the last enum\n    } PROCESSINFOCLASS;\n\n\ntypedef struct _VM_COUNTERS {\n    SIZE_T PeakVirtualSize;\n    SIZE_T VirtualSize;\n    ULONG PageFaultCount;\n    SIZE_T PeakWorkingSetSize;\n    SIZE_T WorkingSetSize;\n    SIZE_T QuotaPeakPagedPoolUsage;\n    SIZE_T QuotaPagedPoolUsage;\n    SIZE_T QuotaPeakNonPagedPoolUsage;\n    SIZE_T QuotaNonPagedPoolUsage;\n    SIZE_T PagefileUsage;\n    SIZE_T PeakPagefileUsage;\n} VM_COUNTERS;\ntypedef VM_COUNTERS *PVM_COUNTERS;\n\n#undef TYPE3\n\n#endif // !defined(HOST_UNIX)\n\n#if !defined(TARGET_X86)\n\ntypedef enum _FUNCTION_TABLE_TYPE {\n    RF_SORTED,\n    RF_UNSORTED,\n    RF_CALLBACK\n} FUNCTION_TABLE_TYPE;\n\ntypedef struct _DYNAMIC_FUNCTION_TABLE {\n    LIST_ENTRY Links;\n    PT_RUNTIME_FUNCTION FunctionTable;\n    LARGE_INTEGER TimeStamp;\n\n#ifdef TARGET_ARM\n    ULONG MinimumAddress;\n    ULONG MaximumAddress;\n    ULONG BaseAddress;\n#else\n    ULONG64 MinimumAddress;\n    ULONG64 MaximumAddress;\n    ULONG64 BaseAddress;\n#endif\n\n    PGET_RUNTIME_FUNCTION_CALLBACK Callback;\n    PVOID Context;\n    PWSTR OutOfProcessCallbackDll;\n    FUNCTION_TABLE_TYPE Type;\n    ULONG EntryCount;\n} DYNAMIC_FUNCTION_TABLE, *PDYNAMIC_FUNCTION_TABLE;\n\n#endif // !TARGET_X86\n\n//\n//   AMD64\n//\n#ifdef TARGET_AMD64\n\n#define RUNTIME_FUNCTION__BeginAddress(prf)             (prf)->BeginAddress\n#define RUNTIME_FUNCTION__SetBeginAddress(prf,address)  ((prf)->BeginAddress = (address))\n\n#define RUNTIME_FUNCTION__EndAddress(prf, ImageBase)    (prf)->EndAddress\n\n#define RUNTIME_FUNCTION__GetUnwindInfoAddress(prf) (prf)->UnwindData\n#define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf,address) do { (prf)->UnwindData = (address); } while (0)\n#define OFFSETOF__RUNTIME_FUNCTION__UnwindInfoAddress offsetof(T_RUNTIME_FUNCTION, UnwindData)\n\n#include \"win64unwind.h\"\n\ntypedef\nPEXCEPTION_ROUTINE\n(RtlVirtualUnwindFn) (\n    IN ULONG HandlerType,\n    IN ULONG64 ImageBase,\n    IN ULONG64 ControlPc,\n    IN PT_RUNTIME_FUNCTION FunctionEntry,\n    IN OUT PCONTEXT ContextRecord,\n    OUT PVOID *HandlerData,\n    OUT PULONG64 EstablisherFrame,\n    IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL\n    );\n\n#ifndef HOST_UNIX\nextern RtlVirtualUnwindFn* RtlVirtualUnwind_Unsafe;\n#else // !HOST_UNIX\nPEXCEPTION_ROUTINE\nRtlVirtualUnwind_Unsafe(\n    IN ULONG HandlerType,\n    IN ULONG64 ImageBase,\n    IN ULONG64 ControlPc,\n    IN PT_RUNTIME_FUNCTION FunctionEntry,\n    IN OUT PCONTEXT ContextRecord,\n    OUT PVOID *HandlerData,\n    OUT PULONG64 EstablisherFrame,\n    IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL\n    );\n#endif // !HOST_UNIX\n\n#endif // TARGET_AMD64\n\n//\n//  X86\n//\n\n#ifdef TARGET_X86\n#ifndef HOST_UNIX\n//\n// x86 ABI does not define RUNTIME_FUNCTION. Define our own to allow unification between x86 and other platforms.\n//\n#ifdef HOST_X86\ntypedef struct _RUNTIME_FUNCTION {\n    DWORD BeginAddress;\n    DWORD UnwindData;\n} RUNTIME_FUNCTION, *PRUNTIME_FUNCTION;\n\ntypedef struct _DISPATCHER_CONTEXT {\n    _EXCEPTION_REGISTRATION_RECORD* RegistrationPointer;\n} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT;\n#endif // HOST_X86\n#endif // !HOST_UNIX\n\n#define RUNTIME_FUNCTION__BeginAddress(prf)             (prf)->BeginAddress\n#define RUNTIME_FUNCTION__SetBeginAddress(prf,addr)     ((prf)->BeginAddress = (addr))\n\n#ifdef FEATURE_EH_FUNCLETS\n#include \"win64unwind.h\"\n#include \"daccess.h\"\n\nFORCEINLINE\nDWORD\nRtlpGetFunctionEndAddress (\n    _In_ PT_RUNTIME_FUNCTION FunctionEntry,\n    _In_ TADDR ImageBase\n    )\n{\n    PTR_UNWIND_INFO pUnwindInfo = (PTR_UNWIND_INFO)(ImageBase + FunctionEntry->UnwindData);\n\n    return FunctionEntry->BeginAddress + pUnwindInfo->FunctionLength;\n}\n\n#define RUNTIME_FUNCTION__EndAddress(prf, ImageBase)   RtlpGetFunctionEndAddress(prf, ImageBase)\n\n#define RUNTIME_FUNCTION__GetUnwindInfoAddress(prf)    (prf)->UnwindData\n#define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf, addr) do { (prf)->UnwindData = (addr); } while(0)\n\n#ifdef HOST_X86\nEXTERN_C\nNTSYSAPI\nPEXCEPTION_ROUTINE\nNTAPI\nRtlVirtualUnwind (\n    _In_ DWORD HandlerType,\n    _In_ DWORD ImageBase,\n    _In_ DWORD ControlPc,\n    _In_ PRUNTIME_FUNCTION FunctionEntry,\n    __inout PT_CONTEXT ContextRecord,\n    _Out_ PVOID *HandlerData,\n    _Out_ PDWORD EstablisherFrame,\n    __inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers\n    );\n#endif // HOST_X86\n#endif // FEATURE_EH_FUNCLETS\n\n#endif // TARGET_X86\n\n#ifdef TARGET_ARM\n#include \"daccess.h\"\n\n//\n// Define unwind information flags.\n//\n\n#define UNW_FLAG_NHANDLER               0x0             /* any handler */\n#define UNW_FLAG_EHANDLER               0x1             /* filter handler */\n#define UNW_FLAG_UHANDLER               0x2             /* unwind handler */\n\n// This function returns the length of a function using the new unwind info on arm.\n// Taken from minkernel\\ntos\\rtl\\arm\\ntrtlarm.h.\nFORCEINLINE\nULONG\nRtlpGetFunctionEndAddress (\n    _In_ PT_RUNTIME_FUNCTION FunctionEntry,\n    _In_ TADDR ImageBase\n    )\n{\n    ULONG FunctionLength;\n\n    FunctionLength = FunctionEntry->UnwindData;\n    if ((FunctionLength & 3) != 0) {\n        FunctionLength = (FunctionLength >> 2) & 0x7ff;\n    } else {\n        FunctionLength = *(PTR_ULONG)(ImageBase + FunctionLength) & 0x3ffff;\n    }\n\n    return FunctionEntry->BeginAddress + 2 * FunctionLength;\n}\n\n#define RUNTIME_FUNCTION__BeginAddress(FunctionEntry)               ThumbCodeToDataPointer<DWORD,DWORD>((FunctionEntry)->BeginAddress)\n#define RUNTIME_FUNCTION__SetBeginAddress(FunctionEntry,address)    ((FunctionEntry)->BeginAddress = DataPointerToThumbCode<DWORD,DWORD>(address))\n\n#define RUNTIME_FUNCTION__EndAddress(FunctionEntry, ImageBase)      ThumbCodeToDataPointer<DWORD,DWORD>(RtlpGetFunctionEndAddress(FunctionEntry, ImageBase))\n\n#define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf,address) do { (prf)->UnwindData = (address); } while (0)\n\ntypedef struct _UNWIND_INFO {\n    // dummy\n} UNWIND_INFO, *PUNWIND_INFO;\n\n#if defined(HOST_UNIX) || defined(HOST_X86)\n\nEXTERN_C\nNTSYSAPI\nPEXCEPTION_ROUTINE\nNTAPI\nRtlVirtualUnwind (\n    _In_ DWORD HandlerType,\n    _In_ DWORD ImageBase,\n    _In_ DWORD ControlPc,\n    _In_ PT_RUNTIME_FUNCTION FunctionEntry,\n    __inout PT_CONTEXT ContextRecord,\n    _Out_ PVOID *HandlerData,\n    _Out_ PDWORD EstablisherFrame,\n    __inout_opt PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers\n    );\n#endif // HOST_UNIX || HOST_X86\n\n#define UNW_FLAG_NHANDLER 0x0\n\n#endif // TARGET_ARM\n\n#ifdef TARGET_ARM64\n#include \"daccess.h\"\n\n#define UNW_FLAG_NHANDLER               0x0             /* any handler */\n#define UNW_FLAG_EHANDLER               0x1             /* filter handler */\n#define UNW_FLAG_UHANDLER               0x2             /* unwind handler */\n\n// This function returns the RVA of the end of the function (exclusive, so one byte after the actual end)\n// using the unwind info on ARM64. (see ExternalAPIs\\Win9CoreSystem\\inc\\winnt.h)\nFORCEINLINE\nULONG64\nRtlpGetFunctionEndAddress (\n    _In_ PT_RUNTIME_FUNCTION FunctionEntry,\n    _In_ ULONG64 ImageBase\n    )\n{\n    ULONG64 FunctionLength;\n\n    FunctionLength = FunctionEntry->UnwindData;\n    if ((FunctionLength & 3) != 0)\n    {\n        // Compact form pdata.\n        if ((FunctionLength & 7) == 3)\n        {\n            // Long branch pdata, by standard this is 3 so size is 12.\n            FunctionLength = 3;\n        }\n        else\n        {\n            FunctionLength = (FunctionLength >> 2) & 0x7ff;\n        }\n    }\n    else\n    {\n        // Get from the xdata record.\n        FunctionLength = *(PTR_ULONG64)(ImageBase + FunctionLength) & 0x3ffff;\n    }\n\n    return FunctionEntry->BeginAddress + 4 * FunctionLength;\n}\n\n#define RUNTIME_FUNCTION__BeginAddress(FunctionEntry)               ((FunctionEntry)->BeginAddress)\n#define RUNTIME_FUNCTION__SetBeginAddress(FunctionEntry,address)    ((FunctionEntry)->BeginAddress = (address))\n\n#define RUNTIME_FUNCTION__EndAddress(FunctionEntry, ImageBase)      (RtlpGetFunctionEndAddress(FunctionEntry, (ULONG64)(ImageBase)))\n\n#define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf,address)         do { (prf)->UnwindData = (address); } while (0)\n\ntypedef struct _UNWIND_INFO {\n    // dummy\n} UNWIND_INFO, *PUNWIND_INFO;\n\nEXTERN_C\nNTSYSAPI\nPEXCEPTION_ROUTINE\nNTAPI\nRtlVirtualUnwind(\n    IN ULONG HandlerType,\n    IN ULONG64 ImageBase,\n    IN ULONG64 ControlPc,\n    IN PRUNTIME_FUNCTION FunctionEntry,\n    IN OUT PCONTEXT ContextRecord,\n    OUT PVOID *HandlerData,\n    OUT PULONG64 EstablisherFrame,\n    IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL\n    );\n\n#endif\n\n#ifdef TARGET_LOONGARCH64\n#include \"daccess.h\"\n\n#define UNW_FLAG_NHANDLER               0x0             /* any handler */\n#define UNW_FLAG_EHANDLER               0x1             /* filter handler */\n#define UNW_FLAG_UHANDLER               0x2             /* unwind handler */\n\n// This function returns the RVA of the end of the function (exclusive, so one byte after the actual end)\n// using the unwind info on LOONGARCH64. (see ExternalAPIs\\Win9CoreSystem\\inc\\winnt.h)\nFORCEINLINE\nULONG64\nRtlpGetFunctionEndAddress (\n    _In_ PT_RUNTIME_FUNCTION FunctionEntry,\n    _In_ ULONG64 ImageBase\n    )\n{\n    ULONG64 FunctionLength;\n\n    FunctionLength = FunctionEntry->UnwindData;\n    if ((FunctionLength & 3) != 0) {\n        FunctionLength = (FunctionLength >> 2) & 0x7ff;\n    } else {\n        memcpy(&FunctionLength, (void*)(ImageBase + FunctionLength), sizeof(UINT32));\n        FunctionLength &= 0x3ffff;\n    }\n\n    return FunctionEntry->BeginAddress + 4 * FunctionLength;\n}\n\n#define RUNTIME_FUNCTION__BeginAddress(FunctionEntry)               ((FunctionEntry)->BeginAddress)\n#define RUNTIME_FUNCTION__SetBeginAddress(FunctionEntry,address)    ((FunctionEntry)->BeginAddress = (address))\n\n#define RUNTIME_FUNCTION__EndAddress(FunctionEntry, ImageBase)      (RtlpGetFunctionEndAddress(FunctionEntry, (ULONG64)(ImageBase)))\n\n#define RUNTIME_FUNCTION__SetUnwindInfoAddress(prf,address)         do { (prf)->UnwindData = (address); } while (0)\n\ntypedef struct _UNWIND_INFO {\n    // dummy\n} UNWIND_INFO, *PUNWIND_INFO;\n\nEXTERN_C\nNTSYSAPI\nPEXCEPTION_ROUTINE\nNTAPI\nRtlVirtualUnwind(\n    IN ULONG HandlerType,\n    IN ULONG64 ImageBase,\n    IN ULONG64 ControlPc,\n    IN PRUNTIME_FUNCTION FunctionEntry,\n    IN OUT PCONTEXT ContextRecord,\n    OUT PVOID *HandlerData,\n    OUT PULONG64 EstablisherFrame,\n    IN OUT PKNONVOLATILE_CONTEXT_POINTERS ContextPointers OPTIONAL\n    );\n\n#endif // TARGET_LOONGARCH64\n\n#endif  // CLRNT_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrtypes.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ================================================================================\n// Standard primitive types for CLR code\n//\n// This header serves as a platform layer containing all of the primitive types\n// which we use across CLR implementation code.\n// ================================================================================\n\n\n#ifndef CLRTYPES_H_\n#define CLRTYPES_H_\n\n#if defined(_MSC_VER) && !defined(SOURCE_FORMATTING)\n    // Prefer intsafe.h when available, which defines many of the MAX/MIN\n    // values below (which is why they are in #ifndef blocks).\n    #include <intsafe.h>\n#endif\n\n#include \"crtwrap.h\"\n#include \"winwrap.h\"\n#include \"staticcontract.h\"\n#include \"static_assert.h\"\n\n#if HOST_64BIT\n    #define POINTER_BITS (64)\n#else\n    #define POINTER_BITS (32)\n#endif\n\n// ================================================================================\n// Integral types - use these for all integral types\n// These types are in ALL_CAPS.  Each type has a _MIN and _MAX defined for it.\n// ================================================================================\n\n// --------------------------------------------------------------------------------\n// Use these types for fixed size integers:\n// INT8 UINT8 INT16 UINT16 INT32 UINT32 INT64 UINT64\n// --------------------------------------------------------------------------------\n\n#ifndef INT8_MAX\n    typedef signed char           INT8;\n    typedef unsigned char         UINT8;\n    typedef short                 INT16;\n    typedef unsigned short        UINT16;\n    typedef int                   INT32;\n    typedef unsigned int          UINT32;\n    typedef __int64               INT64;\n    typedef unsigned __int64      UINT64;\n\n    #ifdef _MSC_VER\n        /* These macros must exactly match those in the Windows SDK's intsafe.h */\n        #define INT8_MIN        (-127i8 - 1)\n        #define INT16_MIN       (-32767i16 - 1)\n        #define INT32_MIN       (-2147483647i32 - 1)\n        #define INT64_MIN       (-9223372036854775807i64 - 1)\n\n        #define INT8_MAX        127i8\n        #define INT16_MAX       32767i16\n        #define INT32_MAX       2147483647i32\n        #define INT64_MAX       9223372036854775807i64\n\n        #define UINT8_MAX       0xffui8\n        #define UINT16_MAX      0xffffui16\n        #define UINT32_MAX      0xffffffffui32\n        #define UINT64_MAX      0xffffffffffffffffui64\n    #else\n        #define INT8_MIN        ((INT8)0x80)\n        #define INT16_MIN       ((INT16)0x8000)\n        #define INT32_MIN       ((INT32)0x80000000)\n        #define INT64_MIN       ((INT64) I64(0x8000000000000000))\n\n        #define INT8_MAX        ((INT8)0x7f)\n        #define INT16_MAX       ((INT16)0x7fff)\n        #define INT32_MAX       ((INT32)0x7fffffff)\n        #define INT64_MAX       ((INT64) I64(0x7fffffffffffffff))\n\n        #define UINT8_MAX       ((UINT8)0xffU)\n        #define UINT16_MAX      ((UINT16)0xffffU)\n        #define UINT32_MAX      ((UINT32)0xffffffffU)\n        #define UINT64_MAX      ((UINT64) UI64(0xffffffffffffffff))\n    #endif\n#endif // !INT8_MAX\n\n// UINTX_MINs aren't defined in standard header files,\n// so definition must be separately predicated.\n#ifndef UINT8_MIN\n    #ifdef _MSC_VER\n        #define UINT8_MIN       0ui8\n        #define UINT16_MIN      0ui16\n        #define UINT32_MIN      0ui32\n        #define UINT64_MIN      0ui64\n    #else\n        #define UINT8_MIN       ((UINT8)0U)\n        #define UINT16_MIN      ((UINT16)0U)\n        #define UINT32_MIN      ((UINT32)0U)\n        #define UINT64_MIN      ((UINT64) UI64(0))\n    #endif\n#endif\n\n\n// --------------------------------------------------------------------------------\n// Use these types for pointer-sized integral types\n// SIZE_T SSIZE_T\n//\n// These types are the ONLY types which can be safely cast back and forth from a\n// pointer.\n// --------------------------------------------------------------------------------\n\n#ifndef SIZE_T_MAX\n    #if NEED_POINTER_SIZED_TYPEDEFS\n        typedef size_t                SIZE_T;\n        typedef ptrdiff_t             SSIZE_T;\n    #endif\n\n    #if POINTER_BITS == 64\n        #define SIZE_T_MAX              UINT64_MAX\n        #define SIZE_T_MIN              UINT64_MIN\n\n        #define SSIZE_T_MAX             INT64_MAX\n        #define SSIZE_T_MIN             INT64_MIN\n    #else\n        #define SIZE_T_MAX              UINT32_MAX\n        #define SIZE_T_MIN              UINT32_MIN\n\n        #define SSIZE_T_MAX             INT32_MAX\n        #define SSIZE_T_MIN             INT32_MIN\n    #endif\n#endif\n\n// --------------------------------------------------------------------------------\n// Non-pointer sized types\n// COUNT_T SCOUNT_T\n//\n// Use these types for \"large\" counts or indexes which will not exceed 32 bits.  They\n// may also be used for pointer differences, if you can guarantee that the pointers\n// are pointing to the same region of memory. (It can NOT be used for arbitrary\n// pointer subtraction.)\n// --------------------------------------------------------------------------------\n\n#ifndef COUNT_T_MAX\n    typedef UINT32                  COUNT_T;\n    typedef INT32                   SCOUNT_T;\n\n    #define COUNT_T_MAX             UINT32_MAX\n    #define COUNT_T_MIN             UINT32_MIN\n\n    #define SCOUNT_T_MAX            INT32_MAX\n    #define SCOUNT_T_MIN            INT32_MIN\n#endif\n\n// --------------------------------------------------------------------------------\n// Integral types with additional semantic content\n// BOOL BYTE\n// --------------------------------------------------------------------------------\n\n#ifndef BYTE_MAX\n    #if NEED_BOOL_TYPEDEF\n        typedef bool                    BOOL;\n    #endif\n\n    #define BOOL_MAX                1\n    #define BOOL_MIN                0\n\n    #define TRUE                    1\n    #define FALSE                   0\n\n    typedef UINT8                   BYTE;\n\n    #define BYTE_MAX                UINT8_MAX\n    #define BYTE_MIN                UINT8_MIN\n#endif\n\n// --------------------------------------------------------------------------------\n// Character types\n// CHAR SCHAR UCHAR WCHAR\n// --------------------------------------------------------------------------------\n\ntypedef char                    CHAR;\ntypedef signed char             SCHAR;\ntypedef unsigned char           UCHAR;\n\ntypedef CHAR                    ASCII;\ntypedef CHAR                    ANSI;\ntypedef CHAR                    UTF8;\n\n// Standard C defines:\n\n// CHAR_MAX\n// CHAR_MIN\n// SCHAR_MAX\n// SCHAR_MIN\n// UCHAR_MAX\n// UCHAR_MIN\n// WCHAR_MAX\n// WCHAR_MIN\n\n#ifndef ASCII_MAX\n    #define ASCII_MIN              ((ASCII)0)\n    #define ASCII_MAX              ((ASCII)127)\n\n    #define ANSI_MIN               ((ANSI)0)\n    #define ANSI_MAX               ((ANSI)255)\n\n    #define UTF8_MIN               ((UTF8)0)\n    #define UTF8_MAX               ((UTF8)255)\n#endif\n\n// ================================================================================\n// Non-integral types\n// These types are in ALL_CAPS.\n// ================================================================================\n\n// --------------------------------------------------------------------------------\n// Floating point types\n// FLOAT DOUBLE\n// --------------------------------------------------------------------------------\n\n// ================================================================================\n// Runtime type definitions - these are guaranteed to be identical with the\n// corresponding managed type\n// ================================================================================\n\ntypedef WCHAR       CLR_CHAR;\ntypedef INT8        CLR_I1;\ntypedef UINT8       CLR_U1;\ntypedef INT16       CLR_I2;\ntypedef UINT16      CLR_U2;\ntypedef INT32       CLR_I4;\ntypedef UINT32      CLR_U4;\ntypedef INT64       CLR_I8;\ntypedef UINT64      CLR_U8;\ntypedef FLOAT       CLR_R4;\ntypedef DOUBLE      CLR_R8;\ntypedef SSIZE_T     CLR_I;\ntypedef SIZE_T      CLR_U;\n\n#define CLR_CHAR_MAX    WCHAR_MAX\n#define CLR_CHAR_MIN    WCHAR_MIN\n\n#define CLR_I1_MAX      INT8_MAX\n#define CLR_I1_MIN      INT8_MIN\n\n#define CLR_U1_MAX      UINT8_MAX\n#define CLR_U1_MIN      UINT8_MIN\n\n#define CLR_I2_MAX      INT16_MAX\n#define CLR_I2_MIN      INT16_MIN\n\n#define CLR_U2_MAX      UINT16_MAX\n#define CLR_U2_MIN      UINT16_MIN\n\n#define CLR_I4_MAX      INT32_MAX\n#define CLR_I4_MIN      INT32_MIN\n\n#define CLR_U4_MAX      UINT32_MAX\n#define CLR_U4_MIN      UINT32_MIN\n\n#define CLR_I8_MAX      INT64_MAX\n#define CLR_I8_MIN      INT64_MIN\n\n#define CLR_U8_MAX      UINT64_MAX\n#define CLR_U8_MIN      UINT64_MIN\n\n#define CLR_I_MAX       SSIZE_T_MAX\n#define CLR_I_MIN       SSIZE_T_MIN\n\n#define CLR_U_MAX       SIZE_T_MAX\n#define CLR_U_MIN       SIZE_T_MIN\n\n    typedef bool            CLR_BOOL;\n\nstatic_assert_no_msg(sizeof(CLR_BOOL) == 1);\n\n#define CLR_BOOL_MAX    BOOL_MAX\n#define CLR_BOOL_MIN    BOOL_MIN\n\n#define CLR_NAN_32 0xFFC00000\n#define CLR_NAN_64 I64(0xFFF8000000000000)\n\n// ================================================================================\n// Simple utility functions\n// ================================================================================\n\n// Note that these routines are in terms of UINT, ULONG, and ULONG64, since those are\n// the unsigned integral types the compiler overloads based on.\n\n// --------------------------------------------------------------------------------\n// Min/Max\n// --------------------------------------------------------------------------------\n\ntemplate <typename T>\nT Min(T v1, T v2)\n{\n    STATIC_CONTRACT_LEAF;\n    return v1 < v2 ? v1 : v2;\n}\n\ntemplate <typename T>\nT Max(T v1, T v2)\n{\n    STATIC_CONTRACT_LEAF;\n    return v1 > v2 ? v1 : v2;\n}\n\n// --------------------------------------------------------------------------------\n// Alignment bit twiddling macros - \"alignment\" must be power of 2\n//\n// AlignUp - align value to given increment, rounding up\n// AlignmentPad - amount adjusted by AlignUp\n//       AlignUp(value, x) == value + AlignmentPad(value, x)\n//\n// AlignDown - align value to given increment, rounding down\n// AlignmentTrim - amount adjusted by AlignDown\n//       AlignDown(value, x) == value - AlignmentTrim(value, x)\n// --------------------------------------------------------------------------------\n\ninline UINT AlignUp(UINT value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return (value+alignment-1)&~(alignment-1);\n}\n\n#if defined(_MSC_VER)\ninline ULONG AlignUp(ULONG value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return (value+alignment-1)&~(alignment-1);\n}\n#endif\n\ninline UINT64 AlignUp(UINT64 value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return (value+alignment-1)&~(UINT64)(alignment-1);\n}\n\n#ifdef __APPLE__\ninline SIZE_T AlignUp(SIZE_T value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return (value+alignment-1)&~(SIZE_T)(alignment-1);\n}\n#endif // __APPLE__\n\ninline UINT AlignDown(UINT value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return (value&~(alignment-1));\n}\n\n#if defined(_MSC_VER)\ninline ULONG AlignDown(ULONG value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return (value&~(ULONG)(alignment-1));\n}\n#endif\n\ninline UINT64 AlignDown(UINT64 value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return (value&~(UINT64)(alignment-1));\n}\n\ninline UINT AlignmentPad(UINT value, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    return AlignUp(value, alignment) - value;\n}\n\n#if defined(_MSC_VER)\ninline UINT AlignmentPad(ULONG value, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    return AlignUp(value, alignment) - value;\n}\n#endif\n\ninline UINT AlignmentPad(UINT64 value, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    return (UINT) (AlignUp(value, alignment) - value);\n}\n\n#ifdef __APPLE__\ninline UINT AlignmentPad(SIZE_T value, UINT alignment)\n{\n    STATIC_CONTRACT_WRAPPER;\n    return (UINT) (AlignUp(value, alignment) - value);\n}\n#endif // __APPLE__\n\ninline UINT AlignmentTrim(UINT value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return value&(alignment-1);\n}\n\n#ifndef HOST_UNIX\n// For Unix this and the previous function get the same types.\n// So, exclude this one.\ninline UINT AlignmentTrim(ULONG value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return value&(alignment-1);\n}\n#endif // HOST_UNIX\n\ninline UINT AlignmentTrim(UINT64 value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return ((UINT)value)&(alignment-1);\n}\n\n#ifdef __APPLE__\ninline UINT AlignmentTrim(SIZE_T value, UINT alignment)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return ((UINT)value)&(alignment-1);\n}\n#endif // __APPLE__\n\n#endif  // CLRTYPES_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/clrversion.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#include \"runtime_version.h\"\n\n#ifndef QUOTE_MACRO\n#define QUOTE_MACRO_HELPER(x)       #x\n#define QUOTE_MACRO(x)              QUOTE_MACRO_HELPER(x)\n#endif\n\n#ifndef QUOTE_MACRO_L\n#define QUOTE_MACRO_L_HELPER(x)     L###x\n#define QUOTE_MACRO_L(x)            QUOTE_MACRO_L_HELPER(x)\n#endif\n\n#define CLR_METADATA_VERSION        \"v4.0.30319\"\n#define CLR_METADATA_VERSION_L      W(\"v4.0.30319\")\n\n#define CLR_PRODUCT_VERSION         QUOTE_MACRO(RuntimeProductVersion)\n#define CLR_PRODUCT_VERSION_L       QUOTE_MACRO_L(RuntimeProductVersion)\n\n#define VER_ASSEMBLYVERSION_STR     QUOTE_MACRO(RuntimeAssemblyMajorVersion.RuntimeAssemblyMinorVersion.0.0)\n#define VER_ASSEMBLYVERSION_STR_L   QUOTE_MACRO_L(RuntimeAssemblyMajorVersion.RuntimeAssemblyMinorVersion.0.0)\n\n#define VER_FILEVERSION_STR         QUOTE_MACRO(RuntimeFileMajorVersion.RuntimeFileMinorVersion.RuntimeFileBuildVersion.RuntimeFileRevisionVersion)\n#define VER_FILEVERSION_STR_L       QUOTE_MACRO_L(RuntimeFileMajorVersion.RuntimeFileMinorVersion.RuntimeFileBuildVersion.RuntimeFileRevisionVersion)\n\n#define VER_LEGALCOPYRIGHT_LOGO_STR    \"Copyright (c) Microsoft Corporation.  All rights reserved.\"\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/complex.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// complex.h\n//\n\n//\n// Defines a basic complex number data type.  We cannot use the standard C++ library's\n// complex implementation, because the CLR links to the wrong CRT.\n//\n\n#ifndef _COMPLEX_H_\n#define _COMPLEX_H_\n\n#include <math.h>\n\n//\n// Default compilation mode is /fp:precise, which disables fp intrinsics. This causes us to pull in FP stuff (sqrt,etc.) from\n// The CRT, and increases our download size.  We don't need the extra precision this gets us, so let's switch to\n// the intrinsic versions.\n//\n#ifdef _MSC_VER\n#pragma float_control(precise, off, push)\n#endif\n\n\nclass Complex\n{\npublic:\n    double r;\n    double i;\n\n    Complex() : r(0), i(0) {}\n    Complex(double real) : r(real), i(0) {}\n    Complex(double real, double imag) : r(real), i(imag) {}\n    Complex(const Complex& other) : r(other.r), i(other.i) {}\n};\n\ninline Complex operator+(Complex left, Complex right)\n{\n    LIMITED_METHOD_CONTRACT;\n    return Complex(left.r + right.r, left.i + right.i);\n}\n\ninline Complex operator-(Complex left, Complex right)\n{\n    LIMITED_METHOD_CONTRACT;\n    return Complex(left.r - right.r, left.i - right.i);\n}\n\ninline Complex operator*(Complex left, Complex right)\n{\n    LIMITED_METHOD_CONTRACT;\n    return Complex(\n        left.r * right.r - left.i * right.i,\n        left.r * right.i + left.i * right.r);\n}\n\ninline Complex operator/(Complex left, Complex right)\n{\n    LIMITED_METHOD_CONTRACT;\n    double denom = right.r * right.r + right.i * right.i;\n    return Complex(\n        (left.r * right.r + left.i * right.i) / denom,\n        (-left.r * right.i + left.i * right.r) / denom);\n}\n\ninline double abs(Complex c)\n{\n    LIMITED_METHOD_CONTRACT;\n    return sqrt(c.r * c.r + c.i * c.i);\n}\n\n#ifdef _MSC_VER\n#pragma float_control(pop)\n#endif\n\n\n#endif //_COMPLEX_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/configuration.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// --------------------------------------------------------------------------------------------------\n// configuration.h\n//\n//\n// Access and update configuration values, falling back on legacy CLRConfig methods where necessary.\n//\n// --------------------------------------------------------------------------------------------------\n\n#include \"clrconfig.h\"\n\n#ifndef __configuration_h__\n#define __configuration_h__\n\nclass Configuration\n{\npublic:\n    static void InitializeConfigurationKnobs(int numberOfConfigs, LPCWSTR *configNames, LPCWSTR *configValues);\n\n    // Returns (in priority order):\n    //    - The value of the ConfigDWORDInfo if it's set\n    //    - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul).\n    //    - The default set in the ConfigDWORDInfo\n    static DWORD GetKnobDWORDValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);\n\n    // Returns (in priority order):\n    //    - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul)\n    //    - The default value passed in\n    static DWORD GetKnobDWORDValue(LPCWSTR name, DWORD defaultValue);\n\n    // Unfortunately our traditional config system insists on interpreting numbers as 32-bit so interpret the config\n    // in the traditional way separately if you need to.\n    //\n    // Returns (in priority order):\n    //    - The value of the ConfigurationKnob (searched by name) if it's set (performs a _wcstoui64)\n    //    - The default value passed in\n    static ULONGLONG GetKnobULONGLONGValue(LPCWSTR name, ULONGLONG defaultValue);\n\n    // Returns (in priority order):\n    //    - The value of the ConfigStringInfo if it's set\n    //    - The value of the ConfigurationKnob (searched by name) if it's set\n    //    - nullptr\n    static LPCWSTR GetKnobStringValue(LPCWSTR name, const CLRConfig::ConfigStringInfo& stringInfo);\n\n    // Returns (in priority order):\n    //    - The value of the ConfigurationKnob (searched by name) if it's set\n    //    - nullptr\n    static LPCWSTR GetKnobStringValue(LPCWSTR name);\n\n    // Returns (in priority order):\n    //    - The value of the ConfigDWORDInfo if it's set (0 is false, anything else is true)\n    //    - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with \"true\").\n    //    - The default set in the ConfigDWORDInfo (0 is false, anything else is true)\n    static bool GetKnobBooleanValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);\n\n    // Returns (in priority order):\n    //    - The value of the ConfigDWORDInfo if it's set (0 is false, anything else is true)\n    //    - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with \"true\").\n    //    - The default value passed in\n    static bool GetKnobBooleanValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo, bool defaultValue);\n\n    // Returns (in priority order):\n    //    - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with \"true\").\n    //    - The default value passed in\n    static bool GetKnobBooleanValue(LPCWSTR name, bool defaultValue);\n};\n\n#endif // __configuration_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/contract.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// Contract.h\n//\n\n// ! I am the owner for issues in the contract *infrastructure*, not for every\n// ! CONTRACT_VIOLATION dialog that comes up. If you interrupt my work for a routine\n// ! CONTRACT_VIOLATION, you will become the new owner of this file.\n//--------------------------------------------------------------------------------\n// CONTRACTS - User Reference\n//\n//   A CONTRACT is a container for a set of checked declarations about a\n// function.  Besides giving developers a \"laundry list\" of checks to\n// make checking more complete, contracts compile these checks\n// as hidden annotations into the checked executable that our static scanner\n// uses to detect violations automatically.\n//\n//   Contracts can be dynamic or static. Dynamic contracts perform runtime checks\n// as well as being visible to the static scanner. Static contracts generate no\n// runtime code but are still visible to the scanner. Dynamic contracts are\n// preferred unless perf or other considerations preclude them.\n//\n//   The following annotations can appear in contracts:\n//\n//\n//      THROWS          an exception might be thrown out of the function\n//      -or- NOTHROW    an exception will NOT be thrown out of the function\n//\n//\n//\n//      INJECT_FAULT(statement)   function might require its caller to handle an OOM\n//      -or- FAULT_FORBID         function will NOT require its caller to handle an OOM\n//\n//\n//\n//      GC_TRIGGERS             the function can trigger a GC\n//      -or- GC_NOTRIGGER       the function will never trigger a GC provided its\n//                              called in coop mode.\n//\n//\n//      MODE_COOPERATIVE        the function requires Cooperative GC mode on entry\n//      -or- MODE_PREEMPTIVE    the function requires Preemptive GC mode on entry\n//      -or- MODE_ANY           the function can be entered in either mode\n//\n//      LOADS_TYPE(level)       the function promises not to load any types beyond \"level\"\n//\n//      CAN_TAKE_LOCK           the function has a code path that takes a lock\n//      _or_ (CAN_TAKE_LOCK and CANNOT_RETAKE_LOCK)\n//                              the function has a code path that takes a lock, but never tries to reenter\n//                              locks held at the time this function was called.\n//      -or- CANNOT_TAKE_LOCK   the function will never allow a lock to be taken\n//      -or-                    the default is WRAPPER(CAN_TAKE_LOCK).  i.e., if any callees take locks,\n//                              then it's ok for this function to as well.  If LIMITED_METHOD_CONTRACT is specified,\n//                              however, then CANNOT_TAKE_LOCK is assumed.\n//\n//\n//      SUPPORTS_DAC            The function has been written to be callable from out-of-process using DAC.\n//                              In builds where DACCESS_COMPILE is defined, such functions can only call\n//                              other such functions (and a few primitives like new).  Functions that support\n//                              DAC must be carefully written to conform to the rules in daccess.h.\n//\n//      SUPPORTS_DAC_HOST_ONLY  The function and its call graph has been written to be callable from out of process\n//                              using DAC, but it differs from SUPPORTS_DAC in that these functions won't perform\n//                              any marshalling. Because it does no marshalling, SUPPORTS_DAC_HOST_ONLY functions\n//                              and their call graph won't be checked by DacCop. This should only be used by utility\n//                              functions which will never marshal anything.\n//\n//      PRECONDITION(X) -   generic CHECK or BOOL expression which should be true\n//                          on function entry\n//\n//      POSTCONDITION(X) -  generic CHECK or BOOL expression which should be true\n//                          on function entry.  Note that variable RETVAL will be\n//                          available for use in the expression.\n//\n//\n//      INSTANCE_CHECK -    equivalent of:\n//                          PRECONDITION(CheckPointer(this));\n//                          POSTCONDITION(CheckInvariant(this));\n//      INSTANCE_CHECK_NULL - equivalent of:\n//                          PRECONDITION(CheckPointer(this, NULL_OK));\n//                          POSTCONDITION(CheckInvariant(this, NULL_OK));\n//      CONSTRUCTOR_CHECK - equivalent of:\n//                          POSTCONDITION(CheckPointer(this));\n//      DESTRUCTOR_CHECK -  equivalent of:\n//                          PRECONDITION(CheckPointer(this));\n//\n//\n//\n//\n//   Contracts come in the following flavors:\n//\n//     Dynamic:\n//        CONTRACTL          the standard version used for all dynamic contracts\n//                           except those including postconditions.\n//\n//        CONTRACT(rettype)  an uglier version of CONTRACTL that's unfortunately\n//                           needed to support postconditions. You must specify\n//                           the correct return type and it cannot be \"void.\"\n//                           (Use CONTRACT_VOID instead) You must use the\n//                           RETURN macro rather than the \"return\" keyword.\n//\n//        CONTRACT_VOID      you can't supply \"void\" to a CONTRACT - use this\n//                           instead.\n//\n//     Static:\n//        LIMITED_METHOD_CONTRACT\n//                           A static contract equivalent to NOTHROW/GC_NOTRIGGER/FORBID_FAULT/MODE_ANY.\n//                           Use only for trivial functions that call only functions with LIMITED_METHOD_CONTRACTs\n//                           (as long as there is no cycle that may introduce infinite recursion).\n//\n//        STATIC_CONTRACT_THROWS\n//        STATIC_CONTRACT_NOTHROW\n//        STATIC_CONTRACT_GC_TRIGGERS\n//        STATIC_CONTRACT_GCNOTRIGGER\n//        STATIC_CONTRACT_FAULT\n//        STATIC_CONTRACT_FORBID_FAULT\n//                           use to implement statically checkable contracts\n//                           when runtime contracts cannot be used.\n//\n//\n//   WRAPPER(annotation)\n//\n// When a function does not explicitly caused a condition, use the WRAPPER macro around\n// the declaration.  This implies that the function is dependent on the functions it calls\n// for its behaviour, and guarantees nothing.\n//\n//\n//   CONTRACT_VIOLATION(violationmask):\n//\n//        A bandaid used to suppress contract assertions. A contract violation\n//        is always a bug and you're expected to remove it before shipping.\n//        If a violation cannot be fixed immediately, however, it's better\n//        to use this on the offending callsite than to disable a contract entirely.\n//\n//        The violationmask can be one or more of the following OR'd together.\n//\n//              ThrowsViolation\n//              GCViolation\n//              ModeViolation\n//              FaultViolation\n//              FaultNotFatal\n//              HostViolation\n//              LoadsTypeViolation\n//              TakesLockViolation\n//\n//        The associated assertion will be suppressed until you leave the scope\n//        containing the CONTRACT_VIOLATION. Note, however, that any called\n//        function that redeclares the associated annotation reinstates\n//        the assert for the scope of *its* call. This prevents a CONTRACT_VIOLATION\n//        placed at the root of a calltree from decimating our entire protection.\n//\n//\n//   PERMANENT_CONTRACT_VIOLATION(violationmask, permanentContractViolationReason):\n//\n//        Like a CONTRACT_VIOLATION but also indicates that the violation was a deliberate decision\n//        and we don't plan on removing the violation in the next release.  The reason\n//        for the violation should be given as the second parameter to the macro.  Reasons\n//        are currently for documentation purposes only and do not have an effect on the binary.\n//        Valid values are listed below in the definition of PermanentContractViolationReason.\n//\n//\n//    CONDITIONAL_CONTRACT_VIOLATION(violationmask, condition):\n//\n//        Similar to CONTRACT_VIOLATION, but only suppresses the contract if the\n//        condition evaluates to non-zero.  The need for this macro should be very\n//        rare, but it can be useful if a contract should be suppressed based on a\n//        condition known only at run-time.  For example, if a particular test causes\n//        call sequences never expected by real scenarios, you may want to suppress\n//        resulting violations, but only when that test is run.\n//\n//   WRAPPER_NO_CONTRACT\n//\n//        A do-nothing contract used by functions that trivially wrap another.\n//\n//\n// \"LEGACY\" stuff - these features have been mostly superseded by better solutions\n//     so their use should be discouraged.\n//\n//\n//   DISABLED(annotation)\n//\n//        Indicates that a condition is supposed to be checked but is being suppressed\n//        due to some temporary bug. The more surgical CONTRACT_VIOLATION is\n//        preferred over DISABLED.\n//\n//   UNCHECKED(annotation)\n//\n//        Indicates that a condition is supposed to be checked but is being suppressed\n//        due for perf reasons. Use STATIC_CONTRACT over this.\n//\n//\n//   Default values:\n//        If you don't specify certain annotaions, you get defaults.\n//           - THROWS/NOTHROW          defaults to THROWS\n//           - GCTRIGGERS/GCNOTRIGGER  defaults to GCTRIGGERS within the VM directory\n//                                     and to no check otherwise\n//           - INJECT/FORBID_FAULT     defaults to no check\n//           - MODE                    defaults to MODE_ANY\n//\n//        The problem is that defaults don't work well with static contracts.\n//        The scanner will always treat a missing annotation as DISABLED.\n//        New code should not rely on defaults. Explicitly state your invariants.\n//\n//\n//--------------------------------------------------------------------------------\n\n\n\n\n#ifndef CONTRACT_H_\n#define CONTRACT_H_\n\n#ifdef _MSC_VER\n#pragma warning(disable:4189) //local variable is initialized but not referenced\n#endif\n\n\n// We only enable contracts in _DEBUG builds\n#if defined(_DEBUG) && !defined(DISABLE_CONTRACTS) && !defined(JIT_BUILD)\n#define ENABLE_CONTRACTS_DATA\n#endif\n\n// Also, we won't enable contracts if this is a DAC build.\n#if defined(ENABLE_CONTRACTS_DATA) && !defined(DACCESS_COMPILE) && !defined(CROSS_COMPILE)\n#define ENABLE_CONTRACTS\n#endif\n\n// Finally, only define the implementation parts of contracts if this isn't a DAC build.\n#if defined(_DEBUG_IMPL) && defined(ENABLE_CONTRACTS)\n#define ENABLE_CONTRACTS_IMPL\n#endif\n\n#include \"specstrings.h\"\n#include \"clrtypes.h\"\n#include \"malloc.h\"\n#include \"check.h\"\n#include \"debugreturn.h\"\n#include \"staticcontract.h\"\n\n#ifdef ENABLE_CONTRACTS_DATA\n\n#include \"eh.h\"\n\n// We chain these onto a stack to give us a stack trace of contract assertions (useful\n// when the bug report doesn't contain valid symbols)\n\nstruct ContractStackRecord\n{\n    ContractStackRecord *m_pNext;\n    const char          *m_szFunction;\n    const char          *m_szFile;\n    int                  m_lineNum;\n    UINT                 m_testmask;  // Bitmask of Contract::TestEnum bitsf\n    const char          *m_construct; // The syntactic construct that pushed this thing\n};\n\nclass CrstBase;\n\n// The next few enums / structs are used to keep track of all kinds of locks\n// currently taken by the current thread (crsts, spinlocks, CLR critical sections).\n// Across the VM, there are still multiple counts of locks.  The lock counts in these\n// contract structs are used to verify consistency of lock take/release in EE code, and\n// for contracts.  Both user and EE locks are tracked here, but it's EE code consistency\n// we're verifying.  The Thread object keeps its own counts as well, primarily of user\n// locks for implementing thread abort & escalation policy.  We tried to have the Thread\n// counts also be used for consistency checking, but that doesn't work.  Thread counters\n// have the following behavior that hurts our internal consistency checks:\n//      - They only count user locks.\n//      - Counters are reset & restored as we leave and return to AppDomains\n\n// An array of these is stored in DbgStateLockData::m_rgTakenLockInfos\n// to remember which locks we've taken.  If you hit an assert that\n// indicates we're exiting locks in the wrong order, or that locks were\n// taken when we expected none to be taken, then you can use\n// DbgStateLockData::m_rgTakenLockInfos to see the locks we know about.\nstruct TakenLockInfo\n{\n    // Generally, this will be a pointer to the lock, but really it's just\n    // a value that identifies which lock is taken.  Ya see, sometimes we don't\n    // have a lock pointer handy (e.g., if the lock is based on a GC object,\n    // which has no persistent object pointer we can use).  Look at the source\n    // indicated by m_szFile / m_lineNum to see what was specified as m_pvLock.\n    //\n    // A common case is that the lock is just a Crst, so to aid debugging, we\n    // also include a statically typed version of this pointer (m_pCrstBase) just\n    // for Crsts. Again, you'll want look at m_szFile / m_lineNum to see how to\n    // interpret this union.\n    union\n    {\n        void *           m_pvLock;\n        CrstBase *       m_pCrstBase;\n    };\n\n    // File & line of the *LOCK_TAKEN* macro that added this lock to our list\n    const char *         m_szFile;\n    int                  m_lineNum;\n};\n\nenum DbgStateLockType\n{\n    // EE locks (used to sync EE structures).  These do not include\n    // CRST_HOST_BREAKABLE Crsts, and are thus not held while managed\n    // code runs\n    kDbgStateLockType_EE,\n\n    // CRST_HOST_BREAKABLE Crsts.  These can be held while arbitrary\n    // managed code runs.\n    kDbgStateLockType_HostBreakableCrst,\n\n    // User locks (e.g., Monitor.Enter, ReaderWriterLock class)\n    kDbgStateLockType_User,\n\n    // add more lock types here\n\n    kDbgStateLockType_Count\n};\n\n// This keeps track of how many locks, and which locks, are currently owned\n// by the current thread.  There is one instance of this structure per\n// thread (no EE Thread object required).  This is in contrast to the\n// ClrDebugState structure, which is instantiated once per function\n// on the stack.  Reason is that ClrDebugState resets its state on exit\n// of function (Contract destructor reinstates previous ClrDebugState), whereas\n// we want DbgStateLockData to persist across function enters & exits.\nstruct DbgStateLockData\n{\n    // When a lock is taken, we keep track of its pointer and file/line# when it\n    // was added in a static-size array DbgStateLockData::m_rgTakenLockInfos.  This is\n    // the size of that array, and therefore indicates the maximum number of locks we\n    // expect one thread to hold at the same time.  If we should exceed this limit,\n    // we'll lose this data for the latter locks that exceed this limit\n    // (though still maintaining an accurate *count* of locks).\n    static const int     kMaxAllowedSimultaneousLocks = 20;\n\n    // Count of locks taken, separately by type\n    UINT                 m_rgcLocksTaken[kDbgStateLockType_Count];\n\n    // List of the specific locks that have been taken (all DbgStateLockTypes\n    // intermingled), in the order they were taken.  If we exceed the elements\n    // in the array, we just won't track the latter locks in here (though they are\n    // included in the counts above)\n    TakenLockInfo        m_rgTakenLockInfos[kMaxAllowedSimultaneousLocks];\n\n    void SetStartingValues();\n    void LockTaken(DbgStateLockType dbgStateLockType,\n                     UINT cEntrances,\n                     void * pvLock,\n                     _In_z_ const char * szFunction,\n                     _In_z_ const char * szFile,\n                     int lineNum);\n    void LockReleased(DbgStateLockType dbgStateLockType, UINT cExits, void * pvLock);\n    UINT GetLockCount(DbgStateLockType dbgStateLockType);\n    UINT GetCombinedLockCount();\n};\n\n// This struct contains all lock contract information.  It is created and destroyed along with\n// ClrDebugState. m_pLockData points to a DbgStateLockData object that is allocated per thread\n// and persists across function enters and exists.\nstruct DbgStateLockState\n{\nprivate:\n    // Count of locks taken at the time the function with CANNOT_RETAKE_LOCK contract\n    // was called\n    UINT               m_cLocksEnteringCannotRetakeLock;\n\n    DbgStateLockData * m_pLockData;  // How many and which locks are currently taken on this thread\n\npublic:\n    void SetStartingValues();\n    void OnEnterCannotRetakeLockFunction();\n    BOOL IsLockRetaken(void * pvLock);\n    BOOL IsSafeToRelease(UINT cReleases);\n    void SetDbgStateLockData(DbgStateLockData * pDbgStateLockData);\n    DbgStateLockData * GetDbgStateLockData();\n};\n\n\n#define CONTRACT_BITMASK_OK_TO_THROW          0x1 << 0\n#define CONTRACT_BITMASK_FAULT_FORBID         0x1 << 1\n#define CONTRACT_BITMASK_HOSTCALLS            0x1 << 2\n#define CONTRACT_BITMASK_SOTOLERANT           0x1 << 3\n#define CONTRACT_BITMASK_DEBUGONLY            0x1 << 4\n#define CONTRACT_BITMASK_SONOTMAINLINE        0x1 << 5\n#define CONTRACT_BITMASK_OK_TO_LOCK           0x1 << 6\n#define CONTRACT_BITMASK_OK_TO_RETAKE_LOCK    0x1 << 7\n\n\n#define CONTRACT_BITMASK_IS_SET(whichbit)    ((m_flags & (whichbit)) != 0)\n#define CONTRACT_BITMASK_SET(whichbit)       (m_flags |= (whichbit))\n#define CONTRACT_BITMASK_RESET(whichbit)     (m_flags &= ~(whichbit))\n#define CONTRACT_BITMASK_UPDATE(whichbit, value)  ((value)?CONTRACT_BITMASK_SET(whichbit):CONTRACT_BITMASK_RESET(whichbit))\n\nstruct ClrDebugState\n{\nprivate:\n    UINT_PTR              m_flags;\n    UINT_PTR             m_violationmask;      // Current CONTRACT_VIOLATIONS in effect\n    ContractStackRecord *m_pContractStackTrace;\n    UINT                 m_GCNoTriggerCount;\n    UINT                 m_GCForbidCount;\n    UINT                  m_maxLoadTypeLevel;   // taken from enum ClassLoadLevel\n    BOOL                  m_allowGetThread;     // TRUE if GetThread() is ok in this scope\n    DbgStateLockState     m_LockState;\n\npublic:\n    // Use an explicit Init rather than ctor as we don't want automatic\n    // construction of the ClrDebugState embedded inside the contract.\n    void SetStartingValues()\n    {\n        m_violationmask     = 0;            // No violations allowed\n\n        // Default is we're in a THROWS scope. This is not ideal, but there are\n                                            //  just too many places that I'd have to go clean up right now\n                                            //  (hundreds) in order to make this FALSE by default.\n        // Faults not forbidden (an unfortunate default but\n                                            //  we'd never get this debug infrastructure bootstrapped otherwise.)\n        // We start out in SO-tolerant mode and must probe before entering SO-intolerant\n        //   any global state updates.\n        // Initial mode is non-debug until we say otherwise\n        // Everything defaults to mainline\n        // By default, GetThread() is perfectly fine to call\n        // By default, it's ok to take a lock (or call someone who does)\n        m_flags             = CONTRACT_BITMASK_OK_TO_THROW|\n                              CONTRACT_BITMASK_HOSTCALLS|\n                              CONTRACT_BITMASK_SOTOLERANT|\n                              CONTRACT_BITMASK_OK_TO_LOCK|\n                              CONTRACT_BITMASK_OK_TO_RETAKE_LOCK;\n\n        m_pContractStackTrace = NULL;       // At top of stack, no contracts in force\n        m_GCNoTriggerCount  = 0;\n        m_GCForbidCount     = 0;\n\n        m_maxLoadTypeLevel = ((UINT)(-1));  // ideally CLASS_LOAD_LEVEL_FINAL but we don't have access to that #define, so\n                                            // the max integer value will do as a substitute.\n\n        m_allowGetThread = TRUE;            // By default, GetThread() is perfectly fine to call\n\n        m_LockState.SetStartingValues();\n    }\n\n    void CheckOkayToThrow(_In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum); // Asserts if its not okay to throw.\n    BOOL CheckOkayToThrowNoAssert(); // Returns if OK to throw\n\n    //--//\n\n    UINT_PTR* ViolationMaskPtr()\n    {\n        return &m_violationmask;\n    }\n\n    UINT_PTR ViolationMask()\n    {\n        return m_violationmask;\n    }\n\n    void ViolationMaskSet( UINT_PTR value )\n    {\n        m_violationmask |= value;\n    }\n\n    void ViolationMaskReset( UINT_PTR value )\n    {\n        m_violationmask &= ~value;\n    }\n\n    //--//\n\n    BOOL IsOkToThrow()\n    {\n        return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_OK_TO_THROW);\n    }\n\n    void SetOkToThrow()\n    {\n        CONTRACT_BITMASK_SET(CONTRACT_BITMASK_OK_TO_THROW);\n    }\n\n    BOOL SetOkToThrow( BOOL value )\n    {\n        BOOL prevState = CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_OK_TO_THROW);\n        CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_OK_TO_THROW, value);\n        return prevState;\n    }\n\n    void ResetOkToThrow()\n    {\n        CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_OK_TO_THROW);\n    }\n    //--//\n\n    BOOL IsFaultForbid()\n    {\n        return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_FAULT_FORBID);\n    }\n\n\n    void SetFaultForbid()\n    {\n        CONTRACT_BITMASK_SET(CONTRACT_BITMASK_FAULT_FORBID);\n    }\n\n    BOOL SetFaultForbid(BOOL value)\n    {\n        BOOL prevState = CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_FAULT_FORBID);\n        CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_FAULT_FORBID, value);\n        return prevState;\n    }\n\n    void ResetFaultForbid()\n    {\n        CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_FAULT_FORBID);\n    }\n\n    //--//\n    BOOL IsHostCaller()\n    {\n        return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_HOSTCALLS);\n    }\n\n    void SetHostCaller()\n    {\n        CONTRACT_BITMASK_SET(CONTRACT_BITMASK_HOSTCALLS);\n    }\n\n\n    BOOL SetHostCaller(BOOL value)\n    {\n        BOOL prevState = CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_HOSTCALLS);\n        CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_HOSTCALLS,value);\n        return prevState;\n    }\n\n    void ResetHostCaller()\n    {\n        CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_HOSTCALLS);\n    }\n\n    //--//\n    BOOL IsDebugOnly()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_DEBUGONLY);\n    }\n\n    void SetDebugOnly()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        CONTRACT_BITMASK_SET(CONTRACT_BITMASK_DEBUGONLY);\n    }\n\n    BOOL SetDebugOnly(BOOL value)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        BOOL prevState = CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_DEBUGONLY);\n        CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_DEBUGONLY,value);\n        return prevState;\n    }\n\n    void ResetDebugOnly()\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_DEBUGONLY);\n    }\n\n    //--//\n    BOOL IsOkToLock()\n    {\n        return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_OK_TO_LOCK);\n    }\n\n    void SetOkToLock()\n    {\n        CONTRACT_BITMASK_SET(CONTRACT_BITMASK_OK_TO_LOCK);\n    }\n\n    BOOL SetOkToLock( BOOL value )\n    {\n        BOOL prevState = CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_OK_TO_LOCK);\n        CONTRACT_BITMASK_UPDATE(CONTRACT_BITMASK_OK_TO_LOCK, value);\n        return prevState;\n    }\n\n    void ResetOkToLock()\n    {\n        CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_OK_TO_LOCK);\n    }\n\n    //--//\n    BOOL IsOkToRetakeLock()\n    {\n        return CONTRACT_BITMASK_IS_SET(CONTRACT_BITMASK_OK_TO_RETAKE_LOCK);\n    }\n\n    void ResetOkToRetakeLock()\n    {\n        CONTRACT_BITMASK_RESET(CONTRACT_BITMASK_OK_TO_RETAKE_LOCK);\n    }\n\n\n    //--//\n    void LinkContractStackTrace( ContractStackRecord* pContractStackTrace )\n    {\n        pContractStackTrace->m_pNext = m_pContractStackTrace;\n\n        m_pContractStackTrace = pContractStackTrace;\n    }\n\n    ContractStackRecord* GetContractStackTrace()\n    {\n        return m_pContractStackTrace;\n    }\n\n    void SetContractStackTrace(ContractStackRecord* pContractStackTrace )\n    {\n        m_pContractStackTrace = pContractStackTrace;\n    }\n\n    //--//\n\n    UINT GetGCNoTriggerCount()\n    {\n        return m_GCNoTriggerCount;\n    }\n\n    void DecrementGCNoTriggerCount()\n    {\n        m_GCNoTriggerCount--;\n    }\n\n    void IncrementGCNoTriggerCount()\n    {\n        m_GCNoTriggerCount++;\n    }\n\n\n    UINT GetGCForbidCount()\n    {\n        return m_GCForbidCount;\n    }\n\n    void DecrementGCForbidCount()\n    {\n        m_GCForbidCount--;\n    }\n\n    void IncrementGCForbidCount()\n    {\n        m_GCForbidCount++;\n    }\n\n    UINT GetMaxLoadTypeLevel()\n    {\n        return m_maxLoadTypeLevel;\n    }\n\n    void SetMaxLoadTypeLevel(UINT newLevel)\n    {\n        m_maxLoadTypeLevel = newLevel;\n    }\n\n    //--//\n\n    void SetDbgStateLockData(DbgStateLockData * pDbgStateLockData)\n    {\n        m_LockState.SetDbgStateLockData(pDbgStateLockData);\n    }\n\n    DbgStateLockData * GetDbgStateLockData()\n    {\n        return m_LockState.GetDbgStateLockData();\n    }\n\n    void OnEnterCannotRetakeLockFunction()\n    {\n        m_LockState.OnEnterCannotRetakeLockFunction();\n    }\n\n    void CheckOkayToLock(_In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum); // Asserts if its not okay to lock\n    BOOL CheckOkayToLockNoAssert(); // Returns if OK to lock\n    void LockTaken(DbgStateLockType dbgStateLockType,\n                     UINT cEntrances,\n                     void * pvLock,\n                     _In_z_ const char * szFunction,\n                     _In_z_ const char * szFile,\n                     int lineNum);\n    void LockReleased(DbgStateLockType dbgStateLockType, UINT cExits, void * pvLock);\n    UINT GetLockCount(DbgStateLockType dbgStateLockType);\n    UINT GetCombinedLockCount();\n};\n\n#endif // ENABLE_CONTRACTS\n\n#ifdef ENABLE_CONTRACTS_IMPL\n// Create ClrDebugState.\n// This routine is not allowed to return NULL. If it can't allocate the memory needed,\n// it should return a pointer to a global static ClrDebugState that indicates\n// that debug assertions should be skipped.\nClrDebugState *CLRInitDebugState();\nClrDebugState *GetClrDebugState(BOOL fAlloc = TRUE);\n\nextern thread_local ClrDebugState* t_pClrDebugState;\n\n// This function returns a ClrDebugState if one has been created, but will not create one itself.\ninline ClrDebugState *CheckClrDebugState()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n    return t_pClrDebugState;\n}\n\nvoid CONTRACT_ASSERT(const char *szElaboration,\n                     UINT  whichTest,\n                     UINT  whichTestMask,\n                     const char *szFunction,\n                     const char *szFile,\n                     int   lineNum\n                     );\n\n#endif\n\n// This needs to be defined up here b/c it is used by ASSERT_CHECK which is used by the contract impl\n#ifdef _DEBUG\n#ifdef ENTER_DEBUG_ONLY_CODE\n#undef ENTER_DEBUG_ONLY_CODE\n#endif\n#ifdef LEAVE_DEBUG_ONLY_CODE\n#undef LEAVE_DEBUG_ONLY_CODE\n#endif\n\n#ifdef ENABLE_CONTRACTS_IMPL\n// This can only appear in a debug function so don't define it non-debug\nclass DebugOnlyCodeHolder\n{\npublic:\n    // We use GetClrDebugState on entry, but CheckClrDebugState on Leave\n    // That way we make sure to create one if we need to set state, but\n    // we don't recreated one on exit if its been deleted.\n    DEBUG_NOINLINE void Enter()\n    {\n        SCAN_SCOPE_BEGIN;\n        STATIC_CONTRACT_DEBUG_ONLY;\n\n        m_pClrDebugState = GetClrDebugState();\n        if (m_pClrDebugState)\n        {\n            m_oldDebugOnlyValue = m_pClrDebugState->IsDebugOnly();\n            m_pClrDebugState->SetDebugOnly();\n        }\n    }\n\n    DEBUG_NOINLINE void Leave()\n    {\n        SCAN_SCOPE_END;\n        STATIC_CONTRACT_DEBUG_ONLY;\n\n        m_pClrDebugState = CheckClrDebugState();\n        if (m_pClrDebugState)\n        {\n            m_pClrDebugState->SetDebugOnly( m_oldDebugOnlyValue );\n        }\n    }\n\nprivate:\nBOOL           m_oldDebugOnlyValue;\nClrDebugState *m_pClrDebugState;\n};\n\n#define ENTER_DEBUG_ONLY_CODE                                                \\\n    DebugOnlyCodeHolder __debugOnlyCodeHolder;                               \\\n    __debugOnlyCodeHolder.Enter();\n\n#define LEAVE_DEBUG_ONLY_CODE                                                \\\n    __debugOnlyCodeHolder.Leave();\n\n\nclass AutoCleanupDebugOnlyCodeHolder : public DebugOnlyCodeHolder\n{\npublic:\n    DEBUG_NOINLINE AutoCleanupDebugOnlyCodeHolder()\n    {\n        SCAN_SCOPE_BEGIN;\n        STATIC_CONTRACT_DEBUG_ONLY;\n\n        Enter();\n    };\n\n    DEBUG_NOINLINE ~AutoCleanupDebugOnlyCodeHolder()\n    {\n        SCAN_SCOPE_END;\n\n        Leave();\n    };\n};\n\n#define DEBUG_ONLY_FUNCTION \\\n    STATIC_CONTRACT_DEBUG_ONLY;                                             \\\n    AutoCleanupDebugOnlyCodeHolder __debugOnlyCodeHolder;\n\n#define DEBUG_ONLY_REGION() \\\n    AutoCleanupDebugOnlyCodeHolder __debugOnlyCodeHolder;\n\n\n#define BEGIN_DEBUG_ONLY_CODE                                               \\\n    {                                                                       \\\n        AutoCleanupDebugOnlyCodeHolder __debugOnlyCodeHolder;\n\n#define END_DEBUG_ONLY_CODE                                                 \\\n    }\n\n#else // ENABLE_CONTRACTS_IMPL\n#define DEBUG_ONLY_FUNCTION STATIC_CONTRACT_DEBUG_ONLY\n#define DEBUG_ONLY_REGION()\n#define BEGIN_DEBUG_ONLY_CODE\n#define END_DEBUG_ONLY_CODE\n#define ENTER_DEBUG_ONLY_CODE\n#define LEAVE_DEBUG_ONLY_CODE\n#endif\n\n#else // _DEBUG\n#define DEBUG_ONLY_REGION()\n#endif\n\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\n// These helpers encapsulate our access to our FLS debug state. To improve\n// contract perf, we'll soon move these to a private alloced block\n// so we can reuse the pointer instead of constantly refetching it.\n// Thus, these helpers are just to bridge this transition.\ninline LPVOID GetViolationMask()\n{\n    ClrDebugState *pState = CheckClrDebugState();\n    if (pState)\n    {\n        return (LPVOID)pState->ViolationMask();\n    }\n    else\n    {\n        return 0;\n    }\n}\n\n// This is the default binding of the MAYBETEMPLATE identifier,\n// used in the RETURN macro\ntemplate <int DUMMY>\nclass ___maybetemplate\n{\n  public:\n    FORCEINLINE void *operator new (size_t size)\n    {\n        return NULL;\n    }\n};\n\n// This is an abstract base class for contracts. The main reason we have this is so that the dtor for many derived class can\n// be performant. If this class was not abstract and had a dtor, then the dtor for the derived class adds EH overhead (even if the derived\n// class did not anything special in its dtor)\nclass BaseContract\n{\n    // Really private, but used by macros\n    public:\n\n    // We use a single integer to specify all the settings for intrinsic tests\n    // such as THROWS and GC_TRIGGERS. The compiler should be able to fold all\n    // these clauses into a single constant.\n    //\n    // The value \"0\" is significant as this is what the entire mask will be initialized to\n    // in the absence of any clauses. Hence, whichever value is assigned \"0\" will be the\n    // default setting for the test.\n    //\n    // Also, there must be a \"disabled\" setting for each category in order to support\n    // the DISABLED macro.\n    enum TestEnum\n    {\n        THROWS_Mask         = 0x00000003,\n        THROWS_Yes          = 0x00000000,   // the default\n        THROWS_No           = 0x00000001,\n        THROWS_Disabled     = 0x00000002,\n\n        GC_Mask             = 0x0000000C,\n        GC_Triggers         = 0x00000000,   // the default\n        GC_NoTrigger        = 0x00000004,\n        GC_Disabled         = 0x00000008,\n\n        FAULT_Mask          = 0x00000030,\n        FAULT_Disabled      = 0x00000000,   // the default\n        FAULT_Inject        = 0x00000010,\n        FAULT_Forbid        = 0x00000020,\n\n        MODE_Mask           = 0x000000C0,\n        MODE_Disabled       = 0x00000000,   // the default\n        MODE_Preempt        = 0x00000040,\n        MODE_Coop           = 0x00000080,\n\n        DEBUG_ONLY_Yes          = 0x00000400,  // code runs under debug only\n\n        SO_MAINLINE_No          = 0x00000800,  // code is not part of our mainline SO scenario\n\n        // Any place where we can't safely call into the host should have a HOST_NoCalls contract\n        HOST_Mask               = 0x00003000,\n        HOST_Calls              = 0x00002000,\n        HOST_NoCalls            = 0x00001000,\n        HOST_Disabled           = 0x00000000,   // the default\n\n        // These enforce the CAN_TAKE_LOCK / CANNOT_TAKE_LOCK contracts\n        CAN_TAKE_LOCK_Mask      = 0x00060000,\n        CAN_TAKE_LOCK_Yes       = 0x00020000,\n        CAN_TAKE_LOCK_No        = 0x00040000,\n        CAN_TAKE_LOCK_Disabled  = 0x00000000,   // the default\n\n        // These enforce the CANNOT_RETAKE_LOCK contract\n        CAN_RETAKE_LOCK_No           = 0x00080000,\n        CAN_RETAKE_LOCK_No_Disabled  = 0x00000000,   // the default\n\n        PRECONDITION_Used       = 0x00010000,   // a PRECONDITION appeared inside the contract\n\n        // IMPORTANT!!! LOADS_TYPE_Mask and LOADS_TYPE_Shift must be kept in sync.\n        LOADS_TYPE_Mask         = 0x00f00000,   // the max loadstype level + 1 (\"+1\" because 0 is reserved for the default which is \"disabled\")\n        LOADS_TYPE_Shift        = 20,           // # of bits to right-shift to get loadstype bits to rightmost position.\n        LOADS_TYPE_Disabled     = 0x00000000,   // the default\n\n        ALL_Disabled            = THROWS_Disabled|GC_Disabled|FAULT_Disabled|MODE_Disabled|LOADS_TYPE_Disabled|\n                                  HOST_Disabled|CAN_TAKE_LOCK_Disabled|CAN_RETAKE_LOCK_No_Disabled\n\n    };\n\n    enum Operation\n    {\n        Setup = 0x01,\n        Preconditions = 0x02,\n        Postconditions = 0x04,\n    };\n\n\n    NOTHROW_DECL BaseContract() : m_testmask(0), m_pClrDebugState(NULL)\n    {\n    }\n    NOTHROW_DECL void Restore()\n    {\n        // m_pClrDebugState is setup in BaseContract::DoChecks. If an SO happens after the\n        // BaseContract object is constructed but before DoChecks is invoked, m_pClrDebugState\n        // will remain NULL (which is what it is set to in the BaseContract ctor).\n        //\n        // Thus, we should check for it being NULL before dereferencing it.\n        if (m_pClrDebugState)\n        {\n            // Backout all changes to debug state.\n            *m_pClrDebugState = m_IncomingClrDebugState;\n        }\n    }\n\n    void DoChecks(UINT testmask, _In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum);\n    void Disable()\n    {\n    }\n    BOOL CheckFaultInjection();\n\n  protected:\n    UINT            m_testmask;\n    // Override this function in any derived class to indicate that you have defined a destructor for that class\n    // and that dtor calls Restore()\n    virtual void DestructorDefinedThatCallsRestore() = 0;\n\n\n  protected:\n    ClrDebugState  *m_pClrDebugState;\n    ClrDebugState   m_IncomingClrDebugState;\n\n    ContractStackRecord m_contractStackRecord;\n\n  public:\n    // --------------------------------------------------------------------------------\n    // These classes and declarations are used to implement our fake return keyword.\n    // --------------------------------------------------------------------------------\n\n    // ___box is used to protect the \"detected\" return value from being combined with other parts\n    // of the return expression after we have processed it.  This can happen if the return\n    // expression is a non-parenthesized expression with an operator of lower precedence than\n    // \">\".\n    //\n    // If you have such a case (and see this class listed in an error message),\n    // parenthesize your return value expression.\n    template <typename T>\n    class Box__USE_PARENS_WITH_THIS_EXPRESSION\n    {\n        const T &value;\n\n    public:\n\n        FORCEINLINE Box__USE_PARENS_WITH_THIS_EXPRESSION(const T &value)\n          : value(value)\n          {\n          }\n\n        FORCEINLINE const T& Unbox()\n          {\n              return value;\n          }\n    };\n\n    // PseudoTemplate is a class which can be instantiated with a template-like syntax, resulting\n    // in an expression which simply boxes a following value in a Box\n\n    template <typename T>\n    class PseudoTemplate\n    {\n      public:\n        FORCEINLINE void *operator new (size_t size)\n        {\n            return NULL;\n        }\n\n        FORCEINLINE Box__USE_PARENS_WITH_THIS_EXPRESSION<T> operator>(const T &value)\n        {\n            return Box__USE_PARENS_WITH_THIS_EXPRESSION<T>(value);\n        }\n\n        FORCEINLINE PseudoTemplate operator<(int dummy)\n        {\n            return PseudoTemplate();\n        }\n    };\n\n    // Returner is used to assign the return value to the RETVAL local.  Note the use of\n    // operator , because of its low precedence.\n\n    template <typename RETURNTYPE>\n    class Returner\n    {\n        RETURNTYPE      &m_value;\n        BOOL            m_got;\n    public:\n\n        FORCEINLINE Returner(RETURNTYPE &value)\n          : m_value(value),\n            m_got(FALSE)\n        {\n        }\n\n        template <typename T>\n        FORCEINLINE RETURNTYPE operator,(Box__USE_PARENS_WITH_THIS_EXPRESSION<T> value)\n        {\n            m_value = value.Unbox();\n            m_got = TRUE;\n            return m_value;\n        }\n\n        FORCEINLINE void operator,(___maybetemplate<0> &dummy)\n        {\n            m_got = TRUE;\n        }\n\n        FORCEINLINE BOOL GotReturn()\n        {\n            return m_got;\n        }\n    };\n\n    // This type ensures that postconditions were run via RETURN or RETURN_VOID\n    class RanPostconditions\n    {\n    public:\n        bool ran;\n        int count;\n        const char *function;\n\n        FORCEINLINE RanPostconditions(const char *function)\n          : ran(false),\n            count(0),\n            function(function)\n        {\n        }\n\n        FORCEINLINE int operator++()\n        {\n            return ++count;\n        }\n\n        FORCEINLINE ~RanPostconditions()\n        {\n            // Note: __uncaught_exception() is not a perfect check. It will return TRUE during any exception\n            // processing. So, if there is a contract called from an exception filter (like our\n            // COMPlusFrameHandler) then it will return TRUE and the saftey check below will not be performed.\n            if (!__uncaught_exception())\n                ASSERT_CHECK(count == 0 || ran, function, \"Didn't run postconditions - be sure to use RETURN at the end of the function\");\n        }\n\n    };\n\n    // Set contract enforcement level\n    static void SetUnconditionalContractEnforcement(BOOL enforceUnconditionally);\n\n    // Check contract enforcement\n    static BOOL EnforceContract();\n\n private:\n    static BOOL s_alwaysEnforceContracts;\n};\n\nclass Contract: public BaseContract\n{\n   // Have to override this function in any derived class to indicate that a valid destructor is defined for this class\n   virtual void DestructorDefinedThatCallsRestore(){}\n\n   public:\n    NOTHROW_DECL ~Contract()\n    {\n        Restore();\n    }\n};\n\n#endif // ENABLE_CONTRACTS_IMPL\n\n\n#ifdef _DEBUG\n\n// Valid parameters for CONTRACT_VIOLATION macro\nenum ContractViolationBits\n{\n    ThrowsViolation = 0x00000001,  // suppress THROW tags in this scope\n    GCViolation     = 0x00000002,  // suppress GCTRIGGER tags in this scope\n    ModeViolation   = 0x00000004,  // suppress MODE_PREEMP and MODE_COOP tags in this scope\n    FaultViolation  = 0x00000008,  // suppress INJECT_FAULT assertions in this scope\n    FaultNotFatal   = 0x00000010,  // suppress INJECT_FAULT but not fault injection by harness\n    LoadsTypeViolation      = 0x00000040,  // suppress LOADS_TYPE tags in this scope\n    TakesLockViolation      = 0x00000080,  // suppress CAN_TAKE_LOCK tags in this scope\n    HostViolation           = 0x00000100,  // suppress HOST_CALLS tags in this scope\n\n    //These are not violation bits. We steal some bits out of the violation mask to serve as\n    // general flag bits.\n    CanFreeMe       = 0x00010000,  // If this bit is ON, the ClrDebugState was allocated by\n                                   // a version of utilcode that registers an Fls Callback to free\n                                   // the state. If this bit is OFF, the ClrDebugState was allocated\n                                   // by an old version of utilcode that doesn't. (And you can't\n                                   // assume that the old utilcode used the same allocator as the new utilcode.)\n                                   // (Most likely, this is because you are using an older shim with\n                                   // a newer mscorwks.dll)\n                                   //\n                                   // The Fls callback must only attempt to free debugstates that\n                                   // have this bit on.\n\n    BadDebugState   = 0x00020000,  // If we OOM creating the ClrDebugState, we return a pointer to\n                                   // a static ClrDebugState that has this bit turned on. (We don't\n                                   // want to slow down contracts with null tests everywhere.)\n                                   // Other than this specific bit, all other fields of the DebugState\n                                   // must be considered trash. You can stomp on them and you can bit-test them\n                                   // but you can't throw up any asserts based on them and you certainly\n                                   // can't deref any pointers stored in the bad DebugState.\n\n    AllViolation    = 0xFFFFFFFF,\n};\n\n#endif\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\n// Global variables allow PRECONDITION and POSTCONDITION to be used outside contracts\nstatic const BaseContract::Operation ___op = (Contract::Operation) (Contract::Preconditions\n                                                                |Contract::Postconditions);\nenum {\n    ___disabled = 0\n};\n\nstatic UINT ___testmask;\n\n// End of global variables\n\nstatic int ___ran;\n\nclass __SafeToUsePostCondition {\npublic:\n    static int safe_to_use_postcondition() {return 0;};\n};\n\nclass __YouCannotUseAPostConditionHere {\nprivate:\n    static int safe_to_use_postcondition() {return 0;};\n};\n\ntypedef __SafeToUsePostCondition __PostConditionOK;\n\n// Uncomment the following line to disable runtime contracts completely - PRE/POST conditions will still be present\n//#define __FORCE_NORUNTIME_CONTRACTS__ 1\n\n#ifndef __FORCE_NORUNTIME_CONTRACTS__\n\n#define CONTRACT_SETUP(_contracttype, _returntype, _returnexp)          \\\n    _returntype RETVAL;                                                 \\\n    _contracttype ___contract;                                          \\\n    Contract::Returner<_returntype> ___returner(RETVAL);                \\\n    Contract::RanPostconditions ___ran(__FUNCTION__);                   \\\n    Contract::Operation ___op = Contract::Setup;                        \\\n    BOOL ___contract_enabled = FALSE;                                   \\\n    DEBUG_ASSURE_NO_RETURN_BEGIN(CONTRACT)                              \\\n    ___contract_enabled = Contract::EnforceContract();                  \\\n    enum {___disabled = 0};                                             \\\n    if (!___contract_enabled)                                           \\\n        ___contract.Disable();                                          \\\n    else                                                                \\\n    {                                                                   \\\n        enum { ___CheckMustBeInside_CONTRACT = 1 };                     \\\n        if (0)                                                          \\\n        {                                                               \\\n        /* If you see an \"unreferenced label\" warning with this name, */\\\n        /* Be sure that you have a RETURN at the end of your */         \\\n        /* CONTRACT_VOID function */                                    \\\n        ___run_postconditions_DID_YOU_FORGET_A_RETURN:                  \\\n            if (___contract_enabled)                                    \\\n            {                                                           \\\n                ___op = Contract::Postconditions;                       \\\n                ___ran.ran = true;                                      \\\n            }                                                           \\\n            else                                                        \\\n            {                                                           \\\n                DEBUG_OK_TO_RETURN_BEGIN(CONTRACT)                      \\\n              ___run_return:                                            \\\n                return _returnexp;                                      \\\n                DEBUG_OK_TO_RETURN_END(CONTRACT)                        \\\n            }                                                           \\\n        }                                                               \\\n        if (0)                                                          \\\n        {                                                               \\\n        ___run_preconditions:                                           \\\n            ___op = Contract::Preconditions;                            \\\n        }                                                               \\\n        UINT ___testmask = 0;                                           \\\n\n#define CONTRACTL_SETUP(_contracttype)                                  \\\n    _contracttype ___contract;                                          \\\n    BOOL ___contract_enabled = Contract::EnforceContract();             \\\n    enum {___disabled = 0};                                             \\\n    if (!___contract_enabled)                                           \\\n        ___contract.Disable();                                          \\\n    else                                                                \\\n    {                                                                   \\\n        typedef __YouCannotUseAPostConditionHere __PostConditionOK;     \\\n        enum { ___CheckMustBeInside_CONTRACT = 1 };                     \\\n        Contract::Operation ___op = Contract::Setup;                    \\\n        enum {___disabled = 0};                                         \\\n        if (0)                                                          \\\n        {                                                               \\\n          ___run_preconditions:                                         \\\n            ___op = Contract::Preconditions;                            \\\n        }                                                               \\\n        if (0)                                                          \\\n        {                                                               \\\n        /* define for CONTRACT_END even though we can't get here */     \\\n          ___run_return:                                                \\\n            UNREACHABLE();                                              \\\n        }                                                               \\\n        UINT ___testmask = 0;                                           \\\n\n#else // #ifndef __FORCE_NORUNTIME_CONTRACTS__\n\n#define CONTRACT_SETUP(_contracttype, _returntype, _returnexp)              \\\n        _returntype RETVAL;                                                 \\\n        Contract::Returner<_returntype> ___returner(RETVAL);                \\\n        Contract::RanPostconditions ___ran(__FUNCTION__);                   \\\n        Contract::Operation ___op = Contract::Setup;                        \\\n        DEBUG_ASSURE_NO_RETURN_BEGIN(CONTRACT)                              \\\n        BOOL ___contract_enabled = Contract::EnforceContract();             \\\n        enum {___disabled = 0};                                             \\\n        {                                                                   \\\n            enum { ___CheckMustBeInside_CONTRACT = 1 };                     \\\n            if (0)                                                          \\\n            {                                                               \\\n            /* If you see an \"unreferenced label\" warning with this name, */\\\n            /* Be sure that you have a RETURN at the end of your */         \\\n            /* CONTRACT_VOID function */                                    \\\n            ___run_postconditions_DID_YOU_FORGET_A_RETURN:                  \\\n                if (___contract_enabled)                                    \\\n                {                                                           \\\n                    ___op = Contract::Postconditions;                       \\\n                    ___ran.ran = true;                                      \\\n                }                                                           \\\n                else                                                        \\\n                {                                                           \\\n                    DEBUG_OK_TO_RETURN_BEGIN(CONTRACT)                      \\\n                  ___run_return:                                            \\\n                    return _returnexp;                                      \\\n                    DEBUG_OK_TO_RETURN_END(CONTRACT)                        \\\n                }                                                           \\\n            }                                                               \\\n            if (0)                                                          \\\n            {                                                               \\\n            ___run_preconditions:                                           \\\n                ___op = Contract::Preconditions;                            \\\n            }                                                               \\\n            UINT ___testmask = 0;                                           \\\n\n\n\n\n#define CONTRACTL_SETUP(_contracttype)                                  \\\n    BOOL ___contract_enabled = Contract::EnforceContract();             \\\n    enum {___disabled = 0};                                             \\\n    {                                                                   \\\n        typedef __YouCannotUseAPostConditionHere __PostConditionOK;     \\\n            enum { ___CheckMustBeInside_CONTRACT = 1 };                 \\\n        Contract::Operation ___op = Contract::Setup;                    \\\n        enum {___disabled = 0};                                         \\\n        if (0)                                                          \\\n        {                                                               \\\n          ___run_preconditions:                                         \\\n            ___op = Contract::Preconditions;                            \\\n        }                                                               \\\n        if (0)                                                          \\\n        {                                                               \\\n        /* define for CONTRACT_END even though we can't get here */     \\\n          ___run_return:                                                \\\n            UNREACHABLE();                                              \\\n        }                                                               \\\n        UINT ___testmask = 0;                                           \\\n\n#endif // __FORCE_NORUNTIME_CONTRACTS__\n\n\n#define CUSTOM_CONTRACT(_contracttype, _returntype)                     \\\n        typedef Contract::PseudoTemplate<_returntype> ___maybetemplate; \\\n        CONTRACT_SETUP(_contracttype, _returntype, RETVAL)\n\n#define CUSTOM_CONTRACT_VOID(_contracttype)                             \\\n        CONTRACT_SETUP(_contracttype, int, ;)\n\n#define CUSTOM_CONTRACTL(_contracttype)                                 \\\n        CONTRACTL_SETUP(_contracttype)\n\n// Although this thing only needs to run in the Setup phase, we'll let it\n// run unconditionally. This way, the compiler will see a sequence like this:\n//\n//    THROWS; GC_TRIGGERS; FORBID_FAULT ==>\n//\n//    ___testmask |= constant\n//    ___testmask |= constant\n//    ___testmask |= constant\n//\n// and be able to fold all these into a single constant at runtime.\n//\n#define REQUEST_TEST(thetest, todisable)   (___testmask |= (___CheckMustBeInside_CONTRACT, (___disabled ? (todisable) : (thetest))))\n\n\n#define INJECT_FAULT(_statement)                                                            \\\n        do                                                                                  \\\n        {                                                                                   \\\n            STATIC_CONTRACT_FAULT;                                                          \\\n            REQUEST_TEST(Contract::FAULT_Inject, Contract::FAULT_Disabled);                 \\\n            if (0)                                                                          \\\n        {                                                                                   \\\n            _statement;                                                                     \\\n            }                                                                               \\\n        }                                                                                   \\\n        while(0)                                                                            \\\n\n\n#define FORBID_FAULT  do { STATIC_CONTRACT_FORBID_FAULT; REQUEST_TEST(Contract::FAULT_Forbid, Contract::FAULT_Disabled); } while(0)\n\n#define THROWS        do { STATIC_CONTRACT_THROWS; REQUEST_TEST(Contract::THROWS_Yes, Contract::THROWS_Disabled); } while(0)\n\n#define NOTHROW       do { STATIC_CONTRACT_NOTHROW; REQUEST_TEST(Contract::THROWS_No,  Contract::THROWS_Disabled); } while(0)                                                               \\\n\n#define ENTRY_POINT   STATIC_CONTRACT_ENTRY_POINT\n\n#define LOADS_TYPE(maxlevel)  do { REQUEST_TEST( ((maxlevel) + 1) << Contract::LOADS_TYPE_Shift, Contract::LOADS_TYPE_Disabled ); } while(0)\n\n#define CAN_TAKE_LOCK    do { STATIC_CONTRACT_CAN_TAKE_LOCK; REQUEST_TEST(Contract::CAN_TAKE_LOCK_Yes, Contract::CAN_TAKE_LOCK_Disabled); } while(0)\n\n#define CANNOT_TAKE_LOCK   do { STATIC_CONTRACT_CANNOT_TAKE_LOCK; REQUEST_TEST(Contract::CAN_TAKE_LOCK_No,  Contract::CAN_TAKE_LOCK_Disabled); } while(0)\n\n#define CANNOT_RETAKE_LOCK   do { REQUEST_TEST(Contract::CAN_RETAKE_LOCK_No,  Contract::CAN_RETAKE_LOCK_No_Disabled); } while(0)\n\n#define DEBUG_ONLY do { STATIC_CONTRACT_DEBUG_ONLY; REQUEST_TEST(Contract::DEBUG_ONLY_Yes, 0);  } while (0)\n\n#ifndef __DISABLE_PREPOST_CONDITIONS__\n#define PRECONDITION_MSG(_expression, _message)                                             \\\n        do                                                                                  \\\n        {                                                                                   \\\n\t\t    enum { ___CheckMustBeInside_CONTRACT = 1 };                                     \\\n            REQUEST_TEST(Contract::PRECONDITION_Used, 0);                                   \\\n            if ((___op&Contract::Preconditions) && !___disabled)                            \\\n                ASSERT_CHECK(_expression, _message, \"Precondition failure\");                \\\n        }                                                                                   \\\n        while(0)\n\n\n#define PRECONDITION(_expression)                                                           \\\n        PRECONDITION_MSG(_expression, NULL)\n\n#define POSTCONDITION_MSG(_expression, _message)                                            \\\n        ++___ran;                                                                           \\\n        if ((!(0 && __PostConditionOK::safe_to_use_postcondition())) &&                     \\\n            (___op&Contract::Postconditions) &&                                             \\\n            !___disabled)                                                                   \\\n        {                                                                                   \\\n            ASSERT_CHECK(_expression, _message, \"Postcondition failure\");                   \\\n        }\n\n#define POSTCONDITION(_expression)                                                          \\\n        POSTCONDITION_MSG(_expression, NULL)\n\n#define INSTANCE_CHECK                                                                      \\\n        ___CheckMustBeInside_CONTRACT;                                                      \\\n        if ((___op&Contract::Preconditions) && !___disabled)                                \\\n            ASSERT_CHECK(CheckPointer(this), NULL, \"Instance precheck failure\");            \\\n        ++___ran;                                                                           \\\n        if ((___op&Contract::Postconditions) && !___disabled)                               \\\n            ASSERT_CHECK(CheckPointer(this), NULL, \"Instance postcheck failure\");\n\n#define INSTANCE_CHECK_NULL                                                                 \\\n        ___CheckMustBeInside_CONTRACT;                                                      \\\n        if ((___op&Contract::Preconditions) && !___disabled)                                \\\n            ASSERT_CHECK(CheckPointer(this, NULL_OK), NULL, \"Instance precheck failure\");   \\\n        ++___ran;                                                                           \\\n        if ((___op&Contract::Postconditions) && !___disabled)                               \\\n            ASSERT_CHECK(CheckPointer(this, NULL_OK), NULL, \"Instance postcheck failure\");\n\n#define CONSTRUCTOR_CHECK                                                                   \\\n        ___CheckMustBeInside_CONTRACT;                                                      \\\n        ++___ran;                                                                           \\\n        if ((___op&Contract::Postconditions) && !___disabled)                               \\\n            ASSERT_CHECK(CheckPointer(this), NULL, \"Instance postcheck failure\");\n\n#define DESTRUCTOR_CHECK                                                                    \\\n        ___CheckMustBeInside_CONTRACT;                                                      \\\n        NOTHROW;                                                                            \\\n        if ((___op&Contract::Preconditions) && !___disabled)                                \\\n            ASSERT_CHECK(CheckPointer(this), NULL, \"Instance precheck failure\");\n#else // __DISABLE_PREPOST_CONDITIONS__\n\n\n#define PRECONDITION_MSG(_expression, _message)     do { } while(0)\n#define PRECONDITION(_expression)                   do { } while(0)\n#define POSTCONDITION_MSG(_expression, _message)    do { } while(0)\n#define POSTCONDITION(_expression)                  do { } while(0)\n#define INSTANCE_CHECK\n#define INSTANCE_CHECK_NULL\n#define CONSTRUCTOR_CHECK\n#define DESTRUCTOR_CHECK\n\n#endif // __DISABLE_PREPOST_CONDITIONS__\n\n#define UNCHECKED(thecheck)                                                                 \\\n        do {                                                                                \\\n            ANNOTATION_UNCHECKED(thecheck);                                                 \\\n            enum {___disabled = 1 };                                                        \\\n            thecheck;                                                                       \\\n        } while(0)\n\n#define DISABLED(thecheck) UNCHECKED(thecheck)\n\n#define WRAPPER(thecheck) UNCHECKED(thecheck)\n\n// This keyword is redundant but it's handy for reducing the nuisance editing you\n// have to when repeatedly enabling and disabling contract items while debugging.\n// You shouldn't check in code that explicitly uses ENABLED.\n#define ENABLED(_check) _check\n\n\n#ifndef __FORCE_NORUNTIME_CONTRACTS__\n#define CONTRACTL_END                                                                       \\\n        if (___op & Contract::Setup)                                                        \\\n        {                                                                                   \\\n            ___contract.DoChecks(___testmask, __FUNCTION__, __FILE__, __LINE__);            \\\n            if (___testmask & Contract::PRECONDITION_Used)                                  \\\n            {                                                                               \\\n                goto ___run_preconditions;                                                  \\\n            }                                                                               \\\n        }                                                                                   \\\n        else if (___op & Contract::Postconditions)                                          \\\n        {                                                                                   \\\n            goto ___run_return;                                                             \\\n        }                                                                                   \\\n        ___CheckMustBeInside_CONTRACT;                                                      \\\n   }\n\n#else\n\n#define CONTRACTL_END                                                                       \\\n        if (___op & Contract::Setup)                                                        \\\n        {                                                                                   \\\n            if (___testmask & Contract::PRECONDITION_Used)                                  \\\n            {                                                                               \\\n                goto ___run_preconditions;                                                  \\\n            }                                                                               \\\n        }                                                                                   \\\n        else if (___op & Contract::Postconditions)                                          \\\n        {                                                                                   \\\n            goto ___run_return;                                                             \\\n        }                                                                                   \\\n        ___CheckMustBeInside_CONTRACT;                                                      \\\n   }                                                                                        \\\n\n#endif // __FORCE_NORUNTIME_CONTRACTS__\n\n#define CONTRACT_END   CONTRACTL_END                                                        \\\n   DEBUG_ASSURE_NO_RETURN_END(CONTRACT)                                                     \\\n\n\n// The final expression in the RETURN macro deserves special explanation (or something.)\n// The expression is constructed so as to be syntactically ambiguous, depending on whether\n// __maybetemplate is a template or not.  If it is a template, the expression is syntactically\n// correct as-is.  If it is not, the angle brackets are interpreted as\n// less than & greater than, and the expression is incomplete.  This is the point - we can\n// choose whether we need an expression or not based on the context in which the macro is used.\n// This allows the same RETURN macro to be used both in value-returning and void-returning\n// contracts.\n//\n// The \"__returner ,\" portion of the expression is used instead of \"RETVAL =\", since \",\"\n// has lower precedence than \"=\". (Ain't overloaded operators fun.)\n//\n// Also note that the < and > operators on the non-template version of __maybetemplate\n// are overridden to \"box\" the return value in a special type and pass it\n// through to the __returner's \",\" operator.  This is so we can detect a case where an\n// operator with lower precedence than \">\" is in the return expression - in such a case we\n// will get a type error message, which instructs that parens be placed around the return\n// value expression.\n\n#define RETURN_BODY                                                                         \\\n    if (___returner.GotReturn())                                                            \\\n        goto ___run_postconditions_DID_YOU_FORGET_A_RETURN;                                 \\\n    else                                                                                    \\\n        ___returner, * new ___maybetemplate < 0 >\n\n\n// We have two versions of the RETURN macro.  CONTRACT_RETURN is for use inside the CONTRACT\n// scope where it is OK to return this way, even though the CONTRACT macro itself does not\n// allow a return.  RETURN is for use inside the function body where it might not be OK\n// to return and we need to ensure that we don't allow a return where one should not happen\n//\n#define RETURN                                                                              \\\n    while (DEBUG_ASSURE_SAFE_TO_RETURN, TRUE)                                               \\\n        RETURN_BODY                                                                         \\\n\n#define RETURN_VOID                                                                         \\\n    RETURN\n\n#define CONTRACT_RETURN                                                                     \\\n    while (___CheckMustBeInside_CONTRACT, TRUE)                                             \\\n        RETURN_BODY                                                                         \\\n\n#define CONTRACT_RETURN_VOID                                                                \\\n    CONTRACT_RETURN                                                                         \\\n\n#if 0\n#define CUSTOM_LIMITED_METHOD_CONTRACT(_contracttype)                                                 \\\n    {                                                                                       \\\n        _contracttype ___contract;                                                          \\\n        STATIC_CONTRACT_LEAF;                                                               \\\n        ___contract.DoChecks(Contract::THROWS_No|Contract::GC_NoTrigger|Contract::MODE_Disabled|Contract::FAULT_Disabled);     \\\n        /* Should add some assertion mechanism to ensure no other contracts are called */   \\\n    }\n#else\n#define CUSTOM_LIMITED_METHOD_CONTRACT(_contracttype)                                                 \\\n    {                                                                                       \\\n        STATIC_CONTRACT_LEAF;                                                               \\\n    }\n#endif\n\n#define CUSTOM_WRAPPER_NO_CONTRACT(_contracttype)                                              \\\n    {                                                                                       \\\n        /* Should add some assertion mechanism to ensure one other contract is called */    \\\n        STATIC_CONTRACT_WRAPPER;                                                            \\\n    }\n\n#define CONTRACT_THROWS()                                                                   \\\n    {                                                                                       \\\n        ::GetClrDebugState()->CheckOkayToThrow(__FUNCTION__, __FILE__, __LINE__);           \\\n    }\n\n#define CONTRACT_THROWSEX(__func, __file, __line)                                           \\\n    {                                                                                       \\\n        ::GetClrDebugState()->CheckOkayToThrow(__func, __file, __line);                     \\\n    }\n\n#else // ENABLE_CONTRACTS_IMPL\n#define CUSTOM_CONTRACT(_contracttype, _returntype)         if (0) {  struct YouCannotUseThisHere { int x; };   // This temporary typedef allows retail use of\n#define CUSTOM_CONTRACT_VOID(_contracttype)                 if (0) {  struct YouCannotUseThisHere { int x; };   // FORBIDGC_LOADER_USE_ENABLED\n#define CUSTOM_CONTRACTL(_contracttype)                     if (0) {  struct YouCannotUseThisHere { int x; };   // inside contracts and asserts but nowhere else.\n\n#define INJECT_FAULT(_statement)\n#define FORBID_FAULT\n#define THROWS\n#define NOTHROW\n#define CAN_TAKE_LOCK\n#define CANNOT_TAKE_LOCK\n#define CANNOT_RETAKE_LOCK\n#define LOADS_TYPE(maxlevel)\n#define ENTRY_POINT\n\n#ifdef _DEBUG\n// This can only appear in a debug function so don't define it non-debug\n#define DEBUG_ONLY STATIC_CONTRACT_DEBUG_ONLY\n#else\n#define DEBUG_ONLY\n#endif\n\n#define PRECONDITION_MSG(_expression, _message)     do { } while(0)\n#define PRECONDITION(_expression)                   do { } while(0)\n#define POSTCONDITION_MSG(_expression, _message)    do { } while(0)\n#define POSTCONDITION(_expression)                  do { } while(0)\n#define INSTANCE_CHECK\n#define INSTANCE_CHECK_NULL\n#define CONSTRUCTOR_CHECK\n#define DESTRUCTOR_CHECK\n#define UNCHECKED(thecheck)\n#define DISABLED(thecheck)\n#define WRAPPER(thecheck)\n#define ENABLED(_check)\n#define CONTRACT_END                                        }\n#define CONTRACTL_END                                       }\n\n#define CUSTOM_LIMITED_METHOD_CONTRACT(_contracttype) \\\n    {                                                                                       \\\n        /* Should add some assertion mechanism to ensure one other contract is called */    \\\n        STATIC_CONTRACT_LEAF;                                                            \\\n    }\n#define CUSTOM_WRAPPER_NO_CONTRACT(_contracttype) \\\n    {                                                                                       \\\n        /* Should add some assertion mechanism to ensure one other contract is called */    \\\n        STATIC_CONTRACT_WRAPPER;                                                            \\\n    }\n\n\n#define RETURN return\n#define RETURN_VOID RETURN\n\n#define CONTRACT_THROWS()\n#define CONTRACT_THROWSEX(__func, __file, __line)\n\n#endif  // ENABLE_CONTRACTS_IMPL\n\n\n#define CONTRACT(_returntype)  CUSTOM_CONTRACT(Contract, _returntype)\n#define CONTRACT_VOID  CUSTOM_CONTRACT_VOID(Contract)\n#define CONTRACTL CUSTOM_CONTRACTL(Contract)\n\n// See description near the top of the file\n#define LIMITED_METHOD_CONTRACT CUSTOM_LIMITED_METHOD_CONTRACT(Contract)\n\n#define WRAPPER_NO_CONTRACT CUSTOM_WRAPPER_NO_CONTRACT(Contract)\n\n// GC_NOTRIGGER allowed but not currently enforced at runtime\n#define GC_NOTRIGGER STATIC_CONTRACT_GC_NOTRIGGER\n#define GC_TRIGGERS static_assert(false, \"TriggersGC not supported in utilcode contracts\")\n\n#ifdef ENABLE_CONTRACTS_IMPL\ntemplate <UINT_PTR VIOLATION_MASK>\nclass ContractViolationHolder\n{\npublic:\n    ContractViolationHolder()\n    {\n        m_pviolationmask = NULL;\n        m_oldviolationmask = 0;\n    }\n\n    DEBUG_NOINLINE void Enter();\n\n    DEBUG_NOINLINE void Leave()\n    {\n        SCAN_SCOPE_END;\n        LeaveInternal();\n    };\n\nprotected:\n    // We require that violationMask is passed as a parameter here to hopefully defeat the\n    // compiler's desire to fold all the Enter and Ctor implementations together.\n    FORCEINLINE void EnterInternal(UINT_PTR violationMask)\n    {\n        _ASSERTE(0 == (violationMask & ~(ThrowsViolation | GCViolation | ModeViolation | FaultViolation |\n            FaultNotFatal | HostViolation |\n            TakesLockViolation | LoadsTypeViolation)) ||\n            violationMask == AllViolation);\n\n        m_pviolationmask = GetClrDebugState()->ViolationMaskPtr();\n        m_oldviolationmask = *m_pviolationmask;\n        *m_pviolationmask = (m_oldviolationmask | violationMask);\n    };\n\n    FORCEINLINE void LeaveInternal()\n    {\n        // This can be used in places where our debug state has been destroyed, so check for it first.\n        if (CheckClrDebugState())\n        {\n            _ASSERTE(m_pviolationmask != NULL);\n            *m_pviolationmask = m_oldviolationmask;\n        }\n    };\n\n    UINT_PTR *m_pviolationmask;\n    UINT_PTR m_oldviolationmask;\n};\n\ntemplate <UINT_PTR VIOLATION_MASK>\nclass AutoCleanupContractViolationHolder : ContractViolationHolder<VIOLATION_MASK>\n{\npublic:\n    DEBUG_NOINLINE AutoCleanupContractViolationHolder(BOOL fEnterViolation = TRUE);\n\n    DEBUG_NOINLINE ~AutoCleanupContractViolationHolder()\n    {\n        SCAN_SCOPE_END;\n        this->LeaveInternal();\n    };\n};\n\n#endif  // ENABLE_CONTRACTS_IMPL\n\n#ifdef ENABLE_CONTRACTS_IMPL\n#define BEGIN_CONTRACT_VIOLATION(violationmask)                             \\\n    {                                                                       \\\n        ContractViolationHolder<violationmask> __violationHolder_onlyOneAllowedPerScope;   \\\n        __violationHolder_onlyOneAllowedPerScope.Enter();                   \\\n        DEBUG_ASSURE_NO_RETURN_BEGIN(CONTRACT)                              \\\n\n// Use this to jump out prematurely from a violation.  Used for EH\n// when the function might not return\n#define RESET_CONTRACT_VIOLATION()                                          \\\n        __violationHolder_onlyOneAllowedPerScope.Leave();                   \\\n\n#define END_CONTRACT_VIOLATION                                              \\\n        DEBUG_ASSURE_NO_RETURN_END(CONTRACT)                                \\\n        __violationHolder_onlyOneAllowedPerScope.Leave();                   \\\n    }                                                                       \\\n\n// See description near the top of the file\n#define CONTRACT_VIOLATION(violationMask)                                   \\\n    AutoCleanupContractViolationHolder<violationMask> __violationHolder_onlyOneAllowedPerScope;\n\n\n// Reasons for having the violation.  Use one of these values as an additional parameter to\n// E.g. PERMANENT_CONTRACT_VIOLATION(ThrowsViolation, ReasonContractInfrastructure)\n// New values and explanations can be added when needed.\nenum PermanentContractViolationReason\n{\n    ReasonContractInfrastructure,        // This violation is there for contract test or infrastructure purposes.\n    ReasonDebugOnly,                     // Code path doesn't occur on retail builds\n    ReasonNonShippingCode,               // Code runs in undocumented non-shipping feature\n    ReasonIBC,                           // Code runs in IBC scenarios only and the violation is safe.\n    ReasonNGEN,                          // Code runs in NGEN scenarios only and the violation is safe.\n    ReasonProfilerCallout,               // Profiler implementers are guaranteed not to throw.\n    ReasonUnsupportedForSQLF1Profiling,  // This code path violates HOST_NOCALLS, but that's ok b/c SQL will never\n                                         // invoke it, and thus SQL/F1 profiling (the primary reason to enforce\n                                         // HOST_NOCALLS) is not in danger.\n    ReasonRuntimeReentrancy,             // e.g. SafeQueryInterface\n    ReasonShutdownOnly,                  // Code path only runs as part of Shutdown and the violation is safe.\n    ReasonSOTolerance,                   // We would like to redesign SO contracts anyways\n    ReasonStartupOnly,                   // Code path only runs as part of Startup and the violation is safe.\n    ReasonWorkaroundForScanBug,          // Violation is needed because of a bug in SCAN\n    ReasonProfilerAsyncCannotRetakeLock, // Profiler may call this from redirected thread, causing a CANNOT_TAKE_LOCK\n                                         // violation, but the scope is still protected with CANNOT_RETAKE_LOCK\n    ReasonILStubWillNotThrow,            // Specially-crafted reverse COM IL stubs will not throw\n};\n\n// See the discussion near the top of the file on the use of PERMANENT_CONTRACT_VIOLATION\n// The reasonEnum is currently only used for documentation and searchability.  Here\n// we have the compiler check for a typo.\n#define PERMANENT_CONTRACT_VIOLATION(violationMask, reasonEnum)            \\\n    if (0)                                                                 \\\n        PermanentContractViolationReason reason = reasonEnum;              \\\n    CONTRACT_VIOLATION(violationMask)\n\n#define CONDITIONAL_CONTRACT_VIOLATION(violationMask, condition)            \\\n    AutoCleanupContractViolationHolder<violationMask> __violationHolder_onlyOneAllowedPerScope((condition));\n\n#else\n#define BEGIN_CONTRACT_VIOLATION(violationmask)\n#define RESET_CONTRACT_VIOLATION()\n#define END_CONTRACT_VIOLATION\n#define CONTRACT_VIOLATION(violationmask)\n#define CONDITIONAL_CONTRACT_VIOLATION(violationMask, condition)\n#define PERMANENT_CONTRACT_VIOLATION(violationMask, reasonEnum)\n#endif\n\n\n\n#ifdef ENABLE_CONTRACTS_IMPL\n// Holder for setting up a faultforbid region\nclass FaultForbidHolder\n{\n public:\n    DEBUG_NOINLINE FaultForbidHolder(BOOL fConditional, BOOL fAlloc, const char *szFunction, const char *szFile, int lineNum)\n    {\n        SCAN_SCOPE_BEGIN;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        m_fConditional = fConditional;\n        if (m_fConditional)\n        {\n            m_pClrDebugState = GetClrDebugState(fAlloc);\n\n            //\n            // If we fail to get a debug state, then we must not be allocating and\n            // we simply no-op this holder.\n            //\n            if (m_pClrDebugState == NULL)\n            {\n                _ASSERTE(!fAlloc);\n                m_fConditional = FALSE;\n                return;\n            }\n\n            m_oldClrDebugState = *m_pClrDebugState;\n\n            m_pClrDebugState->ViolationMaskReset( FaultViolation|FaultNotFatal );\n            m_pClrDebugState->SetFaultForbid();\n\n            m_ContractStackRecord.m_szFunction = szFunction;\n            m_ContractStackRecord.m_szFile     = szFile;\n            m_ContractStackRecord.m_lineNum    = lineNum;\n            m_ContractStackRecord.m_testmask   = (Contract::ALL_Disabled & ~((UINT)(Contract::FAULT_Mask))) | Contract::FAULT_Forbid;\n            m_ContractStackRecord.m_construct  = \"FAULT_FORBID\";\n            m_pClrDebugState->LinkContractStackTrace( &m_ContractStackRecord );\n        }\n    }\n\n    DEBUG_NOINLINE ~FaultForbidHolder()\n    {\n        SCAN_SCOPE_END;\n\n        if (m_fConditional)\n        {\n            *m_pClrDebugState = m_oldClrDebugState;\n        }\n    }\n\n private:\n    ClrDebugState      *m_pClrDebugState;\n    ClrDebugState       m_oldClrDebugState;\n    BOOL m_fConditional;\n    ContractStackRecord m_ContractStackRecord;\n\n};\n#endif  // ENABLE_CONTRACTS_IMPL\n\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\n#define FAULT_FORBID() FaultForbidHolder _ffh(TRUE, TRUE, __FUNCTION__, __FILE__, __LINE__);\n#define FAULT_FORBID_NO_ALLOC() FaultForbidHolder _ffh(TRUE, FALSE, __FUNCTION__, __FILE__, __LINE__);\n#define MAYBE_FAULT_FORBID(cond) FaultForbidHolder _ffh(cond, TRUE, __FUNCTION__, __FILE__, __LINE__);\n#define MAYBE_FAULT_FORBID_NO_ALLOC(cond) FaultForbidHolder _ffh(cond, FALSE, __FUNCTION__, __FILE__, __LINE__);\n\n#else   // ENABLE_CONTRACTS_IMPL\n\n#define FAULT_FORBID() ;\n#define FAULT_FORBID_NO_ALLOC() ;\n#define MAYBE_FAULT_FORBID(cond) ;\n#define MAYBE_FAULT_FORBID_NO_ALLOC(cond) ;\n\n#endif  // ENABLE_CONTRACTS_IMPL\n\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\ninline BOOL AreFaultsForbiddenHelper()\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n\n    ClrDebugState *pClrDebugState = CheckClrDebugState();\n    if (!pClrDebugState)\n    {\n        // By default, faults are not forbidden. Not the most desirable default\n        // but we'd never get this debug infrastructure bootstrapped otherwise.\n        return FALSE;\n    }\n    else\n    {\n        return pClrDebugState->IsFaultForbid() && (!(pClrDebugState->ViolationMask() & (FaultViolation|FaultNotFatal|BadDebugState)));\n    }\n}\n\n#define ARE_FAULTS_FORBIDDEN() AreFaultsForbiddenHelper()\n#else\n\n// If you got an error about ARE_FAULTS_FORBIDDEN being undefined, it's because you tried\n// to use this predicate in a free build outside of a CONTRACT or ASSERT.\n//\n#define ARE_FAULTS_FORBIDDEN() (sizeof(YouCannotUseThisHere) != 0)\n#endif\n\n\n// This allows a fault-forbid region to invoke a non-mandatory allocation, such as for the\n// purpose of growing a lookaside cache (if the allocation fails, the code can abandon the\n// cache growing operation without negative effect.)\n//\n// Although it's implemented using CONTRACT_VIOLATION(), it's not a bug to have this in the code.\n//\n// It *is* a bug to use this to hide a situation where an OOM is genuinely fatal but not handled.\n#define FAULT_NOT_FATAL() CONTRACT_VIOLATION(FaultNotFatal)\n\n\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\n//------------------------------------------------------------------------------------\n// Underlying class support for TRIGGERS_TYPE_LOAD and OVERRIDE_TYPE_LOAD_LEVEL_LIMIT.\n// Don't reference this class directly. Use the macros.\n//------------------------------------------------------------------------------------\nclass LoadsTypeHolder\n{\n public:\n    LoadsTypeHolder(BOOL     fConditional,\n                    UINT     newLevel,\n                    BOOL     fEnforceLevelChangeDirection,\n                    const char    *szFunction,\n                    const char    *szFile,\n                    int      lineNum\n                   );\n\n    ~LoadsTypeHolder();\n\n private:\n    ClrDebugState      *m_pClrDebugState;\n    ClrDebugState       m_oldClrDebugState;\n    BOOL                m_fConditional;\n    ContractStackRecord m_contractStackRecord;\n\n};\n\n#endif  // ENABLE_CONTRACTS_IMPL\n\n\n//------------------------------------------------------------------------------------\n// TRIGGERS_TYPE_LOAD(newLevel)\n//    Works just LOADS_TYPE in contracts but lets you protect individual scopes\n//\n// OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel)\n//    Sets a new limit just like TRIGGERS_TYPE_LOAD but does not restrict you\n//    to decreasing the limit. Only the loader should use this and only when it\n//    can prove structurally that no recursion will occur as a result.\n//------------------------------------------------------------------------------------\n#ifdef ENABLE_CONTRACTS_IMPL\n\n#define TRIGGERS_TYPE_LOAD(newLevel)                            LoadsTypeHolder _lth(TRUE,    newLevel, TRUE,  __FUNCTION__, __FILE__, __LINE__);\n#define MAYBE_TRIGGERS_TYPE_LOAD(newLevel, fEnable)             LoadsTypeHolder _lth(fEnable, newLevel, TRUE,  __FUNCTION__, __FILE__, __LINE__);\n#define OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel)                LoadsTypeHolder _lth(TRUE,    newLevel, FALSE, __FUNCTION__, __FILE__, __LINE__);\n#define MAYBE_OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel, fEnable) LoadsTypeHolder _lth(fEnable, newLevel, FALSE, __FUNCTION__, __FILE__, __LINE__);\n\n#else   // ENABLE_CONTRACTS_IMPL\n\n#define TRIGGERS_TYPE_LOAD(newLevel)\n#define MAYBE_TRIGGERS_TYPE_LOAD(newLevel, fEnable)\n#define OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel)\n#define MAYBE_OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(newLevel, fEnable)\n\n#endif  // ENABLE_CONTRACTS_IMPL\n\n\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\n// This sets up a marker that says its okay to throw on this thread. This is not a public macro, and should only be\n// used from within the implementation of various try/catch macros.\nclass ClrTryMarkerHolder\n{\npublic:\n    DEBUG_NOINLINE ClrTryMarkerHolder()\n    {\n        SCAN_SCOPE_BEGIN;\n        STATIC_CONTRACT_THROWS;\n\n        m_pClrDebugState = GetClrDebugState();\n        m_oldOkayToThrowValue = m_pClrDebugState->IsOkToThrow();\n        m_pClrDebugState->SetOkToThrow();\n    }\n\n    DEBUG_NOINLINE ~ClrTryMarkerHolder()\n    {\n        SCAN_SCOPE_END;\n\n        m_pClrDebugState->SetOkToThrow( m_oldOkayToThrowValue );\n    }\n\nprivate:\n    BOOL           m_oldOkayToThrowValue;\n    ClrDebugState *m_pClrDebugState;\n};\n\n#define CLR_TRY_MARKER() ClrTryMarkerHolder ___tryMarkerHolder;\n\n#else // ENABLE_CONTRACTS_IMPL\n\n#define CLR_TRY_MARKER()\n\n#endif\n\n#ifdef ENABLE_CONTRACTS_IMPL\n// Note: This routine will create a ClrDebugState if called for the first time.\n// It cannot return NULL (see comment for InitClrDebugState).\ninline ClrDebugState *GetClrDebugState(BOOL fAlloc)\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    ClrDebugState *pState = CheckClrDebugState();\n\n    if (pState)\n    {\n        return pState;\n    }\n\n    if (fAlloc)\n    {\n        return CLRInitDebugState();\n    }\n\n    return NULL;\n}\n#endif // ENABLE_CONTRACTS_IMPL\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\nclass HostNoCallHolder\n{\n    public:\n    DEBUG_NOINLINE HostNoCallHolder()\n        {\n        SCAN_SCOPE_BEGIN;\n        STATIC_CONTRACT_HOST_NOCALLS;\n\n            m_clrDebugState = GetClrDebugState();\n            m_previousState = m_clrDebugState->SetHostCaller(FALSE);\n        }\n\n    DEBUG_NOINLINE ~HostNoCallHolder()\n        {\n        SCAN_SCOPE_END;\n\n            m_clrDebugState->SetHostCaller(m_previousState);\n        }\n\n     private:\n        BOOL m_previousState;\n        ClrDebugState* m_clrDebugState;\n\n};\n\n#define BEGIN_HOST_NOCALL_CODE \\\n    {                             \\\n        HostNoCallHolder __hostNoCallHolder;        \\\n        CantAllocHolder __cantAlloc;\n\n#define END_HOST_NOCALL_CODE   \\\n    }\n\n#else // ENABLE_CONTRACTS_IMPL\n#define BEGIN_HOST_NOCALL_CODE                      \\\n    {                                               \\\n        CantAllocHolder __cantAlloc;                \\\n\n#define END_HOST_NOCALL_CODE                        \\\n    }\n#endif\n\n\n#if defined(ENABLE_CONTRACTS_IMPL)\n\n// Macros to indicate we're taking or releasing locks\n\n// Most general macros, not used directly\n#define LOCK_TAKEN_MULTIPLE(dbgStateLockType, cEntrances, pvLock)    \\\n    ::GetClrDebugState()->LockTaken((dbgStateLockType), (cEntrances), (void*) (pvLock), __FUNCTION__, __FILE__, __LINE__)\n#define LOCK_RELEASED_MULTIPLE(dbgStateLockType, cExits, pvLock)     \\\n    ::GetClrDebugState()->LockReleased((dbgStateLockType), (cExits), (void*) (pvLock))\n\n// Use these only if you need to force multiple entrances or exits in a single\n// line (e.g., to restore the lock to a previous state). CRWLock in vm\\rwlock.cpp does this\n#define EE_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)                          \\\n    LOCK_TAKEN_MULTIPLE(kDbgStateLockType_EE, cEntrances, pvLock)\n#define EE_LOCK_RELEASED_MULTIPLE(cExits, pvLock)                           \\\n    LOCK_RELEASED_MULTIPLE(kDbgStateLockType_EE, cExits, pvLock)\n#define HOST_BREAKABLE_CRST_TAKEN_MULTIPLE(cEntrances, pvLock)              \\\n    LOCK_TAKEN_MULTIPLE(kDbgStateLockType_HostBreakableCrst, cEntrances, pvLock)\n#define HOST_BREAKABLE_CRST_RELEASED_MULTIPLE(cExits, pvLock)               \\\n    LOCK_RELEASED_MULTIPLE(kDbgStateLockType_HostBreakableCrst, cExits, pvLock)\n#define USER_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)                        \\\n    LOCK_TAKEN_MULTIPLE(kDbgStateLockType_User, cEntrances, pvLock)\n#define USER_LOCK_RELEASED_MULTIPLE(cExits, pvLock)                         \\\n    LOCK_RELEASED_MULTIPLE(kDbgStateLockType_User, cExits, pvLock)\n\n// These are most typically used\n#define EE_LOCK_TAKEN(pvLock)                   \\\n    LOCK_TAKEN_MULTIPLE(kDbgStateLockType_EE, 1, pvLock)\n#define EE_LOCK_RELEASED(pvLock)                \\\n    LOCK_RELEASED_MULTIPLE(kDbgStateLockType_EE, 1, pvLock)\n#define HOST_BREAKABLE_CRST_TAKEN(pvLock)       \\\n    LOCK_TAKEN_MULTIPLE(kDbgStateLockType_HostBreakableCrst, 1, pvLock)\n#define HOST_BREAKABLE_CRST_RELEASED(pvLock)    \\\n    LOCK_RELEASED_MULTIPLE(kDbgStateLockType_HostBreakableCrst, 1, pvLock)\n#define USER_LOCK_TAKEN(pvLock)                 \\\n    LOCK_TAKEN_MULTIPLE(kDbgStateLockType_User, 1, pvLock)\n#define USER_LOCK_RELEASED(pvLock)              \\\n    LOCK_RELEASED_MULTIPLE(kDbgStateLockType_User, 1, pvLock)\n\n#else // defined(ENABLE_CONTRACTS_IMPL)\n\n#define LOCK_TAKEN_MULTIPLE(dbgStateLockType, cEntrances, pvLock)\n#define LOCK_RELEASED_MULTIPLE(dbgStateLockType, cExits, pvLock)\n#define EE_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)\n#define EE_LOCK_RELEASED_MULTIPLE(cExits, pvLock)\n#define HOST_BREAKABLE_CRST_TAKEN_MULTIPLE(cEntrances, pvLock)\n#define HOST_BREAKABLE_CRST_RELEASED_MULTIPLE(cExits, pvLock)\n#define USER_LOCK_TAKEN_MULTIPLE(cEntrances, pvLock)\n#define USER_LOCK_RELEASED_MULTIPLE(cExits, pvLock)\n#define EE_LOCK_TAKEN(pvLock)\n#define EE_LOCK_RELEASED(pvLock)\n#define HOST_BREAKABLE_CRST_TAKEN(pvLock)\n#define HOST_BREAKABLE_CRST_RELEASED(pvLock)\n#define USER_LOCK_TAKEN(pvLock)\n#define USER_LOCK_RELEASED(pvLock)\n\n#endif // defined(ENABLE_CONTRACTS_IMPL)\n\n#if defined(ENABLE_CONTRACTS_IMPL)\n\n// Abbreviation for an assert that is only considered if there is a valid\n// ClrDebugState available.  Useful if you want to assert based on the value\n// of GetDbgStateLockCount(), where a return of 0 (the default if there is no\n// valid ClrDebugState available) would cause your assert to fire.  The variable\n// __pClrDebugState is set to the current ClrDebugState, and may be used within\n// your assert expression\n#define ASSERT_UNLESS_NO_DEBUG_STATE(e)                                                 \\\n    {                                                                                   \\\n        ClrDebugState * __pClrDebugState = GetClrDebugState();                          \\\n        _ASSERTE(((__pClrDebugState->ViolationMask() & BadDebugState) != 0) || (e));    \\\n    }\n\n#else // defined(ENABLE_CONTRACTS_IMPL)\n\n#define ASSERT_UNLESS_NO_DEBUG_STATE(e)\n\n#endif // defined(ENABLE_CONTRACTS_IMPL)\n\n\n//-----------------------------------------------------------------------------\n// Debug support to ensure that nobody calls New on the helper thread.\n// This is for interop debugging.\n// They should be using the InteropSafe heap.\n// Having this in the meantime allows us to\n// assert that the helper thread never calls new, and maintain a finite list of\n// exceptions (bugs).\n// Eventually, all those bugs should be fixed this holder can be completely removed.\n//\n// It is also the case that we disallow allocations when any thread is OS suspended\n// This happens for a short time when we are suspending the EE.   We suppress both\n// of these.\n//\n// @todo- ideally this would be rolled into the ContractViolation.\n// also, we'd have contract bit for whether APIs can be called on the helper thread.\n// @todo - if we really wanted to be strict, we should make this per-thread.\n//-----------------------------------------------------------------------------\n#ifdef ENABLE_CONTRACTS_IMPL\nextern Volatile<LONG> g_DbgSuppressAllocationAsserts;\n#define SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE CounterHolder _AllowNewOnHelperHolder(&g_DbgSuppressAllocationAsserts);\n#else\n// Nothing in retail since this holder just disabled an assert.\n#define SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE\n#endif\n\n\n//-----------------------------------------------------------------------------\n// Support for contracts in DAC builds\n//\n// At the moment, most of the contract system is disabled in DAC builds.\n// We do however want some simple static contracts in order to support static\n// analysis tools that run on mscordacwks.dll like DacCop.\n// Note that we want these static contracts in both DEBUG and retail builds.\n// We also already get simple static contracts like WRAPPER and LEAF.\n//\n//-----------------------------------------------------------------------------\n#if defined(DACCESS_COMPILE)\n\n// SUPPORTS_DAC is an annotation that says the function is designed to be used in DAC builds.\n// This enables full DacCop analysis on the function, including verifying that all functions that are\n// called also support DAC.\n#define SUPPORTS_DAC do { STATIC_CONTRACT_SUPPORTS_DAC; } while(0)\n\n// Normally a function can be annotated just with WRAPPER_NO_CONTRACT, which (in addition to the normal\n// contract meaning) indicates to DacCop that the function should be considered to support DAC when\n// it is called from a supports-dac function.  This is to avoid having to add a DAC-specific contract\n// to all the trivial one-line wrapper functions we have.\n// However, we occasionally want these semantics even for functions which are not appropriate to label\n// as WRAPPER_NO_CONTRACT.  For example, a template function may support DAC for certain template arguments,\n// but not others (due to the functions it calls).  We want to ensure that when such a function is called\n// in a DAC code path, analysis is enabled on that particular instantiation including checking all of the\n// call targets specific to this template instantiation.  But we don't want to require that the call targets\n// for ALL instantiations support dac, since we may not even be using them in DAC code paths.  Ideally we'd\n// remove any such code from the DAC build, but this will take time.\n#define SUPPORTS_DAC_WRAPPER do { STATIC_CONTRACT_WRAPPER;  } while(0)\n\n// SUPPORTS_DAC_HOST_ONLY indicates that a function is allowed to be called in DAC builds, but rather\n// than being a normal DAC function which operates on marshalled data, it is a host-only utility function\n// that knows nothing about DAC and operates solely on the host.  For example, DbgAssertDialog is a utility\n// function for popping assert dialogs - there is nothing DAC-specific about this.  Ideally such utility\n// functions would be confined to their own library which had no access to DAC functionality, and which\n// is not analyzed by DacCop.  At the moment splitting utilcode into two variations like this is too\n// painful, but we hope to do it in the future (primarily to support functions which can be used in either\n// DAC or host-only mode).\n// WARNING: This contract disables DacCop analysis  on the function and any functions it calls, so it\n// should be used very carefully.\n#define SUPPORTS_DAC_HOST_ONLY do { STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY; } while(0)\n\n#else\n#define SUPPORTS_DAC\n#define SUPPORTS_DAC_HOST_ONLY\n#define SUPPORTS_DAC_WRAPPER\n#endif // DACCESS_COMPILE\n\n// LIMITED_METHOD_DAC_CONTRACT is a shortcut for LIMITED_METHOD_CONTRACT and SUPPORTS_DAC. Usefull for one-line inline functions.\n#define LIMITED_METHOD_DAC_CONTRACT LIMITED_METHOD_CONTRACT; SUPPORTS_DAC\n\n//\n// The default contract is the recommended contract for ordinary code.\n// The ordinary code can throw or trigger GC any time, does not operate\n// on raw object refs, etc.\n//\n\n#define STANDARD_VM_CHECK           \\\n    THROWS;\n\n#define STANDARD_VM_CONTRACT        \\\n    CONTRACTL                   \\\n    {                           \\\n        STANDARD_VM_CHECK;          \\\n    }                           \\\n    CONTRACTL_END;              \\\n\n#define STATIC_STANDARD_VM_CONTRACT         \\\n    STATIC_CONTRACT_THROWS;             \\\n    STATIC_CONTRACT_GC_TRIGGERS;        \\\n    STATIC_CONTRACT_MODE_PREEMPTIVE;\n\n#define AFTER_CONTRACTS\n#include \"volatile.h\"\n\n#endif  // CONTRACT_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/contract.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// Contract.inl\n//\n\n// ! I am the owner for issues in the contract *infrastructure*, not for every\n// ! CONTRACT_VIOLATION dialog that comes up. If you interrupt my work for a routine\n// ! CONTRACT_VIOLATION, you will become the new owner of this file.\n// ---------------------------------------------------------------------------\n\n#ifndef CONTRACT_INL_\n#define CONTRACT_INL_\n\n#include \"contract.h\"\n#include <string.h>\n\n#ifdef ENABLE_CONTRACTS_IMPL\n\ninline void BaseContract::DoChecks(UINT testmask, _In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum)\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    // Cache the pointer to our ClrDebugState if it's not already cached.\n    // Derived types could set up this ptr before calling BaseContract::DoChecks if they have access to the Thread ptr\n    if (m_pClrDebugState == NULL)\n    {\n        m_pClrDebugState = GetClrDebugState();\n    }\n\n    // Save the incoming contents for restoration in the destructor\n    m_IncomingClrDebugState = *m_pClrDebugState;\n\n    m_testmask = testmask;  // Save the testmask for destructor\n\n    // Setup the new stack record.\n    m_contractStackRecord.m_szFunction = szFunction;\n    m_contractStackRecord.m_szFile     = szFile;\n    m_contractStackRecord.m_lineNum    = lineNum;\n    m_contractStackRecord.m_testmask   = testmask;\n    m_contractStackRecord.m_construct  = \"CONTRACT\";\n\n    // Link the new ContractStackRecord into the chain for this thread.\n    m_pClrDebugState->LinkContractStackTrace( &m_contractStackRecord );\n\n    if (testmask & DEBUG_ONLY_Yes)\n    {\n        m_pClrDebugState->SetDebugOnly();\n    }\n\n    switch (testmask & FAULT_Mask)\n    {\n        case FAULT_Forbid:\n            m_pClrDebugState->ViolationMaskReset( FaultViolation|FaultNotFatal );\n            m_pClrDebugState->SetFaultForbid();\n            break;\n\n        case FAULT_Inject:\n            if (m_pClrDebugState->IsFaultForbid() &&\n                !(m_pClrDebugState->ViolationMask() & (FaultViolation|FaultNotFatal|BadDebugState)))\n            {\n                CONTRACT_ASSERT(\"INJECT_FAULT called in a FAULTFORBID region.\",\n                                BaseContract::FAULT_Forbid,\n                                BaseContract::FAULT_Mask,\n                                m_contractStackRecord.m_szFunction,\n                                m_contractStackRecord.m_szFile,\n                                m_contractStackRecord.m_lineNum);\n            }\n            break;\n\n        case FAULT_Disabled:\n            // Nothing\n            break;\n\n        default:\n            UNREACHABLE();\n    }\n\n    switch (testmask & THROWS_Mask)\n    {\n        case THROWS_Yes:\n            m_pClrDebugState->CheckOkayToThrow(m_contractStackRecord.m_szFunction,\n                                               m_contractStackRecord.m_szFile,\n                                               m_contractStackRecord.m_lineNum);\n            break;\n\n        case THROWS_No:\n            m_pClrDebugState->ViolationMaskReset( ThrowsViolation );\n            m_pClrDebugState->ResetOkToThrow();\n            break;\n\n        case THROWS_Disabled:\n            // Nothing\n            break;\n\n        default:\n            UNREACHABLE();\n    }\n\n    // LOADS_TYPE check\n    switch (testmask & LOADS_TYPE_Mask)\n    {\n        case LOADS_TYPE_Disabled:\n            // Nothing\n            break;\n\n        default:\n            {\n                UINT newTypeLoadLevel = ((testmask & LOADS_TYPE_Mask) >> LOADS_TYPE_Shift) - 1;\n                if (newTypeLoadLevel > m_pClrDebugState->GetMaxLoadTypeLevel())\n                {\n                    if (!((LoadsTypeViolation|BadDebugState) & m_pClrDebugState->ViolationMask()))\n                    {\n                        CONTRACT_ASSERT(\"A function tried to load a type past the current level limit.\",\n                                        (m_pClrDebugState->GetMaxLoadTypeLevel() + 1) << LOADS_TYPE_Shift,\n                                        Contract::LOADS_TYPE_Mask,\n                                        m_contractStackRecord.m_szFunction,\n                                        m_contractStackRecord.m_szFile,\n                                        m_contractStackRecord.m_lineNum\n                                        );\n                    }\n                }\n                m_pClrDebugState->SetMaxLoadTypeLevel(newTypeLoadLevel);\n                m_pClrDebugState->ViolationMaskReset(LoadsTypeViolation);\n\n            }\n            break;\n    }\n\n    if (testmask & CAN_RETAKE_LOCK_No)\n    {\n        m_pClrDebugState->OnEnterCannotRetakeLockFunction();\n        m_pClrDebugState->ResetOkToRetakeLock();\n    }\n\n    switch (testmask & CAN_TAKE_LOCK_Mask)\n    {\n        case CAN_TAKE_LOCK_Yes:\n            m_pClrDebugState->CheckOkayToLock(m_contractStackRecord.m_szFunction,\n                                              m_contractStackRecord.m_szFile,\n                                              m_contractStackRecord.m_lineNum);\n            break;\n\n        case CAN_TAKE_LOCK_No:\n            m_pClrDebugState->ViolationMaskReset(TakesLockViolation);\n            m_pClrDebugState->ResetOkToLock();\n            break;\n\n        case CAN_TAKE_LOCK_Disabled:\n            // Nothing\n            break;\n\n        default:\n            UNREACHABLE();\n    }\n\n}\n\nFORCEINLINE BOOL BaseContract::CheckFaultInjection()\n{\n    // ??? use m_tag to see if we should trigger an injection\n    return FALSE;\n}\n\ninline BOOL ClrDebugState::CheckOkayToThrowNoAssert()\n{\n    if (!IsOkToThrow() && !(m_violationmask & (ThrowsViolation|BadDebugState)))\n    {\n        return FALSE;\n    }\n    return TRUE;\n}\n\ninline void ClrDebugState::CheckOkayToThrow(_In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum)\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    if (!CheckOkayToThrowNoAssert())\n    {\n        CONTRACT_ASSERT(\"THROWS called in a NOTHROW region.\",\n                        BaseContract::THROWS_No,\n                        BaseContract::THROWS_Mask,\n                        szFunction,\n                        szFile,\n                        lineNum);\n    }\n}\n\ninline BOOL ClrDebugState::CheckOkayToLockNoAssert()\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    if (!IsOkToLock() && !(m_violationmask & (TakesLockViolation|BadDebugState)))\n    {\n        return FALSE;\n    }\n    return TRUE;\n}\n\ninline void ClrDebugState::CheckOkayToLock(_In_z_ const char *szFunction, _In_z_ const char *szFile, int lineNum)\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    if (!CheckOkayToLockNoAssert())\n    {\n\n        CONTRACT_ASSERT(\"CAN_TAKE_LOCK called in a CANNOT_TAKE_LOCK region.\",\n                        BaseContract::CAN_TAKE_LOCK_No,\n                        BaseContract::CAN_TAKE_LOCK_Mask,\n                        szFunction,\n                        szFile,\n                        lineNum);\n\n    }\n}\n\n\ninline void ClrDebugState::LockTaken(DbgStateLockType dbgStateLockType,\n                                     UINT cTakes,\n                                     void * pvLock,\n                                     _In_z_ const char * szFunction,\n                                     _In_z_ const char * szFile,\n                                     int lineNum)\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    if ((m_violationmask & BadDebugState) != 0)\n    {\n        return;\n    }\n\n    // Assert if we're taking a lock in a CANNOT_TAKE_LOCK scope.  Even if this asserts, we'll\n    // continue to the following lines to track the lock\n    CheckOkayToLock(szFunction, szFile, lineNum);\n\n    _ASSERTE(GetDbgStateLockData() != NULL);\n\n    if (!IsOkToRetakeLock())\n    {\n        if (m_LockState.IsLockRetaken(pvLock))\n        {\n            CONTRACT_ASSERT(\"You cannot take a lock which is already being held in a CANNOT_RETAKE_LOCK scope.\",\n                     BaseContract::CAN_RETAKE_LOCK_No,\n                     BaseContract::CAN_RETAKE_LOCK_No,\n                     szFunction,\n                     szFile,\n                     lineNum);\n        }\n    }\n\n    GetDbgStateLockData()->LockTaken(dbgStateLockType, cTakes, pvLock, szFunction, szFile, lineNum);\n}\n\ninline void ClrDebugState::LockReleased(DbgStateLockType dbgStateLockType, UINT cReleases, void * pvLock)\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    if ((m_violationmask & BadDebugState) != 0)\n    {\n        return;\n    }\n\n    _ASSERTE(GetDbgStateLockData() != NULL);\n\n    if (!IsOkToRetakeLock())\n    {\n        // It is very suspicious to release any locks being hold at the time this function was\n        // called in a CANNOT_RETAKE_LOCK scope\n        _ASSERTE(m_LockState.IsSafeToRelease(cReleases));\n    }\n\n    GetDbgStateLockData()->LockReleased(dbgStateLockType, cReleases, pvLock);\n}\n\ninline UINT ClrDebugState::GetLockCount(DbgStateLockType dbgStateLockType)\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    if ((m_violationmask & BadDebugState) != 0)\n    {\n        return 0;\n    }\n\n    _ASSERTE(GetDbgStateLockData() != NULL);\n    return GetDbgStateLockData()->GetLockCount(dbgStateLockType);\n}\n\ninline UINT ClrDebugState::GetCombinedLockCount()\n{\n    STATIC_CONTRACT_DEBUG_ONLY;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    if ((m_violationmask & BadDebugState) != 0)\n    {\n        return 0;\n    }\n\n    _ASSERTE(GetDbgStateLockData() != NULL);\n    return GetDbgStateLockData()->GetCombinedLockCount();\n}\n\ninline void DbgStateLockData::LockTaken(DbgStateLockType dbgStateLockType,\n                                        UINT cTakes,      // # times we're taking this lock (usually 1)\n                                        void * pvLock,\n                                        _In_z_ const char * szFunction,\n                                        _In_z_ const char * szFile,\n                                        int lineNum)\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    // Technically the lock's already been taken before we're called, but it's\n    // handy to have this contract here at the leaf end of the call chain, as it\n    // ensures SCAN will enforce that no use of the LOCK_TAKEN macros occurs\n    // in a CANNOT_TAKE_LOCK scope (as LOCK_TAKEN macros just call this function).\n    STATIC_CONTRACT_CAN_TAKE_LOCK;\n\n    // Valid enum?\n    _ASSERTE(UINT(dbgStateLockType) < kDbgStateLockType_Count);\n\n    UINT cCombinedLocks = GetCombinedLockCount();\n\n    // Are we exceeding the threshold for what we can store in m_rgTakenLockInfos?\n    // If so, assert a warning, but we'll deal with it.\n    if ((cCombinedLocks <= ARRAY_SIZE(m_rgTakenLockInfos)) &&\n        (cCombinedLocks + cTakes > ARRAY_SIZE(m_rgTakenLockInfos)))\n    {\n        // Actually, for now we are NOT asserting until I can dedicate more time\n        // to this.  Some class loader code paths legally hold many simultaneous\n        // locks (>10).  Need to do further analysis on reasonable value to set\n        // for kMaxAllowedSimultaneousLocks.  Since lock order checking is turned\n        // off for the moment anyway, exceeding kMaxAllowedSimultaneousLocks\n        // has no consequences for now anyway.\n    }\n\n    m_rgcLocksTaken[dbgStateLockType] += cTakes;\n\n    // Remember as many of these new entrances in m_rgTakenLockInfos as we can\n    for (UINT i = cCombinedLocks;\n         i < min (ARRAY_SIZE(m_rgTakenLockInfos), cCombinedLocks + cTakes);\n         i++)\n    {\n        m_rgTakenLockInfos[i].m_pvLock = pvLock;\n        m_rgTakenLockInfos[i].m_szFile = szFile;\n        m_rgTakenLockInfos[i].m_lineNum = lineNum;\n    }\n}\n\ninline void DbgStateLockData::LockReleased(DbgStateLockType dbgStateLockType, UINT cReleases, void * pvLock)\n{\n    // Valid enum?\n    _ASSERTE(UINT(dbgStateLockType) < kDbgStateLockType_Count);\n\n    if (cReleases > m_rgcLocksTaken[dbgStateLockType])\n    {\n        _ASSERTE(!\"Releasing lock(s) that were never taken\");\n        cReleases = m_rgcLocksTaken[dbgStateLockType];\n    }\n\n    UINT cCombinedLocks = GetCombinedLockCount();\n\n    // If lock count is within range of our m_rgTakenLockInfos buffer size, then\n    // make sure we're releasing locks in reverse order of how we took them\n    for (UINT i = cCombinedLocks - cReleases;\n         i < min (ARRAY_SIZE(m_rgTakenLockInfos), cCombinedLocks);\n         i++)\n    {\n        if (m_rgTakenLockInfos[i].m_pvLock != pvLock)\n        {\n            // Ok, I lied.  We're not really checking that we're releasing locks in reverse\n            // order, because sometimes we legally release them out of order.  (The loader\n            // does this intentionally in a few places.) We should consider whether those\n            // places can be changed, or whether we can add some kind of macro to declare\n            // that we're releasing out of order, and that it's ok & intentional.  At that\n            // point, we can place a nice ASSERTE right here.  Until then, do nothing.\n        }\n\n        // We may be clearing out the wrong entry in m_rgTakenLockInfos here, if the locks\n        // were released out of order.  However, it will eventually correct itself once all\n        // the out-of-order locks have been released.  And our count\n        // (i.e., m_rgcLocksTaken[dbgStateLockType]) will always be accurate\n        memset(&(m_rgTakenLockInfos[i]),\n               0,\n               sizeof(m_rgTakenLockInfos[i]));\n    }\n\n    m_rgcLocksTaken[dbgStateLockType] -= cReleases;\n}\n\ninline void DbgStateLockData::SetStartingValues()\n{\n    memset(this, 0, sizeof(*this));\n}\n\ninline UINT DbgStateLockData::GetLockCount(DbgStateLockType dbgStateLockType)\n{\n    _ASSERTE(UINT(dbgStateLockType) < kDbgStateLockType_Count);\n    return m_rgcLocksTaken[dbgStateLockType];\n}\n\ninline UINT DbgStateLockData::GetCombinedLockCount()\n{\n    // If this fires, the set of lock types must have changed.  You'll need to\n    // fix the sum below to include all lock types\n    _ASSERTE(kDbgStateLockType_Count == 3);\n\n    return m_rgcLocksTaken[0] + m_rgcLocksTaken[1] + m_rgcLocksTaken[2];\n}\n\ninline void DbgStateLockState::SetStartingValues()\n{\n    m_cLocksEnteringCannotRetakeLock = 0;\n    m_pLockData = NULL;     // Will get filled in by CLRInitDebugState()\n}\n\n// We set a marker to record the number of locks that have been taken when\n// CANNOT_RETAKE_LOCK contract is constructed.\ninline void DbgStateLockState::OnEnterCannotRetakeLockFunction()\n{\n    m_cLocksEnteringCannotRetakeLock = m_pLockData->GetCombinedLockCount();\n}\n\ninline BOOL DbgStateLockState::IsLockRetaken(void * pvLock)\n{\n    // m_cLocksEnteringCannotRetakeLock must be in valid range\n    _ASSERTE(m_cLocksEnteringCannotRetakeLock <= m_pLockData->GetCombinedLockCount());\n\n    // m_cLocksEnteringCannotRetakeLock records the number of locks that were taken\n    // when CANNOT_RETAKE_LOCK contract was constructed.\n    for (UINT i = 0;\n        i < min(ARRAY_SIZE(m_pLockData->m_rgTakenLockInfos), m_cLocksEnteringCannotRetakeLock);\n        ++i)\n    {\n        if (m_pLockData->m_rgTakenLockInfos[i].m_pvLock == pvLock)\n        {\n            return TRUE;\n        }\n    }\n    return FALSE;\n}\n\ninline BOOL DbgStateLockState::IsSafeToRelease(UINT cReleases)\n{\n    return m_cLocksEnteringCannotRetakeLock <= (m_pLockData->GetCombinedLockCount() - cReleases);\n}\n\ninline void DbgStateLockState::SetDbgStateLockData(DbgStateLockData * pDbgStateLockData)\n{\n    m_pLockData = pDbgStateLockData;\n}\n\ninline DbgStateLockData * DbgStateLockState::GetDbgStateLockData()\n{\n    return m_pLockData;\n}\n\ninline\nvoid CONTRACT_ASSERT(const char *szElaboration,\n                     UINT  whichTest,\n                     UINT  whichTestMask,\n                     const char *szFunction,\n                     const char *szFile,\n                     int   lineNum)\n{\n    if (CheckClrDebugState() && ( CheckClrDebugState()->ViolationMask() & BadDebugState))\n    {\n        _ASSERTE(!\"Someone tried to assert a contract violation although the contracts were disabled in this thread due to\"\n                  \" an OOM or a shim/mscorwks mismatch. You can probably safely ignore this assert - however, whoever\"\n                  \" called CONTRACT_ASSERT was supposed to checked if the current violationmask had the BadDebugState set.\"\n                  \" Look up the stack, see who called CONTRACT_ASSERT and file a bug against the owner.\");\n        return;\n    }\n\n    // prevent recursion - we use the same mechanism as CHECK, so this will\n    // also prevent mutual recursion involving ASSERT_CHECKs\n    CHECK _check;\n    if (_check.EnterAssert())\n    {\n        char Buf[512*20 + 2048 + 1024];\n\n        sprintf_s(Buf,ARRAY_SIZE(Buf), \"CONTRACT VIOLATION by %s at \\\"%s\\\" @ %d\\n\\n%s\\n\", szFunction, szFile, lineNum, szElaboration);\n\n        int count = 20;\n        ContractStackRecord *pRec = CheckClrDebugState() ? CheckClrDebugState()->GetContractStackTrace() : NULL;\n        BOOL foundconflict = FALSE;\n        BOOL exceptionBuildingStack = FALSE;\n\n        PAL_TRY_NAKED\n        {\n            while (pRec != NULL)\n            {\n                char tmpbuf[512];\n                BOOL fshowconflict = FALSE;\n\n                if (!foundconflict)\n                {\n                    if (whichTest == (pRec->m_testmask & whichTestMask))\n                    {\n                        foundconflict = TRUE;\n                        fshowconflict = TRUE;\n                    }\n                }\n\n                if (count != 0 || fshowconflict)\n                {\n                    if (count != 0)\n                    {\n                        count--;\n                    }\n                    else\n                    {\n                        // Show that some lines have been skipped\n                        strcat_s(Buf, ARRAY_SIZE(Buf), \"\\n                        ...\");\n\n                    }\n\n                    sprintf_s(tmpbuf,ARRAY_SIZE(tmpbuf),\n                            \"\\n%s  %s in %s at \\\"%s\\\" @ %d\",\n                            fshowconflict ? \"VIOLATED-->\" : \"                      \",\n                            pRec->m_construct,\n                            pRec->m_szFunction,\n                            pRec->m_szFile,\n                            pRec->m_lineNum\n                            );\n\n                    strcat_s(Buf, ARRAY_SIZE(Buf), tmpbuf);\n                }\n\n                pRec = pRec->m_pNext;\n            }\n        }\n        PAL_EXCEPT_NAKED(EXCEPTION_EXECUTE_HANDLER)\n        {\n            // We're done trying to walk the stack of contracts. We faulted trying to form the contract stack trace,\n            // and that usually means that its corrupted. A common cause of this is having CONTRACTs in functions that\n            // never return, but instead do a non-local goto.\n            count = 0;\n            exceptionBuildingStack = TRUE;\n        }\n        PAL_ENDTRY_NAKED;\n\n        if (count == 0)\n        {\n            strcat_s(Buf,ARRAY_SIZE(Buf), \"\\n                        ...\");\n        }\n\n        if (exceptionBuildingStack)\n        {\n            strcat_s(Buf,ARRAY_SIZE(Buf),\n                   \"\\n\"\n                   \"\\nError forming contract stack. Any contract stack displayed above is correct,\"\n                   \"\\nbut it's most probably truncated. This is probably due to a CONTRACT in a\"\n                   \"\\nfunction that does a non-local goto. There are two bugs here:\"\n                   \"\\n\"\n                   \"\\n    1) the CONTRACT violation, and\"\n                   \"\\n    2) the CONTRACT in the function with the non-local goto.\"\n                   \"\\n\"\n                   \"\\nPlease fix both bugs!\"\n                   \"\\n\"\n                   );\n        }\n\n        strcat_s(Buf,ARRAY_SIZE(Buf), \"\\n\\n\");\n\n        if (!foundconflict && count != 0)\n        {\n            if (whichTest == BaseContract::THROWS_No)\n            {\n                strcat_s(Buf,ARRAY_SIZE(Buf), \"You can't throw here because there is no handler on the stack.\\n\");\n            }\n            else\n            {\n                strcat_s(Buf,ARRAY_SIZE(Buf), \"We can't find the violated contract. Look for an old-style non-holder-based contract.\\n\");\n            }\n        }\n\n        DbgAssertDialog((char *)szFile, lineNum, Buf);\n        _check.LeaveAssert();\n    }\n}\n\n\nFORCEINLINE BOOL BaseContract::EnforceContract()\n{\n    if (s_alwaysEnforceContracts)\n        return TRUE;\n    else\n        return CHECK::EnforceAssert();\n}\n\ninline void BaseContract::SetUnconditionalContractEnforcement(BOOL value)\n{\n    s_alwaysEnforceContracts = value;\n}\n\ninline UINT GetDbgStateCombinedLockCount()\n{\n    return GetClrDebugState()->GetCombinedLockCount();\n}\ninline UINT GetDbgStateLockCount(DbgStateLockType dbgStateLockType)\n{\n    return GetClrDebugState()->GetLockCount(dbgStateLockType);\n}\n\n#define ASSERT_NO_USER_LOCKS_HELD()   \\\n    _ASSERTE(GetDbgStateLockCount(kDbgStateLockType_User) == 0)\n#define ASSERT_NO_HOST_BREAKABLE_CRSTS_HELD()   \\\n    _ASSERTE(GetDbgStateLockCount(kDbgStateLockType_HostBreakableCrst) == 0)\n#define ASSERT_NO_EE_LOCKS_HELD()   \\\n    _ASSERTE(GetDbgStateLockCount(kDbgStateLockType_EE) == 0)\n\n#else  // ENABLE_CONTRACTS_IMPL\n\n#define ASSERT_NO_USER_LOCKS_HELD()\n#define ASSERT_NO_HOST_BREAKABLE_CRSTS_HELD()\n#define ASSERT_NO_EE_LOCKS_HELD()\n\n#endif  // ENABLE_CONTRACTS_IMPL\n\n#endif  // CONTRACT_INL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cor.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** Cor.h - general header for the Runtime.                                 **\n **                                                                         **\n *****************************************************************************/\n\n\n#ifndef _COR_H_\n#define _COR_H_\n\n//*****************************************************************************\n// Required includes\n#include <ole2.h>                       // Definitions of OLE types.\n#include <specstrings.h>\n#include \"corerror.h\"\n\n//*****************************************************************************\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// {BED7F4EA-1A96-11d2-8F08-00A0C9A6186D}\nEXTERN_GUID(LIBID_ComPlusRuntime, 0xbed7f4ea, 0x1a96, 0x11d2, 0x8f, 0x8, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d);\n\n// {90883F05-3D28-11D2-8F17-00A0C9A6186D}\nEXTERN_GUID(GUID_ExportedFromComPlus, 0x90883f05, 0x3d28, 0x11d2, 0x8f, 0x17, 0x0, 0xa0, 0xc9, 0xa6, 0x18, 0x6d);\n\n// {0F21F359-AB84-41e8-9A78-36D110E6D2F9}\nEXTERN_GUID(GUID_ManagedName, 0xf21f359, 0xab84, 0x41e8, 0x9a, 0x78, 0x36, 0xd1, 0x10, 0xe6, 0xd2, 0xf9);\n\n// {54FC8F55-38DE-4703-9C4E-250351302B1C}\nEXTERN_GUID(GUID_Function2Getter, 0x54fc8f55, 0x38de, 0x4703, 0x9c, 0x4e, 0x25, 0x3, 0x51, 0x30, 0x2b, 0x1c);\n\n// CLSID_CorMetaDataDispenserRuntime: {1EC2DE53-75CC-11d2-9775-00A0C9B4D50C}\n//  Dispenser coclass for version 1.5 and 2.0 meta data.  To get the \"latest\" bind\n//  to CLSID_MetaDataDispenser.\nEXTERN_GUID(CLSID_CorMetaDataDispenserRuntime, 0x1ec2de53, 0x75cc, 0x11d2, 0x97, 0x75, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\n\n// {CD2BC5C9-F452-4326-B714-F9C539D4DA58}\nEXTERN_GUID(GUID_DispIdOverride, 0xcd2bc5c9, 0xf452, 0x4326, 0xb7, 0x14, 0xf9, 0xc5, 0x39, 0xd4, 0xda, 0x58);\n\n// {B64784EB-D8D4-4d9b-9ACD-0E30806426F7}\nEXTERN_GUID(GUID_ForceIEnumerable, 0xb64784eb, 0xd8d4, 0x4d9b, 0x9a, 0xcd, 0x0e, 0x30, 0x80, 0x64, 0x26, 0xf7);\n\n// {2941FF83-88D8-4F73-B6A9-BDF8712D000D}\nEXTERN_GUID(GUID_PropGetCA, 0x2941ff83, 0x88d8, 0x4f73, 0xb6, 0xa9, 0xbd, 0xf8, 0x71, 0x2d, 0x00, 0x0d);\n\n// {29533527-3683-4364-ABC0-DB1ADD822FA2}\nEXTERN_GUID(GUID_PropPutCA, 0x29533527, 0x3683, 0x4364, 0xab, 0xc0, 0xdb, 0x1a, 0xdd, 0x82, 0x2f, 0xa2);\n\n// CLSID_CLR_v1_MetaData: {005023CA-72B1-11D3-9FC4-00C04F79A0A3}\n//  Used to generate v1 metadata (for v1.0 and v1.1 CLR compatibility).\nEXTERN_GUID(CLSID_CLR_v1_MetaData, 0x005023ca, 0x72b1, 0x11d3, 0x9f, 0xc4, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);\n\n// CLSID_CLR_v2_MetaData: {EFEA471A-44FD-4862-9292-0C58D46E1F3A}\nEXTERN_GUID(CLSID_CLR_v2_MetaData, 0xefea471a, 0x44fd, 0x4862, 0x92, 0x92, 0xc, 0x58, 0xd4, 0x6e, 0x1f, 0x3a);\n\n\n// CLSID_CorMetaDataRuntime:\n// This will can always be used to generate the \"latest\" metadata available.\n#define CLSID_CorMetaDataRuntime CLSID_CLR_v2_MetaData\n\n\n// {30FE7BE8-D7D9-11D2-9F80-00C04F79A0A3}\nEXTERN_GUID(MetaDataCheckDuplicatesFor, 0x30fe7be8, 0xd7d9, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);\n\n// {DE3856F8-D7D9-11D2-9F80-00C04F79A0A3}\nEXTERN_GUID(MetaDataRefToDefCheck, 0xde3856f8, 0xd7d9, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);\n\n// {E5D71A4C-D7DA-11D2-9F80-00C04F79A0A3}\nEXTERN_GUID(MetaDataNotificationForTokenMovement, 0xe5d71a4c, 0xd7da, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);\n\n// {2eee315c-d7db-11d2-9f80-00c04f79a0a3}\nEXTERN_GUID(MetaDataSetUpdate, 0x2eee315c, 0xd7db, 0x11d2, 0x9f, 0x80, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);\n#define MetaDataSetENC MetaDataSetUpdate\n\n// Use this guid in SetOption to indicate if the import enumerator should skip over\n// delete items or not. The default is yes.\n//\n// {79700F36-4AAC-11d3-84C3-009027868CB1}\nEXTERN_GUID(MetaDataImportOption, 0x79700f36, 0x4aac, 0x11d3, 0x84, 0xc3, 0x0, 0x90, 0x27, 0x86, 0x8c, 0xb1);\n\n// Use this guid in the SetOption if compiler wants to have MetaData API to take reader/writer lock\n//\n// {F7559806-F266-42ea-8C63-0ADB45E8B234}\nEXTERN_GUID(MetaDataThreadSafetyOptions, 0xf7559806, 0xf266, 0x42ea, 0x8c, 0x63, 0xa, 0xdb, 0x45, 0xe8, 0xb2, 0x34);\n\n// Use this guid in the SetOption if compiler wants error when some tokens are emitted out of order\n// {1547872D-DC03-11d2-9420-0000F8083460}\nEXTERN_GUID(MetaDataErrorIfEmitOutOfOrder, 0x1547872d, 0xdc03, 0x11d2, 0x94, 0x20, 0x0, 0x0, 0xf8, 0x8, 0x34, 0x60);\n\n// Use this guid in the SetOption to indicate if the tlbimporter should generate the\n// TCE adapters for COM connection point containers.\n// {DCC9DE90-4151-11d3-88D6-00902754C43A}\nEXTERN_GUID(MetaDataGenerateTCEAdapters, 0xdcc9de90, 0x4151, 0x11d3, 0x88, 0xd6, 0x0, 0x90, 0x27, 0x54, 0xc4, 0x3a);\n\n// Use this guid in the SetOption to specifiy a non-default namespace for typelib import.\n// {F17FF889-5A63-11d3-9FF2-00C04FF7431A}\nEXTERN_GUID(MetaDataTypeLibImportNamespace, 0xf17ff889, 0x5a63, 0x11d3, 0x9f, 0xf2, 0x0, 0xc0, 0x4f, 0xf7, 0x43, 0x1a);\n\n// Use this guid in the SetOption to specify the behavior of UnmarkAll. See CorLinkerOptions.\n// {47E099B6-AE7C-4797-8317-B48AA645B8F9}\nEXTERN_GUID(MetaDataLinkerOptions, 0x47e099b6, 0xae7c, 0x4797, 0x83, 0x17, 0xb4, 0x8a, 0xa6, 0x45, 0xb8, 0xf9);\n\n// Use this guid in the SetOption to specify the runtime version stored in the CLR metadata.\n// {47E099B7-AE7C-4797-8317-B48AA645B8F9}\nEXTERN_GUID(MetaDataRuntimeVersion, 0x47e099b7, 0xae7c, 0x4797, 0x83, 0x17, 0xb4, 0x8a, 0xa6, 0x45, 0xb8, 0xf9);\n\n// Use this guid in the SetOption to specify the behavior of the merger.\n// {132D3A6E-B35D-464e-951A-42EFB9FB6601}\nEXTERN_GUID(MetaDataMergerOptions, 0x132d3a6e, 0xb35d, 0x464e, 0x95, 0x1a, 0x42, 0xef, 0xb9, 0xfb, 0x66, 0x1);\n\n// Use this guid in SetOption to disable optimizing module-local refs to defs\n// {a55c0354-e91b-468b-8648-7cc31035d533}\nEXTERN_GUID(MetaDataPreserveLocalRefs, 0xa55c0354, 0xe91b, 0x468b, 0x86, 0x48, 0x7c, 0xc3, 0x10, 0x35, 0xd5, 0x33);\n\ninterface IMetaDataImport;\ninterface IMetaDataAssemblyEmit;\ninterface IMetaDataAssemblyImport;\ninterface IMetaDataEmit;\n\ntypedef UNALIGNED void const *UVCP_CONSTANT;\n\n\n// Constant for connection id and task id\n#define INVALID_CONNECTION_ID   0x0\n#define INVALID_TASK_ID         0x0\n#define MAX_CONNECTION_NAME     MAX_PATH\n\n\n#define MAIN_CLR_MODULE_NAME_W        W(\"coreclr\")\n#define MAIN_CLR_MODULE_NAME_A         \"coreclr\"\n\n#define MAIN_CLR_DLL_NAME_W           MAKEDLLNAME_W(MAIN_CLR_MODULE_NAME_W)\n#define MAIN_CLR_DLL_NAME_A           MAKEDLLNAME_A(MAIN_CLR_MODULE_NAME_A)\n\n#define TARGET_MAIN_CLR_DLL_NAME_W    MAKE_TARGET_DLLNAME_W(MAIN_CLR_MODULE_NAME_W)\n#define TARGET_MAIN_CLR_DLL_NAME_A    MAKE_TARGET_DLLNAME_A(MAIN_CLR_MODULE_NAME_A)\n\n//*****************************************************************************\n//*****************************************************************************\n//\n// I L   &   F I L E   F O R M A T   D E C L A R A T I O N S\n//\n//*****************************************************************************\n//*****************************************************************************\n\n\n//\n#ifndef _WINDOWS_UPDATES_\n#include <corhdr.h>\n#endif // <windows.h> updates\n\n//*****************************************************************************\n//*****************************************************************************\n\n// CLSID_Cor: {bee00000-ee77-11d0-a015-00c04fbbb884}\nEXTERN_GUID(CLSID_Cor, 0xbee00010, 0xee77, 0x11d0, 0xa0, 0x15, 0x00, 0xc0, 0x4f, 0xbb, 0xb8, 0x84);\n\n// CLSID_CorMetaDataDispenser: {E5CB7A31-7512-11d2-89CE-0080C792E5D8}\n//  This is the \"Master Dispenser\", always guaranteed to be the most recent\n//  dispenser on the machine.\nEXTERN_GUID(CLSID_CorMetaDataDispenser, 0xe5cb7a31, 0x7512, 0x11d2, 0x89, 0xce, 0x0, 0x80, 0xc7, 0x92, 0xe5, 0xd8);\n\n\n// CLSID_CorMetaDataDispenserReg: {435755FF-7397-11d2-9771-00A0C9B4D50C}\n//  Dispenser coclass for version 1.0 meta data.  To get the \"latest\" bind\n//  to CLSID_CorMetaDataDispenser.\nEXTERN_GUID(CLSID_CorMetaDataDispenserReg, 0x435755ff, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\n\n\n// CLSID_CorMetaDataReg: {87F3A1F5-7397-11d2-9771-00A0C9B4D50C}\n// For COM+ Meta Data, Data Driven Registration\nEXTERN_GUID(CLSID_CorMetaDataReg, 0x87f3a1f5, 0x7397, 0x11d2, 0x97, 0x71, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\n\n\ninterface IMetaDataDispenser;\n\n//-------------------------------------\n//--- IMetaDataError\n//-------------------------------------\n// {B81FF171-20F3-11d2-8DCC-00A0C9B09C19}\nEXTERN_GUID(IID_IMetaDataError, 0xb81ff171, 0x20f3, 0x11d2, 0x8d, 0xcc, 0x0, 0xa0, 0xc9, 0xb0, 0x9c, 0x19);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataError\nDECLARE_INTERFACE_(IMetaDataError, IUnknown)\n{\n    STDMETHOD(OnError)(HRESULT hrError, mdToken token) PURE;\n};\n\n//-------------------------------------\n//--- IMapToken\n//-------------------------------------\n// IID_IMapToken: {06A3EA8B-0225-11d1-BF72-00C04FC31E12}\nEXTERN_GUID(IID_IMapToken, 0x6a3ea8b, 0x225, 0x11d1, 0xbf, 0x72, 0x0, 0xc0, 0x4f, 0xc3, 0x1e, 0x12);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMapToken\nDECLARE_INTERFACE_(IMapToken, IUnknown)\n{\n    STDMETHOD(Map)(mdToken tkImp, mdToken tkEmit) PURE;\n};\n\n//-------------------------------------\n//--- IMetaDataDispenser\n//-------------------------------------\n// {809C652E-7396-11D2-9771-00A0C9B4D50C}\nEXTERN_GUID(IID_IMetaDataDispenser, 0x809c652e, 0x7396, 0x11d2, 0x97, 0x71, 0x00, 0xa0, 0xc9, 0xb4, 0xd5, 0x0c);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataDispenser\nDECLARE_INTERFACE_(IMetaDataDispenser, IUnknown)\n{\n    STDMETHOD(DefineScope)(                 // Return code.\n        REFCLSID    rclsid,                 // [in] What version to create.\n        DWORD       dwCreateFlags,          // [in] Flags on the create.\n        REFIID      riid,                   // [in] The interface desired.\n        IUnknown    **ppIUnk) PURE;         // [out] Return interface on success.\n\n    STDMETHOD(OpenScope)(                   // Return code.\n        LPCWSTR     szScope,                // [in] The scope to open.\n        DWORD       dwOpenFlags,            // [in] Open mode flags.\n        REFIID      riid,                   // [in] The interface desired.\n        IUnknown    **ppIUnk) PURE;         // [out] Return interface on success.\n\n    STDMETHOD(OpenScopeOnMemory)(           // Return code.\n        LPCVOID     pData,                  // [in] Location of scope data.\n        ULONG       cbData,                 // [in] Size of the data pointed to by pData.\n        DWORD       dwOpenFlags,            // [in] Open mode flags.\n        REFIID      riid,                   // [in] The interface desired.\n        IUnknown    **ppIUnk) PURE;         // [out] Return interface on success.\n};\n\n//-------------------------------------\n//--- IMetaDataEmit\n//-------------------------------------\n// {BA3FEE4C-ECB9-4e41-83B7-183FA41CD859}\nEXTERN_GUID(IID_IMetaDataEmit, 0xba3fee4c, 0xecb9, 0x4e41, 0x83, 0xb7, 0x18, 0x3f, 0xa4, 0x1c, 0xd8, 0x59);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataEmit\nDECLARE_INTERFACE_(IMetaDataEmit, IUnknown)\n{\n    STDMETHOD(SetModuleProps)(              // S_OK or error.\n        LPCWSTR     szName) PURE;           // [IN] If not NULL, the name of the module to set.\n\n    STDMETHOD(Save)(                        // S_OK or error.\n        LPCWSTR     szFile,                 // [IN] The filename to save to.\n        DWORD       dwSaveFlags) PURE;      // [IN] Flags for the save.\n\n    STDMETHOD(SaveToStream)(                // S_OK or error.\n        IStream     *pIStream,              // [IN] A writable stream to save to.\n        DWORD       dwSaveFlags) PURE;      // [IN] Flags for the save.\n\n    STDMETHOD(GetSaveSize)(                 // S_OK or error.\n        CorSaveSize fSave,                  // [IN] cssAccurate or cssQuick.\n        DWORD       *pdwSaveSize) PURE;     // [OUT] Put the size here.\n\n    STDMETHOD(DefineTypeDef)(               // S_OK or error.\n        LPCWSTR     szTypeDef,              // [IN] Name of TypeDef\n        DWORD       dwTypeDefFlags,         // [IN] CustomAttribute flags\n        mdToken     tkExtends,              // [IN] extends this TypeDef or typeref\n        mdToken     rtkImplements[],        // [IN] Implements interfaces\n        mdTypeDef   *ptd) PURE;             // [OUT] Put TypeDef token here\n\n    STDMETHOD(DefineNestedType)(            // S_OK or error.\n        LPCWSTR     szTypeDef,              // [IN] Name of TypeDef\n        DWORD       dwTypeDefFlags,         // [IN] CustomAttribute flags\n        mdToken     tkExtends,              // [IN] extends this TypeDef or typeref\n        mdToken     rtkImplements[],        // [IN] Implements interfaces\n        mdTypeDef   tdEncloser,             // [IN] TypeDef token of the enclosing type.\n        mdTypeDef   *ptd) PURE;             // [OUT] Put TypeDef token here\n\n    STDMETHOD(SetHandler)(                  // S_OK.\n        IUnknown    *pUnk) PURE;            // [IN] The new error handler.\n\n    STDMETHOD(DefineMethod)(                // S_OK or error.\n        mdTypeDef   td,                     // Parent TypeDef\n        LPCWSTR     szName,                 // Name of member\n        DWORD       dwMethodFlags,          // Member attributes\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        ULONG       ulCodeRVA,\n        DWORD       dwImplFlags,\n        mdMethodDef *pmd) PURE;             // Put member token here\n\n    STDMETHOD(DefineMethodImpl)(            // S_OK or error.\n        mdTypeDef   td,                     // [IN] The class implementing the method\n        mdToken     tkBody,                 // [IN] Method body - MethodDef or MethodRef\n        mdToken     tkDecl) PURE;           // [IN] Method declaration - MethodDef or MethodRef\n\n    STDMETHOD(DefineTypeRefByName)(         // S_OK or error.\n        mdToken     tkResolutionScope,      // [IN] ModuleRef, AssemblyRef or TypeRef.\n        LPCWSTR     szName,                 // [IN] Name of the TypeRef.\n        mdTypeRef   *ptr) PURE;             // [OUT] Put TypeRef token here.\n\n    STDMETHOD(DefineImportType)(            // S_OK or error.\n        IMetaDataAssemblyImport *pAssemImport,  // [IN] Assembly containing the TypeDef.\n        const void  *pbHashValue,           // [IN] Hash Blob for Assembly.\n        ULONG       cbHashValue,            // [IN] Count of bytes.\n        IMetaDataImport *pImport,           // [IN] Scope containing the TypeDef.\n        mdTypeDef   tdImport,               // [IN] The imported TypeDef.\n        IMetaDataAssemblyEmit *pAssemEmit,  // [IN] Assembly into which the TypeDef is imported.\n        mdTypeRef   *ptr) PURE;             // [OUT] Put TypeRef token here.\n\n    STDMETHOD(DefineMemberRef)(             // S_OK or error\n        mdToken     tkImport,               // [IN] ClassRef or ClassDef importing a member.\n        LPCWSTR     szName,                 // [IN] member's name\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        mdMemberRef *pmr) PURE;             // [OUT] memberref token\n\n    STDMETHOD(DefineImportMember)(          // S_OK or error.\n        IMetaDataAssemblyImport *pAssemImport,  // [IN] Assembly containing the Member.\n        const void  *pbHashValue,           // [IN] Hash Blob for Assembly.\n        ULONG       cbHashValue,            // [IN] Count of bytes.\n        IMetaDataImport *pImport,           // [IN] Import scope, with member.\n        mdToken     mbMember,               // [IN] Member in import scope.\n        IMetaDataAssemblyEmit *pAssemEmit,  // [IN] Assembly into which the Member is imported.\n        mdToken     tkParent,               // [IN] Classref or classdef in emit scope.\n        mdMemberRef *pmr) PURE;             // [OUT] Put member ref here.\n\n    STDMETHOD(DefineEvent) (\n        mdTypeDef   td,                     // [IN] the class/interface on which the event is being defined\n        LPCWSTR     szEvent,                // [IN] Name of the event\n        DWORD       dwEventFlags,           // [IN] CorEventAttr\n        mdToken     tkEventType,            // [IN] a reference (mdTypeRef or mdTypeRef) to the Event class\n        mdMethodDef mdAddOn,                // [IN] required add method\n        mdMethodDef mdRemoveOn,             // [IN] required remove method\n        mdMethodDef mdFire,                 // [IN] optional fire method\n        mdMethodDef rmdOtherMethods[],      // [IN] optional array of other methods associate with the event\n        mdEvent     *pmdEvent) PURE;        // [OUT] output event token\n\n    STDMETHOD(SetClassLayout) (\n        mdTypeDef   td,                     // [IN] typedef\n        DWORD       dwPackSize,             // [IN] packing size specified as 1, 2, 4, 8, or 16\n        COR_FIELD_OFFSET rFieldOffsets[],   // [IN] array of layout specification\n        ULONG       ulClassSize) PURE;      // [IN] size of the class\n\n    STDMETHOD(DeleteClassLayout) (\n        mdTypeDef   td) PURE;               // [IN] typedef whose layout is to be deleted.\n\n    STDMETHOD(SetFieldMarshal) (\n        mdToken     tk,                     // [IN] given a fieldDef or paramDef token\n        PCCOR_SIGNATURE pvNativeType,       // [IN] native type specification\n        ULONG       cbNativeType) PURE;     // [IN] count of bytes of pvNativeType\n\n    STDMETHOD(DeleteFieldMarshal) (\n        mdToken     tk) PURE;               // [IN] given a fieldDef or paramDef token\n\n    STDMETHOD(DefinePermissionSet) (\n        mdToken     tk,                     // [IN] the object to be decorated.\n        DWORD       dwAction,               // [IN] CorDeclSecurity.\n        void const  *pvPermission,          // [IN] permission blob.\n        ULONG       cbPermission,           // [IN] count of bytes of pvPermission.\n        mdPermission *ppm) PURE;            // [OUT] returned permission token.\n\n    STDMETHOD(SetRVA)(                      // S_OK or error.\n        mdMethodDef md,                     // [IN] Method for which to set offset\n        ULONG       ulRVA) PURE;            // [IN] The offset\n\n    STDMETHOD(GetTokenFromSig)(             // S_OK or error.\n        PCCOR_SIGNATURE pvSig,              // [IN] Signature to define.\n        ULONG       cbSig,                  // [IN] Size of signature data.\n        mdSignature *pmsig) PURE;           // [OUT] returned signature token.\n\n    STDMETHOD(DefineModuleRef)(             // S_OK or error.\n        LPCWSTR     szName,                 // [IN] DLL name\n        mdModuleRef *pmur) PURE;            // [OUT] returned\n\n    // <TODO>@FUTURE:  This should go away once everyone starts using SetMemberRefProps.</TODO>\n    STDMETHOD(SetParent)(                   // S_OK or error.\n        mdMemberRef mr,                     // [IN] Token for the ref to be fixed up.\n        mdToken     tk) PURE;               // [IN] The ref parent.\n\n    STDMETHOD(GetTokenFromTypeSpec)(        // S_OK or error.\n        PCCOR_SIGNATURE pvSig,              // [IN] TypeSpec Signature to define.\n        ULONG       cbSig,                  // [IN] Size of signature data.\n        mdTypeSpec *ptypespec) PURE;        // [OUT] returned TypeSpec token.\n\n    STDMETHOD(SaveToMemory)(                // S_OK or error.\n        void        *pbData,                // [OUT] Location to write data.\n        ULONG       cbData) PURE;           // [IN] Max size of data buffer.\n\n    STDMETHOD(DefineUserString)(            // Return code.\n        LPCWSTR szString,                   // [IN] User literal string.\n        ULONG       cchString,              // [IN] Length of string.\n        mdString    *pstk) PURE;            // [OUT] String token.\n\n    STDMETHOD(DeleteToken)(                 // Return code.\n        mdToken     tkObj) PURE;            // [IN] The token to be deleted\n\n    STDMETHOD(SetMethodProps)(              // S_OK or error.\n        mdMethodDef md,                     // [IN] The MethodDef.\n        DWORD       dwMethodFlags,          // [IN] Method attributes.\n        ULONG       ulCodeRVA,              // [IN] Code RVA.\n        DWORD       dwImplFlags) PURE;      // [IN] Impl flags.\n\n    STDMETHOD(SetTypeDefProps)(             // S_OK or error.\n        mdTypeDef   td,                     // [IN] The TypeDef.\n        DWORD       dwTypeDefFlags,         // [IN] TypeDef flags.\n        mdToken     tkExtends,              // [IN] Base TypeDef or TypeRef.\n        mdToken     rtkImplements[]) PURE;  // [IN] Implemented interfaces.\n\n    STDMETHOD(SetEventProps)(               // S_OK or error.\n        mdEvent     ev,                     // [IN] The event token.\n        DWORD       dwEventFlags,           // [IN] CorEventAttr.\n        mdToken     tkEventType,            // [IN] A reference (mdTypeRef or mdTypeRef) to the Event class.\n        mdMethodDef mdAddOn,                // [IN] Add method.\n        mdMethodDef mdRemoveOn,             // [IN] Remove method.\n        mdMethodDef mdFire,                 // [IN] Fire method.\n        mdMethodDef rmdOtherMethods[]) PURE;// [IN] Array of other methods associate with the event.\n\n    STDMETHOD(SetPermissionSetProps)(       // S_OK or error.\n        mdToken     tk,                     // [IN] The object to be decorated.\n        DWORD       dwAction,               // [IN] CorDeclSecurity.\n        void const  *pvPermission,          // [IN] Permission blob.\n        ULONG       cbPermission,           // [IN] Count of bytes of pvPermission.\n        mdPermission *ppm) PURE;            // [OUT] Permission token.\n\n    STDMETHOD(DefinePinvokeMap)(            // Return code.\n        mdToken     tk,                     // [IN] FieldDef or MethodDef.\n        DWORD       dwMappingFlags,         // [IN] Flags used for mapping.\n        LPCWSTR     szImportName,           // [IN] Import name.\n        mdModuleRef mrImportDLL) PURE;      // [IN] ModuleRef token for the target DLL.\n\n    STDMETHOD(SetPinvokeMap)(               // Return code.\n        mdToken     tk,                     // [IN] FieldDef or MethodDef.\n        DWORD       dwMappingFlags,         // [IN] Flags used for mapping.\n        LPCWSTR     szImportName,           // [IN] Import name.\n        mdModuleRef mrImportDLL) PURE;      // [IN] ModuleRef token for the target DLL.\n\n    STDMETHOD(DeletePinvokeMap)(            // Return code.\n        mdToken     tk) PURE;               // [IN] FieldDef or MethodDef.\n\n    // New CustomAttribute functions.\n    STDMETHOD(DefineCustomAttribute)(       // Return code.\n        mdToken     tkOwner,                // [IN] The object to put the value on.\n        mdToken     tkCtor,                 // [IN] Constructor of the CustomAttribute type (MemberRef/MethodDef).\n        void const  *pCustomAttribute,      // [IN] The custom value data.\n        ULONG       cbCustomAttribute,      // [IN] The custom value data length.\n        mdCustomAttribute *pcv) PURE;       // [OUT] The custom value token value on return.\n\n    STDMETHOD(SetCustomAttributeValue)(     // Return code.\n        mdCustomAttribute pcv,              // [IN] The custom value token whose value to replace.\n        void const  *pCustomAttribute,      // [IN] The custom value data.\n        ULONG       cbCustomAttribute) PURE;// [IN] The custom value data length.\n\n    STDMETHOD(DefineField)(                 // S_OK or error.\n        mdTypeDef   td,                     // Parent TypeDef\n        LPCWSTR     szName,                 // Name of member\n        DWORD       dwFieldFlags,           // Member attributes\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        DWORD       dwCPlusTypeFlag,        // [IN] flag for value type. selected ELEMENT_TYPE_*\n        void const  *pValue,                // [IN] constant value\n        ULONG       cchValue,               // [IN] size of constant value (string, in wide chars).\n        mdFieldDef  *pmd) PURE;             // [OUT] Put member token here\n\n    STDMETHOD(DefineProperty)(\n        mdTypeDef   td,                     // [IN] the class/interface on which the property is being defined\n        LPCWSTR     szProperty,             // [IN] Name of the property\n        DWORD       dwPropFlags,            // [IN] CorPropertyAttr\n        PCCOR_SIGNATURE pvSig,              // [IN] the required type signature\n        ULONG       cbSig,                  // [IN] the size of the type signature blob\n        DWORD       dwCPlusTypeFlag,        // [IN] flag for value type. selected ELEMENT_TYPE_*\n        void const  *pValue,                // [IN] constant value\n        ULONG       cchValue,               // [IN] size of constant value (string, in wide chars).\n        mdMethodDef mdSetter,               // [IN] optional setter of the property\n        mdMethodDef mdGetter,               // [IN] optional getter of the property\n        mdMethodDef rmdOtherMethods[],      // [IN] an optional array of other methods\n        mdProperty  *pmdProp) PURE;         // [OUT] output property token\n\n    STDMETHOD(DefineParam)(\n        mdMethodDef md,                     // [IN] Owning method\n        ULONG       ulParamSeq,             // [IN] Which param\n        LPCWSTR     szName,                 // [IN] Optional param name\n        DWORD       dwParamFlags,           // [IN] Optional param flags\n        DWORD       dwCPlusTypeFlag,        // [IN] flag for value type. selected ELEMENT_TYPE_*\n        void const  *pValue,                // [IN] constant value\n        ULONG       cchValue,               // [IN] size of constant value (string, in wide chars).\n        mdParamDef  *ppd) PURE;             // [OUT] Put param token here\n\n    STDMETHOD(SetFieldProps)(               // S_OK or error.\n        mdFieldDef  fd,                     // [IN] The FieldDef.\n        DWORD       dwFieldFlags,           // [IN] Field attributes.\n        DWORD       dwCPlusTypeFlag,        // [IN] Flag for the value type, selected ELEMENT_TYPE_*\n        void const  *pValue,                // [IN] Constant value.\n        ULONG       cchValue) PURE;         // [IN] size of constant value (string, in wide chars).\n\n    STDMETHOD(SetPropertyProps)(            // S_OK or error.\n        mdProperty  pr,                     // [IN] Property token.\n        DWORD       dwPropFlags,            // [IN] CorPropertyAttr.\n        DWORD       dwCPlusTypeFlag,        // [IN] Flag for value type, selected ELEMENT_TYPE_*\n        void const  *pValue,                // [IN] Constant value.\n        ULONG       cchValue,               // [IN] size of constant value (string, in wide chars).\n        mdMethodDef mdSetter,               // [IN] Setter of the property.\n        mdMethodDef mdGetter,               // [IN] Getter of the property.\n        mdMethodDef rmdOtherMethods[]) PURE;// [IN] Array of other methods.\n\n    STDMETHOD(SetParamProps)(               // Return code.\n        mdParamDef  pd,                     // [IN] Param token.\n        LPCWSTR     szName,                 // [IN] Param name.\n        DWORD       dwParamFlags,           // [IN] Param flags.\n        DWORD       dwCPlusTypeFlag,        // [IN] Flag for value type. selected ELEMENT_TYPE_*.\n        void const  *pValue,                // [OUT] Constant value.\n        ULONG       cchValue) PURE;         // [IN] size of constant value (string, in wide chars).\n\n    // Specialized Custom Attributes for security.\n    STDMETHOD(DefineSecurityAttributeSet)(  // Return code.\n        mdToken     tkObj,                  // [IN] Class or method requiring security attributes.\n        COR_SECATTR rSecAttrs[],            // [IN] Array of security attribute descriptions.\n        ULONG       cSecAttrs,              // [IN] Count of elements in above array.\n        ULONG       *pulErrorAttr) PURE;    // [OUT] On error, index of attribute causing problem.\n\n    STDMETHOD(ApplyEditAndContinue)(        // S_OK or error.\n        IUnknown    *pImport) PURE;         // [IN] Metadata from the delta PE.\n\n    STDMETHOD(TranslateSigWithScope)(\n        IMetaDataAssemblyImport *pAssemImport, // [IN] importing assembly interface\n        const void  *pbHashValue,           // [IN] Hash Blob for Assembly.\n        ULONG       cbHashValue,            // [IN] Count of bytes.\n        IMetaDataImport *import,            // [IN] importing interface\n        PCCOR_SIGNATURE pbSigBlob,          // [IN] signature in the importing scope\n        ULONG       cbSigBlob,              // [IN] count of bytes of signature\n        IMetaDataAssemblyEmit *pAssemEmit,  // [IN] emit assembly interface\n        IMetaDataEmit *emit,                // [IN] emit interface\n        PCOR_SIGNATURE pvTranslatedSig,     // [OUT] buffer to hold translated signature\n        ULONG       cbTranslatedSigMax,\n        ULONG       *pcbTranslatedSig) PURE;// [OUT] count of bytes in the translated signature\n\n    STDMETHOD(SetMethodImplFlags)(          // [IN] S_OK or error.\n        mdMethodDef md,                     // [IN] Method for which to set ImplFlags\n        DWORD       dwImplFlags) PURE;\n\n    STDMETHOD(SetFieldRVA)(                 // [IN] S_OK or error.\n        mdFieldDef  fd,                     // [IN] Field for which to set offset\n        ULONG       ulRVA) PURE;            // [IN] The offset\n\n    STDMETHOD(Merge)(                       // S_OK or error.\n        IMetaDataImport *pImport,           // [IN] The scope to be merged.\n        IMapToken   *pHostMapToken,         // [IN] Host IMapToken interface to receive token remap notification\n        IUnknown    *pHandler) PURE;        // [IN] An object to receive to receive error notification.\n\n    STDMETHOD(MergeEnd)() PURE;             // S_OK or error.\n\n    // This interface is sealed.  Do not change, add, or remove anything.  Instead, derive a new iterface.\n\n};      // IMetaDataEmit\n\n//-------------------------------------\n//--- IMetaDataEmit2\n//-------------------------------------\n// {F5DD9950-F693-42e6-830E-7B833E8146A9}\nEXTERN_GUID(IID_IMetaDataEmit2, 0xf5dd9950, 0xf693, 0x42e6, 0x83, 0xe, 0x7b, 0x83, 0x3e, 0x81, 0x46, 0xa9);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataEmit2\nDECLARE_INTERFACE_(IMetaDataEmit2, IMetaDataEmit)\n{\n    STDMETHOD(DefineMethodSpec)(\n        mdToken     tkParent,               // [IN] MethodDef or MemberRef\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of COM+ signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        mdMethodSpec *pmi) PURE;            // [OUT] method instantiation token\n\n    STDMETHOD(GetDeltaSaveSize)(            // S_OK or error.\n        CorSaveSize fSave,                  // [IN] cssAccurate or cssQuick.\n        DWORD       *pdwSaveSize) PURE;     // [OUT] Put the size here.\n\n    STDMETHOD(SaveDelta)(                   // S_OK or error.\n        LPCWSTR     szFile,                 // [IN] The filename to save to.\n        DWORD       dwSaveFlags) PURE;      // [IN] Flags for the save.\n\n    STDMETHOD(SaveDeltaToStream)(           // S_OK or error.\n        IStream     *pIStream,              // [IN] A writable stream to save to.\n        DWORD       dwSaveFlags) PURE;      // [IN] Flags for the save.\n\n    STDMETHOD(SaveDeltaToMemory)(           // S_OK or error.\n        void        *pbData,                // [OUT] Location to write data.\n        ULONG       cbData) PURE;           // [IN] Max size of data buffer.\n\n    STDMETHOD(DefineGenericParam)(          // S_OK or error.\n        mdToken      tk,                    // [IN] TypeDef or MethodDef\n        ULONG        ulParamSeq,            // [IN] Index of the type parameter\n        DWORD        dwParamFlags,          // [IN] Flags, for future use (e.g. variance)\n        LPCWSTR      szname,                // [IN] Name\n        DWORD        reserved,              // [IN] For future use (e.g. non-type parameters)\n        mdToken      rtkConstraints[],      // [IN] Array of type constraints (TypeDef,TypeRef,TypeSpec)\n        mdGenericParam *pgp) PURE;          // [OUT] Put GenericParam token here\n\n    STDMETHOD(SetGenericParamProps)(        // S_OK or error.\n        mdGenericParam gp,                  // [IN] GenericParam\n        DWORD        dwParamFlags,          // [IN] Flags, for future use (e.g. variance)\n        LPCWSTR      szName,                // [IN] Optional name\n        DWORD        reserved,              // [IN] For future use (e.g. non-type parameters)\n        mdToken      rtkConstraints[]) PURE;// [IN] Array of type constraints (TypeDef,TypeRef,TypeSpec)\n\n    STDMETHOD(ResetENCLog)() PURE;          // S_OK or error.\n\n};\n\n//-------------------------------------\n//--- IMetaDataImport\n//-------------------------------------\n// {7DAC8207-D3AE-4c75-9B67-92801A497D44}\nEXTERN_GUID(IID_IMetaDataImport, 0x7dac8207, 0xd3ae, 0x4c75, 0x9b, 0x67, 0x92, 0x80, 0x1a, 0x49, 0x7d, 0x44);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataImport\nDECLARE_INTERFACE_(IMetaDataImport, IUnknown)\n{\n    STDMETHOD_(void, CloseEnum)(HCORENUM hEnum) PURE;\n    STDMETHOD(CountEnum)(HCORENUM hEnum, ULONG *pulCount) PURE;\n    STDMETHOD(ResetEnum)(HCORENUM hEnum, ULONG ulPos) PURE;\n    STDMETHOD(EnumTypeDefs)(HCORENUM *phEnum, mdTypeDef rTypeDefs[],\n                            ULONG cMax, ULONG *pcTypeDefs) PURE;\n    STDMETHOD(EnumInterfaceImpls)(HCORENUM *phEnum, mdTypeDef td,\n                            mdInterfaceImpl rImpls[], ULONG cMax,\n                            ULONG* pcImpls) PURE;\n    STDMETHOD(EnumTypeRefs)(HCORENUM *phEnum, mdTypeRef rTypeRefs[],\n                            ULONG cMax, ULONG* pcTypeRefs) PURE;\n\n    STDMETHOD(FindTypeDefByName)(           // S_OK or error.\n        LPCWSTR     szTypeDef,              // [IN] Name of the Type.\n        mdToken     tkEnclosingClass,       // [IN] TypeDef/TypeRef for Enclosing class.\n        mdTypeDef   *ptd) PURE;             // [OUT] Put the TypeDef token here.\n\n    STDMETHOD(GetScopeProps)(               // S_OK or error.\n      _Out_writes_to_opt_(cchName, *pchName)\n        LPWSTR      szName,                 // [OUT] Put the name here.\n        ULONG       cchName,                // [IN] Size of name buffer in wide chars.\n        ULONG       *pchName,               // [OUT] Put size of name (wide chars) here.\n        GUID        *pmvid) PURE;           // [OUT, OPTIONAL] Put MVID here.\n\n    STDMETHOD(GetModuleFromScope)(          // S_OK.\n        mdModule    *pmd) PURE;             // [OUT] Put mdModule token here.\n\n    STDMETHOD(GetTypeDefProps)(             // S_OK or error.\n        mdTypeDef   td,                     // [IN] TypeDef token for inquiry.\n      _Out_writes_to_opt_(cchTypeDef, *pchTypeDef)\n        LPWSTR      szTypeDef,              // [OUT] Put name here.\n        ULONG       cchTypeDef,             // [IN] size of name buffer in wide chars.\n        ULONG       *pchTypeDef,            // [OUT] put size of name (wide chars) here.\n        DWORD       *pdwTypeDefFlags,       // [OUT] Put flags here.\n        mdToken     *ptkExtends) PURE;      // [OUT] Put base class TypeDef/TypeRef here.\n\n    STDMETHOD(GetInterfaceImplProps)(       // S_OK or error.\n        mdInterfaceImpl iiImpl,             // [IN] InterfaceImpl token.\n        mdTypeDef   *pClass,                // [OUT] Put implementing class token here.\n        mdToken     *ptkIface) PURE;        // [OUT] Put implemented interface token here.\n\n    STDMETHOD(GetTypeRefProps)(             // S_OK or error.\n        mdTypeRef   tr,                     // [IN] TypeRef token.\n        mdToken     *ptkResolutionScope,    // [OUT] Resolution scope, ModuleRef or AssemblyRef.\n      _Out_writes_to_opt_(cchName, *pchName)\n        LPWSTR      szName,                 // [OUT] Name of the TypeRef.\n        ULONG       cchName,                // [IN] Size of buffer.\n        ULONG       *pchName) PURE;         // [OUT] Size of Name.\n\n    STDMETHOD(ResolveTypeRef)(mdTypeRef tr, REFIID riid, IUnknown **ppIScope, mdTypeDef *ptd) PURE;\n\n    STDMETHOD(EnumMembers)(                 // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   cl,                     // [IN] TypeDef to scope the enumeration.\n        mdToken     rMembers[],             // [OUT] Put MemberDefs here.\n        ULONG       cMax,                   // [IN] Max MemberDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumMembersWithName)(         // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   cl,                     // [IN] TypeDef to scope the enumeration.\n        LPCWSTR     szName,                 // [IN] Limit results to those with this name.\n        mdToken     rMembers[],             // [OUT] Put MemberDefs here.\n        ULONG       cMax,                   // [IN] Max MemberDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumMethods)(                 // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   cl,                     // [IN] TypeDef to scope the enumeration.\n        mdMethodDef rMethods[],             // [OUT] Put MethodDefs here.\n        ULONG       cMax,                   // [IN] Max MethodDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumMethodsWithName)(         // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   cl,                     // [IN] TypeDef to scope the enumeration.\n        LPCWSTR     szName,                 // [IN] Limit results to those with this name.\n        mdMethodDef rMethods[],             // [OU] Put MethodDefs here.\n        ULONG       cMax,                   // [IN] Max MethodDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumFields)(                  // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   cl,                     // [IN] TypeDef to scope the enumeration.\n        mdFieldDef  rFields[],              // [OUT] Put FieldDefs here.\n        ULONG       cMax,                   // [IN] Max FieldDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumFieldsWithName)(          // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   cl,                     // [IN] TypeDef to scope the enumeration.\n        LPCWSTR     szName,                 // [IN] Limit results to those with this name.\n        mdFieldDef  rFields[],              // [OUT] Put MemberDefs here.\n        ULONG       cMax,                   // [IN] Max MemberDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n\n    STDMETHOD(EnumParams)(                  // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdMethodDef mb,                     // [IN] MethodDef to scope the enumeration.\n        mdParamDef  rParams[],              // [OUT] Put ParamDefs here.\n        ULONG       cMax,                   // [IN] Max ParamDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumMemberRefs)(              // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdToken     tkParent,               // [IN] Parent token to scope the enumeration.\n        mdMemberRef rMemberRefs[],          // [OUT] Put MemberRefs here.\n        ULONG       cMax,                   // [IN] Max MemberRefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumMethodImpls)(             // S_OK, S_FALSE, or error\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   td,                     // [IN] TypeDef to scope the enumeration.\n        mdToken     rMethodBody[],          // [OUT] Put Method Body tokens here.\n        mdToken     rMethodDecl[],          // [OUT] Put Method Declaration tokens here.\n        ULONG       cMax,                   // [IN] Max tokens to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumPermissionSets)(          // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdToken     tk,                     // [IN] if !NIL, token to scope the enumeration.\n        DWORD       dwActions,              // [IN] if !0, return only these actions.\n        mdPermission rPermission[],         // [OUT] Put Permissions here.\n        ULONG       cMax,                   // [IN] Max Permissions to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(FindMember)(\n        mdTypeDef   td,                     // [IN] given typedef\n        LPCWSTR     szName,                 // [IN] member name\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        mdToken     *pmb) PURE;             // [OUT] matching memberdef\n\n    STDMETHOD(FindMethod)(\n        mdTypeDef   td,                     // [IN] given typedef\n        LPCWSTR     szName,                 // [IN] member name\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        mdMethodDef *pmb) PURE;             // [OUT] matching memberdef\n\n    STDMETHOD(FindField)(\n        mdTypeDef   td,                     // [IN] given typedef\n        LPCWSTR     szName,                 // [IN] member name\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        mdFieldDef  *pmb) PURE;             // [OUT] matching memberdef\n\n    STDMETHOD(FindMemberRef)(\n        mdTypeRef   td,                     // [IN] given typeRef\n        LPCWSTR     szName,                 // [IN] member name\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        mdMemberRef *pmr) PURE;             // [OUT] matching memberref\n\n    STDMETHOD (GetMethodProps)(\n        mdMethodDef mb,                     // The method for which to get props.\n        mdTypeDef   *pClass,                // Put method's class here.\n      _Out_writes_to_opt_(cchMethod, *pchMethod)\n        LPWSTR      szMethod,               // Put method's name here.\n        ULONG       cchMethod,              // Size of szMethod buffer in wide chars.\n        ULONG       *pchMethod,             // Put actual size here\n        DWORD       *pdwAttr,               // Put flags here.\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to the blob value of meta data\n        ULONG       *pcbSigBlob,            // [OUT] actual size of signature blob\n        ULONG       *pulCodeRVA,            // [OUT] codeRVA\n        DWORD       *pdwImplFlags) PURE;    // [OUT] Impl. Flags\n\n    STDMETHOD(GetMemberRefProps)(           // S_OK or error.\n        mdMemberRef mr,                     // [IN] given memberref\n        mdToken     *ptk,                   // [OUT] Put classref or classdef here.\n      _Out_writes_to_opt_(cchMember, *pchMember)\n        LPWSTR      szMember,               // [OUT] buffer to fill for member's name\n        ULONG       cchMember,              // [IN] the count of char of szMember\n        ULONG       *pchMember,             // [OUT] actual count of char in member name\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to meta data blob value\n        ULONG       *pbSig) PURE;           // [OUT] actual size of signature blob\n\n    STDMETHOD(EnumProperties)(              // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   td,                     // [IN] TypeDef to scope the enumeration.\n        mdProperty  rProperties[],          // [OUT] Put Properties here.\n        ULONG       cMax,                   // [IN] Max properties to put.\n        ULONG       *pcProperties) PURE;    // [OUT] Put # put here.\n\n    STDMETHOD(EnumEvents)(                  // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdTypeDef   td,                     // [IN] TypeDef to scope the enumeration.\n        mdEvent     rEvents[],              // [OUT] Put events here.\n        ULONG       cMax,                   // [IN] Max events to put.\n        ULONG       *pcEvents) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(GetEventProps)(               // S_OK, S_FALSE, or error.\n        mdEvent     ev,                     // [IN] event token\n        mdTypeDef   *pClass,                // [OUT] typedef containing the event declarion.\n        LPCWSTR     szEvent,                // [OUT] Event name\n        ULONG       cchEvent,               // [IN] the count of wchar of szEvent\n        ULONG       *pchEvent,              // [OUT] actual count of wchar for event's name\n        DWORD       *pdwEventFlags,         // [OUT] Event flags.\n        mdToken     *ptkEventType,          // [OUT] EventType class\n        mdMethodDef *pmdAddOn,              // [OUT] AddOn method of the event\n        mdMethodDef *pmdRemoveOn,           // [OUT] RemoveOn method of the event\n        mdMethodDef *pmdFire,               // [OUT] Fire method of the event\n        mdMethodDef rmdOtherMethod[],       // [OUT] other method of the event\n        ULONG       cMax,                   // [IN] size of rmdOtherMethod\n        ULONG       *pcOtherMethod) PURE;   // [OUT] total number of other method of this event\n\n    STDMETHOD(EnumMethodSemantics)(         // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdMethodDef mb,                     // [IN] MethodDef to scope the enumeration.\n        mdToken     rEventProp[],           // [OUT] Put Event/Property here.\n        ULONG       cMax,                   // [IN] Max properties to put.\n        ULONG       *pcEventProp) PURE;     // [OUT] Put # put here.\n\n    STDMETHOD(GetMethodSemantics)(          // S_OK, S_FALSE, or error.\n        mdMethodDef mb,                     // [IN] method token\n        mdToken     tkEventProp,            // [IN] event/property token.\n        DWORD       *pdwSemanticsFlags) PURE; // [OUT] the role flags for the method/propevent pair\n\n    STDMETHOD(GetClassLayout) (\n        mdTypeDef   td,                     // [IN] give typedef\n        DWORD       *pdwPackSize,           // [OUT] 1, 2, 4, 8, or 16\n        COR_FIELD_OFFSET rFieldOffset[],    // [OUT] field offset array\n        ULONG       cMax,                   // [IN] size of the array\n        ULONG       *pcFieldOffset,         // [OUT] needed array size\n        ULONG       *pulClassSize) PURE;        // [OUT] the size of the class\n\n    STDMETHOD(GetFieldMarshal) (\n        mdToken     tk,                     // [IN] given a field's memberdef\n        PCCOR_SIGNATURE *ppvNativeType,     // [OUT] native type of this field\n        ULONG       *pcbNativeType) PURE;   // [OUT] the count of bytes of *ppvNativeType\n\n    STDMETHOD(GetRVA)(                      // S_OK or error.\n        mdToken     tk,                     // Member for which to set offset\n        ULONG       *pulCodeRVA,            // The offset\n        DWORD       *pdwImplFlags) PURE;    // the implementation flags\n\n    STDMETHOD(GetPermissionSetProps) (\n        mdPermission pm,                    // [IN] the permission token.\n        DWORD       *pdwAction,             // [OUT] CorDeclSecurity.\n        void const  **ppvPermission,        // [OUT] permission blob.\n        ULONG       *pcbPermission) PURE;   // [OUT] count of bytes of pvPermission.\n\n    STDMETHOD(GetSigFromToken)(             // S_OK or error.\n        mdSignature mdSig,                  // [IN] Signature token.\n        PCCOR_SIGNATURE *ppvSig,            // [OUT] return pointer to token.\n        ULONG       *pcbSig) PURE;          // [OUT] return size of signature.\n\n    STDMETHOD(GetModuleRefProps)(           // S_OK or error.\n        mdModuleRef mur,                    // [IN] moduleref token.\n      _Out_writes_to_opt_(cchName, *pchName)\n        LPWSTR      szName,                 // [OUT] buffer to fill with the moduleref name.\n        ULONG       cchName,                // [IN] size of szName in wide characters.\n        ULONG       *pchName) PURE;         // [OUT] actual count of characters in the name.\n\n    STDMETHOD(EnumModuleRefs)(              // S_OK or error.\n        HCORENUM    *phEnum,                // [IN|OUT] pointer to the enum.\n        mdModuleRef rModuleRefs[],          // [OUT] put modulerefs here.\n        ULONG       cmax,                   // [IN] max memberrefs to put.\n        ULONG       *pcModuleRefs) PURE;    // [OUT] put # put here.\n\n    STDMETHOD(GetTypeSpecFromToken)(        // S_OK or error.\n        mdTypeSpec typespec,                // [IN] TypeSpec token.\n        PCCOR_SIGNATURE *ppvSig,            // [OUT] return pointer to TypeSpec signature\n        ULONG       *pcbSig) PURE;          // [OUT] return size of signature.\n\n    STDMETHOD(GetNameFromToken)(            // Not Recommended! May be removed!\n        mdToken     tk,                     // [IN] Token to get name from.  Must have a name.\n        MDUTF8CSTR  *pszUtf8NamePtr) PURE;  // [OUT] Return pointer to UTF8 name in heap.\n\n    STDMETHOD(EnumUnresolvedMethods)(       // S_OK, S_FALSE, or error.\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdToken     rMethods[],             // [OUT] Put MemberDefs here.\n        ULONG       cMax,                   // [IN] Max MemberDefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(GetUserString)(               // S_OK or error.\n        mdString    stk,                    // [IN] String token.\n      _Out_writes_to_opt_(cchString, *pchString)\n        LPWSTR      szString,               // [OUT] Copy of string.\n        ULONG       cchString,              // [IN] Max chars of room in szString.\n        ULONG       *pchString) PURE;       // [OUT] How many chars in actual string.\n\n    STDMETHOD(GetPinvokeMap)(               // S_OK or error.\n        mdToken     tk,                     // [IN] FieldDef or MethodDef.\n        DWORD       *pdwMappingFlags,       // [OUT] Flags used for mapping.\n      _Out_writes_to_opt_(cchImportName, *pchImportName)\n        LPWSTR      szImportName,           // [OUT] Import name.\n        ULONG       cchImportName,          // [IN] Size of the name buffer.\n        ULONG       *pchImportName,         // [OUT] Actual number of characters stored.\n        mdModuleRef *pmrImportDLL) PURE;    // [OUT] ModuleRef token for the target DLL.\n\n    STDMETHOD(EnumSignatures)(              // S_OK or error.\n        HCORENUM    *phEnum,                // [IN|OUT] pointer to the enum.\n        mdSignature rSignatures[],          // [OUT] put signatures here.\n        ULONG       cmax,                   // [IN] max signatures to put.\n        ULONG       *pcSignatures) PURE;    // [OUT] put # put here.\n\n    STDMETHOD(EnumTypeSpecs)(               // S_OK or error.\n        HCORENUM    *phEnum,                // [IN|OUT] pointer to the enum.\n        mdTypeSpec  rTypeSpecs[],           // [OUT] put TypeSpecs here.\n        ULONG       cmax,                   // [IN] max TypeSpecs to put.\n        ULONG       *pcTypeSpecs) PURE;     // [OUT] put # put here.\n\n    STDMETHOD(EnumUserStrings)(             // S_OK or error.\n        HCORENUM    *phEnum,                // [IN/OUT] pointer to the enum.\n        mdString    rStrings[],             // [OUT] put Strings here.\n        ULONG       cmax,                   // [IN] max Strings to put.\n        ULONG       *pcStrings) PURE;       // [OUT] put # put here.\n\n    STDMETHOD(GetParamForMethodIndex)(      // S_OK or error.\n        mdMethodDef md,                     // [IN] Method token.\n        ULONG       ulParamSeq,             // [IN] Parameter sequence.\n        mdParamDef  *ppd) PURE;             // [IN] Put Param token here.\n\n    STDMETHOD(EnumCustomAttributes)(        // S_OK or error.\n        HCORENUM    *phEnum,                // [IN, OUT] COR enumerator.\n        mdToken     tk,                     // [IN] Token to scope the enumeration, 0 for all.\n        mdToken     tkType,                 // [IN] Type of interest, 0 for all.\n        mdCustomAttribute rCustomAttributes[], // [OUT] Put custom attribute tokens here.\n        ULONG       cMax,                   // [IN] Size of rCustomAttributes.\n        ULONG       *pcCustomAttributes) PURE;  // [OUT, OPTIONAL] Put count of token values here.\n\n    STDMETHOD(GetCustomAttributeProps)(     // S_OK or error.\n        mdCustomAttribute cv,               // [IN] CustomAttribute token.\n        mdToken     *ptkObj,                // [OUT, OPTIONAL] Put object token here.\n        mdToken     *ptkType,               // [OUT, OPTIONAL] Put AttrType token here.\n        void const  **ppBlob,               // [OUT, OPTIONAL] Put pointer to data here.\n        ULONG       *pcbSize) PURE;         // [OUT, OPTIONAL] Put size of date here.\n\n    STDMETHOD(FindTypeRef)(\n        mdToken     tkResolutionScope,      // [IN] ModuleRef, AssemblyRef or TypeRef.\n        LPCWSTR     szName,                 // [IN] TypeRef Name.\n        mdTypeRef   *ptr) PURE;             // [OUT] matching TypeRef.\n\n    STDMETHOD(GetMemberProps)(\n        mdToken     mb,                     // The member for which to get props.\n        mdTypeDef   *pClass,                // Put member's class here.\n      _Out_writes_to_opt_(cchMember, *pchMember)\n        LPWSTR      szMember,               // Put member's name here.\n        ULONG       cchMember,              // Size of szMember buffer in wide chars.\n        ULONG       *pchMember,             // Put actual size here\n        DWORD       *pdwAttr,               // Put flags here.\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to the blob value of meta data\n        ULONG       *pcbSigBlob,            // [OUT] actual size of signature blob\n        ULONG       *pulCodeRVA,            // [OUT] codeRVA\n        DWORD       *pdwImplFlags,          // [OUT] Impl. Flags\n        DWORD       *pdwCPlusTypeFlag,      // [OUT] flag for value type. selected ELEMENT_TYPE_*\n        UVCP_CONSTANT *ppValue,             // [OUT] constant value\n        ULONG       *pcchValue) PURE;       // [OUT] size of constant string in chars, 0 for non-strings.\n\n    STDMETHOD(GetFieldProps)(\n        mdFieldDef  mb,                     // The field for which to get props.\n        mdTypeDef   *pClass,                // Put field's class here.\n      _Out_writes_to_opt_(cchField, *pchField)\n        LPWSTR      szField,                // Put field's name here.\n        ULONG       cchField,               // Size of szField buffer in wide chars.\n        ULONG       *pchField,              // Put actual size here\n        DWORD       *pdwAttr,               // Put flags here.\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to the blob value of meta data\n        ULONG       *pcbSigBlob,            // [OUT] actual size of signature blob\n        DWORD       *pdwCPlusTypeFlag,      // [OUT] flag for value type. selected ELEMENT_TYPE_*\n        UVCP_CONSTANT *ppValue,             // [OUT] constant value\n        ULONG       *pcchValue) PURE;       // [OUT] size of constant string in chars, 0 for non-strings.\n\n    STDMETHOD(GetPropertyProps)(            // S_OK, S_FALSE, or error.\n        mdProperty  prop,                   // [IN] property token\n        mdTypeDef   *pClass,                // [OUT] typedef containing the property declarion.\n        LPCWSTR     szProperty,             // [OUT] Property name\n        ULONG       cchProperty,            // [IN] the count of wchar of szProperty\n        ULONG       *pchProperty,           // [OUT] actual count of wchar for property name\n        DWORD       *pdwPropFlags,          // [OUT] property flags.\n        PCCOR_SIGNATURE *ppvSig,            // [OUT] property type. pointing to meta data internal blob\n        ULONG       *pbSig,                 // [OUT] count of bytes in *ppvSig\n        DWORD       *pdwCPlusTypeFlag,      // [OUT] flag for value type. selected ELEMENT_TYPE_*\n        UVCP_CONSTANT *ppDefaultValue,      // [OUT] constant value\n        ULONG       *pcchDefaultValue,      // [OUT] size of constant string in chars, 0 for non-strings.\n        mdMethodDef *pmdSetter,             // [OUT] setter method of the property\n        mdMethodDef *pmdGetter,             // [OUT] getter method of the property\n        mdMethodDef rmdOtherMethod[],       // [OUT] other method of the property\n        ULONG       cMax,                   // [IN] size of rmdOtherMethod\n        ULONG       *pcOtherMethod) PURE;   // [OUT] total number of other method of this property\n\n    STDMETHOD(GetParamProps)(               // S_OK or error.\n        mdParamDef  tk,                     // [IN]The Parameter.\n        mdMethodDef *pmd,                   // [OUT] Parent Method token.\n        ULONG       *pulSequence,           // [OUT] Parameter sequence.\n      _Out_writes_to_opt_(cchName, *pchName)\n        LPWSTR      szName,                 // [OUT] Put name here.\n        ULONG       cchName,                // [OUT] Size of name buffer.\n        ULONG       *pchName,               // [OUT] Put actual size of name here.\n        DWORD       *pdwAttr,               // [OUT] Put flags here.\n        DWORD       *pdwCPlusTypeFlag,      // [OUT] Flag for value type. selected ELEMENT_TYPE_*.\n        UVCP_CONSTANT *ppValue,             // [OUT] Constant value.\n        ULONG       *pcchValue) PURE;       // [OUT] size of constant string in chars, 0 for non-strings.\n\n    STDMETHOD(GetCustomAttributeByName)(    // S_OK or error.\n        mdToken     tkObj,                  // [IN] Object with Custom Attribute.\n        LPCWSTR     szName,                 // [IN] Name of desired Custom Attribute.\n        const void  **ppData,               // [OUT] Put pointer to data here.\n        ULONG       *pcbData) PURE;         // [OUT] Put size of data here.\n\n    STDMETHOD_(BOOL, IsValidToken)(         // True or False.\n        mdToken     tk) PURE;               // [IN] Given token.\n\n    STDMETHOD(GetNestedClassProps)(         // S_OK or error.\n        mdTypeDef   tdNestedClass,          // [IN] NestedClass token.\n        mdTypeDef   *ptdEnclosingClass) PURE; // [OUT] EnclosingClass token.\n\n    STDMETHOD(GetNativeCallConvFromSig)(    // S_OK or error.\n        void const  *pvSig,                 // [IN] Pointer to signature.\n        ULONG       cbSig,                  // [IN] Count of signature bytes.\n        ULONG       *pCallConv) PURE;       // [OUT] Put calling conv here (see CorPinvokemap).\n\n    STDMETHOD(IsGlobal)(                    // S_OK or error.\n        mdToken     pd,                     // [IN] Type, Field, or Method token.\n        int         *pbGlobal) PURE;        // [OUT] Put 1 if global, 0 otherwise.\n\n    // This interface is sealed.  Do not change, add, or remove anything.  Instead, derive a new iterface.\n\n};      // IMetaDataImport\n\n//-------------------------------------\n//--- IMetaDataImport2\n//-------------------------------------\n// {FCE5EFA0-8BBA-4f8e-A036-8F2022B08466}\nEXTERN_GUID(IID_IMetaDataImport2, 0xfce5efa0, 0x8bba, 0x4f8e, 0xa0, 0x36, 0x8f, 0x20, 0x22, 0xb0, 0x84, 0x66);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataImport2\nDECLARE_INTERFACE_(IMetaDataImport2, IMetaDataImport)\n{\n    STDMETHOD(EnumGenericParams)(\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdToken      tk,                    // [IN] TypeDef or MethodDef whose generic parameters are requested\n        mdGenericParam rGenericParams[],    // [OUT] Put GenericParams here.\n        ULONG       cMax,                   // [IN] Max GenericParams to put.\n        ULONG       *pcGenericParams) PURE; // [OUT] Put # put here.\n\n    STDMETHOD(GetGenericParamProps)(        // S_OK or error.\n        mdGenericParam gp,                  // [IN] GenericParam\n        ULONG        *pulParamSeq,          // [OUT] Index of the type parameter\n        DWORD        *pdwParamFlags,        // [OUT] Flags, for future use (e.g. variance)\n        mdToken      *ptOwner,              // [OUT] Owner (TypeDef or MethodDef)\n        DWORD       *reserved,              // [OUT] For future use (e.g. non-type parameters)\n      _Out_writes_to_opt_(cchName, *pchName)\n        LPWSTR       wzname,                // [OUT] Put name here\n        ULONG        cchName,               // [IN] Size of buffer\n        ULONG        *pchName) PURE;        // [OUT] Put size of name (wide chars) here.\n\n    STDMETHOD(GetMethodSpecProps)(\n        mdMethodSpec mi,                    // [IN] The method instantiation\n        mdToken *tkParent,                  // [OUT] MethodDef or MemberRef\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to the blob value of meta data\n        ULONG       *pcbSigBlob) PURE;      // [OUT] actual size of signature blob\n\n    STDMETHOD(EnumGenericParamConstraints)(\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdGenericParam tk,                  // [IN] GenericParam whose constraints are requested\n        mdGenericParamConstraint rGenericParamConstraints[],    // [OUT] Put GenericParamConstraints here.\n        ULONG       cMax,                   // [IN] Max GenericParamConstraints to put.\n        ULONG       *pcGenericParamConstraints) PURE; // [OUT] Put # put here.\n\n    STDMETHOD(GetGenericParamConstraintProps)( // S_OK or error.\n        mdGenericParamConstraint gpc,       // [IN] GenericParamConstraint\n        mdGenericParam *ptGenericParam,     // [OUT] GenericParam that is constrained\n        mdToken      *ptkConstraintType) PURE; // [OUT] TypeDef/Ref/Spec constraint\n\n    STDMETHOD(GetPEKind)(                   // S_OK or error.\n        DWORD* pdwPEKind,                   // [OUT] The kind of PE (0 - not a PE)\n        DWORD* pdwMAchine) PURE;            // [OUT] Machine as defined in NT header\n\n    STDMETHOD(GetVersionString)(            // S_OK or error.\n      _Out_writes_to_opt_(ccBufSize, *pccBufSize)\n        LPWSTR      pwzBuf,                 // [OUT] Put version string here.\n        DWORD       ccBufSize,              // [IN] size of the buffer, in wide chars\n        DWORD       *pccBufSize) PURE;      // [OUT] Size of the version string, wide chars, including terminating nul.\n\n    STDMETHOD(EnumMethodSpecs)(\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdToken      tk,                    // [IN] MethodDef or MemberRef whose MethodSpecs are requested\n        mdMethodSpec rMethodSpecs[],        // [OUT] Put MethodSpecs here.\n        ULONG       cMax,                   // [IN] Max tokens to put.\n        ULONG       *pcMethodSpecs) PURE;   // [OUT] Put actual count here.\n\n}; // IMetaDataImport2\n\n//-------------------------------------\n//--- IMetaDataFilter\n//-------------------------------------\n// {D0E80DD1-12D4-11d3-B39D-00C04FF81795}\nEXTERN_GUID(IID_IMetaDataFilter, 0xd0e80dd1, 0x12d4, 0x11d3, 0xb3, 0x9d, 0x0, 0xc0, 0x4f, 0xf8, 0x17, 0x95);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataFilter\nDECLARE_INTERFACE_(IMetaDataFilter, IUnknown)\n{\n    STDMETHOD(UnmarkAll)() PURE;\n    STDMETHOD(MarkToken)(mdToken tk) PURE;\n    STDMETHOD(IsTokenMarked)(mdToken tk, BOOL *pIsMarked) PURE;\n};\n\n\n//-------------------------------------\n//--- IHostFilter\n//-------------------------------------\n// {D0E80DD3-12D4-11d3-B39D-00C04FF81795}\nEXTERN_GUID(IID_IHostFilter, 0xd0e80dd3, 0x12d4, 0x11d3, 0xb3, 0x9d, 0x0, 0xc0, 0x4f, 0xf8, 0x17, 0x95);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IHostFilter\nDECLARE_INTERFACE_(IHostFilter, IUnknown)\n{\n    STDMETHOD(MarkToken)(mdToken tk) PURE;\n};\n\n\n//*****************************************************************************\n// Assembly Declarations\n//*****************************************************************************\n\ntypedef struct\n{\n    DWORD       dwOSPlatformId;         // Operating system platform.\n    DWORD       dwOSMajorVersion;       // OS Major version.\n    DWORD       dwOSMinorVersion;       // OS Minor version.\n} OSINFO;\n\n\ntypedef struct\n{\n    USHORT      usMajorVersion;         // Major Version.\n    USHORT      usMinorVersion;         // Minor Version.\n    USHORT      usBuildNumber;          // Build Number.\n    USHORT      usRevisionNumber;       // Revision Number.\n    LPWSTR      szLocale;               // Locale.\n    ULONG       cbLocale;               // [IN/OUT] Size of the buffer in wide chars/Actual size.\n    DWORD       *rProcessor;            // Processor ID array.\n    ULONG       ulProcessor;            // [IN/OUT] Size of the Processor ID array/Actual # of entries filled in.\n    OSINFO      *rOS;                   // OSINFO array.\n    ULONG       ulOS;                   // [IN/OUT]Size of the OSINFO array/Actual # of entries filled in.\n} ASSEMBLYMETADATA;\n\n\n// {211EF15B-5317-4438-B196-DEC87B887693}\nEXTERN_GUID(IID_IMetaDataAssemblyEmit, 0x211ef15b, 0x5317, 0x4438, 0xb1, 0x96, 0xde, 0xc8, 0x7b, 0x88, 0x76, 0x93);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataAssemblyEmit\nDECLARE_INTERFACE_(IMetaDataAssemblyEmit, IUnknown)\n{\n    STDMETHOD(DefineAssembly)(              // S_OK or error.\n        const void  *pbPublicKey,           // [IN] Public key of the assembly.\n        ULONG       cbPublicKey,            // [IN] Count of bytes in the public key.\n        ULONG       ulHashAlgId,            // [IN] Hash algorithm used to hash the files.\n        LPCWSTR     szName,                 // [IN] Name of the assembly.\n        const ASSEMBLYMETADATA *pMetaData,  // [IN] Assembly MetaData.\n        DWORD       dwAssemblyFlags,        // [IN] Flags.\n        mdAssembly  *pma) PURE;             // [OUT] Returned Assembly token.\n\n    STDMETHOD(DefineAssemblyRef)(           // S_OK or error.\n        const void  *pbPublicKeyOrToken,    // [IN] Public key or token of the assembly.\n        ULONG       cbPublicKeyOrToken,     // [IN] Count of bytes in the public key or token.\n        LPCWSTR     szName,                 // [IN] Name of the assembly being referenced.\n        const ASSEMBLYMETADATA *pMetaData,  // [IN] Assembly MetaData.\n        const void  *pbHashValue,           // [IN] Hash Blob.\n        ULONG       cbHashValue,            // [IN] Count of bytes in the Hash Blob.\n        DWORD       dwAssemblyRefFlags,     // [IN] Flags.\n        mdAssemblyRef *pmdar) PURE;         // [OUT] Returned AssemblyRef token.\n\n    STDMETHOD(DefineFile)(                  // S_OK or error.\n        LPCWSTR     szName,                 // [IN] Name of the file.\n        const void  *pbHashValue,           // [IN] Hash Blob.\n        ULONG       cbHashValue,            // [IN] Count of bytes in the Hash Blob.\n        DWORD       dwFileFlags,            // [IN] Flags.\n        mdFile      *pmdf) PURE;            // [OUT] Returned File token.\n\n    STDMETHOD(DefineExportedType)(          // S_OK or error.\n        LPCWSTR     szName,                 // [IN] Name of the Com Type.\n        mdToken     tkImplementation,       // [IN] mdFile or mdAssemblyRef or mdExportedType\n        mdTypeDef   tkTypeDef,              // [IN] TypeDef token within the file.\n        DWORD       dwExportedTypeFlags,    // [IN] Flags.\n        mdExportedType   *pmdct) PURE;      // [OUT] Returned ExportedType token.\n\n    STDMETHOD(DefineManifestResource)(      // S_OK or error.\n        LPCWSTR     szName,                 // [IN] Name of the resource.\n        mdToken     tkImplementation,       // [IN] mdFile or mdAssemblyRef that provides the resource.\n        DWORD       dwOffset,               // [IN] Offset to the beginning of the resource within the file.\n        DWORD       dwResourceFlags,        // [IN] Flags.\n        mdManifestResource  *pmdmr) PURE;   // [OUT] Returned ManifestResource token.\n\n    STDMETHOD(SetAssemblyProps)(            // S_OK or error.\n        mdAssembly  pma,                    // [IN] Assembly token.\n        const void  *pbPublicKey,           // [IN] Public key of the assembly.\n        ULONG       cbPublicKey,            // [IN] Count of bytes in the public key.\n        ULONG       ulHashAlgId,            // [IN] Hash algorithm used to hash the files.\n        LPCWSTR     szName,                 // [IN] Name of the assembly.\n        const ASSEMBLYMETADATA *pMetaData,  // [IN] Assembly MetaData.\n        DWORD       dwAssemblyFlags) PURE;  // [IN] Flags.\n\n    STDMETHOD(SetAssemblyRefProps)(         // S_OK or error.\n        mdAssemblyRef ar,                   // [IN] AssemblyRefToken.\n        const void  *pbPublicKeyOrToken,    // [IN] Public key or token of the assembly.\n        ULONG       cbPublicKeyOrToken,     // [IN] Count of bytes in the public key or token.\n        LPCWSTR     szName,                 // [IN] Name of the assembly being referenced.\n        const ASSEMBLYMETADATA *pMetaData,  // [IN] Assembly MetaData.\n        const void  *pbHashValue,           // [IN] Hash Blob.\n        ULONG       cbHashValue,            // [IN] Count of bytes in the Hash Blob.\n        DWORD       dwAssemblyRefFlags) PURE; // [IN] Token for Execution Location.\n\n    STDMETHOD(SetFileProps)(                // S_OK or error.\n        mdFile      file,                   // [IN] File token.\n        const void  *pbHashValue,           // [IN] Hash Blob.\n        ULONG       cbHashValue,            // [IN] Count of bytes in the Hash Blob.\n        DWORD       dwFileFlags) PURE;      // [IN] Flags.\n\n    STDMETHOD(SetExportedTypeProps)(        // S_OK or error.\n        mdExportedType   ct,                // [IN] ExportedType token.\n        mdToken     tkImplementation,       // [IN] mdFile or mdAssemblyRef or mdExportedType.\n        mdTypeDef   tkTypeDef,              // [IN] TypeDef token within the file.\n        DWORD       dwExportedTypeFlags) PURE;   // [IN] Flags.\n\n    STDMETHOD(SetManifestResourceProps)(    // S_OK or error.\n        mdManifestResource  mr,             // [IN] ManifestResource token.\n        mdToken     tkImplementation,       // [IN] mdFile or mdAssemblyRef that provides the resource.\n        DWORD       dwOffset,               // [IN] Offset to the beginning of the resource within the file.\n        DWORD       dwResourceFlags) PURE;  // [IN] Flags.\n\n};  // IMetaDataAssemblyEmit\n\n\n// {EE62470B-E94B-424e-9B7C-2F00C9249F93}\nEXTERN_GUID(IID_IMetaDataAssemblyImport, 0xee62470b, 0xe94b, 0x424e, 0x9b, 0x7c, 0x2f, 0x0, 0xc9, 0x24, 0x9f, 0x93);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataAssemblyImport\nDECLARE_INTERFACE_(IMetaDataAssemblyImport, IUnknown)\n{\n    STDMETHOD(GetAssemblyProps)(            // S_OK or error.\n        mdAssembly  mda,                    // [IN] The Assembly for which to get the properties.\n        const void  **ppbPublicKey,         // [OUT] Pointer to the public key.\n        ULONG       *pcbPublicKey,          // [OUT] Count of bytes in the public key.\n        ULONG       *pulHashAlgId,          // [OUT] Hash Algorithm.\n        _Out_writes_to_opt_(cchName, *pchName) LPWSTR  szName, // [OUT] Buffer to fill with assembly's simply name.\n        ULONG       cchName,                // [IN] Size of buffer in wide chars.\n        ULONG       *pchName,               // [OUT] Actual # of wide chars in name.\n        ASSEMBLYMETADATA *pMetaData,        // [OUT] Assembly MetaData.\n        DWORD       *pdwAssemblyFlags) PURE;    // [OUT] Flags.\n\n    STDMETHOD(GetAssemblyRefProps)(         // S_OK or error.\n        mdAssemblyRef mdar,                 // [IN] The AssemblyRef for which to get the properties.\n        const void  **ppbPublicKeyOrToken,  // [OUT] Pointer to the public key or token.\n        ULONG       *pcbPublicKeyOrToken,   // [OUT] Count of bytes in the public key or token.\n        _Out_writes_to_opt_(cchName, *pchName)LPWSTR szName, // [OUT] Buffer to fill with name.\n        ULONG       cchName,                // [IN] Size of buffer in wide chars.\n        ULONG       *pchName,               // [OUT] Actual # of wide chars in name.\n        ASSEMBLYMETADATA *pMetaData,        // [OUT] Assembly MetaData.\n        const void  **ppbHashValue,         // [OUT] Hash blob.\n        ULONG       *pcbHashValue,          // [OUT] Count of bytes in the hash blob.\n        DWORD       *pdwAssemblyRefFlags) PURE; // [OUT] Flags.\n\n    STDMETHOD(GetFileProps)(                // S_OK or error.\n        mdFile      mdf,                    // [IN] The File for which to get the properties.\n        _Out_writes_to_opt_(cchName, *pchName) LPWSTR      szName, // [OUT] Buffer to fill with name.\n        ULONG       cchName,                // [IN] Size of buffer in wide chars.\n        ULONG       *pchName,               // [OUT] Actual # of wide chars in name.\n        const void  **ppbHashValue,         // [OUT] Pointer to the Hash Value Blob.\n        ULONG       *pcbHashValue,          // [OUT] Count of bytes in the Hash Value Blob.\n        DWORD       *pdwFileFlags) PURE;    // [OUT] Flags.\n\n    STDMETHOD(GetExportedTypeProps)(        // S_OK or error.\n        mdExportedType   mdct,              // [IN] The ExportedType for which to get the properties.\n        _Out_writes_to_opt_(cchName, *pchName) LPWSTR      szName, // [OUT] Buffer to fill with name.\n        ULONG       cchName,                // [IN] Size of buffer in wide chars.\n        ULONG       *pchName,               // [OUT] Actual # of wide chars in name.\n        mdToken     *ptkImplementation,     // [OUT] mdFile or mdAssemblyRef or mdExportedType.\n        mdTypeDef   *ptkTypeDef,            // [OUT] TypeDef token within the file.\n        DWORD       *pdwExportedTypeFlags) PURE; // [OUT] Flags.\n\n    STDMETHOD(GetManifestResourceProps)(    // S_OK or error.\n        mdManifestResource  mdmr,           // [IN] The ManifestResource for which to get the properties.\n        _Out_writes_to_opt_(cchName, *pchName)LPWSTR      szName,  // [OUT] Buffer to fill with name.\n        ULONG       cchName,                // [IN] Size of buffer in wide chars.\n        ULONG       *pchName,               // [OUT] Actual # of wide chars in name.\n        mdToken     *ptkImplementation,     // [OUT] mdFile or mdAssemblyRef that provides the ManifestResource.\n        DWORD       *pdwOffset,             // [OUT] Offset to the beginning of the resource within the file.\n        DWORD       *pdwResourceFlags) PURE;// [OUT] Flags.\n\n    STDMETHOD(EnumAssemblyRefs)(            // S_OK or error\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdAssemblyRef rAssemblyRefs[],      // [OUT] Put AssemblyRefs here.\n        ULONG       cMax,                   // [IN] Max AssemblyRefs to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumFiles)(                   // S_OK or error\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdFile      rFiles[],               // [OUT] Put Files here.\n        ULONG       cMax,                   // [IN] Max Files to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumExportedTypes)(           // S_OK or error\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdExportedType   rExportedTypes[],  // [OUT] Put ExportedTypes here.\n        ULONG       cMax,                   // [IN] Max ExportedTypes to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(EnumManifestResources)(       // S_OK or error\n        HCORENUM    *phEnum,                // [IN|OUT] Pointer to the enum.\n        mdManifestResource  rManifestResources[],   // [OUT] Put ManifestResources here.\n        ULONG       cMax,                   // [IN] Max Resources to put.\n        ULONG       *pcTokens) PURE;        // [OUT] Put # put here.\n\n    STDMETHOD(GetAssemblyFromScope)(        // S_OK or error\n        mdAssembly  *ptkAssembly) PURE;     // [OUT] Put token here.\n\n    STDMETHOD(FindExportedTypeByName)(      // S_OK or error\n        LPCWSTR     szName,                 // [IN] Name of the ExportedType.\n        mdToken     mdtExportedType,        // [IN] ExportedType for the enclosing class.\n        mdExportedType   *ptkExportedType) PURE; // [OUT] Put the ExportedType token here.\n\n    STDMETHOD(FindManifestResourceByName)(  // S_OK or error\n        LPCWSTR     szName,                 // [IN] Name of the ManifestResource.\n        mdManifestResource *ptkManifestResource) PURE;  // [OUT] Put the ManifestResource token here.\n\n    STDMETHOD_(void, CloseEnum)(\n        HCORENUM hEnum) PURE;               // Enum to be closed.\n\n    STDMETHOD(FindAssembliesByName)(        // S_OK or error\n        LPCWSTR  szAppBase,                 // [IN] optional - can be NULL\n        LPCWSTR  szPrivateBin,              // [IN] optional - can be NULL\n        LPCWSTR  szAssemblyName,            // [IN] required - this is the assembly you are requesting\n        IUnknown *ppIUnk[],                 // [OUT] put IMetaDataAssemblyImport pointers here\n        ULONG    cMax,                      // [IN] The max number to put\n        ULONG    *pcAssemblies) PURE;       // [OUT] The number of assemblies returned.\n};  // IMetaDataAssemblyImport\n\n\n//*****************************************************************************\n// End Assembly Declarations\n//*****************************************************************************\n\n//*****************************************************************************\n// MetaData Validator Declarations\n//*****************************************************************************\n\n// Specifies the type of the module, PE file vs. .obj file.\ntypedef enum\n{\n    ValidatorModuleTypeInvalid      = 0x0,\n    ValidatorModuleTypeMin          = 0x00000001,\n    ValidatorModuleTypePE           = 0x00000001,\n    ValidatorModuleTypeObj          = 0x00000002,\n    ValidatorModuleTypeEnc          = 0x00000003,\n    ValidatorModuleTypeIncr         = 0x00000004,\n    ValidatorModuleTypeMax          = 0x00000004,\n} CorValidatorModuleType;\n\n\n// {4709C9C6-81FF-11D3-9FC7-00C04F79A0A3}\nEXTERN_GUID(IID_IMetaDataValidate, 0x4709c9c6, 0x81ff, 0x11d3, 0x9f, 0xc7, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataValidate\nDECLARE_INTERFACE_(IMetaDataValidate, IUnknown)\n{\n    STDMETHOD(ValidatorInit)(               // S_OK or error.\n        DWORD       dwModuleType,           // [IN] Specifies the type of the module.\n        IUnknown    *pUnk) PURE;            // [IN] Validation error handler.\n\n    STDMETHOD(ValidateMetaData)(            // S_OK or error.\n        ) PURE;\n};  // IMetaDataValidate\n\n//*****************************************************************************\n// End MetaData Validator Declarations\n//*****************************************************************************\n\n//*****************************************************************************\n// IMetaDataDispenserEx declarations.\n//*****************************************************************************\n\n// {31BCFCE2-DAFB-11D2-9F81-00C04F79A0A3}\nEXTERN_GUID(IID_IMetaDataDispenserEx, 0x31bcfce2, 0xdafb, 0x11d2, 0x9f, 0x81, 0x0, 0xc0, 0x4f, 0x79, 0xa0, 0xa3);\n\n#undef  INTERFACE\n#define INTERFACE IMetaDataDispenserEx\nDECLARE_INTERFACE_(IMetaDataDispenserEx, IMetaDataDispenser)\n{\n    STDMETHOD(SetOption)(                   // Return code.\n        REFGUID     optionid,               // [in] GUID for the option to be set.\n        const VARIANT *value) PURE;         // [in] Value to which the option is to be set.\n\n    STDMETHOD(GetOption)(                   // Return code.\n        REFGUID     optionid,               // [in] GUID for the option to be set.\n        VARIANT *pvalue) PURE;              // [out] Value to which the option is currently set.\n\n    STDMETHOD(OpenScopeOnITypeInfo)(        // Return code.\n        ITypeInfo   *pITI,                  // [in] ITypeInfo to open.\n        DWORD       dwOpenFlags,            // [in] Open mode flags.\n        REFIID      riid,                   // [in] The interface desired.\n        IUnknown    **ppIUnk) PURE;         // [out] Return interface on success.\n\n    STDMETHOD(GetCORSystemDirectory)(       // Return code.\n       _Out_writes_to_opt_(cchBuffer, *pchBuffer)\n         LPWSTR      szBuffer,              // [out] Buffer for the directory name\n         DWORD       cchBuffer,             // [in] Size of the buffer\n         DWORD*      pchBuffer) PURE;       // [OUT] Number of characters returned\n\n    STDMETHOD(FindAssembly)(                // S_OK or error\n        LPCWSTR  szAppBase,                 // [IN] optional - can be NULL\n        LPCWSTR  szPrivateBin,              // [IN] optional - can be NULL\n        LPCWSTR  szGlobalBin,               // [IN] optional - can be NULL\n        LPCWSTR  szAssemblyName,            // [IN] required - this is the assembly you are requesting\n        LPCWSTR  szName,                    // [OUT] buffer - to hold name\n        ULONG    cchName,                   // [IN] the name buffer's size\n        ULONG    *pcName) PURE;             // [OUT] the number of characters returned in the buffer\n\n    STDMETHOD(FindAssemblyModule)(          // S_OK or error\n        LPCWSTR  szAppBase,                 // [IN] optional - can be NULL\n        LPCWSTR  szPrivateBin,              // [IN] optional - can be NULL\n        LPCWSTR  szGlobalBin,               // [IN] optional - can be NULL\n        LPCWSTR  szAssemblyName,            // [IN] required - this is the assembly you are requesting\n        LPCWSTR  szModuleName,              // [IN] required - the name of the module\n      _Out_writes_to_opt_(cchName, *pcName)\n        LPWSTR   szName,                    // [OUT] buffer - to hold name\n        ULONG    cchName,                   // [IN]  the name buffer's size\n        ULONG    *pcName) PURE;             // [OUT] the number of characters returned in the buffer\n\n};\n\n//**********************************************************************\n//**********************************************************************\n//--- IMetaDataTables\n//-------------------------------------\n// This API isn't big endian friendly since it indexes directly into the memory that\n// is stored in little endian format.\n// {D8F579AB-402D-4b8e-82D9-5D63B1065C68}\nEXTERN_GUID(IID_IMetaDataTables, 0xd8f579ab, 0x402d, 0x4b8e, 0x82, 0xd9, 0x5d, 0x63, 0xb1, 0x6, 0x5c, 0x68);\n\nDECLARE_INTERFACE_(IMetaDataTables, IUnknown)\n{\n    STDMETHOD (GetStringHeapSize) (\n        ULONG   *pcbStrings) PURE;          // [OUT] Size of the string heap.\n\n    STDMETHOD (GetBlobHeapSize) (\n        ULONG   *pcbBlobs) PURE;            // [OUT] Size of the Blob heap.\n\n    STDMETHOD (GetGuidHeapSize) (\n        ULONG   *pcbGuids) PURE;            // [OUT] Size of the Guid heap.\n\n    STDMETHOD (GetUserStringHeapSize) (\n        ULONG   *pcbBlobs) PURE;            // [OUT] Size of the User String heap.\n\n    STDMETHOD (GetNumTables) (\n        ULONG   *pcTables) PURE;            // [OUT] Count of tables.\n\n    STDMETHOD (GetTableIndex) (\n        ULONG   token,                      // [IN] Token for which to get table index.\n        ULONG   *pixTbl) PURE;              // [OUT] Put table index here.\n\n    STDMETHOD (GetTableInfo) (\n        ULONG   ixTbl,                      // [IN] Which table.\n        ULONG   *pcbRow,                    // [OUT] Size of a row, bytes.\n        ULONG   *pcRows,                    // [OUT] Number of rows.\n        ULONG   *pcCols,                    // [OUT] Number of columns in each row.\n        ULONG   *piKey,                     // [OUT] Key column, or -1 if none.\n        const char **ppName) PURE;          // [OUT] Name of the table.\n\n    STDMETHOD (GetColumnInfo) (\n        ULONG   ixTbl,                      // [IN] Which Table\n        ULONG   ixCol,                      // [IN] Which Column in the table\n        ULONG   *poCol,                     // [OUT] Offset of the column in the row.\n        ULONG   *pcbCol,                    // [OUT] Size of a column, bytes.\n        ULONG   *pType,                     // [OUT] Type of the column.\n        const char **ppName) PURE;          // [OUT] Name of the Column.\n\n    STDMETHOD (GetCodedTokenInfo) (\n        ULONG   ixCdTkn,                    // [IN] Which kind of coded token.\n        ULONG   *pcTokens,                  // [OUT] Count of tokens.\n        ULONG   **ppTokens,                 // [OUT] List of tokens.\n        const char **ppName) PURE;          // [OUT] Name of the CodedToken.\n\n    STDMETHOD (GetRow) (\n        ULONG   ixTbl,                      // [IN] Which table.\n        ULONG   rid,                        // [IN] Which row.\n        void    **ppRow) PURE;              // [OUT] Put pointer to row here.\n\n    STDMETHOD (GetColumn) (\n        ULONG   ixTbl,                      // [IN] Which table.\n        ULONG   ixCol,                      // [IN] Which column.\n        ULONG   rid,                        // [IN] Which row.\n        ULONG   *pVal) PURE;                // [OUT] Put the column contents here.\n\n    STDMETHOD (GetString) (\n        ULONG   ixString,                   // [IN] Value from a string column.\n        const char **ppString) PURE;        // [OUT] Put a pointer to the string here.\n\n    STDMETHOD (GetBlob) (\n        ULONG   ixBlob,                     // [IN] Value from a blob column.\n        ULONG   *pcbData,                   // [OUT] Put size of the blob here.\n        const void **ppData) PURE;          // [OUT] Put a pointer to the blob here.\n\n    STDMETHOD (GetGuid) (\n        ULONG   ixGuid,                     // [IN] Value from a guid column.\n        const GUID **ppGUID) PURE;          // [OUT] Put a pointer to the GUID here.\n\n    STDMETHOD (GetUserString) (\n        ULONG   ixUserString,               // [IN] Value from a UserString column.\n        ULONG   *pcbData,                   // [OUT] Put size of the UserString here.\n        const void **ppData) PURE;          // [OUT] Put a pointer to the UserString here.\n\n    STDMETHOD (GetNextString) (\n        ULONG   ixString,                   // [IN] Value from a string column.\n        ULONG   *pNext) PURE;               // [OUT] Put the index of the next string here.\n\n    STDMETHOD (GetNextBlob) (\n        ULONG   ixBlob,                     // [IN] Value from a blob column.\n        ULONG   *pNext) PURE;               // [OUT] Put the index of the netxt blob here.\n\n    STDMETHOD (GetNextGuid) (\n        ULONG   ixGuid,                     // [IN] Value from a guid column.\n        ULONG   *pNext) PURE;               // [OUT] Put the index of the next guid here.\n\n    STDMETHOD (GetNextUserString) (\n        ULONG   ixUserString,               // [IN] Value from a UserString column.\n        ULONG   *pNext) PURE;               // [OUT] Put the index of the next user string here.\n\n    // Interface is sealed.\n\n};\n// This API isn't big endian friendly since it indexes directly into the memory that\n// is stored in little endian format.\n// {BADB5F70-58DA-43a9-A1C6-D74819F19B15}\nEXTERN_GUID(IID_IMetaDataTables2, 0xbadb5f70, 0x58da, 0x43a9, 0xa1, 0xc6, 0xd7, 0x48, 0x19, 0xf1, 0x9b, 0x15);\n\nDECLARE_INTERFACE_(IMetaDataTables2, IMetaDataTables)\n{\n    STDMETHOD (GetMetaDataStorage) (        //@todo: name?\n        const void **ppvMd,                 // [OUT] put pointer to MD section here (aka, 'BSJB').\n        ULONG   *pcbMd) PURE;               // [OUT] put size of the stream here.\n\n    STDMETHOD (GetMetaDataStreamInfo) (     // Get info about the MD stream.\n        ULONG   ix,                         // [IN] Stream ordinal desired.\n        const char **ppchName,              // [OUT] put pointer to stream name here.\n        const void **ppv,                   // [OUT] put pointer to MD stream here.\n        ULONG   *pcb) PURE;                 // [OUT] put size of the stream here.\n\n}; // IMetaDataTables2\n\n#ifdef _DEFINE_META_DATA_META_CONSTANTS\n#ifndef _META_DATA_META_CONSTANTS_DEFINED\n#define _META_DATA_META_CONSTANTS_DEFINED\nconst unsigned int iRidMax          = 63;\nconst unsigned int iCodedToken      = 64;   // base of coded tokens.\nconst unsigned int iCodedTokenMax   = 95;\nconst unsigned int iSHORT           = 96;   // fixed types.\nconst unsigned int iUSHORT          = 97;\nconst unsigned int iLONG            = 98;\nconst unsigned int iULONG           = 99;\nconst unsigned int iBYTE            = 100;\nconst unsigned int iSTRING          = 101;  // pool types.\nconst unsigned int iGUID            = 102;\nconst unsigned int iBLOB            = 103;\n\ninline int IsRidType(ULONG ix) { return ix <= iRidMax; }\ninline int IsCodedTokenType(ULONG ix) { return (ix >= iCodedToken) && (ix <= iCodedTokenMax); }\ninline int IsRidOrToken(ULONG ix) { return ix <= iCodedTokenMax; }\ninline int IsHeapType(ULONG ix) { return ix >= iSTRING; }\ninline int IsFixedType(ULONG ix) { return (ix < iSTRING) && (ix > iCodedTokenMax); }\n#endif\n#endif\n\n//**********************************************************************\n// End of IMetaDataTables.\n//**********************************************************************\n\n//-------------------------------------\n//--- IMetaDataInfo\n//-------------------------------------\n// {7998EA64-7F95-48B8-86FC-17CAF48BF5CB}\nEXTERN_GUID(IID_IMetaDataInfo, 0x7998EA64, 0x7F95, 0x48B8, 0x86, 0xFC, 0x17, 0xCA, 0xF4, 0x8B, 0xF5, 0xCB);\n\n//---\n#undef  INTERFACE\n#define INTERFACE IMetaDataInfo\nDECLARE_INTERFACE_(IMetaDataInfo, IUnknown)\n{\n    // Return Values:\n    //   S_OK               - All parameters are filled.\n    //   COR_E_NOTSUPPORTED - The API is not supported for this particular scope (e.g. .obj files, scope\n    //                        opened without whole file via code:IMetaDataDispenser::OpenScopeOnMemory, etc.).\n    //   E_INVALIDARG       - If NULL is passed as parameter.\n   STDMETHOD(GetFileMapping)(\n        const void ** ppvData,              // [out] Pointer to the start of the mapped file.\n        ULONGLONG *   pcbData,              // [out] Size of the mapped memory region.\n        DWORD *       pdwMappingType) PURE; // [out] Type of file mapping (code:CorFileMapping).\n};  // class IMetaDataInfo\n\n//**********************************************************************\n//\n// Predefined CustomAttribute and structures for these custom value\n//\n//**********************************************************************\n\n//\n// Native Link method custom value definitions. This is for N-direct support.\n//\n\n#include <pshpack1.h>\ntypedef struct\n{\n    BYTE        m_linkType;       // see CorNativeLinkType below\n    BYTE        m_flags;          // see CorNativeLinkFlags below\n    mdMemberRef m_entryPoint;     // member ref token giving entry point, format is lib:entrypoint\n} COR_NATIVE_LINK;\n#include <poppack.h>\n\ntypedef enum\n{\n    nltNone         = 1,    // none of the keywords are specified\n    nltAnsi         = 2,    // ansi keyword specified\n    nltUnicode      = 3,    // unicode keyword specified\n    nltAuto         = 4,    // auto keyword specified\n    nltMaxValue     = 7,    // used so we can assert how many bits are required for this enum\n} CorNativeLinkType;\n\ntypedef enum\n{\n    nlfNone         = 0x00,     // no flags\n    nlfLastError    = 0x01,     // setLastError keyword specified\n    nlfNoMangle     = 0x02,     // nomangle keyword specified\n    nlfMaxValue     = 0x03,     // used so we can assert how many bits are required for this enum\n} CorNativeLinkFlags;\n\n//\n// Base class for security custom attributes.\n//\n\n#define COR_BASE_SECURITY_ATTRIBUTE_CLASS L\"System.Security.Permissions.SecurityAttribute\"\n#define COR_BASE_SECURITY_ATTRIBUTE_CLASS_ANSI \"System.Security.Permissions.SecurityAttribute\"\n\n//\n// Name of custom attribute used to indicate that per-call security checks should\n// be disabled for P/Invoke calls.\n//\n\n#define COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE L\"System.Security.SuppressUnmanagedCodeSecurityAttribute\"\n#define COR_SUPPRESS_UNMANAGED_CODE_CHECK_ATTRIBUTE_ANSI \"System.Security.SuppressUnmanagedCodeSecurityAttribute\"\n\n//\n// Name of custom attribute tagged on module to indicate it contains\n// unverifiable code.\n//\n\n#define COR_UNVER_CODE_ATTRIBUTE L\"System.Security.UnverifiableCodeAttribute\"\n#define COR_UNVER_CODE_ATTRIBUTE_ANSI \"System.Security.UnverifiableCodeAttribute\"\n\n//\n// Name of custom attribute indicating that a method requires a security object\n// slot on the caller's stack.\n//\n\n#define COR_REQUIRES_SECOBJ_ATTRIBUTE W(\"System.Security.DynamicSecurityMethodAttribute\")\n#define COR_REQUIRES_SECOBJ_ATTRIBUTE_ANSI \"System.Security.DynamicSecurityMethodAttribute\"\n\n#define COR_COMPILERSERVICE_DISCARDABLEATTRIBUTE L\"System.Runtime.CompilerServices.DiscardableAttribute\"\n#define COR_COMPILERSERVICE_DISCARDABLEATTRIBUTE_ASNI \"System.Runtime.CompilerServices.DiscardableAttribute\"\n\n\n#ifdef __cplusplus\n}\n\n//*****************************************************************************\n//*****************************************************************************\n//\n// C O M +   s i g n a t u r e   s u p p o r t\n//\n//*****************************************************************************\n//*****************************************************************************\n\n#ifndef FORCEINLINE\n #if _MSC_VER < 1200\n   #define FORCEINLINE inline\n #else\n   #define FORCEINLINE __forceinline\n #endif\n#endif\n\n\n// We need a version that is FORCEINLINE on retail and NOINLINE on debug\n\n#ifndef DEBUG_NOINLINE\n#if defined(_DEBUG)\n#define DEBUG_NOINLINE NOINLINE\n#else\n#define DEBUG_NOINLINE\n#endif\n#endif\n\n#ifndef NOINLINE\n#ifdef _MSC_VER\n#define NOINLINE __declspec(noinline)\n#elif defined __GNUC__\n#define NOINLINE __attribute__ ((noinline))\n#else\n#define NOINLINE\n#endif\n#endif // !NOINLINE\n\n// return true if it is a primitive type, i.e. only need to store CorElementType\nFORCEINLINE int CorIsPrimitiveType(CorElementType elementtype)\n{\n    return (elementtype < ELEMENT_TYPE_PTR || elementtype == ELEMENT_TYPE_I || elementtype == ELEMENT_TYPE_U);\n}\n\n\n// Return true if element type is a modifier, i.e. ELEMENT_TYPE_MODIFIER bits are\n// turned on. For now, it is checking for ELEMENT_TYPE_PTR and ELEMENT_TYPE_BYREF\n// as well. This will be removed when we turn on ELEMENT_TYPE_MODIFIER bits for\n// these two enum members.\n//\nFORCEINLINE int CorIsModifierElementType(CorElementType elementtype)\n{\n    if (elementtype == ELEMENT_TYPE_PTR || elementtype == ELEMENT_TYPE_BYREF)\n        return 1;\n    return  (elementtype & ELEMENT_TYPE_MODIFIER);\n}\n\n// Given a compress byte (*pData), return the size of the uncompressed data.\ninline ULONG CorSigUncompressedDataSize(\n    PCCOR_SIGNATURE pData)\n{\n    if ((*pData & 0x80) == 0)\n        return 1;\n    else if ((*pData & 0xC0) == 0x80)\n        return 2;\n    else\n        return 4;\n}\n\n/////////////////////////////////////////////////////////////////////////////////////////////\n//\n// Given a compressed integer(*pData), expand the compressed int to *pDataOut.\n// Return value is the number of bytes that the integer occupies in the compressed format\n// It is caller's responsibility to ensure pDataOut has at least 4 bytes to be written to.\n//\n// This function returns -1 if pass in with an incorrectly compressed data, such as\n// (*pBytes & 0xE0) == 0XE0.\n/////////////////////////////////////////////////////////////////////////////////////////////\ninline ULONG CorSigUncompressBigData(\n    PCCOR_SIGNATURE & pData)    // [IN,OUT] compressed data\n{\n    ULONG res;\n\n    // 1 byte data is handled in CorSigUncompressData\n    //  _ASSERTE(*pData & 0x80);\n\n    // Medium.\n    if ((*pData & 0xC0) == 0x80)  // 10?? ????\n    {\n        res = (ULONG)((*pData++ & 0x3f) << 8);\n        res |= *pData++;\n    }\n    else // 110? ????\n    {\n        res = (*pData++ & 0x1f) << 24;\n        res |= *pData++ << 16;\n        res |= *pData++ << 8;\n        res |= *pData++;\n    }\n    return res;\n}\nFORCEINLINE ULONG CorSigUncompressData(\n    PCCOR_SIGNATURE & pData)    // [IN,OUT] compressed data\n{\n    // Handle smallest data inline.\n    if ((*pData & 0x80) == 0x00)        // 0??? ????\n        return *pData++;\n    return CorSigUncompressBigData(pData);\n}\n\n#ifdef HOST_WINDOWS\ninline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the signature is bad\n    PCCOR_SIGNATURE pData,          // [IN] compressed data\n    DWORD           len,            // [IN] length of the signature\n    ULONG *         pDataOut,       // [OUT] the expanded *pData\n    ULONG *         pDataLen)       // [OUT] length of the expanded *pData\n{\n    HRESULT hr = S_OK;\n    BYTE const  *pBytes = reinterpret_cast<BYTE const*>(pData);\n\n    // Smallest.\n    if ((*pBytes & 0x80) == 0x00)       // 0??? ????\n    {\n        if (len < 1)\n        {\n            *pDataOut = 0;\n            *pDataLen = 0;\n            hr = META_E_BAD_SIGNATURE;\n        }\n        else\n        {\n            *pDataOut = *pBytes;\n            *pDataLen = 1;\n        }\n    }\n    // Medium.\n    else if ((*pBytes & 0xC0) == 0x80)  // 10?? ????\n    {\n        if (len < 2)\n        {\n            *pDataOut = 0;\n            *pDataLen = 0;\n            hr = META_E_BAD_SIGNATURE;\n        }\n        else\n        {\n            *pDataOut = (ULONG)(((*pBytes & 0x3f) << 8 | *(pBytes+1)));\n            *pDataLen = 2;\n        }\n    }\n    else if ((*pBytes & 0xE0) == 0xC0)      // 110? ????\n    {\n        if (len < 4)\n        {\n            *pDataOut = 0;\n            *pDataLen = 0;\n            hr = META_E_BAD_SIGNATURE;\n        }\n        else\n        {\n            *pDataOut = (ULONG)(((*pBytes & 0x1f) << 24 | *(pBytes+1) << 16 | *(pBytes+2) << 8 | *(pBytes+3)));\n            *pDataLen = 4;\n        }\n    }\n    else // We don't recognize this encoding\n    {\n        *pDataOut = 0;\n        *pDataLen = 0;\n        hr = META_E_BAD_SIGNATURE;\n    }\n\n    return hr;\n}\n#endif // HOST_WINDOWS\n\ninline HRESULT CorSigUncompressData(// return S_OK or E_BADIMAGEFORMAT if the signature is bad\n    PCCOR_SIGNATURE pData,          // [IN] compressed data\n    DWORD           len,            // [IN] length of the signature\n    uint32_t *      pDataOut,       // [OUT] the expanded *pData\n    uint32_t *      pDataLen)       // [OUT] length of the expanded *pData\n{\n    HRESULT hr = S_OK;\n    BYTE const  *pBytes = reinterpret_cast<BYTE const*>(pData);\n\n    // Smallest.\n    if ((*pBytes & 0x80) == 0x00)       // 0??? ????\n    {\n        if (len < 1)\n        {\n            *pDataOut = 0;\n            *pDataLen = 0;\n            hr = META_E_BAD_SIGNATURE;\n        }\n        else\n        {\n            *pDataOut = *pBytes;\n            *pDataLen = 1;\n        }\n    }\n    // Medium.\n    else if ((*pBytes & 0xC0) == 0x80)  // 10?? ????\n    {\n        if (len < 2)\n        {\n            *pDataOut = 0;\n            *pDataLen = 0;\n            hr = META_E_BAD_SIGNATURE;\n        }\n        else\n        {\n            *pDataOut = (uint32_t)(((*pBytes & 0x3f) << 8 | *(pBytes+1)));\n            *pDataLen = 2;\n        }\n    }\n    else if ((*pBytes & 0xE0) == 0xC0)      // 110? ????\n    {\n        if (len < 4)\n        {\n            *pDataOut = 0;\n            *pDataLen = 0;\n            hr = META_E_BAD_SIGNATURE;\n        }\n        else\n        {\n            *pDataOut = (uint32_t)(((*pBytes & 0x1f) << 24 | *(pBytes+1) << 16 | *(pBytes+2) << 8 | *(pBytes+3)));\n            *pDataLen = 4;\n        }\n    }\n    else // We don't recognize this encoding\n    {\n        *pDataOut = 0;\n        *pDataLen = 0;\n        hr = META_E_BAD_SIGNATURE;\n    }\n\n    return hr;\n}\n\ninline ULONG CorSigUncompressData(      // return number of bytes of that compressed data occupied in pData\n    PCCOR_SIGNATURE pData,              // [IN] compressed data\n    ULONG       *pDataOut)              // [OUT] the expanded *pData\n{\n    ULONG dwSizeOfData = 0;\n\n    // We don't know how big the signature is, so we'll just say that it's big enough\n    if (FAILED(CorSigUncompressData(pData, 0xff, reinterpret_cast<uint32_t *>(pDataOut), reinterpret_cast<uint32_t *>(&dwSizeOfData))))\n    {\n        *pDataOut = 0;\n        return (ULONG)-1;\n    }\n\n    return dwSizeOfData;\n}\n\n\nFORCEINLINE mdToken CorSigDecodeTokenType(int encoded)\n{\n    static const mdToken s_tableTokenTypes[] = {mdtTypeDef, mdtTypeRef, mdtTypeSpec, mdtBaseType};\n    return s_tableTokenTypes[encoded];\n}\n\n// uncompress a token\ninline mdToken CorSigUncompressToken(   // return the token.\n    PCCOR_SIGNATURE &pData)             // [IN,OUT] compressed data\n{\n    mdToken tk;\n    mdToken tkType;\n\n    tk = CorSigUncompressData(pData);\n    tkType = CorSigDecodeTokenType(tk & 0x3);\n    tk = TokenFromRid(tk >> 2, tkType);\n    return tk;\n}\n\n\ninline ULONG CorSigUncompressToken( // return number of bytes of that compressed data occupied in pData\n    PCCOR_SIGNATURE pData,          // [IN] compressed data\n    mdToken *       pToken)         // [OUT] the expanded *pData\n{\n    ULONG   cb;\n    mdToken tk;\n    mdToken tkType;\n\n    cb = CorSigUncompressData(pData, (ULONG *)&tk);\n    tkType = CorSigDecodeTokenType(tk & 0x3);\n    tk = TokenFromRid(tk >> 2, tkType);\n    *pToken = tk;\n    return cb;\n}\n\ninline HRESULT CorSigUncompressToken(\n    PCCOR_SIGNATURE pData,          // [IN] compressed data\n    uint32_t        dwLen,          // [IN] Remaining length of sigature\n    mdToken *       pToken,         // [OUT] the expanded *pData\n    uint32_t *      dwTokenLength)  // [OUT] The length of the token in the sigature\n{\n    mdToken tk;\n    mdToken tkType;\n\n    HRESULT hr = CorSigUncompressData(pData, dwLen, (uint32_t *)&tk, dwTokenLength);\n\n    if (SUCCEEDED(hr))\n    {\n        tkType = CorSigDecodeTokenType(tk & 0x3);\n        tk = TokenFromRid(tk >> 2, tkType);\n        *pToken = tk;\n    }\n    else\n    {\n        *pToken = mdTokenNil;\n    }\n    return hr;\n}\n\n\n\nFORCEINLINE ULONG CorSigUncompressCallingConv(\n    PCCOR_SIGNATURE & pData)    // [IN,OUT] Compressed data\n{\n    return *pData++;\n}\n\nFORCEINLINE HRESULT CorSigUncompressCallingConv(\n    PCCOR_SIGNATURE pData,      // [IN] Signature\n    DWORD           dwLen,      // [IN] Length of signature\n    uint32_t *      data)       // [OUT] Compressed data\n{\n    if (dwLen > 0)\n    {\n        *data = *pData;\n        return S_OK;\n    }\n    else\n    {\n        *data = 0;\n        return META_E_BAD_SIGNATURE;\n    }\n}\n\n\nenum {\n    SIGN_MASK_ONEBYTE  = 0xffffffc0,        // Mask the same size as the missing bits.\n    SIGN_MASK_TWOBYTE  = 0xffffe000,        // Mask the same size as the missing bits.\n    SIGN_MASK_FOURBYTE = 0xf0000000,        // Mask the same size as the missing bits.\n};\n\n// uncompress a signed integer\ninline ULONG CorSigUncompressSignedInt( // return number of bytes of that compressed data occupied in pData\n    PCCOR_SIGNATURE pData,              // [IN] compressed data\n    int *           pInt)               // [OUT] the expanded *pInt\n{\n    ULONG cb;\n    ULONG ulSigned;\n    ULONG iData;\n\n    cb = CorSigUncompressData(pData, &iData);\n    if (cb == (ULONG) -1) return cb;\n    ulSigned = iData & 0x1;\n    iData = iData >> 1;\n    if (ulSigned)\n    {\n        if (cb == 1)\n        {\n            iData |= SIGN_MASK_ONEBYTE;\n        }\n        else if (cb == 2)\n        {\n            iData |= SIGN_MASK_TWOBYTE;\n        }\n        else\n        {\n            iData |= SIGN_MASK_FOURBYTE;\n        }\n    }\n    *pInt = (int)iData;\n    return cb;\n}\n\n\n// uncompress encoded element type\nFORCEINLINE CorElementType CorSigUncompressElementType( // Element type\n    PCCOR_SIGNATURE & pData)                            // [IN,OUT] Compressed data\n{\n    return (CorElementType)*pData++;\n}\n\ninline ULONG CorSigUncompressElementType(   // Return number of bytes of that compressed data occupied in pData\n    PCCOR_SIGNATURE  pData,                 // [IN] Compressed data\n    CorElementType * pElementType)          // [OUT] The expanded *pData\n{\n    *pElementType = (CorElementType)(*pData & 0x7f);\n    return 1;\n}\n\n\n/////////////////////////////////////////////////////////////////////////////////////////////\n//\n// Given an uncompressed unsigned integer (iLen), Store it to pDataOut in a compressed format.\n// Return value is the number of bytes that the integer occupies in the compressed format.\n// It is caller's responsibilityt to ensure *pDataOut has at least 4 bytes to write to.\n//\n// Note that this function returns -1 if iLen is too big to be compressed. We currently can\n// only represent to 0x1FFFFFFF.\n//\n/////////////////////////////////////////////////////////////////////////////////////////////\ninline ULONG CorSigCompressData(    // return number of bytes that compressed form of iLen will take\n    ULONG  iLen,                    // [IN] given uncompressed data\n    void * pDataOut)                // [OUT] buffer where iLen will be compressed and stored.\n{\n    BYTE *pBytes = reinterpret_cast<BYTE *>(pDataOut);\n\n    if (iLen <= 0x7F)\n    {\n        *pBytes = BYTE(iLen);\n        return 1;\n    }\n\n    if (iLen <= 0x3FFF)\n    {\n        *pBytes     = BYTE((iLen >> 8) | 0x80);\n        *(pBytes+1) = BYTE(iLen & 0xff);\n        return 2;\n    }\n\n    if (iLen <= 0x1FFFFFFF)\n    {\n        *pBytes     = BYTE((iLen >> 24) | 0xC0);\n        *(pBytes+1) = BYTE((iLen >> 16) & 0xff);\n        *(pBytes+2) = BYTE((iLen >> 8)  & 0xff);\n        *(pBytes+3) = BYTE(iLen & 0xff);\n        return 4;\n    }\n    return (ULONG) -1;\n}\n\n// compress a token\n// The least significant bit of the first compress byte will indicate the token type.\n//\ninline ULONG CorSigCompressToken(   // return number of bytes that compressed form of the token will take\n    mdToken  tk,                    // [IN] given token\n    void *   pDataOut)              // [OUT] buffer where the token will be compressed and stored.\n{\n    RID     rid = RidFromToken(tk);\n    ULONG32 ulTyp = TypeFromToken(tk);\n\n    if (rid > 0x3FFFFFF)\n        // token is too big to be compressed\n        return (ULONG) -1;\n\n    rid = (rid << 2);\n\n    // TypeDef is encoded with low bits 00\n    // TypeRef is encoded with low bits 01\n    // TypeSpec is encoded with low bits 10\n    // BaseType is encoded with low bit 11\n    //\n    if (ulTyp == CorSigDecodeTokenType(1))\n    {\n        // make the last two bits 01\n        rid |= 0x1;\n    }\n    else if (ulTyp == CorSigDecodeTokenType(2))\n    {\n        // make last two bits 0\n        rid |= 0x2;\n    }\n    else if (ulTyp == CorSigDecodeTokenType(3))\n    {\n        rid |= 0x3;\n    }\n    return CorSigCompressData((ULONG)rid, pDataOut);\n}\n\n// compress a signed integer\n// The least significant bit of the first compress byte will be the signed bit.\n//\ninline ULONG CorSigCompressSignedInt(   // return number of bytes that compressed form of iData will take\n    int    iData,                       // [IN] given integer\n    void * pDataOut)                    // [OUT] buffer where iLen will be compressed and stored.\n{\n    ULONG isSigned = 0;\n    BYTE *pBytes = reinterpret_cast<BYTE *>(pDataOut);\n\n    if (iData < 0)\n        isSigned = 0x1;\n\n    // Note that we cannot use code:CorSigCompressData to pack the iData value, because of negative values\n    // like: 0xffffe000 (-8192) which has to be encoded as 1 in 2 bytes, i.e. 0x81 0x00\n    // However CorSigCompressedData would store value 1 as 1 byte: 0x01\n    if ((iData & SIGN_MASK_ONEBYTE) == 0 || (iData & SIGN_MASK_ONEBYTE) == SIGN_MASK_ONEBYTE)\n    {\n        iData = (int)((iData & ~SIGN_MASK_ONEBYTE) << 1 | isSigned);\n        //_ASSERTE(iData <= 0x7f);\n        *pBytes = BYTE(iData);\n        return 1;\n    }\n    else if ((iData & SIGN_MASK_TWOBYTE) == 0 || (iData & SIGN_MASK_TWOBYTE) == SIGN_MASK_TWOBYTE)\n    {\n        iData = (int)((iData & ~SIGN_MASK_TWOBYTE) << 1 | isSigned);\n        //_ASSERTE(iData <= 0x3fff);\n        *pBytes       = BYTE((iData >> 8) | 0x80);\n        *(pBytes + 1) = BYTE(iData & 0xff);\n        return 2;\n    }\n    else if ((iData & SIGN_MASK_FOURBYTE) == 0 || (iData & SIGN_MASK_FOURBYTE) == SIGN_MASK_FOURBYTE)\n    {\n        iData = (int)((iData & ~SIGN_MASK_FOURBYTE) << 1 | isSigned);\n        //_ASSERTE(iData <= 0x1FFFFFFF);\n        *pBytes       = BYTE((iData >> 24) | 0xC0);\n        *(pBytes + 1) = BYTE((iData >> 16) & 0xff);\n        *(pBytes + 2) = BYTE((iData >> 8)  & 0xff);\n        *(pBytes + 3) = BYTE(iData & 0xff);\n        return 4;\n    }\n    // Out of compressible range\n    return (ULONG)-1;\n} // CorSigCompressSignedInt\n\n\n// uncompress encoded element type\ninline ULONG CorSigCompressElementType( // return number of bytes of that compressed data occupied in pData\n    CorElementType et,                  // [OUT] the expanded *pData\n    void *         pData)               // [IN] compressed data\n{\n    BYTE *pBytes = (BYTE *)(pData);\n\n    *pBytes = BYTE(et);\n    return 1;\n}\n\n// Compress a pointer (used for internal element types only, never for persisted\n// signatures).\ninline ULONG CorSigCompressPointer( // return number of bytes of that compressed data occupied\n    void * pvPointer,               // [IN] given uncompressed data\n    void * pData)                   // [OUT] buffer where iLen will be compressed and stored.\n{\n    *((void * UNALIGNED *)pData) = pvPointer;\n    return sizeof(void *);\n}\n\n// Uncompress a pointer (see above for comments).\ninline ULONG CorSigUncompressPointer(   // return number of bytes of that compressed data occupied\n    PCCOR_SIGNATURE pData,              // [IN] compressed data\n    void **         ppvPointer)         // [OUT] the expanded *pData\n{\n    *ppvPointer = *(void * const UNALIGNED *)pData;\n    return sizeof(void *);\n}\n\n#endif  // __cplusplus\n\n#endif // _COR_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corcompile.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\\\n*                                                                             *\n* CorCompile.h -    EE / Compiler interface                                   *\n*                                                                             *\n*               Version 1.0                                                   *\n*******************************************************************************\n*                                                                             *\n*                                                                     *\n*                                                                             *\n\\*****************************************************************************/\n\n#ifndef _COR_COMPILE_H_\n#define _COR_COMPILE_H_\n\n#include <cor.h>\n#include <corhdr.h>\n#include <corinfo.h>\n#include <corjit.h>\n#include <sstring.h>\n#include <shash.h>\n#include <daccess.h>\n#include <clrtypes.h>\n#include <readytorun.h>\n\ntypedef DPTR(struct CORCOMPILE_EXCEPTION_LOOKUP_TABLE)\n    PTR_CORCOMPILE_EXCEPTION_LOOKUP_TABLE;\ntypedef DPTR(struct CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY)\n   PTR_CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY;\ntypedef DPTR(struct CORCOMPILE_EXCEPTION_CLAUSE)\n   PTR_CORCOMPILE_EXCEPTION_CLAUSE;\ntypedef DPTR(struct CORCOMPILE_EXTERNAL_METHOD_DATA_ENTRY)\n    PTR_CORCOMPILE_EXTERNAL_METHOD_DATA_ENTRY;\ntypedef DPTR(struct READYTORUN_IMPORT_SECTION)\n    PTR_READYTORUN_IMPORT_SECTION;\n\ninline ReadyToRunImportSectionFlags operator |( const ReadyToRunImportSectionFlags left, const ReadyToRunImportSectionFlags right)\n{\n    return static_cast<ReadyToRunImportSectionFlags>(static_cast<uint16_t>(left) | static_cast<uint16_t>(right));\n}\n\ninline ReadyToRunImportSectionFlags operator &( const ReadyToRunImportSectionFlags left, const ReadyToRunImportSectionFlags right)\n{\n    return static_cast<ReadyToRunImportSectionFlags>(static_cast<uint16_t>(left) & static_cast<uint16_t>(right));\n}\n\ninline ReadyToRunCrossModuleInlineFlags operator |( const ReadyToRunCrossModuleInlineFlags left, const ReadyToRunCrossModuleInlineFlags right)\n{\n    return static_cast<ReadyToRunCrossModuleInlineFlags>(static_cast<uint32_t>(left) | static_cast<uint32_t>(right));\n}\n\ninline ReadyToRunCrossModuleInlineFlags operator &( const ReadyToRunCrossModuleInlineFlags left, const ReadyToRunCrossModuleInlineFlags right)\n{\n    return static_cast<ReadyToRunCrossModuleInlineFlags>(static_cast<uint32_t>(left) & static_cast<uint32_t>(right));\n}\n\n#ifdef TARGET_X86\n\ntypedef DPTR(RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;\n\n\n// Chained unwind info. Used for cold methods.\n#ifdef HOST_X86\n#define RUNTIME_FUNCTION_INDIRECT 0x80000000\n#else\n// If not hosted on X86, undefine RUNTIME_FUNCTION_INDIRECT as it likely isn't correct\n#ifdef RUNTIME_FUNCTION_INDIRECT\n#undef RUNTIME_FUNCTION_INDIRECT\n#endif // RUNTIME_FUNCTION_INDIRECT\n#endif // HOST_X86\n\n#endif // TARGET_X86\n\ntypedef DPTR(struct CORCOMPILE_RUNTIME_DLL_INFO)\n    PTR_CORCOMPILE_RUNTIME_DLL_INFO;\ntypedef DPTR(struct COR_ILMETHOD) PTR_COR_ILMETHOD;\n\n//\n// GCRefMap blob starts with DWORDs lookup index of relative offsets into the blob. This lookup index is used to limit amount\n// of linear scanning required to find entry in the GCRefMap. The size of this lookup index is\n// <totalNumberOfEntries in the GCRefMap> / GCREFMAP_LOOKUP_STRIDE.\n//\n#define GCREFMAP_LOOKUP_STRIDE 1024\n\nenum CORCOMPILE_GCREFMAP_TOKENS\n{\n    GCREFMAP_SKIP = 0,\n    GCREFMAP_REF = 1,\n    GCREFMAP_INTERIOR = 2,\n    GCREFMAP_METHOD_PARAM = 3,\n    GCREFMAP_TYPE_PARAM = 4,\n    GCREFMAP_VASIG_COOKIE = 5,\n};\n\n// Tags for fixup blobs\nenum CORCOMPILE_FIXUP_BLOB_KIND\n{\n    ENCODE_NONE                         = 0,\n\n    ENCODE_MODULE_OVERRIDE              = 0x80,     /* When the high bit is set, override of the module immediately follows */\n\n    ENCODE_DICTIONARY_LOOKUP_THISOBJ    = 0x07,\n    ENCODE_DICTIONARY_LOOKUP_TYPE       = 0x08,\n    ENCODE_DICTIONARY_LOOKUP_METHOD     = 0x09,\n\n    ENCODE_TYPE_HANDLE                  = 0x10,     /* Type handle */\n    ENCODE_METHOD_HANDLE,                           /* Method handle */\n    ENCODE_FIELD_HANDLE,                            /* Field handle */\n\n    ENCODE_METHOD_ENTRY,                            /* For calling a method entry point */\n    ENCODE_METHOD_ENTRY_DEF_TOKEN,                  /* Smaller version of ENCODE_METHOD_ENTRY - method is def token */\n    ENCODE_METHOD_ENTRY_REF_TOKEN,                  /* Smaller version of ENCODE_METHOD_ENTRY - method is ref token */\n\n    ENCODE_VIRTUAL_ENTRY,                           /* For invoking a virtual method */\n    ENCODE_VIRTUAL_ENTRY_DEF_TOKEN,                 /* Smaller version of ENCODE_VIRTUAL_ENTRY - method is def token */\n    ENCODE_VIRTUAL_ENTRY_REF_TOKEN,                 /* Smaller version of ENCODE_VIRTUAL_ENTRY - method is ref token */\n    ENCODE_VIRTUAL_ENTRY_SLOT,                      /* Smaller version of ENCODE_VIRTUAL_ENTRY - type & slot */\n\n    ENCODE_READYTORUN_HELPER,                       /* ReadyToRun helper */\n    ENCODE_STRING_HANDLE,                           /* String token */\n\n    ENCODE_NEW_HELPER,                              /* Dynamically created new helpers */\n    ENCODE_NEW_ARRAY_HELPER,\n\n    ENCODE_ISINSTANCEOF_HELPER,                     /* Dynamically created casting helper */\n    ENCODE_CHKCAST_HELPER,\n\n    ENCODE_FIELD_ADDRESS,                           /* For accessing a cross-module static fields */\n    ENCODE_CCTOR_TRIGGER,                           /* Static constructor trigger */\n\n    ENCODE_STATIC_BASE_NONGC_HELPER,                /* Dynamically created static base helpers */\n    ENCODE_STATIC_BASE_GC_HELPER,\n    ENCODE_THREAD_STATIC_BASE_NONGC_HELPER,\n    ENCODE_THREAD_STATIC_BASE_GC_HELPER,\n\n    ENCODE_FIELD_BASE_OFFSET,                       /* Field base */\n    ENCODE_FIELD_OFFSET,\n\n    ENCODE_TYPE_DICTIONARY,\n    ENCODE_METHOD_DICTIONARY,\n\n    ENCODE_CHECK_TYPE_LAYOUT,\n    ENCODE_CHECK_FIELD_OFFSET,\n\n    ENCODE_DELEGATE_CTOR,\n\n    ENCODE_DECLARINGTYPE_HANDLE,\n\n    ENCODE_INDIRECT_PINVOKE_TARGET,                 /* For calling a pinvoke method ptr indirectly */\n    ENCODE_PINVOKE_TARGET,                          /* For calling a pinvoke method ptr */\n\n    ENCODE_CHECK_INSTRUCTION_SET_SUPPORT,           /* Define the set of instruction sets that must be supported/unsupported to use the fixup */\n\n    ENCODE_VERIFY_FIELD_OFFSET,                     /* Used for the R2R compiler can generate a check against the real field offset used at runtime */\n    ENCODE_VERIFY_TYPE_LAYOUT,                      /* Used for the R2R compiler can generate a check against the real type layout used at runtime */\n\n    ENCODE_CHECK_VIRTUAL_FUNCTION_OVERRIDE,         /* Generate a runtime check to ensure that virtual function resolution has equivalent behavior at runtime as at compile time. If not equivalent, code will not be used */\n    ENCODE_VERIFY_VIRTUAL_FUNCTION_OVERRIDE,        /* Generate a runtime check to ensure that virtual function resolution has equivalent behavior at runtime as at compile time. If not equivalent, generate runtime failure. */\n\n    ENCODE_CHECK_IL_BODY,                           /* Check to see if an IL method is defined the same at runtime as at compile time. A failed match will cause code not to be used. */\n    ENCODE_VERIFY_IL_BODY,                          /* Verify an IL body is defined the same at compile time and runtime. A failed match will cause a hard runtime failure. */\n\n    ENCODE_MODULE_HANDLE                = 0x50,     /* Module token */\n    ENCODE_STATIC_FIELD_ADDRESS,                    /* For accessing a static field */\n    ENCODE_MODULE_ID_FOR_GENERIC_STATICS,           /* For accessing static fields */\n    ENCODE_CLASS_ID_FOR_STATICS,                    /* For accessing static fields */\n    ENCODE_SYNC_LOCK,                               /* For synchronizing access to a type */\n    ENCODE_PROFILING_HANDLE,                        /* For the method's profiling counter */\n    ENCODE_VARARGS_METHODDEF,                       /* For calling a varargs method */\n    ENCODE_VARARGS_METHODREF,\n    ENCODE_VARARGS_SIG,\n};\n\nenum EncodeMethodSigFlags\n{\n    ENCODE_METHOD_SIG_UnboxingStub              = 0x01,\n    ENCODE_METHOD_SIG_InstantiatingStub         = 0x02,\n    ENCODE_METHOD_SIG_MethodInstantiation       = 0x04,\n    ENCODE_METHOD_SIG_SlotInsteadOfToken        = 0x08,\n    ENCODE_METHOD_SIG_MemberRefToken            = 0x10,\n    ENCODE_METHOD_SIG_Constrained               = 0x20,\n    ENCODE_METHOD_SIG_OwnerType                 = 0x40,\n    ENCODE_METHOD_SIG_UpdateContext             = 0x80,\n};\n\nenum EncodeFieldSigFlags\n{\n    ENCODE_FIELD_SIG_IndexInsteadOfToken        = 0x08,\n    ENCODE_FIELD_SIG_MemberRefToken             = 0x10,\n    ENCODE_FIELD_SIG_OwnerType                  = 0x40,\n};\n\nclass SBuffer;\nclass SigBuilder;\nclass PEDecoder;\nclass GCRefMapBuilder;\n\n//REVIEW: include for ee exception info\n#include \"eexcp.h\"\n\nstruct CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY\n{\n    DWORD MethodStartRVA;\n    DWORD ExceptionInfoRVA;\n};\n\nstruct CORCOMPILE_EXCEPTION_LOOKUP_TABLE\n{\n    // pointer to the first element of m_numLookupEntries elements\n    CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY m_Entries[1];\n\n    CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY* ExceptionLookupEntry(unsigned i)\n    {\n        SUPPORTS_DAC_WRAPPER;\n        return &(PTR_CORCOMPILE_EXCEPTION_LOOKUP_TABLE_ENTRY(PTR_HOST_MEMBER_TADDR(CORCOMPILE_EXCEPTION_LOOKUP_TABLE,this,m_Entries))[i]);\n    }\n};\n\nstruct CORCOMPILE_EXCEPTION_CLAUSE\n{\n    CorExceptionFlag    Flags;\n    DWORD               TryStartPC;\n    DWORD               TryEndPC;\n    DWORD               HandlerStartPC;\n    DWORD               HandlerEndPC;\n    union {\n        mdToken         ClassToken;\n        DWORD           FilterOffset;\n    };\n};\n\n/*********************************************************************************/\n// When NGEN install /Profile is run, the ZapProfilingHandleImport fixup table contains\n// these 5 values per MethodDesc\nenum\n{\n    kZapProfilingHandleImportValueIndexFixup        = 0,\n    kZapProfilingHandleImportValueIndexEnterAddr    = 1,\n    kZapProfilingHandleImportValueIndexLeaveAddr    = 2,\n    kZapProfilingHandleImportValueIndexTailcallAddr = 3,\n    kZapProfilingHandleImportValueIndexClientData   = 4,\n\n    kZapProfilingHandleImportValueIndexCount\n};\n#endif /* COR_COMPILE_H_ */\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cordbpriv.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/* ------------------------------------------------------------------------- *\n * cordbpriv.h -- header file for private Debugger data shared by various\n *                Runtime components.\n * ------------------------------------------------------------------------- */\n\n#ifndef _cordbpriv_h_\n#define _cordbpriv_h_\n\n#include \"corhdr.h\"\n#include <unknwn.h>\n\n//\n// Initial value for EnC versions\n//\n#define CorDB_DEFAULT_ENC_FUNCTION_VERSION    1\n#define CorDB_UNKNOWN_ENC_FUNCTION_VERSION    ((SIZE_T)(-1))\n\nenum DebuggerLaunchSetting\n{\n    DLS_ASK_USER          = 0,\n    DLS_ATTACH_DEBUGGER   = 1\n};\n\n\n//\n// Flags used to control the Runtime's debugging modes. These indicate to\n// the Runtime that it needs to load the Runtime Controller, track data\n// during JIT's, etc.\n//\nenum DebuggerControlFlag\n{\n    DBCF_NORMAL_OPERATION           = 0x0000,\n\n    DBCF_USER_MASK                  = 0x00FF,\n    DBCF_GENERATE_DEBUG_CODE        = 0x0001,\n    DBCF_ALLOW_JIT_OPT              = 0x0008,\n    DBCF_PROFILER_ENABLED           = 0x0020,\n//    DBCF_ACTIVATE_REMOTE_DEBUGGING  = 0x0040,  Deprecated.  DO NOT USE\n\n    DBCF_INTERNAL_MASK              = 0xFF00,\n    DBCF_PENDING_ATTACH             = 0x0100,\n    DBCF_ATTACHED                   = 0x0200,\n    DBCF_FIBERMODE                  = 0x0400\n};\n\n//\n// Flags used to control the debuggable state of modules and\n// assemblies.\n//\nenum DebuggerAssemblyControlFlags\n{\n    DACF_NONE                       = 0x00,\n    DACF_USER_OVERRIDE              = 0x01,\n    DACF_ALLOW_JIT_OPTS             = 0x02,\n    DACF_OBSOLETE_TRACK_JIT_INFO    = 0x04, // obsolete in V2.0, we're always tracking.\n    DACF_ENC_ENABLED                = 0x08,\n    DACF_IGNORE_PDBS                = 0x20,\n    DACF_CONTROL_FLAGS_MASK         = 0x2F,\n\n    DACF_PDBS_COPIED                = 0x10,\n    DACF_MISC_FLAGS_MASK            = 0x10,\n};\n\n#endif /* _cordbpriv_h_ */\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cordebug.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** Cordebug.idl - Common Language Runtime Debugging interfaces.            **\n **                                                                         **\n *****************************************************************************/\n\n\n/* ------------------------------------------------------------------------- *\n * Imported types\n * ------------------------------------------------------------------------- */\n\n#if !DEFINITIONS_FROM_NON_IMPORTABLE_PLACES\n\ncpp_quote(\"#if 0\")\n\nimport \"unknwn.idl\";\nimport \"objidl.idl\";\n\ntypedef UINT32 mdToken;\ntypedef mdToken mdModule;\ntypedef SIZE_T  mdScope;\ntypedef mdToken mdTypeDef;\ntypedef mdToken mdSourceFile;\ntypedef mdToken mdMemberRef;\ntypedef mdToken mdMethodDef;\ntypedef mdToken mdFieldDef;\ntypedef mdToken mdSignature;\ntypedef ULONG CorElementType;\ntypedef SIZE_T PCCOR_SIGNATURE;\n\ntypedef SIZE_T LPDEBUG_EVENT;\n\ntypedef SIZE_T LPSTARTUPINFOW;\ntypedef SIZE_T LPPROCESS_INFORMATION;\n\ntypedef const void far *LPCVOID;\n\ncpp_quote(\"#endif\")\n\ntypedef [wire_marshal(unsigned long)] void *HPROCESS;\ntypedef [wire_marshal(unsigned long)] void *HTHREAD;\n\ntypedef UINT64 TASKID;\ntypedef DWORD CONNID;\n\n\n\n\n#endif\n\ncpp_quote(\"#ifndef _COR_IL_MAP\")\ncpp_quote(\"#define _COR_IL_MAP\")\n\n// Note that this structure is also defined in CorProf.idl - PROPAGATE CHANGES\n// BOTH WAYS, or this'll become a really insidious bug some day.\ntypedef struct _COR_IL_MAP\n{\n    ULONG32 oldOffset;      // Old IL offset relative to beginning of function\n    ULONG32 newOffset;      // New IL offset relative to beginning of function\n    BOOL    fAccurate;      // TRUE if mapping is known to be good, FALSE otherwise\n} COR_IL_MAP;\n\ncpp_quote(\"#endif //_COR_IL_MAP\")\n\ncpp_quote(\"#ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_\")\ncpp_quote(\"#define _COR_DEBUG_IL_TO_NATIVE_MAP_\")\n\n/* ICorDebugCode:: GetILToNativeMapping returns an array of\n * COR_DEBUG_IL_TO_NATIVE_MAP structures.  In order to convey that certain\n * ranges of native instructions correspond to special regions of code (for\n * example, the prolog), an entry in the array may have it's ilOffset field set\n * to one of these values.\n */\ntypedef enum CorDebugIlToNativeMappingTypes\n{\n    NO_MAPPING = -1,\n    PROLOG     = -2,\n    EPILOG     = -3\n} CorDebugIlToNativeMappingTypes;\n\ntypedef struct COR_DEBUG_IL_TO_NATIVE_MAP\n{\n    ULONG32 ilOffset;\n    ULONG32 nativeStartOffset;\n    ULONG32 nativeEndOffset;\n} COR_DEBUG_IL_TO_NATIVE_MAP;\n\ncpp_quote(\"#endif // _COR_DEBUG_IL_TO_NATIVE_MAP_\")\n\ncpp_quote(\"#define REMOTE_DEBUGGING_DLL_ENTRY L\\\"Software\\\\\\\\Microsoft\\\\\\\\.NETFramework\\\\\\\\Debugger\\\\\\\\ActivateRemoteDebugging\\\"\")\n\n\ntypedef enum CorDebugJITCompilerFlags\n{\n   CORDEBUG_JIT_DEFAULT = 0x1,                  // Track info, enable optimizations\n   CORDEBUG_JIT_DISABLE_OPTIMIZATION = 0x3,     // Includes track info, disable opts,\n   CORDEBUG_JIT_ENABLE_ENC = 0x7                // Includes track & disable opt & Edit and Continue.\n} CorDebugJITCompilerFlags;\n\ntypedef enum CorDebugJITCompilerFlagsDecprecated\n{\n   CORDEBUG_JIT_TRACK_DEBUG_INFO  = 0x1,          // Use CORDEBUG_JIT_DEFAULT instead\n} CorDebugJITCompilerFlagsDeprecated;\n\ntypedef enum CorDebugNGENPolicy\n{\n    DISABLE_LOCAL_NIC = 1 // indicates that the native image cache for a modern application should be ignored\n} CorDebugNGENPolicy;\n\n/* ------------------------------------------------------------------------- *\n * Forward declarations\n * ------------------------------------------------------------------------- */\n#pragma warning(push)\n#pragma warning(disable:28718)    //Unable to annotate as this is not a local interface\n\ninterface ICorDebug;\n\ninterface ICorDebugController;\ninterface ICorDebugProcess;\ninterface ICorDebugProcess2;\ninterface ICorDebugAppDomain;\ninterface ICorDebugAssembly;\ninterface ICorDebugAssembly2;\ninterface ICorDebugBreakpoint;\ninterface ICorDebugFunctionBreakpoint;\ninterface ICorDebugModuleBreakpoint;\ninterface ICorDebugValueBreakpoint;\ninterface ICorDebugStepper;\ninterface ICorDebugEval;\ninterface ICorDebugEval2;\ninterface ICorDebugThread;\ninterface ICorDebugThread2;\ninterface ICorDebugThread3;\ninterface ICorDebugThread4;\ninterface ICorDebugThread5;\ninterface ICorDebugStackWalk;\ninterface ICorDebugChain;\ninterface ICorDebugFrame;\ninterface ICorDebugILFrame;\ninterface ICorDebugInternalFrame;\ninterface ICorDebugInternalFrame2;\ninterface ICorDebugNativeFrame;\ninterface ICorDebugNativeFrame2;\ninterface ICorDebugRuntimeUnwindableFrame;\ninterface ICorDebugContext;\ninterface ICorDebugModule;\ninterface ICorDebugFunction;\ninterface ICorDebugFunction2;\ninterface ICorDebugCode;\ninterface ICorDebugILCode;\ninterface ICorDebugClass;\ninterface ICorDebugType;\n\ninterface ICorDebugValue;\ninterface ICorDebugGenericValue;\ninterface ICorDebugReferenceValue;\ninterface ICorDebugHeapValue;\ninterface ICorDebugHeapValue2;\ninterface ICorDebugHeapValue3;\ninterface ICorDebugHeapValue4;\ninterface ICorDebugHandleValue;\ninterface ICorDebugObjectValue;\ninterface ICorDebugStringValue;\ninterface ICorDebugArrayValue;\n\ninterface ICorDebugEnum;\ninterface ICorDebugObjectEnum;\ninterface ICorDebugProcessEnum;\ninterface ICorDebugBreakpointEnum;\ninterface ICorDebugStepperEnum;\ninterface ICorDebugModuleEnum;\ninterface ICorDebugThreadEnum;\ninterface ICorDebugChainEnum;\ninterface ICorDebugTypeEnum;\ninterface ICorDebugCodeEnum;\ninterface ICorDebugFrameEnum;\ninterface ICorDebugValueEnum;\ninterface ICorDebugVariableHomeEnum;\ninterface ICorDebugAppDomainEnum;\ninterface ICorDebugAssemblyEnum;\ninterface ICorDebugBlockingObjectEnum;\n\ninterface ICorDebugErrorInfoEnum;\ninterface ICorDebugMDA;\n\n/* DEPRECATED */\ninterface ICorDebugEditAndContinueSnapshot;\n/* DEPRECATED */\ninterface ICorDebugEditAndContinueErrorInfo;\n\n#pragma warning(pop)\n\n// All target addresses in ICorDebug are represented as 0-extended 64-bit integer values.\ntypedef ULONG64 CORDB_ADDRESS;\n\ntypedef ULONG64 CORDB_REGISTER;\ntypedef DWORD CORDB_CONTINUE_STATUS;\ntypedef enum CorDebugBlockingReason {\n    BLOCKING_NONE                     = 0x0,\n    BLOCKING_MONITOR_CRITICAL_SECTION = 0x1,\n    BLOCKING_MONITOR_EVENT            = 0x2\n} CorDebugBlockingReason;\n\ntypedef struct CorDebugBlockingObject {\n    ICorDebugValue         *pBlockingObject;\n    DWORD                   dwTimeout;\n    CorDebugBlockingReason  blockingReason;\n} CorDebugBlockingObject;\n\ntypedef struct CorDebugExceptionObjectStackFrame\n{\n    ICorDebugModule* pModule;\n    CORDB_ADDRESS ip;\n    mdMethodDef methodDef;\n    BOOL isLastForeignExceptionFrame;\n} CorDebugExceptionObjectStackFrame;\n\ntypedef struct CorDebugGuidToTypeMapping\n{\n\tGUID iid;\n\tICorDebugType * pType;\n} CorDebugGuidToTypeMapping;\n\n/*\n * Callback interface for providing access to a particular target process. The\n * debugging services will call functions on this interface to access memory\n * and other data in the target process.  The debugger client must implement\n * this interface as appropriate for the particular target (for example, a live\n * process or a memory dump).  The DataTarget will only be invoked from within\n * the implementation of other ICorDebug APIs (i.e. the debugger client has\n * control over which thread it is invoked on, and when)\n *\n * Error HRESULTS returned by DataTarget APIs will propagate up and be returned\n * by the active ICorDebug API call.\n *\n * The DataTarget implementation must always return up-to-date information\n * about the target.  The target process should be stopped (not changing\n * in any way) while ICorDebug APIs (and hence DataTarget APIs) are being\n * called.  If the target is a live process and it's state changes,\n * OpenVirtualProcess needs to be called again to provide a replacement\n * ICorDebugProcess instance.\n */\n[\n    object,\n    local,\n    uuid(FE06DC28-49FB-4636-A4A3-E80DB4AE116C),\n    pointer_default(unique)\n]\ninterface ICorDebugDataTarget : IUnknown\n{\n    /*\n     * GetPlatform returns the processor architecture and operating system on\n     * which the target process is (or was) running.\n     *\n     * This is used by ICorDebug to determine details of the target process\n     * such as its pointer size, address space layout, register set,\n     * instruction format, context layout, and calling conventions, etc.\n     * This platforms in this list are the only ones supported by this version\n     * of ICorDebug, but more may be added in future versions.\n     *\n     * Note that this may actually indicate the platform which is being\n     * emulated for the target, not the actual hardware in use.  For example,\n     * a process running in the WOW on Windows x64 should use\n     * CORDB_PLATFORM_WINDOWS_X86.\n     *\n     * Implementations should be sure to describe what the platform of the\n     * target actually is, not just what the host expects it to be.\n     *\n     * This function must succeed.  If it fails, the DataTarget is unusable.\n     */\n    typedef enum CorDebugPlatform\n    {\n        CORDB_PLATFORM_WINDOWS_X86,       // Windows on Intel x86\n        CORDB_PLATFORM_WINDOWS_AMD64,     // Windows x64 (Amd64, Intel EM64T)\n        CORDB_PLATFORM_WINDOWS_IA64,      // Windows on Intel IA-64\n        CORDB_PLATFORM_MAC_PPC,           // Mac OS on PowerPC (Deprecated)\n        CORDB_PLATFORM_MAC_X86,           // Mac OS on Intel x86 (Deprecated, use CORDB_PLATFORM_POSIX_X86)\n        CORDB_PLATFORM_WINDOWS_ARM,       // Windows on ARM\n        CORDB_PLATFORM_MAC_AMD64,         // Mac OS on Intel x64 (Deprecated, use CORDB_PLATFORM_POSIX_AMD64)\n        CORDB_PLATFORM_WINDOWS_ARM64,     // Windows on ARM64\n\n        CORDB_PLATFORM_POSIX_AMD64,       // Posix supporting OS on Intel x64\n        CORDB_PLATFORM_POSIX_X86,         // Posix supporting OS on Intel x86\n        CORDB_PLATFORM_POSIX_ARM,         // Posix supporting OS on ARM32\n        CORDB_PLATFORM_POSIX_ARM64,       // Posix supporting OS on ARM64\n        CORDB_PLATFORM_POSIX_LOONGARCH64  // Posix supporting OS on LoongArch64\n    } CorDebugPlatform;\n\n    HRESULT GetPlatform([out] CorDebugPlatform * pTargetPlatform);\n\n    /*\n     * ReadVirtual - Read virtual memory from the target process.\n     *\n     * Requests contiguous memory starting at the specified target address to\n     * be read from the target process into the supplied buffer.  If at least\n     * the first byte (at the specified start address) can be read, the call\n     * should return success (to support efficient reading of data structures\n     * with self-describing length, like null-terminated strings).\n     *\n     * On success, the actual number of bytes read must be stored into\n     * pBytesRead.\n     */\n    HRESULT ReadVirtual([in] CORDB_ADDRESS address,\n                        [out, size_is(bytesRequested), length_is(*pBytesRead)] BYTE * pBuffer,\n                        [in] ULONG32 bytesRequested,\n                        [out] ULONG32 * pBytesRead);\n\n    /*\n     * GetThreadContext - Get the thread context (register values) for a thread.\n     *\n     * Requests the current thread context for the specified (operating-system\n     * defined) thread identifier.  The size and format of the context record\n     * is platform dependant, and is determined by the result of the call to\n     * GetPlatform.\n     *\n     * The context flags specify, in a platform-dependent manor, which portions\n     * of the context should be read.  contextSize specifies the size of the\n     * supplied buffer, but the function is free to not fill the whole buffer\n     * if it is possible to determine the actual size from the context.\n     *\n     * On Windows platforms, the buffer must be a CONTEXT structure appropriate\n     * for the machine type specified by GetPlatform.  contextFlags has the\n     * same values as the ContextFlags field of CONTEXT.\n     */\n    HRESULT GetThreadContext([in] DWORD dwThreadID,\n                             [in] ULONG32 contextFlags,\n                             [in] ULONG32 contextSize,\n                             [out, size_is(contextSize)] BYTE * pContext);\n};\n\n/*\n * Used to retrieve the debug-symbol information for a static field.\n */\n[\n    object,\n    local,\n    uuid(CBF9DA63-F68D-4BBB-A21C-15A45EAADF5B),\n    pointer_default(unique)\n]\ninterface ICorDebugStaticFieldSymbol : IUnknown\n{\n    /*\n     * GetName - gives the name of the static field\n     */\n    HRESULT GetName([in] ULONG32 cchName, [out] ULONG32 *pcchName, [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * GetSize - gives the size of the static field\n     */\n    HRESULT GetSize([out] ULONG32 *pcbSize);\n\n    /*\n     * GetAddress - gives the RVA of the static field\n     */\n    HRESULT GetAddress([out] CORDB_ADDRESS *pRVA);\n}\n\n/*\n * Used to retrieve the debug-symbol information for an instance field.\n */\n[\n    object,\n    local,\n    uuid(A074096B-3ADC-4485-81DA-68C7A4EA52DB),\n    pointer_default(unique)\n]\ninterface ICorDebugInstanceFieldSymbol : IUnknown\n{\n    /*\n     * GetName - gives the name of the instance field\n     */\n    HRESULT GetName([in] ULONG32 cchName, [out] ULONG32 *pcchName, [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * GetSize - gives the size of the instance field\n     */\n    HRESULT GetSize([out] ULONG32 *pcbSize);\n\n    /*\n     * GetOffset - gives the offset of the instance field in its parent class\n     */\n    HRESULT GetOffset([out] ULONG32 *pcbOffset);\n}\n\n/*\n * Used to retrieve the debug-symbol information for a variable.\n */\n[\n    object,\n    local,\n    uuid(707E8932-1163-48D9-8A93-F5B1F480FBB7),\n    pointer_default(unique)\n]\ninterface ICorDebugVariableSymbol : IUnknown\n{\n    /*\n     * GetName - gives the name of the variable\n     */\n    HRESULT GetName([in] ULONG32 cchName, [out] ULONG32 *pcchName, [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * GetSize - gives the size of a variable\n     */\n    HRESULT GetSize([out] ULONG32 *pcbValue);\n\n    /*\n     * GetValue - Used to get the value of a variable as a byte array.\n     *\n     * offset: read the value starting at this offset in variable, this is used when reading member fields in an object\n     * context: thread context used to read the value\n     * cbContext: size of thread context\n     *\n     * cbValue: size of pValue buffer\n     * pcbValue: size of pValue buffer filled with value\n     * pValue: buffer used to hold the read value\n     */\n    HRESULT GetValue([in] ULONG32 offset,\n                     [in] ULONG32 cbContext,\n                     [in, size_is(cbContext)] BYTE context[],\n                     [in] ULONG32 cbValue,\n                     [out] ULONG32 *pcbValue,\n                     [out, size_is(cbValue), length_is(*pcbValue)] BYTE pValue[]);\n\n    /*\n     * SetValue - Given a byte array, sets it as the value of the variable.\n     *\n     * offset: set the value starting at this offset in variable, this is used when writing member fields in an object\n     * threadID: thread id used to indentify the thread whose context must be updated to reflect the new value\n     * context: thread context used to write the value\n     * cbContext: size of thread context\n     *\n     * cbValue: size of pValue buffer\n     * pValue: buffer to hold the value to set\n     */\n    HRESULT SetValue([in] ULONG32 offset,\n                     [in] DWORD threadID,\n                     [in] ULONG32 cbContext,\n                     [in, size_is(cbContext)] BYTE context[],\n                     [in] ULONG32 cbValue,\n                     [in, size_is(cbValue)] BYTE pValue[]);\n\n    /*\n     * GetSlotIndex - Gives the managed slot-index of a local variable.\n     *                This slot-index can be used to retrieve the metadata information for this local.\n     *\n     *                Returns E_FAIL if the variable is a function argument.\n     */\n    HRESULT GetSlotIndex([out] ULONG32 *pSlotIndex);\n}\n\n\n/*\n * Represents an in-memory buffer.\n */\n[\n    object,\n    uuid(677888B3-D160-4B8C-A73B-D79E6AAA1D13),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugMemoryBuffer : IUnknown\n{\n    /*\n     * GetStartAddress - Gives the address where buffer starts.\n     */\n    HRESULT GetStartAddress([out] LPCVOID *address);\n\n    /*\n     * GetStartAddress - Gives the size of memory buffer.\n     */\n    HRESULT GetSize([out] ULONG32 *pcbBufferLength);\n}\n\n/*\n * Used to get information about a merged assembly.\n */\n[\n    object,\n    uuid(FAA8637B-3BBE-4671-8E26-3B59875B922A),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugMergedAssemblyRecord : IUnknown\n{\n    /*\n     * GetSimpleName - Gives the simple name of the assembly (for example \"System.Collections\")\n     *                 These names do not include qualifiers such as file extensions, culture, version, or public key token\n     */\n    HRESULT GetSimpleName([in] ULONG32 cchName, [out] ULONG32 *pcchName, [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * GetVersion - Gives the assembly version information\n     */\n    HRESULT GetVersion([out] USHORT *pMajor, [out] USHORT *pMinor, [out] USHORT *pBuild, [out] USHORT *pRevision);\n\n    /*\n     * GetCulture - Gives culture string for the assembly (for example \"neutral\" or \"en-US\")\n     */\n    HRESULT GetCulture([in] ULONG32 cchCulture, [out] ULONG32 *pcchCulture, [out, size_is(cchCulture), length_is(*pcchCulture)] WCHAR szCulture[]);\n\n    /*\n     * GetPublicKey - Gives the assembly public key\n     */\n    HRESULT GetPublicKey([in] ULONG32 cbPublicKey, [out] ULONG32 *pcbPublicKey, [out, size_is(cbPublicKey), length_is(*pcbPublicKey)] BYTE pbPublicKey[]);\n\n    /*\n     * GetPublicKeyToken - Gives the assembly public key token (the last 8 bytes of a SHA1 hash of the public key)\n     */\n    HRESULT GetPublicKeyToken([in] ULONG32 cbPublicKeyToken, [out] ULONG32 *pcbPublicKeyToken,\n        [out, size_is(cbPublicKeyToken), length_is(*pcbPublicKeyToken)] BYTE pbPublicKeyToken[]);\n\n    /*\n     * GetIndex - Gives prefix index used to prevent name collisions in the merged metadata type names\n     */\n    HRESULT GetIndex([out] ULONG32 *pIndex);\n}\n\n/*\n * Used to retrieve debug symbol information.\n */\n[\n    object,\n    uuid(3948A999-FD8A-4C38-A708-8A71E9B04DBB),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugSymbolProvider : IUnknown\n{\n    /*\n     * GetStaticFieldSymbols - given a typespec signature, gives back its static field symbols\n     */\n    HRESULT GetStaticFieldSymbols([in] ULONG32 cbSignature,\n                                  [in, size_is(cbSignature)]  BYTE typeSig[],\n                                  [in] ULONG32 cRequestedSymbols,\n                                  [out] ULONG32 *pcFetchedSymbols,\n                                  [out, size_is(cRequestedSymbols), length_is(*pcFetchedSymbols)] ICorDebugStaticFieldSymbol *pSymbols[]);\n\n    /*\n     * GetInstanceFieldSymbols - given a typespec signature, gives back its instance field symbols\n     */\n    HRESULT GetInstanceFieldSymbols([in] ULONG32 cbSignature,\n                                    [in, size_is(cbSignature)]  BYTE typeSig[],\n                                    [in] ULONG32 cRequestedSymbols,\n                                    [out] ULONG32 *pcFetchedSymbols,\n                                    [out, size_is(cRequestedSymbols), length_is(*pcFetchedSymbols)] ICorDebugInstanceFieldSymbol *pSymbols[]);\n\n    /*\n     * GetMethodLocalSymbols - given rva in a method, gives back its local symbols\n     */\n    HRESULT GetMethodLocalSymbols([in] ULONG32 nativeRVA,\n                                  [in] ULONG32 cRequestedSymbols,\n                                  [out] ULONG32 *pcFetchedSymbols,\n                                  [out, size_is(cRequestedSymbols), length_is(*pcFetchedSymbols)] ICorDebugVariableSymbol *pSymbols[]);\n\n    /*\n     * GetMethodParameterSymbols - given rva in a method, gives back its parameter symbols\n     */\n    HRESULT GetMethodParameterSymbols([in] ULONG32 nativeRVA,\n                                      [in] ULONG32 cRequestedSymbols,\n                                      [out] ULONG32 *pcFetchedSymbols,\n                                      [out, size_is(cRequestedSymbols), length_is(*pcFetchedSymbols)] ICorDebugVariableSymbol *pSymbols[]);\n\n    /*\n     *  GetMergedAssemblyRecords - gets symbol records for all the merged assemblies\n     */\n    HRESULT GetMergedAssemblyRecords([in] ULONG32 cRequestedRecords,\n                                     [out] ULONG32 *pcFetchedRecords,\n                                     [out, size_is(cRequestedRecords), length_is(*pcFetchedRecords)] ICorDebugMergedAssemblyRecord *pRecords[]);\n\n    /*\n     * GetMethodProps - given an rva in a method, gives back the\n     *                  pMethodToken - method's token\n     *                  pcGenericParams - number of generic parameters associated with this method\n     *                  cbSignature - size of signature array, set to 0 and pass signature as NULL to get the actual size in pcbSignature\n     *                  pcbSignature - returned size of signature\n     *                  signature - buffer to hold the type-spec signatures of all generic parameters\n     */\n    HRESULT GetMethodProps([in]  ULONG32 codeRva,\n                           [out] mdToken *pMethodToken,\n                           [out] ULONG32 *pcGenericParams,\n                           [in]  ULONG32 cbSignature,\n                           [out] ULONG32 *pcbSignature,\n                           [out, size_is(cbSignature), length_is(*pcbSignature)] BYTE signature[]);\n\n    /*\n     * GetTypeProps - given a vtable rva, gives back the\n     *                cbSignature - size of signature array, set to 0 and pass signature as NULL to get the actual size in pcbSignature\n     *                pcbSignature - returned size of signature\n     *                signature - buffer to hold the signature of type corresponding to input vtableRva\n     */\n    HRESULT GetTypeProps([in]  ULONG32 vtableRva,\n                         [in]  ULONG32 cbSignature,\n                         [out] ULONG32 *pcbSignature,\n                         [out, size_is(cbSignature), length_is(*pcbSignature)] BYTE signature[]);\n\n    /*\n     * GetCodeRange - given rva in a method, gives back the method start address and size.\n     */\n    HRESULT GetCodeRange([in] ULONG32 codeRva, [out] ULONG32* pCodeStartAddress, ULONG32* pCodeSize);\n\n    /*\n     * GetAssemblyImageBytes - given an RVA in the merged assembly and size, reads data from the merged assembly and gives it back as an ICorDebugMemoryBuffer\n     */\n    HRESULT GetAssemblyImageBytes([in] CORDB_ADDRESS rva, [in] ULONG32 length, [out] ICorDebugMemoryBuffer** ppMemoryBuffer);\n\n    /*\n     * GetObjectSize - given a typespec signature, gives back its object size\n     */\n    HRESULT GetObjectSize([in] ULONG32 cbSignature,\n                          [in, size_is(cbSignature)]  BYTE typeSig[],\n                          [out] ULONG32 *pObjectSize);\n\n    /*\n     * GetAssemblyImageMetadata - gives back the merged assembly metadata as an ICorDebugMemoryBuffer\n     */\n    HRESULT GetAssemblyImageMetadata([out] ICorDebugMemoryBuffer** ppMemoryBuffer);\n}\n\n/*\n * Used to retrieve debug symbol information.\n */\n[\n    object,\n    uuid(F9801807-4764-4330-9E67-4F685094165E),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugSymbolProvider2 : IUnknown\n{\n    /*\n     * Gives back the generic dictionary map as an ICorDebugMemoryBuffer\n     *\n     * At the highest level, the map consists of two sections.\n     * The first section contains a \"directory\" of all dictionaries (RVA) covered by this map, the second section\n     * is a byte aligned heap with instantiation information starting right after the last directory entry.\n     * Each entry in the \"directory\" refers to an offset inside the \"heap\" (relative to the start of the heap).\n     * Please note that it is possible that multiple directory entries point to the same offset into the heap.\n     *\n     * Contents of the map:\n     *\n     *  - First 4 bytes: number of RVA/dictionary entries (N)\n     *    If the high bit is set, the following N entries are sorted by RVA in ascending order.\n     *\n     *  - N 8 byte wide entries, each entry consisting of 2 4-byte entries:\n     *    1st 4 byte entry - RVA:    the dictionary's RVA\n     *    2nd 4 byte entry - Offset: an offset relative to the start of the heap.\n     *\n     *  - Heap\n     *\n     * The heap's size can be computed be a stream reader by subtracting the directory size + 4.\n     *\n     * The format for each instantiation info in heap is as follows:\n     *  - Length of this instantiation info (in bytes, not including this length information) in compressed ECMA metadata format.\n     *  - Number of instantiation types (T, in compressed ECMA metadata format)\n     *  - T types, each expressed in ECMA type signature format\n     *\n     * The inclusion of the length for each heap element enables simple sorting of the directory section without affecting the heap.\n     */\n    HRESULT GetGenericDictionaryInfo([out] ICorDebugMemoryBuffer** ppMemoryBuffer);\n\n    /*\n     * GetFrameProps:\n     * For a given code-rva, gives the method start rva (pCodeStartRva) and parent\n     * frame's start rva (pParentFrameStartRva).\n     * If there is no parent frame, then pParentFrameStartRva is set to 0\n     */\n    HRESULT GetFrameProps([in] ULONG32 codeRva,\n        [out] ULONG32 *pCodeStartRva,\n        [out] ULONG32 *pParentFrameStartRva);\n}\n\n/*\n * Implemented by the debugger and helps in stack unwinding.\n */\n[\n    object,\n    uuid(F69126B7-C787-4F6B-AE96-A569786FC670),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugVirtualUnwinder : IUnknown\n{\n    /*\n     * Get the current context of this unwinder.\n     *\n     * contextBuf is passed in by ICorDebugStackWalk.  As unwinding may only restore a subset of the\n     * registers, such as only non-volatile registers, the context may not exactly match the register\n     * state at the time of the actual call.\n     *\n     * Any failing HRESULT received by mscordbi is considered fatal and will cause ICorDebug\n     * APIs to return CORDBG_E_DATA_TARGET_ERROR.\n     */\n    HRESULT GetContext([in] ULONG32 contextFlags,\n                       [in] ULONG32 cbContextBuf,\n                       [out] ULONG32* contextSize,\n                       [out, size_is(cbContextBuf)] BYTE contextBuf[]);\n\n    /*\n     * Advances to the callers context.\n     *\n     * If a failing HRESULT is returned ICorDebug APIs will return CORDBG_E_DATA_TARGET_ERROR.\n     * If the unwind can not be completed because there are no more frames the unwinder should\n     * return CORDBG_S_AT_END_OF_STACK.\n     * If the unwind occurred successfully return S_OK.\n     *\n     * The stackwalker should ensure forward progress is being made, so that eventually a call\n     * to Next() will return a failing HRESULT or CORDBG_S_AT_END_OF_STACK. Returning S_OK\n     * indefinitely may cause an infinite loop.\n     */\n    HRESULT Next();\n}\n\n\n[\n    object,\n    uuid(2eb364da-605b-4e8d-b333-3394c4828d41),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugDataTarget2 : IUnknown\n{\n    /*\n     * GetImageFromPointer:\n     * Given address in a module, gives back the module base address and size.\n     */\n    HRESULT GetImageFromPointer([in] CORDB_ADDRESS addr, [out] CORDB_ADDRESS *pImageBase, [out] ULONG32 *pSize);\n\n    /*\n     * GetImageLocation:\n     * Given module base address, gives back the module's path.\n     */\n    HRESULT GetImageLocation([in] CORDB_ADDRESS baseAddress,\n                             [in] ULONG32 cchName,\n                             [out] ULONG32 *pcchName,\n                             [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * GetImageLocation:\n     * Given address in a module, gives back a symbol-provider for the module.\n     */\n    HRESULT GetSymbolProviderForImage([in] CORDB_ADDRESS imageBaseAddress, [out] ICorDebugSymbolProvider **ppSymProvider);\n\n    /*\n     * EnumerateThreadIDs:\n     * Gives back the list of active thread ids.\n     */\n    HRESULT EnumerateThreadIDs([in] ULONG32 cThreadIds, [out] ULONG32 *pcThreadIds, [out, size_is(cThreadIds), length_is(*pcThreadIds)] ULONG32 pThreadIds[]);\n\n    /*\n     * CreateVirtualUnwinder:\n     * Create a new stack unwinder that starts unwinding from initialContext (which isn't\n     * necessarily the leaf of a thread).\n     * Any failing HRESULT received by mscordbi is considered fatal and will cause ICorDebug\n     * APIs to return CORDBG_E_DATA_TARGET_ERROR.\n     */\n    HRESULT CreateVirtualUnwinder([in] DWORD nativeThreadID,\n                                  [in] ULONG32 contextFlags,\n                                  [in] ULONG32 cbContext,\n                                  [in, size_is(cbContext)] BYTE initialContext[],\n                                  [out] ICorDebugVirtualUnwinder ** ppUnwinder);\n};\n\n\n/*\n * Provides the information about a loaded module.\n * Note that this interface is implemented by debugger and is used by DBI to get\n * the loaded module information from debugger.\n */\n[\n    object,\n    uuid(817F343A-6630-4578-96C5-D11BC0EC5EE2),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugLoadedModule : IUnknown\n{\n    /*\n     * gives the base address\n     */\n    HRESULT GetBaseAddress([out] CORDB_ADDRESS *pAddress);\n\n    /*\n     * gives the module name\n     */\n    HRESULT GetName([in] ULONG32 cchName,\n        [out] ULONG32 *pcchName,\n        [out, size_is(cchName),\n        length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * gives the module size\n     */\n    HRESULT GetSize([out] ULONG32 *pcBytes);\n};\n\n[\n    object,\n    uuid(D05E60C3-848C-4E7D-894E-623320FF6AFA),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugDataTarget3 : IUnknown\n{\n    /*\n     * gives back the list of modules loaded so far.\n     */\n    HRESULT GetLoadedModules([in] ULONG32 cRequestedModules,\n                             [out] ULONG32 *pcFetchedModules,\n                             [out, size_is(cRequestedModules),\n                             length_is(*pcFetchedModules)] ICorDebugLoadedModule *pLoadedModules[]);\n};\n\n/*\n * Data target that knows how to obtain debugee's process id.\n * Debugee is not necessarily a living process at that time or on the same machine.\n */\n[\n    object,\n    uuid(E799DC06-E099-4713-BDD9-906D3CC02CF2),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugDataTarget4 : IUnknown\n{\n    /*\n     * Unwinds one native stack frame in the target process/thread\n     */\n    HRESULT VirtualUnwind([in] DWORD threadId,\n                          [in] ULONG32 contextSize,\n                          [in, out, size_is(contextSize)] BYTE *context);\n};\n\n/*\n * Mutable extension to the data target.  This version of ICorDebugDataTarget\n * can be implemented by targets that wish to support modification of the target\n * process (such as for live invasive debugging).\n *\n * All of these APIs are optional in the sense that no core inspection-based\n * debugging functionality will be lost by not implementing this interface or\n * by the failure of these methods.  Any failure HRESULT from these APIs will\n * propagate out as the HRESULT from the ICorDebug API call.\n *\n * Note that a single ICorDebug API call may result in multiple mutations,\n * and there is no mechanism for ensuring related mutations are applied\n * transactionally (all-or-none).  This means that if a mutation fails after\n * others (for the same ICorDebug call) have succeeded, the target process may\n * be left in an inconsistent state and debugging may become unreliable.\n  */\n[\n    object,\n    uuid(A1B8A756-3CB6-4CCB-979F-3DF999673A59),\n    local,\n    pointer_default(unique)\n]\ninterface ICorDebugMutableDataTarget : ICorDebugDataTarget\n{\n    /*\n     * WriteVirtual - write memory into the target process address space\n     *\n     * Write the specified buffer into the target process at the specified\n     * address.  If any bytes cannot be written, the call should fail without\n     * changing any bytes in the target (otherwise the target may be in an\n     * inconsistent state which makes further debugging unreliable).\n     */\n    HRESULT WriteVirtual([in] CORDB_ADDRESS address,\n                         [in, size_is(bytesRequested)] const BYTE * pBuffer,\n                         [in] ULONG32 bytesRequested);\n\n    /*\n     * SetThreadContext - set the context (register values) for a thread.\n     *\n     * Updates the current context for the thread specified by the (OS-defined)\n     * dwThreadID.  The format of the context record is determined by the platform\n     * indicated by GetPlatform.  On Windows, this is a CONTEXT structure.\n     * contextSize specifies the size of the buffer being passed.\n     */\n    HRESULT SetThreadContext([in] DWORD dwThreadID,\n                             [in] ULONG32 contextSize,\n                             [in, size_is(contextSize)] const BYTE * pContext);\n\n    /*\n     * Invoke to change the continue-status for the outstanding debug-event on\n     * the specified thread.\n     *\n     * Arguments:\n     *        dwThreadId - OS Thread Id of the debug event\n     *    continueStatus - New continue status being requested.  See the\n     *                     definition of CORDB_CONTINUE_STATUS for details.\n     *\n     * This API is used when the Debugger makes an ICorDebug API request\n     * which requires the current debug event to be handled in a way that is\n     * potentially different from which it would be otherwise.  For example,\n     * if there is an outstanding exception, and the debugger requests an\n     * operation that would cancel the exception (such as SetIp or FuncEval),\n     * than this API is used to request the exception be cancelled.\n     */\n    HRESULT ContinueStatusChanged([in] DWORD dwThreadId,\n                                  [in] CORDB_CONTINUE_STATUS continueStatus);\n\n};\n\n\n/*\n * Interface used by the data access services layer to locate metadata\n * of assemblies in a target.\n *\n * The API client must implement this interface as appropriate for the\n * particular target (for example, a live process or a memory dump).\n *\n */\n[\n    object,\n    local,\n    uuid(7cef8ba9-2ef7-42bf-973f-4171474f87d9),\n    pointer_default(unique)\n]\ninterface ICorDebugMetaDataLocator : IUnknown\n{\n    /*\n     * Ask the debugger to return the full path to a module whose metadata is\n     *  needed to complete an operation the debugger requested.\n     *\n     * Arguments:\n     *  wszImagePath - This buffer will always contain a NULL-terminated string\n     *      representing the full path to the file when available, and the\n     *      FileName.extension otherwise.\n     *  dwImageTimeStamp - The TimeStamp from the image's PE headers; can\n     *      potentially be used for a symsrv lookup.\n     *  dwImageSize - Size of the image from PE headers; potentially used for\n     *      a symsrv lookup.\n     *  cchPathBuffer - The count of WCHARs pointed to by wszPathBuffer.\n     *  pcchPathBuffer - When the callee returns E_NOT_SUFFICIENT_BUFFER, contains\n     *      the count of WCHARs needed to store the path.\n     *      For all other return values, pcchPathBuffer contains the count of\n     *      WCHARs written to wszPathBuffer.\n     *  wszPathBuffer - Pointer to a buffer into which the debugger will copy\n     *      the full path to the file containing the requested metadata.\n     *      CorOpenFlags.ofReadOnly access to the metadata in this file will\n     *      be requested.\n     *\n     * Assumptions:\n     *  The returned file represents a Windows module containing the metadata\n     *  needed to complete a request made by the debugger.\n     *\n     * Return Value:\n     *  S_OK on success.  wszPathBuffer contains the full path to the file and\n     *      is NULL-terminated.\n     *\n     *  E_NOT_SUFFICIENT_BUFFER if the current size of wszPathBuffer is not\n     *      sufficient to hold the full path.  pcchPathBuffer will contain the\n     *      needed count of WCHARs, including the terminating NULL.\n     *      In this case GetMetaData will be called a second time with the\n     *      requested buffer size.\n     *\n     *  All other failure HRESULTs are interpreted to mean that the file\n     *  is not retrievable.\n     *\n     * Notes:\n     *  If wszImagePath contains a full path for a module from a dump, that\n     *  path will be the path from the machine where the dump was collected.\n     *  The file may not exist at this location, or an incorrect file with the\n     *  same name may be stored on the path.\n     */\n    HRESULT GetMetaData( [in] LPCWSTR wszImagePath,\n                         [in] DWORD   dwImageTimeStamp,\n                         [in] DWORD   dwImageSize,\n                         [in] ULONG32 cchPathBuffer,\n                         [out, annotation(\"_Out_\")] ULONG32 * pcchPathBuffer,\n                         [out, size_is(cchPathBuffer), length_is(*pcchPathBuffer), annotation(\"_Out_writes_to_(cchPathBuffer, *pcchPathBuffer) \")] WCHAR wszPathBuffer[]);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * User Callback interface\n * ------------------------------------------------------------------------- */\n\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* disable warning 28718 for interface ICorDebugManagedCallback */\n/*\n * ICorDebugManagedCallback is implemented by the user of the\n * ICorDebug interfaces in order to respond to events in managed code\n * in the debuggee process.\n * This interface handles manage debug events from v1.0/v1.1\n */\n\n[\n    object,\n    local,\n    uuid(3d6f5f60-7538-11d3-8d5b-00104b35e7ef),\n    pointer_default(unique)\n]\ninterface ICorDebugManagedCallback : IUnknown\n{\n    /*\n     * All callbacks are called with the process in the synchronized state\n     * All callbacks are serialized, and are called in the same thread.\n     * Each callback implementor must call Continue in a callback to\n     *      resume execution.\n     * If Continue is not called before returning, the process will\n     * remain stopped. Continue must later be called before any more\n     * event callbacks will happen.\n     *\n     */\n\n    /*\n     * Breakpoint is called when a breakpoint is hit.\n     */\n\n    HRESULT Breakpoint([in] ICorDebugAppDomain *pAppDomain,\n                       [in] ICorDebugThread *pThread,\n                       [in] ICorDebugBreakpoint *pBreakpoint);\n\n    /*\n     * StepComplete is called when a step has completed.  The stepper\n     * may be used to continue stepping if desired (except for TERMINATE\n     * reasons.)\n     *\n     * STEP_NORMAL means that stepping completed normally, in the same\n     *      function.\n     *\n     * STEP_RETURN means that stepping continued normally, after the function\n     *      returned.\n     *\n     * STEP_CALL means that stepping continued normally, at the start of\n     *      a newly called function.\n     *\n     * STEP_EXCEPTION_FILTER means that control passed to an exception filter\n     *      after an exception was thrown.\n     *\n     * STEP_EXCEPTION_HANDLER means that control passed to an exception handler\n     *      after an exception was thrown.\n     *\n     * STEP_INTERCEPT means that control passed to an interceptor.\n     *\n     * STEP_EXIT means that the thread exited before the step completed.\n     *      No more stepping can be performed with the stepper.\n     */\n\n    typedef enum CorDebugStepReason\n    {\n        STEP_NORMAL,\n        STEP_RETURN,\n        STEP_CALL,\n        STEP_EXCEPTION_FILTER,\n        STEP_EXCEPTION_HANDLER,\n        STEP_INTERCEPT,\n        STEP_EXIT\n    } CorDebugStepReason;\n\n    HRESULT StepComplete([in] ICorDebugAppDomain *pAppDomain,\n                         [in] ICorDebugThread *pThread,\n                         [in] ICorDebugStepper *pStepper,\n                         [in] CorDebugStepReason reason);\n\n    /*\n     * Break is called when a break opcode in the code stream is\n     * executed.\n     */\n\n    HRESULT Break([in] ICorDebugAppDomain *pAppDomain,\n                  [in] ICorDebugThread *thread);\n\n    /*\n     * Exception is called when an exception is thrown from managed\n     * code, The specific exception can be retrieved from the thread object.\n     *\n     * If unhandled is FALSE, this is a \"first chance\" exception that\n     * hasn't had a chance to be processed by the application.  If\n     * unhandled is TRUE, this is an unhandled exception which will\n     * terminate the process.\n     */\n\n    HRESULT Exception([in] ICorDebugAppDomain *pAppDomain,\n                      [in] ICorDebugThread *pThread,\n                      [in] BOOL unhandled);\n\n    /*\n     * EvalComplete is called when an evaluation is completed.\n     */\n\n    HRESULT EvalComplete([in] ICorDebugAppDomain *pAppDomain,\n                         [in] ICorDebugThread *pThread,\n                         [in] ICorDebugEval *pEval);\n\n    /*\n     * EvalException is called when an evaluation terminates with\n     * an unhandled exception.\n     */\n\n    HRESULT EvalException([in] ICorDebugAppDomain *pAppDomain,\n                          [in] ICorDebugThread *pThread,\n                          [in] ICorDebugEval *pEval);\n\n    /*\n     * CreateProcess is called when a process is first attached to or\n     * started.\n     *\n     * This entry point won't be called until the EE is initialized.\n     * Most of the ICorDebug API will return CORDBG_E_NOTREADY prior\n     * to the CreateProcess callback.\n     */\n\n    HRESULT CreateProcess([in] ICorDebugProcess *pProcess);\n\n    /*\n     * ExitProcess is called when a process exits.\n     *\n     * Note: you don't Continue from an ExitProcess event, and this\n     * event may fire asynchronously to other events, while the\n     * process appears to be stopped. This can occur if the process\n     * dies while stopped, usually due to some external force.\n     *\n     * If the CLR is already dispatching a managed callback, this event\n     * will be delayed until after that callback has returned.\n     *\n     * This is the only exit/unload event that is guaranteed to get called\n     * on shutdown.\n     */\n\n    HRESULT ExitProcess([in] ICorDebugProcess *pProcess);\n\n    /*\n     * CreateThread is called when a thread first begins executing managed\n     * code. The thread will be positioned immediately at the first\n     * managed code to be executed.\n     */\n\n    HRESULT CreateThread([in] ICorDebugAppDomain *pAppDomain,\n                         [in] ICorDebugThread *thread);\n\n    /*\n     * ExitThread is called when a thread which has run managed code exits.\n     * Once this callback is fired, the thread no longer will appear in thread enumerations.\n     */\n\n    HRESULT ExitThread([in] ICorDebugAppDomain *pAppDomain,\n                       [in] ICorDebugThread *thread);\n\n    /*\n     * LoadModule is called when a Common Language Runtime module is successfully\n     * loaded. This is an appropriate time to examine metadata for the\n     * module, set JIT compiler flags, or enable or disable\n     * class loading callbacks for the module.\n     */\n\n    HRESULT LoadModule([in] ICorDebugAppDomain *pAppDomain,\n                       [in] ICorDebugModule *pModule);\n\n    /*\n     * UnloadModule is called when a Common Language Runtime module (DLL) is unloaded. The module\n     * should not be used after this point.\n     */\n\n    HRESULT UnloadModule([in] ICorDebugAppDomain *pAppDomain,\n                         [in] ICorDebugModule *pModule);\n\n    /*\n     * LoadClass is called when a class finishes loading.  This callback only\n     * occurs if ClassLoading has been enabled for the class's module.\n     *\n     * ClassLoading is always enabled for dynamic modules. This is a good time\n     * to update symbols (ICorDebugModule3::CreateReaderForInMemorySymbols) and\n     * bind breakpoints to newly generated classes in dynamic modules.\n     */\n\n    HRESULT LoadClass([in] ICorDebugAppDomain *pAppDomain,\n                      [in] ICorDebugClass *c);\n\n    /*\n     * UnloadClass is called immediately before a class is unloaded. The class\n     * should not be referenced after this point. This callback only occurs if\n     * ClassLoading has been enabled for the class's module.\n     */\n\n    HRESULT UnloadClass([in] ICorDebugAppDomain *pAppDomain,\n                        [in] ICorDebugClass *c);\n\n    /*\n     * DebuggerError is called when an error occurs while attempting to\n     * handle an event from the Common Language Runtime. It is very strongly\n     * advised that debuggers log this message to the end user because\n     * this callback indicates the debugging services have been disabled due to\n     * an error.\n     *\n     * ICorDebugProcess::GetID() will be safe to call, but all other APIs should\n     * not be called and will fail if they are.\n     * This includes ICorDebugProcess::Terminate and ICorDebug  Process::Detach. The\n     * debugger should use OS facilities for terminating processes to shut down the process.\n     */\n    HRESULT DebuggerError([in] ICorDebugProcess *pProcess,\n                          [in] HRESULT errorHR,\n                          [in] DWORD errorCode);\n\n\n    /*\n     * Enum defining log message LoggingLevels\n     */\n    typedef enum LoggingLevelEnum\n    {\n        LTraceLevel0 = 0,\n        LTraceLevel1,\n        LTraceLevel2,\n        LTraceLevel3,\n        LTraceLevel4,\n        LStatusLevel0 = 20,\n        LStatusLevel1,\n        LStatusLevel2,\n        LStatusLevel3,\n        LStatusLevel4,\n        LWarningLevel = 40,\n        LErrorLevel = 50,\n        LPanicLevel = 100\n    } LoggingLevelEnum;\n\n\n    typedef enum LogSwitchCallReason\n    {\n        SWITCH_CREATE,\n        SWITCH_MODIFY,\n        SWITCH_DELETE\n    } LogSwitchCallReason;\n\n\n    /*\n     * LogMessage is called when a Common Language Runtime managed thread calls the Log\n     * class in the System.Diagnostics package to log an event.\n     */\n    HRESULT LogMessage([in] ICorDebugAppDomain *pAppDomain,\n                       [in] ICorDebugThread *pThread,\n                       [in] LONG lLevel,\n                       [in] WCHAR *pLogSwitchName,\n                       [in] WCHAR *pMessage);\n\n    /*\n     * LogSwitch is called when a Common Language Runtime managed thread calls the LogSwitch\n     * class in the System.Diagnostics package to create/modify a LogSwitch.\n     */\n    HRESULT LogSwitch([in] ICorDebugAppDomain *pAppDomain,\n                      [in] ICorDebugThread *pThread,\n                      [in] LONG lLevel,\n                      [in] ULONG ulReason,\n                      [in] WCHAR *pLogSwitchName,\n                      [in] WCHAR *pParentName);\n\n    /*\n     * CreateAppDomain is called when an app domain is created.\n     */\n    HRESULT CreateAppDomain([in] ICorDebugProcess *pProcess,\n                            [in] ICorDebugAppDomain *pAppDomain);\n\n    /*\n     * ExitAppDomain is called when an app domain exits.\n     */\n    HRESULT ExitAppDomain([in] ICorDebugProcess *pProcess,\n                          [in] ICorDebugAppDomain *pAppDomain);\n\n\n    /*\n     * LoadAssembly is called when a Common Language Runtime assembly is successfully\n     * loaded.\n     */\n    HRESULT LoadAssembly([in] ICorDebugAppDomain *pAppDomain,\n                         [in] ICorDebugAssembly *pAssembly);\n\n    /*\n     * UnloadAssembly is called when a Common Language Runtime assembly is unloaded. The assembly\n     * should not be used after this point.\n     */\n    HRESULT UnloadAssembly([in] ICorDebugAppDomain *pAppDomain,\n                           [in] ICorDebugAssembly *pAssembly);\n\n    /*\n     * ControlCTrap is called if a CTRL-C is trapped in the process being\n     * debugged. All appdomains within the process are stopped for\n     * this callback.\n     * Return values:\n     *      S_OK    : Debugger will handle the ControlC Trap\n     *      S_FALSE : Debugger won't handle the ControlC Trap\n     */\n    HRESULT ControlCTrap([in] ICorDebugProcess *pProcess);\n\n    /*\n     * NameChange() is called if either an AppDomain's or\n     * Thread's name changes.\n     */\n    HRESULT NameChange([in] ICorDebugAppDomain *pAppDomain,\n                       [in] ICorDebugThread *pThread);\n\n    /*\n     * UpdateModuleSymbols is called when PDB debug symbols are available for an\n     * in-memory module. This is a debugger's chance to load the symbols\n     * (using ISymUnmanagedBinder::GetReaderForStream), and bind source-level\n     * breakpoints for the module.\n     *\n     * This callback is no longer dispatched for dynamic modules.  Instead,\n     * debuggers should call ICorDebugModule3::CreateReaderForInMemorySymbols\n     * to obtain a symbol reader for a dynamic module.\n     */\n    HRESULT UpdateModuleSymbols([in] ICorDebugAppDomain *pAppDomain,\n                                [in] ICorDebugModule *pModule,\n                                [in] IStream *pSymbolStream);\n\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT EditAndContinueRemap([in] ICorDebugAppDomain *pAppDomain,\n                                 [in] ICorDebugThread *pThread,\n                                 [in] ICorDebugFunction *pFunction,\n                                 [in] BOOL fAccurate);\n\n    /*\n     * BreakpointSetError is called if the CLR was unable to accuratley bind a breakpoint that\n     * was set before a function was JIT compiled. The given breakpoint will never be hit. The\n     * debugger should deactivate it and rebind it appropiatley.\n     */\n    HRESULT BreakpointSetError([in] ICorDebugAppDomain *pAppDomain,\n                               [in] ICorDebugThread *pThread,\n                               [in] ICorDebugBreakpoint *pBreakpoint,\n                               [in] DWORD dwError);\n};\n#pragma warning(pop)\n\n#pragma warning(push)\n\n[\n    object,\n    local,\n    uuid(264EA0FC-2591-49AA-868E-835E6515323F),\n    pointer_default(unique)\n]\n\ninterface ICorDebugManagedCallback3 : IUnknown\n{\n    /* Callback indicating an enabled custom debugger notification has been\n     * raised. pThread points to the thread that issued the notification.\n     * A subsequent call to GetCurrentCustomDebuggerNotification will retrieve the object that was passed to\n     * System.Diagnostics.Debugger.CustomNotification, whose type will be one\n     * that has been enabled via SetEnableCustomNotification.\n     * Note that this will return non-null if and only if we are currently inside a CustomNotification\n     * callback.\n     * The debugger can read type-specific parameters from fields of the data\n     * object, and store responses into fields.\n     * ICorDebug imposes no policy on the types of notifications or their\n     * contents, and their semantics are strictly a contract between\n     * debuggers and applications/frameworks.\n     */\n    HRESULT CustomNotification([in] ICorDebugThread * pThread, [in] ICorDebugAppDomain * pAppDomain);\n}\n\n[\n    object,\n    local,\n    uuid(322911AE-16A5-49BA-84A3-ED69678138A3),\n    pointer_default(unique)\n]\n\ninterface ICorDebugManagedCallback4 : IUnknown\n{\n    //\n    // Callback indicating a garbage collection is about to start.\n    //\n    // Parameters\n    //   pProcess - the process that is going to perform garbage collection.\n    //\n    // Returns\n    //   S_OK - on success\n    //\n    HRESULT BeforeGarbageCollection([in] ICorDebugProcess* pProcess);\n\n    //\n    // Callback indicating a garbage collection is about to complete.\n    //\n    // Parameters\n    //   pProcess - the process that is going to complete garbage collection.\n    //\n    // Returns\n    //   S_OK - on success\n    //\n    HRESULT AfterGarbageCollection([in] ICorDebugProcess* pProcess);\n\n    //\n    // Callback indicating a data breakpoint is hit\n    //\n    // Parameters\n    //   pProcess    - the process that hits the data breakpoint\n    //   pThread     - the thread that hits the data breakpoint\n    //   pContext    - a pointer to the CONTEXT structure\n    //   contextSize - the size of the CONTEXT structure\n    //\n    // Returns\n    //   S_OK - on success\n    //\n    HRESULT DataBreakpoint([in] ICorDebugProcess* pProcess, [in] ICorDebugThread* pThread, [in] BYTE* pContext, [in] ULONG32 contextSize);\n}\n\n#pragma warning(disable:28718)\t/* disable warning 28718 for interface ICorDebugManagedCallback2 */\n\n/*\n  * ICorDebugManagedCallback2 is a logical extension to ICorDebugManagedCallback.\n  * This handles new debug events introduced in V2.0. A debugger's callback object\n  * to ICorDebug::SetManagedHandler must implement this interface if it is debugging v2.0 apps.\n  */\n[\n    object,\n    local,\n    uuid(250E5EEA-DB5C-4C76-B6F3-8C46F12E3203),\n    pointer_default(unique)\n]\ninterface ICorDebugManagedCallback2 : IUnknown\n{\n\n   /*\n     * FunctionRemapOpportunity is fired whenever execution reaches a sequence point in an older version\n     * of an edited function. This event gives the debugger an opportunity to remap the IP to its proper\n     * place in the new version by calling ICorDebugILFrame2::RemapFunction. If the debugger does not call\n     * RemapFunction before calling Continue, the runtime will continue executing the old code and will\n     * fire another FunctionRemapOpportunity callback at the next sequence point\n     */\n    HRESULT FunctionRemapOpportunity([in] ICorDebugAppDomain *pAppDomain,\n                                     [in] ICorDebugThread *pThread,\n                                     [in] ICorDebugFunction *pOldFunction,\n                                     [in] ICorDebugFunction *pNewFunction,\n                                     [in] ULONG32 oldILOffset);\n\n    /*\n     * CreateConnection is called when a new connection is created.\n     */\n    HRESULT CreateConnection([in] ICorDebugProcess *pProcess,\n                             [in] CONNID dwConnectionId,\n                             [in] WCHAR *pConnName);\n\n    /*\n     * ChangeConnection is called when a connection's set of tasks changes.\n     */\n    HRESULT ChangeConnection([in] ICorDebugProcess *pProcess,\n                             [in] CONNID dwConnectionId );\n\n    /*\n     * DestroyConnection is called when a connection is ended.\n     */\n    HRESULT DestroyConnection([in] ICorDebugProcess *pProcess,\n                              [in] CONNID dwConnectionId );\n\n\n\n\n\n\n    typedef enum CorDebugExceptionCallbackType\n    {\n        DEBUG_EXCEPTION_FIRST_CHANCE = 1,        /* Fired when exception thrown */\n        DEBUG_EXCEPTION_USER_FIRST_CHANCE = 2,   /* Fired when search reaches first user code */\n        DEBUG_EXCEPTION_CATCH_HANDLER_FOUND = 3, /* Fired if & when search finds a handler */\n        DEBUG_EXCEPTION_UNHANDLED = 4            /* Fired if search doesnt find a handler */\n    } CorDebugExceptionCallbackType;\n\n\n    typedef enum CorDebugExceptionFlags\n    {\n        DEBUG_EXCEPTION_NONE = 0,\n        DEBUG_EXCEPTION_CAN_BE_INTERCEPTED = 0x0001 /* Indicates interceptable exception */\n    } CorDebugExceptionFlags;\n\n\n    /*\n     * Exception is called at various points during the search phase of the\n     * exception-handling process.  The exception being processed can be\n     * retrieved from the ICorDebugThread.\n     */\n    HRESULT Exception( [in] ICorDebugAppDomain *pAppDomain,\n                       [in] ICorDebugThread *pThread,\n                       [in] ICorDebugFrame *pFrame,\n                       [in] ULONG32 nOffset,\n                       [in] CorDebugExceptionCallbackType dwEventType,\n                       [in] DWORD dwFlags );\n\n\n    typedef enum CorDebugExceptionUnwindCallbackType\n    {\n        DEBUG_EXCEPTION_UNWIND_BEGIN = 1, /* Fired at the beginning of the unwind */\n        DEBUG_EXCEPTION_INTERCEPTED = 2   /* Fired after an exception has been intercepted */\n    } CorDebugExceptionUnwindCallbackType;\n\n\n\n    /*\n     * For non-intercepted exceptions, ExceptionUnwind is called at the beginning of the second pass\n     * when we start to unwind the stack.  For intercepted exceptions, ExceptionUnwind is called when\n     * the interception is complete, conceptually at the end of the second pass.\n     *\n     * dwFlags is not currently used.\n     */\n    HRESULT ExceptionUnwind( [in] ICorDebugAppDomain *pAppDomain,\n                             [in] ICorDebugThread *pThread,\n                             [in] CorDebugExceptionUnwindCallbackType dwEventType,\n                             [in] DWORD dwFlags );\n\n    /*\n     * FunctionRemapComplete is fired whenever execution has completed switching over to a\n     * new version of an edited function (as requested by a call to ICorDebugILFrame2::RemapFunction).\n     * At this point (and no sooner) steppers can be added to that new version of the function.\n     */\n    HRESULT FunctionRemapComplete([in] ICorDebugAppDomain *pAppDomain,\n                                                                    [in] ICorDebugThread *pThread,\n                                                                    [in] ICorDebugFunction *pFunction);\n\n    // Notification that an Managed Debug Assistant (MDA) was hit in the debuggee process.\n    // - MDAs are heuristic warnings and do not require any explicit debugger action (other than continue, of course) for proper functionality.\n    // - The CLR can change what MDAs are fired (and what data is in any given MDA) at any point.\n    // - Therefore, debuggers should not build any specific functionality requiring specific MDAs patterns.\n    // - MDAs may be queued and fired \"after the fact\". This could happen if the runtime needs to slip from when an\n    //   MDA occurs to get to a safe point for firing it. It also means the runtime reserves the right to fire a bunch of MDAs\n    //   in a single set of callback queue (similar for what we do w/ attach events).\n    //\n    // See the MDA documentation for how to enable / disable notifications.\n    //\n    // Parameters:\n    // - pController is the controller object (process or appdomain) that the MDA occurred in.\n    //     Clients should not make any assumption about whether the controller is a process or appdomain (though they can\n    //     always QI to find out).\n    //     Call continue on this to resume the debuggee.\n    // - pThread - managed thread on which the debug event occurred. If the MDA occurred on an unmanaged thread then\n    //     this will be null. Get the OS thread ID from the MDA object itself.\n    // - pMDA is an object containing MDA information.\n    //    Suggested usage is that the client does not keep a reference to the MDA object after returning from this callback\n    //    because that lets the CLR quickly recycle the MDA's memory. This could be a performance win if there are\n    //    lots of MDAs firing.\n    HRESULT MDANotification(\n        [in] ICorDebugController * pController,\n        [in] ICorDebugThread *pThread,\n        [in] ICorDebugMDA * pMDA\n    );\n\n};\n#pragma warning(pop)\n\n[\n    object,\n    local,\n    uuid(5263E909-8CB5-11d3-BD2F-0000F80849BD),\n    pointer_default(unique)\n]\ninterface ICorDebugUnmanagedCallback : IUnknown\n{\n    /*\n     * DebugEvent is called when a DEBUG_EVENT is received which is\n     * not directly related to the Common Language Runtime.\n     *\n     * DO NOT USE any parts of the debugging API from the Win32 Event\n     * Thread. Only ICorDebugController::Continue() can be called on\n     * the Win32 Event Thread, and only when continuing from an out-of-band\n     * event.\n     *\n     * This callback is an exception to the rules about callbacks.\n     * When this callback is called, the process will be in the \"raw\"\n     * OS debug stopped state. The process will not be synchronized.\n     * The process will automatically enter the synchronized state when\n     * necessary to satisfy certain requests for information about\n     * managed code. (Note that this may result in other nested\n     * DebugEvent callbacks.)\n     *\n     * Call ClearCurrentException on the process to ignore an\n     * exception event before continuing the process. (Causes\n     * DBG_CONTINUE to be sent on continue rather than\n     * DBG_EXCEPTION_NOT_HANDLED)\n     * Out-of-band Breakpoint and single-step exceptions are automatically cleared.\n     *\n     * fOutOfBand will be FALSE if the debugging services support\n     * interaction with the process's managed state while the process\n     * is stopped due to this event. fOutOfBand will be TRUE if\n     * interaction with the process's managed state is impossible until\n     * the unmanaged event is continued from.\n     *\n     * Out-Of-Band events can come at anytime; even when there debuggee appears stopped\n     * and even when there's already an outstanding inband event.\n     *\n     * In v2.0, it is strongly recommended that the debugger just immediately\n     * continues OOB breakpoint events. The debugger should be using the ICorDebugProcess2\n     * SetUnmanagedBreakpoint and ClearUnmanagedBreakpoint APIs to add/remove breakpoints.\n     * Those APIs will already skip over any OOB breakpoints automatically. Thus the only\n     * oob breakpoints that get dispatched should be raw breakpoints already in the\n     * instruction stream (eg, like a call to kernel32!DebugBreak). In these cases,\n     * just continuing past the breakpoint is the correct thing to do. Do not try to use\n     * any other portion of the API like ClearCurrentException or Get/SetThreadContext.\n     *\n     */\n\n    HRESULT DebugEvent([in] LPDEBUG_EVENT pDebugEvent,\n                       [in] BOOL fOutOfBand);\n};\n\n/* ------------------------------------------------------------------------- *\n * Debugger interface\n * ------------------------------------------------------------------------- */\n\n\ntypedef enum CorDebugCreateProcessFlags\n{\n    DEBUG_NO_SPECIAL_OPTIONS        = 0x0000\n} CorDebugCreateProcessFlags;\n\n\n/* ICorDebugHeapValue::CreateHandle takes a handle flavor.\n *   - A strong handle will keep an object alive while allowing GC relocation\n *   - A weak handle will not keep an object alive\n *   - A pinned handle will keep an object alive and disallow GC relocation\n */\ntypedef enum CorDebugHandleType\n{\n    HANDLE_STRONG = 1,\n    HANDLE_WEAK_TRACK_RESURRECTION = 2,\n    HANDLE_PINNED = 3\n} CorDebugHandleType;\n\n#pragma warning(push)\n#pragma warning(disable:28718) /* disable warning 28718 for interface ICorDebug */\n/*\n * ICorDebug represents an event processing loop for a debugger process.\n *\n * The debugger must wait for the ExitProcess callback from all\n * processes being debugged before releasing this interface.\n *\n * The ICorDebug object is the initial object to control all further managed debugging.\n * In v1.0 + v1.1, this object was a CoClass created from COM.\n * In v2.0, this object is no longer a CoClass and must be created from the function:\n *      CreateDebuggingInterfaceFromVersion(\n *          int iDebuggerVersion, // <--- CorDebugVersion_2_0 if Debugger is V2.0\n *          LPCWSTR szDebuggeeVersion, // <--- version string of debuggee. Eg, \"v1.1.4322\"\n *          IUnknown ** ppCordb\n *      )\n * declared in mscoree.idl.\n * This new creation function is more version-aware. It allows clients to get a\n * specific implementation (as specified by szDebuggeeVersion) of ICorDebug, which\n * also emulates a specific version of the debugging API (as specified by iDebuggerVersion).\n */\n[\n    object,\n    local,\n    uuid(3d6f5f61-7538-11d3-8d5b-00104b35e7ef),\n    pointer_default(unique)\n]\ninterface ICorDebug : IUnknown\n{\n    /*\n     * The debugger calls this method at creation time to initialize the debugging\n     * services, and  must be called at creation time before any other method on\n     * ICorDebug is called.\n     */\n\n    HRESULT Initialize();\n\n    /*\n     * Terminate must be called when the ICorDebug is no longer needed.\n     *\n     * NOTE: Terminate should not be called until an ExitProcess callback has\n     * been received for all processes being debugged.\n     *\n     */\n\n    HRESULT Terminate();\n\n    /*\n     * SetManagedHandler should be called at creation time to specify the\n     * event handler object for managed events.\n     *\n     * Returns:\n     * S_OK on success.\n     * E_NOINTERFACE - if pCallback does not implement sufficient interfaces\n     *     to receive debug events for the version of the API it requested.\n     *     Eg, if debugging a V2.0 app, pCallback must implement ICorDebugManagedCallback2.\n     *\n     */\n\n    HRESULT SetManagedHandler([in] ICorDebugManagedCallback *pCallback);\n\n    /*\n     * SetUnmanagedHandler should be called at creation time to specify the\n     * event handler object for unmanaged events.\n     *\n     * This should be set after Initialize and before any calls to CreateProcess or DebugActiveProcess.\n     *\n     * However, for legacy purposes, it is not absolutely required to set this until\n     * before the first native debug event is fired. Specifically, if CreateProcess has the\n     * CREATE_SUSPENDED flag, native debug events will not be dispatched until the main thread\n     * is resumed.\n     * DebugActiveProcess will dispatch native debug events immediately, and so the unmanaged callback\n     * must be set before DebugActiveProcess is called.\n     *\n     * Returns:\n     *    S_OK if callback pointer is successfully updated.\n     *    failure on any failure.\n     *\n     */\n\n    HRESULT SetUnmanagedHandler([in] ICorDebugUnmanagedCallback *pCallback);\n\n    /*\n     * CreateProcess launches a process under the control of the debugger\n     * All parameters are the same as the win32 CreateProcess call.\n     *\n     * To enable unmanaged (mixed-mode) debugging, pass\n     * DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS to dwCreationFlags. DEBUG_PROCESS\n     * alone is not supported. If only managed debugging is desired, do not set\n     * these flags.\n     *\n     * The debugger and debuggee share a single console, then it's possible for\n     * the debuggee to hold \"console locks\" and then get stopped at a debug event.\n     * The debugger will then block trying to use the console. This is only an issue\n     * when interop debugging and if debugger + debuggee share the console.\n     * It is recommended to use the CREATE_NEW_CONSOLE flag to avoid this problem.\n     *\n     */\n\n    HRESULT CreateProcess([in] LPCWSTR lpApplicationName,\n                          [in] LPWSTR lpCommandLine,\n                          [in] LPSECURITY_ATTRIBUTES lpProcessAttributes,\n                          [in] LPSECURITY_ATTRIBUTES lpThreadAttributes,\n                          [in] BOOL bInheritHandles,\n                          [in] DWORD dwCreationFlags,\n                          [in] PVOID lpEnvironment,\n                          [in] LPCWSTR lpCurrentDirectory,\n                          [in] LPSTARTUPINFOW lpStartupInfo,\n                          [in] LPPROCESS_INFORMATION lpProcessInformation,\n                          [in] CorDebugCreateProcessFlags debuggingFlags,\n                          [out] ICorDebugProcess **ppProcess);\n\n    /*\n     * DebugActiveProcess is used to attach to an existing process.\n     *\n     * If win32Attach is TRUE, then the debugger becomes the Win32\n     * debugger for the process and will begin dispatching the\n     * unmanaged callbacks.\n     *\n     */\n\n    HRESULT DebugActiveProcess([in] DWORD id,\n                               [in] BOOL win32Attach,\n                               [out] ICorDebugProcess **ppProcess);\n\n    /*\n     * EnumerateProcesses returns an enum of processes being debugged.\n     *\n     */\n\n    HRESULT EnumerateProcesses([out] ICorDebugProcessEnum **ppProcess);\n\n    /*\n     * GetProcess returns the ICorDebugProcess with the given OS Id.\n     */\n\n    HRESULT GetProcess([in] DWORD dwProcessId,\n                       [out] ICorDebugProcess **ppProcess);\n\n    /*\n     * CanLaunchOrAttach returns S_OK if the debugging services believe that\n     * launching a new process or attaching to the given process is possible\n     * given what it knows about the current machine and runtime configuration.\n     *\n     * If you plan to launch with win32 debugging enabled, or to attach with\n     * win32 debugging enabled then pass in TRUE for win32DebuggineEnabled.\n     * The answer may be different if this option will be used.\n     *\n     * Note: the rest of the API will not stop you from launching or attaching\n     * to a process anyway. This function is purely informational.\n     *\n     * Possible HRESULTs: S_OK, CORDBG_E_DEBUGGING_NOT_POSSIBLE,\n     * CORDBG_E_KERNEL_DEBUGGER_PRESENT, CORDBG_E_KERNEL_DEBUGGER_ENABLED\n     *\n     */\n\n    HRESULT CanLaunchOrAttach([in] DWORD dwProcessId,\n                              [in] BOOL win32DebuggingEnabled);\n};\n#pragma warning(pop)\n\n/*\n * A debugger can implement this interface and pass it to ICorDebugRemote to specify the host name of the\n * target machine in Mac remote debugging scenarios.  This is only supported on Silverlight.\n */\n[\n    object,\n    local,\n    uuid(C3ED8383-5A49-4cf5-B4B7-01864D9E582D),\n    pointer_default(unique)\n]\ninterface ICorDebugRemoteTarget : IUnknown\n{\n    /*\n     * Return the host name of the target machine.  The host name can either be a fully qualified domain name or\n     * an IPv4 address.  If cchHostName is 0 and szHostName is NULL, this function just returns the number of\n     * characters including the NULL character in the host name.\n     *\n     * cchHostName is the number of characters in the buffer szHostName.  If this is 0, then szHostName must\n     * be NULL.  If it is not 0, then szHostName must be non-NULL.\n     *\n     * pcchHostName returns the number of characters including the NULL character in the host name.  This can\n     * be NULL.\n     *\n     * szHostName is the buffer for returning the host name.\n     */\n\n    HRESULT GetHostName([in]  ULONG32 cchHostName,\n                        [out, annotation(\"_Out_\")] ULONG32 * pcchHostName,\n                        [out, size_is(cchHostName), length_is(*pcchHostName), annotation(\"_Out_writes_to_opt_(cchHostName, *pcchHostName)\")]\n                                                     WCHAR szHostName[]);\n}\n\n/*\n * A debugger can QI for this interface from an ICorDebug interface in order to specify a target machine in\n * Mac remote debugging scenarios.  This is only supported on Silverlight.\n */\n[\n    object,\n    local,\n    uuid(D5EBB8E2-7BBE-4c1d-98A6-A3C04CBDEF64),\n    pointer_default(unique)\n]\ninterface ICorDebugRemote : IUnknown\n{\n    HRESULT CreateProcessEx([in] ICorDebugRemoteTarget * pRemoteTarget,\n                            [in] LPCWSTR lpApplicationName,\n                            [in, annotation(\"_In_\")] LPWSTR lpCommandLine,\n                            [in] LPSECURITY_ATTRIBUTES lpProcessAttributes,\n                            [in] LPSECURITY_ATTRIBUTES lpThreadAttributes,\n                            [in] BOOL bInheritHandles,\n                            [in] DWORD dwCreationFlags,\n                            [in] PVOID lpEnvironment,\n                            [in] LPCWSTR lpCurrentDirectory,\n                            [in] LPSTARTUPINFOW lpStartupInfo,\n                            [in] LPPROCESS_INFORMATION lpProcessInformation,\n                            [in] CorDebugCreateProcessFlags debuggingFlags,\n                            [out] ICorDebugProcess ** ppProcess);\n\n\n    HRESULT DebugActiveProcessEx([in] ICorDebugRemoteTarget * pRemoteTarget,\n                                 [in] DWORD dwProcessId,\n                                 [in] BOOL fWin32Attach,\n                                 [out] ICorDebugProcess ** ppProcess);\n}\n\ntypedef struct _COR_VERSION\n{\n    DWORD dwMajor;\n    DWORD dwMinor;\n    DWORD dwBuild;\n    DWORD dwSubBuild;\n} COR_VERSION;\n\n\n[\n    object,\n    local,\n    uuid(ECCCCF2E-B286-4b3e-A983-860A8793D105),\n    pointer_default(unique)\n]\n/*\n * Sets the maximum version of the runtime supported by the debugger using this\n * object.\n */\ninterface ICorDebug2 : IUnknown\n{\n    typedef enum CorDebugInterfaceVersion\n    {\n        CorDebugInvalidVersion = 0,\n        CorDebugVersion_1_0 = CorDebugInvalidVersion + 1,\n        ver_ICorDebugManagedCallback = CorDebugVersion_1_0,\n        ver_ICorDebugUnmanagedCallback = CorDebugVersion_1_0,\n        ver_ICorDebug = CorDebugVersion_1_0,\n        ver_ICorDebugController = CorDebugVersion_1_0,\n        ver_ICorDebugAppDomain = CorDebugVersion_1_0,\n        ver_ICorDebugAssembly = CorDebugVersion_1_0,\n        ver_ICorDebugProcess = CorDebugVersion_1_0,\n        ver_ICorDebugBreakpoint = CorDebugVersion_1_0,\n        ver_ICorDebugFunctionBreakpoint = CorDebugVersion_1_0,\n        ver_ICorDebugModuleBreakpoint = CorDebugVersion_1_0,\n        ver_ICorDebugValueBreakpoint = CorDebugVersion_1_0,\n        ver_ICorDebugStepper = CorDebugVersion_1_0,\n        ver_ICorDebugRegisterSet = CorDebugVersion_1_0,\n        ver_ICorDebugThread = CorDebugVersion_1_0,\n        ver_ICorDebugChain = CorDebugVersion_1_0,\n        ver_ICorDebugFrame = CorDebugVersion_1_0,\n        ver_ICorDebugILFrame = CorDebugVersion_1_0,\n        ver_ICorDebugNativeFrame = CorDebugVersion_1_0,\n        ver_ICorDebugModule = CorDebugVersion_1_0,\n        ver_ICorDebugFunction = CorDebugVersion_1_0,\n        ver_ICorDebugCode = CorDebugVersion_1_0,\n        ver_ICorDebugClass = CorDebugVersion_1_0,\n        ver_ICorDebugEval = CorDebugVersion_1_0,\n        ver_ICorDebugValue = CorDebugVersion_1_0,\n        ver_ICorDebugGenericValue = CorDebugVersion_1_0,\n        ver_ICorDebugReferenceValue = CorDebugVersion_1_0,\n        ver_ICorDebugHeapValue = CorDebugVersion_1_0,\n        ver_ICorDebugObjectValue = CorDebugVersion_1_0,\n        ver_ICorDebugBoxValue = CorDebugVersion_1_0,\n        ver_ICorDebugStringValue = CorDebugVersion_1_0,\n        ver_ICorDebugArrayValue = CorDebugVersion_1_0,\n        ver_ICorDebugContext = CorDebugVersion_1_0,\n        ver_ICorDebugEnum = CorDebugVersion_1_0,\n        ver_ICorDebugObjectEnum = CorDebugVersion_1_0,\n        ver_ICorDebugBreakpointEnum = CorDebugVersion_1_0,\n        ver_ICorDebugStepperEnum = CorDebugVersion_1_0,\n        ver_ICorDebugProcessEnum = CorDebugVersion_1_0,\n        ver_ICorDebugThreadEnum = CorDebugVersion_1_0,\n        ver_ICorDebugFrameEnum = CorDebugVersion_1_0,\n        ver_ICorDebugChainEnum = CorDebugVersion_1_0,\n        ver_ICorDebugModuleEnum = CorDebugVersion_1_0,\n        ver_ICorDebugValueEnum = CorDebugVersion_1_0,\n        ver_ICorDebugCodeEnum = CorDebugVersion_1_0,\n        ver_ICorDebugTypeEnum = CorDebugVersion_1_0,\n        ver_ICorDebugErrorInfoEnum = CorDebugVersion_1_0,\n        ver_ICorDebugAppDomainEnum = CorDebugVersion_1_0,\n        ver_ICorDebugAssemblyEnum = CorDebugVersion_1_0,\n        ver_ICorDebugEditAndContinueErrorInfo = CorDebugVersion_1_0,\n        ver_ICorDebugEditAndContinueSnapshot = CorDebugVersion_1_0,\n\n        CorDebugVersion_1_1 = CorDebugVersion_1_0 + 1,\n        // no interface definitions in v1.1\n\n        CorDebugVersion_2_0 = CorDebugVersion_1_1 + 1,\n\n        ver_ICorDebugManagedCallback2 = CorDebugVersion_2_0,\n        ver_ICorDebugAppDomain2 = CorDebugVersion_2_0,\n        ver_ICorDebugAssembly2 = CorDebugVersion_2_0,\n        ver_ICorDebugProcess2 = CorDebugVersion_2_0,\n        ver_ICorDebugStepper2 = CorDebugVersion_2_0,\n        ver_ICorDebugRegisterSet2 = CorDebugVersion_2_0,\n        ver_ICorDebugThread2 = CorDebugVersion_2_0,\n        ver_ICorDebugILFrame2 = CorDebugVersion_2_0,\n        ver_ICorDebugInternalFrame = CorDebugVersion_2_0,\n        ver_ICorDebugModule2 = CorDebugVersion_2_0,\n        ver_ICorDebugFunction2 = CorDebugVersion_2_0,\n        ver_ICorDebugCode2 = CorDebugVersion_2_0,\n        ver_ICorDebugClass2 = CorDebugVersion_2_0,\n        ver_ICorDebugValue2 = CorDebugVersion_2_0,\n        ver_ICorDebugEval2 = CorDebugVersion_2_0,\n        ver_ICorDebugObjectValue2 = CorDebugVersion_2_0,\n\n        // CLR v4 - next major CLR version after CLR v2\n        // Includes Silverlight 4\n        CorDebugVersion_4_0 = CorDebugVersion_2_0 + 1,\n\n        ver_ICorDebugThread3 = CorDebugVersion_4_0,\n        ver_ICorDebugThread4 = CorDebugVersion_4_0,\n        ver_ICorDebugStackWalk = CorDebugVersion_4_0,\n        ver_ICorDebugNativeFrame2 = CorDebugVersion_4_0,\n        ver_ICorDebugInternalFrame2 = CorDebugVersion_4_0,\n        ver_ICorDebugRuntimeUnwindableFrame = CorDebugVersion_4_0,\n        ver_ICorDebugHeapValue3 = CorDebugVersion_4_0,\n        ver_ICorDebugBlockingObjectEnum = CorDebugVersion_4_0,\n        ver_ICorDebugValue3 = CorDebugVersion_4_0,\n\n        CorDebugVersion_4_5 = CorDebugVersion_4_0 + 1,\n\n        ver_ICorDebugComObjectValue = CorDebugVersion_4_5,\n        ver_ICorDebugAppDomain3 = CorDebugVersion_4_5,\n        ver_ICorDebugCode3 = CorDebugVersion_4_5,\n        ver_ICorDebugILFrame3 = CorDebugVersion_4_5,\n\n        CorDebugLatestVersion = CorDebugVersion_4_5\n\n    } CorDebugInterfaceVersion;\n\n};\n\n/* ------------------------------------------------------------------------- *\n * Controller interface\n * ------------------------------------------------------------------------- */\n\n\n/*\n * A thread's DebugState determines whether the debugger lets a thread\n * run or not.  Possible states are:\n *\n * THREAD_RUN - thread runs freely, unless a debug event occurs\n * THREAD_SUSPEND - thread cannot run.\n *\n * NOTE: We allow for message pumping via a callback provided to the Hosting\n *      API, thus we don't need an 'interrupted' state here.\n */\n\ntypedef enum CorDebugThreadState\n{\n    THREAD_RUN,\n    THREAD_SUSPEND\n} CorDebugThreadState;\n\n\n/*\n * ICorDebugController represents a scope at which program execution context\n * can be controlled.  It represents either a process or an app domain.\n *\n * If this is the controller of a process, this controller affects all\n * threads in the process.  Otherwise it just affects the threads of\n * a particular app domain\n */\n\n[\n    object,\n    local,\n    uuid(3d6f5f62-7538-11d3-8d5b-00104b35e7ef),\n    pointer_default(unique)\n]\n\ninterface ICorDebugController : IUnknown\n{\n    /*\n     * Stop performs a cooperative stop on all threads running managed\n     * code in the process. When managed-only debugging, unmanaged threads may continue\n     * to run (but will be blocked when trying to call managed code). When-interop debugging,\n     * unmanaged threads will also be stopped.\n     * The timeout value is currently ignored and treated as INFINTE (-1).\n     * If the cooperative stop fails due to a deadlock, all threads are suspended (and E_TIMEOUT is returned)\n     *\n     * NOTE: This function is the one function in the debugging API\n     * that is synchronous. When Stop returns with S_OK, the process\n     * is stopped. (No callback will be given to notify of the stop.)\n     * The debugger must call Continue when it wishes to allow\n     * the process to resume running.\n     *\n     * The debugger maintains a \"stop-counter\". When the counter goes to zero, the\n     * Controller is resumed. Each call to Stop() or each dispatched callback will increment\n     * the counter. Each call to continue will decrement the counter.\n     */\n\n    HRESULT Stop([in] DWORD dwTimeoutIgnored);\n\n    /*\n     * Continue continues the process after a call to Stop.\n     *\n     * Continue continues the process. fIsOutOfBand is set to TRUE\n     * if continuing from an unmanaged event that was sent with the\n     * fOutOfBand flag in the unmanaged callback and it is set to\n     * FALSE if continuing from a managed event or a normal\n     * unmanaged event.\n     *\n     * When doing mixed-mode debugging, Continue cannot be called on\n     * the Win32 Event Thread unless it is continuing from an\n     * out-of-band event.\n     */\n\n    HRESULT Continue([in] BOOL fIsOutOfBand);\n\n    /*\n     * IsRunning returns TRUE if the threads in the process are running freely.\n     *\n     */\n\n    HRESULT IsRunning([out] BOOL *pbRunning);\n\n    /*\n     * HasQueuedCallbacks returns TRUE if there are currently managed\n     * callbacks which are queued up for the given thread.  These\n     * callbacks will be dispatched one at a time, each time Continue\n     * is called.\n     *\n     * The debugger can check this flag if it wishes to report multiple\n     * debugging events which occur simultaneously.\n     *\n     * If NULL is given for the pThread parameter, HasQueuedCallbacks\n     * will return TRUE if there are currently managed callbacks\n     * queued for any thread.\n     *\n     * Note that once debug events have been queued, they've already occurred,\n     * and so the debugger must drain the entire queue to be sure of the state\n     * of the debuggee. For example, if the queue contains 2 debug events on thread X,\n     * and the debugger suspends thread X after the 1st debug event and then calls continue,\n     * the 2nd debug event for thread X will still be dispatched even though the thread\n     * is suspended.\n     *\n     */\n\n    HRESULT HasQueuedCallbacks([in] ICorDebugThread *pThread,\n                               [out] BOOL *pbQueued);\n\n    /*\n     * EnumerateThreads returns an enum of all managed threads active in the process.\n     * A thread is considered Managed threads after the CreateThread callback has been\n     * dispatched and before the ExitThread callback has been dispatched.\n     * A managed thread may not necessarily have any managed frames on its stack.\n     *\n     * Threads can be enumerated even before the CreateProcess callback. The enumeration\n     * will naturally be empty.\n     */\n\n    HRESULT EnumerateThreads([out] ICorDebugThreadEnum **ppThreads);\n\n    /*\n     * SetAllThreadsDebugState sets the current debug state of each thread.\n     * See ICorDebugThread::SetDebugState for details.\n     *\n     * The pExceptThisThread parameter allows you to specify one\n     * thread which is exempted from the debug state change. Pass NULL\n     * if you want to affect all threads.\n     *\n     * This may affect threads not visible via EnumerateThreads, so threads suspended\n     * via this API will need to be resumed via this API too.\n     *\n     */\n\n    HRESULT SetAllThreadsDebugState([in] CorDebugThreadState state,\n                                    [in] ICorDebugThread *pExceptThisThread);\n\n    /*\n     * Detach detaches the debugger from the process.  The process\n     * continues execution normally. The ICorDebugProcess object is\n     * no longer valid and no further callbacks will occur.  This is\n     * not implemented for AppDomains (detaching is process-wide).\n     *\n     * Note that currently if unmanaged debugging is enabled this call will\n     * fail due to OS limitations.\n     *\n     * Returns S_OK on success.\n     *\n     */\n\n    HRESULT Detach();\n\n    /*\n     * Terminate terminates the process (with extreme prejudice, I might add).\n     *\n     * NOTE: If the process or appdomain is stopped when Terminate is called,\n     * the process or appdomain should be continued using Continue so that the\n     * ExitProcess or ExitAppDomain callback is received.\n     *\n     * NOTE: This method is not implemented by an appdomain.\n     */\n\n    HRESULT Terminate([in] UINT exitCode);\n\n    /*\n     * DEPRECATED\n     */\n\n    HRESULT CanCommitChanges([in] ULONG cSnapshots,\n                             [in, size_is(cSnapshots)] ICorDebugEditAndContinueSnapshot *pSnapshots[],\n                             [out] ICorDebugErrorInfoEnum **pError);\n\n\n    /*\n     * DEPRECATED\n     */\n\n    HRESULT CommitChanges([in] ULONG cSnapshots,\n                          [in, size_is(cSnapshots)] ICorDebugEditAndContinueSnapshot *pSnapshots[],\n                          [out] ICorDebugErrorInfoEnum **pError);\n\n};\n\n\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* disable warning 28718 for interface ICorDebugAppDomain */\n/* ------------------------------------------------------------------------- *\n *\n * AppDomain interface\n *\n * ------------------------------------------------------------------------- */\n\n\n[\n    object,\n    local,\n    uuid(3d6f5f63-7538-11d3-8d5b-00104b35e7ef),\n    pointer_default(unique)\n]\ninterface ICorDebugAppDomain : ICorDebugController\n{\n    /*\n     * GetProcess returns the process containing the app domain\n     */\n\n    HRESULT GetProcess([out] ICorDebugProcess **ppProcess);\n\n    /*\n     * EnumerateAssemblies enumerates all assemblies in the app domain\n     *\n     */\n\n    HRESULT EnumerateAssemblies([out] ICorDebugAssemblyEnum **ppAssemblies);\n\n    /*\n     * GetModuleFromMetaDataInterface returns the ICorDebugModule with\n     * the given metadata interface.\n     */\n\n    HRESULT GetModuleFromMetaDataInterface([in] IUnknown *pIMetaData,\n                                           [out] ICorDebugModule **ppModule);\n\n    /*\n     * EnumerateBreakpoints returns an enum (ICorDebugBreakpointEnum) of all active\n     * breakpoints in the app domain.  This includes all types of breakpoints :\n     * function breakpoints, data breakpoints, etc.\n     */\n\n    HRESULT EnumerateBreakpoints([out] ICorDebugBreakpointEnum **ppBreakpoints);\n\n    /*\n     * EnumerateSteppers returns an enum of all active steppers in the app domain.\n     *\n     */\n\n    HRESULT EnumerateSteppers([out] ICorDebugStepperEnum **ppSteppers);\n\n    /*\n     * DEPRECATED.  Always returns TRUE in V3 (attaching is process-wide).\n     */\n\n    HRESULT IsAttached([out] BOOL *pbAttached);\n\n\n    /*\n     * GetName returns the name of the app domain.\n     *\n     * Usage pattern:\n     * *pcchName is always set to the length of pInputString (including NULL) in characters. This lets\n     *   callers know the full size of buffer they'd need to allocate to get the full string.\n     *\n     * if (cchName == 0) then we're in \"query\" mode:\n     *     This fails if szName is non-null or pcchName is null\n     *     Else this function will set pcchName to let the caller know how large of a buffer to allocate\n     *     and return S_OK.\n     *\n     * if (cchName != 0) then\n     *     This fails if szName is null.\n     *     Else this copies as much as can fit into szName (it will always null terminate szName) and returns S_OK.\n     *     pcchName can be null. If it's non-null, we set it.\n     *\n     * The expected usage pattern is that a client will call once to get the size of a buffer needed for the name,\n     *  allocate the buffer, and then call a 2nd time to fill in the buffer.\n     *\n     * The rest of the GetName() functions have the same semantics for the parameters unless otherwise noted.\n     */\n\n    HRESULT GetName([in] ULONG32 cchName,\n                    [out] ULONG32 *pcchName,\n                    [out, size_is(cchName),\n                    length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * GetObject returns a reference to the System.AppDomain object which represents this AppDomain\n     * from within the runtime.\n     *\n     * Note: this object is lazily initialized within the runtime and may return NULL if the object\n     *       does not yet exist. This case will return S_FALSE and is not considered a failure.\n     *\n     */\n\n    HRESULT GetObject([out] ICorDebugValue **ppObject);\n\n    /*\n     * DEPRECATED.  This does nothing in V3.  Attaching is process-wide.\n     */\n\n    HRESULT Attach();\n\n    /*\n     * Get the ID of this app domain. The ID will be unique within the\n     * containing process.\n     */\n\n    HRESULT GetID([out] ULONG32 *pId);\n};\n#pragma warning(pop)\n\n[\n    object,\n    local,\n    uuid(096E81D5-ECDA-4202-83F5-C65980A9EF75),\n    pointer_default(unique)\n]\ninterface ICorDebugAppDomain2 : IUnknown\n{\n    /*\n     * GetArrayOrPointerType returns an array, pointer, byref or function pointer type.\n     * elementType indicated the kind of type to be created and\n     * must be one of ELEMENT_TYPE_PTR, ELEMENT_TYPE_BYREF,\n     * ELEMENT_TYPE_ARRAY or ELEMENT_TYPE_SZARRAY.  If used with\n     * ELEMENT_TYPE_PTR or ELEMENT_TYPE_BYREF then nRank must be zero.\n     */\n\n    HRESULT GetArrayOrPointerType([in] CorElementType elementType,\n                                  [in] ULONG32 nRank,\n                                  [in] ICorDebugType *pTypeArg,\n                                  [out] ICorDebugType **ppType);\n\n    /*\n     * GetFunctionPointerType returns a function pointer type.\n     * This corresponds to ELEMENT_TYPE_FNPTR.  The first type in the type arguments\n     * must be the return type and the remainder the argument types.\n     */\n\n     HRESULT GetFunctionPointerType( [in] ULONG32 nTypeArgs,\n                                     [in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[],\n                                     [out] ICorDebugType **ppType);\n};\n\n[\n    object,\n    local,\n    uuid(6164D242-1015-4BD6-8CBE-D0DBD4B8275A),\n    pointer_default(unique)\n]\ninterface ICorDebugGuidToTypeEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of IID / Type pairs from the app domain cache.\n     * The actual number of frames retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of pairs retrieved is smaller\n     * than the number of pairs requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                 CorDebugGuidToTypeMapping values[],\n                 [out] ULONG* pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(8CB96A16-B588-42E2-B71C-DD849FC2ECCC),\n    pointer_default(unique)\n]\ninterface ICorDebugAppDomain3 : IUnknown\n{\n    /*\n     * Returns an enumeration of types corresponding to the IIDs passed in\n     * guidsToResolve. The enumeration will have the same cReqTypes elements\n     * with NULL values corresponding to unknown IIDs.\n     */\n    HRESULT GetCachedWinRTTypesForIIDs(\n                        [in]                      ULONG32              cReqTypes,\n                        [in, size_is(cReqTypes)]  GUID               * iidsToResolve,\n                        [out]                     ICorDebugTypeEnum ** ppTypesEnum);\n\n    /*\n     * Returns an enumeration of IID / Type pairs. This is the exhaustive\n     * list of pairs as they were cached in the current app domain.\n     */\n    HRESULT GetCachedWinRTTypes(\n                        [out] ICorDebugGuidToTypeEnum ** ppGuidToTypeEnum);\n};\n\n[\n    object,\n    local,\n    uuid(FB99CC40-83BE-4724-AB3B-768E796EBAC2),\n    pointer_default(unique)\n]\ninterface ICorDebugAppDomain4 : IUnknown\n{\n    /*\n     * gives back the managed object for a given CCW pointer\n     */\n    HRESULT GetObjectForCCW([in]CORDB_ADDRESS ccwPointer, [out]ICorDebugValue **ppManagedObject);\n};\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* disable warning 28718 for interface ICorDebugAssembly */\n\n/* ------------------------------------------------------------------------- *\n * Assembly interface\n * An ICorDebugAssembly instance corresponds to a managed assembly loaded\n * into a specific AppDomain in the CLR.  For assemblies shared between multiple\n * AppDomains (eg. CoreLib), there will be a separate ICorDebugAssembly instance\n * per AppDomain in which it is used.\n * ------------------------------------------------------------------------- */\n[\n    object,\n    local,\n    uuid(df59507c-d47a-459e-bce2-6427eac8fd06),\n    pointer_default(unique)\n]\n\ninterface ICorDebugAssembly : IUnknown\n{\n    /*\n     * GetProcess returns the process containing the assembly\n     */\n\n    HRESULT GetProcess([out] ICorDebugProcess **ppProcess);\n\n    /*\n     * GetAppDomain returns the app domain containing the assembly.\n     */\n\n    HRESULT GetAppDomain([out] ICorDebugAppDomain **ppAppDomain);\n\n    /*\n     * EnumerateModules enumerates all modules in the assembly\n     *\n     */\n\n    HRESULT EnumerateModules([out] ICorDebugModuleEnum **ppModules);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetCodeBase([in] ULONG32 cchName,\n                        [out] ULONG32 *pcchName,\n                        [out, size_is(cchName),\n                        length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * GetName returns the full path and filename of the assembly.\n     * If the assembly has no filename (i.e. it is in-memory only),\n     * S_FALSE is returned, and a fabricated string is stored into szName.\n     */\n\n    HRESULT GetName([in] ULONG32 cchName,\n                    [out] ULONG32 *pcchName,\n                    [out, size_is(cchName),\n                    length_is(*pcchName)] WCHAR szName[]);\n};\n#pragma warning(pop)\n\n[\n    object,\n    local,\n    uuid(426d1f9e-6dd4-44c8-aec7-26cdbaf4e398),\n    pointer_default(unique)\n]\ninterface ICorDebugAssembly2 : IUnknown\n{\n    /*\n     * IsFullyTrusted sets a flag indicating whether the assembly has\n     * been granted full trust by the runtime security system.\n     * This may return CORDBG_E_NOTREADY if the security policy for\n     * the assembly has not yet been resolved (eg. no code in the\n     * assembly has been run yet).\n     */\n    HRESULT IsFullyTrusted([out] BOOL *pbFullyTrusted);\n};\n\n[\n    object,\n    local,\n    uuid(76361AB2-8C86-4FE9-96F2-F73D8843570A),\n    pointer_default(unique)\n]\ninterface ICorDebugAssembly3 : IUnknown\n{\n    /*\n     * If this assembly has been merged with others inside a single container assembly,\n     * this gives back the container. Otherwise *ppAssembly = NULL and the result is S_FALSE.\n     */\n    HRESULT GetContainerAssembly(ICorDebugAssembly **ppAssembly);\n\n    /*\n     * Gets an enumeration for all the assemblies contained within this assembly\n     * If the assembly isn't a container, the result is S_FALSE and the enumeration\n     * will be empty. Symbols are needed to compute this result; if they aren't\n     * present an error will be returned and no enumeration provided.\n     */\n    HRESULT EnumerateContainedAssemblies(ICorDebugAssemblyEnum **ppAssemblies);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * Heap enumeration interface\n * ------------------------------------------------------------------------- */\n\ncpp_quote(\"#ifndef _DEF_COR_TYPEID_\")\ncpp_quote(\"#define _DEF_COR_TYPEID_\")\ntypedef struct COR_TYPEID\n{\n    UINT64 token1;\n    UINT64 token2;\n} COR_TYPEID;\ncpp_quote(\"#endif // _DEF_COR_TYPEID_\")\n\ntypedef struct _COR_HEAPOBJECT\n{\n    CORDB_ADDRESS address;  // The address (in memory) of the object.\n    ULONG64 size;           // The total size of the object.\n    COR_TYPEID type;        // The fully instantiated type of the object.\n} COR_HEAPOBJECT;\n\n[\n    object,\n    local,\n    uuid(76D7DAB8-D044-11DF-9A15-7E29DFD72085),\n    pointer_default(unique)\n]\ninterface ICorDebugHeapEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of objects in the enumeration.\n     * The actual number of objects retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of objects retrieved is smaller\n     * than the number of objects requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)] COR_HEAPOBJECT objects[],\n                 [out] ULONG *pceltFetched);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * Segment enumeration interface\n * ------------------------------------------------------------------------- */\n\ntypedef enum CorDebugGenerationTypes\n{\n    CorDebug_Gen0 = 0,\n    CorDebug_Gen1 = 1,\n    CorDebug_Gen2 = 2,\n    CorDebug_LOH  = 3,\n    CorDebug_POH  = 4,\n} CorDebugGenerationTypes;\n\ntypedef struct _COR_SEGMENT\n{\n    CORDB_ADDRESS start;          // The start address of the segment.\n    CORDB_ADDRESS end;            // The end address of the segment.\n    CorDebugGenerationTypes type; // The generation of the segment.\n    ULONG heap;                   // The heap the segment resides in.\n} COR_SEGMENT;\n\n\ntypedef enum CorDebugGCType\n{\n    CorDebugWorkstationGC,\n    CorDebugServerGC\n} CorDebugGCType;\n\ntypedef struct _COR_HEAPINFO\n{\n    BOOL areGCStructuresValid;  // TRUE if it's ok to walk the heap, FALSE otherwise.\n    DWORD pointerSize;          // The size of pointers on the target architecture in bytes.\n    DWORD numHeaps;             // The number of logical GC heaps in the process.\n    BOOL concurrent;            // Is the GC concurrent?\n    CorDebugGCType gcType;      // Workstation or Server?\n} COR_HEAPINFO;\n\n[\n    object,\n    local,\n    uuid(A2FA0F8E-D045-11DF-AC8E-CE2ADFD72085),\n    pointer_default(unique)\n]\ninterface ICorDebugHeapSegmentEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of objects in the enumeration.\n     * The actual number of objects retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of objects retrieved is smaller\n     * than the number of objects requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)] COR_SEGMENT segments[],\n                 [out] ULONG *pceltFetched);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * Reference enumeration interface\n * ------------------------------------------------------------------------- */\ntypedef enum CorGCReferenceType\n{\n    CorHandleStrong = 1<<0,\n    CorHandleStrongPinning = 1<<1,\n    CorHandleWeakShort = 1<<2,\n    CorHandleWeakLong = 1<<3,\n    CorHandleWeakRefCount = 1<<4,\n    CorHandleStrongRefCount = 1<<5,\n    CorHandleStrongDependent = 1<<6,\n    CorHandleStrongAsyncPinned = 1<<7,\n    CorHandleStrongSizedByref = 1<<8,\n    CorHandleWeakNativeCom = 1<<9,\n    CorHandleWeakWinRT = CorHandleWeakNativeCom,\n\n    CorReferenceStack = 0x80000001,\n    CorReferenceFinalizer = 80000002,\n\n    // Used for EnumHandles\n    CorHandleStrongOnly = 0x1E3,\n    CorHandleWeakOnly = 0x21C,\n    CorHandleAll = 0x7FFFFFFF\n} CorGCReferenceType;\n\n\ncpp_quote(\"#ifndef _DEF_COR_GC_REFERENCE_\")\ncpp_quote(\"#define _DEF_COR_GC_REFERENCE_\")\ntypedef struct COR_GC_REFERENCE\n{\n    ICorDebugAppDomain *Domain;         // The AppDomain of the handle/object, may be null.\n    ICorDebugValue *Location;           // A reference to the object\n    CorGCReferenceType Type;            // Where the root came from.\n\n    /*\n        DependentSource - for HandleDependent\n        RefCount - for HandleStrongRefCount\n        Size - for HandleSizedByref\n    */\n    UINT64 ExtraData;\n} COR_GC_REFERENCE;\n\ncpp_quote(\"#endif // _DEF_COR_GC_REFERENCE_\")\n\n[\n    object,\n    local,\n    uuid(7F3C24D3-7E1D-4245-AC3A-F72F8859C80C),\n    pointer_default(unique)\n]\ninterface ICorDebugGCReferenceEnum : ICorDebugEnum\n{\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)] COR_GC_REFERENCE roots[],\n                 [out] ULONG *pceltFetched);\n}\n\ncpp_quote(\"#ifndef _DEF_COR_ARRAY_LAYOUT_\")\ncpp_quote(\"#define _DEF_COR_ARRAY_LAYOUT_\")\ntypedef struct COR_ARRAY_LAYOUT\n{\n    COR_TYPEID componentID; // The type of objects the array contains\n\n    CorElementType componentType;  // Whether the component itself is a GC reference, value class, or primitive\n\n    ULONG32 firstElementOffset; // The offset to the first element\n    ULONG32 elementSize;     // The size of each element\n    ULONG32 countOffset;     // The offset to the number of elements in the array.\n\n    // For multidimensional arrays (works with normal arrays too).\n    ULONG32 rankSize;       // The size of the rank\n    ULONG32 numRanks;       // The number of ranks in the array (1 for array, N for multidimensional array)\n    ULONG32 rankOffset;     // The offset at which the ranks start\n} COR_ARRAY_LAYOUT;\n\ncpp_quote(\"#endif // _DEF_COR_ARRAY_LAYOUT_\")\n\n\ncpp_quote(\"#ifndef _DEF_COR_TYPE_LAYOUT_\")\ncpp_quote(\"#define _DEF_COR_TYPE_LAYOUT_\")\ntypedef struct COR_TYPE_LAYOUT\n{\n    COR_TYPEID parentID;\n    ULONG32 objectSize;\n    ULONG32 numFields;\n    ULONG32 boxOffset;\n    CorElementType type;\n} COR_TYPE_LAYOUT;\ncpp_quote(\"#endif // _DEF_COR_TYPE_LAYOUT_\")\n\ncpp_quote(\"#ifndef _DEF_COR_FIELD_\")\ncpp_quote(\"#define _DEF_COR_FIELD_\")\ntypedef struct COR_FIELD\n{\n    mdFieldDef token;   // FieldDef token to get the field info\n    ULONG32 offset;     // Offset in object of data.\n    COR_TYPEID id;      // TYPEID of the field\n\n    CorElementType fieldType;\n} COR_FIELD;\ncpp_quote(\"#endif // _DEF_COR_FIELD_\")\n\n\n\n\n/* ------------------------------------------------------------------------- *\n * Process interface\n * ------------------------------------------------------------------------- */\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface ICorDebugProcess */\n\n/*\n * ICorDebugProcess represents a process running some managed code.\n */\n\n[\n    object,\n    local,\n    uuid(3d6f5f64-7538-11d3-8d5b-00104b35e7ef),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess : ICorDebugController\n{\n    /*\n     * GetID returns the OS ID of the process.\n     */\n\n    HRESULT GetID([out] DWORD *pdwProcessId);\n\n    /*\n     * GetHandle returns a handle to the process. This handle is owned\n     * by the debugging API; the debugger should duplicate it before\n     * using it.\n     */\n\n    HRESULT GetHandle([out] HPROCESS *phProcessHandle);\n\n    /*\n     * GetThread returns the ICorDebugThread with the given OS Id.\n     *\n     * Note that eventually there will not be a one to one correspondence\n     * between OS threads and runtime threads, so this entry point will\n     * go away.\n     */\n\n    HRESULT GetThread([in] DWORD dwThreadId, [out] ICorDebugThread **ppThread);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT EnumerateObjects([out] ICorDebugObjectEnum **ppObjects);\n\n    /*\n     * IsTransitionStub tests whether an address is inside of a transition stub\n     * which will cause a transition to managed code.  This can be used by\n     * unmanaged stepping code to decide when to return stepping control to\n     * the managed stepper.\n     *\n     * Note that, tentatively, these stubs may also be able to be identified\n     * ahead of time by looking at information in the PE file.\n     *\n     */\n\n    HRESULT IsTransitionStub([in] CORDB_ADDRESS address,\n                             [out] BOOL *pbTransitionStub);\n\n\n    /*\n     * IsOSSuspended returns whether or not the thread has been\n     * suspended as part of the debugger logic of stopping the process.\n     * (that is, it has had its Win32 suspend count incremented by\n     * one.)  The debugger UI may want to take this into account if\n     * it shows the user the OS suspend count of the thread.\n     *\n     * This function only makes sense in the context of\n     * unmanaged debugging - during managed debugging threads are not\n     * OS suspended. (They are cooperatively suspended.)\n */\n\n    HRESULT IsOSSuspended([in] DWORD threadID, [out] BOOL *pbSuspended);\n\n    /*\n     * GetThreadContext returns the context for the given thread.  The\n     * debugger should call this function rather than the Win32\n     * GetThreadContext, because the thread may actually be in a \"hijacked\"\n     * state where its context has been temporarily changed.\n     *\n     * This should only be used on when a thread is in native code. Use ICorDebugRegisterSet\n     * for threads in managed code.\n     *\n     * The data returned is a CONTEXT structure for the current platform.\n     * (CONTEXT is typically declared in winnt.h) Just as with a call\n     * to Win32's GetThreadContext, the caller should initialize the\n     * CONTEXT struct before calling.\n     *\n     */\n\n    HRESULT GetThreadContext([in] DWORD threadID,\n                             [in] ULONG32 contextSize,\n                             [in, out, length_is(contextSize),\n                             size_is(contextSize)] BYTE context[]);\n\n    /*\n     * SetThreadContext sets the context for the given thread.  The\n     * debugger should call this function rather than the Win32\n     * SetThreadContext, because the thread may actually be in a \"hijacked\"\n     * state where its context has been temporarily changed.\n     *\n     * This should only be used on when a thread is in native code. Use ICorDebugRegisterSet\n     * for threads in managed code.\n     *\n     * This should never be needed to modify the context of a thread during an oob-debug\n     * event.\n     *\n     * The data passed should be a CONTEXT structure for the current platform.\n     * (CONTEXT is typically declared in winnt.h)\n     *\n     * This is a dangerous call which can corrupt the runtime if used\n     * improperly.\n     *\n     */\n\n    HRESULT SetThreadContext([in] DWORD threadID,\n                             [in] ULONG32 contextSize,\n                             [in, length_is(contextSize),\n                             size_is(contextSize)] BYTE context[]);\n\n    /*\n     * ReadMemory reads memory from the process.\n     * This is primarily intended to be used by interop-debugging to inspect memory\n     * regions used by the unmanaged portion of the debuggee.\n     *\n     * This can also be used to read IL and native jitted code.\n     * Any managed breakpoints will be automatically stripped from the returned buffer.\n     * No adjustments will be made for Native breakpoints set by ICorDebugProcess2::SetUnmanagedBreakpoint\n     *\n     * No caching of process memory is performed.\n     * These parameters have the same semantics as kernel32!ReadProcessMemory.\n     * The entire range must be read for the function to return success.\n     */\n\n    HRESULT ReadMemory([in] CORDB_ADDRESS address, [in] DWORD size,\n                       [out, size_is(size), length_is(size)] BYTE buffer[],\n                       [out] SIZE_T *read);\n\n    /*\n     * WriteMemory writes memory in the process.\n     * In v2.0, Native debuggers should *not* use this to inject breakpoints\n     * into the instruction stream. Use ICorDebugProcess2::SetUnamangedBreakpoint\n     * instead.\n     *\n     * This is a dangerous call which can corrupt the runtime if used\n     * improperly. It is highly recommended that this is only used outside\n     * of managed code.\n     *\n     * These parameters have the same semantics as kernel32!WriteProcessMemory.\n     */\n\n    HRESULT WriteMemory([in] CORDB_ADDRESS address, [in] DWORD size,\n                        [in, size_is(size)] BYTE buffer[],\n                        [out]SIZE_T *written);\n\n\n    /*\n     * ClearCurrentException clears the current unmanaged exception on\n     * the given thread. Call this before calling Continue when a\n     * thread has reported an unmanaged exception that should be\n     * ignored by the debuggee.\n     *\n     * This will clear both the outstanding IB and OOB events on the given thread.\n     * Out-of-band Breakpoint and single-step exceptions are automatically cleared.\n     *\n     * See ICorDebugThread2::InterceptCurrentException for continuing managed exceptions.\n     *\n     */\n\n    HRESULT ClearCurrentException([in] DWORD threadID);\n\n    /*\n     * EnableLogMessages enables/disables sending of log messages to the\n     * debugger for logging.\n     * This is only valid after the CreateProcess callback.\n     *\n     */\n\n    HRESULT EnableLogMessages([in]BOOL fOnOff);\n\n    /*\n     * ModifyLogSwitch modifies the specified switch's severity level.\n     * This is only valid after the CreateProcess callback.\n     *\n     */\n    HRESULT ModifyLogSwitch([in, annotation(\"_In_\")] WCHAR *pLogSwitchName,\n                            [in]LONG lLevel);\n\n    /*\n     * EnumerateAppDomains enumerates all app domains in the process.\n     * This can be used before the CreateProcess callback.\n     *\n     */\n\n    HRESULT EnumerateAppDomains([out] ICorDebugAppDomainEnum **ppAppDomains);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetObject([out] ICorDebugValue **ppObject);\n\n    /*\n     * DEPRECATED\n     */\n\n    HRESULT ThreadForFiberCookie([in] DWORD fiberCookie,\n                                 [out] ICorDebugThread **ppThread);\n\n    /*\n     * Returns the OS thread id of the debugger's internal helper thread.\n     * During managed/unmanaged debugging, it is the debugger's\n     * responsibility to ensure that the thread with this ID remains running\n     * if it hits a breakpoint placed by the debugger. A debugger may also\n     * wish to hide this thread from the user.\n     *\n     * If there is no helper thread in the process yet, then this method\n     * will return zero as the thread id.\n     *\n     * Note: you cannot cache this value. The ID of the helper thread may\n     * change over time, so this value must be re-queried at every stopping\n     * event.\n     *\n     * Note: this value will be correct on every unmanaged CreateThread event.\n     * This will allow a debugger to determine the TID of the helper thread\n     * and hide it from the user. A thread identified as a helper thread during\n     * an unmanaged CreateThread event will never run managed user code.\n     */\n\n    HRESULT GetHelperThreadID([out] DWORD *pThreadID);\n};\n#pragma warning(pop)\n\n[\n    object,\n    local,\n    uuid(AD1B3588-0EF0-4744-A496-AA09A9F80371),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess2 : IUnknown\n{\n\n    /*\n      * Return a ICorDebugThread2 interface given a TASKID\n     * Host can set TASKID using ICLRTask::SetTaskIdentifier\n      */\n    HRESULT GetThreadForTaskID(\n       [in] TASKID taskid,\n       [out] ICorDebugThread2 **ppThread);\n\n\n    /*\n     * Returns the version of the runtime the debugee process is running.\n     */\n    HRESULT GetVersion([out] COR_VERSION* version);\n\n    /*\n     * Set an unmanaged breakpoint at the given native address. If the address is within\n     * the runtime, the breakpoint will be ignored.\n     * This allows the CLR to avoid dispatching out-of-band breakpoints for breakpoints\n     * set by the debugger.\n     * buffer[] returns the opcode at the address that is replaced by the breakpoint.\n     */\n\n    HRESULT SetUnmanagedBreakpoint([in] CORDB_ADDRESS address,\n                                   [in] ULONG32 bufsize,\n                                   [out, size_is(bufsize), length_is(*bufLen)] BYTE buffer[],\n                                   [out] ULONG32 * bufLen);\n\n    /*\n     * Remove a breakpoint set by SetUnmanagedBreakpoint.\n     */\n    HRESULT ClearUnmanagedBreakpoint([in] CORDB_ADDRESS address);\n\n\n    /*\n     * SetDesiredNGENCompilerFlags specifies the set of flags that must be set in a pre-JITted\n     * image in order for the runtime to load that image into this app domain. If no such image exists,\n     * the runtime will load the IL and JIT instead. The flags set by this function are just used to select the\n     * correct pre-JITted image; if no suitable image is found the debugger will still need to use\n     * ICorDebugModule2::SetJITCompilerFlags to set the flags as desired for JIT.\n     *\n     * This function must be called during the CreateProcess callback.\n     * Attempts to call it after this callback has been delivered will fail.\n     */\n     HRESULT SetDesiredNGENCompilerFlags( [in] DWORD pdwFlags );\n\n    /*\n     * GetDesiredNGENCompilerFlags gets the set of flags that must be set in a pre-JITted image in order\n     * for the runtime to load that image into this process.\n     */\n     HRESULT GetDesiredNGENCompilerFlags( [out] DWORD *pdwFlags );\n\n\n    /*\n    * Gets an ICorDebugReferenceValue object from a raw GC handle value.\n    *\n    * handle is the IntPtr within a GCHandle. Do not confuse\n    * this with a GC reference value. This is a potentially dangerous API and may\n    * corrupt both the debugger and debuggee if a bogus handle is passed in.\n    * This API does not necessarily validate that the handle is valid.\n    *\n    * The ICorDebugReferenceValue will behave much like a normal reference. It will\n    * be neutered on the next continue; the lifetime of the target object will\n    * not be affected by the existence of the ReferenceValue.\n    */\n    HRESULT GetReferenceValueFromGCHandle( [in] UINT_PTR handle,\n                                           [out] ICorDebugReferenceValue **pOutValue);\n\n};\n\n\n[\n    object,\n    local,\n    uuid(2EE06488-C0D4-42B1-B26D-F3795EF606FB),\n    pointer_default(unique)\n]\n\ninterface ICorDebugProcess3 : IUnknown\n{\n    /*  Enables (or disables) custom debugger notifications of a specified\n     *  type (which implements ICustomDebuggerNotification).\n     *  When this has been enabled, calls to\n     *  System.Diagnostics.Debugger.CustomNotification with a data argument\n     *  of the specified class will trigger a CustomNotification callback.\n     *  Notifications are disabled by default and the debugger must opt-into\n     *  any notification types it knows of and wishes to handle.\n     *  Since ICorDebugClass is scoped by appdomains, the debugger needs to\n     *  call this API for every appdomain in the process if it's interested in\n     *  receiving the notification across the entire process.\n     */\n\n    HRESULT SetEnableCustomNotification(ICorDebugClass * pClass, BOOL fEnable);\n}\n\n[\n    object,\n    local,\n    uuid(21e9d9c0-fcb8-11df-8cff-0800200c9a66),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess5 : IUnknown\n{\n    HRESULT GetGCHeapInformation([out] COR_HEAPINFO *pHeapInfo);\n    HRESULT EnumerateHeap([out] ICorDebugHeapEnum **ppObjects);\n    HRESULT EnumerateHeapRegions([out] ICorDebugHeapSegmentEnum **ppRegions);\n    HRESULT GetObject([in] CORDB_ADDRESS addr, [out] ICorDebugObjectValue **pObject);\n    HRESULT EnumerateGCReferences([in] BOOL enumerateWeakReferences, [out] ICorDebugGCReferenceEnum **ppEnum);\n    HRESULT EnumerateHandles([in] CorGCReferenceType types, [out] ICorDebugGCReferenceEnum **ppEnum);\n\n    HRESULT GetTypeID([in] CORDB_ADDRESS obj, [out] COR_TYPEID *pId);\n    HRESULT GetTypeForTypeID([in] COR_TYPEID id, [out] ICorDebugType **ppType);\n\n    HRESULT GetArrayLayout([in] COR_TYPEID id, [out] COR_ARRAY_LAYOUT *pLayout);\n    HRESULT GetTypeLayout([in] COR_TYPEID id, [out] COR_TYPE_LAYOUT *pLayout);\n    HRESULT GetTypeFields([in] COR_TYPEID id, ULONG32 celt, COR_FIELD fields[], ULONG32 *pceltNeeded);\n\n    /*\n     *  Enables the specified policy.\n     */\n    HRESULT EnableNGENPolicy([in] CorDebugNGENPolicy ePolicy);\n}\n\n\n// Describes formats of pRecord byte blob in DecodeEvent.\n// This is dependent on the target architecture.\ntypedef enum CorDebugRecordFormat\n{\n    FORMAT_WINDOWS_EXCEPTIONRECORD32 = 1,\n    FORMAT_WINDOWS_EXCEPTIONRECORD64 = 2,\n} CorDebugRecordFormat;\n\n// dwFlags in DecodeEvent is dependent on the target architecture.\n// Definition of DecodeEvent flags on Windows.\ntypedef enum CorDebugDecodeEventFlagsWindows\n{\n    IS_FIRST_CHANCE = 1,\n} CorDebugDecodeEventFlagsWindows;\n\n// Possible events which can be decoded in DecodeEvent\ntypedef enum CorDebugDebugEventKind\n{\n    DEBUG_EVENT_KIND_MODULE_LOADED = 1,\n    DEBUG_EVENT_KIND_MODULE_UNLOADED = 2,\n    DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE = 3,\n    DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE = 4,\n    DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND = 5,\n    DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED = 6\n} CorDebugDebugEventKind;\n\n// Describes what amount of cached data must be discarded based on changes to the\n// process\ntypedef enum CorDebugStateChange\n{\n    PROCESS_RUNNING = 0x0000001, // The process reached a new memory state via\n                                 // forward execution.\n    FLUSH_ALL       = 0x0000002, // The process' memory might be arbitrarily\n                                 // different than it was before.\n} CorDebugStateChange;\n\n// Base interface from which all ICorDebug debug events derive\n[\n    object,\n    local,\n    uuid(41BD395D-DE99-48F1-BF7A-CC0F44A6D281),\n    pointer_default(unique)\n]\ninterface ICorDebugDebugEvent : IUnknown\n{\n    /*\n     * Quickly determines what kind of event this is. Based on the answer you\n     * you can QI to get a more precise debug event interface with additional data\n     * available.\n     */\n    HRESULT GetEventKind([out]CorDebugDebugEventKind *pDebugEventKind);\n\n    /*\n     * Gets the thread on which the event occurred\n     */\n    HRESULT GetThread([out]ICorDebugThread **ppThread);\n}\n\ntypedef enum CorDebugCodeInvokeKind\n{\n    CODE_INVOKE_KIND_NONE,     // if there is any managed code invoked by this method, it will have\n                               // have to be located by explicit events/breakpoints later\n                               // OR we may just miss some of the managed code this method calls\n                               // because there is no easy way to stop on it\n                               // OR the method may never invoke managed code\n    CODE_INVOKE_KIND_RETURN,   // This method will invoke managed code via a return instruction,\n                               // Stepping out should arrive at the next managed code\n    CODE_INVOKE_KIND_TAILCALL, // This method will invoke managed code via a tail-call. Single-stepping\n                               // + stepping over any call instructions should arrive at managed code\n} CorDebugCodeInvokeKind;\n\ntypedef enum CorDebugCodeInvokePurpose\n{\n    CODE_INVOKE_PURPOSE_NONE,\n    CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION,  // The managed code will run any managed entrypoint\n                                                       // such as a reverse p-invoke. Any more detailed purpose\n                                                       // is unknown by the runtime.\n    CODE_INVOKE_PURPOSE_CLASS_INIT,                    // The managed code will run a static constructor\n    CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH,            // The managed code will run the implementation for\n                                                       // some interface method that was called\n} CorDebugCodeInvokePurpose;\n\n[\n    object,\n    local,\n    uuid(11588775-7205-4CEB-A41A-93753C3153E9),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess6 : IUnknown\n{\n    //Decodes managed debug events which have been encapsulated in the payload of\n    //specially crafted native exception debug events\n    HRESULT DecodeEvent(\n        [in, length_is(countBytes), size_is(countBytes)]  const BYTE pRecord[],\n        [in] DWORD countBytes,\n        [in] CorDebugRecordFormat format,\n        [in] DWORD dwFlags,\n        [in] DWORD dwThreadId,\n        [out] ICorDebugDebugEvent **ppEvent);\n\n    // Debugger calls this to notify ICorDebug that the process is running.\n    //\n    // Notes:\n    //  ProcessStateChanged(PROCESS_RUNNING) has similar semantics to\n    //  ICorDebugProcess::Continue();\n    HRESULT ProcessStateChanged([in] CorDebugStateChange change);\n\n    // Get information about managed code at codeAddress\n    HRESULT GetCode([in] CORDB_ADDRESS codeAddress, [out] ICorDebugCode **ppCode);\n\n    // Virtual module splitting causes ICorDebug to recognize modules that were\n    // merged together during the build process and present them as a group of separate\n    // modules rather than a single large module. Doing this changes the behavior of\n    // various ICorDebug APIs described below.\n    //\n    // Terminology\n    // The aggregate modules are called containers, the modules inside are called\n    // sub-modules or virtual modules. Both container modules and sub-modules are\n    // represented with the ICorDebugModule interface, however the behavior of the\n    // interface is slightly different in each case, as described below.\n    // In addition there may still be modules loaded that weren't merged during build.\n    // These modules, called regular modules, are neither container modules nor\n    // sub-modules.\n    //\n    // Modules and assemblies\n    // Multi-module assemblies are not supported for assembly merging scenarios\n    // so module and assembly are exactly 1:1. Each ICorDebugModule, regardless of\n    // whether it represents a container module or a sub-module, has a corresponding\n    // ICorDebugAssembly. ICorDebugModule.GetAssembly() converts from the module to the\n    // assembly. To map the other direction, ICorDebugAssembly.EnumerateModules() will\n    // enumerate only 1 module. Because assembly and module form a tightly coupled pair\n    // in this case, the terms assembly and module become largely interchangeable.\n    //\n    // Differences in behavior for container modules vs. sub-modules\n    // Container modules:\n    //     -have metadata for all of the constituent sub-modules merged together\n    //     -type names may be mangled\n    //     -ICorDebugModule.GetName() will return the path to an on-disk module\n    //     -ICorDebugModule.GetSize() returns the size of that image.\n    //     -ICorDebugAssembly3.EnumerateContainedAssemblies will list the sub-modules\n    //     -ICorDebugAssembly3.GetContainerAssembly returns S_FALSE\n    // Sub-modules:\n    //     -have a reduced set of metadata that corresponds only to the original\n    //      assembly that was merged in.\n    //     -The metadata names have no mangling.\n    //     -Metadata tokens are unlikely to match with the tokens in the original\n    //      assembly before it was merged in the build process\n    //     -ICorDebugModule.GetName() returns the assembly name (not a file path)\n    //     -ICorDebug.GetSize() returns the original unmerged image size.\n    //     -ICorDebugModule3.EnumerateContainedAssemblies will return S_FALSE\n    //     -ICorDebugAssembly3.GetContainerAssembly will return the containing module\n    //\n    // Interfaces retrieved from modules\n    // There are a variety of interfaces that can be created from modules, such as\n    // ICorDebugModule.GetClassFromToken() -> ICorDebugClass\n    // These objects are always cached by ICorDebug, and they will have the same pointer\n    // identity regardless of whether they were created/queried from the container module\n    // or a sub-module. The sub-module serves as a filtered view of these cached\n    // objects, not a separate cache with its own copies.\n    //\n    // Enabling Virtual Module Splitting has the following effects elsewhere in the API:\n    // ICorDebugFunction.GetModule\n    //     Disabled - Returns the container module this function was merged into\n    //     Enabled - Returns the sub-module this function was originally defined in\n    // ICorDebugClass.GetModule\n    //     Disabled - Returns the container module this class was merged into\n    //     Enabled - Returns the sub-module this class was originally defined in\n    // ICorDebugModuleDebugEvent.GetModule\n    //     Enabled OR Disabled - Returns the container module that was loaded.\n    //                           Sub-modules are not given load events regardless of this\n    //                           setting.\n    // ICorDebugAppDomain.EnumerateAssemblies\n    //     Disabled - Returns a list of container assemblies + regular assemblies\n    //                (no sub-assemblies are shown)\n    //     Enabled - Returns the list of sub-assemblies + regular assemblies\n    //                (no container assemblies are shown).\n    //                Note: If any container assembly is missing symbols, none of its\n    //                sub-assemblies will be enumerated. If any regular assembly is\n    //                missing symbols it may or may not be enumerated.\n    // ICorDebugCode.GetCode (when referring to IL code only)\n    //     Disabled - Returns the IL in the post-merge assembly image.\n    //     Enabled - Returns IL that would be valid in a pre-merge assembly image. Specifically\n    //               any inline metadata tokens will correctly be TypeRef or MemberRef tokens\n    //               when the types being referred to are not defined in the virtual module\n    //               containing the IL. These TypeRefs/MemberRefs can be looked up in the\n    //               IMetaDataImport for the corresponding virtual ICorDebugModule.\n    //\n    // This setting can be changed at any time. It does not incur any stateful functional\n    // changes in ICorDebug, beyond altering the behavior of the above APIs at the time they are\n    // called. Using virtual modules does incur a performance penalty for all the above\n    // APIs. Additionally the virtualized metadata may do significant in-memory caching required\n    // to correctly implement the IMetaDataImport APIs, and these caches may be retained\n    // even after virtual module splitting has been turned off.\n    HRESULT EnableVirtualModuleSplitting(BOOL enableSplitting);\n\n    // Changes internal state of the debuggee so that the System.Debugger.IsAttached API in the BCL\n    // returns true.\n    //\n    // Returns\n    //   S_OK - debuggee is successfully updated\n    //   CORDBG_E_MODULE_NOT_LOADED - assembly containing System.Debugger.IsAttached API is not loaded\n    //   or some other error is preventing it from being recognized such as missing metadata. This error\n    //   is common and benign - it is recommended to try the call again when future assemblies load.\n    //\n    //   other misc failing HRESULTs are possible, but likely indicate misbehaving debugger or compiler\n    //   components\n    HRESULT MarkDebuggerAttached(BOOL fIsAttached);\n\n    // Provides information on runtime exported functions to help step to managed code\n    //\n    // Parameters\n    //   pszExportName - The name of a runtime export function as written in the PE export table\n    //   invokeKind - [out] A description of how the exported function will invoke managed code\n    //   invokePurpose - [out] A description of why the exported function will call managed code\n    //\n    // Returns\n    //   S_OK - on success\n    //   E_POINTER - pInvokeKind or pInvokePurpose is NULL\n    //   Other failing HRESULTs as appropriate\n    //\n    HRESULT GetExportStepInfo([in]LPCWSTR pszExportName, [out]CorDebugCodeInvokeKind* pInvokeKind, [out]CorDebugCodeInvokePurpose* pInvokePurpose);\n}\n\ntypedef enum WriteableMetadataUpdateMode\n{\n   LegacyCompatPolicy,\n   AlwaysShowUpdates\n} WriteableMetadataUpdateMode;\n\n\n[\n    object,\n    local,\n    uuid(9B2C54E4-119F-4D6F-B402-527603266D69),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess7 : IUnknown\n{\n    // Configures how the debugger handles metadata that has been updated in-memory\n    // within the target process. These updates could come from EnC, a profiler,\n    // or Reflection.Emit\n    HRESULT SetWriteableMetadataUpdateMode(WriteableMetadataUpdateMode flags);\n}\n\n[\n    object,\n    local,\n    uuid(2E6F28C1-85EB-4141-80AD-0A90944B9639),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess8 : IUnknown\n{\n    /*\n    * EnableExceptionCallbacksOutsideOfMyCode enables/disables certain types of exception callback to ICorDebugManagedCallback2.\n    * If the flag is FALSE:\n    * 1) DEBUG_EXCEPTION_FIRST_CHANCE callbacks won't called in the debugger.\n    * 2) DEBUG_EXCEPTION_CATCH_HANDLER_FOUND callbacks won't be called if an exception never escapes into user code.\n    * (i.e. a path from an exception origin to an exception handler has no methods marked as JMC)\n    *\n    * Default value of this flag is TRUE.\n    */\n    HRESULT EnableExceptionCallbacksOutsideOfMyCode([in] BOOL enableExceptionsOutsideOfJMC);\n}\n\n[\n    object,\n    local,\n    uuid(8F378F6F-1017-4461-9890-ECF64C54079F),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess10 : IUnknown\n{\n    //\n    // Enable or disable the GC notification events. The GC notification events are turned off by default\n    // They will be delivered through ICorDebugManagedCallback4\n    //\n    // This interface is deprecated. The EnableGCNotificationEvents(true) occasionally deadlocked debug sessions\n    // in .NET Core 5.0 and later. Please use the IID_ICorDebugHeapValue4 to pin an object and prevent its relocation\n    //\n    // Parameters\n    //   fEnable - true to enable the events, false to disable\n    //\n    // Returns\n    //   S_OK - on success\n    //\n    HRESULT EnableGCNotificationEvents(BOOL fEnable);\n}\n\n// The memory range described by this structure is a closed-open\n// interval, that is only the start is inclusive.\ntypedef struct _COR_MEMORY_RANGE\n{\n    CORDB_ADDRESS start;          // The start address of the range.\n    CORDB_ADDRESS end;            // The end address of the range.\n} COR_MEMORY_RANGE;\n\n[\n    object,\n    local,\n    uuid(D1A0BCFC-5865-4437-BE3F-36F022951F8A),\n    pointer_default(unique)\n]\ninterface ICorDebugMemoryRangeEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of objects in the enumeration.\n     * The actual number of objects retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of objects retrieved is smaller\n     * than the number of objects requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt),\n                  length_is(*pceltFetched)] COR_MEMORY_RANGE objects[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(344B37AA-F2C0-4D3B-9909-91CCF787DA8C),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess11 : IUnknown\n{\n    HRESULT EnumerateLoaderHeapMemoryRegions([out] ICorDebugMemoryRangeEnum** ppRanges);\n}\n\n// Event types MODULE_LOADED and MODULE_UNLOADED implement this interface\n[\n    object,\n    local,\n    uuid(51A15E8D-9FFF-4864-9B87-F4FBDEA747A2),\n    pointer_default(unique)\n]\ninterface ICorDebugModuleDebugEvent : ICorDebugDebugEvent\n{\n    /*\n     * Gets the merged module that was just loaded or unloaded. Use\n     * ICorDebugDebugEvent.GetEventType() to determine whether it was load/unload.\n     */\n    HRESULT GetModule([out]ICorDebugModule **ppModule);\n}\n\n// This interface is implemented by events types:\n// MANAGED_EXCEPTION_FIRST_CHANCE,\n// MANAGED_EXCEPTION_USER_FIRST_CHANCE,\n// MANAGED_EXCEPTION_CATCH_HANDLER_FOUND,\n// MANAGED_EXCEPTION_UNHANDLED,\n[\n    object,\n    local,\n    uuid(AF79EC94-4752-419C-A626-5FB1CC1A5AB7),\n    pointer_default(unique)\n]\ninterface ICorDebugExceptionDebugEvent : ICorDebugDebugEvent\n{\n    // The meaning of this stack pointer varies based on event type (available from\n    // ICorDebugDebugEvent.GetEventType())\n    //\n    // MANAGED_EXCEPTION_FIRST_CHANCE -> The stack pointer for the frame that threw the exception\n    // MANAGED_EXCEPTION_USER_FIRST_CHANCE -> The stack pointer for the user-code frame closest to the point of\n    // the thrown exception\n    // MANAGED_EXCEPTION_CATCH_HANDLER_FOUND -> The stack pointer for the frame that contains the catch handler\n    // MANAGED_EXCEPTION_UNHANDLED -> *pStackPointer will be NULL\n    HRESULT GetStackPointer([out]CORDB_ADDRESS *pStackPointer);\n\n    // The meaning of the IP varies based on event type (available from\n    // ICorDebugDebugEvent.GetEventType())\n    //\n    // MANAGED_EXCEPTION_FIRST_CHANCE -> The address of the faulting instruction\n    // MANAGED_EXCEPTION_USER_FIRST_CHANCE -> Within the frame indicated by GetStackPointer(),\n    // this is the code address where execution would resume if no exception had been\n    // raised. The exception may or may not cause different code to be executed in this\n    // frame such as a catch of finally clause.\n    // MANAGED_EXCEPTION_CATCH_HANDLER_FOUND -> Within the frame indicated by GetStackPointer(),\n    // this is the code address where catch handler execution will start\n    // MANAGED_EXCEPTION_UNHANDLED -> *pIP will be 0\n    HRESULT GetNativeIP([out]CORDB_ADDRESS *pIP);\n\n\n    // Gets a flag that indicates if the exception is interceptable.\n    HRESULT GetFlags([out]CorDebugExceptionFlags *pdwFlags);\n}\n\n/* ------------------------------------------------------------------------- *\n * Breakpoint interface\n * ------------------------------------------------------------------------- */\n\n/*\n * ICorDebugBreakpoint represents a breakpoint; either a breakpoint\n * set in a function, or a watchpoint set on a value.\n *\n * Note that breakpoints have no direct support for condition\n * expressions.  The debugger must implement this functionality on top of\n * this interface if desired.\n *\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAE8-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugBreakpoint : IUnknown\n{\n    /*\n     * Sets the active state of the breakpoint\n     */\n    HRESULT Activate([in] BOOL bActive);\n\n    /*\n     * Returns whether the breakpoint is active.\n     */\n    HRESULT IsActive([out] BOOL *pbActive);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCAE9-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugFunctionBreakpoint : ICorDebugBreakpoint\n{\n    /*\n     * Returns the function on which this breakpoint is set\n     */\n    HRESULT GetFunction([out] ICorDebugFunction **ppFunction);\n\n    /*\n     * Returns the offset of this breakpoint within the function\n     */\n    HRESULT GetOffset([out] ULONG32 *pnOffset);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCAEA-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugModuleBreakpoint : ICorDebugBreakpoint\n{\n    /*\n     * Returns the module on which this breakpoint is set.\n     */\n    HRESULT GetModule([out] ICorDebugModule **ppModule);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCAEB-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugValueBreakpoint : ICorDebugBreakpoint\n{\n    /*\n     * Gets the value on which this breakpoint is set.\n     */\n    HRESULT GetValue([out] ICorDebugValue **ppValue);\n};\n\n/* ------------------------------------------------------------------------- *\n * Stepper interface\n * ------------------------------------------------------------------------- */\n\n/*\n * A Stepper object represents a stepping operation being performed by\n * the debugger.  Note that there can be more than one stepper per\n * thread; for instance a breakpoint may be hit in the midst of a\n * stepping over a function, and the user may wish to start a new\n * stepping operation inside that function. (Note that it is up to the\n * debugger how to handle this; it may want to cancel the original\n * stepping operation, or nest them.  This API allows either behavior.)\n *\n * Also, a stepper may migrate between threads if a cross-thread\n * marshalled call is made by the EE.\n *\n * This object serves several purposes.  Its serves as an identifier between a\n * step command issued and the completion of that command. It also\n * provides a central interface to encapsulate all of the stepping\n * that can be performed.  Finally it provides a way to prematurely\n * cancel a stepping operation.\n *\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAEC-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugStepper : IUnknown\n{\n    /*\n     * IsActive returns whether or not the stepper is active, that is, whether\n     * it is currently stepping.\n     *\n     * Any step action remains active until StepComplete is called.  Note that\n     * this automatically deactivates the stepper.\n     *\n     * A stepper may also be deactivated prematurely by calling\n     * Deactivate before a callback condition is reached.\n     */\n\n    HRESULT IsActive([out] BOOL *pbActive);\n\n    /*\n     * Deactivate causes a stepper to cancel the last stepping command it\n     * received.  A new stepping command may then be issued.\n     */\n\n    HRESULT Deactivate();\n\n    /*\n     * SetInterceptMask controls which intercept code will be stepped\n     * into by the stepper. If the bit for an interceptor is set, the\n     * stepper will complete with reason STEPPER_INTERCEPT when the\n     * given type of intercept occurs.  If the bit is cleared, the\n     * intercepting code will be skipped.\n     *\n     * Note that SetInterceptMask may have unforeseen interactions\n     * with SetUnmappedStopMask (from the user's point of view).  For\n     * example, if the only visible (ie, non internal) portion of class\n     * init code lacks mapping info (STOP_NO_MAPPING_INFO) and\n     * STOP_NO_MAPPING_INFO isn't set, then we'll step over the class init.\n     *\n     * By default, only INTERCEPT_NONE will be used.\n     */\n\n    typedef enum CorDebugIntercept\n    {\n          INTERCEPT_NONE                = 0x0 ,\n          INTERCEPT_CLASS_INIT          = 0x01,\n          INTERCEPT_EXCEPTION_FILTER    = 0x02,\n          INTERCEPT_SECURITY            = 0x04,\n          INTERCEPT_CONTEXT_POLICY      = 0x08,\n          INTERCEPT_INTERCEPTION        = 0x10,\n          INTERCEPT_ALL                 = 0xffff\n    } CorDebugIntercept;\n\n    HRESULT SetInterceptMask([in] CorDebugIntercept mask);\n\n    /*\n     * SetUnmappedStopMask controls whether the stepper\n     * will stop in jitted code which is not mapped to IL.\n     *\n     * If the given flag is set, then that type of unmapped code\n     * will be stopped in.  Otherwise stepping transparently continues.\n     *\n     * It should be noted that if one doesn't use a stepper to enter a\n     * method (for example, the main() method of C++), then one\n     * won't necessarily step over prologs,etc.\n     *\n     * By default, STOP_OTHER_UNMAPPED will be used.\n     *\n     * STOP_UNMANAGED is only valid w/ interop debugging.\n     */\n\n    typedef enum CorDebugUnmappedStop\n    {\n        STOP_NONE               = 0x0,\n        STOP_PROLOG             = 0x01,\n        STOP_EPILOG             = 0x02,\n        STOP_NO_MAPPING_INFO    = 0x04,\n        STOP_OTHER_UNMAPPED     = 0x08,\n        STOP_UNMANAGED          = 0x10,\n\n        STOP_ALL                = 0xffff,\n\n    } CorDebugUnmappedStop;\n\n    HRESULT SetUnmappedStopMask([in] CorDebugUnmappedStop mask);\n\n    /*\n     * Step is called when a thread is to be single stepped.  The step\n     * will complete at the next managed instruction executed by the\n     * EE in the stepper's frame.\n     *\n     * If bStepIn is TRUE, any function calls made during the step\n     * will be stepped into.  Otherwise they will be skipped.\n     *\n     * If Step is called on a stepper which is not in managed code,\n     * the step will complete when the next managed code is executed\n     * by the thread. (if bStepIn is FALSE, it will only complete\n     * when managed code is returned to, not when it is stepped into.)\n     */\n\n    HRESULT Step([in] BOOL bStepIn);\n\n    /*\n     * StepRange works just like Step, except it will not complete\n     * until code outside the given range is reached.  This can be\n     * more efficient than stepping one instruction at a time.\n     *\n     * Ranges are specified as a list of offset pairs [start, end)\n     * (note that end is exclusive) from the start of the stepper's\n     * frame's code.\n     *\n     * Ranges are in relative to the IL code of a method.  Call\n     * SetRangeIL(FALSE) to specify ranges relative to the native code\n     * of a method.\n     */\n\n    typedef struct COR_DEBUG_STEP_RANGE\n    {\n        ULONG32 startOffset, endOffset;\n    } COR_DEBUG_STEP_RANGE;\n\n    HRESULT StepRange([in] BOOL bStepIn,\n                      [in,size_is(cRangeCount)] COR_DEBUG_STEP_RANGE ranges[],\n                      [in] ULONG32 cRangeCount);\n\n    /*\n     * A StepOut operation will complete after the current frame is\n     * returned from normally and the previous frame is reactivated.\n     *\n     * If this is called when in unmanaged code, the step will complete\n     * when the calling managed code is returned to.\n     *\n     * In v2.0, we explicitly forbid StepOut with the STOP_UNMANAGED mask\n     * and will fail that. Interop debuggers must do step-out-to-native\n     * themselves.\n     */\n\n    HRESULT StepOut();\n\n    /*\n     * SetRangeIL is used to set whether the ranges passed StepRange are\n     * relative to the IL code or the native code for the method being\n     * stepped in.\n     *\n     * By default the range is in IL.\n     */\n\n    HRESULT SetRangeIL([in] BOOL bIL);\n};\n\n/*\n * ICorDebugStepper2 exposes JMC functionality.\n */\n[\n    object,\n    local,\n    uuid(C5B6E9C3-E7D1-4a8e-873B-7F047F0706F7),\n    pointer_default(unique)\n]\ninterface ICorDebugStepper2 : IUnknown\n{\n    HRESULT SetJMC([in] BOOL fIsJMCStepper);\n}\n\n/* ------------------------------------------------------------------------- *\n * Program state object interfaces\n * ------------------------------------------------------------------------- */\n\n/*\n * ICorDebugRegisterSet\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCB0B-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugRegisterSet : IUnknown\n{\n    typedef enum CorDebugRegister\n    {\n        // registers (potentially) available on all architectures\n        // Note that these overlap with the architecture-specific\n        // registers\n        //\n        // NOTE: On IA64, REGISTER_FRAME_POINTER represents the BSP register.\n\n        REGISTER_INSTRUCTION_POINTER = 0,\n        REGISTER_STACK_POINTER,\n        REGISTER_FRAME_POINTER,\n\n\n        // X86 registers\n\n        REGISTER_X86_EIP = 0,\n        REGISTER_X86_ESP,\n        REGISTER_X86_EBP,\n\n        REGISTER_X86_EAX,\n        REGISTER_X86_ECX,\n        REGISTER_X86_EDX,\n        REGISTER_X86_EBX,\n\n        REGISTER_X86_ESI,\n        REGISTER_X86_EDI,\n\n        REGISTER_X86_FPSTACK_0,\n        REGISTER_X86_FPSTACK_1,\n        REGISTER_X86_FPSTACK_2,\n        REGISTER_X86_FPSTACK_3,\n        REGISTER_X86_FPSTACK_4,\n        REGISTER_X86_FPSTACK_5,\n        REGISTER_X86_FPSTACK_6,\n        REGISTER_X86_FPSTACK_7,\n\n\n        // AMD64 registers\n\n        REGISTER_AMD64_RIP = 0,\n        REGISTER_AMD64_RSP,\n        REGISTER_AMD64_RBP,\n\n        REGISTER_AMD64_RAX,\n        REGISTER_AMD64_RCX,\n        REGISTER_AMD64_RDX,\n        REGISTER_AMD64_RBX,\n\n        REGISTER_AMD64_RSI,\n        REGISTER_AMD64_RDI,\n\n        REGISTER_AMD64_R8,\n        REGISTER_AMD64_R9,\n        REGISTER_AMD64_R10,\n        REGISTER_AMD64_R11,\n        REGISTER_AMD64_R12,\n        REGISTER_AMD64_R13,\n        REGISTER_AMD64_R14,\n        REGISTER_AMD64_R15,\n\n        // Xmm FP\n\n        REGISTER_AMD64_XMM0,\n        REGISTER_AMD64_XMM1,\n        REGISTER_AMD64_XMM2,\n        REGISTER_AMD64_XMM3,\n        REGISTER_AMD64_XMM4,\n        REGISTER_AMD64_XMM5,\n        REGISTER_AMD64_XMM6,\n        REGISTER_AMD64_XMM7,\n        REGISTER_AMD64_XMM8,\n        REGISTER_AMD64_XMM9,\n        REGISTER_AMD64_XMM10,\n        REGISTER_AMD64_XMM11,\n        REGISTER_AMD64_XMM12,\n        REGISTER_AMD64_XMM13,\n        REGISTER_AMD64_XMM14,\n        REGISTER_AMD64_XMM15,\n\n\n        // IA64 registers\n\n        REGISTER_IA64_BSP = REGISTER_FRAME_POINTER,\n\n        // To get a particular general register, add the register number\n        // to REGISTER_IA64_R0.  The same also goes for floating point\n        // registers.\n        //\n        // For example, if you need REGISTER_IA64_R83,\n        // use REGISTER_IA64_R0 + 83.\n        REGISTER_IA64_R0  = REGISTER_IA64_BSP + 1,\n        REGISTER_IA64_F0  = REGISTER_IA64_R0  + 128,\n\n\n        // ARM registers (@ARMTODO: FP?)\n\n        REGISTER_ARM_PC = 0,\n        REGISTER_ARM_SP,\n        REGISTER_ARM_R0,\n        REGISTER_ARM_R1,\n        REGISTER_ARM_R2,\n        REGISTER_ARM_R3,\n        REGISTER_ARM_R4,\n        REGISTER_ARM_R5,\n        REGISTER_ARM_R6,\n        REGISTER_ARM_R7,\n        REGISTER_ARM_R8,\n        REGISTER_ARM_R9,\n        REGISTER_ARM_R10,\n        REGISTER_ARM_R11,\n        REGISTER_ARM_R12,\n        REGISTER_ARM_LR,\n        REGISTER_ARM_D0,\n        REGISTER_ARM_D1,\n        REGISTER_ARM_D2,\n        REGISTER_ARM_D3,\n        REGISTER_ARM_D4,\n        REGISTER_ARM_D5,\n        REGISTER_ARM_D6,\n        REGISTER_ARM_D7,\n        REGISTER_ARM_D8,\n        REGISTER_ARM_D9,\n        REGISTER_ARM_D10,\n        REGISTER_ARM_D11,\n        REGISTER_ARM_D12,\n        REGISTER_ARM_D13,\n        REGISTER_ARM_D14,\n        REGISTER_ARM_D15,\n        REGISTER_ARM_D16,\n        REGISTER_ARM_D17,\n        REGISTER_ARM_D18,\n        REGISTER_ARM_D19,\n        REGISTER_ARM_D20,\n        REGISTER_ARM_D21,\n        REGISTER_ARM_D22,\n        REGISTER_ARM_D23,\n        REGISTER_ARM_D24,\n        REGISTER_ARM_D25,\n        REGISTER_ARM_D26,\n        REGISTER_ARM_D27,\n        REGISTER_ARM_D28,\n        REGISTER_ARM_D29,\n        REGISTER_ARM_D30,\n        REGISTER_ARM_D31,\n\n\n        // ARM64 registers\n\n        REGISTER_ARM64_PC = 0,\n        REGISTER_ARM64_SP,\n        REGISTER_ARM64_FP,\n        REGISTER_ARM64_X0,\n        REGISTER_ARM64_X1,\n        REGISTER_ARM64_X2,\n        REGISTER_ARM64_X3,\n        REGISTER_ARM64_X4,\n        REGISTER_ARM64_X5,\n        REGISTER_ARM64_X6,\n        REGISTER_ARM64_X7,\n        REGISTER_ARM64_X8,\n        REGISTER_ARM64_X9,\n        REGISTER_ARM64_X10,\n        REGISTER_ARM64_X11,\n        REGISTER_ARM64_X12,\n        REGISTER_ARM64_X13,\n        REGISTER_ARM64_X14,\n        REGISTER_ARM64_X15,\n        REGISTER_ARM64_X16,\n        REGISTER_ARM64_X17,\n        REGISTER_ARM64_X18,\n        REGISTER_ARM64_X19,\n        REGISTER_ARM64_X20,\n        REGISTER_ARM64_X21,\n        REGISTER_ARM64_X22,\n        REGISTER_ARM64_X23,\n        REGISTER_ARM64_X24,\n        REGISTER_ARM64_X25,\n        REGISTER_ARM64_X26,\n        REGISTER_ARM64_X27,\n        REGISTER_ARM64_X28,\n        REGISTER_ARM64_LR,\n\n        REGISTER_ARM64_V0,\n        REGISTER_ARM64_V1,\n        REGISTER_ARM64_V2,\n        REGISTER_ARM64_V3,\n        REGISTER_ARM64_V4,\n        REGISTER_ARM64_V5,\n        REGISTER_ARM64_V6,\n        REGISTER_ARM64_V7,\n        REGISTER_ARM64_V8,\n        REGISTER_ARM64_V9,\n        REGISTER_ARM64_V10,\n        REGISTER_ARM64_V11,\n        REGISTER_ARM64_V12,\n        REGISTER_ARM64_V13,\n        REGISTER_ARM64_V14,\n        REGISTER_ARM64_V15,\n        REGISTER_ARM64_V16,\n        REGISTER_ARM64_V17,\n        REGISTER_ARM64_V18,\n        REGISTER_ARM64_V19,\n        REGISTER_ARM64_V20,\n        REGISTER_ARM64_V21,\n        REGISTER_ARM64_V22,\n        REGISTER_ARM64_V23,\n        REGISTER_ARM64_V24,\n        REGISTER_ARM64_V25,\n        REGISTER_ARM64_V26,\n        REGISTER_ARM64_V27,\n        REGISTER_ARM64_V28,\n        REGISTER_ARM64_V29,\n        REGISTER_ARM64_V30,\n        REGISTER_ARM64_V31,\n\n        // LoongArch64 registers\n        REGISTER_LOONGARCH64_PC = 0,\n        REGISTER_LOONGARCH64_SP,\n        REGISTER_LOONGARCH64_FP,\n        REGISTER_LOONGARCH64_RA,\n        REGISTER_LOONGARCH64_TP,\n        REGISTER_LOONGARCH64_A0,\n        REGISTER_LOONGARCH64_A1,\n        REGISTER_LOONGARCH64_A2,\n        REGISTER_LOONGARCH64_A3,\n        REGISTER_LOONGARCH64_A4,\n        REGISTER_LOONGARCH64_A5,\n        REGISTER_LOONGARCH64_A6,\n        REGISTER_LOONGARCH64_A7,\n        REGISTER_LOONGARCH64_T0,\n        REGISTER_LOONGARCH64_T1,\n        REGISTER_LOONGARCH64_T2,\n        REGISTER_LOONGARCH64_T3,\n        REGISTER_LOONGARCH64_T4,\n        REGISTER_LOONGARCH64_T5,\n        REGISTER_LOONGARCH64_T6,\n        REGISTER_LOONGARCH64_T7,\n        REGISTER_LOONGARCH64_T8,\n        REGISTER_LOONGARCH64_X0,\n        REGISTER_LOONGARCH64_S0,\n        REGISTER_LOONGARCH64_S1,\n        REGISTER_LOONGARCH64_S2,\n        REGISTER_LOONGARCH64_S3,\n        REGISTER_LOONGARCH64_S4,\n        REGISTER_LOONGARCH64_S5,\n        REGISTER_LOONGARCH64_S6,\n        REGISTER_LOONGARCH64_S7,\n        REGISTER_LOONGARCH64_S8,\n\n        REGISTER_LOONGARCH64_F0,\n        REGISTER_LOONGARCH64_F1,\n        REGISTER_LOONGARCH64_F2,\n        REGISTER_LOONGARCH64_F3,\n        REGISTER_LOONGARCH64_F4,\n        REGISTER_LOONGARCH64_F5,\n        REGISTER_LOONGARCH64_F6,\n        REGISTER_LOONGARCH64_F7,\n        REGISTER_LOONGARCH64_F8,\n        REGISTER_LOONGARCH64_F9,\n        REGISTER_LOONGARCH64_F10,\n        REGISTER_LOONGARCH64_F11,\n        REGISTER_LOONGARCH64_F12,\n        REGISTER_LOONGARCH64_F13,\n        REGISTER_LOONGARCH64_F14,\n        REGISTER_LOONGARCH64_F15,\n        REGISTER_LOONGARCH64_F16,\n        REGISTER_LOONGARCH64_F17,\n        REGISTER_LOONGARCH64_F18,\n        REGISTER_LOONGARCH64_F19,\n        REGISTER_LOONGARCH64_F20,\n        REGISTER_LOONGARCH64_F21,\n        REGISTER_LOONGARCH64_F22,\n        REGISTER_LOONGARCH64_F23,\n        REGISTER_LOONGARCH64_F24,\n        REGISTER_LOONGARCH64_F25,\n        REGISTER_LOONGARCH64_F26,\n        REGISTER_LOONGARCH64_F27,\n        REGISTER_LOONGARCH64_F28,\n        REGISTER_LOONGARCH64_F29,\n        REGISTER_LOONGARCH64_F30,\n        REGISTER_LOONGARCH64_F31,\n\n        // other architectures here\n\n    } CorDebugRegister;\n\n    /*\n     * GetRegistersAvailable returns a mask indicating which registers\n     * are available in the given register set.  Registers may be unavailable\n     * if their value is undeterminable for the given situation.  The returned\n     * word contains a bit for each register (1 << register index), which will\n     * be 1 if the register is available or 0 if it is not.\n     */\n\n    HRESULT GetRegistersAvailable([out] ULONG64 *pAvailable);\n\n    /*\n     * GetRegisters returns an array of register values corresponding\n     * to the given mask.  The registers which have their bit set in\n     * the mask will be packed into the resulting array.  (No room is\n     * assigned in the array for registers whose mask bit is not set.)\n     * Thus, the size of the array should be equal to the number of\n     * 1's in the mask.\n     *\n     * If an unavailable register is indicated by the mask, an indeterminate\n     * value will be returned for the corresponding register.\n     *\n     * registerBufferCount should indicate number of elements in the\n     * buffer to receive the register values.  If it is too small for\n     * the number of registers indicated by the mask, the higher\n     * numbered registers will be truncated from the set.  Or, if it\n     * is too large, the unused registerBuffer elements will be\n     * unmodified.  */\n\n    HRESULT GetRegisters([in] ULONG64 mask, [in] ULONG32 regCount,\n                         [out, size_is(regCount), length_is(regCount)]\n                         CORDB_REGISTER regBuffer[]);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT SetRegisters([in] ULONG64 mask,\n                         [in] ULONG32 regCount,\n                         [in, size_is(regCount)] CORDB_REGISTER regBuffer[]);\n\n    /*\n     * GetThreadContext returns the context for the given thread.  The\n     * debugger should call this function rather than the Win32\n     * GetThreadContext, because the thread may actually be in a \"hijacked\"\n     * state where its context has been temporarily changed.\n     *\n     * The data returned is a CONTEXT structure for the current platform.\n     *\n     * For non-leaf frames, clients should check which registers are valid by\n     * using GetRegistersAvailable.\n     *\n     */\n\n    HRESULT GetThreadContext([in] ULONG32 contextSize,\n                             [in, out, length_is(contextSize),\n                             size_is(contextSize)] BYTE context[]);\n\n    /*\n     * Not implemented in v2.0. It is too dangerous to manipulate the context of\n     * threads in Managed code. Use other high level operations (like SetIp,\n     * ICorDebugValue::SetValue) instead.\n     *\n     */\n\n    HRESULT SetThreadContext([in] ULONG32 contextSize,\n                             [in, length_is(contextSize),\n                             size_is(contextSize)] BYTE context[]);\n}\n\n/*\n * ICorDebugRegisterSet2 is an extension for hardward platforms with more\n * than 64 registers, since ICorDebugRegisterSet::GetRegisters() only\n * recognizes a 64-bit mask.\n */\n\n[\n    object,\n    local,\n    uuid(6DC7BA3F-89BA-4459-9EC1-9D60937B468D),\n    pointer_default(unique)\n]\ninterface ICorDebugRegisterSet2 : IUnknown\n{\n    /*\n     * Given a CorDebugRegister value, its position in the mask is determined as\n     * follows:\n     *\n     * 1) (value >> 3) is used to index the array of BYTEs, and\n     * 2) (value &  7) (the least significant three bits) represents the bit position\n     *    within the indexed BYTE, where bit 0 is the least significant bit.\n     *\n     * Or, in code:\n     *\n     *    #define REGISTER_IA64_MAX              REGISTER_IA64_F0 + 128\n     *    #define MAX_MASK_COUNT                 ((REGISTER_IA64_MAX + 7) >> 3)\n     *    #define SET_BIT_MASK(_mask, _reg)      _mask[(_reg) >> 3] |=  (1 << ((_reg) & 7))\n     *    #define RESET_BIT_MASK(_mask, _reg)    _mask[(_reg) >> 3] &= ~(1 << ((_reg) & 7))\n     *    #define IS_SET_BIT_MASK(_mask, _reg)   _mask[(_reg) >> 3] &   (1 << ((_reg) & 7))\n     *\n     *    CorDebugRegister value = <some value>;\n     *    BYTE pAvailable[MAX_MASK_COUNT];\n     *\n     *    GetRegistersAvailable(MAX_MASK_COUNT, pAvailable);\n     *    ASSERT(value < REGISTER_IA64_MAX);\n     *    IS_SET_BIT_MASK(pAvailable, value);\n     */\n\n    HRESULT GetRegistersAvailable([in] ULONG32 numChunks,\n                                  [out, size_is(numChunks)] BYTE availableRegChunks[]);\n\n    HRESULT GetRegisters([in] ULONG32 maskCount,\n                         [in, size_is(maskCount)] BYTE mask[],\n                         [in] ULONG32 regCount,\n                         [out, size_is(regCount)] CORDB_REGISTER regBuffer[]);\n\n    HRESULT SetRegisters([in] ULONG32 maskCount,\n                         [in, size_is(maskCount)] BYTE mask[],\n                         [in] ULONG32 regCount,\n                         [in, size_is(regCount)] CORDB_REGISTER regBuffer[]);\n}\n\n/*\n * ICorDebugThread represents a thread in the process.  The lifetime of a\n * thread object is equal to the lifetime of the thread it represents.\n */\n\n[\n    object,\n    local,\n    uuid(938c6d66-7fb6-4f69-b389-425b8987329b),\n    pointer_default(unique)\n]\ninterface ICorDebugThread : IUnknown\n{\n    /*\n     * GetProcess returns the process of which this thread is a part.\n     */\n\n    HRESULT GetProcess([out] ICorDebugProcess **ppProcess);\n\n    /*\n     * GetID returns the current OS ID of the active part of the thread.\n     * Note that this may theoretically change as the process executes,\n     * and even be different for different parts of the thread.\n     */\n\n    HRESULT GetID([out] DWORD *pdwThreadId);\n\n    /*\n     * GetHandle returns the current Handle of the active part of the thread.\n     * Note that this may theoretically change as the process executes,\n     * and even be different for different parts of the thread.\n     *\n     * This handle is owned by the debugging API. The debugger should duplicate\n     * it before using it.\n     */\n\n    HRESULT GetHandle([out] HTHREAD *phThreadHandle);\n\n    /*\n     * GetAppDomain returns the app domain which the thread is currently\n     * executing in.\n     */\n\n    HRESULT GetAppDomain([out] ICorDebugAppDomain **ppAppDomain);\n\n    /*\n     * SetDebugState sets the current debug state of the thread.\n     * (The \"current debug state\"\n     * represents the debug state if the process were to be continued,\n     * not the actual current state.)\n     *\n     * The normal value for this is THREAD_RUNNING.  Only the debugger\n     * can affect the debug state of a thread.  Debug states do\n     * last across continues, so if you want to keep a thread\n     * THREAD_SUSPENDed over multiple continues, you can set it once\n     * and thereafter not have to worry about it.\n     *\n     * Suspending threads and resuming the process can cause deadlocks, though it's\n     * usually unlikely. This is an intrinsic quality of threads and processes and is by-design.\n     * A debugger can async break and resume the threads to break the deadlock.\n     *\n     * If the thread's user state includes USER_UNSAFE_POINT, then the thread may block a GC.\n     * This means the suspended thread has a mcuh higher chance of causing a deadlock.\n     *\n     * This may not affect debug events already queued. Thus a debugger should drain the entire\n     * event queue (via calling HasQueuedCallbacks) before suspending or resuming threads. Else it\n     * may get events on a thread that it believes it has already suspended.\n     *\n     */\n\n    HRESULT SetDebugState([in] CorDebugThreadState state);\n\n    /*\n     * GetDebugState returns the current debug state of the thread.\n     * (If the process is currently stopped, the \"current debug state\"\n     * represents the debug state if the process were to be continued,\n     * not the actual current state.)\n     */\n\n    HRESULT GetDebugState([out] CorDebugThreadState *pState);\n\n    /*\n     * GetUserState returns the user state of the thread, that is, the state\n     * which it has when the program being debugged examines it.\n     * A thread may have multiple state bits set.\n     */\n\n    typedef enum CorDebugUserState\n    {\n        USER_STOP_REQUESTED     = 0x01,\n        USER_SUSPEND_REQUESTED  = 0x02,\n        USER_BACKGROUND         = 0x04,\n        USER_UNSTARTED          = 0x08,\n        USER_STOPPED            = 0x10,\n        USER_WAIT_SLEEP_JOIN    = 0x20,\n        USER_SUSPENDED          = 0x40,\n\n        // An \"unsafe point\" is a place where the thread may block a Garbage Collection (GC).\n        // Debug events may be dispatched from unsafe points, but suspending a thread at\n        // an unsafe spot will very likely cause a deadlock (until the thread is resumed).\n        // This is a function of the thread's IP and the available GC info. The exact details\n        // of what is safe and unsafe is unspecified and highly determined by jit/gc implementation details.\n        USER_UNSAFE_POINT       = 0x80,\n\n        // indicates that this thread is a threadpool thread\n        USER_THREADPOOL         = 0x100,\n    } CorDebugUserState;\n\n    HRESULT GetUserState([out] CorDebugUserState *pState);\n\n    /*\n     * GetCurrentException returns the exception object which is\n     * currently being thrown by the thread.  This will exist from the time the exception\n     * is thrown until the end of the catch block. That range will include filters\n     * and finallys.\n     *\n     * FuncEval will clear out the exception object on setup and restore it on completion.\n     *\n     * Exceptions can be nested (eg, if an exception is thrown in filter or a func-eval),\n     * so there may be multiple outstanding exceptions on a single thread.\n     * This returns the most current exception.\n     *\n     * The exception object and type may change throughout the life of the exception. For example, an\n     * exception of type X may be thrown, but then the CLR may run out of memory and promote\n     * that to an OutOfMemory exception.\n     */\n\n    HRESULT GetCurrentException([out] ICorDebugValue **ppExceptionObject);\n\n    /*\n     * This is not implemented.\n     */\n\n    HRESULT ClearCurrentException();\n\n    /*\n     * CreateStepper creates a stepper object which operates relative\n     * to the active frame in the given thread. (Note that this may be\n     * unmanaged code.)  The Stepper API must then be used to perform\n     * actual stepping.\n     *\n     */\n\n    HRESULT CreateStepper([out] ICorDebugStepper **ppStepper);\n\n    /*\n     * EnumerateChains returns an enum which will return all the stack\n     * chains in the thread, starting at the active (most recent) one.\n     * These chains represent the physical call stack for the thread.\n     *\n     * Chain boundaries occur for several reasons:\n     *   managed <-> unmanaged transitions\n     *   context switches\n     *   debugger hijacking of user threads\n     *\n     * Note that in the simple case for a thread running purely\n     * managed code in a single context there will be a one to one\n     * correspondence between threads & chains.\n     *\n     * A debugger may want to rearrange the physical call\n     * stacks of all threads into logical call stacks. This would involve\n     * sorting all the threads' chains by their caller/callee\n     * relationships & regrouping them.\n     *\n     */\n\n    HRESULT EnumerateChains([out] ICorDebugChainEnum **ppChains);\n\n    /*\n     * GetActiveChain is a convenience routine to return the\n     * active (most recent) chain on the thread, if any.\n     *\n     */\n\n    HRESULT GetActiveChain([out] ICorDebugChain **ppChain);\n\n    /*\n     * GetActiveFrame is a convenience routine to return the\n     * active (most recent) frame on the thread, if any.\n     * If there are no frames on the stack, ppFrame will point to NULL\n     * and the function still returns S_OK.\n     */\n\n    HRESULT GetActiveFrame([out] ICorDebugFrame **ppFrame);\n\n    /*\n     * GetRegisterSet returns the register set for the active part\n     * of the thread.\n     *\n     */\n\n    HRESULT GetRegisterSet([out] ICorDebugRegisterSet **ppRegisters);\n\n    /*\n     * CreateEval creates an evaluation object which operates on the\n     * given thread.  The Eval will push a new chain on the thread before\n     * doing its computation.\n     *\n     * Note that this interrupts the computation currently\n     * being performed on the thread until the eval completes.\n     *\n     */\n\n    HRESULT CreateEval([out] ICorDebugEval **ppEval);\n\n    /*\n     * Returns the runtime thread object.\n     */\n\n    HRESULT GetObject([out] ICorDebugValue **ppObject);\n\n};\n\n/*\n  * ICorDebugThread2 is a logical extension to ICorDebugThread.\n  */\n[\n    object,\n    local,\n    uuid(2BD956D9-7B07-4bef-8A98-12AA862417C5),\n    pointer_default(unique)\n]\ninterface ICorDebugThread2 : IUnknown\n{\n\n    typedef struct _COR_ACTIVE_FUNCTION\n    {\n        ICorDebugAppDomain *pAppDomain;   // Pointer to the owning AppDomain of the below IL Offset.\n        ICorDebugModule *pModule;         // Pointer to the owning Module of the below IL Offset.\n        ICorDebugFunction2 *pFunction;    // Pointer to the owning Function of the below IL Offset.\n        ULONG32 ilOffset;                 // IL Offset of the frame.\n        ULONG32 flags;                    // Bit mask of flags, currently unused.  Reserved.\n    } COR_ACTIVE_FUNCTION;\n\n    /*\n     * Retrieves the active functions for the given threads' frames. This\n     * includes AppDomain ID, Module ID, Funtion ID and IL offset for\n     * each active statement on the stack.  A flags field is also included\n     * for future information about the frame that might need to be conveyed.\n     *\n     * If pFunctions is NULL, returns only the number of functions that\n     * is on the stack in pcFunctions.\n     */\n\n    HRESULT GetActiveFunctions([in] ULONG32 cFunctions,\n                               [out] ULONG32 *pcFunctions,\n                               [in, out, size_is(cFunctions), length_is(*pcFunctions)]\n                               COR_ACTIVE_FUNCTION pFunctions[]\n                               );\n    /*\n     * Returns 0 if not part of a connection\n     * Maps to a SPID in SQL Server\n     */\n    HRESULT GetConnectionID(\n        [out] CONNID *pdwConnectionId);\n\n    /*\n     * Return the TASKID of this thread.\n    */\n    HRESULT GetTaskID(\n        [out] TASKID *pTaskId);\n\n    /*\n     * Return the OS Thread ID\n     */\n    HRESULT GetVolatileOSThreadID(\n        [out] DWORD *pdwTid);\n\n    /*\n     * Allow the debugger to intercept the current exception on a thread.  It can be\n     * called between an Exception callback and the associated call to ICorDebugProcess::Continue.\n     *\n     * pFrame specifies where we should intercept the exception.  It must be a valid ICDFrame pointer,\n     * which can be obtained from a stackwalk.  However, you must not call Continue() between\n     * doing the stackwalk and calling this function.\n     */\n    HRESULT InterceptCurrentException(\n        [in] ICorDebugFrame *pFrame);\n}\n\n\n\n/*\n * ICorDebugThread3 is a logical extension to ICorDebugThread.\n */\n[\n    object,\n    local,\n    uuid(F8544EC3-5E4E-46c7-8D3E-A52B8405B1F5),\n    pointer_default(unique)\n]\ninterface ICorDebugThread3 : IUnknown\n{\n    HRESULT CreateStackWalk([out] ICorDebugStackWalk **ppStackWalk);\n\n    HRESULT GetActiveInternalFrames([in] ULONG32 cInternalFrames,\n                                    [out] ULONG32 *pcInternalFrames,\n                                    [in, out, size_is(cInternalFrames), length_is(*pcInternalFrames)]\n                                    ICorDebugInternalFrame2 * ppInternalFrames[]\n                                    );\n};\n\n/*\n * ICorDebugThread4 is a logical extension to ICorDebugThread.\n */\n[\n    object,\n    local,\n    uuid(1A1F204B-1C66-4637-823F-3EE6C744A69C),\n    pointer_default(unique)\n]\ninterface ICorDebugThread4 : IUnknown\n{\n    /*\n     * Returns S_OK if ICorDebugThread::GetCurrentException() is non-NULL and the exception\n     * it refers to has completed the first pass of exception handling without locating\n     * a catch clause.\n     * Returns S_FALSE if there is no exception, it hasn't completed first pass handling,\n     * or a catch handler was located\n     * Returns an appropriate error HRESULT when the answer can not be determined\n     */\n    HRESULT HasUnhandledException();\n\n    HRESULT GetBlockingObjects([out] ICorDebugBlockingObjectEnum **ppBlockingObjectEnum);\n    /*\n     * Gets the current CustomNotification object on the current thread. This could be NULL if no\n     * current notification object exists. If we aren't currently inside a CustomNotification callback,\n     * this will always return NULL.\n     * A debugger can examine this object to determine how to handle the notification.\n     * See ICorDebugManagedCallback3::CustomNotification for more information about\n     * custom notifications.\n     */\n    HRESULT GetCurrentCustomDebuggerNotification([out] ICorDebugValue ** ppNotificationObject);\n};\n\n/*\n * ICorDebugThread5 is a logical extension to ICorDebugThread.\n */\n[\n    object,\n    local,\n    uuid(F98421C4-E506-4D24-916F-0237EE853EC6),\n    pointer_default(unique)\n]\ninterface ICorDebugThread5 : IUnknown\n{\n    /*\n     * Returns S_OK if it was possible to obtain the allocation information for the thread\n     * and sets the corresponding SOH and UOH allocations.\n     * Returns E_INVALIDARG if any of the pointers for the outputs is null.\n     * Can return E_FAIL if the process is not properly stopped.\n     */\n    HRESULT GetBytesAllocated([out] ULONG64 *pSohAllocatedBytes, [out] ULONG64 *pUohAllocatedBytes);\n};\n\n/*\n * The new V3.0 stackwalking API.\n */\n[\n    object,\n    local,\n    uuid(A0647DE9-55DE-4816-929C-385271C64CF7),\n    pointer_default(unique)\n]\ninterface ICorDebugStackWalk : IUnknown\n{\n    typedef enum CorDebugSetContextFlag\n    {\n        SET_CONTEXT_FLAG_ACTIVE_FRAME = 0x1,\n        SET_CONTEXT_FLAG_UNWIND_FRAME = 0x2,\n    } CorDebugSetContextFlag;\n\n    /*\n     * Get the current context of this stack frame.\n     *\n     * The CONTEXT is retrieved from the ICorDebugStackWalk.  As unwinding may only restore a subset of the\n     * registers, such as only non-volatile registers, the context may not exactly match the register state at\n     * the time of the actual call.\n     */\n    HRESULT GetContext([in] ULONG32 contextFlags,\n                       [in] ULONG32 contextBufSize,\n                       [out] ULONG32* contextSize,\n                       [out, size_is(contextBufSize)] BYTE contextBuf[]);\n\n    /*\n     * Change the current context of this stack walk, allowing the\n     * debugger to move it to an arbitrary context. Does not actually\n     * alter the current context of the thread whose stack is being walked.\n     *\n     * The CONTEXT has to be a valid CONTEXT of a stack frame on the thread.\n     * If the CONTEXT is outside of the current thread's stack range, we'll\n     * return a failure HRESULT.  Otherwise, in the case of an invalid CONTEXT,\n     * the result is undefined.\n     */\n    HRESULT SetContext([in] CorDebugSetContextFlag flag,\n                       [in] ULONG32 contextSize,\n                       [in, size_is(contextSize)] BYTE context[]);\n\n    /*\n     * Attempt to advance the stackwalk to the next frame.\n     * If the current frame type is a native stack frame, Next() will not advance to the caller frame.\n     * Instead, Next() will advance to the next managed stack frame or the next internal frame marker.\n     *\n     * If a debugger wants to unwind unmanaged stack frames, it needs to start from the\n     * native stack frame itself.  It can seed the unwind by calling GetContext().\n     *\n     * This function will return CORDBG_S_AT_END_OF_STACK when there are no more frames.\n     */\n    HRESULT Next();\n\n    /*\n     * Return the current frame.  If the stackwalker is stopped at a native stack frame, we will return S_FALSE\n     * and set pFrame to NULL.\n     */\n    HRESULT GetFrame([out] ICorDebugFrame ** pFrame);\n};\n\n\n/*\n * ICorDebugChain represents a segment of a physical or logical call\n * stack.  All frames in a chain occupy contiguous stack space, and\n * they share the same thread & context.  A chain may represent either\n * managed or unmanaged code. Chains may be empty. Unmanaged chains are\n * always empty.\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAEE-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugChain : IUnknown\n{\n    /*\n     * GetThread returns the physical thread which this call chain is\n     * part of.\n     */\n\n    HRESULT GetThread([out] ICorDebugThread **ppThread);\n\n    /*\n     * GetStackRange returns the address range of the stack segment for the\n     * call chain.  Note that you cannot make any assumptions about\n     * what is actually stored on the stack - the numeric range is to compare\n     * stack frame locations only.\n     * The start of a stack range is the leafmost boundary of the chain, and\n     * the end of a stack range is the rootmost boundary of the chain.\n     */\n\n    HRESULT GetStackRange([out] CORDB_ADDRESS *pStart, [out] CORDB_ADDRESS *pEnd);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetContext([out] ICorDebugContext **ppContext);\n\n    /*\n     * GetCaller returns a pointer to the chain which called this\n     * chain.  Note that this may be a chain on another thread in the\n     * case of cross-thread-marshalled calls. The caller will be NULL\n     * for spontaneously called chains (e.g. the ThreadProc, a\n     * debugger initiated call, etc.)\n     */\n\n    HRESULT GetCaller([out] ICorDebugChain **ppChain);\n\n    /*\n     * GetCallee returns a pointer to the chain which this chain is\n     * waiting on before it resumes. Note that this may be a chain on\n     * another thread in the case of cross-thread-marshalled\n     * calls. The callee will be NULL if the chain is currently\n     * actively running.\n     */\n\n    HRESULT GetCallee([out] ICorDebugChain **ppChain);\n\n    /*\n     * GetPrevious returns a pointer to the chain which was on this\n     * thread before the current one was pushed, if there is one.\n     */\n\n    HRESULT GetPrevious([out] ICorDebugChain **ppChain);\n\n    /*\n     * GetNext returns a pointer to the chain which was pushed on this\n     * thread after the current one, if there is one.\n     */\n\n    HRESULT GetNext([out] ICorDebugChain **ppChain);\n\n    /*\n     * IsManaged returns whether or not the chain is running managed\n     * code.\n     */\n\n    HRESULT IsManaged([out] BOOL *pManaged);\n\n    /*\n     * These chains represent the physical call stack for the thread.\n     * EnumerateFrames returns an iterator which will list all the stack\n     * frames in the chain, starting at the active (most recent) one. This\n     * should be called only for managed chains.\n     *\n     * NOTE: The debugging API does not provide methods for obtaining\n     * frames contained in unmanaged chains. The debugger needs to use\n     * other means to obtain this information.\n     */\n\n    HRESULT EnumerateFrames([out] ICorDebugFrameEnum **ppFrames);\n\n    /*\n     * GetActiveFrame is a convenience routine to return the\n     * active (most recent) frame on the chain, if any.\n     *\n     * If the active frame is not available, the call will succeed\n     * and *ppFrame will be NULL. Active frames will not be available\n     * for all CHAIN_ENTER_UNMANAGED chains, and for some\n     * CHAIN_CLASS_INIT chains.\n     */\n\n    HRESULT GetActiveFrame([out] ICorDebugFrame **ppFrame);\n\n    /*\n     * GetRegisterSet returns the register set for the beginnning (the leafmost end)\n     * of the chain.\n     */\n\n    HRESULT GetRegisterSet([out] ICorDebugRegisterSet **ppRegisters);\n\n    /*\n     * GetReason returns the reason for the genesis of this calling chain.\n     */\n\n    typedef enum CorDebugChainReason\n    {\n        // Note that the first five line up with CorDebugIntercept\n        CHAIN_NONE              = 0x000,\n        CHAIN_CLASS_INIT        = 0x001,\n        CHAIN_EXCEPTION_FILTER  = 0x002,\n        CHAIN_SECURITY          = 0x004,\n        CHAIN_CONTEXT_POLICY    = 0x008,\n        CHAIN_INTERCEPTION      = 0x010,\n        CHAIN_PROCESS_START     = 0x020,\n        CHAIN_THREAD_START      = 0x040,\n        CHAIN_ENTER_MANAGED     = 0x080,\n        CHAIN_ENTER_UNMANAGED   = 0x100,\n        CHAIN_DEBUGGER_EVAL     = 0x200,\n        CHAIN_CONTEXT_SWITCH    = 0x400,\n        CHAIN_FUNC_EVAL         = 0x800,\n    } CorDebugChainReason;\n\n    HRESULT GetReason([out] CorDebugChainReason *pReason);\n};\n\n\n[\n    object,\n    local,\n    uuid(CC7BCAEF-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugFrame : IUnknown\n{\n    /*\n     * GetChain returns the chain of which this stack frame is a part.\n     */\n\n    HRESULT GetChain([out] ICorDebugChain **ppChain);\n\n    /*\n     * GetCode returns the code which this stack frame is running if any.\n     */\n\n    HRESULT GetCode([out] ICorDebugCode **ppCode);\n\n    /*\n     * GetFunction returns the function for the code which this stack\n     * frame is running.\n     * For ICorDebugInternalFrames, this may point to a method the\n     * frame is associated with (which may be in a different AppDomain\n     * from the frame itself), or may fail if the frame doesn't relate to any\n     * particular function.\n     */\n\n    HRESULT GetFunction([out] ICorDebugFunction **ppFunction);\n\n    /*\n     * GetFunctionToken is a convenience routine to return the token for the\n     * function for the code which this stack frame is running.\n     * The scope to resolve the token can be gotten from the ICorDebugFunction\n     * associated with this frame.\n     */\n\n    HRESULT GetFunctionToken([out] mdMethodDef *pToken);\n\n    /*\n     * GetStackRange returns the absolute address range of the stack\n     * frame.  (This is useful for piecing together interleaved stack\n     * traces gathered from multiple debugging engines.)  Note that you\n     * cannot make any assumptions about what is actually stored on\n     * the stack - the numeric range is to compare stack frame\n     * locations only.\n     * The start of a stack range is the leafmost boundary of the frame, and\n     * the end of a stack range is the rootmost boundary of the frame.\n     */\n\n    HRESULT GetStackRange([out] CORDB_ADDRESS *pStart, [out] CORDB_ADDRESS *pEnd);\n\n    /*\n     * GetCaller returns a pointer to the frame in the current chain\n     * which called this frame, or NULL if this is the rootmost frame\n     * in the chain.\n     */\n\n    HRESULT GetCaller([out] ICorDebugFrame **ppFrame);\n\n    /*\n     * GetCallee returns a pointer to the frame in the current chain\n     * which this frame called, or NULL if this is the leafmost frame\n     * in the chain.\n     */\n\n    HRESULT GetCallee([out] ICorDebugFrame **ppFrame);\n\n    /*\n     * CreateStepper creates a stepper object which operates relative to the\n     * frame. The Stepper API must then be used to perform actual stepping.\n     *\n     * Note that if this frame is not active, the frame will typically have to\n     * be returned to before the step is completed.\n     *\n     */\n\n    HRESULT CreateStepper([out] ICorDebugStepper **ppStepper);\n};\n\n[\n    object,\n    local,\n    uuid(B92CC7F7-9D2D-45c4-BC2B-621FCC9DFBF4),\n    pointer_default(unique)\n]\ninterface ICorDebugInternalFrame : ICorDebugFrame\n{\n\n    typedef enum CorDebugInternalFrameType\n    {\n        // This is a 'null' value for GetFrameType and is included for completeness sake.\n        // ICorDebugInternalFrame::GetFrameType() should never actually return this.\n        STUBFRAME_NONE = 0x00000000,\n\n        // This frame is a M2U stub-frame. This could include both PInvoke\n        // and COM-interop calls.\n        STUBFRAME_M2U = 0x0000001,\n\n        // This is a U2M stub frame.\n        STUBFRAME_U2M = 0x0000002,\n\n        // AppDomain transition.\n        STUBFRAME_APPDOMAIN_TRANSITION = 0x00000003,\n\n        // LightWeight method calls.\n        STUBFRAME_LIGHTWEIGHT_FUNCTION = 0x00000004,\n\n        // Start of Func-eval. This is included for CHF callbacks.\n        // Funcevals also have a chain CHAIN_FUNC_EVAL (legacy from v1.0)\n        STUBFRAME_FUNC_EVAL = 0x00000005,\n\n        // Start of an internal call into the CLR.\n        STUBFRAME_INTERNALCALL = 0x00000006,\n\n        // start of a class initialization; corresponds to CHAIN_CLASS_INIT\n        STUBFRAME_CLASS_INIT = 0x00000007,\n\n        // an exception is thrown; corresponds to CHAIN_EXCEPTION_FILTER\n        STUBFRAME_EXCEPTION = 0x00000008,\n\n        // a frame used for code-access security purposes; corresponds to CHAIN_SECURITY\n        STUBFRAME_SECURITY = 0x00000009,\n\n        // a frame used to mark that the runtime is jitting a managed method\n        STUBFRAME_JIT_COMPILATION = 0x0000000a,\n    } CorDebugInternalFrameType;\n\n    // Get the type of internal frame. This will never be STUBFRAME_NONE.\n    // Debuggers should gracefully ignore unrecognized internal frame types.\n    HRESULT GetFrameType([out] CorDebugInternalFrameType * pType);\n\n};\n\n[\n    object,\n    local,\n    uuid(C0815BDC-CFAB-447e-A779-C116B454EB5B),\n    pointer_default(unique)\n]\ninterface ICorDebugInternalFrame2 : IUnknown\n{\n    /*\n     * Returns the stack address of the internal frame marker.\n     */\n    HRESULT GetAddress([out] CORDB_ADDRESS *pAddress);\n\n/*\n     * Check if an internal frame is closer to the leaf than pFrameToCompare.\n     */\n    HRESULT IsCloserToLeaf([in] ICorDebugFrame * pFrameToCompare,\n                           [out] BOOL * pIsCloser);\n};\n\n/*\n * ICorDebugILFrame is a specialized interface of ICorDebugFrame for IL frames or jitted frames.\n * (Note that jitted frames implement both ICorDebugILFrame and ICorDebugNativeFrame.)\n */\n\n[\n    object,\n    local,\n    uuid(03E26311-4F76-11d3-88C6-006097945418),\n    pointer_default(unique)\n]\ninterface ICorDebugILFrame : ICorDebugFrame\n{\n    /*\n     * GetIP returns the stack frame's offset into the function's IL code.\n     * If this stack frame is active, this address is the next\n     * instruction to execute.  If this stack frame is not active, this is the\n     * next instruction to execute when the stack frame is reactivated.\n     *\n     * Note that if this a jitted frame, the IP will be determined by\n     * mapping backwards from the actual native IP, so the value may\n     * be only approximately correct.\n     *\n     * If pMappingResult is not NULL, A mapping result is returned which\n     * indicates the details of how the IP was obtained.  The following values\n     * can be returned:\n     *\n     *  MAPPING_EXACT - the IP is correct; either the frame is\n     *  interpreted or there is an exact IL map for the function.\n     *\n     *  MAPPING_APPROXIMATE - the IP was successfully mapped, but may\n     *  be only approximately correct\n     *\n     *  MAPPING_UNMAPPED_ADDRESS - although there is mapping info for\n     *  the function, the current address is not mappable to IL.  An\n     *  IP of 0 is returned.\n     *\n     *  MAPPING_PROLOG - the native code is in the prolog, so an IP of\n     *  0 is returned\n     *\n     *  MAPPING_EPILOG - the native code is in an epilog, so the last\n     *  IP of the method is returned\n     *\n     *  MAPPING_NO_INFO - no mapping info is available for the method,\n     *  so an IP of 0 is returned\n     *\n     */\n\n    typedef enum CorDebugMappingResult\n    {\n        MAPPING_PROLOG              = 0x1,\n        MAPPING_EPILOG              = 0x2,\n        MAPPING_NO_INFO             = 0x4,\n        MAPPING_UNMAPPED_ADDRESS    = 0x8,\n        MAPPING_EXACT               = 0x10,\n        MAPPING_APPROXIMATE         = 0x20,\n    } CorDebugMappingResult;\n\n    HRESULT GetIP([out] ULONG32 *pnOffset, [out] CorDebugMappingResult *pMappingResult);\n\n    /*\n     * SetIP sets the instruction pointer to the IL at the given offset.\n     * The debugger will do its best to fix up the state of the executing code\n     * so that it is consistent with the new IP as far as the EE is concerned,\n     * while preserving as much of the state of the user program as possible.\n     *\n     * Calling SetIP immediately invalidates all frames and chains for the\n     * current thread; the debugger must perform a new stack trace if it\n     * requires frame information after calling SetIP.\n     *\n     */\n\n    HRESULT SetIP([in] ULONG32 nOffset);\n\n    /*\n     * EnumerateLocalVariables returns a list of the local variables\n     * available in the frame.  Note that this may not include all of\n     * the locals in the running function, as some of them may not be\n     * active.\n     */\n\n    HRESULT EnumerateLocalVariables([out] ICorDebugValueEnum **ppValueEnum);\n\n    /*\n     * GetLocalVariable gets the value for a local variable\n     * in an IL frame.  This can be used either in an IL\n     * frame or a jitted frame.\n     */\n\n    HRESULT GetLocalVariable([in] DWORD dwIndex,\n                             [out] ICorDebugValue **ppValue);\n\n    /*\n     * EnumerateArguments returns a list of the arguments available in the\n     * frame.  Note that this will include varargs arguments as well as\n     * arguments declared by the function signature (inlucding the implicit\n     * \"this\" argument if any).\n     */\n\n    HRESULT EnumerateArguments([out] ICorDebugValueEnum **ppValueEnum);\n\n    /*\n     * GetArgument gets the value for an argument\n     * in an IL frame.  This can be used either in an IL\n     * frame or a jitted frame.\n     * For instance (non-static) methods, argument index 0 is the \"this\" object,\n     * and the normal explicit arguments start with index 1.\n     */\n\n    HRESULT GetArgument([in] DWORD dwIndex,\n                        [out] ICorDebugValue **ppValue);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetStackDepth([out] ULONG32 *pDepth);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetStackValue([in] DWORD dwIndex,\n                          [out] ICorDebugValue **ppValue);\n\n    /*\n     * CanSetIP attempts to determine if it's safe to set the instruction pointer\n     * to the IL at the given offset. If this returns S_OK, then executing\n     * SetIP (see above) will result in a safe, correct, continued execution.\n     * If CanSetIP returns anything else, SetIP can still be invoked, but\n     * continued, correct execution of the debuggee cannot be guaranteed.\n     *\n     */\n\n    HRESULT CanSetIP([in] ULONG32 nOffset);\n};\n\n\n/*\n * ICorDebugILFrame2 is a logical extension to ICorDebugILFrame.\n */\n[\n    object,\n    local,\n    uuid(5D88A994-6C30-479b-890F-BCEF88B129A5),\n    pointer_default(unique)\n]\ninterface ICorDebugILFrame2 : IUnknown\n{\n    /*\n     * Performs an on-stack replacement for an outstanding function remap opportunity.\n     * This is used to update execution of an edited function to the latest version,\n     * preserving the current frame state (such as the values of all locals).\n     * This can only be called when a FunctionRemapOpportunity callback has been delivered\n     * for this leaf frame, and the callback has not yet been continued.  newILOffset\n     * is the offset into the new function at which execution should continue.\n     * When the remap has completed, a FunctionRemapComplete callback will be delivered.\n     */\n    HRESULT RemapFunction([in] ULONG32 newILOffset);\n\n    /*\n     * EnumerateTypeParameters returns the type parameters active on a frame.\n     * This will include both the class type parameters (if any) followed by the method type\n     * parameters (if any).\n     * Use the metadata API IMetaDataImport2::EnumGenericParams to determine how many\n     * Class type parameters vs. Method Type parameters there are in this list.\n     * The type parameters will not always be available.\n     */\n\n    HRESULT EnumerateTypeParameters([out] ICorDebugTypeEnum **ppTyParEnum);\n\n};\n\n[\n    object,\n    local,\n    uuid(9A9E2ED6-04DF-4FE0-BB50-CAB64126AD24),\n    pointer_default(unique)\n]\ninterface ICorDebugILFrame3 : IUnknown\n{\n    /*\n     *  For the specified IL offset, obtains an ICorDebugValue object that encapsulates\n     *  the return value of a function.  The provided IL offset should be at a function\n     *  call site and the debuggee should be stopped at a breakpoint set at the native\n     *  offset returned by ICorDebugCode3::GetNativeOffsetForReturnValueBreakpoint for\n     *  the same IL offset.\n     *  If the debuggee is not stopped at the correct location for the specified IL offset\n     *  the API will fail.\n     *  If the function call doesn't return a value the API will fail.\n     */\n    HRESULT GetReturnValueForILOffset(ULONG32 ILoffset, [out] ICorDebugValue** ppReturnValue);\n};\n\ntypedef enum ILCodeKind\n{\n    ILCODE_ORIGINAL_IL = 0x1,\n    ILCODE_REJIT_IL = 0x2,\n} ILCodeKind;\n\n[\n    object,\n    local,\n    uuid(AD914A30-C6D1-4AC5-9C5E-577F3BAA8A45),\n    pointer_default(unique)\n]\ninterface ICorDebugILFrame4 : IUnknown\n{\n    /*\n    * EnumerateLocalVariablesEx returns a list of the local variables\n    * available in the frame.  Note that this may not include all of\n    * the locals in the running function, as some of them may not be\n    * active. The Ex version of this function optionally accesses\n    * variables added in profiler ReJIT instrumentation.\n    *\n    * flags:\n    * ILCODE_ORIGINAL_IL preserves the same behavior as calling\n    *    EnermateLocalVariables in ICorDebugILFrame.\n    *    If the method is instrumented with additional locals, those locals\n    *    will not be viewable.\n    * ILCODE_REJIT_IL allows viewing the locals defined\n    *    in the profiler's updated local var signature included with the\n    *    instrumented IL. If the IL is not instrumented the enumeration will\n    *    be empty and S_OK is returned.\n    */\n\n    HRESULT EnumerateLocalVariablesEx([in] ILCodeKind flags, [out] ICorDebugValueEnum **ppValueEnum);\n\n    /*\n    * GetLocalVariableEx gets the value for a local variable\n    * in an IL frame. The Ex version of this function optionally accesses\n    * variables added in profiler ReJIT instrumentation.\n    *\n    * flags:\n    * ILCODE_ORIGINAL_IL preserves the same behavior as calling\n    *    GetLocalVariable in ICorDebugILFrame.\n    *    If the method is instrumented with additional locals, those locals\n    *    will not be addressable or viewable.\n    * ILCODE_REJIT_IL allows viewing the locals defined\n    *    in the profiler's updated local var signature included with the\n    *    instrumented IL. If the IL is not instrumented the method will\n    *    return E_INVALIDARG.\n    */\n    HRESULT GetLocalVariableEx([in] ILCodeKind flags, [in] DWORD dwIndex, [out] ICorDebugValue **ppValue);\n\n\n    /*\n    * GetCode returns the code which this stack frame is running if any.\n    *\n    * flags:\n    * ILCODE_ORIGINAL_IL preserves the same behavior as calling\n    *    GetCode in ICorDebugFrame.\n    *    If the method is instrumented that IL will not be visible.\n    * ILCODE_REJIT_IL allows viewing the IL defined by the profiler's\n    *    rejit request. If the IL is not instrumented *ppCode will be\n    *    set to NULL and S_OK is returned.\n    */\n    HRESULT GetCodeEx([in] ILCodeKind flags, [out] ICorDebugCode **ppCode);\n\n};\n\n/*\n * ICorDebugNativeFrame is a specialized interface of ICorDebugFrame for jitted frames, i.e.\n * native frames for managed methods.\n * (Note that jitted frames implement both ICorDebugILFrame and ICorDebugNativeFrame.)\n */\n\n[\n    object,\n    local,\n    uuid(03E26314-4F76-11d3-88C6-006097945418),\n    pointer_default(unique)\n]\ninterface ICorDebugNativeFrame : ICorDebugFrame\n{\n    /*\n     * GetIP returns the stack frame's offset into the function's\n     * native code.  If this stack frame is active, this address is\n     * the next instruction to execute.  If this stack frame is not\n     * active, this is the next instruction to execute when the stack\n     * frame is reactivated.\n     */\n\n    HRESULT GetIP([out] ULONG32 *pnOffset);\n\n    /*\n     * SetIP sets the instruction pointer to the given native\n     * offset. CorDebug will attempt to keep the stack frame in a\n     * coherent state.  (Note that even if the frame is in a valid\n     * state as far as the runtime is concerned, there still may be\n     * problems - e.g. uninitialized local variables, etc.  The caller\n     * (or perhaps the user) is responsible for insuring coherency of\n     * the running program.)\n     *\n     * Calling SetIP immediately invalidates all frames and chains for the\n     * current thread; the debugger must perform a new stack trace if it\n     * requires frame information after calling SetIP.\n     */\n\n    HRESULT SetIP([in] ULONG32 nOffset);\n\n    /*\n     * GetRegisterSet returns the register set for the given frame.\n     *\n     */\n\n    HRESULT GetRegisterSet([out] ICorDebugRegisterSet **ppRegisters);\n\n    /*\n     * GetLocalRegisterValue gets the value for a local variable or\n     * argument stored in a register of a native frame. This can be\n     * used either in a native frame or a jitted frame.\n     */\n\n    HRESULT GetLocalRegisterValue([in] CorDebugRegister reg,\n                                  [in] ULONG cbSigBlob,\n                                  [in] PCCOR_SIGNATURE pvSigBlob,\n                                  [out] ICorDebugValue **ppValue);\n\n    /*\n     * GetLocalDoubleRegisterValue gets the value for a local variable\n     * or argument stored in 2 registers of a native frame. This can\n     * be used either in a native frame or a jitted frame.\n     */\n\n    HRESULT GetLocalDoubleRegisterValue([in] CorDebugRegister highWordReg,\n                                        [in] CorDebugRegister lowWordReg,\n                                        [in] ULONG cbSigBlob,\n                                        [in] PCCOR_SIGNATURE pvSigBlob,\n                                        [out] ICorDebugValue **ppValue);\n\n    /*\n     * GetLocalMemoryValue gets the value for a local variable stored\n     * at the given address.\n     */\n\n    HRESULT GetLocalMemoryValue([in] CORDB_ADDRESS address,\n                                [in] ULONG cbSigBlob,\n                                [in] PCCOR_SIGNATURE pvSigBlob,\n                                [out] ICorDebugValue **ppValue);\n\n    /*\n     * GetLocalRegisterMemoryValue gets the value for a local which\n     * is stored half in a register and half in memory.\n     */\n\n    HRESULT GetLocalRegisterMemoryValue([in] CorDebugRegister highWordReg,\n                                        [in] CORDB_ADDRESS lowWordAddress,\n                                        [in] ULONG cbSigBlob,\n                                        [in] PCCOR_SIGNATURE pvSigBlob,\n                                        [out] ICorDebugValue **ppValue);\n\n    /*\n     * GetLocalMemoryRegisterValue gets the value for a local which\n     * is stored half in a register and half in memory.\n     */\n\n    HRESULT GetLocalMemoryRegisterValue([in] CORDB_ADDRESS highWordAddress,\n                                        [in] CorDebugRegister lowWordRegister,\n                                        [in] ULONG cbSigBlob,\n                                        [in] PCCOR_SIGNATURE pvSigBlob,\n                                        [out] ICorDebugValue **ppValue);\n    /*\n     * CanSetIP attempts to determine if it's safe to set the instruction pointer\n     * to the given native offset. If this returns S_OK, then executing\n     * SetIP (see above) will result in a safe, correct, continued execution.\n     * If CanSetIP returns anything else, SetIP can still be invoked, but\n     * continued, correct execution of the debuggee cannot be guaranteed.\n     *\n     */\n\n    HRESULT CanSetIP([in] ULONG32 nOffset);\n};\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface ICorDebugModule */\n[\n    object,\n    local,\n    uuid(35389FF1-3684-4c55-A2EE-210F26C60E5E),\n    pointer_default(unique)\n]\ninterface ICorDebugNativeFrame2 : IUnknown\n{\n    /*\n     * Returns true if the current frame is a child frame.\n     */\n    HRESULT IsChild([out] BOOL *pIsChild);\n\n    /*\n     * Return true if the specified frame is the parent frame of the current frame.\n     */\n    HRESULT IsMatchingParentFrame([in] ICorDebugNativeFrame2 *pPotentialParentFrame,\n                                  [out] BOOL *pIsParent);\n\n    /*\n     * Return the stack parameter size on x86.  On other platforms, we return S_FALSE and set pSize to 0.\n     * This is because other platforms don't need this information for unwinding.\n     */\n    HRESULT GetStackParameterSize([out] ULONG32 * pSize);\n};\n\n/*\n * ICorDebugModule3 is a logical extension to ICorDebugModule.\n */\n[\n    object,\n    local,\n    uuid(86F012BF-FF15-4372-BD30-B6F11CAAE1DD),\n    pointer_default(unique)\n]\ninterface ICorDebugModule3 : IUnknown\n{\n    /*\n     * CreateReaderForInMemorySymbols creates a debug symbol reader object (eg.\n     * ISymUnmanagedReader) for a dynamic module.  This symbol reader becomes stale\n     * and is usually discarded whenever a LoadClass callback is delivered for the\n     * module.\n     *\n     * Arguments:\n     *    riid - The IID of the COM interface to return (typically IID_ISymUnmanagedReader)\n     *   ppObj - Where to store the reader interface.\n     *\n     * Return Value:\n     *   S_OK on success\n     *   Error hresults otherwise, including:\n     *   CORDBG_E_MODULE_LOADED_FROM_DISK if this isn't an in-memory or dynamic module\n     *   CORDBG_E_SYMBOLS_NOT_AVAILABLE if symbols weren't supplied by the application or aren't\n     *      yet available.\n     *\n     * Notes:\n     *   This API can also be used to create a symbol reader object for in-memory\n     *   (non-dynamic) modules, but only after the symbols are first available\n     *   (indicated by the UpdateModuleSymbols callback).\n     *\n     *   This API returns a new reader instance every time it is called (like CoCreateInstance)\n     *   and so the debugger should cache the result and only request a new one when\n     *   the underlying data may have changed (i.e. a LoadClass event).\n     *\n     *   Dynamic modules do not have any symbols available until the first type has been\n     *   loaded into them (as indicated by the LoadClass callback).\n     */\n    HRESULT CreateReaderForInMemorySymbols([in] REFIID riid,\n                                           [out][iid_is(riid)] void **ppObj);\n}\n\n/*\n * ICorDebugModule4 is a logical extension to ICorDebugModule.\n */\n[\n    object,\n    local,\n    uuid(FF8B8EAF-25CD-4316-8859-84416DE4402E),\n    pointer_default(unique)\n]\ninterface ICorDebugModule4 : IUnknown\n{\n    /*\n     * Query to see if the module is loaded into memory in mapped/hydrated format\n     *\n     * Arguments:\n     *     pIsMapped - BOOL to store mapping information. TRUE will represent mapped\n                      format while FALSE represents flat format.\n     * Return Value:\n     *     S_OK in successful case.\n     *     S_FALSE if they layout could not be determined.\n     * Notes:\n     *     The pIsMapped value set in pIsMapped should only be interpreted as valid\n     *     when this function returns S_OK. All other return values (including\n     *     S_FALSE) indicate that the layout could not be determined and pIsMapped\n     *     should be ignored.\n     */\n    HRESULT IsMappedLayout([out] BOOL *pIsMapped);\n}\n\n/*\n * ICorDebugRuntimeUnwindableFrame is a specialized interface of ICorDebugFrame for unmanaged methods\n * which requires special knowledge to unwind.  They are not jitted code.  When the debugger sees this type\n * of frames, it should use ICorDebugStackWalk::Next() to unwind, but it should do inspection itself.\n * The debugger can call ICorDebugStackWalk::GetContext() to retrieve the CONTEXT of the frame when it gets\n * an ICorDebugRuntimeUnwindableFrame.\n */\n\n[\n    object,\n    local,\n    uuid(879CAC0A-4A53-4668-B8E3-CB8473CB187F),\n    pointer_default(unique)\n]\ninterface ICorDebugRuntimeUnwindableFrame : ICorDebugFrame\n{\n}\n\n/*\n * ICorDebugModule represents a Common Language Runtime module that is loaded into a\n * specific AppDomain.  Normally this is an executable or a DLL, but it may also be\n * some other file of a multi-module assembly.  There is an ICorDebugModule instance\n * for each AppDomain a module is loaded into, even in the case of shared modules like\n * CoreLib.\n */\n\n[\n    object,\n    local,\n    uuid(dba2d8c1-e5c5-4069-8c13-10a7c6abf43d),\n    pointer_default(unique)\n]\ninterface ICorDebugModule : IUnknown\n{\n    /*\n     * GetProcess returns the process of which this module is a part.\n     */\n\n    HRESULT GetProcess([out] ICorDebugProcess **ppProcess);\n\n    /*\n     * GetBaseAddress returns the base address of the module.\n     *\n     * For modules loaded from NGEN images, the base address will be 0.\n     */\n\n    HRESULT GetBaseAddress([out] CORDB_ADDRESS *pAddress);\n\n    /*\n     * GetAssembly returns the assembly of which this module is a part.\n     */\n\n    HRESULT GetAssembly([out] ICorDebugAssembly **ppAssembly);\n\n    /*\n     * GetName returns a name identifying the module.\n     *\n     * For on-disk modules this is a full path.  For dynamic modules this\n     * is just the filename if one was provided.  Otherwise, and for other\n     * in-memory modules, this is just the simple name stored in the module's\n     * metadata.\n     */\n\n    HRESULT GetName([in] ULONG32 cchName,\n                    [out] ULONG32 *pcchName,\n                    [out, size_is(cchName),\n                    length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * EnableJITDebugging controls whether the jitter preserves\n     * debugging information for methods within this module.\n     * If bTrackJITInfo is true, then the jitter preserves\n     * mapping information between the IL version of a function and\n     * the jitted version for functions in the module.  If bAllowJitOpts\n     * is true, then the jitter will generate code with certain (JIT-specific)\n     * optimizations.\n     *\n     * JITDebug is enabled by default for all modules loaded when the\n     * debugger is active.  Programmatically enabling/disabling these\n     * settings will override global settings.\n     *\n     */\n    HRESULT EnableJITDebugging([in] BOOL bTrackJITInfo,\n                               [in] BOOL bAllowJitOpts);\n\n    /*\n     * EnableClassLoadCallbacks controls whether on not LoadClass and\n     * UnloadClass callbacks are called for the particular module.\n     * For non-dynamic modules, they are off by default.\n     * For dynamic modules, they are on by default and can not be disabled.\n     */\n\n    HRESULT EnableClassLoadCallbacks([in] BOOL bClassLoadCallbacks);\n\n    /*\n     * GetFunctionFromToken returns the ICorDebugFunction from\n     * metadata information. Returns CORDBG_E_FUNCTION_NOT_IL if\n     * called with a methodDef that does not refer to an IL method.\n     * In the EnC case, this will return the most recent version of the function.\n     */\n\n    HRESULT GetFunctionFromToken([in] mdMethodDef methodDef,\n                                 [out] ICorDebugFunction **ppFunction);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetFunctionFromRVA([in] CORDB_ADDRESS rva,\n                               [out] ICorDebugFunction **ppFunction);\n\n    /*\n     * GetClassFromToken returns the ICorDebugClass from metadata information.\n     */\n\n    HRESULT GetClassFromToken([in] mdTypeDef typeDef,\n                              [out] ICorDebugClass **ppClass);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT CreateBreakpoint([out] ICorDebugModuleBreakpoint **ppBreakpoint);\n\n    /*\n     * DEPRECATED\n     */\n\n    HRESULT GetEditAndContinueSnapshot([out] ICorDebugEditAndContinueSnapshot **ppEditAndContinueSnapshot);\n\n    /*\n     * Return a metadata interface pointer that can be used to examine the\n     * metadata for this module.\n     */\n    HRESULT GetMetaDataInterface([in] REFIID riid, [out] IUnknown **ppObj);\n\n\n    /*\n     * Return the token for the Module table entry for this object.  The token\n     * may then be passed to the meta data import api's.\n     */\n    HRESULT GetToken([out] mdModule *pToken);\n\n    /*\n     * If this is a dynamic module, IsDynamic sets *pDynamic to true, otherwise\n     * sets *pDynamic to false.\n     * Dynamic modules can continue to grow new classes (receive LoadClass callbacks) even after\n     * the module is loaded.\n     */\n    HRESULT IsDynamic([out] BOOL *pDynamic);\n\n    /*\n     * GetGlobalVariableValue returns a value object for the given global\n     * variable.\n     */\n    HRESULT GetGlobalVariableValue([in] mdFieldDef fieldDef,\n                                   [out] ICorDebugValue **ppValue);\n\n    /*\n     * GetSize returns the size, in bytes, of the module.\n     *\n     * For modules loaded from NGEN images, the size will be 0.\n     */\n    HRESULT GetSize([out] ULONG32 *pcBytes);\n\n    /*\n     * If this is a module that exists only in the debuggee's memory,\n     * then pInMemory will be set to TRUE. The Runtime supports\n     * loading assemblies from raw streams of bytes. Such modules are\n     * called \"in memory\" modules and they have no on-disk\n     * representation.\n     */\n    HRESULT IsInMemory([out] BOOL *pInMemory);\n};\n#pragma warning(pop)\n\n/*\n * ICorDebugModule2 is a logical extension to ICorDebugModule.\n */\n[\n    object,\n    local,\n    uuid(7FCC5FB5-49C0-41de-9938-3B88B5B9ADD7),\n    pointer_default(unique)\n]\ninterface ICorDebugModule2 : IUnknown\n{\n    /*\n     * SetUserCode sets the user-code status of all the functions on all the classes in\n     * the module to bIsJustMyCode, except for the functions or classes in the tokens array,\n     * which it sets to !bIsJustMyCode.\n     * These settings erase all previous JMC settings in this module.\n     * JMC status can be refined by calls to SetJMCStatus on the Class and Function.\n     * Returns S_OK if all functions were set successfully,\n     * CORDBG_E_FUNCTION_NOT_DEBUGGABLE if some function to be marked TRUE was not\n     * debuggable.\n     */\n    HRESULT SetJMCStatus([in] BOOL bIsJustMyCode,\n                        [in] ULONG32 cTokens,\n                        [in, size_is(cTokens)] mdToken pTokens[]);\n\n   /*\n     * ApplyChanges is called to apply an Edit and Continue delta to the running process.\n     * An EnC delta consists of a delta metadata blob (created by IMetadataEmit2::SaveDelta)\n     * and a delta IL blob (a method body stream just like the one in an on disk assembly).\n     * If this operation fails, the debug session is considered to be in an invalid state\n     * and must be restarted.\n     */\n    HRESULT ApplyChanges([in] ULONG cbMetadata,\n                         [in, size_is(cbMetadata)] BYTE pbMetadata[],\n                         [in] ULONG cbIL,\n                         [in, size_is(cbIL)] BYTE pbIL[]);\n\n  /*\n   * SetJITCompilerFlags sets the flags that control the JIT compiler. If the set of flags is invalid,\n   * the function will fail. This function can only be called from within the true LoadModule callback\n   * for the given module. Attempts to call it after this callback has been delivered or in a \"faked\"\n   * LoadModule callback for debugger attach will fail.\n   */\n\n    HRESULT SetJITCompilerFlags( [in] DWORD dwFlags );\n\n    /*\n    * GetJITCompilerFlags gets the set of flags that control the JIT compiler for this module.\n    */\n\n    HRESULT GetJITCompilerFlags( [out] DWORD *pdwFlags );\n\n    /*\n     * Resolve an assembly given an AssemblyRef token. Note that\n     * this will not trigger the loading of assembly. If assembly is not yet loaded,\n     * this will return an CORDBG_E_CANNOT_RESOLVE_ASSEMBLY error\n     *\n    */\n    HRESULT ResolveAssembly([in] mdToken tkAssemblyRef,\n\t\t\t\t\t\t\t[out] ICorDebugAssembly **ppAssembly);\n\n};\n\n\n/*\n    ICorDebugFunction represents a managed function.\n    In the non-EnC case, it is 1:1 with a methoddef metadata token.\n    For EnC, each version of a function has its own ICorDebugFunction instance.\n    EnCed functions keep the same metadata tokens, but will get new ICorDebugCode instances.\n\n    ICorDebugFunction does not represent generic typeparameters. That means that there's\n    an ICDFunction for Func<T>, but not for Func<string> or Func<Bar>. Get the generic\n    parameters from ICorDebugIlFrame::EnumerateTypeParameters.\n*/\n[\n    object,\n    local,\n    uuid(CC7BCAF3-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugFunction : IUnknown\n{\n    /*\n     * GetModule returns the module for the function.\n     */\n\n    HRESULT GetModule([out] ICorDebugModule **ppModule);\n\n    /*\n     * GetClass returns the class for the function. Returns null if\n     * the function is not a member.\n     */\n\n    HRESULT GetClass([out] ICorDebugClass **ppClass);\n\n    /*\n     * GetToken returns the metadata methodDef token for the function.\n     */\n\n    HRESULT GetToken([out] mdMethodDef *pMethodDef);\n\n    /*\n     * GetILCode returns the IL code for the function.  Returns null\n     * if there is no IL code for the function.  Note that this will\n     * get the IL code corresponding to this function's EnC version of\n     * the code in the runtime, if this function has been EnC'd.\n     */\n\n    HRESULT GetILCode([out] ICorDebugCode **ppCode);\n\n    /*\n     * GetNativeCode returns the native code for the function.\n     * Returns null if there is no native code for the function\n     * (i.e. it is an IL function which has not been jitted)\n     * If this function has been jitted multiple times (Eg, generics) this\n     * will return a random Native Code object.\n     */\n\n    HRESULT GetNativeCode([out] ICorDebugCode **ppCode);\n\n    /*\n     * CreateBreakpoint creates a breakpoint at the start of the function.\n     *\n     */\n\n    HRESULT CreateBreakpoint([out] ICorDebugFunctionBreakpoint **ppBreakpoint);\n\n    /*\n     * Returns the token for the local variable signature for this function.\n     * If there is no signature (ie, the function doesn't have any local\n     * variables), then mdSignatureNil will be returned.\n     */\n\n    HRESULT GetLocalVarSigToken([out] mdSignature *pmdSig);\n\n\n    /*\n     * Obtains the latest (largest) EnC version number for this function.\n     * If this function has never been edited with EnC, this will return\n     * the same value as ICorDebugFunction2::GetVersionNumber.\n     */\n     HRESULT GetCurrentVersionNumber([out] ULONG32 *pnCurrentVersion);\n};\n\n/*\n    ICorDebugFunction2 is a logical extension to ICorDebugFunction.\n*/\n[\n    object,\n    local,\n    uuid(EF0C490B-94C3-4e4d-B629-DDC134C532D8),\n    pointer_default(unique)\n]\ninterface ICorDebugFunction2 : IUnknown\n{\n    /*\n     * Sets the User-code status (for JMC stepping) for this function.\n     * A JMC stepper will skip non-user code.\n     * User code must be a subset of debuggable code.\n     * Returns S_OK if successful, CORDBG_E_FUNCTION_NOT_DEBUGGABLE\n     * if bIsJustMyCode is TRUE and the function is not debuggable.\n     */\n    HRESULT SetJMCStatus([in] BOOL bIsJustMyCode);\n\n    /*\n     * IsUserCode outputs whether the function is marked as user code.\n     * Always outputs FALSE for non-debuggable functions.\n     * Returns S_OK if successful.\n     */\n    HRESULT GetJMCStatus([out] BOOL * pbIsJustMyCode);\n\n    /*\n     *    Not yet implemented.\n     */\n\n    HRESULT EnumerateNativeCode([out] ICorDebugCodeEnum **ppCodeEnum);\n\n    /*\n     * Obtains the EnC version number of the function represented by this ICorDebugFunction2.\n     * When a function is edited with EnC, the new function has a larger version number than\n     * that of any previous version (not necessarily exactly 1 greater).\n     * This function's version number will be less than or equal to the value returned by\n     * ICorDebugFunction::GetCurrentVersionNumber.\n     */\n\n     HRESULT GetVersionNumber([out] ULONG32 *pnVersion);\n};\n\n\n/*\nICorDebugFunction3 is a logical extension to ICorDebugFunction.\n*/\n[\n    object,\n    local,\n    uuid(09B70F28-E465-482D-99E0-81A165EB0532),\n    pointer_default(unique)\n]\ninterface ICorDebugFunction3 : IUnknown\n{\n    /*\n     * If this function has an active rejit request it will be returned in\n     * pRejitedILCode.\n     * If there is no active request (a common case) then *ppRejitedILCode = NULL\n     *\n     * A rejit request becomes active just after execution returns from the call\n     * ICorProfilerCallback4::GetReJITParameters(). It may not yet be jitted\n     * and threads may still be executing in the original version of the code.\n     *\n     * A rejit request becomes inactive during the profiler's call to\n     * ICorProfInfo::RequestRevert. Even after being reverted a thread can still\n     * be executing in the rejited code.\n     */\n    HRESULT GetActiveReJitRequestILCode(ICorDebugILCode **ppReJitedILCode);\n};\n\n/*\nICorDebugFunction4 is a logical extension to ICorDebugFunction.\n*/\n[\n    object,\n    local,\n    uuid(72965963-34fd-46e9-9434-b817fe6e7f43),\n    pointer_default(unique)\n]\ninterface ICorDebugFunction4 : IUnknown\n{\n    /*\n     * Sets a breakpoint at offset 0 of any current or future jitted methods.\n     */\n    HRESULT CreateNativeBreakpoint(ICorDebugFunctionBreakpoint **ppBreakpoint);\n};\n\n/*\n    ICorDebugCode represents an IL or native code blob.\n\n    For methods that take offsets, the units are the same as the units on the CordbCode object.\n    (eg, IL offsets for an IL code object, and native offsets for a native code object)\n\n    V2 allows multiple code-regions. CordbCode presents an abstraction where these\n    are merged together in a single linear, continuous space. So if the code is split\n    with 0x5 bytes at address 0x1000, and 0x10 bytes at address 0x2000,\n    then:\n    - GetAddress() yields a start address of 0x1000.\n    - GetSize() is the size of the merged regions = 0x5+ 0x10 = 0x15 bytes.\n    - The (Offset --> Address) mapping is:\n           0x0  --> 0x1000\n           0x1  --> 0x1001\n           0x4  --> 0x1004\n           0x5  --> 0x2000\n           0x6  --> 0x2001\n           0x15 --> 0x2010\n\n    A caller can get the specific code regions via ICorDebugCode2.\n*/\n[\n    object,\n    local,\n    uuid(CC7BCAF4-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugCode : IUnknown\n{\n    /*\n     * IsIL returns whether the code is IL (as opposed to native.)\n     */\n\n    HRESULT IsIL([out] BOOL *pbIL);\n\n    /*\n     * GetFunction returns the function for the code.\n     */\n\n    HRESULT GetFunction([out] ICorDebugFunction **ppFunction);\n\n    /*\n     * GetAddress returns the address of the code.\n     */\n\n    HRESULT GetAddress([out] CORDB_ADDRESS *pStart);\n\n    /*\n     * GetSize returns the size in bytes of the code.\n     */\n\n    HRESULT GetSize([out] ULONG32 *pcBytes);\n\n    /*\n     * CreateBreakpoint creates a breakpoint in the function at the\n     * given offset.\n     *\n     * If this code is IL code, and there is a jitted native version\n     * of the code, the breakpoint will be applied in the jitted code\n     * as well.  (The same is true if the code is later jitted.)\n     *\n     */\n\n    HRESULT CreateBreakpoint([in] ULONG32 offset,\n                             [out] ICorDebugFunctionBreakpoint **ppBreakpoint);\n\n    /*\n     * GetCode returns the code of the method, suitable for disassembly.  Note\n     * that instruction boundaries aren't checked.\n     * This glues together multiple code-regions into a single binary stream.\n     * Caller must use ICorDebugCode2::GetCodeChunks to get (start,size) for\n     * code chunks to be able to properly resolve addresses embedded in the instructions.\n     */\n\n    HRESULT GetCode([in] ULONG32 startOffset, [in] ULONG32 endOffset,\n                    [in] ULONG32 cBufferAlloc,\n                    [out, size_is(cBufferAlloc),\n                          length_is(*pcBufferSize)] BYTE buffer[],\n                    [out] ULONG32 *pcBufferSize);\n\n    /*\n     * GetVersionNumber returns the 1 based number identifying the\n     * version of the code that this ICorDebugCode corresponds to.  The\n     * version number is incremented each time the function is Edit-And-\n     * Continue'd.\n     */\n\n    HRESULT GetVersionNumber([out] ULONG32 *nVersion);\n\n    /*\n     * GetILToNativeMapping returns a map from IL offsets to native\n     * offsets for this code. An array of COR_DEBUG_IL_TO_NATIVE_MAP\n     * structs will be returned, and some of the ilOffsets in this array\n     * map be the values specified in CorDebugIlToNativeMappingTypes.\n     *\n     * Note: this method is only valid for ICorDebugCodes representing\n     * native code that was jitted from IL code.\n     * Note: There is no ordering to the array of elements returned, nor\n     * should you assume that there is or will be.\n     */\n    HRESULT GetILToNativeMapping([in] ULONG32 cMap,\n                                 [out] ULONG32 *pcMap,\n                                 [out, size_is(cMap), length_is(*pcMap)]\n                                 COR_DEBUG_IL_TO_NATIVE_MAP map[]);\n\n    /*\n     * Not implemented.\n     */\n    HRESULT GetEnCRemapSequencePoints([in] ULONG32 cMap,\n                                      [out] ULONG32 *pcMap,\n                                      [out, size_is(cMap), length_is(*pcMap)]\n                                      ULONG32 offsets[]);\n};\n\n[\n    object,\n    local,\n    uuid(5F696509-452F-4436-A3FE-4D11FE7E2347),\n    pointer_default(unique)\n]\ninterface ICorDebugCode2 : IUnknown\n{\n    typedef struct _CodeChunkInfo\n    {\n        CORDB_ADDRESS startAddr;\n        ULONG32 length;\n    } CodeChunkInfo;\n\n    // The native code for a code object may be split up into multiple regions.\n    //\n    HRESULT GetCodeChunks(\n        [in] ULONG32 cbufSize,\n        [out] ULONG32 * pcnumChunks,\n        [out, size_is(cbufSize), length_is(*pcnumChunks)] CodeChunkInfo chunks[]);\n\n\n   // GetCompilerFlags returns the flags under which this piece of code was JITted or NGENed.\n\n   HRESULT GetCompilerFlags( [out] DWORD *pdwFlags );\n};\n\n[\n    object,\n    local,\n    uuid(D13D3E88-E1F2-4020-AA1D-3D162DCBE966),\n    pointer_default(unique)\n]\ninterface ICorDebugCode3 : IUnknown\n{\n    /*\n     *  For the specified IL offset, obtains the native offset where a breakpoint should\n     *  be placed so that the debugger can obtain the return value from a function.\n     *  The provided IL offset should be at a function call site, if not the API will fail.\n     *  If the function call doesn't return a value the API will fail.\n     *\n     *  Returns:\n     *    S_OK - on success.\n     *    CORDBG_E_INVALID_OPCODE - If the given IL offset site was not a call instruction\n     *                              or if the function returns \"void\".\n     *    CORDBG_E_UNSUPPORTED - If the given IL offset is a proper call, but the return\n     *                           type is unsupported for getting return value.\n     */\n    HRESULT GetReturnValueLiveOffset([in] ULONG32 ILoffset,\n                                     [in] ULONG32 bufferSize,\n                                     [out] ULONG32 *pFetched,\n                                     [out, size_is(bufferSize), length_is(*pFetched)] ULONG32 pOffsets[]);\n};\n\n[\n    object,\n    local,\n    uuid(18221fa4-20cb-40fa-b19d-9f91c4fa8c14),\n    pointer_default(unique)\n]\ninterface ICorDebugCode4 : IUnknown\n{\n    /*\n     * EnumerateVariableHomes - gives an enum for local variables and arguments\n     * in the function.\n     * This may include multiple ICorDebugVariableHomes for the same slot or\n     * argument index if they have different homes at different points in the\n     * function.\n     */\n    HRESULT EnumerateVariableHomes([out] ICorDebugVariableHomeEnum **ppEnum);\n}\n\n[\n    object,\n    local,\n    uuid(598D46C2-C877-42A7-89D2-3D0C7F1C1264),\n    pointer_default(unique)\n]\ninterface ICorDebugILCode : IUnknown\n{\n    /*\n     * Represents an exception clause for a given piece of IL. These fields should be interpretted\n     * the same was as an EH clause in encoded IL in the ECMA CLI specification.\n     */\n    typedef struct _CorDebugEHClause\n    {\n        ULONG32 Flags;\n        ULONG32 TryOffset;\n        ULONG32 TryLength;\n        ULONG32 HandlerOffset;\n        ULONG32 HandlerLength;\n        ULONG32 ClassToken;\n        ULONG32 FilterOffset;\n    } CorDebugEHClause;\n\n    /*\n     * Returns a list of EH clauses that were defined for this IL. The EH clause information\n     * is defined by the CLI specification.\n     * If cClauses is 0 and pcClauses is non-NULL, *pcClauses will be set to the number of\n     * available EH clauses.\n     * If cClauses is non-zero it represents the storage capacity of the clauses array, which\n     * be filled with at most cClauses entries. *pcClauses will be set to the number of clauses\n     * actually written into clauses array.\n     */\n    HRESULT GetEHClauses(\n        [in] ULONG32 cClauses,\n        [out] ULONG32 * pcClauses,\n        [out, size_is(cClauses), length_is(*pcClauses)] CorDebugEHClause clauses[]);\n}\n\n[\n    object,\n    local,\n    uuid(46586093-D3F5-4DB6-ACDB-955BCE228C15),\n    pointer_default(unique)\n]\ninterface ICorDebugILCode2 : IUnknown\n{\n    /*\n     * Returns the token for the local variable signature for this function.\n     * If there is no signature (ie, the function doesn't have any local\n     * variables), then mdSignatureNil will be returned.\n     */\n    HRESULT GetLocalVarSigToken([out] mdSignature *pmdSig);\n\n    /*\n     * GetInstrumentedILMap returns a map from profiler instrumentated IL\n     * offsets to original method IL offsets.\n     *\n     * If the IL hasn't been instrumentated or the mapping wasn't provided\n     * by a profiler then this function returns S_OK and pcMap = 0.\n     */\n    HRESULT GetInstrumentedILMap([in] ULONG32 cMap,\n        [out] ULONG32 *pcMap,\n        [out, size_is(cMap), length_is(*pcMap)] COR_IL_MAP map[]);\n}\n\n/*\n ICorDebugClass represents a Class (mdTypeDef) in the IL image.\n For generic types, it represents the generic type definition (eg. List<T>) not any of\n the specific instantiations (eg. List<int>).\n\n Use ICorDebugClass2::GetParameterizedType to build an ICorDebugType from an\n ICorDebugClass and type parameters.\n\n Classes live in a module and are uniquely identified by a mdTypeDef.\n In other words, you can round-trip a class like so:\n    ICorDebugClass * pClass1 = ...; // some initial class\n\n    ICorDebugModule * pModule = NULL;\n    pClass1->GetModule(&pModule);\n\n    mdTypeDef token;\n    pClass1->GetToken(&token);\n\n    ICorDebugClass * pClass2;\n    pModule->GetClassFromToken(token, &pClass2);\n    // Now: pClass1 == pClass2\n\n*/\n[\n    object,\n    local,\n    uuid(CC7BCAF5-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugClass : IUnknown\n{\n    /*\n     * GetModule returns the module for the class.\n     */\n\n    HRESULT GetModule([out] ICorDebugModule **pModule);\n\n    /*\n     * GetTypeDefToken returns the metadata typedef token for the class.\n     */\n\n    HRESULT GetToken([out] mdTypeDef *pTypeDef);\n\n    /*\n     * GetStaticFieldValue returns a value object (ICorDebugValue) for the given static field\n     * variable. If the static field could possibly be relative to either\n     * a thread, context, or appdomain, then pFrame will help the debugger\n     * determine the proper value.\n     *\n     * Note that if the class accepts type parameters, then you should\n     * use GetStaticField on an appropriate ICorDebugType rather than on the\n     * ICorDebugClass.\n     *\n     * Returns:\n     *  S_OK on success.\n     *  CORDBG_E_FIELD_NOT_STATIC if the field is not static.\n     *  CORDBG_E_STATIC_VAR_NOT_AVAILABLE if field is not yet available (storage for statics\n     *    may be lazily allocated).\n     *  CORDBG_E_VARIABLE_IS_ACTUALLY_LITERAL if the field is actually a metadata literal. In this\n     *    case, the debugger should get the value from the metadata.\n     *  error on other errors.\n     */\n\n    HRESULT GetStaticFieldValue([in] mdFieldDef fieldDef,\n                                [in] ICorDebugFrame *pFrame,\n                                [out] ICorDebugValue **ppValue);\n};\n\n[\n    object,\n    local,\n    uuid(B008EA8D-7AB1-43f7-BB20-FBB5A04038AE),\n    pointer_default(unique)\n]\ninterface ICorDebugClass2 : IUnknown\n{\n    /*\n     * GetParameterizedType returns a type that corresponds to this class.\n     *\n     * If the class is non-generic, i.e. has no type parameters, then\n     * this simply gets the type object corresponding to the class.\n     * elementType should be set to the correct element type for the\n     * class, i.e. ELEMENT_TYPE_VALUETYPE if the class is a value type\n     * otherwise ELEMENT_TYPE_CLASS.\n     *\n     * If the class accepts type parameters, e.g. ArrayList<T>, then\n     * this function can be used to construct a type object for an\n     * instantiated type such as ArrayList<int>.\n     */\n    HRESULT GetParameterizedType([in] CorElementType elementType,\n                                 [in] ULONG32 nTypeArgs,\n                                 [in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[],\n                                 [out] ICorDebugType **ppType);\n\n    /*\n     * Sets the User-code status (for JMC stepping) for all methods\n     * in this class. This is functionally equivalent to setting the\n     * JMCStatus onall methods in this class.\n     * A JMC stepper will skip non-user code.\n     * User code must be a subset of debuggable code.\n     *\n     * Returns S_OK if all methods are set successfully.\n     * Return failure if any are not set.\n     * On failure, some may still be set.\n     */\n    HRESULT SetJMCStatus([in] BOOL bIsJustMyCode);\n\n};\n\n/* ------------------------------------------------------------------------- *\n * Function call interfaces\n * ------------------------------------------------------------------------- */\n\n/*\n * ICorDebugEval collects functionality which requires running code\n * inside the debuggee. Note that the operations do not complete until\n * ICorDebugProcess::Continue is called, and the EvalComplete callback\n * is called.\n *\n * An ICorDebugEval object is created in the context of a specific\n * thread, which will be used to perform the evaluations.\n *\n * If you need to use this functionality without allowing other threads\n * to run, set the DebugState of the program's threads to STOP\n * before calling Continue.\n *\n * Note that since user code is running when the evaluation is in\n * progress, any debug events can occur, including class loads,\n * breakpoints, etc. Callbacks will be called normally in such a\n * case. The state of the Eval will be seen as part of the normal\n * program state inspection, the stack chain will be a CHAIN_FUNC_EVAL chain;\n * the full debugger API continues to operate as normal. Evals can even be nested.\n *\n * Also, the user code may never complete due to deadlock or infinite\n * looping. In this case you will need to Abort the Eval before\n * resuming the program.\n *\n * All objects and types used in a given func-eval must all reside within the\n * same app domain. That app-domain need not be the same as the current\n * app domain of the thread.\n *\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAF6-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugEval : IUnknown\n{\n    /*\n     * CallFunction sets up a function call.  Note that if the function\n     * is virtual, this will perform virtual dispatch.  If the function is\n     * not static, then the first argument must be the \"this\" object.\n     * If the function is in an a different AppDomain, a transition will\n     * occur (but all arguments must also be in the target AppDomain)\n     */\n\n    HRESULT CallFunction([in] ICorDebugFunction *pFunction,\n                         [in] ULONG32 nArgs,\n                         [in, size_is(nArgs)] ICorDebugValue *ppArgs[]);\n\n    /*\n     * NewObject allocates and calls the constructor for an object.\n     */\n\n    HRESULT NewObject([in] ICorDebugFunction *pConstructor,\n                      [in] ULONG32 nArgs,\n                      [in, size_is(nArgs)] ICorDebugValue *ppArgs[]);\n\n    /*\n     * NewObjectNoConstructor allocates a new object without\n     * attempting to call any constructor on the object.\n     */\n\n    HRESULT NewObjectNoConstructor([in] ICorDebugClass *pClass);\n\n    /*\n     * NewString allocates a string object with the given contents.\n     * The string is always created in the AppDomain the thread is currently in.\n     */\n\n    HRESULT NewString([in] LPCWSTR string);\n\n    /*\n     * NewArray allocates a new array with the given element type and\n     * dimensions. If the elementType is a primitive, pElementClass\n     * may be NULL. Otherwise, pElementClass should be the class of\n     * the elements of the array. Note: lowBounds is optional. If\n     * omitted, a zero lower bound for each dimension is assumed.\n     * The array is always created in the AppDomain the thread is currently in.\n     *\n     * NOTE: In the current release, rank must be 1.\n     */\n\n    HRESULT NewArray([in] CorElementType elementType,\n                     [in] ICorDebugClass *pElementClass,\n                     [in] ULONG32 rank,\n                     [in, size_is(rank)] ULONG32 dims[],\n                     [in, size_is(rank)] ULONG32 lowBounds[]);\n\n    /*\n     * IsActive returns whether the func-eval is currently executing.\n     */\n\n    HRESULT IsActive([out] BOOL *pbActive);\n\n    /*\n     * Abort aborts the current computation.  Note that in the case of nested\n     * Evals, this may fail unless it is the most recent Eval.\n     */\n\n    HRESULT Abort();\n\n    /*\n     * GetResult returns the result of the evaluation.  This is only\n     * valid after the evaluation is completed.\n     *\n     * If the evaluation completes normally, the result will be the\n     * return value.  If it terminates with an exception, the result\n     * is the exception thrown. If the evaluation was for a new object,\n     * the return value is the reference to the object.\n     */\n\n    HRESULT GetResult([out] ICorDebugValue **ppResult);\n\n    /*\n     * GetThread returns the thread on which this eval will run or is running.\n     */\n\n    HRESULT GetThread([out] ICorDebugThread **ppThread);\n\n    /*\n     * CreateValue creates an ICorDebugValue of the given type for the\n     * sole purpose of using it in a function evaluation. These can be\n     * used to pass user constants as parameters. The value has a zero\n     * or NULL initial value. Use ICorDebugValue::SetValue to\n     * set the value.\n     *\n     * pElementClass is only required for value classes. Pass NULL\n     * otherwise.\n     *\n     * If elementType == ELEMENT_TYPE_CLASS, then you get an\n     * ICorDebugReferenceValue representing the NULL object reference.\n     * You can use this to pass NULL to evals that have object reference\n     * parameters. You cannot set the ICorDebugReferenceValue to\n     * anything... it always remains NULL.\n     */\n\n    HRESULT CreateValue([in] CorElementType elementType,\n                        [in] ICorDebugClass *pElementClass,\n                        [out] ICorDebugValue **ppValue);\n};\n\n[\n    object,\n    local,\n    uuid(FB0D9CE7-BE66-4683-9D32-A42A04E2FD91),\n    pointer_default(unique)\n]\ninterface ICorDebugEval2 : IUnknown\n{\n    /*\n     * CallParameterizedFunction is like CallFunction except the function\n     * may be inside a class with type parameters, or may itself take type\n     * parameters, or both.  The type arguments should be given for the\n     * class first, then the function.\n     *\n     * If the function is in an a different AppDomain, a transition will occur.\n     * However, all type and value arguments must be in the target AppDomain.\n     *\n     * Func-eval can only be performed in limited scenarios. If Call*Function\n     * fails, then the HR makes a best effort at describing the most general\n     * possible reason for failure.\n     */\n\n    HRESULT CallParameterizedFunction([in] ICorDebugFunction *pFunction,\n                      [in] ULONG32 nTypeArgs,\n                      [in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[],\n                      [in] ULONG32 nArgs,\n                      [in, size_is(nArgs)] ICorDebugValue *ppArgs[]);\n\n    /*\n     * CreateValueForType generalizes CreateValue by allowing you to specify an\n     * arbitrary object type including constructed types such as List<int>.\n     * Once again the sole purpose is to generate a value to pass for a function evaluation.\n     *\n     * The element type of the type must be ELEMENT_TYPE_CLASS or\n     * ELEMENT_TYPE_VALUE, or one of the simple types.  You cannot use this\n     * to create array values or string values.\n     */\n\n    HRESULT CreateValueForType([in] ICorDebugType *pType,\n                               [out] ICorDebugValue **ppValue);\n\n    /*\n    * NewParameterizedObject allocates and calls the constructor for an object.\n    * The object may be in a class that includes type parameters.\n    */\n\n    HRESULT NewParameterizedObject([in] ICorDebugFunction *pConstructor,\n                               [in] ULONG32 nTypeArgs,\n                   [in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[],\n                           [in] ULONG32 nArgs,\n                   [in, size_is(nArgs)] ICorDebugValue *ppArgs[]);\n\n    /*\n     * NewParameterizedObjectNoConstructor allocates a new object without\n     * attempting to call any constructor on the object.\n     * The object may be in a class that includes type parameters.\n     */\n\n    HRESULT NewParameterizedObjectNoConstructor([in] ICorDebugClass *pClass,\n                        [in] ULONG32 nTypeArgs,\n                        [in, size_is(nTypeArgs)] ICorDebugType *ppTypeArgs[]);\n\n    /*\n     * NewParameterizedArray allocates a new array whose elements may be instances\n     * of a generic type.  The array is always created in the AppDomain the thread is\n     * currently in.\n     */\n    HRESULT NewParameterizedArray([in] ICorDebugType *pElementType,\n                  [in] ULONG32 rank,\n                  [in, size_is(rank)] ULONG32 dims[],\n                  [in, size_is(rank)] ULONG32 lowBounds[]);\n\n   /*\n    * NewStringWithLength allocates a string object with the given contents.\n    * The length is specified in uiLength. This is used for user to pass in null\n    * embedded string. If the string's tailing null is expected to be in\n    * the managed string, client has to ensure the length including the tailing null.\n    *\n    * The string is always created in the AppDomain the thread is currently in.\n    */\n\n    HRESULT NewStringWithLength([in] LPCWSTR string,\n                               [in] UINT  uiLength);\n\n    /*\n     * RudeAbort aborts the current computation.  Any locks the aborted\n     * eval was holding are not released, and thus the debugging session\n     * is in an unsafe state.\n     */\n\n     HRESULT RudeAbort(void);\n\n};\n\n\n/* ------------------------------------------------------------------------- *\n * Runtime value interfaces\n * ------------------------------------------------------------------------- */\n\n/*\n * ICorDebugValue represents a value in the remote process.  Note that\n * the values can be both Get and Set; they are \"lvalues\".\n *\n * In general, ownership of a value object is passed when it is returned. The\n * recipient is responsible for removing a reference from the object when\n * finished with it.\n *\n * Depending on where the value was retrieved from, the value may not remain\n * valid after the process is resumed,\n * so in general they shouldn't be held across continues.\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAF7-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugValue : IUnknown\n{\n    /*\n     * GetType returns the simple type of the value.  If the object\n     * has a more complex runtime type, that type may be examined through the\n     * appropriate subclasses (e.g. ICorDebugObjectValue can get the class of\n     * an object.)\n     */\n\n    HRESULT GetType([out] CorElementType *pType);\n\n    /*\n     * GetSize returns the size of the value in bytes. Note that for reference\n     * types this will be the size of the pointer rather than the size of\n     * the object.\n     */\n\n    HRESULT GetSize([out] ULONG32 *pSize);\n\n    /*\n     * GetAddress returns the address of the value in the debugee\n     * process.  This might be useful information for the debugger to\n     * show.\n     *\n     * If the value is unavailable, 0 is returned. This could happen if\n     * it is at least partly in registers or stored in a GC Handle.\n     */\n\n    HRESULT GetAddress([out] CORDB_ADDRESS *pAddress);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT CreateBreakpoint([out] ICorDebugValueBreakpoint **ppBreakpoint);\n\n};\n\n[\n    object,\n    local,\n    uuid(5E0B54E7-D88A-4626-9420-A691E0A78B49),\n    pointer_default(unique)\n]\ninterface ICorDebugValue2 : IUnknown\n{\n    /*\n     * GetExactType returns the runtime type of the object in the value.\n     */\n\n    HRESULT GetExactType([out] ICorDebugType **ppType);\n\n};\n\n[\n    object,\n    local,\n    uuid(565005FC-0F8A-4F3E-9EDB-83102B156595),\n    pointer_default(unique)\n]\ninterface ICorDebugValue3 : IUnknown\n{\n    /*\n     * GetSize returns the size of the value in bytes. It has the same\n     * semantics as ICorDebugValue::GetSize except that it works\n     * for arrays >4GB.\n     */\n\n    HRESULT GetSize64([out] ULONG64 *pSize);\n\n};\n\n/*\n * ICorDebugGenericValue is a subclass of ICorDebugValue which applies to\n * all values, and can be used to get & set the value.  It is a\n * separate subinterface because it is non-remotable.\n *\n * Note that for reference types, the value is the reference rather than\n * the contents.\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAF8-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugGenericValue : ICorDebugValue\n{\n    /*\n     * GetValue copies the value into the specified buffer.  The buffer should\n     * be the appropriate size for the simple type.\n     */\n\n    HRESULT GetValue([out] void *pTo);\n\n    /*\n     * SetValue copies a new value from the specified buffer. The buffer should\n     * be the approprirate size for the simple type.\n     *\n     */\n\n    HRESULT SetValue([in] void *pFrom);\n};\n\n/* ISSUE: an remotable interface for each simple type\n *\n * It might be nice to have a subclass with a typesafe Get/Set for each simple\n * type.\n */\n\n/*\n * ICorDebugReferenceValue is a subclass of ICorDebugValue which applies to\n * a reference type.\n * The runtime may Garbage Collect objects once the debuggee is continued. The GC may\n * move objects around in memory.\n *\n * An ICorDebugReference will either cooperate with GCs such that its information is updated\n * after the GC, or it will be implicitly neutered before the GC.\n *\n * The ICorDebugReferenceValue interface may be implicitly neutered after the debuggee\n * has been continued. The derived ICorDebugHandleValue is not neutered until explicitly\n * released or exposed.\n *\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAF9-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugReferenceValue : ICorDebugValue\n{\n    /*\n     * IsNull tests whether the reference is null.\n     */\n\n    HRESULT IsNull([out] BOOL *pbNull);\n\n    /*\n     * GetValue returns the current address of the object referred to by this\n     * reference.\n     */\n\n    HRESULT GetValue([out] CORDB_ADDRESS *pValue);\n\n    /*\n     * SetValue sets this reference to refer to a different address.\n     */\n\n    HRESULT SetValue([in] CORDB_ADDRESS value);\n\n    /*\n     * Dereference returns a ICorDebugValue representing the value\n     * referenced. This is only valid while the interface has not yet been neutered.\n     */\n\n    HRESULT Dereference([out] ICorDebugValue **ppValue);\n\n    /*\n     * DEPRECATED\n     */\n\n    HRESULT DereferenceStrong([out] ICorDebugValue **ppValue);\n};\n\n/*\n * ICorDebugHeapValue is a subclass of ICorDebugValue which represents\n * a garbage collected object\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAFA-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugHeapValue : ICorDebugValue\n{\n    /*\n     * DEPRECATED.\n     * All objects are only valid until Continue is called, at which time they are neutered.\n     */\n\n    HRESULT IsValid([out] BOOL *pbValid);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT CreateRelocBreakpoint([out]\n                                  ICorDebugValueBreakpoint **ppBreakpoint);\n\n};\n\n/*\n * ICorDebugHeapValue2\n */\n\n[\n    object,\n    local,\n    uuid(E3AC4D6C-9CB7-43e6-96CC-B21540E5083C),\n    pointer_default(unique)\n]\ninterface ICorDebugHeapValue2 : IUnknown\n{\n\n    /*\n      * Creates a handle of the given type for this heap value.\n      *\n      */\n    HRESULT CreateHandle([in] CorDebugHandleType type, [out] ICorDebugHandleValue ** ppHandle);\n\n};\n\n/*\n * ICorDebugHeapValue3 - exposes the monitor lock properties of objects\n */\n\n[\n    object,\n    local,\n    uuid(A69ACAD8-2374-46e9-9FF8-B1F14120D296),\n    pointer_default(unique)\n]\ninterface ICorDebugHeapValue3 : IUnknown\n{\n\n    /*\n     * Gets the owning thread for a monitor lock\n     */\n    HRESULT GetThreadOwningMonitorLock([out] ICorDebugThread **ppThread, [out] DWORD *pAcquisitionCount);\n\n    /*\n     * Gets the list of threads waiting on a monitor event\n     */\n    HRESULT GetMonitorEventWaitList([out] ICorDebugThreadEnum **ppThreadEnum);\n};\n\n/*\n * ICorDebugHeapValue4\n */\n\n[\n    object,\n    local,\n    uuid(B35DD495-A555-463B-9BE9-C55338486BB8),\n    pointer_default(unique)\n]\ninterface ICorDebugHeapValue4 : IUnknown\n{\n\n    /*\n      * Creates a handle of the given type for this heap value.\n      *\n      */\n    HRESULT CreatePinnedHandle([out] ICorDebugHandleValue ** ppHandle);\n\n};\n\n/*\n * ICorDebugObjectValue is a subclass of ICorDebugValue which applies to\n * values which contain an object.\n * An ICorDebugObjectValue becomes invalid after the debuggee is continued.\n */\n\n[\n    object,\n    local,\n    uuid(18AD3D6E-B7D2-11d2-BD04-0000F80849BD),\n    pointer_default(unique)\n]\ninterface ICorDebugObjectValue : ICorDebugValue\n{\n    /*\n     * GetClass returns the runtime class of the object in the value.\n     */\n\n    HRESULT GetClass([out] ICorDebugClass **ppClass);\n\n    /*\n     * GetFieldValue returns a value for the given field in the given\n     * class. The class must be on the class hierarchy of the object's\n     * class, and the field must be a field of that class.\n     */\n\n    HRESULT GetFieldValue([in] ICorDebugClass *pClass,\n                          [in] mdFieldDef fieldDef,\n                          [out] ICorDebugValue **ppValue);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetVirtualMethod([in] mdMemberRef memberRef,\n                             [out] ICorDebugFunction **ppFunction);\n\n    /*\n     * NOT YET IMPLEMENTED\n     */\n\n    HRESULT GetContext([out] ICorDebugContext **ppContext);\n\n    /*\n     * IsValueClass returns true if the class of this object is\n     * a value class.\n     */\n\n    HRESULT IsValueClass([out] BOOL *pbIsValueClass);\n\n    /*\n     * DEPRECATED\n     */\n\n    HRESULT GetManagedCopy([out] IUnknown **ppObject);\n\n    /*\n     * DEPRECATED\n     */\n\n    HRESULT SetFromManagedCopy([in] IUnknown *pObject);\n};\n\n[\n    object,\n    local,\n    uuid(49E4A320-4A9B-4eca-B105-229FB7D5009F),\n    pointer_default(unique)\n]\ninterface ICorDebugObjectValue2 : IUnknown\n{\n    /*\n     * GetVirtualMethodForType returns the most derived function\n     * for the given ref on this object.\n     *\n     * Note: not yet implemented.\n     */\n\n    HRESULT GetVirtualMethodAndType([in] mdMemberRef memberRef,\n                                    [out] ICorDebugFunction **ppFunction,\n                                    [out] ICorDebugType **ppType);\n};\n\n[\n    object,\n    local,\n    uuid(3AF70CC7-6047-47F6-A5C5-090A1A622638),\n    pointer_default(unique)\n]\ninterface ICorDebugDelegateObjectValue : IUnknown\n{\n    /*\n     * GetTarget retrieves the object on which the delegate calls the function.\n     * Returns:\n     *  - S_OK:\n     *      - The ICorDebugReferenceValue object targeted by the function.\n     *      - NULL if the delegate function is a static function or an open delegate\n     *  - HRESULT CORDBG_E_UNSUPPORTED_DELEGATE for curently unsupported delegates.\n     *      In this case, the value of ppObject should not be used. Some of these\n     *      include: Wrapper delegates, Open Virual delegates.\n     */\n    HRESULT GetTarget([out] ICorDebugReferenceValue **ppObject);\n\n    /*\n     * GetFunction returns the function that gets run by the delegate.\n    *  - S_OK:\n     *      - The ICorDebugFunction function for the function the delegate would invoke.\n     *      - There are a few cases where the ICorDebugFunction can be different from what's expected,\n     *        such as generic methods, which won't contain the instantiation.\n     *  - HRESULT CORDBG_E_UNSUPPORTED_DELEGATE for curently unsupported delegates.\n     *      In this case, the value of ppObject should not be used. Some of these\n     *      include: Wrapper delegates, Open Virual delegates.\n     */\n    HRESULT GetFunction([out] ICorDebugFunction **ppFunction);\n}\n\n\n/*\n * ICorDebugBoxValue is a subclass of ICorDebugValue which\n * represents a boxed value class object.\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAFC-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugBoxValue : ICorDebugHeapValue\n{\n    /*\n     * GetObject returns the value object which is in the box.\n     */\n\n    HRESULT GetObject([out] ICorDebugObjectValue **ppObject);\n};\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface ICorDebugStringValue */\n/*\n * ICorDebugStringValue is a subclass of ICorDebugValue which\n * applies to values which contain a string.  This interface\n * provides an easy way to get the string contents.\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCAFD-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugStringValue : ICorDebugHeapValue\n{\n    /*\n     * GetLength returns the number of characters in the string.\n     */\n\n    HRESULT GetLength([out] ULONG32 *pcchString);\n\n    /*\n     * GetString returns the contents of the string.\n     */\n\n    HRESULT GetString([in] ULONG32 cchString,\n                      [out] ULONG32 *pcchString,\n                      [out, size_is(cchString),\n                      length_is(*pcchString)] WCHAR szString[]);\n};\n#pragma warning(pop)\n\n/*\n * ICorDebugArrayValue is a subclass of ICorDebugValue which applies\n * to values which contain an array. This interface supports both\n * single and multidimension arrays.\n */\n\n[\n    object,\n    local,\n    uuid(0405B0DF-A660-11d2-BD02-0000F80849BD),\n    pointer_default(unique)\n]\ninterface ICorDebugArrayValue : ICorDebugHeapValue\n{\n    /*\n     * GetElementType returns the simple type of the elements in the\n     * array.\n     */\n\n    HRESULT GetElementType([out] CorElementType *pType);\n\n    /*\n     * GetRank returns the number of dimensions in the array.\n     */\n\n    HRESULT GetRank([out] ULONG32 *pnRank);\n\n    /*\n     * GetCount returns the total number of elements in the array.\n     */\n\n    HRESULT GetCount([out] ULONG32 *pnCount);\n\n    /*\n     * GetDimensions returns the dimensions of the array.\n     */\n\n    HRESULT GetDimensions([in] ULONG32 cdim,\n                          [out, size_is(cdim),\n                           length_is(cdim)] ULONG32 dims[]);\n\n    /*\n     * HasBaseIndicies returns whether or not the array has base indices.\n     * If the answer is no, then all dimensions have a base index of 0.\n     */\n\n    HRESULT HasBaseIndicies([out] BOOL *pbHasBaseIndicies);\n\n    /*\n     * GetBaseIndicies returns the base index of each dimension in\n     * the array\n     */\n\n    HRESULT GetBaseIndicies([in] ULONG32 cdim,\n                            [out, size_is(cdim),\n                            length_is(cdim)] ULONG32 indices[]);\n\n    /*\n     * GetElement returns a value representing the given element in the array.\n     * The indices array must not be null.\n     */\n\n    HRESULT GetElement([in] ULONG32 cdim,\n                       [in, size_is(cdim),\n                        length_is(cdim)] ULONG32 indices[],\n                       [out] ICorDebugValue **ppValue);\n    /*\n     * GetElementAtPosition returns the element at the given position,\n     * treating the array as a zero-based, single-dimensional array.\n     *\n     * Multidimensional array layout follows the C++ style of array layout.\n     */\n\n    HRESULT GetElementAtPosition([in] ULONG32 nPosition,\n                                 [out] ICorDebugValue **ppValue);\n};\n\n[\n    object,\n    local,\n    uuid(50847b8d-f43f-41b0-924c-6383a5f2278b),\n    pointer_default(unique)\n]\ninterface ICorDebugVariableHome : IUnknown\n{\n    /*\n     * GetCode - gives the ICorDebugCode instance containing this\n     * ICorDebugVariableHome.\n     */\n    HRESULT GetCode([out] ICorDebugCode **ppCode);\n    /*\n     * GetSlotIndex - gives the managed slot-index of a local variable.\n     * The slot-index can be used to retrieve the metadata for this local.\n     * Returns E_FAIL if the variable is a function argument.\n     */\n    HRESULT GetSlotIndex([out] ULONG32 *pSlotIndex);\n\n    /*\n     * GetArgumentIndex - gives the argument index of a function argument.\n     * The argument index can be used to retrieve the metadata for this\n     * argument.\n     * Returns E_FAIL if the variable is a local variable.\n     */\n    HRESULT GetArgumentIndex([out] ULONG32* pArgumentIndex);\n\n    /*\n     * GetLiveRange - gives the native range over which this variable is live.\n     * pStartOffset is the logical offset at which the variable is first live.\n     * pEndOffset is the logical offset immediately after that at which the\n     * variable is last live.\n     */\n    HRESULT GetLiveRange([out] ULONG32* pStartOffset,\n                         [out] ULONG32 *pEndOffset);\n\n    typedef enum VariableLocationType\n    {\n        VLT_REGISTER,             // variable is in a register\n        VLT_REGISTER_RELATIVE,    // variable is in a register-relative memory\n                                  // location\n        VLT_INVALID\n    } VariableLocationType;\n\n    /*\n     * GetLocationType - gives the type of native location. See\n     * VariableLocationType.\n     * Returns VLT_INVALID if the variable is not stored in a register or in a\n     * register-relative memory location.\n     */\n    HRESULT GetLocationType([out] VariableLocationType *pLocationType);\n\n    /*\n     * GetRegister - gives the register containing the variables with location\n     * type VLT_REGISTER, and the base register for variables with location\n     * type VLT_REGISTER_RELATIVE.\n     * Returns E_FAIL if the variable is not in a register or in a\n     * register-relative location.\n     */\n    HRESULT GetRegister([out] CorDebugRegister *pRegister);\n\n    /*\n     * GetOffset - gives the offset from the base register for a variable.\n     * Returns E_FAIL if the variable is not in a register-relative memory\n     * location.\n     */\n    HRESULT GetOffset([out] LONG *pOffset);\n}\n\n\n\n/*\n * ICorDebugHandleValue represents a reference value that the debugger has\n * explicitly created a GC handle to. It does not represent GC Handles in the debuggee process,\n\n * A normal ICorDebugReference becomes neutered after the debuggee has been\n * continued. A ICorDebugHandleValue will survive across continues and can be\n * dereferenced until the client explicitly disposes the handle.\n *\n *\n * ICorDebugHeapValu2::CreateHandle will create ICorDebugHandleValue\n */\n[\n    object,\n    local,\n    uuid(029596E8-276B-46a1-9821-732E96BBB00B),\n    pointer_default(unique)\n]\ninterface ICorDebugHandleValue : ICorDebugReferenceValue\n{\n    /*\n      * returns the type of this handle.\n      *\n      */\n    HRESULT GetHandleType([out] CorDebugHandleType *pType);\n\n\n    /*\n      * The final release of the interface will also dispose of the handle. This\n      * API provides the ability for client to early dispose the handle.\n      *\n      */\n    HRESULT Dispose();\n\n};\n\n\n/*\n * ICorDebugContext represents a context object.\n *\n * Interface TBD.\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCB00-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugContext : ICorDebugObjectValue\n{\n};\n\n\n/*\n * ICorDebugComObjectValue applies to values which contain a COM object.\n * An ICorDebugComObjectValue becomes invalid after the debuggee is continued.\n */\n\n[\n    object,\n    local,\n    uuid(5F69C5E5-3E12-42DF-B371-F9D761D6EE24),\n    pointer_default(unique)\n]\ninterface ICorDebugComObjectValue : IUnknown\n{\n    /*\n     * GetCachedInterfaceTypes returns an enum of the types of all interfaces\n     * that are cached by the COM object.\n     */\n    HRESULT GetCachedInterfaceTypes(\n                        [in] BOOL bIInspectableOnly,\n                        [out] ICorDebugTypeEnum **ppInterfacesEnum);\n\n    /*\n     * GetCachedInterfacePointers returns at most celt values of the\n     * interface pointer values cached by the COM object. It fills\n     * pcEltFetched with the actual number of fetched elements.\n     * When called with NULL for ptrs, and 0 for celt, it simply returns\n     * the number of elements it needs.\n     */\n    HRESULT GetCachedInterfacePointers(\n                        [in] BOOL bIInspectableOnly,\n                        [in] ULONG32 celt,\n                        [out] ULONG32 *pcEltFetched,\n                        [out, size_is(celt), length_is(*pcEltFetched)] CORDB_ADDRESS * ptrs);\n};\n\n/* ------------------------------------------------------------------------- *\n * Enum interfaces\n * ------------------------------------------------------------------------- */\n\n/*\n * ICorDebugEnum is an abstract enumerator.\n */\n\n[\n    object,\n    local,\n    uuid(CC7BCB01-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugEnum : IUnknown\n{\n    /*\n     * Moves the current position forward the given number of\n     * elements.\n     */\n    HRESULT Skip([in] ULONG celt);\n\n    /*\n     * Sets the position of the enumerator to the beginning of the\n     * enumeration.\n     */\n    HRESULT Reset();\n\n    /*\n     * Creates another enumerator with the same current position\n     * as this one.\n     */\n    HRESULT Clone([out] ICorDebugEnum **ppEnum);\n\n    /*\n     * Gets the number of elements in the enumeration\n     */\n    HRESULT GetCount([out] ULONG *pcelt);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB02-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugObjectEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of objects in the enumeration.\n     * The actual number of objects retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of objects retrieved is smaller\n     * than the number of objects requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt),\n                  length_is(*pceltFetched)]  CORDB_ADDRESS objects[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB03-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\n\ninterface ICorDebugBreakpointEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of breakpoints in the enumeration.\n     * The actual number of breakpoints retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of breakpoints retrieved is smaller\n     * than the number of breakpoints requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugBreakpoint *breakpoints[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB04-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\n\ninterface ICorDebugStepperEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of steppers in the enumeration.\n     * The actual number of steppers retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of steppers retrieved is smaller\n     * than the number of steppers requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugStepper *steppers[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB05-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugProcessEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of processes in the enumeration.\n     * The actual number of processes retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of processes retrieved is smaller\n     * than the number of processes requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugProcess *processes[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB06-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugThreadEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of threads in the enumeration.\n     * The actual number of threads retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of threads retrieved is smaller\n     * than the number of threads requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugThread *threads[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB07-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugFrameEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of frames in the enumeration.\n     * The actual number of frames retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of frames retrieved is smaller\n     * than the number of frames requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugFrame *frames[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB08-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugChainEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of chains in the enumeration.\n     * The actual number of chains retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of chains retrieved is smaller\n     * than the number of chains requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugChain *chains[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB09-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugModuleEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of modules in the enumeration.\n     * The actual number of modules retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of modules retrieved is smaller\n     * than the number of modules requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugModule *modules[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(CC7BCB0A-8A68-11d2-983C-0000F808342D),\n    pointer_default(unique)\n]\ninterface ICorDebugValueEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of values in the enumeration.\n     * The actual number of values retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of values retrieved is smaller\n     * than the number of values requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugValue *values[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(e76b7a57-4f7a-4309-85a7-5d918c3deaf7),\n    pointer_default(unique)\n]\ninterface ICorDebugVariableHomeEnum : ICorDebugEnum\n{\n    /*\n     * Next - gives the specified number of ICorDebugVariableHome instances from\n     * the enumeration, starting at the current position.\n     * celt is the number of requested instances.\n     * pceltFetched is the number of instances retrieved.\n     * returns S_FALSE if the actual number of instances retrieved is smaller\n     * than the number of instances requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                     ICorDebugVariableHome *homes[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(55E96461-9645-45e4-A2FF-0367877ABCDE),\n    pointer_default(unique)\n]\ninterface ICorDebugCodeEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of code objects in the enumeration.\n     * The actual number of code objects retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of code objects retrieved is smaller\n     * than the number of code objects requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugCode *values[],\n                 [out] ULONG *pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(10F27499-9DF2-43ce-8333-A321D7C99CB4),\n    pointer_default(unique)\n]\ninterface ICorDebugTypeEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of types in the enumeration.\n     * The actual number of types retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of types retrieved is smaller\n     * than the number of types requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugType *values[],\n                 [out] ULONG *pceltFetched);\n};\n\n\n\n/*\n * ICorDebugType represents an instantiated type in the debugggee.\n * Unlike ICorDebugClass, it can store type-parameter information and thus can\n * represent instantiated generic types (Eg, List<int>)\n * Use the metadata interfaces to get static (Compile-time) information about the type.\n *\n * A type (and all of its type parameters) lives in an single AppDomain and becomes\n * invalid once the containing ICorDebugAppDomain is unloaded.\n *\n * Types may be lazily loaded, so if the debugger queries for a type that hasn't been\n * loaded yet, it may be unavailable.\n */\n[\n    object,\n    local,\n    uuid(D613F0BB-ACE1-4c19-BD72-E4C08D5DA7F5),\n    pointer_default(unique)\n]\ninterface ICorDebugType : IUnknown\n{\n    /*\n    * GetType gets the basic type of the generic parameter.  This can be used to\n    * determine if it is necessary to call GetClass to find the full information for the\n    * generic type parameter.\n    */\n    HRESULT GetType([out] CorElementType *ty);\n\n    /*\n    * GetClass is used if the CorElementType returned by GetType is ELEMENT_TYPE_CLASS,\n    * ELEMENT_TYPE_VALUETYPE.  If the type is a constructed type, e.g. List<String>,\n    * then this will return the ICorDebugClass for the type constructor, i.e. \"List<T>\".\n    *\n    * GetClass should not be used if the element type is anything other than these two element\n    * types.  In particular, it may not be used if the element type is ELEMENT_TYPE_STRING.\n    */\n    HRESULT GetClass([out] ICorDebugClass **ppClass);\n\n    /*\n    * EnumerateTypeParameters may be used if the CorElementType\n        * returned by GetType is one of ELEMENT_TYPE_CLASS,\n        * ELEMENT_TYPE_VALUETYPE, ELEMENT_TYPE_ARRAY, ELEMENT_TYPE_SZARRAY,\n    * ELEMENT_TYPE_BYREF, ELEMENT_TYPE_PTR or ELEMENT_TYPE_FNPTR.\n        * It returns the parameters specifying further information about\n        * the type.  For example, if the type is \"class Dict<String,int32>\"\n    * then EnumerateTypeParameters will return \"String\" and \"int32\"\n        * in sequence.\n    *\n     */\n    HRESULT EnumerateTypeParameters([out] ICorDebugTypeEnum **ppTyParEnum);\n\n    /*\n    * GetFirstTypeParameter can be used in those cases where the further\n        * information about the type involves at most one type\n    * parameter.  You can determine this from the element type returned by\n        * GetType.  In particular it may be used with\n        * ELEMENT_TYPE_ARRAY, ELEMENT_TYPE_SZARRAY, ELEMENT_TYPE_BYREF\n        * or ELEMENT_TYPE_PTR.\n     * This can only be called if the type does indeed have a type-parameter.\n    */\n    HRESULT GetFirstTypeParameter([out] ICorDebugType **value);\n\n    /*\n     * GetBase returns the ICorDebugType object for the base type of this type, if it\n     * has one, i.e. if the type is a class type.\n     * For example, if\n     *        class MyStringDict<T> : Dict<String,T>\n     * then the base type of \"MyStringDict<int32>\" will be \"Dict<String,int32>\".\n     *\n     * This is a helper function - you could compute this from EnumerateTypeParameters,\n     * GetClass and the relevant metadata, but it is relatively painful: you would\n     * have to lookup the class, then the metadata of that class\n     * to find the \"generic\" base type, then instantiate this generic base type by\n     * looking up the type parameters to the initial type,\n     * and then perform the appropriate instantiation in the case where the class\n     * happens to be either a generic class or a normal class with a constructed type\n     * as its parent.  Looking up the base types is useful to implement common\n     * debugger functionality, e.g. printing out all the fields of an object, including its\n     * superclasses.\n     *\n     */\n\n    HRESULT GetBase([out] ICorDebugType **pBase);\n\n    /*\n     * GetStaticFieldValue returns a value object (ICorDebugValue)\n         * for the given static field variable. For non-parameterized\n         * types, this is identical to calling GetStaticFieldValue on the\n         * ICorDebugClass object returned by ICorDebugType::GetClass.\n         * For parameterized types a static field value will be relative to a\n         * particular instantiation.  If in addition the static field could\n         * possibly be relative to either a thread, context, or appdomain, then pFrame\n         * will help the debugger determine the proper value.\n         *\n         * This may only be used when ICorDebugType::GetType returns\n         * ELEMENT_TYPE_CLASS or ELEMENT_TYPE_VALUETYPE.\n     */\n    HRESULT GetStaticFieldValue([in] mdFieldDef fieldDef,\n                                    [in] ICorDebugFrame *pFrame,\n                            [out] ICorDebugValue **ppValue);\n\n\n    /*\n     * GetRank returns the number of dimensions in an array type\n     */\n\n    HRESULT GetRank([out] ULONG32 *pnRank);\n\n};\n\n\n[\n    object,\n    local,\n    uuid(e6e91d79-693d-48bc-b417-8284b4f10fb5),\n    pointer_default(unique)\n]\ninterface ICorDebugType2 : IUnknown\n{\n    /*\n     * GetTypeID - gives a COR_TYPEID for the ICorDebugType. This\n     * provides a mapping from the ICorDebugType, which represents a\n     * type that may or may not have been loaded into the runtime, to\n     * a COR_TYPEID, which serves as an opaque handle identifying a\n     * type loaded into the runtime. When the type that the\n     * ICorDebugType represents has not yet been loaded, this returns\n     * CORDBG_E_CLASS_NOT_LOADED. Returns CORDBG_E_UNSUPPORTED for\n     * unsupported types.\n     */\n    HRESULT GetTypeID([out] COR_TYPEID *id);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * DEPRECATED\n *\n * ICorDebugErrorInfoEnum interface\n *\n * ------------------------------------------------------------------------- */\n[\n    object,\n    local,\n    uuid(F0E18809-72B5-11d2-976F-00A0C9B4D50C),\n    pointer_default(unique)\n]\ninterface ICorDebugErrorInfoEnum : ICorDebugEnum\n{\n    /*\n     * DEPRECATED\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugEditAndContinueErrorInfo *errors[],\n                 [out] ULONG *pceltFetched);\n};\n\n/* ------------------------------------------------------------------------- *\n * AppDomainEnum interface\n * ------------------------------------------------------------------------- */\n\n[\n    object,\n    local,\n    uuid(63ca1b24-4359-4883-bd57-13f815f58744),\n    pointer_default(unique)\n]\n\ninterface ICorDebugAppDomainEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" app domains in the enumeration\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugAppDomain *values[],\n                 [out] ULONG *pceltFetched);\n\n};\n\n\n/* ------------------------------------------------------------------------- *\n * AssemblyEnum interface\n * ------------------------------------------------------------------------- */\n\n[\n    object,\n    local,\n    uuid(4a2a1ec9-85ec-4bfb-9f15-a89fdfe0fe83),\n    pointer_default(unique)\n]\n\ninterface ICorDebugAssemblyEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" assemblies in the enumeration\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                    ICorDebugAssembly *values[],\n                 [out] ULONG *pceltFetched);\n\n};\n\n/* ------------------------------------------------------------------------- *\n * BlockingObjectEnum interface\n * ------------------------------------------------------------------------- */\n\n[\n    object,\n    local,\n    uuid(976A6278-134A-4a81-81A3-8F277943F4C3),\n    pointer_default(unique)\n]\n\ninterface ICorDebugBlockingObjectEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" blocking objects in the enumeration\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                 CorDebugBlockingObject values[],\n                 [out] ULONG *pceltFetched);\n\n};\n\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n// Represent data for an Managed Debugging Assistant (MDA) notification. See the MDA documentation for MDA-specific information like:\n// - enabling / disabling MDAs\n// - MDA naming conventions\n// - What the contents of an MDA look like, schemas, etc.\n[\n    object,\n    local,\n    uuid(CC726F2F-1DB7-459b-B0EC-05F01D841B42),\n    pointer_default(unique)\n]\ninterface ICorDebugMDA : IUnknown\n{\n    // Get the string for the type of the MDA. Never empty.\n    // This is a convenient performant alternative to getting the XML stream and extracting\n    // the type from that based off the schema.\n    HRESULT GetName(\n        [in] ULONG32 cchName,\n        [out] ULONG32 * pcchName,\n        [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    // Get a string description of the MDA. This may be empty (0-length).\n    HRESULT GetDescription(\n        [in] ULONG32 cchName,\n        [out] ULONG32 * pcchName,\n        [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    // Get the full associated XML for the MDA. This may be empty.\n    // This could be a potentially expensive operation if the xml stream is large.\n    // See the MDA documentation for the schema for this XML stream.\n    HRESULT GetXML(\n        [in] ULONG32 cchName,\n        [out] ULONG32 * pcchName,\n        [out, size_is(cchName), length_is(*pcchName)] WCHAR szName[]);\n\n    // Get the flags associated w/ the MDA. New flags may be added in future versions.\n    typedef enum CorDebugMDAFlags\n    {\n\t// If this flag is high, then the thread may have slipped since the MDA was fired.\n\tMDA_FLAG_SLIP = 0x2\n    } CorDebugMDAFlags;\n    HRESULT GetFlags([in] CorDebugMDAFlags * pFlags);\n\n    // Thread that the MDA is fired on. We use the os tid instead of an ICDThread in case an MDA is fired on a\n    // native thread (or a managed thread that hasn't yet entered managed code and so we don't have a ICDThread\n    // object for it yet)\n    HRESULT GetOSThreadId([out] DWORD * pOsTid);\n};\n#pragma warning(pop)\n\n/* ------------------------------------------------------------------------- *\n * Edit and Continue interfaces\n * DEPRECATED\n * ------------------------------------------------------------------------- */\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface ICorDebugEditAndContinueErrorInfo */\n/*\n * DEPRECATED\n *\n * ICorDebugEditAndContinueErrorInfo\n *\n */\n[\n    object,\n    local,\n    uuid(8D600D41-F4F6-4cb3-B7EC-7BD164944036),\n    pointer_default(unique)\n]\ninterface ICorDebugEditAndContinueErrorInfo : IUnknown\n{\n    /*\n     * DEPRECATED\n     */\n    HRESULT GetModule([out] ICorDebugModule **ppModule);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT GetToken([out]mdToken *pToken);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT GetErrorCode([out]HRESULT *pHr);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT GetString([in] ULONG32 cchString,\n                      [out] ULONG32 *pcchString,\n                      [out, size_is(cchString),\n                      length_is(*pcchString)] WCHAR szString[]);\n}\n#pragma warning(pop)\n\n/*\n * DEPRECATED\n *\n * ICorDebugEditAndContinueSnapshot\n */\n\n[\n    object,\n    local,\n    uuid(6DC3FA01-D7CB-11d2-8A95-0080C792E5D8),\n    pointer_default(unique)\n]\ninterface ICorDebugEditAndContinueSnapshot : IUnknown\n{\n    /*\n     * DEPRECATED\n     */\n    HRESULT CopyMetaData([in] IStream *pIStream, [out] GUID *pMvid);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT GetMvid([out] GUID *pMvid);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT GetRoDataRVA([out] ULONG32 *pRoDataRVA);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT GetRwDataRVA([out] ULONG32 *pRwDataRVA);\n\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT SetPEBytes([in] IStream *pIStream);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT SetILMap([in] mdToken mdFunction, [in] ULONG cMapSize,\n                     [in, size_is(cMapSize)] COR_IL_MAP map[]);\n\n    /*\n     * DEPRECATED\n     */\n    HRESULT SetPESymbolBytes([in] IStream *pIStream);\n};\n\n[\n    object,\n    local,\n    uuid(ED775530-4DC4-41F7-86D0-9E2DEF7DFC66),\n    pointer_default(unique)\n]\ninterface ICorDebugExceptionObjectCallStackEnum : ICorDebugEnum\n{\n    /*\n     * Gets the next \"celt\" number of frames in the enumeration.\n     * The actual number of frames retrieved is returned in \"pceltFetched\".\n     * Returns S_FALSE if the actual number of frames retrieved is smaller\n     * than the number of frames requested.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                 CorDebugExceptionObjectStackFrame values[],\n                 [out] ULONG* pceltFetched);\n};\n\n[\n    object,\n    local,\n    uuid(AE4CA65D-59DD-42A2-83A5-57E8A08D8719),\n    pointer_default(unique)\n]\ninterface ICorDebugExceptionObjectValue : IUnknown\n{\n    HRESULT EnumerateExceptionCallStack([out] ICorDebugExceptionObjectCallStackEnum** ppCallStackEnum);\n};\n\n/* ------------------------------------------------------------------------- *\n * Library definition\n * ------------------------------------------------------------------------- */\n\n[\n    uuid(53D13620-F417-11d1-9762-A63826A4F255),\n    version(1.0),\n    helpstring(\"Common Language Runtime Debugging 1.0 Type Library\")\n]\nlibrary CORDBLib\n{\n    importlib(\"stdole32.tlb\");\n\n    // There should be no co-class for V2.0 CorDebug at all.\n    // Clients should create the ICorDebug object using the shim API\n    // CreateDebuggerInterfaceFromVersion defined in mscoree.idl.\n    // This guid here is the same as the v1.1 guid for setup / breaking-change purposes.\n    [\n        uuid(6fef44d0-39e7-4c77-be8e-c9f8cf988630)\n    ]\n    coclass CorDebug\n    {\n        [default] interface ICorDebug;\n    };\n\n    [\n        uuid(211f1254-bc7e-4af5-b9aa-067308d83dd1)\n    ]\n    coclass EmbeddedCLRCorDebug\n    {\n        [default] interface ICorDebug;\n    };\n\n    interface ICorDebugReferenceValue;\n    interface ICorDebugStringValue;\n    interface ICorDebugGenericValue;\n    interface ICorDebugBoxValue;\n    interface ICorDebugArrayValue;\n    interface ICorDebugILFrame;\n    interface ICorDebugInternalFrame;\n    interface ICorDebugInternalFrame2;\n    interface ICorDebugNativeFrame;\n    interface ICorDebugNativeFrame2;\n    interface ICorDebugRuntimeUnwindableFrame;\n\n    interface ICorDebugManagedCallback2;\n    interface ICorDebugAppDomain2;\n    interface ICorDebugAppDomain3;\n    interface ICorDebugAssembly2;\n    interface ICorDebugProcess2 ;\n    interface ICorDebugStepper2 ;\n    interface ICorDebugThread2 ;\n    interface ICorDebugThread3 ;\n    interface ICorDebugILFrame2;\n    interface ICorDebugModule2 ;\n    interface ICorDebugFunction2;\n    interface ICorDebugClass2 ;\n    interface ICorDebugEval2 ;\n    interface ICorDebugValue2;\n    interface ICorDebugObjectValue2;\n    interface ICorDebugHandleValue;\n    interface ICorDebugHeapValue2;\n    interface ICorDebugComObjectValue;\n\n    interface ICorDebugModule3;\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cordebuginfo.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// Keep in sync with llvm/tools/objwriter/cordebuginfo.h in current objwriter branch in https://github.com/dotnet/llvm-project repo\n//\n\n/**********************************************************************************/\n// DebugInfo types shared by JIT-EE interface and EE-Debugger interface\n\nclass ICorDebugInfo\n{\npublic:\n    /*----------------------------- Boundary-info ---------------------------*/\n\n    enum MappingTypes\n    {\n        NO_MAPPING  = -1,\n        PROLOG      = -2,\n        EPILOG      = -3,\n        MAX_MAPPING_VALUE = -3 // Sentinel value. This should be set to the largest magnitude value in the enum\n                               // so that the compression routines know the enum's range.\n    };\n\n    enum BoundaryTypes\n    {\n        NO_BOUNDARIES           = 0x00,     // No implicit boundaries\n        STACK_EMPTY_BOUNDARIES  = 0x01,     // Boundary whenever the IL evaluation stack is empty\n        NOP_BOUNDARIES          = 0x02,     // Before every CEE_NOP instruction\n        CALL_SITE_BOUNDARIES    = 0x04,     // Before every CEE_CALL, CEE_CALLVIRT, etc instruction\n\n        // Set of boundaries that debugger should always reasonably ask the JIT for.\n        DEFAULT_BOUNDARIES      = STACK_EMPTY_BOUNDARIES | NOP_BOUNDARIES | CALL_SITE_BOUNDARIES\n    };\n\n    // Note that SourceTypes can be OR'd together - it's possible that\n    // a sequence point will also be a stack_empty point, and/or a call site.\n    // The debugger will check to see if a boundary offset's source field &\n    // SEQUENCE_POINT is true to determine if the boundary is a sequence point.\n\n    enum SourceTypes\n    {\n        SOURCE_TYPE_INVALID        = 0x00, // To indicate that nothing else applies\n        SEQUENCE_POINT             = 0x01, // The debugger asked for it.\n        STACK_EMPTY                = 0x02, // The stack is empty here\n        CALL_SITE                  = 0x04, // This is a call site.\n        NATIVE_END_OFFSET_UNKNOWN  = 0x08, // Indicates a epilog endpoint\n        CALL_INSTRUCTION           = 0x10  // The actual instruction of a call.\n\n    };\n\n    struct OffsetMapping\n    {\n        uint32_t        nativeOffset;\n        uint32_t        ilOffset; // IL offset or one of the special values in MappingTypes\n        SourceTypes     source; // The debugger needs this so that\n                                // we don't put Edit and Continue breakpoints where\n                                // the stack isn't empty.  We can put regular breakpoints\n                                // there, though, so we need a way to discriminate\n                                // between offsets.\n    };\n\n    /*------------------------------ Var-info -------------------------------*/\n\n    // Note: The debugger needs to target register numbers on platforms other than which the debugger itself\n    // is running. To this end it maintains its own values for REGNUM_SP and REGNUM_AMBIENT_SP across multiple\n    // platforms. So any change here that may effect these values should be reflected in the definitions\n    // contained in debug/inc/DbgIPCEvents.h.\n    enum RegNum\n    {\n#ifdef TARGET_X86\n        REGNUM_EAX,\n        REGNUM_ECX,\n        REGNUM_EDX,\n        REGNUM_EBX,\n        REGNUM_ESP,\n        REGNUM_EBP,\n        REGNUM_ESI,\n        REGNUM_EDI,\n#elif TARGET_ARM\n        REGNUM_R0,\n        REGNUM_R1,\n        REGNUM_R2,\n        REGNUM_R3,\n        REGNUM_R4,\n        REGNUM_R5,\n        REGNUM_R6,\n        REGNUM_R7,\n        REGNUM_R8,\n        REGNUM_R9,\n        REGNUM_R10,\n        REGNUM_R11,\n        REGNUM_R12,\n        REGNUM_SP,\n        REGNUM_LR,\n        REGNUM_PC,\n#elif TARGET_ARM64\n        REGNUM_X0,\n        REGNUM_X1,\n        REGNUM_X2,\n        REGNUM_X3,\n        REGNUM_X4,\n        REGNUM_X5,\n        REGNUM_X6,\n        REGNUM_X7,\n        REGNUM_X8,\n        REGNUM_X9,\n        REGNUM_X10,\n        REGNUM_X11,\n        REGNUM_X12,\n        REGNUM_X13,\n        REGNUM_X14,\n        REGNUM_X15,\n        REGNUM_X16,\n        REGNUM_X17,\n        REGNUM_X18,\n        REGNUM_X19,\n        REGNUM_X20,\n        REGNUM_X21,\n        REGNUM_X22,\n        REGNUM_X23,\n        REGNUM_X24,\n        REGNUM_X25,\n        REGNUM_X26,\n        REGNUM_X27,\n        REGNUM_X28,\n        REGNUM_FP,\n        REGNUM_LR,\n        REGNUM_SP,\n        REGNUM_PC,\n#elif TARGET_AMD64\n        REGNUM_RAX,\n        REGNUM_RCX,\n        REGNUM_RDX,\n        REGNUM_RBX,\n        REGNUM_RSP,\n        REGNUM_RBP,\n        REGNUM_RSI,\n        REGNUM_RDI,\n        REGNUM_R8,\n        REGNUM_R9,\n        REGNUM_R10,\n        REGNUM_R11,\n        REGNUM_R12,\n        REGNUM_R13,\n        REGNUM_R14,\n        REGNUM_R15,\n#elif TARGET_LOONGARCH64\n        REGNUM_R0,\n        REGNUM_RA,\n        REGNUM_TP,\n        REGNUM_SP,\n        REGNUM_A0,\n        REGNUM_A1,\n        REGNUM_A2,\n        REGNUM_A3,\n        REGNUM_A4,\n        REGNUM_A5,\n        REGNUM_A6,\n        REGNUM_A7,\n        REGNUM_T0,\n        REGNUM_T1,\n        REGNUM_T2,\n        REGNUM_T3,\n        REGNUM_T4,\n        REGNUM_T5,\n        REGNUM_T6,\n        REGNUM_T7,\n        REGNUM_T8,\n        REGNUM_X0,\n        REGNUM_FP,\n        REGNUM_S0,\n        REGNUM_S1,\n        REGNUM_S2,\n        REGNUM_S3,\n        REGNUM_S4,\n        REGNUM_S5,\n        REGNUM_S6,\n        REGNUM_S7,\n        REGNUM_S8,\n        REGNUM_PC,\n#else\n        PORTABILITY_WARNING(\"Register numbers not defined on this platform\")\n#endif\n        REGNUM_COUNT,\n        REGNUM_AMBIENT_SP, // ambient SP support. Ambient SP is the original SP in the non-BP based frame.\n                           // Ambient SP should not change even if there are push/pop operations in the method.\n\n#ifdef TARGET_X86\n        REGNUM_FP = REGNUM_EBP,\n        REGNUM_SP = REGNUM_ESP,\n#elif TARGET_AMD64\n        REGNUM_SP = REGNUM_RSP,\n#elif TARGET_ARM\n#ifdef REDHAWK\n        REGNUM_FP = REGNUM_R7,\n#else\n        REGNUM_FP = REGNUM_R11,\n#endif //REDHAWK\n#elif TARGET_ARM64\n        //Nothing to do here. FP is already alloted.\n#elif TARGET_LOONGARCH64\n        //Nothing to do here. FP is already alloted.\n#else\n        // RegNum values should be properly defined for this platform\n        REGNUM_FP = 0,\n        REGNUM_SP = 1,\n#endif\n\n    };\n\n    // VarLoc describes the location of a native variable.  Note that currently, VLT_REG_BYREF and VLT_STK_BYREF\n    // are only used for value types on X64.\n\n    enum VarLocType\n    {\n        VLT_REG,        // variable is in a register\n        VLT_REG_BYREF,  // address of the variable is in a register\n        VLT_REG_FP,     // variable is in an fp register\n        VLT_STK,        // variable is on the stack (memory addressed relative to the frame-pointer)\n        VLT_STK_BYREF,  // address of the variable is on the stack (memory addressed relative to the frame-pointer)\n        VLT_REG_REG,    // variable lives in two registers\n        VLT_REG_STK,    // variable lives partly in a register and partly on the stack\n        VLT_STK_REG,    // reverse of VLT_REG_STK\n        VLT_STK2,       // variable lives in two slots on the stack\n        VLT_FPSTK,      // variable lives on the floating-point stack\n        VLT_FIXED_VA,   // variable is a fixed argument in a varargs function (relative to VARARGS_HANDLE)\n\n        VLT_COUNT,\n        VLT_INVALID,\n    };\n\n    // VLT_REG/VLT_REG_FP -- Any pointer-sized enregistered value (TYP_INT, TYP_REF, etc)\n    // eg. EAX\n    // VLT_REG_BYREF -- the specified register contains the address of the variable\n    // eg. [EAX]\n\n    struct vlReg\n    {\n        RegNum      vlrReg;\n    };\n\n    // VLT_STK -- Any 32 bit value which is on the stack\n    // eg. [ESP+0x20], or [EBP-0x28]\n    // VLT_STK_BYREF -- the specified stack location contains the address of the variable\n    // eg. mov EAX, [ESP+0x20]; [EAX]\n\n    struct vlStk\n    {\n        RegNum      vlsBaseReg;\n        signed      vlsOffset;\n    };\n\n    // VLT_REG_REG -- TYP_LONG with both uint32_ts enregistred\n    // eg. RBM_EAXEDX\n\n    struct vlRegReg\n    {\n        RegNum      vlrrReg1;\n        RegNum      vlrrReg2;\n    };\n\n    // VLT_REG_STK -- Partly enregistered TYP_LONG\n    // eg { LowerDWord=EAX UpperDWord=[ESP+0x8] }\n\n    struct vlRegStk\n    {\n        RegNum      vlrsReg;\n        struct\n        {\n            RegNum      vlrssBaseReg;\n            signed      vlrssOffset;\n        }           vlrsStk;\n    };\n\n    // VLT_STK_REG -- Partly enregistered TYP_LONG\n    // eg { LowerDWord=[ESP+0x8] UpperDWord=EAX }\n\n    struct vlStkReg\n    {\n        struct\n        {\n            RegNum      vlsrsBaseReg;\n            signed      vlsrsOffset;\n        }           vlsrStk;\n        RegNum      vlsrReg;\n    };\n\n    // VLT_STK2 -- Any 64 bit value which is on the stack,\n    // in 2 successive DWords.\n    // eg 2 DWords at [ESP+0x10]\n\n    struct vlStk2\n    {\n        RegNum      vls2BaseReg;\n        signed      vls2Offset;\n    };\n\n    // VLT_FPSTK -- enregisterd TYP_DOUBLE (on the FP stack)\n    // eg. ST(3). Actually it is ST(\"FPstkHeight - vpFpStk\")\n\n    struct vlFPstk\n    {\n        unsigned        vlfReg;\n    };\n\n    // VLT_FIXED_VA -- fixed argument of a varargs function.\n    // The argument location depends on the size of the variable\n    // arguments (...). Inspecting the VARARGS_HANDLE indicates the\n    // location of the first arg. This argument can then be accessed\n    // relative to the position of the first arg\n\n    struct vlFixedVarArg\n    {\n        unsigned        vlfvOffset;\n    };\n\n    // VLT_MEMORY\n\n    struct vlMemory\n    {\n        void        *rpValue; // pointer to the in-process\n        // location of the value.\n    };\n\n    struct VarLoc\n    {\n        VarLocType      vlType;\n\n        union\n        {\n            ICorDebugInfo::vlReg           vlReg;\n            ICorDebugInfo::vlStk           vlStk;\n            ICorDebugInfo::vlRegReg        vlRegReg;\n            ICorDebugInfo::vlRegStk        vlRegStk;\n            ICorDebugInfo::vlStkReg        vlStkReg;\n            ICorDebugInfo::vlStk2          vlStk2;\n            ICorDebugInfo::vlFPstk         vlFPstk;\n            ICorDebugInfo::vlFixedVarArg   vlFixedVarArg;\n            ICorDebugInfo::vlMemory        vlMemory;\n        };\n    };\n\n    // This is used to report implicit/hidden arguments\n\n    enum\n    {\n        VARARGS_HND_ILNUM   = -1, // Value for the CORINFO_VARARGS_HANDLE varNumber\n        RETBUF_ILNUM        = -2, // Pointer to the return-buffer\n        TYPECTXT_ILNUM      = -3, // ParamTypeArg for CORINFO_GENERICS_CTXT_FROM_PARAMTYPEARG\n\n        UNKNOWN_ILNUM       = -4, // Unknown variable\n\n        MAX_ILNUM           = -4  // Sentinel value. This should be set to the largest magnitude value in th enum\n                                  // so that the compression routines know the enum's range.\n    };\n\n    struct ILVarInfo\n    {\n        uint32_t        startOffset;\n        uint32_t        endOffset;\n        uint32_t        varNumber;\n    };\n\n    struct NativeVarInfo\n    {\n        uint32_t        startOffset;\n        uint32_t        endOffset;\n        uint32_t        varNumber;\n        VarLoc          loc;\n    };\n\n    // Represents an individual entry in the inline tree.\n    // This is ordinarily stored as a flat array in which [0] is the root, and\n    // the indices below indicate the tree structure.\n    struct InlineTreeNode\n    {\n        // Method handle of inlinee (or root)\n        CORINFO_METHOD_HANDLE Method;\n        // IL offset of IL instruction resulting in the inline\n        uint32_t ILOffset;\n        // Index of child in tree, 0 if no children\n        uint32_t Child;\n        // Index of sibling in tree, 0 if no sibling\n        uint32_t Sibling;\n    };\n\n    struct RichOffsetMapping\n    {\n        // Offset in emitted code\n        uint32_t NativeOffset;\n        // Index of inline tree node containing the IL offset (0 for root)\n        uint32_t Inlinee;\n        // IL offset of IL instruction in inlinee that this mapping was created from\n        uint32_t ILOffset;\n        // Source information about the IL instruction in the inlinee\n        SourceTypes Source;\n    };\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/coredistools.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//===--------- coredistools.h - Dissassembly tools for CoreClr ------------===//\n//\n//  Core Disassembly Tools API Version 1.0.1-prerelease\n//  Disassembly tools required by CoreCLR for utilities like\n//  GCStress and SuperPMI\n//===----------------------------------------------------------------------===//\n\n#if !defined(_COREDISTOOLS_H_)\n#define _COREDISTOOLS_H_\n\n#include <stdint.h>\n\n#if defined(__cplusplus)\n#define EXTERN_C extern \"C\"\n#else\n#define EXTERN_C\n#endif // defined(__cplusplus)\n\n#if defined(_MSC_VER)\n#if defined(DllInterfaceExporter)\n#define DllIface EXTERN_C __declspec(dllexport)\n#else\n#define DllIface EXTERN_C __declspec(dllimport)\n#endif // defined(DllInterfaceExporter)\n#else\n#if !defined(__cdecl)\n#if defined(__i386__)\n#define __cdecl __attribute__((cdecl))\n#else\n#define __cdecl\n#endif\n#endif\n#define DllIface EXTERN_C\n#endif // defined(_MSC_VER)\n\nenum TargetArch {\n    Target_Host, // Target is the same as host architecture\n    Target_X86,\n    Target_X64,\n    Target_Thumb,\n    Target_Arm64\n};\n\nstruct CorDisasm;\nstruct CorAsmDiff;\n\n// The custom print functionality to be provide by the\n// users of this Library\ntypedef void(__cdecl *Printer)(const char *msg, ...);\nstruct PrintControl {\n    const Printer Error;\n    const Printer Warning;\n    const Printer Log;\n    const Printer Dump;\n};\n\n// The type of a custom function provided by the user to determine\n// if two offsets are considered equivalent wrt diffing code blocks.\n// Offset1 and Offset2 are the two offsets to be compared.\n// BlockOffset is the offest of the instructions (that contain Offset1\n// and Offset2) from the beginning of their respective code blocks.\n// InstructionLength is the length of the current instruction being\n// compared for equivalency.\ntypedef bool(__cdecl *OffsetComparator)(const void *UserData, size_t BlockOffset,\n    size_t InstructionLength, uint64_t Offset1,\n    uint64_t Offset2);\n\n// The Export/Import definitions for CoreDistools library are defined below.\n// A typedef for each interface function's type is defined in order to aid\n// the importer.\n\n// Initialize the disassembler, using default print controls\ntypedef CorDisasm * __cdecl InitDisasm_t(enum TargetArch Target);\nDllIface InitDisasm_t InitDisasm;\n\n// Initialize the disassembler using custom print controls\ntypedef CorDisasm * __cdecl NewDisasm_t(enum TargetArch Target,\n    const PrintControl *PControl);\nDllIface NewDisasm_t NewDisasm;\n\n// Delete the disassembler\ntypedef void __cdecl FinishDisasm_t(const CorDisasm *Disasm);\nDllIface FinishDisasm_t FinishDisasm;\n\n// DisasmInstruction -- Disassemble one instruction\n// Arguments:\n// Disasm -- The Disassembler\n// Address -- The address at which the bytes of the instruction\n//            are intended to execute\n// Bytes -- Pointer to the actual bytes which need to be disassembled\n// MaxLength -- Number of bytes available in Bytes buffer\n// Returns:\n//   -- The Size of the disassembled instruction\n//   -- Zero on failure\ntypedef size_t __cdecl DisasmInstruction_t(const CorDisasm *Disasm,\n    const uint8_t *Address,\n    const uint8_t *Bytes, size_t Maxlength);\nDllIface DisasmInstruction_t DisasmInstruction;\n\n// Initialize the Code Differ\ntypedef CorAsmDiff * __cdecl NewDiffer_t(enum TargetArch Target,\n    const PrintControl *PControl,\n    const OffsetComparator Comparator);\nDllIface NewDiffer_t NewDiffer;\n\n// Delete the Code Differ\ntypedef void __cdecl FinishDiff_t(const CorAsmDiff *AsmDiff);\nDllIface FinishDiff_t FinishDiff;\n\n// NearDiffCodeBlocks -- Compare two code blocks for semantic\n//                       equivalence\n// Arguments:\n// AsmDiff -- The Asm-differ\n// UserData -- Any data the user wishes to pass through into\n//             the OffsetComparator\n// Address1 -- Address at which first block will execute\n// Bytes1 -- Pointer to the actual bytes of the first block\n// Size1 -- The size of the first block\n// Address2 -- Address at which second block will execute\n// Bytes2 -- Pointer to the actual bytes of the second block\n// Size2 -- The size of the second block\n// Returns:\n//   -- true if the two blocks are equivalent, false if not.\ntypedef bool __cdecl NearDiffCodeBlocks_t(const CorAsmDiff *AsmDiff,\n    const void *UserData,\n    const uint8_t *Address1,\n    const uint8_t *Bytes1, size_t Size1,\n    const uint8_t *Address2,\n    const uint8_t *Bytes2, size_t Size2);\nDllIface NearDiffCodeBlocks_t NearDiffCodeBlocks;\n\n// Print a code block according to the Disassembler's Print Controls\ntypedef void __cdecl DumpCodeBlock_t(const CorDisasm *Disasm, const uint8_t *Address,\n    const uint8_t *Bytes, size_t Size);\nDllIface DumpCodeBlock_t DumpCodeBlock;\n\n// Print the two code blocks being diffed, according to\n// AsmDiff's PrintControls.\ntypedef void __cdecl DumpDiffBlocks_t(const CorAsmDiff *AsmDiff,\n    const uint8_t *Address1, const uint8_t *Bytes1,\n    size_t Size1, const uint8_t *Address2,\n    const uint8_t *Bytes2, size_t Size2);\nDllIface DumpDiffBlocks_t DumpDiffBlocks;\n\n#endif // !defined(_COREDISTOOLS_H_)\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corerror.xml",
    "content": "<?xml version=\"1.0\"?>\n<Root><xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"\n\txmlns='xsdResources'\n\t\ttargetNamespace='xsdResources'>\n\t<xs:element name=\"ResourceStrings\">\n\t\t<xs:complexType>\n\t\t\t<xs:sequence>\n\t\t\t\t<xs:element maxOccurs=\"unbounded\" name=\"HRESULT\">\n\t\t\t\t\t<xs:complexType>\n\t\t\t\t\t\t<xs:sequence>\n\t\t\t\t\t\t\t<xs:element name=\"SymbolicName\" type=\"xs:string\" />\n\t\t\t\t\t\t\t<xs:element minOccurs=\"0\" name=\"Message\" type=\"xs:string\" />\n\t\t\t\t\t\t\t<xs:element minOccurs=\"0\" name=\"Comment\" type=\"xs:string\" />\n\t\t\t\t\t\t</xs:sequence>\n\t\t\t\t\t\t<xs:attribute name=\"NumericValue\" type=\"xs:string\" use=\"required\" />\n\t\t\t\t\t</xs:complexType>\n\t\t\t\t</xs:element>\n\t\t\t</xs:sequence>\n\t\t</xs:complexType>\n\t</xs:element>\n</xs:schema>\n\n<hc:ResourceStrings xmlns:hc=\"xsdResources\">\n\n<!--                                          -->\n<!-- This XML file is used to generate the public header file corerror.h -->\n<!-- and resource file msgurt.rc. All new HRESULT declarations should be added to this XML. -->\n<!--                                          -->\n<!--     IMPORTANT***IMPORTANT***IMPORTANT    -->\n<!--                                          -->\n<!--     All CLR error codes should be in     -->\n<!--     HRESULT NumericValue=\"0x......\" format -->\n<!--                                          -->\n<!-- These HRESULTs are used for mapping managed exceptions to COM error codes -->\n<!-- and vice versa through COM Interop.  For background on COM error codes see -->\n<!-- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/error_9td2.asp. -->\n\n<!-- The range (0x8013xxxx) and (0x13xxxx) is reserved for the .NET Framework SDK teams. -->\n<!-- Within that range, the following subranges have been allocated for different feature areas: -->\n<!-- 0x10yy for Execution Engine -->\n<!-- 0x11yy for Metadata, TypeLib Export, and CLDB -->\n<!-- 0x12yy for MetaData Validator -->\n<!-- 0x13yy for Debugger and Profiler errors -->\n<!-- 0x14yy for Security -->\n<!-- 0x15yy for BCL-->\n<!-- 0x1600 - 0x161F for Reflection -->\n<!-- 0x1620 - 0x163F for System.IO -->\n<!-- 0x1640 - 0x165F for Security -->\n<!-- 0x1660 - 0x16FF for BCL -->\n<!-- 0x17yy for shim -->\n<!-- 0x18yy for IL Verifier -->\n<!-- 0x19yy for .NET Framework -->\n<!-- 0x1Ayy for .NET Framework -->\n<!-- 0x1Byy for MetaData Validator -->\n<!-- 0x1Cyy for more debugger errors -->\n<!-- 0x1Dyy for PE Format Validation -->\n<!-- 0x1Eyy for CLR Optimization Service errors -->\n<!-- 0x1Fyy for NGEN errors -->\n<!-- 0x30yy for VSA errors -->\n<!-- 0x31yy for NGEN errors -->\n<!-- 0x32yy for binder errors -->\n<!-- Base class library HRESULTs are copied from this file into many different -->\n<!-- files named __HResults.cs under the BCL directory.  Frameworks HRESULTs are -->\n<!-- defined in src/main/HResults.cs. If you make any modifications to -->\n<!-- the range allocations described above, please make sure this xml file gets updated. -->\n<!--                                          -->\n\n\n<HRESULT NumericValue=\"0x131106\">\n\t<SymbolicName>CLDB_S_TRUNCATION</SymbolicName>\n\t<Comment> STATUS: Data value was truncated. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x131197\">\n\t<SymbolicName>META_S_DUPLICATE</SymbolicName>\n\t<Comment> Attempt to define an object that already exists in valid scenerios. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x13130b\">\n\t<SymbolicName>CORDBG_S_BAD_START_SEQUENCE_POINT</SymbolicName>\n\t<Comment> Attempt to SetIP not at a sequence point sequence point. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x13130c\">\n\t<SymbolicName>CORDBG_S_BAD_END_SEQUENCE_POINT</SymbolicName>\n\t<Comment> Attempt to SetIP when not going to a sequence point. If both this and CORDBG_E_BAD_START_SEQUENCE_POINT are true, only CORDBG_E_BAD_START_SEQUENCE_POINT will be reported.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x131316\">\n\t<SymbolicName>CORDBG_S_FUNC_EVAL_HAS_NO_RESULT</SymbolicName>\n\t<Comment> Some Func evals will lack a return value, </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x131317\">\n\t<SymbolicName>CORDBG_S_VALUE_POINTS_TO_VOID</SymbolicName>\n\t<Comment> The Debugging API doesn't support dereferencing void pointers. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x131319\">\n\t<SymbolicName>CORDBG_S_FUNC_EVAL_ABORTED</SymbolicName>\n\t<Comment> The func eval completed, but was aborted. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x131324\">\n    <SymbolicName>CORDBG_S_AT_END_OF_STACK</SymbolicName>\n    <Message>\"The stack walk has reached the end of the stack.  There are no more frames to walk.\"</Message>\n    <Comment> The stack walk has reached the end of the stack.  There are no more frames to walk. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x131c13\">\n\t<SymbolicName>CORDBG_S_NOT_ALL_BITS_SET</SymbolicName>\n\t<Comment> Not all bits specified were successfully applied </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131013\">\n\t<SymbolicName>COR_E_TYPEUNLOADED</SymbolicName>\n\t<Message>\"Type has been unloaded.\"</Message>\n\t<Comment> The type had been unloaded.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131014\">\n\t<SymbolicName>COR_E_APPDOMAINUNLOADED</SymbolicName>\n\t<Message>\"Attempted to access an unloaded appdomain.\"</Message>\n\t<Comment> access unloaded appdomain </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131015\">\n\t<SymbolicName>COR_E_CANNOTUNLOADAPPDOMAIN</SymbolicName>\n\t<Message>\"Error while unloading appdomain.\"</Message>\n\t<Comment> Error while unloading an appdomain </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131016\">\n\t<SymbolicName>MSEE_E_ASSEMBLYLOADINPROGRESS</SymbolicName>\n\t<Message>\"Assembly is still being loaded.\"</Message>\n\t<Comment> Assembly is being currently being loaded </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131018\">\n\t<SymbolicName>COR_E_ASSEMBLYEXPECTED</SymbolicName>\n\t<Message>\"The module was expected to contain an assembly manifest.\"</Message>\n\t<Comment> The module was expected to contain an assembly manifest.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013101b\">\n\t<SymbolicName>COR_E_NEWER_RUNTIME</SymbolicName>\n\t<Message>\"This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.\"</Message>\n\t<Comment> The assembly is built by a runtime newer than the currently loaded runtime, and cannot be loaded. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013101e\">\n\t<SymbolicName>COR_E_MULTIMODULEASSEMBLIESDIALLOWED</SymbolicName>\n\t<Message>\"The module cannot be loaded because only single file assemblies are supported.\"</Message>\n\t<Comment> The module cannot be loaded because only single file assemblies are supported. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131022\">\n\t<SymbolicName>HOST_E_INVALIDOPERATION</SymbolicName>\n\t<Message>\"Invalid operation.\"</Message>\n\t<Comment> The operation is invalid </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131023\">\n\t<SymbolicName>HOST_E_CLRNOTAVAILABLE</SymbolicName>\n\t<Message>\"CLR has been disabled due to unrecoverable error.\"</Message>\n\t<Comment> CLR has been disabled due to unrecoverable error </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131040\">\n\t<SymbolicName>FUSION_E_REF_DEF_MISMATCH</SymbolicName>\n\t<Message>\"The located assembly's manifest definition does not match the assembly reference.\"</Message>\n\t<Comment> The located assembly's manifest definition does not match the assembly reference. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131044\">\n\t<SymbolicName>FUSION_E_PRIVATE_ASM_DISALLOWED</SymbolicName>\n\t<Message>\"A strongly-named assembly is required.\"</Message>\n\t<Comment> A strongly-named assembly is required. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131047\">\n\t<SymbolicName>FUSION_E_INVALID_NAME</SymbolicName>\n\t<Message>\"The given assembly name was invalid.\"</Message>\n\t<Comment> The given assembly name was invalid. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131052\">\n\t<SymbolicName>FUSION_E_CACHEFILE_FAILED</SymbolicName>\n\t<Message>\"Failed to add file to AppDomain cache.\"</Message>\n\t<Comment> Failed to add file to AppDomain cache </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131053\">\n\t<SymbolicName>FUSION_E_APP_DOMAIN_LOCKED</SymbolicName>\n\t<Message>\"The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest.\"</Message>\n\t<Comment> The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131058\">\n\t<SymbolicName>COR_E_LOADING_REFERENCE_ASSEMBLY</SymbolicName>\n\t<Message>\"Reference assemblies cannot not be loaded for execution.\"</Message>\n\t<Comment> Reference assemblies cannot not be loaded for execution.  </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013106A\">\n  <SymbolicName>COR_E_AMBIGUOUSIMPLEMENTATION</SymbolicName>\n  <Message>\"Ambiguous implementation found.\"</Message>\n  <Comment> Ambiguous implementation found </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131100\">\n\t<SymbolicName>CLDB_E_FILE_BADREAD</SymbolicName>\n\t<Message>\"Error occurred during a read.\"</Message>\n\t<Comment> Error occurred during a read. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131101\">\n\t<SymbolicName>CLDB_E_FILE_BADWRITE</SymbolicName>\n\t<Message>\"Error occurred during a write.\"</Message>\n\t<Comment> Error occurred during a write. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131107\">\n\t<SymbolicName>CLDB_E_FILE_OLDVER</SymbolicName>\n\t<Message>\"Old version error.\"</Message>\n\t<Comment> Old version error. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013110a\">\n\t<SymbolicName>CLDB_E_SMDUPLICATE</SymbolicName>\n\t<Message>\"Create of shared memory failed.  A memory mapping of the same name already exists.\"</Message>\n\t<Comment> Create of shared memory failed.  A memory mapping of the same name already exists. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013110b\">\n\t<SymbolicName>CLDB_E_NO_DATA</SymbolicName>\n\t<Message>\"No .CLB data in the memory or stream.\"</Message>\n\t<Comment> There isn't .CLB data in the memory or stream. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013110d\">\n\t<SymbolicName>CLDB_E_INCOMPATIBLE</SymbolicName>\n\t<Message>\"Importing scope is not compatible with the emitting scope.\"</Message>\n\t<Comment> The importing scope is not comptabile with the emitting scope </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013110e\">\n\t<SymbolicName>CLDB_E_FILE_CORRUPT</SymbolicName>\n\t<Message>\"File is corrupt.\"</Message>\n\t<Comment> File is corrupt. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131110\">\n\t<SymbolicName>CLDB_E_BADUPDATEMODE</SymbolicName>\n\t<Message>\"Cannot open a incrementally build scope for full update.\"</Message>\n\t<Comment> cannot open a incrementally build scope for full update </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131124\">\n\t<SymbolicName>CLDB_E_INDEX_NOTFOUND</SymbolicName>\n\t<Message>\"Index not found.\"</Message>\n\t<Comment> Index %s not found. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131130\">\n\t<SymbolicName>CLDB_E_RECORD_NOTFOUND</SymbolicName>\n\t<Message>\"Record not found on lookup.\"</Message>\n\t<Comment> Record wasn't found on lookup. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131135\">\n\t<SymbolicName>CLDB_E_RECORD_OUTOFORDER</SymbolicName>\n\t<Message>\"Record is emitted out of order.\"</Message>\n\t<Comment> Record is emitted out of order. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131154\">\n\t<SymbolicName>CLDB_E_TOO_BIG</SymbolicName>\n\t<Message>\"A blob or string was too big.\"</Message>\n\t<Comment> A blob or string was too big. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013115f\">\n\t<SymbolicName>META_E_INVALID_TOKEN_TYPE</SymbolicName>\n\t<Message>\"A token of the wrong type passed to a metadata function.\"</Message>\n\t<Comment> A token of the wrong type passed to a metadata function. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131165\">\n\t<SymbolicName>TLBX_E_LIBNOTREGISTERED</SymbolicName>\n\t<Message>\"Typelib export: Type library is not registered.\"</Message>\n\t<Comment> Typelib export: type library is not registered. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013118a\">\n\t<SymbolicName>META_E_BADMETADATA</SymbolicName>\n\t<Message>\"Merge: Inconsistency in meta data import scope.\"</Message>\n\t<Comment> Merge: Inconsistency in meta data import scope </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131192\">\n\t<SymbolicName>META_E_BAD_SIGNATURE</SymbolicName>\n\t<Message>\"Bad binary signature.\"</Message>\n\t<Comment> Bad binary signature </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131193\">\n\t<SymbolicName>META_E_BAD_INPUT_PARAMETER</SymbolicName>\n\t<Message>\"Bad input parameters.\"</Message>\n\t<Comment> Bad input parameters </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131196\">\n\t<SymbolicName>META_E_CANNOTRESOLVETYPEREF</SymbolicName>\n\t<Message>\"Cannot resolve typeref.\"</Message>\n\t<Comment> Cannot resolve typeref </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131198\">\n\t<SymbolicName>META_E_STRINGSPACE_FULL</SymbolicName>\n\t<Message>\"No logical space left to create more user strings.\"</Message>\n\t<Comment> No logical space left to create more user strings. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013119a\">\n\t<SymbolicName>META_E_HAS_UNMARKALL</SymbolicName>\n\t<Message>\"Unmark all has been called already.\"</Message>\n\t<Comment> Unmark all has been called already </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013119b\">\n\t<SymbolicName>META_E_MUST_CALL_UNMARKALL</SymbolicName>\n\t<Message>\"Must call UnmarkAll first before marking.\"</Message>\n\t<Comment> Must call UnmarkAll first before marking. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c0\">\n\t<SymbolicName>META_E_CA_INVALID_TARGET</SymbolicName>\n\t<Message>\"Known custom attribute on invalid target.\"</Message>\n\t<Comment> Known custom attribute on invalid target. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c1\">\n\t<SymbolicName>META_E_CA_INVALID_VALUE</SymbolicName>\n\t<Message>\"Known custom attribute had invalid value.\"</Message>\n\t<Comment> Known custom attribute had invalid value. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c2\">\n\t<SymbolicName>META_E_CA_INVALID_BLOB</SymbolicName>\n\t<Message>\"Known custom attribute blob has bad format.\"</Message>\n\t<Comment> Known custom attribute blob is bad format. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c3\">\n\t<SymbolicName>META_E_CA_REPEATED_ARG</SymbolicName>\n\t<Message>\"Known custom attribute blob has repeated named argument.\"</Message>\n\t<Comment> Known custom attribute blob has repeated named argument. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c4\">\n\t<SymbolicName>META_E_CA_UNKNOWN_ARGUMENT</SymbolicName>\n\t<Message>\"Known custom attribute named argument not recognized.\"</Message>\n\t<Comment> Known custom attrubte named arg not recognized. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c7\">\n\t<SymbolicName>META_E_CA_UNEXPECTED_TYPE</SymbolicName>\n\t<Message>\"Known attribute parser found unexpected type.\"</Message>\n\t<Comment> Known attribute parser found unexpected type. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c8\">\n\t<SymbolicName>META_E_CA_INVALID_ARGTYPE</SymbolicName>\n\t<Message>\"Known attribute parser only handles fields, not properties.\"</Message>\n\t<Comment> Known attribute parser only handles fields -- no properties. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311c9\">\n\t<SymbolicName>META_E_CA_INVALID_ARG_FOR_TYPE</SymbolicName>\n\t<Message>\"Known attribute parser found an argument that is invalid for the object it is applied to.\"</Message>\n\t<Comment> Known attribute parser found an argument that is invalid for the object it is applied to. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311ca\">\n\t<SymbolicName>META_E_CA_INVALID_UUID</SymbolicName>\n\t<Message>\"The format of the UUID was invalid.\"</Message>\n\t<Comment> The format of the UUID was invalid. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311cb\">\n\t<SymbolicName>META_E_CA_INVALID_MARSHALAS_FIELDS</SymbolicName>\n\t<Message>\"The MarshalAs attribute has fields set that are not valid for the specified unmanaged type.\"</Message>\n\t<Comment> The MarshalAs attribute has fields set that are not valid for the specified unmanaged type. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311cc\">\n\t<SymbolicName>META_E_CA_NT_FIELDONLY</SymbolicName>\n\t<Message>\"The specified unmanaged type is only valid on fields.\"</Message>\n\t<Comment> The specified unmanaged type is only valid on fields. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311cd\">\n\t<SymbolicName>META_E_CA_NEGATIVE_PARAMINDEX</SymbolicName>\n\t<Message>\"The parameter index cannot be negative.\"</Message>\n\t<Comment> The parameter index cannot be negative. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311cf\">\n\t<SymbolicName>META_E_CA_NEGATIVE_CONSTSIZE</SymbolicName>\n\t<Message>\"The constant size cannot be negative.\"</Message>\n\t<Comment> The constant size cannot be negative. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311d0\">\n\t<SymbolicName>META_E_CA_FIXEDSTR_SIZE_REQUIRED</SymbolicName>\n\t<Message>\"A fixed string requires a size.\"</Message>\n\t<Comment> A fixed string requires a size. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311d1\">\n\t<SymbolicName>META_E_CA_CUSTMARSH_TYPE_REQUIRED</SymbolicName>\n\t<Message>\"A custom marshaler requires the custom marshaler type.\"</Message>\n\t<Comment> A custom marshaler requires the custom marshaler type. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311d4\">\n\t<SymbolicName>META_E_NOT_IN_ENC_MODE</SymbolicName>\n\t<Message>\"SaveDelta was called without being in EnC mode.\"</Message>\n\t<Comment> SaveDelta was called without being in EnC mode </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311e5\">\n\t<SymbolicName>META_E_CA_BAD_FRIENDS_ARGS</SymbolicName>\n\t<Message>\"InternalsVisibleTo can't have a version, culture, or processor architecture.\"</Message>\n\t<Comment> InternalsVisibleTo can't have a version, culture, or processor architecture. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801311e6\">\n\t<SymbolicName>META_E_CA_FRIENDS_SN_REQUIRED</SymbolicName>\n\t<Comment> Strong-name signed assemblies can only grant friend access to strong name-signed assemblies </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131203\">\n\t<SymbolicName>VLDTR_E_RID_OUTOFRANGE</SymbolicName>\n\t<Message>\"Rid is out of range.\"</Message>\n\t<Comment> Rid is out of range. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131206\">\n\t<SymbolicName>VLDTR_E_STRING_INVALID</SymbolicName>\n\t<Message>\"String offset is invalid.\"</Message>\n\t<Comment> String offset is invalid. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131207\">\n\t<SymbolicName>VLDTR_E_GUID_INVALID</SymbolicName>\n\t<Message>\"GUID offset is invalid.\"</Message>\n\t<Comment> GUID offset is invalid. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131208\">\n\t<SymbolicName>VLDTR_E_BLOB_INVALID</SymbolicName>\n\t<Message>\"Blob offset if invalid.\"</Message>\n\t<Comment> Blob offset if invalid. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131224\">\n\t<SymbolicName>VLDTR_E_MR_BADCALLINGCONV</SymbolicName>\n\t<Message>\"MemberRef has invalid calling convention.\"</Message>\n\t<Comment> MemberRef has invalid calling convention. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131237\">\n\t<SymbolicName>VLDTR_E_SIGNULL</SymbolicName>\n\t<Message>\"Signature specified is zero-sized.\"</Message>\n\t<Comment> Signature specified is zero-sized. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131239\">\n\t<SymbolicName>VLDTR_E_MD_BADCALLINGCONV</SymbolicName>\n\t<Message>\"Method signature has invalid calling convention.\"</Message>\n\t<Comment> Method signature has invalid calling convention. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013123a\">\n\t<SymbolicName>VLDTR_E_MD_THISSTATIC</SymbolicName>\n\t<Message>\"Method is marked static but has HASTHIS/EXPLICITTHIS set on the calling convention.\"</Message>\n\t<Comment> Method is marked static but has HASTHIS/EXPLICITTHIS set on the calling convention. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013123b\">\n\t<SymbolicName>VLDTR_E_MD_NOTTHISNOTSTATIC</SymbolicName>\n\t<Message>\"Method is not marked static but is not HASTHIS or EXPLICITTHIS.\"</Message>\n\t<Comment> Method is not marked static but is not HASTHIS/EXPLICITTHIS. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013123c\">\n\t<SymbolicName>VLDTR_E_MD_NOARGCNT</SymbolicName>\n\t<Message>\"Method signature is missing the argument count.\"</Message>\n\t<Comment> Method signature is missing the argument count. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013123d\">\n\t<SymbolicName>VLDTR_E_SIG_MISSELTYPE</SymbolicName>\n\t<Message>\"Signature missing element type.\"</Message>\n\t<Comment> Signature missing element type. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013123e\">\n\t<SymbolicName>VLDTR_E_SIG_MISSTKN</SymbolicName>\n\t<Message>\"Signature missing token.\"</Message>\n\t<Comment> Signature missing token. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013123f\">\n\t<SymbolicName>VLDTR_E_SIG_TKNBAD</SymbolicName>\n\t<Message>\"Signature has bad token.\"</Message>\n\t<Comment> Signature has bad token. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131240\">\n\t<SymbolicName>VLDTR_E_SIG_MISSFPTR</SymbolicName>\n\t<Message>\"Signature is missing function pointer.\"</Message>\n\t<Comment> Signature is missing function pointer. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131241\">\n\t<SymbolicName>VLDTR_E_SIG_MISSFPTRARGCNT</SymbolicName>\n\t<Message>\"Signature has function pointer missing argument count.\"</Message>\n\t<Comment> Signature has function pointer missing argument count. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131242\">\n\t<SymbolicName>VLDTR_E_SIG_MISSRANK</SymbolicName>\n\t<Message>\"Signature is missing rank specification.\"</Message>\n\t<Comment> Signature is missing rank specification. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131243\">\n\t<SymbolicName>VLDTR_E_SIG_MISSNSIZE</SymbolicName>\n\t<Message>\"Signature is missing count of sized dimensions.\"</Message>\n\t<Comment> Signature is missing count of sized dimensions. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131244\">\n\t<SymbolicName>VLDTR_E_SIG_MISSSIZE</SymbolicName>\n\t<Message>\"Signature is missing size of dimension.\"</Message>\n\t<Comment> Signature is missing size of dimension. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131245\">\n\t<SymbolicName>VLDTR_E_SIG_MISSNLBND</SymbolicName>\n\t<Message>\"Signature is missing count of lower bounds.\"</Message>\n\t<Comment> Signature is missing count of lower bounds. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131246\">\n\t<SymbolicName>VLDTR_E_SIG_MISSLBND</SymbolicName>\n\t<Message>\"Signature is missing a lower bound.\"</Message>\n\t<Comment> Signature is missing a lower bound. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131247\">\n\t<SymbolicName>VLDTR_E_SIG_BADELTYPE</SymbolicName>\n\t<Message>\"Signature has bad element type.\"</Message>\n\t<Comment> Signature has bad element type. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131256\">\n\t<SymbolicName>VLDTR_E_TD_ENCLNOTNESTED</SymbolicName>\n\t<Message>\"TypeDef not nested has encloser.\"</Message>\n\t<Comment> TypeDef not nested has encloser. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131277\">\n\t<SymbolicName>VLDTR_E_FMD_PINVOKENOTSTATIC</SymbolicName>\n\t<Message>\"Field or method is PInvoke but is not marked Static.\"</Message>\n\t<Comment> Field/method is PInvoke but is not marked Static. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801312df\">\n\t<SymbolicName>VLDTR_E_SIG_SENTINMETHODDEF</SymbolicName>\n\t<Message>\"E_T_SENTINEL in MethodDef signature.\"</Message>\n\t<Comment> E_T_SENTINEL in MethodDef signature </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801312e0\">\n\t<SymbolicName>VLDTR_E_SIG_SENTMUSTVARARG</SymbolicName>\n\t<Message>\"E_T_SENTINEL &lt;=&gt; VARARG.\"</Message>\n\t<Comment> E_T_SENTINEL &lt;=&gt; VARARG </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801312e1\">\n\t<SymbolicName>VLDTR_E_SIG_MULTSENTINELS</SymbolicName>\n\t<Message>\"Multiple E_T_SENTINELs.\"</Message>\n\t<Comment> Multiple E_T_SENTINELs </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801312e3\">\n\t<SymbolicName>VLDTR_E_SIG_MISSARG</SymbolicName>\n\t<Message>\"Signature missing argument.\"</Message>\n\t<Comment> Signature missing argument </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801312e4\">\n\t<SymbolicName>VLDTR_E_SIG_BYREFINFIELD</SymbolicName>\n\t<Message>\"Field of ByRef type.\"</Message>\n\t<Comment> Field of ByRef type </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131300\">\n\t<SymbolicName>CORDBG_E_UNRECOVERABLE_ERROR</SymbolicName>\n\t<Message>\"Unrecoverable API error.\"</Message>\n\t<Comment> Unrecoverable API error. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131301\">\n\t<SymbolicName>CORDBG_E_PROCESS_TERMINATED</SymbolicName>\n\t<Message>\"Process was terminated.\"</Message>\n\t<Comment> Process was terminated. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131302\">\n\t<SymbolicName>CORDBG_E_PROCESS_NOT_SYNCHRONIZED</SymbolicName>\n\t<Message>\"Process not synchronized.\"</Message>\n\t<Comment> Process not synchronized. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131303\">\n\t<SymbolicName>CORDBG_E_CLASS_NOT_LOADED</SymbolicName>\n\t<Message>\"A class is not loaded.\"</Message>\n\t<Comment> A class is not loaded. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131304\">\n\t<SymbolicName>CORDBG_E_IL_VAR_NOT_AVAILABLE</SymbolicName>\n\t<Message>\"An IL variable is not available at the current native IP.\"</Message>\n\t<Comment> An IL variable is not available at the </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131305\">\n\t<SymbolicName>CORDBG_E_BAD_REFERENCE_VALUE</SymbolicName>\n\t<Message>\"A reference value was found to be bad during dereferencing.\"</Message>\n\t<Comment> A reference value was found to be bad </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131306\">\n\t<SymbolicName>CORDBG_E_FIELD_NOT_AVAILABLE</SymbolicName>\n\t<Message>\"A field in a class is not available, because the runtime optimized it away.\"</Message>\n\t<Comment> A field in a class is not available, </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131307\">\n\t<SymbolicName>CORDBG_E_NON_NATIVE_FRAME</SymbolicName>\n\t<Message>\"'Native-frame-only' operation on non-native frame.\"</Message>\n\t<Comment> \"Native frame only\" operation on </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131309\">\n\t<SymbolicName>CORDBG_E_CODE_NOT_AVAILABLE</SymbolicName>\n\t<Message>\"The code is currently unavailable.\"</Message>\n\t<Comment> The code is currently unavailable </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013130a\">\n\t<SymbolicName>CORDBG_E_FUNCTION_NOT_IL</SymbolicName>\n\t<Message>\"Attempt to get a ICorDebugFunction for a function that is not IL.\"</Message>\n\t<Comment> Attempt to get a ICorDebugFunction for </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013130e\">\n\t<SymbolicName>CORDBG_E_CANT_SET_IP_INTO_FINALLY</SymbolicName>\n\t<Message>\"SetIP is not possible because SetIP would move EIP from outside of an exception handling finally clause to a point inside of one.\"</Message>\n\t<Comment> SetIP isn't possible, because SetIP would </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013130f\">\n\t<SymbolicName>CORDBG_E_CANT_SET_IP_OUT_OF_FINALLY</SymbolicName>\n\t<Message>\"SetIP is not possible because it would move EIP from within an exception handling finally clause to a point outside of one.\"</Message>\n\t<Comment> SetIP isn't possible because it would move </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131310\">\n\t<SymbolicName>CORDBG_E_CANT_SET_IP_INTO_CATCH</SymbolicName>\n\t<Message>\"SetIP is not possible, because SetIP would move EIP from outside of an exception handling catch clause to a point inside of one.\"</Message>\n\t<Comment> SetIP isn't possible, because SetIP would </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131311\">\n\t<SymbolicName>CORDBG_E_SET_IP_NOT_ALLOWED_ON_NONLEAF_FRAME</SymbolicName>\n\t<Message>\"SetIP cannot be done on any frame except the leaf frame.\"</Message>\n\t<Comment> Setip cannot be done on any frame except </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131312\">\n\t<SymbolicName>CORDBG_E_SET_IP_IMPOSSIBLE</SymbolicName>\n\t<Message>\"SetIP is not allowed.\"</Message>\n\t<Comment> SetIP isn't allowed. For example, there is </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131313\">\n\t<SymbolicName>CORDBG_E_FUNC_EVAL_BAD_START_POINT</SymbolicName>\n\t<Message>\"Func eval cannot work. Bad starting point.\"</Message>\n\t<Comment> Func eval can't work if we're, for example, </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131314\">\n\t<SymbolicName>CORDBG_E_INVALID_OBJECT</SymbolicName>\n\t<Message>\"This object value is no longer valid.\"</Message>\n\t<Comment> This object value is no longer valid. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131315\">\n\t<SymbolicName>CORDBG_E_FUNC_EVAL_NOT_COMPLETE</SymbolicName>\n\t<Message>\"CordbEval::GetResult called before func eval has finished.\"</Message>\n\t<Comment> If you call CordbEval::GetResult before the </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013131a\">\n\t<SymbolicName>CORDBG_E_STATIC_VAR_NOT_AVAILABLE</SymbolicName>\n\t<Message>\"A static variable is not available because it has not been initialized yet.\"</Message>\n\t<Comment> A static variable isn't available because </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013131c\">\n\t<SymbolicName>CORDBG_E_CANT_SETIP_INTO_OR_OUT_OF_FILTER</SymbolicName>\n\t<Message>\"SetIP cannot leave or enter a filter.\"</Message>\n\t<Comment> SetIP can't leave or enter a filter </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013131d\">\n\t<SymbolicName>CORDBG_E_CANT_CHANGE_JIT_SETTING_FOR_ZAP_MODULE</SymbolicName>\n\t<Message>\"JIT settings for ZAP modules cannot be changed.\"</Message>\n\t<Comment> You can't change JIT settings for ZAP </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013131e\">\n\t<SymbolicName>CORDBG_E_CANT_SET_IP_OUT_OF_FINALLY_ON_WIN64</SymbolicName>\n\t<Message>\"SetIP is not possible because it would move EIP from within a finally clause to a point outside of one on this platforms.\"</Message>\n\t<Comment> SetIP isn't possible because it would move </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013131f\">\n\t<SymbolicName>CORDBG_E_CANT_SET_IP_OUT_OF_CATCH_ON_WIN64</SymbolicName>\n\t<Message>\"SetIP is not possible because it would move EIP from within a catch clause to a point outside of one on this platforms.\"</Message>\n\t<Comment> SetIP isn't possible because it would move </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131323\">\n\t<SymbolicName>CORDBG_E_CANT_SET_TO_JMC</SymbolicName>\n\t<Message>\"Cannot use JMC on this code (likely wrong JIT settings).\"</Message>\n\t<Comment> Can't use JMC on this code (likely wrong jit settings). </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131325\">\n    <SymbolicName>CORDBG_E_NO_CONTEXT_FOR_INTERNAL_FRAME</SymbolicName>\n    <Message>\"Internal frame markers have no associated context.\"</Message>\n    <Comment> Internal frame markers have no associated context. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131326\">\n    <SymbolicName>CORDBG_E_NOT_CHILD_FRAME</SymbolicName>\n    <Message>\"The current frame is not a child frame.\"</Message>\n    <Comment> The current frame is not a child frame. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131327\">\n    <SymbolicName>CORDBG_E_NON_MATCHING_CONTEXT</SymbolicName>\n    <Message>\"The provided CONTEXT does not match the specified thread.\"</Message>\n    <Comment> The provided CONTEXT does not match the specified thread.\n    The stack pointer in the provided CONTEXT must match the cached stack base and stack limit of the thread.\n    </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131328\">\n    <SymbolicName>CORDBG_E_PAST_END_OF_STACK</SymbolicName>\n    <Message>\"The stackwalker is now past the end of stack.  No information is available.\"</Message>\n    <Comment> The stackwalker is now past the end of stack.  No information is available. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131329\">\n    <SymbolicName>CORDBG_E_FUNC_EVAL_CANNOT_UPDATE_REGISTER_IN_NONLEAF_FRAME</SymbolicName>\n    <Message>\"Func eval cannot update a variable stored in a register on a non-leaf frame.  The most likely cause is that such a variable is passed as a ref/out argument.\"</Message>\n    <Comment> Func eval cannot update a variable stored in a register on a non-leaf frame.  The most likely cause is that such a variable is passed as a ref/out argument. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013132d\">\n\t<SymbolicName>CORDBG_E_BAD_THREAD_STATE</SymbolicName>\n\t<Message>\"The state of the thread is invalid.\"</Message>\n\t<Comment> The state of the thread is invalid. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013132e\">\n\t<SymbolicName>CORDBG_E_DEBUGGER_ALREADY_ATTACHED</SymbolicName>\n\t<Message>\"This process has already been attached.\"</Message>\n\t<Comment> This process has already been attached to </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013132f\">\n\t<SymbolicName>CORDBG_E_SUPERFLOUS_CONTINUE</SymbolicName>\n\t<Message>\"Returned from a call to Continue that was not matched with a stopping event.\"</Message>\n\t<Comment> Returned from a call to Continue that was </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131330\">\n\t<SymbolicName>CORDBG_E_SET_VALUE_NOT_ALLOWED_ON_NONLEAF_FRAME</SymbolicName>\n\t<Message>\"Cannot perfrom SetValue on non-leaf frames.\"</Message>\n\t<Comment> Can't perfrom SetValue on non-leaf frames. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131332\">\n\t<SymbolicName>CORDBG_E_ENC_MODULE_NOT_ENC_ENABLED</SymbolicName>\n\t<Message>\"Tried to do Edit and Continue on a module that was not started in Edit and Continue mode.\"</Message>\n\t<Comment> Tried to do EnC on a module that wasn't </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131333\">\n\t<SymbolicName>CORDBG_E_SET_IP_NOT_ALLOWED_ON_EXCEPTION</SymbolicName>\n\t<Message>\"SetIP cannot be done on any exception.\"</Message>\n\t<Comment> Setip cannot be done on any exception </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131334\">\n\t<SymbolicName>CORDBG_E_VARIABLE_IS_ACTUALLY_LITERAL</SymbolicName>\n\t<Message>\"The 'variable' does not exist because it is a literal optimized away by the compiler.\"</Message>\n\t<Comment> The 'variable' doesn't exist because it is a </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131335\">\n\t<SymbolicName>CORDBG_E_PROCESS_DETACHED</SymbolicName>\n\t<Message>\"Process has been detached.\"</Message>\n\t<Comment> Process has been detached from </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131338\">\n\t<SymbolicName>CORDBG_E_ENC_CANT_ADD_FIELD_TO_VALUE_OR_LAYOUT_CLASS</SymbolicName>\n\t<Message>\"Adding a field to a value or layout class is prohibited.\"</Message>\n\t<Comment> Adding a field to a value or layout class is prohibitted, </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013133b\">\n\t<SymbolicName>CORDBG_E_FIELD_NOT_STATIC</SymbolicName>\n\t<Message>\"GetStaticFieldValue called on a non-static field.\"</Message>\n\t<Comment> Returned if someone tries to call GetStaticFieldValue </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013133c\">\n\t<SymbolicName>CORDBG_E_FIELD_NOT_INSTANCE</SymbolicName>\n\t<Message>\"Returned if someone tries to call GetStaticFieldValue on a non-instance field.\"</Message>\n\t<Comment> Returned if someone tries to call GetStaticFieldValue </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013133f\">\n\t<SymbolicName>CORDBG_E_ENC_JIT_CANT_UPDATE</SymbolicName>\n\t<Message>\"The JIT is unable to update the method.\"</Message>\n\t<Comment> The JIT is unable to update the method. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131341\">\n\t<SymbolicName>CORDBG_E_ENC_INTERNAL_ERROR</SymbolicName>\n\t<Message>\"Internal Runtime Error while doing Edit-and-Continue.\"</Message>\n\t<Comment> Generic message for \"Something user doesn't control went wrong\" message. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131342\">\n\t<SymbolicName>CORDBG_E_ENC_HANGING_FIELD</SymbolicName>\n\t<Message>\"The field was added via Edit and Continue after the class was loaded.\"</Message>\n\t<Comment> The field was added via EnC after the class was loaded, and so instead of the field being contiguous with the other fields, it's 'hanging' off the instance or type.  This error is used to indicate that either the storage for this field is not yet available and so the field value cannot be read, or the debugger needs to use an EnC specific code path to get the value.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131343\">\n\t<SymbolicName>CORDBG_E_MODULE_NOT_LOADED</SymbolicName>\n\t<Message>\"Module not loaded.\"</Message>\n\t<Comment> If the module isn't loaded, including if it's been unloaded. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131345\">\n\t<SymbolicName>CORDBG_E_UNABLE_TO_SET_BREAKPOINT</SymbolicName>\n\t<Message>\"Cannot set a breakpoint here.\"</Message>\n\t<Comment> Can't set a breakpoint here. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131346\">\n\t<SymbolicName>CORDBG_E_DEBUGGING_NOT_POSSIBLE</SymbolicName>\n\t<Message>\"Debugging is not possible due to an incompatibility within the CLR implementation.\"</Message>\n\t<Comment> Debugging isn't possible due to an incompatibility within the CLR implementation. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131347\">\n\t<SymbolicName>CORDBG_E_KERNEL_DEBUGGER_ENABLED</SymbolicName>\n\t<Message>\"A kernel debugger is enabled on the system.  User-mode debugging will trap to the kernel debugger.\"</Message>\n\t<Comment> Debugging isn't possible because a kernel debugger is enabled on the system. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131348\">\n\t<SymbolicName>CORDBG_E_KERNEL_DEBUGGER_PRESENT</SymbolicName>\n\t<Message>\"A kernel debugger is present on the system.  User-mode debugging will trap to the kernel debugger.\"</Message>\n\t<Comment> Debugging isn't possible because a kernel debugger is present on the system. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013134b\">\n\t<SymbolicName>CORDBG_E_INCOMPATIBLE_PROTOCOL</SymbolicName>\n\t<Message>\"The debugger's protocol is incompatible with the debuggee.\"</Message>\n\t<Comment> The debugger's protocol is incompatible with the debuggee. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013134c\">\n\t<SymbolicName>CORDBG_E_TOO_MANY_PROCESSES</SymbolicName>\n\t<Message>\"The debugger can only handle a finite number of debuggees.\"</Message>\n\t<Comment> The debugger can only handle a finite number of debuggees. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013134d\">\n\t<SymbolicName>CORDBG_E_INTEROP_NOT_SUPPORTED</SymbolicName>\n\t<Message>\"Interop debugging is not supported.\"</Message>\n\t<Comment> Interop debugging is not supported </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013134e\">\n\t<SymbolicName>CORDBG_E_NO_REMAP_BREAKPIONT</SymbolicName>\n\t<Message>\"Cannot call RemapFunction until have received RemapBreakpoint.\"</Message>\n\t<Comment> Cannot call RemapFunction until have received RemapBreakpoint </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013134f\">\n\t<SymbolicName>CORDBG_E_OBJECT_NEUTERED</SymbolicName>\n\t<Message>\"Object is in a zombie state.\"</Message>\n\t<Comment> Object has been neutered (it's in a zombie state). </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131350\">\n\t<SymbolicName>CORPROF_E_FUNCTION_NOT_COMPILED</SymbolicName>\n\t<Message>\"Function not yet compiled.\"</Message>\n\t<Comment> Function not yet compiled. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131351\">\n\t<SymbolicName>CORPROF_E_DATAINCOMPLETE</SymbolicName>\n\t<Message>\"The ID is not fully loaded/defined yet.\"</Message>\n\t<Comment> The ID is not fully loaded/defined yet. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131354\">\n\t<SymbolicName>CORPROF_E_FUNCTION_NOT_IL</SymbolicName>\n\t<Message>\"The Method has no associated IL.\"</Message>\n\t<Comment> The Method has no associated IL </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131355\">\n\t<SymbolicName>CORPROF_E_NOT_MANAGED_THREAD</SymbolicName>\n\t<Message>\"The thread has never run managed code before.\"</Message>\n\t<Comment> The thread has never run managed code before </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131356\">\n\t<SymbolicName>CORPROF_E_CALL_ONLY_FROM_INIT</SymbolicName>\n\t<Message>\"The function may only be called during profiler initialization.\"</Message>\n\t<Comment> The function may only be called during profiler init </Comment>\n</HRESULT>\n\n\n<HRESULT NumericValue=\"0x8013135b\">\n\t<SymbolicName>CORPROF_E_NOT_YET_AVAILABLE</SymbolicName>\n\t<Message>\"Requested information is not yet available.\"</Message>\n\t<Comment> This is a general error used to indicated that the information </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013135c\">\n\t<SymbolicName>CORPROF_E_TYPE_IS_PARAMETERIZED</SymbolicName>\n\t<Message>\"The given type is a generic and cannot be used with this method.\"</Message>\n\t<Comment> The given type is a generic and cannot be used with this method. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013135d\">\n\t<SymbolicName>CORPROF_E_FUNCTION_IS_PARAMETERIZED</SymbolicName>\n\t<Message>\"The given function is a generic and cannot be used with this method.\"</Message>\n\t<Comment> The given function is a generic and cannot be used with this method. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013135e\">\n\t<SymbolicName>CORPROF_E_STACKSNAPSHOT_INVALID_TGT_THREAD</SymbolicName>\n\t<Comment> A profiler tried to walk the stack of an invalid thread </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013135f\">\n\t<SymbolicName>CORPROF_E_STACKSNAPSHOT_UNMANAGED_CTX</SymbolicName>\n\t<Comment> A profiler can not walk a thread that is currently executing unmanaged code </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131360\">\n\t<SymbolicName>CORPROF_E_STACKSNAPSHOT_UNSAFE</SymbolicName>\n\t<Comment> A stackwalk at this point may cause dead locks or data corruption </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131361\">\n\t<SymbolicName>CORPROF_E_STACKSNAPSHOT_ABORTED</SymbolicName>\n\t<Comment> Stackwalking callback requested the walk to abort </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131362\">\n\t<SymbolicName>CORPROF_E_LITERALS_HAVE_NO_ADDRESS</SymbolicName>\n\t<Comment> Returned when asked for the address of a static that is a literal. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131363\">\n\t<SymbolicName>CORPROF_E_UNSUPPORTED_CALL_SEQUENCE</SymbolicName>\n    <Comment> A call was made at an unsupported time.  Examples include illegally calling a profiling API method asynchronously, calling a method that might trigger a GC at an unsafe time, and calling a method at a time that could cause locks to be taken out of order.  </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131364\">\n\t<SymbolicName>CORPROF_E_ASYNCHRONOUS_UNSAFE</SymbolicName>\n\t<Comment> A legal asynchronous call was made at an unsafe time (e.g., CLR locks are held)  </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131365\">\n\t<SymbolicName>CORPROF_E_CLASSID_IS_ARRAY</SymbolicName>\n\t<Comment> The specified ClassID cannot be inspected by this function because it is an array </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131366\">\n\t<SymbolicName>CORPROF_E_CLASSID_IS_COMPOSITE</SymbolicName>\n\t<Comment> The specified ClassID is a non-array composite type (e.g., ref) and cannot be inspected </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131367\">\n  <SymbolicName>CORPROF_E_PROFILER_DETACHING</SymbolicName>\n  <Comment> The profiler's call into the CLR is disallowed because the profiler is attempting to detach. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131368\">\n  <SymbolicName>CORPROF_E_PROFILER_NOT_ATTACHABLE</SymbolicName>\n  <Comment> The profiler does not support attaching to a live process. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131369\">\n  <SymbolicName>CORPROF_E_UNRECOGNIZED_PIPE_MSG_FORMAT</SymbolicName>\n  <Comment> The message sent on the profiling API attach pipe is in an unrecognized format. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013136A\">\n  <SymbolicName>CORPROF_E_PROFILER_ALREADY_ACTIVE</SymbolicName>\n  <Comment> The request to attach a profiler was denied because a profiler is already loaded. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013136B\">\n  <SymbolicName>CORPROF_E_PROFILEE_INCOMPATIBLE_WITH_TRIGGER</SymbolicName>\n  <Comment> Unable to request a profiler attach because the target profilee's runtime is of a version incompatible with the current process calling AttachProfiler(). </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013136C\">\n  <SymbolicName>CORPROF_E_IPC_FAILED</SymbolicName>\n  <Comment> AttachProfiler() encountered an error while communicating on the pipe to the target profilee.  This is often caused by a target profilee that is shutting down or killed while AttachProfiler() is reading or writing the pipe. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013136D\">\n  <SymbolicName>CORPROF_E_PROFILEE_PROCESS_NOT_FOUND</SymbolicName>\n  <Comment> AttachProfiler() was unable to find a profilee with the specified process ID. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013136E\">\n  <SymbolicName>CORPROF_E_CALLBACK3_REQUIRED</SymbolicName>\n  <Comment> Profiler must implement ICorProfilerCallback3 interface for this call to be supported. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013136F\">\n  <SymbolicName>CORPROF_E_UNSUPPORTED_FOR_ATTACHING_PROFILER</SymbolicName>\n  <Comment> This call was attempted by a profiler that attached to the process after startup, but this call is only supported by profilers that are loaded into the process on startup.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131370\">\n  <SymbolicName>CORPROF_E_IRREVERSIBLE_INSTRUMENTATION_PRESENT</SymbolicName>\n  <Comment> Detach is impossible because the profiler has either instrumented IL or inserted enter/leave hooks. Detach was not attempted; the profiler is still fully attached. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131371\">\n  <SymbolicName>CORPROF_E_RUNTIME_UNINITIALIZED</SymbolicName>\n  <Comment> The profiler called a function that cannot complete because the CLR is not yet fully initialized.  The profiler may try again once the CLR has fully started. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131372\">\n  <SymbolicName>CORPROF_E_IMMUTABLE_FLAGS_SET</SymbolicName>\n  <Comment> Detach is impossible because immutable flags were set by the profiler at startup. Detach was not attempted; the profiler is still fully attached. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131373\">\n  <SymbolicName>CORPROF_E_PROFILER_NOT_YET_INITIALIZED</SymbolicName>\n  <Comment> The profiler called a function that cannot complete because the profiler is not yet fully initialized. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131374\">\n  <SymbolicName>CORPROF_E_INCONSISTENT_WITH_FLAGS</SymbolicName>\n  <Comment> The profiler called a function that first requires additional flags to be set in the event mask.  This HRESULT may also indicate that the profiler called a function that first requires that some of the flags currently set in the event mask be reset. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131375\">\n  <SymbolicName>CORPROF_E_PROFILER_CANCEL_ACTIVATION</SymbolicName>\n  <Comment> The profiler has requested that the CLR instance not load the profiler into this process. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131376\">\n  <SymbolicName>CORPROF_E_CONCURRENT_GC_NOT_PROFILABLE</SymbolicName>\n  <Comment> Concurrent GC mode is enabled, which prevents use of COR_PRF_MONITOR_GC </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131378\">\n    <SymbolicName>CORPROF_E_DEBUGGING_DISABLED</SymbolicName>\n    <Comment> This functionality requires CoreCLR debugging to be enabled. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131379\">\n    <SymbolicName>CORPROF_E_TIMEOUT_WAITING_FOR_CONCURRENT_GC</SymbolicName>\n    <Comment> Timed out on waiting for concurrent GC to finish during attach. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013137A\">\n  <SymbolicName>CORPROF_E_MODULE_IS_DYNAMIC</SymbolicName>\n  <Comment> The specified module was dynamically generated (e.g., via Reflection.Emit API), and is thus not supported by this API method. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013137B\">\n  <SymbolicName>CORPROF_E_CALLBACK4_REQUIRED</SymbolicName>\n  <Comment> Profiler must implement ICorProfilerCallback4 interface for this call to be supported. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013137C\">\n  <SymbolicName>CORPROF_E_REJIT_NOT_ENABLED</SymbolicName>\n  <Comment> This call is not supported unless ReJIT is first enabled during initialization by setting COR_PRF_ENABLE_REJIT via SetEventMask. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013137E\">\n    <SymbolicName>CORPROF_E_FUNCTION_IS_COLLECTIBLE</SymbolicName>\n    <Comment> The specified function is instantiated into a collectible assembly, and is thus not supported by this API method. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131380\">\n    <SymbolicName>CORPROF_E_CALLBACK6_REQUIRED</SymbolicName>\n    <Comment> Profiler must implement ICorProfilerCallback6 interface for this call to be supported. </Comment>\n</HRESULT>\n\n<!-- This HRESULT is used only internally by our rejit implementation right now. If it ever appears in\n     a public API HRESULT it is a bug. It is included here to prevent anyone else from defining\n     a new failure with the same value and causing confusion.\n<HRESULT NumericValue=\"0x80131381\">\n    <SymbolicName>CORPROF_E_RUNTIME_SUSPEND_REQUIRED</SymbolicName>\n    <Comment> This call can't be completed safely because the runtime is not suspended </Comment>\n</HRESULT>\n-->\n\n<HRESULT NumericValue=\"0x80131382\">\n    <SymbolicName>CORPROF_E_CALLBACK7_REQUIRED</SymbolicName>\n    <Comment> Profiler must implement ICorProfilerCallback7 interface for this call to be supported. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131383\">\n    <SymbolicName>CORPROF_E_REJIT_INLINING_DISABLED</SymbolicName>\n    <Comment> The runtime's tracking of inlined methods for ReJIT is not enabled. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131384\">\n    <SymbolicName>CORDIAGIPC_E_BAD_ENCODING</SymbolicName>\n    <Comment> The runtime was unable to decode the Header or Payload. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131385\">\n    <SymbolicName>CORDIAGIPC_E_UNKNOWN_COMMAND</SymbolicName>\n    <Comment> The specified CommandSet or CommandId is unknown. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131386\">\n    <SymbolicName>CORDIAGIPC_E_UNKNOWN_MAGIC</SymbolicName>\n    <Comment> The magic version of Diagnostics IPC is unknown. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131387\">\n    <SymbolicName>CORDIAGIPC_E_UNKNOWN_ERROR</SymbolicName>\n    <Comment> An unknown error occurred in the Diagnpostics IPC Server. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131388\">\n    <SymbolicName>CORPROF_E_SUSPENSION_IN_PROGRESS</SymbolicName>\n    <Comment> The runtime cannot be suspened since a suspension is already in progress. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131416\">\n\t<SymbolicName>CORSEC_E_POLICY_EXCEPTION</SymbolicName>\n\t<Message>\"PolicyException thrown.\"</Message>\n\t<Comment> PolicyException thrown </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131417\">\n\t<SymbolicName>CORSEC_E_MIN_GRANT_FAIL</SymbolicName>\n\t<Message>\"Failed to grant minimum permission requests.\"</Message>\n\t<Comment> Failed to grant minimum permission requests </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131418\">\n\t<SymbolicName>CORSEC_E_NO_EXEC_PERM</SymbolicName>\n\t<Message>\"Failed to grant permission to execute.\"</Message>\n\t<Comment> Failed to grant permission to execute </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131419\">\n\t<SymbolicName>CORSEC_E_XMLSYNTAX</SymbolicName>\n\t<Message>\"XML Syntax error.\"</Message>\n\t<Comment> XML Syntax error </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013141a\">\n\t<SymbolicName>CORSEC_E_INVALID_STRONGNAME</SymbolicName>\n\t<Message>\"Strong name validation failed.\"</Message>\n\t<Comment> Strong name validation failed </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013141d\">\n\t<SymbolicName>CORSEC_E_INVALID_IMAGE_FORMAT</SymbolicName>\n\t<Message>\"Invalid assembly file format.\"</Message>\n\t<Comment> Invalid assembly file format </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013141e\">\n\t<SymbolicName>CORSEC_E_INVALID_PUBLICKEY</SymbolicName>\n\t<Message>\"Invalid assembly public key.\"</Message>\n\t<Comment> Invalid assembly public key </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131420\">\n\t<SymbolicName>CORSEC_E_SIGNATURE_MISMATCH</SymbolicName>\n\t<Message>\"Signature size mismatch.\"</Message>\n\t<Comment> Signature size mismatch </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131430\">\n\t<SymbolicName>CORSEC_E_CRYPTO</SymbolicName>\n\t<Message>\"Failure during Cryptographic operation.\"</Message>\n\t<Comment> generic CryptographicException </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131431\">\n\t<SymbolicName>CORSEC_E_CRYPTO_UNEX_OPER</SymbolicName>\n\t<Message>\"Unexpected Cryptographic operation.\"</Message>\n\t<Comment> generic CryptographicUnexpectedOperationException </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131500\">\n\t<SymbolicName>COR_E_EXCEPTION</SymbolicName>\n\t<Message>\"General Exception\"</Message>\n\t<Comment> Base class for all exceptions in the runtime</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131501\">\n\t<SymbolicName>COR_E_SYSTEM</SymbolicName>\n\t<Message>\"System.Exception\"</Message>\n\t<Comment> The base class for the runtime's \"less serious\" exceptions</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131502\">\n\t<SymbolicName>COR_E_ARGUMENTOUTOFRANGE</SymbolicName>\n\t<Message>\"An argument was out of its legal range.\"</Message>\n\t<Comment> An argument was out of its legal range.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131503\">\n\t<SymbolicName>COR_E_ARRAYTYPEMISMATCH</SymbolicName>\n\t<Message>\"Attempted to store an object of the wrong type in an array.\"</Message>\n\t<Comment> Attempted to store an object of the wrong type in an array</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131504\">\n\t<SymbolicName>COR_E_CONTEXTMARSHAL</SymbolicName>\n\t<Message>\"Attempted to marshal an object across a context boundary.\"</Message>\n\t<Comment></Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131505\">\n\t<SymbolicName>COR_E_TIMEOUT</SymbolicName>\n\t<Message>\"Operation timed out.\"</Message>\n\t<Comment></Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131506\">\n\t<SymbolicName>COR_E_EXECUTIONENGINE</SymbolicName>\n\t<Message>\"Internal CLR error.\"</Message>\n\t<Comment> An internal error happened in the Common Language Runtime's Execution Engine</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131507\">\n\t<SymbolicName>COR_E_FIELDACCESS</SymbolicName>\n\t<Message>\"Access to this field is denied.\"</Message>\n\t<Comment> Access to this field is denied.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131508\">\n\t<SymbolicName>COR_E_INDEXOUTOFRANGE</SymbolicName>\n\t<Message>\"Array subscript out of range.\"</Message>\n\t<Comment> Attempted to access an element within an array by using an index that is</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131509\">\n\t<SymbolicName>COR_E_INVALIDOPERATION</SymbolicName>\n\t<Message>\"An operation is not legal in the current state.\"</Message>\n\t<Comment> An operation is not legal in the current state.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013150a\">\n\t<SymbolicName>COR_E_SECURITY</SymbolicName>\n\t<Message>\"An error relating to security occurred.\"</Message>\n\t<Comment> An error relating to security occurred.</Comment>\n</HRESULT>\n\n\n<HRESULT NumericValue=\"0x8013150c\">\n\t<SymbolicName>COR_E_SERIALIZATION</SymbolicName>\n\t<Message>\"An error relating to serialization occurred.\"</Message>\n\t<Comment> An error relating to serialization has occurred.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013150d\">\n\t<SymbolicName>COR_E_VERIFICATION</SymbolicName>\n\t<Message>\"A verification failure has occurred.\"</Message>\n\t<Comment> A verification failure occurred</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131510\">\n\t<SymbolicName>COR_E_METHODACCESS</SymbolicName>\n\t<Message>\"Access to this method is denied.\"</Message>\n\t<Comment> Access to this method is denied.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131511\">\n\t<SymbolicName>COR_E_MISSINGFIELD</SymbolicName>\n\t<Message>\"Field does not exist.\"</Message>\n\t<Comment> An attempt was made to dynamically access a field that does not exist.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131512\">\n\t<SymbolicName>COR_E_MISSINGMEMBER</SymbolicName>\n\t<Message>\"Member does not exist.\"</Message>\n\t<Comment> An attempt was made to dynamically invoke or access a field or method</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131513\">\n\t<SymbolicName>COR_E_MISSINGMETHOD</SymbolicName>\n\t<Message>\"Method does not exist.\"</Message>\n\t<Comment> An attempt was made to dynamically invoke a method that does not exist</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131514\">\n\t<SymbolicName>COR_E_MULTICASTNOTSUPPORTED</SymbolicName>\n\t<Message>\"Attempt to combine delegates that are not multicast.\"</Message>\n\t<Comment> Attempted to combine delegates that are not multicast</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131515\">\n\t<SymbolicName>COR_E_NOTSUPPORTED</SymbolicName>\n\t<Message>\"Operation is not supported.\"</Message>\n\t<Comment> The operation is not supported</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131516\">\n\t<SymbolicName>COR_E_OVERFLOW</SymbolicName>\n\t<Message>\"Arithmetic, casting or conversion operation overflowed or underflowed.\"</Message>\n\t<Comment> An arithmetic, casting, or conversion operation overflowed or underflowed.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131517\">\n\t<SymbolicName>COR_E_RANK</SymbolicName>\n\t<Message>\"An array has the wrong number of dimensions for a particular operation.\"</Message>\n\t<Comment> An array has the wrong number of dimensions for a particular operation.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131518\">\n\t<SymbolicName>COR_E_SYNCHRONIZATIONLOCK</SymbolicName>\n\t<Message>\"This operation must be called from a synchronized block.\"</Message>\n\t<Comment> Wait(), Notify() or NotifyAll() was called from an unsynchronized ** block of c</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131519\">\n\t<SymbolicName>COR_E_THREADINTERRUPTED</SymbolicName>\n\t<Message>\"Thread was interrupted from a waiting state.\"</Message>\n\t<Comment> Indicates that the thread was interrupted from a waiting state</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013151a\">\n\t<SymbolicName>COR_E_MEMBERACCESS</SymbolicName>\n\t<Message>\"Access to this member is denied.\"</Message>\n\t<Comment> Access to this member is denied.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131520\">\n\t<SymbolicName>COR_E_THREADSTATE</SymbolicName>\n\t<Message>\"Thread is in an invalid state for this operation.\"</Message>\n\t<Comment> Indicate that the Thread class is in an invalid state for the method call</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131521\">\n\t<SymbolicName>COR_E_THREADSTOP</SymbolicName>\n\t<Message>\"Thread is stopping.\"</Message>\n\t<Comment> Thrown into a thread to cause it to stop. This exception is typically not caught</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131522\">\n\t<SymbolicName>COR_E_TYPELOAD</SymbolicName>\n\t<Message>\"Could not find or load a type.\"</Message>\n\t<Comment> Could not find or load a specific type (class, enum, etc).</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131523\">\n\t<SymbolicName>COR_E_ENTRYPOINTNOTFOUND</SymbolicName>\n\t<Message>\"Could not find the specified DllImport entrypoint.\"</Message>\n\t<Comment> Could not find the specified DllImport entry point</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131524\">\n\t<SymbolicName>COR_E_DLLNOTFOUND</SymbolicName>\n\t<Message>\"Could not find the specified DllImport Dll.\"</Message>\n\t<Comment> Could not find the specified DllImport DLL.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131525\">\n\t<SymbolicName>COR_E_THREADSTART</SymbolicName>\n\t<Comment> Indicate that a user thread fails to start.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131527\">\n\t<SymbolicName>COR_E_INVALIDCOMOBJECT</SymbolicName>\n\t<Message>\"An invalid __ComObject has been used.\"</Message>\n\t<Comment> An invalid __ComObject has been used.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131528\">\n\t<SymbolicName>COR_E_NOTFINITENUMBER</SymbolicName>\n\t<Message>\"Not a Number.\"</Message>\n\t<Comment>  Thrown if value (a floating point number) is either the not a number value (NaN) or +- infinity value</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131529\">\n\t<SymbolicName>COR_E_DUPLICATEWAITOBJECT</SymbolicName>\n\t<Message>\"An object appears more than once in the wait objects array.\"</Message>\n\t<Comment> An object appears more than once in the wait objects array.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013152b\">\n\t<SymbolicName>COR_E_SEMAPHOREFULL</SymbolicName>\n\t<Message>\"Reached maximum count for semaphore.\"</Message>\n\t<Comment> Adding the given count to the semaphore would cause it to exceed its maximum count.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013152c\">\n\t<SymbolicName>COR_E_WAITHANDLECANNOTBEOPENED</SymbolicName>\n\t<Message>\"No semaphore of the given name exists.\"</Message>\n\t<Comment> No Semaphore of the given name exists.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013152d\">\n\t<SymbolicName>COR_E_ABANDONEDMUTEX</SymbolicName>\n\t<Message>\"The wait completed due to an abandoned mutex.\"</Message>\n\t<Comment> The wait completed due to an abandoned mutex.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131530\">\n\t<SymbolicName>COR_E_THREADABORTED</SymbolicName>\n\t<Message>\"Thread has aborted.\"</Message>\n\t<Comment> Thrown into a thread to cause it to abort. Not catchable.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131531\">\n\t<SymbolicName>COR_E_INVALIDOLEVARIANTTYPE</SymbolicName>\n\t<Message>\"OLE Variant has an invalid type.\"</Message>\n\t<Comment> The type of an OLE variant that was passed into the runtime is invalid.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131532\">\n\t<SymbolicName>COR_E_MISSINGMANIFESTRESOURCE</SymbolicName>\n\t<Message>\"An expected resource in the assembly manifest was missing.\"</Message>\n\t<Comment> An expected resource in the assembly manifest was missing.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131533\">\n\t<SymbolicName>COR_E_SAFEARRAYTYPEMISMATCH</SymbolicName>\n\t<Message>\"A mismatch has occurred between the runtime type of the array and the sub type recorded in the metadata.\"</Message>\n\t<Comment> A mismatch has occurred between the runtime type of the array and the subtype recorded in the metadata</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131534\">\n\t<SymbolicName>COR_E_TYPEINITIALIZATION</SymbolicName>\n\t<Message>\"Uncaught exception during type initialization.\"</Message>\n\t<Comment> An exception was thrown by a type's initializer (.cctor).</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131535\">\n\t<SymbolicName>COR_E_MARSHALDIRECTIVE</SymbolicName>\n\t<Message>\"Invalid marshaling directives.\"</Message>\n\t<Comment> The marshaling directives are invalid.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131536\">\n\t<SymbolicName>COR_E_MISSINGSATELLITEASSEMBLY</SymbolicName>\n\t<Message>\"An expected satellite assembly containing the ultimate fallback resources for a given culture was not found or could not be loaded.\"</Message>\n\t<Comment> An expected satellite assembly containing the ultimate fallback resources</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131537\">\n\t<SymbolicName>COR_E_FORMAT</SymbolicName>\n\t<Message>\"The format of one argument does not meet the contract of the method.\"</Message>\n\t<Comment> The format of one argument does not meet the contract of the method.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131538\">\n\t<SymbolicName>COR_E_SAFEARRAYRANKMISMATCH</SymbolicName>\n\t<Message>\"A mismatch has occurred between the runtime rank of the array and the rank recorded in the metadata.\"</Message>\n\t<Comment> A mismatch has occurred between the runtime rank of the array and the rank recorded in the metadata</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131539\">\n\t<SymbolicName>COR_E_PLATFORMNOTSUPPORTED</SymbolicName>\n\t<Message>\"Operation is not supported on this platform.\"</Message>\n\t<Comment> The method is not supported on this platform</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013153a\">\n\t<SymbolicName>COR_E_INVALIDPROGRAM</SymbolicName>\n\t<Message>\"Invalid IL or CLR metadata.\"</Message>\n\t<Comment> A program contained invalid IL or bad metadata.  Usually this is a compiler bug.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013153b\">\n\t<SymbolicName>COR_E_OPERATIONCANCELED</SymbolicName>\n\t<Message>\"The operation was cancelled.\"</Message>\n\t<Comment> The operation was cancelled.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013153d\">\n\t<SymbolicName>COR_E_INSUFFICIENTMEMORY</SymbolicName>\n\t<Comment> Not enough memory was available for an operation.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013153e\">\n\t<SymbolicName>COR_E_RUNTIMEWRAPPED</SymbolicName>\n\t<Comment> An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131541\">\n\t<SymbolicName>COR_E_DATAMISALIGNED</SymbolicName>\n\t<Message>\"A datatype misalignment was detected in a load or store instruction.\"</Message>\n\t<Comment> A datatype misalignment was detected in a load or store instruction.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131542\">\n\t<SymbolicName>COR_E_CODECONTRACTFAILED</SymbolicName>\n\t<Message>\"A managed code contract (ie, precondition, postcondition, invariant, or assert) failed.\"</Message>\n\t<Comment> A managed code contract (ie, precondition, postcondition, invariant, or assert) failed.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131543\">\n  <SymbolicName>COR_E_TYPEACCESS</SymbolicName>\n  <Message>\"Access to this type is denied.\"</Message>\n  <Comment>Access to this type is denied.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131544\">\n  <SymbolicName>COR_E_ACCESSING_CCW</SymbolicName>\n  <Message>\"Fail to access a CCW because the corresponding managed object is already collected.\"</Message>\n  <Comment>Fail to access a CCW because the corresponding managed object is already collected.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131577\">\n\t<SymbolicName>COR_E_KEYNOTFOUND</SymbolicName>\n\t<Message>\"The given key was not present in the dictionary.\"</Message>\n\t<Comment></Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131578\">\n  <SymbolicName>COR_E_INSUFFICIENTEXECUTIONSTACK</SymbolicName>\n  <Message>\"Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.\"</Message>\n  <Comment> Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131600\">\n\t<SymbolicName>COR_E_APPLICATION</SymbolicName>\n\t<Message>\"Application exception\"</Message>\n\t<Comment> The base class for all \"less serious\" exceptions.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131601\">\n\t<SymbolicName>COR_E_INVALIDFILTERCRITERIA</SymbolicName>\n\t<Message>\"The given filter criteria does not match the filter content.\"</Message>\n\t<Comment> The given filter criteria does not match the filter contract.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131602\">\n\t<SymbolicName>COR_E_REFLECTIONTYPELOAD</SymbolicName>\n\t<Message>\"Could not find or load a specific class that was requested through Reflection.\"</Message>\n\t<Comment> Could not find or load a specific class that was requested through Reflection</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131603\">\n\t<SymbolicName>COR_E_TARGET</SymbolicName>\n\t<Message>\"Attempt to invoke non-static method with a null Object.\"</Message>\n\t<Comment> - If you attempt to invoke a non-static method with a null Object - If you atte</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131604\">\n\t<SymbolicName>COR_E_TARGETINVOCATION</SymbolicName>\n\t<Message>\"Uncaught exception thrown by method called through Reflection.\"</Message>\n\t<Comment> If the method called throws an exception</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131605\">\n\t<SymbolicName>COR_E_CUSTOMATTRIBUTEFORMAT</SymbolicName>\n\t<Message>\"Custom attribute has invalid format.\"</Message>\n\t<Comment> If the binary format of a custom attribute is invalid.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131620\">\n\t<SymbolicName>COR_E_IO</SymbolicName>\n\t<Message>\"Error during managed I/O.\"</Message>\n\t<Comment> Some sort of I/O error.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131621\">\n\t<SymbolicName>COR_E_FILELOAD</SymbolicName>\n\t<Message>\"Could not find or load a specific file.\"</Message>\n\t<Comment></Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131622\">\n\t<SymbolicName>COR_E_OBJECTDISPOSED</SymbolicName>\n\t<Message>\"The object has already been disposed.\"</Message>\n\t<Comment> The object has already been disposed.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131623\">\n\t<SymbolicName>COR_E_FAILFAST</SymbolicName>\n\t<Message>\"Runtime operation halted by call to System.Environment.FailFast().\"</Message>\n\t<Comment> Runtime operation halted by call to System.Environment.FailFast().</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131640\">\n\t<SymbolicName>COR_E_HOSTPROTECTION</SymbolicName>\n\t<Message>\"The host has forbidden this operation.\"</Message>\n\t<Comment> Attempted to perform an operation that was forbidden by the host.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131641\">\n\t<SymbolicName>COR_E_ILLEGAL_REENTRANCY</SymbolicName>\n\t<Message>\"Attempted to call into managed code when executing inside a low level extensibility point.\"</Message>\n\t<Comment> Attempted to call into managed code when executing inside a low level extensibility point.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131700\">\n\t<SymbolicName>CLR_E_SHIM_RUNTIMELOAD</SymbolicName>\n\t<Message>\"Failed to load the runtime.\"</Message>\n\t<Comment> Failed to load the runtime </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131704\">\n\t<SymbolicName>CLR_E_SHIM_LEGACYRUNTIMEALREADYBOUND</SymbolicName>\n\t<Message>\"A runtime has already been bound for legacy activation policy use.\"</Message>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131815\">\n\t<SymbolicName>VER_E_FIELD_SIG</SymbolicName>\n\t<Message>\"[field sig]\"</Message>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801318ce\">\n\t<SymbolicName>VER_E_CIRCULAR_VAR_CONSTRAINTS</SymbolicName>\n\t<Message>\"Method parent has circular class type parameter constraints.\"</Message>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x801318cf\">\n\t<SymbolicName>VER_E_CIRCULAR_MVAR_CONSTRAINTS</SymbolicName>\n\t<Message>\"Method has circular method type parameter constraints.\"</Message>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131920\">\n\t<SymbolicName>COR_E_Data</SymbolicName>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131b24\">\n\t<SymbolicName>VLDTR_E_SIG_BADVOID</SymbolicName>\n\t<Message>\"Illegal 'void' in signature.\"</Message>\n\t<Comment> Illegal \"void\" in signature </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131b2d\">\n\t<SymbolicName>VLDTR_E_GP_ILLEGAL_VARIANT_MVAR</SymbolicName>\n\t<Message>\"GenericParam is a method type parameter and must be non-variant.\"</Message>\n\t<Comment> GenericParam is a method type parameter and must be non-variant </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c00\">\n\t<SymbolicName>CORDBG_E_THREAD_NOT_SCHEDULED</SymbolicName>\n\t<Message>\"Thread is not scheduled. Thus we may not have OSThreadId, handle, or context.\"</Message>\n\t<Comment> Thread is not scheduled. Thus we may not have OSThreadId, handle, or context </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c01\">\n\t<SymbolicName>CORDBG_E_HANDLE_HAS_BEEN_DISPOSED</SymbolicName>\n\t<Message>\"Handle has been disposed.\"</Message>\n\t<Comment> Handle has been disposed. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c02\">\n\t<SymbolicName>CORDBG_E_NONINTERCEPTABLE_EXCEPTION</SymbolicName>\n\t<Message>\"Cannot intercept this exception.\"</Message>\n\t<Comment> Cant intercept this exception. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c04\">\n\t<SymbolicName>CORDBG_E_INTERCEPT_FRAME_ALREADY_SET</SymbolicName>\n\t<Message>\"The intercept frame for this exception has already been set.\"</Message>\n\t<Comment> The intercept frame for this exception has already been set. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c05\">\n\t<SymbolicName>CORDBG_E_NO_NATIVE_PATCH_AT_ADDR</SymbolicName>\n\t<Message>\"There is no native patch at the given address.\"</Message>\n\t<Comment> there's no native patch at the given address. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c06\">\n\t<SymbolicName>CORDBG_E_MUST_BE_INTEROP_DEBUGGING</SymbolicName>\n\t<Message>\"This API is only allowed when interop debugging.\"</Message>\n\t<Comment> This API is only allowed when interop debugging. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c07\">\n\t<SymbolicName>CORDBG_E_NATIVE_PATCH_ALREADY_AT_ADDR</SymbolicName>\n\t<Message>\"There is already a native patch at the address.\"</Message>\n\t<Comment> There's already a native patch at the address </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c08\">\n\t<SymbolicName>CORDBG_E_TIMEOUT</SymbolicName>\n\t<Message>\"A wait timed out, likely an indication of deadlock.\"</Message>\n\t<Comment> a wait timed out .. likely an indication of deadlock. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c09\">\n\t<SymbolicName>CORDBG_E_CANT_CALL_ON_THIS_THREAD</SymbolicName>\n\t<Message>\"Cannot use the API on this thread.\"</Message>\n\t<Comment> Can't use the API on this thread. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c0a\">\n\t<SymbolicName>CORDBG_E_ENC_INFOLESS_METHOD</SymbolicName>\n\t<Message>\"Method was not JIT'd in EnC mode.\"</Message>\n\t<Comment> Method was not JITed in EnC mode </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c0c\">\n\t<SymbolicName>CORDBG_E_ENC_IN_FUNCLET</SymbolicName>\n\t<Message>\"Method is in a callable handler/filter. Cannot increase stack.\"</Message>\n\t<Comment> Method is in a callable handler/filter. Cant grow stack </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c0e\">\n\t<SymbolicName>CORDBG_E_ENC_EDIT_NOT_SUPPORTED</SymbolicName>\n\t<Message>\"Attempt to perform unsupported edit.\"</Message>\n\t<Comment> Attempt to perform unsupported edit </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c10\">\n\t<SymbolicName>CORDBG_E_NOTREADY</SymbolicName>\n\t<Message>\"The LS is not in a good spot to perform the requested operation.\"</Message>\n\t<Comment> The LS is not in a good spot to perform the requested operation. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c11\">\n\t<SymbolicName>CORDBG_E_CANNOT_RESOLVE_ASSEMBLY</SymbolicName>\n\t<Message>\"We failed to resolve assembly given an AssemblyRef token. Assembly may be not loaded yet or not a valid token.\"</Message>\n\t<Comment> We failed to resolve assembly given an AssemblyRef token. Assembly may be not loaded yet or not a valid token. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c12\">\n\t<SymbolicName>CORDBG_E_MUST_BE_IN_LOAD_MODULE</SymbolicName>\n\t<Message>\"Must be in context of LoadModule callback to perform requested operation.\"</Message>\n\t<Comment> Must be in context of LoadModule callback to perform requested operation </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c13\">\n\t<SymbolicName>CORDBG_E_CANNOT_BE_ON_ATTACH</SymbolicName>\n\t<Message>\"Requested operation cannot be performed during an attach operation.\"</Message>\n\t<Comment> Requested operation cannot be performed during an attach operation </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c14\">\n\t<SymbolicName>CORDBG_E_NGEN_NOT_SUPPORTED</SymbolicName>\n\t<Message>\"NGEN must be supported to perform the requested operation.\"</Message>\n\t<Comment> NGEN must be supported to perform the requested operation </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c15\">\n\t<SymbolicName>CORDBG_E_ILLEGAL_SHUTDOWN_ORDER</SymbolicName>\n\t<Message>\"Trying to shutdown out of order.\"</Message>\n\t<Comment> Trying to shutdown out of order. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c16\">\n\t<SymbolicName>CORDBG_E_CANNOT_DEBUG_FIBER_PROCESS</SymbolicName>\n\t<Message>\"Debugging fiber mode managed process is not supported.\"</Message>\n\t<Comment> For Whidbey, we don't support debugging fiber mode managed process </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c17\">\n\t<SymbolicName>CORDBG_E_MUST_BE_IN_CREATE_PROCESS</SymbolicName>\n\t<Message>\"Must be in context of CreateProcess callback to perform requested operation.\"</Message>\n\t<Comment> Must be in context of CreateProcess callback to perform requested operation </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c18\">\n\t<SymbolicName>CORDBG_E_DETACH_FAILED_OUTSTANDING_EVALS</SymbolicName>\n\t<Message>\"All outstanding func-evals have not completed, detaching is not allowed at this time.\"</Message>\n\t<Comment> All outstanding func-evals have not completed, detaching is not allowed at this time. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c19\">\n\t<SymbolicName>CORDBG_E_DETACH_FAILED_OUTSTANDING_STEPPERS</SymbolicName>\n\t<Message>\"All outstanding steppers have not been closed, detaching is not allowed at this time.\"</Message>\n\t<Comment> All outstanding steppers have not been closed, detaching is not allowed at this time. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c20\">\n\t<SymbolicName>CORDBG_E_CANT_INTEROP_STEP_OUT</SymbolicName>\n\t<Message>\"Cannot have an ICorDebugStepper do a native step-out.\"</Message>\n\t<Comment> Can't have an ICorDebugStepper do a native step-out. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c21\">\n\t<SymbolicName>CORDBG_E_DETACH_FAILED_OUTSTANDING_BREAKPOINTS</SymbolicName>\n\t<Message>\"All outstanding breakpoints have not been closed, detaching is not allowed at this time.\"</Message>\n\t<Comment> All outstanding breakpoints have not been closed, detaching is not allowed at this time. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c22\">\n\t<SymbolicName>CORDBG_E_ILLEGAL_IN_STACK_OVERFLOW</SymbolicName>\n\t<Message>\"The operation is illegal because of a stack overflow.\"</Message>\n\t<Comment> the operation is illegal because of a stackoverflow. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c23\">\n\t<SymbolicName>CORDBG_E_ILLEGAL_AT_GC_UNSAFE_POINT</SymbolicName>\n\t<Message>\"The operation failed because it is a GC unsafe point.\"</Message>\n\t<Comment> The operation failed because it's a GC unsafe point. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c24\">\n\t<SymbolicName>CORDBG_E_ILLEGAL_IN_PROLOG</SymbolicName>\n\t<Message>\"The operation failed because the thread is in the prolog.\"</Message>\n\t<Comment> The operation failed because the thread is in the prolog </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c25\">\n\t<SymbolicName>CORDBG_E_ILLEGAL_IN_NATIVE_CODE</SymbolicName>\n\t<Message>\"The operation failed because the thread is in native code.\"</Message>\n\t<Comment> The operation failed because the thread is in native code </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c26\">\n\t<SymbolicName>CORDBG_E_ILLEGAL_IN_OPTIMIZED_CODE</SymbolicName>\n\t<Message>\"The operation failed because the thread is in optimized code.\"</Message>\n\t<Comment> The operation failed because the thread is in optimized code. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c28\">\n\t<SymbolicName>CORDBG_E_APPDOMAIN_MISMATCH</SymbolicName>\n\t<Message>\"A supplied object or type belongs to the wrong AppDomain.\"</Message>\n\t<Comment> A supplied object or type belongs to the wrong AppDomain </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c29\">\n\t<SymbolicName>CORDBG_E_CONTEXT_UNVAILABLE</SymbolicName>\n\t<Message>\"The thread's context is not available.\"</Message>\n\t<Comment> The thread's context is not available. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c30\">\n\t<SymbolicName>CORDBG_E_INCOMPATIBLE_PLATFORMS</SymbolicName>\n\t<Message>\"The operation failed because debuggee and debugger are on incompatible platforms.\"</Message>\n\t<Comment> The operation failed because debuggee and debugger are on incompatible platform </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c31\">\n\t<SymbolicName>CORDBG_E_DEBUGGING_DISABLED</SymbolicName>\n\t<Message>\"The operation failed because the debugging has been disabled\"</Message>\n\t<Comment> The operation failed because the debugging has been disabled </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c32\">\n\t<SymbolicName>CORDBG_E_DETACH_FAILED_ON_ENC</SymbolicName>\n\t<Message>\"Detach is illegal after an Edit and Continue on a module.\"</Message>\n\t<Comment> Detach is illegal after a module has been EnCed. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c33\">\n\t<SymbolicName>CORDBG_E_CURRENT_EXCEPTION_IS_OUTSIDE_CURRENT_EXECUTION_SCOPE</SymbolicName>\n\t<Message>\"Cannot intercept the current exception at the specified frame.\"</Message>\n\t<Comment> Interception of the current exception is not legal </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c34\">\n\t<SymbolicName>CORDBG_E_HELPER_MAY_DEADLOCK</SymbolicName>\n\t<Message>\"The debugger helper thread cannot obtain the locks it needs to perform this operation.\"</Message>\n\t<Comment> Helper thread can not safely run code. The opereration may work at a later time. </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c35\">\n    <SymbolicName>CORDBG_E_MISSING_METADATA</SymbolicName>\n    <Message>\"The operation failed because the debugger could not get the metadata.\"</Message>\n    <Comment>The operation failed because the debugger could not get the metadata.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c36\">\n    <SymbolicName>CORDBG_E_TARGET_INCONSISTENT</SymbolicName>\n    <Message>\"The debuggee is in a corrupt state.\"</Message>\n    <Comment>The debuggee is in a corrupt state.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c37\">\n  <SymbolicName>CORDBG_E_DETACH_FAILED_OUTSTANDING_TARGET_RESOURCES</SymbolicName>\n  <Message>\"Detach failed because there are outstanding resources in the target.\"</Message>\n  <Comment>The debugger is holding resource in the target (such as GC handles, function evaluations, etc).\n  These resources must be released through the appropriate ICorDebug API before detach can succeed.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c38\">\n    <SymbolicName>CORDBG_E_TARGET_READONLY</SymbolicName>\n    <Message>\"The debuggee is read-only.\"</Message>\n    <Comment>The provided ICorDebugDataTarget does not implement ICorDebugMutableDataTarget.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c39\">\n  <SymbolicName>CORDBG_E_MISMATCHED_CORWKS_AND_DACWKS_DLLS</SymbolicName>\n  <Message>\"The version of clr.dll in the target does not match the one mscordacwks.dll was built for.\"</Message>\n  <Comment>A clr/mscordacwks mismatch will cause DAC to fail to initialize in ClrDataAccess::Initialize</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c3a\">\n    <SymbolicName>CORDBG_E_MODULE_LOADED_FROM_DISK</SymbolicName>\n    <Message>\"Symbols are not supplied for modules loaded from disk.\"</Message>\n    <Comment>Symbols are not supplied for modules loaded from disk</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c3b\">\n    <SymbolicName>CORDBG_E_SYMBOLS_NOT_AVAILABLE</SymbolicName>\n    <Message>\"The application did not supply symbols when it loaded or created this module, or they are not yet available.\"</Message>\n    <Comment>The application did not supply symbols when it loaded or created this module, or they are not yet available</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c3c\">\n  <SymbolicName>CORDBG_E_DEBUG_COMPONENT_MISSING</SymbolicName>\n  <Message>\"A debug component is not installed.\"</Message>\n  <Comment>A debug component is not installed</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c43\">\n    <SymbolicName>CORDBG_E_LIBRARY_PROVIDER_ERROR</SymbolicName>\n    <Message>\"The ICLRDebuggingLibraryProvider callback returned an error or did not provide a valid handle.\"</Message>\n    <Comment>The ICLRDebuggingLibraryProvider callback returned an error or did not provide a valid handle</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c44\">\n    <SymbolicName>CORDBG_E_NOT_CLR</SymbolicName>\n    <Message>\"The module at the base address indicated was not recognized as a CLR\"</Message>\n    <Comment>The module at the base address indicated was not recognized as a CLR</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c45\">\n    <SymbolicName>CORDBG_E_MISSING_DATA_TARGET_INTERFACE</SymbolicName>\n    <Message>\"The provided data target does not implement the required interfaces for this version of the runtime\"</Message>\n    <Comment>The provided data target does not implement the required interfaces for this version of the runtime</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c46\">\n    <SymbolicName>CORDBG_E_UNSUPPORTED_DEBUGGING_MODEL</SymbolicName>\n    <Message>\"This debugging model is unsupported by the specified runtime\"</Message>\n    <Comment>This debugging model is unsupported by the specified runtime</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c47\">\n    <SymbolicName>CORDBG_E_UNSUPPORTED_FORWARD_COMPAT</SymbolicName>\n    <Message>\"The debugger is not designed to support the version of the CLR the debuggee is using.\"</Message>\n    <Comment>The debugger is not designed to support the version of the CLR the debuggee is using.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c48\">\n    <SymbolicName>CORDBG_E_UNSUPPORTED_VERSION_STRUCT</SymbolicName>\n    <Message>\"The version struct has an unrecognized value for wStructVersion\"</Message>\n    <Comment>The version struct has an unrecognized value for wStructVersion</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c49\">\n    <SymbolicName>CORDBG_E_READVIRTUAL_FAILURE</SymbolicName>\n    <Message>\"A call into a ReadVirtual implementation returned failure\"</Message>\n    <Comment>A call into a ReadVirtual implementation returned failure</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c4a\">\n  <SymbolicName>CORDBG_E_VALUE_POINTS_TO_FUNCTION</SymbolicName>\n  <Message>\"The Debugging API doesn't support dereferencing function pointers.\"</Message>\n  <Comment>The Debugging API doesn't support dereferencing function pointers.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c4b\">\n  <SymbolicName>CORDBG_E_CORRUPT_OBJECT</SymbolicName>\n  <Message>\"The address provided does not point to a valid managed object.\"</Message>\n  <Comment>The address provided does not point to a valid managed object.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c4c\">\n  <SymbolicName>CORDBG_E_GC_STRUCTURES_INVALID</SymbolicName>\n  <Message>\"The GC heap structures are not in a valid state for traversal.\"</Message>\n  <Comment>The GC heap structures are not in a valid state for traversal.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c4d\">\n  <SymbolicName>CORDBG_E_INVALID_OPCODE</SymbolicName>\n  <Message>\"The specified IL offset or opcode is not supported for this operation.\"</Message>\n  <Comment>The specified IL offset or opcode is not supported for this operation.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c4e\">\n  <SymbolicName>CORDBG_E_UNSUPPORTED</SymbolicName>\n  <Message>\"The specified action is unsupported by this version of the runtime.\"</Message>\n  <Comment>The specified action is unsupported by this version of the runtime.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c4f\">\n  <SymbolicName>CORDBG_E_MISSING_DEBUGGER_EXPORTS</SymbolicName>\n  <Message>\"The debuggee memory space does not have the expected debugging export table.\"</Message>\n  <Comment>The debuggee memory space does not have the expected debugging export table.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c61\">\n  <SymbolicName>CORDBG_E_DATA_TARGET_ERROR</SymbolicName>\n  <Message>\"Failure when calling a data target method.\"</Message>\n  <Comment>Failure when calling a data target method.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c68\">\n  <SymbolicName>CORDBG_E_UNSUPPORTED_DELEGATE</SymbolicName>\n  <Message>\"The delegate contains a delegate currently not supported by the API.\"</Message>\n  <Comment>The delegate contains a delegate currently not supported by the API.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131c69\">\n  <SymbolicName>CORDBG_E_ASSEMBLY_UPDATES_APPLIED</SymbolicName>\n  <Message>\"The operation is not supported because assembly updates have been applied.\"</Message>\n  <Comment>The operation is not supported because assembly updates have been applied.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131d02\">\n\t<SymbolicName>PEFMT_E_64BIT</SymbolicName>\n\t<Message>\"File is PE32+.\"</Message>\n\t<Comment> File is PE32+ </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131d0b\">\n\t<SymbolicName>PEFMT_E_32BIT</SymbolicName>\n\t<Message>\"File is PE32\"</Message>\n\t<Comment> File is PE32 </Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80131fff\">\n\t<SymbolicName>CLDB_E_INTERNALERROR</SymbolicName>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80132000\">\n\t<SymbolicName>CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW</SymbolicName>\n\t<Message>\"The bound assembly has a version that is lower than that of the request.\"</Message>\n\t<Comment>For AppX binder, indicates that bound assembly has a version lower than that requested, and we will refuse version rollback.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80132001\">\n\t<SymbolicName>CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH</SymbolicName>\n\t<Message>\"The assembly version has a public key token that does not match that of the request.\"</Message>\n\t<Comment>For AppX binder, indicates that bound assembly's public key token doesn't match the key in the assembly name.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80132002\">\n\t<SymbolicName>CLR_E_BIND_IMAGE_UNAVAILABLE</SymbolicName>\n\t<Message>\"The requested image was not found or is unavailable.\"</Message>\n\t<Comment>Occurs if a request for a native image is made on an BINDER_SPACE::Assembly interface when one is not available.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80132003\">\n\t<SymbolicName>CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT</SymbolicName>\n\t<Message>\"The provided identity format is not recognized.\"</Message>\n\t<Comment>If a binder is provided an identity format that it cannot parse, it returns this error.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80132004\">\n\t<SymbolicName>CLR_E_BIND_ASSEMBLY_NOT_FOUND</SymbolicName>\n\t<Message>\"A binding for the specified assembly name was not found.\"</Message>\n\t<Comment>Returned by binders that bind based on assembly identity.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80132005\">\n\t<SymbolicName>CLR_E_BIND_TYPE_NOT_FOUND</SymbolicName>\n\t<Message>\"A binding for the specified type name was not found.\"</Message>\n\t<Comment>Returned by binders that bind based on type identity.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x80132009\">\n\t<SymbolicName>CLR_E_GC_OOM</SymbolicName>\n\t<Message>\"Failfast due to an OOM during a GC\"</Message>\n\t<Comment>During a GC when we try to allocate memory for GC datastructures we could not.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013200A\">\n\t<SymbolicName>CLR_E_GC_BAD_AFFINITY_CONFIG</SymbolicName>\n\t<Message>\"GCHeapAffinitizeMask or GCHeapAffinitizeRanges didn't specify any CPUs the current process is affinitized to.\"</Message>\n\t<Comment>During a GC initialization, the affinity mask specified via GCHeapAffinitizeMask or GCHeapAffinitizeRanges didn't contain any CPUs the current process is affinitized to.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013200B\">\n\t<SymbolicName>CLR_E_GC_BAD_AFFINITY_CONFIG_FORMAT</SymbolicName>\n\t<Message>\"GCHeapAffinitizeRanges configuration string has invalid format.\"</Message>\n\t<Comment>During a GC initialization, the GCHeapAffinitizeRanges config couldn't be parsed due to its invalid format.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013200D\">\n\t<SymbolicName>CLR_E_GC_BAD_HARD_LIMIT</SymbolicName>\n\t<Message>\"GC heap hard limit configuration is invalid.\"</Message>\n\t<Comment>During a GC initialization, the GC heap hard limit configuration is invalid.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"0x8013200E\">\n\t<SymbolicName>CLR_E_GC_LARGE_PAGE_MISSING_HARD_LIMIT</SymbolicName>\n\t<Message>\"GC large page support requires hard limit settings.\"</Message>\n\t<Comment>During a GC initialization, GC large page support requires hard limit settings.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"E_ACCESSDENIED\">\n\t<SymbolicName>COR_E_UNAUTHORIZEDACCESS</SymbolicName>\n\t<Comment> 0x80070005 // Access is denied.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"E_INVALIDARG\">\n\t<SymbolicName>COR_E_ARGUMENT</SymbolicName>\n\t<Comment> 0x80070057 // An argument does not meet the contract of the method.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"E_NOINTERFACE\">\n\t<SymbolicName>COR_E_INVALIDCAST</SymbolicName>\n\t<Comment> 0x80004002 // Indicates a bad cast condition</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"E_OUTOFMEMORY\">\n\t<SymbolicName>COR_E_OUTOFMEMORY</SymbolicName>\n\t<Comment> 0x8007000E // The EE thows this exception when no more memory is avaible to continue execution</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"E_POINTER\">\n\t<SymbolicName>COR_E_NULLREFERENCE</SymbolicName>\n\t<Comment> 0x80004003 // Dereferencing a null reference. In general class libraries should not throw this</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"__HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW)\">\n\t<SymbolicName>COR_E_ARITHMETIC</SymbolicName>\n\t<Comment> 0x80070216 // Overflow or underflow in mathematical operations.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"__HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE)\">\n\t<SymbolicName>COR_E_PATHTOOLONG</SymbolicName>\n\t<Comment> The specified path was too long.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"__HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)\">\n\t<SymbolicName>COR_E_FILENOTFOUND</SymbolicName>\n\t<Comment></Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"__HRESULT_FROM_WIN32(ERROR_HANDLE_EOF)\">\n\t<SymbolicName>COR_E_ENDOFSTREAM</SymbolicName>\n\t<Comment> Thrown when the End of file is reached</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"__HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)\">\n\t<SymbolicName>COR_E_DIRECTORYNOTFOUND</SymbolicName>\n\t<Comment> The specified path couldn't be found.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"__HRESULT_FROM_WIN32(ERROR_STACK_OVERFLOW)\">\n\t<SymbolicName>COR_E_STACKOVERFLOW</SymbolicName>\n\t<Comment> 0x800703E9 // Is raised by the EE when the execution stack overflows as it is attempting to ex</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"_HRESULT_TYPEDEF_(0x8000211DL)\">\n\t<SymbolicName>COR_E_AMBIGUOUSMATCH</SymbolicName>\n\t<Comment> While late binding to a method via reflection, could not resolve between</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"_HRESULT_TYPEDEF_(0x8002000EL)\">\n\t<SymbolicName>COR_E_TARGETPARAMCOUNT</SymbolicName>\n\t<Comment> DISP_E_BADPARAMCOUNT // There was a mismatch between number of arguments provided and the number expected</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"_HRESULT_TYPEDEF_(0x80020012L)\">\n\t<SymbolicName>COR_E_DIVIDEBYZERO</SymbolicName>\n\t<Comment> DISP_E_DIVBYZERO // Attempted to divide a number by zero.</Comment>\n</HRESULT>\n\n<HRESULT NumericValue=\"_HRESULT_TYPEDEF_(0x8007000BL)\">\n\t<SymbolicName>COR_E_BADIMAGEFORMAT</SymbolicName>\n\t<Message>\"The format of a DLL or executable being loaded is invalid.\"</Message>\n\t<Comment> The format of DLL or executable being loaded is invalid.</Comment>\n</HRESULT>\n\n</hc:ResourceStrings>\n</Root>\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corexcep.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*********************************************************************\n **                                                                 **\n ** CorExcep.h - lists the exception codes used by the CLR.         **\n **                                                                 **\n *********************************************************************/\n\n\n#ifndef __COREXCEP_H__\n#define __COREXCEP_H__\n\n// All COM+ exceptions are expressed as a RaiseException with this exception\n// code.  If you change this value, you must also change\n// Exception.cs's _COMPlusExceptionCode value.\n\n#define EXCEPTION_MSVC    0xe06d7363    // 0xe0000000 | 'msc'\n\n#define EXCEPTION_COMPLUS 0xe0434352    // 0xe0000000 | 'CCR'\n\n#define EXCEPTION_HIJACK  0xe0434f4e    // 0xe0000000 | 'COM'+1\n\n#if defined(_DEBUG)\n#define EXCEPTION_INTERNAL_ASSERT 0xe0584d4e // 0xe0000000 | 'XMN'\n                                        // An internal Assert will raise this exception when the config\n                                        // value \"RaiseExceptionOnAssert\" si specified. This is used in\n                                        // stress to facilitate failure triaging.\n#endif\n\n// This is the exception code to report SetupThread failure to caller of reverse pinvoke\n// It is misleading to use our COM+ exception code, since this is not a managed exception.\n// In the end, we picked e0455858 (EXX).\n#define EXCEPTION_EXX     0xe0455858    // 0xe0000000 | 'EXX'\n#endif // __COREXCEP_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corhdr.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** CorHdr.h - contains definitions for the Runtime structures,             **\n**\n\n **            needed to work with metadata.                                **\n **                                                                         **\n *****************************************************************************/\n//\n// The top most managed code structure in a EXE or DLL is the IMAGE_COR20_HEADER\n// see code:#ManagedHeader for more\n\n#ifndef __CORHDR_H__\n#define __CORHDR_H__\n\n#include <stdint.h>\n\n#ifdef _MSC_VER\n#pragma warning(disable:4200) // nonstandard extension used : zero-sized array in struct/union.\n#endif\ntypedef void*  mdScope;                // Obsolete; not used in the runtime.\ntypedef uint32_t mdToken;                // Generic token\n\n\n// Token  definitions\n\n\ntypedef mdToken mdModule;               // Module token (roughly, a scope)\ntypedef mdToken mdTypeRef;              // TypeRef reference (this or other scope)\ntypedef mdToken mdTypeDef;              // TypeDef in this scope\ntypedef mdToken mdFieldDef;             // Field in this scope\ntypedef mdToken mdMethodDef;            // Method in this scope\ntypedef mdToken mdParamDef;             // param token\ntypedef mdToken mdInterfaceImpl;        // interface implementation token\n\ntypedef mdToken mdMemberRef;            // MemberRef (this or other scope)\ntypedef mdToken mdCustomAttribute;      // attribute token\ntypedef mdToken mdPermission;           // DeclSecurity\n\ntypedef mdToken mdSignature;            // Signature object\ntypedef mdToken mdEvent;                // event token\ntypedef mdToken mdProperty;             // property token\n\ntypedef mdToken mdModuleRef;            // Module reference (for the imported modules)\n\n// Assembly tokens.\ntypedef mdToken mdAssembly;             // Assembly token.\ntypedef mdToken mdAssemblyRef;          // AssemblyRef token.\ntypedef mdToken mdFile;                 // File token.\ntypedef mdToken mdExportedType;         // ExportedType token.\ntypedef mdToken mdManifestResource;     // ManifestResource token.\n\ntypedef mdToken mdTypeSpec;             // TypeSpec object\n\ntypedef mdToken mdGenericParam;         // formal parameter to generic type or method\ntypedef mdToken mdMethodSpec;           // instantiation of a generic method\ntypedef mdToken mdGenericParamConstraint; // constraint on a formal generic parameter\n\n// Application string.\ntypedef mdToken mdString;               // User literal string token.\n\ntypedef mdToken mdCPToken;              // constantpool token\n\n#ifndef MACROS_NOT_SUPPORTED\ntypedef uint32_t RID;\n#else\ntypedef unsigned RID;\n#endif // MACROS_NOT_SUPPORTED\n\ntypedef enum ReplacesGeneralNumericDefines\n{\n// Directory entry macro for CLR data.\n#ifndef IMAGE_DIRECTORY_ENTRY_COMHEADER\n    IMAGE_DIRECTORY_ENTRY_COMHEADER     =14,\n#endif // IMAGE_DIRECTORY_ENTRY_COMHEADER\n} ReplacesGeneralNumericDefines;\n\n\n// The COMIMAGE_FLAGS_32BITREQUIRED and COMIMAGE_FLAGS_32BITPREFERRED flags defined below interact as a pair\n// in order to get the performance profile we desire for platform neutral assemblies while retaining backwards\n// compatibility with pre-4.5 runtimes/OSs, which don't know about COMIMAGE_FLAGS_32BITPREFERRED.\n//\n// COMIMAGE_FLAGS_32BITREQUIRED originally meant \"this assembly is x86-only\" (required to distinguish platform\n// neutral assemblies which also mark their PE MachineType as IMAGE_FILE_MACHINE_I386).\n//\n// COMIMAGE_FLAGS_32BITPREFERRED has been added so we can create a sub-class of platform neutral assembly that\n// prefers to be loaded into 32-bit environment for perf reasons, but is still compatible with 64-bit\n// environments.\n//\n// In order to retain maximum backwards compatibility you cannot simply read or write one of these flags.\n// You must treat them as a pair, a two-bit field with the following meanings:\n//\n//  32BITREQUIRED  32BITPREFERRED\n//        0               0         :   no special meaning, MachineType and ILONLY flag determine image requirements\n//        0               1         :   illegal, reserved for future use\n//        1               0         :   image is x86-specific\n//        1               1         :   image is platform neutral and prefers to be loaded 32-bit when possible\n//\n// To simplify manipulation of these flags the following macros are provided below.\n\n#define COR_IS_32BIT_REQUIRED(_flags) \\\n    (((_flags) & (COMIMAGE_FLAGS_32BITREQUIRED|COMIMAGE_FLAGS_32BITPREFERRED)) == (COMIMAGE_FLAGS_32BITREQUIRED))\n\n#define COR_IS_32BIT_PREFERRED(_flags) \\\n    (((_flags) & (COMIMAGE_FLAGS_32BITREQUIRED|COMIMAGE_FLAGS_32BITPREFERRED)) == (COMIMAGE_FLAGS_32BITREQUIRED|COMIMAGE_FLAGS_32BITPREFERRED))\n\n#define COR_SET_32BIT_REQUIRED(_flagsfield) \\\n    do { _flagsfield = (_flagsfield & ~COMIMAGE_FLAGS_32BITPREFERRED) | COMIMAGE_FLAGS_32BITREQUIRED; } while (false)\n\n#define COR_SET_32BIT_PREFERRED(_flagsfield) \\\n    do { _flagsfield |= COMIMAGE_FLAGS_32BITPREFERRED|COMIMAGE_FLAGS_32BITREQUIRED; } while (false)\n\n#define COR_CLEAR_32BIT_REQUIRED(_flagsfield) \\\n    do { _flagsfield &= ~(COMIMAGE_FLAGS_32BITREQUIRED|COMIMAGE_FLAGS_32BITPREFERRED); } while (false)\n\n#define COR_CLEAR_32BIT_PREFERRED(_flagsfield) \\\n    do { _flagsfield &= ~(COMIMAGE_FLAGS_32BITREQUIRED|COMIMAGE_FLAGS_32BITPREFERRED); } while (false)\n\n\n#ifndef __IMAGE_COR20_HEADER_DEFINED__\n#define __IMAGE_COR20_HEADER_DEFINED__\n\ntypedef enum ReplacesCorHdrNumericDefines\n{\n// COM+ Header entry point flags.\n    COMIMAGE_FLAGS_ILONLY               =0x00000001,\n    COMIMAGE_FLAGS_32BITREQUIRED        =0x00000002,    // *** Do not manipulate this bit directly (see notes above)\n    COMIMAGE_FLAGS_IL_LIBRARY           =0x00000004,\n    COMIMAGE_FLAGS_STRONGNAMESIGNED     =0x00000008,\n    COMIMAGE_FLAGS_NATIVE_ENTRYPOINT    =0x00000010,\n    COMIMAGE_FLAGS_TRACKDEBUGDATA       =0x00010000,\n    COMIMAGE_FLAGS_32BITPREFERRED       =0x00020000,    // *** Do not manipulate this bit directly (see notes above)\n\n\n// Version flags for image.\n    COR_VERSION_MAJOR_V2                =2,\n    COR_VERSION_MAJOR                   =COR_VERSION_MAJOR_V2,\n    COR_VERSION_MINOR                   =5,\n    COR_DELETED_NAME_LENGTH             =8,\n    COR_VTABLEGAP_NAME_LENGTH           =8,\n\n// Maximum size of a NativeType descriptor.\n    NATIVE_TYPE_MAX_CB                  =1,\n    COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE=0xFF,\n\n// V-table constants\n    COR_VTABLE_32BIT                    =0x01,          // V-table slots are 32-bits in size.\n    COR_VTABLE_64BIT                    =0x02,          // V-table slots are 64-bits in size.\n    COR_VTABLE_FROM_UNMANAGED           =0x04,          // If set, transition from unmanaged.\n    COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN=0x08,    // NEW\n    COR_VTABLE_CALL_MOST_DERIVED        =0x10,          // Call most derived method described by\n\n// EATJ constants\n    IMAGE_COR_EATJ_THUNK_SIZE           = 32,           // Size of a jump thunk reserved range.\n\n// Max name lengths\n    //@todo: Change to unlimited name lengths.\n    MAX_CLASS_NAME                      =1024,\n    MAX_PACKAGE_NAME                    =1024,\n} ReplacesCorHdrNumericDefines;\n\n//\n// Directory format.\n//\n#ifndef IMAGE_DATA_DIRECTORY_DEFINED\n\n#define IMAGE_DATA_DIRECTORY_DEFINED\ntypedef struct _IMAGE_DATA_DIRECTORY {\n    uint32_t   VirtualAddress;\n    uint32_t   Size;\n} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;\n\n#endif // IMAGE_DATA_DIRECTORY_DEFINED\n\n// #ManagedHeader\n//\n// A managed code EXE or DLL uses the same basic format that unmanaged executables use call the Portable\n// Executable (PE) format. See http://en.wikipedia.org/wiki/Portable_Executable or\n// http://msdn.microsoft.com/msdnmag/issues/02/02/PE/default.aspx for more on this format and RVAs.\n//\n// PE files define fixed table of well known entry pointers call Directory entries. Each entry holds the\n// relative virtual address (RVA) and length of a blob of data within the PE file. You can see these using\n// the command\n//\n// link /dump /headers <EXENAME>\n//\n//\n// Managed code has defined one of these entries (the 14th see code:IMAGE_DIRECTORY_ENTRY_COMHEADER) and the RVA points\n// that the IMAGE_COR20_HEADER.  This header shows up in the previous dump as the following line\n//\n// // Managed code is identified by is following line\n//\n//             2008 [      48] RVA [size] of COM Descriptor Directory\n//\n// The IMAGE_COR20_HEADER is mostly just RVA:Length pairs (pointers) to other interesting data structures.\n// The most important of these is the MetaData tables.   The easiest way of looking at meta-data is using\n// the IlDasm.exe tool.\n//\n// MetaData holds most of the information in the IL image.  The exceptions are resource blobs and the IL\n// instructions streams for individual methods.  Instead the Meta-data for a method holds an RVA to a\n// code:IMAGE_COR_ILMETHOD which holds all the IL stream (and exception handling information).\n//\n// Precompiled (NGEN) images use the same IMAGE_COR20_HEADER but also use the ManagedNativeHeader field to\n// point at structures that only exist in precompiled images.\n//\ntypedef struct IMAGE_COR20_HEADER\n{\n    // Header versioning\n    uint32_t                cb;\n    uint16_t                MajorRuntimeVersion;\n    uint16_t                MinorRuntimeVersion;\n\n    // Symbol table and startup information\n    IMAGE_DATA_DIRECTORY    MetaData;\n    uint32_t                Flags;\n\n\t// The main program if it is an EXE (not used if a DLL?)\n    // If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is not set, EntryPointToken represents a managed entrypoint.\n\t// If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is set, EntryPointRVA represents an RVA to a native entrypoint\n\t// (deprecated for DLLs, use modules constructors instead).\n    union {\n        uint32_t            EntryPointToken;\n        uint32_t            EntryPointRVA;\n    };\n\n    // This is the blob of managed resources. Fetched using code:AssemblyNative.GetResource and\n    // code:PEAssembly.GetResource and accessible from managed code from\n\t// System.Assembly.GetManifestResourceStream.  The meta data has a table that maps names to offsets into\n\t// this blob, so logically the blob is a set of resources.\n    IMAGE_DATA_DIRECTORY    Resources;\n\t// IL assemblies can be signed with a public-private key to validate who created it.  The signature goes\n\t// here if this feature is used.\n    IMAGE_DATA_DIRECTORY    StrongNameSignature;\n\n    IMAGE_DATA_DIRECTORY    CodeManagerTable;\t\t\t// Deprecated, not used\n\t// Used for manged code that has unmanaged code inside it (or exports methods as unmanaged entry points)\n    IMAGE_DATA_DIRECTORY    VTableFixups;\n    IMAGE_DATA_DIRECTORY    ExportAddressTableJumps;\n\n\t// null for ordinary IL images.\n\t// In Ready2Run images it points to a READYTORUN_HEADER.\n    IMAGE_DATA_DIRECTORY    ManagedNativeHeader;\n\n} IMAGE_COR20_HEADER, *PIMAGE_COR20_HEADER;\n\n#else // !__IMAGE_COR20_HEADER_DEFINED__\n\n// <TODO>@TODO: This is required because we pull in the COM+ 2.0 PE header\n// definition from WinNT.h, and these constants have not yet propagated to there.</TODO>\n//\n#define COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN 0x08\n#define COMIMAGE_FLAGS_32BITPREFERRED              0x00020000\n\n#endif // __IMAGE_COR20_HEADER_DEFINED__\n\n\n// The most recent version.\n\n#define COR_CTOR_METHOD_NAME        \".ctor\"\n#define COR_CTOR_METHOD_NAME_W      W(\".ctor\")\n#define COR_CCTOR_METHOD_NAME       \".cctor\"\n#define COR_CCTOR_METHOD_NAME_W     W(\".cctor\")\n\n#define COR_ENUM_FIELD_NAME         \"value__\"\n#define COR_ENUM_FIELD_NAME_W       W(\"value__\")\n\n// The predefined name for deleting a typeDef,MethodDef, FieldDef, Property and Event\n#define COR_DELETED_NAME_A          \"_Deleted\"\n#define COR_DELETED_NAME_W          W(\"_Deleted\")\n#define COR_VTABLEGAP_NAME_A        \"_VtblGap\"\n#define COR_VTABLEGAP_NAME_W        W(\"_VtblGap\")\n\n// We intentionally use strncmp so that we will ignore any suffix\n#define IsDeletedName(strName)      (strncmp(strName, COR_DELETED_NAME_A, COR_DELETED_NAME_LENGTH) == 0)\n#define IsVtblGapName(strName)      (strncmp(strName, COR_VTABLEGAP_NAME_A, COR_VTABLEGAP_NAME_LENGTH) == 0)\n\n// TypeDef/ExportedType attr bits, used by DefineTypeDef.\ntypedef enum CorTypeAttr\n{\n    // Use this mask to retrieve the type visibility information.\n    tdVisibilityMask        =   0x00000007,\n    tdNotPublic             =   0x00000000,     // Class is not public scope.\n    tdPublic                =   0x00000001,     // Class is public scope.\n    tdNestedPublic          =   0x00000002,     // Class is nested with public visibility.\n    tdNestedPrivate         =   0x00000003,     // Class is nested with private visibility.\n    tdNestedFamily          =   0x00000004,     // Class is nested with family visibility.\n    tdNestedAssembly        =   0x00000005,     // Class is nested with assembly visibility.\n    tdNestedFamANDAssem     =   0x00000006,     // Class is nested with family and assembly visibility.\n    tdNestedFamORAssem      =   0x00000007,     // Class is nested with family or assembly visibility.\n\n    // Use this mask to retrieve class layout information\n    tdLayoutMask            =   0x00000018,\n    tdAutoLayout            =   0x00000000,     // Class fields are auto-laid out\n    tdSequentialLayout      =   0x00000008,     // Class fields are laid out sequentially\n    tdExplicitLayout        =   0x00000010,     // Layout is supplied explicitly\n    // end layout mask\n\n    // Use this mask to retrieve class semantics information.\n    tdClassSemanticsMask    =   0x00000020,\n    tdClass                 =   0x00000000,     // Type is a class.\n    tdInterface             =   0x00000020,     // Type is an interface.\n    // end semantics mask\n\n    // Special semantics in addition to class semantics.\n    tdAbstract              =   0x00000080,     // Class is abstract\n    tdSealed                =   0x00000100,     // Class is concrete and may not be extended\n    tdSpecialName           =   0x00000400,     // Class name is special.  Name describes how.\n\n    // Implementation attributes.\n    tdImport                =   0x00001000,     // Class / interface is imported\n    tdSerializable          =   0x00002000,     // The class is Serializable.\n    tdWindowsRuntime        =   0x00004000,     // The type is a Windows Runtime type\n\n    // Use tdStringFormatMask to retrieve string information for native interop\n    tdStringFormatMask      =   0x00030000,\n    tdAnsiClass             =   0x00000000,     // LPTSTR is interpreted as ANSI in this class\n    tdUnicodeClass          =   0x00010000,     // LPTSTR is interpreted as UNICODE\n    tdAutoClass             =   0x00020000,     // LPTSTR is interpreted automatically\n    tdCustomFormatClass     =   0x00030000,     // A non-standard encoding specified by CustomFormatMask\n    tdCustomFormatMask      =   0x00C00000,     // Use this mask to retrieve non-standard encoding information for native interop. The meaning of the values of these 2 bits is unspecified.\n\n    // end string format mask\n\n    tdBeforeFieldInit       =   0x00100000,     // Initialize the class any time before first static field access.\n    tdForwarder             =   0x00200000,     // This ExportedType is a type forwarder.\n\n    // Flags reserved for runtime use.\n    tdReservedMask          =   0x00040800,\n    tdRTSpecialName         =   0x00000800,     // Runtime should check name encoding.\n    tdHasSecurity           =   0x00040000,     // Class has security associate with it.\n} CorTypeAttr;\n\n\n// Macros for accessing the members of the CorTypeAttr.\n#define IsTdNotPublic(x)                    (((x) & tdVisibilityMask) == tdNotPublic)\n#define IsTdPublic(x)                       (((x) & tdVisibilityMask) == tdPublic)\n#define IsTdNestedPublic(x)                 (((x) & tdVisibilityMask) == tdNestedPublic)\n#define IsTdNestedPrivate(x)                (((x) & tdVisibilityMask) == tdNestedPrivate)\n#define IsTdNestedFamily(x)                 (((x) & tdVisibilityMask) == tdNestedFamily)\n#define IsTdNestedAssembly(x)               (((x) & tdVisibilityMask) == tdNestedAssembly)\n#define IsTdNestedFamANDAssem(x)            (((x) & tdVisibilityMask) == tdNestedFamANDAssem)\n#define IsTdNestedFamORAssem(x)             (((x) & tdVisibilityMask) == tdNestedFamORAssem)\n#define IsTdNested(x)                       (((x) & tdVisibilityMask) >= tdNestedPublic)\n\n#define IsTdAutoLayout(x)                   (((x) & tdLayoutMask) == tdAutoLayout)\n#define IsTdSequentialLayout(x)             (((x) & tdLayoutMask) == tdSequentialLayout)\n#define IsTdExplicitLayout(x)               (((x) & tdLayoutMask) == tdExplicitLayout)\n\n#define IsTdClass(x)                        (((x) & tdClassSemanticsMask) == tdClass)\n#define IsTdInterface(x)                    (((x) & tdClassSemanticsMask) == tdInterface)\n\n#define IsTdAbstract(x)                     ((x) & tdAbstract)\n#define IsTdSealed(x)                       ((x) & tdSealed)\n#define IsTdSpecialName(x)                  ((x) & tdSpecialName)\n\n#define IsTdImport(x)                       ((x) & tdImport)\n#define IsTdSerializable(x)                 ((x) & tdSerializable)\n#define IsTdWindowsRuntime(x)               ((x) & tdWindowsRuntime)\n\n#define IsTdAnsiClass(x)                    (((x) & tdStringFormatMask) == tdAnsiClass)\n#define IsTdUnicodeClass(x)                 (((x) & tdStringFormatMask) == tdUnicodeClass)\n#define IsTdAutoClass(x)                    (((x) & tdStringFormatMask) == tdAutoClass)\n#define IsTdCustomFormatClass(x)            (((x) & tdStringFormatMask) == tdCustomFormatClass)\n#define IsTdBeforeFieldInit(x)              ((x) & tdBeforeFieldInit)\n#define IsTdForwarder(x)                    ((x) & tdForwarder)\n\n#define IsTdRTSpecialName(x)                ((x) & tdRTSpecialName)\n#define IsTdHasSecurity(x)                  ((x) & tdHasSecurity)\n\n// MethodDef attr bits, Used by DefineMethod.\ntypedef enum CorMethodAttr\n{\n    // member access mask - Use this mask to retrieve accessibility information.\n    mdMemberAccessMask          =   0x0007,\n    mdPrivateScope              =   0x0000,     // Member not referencable.\n    mdPrivate                   =   0x0001,     // Accessible only by the parent type.\n    mdFamANDAssem               =   0x0002,     // Accessible by sub-types only in this Assembly.\n    mdAssem                     =   0x0003,     // Accessibly by anyone in the Assembly.\n    mdFamily                    =   0x0004,     // Accessible only by type and sub-types.\n    mdFamORAssem                =   0x0005,     // Accessibly by sub-types anywhere, plus anyone in assembly.\n    mdPublic                    =   0x0006,     // Accessibly by anyone who has visibility to this scope.\n    // end member access mask\n\n    // method contract attributes.\n    mdStatic                    =   0x0010,     // Defined on type, else per instance.\n    mdFinal                     =   0x0020,     // Method may not be overridden.\n    mdVirtual                   =   0x0040,     // Method virtual.\n    mdHideBySig                 =   0x0080,     // Method hides by name+sig, else just by name.\n\n    // vtable layout mask - Use this mask to retrieve vtable attributes.\n    mdVtableLayoutMask          =   0x0100,\n    mdReuseSlot                 =   0x0000,     // The default.\n    mdNewSlot                   =   0x0100,     // Method always gets a new slot in the vtable.\n    // end vtable layout mask\n\n    // method implementation attributes.\n    mdCheckAccessOnOverride     =   0x0200,     // Overridability is the same as the visibility.\n    mdAbstract                  =   0x0400,     // Method does not provide an implementation.\n    mdSpecialName               =   0x0800,     // Method is special.  Name describes how.\n\n    // interop attributes\n    mdPinvokeImpl               =   0x2000,     // Implementation is forwarded through pinvoke.\n    mdUnmanagedExport           =   0x0008,     // Managed method exported via thunk to unmanaged code.\n\n    // Reserved flags for runtime use only.\n    mdReservedMask              =   0xd000,\n    mdRTSpecialName             =   0x1000,     // Runtime should check name encoding.\n    mdHasSecurity               =   0x4000,     // Method has security associate with it.\n    mdRequireSecObject          =   0x8000,     // Method calls another method containing security code.\n\n} CorMethodAttr;\n\n// Macros for accessing the members of CorMethodAttr.\n#define IsMdPrivateScope(x)                 (((x) & mdMemberAccessMask) == mdPrivateScope)\n#define IsMdPrivate(x)                      (((x) & mdMemberAccessMask) == mdPrivate)\n#define IsMdFamANDAssem(x)                  (((x) & mdMemberAccessMask) == mdFamANDAssem)\n#define IsMdAssem(x)                        (((x) & mdMemberAccessMask) == mdAssem)\n#define IsMdFamily(x)                       (((x) & mdMemberAccessMask) == mdFamily)\n#define IsMdFamORAssem(x)                   (((x) & mdMemberAccessMask) == mdFamORAssem)\n#define IsMdPublic(x)                       (((x) & mdMemberAccessMask) == mdPublic)\n\n#define IsMdStatic(x)                       ((x) & mdStatic)\n#define IsMdFinal(x)                        ((x) & mdFinal)\n#define IsMdVirtual(x)                      ((x) & mdVirtual)\n#define IsMdHideBySig(x)                    ((x) & mdHideBySig)\n\n#define IsMdReuseSlot(x)                    (((x) & mdVtableLayoutMask) == mdReuseSlot)\n#define IsMdNewSlot(x)                      (((x) & mdVtableLayoutMask) == mdNewSlot)\n\n#define IsMdCheckAccessOnOverride(x)        ((x) & mdCheckAccessOnOverride)\n#define IsMdAbstract(x)                     ((x) & mdAbstract)\n#define IsMdSpecialName(x)                  ((x) & mdSpecialName)\n\n#define IsMdPinvokeImpl(x)                  ((x) & mdPinvokeImpl)\n#define IsMdUnmanagedExport(x)              ((x) & mdUnmanagedExport)\n\n#define IsMdRTSpecialName(x)                ((x) & mdRTSpecialName)\n#define IsMdInstanceInitializer(x, str)     (((x) & mdRTSpecialName) && !strcmp((str), COR_CTOR_METHOD_NAME))\n#define IsMdInstanceInitializerW(x, str)    (((x) & mdRTSpecialName) && !wcscmp((str), COR_CTOR_METHOD_NAME_W))\n#define IsMdClassConstructor(x, str)        (((x) & mdRTSpecialName) && !strcmp((str), COR_CCTOR_METHOD_NAME))\n#define IsMdClassConstructorW(x, str)       (((x) & mdRTSpecialName) && !wcscmp((str), COR_CCTOR_METHOD_NAME_W))\n#define IsMdHasSecurity(x)                  ((x) & mdHasSecurity)\n#define IsMdRequireSecObject(x)             ((x) & mdRequireSecObject)\n\n// FieldDef attr bits, used by DefineField.\ntypedef enum CorFieldAttr\n{\n    // member access mask - Use this mask to retrieve accessibility information.\n    fdFieldAccessMask           =   0x0007,\n    fdPrivateScope              =   0x0000,     // Member not referencable.\n    fdPrivate                   =   0x0001,     // Accessible only by the parent type.\n    fdFamANDAssem               =   0x0002,     // Accessible by sub-types only in this Assembly.\n    fdAssembly                  =   0x0003,     // Accessibly by anyone in the Assembly.\n    fdFamily                    =   0x0004,     // Accessible only by type and sub-types.\n    fdFamORAssem                =   0x0005,     // Accessibly by sub-types anywhere, plus anyone in assembly.\n    fdPublic                    =   0x0006,     // Accessibly by anyone who has visibility to this scope.\n    // end member access mask\n\n    // field contract attributes.\n    fdStatic                    =   0x0010,     // Defined on type, else per instance.\n    fdInitOnly                  =   0x0020,     // Field may only be initialized, not written to after init.\n    fdLiteral                   =   0x0040,     // Value is compile time constant.\n    fdNotSerialized             =   0x0080,     // Field does not have to be serialized when type is remoted.\n\n    fdSpecialName               =   0x0200,     // field is special.  Name describes how.\n\n    // interop attributes\n    fdPinvokeImpl               =   0x2000,     // Implementation is forwarded through pinvoke.\n\n    // Reserved flags for runtime use only.\n    fdReservedMask              =   0x9500,\n    fdRTSpecialName             =   0x0400,     // Runtime(metadata internal APIs) should check name encoding.\n    fdHasFieldMarshal           =   0x1000,     // Field has marshalling information.\n    fdHasDefault                =   0x8000,     // Field has default.\n    fdHasFieldRVA               =   0x0100,     // Field has RVA.\n} CorFieldAttr;\n\n// Macros for accessing the members of CorFieldAttr.\n#define IsFdPrivateScope(x)                 (((x) & fdFieldAccessMask) == fdPrivateScope)\n#define IsFdPrivate(x)                      (((x) & fdFieldAccessMask) == fdPrivate)\n#define IsFdFamANDAssem(x)                  (((x) & fdFieldAccessMask) == fdFamANDAssem)\n#define IsFdAssembly(x)                     (((x) & fdFieldAccessMask) == fdAssembly)\n#define IsFdFamily(x)                       (((x) & fdFieldAccessMask) == fdFamily)\n#define IsFdFamORAssem(x)                   (((x) & fdFieldAccessMask) == fdFamORAssem)\n#define IsFdPublic(x)                       (((x) & fdFieldAccessMask) == fdPublic)\n\n#define IsFdStatic(x)                       ((x) & fdStatic)\n#define IsFdInitOnly(x)                     ((x) & fdInitOnly)\n#define IsFdLiteral(x)                      ((x) & fdLiteral)\n#define IsFdNotSerialized(x)                ((x) & fdNotSerialized)\n\n#define IsFdPinvokeImpl(x)                  ((x) & fdPinvokeImpl)\n#define IsFdSpecialName(x)                  ((x) & fdSpecialName)\n#define IsFdHasFieldRVA(x)                  ((x) & fdHasFieldRVA)\n\n#define IsFdRTSpecialName(x)                ((x) & fdRTSpecialName)\n#define IsFdHasFieldMarshal(x)              ((x) & fdHasFieldMarshal)\n#define IsFdHasDefault(x)                   ((x) & fdHasDefault)\n\n// Param attr bits, used by DefineParam.\ntypedef enum CorParamAttr\n{\n    pdIn                        =   0x0001,     // Param is [In]\n    pdOut                       =   0x0002,     // Param is [out]\n    pdOptional                  =   0x0010,     // Param is optional\n\n    // Reserved flags for Runtime use only.\n    pdReservedMask              =   0xf000,\n    pdHasDefault                =   0x1000,     // Param has default value.\n    pdHasFieldMarshal           =   0x2000,     // Param has FieldMarshal.\n\n    pdUnused                    =   0xcfe0,\n} CorParamAttr;\n\n// Macros for accessing the members of CorParamAttr.\n#define IsPdIn(x)                           ((x) & pdIn)\n#define IsPdOut(x)                          ((x) & pdOut)\n#define IsPdOptional(x)                     ((x) & pdOptional)\n\n#define IsPdHasDefault(x)                   ((x) & pdHasDefault)\n#define IsPdHasFieldMarshal(x)              ((x) & pdHasFieldMarshal)\n\n\n// Property attr bits, used by DefineProperty.\ntypedef enum CorPropertyAttr\n{\n    prSpecialName           =   0x0200,     // property is special.  Name describes how.\n\n    // Reserved flags for Runtime use only.\n    prReservedMask          =   0xf400,\n    prRTSpecialName         =   0x0400,     // Runtime(metadata internal APIs) should check name encoding.\n    prHasDefault            =   0x1000,     // Property has default\n\n    prUnused                =   0xe9ff,\n} CorPropertyAttr;\n\n// Macros for accessing the members of CorPropertyAttr.\n#define IsPrSpecialName(x)                  ((x) & prSpecialName)\n\n#define IsPrRTSpecialName(x)                ((x) & prRTSpecialName)\n#define IsPrHasDefault(x)                   ((x) & prHasDefault)\n\n// Event attr bits, used by DefineEvent.\ntypedef enum CorEventAttr\n{\n    evSpecialName           =   0x0200,     // event is special.  Name describes how.\n\n    // Reserved flags for Runtime use only.\n    evReservedMask          =   0x0400,\n    evRTSpecialName         =   0x0400,     // Runtime(metadata internal APIs) should check name encoding.\n} CorEventAttr;\n\n// Macros for accessing the members of CorEventAttr.\n#define IsEvSpecialName(x)                  ((x) & evSpecialName)\n\n#define IsEvRTSpecialName(x)                ((x) & evRTSpecialName)\n\n\n// MethodSemantic attr bits, used by DefineProperty, DefineEvent.\ntypedef enum CorMethodSemanticsAttr\n{\n    msSetter    =   0x0001,     // Setter for property\n    msGetter    =   0x0002,     // Getter for property\n    msOther     =   0x0004,     // other method for property or event\n    msAddOn     =   0x0008,     // AddOn method for event\n    msRemoveOn  =   0x0010,     // RemoveOn method for event\n    msFire      =   0x0020,     // Fire method for event\n} CorMethodSemanticsAttr;\n\n// Macros for accessing the members of CorMethodSemanticsAttr.\n#define IsMsSetter(x)                       ((x) & msSetter)\n#define IsMsGetter(x)                       ((x) & msGetter)\n#define IsMsOther(x)                        ((x) & msOther)\n#define IsMsAddOn(x)                        ((x) & msAddOn)\n#define IsMsRemoveOn(x)                     ((x) & msRemoveOn)\n#define IsMsFire(x)                         ((x) & msFire)\n\n\n// DeclSecurity attr bits, used by DefinePermissionSet.\ntypedef enum CorDeclSecurity\n{\n    dclActionMask               =   0x001f,     // Mask allows growth of enum.\n    dclActionNil                =   0x0000,     //\n    dclRequest                  =   0x0001,     //\n    dclDemand                   =   0x0002,     //\n    dclAssert                   =   0x0003,     //\n    dclDeny                     =   0x0004,     //\n    dclPermitOnly               =   0x0005,     //\n    dclLinktimeCheck            =   0x0006,     //\n    dclInheritanceCheck         =   0x0007,     //\n    dclRequestMinimum           =   0x0008,     //\n    dclRequestOptional          =   0x0009,     //\n    dclRequestRefuse            =   0x000a,     //\n    dclPrejitGrant              =   0x000b,     // Persisted grant set at prejit time\n    dclPrejitDenied             =   0x000c,     // Persisted denied set at prejit time\n    dclNonCasDemand             =   0x000d,     //\n    dclNonCasLinkDemand         =   0x000e,     //\n    dclNonCasInheritance        =   0x000f,     //\n    dclMaximumValue             =   0x000f,     // Maximum legal value\n} CorDeclSecurity;\n\n// Macros for accessing the members of CorDeclSecurity.\n#define IsDclActionNil(x)                   (((x) & dclActionMask) == dclActionNil)\n\n// Is this a demand that can trigger a stackwalk?\n#define IsDclActionAnyStackModifier(x)              ((((x) & dclActionMask) == dclAssert) || \\\n                                                    (((x) & dclActionMask) == dclDeny)  || \\\n                                                    (((x) & dclActionMask) == dclPermitOnly))\n\n// Is this an assembly level attribute (i.e. not applicable on Type/Member)?\n#define IsAssemblyDclAction(x)              (((x) >= dclRequestMinimum)  && \\\n                                             ((x) <= dclRequestRefuse))\n\n// Is this an NGen only attribute?\n#define IsNGenOnlyDclAction(x)              (((x) == dclPrejitGrant)  || \\\n                                             ((x) == dclPrejitDenied))\n\n\n// MethodImpl attr bits, used by DefineMethodImpl.\ntypedef enum CorMethodImpl\n{\n    // code impl mask\n    miCodeTypeMask       =   0x0003,   // Flags about code type.\n    miIL                 =   0x0000,   // Method impl is IL.\n    miNative             =   0x0001,   // Method impl is native.\n    miOPTIL              =   0x0002,   // Method impl is OPTIL\n    miRuntime            =   0x0003,   // Method impl is provided by the runtime.\n    // end code impl mask\n\n    // managed mask\n    miManagedMask        =   0x0004,   // Flags specifying whether the code is managed or unmanaged.\n    miUnmanaged          =   0x0004,   // Method impl is unmanaged, otherwise managed.\n    miManaged            =   0x0000,   // Method impl is managed.\n    // end managed mask\n\n    // implementation info and interop\n    miForwardRef         =   0x0010,   // Indicates method is defined; used primarily in merge scenarios.\n    miPreserveSig        =   0x0080,   // Indicates method sig is not to be mangled to do HRESULT conversion.\n\n    miInternalCall       =   0x1000,   // Reserved for internal use.\n\n    miSynchronized       =   0x0020,   // Method is single threaded through the body.\n    miNoInlining         =   0x0008,   // Method may not be inlined.\n    miAggressiveInlining =   0x0100,   // Method should be inlined if possible.\n    miNoOptimization     =   0x0040,   // Method may not be optimized.\n    miAggressiveOptimization = 0x0200, // Method may contain hot code and should be aggressively optimized.\n\n    // These are the flags that are allowed in MethodImplAttribute's Value\n    // property. This should include everything above except the code impl\n    // flags (which are used for MethodImplAttribute's MethodCodeType field).\n    miUserMask           =   miManagedMask | miForwardRef | miPreserveSig |\n                             miInternalCall | miSynchronized |\n                             miNoInlining | miAggressiveInlining |\n                             miNoOptimization | miAggressiveOptimization,\n\n    miMaxMethodImplVal   =   0xffff,   // Range check value\n} CorMethodImpl;\n\n// Macros for accessing the members of CorMethodImpl.\n#define IsMiIL(x)                           (((x) & miCodeTypeMask) == miIL)\n#define IsMiNative(x)                       (((x) & miCodeTypeMask) == miNative)\n#define IsMiOPTIL(x)                        (((x) & miCodeTypeMask) == miOPTIL)\n#define IsMiRuntime(x)                      (((x) & miCodeTypeMask) == miRuntime)\n\n#define IsMiUnmanaged(x)                    (((x) & miManagedMask) == miUnmanaged)\n#define IsMiManaged(x)                      (((x) & miManagedMask) == miManaged)\n\n#define IsMiForwardRef(x)                   ((x) & miForwardRef)\n#define IsMiPreserveSig(x)                  ((x) & miPreserveSig)\n\n#define IsMiInternalCall(x)                 ((x) & miInternalCall)\n\n#define IsMiSynchronized(x)                 ((x) & miSynchronized)\n#define IsMiNoInlining(x)                   ((x) & miNoInlining)\n#define IsMiAggressiveInlining(x)           ((x) & miAggressiveInlining)\n#define IsMiNoOptimization(x)               ((x) & miNoOptimization)\n#define IsMiAggressiveOptimization(x)       (((x) & (miAggressiveOptimization | miNoOptimization)) == miAggressiveOptimization)\n\n// PinvokeMap attr bits, used by DefinePinvokeMap.\ntypedef enum  CorPinvokeMap\n{\n    pmNoMangle          = 0x0001,   // Pinvoke is to use the member name as specified.\n\n    // Use this mask to retrieve the CharSet information.\n    pmCharSetMask       = 0x0006,\n    pmCharSetNotSpec    = 0x0000,\n    pmCharSetAnsi       = 0x0002,\n    pmCharSetUnicode    = 0x0004,\n    pmCharSetAuto       = 0x0006,\n\n\n    pmBestFitUseAssem   = 0x0000,\n    pmBestFitEnabled    = 0x0010,\n    pmBestFitDisabled   = 0x0020,\n    pmBestFitMask       = 0x0030,\n\n    pmThrowOnUnmappableCharUseAssem   = 0x0000,\n    pmThrowOnUnmappableCharEnabled    = 0x1000,\n    pmThrowOnUnmappableCharDisabled   = 0x2000,\n    pmThrowOnUnmappableCharMask       = 0x3000,\n\n    pmSupportsLastError = 0x0040,   // Information about target function. Not relevant for fields.\n\n    // None of the calling convention flags is relevant for fields.\n    pmCallConvMask      = 0x0700,\n    pmCallConvWinapi    = 0x0100,   // Pinvoke will use native callconv appropriate to target windows platform.\n    pmCallConvCdecl     = 0x0200,\n    pmCallConvStdcall   = 0x0300,\n    pmCallConvThiscall  = 0x0400,   // In M9, pinvoke will raise exception.\n    pmCallConvFastcall  = 0x0500,\n\n    pmMaxValue          = 0xFFFF,\n} CorPinvokeMap;\n\n// Macros for accessing the members of CorPinvokeMap\n#define IsPmNoMangle(x)                     ((x) & pmNoMangle)\n\n#define IsPmCharSetNotSpec(x)               (((x) & pmCharSetMask) == pmCharSetNotSpec)\n#define IsPmCharSetAnsi(x)                  (((x) & pmCharSetMask) == pmCharSetAnsi)\n#define IsPmCharSetUnicode(x)               (((x) & pmCharSetMask) == pmCharSetUnicode)\n#define IsPmCharSetAuto(x)                  (((x) & pmCharSetMask) == pmCharSetAuto)\n\n#define IsPmSupportsLastError(x)            ((x) & pmSupportsLastError)\n\n#define IsPmCallConvWinapi(x)               (((x) & pmCallConvMask) == pmCallConvWinapi)\n#define IsPmCallConvCdecl(x)                (((x) & pmCallConvMask) == pmCallConvCdecl)\n#define IsPmCallConvStdcall(x)              (((x) & pmCallConvMask) == pmCallConvStdcall)\n#define IsPmCallConvThiscall(x)             (((x) & pmCallConvMask) == pmCallConvThiscall)\n#define IsPmCallConvFastcall(x)             (((x) & pmCallConvMask) == pmCallConvFastcall)\n\n#define IsPmBestFitEnabled(x)                 (((x) & pmBestFitMask) == pmBestFitEnabled)\n#define IsPmBestFitDisabled(x)                (((x) & pmBestFitMask) == pmBestFitDisabled)\n#define IsPmBestFitUseAssem(x)                (((x) & pmBestFitMask) == pmBestFitUseAssem)\n\n#define IsPmThrowOnUnmappableCharEnabled(x)   (((x) & pmThrowOnUnmappableCharMask) == pmThrowOnUnmappableCharEnabled)\n#define IsPmThrowOnUnmappableCharDisabled(x)  (((x) & pmThrowOnUnmappableCharMask) == pmThrowOnUnmappableCharDisabled)\n#define IsPmThrowOnUnmappableCharUseAssem(x)  (((x) & pmThrowOnUnmappableCharMask) == pmThrowOnUnmappableCharUseAssem)\n\n// Assembly attr bits, used by DefineAssembly.\ntypedef enum CorAssemblyFlags\n{\n    afPublicKey             =   0x0001,     // The assembly ref holds the full (unhashed) public key.\n\n    afPA_None               =   0x0000,     // Processor Architecture unspecified\n    afPA_MSIL               =   0x0010,     // Processor Architecture: neutral (PE32)\n    afPA_x86                =   0x0020,     // Processor Architecture: x86 (PE32)\n    afPA_IA64               =   0x0030,     // Processor Architecture: Itanium (PE32+)\n    afPA_AMD64              =   0x0040,     // Processor Architecture: AMD X64 (PE32+)\n    afPA_ARM                =   0x0050,     // Processor Architecture: ARM (PE32)\n    afPA_ARM64              =   0x0060,     // Processor Architecture: ARM64 (PE32+)\n    afPA_NoPlatform         =   0x0070,      // applies to any platform but cannot run on any (e.g. reference assembly), should not have \"specified\" set\n    afPA_Specified          =   0x0080,     // Propagate PA flags to AssemblyRef record\n    afPA_Mask               =   0x0070,     // Bits describing the processor architecture\n    afPA_FullMask           =   0x00F0,     // Bits describing the PA incl. Specified\n    afPA_Shift              =   0x0004,     // NOT A FLAG, shift count in PA flags <--> index conversion\n\n    afEnableJITcompileTracking   =  0x8000, // From \"DebuggableAttribute\".\n    afDisableJITcompileOptimizer =  0x4000, // From \"DebuggableAttribute\".\n    afDebuggableAttributeMask    =  0xc000,\n\n    afRetargetable          =   0x0100,     // The assembly can be retargeted (at runtime) to an\n                                            //  assembly from a different publisher.\n\n    afContentType_Default         = 0x0000,\n    afContentType_WindowsRuntime  = 0x0200,\n    afContentType_Mask            = 0x0E00, // Bits describing ContentType\n} CorAssemblyFlags;\n\n// Macros for accessing the members of CorAssemblyFlags.\n#define IsAfRetargetable(x)                 ((x) & afRetargetable)\n#define IsAfContentType_Default(x)          (((x) & afContentType_Mask) == afContentType_Default)\n#define IsAfContentType_WindowsRuntime(x)   (((x) & afContentType_Mask) == afContentType_WindowsRuntime)\n\n// Macros for accessing the Processor Architecture flags of CorAssemblyFlags.\n#define IsAfPA_MSIL(x) (((x) & afPA_Mask) == afPA_MSIL)\n#define IsAfPA_x86(x) (((x) & afPA_Mask) == afPA_x86)\n#define IsAfPA_IA64(x) (((x) & afPA_Mask) == afPA_IA64)\n#define IsAfPA_AMD64(x) (((x) & afPA_Mask) == afPA_AMD64)\n#define IsAfPA_ARM(x) (((x) & afPA_Mask) == afPA_ARM)\n#define IsAfPA_ARM64(x) (((x) & afPA_Mask) == afPA_ARM64)\n#define IsAfPA_NoPlatform(x) (((x) & afPA_FullMask) == afPA_NoPlatform)\n#define IsAfPA_Specified(x) ((x) & afPA_Specified)\n#define PAIndex(x) (((x) & afPA_Mask) >> afPA_Shift)\n#define PAFlag(x)  (((x) << afPA_Shift) & afPA_Mask)\n#define PrepareForSaving(x) ((x) & (((x) & afPA_Specified) ? ~afPA_Specified : ~afPA_FullMask))\n\n#define IsAfEnableJITcompileTracking(x)     ((x) & afEnableJITcompileTracking)\n#define IsAfDisableJITcompileOptimizer(x)   ((x) & afDisableJITcompileOptimizer)\n\n// Macros for accessing the public key flags of CorAssemblyFlags.\n#define IsAfPublicKey(x)                    ((x) & afPublicKey)\n#define IsAfPublicKeyToken(x)               (((x) & afPublicKey) == 0)\n\n\n// ManifestResource attr bits, used by DefineManifestResource.\ntypedef enum CorManifestResourceFlags\n{\n    mrVisibilityMask        =   0x0007,\n    mrPublic                =   0x0001,     // The Resource is exported from the Assembly.\n    mrPrivate               =   0x0002,     // The Resource is private to the Assembly.\n} CorManifestResourceFlags;\n\n// Macros for accessing the members of CorManifestResourceFlags.\n#define IsMrPublic(x)                       (((x) & mrVisibilityMask) == mrPublic)\n#define IsMrPrivate(x)                      (((x) & mrVisibilityMask) == mrPrivate)\n\n\n// File attr bits, used by DefineFile.\ntypedef enum CorFileFlags\n{\n    ffContainsMetaData      =   0x0000,     // This is not a resource file\n    ffContainsNoMetaData    =   0x0001,     // This is a resource file or other non-metadata-containing file\n} CorFileFlags;\n\n// Macros for accessing the members of CorFileFlags.\n#define IsFfContainsMetaData(x)             (!((x) & ffContainsNoMetaData))\n#define IsFfContainsNoMetaData(x)           ((x) & ffContainsNoMetaData)\n\n// PE file kind bits, returned by IMetaDataImport2::GetPEKind()\ntypedef enum CorPEKind\n{\n    peNot       = 0x00000000,   // not a PE file\n    peILonly    = 0x00000001,   // flag IL_ONLY is set in COR header\n    pe32BitRequired=0x00000002,  // flag 32BITREQUIRED is set and 32BITPREFERRED is clear in COR header\n    pe32Plus    = 0x00000004,   // PE32+ file (64 bit)\n    pe32Unmanaged=0x00000008,    // PE32 without COR header\n    pe32BitPreferred=0x00000010  // flags 32BITREQUIRED and 32BITPREFERRED are set in COR header\n} CorPEKind;\n\n\n// GenericParam bits, used by DefineGenericParam.\ntypedef enum CorGenericParamAttr\n{\n    // Variance of type parameters, only applicable to generic parameters\n    // for generic interfaces and delegates\n    gpVarianceMask          =   0x0003,\n    gpNonVariant            =   0x0000,\n    gpCovariant             =   0x0001,\n    gpContravariant         =   0x0002,\n\n    // Special constraints, applicable to any type parameters\n    gpSpecialConstraintMask =  0x003C,\n    gpNoSpecialConstraint   =   0x0000,\n    gpReferenceTypeConstraint = 0x0004,      // type argument must be a reference type\n    gpNotNullableValueTypeConstraint   =   0x0008,      // type argument must be a value type but not Nullable\n    gpDefaultConstructorConstraint = 0x0010, // type argument must have a public default constructor\n    gpAcceptByRefLike = 0x0020, // type argument can be ByRefLike\n} CorGenericParamAttr;\n\n// structures and enums moved from COR.H\ntypedef uint8_t COR_SIGNATURE;\n\ntypedef COR_SIGNATURE* PCOR_SIGNATURE;      // pointer to a cor sig.  Not void* so that\n                                            // the bytes can be incremented easily\ntypedef const COR_SIGNATURE* PCCOR_SIGNATURE;\n\n\ntypedef const char * MDUTF8CSTR;\ntypedef char * MDUTF8STR;\n\n//*****************************************************************************\n//\n// Element type for Cor signature\n//\n//*****************************************************************************\n\ntypedef enum CorElementType\n{\n    ELEMENT_TYPE_END            = 0x00,\n    ELEMENT_TYPE_VOID           = 0x01,\n    ELEMENT_TYPE_BOOLEAN        = 0x02,\n    ELEMENT_TYPE_CHAR           = 0x03,\n    ELEMENT_TYPE_I1             = 0x04,\n    ELEMENT_TYPE_U1             = 0x05,\n    ELEMENT_TYPE_I2             = 0x06,\n    ELEMENT_TYPE_U2             = 0x07,\n    ELEMENT_TYPE_I4             = 0x08,\n    ELEMENT_TYPE_U4             = 0x09,\n    ELEMENT_TYPE_I8             = 0x0a,\n    ELEMENT_TYPE_U8             = 0x0b,\n    ELEMENT_TYPE_R4             = 0x0c,\n    ELEMENT_TYPE_R8             = 0x0d,\n    ELEMENT_TYPE_STRING         = 0x0e,\n\n    // every type above PTR will be simple type\n    ELEMENT_TYPE_PTR            = 0x0f,     // PTR <type>\n    ELEMENT_TYPE_BYREF          = 0x10,     // BYREF <type>\n\n    // Please use ELEMENT_TYPE_VALUETYPE. ELEMENT_TYPE_VALUECLASS is deprecated.\n    ELEMENT_TYPE_VALUETYPE      = 0x11,     // VALUETYPE <class Token>\n    ELEMENT_TYPE_CLASS          = 0x12,     // CLASS <class Token>\n    ELEMENT_TYPE_VAR            = 0x13,     // a class type variable VAR <number>\n    ELEMENT_TYPE_ARRAY          = 0x14,     // MDARRAY <type> <rank> <bcount> <bound1> ... <lbcount> <lb1> ...\n    ELEMENT_TYPE_GENERICINST    = 0x15,     // GENERICINST <generic type> <argCnt> <arg1> ... <argn>\n    ELEMENT_TYPE_TYPEDBYREF     = 0x16,     // TYPEDREF  (it takes no args) a typed reference to some other type\n\n    ELEMENT_TYPE_I              = 0x18,     // native integer size\n    ELEMENT_TYPE_U              = 0x19,     // native unsigned integer size\n    ELEMENT_TYPE_FNPTR          = 0x1b,     // FNPTR <complete sig for the function including calling convention>\n    ELEMENT_TYPE_OBJECT         = 0x1c,     // Shortcut for System.Object\n    ELEMENT_TYPE_SZARRAY        = 0x1d,     // Shortcut for single dimension zero lower bound array\n                                            // SZARRAY <type>\n    ELEMENT_TYPE_MVAR           = 0x1e,     // a method type variable MVAR <number>\n\n    // This is only for binding\n    ELEMENT_TYPE_CMOD_REQD      = 0x1f,     // required C modifier : E_T_CMOD_REQD <mdTypeRef/mdTypeDef>\n    ELEMENT_TYPE_CMOD_OPT       = 0x20,     // optional C modifier : E_T_CMOD_OPT <mdTypeRef/mdTypeDef>\n\n    // This is for signatures generated internally (which will not be persisted in any way).\n    ELEMENT_TYPE_INTERNAL       = 0x21,     // INTERNAL <typehandle>\n\n    // Note that this is the max of base type excluding modifiers\n    ELEMENT_TYPE_MAX            = 0x22,     // first invalid element type\n\n\n    ELEMENT_TYPE_MODIFIER       = 0x40,\n    ELEMENT_TYPE_SENTINEL       = 0x01 | ELEMENT_TYPE_MODIFIER, // sentinel for varargs\n    ELEMENT_TYPE_PINNED         = 0x05 | ELEMENT_TYPE_MODIFIER,\n\n} CorElementType;\n\n\n//*****************************************************************************\n//\n// Serialization types for Custom attribute support\n//\n//*****************************************************************************\n\ntypedef enum CorSerializationType\n{\n    SERIALIZATION_TYPE_UNDEFINED    = 0,\n    SERIALIZATION_TYPE_BOOLEAN      = ELEMENT_TYPE_BOOLEAN,\n    SERIALIZATION_TYPE_CHAR         = ELEMENT_TYPE_CHAR,\n    SERIALIZATION_TYPE_I1           = ELEMENT_TYPE_I1,\n    SERIALIZATION_TYPE_U1           = ELEMENT_TYPE_U1,\n    SERIALIZATION_TYPE_I2           = ELEMENT_TYPE_I2,\n    SERIALIZATION_TYPE_U2           = ELEMENT_TYPE_U2,\n    SERIALIZATION_TYPE_I4           = ELEMENT_TYPE_I4,\n    SERIALIZATION_TYPE_U4           = ELEMENT_TYPE_U4,\n    SERIALIZATION_TYPE_I8           = ELEMENT_TYPE_I8,\n    SERIALIZATION_TYPE_U8           = ELEMENT_TYPE_U8,\n    SERIALIZATION_TYPE_R4           = ELEMENT_TYPE_R4,\n    SERIALIZATION_TYPE_R8           = ELEMENT_TYPE_R8,\n    SERIALIZATION_TYPE_STRING       = ELEMENT_TYPE_STRING,\n    SERIALIZATION_TYPE_SZARRAY      = ELEMENT_TYPE_SZARRAY, // Shortcut for single dimension zero lower bound array\n    SERIALIZATION_TYPE_TYPE         = 0x50,\n    SERIALIZATION_TYPE_TAGGED_OBJECT= 0x51,\n    SERIALIZATION_TYPE_FIELD        = 0x53,\n    SERIALIZATION_TYPE_PROPERTY     = 0x54,\n    SERIALIZATION_TYPE_ENUM         = 0x55\n} CorSerializationType;\n\n//\n// Calling convention flags.\n//\n\ntypedef enum CorUnmanagedCallingConvention\n{\n    IMAGE_CEE_UNMANAGED_CALLCONV_C         = 0x1,\n    IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL   = 0x2,\n    IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL  = 0x3,\n    IMAGE_CEE_UNMANAGED_CALLCONV_FASTCALL  = 0x4,\n} CorUnmanagedCallingConvention;\n\ntypedef enum CorCallingConvention\n{\n    IMAGE_CEE_CS_CALLCONV_DEFAULT       = 0x0,\n    IMAGE_CEE_CS_CALLCONV_C         = IMAGE_CEE_UNMANAGED_CALLCONV_C,\n    IMAGE_CEE_CS_CALLCONV_STDCALL   = IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL,\n    IMAGE_CEE_CS_CALLCONV_THISCALL  = IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL,\n    IMAGE_CEE_CS_CALLCONV_FASTCALL  = IMAGE_CEE_UNMANAGED_CALLCONV_FASTCALL,\n    IMAGE_CEE_CS_CALLCONV_VARARG        = 0x5,\n    IMAGE_CEE_CS_CALLCONV_FIELD         = 0x6,\n    IMAGE_CEE_CS_CALLCONV_LOCAL_SIG     = 0x7,\n    IMAGE_CEE_CS_CALLCONV_PROPERTY      = 0x8,\n    IMAGE_CEE_CS_CALLCONV_UNMANAGED     = 0x9,  // Unmanaged calling convention encoded as modopts\n    IMAGE_CEE_CS_CALLCONV_GENERICINST   = 0xa,  // generic method instantiation\n    IMAGE_CEE_CS_CALLCONV_NATIVEVARARG  = 0xb,  // used ONLY for 64bit vararg PInvoke calls\n    IMAGE_CEE_CS_CALLCONV_MAX           = 0xc,  // first invalid calling convention\n\n\n        // The high bits of the calling convention convey additional info\n    IMAGE_CEE_CS_CALLCONV_MASK      = 0x0f,  // Calling convention is bottom 4 bits\n    IMAGE_CEE_CS_CALLCONV_HASTHIS   = 0x20,  // Top bit indicates a 'this' parameter\n    IMAGE_CEE_CS_CALLCONV_EXPLICITTHIS = 0x40,  // This parameter is explicitly in the signature\n    IMAGE_CEE_CS_CALLCONV_GENERIC   = 0x10,  // Generic method sig with explicit number of type arguments (precedes ordinary parameter count)\n    // 0x80 is reserved for internal use\n} CorCallingConvention;\n\n#define IMAGE_CEE_CS_CALLCONV_INSTANTIATION IMAGE_CEE_CS_CALLCONV_GENERICINST\n\n\ntypedef enum CorArgType\n{\n    IMAGE_CEE_CS_END        = 0x0,\n    IMAGE_CEE_CS_VOID       = 0x1,\n    IMAGE_CEE_CS_I4         = 0x2,\n    IMAGE_CEE_CS_I8         = 0x3,\n    IMAGE_CEE_CS_R4         = 0x4,\n    IMAGE_CEE_CS_R8         = 0x5,\n    IMAGE_CEE_CS_PTR        = 0x6,\n    IMAGE_CEE_CS_OBJECT     = 0x7,\n    IMAGE_CEE_CS_STRUCT4    = 0x8,\n    IMAGE_CEE_CS_STRUCT32   = 0x9,\n    IMAGE_CEE_CS_BYVALUE    = 0xA,\n} CorArgType;\n\n\n//*****************************************************************************\n//\n// Native type for N-Direct\n//\n//*****************************************************************************\n\ntypedef enum CorNativeType\n{\n\n    // Keep this in-sync with ndp\\clr\\src\\BCL\\System\\runtime\\interopservices\\attributes.cs\n\n    NATIVE_TYPE_END         = 0x0,    //DEPRECATED\n    NATIVE_TYPE_VOID        = 0x1,    //DEPRECATED\n    NATIVE_TYPE_BOOLEAN     = 0x2,    // (4 byte boolean value: TRUE = non-zero, FALSE = 0)\n    NATIVE_TYPE_I1          = 0x3,\n    NATIVE_TYPE_U1          = 0x4,\n    NATIVE_TYPE_I2          = 0x5,\n    NATIVE_TYPE_U2          = 0x6,\n    NATIVE_TYPE_I4          = 0x7,\n    NATIVE_TYPE_U4          = 0x8,\n    NATIVE_TYPE_I8          = 0x9,\n    NATIVE_TYPE_U8          = 0xa,\n    NATIVE_TYPE_R4          = 0xb,\n    NATIVE_TYPE_R8          = 0xc,\n    NATIVE_TYPE_SYSCHAR     = 0xd,    //DEPRECATED\n    NATIVE_TYPE_VARIANT     = 0xe,    //DEPRECATED\n    NATIVE_TYPE_CURRENCY    = 0xf,\n    NATIVE_TYPE_PTR         = 0x10,   //DEPRECATED\n\n    NATIVE_TYPE_DECIMAL     = 0x11,   //DEPRECATED\n    NATIVE_TYPE_DATE        = 0x12,   //DEPRECATED\n    NATIVE_TYPE_BSTR        = 0x13,   //COMINTEROP\n    NATIVE_TYPE_LPSTR       = 0x14,\n    NATIVE_TYPE_LPWSTR      = 0x15,\n    NATIVE_TYPE_LPTSTR      = 0x16,\n    NATIVE_TYPE_FIXEDSYSSTRING  = 0x17,\n    NATIVE_TYPE_OBJECTREF   = 0x18,   //DEPRECATED\n    NATIVE_TYPE_IUNKNOWN    = 0x19,   //COMINTEROP\n    NATIVE_TYPE_IDISPATCH   = 0x1a,   //COMINTEROP\n    NATIVE_TYPE_STRUCT      = 0x1b,\n    NATIVE_TYPE_INTF        = 0x1c,   //COMINTEROP\n    NATIVE_TYPE_SAFEARRAY   = 0x1d,   //COMINTEROP\n    NATIVE_TYPE_FIXEDARRAY  = 0x1e,\n    NATIVE_TYPE_INT         = 0x1f,\n    NATIVE_TYPE_UINT        = 0x20,\n\n    NATIVE_TYPE_NESTEDSTRUCT  = 0x21, //DEPRECATED (use NATIVE_TYPE_STRUCT)\n\n    NATIVE_TYPE_BYVALSTR    = 0x22,   //COMINTEROP\n\n    NATIVE_TYPE_ANSIBSTR    = 0x23,   //COMINTEROP\n\n    NATIVE_TYPE_TBSTR       = 0x24, // select BSTR or ANSIBSTR depending on platform\n                                      //COMINTEROP\n\n    NATIVE_TYPE_VARIANTBOOL = 0x25, // (2-byte boolean value: TRUE = -1, FALSE = 0)\n                                      //COMINTEROP\n    NATIVE_TYPE_FUNC        = 0x26,\n\n    NATIVE_TYPE_ASANY       = 0x28,\n\n    NATIVE_TYPE_ARRAY       = 0x2a,\n    NATIVE_TYPE_LPSTRUCT    = 0x2b,\n\n    NATIVE_TYPE_CUSTOMMARSHALER = 0x2c,  // Custom marshaler native type. This must be followed\n                                         // by a string of the following format:\n                                         // \"Native type name/0Custom marshaler type name/0Optional cookie/0\"\n                                         // Or\n                                         // \"{Native type GUID}/0Custom marshaler type name/0Optional cookie/0\"\n\n    NATIVE_TYPE_ERROR       = 0x2d, // This native type coupled with ELEMENT_TYPE_I4 will map to VT_HRESULT\n                                    //COMINTEROP\n\n    NATIVE_TYPE_IINSPECTABLE = 0x2e,\n    NATIVE_TYPE_HSTRING     = 0x2f,\n    NATIVE_TYPE_LPUTF8STR   = 0x30, // utf-8 string\n    NATIVE_TYPE_MAX         = 0x50, // first invalid element type\n} CorNativeType;\n\n\nenum\n{\n    DESCR_GROUP_METHODDEF = 0,          // DESCR group for MethodDefs\n    DESCR_GROUP_METHODIMPL,             // DESCR group for MethodImpls\n};\n\n/***********************************************************************************/\n// a COR_ILMETHOD_SECT is a generic container for attributes that are private\n// to a particular method.  The COR_ILMETHOD structure points to one of these\n// (see GetSect()).  COR_ILMETHOD_SECT can decode the Kind of attribute (but not\n// its internal data layout), and can skip past the current attribute to find the\n// Next one.   The overhead for COR_ILMETHOD_SECT is a minimum of 2 bytes.\n\ntypedef enum CorILMethodSect                             // codes that identify attributes\n{\n    CorILMethod_Sect_Reserved    = 0,\n    CorILMethod_Sect_EHTable     = 1,\n    CorILMethod_Sect_OptILTable  = 2,\n\n    CorILMethod_Sect_KindMask    = 0x3F,        // The mask for decoding the type code\n    CorILMethod_Sect_FatFormat   = 0x40,        // fat format\n    CorILMethod_Sect_MoreSects   = 0x80,        // there is another attribute after this one\n} CorILMethodSect;\n\n/************************************/\n/* NOTE this structure must be DWORD aligned!! */\n\ntypedef struct IMAGE_COR_ILMETHOD_SECT_SMALL\n{\n    uint8_t Kind;\n    uint8_t DataSize;\n\n} IMAGE_COR_ILMETHOD_SECT_SMALL;\n\n\n\n/************************************/\n/* NOTE this structure must be DWORD aligned!! */\ntypedef struct IMAGE_COR_ILMETHOD_SECT_FAT\n{\n    unsigned Kind : 8;\n    unsigned DataSize : 24;\n\n} IMAGE_COR_ILMETHOD_SECT_FAT;\n\n\n\n/***********************************************************************************/\n/* If COR_ILMETHOD_SECT_HEADER::Kind() = CorILMethod_Sect_EHTable then the attribute\n   is a list of exception handling clauses.  There are two formats, fat or small\n*/\ntypedef enum CorExceptionFlag                       // definitions for the Flags field below (for both big and small)\n{\n    COR_ILEXCEPTION_CLAUSE_NONE,                    // This is a typed handler\n    COR_ILEXCEPTION_CLAUSE_OFFSETLEN = 0x0000,      // Deprecated\n    COR_ILEXCEPTION_CLAUSE_DEPRECATED = 0x0000,     // Deprecated\n    COR_ILEXCEPTION_CLAUSE_FILTER  = 0x0001,        // If this bit is on, then this EH entry is for a filter\n    COR_ILEXCEPTION_CLAUSE_FINALLY = 0x0002,        // This clause is a finally clause\n    COR_ILEXCEPTION_CLAUSE_FAULT = 0x0004,          // Fault clause (finally that is called on exception only)\n    COR_ILEXCEPTION_CLAUSE_DUPLICATED = 0x0008,     // duplicated clause. This clause was duplicated to a funclet which was pulled out of line\n} CorExceptionFlag;\n\n/***********************************/\ntypedef struct IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT\n{\n    CorExceptionFlag    Flags;\n    uint32_t            TryOffset;\n    uint32_t            TryLength;      // relative to start of try block\n    uint32_t            HandlerOffset;\n    uint32_t            HandlerLength;  // relative to start of handler\n    union {\n        uint32_t        ClassToken;     // use for type-based exception handlers\n        uint32_t        FilterOffset;   // use for filter-based exception handlers (COR_ILEXCEPTION_FILTER is set)\n    };\n} IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT;\n\ntypedef struct IMAGE_COR_ILMETHOD_SECT_EH_FAT\n{\n    IMAGE_COR_ILMETHOD_SECT_FAT   SectFat;\n    IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT Clauses[1];     // actually variable size\n} IMAGE_COR_ILMETHOD_SECT_EH_FAT;\n\n/***********************************/\ntypedef struct IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL\n{\n#ifdef HOST_64BIT\n    unsigned            Flags         : 16;\n#else // !HOST_64BIT\n    CorExceptionFlag    Flags         : 16;\n#endif\n    unsigned            TryOffset     : 16;\n    unsigned            TryLength     : 8;  // relative to start of try block\n    unsigned            HandlerOffset : 16;\n    unsigned            HandlerLength : 8;  // relative to start of handler\n    union {\n        uint32_t        ClassToken;\n        uint32_t        FilterOffset;\n    };\n} IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL;\n\n/***********************************/\ntypedef struct IMAGE_COR_ILMETHOD_SECT_EH_SMALL\n{\n    IMAGE_COR_ILMETHOD_SECT_SMALL SectSmall;\n    uint16_t Reserved;\n    IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL Clauses[1];   // actually variable size\n} IMAGE_COR_ILMETHOD_SECT_EH_SMALL;\n\n\n\ntypedef union IMAGE_COR_ILMETHOD_SECT_EH\n{\n    IMAGE_COR_ILMETHOD_SECT_EH_SMALL Small;\n    IMAGE_COR_ILMETHOD_SECT_EH_FAT Fat;\n} IMAGE_COR_ILMETHOD_SECT_EH;\n\n\n/***********************************************************************************/\n// Legal values for\n// * code:IMAGE_COR_ILMETHOD_FAT::Flags or\n// * code:IMAGE_COR_ILMETHOD_TINY::Flags_CodeSize fields.\n//\n// The only semantic flag at present is CorILMethod_InitLocals\ntypedef enum CorILMethodFlags\n{\n    CorILMethod_InitLocals      = 0x0010,           // call default constructor on all local vars\n    CorILMethod_MoreSects       = 0x0008,           // there is another attribute after this one\n\n    CorILMethod_CompressedIL    = 0x0040,           // Not used.\n\n        // Indicates the format for the COR_ILMETHOD header\n    CorILMethod_FormatShift     = 3,\n    CorILMethod_FormatMask      = ((1 << CorILMethod_FormatShift) - 1),\n    CorILMethod_TinyFormat      = 0x0002,         // use this code if the code size is even\n    CorILMethod_SmallFormat     = 0x0000,\n    CorILMethod_FatFormat       = 0x0003,\n    CorILMethod_TinyFormat1     = 0x0006,         // use this code if the code size is odd\n} CorILMethodFlags;\n\n/***************************************************************************/\n/* Used when the method is tiny (< 64 bytes), and there are no local vars */\ntypedef struct IMAGE_COR_ILMETHOD_TINY\n{\n    uint8_t Flags_CodeSize;\n} IMAGE_COR_ILMETHOD_TINY;\n\n/************************************/\n// This structure is the 'fat' layout, where no compression is attempted.\n// Note that this structure can be added on at the end, thus making it extensible\ntypedef struct IMAGE_COR_ILMETHOD_FAT\n{\n    unsigned Flags    : 12;     // Flags see code:CorILMethodFlags\n    unsigned Size     :  4;     // size in DWords of this structure (currently 3)\n    unsigned MaxStack : 16;     // maximum number of items (I4, I, I8, obj ...), on the operand stack\n    uint32_t CodeSize;          // size of the code\n    mdSignature   LocalVarSigTok;     // token that indicates the signature of the local vars (0 means none)\n\n} IMAGE_COR_ILMETHOD_FAT;\n\n// an IMAGE_COR_ILMETHOD holds the IL instructions for a individual method.  To save space they come in two\n// flavors Fat and Tiny.  Conceptually Tiny is just a compressed version of Fat, so code:IMAGE_COR_ILMETHOD_FAT\n// is the logical structure for all headers.  Conceptually this blob holds the IL, the Exception Handling\n// Tables, the local variable information and some flags.\ntypedef union IMAGE_COR_ILMETHOD\n{\n    IMAGE_COR_ILMETHOD_TINY       Tiny;\n    IMAGE_COR_ILMETHOD_FAT        Fat;\n} IMAGE_COR_ILMETHOD;\n\n//*****************************************************************************\n// Non VOS v-table entries.  Define an array of these pointed to by\n// IMAGE_COR20_HEADER.VTableFixups.  Each entry describes a contiguous array of\n// v-table slots.  The slots start out initialized to the meta data token value\n// for the method they need to call.  At image load time, the CLR Loader will\n// turn each entry into a pointer to machine code for the CPU and can be\n// called directly.\n//*****************************************************************************\n\ntypedef struct IMAGE_COR_VTABLEFIXUP\n{\n    uint32_t       RVA;                    // Offset of v-table array in image.\n    uint16_t       Count;                  // How many entries at location.\n    uint16_t       Type;                   // COR_VTABLE_xxx type of entries.\n} IMAGE_COR_VTABLEFIXUP;\n\n\n\n\n\n//*****************************************************************************\n//*****************************************************************************\n//\n// M E T A - D A T A    D E C L A R A T I O N S\n//\n//*****************************************************************************\n//*****************************************************************************\n\n//*****************************************************************************\n//\n// Enums for SetOption API.\n//\n//*****************************************************************************\n\n// flags for MetaDataCheckDuplicatesFor\ntypedef enum CorCheckDuplicatesFor\n{\n    MDDupAll                    = 0xffffffff,\n    MDDupENC                    = MDDupAll,\n    MDNoDupChecks               = 0x00000000,\n    MDDupTypeDef                = 0x00000001,\n    MDDupInterfaceImpl          = 0x00000002,\n    MDDupMethodDef              = 0x00000004,\n    MDDupTypeRef                = 0x00000008,\n    MDDupMemberRef              = 0x00000010,\n    MDDupCustomAttribute        = 0x00000020,\n    MDDupParamDef               = 0x00000040,\n    MDDupPermission             = 0x00000080,\n    MDDupProperty               = 0x00000100,\n    MDDupEvent                  = 0x00000200,\n    MDDupFieldDef               = 0x00000400,\n    MDDupSignature              = 0x00000800,\n    MDDupModuleRef              = 0x00001000,\n    MDDupTypeSpec               = 0x00002000,\n    MDDupImplMap                = 0x00004000,\n    MDDupAssemblyRef            = 0x00008000,\n    MDDupFile                   = 0x00010000,\n    MDDupExportedType           = 0x00020000,\n    MDDupManifestResource       = 0x00040000,\n    MDDupGenericParam           = 0x00080000,\n    MDDupMethodSpec             = 0x00100000,\n    MDDupGenericParamConstraint = 0x00200000,\n    // gap for debug junk\n    MDDupAssembly               = 0x10000000,\n\n    // This is the default behavior on metadata. It will check duplicates for TypeRef, MemberRef, Signature, TypeSpec and MethodSpec.\n    MDDupDefault = MDNoDupChecks | MDDupTypeRef | MDDupMemberRef | MDDupSignature | MDDupTypeSpec | MDDupMethodSpec,\n} CorCheckDuplicatesFor;\n\n// flags for MetaDataRefToDefCheck\ntypedef enum CorRefToDefCheck\n{\n    // default behavior is to always perform TypeRef to TypeDef and MemberRef to MethodDef/FieldDef optimization\n    MDRefToDefDefault           = 0x00000003,\n    MDRefToDefAll               = 0xffffffff,\n    MDRefToDefNone              = 0x00000000,\n    MDTypeRefToDef              = 0x00000001,\n    MDMemberRefToDef            = 0x00000002\n} CorRefToDefCheck;\n\n\n// MetaDataNotificationForTokenMovement\ntypedef enum CorNotificationForTokenMovement\n{\n    // default behavior is to notify TypeRef, MethodDef, MemberRef, and FieldDef token remaps\n    MDNotifyDefault             = 0x0000000f,\n    MDNotifyAll                 = 0xffffffff,\n    MDNotifyNone                = 0x00000000,\n    MDNotifyMethodDef           = 0x00000001,\n    MDNotifyMemberRef           = 0x00000002,\n    MDNotifyFieldDef            = 0x00000004,\n    MDNotifyTypeRef             = 0x00000008,\n\n    MDNotifyTypeDef             = 0x00000010,\n    MDNotifyParamDef            = 0x00000020,\n    MDNotifyInterfaceImpl       = 0x00000040,\n    MDNotifyProperty            = 0x00000080,\n    MDNotifyEvent               = 0x00000100,\n    MDNotifySignature           = 0x00000200,\n    MDNotifyTypeSpec            = 0x00000400,\n    MDNotifyCustomAttribute     = 0x00000800,\n    MDNotifySecurityValue       = 0x00001000,\n    MDNotifyPermission          = 0x00002000,\n    MDNotifyModuleRef           = 0x00004000,\n\n    MDNotifyNameSpace           = 0x00008000,\n\n    MDNotifyAssemblyRef         = 0x01000000,\n    MDNotifyFile                = 0x02000000,\n    MDNotifyExportedType        = 0x04000000,\n    MDNotifyResource            = 0x08000000,\n} CorNotificationForTokenMovement;\n\n\ntypedef enum CorSetENC\n{\n    MDSetENCOn                  = 0x00000001,   // Deprecated name.\n    MDSetENCOff                 = 0x00000002,   // Deprecated name.\n\n    MDUpdateENC                 = 0x00000001,   // ENC mode.  Tokens don't move; can be updated.\n    MDUpdateFull                = 0x00000002,   // \"Normal\" update mode.\n    MDUpdateExtension           = 0x00000003,   // Extension mode.  Tokens don't move, adds only.\n    MDUpdateIncremental         = 0x00000004,   // Incremental compilation\n    MDUpdateDelta               = 0x00000005,   // If ENC on, save only deltas.\n    MDUpdateMask                = 0x00000007,\n\n\n} CorSetENC;\n\n#define IsENCDelta(x)                       (((x) & MDUpdateMask) == MDUpdateDelta)\n\n// flags used in SetOption when pair with MetaDataErrorIfEmitOutOfOrder guid\ntypedef enum CorErrorIfEmitOutOfOrder\n{\n    MDErrorOutOfOrderDefault    = 0x00000000,   // default not to generate any error\n    MDErrorOutOfOrderNone       = 0x00000000,   // do not generate error for out of order emit\n    MDErrorOutOfOrderAll        = 0xffffffff,   // generate out of order emit for method, field, param, property, and event\n    MDMethodOutOfOrder          = 0x00000001,   // generate error when methods are emitted out of order\n    MDFieldOutOfOrder           = 0x00000002,   // generate error when fields are emitted out of order\n    MDParamOutOfOrder           = 0x00000004,   // generate error when params are emitted out of order\n    MDPropertyOutOfOrder        = 0x00000008,   // generate error when properties are emitted out of order\n    MDEventOutOfOrder           = 0x00000010,   // generate error when events are emitted out of order\n} CorErrorIfEmitOutOfOrder;\n\n\n// flags used in SetOption when pair with MetaDataImportOption guid\ntypedef enum CorImportOptions\n{\n    MDImportOptionDefault       = 0x00000000,   // default to skip over deleted records\n    MDImportOptionAll           = 0xFFFFFFFF,   // Enumerate everything\n    MDImportOptionAllTypeDefs   = 0x00000001,   // all the typedefs including the deleted typedef\n    MDImportOptionAllMethodDefs = 0x00000002,   // all the methoddefs including the deleted ones\n    MDImportOptionAllFieldDefs  = 0x00000004,   // all the fielddefs including the deleted ones\n    MDImportOptionAllProperties = 0x00000008,   // all the properties including the deleted ones\n    MDImportOptionAllEvents     = 0x00000010,   // all the events including the deleted ones\n    MDImportOptionAllCustomAttributes = 0x00000020, // all the custom attributes including the deleted ones\n    MDImportOptionAllExportedTypes  = 0x00000040,   // all the ExportedTypes including the deleted ones\n\n} CorImportOptions;\n\n\n// flags for MetaDataThreadSafetyOptions\ntypedef enum CorThreadSafetyOptions\n{\n    // default behavior is to have thread safety turn off. This means that MetaData APIs will not take reader/writer\n    // lock. Clients are responsible to make sure the properly thread synchronization when using MetaData APIs.\n    MDThreadSafetyDefault       = 0x00000000,\n    MDThreadSafetyOff           = 0x00000000,\n    MDThreadSafetyOn            = 0x00000001,\n} CorThreadSafetyOptions;\n\n\n// flags for MetaDataLinkerOptions\ntypedef enum CorLinkerOptions\n{\n    // default behavior is not to keep private types\n    MDAssembly          = 0x00000000,\n    MDNetModule         = 0x00000001,\n} CorLinkerOptions;\n\n// flags for MetaDataMergeOptions\ntypedef enum MergeFlags\n{\n    MergeFlagsNone      =   0,\n    MergeManifest       =   0x00000001,\n    DropMemberRefCAs    =   0x00000002,\n    NoDupCheck          =   0x00000004,\n    MergeExportedTypes  =   0x00000008\n} MergeFlags;\n\n// flags for MetaDataPreserveLocalRefs\ntypedef enum CorLocalRefPreservation\n{\n    MDPreserveLocalRefsNone     = 0x00000000,\n    MDPreserveLocalTypeRef      = 0x00000001,\n    MDPreserveLocalMemberRef    = 0x00000002\n} CorLocalRefPreservation;\n\n//\n// struct used to retrieve field offset\n// used by GetClassLayout and SetClassLayout\n//\n\n#ifndef _COR_FIELD_OFFSET_\n#define _COR_FIELD_OFFSET_\n\ntypedef struct COR_FIELD_OFFSET\n{\n    mdFieldDef  ridOfField;\n    uint32_t       ulOffset;\n} COR_FIELD_OFFSET;\n\n#endif\n\n\n//\n// Token tags.\n//\ntypedef enum CorTokenType\n{\n    mdtModule               = 0x00000000,       //\n    mdtTypeRef              = 0x01000000,       //\n    mdtTypeDef              = 0x02000000,       //\n    mdtFieldDef             = 0x04000000,       //\n    mdtMethodDef            = 0x06000000,       //\n    mdtParamDef             = 0x08000000,       //\n    mdtInterfaceImpl        = 0x09000000,       //\n    mdtMemberRef            = 0x0a000000,       //\n    mdtCustomAttribute      = 0x0c000000,       //\n    mdtPermission           = 0x0e000000,       //\n    mdtSignature            = 0x11000000,       //\n    mdtEvent                = 0x14000000,       //\n    mdtProperty             = 0x17000000,       //\n    mdtMethodImpl           = 0x19000000,       //\n    mdtModuleRef            = 0x1a000000,       //\n    mdtTypeSpec             = 0x1b000000,       //\n    mdtAssembly             = 0x20000000,       //\n    mdtAssemblyRef          = 0x23000000,       //\n    mdtFile                 = 0x26000000,       //\n    mdtExportedType         = 0x27000000,       //\n    mdtManifestResource     = 0x28000000,       //\n    mdtNestedClass          = 0x29000000,       //\n    mdtGenericParam         = 0x2a000000,       //\n    mdtMethodSpec           = 0x2b000000,       //\n    mdtGenericParamConstraint = 0x2c000000,\n\n    mdtString               = 0x70000000,       //\n    mdtName                 = 0x71000000,       //\n    mdtBaseType             = 0x72000000,       // Leave this on the high end value. This does not correspond to metadata table\n} CorTokenType;\n\n//\n// Build / decompose tokens.\n//\n#define RidToToken(rid,tktype) ((rid) |= (tktype))\n#define TokenFromRid(rid,tktype) ((rid) | (tktype))\n#define RidFromToken(tk) ((RID) ((tk) & 0x00ffffff))\n#define TypeFromToken(tk) ((ULONG32)((tk) & 0xff000000))\n#define IsNilToken(tk) ((RidFromToken(tk)) == 0)\n\n//\n// Nil tokens\n//\n#define mdTokenNil                  ((mdToken)0)\n#define mdModuleNil                 ((mdModule)mdtModule)\n#define mdTypeRefNil                ((mdTypeRef)mdtTypeRef)\n#define mdTypeDefNil                ((mdTypeDef)mdtTypeDef)\n#define mdFieldDefNil               ((mdFieldDef)mdtFieldDef)\n#define mdMethodDefNil              ((mdMethodDef)mdtMethodDef)\n#define mdParamDefNil               ((mdParamDef)mdtParamDef)\n#define mdInterfaceImplNil          ((mdInterfaceImpl)mdtInterfaceImpl)\n#define mdMemberRefNil              ((mdMemberRef)mdtMemberRef)\n#define mdCustomAttributeNil        ((mdCustomAttribute)mdtCustomAttribute)\n#define mdPermissionNil             ((mdPermission)mdtPermission)\n#define mdSignatureNil              ((mdSignature)mdtSignature)\n#define mdEventNil                  ((mdEvent)mdtEvent)\n#define mdPropertyNil               ((mdProperty)mdtProperty)\n#define mdModuleRefNil              ((mdModuleRef)mdtModuleRef)\n#define mdTypeSpecNil               ((mdTypeSpec)mdtTypeSpec)\n#define mdAssemblyNil               ((mdAssembly)mdtAssembly)\n#define mdAssemblyRefNil            ((mdAssemblyRef)mdtAssemblyRef)\n#define mdFileNil                   ((mdFile)mdtFile)\n#define mdExportedTypeNil           ((mdExportedType)mdtExportedType)\n#define mdManifestResourceNil       ((mdManifestResource)mdtManifestResource)\n\n#define mdGenericParamNil           ((mdGenericParam)mdtGenericParam)\n#define mdGenericParamConstraintNil ((mdGenericParamConstraint)mdtGenericParamConstraint)\n#define mdMethodSpecNil             ((mdMethodSpec)mdtMethodSpec)\n\n#define mdStringNil                 ((mdString)mdtString)\n\n//\n// Open bits.\n//\ntypedef enum CorOpenFlags\n{\n    ofRead              =   0x00000000,     // Open scope for read\n    ofWrite             =   0x00000001,     // Open scope for write.\n    ofReadWriteMask     =   0x00000001,     // Mask for read/write bit.\n\n    ofCopyMemory        =   0x00000002,     // Open scope with memory. Ask metadata to maintain its own copy of memory.\n\n    ofReadOnly          =   0x00000010,     // Open scope for read. Will be unable to QI for a IMetadataEmit* interface\n    ofTakeOwnership     =   0x00000020,     // The memory was allocated with CoTaskMemAlloc and will be freed by the metadata\n\n    // These are obsolete and are ignored.\n    // ofCacheImage     =   0x00000004,     // EE maps but does not do relocations or verify image\n    // ofManifestMetadata = 0x00000008,     // Open scope on ngen image, return the manifest metadata instead of the IL metadata\n    ofNoTypeLib         =   0x00000080,     // Don't OpenScope on a typelib.\n    ofNoTransform       =   0x00001000,     // Disable automatic transforms of .winmd files.\n\n    // Internal bits\n    ofReserved1         =   0x00000100,     // Reserved for internal use.\n    ofReserved2         =   0x00000200,     // Reserved for internal use.\n    ofReserved3         =   0x00000400,     // Reserved for internal use.\n    ofReserved          =   0xffffef40      // All the reserved bits.\n\n} CorOpenFlags;\n\n#define IsOfRead(x)                         (((x) & ofReadWriteMask) == ofRead)\n#define IsOfReadWrite(x)                    (((x) & ofReadWriteMask) == ofWrite)\n\n#define IsOfCopyMemory(x)                   ((x) & ofCopyMemory)\n\n#define IsOfReadOnly(x)                     ((x) & ofReadOnly)\n#define IsOfTakeOwnership(x)                ((x) & ofTakeOwnership)\n\n#define IsOfReserved(x)                     (((x) & ofReserved) != 0)\n\n//\n// Type of file mapping returned by code:IMetaDataInfo::GetFileMapping.\n//\ntypedef enum CorFileMapping\n{\n    fmFlat            = 0,  // Flat file mapping - file is mapped as data file (code:SEC_IMAGE flag was not\n                            // passed to code:CreateFileMapping).\n    fmExecutableImage = 1,  // Executable image file mapping - file is mapped for execution\n                            // (either via code:LoadLibrary or code:CreateFileMapping with code:SEC_IMAGE flag).\n} CorFileMapping;\n\n\ntypedef CorTypeAttr CorRegTypeAttr;\n\n//\n// Opaque type for an enumeration handle.\n//\ntypedef void *HCORENUM;\n\n\n// Note that this must be kept in sync with System.AttributeTargets.\ntypedef enum CorAttributeTargets\n{\n    catAssembly      = 0x0001,\n    catModule        = 0x0002,\n    catClass         = 0x0004,\n    catStruct        = 0x0008,\n    catEnum          = 0x0010,\n    catConstructor   = 0x0020,\n    catMethod        = 0x0040,\n    catProperty      = 0x0080,\n    catField         = 0x0100,\n    catEvent         = 0x0200,\n    catInterface     = 0x0400,\n    catParameter     = 0x0800,\n    catDelegate      = 0x1000,\n    catGenericParameter = 0x4000,\n\n    catAll           = catAssembly | catModule | catClass | catStruct | catEnum | catConstructor |\n                    catMethod | catProperty | catField | catEvent | catInterface | catParameter | catDelegate | catGenericParameter,\n    catClassMembers  = catClass | catStruct | catEnum | catConstructor | catMethod | catProperty | catField | catEvent | catDelegate | catInterface,\n\n} CorAttributeTargets;\n\n#ifndef MACROS_NOT_SUPPORTED\n//\n// Some well-known custom attributes\n//\n#ifndef IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS\n  #define IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS (IMAGE_CEE_CS_CALLCONV_DEFAULT | IMAGE_CEE_CS_CALLCONV_HASTHIS)\n#endif\n\n#define INTEROP_DISPID_TYPE_W                   W(\"System.Runtime.InteropServices.DispIdAttribute\")\n#define INTEROP_DISPID_TYPE                     \"System.Runtime.InteropServices.DispIdAttribute\"\n#define INTEROP_DISPID_SIG                      {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I4}\n\n#define INTEROP_INTERFACETYPE_TYPE_W            W(\"System.Runtime.InteropServices.InterfaceTypeAttribute\")\n#define INTEROP_INTERFACETYPE_TYPE              \"System.Runtime.InteropServices.InterfaceTypeAttribute\"\n#define INTEROP_INTERFACETYPE_SIG               {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2}\n\n#define INTEROP_GUID_TYPE_W                     W(\"System.Runtime.InteropServices.GuidAttribute\")\n#define INTEROP_GUID_TYPE                       \"System.Runtime.InteropServices.GuidAttribute\"\n#define INTEROP_GUID_SIG                        {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}\n\n#define INTEROP_TYPELIBVERSION_TYPE_W           W(\"System.Runtime.InteropServices.TypeLibVersionAttribute\")\n#define INTEROP_TYPELIBVERSION_TYPE             \"System.Runtime.InteropServices.TypeLibVersionAttribute\"\n#define INTEROP_TYPELIBVERSION_SIG              {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 2, ELEMENT_TYPE_VOID, ELEMENT_TYPE_I2, ELEMENT_TYPE_I2}\n\n#define INTEROP_COMEVENTINTERFACE_TYPE_W        W(\"System.Runtime.InteropServices.ComEventInterfaceAttribute\")\n#define INTEROP_COMEVENTINTERFACE_TYPE          \"System.Runtime.InteropServices.ComEventInterfaceAttribute\"\n\n#define FRIEND_ASSEMBLY_TYPE_W                  W(\"System.Runtime.CompilerServices.InternalsVisibleToAttribute\")\n#define FRIEND_ASSEMBLY_TYPE                    \"System.Runtime.CompilerServices.InternalsVisibleToAttribute\"\n#define FRIEND_ASSEMBLY_TYPE_NAMESPACE          \"System.Runtime.CompilerServices\"\n#define FRIEND_ASSEMBLY_TYPE_NAME               \"InternalsVisibleToAttribute\"\n#define FRIEND_ASSEMBLY_SIG                     {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 2, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING, ELEMENT_TYPE_BOOLEAN}\n\n#define SUBJECT_ASSEMBLY_TYPE_W                 W(\"System.Runtime.CompilerServices.IgnoresAccessChecksToAttribute\")\n#define SUBJECT_ASSEMBLY_TYPE                   \"System.Runtime.CompilerServices.IgnoresAccessChecksToAttribute\"\n#define SUBJECT_ASSEMBLY_TYPE_NAMESPACE         \"System.Runtime.CompilerServices\"\n#define SUBJECT_ASSEMBLY_TYPE_NAME              \"IgnoresAccessChecksToAttribute\"\n#define SUBJECT_ASSEMBLY_SIG                    {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 1, ELEMENT_TYPE_VOID, ELEMENT_TYPE_STRING}\n\n#define DEFAULTDOMAIN_STA_TYPE_W                W(\"System.STAThreadAttribute\")\n#define DEFAULTDOMAIN_STA_TYPE                   \"System.STAThreadAttribute\"\n#define DEFAULTDOMAIN_STA_SIG                   {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}\n\n#define DEFAULTDOMAIN_MTA_TYPE_W                W(\"System.MTAThreadAttribute\")\n#define DEFAULTDOMAIN_MTA_TYPE                   \"System.MTAThreadAttribute\"\n#define DEFAULTDOMAIN_MTA_SIG                   {IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS, 0, ELEMENT_TYPE_VOID}\n\n#define DEBUGGABLE_ATTRIBUTE_TYPE_W             W(\"System.Diagnostics.DebuggableAttribute\")\n#define DEBUGGABLE_ATTRIBUTE_TYPE               \"System.Diagnostics.DebuggableAttribute\"\n#define DEBUGGABLE_ATTRIBUTE_TYPE_NAMESPACE     \"System.Diagnostics\"\n#define DEBUGGABLE_ATTRIBUTE_TYPE_NAME          \"DebuggableAttribute\"\n\n\n// Keep in sync with RuntimeCompatibilityAttribute.cs\n#define RUNTIMECOMPATIBILITY_TYPE_W             W(\"System.Runtime.CompilerServices.RuntimeCompatibilityAttribute\")\n#define RUNTIMECOMPATIBILITY_TYPE               \"System.Runtime.CompilerServices.RuntimeCompatibilityAttribute\"\n\n\n// Keep in sync with AssemblySettingAttributes.cs\n\ntypedef enum NGenHintEnum\n{\n    NGenDefault             = 0x0000, // No preference specified\n\n    NGenEager               = 0x0001, // NGen at install time\n    NGenLazy                = 0x0002, // NGen after install time\n    NGenNever               = 0x0003  // Assembly should not be ngened\n} NGenHintEnum;\n\ntypedef enum LoadHintEnum\n{\n    LoadDefault             = 0x0000, // No preference specified\n\n    LoadAlways              = 0x0001, // Dependency is always loaded\n    LoadSometimes           = 0x0002, // Dependency is sometimes loaded\n    LoadNever               = 0x0003  // Dependency is never loaded\n} LoadHintEnum;\n\n#define CMOD_CALLCONV_NAMESPACE_OLD             \"System.Runtime.InteropServices\"\n#define CMOD_CALLCONV_NAMESPACE                 \"System.Runtime.CompilerServices\"\n#define CMOD_CALLCONV_NAME_CDECL                \"CallConvCdecl\"\n#define CMOD_CALLCONV_NAME_STDCALL              \"CallConvStdcall\"\n#define CMOD_CALLCONV_NAME_THISCALL             \"CallConvThiscall\"\n#define CMOD_CALLCONV_NAME_FASTCALL             \"CallConvFastcall\"\n#define CMOD_CALLCONV_NAME_SUPPRESSGCTRANSITION \"CallConvSuppressGCTransition\"\n#define CMOD_CALLCONV_NAME_MEMBERFUNCTION       \"CallConvMemberFunction\"\n\n#endif // MACROS_NOT_SUPPORTED\n\n//\n// GetSaveSize accuracy\n//\n#ifndef _CORSAVESIZE_DEFINED_\n#define _CORSAVESIZE_DEFINED_\ntypedef enum CorSaveSize\n{\n    cssAccurate             = 0x0000,               // Find exact save size, accurate but slower.\n    cssQuick                = 0x0001,               // Estimate save size, may pad estimate, but faster.\n    cssDiscardTransientCAs  = 0x0002,               // remove all of the CAs of discardable types\n} CorSaveSize;\n#endif\n\n#define COR_IS_METHOD_MANAGED_IL(flags)         (((flags) & 0xf) == (miIL | miManaged))\n#define COR_IS_METHOD_MANAGED_OPTIL(flags)      (((flags) & 0xf) == (miOPTIL | miManaged))\n#define COR_IS_METHOD_MANAGED_NATIVE(flags)     (((flags) & 0xf) == (miNative | miManaged))\n#define COR_IS_METHOD_UNMANAGED_NATIVE(flags)   (((flags) & 0xf) == (miNative | miUnmanaged))\n\n//\n// Enum used with NATIVE_TYPE_ARRAY.\n//\ntypedef enum NativeTypeArrayFlags\n{\n    ntaSizeParamIndexSpecified = 0x0001,\n    ntaReserved                = 0xfffe      // All the reserved bits.\n} NativeTypeArrayFlags;\n\n//\n// Enum used for HFA type recognition.\n// Supported across architectures, so that it can be used in altjits and cross-compilation.\ntypedef enum CorInfoHFAElemType : unsigned {\n    CORINFO_HFA_ELEM_NONE,\n    CORINFO_HFA_ELEM_FLOAT,\n    CORINFO_HFA_ELEM_DOUBLE,\n    CORINFO_HFA_ELEM_VECTOR64,\n    CORINFO_HFA_ELEM_VECTOR128,\n} CorInfoHFAElemType;\n\n//\n// Opaque types for security properties and values.\n//\ntypedef void  *  PSECURITY_PROPS ;\ntypedef void  *  PSECURITY_VALUE ;\ntypedef void ** PPSECURITY_PROPS ;\ntypedef void ** PPSECURITY_VALUE ;\n\n//-------------------------------------\n//--- Security data structures\n//-------------------------------------\n\n// Descriptor for a single security custom attribute.\ntypedef struct COR_SECATTR {\n    mdMemberRef     tkCtor;         // Ref to constructor of security attribute.\n    const void     *pCustomAttribute;  // Blob describing ctor args and field/property values.\n    uint32_t        cbCustomAttribute;  // Length of the above blob.\n} COR_SECATTR;\n\n#endif // __CORHDR_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corhlpr.cpp",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/****************************************************************************\n **                                                                        **\n ** Corhlpr.h - signature helpers.                                         **\n **                                                                        **\n ****************************************************************************/\n#ifndef SOS_INCLUDE\n\n#ifdef _BLD_CLR\n#include \"utilcode.h\"\n#endif\n#include \"corhlpr.h\"\n#include <stdlib.h>\n\n#endif // !SOS_INCLUDE\n\n\n//*****************************************************************************\n//\n//***** File format helper classes\n//\n//*****************************************************************************\n\nextern \"C\" {\n\n/***************************************************************************/\n/* Note that this constructor does not set the LocalSig, but has the\n   advantage that it does not have any dependency on EE structures.\n   inside the EE use the FunctionDesc constructor */\n\nvoid __stdcall DecoderInit(void *pThis, COR_ILMETHOD *header)\n{\n    memset(pThis, 0, sizeof(COR_ILMETHOD_DECODER));\n    COR_ILMETHOD_DECODER *decoder = (COR_ILMETHOD_DECODER *)pThis;\n\n    if (header->Tiny.IsTiny())\n    {\n        decoder->SetMaxStack(header->Tiny.GetMaxStack());\n        decoder->Code = header->Tiny.GetCode();\n        decoder->SetCodeSize(header->Tiny.GetCodeSize());\n        decoder->SetFlags(CorILMethod_TinyFormat);\n        return;\n    }\n    if (header->Fat.IsFat())\n    {\n#ifdef HOST_64BIT\n        if((((size_t) header) & 3) == 0)        // header is aligned\n#else\n        assert((((size_t) header) & 3) == 0);        // header is aligned\n#endif\n        {\n            *((COR_ILMETHOD_FAT *)decoder) = header->Fat;\n            decoder->Code = header->Fat.GetCode();\n            if (header->Fat.GetSize() >= (sizeof(COR_ILMETHOD_FAT) / 4))        // Size if valid\n            {\n                decoder->Sect = header->Fat.GetSect();\n                if ((decoder->Sect != NULL) && (decoder->Sect->Kind() == CorILMethod_Sect_EHTable))\n                {\n                    decoder->EH = (COR_ILMETHOD_SECT_EH *)decoder->Sect;\n                    decoder->Sect = decoder->Sect->Next();\n                }\n            }\n        }\n        return;\n    }\n} // DecoderInit\n\n// Calculate the total method size. First get address of end of code. If there are no sections, then\n// the end of code addr marks end of COR_ILMETHOD. Otherwise find addr of end of last section and use it\n// to mark end of COR_ILMETHOD. Assumes that the code is directly followed\n// by each section in the on-disk format\nint __stdcall DecoderGetOnDiskSize(void * pThis, COR_ILMETHOD* header)\n{\n    COR_ILMETHOD_DECODER* decoder = (COR_ILMETHOD_DECODER*)pThis;\n\n    if (decoder->Code == NULL)\n        return 0;\n\n    BYTE *lastAddr = (BYTE*)decoder->Code + decoder->GetCodeSize();    // addr of end of code\n    const COR_ILMETHOD_SECT *sect = decoder->EH;\n    if (sect != 0 && sect->Next() == 0)\n    {\n        lastAddr = (BYTE *)sect + sect->DataSize();\n    }\n    else\n    {\n        const COR_ILMETHOD_SECT *nextSect;\n        for (sect = decoder->Sect; sect; sect = nextSect)\n        {\n            nextSect = sect->Next();\n            if (nextSect == 0)\n            {\n                // sect points to the last section, so set lastAddr\n                lastAddr = (BYTE *)sect + sect->DataSize();\n                break;\n            }\n        }\n    }\n    return (int)(lastAddr - (BYTE*)header);\n}\n\n/*********************************************************************/\n/* APIs for emitting sections etc */\n\nunsigned __stdcall IlmethodSize(COR_ILMETHOD_FAT* header, BOOL moreSections)\n{\n    if (header->GetMaxStack() <= 8 && (header->GetFlags() & ~CorILMethod_FormatMask) == 0\n        && header->GetLocalVarSigTok() == 0 && header->GetCodeSize() < 64 && !moreSections)\n        return(sizeof(COR_ILMETHOD_TINY));\n\n    return(sizeof(COR_ILMETHOD_FAT));\n}\n\n/*********************************************************************/\n        // emit the header (bestFormat) return amount emitted\nunsigned __stdcall IlmethodEmit(unsigned size, COR_ILMETHOD_FAT* header,\n                  BOOL moreSections, BYTE* outBuff)\n{\n#ifndef SOS_INCLUDE\n#ifdef _DEBUG\n    BYTE* origBuff = outBuff;\n#endif\n#endif // !SOS_INCLUDE\n    if (size == 1) {\n            // Tiny format\n        *outBuff++ = (BYTE) (CorILMethod_TinyFormat | (header->GetCodeSize() << 2));\n    }\n    else {\n            // Fat format\n        assert((((size_t) outBuff) & 3) == 0);               // header is dword aligned\n        COR_ILMETHOD_FAT* fatHeader = (COR_ILMETHOD_FAT*) outBuff;\n        outBuff += sizeof(COR_ILMETHOD_FAT);\n        *fatHeader = *header;\n        fatHeader->SetFlags(fatHeader->GetFlags() | CorILMethod_FatFormat);\n        assert((fatHeader->GetFlags() & CorILMethod_FormatMask) == CorILMethod_FatFormat);\n        if (moreSections)\n            fatHeader->SetFlags(fatHeader->GetFlags() | CorILMethod_MoreSects);\n        fatHeader->SetSize(sizeof(COR_ILMETHOD_FAT) / 4);\n    }\n#ifndef SOS_INCLUDE\n#ifdef _DEBUG\n    assert(&origBuff[size] == outBuff);\n#endif\n#endif // !SOS_INCLUDE\n    return(size);\n}\n\n/*********************************************************************/\n/* static */\nIMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* __stdcall SectEH_EHClause(void *pSectEH, unsigned idx, IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* buff)\n{\n    if (((COR_ILMETHOD_SECT_EH *)pSectEH)->IsFat())\n        return(&(((COR_ILMETHOD_SECT_EH *)pSectEH)->Fat.Clauses[idx]));\n\n    COR_ILMETHOD_SECT_EH_CLAUSE_FAT* fatClause = (COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)buff;\n    COR_ILMETHOD_SECT_EH_CLAUSE_SMALL* smallClause = (COR_ILMETHOD_SECT_EH_CLAUSE_SMALL*)&((COR_ILMETHOD_SECT_EH *)pSectEH)->Small.Clauses[idx];\n\n    // mask to remove sign extension - cast just wouldn't work\n    fatClause->SetFlags((CorExceptionFlag)(smallClause->GetFlags()&0x0000ffff));\n    fatClause->SetClassToken(smallClause->GetClassToken());\n    fatClause->SetTryOffset(smallClause->GetTryOffset());\n    fatClause->SetTryLength(smallClause->GetTryLength());\n    fatClause->SetHandlerLength(smallClause->GetHandlerLength());\n    fatClause->SetHandlerOffset(smallClause->GetHandlerOffset());\n    return(buff);\n}\n/*********************************************************************/\n        // compute the size of the section (best format)\n        // codeSize is the size of the method\n    // deprecated\nunsigned __stdcall SectEH_SizeWithCode(unsigned ehCount, unsigned codeSize)\n{\n    return((ehCount)? SectEH_SizeWorst(ehCount) : 0);\n}\n\n    // will return worse-case size and then Emit will return actual size\nunsigned __stdcall SectEH_SizeWorst(unsigned ehCount)\n{\n    return((ehCount)? (COR_ILMETHOD_SECT_EH_FAT::Size(ehCount)) : 0);\n}\n\n    // will return exact size which will match the size returned by Emit\nunsigned __stdcall SectEH_SizeExact(unsigned ehCount, IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses)\n{\n    if (ehCount == 0)\n        return(0);\n\n    unsigned smallSize = COR_ILMETHOD_SECT_EH_SMALL::Size(ehCount);\n    if (smallSize > COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE)\n            return(COR_ILMETHOD_SECT_EH_FAT::Size(ehCount));\n    for (unsigned i = 0; i < ehCount; i++) {\n        COR_ILMETHOD_SECT_EH_CLAUSE_FAT* fatClause = (COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)&clauses[i];\n        if (fatClause->GetTryOffset() > 0xFFFF ||\n                fatClause->GetTryLength() > 0xFF ||\n                fatClause->GetHandlerOffset() > 0xFFFF ||\n                fatClause->GetHandlerLength() > 0xFF) {\n            return(COR_ILMETHOD_SECT_EH_FAT::Size(ehCount));\n        }\n    }\n    return smallSize;\n}\n\n/*********************************************************************/\n\n        // emit the section (best format);\nunsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount,\n                  IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses,\n                  BOOL moreSections, BYTE* outBuff,\n                  ULONG* ehTypeOffsets)\n{\n    if (size == 0)\n       return(0);\n\n    assert((((size_t) outBuff) & 3) == 0);               // header is dword aligned\n    BYTE* origBuff = outBuff;\n    if (ehCount <= 0)\n        return 0;\n\n    // Initialize the ehTypeOffsets array.\n    if (ehTypeOffsets)\n    {\n        for (unsigned int i = 0; i < ehCount; i++)\n            ehTypeOffsets[i] = (ULONG) -1;\n    }\n\n    if (COR_ILMETHOD_SECT_EH_SMALL::Size(ehCount) < COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE) {\n        COR_ILMETHOD_SECT_EH_SMALL* EHSect = (COR_ILMETHOD_SECT_EH_SMALL*) outBuff;\n        unsigned i;\n        for (i = 0; i < ehCount; i++) {\n            COR_ILMETHOD_SECT_EH_CLAUSE_FAT* fatClause = (COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)&clauses[i];\n            if (fatClause->GetTryOffset() > 0xFFFF ||\n                    fatClause->GetTryLength() > 0xFF ||\n                    fatClause->GetHandlerOffset() > 0xFFFF ||\n                    fatClause->GetHandlerLength() > 0xFF) {\n                break;  // fall through and generate as FAT\n            }\n            assert((fatClause->GetFlags() & ~0xFFFF) == 0);\n            assert((fatClause->GetTryOffset() & ~0xFFFF) == 0);\n            assert((fatClause->GetTryLength() & ~0xFF) == 0);\n            assert((fatClause->GetHandlerOffset() & ~0xFFFF) == 0);\n            assert((fatClause->GetHandlerLength() & ~0xFF) == 0);\n\n            COR_ILMETHOD_SECT_EH_CLAUSE_SMALL* smallClause = (COR_ILMETHOD_SECT_EH_CLAUSE_SMALL*)&EHSect->Clauses[i];\n            smallClause->SetFlags((CorExceptionFlag) fatClause->GetFlags());\n            smallClause->SetTryOffset(fatClause->GetTryOffset());\n            smallClause->SetTryLength(fatClause->GetTryLength());\n            smallClause->SetHandlerOffset(fatClause->GetHandlerOffset());\n            smallClause->SetHandlerLength(fatClause->GetHandlerLength());\n            smallClause->SetClassToken(fatClause->GetClassToken());\n        }\n        if (i >= ehCount) {\n            // if actually got through all the clauses and they are small enough\n            EHSect->Kind = CorILMethod_Sect_EHTable;\n            if (moreSections)\n                EHSect->Kind |= CorILMethod_Sect_MoreSects;\n            EHSect->DataSize = (BYTE) EHSect->Size(ehCount);\n            EHSect->Reserved = 0;\n            assert(EHSect->DataSize == EHSect->Size(ehCount)); // make sure didn't overflow\n            outBuff = (BYTE*) &EHSect->Clauses[ehCount];\n            // Set the offsets for the exception type tokens.\n            if (ehTypeOffsets)\n            {\n                for (i = 0; i < ehCount; i++) {\n                    COR_ILMETHOD_SECT_EH_CLAUSE_SMALL* smallClause = (COR_ILMETHOD_SECT_EH_CLAUSE_SMALL*)&EHSect->Clauses[i];\n                    if (smallClause->GetFlags() == COR_ILEXCEPTION_CLAUSE_NONE)\n                    {\n                        assert(! IsNilToken(smallClause->GetClassToken()));\n                        ehTypeOffsets[i] = (ULONG)((BYTE *)&smallClause->ClassToken - origBuff);\n                    }\n                }\n            }\n            return(size);\n        }\n    }\n    // either total size too big or one of constituent elements too big (eg. offset or length)\n    COR_ILMETHOD_SECT_EH_FAT* EHSect = (COR_ILMETHOD_SECT_EH_FAT*) outBuff;\n    EHSect->SetKind(CorILMethod_Sect_EHTable | CorILMethod_Sect_FatFormat);\n    if (moreSections)\n        EHSect->SetKind(EHSect->GetKind() | CorILMethod_Sect_MoreSects);\n\n    EHSect->SetDataSize(EHSect->Size(ehCount));\n    memcpy(EHSect->Clauses, clauses, ehCount * sizeof(COR_ILMETHOD_SECT_EH_CLAUSE_FAT));\n    outBuff = (BYTE*) &EHSect->Clauses[ehCount];\n    assert(&origBuff[size] == outBuff);\n    // Set the offsets for the exception type tokens.\n    if (ehTypeOffsets)\n    {\n        for (unsigned int i = 0; i < ehCount; i++) {\n            COR_ILMETHOD_SECT_EH_CLAUSE_FAT* fatClause = (COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)&EHSect->Clauses[i];\n            if (fatClause->GetFlags() == COR_ILEXCEPTION_CLAUSE_NONE)\n            {\n                assert(! IsNilToken(fatClause->GetClassToken()));\n                ehTypeOffsets[i] = (ULONG)((BYTE *)&fatClause->ClassToken - origBuff);\n            }\n        }\n    }\n    return(size);\n}\n\n} // extern \"C\"\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corhlpr.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** Corhlpr.h -                                                                 **\n **                                                                         **\n *****************************************************************************/\n\n\n#ifndef __CORHLPR_H__\n#define __CORHLPR_H__\n\n#if defined(_MSC_VER) && defined(HOST_X86) && !defined(FPO_ON)\n#pragma optimize(\"y\", on)\t\t// Small critical routines, don't put in EBP frame\n#define FPO_ON 1\n#define CORHLPR_TURNED_FPO_ON 1\n#endif\n\n#include <assert.h>\n#include \"cor.h\"\n#include \"corhdr.h\"\n#include \"corerror.h\"\n#include \"unreachable.h\"\n\n// This header is consumed both within the runtime and externally. In the former\n// case we need to wrap memory allocations, in the latter there is no\n// infrastructure to support this. Detect which way we're building and provide a\n// very simple abstraction layer (handles allocating bytes only).\n#ifdef _BLD_CLR\n#include \"new.hpp\"\n\n\n#define NEW_NOTHROW(_bytes) new (nothrow) BYTE[_bytes]\n#define NEW_THROWS(_bytes) new BYTE[_bytes]\nvoid DECLSPEC_NORETURN ThrowOutOfMemory();\ninline void DECLSPEC_NORETURN THROW_OUT_OF_MEMORY()\n{\n    ThrowOutOfMemory();\n}\n#else\n#define NEW_NOTHROW(_bytes) new BYTE[_bytes]\n#define NEW_THROWS(_bytes) __CorHlprNewThrows(_bytes)\nstatic inline void DECLSPEC_NORETURN __CorHlprThrowOOM()\n{\n    RaiseException(STATUS_NO_MEMORY, 0, 0, NULL);\n    __UNREACHABLE();\n}\nstatic inline BYTE *__CorHlprNewThrows(size_t bytes)\n{\n    BYTE *pbMemory = new BYTE[bytes];\n    if (pbMemory == NULL)\n        __CorHlprThrowOOM();\n    return pbMemory;\n}\ninline void DECLSPEC_NORETURN THROW_OUT_OF_MEMORY()\n{\n    __CorHlprThrowOOM();\n}\n#endif\n\n\n//*****************************************************************************\n// There are a set of macros commonly used in the helpers which you will want\n// to override to get richer behavior.  The following defines what is needed\n// if you chose not to do the extra work.\n//*****************************************************************************\n#ifndef IfFailGoto\n#define IfFailGoto(EXPR, LABEL) \\\ndo { hr = (EXPR); if(FAILED(hr)) { goto LABEL; } } while (0)\n#endif\n\n#ifndef IfFailGo\n#define IfFailGo(EXPR) IfFailGoto(EXPR, ErrExit)\n#endif\n\n#ifndef IfFailRet\n#define IfFailRet(EXPR) do { hr = (EXPR); if(FAILED(hr)) { return (hr); } } while (0)\n#endif\n\n#ifndef IfNullRet\n#define IfNullRet(EXPR) do { if ((EXPR) == NULL){ return (E_OUTOFMEMORY); } } while (0)\n#endif\n\n\n#if !BIGENDIAN\n#define VAL16(x) x\n#define VAL32(x) x\n#endif\n\n//*****************************************************************************\n//\n//***** Macro to assist with cleaning up local static variables\n//\n//*****************************************************************************\n\n#define CHECK_LOCAL_STATIC_VAR(x)   \\\n    x                                \\\n\n//*****************************************************************************\n//\n//***** Utility helpers\n//\n//*****************************************************************************\n\n\n#define MAX_CLASSNAME_LENGTH 1024\n\n//*****************************************************************************\n//\n//***** Signature helpers\n//\n//*****************************************************************************\n\ninline bool isCallConv(unsigned sigByte, CorCallingConvention conv)\n{\n    return ((sigByte & IMAGE_CEE_CS_CALLCONV_MASK) == (unsigned) conv);\n}\n\n//*****************************************************************************\n//\n//***** File format helper classes\n//\n//*****************************************************************************\n\n\n\n//*****************************************************************************\ntypedef struct tagCOR_ILMETHOD_SECT_SMALL : IMAGE_COR_ILMETHOD_SECT_SMALL {\n        //Data follows\n    const BYTE* Data() const\n    {\n        return(((const BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_SECT_SMALL));\n    }\n\n    bool IsSmall() const\n    {\n        return (Kind & CorILMethod_Sect_FatFormat) == 0;\n    }\n\n    bool More() const\n    {\n        return (Kind & CorILMethod_Sect_MoreSects) != 0;\n    }\n} COR_ILMETHOD_SECT_SMALL;\n\n\n/************************************/\n/* NOTE this structure must be DWORD aligned!! */\ntypedef struct tagCOR_ILMETHOD_SECT_FAT : IMAGE_COR_ILMETHOD_SECT_FAT {\n        //Data follows\n    const BYTE* Data() const\n    {\n        return(((const BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_SECT_FAT));\n    }\n\n        //Endian-safe wrappers\n    unsigned GetKind() const {\n        /* return Kind; */\n        return *(BYTE*)this;\n    }\n    void SetKind(unsigned kind) {\n        /* Kind = kind; */\n        *(BYTE*)this = (BYTE)kind;\n    }\n\n    unsigned GetDataSize() const {\n        /* return DataSize; */\n        BYTE* p = (BYTE*)this;\n        return ((unsigned)*(p+1)) |\n            (((unsigned)*(p+2)) << 8) |\n            (((unsigned)*(p+3)) << 16);\n    }\n    void SetDataSize(unsigned datasize) {\n        /* DataSize = dataSize; */\n        BYTE* p = (BYTE*)this;\n        *(p+1) = (BYTE)(datasize);\n        *(p+2) = (BYTE)(datasize >> 8);\n        *(p+3) = (BYTE)(datasize >> 16);\n    }\n} COR_ILMETHOD_SECT_FAT;\n\ntypedef struct tagCOR_ILMETHOD_SECT_EH_CLAUSE_FAT : public IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT {\n    //Endian-safe wrappers\n    CorExceptionFlag GetFlags() const {\n        return (CorExceptionFlag)VAL32((unsigned)Flags);\n    }\n    void SetFlags(CorExceptionFlag flags) {\n        Flags = (CorExceptionFlag)VAL32((unsigned)flags);\n    }\n\n    DWORD GetTryOffset() const {\n        return VAL32(TryOffset);\n    }\n    void SetTryOffset(DWORD Offset) {\n        TryOffset = VAL32(Offset);\n    }\n\n    DWORD GetTryLength() const {\n        return VAL32(TryLength);\n    }\n    void SetTryLength(DWORD Length) {\n        TryLength = VAL32(Length);\n    }\n\n    DWORD GetHandlerOffset() const {\n        return VAL32(HandlerOffset);\n    }\n    void SetHandlerOffset(DWORD Offset) {\n        HandlerOffset = VAL32(Offset);\n    }\n\n    DWORD GetHandlerLength() const {\n        return VAL32(HandlerLength);\n    }\n    void SetHandlerLength(DWORD Length) {\n        HandlerLength = VAL32(Length);\n    }\n\n    DWORD GetClassToken() const {\n        return VAL32(ClassToken);\n    }\n    void SetClassToken(DWORD tok) {\n        ClassToken = VAL32(tok);\n    }\n\n    DWORD GetFilterOffset() const {\n        return VAL32(FilterOffset);\n    }\n    void SetFilterOffset(DWORD offset) {\n        FilterOffset = VAL32(offset);\n    }\n\n} COR_ILMETHOD_SECT_EH_CLAUSE_FAT;\n\n//*****************************************************************************\nstruct COR_ILMETHOD_SECT_EH_FAT : public COR_ILMETHOD_SECT_FAT {\n    static unsigned Size(unsigned ehCount) {\n        return (sizeof(COR_ILMETHOD_SECT_EH_FAT) +\n                sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT) * (ehCount-1));\n        }\n\n    IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT Clauses[1];     // actually variable size\n};\n\ntypedef struct tagCOR_ILMETHOD_SECT_EH_CLAUSE_SMALL : public IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL {\n    //Endian-safe wrappers\n    CorExceptionFlag GetFlags() const {\n        return (CorExceptionFlag)VAL16((SHORT)Flags);\n    }\n    void SetFlags(CorExceptionFlag flags) {\n        Flags = (CorExceptionFlag)VAL16((SHORT)flags);\n    }\n\n    DWORD GetTryOffset() const {\n        return VAL16(TryOffset);\n    }\n    void SetTryOffset(DWORD Offset) {\n        assert((Offset & ~0xffff) == 0);\n        TryOffset = VAL16(Offset);\n    }\n\n    DWORD GetTryLength() const {\n        return TryLength;\n    }\n    void SetTryLength(DWORD Length) {\n        assert((Length & ~0xff) == 0);\n        TryLength = Length;\n    }\n\n    DWORD GetHandlerOffset() const {\n        return VAL16(HandlerOffset);\n    }\n    void SetHandlerOffset(DWORD Offset) {\n        assert((Offset & ~0xffff) == 0);\n        HandlerOffset = VAL16(Offset);\n    }\n\n    DWORD GetHandlerLength() const {\n        return HandlerLength;\n    }\n    void SetHandlerLength(DWORD Length) {\n        assert((Length & ~0xff) == 0);\n        HandlerLength = Length;\n    }\n\n    DWORD GetClassToken() const {\n        return VAL32(ClassToken);\n    }\n    void SetClassToken(DWORD tok) {\n        ClassToken = VAL32(tok);\n    }\n\n    DWORD GetFilterOffset() const {\n        return VAL32(FilterOffset);\n    }\n    void SetFilterOffset(DWORD offset) {\n        FilterOffset = VAL32(offset);\n    }\n} COR_ILMETHOD_SECT_EH_CLAUSE_SMALL;\n\n//*****************************************************************************\nstruct COR_ILMETHOD_SECT_EH_SMALL : public COR_ILMETHOD_SECT_SMALL {\n    static unsigned Size(unsigned ehCount) {\n        return (sizeof(COR_ILMETHOD_SECT_EH_SMALL) +\n                sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL) * (ehCount-1));\n        }\n\n    WORD Reserved;                                  // alignment padding\n    IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL Clauses[1];   // actually variable size\n};\n\n\n/************************************/\n/* NOTE this structure must be DWORD aligned!! */\nstruct COR_ILMETHOD_SECT\n{\n    bool More() const\n    {\n        return((AsSmall()->Kind & CorILMethod_Sect_MoreSects) != 0);\n    }\n\n    CorILMethodSect Kind() const\n    {\n        return((CorILMethodSect) (AsSmall()->Kind & CorILMethod_Sect_KindMask));\n    }\n\n    const COR_ILMETHOD_SECT* Next() const\n    {\n        if (!More()) return(0);\n        return ((COR_ILMETHOD_SECT*)Align(((BYTE *)this) + DataSize()));\n    }\n\n    const BYTE* Data() const\n    {\n        if (IsFat()) return(AsFat()->Data());\n        return(AsSmall()->Data());\n    }\n\n    unsigned DataSize() const\n    {\n        if (Kind() == CorILMethod_Sect_EHTable)\n        {\n            // VB and MC++ shipped with bug where they have not accounted for size of COR_ILMETHOD_SECT_EH_XXX\n            // in DataSize. To avoid breaking these images, we will align the size of EH sections up. This works\n            // because IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_XXX is bigger than COR_ILMETHOD_SECT_EH_XXX\n            // (see VSWhidbey #99031 and related bugs for details).\n\n            if (IsFat())\n                return Fat.Size(Fat.GetDataSize() / sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT));\n            else\n                return Small.Size(Small.DataSize / sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL));\n        }\n        else\n    {\n        if (IsFat()) return(AsFat()->GetDataSize());\n        return(AsSmall()->DataSize);\n    }\n    }\n\n    friend struct COR_ILMETHOD;\n    friend struct tagCOR_ILMETHOD_FAT;\n    friend struct tagCOR_ILMETHOD_TINY;\n    bool IsFat() const\n    {\n        return((AsSmall()->Kind & CorILMethod_Sect_FatFormat) != 0);\n    }\n\n    static const void* Align(const void* p)\n    {\n        return((void*) ((((UINT_PTR) p) + 3) & ~3));\n    }\n\nprotected:\n    const COR_ILMETHOD_SECT_FAT*   AsFat() const\n    {\n        return((COR_ILMETHOD_SECT_FAT*) this);\n    }\n\n    const COR_ILMETHOD_SECT_SMALL* AsSmall() const\n    {\n        return((COR_ILMETHOD_SECT_SMALL*) this);\n    }\n\npublic:\n    // The body is either a COR_ILMETHOD_SECT_SMALL or COR_ILMETHOD_SECT_FAT\n    // (as indicated by the CorILMethod_Sect_FatFormat bit\n    union {\n        COR_ILMETHOD_SECT_EH_SMALL Small;\n        COR_ILMETHOD_SECT_EH_FAT Fat;\n        };\n};\n\n\n/***********************************/\n// exported functions (implementation in Format\\Format.cpp:\nextern \"C\" {\nIMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* __stdcall SectEH_EHClause(void *pSectEH, unsigned idx, IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* buff);\n        // compute the size of the section (best format)\n        // codeSize is the size of the method\n    // deprecated\nunsigned __stdcall SectEH_SizeWithCode(unsigned ehCount, unsigned codeSize);\n\n    // will return worse-case size and then Emit will return actual size\nunsigned __stdcall SectEH_SizeWorst(unsigned ehCount);\n\n    // will return exact size which will match the size returned by Emit\nunsigned __stdcall SectEH_SizeExact(unsigned ehCount, IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses);\n\n        // emit the section (best format);\nunsigned __stdcall SectEH_Emit(unsigned size, unsigned ehCount,\n                  IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses,\n                  BOOL moreSections, BYTE* outBuff,\n                  ULONG* ehTypeOffsets = 0);\n} // extern \"C\"\n\n\nstruct COR_ILMETHOD_SECT_EH : public COR_ILMETHOD_SECT\n{\n    unsigned EHCount() const\n    {\n        return (unsigned)(IsFat() ? (Fat.GetDataSize() / sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT)) :\n                        (Small.DataSize / sizeof(IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_SMALL)));\n    }\n\n        // return one clause in its fat form.  Use 'buff' if needed\n    const IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* EHClause(unsigned idx, IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* buff) const\n    {\n        return SectEH_EHClause((void *)this, idx, buff);\n    };\n        // compute the size of the section (best format)\n        // codeSize is the size of the method\n    // deprecated\n    unsigned static Size(unsigned ehCount, unsigned codeSize)\n    {\n        return SectEH_SizeWithCode(ehCount, codeSize);\n    };\n\n    // will return worse-case size and then Emit will return actual size\n    unsigned static Size(unsigned ehCount)\n    {\n        return SectEH_SizeWorst(ehCount);\n    };\n\n    // will return exact size which will match the size returned by Emit\n    unsigned static Size(unsigned ehCount, const IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses)\n    {\n        return SectEH_SizeExact(ehCount, (IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)clauses);\n    };\n\n        // emit the section (best format);\n    unsigned static Emit(unsigned size, unsigned ehCount,\n                  const IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT* clauses,\n                  bool moreSections, BYTE* outBuff,\n                  ULONG* ehTypeOffsets = 0)\n    {\n        return SectEH_Emit(size, ehCount,\n                           (IMAGE_COR_ILMETHOD_SECT_EH_CLAUSE_FAT*)clauses,\n                           moreSections, outBuff, ehTypeOffsets);\n    };\n};\n\n\n/***************************************************************************/\n/* Used when the method is tiny (< 64 bytes), and there are no local vars */\ntypedef struct tagCOR_ILMETHOD_TINY : IMAGE_COR_ILMETHOD_TINY\n{\n    bool     IsTiny() const\n    {\n        return((Flags_CodeSize & (CorILMethod_FormatMask >> 1)) == CorILMethod_TinyFormat);\n    }\n\n    unsigned GetCodeSize() const\n    {\n        return(((unsigned) Flags_CodeSize) >> (CorILMethod_FormatShift-1));\n    }\n\n    unsigned GetMaxStack() const\n    {\n        return(8);\n    }\n\n    BYTE*    GetCode() const\n    {\n        return(((BYTE*) this) + sizeof(struct tagCOR_ILMETHOD_TINY));\n    }\n\n    DWORD    GetLocalVarSigTok() const\n    {\n        return(0);\n    }\n\n    COR_ILMETHOD_SECT* GetSect() const\n    {\n        return(0);\n    }\n} COR_ILMETHOD_TINY;\n\n\n/************************************/\n// This structure is the 'fat' layout, where no compression is attempted.\n// Note that this structure can be added on at the end, thus making it extensible\ntypedef struct tagCOR_ILMETHOD_FAT : IMAGE_COR_ILMETHOD_FAT\n{\n        //Endian-safe wrappers\n    unsigned GetSize() const {\n        /* return Size; */\n        BYTE* p = (BYTE*)this;\n        return *(p+1) >> 4;\n    }\n    void SetSize(unsigned size) {\n        /* Size = size; */\n        BYTE* p = (BYTE*)this;\n        *(p+1) = (BYTE)((*(p+1) & 0x0F) | (size << 4));\n    }\n\n    unsigned GetFlags() const {\n        /* return Flags; */\n        BYTE* p = (BYTE*)this;\n        return ((unsigned)*(p+0)) | (( ((unsigned)*(p+1)) & 0x0F) << 8);\n    }\n    void SetFlags(unsigned flags) {\n        /* flags = Flags; */\n        BYTE* p = (BYTE*)this;\n        *p = (BYTE)flags;\n        *(p+1) = (BYTE)((*(p+1) & 0xF0) | ((flags >> 8) & 0x0F));\n    }\n\n    bool IsFat() const {\n        /* return((IMAGE_COR_ILMETHOD_FAT::GetFlags() & CorILMethod_FormatMask) == CorILMethod_FatFormat); */\n        return (*(BYTE*)this & CorILMethod_FormatMask) == CorILMethod_FatFormat;\n    }\n\n    unsigned GetMaxStack() const {\n        /* return MaxStack; */\n        return VAL16(*(USHORT*)((BYTE*)this+2));\n    }\n    void SetMaxStack(unsigned maxStack) {\n        /* MaxStack = maxStack; */\n        *(USHORT*)((BYTE*)this+2) = VAL16((USHORT)maxStack);\n    }\n\n    unsigned GetCodeSize() const\n    {\n        return VAL32(CodeSize);\n    }\n\n    void SetCodeSize(DWORD Size)\n    {\n        CodeSize = VAL32(Size);\n    }\n\n    mdToken  GetLocalVarSigTok() const\n    {\n        return VAL32(LocalVarSigTok);\n    }\n\n    void SetLocalVarSigTok(mdSignature tok)\n    {\n        LocalVarSigTok = VAL32(tok);\n    }\n\n    BYTE* GetCode() const {\n        return(((BYTE*) this) + 4*GetSize());\n    }\n\n    bool More() const {\n        // return (GetFlags() & CorILMethod_MoreSects) != 0;\n        return (*(BYTE*)this & CorILMethod_MoreSects) != 0;\n    }\n\n    const COR_ILMETHOD_SECT* GetSect() const {\n        if (!More()) return (0);\n        return(((COR_ILMETHOD_SECT*) COR_ILMETHOD_SECT::Align(GetCode() + GetCodeSize())));\n    }\n} COR_ILMETHOD_FAT;\n\n\nextern \"C\" {\n/************************************/\n// exported functions (impl. Format\\Format.cpp)\nunsigned __stdcall IlmethodSize(COR_ILMETHOD_FAT* header, BOOL MoreSections);\n        // emit the header (bestFormat) return amount emitted\nunsigned __stdcall IlmethodEmit(unsigned size, COR_ILMETHOD_FAT* header,\n                  BOOL moreSections, BYTE* outBuff);\n}\n\nstruct COR_ILMETHOD\n{\n        // a COR_ILMETHOD header should not be decoded by hand.  Instead us\n        // COR_ILMETHOD_DECODER to decode it.\n    friend class COR_ILMETHOD_DECODER;\n\n        // compute the size of the header (best format)\n    unsigned static Size(const COR_ILMETHOD_FAT* header, bool MoreSections)\n    {\n        return IlmethodSize((COR_ILMETHOD_FAT*)header,MoreSections);\n    };\n        // emit the header (bestFormat) return amount emitted\n    unsigned static Emit(unsigned size, const COR_ILMETHOD_FAT* header,\n                  bool moreSections, BYTE* outBuff)\n    {\n        return IlmethodEmit(size, (COR_ILMETHOD_FAT*)header, moreSections, outBuff);\n    };\n\n//private:\n    union\n    {\n        COR_ILMETHOD_TINY       Tiny;\n        COR_ILMETHOD_FAT        Fat;\n    };\n        // Code follows the Header, then immedately after the code comes\n        // any sections (COR_ILMETHOD_SECT).\n};\n\nextern \"C\" {\n/***************************************************************************/\n/* COR_ILMETHOD_DECODER is the only way functions internal to the EE should\n   fetch data from a COR_ILMETHOD.  This way any dependency on the file format\n   (and the multiple ways of encoding the header) is centralized to the\n   COR_ILMETHOD_DECODER constructor) */\n    void __stdcall DecoderInit(void * pThis, COR_ILMETHOD* header);\n    int  __stdcall DecoderGetOnDiskSize(void * pThis, COR_ILMETHOD* header);\n} // extern \"C\"\n\nclass COR_ILMETHOD_DECODER : public COR_ILMETHOD_FAT\n{\npublic:\n    // This returns an uninitialized decoder, suitable for placement new but nothing\n    // else. Use with caution.\n    COR_ILMETHOD_DECODER() {}\n\n    // Typically the ONLY way you should access COR_ILMETHOD is through\n    // this constructor so format changes are easier.\n    COR_ILMETHOD_DECODER(const COR_ILMETHOD* header)\n    {\n        DecoderInit(this,(COR_ILMETHOD*)header);\n    };\n\n    // The above variant of the constructor can not do a 'complete' job, because\n    // it can not look up the local variable signature meta-data token.\n    // This method should be used when you have access to the Meta data API\n    // If the construction fails, the 'Code' field is set to 0\n\n    enum DecoderStatus {SUCCESS, FORMAT_ERROR, VERIFICATION_ERROR};\n\n    // If we want the decoder to verify the that local signature is OK we\n    // will pass a non-NULL value for wbStatus\n    //\n    // When using LazyInit we want ask that the local signature be verified\n    // But if we fail verification we still need access to the 'Code' field\n    // Because we may be able to demand SkipVerification and thus it was OK\n    // to have had a verification error.\n\n    COR_ILMETHOD_DECODER(COR_ILMETHOD* header,\n                         void *pInternalImport,\n                         DecoderStatus* wbStatus);\n\n    unsigned EHCount() const\n    {\n        return (EH != 0) ? EH->EHCount() : 0;\n    }\n\n    unsigned GetHeaderSize() const\n    {\n        return GetCodeSize() + ((EH != 0) ? EH->DataSize() : 0);\n    }\n\n    // returns total size of method for use in copying\n    int GetOnDiskSize(const COR_ILMETHOD* header)\n    {\n        return DecoderGetOnDiskSize(this,(COR_ILMETHOD*)header);\n    }\n\n    // Flags        these are available because we inherit COR_ILMETHOD_FAT\n    // MaxStack\n    // CodeSize\n    const BYTE *    Code;\n    PCCOR_SIGNATURE LocalVarSig;        // pointer to signature blob, or 0 if none\n    DWORD           cbLocalVarSig;      // size of dignature blob, or 0 if none\n    const COR_ILMETHOD_SECT_EH * EH;    // eh table if any  0 if none\n    const COR_ILMETHOD_SECT *    Sect;  // additional sections  0 if none\n};  // class COR_ILMETHOD_DECODER\n\n#if defined(CORHLPR_TURNED_FPO_ON)\n#pragma optimize(\"\", on)\t\t// Go back to command line default optimizations\n#undef CORHLPR_TURNED_FPO_ON\n#undef FPO_ON\n#endif\n\n#endif // __CORHLPR_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corhlprpriv.cpp",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/****************************************************************************\n **                                                                        **\n ** Corhlprpriv.cpp - signature helpers.                                         **\n **                                                                        **\n ****************************************************************************/\n#ifndef SOS_INCLUDE\n\n#ifdef _BLD_CLR\n#include \"utilcode.h\"\n#endif\n#include \"corhlprpriv.h\"\n#include <stdlib.h>\n\n/*************************************************************************************\n*\n* implementation of CQuickMemoryBase\n*\n*************************************************************************************/\n\ntemplate <SIZE_T SIZE, SIZE_T INCREMENT>\nHRESULT CQuickMemoryBase<SIZE, INCREMENT>::ReSizeNoThrow(SIZE_T iItems)\n{\n#ifdef _BLD_CLR\n#ifdef _DEBUG\n#ifndef DACCESS_COMPILE\n    // Exercise heap for OOM-fault injection purposes\n    // But we can't do this if current thread suspends EE\n    if (!IsSuspendEEThread ())\n    {\n        BYTE *pTmp = NEW_NOTHROW(iItems);\n        if (!pTmp)\n        {\n            return E_OUTOFMEMORY;\n        }\n        delete [] pTmp;\n    }\n#endif\n#endif\n#endif\n    BYTE *pbBuffNew;\n    if (iItems <= cbTotal)\n    {\n        iSize = iItems;\n        return NOERROR;\n    }\n\n#ifdef _BLD_CLR\n#ifndef DACCESS_COMPILE\n    // not allowed to do allocation if current thread suspends EE\n    if (IsSuspendEEThread ())\n        return E_OUTOFMEMORY;\n#endif\n#endif\n    pbBuffNew = NEW_NOTHROW(iItems + INCREMENT);\n    if (!pbBuffNew)\n        return E_OUTOFMEMORY;\n    if (pbBuff)\n    {\n        memcpy(pbBuffNew, pbBuff, cbTotal);\n        delete [] pbBuff;\n    }\n    else\n    {\n        _ASSERTE(cbTotal == SIZE);\n        memcpy(pbBuffNew, rgData, cbTotal);\n    }\n    cbTotal = iItems + INCREMENT;\n    iSize = iItems;\n    pbBuff = pbBuffNew;\n    return NOERROR;\n}\n\n\n/*************************************************************************************\n*\n* get number of bytes consumed by one argument/return type\n*\n*************************************************************************************/\n#define CHECK_REMAINDER  if(cbTotal >= cbTotalMax){hr=E_FAIL; goto ErrExit;}\nHRESULT _CountBytesOfOneArg(\n    PCCOR_SIGNATURE pbSig,\n    ULONG       *pcbTotal)  // Initially, *pcbTotal contains the remaining size of the sig blob\n{\n    ULONG       cb;\n    ULONG       cbTotal=0;\n    ULONG       cbTotalMax;\n    CorElementType ulElementType;\n    ULONG       ulData;\n    ULONG       ulTemp;\n    int         iData;\n    mdToken     tk;\n    ULONG       cArg;\n    ULONG       callingconv;\n    ULONG       cArgsIndex;\n    HRESULT     hr = NOERROR;\n\n    if(pcbTotal==NULL) return E_FAIL;\n    cbTotalMax = *pcbTotal;\n\n    CHECK_REMAINDER;\n    cbTotal = CorSigUncompressElementType(pbSig, &ulElementType);\n    while (CorIsModifierElementType((CorElementType) ulElementType))\n    {\n        CHECK_REMAINDER;\n        cbTotal += CorSigUncompressElementType(&pbSig[cbTotal], &ulElementType);\n    }\n    switch (ulElementType)\n    {\n        case ELEMENT_TYPE_GENERICINST:\n            // skip over generic type\n            CHECK_REMAINDER;\n            cb = cbTotalMax - cbTotal;\n            IfFailGo( _CountBytesOfOneArg(&pbSig[cbTotal], &cb) );\n            cbTotal += cb;\n\n            // skip over number of parameters\n            CHECK_REMAINDER;\n            cbTotal += CorSigUncompressData(&pbSig[cbTotal], &cArg);\n\n            // loop through type parameters\n            for (cArgsIndex = 0; cArgsIndex < cArg; cArgsIndex++)\n            {\n                CHECK_REMAINDER;\n                cb = cbTotalMax - cbTotal;\n                IfFailGo( _CountBytesOfOneArg(&pbSig[cbTotal], &cb) );\n                cbTotal += cb;\n            }\n            break;\n\n        case ELEMENT_TYPE_SZARRAY:\n        case 0x1e /* obsolete */:\n            // skip over base type\n            CHECK_REMAINDER;\n            cb = cbTotalMax - cbTotal;\n            IfFailGo( _CountBytesOfOneArg(&pbSig[cbTotal], &cb) );\n            cbTotal += cb;\n            break;\n\n        case ELEMENT_TYPE_FNPTR:\n            CHECK_REMAINDER;\n            cbTotal += CorSigUncompressData (&pbSig[cbTotal], &callingconv);\n\n            // remember number of bytes to represent the arg counts\n            CHECK_REMAINDER;\n            cbTotal += CorSigUncompressData (&pbSig[cbTotal], &cArg);\n\n            // how many bytes to represent the return type\n            CHECK_REMAINDER;\n            cb = cbTotalMax - cbTotal;\n            IfFailGo( _CountBytesOfOneArg( &pbSig[cbTotal], &cb) );\n            cbTotal += cb;\n\n            // loop through argument\n            for (cArgsIndex = 0; cArgsIndex < cArg; cArgsIndex++)\n            {\n                CHECK_REMAINDER;\n                cb = cbTotalMax - cbTotal;\n                IfFailGo( _CountBytesOfOneArg( &pbSig[cbTotal], &cb) );\n                cbTotal += cb;\n            }\n\n            break;\n\n        case ELEMENT_TYPE_ARRAY:\n            // syntax : ARRAY BaseType <rank> [i size_1... size_i] [j lowerbound_1 ... lowerbound_j]\n\n            // skip over base type\n            CHECK_REMAINDER;\n            cb = cbTotalMax - cbTotal;\n            IfFailGo( _CountBytesOfOneArg(&pbSig[cbTotal], &cb) );\n            cbTotal += cb;\n\n            // Parse for the rank\n            CHECK_REMAINDER;\n            cbTotal += CorSigUncompressData(&pbSig[cbTotal], &ulData);\n\n            // if rank == 0, we are done\n            if (ulData == 0)\n                break;\n\n            // any size of dimension specified?\n            CHECK_REMAINDER;\n            cbTotal += CorSigUncompressData(&pbSig[cbTotal], &ulData);\n            while (ulData--)\n            {\n                CHECK_REMAINDER;\n                cbTotal += CorSigUncompressData(&pbSig[cbTotal], &ulTemp);\n            }\n\n            // any lower bound specified?\n            CHECK_REMAINDER;\n            cbTotal += CorSigUncompressData(&pbSig[cbTotal], &ulData);\n\n            while (ulData--)\n            {\n                CHECK_REMAINDER;\n                cbTotal += CorSigUncompressSignedInt(&pbSig[cbTotal], &iData);\n            }\n\n            break;\n        case ELEMENT_TYPE_VALUETYPE:\n        case ELEMENT_TYPE_CLASS:\n        case ELEMENT_TYPE_CMOD_REQD:\n        case ELEMENT_TYPE_CMOD_OPT:\n            // count the bytes for the token compression\n            CHECK_REMAINDER;\n            cbTotal += CorSigUncompressToken(&pbSig[cbTotal], &tk);\n            if ( ulElementType == ELEMENT_TYPE_CMOD_REQD ||\n                 ulElementType == ELEMENT_TYPE_CMOD_OPT)\n            {\n                // skip over base type\n                CHECK_REMAINDER;\n                cb = cbTotalMax - cbTotal;\n                IfFailGo( _CountBytesOfOneArg(&pbSig[cbTotal], &cb) );\n                cbTotal += cb;\n            }\n            break;\n        default:\n            break;\n    }\n\n    *pcbTotal = cbTotal;\nErrExit:\n    return hr;\n}\n#undef CHECK_REMAINDER\n\n//*****************************************************************************\n// copy fixed part of VarArg signature to a buffer\n//*****************************************************************************\nHRESULT _GetFixedSigOfVarArg(           // S_OK or error.\n    PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob of COM+ method signature\n    ULONG   cbSigBlob,                  // [IN] size of signature\n    CQuickBytes *pqbSig,                // [OUT] output buffer for fixed part of VarArg Signature\n    ULONG   *pcbSigBlob)                // [OUT] number of bytes written to the above output buffer\n{\n    HRESULT     hr = NOERROR;\n    ULONG       cbCalling;\n    ULONG       cbTyArgsNumber = 0;     // number of bytes to store the type arg count (generics only)\n    ULONG       cbArgsNumber;           // number of bytes to store the original arg count\n    ULONG       cbArgsNumberTemp;       // number of bytes to store the fixed arg count\n    ULONG       cbTotal = 0;            // total of number bytes for return type + all fixed arguments\n    ULONG       cbCur = 0;              // index through the pvSigBlob\n    ULONG       cb;\n    ULONG       cArg;\n    ULONG       cTyArg;\n    ULONG       callingconv;\n    ULONG       cArgsIndex;\n    CorElementType ulElementType;\n    BYTE        *pbSig;\n\n    _ASSERTE (pvSigBlob && pcbSigBlob);\n\n    // remember the number of bytes to represent the calling convention\n    cbCalling = CorSigUncompressData (pvSigBlob, &callingconv);\n    if (cbCalling == ((ULONG)(-1)))\n    {\n        return E_INVALIDARG;\n    }\n    _ASSERTE (isCallConv(callingconv, IMAGE_CEE_CS_CALLCONV_VARARG));\n    cbCur += cbCalling;\n\n    if (callingconv & IMAGE_CEE_CS_CALLCONV_GENERIC)\n    {\n        cbTyArgsNumber = CorSigUncompressData(&pvSigBlob[cbCur], &cTyArg);\n        if (cbTyArgsNumber == ((ULONG)(-1)))\n        {\n            return E_INVALIDARG;\n        }\n        cbCur += cbTyArgsNumber;\n    }\n\n    // remember number of bytes to represent the arg counts\n    cbArgsNumber= CorSigUncompressData (&pvSigBlob[cbCur], &cArg);\n    if (cbArgsNumber == ((ULONG)(-1)))\n    {\n        return E_INVALIDARG;\n    }\n\n    cbCur += cbArgsNumber;\n\n    // how many bytes to represent the return type\n    cb = cbSigBlob-cbCur;\n    IfFailGo( _CountBytesOfOneArg( &pvSigBlob[cbCur], &cb) );\n    cbCur += cb;\n    cbTotal += cb;\n\n    // loop through argument until we found ELEMENT_TYPE_SENTINEL or run\n    // out of arguments\n    for (cArgsIndex = 0; cArgsIndex < cArg; cArgsIndex++)\n    {\n        _ASSERTE(cbCur < cbSigBlob);\n\n        // peak the outer most ELEMENT_TYPE_*\n        CorSigUncompressElementType (&pvSigBlob[cbCur], &ulElementType);\n        if (ulElementType == ELEMENT_TYPE_SENTINEL)\n            break;\n        cb = cbSigBlob-cbCur;\n        IfFailGo( _CountBytesOfOneArg( &pvSigBlob[cbCur], &cb) );\n        cbTotal += cb;\n        cbCur += cb;\n    }\n\n    cbArgsNumberTemp = CorSigCompressData(cArgsIndex, &cArg);\n\n    // now cbCalling : the number of bytes needed to store the calling convention\n    // cbArgNumberTemp : number of bytes to store the fixed arg count\n    // cbTotal : the number of bytes to store the ret and fixed arguments\n\n    *pcbSigBlob = cbCalling + cbArgsNumberTemp + cbTotal;\n\n    // resize the buffer\n    IfFailGo( pqbSig->ReSizeNoThrow(*pcbSigBlob) );\n    pbSig = (BYTE *)pqbSig->Ptr();\n\n    // copy over the calling convention\n    cb = CorSigCompressData(callingconv, pbSig);\n\n    // copy over the fixed arg count\n    cbArgsNumberTemp = CorSigCompressData(cArgsIndex, &pbSig[cb]);\n\n    // copy over the fixed args + ret type\n    memcpy(&pbSig[cb + cbArgsNumberTemp], &pvSigBlob[cbCalling + cbArgsNumber], cbTotal);\n\nErrExit:\n    return hr;\n}\n\n\n#endif // !SOS_INCLUDE\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corhlprpriv.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** Corhlprpriv.h -                                                                 **\n **                                                                         **\n *****************************************************************************/\n\n#ifndef __CORHLPRPRIV_H__\n#define __CORHLPRPRIV_H__\n\n#include \"corhlpr.h\"\n#include \"fstring.h\"\n\n#if defined(_MSC_VER) && defined(HOST_X86)\n#pragma optimize(\"y\", on)\t\t// If routines don't get inlined, don't pay the EBP frame penalty\n#endif\n\n//*****************************************************************************\n//\n//***** Utility helpers\n//\n//*****************************************************************************\n\n#ifndef SOS_INCLUDE\n\n//*****************************************************************************\n//\n// **** CQuickBytes\n// This helper class is useful for cases where 90% of the time you allocate 512\n// or less bytes for a data structure.  This class contains a 512 byte buffer.\n// Alloc() will return a pointer to this buffer if your allocation is small\n// enough, otherwise it asks the heap for a larger buffer which is freed for\n// you.  No mutex locking is required for the small allocation case, making the\n// code run faster, less heap fragmentation, etc...  Each instance will allocate\n// 520 bytes, so use accordinly.\n//\n//*****************************************************************************\nnamespace NSQuickBytesHelper\n{\n    template <BOOL bThrow>\n    struct _AllocBytes;\n\n    template <>\n    struct _AllocBytes<TRUE>\n    {\n        static BYTE *Invoke(SIZE_T iItems)\n        {\n            return NEW_THROWS(iItems);\n        }\n    };\n\n    template <>\n    struct _AllocBytes<FALSE>\n    {\n        static BYTE *Invoke(SIZE_T iItems)\n        {\n            return NEW_NOTHROW(iItems);\n        }\n    };\n};\n\nvoid DECLSPEC_NORETURN ThrowHR(HRESULT hr);\n\ntemplate <SIZE_T SIZE, SIZE_T INCREMENT>\nclass CQuickMemoryBase\n{\nprotected:\n    template <typename ELEM_T>\n    static ELEM_T Min(ELEM_T a, ELEM_T b)\n        { return a < b ? a : b; }\n\n    template <typename ELEM_T>\n    static ELEM_T Max(ELEM_T a, ELEM_T b)\n        { return a < b ? b : a; }\n\n    // bGrow  - indicates that this is a resize and that the original data\n    //          needs to be copied over.\n    // bThrow - indicates whether or not memory allocations will throw.\n    template <BOOL bGrow, BOOL bThrow>\n    void *_Alloc(SIZE_T iItems)\n    {\n#if defined(_BLD_CLR) && defined(_DEBUG)\n        {  // Exercise heap for OOM-fault injection purposes\n            BYTE * pb = NSQuickBytesHelper::_AllocBytes<bThrow>::Invoke(iItems);\n            _ASSERTE(!bThrow || pb != NULL); // _AllocBytes would have thrown if bThrow == TRUE\n            if (pb == NULL) return NULL; // bThrow == FALSE and we failed to allocate memory\n            delete [] pb; // Success, delete allocated memory.\n        }\n#endif\n        if (iItems <= cbTotal)\n        {   // Fits within existing memory allocation\n            iSize = iItems;\n        }\n        else if (iItems <= SIZE)\n        {   // Will fit in internal buffer.\n            if (pbBuff == NULL)\n            {   // Any previous allocation is in the internal buffer and the new\n                // allocation fits in the internal buffer, so just update the size.\n                iSize = iItems;\n                cbTotal = SIZE;\n            }\n            else\n            {   // There was a previous allocation, sitting in pbBuff\n                if (bGrow)\n                {   // If growing, need to copy any existing data over.\n                    memcpy(&rgData[0], pbBuff, Min(cbTotal, SIZE));\n                }\n\n                delete [] pbBuff;\n                pbBuff = NULL;\n                iSize = iItems;\n                cbTotal = SIZE;\n            }\n        }\n        else\n        {   // Need to allocate a new buffer\n            SIZE_T cbTotalNew = iItems + (bGrow ? INCREMENT : 0);\n            BYTE * pbBuffNew = NSQuickBytesHelper::_AllocBytes<bThrow>::Invoke(cbTotalNew);\n\n            if (!bThrow && pbBuffNew == NULL)\n            {   // Allocation failed. Zero out structure.\n                if (pbBuff != NULL)\n                {   // Delete old buffer\n                    delete [] pbBuff;\n                }\n                pbBuff = NULL;\n                iSize = 0;\n                cbTotal = 0;\n                return NULL;\n            }\n\n            if (bGrow && cbTotal > 0)\n            {   // If growing, need to copy any existing data over.\n                memcpy(pbBuffNew, (BYTE *)Ptr(), Min(cbTotal, cbTotalNew));\n            }\n\n            if (pbBuff != NULL)\n            {   // Delete old pre-existing buffer\n                delete [] pbBuff;\n                pbBuff = NULL;\n            }\n\n            pbBuff = pbBuffNew;\n            cbTotal = cbTotalNew;\n            iSize = iItems;\n        }\n\n        return Ptr();\n    }\n\npublic:\n    void Init()\n    {\n        pbBuff = 0;\n        iSize = 0;\n        cbTotal = SIZE;\n    }\n\n    void Destroy()\n    {\n        if (pbBuff)\n        {\n            delete [] pbBuff;\n            pbBuff = 0;\n        }\n    }\n\n    void *AllocThrows(SIZE_T iItems)\n    {\n        return _Alloc<FALSE /*bGrow*/, TRUE /*bThrow*/>(iItems);\n    }\n\n    void *AllocNoThrow(SIZE_T iItems)\n    {\n        return _Alloc<FALSE /*bGrow*/, FALSE /*bThrow*/>(iItems);\n    }\n\n    void ReSizeThrows(SIZE_T iItems)\n    {\n        _Alloc<TRUE /*bGrow*/, TRUE /*bThrow*/>(iItems);\n    }\n\n#ifdef __GNUC__\n    // This makes sure that we will not get an undefined symbol\n    // when building a release version of libcoreclr using LLVM/GCC.\n    __attribute__((used))\n#endif // __GNUC__\n    HRESULT ReSizeNoThrow(SIZE_T iItems);\n\n    void Shrink(SIZE_T iItems)\n    {\n        _ASSERTE(iItems <= cbTotal);\n        iSize = iItems;\n    }\n\n    operator PVOID()\n    {\n        return ((pbBuff) ? pbBuff : (PVOID)&rgData[0]);\n    }\n\n    void *Ptr()\n    {\n        return ((pbBuff) ? pbBuff : (PVOID)&rgData[0]);\n    }\n\n    const void *Ptr() const\n    {\n        return ((pbBuff) ? pbBuff : (PVOID)&rgData[0]);\n    }\n\n    SIZE_T Size() const\n    {\n        return (iSize);\n    }\n\n    SIZE_T MaxSize() const\n    {\n        return (cbTotal);\n    }\n\n    void Maximize()\n    {\n        iSize = cbTotal;\n    }\n\n\n    // Convert UTF8 string to UNICODE string, optimized for speed\n    HRESULT ConvertUtf8_UnicodeNoThrow(const char * utf8str)\n    {\n        bool allAscii;\n        DWORD length;\n\n        HRESULT hr = FString::Utf8_Unicode_Length(utf8str, & allAscii, & length);\n\n        if (SUCCEEDED(hr))\n        {\n            LPWSTR buffer = (LPWSTR) AllocNoThrow((length + 1) * sizeof(WCHAR));\n\n            if (buffer == NULL)\n            {\n                hr = E_OUTOFMEMORY;\n            }\n            else\n            {\n                hr = FString::Utf8_Unicode(utf8str, allAscii, buffer, length);\n            }\n        }\n\n        return hr;\n    }\n\n    // Convert UTF8 string to UNICODE string, optimized for speed\n    void ConvertUtf8_Unicode(const char * utf8str)\n    {\n        bool allAscii;\n        DWORD length;\n\n        HRESULT hr = FString::Utf8_Unicode_Length(utf8str, & allAscii, & length);\n\n        if (SUCCEEDED(hr))\n        {\n            LPWSTR buffer = (LPWSTR) AllocThrows((length + 1) * sizeof(WCHAR));\n\n            hr = FString::Utf8_Unicode(utf8str, allAscii, buffer, length);\n        }\n\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n    }\n\n    // Convert UNICODE string to UTF8 string, optimized for speed\n    void ConvertUnicode_Utf8(const WCHAR * pString)\n    {\n        bool allAscii;\n        DWORD length;\n\n        HRESULT hr = FString::Unicode_Utf8_Length(pString, & allAscii, & length);\n\n        if (SUCCEEDED(hr))\n        {\n            LPSTR buffer = (LPSTR) AllocThrows((length + 1) * sizeof(char));\n\n            hr = FString::Unicode_Utf8(pString, allAscii, buffer, length);\n        }\n\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n    }\n\n    // Copy single byte string and hold it\n    const char * SetStringNoThrow(const char * pStr, SIZE_T len)\n    {\n        LPSTR buffer = (LPSTR) AllocNoThrow(len + 1);\n\n        if (buffer != NULL)\n        {\n            memcpy(buffer, pStr, len);\n            buffer[len] = 0;\n        }\n\n        return buffer;\n    }\n\n#ifdef DACCESS_COMPILE\n    void\n    EnumMemoryRegions(CLRDataEnumMemoryFlags flags)\n    {\n        // Assume that 'this' is enumerated, either explicitly\n        // or because this class is embedded in another.\n        DacEnumMemoryRegion(dac_cast<TADDR>(pbBuff), iSize);\n    }\n#endif // DACCESS_COMPILE\n\n    BYTE       *pbBuff;\n    SIZE_T      iSize;              // number of bytes used\n    SIZE_T      cbTotal;            // total bytes allocated in the buffer\n    // use UINT64 to enforce the alignment of the memory\n    UINT64 rgData[(SIZE+sizeof(UINT64)-1)/sizeof(UINT64)];\n};\n\n// These should be multiples of 8 so that data can be naturally aligned.\n#define     CQUICKBYTES_BASE_SIZE           512\n#define     CQUICKBYTES_INCREMENTAL_SIZE    128\n\nclass CQuickBytesBase : public CQuickMemoryBase<CQUICKBYTES_BASE_SIZE, CQUICKBYTES_INCREMENTAL_SIZE>\n{\n};\n\n\nclass CQuickBytes : public CQuickBytesBase\n{\npublic:\n    CQuickBytes()\n    {\n        Init();\n    }\n\n    ~CQuickBytes()\n    {\n        Destroy();\n    }\n};\n\n/* to be used as static variable - no constructor/destructor, assumes zero\n   initialized memory */\nclass CQuickBytesStatic : public CQuickBytesBase\n{\n};\n\ntemplate <SIZE_T CQUICKBYTES_BASE_SPECIFY_SIZE>\nclass CQuickBytesSpecifySizeBase : public CQuickMemoryBase<CQUICKBYTES_BASE_SPECIFY_SIZE, CQUICKBYTES_INCREMENTAL_SIZE>\n{\n};\n\ntemplate <SIZE_T CQUICKBYTES_BASE_SPECIFY_SIZE>\nclass CQuickBytesSpecifySize : public CQuickBytesSpecifySizeBase<CQUICKBYTES_BASE_SPECIFY_SIZE>\n{\npublic:\n    CQuickBytesSpecifySize()\n    {\n        this->Init();\n    }\n\n    ~CQuickBytesSpecifySize()\n    {\n        this->Destroy();\n    }\n};\n\n/* to be used as static variable - no constructor/destructor, assumes zero\n   initialized memory */\ntemplate <SIZE_T CQUICKBYTES_BASE_SPECIFY_SIZE>\nclass CQuickBytesSpecifySizeStatic : public CQuickBytesSpecifySizeBase<CQUICKBYTES_BASE_SPECIFY_SIZE>\n{\n};\n\ntemplate <class T> class CQuickArrayBase : public CQuickBytesBase\n{\npublic:\n    T* AllocThrows(SIZE_T iItems)\n    {\n        CheckOverflowThrows(iItems);\n        return (T*)CQuickBytesBase::AllocThrows(iItems * sizeof(T));\n    }\n\n    void ReSizeThrows(SIZE_T iItems)\n    {\n        CheckOverflowThrows(iItems);\n        CQuickBytesBase::ReSizeThrows(iItems * sizeof(T));\n    }\n\n    T* AllocNoThrow(SIZE_T iItems)\n    {\n        if (!CheckOverflowNoThrow(iItems))\n        {\n            return NULL;\n        }\n        return (T*)CQuickBytesBase::AllocNoThrow(iItems * sizeof(T));\n    }\n\n    HRESULT ReSizeNoThrow(SIZE_T iItems)\n    {\n        if (!CheckOverflowNoThrow(iItems))\n        {\n            return E_OUTOFMEMORY;\n        }\n        return CQuickBytesBase::ReSizeNoThrow(iItems * sizeof(T));\n    }\n\n    void Shrink(SIZE_T iItems)\n    {\n        CQuickBytesBase::Shrink(iItems * sizeof(T));\n    }\n\n    T* Ptr()\n    {\n        return (T*) CQuickBytesBase::Ptr();\n    }\n\n    const T* Ptr() const\n    {\n        return (T*) CQuickBytesBase::Ptr();\n    }\n\n    SIZE_T Size() const\n    {\n        return CQuickBytesBase::Size() / sizeof(T);\n    }\n\n    SIZE_T MaxSize() const\n    {\n        return CQuickBytesBase::cbTotal / sizeof(T);\n    }\n\n    T& operator[] (SIZE_T ix)\n    {\n        _ASSERTE(ix < Size());\n        return *(Ptr() + ix);\n    }\n\n    const T& operator[] (SIZE_T ix) const\n    {\n        _ASSERTE(ix < Size());\n        return *(Ptr() + ix);\n    }\n\nprivate:\n    inline\n    BOOL CheckOverflowNoThrow(SIZE_T iItems)\n    {\n        SIZE_T totalSize = iItems * sizeof(T);\n\n        if (totalSize / sizeof(T) != iItems)\n        {\n            return FALSE;\n        }\n\n        return TRUE;\n    }\n\n    inline\n    void CheckOverflowThrows(SIZE_T iItems)\n    {\n        if (!CheckOverflowNoThrow(iItems))\n        {\n            THROW_OUT_OF_MEMORY();\n        }\n    }\n};\n\ntemplate <class T> class CQuickArray : public CQuickArrayBase<T>\n{\npublic:\n    CQuickArray<T>()\n    {\n        this->Init();\n    }\n\n    ~CQuickArray<T>()\n    {\n        this->Destroy();\n    }\n};\n\n// This is actually more of a stack with array access. Essentially, you can\n// only add elements through Push and remove them through Pop, but you can\n// access and modify any random element with the index operator. You cannot\n// access elements that have not been added.\n\ntemplate <class T>\nclass CQuickArrayList : protected CQuickArray<T>\n{\nprivate:\n    SIZE_T m_curSize;\n\npublic:\n    // Make these specific functions public.\n    using CQuickArray<T>::AllocThrows;\n    using CQuickArray<T>::ReSizeThrows;\n    using CQuickArray<T>::AllocNoThrow;\n    using CQuickArray<T>::ReSizeNoThrow;\n    using CQuickArray<T>::MaxSize;\n    using CQuickArray<T>::Ptr;\n\n    CQuickArrayList()\n        : m_curSize(0)\n    {\n        this->Init();\n    }\n\n    ~CQuickArrayList()\n    {\n        this->Destroy();\n    }\n\n    // Can only access values that have been pushed.\n    T& operator[] (SIZE_T ix)\n    {\n        _ASSERTE(ix < m_curSize);\n        return CQuickArray<T>::operator[](ix);\n    }\n\n    // Can only access values that have been pushed.\n    const T& operator[] (SIZE_T ix) const\n    {\n        _ASSERTE(ix < m_curSize);\n        return CQuickArray<T>::operator[](ix);\n    }\n\n    // THROWS: Resizes if necessary.\n    void Push(const T & value)\n    {\n        // Resize if necessary - thows.\n        if (m_curSize + 1 >= CQuickArray<T>::Size())\n            ReSizeThrows((m_curSize + 1) * 2);\n\n        // Append element to end of array.\n        _ASSERTE(m_curSize + 1 < CQuickArray<T>::Size());\n        SIZE_T ix = m_curSize++;\n        (*this)[ix] = value;\n    }\n\n    // NOTHROW: Resizes if necessary.\n    BOOL PushNoThrow(const T & value)\n    {\n        // Resize if necessary - nothow.\n        if (m_curSize + 1 >= CQuickArray<T>::Size()) {\n            if (ReSizeNoThrow((m_curSize + 1) * 2) != NOERROR)\n                return FALSE;\n        }\n\n        // Append element to end of array.\n        _ASSERTE(m_curSize + 1 < CQuickArray<T>::Size());\n        SIZE_T ix = m_curSize++;\n        (*this)[ix] = value;\n        return TRUE;\n    }\n\n    T Pop()\n    {\n        _ASSERTE(m_curSize > 0);\n        T retval = (*this)[m_curSize - 1];\n        INDEBUG(ZeroMemory(&(this->Ptr()[m_curSize - 1]), sizeof(T));)\n        --m_curSize;\n        return retval;\n    }\n\n    SIZE_T Size() const\n    {\n        return m_curSize;\n    }\n\n    void Shrink()\n    {\n        CQuickArray<T>::Shrink(m_curSize);\n    }\n};\n\n\n/* to be used as static variable - no constructor/destructor, assumes zero\n   initialized memory */\ntemplate <class T> class CQuickArrayStatic : public CQuickArrayBase<T>\n{\n};\n\ntypedef CQuickArrayBase<WCHAR> CQuickWSTRBase;\ntypedef CQuickArray<WCHAR> CQuickWSTR;\ntypedef CQuickArrayStatic<WCHAR> CQuickWSTRStatic;\n\ntypedef CQuickArrayBase<CHAR> CQuickSTRBase;\ntypedef CQuickArray<CHAR> CQuickSTR;\ntypedef CQuickArrayStatic<CHAR> CQuickSTRStatic;\n\nclass RidBitmap\n{\npublic:\n    HRESULT InsertToken(mdToken token)\n    {\n        HRESULT  hr     = S_OK;\n        mdToken  rid    = RidFromToken(token);\n        SIZE_T   index  = rid / 8;\n        BYTE     bit    = (BYTE)(1 << (rid % 8));\n\n        if (index >= buffer.Size())\n        {\n            SIZE_T oldSize = buffer.Size();\n            SIZE_T newSize = index+1+oldSize/8;\n            IfFailRet(buffer.ReSizeNoThrow(newSize));\n            memset(&buffer[oldSize], 0, newSize-oldSize);\n        }\n\n        buffer[index] |= bit;\n        return hr;\n    }\n\n    bool IsTokenInBitmap(mdToken token)\n    {\n        mdToken rid   = RidFromToken(token);\n        SIZE_T  index = rid / 8;\n        BYTE    bit   = (BYTE)(1 << (rid % 8));\n\n        return ((index < buffer.Size()) && (buffer[index] & bit));\n    }\n\n    void Reset()\n    {\n        if (buffer.Size())\n        {\n            memset(&buffer[0], 0, buffer.Size());\n        }\n    }\n\nprivate:\n    CQuickArray<BYTE> buffer;\n};\n\n//*****************************************************************************\n//\n//***** Signature helpers\n//\n//*****************************************************************************\n\nHRESULT _CountBytesOfOneArg(\n    PCCOR_SIGNATURE pbSig,\n    ULONG       *pcbTotal);\n\nHRESULT _GetFixedSigOfVarArg(           // S_OK or error.\n    PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob of CLR signature\n    ULONG   cbSigBlob,                  // [IN] size of signature\n    CQuickBytes *pqbSig,                // [OUT] output buffer for fixed part of VarArg Signature\n    ULONG   *pcbSigBlob);               // [OUT] number of bytes written to the above output buffer\n\n#endif //!SOS_INCLUDE\n\n#if defined(_MSC_VER) && defined(TARGET_X86)\n#pragma optimize(\"\", on)\t\t// restore command line default optimizations\n#endif\n\n\n//---------------------------------------------------------------------------------------\n//\n// Reads compressed integer from buffer pData, fills the result to *pnDataOut. Advances buffer pointer.\n// Doesn't read behind the end of the buffer (the end starts at pDataEnd).\n//\ninline\n__checkReturn\nHRESULT\nCorSigUncompressData_EndPtr(\n    PCCOR_SIGNATURE & pData,        // [IN,OUT] Buffer\n    PCCOR_SIGNATURE   pDataEnd,     // End of buffer\n    DWORD *           pnDataOut)    // [OUT] Compressed integer read from the buffer\n{\n    _ASSERTE(pData <= pDataEnd);\n    HRESULT hr = S_OK;\n\n    INT_PTR cbDataSize = pDataEnd - pData;\n    if (cbDataSize > 4)\n    {   // Compressed integer cannot be bigger than 4 bytes\n        cbDataSize = 4;\n    }\n    DWORD dwDataSize = (DWORD)cbDataSize;\n\n    ULONG cbDataOutLength;\n    IfFailRet(CorSigUncompressData(\n        pData,\n        dwDataSize,\n        pnDataOut,\n        &cbDataOutLength));\n    pData += cbDataOutLength;\n\n    return hr;\n} // CorSigUncompressData_EndPtr\n\n//---------------------------------------------------------------------------------------\n//\n// Reads CorElementType (1 byte) from buffer pData, fills the result to *pTypeOut. Advances buffer pointer.\n// Doesn't read behind the end of the buffer (the end starts at pDataEnd).\n//\ninline\n__checkReturn\nHRESULT\nCorSigUncompressElementType_EndPtr(\n    PCCOR_SIGNATURE & pData,    // [IN,OUT] Buffer\n    PCCOR_SIGNATURE   pDataEnd, // End of buffer\n    CorElementType *  pTypeOut) // [OUT] ELEMENT_TYPE_* value read from the buffer\n{\n    _ASSERTE(pData <= pDataEnd);\n    // We don't expect pData > pDataEnd, but the runtime check doesn't cost much and it is more secure in\n    // case caller has a bug\n    if (pData >= pDataEnd)\n    {   // No data\n        return META_E_BAD_SIGNATURE;\n    }\n    // Read 'type' as 1 byte\n    *pTypeOut = (CorElementType)*pData;\n    pData++;\n\n    return S_OK;\n} // CorSigUncompressElementType_EndPtr\n\n//---------------------------------------------------------------------------------------\n//\n// Reads pointer (4/8 bytes) from buffer pData, fills the result to *ppvPointerOut. Advances buffer pointer.\n// Doesn't read behind the end of the buffer (the end starts at pDataEnd).\n//\ninline\n__checkReturn\nHRESULT\nCorSigUncompressPointer_EndPtr(\n    PCCOR_SIGNATURE & pData,            // [IN,OUT] Buffer\n    PCCOR_SIGNATURE   pDataEnd,         // End of buffer\n    void **           ppvPointerOut)    // [OUT] Pointer value read from the buffer\n{\n    _ASSERTE(pData <= pDataEnd);\n    // We could just skip this check as pointers should be only in trusted (and therefore correct)\n    // signatures and we check for that on the caller side, but it won't hurt to have this check and it will\n    // make it easier to catch invalid signatures in trusted code (e.g. IL stubs, NGEN images, etc.)\n    if (pData + sizeof(void *) > pDataEnd)\n    {   // Not enough data in the buffer\n        _ASSERTE(!\"This signature is invalid. Note that caller should check that it is not coming from untrusted source!\");\n        return META_E_BAD_SIGNATURE;\n    }\n    *ppvPointerOut = *(void * UNALIGNED *)pData;\n    pData += sizeof(void *);\n\n    return S_OK;\n} // CorSigUncompressPointer_EndPtr\n\n//---------------------------------------------------------------------------------------\n//\n// Reads compressed TypeDef/TypeRef/TypeSpec token, fills the result to *pnDataOut. Advances buffer pointer.\n// Doesn't read behind the end of the buffer (the end starts at pDataEnd).\n//\ninline\n__checkReturn\nHRESULT\nCorSigUncompressToken_EndPtr(\n    PCCOR_SIGNATURE & pData,        // [IN,OUT] Buffer\n    PCCOR_SIGNATURE   pDataEnd,     // End of buffer\n    mdToken *         ptkTokenOut)  // [OUT] Token read from the buffer\n{\n    _ASSERTE(pData <= pDataEnd);\n    HRESULT hr = S_OK;\n\n    INT_PTR cbDataSize = pDataEnd - pData;\n    if (cbDataSize > 4)\n    {   // Compressed token cannot be bigger than 4 bytes\n        cbDataSize = 4;\n    }\n    DWORD dwDataSize = (DWORD)cbDataSize;\n\n    uint32_t cbTokenOutLength;\n    IfFailRet(CorSigUncompressToken(\n        pData,\n        dwDataSize,\n        ptkTokenOut,\n        &cbTokenOutLength));\n    pData += cbTokenOutLength;\n\n    return hr;\n} // CorSigUncompressToken_EndPtr\n\n#endif // __CORHLPRPRIV_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corhost.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n//*****************************************************************************\n// CorHost.h\n//\n// Class factories are used by the pluming in COM to activate new objects.\n// This module contains the class factory code to instantiate the debugger\n// objects described in <cordb.h>.\n//\n//*****************************************************************************\n\n#ifndef __CorHost__h__\n#define __CorHost__h__\n\n\n#include \"windows.h\" // worth to include before mscoree.h so we are guaranteed to pick few definitions\n#ifdef CreateSemaphore\n#undef CreateSemaphore\n#endif\n\n#include \"mscoree.h\"\n\n#include \"clrinternal.h\"\n\n#include \"holder.h\"\n\n#ifdef FEATURE_COMINTEROP\n#include \"activation.h\" // WinRT activation.\n#endif\n\nclass AppDomain;\nclass Assembly;\n\nclass CorHost2 : ICLRRuntimeHost4\n#ifndef TARGET_UNIX\n    , public IPrivateManagedExceptionReporting /* This interface is for internal Watson testing only*/\n#endif // TARGET_UNIX\n{\n    friend struct _DacGlobals;\n\npublic:\n    CorHost2();\n    virtual ~CorHost2() {}\n\n    // *** IUnknown methods ***\n    STDMETHODIMP    QueryInterface(REFIID riid, void** ppv);\n    STDMETHODIMP_(ULONG) AddRef(void);\n    STDMETHODIMP_(ULONG) Release(void);\n\n\n    // *** ICorRuntimeHost methods ***\n\n#ifndef TARGET_UNIX\n    // defined in IPrivateManagedExceptionReporting interface for internal Watson testing only\n    STDMETHODIMP GetBucketParametersForCurrentException(BucketParameters *pParams);\n#endif // TARGET_UNIX\n\n    // Starts the runtime. This is equivalent to CoInitializeCor().\n    STDMETHODIMP Start();\n    STDMETHODIMP Stop();\n\n    STDMETHODIMP ExecuteInAppDomain(DWORD dwAppDomainId,\n                                    FExecuteInAppDomainCallback pCallback,\n                                    void * cookie);\n\n    // Class factory hook-up.\n    static HRESULT CreateObject(REFIID riid, void **ppUnk);\n\n    STDMETHODIMP STDMETHODCALLTYPE SetHostControl(\n        IHostControl* pHostControl);\n\n    STDMETHODIMP STDMETHODCALLTYPE GetCLRControl(\n        ICLRControl** pCLRControl);\n\n    STDMETHODIMP UnloadAppDomain(DWORD dwDomainId, BOOL fWaitUntilDone);\n\n    STDMETHODIMP UnloadAppDomain2(DWORD dwDomainId, BOOL fWaitUntilDone, int *pLatchedExitCode);\n\n    STDMETHODIMP GetCurrentAppDomainId(DWORD *pdwAppDomainId);\n\n    STDMETHODIMP ExecuteApplication(LPCWSTR  pwzAppFullName,\n                                    DWORD    dwManifestPaths,\n                                    LPCWSTR  *ppwzManifestPaths,\n                                    DWORD    dwActivationData,\n                                    LPCWSTR  *ppwzActivationData,\n                                    int      *pReturnValue);\n\n    STDMETHODIMP ExecuteInDefaultAppDomain(LPCWSTR pwzAssemblyPath,\n                                           LPCWSTR pwzTypeName,\n                                           LPCWSTR pwzMethodName,\n                                           LPCWSTR pwzArgument,\n                                           DWORD   *pReturnValue);\n\n    // *** ICLRRuntimeHost2 methods ***\n    STDMETHODIMP CreateAppDomainWithManager(\n        LPCWSTR wszFriendlyName,\n        DWORD  dwSecurityFlags,\n        LPCWSTR wszAppDomainManagerAssemblyName,\n        LPCWSTR wszAppDomainManagerTypeName,\n        int nProperties,\n        LPCWSTR* pPropertyNames,\n        LPCWSTR* pPropertyValues,\n        DWORD* pAppDomainID);\n\n    STDMETHODIMP CreateDelegate(\n        DWORD appDomainID,\n        LPCWSTR wszAssemblyName,\n        LPCWSTR wszClassName,\n        LPCWSTR wszMethodName,\n        INT_PTR* fnPtr);\n\n    STDMETHODIMP Authenticate(ULONGLONG authKey);\n\n    STDMETHODIMP RegisterMacEHPort();\n    STDMETHODIMP SetStartupFlags(STARTUP_FLAGS flag);\n    STDMETHODIMP DllGetActivationFactory(\n        DWORD appDomainID,\n        LPCWSTR wszTypeName,\n        IActivationFactory ** factory);\n\n    STDMETHODIMP ExecuteAssembly(\n        DWORD dwAppDomainId,\n        LPCWSTR pwzAssemblyPath,\n        int argc,\n        LPCWSTR* argv,\n        DWORD* pReturnValue);\n\n    static STARTUP_FLAGS GetStartupFlags();\n\n    static BOOL HasStarted()\n    {\n        return m_RefCount != 0;\n    }\n\nprivate:\n    LONG        m_cRef;                 // COM ref count.\n\n    // This flag indicates if this instance was the first to load and start CoreCLR\n    BOOL m_fFirstToLoadCLR;\n\n    // This flag will be used to ensure that a CoreCLR host can invoke Start/Stop in pairs only.\n    BOOL m_fStarted;\n    BOOL m_fAppDomainCreated; // this flag is used when an appdomain can only create a single appdomain\n\n    // entrypoint helper to be wrapped in a filter to process unhandled exceptions\n    VOID ExecuteMainInner(Assembly* pRootAssembly);\n\n    static LONG  m_RefCount;\n\n    SVAL_DECL(STARTUP_FLAGS, m_dwStartupFlags);\n};\n\n#endif // __CorHost__h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corimage.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n//\n\n/*============================================================\n**\n** CorImage.h\n**\n** IMAGEHLP routines so we can avoid early binding to that DLL.\n**\n===========================================================*/\n\n#ifndef _CORIMAGE_H_\n#define _CORIMAGE_H_\n\n#include <daccess.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nIMAGE_NT_HEADERS *Cor_RtlImageNtHeader(VOID *pvBase,\n                                       ULONG FileLength);\n\nPIMAGE_SECTION_HEADER\nCor_RtlImageRvaToSection(PTR_IMAGE_NT_HEADERS NtHeaders,\n                         ULONG Rva,\n                         ULONG FileLength);\n\nPIMAGE_SECTION_HEADER\nCor_RtlImageRvaRangeToSection(PTR_IMAGE_NT_HEADERS NtHeaders,\n                              ULONG Rva,\n                              ULONG Range,\n                              ULONG FileLength);\n\nDWORD Cor_RtlImageRvaToOffset(PTR_IMAGE_NT_HEADERS NtHeaders,\n                              ULONG Rva,\n                              ULONG FileLength);\n\nPBYTE Cor_RtlImageRvaToVa(PTR_IMAGE_NT_HEADERS NtHeaders,\n                          PBYTE Base,\n                          ULONG Rva,\n                          ULONG FileLength);\n\nPBYTE Cor_RtlImageDirToVa(PTR_IMAGE_NT_HEADERS NtHeaders,\n                          PBYTE Base,\n                          UINT  DirIndex,\n                          ULONG FileLength);\n\nPBYTE Cor_RtlImageRvaToVa32(PTR_IMAGE_NT_HEADERS32 NtHeaders,\n                            PBYTE Base,\n                            ULONG Rva,\n                            ULONG FileLength);\n\nPBYTE Cor_RtlImageRvaToVa64(PTR_IMAGE_NT_HEADERS64 NtHeaders,\n                            PBYTE Base,\n                            ULONG Rva,\n                            ULONG FileLength);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // _CORIMAGE_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corinfo.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n\n/*****************************************************************************\\\n*                                                                             *\n* CorInfo.h -    EE / Code generator interface                                *\n*                                                                             *\n*******************************************************************************\n*\n* This file exposes CLR runtime functionality. It can be used by compilers,\n* both Just-in-time and ahead-of-time, to generate native code which\n* executes in the runtime environment.\n*******************************************************************************\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n// The JIT/EE interface is versioned. By \"interface\", we mean mean any and all communication between the\n// JIT and the EE. Any time a change is made to the interface, the JIT/EE interface version identifier\n// must be updated. See code:JITEEVersionIdentifier for more information.\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n#EEJitContractDetails\n\nThe semantic contract between the EE and the JIT should be documented here It is incomplete, but as time goes\non, that hopefully will change\n\nSee file:../../doc/BookOfTheRuntime/JIT/JIT%20Design.doc for details on the JIT compiler. See\ncode:EEStartup#TableOfContents for information on the runtime as a whole.\n\n-------------------------------------------------------------------------------\n#Tokens\n\nThe tokens in IL stream needs to be resolved to EE handles (CORINFO_CLASS/METHOD/FIELD_HANDLE) that\nthe runtime operates with. ICorStaticInfo::resolveToken is the method that resolves the found in IL stream\nto set of EE handles (CORINFO_RESOLVED_TOKEN). All other APIs take resolved token as input. This design\navoids redundant token resolutions.\n\nThe token validation is done as part of token resolution. The JIT is not required to do explicit upfront\ntoken validation.\n\n-------------------------------------------------------------------------------\n#ClassConstruction\n\nFirst of all class construction comes in two flavors precise and 'beforeFieldInit'. In C# you get the former\nif you declare an explicit class constructor method and the later if you declaratively initialize static\nfields. Precise class construction guarantees that the .cctor is run precisely before the first access to any\nmethod or field of the class. 'beforeFieldInit' semantics guarantees only that the .cctor will be run some\ntime before the first static field access (note that calling methods (static or instance) or accessing\ninstance fields does not cause .cctors to be run).\n\nNext you need to know that there are two kinds of code generation that can happen in the JIT: appdomain\nneutral and appdomain specialized. The difference between these two kinds of code is how statics are handled.\nFor appdomain specific code, the address of a particular static variable is embedded in the code. This makes\nit usable only for one appdomain (since every appdomain gets a own copy of its statics). Appdomain neutral\ncode calls a helper that looks up static variables off of a thread local variable. Thus the same code can be\nused by multiple appdomains in the same process.\n\nGenerics also introduce a similar issue. Code for generic classes might be specialized for a particular set\nof type arguments, or it could use helpers to access data that depends on type parameters and thus be shared\nacross several instantiations of the generic type.\n\nThus there four cases\n\n    * BeforeFieldInitCCtor - Unshared code. Cctors are only called when static fields are fetched. At the\n        time the method that touches the static field is JITed (or fixed up in the case of NGENed code), the\n        .cctor is called.\n    * BeforeFieldInitCCtor - Shared code. Since the same code is used for multiple classes, the act of JITing\n        the code can not be used as a hook. However, it is also the case that since the code is shared, it\n        can not wire in a particular address for the static and thus needs to use a helper that looks up the\n        correct address based on the thread ID. This helper does the .cctor check, and thus no additional\n        cctor logic is needed.\n    * PreciseCCtor - Unshared code. Any time a method is JITTed (or fixed up in the case of NGEN), a cctor\n        check for the class of the method being JITTed is done. In addition the JIT inserts explicit checks\n        before any static field accesses. Instance methods and fields do NOT have hooks because a .ctor\n        method must be called before the instance can be created.\n    * PreciseCctor - Shared code .cctor checks are placed in the prolog of every .ctor and static method. All\n        methods that access static fields have an explicit .cctor check before use. Again instance methods\n        don't have hooks because a .ctor would have to be called first.\n\nTechnically speaking, however the optimization of avoiding checks on instance methods is flawed. It requires\nthat a .ctor always precede a call to an instance methods. This break down when\n\n    * A NULL is passed to an instance method.\n    * A .ctor does not call its superclasses .ctor. This allows an instance to be created without necessarily\n        calling all the .cctors of all the superclasses. A virtual call can then be made to a instance of a\n        superclass without necessarily calling the superclass's .cctor.\n    * The class is a value class (which exists without a .ctor being called)\n\nNevertheless, the cost of plugging these holes is considered to high and the benefit is low.\n\n----------------------------------------------------------------------\n\n#ClassConstructionFlags\n\nThus the JIT's cctor responsibilities require it to check with the EE on every static field access using\ninitClass and before jitting any method to see if a .cctor check must be placed in the prolog.\n\n    * CORINFO_FLG_BEFOREFIELDINIT indicate the class has beforeFieldInit semantics. The jit does not strictly\n        need this information however, it is valuable in optimizing static field fetch helper calls. Helper\n        call for classes with BeforeFieldInit semantics can be hoisted before other side effects where\n        classes with precise .cctor semantics do not allow this optimization.\n\nInlining also complicates things. Because the class could have precise semantics it is also required that the\ninlining of any constructor or static method must also do the initClass check. The inliner has the option of\ninserting any required runtime check or simply not inlining the function.\n\n-------------------------------------------------------------------------------\n\n#StaticFields\n\nThe first 4 options are mutually exclusive\n\n    * CORINFO_FLG_HELPER If the field has this set, then the JIT must call getFieldHelper and call the\n        returned helper with the object ref (for an instance field) and a fieldDesc. Note that this should be\n        able to handle ANY field so to get a JIT up quickly, it has the option of using helper calls for all\n        field access (and skip the complexity below). Note that for statics it is assumed that you will\n        always ask for the ADDRESS helper and to the fetch in the JIT.\n\n    * CORINFO_FLG_SHARED_HELPER This is currently only used for static fields. If this bit is set it means\n        that the field is feched by a helper call that takes a module identifier (see getModuleDomainID) and\n        a class identifier (see getClassDomainID) as arguments. The exact helper to call is determined by\n        getSharedStaticBaseHelper. The return value is of this function is the base of all statics in the\n        module. The offset from getFieldOffset must be added to this value to get the address of the field\n        itself. (see also CORINFO_FLG_STATIC_IN_HEAP).\n\n\n    * CORINFO_FLG_GENERICS_STATIC This is currently only used for static fields (of generic type). This\n        function is intended to be called with a Generic handle as a argument (from embedGenericHandle). The\n        exact helper to call is determined by getSharedStaticBaseHelper. The returned value is the base of\n        all statics in the class. The offset from getFieldOffset must be added to this value to get the\n        address of the (see also CORINFO_FLG_STATIC_IN_HEAP).\n\n    * CORINFO_FLG_TLS This indicate that the static field is a Windows style Thread Local Static. (We also\n        have managed thread local statics, which work through the HELPER. Support for this is considered\n        legacy, and going forward, the EE should\n\n    * <NONE> This is a normal static field. Its address in memory is determined by getFieldAddress. (see\n        also CORINFO_FLG_STATIC_IN_HEAP).\n\n\nThis last field can modify any of the cases above except CORINFO_FLG_HELPER\n\nCORINFO_FLG_STATIC_IN_HEAP This is currently only used for static fields of value classes. If the field has\nthis set then after computing what would normally be the field, what you actually get is a object pointer\n(that must be reported to the GC) to a boxed version of the value. Thus the actual field address is computed\nby addr = (*addr+sizeof(OBJECTREF))\n\nInstance fields\n\n    * CORINFO_FLG_HELPER This is used if the class is MarshalByRef, which means that the object might be a\n        proxy to the real object in some other appdomain or process. If the field has this set, then the JIT\n        must call getFieldHelper and call the returned helper with the object ref. If the helper returned is\n        helpers that are for structures the args are as follows\n\n    * CORINFO_HELP_GETFIELDSTRUCT - args are: retBuff, object, fieldDesc\n    * CORINFO_HELP_SETFIELDSTRUCT - args are object fieldDesc value\n\nThe other GET helpers take an object fieldDesc and return the value The other SET helpers take an object\nfieldDesc and value\n\n    Note that unlike static fields there is no helper to take the address of a field because in general there\n    is no address for proxies (LDFLDA is illegal on proxies).\n\n    CORINFO_FLG_EnC This is to support adding new field for edit and continue. This field also indicates that\n    a helper is needed to access this field. However this helper is always CORINFO_HELP_GETFIELDADDR, and\n    this helper always takes the object and field handle and returns the address of the field. It is the\n                            JIT's responsibility to do the fetch or set.\n\n-------------------------------------------------------------------------------\n\nTODO: Talk about initializing strutures before use\n\n\n*******************************************************************************\n*/\n\n#ifndef _COR_INFO_H_\n#define _COR_INFO_H_\n\n#include \"corhdr.h\"\n\n#if !defined(_In_)\n// Minimum set of SAL annotations so that non Windows builds work\n#define _In_\n#define _In_reads_(size)\n#define _Inout_updates_(size)\n#define _Out_\n#define _Out_writes_(size)\n#define _Outptr_\n#define _Outptr_opt_\n#define _Outptr_opt_result_maybenull_\n#define _Outptr_result_z_\n#define _Outptr_result_buffer_(size)\n#define _Outptr_opt_result_buffer_(size)\n#endif\n\n#include \"jiteeversionguid.h\"\n\n#ifdef _MSC_VER\ntypedef long JITINTERFACE_HRESULT;\n#else\ntypedef int JITINTERFACE_HRESULT;\n#endif // _MSC_VER\n\n// For System V on the CLR type system number of registers to pass in and return a struct is the same.\n// The CLR type system allows only up to 2 eightbytes to be passed in registers. There is no SSEUP classification types.\n#define CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS   2\n#define CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_RETURN_IN_REGISTERS 2\n#define CLR_SYSTEMV_MAX_STRUCT_BYTES_TO_PASS_IN_REGISTERS       16\n\n// System V struct passing\n// The Classification types are described in the ABI spec at https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf\nenum SystemVClassificationType : uint8_t\n{\n    SystemVClassificationTypeUnknown            = 0,\n    SystemVClassificationTypeStruct             = 1,\n    SystemVClassificationTypeNoClass            = 2,\n    SystemVClassificationTypeMemory             = 3,\n    SystemVClassificationTypeInteger            = 4,\n    SystemVClassificationTypeIntegerReference   = 5,\n    SystemVClassificationTypeIntegerByRef       = 6,\n    SystemVClassificationTypeSSE                = 7,\n    // SystemVClassificationTypeSSEUp           = Unused, // Not supported by the CLR.\n    // SystemVClassificationTypeX87             = Unused, // Not supported by the CLR.\n    // SystemVClassificationTypeX87Up           = Unused, // Not supported by the CLR.\n    // SystemVClassificationTypeComplexX87      = Unused, // Not supported by the CLR.\n};\n\n// Represents classification information for a struct.\nstruct SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR\n{\n    SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR()\n    {\n        Initialize();\n    }\n\n    bool                        passedInRegisters; // Whether the struct is passable/passed (this includes struct returning) in registers.\n    uint8_t                     eightByteCount;    // Number of eightbytes for this struct.\n    SystemVClassificationType   eightByteClassifications[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS]; // The eightbytes type classification.\n    uint8_t                     eightByteSizes[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS];           // The size of the eightbytes (an eightbyte could include padding. This represents the no padding size of the eightbyte).\n    uint8_t                     eightByteOffsets[CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS];         // The start offset of the eightbytes (in bytes).\n\n    // Members\n\n    //------------------------------------------------------------------------\n    // CopyFrom: Copies a struct classification into this one.\n    //\n    // Arguments:\n    //    'copyFrom' the struct classification to copy from.\n    //\n    void CopyFrom(const SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR& copyFrom)\n    {\n        passedInRegisters = copyFrom.passedInRegisters;\n        eightByteCount = copyFrom.eightByteCount;\n\n        for (int i = 0; i < CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS; i++)\n        {\n            eightByteClassifications[i] = copyFrom.eightByteClassifications[i];\n            eightByteSizes[i] = copyFrom.eightByteSizes[i];\n            eightByteOffsets[i] = copyFrom.eightByteOffsets[i];\n        }\n    }\n\n    //------------------------------------------------------------------------\n    // IsIntegralSlot: Returns whether the eightbyte at slotIndex is of integral type.\n    //\n    // Arguments:\n    //    'slotIndex' the slot number we are determining if it is of integral type.\n    //\n    // Return value:\n    //     returns true if we the eightbyte at index slotIndex is of integral type.\n    //\n\n    bool IsIntegralSlot(unsigned slotIndex) const\n    {\n        return ((eightByteClassifications[slotIndex] == SystemVClassificationTypeInteger) ||\n                (eightByteClassifications[slotIndex] == SystemVClassificationTypeIntegerReference) ||\n                (eightByteClassifications[slotIndex] == SystemVClassificationTypeIntegerByRef));\n    }\n\n    //------------------------------------------------------------------------\n    // IsSseSlot: Returns whether the eightbyte at slotIndex is SSE type.\n    //\n    // Arguments:\n    //    'slotIndex' the slot number we are determining if it is of SSE type.\n    //\n    // Return value:\n    //     returns true if we the eightbyte at index slotIndex is of SSE type.\n    //\n    // Follows the rules of the AMD64 System V ABI specification at https://software.intel.com/sites/default/files/article/402129/mpx-linux64-abi.pdf.\n    // Please refer to it for definitions/examples.\n    //\n    bool IsSseSlot(unsigned slotIndex) const\n    {\n        return (eightByteClassifications[slotIndex] == SystemVClassificationTypeSSE);\n    }\n\nprivate:\n    void Initialize()\n    {\n        passedInRegisters = false;\n        eightByteCount = 0;\n\n        for (int i = 0; i < CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS; i++)\n        {\n            eightByteClassifications[i] = SystemVClassificationTypeUnknown;\n            eightByteSizes[i] = 0;\n            eightByteOffsets[i] = 0;\n        }\n    }\n};\n\n// StructFloadFieldInfoFlags: used on LoongArch64 architecture by `getLoongArch64PassStructInRegisterFlags` API\n// to convey struct argument passing information.\n//\n// `STRUCT_NO_FLOAT_FIELD` means structs are not passed using the float register(s).\n//\n// Otherwise, and only for structs with no more than two fields and a total struct size no larger\n// than two pointers:\n//\n// The lowest four bits denote the floating-point info:\n//   bit 0: `1` means there is only one float or double field within the struct.\n//   bit 1: `1` means only the first field is floating-point type.\n//   bit 2: `1` means only the second field is floating-point type.\n//   bit 3: `1` means the two fields are both floating-point type.\n// The bits[5:4] denoting whether the field size is 8-bytes:\n//   bit 4: `1` means the first field's size is 8.\n//   bit 5: `1` means the second field's size is 8.\n//\n// Note that bit 0 and 3 cannot both be set.\nenum StructFloatFieldInfoFlags\n{\n    STRUCT_NO_FLOAT_FIELD         = 0x0,\n    STRUCT_FLOAT_FIELD_ONLY_ONE   = 0x1,\n    STRUCT_FLOAT_FIELD_ONLY_TWO   = 0x8,\n    STRUCT_FLOAT_FIELD_FIRST      = 0x2,\n    STRUCT_FLOAT_FIELD_SECOND     = 0x4,\n    STRUCT_FIRST_FIELD_SIZE_IS8   = 0x10,\n    STRUCT_SECOND_FIELD_SIZE_IS8  = 0x20,\n\n    STRUCT_FIRST_FIELD_DOUBLE     = (STRUCT_FLOAT_FIELD_FIRST | STRUCT_FIRST_FIELD_SIZE_IS8),\n    STRUCT_SECOND_FIELD_DOUBLE    = (STRUCT_FLOAT_FIELD_SECOND | STRUCT_SECOND_FIELD_SIZE_IS8),\n    STRUCT_FIELD_TWO_DOUBLES      = (STRUCT_FIRST_FIELD_SIZE_IS8 | STRUCT_SECOND_FIELD_SIZE_IS8 | STRUCT_FLOAT_FIELD_ONLY_TWO),\n\n    STRUCT_MERGE_FIRST_SECOND     = (STRUCT_FLOAT_FIELD_FIRST | STRUCT_FLOAT_FIELD_ONLY_TWO),\n    STRUCT_MERGE_FIRST_SECOND_8   = (STRUCT_FLOAT_FIELD_FIRST | STRUCT_FLOAT_FIELD_ONLY_TWO | STRUCT_SECOND_FIELD_SIZE_IS8),\n\n    STRUCT_HAS_FLOAT_FIELDS_MASK  = (STRUCT_FLOAT_FIELD_FIRST | STRUCT_FLOAT_FIELD_SECOND | STRUCT_FLOAT_FIELD_ONLY_TWO | STRUCT_FLOAT_FIELD_ONLY_ONE),\n    STRUCT_HAS_8BYTES_FIELDS_MASK = (STRUCT_FIRST_FIELD_SIZE_IS8 | STRUCT_SECOND_FIELD_SIZE_IS8),\n};\n\n#include \"corinfoinstructionset.h\"\n\n// CorInfoHelpFunc defines the set of helpers (accessed via the ICorDynamicInfo::getHelperFtn())\n// These helpers can be called by native code which executes in the runtime.\n// Compilers can emit calls to these helpers.\n//\n// The signatures of the helpers are below (see RuntimeHelperArgumentCheck)\n\nenum CorInfoHelpFunc\n{\n    CORINFO_HELP_UNDEF,         // invalid value. This should never be used\n\n    /* Arithmetic helpers */\n\n    CORINFO_HELP_DIV,           // For the ARM 32-bit integer divide uses a helper call :-(\n    CORINFO_HELP_MOD,\n    CORINFO_HELP_UDIV,\n    CORINFO_HELP_UMOD,\n\n    CORINFO_HELP_LLSH,\n    CORINFO_HELP_LRSH,\n    CORINFO_HELP_LRSZ,\n    CORINFO_HELP_LMUL,\n    CORINFO_HELP_LMUL_OVF,\n    CORINFO_HELP_ULMUL_OVF,\n    CORINFO_HELP_LDIV,\n    CORINFO_HELP_LMOD,\n    CORINFO_HELP_ULDIV,\n    CORINFO_HELP_ULMOD,\n    CORINFO_HELP_LNG2DBL,               // Convert a signed int64 to a double\n    CORINFO_HELP_ULNG2DBL,              // Convert a unsigned int64 to a double\n    CORINFO_HELP_DBL2INT,\n    CORINFO_HELP_DBL2INT_OVF,\n    CORINFO_HELP_DBL2LNG,\n    CORINFO_HELP_DBL2LNG_OVF,\n    CORINFO_HELP_DBL2UINT,\n    CORINFO_HELP_DBL2UINT_OVF,\n    CORINFO_HELP_DBL2ULNG,\n    CORINFO_HELP_DBL2ULNG_OVF,\n    CORINFO_HELP_FLTREM,\n    CORINFO_HELP_DBLREM,\n    CORINFO_HELP_FLTROUND,\n    CORINFO_HELP_DBLROUND,\n\n    /* Allocating a new object. Always use ICorClassInfo::getNewHelper() to decide\n       which is the right helper to use to allocate an object of a given type. */\n\n    CORINFO_HELP_NEWFAST,\n    CORINFO_HELP_NEWSFAST,          // allocator for small, non-finalizer, non-array object\n    CORINFO_HELP_NEWSFAST_FINALIZE, // allocator for small, finalizable, non-array object\n    CORINFO_HELP_NEWSFAST_ALIGN8,   // allocator for small, non-finalizer, non-array object, 8 byte aligned\n    CORINFO_HELP_NEWSFAST_ALIGN8_VC,// allocator for small, value class, 8 byte aligned\n    CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE, // allocator for small, finalizable, non-array object, 8 byte aligned\n    CORINFO_HELP_NEW_MDARR,// multi-dim array helper (with or without lower bounds - dimensions passed in as unmanaged array)\n    CORINFO_HELP_NEWARR_1_DIRECT,   // helper for any one dimensional array creation\n    CORINFO_HELP_NEWARR_1_OBJ,      // optimized 1-D object arrays\n    CORINFO_HELP_NEWARR_1_VC,       // optimized 1-D value class arrays\n    CORINFO_HELP_NEWARR_1_ALIGN8,   // like VC, but aligns the array start\n\n    CORINFO_HELP_STRCNS,            // create a new string literal\n    CORINFO_HELP_STRCNS_CURRENT_MODULE, // create a new string literal from the current module (used by NGen code)\n\n    /* Object model */\n\n    CORINFO_HELP_INITCLASS,         // Initialize class if not already initialized\n    CORINFO_HELP_INITINSTCLASS,     // Initialize class for instantiated type\n\n    // Use ICorClassInfo::getCastingHelper to determine\n    // the right helper to use\n\n    CORINFO_HELP_ISINSTANCEOFINTERFACE, // Optimized helper for interfaces\n    CORINFO_HELP_ISINSTANCEOFARRAY,  // Optimized helper for arrays\n    CORINFO_HELP_ISINSTANCEOFCLASS, // Optimized helper for classes\n    CORINFO_HELP_ISINSTANCEOFANY,   // Slow helper for any type\n\n    CORINFO_HELP_CHKCASTINTERFACE,\n    CORINFO_HELP_CHKCASTARRAY,\n    CORINFO_HELP_CHKCASTCLASS,\n    CORINFO_HELP_CHKCASTANY,\n    CORINFO_HELP_CHKCASTCLASS_SPECIAL, // Optimized helper for classes. Assumes that the trivial cases\n                                    // has been taken care of by the inlined check\n\n    CORINFO_HELP_ISINSTANCEOF_EXCEPTION,\n\n    CORINFO_HELP_BOX,               // Fast box helper. Only possible exception is OutOfMemory\n    CORINFO_HELP_BOX_NULLABLE,      // special form of boxing for Nullable<T>\n    CORINFO_HELP_UNBOX,\n    CORINFO_HELP_UNBOX_NULLABLE,    // special form of unboxing for Nullable<T>\n    CORINFO_HELP_GETREFANY,         // Extract the byref from a TypedReference, checking that it is the expected type\n\n    CORINFO_HELP_ARRADDR_ST,        // assign to element of object array with type-checking\n    CORINFO_HELP_LDELEMA_REF,       // does a precise type comparison and returns address\n\n    /* Exceptions */\n\n    CORINFO_HELP_THROW,             // Throw an exception object\n    CORINFO_HELP_RETHROW,           // Rethrow the currently active exception\n    CORINFO_HELP_USER_BREAKPOINT,   // For a user program to break to the debugger\n    CORINFO_HELP_RNGCHKFAIL,        // array bounds check failed\n    CORINFO_HELP_OVERFLOW,          // throw an overflow exception\n    CORINFO_HELP_THROWDIVZERO,      // throw a divide by zero exception\n    CORINFO_HELP_THROWNULLREF,      // throw a null reference exception\n\n    CORINFO_HELP_VERIFICATION,      // Throw a VerificationException\n    CORINFO_HELP_FAIL_FAST,         // Kill the process avoiding any exceptions or stack and data dependencies (use for GuardStack unsafe buffer checks)\n\n    CORINFO_HELP_METHOD_ACCESS_EXCEPTION,//Throw an access exception due to a failed member/class access check.\n    CORINFO_HELP_FIELD_ACCESS_EXCEPTION,\n    CORINFO_HELP_CLASS_ACCESS_EXCEPTION,\n\n    CORINFO_HELP_ENDCATCH,          // call back into the EE at the end of a catch block\n\n    /* Synchronization */\n\n    CORINFO_HELP_MON_ENTER,\n    CORINFO_HELP_MON_EXIT,\n    CORINFO_HELP_MON_ENTER_STATIC,\n    CORINFO_HELP_MON_EXIT_STATIC,\n\n    CORINFO_HELP_GETCLASSFROMMETHODPARAM, // Given a generics method handle, returns a class handle\n    CORINFO_HELP_GETSYNCFROMCLASSHANDLE,  // Given a generics class handle, returns the sync monitor\n                                          // in its ManagedClassObject\n\n    /* GC support */\n\n    CORINFO_HELP_STOP_FOR_GC,       // Call GC (force a GC)\n    CORINFO_HELP_POLL_GC,           // Ask GC if it wants to collect\n\n    CORINFO_HELP_STRESS_GC,         // Force a GC, but then update the JITTED code to be a noop call\n    CORINFO_HELP_CHECK_OBJ,         // confirm that ECX is a valid object pointer (debugging only)\n\n    /* GC Write barrier support */\n\n    CORINFO_HELP_ASSIGN_REF,        // universal helpers with F_CALL_CONV calling convention\n    CORINFO_HELP_CHECKED_ASSIGN_REF,\n    CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP,  // Do the store, and ensure that the target was not in the heap.\n\n    CORINFO_HELP_ASSIGN_BYREF,\n    CORINFO_HELP_ASSIGN_STRUCT,\n\n\n    /* Accessing fields */\n\n    // For COM object support (using COM get/set routines to update object)\n    // and EnC and cross-context support\n    CORINFO_HELP_GETFIELD8,\n    CORINFO_HELP_SETFIELD8,\n    CORINFO_HELP_GETFIELD16,\n    CORINFO_HELP_SETFIELD16,\n    CORINFO_HELP_GETFIELD32,\n    CORINFO_HELP_SETFIELD32,\n    CORINFO_HELP_GETFIELD64,\n    CORINFO_HELP_SETFIELD64,\n    CORINFO_HELP_GETFIELDOBJ,\n    CORINFO_HELP_SETFIELDOBJ,\n    CORINFO_HELP_GETFIELDSTRUCT,\n    CORINFO_HELP_SETFIELDSTRUCT,\n    CORINFO_HELP_GETFIELDFLOAT,\n    CORINFO_HELP_SETFIELDFLOAT,\n    CORINFO_HELP_GETFIELDDOUBLE,\n    CORINFO_HELP_SETFIELDDOUBLE,\n\n    CORINFO_HELP_GETFIELDADDR,\n\n    CORINFO_HELP_GETSTATICFIELDADDR_TLS,        // Helper for PE TLS fields\n\n    // There are a variety of specialized helpers for accessing static fields. The JIT should use\n    // ICorClassInfo::getSharedStaticsOrCCtorHelper to determine which helper to use\n\n    // Helpers for regular statics\n    CORINFO_HELP_GETGENERICS_GCSTATIC_BASE,\n    CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE,\n    CORINFO_HELP_GETSHARED_GCSTATIC_BASE,\n    CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE,\n    CORINFO_HELP_GETSHARED_GCSTATIC_BASE_NOCTOR,\n    CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE_NOCTOR,\n    CORINFO_HELP_GETSHARED_GCSTATIC_BASE_DYNAMICCLASS,\n    CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE_DYNAMICCLASS,\n    // Helper to class initialize shared generic with dynamicclass, but not get static field address\n    CORINFO_HELP_CLASSINIT_SHARED_DYNAMICCLASS,\n\n    // Helpers for thread statics\n    CORINFO_HELP_GETGENERICS_GCTHREADSTATIC_BASE,\n    CORINFO_HELP_GETGENERICS_NONGCTHREADSTATIC_BASE,\n    CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE,\n    CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE,\n    CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_NOCTOR,\n    CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR,\n    CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_DYNAMICCLASS,\n    CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_DYNAMICCLASS,\n\n    /* Debugger */\n\n    CORINFO_HELP_DBG_IS_JUST_MY_CODE,    // Check if this is \"JustMyCode\" and needs to be stepped through.\n\n    /* Profiling enter/leave probe addresses */\n    CORINFO_HELP_PROF_FCN_ENTER,        // record the entry to a method (caller)\n    CORINFO_HELP_PROF_FCN_LEAVE,        // record the completion of current method (caller)\n    CORINFO_HELP_PROF_FCN_TAILCALL,     // record the completion of current method through tailcall (caller)\n\n    /* Miscellaneous */\n\n    CORINFO_HELP_BBT_FCN_ENTER,         // record the entry to a method for collecting Tuning data\n\n    CORINFO_HELP_PINVOKE_CALLI,         // Indirect pinvoke call\n    CORINFO_HELP_TAILCALL,              // Perform a tail call\n\n    CORINFO_HELP_GETCURRENTMANAGEDTHREADID,\n\n    CORINFO_HELP_INIT_PINVOKE_FRAME,   // initialize an inlined PInvoke Frame for the JIT-compiler\n\n    CORINFO_HELP_MEMSET,                // Init block of memory\n    CORINFO_HELP_MEMCPY,                // Copy block of memory\n\n    CORINFO_HELP_RUNTIMEHANDLE_METHOD,          // determine a type/field/method handle at run-time\n    CORINFO_HELP_RUNTIMEHANDLE_METHOD_LOG,      // determine a type/field/method handle at run-time, with IBC logging\n    CORINFO_HELP_RUNTIMEHANDLE_CLASS,           // determine a type/field/method handle at run-time\n    CORINFO_HELP_RUNTIMEHANDLE_CLASS_LOG,       // determine a type/field/method handle at run-time, with IBC logging\n\n    CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE, // Convert from a TypeHandle (native structure pointer) to RuntimeType at run-time\n    CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE_MAYBENULL, // Convert from a TypeHandle (native structure pointer) to RuntimeType at run-time, the type may be null\n    CORINFO_HELP_METHODDESC_TO_STUBRUNTIMEMETHOD, // Convert from a MethodDesc (native structure pointer) to RuntimeMethodHandle at run-time\n    CORINFO_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD, // Convert from a FieldDesc (native structure pointer) to RuntimeFieldHandle at run-time\n    CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE, // Convert from a TypeHandle (native structure pointer) to RuntimeTypeHandle at run-time\n    CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE_MAYBENULL, // Convert from a TypeHandle (native structure pointer) to RuntimeTypeHandle at run-time, handle might point to a null type\n\n    CORINFO_HELP_ARE_TYPES_EQUIVALENT, // Check whether two TypeHandles (native structure pointers) are equivalent\n\n    CORINFO_HELP_VIRTUAL_FUNC_PTR,      // look up a virtual method at run-time\n\n    // Not a real helpers. Instead of taking handle arguments, these helpers point to a small stub that loads the handle argument and calls the static helper.\n    CORINFO_HELP_READYTORUN_NEW,\n    CORINFO_HELP_READYTORUN_NEWARR_1,\n    CORINFO_HELP_READYTORUN_ISINSTANCEOF,\n    CORINFO_HELP_READYTORUN_CHKCAST,\n    CORINFO_HELP_READYTORUN_STATIC_BASE,\n    CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR,\n    CORINFO_HELP_READYTORUN_GENERIC_HANDLE,\n    CORINFO_HELP_READYTORUN_DELEGATE_CTOR,\n    CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE,\n\n    CORINFO_HELP_EE_PERSONALITY_ROUTINE,// Not real JIT helper. Used in native images.\n    CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET,// Not real JIT helper. Used in native images to detect filter funclets.\n\n    // ASSIGN_REF_EAX - CHECKED_ASSIGN_REF_EBP: NOGC_WRITE_BARRIERS JIT helper calls\n    //\n    // For unchecked versions EDX is required to point into GC heap.\n    //\n    // NOTE: these helpers are only used for x86.\n    CORINFO_HELP_ASSIGN_REF_EAX,    // EAX holds GC ptr, do a 'mov [EDX], EAX' and inform GC\n    CORINFO_HELP_ASSIGN_REF_EBX,    // EBX holds GC ptr, do a 'mov [EDX], EBX' and inform GC\n    CORINFO_HELP_ASSIGN_REF_ECX,    // ECX holds GC ptr, do a 'mov [EDX], ECX' and inform GC\n    CORINFO_HELP_ASSIGN_REF_ESI,    // ESI holds GC ptr, do a 'mov [EDX], ESI' and inform GC\n    CORINFO_HELP_ASSIGN_REF_EDI,    // EDI holds GC ptr, do a 'mov [EDX], EDI' and inform GC\n    CORINFO_HELP_ASSIGN_REF_EBP,    // EBP holds GC ptr, do a 'mov [EDX], EBP' and inform GC\n\n    CORINFO_HELP_CHECKED_ASSIGN_REF_EAX,  // These are the same as ASSIGN_REF above ...\n    CORINFO_HELP_CHECKED_ASSIGN_REF_EBX,  // ... but also check if EDX points into heap.\n    CORINFO_HELP_CHECKED_ASSIGN_REF_ECX,\n    CORINFO_HELP_CHECKED_ASSIGN_REF_ESI,\n    CORINFO_HELP_CHECKED_ASSIGN_REF_EDI,\n    CORINFO_HELP_CHECKED_ASSIGN_REF_EBP,\n\n    CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, // Return the reference to a counter to decide to take cloned path in debug stress.\n    CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, // Print a message that a loop cloning optimization has occurred in debug mode.\n\n    CORINFO_HELP_THROW_ARGUMENTEXCEPTION,           // throw ArgumentException\n    CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, // throw ArgumentOutOfRangeException\n    CORINFO_HELP_THROW_NOT_IMPLEMENTED,             // throw NotImplementedException\n    CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED,      // throw PlatformNotSupportedException\n    CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED,          // throw TypeNotSupportedException\n    CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION, // throw AmbiguousResolutionException for failed static virtual method resolution\n\n    CORINFO_HELP_JIT_PINVOKE_BEGIN, // Transition to preemptive mode before a P/Invoke, frame is the first argument\n    CORINFO_HELP_JIT_PINVOKE_END,   // Transition to cooperative mode after a P/Invoke, frame is the first argument\n\n    CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER, // Transition to cooperative mode in reverse P/Invoke prolog, frame is the first argument\n    CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER_TRACK_TRANSITIONS, // Transition to cooperative mode and track transitions in reverse P/Invoke prolog.\n    CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT,  // Transition to preemptive mode in reverse P/Invoke epilog, frame is the first argument\n    CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT_TRACK_TRANSITIONS, // Transition to preemptive mode and track transitions in reverse P/Invoke prolog.\n\n    CORINFO_HELP_GVMLOOKUP_FOR_SLOT,        // Resolve a generic virtual method target from this pointer and runtime method handle\n\n    CORINFO_HELP_STACK_PROBE,               // Probes each page of the allocated stack frame\n\n    CORINFO_HELP_PATCHPOINT,                // Notify runtime that code has reached a patchpoint\n    CORINFO_HELP_PARTIAL_COMPILATION_PATCHPOINT,  // Notify runtime that code has reached a part of the method that wasn't originally jitted.\n\n    CORINFO_HELP_CLASSPROFILE32,            // Update 32-bit class profile for a call site\n    CORINFO_HELP_CLASSPROFILE64,            // Update 64-bit class profile for a call site\n    CORINFO_HELP_DELEGATEPROFILE32,         // Update 32-bit method profile for a delegate call site\n    CORINFO_HELP_DELEGATEPROFILE64,         // Update 64-bit method profile for a delegate call site\n    CORINFO_HELP_VTABLEPROFILE32,           // Update 32-bit method profile for a vtable call site\n    CORINFO_HELP_VTABLEPROFILE64,           // Update 64-bit method profile for a vtable call site\n\n    CORINFO_HELP_VALIDATE_INDIRECT_CALL,    // CFG: Validate function pointer\n    CORINFO_HELP_DISPATCH_INDIRECT_CALL,    // CFG: Validate and dispatch to pointer\n\n    CORINFO_HELP_COUNT,\n};\n\n//This describes the signature for a helper method.\nenum CorInfoHelpSig\n{\n    CORINFO_HELP_SIG_UNDEF,\n    CORINFO_HELP_SIG_NO_ALIGN_STUB,\n    CORINFO_HELP_SIG_NO_UNWIND_STUB,\n    CORINFO_HELP_SIG_REG_ONLY,\n    CORINFO_HELP_SIG_4_STACK,\n    CORINFO_HELP_SIG_8_STACK,\n    CORINFO_HELP_SIG_12_STACK,\n    CORINFO_HELP_SIG_16_STACK,\n\n    CORINFO_HELP_SIG_EBPCALL, //special calling convention that uses EDX and\n                              //EBP as arguments\n\n    CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB,\n\n    CORINFO_HELP_SIG_COUNT\n};\n\n// The enumeration is returned in 'getSig','getType', getArgType methods\nenum CorInfoType\n{\n    CORINFO_TYPE_UNDEF           = 0x0,\n    CORINFO_TYPE_VOID            = 0x1,\n    CORINFO_TYPE_BOOL            = 0x2,\n    CORINFO_TYPE_CHAR            = 0x3,\n    CORINFO_TYPE_BYTE            = 0x4,\n    CORINFO_TYPE_UBYTE           = 0x5,\n    CORINFO_TYPE_SHORT           = 0x6,\n    CORINFO_TYPE_USHORT          = 0x7,\n    CORINFO_TYPE_INT             = 0x8,\n    CORINFO_TYPE_UINT            = 0x9,\n    CORINFO_TYPE_LONG            = 0xa,\n    CORINFO_TYPE_ULONG           = 0xb,\n    CORINFO_TYPE_NATIVEINT       = 0xc,\n    CORINFO_TYPE_NATIVEUINT      = 0xd,\n    CORINFO_TYPE_FLOAT           = 0xe,\n    CORINFO_TYPE_DOUBLE          = 0xf,\n    CORINFO_TYPE_STRING          = 0x10,         // Not used, should remove\n    CORINFO_TYPE_PTR             = 0x11,\n    CORINFO_TYPE_BYREF           = 0x12,\n    CORINFO_TYPE_VALUECLASS      = 0x13,\n    CORINFO_TYPE_CLASS           = 0x14,\n    CORINFO_TYPE_REFANY          = 0x15,\n\n    // CORINFO_TYPE_VAR is for a generic type variable.\n    // Generic type variables only appear when the JIT is doing\n    // verification (not NOT compilation) of generic code\n    // for the EE, in which case we're running\n    // the JIT in \"import only\" mode.\n\n    CORINFO_TYPE_VAR             = 0x16,\n    CORINFO_TYPE_COUNT,                         // number of jit types\n};\n\nenum CorInfoTypeWithMod\n{\n    CORINFO_TYPE_MASK            = 0x3F,        // lower 6 bits are type mask\n    CORINFO_TYPE_MOD_PINNED      = 0x40,        // can be applied to CLASS, or BYREF to indicate pinned\n};\n\ninline CorInfoType strip(CorInfoTypeWithMod val) {\n    return CorInfoType(val & CORINFO_TYPE_MASK);\n}\n\n// The enumeration is returned in 'getSig'\n\nenum CorInfoCallConv\n{\n    // These correspond to CorCallingConvention\n\n    CORINFO_CALLCONV_DEFAULT    = 0x0,\n    // Instead of using the below values, use the CorInfoCallConvExtension enum for unmanaged calling conventions.\n    // CORINFO_CALLCONV_C          = 0x1,\n    // CORINFO_CALLCONV_STDCALL    = 0x2,\n    // CORINFO_CALLCONV_THISCALL   = 0x3,\n    // CORINFO_CALLCONV_FASTCALL   = 0x4,\n    CORINFO_CALLCONV_VARARG     = 0x5,\n    CORINFO_CALLCONV_FIELD      = 0x6,\n    CORINFO_CALLCONV_LOCAL_SIG  = 0x7,\n    CORINFO_CALLCONV_PROPERTY   = 0x8,\n    CORINFO_CALLCONV_UNMANAGED  = 0x9,\n    CORINFO_CALLCONV_NATIVEVARARG = 0xb,    // used ONLY for IL stub PInvoke vararg calls\n\n    CORINFO_CALLCONV_MASK       = 0x0f,     // Calling convention is bottom 4 bits\n    CORINFO_CALLCONV_GENERIC    = 0x10,\n    CORINFO_CALLCONV_HASTHIS    = 0x20,\n    CORINFO_CALLCONV_EXPLICITTHIS=0x40,\n    CORINFO_CALLCONV_PARAMTYPE  = 0x80,     // Passed last. Same as CORINFO_GENERICS_CTXT_FROM_PARAMTYPEARG\n};\n\n// Represents the calling conventions supported with the extensible calling convention syntax\n// as well as the original metadata-encoded calling conventions.\nenum class CorInfoCallConvExtension\n{\n    Managed,\n    C,\n    Stdcall,\n    Thiscall,\n    Fastcall,\n    // New calling conventions supported with the extensible calling convention encoding go here.\n    CMemberFunction,\n    StdcallMemberFunction,\n    FastcallMemberFunction\n};\n\n#ifdef TARGET_X86\ninline bool IsCallerPop(CorInfoCallConvExtension callConv)\n{\n#ifdef UNIX_X86_ABI\n    return callConv == CorInfoCallConvExtension::Managed || callConv == CorInfoCallConvExtension::C || callConv == CorInfoCallConvExtension::CMemberFunction;\n#else\n    return callConv == CorInfoCallConvExtension::C || callConv == CorInfoCallConvExtension::CMemberFunction;\n#endif // UNIX_X86_ABI\n}\n#endif\n\n// Determines whether or not this calling convention is an instance method calling convention.\ninline bool callConvIsInstanceMethodCallConv(CorInfoCallConvExtension callConv)\n{\n    return callConv == CorInfoCallConvExtension::Thiscall || callConv == CorInfoCallConvExtension::CMemberFunction || callConv == CorInfoCallConvExtension::StdcallMemberFunction || callConv == CorInfoCallConvExtension::FastcallMemberFunction;\n}\n\n// These are returned from getMethodOptions\nenum CorInfoOptions\n{\n    CORINFO_OPT_INIT_LOCALS                 = 0x00000010, // zero initialize all variables\n\n    CORINFO_GENERICS_CTXT_FROM_THIS         = 0x00000020, // is this shared generic code that access the generic context from the this pointer?  If so, then if the method has SEH then the 'this' pointer must always be reported and kept alive.\n    CORINFO_GENERICS_CTXT_FROM_METHODDESC   = 0x00000040, // is this shared generic code that access the generic context from the ParamTypeArg(that is a MethodDesc)?  If so, then if the method has SEH then the 'ParamTypeArg' must always be reported and kept alive. Same as CORINFO_CALLCONV_PARAMTYPE\n    CORINFO_GENERICS_CTXT_FROM_METHODTABLE  = 0x00000080, // is this shared generic code that access the generic context from the ParamTypeArg(that is a MethodTable)?  If so, then if the method has SEH then the 'ParamTypeArg' must always be reported and kept alive. Same as CORINFO_CALLCONV_PARAMTYPE\n    CORINFO_GENERICS_CTXT_MASK              = (CORINFO_GENERICS_CTXT_FROM_THIS |\n                                               CORINFO_GENERICS_CTXT_FROM_METHODDESC |\n                                               CORINFO_GENERICS_CTXT_FROM_METHODTABLE),\n    CORINFO_GENERICS_CTXT_KEEP_ALIVE        = 0x00000100, // Keep the generics context alive throughout the method even if there is no explicit use, and report its location to the CLR\n\n};\n\n//\n// what type of code region we are in\n//\nenum CorInfoRegionKind\n{\n    CORINFO_REGION_NONE,\n    CORINFO_REGION_HOT,\n    CORINFO_REGION_COLD,\n    CORINFO_REGION_JIT,\n};\n\n\n// these are the attribute flags for fields and methods (getMethodAttribs)\nenum CorInfoFlag\n{\n//  CORINFO_FLG_UNUSED                = 0x00000001,\n//  CORINFO_FLG_UNUSED                = 0x00000002,\n    CORINFO_FLG_PROTECTED             = 0x00000004,\n    CORINFO_FLG_STATIC                = 0x00000008,\n    CORINFO_FLG_FINAL                 = 0x00000010,\n    CORINFO_FLG_SYNCH                 = 0x00000020,\n    CORINFO_FLG_VIRTUAL               = 0x00000040,\n//  CORINFO_FLG_UNUSED                = 0x00000080,\n    CORINFO_FLG_NATIVE                = 0x00000100,\n    CORINFO_FLG_INTRINSIC_TYPE        = 0x00000200, // This type is marked by [Intrinsic]\n    CORINFO_FLG_ABSTRACT              = 0x00000400,\n\n    CORINFO_FLG_EnC                   = 0x00000800, // member was added by Edit'n'Continue\n\n    // These are internal flags that can only be on methods\n    CORINFO_FLG_FORCEINLINE           = 0x00010000, // The method should be inlined if possible.\n    CORINFO_FLG_SHAREDINST            = 0x00020000, // the code for this method is shared between different generic instantiations (also set on classes/types)\n    CORINFO_FLG_DELEGATE_INVOKE       = 0x00040000, // \"Delegate\n    CORINFO_FLG_PINVOKE               = 0x00080000, // Is a P/Invoke call\n//  CORINFO_FLG_UNUSED                = 0x00100000,\n    CORINFO_FLG_NOGCCHECK             = 0x00200000, // This method is FCALL that has no GC check.  Don't put alone in loops\n    CORINFO_FLG_INTRINSIC             = 0x00400000, // This method MAY have an intrinsic ID\n    CORINFO_FLG_CONSTRUCTOR           = 0x00800000, // This method is an instance or type initializer\n    CORINFO_FLG_AGGRESSIVE_OPT        = 0x01000000, // The method may contain hot code and should be aggressively optimized if possible\n    CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS = 0x02000000, // Indicates that tier 0 JIT should not be used for a method that contains a loop\n//  CORINFO_FLG_UNUSED                = 0x04000000,\n//  CORINFO_FLG_UNUSED                = 0x08000000,\n    CORINFO_FLG_DONT_INLINE           = 0x10000000, // The method should not be inlined\n    CORINFO_FLG_DONT_INLINE_CALLER    = 0x20000000, // The method should not be inlined, nor should its callers. It cannot be tail called.\n//  CORINFO_FLG_UNUSED                = 0x40000000,\n\n    // These are internal flags that can only be on Classes\n    CORINFO_FLG_VALUECLASS            = 0x00010000, // is the class a value class\n//  This flag is define din the Methods section, but is also valid on classes.\n//  CORINFO_FLG_SHAREDINST            = 0x00020000, // This class is satisfies TypeHandle::IsCanonicalSubtype\n    CORINFO_FLG_VAROBJSIZE            = 0x00040000, // the object size varies depending of constructor args\n    CORINFO_FLG_ARRAY                 = 0x00080000, // class is an array class (initialized differently)\n    CORINFO_FLG_OVERLAPPING_FIELDS    = 0x00100000, // struct or class has fields that overlap (aka union)\n    CORINFO_FLG_INTERFACE             = 0x00200000, // it is an interface\n    CORINFO_FLG_DONT_DIG_FIELDS       = 0x00400000, // don't ask field info, AOT can't rely on it (used for types outside of AOT compilation version bubble)\n    CORINFO_FLG_CUSTOMLAYOUT          = 0x00800000, // does this struct have custom layout?\n    CORINFO_FLG_CONTAINS_GC_PTR       = 0x01000000, // does the class contain a gc ptr ?\n    CORINFO_FLG_DELEGATE              = 0x02000000, // is this a subclass of delegate or multicast delegate ?\n    // CORINFO_FLG_UNUSED             = 0x04000000,\n    CORINFO_FLG_BYREF_LIKE            = 0x08000000, // it is byref-like value type\n    CORINFO_FLG_VARIANCE              = 0x10000000, // MethodTable::HasVariance (sealed does *not* mean uncast-able)\n    CORINFO_FLG_BEFOREFIELDINIT       = 0x20000000, // Additional flexibility for when to run .cctor (see code:#ClassConstructionFlags)\n    CORINFO_FLG_GENERIC_TYPE_VARIABLE = 0x40000000, // This is really a handle for a variable type\n    CORINFO_FLG_UNSAFE_VALUECLASS     = 0x80000000, // Unsafe (C++'s /GS) value type\n};\n\n// Flags computed by a runtime compiler\nenum CorInfoMethodRuntimeFlags\n{\n    CORINFO_FLG_BAD_INLINEE         = 0x00000001, // The method is not suitable for inlining\n    // unused                       = 0x00000002,\n    // unused                       = 0x00000004,\n    CORINFO_FLG_SWITCHED_TO_MIN_OPT = 0x00000008, // The JIT decided to switch to MinOpt for this method, when it was not requested\n    CORINFO_FLG_SWITCHED_TO_OPTIMIZED = 0x00000010, // The JIT decided to switch to tier 1 for this method, when a different tier was requested\n};\n\n\nenum CORINFO_ACCESS_FLAGS\n{\n    CORINFO_ACCESS_ANY        = 0x0000, // Normal access\n    CORINFO_ACCESS_THIS       = 0x0001, // Accessed via the this reference\n    // UNUSED                 = 0x0002,\n\n    CORINFO_ACCESS_NONNULL    = 0x0004, // Instance is guaranteed non-null\n\n    CORINFO_ACCESS_LDFTN      = 0x0010, // Accessed via ldftn\n\n    // Field access flags\n    CORINFO_ACCESS_GET        = 0x0100, // Field get (ldfld)\n    CORINFO_ACCESS_SET        = 0x0200, // Field set (stfld)\n    CORINFO_ACCESS_ADDRESS    = 0x0400, // Field address (ldflda)\n    CORINFO_ACCESS_INIT_ARRAY = 0x0800, // Field use for InitializeArray\n    // UNUSED                 = 0x4000,\n    CORINFO_ACCESS_INLINECHECK= 0x8000, // Return fieldFlags and fieldAccessor only. Used by JIT64 during inlining.\n};\n\n// These are the flags set on an CORINFO_EH_CLAUSE\nenum CORINFO_EH_CLAUSE_FLAGS\n{\n    CORINFO_EH_CLAUSE_NONE      = 0,\n    CORINFO_EH_CLAUSE_FILTER    = 0x0001, // If this bit is on, then this EH entry is for a filter\n    CORINFO_EH_CLAUSE_FINALLY   = 0x0002, // This clause is a finally clause\n    CORINFO_EH_CLAUSE_FAULT     = 0x0004, // This clause is a fault clause\n    CORINFO_EH_CLAUSE_DUPLICATE = 0x0008, // Duplicated clause. This clause was duplicated to a funclet which was pulled out of line\n    CORINFO_EH_CLAUSE_SAMETRY   = 0x0010, // This clause covers same try block as the previous one. (Used by NativeAOT ABI.)\n};\n\n// This enumeration is passed to InternalThrow\nenum CorInfoException\n{\n    CORINFO_NullReferenceException,\n    CORINFO_DivideByZeroException,\n    CORINFO_InvalidCastException,\n    CORINFO_IndexOutOfRangeException,\n    CORINFO_OverflowException,\n    CORINFO_SynchronizationLockException,\n    CORINFO_ArrayTypeMismatchException,\n    CORINFO_RankException,\n    CORINFO_ArgumentNullException,\n    CORINFO_ArgumentException,\n    CORINFO_Exception_Count,\n};\n\n// These are used to detect array methods as NamedIntrinsic in JIT importer,\n// which otherwise don't have a name.\nenum class CorInfoArrayIntrinsic\n{\n    GET = 0,\n    SET = 1,\n    ADDRESS = 2,\n\n    ILLEGAL\n};\n\n// Can a value be accessed directly from JITed code.\nenum InfoAccessType\n{\n    IAT_VALUE,      // The info value is directly available\n    IAT_PVALUE,     // The value needs to be accessed via an         indirection\n    IAT_PPVALUE,    // The value needs to be accessed via a double   indirection\n    IAT_RELPVALUE   // The value needs to be accessed via a relative indirection\n};\n\nenum CorInfoGCType\n{\n    TYPE_GC_NONE,   // no embedded objectrefs\n    TYPE_GC_REF,    // Is an object ref\n    TYPE_GC_BYREF,  // Is an interior pointer - promote it but don't scan it\n    TYPE_GC_OTHER   // requires type-specific treatment\n};\n\nenum CorInfoClassId\n{\n    CLASSID_SYSTEM_OBJECT,\n    CLASSID_TYPED_BYREF,\n    CLASSID_TYPE_HANDLE,\n    CLASSID_FIELD_HANDLE,\n    CLASSID_METHOD_HANDLE,\n    CLASSID_STRING,\n    CLASSID_ARGUMENT_HANDLE,\n    CLASSID_RUNTIME_TYPE,\n};\n\nenum CorInfoInline\n{\n    INLINE_PASS                     = 0,    // Inlining OK\n    INLINE_PREJIT_SUCCESS           = 1,    // Inline check for prejit checking usage succeeded\n    INLINE_CHECK_CAN_INLINE_SUCCESS = 2,    // JIT detected it is permitted to try to actually inline\n    INLINE_CHECK_CAN_INLINE_VMFAIL  = 3,    // VM specified that inline must fail via the CanInline api\n\n    // failures are negative\n    INLINE_FAIL                     = -1,   // Inlining not OK for this case only\n    INLINE_NEVER                    = -2,   // This method should never be inlined, regardless of context\n};\n\nenum CorInfoInlineTypeCheck\n{\n    CORINFO_INLINE_TYPECHECK_NONE       = 0x00000000, // It's not okay to compare type's vtable with a native type handle\n    CORINFO_INLINE_TYPECHECK_PASS       = 0x00000001, // It's okay to compare type's vtable with a native type handle\n    CORINFO_INLINE_TYPECHECK_USE_HELPER = 0x00000002, // Use a specialized helper to compare type's vtable with native type handle\n};\n\nenum CorInfoInlineTypeCheckSource\n{\n    CORINFO_INLINE_TYPECHECK_SOURCE_VTABLE = 0x00000000, // Type handle comes from the vtable\n    CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN  = 0x00000001, // Type handle comes from an ldtoken\n};\n\n// If you add more values here, keep it in sync with TailCallTypeMap in ..\\vm\\ClrEtwAll.man\n// and the string enum in CEEInfo::reportTailCallDecision in ..\\vm\\JITInterface.cpp\nenum CorInfoTailCall\n{\n    TAILCALL_OPTIMIZED      = 0,    // Optimized tail call (epilog + jmp)\n    TAILCALL_RECURSIVE      = 1,    // Optimized into a loop (only when a method tail calls itself)\n    TAILCALL_HELPER         = 2,    // Helper assisted tail call (call to JIT_TailCall)\n\n    // failures are negative\n    TAILCALL_FAIL           = -1,   // Couldn't do a tail call\n};\n\nenum CorInfoInitClassResult\n{\n    CORINFO_INITCLASS_NOT_REQUIRED  = 0x00, // No class initialization required, but the class is not actually initialized yet\n                                            // (e.g. we are guaranteed to run the static constructor in method prolog)\n    CORINFO_INITCLASS_INITIALIZED   = 0x01, // Class initialized\n    CORINFO_INITCLASS_USE_HELPER    = 0x02, // The JIT must insert class initialization helper call.\n    CORINFO_INITCLASS_DONT_INLINE   = 0x04, // The JIT should not inline the method requesting the class initialization. The class\n                                            // initialization requires helper class now, but will not require initialization\n                                            // if the method is compiled standalone. Or the method cannot be inlined due to some\n                                            // requirement around class initialization such as shared generics.\n};\n\n// Reason codes for making indirect calls\n#define INDIRECT_CALL_REASONS() \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_UNKNOWN) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_EXOTIC) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_PINVOKE) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_GENERIC) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_NO_CODE) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_FIXUPS) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_STUB) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_REMOTING) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_CER) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_RESTORE_METHOD) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_RESTORE_FIRST_CALL) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_RESTORE_VALUE_TYPE) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_RESTORE) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_CANT_PATCH) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_PROFILING) \\\n    INDIRECT_CALL_REASON_FUNC(CORINFO_INDIRECT_CALL_OTHER_LOADER_MODULE) \\\n\nenum CorInfoIndirectCallReason\n{\n    #undef INDIRECT_CALL_REASON_FUNC\n    #define INDIRECT_CALL_REASON_FUNC(x) x,\n    INDIRECT_CALL_REASONS()\n\n    #undef INDIRECT_CALL_REASON_FUNC\n\n    CORINFO_INDIRECT_CALL_COUNT\n};\n\ninline bool dontInline(CorInfoInline val) {\n    return(val < 0);\n}\n\n// Patchpoint info is passed back and forth across the interface\n// but is opaque.\n\nstruct PatchpointInfo;\n\n// Cookie types consumed by the code generator (these are opaque values\n// not inspected by the code generator):\n\ntypedef struct CORINFO_ASSEMBLY_STRUCT_*    CORINFO_ASSEMBLY_HANDLE;\ntypedef struct CORINFO_MODULE_STRUCT_*      CORINFO_MODULE_HANDLE;\ntypedef struct CORINFO_DEPENDENCY_STRUCT_*  CORINFO_DEPENDENCY_HANDLE;\ntypedef struct CORINFO_CLASS_STRUCT_*       CORINFO_CLASS_HANDLE;\ntypedef struct CORINFO_METHOD_STRUCT_*      CORINFO_METHOD_HANDLE;\ntypedef struct CORINFO_FIELD_STRUCT_*       CORINFO_FIELD_HANDLE;\ntypedef struct CORINFO_OBJECT_STRUCT_*      CORINFO_OBJECT_HANDLE;\ntypedef struct CORINFO_ARG_LIST_STRUCT_*    CORINFO_ARG_LIST_HANDLE;    // represents a list of argument types\ntypedef struct CORINFO_JUST_MY_CODE_HANDLE_*CORINFO_JUST_MY_CODE_HANDLE;\ntypedef struct CORINFO_PROFILING_STRUCT_*   CORINFO_PROFILING_HANDLE;   // a handle guaranteed to be unique per process\ntypedef struct CORINFO_GENERIC_STRUCT_*     CORINFO_GENERIC_HANDLE;     // a generic handle (could be any of the above)\n\n// what is actually passed on the varargs call\ntypedef struct CORINFO_VarArgInfo *         CORINFO_VARARGS_HANDLE;\n\n// Generic tokens are resolved with respect to a context, which is usually the method\n// being compiled. The CORINFO_CONTEXT_HANDLE indicates which exact instantiation\n// (or the open instantiation) is being referred to.\ntypedef struct CORINFO_CONTEXT_STRUCT_*     CORINFO_CONTEXT_HANDLE;\n\n// MethodSignatureInfo is an opaque handle for passing method signature information across the Jit/EE interface\nstruct MethodSignatureInfo;\n\ntypedef struct CORINFO_DEPENDENCY_STRUCT_\n{\n    CORINFO_MODULE_HANDLE moduleFrom;\n    CORINFO_MODULE_HANDLE moduleTo;\n} CORINFO_DEPENDENCY;\n\n// Bit-twiddling of contexts assumes word-alignment of method handles and type handles\n// If this ever changes, some other encoding will be needed\nenum CorInfoContextFlags\n{\n    CORINFO_CONTEXTFLAGS_METHOD = 0x00, // CORINFO_CONTEXT_HANDLE is really a CORINFO_METHOD_HANDLE\n    CORINFO_CONTEXTFLAGS_CLASS  = 0x01, // CORINFO_CONTEXT_HANDLE is really a CORINFO_CLASS_HANDLE\n    CORINFO_CONTEXTFLAGS_MASK   = 0x01\n};\n\n#define METHOD_BEING_COMPILED_CONTEXT() ((CORINFO_CONTEXT_HANDLE)1)\n#define MAKE_CLASSCONTEXT(c)  (CORINFO_CONTEXT_HANDLE((size_t) (c) | CORINFO_CONTEXTFLAGS_CLASS))\n#define MAKE_METHODCONTEXT(m) (CORINFO_CONTEXT_HANDLE((size_t) (m) | CORINFO_CONTEXTFLAGS_METHOD))\n\nenum CorInfoSigInfoFlags\n{\n    CORINFO_SIGFLAG_IS_LOCAL_SIG           = 0x01,\n    CORINFO_SIGFLAG_IL_STUB                = 0x02,\n    // unused                              = 0x04,\n    CORINFO_SIGFLAG_FAT_CALL               = 0x08,\n};\n\nstruct CORINFO_SIG_INST\n{\n    unsigned                classInstCount;\n    CORINFO_CLASS_HANDLE *  classInst; // (representative, not exact) instantiation for class type variables in signature\n    unsigned                methInstCount;\n    CORINFO_CLASS_HANDLE *  methInst; // (representative, not exact) instantiation for method type variables in signature\n};\n\nstruct CORINFO_SIG_INFO\n{\n    CorInfoCallConv         callConv;\n    CORINFO_CLASS_HANDLE    retTypeClass;   // if the return type is a value class, this is its handle (enums are normalized)\n    CORINFO_CLASS_HANDLE    retTypeSigClass;// returns the value class as it is in the sig (enums are not converted to primitives)\n    CorInfoType             retType : 8;\n    unsigned                flags   : 8;    // used by IL stubs code\n    unsigned                numArgs : 16;\n    struct CORINFO_SIG_INST sigInst;        // information about how type variables are being instantiated in generic code\n    CORINFO_ARG_LIST_HANDLE args;\n    PCCOR_SIGNATURE         pSig;\n    unsigned                cbSig;\n    MethodSignatureInfo*    methodSignature;// used in place of pSig and cbSig to reference a method signature object handle\n    CORINFO_MODULE_HANDLE   scope;          // passed to getArgClass\n    mdToken                 token;\n\n    CorInfoCallConv     getCallConv()       { return CorInfoCallConv((callConv & CORINFO_CALLCONV_MASK)); }\n    bool                hasThis()           { return ((callConv & CORINFO_CALLCONV_HASTHIS) != 0); }\n    bool                hasExplicitThis()   { return ((callConv & CORINFO_CALLCONV_EXPLICITTHIS) != 0); }\n    unsigned            totalILArgs()       { return (numArgs + (hasThis() ? 1 : 0)); }\n    bool                isVarArg()          { return ((getCallConv() == CORINFO_CALLCONV_VARARG) || (getCallConv() == CORINFO_CALLCONV_NATIVEVARARG)); }\n    bool                hasTypeArg()        { return ((callConv & CORINFO_CALLCONV_PARAMTYPE) != 0); }\n};\n\nstruct CORINFO_METHOD_INFO\n{\n    CORINFO_METHOD_HANDLE       ftn;\n    CORINFO_MODULE_HANDLE       scope;\n    uint8_t *                   ILCode;\n    unsigned                    ILCodeSize;\n    unsigned                    maxStack;\n    unsigned                    EHcount;\n    CorInfoOptions              options;\n    CorInfoRegionKind           regionKind;\n    CORINFO_SIG_INFO            args;\n    CORINFO_SIG_INFO            locals;\n};\n\n//----------------------------------------------------------------------------\n// Looking up handles and addresses.\n//\n// When the JIT requests a handle, the EE may direct the JIT that it must\n// access the handle in a variety of ways.  These are packed as\n//    CORINFO_CONST_LOOKUP\n// or CORINFO_LOOKUP (contains either a CORINFO_CONST_LOOKUP or a CORINFO_RUNTIME_LOOKUP)\n//\n// Constant Lookups v. Runtime Lookups (i.e. when will Runtime Lookups be generated?)\n// -----------------------------------------------------------------------------------\n//\n// CORINFO_LOOKUP_KIND is part of the result type of embedGenericHandle,\n// getVirtualCallInfo and any other functions that may require a\n// runtime lookup when compiling shared generic code.\n//\n// CORINFO_LOOKUP_KIND indicates whether a particular token in the instruction stream can be:\n// (a) Mapped to a handle (type, field or method) at compile-time (!needsRuntimeLookup)\n// (b) Must be looked up at run-time, and if so which runtime lookup technique should be used (see below)\n//\n// If the JIT or EE does not support code sharing for generic code, then\n// all CORINFO_LOOKUP results will be \"constant lookups\", i.e.\n// the needsRuntimeLookup of CORINFO_LOOKUP.lookupKind.needsRuntimeLookup\n// will be false.\n//\n// Constant Lookups\n// ----------------\n//\n// Constant Lookups are either:\n//     IAT_VALUE: immediate (relocatable) values,\n//     IAT_PVALUE: immediate values access via an indirection through an immediate (relocatable) address\n//     IAT_RELPVALUE: immediate values access via a relative indirection through an immediate offset\n//     IAT_PPVALUE: immediate values access via a double indirection through an immediate (relocatable) address\n//\n// Runtime Lookups\n// ---------------\n//\n// CORINFO_LOOKUP_KIND is part of the result type of embedGenericHandle,\n// getVirtualCallInfo and any other functions that may require a\n// runtime lookup when compiling shared generic code.\n//\n// CORINFO_LOOKUP_KIND indicates whether a particular token in the instruction stream can be:\n// (a) Mapped to a handle (type, field or method) at compile-time (!needsRuntimeLookup)\n// (b) Must be looked up at run-time using the class dictionary\n//     stored in the vtable of the this pointer (needsRuntimeLookup && THISOBJ)\n// (c) Must be looked up at run-time using the method dictionary\n//     stored in the method descriptor parameter passed to a generic\n//     method (needsRuntimeLookup && METHODPARAM)\n// (d) Must be looked up at run-time using the class dictionary stored\n//     in the vtable parameter passed to a method in a generic\n//     struct (needsRuntimeLookup && CLASSPARAM)\n\nstruct CORINFO_CONST_LOOKUP\n{\n    // If the handle is obtained at compile-time, then this handle is the \"exact\" handle (class, method, or field)\n    // Otherwise, it's a representative...\n    // If accessType is\n    //     IAT_VALUE     --> \"handle\" stores the real handle or \"addr \" stores the computed address\n    //     IAT_PVALUE    --> \"addr\" stores a pointer to a location which will hold the real handle\n    //     IAT_RELPVALUE --> \"addr\" stores a relative pointer to a location which will hold the real handle\n    //     IAT_PPVALUE   --> \"addr\" stores a double indirection to a location which will hold the real handle\n\n    InfoAccessType              accessType;\n    union\n    {\n        CORINFO_GENERIC_HANDLE  handle;\n        void *                  addr;\n    };\n};\n\nenum CORINFO_RUNTIME_LOOKUP_KIND\n{\n    CORINFO_LOOKUP_THISOBJ,\n    CORINFO_LOOKUP_METHODPARAM,\n    CORINFO_LOOKUP_CLASSPARAM,\n    CORINFO_LOOKUP_NOT_SUPPORTED, // Returned for attempts to inline dictionary lookups\n};\n\nstruct CORINFO_LOOKUP_KIND\n{\n    bool                        needsRuntimeLookup;\n    CORINFO_RUNTIME_LOOKUP_KIND runtimeLookupKind;\n\n    // The 'runtimeLookupFlags' and 'runtimeLookupArgs' fields\n    // are just for internal VM / ZAP communication, not to be used by the JIT.\n    uint16_t                    runtimeLookupFlags;\n    void *                      runtimeLookupArgs;\n} ;\n\n\n// CORINFO_RUNTIME_LOOKUP indicates the details of the runtime lookup\n// operation to be performed.\n//\n// CORINFO_MAXINDIRECTIONS is the maximum number of\n// indirections used by runtime lookups.\n// This accounts for up to 2 indirections to get at a dictionary followed by a possible spill slot\n//\n#define CORINFO_MAXINDIRECTIONS 4\n#define CORINFO_USEHELPER ((uint16_t) 0xffff)\n#define CORINFO_NO_SIZE_CHECK ((uint16_t) 0xffff)\n\nstruct CORINFO_RUNTIME_LOOKUP\n{\n    // This is signature you must pass back to the runtime lookup helper\n    void*                   signature;\n\n    // Here is the helper you must call. It is one of CORINFO_HELP_RUNTIMEHANDLE_* helpers.\n    CorInfoHelpFunc         helper;\n\n    // Number of indirections to get there\n    // CORINFO_USEHELPER = don't know how to get it, so use helper function at run-time instead\n    // 0 = use the this pointer itself (e.g. token is C<!0> inside code in sealed class C)\n    //     or method desc itself (e.g. token is method void M::mymeth<!!0>() inside code in M::mymeth)\n    // Otherwise, follow each byte-offset stored in the \"offsets[]\" array (may be negative)\n    uint16_t                indirections;\n\n    // If set, test for null and branch to helper if null\n    bool                    testForNull;\n\n    // If set, test the lowest bit and dereference if set (see code:FixupPointer)\n    bool                    testForFixup;\n\n    uint16_t                sizeOffset;\n    size_t                  offsets[CORINFO_MAXINDIRECTIONS];\n\n    // If set, first offset is indirect.\n    // 0 means that value stored at first offset (offsets[0]) from pointer is next pointer, to which the next offset\n    // (offsets[1]) is added and so on.\n    // 1 means that value stored at first offset (offsets[0]) from pointer is offset1, and the next pointer is\n    // stored at pointer+offsets[0]+offset1.\n    bool                indirectFirstOffset;\n\n    // If set, second offset is indirect.\n    // 0 means that value stored at second offset (offsets[1]) from pointer is next pointer, to which the next offset\n    // (offsets[2]) is added and so on.\n    // 1 means that value stored at second offset (offsets[1]) from pointer is offset2, and the next pointer is\n    // stored at pointer+offsets[1]+offset2.\n    bool                indirectSecondOffset;\n} ;\n\n// Result of calling embedGenericHandle\nstruct CORINFO_LOOKUP\n{\n    CORINFO_LOOKUP_KIND     lookupKind;\n\n    union\n    {\n        // If kind.needsRuntimeLookup then this indicates how to do the lookup\n        CORINFO_RUNTIME_LOOKUP  runtimeLookup;\n\n        // If the handle is obtained at compile-time, then this handle is the \"exact\" handle (class, method, or field)\n        // Otherwise, it's a representative...  If accessType is\n        //     IAT_VALUE --> \"handle\" stores the real handle or \"addr \" stores the computed address\n        //     IAT_PVALUE --> \"addr\" stores a pointer to a location which will hold the real handle\n        //     IAT_RELPVALUE --> \"addr\" stores a relative pointer to a location which will hold the real handle\n        //     IAT_PPVALUE --> \"addr\" stores a double indirection to a location which will hold the real handle\n        CORINFO_CONST_LOOKUP    constLookup;\n    };\n};\n\nenum CorInfoGenericHandleType\n{\n    CORINFO_HANDLETYPE_UNKNOWN,\n    CORINFO_HANDLETYPE_CLASS,\n    CORINFO_HANDLETYPE_METHOD,\n    CORINFO_HANDLETYPE_FIELD\n};\n\n//----------------------------------------------------------------------------\n// Embedding type, method and field handles (for \"ldtoken\" or to pass back to helpers)\n\n// Result of calling embedGenericHandle\nstruct CORINFO_GENERICHANDLE_RESULT\n{\n    CORINFO_LOOKUP          lookup;\n\n    // compileTimeHandle is guaranteed to be either NULL or a handle that is usable during compile time.\n    // It must not be embedded in the code because it might not be valid at run-time.\n    CORINFO_GENERIC_HANDLE  compileTimeHandle;\n\n    // Type of the result\n    CorInfoGenericHandleType handleType;\n};\n\n#define CORINFO_ACCESS_ALLOWED_MAX_ARGS 4\n\nenum CorInfoAccessAllowedHelperArgType\n{\n    CORINFO_HELPER_ARG_TYPE_Invalid = 0,\n    CORINFO_HELPER_ARG_TYPE_Field   = 1,\n    CORINFO_HELPER_ARG_TYPE_Method  = 2,\n    CORINFO_HELPER_ARG_TYPE_Class   = 3,\n    CORINFO_HELPER_ARG_TYPE_Module  = 4,\n    CORINFO_HELPER_ARG_TYPE_Const   = 5,\n};\nstruct CORINFO_HELPER_ARG\n{\n    union\n    {\n        CORINFO_FIELD_HANDLE fieldHandle;\n        CORINFO_METHOD_HANDLE methodHandle;\n        CORINFO_CLASS_HANDLE classHandle;\n        CORINFO_MODULE_HANDLE moduleHandle;\n        size_t constant;\n    };\n    CorInfoAccessAllowedHelperArgType argType;\n\n    void Set(CORINFO_METHOD_HANDLE handle)\n    {\n        argType = CORINFO_HELPER_ARG_TYPE_Method;\n        methodHandle = handle;\n    }\n\n    void Set(CORINFO_FIELD_HANDLE handle)\n    {\n        argType = CORINFO_HELPER_ARG_TYPE_Field;\n        fieldHandle = handle;\n    }\n\n    void Set(CORINFO_CLASS_HANDLE handle)\n    {\n        argType = CORINFO_HELPER_ARG_TYPE_Class;\n        classHandle = handle;\n    }\n\n    void Set(size_t value)\n    {\n        argType = CORINFO_HELPER_ARG_TYPE_Const;\n        constant = value;\n    }\n};\n\nstruct CORINFO_HELPER_DESC\n{\n    CorInfoHelpFunc helperNum;\n    unsigned numArgs;\n    CORINFO_HELPER_ARG args[CORINFO_ACCESS_ALLOWED_MAX_ARGS];\n};\n\n//----------------------------------------------------------------------------\n// getCallInfo and CORINFO_CALL_INFO: The EE instructs the JIT about how to make a call\n//\n// callKind\n// --------\n//\n// CORINFO_CALL :\n//   Indicates that the JIT can use getFunctionEntryPoint to make a call,\n//   i.e. there is nothing abnormal about the call.  The JITs know what to do if they get this.\n//   Except in the case of constraint calls (see below), [targetMethodHandle] will hold\n//   the CORINFO_METHOD_HANDLE that a call to findMethod would\n//   have returned.\n//   This flag may be combined with nullInstanceCheck=TRUE for uses of callvirt on methods that can\n//   be resolved at compile-time (non-virtual, final or sealed).\n//\n// CORINFO_CALL_CODE_POINTER (shared generic code only) :\n//   Indicates that the JIT should do an indirect call to the entrypoint given by address, which may be specified\n//   as a runtime lookup by CORINFO_CALL_INFO::codePointerLookup.\n//   [targetMethodHandle] will not hold a valid value.\n//   This flag may be combined with nullInstanceCheck=TRUE for uses of callvirt on methods whose target method can\n//   be resolved at compile-time but whose instantiation can be resolved only through runtime lookup.\n//\n// CORINFO_VIRTUALCALL_STUB (interface calls) :\n//   Indicates that the EE supports \"stub dispatch\" and request the JIT to make a\n//   \"stub dispatch\" call (an indirect call through CORINFO_CALL_INFO::stubLookup,\n//   similar to CORINFO_CALL_CODE_POINTER).\n//   \"Stub dispatch\" is a specialized calling sequence (that may require use of NOPs)\n//   which allow the runtime to determine the call-site after the call has been dispatched.\n//   If the call is too complex for the JIT (e.g. because\n//   fetching the dispatch stub requires a runtime lookup, i.e. lookupKind.needsRuntimeLookup\n//   is set) then the JIT is allowed to implement the call as if it were CORINFO_VIRTUALCALL_LDVIRTFTN\n//   [targetMethodHandle] will hold the CORINFO_METHOD_HANDLE that a call to findMethod would\n//   have returned.\n//   This flag is always accompanied by nullInstanceCheck=TRUE.\n//\n// CORINFO_VIRTUALCALL_LDVIRTFTN (virtual generic methods) :\n//   Indicates that the EE provides no way to implement the call directly and\n//   that the JIT should use a LDVIRTFTN sequence (as implemented by CORINFO_HELP_VIRTUAL_FUNC_PTR)\n//   followed by an indirect call.\n//   [targetMethodHandle] will hold the CORINFO_METHOD_HANDLE that a call to findMethod would\n//   have returned.\n//   This flag is always accompanied by nullInstanceCheck=TRUE though typically the null check will\n//   be implicit in the access through the instance pointer.\n//\n//  CORINFO_VIRTUALCALL_VTABLE (regular virtual methods) :\n//   Indicates that the EE supports vtable dispatch and that the JIT should use getVTableOffset etc.\n//   to implement the call.\n//   [targetMethodHandle] will hold the CORINFO_METHOD_HANDLE that a call to findMethod would\n//   have returned.\n//   This flag is always accompanied by nullInstanceCheck=TRUE though typically the null check will\n//   be implicit in the access through the instance pointer.\n//\n// thisTransform and constraint calls\n// ----------------------------------\n//\n// For everything besides \"constrained.\" calls \"thisTransform\" is set to\n// CORINFO_NO_THIS_TRANSFORM.\n//\n// For \"constrained.\" calls the EE attempts to resolve the call at compile\n// time to a more specific method, or (shared generic code only) to a runtime lookup\n// for a code pointer for the more specific method.\n//\n// In order to permit this, the \"this\" pointer supplied for a \"constrained.\" call\n// is a byref to an arbitrary type (see the IL spec). The \"thisTransform\" field\n// will indicate how the JIT must transform the \"this\" pointer in order\n// to be able to call the resolved method:\n//\n//  CORINFO_NO_THIS_TRANSFORM --> Leave it as a byref to an unboxed value type\n//  CORINFO_BOX_THIS          --> Box it to produce an object\n//  CORINFO_DEREF_THIS        --> Deref the byref to get an object reference\n//\n// In addition, the \"kind\" field will be set as follows for constraint calls:\n//\n//    CORINFO_CALL              --> the call was resolved at compile time, and\n//                                  can be compiled like a normal call.\n//    CORINFO_CALL_CODE_POINTER --> the call was resolved, but the target address will be\n//                                  computed at runtime.  Only returned for shared generic code.\n//    CORINFO_VIRTUALCALL_STUB,\n//    CORINFO_VIRTUALCALL_LDVIRTFTN,\n//    CORINFO_VIRTUALCALL_VTABLE   --> usual values indicating that a virtual call must be made\n\nenum CORINFO_CALL_KIND\n{\n    CORINFO_CALL,\n    CORINFO_CALL_CODE_POINTER,\n    CORINFO_VIRTUALCALL_STUB,\n    CORINFO_VIRTUALCALL_LDVIRTFTN,\n    CORINFO_VIRTUALCALL_VTABLE\n};\n\n// Indicates that the CORINFO_VIRTUALCALL_VTABLE lookup needn't do a chunk indirection\n#define CORINFO_VIRTUALCALL_NO_CHUNK 0xFFFFFFFF\n\nenum CORINFO_THIS_TRANSFORM\n{\n    CORINFO_NO_THIS_TRANSFORM,\n    CORINFO_BOX_THIS,\n    CORINFO_DEREF_THIS\n};\n\nenum CORINFO_CALLINFO_FLAGS\n{\n    CORINFO_CALLINFO_NONE           = 0x0000,\n    CORINFO_CALLINFO_ALLOWINSTPARAM = 0x0001,   // Can the compiler generate code to pass an instantiation parameters? Simple compilers should not use this flag\n    CORINFO_CALLINFO_CALLVIRT       = 0x0002,   // Is it a virtual call?\n    CORINFO_CALLINFO_KINDONLY       = 0x0004,   // This is set to only query the kind of call to perform, without getting any other information\n    CORINFO_CALLINFO_VERIFICATION   = 0x0008,   // Gets extra verification information.\n    CORINFO_CALLINFO_SECURITYCHECKS = 0x0010,   // Perform security checks.\n    CORINFO_CALLINFO_LDFTN          = 0x0020,   // Resolving target of LDFTN\n    // UNUSED                       = 0x0040,\n};\n\nenum CorInfoIsAccessAllowedResult\n{\n    CORINFO_ACCESS_ALLOWED = 0,           // Call allowed\n    CORINFO_ACCESS_ILLEGAL = 1,           // Call not allowed\n};\n\n\n// This enum is used for JIT to tell EE where this token comes from.\n// E.g. Depending on different opcodes, we might allow/disallow certain types of tokens or\n// return different types of handles (e.g. boxed vs. regular entrypoints)\nenum CorInfoTokenKind\n{\n    CORINFO_TOKENKIND_Class     = 0x01,\n    CORINFO_TOKENKIND_Method    = 0x02,\n    CORINFO_TOKENKIND_Field     = 0x04,\n    CORINFO_TOKENKIND_Mask      = 0x07,\n\n    // token comes from CEE_LDTOKEN\n    CORINFO_TOKENKIND_Ldtoken   = 0x10 | CORINFO_TOKENKIND_Class | CORINFO_TOKENKIND_Method | CORINFO_TOKENKIND_Field,\n\n    // token comes from CEE_CASTCLASS or CEE_ISINST\n    CORINFO_TOKENKIND_Casting   = 0x20 | CORINFO_TOKENKIND_Class,\n\n    // token comes from CEE_NEWARR\n    CORINFO_TOKENKIND_Newarr    = 0x40 | CORINFO_TOKENKIND_Class,\n\n    // token comes from CEE_BOX\n    CORINFO_TOKENKIND_Box       = 0x80 | CORINFO_TOKENKIND_Class,\n\n    // token comes from CEE_CONSTRAINED\n    CORINFO_TOKENKIND_Constrained = 0x100 | CORINFO_TOKENKIND_Class,\n\n    // token comes from CEE_NEWOBJ\n    CORINFO_TOKENKIND_NewObj    = 0x200 | CORINFO_TOKENKIND_Method,\n\n    // token comes from CEE_LDVIRTFTN\n    CORINFO_TOKENKIND_Ldvirtftn = 0x400 | CORINFO_TOKENKIND_Method,\n\n    // token comes from devirtualizing a method\n    CORINFO_TOKENKIND_DevirtualizedMethod = 0x800 | CORINFO_TOKENKIND_Method,\n};\n\nstruct CORINFO_RESOLVED_TOKEN\n{\n    //\n    // [In] arguments of resolveToken\n    //\n    CORINFO_CONTEXT_HANDLE  tokenContext;       //Context for resolution of generic arguments\n    CORINFO_MODULE_HANDLE   tokenScope;\n    mdToken                 token;              //The source token\n    CorInfoTokenKind        tokenType;\n\n    //\n    // [Out] arguments of resolveToken.\n    // - Type handle is always non-NULL.\n    // - At most one of method and field handles is non-NULL (according to the token type).\n    // - Method handle is an instantiating stub only for generic methods. Type handle\n    //   is required to provide the full context for methods in generic types.\n    //\n    CORINFO_CLASS_HANDLE    hClass;\n    CORINFO_METHOD_HANDLE   hMethod;\n    CORINFO_FIELD_HANDLE    hField;\n\n    //\n    // [Out] TypeSpec and MethodSpec signatures for generics. NULL otherwise.\n    //\n    PCCOR_SIGNATURE         pTypeSpec;\n    uint32_t                cbTypeSpec;\n    PCCOR_SIGNATURE         pMethodSpec;\n    uint32_t                cbMethodSpec;\n};\n\nstruct CORINFO_CALL_INFO\n{\n    CORINFO_METHOD_HANDLE   hMethod;            //target method handle\n    unsigned                methodFlags;        //flags for the target method\n\n    unsigned                classFlags;         //flags for CORINFO_RESOLVED_TOKEN::hClass\n\n    CORINFO_SIG_INFO        sig;\n\n    //Verification information\n    unsigned                verMethodFlags;     // flags for CORINFO_RESOLVED_TOKEN::hMethod\n    CORINFO_SIG_INFO        verSig;\n    //All of the regular method data is the same... hMethod might not be the same as CORINFO_RESOLVED_TOKEN::hMethod\n\n\n    //If set to:\n    //  - CORINFO_ACCESS_ALLOWED - The access is allowed.\n    //  - CORINFO_ACCESS_ILLEGAL - This access cannot be allowed (i.e. it is public calling private).  The\n    //      JIT may either insert the callsiteCalloutHelper into the code (as per a verification error) or\n    //      call throwExceptionFromHelper on the callsiteCalloutHelper.  In this case callsiteCalloutHelper\n    //      is guaranteed not to return.\n    CorInfoIsAccessAllowedResult accessAllowed;\n    CORINFO_HELPER_DESC     callsiteCalloutHelper;\n\n    // See above section on constraintCalls to understand when these are set to unusual values.\n    CORINFO_THIS_TRANSFORM  thisTransform;\n\n    CORINFO_CALL_KIND       kind;\n    bool                    nullInstanceCheck;\n\n    // Context for inlining and hidden arg\n    CORINFO_CONTEXT_HANDLE  contextHandle;\n    bool                    exactContextNeedsRuntimeLookup; // Set if contextHandle is approx handle. Runtime lookup is required to get the exact handle.\n\n    // If kind.CORINFO_VIRTUALCALL_STUB then stubLookup will be set.\n    // If kind.CORINFO_CALL_CODE_POINTER then entryPointLookup will be set.\n    union\n    {\n        CORINFO_LOOKUP      stubLookup;\n\n        CORINFO_LOOKUP      codePointerLookup;\n    };\n\n    CORINFO_CONST_LOOKUP    instParamLookup;    // Used by Ready-to-Run\n\n    bool                    wrapperDelegateInvoke;\n};\n\nenum CORINFO_DEVIRTUALIZATION_DETAIL\n{\n    CORINFO_DEVIRTUALIZATION_UNKNOWN,                              // no details available\n    CORINFO_DEVIRTUALIZATION_SUCCESS,                              // devirtualization was successful\n    CORINFO_DEVIRTUALIZATION_FAILED_CANON,                         // object class was canonical\n    CORINFO_DEVIRTUALIZATION_FAILED_COM,                           // object class was com\n    CORINFO_DEVIRTUALIZATION_FAILED_CAST,                          // object class could not be cast to interface class\n    CORINFO_DEVIRTUALIZATION_FAILED_LOOKUP,                        // interface method could not be found\n    CORINFO_DEVIRTUALIZATION_FAILED_DIM,                           // interface method was default interface method\n    CORINFO_DEVIRTUALIZATION_FAILED_SUBCLASS,                      // object not subclass of base class\n    CORINFO_DEVIRTUALIZATION_FAILED_SLOT,                          // virtual method installed via explicit override\n    CORINFO_DEVIRTUALIZATION_FAILED_BUBBLE,                        // devirtualization crossed version bubble\n    CORINFO_DEVIRTUALIZATION_MULTIPLE_IMPL,                        // object has multiple implementations of interface class\n    CORINFO_DEVIRTUALIZATION_FAILED_BUBBLE_CLASS_DECL,             // decl method is defined on class and decl method not in version bubble, and decl method not in closest to version bubble\n    CORINFO_DEVIRTUALIZATION_FAILED_BUBBLE_INTERFACE_DECL,         // decl method is defined on interface and not in version bubble, and implementation type not entirely defined in bubble\n    CORINFO_DEVIRTUALIZATION_FAILED_BUBBLE_IMPL,                   // object class not defined within version bubble\n    CORINFO_DEVIRTUALIZATION_FAILED_BUBBLE_IMPL_NOT_REFERENCEABLE, // object class cannot be referenced from R2R code due to missing tokens\n    CORINFO_DEVIRTUALIZATION_FAILED_DUPLICATE_INTERFACE,           // crossgen2 virtual method algorithm and runtime algorithm differ in the presence of duplicate interface implementations\n    CORINFO_DEVIRTUALIZATION_FAILED_DECL_NOT_REPRESENTABLE,        // Decl method cannot be represented in R2R image\n    CORINFO_DEVIRTUALIZATION_COUNT,                                // sentinel for maximum value\n};\n\nstruct CORINFO_DEVIRTUALIZATION_INFO\n{\n    //\n    // [In] arguments of resolveVirtualMethod\n    //\n    CORINFO_METHOD_HANDLE       virtualMethod;\n    CORINFO_CLASS_HANDLE        objClass;\n    CORINFO_CONTEXT_HANDLE      context;\n    CORINFO_RESOLVED_TOKEN     *pResolvedTokenVirtualMethod;\n\n    //\n    // [Out] results of resolveVirtualMethod.\n    // - devirtualizedMethod is set to MethodDesc of devirt'ed method iff we were able to devirtualize.\n    //      invariant is `resolveVirtualMethod(...) == (devirtualizedMethod != nullptr)`.\n    // - requiresInstMethodTableArg is set to TRUE if the devirtualized method requires a type handle arg.\n    // - exactContext is set to wrapped CORINFO_CLASS_HANDLE of devirt'ed method table.\n    // - details on the computation done by the jit host\n    // - If pResolvedTokenDevirtualizedMethod is not set to NULL and targeting an R2R image\n    //   use it as the parameter to getCallInfo\n    //\n    CORINFO_METHOD_HANDLE           devirtualizedMethod;\n    bool                            requiresInstMethodTableArg;\n    CORINFO_CONTEXT_HANDLE          exactContext;\n    CORINFO_DEVIRTUALIZATION_DETAIL detail;\n    CORINFO_RESOLVED_TOKEN          resolvedTokenDevirtualizedMethod;\n    CORINFO_RESOLVED_TOKEN          resolvedTokenDevirtualizedUnboxedMethod;\n};\n\n//----------------------------------------------------------------------------\n// getFieldInfo and CORINFO_FIELD_INFO: The EE instructs the JIT about how to access a field\n\nenum CORINFO_FIELD_ACCESSOR\n{\n    CORINFO_FIELD_INSTANCE,                 // regular instance field at given offset from this-ptr\n    CORINFO_FIELD_INSTANCE_WITH_BASE,       // instance field with base offset (used by Ready-to-Run)\n    CORINFO_FIELD_INSTANCE_HELPER,          // instance field accessed using helper (arguments are this, FieldDesc * and the value)\n    CORINFO_FIELD_INSTANCE_ADDR_HELPER,     // instance field accessed using address-of helper (arguments are this and FieldDesc *)\n\n    CORINFO_FIELD_STATIC_ADDRESS,           // field at given address\n    CORINFO_FIELD_STATIC_RVA_ADDRESS,       // RVA field at given address\n    CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER, // static field accessed using the \"shared static\" helper (arguments are ModuleID + ClassID)\n    CORINFO_FIELD_STATIC_GENERICS_STATIC_HELPER, // static field access using the \"generic static\" helper (argument is MethodTable *)\n    CORINFO_FIELD_STATIC_ADDR_HELPER,       // static field accessed using address-of helper (argument is FieldDesc *)\n    CORINFO_FIELD_STATIC_TLS,               // unmanaged TLS access\n    CORINFO_FIELD_STATIC_READYTORUN_HELPER, // static field access using a runtime lookup helper\n\n    CORINFO_FIELD_INTRINSIC_ZERO,           // intrinsic zero (IntPtr.Zero, UIntPtr.Zero)\n    CORINFO_FIELD_INTRINSIC_EMPTY_STRING,   // intrinsic emptry string (String.Empty)\n    CORINFO_FIELD_INTRINSIC_ISLITTLEENDIAN, // intrinsic BitConverter.IsLittleEndian\n};\n\n// Set of flags returned in CORINFO_FIELD_INFO::fieldFlags\nenum CORINFO_FIELD_FLAGS\n{\n    CORINFO_FLG_FIELD_STATIC                    = 0x00000001,\n    CORINFO_FLG_FIELD_UNMANAGED                 = 0x00000002, // RVA field\n    CORINFO_FLG_FIELD_FINAL                     = 0x00000004,\n    CORINFO_FLG_FIELD_STATIC_IN_HEAP            = 0x00000008, // See code:#StaticFields. This static field is in the GC heap as a boxed object\n    CORINFO_FLG_FIELD_SAFESTATIC_BYREF_RETURN   = 0x00000010, // Field can be returned safely (has GC heap lifetime)\n    CORINFO_FLG_FIELD_INITCLASS                 = 0x00000020, // initClass has to be called before accessing the field\n    CORINFO_FLG_FIELD_PROTECTED                 = 0x00000040,\n};\n\nstruct CORINFO_FIELD_INFO\n{\n    CORINFO_FIELD_ACCESSOR  fieldAccessor;\n    unsigned                fieldFlags;\n\n    // Helper to use if the field access requires it\n    CorInfoHelpFunc         helper;\n\n    // Field offset if there is one\n    uint32_t                offset;\n\n    CorInfoType             fieldType;\n    CORINFO_CLASS_HANDLE    structType; //possibly null\n\n    //See CORINFO_CALL_INFO.accessAllowed\n    CorInfoIsAccessAllowedResult accessAllowed;\n    CORINFO_HELPER_DESC     accessCalloutHelper;\n\n    CORINFO_CONST_LOOKUP    fieldLookup;        // Used by Ready-to-Run\n};\n\n//----------------------------------------------------------------------------\n// Exception handling\n\nstruct CORINFO_EH_CLAUSE\n{\n    CORINFO_EH_CLAUSE_FLAGS     Flags;\n    uint32_t                    TryOffset;\n    uint32_t                    TryLength;\n    uint32_t                    HandlerOffset;\n    uint32_t                    HandlerLength;\n    union\n    {\n        uint32_t                ClassToken;       // use for type-based exception handlers\n        uint32_t                FilterOffset;     // use for filter-based exception handlers (COR_ILEXCEPTION_FILTER is set)\n    };\n};\n\nenum CORINFO_OS\n{\n    CORINFO_WINNT,\n    CORINFO_UNIX,\n    CORINFO_MACOS,\n};\n\nstruct CORINFO_CPU\n{\n    uint32_t           dwCPUType;\n    uint32_t           dwFeatures;\n    uint32_t           dwExtendedFeatures;\n};\n\nenum CORINFO_RUNTIME_ABI\n{\n    CORINFO_DESKTOP_ABI = 0x100,\n    CORINFO_CORECLR_ABI = 0x200,\n    CORINFO_NATIVEAOT_ABI = 0x300,\n};\n\n// For some highly optimized paths, the JIT must generate code that directly\n// manipulates internal EE data structures. The getEEInfo() helper returns\n// this structure containing the needed offsets and values.\nstruct CORINFO_EE_INFO\n{\n    // Information about the InlinedCallFrame structure layout\n    struct InlinedCallFrameInfo\n    {\n        // Size of the Frame structure\n        unsigned    size;\n\n        unsigned    offsetOfGSCookie;\n        unsigned    offsetOfFrameVptr;\n        unsigned    offsetOfFrameLink;\n        unsigned    offsetOfCallSiteSP;\n        unsigned    offsetOfCalleeSavedFP;\n        unsigned    offsetOfCallTarget;\n        unsigned    offsetOfReturnAddress;\n        // This offset is used only for ARM\n        unsigned    offsetOfSPAfterProlog;\n    }\n    inlinedCallFrameInfo;\n\n    // Offsets into the Thread structure\n    unsigned    offsetOfThreadFrame;            // offset of the current Frame\n    unsigned    offsetOfGCState;                // offset of the preemptive/cooperative state of the Thread\n\n    // Delegate offsets\n    unsigned    offsetOfDelegateInstance;\n    unsigned    offsetOfDelegateFirstTarget;\n\n    // Wrapper delegate offsets\n    unsigned    offsetOfWrapperDelegateIndirectCell;\n\n    // Reverse PInvoke offsets\n    unsigned    sizeOfReversePInvokeFrame;\n\n    // OS Page size\n    size_t      osPageSize;\n\n    // Null object offset\n    size_t      maxUncheckedOffsetForNullObject;\n\n    // Target ABI. Combined with target architecture and OS to determine\n    // GC, EH, and unwind styles.\n    CORINFO_RUNTIME_ABI targetAbi;\n\n    CORINFO_OS  osType;\n};\n\n// Flags passed from JIT to runtime.\nenum CORINFO_GET_TAILCALL_HELPERS_FLAGS\n{\n    // The callsite is a callvirt instruction.\n    CORINFO_TAILCALL_IS_CALLVIRT       = 0x00000001,\n    CORINFO_TAILCALL_THIS_ARG_IS_BYREF = 0x00000002,\n};\n\n// Flags passed from runtime to JIT.\nenum CORINFO_TAILCALL_HELPERS_FLAGS\n{\n    // The StoreArgs stub needs to be passed the target function pointer as the\n    // first argument.\n    CORINFO_TAILCALL_STORE_TARGET = 0x00000001,\n};\n\nstruct CORINFO_TAILCALL_HELPERS\n{\n    CORINFO_TAILCALL_HELPERS_FLAGS flags;\n    CORINFO_METHOD_HANDLE          hStoreArgs;\n    CORINFO_METHOD_HANDLE          hCallTarget;\n    CORINFO_METHOD_HANDLE          hDispatcher;\n};\n\n// This is used to indicate that a finally has been called\n// \"locally\" by the try block\nenum { LCL_FINALLY_MARK = 0xFC }; // FC = \"Finally Call\"\n\n/**********************************************************************************\n * The following is the internal structure of an object that the compiler knows about\n * when it generates code\n **********************************************************************************/\n\ntypedef void* CORINFO_MethodPtr;            // a generic method pointer\n\nstruct CORINFO_Object\n{\n    CORINFO_MethodPtr      *methTable;      // the vtable for the object\n};\n\nstruct CORINFO_String : public CORINFO_Object\n{\n    unsigned                stringLen;\n    char16_t                chars[1];       // actually of variable size\n};\n\nstruct CORINFO_Array : public CORINFO_Object\n{\n    unsigned                length;\n#ifdef HOST_64BIT\n    unsigned                alignpad;\n#endif // HOST_64BIT\n\n#if 0\n    // Multi-dimensional arrays have the dimension lengths and bounds here.\n    // The element count of these arrays is the array rank (the number of dimensions in the\n    // multi-dimensional array). So, there is one element for each dimension. The upper bound\n    // of a dimension is `dimBound[d] + dimLength[d] - 1`.\n    int                     dimLength[rank]; // Number of array elements in each dimension.\n    int                     dimBound[rank];  // Lower bound of each dimension (possibly negative).\n#endif\n\n    union\n    {\n        int8_t              i1Elems[1];    // actually of variable size\n        uint8_t             u1Elems[1];\n        int16_t             i2Elems[1];\n        uint16_t            u2Elems[1];\n        int32_t             i4Elems[1];\n        uint32_t            u4Elems[1];\n        float               r4Elems[1];\n    };\n};\n\nstruct CORINFO_Array8 : public CORINFO_Object\n{\n    unsigned                length;\n#ifdef HOST_64BIT\n    unsigned                alignpad;\n#endif // HOST_64BIT\n\n    union\n    {\n        double              r8Elems[1];\n        int64_t             i8Elems[1];\n        uint64_t            u8Elems[1];\n    };\n};\n\n\nstruct CORINFO_RefArray : public CORINFO_Object\n{\n    unsigned                length;\n#ifdef HOST_64BIT\n    unsigned                alignpad;\n#endif // HOST_64BIT\n\n#if 0\n    /* Multi-dimensional arrays have the lengths and bounds here */\n    unsigned                dimLength[length];\n    unsigned                dimBound[length];\n#endif\n\n    CORINFO_Object*         refElems[1];    // actually of variable size;\n};\n\nstruct CORINFO_RefAny\n{\n    void                      * dataPtr;\n    CORINFO_CLASS_HANDLE        type;\n};\n\n// The jit assumes the CORINFO_VARARGS_HANDLE is a pointer to a subclass of this\nstruct CORINFO_VarArgInfo\n{\n    unsigned                argBytes;       // number of bytes the arguments take up.\n                                            // (The CORINFO_VARARGS_HANDLE counts as an arg)\n};\n\n#define SIZEOF__CORINFO_Object                            TARGET_POINTER_SIZE /* methTable */\n\n#define CORINFO_Array_MaxLength                           0x7FFFFFC7\n#define CORINFO_String_MaxLength                          0x3FFFFFDF\n\n#define OFFSETOF__CORINFO_Array__length                   SIZEOF__CORINFO_Object\n#ifdef TARGET_64BIT\n#define OFFSETOF__CORINFO_Array__data                     (OFFSETOF__CORINFO_Array__length + sizeof(uint32_t) /* length */ + sizeof(uint32_t) /* alignpad */)\n#else\n#define OFFSETOF__CORINFO_Array__data                     (OFFSETOF__CORINFO_Array__length + sizeof(uint32_t) /* length */)\n#endif\n\n#define OFFSETOF__CORINFO_TypedReference__dataPtr         0\n#define OFFSETOF__CORINFO_TypedReference__type            (OFFSETOF__CORINFO_TypedReference__dataPtr + TARGET_POINTER_SIZE /* dataPtr */)\n\n#define OFFSETOF__CORINFO_String__stringLen               SIZEOF__CORINFO_Object\n#define OFFSETOF__CORINFO_String__chars                   (OFFSETOF__CORINFO_String__stringLen + sizeof(uint32_t) /* stringLen */)\n\n#define OFFSETOF__CORINFO_NullableOfT__hasValue           0\n\n/* data to optimize delegate construction */\nstruct DelegateCtorArgs\n{\n    void * pMethod;\n    void * pArg3;\n    void * pArg4;\n    void * pArg5;\n};\n\n// use offsetof to get the offset of the fields above\n#include <stddef.h> // offsetof\n\n// Guard-stack cookie for preventing against stack buffer overruns\ntypedef size_t GSCookie;\n\n#include \"cordebuginfo.h\"\n\n/**********************************************************************************/\n// Some compilers cannot arbitrarily allow the handler nesting level to grow\n// arbitrarily during Edit'n'Continue.\n// This is the maximum nesting level that a compiler needs to support for EnC\n\nconst int MAX_EnC_HANDLER_NESTING_LEVEL = 6;\n\n// Results from type comparison queries\nenum class TypeCompareState\n{\n    MustNot = -1, // types are not equal\n    May = 0,      // types may be equal (must test at runtime)\n    Must = 1,     // type are equal\n};\n\n//\n// This interface is logically split into sections for each class of information\n// (ICorMethodInfo, ICorModuleInfo, etc.). This split used to exist physically as well\n// using virtual inheritance, but was eliminated to improve efficiency of the JIT-EE\n// interface calls.\n//\nclass ICorStaticInfo\n{\npublic:\n    /**********************************************************************************/\n    //\n    // ICorMethodInfo\n    //\n    /**********************************************************************************/\n\n    // Quick check whether the method is a jit intrinsic. Returns the same value as getMethodAttribs(ftn) & CORINFO_FLG_INTRINSIC, except faster.\n    virtual bool isIntrinsic(CORINFO_METHOD_HANDLE ftn) = 0;\n\n    // return flags (a bitfield of CorInfoFlags values)\n    virtual uint32_t getMethodAttribs (\n            CORINFO_METHOD_HANDLE       ftn         /* IN */\n            ) = 0;\n\n    // sets private JIT flags, which can be, retrieved using getAttrib.\n    virtual void setMethodAttribs (\n            CORINFO_METHOD_HANDLE       ftn,        /* IN */\n            CorInfoMethodRuntimeFlags   attribs     /* IN */\n            ) = 0;\n\n    // Given a method descriptor ftnHnd, extract signature information into sigInfo\n    //\n    // 'memberParent' is typically only set when verifying.  It should be the\n    // result of calling getMemberParent.\n    virtual void getMethodSig (\n             CORINFO_METHOD_HANDLE      ftn,        /* IN  */\n             CORINFO_SIG_INFO          *sig,        /* OUT */\n             CORINFO_CLASS_HANDLE      memberParent = NULL /* IN */\n             ) = 0;\n\n    /*********************************************************************\n     * Note the following methods can only be used on functions known\n     * to be IL.  This includes the method being compiled and any method\n     * that 'getMethodInfo' returns true for\n     *********************************************************************/\n\n    // return information about a method private to the implementation\n    //      returns false if method is not IL, or is otherwise unavailable.\n    //      This method is used to fetch data needed to inline functions\n    virtual bool getMethodInfo (\n            CORINFO_METHOD_HANDLE   ftn,            /* IN  */\n            CORINFO_METHOD_INFO*    info            /* OUT */\n            ) = 0;\n\n    // Decides if you have any limitations for inlining. If everything's OK, it will return\n    // INLINE_PASS.\n    //\n    // The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls)\n    //\n    // The inlined method need not be verified\n\n    virtual CorInfoInline canInline (\n            CORINFO_METHOD_HANDLE       callerHnd,                  /* IN  */\n            CORINFO_METHOD_HANDLE       calleeHnd                   /* IN  */\n            ) = 0;\n\n    // Report that an inlining related process has begun. This will always be paired with\n    // a call to reportInliningDecision unless the jit fails.\n    virtual void beginInlining (CORINFO_METHOD_HANDLE inlinerHnd,\n                                CORINFO_METHOD_HANDLE inlineeHnd) = 0;\n\n    // Reports whether or not a method can be inlined, and why.  canInline is responsible for reporting all\n    // inlining results when it returns INLINE_FAIL and INLINE_NEVER.  All other results are reported by the\n    // JIT.\n    virtual void reportInliningDecision (CORINFO_METHOD_HANDLE inlinerHnd,\n                                                   CORINFO_METHOD_HANDLE inlineeHnd,\n                                                   CorInfoInline inlineResult,\n                                                   const char * reason) = 0;\n\n\n    // Returns false if the call is across security boundaries thus we cannot tailcall\n    //\n    // The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls)\n    virtual bool canTailCall (\n            CORINFO_METHOD_HANDLE   callerHnd,          /* IN */\n            CORINFO_METHOD_HANDLE   declaredCalleeHnd,  /* IN */\n            CORINFO_METHOD_HANDLE   exactCalleeHnd,     /* IN */\n            bool fIsTailPrefix                          /* IN */\n            ) = 0;\n\n    // Reports whether or not a method can be tail called, and why.\n    // canTailCall is responsible for reporting all results when it returns\n    // false.  All other results are reported by the JIT.\n    virtual void reportTailCallDecision (CORINFO_METHOD_HANDLE callerHnd,\n                                                   CORINFO_METHOD_HANDLE calleeHnd,\n                                                   bool fIsTailPrefix,\n                                                   CorInfoTailCall tailCallResult,\n                                                   const char * reason) = 0;\n\n    // get individual exception handler\n    virtual void getEHinfo(\n            CORINFO_METHOD_HANDLE ftn,              /* IN  */\n            unsigned          EHnumber,             /* IN */\n            CORINFO_EH_CLAUSE* clause               /* OUT */\n            ) = 0;\n\n    // return class it belongs to\n    virtual CORINFO_CLASS_HANDLE getMethodClass (\n            CORINFO_METHOD_HANDLE       method\n            ) = 0;\n\n    // return module it belongs to\n    virtual CORINFO_MODULE_HANDLE getMethodModule (\n            CORINFO_METHOD_HANDLE       method\n            ) = 0;\n\n    // This function returns the offset of the specified method in the\n    // vtable of it's owning class or interface.\n    virtual void getMethodVTableOffset (\n            CORINFO_METHOD_HANDLE       method,                 /* IN */\n            unsigned*                   offsetOfIndirection,    /* OUT */\n            unsigned*                   offsetAfterIndirection, /* OUT */\n            bool*                       isRelative              /* OUT */\n            ) = 0;\n\n    // Finds the virtual method in info->objClass that overrides info->virtualMethod,\n    // or the method in info->objClass that implements the interface method\n    // represented by info->virtualMethod.\n    //\n    // Returns false if devirtualization is not possible.\n    virtual bool resolveVirtualMethod(CORINFO_DEVIRTUALIZATION_INFO * info) = 0;\n\n    // Get the unboxed entry point for a method, if possible.\n    virtual CORINFO_METHOD_HANDLE getUnboxedEntry(\n        CORINFO_METHOD_HANDLE ftn,\n        bool* requiresInstMethodTableArg\n        ) = 0;\n\n    // Given T, return the type of the default Comparer<T>.\n    // Returns null if the type can't be determined exactly.\n    virtual CORINFO_CLASS_HANDLE getDefaultComparerClass(\n            CORINFO_CLASS_HANDLE elemType\n            ) = 0;\n\n    // Given T, return the type of the default EqualityComparer<T>.\n    // Returns null if the type can't be determined exactly.\n    virtual CORINFO_CLASS_HANDLE getDefaultEqualityComparerClass(\n            CORINFO_CLASS_HANDLE elemType\n            ) = 0;\n\n    // Given resolved token that corresponds to an intrinsic classified to\n    // get a raw handle (NI_System_Activator_AllocatorOf etc.), fetch the\n    // handle associated with the token. If this is not possible at\n    // compile-time (because the current method's code is shared and the\n    // token contains generic parameters) then indicate how the handle\n    // should be looked up at runtime.\n    virtual void expandRawHandleIntrinsic(\n        CORINFO_RESOLVED_TOKEN *        pResolvedToken,\n        CORINFO_GENERICHANDLE_RESULT *  pResult) = 0;\n\n    // Is the given type in System.Private.Corelib and marked with IntrinsicAttribute?\n    // This defaults to false.\n    virtual bool isIntrinsicType(\n            CORINFO_CLASS_HANDLE        classHnd\n            ) { return false; }\n\n    // return the entry point calling convention for any of the following\n    // - a P/Invoke\n    // - a method marked with UnmanagedCallersOnly\n    // - a function pointer with the CORINFO_CALLCONV_UNMANAGED calling convention.\n    virtual CorInfoCallConvExtension getUnmanagedCallConv(\n            CORINFO_METHOD_HANDLE       method,\n            CORINFO_SIG_INFO*           callSiteSig,\n            bool*                       pSuppressGCTransition /* OUT */\n            ) = 0;\n\n    // return if any marshaling is required for PInvoke methods.  Note that\n    // method == 0 => calli.  The call site sig is only needed for the varargs or calli case\n    virtual bool pInvokeMarshalingRequired(\n            CORINFO_METHOD_HANDLE       method,\n            CORINFO_SIG_INFO*           callSiteSig\n            ) = 0;\n\n    // Check constraints on method type arguments (only).\n    // The parent class should be checked separately using satisfiesClassConstraints(parent).\n    virtual bool satisfiesMethodConstraints(\n            CORINFO_CLASS_HANDLE        parent, // the exact parent of the method\n            CORINFO_METHOD_HANDLE       method\n            ) = 0;\n\n    // Given a delegate target class, a target method parent class,  a  target method,\n    // a delegate class, check if the method signature is compatible with the Invoke method of the delegate\n    // (under the typical instantiation of any free type variables in the memberref signatures).\n    virtual bool isCompatibleDelegate(\n            CORINFO_CLASS_HANDLE        objCls,           /* type of the delegate target, if any */\n            CORINFO_CLASS_HANDLE        methodParentCls,  /* exact parent of the target method, if any */\n            CORINFO_METHOD_HANDLE       method,           /* (representative) target method, if any */\n            CORINFO_CLASS_HANDLE        delegateCls,      /* exact type of the delegate */\n            bool                        *pfIsOpenDelegate /* is the delegate open */\n            ) = 0;\n\n    // load and restore the method\n    virtual void methodMustBeLoadedBeforeCodeIsRun(\n            CORINFO_METHOD_HANDLE       method\n            ) = 0;\n\n    virtual CORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl(\n            CORINFO_METHOD_HANDLE       method\n            ) = 0;\n\n    // Returns the global cookie for the /GS unsafe buffer checks\n    // The cookie might be a constant value (JIT), or a handle to memory location (Ngen)\n    virtual void getGSCookie(\n            GSCookie * pCookieVal,                     // OUT\n            GSCookie ** ppCookieVal                    // OUT\n            ) = 0;\n\n    // Provide patchpoint info for the method currently being jitted.\n    virtual void setPatchpointInfo(\n            PatchpointInfo* patchpointInfo\n            ) = 0;\n\n    // Get patchpoint info and il offset for the method currently being jitted.\n    virtual PatchpointInfo* getOSRInfo(\n            unsigned                       *ilOffset        // [OUT] il offset of OSR entry point\n            ) = 0;\n\n    /**********************************************************************************/\n    //\n    // ICorModuleInfo\n    //\n    /**********************************************************************************/\n\n    // Resolve metadata token into runtime method handles. This function may not\n    // return normally (e.g. it may throw) if it encounters invalid metadata or other\n    // failures during token resolution.\n    virtual void resolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) = 0;\n\n    // Attempt to resolve a metadata token into a runtime method handle. Returns true\n    // if resolution succeeded and false otherwise (e.g. if it encounters invalid metadata\n    // during token reoslution). This method should be used instead of `resolveToken` in\n    // situations that need to be resilient to invalid metadata.\n    virtual bool tryResolveToken(/* IN, OUT */ CORINFO_RESOLVED_TOKEN * pResolvedToken) = 0;\n\n    // Signature information about the call sig\n    virtual void findSig (\n            CORINFO_MODULE_HANDLE       module,     /* IN */\n            unsigned                    sigTOK,     /* IN */\n            CORINFO_CONTEXT_HANDLE      context,    /* IN */\n            CORINFO_SIG_INFO           *sig         /* OUT */\n            ) = 0;\n\n    // for Varargs, the signature at the call site may differ from\n    // the signature at the definition.  Thus we need a way of\n    // fetching the call site information\n    virtual void findCallSiteSig (\n            CORINFO_MODULE_HANDLE       module,     /* IN */\n            unsigned                    methTOK,    /* IN */\n            CORINFO_CONTEXT_HANDLE      context,    /* IN */\n            CORINFO_SIG_INFO           *sig         /* OUT */\n            ) = 0;\n\n    virtual CORINFO_CLASS_HANDLE getTokenTypeAsHandle (\n            CORINFO_RESOLVED_TOKEN *    pResolvedToken /* IN  */) = 0;\n\n    // Checks if the given metadata token is valid\n    virtual bool isValidToken (\n            CORINFO_MODULE_HANDLE       module,     /* IN  */\n            unsigned                    metaTOK     /* IN  */\n            ) = 0;\n\n    // Checks if the given metadata token is valid StringRef\n    virtual bool isValidStringRef (\n            CORINFO_MODULE_HANDLE       module,     /* IN  */\n            unsigned                    metaTOK     /* IN  */\n            ) = 0;\n\n    // Returns (sub)string length and content (can be null for dynamic context)\n    // for given metaTOK and module, length `-1` means input is incorrect\n    virtual int getStringLiteral (\n            CORINFO_MODULE_HANDLE       module,     /* IN  */\n            unsigned                    metaTOK,    /* IN  */\n            char16_t*                   buffer,     /* OUT */\n            int                         bufferSize, /* IN  */\n            int                         startIndex = 0 /* IN  */\n            ) = 0;\n\n\n    //------------------------------------------------------------------------------\n    // printObjectDescription: Prints a (possibly truncated) textual UTF8 representation of the given\n    //    object to a preallocated buffer. It's intended to be used only for debug/diagnostic\n    //    purposes such as JitDisasm. The buffer is null-terminated (even if truncated).\n    //\n    // Arguments:\n    //    handle     -          Direct object handle\n    //    buffer     -          Pointer to buffer. Can be nullptr.\n    //    bufferSize -          Buffer size (in bytes).\n    //    pRequiredBufferSize - Full length of the textual UTF8 representation, in bytes.\n    //                          Includes the null terminator, so the value is always at least 1,\n    //                          where 1 indicates an empty string.\n    //                          Can be used to call this API again with a bigger buffer to get the full\n    //                          string.\n    //\n    // Return Value:\n    //    Bytes written to the buffer, excluding the null terminator. The range is [0..bufferSize).\n    //    If bufferSize is 0, returns 0.\n    //\n    // Remarks:\n    //    buffer and bufferSize can be respectively nullptr and 0 to query just the required buffer size.\n    //\n    //    If the return value is less than bufferSize - 1 then the full string was written. In this case\n    //    it is guaranteed that return value == *pRequiredBufferSize - 1.\n    //\n    virtual size_t printObjectDescription (\n            CORINFO_OBJECT_HANDLE       handle,                       /* IN  */\n            char*                       buffer,                       /* OUT */\n            size_t                      bufferSize,                   /* IN  */\n            size_t*                     pRequiredBufferSize = nullptr /* OUT */\n            ) = 0;\n\n    /**********************************************************************************/\n    //\n    // ICorClassInfo\n    //\n    /**********************************************************************************/\n\n    // If the value class 'cls' is isomorphic to a primitive type it will\n    // return that type, otherwise it will return CORINFO_TYPE_VALUECLASS\n    virtual CorInfoType asCorInfoType (\n            CORINFO_CLASS_HANDLE    cls\n            ) = 0;\n\n    // Return class name as in metadata, or nullptr if there is none.\n    // Suitable for non-debugging use.\n    virtual const char* getClassNameFromMetadata (\n            CORINFO_CLASS_HANDLE    cls,\n            const char            **namespaceName   /* OUT */\n            ) = 0;\n\n    // Return the type argument of the instantiated generic class,\n    // which is specified by the index\n    virtual CORINFO_CLASS_HANDLE getTypeInstantiationArgument(\n            CORINFO_CLASS_HANDLE cls,\n            unsigned             index\n            ) = 0;\n\n    // Prints the name for a specified class including namespaces and enclosing\n    // classes.\n    // See printObjectDescription for documentation for the parameters.\n    virtual size_t printClassName(\n            CORINFO_CLASS_HANDLE cls,                          /* IN  */\n            char*                buffer,                       /* OUT */\n            size_t               bufferSize,                   /* IN  */\n            size_t*              pRequiredBufferSize = nullptr /* OUT */\n            ) = 0;\n\n    // Quick check whether the type is a value class. Returns the same value as getClassAttribs(cls) & CORINFO_FLG_VALUECLASS, except faster.\n    virtual bool isValueClass(CORINFO_CLASS_HANDLE cls) = 0;\n\n    // Decides how the JIT should do the optimization to inline the check for\n    //     GetTypeFromHandle(handle) == obj.GetType() (for CORINFO_INLINE_TYPECHECK_SOURCE_VTABLE)\n    //     GetTypeFromHandle(X) == GetTypeFromHandle(Y) (for CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN)\n    virtual CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_HANDLE cls, CorInfoInlineTypeCheckSource source) = 0;\n\n    // return flags (a bitfield of CorInfoFlags values)\n    virtual uint32_t getClassAttribs (\n            CORINFO_CLASS_HANDLE    cls\n            ) = 0;\n\n    virtual CORINFO_MODULE_HANDLE getClassModule (\n            CORINFO_CLASS_HANDLE    cls\n            ) = 0;\n\n    // Returns the assembly that contains the module \"mod\".\n    virtual CORINFO_ASSEMBLY_HANDLE getModuleAssembly (\n            CORINFO_MODULE_HANDLE   mod\n            ) = 0;\n\n    // Returns the name of the assembly \"assem\".\n    virtual const char* getAssemblyName (\n            CORINFO_ASSEMBLY_HANDLE assem\n            ) = 0;\n\n    // Allocate and delete process-lifetime objects.  Should only be\n    // referred to from static fields, lest a leak occur.\n    // Note that \"LongLifetimeFree\" does not execute destructors, if \"obj\"\n    // is an array of a struct type with a destructor.\n    virtual void* LongLifetimeMalloc(size_t sz) = 0;\n    virtual void LongLifetimeFree(void* obj) = 0;\n\n    virtual size_t getClassModuleIdForStatics (\n            CORINFO_CLASS_HANDLE    cls,\n            CORINFO_MODULE_HANDLE *pModule,\n            void **ppIndirection\n            ) = 0;\n\n    // return the number of bytes needed by an instance of the class\n    virtual unsigned getClassSize (\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // return the number of bytes needed by an instance of the class allocated on the heap\n    virtual unsigned getHeapClassSize(\n        CORINFO_CLASS_HANDLE        cls\n    ) = 0;\n\n    virtual bool canAllocateOnStack(\n        CORINFO_CLASS_HANDLE cls\n    ) = 0;\n\n    virtual unsigned getClassAlignmentRequirement (\n            CORINFO_CLASS_HANDLE        cls,\n            bool                        fDoubleAlignHint = false\n            ) = 0;\n\n    // This is only called for Value classes.  It returns a boolean array\n    // in representing of 'cls' from a GC perspective.  The class is\n    // assumed to be an array of machine words\n    // (of length // getClassSize(cls) / TARGET_POINTER_SIZE),\n    // 'gcPtrs' is a pointer to an array of uint8_ts of this length.\n    // getClassGClayout fills in this array so that gcPtrs[i] is set\n    // to one of the CorInfoGCType values which is the GC type of\n    // the i-th machine word of an object of type 'cls'\n    // returns the number of GC pointers in the array\n    virtual unsigned getClassGClayout (\n            CORINFO_CLASS_HANDLE        cls,        /* IN */\n            uint8_t                    *gcPtrs      /* OUT */\n            ) = 0;\n\n    // returns the number of instance fields in a class\n    virtual unsigned getClassNumInstanceFields (\n            CORINFO_CLASS_HANDLE        cls        /* IN */\n            ) = 0;\n\n    virtual CORINFO_FIELD_HANDLE getFieldInClass(\n            CORINFO_CLASS_HANDLE clsHnd,\n            int32_t num\n            ) = 0;\n\n    virtual bool checkMethodModifier(\n            CORINFO_METHOD_HANDLE hMethod,\n            const char * modifier,\n            bool fOptional\n            ) = 0;\n\n    // returns the \"NEW\" helper optimized for \"newCls.\"\n    virtual CorInfoHelpFunc getNewHelper(\n            CORINFO_RESOLVED_TOKEN * pResolvedToken,\n            CORINFO_METHOD_HANDLE    callerHandle,\n            bool *                   pHasSideEffects\n            ) = 0;\n\n    // returns the newArr (1-Dim array) helper optimized for \"arrayCls.\"\n    virtual CorInfoHelpFunc getNewArrHelper(\n            CORINFO_CLASS_HANDLE        arrayCls\n            ) = 0;\n\n    // returns the optimized \"IsInstanceOf\" or \"ChkCast\" helper\n    virtual CorInfoHelpFunc getCastingHelper(\n            CORINFO_RESOLVED_TOKEN * pResolvedToken,\n            bool fThrowing\n            ) = 0;\n\n    // returns helper to trigger static constructor\n    virtual CorInfoHelpFunc getSharedCCtorHelper(\n            CORINFO_CLASS_HANDLE clsHnd\n            ) = 0;\n\n    // This is not pretty.  Boxing nullable<T> actually returns\n    // a boxed<T> not a boxed Nullable<T>.  This call allows the verifier\n    // to call back to the EE on the 'box' instruction and get the transformed\n    // type to use for verification.\n    virtual CORINFO_CLASS_HANDLE  getTypeForBox(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // returns the correct box helper for a particular class.  Note\n    // that if this returns CORINFO_HELP_BOX, the JIT can assume\n    // 'standard' boxing (allocate object and copy), and optimize\n    virtual CorInfoHelpFunc getBoxHelper(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // returns the unbox helper.  If 'helperCopies' points to a true\n    // value it means the JIT is requesting a helper that unboxes the\n    // value into a particular location and thus has the signature\n    //     void unboxHelper(void* dest, CORINFO_CLASS_HANDLE cls, Object* obj)\n    // Otherwise (it is null or points at a FALSE value) it is requesting\n    // a helper that returns a pointer to the unboxed data\n    //     void* unboxHelper(CORINFO_CLASS_HANDLE cls, Object* obj)\n    // The EE has the option of NOT returning the copy style helper\n    // (But must be able to always honor the non-copy style helper)\n    // The EE set 'helperCopies' on return to indicate what kind of\n    // helper has been created.\n\n    virtual CorInfoHelpFunc getUnBoxHelper(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    virtual CORINFO_OBJECT_HANDLE getRuntimeTypePointer(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    //------------------------------------------------------------------------------\n    // isObjectImmutable: checks whether given object is known to be immutable or not\n    //\n    // Arguments:\n    //    objPtr - Direct object handle\n    //\n    // Return Value:\n    //    Returns true if object is known to be immutable\n    //\n    virtual bool isObjectImmutable(\n            CORINFO_OBJECT_HANDLE       objPtr\n            ) = 0;\n\n    //------------------------------------------------------------------------------\n    // getStringChar: returns char at the given index if the given object handle\n    //    represents String and index is not out of bounds.\n    //\n    // Arguments:\n    //    strObj - object handle\n    //    index  - index of the char to return\n    //    value  - output char\n    //\n    // Return Value:\n    //    Returns true if value was successfully obtained\n    //\n    virtual bool getStringChar(\n            CORINFO_OBJECT_HANDLE strObj,\n            int                   index,\n            uint16_t*             value) = 0;\n\n    //------------------------------------------------------------------------------\n    // getObjectType: obtains type handle for given object\n    //\n    // Arguments:\n    //    objPtr - Direct object handle\n    //\n    // Return Value:\n    //    Returns CORINFO_CLASS_HANDLE handle that represents given object's type\n    //\n    virtual CORINFO_CLASS_HANDLE getObjectType(\n            CORINFO_OBJECT_HANDLE       objPtr\n            ) = 0;\n\n    virtual bool getReadyToRunHelper(\n            CORINFO_RESOLVED_TOKEN *        pResolvedToken,\n            CORINFO_LOOKUP_KIND *           pGenericLookupKind,\n            CorInfoHelpFunc                 id,\n            CORINFO_CONST_LOOKUP *          pLookup\n            ) = 0;\n\n    virtual void getReadyToRunDelegateCtorHelper(\n            CORINFO_RESOLVED_TOKEN * pTargetMethod,\n            mdToken                  targetConstraint,\n            CORINFO_CLASS_HANDLE     delegateType,\n            CORINFO_LOOKUP *   pLookup\n            ) = 0;\n\n    // This function tries to initialize the class (run the class constructor).\n    // this function returns whether the JIT must insert helper calls before\n    // accessing static field or method.\n    //\n    // See code:ICorClassInfo#ClassConstruction.\n    virtual CorInfoInitClassResult initClass(\n            CORINFO_FIELD_HANDLE    field,          // Non-NULL - inquire about cctor trigger before static field access\n                                                    // NULL - inquire about cctor trigger in method prolog\n            CORINFO_METHOD_HANDLE   method,         // Method referencing the field or prolog\n                                                    // NULL - method being compiled\n            CORINFO_CONTEXT_HANDLE  context         // Exact context of method\n            ) = 0;\n\n    // This used to be called \"loadClass\".  This records the fact\n    // that the class must be loaded (including restored if necessary) before we execute the\n    // code that we are currently generating.  When jitting code\n    // the function loads the class immediately.  When zapping code\n    // the zapper will if necessary use the call to record the fact that we have\n    // to do a fixup/restore before running the method currently being generated.\n    //\n    // This is typically used to ensure value types are loaded before zapped\n    // code that manipulates them is executed, so that the GC can access information\n    // about those value types.\n    virtual void classMustBeLoadedBeforeCodeIsRun(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // returns the class handle for the special builtin classes\n    virtual CORINFO_CLASS_HANDLE getBuiltinClass (\n            CorInfoClassId              classId\n            ) = 0;\n\n    // \"System.Int32\" ==> CORINFO_TYPE_INT..\n    virtual CorInfoType getTypeForPrimitiveValueClass(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // \"System.Int32\" ==> CORINFO_TYPE_INT..\n    // \"System.UInt32\" ==> CORINFO_TYPE_UINT..\n    virtual CorInfoType getTypeForPrimitiveNumericClass(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // TRUE if child is a subtype of parent\n    // if parent is an interface, then does child implement / extend parent\n    virtual bool canCast(\n            CORINFO_CLASS_HANDLE        child,  // subtype (extends parent)\n            CORINFO_CLASS_HANDLE        parent  // base type\n            ) = 0;\n\n    // TRUE if cls1 and cls2 are considered equivalent types.\n    virtual bool areTypesEquivalent(\n            CORINFO_CLASS_HANDLE        cls1,\n            CORINFO_CLASS_HANDLE        cls2\n            ) = 0;\n\n    // See if a cast from fromClass to toClass will succeed, fail, or needs\n    // to be resolved at runtime.\n    virtual TypeCompareState compareTypesForCast(\n            CORINFO_CLASS_HANDLE        fromClass,\n            CORINFO_CLASS_HANDLE        toClass\n            ) = 0;\n\n    // See if types represented by cls1 and cls2 compare equal, not\n    // equal, or the comparison needs to be resolved at runtime.\n    virtual TypeCompareState compareTypesForEquality(\n            CORINFO_CLASS_HANDLE        cls1,\n            CORINFO_CLASS_HANDLE        cls2\n            ) = 0;\n\n    // Returns the intersection of cls1 and cls2.\n    virtual CORINFO_CLASS_HANDLE mergeClasses(\n            CORINFO_CLASS_HANDLE        cls1,\n            CORINFO_CLASS_HANDLE        cls2\n            ) = 0;\n\n    // Returns true if cls2 is known to be a more specific type\n    // than cls1 (a subtype or more restrictive shared type)\n    // for purposes of jit type tracking. This is a hint to the\n    // jit for optimization; it does not have correctness\n    // implications.\n    virtual bool isMoreSpecificType(\n            CORINFO_CLASS_HANDLE        cls1,\n            CORINFO_CLASS_HANDLE        cls2\n            ) = 0;\n\n    // Returns TypeCompareState::Must if cls is known to be an enum.\n    // For enums with known exact type returns the underlying\n    // type in underlyingType when the provided pointer is\n    // non-NULL.\n    // Returns TypeCompareState::May when a runtime check is required.\n    virtual TypeCompareState isEnum(\n            CORINFO_CLASS_HANDLE        cls,\n            CORINFO_CLASS_HANDLE*       underlyingType\n            ) = 0;\n\n    // Given a class handle, returns the Parent type.\n    // For COMObjectType, it returns Class Handle of System.Object.\n    // Returns 0 if System.Object is passed in.\n    virtual CORINFO_CLASS_HANDLE getParentType (\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // Returns the CorInfoType of the \"child type\". If the child type is\n    // not a primitive type, *clsRet will be set.\n    // Given an Array of Type Foo, returns Foo.\n    // Given BYREF Foo, returns Foo\n    virtual CorInfoType getChildType (\n            CORINFO_CLASS_HANDLE       clsHnd,\n            CORINFO_CLASS_HANDLE       *clsRet\n            ) = 0;\n\n    // Check constraints on type arguments of this class and parent classes\n    virtual bool satisfiesClassConstraints(\n            CORINFO_CLASS_HANDLE cls\n            ) = 0;\n\n    // Check if this is a single dimensional array type\n    virtual bool isSDArray(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // Get the numbmer of dimensions in an array\n    virtual unsigned getArrayRank(\n            CORINFO_CLASS_HANDLE        cls\n            ) = 0;\n\n    // Get the index of runtime provided array method\n    virtual CorInfoArrayIntrinsic getArrayIntrinsicID(\n            CORINFO_METHOD_HANDLE        ftn\n            ) = 0;\n\n    // Get static field data for an array\n    virtual void * getArrayInitializationData(\n            CORINFO_FIELD_HANDLE        field,\n            uint32_t                    size\n            ) = 0;\n\n    // Check Visibility rules.\n    virtual CorInfoIsAccessAllowedResult canAccessClass(\n                        CORINFO_RESOLVED_TOKEN * pResolvedToken,\n                        CORINFO_METHOD_HANDLE   callerHandle,\n                        CORINFO_HELPER_DESC    *pAccessHelper /* If canAccessMethod returns something other\n                                                                 than ALLOWED, then this is filled in. */\n                        ) = 0;\n\n    /**********************************************************************************/\n    //\n    // ICorFieldInfo\n    //\n    /**********************************************************************************/\n\n    // Prints the name of a field into a buffer. See printObjectDescription for more documentation.\n    virtual size_t printFieldName(\n                        CORINFO_FIELD_HANDLE field,\n                        char* buffer,\n                        size_t bufferSize,\n                        size_t* pRequiredBufferSize = nullptr\n                        ) = 0;\n\n    // return class it belongs to\n    virtual CORINFO_CLASS_HANDLE getFieldClass (\n                        CORINFO_FIELD_HANDLE    field\n                        ) = 0;\n\n    // Return the field's type, if it is CORINFO_TYPE_VALUECLASS 'structType' is set\n    // the field's value class (if 'structType' == 0, then don't bother\n    // the structure info).\n    //\n    // 'memberParent' is typically only set when verifying.  It should be the\n    // result of calling getMemberParent.\n    virtual CorInfoType getFieldType(\n                        CORINFO_FIELD_HANDLE    field,\n                        CORINFO_CLASS_HANDLE   *structType = NULL,\n                        CORINFO_CLASS_HANDLE    memberParent = NULL /* IN */\n                        ) = 0;\n\n    // return the data member's instance offset\n    virtual unsigned getFieldOffset(\n                        CORINFO_FIELD_HANDLE    field\n                        ) = 0;\n\n    virtual void getFieldInfo (CORINFO_RESOLVED_TOKEN * pResolvedToken,\n                               CORINFO_METHOD_HANDLE  callerHandle,\n                               CORINFO_ACCESS_FLAGS   flags,\n                               CORINFO_FIELD_INFO    *pResult\n                              ) = 0;\n\n    // Returns true iff \"fldHnd\" represents a static field.\n    virtual bool isFieldStatic(CORINFO_FIELD_HANDLE fldHnd) = 0;\n\n    // Returns Length of an Array or of a String object, otherwise -1.\n    // objHnd must not be null.\n    virtual int getArrayOrStringLength(CORINFO_OBJECT_HANDLE objHnd) = 0;\n\n    /*********************************************************************************/\n    //\n    // ICorDebugInfo\n    //\n    /*********************************************************************************/\n\n    // Query the EE to find out where interesting break points\n    // in the code are.  The native compiler will ensure that these places\n    // have a corresponding break point in native code.\n    //\n    // Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will\n    // be used only as a hint and the native compiler should not change its\n    // code generation.\n    virtual void getBoundaries(\n                CORINFO_METHOD_HANDLE   ftn,                // [IN] method of interest\n                unsigned int           *cILOffsets,         // [OUT] size of pILOffsets\n                uint32_t              **pILOffsets,         // [OUT] IL offsets of interest\n                                                            //       jit MUST free with freeArray!\n                ICorDebugInfo::BoundaryTypes *implicitBoundaries // [OUT] tell jit, all boundaries of this type\n                ) = 0;\n\n    // Report back the mapping from IL to native code,\n    // this map should include all boundaries that 'getBoundaries'\n    // reported as interesting to the debugger.\n\n    // Note that debugger (and profiler) is assuming that all of the\n    // offsets form a contiguous block of memory, and that the\n    // OffsetMapping is sorted in order of increasing native offset.\n    virtual void setBoundaries(\n                CORINFO_METHOD_HANDLE         ftn,      // [IN] method of interest\n                uint32_t                      cMap,     // [IN] size of pMap\n                ICorDebugInfo::OffsetMapping *pMap      // [IN] map including all points of interest.\n                                                        //      jit allocated with allocateArray, EE frees\n                ) = 0;\n\n    // Query the EE to find out the scope of local variables.\n    // normally the JIT would trash variables after last use, but\n    // under debugging, the JIT needs to keep them live over their\n    // entire scope so that they can be inspected.\n    //\n    // Note that unless CORJIT_FLAG_DEBUG_CODE is specified, this function will\n    // be used only as a hint and the native compiler should not change its\n    // code generation.\n    virtual void getVars(\n            CORINFO_METHOD_HANDLE           ftn,            // [IN]  method of interest\n            uint32_t                       *cVars,          // [OUT] size of 'vars'\n            ICorDebugInfo::ILVarInfo      **vars,          // [OUT] scopes of variables of interest\n                                                            //       jit MUST free with freeArray!\n            bool                           *extendOthers    // [OUT] it TRUE, then assume the scope\n                                                            //       of unmentioned vars is entire method\n            ) = 0;\n\n    // Report back to the EE the location of every variable.\n    // note that the JIT might split lifetimes into different\n    // locations etc.\n\n    virtual void setVars(\n            CORINFO_METHOD_HANDLE           ftn,            // [IN] method of interest\n            uint32_t                        cVars,          // [IN] size of 'vars'\n            ICorDebugInfo::NativeVarInfo   *vars            // [IN] map telling where local vars are stored at what points\n                                                            //      jit allocated with allocateArray, EE frees\n            ) = 0;\n\n    // Report inline tree and rich offset mappings to EE.\n    // The arrays are expected to be allocated with allocateArray\n    // and ownership is transferred to the EE with this call.\n    virtual void reportRichMappings(\n            ICorDebugInfo::InlineTreeNode*    inlineTreeNodes,    // [IN] Nodes of the inline tree\n            uint32_t                          numInlineTreeNodes, // [IN] Number of nodes in the inline tree\n            ICorDebugInfo::RichOffsetMapping* mappings,           // [IN] Rich mappings\n            uint32_t                          numMappings         // [IN] Number of rich mappings\n            ) = 0;\n\n    /*-------------------------- Misc ---------------------------------------*/\n\n    // Used to allocate memory that needs to handed to the EE.\n    // For eg, use this to allocated memory for reporting debug info,\n    // which will be handed to the EE by setVars() and setBoundaries()\n    virtual void * allocateArray(\n                        size_t              cBytes\n                        ) = 0;\n\n    // JitCompiler will free arrays passed by the EE using this\n    // For eg, The EE returns memory in getVars() and getBoundaries()\n    // to the JitCompiler, which the JitCompiler should release using\n    // freeArray()\n    virtual void freeArray(\n            void               *array\n            ) = 0;\n\n    /*********************************************************************************/\n    //\n    // ICorArgInfo\n    //\n    /*********************************************************************************/\n\n    // advance the pointer to the argument list.\n    // a ptr of 0, is special and always means the first argument\n    virtual CORINFO_ARG_LIST_HANDLE getArgNext (\n            CORINFO_ARG_LIST_HANDLE     args            /* IN */\n            ) = 0;\n\n    // Get the type of a particular argument\n    // CORINFO_TYPE_UNDEF is returned when there are no more arguments\n    // If the type returned is a primitive type (or an enum) *vcTypeRet set to NULL\n    // otherwise it is set to the TypeHandle associted with the type\n    // Enumerations will always look their underlying type (probably should fix this)\n    // Otherwise vcTypeRet is the type as would be seen by the IL,\n    // The return value is the type that is used for calling convention purposes\n    // (Thus if the EE wants a value class to be passed like an int, then it will\n    // return CORINFO_TYPE_INT\n    virtual CorInfoTypeWithMod getArgType (\n            CORINFO_SIG_INFO*           sig,            /* IN */\n            CORINFO_ARG_LIST_HANDLE     args,           /* IN */\n            CORINFO_CLASS_HANDLE       *vcTypeRet       /* OUT */\n            ) = 0;\n\n    // Obtains a list of exact classes for a given base type. Returns 0 if the number of\n    // the exact classes is greater than maxExactClasses or if more types might be loaded\n    // in future.\n    virtual int getExactClasses(\n                CORINFO_CLASS_HANDLE  baseType,            /* IN */\n                int                   maxExactClasses,     /* IN */\n                CORINFO_CLASS_HANDLE* exactClsRet          /* OUT */\n                ) = 0;\n\n    // If the Arg is a CORINFO_TYPE_CLASS fetch the class handle associated with it\n    virtual CORINFO_CLASS_HANDLE getArgClass (\n            CORINFO_SIG_INFO*           sig,            /* IN */\n            CORINFO_ARG_LIST_HANDLE     args            /* IN */\n            ) = 0;\n\n    // Returns type of HFA for valuetype\n    virtual CorInfoHFAElemType getHFAType (\n            CORINFO_CLASS_HANDLE hClass\n            ) = 0;\n\n /*****************************************************************************\n * ICorErrorInfo contains methods to deal with SEH exceptions being thrown\n * from the corinfo interface.  These methods may be called when an exception\n * with code EXCEPTION_COMPLUS is caught.\n *****************************************************************************/\n\n    // Returns the HRESULT of the current exception\n    virtual JITINTERFACE_HRESULT GetErrorHRESULT(\n            struct _EXCEPTION_POINTERS *pExceptionPointers\n            ) = 0;\n\n    // Fetches the message of the current exception\n    // Returns the size of the message (including terminating null). This can be\n    // greater than bufferLength if the buffer is insufficient.\n    virtual uint32_t GetErrorMessage(\n            _Inout_updates_(bufferLength) char16_t *buffer,\n            uint32_t bufferLength\n            ) = 0;\n\n    // returns EXCEPTION_EXECUTE_HANDLER if it is OK for the compile to handle the\n    //                        exception, abort some work (like the inlining) and continue compilation\n    // returns EXCEPTION_CONTINUE_SEARCH if exception must always be handled by the EE\n    //                    things like ThreadStoppedException ...\n    // returns EXCEPTION_CONTINUE_EXECUTION if exception is fixed up by the EE\n    // Only used as a contract between the Zapper and the VM.\n    virtual int FilterException(\n            struct _EXCEPTION_POINTERS *pExceptionPointers\n            ) = 0;\n\n\n    virtual void ThrowExceptionForJitResult(\n            JITINTERFACE_HRESULT result) = 0;\n\n    //Throws an exception defined by the given throw helper.\n    virtual void ThrowExceptionForHelper(\n            const CORINFO_HELPER_DESC * throwHelper) = 0;\n\n    // Runs the given function under an error trap. This allows the JIT to make calls\n    // to interface functions that may throw exceptions without needing to be aware of\n    // the EH ABI, exception types, etc. Returns true if the given function completed\n    // successfully and false otherwise.\n    typedef void (*errorTrapFunction)(void*);\n    virtual bool runWithErrorTrap(\n        errorTrapFunction function, // The function to run\n        void* parameter          // The context parameter that will be passed to the function and the handler\n        ) = 0;\n\n    // Runs the given function under an error trap. This allows the JIT to make calls\n    // to interface functions that may throw exceptions without needing to be aware of\n    // the EH ABI, exception types, etc. Returns true if the given function completed\n    // successfully and false otherwise. This error trap checks for SuperPMI exceptions\n    virtual bool runWithSPMIErrorTrap(\n        errorTrapFunction function, // The function to run\n        void* parameter          // The context parameter that will be passed to the function and the handler\n        ) = 0;\n\n/*****************************************************************************\n * ICorStaticInfo contains EE interface methods which return values that are\n * constant from invocation to invocation.  Thus they may be embedded in\n * persisted information like statically generated code. (This is of course\n * assuming that all code versions are identical each time.)\n *****************************************************************************/\n\n    // Return details about EE internal data structures\n    virtual void getEEInfo(\n                CORINFO_EE_INFO            *pEEInfoOut\n                ) = 0;\n\n    // Returns name of the JIT timer log\n    virtual const char16_t *getJitTimeLogFilename() = 0;\n\n    /*********************************************************************************/\n    //\n    // Diagnostic methods\n    //\n    /*********************************************************************************/\n\n    // this function is for debugging only. Returns method token.\n    // Returns mdMethodDefNil for dynamic methods.\n    virtual mdMethodDef getMethodDefFromMethod(\n            CORINFO_METHOD_HANDLE hMethod\n            ) = 0;\n\n    // This is similar to getMethodNameFromMetadata except that it also returns\n    // reasonable names for functions without metadata.\n    // See printObjectDescription for documentation of parameters.\n    virtual size_t printMethodName(\n            CORINFO_METHOD_HANDLE ftn,\n            char*                 buffer,\n            size_t                bufferSize,\n            size_t*               pRequiredBufferSize = nullptr) = 0;\n\n    // Return method name as in metadata, or nullptr if there is none,\n    // and optionally return the class, enclosing class, and namespace names\n    // as in metadata.\n    // Suitable for non-debugging use.\n    virtual const char* getMethodNameFromMetadata(\n            CORINFO_METHOD_HANDLE       ftn,                  /* IN */\n            const char                **className,            /* OUT */\n            const char                **namespaceName,        /* OUT */\n            const char                **enclosingClassName   /* OUT */\n            ) = 0;\n\n    // this function is for debugging only.  It returns a value that\n    // is will always be the same for a given method.  It is used\n    // to implement the 'jitRange' functionality\n    virtual unsigned getMethodHash (\n            CORINFO_METHOD_HANDLE       ftn         /* IN */\n            ) = 0;\n\n    // this function is for debugging only.\n    virtual size_t findNameOfToken (\n            CORINFO_MODULE_HANDLE       module,     /* IN  */\n            mdToken                     metaTOK,     /* IN  */\n            _Out_writes_ (FQNameCapacity) char * szFQName, /* OUT */\n            size_t FQNameCapacity  /* IN */\n            ) = 0;\n\n    // returns whether the struct is enregisterable. Only valid on a System V VM. Returns true on success, false on failure.\n    virtual bool getSystemVAmd64PassStructInRegisterDescriptor(\n        /* IN */    CORINFO_CLASS_HANDLE        structHnd,\n        /* OUT */   SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr\n        ) = 0;\n\n    virtual uint32_t getLoongArch64PassStructInRegisterFlags(CORINFO_CLASS_HANDLE cls) = 0;\n};\n\n/*****************************************************************************\n * ICorDynamicInfo contains EE interface methods which return values that may\n * change from invocation to invocation.  They cannot be embedded in persisted\n * data; they must be requeried each time the EE is run.\n *****************************************************************************/\n\nclass ICorDynamicInfo : public ICorStaticInfo\n{\npublic:\n\n    //\n    // These methods return values to the JIT which are not constant\n    // from session to session.\n    //\n    // These methods take an extra parameter : void **ppIndirection.\n    // If a JIT supports generation of prejit code (install-o-jit), it\n    // must pass a non-null value for this parameter, and check the\n    // resulting value.  If *ppIndirection is NULL, code should be\n    // generated normally.  If non-null, then the value of\n    // *ppIndirection is an address in the cookie table, and the code\n    // generator needs to generate an indirection through the table to\n    // get the resulting value.  In this case, the return result of the\n    // function must NOT be directly embedded in the generated code.\n    //\n    // Note that if a JIT does not support prejit code generation, it\n    // may ignore the extra parameter & pass the default of NULL - the\n    // prejit ICorDynamicInfo implementation will see this & generate\n    // an error if the jitter is used in a prejit scenario.\n    //\n\n    // Return details about EE internal data structures\n\n    virtual uint32_t getThreadTLSIndex(\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    virtual const void * getInlinedCallFrameVptr(\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    virtual int32_t * getAddrOfCaptureThreadGlobal(\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    // return the native entry point to an EE helper (see CorInfoHelpFunc)\n    virtual void* getHelperFtn (\n                    CorInfoHelpFunc         ftnNum,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    // return a callable address of the function (native code). This function\n    // may return a different value (depending on whether the method has\n    // been JITed or not.\n    virtual void getFunctionEntryPoint(\n                              CORINFO_METHOD_HANDLE   ftn,                 /* IN  */\n                              CORINFO_CONST_LOOKUP *  pResult,             /* OUT */\n                              CORINFO_ACCESS_FLAGS    accessFlags = CORINFO_ACCESS_ANY) = 0;\n\n    // return a directly callable address. This can be used similarly to the\n    // value returned by getFunctionEntryPoint() except that it is\n    // guaranteed to be multi callable entrypoint.\n    virtual void getFunctionFixedEntryPoint(\n                              CORINFO_METHOD_HANDLE   ftn,\n                              bool                    isUnsafeFunctionPointer,\n                              CORINFO_CONST_LOOKUP *  pResult) = 0;\n\n    // get the synchronization handle that is passed to monXstatic function\n    virtual void* getMethodSync(\n                    CORINFO_METHOD_HANDLE               ftn,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    // get slow lazy string literal helper to use (CORINFO_HELP_STRCNS*).\n    // Returns CORINFO_HELP_UNDEF if lazy string literal helper cannot be used.\n    virtual CorInfoHelpFunc getLazyStringLiteralHelper(\n                    CORINFO_MODULE_HANDLE   handle\n                    ) = 0;\n\n    virtual CORINFO_MODULE_HANDLE embedModuleHandle(\n                    CORINFO_MODULE_HANDLE   handle,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    virtual CORINFO_CLASS_HANDLE embedClassHandle(\n                    CORINFO_CLASS_HANDLE    handle,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    virtual CORINFO_METHOD_HANDLE embedMethodHandle(\n                    CORINFO_METHOD_HANDLE   handle,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    virtual CORINFO_FIELD_HANDLE embedFieldHandle(\n                    CORINFO_FIELD_HANDLE    handle,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    // Given a module scope (module), a method handle (context) and\n    // a metadata token (metaTOK), fetch the handle\n    // (type, field or method) associated with the token.\n    // If this is not possible at compile-time (because the current method's\n    // code is shared and the token contains generic parameters)\n    // then indicate how the handle should be looked up at run-time.\n    //\n    virtual void embedGenericHandle(\n                        CORINFO_RESOLVED_TOKEN *        pResolvedToken,\n                        bool                            fEmbedParent, // TRUE - embeds parent type handle of the field/method handle\n                        CORINFO_GENERICHANDLE_RESULT *  pResult) = 0;\n\n    // Return information used to locate the exact enclosing type of the current method.\n    // Used only to invoke .cctor method from code shared across generic instantiations\n    //   !needsRuntimeLookup       statically known (enclosing type of method itself)\n    //   needsRuntimeLookup:\n    //      CORINFO_LOOKUP_THISOBJ     use vtable pointer of 'this' param\n    //      CORINFO_LOOKUP_CLASSPARAM  use vtable hidden param\n    //      CORINFO_LOOKUP_METHODPARAM use enclosing type of method-desc hidden param\n    virtual void getLocationOfThisType(\n                    CORINFO_METHOD_HANDLE context,\n                    CORINFO_LOOKUP_KIND* pLookupKind\n                    ) = 0;\n\n    // return the address of the PInvoke target. May be a fixup area in the\n    // case of late-bound PInvoke calls.\n    virtual void getAddressOfPInvokeTarget(\n                    CORINFO_METHOD_HANDLE  method,\n                    CORINFO_CONST_LOOKUP  *pLookup\n                    ) = 0;\n\n    // Generate a cookie based on the signature that would needs to be passed\n    // to CORINFO_HELP_PINVOKE_CALLI\n    virtual void* GetCookieForPInvokeCalliSig(\n            CORINFO_SIG_INFO* szMetaSig,\n            void           ** ppIndirection = NULL\n            ) = 0;\n\n    // returns true if a VM cookie can be generated for it (might be false due to cross-module\n    // inlining, in which case the inlining should be aborted)\n    virtual bool canGetCookieForPInvokeCalliSig(\n                    CORINFO_SIG_INFO* szMetaSig\n                    ) = 0;\n\n    // Gets a handle that is checked to see if the current method is\n    // included in \"JustMyCode\"\n    virtual CORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(\n                    CORINFO_METHOD_HANDLE       method,\n                    CORINFO_JUST_MY_CODE_HANDLE**ppIndirection = NULL\n                    ) = 0;\n\n    // Gets a method handle that can be used to correlate profiling data.\n    // This is the IP of a native method, or the address of the descriptor struct\n    // for IL.  Always guaranteed to be unique per process, and not to move. */\n    virtual void GetProfilingHandle(\n                    bool                      *pbHookFunction,\n                    void                     **pProfilerHandle,\n                    bool                      *pbIndirectedHandles\n                    ) = 0;\n\n    // Returns instructions on how to make the call. See code:CORINFO_CALL_INFO for possible return values.\n    virtual void getCallInfo(\n                        // Token info\n                        CORINFO_RESOLVED_TOKEN * pResolvedToken,\n\n                        //Generics info\n                        CORINFO_RESOLVED_TOKEN * pConstrainedResolvedToken,\n\n                        //Security info\n                        CORINFO_METHOD_HANDLE   callerHandle,\n\n                        //Jit info\n                        CORINFO_CALLINFO_FLAGS  flags,\n\n                        //out params\n                        CORINFO_CALL_INFO       *pResult\n                        ) = 0;\n\n    virtual bool canAccessFamily(CORINFO_METHOD_HANDLE hCaller,\n                                           CORINFO_CLASS_HANDLE hInstanceType) = 0;\n\n    // Returns TRUE if the Class Domain ID is the RID of the class (currently true for every class\n    // except reflection emitted classes and generics)\n    virtual bool isRIDClassDomainID(CORINFO_CLASS_HANDLE cls) = 0;\n\n    // returns the class's domain ID for accessing shared statics\n    virtual unsigned getClassDomainID (\n                    CORINFO_CLASS_HANDLE    cls,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n\n    // return the data's address (for static fields only)\n    virtual void* getFieldAddress(\n                    CORINFO_FIELD_HANDLE    field,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    //------------------------------------------------------------------------------\n    // getReadonlyStaticFieldValue: returns true and the actual field's value if the given\n    //    field represents a statically initialized readonly field of any type.\n    //\n    // Arguments:\n    //    field                - field handle\n    //    buffer               - buffer field's value will be stored to\n    //    bufferSize           - size of buffer\n    //    ignoreMovableObjects - ignore movable reference types or not\n    //\n    // Return Value:\n    //    Returns true if field's constant value was available and successfully copied to buffer\n    //\n    virtual bool getReadonlyStaticFieldValue(\n                    CORINFO_FIELD_HANDLE    field,\n                    uint8_t                *buffer,\n                    int                     bufferSize,\n                    int                     valueOffset = 0,\n                    bool                    ignoreMovableObjects = true\n                    ) = 0;\n\n    // If pIsSpeculative is NULL, return the class handle for the value of ref-class typed\n    // static readonly fields, if there is a unique location for the static and the class\n    // is already initialized.\n    //\n    // If pIsSpeculative is not NULL, fetch the class handle for the value of all ref-class\n    // typed static fields, if there is a unique location for the static and the field is\n    // not null.\n    //\n    // Set *pIsSpeculative true if this type may change over time (field is not readonly or\n    // is readonly but class has not yet finished initialization). Set *pIsSpeculative false\n    // if this type will not change.\n    virtual CORINFO_CLASS_HANDLE getStaticFieldCurrentClass(\n                    CORINFO_FIELD_HANDLE    field,\n                    bool                   *pIsSpeculative = NULL\n                    ) = 0;\n\n    // registers a vararg sig & returns a VM cookie for it (which can contain other stuff)\n    virtual CORINFO_VARARGS_HANDLE getVarArgsHandle(\n                    CORINFO_SIG_INFO       *pSig,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    // returns true if a VM cookie can be generated for it (might be false due to cross-module\n    // inlining, in which case the inlining should be aborted)\n    virtual bool canGetVarArgsHandle(\n                    CORINFO_SIG_INFO       *pSig\n                    ) = 0;\n\n    // Allocate a string literal on the heap and return a handle to it\n    virtual InfoAccessType constructStringLiteral(\n                    CORINFO_MODULE_HANDLE   module,\n                    mdToken                 metaTok,\n                    void                  **ppValue\n                    ) = 0;\n\n    virtual InfoAccessType emptyStringLiteral(\n                    void                  **ppValue\n                    ) = 0;\n\n    // (static fields only) given that 'field' refers to thread local store,\n    // return the ID (TLS index), which is used to find the beginning of the\n    // TLS data area for the particular DLL 'field' is associated with.\n    virtual uint32_t getFieldThreadLocalStoreID (\n                    CORINFO_FIELD_HANDLE    field,\n                    void                  **ppIndirection = NULL\n                    ) = 0;\n\n    // Adds an active dependency from the context method's module to the given module\n    // This is internal callback for the EE. JIT should not call it directly.\n    virtual void addActiveDependency(\n               CORINFO_MODULE_HANDLE       moduleFrom,\n               CORINFO_MODULE_HANDLE       moduleTo\n                ) = 0;\n\n    virtual CORINFO_METHOD_HANDLE GetDelegateCtor(\n            CORINFO_METHOD_HANDLE  methHnd,\n            CORINFO_CLASS_HANDLE   clsHnd,\n            CORINFO_METHOD_HANDLE  targetMethodHnd,\n            DelegateCtorArgs *     pCtorData\n            ) = 0;\n\n    virtual void MethodCompileComplete(\n                CORINFO_METHOD_HANDLE methHnd\n                ) = 0;\n\n    // Obtain tailcall help for the specified call site.\n    virtual bool getTailCallHelpers(\n\n        // The resolved token for the call. Can be null for calli.\n        CORINFO_RESOLVED_TOKEN* callToken,\n\n        // The signature at the callsite.\n        CORINFO_SIG_INFO* sig,\n\n        // Flags for the tailcall site.\n        CORINFO_GET_TAILCALL_HELPERS_FLAGS flags,\n\n        // The resulting help.\n        CORINFO_TAILCALL_HELPERS* pResult) = 0;\n\n    // Optionally, convert calli to regular method call. This is for PInvoke argument marshalling.\n    virtual bool convertPInvokeCalliToCall(\n                    CORINFO_RESOLVED_TOKEN * pResolvedToken,\n                    bool fMustConvert\n                    ) = 0;\n\n    // Notify EE about intent to use or not to use instruction set in the method. Returns true if the instruction set is supported unconditionally.\n    virtual bool notifyInstructionSetUsage(\n                CORINFO_InstructionSet instructionSet,\n                bool supportEnabled\n            ) = 0;\n\n    // Notify EE that JIT needs an entry-point that is tail-callable.\n    // This is used for AOT on x64 to support delay loaded fast tailcalls.\n    // Normally the indirection cell is retrieved from the return address,\n    // but for tailcalls, the contract is that JIT leaves the indirection cell in\n    // a register during tailcall.\n    virtual void updateEntryPointForTailCall(CORINFO_CONST_LOOKUP* entryPoint) = 0;\n};\n\n/**********************************************************************************/\n\n// It would be nicer to use existing IMAGE_REL_XXX constants instead of defining our own here...\n#define IMAGE_REL_BASED_REL32           0x10\n#define IMAGE_REL_BASED_THUMB_BRANCH24  0x13\n\n// The identifier for ARM32-specific PC-relative address\n// computation corresponds to the following instruction\n// sequence:\n//  l0: movw rX, #imm_lo  // 4 byte\n//  l4: movt rX, #imm_hi  // 4 byte\n//  l8: add  rX, pc <- after this instruction rX = relocTarget\n//\n// Program counter at l8 is address of l8 + 4\n// Address of relocated movw/movt is l0\n// So, imm should be calculated as the following:\n//  imm = relocTarget - (l8 + 4) = relocTarget - (l0 + 8 + 4) = relocTarget - (l_0 + 12)\n// So, the value of offset correction is 12\n//\n#define IMAGE_REL_BASED_REL_THUMB_MOV32_PCREL   0x14\n\n/**********************************************************************************/\n#ifdef TARGET_64BIT\n#define USE_PER_FRAME_PINVOKE_INIT\n#endif\n\n#endif // _COR_INFO_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corinfoinstructionset.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED\n// FROM /src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt\n// using /src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat\n\n#ifndef CORINFOINSTRUCTIONSET_H\n#define CORINFOINSTRUCTIONSET_H\n\n#include \"readytoruninstructionset.h\"\n#include <stdint.h>\n\nenum CORINFO_InstructionSet\n{\n    InstructionSet_ILLEGAL = 0,\n    InstructionSet_NONE = 63,\n#ifdef TARGET_ARM64\n    InstructionSet_ArmBase=1,\n    InstructionSet_AdvSimd=2,\n    InstructionSet_Aes=3,\n    InstructionSet_Crc32=4,\n    InstructionSet_Dp=5,\n    InstructionSet_Rdm=6,\n    InstructionSet_Sha1=7,\n    InstructionSet_Sha256=8,\n    InstructionSet_Atomics=9,\n    InstructionSet_Vector64=10,\n    InstructionSet_Vector128=11,\n    InstructionSet_Dczva=12,\n    InstructionSet_Rcpc=13,\n    InstructionSet_ArmBase_Arm64=14,\n    InstructionSet_AdvSimd_Arm64=15,\n    InstructionSet_Aes_Arm64=16,\n    InstructionSet_Crc32_Arm64=17,\n    InstructionSet_Dp_Arm64=18,\n    InstructionSet_Rdm_Arm64=19,\n    InstructionSet_Sha1_Arm64=20,\n    InstructionSet_Sha256_Arm64=21,\n#endif // TARGET_ARM64\n#ifdef TARGET_AMD64\n    InstructionSet_X86Base=1,\n    InstructionSet_SSE=2,\n    InstructionSet_SSE2=3,\n    InstructionSet_SSE3=4,\n    InstructionSet_SSSE3=5,\n    InstructionSet_SSE41=6,\n    InstructionSet_SSE42=7,\n    InstructionSet_AVX=8,\n    InstructionSet_AVX2=9,\n    InstructionSet_AES=10,\n    InstructionSet_BMI1=11,\n    InstructionSet_BMI2=12,\n    InstructionSet_FMA=13,\n    InstructionSet_LZCNT=14,\n    InstructionSet_PCLMULQDQ=15,\n    InstructionSet_POPCNT=16,\n    InstructionSet_Vector128=17,\n    InstructionSet_Vector256=18,\n    InstructionSet_AVXVNNI=19,\n    InstructionSet_MOVBE=20,\n    InstructionSet_X86Serialize=21,\n    InstructionSet_AVX512F=22,\n    InstructionSet_AVX512F_VL=23,\n    InstructionSet_AVX512BW=24,\n    InstructionSet_AVX512BW_VL=25,\n    InstructionSet_AVX512CD=26,\n    InstructionSet_AVX512CD_VL=27,\n    InstructionSet_AVX512DQ=28,\n    InstructionSet_AVX512DQ_VL=29,\n    InstructionSet_X86Base_X64=30,\n    InstructionSet_SSE_X64=31,\n    InstructionSet_SSE2_X64=32,\n    InstructionSet_SSE3_X64=33,\n    InstructionSet_SSSE3_X64=34,\n    InstructionSet_SSE41_X64=35,\n    InstructionSet_SSE42_X64=36,\n    InstructionSet_AVX_X64=37,\n    InstructionSet_AVX2_X64=38,\n    InstructionSet_AES_X64=39,\n    InstructionSet_BMI1_X64=40,\n    InstructionSet_BMI2_X64=41,\n    InstructionSet_FMA_X64=42,\n    InstructionSet_LZCNT_X64=43,\n    InstructionSet_PCLMULQDQ_X64=44,\n    InstructionSet_POPCNT_X64=45,\n    InstructionSet_AVXVNNI_X64=46,\n    InstructionSet_MOVBE_X64=47,\n    InstructionSet_X86Serialize_X64=48,\n    InstructionSet_AVX512F_X64=49,\n    InstructionSet_AVX512F_VL_X64=50,\n    InstructionSet_AVX512BW_X64=51,\n    InstructionSet_AVX512BW_VL_X64=52,\n    InstructionSet_AVX512CD_X64=53,\n    InstructionSet_AVX512CD_VL_X64=54,\n    InstructionSet_AVX512DQ_X64=55,\n    InstructionSet_AVX512DQ_VL_X64=56,\n#endif // TARGET_AMD64\n#ifdef TARGET_X86\n    InstructionSet_X86Base=1,\n    InstructionSet_SSE=2,\n    InstructionSet_SSE2=3,\n    InstructionSet_SSE3=4,\n    InstructionSet_SSSE3=5,\n    InstructionSet_SSE41=6,\n    InstructionSet_SSE42=7,\n    InstructionSet_AVX=8,\n    InstructionSet_AVX2=9,\n    InstructionSet_AES=10,\n    InstructionSet_BMI1=11,\n    InstructionSet_BMI2=12,\n    InstructionSet_FMA=13,\n    InstructionSet_LZCNT=14,\n    InstructionSet_PCLMULQDQ=15,\n    InstructionSet_POPCNT=16,\n    InstructionSet_Vector128=17,\n    InstructionSet_Vector256=18,\n    InstructionSet_AVXVNNI=19,\n    InstructionSet_MOVBE=20,\n    InstructionSet_X86Serialize=21,\n    InstructionSet_AVX512F=22,\n    InstructionSet_AVX512F_VL=23,\n    InstructionSet_AVX512BW=24,\n    InstructionSet_AVX512BW_VL=25,\n    InstructionSet_AVX512CD=26,\n    InstructionSet_AVX512CD_VL=27,\n    InstructionSet_AVX512DQ=28,\n    InstructionSet_AVX512DQ_VL=29,\n    InstructionSet_X86Base_X64=30,\n    InstructionSet_SSE_X64=31,\n    InstructionSet_SSE2_X64=32,\n    InstructionSet_SSE3_X64=33,\n    InstructionSet_SSSE3_X64=34,\n    InstructionSet_SSE41_X64=35,\n    InstructionSet_SSE42_X64=36,\n    InstructionSet_AVX_X64=37,\n    InstructionSet_AVX2_X64=38,\n    InstructionSet_AES_X64=39,\n    InstructionSet_BMI1_X64=40,\n    InstructionSet_BMI2_X64=41,\n    InstructionSet_FMA_X64=42,\n    InstructionSet_LZCNT_X64=43,\n    InstructionSet_PCLMULQDQ_X64=44,\n    InstructionSet_POPCNT_X64=45,\n    InstructionSet_AVXVNNI_X64=46,\n    InstructionSet_MOVBE_X64=47,\n    InstructionSet_X86Serialize_X64=48,\n    InstructionSet_AVX512F_X64=49,\n    InstructionSet_AVX512F_VL_X64=50,\n    InstructionSet_AVX512BW_X64=51,\n    InstructionSet_AVX512BW_VL_X64=52,\n    InstructionSet_AVX512CD_X64=53,\n    InstructionSet_AVX512CD_VL_X64=54,\n    InstructionSet_AVX512DQ_X64=55,\n    InstructionSet_AVX512DQ_VL_X64=56,\n#endif // TARGET_X86\n\n};\n\nstruct CORINFO_InstructionSetFlags\n{\nprivate:\n    static const int32_t FlagsFieldCount = 1;\n    static const int32_t BitsPerFlagsField = sizeof(uint64_t) * 8;\n    uint64_t _flags[FlagsFieldCount] = { };\n\n\n    static uint32_t GetFlagsFieldIndex(CORINFO_InstructionSet instructionSet)\n    {\n        uint32_t bitIndex = (uint32_t)instructionSet;\n        return (uint32_t)(bitIndex / (uint32_t)BitsPerFlagsField);\n    }\n\n    static uint64_t GetRelativeBitMask(CORINFO_InstructionSet instructionSet)\n    {\n        return ((uint64_t)1) << (instructionSet & 0x3F);\n    }\n\npublic:\n\n    const int GetInstructionFlagsFieldCount() const\n    {\n        return FlagsFieldCount;\n    }\n\n    void AddInstructionSet(CORINFO_InstructionSet instructionSet)\n    {\n        uint32_t index = GetFlagsFieldIndex(instructionSet);\n        _flags[index] |= GetRelativeBitMask(instructionSet);\n    }\n\n    void RemoveInstructionSet(CORINFO_InstructionSet instructionSet)\n    {\n        uint32_t index = GetFlagsFieldIndex(instructionSet);\n        uint64_t bitIndex = GetRelativeBitMask(instructionSet);\n        _flags[index] &= ~bitIndex;\n    }\n\n    bool HasInstructionSet(CORINFO_InstructionSet instructionSet) const\n    {\n        uint32_t index = GetFlagsFieldIndex(instructionSet);\n        uint64_t bitIndex = GetRelativeBitMask(instructionSet);\n        return ((_flags[index] & bitIndex) != 0);\n    }\n\n    bool Equals(CORINFO_InstructionSetFlags other) const\n    {\n        for (int i = 0; i < FlagsFieldCount; i++)\n        {\n            if (_flags[i] != other._flags[i])\n            {\n                return false;\n            }\n\n        }\n        return true;\n    }\n\n    void Add(CORINFO_InstructionSetFlags other)\n    {\n        for (int i = 0; i < FlagsFieldCount; i++)\n        {\n            _flags[i] |= other._flags[i];\n        }\n    }\n\n    bool IsEmpty() const\n    {\n        for (int i = 0; i < FlagsFieldCount; i++)\n        {\n            if (_flags[i] != 0)\n            {\n                return false;\n            }\n\n        }\n        return true;\n    }\n\n    void Reset()\n    {\n        for (int i = 0; i < FlagsFieldCount; i++)\n        {\n            _flags[i] = 0;\n        }\n    }\n\n    void Set64BitInstructionSetVariants()\n    {\n#ifdef TARGET_ARM64\n        if (HasInstructionSet(InstructionSet_ArmBase))\n            AddInstructionSet(InstructionSet_ArmBase_Arm64);\n        if (HasInstructionSet(InstructionSet_AdvSimd))\n            AddInstructionSet(InstructionSet_AdvSimd_Arm64);\n        if (HasInstructionSet(InstructionSet_Aes))\n            AddInstructionSet(InstructionSet_Aes_Arm64);\n        if (HasInstructionSet(InstructionSet_Crc32))\n            AddInstructionSet(InstructionSet_Crc32_Arm64);\n        if (HasInstructionSet(InstructionSet_Dp))\n            AddInstructionSet(InstructionSet_Dp_Arm64);\n        if (HasInstructionSet(InstructionSet_Rdm))\n            AddInstructionSet(InstructionSet_Rdm_Arm64);\n        if (HasInstructionSet(InstructionSet_Sha1))\n            AddInstructionSet(InstructionSet_Sha1_Arm64);\n        if (HasInstructionSet(InstructionSet_Sha256))\n            AddInstructionSet(InstructionSet_Sha256_Arm64);\n#endif // TARGET_ARM64\n#ifdef TARGET_AMD64\n        if (HasInstructionSet(InstructionSet_X86Base))\n            AddInstructionSet(InstructionSet_X86Base_X64);\n        if (HasInstructionSet(InstructionSet_SSE))\n            AddInstructionSet(InstructionSet_SSE_X64);\n        if (HasInstructionSet(InstructionSet_SSE2))\n            AddInstructionSet(InstructionSet_SSE2_X64);\n        if (HasInstructionSet(InstructionSet_SSE3))\n            AddInstructionSet(InstructionSet_SSE3_X64);\n        if (HasInstructionSet(InstructionSet_SSSE3))\n            AddInstructionSet(InstructionSet_SSSE3_X64);\n        if (HasInstructionSet(InstructionSet_SSE41))\n            AddInstructionSet(InstructionSet_SSE41_X64);\n        if (HasInstructionSet(InstructionSet_SSE42))\n            AddInstructionSet(InstructionSet_SSE42_X64);\n        if (HasInstructionSet(InstructionSet_AVX))\n            AddInstructionSet(InstructionSet_AVX_X64);\n        if (HasInstructionSet(InstructionSet_AVX2))\n            AddInstructionSet(InstructionSet_AVX2_X64);\n        if (HasInstructionSet(InstructionSet_AES))\n            AddInstructionSet(InstructionSet_AES_X64);\n        if (HasInstructionSet(InstructionSet_BMI1))\n            AddInstructionSet(InstructionSet_BMI1_X64);\n        if (HasInstructionSet(InstructionSet_BMI2))\n            AddInstructionSet(InstructionSet_BMI2_X64);\n        if (HasInstructionSet(InstructionSet_FMA))\n            AddInstructionSet(InstructionSet_FMA_X64);\n        if (HasInstructionSet(InstructionSet_LZCNT))\n            AddInstructionSet(InstructionSet_LZCNT_X64);\n        if (HasInstructionSet(InstructionSet_PCLMULQDQ))\n            AddInstructionSet(InstructionSet_PCLMULQDQ_X64);\n        if (HasInstructionSet(InstructionSet_POPCNT))\n            AddInstructionSet(InstructionSet_POPCNT_X64);\n        if (HasInstructionSet(InstructionSet_AVXVNNI))\n            AddInstructionSet(InstructionSet_AVXVNNI_X64);\n        if (HasInstructionSet(InstructionSet_MOVBE))\n            AddInstructionSet(InstructionSet_MOVBE_X64);\n        if (HasInstructionSet(InstructionSet_X86Serialize))\n            AddInstructionSet(InstructionSet_X86Serialize_X64);\n        if (HasInstructionSet(InstructionSet_AVX512F))\n            AddInstructionSet(InstructionSet_AVX512F_X64);\n        if (HasInstructionSet(InstructionSet_AVX512F_VL))\n            AddInstructionSet(InstructionSet_AVX512F_VL_X64);\n        if (HasInstructionSet(InstructionSet_AVX512BW))\n            AddInstructionSet(InstructionSet_AVX512BW_X64);\n        if (HasInstructionSet(InstructionSet_AVX512BW_VL))\n            AddInstructionSet(InstructionSet_AVX512BW_VL_X64);\n        if (HasInstructionSet(InstructionSet_AVX512CD))\n            AddInstructionSet(InstructionSet_AVX512CD_X64);\n        if (HasInstructionSet(InstructionSet_AVX512CD_VL))\n            AddInstructionSet(InstructionSet_AVX512CD_VL_X64);\n        if (HasInstructionSet(InstructionSet_AVX512DQ))\n            AddInstructionSet(InstructionSet_AVX512DQ_X64);\n        if (HasInstructionSet(InstructionSet_AVX512DQ_VL))\n            AddInstructionSet(InstructionSet_AVX512DQ_VL_X64);\n#endif // TARGET_AMD64\n#ifdef TARGET_X86\n#endif // TARGET_X86\n\n    }\n\n    uint64_t* GetFlagsRaw()\n    {\n        return _flags;\n    }\n};\n\ninline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_InstructionSetFlags input)\n{\n    CORINFO_InstructionSetFlags oldflags = input;\n    CORINFO_InstructionSetFlags resultflags = input;\n    do\n    {\n        oldflags = resultflags;\n#ifdef TARGET_ARM64\n        if (resultflags.HasInstructionSet(InstructionSet_ArmBase) && !resultflags.HasInstructionSet(InstructionSet_ArmBase_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_ArmBase);\n        if (resultflags.HasInstructionSet(InstructionSet_ArmBase_Arm64) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))\n            resultflags.RemoveInstructionSet(InstructionSet_ArmBase_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_AdvSimd) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_AdvSimd);\n        if (resultflags.HasInstructionSet(InstructionSet_AdvSimd_Arm64) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))\n            resultflags.RemoveInstructionSet(InstructionSet_AdvSimd_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_Aes) && !resultflags.HasInstructionSet(InstructionSet_Aes_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_Aes);\n        if (resultflags.HasInstructionSet(InstructionSet_Aes_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Aes))\n            resultflags.RemoveInstructionSet(InstructionSet_Aes_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_Crc32) && !resultflags.HasInstructionSet(InstructionSet_Crc32_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_Crc32);\n        if (resultflags.HasInstructionSet(InstructionSet_Crc32_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Crc32))\n            resultflags.RemoveInstructionSet(InstructionSet_Crc32_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_Dp) && !resultflags.HasInstructionSet(InstructionSet_Dp_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_Dp);\n        if (resultflags.HasInstructionSet(InstructionSet_Dp_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Dp))\n            resultflags.RemoveInstructionSet(InstructionSet_Dp_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_Rdm) && !resultflags.HasInstructionSet(InstructionSet_Rdm_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_Rdm);\n        if (resultflags.HasInstructionSet(InstructionSet_Rdm_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Rdm))\n            resultflags.RemoveInstructionSet(InstructionSet_Rdm_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_Sha1) && !resultflags.HasInstructionSet(InstructionSet_Sha1_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_Sha1);\n        if (resultflags.HasInstructionSet(InstructionSet_Sha1_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Sha1))\n            resultflags.RemoveInstructionSet(InstructionSet_Sha1_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_Sha256) && !resultflags.HasInstructionSet(InstructionSet_Sha256_Arm64))\n            resultflags.RemoveInstructionSet(InstructionSet_Sha256);\n        if (resultflags.HasInstructionSet(InstructionSet_Sha256_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Sha256))\n            resultflags.RemoveInstructionSet(InstructionSet_Sha256_Arm64);\n        if (resultflags.HasInstructionSet(InstructionSet_AdvSimd) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))\n            resultflags.RemoveInstructionSet(InstructionSet_AdvSimd);\n        if (resultflags.HasInstructionSet(InstructionSet_Aes) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))\n            resultflags.RemoveInstructionSet(InstructionSet_Aes);\n        if (resultflags.HasInstructionSet(InstructionSet_Crc32) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))\n            resultflags.RemoveInstructionSet(InstructionSet_Crc32);\n        if (resultflags.HasInstructionSet(InstructionSet_Dp) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))\n            resultflags.RemoveInstructionSet(InstructionSet_Dp);\n        if (resultflags.HasInstructionSet(InstructionSet_Rdm) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))\n            resultflags.RemoveInstructionSet(InstructionSet_Rdm);\n        if (resultflags.HasInstructionSet(InstructionSet_Sha1) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))\n            resultflags.RemoveInstructionSet(InstructionSet_Sha1);\n        if (resultflags.HasInstructionSet(InstructionSet_Sha256) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))\n            resultflags.RemoveInstructionSet(InstructionSet_Sha256);\n        if (resultflags.HasInstructionSet(InstructionSet_Vector64) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))\n            resultflags.RemoveInstructionSet(InstructionSet_Vector64);\n        if (resultflags.HasInstructionSet(InstructionSet_Vector128) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))\n            resultflags.RemoveInstructionSet(InstructionSet_Vector128);\n#endif // TARGET_ARM64\n#ifdef TARGET_AMD64\n        if (resultflags.HasInstructionSet(InstructionSet_X86Base) && !resultflags.HasInstructionSet(InstructionSet_X86Base_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_X86Base);\n        if (resultflags.HasInstructionSet(InstructionSet_X86Base_X64) && !resultflags.HasInstructionSet(InstructionSet_X86Base))\n            resultflags.RemoveInstructionSet(InstructionSet_X86Base_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE) && !resultflags.HasInstructionSet(InstructionSet_SSE_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE2) && !resultflags.HasInstructionSet(InstructionSet_SSE2_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE2);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE2_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE2))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE2_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE3_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE3);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE3_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE3))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE3_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_SSSE3) && !resultflags.HasInstructionSet(InstructionSet_SSSE3_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_SSSE3);\n        if (resultflags.HasInstructionSet(InstructionSet_SSSE3_X64) && !resultflags.HasInstructionSet(InstructionSet_SSSE3))\n            resultflags.RemoveInstructionSet(InstructionSet_SSSE3_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE41) && !resultflags.HasInstructionSet(InstructionSet_SSE41_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE41);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE41_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE41))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE41_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE42) && !resultflags.HasInstructionSet(InstructionSet_SSE42_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE42);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE42_X64) && !resultflags.HasInstructionSet(InstructionSet_SSE42))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE42_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX) && !resultflags.HasInstructionSet(InstructionSet_AVX_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX2) && !resultflags.HasInstructionSet(InstructionSet_AVX2_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX2);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX2_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX2))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX2_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AES) && !resultflags.HasInstructionSet(InstructionSet_AES_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AES);\n        if (resultflags.HasInstructionSet(InstructionSet_AES_X64) && !resultflags.HasInstructionSet(InstructionSet_AES))\n            resultflags.RemoveInstructionSet(InstructionSet_AES_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI1) && !resultflags.HasInstructionSet(InstructionSet_BMI1_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI1);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI1_X64) && !resultflags.HasInstructionSet(InstructionSet_BMI1))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI1_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI2) && !resultflags.HasInstructionSet(InstructionSet_BMI2_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI2);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI2_X64) && !resultflags.HasInstructionSet(InstructionSet_BMI2))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI2_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_FMA) && !resultflags.HasInstructionSet(InstructionSet_FMA_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_FMA);\n        if (resultflags.HasInstructionSet(InstructionSet_FMA_X64) && !resultflags.HasInstructionSet(InstructionSet_FMA))\n            resultflags.RemoveInstructionSet(InstructionSet_FMA_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_LZCNT) && !resultflags.HasInstructionSet(InstructionSet_LZCNT_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_LZCNT);\n        if (resultflags.HasInstructionSet(InstructionSet_LZCNT_X64) && !resultflags.HasInstructionSet(InstructionSet_LZCNT))\n            resultflags.RemoveInstructionSet(InstructionSet_LZCNT_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ) && !resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_PCLMULQDQ);\n        if (resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ_X64) && !resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ))\n            resultflags.RemoveInstructionSet(InstructionSet_PCLMULQDQ_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_POPCNT) && !resultflags.HasInstructionSet(InstructionSet_POPCNT_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_POPCNT);\n        if (resultflags.HasInstructionSet(InstructionSet_POPCNT_X64) && !resultflags.HasInstructionSet(InstructionSet_POPCNT))\n            resultflags.RemoveInstructionSet(InstructionSet_POPCNT_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVXVNNI) && !resultflags.HasInstructionSet(InstructionSet_AVXVNNI_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVXVNNI);\n        if (resultflags.HasInstructionSet(InstructionSet_AVXVNNI_X64) && !resultflags.HasInstructionSet(InstructionSet_AVXVNNI))\n            resultflags.RemoveInstructionSet(InstructionSet_AVXVNNI_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_MOVBE) && !resultflags.HasInstructionSet(InstructionSet_MOVBE_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_MOVBE);\n        if (resultflags.HasInstructionSet(InstructionSet_MOVBE_X64) && !resultflags.HasInstructionSet(InstructionSet_MOVBE))\n            resultflags.RemoveInstructionSet(InstructionSet_MOVBE_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_X86Serialize) && !resultflags.HasInstructionSet(InstructionSet_X86Serialize_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_X86Serialize);\n        if (resultflags.HasInstructionSet(InstructionSet_X86Serialize_X64) && !resultflags.HasInstructionSet(InstructionSet_X86Serialize))\n            resultflags.RemoveInstructionSet(InstructionSet_X86Serialize_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F_VL_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F_VL_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW_VL_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD_VL_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL_X64))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL_X64) && !resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ_VL_X64);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE) && !resultflags.HasInstructionSet(InstructionSet_X86Base))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE2) && !resultflags.HasInstructionSet(InstructionSet_SSE))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE2);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE2))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE3);\n        if (resultflags.HasInstructionSet(InstructionSet_SSSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE3))\n            resultflags.RemoveInstructionSet(InstructionSet_SSSE3);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE41) && !resultflags.HasInstructionSet(InstructionSet_SSSE3))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE41);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE42) && !resultflags.HasInstructionSet(InstructionSet_SSE41))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE42);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX) && !resultflags.HasInstructionSet(InstructionSet_SSE42))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX2) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX2);\n        if (resultflags.HasInstructionSet(InstructionSet_AES) && !resultflags.HasInstructionSet(InstructionSet_SSE2))\n            resultflags.RemoveInstructionSet(InstructionSet_AES);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI1) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI1);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI2) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI2);\n        if (resultflags.HasInstructionSet(InstructionSet_FMA) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_FMA);\n        if (resultflags.HasInstructionSet(InstructionSet_LZCNT) && !resultflags.HasInstructionSet(InstructionSet_X86Base))\n            resultflags.RemoveInstructionSet(InstructionSet_LZCNT);\n        if (resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ) && !resultflags.HasInstructionSet(InstructionSet_SSE2))\n            resultflags.RemoveInstructionSet(InstructionSet_PCLMULQDQ);\n        if (resultflags.HasInstructionSet(InstructionSet_POPCNT) && !resultflags.HasInstructionSet(InstructionSet_SSE42))\n            resultflags.RemoveInstructionSet(InstructionSet_POPCNT);\n        if (resultflags.HasInstructionSet(InstructionSet_Vector128) && !resultflags.HasInstructionSet(InstructionSet_SSE))\n            resultflags.RemoveInstructionSet(InstructionSet_Vector128);\n        if (resultflags.HasInstructionSet(InstructionSet_Vector256) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_Vector256);\n        if (resultflags.HasInstructionSet(InstructionSet_AVXVNNI) && !resultflags.HasInstructionSet(InstructionSet_AVX2))\n            resultflags.RemoveInstructionSet(InstructionSet_AVXVNNI);\n        if (resultflags.HasInstructionSet(InstructionSet_MOVBE) && !resultflags.HasInstructionSet(InstructionSet_SSE42))\n            resultflags.RemoveInstructionSet(InstructionSet_MOVBE);\n        if (resultflags.HasInstructionSet(InstructionSet_X86Serialize) && !resultflags.HasInstructionSet(InstructionSet_X86Base))\n            resultflags.RemoveInstructionSet(InstructionSet_X86Serialize);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F) && !resultflags.HasInstructionSet(InstructionSet_AVX2))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ_VL);\n#endif // TARGET_AMD64\n#ifdef TARGET_X86\n        if (resultflags.HasInstructionSet(InstructionSet_SSE) && !resultflags.HasInstructionSet(InstructionSet_X86Base))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE2) && !resultflags.HasInstructionSet(InstructionSet_SSE))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE2);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE2))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE3);\n        if (resultflags.HasInstructionSet(InstructionSet_SSSE3) && !resultflags.HasInstructionSet(InstructionSet_SSE3))\n            resultflags.RemoveInstructionSet(InstructionSet_SSSE3);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE41) && !resultflags.HasInstructionSet(InstructionSet_SSSE3))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE41);\n        if (resultflags.HasInstructionSet(InstructionSet_SSE42) && !resultflags.HasInstructionSet(InstructionSet_SSE41))\n            resultflags.RemoveInstructionSet(InstructionSet_SSE42);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX) && !resultflags.HasInstructionSet(InstructionSet_SSE42))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX2) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX2);\n        if (resultflags.HasInstructionSet(InstructionSet_AES) && !resultflags.HasInstructionSet(InstructionSet_SSE2))\n            resultflags.RemoveInstructionSet(InstructionSet_AES);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI1) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI1);\n        if (resultflags.HasInstructionSet(InstructionSet_BMI2) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_BMI2);\n        if (resultflags.HasInstructionSet(InstructionSet_FMA) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_FMA);\n        if (resultflags.HasInstructionSet(InstructionSet_LZCNT) && !resultflags.HasInstructionSet(InstructionSet_X86Base))\n            resultflags.RemoveInstructionSet(InstructionSet_LZCNT);\n        if (resultflags.HasInstructionSet(InstructionSet_PCLMULQDQ) && !resultflags.HasInstructionSet(InstructionSet_SSE2))\n            resultflags.RemoveInstructionSet(InstructionSet_PCLMULQDQ);\n        if (resultflags.HasInstructionSet(InstructionSet_POPCNT) && !resultflags.HasInstructionSet(InstructionSet_SSE42))\n            resultflags.RemoveInstructionSet(InstructionSet_POPCNT);\n        if (resultflags.HasInstructionSet(InstructionSet_Vector128) && !resultflags.HasInstructionSet(InstructionSet_SSE))\n            resultflags.RemoveInstructionSet(InstructionSet_Vector128);\n        if (resultflags.HasInstructionSet(InstructionSet_Vector256) && !resultflags.HasInstructionSet(InstructionSet_AVX))\n            resultflags.RemoveInstructionSet(InstructionSet_Vector256);\n        if (resultflags.HasInstructionSet(InstructionSet_AVXVNNI) && !resultflags.HasInstructionSet(InstructionSet_AVX2))\n            resultflags.RemoveInstructionSet(InstructionSet_AVXVNNI);\n        if (resultflags.HasInstructionSet(InstructionSet_MOVBE) && !resultflags.HasInstructionSet(InstructionSet_SSE42))\n            resultflags.RemoveInstructionSet(InstructionSet_MOVBE);\n        if (resultflags.HasInstructionSet(InstructionSet_X86Serialize) && !resultflags.HasInstructionSet(InstructionSet_X86Base))\n            resultflags.RemoveInstructionSet(InstructionSet_X86Serialize);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F) && !resultflags.HasInstructionSet(InstructionSet_AVX2))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512F_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512F_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512CD_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512CD_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512BW_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512BW_VL);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ) && !resultflags.HasInstructionSet(InstructionSet_AVX512F))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ);\n        if (resultflags.HasInstructionSet(InstructionSet_AVX512DQ_VL) && !resultflags.HasInstructionSet(InstructionSet_AVX512F_VL))\n            resultflags.RemoveInstructionSet(InstructionSet_AVX512DQ_VL);\n#endif // TARGET_X86\n\n    } while (!oldflags.Equals(resultflags));\n    return resultflags;\n}\n\ninline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet)\n{\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable: 4065) // disable warning for switch statement with only default label.\n#endif\n\n    switch (instructionSet)\n    {\n#ifdef TARGET_ARM64\n        case InstructionSet_ArmBase :\n            return \"ArmBase\";\n        case InstructionSet_ArmBase_Arm64 :\n            return \"ArmBase_Arm64\";\n        case InstructionSet_AdvSimd :\n            return \"AdvSimd\";\n        case InstructionSet_AdvSimd_Arm64 :\n            return \"AdvSimd_Arm64\";\n        case InstructionSet_Aes :\n            return \"Aes\";\n        case InstructionSet_Aes_Arm64 :\n            return \"Aes_Arm64\";\n        case InstructionSet_Crc32 :\n            return \"Crc32\";\n        case InstructionSet_Crc32_Arm64 :\n            return \"Crc32_Arm64\";\n        case InstructionSet_Dp :\n            return \"Dp\";\n        case InstructionSet_Dp_Arm64 :\n            return \"Dp_Arm64\";\n        case InstructionSet_Rdm :\n            return \"Rdm\";\n        case InstructionSet_Rdm_Arm64 :\n            return \"Rdm_Arm64\";\n        case InstructionSet_Sha1 :\n            return \"Sha1\";\n        case InstructionSet_Sha1_Arm64 :\n            return \"Sha1_Arm64\";\n        case InstructionSet_Sha256 :\n            return \"Sha256\";\n        case InstructionSet_Sha256_Arm64 :\n            return \"Sha256_Arm64\";\n        case InstructionSet_Atomics :\n            return \"Atomics\";\n        case InstructionSet_Vector64 :\n            return \"Vector64\";\n        case InstructionSet_Vector128 :\n            return \"Vector128\";\n        case InstructionSet_Dczva :\n            return \"Dczva\";\n        case InstructionSet_Rcpc :\n            return \"Rcpc\";\n#endif // TARGET_ARM64\n#ifdef TARGET_AMD64\n        case InstructionSet_X86Base :\n            return \"X86Base\";\n        case InstructionSet_X86Base_X64 :\n            return \"X86Base_X64\";\n        case InstructionSet_SSE :\n            return \"SSE\";\n        case InstructionSet_SSE_X64 :\n            return \"SSE_X64\";\n        case InstructionSet_SSE2 :\n            return \"SSE2\";\n        case InstructionSet_SSE2_X64 :\n            return \"SSE2_X64\";\n        case InstructionSet_SSE3 :\n            return \"SSE3\";\n        case InstructionSet_SSE3_X64 :\n            return \"SSE3_X64\";\n        case InstructionSet_SSSE3 :\n            return \"SSSE3\";\n        case InstructionSet_SSSE3_X64 :\n            return \"SSSE3_X64\";\n        case InstructionSet_SSE41 :\n            return \"SSE41\";\n        case InstructionSet_SSE41_X64 :\n            return \"SSE41_X64\";\n        case InstructionSet_SSE42 :\n            return \"SSE42\";\n        case InstructionSet_SSE42_X64 :\n            return \"SSE42_X64\";\n        case InstructionSet_AVX :\n            return \"AVX\";\n        case InstructionSet_AVX_X64 :\n            return \"AVX_X64\";\n        case InstructionSet_AVX2 :\n            return \"AVX2\";\n        case InstructionSet_AVX2_X64 :\n            return \"AVX2_X64\";\n        case InstructionSet_AES :\n            return \"AES\";\n        case InstructionSet_AES_X64 :\n            return \"AES_X64\";\n        case InstructionSet_BMI1 :\n            return \"BMI1\";\n        case InstructionSet_BMI1_X64 :\n            return \"BMI1_X64\";\n        case InstructionSet_BMI2 :\n            return \"BMI2\";\n        case InstructionSet_BMI2_X64 :\n            return \"BMI2_X64\";\n        case InstructionSet_FMA :\n            return \"FMA\";\n        case InstructionSet_FMA_X64 :\n            return \"FMA_X64\";\n        case InstructionSet_LZCNT :\n            return \"LZCNT\";\n        case InstructionSet_LZCNT_X64 :\n            return \"LZCNT_X64\";\n        case InstructionSet_PCLMULQDQ :\n            return \"PCLMULQDQ\";\n        case InstructionSet_PCLMULQDQ_X64 :\n            return \"PCLMULQDQ_X64\";\n        case InstructionSet_POPCNT :\n            return \"POPCNT\";\n        case InstructionSet_POPCNT_X64 :\n            return \"POPCNT_X64\";\n        case InstructionSet_Vector128 :\n            return \"Vector128\";\n        case InstructionSet_Vector256 :\n            return \"Vector256\";\n        case InstructionSet_AVXVNNI :\n            return \"AVXVNNI\";\n        case InstructionSet_AVXVNNI_X64 :\n            return \"AVXVNNI_X64\";\n        case InstructionSet_MOVBE :\n            return \"MOVBE\";\n        case InstructionSet_MOVBE_X64 :\n            return \"MOVBE_X64\";\n        case InstructionSet_X86Serialize :\n            return \"X86Serialize\";\n        case InstructionSet_X86Serialize_X64 :\n            return \"X86Serialize_X64\";\n        case InstructionSet_AVX512F :\n            return \"AVX512F\";\n        case InstructionSet_AVX512F_X64 :\n            return \"AVX512F_X64\";\n        case InstructionSet_AVX512F_VL :\n            return \"AVX512F_VL\";\n        case InstructionSet_AVX512F_VL_X64 :\n            return \"AVX512F_VL_X64\";\n        case InstructionSet_AVX512BW :\n            return \"AVX512BW\";\n        case InstructionSet_AVX512BW_X64 :\n            return \"AVX512BW_X64\";\n        case InstructionSet_AVX512BW_VL :\n            return \"AVX512BW_VL\";\n        case InstructionSet_AVX512BW_VL_X64 :\n            return \"AVX512BW_VL_X64\";\n        case InstructionSet_AVX512CD :\n            return \"AVX512CD\";\n        case InstructionSet_AVX512CD_X64 :\n            return \"AVX512CD_X64\";\n        case InstructionSet_AVX512CD_VL :\n            return \"AVX512CD_VL\";\n        case InstructionSet_AVX512CD_VL_X64 :\n            return \"AVX512CD_VL_X64\";\n        case InstructionSet_AVX512DQ :\n            return \"AVX512DQ\";\n        case InstructionSet_AVX512DQ_X64 :\n            return \"AVX512DQ_X64\";\n        case InstructionSet_AVX512DQ_VL :\n            return \"AVX512DQ_VL\";\n        case InstructionSet_AVX512DQ_VL_X64 :\n            return \"AVX512DQ_VL_X64\";\n#endif // TARGET_AMD64\n#ifdef TARGET_X86\n        case InstructionSet_X86Base :\n            return \"X86Base\";\n        case InstructionSet_SSE :\n            return \"SSE\";\n        case InstructionSet_SSE2 :\n            return \"SSE2\";\n        case InstructionSet_SSE3 :\n            return \"SSE3\";\n        case InstructionSet_SSSE3 :\n            return \"SSSE3\";\n        case InstructionSet_SSE41 :\n            return \"SSE41\";\n        case InstructionSet_SSE42 :\n            return \"SSE42\";\n        case InstructionSet_AVX :\n            return \"AVX\";\n        case InstructionSet_AVX2 :\n            return \"AVX2\";\n        case InstructionSet_AES :\n            return \"AES\";\n        case InstructionSet_BMI1 :\n            return \"BMI1\";\n        case InstructionSet_BMI2 :\n            return \"BMI2\";\n        case InstructionSet_FMA :\n            return \"FMA\";\n        case InstructionSet_LZCNT :\n            return \"LZCNT\";\n        case InstructionSet_PCLMULQDQ :\n            return \"PCLMULQDQ\";\n        case InstructionSet_POPCNT :\n            return \"POPCNT\";\n        case InstructionSet_Vector128 :\n            return \"Vector128\";\n        case InstructionSet_Vector256 :\n            return \"Vector256\";\n        case InstructionSet_AVXVNNI :\n            return \"AVXVNNI\";\n        case InstructionSet_MOVBE :\n            return \"MOVBE\";\n        case InstructionSet_X86Serialize :\n            return \"X86Serialize\";\n        case InstructionSet_AVX512F :\n            return \"AVX512F\";\n        case InstructionSet_AVX512F_VL :\n            return \"AVX512F_VL\";\n        case InstructionSet_AVX512BW :\n            return \"AVX512BW\";\n        case InstructionSet_AVX512BW_VL :\n            return \"AVX512BW_VL\";\n        case InstructionSet_AVX512CD :\n            return \"AVX512CD\";\n        case InstructionSet_AVX512CD_VL :\n            return \"AVX512CD_VL\";\n        case InstructionSet_AVX512DQ :\n            return \"AVX512DQ\";\n        case InstructionSet_AVX512DQ_VL :\n            return \"AVX512DQ_VL\";\n#endif // TARGET_X86\n\n        default:\n            return \"UnknownInstructionSet\";\n    }\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n}\n\ninline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInstructionSet r2rSet)\n{\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable: 4065) // disable warning for switch statement with only default label.\n#endif\n\n    switch (r2rSet)\n    {\n#ifdef TARGET_ARM64\n        case READYTORUN_INSTRUCTION_ArmBase: return InstructionSet_ArmBase;\n        case READYTORUN_INSTRUCTION_AdvSimd: return InstructionSet_AdvSimd;\n        case READYTORUN_INSTRUCTION_Aes: return InstructionSet_Aes;\n        case READYTORUN_INSTRUCTION_Crc32: return InstructionSet_Crc32;\n        case READYTORUN_INSTRUCTION_Dp: return InstructionSet_Dp;\n        case READYTORUN_INSTRUCTION_Rdm: return InstructionSet_Rdm;\n        case READYTORUN_INSTRUCTION_Sha1: return InstructionSet_Sha1;\n        case READYTORUN_INSTRUCTION_Sha256: return InstructionSet_Sha256;\n        case READYTORUN_INSTRUCTION_Atomics: return InstructionSet_Atomics;\n        case READYTORUN_INSTRUCTION_Rcpc: return InstructionSet_Rcpc;\n#endif // TARGET_ARM64\n#ifdef TARGET_AMD64\n        case READYTORUN_INSTRUCTION_X86Base: return InstructionSet_X86Base;\n        case READYTORUN_INSTRUCTION_Sse: return InstructionSet_SSE;\n        case READYTORUN_INSTRUCTION_Sse2: return InstructionSet_SSE2;\n        case READYTORUN_INSTRUCTION_Sse3: return InstructionSet_SSE3;\n        case READYTORUN_INSTRUCTION_Ssse3: return InstructionSet_SSSE3;\n        case READYTORUN_INSTRUCTION_Sse41: return InstructionSet_SSE41;\n        case READYTORUN_INSTRUCTION_Sse42: return InstructionSet_SSE42;\n        case READYTORUN_INSTRUCTION_Avx: return InstructionSet_AVX;\n        case READYTORUN_INSTRUCTION_Avx2: return InstructionSet_AVX2;\n        case READYTORUN_INSTRUCTION_Aes: return InstructionSet_AES;\n        case READYTORUN_INSTRUCTION_Bmi1: return InstructionSet_BMI1;\n        case READYTORUN_INSTRUCTION_Bmi2: return InstructionSet_BMI2;\n        case READYTORUN_INSTRUCTION_Fma: return InstructionSet_FMA;\n        case READYTORUN_INSTRUCTION_Lzcnt: return InstructionSet_LZCNT;\n        case READYTORUN_INSTRUCTION_Pclmulqdq: return InstructionSet_PCLMULQDQ;\n        case READYTORUN_INSTRUCTION_Popcnt: return InstructionSet_POPCNT;\n        case READYTORUN_INSTRUCTION_AvxVnni: return InstructionSet_AVXVNNI;\n        case READYTORUN_INSTRUCTION_Movbe: return InstructionSet_MOVBE;\n        case READYTORUN_INSTRUCTION_X86Serialize: return InstructionSet_X86Serialize;\n        case READYTORUN_INSTRUCTION_Avx512F: return InstructionSet_AVX512F;\n        case READYTORUN_INSTRUCTION_Avx512F_VL: return InstructionSet_AVX512F_VL;\n        case READYTORUN_INSTRUCTION_Avx512BW: return InstructionSet_AVX512BW;\n        case READYTORUN_INSTRUCTION_Avx512BW_VL: return InstructionSet_AVX512BW_VL;\n        case READYTORUN_INSTRUCTION_Avx512CD: return InstructionSet_AVX512CD;\n        case READYTORUN_INSTRUCTION_Avx512CD_VL: return InstructionSet_AVX512CD_VL;\n        case READYTORUN_INSTRUCTION_Avx512DQ: return InstructionSet_AVX512DQ;\n        case READYTORUN_INSTRUCTION_Avx512DQ_VL: return InstructionSet_AVX512DQ_VL;\n#endif // TARGET_AMD64\n#ifdef TARGET_X86\n        case READYTORUN_INSTRUCTION_X86Base: return InstructionSet_X86Base;\n        case READYTORUN_INSTRUCTION_Sse: return InstructionSet_SSE;\n        case READYTORUN_INSTRUCTION_Sse2: return InstructionSet_SSE2;\n        case READYTORUN_INSTRUCTION_Sse3: return InstructionSet_SSE3;\n        case READYTORUN_INSTRUCTION_Ssse3: return InstructionSet_SSSE3;\n        case READYTORUN_INSTRUCTION_Sse41: return InstructionSet_SSE41;\n        case READYTORUN_INSTRUCTION_Sse42: return InstructionSet_SSE42;\n        case READYTORUN_INSTRUCTION_Avx: return InstructionSet_AVX;\n        case READYTORUN_INSTRUCTION_Avx2: return InstructionSet_AVX2;\n        case READYTORUN_INSTRUCTION_Aes: return InstructionSet_AES;\n        case READYTORUN_INSTRUCTION_Bmi1: return InstructionSet_BMI1;\n        case READYTORUN_INSTRUCTION_Bmi2: return InstructionSet_BMI2;\n        case READYTORUN_INSTRUCTION_Fma: return InstructionSet_FMA;\n        case READYTORUN_INSTRUCTION_Lzcnt: return InstructionSet_LZCNT;\n        case READYTORUN_INSTRUCTION_Pclmulqdq: return InstructionSet_PCLMULQDQ;\n        case READYTORUN_INSTRUCTION_Popcnt: return InstructionSet_POPCNT;\n        case READYTORUN_INSTRUCTION_AvxVnni: return InstructionSet_AVXVNNI;\n        case READYTORUN_INSTRUCTION_Movbe: return InstructionSet_MOVBE;\n        case READYTORUN_INSTRUCTION_X86Serialize: return InstructionSet_X86Serialize;\n        case READYTORUN_INSTRUCTION_Avx512F: return InstructionSet_AVX512F;\n        case READYTORUN_INSTRUCTION_Avx512F_VL: return InstructionSet_AVX512F_VL;\n        case READYTORUN_INSTRUCTION_Avx512BW: return InstructionSet_AVX512BW;\n        case READYTORUN_INSTRUCTION_Avx512BW_VL: return InstructionSet_AVX512BW_VL;\n        case READYTORUN_INSTRUCTION_Avx512CD: return InstructionSet_AVX512CD;\n        case READYTORUN_INSTRUCTION_Avx512CD_VL: return InstructionSet_AVX512CD_VL;\n        case READYTORUN_INSTRUCTION_Avx512DQ: return InstructionSet_AVX512DQ;\n        case READYTORUN_INSTRUCTION_Avx512DQ_VL: return InstructionSet_AVX512DQ_VL;\n#endif // TARGET_X86\n\n        default:\n            return InstructionSet_ILLEGAL;\n    }\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n}\n\n#endif // CORINFOINSTRUCTIONSET_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corjit.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\\\n*                                                                             *\n* CorJit.h -    EE / JIT interface                                            *\n*                                                                             *\n*               Version 1.0                                                   *\n*******************************************************************************\n*                                                                             *\n*                                                                     *\n*                                                                             *\n\\*****************************************************************************/\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n// The JIT/EE interface is versioned. By \"interface\", we mean any and all communication between the\n// JIT and the EE. Any time a change is made to the interface, the JIT/EE interface version identifier\n// must be updated. See code:JITEEVersionIdentifier for more information.\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n#ifndef _COR_JIT_H_\n#define _COR_JIT_H_\n\n#include \"corinfo.h\"\n\n#include <stdarg.h>\n\n#include \"corjitflags.h\"\n\n\n#ifndef MAKE_HRESULT\n// If this header is included without including the windows or PAL headers, then define\n// MAKE_HRESULT, and associated macros\n\n/******************* HRESULT types ****************************************/\n\n#define FACILITY_WINDOWS                 8\n#define FACILITY_URT                     19\n#define FACILITY_UMI                     22\n#define FACILITY_SXS                     23\n#define FACILITY_STORAGE                 3\n#define FACILITY_SSPI                    9\n#define FACILITY_SCARD                   16\n#define FACILITY_SETUPAPI                15\n#define FACILITY_SECURITY                9\n#define FACILITY_RPC                     1\n#define FACILITY_WIN32                   7\n#define FACILITY_CONTROL                 10\n#define FACILITY_NULL                    0\n#define FACILITY_MSMQ                    14\n#define FACILITY_MEDIASERVER             13\n#define FACILITY_INTERNET                12\n#define FACILITY_ITF                     4\n#define FACILITY_DPLAY                   21\n#define FACILITY_DISPATCH                2\n#define FACILITY_COMPLUS                 17\n#define FACILITY_CERT                    11\n#define FACILITY_ACS                     20\n#define FACILITY_AAF                     18\n\n#define NO_ERROR 0L\n\n#define SEVERITY_SUCCESS    0\n#define SEVERITY_ERROR      1\n\n#define SUCCEEDED(Status) ((JITINTERFACE_HRESULT)(Status) >= 0)\n#define FAILED(Status) ((JITINTERFACE_HRESULT)(Status)<0)\n#define IS_ERROR(Status) ((uint32_t)(Status) >> 31 == SEVERITY_ERROR) // diff from win32\n#define HRESULT_CODE(hr)    ((hr) & 0xFFFF)\n#define SCODE_CODE(sc)      ((sc) & 0xFFFF)\n#define HRESULT_FACILITY(hr)  (((hr) >> 16) & 0x1fff)\n#define SCODE_FACILITY(sc)    (((sc) >> 16) & 0x1fff)\n#define HRESULT_SEVERITY(hr)  (((hr) >> 31) & 0x1)\n#define SCODE_SEVERITY(sc)    (((sc) >> 31) & 0x1)\n\n// both macros diff from Win32\n#define MAKE_HRESULT(sev,fac,code) \\\n    ((JITINTERFACE_HRESULT) (((uint32_t)(sev)<<31) | ((uint32_t)(fac)<<16) | ((uint32_t)(code))) )\n#define MAKE_SCODE(sev,fac,code) \\\n    ((SCODE) (((uint32_t)(sev)<<31) | ((uint32_t)(fac)<<16) | ((LONG)(code))) )\n\n#define FACILITY_NT_BIT                 0x10000000\n#define HRESULT_FROM_WIN32(x) ((JITINTERFACE_HRESULT)(x) <= 0 ? ((JITINTERFACE_HRESULT)(x)) : ((JITINTERFACE_HRESULT) (((x) & 0x0000FFFF) | (FACILITY_WIN32 << 16) | 0x80000000)))\n#define __HRESULT_FROM_WIN32(x) HRESULT_FROM_WIN32(x)\n\n#define HRESULT_FROM_NT(x)      ((JITINTERFACE_HRESULT) ((x) | FACILITY_NT_BIT))\n#endif // MAKE_HRESULT\n\n/*****************************************************************************/\n    // These are error codes returned by CompileMethod\nenum CorJitResult\n{\n    // Note that I dont use FACILITY_NULL for the facility number,\n    // we may want to get a 'real' facility number\n    CORJIT_OK            =     NO_ERROR,\n    CORJIT_BADCODE       =     MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 1),\n    CORJIT_OUTOFMEM      =     MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 2),\n    CORJIT_INTERNALERROR =     MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 3),\n    CORJIT_SKIPPED       =     MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 4),\n    CORJIT_RECOVERABLEERROR =  MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 5),\n    CORJIT_IMPLLIMITATION=     MAKE_HRESULT(SEVERITY_ERROR,FACILITY_NULL, 6),\n};\n\n/*****************************************************************************/\n// These are flags passed to ICorJitInfo::allocMem\n// to guide the memory allocation for the code, readonly data, and read-write data\nenum CorJitAllocMemFlag\n{\n    CORJIT_ALLOCMEM_DEFAULT_CODE_ALIGN = 0x00000000, // The code will use the normal alignment\n    CORJIT_ALLOCMEM_FLG_16BYTE_ALIGN   = 0x00000001, // The code will be 16-byte aligned\n    CORJIT_ALLOCMEM_FLG_RODATA_16BYTE_ALIGN = 0x00000002, // The read-only data will be 16-byte aligned\n    CORJIT_ALLOCMEM_FLG_32BYTE_ALIGN   = 0x00000004, // The code will be 32-byte aligned\n    CORJIT_ALLOCMEM_FLG_RODATA_32BYTE_ALIGN = 0x00000008, // The read-only data will be 32-byte aligned\n};\n\ninline CorJitAllocMemFlag operator |(CorJitAllocMemFlag a, CorJitAllocMemFlag b)\n{\n    return static_cast<CorJitAllocMemFlag>(static_cast<int>(a) | static_cast<int>(b));\n}\n\nenum CorJitFuncKind\n{\n    CORJIT_FUNC_ROOT,          // The main/root function (always id==0)\n    CORJIT_FUNC_HANDLER,       // a funclet associated with an EH handler (finally, fault, catch, filter handler)\n    CORJIT_FUNC_FILTER         // a funclet associated with an EH filter\n};\n\n// We have a performance-investigation mode (defined by the FEATURE_USE_ASM_GC_WRITE_BARRIERS and\n// FEATURE_COUNT_GC_WRITE_BARRIER preprocessor symbols) in which the JIT adds an argument of this\n// enumeration to checked write barrier calls in order to classify them.\nenum CheckedWriteBarrierKinds {\n    CWBKind_Unclassified,    // Not one of the ones below.\n    CWBKind_RetBuf,          // Store through a return buffer pointer argument.\n    CWBKind_ByRefArg,        // Store through a by-ref argument (not an implicit return buffer).\n    CWBKind_OtherByRefLocal, // Store through a by-ref local variable.\n    CWBKind_AddrOfLocal,     // Store through the address of a local (arguably a bug that this happens at all).\n};\n\nstruct AllocMemArgs\n{\n    // Input arguments\n    uint32_t hotCodeSize;\n    uint32_t coldCodeSize;\n    uint32_t roDataSize;\n    uint32_t xcptnsCount;\n    CorJitAllocMemFlag flag;\n\n    // Output arguments\n    void* hotCodeBlock;\n    void* hotCodeBlockRW;\n    void* coldCodeBlock;\n    void* coldCodeBlockRW;\n    void* roDataBlock;\n    void* roDataBlockRW;\n};\n\n#include \"corjithost.h\"\n\nextern \"C\" void jitStartup(ICorJitHost* host);\n\nclass ICorJitCompiler;\nclass ICorJitInfo;\n\nextern \"C\" ICorJitCompiler* getJit();\n\n// #EEToJitInterface\n// ICorJitCompiler is the interface that the EE uses to get IL bytecode converted to native code. Note that\n// to accomplish this the JIT has to call back to the EE to get symbolic information.  The code:ICorJitInfo\n// type passed as 'comp' to compileMethod is the mechanism to get this information.  This is often the more\n// interesting interface.\n//\n//\nclass ICorJitCompiler\n{\npublic:\n    // compileMethod is the main routine to ask the JIT Compiler to create native code for a method. The\n    // method to be compiled is passed in the 'info' parameter, and the code:ICorJitInfo is used to allow the\n    // JIT to resolve tokens, and make any other callbacks needed to create the code. nativeEntry, and\n    // nativeSizeOfCode are just for convenience because the JIT asks the EE for the memory to emit code into\n    // (see code:ICorJitInfo.allocMem), so really the EE already knows where the method starts and how big\n    // it is (in fact, it could be in more than one chunk).\n    //\n    // * In the 32 bit jit this is implemented by code:CILJit.compileMethod\n    // * For the 64 bit jit this is implemented by code:PreJit.compileMethod\n    // Note: setTargetOS must be called before this api is used.\n    virtual CorJitResult compileMethod (\n            ICorJitInfo                 *comp,               /* IN */\n            struct CORINFO_METHOD_INFO  *info,               /* IN */\n            unsigned /* code:CorJitFlag */   flags,          /* IN */\n            uint8_t                        **nativeEntry,       /* OUT */\n            uint32_t                       *nativeSizeOfCode    /* OUT */\n            ) = 0;\n\n    // Do any appropriate work at process shutdown.  Default impl is to do nothing.\n    virtual void ProcessShutdownWork(ICorStaticInfo* info) {};\n\n    // The EE asks the JIT for a \"version identifier\". This represents the version of the JIT/EE interface.\n    // If the JIT doesn't implement the same JIT/EE interface expected by the EE (because the JIT doesn't\n    // return the version identifier that the EE expects), then the EE fails to load the JIT.\n    //\n    virtual void getVersionIdentifier(\n            GUID*   versionIdentifier   /* OUT */\n            ) = 0;\n\n    // When the EE loads the System.Numerics.Vectors assembly, it asks the JIT what length (in bytes) of\n    // SIMD vector it supports as an intrinsic type.  Zero means that the JIT does not support SIMD\n    // intrinsics, so the EE should use the default size (i.e. the size of the IL implementation).\n    virtual unsigned getMaxIntrinsicSIMDVectorLength(CORJIT_FLAGS cpuCompileFlags) { return 0; }\n\n    // Some JIT's may support multiple OSs. This api provides a means to specify to the JIT what OS it should\n    // be trying to compile. This api does not produce any errors, any errors are to be generated by the\n    // the compileMethod call, which will call back into the VM to ensure bits are correctly setup.\n    //\n    // Note: this api MUST be called before the compileMethod is called for the first time in the process.\n    virtual void setTargetOS(CORINFO_OS os) = 0;\n};\n\n//------------------------------------------------------------------------------------------\n// #JitToEEInterface\n//\n// ICorJitInfo is the main interface that the JIT uses to call back to the EE and get information. It is\n// the companion to code:ICorJitCompiler#EEToJitInterface. The concrete implementation of this in the\n// runtime is the code:CEEJitInfo type.  There is also a version of this for the NGEN case.\n//\n// See code:ICorMethodInfo#EEJitContractDetails for subtle conventions used by this interface.\n//\n// There is more information on the JIT in the book of the runtime entry\n// http://devdiv/sites/CLR/Product%20Documentation/2.0/BookOfTheRuntime/JIT/JIT%20Design.doc\n//\nclass ICorJitInfo : public ICorDynamicInfo\n{\npublic:\n    // get a block of memory for the code, readonly data, and read-write data\n    virtual void allocMem (\n            AllocMemArgs *pArgs\n            ) = 0;\n\n    // Reserve memory for the method/funclet's unwind information.\n    // Note that this must be called before allocMem. It should be\n    // called once for the main method, once for every funclet, and\n    // once for every block of cold code for which allocUnwindInfo\n    // will be called.\n    //\n    // This is necessary because jitted code must allocate all the\n    // memory needed for the unwindInfo at the allocMem call.\n    // For prejitted code we split up the unwinding information into\n    // separate sections .rdata and .pdata.\n    //\n    virtual void reserveUnwindInfo (\n            bool                isFunclet,             /* IN */\n            bool                isColdCode,            /* IN */\n            uint32_t               unwindSize             /* IN */\n            ) = 0;\n\n    // Allocate and initialize the .rdata and .pdata for this method or\n    // funclet, and get the block of memory needed for the machine-specific\n    // unwind information (the info for crawling the stack frame).\n    // Note that allocMem must be called first.\n    //\n    // Parameters:\n    //\n    //    pHotCode        main method code buffer, always filled in\n    //    pColdCode       cold code buffer, only filled in if this is cold code,\n    //                      null otherwise\n    //    startOffset     start of code block, relative to appropriate code buffer\n    //                      (e.g. pColdCode if cold, pHotCode if hot).\n    //    endOffset       end of code block, relative to appropriate code buffer\n    //    unwindSize      size of unwind info pointed to by pUnwindBlock\n    //    pUnwindBlock    pointer to unwind info\n    //    funcKind        type of funclet (main method code, handler, filter)\n    //\n    virtual void allocUnwindInfo (\n            uint8_t *              pHotCode,              /* IN */\n            uint8_t *              pColdCode,             /* IN */\n            uint32_t               startOffset,           /* IN */\n            uint32_t               endOffset,             /* IN */\n            uint32_t               unwindSize,            /* IN */\n            uint8_t *              pUnwindBlock,          /* IN */\n            CorJitFuncKind      funcKind               /* IN */\n            ) = 0;\n\n        // Get a block of memory needed for the code manager information,\n        // (the info for enumerating the GC pointers while crawling the\n        // stack frame).\n        // Note that allocMem must be called first\n    virtual void * allocGCInfo (\n            size_t                  size        /* IN */\n            ) = 0;\n\n    // Indicate how many exception handler blocks are to be returned.\n    // This is guaranteed to be called before any 'setEHinfo' call.\n    // Note that allocMem must be called before this method can be called.\n    virtual void setEHcount (\n            unsigned                cEH          /* IN */\n            ) = 0;\n\n    // Set the values for one particular exception handler block.\n    //\n    // Handler regions should be lexically contiguous.\n    // This is because FinallyIsUnwinding() uses lexicality to\n    // determine if a \"finally\" clause is executing.\n    virtual void setEHinfo (\n            unsigned                 EHnumber,   /* IN  */\n            const CORINFO_EH_CLAUSE *clause      /* IN */\n            ) = 0;\n\n    // Level -> fatalError, Level 2 -> Error, Level 3 -> Warning\n    // Level 4 means happens 10 times in a run, level 5 means 100, level 6 means 1000 ...\n    // returns non-zero if the logging succeeded\n    virtual bool logMsg(unsigned level, const char* fmt, va_list args) = 0;\n\n    // do an assert.  will return true if the code should retry (DebugBreak)\n    // returns false, if the assert should be ignored.\n    virtual int doAssert(const char* szFile, int iLine, const char* szExpr) = 0;\n\n    virtual void reportFatalError(CorJitResult result) = 0;\n\n    struct BlockCounts  // Also defined by:  CORBBTPROF_BLOCK_DATA\n    {\n        uint32_t ILOffset;\n        uint32_t ExecutionCount;\n    };\n\n\n    // Data structure for a single class probe using 32-bit count.\n    //\n    // CLASS_FLAG, INTERFACE_FLAG and DELEGATE_FLAG are placed into the Other field in the schema.\n    // If CLASS_FLAG is set the handle table consists of type handles, and otherwise method handles.\n    //\n    // Count is the number of times a call was made at that call site.\n    //\n    // SIZE is the number of entries in the table.\n    //\n    // SAMPLE_INTERVAL must be >= SIZE. SAMPLE_INTERVAL / SIZE\n    // gives the average number of calls between table updates.\n    // \n    struct HandleHistogram32\n    {\n        enum\n        {\n            SIZE = 8,\n            SAMPLE_INTERVAL = 32,\n            CLASS_FLAG     = 0x80000000,\n            INTERFACE_FLAG = 0x40000000,\n            DELEGATE_FLAG  = 0x20000000,\n            OFFSET_MASK    = 0x0FFFFFFF\n        };\n\n        uint32_t Count;\n        void* HandleTable[SIZE];\n    };\n\n    struct HandleHistogram64\n    {\n        uint64_t Count;\n        void* HandleTable[HandleHistogram32::SIZE];\n    };\n\n    enum class PgoInstrumentationKind\n    {\n        // This must be kept in sync with PgoInstrumentationKind in PgoFormat.cs\n\n        // Schema data types\n        None = 0,\n        FourByte = 1,\n        EightByte = 2,\n        TypeHandle = 3,\n        MethodHandle = 4,\n\n        // Mask of all schema data types\n        MarshalMask = 0xF,\n\n        // ExcessAlignment\n        Align4Byte = 0x10,\n        Align8Byte = 0x20,\n        AlignPointer = 0x30,\n\n        // Mask of all schema alignment types\n        AlignMask = 0x30,\n\n        DescriptorMin = 0x40,\n\n        Done = None, // All instrumentation schemas must end with a record which is \"Done\"\n        BasicBlockIntCount = (DescriptorMin * 1) | FourByte, // basic block counter using unsigned 4 byte int\n        BasicBlockLongCount = (DescriptorMin * 1) | EightByte, // basic block counter using unsigned 8 byte int\n        HandleHistogramIntCount = (DescriptorMin * 2) | FourByte | AlignPointer, // 4 byte counter that is part of a type histogram. Aligned to match HandleHistogram32's alignment.\n        HandleHistogramLongCount = (DescriptorMin * 2) | EightByte, // 8 byte counter that is part of a type histogram\n        HandleHistogramTypes = (DescriptorMin * 3) | TypeHandle, // Histogram of type handles\n        HandleHistogramMethods = (DescriptorMin * 3) | MethodHandle, // Histogram of method handles\n        Version = (DescriptorMin * 4) | None, // Version is encoded in the Other field of the schema\n        NumRuns = (DescriptorMin * 5) | None, // Number of runs is encoded in the Other field of the schema\n        EdgeIntCount = (DescriptorMin * 6) | FourByte, // edge counter using unsigned 4 byte int\n        EdgeLongCount = (DescriptorMin * 6) | EightByte, // edge counter using unsigned 8 byte int\n        GetLikelyClass = (DescriptorMin * 7) | TypeHandle, // Compressed get likely class data\n        GetLikelyMethod = (DescriptorMin * 7) | MethodHandle, // Compressed get likely method data\n    };\n\n    struct PgoInstrumentationSchema\n    {\n        size_t Offset;\n        PgoInstrumentationKind InstrumentationKind;\n        int32_t ILOffset;\n        int32_t Count;\n        int32_t Other;\n    };\n\n    enum class PgoSource\n    {\n        Unknown = 0,    // PGO data source unknown\n        Static = 1,     // PGO data comes from embedded R2R profile data\n        Dynamic = 2,    // PGO data comes from current run\n        Blend = 3,      // PGO data comes from blend of prior runs and current run\n        Text = 4,       // PGO data comes from text file\n        IBC = 5,        // PGO data from classic IBC\n        Sampling= 6,    // PGO data derived from sampling\n    };\n\n#define DEFAULT_UNKNOWN_HANDLE 1\n#define UNKNOWN_HANDLE_MIN 1\n#define UNKNOWN_HANDLE_MAX 33\n\n    static inline bool IsUnknownHandle(intptr_t handle)\n    {\n        return ((handle >= UNKNOWN_HANDLE_MIN) && (handle <= UNKNOWN_HANDLE_MAX));\n    }\n\n    // get profile information to be used for optimizing a current method.  The format\n    // of the buffer is the same as the format the JIT passes to allocPgoInstrumentationBySchema.\n    virtual JITINTERFACE_HRESULT getPgoInstrumentationResults(\n            CORINFO_METHOD_HANDLE      ftnHnd,\n            PgoInstrumentationSchema **pSchema,                    // OUT: pointer to the schema table (array) which describes the instrumentation results\n                                                                   // (pointer will not remain valid after jit completes).\n            uint32_t *                 pCountSchemaItems,          // OUT: pointer to the count of schema items in `pSchema` array.\n            uint8_t **                 pInstrumentationData,       // OUT: `*pInstrumentationData` is set to the address of the instrumentation data\n                                                                   // (pointer will not remain valid after jit completes).\n            PgoSource *                pPgoSource                  // OUT: value describing source of pgo data\n            ) = 0;\n\n    // Allocate a profile buffer for use in the current process\n    // The JIT shall call this api with the schema entries other than Offset filled in.\n    // The VM is responsible for allocating the buffer, and computing the various offsets\n    // The offset calculation shall obey the following rules\n    //  1. All data fields shall be naturally aligned.\n    //  2. The first offset may be arbitrarily large.\n    //  3. The JIT may mark a schema item with an alignment flag. This may be used to increase the alignment of a field.\n    //  4. Each data entry shall be laid out without extra padding.\n    //\n    //  The intention here is that it becomes possible to describe a C data structure with the alignment for ease of use with\n    //  instrumentation helper functions\n    virtual JITINTERFACE_HRESULT allocPgoInstrumentationBySchema(\n            CORINFO_METHOD_HANDLE     ftnHnd,\n            PgoInstrumentationSchema *pSchema,                     // IN OUT: pointer to the schema table (array) which describes the instrumentation results. `Offset` field\n                                                                   // is filled in by VM; other fields are set and passed in by caller.\n            uint32_t                  countSchemaItems,            // IN: count of schema items in `pSchema` array.\n            uint8_t **                pInstrumentationData         // OUT: `*pInstrumentationData` is set to the address of the instrumentation data.\n            ) = 0;\n\n    // Associates a native call site, identified by its offset in the native code stream, with\n    // the signature information and method handle the JIT used to lay out the call site. If\n    // the call site has no signature information (e.g. a helper call) or has no method handle\n    // (e.g. a CALLI P/Invoke), then null should be passed instead.\n    virtual void recordCallSite(\n            uint32_t                 instrOffset,  /* IN */\n            CORINFO_SIG_INFO *    callSig,      /* IN */\n            CORINFO_METHOD_HANDLE methodHandle  /* IN */\n            ) = 0;\n\n    // A relocation is recorded if we are pre-jitting.\n    // A jump thunk may be inserted if we are jitting\n    virtual void recordRelocation(\n            void *                 location,   /* IN  */\n            void *                 locationRW, /* IN  */\n            void *                 target,     /* IN  */\n            uint16_t                   fRelocType, /* IN  */\n            uint16_t                   slotNum = 0,  /* IN  */\n            int32_t                  addlDelta = 0 /* IN  */\n            ) = 0;\n\n    virtual uint16_t getRelocTypeHint(void * target) = 0;\n\n    // For what machine does the VM expect the JIT to generate code? The VM\n    // returns one of the IMAGE_FILE_MACHINE_* values. Note that if the VM\n    // is cross-compiling (such as the case for crossgen), it will return a\n    // different value than if it was compiling for the host architecture.\n    //\n    virtual uint32_t getExpectedTargetArchitecture() = 0;\n\n    // Fetches extended flags for a particular compilation instance. Returns\n    // the number of bytes written to the provided buffer.\n    virtual uint32_t getJitFlags(\n        CORJIT_FLAGS* flags,       /* IN: Points to a buffer that will hold the extended flags. */\n        uint32_t        sizeInBytes   /* IN: The size of the buffer. Note that this is effectively a\n                                          version number for the CORJIT_FLAGS value. */\n        ) = 0;\n};\n\n/**********************************************************************************/\n#endif // _COR_CORJIT_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corjitflags.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n// The JIT/EE interface is versioned. By \"interface\", we mean mean any and all communication between the\n// JIT and the EE. Any time a change is made to the interface, the JIT/EE interface version identifier\n// must be updated. See code:JITEEVersionIdentifier for more information.\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n#ifndef _COR_JIT_FLAGS_H_\n#define _COR_JIT_FLAGS_H_\n\n#include \"corinfoinstructionset.h\"\n\nclass CORJIT_FLAGS\n{\npublic:\n\n    enum CorJitFlag\n    {\n        CORJIT_FLAG_CALL_GETJITFLAGS        = 0xffffffff, // Indicates that the JIT should retrieve flags in the form of a\n                                                          // pointer to a CORJIT_FLAGS value via ICorJitInfo::getJitFlags().\n        CORJIT_FLAG_SPEED_OPT               = 0,\n        CORJIT_FLAG_SIZE_OPT                = 1,\n        CORJIT_FLAG_DEBUG_CODE              = 2, // generate \"debuggable\" code (no code-mangling optimizations)\n        CORJIT_FLAG_DEBUG_EnC               = 3, // We are in Edit-n-Continue mode\n        CORJIT_FLAG_DEBUG_INFO              = 4, // generate line and local-var info\n        CORJIT_FLAG_MIN_OPT                 = 5, // disable all jit optimizations (not necessarily debuggable code)\n        CORJIT_FLAG_ENABLE_CFG              = 6, // generate control-flow guard checks\n        CORJIT_FLAG_MCJIT_BACKGROUND        = 7, // Calling from multicore JIT background thread, do not call JitComplete\n\n    #if defined(TARGET_X86)\n\n        CORJIT_FLAG_PINVOKE_RESTORE_ESP     = 8, // Restore ESP after returning from inlined PInvoke\n        CORJIT_FLAG_TARGET_P4               = 9,\n        CORJIT_FLAG_USE_FCOMI               = 10, // Generated code may use fcomi(p) instruction\n        CORJIT_FLAG_USE_CMOV                = 11, // Generated code may use cmov instruction\n\n    #else // !defined(TARGET_X86)\n\n        CORJIT_FLAG_UNUSED2                 = 8,\n        CORJIT_FLAG_UNUSED3                 = 9,\n        CORJIT_FLAG_UNUSED4                 = 10,\n        CORJIT_FLAG_UNUSED5                 = 11,\n        CORJIT_FLAG_UNUSED6                 = 12,\n\n    #endif // !defined(TARGET_X86)\n\n        CORJIT_FLAG_OSR                     = 13, // Generate alternate method for On Stack Replacement\n\n        CORJIT_FLAG_ALT_JIT                 = 14, // JIT should consider itself an ALT_JIT\n        CORJIT_FLAG_UNUSED8                 = 15,\n        CORJIT_FLAG_UNUSED9                 = 16,\n        CORJIT_FLAG_UNUSED10                = 17,\n\n        CORJIT_FLAG_MAKEFINALCODE           = 18, // Use the final code generator, i.e., not the interpreter.\n        CORJIT_FLAG_READYTORUN              = 19, // Use version-resilient code generation\n        CORJIT_FLAG_PROF_ENTERLEAVE         = 20, // Instrument prologues/epilogues\n        CORJIT_FLAG_UNUSED11                = 21,\n        CORJIT_FLAG_PROF_NO_PINVOKE_INLINE  = 22, // Disables PInvoke inlining\n        CORJIT_FLAG_SKIP_VERIFICATION       = 23, // (lazy) skip verification - determined without doing a full resolve. See comment below\n        CORJIT_FLAG_PREJIT                  = 24, // jit or prejit is the execution engine.\n        CORJIT_FLAG_RELOC                   = 25, // Generate relocatable code\n        CORJIT_FLAG_IMPORT_ONLY             = 26, // Only import the function\n        CORJIT_FLAG_IL_STUB                 = 27, // method is an IL stub\n        CORJIT_FLAG_PROCSPLIT               = 28, // JIT should separate code into hot and cold sections\n        CORJIT_FLAG_BBINSTR                 = 29, // Collect basic block profile information\n        CORJIT_FLAG_BBOPT                   = 30, // Optimize method based on profile information\n        CORJIT_FLAG_FRAMED                  = 31, // All methods have an EBP frame\n        CORJIT_FLAG_UNUSED12                = 32,\n        CORJIT_FLAG_PUBLISH_SECRET_PARAM    = 33, // JIT must place stub secret param into local 0.  (used by IL stubs)\n        CORJIT_FLAG_UNUSED13                = 34,\n        CORJIT_FLAG_SAMPLING_JIT_BACKGROUND = 35, // JIT is being invoked as a result of stack sampling for hot methods in the background\n        CORJIT_FLAG_USE_PINVOKE_HELPERS     = 36, // The JIT should use the PINVOKE_{BEGIN,END} helpers instead of emitting inline transitions\n        CORJIT_FLAG_REVERSE_PINVOKE         = 37, // The JIT should insert REVERSE_PINVOKE_{ENTER,EXIT} helpers into method prolog/epilog\n        CORJIT_FLAG_TRACK_TRANSITIONS       = 38, // The JIT should insert the REVERSE_PINVOKE helper variants that track transitions.\n        CORJIT_FLAG_TIER0                   = 39, // This is the initial tier for tiered compilation which should generate code as quickly as possible\n        CORJIT_FLAG_TIER1                   = 40, // This is the final tier (for now) for tiered compilation which should generate high quality code\n\n#if defined(TARGET_ARM)\n        CORJIT_FLAG_RELATIVE_CODE_RELOCS    = 41, // JIT should generate PC-relative address computations instead of EE relocation records\n#else // !defined(TARGET_ARM)\n        CORJIT_FLAG_UNUSED15                = 41,\n#endif // !defined(TARGET_ARM)\n\n        CORJIT_FLAG_NO_INLINING             = 42, // JIT should not inline any called method into this method\n\n#if defined(TARGET_ARM)\n        CORJIT_FLAG_SOFTFP_ABI              = 43, // On ARM should enable armel calling convention\n#else // !defined(TARGET_ARM)\n        CORJIT_FLAG_UNUSED16                = 43,\n#endif // !defined(TARGET_ARM)\n\n        CORJIT_FLAG_UNUSED17                = 44,\n        CORJIT_FLAG_UNUSED18                = 45,\n        CORJIT_FLAG_UNUSED19                = 46,\n        CORJIT_FLAG_UNUSED20                = 47,\n        CORJIT_FLAG_UNUSED21                = 48,\n        CORJIT_FLAG_UNUSED22                = 49,\n        CORJIT_FLAG_UNUSED23                = 50,\n        CORJIT_FLAG_UNUSED24                = 51,\n        CORJIT_FLAG_UNUSED25                = 52,\n        CORJIT_FLAG_UNUSED26                = 53,\n        CORJIT_FLAG_UNUSED27                = 54,\n        CORJIT_FLAG_UNUSED28                = 55,\n        CORJIT_FLAG_UNUSED29                = 56,\n        CORJIT_FLAG_UNUSED30                = 57,\n        CORJIT_FLAG_UNUSED31                = 58,\n        CORJIT_FLAG_UNUSED32                = 59,\n        CORJIT_FLAG_UNUSED33                = 60,\n        CORJIT_FLAG_UNUSED34                = 61,\n        CORJIT_FLAG_UNUSED35                = 62,\n        CORJIT_FLAG_UNUSED36                = 63\n    };\n\n    CORJIT_FLAGS()\n        : corJitFlags(0)\n    {\n        // empty\n    }\n\n    // Convenience constructor to set exactly one flag.\n    CORJIT_FLAGS(CorJitFlag flag)\n        : corJitFlags(0)\n    {\n        Set(flag);\n    }\n\n    CORJIT_FLAGS(const CORJIT_FLAGS& other)\n    {\n        corJitFlags = other.corJitFlags;\n        instructionSetFlags = other.instructionSetFlags;\n    }\n\n    void Reset()\n    {\n        corJitFlags = 0;\n        instructionSetFlags.Reset();\n    }\n\n    void Set(CORINFO_InstructionSet instructionSet)\n    {\n        instructionSetFlags.AddInstructionSet(instructionSet);\n    }\n\n    bool IsSet(CORINFO_InstructionSet instructionSet) const\n    {\n        return instructionSetFlags.HasInstructionSet(instructionSet);\n    }\n\n    void Clear(CORINFO_InstructionSet instructionSet)\n    {\n        instructionSetFlags.RemoveInstructionSet(instructionSet);\n    }\n\n    void Set64BitInstructionSetVariants()\n    {\n        instructionSetFlags.Set64BitInstructionSetVariants();\n    }\n\n    void Set(CorJitFlag flag)\n    {\n        corJitFlags |= 1ULL << (uint64_t)flag;\n    }\n\n    void Clear(CorJitFlag flag)\n    {\n        corJitFlags &= ~(1ULL << (uint64_t)flag);\n    }\n\n    bool IsSet(CorJitFlag flag) const\n    {\n        return (corJitFlags & (1ULL << (uint64_t)flag)) != 0;\n    }\n\n    void Add(const CORJIT_FLAGS& other)\n    {\n        corJitFlags |= other.corJitFlags;\n        instructionSetFlags.Add(other.instructionSetFlags);\n    }\n\n    bool IsEmpty() const\n    {\n        return corJitFlags == 0 && instructionSetFlags.IsEmpty();\n    }\n\n    void EnsureValidInstructionSetSupport()\n    {\n        instructionSetFlags = EnsureInstructionSetFlagsAreValid(instructionSetFlags);\n    }\n\n    // DO NOT USE THIS FUNCTION! (except in very restricted special cases)\n    uint64_t GetFlagsRaw()\n    {\n        return corJitFlags;\n    }\n\n    // DO NOT USE THIS FUNCTION! (except in very restricted special cases)\n    uint64_t* GetInstructionSetFlagsRaw()\n    {\n        return instructionSetFlags.GetFlagsRaw();\n    }\n\n    CORINFO_InstructionSetFlags GetInstructionSetFlags()\n    {\n        return instructionSetFlags;\n    }\n\n    const int GetInstructionFlagsFieldCount()\n    {\n        return instructionSetFlags.GetInstructionFlagsFieldCount();\n    }\n\nprivate:\n\n    uint64_t corJitFlags;\n    CORINFO_InstructionSetFlags instructionSetFlags;\n};\n\n\n#endif // _COR_JIT_FLAGS_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corjithost.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __CORJITHOST_H__\n#define __CORJITHOST_H__\n\n// ICorJitHost\n//\n// ICorJitHost provides the interface that the JIT uses to access some functionality that\n// would normally be provided by the operating system. This is intended to allow for\n// host-specific policies re: memory allocation, configuration value access, etc. It is\n// expected that the `ICorJitHost` value provided to `jitStartup` lives at least as\n// long as the JIT itself.\nclass ICorJitHost\n{\npublic:\n    // Allocate memory of the given size in bytes.\n    virtual void* allocateMemory(size_t size) = 0;\n\n    // Frees memory previous obtained by a call to `ICorJitHost::allocateMemory`.\n    virtual void freeMemory(void* block) = 0;\n\n    // Return an integer config value for the given key, if any exists.\n    virtual int getIntConfigValue(\n        const WCHAR* name,\n        int defaultValue\n        ) = 0;\n\n    // Return a string config value for the given key, if any exists.\n    virtual const WCHAR* getStringConfigValue(\n        const WCHAR* name\n        ) = 0;\n\n    // Free a string ConfigValue returned by the runtime.\n    // JITs using the getStringConfigValue query are required\n    // to return the string values to the runtime for deletion.\n    // This avoids leaking the memory in the JIT.\n    virtual void freeStringConfigValue(\n        const WCHAR* value\n        ) = 0;\n\n    // Allocate memory slab of the given size in bytes. The host is expected to pool\n    // these for a good performance.\n    virtual void* allocateSlab(size_t size, size_t* pActualSize)\n    {\n        *pActualSize = size;\n        return allocateMemory(size);\n    }\n\n    // Free memory slab of the given size in bytes.\n    virtual void freeSlab(void* slab, size_t actualSize)\n    {\n        freeMemory(slab);\n    }\n};\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corpriv.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ===========================================================================\n// File: CORPRIV.H\n//\n// ===========================================================================\n\n#ifndef _CORPRIV_H_\n#define _CORPRIV_H_\n#if _MSC_VER >= 1000\n#pragma once\n#endif // _MSC_VER >= 1000\n\n// %%Includes: ---------------------------------------------------------------\n// avoid taking DLL import hit on intra-DLL calls\n#define NODLLIMPORT\n#include <daccess.h>\n#include \"cor.h\"\n#include \"corimage.h\"\n#include \"metadata.h\"\n#include <sstring.h>\n//\n\ninterface IAssemblyName;\n\nclass UTSemReadWrite;\n\n// Helper function to get a pointer to the Dispenser interface.\nSTDAPI MetaDataGetDispenser(            // Return HRESULT\n    REFCLSID    rclsid,                 // The class to desired.\n    REFIID      riid,                   // Interface wanted on class factory.\n    LPVOID FAR  *ppv);                  // Return interface pointer here.\n\nBOOL RuntimeFileNotFound(HRESULT hr);\n\n// Helper function to get an Internal interface with an in-memory metadata section\nSTDAPI  GetMetaDataInternalInterface(\n    LPVOID      pData,                  // [IN] in memory metadata section\n    ULONG       cbData,                 // [IN] size of the metadata section\n    DWORD       flags,                  // [IN] CorOpenFlags\n    REFIID      riid,                   // [IN] desired interface\n    void        **ppv);                 // [OUT] returned interface\n\n// Helper function to get an internal scopeless interface given a scope.\nSTDAPI  GetMetaDataInternalInterfaceFromPublic(\n    IUnknown    *pv,                    // [IN] Given interface\n    REFIID      riid,                   // [IN] desired interface\n    void        **ppv);                 // [OUT] returned interface\n\n// Helper function to get an internal scopeless interface given a scope.\nSTDAPI  GetMetaDataPublicInterfaceFromInternal(\n    void        *pv,                    // [IN] Given interface\n    REFIID      riid,                   // [IN] desired interface\n    void        **ppv);                 // [OUT] returned interface\n\n// Converts an internal MD import API into the read/write version of this API.\n// This could support edit and continue, or modification of the metadata at\n// runtime (say for profiling).\nSTDAPI ConvertMDInternalImport(         // S_OK or error.\n    IMDInternalImport *pIMD,            // [IN] The metadata to be updated.\n    IMDInternalImport **ppIMD);         // [OUT] Put RW interface here.\n\nSTDAPI GetAssemblyMDInternalImport(     // Return code.\n    LPCWSTR     szFileName,             // [IN] The scope to open.\n    REFIID      riid,                   // [IN] The interface desired.\n    IUnknown    **ppIUnk);              // [OUT] Return interface on success.\n\nSTDAPI GetAssemblyMDInternalImportByStream( // Return code.\n    IStream     *pIStream,              // [IN] The IStream for the file\n    UINT64      AssemblyId,             // [IN] Unique Id for the assembly\n    REFIID      riid,                   // [IN] The interface desired.\n    IUnknown    **ppIUnk);              // [OUT] Return interface on success.\n\n\nenum MDInternalImportFlags\n{\n    MDInternalImport_Default            = 0,\n    MDInternalImport_NoCache            = 1, // Do not share/cached the results of opening the image\n    // unused                           = 2,\n    // unused                           = 4,\n    MDInternalImport_OnlyLookInCache    =0x20, // Only look in the cache. (If the cache does not have the image already loaded, return NULL)\n};  // enum MDInternalImportFlags\n\n\n\nSTDAPI GetAssemblyMDInternalImportEx(     // Return code.\n    LPCWSTR     szFileName,             // [IN] The scope to open.\n    REFIID      riid,                   // [IN] The interface desired.\n    MDInternalImportFlags flags,        // [in] Flags to control opening the assembly\n    IUnknown    **ppIUnk,               // [OUT] Return interface on success.\n    HANDLE      hFile = INVALID_HANDLE_VALUE);\n\nSTDAPI GetAssemblyMDInternalImportByStreamEx( // Return code.\n    IStream     *pIStream,              // [IN] The IStream for the file\n    UINT64      AssemblyId,             // [IN] Unique Id for the assembly\n    REFIID      riid,                   // [IN] The interface desired.\n    MDInternalImportFlags flags,        // [in] Flags to control opening the assembly\n    IUnknown    **ppIUnk);              // [OUT] Return interface on success.\n\n\n// Returns part of the \"Zap string\" which describes the properties of a native image\n\n__success(SUCCEEDED(return))\nSTDAPI GetNativeImageDescription(\n    _In_z_ LPCWSTR wzCustomString,                     // [IN] Custom string of the native image\n    DWORD dwConfigMask,                         // [IN] Config mask of the native image\n    _Out_writes_to_opt_(*pdwLength,*pdwLength) LPWSTR pwzZapInfo,// [OUT] The description string. Can be NULL to find the size of buffer to allocate\n    LPDWORD pdwLength);                         // [IN/OUT] Length of the pwzZapInfo buffer on IN.\n                                                //          Number of WCHARs (including termintating NULL) on OUT\n\n\nclass CQuickBytes;\n\n\n// predefined constant for parent token for global functions\n#define     COR_GLOBAL_PARENT_TOKEN     TokenFromRid(1, mdtTypeDef)\n\n\n\n//////////////////////////////////////////////////////////////////////////\n//\n//////////////////////////////////////////////////////////////////////////\n\n// %%Interfaces: -------------------------------------------------------------\n\n// interface IMetaDataHelper\n\n// {AD93D71D-E1F2-11d1-9409-0000F8083460}\nEXTERN_GUID(IID_IMetaDataHelper, 0xad93d71d, 0xe1f2, 0x11d1, 0x94, 0x9, 0x0, 0x0, 0xf8, 0x8, 0x34, 0x60);\n\n#undef  INTERFACE\n#define INTERFACE IMetaDataHelper\nDECLARE_INTERFACE_(IMetaDataHelper, IUnknown)\n{\n    // helper functions\n    // This function is exposing the ability to translate signature from a given\n    // source scope to a given target scope.\n    //\n    STDMETHOD(TranslateSigWithScope)(\n        IMetaDataAssemblyImport *pAssemImport, // [IN] importing assembly interface\n        const void  *pbHashValue,           // [IN] Hash Blob for Assembly.\n        ULONG       cbHashValue,            // [IN] Count of bytes.\n        IMetaDataImport *import,            // [IN] importing interface\n        PCCOR_SIGNATURE pbSigBlob,          // [IN] signature in the importing scope\n        ULONG       cbSigBlob,              // [IN] count of bytes of signature\n        IMetaDataAssemblyEmit *pAssemEmit,  // [IN] emit assembly interface\n        IMetaDataEmit *emit,                // [IN] emit interface\n        PCOR_SIGNATURE pvTranslatedSig,     // [OUT] buffer to hold translated signature\n        ULONG       cbTranslatedSigMax,\n        ULONG       *pcbTranslatedSig) PURE;// [OUT] count of bytes in the translated signature\n\n    STDMETHOD(GetMetadata)(\n        ULONG       ulSelect,               // [IN] Selector.\n        void        **ppData) PURE;         // [OUT] Put pointer to data here.\n\n    STDMETHOD_(IUnknown *, GetCachedInternalInterface)(BOOL fWithLock) PURE;    // S_OK or error\n    STDMETHOD(SetCachedInternalInterface)(IUnknown * pUnk) PURE;    // S_OK or error\n    STDMETHOD_(UTSemReadWrite*, GetReaderWriterLock)() PURE;   // return the reader writer lock\n    STDMETHOD(SetReaderWriterLock)(UTSemReadWrite * pSem) PURE;\n};  // IMetaDataHelper\n\n\nEXTERN_GUID(IID_IMetaDataEmitHelper, 0x5c240ae4, 0x1e09, 0x11d3, 0x94, 0x24, 0x0, 0x0, 0xf8, 0x8, 0x34, 0x60);\n\n#undef  INTERFACE\n#define INTERFACE IMetaDataEmitHelper\nDECLARE_INTERFACE_(IMetaDataEmitHelper, IUnknown)\n{\n    // emit helper functions\n    STDMETHOD(DefineMethodSemanticsHelper)(\n        mdToken     tkAssociation,          // [IN] property or event token\n        DWORD       dwFlags,                // [IN] semantics\n        mdMethodDef md) PURE;               // [IN] method to associated with\n\n    STDMETHOD(SetFieldLayoutHelper)(                // Return hresult.\n        mdFieldDef  fd,                     // [IN] field to associate the layout info\n        ULONG       ulOffset) PURE;         // [IN] the offset for the field\n\n    STDMETHOD(DefineEventHelper) (\n        mdTypeDef   td,                     // [IN] the class/interface on which the event is being defined\n        LPCWSTR     szEvent,                // [IN] Name of the event\n        DWORD       dwEventFlags,           // [IN] CorEventAttr\n        mdToken     tkEventType,            // [IN] a reference (mdTypeRef or mdTypeRef) to the Event class\n        mdEvent     *pmdEvent) PURE;        // [OUT] output event token\n\n    STDMETHOD(AddDeclarativeSecurityHelper) (\n        mdToken     tk,                     // [IN] Parent token (typedef/methoddef)\n        DWORD       dwAction,               // [IN] Security action (CorDeclSecurity)\n        void const  *pValue,                // [IN] Permission set blob\n        DWORD       cbValue,                // [IN] Byte count of permission set blob\n        mdPermission*pmdPermission) PURE;   // [OUT] Output permission token\n\n    STDMETHOD(SetResolutionScopeHelper)(    // Return hresult.\n        mdTypeRef   tr,                     // [IN] TypeRef record to update\n        mdToken     rs) PURE;               // [IN] new ResolutionScope\n\n    STDMETHOD(SetManifestResourceOffsetHelper)(  // Return hresult.\n        mdManifestResource mr,              // [IN] The manifest token\n        ULONG       ulOffset) PURE;         // [IN] new offset\n\n    STDMETHOD(SetTypeParent)(               // Return hresult.\n        mdTypeDef   td,                     // [IN] Type definition\n        mdToken     tkExtends) PURE;        // [IN] parent type\n\n    STDMETHOD(AddInterfaceImpl)(            // Return hresult.\n        mdTypeDef   td,                     // [IN] Type definition\n        mdToken     tkInterface) PURE;      // [IN] interface type\n\n};  // IMetaDataEmitHelper\n\n//////////////////////////////////////////////////////////////////////////////\n// enum CorElementTypeZapSig defines some additional internal ELEMENT_TYPE's\n// values that are only used by ZapSig signatures.\n//////////////////////////////////////////////////////////////////////////////\ntypedef enum CorElementTypeZapSig\n{\n    // ZapSig encoding for ELEMENT_TYPE_VAR and ELEMENT_TYPE_MVAR. It is always followed\n    // by the RID of a GenericParam token, encoded as a compressed integer.\n    ELEMENT_TYPE_VAR_ZAPSIG = 0x3b,\n\n    // UNUSED = 0x3c,\n\n    // ZapSig encoding for native value types in IL stubs. IL stub signatures may contain\n    // ELEMENT_TYPE_INTERNAL followed by ParamTypeDesc with ELEMENT_TYPE_VALUETYPE element\n    // type. It acts like a modifier to the underlying structure making it look like its\n    // unmanaged view (size determined by unmanaged layout, blittable, no GC pointers).\n    //\n    // ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG is used when encoding such types to NGEN images.\n    // The signature looks like this: ET_NATIVE_VALUETYPE_ZAPSIG ET_VALUETYPE <token>.\n    // See code:ZapSig.GetSignatureForTypeHandle and code:SigPointer.GetTypeHandleThrowing\n    // where the encoding/decoding takes place.\n    ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG = 0x3d,\n\n    ELEMENT_TYPE_CANON_ZAPSIG            = 0x3e,     // zapsig encoding for System.__Canon\n    ELEMENT_TYPE_MODULE_ZAPSIG           = 0x3f,     // zapsig encoding for external module id#\n\n} CorElementTypeZapSig;\n\ntypedef enum CorCallingConventionInternal\n{\n    // IL stub signatures containing types that need to be restored have the highest\n    // bit of the calling convention set.\n    IMAGE_CEE_CS_CALLCONV_NEEDSRESTORE   = 0x80,\n\n} CorCallingConventionInternal;\n\n//////////////////////////////////////////////////////////////////////////\n// Obsoleted ELEMENT_TYPE values which are not supported anymore.\n// They are not part of CLI ECMA spec, they were only experimental before v1.0 RTM.\n// They are needed for indexing arrays initialized using file:corTypeInfo.h\n//    0x17 ... VALUEARRAY <type> <bound>\n//    0x1a ... CPU native floating-point type\n//////////////////////////////////////////////////////////////////////////\n#define ELEMENT_TYPE_VALUEARRAY_UNSUPPORTED ((CorElementType) 0x17)\n#define ELEMENT_TYPE_R_UNSUPPORTED          ((CorElementType) 0x1a)\n\n// Use this guid in the SetOption if Reflection.Emit wants to control size of the initially allocated\n// MetaData. See values: code:CorMetaDataInitialSize.\n//\n// {2675b6bf-f504-4cb4-a4d5-084eea770ddc}\nEXTERN_GUID(MetaDataInitialSize, 0x2675b6bf, 0xf504, 0x4cb4, 0xa4, 0xd5, 0x08, 0x4e, 0xea, 0x77, 0x0d, 0xdc);\n\n// Allowed values for code:MetaDataInitialSize option.\ntypedef enum CorMetaDataInitialSize\n{\n    MDInitialSizeDefault = 0,\n    MDInitialSizeMinimal = 1\n} CorMetaDataInitialSize;\n\n// Internal extension of open flags code:CorOpenFlags\ntypedef enum CorOpenFlagsInternal\n{\n#ifdef FEATURE_METADATA_LOAD_TRUSTED_IMAGES\n    // Flag code:ofTrustedImage is used by mscordbi.dll, therefore defined in file:CorPriv.h\n    ofTrustedImage = ofReserved3    // We trust this PE file (we are willing to do a LoadLibrary on it).\n                                    // It is optional and only an (VM) optimization - typically for NGEN images\n                                    // opened by debugger.\n#endif\n} CorOpenFlagsInternal;\n\n#ifdef FEATURE_METADATA_LOAD_TRUSTED_IMAGES\n#define IsOfTrustedImage(x)     ((x) & ofTrustedImage)\n#endif\n\n// %%Classes: ----------------------------------------------------------------\n\n#define COR_MODULE_CLASS    \"<Module>\"\n#define COR_WMODULE_CLASS   W(\"<Module>\")\n\n//*****************************************************************************\n//*****************************************************************************\n//\n// CeeGen interfaces for generating in-memory Common Language Runtime files\n//\n//*****************************************************************************\n//*****************************************************************************\n\ntypedef void* HCEESECTION;\n\ntypedef enum {\n    sdNone = 0,\n    sdReadOnly = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA,\n    sdReadWrite = sdReadOnly | IMAGE_SCN_MEM_WRITE,\n    sdExecute = IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE\n} CeeSectionAttr;\n\n//\n// Relocation types.\n//\n\ntypedef enum {\n    // generate only a section-relative reloc, nothing into .reloc section\n    srRelocAbsolute,\n\n    // generate a .reloc for a pointer sized location,\n    // This is transformed into BASED_HIGHLOW or BASED_DIR64 based on the platform\n    srRelocHighLow = 3,\n\n    // generate a .reloc for the top 16-bits of a 32 bit number, where the\n    // bottom 16 bits are included in the next word in the .reloc table\n    srRelocHighAdj,     // Never Used\n\n    // generate a token map relocation, nothing into .reloc section\n    srRelocMapToken,\n\n    // relative address fixup\n    srRelocRelative,\n\n    // Generate only a section-relative reloc, nothing into .reloc\n    // section.  This reloc is relative to the file position of the\n    // section, not the section's virtual address.\n    srRelocFilePos,\n\n    // code relative address fixup\n    srRelocCodeRelative,\n\n    // generate a .reloc for a 64 bit address in an ia64 movl instruction\n    srRelocIA64Imm64,\n\n    // generate a .reloc for a 64 bit address\n    srRelocDir64,\n\n    // generate a .reloc for a 25-bit PC relative address in an ia64 br.call instruction\n    srRelocIA64PcRel25,\n\n    // generate a .reloc for a 64-bit PC relative address in an ia64 brl.call instruction\n    srRelocIA64PcRel64,\n\n    // generate a 30-bit section-relative reloc, used for tagged pointer values\n    srRelocAbsoluteTagged,\n\n\n    // A sentinel value to help ensure any additions to this enum are reflected\n    // in PEWriter.cpp's RelocName array.\n    srRelocSentinel,\n\n    // Flags that can be used with the above reloc types\n\n    // do not emit base reloc\n    srNoBaseReloc = 0x4000,\n\n    // pre-fixup contents of memory are ptr rather than a section offset\n    srRelocPtr = 0x8000,\n\n    // legal enums which include the Ptr flag\n    srRelocAbsolutePtr = srRelocPtr + srRelocAbsolute,\n    srRelocHighLowPtr = srRelocPtr + srRelocHighLow,\n    srRelocRelativePtr = srRelocPtr + srRelocRelative,\n    srRelocIA64Imm64Ptr = srRelocPtr + srRelocIA64Imm64,\n    srRelocDir64Ptr = srRelocPtr + srRelocDir64,\n\n} CeeSectionRelocType;\n\ntypedef union {\n    USHORT highAdj;\n} CeeSectionRelocExtra;\n\n//-------------------------------------\n//--- ICeeGenInternal\n//-------------------------------------\n// {8C26FC02-BE39-476D-B835-E17EDD120246}\nEXTERN_GUID(IID_ICeeGenInternal, 0x8c26fc02, 0xbe39, 0x476d, 0xb8, 0x35, 0xe1, 0x7e, 0xdd, 0x12, 0x2, 0x46);\n#undef  INTERFACE\n#define INTERFACE ICeeGenInternal\nDECLARE_INTERFACE_(ICeeGenInternal, IUnknown)\n{\n    STDMETHOD(EmitString) (\n        _In_\n        LPWSTR lpString,                    // [IN] String to emit\n        ULONG * RVA) PURE;                   // [OUT] RVA for string emitted string\n\n    STDMETHOD(GetString) (\n        ULONG RVA,                          // [IN] RVA for string to return\n        _Out_opt_\n        LPWSTR * lpString) PURE;             // [OUT] Returned string\n\n    STDMETHOD(AllocateMethodBuffer) (\n        ULONG cchBuffer,                    // [IN] Length of buffer to create\n        UCHAR * *lpBuffer,                   // [OUT] Returned buffer\n        ULONG * RVA) PURE;                   // [OUT] RVA for method\n\n    STDMETHOD(GetMethodBuffer) (\n        ULONG RVA,                          // [IN] RVA for method to return\n        UCHAR * *lpBuffer) PURE;             // [OUT] Returned buffer\n\n    STDMETHOD(GetIMapTokenIface) (\n        IUnknown * *pIMapToken) PURE;\n\n    STDMETHOD(GenerateCeeFile) () PURE;\n\n    STDMETHOD(GetIlSection) (\n        HCEESECTION * section) PURE;\n\n    STDMETHOD(GetStringSection) (\n        HCEESECTION * section) PURE;\n\n    STDMETHOD(AddSectionReloc) (\n        HCEESECTION section,\n        ULONG offset,\n        HCEESECTION relativeTo,\n        CeeSectionRelocType relocType) PURE;\n\n    // use these only if you have special section requirements not handled\n    // by other APIs\n    STDMETHOD(GetSectionCreate) (\n        const char* name,\n        DWORD flags,\n        HCEESECTION * section) PURE;\n\n    STDMETHOD(GetSectionDataLen) (\n        HCEESECTION section,\n        ULONG * dataLen) PURE;\n\n    STDMETHOD(GetSectionBlock) (\n        HCEESECTION section,\n        ULONG len,\n        ULONG align = 1,\n        void** ppBytes = 0) PURE;\n\n    STDMETHOD(ComputePointer) (\n        HCEESECTION section,\n        ULONG RVA,                          // [IN] RVA for method to return\n        UCHAR * *lpBuffer) PURE;             // [OUT] Returned buffer\n\n    STDMETHOD(SetInitialGrowth) (DWORD growth) PURE;\n};\n\n//\n// IGetIMDInternalImport\n//\n// Private interface exposed by\n//    AssemblyMDInternalImport - gives us access to the internally stored IMDInternalImport*.\n//\n//    RegMeta - supports the internal GetMetaDataInternalInterfaceFromPublic() \"api\".\n//\n// {92B2FEF9-F7F5-420d-AD42-AECEEE10A1EF}\nEXTERN_GUID(IID_IGetIMDInternalImport, 0x92b2fef9, 0xf7f5, 0x420d, 0xad, 0x42, 0xae, 0xce, 0xee, 0x10, 0xa1, 0xef);\n#undef  INTERFACE\n#define INTERFACE IGetIMDInternalImport\nDECLARE_INTERFACE_(IGetIMDInternalImport, IUnknown)\n{\n    STDMETHOD(GetIMDInternalImport) (\n        IMDInternalImport ** ppIMDInternalImport   // [OUT] Buffer to receive IMDInternalImport*\n    ) PURE;\n};\n\n#endif  // _CORPRIV_H_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corprof.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/**************************************************************************************\n **                                                                                  **\n ** Corprof.idl - CLR Profiling interfaces.                                          **\n **                                                                                  **\n **************************************************************************************/\n\n/* -------------------------------------------------------------------------- *\n * Imported types\n * -------------------------------------------------------------------------- */\n\n#if !DEFINITIONS_FROM_NON_IMPORTABLE_PLACES\n\ncpp_quote(\"#if 0\")\n\n\nimport \"unknwn.idl\";\n\ntypedef LONG32  mdToken;\ntypedef mdToken mdModule;\ntypedef mdToken mdTypeDef;\ntypedef mdToken mdMethodDef;\ntypedef mdToken mdFieldDef;\ntypedef ULONG CorElementType;\n\n// Forward declaration of enum in CorHdr.h\nenum    CorElementType;\n\n// Forward declaration of structs in Cor.h\n\ntypedef struct\n{\n    DWORD       dwOSPlatformId;         // Operating system platform.\n    DWORD       dwOSMajorVersion;       // OS Major version.\n    DWORD       dwOSMinorVersion;       // OS Minor version.\n} OSINFO;\n\ntypedef struct\n{\n    USHORT      usMajorVersion;         // Major Version.\n    USHORT      usMinorVersion;         // Minor Version.\n    USHORT      usBuildNumber;          // Build Number.\n    USHORT      usRevisionNumber;       // Revision Number.\n    LPWSTR      szLocale;               // Locale.\n    ULONG       cbLocale;               // [IN/OUT] Size of the buffer in wide chars/Actual size.\n    DWORD       *rProcessor;            // Processor ID array.\n    ULONG       ulProcessor;            // [IN/OUT] Size of the Processor ID array/Actual # of entries filled in.\n    OSINFO      *rOS;                   // OSINFO array.\n    ULONG       ulOS;                   // [IN/OUT]Size of the OSINFO array/Actual # of entries filled in.\n} ASSEMBLYMETADATA;\n\ncpp_quote(\"#endif\")\n\ntypedef const BYTE *LPCBYTE;\ntypedef BYTE *LPBYTE;\n\ntypedef BYTE COR_SIGNATURE;\ntypedef COR_SIGNATURE* PCOR_SIGNATURE;\ntypedef const COR_SIGNATURE* PCCOR_SIGNATURE;\n\n#endif\n\n\ncpp_quote(\"#ifndef _COR_IL_MAP\")\ncpp_quote(\"#define _COR_IL_MAP\")\n\n#ifdef INTERNAL_DOCS\n// Note that this structure is also defined in CorDebug.idl - PROPAGATE CHANGES\n// BOTH WAYS, or this'll become a really insidious bug some day.\n#endif\ntypedef struct _COR_IL_MAP\n{\n    ULONG32 oldOffset;        // Old IL offset relative to beginning of function\n    ULONG32 newOffset;        // New IL offset relative to beginning of function\n    BOOL    fAccurate; //put here for compatibility with the Debugger structure.\n} COR_IL_MAP;\n\ncpp_quote(\"#endif //_COR_IL_MAP\")\n\ncpp_quote(\"#ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_\")\ncpp_quote(\"#define _COR_DEBUG_IL_TO_NATIVE_MAP_\")\n\n/* ICorProfilerInfo:: GetILToNativeMapping returns an array of\n * COR_DEBUG_IL_TO_NATIVE_MAP structures.  In order to convey that certain\n * ranges of native instructions correspond to special regions of code (for\n * example, the prolog), an entry in the array may have it's ilOffset field set\n * to one of these values.\n */\ntypedef enum CorDebugIlToNativeMappingTypes\n{\n    NO_MAPPING = -1,\n    PROLOG     = -2,\n    EPILOG     = -3\n} CorDebugIlToNativeMappingTypes;\n\ntypedef struct COR_DEBUG_IL_TO_NATIVE_MAP\n{\n    ULONG32 ilOffset;\n    ULONG32 nativeStartOffset;\n    ULONG32 nativeEndOffset;\n} COR_DEBUG_IL_TO_NATIVE_MAP;\n\ncpp_quote(\"#endif // _COR_DEBUG_IL_TO_NATIVE_MAP_\")\n\ncpp_quote(\"#ifndef _COR_FIELD_OFFSET_\")\ncpp_quote(\"#define _COR_FIELD_OFFSET_\")\n\ntypedef struct _COR_FIELD_OFFSET\n{\n    mdFieldDef ridOfField;  // fieldDef token of the field\n    ULONG      ulOffset;      // offset (from the ObjectID pointer) of the field\n} COR_FIELD_OFFSET;\n\ncpp_quote(\"#endif // _COR_FIELD_OFFSET_\")\n\n\n#ifndef DO_NO_IMPORTS\nimport \"wtypes.idl\";\nimport \"unknwn.idl\";\n#endif\n\n#define STDMETHODCALLTYPE\n\ntypedef UINT_PTR ProcessID;\ntypedef UINT_PTR AssemblyID;\ntypedef UINT_PTR AppDomainID;\ntypedef UINT_PTR ModuleID;\ntypedef UINT_PTR ClassID;\ntypedef UINT_PTR ThreadID;\ntypedef UINT_PTR ContextID;\ntypedef UINT_PTR FunctionID;\ntypedef UINT_PTR ObjectID;\ntypedef UINT_PTR GCHandleID;\ntypedef UINT_PTR COR_PRF_ELT_INFO;\ntypedef UINT_PTR ReJITID;\n\ntypedef union {FunctionID functionID; UINT_PTR clientID;} FunctionIDOrClientID;\n\n/*\n * The FunctionIDMapper type definition is used by the\n * ICorProfilerInfo::SetFunctionIDMapper method to specify\n * a function that will be called to map FunctionIDs to alternative\n * values that will be passed to the function entry and function exit\n * callbacks supplied to the ICorProfilerInfo::SetEnterLeaveFunctionHooks\n * method. The mapper can be set only once and it is recommended to do so\n * in the Initialize callback.\n *\n * NOTE: There is a known bug in this API that must be worked around.\n * The return value of FunctionIDMapper cannot be NULL (unless the boolean\n * value in pbHookTheFunction is FALSE).  All other values are treated as\n * opaque data to be passed to the entry/exit callback functions.  The use\n * of a NULL return value will produce unpredictable results, including\n * possibly halting the process.\n *\n * NOTE: Profilers should be tolerant of cases where multiple threads of\n * a profiled app are calling the same method simultaneously.  In such\n * cases, the profiler may receive multiple FunctionIDMapper callbacks\n * for the same functionId.  The profiler should be certain to return\n * the same values from this callback when it is called multiple times\n * with the same functionId.\n *\n */\ntypedef UINT_PTR __stdcall FunctionIDMapper(\n                FunctionID funcId,\n                BOOL *pbHookFunction);\n\ntypedef UINT_PTR __stdcall FunctionIDMapper2(\n                FunctionID funcId,\n                void *clientData,\n                BOOL *pbHookFunction);\n\n/*\n * Enum for specifying how much data to pass back with a stack snapshot\n */\ntypedef enum _COR_PRF_SNAPSHOT_INFO\n{\n    COR_PRF_SNAPSHOT_DEFAULT            = 0x0,\n\n    // Return a register context for each frame\n    COR_PRF_SNAPSHOT_REGISTER_CONTEXT   = 0x1,\n\n    // Use a quicker stack walk algorithm based on the EBP frame chain. This is available\n    // on x86 only.\n    COR_PRF_SNAPSHOT_X86_OPTIMIZED      = 0x2,\n} COR_PRF_SNAPSHOT_INFO;\n\n/*\n * Opaque handle that represents information about a given stack frame. It is only\n * valid during the callback to which it is passed.\n */\ntypedef UINT_PTR COR_PRF_FRAME_INFO;\n\n/*\n * Describes a range of function arguments stored contiguously in left-to-right\n * order in memory.\n */\ntypedef struct _COR_PRF_FUNCTION_ARGUMENT_RANGE\n{\n    UINT_PTR startAddress;          // start address of the range\n    ULONG length;                         // contiguous length of the range\n} COR_PRF_FUNCTION_ARGUMENT_RANGE;\n\n/*\n * Describes the locations in memory of a function's arguments, in\n * left-to-right order. Note that arguments stored in registers are\n * spilled to memory to build these structures.\n */\ntypedef struct _COR_PRF_FUNCTION_ARGUMENT_INFO\n{\n    ULONG numRanges;                // number of chunks of arguments\n    ULONG totalArgumentSize;    // total size of arguments\n    COR_PRF_FUNCTION_ARGUMENT_RANGE ranges[1];  // chunks\n} COR_PRF_FUNCTION_ARGUMENT_INFO;\n\n/*\n * Represents one contiguous chunk of native code\n */\ntypedef struct _COR_PRF_CODE_INFO\n{\n    UINT_PTR startAddress;\n    SIZE_T size;\n} COR_PRF_CODE_INFO;\n\n/*\n * Enum for describing the type of static a field is.  These may be bit-wise\n * or'ed with each other if the field is multiple types.\n */\ntypedef enum\n{\n    COR_PRF_FIELD_NOT_A_STATIC = 0x0,\n    COR_PRF_FIELD_APP_DOMAIN_STATIC = 0x1,\n    COR_PRF_FIELD_THREAD_STATIC = 0x2,\n    COR_PRF_FIELD_CONTEXT_STATIC = 0x4,\n    COR_PRF_FIELD_RVA_STATIC = 0x8\n} COR_PRF_STATIC_TYPE;\n\n/*\n * Represents a function uniquely by combining the FunctionID\n * with a ReJITID.\n */\ntypedef struct _COR_PRF_FUNCTION\n{\n    FunctionID functionId;\n    ReJITID    reJitId;\n} COR_PRF_FUNCTION;\n\n\n/*\n * Structure populated by profiler when declaring additional assembly references\n * that the CLR should consider when performing an assembly reference closure\n * walk.  See ICorProfilerCallback6::GetAssemblyReferences and\n * ICorProfilerAssemblyReferenceProvider::AddAssemblyReference\n */\ntypedef struct _COR_PRF_ASSEMBLY_REFERENCE_INFO\n{\n    void  *pbPublicKeyOrToken;          // Public key or token of the assembly.\n    ULONG       cbPublicKeyOrToken;     // Count of bytes in the public key or token.\n    LPCWSTR     szName;                 // Name of the assembly being referenced.\n    ASSEMBLYMETADATA * pMetaData;       // Assembly MetaData, as defined in cor.h\n    void  *pbHashValue;                 // Hash Blob.\n    ULONG       cbHashValue;            // Count of bytes in the Hash Blob.\n    DWORD       dwAssemblyRefFlags;     // Flags.\n} COR_PRF_ASSEMBLY_REFERENCE_INFO;\n\n\n/*\n * Represents a IL methods uniquely by combining the module ID and method token.\n */\ntypedef struct _COR_PRF_METHOD\n{\n    ModuleID    moduleId;\n    mdMethodDef methodId;\n} COR_PRF_METHOD;\n\n/*\n * NOTE!!!\n *\n * The following applies to ALL FunctionEnter[2,3], FunctionLeave[2,3],\n * FunctionTailcall[2,3] hooks below:\n *\n * It is VERY IMPORTANT to note that these function implementations must be\n * __declspec(naked), since the EE is not saving any registers before calling\n * any of them.  YOU MUST SAVE ALL REGISTERS YOU USE, INCLUDING FPU REGISTERS\n * IF THE FPU STACK IS NOT EMPTY AND YOU INTEND TO USE IT.\n *\n * NOTE: The profiler should not block here, since the stack may not be in a\n *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n *       profiler blocks here and a GC is attempted, the runtime will block\n *       until this callback returns.  Also, the profiler may NOT call into\n *       managed code or in any way cause a managed memory allocation.\n */\n\n /*\n * NOTE: DEPRECATED IN V2\n *\n * These functions are considered deprecated in V2 and higher.  They will\n * continue to work, but incur a performance penalty for usage.  For equivalent\n * functionality, use the FunctionEnter3/Leave3/Tailcall3 callbacks with\n * bits cleared for COR_PRF_ENABLE_FRAME_INFO, COR_PRF_ENABLE_FUNCTION_RETVAL\n * and COR_PRF_ENABLE_FUNCTION_ARGS.\n */\ntypedef void STDMETHODCALLTYPE FunctionEnter(\n                FunctionID funcID);\n\ntypedef void STDMETHODCALLTYPE FunctionLeave(\n                FunctionID funcID);\n\ntypedef void STDMETHODCALLTYPE FunctionTailcall(\n                FunctionID funcID);\n\n/*\n * NOTE: DEPRECATED IN V4\n *\n * These functions are considered deprecated in V4 and higher.  They will\n * continue to work, but incur a performance penalty for usage.  For equivalent\n * functionality, use the FunctionEnter3/Leave3/Tailcall3 callbacks.\n */\n\ntypedef void STDMETHODCALLTYPE FunctionEnter2(\n                FunctionID funcId,\n                UINT_PTR clientData,\n                COR_PRF_FRAME_INFO func,\n                COR_PRF_FUNCTION_ARGUMENT_INFO *argumentInfo);\n\ntypedef void STDMETHODCALLTYPE FunctionLeave2(\n                FunctionID funcId,\n                UINT_PTR clientData,\n                COR_PRF_FRAME_INFO func,\n                COR_PRF_FUNCTION_ARGUMENT_RANGE *retvalRange);\n\ntypedef void STDMETHODCALLTYPE FunctionTailcall2(\n                FunctionID funcId,\n                UINT_PTR clientData,\n                COR_PRF_FRAME_INFO func);\n\n/*\n * When you are not interested in inspecting arguments or return values, then\n * use these to be notified as functions are called and return.  Use\n * SetEnterLeaveFunctionHooks3 to register your implementations of these\n * functions.\n *\n * functionIDOrClientID: if the profiler returned a remapped value from\n * FunctionIDMapper[2], then this is that remapped value; else it is the\n * true FunctionID of the function.\n */\n\ntypedef void STDMETHODCALLTYPE FunctionEnter3(\n                FunctionIDOrClientID functionIDOrClientID);\n\ntypedef void STDMETHODCALLTYPE FunctionLeave3(\n                FunctionIDOrClientID functionIDOrClientID);\n\ntypedef void STDMETHODCALLTYPE FunctionTailcall3(\n                FunctionIDOrClientID functionIDOrClientID);\n\n/*\n * When you are interested in inspecting arguments and return values, then\n * use these to be notified as functions are called and return.  Use\n * SetEnterLeaveFunctionHooks3WithInfo to register your implementations of these\n * functions.\n *\n * functionIDOrClientID: if the profiler returned a remapped value from\n * FunctionIDMapper[2], then this is that remapped value; else it is the\n * true FunctionID of the function.\n *\n * eltInfo is an opaque handle that represents information about a given stack frame.\n * It is only valid during the callback to which it is passed.\n */\n\ntypedef void STDMETHODCALLTYPE FunctionEnter3WithInfo(\n                FunctionIDOrClientID functionIDOrClientID,\n                COR_PRF_ELT_INFO eltInfo);\n\ntypedef void STDMETHODCALLTYPE FunctionLeave3WithInfo(\n                FunctionIDOrClientID functionIDOrClientID,\n                COR_PRF_ELT_INFO eltInfo);\n\ntypedef void STDMETHODCALLTYPE FunctionTailcall3WithInfo(\n                FunctionIDOrClientID functionIDOrClientID,\n                COR_PRF_ELT_INFO eltInfo);\n\n/*\n * Stack snapshot callback definition.\n *\n * This callback is called once per managed frame or run of unmanaged frames.\n *\n * funcID is the FunctionID of the managed function. If funcID == 0, the callback is\n * for a run of unmanaged frames. The profiler may either ignore the frame, or use\n * the register context to perform its own unmanaged stackwalk.\n *\n * ip is the native IP in the frame\n *\n * frameInfo is the COR_PRF_FRAME_INFO for this frame. It is only valid for\n * use during this callback.\n *\n * context is a Win32 CONTEXT struct for the current platform (size given in\n * contextSize). It will only be valid if the COR_PRF_SNAPSHOT_CONTEXT flag\n * was passed to DoStackSnapshot.\n *\n * clientData is a void* passed straight through from DoStackSnapshot\n *\n * NOTE: One must limit the complexity of work done in StackSnapshotCallback.\n * For example, particularly when using DoStackSnapshot in an asynchronous manner,\n * the target thread may be holding locks. Executing code within StackSnapshotCallback\n * that requires the same locks could lead to deadlock.\n */\ntypedef HRESULT __stdcall StackSnapshotCallback(\n                FunctionID funcId,\n                UINT_PTR ip,\n                COR_PRF_FRAME_INFO frameInfo,\n                ULONG32 contextSize,\n                BYTE context[],\n                void *clientData);\n\n/* Callback for each object reference */\ntypedef BOOL STDMETHODCALLTYPE ObjectReferenceCallback(ObjectID root, ObjectID* reference, void *clientData);\n\ntypedef enum\n{\n    // These flags represent classes of callback events\n    COR_PRF_MONITOR_NONE                = 0x00000000,\n\n    // MONITOR_FUNCTION_UNLOADS controls the\n    // FunctionUnloadStarted callback.\n    COR_PRF_MONITOR_FUNCTION_UNLOADS    = 0x00000001,\n\n    // MONITOR_CLASS_LOADS controls the ClassLoad*\n    // and ClassUnload* callbacks.\n    // See the comments on those callbacks for important\n    // behavior changes in V2.\n    COR_PRF_MONITOR_CLASS_LOADS         = 0x00000002,\n\n    // MONITOR_MODULE_LOADS controls the\n    // ModuleLoad*, ModuleUnload*, and ModuleAttachedToAssembly\n    // callbacks.\n    COR_PRF_MONITOR_MODULE_LOADS        = 0x00000004,\n\n    // MONITOR_ASSEMBLY_LOADS controls the\n    // AssemblyLoad* and AssemblyUnload* callbacks\n    COR_PRF_MONITOR_ASSEMBLY_LOADS      = 0x00000008,\n\n    // MONITOR_APPDOMAIN_LOADS controls the\n    // AppDomainCreation* and AppDomainShutdown* callbacks\n    COR_PRF_MONITOR_APPDOMAIN_LOADS     = 0x00000010,\n\n    // MONITOR_JIT_COMPILATION controls the\n    // JITCompilation*, JITFunctionPitched, and JITInlining\n    // callbacks.\n    COR_PRF_MONITOR_JIT_COMPILATION     = 0x00000020,\n\n\n    // MONITOR_EXCEPTIONS controls the ExceptionThrown,\n    // ExceptionSearch*, ExceptionOSHandler*, ExceptionUnwind*,\n    // and ExceptionCatcher* callbacks.\n    COR_PRF_MONITOR_EXCEPTIONS          = 0x00000040,\n\n    // MONITOR_GC controls the GarbageCollectionStarted/Finished,\n    // MovedReferences, SurvivingReferences,\n    // ObjectReferences, ObjectsAllocatedByClass,\n    // RootReferences*, HandleCreated/Destroyed, and FinalizeableObjectQueued\n    // callbacks.\n    COR_PRF_MONITOR_GC                  = 0x00000080,\n\n    // MONITOR_OBJECT_ALLOCATED controls the\n    // ObjectAllocated callback.\n    COR_PRF_MONITOR_OBJECT_ALLOCATED    = 0x00000100,\n\n    // MONITOR_THREADS controls the ThreadCreated,\n    // ThreadDestroyed, ThreadAssignedToOSThread,\n    // and ThreadNameChanged callbacks.\n    COR_PRF_MONITOR_THREADS             = 0x00000200,\n\n    // CORECLR DEPRECATION WARNING: Remoting no longer exists in coreclr\n    // MONITOR_REMOTING controls the Remoting*\n    // callbacks.\n    COR_PRF_MONITOR_REMOTING            = 0x00000400,\n\n    // MONITOR_CODE_TRANSITIONS controls the\n    // UnmanagedToManagedTransition and\n    // ManagedToUnmanagedTransition callbacks.\n    COR_PRF_MONITOR_CODE_TRANSITIONS    = 0x00000800,\n\n    // MONITOR_ENTERLEAVE controls the\n    // FunctionEnter*/Leave*/Tailcall* callbacks\n    COR_PRF_MONITOR_ENTERLEAVE          = 0x00001000,\n\n    // MONITOR_CCW controls the COMClassicVTable*\n    // callbacks.\n    COR_PRF_MONITOR_CCW                 = 0x00002000,\n\n    // CORECLR DEPRECATION WARNING: Remoting no longer exists in coreclr\n    // MONITOR_REMOTING_COOKIE controls whether\n    // a cookie will be passed to the Remoting* callbacks\n    COR_PRF_MONITOR_REMOTING_COOKIE     = 0x00004000 | COR_PRF_MONITOR_REMOTING,\n\n    // CORECLR DEPRECATION WARNING: Remoting no longer exists in coreclr\n    // MONITOR_REMOTING_ASYNC controls whether\n    // the Remoting* callbacks will monitor async events\n    COR_PRF_MONITOR_REMOTING_ASYNC      = 0x00008000 | COR_PRF_MONITOR_REMOTING,\n\n    // MONITOR_SUSPENDS controls the RuntimeSuspend*,\n    // RuntimeResume*, RuntimeThreadSuspended, and\n    // RuntimeThreadResumed callbacks.\n    COR_PRF_MONITOR_SUSPENDS            = 0x00010000,\n\n    // MONITOR_CACHE_SEARCHES controls the\n    // JITCachedFunctionSearch* callbacks.\n    // See the comments on those callbacks for important\n    // behavior changes in V2.\n    COR_PRF_MONITOR_CACHE_SEARCHES      = 0x00020000,\n\n    // NOTE: ReJIT is now supported again.  The profiler must set this flag on\n    // startup in order to use RequestReJIT or RequestRevert.  If the profiler specifies\n    // this flag, then the profiler must also specify COR_PRF_DISABLE_ALL_NGEN_IMAGES\n    COR_PRF_ENABLE_REJIT                = 0x00040000,\n\n    // V2 MIGRATION WARNING: DEPRECATED\n    // Inproc debugging is no longer supported. ENABLE_INPROC_DEBUGGING\n    // has no effect.\n    COR_PRF_ENABLE_INPROC_DEBUGGING     = 0x00080000,\n\n    // V2 MIGRATION NOTE: DEPRECATED\n    // The runtime now always tracks IL-native maps; this flag is thus always\n    // considered to be set.\n    COR_PRF_ENABLE_JIT_MAPS             = 0x00100000,\n\n    // DISABLE_INLINING tells the runtime to disable all inlining\n    COR_PRF_DISABLE_INLINING            = 0x00200000,\n\n    // DISABLE_OPTIMIZATIONS tells the runtime to disable all code optimizations\n    COR_PRF_DISABLE_OPTIMIZATIONS       = 0x00400000,\n\n    // ENABLE_OBJECT_ALLOCATED tells the runtime that the profiler may want\n    // object allocation notifications.  This must be set during initialization if the profiler\n    // ever wants object notifications (using COR_PRF_MONITOR_OBJECT_ALLOCATED)\n    COR_PRF_ENABLE_OBJECT_ALLOCATED     = 0x00800000,\n\n    // MONITOR_CLR_EXCEPTIONS controls the ExceptionCLRCatcher*\n    // callbacks.\n    COR_PRF_MONITOR_CLR_EXCEPTIONS      = 0x01000000,\n\n    // All callback events are enabled with this flag\n    COR_PRF_MONITOR_ALL                 = 0x0107FFFF,\n\n    // ENABLE_FUNCTION_ARGS enables argument tracing through FunctionEnter2.\n    COR_PRF_ENABLE_FUNCTION_ARGS        = 0X02000000,\n\n    // ENABLE_FUNCTION_RETVAL enables retval tracing through FunctionLeave2.\n    COR_PRF_ENABLE_FUNCTION_RETVAL      = 0X04000000,\n\n    // ENABLE_FRAME_INFO enables retrieval of exact ClassIDs for generic functions using\n    // GetFunctionInfo2 with a COR_PRF_FRAME_INFO obtained from FunctionEnter2.\n    COR_PRF_ENABLE_FRAME_INFO           = 0X08000000,\n\n    // ENABLE_STACK_SNAPSHOT enables the used of DoStackSnapshot calls.\n    COR_PRF_ENABLE_STACK_SNAPSHOT       = 0X10000000,\n\n    // USE_PROFILE_IMAGES causes the native image search to look for profiler-enhanced\n    // images.  If no profiler-enhanced image is found for a given assembly the\n    // runtime will fallback to JIT for that assembly.\n    COR_PRF_USE_PROFILE_IMAGES          = 0x20000000,\n\n    // COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST will disable security\n    // transparency checks normally done during JIT compilation and class loading for\n    // full trust assemblies. This can make some instrumentation easier to perform.\n    COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST\n                                        = 0x40000000,\n\n    // Prevents all NGEN images (including profiler-enhanced images) from loading.  If\n    // this and COR_PRF_USE_PROFILE_IMAGES are both specified,\n    // COR_PRF_DISABLE_ALL_NGEN_IMAGES wins.\n    COR_PRF_DISABLE_ALL_NGEN_IMAGES     = 0x80000000,\n\n    // The mask for valid mask bits\n    COR_PRF_ALL                         = 0x8FFFFFFF,\n\n    // COR_PRF_REQUIRE_PROFILE_IMAGE represents all flags that require profiler-enhanced\n    // images.\n    COR_PRF_REQUIRE_PROFILE_IMAGE       = COR_PRF_USE_PROFILE_IMAGES |\n                                          COR_PRF_MONITOR_CODE_TRANSITIONS |\n                                          COR_PRF_MONITOR_ENTERLEAVE,\n\n    COR_PRF_ALLOWABLE_AFTER_ATTACH      = COR_PRF_MONITOR_THREADS |\n                                          COR_PRF_MONITOR_MODULE_LOADS |\n                                          COR_PRF_MONITOR_ASSEMBLY_LOADS |\n                                          COR_PRF_MONITOR_APPDOMAIN_LOADS |\n                                          COR_PRF_ENABLE_STACK_SNAPSHOT |\n                                          COR_PRF_MONITOR_GC |\n                                          COR_PRF_MONITOR_SUSPENDS |\n                                          COR_PRF_MONITOR_CLASS_LOADS |\n                                          COR_PRF_MONITOR_EXCEPTIONS |\n                                          COR_PRF_MONITOR_JIT_COMPILATION |\n                                          COR_PRF_ENABLE_REJIT,\n\n    COR_PRF_ALLOWABLE_NOTIFICATION_PROFILER\n                                        =     COR_PRF_MONITOR_FUNCTION_UNLOADS |\n                                              COR_PRF_MONITOR_CLASS_LOADS |\n                                              COR_PRF_MONITOR_MODULE_LOADS |\n                                              COR_PRF_MONITOR_ASSEMBLY_LOADS |\n                                              COR_PRF_MONITOR_APPDOMAIN_LOADS |\n                                              COR_PRF_MONITOR_JIT_COMPILATION |\n                                              COR_PRF_MONITOR_EXCEPTIONS |\n                                              COR_PRF_MONITOR_OBJECT_ALLOCATED |\n                                              COR_PRF_MONITOR_THREADS |\n                                              COR_PRF_MONITOR_CODE_TRANSITIONS |\n                                              COR_PRF_MONITOR_CCW |\n                                              COR_PRF_MONITOR_SUSPENDS |\n                                              COR_PRF_MONITOR_CACHE_SEARCHES |\n                                              COR_PRF_DISABLE_INLINING |\n                                              COR_PRF_DISABLE_OPTIMIZATIONS |\n                                              COR_PRF_ENABLE_OBJECT_ALLOCATED |\n                                              COR_PRF_MONITOR_CLR_EXCEPTIONS |\n                                              COR_PRF_ENABLE_STACK_SNAPSHOT |\n                                              COR_PRF_USE_PROFILE_IMAGES |\n                                              COR_PRF_DISABLE_ALL_NGEN_IMAGES,\n\n    // MONITOR_IMMUTABLE represents all flags that may only be set during initialization.\n    // Trying to change any of these flags elsewhere will result in a\n    // failed HRESULT.\n    COR_PRF_MONITOR_IMMUTABLE           = COR_PRF_MONITOR_CODE_TRANSITIONS |\n                                          COR_PRF_MONITOR_REMOTING |\n                                          COR_PRF_MONITOR_REMOTING_COOKIE |\n                                          COR_PRF_MONITOR_REMOTING_ASYNC |\n                                          COR_PRF_ENABLE_INPROC_DEBUGGING |\n                                          COR_PRF_ENABLE_JIT_MAPS |\n                                          COR_PRF_DISABLE_OPTIMIZATIONS |\n                                          COR_PRF_DISABLE_INLINING |\n                                          COR_PRF_ENABLE_OBJECT_ALLOCATED |\n                                          COR_PRF_ENABLE_FUNCTION_ARGS |\n                                          COR_PRF_ENABLE_FUNCTION_RETVAL |\n                                          COR_PRF_ENABLE_FRAME_INFO |\n                                          COR_PRF_USE_PROFILE_IMAGES |\n                                          COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST |\n                                          COR_PRF_DISABLE_ALL_NGEN_IMAGES\n} COR_PRF_MONITOR;\n\n/*\n * Additional flags the profiler can specify via SetEventMask2 when loading\n */\ntypedef enum\n{\n    COR_PRF_HIGH_MONITOR_NONE                       = 0x00000000,\n\n    // CORECLR DEPRECATION WARNING: This flag is no longer checked by the runtime\n    COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES            = 0x00000001,\n\n    COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED          = 0x00000002,\n\n    COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS   = 0x00000004,\n\n    COR_PRF_HIGH_DISABLE_TIERED_COMPILATION         = 0x00000008,\n\n    COR_PRF_HIGH_BASIC_GC                           = 0x00000010,\n\n    // Enables the MovedReferences/MovedReferences2 callback for compacting GCs only.\n    COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS           = 0x00000020,\n\n    COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE              = 0,\n\n    // Enables the large object allocation monitoring according to the LOH threshold.\n    COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED      = 0x00000040,\n\n    COR_PRF_HIGH_MONITOR_EVENT_PIPE                 = 0x00000080,\n\n    // Enables the pinned object allocation monitoring.\n    COR_PRF_HIGH_MONITOR_PINNEDOBJECT_ALLOCATED     = 0x00000100,\n\n    COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH             = COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED |\n                                                      COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS |\n                                                      COR_PRF_HIGH_BASIC_GC |\n                                                      COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS |\n                                                      COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED |\n                                                      COR_PRF_HIGH_MONITOR_EVENT_PIPE,\n\n    COR_PRF_HIGH_ALLOWABLE_NOTIFICATION_PROFILER\n                                        =     COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED |\n                                              COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS |\n                                              COR_PRF_HIGH_DISABLE_TIERED_COMPILATION |\n                                              COR_PRF_HIGH_BASIC_GC |\n                                              COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS |\n                                              COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED |\n                                              COR_PRF_HIGH_MONITOR_EVENT_PIPE,\n\n    // MONITOR_IMMUTABLE represents all flags that may only be set during initialization.\n    // Trying to change any of these flags elsewhere will result in a\n    // failed HRESULT.\n    COR_PRF_HIGH_MONITOR_IMMUTABLE                  = COR_PRF_HIGH_DISABLE_TIERED_COMPILATION,\n\n} COR_PRF_HIGH_MONITOR;\n\n/*\n * COR_PRF_MISC contains miscellaneous constant ID's used for special\n * purposes.\n */\ntypedef enum\n{\n    // PROFILER_PARENT_UNKNOWN is the AssemblyID used by GetModuleInfo\n    // when a module has not yet been attached to an assembly.\n    PROFILER_PARENT_UNKNOWN             = 0xFFFFFFFD,\n\n    // PROFILER_GLOBAL_CLASS is a ClassID used for globals that belong to no class\n    PROFILER_GLOBAL_CLASS               = 0xFFFFFFFE,\n\n    // PROFILER_GLOBAL_MODULE is a ModuleID used for globals that belong\n    // to no module in particular\n    PROFILER_GLOBAL_MODULE              = 0xFFFFFFFF\n} COR_PRF_MISC;\n\n/*\n * COR_PRF_JIT_CACHE contains values used to express the result of a\n * cached function search. Note that FOUND is 0, and thus this is not truly\n * a boolean.\n */\ntypedef enum\n{\n    COR_PRF_CACHED_FUNCTION_FOUND,\n    COR_PRF_CACHED_FUNCTION_NOT_FOUND\n} COR_PRF_JIT_CACHE;\n\n/*\n * COR_PRF_TRANSITION_REASON contains values used to describe\n * the reason for a ManagedToUnmanaged or UnmanagedToManagedTransition\n * callback.\n */\ntypedef enum\n{\n    COR_PRF_TRANSITION_CALL,\n    COR_PRF_TRANSITION_RETURN\n} COR_PRF_TRANSITION_REASON;\n\n/*\n * COR_PRF_SUSPEND_REASON contains values used to describe the\n * reason for suspending the runtime. See the RuntimeSuspension*\n * callbacks for detailed descriptions of each.\n */\ntypedef enum\n{\n    COR_PRF_SUSPEND_OTHER                   = 0,\n    COR_PRF_SUSPEND_FOR_GC                  = 1,\n    COR_PRF_SUSPEND_FOR_APPDOMAIN_SHUTDOWN  = 2,\n    COR_PRF_SUSPEND_FOR_CODE_PITCHING       = 3,\n    COR_PRF_SUSPEND_FOR_SHUTDOWN            = 4,\n    COR_PRF_SUSPEND_FOR_INPROC_DEBUGGER     = 6,\n    COR_PRF_SUSPEND_FOR_GC_PREP             = 7,\n    COR_PRF_SUSPEND_FOR_REJIT               = 8,\n    COR_PRF_SUSPEND_FOR_PROFILER            = 9,\n} COR_PRF_SUSPEND_REASON;\n\n/*\n * COR_PRF_RUNTIME_TYPE contains values used to indicate the\n * type of runtime.\n */\ntypedef enum\n{\n    COR_PRF_DESKTOP_CLR = 0x1,\n    COR_PRF_CORE_CLR    = 0x2,\n} COR_PRF_RUNTIME_TYPE;\n\n/*\n * COR_PRF_REJIT_FLAGS contains values used to control the behavior of\n * RequestReJITWithInliners.\n */\ntypedef enum\n{\n    // ReJITted methods will be prevented from being inlined\n    COR_PRF_REJIT_BLOCK_INLINING = 0x1,\n\n    // This flag controls whether the runtime will call GetReJITParameters\n    // on methods that are ReJITted because they inline a method that was requested\n    // for ReJIT\n    COR_PRF_REJIT_INLINING_CALLBACKS    = 0x2\n} COR_PRF_REJIT_FLAGS;\n\ntypedef UINT_PTR EVENTPIPE_PROVIDER;\ntypedef UINT_PTR EVENTPIPE_EVENT;\ntypedef UINT64   EVENTPIPE_SESSION;\n\ntypedef enum\n{\n    COR_PRF_EVENTPIPE_OBJECT = 1,         // Instance that isn't a value\n    COR_PRF_EVENTPIPE_BOOLEAN = 3,        // Boolean\n    COR_PRF_EVENTPIPE_CHAR = 4,           // Unicode character\n    COR_PRF_EVENTPIPE_SBYTE = 5,          // Signed 8-bit integer\n    COR_PRF_EVENTPIPE_BYTE = 6,           // Unsigned 8-bit integer\n    COR_PRF_EVENTPIPE_INT16 = 7,          // Signed 16-bit integer\n    COR_PRF_EVENTPIPE_UINT16 = 8,         // Unsigned 16-bit integer\n    COR_PRF_EVENTPIPE_INT32 = 9,          // Signed 32-bit integer\n    COR_PRF_EVENTPIPE_UINT32 = 10,        // Unsigned 32-bit integer\n    COR_PRF_EVENTPIPE_INT64 = 11,         // Signed 64-bit integer\n    COR_PRF_EVENTPIPE_UINT64 = 12,        // Unsigned 64-bit integer\n    COR_PRF_EVENTPIPE_SINGLE = 13,        // IEEE 32-bit float\n    COR_PRF_EVENTPIPE_DOUBLE = 14,        // IEEE 64-bit double\n    COR_PRF_EVENTPIPE_DECIMAL = 15,       // Decimal\n    COR_PRF_EVENTPIPE_DATETIME = 16,      // DateTime\n    COR_PRF_EVENTPIPE_GUID = 17,          // Guid\n    COR_PRF_EVENTPIPE_STRING = 18,        // Unicode character string\n    COR_PRF_EVENTPIPE_ARRAY = 19,         // Arbitrary length array\n} COR_PRF_EVENTPIPE_PARAM_TYPE;\n\ntypedef enum\n{\n    COR_PRF_EVENTPIPE_LOGALWAYS = 0,\n    COR_PRF_EVENTPIPE_CRITICAL = 1,\n    COR_PRF_EVENTPIPE_ERROR = 2,\n    COR_PRF_EVENTPIPE_WARNING = 3,\n    COR_PRF_EVENTPIPE_INFORMATIONAL = 4,\n    COR_PRF_EVENTPIPE_VERBOSE = 5\n} COR_PRF_EVENTPIPE_LEVEL;\n\ntypedef struct\n{\n    const WCHAR* providerName;\n    UINT64       keywords;\n    UINT32       loggingLevel;\n    // filterData expects a semicolon delimited string that defines key value pairs\n    // such as \"key1=value1;key2=value2;\". Quotes can be used to escape the '=' and ';'\n    // characters. These key value pairs will be passed in the enable callback to event\n    // providers\n    const WCHAR* filterData;\n} COR_PRF_EVENTPIPE_PROVIDER_CONFIG;\n\ntypedef struct\n{\n    UINT32       type;\n    // Used if type == ArrayType\n    UINT32       elementType;\n    const WCHAR *name;\n} COR_PRF_EVENTPIPE_PARAM_DESC;\n\ntypedef struct\n{\n    UINT64 ptr;\n    UINT32 size;\n    UINT32 reserved;\n} COR_PRF_EVENT_DATA;\n\ntypedef enum _COR_PRF_HANDLE_TYPE\n{\n    COR_PRF_HANDLE_TYPE_WEAK    = 0x1,\n    COR_PRF_HANDLE_TYPE_STRONG  = 0x2,\n    COR_PRF_HANDLE_TYPE_PINNED  = 0x3,\n} COR_PRF_HANDLE_TYPE;\n\ntypedef void** ObjectHandleID;\n\n/* -------------------------------------------------------------------------- *\n * Forward declarations\n * -------------------------------------------------------------------------- */\n\ninterface ICorProfilerCallback;\ninterface ICorProfilerCallback2;\ninterface ICorProfilerCallback3;\ninterface ICorProfilerCallback4;\ninterface ICorProfilerInfo;\ninterface ICorProfilerInfo2;\ninterface ICorProfilerInfo3;\ninterface ICorProfilerInfo4;\ninterface ICorProfilerObjectEnum;\ninterface ICorProfilerFunctionEnum;\ninterface ICorProfilerModuleEnum;\ninterface ICorProfilerThreadEnum;\ninterface ICorProfilerMethodEnum;\ninterface IMethodMalloc;\ninterface ICorProfilerFunctionControl;\ninterface ICorProfilerAssemblyReferenceProvider;\n/* -------------------------------------------------------------------------- *\n * User Callback interface\n * -------------------------------------------------------------------------- */\n\n/*\n * The ICorProfilerCallback interface is used by the CLR to notify a\n * code profiler when events have occurred that the code profiler has registered\n * an in interest in receiving. This is the primary callback interface through\n * which the CLR communicates with the code profiler. A code profiler\n * must register this callback interface in the Win32 registry. This object has\n * several methods that receive notification from the runtime when an event is\n * about to occur in an executing runtime process.\n *\n * The methods implemented on this interface return S_OK on success, or E_FAIL\n * on failure.\n */\n\n[\n    object,\n    uuid(176FBED1-A55C-4796-98CA-A9DA0EF883E7),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback : IUnknown\n{\n\n    /*\n     *\n     * STARTUP/SHUTDOWN EVENTS\n     *\n     */\n\n    /*\n     * The CLR calls Initialize to setup the code profiler\n     * whenever a new CLR application is started. The call provides\n     * an IUnknown interface pointer that should be QI'd for an ICorProfilerInfo\n     * interface pointer.\n     *\n     * NOTE: this is the only opportunity to enable callbacks that are a part\n     * of COR_PRF_MONITOR_IMMUTABLE, since they can no longer be changed after\n     * returning from this function.  This is done through SetEventMask on the\n     * ICorProfilerInfo object.\n     */\n    HRESULT Initialize(\n                [in] IUnknown     *pICorProfilerInfoUnk);\n\n    /*\n     * The CLR calls Shutdown to notify the code profiler that\n     * the application is exiting.  This is the profiler's last opportunity to\n     * safely call functions on the ICorProfilerInfo interface.  After returning\n     * from this function the runtime will proceed to unravel its internal data\n     * structures and any calls to ICorProfilerInfo are undefined in their\n     * behaviour.\n     *\n     * NOTE: Certain IMMUTABLE events may still occur after Shutdown.\n     *\n     * NOTE: Shutdown will only fire where the managed application that is being\n     * profiled was started running managed code (i.e., the initial frame on the\n     * process' stack is managed).  If the application being profiled started\n     * life as unmanaged code, which later 'jumped into' managed code (thereby\n     * creating an instance of the CLR), then Shutdown will not fire.  In these\n     * cases, the profiler should include a DllMain routine in their library that\n     * uses Win32's DLL_PROCESS_DETACH call to free any resources and perform tidy-up\n     * processing of its data (flush traces to disk, etc)\n     *\n     * NOTE: The profiler must in general cope with unexpected shutdowns, such as\n     * when the process is \"killed\" by Win32's TerminateProcess.\n     *\n     * NOTE: Sometimes the CLR will violently kill certain managed threads\n     * (background threads) without delivering orderly destruction messages for them.\n     */\n    HRESULT Shutdown();\n\n\n    /*\n     *\n     * APPLICATION DOMAIN EVENTS\n     *\n     */\n\n    /*\n     * Called when an application domain creation has begun and ended.\n     * The ID is not valid for any information request until the Finished\n     * event is called.\n     *\n     * Some parts of app domain loading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of app domain creation succeeded.\n     */\n    HRESULT AppDomainCreationStarted(\n                [in] AppDomainID appDomainId);\n\n    HRESULT AppDomainCreationFinished(\n                [in] AppDomainID appDomainId,\n                [in] HRESULT     hrStatus);\n\n    /*\n     * Called before and after an app domain is unloaded from a process.\n     * The ID is no longer valid after the Started event returns.\n     *\n     * Some parts of app domain unloading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of app domain unloading succeeded.\n     */\n    HRESULT AppDomainShutdownStarted(\n                [in] AppDomainID appDomainId);\n\n    HRESULT AppDomainShutdownFinished(\n                [in] AppDomainID appDomainId,\n                [in] HRESULT     hrStatus);\n\n    /*\n     *\n     * ASSEMBLY EVENTS\n     *\n     */\n\n    /*\n     * Called when an Assembly load has begun and ended. The ID is not valid\n     * for any information request until the Finished event is called.\n     *\n     * Some parts of assembly loading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of assembly loading succeeded.\n     */\n    HRESULT AssemblyLoadStarted(\n                [in] AssemblyID assemblyId);\n\n    HRESULT AssemblyLoadFinished(\n                [in] AssemblyID assemblyId,\n                [in] HRESULT    hrStatus);\n\n    /*\n     * Called before and after an assembly is unloaded.\n     * The ID is no longer valid after the Started event returns.\n     *\n     * Some parts of assembly unloading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of assembly unloading succeeded.\n     */\n    HRESULT AssemblyUnloadStarted(\n                [in] AssemblyID assemblyId);\n\n    HRESULT AssemblyUnloadFinished(\n                [in] AssemblyID assemblyId,\n                [in] HRESULT    hrStatus);\n\n\n    /*\n     *\n     * MODULE EVENTS\n     *\n     */\n\n    /*\n     * Called when a module load has begun and ended. The ID is not valid\n     * for any information request until the Finished event is called.\n     *\n     * Some parts of module loading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of module loading succeeded.\n     *\n     * Note that when a module load is reported as finished this indicates\n     * that the load has completed but it has not yet returned to the caller.\n     * This is the opportunity for the profiler to note that other notifications regarding\n     * this module may start coming afterwards however internal safeguards\n     * protecting the runtime from recursive loading are still present and so it is\n     * a bad time to begin inquiries on this module.  The notification is informational\n     * only.\n     *\n     * Note: ModuleLoadFinished is a reasonable time to interrogate MetaData via API's\n     * like GetModuleMetadata, however APIs that create (e.g. ClassID's and FunctionID's)\n     * are not safe to use here.  Profiler writers are advised to stay in the universe of\n     * tokens.\n     *\n     */\n    HRESULT ModuleLoadStarted(\n                [in] ModuleID moduleId);\n\n    HRESULT ModuleLoadFinished(\n                [in] ModuleID moduleId,\n                [in] HRESULT  hrStatus);\n\n    /*\n     * Called before and after a module is unloaded.\n     * The ID is no longer valid after the Started event returns.\n     *\n     * Some parts of module unloading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of module unloading succeeded.\n     */\n    HRESULT ModuleUnloadStarted(\n                [in] ModuleID moduleId);\n\n    HRESULT ModuleUnloadFinished(\n                [in] ModuleID moduleId,\n                [in] HRESULT  hrStatus);\n\n    /*\n     * A module can get loaded through legacy means (ie: IAT or LoadLibrary) or\n     * through a metadata reference.  The CLR loader therefore has many code\n     * paths for determining what assembly a module lives in.  It is therefore\n     * possible that after a ModuleLoadFinished event, the module does not\n     * know what assembly it is in and getting the parent AssemblyID is not possible.\n     * This event is fired when the module is officially attached to its parent\n     * assembly.  Calling GetModuleInfo after this function is called will return the\n     * proper parent assembly.\n     */\n    HRESULT ModuleAttachedToAssembly(\n                [in] ModuleID   moduleId,\n                [in] AssemblyID AssemblyId);\n\n\n    /*\n     *\n     *  CLASS EVENTS\n     *\n     */\n\n    /*\n     * Called when a class load has begun and ended. The ID is not valid\n     * for any information request until the Finished event is called.\n     *\n     * Some parts of class loading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of class loading succeeded.\n     *\n     * Note that when a class load is reported as finished this indicates\n     * that the load has completed but it has not yet returned to the caller.\n     * This is the opportunity for the profiler to note that other notifications regarding\n     * this class may start coming afterwards however internal safeguards\n     * protecting the runtime from recursive loading are still present and so it is\n     * a bad time to begin inquiries on this class.  The notification is informational\n     * only.\n     *\n     */\n    HRESULT ClassLoadStarted(\n                [in] ClassID classId);\n\n    HRESULT ClassLoadFinished(\n                [in] ClassID classId,\n                [in] HRESULT hrStatus);\n\n    /*\n     * Called before and after a class is unloaded.\n     * The ID is no longer valid after the Started event returns.\n     *\n     * Some parts of class unloading may take place lazily at some time\n     * after the Finished callback. Therefore, while a failure HRESULT in\n     * hrStatus definitely indicates a failure, a success HRESULT only indicates\n     * that the first part of class unloading succeeded.\n     */\n    HRESULT ClassUnloadStarted(\n                [in] ClassID classId);\n\n    HRESULT ClassUnloadFinished(\n                [in] ClassID classId,\n                [in] HRESULT hrStatus);\n\n    /*\n     *\n     * JIT EVENTS\n     *\n     */\n\n    /*\n     * The CLR calls FunctionUnloadStarted to notify the code\n     * profiler that a function is being unloaded.  After returning from this\n     * call, the FunctionID is no longer valid.\n     */\n    HRESULT FunctionUnloadStarted(\n                [in] FunctionID functionId);\n\n\n    /*\n     * The CLR calls JITCompilationStarted to notify the code\n     * profiler that the JIT compiler is starting to compile a function.\n     *\n     * The fIsSafeToBlock argument tells the profiler whether or not blocking\n     * will affect the operation of the runtime.  If true, blocking may cause\n     * the runtime to wait for the calling thread to return from this callback.\n     * Although this will not harm the runtime, it will skew the profiling\n     * results.\n     *\n     * NOTE: It is possible to receive more than one JITCompilationStarted/\n     * JITCompilationFinished pair for each method.  This is because of how\n     * the runtime handles class constructors: method A starts to be JIT'd,\n     * then realizes that the class ctor for class B needs to be run, so\n     * JIT's it and runs it, and while it's running makes a call to original\n     * method A, which causes it to be JIT'd again, and causes the original\n     * (incomplete) JIT'ing of A to be aborted.  However, both attempts to\n     * JIT A are reported with JIT compilation events.  If the profiler is\n     * going to replace IL code for this method with SetILFunctionBody, then\n     * it must do so for both JITCompilationStarted events, but may use the\n     * same IL block for both.\n     *\n     * NOTE: A profiler should be tolerant of the sequence of JIT callbacks\n     * received in cases where two threads are simultaneously calling a\n     * method.  For example, thread A receives JITCompilationStarted.\n     * But before thread A receives JITCompilationFinished, thread B\n     * receives FunctionEnter with the functionId from thread A's\n     * JITCompilationStarted callback.  It may appear that functionId should\n     * not yet be valid because JITCompilationFinished had not yet been\n     * received.  But it is indeed valid in such a case.\n     */\n    HRESULT JITCompilationStarted(\n                [in] FunctionID functionId,\n                [in] BOOL       fIsSafeToBlock);\n\n    /*\n     * The CLR calls JITCompilationFinished to notify the code\n     * profiler that the JIT compiler has finished compiling a function.\n     *\n     * The fIsSafeToBlock argument tells the profiler whether or not blocking\n     * will affect the operation of the runtime.  If true, blocking may cause\n     * the runtime to wait for the calling thread to return from this callback.\n     * Although this will not harm the runtime, it will skew the profiling\n     * results.\n     *\n     * The FunctionID is now valid in ICorProfilerInfo APIs.\n     *\n     * The hrStatus provides the success or failure of the operation\n     */\n    HRESULT JITCompilationFinished(\n                [in] FunctionID functionId,\n                [in] HRESULT    hrStatus,\n                [in] BOOL       fIsSafeToBlock);\n\n    /*\n     * V2 MIGRATION WARNING: DOES NOT ALWAYS OCCUR\n     * The JITCachedFunctionSearchStarted/Finished callbacks\n     * will now occur only for some functions in regular NGEN images;\n     * only profiler-optimized NGEN images will generate callbacks for\n     * all functions in the image. Profilers which do not use these callbacks\n     * to force a function to be JIT-compiled should move to using a lazy\n     * strategy for gathering function information.\n     *\n     * This notifies the profiler when a search for a prejitted function is\n     * starting.\n     *\n     *    functionId: the function for which the search is being performed.\n     *    bUseCachedFunction: if true, the EE uses the cached function (if applicable)\n     *                        if false, the EE jits the function instead of\n     *                        using a pre-jitted version.\n     *\n     * NOTE: Profilers should be tolerant of cases where multiple threads of\n     * a profiled app are calling the same method simultaneously.  For example,\n     * thread A may receive JITCachedFunctionSearchStarted (and the\n     * profiler sets *pbUseCachedFunction=FALSE to force a JIT), thread A\n     * then receives JITCompilationStarted/JITCompilationFinished, then\n     * thread B receives another JITCachedFunctionSearchStarted for the same\n     * method.  It might appear odd to receive this final callback, since the\n     * profiler already stated its intention to JIT the method.  But this is\n     * occurring because the CLR in thread B decided to send this callback\n     * before thread A responded to JITCachedFunctionSearchStarted\n     * with *pbUseCachedFunction=FALSE, and the thread B callback\n     * hadn't actually been sent until now due how the threads\n     * happened to be scheduled.  In such cases where the profiler\n     * receives duplicate JITCachedFunctionSearchStarted callbacks for\n     * the same functionId, the profiler should be certain to set\n     * *pbUseCachedFunction to the same value from this callback\n     * when it is called multiple times with the same functionId.\n     */\n    HRESULT JITCachedFunctionSearchStarted(\n                [in] FunctionID functionId,\n                [out] BOOL      *pbUseCachedFunction);\n\n    /*\n     * V2 MIGRATION WARNING: DOES NOT ALWAYS OCCUR\n     * The JITCachedFunctionSearchStarted/Finished callbacks\n     * will now occur only for some functions in regular NGEN images;\n     * only profiler-optimized NGEN images will generate callbacks for\n     * all functions in the image. Profilers which do not use these callbacks\n     * to force a function to be JIT-compiled should move to using a lazy\n     * strategy for gathering function information.\n     *\n     * This notifies the profiler when a search for a cached function has been\n     * performed.\n     *\n     *    functionId: the function for which the search has been performed.\n     *    result: the result of the search.  There are two possible results:\n     *        COR_PRF_CACHED_FUNCTION_FOUND\n     *        COR_PRF_CACHED_FUNCTION_NOT_FOUND\n     *\n     */\n    HRESULT JITCachedFunctionSearchFinished(\n                [in] FunctionID        functionId,\n                [in] COR_PRF_JIT_CACHE result);\n\n    /*\n     * The CLR calls JITFunctionPitched to notify the profiler\n     * that a jitted function was removed from memory.  If the pitched\n     * function is called in the future, the profiler will receive new\n     * JIT compilation events as it is re-jitted.\n     *\n     * Currently the CLR JIT does not pitch functions, so this callback\n     * will not be received.\n     *\n     * NOTE: the FunctionID is not valid until it is re-jitted.  When it is\n     * re-jitted, it will use the same FunctionID value.\n     */\n    HRESULT JITFunctionPitched(\n                [in] FunctionID functionId);\n\n    /*\n     * The CLR calls JITInlining to notify the profiler that the jitter\n     * is about to inline calleeId into callerId.  Set pfShouldInline to FALSE\n     * to prevent the callee from being inlined into the caller, and set to\n     * TRUE to allow the inline to occur.\n     *\n     * NOTE: Inlined functions do not provide Enter/Leave events, so if you desire\n     *       an accurate callgraph, you should set FALSE.  Be aware that\n     *       setting FALSE will affect performance, since inlining typically\n     *       increases speed and reduces separate jitting events for the inlined\n     *       method.\n     *\n     * NOTE: It is also possible to globally disable inlining by setting the\n     *       COR_PRF_DISABLE_INLINING flag.\n     */\n    HRESULT JITInlining(\n                [in] FunctionID callerId,\n                [in] FunctionID calleeId,\n                [out] BOOL      *pfShouldInline);\n\n    /*\n     *\n     * THREAD EVENTS\n     *\n     */\n\n    /*\n     * The CLR calls ThreadCreated to notify the code profiler\n     * that a thread has been created.  The ThreadID is valid immediately.\n     */\n    HRESULT ThreadCreated(\n                [in] ThreadID threadId);\n\n    /*\n     * The CLR calls ThreadDestroyed to notify the code profiler\n     * that a thread has been destroyed.  The ThreadID is no longer valid\n     * at the time of this call.\n     */\n    HRESULT ThreadDestroyed(\n                [in] ThreadID threadId);\n\n    /*\n     * The CLR calls ThreadAssignedToOSThread to tell the profiler\n     * that a managed thread is being implemented via a particular OS thread.\n     * This callback exists so that the profiler can maintain an accurate\n     * OS to Managed thread mapping across fibres.\n     */\n    HRESULT ThreadAssignedToOSThread(\n                [in] ThreadID managedThreadId,\n                [in] DWORD    osThreadId);\n\n    /*\n     *\n     * REMOTING EVENTS\n     *\n     */\n\n    //\n    // Client-side events\n    //\n\n    /*\n     * NOTE: each of the following pairs of callbacks will occur on the same\n     *       thread\n     *   RemotingClientInvocationStarted  & RemotingClientSendingMessage\n     *   RemotingClientReceivingReply     & RemotingClientInvocationFinished\n     *   RemotingServerInvocationReturned & RemotingServerSendingReply\n     *\n     * There are a few issues with the remoting callbacks that should be outlined.\n     * First, remoting function execution is not reflected by the profiler API, so\n     * the notifications for functions that are called from the client and executed\n     * to the server are not properly received. The actual invocation happens via a\n     * proxy object. That creates the illusion to the profiler that certain\n     * functions get jit-compiled but they never get used. Second, the profiler does\n     * not receive accurate notifications for asynchronous remoting events.\n     */\n\n    /*\n     * The CLR calls RemotingClientInvocationStarted to notify the profiler that\n     * a remoting call has begun.  This event is the same for synchronous and\n     * asynchronous calls.\n     */\n    HRESULT RemotingClientInvocationStarted();\n\n    /*\n     * The CLR calls RemotingClientSendingMessage to notify the profiler that\n     * a remoting call is requiring the caller to send an invocation request through\n     * a remoting channel.\n     *\n     * pCookie  - if remoting GUID cookies are active, this value will correspond with the\n     *            the value provided in RemotingServerReceivingMessage, if the channel\n     *            succeeds in transmitting the message, and if GUID cookies are active on\n     *            the server-side process.  This allows easy pairing of remoting calls,\n     *            and the creation of a logical call stack.\n     * fIsAsync - is true if the call is asynchronous.\n     */\n    HRESULT RemotingClientSendingMessage(\n                [in] GUID *pCookie,\n                [in] BOOL fIsAsync);\n\n    /*\n     * The CLR calls RemotingClientReceivingReply to notify the profiler that\n     * the server-side portion of a remoting call has completed and that the client is\n     * now receiving and about to process the reply.\n     *\n     * pCookie  - if remoting GUID cookies are active, this value will correspond with the\n     *            the value provided in RemotingServerSendingReply, if the channel\n     *            succeeds in transmitting the message, and if GUID cookies are active on\n     *            the server-side process.  This allows easy pairing of remoting calls.\n     * fIsAsync - is true if the call is asynchronous.\n     */\n    HRESULT RemotingClientReceivingReply(\n                [in] GUID *pCookie,\n                [in] BOOL fIsAsync);\n\n    /*\n     * The CLR calls RemotingClientInvocationFinished to notify the profiler that\n     * a remoting invocation has run to completion on the client side.  If the call was\n     * synchronous, this means that it has also run to completion on the server side.  If\n     * the call was asynchronous, a reply may still be expected when the call is handled.\n     * If the call is asynchronous, and a reply is expected, then the reply will occur in\n     * the form of a call to RemotingClientReceivingReply and an additional call to\n     * RemotingClientInvocationFinished to indicate the required secondary processing of\n     * an asynchronous call.\n     */\n    HRESULT RemotingClientInvocationFinished();\n\n    //\n    // Server-side events\n    //\n\n    /*\n     * The CLR calls RemotingServerReceivingMessage to notify the profiler that\n     * the process has received a remote method invocation (or activation) request.  If\n     * the message request is asynchronous, then the request may be serviced by any\n     * arbitrary thread.\n     *\n     * pCookie  - if remoting GUID cookies are active, this value will correspond with the\n     *            the value provided in RemotingClientSendingMessage, if the channel\n     *            succeeds in transmitting the message, and if GUID cookies are active on\n     *            the client-side process.  This allows easy pairing of remoting calls.\n     * fIsAsync - is true if the call is asynchronous.\n     */\n    HRESULT RemotingServerReceivingMessage(\n                [in] GUID *pCookie,\n                [in] BOOL fIsAsync);\n\n    /*\n     * The CLR calls RemotingServerInvocationStarted to notify the profiler that\n     * the process is invoking a method due to a remote method invocation request.\n     */\n    HRESULT RemotingServerInvocationStarted();\n\n    /*\n     * The CLR calls RemotingServerInvocationReturned to notify the profiler that\n     * the process has finished invoking a method due to a remote method invocation request.\n     */\n    HRESULT RemotingServerInvocationReturned();\n\n    /*\n     * The CLR calls RemotingServerSendingReply to notify the profiler that\n     * the process has finished processing a remote method invocation request and is\n     * about to transmit the reply through a channel.\n     *\n     * pCookie  - if remoting GUID cookies are active, this value will correspond with the\n     *            the value provided in RemotingClientReceivingReply, if the channel\n     *            succeeds in transmitting the message, and if GUID cookies are active on\n     *            the client-side process.  This allows easy pairing of remoting calls.\n     * fIsAsync - is true if the call is asynchronous.\n     */\n    HRESULT RemotingServerSendingReply(\n                [in] GUID *pCookie,\n                [in] BOOL fIsAsync);\n\n    /*\n     *\n     * TRANSITION EVENTS\n     *\n     */\n\n    /*\n     * The CLR calls UnmanagedToManagedTransition to notify the\n     * code profiler that a transition from unmanaged code to managed code has\n     * occurred. functionId is always the ID of the callee, and reason\n     * indicates whether the transition was due to a call into managed code from\n     * unmanaged, or a return from an unmanaged function called by a managed one.\n     *\n     * Note that if the reason is COR_PRF_TRANSITION_RETURN and the functionId is\n     * non-NULL, then the functionId is that of the unmanaged function, and will\n     * never have been jitted. Unmanaged functions still have some basic\n     * information associated with them, such as a name, and some metadata.\n     *\n     * Note that if the reason is COR_PRF_TRANSITION_RETURN and the callee was\n     * a PInvoke call indirect, then the runtime does not know the destination\n     * of the call and functionId will be NULL.\n     *\n     * Note that if the reason is COR_PRF_TRANSITION_CALL then it may be possible\n     * that the callee has not yet been JIT-compiled.\n     */\n    HRESULT UnmanagedToManagedTransition(\n                [in] FunctionID                functionId,\n                [in] COR_PRF_TRANSITION_REASON reason);\n\n\n    /*\n     * The CLR calls ManagedToUnmanagedTransition to notify the\n     * code profiler that a transition from managed code to unmanaged code has\n     * occurred. functionId is always the ID of the callee, and reason\n     * indicates whether the transition was due to a call into unmanaged code from\n     * managed, or a return from an managed function called by an unmanaged one.\n     *\n     * Note that if the reason is COR_PRF_TRANSITION_CALL, then the functionId\n     * is that of the unmanaged function, and will never have been jitted.\n     * Unmanaged functions still have some basic information associated with\n     * them, such as a name, and some metadata.\n     *\n     * Note that if the reason is COR_PRF_TRANSITION_CALL and the callee is\n     * a PInvoke call indirect, then the runtime does not know the destination\n     * of the call and functionId will be NULL.\n     */\n    HRESULT ManagedToUnmanagedTransition(\n                [in] FunctionID                functionId,\n                [in] COR_PRF_TRANSITION_REASON reason);\n\n\n    /*\n     *\n     * RUNTIME SUSPENSION EVENTS\n     *\n     */\n\n    /*\n     * The CLR calls RuntimeSuspendStarted to notify the code profiler\n     * that the runtime is about to suspend all of the runtime threads.\n     * All runtime threads that are in unmanaged code are permitted to continue\n     * running until they try to re-enter the runtime, at which point they will\n     * also suspend until the runtime resumes.  This also applies to new threads\n     * that enter the runtime.  All threads within the runtime are either\n     * suspended immediately if they are in interruptible code, or asked to\n     * suspend when they do reach interruptible code.\n     *\n     * suspendReason make be any of the following values:\n     *  COR_PRF_SUSPEND_FOR_GC\n     *      the runtime is suspending to service a GC request.  The GC-related\n     *      callbacks will occur between the RuntimeSuspendFinished and\n     *      RuntimeResumeStarted events.\n     *  COR_PRF_SUSPEND_FOR_CODE_PITCHING\n     *      the runtime is suspending so that code pitching may occur.  This\n     *      only occurs when the EJit is active with code pitching enabled.\n     *      Code pitching callbacks will occur between the\n     *      RuntimeSuspendFinished and RuntimeResumeStarted events.\n     *  COR_PRF_SUSPEND_FOR_APPDOMAIN_SHUTDOWN\n     *      the runtime is suspending so that an AppDomain can be shut down.\n     *      While the runtime is suspended, the runtime will determine which\n     *      threads are in the AppDomain that is being shut down, set them to\n     *      abort when they resume, and then resumes the runtime.  There are\n     *      no AppDomain-specific callbacks during this suspension.\n     *  COR_PRF_SUSPEND_FOR_SHUTDOWN\n     *      the runtime is shutting down, and it must suspend all threads to\n     *      complete the operation.\n     *  COR_PRF_SUSPEND_FOR_GC_PREP\n     *      the runtime is preparing for a GC.\n     *  COR_PRF_SUSPEND_FOR_INPROC_DEBUGGER\n     *      the runtime is suspending for in-process debugging.\n     *  COR_PRF_SUSPEND_FOR_PROFILER\n     *      the runtime is suspending because of ICorProfilerInfo10::SuspendRuntime.\n     *  COR_PRF_SUSPEND_OTHER\n     *      the runtime is suspending for a reason other than those above.\n     */\n    HRESULT RuntimeSuspendStarted(\n            [in] COR_PRF_SUSPEND_REASON suspendReason);\n\n    /*\n     * The CLR calls RuntimeSuspendFinished to notify the code profiler\n     * that the runtime has suspended all threads needed for a runtime\n     * suspension.  Note that not all runtime threads are required to be\n     * suspended, as described in the comment for RuntimeSuspendStarted.\n     *\n     * NOTE: It is guaranteed that this event will occur on the same ThreadID\n     * as RuntimeSuspendStarted occurred on.\n     */\n    HRESULT RuntimeSuspendFinished();\n\n    /*\n     * The CLR calls RuntimeSuspendAborted to notify the code profiler\n     * that the runtime is aborting the runtime suspension that was occurring.\n     * This may occur if two threads simultaneously attempt to suspend the\n     * runtime.\n     *\n     * NOTE: It is guaranteed that this event will occur on the same ThreadID\n     * as the RuntimeSuspendStarted occurred on, and that only one of\n     * RuntimeSuspendFinished and RuntimeSuspendAborted may occur on a single\n     * thread following a RuntimeSuspendStarted event.\n     */\n    HRESULT RuntimeSuspendAborted();\n\n    /*\n     * The CLR calls RuntimeResumeStarted to notify the code profiler\n     * that the runtime is about to resume all of the runtime threads.\n     */\n    HRESULT RuntimeResumeStarted();\n\n    /*\n     * The CLR calls RuntimeResumeFinished to notify the code profiler\n     * that the runtime has finished resuming all of it's threads and is now\n     * back in normal operation.\n     *\n     * NOTE: It is *NOT* guaranteed that this event will occur on the same\n     * ThreadID as the RuntimeSuspendStarted occurred on, but is guaranteed\n     * to occur on the same ThreadID as the RuntimeResumeStarted occurred on.\n     */\n    HRESULT RuntimeResumeFinished();\n\n    /*\n     * The CLR calls RuntimeThreadSuspended to notify the code profiler\n     * that a particular thread has been suspended.\n     *\n     * This notification may occur any time between the RuntimeSuspendStarted\n     * and the associated RuntimeResumeStarted. Notifications that occur\n     * between RuntimeSuspendFinished and RuntimeResumeStarted are for\n     * threads that had been running in unmanaged code and were suspended\n     * upon entry to the runtime.\n     */\n    HRESULT RuntimeThreadSuspended(\n                    [in] ThreadID threadId);\n\n    /*\n     * The CLR calls RuntimeThreadResumed to notify the code profiler\n     * that a particular thread has been resumed after being suspended due to\n     * a runtime suspension.\n     */\n    HRESULT RuntimeThreadResumed(\n                    [in] ThreadID threadId);\n\n    /*\n     *\n     * GC EVENTS\n     *\n     * NOTE: All of these callbacks (except ObjectAllocated) are made while the\n     *       runtime is suspended, so none of the ObjectID values can change until\n     *       the runtime resumes and another GC occurs.\n     *\n     * NOTE: The profiler will receive GC-related events (except ObjectAllocated)\n     *       when the profiler has been suspended for COR_PRF_SUSPEND_FOR_GC *except*\n     *       for one special case.  When the runtime is shutting down, there is a\n     *       stage where it is suspended for COR_PRF_SUSPEND_FOR_SHUTDOWN reason and\n     *       is never resumed.  But after this suspension a garbage collection may\n     *       occur without a COR_PRF_SUSPEND_FOR_GC suspension notification, and\n     *       the profiler will thus receive GC-related callbacks.\n     *\n     * NOTE: All of these callbacks (except ObjectAllocated) may be called more than\n     *       once during the same GC. These calls should be considered multiple parts of\n     *       one long report; the profiler should simply aggregate the information provided\n     *       in all of them.\n     */\n\n    /*\n     * The CLR calls MovedReferences with information about\n     * object references that moved as a result of garbage collection.\n     *\n     * cMovedObjectIDRanges is a count of the number of ObjectID ranges that\n     *      were moved.\n     * oldObjectIDRangeStart is an array of elements, each of which is the start\n     *      value of a range of ObjectID values before being moved.\n     * newObjectIDRangeStart is an array of elements, each of which is the start\n     *      value of a range of ObjectID values after being moved.\n     * cObjectIDRangeLength is an array of elements, each of which states the\n     *      size of the moved ObjectID value range.\n     *\n     * The last three arguments of this function are parallel arrays.\n     *\n     * In other words, if an ObjectID value lies within the range\n     *      oldObjectIDRangeStart[i] <= ObjectID < oldObjectIDRangeStart[i] + cObjectIDRangeLength[i]\n     * for 0 <= i < cMovedObjectIDRanges, then the ObjectID value has changed to\n     *      ObjectID - oldObjectIDRangeStart[i] + newObjectIDRangeStart[i]\n     *\n     * NOTE: None of the objectIDs returned by MovedReferences are valid during the callback\n     * itself, as the GC may be in the middle of moving objects from old to new. Thus profilers\n     * should not attempt to inspect objects during a MovedReferences call. At\n     * GarbageCollectionFinished, all objects have been moved to their new locations, and\n     * inspection may be done.\n     *\n     * THIS CALLBACK IS OBSOLETE. It reports ranges for objects >4GB as UINT32_MAX\n     * on 64-bit platforms. Use ICorProfilerCallback4::MovedReferences2 instead.\n     */\n    HRESULT MovedReferences(\n                [in]                                ULONG    cMovedObjectIDRanges,\n                [in, size_is(cMovedObjectIDRanges)] ObjectID oldObjectIDRangeStart[] ,\n                [in, size_is(cMovedObjectIDRanges)] ObjectID newObjectIDRangeStart[] ,\n                [in, size_is(cMovedObjectIDRanges)] ULONG    cObjectIDRangeLength[] );\n\n    /*\n     * The CLR calls ObjectAllocated to notify the code profiler\n     * an object was allocated on the heap. This notification does not fire\n     * for allocations from the stack, nor from unmanaged memory.\n     *\n     * It is possible to receive a classId that corresponds to a regular class\n     * that has not been loaded yet. The profiler will receive a class load\n     * callback for that class immediately after the object creation callback.\n     */\n    HRESULT ObjectAllocated(\n                [in] ObjectID objectId,\n                [in] ClassID classId);\n\n    /*\n     * The CLR calls ObjectsAllocatedByClass to notify the code\n     * profiler about the number of objects of a particular class that were\n     * allocated since the previous garbage collection. The classes and the\n     * counts are passed in parallel arrays. (Classes for which no instances\n     * have been allocated since the previous GC are omitted entirely.)\n     *\n     * NOTE: This callback will not report objects allocated in the large\n     *       object heap.\n     *\n     * NOTE: The numbers here are only estimates. Use ObjectAllocated for\n     *       exact counts.\n     */\n    HRESULT ObjectsAllocatedByClass(\n                [in]                       ULONG   cClassCount,\n                [in, size_is(cClassCount)] ClassID classIds[] ,\n                [in, size_is(cClassCount)] ULONG   cObjects[] );\n\n    /*\n     * The CLR calls ObjectReferences to provide information\n     * about objects in memory referenced by a given object.  This function\n     * is called for each object remaining in the GC heap after a collection\n     * has completed.  If the profiler returns an error from this callback,\n     * the profiling services will discontinue invoking this callback until the\n     * next GC.  This callback can be used in conjunction with the\n     * RootReferences callback to create a complete object reference graph for\n     * the runtime.\n     *\n     * NOTE: The CLR will ensure that each object reference is reported only\n     * once by this function.\n     *\n     * NOTE: None of the objectIDs returned by ObjectReferences are valid during the callback\n     * itself, as the GC may be in the middle of moving objects from old to new. Thus profilers\n     * should not attempt to inspect objects during an ObjectReferences call. At\n     * GarbageCollectionFinished, all objects have been moved to their new locations, and\n     * inspection may be done.\n     */\n    HRESULT ObjectReferences(\n                [in]                       ObjectID objectId,\n                [in]                       ClassID  classId,\n                [in]                       ULONG    cObjectRefs,\n                [in, size_is(cObjectRefs)] ObjectID objectRefIds[] );\n\n    /*\n     * The CLR calls RootReferences with information about root\n     * references after a garbage collection has occurred. Static object\n     * references and references to objects on a stack are co-mingled in the\n     * arrays.\n     *\n     * NOTE: It is possible to get NULL ObjectIDs in the RootReferences callback.\n     * For example, all object references declared on the stack are treated as\n     * roots by the GC, and will always be reported.\n     *\n     * NOTE: None of the objectIDs returned by RootReferences are valid during the callback\n     * itself, as the GC may be in the middle of moving objects from old to new. Thus profilers\n     * should not attempt to inspect objects during a RootReferences call. At\n     * GarbageCollectionFinished, all objects have been moved to their new locations, and\n     * inspection may be done.\n     */\n    HRESULT RootReferences(\n                [in]                     ULONG    cRootRefs,\n                [in, size_is(cRootRefs)] ObjectID rootRefIds[] );\n\n\n    /*\n     *\n     * EXCEPTION EVENTS\n     *\n     */\n\n    //\n    // Exception creation\n    //\n\n    /*\n     * The CLR calls ExceptionThrown to notify the code\n     * profiler that an exception has been thrown.\n     *\n     * NOTE: This function is only called if the exception reaches\n     *       managed code.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     */\n    HRESULT ExceptionThrown(\n                [in] ObjectID thrownObjectId);\n\n    //\n    // Search phase\n    //\n\n    /*\n     * The CLR calls ExceptionSearchFunctionEnter to notify the profiler\n     * that the search phase of exception handling has entered a function.\n     */\n    HRESULT ExceptionSearchFunctionEnter(\n                [in] FunctionID functionId);\n\n    /*\n     * The CLR calls ExceptionSearchFunctionLeave to notify the profiler\n     * that the search phase of exception handling has left a function.\n     */\n    HRESULT ExceptionSearchFunctionLeave();\n\n    /*\n     * The CLR will call ExceptionSearchFilterEnter just before excecuting\n     * a user filter.  The functionID is that of the function containing the filter.\n     */\n    HRESULT ExceptionSearchFilterEnter(\n                [in] FunctionID functionId);\n\n    /*\n     * The CLR will call ExceptionSearchFilterLeave immediately after\n     * executing a user filter.\n     */\n    HRESULT ExceptionSearchFilterLeave();\n\n    /*\n     * The CLR will call ExceptionSearchCatcherFound when the search\n     * phase of exception handling has located a handler for the exception that\n     * was thrown.\n     */\n    HRESULT ExceptionSearchCatcherFound(\n                [in] FunctionID functionId);\n\n    /*\n     * DEPRECATED. It is the job of the unmanaged profiler to detect OS\n     * handling of exceptions.\n     */\n    HRESULT ExceptionOSHandlerEnter(\n                [in] UINT_PTR __unused);\n\n    /*\n     * DEPRECATED. It is the job of the unmanaged profiler to detect OS\n     * handling of exceptions.\n     */\n    HRESULT ExceptionOSHandlerLeave(\n                [in] UINT_PTR __unused);\n\n    //\n    // Unwind phase\n    //\n\n    /*\n     * The CLR calls ExceptionUnwindFunctionEnter to notify the profiler\n     * that the unwind phase of exception handling has entered a function.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     */\n    HRESULT ExceptionUnwindFunctionEnter(\n                [in] FunctionID functionId);\n\n    /*\n     * The CLR calls ExceptionUnwindFunctionLeave to notify the profiler\n     * that the unwind phase of exception handling has left a function.  The\n     * function instance and it's stack data has now been removed from the stack.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     */\n    HRESULT ExceptionUnwindFunctionLeave();\n\n    /*\n     * The CLR calls ExceptionUnwindFinallyEnter to notify the profiler\n     * that the unwind phase of exception is entering a finally clause contained\n     * in the specified function.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     */\n    HRESULT ExceptionUnwindFinallyEnter(\n                [in] FunctionID functionId);\n\n    /*\n     * The CLR calls ExceptionUnwindFinallyLeave to notify the profiler\n     * that the unwind phase of exception is leaving a finally clause.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     */\n    HRESULT ExceptionUnwindFinallyLeave();\n\n    /*\n     * The CLR calls this function just before passing control to\n     * the appropriate catch block.  Note that this is called only if the\n     * catch point is in JIT'ed code.  An exception that is caught in\n     * unmanaged code, or in the internal code of the CLR will\n     * not generate this notification.  The ObjectID is passed again since\n     * a GC could have moved the object since the ExceptionThrown\n     * notification.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     */\n    HRESULT ExceptionCatcherEnter(\n                [in] FunctionID functionId,\n                [in] ObjectID   objectId);\n\n    /*\n     * The CLR calls ExceptionCatcherLeave when the runtime leaves\n     * the catcher's code.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     */\n    HRESULT ExceptionCatcherLeave();\n\n    /*\n     *  CLR<->COM interop vtable creation/destruction.\n     */\n\n    /*\n     * The CLR calls this function when an CLR<->COM interop vtable\n     * for a particular IID and for a particular class has been created.\n     * This provides the ClassID of the class for which this vtable has been\n     * created, the IID it implements, the start of the vtable and how many\n     * slots are in it.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     *\n     * NOTE: It is possible to receive a NULL GUID if the interface is\n     *       internal only.\n     */\n    HRESULT COMClassicVTableCreated(\n               [in] ClassID wrappedClassId,\n               [in] REFGUID implementedIID,\n               [in] void    *pVTable,\n               [in] ULONG   cSlots);\n\n    /*\n     * The CLR calls this function when a CLR<->COM interop vtable is\n     * being destroyed.  Provided are the ClassID, IID and vtable pointer for\n     * the destroyed vtable.\n     *\n     * NOTE: The profiler should not block here, since the stack may not be in a\n     *       GC-friendly state and so preemptive GC cannot be enabled.  If the\n     *       profiler blocks here and a GC is attempted, the runtime will block\n     *       until this callback returns.  Also, the profiler may NOT call into\n     *       managed code or in any way cause a managed memory allocation.\n     *\n     * NOTE: It is possible to receive a NULL GUID if the interface is\n     *       internal only.\n     *\n     * NOTE: This callback is likely never to occur, since the destruction of\n     *       vtables occurs very close to Shutdown.\n     */\n    HRESULT COMClassicVTableDestroyed(\n               [in] ClassID wrappedClassId,\n               [in] REFGUID implementedIID,\n               [in] void    *pVTable);\n\n    /*\n     * DEPRECATED. These callbacks are no longer delivered.\n     */\n    HRESULT ExceptionCLRCatcherFound();\n\n    HRESULT ExceptionCLRCatcherExecute();\n}\n\n/*\n * COR_PRF_GC_ROOT_KIND describes the kind of GC root exposed by\n * the RootReferences2 callback.\n */\n\ntypedef enum\n{\n    COR_PRF_GC_ROOT_STACK = 1,        // Variables on the stack\n    COR_PRF_GC_ROOT_FINALIZER = 2,    // Entry in the finalizer queue\n    COR_PRF_GC_ROOT_HANDLE = 3,        // GC Handle\n    COR_PRF_GC_ROOT_OTHER = 0        //Misc. roots\n}   COR_PRF_GC_ROOT_KIND;\n\n\n/*\n * COR_PRF_GC_ROOT_FLAGS describes properties of a GC root\n * exposed by the RootReferences callback.\n */\n\ntypedef enum\n{\n    COR_PRF_GC_ROOT_PINNING = 0x1,    // Prevents GC from moving the object\n    COR_PRF_GC_ROOT_WEAKREF = 0x2,    // Does not prevent collection\n    COR_PRF_GC_ROOT_INTERIOR = 0x4,   // Refers to a field of the object rather than the object itself\n    COR_PRF_GC_ROOT_REFCOUNTED = 0x8, // Whether it prevents collection depends on a refcount - if not,\n                                      // COR_PRF_GC_ROOT_WEAKREF will be set also\n}   COR_PRF_GC_ROOT_FLAGS;\n\n\n/*\n * COR_PRF_FINALIZER_FLAGS is used by FinalizableObjectQueued to describe\n * the finalizer for the object.\n */\n\ntypedef enum\n{\n    COR_PRF_FINALIZER_CRITICAL = 0x1    // Critical finalizer\n}   COR_PRF_FINALIZER_FLAGS;\n\n\n/*\n * COR_PRF_GC_GENERATION contains the numbers used to represent each GC generation\n * in the GetGenerationBounds and GetObjectGeneration functions.\n */\n\ntypedef enum\n{\n    COR_PRF_GC_GEN_0 = 0,\n    COR_PRF_GC_GEN_1 = 1,\n    COR_PRF_GC_GEN_2 = 2,\n    COR_PRF_GC_LARGE_OBJECT_HEAP = 3,\n    COR_PRF_GC_PINNED_OBJECT_HEAP= 4\n}   COR_PRF_GC_GENERATION;\n\n\n/*\n * COR_PRF_GC_GENERATION_RANGE describes a range of memory in the GetGenerationBounds and GetObjectGeneration functions.\n * Note that the rangeLength member is only guaranteed to be accurate if GetGenerationBounds or GetObjectGeneration are\n * called from a GarbageCollectionStarted or GarbageCollectionFinished notification\n */\ntypedef struct COR_PRF_GC_GENERATION_RANGE\n{\n    COR_PRF_GC_GENERATION   generation;             // what generation the range of memory belongs to\n    ObjectID                rangeStart;             // the start of the range\n    UINT_PTR                rangeLength;            // the used length of the range\n    UINT_PTR                rangeLengthReserved;    // the amount of memory reserved for the range (including rangeLength)\n\n}   COR_PRF_GC_GENERATION_RANGE;\n\n\n\n/*\n * COR_PRF_CLAUSE_TYPE defines the various clause codes for the EX clauses\n */\ntypedef enum\n{\n    COR_PRF_CLAUSE_NONE = 0,  // not a real clause (only used in error cases)\n    COR_PRF_CLAUSE_FILTER = 1,\n    COR_PRF_CLAUSE_CATCH = 2,\n    COR_PRF_CLAUSE_FINALLY = 3,\n}   COR_PRF_CLAUSE_TYPE;\n\n/*\n * COR_PRF_EX_CLAUSE_INFO identifies a specific exception clause instance and its associated frame.\n * When an exception notification is received, GetNotifiedExceptionClauseInfo() may be used to get the\n * native address and frame information for the exception clause (catch/finally/filter) that is\n * about to be run (ExceptionCatchEnter, ExceptionUnwindFinallyEnter, ExceptionFilterEnter) or has just\n * been run (ExceptionCatchLeave, ExceptionUnwindFinallyLeave, ExceptionFilterLeave).\n */\ntypedef struct COR_PRF_EX_CLAUSE_INFO\n{\n    COR_PRF_CLAUSE_TYPE  clauseType; // the type of clause we just entered or left\n    UINT_PTR  programCounter;   // the native entry point of the clause handler (e.g. EIP)\n    UINT_PTR framePointer;    // the logical frame pointer (e.g. EBP) for that clause handler\n    UINT_PTR shadowStackPointer;  // the shadow stack pointer (IA64 only, BSP)\n}   COR_PRF_EX_CLAUSE_INFO;\n\n/*\n * COR_PRF_GC_REASON describes the reason for a given GC.\n */\ntypedef enum\n{\n    COR_PRF_GC_INDUCED = 1,     // Induced by GC.Collect\n    COR_PRF_GC_OTHER = 0        // Anything else\n}   COR_PRF_GC_REASON;\n\n/*\n * Bits from COR_PRF_MODULE_FLAGS are returned to the profiler in GetModuleInfo2's\n * pdwModuleFlags output parameter. Some combinations of 2 or more flags are possible,\n * though not all combinations are possible.\n */\ntypedef enum\n{\n    // The module was loaded from disk\n    COR_PRF_MODULE_DISK             = 0x00000001,\n\n    // The module had been generated via NGEN\n    COR_PRF_MODULE_NGEN             = 0x00000002,\n\n    // The module was created via methods in the Reflection.Emit namespace\n    COR_PRF_MODULE_DYNAMIC          = 0x00000004,\n\n    // The module's lifetime is managed by the garbage collector.\n    COR_PRF_MODULE_COLLECTIBLE      = 0x00000008,\n\n    // The module contains no metadata and is used strictly as a resource.  The managed\n    // equivalent of this bit is the System.Reflection.Module.IsResource() method.\n    COR_PRF_MODULE_RESOURCE         = 0x00000010,\n\n    // The module's layout in memory is flat, as opposed to mapped. For modules that have\n    // this bit set, profilers that directly read information out of the PE header will\n    // need to be careful when interpreting RVAs present in the PE header.\n    COR_PRF_MODULE_FLAT_LAYOUT      = 0x00000020,\n\n    // The Windows Runtime content type flag is set in the metadata for this module's\n    // assembly\n    COR_PRF_MODULE_WINDOWS_RUNTIME  = 0x00000040,\n}   COR_PRF_MODULE_FLAGS;\n/*\n * The ICorProfilerCallback2 interface is used by the CLR to notify a\n * code profiler when events have occurred that the code profiler has registered\n * an in interest in receiving.  These are new callbacks implemented in V2.0\n * of the runtime.\n *\n * The methods implemented on this interface return S_OK on success, or E_FAIL\n * on failure.\n */\n\n[\n    object,\n    uuid(8A8CC829-CCF2-49fe-BBAE-0F022228071A),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback2 : ICorProfilerCallback\n{\n\n    /*\n     *\n     * THREAD EVENTS\n     *\n     */\n\n    /*\n     * The CLR calls ThreadNameChanged to notify the code profiler\n     * that a thread's name has changed.\n     *\n     * name is not NULL terminated.\n     *\n     */\n    HRESULT ThreadNameChanged(\n                [in] ThreadID threadId,\n                [in] ULONG cchName,\n                [in, annotation(\"_In_reads_opt_(cchName)\")] WCHAR name[]);\n\n    /*\n     *\n     * GARBAGE COLLECTION EVENTS\n     *\n     */\n\n    /*\n     * The CLR calls GarbageCollectionStarted before beginning a\n     * garbage collection. All GC callbacks pertaining to this\n     * collection will occur between the GarbageCollectionStarted\n     * callback and the corresponding GarbageCollectionFinished\n     * callback. Corresponding GarbageCollectionStarted and\n     * GarbageCollectionFinished callbacks need not occur on the same thread.\n     *\n     *          cGenerations indicates the total number of entries in\n     *                the generationCollected array\n     *          generationCollected is an array of booleans, indexed\n     *                by COR_PRF_GC_GENERATIONS, indicating which\n     *                generations are being collected in this collection\n     *          reason indicates whether this GC was induced\n     *                by the application calling GC.Collect().\n     *\n     * NOTE: It is safe to inspect objects in their original locations\n     * during this callback. The GC will begin moving objects after\n     * the profiler returns from this callback. Therefore, after\n     * returning, the profiler should consider all ObjectIDs to be invalid\n     * until it receives a GarbageCollectionFinished callback.\n     */\n    HRESULT GarbageCollectionStarted(\n                [in] int cGenerations,\n                [in, size_is(cGenerations)] BOOL generationCollected[],\n                [in] COR_PRF_GC_REASON reason);\n\n    /*\n     * The CLR calls SurvivingReferences with information about\n     * object references that survived a garbage collection.\n     *\n     * Generally, the CLR calls SurvivingReferences for non-compacting garbage collections.\n     * For compacting garbage collections, MovedReferences is called instead.\n     *\n     * The exception to this rule is that the CLR always calls SurvivingReferences for objects\n     * in the large object heap, which is not compacted.\n     *\n     * Multiple calls to SurvivingReferences may be received during a particular\n     * garbage collection, due to limited internal buffering, multiple threads reporting\n     * in the case of server gc, and other reasons.\n     * In the case of multiple calls, the information is cumulative - all of the references\n     * reported in any SurvivingReferences call survive this collection.\n     *\n     * cSurvivingObjectIDRanges is a count of the number of ObjectID ranges that\n     *      survived.\n     * objectIDRangeStart is an array of elements, each of which is the start\n     *      value of a range of ObjectID values that survived the collection.\n     * cObjectIDRangeLength is an array of elements, each of which states the\n     *      size of the surviving ObjectID value range.\n     *\n     * The last two arguments of this function are parallel arrays.\n     *\n     * In other words, if an ObjectID value lies within the range\n     *      objectIDRangeStart[i] <= ObjectID < objectIDRangeStart[i] + cObjectIDRangeLength[i]\n     * for 0 <= i < cMovedObjectIDRanges, then the ObjectID has survived the collection\n     *\n     * THIS CALLBACK IS OBSOLETE. It reports ranges for objects >4GB as UINT32_MAX\n     * on 64-bit platforms. Use ICorProfilerCallback4::SurvivingReferences2 instead.\n     */\n    HRESULT SurvivingReferences(\n                [in]                                    ULONG    cSurvivingObjectIDRanges,\n                [in, size_is(cSurvivingObjectIDRanges)] ObjectID objectIDRangeStart[] ,\n                [in, size_is(cSurvivingObjectIDRanges)] ULONG    cObjectIDRangeLength[] );\n    /*\n     * The CLR calls GarbageCollectionFinished after a garbage\n     * collection has completed and all GC callbacks have been\n     * issued for it.\n     *\n     * NOTE: It is now safe to inspect objects in their\n     * final locations.\n     */\n    HRESULT GarbageCollectionFinished();\n\n    /*\n     * The CLR calls FinalizeableObjectQueued to notify the code profiler\n     * that an object with a finalizer (destructor in C# parlance) has\n     * just been queued to the finalizer thread for execution of its\n     * Finalize method.\n     *\n     * finalizerFlags describes aspects of the finalizer, and takes its\n     *     value from COR_PRF_FINALIZER_FLAGS.\n     *\n     */\n\n    HRESULT FinalizeableObjectQueued(\n                [in] DWORD finalizerFlags,\n                [in] ObjectID objectID);\n\n    /*\n     * The CLR calls RootReferences2 with information about root\n     * references after a garbage collection has occurred.\n     * For each root reference in rootRefIds, there is information in\n     * rootClassifications to classify it. Depending on the classification,\n     * rootsIds may contain additional information. The information in\n     * rootKinds and rootFlags contains information about the location and\n     * properties of the reference.\n     *\n     * If the profiler implements ICorProfilerCallback2, both\n     * ICorProfilerCallback::RootReferences and ICorProfilerCallback2::RootReferences2\n     * are called. As the information passed to RootReferences2 is a superset\n     * of the one passed to RootReferences, profilers will normally implement\n     * one or the other, but not both.\n     *\n     * If the root kind is STACK, the ID is the FunctionID of the\n     * function containing the variable. If the FunctionID is 0, the function\n     * is an unnamed function internal to the CLR.\n     *\n     * If the root kind is HANDLE, the ID is the GCHandleID.\n     *\n     * For the other root kinds, the ID is an opaque value and should\n     * be ignored.\n     *\n     * It's possible for entries in rootRefIds to be 0 - this just\n     * implies the corresponding root reference was null and thus did not\n     * refer to an object on the managed heap.\n     *\n     * NOTE: None of the objectIDs returned by RootReferences2 are valid during the callback\n     * itself, as the GC may be in the middle of moving objects from old to new. Thus profilers\n     * should not attempt to inspect objects during a RootReferences2 call. At\n     * GarbageCollectionFinished, all objects have been moved to their new locations, and\n     * inspection may be done.\n     */\n\n    HRESULT RootReferences2(\n                [in]                     ULONG    cRootRefs,\n                [in, size_is(cRootRefs)] ObjectID rootRefIds[],\n                [in, size_is(cRootRefs)] COR_PRF_GC_ROOT_KIND rootKinds[],\n                [in, size_is(cRootRefs)] COR_PRF_GC_ROOT_FLAGS rootFlags[],\n                [in, size_is(cRootRefs)] UINT_PTR rootIds[]);\n\n    /*\n     * The CLR calls HandleCreated when a gc handle has been created.\n     *\n     */\n\n    HRESULT HandleCreated(\n                [in] GCHandleID handleId,\n                [in] ObjectID initialObjectId);\n\n    /*\n     * The CLR calls HandleDestroyed when a gc handle has been destroyed.\n     *\n     */\n\n    HRESULT HandleDestroyed(\n                [in] GCHandleID handleId);\n}\n\n[\n    object,\n    uuid(4FD2ED52-7731-4b8d-9469-03D2CC3086C5),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback3 : ICorProfilerCallback2\n{\n    HRESULT InitializeForAttach(\n                [in] IUnknown * pCorProfilerInfoUnk,\n                [in] void * pvClientData,\n                [in] UINT cbClientData);\n\n    HRESULT ProfilerAttachComplete();\n\n    HRESULT ProfilerDetachSucceeded();\n};\n\n[\n    object,\n    uuid(7B63B2E3-107D-4d48-B2F6-F61E229470D2),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback4 : ICorProfilerCallback3\n{\n    /*\n     * Similar to JITCompilationStarted, except called when rejitting a method\n     */\n    HRESULT ReJITCompilationStarted(\n                [in] FunctionID functionId,\n                [in] ReJITID rejitId,\n                [in] BOOL fIsSafeToBlock);\n\n    /*\n     * This is called exactly once per method (which may represent more than\n     * one function id), to allow the code profiler to set alternate code\n     * generation flags or a new method body.\n     */\n    HRESULT GetReJITParameters(\n                [in] ModuleID moduleId,\n                [in] mdMethodDef methodId,\n                [in] ICorProfilerFunctionControl *pFunctionControl);\n\n    /*\n     * Similar to JITCompilationFinished, except called when rejitting a method\n     */\n    HRESULT ReJITCompilationFinished(\n                [in] FunctionID functionId,\n                [in] ReJITID rejitId,\n                [in] HRESULT hrStatus,\n                [in] BOOL fIsSafeToBlock);\n\n    /*\n     * This is called to report an error encountered while processing a ReJIT request.\n     * This may either be called from within the RequestReJIT call itself, or called after\n     * RequestReJIT returns, if the error was encountered later on.\n     */\n    HRESULT ReJITError(\n                [in] ModuleID moduleId,\n                [in] mdMethodDef methodId,\n                [in] FunctionID functionId,\n                [in] HRESULT hrStatus);\n\n    /*\n     * The CLR calls MovedReferences with information about\n     * object references that moved as a result of garbage collection.\n     *\n     * cMovedObjectIDRanges is a count of the number of ObjectID ranges that\n     *      were moved.\n     * oldObjectIDRangeStart is an array of elements, each of which is the start\n     *      value of a range of ObjectID values before being moved.\n     * newObjectIDRangeStart is an array of elements, each of which is the start\n     *      value of a range of ObjectID values after being moved.\n     * cObjectIDRangeLength is an array of elements, each of which states the\n     *      size of the moved ObjectID value range.\n     *\n     * The last three arguments of this function are parallel arrays.\n     *\n     * In other words, if an ObjectID value lies within the range\n     *      oldObjectIDRangeStart[i] <= ObjectID < oldObjectIDRangeStart[i] + cObjectIDRangeLength[i]\n     * for 0 <= i < cMovedObjectIDRanges, then the ObjectID value has changed to\n     *      ObjectID - oldObjectIDRangeStart[i] + newObjectIDRangeStart[i]\n     *\n     * NOTE: None of the objectIDs returned by MovedReferences are valid during the callback\n     * itself, as the GC may be in the middle of moving objects from old to new. Thus profilers\n     * should not attempt to inspect objects during a MovedReferences call. At\n     * GarbageCollectionFinished, all objects have been moved to their new locations, and\n     * inspection may be done.\n     *\n     * If the profiler implements ICorProfilerCallback4, ICorProfilerCallback4::MovedReferences2\n     * is called first and ICorProfilerCallback::MovedReferences is called second but only if\n     * ICorProfilerCallback4::MovedReferences2 returned success. Profilers can return failure\n     * from ICorProfilerCallback4::MovedReferences2 to save some chattiness.\n     */\n    HRESULT MovedReferences2(\n                [in]                                ULONG    cMovedObjectIDRanges,\n                [in, size_is(cMovedObjectIDRanges)] ObjectID oldObjectIDRangeStart[] ,\n                [in, size_is(cMovedObjectIDRanges)] ObjectID newObjectIDRangeStart[] ,\n                [in, size_is(cMovedObjectIDRanges)] SIZE_T   cObjectIDRangeLength[] );\n\n    /*\n     * The CLR calls SurvivingReferences with information about\n     * object references that survived a garbage collection.\n     *\n     * Generally, the CLR calls SurvivingReferences for non-compacting garbage collections.\n     * For compacting garbage collections, MovedReferences is called instead.\n     *\n     * The exception to this rule is that the CLR always calls SurvivingReferences for objects\n     * in the large object heap, which is not compacted.\n     *\n     * Multiple calls to SurvivingReferences may be received during a particular\n     * garbage collection, due to limited internal buffering, multiple threads reporting\n     * in the case of server gc, and other reasons.\n     * In the case of multiple calls, the information is cumulative - all of the references\n     * reported in any SurvivingReferences call survive this collection.\n     *\n     * cSurvivingObjectIDRanges is a count of the number of ObjectID ranges that\n     *      survived.\n     * objectIDRangeStart is an array of elements, each of which is the start\n     *      value of a range of ObjectID values that survived the collection.\n     * cObjectIDRangeLength is an array of elements, each of which states the\n     *      size of the surviving ObjectID value range.\n     *\n     * The last two arguments of this function are parallel arrays.\n     *\n     * In other words, if an ObjectID value lies within the range\n     *      objectIDRangeStart[i] <= ObjectID < objectIDRangeStart[i] + cObjectIDRangeLength[i]\n     * for 0 <= i < cMovedObjectIDRanges, then the ObjectID has survived the collection\n     *\n     * If the profiler implements ICorProfilerCallback4, ICorProfilerCallback4::SurvivingReferences2\n     * is called first and ICorProfilerCallback2::SurvivingReferences is called second but only if\n     * ICorProfilerCallback4::SurvivingReferences2 returned success. Profilers can return failure\n     * from ICorProfilerCallback4::SurvivingReferences2 to save some chattiness.\n     */\n    HRESULT SurvivingReferences2(\n                [in]                                    ULONG    cSurvivingObjectIDRanges,\n                [in, size_is(cSurvivingObjectIDRanges)] ObjectID objectIDRangeStart[] ,\n                [in, size_is(cSurvivingObjectIDRanges)] SIZE_T   cObjectIDRangeLength[] );\n\n};\n\n\n[\n    object,\n    uuid(8DFBA405-8C9F-45F8-BFFA-83B14CEF78B5),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback5 : ICorProfilerCallback4\n{\n    /*\n     * The CLR calls ConditionalWeakTableElementReferences with information\n     * about dependent handles after a garbage collection has occurred.\n     *\n     * For each root ID in rootIds, keyRefIds will contain the ObjectID for\n     * the primary element in the dependent handle pair, and valueRefIds will\n     * contain the ObjectID for the secondary element (keyRefIds[i] keeps\n     * valueRefIds[i] alive).\n     *\n     * NOTE: None of the objectIDs returned by ConditionalWeakTableElementReferences\n     * are valid during the callback itself, as the GC may be in the middle\n     * of moving objects from old to new. Thus profilers should not attempt\n     * to inspect objects during a ConditionalWeakTableElementReferences call.\n     * At GarbageCollectionFinished, all objects have been moved to their new\n     * locations, and inspection may be done.\n     */\n    HRESULT ConditionalWeakTableElementReferences(\n                [in]                     ULONG    cRootRefs,\n                [in, size_is(cRootRefs)] ObjectID keyRefIds[],\n                [in, size_is(cRootRefs)] ObjectID valueRefIds[],\n                [in, size_is(cRootRefs)] GCHandleID rootIds[]);\n};\n\n\n[\n    object,\n    uuid(FC13DF4B-4448-4F4F-950C-BA8D19D00C36),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback6 : ICorProfilerCallback5\n{\n    // CORECLR DEPRECATION WARNING: This callback does not occur on coreclr.\n    // Controlled by the COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES event mask flag.\n    // Notifies the profiler of a very early stage in the loading of an Assembly, where the CLR\n    // performs an assembly reference closure walk.  This is useful ONLY if the profiler will need\n    // to modify the metadata of the Assembly to add AssemblyRefs (later, in ModuleLoadFinished).  In\n    // such a case, the profiler should implement this callback as well, to inform the CLR that assembly references\n    // will be added once the module has loaded.  This is useful to ensure that assembly sharing decisions\n    // made by the CLR during this early stage remain valid even though the profiler plans to modify the metadata\n    // assembly references later on.  This can be used to avoid some instances where profiler metadata\n    // modifications can cause the SECURITY_E_INCOMPATIBLE_SHARE error to be thrown.\n    //\n    // The profiler uses the ICorProfilerAssemblyReferenceProvider provided to add assembly references\n    // to the CLR assembly reference closure walker.  The ICorProfilerAssemblyReferenceProvider\n    // should only be used from within this callback. The profiler will still need to explicitly add assembly\n    // references via IMetaDataAssemblyEmit, from within the ModuleLoadFinished callback for the referencing assembly,\n    // even though the profiler implements this GetAssemblyReferences callback.  This callback does not result in\n    // modified metadata; only in a modified assembly reference closure walk.\n    //\n    // The profiler should be prepared to receive duplicate calls to this callback for the same assembly,\n    // and should respond identically for each such duplicate call (by making the same set of\n    // ICorProfilerAssemblyReferenceProvider::AddAssemblyReference calls).\n    HRESULT GetAssemblyReferences(\n        [in, string] const WCHAR * wszAssemblyPath,\n        [in] ICorProfilerAssemblyReferenceProvider * pAsmRefProvider);\n};\n\n\n[\n    object,\n    uuid(F76A2DBA-1D52-4539-866C-2AA518F9EFC3),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback7 : ICorProfilerCallback6\n{\n    // This event is triggered whenever the symbol stream associated with an\n    // in-memory module is updated. Even when symbols are provided up-front in\n    // a call to the managed API Assembly.Load(byte[], byte[], ...) the runtime\n    // may not actually associate the symbolic data with the module until after\n    // the ModuleLoadFinished callback has occurred. This event provides a later\n    // opportunity to collect symbols for such modules.\n    //\n    // This event is controlled by the COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED\n    // event mask flag.\n    //\n    // Note: This event is not currently raised for symbols implicitly created or\n    // modified via Reflection.Emit APIs.\n    HRESULT ModuleInMemorySymbolsUpdated(ModuleID moduleId);\n}\n\n\n[\n    object,\n    uuid(5BED9B15-C079-4D47-BFE2-215A140C07E0),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback8 : ICorProfilerCallback7\n{\n    // This event is triggered whenever a dynamic method is jit compiled.\n    // These include various IL Stubs and LCG Methods.\n    // The goal is to provide profiler writers with enough information to identify\n    // it to users as beyond unknown code addresses.\n    // Note: FunctionID's provided here cannot be used to resolve to their metadata\n    //       tokens since dynamic methods have no metadata.\n    //\n    // Documentation Note: pILHeader is only valid during the callback\n\n    HRESULT DynamicMethodJITCompilationStarted(\n        [in] FunctionID functionId,\n        [in] BOOL       fIsSafeToBlock,\n        [in] LPCBYTE    pILHeader,\n        [in] ULONG      cbILHeader);\n\n    HRESULT DynamicMethodJITCompilationFinished(\n        [in] FunctionID functionId,\n        [in] HRESULT    hrStatus,\n        [in] BOOL       fIsSafeToBlock);\n}\n\n[\n    object,\n    uuid(27583EC3-C8F5-482F-8052-194B8CE4705A),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback9 : ICorProfilerCallback8\n{\n    // This event is triggered whenever a dynamic method is garbage collected\n    // and subsequently unloaded.\n\n    HRESULT DynamicMethodUnloaded([in] FunctionID functionId);\n}\n\n[\n    object,\n    uuid(CEC5B60E-C69C-495F-87F6-84D28EE16FFB),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback10 : ICorProfilerCallback9\n{\n    // This event is triggered whenever an EventPipe event is configured to be delivered.\n    //\n    // Documentation Note: All pointers are only valid during the callback\n\n    HRESULT EventPipeEventDelivered(\n        [in] EVENTPIPE_PROVIDER provider,\n        [in] DWORD eventId,\n        [in] DWORD eventVersion,\n        [in] ULONG cbMetadataBlob,\n        [in, size_is(cbMetadataBlob)] LPCBYTE metadataBlob,\n        [in] ULONG cbEventData,\n        [in, size_is(cbEventData)] LPCBYTE eventData,\n        [in] LPCGUID pActivityId,\n        [in] LPCGUID pRelatedActivityId,\n        [in] ThreadID eventThread,\n        [in] ULONG numStackFrames,\n        [in, length_is(numStackFrames)] UINT_PTR stackFrames[]);\n\n    HRESULT EventPipeProviderCreated([in] EVENTPIPE_PROVIDER provider);\n}\n\n[\n    object,\n    uuid(42350846-AAED-47F7-B128-FD0C98881CDE),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerCallback11 : ICorProfilerCallback10\n{\n    HRESULT LoadAsNotificationOnly(BOOL *pbNotificationOnly);\n}\n\n/*\n * COR_PRF_CODEGEN_FLAGS controls various flags and hooks for a specific\n * method.  A combination of COR_PRF_CODEGEN_FLAGS is provided by the\n * profiler in its call to ICorProfilerFunctionControl::SetCodegenFlags()\n * when rejitting a method.\n */\ntypedef enum\n{\n    COR_PRF_CODEGEN_DISABLE_INLINING =          0x0001,\n    COR_PRF_CODEGEN_DISABLE_ALL_OPTIMIZATIONS = 0x0002,\n} COR_PRF_CODEGEN_FLAGS;\n\n\n/*\n * The CLR implements the ICorProfilerInfo interface. This interface is\n * used by a code profiler to communicate with the CLR to control event\n * monitoring and request information. The CLR passes an\n * ICorProfilerInfo interface to each code profiler during initialization.\n *\n * A code profiler can call methods on the ICorProfilerInfo interface to get\n * information about managed code being executed under the control of the CLR\n *\n * The ICorProfilerInfo interface implemented by the CLR uses the free\n * threaded model.\n *\n * The methods implemented on this interface return S_OK on success, or E_FAIL\n * on failure.\n *\n */\n\n[\n    object,\n    uuid(28B5557D-3F3F-48b4-90B2-5F9EEA2F6C48),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo : IUnknown\n{\n    /*\n     * The code profiler calls GetClassFromObject to obtain the ClassID of an\n     * object given its ObjectID.\n     */\n    HRESULT GetClassFromObject(\n                [in]  ObjectID objectId,\n                [out] ClassID *pClassId);\n\n    /*\n     * V2 MIGRATION WARNING - DOES NOT WORK FOR GENERIC TYPES\n     *\n     * This function will be removed in a future release, so\n     * use GetClassFromTokenAndTypeArgs for all types.\n     */\n    HRESULT GetClassFromToken(\n                [in]  ModuleID  moduleId,\n                [in]  mdTypeDef typeDef,\n                [out] ClassID   *pClassId);\n\n    /*\n     * V2 MIGRATION WARNING - WILL NOT WORK WITH .NET FRAMEWORK\n     * FUNCTIONS\n     *\n     * This function will be removed in a future release; use GetCodeInfo2\n     * in all cases.\n     */\n    HRESULT GetCodeInfo(\n                [in]  FunctionID functionId,\n                [out] LPCBYTE    *pStart,\n                [out] ULONG      *pcSize);\n\n    /*\n     * RECOMMENDATION: USE GetEventMask2 INSTEAD.  WHILE THIS METHOD CONTINUES TO\n     * TO WORK, GetEventMask2 PROVIDES MORE FUNCTIONALITY.\n     *\n     * The code profiler calls GetEventMask to obtain the current event\n     * categories for which it is to receive event notifications from the COM+\n     * Runtime.\n     */\n    HRESULT GetEventMask(\n                [out] DWORD *pdwEvents);\n\n    /*\n     * The code profiler calls GetFunctionFromIP to map an instruction pointer\n     * in managed code to a FunctionID.\n     */\n    HRESULT GetFunctionFromIP(\n                [in]  LPCBYTE    ip,\n                [out] FunctionID *pFunctionId);\n\n    /*\n     * V2 MIGRATION WARNING - WILL NOT WORK FOR GENERIC FUNCTIONS OR\n     * FUNCTIONS ON GENERIC TYPES\n     *\n     * This function will be removed in a future release, so use\n     * GetFunctionFromTokenAndTypeArgs for all functions.\n     */\n    HRESULT GetFunctionFromToken(\n                [in]  ModuleID   moduleId,\n                [in]  mdToken    token,\n                [out] FunctionID *pFunctionId);\n\n    /*\n     * The code profiler calls GetHandleFromThread to map a ThreadID to a Win32\n     * thread handle. The profiler must call DuplicateHandle on the handle\n     * before using it.\n     */\n    HRESULT GetHandleFromThread(\n                [in]  ThreadID threadId,\n                [out] HANDLE  *phThread);\n\n    /*\n     * The code profiler calls GetObjectSize to obtain the size of an object.\n     * Note that types like arrays and strings may have a different size for each object.\n     *\n     * THIS API IS OBSOLETE. It does not work for objects >4GB on 64-bit platforms.\n     * Use ICorProfilerInfo4::GetObjectSize2 instead.\n     */\n    HRESULT GetObjectSize(\n                [in]  ObjectID objectId,\n                [out] ULONG  *pcSize);\n\n    /*\n     * This will return S_OK if the ClassID provided is an array class, and will\n     * fill out the information for any non-null out params.  S_FALSE will be\n     * returned if the ClassID is not an array.\n     *\n     * classId       : the ClassID to return information about\n     * pBaseElemType : the array's base element type\n     * pBaseClassId  : the base ClassID if the element type == ELEMENT_TYPE_CLASS\n     * pcRank        : the number of dimensions of the array\n     */\n    HRESULT IsArrayClass(\n                [in]  ClassID        classId,\n                [out] CorElementType *pBaseElemType,\n                [out] ClassID        *pBaseClassId,\n                [out] ULONG          *pcRank);\n\n    /*\n     * The code profiler calls GetThreadInfo to obtain the current Win32 thread ID for\n     * the specified thread.\n     */\n    HRESULT GetThreadInfo(\n                [in]  ThreadID threadId,\n                [out] DWORD    *pdwWin32ThreadId);\n\n    /*\n     * The code profiler calls GetCurrentThreadID to get the managed thread ID\n     * for the current thread.\n     *\n     * NOTE: GetCurrentThreadID may return CORPROF_E_NOT_MANAGED_THREAD if the\n     * current thread is an internal runtime thread, and the returned value of\n     * pThreadId will be NULL.\n     */\n    HRESULT GetCurrentThreadID(\n                [out] ThreadID *pThreadId);\n\n    /*\n     * V2 MIGRATION NOTE - More information is available for generic types\n     * from GetClassIDInfo2.\n     *\n     * Returns the parent module a class is defined in, along with the\n     * metadata token for the class.  One can call GetModuleMetaData\n     * to obtain the metadata interface for a given module.  The token\n     * can then be used to access the metadata for this class.\n     */\n    HRESULT GetClassIDInfo(\n                [in]  ClassID   classId,\n                [out] ModuleID  *pModuleId,\n                [out] mdTypeDef *pTypeDefToken);\n\n    /*\n     * Return the parent class for a given function.  Also return the metadata\n     * token which can be used to read the metadata.\n     *\n     * V2 MIGRATION WARNING - LESS INFORMATION FOR GENERIC CLASSES\n     * The ClassID of a function on a generic class may not be obtainable without\n     * more context about the use of the function. In this case, *pClassId will be 0;\n     * try using GetFunctionInfo2 with a COR_PRF_FRAME_INFO to give more context.\n     */\n    HRESULT GetFunctionInfo(\n                [in]  FunctionID functionId,\n                [out] ClassID    *pClassId,\n                [out] ModuleID   *pModuleId,\n                [out] mdToken    *pToken);\n\n    /*\n     * RECOMMENDATION: USE SetEventMask2 INSTEAD.  WHILE THIS METHOD CONTINUES TO\n     * TO WORK, SetEventMask2 PROVIDES MORE FUNCTIONALITY.\n     *\n     * The code profiler calls SetEventMask to set the event categories for\n     * which it is set to receive notification from the CLR.\n     */\n    HRESULT SetEventMask(\n                [in] DWORD dwEvents);\n\n    /*\n     * The code profiler calls SetFunctionHooks to specify handlers\n     * for FunctionEnter, FunctionLeave, and FunctionTailcall.\n     *\n     * Note that only one set of callbacks may be active at a time. Thus,\n     * if a profiler calls SetEnterLeaveFunctionHooks, SetEnterLeaveFunctionHooks2\n     * and SetEnterLeaveFunctionHooks3(WithInfo), then SetEnterLeaveFunctionHooks3(WithInfo)\n     * wins.  SetEnterLeaveFunctionHooks2 takes precedence over SetEnterLeaveFunctionHooks\n     * when both are set.\n     *\n     * Each function pointer may be null to disable that callback.\n     *\n     * SetEnterLeaveFunctionHooks may only be called from the\n     * profiler's Initialize() callback.\n     */\n    HRESULT SetEnterLeaveFunctionHooks(\n                [in] FunctionEnter    *pFuncEnter,\n                [in] FunctionLeave    *pFuncLeave,\n                [in] FunctionTailcall *pFuncTailcall);\n\n    /*\n     * This is used for mapping FunctionIDs to alternative values that will be\n     * passed to the callbacks\n     */\n    HRESULT SetFunctionIDMapper(\n                [in] FunctionIDMapper *pFunc);\n\n    /*\n     * For a given function, retrieve the token value and an instance of the\n     * meta data interface which can be used against this token.\n     */\n    HRESULT GetTokenAndMetaDataFromFunction(\n                [in]  FunctionID functionId,\n                [in]  REFIID     riid,\n                [out] IUnknown   **ppImport,\n                [out] mdToken    *pToken);\n\n    /*\n     * Retrieve information about a given module.\n     *\n     * When the module is loaded from disk, the name returned will be the filename;\n     * otherwise, the name will be the name from the metadata Module table (i.e.,\n     * the same as the managed System.Reflection.Module.ScopeName).\n     *\n     * NOTE: While this function may be called as soon as the moduleId is alive,\n     * the AssemblyID of the containing assembly will not be available until the\n     * ModuleAttachedToAssembly callback.\n     *\n     * NOTE: More information is available by using ICorProfilerInfo3::GetModuleInfo2 instead.\n     */\n    HRESULT GetModuleInfo(\n                [in]  ModuleID   moduleId,\n                [out] LPCBYTE    *ppBaseLoadAddress,\n                [in]  ULONG      cchName,\n                [out] ULONG      *pcchName,\n                [out, annotation(\"_Out_writes_to_(cchName, *pcchName)\")]\n                      WCHAR      szName[] ,\n                [out] AssemblyID *pAssemblyId);\n\n    /*\n     * Get a metadata interface instance which maps to the given module.\n     * One may ask for the metadata to be opened in read+write mode, but\n     * this will result in slower metadata execution of the program, because\n     * changes made to the metadata cannot be optimized as they were from\n     * the compiler.\n     *\n     * NOTE: Some modules (such as resource modules) have no metadata. In\n     * those cases, GetModuleMetaData will return S_FALSE, and a NULL\n     * IUnknown.\n     *\n     * NOTE: the only values valid for dwOpenFlags are ofRead and ofWrite.\n     */\n    HRESULT GetModuleMetaData(\n                [in]  ModuleID moduleId,\n                [in]  DWORD    dwOpenFlags,\n                [in]  REFIID   riid,\n                [out] IUnknown **ppOut);\n\n    /*\n     * Retrieve a pointer to the body of a method starting at it's header.\n     * A method is scoped by the module it lives in.  Because this function\n     * is designed to give a tool access to IL before it has been loaded\n     * by the Runtime, it uses the metadata token of the method to find\n     * the instance desired.\n     *\n     * GetILFunctionBody can return CORPROF_E_FUNCTION_NOT_IL if the methodId\n     * points to a method without any IL (such as an abstract method, or a\n     * P/Invoke method).\n     */\n    HRESULT GetILFunctionBody(\n                [in]  ModuleID    moduleId,\n                [in]  mdMethodDef methodId,\n                [out] LPCBYTE     *ppMethodHeader,\n                [out] ULONG       *pcbMethodSize);\n\n    /*\n     * IL method bodies must be located as RVA's to the loaded module, which\n     * means they come after the module within 4 gb.  In order to make it\n     * easier for a tool to swap out the body of a method, this allocator\n     * will ensure memory is allocated within that range.\n     */\n    HRESULT GetILFunctionBodyAllocator(\n                [in]  ModuleID      moduleId,\n                [out] IMethodMalloc **ppMalloc);\n\n    /*\n     * Replaces the method body for a function in a module.  This will replace\n     * the RVA of the method in the metadata to point to this new method body,\n     * and adjust any internal data structures as required.  This function can\n     * only be called on those methods which have never been compiled by a JITTER.\n     * Please use the GetILFunctionAllocator to allocate space for the new method to\n     * ensure the buffer is compatible.\n     */\n    HRESULT SetILFunctionBody(\n                [in] ModuleID    moduleId,\n                [in] mdMethodDef methodid,\n                [in] LPCBYTE     pbNewILMethodHeader);\n\n    /*\n     * Retrieve app domain information given its id.\n     */\n    HRESULT GetAppDomainInfo(\n                [in]  AppDomainID appDomainId,\n                [in]  ULONG       cchName,\n                [out] ULONG       *pcchName,\n                [out, annotation(\"_Out_writes_to_(cchName, *pcchName)\")]\n                      WCHAR       szName[] ,\n                [out] ProcessID   *pProcessId);\n\n    /*\n     * Retrieve information about an assembly given its ID.\n     */\n    HRESULT GetAssemblyInfo(\n                [in]  AssemblyID  assemblyId,\n                [in]  ULONG       cchName,\n                [out] ULONG       *pcchName,\n                [out, annotation(\"_Out_writes_to_(cchName, *pcchName)\")]\n                      WCHAR       szName[] ,\n                [out] AppDomainID *pAppDomainId,\n                [out] ModuleID    *pModuleId);\n\n\n    /*\n     * V2 MIGRATION WARNING: DEPRECATED.  Returns E_NOTIMPL always.\n     *\n     * See ICorProfilerInfo4::RequestReJIT instead\n     *\n     */\n    HRESULT SetFunctionReJIT(\n                [in] FunctionID functionId);\n\n    /*\n     * ForceGC forces a GC to occur within the runtime.\n     *\n     * NOTE: This method needs to be called from a thread that does not have any\n     * profiler callbacks on its stack. The most convenient way to implement this is\n     * to create a separate thread within the profiler and have it call ForceGC when\n     * signalled.\n     */\n    HRESULT ForceGC();\n\n    /*\n     *\n     * V2 MIGRATION NOTE - Calling SetILInstrumentedCodeMap on any one\n     * of the multiple FunctionIDs that represent a generic function in a given\n     * AppDomain will affect all instantiations of that function in the AppDomain.\n     *\n     * fStartJit should be set to true the first time this function is called for\n     * a given FunctionID, and false thereafter.\n     *\n     * The format of the map is as follows:\n     *      The debugger will assume that each oldOffset refers to an IL offset\n     *  within the original, unmodified IL code.  newOffset refers to the corresponding\n     *  IL offset within the new, instrumented code.\n     *\n     * The map should be sorted in increasing order. For stepping to work properly:\n     * - Instrumented IL should not be reordered (so both old & new are sorted)\n     * - original IL should not be removed\n     * - the map should include entries to map all of the sequence points from the pdb.\n     *\n     * The map does not interpolate missing entries. So given the following map:\n     * (0 old, 0  new)\n     * (5 old, 10 new)\n     * (9 old, 20 new)\n     * - An old offset of 0,1,2,3,4 will be mapped to a new offset of 0\n     * - An old offset of 5,6,7, or 8 will be mapped to new offset 10.\n     * - An old offset of 9 or higher will be mapped to new offset 20.\n     * - A new offset of 0, 1,...8,9 will be mapped to old offset 0\n     * - A new offset of 10,11,...18,19 will be mapped to old offset 5.\n     * - A new offset of 20 or higher will be mapped to old offset 9.\n     *\n     */\n    HRESULT SetILInstrumentedCodeMap(\n                [in]                         FunctionID functionId,\n                [in]                         BOOL       fStartJit,\n                [in]                         ULONG      cILMapEntries,\n                [in, size_is(cILMapEntries)] COR_IL_MAP rgILMapEntries[] );\n\n    /*\n     * DEPRECATED.\n     */\n    HRESULT GetInprocInspectionInterface(\n                [out] IUnknown **ppicd);\n\n    /*\n     * DEPRECATED.\n     */\n    HRESULT GetInprocInspectionIThisThread(\n                [out] IUnknown **ppicd);\n\n    /*\n     * This will return the ContextID currently associated with the calling\n     * runtime thread.  This will set pContextId to NULL if the calling thread\n     * is not a runtime thread.\n     */\n    HRESULT GetThreadContext(\n                [in]  ThreadID  threadId,\n                [out] ContextID *pContextId);\n\n    /*\n     * DEPRECATED.\n     */\n    HRESULT BeginInprocDebugging(\n                [in]  BOOL   fThisThreadOnly,\n                [out] DWORD *pdwProfilerContext);\n\n    /*\n     * DEPRECATED.\n     */\n    HRESULT EndInprocDebugging(\n                [in]  DWORD dwProfilerContext);\n\n    /*\n     * GetILToNativeMapping returns a map from IL offsets to native\n     * offsets for this code. An array of COR_PROF_IL_TO_NATIVE_MAP\n     * structs will be returned, and some of the ilOffsets in this array\n     * may be the values specified in CorDebugIlToNativeMappingTypes.\n     */\n    HRESULT GetILToNativeMapping(\n                [in] FunctionID functionId,\n                [in] ULONG32 cMap,\n                [out] ULONG32 *pcMap,\n                [out, size_is(cMap), length_is(*pcMap)]\n                    COR_DEBUG_IL_TO_NATIVE_MAP map[]);\n}\n\n/*\n * The CLR implements the ICorProfilerInfo2 interface. This interface is\n * used by a code profiler to communicate with the CLR to control event\n * monitoring and request information. The CLR passes an\n * ICorProfilerInfo2 interface to each code profiler during initialization.\n *\n * A code profiler can call methods on the ICorProfilerInfo2 interface to get\n  * information about managed code being executed under the control of the CLR\n *\n * The ICorProfilerInfo2 interface implemented by the CLR uses the free\n * threaded model.\n *\n * The methods implemented on this interface return S_OK on success, or E_FAIL\n * on failure.\n *\n */\n\n[\n    object,\n    uuid(CC0935CD-A518-487d-B0BB-A93214E65478),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo2 : ICorProfilerInfo\n{\n    /*\n     * The code profiler calls DoStackSnapshot to do sparse one-off stack snapshots.\n     *\n     * Passing NULL for thread yields a snapshot of the current thread. If a ThreadID\n     * of a different thread is passed, the runtime will suspend that thread, perform\n     * the snapshot, and resume.\n     *\n     * infoFlags come from the COR_PRF_SNAPSHOT_INFO enum.\n     *\n     * context is a platform-dependent CONTEXT structure, representing the complete\n     * register context that the profiling API will use to seed the stack walk.  If this\n     * is non-NULL, it must point to JITd or NGENd code, or else DoStackSnapshot\n     * will return CORPROF_E_STACKSNAPSHOT_UNMANAGED_CTX.  Contexts are\n     * only provided by profilers that hijack threads to force them to walk their\n     * own stacks; profilers should not attempt to provide a context when walking\n     * another thread's stack. If context is NULL, the stack walk will begin at the\n     * last available managed frame for the target thread.\n     *\n     * See the definition of StackSnapshotCallback for more information.\n     */\n    HRESULT DoStackSnapshot(\n                [in] ThreadID thread,\n                [in] StackSnapshotCallback *callback,\n                [in] ULONG32 infoFlags,\n                [in] void *clientData,\n                [in, size_is(contextSize)] BYTE context[],\n                [in] ULONG32 contextSize);\n\n    /*\n     * The code profiler calls SetFunctionHooks2 to specify handlers\n     * for FunctionEnter2, FunctionLeave2, and FunctionTailcall2\n     * callbacks.\n     *\n     * Note that only one set of callbacks may be active at a time. Thus,\n     * if a profiler calls SetEnterLeaveFunctionHooks, SetEnterLeaveFunctionHooks2\n     * and SetEnterLeaveFunctionHooks3(WithInfo), then SetEnterLeaveFunctionHooks3(WithInfo)\n     * wins.  SetEnterLeaveFunctionHooks2 takes precedence over SetEnterLeaveFunctionHooks\n     * when both are set.\n     *\n     * Each pointer may be null to disable that particular callback.\n     *\n     * SetEnterLeaveFunctionHooks2 may only be called from the\n     * profiler's Initialize() callback.\n     */\n    HRESULT SetEnterLeaveFunctionHooks2(\n                [in] FunctionEnter2    *pFuncEnter,\n                [in] FunctionLeave2    *pFuncLeave,\n                [in] FunctionTailcall2 *pFuncTailcall);\n\n    /*\n     * GetFunctionInfo2 returns the parent class of a function, plus the\n     * function's metadata token and the ClassIDs of its type arguments\n     * (if any).\n     *\n     * When a COR_PRF_FRAME_INFO obtained from a FunctionEnter2\n     * callback is passed, the ClassID and all type arguments will be exact.\n     *\n     * When a COR_PRF_FRAME_INFO from any other source is passed, or\n     * when 0 is passed as the frameInfo argument, exact ClassID and type\n     * arguments cannot always be determined.  The value returned in pClassId\n     * may be NULL and some type args will come back as System.Object.\n     *\n     */\n    HRESULT GetFunctionInfo2(\n                [in] FunctionID funcId,\n                [in] COR_PRF_FRAME_INFO frameInfo,\n                [out] ClassID *pClassId,\n                [out] ModuleID *pModuleId,\n                [out] mdToken *pToken,\n                [in] ULONG32 cTypeArgs,\n                [out] ULONG32 *pcTypeArgs,\n                [out] ClassID typeArgs[]);\n\n    /*\n     * GetStringLayout returns detailed information about how string objects are stored.\n     *\n     * *pBufferLengthOffset is the offset (from the ObjectID pointer) to a DWORD that\n     * stores the length of the string's buffer\n     *\n     * *pStringLengthOffset is the offset (from the ObjectID pointer) to a DWORD that\n     * stores the length of the string itself\n     *\n     * *pBufferOffset is the offset (from the ObjectID pointer) to the actual buffer\n     * of wide characters\n     *\n     * Strings may or may not be null-terminated.\n     */\n    HRESULT GetStringLayout(\n                [out] ULONG *pBufferLengthOffset,\n                [out] ULONG *pStringLengthOffset,\n                [out] ULONG *pBufferOffset);\n\n    /*\n     * GetClassLayout returns detailed information how a specific class is stored.\n     * It only returns the fields defined by the class itself; if the parent class\n     * defined fields as well, the profiler must call GetClassLayout on the parent class\n     * to obtain those fields.\n     *\n     * It will fail with E_INVALIDARG for string and array classes.\n     */\n    HRESULT GetClassLayout(\n                [in]  ClassID classID,\n                [in, out] COR_FIELD_OFFSET rFieldOffset[],\n                [in] ULONG cFieldOffset,\n                [out] ULONG *pcFieldOffset,\n                [out] ULONG *pulClassSize);\n\n    /*\n     * Returns the parent module a class is defined in, along with the\n     * metadata token for the class, the ClassID of its parent class, and the\n     * ClassIDs of its type arguments (if any).\n     *\n     * One can call GetModuleMetaData to obtain the metadata interface for\n     * a given module.  The token can then be used to access the metadata for this\n     * class.\n     */\n    HRESULT GetClassIDInfo2(\n                [in] ClassID classId,\n                [out] ModuleID *pModuleId,\n                [out] mdTypeDef *pTypeDefToken,\n                [out] ClassID *pParentClassId,\n                [in] ULONG32 cNumTypeArgs,\n                [out] ULONG32 *pcNumTypeArgs,\n                [out] ClassID typeArgs[]);\n\n    /*\n     * GetCodeInfo2 returns the extents of native code associated with the\n     * given FunctionID. These extents are returned sorted in order of increasing\n     * IL offset.\n     */\n    HRESULT GetCodeInfo2(\n                [in] FunctionID functionID,\n                [in] ULONG32 cCodeInfos,\n                [out] ULONG32 *pcCodeInfos,\n                [out, size_is(cCodeInfos), length_is(*pcCodeInfos)]\n                COR_PRF_CODE_INFO codeInfos[]);\n\n    /*\n     * GetClassFromTokenAndTypeArgs returns the ClassID of a type given its metadata\n     * token (typedef) and the ClassIDs of its type arguments (if any).\n     *\n     *      cTypeArgs must be equal to the number of type parameters for the given type\n     *          (0 for non-generic types)\n     *      typeArgs may be NULL if cTypeArgs == 0\n     *\n     * Calling this function with a TypeRef token can have unpredictable results; callers\n     * should resolve the TypeRef to a TypeDef and use that.\n     *\n     * If the type is not already loaded, calling this function will cause it to be.\n     * Loading is a dangerous operation in many contexts. For example, calling\n     * this function during loading of modules or other types could lead to an infinite\n     * loop as the runtime attempts to circularly load things.\n     *\n     * In general, use of this function is discouraged. If profilers are interested in\n     * events for a particular type, they should store the ModuleID and TypeDef of that type,\n     * and use GetClassIDInfo2 to check whether a given ClassID is the desired type.\n     */\n    HRESULT GetClassFromTokenAndTypeArgs(\n                    [in] ModuleID moduleID,\n                    [in] mdTypeDef typeDef,\n                    [in] ULONG32 cTypeArgs,\n                    [in, size_is(cTypeArgs)] ClassID typeArgs[],\n                    [out] ClassID* pClassID);\n\n    /*\n     * GetFunctionFromTokenAndTypeArgs returns the FunctionID of a function given\n     * its metadata token (methoddef), containing class, and type args (if any).\n     *\n     *      classID may be 0 if the containing class is not generic\n     *      typeArgs may be NULL if cTypeArgs == 0\n     *\n     * Calling this function with a MethodRef token can have unpredictable results; callers\n     * should resolve the MethodRef to a MethodDef and use that.\n     *\n     * If the function is not already loaded, calling this function will cause it to be.\n     * Loading is a dangerous operation in many contexts. For example, calling\n     * this function during loading of modules or types could lead to an infinite\n     * loop as the runtime attempts to circularly load things.\n     *\n     * In general, use of this function is discouraged. If profilers are interested in\n     * events for a particular function, they should store the ModuleID and MethodDef of that function,\n     * and use GetFunctionInfo2 to check whether a given FunctionID is the desired function.\n     */\n    HRESULT GetFunctionFromTokenAndTypeArgs(\n                    [in] ModuleID moduleID,\n                    [in] mdMethodDef funcDef,\n                    [in] ClassID classId,\n                    [in] ULONG32 cTypeArgs,\n                    [in, size_is(cTypeArgs)] ClassID typeArgs[],\n                    [out] FunctionID* pFunctionID);\n\n    /*\n     * Returns an enumerator over all frozen objects in the given module.\n     */\n    HRESULT EnumModuleFrozenObjects(\n                [in] ModuleID moduleID,\n                [out] ICorProfilerObjectEnum** ppEnum);\n\n\n\n    /*\n     * GetArrayObjectInfo returns detailed information about an array object.\n     * objectId is a valid array object.\n     * cDimensions is the rank (# of dimensions).\n     * On success:\n     *   pDimensionSizes, pDimensionLowerBounds are parallel arrays describing the size and lower bound for each dimension.\n     *   (*ppData) is a pointer to the raw buffer for the array, which is laid out according to the C++\n     *   convention\n     */\n    HRESULT GetArrayObjectInfo(\n                    [in] ObjectID objectId,\n                    [in] ULONG32 cDimensions,\n                    [out, size_is(cDimensions)] ULONG32 pDimensionSizes[],\n                    [out, size_is(cDimensions)] int pDimensionLowerBounds[],\n                    [out] BYTE **ppData);\n\n    /*\n     * GetBoxClassLayout returns information about how a particular value type is laid out\n     * when boxed.\n     *\n     *  *pBufferOffset is the offset (from the ObjectID pointer) to where the value type\n     *  is stored within the box. The value type's class layout may then be used to\n     *  interpret it.\n     */\n    HRESULT GetBoxClassLayout(\n                    [in] ClassID classId,\n                    [out] ULONG32 *pBufferOffset);\n\n\n    /*\n     * GetThreadAppDomain returns the AppDomainID currently associated with\\\n     * the given ThreadID\n     */\n    HRESULT GetThreadAppDomain(\n                    [in] ThreadID threadId,\n                    [out] AppDomainID *pAppDomainId);\n\n\n    /*\n     * GetRVAStaticAddress gets the address of the home for the given\n     * RVA static. It must be called from a managed thread.  Otherwise,\n     * it will return CORPROF_E_NOT_MANAGED_THREAD.\n     */\n    HRESULT GetRVAStaticAddress(\n                    [in] ClassID classId,\n                    [in] mdFieldDef fieldToken,\n                    [out] void **ppAddress);\n\n    /*\n     * GetAppDomainStaticAddress gets the address of the home for the given\n     * AppDomain static in the given AppDomain.\n     *\n     * This function may return CORPROF_E_DATAINCOMPLETE if the given static\n     * has not been assigned a home in the given AppDomain.\n     */\n    HRESULT GetAppDomainStaticAddress(\n                    [in] ClassID classId,\n                    [in] mdFieldDef fieldToken,\n                    [in] AppDomainID appDomainId,\n                    [out] void **ppAddress);\n\n    /*\n     * GetThreadStaticAddress gets the address of the home for the given\n     * Thread static in the given Thread. threadId must be the current thread\n     * ID or NULL, which means using curernt thread ID.\n     *\n     * This function may return CORPROF_E_DATAINCOMPLETE if the given static\n     * has not been assigned a home in the given Thread.\n     */\n    HRESULT GetThreadStaticAddress(\n                    [in] ClassID classId,\n                    [in] mdFieldDef fieldToken,\n                    [in] ThreadID threadId,\n                    [out] void **ppAddress);\n\n    /*\n     * GetContextStaticAddress gets the address of the home for the given\n     * Context static in the given context.  It must be called from a managed\n     * thread.  Otherwise, it will return CORPROF_E_NOT_MANAGED_THREAD.\n     *\n     * This function may return CORPROF_E_DATAINCOMPLETE if the given static\n     * has not been assigned a home in the given Context.\n     */\n    HRESULT GetContextStaticAddress(\n                    [in] ClassID classId,\n                    [in] mdFieldDef fieldToken,\n                    [in] ContextID contextId,\n                    [out] void **ppAddress);\n\n    /*\n     * GetStaticFieldInfo gets COR_PRF_STATIC_TYPE for a specific\n     * field in a class. This information can be used to decide which\n     * function to call to get the address of the static.\n     *\n     * NOTE: One should still check the metadata for a static to ensure\n     * it is actually going to have an address. Statics that are literals\n     * (aka constants) exist only in the metadata and do not have an address.\n     *\n     */\n    HRESULT GetStaticFieldInfo(\n                    [in] ClassID classId,\n                    [in] mdFieldDef fieldToken,\n                    [out] COR_PRF_STATIC_TYPE *pFieldInfo);\n\n    /*\n     * GetGenerationBounds returns the memory regions that make up a given\n     * GC generation in memory. It may be called from any profiler callback as long\n     * as a GC is not in progress. (To be exact, it may be called from any callback\n     * except for those that occur between GarbageCollectionStarted and GarbageCollectionFinished.)\n     *\n     * Most shifting of generations takes place during garbage collections; between\n     * collections generations may grow, but generally do not move around. Therefore\n     * the most interesting places to call this function are in GarbageCollectionStarted\n     * and Finished.\n     *\n     * During program startup, some objects are allocated by the CLR itself, generally\n     * in generations 3 and 0. So by the time managed code starts executing, these\n     * generations will already contain objects. Generations 1 and 2 will be normally\n     * empty, except for dummy objects generated by the garbage collector (of size 12\n     * bytes in 32-bit implementations of the CLR, larger in 64-bit implementations).\n     * You may also see generation 2 ranges that are inside modules generated by ngen.\n     * These are \"frozen objects\" generated at ngen time rather than allocated by the\n     * garbage collector.\n     *\n     * cObjectRanges is a count of the number of elements allocated by the caller for\n     *      the ranges array\n     * pcObjectRanges is an out param for the number of ranges in the given generation\n     * ranges is an array of elements of type COR_PRF_GC_GENERATION_RANGE, each of which\n     *      describes a range of memory used by the garbage collector\n     */\n\n    HRESULT GetGenerationBounds(\n                    [in] ULONG cObjectRanges,\n                    [out] ULONG *pcObjectRanges,\n                    [out, size_is(cObjectRanges), length_is(*pcObjectRanges)] COR_PRF_GC_GENERATION_RANGE ranges[]);\n\n    /*\n     * GetObjectGeneration returns which generation the given object is currently in, along\n     * with the start and length of the segment containing the object. It may be called\n     * at any time as long as a GC is not in progress.\n     */\n\n    HRESULT GetObjectGeneration(\n                    [in] ObjectID objectId,\n                    [out] COR_PRF_GC_GENERATION_RANGE *range);\n\n\n   /*\n     * When an exception notification is received, GetNotifiedExceptionClauseInfo() may be used\n     * to get the native address and frame information for the exception clause (catch/finally/filter)\n     * that is about to be run (ExceptionCatchEnter, ExceptionUnwindFinallyEnter, ExceptionFilterEnter)\n     * or has just been run (ExceptionCatchLeave, ExceptionUnwindFinallyLeave, ExceptionFilterLeave).\n     *\n     * This call may be made at any time after one of the Enter calls above until either the matching\n     * Leave call is received or until a nested exception throws out of the current clause in which case\n     * there will be no Leave notification for that clause.  Note it is not possible for a throw to escape\n     * a Filter so there is always a Leave in that case.\n     *\n     * Return values:\n     *   S_OK indicates success\n     *   S_FALSE indicates that no exception clause is active\n     *   CORPROF_E_NOT_MANAGED_THREAD indicates an unmanaged thread.\n     */\n\n    HRESULT GetNotifiedExceptionClauseInfo(\n                    [out] COR_PRF_EX_CLAUSE_INFO *pinfo);\n}\n\n/*\n * The CLR implements the ICorProfilerInfo3 interface. This interface is\n * used by a code profiler to communicate with the CLR to control event\n * monitoring and request information. The CLR passes an\n * ICorProfilerInfo3 interface to each code profiler during initialization.\n *\n * A code profiler can call methods on the ICorProfilerInfo3 interface to get\n  * information about managed code being executed under the control of the CLR\n *\n * The ICorProfilerInfo3 interface implemented by the CLR uses the free\n * threaded model.\n *\n * The methods implemented on this interface return S_OK on success, or E_FAIL\n * on failure.\n *\n */\n\n[\n    object,\n    uuid(B555ED4F-452A-4E54-8B39-B5360BAD32A0),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo3 : ICorProfilerInfo2\n{\n    /*\n     * Returns an enumerator for all previously jitted functions. May overlap with\n     * functions previously reported via CompilationStarted callbacks.\n     * NOTE: The returned enumeration will only include '0' for the value of the\n     * COR_PRF_FUNCTION::reJitId field.  If you require valid COR_PRF_FUNCTION::reJitId values, use\n     * ICorProfilerInfo4::EnumJITedFunctions2.\n     */\n    HRESULT EnumJITedFunctions([out] ICorProfilerFunctionEnum** ppEnum);\n\n    HRESULT RequestProfilerDetach([in] DWORD dwExpectedCompletionMilliseconds);\n\n    HRESULT SetFunctionIDMapper2(\n                [in] FunctionIDMapper2 *pFunc,\n                [in] void *clientData);\n\n    /*\n     * GetStringLayout2 returns detailed information about how string objects are stored.\n     *\n     * *pStringLengthOffset is the offset (from the ObjectID pointer) to a DWORD that\n     * stores the length of the string itself\n     *\n     * *pBufferOffset is the offset (from the ObjectID pointer) to the actual buffer\n     * of wide characters\n     *\n     * Strings may or may not be null-terminated.\n     */\n    HRESULT GetStringLayout2(\n                [out] ULONG *pStringLengthOffset,\n                [out] ULONG *pBufferOffset);\n\n    /*\n     * The code profiler calls SetFunctionHooks3 to specify handlers\n     * for FunctionEnter3, FunctionLeave3, and FunctionTailcall3, and calls\n     * SetFunctionHooks3WithInfo to specify handlers for FunctionEnter3WithInfo,\n     * FunctionLeave3WithInfo, and FunctionTailcall3WithInfo.\n     *\n     * Note that only one set of callbacks may be active at a time. Thus,\n     * if a profiler calls SetEnterLeaveFunctionHooks, SetEnterLeaveFunctionHooks2\n     * and SetEnterLeaveFunctionHooks3(WithInfo), then SetEnterLeaveFunctionHooks3(WithInfo)\n     * wins.  SetEnterLeaveFunctionHooks2 takes precedence over SetEnterLeaveFunctionHooks\n     * when both are set.\n     *\n     * Each function pointer may be null to disable that callback.\n     *\n     * SetEnterLeaveFunctionHooks3(WithInfo) may only be called from the\n     * profiler's Initialize() callback.\n     */\n    HRESULT SetEnterLeaveFunctionHooks3(\n                [in] FunctionEnter3    *pFuncEnter3,\n                [in] FunctionLeave3    *pFuncLeave3,\n                [in] FunctionTailcall3 *pFuncTailcall3);\n\n\n    HRESULT SetEnterLeaveFunctionHooks3WithInfo(\n                [in] FunctionEnter3WithInfo    *pFuncEnter3WithInfo,\n                [in] FunctionLeave3WithInfo    *pFuncLeave3WithInfo,\n                [in] FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n    /*\n     * The profiler can call GetFunctionEnter3Info to gather frame info and argument info\n     * in FunctionEnter3WithInfo callback. The profiler needs to allocate sufficient space\n     * for COR_PRF_FUNCTION_ARGUMENT_INFO of the function it's inspecting and indicate the\n     * size in a ULONG pointed by pcbArgumentInfo.\n     */\n    HRESULT GetFunctionEnter3Info(\n                [in]  FunctionID functionId,\n                [in]  COR_PRF_ELT_INFO eltInfo,\n                [out] COR_PRF_FRAME_INFO *pFrameInfo,\n                [in, out] ULONG *pcbArgumentInfo,\n                [out, size_is(*pcbArgumentInfo)] COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n    /*\n     * The profiler can call GetFunctionLeave3Info to gather frame info and return value\n     * in FunctionLeave3WithInfo callback.\n     */\n    HRESULT GetFunctionLeave3Info(\n                [in]  FunctionID functionId,\n                [in]  COR_PRF_ELT_INFO eltInfo,\n                [out] COR_PRF_FRAME_INFO *pFrameInfo,\n                [out] COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n    /*\n     * The profiler can call GetFunctionTailcall3Info to gather frame info in\n     * FunctionTailcall3WithInfo callback.\n     */\n    HRESULT GetFunctionTailcall3Info(\n                [in]  FunctionID functionId,\n                [in]  COR_PRF_ELT_INFO eltInfo,\n                [out] COR_PRF_FRAME_INFO *pFrameInfo);\n\n    HRESULT EnumModules([out] ICorProfilerModuleEnum** ppEnum);\n\n    /*\n     * The profiler can call GetRuntimeInformation to query CLR version information.\n     * Passing NULL to any parameter is acceptable except pcchVersionString cannot\n     * be NULL if szVersionString is not NULL.\n     */\n    HRESULT GetRuntimeInformation([out] USHORT *pClrInstanceId,\n                                  [out] COR_PRF_RUNTIME_TYPE *pRuntimeType,\n                                  [out] USHORT *pMajorVersion,\n                                  [out] USHORT *pMinorVersion,\n                                  [out] USHORT *pBuildNumber,\n                                  [out] USHORT *pQFEVersion,\n                                  [in]  ULONG  cchVersionString,\n                                  [out] ULONG  *pcchVersionString,\n                                  [out, annotation(\"_Out_writes_to_(cchVersionString, *pcchVersionString)\")]\n                                        WCHAR  szVersionString[]);\n\n    /*\n     * GetThreadStaticAddress2 gets the address of the home for the given\n     * Thread static in the given Thread.\n     *\n     * This function may return CORPROF_E_DATAINCOMPLETE if the given static\n     * has not been assigned a home in the given Thread.\n     */\n    HRESULT GetThreadStaticAddress2(\n                    [in] ClassID classId,\n                    [in] mdFieldDef fieldToken,\n                    [in] AppDomainID appDomainId,\n                    [in] ThreadID threadId,\n                    [out] void **ppAddress);\n\n    /*\n     * GetAppDomainsContainingModule returns the AppDomainIDs in which the\n     * given module has been loaded\n     */\n    HRESULT GetAppDomainsContainingModule(\n                [in] ModuleID moduleId,\n                [in] ULONG32 cAppDomainIds,\n                [out] ULONG32 *pcAppDomainIds,\n                [out, size_is(cAppDomainIds), length_is(*pcAppDomainIds)] AppDomainID appDomainIds[]);\n\n\n    /*\n     * Retrieve information about a given module.\n     *\n     * When the module is loaded from disk, the name returned will be the filename;\n     * otherwise, the name will be the name from the metadata Module table (i.e.,\n     * the same as the managed System.Reflection.Module.ScopeName).\n     *\n     * *pdwModuleFlags will be filled in with a bitmask of values from COR_PRF_MODULE_FLAGS\n     * that specify some properties of the module.\n     *\n     * NOTE: While this function may be called as soon as the moduleId is alive,\n     * the AssemblyID of the containing assembly will not be available until the\n     * ModuleAttachedToAssembly callback.\n     *\n     */\n    HRESULT GetModuleInfo2(\n                [in]  ModuleID              moduleId,\n                [out] LPCBYTE               *ppBaseLoadAddress,\n                [in]  ULONG                 cchName,\n                [out] ULONG                 *pcchName,\n                [out, annotation(\"_Out_writes_to_(cchName, *pcchName)\")]\n                      WCHAR                 szName[],\n                [out] AssemblyID            *pAssemblyId,\n                [out] DWORD                 *pdwModuleFlags);\n\n\n}\n\n\n/*\n * This interface lets you iterate over the frozen objects from ngen images.\n */\n\n[\n    object,\n    uuid(2C6269BD-2D13-4321-AE12-6686365FD6AF),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerObjectEnum : IUnknown\n{\n    HRESULT Skip(\n                [in] ULONG celt);\n\n    HRESULT Reset();\n\n    HRESULT Clone(\n                    [out] ICorProfilerObjectEnum **ppEnum);\n\n    HRESULT GetCount(\n                    [out] ULONG *pcelt);\n\n    HRESULT Next(\n                    [in] ULONG celt,\n                    [out, size_is(celt), length_is(*pceltFetched)]  ObjectID objects[],\n                    [out] ULONG *pceltFetched);\n}\n\n\n/*\n * This interface lets you iterate over functions in the runtime.\n */\n\n[\n    object,\n    uuid(FF71301A-B994-429D-A10B-B345A65280EF),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerFunctionEnum : IUnknown\n{\n    HRESULT Skip([in] ULONG celt);\n\n    HRESULT Reset();\n\n    HRESULT Clone([out] ICorProfilerFunctionEnum **ppEnum);\n\n    HRESULT GetCount([out] ULONG *pcelt);\n\n    HRESULT Next([in]  ULONG            celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                       COR_PRF_FUNCTION ids[],\n                 [out] ULONG *          pceltFetched);\n};\n\n/*\n * This interface lets you iterate over modules in the runtime.\n */\n\n[\n    object,\n    uuid(b0266d75-2081-4493-af7f-028ba34db891),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerModuleEnum : IUnknown\n{\n    HRESULT Skip([in] ULONG celt);\n\n    HRESULT Reset();\n\n    HRESULT Clone([out] ICorProfilerModuleEnum **ppEnum);\n\n    HRESULT GetCount([out] ULONG *pcelt);\n\n    HRESULT Next([in]  ULONG            celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                       ModuleID         ids[],\n                 [out] ULONG *          pceltFetched);\n};\n\n/*\n * NOTE: DEPRECATED, now you can use your any allocator.\n *\n * This is simple allocator that only allows you to allocate memory.\n * You may not free it.  This was used in conjunction with\n * ICorProfilerInfo::SetILFunctionBody.\n */\n[\n    object,\n    uuid(A0EFB28B-6EE2-4d7b-B983-A75EF7BEEDB8),\n    pointer_default(unique),\n    local\n]\ninterface IMethodMalloc : IUnknown\n{\n    /*\n     * Tries to allocate memory above the start address of the module from\n     * which it was created.  It is important to note that this method may\n     * fail to allocate the memory specified above the start address, and\n     * may as a result return NULL.\n     */\n    PVOID Alloc(\n                    [in] ULONG cb);\n}\n\n/*\n * The CLR implements the ICorProfilerFunctionControl interface. This interface\n * is used by a code profiler to communicate with the CLR to control how the\n * JIT should generate code when rejitting a specific method.\n *\n * The ICorProfilerFunctionControl interface implemented by the CLR uses the\n * free threaded model.\n */\n\n[\n    object,\n    uuid(F0963021-E1EA-4732-8581-E01B0BD3C0C6),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerFunctionControl : IUnknown\n{\n    /*\n     * Set one or more flags from COR_PRF_CODEGEN_FLAGS to control code\n     * generation just for this method.\n     */\n    HRESULT SetCodegenFlags(\n                [in] DWORD flags);\n\n    /*\n     * Override the method body.\n     */\n    HRESULT SetILFunctionBody(\n                [in]                               ULONG   cbNewILMethodHeader,\n                [in, size_is(cbNewILMethodHeader)] LPCBYTE pbNewILMethodHeader);\n\n    /*\n     * This is not currently implemented, and will return E_NOTIMPL\n     */\n    HRESULT SetILInstrumentedCodeMap(\n                [in]                         ULONG      cILMapEntries,\n                [in, size_is(cILMapEntries)] COR_IL_MAP rgILMapEntries[]);\n\n}\n\n/*\n * The CLR implements the ICorProfilerInfo4 interface. This interface is\n * used by a code profiler to communicate with the CLR to control event\n * monitoring and request information. The CLR passes an\n * ICorProfilerInfo4 interface to each code profiler during initialization.\n *\n * A code profiler can call methods on the ICorProfilerInfo4 interface to get\n  * information about managed code being executed under the control of the CLR\n *\n * The ICorProfilerInfo4 interface implemented by the CLR uses the free\n * threaded model.\n *\n * The methods implemented on this interface return S_OK on success, or E_FAIL\n * on failure.\n *\n */\n\n[\n    object,\n    uuid(0d8fdcaa-6257-47bf-b1bf-94dac88466ee),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo4 : ICorProfilerInfo3\n{\n    HRESULT EnumThreads([out] ICorProfilerThreadEnum **ppEnum);\n    HRESULT InitializeCurrentThread();\n\n    /*\n     * Call RequestReJIT to have the runtime re-JIT a particular set of methods.\n     * A code profiler can then adjust the code generated when the method is\n     * re-JITed through the ICorProfilerFunctionControl interface.  This does\n     * not impact currently executing methods, only future invocations.\n     *\n     * A return code of S_OK indicates that all of the requested methods were\n     * attempted to be rejitted.   However, the profiler must implement\n     * ICorProfilerCallback4::ReJITError to determine which of the methods were\n     * successfully re-JITed.\n     *\n     * A failure return value (E_*) indicates some failure that prevents any\n     * re-JITs.\n     */\n    HRESULT RequestReJIT(\n                [in]                       ULONG       cFunctions,\n                [in, size_is(cFunctions)]  ModuleID    moduleIds[],\n                [in, size_is(cFunctions)]  mdMethodDef methodIds[]);\n\n    /*\n     * RequestRevert will instruct the runtime to revert to using/calling the\n     * original method (original IL and flags) rather than whatever was\n     * ReJITed.  This does not change any currently active methods, only future\n     * invocations.\n     *\n     */\n    HRESULT RequestRevert(\n                [in]                       ULONG       cFunctions,\n                [in, size_is(cFunctions)]  ModuleID    moduleIds[],\n                [in, size_is(cFunctions)]  mdMethodDef methodIds[],\n                [out, size_is(cFunctions)] HRESULT     status[]);\n\n    /*\n     * Same as GetCodeInfo2, except instead of always returning the code info\n     * associated with the original IL/function, you can request the code info\n     * for a particular re-JITed version of a function.\n     */\n    HRESULT GetCodeInfo3(\n                [in]  FunctionID           functionID,\n                [in]  ReJITID              reJitId,\n                [in]  ULONG32              cCodeInfos,\n                [out] ULONG32 *            pcCodeInfos,\n                [out, size_is(cCodeInfos), length_is(*pcCodeInfos)]\n                      COR_PRF_CODE_INFO    codeInfos[]);\n\n    /*\n     * Same as GetFunctionFromIP, but also returns which re-JITed version is\n     * associated with the IP address.\n     */\n    HRESULT GetFunctionFromIP2(\n                [in]  LPCBYTE      ip,\n                [out] FunctionID * pFunctionId,\n                [out] ReJITID *    pReJitId);\n\n    /*\n     * GetReJITIDs can be used to find all of the re-JITed versions of the\n     * given function.\n     */\n    HRESULT GetReJITIDs(\n                [in]  FunctionID          functionId,\n                [in]  ULONG               cReJitIds,\n                [out] ULONG *             pcReJitIds,\n                [out, size_is(cReJitIds), length_is(*pcReJitIds)]\n                      ReJITID             reJitIds[]);\n\n    /*\n     * Same as GetILToNativeMapping, but allows the code profiler to specify\n     * which re-JITed version it applies to.\n     */\n    HRESULT GetILToNativeMapping2(\n                [in]  FunctionID                       functionId,\n                [in]  ReJITID                          reJitId,\n                [in]  ULONG32                          cMap,\n                [out] ULONG32 *                        pcMap,\n                [out, size_is(cMap),length_is(*pcMap)]\n                      COR_DEBUG_IL_TO_NATIVE_MAP       map[]);\n\n    /*\n     * Returns an enumerator for all previously jitted functions. May overlap with\n     * functions previously reported via CompilationStarted callbacks.  The returned\n     * enumeration will include values for the COR_PRF_FUNCTION::reJitId field\n     */\n    HRESULT EnumJITedFunctions2([out] ICorProfilerFunctionEnum** ppEnum);\n\n    /*\n     * The code profiler calls GetObjectSize to obtain the size of an object.\n     * Note that types like arrays and strings may have a different size for each object.\n     */\n    HRESULT GetObjectSize2(\n                [in]  ObjectID objectId,\n                [out] SIZE_T *pcSize);\n\n}\n\n[\n    object,\n    uuid(07602928-CE38-4B83-81E7-74ADAF781214),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo5 : ICorProfilerInfo4\n{\n    /*\n     * The code profiler calls GetEventMask2 to obtain the current event\n     * categories for which it is to receive event notifications from the CLR\n     *\n     * *pdwEventsLow is a bitwise combination of values from COR_PRF_MONITOR\n     * *pdwEventsHigh is a bitwise combination of values from COR_PRF_HIGH_MONITOR\n     */\n    HRESULT GetEventMask2(\n            [out] DWORD *pdwEventsLow,\n            [out] DWORD *pdwEventsHigh);\n\n    /*\n     * The code profiler calls SetEventMask2 to set the event categories for\n     * which it is set to receive notification from the CLR.\n     *\n     * dwEventsLow is a bitwise combination of values from COR_PRF_MONITOR\n     * dwEventsHigh is a bitwise combination of values from COR_PRF_HIGH_MONITOR\n     */\n    HRESULT SetEventMask2(\n            [in] DWORD dwEventsLow,\n            [in] DWORD dwEventsHigh);\n};\n\n\n[\n    object,\n    uuid(F30A070D-BFFB-46A7-B1D8-8781EF7B698A),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo6 : ICorProfilerInfo5\n{\n    /*\n    * Returns an enumerator for all methods that\n    * - belong to a given NGen or R2R module (inlinersModuleId) and\n    * - inlined a body of a given method (inlineeModuleId / inlineeMethodId).\n    *\n    * If incompleteData is set to TRUE after function is called, it means that the methods enumerator\n    * doesn't contain all methods inlining a given method.\n    * It can happen when one or more direct or indirect dependencies of inliners module haven't been loaded yet.\n    * If profiler needs accurate data it should retry later when more modules are loaded (preferably on each module load).\n    *\n    * It can be used to lift limitation on inlining for ReJIT.\n    *\n    * NOTE: If the inlinee method is decorated with the System.Runtime.Versioning.NonVersionable attribute then\n    * then some inliners may not ever be reported. If you need to get a full accounting you can avoid the issue\n    * by disabling the use of all native images.\n    *\n    */\n    HRESULT EnumNgenModuleMethodsInliningThisMethod(\n        [in] ModuleID    inlinersModuleId,\n        [in] ModuleID    inlineeModuleId,\n        [in] mdMethodDef inlineeMethodId,\n        [out] BOOL        *incompleteData,\n        [out] ICorProfilerMethodEnum** ppEnum);\n};\n\n[\n    object,\n    uuid(9AEECC0D-63E0-4187-8C00-E312F503F663),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo7 : ICorProfilerInfo6\n{\n    /*\n    * Applies the newly emitted Metadata.\n    *\n    * This method can be used to apply the newly defined metadata by IMetadataEmit::Define* methods\n    * to the module.\n    *\n    * If metadata changes are made after ModuleLoadFinished callback,\n    * it is required to call this method before using the new metadata\n    */\n    HRESULT ApplyMetaData(\n        [in] ModuleID    moduleId);\n\n    /* Returns the length of an in-memory symbol stream\n    *\n    * If the module has in-memory symbols the length of the stream will\n    * be placed in pCountSymbolBytes. If the module doesn't have in-memory\n    * symbols, *pCountSymbolBytes = 0\n    *\n    * Returns S_OK if the length could be determined (even if it is 0)\n    *\n    * Note: The current implementation does not support reflection.emit.\n    * CORPROF_E_MODULE_IS_DYNAMIC will be returned in that case.\n    */\n    HRESULT GetInMemorySymbolsLength(\n        [in] ModuleID moduleId,\n        [out] DWORD* pCountSymbolBytes);\n\n    /* Reads bytes from an in-memory symbol stream\n    *\n    * This function attempts to read countSymbolBytes of data starting at offset\n    * symbolsReadOffset within the in-memory stream. The data will be copied into\n    * pSymbolBytes which is expected to have countSymbolBytes of space available.\n    * pCountSymbolsBytesRead contains the actual number of bytes read which\n    * may be less than countSymbolBytes if the end of the stream is reached.\n    *\n    * Returns S_OK if a non-zero number of bytes were read.\n    *\n    * Note: The current implementation does not support reflection.emit.\n    * CORPROF_E_MODULE_IS_DYNAMIC will be returned in that case.\n    */\n    HRESULT ReadInMemorySymbols(\n        [in] ModuleID moduleId,\n        [in] DWORD symbolsReadOffset,\n        [out] BYTE* pSymbolBytes,\n        [in] DWORD countSymbolBytes,\n        [out] DWORD* pCountSymbolBytesRead);\n\n};\n\n[\n    object,\n    uuid(C5AC80A6-782E-4716-8044-39598C60CFBF),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo8 : ICorProfilerInfo7\n{\n    /*\n    * Determines if a function has associated metadata\n    *\n    * Certain methods like IL Stubs or LCG Methods do not have\n    * associated metadata that can be retrieved using the IMetaDataImport APIs.\n    *\n    * Such methods can be encountered by profilers through instruction pointers\n    * or by listening to ICorProfilerCallback::DynamicMethodJITCompilationStarted\n    *\n    * This API can be used to determine whether a FunctionID is dynamic.\n    */\n    HRESULT IsFunctionDynamic( [in]  FunctionID  functionId,\n                               [out] BOOL        *isDynamic);\n\n    /*\n    * Maps a managed code instruction pointer to a FunctionID.\n    *\n    * GetFunctionFromIP2 fails for dynamic methods, this method works for\n    * both dynamic and non-dynamic methods. It is a superset of GetFunctionFromIP2\n    */\n    HRESULT GetFunctionFromIP3([in] LPCBYTE ip,\n                               [out] FunctionID *functionId,\n                               [out] ReJITID * pReJitId);\n\n    /*\n    * Retrieves information about dynamic methods\n    *\n    * Certain methods like IL Stubs or LCG do not have\n    * associated metadata that can be retrieved using the IMetaDataImport APIs.\n    *\n    * Such methods can be encountered by profilers through instruction pointers\n    * or by listening to ICorProfilerCallback::DynamicMethodJITCompilationStarted\n    *\n    * This API can be used to retrieve information about dynamic methods\n    * including a friendly name if available.\n    */\n    HRESULT GetDynamicFunctionInfo( [in]  FunctionID              functionId,\n                                    [out] ModuleID                *moduleId,\n                                    [out] PCCOR_SIGNATURE         *ppvSig,\n                                    [out] ULONG                   *pbSig,\n                                    [in]  ULONG                   cchName,\n                                    [out] ULONG                   *pcchName,\n                                    [out] WCHAR                    wszName[]);\n};\n\n[\n    object,\n    uuid(008170DB-F8CC-4796-9A51-DC8AA0B47012),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo9 : ICorProfilerInfo8\n{\n    //Given functionId + rejitId, enumerate the native code start address of all jitted versions of this code that currently exist\n    HRESULT GetNativeCodeStartAddresses(FunctionID functionID, ReJITID reJitId, ULONG32 cCodeStartAddresses, ULONG32 *pcCodeStartAddresses, UINT_PTR codeStartAddresses[]);\n\n    //Given the native code start address, return the native->IL mapping information for this jitted version of the code\n    HRESULT GetILToNativeMapping3(UINT_PTR pNativeCodeStartAddress, ULONG32 cMap, ULONG32 *pcMap, COR_DEBUG_IL_TO_NATIVE_MAP map[]);\n\n    //Given the native code start address, return the blocks of virtual memory that store this code (method code is not necessarily stored in a single contiguous memory region)\n    HRESULT GetCodeInfo4(UINT_PTR pNativeCodeStartAddress, ULONG32 cCodeInfos, ULONG32* pcCodeInfos, COR_PRF_CODE_INFO codeInfos[]);\n};\n\n[\n    object,\n    uuid(2F1B5152-C869-40C9-AA5F-3ABE026BD720),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo10 : ICorProfilerInfo9\n{\n    // Given an ObjectID, callback and clientData, enumerates each object reference (if any).\n    HRESULT EnumerateObjectReferences(ObjectID objectId, ObjectReferenceCallback callback, void* clientData);\n\n    // Given an ObjectID, determines whether it is in a read only segment.\n    HRESULT IsFrozenObject(ObjectID objectId, BOOL *pbFrozen);\n\n    // Gets the value of the configured LOH Threshold.\n    HRESULT GetLOHObjectSizeThreshold(DWORD *pThreshold);\n\n    /*\n     * This method will ReJIT the methods requested, as well as any inliners\n     * of the methods requested.\n     *\n     * RequestReJIT does not do any tracking of inlined methods. The profiler\n     * was expected to track inlining and call RequestReJIT for all inliners\n     * to make sure every instance of an inlined method was ReJITted.\n     * This poses a problem with ReJIT on attach, since the profiler was\n     * not present to monitor inlining. This method can be called to guarantee\n     * that the full set of inliners will be ReJITted as well.\n     */\n    HRESULT RequestReJITWithInliners(\n                [in]                       DWORD       dwRejitFlags,\n                [in]                       ULONG       cFunctions,\n                [in, size_is(cFunctions)]  ModuleID    moduleIds[],\n                [in, size_is(cFunctions)]  mdMethodDef methodIds[]);\n\n    // Suspend the runtime without performing a GC.\n    HRESULT SuspendRuntime();\n\n    // Restart the runtime from a previous suspension.\n    HRESULT ResumeRuntime();\n}\n\n[\n    object,\n    uuid(06398876-8987-4154-B621-40A00D6E4D04),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo11 : ICorProfilerInfo10\n{\n    /*\n     * Get environment variable for the running managed code.\n     */\n    HRESULT GetEnvironmentVariable(\n                [in, string] const WCHAR *szName,\n                [in]         ULONG cchValue,\n                [out]        ULONG *pcchValue,\n                [out, annotation(\"_Out_writes_to_(cchValue, *pcchValue)\")]\n                             WCHAR szValue[]);\n\n    /*\n     * Set environment variable for the running managed code.\n     *\n     * The code profiler calls this function to modify environment variables of the\n     * current managed process. For example, it can be used in the profiler's Initialize()\n     * or InitializeForAttach() callbacks.\n     *\n     * szName is the name of the environment variable, should not be NULL.\n     *\n     * szValue is the contents of the environment variable, or NULL if the variable should be deleted.\n     */\n    HRESULT SetEnvironmentVariable(\n                [in, string] const WCHAR *szName,\n                [in, string] const WCHAR *szValue);\n}\n\n[\n    object,\n    uuid(27b24ccd-1cb1-47c5-96ee-98190dc30959),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo12 : ICorProfilerInfo11\n{\n    HRESULT EventPipeStartSession(\n        [in]  UINT32                            cProviderConfigs,\n        [in, size_is(cProviderConfigs)]\n              COR_PRF_EVENTPIPE_PROVIDER_CONFIG pProviderConfigs[],\n        [in]  BOOL                              requestRundown,\n        [out] EVENTPIPE_SESSION*                pSession);\n\n    HRESULT EventPipeAddProviderToSession(\n        [in] EVENTPIPE_SESSION                 session,\n        [in] COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig);\n\n    HRESULT EventPipeStopSession(\n        [in] EVENTPIPE_SESSION session);\n\n    HRESULT EventPipeCreateProvider(\n                [in, string] const WCHAR    *providerName,\n                [out] EVENTPIPE_PROVIDER    *pProvider);\n\n    HRESULT EventPipeGetProviderInfo(\n                [in] EVENTPIPE_PROVIDER provider,\n                [in]  ULONG      cchName,\n                [out] ULONG      *pcchName,\n                [out, annotation(\"_Out_writes_to_(cchName, *pcchName)\")]\n                      WCHAR      providerName[]);\n\n    HRESULT EventPipeDefineEvent(\n                [in] EVENTPIPE_PROVIDER     provider,\n                [in, string] const WCHAR   *eventName,\n                [in] UINT32                 eventID,\n                [in] UINT64                 keywords,\n                [in] UINT32                 eventVersion,\n                [in] UINT32                 level,\n                [in] UINT8                  opcode,\n                [in] BOOL                   needStack,\n                [in] UINT32                 cParamDescs,\n                [in, size_is(cParamDescs)]\n                     COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[],\n                [out] EVENTPIPE_EVENT      *pEvent);\n\n    HRESULT EventPipeWriteEvent(\n                [in] EVENTPIPE_EVENT    event,\n                [in] UINT32             cData,\n                [in, size_is(cData)]\n                     COR_PRF_EVENT_DATA data[],\n                [in] LPCGUID            pActivityId,\n                [in] LPCGUID            pRelatedActivityId);\n}\n\n[\n    object,\n    uuid(6E6C7EE2-0701-4EC2-9D29-2E8733B66934),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerInfo13 : ICorProfilerInfo12\n{\n    HRESULT CreateHandle(\n        [in]  ObjectID object,\n        [in]  COR_PRF_HANDLE_TYPE type,\n        [out] ObjectHandleID* pHandle);\n\n    HRESULT DestroyHandle(\n        [in] ObjectHandleID handle);\n\n    HRESULT GetObjectIDFromHandle(\n        [in] ObjectHandleID handle,\n        [out] ObjectID* pObject);\n}\n\n/*\n* This interface lets you iterate over methods in the runtime.\n*/\n\n[\n    object,\n    uuid(FCCEE788-0088-454B-A811-C99F298D1942),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerMethodEnum : IUnknown\n{\n    HRESULT Skip([in] ULONG celt);\n\n    HRESULT Reset();\n\n    HRESULT Clone([out] ICorProfilerMethodEnum **ppEnum);\n\n    HRESULT GetCount([out] ULONG *pcelt);\n\n    HRESULT Next([in]  ULONG   celt,\n        [out, size_is(celt), length_is(*pceltFetched)]\n        COR_PRF_METHOD         elements[],\n        [out] ULONG *          pceltFetched);\n}\n\n/*\n * This interface lets you iterate over threads in the runtime.\n */\n\n[\n    object,\n    uuid(571194f7-25ed-419f-aa8b-7016b3159701),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerThreadEnum : IUnknown\n{\n    HRESULT Skip([in] ULONG celt);\n\n    HRESULT Reset();\n\n    HRESULT Clone([out] ICorProfilerThreadEnum **ppEnum);\n\n    HRESULT GetCount([out] ULONG *pcelt);\n\n    HRESULT Next([in]  ULONG            celt,\n                 [out, size_is(celt), length_is(*pceltFetched)]\n                       ThreadID         ids[],\n                 [out] ULONG *          pceltFetched);\n}\n\n\n/*\n * This interface is given to the profiler in the GetAssemblyReferences() callback, to\n * allow the profiler to inform the CLR of assembly references that the profiler plans to\n * add later on during ModuleLoadFinished.  This improves the accuracy of the CLR assembly\n * reference closure walker, and its algorithms for determining whether assemblies may be shared\n *\n * This interface is valid for use only within the GetAssemblyReferences callback that passed\n * this interface to the profiler\n */\n[\n    object,\n    uuid(66A78C24-2EEF-4F65-B45F-DD1D8038BF3C),\n    pointer_default(unique),\n    local\n]\ninterface ICorProfilerAssemblyReferenceProvider : IUnknown\n{\n    // The profiler calls this for each target assembly it plans to reference from the\n    // assembly specified in the wszAssemblyPath argument of the GetAssemblyReferences callback.\n    HRESULT AddAssemblyReference(const COR_PRF_ASSEMBLY_REFERENCE_INFO * pAssemblyRefInfo);\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corpub.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/* -------------------------------------------------------------------------- *\n * Common Language Runtime Process Publishing Interfaces\n * -------------------------------------------------------------------------- */\n\ncpp_quote(\"#if 0\")\n#ifndef DO_NO_IMPORTS\nimport \"unknwn.idl\";\n#endif\ncpp_quote(\"#endif\")\n\ntypedef enum\n{\n    COR_PUB_MANAGEDONLY                 = 0x00000001    // Must always be set,\n                                                        // only enumerates\n                                                        // managed processes\n} COR_PUB_ENUMPROCESS;\n\n\n/* -------------------------------------------------------------------------- *\n * Forward declarations\n * -------------------------------------------------------------------------- */\n#pragma warning(push)\n#pragma warning(disable:28718)    //Unable to annotate as this is not a local interface\n\ninterface ICorPublish;\ninterface ICorPublishProcess;\ninterface ICorPublishAppDomain;\ninterface ICorPublishProcessEnum;\ninterface ICorPublishAppDomainEnum;\n\n#pragma warning(pop)\n\n/* ------------------------------------------------------------------------- *\n * Library definition\n * ------------------------------------------------------------------------- */\n\n[\n  uuid(e97ca460-657d-11d3-8d5b-00104b35e7ef),\n  version(1.0),\n  helpstring(\"Common Language Runtime Process Publishing Library\")\n]\nlibrary CorpubProcessLib\n{\n    importlib(\"STDOLE2.TLB\");\n\n    // CorPublish is a shared component across all version of the runtime.\n    [\n        uuid(047a9a40-657e-11d3-8d5b-00104b35e7ef)\n    ]\n    coclass CorpubPublish\n    {\n        [default] interface ICorPublish;\n        interface            ICorPublishProcess;\n        interface            ICorPublishAppDomain;\n        interface            ICorPublishProcessEnum;\n        interface            ICorPublishAppDomainEnum;\n    };\n};\n\n\n/* -------------------------------------------------------------------------- *\n * Interface definitions\n * -------------------------------------------------------------------------- */\n\n/*\n * This interface is the top level interface for publishing of processes.\n */\n[\n    object,\n    uuid(9613A0E7-5A68-11d3-8F84-00A0C9B4D50C),\n    pointer_default(unique),\n    local\n]\ninterface ICorPublish : IUnknown\n{\n    /*\n     * Retrieves a list of managed processes on this machine which\n     * the current user has permission to debug.  In this version,\n     * Type must always be equal to COR_PUB_MANAGEDONLY.\n     * The list is based on a snapshot of the processes running when\n     * the enum method is called.  The enumerator will not reflect any\n     * processes that start before or terminate after EnumProcesses is called.\n     * If EnumProcesses is called more than once on this ICorPublish\n     * instance, a new up-to-date enumeration will be returned without\n     * affecting any previous ones.\n     */\n    HRESULT EnumProcesses([in] COR_PUB_ENUMPROCESS Type,\n                          [out] ICorPublishProcessEnum **ppIEnum);\n\n    /*\n     * Gets a new ICorPublishProcess object for the managed process\n     * with the given process ID.  Returns failure if the process doesn't\n     * exist, or isn't a managed process that can be debugged by the current\n     * user.\n     */\n    HRESULT GetProcess([in] unsigned pid,\n                       [out] ICorPublishProcess **ppProcess);\n}\n\n/*\n * An abstract enumerator.\n */\n[\n    object,\n    uuid(C0B22967-5A69-11d3-8F84-00A0C9B4D50C),\n    pointer_default(unique),\n    local\n]\ninterface ICorPublishEnum : IUnknown\n{\n    /*\n     * Moves the current position forward the given number of\n     * elements.\n     */\n    HRESULT Skip([in] ULONG celt);\n\n    /*\n     * Sets the position of the enumerator to the beginning of the\n     * enumeration.\n     */\n    HRESULT Reset();\n\n    /*\n     * Creates another enumerator with the same current position\n     * as this one.\n     */\n    HRESULT Clone([out] ICorPublishEnum **ppEnum);\n\n    /*\n     * Gets the number of elements in the enumeration\n     */\n    HRESULT GetCount([out] ULONG *pcelt);\n};\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n/*\n * Describes a process on a machine.\n */\n[\n    object,\n    uuid(18D87AF1-5A6A-11d3-8F84-00A0C9B4D50C),\n    pointer_default(unique),\n    local\n]\ninterface ICorPublishProcess : IUnknown\n{\n    /*\n     * Returns true if the process is known to have managed code\n     * running in it.  Since this version of ICorPublish only provides access\n     * to managed processes, this method always returns true.\n     */\n    HRESULT IsManaged([out] BOOL *pbManaged);\n\n    /*\n     * Enumerates the list of known application domains in this process.\n     * This list is based on a snapshot of the existing AppDomains when\n     * this method is called.  This method may be called more than\n     * once to create a new up-to-date list.  Existing enumerations will not\n     * be affected by calls to this method.  If the process has been\n     * terminated, this will fail with CORDBG_E_PROCESS_TERMINATED.\n     */\n    HRESULT EnumAppDomains([out] ICorPublishAppDomainEnum **ppEnum);\n\n    /*\n     * Returns the OS ID for this process.\n     */\n    HRESULT GetProcessID([out] unsigned *pid);\n\n    /*\n     * Get the full path of the executable for this process.\n     * If szName is non-null, this copies up to cchName characters (including\n     * the null terminator) into szName, and ensures it is null-terminated.\n     * If pcchName is non-null, the actual number of characters in the name\n     * (including the null terminator) is stored there.  This method returns\n     * S_OK regardless of how many characters were copied.\n     */\n    HRESULT GetDisplayName([in] ULONG32 cchName,\n                           [out] ULONG32 *pcchName,\n                           [out, size_is(cchName),\n                           length_is(*pcchName)] WCHAR *szName);\n}\n#pragma warning(pop)\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n/*\n * Provide information on an Application Domain object.\n */\n[\n    object,\n    uuid(D6315C8F-5A6A-11d3-8F84-00A0C9B4D50C),\n    pointer_default(unique),\n    local\n]\ninterface ICorPublishAppDomain : IUnknown\n{\n    /*\n     * Gets the identification number of this application domain.\n     * Note that this number is unique to this AppDomain, but only\n     * within the containing process.\n     */\n    HRESULT GetID([out] ULONG32 *puId);\n\n    /*\n     * Get the name for an application domain.\n     * If szName is non-null, this copies up to cchName characters (including\n     * the null terminator) into szName, and ensures it is null-terminated.\n     * If pcchName is non-null, the actual number of characters in the name\n     * (including the null terminator) is stored there.  This method returns\n     * S_OK regardless of how many characters were copied.\n     */\n    HRESULT GetName([in] ULONG32 cchName,\n                    [out] ULONG32 *pcchName,\n                    [out, size_is(cchName),\n                    length_is(*pcchName)] WCHAR *szName);\n}\n#pragma warning(pop)\n\n\n/*\n * Enumerate a list of processes based on the filter criteria given\n * when the enumerator object was created.\n */\n[\n    object,\n    uuid(A37FBD41-5A69-11d3-8F84-00A0C9B4D50C),\n    pointer_default(unique),\n    local\n]\ninterface ICorPublishProcessEnum : ICorPublishEnum\n{\n    /*\n     * Gets the next \"celt\" processes in the enumeration.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt),\n                  length_is(*pceltFetched)] ICorPublishProcess **objects,\n                 [out] ULONG *pceltFetched);\n}\n\n/*\n * Enumerate a list of app domains based in a process.\n */\n[\n    object,\n    uuid(9F0C98F5-5A6A-11d3-8F84-00A0C9B4D50C),\n    pointer_default(unique),\n    local\n]\ninterface ICorPublishAppDomainEnum : ICorPublishEnum\n{\n    /*\n     * Gets the next \"celt\" application domains in the enumeration.\n     */\n    HRESULT Next([in] ULONG celt,\n                 [out, size_is(celt),\n                  length_is(*pceltFetched)] ICorPublishAppDomain **objects,\n                 [out] ULONG *pceltFetched);\n}\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/corsym.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/* ------------------------------------------------------------------------- *\n * Common Language Runtime Debugging Symbol Reader/Writer/Binder Interfaces\n * ------------------------------------------------------------------------- */\n\n/* ------------------------------------------------------------------------- *\n * Imported types\n * ------------------------------------------------------------------------- */\n\ncpp_quote(\"#if 0\")\ntypedef UINT32 mdToken;\ntypedef mdToken mdTypeDef;\ntypedef mdToken mdMethodDef;\ntypedef SIZE_T IMAGE_DEBUG_DIRECTORY;\ncpp_quote(\"#endif\")\n\ncpp_quote(\"#ifndef __CORHDR_H__\")\ntypedef mdToken mdSignature;\ncpp_quote(\"#endif\")\n\n#include \"winerror.h\"\n\n/* ------------------------------------------------------------------------- *\n * Guids for known languages, language vendors, and document types\n * ------------------------------------------------------------------------- */\n\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_C, 0x63a08714, 0xfc37, 0x11d2, 0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_CPlusPlus, 0x3a12d0b7, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_CSharp, 0x3f5162f8, 0x07c6, 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_Basic, 0x3a12d0b8, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_Java, 0x3a12d0b4, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_Cobol, 0xaf046cd1, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_Pascal, 0xaf046cd2, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_ILAssembly, 0xaf046cd3, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_JScript, 0x3a12d0b6, 0xc26c, 0x11d0, 0xb4, 0x42, 0x00, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_SMC, 0xd9b9f7b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageType_MCPlusPlus, 0x4b35fde8, 0x07c6, 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\")\ncpp_quote(\"EXTERN_GUID(CorSym_LanguageVendor_Microsoft, 0x994b45c4, 0xe6e9, 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\")\ncpp_quote(\"EXTERN_GUID(CorSym_DocumentType_Text, 0x5a869d0b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd);\")\ncpp_quote(\"EXTERN_GUID(CorSym_DocumentType_MC, 0xeb40cb65, 0x3c1f, 0x4352, 0x9d, 0x7b, 0xba, 0xf, 0xc4, 0x7a, 0x9d, 0x77);\")\n\n#ifdef INTEROPLIB\nmodule LanguageType\n{\n\tconst LPSTR C = \t\"{63a08714-fc37-11d2-904c-00c04fa302a1}\";\n\tconst LPSTR CPlusPlus = \"{3a12d0b7-c26c-11d0-b442-00a0244a1dd2}\";\n\tconst LPSTR CSharp = \t\"{3f5162f8-07c6-11d3-9053-00c04fa302a1}\";\n\tconst LPSTR Basic = \t\"{3a12d0b8-c26c-11d0-b442-00a0244a1dd2}\";\n\tconst LPSTR Java = \t\"{3a12d0b4-c26c-11d0-b442-00a0244a1dd2}\";\n\tconst LPSTR Cobol = \t\"{af046cd1-d0e1-11d2-977c-00a0c9b4d50c}\";\n\tconst LPSTR Pascal = \t\"{af046cd2-d0e1-11d2-977c-00a0c9b4d50c}\";\n\tconst LPSTR ILAssembly =\"{af046cd3-d0e1-11d2-977c-00a0c9b4d50c}\";\n\tconst LPSTR JScript = \t\"{3a12d0b6-c26c-11d0-b442-00a0244a1dd2}\";\n\tconst LPSTR SMC = \t\"{0d9b9f7b-6611-11d3-bd2a-0000f80849bd}\";\n\tconst LPSTR MCPlusPlus =\"{4b35fde8-07c6-11d3-9053-00c04fa302a1}\";\n}\n\n\nmodule ErrorCodes80\n{\n\tconst int E_SYM_DESTROYED = MAKE_HRESULT(1, FACILITY_ITF, 0xdead);\n}\n\n\n#endif // ndef INTEROPLIB\n\n\n/* ------------------------------------------------------------------------- *\n * Guids for known Source Hash Algorithms\n * ------------------------------------------------------------------------- */\n\ncpp_quote(\"EXTERN_GUID(CorSym_SourceHash_MD5,  0x406ea660, 0x64cf, 0x4c82, 0xb6, 0xf0, 0x42, 0xd4, 0x81, 0x72, 0xa7, 0x99);\")\ncpp_quote(\"EXTERN_GUID(CorSym_SourceHash_SHA1, 0xff1816ec, 0xaa5e, 0x4d10, 0x87, 0xf7, 0x6f, 0x49, 0x63, 0x83, 0x34, 0x60);\")\n\n\n/* ------------------------------------------------------------------------- *\n * Forward declarations\n * ------------------------------------------------------------------------- */\n\ninterface ISymUnmanagedDocument;\ninterface ISymUnmanagedDocumentWriter;\ninterface ISymUnmanagedMethod;\ninterface ISymUnmanagedNamespace;\ninterface ISymUnmanagedReader;\ninterface ISymUnmanagedReaderSymbolSearchInfo;\ninterface ISymUnmanagedScope;\ninterface ISymUnmanagedVariable;\ninterface ISymUnmanagedSymbolSearchInfo;\ninterface ISymUnmanagedWriter;\ninterface ISymUnmanagedWriter2;\ninterface ISymUnmanagedBinder;\n\n/* ------------------------------------------------------------------------- *\n * CorSymAddrKind -- specifies the kinds of addresses used by the interfaces\n * ------------------------------------------------------------------------- */\n\ntypedef enum CorSymAddrKind\n{\n    /*\n     * ADDR_IL_OFFSET: addr1 = IL local var or param index.\n     */\n    ADDR_IL_OFFSET = 1,\n\n    /*\n     * ADDR_NATIVE_RVA: addr1 = RVA into module.\n     */\n    ADDR_NATIVE_RVA = 2,\n\n    /*\n     * ADDR_NATIVE_REGISTER: addr1 = register the var is stored in.\n     */\n    ADDR_NATIVE_REGISTER = 3,\n\n    /*\n     * ADDR_NATIVE_REGREL: addr1 = register, addr2 = offset.\n     */\n    ADDR_NATIVE_REGREL = 4,\n\n    /*\n     * ADDR_NATIVE_OFFSET: addr1 = offset from start of parent.\n     */\n    ADDR_NATIVE_OFFSET = 5,\n\n    /*\n     * ADDR_NATIVE_REGREG: addr1 = reg low, addr2 = reg high.\n     */\n    ADDR_NATIVE_REGREG = 6,\n\n    /*\n     * ADDR_NATIVE_REGSTK: addr1 = reg low, addr2 = reg stk, addr3 = offset.\n     */\n    ADDR_NATIVE_REGSTK = 7,\n\n    /*\n     * ADDR_NATIVE_STKREG: addr1 = reg stk, addr2 = offset, addr3 = reg high.\n     */\n    ADDR_NATIVE_STKREG = 8,\n\n    /*\n     * ADDR_BITFIELD: addr1 = field start, addr = field length.\n     */\n    ADDR_BITFIELD = 9,\n\n    /*\n     * ADDR_NATIVE_SECTOFF: addr1 = section, addr = offset\n     */\n    ADDR_NATIVE_ISECTOFFSET = 10\n\n} CorSymAddrKind;\n\ntypedef enum CorSymVarFlag {\n\n    /*\n     * VAR_IS_COMP_GEN: Variable is compiler generated.\n     */\n    VAR_IS_COMP_GEN = 1\n\n} CorSymVarFlag;\n\n/* ------------------------------------------------------------------------- *\n * Library definition\n *\n * Use the _SxS coclasses for tools designed to work with .NET Framework\n * 1.1 and above. On computers that only have version 1.0 installed, fall\n * back to the _deprecated coclasses if CoCreating the _SxS ones fails.\n * ------------------------------------------------------------------------- */\n\n#ifndef INTEROPLIB\n\n[\n  uuid(7E348441-7E1F-380E-A0F6-22668F0F9E4B),\n  version(1.0),\n  helpstring(\"Common Language Runtime Symbol Store 1.0 Type Library\")\n]\nlibrary CorSymLib\n{\n    importlib(\"STDOLE2.TLB\");\n\n#endif // ndef INTEROPLIB\n\n\n    [\n        uuid(108296C1-281E-11d3-BD22-0000F80849BD)\n    ]\n    coclass CorSymWriter_deprecated\n    {\n        [default] interface ISymUnmanagedWriter;\n    };\n\n    [\n        uuid(108296C2-281E-11d3-BD22-0000F80849BD)\n    ]\n    coclass CorSymReader_deprecated\n    {\n        [default] interface ISymUnmanagedReader;\n    };\n\n    [\n        uuid(AA544D41-28CB-11d3-BD22-0000F80849BD)\n    ]\n    coclass CorSymBinder_deprecated\n    {\n        [default] interface ISymUnmanagedBinder;\n    };\n\n    [\n        uuid(0AE2DEB0-F901-478b-BB9F-881EE8066788)\n    ]\n    coclass CorSymWriter_SxS\n    {\n        [default] interface ISymUnmanagedWriter;\n    };\n\n    [\n        uuid(0A3976C5-4529-4ef8-B0B0-42EED37082CD)\n    ]\n    coclass CorSymReader_SxS\n    {\n        [default] interface ISymUnmanagedReader;\n    };\n\n    [\n        uuid(0A29FF9E-7F9C-4437-8B11-F424491E3931)\n    ]\n    coclass CorSymBinder_SxS\n    {\n        [default] interface ISymUnmanagedBinder;\n    };\n\n\n#ifndef INTEROPLIB\n};\n#endif // ndef INTEROPLIB\n\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedBinder interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(AA544D42-28CB-11d3-BD22-0000F80849BD),\n pointer_default(unique)\n]\ninterface ISymUnmanagedBinder : IUnknown\n{\n    /*\n     * Given a metadata interface and a file name, returns the\n     * correct ISymUnmanagedReader that will read the debugging symbols\n     * associated with the module.\n     *\n     *  This will only open the Pdb if it is next to the Exe.\n     *  This change has been made for security purposes\n     *\n     *  If you need a more extensive search for the pdb\n     *  use ISymUnmanagedBinder2.\n     */\n\n    HRESULT GetReaderForFile([in] IUnknown *importer,\n                             [in] const WCHAR *fileName,\n                             [in] const WCHAR *searchPath,\n                             [out, retval] ISymUnmanagedReader **pRetVal);\n\n\t/*\n\t * Given a metadata interface and a stream that contains\n\t * the symbol store, returns the correct ISymUnmanagedReader\n\t * that will read the debugging symbols from the given\n\t * symbol store.\n\t */\n\tHRESULT GetReaderFromStream([in] IUnknown *importer,\n                                [in] IStream *pstream,\n                                [out,retval] ISymUnmanagedReader **pRetVal);\n};\n\ntypedef enum CorSymSearchPolicyAttributes\n{\n    AllowRegistryAccess      = 0x1,     // query the registry for symbol search paths\n    AllowSymbolServerAccess  = 0x2,     // access a symbol server\n    AllowOriginalPathAccess  = 0x4,     // look at the path specified in Debug Directory\n    AllowReferencePathAccess = 0x8      // look for PDB in the place where the exe is.\n} CorSymSearchPolicyAttributes;\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedBinder2 interface: QI from an ISymUnmanagedBinder\n * ------------------------------------------------------------------------- */\n[\n object,\n uuid(ACCEE350-89AF-4ccb-8B40-1C2C4C6F9434),\n pointer_default(unique)\n]\ninterface ISymUnmanagedBinder2 : ISymUnmanagedBinder\n{\n    /*\n\t *  Given a metadata interface and a file name, returns the correct\n\t *  ISymUnmanagedReader interface that will read the debugging symbols associated\n\t *  with the module.\n\t *\n\t *  This version of the function can search for the PDB in areas other than\n\t *  right next to the module.\n\t *  The search policy can be controlled by combining CorSymSearchPolicyAttributes\n     *  e.g AllowReferencePathAccess|AllowSymbolServerAccess will look for the pdb next\n     *  to the PE file and on a symbol server, but won't query the registry or use the path\n     *  in the PE file.\n     *  If a searchPath is provided, those directories will always be searched.\n     */\n\n    HRESULT GetReaderForFile2([in] IUnknown *importer,\n                              [in] const WCHAR *fileName,\n                              [in] const WCHAR *searchPath,\n                              [in] ULONG32 searchPolicy,\n                              [out,retval] ISymUnmanagedReader **pRetVal);\n\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedBinder3 interface: QI from an ISymUnmanagedBinder\n * ------------------------------------------------------------------------- */\n[\n object,\n uuid(28AD3D43-B601-4d26-8A1B-25F9165AF9D7),\n pointer_default(unique)\n]\ninterface ISymUnmanagedBinder3 : ISymUnmanagedBinder2\n{\n\t/*\n\t * GetReaderFromCallback allows the user to implement supply via callback either an\n\t * IID_IDiaReadExeAtRVACallback or IID_IDiaReadExeAtOffsetCallback to obtain the\n\t * Debug directory information from memory.\n\t */\n\tHRESULT GetReaderFromCallback([in] IUnknown *importer,\n                                  [in] const WCHAR *fileName,\n                                  [in] const WCHAR *searchPath,\n                                  [in] ULONG32 searchPolicy,\n                                  [in] IUnknown *callback,\n                                  [out,retval] ISymUnmanagedReader **pRetVal);\n};\n\ncpp_quote(\"static const int E_SYM_DESTROYED = MAKE_HRESULT(1, FACILITY_ITF, 0xdead);\")\n\n[\n object,\n uuid(969708D2-05E5-4861-A3B0-96E473CDF63F),\n pointer_default(unique)\n]\ninterface ISymUnmanagedDispose : IUnknown\n{\n\n   /*\n    * Calling this function will cause the underlying object to\n    * release all internal references and return failure on any subsequent\n    * method calls.\n    */\n\n    HRESULT Destroy();\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedDocument interface\n *\n * Represents a document referenced by a symbol store. A document is defined\n * by an URL and a document type GUID. Using the URL and document type GUID,\n * one can locate the document however it is stored. Document source can\n * optionally be stored in the symbol store, and retrieved through this\n * interface.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(40DE4037-7C81-3E1E-B022-AE1ABFF2CA08),\n pointer_default(unique)\n]\ninterface ISymUnmanagedDocument : IUnknown\n{\n    /*\n     * Return the URL for this document.\n     */\n    HRESULT GetURL([in] ULONG32 cchUrl,\n                   [out] ULONG32 *pcchUrl,\n                   [out, size_is(cchUrl),\n                   length_is(*pcchUrl)] WCHAR szUrl[]);\n\n    /*\n     * Get the document type of this document.\n     */\n    HRESULT GetDocumentType([out, retval] GUID* pRetVal);\n\n    /*\n     * Get the language id of this document.\n     */\n    HRESULT GetLanguage([out, retval] GUID* pRetVal);\n\n    /*\n     * Get the language vendor of this document.\n     */\n    HRESULT GetLanguageVendor([out, retval] GUID* pRetVal);\n\n    /*\n     * Get the check sum algorithm id. Returns a guid of all zeros if\n     * there is no checksum.\n     */\n    HRESULT GetCheckSumAlgorithmId([out, retval] GUID* pRetVal);\n\n    /*\n     * Get the check sum.\n     */\n    HRESULT GetCheckSum([in] ULONG32 cData,\n                        [out] ULONG32 *pcData,\n                        [out, size_is(cData),\n                        length_is(*pcData)] BYTE data[]);\n\n    /*\n     * Given a line in this document that may or may not be a sequence\n     * point, return the closest line that is a sequence point.  */\n    HRESULT FindClosestLine([in] ULONG32 line,\n                            [out, retval] ULONG32* pRetVal);\n\n    /*\n     * Returns true if the document has source embedded in the\n     * debugging symbols.\n     */\n    HRESULT HasEmbeddedSource([out, retval] BOOL *pRetVal);\n\n    /*\n     * Returns the length, in bytes, of the embedded source.\n     */\n    HRESULT GetSourceLength([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Returns the embedded source into the given buffer. The buffer must\n     * be large enough to hold the source.\n     */\n    HRESULT GetSourceRange([in] ULONG32 startLine,\n                           [in] ULONG32 startColumn,\n                           [in] ULONG32 endLine,\n                           [in] ULONG32 endColumn,\n                           [in] ULONG32 cSourceBytes,\n                           [out] ULONG32 *pcSourceBytes,\n                           [out, size_is(cSourceBytes),\n                           length_is(*pcSourceBytes)] BYTE source[]);\n\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedDocumentWriter interface\n *\n * Provides functions for writing to a document referenced by a symbol\n * store.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(B01FAFEB-C450-3A4D-BEEC-B4CEEC01E006),\n pointer_default(unique)\n]\ninterface ISymUnmanagedDocumentWriter : IUnknown\n{\n    /*\n     * Sets embedded source for a document being written.\n     */\n    HRESULT SetSource([in] ULONG32 sourceSize,\n                      [in, size_is(sourceSize)] BYTE source[]);\n\n    /*\n     * Sets check sum info.\n     */\n    HRESULT SetCheckSum([in] GUID algorithmId,\n                        [in] ULONG32 checkSumSize,\n                        [in, size_is(checkSumSize)] BYTE checkSum[]);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedMethod interface\n *\n * Represents a method within the symbol store. Provides access to only the\n * symbol-related attributes of a method, rather than type-related attributes.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(B62B923C-B500-3158-A543-24F307A8B7E1),\n pointer_default(unique)\n]\ninterface ISymUnmanagedMethod : IUnknown\n{\n    /*\n     * Return the metadata token for this method.\n     */\n    HRESULT GetToken([out, retval] mdMethodDef *pToken);\n\n    /*\n     * Get the count of sequence points within this method.\n     */\n    HRESULT GetSequencePointCount([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the root lexical scope within this method.\n\t * This scope encloses the entire method.\n     */\n    HRESULT GetRootScope([out, retval] ISymUnmanagedScope** pRetVal);\n\n    /*\n     * Get the most enclosing lexical scope within this method that\n     * encloses the given offset. This can be used to start\n\t * local variable searches.\n     */\n    HRESULT GetScopeFromOffset([in] ULONG32 offset,\n                               [out, retval] ISymUnmanagedScope** pRetVal);\n\n    /*\n     * Given a position within a document, return the offset within\n     * this method that cooresponds to the position.\n     */\n    HRESULT GetOffset([in] ISymUnmanagedDocument* document,\n                      [in] ULONG32 line,\n                      [in] ULONG32 column,\n                      [out, retval] ULONG32* pRetVal);\n\n    /*\n     * Given a position in a document, return an array of start/end\n     * offset paris that correspond to the ranges of IL that the\n     * position covers within this method. The array is an array of\n     * integers and is [start,end,start,end]. The number of range\n     * pairs is the length of the array / 2.\n     */\n    HRESULT GetRanges([in] ISymUnmanagedDocument* document,\n                      [in] ULONG32 line,\n                      [in] ULONG32 column,\n                      [in] ULONG32 cRanges,\n                      [out] ULONG32 *pcRanges,\n                      [out, size_is(cRanges),\n                      length_is(*pcRanges)] ULONG32 ranges[]);\n\n    /*\n     * Get the parameters for this method. The parameters are returned\n     * in the order they are defined within the method's signature.\n     */\n    HRESULT GetParameters([in] ULONG32 cParams,\n                          [out] ULONG32 *pcParams,\n                          [out, size_is(cParams),\n                          length_is(*pcParams)] ISymUnmanagedVariable* params[]);\n\n    /*\n     * Get the namespace that this method is defined within.\n     */\n    HRESULT GetNamespace([out] ISymUnmanagedNamespace **pRetVal);\n\n    /*\n     * Get the start/end document positions for the source of this\n     * method. The first array position is the start while the second\n     * is the end. Returns true if positions were defined, false\n     * otherwise.\n     */\n    HRESULT GetSourceStartEnd([in] ISymUnmanagedDocument *docs[2],\n                              [in] ULONG32 lines[2],\n                              [in] ULONG32 columns[2],\n                              [out] BOOL *pRetVal);\n\n    /*\n     * Get all the sequence points within this method.\n     */\n    HRESULT GetSequencePoints([in] ULONG32 cPoints,\n                              [out] ULONG32 *pcPoints,\n                              [in, size_is(cPoints)] ULONG32 offsets[],\n                              [in, size_is(cPoints)] ISymUnmanagedDocument* documents[],\n                              [in, size_is(cPoints)] ULONG32 lines[],\n                              [in, size_is(cPoints)] ULONG32 columns[],\n                              [in, size_is(cPoints)] ULONG32 endLines[],\n                              [in, size_is(cPoints)] ULONG32 endColumns[]);\n};\n\n[\n object,\n uuid(85E891DA-A631-4c76-ACA2-A44A39C46B8C),\n pointer_default(unique)\n]\ninterface ISymENCUnmanagedMethod : IUnknown\n{\n\t/*\n\t * Get the file name for the line associated with offset dwOffset.\n\t */\n    HRESULT GetFileNameFromOffset([in] ULONG32 dwOffset,\n                                  [in] ULONG32 cchName,\n                                  [out] ULONG32 *pcchName,\n                                  [out, size_is(cchName),\n                                    length_is(*pcchName)] WCHAR szName[]);\n\n\t/*\n\t * Get the Line information associated with dwOffset.\n\t * If dwOffset is not a sequence point it is associated with the previous one.\n\t * pdwStartOffset provides the associated sequence point.\n\t */\n    HRESULT GetLineFromOffset([in] ULONG32 dwOffset,\n                              [out] ULONG32* pline,\n                              [out] ULONG32* pcolumn,\n                              [out] ULONG32* pendLine,\n                              [out] ULONG32* pendColumn,\n                              [out] ULONG32* pdwStartOffset);\n\n\t/*\n\t * Get the number of Documents that this method has lines in.\n\t */\n\tHRESULT GetDocumentsForMethodCount([out, retval] ULONG32* pRetVal);\n\n\t/*\n\t * Get the documents this method has lines in.\n\t */\n\tHRESULT GetDocumentsForMethod([in] ULONG32 cDocs,\n                                  [out] ULONG32 *pcDocs,\n                                  [in, size_is(cDocs)] ISymUnmanagedDocument* documents[]);\n\t/*\n\t * Get the smallest start line and largest end line, for the method, in a specific document.\n\t */\n\tHRESULT GetSourceExtentInDocument([in] ISymUnmanagedDocument *document,\n\t\t\t\t\t\t\t\t\t  [out] ULONG32* pstartLine,\n\t\t\t\t\t\t\t\t\t  [out] ULONG32* pendLine);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedNamespace interface\n *\n * Represents a namespace.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(0DFF7289-54F8-11d3-BD28-0000F80849BD),\n pointer_default(unique)\n]\ninterface ISymUnmanagedNamespace : IUnknown\n{\n    /*\n     * Get the name of this namespace.\n     */\n    HRESULT GetName([in] ULONG32 cchName,\n                    [out] ULONG32 *pcchName,\n                    [out, size_is(cchName),\n                    length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * Get the children of this namespace.\n     */\n    HRESULT GetNamespaces([in] ULONG32 cNameSpaces,\n                          [out] ULONG32 *pcNameSpaces,\n                          [out, size_is(cNameSpaces),\n                          length_is(*pcNameSpaces)]\n                          ISymUnmanagedNamespace* namespaces[]);\n\n    /*\n     * Return all variables defined at global scope within this namespace.\n     */\n    HRESULT GetVariables([in] ULONG32 cVars,\n                         [out] ULONG32 *pcVars,\n                         [out, size_is(cVars),\n                         length_is(*pcVars)] ISymUnmanagedVariable *pVars[]);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedReader interface\n *\n * Represents a symbol reader. Provides access to documents, methods, and\n * variables within a symbol store.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(B4CE6286-2A6B-3712-A3B7-1EE1DAD467B5),\n pointer_default(unique)\n]\ninterface ISymUnmanagedReader : IUnknown\n{\n    /*\n     * Find a document. Language, vendor, and document type are optional.\n     */\n    HRESULT GetDocument([in] WCHAR *url,\n                        [in] GUID language,\n                        [in] GUID languageVendor,\n                        [in] GUID documentType,\n                        [out, retval] ISymUnmanagedDocument** pRetVal);\n\n    /*\n     * Return an array of all the documents defined in the symbol store.\n     */\n    HRESULT GetDocuments([in] ULONG32 cDocs,\n                         [out] ULONG32 *pcDocs,\n                         [out, size_is(cDocs),\n                         length_is(*pcDocs)] ISymUnmanagedDocument *pDocs[]);\n\n    /*\n     * Return the method that was specified as the user entry point\n     * for the module, if any. This would be, perhaps, the user's main\n     * method rather than compiler generated stubs before main.\n     */\n    HRESULT GetUserEntryPoint([out, retval] mdMethodDef *pToken);\n\n    /*\n     * Get a symbol reader method given a method token.\n     */\n    HRESULT GetMethod([in] mdMethodDef token,\n                      [out, retval] ISymUnmanagedMethod** pRetVal);\n\n    /*\n     * Get a symbol reader method given a method token and an E&C\n     * version number. Version numbers start at 1 and are incremented\n     * each time the method is changed due to an E&C operation.\n     */\n    HRESULT GetMethodByVersion([in] mdMethodDef token,\n                               [in] int version,\n                               [out, retval] ISymUnmanagedMethod** pRetVal);\n\n    /*\n     * Return a non-local variable given its parent and name.\n     */\n    HRESULT GetVariables([in] mdToken parent,\n                         [in] ULONG32 cVars,\n                         [out] ULONG32 *pcVars,\n                         [out, size_is(cVars),\n                         length_is(*pcVars)] ISymUnmanagedVariable *pVars[]);\n    /*\n     * Return all global variables.\n     */\n    HRESULT GetGlobalVariables([in] ULONG32 cVars,\n                               [out] ULONG32 *pcVars,\n                               [out, size_is(cVars),\n                               length_is(*pcVars)] ISymUnmanagedVariable *pVars[]);\n\n    /*\n     * Given a position in a document, return the ISymUnmanagedMethod that\n     * contains that position.\n     */\n    HRESULT GetMethodFromDocumentPosition([in] ISymUnmanagedDocument* document,\n                                          [in] ULONG32 line,\n                                          [in] ULONG32 column,\n                                          [out, retval] ISymUnmanagedMethod** pRetVal);\n\n    /*\n     * Gets a custom attribute based upon its name. Not to be\n     * confused with Metadata custom attributes, these attributes are\n     * held in the symbol store.\n     */\n    HRESULT GetSymAttribute([in] mdToken parent,\n                            [in] WCHAR *name,\n                            [in] ULONG32 cBuffer,\n                            [out] ULONG32 *pcBuffer,\n                            [out, size_is(cBuffer),\n                            length_is(*pcBuffer)] BYTE buffer[]);\n\n    /*\n     * Get the namespaces defined at global scope within this symbol store.\n     */\n    HRESULT GetNamespaces([in] ULONG32 cNameSpaces,\n                          [out] ULONG32 *pcNameSpaces,\n                          [out, size_is(cNameSpaces),\n                          length_is(*pcNameSpaces)]\n                          ISymUnmanagedNamespace* namespaces[]);\n\n    /*\n     * Initialize the symbol reader with the metadata importer interface\n     * that this reader will be associated with, along with the filename\n     * of the module. This can only be called once, and must be called\n     * before any other reader methods are called.\n     *\n     * Note: you need only specify one of the filename or the pIStream,\n     * not both. The searchPath parameter is optional.\n     */\n    HRESULT Initialize([in] IUnknown *importer,\n                       [in] const WCHAR *filename,\n                       [in] const WCHAR *searchPath,\n                       [in] IStream *pIStream);\n\n    /*\n     * Update the existing symbol reader with a delta symbol store. This\n     * is used in EnC scenarios as a way to update the symbol store to\n     * match deltas to the original PE file.\n     *\n     * Only one of the filename or pIStream parameters need be specified.\n     * If a filename is specified, the symbol store will be updated with\n     * the symbols in that file. If a IStream is specified, the store will\n     * be updated with the data from the IStream.\n     */\n    HRESULT UpdateSymbolStore([in] const WCHAR *filename,\n                              [in] IStream *pIStream);\n\n    /*\n     * Update the existing symbol reader with a delta symbol\n     * store. This is much like UpdateSymbolStore, but the given detla\n     * acts as a complete replacement rather than an update.\n     *\n     * Only one of the filename or pIStream parameters need be specified.\n     * If a filename is specified, the symbol store will be updated with\n     * the symbols in that file. If a IStream is specified, the store will\n     * be updated with the data from the IStream.\n     */\n    HRESULT ReplaceSymbolStore([in] const WCHAR *filename,\n                               [in] IStream *pIStream);\n\n    /*\n     * Provides the on disk filename of the symbol store.\n     */\n\n    HRESULT GetSymbolStoreFileName( [in] ULONG32 cchName,\n                                    [out] ULONG32 *pcchName,\n                                    [out, size_is(cchName),\n                                    length_is(*pcchName)]  WCHAR szName[]);\n\n    /*\n     * Given a position in a document, return the ISymUnmanagedMethods that\n     * contains that position.\n     */\n    HRESULT GetMethodsFromDocumentPosition([in] ISymUnmanagedDocument* document,\n                                           [in] ULONG32 line,\n                                           [in] ULONG32 column,\n                                           [in] ULONG32 cMethod,\n                                           [out] ULONG32* pcMethod,\n                                           [out, size_is(cMethod),\n                                           length_is(*pcMethod)] ISymUnmanagedMethod* pRetVal[]);\n\n    /*\n     * Get the given version of the given document.\n\t * The document version starts at 1 and is incremented each time\n     * the document is updated via UpdateSymbols.\n     * bCurrent is true is this is the latest version of the document.\n     */\n    HRESULT GetDocumentVersion([in] ISymUnmanagedDocument *pDoc,\n                               [out] int* version,\n                               [out] BOOL* pbCurrent);\n\n    /*\n     * The method version starts at 1 and is incremented each time\n     * the method is recompiled.  (This can happen without changes to the method.)\n     */\n    HRESULT GetMethodVersion([in] ISymUnmanagedMethod* pMethod,\n                             [out] int* version);\n\n};\n\n//\n// ISymUnmanagedSourceServerModule\n//\n// QI for this interface from an ISymUnmanagedReader\n[\n\tobject,\n\tuuid(997DD0CC-A76F-4c82-8D79-EA87559D27AD),\n\tpointer_default(unique)\n]\ninterface ISymUnmanagedSourceServerModule : IUnknown\n{\n \t// returns the source server data for the module\n\t// caller must free using CoTaskMemFree()\n\tHRESULT GetSourceServerData(\n\t\t\t[out] ULONG* pDataByteCount,\n\t\t\t[out, size_is (, *pDataByteCount)] BYTE** ppData);\n\n}\n\n// QI for this interface from an ISymUnmanagedReader\n[\n object,\n uuid(E502D2DD-8671-4338-8F2A-FC08229628C4),\n pointer_default(unique)\n]\ninterface ISymUnmanagedENCUpdate : IUnknown\n{\n\n    // UpdateSymbolStore2:\n\n    // Line deltas allow a compiler to omit functions that have not been modified from\n    // the pdb stream provided the line information meets the following condition.\n    // The correct line information can be determined with the old pdb line info and\n    // one delta for all lines in the function.\n    //\n\n    typedef struct _SYMLINEDELTA\n    {\n        mdMethodDef mdMethod;\n        INT32       delta;\n    } SYMLINEDELTA;\n\n    HRESULT UpdateSymbolStore2([in] IStream *pIStream,\n                               [in] SYMLINEDELTA* pDeltaLines,\n                               [in] ULONG cDeltaLines);\n\n    HRESULT GetLocalVariableCount([in] mdMethodDef mdMethodToken,\n                                  [out] ULONG *pcLocals);\n\n    HRESULT GetLocalVariables([in] mdMethodDef mdMethodToken,\n                              [in] ULONG cLocals,\n                              [out, size_is(cLocals),\n                              length_is(*pceltFetched)] ISymUnmanagedVariable *rgLocals[],\n                              [out] ULONG *pceltFetched);\n\n    // Perf: Allow method boundaries to be computed before the first\n    // UpdateSymbolStore2.\n    HRESULT InitializeForEnc();\n\n\t//\n\t// This allows updating the line info for a method that has not been recompiled,\n\t// but whose lines have moved independently.  A delta for each statement is allowed.\n\t//\n    HRESULT UpdateMethodLines([in] mdMethodDef mdMethodToken,\n    \t\t\t\t\t\t  [in, size_is(cDeltas)] INT32* pDeltas,\n    \t\t\t\t\t\t  [in] ULONG cDeltas);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedReaderSymbolSearchInfo interface\n * ------------------------------------------------------------------------- */\n\n// QI for this interface from an ISymUnmanagedReader\n[\n object,\n uuid(20D9645D-03CD-4e34-9C11-9848A5B084F1),\n pointer_default(unique)\n]\ninterface ISymUnmanagedReaderSymbolSearchInfo : IUnknown\n{\n    HRESULT GetSymbolSearchInfoCount([out] ULONG32 *pcSearchInfo);\n\n    HRESULT GetSymbolSearchInfo([in] ULONG32 cSearchInfo,\n                                [out] ULONG32 *pcSearchInfo,\n                                [out, size_is(cSearchInfo),\n                                length_is(*pcSearchInfo)] ISymUnmanagedSymbolSearchInfo **rgpSearchInfo);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedScope interface\n *\n * Represents a lexical scope within a method.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(68005D0F-B8E0-3B01-84D5-A11A94154942),\n pointer_default(unique)\n]\ninterface ISymUnmanagedScope : IUnknown\n{\n    /*\n     * Get the method that contains this scope.\n     */\n    HRESULT GetMethod([out, retval] ISymUnmanagedMethod** pRetVal);\n\n    /*\n     * Get the parent scope of this scope.\n     */\n    HRESULT GetParent([out, retval] ISymUnmanagedScope** pRetVal);\n\n    /*\n     * Get the children of this scope.\n     */\n    HRESULT GetChildren([in] ULONG32 cChildren,\n                        [out] ULONG32 *pcChildren,\n                        [out, size_is(cChildren),\n                        length_is(*pcChildren)] ISymUnmanagedScope* children[]);\n\n    /*\n     * Get the start offset for this scope,\n     */\n    HRESULT GetStartOffset([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the end offset for this scope.\n     */\n    HRESULT GetEndOffset([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get a count of the number of local variables defined within this\n     * scope.\n     */\n    HRESULT GetLocalCount([out, retval] ULONG32 *pRetVal);\n\n    /*\n     * Get the local variables defined within this scope.\n     */\n    HRESULT GetLocals([in] ULONG32 cLocals,\n                      [out] ULONG32 *pcLocals,\n                      [out, size_is(cLocals),\n                      length_is(*pcLocals)] ISymUnmanagedVariable* locals[]);\n\n    /*\n     * Get the namespaces that are being \"used\" within this scope.\n     */\n    HRESULT GetNamespaces([in] ULONG32 cNameSpaces,\n                          [out] ULONG32 *pcNameSpaces,\n                          [out, size_is(cNameSpaces),\n                          length_is(*pcNameSpaces)]\n                          ISymUnmanagedNamespace* namespaces[]);\n};\n\n[\n object,\n uuid(48B25ED8-5BAD-41bc-9CEE-CD62FABC74E9),\n pointer_default(unique)\n]\ninterface ISymUnmanagedConstant : IUnknown\n{\n    /*\n     * Get the name of this constant.\n     */\n    HRESULT GetName([in] ULONG32 cchName,\n                    [out] ULONG32 *pcchName,\n                    [out, size_is(cchName),\n                    length_is(*pcchName)] WCHAR szName[]);\n\n    HRESULT GetValue(VARIANT* pValue);\n\n   HRESULT GetSignature([in] ULONG32 cSig,\n                         [out] ULONG32 *pcSig,\n                         [out, size_is(cSig),\n                         length_is(*pcSig)] BYTE sig[]);\n\n};\n\n/*\n * QI for this interface from an ISymUnmanagedScope.\n */\n[\n object,\n uuid(AE932FBA-3FD8-4dba-8232-30A2309B02DB),\n pointer_default(unique)\n]\ninterface ISymUnmanagedScope2 : ISymUnmanagedScope\n{\n    /*\n     * Get a count of the number of constants defined within this\n     * scope.\n     */\n    HRESULT GetConstantCount([out, retval] ULONG32 *pRetVal);\n    /*\n     * Get the local constants defined within this scope.\n     */\n    HRESULT GetConstants([in] ULONG32 cConstants,\n                         [out] ULONG32 *pcConstants,\n                         [out, size_is(cConstants),\n                         length_is(*pcConstants)] ISymUnmanagedConstant* constants[]);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedVariable interface\n *\n * Represents a variable--a parameter, a local variable, or a field.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(9F60EEBE-2D9A-3F7C-BF58-80BC991C60BB),\n pointer_default(unique)\n]\ninterface ISymUnmanagedVariable : IUnknown\n{\n    /*\n     * Get the name of this variable.\n     */\n    HRESULT GetName([in] ULONG32 cchName,\n                    [out] ULONG32 *pcchName,\n                    [out, size_is(cchName),\n                    length_is(*pcchName)] WCHAR szName[]);\n\n    /*\n     * Get the attribute flags for this variable.\n     */\n    HRESULT GetAttributes([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the signature of this variable.\n     */\n    HRESULT GetSignature([in] ULONG32 cSig,\n                         [out] ULONG32 *pcSig,\n                         [out, size_is(cSig),\n                         length_is(*pcSig)] BYTE sig[]);\n\n    /*\n     * Get the kind of address of this variable\n\t * The retval will be one of the CorSymAddrKind constants.\n     */\n    HRESULT GetAddressKind([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the first address field for this variable. Its meaning depends\n     * on the address kind.\n     */\n    HRESULT GetAddressField1([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the second address field for this variable. Its meaning depends\n     * on the address kind.\n     */\n    HRESULT GetAddressField2([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the third address field for this variable. Its meaning depends\n     * on the address kind.\n     */\n    HRESULT GetAddressField3([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the start offset of this variable within its parent. If this is\n     * a local variable within a scope, this will fall within the offsets\n     * defined for the scope.\n     */\n    HRESULT GetStartOffset([out, retval] ULONG32* pRetVal);\n\n    /*\n     * Get the end offset of this variable within its parent. If this is\n     * a local variable within a scope, this will fall within the offsets\n     * defined for the scope.\n     */\n    HRESULT GetEndOffset([out, retval] ULONG32* pRetVal);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedSymbolSearchInfo interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(F8B3534A-A46B-4980-B520-BEC4ACEABA8F),\n pointer_default(unique)\n]\ninterface ISymUnmanagedSymbolSearchInfo : IUnknown\n{\n    HRESULT GetSearchPathLength([out] ULONG32 *pcchPath);\n\n    HRESULT GetSearchPath([in] ULONG32 cchPath,\n                          [out] ULONG32 *pcchPath,\n                          [out, size_is(cchPath),\n                          length_is(*pcchPath)] WCHAR szPath[]);\n\n    HRESULT GetHRESULT([out] HRESULT *phr);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedWriter interface\n *\n * Represents a symbol writer. Provides methods to define documents,\n * sequence points, lexical scopes, and variables.\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(ED14AA72-78E2-4884-84E2-334293AE5214),\n pointer_default(unique)\n]\ninterface ISymUnmanagedWriter : IUnknown\n{\n    /*\n     * Define a source document. Guid's will be provided for languages,\n     * vendors, and document types that we currently know about.\n     */\n    HRESULT DefineDocument([in] const WCHAR *url,\n                           [in] const GUID *language,\n                           [in] const GUID *languageVendor,\n                           [in] const GUID *documentType,\n                           [out, retval] ISymUnmanagedDocumentWriter** pRetVal);\n\n    /*\n     * Define the method that the user has defined as their entry point\n     * for this module. This would be, perhaps, the user's main method\n     * rather than compiler generated stubs before main.\n     */\n    HRESULT SetUserEntryPoint([in] mdMethodDef entryMethod);\n\n    /*\n     * Open a method to emit symbol information into. The given method\n     * becomes the current method for calls do define sequence points,\n     * parameters and lexical scopes. There is an implicit lexical\n     * scope around the entire method. Re-opening a method that has\n     * been previously closed effectivley erases any previously\n     * defined symbols for that method.\n     *\n     * There can be only one open method at a time.\n     */\n    HRESULT OpenMethod([in] mdMethodDef method);\n\n    /*\n     * Close the current method. Once a method is closed, no more\n     * symbols can be defined within it.\n     */\n    HRESULT CloseMethod();\n\n    /*\n     * Open a new lexical scope in the current method. The scope\n     * becomes the new current scope and is effectivley pushed onto a\n     * stack of scopes. startOffset is the offset, in bytes from the\n     * beginning of the method, of the first instruction in the\n     * lexical scope. Scopes must form a hierarchy. Siblings are not\n     * allowed to overlap.\n     *\n     * OpenScope returns an opaque scope id that can be used with\n     * SetScopeRange to define a scope's start/end offset at a later\n     * time. In this case, the offsets passed to OpenScope and\n     * CloseScope are ignored.\n     *\n     * Note: scope id's are only valid in the current method.\n     */\n    HRESULT OpenScope([in] ULONG32 startOffset,\n                      [out, retval] ULONG32* pRetVal);\n\n    /*\n     * Close the current lexical scope. Once a scope is closed no more\n     * variables can be defined within it. endOffset points past the\n     * last instruction in the scope.\n     */\n    HRESULT CloseScope([in] ULONG32 endOffset);\n\n    /*\n     * Define the offset range for a given lexical scope.\n     */\n    HRESULT SetScopeRange([in] ULONG32 scopeID,\n                          [in] ULONG32 startOffset,\n                          [in] ULONG32 endOffset);\n\n    /*\n     * Define a single variable in the current lexical\n     * scope. startOffset and endOffset are optional. If 0, then they\n     * are ignored and the variable is defined over the entire\n     * scope. If non-zero, then they must fall within the offsets of\n     * the current scope. This can be called multiple times for a\n     * variable of the same name that has multiple homes throughout a\n     * scope. (Note: start/end offsets must not overlap in such a\n     * case.)\n     */\n    HRESULT DefineLocalVariable([in] const WCHAR *name,\n                                [in] ULONG32 attributes,\n                                [in] ULONG32 cSig,\n                                [in, size_is(cSig)] unsigned char signature[],\n                                [in] ULONG32 addrKind,\n                                [in] ULONG32 addr1,\n                                [in] ULONG32 addr2,\n                                [in] ULONG32 addr3,\n                                [in] ULONG32 startOffset,\n                                [in] ULONG32 endOffset);\n\n    /*\n     * Define a single parameter in the current method. The type of\n     * each parameter is taken from its position (sequence) within the\n     * method's signature.\n     *\n     * Note: if parameters are defined in the metadata for a given\n     * method, then clearly one would not have to define them again\n     * with calls to this method. The symbol readers will have to be\n     * smart enough to check the normal metadata for these first then\n     * fall back to the symbol store.\n     */\n    HRESULT DefineParameter([in] const WCHAR *name,\n                            [in] ULONG32 attributes,\n                            [in] ULONG32 sequence,\n                            [in] ULONG32 addrKind,\n                            [in] ULONG32 addr1,\n                            [in] ULONG32 addr2,\n                            [in] ULONG32 addr3);\n\n    /*\n     * Define a single variable not within a method. This is used for\n     * certain fields in classes, bitfields, etc.\n     */\n    HRESULT DefineField([in] mdTypeDef parent,\n                        [in] const WCHAR *name,\n                        [in] ULONG32 attributes,\n                        [in] ULONG32 cSig,\n                        [in, size_is(cSig)] unsigned char signature[],\n                        [in] ULONG32 addrKind,\n                        [in] ULONG32 addr1,\n                        [in] ULONG32 addr2,\n                        [in] ULONG32 addr3);\n\n    /*\n     * Define a single global variable.\n     */\n    HRESULT DefineGlobalVariable([in] const WCHAR *name,\n                                 [in] ULONG32 attributes,\n                                 [in] ULONG32 cSig,\n                                 [in, size_is(cSig)] unsigned char signature[],\n                                 [in] ULONG32 addrKind,\n                                 [in] ULONG32 addr1,\n                                 [in] ULONG32 addr2,\n                                 [in] ULONG32 addr3);\n\n    /*\n     * Close will close the ISymUnmanagedWriter and commit the symbols\n     * to the symbol store. The ISymUnmanagedWriter becomes invalid\n     * after this call for further updates.\n     */\n    HRESULT Close();\n\n    /*\n     * Defines a custom attribute based upon its name. Not to be\n     * confused with Metadata custom attributes, these attributes are\n     * held in the symbol store.\n     */\n    HRESULT SetSymAttribute([in] mdToken parent,\n                            [in] const WCHAR *name,\n                            [in] ULONG32 cData,\n                            [in, size_is(cData)] unsigned char data[]);\n\n    /*\n     * Opens a new namespace. Call this before defining methods or\n     * variables that live within a namespace. Namespaces can be nested.\n     */\n    HRESULT OpenNamespace([in] const WCHAR *name);\n\n    /*\n     * Close the most recently opened namespace.\n     */\n    HRESULT CloseNamespace();\n\n    /*\n     * Specifies that the given, fully qualified namespace name is\n     * being used within the currently open lexical scope. Closing the\n     * current scope will also stop using the namespace, and the\n     * namespace will be in use in all scopes that inherit from the\n     * currently open scope.\n     */\n    HRESULT UsingNamespace([in] const WCHAR *fullName);\n\n    /*\n     * Specifies the true start and end of a method within a source\n     * file. Use this to specify the extent of a method independently\n     * of what sequence points exist within the method.\n     */\n    HRESULT SetMethodSourceRange([in] ISymUnmanagedDocumentWriter *startDoc,\n                                 [in] ULONG32 startLine,\n                                 [in] ULONG32 startColumn,\n                                 [in] ISymUnmanagedDocumentWriter *endDoc,\n                                 [in] ULONG32 endLine,\n                                 [in] ULONG32 endColumn);\n\n    /*\n     * Sets the metadata emitter interface that this writer will be\n     * associated with. Also sets the output filename of where the\n     * debugging symbols will be written. This can only be called once,\n     * and must be called before any other writer methods are called.\n     *\n     * Some writers may require a filename, while others may not. A\n     * filename can always be passed to this method, however, with\n     * no ill effects on writers that do not use it.\n     *\n     * The pIStream parameter is optional. If specified, the symbol\n     * writer will emit the symbols into the given IStream rather than\n     * to the file specified in filename.\n     *\n     * The fFullBuild parameter indicates to the symbol writer whether\n     * this is a full build or an incremental build.\n     */\n    HRESULT Initialize([in] IUnknown *emitter,\n                       [in] const WCHAR *filename,\n                       [in] IStream *pIStream,\n                       [in] BOOL fFullBuild);\n\n    /*\n     * Returns the necessary info for a compiler to write the\n     * necessary debug directory entry into the PE header.\n     *\n     * pIDD should point to a IMAGE_DEBUG_DIRECTORY that the symbol\n     * writer will fill out. All fields except for TimeDateStamp and\n     * PointerToRawData will be filled out by the symbol writer. (The\n     * compiler is responsible for setting TimeDateStamp and\n     * PointerToRawData appropiatley.)\n     *\n     * data should point to a buffer large enough to hold the debug\n     * data for the symbol store.\n     *\n     * A compiler should call this method, then emit the data blob to\n     * the PE file and set the PointerToRawData field in the\n     * IMAGE_DEBUG_DIRECTORY to point to the emitted data. Then, the\n     * IMAGE_DEBUG_DIRECTORY should be written to the PE file. The\n     * compiler should also set the TimeDateStamp field to equal the\n     * TimeDateStamp of the PE file being generated.\n     */\n    HRESULT GetDebugInfo([in, out] IMAGE_DEBUG_DIRECTORY *pIDD,\n                         [in] DWORD cData,\n                         [out] DWORD *pcData,\n                         [out, size_is(cData),\n                         length_is(*pcData)] BYTE data[]);\n\n    /*\n     * Define a group of sequence points within the current method.\n     * Each line/column defines the start of a statement within a\n     * method. Each end line/column defines the end of a statement\n     * with a method. (End line/column is optional.) The arrays should\n     * be sorted by offset. The offset is always the offset from the\n     * start of the method, in bytes.\n     */\n    HRESULT DefineSequencePoints([in] ISymUnmanagedDocumentWriter* document,\n                                 [in] ULONG32 spCount,\n                                 [in, size_is(spCount)] ULONG32 offsets[],\n                                 [in, size_is(spCount)] ULONG32 lines[],\n                                 [in, size_is(spCount)] ULONG32 columns[],\n                                 [in, size_is(spCount)] ULONG32 endLines[],\n                                 [in, size_is(spCount)] ULONG32 endColumns[]);\n\n    /*\n     * This method tells the symbol writer that a metadata token has\n     * been remapped as the metadata was emitted. If the symbol writer\n     * has stored the old token within the symbol store, it must\n     * either update the stored token to the new value, or persist the\n     * map for the corresponding symbol reader to remap during the\n     * read phase.\n     */\n    HRESULT RemapToken([in] mdToken oldToken,\n                       [in] mdToken newToken);\n\n    /*\n     * Same as Initialize except that the final path name is the path string to\n     * name the final location of the pdb file. This is used in build environments in\n     * which the pdb is built in a temporary location and moved when the build is\n     * complete.\n     */\n    HRESULT Initialize2([in] IUnknown *emitter,\n                   [in] const WCHAR *tempfilename,\n                   [in] IStream *pIStream,\n                   [in] BOOL fFullBuild,\n                   [in] const WCHAR *finalfilename);\n\n    /*\n     * Defines a name for a constant value.\n     */\n    HRESULT DefineConstant( [in] const WCHAR *name,\n                            [in] VARIANT value,\n                            [in] ULONG32 cSig,\n                            [in, size_is(cSig)] unsigned char signature[]);\n\n    /*\n     * Abort will close the ISymUnmanagedWriter without committing the symbols\n     * to the symbol store. The ISymUnmanagedWriter becomes invalid\n     * after this call for further updates.\n     */\n    HRESULT Abort();\n\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedWriter2 interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(0B97726E-9E6D-4f05-9A26-424022093CAA),\n pointer_default(unique)\n]\ninterface ISymUnmanagedWriter2 : ISymUnmanagedWriter\n{\n    /*\n     * Define a single variable in the current lexical\n     * scope. startOffset and endOffset are optional. If 0, then they\n     * are ignored and the variable is defined over the entire\n     * scope. If non-zero, then they must fall within the offsets of\n     * the current scope. This can be called multiple times for a\n     * variable of the same name that has multiple homes throughout a\n     * scope. (Note: start/end offsets must not overlap in such a\n     * case.)\n     */\n    HRESULT DefineLocalVariable2([in] const WCHAR *name,\n                                 [in] ULONG32 attributes,\n                                 [in] mdSignature sigToken,\n                                 [in] ULONG32 addrKind,\n                                 [in] ULONG32 addr1,\n                                 [in] ULONG32 addr2,\n                                 [in] ULONG32 addr3,\n                                 [in] ULONG32 startOffset,\n                                 [in] ULONG32 endOffset);\n\n    /*\n     * Define a single global variable.\n     */\n    HRESULT DefineGlobalVariable2([in] const WCHAR *name,\n                                  [in] ULONG32 attributes,\n                                  [in] mdSignature sigToken,\n                                  [in] ULONG32 addrKind,\n                                  [in] ULONG32 addr1,\n                                  [in] ULONG32 addr2,\n                                  [in] ULONG32 addr3);\n\n\n    /*\n     * Defines a name for a constant value.\n     */\n    HRESULT DefineConstant2( [in] const WCHAR *name,\n                             [in] VARIANT value,\n                             [in] mdSignature sigToken);\n\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedWriter3 interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(12F1E02C-1E05-4B0E-9468-EBC9D1BB040F),\n pointer_default(unique)\n]\ninterface ISymUnmanagedWriter3 : ISymUnmanagedWriter2\n{\n    /*\n     * Open a method, and also provide its real section offset in image\n     */\n    HRESULT OpenMethod2( [in] mdMethodDef method,\n                        [in] ULONG32 isect,\n                        [in] ULONG32 offset);\n\n    /*\n     * Commit the changes written so far to the stream\n     */\n\n    HRESULT Commit();\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedWriter4 interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(BC7E3F53-F458-4C23-9DBD-A189E6E96594),\n pointer_default(unique)\n]\ninterface ISymUnmanagedWriter4 : ISymUnmanagedWriter3\n{\n    /*\n     * Functions the same as ISymUnmanagedWriter::GetDebugInfo with the exception\n     * that the path string is padded with zeros following the terminating null\n     * character to make the string data a fixed size of MAX_PATH. Padding is only\n     * given if the path string length itself is less than MAX_PATH.\n     *\n     * This makes writing tools that difference PE files easier.\n     */\n    HRESULT GetDebugInfoWithPadding([in, out] IMAGE_DEBUG_DIRECTORY *pIDD,\n                                    [in] DWORD cData,\n                                    [out] DWORD *pcData,\n                                    [out, size_is(cData),\n                                    length_is(*pcData)] BYTE data[]);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedWriter5 interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(DCF7780D-BDE9-45DF-ACFE-21731A32000C),\n pointer_default(unique)\n]\ninterface ISymUnmanagedWriter5 : ISymUnmanagedWriter4\n{\n    /*\n     * Open a special custom data section to emit token to source span mapping\n     * information into. Opening this section while a method is already open\n     * or vice versa is an error.\n     */\n    HRESULT OpenMapTokensToSourceSpans();\n\n    /*\n     * Close the special custom data section for token to source span mapping\n     * information. Once it is closed no more mapping information can be added.\n     */\n    HRESULT CloseMapTokensToSourceSpans();\n\n    /*\n     * Maps the given metadata token to the given source line span in the specified\n     * source file.\n     *\n     * Must be called between calls to OpenMapTokensToSourceSpans() and\n     * CloseMapTokensToSourceSpans().\n     */\n    HRESULT MapTokenToSourceSpan([in] mdToken token,\n                                 [in] ISymUnmanagedDocumentWriter* document,\n                                 [in] ULONG32 line,\n                                 [in] ULONG32 column,\n                                 [in] ULONG32 endLine,\n                                 [in] ULONG32 endColumn);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedReader interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(A09E53B2-2A57-4cca-8F63-B84F7C35D4AA),\n pointer_default(unique)\n]\ninterface ISymUnmanagedReader2 : ISymUnmanagedReader\n{\n    /*\n     * Get a symbol reader method given a method token and an E&C\n     * version number. Version numbers start at 1 and are incremented\n     * each time the method is changed due to an E&C operation.\n     */\n    HRESULT GetMethodByVersionPreRemap([in] mdMethodDef token,\n                                       [in] int version,\n                                       [out, retval] ISymUnmanagedMethod** pRetVal);\n    /*\n     * Gets a custom attribute based upon its name. Not to be\n     * confused with Metadata custom attributes, these attributes are\n     * held in the symbol store.\n     */\n    HRESULT GetSymAttributePreRemap([in] mdToken parent,\n                                    [in] WCHAR *name,\n                                    [in] ULONG32 cBuffer,\n                                    [out] ULONG32 *pcBuffer,\n                                    [out, size_is(cBuffer),\n                                    length_is(*pcBuffer)] BYTE buffer[]);\n\n    /*\n     * Gets every method that has line information in the provided Document.\n     */\n    HRESULT GetMethodsInDocument([in] ISymUnmanagedDocument *document,\n                                 [in] ULONG32 cMethod,\n                                 [out] ULONG32* pcMethod,\n                                 [out, size_is(cMethod),\n                                    length_is(*pcMethod)] ISymUnmanagedMethod* pRetVal[]);\n\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymNGenWriter interface\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(d682fd12-43de-411c-811b-be8404cea126),\n pointer_default(unique)\n]\ninterface ISymNGenWriter : IUnknown\n{\n    /*\n     * Add a new public symbol to the NGEN PDB.\n     */\n    HRESULT AddSymbol([in] BSTR pSymbol,\n                      [in] USHORT iSection,\n                      [in] ULONGLONG rva);\n\n    /*\n     * Adds a new section to the NGEN PDB.\n     */\n    HRESULT AddSection([in] USHORT iSection,\n                       [in] USHORT flags,\n                       [in] long offset,\n                       [in] long cb);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * ISymNGenWriter2 interface\n * ------------------------------------------------------------------------- */\n[\n object,\n local,\n uuid(B029E51B-4C55-4fe2-B993-9F7BC1F10DB4),\n pointer_default(unique)\n]\ninterface ISymNGenWriter2 : ISymNGenWriter\n{\n    HRESULT OpenModW([in] LPCWSTR wszModule,\n                     [in] LPCWSTR wszObjFile,\n                     [out] BYTE** ppmod);\n\n    HRESULT CloseMod([in] BYTE* pmod);\n\n    HRESULT ModAddSymbols([in] BYTE* pmod, [in] BYTE* pbSym, [in] long cb);\n\n    HRESULT ModAddSecContribEx(\n        [in] BYTE* pmod,\n        [in] USHORT isect,\n        [in] long off,\n        [in] long cb,\n        [in] ULONG dwCharacteristics,\n        [in] DWORD dwDataCrc,\n        [in] DWORD dwRelocCrc);\n\n    HRESULT QueryPDBNameExW(\n        [out, size_is(cchMax)] WCHAR wszPDB[],\n        [in] SIZE_T cchMax);\n};\n\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedAsyncPropertiesWriter interface\n *\n * Allows definition of optional async method information per method symbol.\n * Must use with an opened method (i.e. between calls to ISymUnmanagedWriter's\n * OpenMethod and CloseMethod methods).\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(FC073774-1739-4232-BD56-A027294BEC15),\n pointer_default(unique)\n]\ninterface ISymUnmanagedAsyncMethodPropertiesWriter : IUnknown\n{\n    /*\n    * Sets the starting method that initiates the async operation.\n    *\n    * When performing a step-out of an async method, if the caller matches\n    * the kickoff method, we will step out synchronously.  Otherwise, an\n    * async step-out will occur.\n    *\n    * This works in C#/VB because there is an initial method stub that\n    * creates the state machine object and starts if off, hence \"kickoff\"\n    * Still have to determine if this will work with F#.\n    */\n    HRESULT DefineKickoffMethod([in] mdToken kickoffMethod);\n\n    /*\n    * Sets the IL offset for the compiler generated catch handler that wraps\n    * an async method.\n    *\n    * The IL offset of the generated catch is used by the debugger to handle\n    * the catch as though it were non-user code even though it may occur in\n    * a user code method.  In particular it is used in response to a\n    * CatchHandlerFound exception event.\n    */\n    HRESULT DefineCatchHandlerILOffset([in] ULONG32 catchHandlerOffset);\n\n    /*\n     * Define a group of async scopes within the current method.\n     *\n     * Each yield offset matches an await's return instruction,\n     * identifying a potential yield.  Each breakpointMethod/breakpointOffset\n     * pair tells us where the asynchronous operation will resume\n     * (which may be in a different method).\n     */\n    HRESULT DefineAsyncStepInfo([in] ULONG32 count,\n                                [in, size_is(count)] ULONG32 yieldOffsets[],\n                                [in, size_is(count)] ULONG32 breakpointOffset[],\n                                [in, size_is(count)] mdToken breakpointMethod[]);\n};\n\n/* ------------------------------------------------------------------------- *\n * ISymUnmanagedAsyncMethod interface\n *\n * This interface is the reading complement to\n * ISymUnmanangedAsyncMethodPropertiesWriter\n * ------------------------------------------------------------------------- */\n\n[\n object,\n uuid(B20D55B3-532E-4906-87E7-25BD5734ABD2),\n pointer_default(unique)\n]\ninterface ISymUnmanagedAsyncMethod : IUnknown\n{\n    /*\n    * Checks if the method has asynch information or not.\n    *\n    * If this method returns FALSE then it is invalid to call any\n    * other methods in this interface.  They will all return\n    * E_UNEXPECTED in this case.\n    */\n    HRESULT IsAsyncMethod([out, retval] BOOL* pRetVal);\n\n    /*\n    * See ISymUnmanagedAsyncMethodPropertiesWriter::DefineKickoffMethod\n    */\n    HRESULT GetKickoffMethod([out, retval] mdToken* kickoffMethod);\n\n    /*\n    * See ISymUnmanagedAsyncMethodPropertiesWriter::DefineCatchHandlerILOffset\n    */\n    HRESULT HasCatchHandlerILOffset([out, retval] BOOL* pRetVal);\n\n    /*\n    * See ISymUnmanagedAsyncMethodPropertiesWriter::DefineCatchHandlerILOffset\n    */\n    HRESULT GetCatchHandlerILOffset([out, retval] ULONG32* pRetVal);\n\n    /*\n     * See ISymUnmanagedAsyncMethodPropertiesWriter::DefineAsyncStepInfo\n     */\n    HRESULT GetAsyncStepInfoCount([out, retval] ULONG32* pRetVal);\n\n    /*\n     * See ISymUnmanagedAsyncMethodPropertiesWriter::DefineAsyncStepInfo\n     */\n    HRESULT GetAsyncStepInfo([in] ULONG32 cStepInfo,\n                             [out] ULONG32 *pcStepInfo,\n                             [in, size_is(cStepInfo)] ULONG32 yieldOffsets[],\n                             [in, size_is(cStepInfo)] ULONG32 breakpointOffset[],\n                             [in, size_is(cStepInfo)] mdToken breakpointMethod[]);\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cortypeinfo.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// This describes information about the COM+ primitive types\n\n//\n// Note: This file gets parsed by the Mono IL Linker (https://github.com/mono/linker/) which may throw an exception during parsing.\n// Specifically, this (https://github.com/mono/linker/blob/master/corebuild/integration/ILLink.Tasks/CreateRuntimeRootDescriptorFile.cs) will try to\n// parse this header, and it may throw an exception while doing that. If you edit this file and get a build failure on msbuild.exe D:\\repos\\coreclr\\build.proj\n// you might want to check out the parser linked above.\n//\n\n\n#define NO_SIZE ((BYTE)-1)\n\n// TYPEINFO(type (CorElementType),  namespace, class,          size,                 gcType,         isArray,isPrim, isFloat,isModifier,isGenVariable)\n\nTYPEINFO(ELEMENT_TYPE_END,          NULL, NULL,                NO_SIZE,              TYPE_GC_NONE,   false,  false,  false,  false,  false) // 0x00\nTYPEINFO(ELEMENT_TYPE_VOID,         \"System\", \"Void\",          0,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x01\nTYPEINFO(ELEMENT_TYPE_BOOLEAN,      \"System\", \"Boolean\",       1,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x02\nTYPEINFO(ELEMENT_TYPE_CHAR,         \"System\", \"Char\",          2,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x03\nTYPEINFO(ELEMENT_TYPE_I1,           \"System\", \"SByte\",         1,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x04\nTYPEINFO(ELEMENT_TYPE_U1,           \"System\", \"Byte\",          1,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x05\nTYPEINFO(ELEMENT_TYPE_I2,           \"System\", \"Int16\",         2,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x06\nTYPEINFO(ELEMENT_TYPE_U2,           \"System\", \"UInt16\",        2,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x07\nTYPEINFO(ELEMENT_TYPE_I4,           \"System\", \"Int32\",         4,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x08\nTYPEINFO(ELEMENT_TYPE_U4,           \"System\", \"UInt32\",        4,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x09\nTYPEINFO(ELEMENT_TYPE_I8,           \"System\", \"Int64\",         8,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x0a\nTYPEINFO(ELEMENT_TYPE_U8,           \"System\", \"UInt64\",        8,                    TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x0b\n\nTYPEINFO(ELEMENT_TYPE_R4,           \"System\", \"Single\",        4,                    TYPE_GC_NONE,   false,  true,   true,   false,  false) // 0x0c\nTYPEINFO(ELEMENT_TYPE_R8,           \"System\", \"Double\",        8,                    TYPE_GC_NONE,   false,  true,   true,   false,  false) // 0x0d\n\nTYPEINFO(ELEMENT_TYPE_STRING,       \"System\", \"String\",        TARGET_POINTER_SIZE,  TYPE_GC_REF,    false,  false,  false,  false,  false) // 0x0e\nTYPEINFO(ELEMENT_TYPE_PTR,          NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_NONE,   false,  false,  false,  true,   false) // 0x0f\nTYPEINFO(ELEMENT_TYPE_BYREF,        NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_BYREF,  false,  false,  false,  true,   false) // 0x10\nTYPEINFO(ELEMENT_TYPE_VALUETYPE,    NULL, NULL,                NO_SIZE,              TYPE_GC_OTHER,  false,  false,  false,  false,  false) // 0x11\nTYPEINFO(ELEMENT_TYPE_CLASS,        NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_REF,    false,  false,  false,  false,  false) // 0x12\nTYPEINFO(ELEMENT_TYPE_VAR,          NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_OTHER,  false,  false,  false,  false,  true)  // 0x13\nTYPEINFO(ELEMENT_TYPE_ARRAY,        NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_REF,    true,   false,  false,  true,   false) // 0x14\n\nTYPEINFO(ELEMENT_TYPE_GENERICINST,  NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_OTHER,  false,  false,  false,  false,  false) // 0x15\nTYPEINFO(ELEMENT_TYPE_TYPEDBYREF,   \"System\", \"TypedReference\",2*TARGET_POINTER_SIZE,TYPE_GC_BYREF,  false,  false,  false,  false,  false) // 0x16\nTYPEINFO(ELEMENT_TYPE_VALUEARRAY_UNSUPPORTED, NULL,NULL,       NO_SIZE,              TYPE_GC_NONE,   false,  false,  false,  false,  false) // 0x17 (unsupported, not in the ECMA spec)\n\nTYPEINFO(ELEMENT_TYPE_I,            \"System\", \"IntPtr\",        TARGET_POINTER_SIZE,  TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x18\nTYPEINFO(ELEMENT_TYPE_U,            \"System\", \"UIntPtr\",       TARGET_POINTER_SIZE,  TYPE_GC_NONE,   false,  true,   false,  false,  false) // 0x19\nTYPEINFO(ELEMENT_TYPE_R_UNSUPPORTED,NULL, NULL,                NO_SIZE,              TYPE_GC_NONE,   false,  false,  false,  false,  false) // 0x1a (unsupported, not in the ECMA spec)\n\nTYPEINFO(ELEMENT_TYPE_FNPTR,        NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_NONE,   false,  false,  false,  false,  false) // 0x1b\nTYPEINFO(ELEMENT_TYPE_OBJECT,       \"System\", \"Object\",        TARGET_POINTER_SIZE,  TYPE_GC_REF,    false,  false,  false,  false,  false) // 0x1c\nTYPEINFO(ELEMENT_TYPE_SZARRAY,      NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_REF,    true,   false,  false,  true,   false) // 0x1d\nTYPEINFO(ELEMENT_TYPE_MVAR,         NULL, NULL,                TARGET_POINTER_SIZE,  TYPE_GC_OTHER,  false,  false,  false,  false,  true)  // x01e\nTYPEINFO(ELEMENT_TYPE_CMOD_REQD,    NULL, NULL,                0,                    TYPE_GC_NONE,   false,  false,  false,  false,  false) // 0x1f\nTYPEINFO(ELEMENT_TYPE_CMOD_OPT,     NULL, NULL,                0,                    TYPE_GC_NONE,   false,  false,  false,  false,  false) // 0x20\nTYPEINFO(ELEMENT_TYPE_INTERNAL,     NULL, NULL,                0,                    TYPE_GC_OTHER,  false,  false,  false,  false,  false) // 0x21\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/crosscomp.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// crosscomp.h - cross-compilation enablement structures.\n//\n\n\n#pragma once\n\n#if (!defined(HOST_64BIT) && defined(TARGET_64BIT)) || (defined(HOST_64BIT) && !defined(TARGET_64BIT))\n#define CROSSBITNESS_COMPILE\n#endif\n\n// Target platform-specific library naming\n//\n#ifdef TARGET_WINDOWS\n#define MAKE_TARGET_DLLNAME_W(name) name W(\".dll\")\n#define MAKE_TARGET_DLLNAME_A(name) name \".dll\"\n#else // TARGET_WINDOWS\n#ifdef TARGET_OSX\n#define MAKE_TARGET_DLLNAME_W(name) W(\"lib\") name W(\".dylib\")\n#define MAKE_TARGET_DLLNAME_A(name)  \"lib\" name  \".dylib\"\n#else\n#define MAKE_TARGET_DLLNAME_W(name) W(\"lib\") name W(\".so\")\n#define MAKE_TARGET_DLLNAME_A(name)  \"lib\" name  \".so\"\n#endif\n#endif // TARGET_WINDOWS\n\n#ifdef UNICODE\n#define MAKE_TARGET_DLLNAME(name) MAKE_TARGET_DLLNAME_W(name)\n#else\n#define MAKE_TARGET_DLLNAME(name) MAKE_TARGET_DLLNAME_A(name)\n#endif\n\n#if !defined(HOST_ARM) && defined(TARGET_ARM) // Non-ARM Host managing ARM related code\n\n#ifndef CROSS_COMPILE\n#define CROSS_COMPILE\n#endif\n\n#define ARM_MAX_BREAKPOINTS     8\n#define ARM_MAX_WATCHPOINTS     1\n\n#ifndef CONTEXT_UNWOUND_TO_CALL\n#define CONTEXT_UNWOUND_TO_CALL 0x20000000\n#endif\n\n#if !defined(HOST_ARM64)\ntypedef struct _NEON128 {\n    ULONGLONG Low;\n    LONGLONG High;\n} NEON128, *PNEON128;\n#endif // !defined(HOST_ARM64)\n\ntypedef struct DECLSPEC_ALIGN(8) _T_CONTEXT {\n    //\n    // Control flags.\n    //\n\n    DWORD ContextFlags;\n\n    //\n    // Integer registers\n    //\n\n    DWORD R0;\n    DWORD R1;\n    DWORD R2;\n    DWORD R3;\n    DWORD R4;\n    DWORD R5;\n    DWORD R6;\n    DWORD R7;\n    DWORD R8;\n    DWORD R9;\n    DWORD R10;\n    DWORD R11;\n    DWORD R12;\n\n    //\n    // Control Registers\n    //\n\n    DWORD Sp;\n    DWORD Lr;\n    DWORD Pc;\n    DWORD Cpsr;\n\n    //\n    // Floating Point/NEON Registers\n    //\n\n    DWORD Fpscr;\n    DWORD Padding;\n    union {\n        NEON128 Q[16];\n        ULONGLONG D[32];\n        DWORD S[32];\n    };\n\n    //\n    // Debug registers\n    //\n\n    DWORD Bvr[ARM_MAX_BREAKPOINTS];\n    DWORD Bcr[ARM_MAX_BREAKPOINTS];\n    DWORD Wvr[ARM_MAX_WATCHPOINTS];\n    DWORD Wcr[ARM_MAX_WATCHPOINTS];\n\n    DWORD Padding2[2];\n\n} T_CONTEXT, *PT_CONTEXT;\n\n//\n// Define function table entry - a function table entry is generated for\n// each frame function.\n//\n\n#if defined(HOST_WINDOWS)\ntypedef struct _T_RUNTIME_FUNCTION {\n    DWORD BeginAddress;\n    DWORD UnwindData;\n} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION;\n#else // HOST_WINDOWS\n#define T_RUNTIME_FUNCTION RUNTIME_FUNCTION\n#define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION\n#endif // HOST_WINDOWS\n\n//\n// Nonvolatile context pointer record.\n//\n\ntypedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {\n\n    PDWORD R4;\n    PDWORD R5;\n    PDWORD R6;\n    PDWORD R7;\n    PDWORD R8;\n    PDWORD R9;\n    PDWORD R10;\n    PDWORD R11;\n    PDWORD Lr;\n\n    PULONGLONG D8;\n    PULONGLONG D9;\n    PULONGLONG D10;\n    PULONGLONG D11;\n    PULONGLONG D12;\n    PULONGLONG D13;\n    PULONGLONG D14;\n    PULONGLONG D15;\n\n} T_KNONVOLATILE_CONTEXT_POINTERS, *PT_KNONVOLATILE_CONTEXT_POINTERS;\n\n//\n// Define dynamic function table entry.\n//\n#if defined(HOST_X86)\ntypedef\nPT_RUNTIME_FUNCTION\n(*PGET_RUNTIME_FUNCTION_CALLBACK) (\n    IN DWORD64 ControlPc,\n    IN PVOID Context\n    );\n#endif // defined(HOST_X86)\n\ntypedef struct _T_DISPATCHER_CONTEXT {\n    ULONG ControlPc;\n    ULONG ImageBase;\n    PT_RUNTIME_FUNCTION FunctionEntry;\n    ULONG EstablisherFrame;\n    ULONG TargetPc;\n    PT_CONTEXT ContextRecord;\n    PEXCEPTION_ROUTINE LanguageHandler;\n    PVOID HandlerData;\n    PVOID HistoryTable;\n    ULONG ScopeIndex;\n    BOOLEAN ControlPcIsUnwound;\n    PUCHAR NonVolatileRegisters;\n} T_DISPATCHER_CONTEXT, *PT_DISPATCHER_CONTEXT;\n\n\n#elif defined(HOST_AMD64) && defined(TARGET_ARM64)  // Host amd64 managing ARM64 related code\n\n#ifndef CROSS_COMPILE\n#define CROSS_COMPILE\n#endif\n\n//\n// Specify the number of breakpoints and watchpoints that the OS\n// will track. Architecturally, ARM64 supports up to 16. In practice,\n// however, almost no one implements more than 4 of each.\n//\n\n#define ARM64_MAX_BREAKPOINTS     8\n#define ARM64_MAX_WATCHPOINTS     2\n\n#define CONTEXT_UNWOUND_TO_CALL 0x20000000\n\ntypedef union _NEON128 {\n    struct {\n        ULONGLONG Low;\n        LONGLONG High;\n    };\n    double D[2];\n    float S[4];\n    WORD   H[8];\n    BYTE  B[16];\n} NEON128, *PNEON128;\n\ntypedef struct DECLSPEC_ALIGN(16) _T_CONTEXT {\n\n    //\n    // Control flags.\n    //\n\n    /* +0x000 */ DWORD ContextFlags;\n\n    //\n    // Integer registers\n    //\n\n    /* +0x004 */ DWORD Cpsr;       // NZVF + DAIF + CurrentEL + SPSel\n    /* +0x008 */ union {\n                    struct {\n                        DWORD64 X0;\n                        DWORD64 X1;\n                        DWORD64 X2;\n                        DWORD64 X3;\n                        DWORD64 X4;\n                        DWORD64 X5;\n                        DWORD64 X6;\n                        DWORD64 X7;\n                        DWORD64 X8;\n                        DWORD64 X9;\n                        DWORD64 X10;\n                        DWORD64 X11;\n                        DWORD64 X12;\n                        DWORD64 X13;\n                        DWORD64 X14;\n                        DWORD64 X15;\n                        DWORD64 X16;\n                        DWORD64 X17;\n                        DWORD64 X18;\n                        DWORD64 X19;\n                        DWORD64 X20;\n                        DWORD64 X21;\n                        DWORD64 X22;\n                        DWORD64 X23;\n                        DWORD64 X24;\n                        DWORD64 X25;\n                        DWORD64 X26;\n                        DWORD64 X27;\n                        DWORD64 X28;\n                    };\n                    DWORD64 X[29];\n                 };\n    /* +0x0f0 */ DWORD64 Fp;\n    /* +0x0f8 */ DWORD64 Lr;\n    /* +0x100 */ DWORD64 Sp;\n    /* +0x108 */ DWORD64 Pc;\n\n    //\n    // Floating Point/NEON Registers\n    //\n\n    /* +0x110 */ NEON128 V[32];\n    /* +0x310 */ DWORD Fpcr;\n    /* +0x314 */ DWORD Fpsr;\n\n    //\n    // Debug registers\n    //\n\n    /* +0x318 */ DWORD Bcr[ARM64_MAX_BREAKPOINTS];\n    /* +0x338 */ DWORD64 Bvr[ARM64_MAX_BREAKPOINTS];\n    /* +0x378 */ DWORD Wcr[ARM64_MAX_WATCHPOINTS];\n    /* +0x380 */ DWORD64 Wvr[ARM64_MAX_WATCHPOINTS];\n    /* +0x390 */\n\n} T_CONTEXT, *PT_CONTEXT;\n\n// _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY (see ExternalAPIs\\Win9CoreSystem\\inc\\winnt.h)\ntypedef struct _T_RUNTIME_FUNCTION {\n    DWORD BeginAddress;\n    union {\n        DWORD UnwindData;\n        struct {\n            DWORD Flag : 2;\n            DWORD FunctionLength : 11;\n            DWORD RegF : 3;\n            DWORD RegI : 4;\n            DWORD H : 1;\n            DWORD CR : 2;\n            DWORD FrameSize : 9;\n        } PackedUnwindData;\n    };\n} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION;\n\n\n#ifdef HOST_UNIX\n\ntypedef\nEXCEPTION_DISPOSITION\n(*PEXCEPTION_ROUTINE) (\n    PEXCEPTION_RECORD ExceptionRecord,\n    ULONG64 EstablisherFrame,\n    PCONTEXT ContextRecord,\n    PVOID DispatcherContext\n    );\n#endif\n//\n// Define exception dispatch context structure.\n//\n\ntypedef struct _T_DISPATCHER_CONTEXT {\n    DWORD64 ControlPc;\n    DWORD64 ImageBase;\n    PT_RUNTIME_FUNCTION FunctionEntry;\n    DWORD64 EstablisherFrame;\n    DWORD64 TargetPc;\n    PCONTEXT ContextRecord;\n    PEXCEPTION_ROUTINE LanguageHandler;\n    PVOID HandlerData;\n    PVOID HistoryTable;\n    DWORD ScopeIndex;\n    BOOLEAN ControlPcIsUnwound;\n    PBYTE  NonVolatileRegisters;\n} T_DISPATCHER_CONTEXT, *PT_DISPATCHER_CONTEXT;\n\n\n\n//\n// Nonvolatile context pointer record.\n//\n\ntypedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {\n\n    PDWORD64 X19;\n    PDWORD64 X20;\n    PDWORD64 X21;\n    PDWORD64 X22;\n    PDWORD64 X23;\n    PDWORD64 X24;\n    PDWORD64 X25;\n    PDWORD64 X26;\n    PDWORD64 X27;\n    PDWORD64 X28;\n    PDWORD64 Fp;\n    PDWORD64 Lr;\n\n    PDWORD64 D8;\n    PDWORD64 D9;\n    PDWORD64 D10;\n    PDWORD64 D11;\n    PDWORD64 D12;\n    PDWORD64 D13;\n    PDWORD64 D14;\n    PDWORD64 D15;\n\n} T_KNONVOLATILE_CONTEXT_POINTERS, *PT_KNONVOLATILE_CONTEXT_POINTERS;\n\n#if defined(HOST_UNIX) && defined(TARGET_ARM64) && !defined(HOST_ARM64)\nenum\n{\n    UNW_AARCH64_X19 = 19,\n    UNW_AARCH64_X20 = 20,\n    UNW_AARCH64_X21 = 21,\n    UNW_AARCH64_X22 = 22,\n    UNW_AARCH64_X23 = 23,\n    UNW_AARCH64_X24 = 24,\n    UNW_AARCH64_X25 = 25,\n    UNW_AARCH64_X26 = 26,\n    UNW_AARCH64_X27 = 27,\n    UNW_AARCH64_X28 = 28,\n    UNW_AARCH64_X29 = 29,\n    UNW_AARCH64_X30 = 30,\n    UNW_AARCH64_SP = 31,\n    UNW_AARCH64_PC = 32\n};\n\n#endif // TARGET_ARM64 && !HOST_ARM64\n\n#elif defined(HOST_AMD64) && defined(TARGET_LOONGARCH64)  // Host amd64 managing LOONGARCH64 related code\n\n#ifndef CROSS_COMPILE\n#define CROSS_COMPILE\n#endif\n\n//\n// Specify the number of breakpoints and watchpoints that the OS\n// will track. Architecturally, LOONGARCH64 supports up to 16. In practice,\n// however, almost no one implements more than 4 of each.\n//\n\n#define LOONGARCH64_MAX_BREAKPOINTS     8\n#define LOONGARCH64_MAX_WATCHPOINTS     2\n\n#define CONTEXT_UNWOUND_TO_CALL 0x20000000\n\ntypedef struct DECLSPEC_ALIGN(16) _T_CONTEXT {\n\n    //\n    // Control flags.\n    //\n\n    /* +0x000 */ DWORD ContextFlags;\n\n    //\n    // Integer registers\n    //\n    DWORD64 R0;\n    DWORD64 Ra;\n    DWORD64 Tp;\n    DWORD64 Sp;\n    DWORD64 A0;\n    DWORD64 A1;\n    DWORD64 A2;\n    DWORD64 A3;\n    DWORD64 A4;\n    DWORD64 A5;\n    DWORD64 A6;\n    DWORD64 A7;\n    DWORD64 T0;\n    DWORD64 T1;\n    DWORD64 T2;\n    DWORD64 T3;\n    DWORD64 T4;\n    DWORD64 T5;\n    DWORD64 T6;\n    DWORD64 T7;\n    DWORD64 T8;\n    DWORD64 X0;\n    DWORD64 Fp;\n    DWORD64 S0;\n    DWORD64 S1;\n    DWORD64 S2;\n    DWORD64 S3;\n    DWORD64 S4;\n    DWORD64 S5;\n    DWORD64 S6;\n    DWORD64 S7;\n    DWORD64 S8;\n    DWORD64 Pc;\n\n    //\n    // Floating Point Registers\n    //\n    //TODO-LoongArch64: support the SIMD.\n    ULONGLONG F[32];\n    DWORD   Fcsr;\n} T_CONTEXT, *PT_CONTEXT;\n\n// _IMAGE_LOONGARCH64_RUNTIME_FUNCTION_ENTRY (see ExternalAPIs\\Win9CoreSystem\\inc\\winnt.h)\ntypedef struct _T_RUNTIME_FUNCTION {\n    DWORD BeginAddress;\n    union {\n        DWORD UnwindData;\n        struct {\n            DWORD Flag : 2;\n            DWORD FunctionLength : 11;\n            DWORD RegF : 3;\n            DWORD RegI : 4;\n            DWORD H : 1;\n            DWORD CR : 2;\n            DWORD FrameSize : 9;\n        } PackedUnwindData;\n    };\n} T_RUNTIME_FUNCTION, *PT_RUNTIME_FUNCTION;\n\n//\n// Define exception dispatch context structure.\n//\n\ntypedef struct _T_DISPATCHER_CONTEXT {\n    DWORD64 ControlPc;\n    DWORD64 ImageBase;\n    PT_RUNTIME_FUNCTION FunctionEntry;\n    DWORD64 EstablisherFrame;\n    DWORD64 TargetPc;\n    PCONTEXT ContextRecord;\n    PEXCEPTION_ROUTINE LanguageHandler;\n    PVOID HandlerData;\n    PVOID HistoryTable;\n    DWORD ScopeIndex;\n    BOOLEAN ControlPcIsUnwound;\n    PBYTE  NonVolatileRegisters;\n} T_DISPATCHER_CONTEXT, *PT_DISPATCHER_CONTEXT;\n\n//\n// Nonvolatile context pointer record.\n//\n\ntypedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {\n\n    PDWORD64 S0;\n    PDWORD64 S1;\n    PDWORD64 S2;\n    PDWORD64 S3;\n    PDWORD64 S4;\n    PDWORD64 S5;\n    PDWORD64 S6;\n    PDWORD64 S7;\n    PDWORD64 S8;\n    PDWORD64 Fp;\n    PDWORD64 Tp;\n    PDWORD64 Ra;\n\n    PDWORD64 F24;\n    PDWORD64 F25;\n    PDWORD64 F26;\n    PDWORD64 F27;\n    PDWORD64 F28;\n    PDWORD64 F29;\n    PDWORD64 F30;\n    PDWORD64 F31;\n} T_KNONVOLATILE_CONTEXT_POINTERS, *PT_KNONVOLATILE_CONTEXT_POINTERS;\n\n#else\n\n#define T_CONTEXT CONTEXT\n#define PT_CONTEXT PCONTEXT\n\n#define T_DISPATCHER_CONTEXT DISPATCHER_CONTEXT\n#define PT_DISPATCHER_CONTEXT PDISPATCHER_CONTEXT\n\n#define T_KNONVOLATILE_CONTEXT_POINTERS KNONVOLATILE_CONTEXT_POINTERS\n#define PT_KNONVOLATILE_CONTEXT_POINTERS PKNONVOLATILE_CONTEXT_POINTERS\n\n#define T_RUNTIME_FUNCTION RUNTIME_FUNCTION\n#define PT_RUNTIME_FUNCTION PRUNTIME_FUNCTION\n\n#endif\n\n#if defined(DACCESS_COMPILE) && defined(TARGET_UNIX)\n// This is a TARGET oriented copy of CRITICAL_SECTION and PAL_CS_NATIVE_DATA_SIZE\n// It is configured based on TARGET configuration rather than HOST configuration\n// There is validation code in src/coreclr/vm/crst.cpp to keep these from\n// getting out of sync\n\n#define T_CRITICAL_SECTION_VALIDATION_MESSAGE \"T_CRITICAL_SECTION validation failed. It is not in sync with CRITICAL_SECTION\"\n\n#if defined(TARGET_OSX) && defined(TARGET_X86)\n#define DAC_CS_NATIVE_DATA_SIZE 76\n#elif defined(TARGET_OSX) && defined(TARGET_AMD64)\n#define DAC_CS_NATIVE_DATA_SIZE 120\n#elif defined(TARGET_OSX) && defined(TARGET_ARM64)\n#define DAC_CS_NATIVE_DATA_SIZE 120\n#elif defined(TARGET_FREEBSD) && defined(TARGET_X86)\n#define DAC_CS_NATIVE_DATA_SIZE 12\n#elif defined(TARGET_FREEBSD) && defined(TARGET_AMD64)\n#define DAC_CS_NATIVE_DATA_SIZE 24\n#elif defined(TARGET_LINUX) && defined(TARGET_ARM)\n#define DAC_CS_NATIVE_DATA_SIZE 80\n#elif defined(TARGET_LINUX) && defined(TARGET_ARM64)\n#define DAC_CS_NATIVE_DATA_SIZE 104\n#elif defined(TARGET_LINUX) && defined(TARGET_LOONGARCH64)\n#define DAC_CS_NATIVE_DATA_SIZE 96\n#elif defined(TARGET_LINUX) && defined(TARGET_X86)\n#define DAC_CS_NATIVE_DATA_SIZE 76\n#elif defined(TARGET_LINUX) && defined(TARGET_AMD64)\n#define DAC_CS_NATIVE_DATA_SIZE 96\n#elif defined(TARGET_LINUX) && defined(TARGET_S390X)\n#define DAC_CS_NATIVE_DATA_SIZE 96\n#elif defined(TARGET_LINUX) && defined(TARGET_LOONGARCH64)\n#define DAC_CS_NATIVE_DATA_SIZE 96\n#elif defined(TARGET_LINUX) && defined(TARGET_RISCV64)\n#define DAC_CS_NATIVE_DATA_SIZE 96\n#elif defined(TARGET_LINUX) && defined(TARGET_POWERPC64)\n#define DAC_CS_NATIVE_DATA_SIZE 96\n#elif defined(TARGET_NETBSD) && defined(TARGET_AMD64)\n#define DAC_CS_NATIVE_DATA_SIZE 96\n#elif defined(TARGET_NETBSD) && defined(TARGET_ARM)\n#define DAC_CS_NATIVE_DATA_SIZE 56\n#elif defined(TARGET_NETBSD) && defined(TARGET_X86)\n#define DAC_CS_NATIVE_DATA_SIZE 56\n#elif defined(__sun) && defined(TARGET_AMD64)\n#define DAC_CS_NATIVE_DATA_SIZE 48\n#else\n#warning\n#error  DAC_CS_NATIVE_DATA_SIZE is not defined for this architecture. This should be same value as PAL_CS_NATIVE_DATA_SIZE (aka sizeof(PAL_CS_NATIVE_DATA)).\n#endif\n\nstruct T_CRITICAL_SECTION {\n    PVOID DebugInfo;\n    LONG LockCount;\n    LONG RecursionCount;\n    HANDLE OwningThread;\n    ULONG_PTR SpinCount;\n\n#ifdef PAL_TRACK_CRITICAL_SECTIONS_DATA\n    BOOL bInternal;\n#endif // PAL_TRACK_CRITICAL_SECTIONS_DATA\n    volatile DWORD dwInitState;\n\n    union CSNativeDataStorage\n    {\n        BYTE rgNativeDataStorage[DAC_CS_NATIVE_DATA_SIZE];\n        PVOID pvAlign; // make sure the storage is machine-pointer-size aligned\n    } csnds;\n};\n#else\n#define T_CRITICAL_SECTION CRITICAL_SECTION\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/crsttypes_generated.h",
    "content": "//\n// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n#ifndef __CRST_TYPES_INCLUDED\n#define __CRST_TYPES_INCLUDED\n\n// **** THIS IS AN AUTOMATICALLY GENERATED HEADER FILE -- DO NOT EDIT!!! ****\n\n// This file describes the range of Crst types available and their mapping to a numeric level (used by the\n// runtime in debug mode to validate we're deadlock free). To modify these settings edit the\n// file:CrstTypes.def file and run the clr\\artifacts\\CrstTypeTool utility to generate a new version of this file.\n\n// Each Crst type is declared as a value in the following CrstType enum.\nenum CrstType\n{\n    CrstAppDomainCache = 0,\n    CrstArgBasedStubCache = 1,\n    CrstAssemblyList = 2,\n    CrstAssemblyLoader = 3,\n    CrstAvailableClass = 4,\n    CrstAvailableParamTypes = 5,\n    CrstBaseDomain = 6,\n    CrstCCompRC = 7,\n    CrstClassFactInfoHash = 8,\n    CrstClassInit = 9,\n    CrstClrNotification = 10,\n    CrstCodeFragmentHeap = 11,\n    CrstCodeVersioning = 12,\n    CrstCOMCallWrapper = 13,\n    CrstCOMWrapperCache = 14,\n    CrstDataTest1 = 15,\n    CrstDataTest2 = 16,\n    CrstDbgTransport = 17,\n    CrstDeadlockDetection = 18,\n    CrstDebuggerController = 19,\n    CrstDebuggerFavorLock = 20,\n    CrstDebuggerHeapExecMemLock = 21,\n    CrstDebuggerHeapLock = 22,\n    CrstDebuggerJitInfo = 23,\n    CrstDebuggerMutex = 24,\n    CrstDelegateToFPtrHash = 25,\n    CrstDomainLocalBlock = 26,\n    CrstDynamicIL = 27,\n    CrstDynamicMT = 28,\n    CrstEtwTypeLogHash = 29,\n    CrstEventPipe = 30,\n    CrstEventStore = 31,\n    CrstException = 32,\n    CrstExecutableAllocatorLock = 33,\n    CrstExecuteManRangeLock = 34,\n    CrstExternalObjectContextCache = 35,\n    CrstFCall = 36,\n    CrstFrozenObjectHeap = 37,\n    CrstFuncPtrStubs = 38,\n    CrstFusionAppCtx = 39,\n    CrstGCCover = 40,\n    CrstGlobalStrLiteralMap = 41,\n    CrstHandleTable = 42,\n    CrstIbcProfile = 43,\n    CrstIJWFixupData = 44,\n    CrstIJWHash = 45,\n    CrstILStubGen = 46,\n    CrstInlineTrackingMap = 47,\n    CrstInstMethodHashTable = 48,\n    CrstInterop = 49,\n    CrstInteropData = 50,\n    CrstIsJMCMethod = 51,\n    CrstISymUnmanagedReader = 52,\n    CrstJit = 53,\n    CrstJitGenericHandleCache = 54,\n    CrstJitInlineTrackingMap = 55,\n    CrstJitPatchpoint = 56,\n    CrstJitPerf = 57,\n    CrstJumpStubCache = 58,\n    CrstLeafLock = 59,\n    CrstListLock = 60,\n    CrstLoaderAllocator = 61,\n    CrstLoaderAllocatorReferences = 62,\n    CrstLoaderHeap = 63,\n    CrstManagedObjectWrapperMap = 64,\n    CrstMethodDescBackpatchInfoTracker = 65,\n    CrstMethodTableExposedObject = 66,\n    CrstModule = 67,\n    CrstModuleFixup = 68,\n    CrstModuleLookupTable = 69,\n    CrstMulticoreJitHash = 70,\n    CrstMulticoreJitManager = 71,\n    CrstNativeImageEagerFixups = 72,\n    CrstNativeImageLoad = 73,\n    CrstNls = 74,\n    CrstNotifyGdb = 75,\n    CrstObjectList = 76,\n    CrstPEImage = 77,\n    CrstPendingTypeLoadEntry = 78,\n    CrstPgoData = 79,\n    CrstPinnedByrefValidation = 80,\n    CrstPinnedHeapHandleTable = 81,\n    CrstProfilerGCRefDataFreeList = 82,\n    CrstProfilingAPIStatus = 83,\n    CrstRCWCache = 84,\n    CrstRCWCleanupList = 85,\n    CrstReadyToRunEntryPointToMethodDescMap = 86,\n    CrstReflection = 87,\n    CrstReJITGlobalRequest = 88,\n    CrstRetThunkCache = 89,\n    CrstSavedExceptionInfo = 90,\n    CrstSaveModuleProfileData = 91,\n    CrstSecurityStackwalkCache = 92,\n    CrstSigConvert = 93,\n    CrstSingleUseLock = 94,\n    CrstSpecialStatics = 95,\n    CrstStackSampler = 96,\n    CrstStressLog = 97,\n    CrstStubCache = 98,\n    CrstStubDispatchCache = 99,\n    CrstStubUnwindInfoHeapSegments = 100,\n    CrstSyncBlockCache = 101,\n    CrstSyncHashLock = 102,\n    CrstSystemBaseDomain = 103,\n    CrstSystemDomain = 104,\n    CrstSystemDomainDelayedUnloadList = 105,\n    CrstThreadIdDispenser = 106,\n    CrstThreadStore = 107,\n    CrstTieredCompilation = 108,\n    CrstTypeEquivalenceMap = 109,\n    CrstTypeIDMap = 110,\n    CrstUMEntryThunkCache = 111,\n    CrstUMEntryThunkFreeListLock = 112,\n    CrstUniqueStack = 113,\n    CrstUnresolvedClassLock = 114,\n    CrstUnwindInfoTableLock = 115,\n    CrstVSDIndirectionCellLock = 116,\n    CrstWrapperTemplate = 117,\n    kNumberOfCrstTypes = 118\n};\n\n#endif // __CRST_TYPES_INCLUDED\n\n// Define some debug data in one module only -- vm\\crst.cpp.\n#if defined(__IN_CRST_CPP) && defined(_DEBUG)\n\n// An array mapping CrstType to level.\nint g_rgCrstLevelMap[] =\n{\n    10,         // CrstAppDomainCache\n    3,          // CrstArgBasedStubCache\n    0,          // CrstAssemblyList\n    12,         // CrstAssemblyLoader\n    4,          // CrstAvailableClass\n    5,          // CrstAvailableParamTypes\n    7,          // CrstBaseDomain\n    -1,         // CrstCCompRC\n    13,         // CrstClassFactInfoHash\n    11,         // CrstClassInit\n    -1,         // CrstClrNotification\n    6,          // CrstCodeFragmentHeap\n    9,          // CrstCodeVersioning\n    3,          // CrstCOMCallWrapper\n    10,         // CrstCOMWrapperCache\n    3,          // CrstDataTest1\n    0,          // CrstDataTest2\n    0,          // CrstDbgTransport\n    0,          // CrstDeadlockDetection\n    -1,         // CrstDebuggerController\n    3,          // CrstDebuggerFavorLock\n    0,          // CrstDebuggerHeapExecMemLock\n    0,          // CrstDebuggerHeapLock\n    4,          // CrstDebuggerJitInfo\n    10,         // CrstDebuggerMutex\n    0,          // CrstDelegateToFPtrHash\n    16,         // CrstDomainLocalBlock\n    0,          // CrstDynamicIL\n    3,          // CrstDynamicMT\n    0,          // CrstEtwTypeLogHash\n    18,         // CrstEventPipe\n    0,          // CrstEventStore\n    0,          // CrstException\n    0,          // CrstExecutableAllocatorLock\n    0,          // CrstExecuteManRangeLock\n    0,          // CrstExternalObjectContextCache\n    4,          // CrstFCall\n    -1,         // CrstFrozenObjectHeap\n    7,          // CrstFuncPtrStubs\n    10,         // CrstFusionAppCtx\n    10,         // CrstGCCover\n    15,         // CrstGlobalStrLiteralMap\n    1,          // CrstHandleTable\n    0,          // CrstIbcProfile\n    8,          // CrstIJWFixupData\n    0,          // CrstIJWHash\n    7,          // CrstILStubGen\n    3,          // CrstInlineTrackingMap\n    17,         // CrstInstMethodHashTable\n    20,         // CrstInterop\n    5,          // CrstInteropData\n    0,          // CrstIsJMCMethod\n    7,          // CrstISymUnmanagedReader\n    11,         // CrstJit\n    0,          // CrstJitGenericHandleCache\n    13,         // CrstJitInlineTrackingMap\n    4,          // CrstJitPatchpoint\n    -1,         // CrstJitPerf\n    6,          // CrstJumpStubCache\n    0,          // CrstLeafLock\n    -1,         // CrstListLock\n    15,         // CrstLoaderAllocator\n    16,         // CrstLoaderAllocatorReferences\n    3,          // CrstLoaderHeap\n    3,          // CrstManagedObjectWrapperMap\n    10,         // CrstMethodDescBackpatchInfoTracker\n    -1,         // CrstMethodTableExposedObject\n    5,          // CrstModule\n    16,         // CrstModuleFixup\n    4,          // CrstModuleLookupTable\n    0,          // CrstMulticoreJitHash\n    13,         // CrstMulticoreJitManager\n    3,          // CrstNativeImageEagerFixups\n    0,          // CrstNativeImageLoad\n    0,          // CrstNls\n    0,          // CrstNotifyGdb\n    2,          // CrstObjectList\n    5,          // CrstPEImage\n    19,         // CrstPendingTypeLoadEntry\n    4,          // CrstPgoData\n    0,          // CrstPinnedByrefValidation\n    14,         // CrstPinnedHeapHandleTable\n    0,          // CrstProfilerGCRefDataFreeList\n    13,         // CrstProfilingAPIStatus\n    4,          // CrstRCWCache\n    0,          // CrstRCWCleanupList\n    10,         // CrstReadyToRunEntryPointToMethodDescMap\n    8,          // CrstReflection\n    14,         // CrstReJITGlobalRequest\n    4,          // CrstRetThunkCache\n    3,          // CrstSavedExceptionInfo\n    0,          // CrstSaveModuleProfileData\n    0,          // CrstSecurityStackwalkCache\n    4,          // CrstSigConvert\n    5,          // CrstSingleUseLock\n    0,          // CrstSpecialStatics\n    0,          // CrstStackSampler\n    -1,         // CrstStressLog\n    5,          // CrstStubCache\n    0,          // CrstStubDispatchCache\n    4,          // CrstStubUnwindInfoHeapSegments\n    3,          // CrstSyncBlockCache\n    0,          // CrstSyncHashLock\n    5,          // CrstSystemBaseDomain\n    13,         // CrstSystemDomain\n    0,          // CrstSystemDomainDelayedUnloadList\n    0,          // CrstThreadIdDispenser\n    12,         // CrstThreadStore\n    8,          // CrstTieredCompilation\n    4,          // CrstTypeEquivalenceMap\n    10,         // CrstTypeIDMap\n    4,          // CrstUMEntryThunkCache\n    3,          // CrstUMEntryThunkFreeListLock\n    4,          // CrstUniqueStack\n    7,          // CrstUnresolvedClassLock\n    3,          // CrstUnwindInfoTableLock\n    4,          // CrstVSDIndirectionCellLock\n    3,          // CrstWrapperTemplate\n};\n\n// An array mapping CrstType to a stringized name.\nLPCSTR g_rgCrstNameMap[] =\n{\n    \"CrstAppDomainCache\",\n    \"CrstArgBasedStubCache\",\n    \"CrstAssemblyList\",\n    \"CrstAssemblyLoader\",\n    \"CrstAvailableClass\",\n    \"CrstAvailableParamTypes\",\n    \"CrstBaseDomain\",\n    \"CrstCCompRC\",\n    \"CrstClassFactInfoHash\",\n    \"CrstClassInit\",\n    \"CrstClrNotification\",\n    \"CrstCodeFragmentHeap\",\n    \"CrstCodeVersioning\",\n    \"CrstCOMCallWrapper\",\n    \"CrstCOMWrapperCache\",\n    \"CrstDataTest1\",\n    \"CrstDataTest2\",\n    \"CrstDbgTransport\",\n    \"CrstDeadlockDetection\",\n    \"CrstDebuggerController\",\n    \"CrstDebuggerFavorLock\",\n    \"CrstDebuggerHeapExecMemLock\",\n    \"CrstDebuggerHeapLock\",\n    \"CrstDebuggerJitInfo\",\n    \"CrstDebuggerMutex\",\n    \"CrstDelegateToFPtrHash\",\n    \"CrstDomainLocalBlock\",\n    \"CrstDynamicIL\",\n    \"CrstDynamicMT\",\n    \"CrstEtwTypeLogHash\",\n    \"CrstEventPipe\",\n    \"CrstEventStore\",\n    \"CrstException\",\n    \"CrstExecutableAllocatorLock\",\n    \"CrstExecuteManRangeLock\",\n    \"CrstExternalObjectContextCache\",\n    \"CrstFCall\",\n    \"CrstFrozenObjectHeap\",\n    \"CrstFuncPtrStubs\",\n    \"CrstFusionAppCtx\",\n    \"CrstGCCover\",\n    \"CrstGlobalStrLiteralMap\",\n    \"CrstHandleTable\",\n    \"CrstIbcProfile\",\n    \"CrstIJWFixupData\",\n    \"CrstIJWHash\",\n    \"CrstILStubGen\",\n    \"CrstInlineTrackingMap\",\n    \"CrstInstMethodHashTable\",\n    \"CrstInterop\",\n    \"CrstInteropData\",\n    \"CrstIsJMCMethod\",\n    \"CrstISymUnmanagedReader\",\n    \"CrstJit\",\n    \"CrstJitGenericHandleCache\",\n    \"CrstJitInlineTrackingMap\",\n    \"CrstJitPatchpoint\",\n    \"CrstJitPerf\",\n    \"CrstJumpStubCache\",\n    \"CrstLeafLock\",\n    \"CrstListLock\",\n    \"CrstLoaderAllocator\",\n    \"CrstLoaderAllocatorReferences\",\n    \"CrstLoaderHeap\",\n    \"CrstManagedObjectWrapperMap\",\n    \"CrstMethodDescBackpatchInfoTracker\",\n    \"CrstMethodTableExposedObject\",\n    \"CrstModule\",\n    \"CrstModuleFixup\",\n    \"CrstModuleLookupTable\",\n    \"CrstMulticoreJitHash\",\n    \"CrstMulticoreJitManager\",\n    \"CrstNativeImageEagerFixups\",\n    \"CrstNativeImageLoad\",\n    \"CrstNls\",\n    \"CrstNotifyGdb\",\n    \"CrstObjectList\",\n    \"CrstPEImage\",\n    \"CrstPendingTypeLoadEntry\",\n    \"CrstPgoData\",\n    \"CrstPinnedByrefValidation\",\n    \"CrstPinnedHeapHandleTable\",\n    \"CrstProfilerGCRefDataFreeList\",\n    \"CrstProfilingAPIStatus\",\n    \"CrstRCWCache\",\n    \"CrstRCWCleanupList\",\n    \"CrstReadyToRunEntryPointToMethodDescMap\",\n    \"CrstReflection\",\n    \"CrstReJITGlobalRequest\",\n    \"CrstRetThunkCache\",\n    \"CrstSavedExceptionInfo\",\n    \"CrstSaveModuleProfileData\",\n    \"CrstSecurityStackwalkCache\",\n    \"CrstSigConvert\",\n    \"CrstSingleUseLock\",\n    \"CrstSpecialStatics\",\n    \"CrstStackSampler\",\n    \"CrstStressLog\",\n    \"CrstStubCache\",\n    \"CrstStubDispatchCache\",\n    \"CrstStubUnwindInfoHeapSegments\",\n    \"CrstSyncBlockCache\",\n    \"CrstSyncHashLock\",\n    \"CrstSystemBaseDomain\",\n    \"CrstSystemDomain\",\n    \"CrstSystemDomainDelayedUnloadList\",\n    \"CrstThreadIdDispenser\",\n    \"CrstThreadStore\",\n    \"CrstTieredCompilation\",\n    \"CrstTypeEquivalenceMap\",\n    \"CrstTypeIDMap\",\n    \"CrstUMEntryThunkCache\",\n    \"CrstUMEntryThunkFreeListLock\",\n    \"CrstUniqueStack\",\n    \"CrstUnresolvedClassLock\",\n    \"CrstUnwindInfoTableLock\",\n    \"CrstVSDIndirectionCellLock\",\n    \"CrstWrapperTemplate\",\n};\n\n// Define a special level constant for unordered locks.\n#define CRSTUNORDERED (-1)\n\n// Define inline helpers to map Crst types to names and levels.\ninline static int GetCrstLevel(CrstType crstType)\n{\n    LIMITED_METHOD_CONTRACT;\n    _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);\n    return g_rgCrstLevelMap[crstType];\n}\ninline static LPCSTR GetCrstName(CrstType crstType)\n{\n    LIMITED_METHOD_CONTRACT;\n    _ASSERTE(crstType >= 0 && crstType < kNumberOfCrstTypes);\n    return g_rgCrstNameMap[crstType];\n}\n\n#endif // defined(__IN_CRST_CPP) && defined(_DEBUG)\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/crtwrap.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// CrtWrap.h\n//\n// Wrapper code for the C runtime library.\n//\n//*****************************************************************************\n\n#ifndef __CrtWrap_h__\n#define __CrtWrap_h__\n\n#include <stdint.h>\n#include <windows.h>\n#include <objbase.h>\n#include \"debugmacros.h\"\n#include <stdlib.h>\n#include <malloc.h>\n#include <wchar.h>\n#include <stdio.h>\n\n#ifdef HOST_WINDOWS\n// CoreCLR.dll uses linker .def files to control the exported symbols.\n// Define DLLEXPORT macro as empty on Windows.\n#define DLLEXPORT\n#endif\n\n#endif // __CrtWrap_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cvconst.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// cvconst.h - codeview constant definitions\n//-----------------------------------------------------------------\n//\n// Copyright Microsoft Corporation.  All Rights Reserved.\n//\n//---------------------------------------------------------------\n#ifndef _CVCONST_H_\n#define _CVCONST_H_\n\n\n\n//      Enumeration for function call type\n\n\ntypedef enum CV_call_e {\n    CV_CALL_NEAR_C      = 0x00, // near right to left push, caller pops stack\n    CV_CALL_FAR_C       = 0x01, // far right to left push, caller pops stack\n    CV_CALL_NEAR_PASCAL = 0x02, // near left to right push, callee pops stack\n    CV_CALL_FAR_PASCAL  = 0x03, // far left to right push, callee pops stack\n    CV_CALL_NEAR_FAST   = 0x04, // near left to right push with regs, callee pops stack\n    CV_CALL_FAR_FAST    = 0x05, // far left to right push with regs, callee pops stack\n    CV_CALL_SKIPPED     = 0x06, // skipped (unused) call index\n    CV_CALL_NEAR_STD    = 0x07, // near standard call\n    CV_CALL_FAR_STD     = 0x08, // far standard call\n    CV_CALL_NEAR_SYS    = 0x09, // near sys call\n    CV_CALL_FAR_SYS     = 0x0a, // far sys call\n    CV_CALL_THISCALL    = 0x0b, // this call (this passed in register)\n    CV_CALL_MIPSCALL    = 0x0c, // Mips call\n    CV_CALL_GENERIC     = 0x0d, // Generic call sequence\n    CV_CALL_ALPHACALL   = 0x0e, // Alpha call\n    CV_CALL_PPCCALL     = 0x0f, // PPC call\n    CV_CALL_SHCALL      = 0x10, // Hitachi SuperH call\n    CV_CALL_ARMCALL     = 0x11, // ARM call\n    CV_CALL_AM33CALL    = 0x12, // AM33 call\n    CV_CALL_TRICALL     = 0x13, // TriCore Call\n    CV_CALL_SH5CALL     = 0x14, // Hitachi SuperH-5 call\n    CV_CALL_M32RCALL    = 0x15, // M32R Call\n    CV_CALL_CLRCALL     = 0x16, // clr call\n    CV_CALL_INLINE      = 0x17, // Marker for routines always inlined and thus lacking a convention\n    CV_CALL_NEAR_VECTOR = 0x18, // near left to right push with regs, callee pops stack\n    CV_CALL_RESERVED    = 0x19  // first unused call enumeration\n\n    // Do NOT add any more machine specific conventions.  This is to be used for\n    // calling conventions in the source only (e.g. __cdecl, __stdcall).\n} CV_call_e;\n\n\n//      Values for the access protection of class attributes\n\n\ntypedef enum CV_access_e {\n    CV_private   = 1,\n    CV_protected = 2,\n    CV_public    = 3\n} CV_access_e;\n\ntypedef enum THUNK_ORDINAL {\n    THUNK_ORDINAL_NOTYPE,       // standard thunk\n    THUNK_ORDINAL_ADJUSTOR,     // \"this\" adjustor thunk\n    THUNK_ORDINAL_VCALL,        // virtual call thunk\n    THUNK_ORDINAL_PCODE,        // pcode thunk\n    THUNK_ORDINAL_LOAD,         // thunk which loads the address to jump to\n                                //  via unknown means...\n\n // trampoline thunk ordinals   - only for use in Trampoline thunk symbols\n    THUNK_ORDINAL_TRAMP_INCREMENTAL,\n    THUNK_ORDINAL_TRAMP_BRANCHISLAND,\n\n} THUNK_ORDINAL;\n\n\nenum CV_SourceChksum_t {\n    CHKSUM_TYPE_NONE = 0,        // indicates no checksum is available\n    CHKSUM_TYPE_MD5,\n    CHKSUM_TYPE_SHA1,\n    CHKSUM_TYPE_SHA_256,\n};\n\n//\n// DIA enums\n//\n\nenum SymTagEnum\n{\n    SymTagNull,\n    SymTagExe,\n    SymTagCompiland,\n    SymTagCompilandDetails,\n    SymTagCompilandEnv,\n    SymTagFunction,\n    SymTagBlock,\n    SymTagData,\n    SymTagAnnotation,\n    SymTagLabel,\n    SymTagPublicSymbol,\n    SymTagUDT,\n    SymTagEnum,\n    SymTagFunctionType,\n    SymTagPointerType,\n    SymTagArrayType,\n    SymTagBaseType,\n    SymTagTypedef,\n    SymTagBaseClass,\n    SymTagFriend,\n    SymTagFunctionArgType,\n    SymTagFuncDebugStart,\n    SymTagFuncDebugEnd,\n    SymTagUsingNamespace,\n    SymTagVTableShape,\n    SymTagVTable,\n    SymTagCustom,\n    SymTagThunk,\n    SymTagCustomType,\n    SymTagManagedType,\n    SymTagDimension,\n    SymTagCallSite,\n    SymTagInlineSite,\n    SymTagBaseInterface,\n    SymTagVectorType,\n    SymTagMatrixType,\n    SymTagHLSLType,\n    SymTagCaller,\n    SymTagCallee,\n    SymTagExport,\n    SymTagHeapAllocationSite,\n    SymTagCoffGroup,\n    SymTagMax\n};\n\nenum LocationType\n{\n    LocIsNull,\n    LocIsStatic,\n    LocIsTLS,\n    LocIsRegRel,\n    LocIsThisRel,\n    LocIsEnregistered,\n    LocIsBitField,\n    LocIsSlot,\n    LocIsIlRel,\n    LocInMetaData,\n    LocIsConstant,\n    LocTypeMax\n};\n\nenum DataKind\n{\n    DataIsUnknown,\n    DataIsLocal,\n    DataIsStaticLocal,\n    DataIsParam,\n    DataIsObjectPtr,\n    DataIsFileStatic,\n    DataIsGlobal,\n    DataIsMember,\n    DataIsStaticMember,\n    DataIsConstant\n};\n\nenum UdtKind\n{\n    UdtStruct,\n    UdtClass,\n    UdtUnion,\n    UdtInterface\n};\n\nenum BasicType\n{\n    btNoType = 0,\n    btVoid = 1,\n    btChar = 2,\n    btWChar = 3,\n    btInt = 6,\n    btUInt = 7,\n    btFloat = 8,\n    btBCD = 9,\n    btBool = 10,\n    btLong = 13,\n    btULong = 14,\n    btCurrency = 25,\n    btDate = 26,\n    btVariant = 27,\n    btComplex = 28,\n    btBit = 29,\n    btBSTR = 30,\n    btHresult = 31,\n    btChar16 = 32,  // char16_t\n    btChar32 = 33,  // char32_t\n};\n\n\n//      enumeration for type modifier values\n\ntypedef enum CV_modifier_e {\n    // 0x0000 - 0x01ff - Reserved.\n\n    CV_MOD_INVALID                      = 0x0000,\n\n    // Standard modifiers.\n\n    CV_MOD_CONST                        = 0x0001,\n    CV_MOD_VOLATILE                     = 0x0002,\n    CV_MOD_UNALIGNED                    = 0x0003,\n\n    // 0x0200 - 0x03ff - HLSL modifiers.\n\n    CV_MOD_HLSL_UNIFORM                 = 0x0200,\n    CV_MOD_HLSL_LINE                    = 0x0201,\n    CV_MOD_HLSL_TRIANGLE                = 0x0202,\n    CV_MOD_HLSL_LINEADJ                 = 0x0203,\n    CV_MOD_HLSL_TRIANGLEADJ             = 0x0204,\n    CV_MOD_HLSL_LINEAR                  = 0x0205,\n    CV_MOD_HLSL_CENTROID                = 0x0206,\n    CV_MOD_HLSL_CONSTINTERP             = 0x0207,\n    CV_MOD_HLSL_NOPERSPECTIVE           = 0x0208,\n    CV_MOD_HLSL_SAMPLE                  = 0x0209,\n    CV_MOD_HLSL_CENTER                  = 0x020a,\n    CV_MOD_HLSL_SNORM                   = 0x020b,\n    CV_MOD_HLSL_UNORM                   = 0x020c,\n    CV_MOD_HLSL_PRECISE                 = 0x020d,\n    CV_MOD_HLSL_UAV_GLOBALLY_COHERENT   = 0x020e,\n\n    // 0x0400 - 0xffff - Unused.\n\n} CV_modifier_e;\n\n\n//      built-in type kinds\n\n\ntypedef enum CV_builtin_e {\n\n    // 0x0000 - 0x01ff - Reserved.\n    CV_BI_INVALID                       = 0x0000,\n\n    // 0x0200 - 0x03ff - HLSL types.\n\n    CV_BI_HLSL_INTERFACE_POINTER        = 0x0200,\n    CV_BI_HLSL_TEXTURE1D                = 0x0201,\n    CV_BI_HLSL_TEXTURE1D_ARRAY          = 0x0202,\n    CV_BI_HLSL_TEXTURE2D                = 0x0203,\n    CV_BI_HLSL_TEXTURE2D_ARRAY          = 0x0204,\n    CV_BI_HLSL_TEXTURE3D                = 0x0205,\n    CV_BI_HLSL_TEXTURECUBE              = 0x0206,\n    CV_BI_HLSL_TEXTURECUBE_ARRAY        = 0x0207,\n    CV_BI_HLSL_TEXTURE2DMS              = 0x0208,\n    CV_BI_HLSL_TEXTURE2DMS_ARRAY        = 0x0209,\n    CV_BI_HLSL_SAMPLER                  = 0x020a,\n    CV_BI_HLSL_SAMPLERCOMPARISON        = 0x020b,\n    CV_BI_HLSL_BUFFER                   = 0x020c,\n    CV_BI_HLSL_POINTSTREAM              = 0x020d,\n    CV_BI_HLSL_LINESTREAM               = 0x020e,\n    CV_BI_HLSL_TRIANGLESTREAM           = 0x020f,\n    CV_BI_HLSL_INPUTPATCH               = 0x0210,\n    CV_BI_HLSL_OUTPUTPATCH              = 0x0211,\n    CV_BI_HLSL_RWTEXTURE1D              = 0x0212,\n    CV_BI_HLSL_RWTEXTURE1D_ARRAY        = 0x0213,\n    CV_BI_HLSL_RWTEXTURE2D              = 0x0214,\n    CV_BI_HLSL_RWTEXTURE2D_ARRAY        = 0x0215,\n    CV_BI_HLSL_RWTEXTURE3D              = 0x0216,\n    CV_BI_HLSL_RWBUFFER                 = 0x0217,\n    CV_BI_HLSL_BYTEADDRESS_BUFFER       = 0x0218,\n    CV_BI_HLSL_RWBYTEADDRESS_BUFFER     = 0x0219,\n    CV_BI_HLSL_STRUCTURED_BUFFER        = 0x021a,\n    CV_BI_HLSL_RWSTRUCTURED_BUFFER      = 0x021b,\n    CV_BI_HLSL_APPEND_STRUCTURED_BUFFER = 0x021c,\n    CV_BI_HLSL_CONSUME_STRUCTURED_BUFFER= 0x021d,\n    CV_BI_HLSL_MIN8FLOAT                = 0x021e,\n    CV_BI_HLSL_MIN10FLOAT               = 0x021f,\n    CV_BI_HLSL_MIN16FLOAT               = 0x0220,\n    CV_BI_HLSL_MIN12INT                 = 0x0221,\n    CV_BI_HLSL_MIN16INT                 = 0x0222,\n    CV_BI_HLSL_MIN16UINT                = 0x0223,\n\n    // 0x0400 - 0xffff - Unused.\n\n} CV_builtin_e;\n\n\n//  enum describing the compile flag source language\n\n\ntypedef enum CV_CFL_LANG {\n    CV_CFL_C        = 0x00,\n    CV_CFL_CXX      = 0x01,\n    CV_CFL_FORTRAN  = 0x02,\n    CV_CFL_MASM     = 0x03,\n    CV_CFL_PASCAL   = 0x04,\n    CV_CFL_BASIC    = 0x05,\n    CV_CFL_COBOL    = 0x06,\n    CV_CFL_LINK     = 0x07,\n    CV_CFL_CVTRES   = 0x08,\n    CV_CFL_CVTPGD   = 0x09,\n    CV_CFL_CSHARP   = 0x0A,  // C#\n    CV_CFL_VB       = 0x0B,  // Visual Basic\n    CV_CFL_ILASM    = 0x0C,  // IL (as in CLR) ASM\n    CV_CFL_JAVA     = 0x0D,\n    CV_CFL_JSCRIPT  = 0x0E,\n    CV_CFL_MSIL     = 0x0F,  // Unknown MSIL (LTCG of .NETMODULE)\n    CV_CFL_HLSL     = 0x10,  // High Level Shader Language\n} CV_CFL_LANG;\n\n\n//  enum describing target processor\n\n\ntypedef enum CV_CPU_TYPE_e {\n    CV_CFL_8080         = 0x00,\n    CV_CFL_8086         = 0x01,\n    CV_CFL_80286        = 0x02,\n    CV_CFL_80386        = 0x03,\n    CV_CFL_80486        = 0x04,\n    CV_CFL_PENTIUM      = 0x05,\n    CV_CFL_PENTIUMII    = 0x06,\n    CV_CFL_PENTIUMPRO   = CV_CFL_PENTIUMII,\n    CV_CFL_PENTIUMIII   = 0x07,\n    CV_CFL_MIPS         = 0x10,\n    CV_CFL_MIPSR4000    = CV_CFL_MIPS,  // don't break current code\n    CV_CFL_MIPS16       = 0x11,\n    CV_CFL_MIPS32       = 0x12,\n    CV_CFL_MIPS64       = 0x13,\n    CV_CFL_MIPSI        = 0x14,\n    CV_CFL_MIPSII       = 0x15,\n    CV_CFL_MIPSIII      = 0x16,\n    CV_CFL_MIPSIV       = 0x17,\n    CV_CFL_MIPSV        = 0x18,\n    CV_CFL_M68000       = 0x20,\n    CV_CFL_M68010       = 0x21,\n    CV_CFL_M68020       = 0x22,\n    CV_CFL_M68030       = 0x23,\n    CV_CFL_M68040       = 0x24,\n    CV_CFL_ALPHA        = 0x30,\n    CV_CFL_ALPHA_21064  = 0x30,\n    CV_CFL_ALPHA_21164  = 0x31,\n    CV_CFL_ALPHA_21164A = 0x32,\n    CV_CFL_ALPHA_21264  = 0x33,\n    CV_CFL_ALPHA_21364  = 0x34,\n    CV_CFL_PPC601       = 0x40,\n    CV_CFL_PPC603       = 0x41,\n    CV_CFL_PPC604       = 0x42,\n    CV_CFL_PPC620       = 0x43,\n    CV_CFL_PPCFP        = 0x44,\n    CV_CFL_PPCBE        = 0x45,\n    CV_CFL_SH3          = 0x50,\n    CV_CFL_SH3E         = 0x51,\n    CV_CFL_SH3DSP       = 0x52,\n    CV_CFL_SH4          = 0x53,\n    CV_CFL_SHMEDIA      = 0x54,\n    CV_CFL_ARM3         = 0x60,\n    CV_CFL_ARM4         = 0x61,\n    CV_CFL_ARM4T        = 0x62,\n    CV_CFL_ARM5         = 0x63,\n    CV_CFL_ARM5T        = 0x64,\n    CV_CFL_ARM6         = 0x65,\n    CV_CFL_ARM_XMAC     = 0x66,\n    CV_CFL_ARM_WMMX     = 0x67,\n    CV_CFL_ARM7         = 0x68,\n    CV_CFL_OMNI         = 0x70,\n    CV_CFL_IA64         = 0x80,\n    CV_CFL_IA64_1       = 0x80,\n    CV_CFL_IA64_2       = 0x81,\n    CV_CFL_CEE          = 0x90,\n    CV_CFL_AM33         = 0xA0,\n    CV_CFL_M32R         = 0xB0,\n    CV_CFL_TRICORE      = 0xC0,\n    CV_CFL_X64          = 0xD0,\n    CV_CFL_AMD64        = CV_CFL_X64,\n    CV_CFL_EBC          = 0xE0,\n    CV_CFL_THUMB        = 0xF0,\n    CV_CFL_ARMNT        = 0xF4,\n    CV_CFL_ARM64        = 0xF6,\n    CV_CFL_D3D11_SHADER = 0x100,\n} CV_CPU_TYPE_e;\n\ntypedef enum CV_HREG_e {\n    // Register subset shared by all processor types,\n    // must not overlap with any of the ranges below, hence the high values\n\n    CV_ALLREG_ERR   =   30000,\n    CV_ALLREG_TEB   =   30001,\n    CV_ALLREG_TIMER =   30002,\n    CV_ALLREG_EFAD1 =   30003,\n    CV_ALLREG_EFAD2 =   30004,\n    CV_ALLREG_EFAD3 =   30005,\n    CV_ALLREG_VFRAME=   30006,\n    CV_ALLREG_HANDLE=   30007,\n    CV_ALLREG_PARAMS=   30008,\n    CV_ALLREG_LOCALS=   30009,\n    CV_ALLREG_TID   =   30010,\n    CV_ALLREG_ENV   =   30011,\n    CV_ALLREG_CMDLN =   30012,\n\n\n    //  Register set for the Intel 80x86 and ix86 processor series\n    //  (plus PCODE registers)\n\n    CV_REG_NONE     =   0,\n    CV_REG_AL       =   1,\n    CV_REG_CL       =   2,\n    CV_REG_DL       =   3,\n    CV_REG_BL       =   4,\n    CV_REG_AH       =   5,\n    CV_REG_CH       =   6,\n    CV_REG_DH       =   7,\n    CV_REG_BH       =   8,\n    CV_REG_AX       =   9,\n    CV_REG_CX       =  10,\n    CV_REG_DX       =  11,\n    CV_REG_BX       =  12,\n    CV_REG_SP       =  13,\n    CV_REG_BP       =  14,\n    CV_REG_SI       =  15,\n    CV_REG_DI       =  16,\n    CV_REG_EAX      =  17,\n    CV_REG_ECX      =  18,\n    CV_REG_EDX      =  19,\n    CV_REG_EBX      =  20,\n    CV_REG_ESP      =  21,\n    CV_REG_EBP      =  22,\n    CV_REG_ESI      =  23,\n    CV_REG_EDI      =  24,\n    CV_REG_ES       =  25,\n    CV_REG_CS       =  26,\n    CV_REG_SS       =  27,\n    CV_REG_DS       =  28,\n    CV_REG_FS       =  29,\n    CV_REG_GS       =  30,\n    CV_REG_IP       =  31,\n    CV_REG_FLAGS    =  32,\n    CV_REG_EIP      =  33,\n    CV_REG_EFLAGS   =  34,\n    CV_REG_TEMP     =  40,          // PCODE Temp\n    CV_REG_TEMPH    =  41,          // PCODE TempH\n    CV_REG_QUOTE    =  42,          // PCODE Quote\n    CV_REG_PCDR3    =  43,          // PCODE reserved\n    CV_REG_PCDR4    =  44,          // PCODE reserved\n    CV_REG_PCDR5    =  45,          // PCODE reserved\n    CV_REG_PCDR6    =  46,          // PCODE reserved\n    CV_REG_PCDR7    =  47,          // PCODE reserved\n    CV_REG_CR0      =  80,          // CR0 -- control registers\n    CV_REG_CR1      =  81,\n    CV_REG_CR2      =  82,\n    CV_REG_CR3      =  83,\n    CV_REG_CR4      =  84,          // Pentium\n    CV_REG_DR0      =  90,          // Debug register\n    CV_REG_DR1      =  91,\n    CV_REG_DR2      =  92,\n    CV_REG_DR3      =  93,\n    CV_REG_DR4      =  94,\n    CV_REG_DR5      =  95,\n    CV_REG_DR6      =  96,\n    CV_REG_DR7      =  97,\n    CV_REG_GDTR     =  110,\n    CV_REG_GDTL     =  111,\n    CV_REG_IDTR     =  112,\n    CV_REG_IDTL     =  113,\n    CV_REG_LDTR     =  114,\n    CV_REG_TR       =  115,\n\n    CV_REG_PSEUDO1  =  116,\n    CV_REG_PSEUDO2  =  117,\n    CV_REG_PSEUDO3  =  118,\n    CV_REG_PSEUDO4  =  119,\n    CV_REG_PSEUDO5  =  120,\n    CV_REG_PSEUDO6  =  121,\n    CV_REG_PSEUDO7  =  122,\n    CV_REG_PSEUDO8  =  123,\n    CV_REG_PSEUDO9  =  124,\n\n    CV_REG_ST0      =  128,\n    CV_REG_ST1      =  129,\n    CV_REG_ST2      =  130,\n    CV_REG_ST3      =  131,\n    CV_REG_ST4      =  132,\n    CV_REG_ST5      =  133,\n    CV_REG_ST6      =  134,\n    CV_REG_ST7      =  135,\n    CV_REG_CTRL     =  136,\n    CV_REG_STAT     =  137,\n    CV_REG_TAG      =  138,\n    CV_REG_FPIP     =  139,\n    CV_REG_FPCS     =  140,\n    CV_REG_FPDO     =  141,\n    CV_REG_FPDS     =  142,\n    CV_REG_ISEM     =  143,\n    CV_REG_FPEIP    =  144,\n    CV_REG_FPEDO    =  145,\n\n    CV_REG_MM0      =  146,\n    CV_REG_MM1      =  147,\n    CV_REG_MM2      =  148,\n    CV_REG_MM3      =  149,\n    CV_REG_MM4      =  150,\n    CV_REG_MM5      =  151,\n    CV_REG_MM6      =  152,\n    CV_REG_MM7      =  153,\n\n    CV_REG_XMM0     =  154, // KATMAI registers\n    CV_REG_XMM1     =  155,\n    CV_REG_XMM2     =  156,\n    CV_REG_XMM3     =  157,\n    CV_REG_XMM4     =  158,\n    CV_REG_XMM5     =  159,\n    CV_REG_XMM6     =  160,\n    CV_REG_XMM7     =  161,\n\n    CV_REG_XMM00    =  162, // KATMAI sub-registers\n    CV_REG_XMM01    =  163,\n    CV_REG_XMM02    =  164,\n    CV_REG_XMM03    =  165,\n    CV_REG_XMM10    =  166,\n    CV_REG_XMM11    =  167,\n    CV_REG_XMM12    =  168,\n    CV_REG_XMM13    =  169,\n    CV_REG_XMM20    =  170,\n    CV_REG_XMM21    =  171,\n    CV_REG_XMM22    =  172,\n    CV_REG_XMM23    =  173,\n    CV_REG_XMM30    =  174,\n    CV_REG_XMM31    =  175,\n    CV_REG_XMM32    =  176,\n    CV_REG_XMM33    =  177,\n    CV_REG_XMM40    =  178,\n    CV_REG_XMM41    =  179,\n    CV_REG_XMM42    =  180,\n    CV_REG_XMM43    =  181,\n    CV_REG_XMM50    =  182,\n    CV_REG_XMM51    =  183,\n    CV_REG_XMM52    =  184,\n    CV_REG_XMM53    =  185,\n    CV_REG_XMM60    =  186,\n    CV_REG_XMM61    =  187,\n    CV_REG_XMM62    =  188,\n    CV_REG_XMM63    =  189,\n    CV_REG_XMM70    =  190,\n    CV_REG_XMM71    =  191,\n    CV_REG_XMM72    =  192,\n    CV_REG_XMM73    =  193,\n\n    CV_REG_XMM0L    =  194,\n    CV_REG_XMM1L    =  195,\n    CV_REG_XMM2L    =  196,\n    CV_REG_XMM3L    =  197,\n    CV_REG_XMM4L    =  198,\n    CV_REG_XMM5L    =  199,\n    CV_REG_XMM6L    =  200,\n    CV_REG_XMM7L    =  201,\n\n    CV_REG_XMM0H    =  202,\n    CV_REG_XMM1H    =  203,\n    CV_REG_XMM2H    =  204,\n    CV_REG_XMM3H    =  205,\n    CV_REG_XMM4H    =  206,\n    CV_REG_XMM5H    =  207,\n    CV_REG_XMM6H    =  208,\n    CV_REG_XMM7H    =  209,\n\n    CV_REG_MXCSR    =  211, // XMM status register\n\n    CV_REG_EDXEAX   =  212, // EDX:EAX pair\n\n    CV_REG_EMM0L    =  220, // XMM sub-registers (WNI integer)\n    CV_REG_EMM1L    =  221,\n    CV_REG_EMM2L    =  222,\n    CV_REG_EMM3L    =  223,\n    CV_REG_EMM4L    =  224,\n    CV_REG_EMM5L    =  225,\n    CV_REG_EMM6L    =  226,\n    CV_REG_EMM7L    =  227,\n\n    CV_REG_EMM0H    =  228,\n    CV_REG_EMM1H    =  229,\n    CV_REG_EMM2H    =  230,\n    CV_REG_EMM3H    =  231,\n    CV_REG_EMM4H    =  232,\n    CV_REG_EMM5H    =  233,\n    CV_REG_EMM6H    =  234,\n    CV_REG_EMM7H    =  235,\n\n    // do not change the order of these regs, first one must be even too\n    CV_REG_MM00     =  236,\n    CV_REG_MM01     =  237,\n    CV_REG_MM10     =  238,\n    CV_REG_MM11     =  239,\n    CV_REG_MM20     =  240,\n    CV_REG_MM21     =  241,\n    CV_REG_MM30     =  242,\n    CV_REG_MM31     =  243,\n    CV_REG_MM40     =  244,\n    CV_REG_MM41     =  245,\n    CV_REG_MM50     =  246,\n    CV_REG_MM51     =  247,\n    CV_REG_MM60     =  248,\n    CV_REG_MM61     =  249,\n    CV_REG_MM70     =  250,\n    CV_REG_MM71     =  251,\n\n    CV_REG_YMM0     =  252, // AVX registers\n    CV_REG_YMM1     =  253,\n    CV_REG_YMM2     =  254,\n    CV_REG_YMM3     =  255,\n    CV_REG_YMM4     =  256,\n    CV_REG_YMM5     =  257,\n    CV_REG_YMM6     =  258,\n    CV_REG_YMM7     =  259,\n\n    CV_REG_YMM0H    =  260,\n    CV_REG_YMM1H    =  261,\n    CV_REG_YMM2H    =  262,\n    CV_REG_YMM3H    =  263,\n    CV_REG_YMM4H    =  264,\n    CV_REG_YMM5H    =  265,\n    CV_REG_YMM6H    =  266,\n    CV_REG_YMM7H    =  267,\n\n    CV_REG_YMM0I0     =    268,    // AVX integer registers\n    CV_REG_YMM0I1     =    269,\n    CV_REG_YMM0I2     =    270,\n    CV_REG_YMM0I3     =    271,\n    CV_REG_YMM1I0     =    272,\n    CV_REG_YMM1I1     =    273,\n    CV_REG_YMM1I2     =    274,\n    CV_REG_YMM1I3     =    275,\n    CV_REG_YMM2I0     =    276,\n    CV_REG_YMM2I1     =    277,\n    CV_REG_YMM2I2     =    278,\n    CV_REG_YMM2I3     =    279,\n    CV_REG_YMM3I0     =    280,\n    CV_REG_YMM3I1     =    281,\n    CV_REG_YMM3I2     =    282,\n    CV_REG_YMM3I3     =    283,\n    CV_REG_YMM4I0     =    284,\n    CV_REG_YMM4I1     =    285,\n    CV_REG_YMM4I2     =    286,\n    CV_REG_YMM4I3     =    287,\n    CV_REG_YMM5I0     =    288,\n    CV_REG_YMM5I1     =    289,\n    CV_REG_YMM5I2     =    290,\n    CV_REG_YMM5I3     =    291,\n    CV_REG_YMM6I0     =    292,\n    CV_REG_YMM6I1     =    293,\n    CV_REG_YMM6I2     =    294,\n    CV_REG_YMM6I3     =    295,\n    CV_REG_YMM7I0     =    296,\n    CV_REG_YMM7I1     =    297,\n    CV_REG_YMM7I2     =    298,\n    CV_REG_YMM7I3     =    299,\n\n    CV_REG_YMM0F0    =  300,     // AVX floating-point single precise registers\n    CV_REG_YMM0F1    =  301,\n    CV_REG_YMM0F2    =  302,\n    CV_REG_YMM0F3    =  303,\n    CV_REG_YMM0F4    =  304,\n    CV_REG_YMM0F5    =  305,\n    CV_REG_YMM0F6    =  306,\n    CV_REG_YMM0F7    =  307,\n    CV_REG_YMM1F0    =  308,\n    CV_REG_YMM1F1    =  309,\n    CV_REG_YMM1F2    =  310,\n    CV_REG_YMM1F3    =  311,\n    CV_REG_YMM1F4    =  312,\n    CV_REG_YMM1F5    =  313,\n    CV_REG_YMM1F6    =  314,\n    CV_REG_YMM1F7    =  315,\n    CV_REG_YMM2F0    =  316,\n    CV_REG_YMM2F1    =  317,\n    CV_REG_YMM2F2    =  318,\n    CV_REG_YMM2F3    =  319,\n    CV_REG_YMM2F4    =  320,\n    CV_REG_YMM2F5    =  321,\n    CV_REG_YMM2F6    =  322,\n    CV_REG_YMM2F7    =  323,\n    CV_REG_YMM3F0    =  324,\n    CV_REG_YMM3F1    =  325,\n    CV_REG_YMM3F2    =  326,\n    CV_REG_YMM3F3    =  327,\n    CV_REG_YMM3F4    =  328,\n    CV_REG_YMM3F5    =  329,\n    CV_REG_YMM3F6    =  330,\n    CV_REG_YMM3F7    =  331,\n    CV_REG_YMM4F0    =  332,\n    CV_REG_YMM4F1    =  333,\n    CV_REG_YMM4F2    =  334,\n    CV_REG_YMM4F3    =  335,\n    CV_REG_YMM4F4    =  336,\n    CV_REG_YMM4F5    =  337,\n    CV_REG_YMM4F6    =  338,\n    CV_REG_YMM4F7    =  339,\n    CV_REG_YMM5F0    =  340,\n    CV_REG_YMM5F1    =  341,\n    CV_REG_YMM5F2    =  342,\n    CV_REG_YMM5F3    =  343,\n    CV_REG_YMM5F4    =  344,\n    CV_REG_YMM5F5    =  345,\n    CV_REG_YMM5F6    =  346,\n    CV_REG_YMM5F7    =  347,\n    CV_REG_YMM6F0    =  348,\n    CV_REG_YMM6F1    =  349,\n    CV_REG_YMM6F2    =  350,\n    CV_REG_YMM6F3    =  351,\n    CV_REG_YMM6F4    =  352,\n    CV_REG_YMM6F5    =  353,\n    CV_REG_YMM6F6    =  354,\n    CV_REG_YMM6F7    =  355,\n    CV_REG_YMM7F0    =  356,\n    CV_REG_YMM7F1    =  357,\n    CV_REG_YMM7F2    =  358,\n    CV_REG_YMM7F3    =  359,\n    CV_REG_YMM7F4    =  360,\n    CV_REG_YMM7F5    =  361,\n    CV_REG_YMM7F6    =  362,\n    CV_REG_YMM7F7    =  363,\n\n    CV_REG_YMM0D0     =    364,    // AVX floating-point double precise registers\n    CV_REG_YMM0D1     =    365,\n    CV_REG_YMM0D2     =    366,\n    CV_REG_YMM0D3     =    367,\n    CV_REG_YMM1D0     =    368,\n    CV_REG_YMM1D1     =    369,\n    CV_REG_YMM1D2     =    370,\n    CV_REG_YMM1D3     =    371,\n    CV_REG_YMM2D0     =    372,\n    CV_REG_YMM2D1     =    373,\n    CV_REG_YMM2D2     =    374,\n    CV_REG_YMM2D3     =    375,\n    CV_REG_YMM3D0     =    376,\n    CV_REG_YMM3D1     =    377,\n    CV_REG_YMM3D2     =    378,\n    CV_REG_YMM3D3     =    379,\n    CV_REG_YMM4D0     =    380,\n    CV_REG_YMM4D1     =    381,\n    CV_REG_YMM4D2     =    382,\n    CV_REG_YMM4D3     =    383,\n    CV_REG_YMM5D0     =    384,\n    CV_REG_YMM5D1     =    385,\n    CV_REG_YMM5D2     =    386,\n    CV_REG_YMM5D3     =    387,\n    CV_REG_YMM6D0     =    388,\n    CV_REG_YMM6D1     =    389,\n    CV_REG_YMM6D2     =    390,\n    CV_REG_YMM6D3     =    391,\n    CV_REG_YMM7D0     =    392,\n    CV_REG_YMM7D1     =    393,\n    CV_REG_YMM7D2     =    394,\n    CV_REG_YMM7D3     =    395,\n\n    CV_REG_BND0       =    396,\n    CV_REG_BND1       =    397,\n    CV_REG_BND2       =    398,\n    CV_REG_BND3       =    399,\n\n    // registers for the 68K processors\n\n    CV_R68_D0       =    0,\n    CV_R68_D1       =    1,\n    CV_R68_D2       =    2,\n    CV_R68_D3       =    3,\n    CV_R68_D4       =    4,\n    CV_R68_D5       =    5,\n    CV_R68_D6       =    6,\n    CV_R68_D7       =    7,\n    CV_R68_A0       =    8,\n    CV_R68_A1       =    9,\n    CV_R68_A2       =   10,\n    CV_R68_A3       =   11,\n    CV_R68_A4       =   12,\n    CV_R68_A5       =   13,\n    CV_R68_A6       =   14,\n    CV_R68_A7       =   15,\n    CV_R68_CCR      =   16,\n    CV_R68_SR       =   17,\n    CV_R68_USP      =   18,\n    CV_R68_MSP      =   19,\n    CV_R68_SFC      =   20,\n    CV_R68_DFC      =   21,\n    CV_R68_CACR     =   22,\n    CV_R68_VBR      =   23,\n    CV_R68_CAAR     =   24,\n    CV_R68_ISP      =   25,\n    CV_R68_PC       =   26,\n    //reserved  27\n    CV_R68_FPCR     =   28,\n    CV_R68_FPSR     =   29,\n    CV_R68_FPIAR    =   30,\n    //reserved  31\n    CV_R68_FP0      =   32,\n    CV_R68_FP1      =   33,\n    CV_R68_FP2      =   34,\n    CV_R68_FP3      =   35,\n    CV_R68_FP4      =   36,\n    CV_R68_FP5      =   37,\n    CV_R68_FP6      =   38,\n    CV_R68_FP7      =   39,\n    //reserved  40\n    CV_R68_MMUSR030 =   41,\n    CV_R68_MMUSR    =   42,\n    CV_R68_URP      =   43,\n    CV_R68_DTT0     =   44,\n    CV_R68_DTT1     =   45,\n    CV_R68_ITT0     =   46,\n    CV_R68_ITT1     =   47,\n    //reserved  50\n    CV_R68_PSR      =   51,\n    CV_R68_PCSR     =   52,\n    CV_R68_VAL      =   53,\n    CV_R68_CRP      =   54,\n    CV_R68_SRP      =   55,\n    CV_R68_DRP      =   56,\n    CV_R68_TC       =   57,\n    CV_R68_AC       =   58,\n    CV_R68_SCC      =   59,\n    CV_R68_CAL      =   60,\n    CV_R68_TT0      =   61,\n    CV_R68_TT1      =   62,\n    //reserved  63\n    CV_R68_BAD0     =   64,\n    CV_R68_BAD1     =   65,\n    CV_R68_BAD2     =   66,\n    CV_R68_BAD3     =   67,\n    CV_R68_BAD4     =   68,\n    CV_R68_BAD5     =   69,\n    CV_R68_BAD6     =   70,\n    CV_R68_BAD7     =   71,\n    CV_R68_BAC0     =   72,\n    CV_R68_BAC1     =   73,\n    CV_R68_BAC2     =   74,\n    CV_R68_BAC3     =   75,\n    CV_R68_BAC4     =   76,\n    CV_R68_BAC5     =   77,\n    CV_R68_BAC6     =   78,\n    CV_R68_BAC7     =   79,\n\n     // Register set for the MIPS 4000\n\n    CV_M4_NOREG     =   CV_REG_NONE,\n\n    CV_M4_IntZERO   =   10,      /* CPU REGISTER */\n    CV_M4_IntAT     =   11,\n    CV_M4_IntV0     =   12,\n    CV_M4_IntV1     =   13,\n    CV_M4_IntA0     =   14,\n    CV_M4_IntA1     =   15,\n    CV_M4_IntA2     =   16,\n    CV_M4_IntA3     =   17,\n    CV_M4_IntT0     =   18,\n    CV_M4_IntT1     =   19,\n    CV_M4_IntT2     =   20,\n    CV_M4_IntT3     =   21,\n    CV_M4_IntT4     =   22,\n    CV_M4_IntT5     =   23,\n    CV_M4_IntT6     =   24,\n    CV_M4_IntT7     =   25,\n    CV_M4_IntS0     =   26,\n    CV_M4_IntS1     =   27,\n    CV_M4_IntS2     =   28,\n    CV_M4_IntS3     =   29,\n    CV_M4_IntS4     =   30,\n    CV_M4_IntS5     =   31,\n    CV_M4_IntS6     =   32,\n    CV_M4_IntS7     =   33,\n    CV_M4_IntT8     =   34,\n    CV_M4_IntT9     =   35,\n    CV_M4_IntKT0    =   36,\n    CV_M4_IntKT1    =   37,\n    CV_M4_IntGP     =   38,\n    CV_M4_IntSP     =   39,\n    CV_M4_IntS8     =   40,\n    CV_M4_IntRA     =   41,\n    CV_M4_IntLO     =   42,\n    CV_M4_IntHI     =   43,\n\n    CV_M4_Fir       =   50,\n    CV_M4_Psr       =   51,\n\n    CV_M4_FltF0     =   60,      /* Floating point registers */\n    CV_M4_FltF1     =   61,\n    CV_M4_FltF2     =   62,\n    CV_M4_FltF3     =   63,\n    CV_M4_FltF4     =   64,\n    CV_M4_FltF5     =   65,\n    CV_M4_FltF6     =   66,\n    CV_M4_FltF7     =   67,\n    CV_M4_FltF8     =   68,\n    CV_M4_FltF9     =   69,\n    CV_M4_FltF10    =   70,\n    CV_M4_FltF11    =   71,\n    CV_M4_FltF12    =   72,\n    CV_M4_FltF13    =   73,\n    CV_M4_FltF14    =   74,\n    CV_M4_FltF15    =   75,\n    CV_M4_FltF16    =   76,\n    CV_M4_FltF17    =   77,\n    CV_M4_FltF18    =   78,\n    CV_M4_FltF19    =   79,\n    CV_M4_FltF20    =   80,\n    CV_M4_FltF21    =   81,\n    CV_M4_FltF22    =   82,\n    CV_M4_FltF23    =   83,\n    CV_M4_FltF24    =   84,\n    CV_M4_FltF25    =   85,\n    CV_M4_FltF26    =   86,\n    CV_M4_FltF27    =   87,\n    CV_M4_FltF28    =   88,\n    CV_M4_FltF29    =   89,\n    CV_M4_FltF30    =   90,\n    CV_M4_FltF31    =   91,\n    CV_M4_FltFsr    =   92,\n\n\n    // Register set for the ALPHA AXP\n\n    CV_ALPHA_NOREG  = CV_REG_NONE,\n\n    CV_ALPHA_FltF0  =   10,   // Floating point registers\n    CV_ALPHA_FltF1  =   11,\n    CV_ALPHA_FltF2  =   12,\n    CV_ALPHA_FltF3  =   13,\n    CV_ALPHA_FltF4  =   14,\n    CV_ALPHA_FltF5  =   15,\n    CV_ALPHA_FltF6  =   16,\n    CV_ALPHA_FltF7  =   17,\n    CV_ALPHA_FltF8  =   18,\n    CV_ALPHA_FltF9  =   19,\n    CV_ALPHA_FltF10 =   20,\n    CV_ALPHA_FltF11 =   21,\n    CV_ALPHA_FltF12 =   22,\n    CV_ALPHA_FltF13 =   23,\n    CV_ALPHA_FltF14 =   24,\n    CV_ALPHA_FltF15 =   25,\n    CV_ALPHA_FltF16 =   26,\n    CV_ALPHA_FltF17 =   27,\n    CV_ALPHA_FltF18 =   28,\n    CV_ALPHA_FltF19 =   29,\n    CV_ALPHA_FltF20 =   30,\n    CV_ALPHA_FltF21 =   31,\n    CV_ALPHA_FltF22 =   32,\n    CV_ALPHA_FltF23 =   33,\n    CV_ALPHA_FltF24 =   34,\n    CV_ALPHA_FltF25 =   35,\n    CV_ALPHA_FltF26 =   36,\n    CV_ALPHA_FltF27 =   37,\n    CV_ALPHA_FltF28 =   38,\n    CV_ALPHA_FltF29 =   39,\n    CV_ALPHA_FltF30 =   40,\n    CV_ALPHA_FltF31 =   41,\n\n    CV_ALPHA_IntV0  =   42,   // Integer registers\n    CV_ALPHA_IntT0  =   43,\n    CV_ALPHA_IntT1  =   44,\n    CV_ALPHA_IntT2  =   45,\n    CV_ALPHA_IntT3  =   46,\n    CV_ALPHA_IntT4  =   47,\n    CV_ALPHA_IntT5  =   48,\n    CV_ALPHA_IntT6  =   49,\n    CV_ALPHA_IntT7  =   50,\n    CV_ALPHA_IntS0  =   51,\n    CV_ALPHA_IntS1  =   52,\n    CV_ALPHA_IntS2  =   53,\n    CV_ALPHA_IntS3  =   54,\n    CV_ALPHA_IntS4  =   55,\n    CV_ALPHA_IntS5  =   56,\n    CV_ALPHA_IntFP  =   57,\n    CV_ALPHA_IntA0  =   58,\n    CV_ALPHA_IntA1  =   59,\n    CV_ALPHA_IntA2  =   60,\n    CV_ALPHA_IntA3  =   61,\n    CV_ALPHA_IntA4  =   62,\n    CV_ALPHA_IntA5  =   63,\n    CV_ALPHA_IntT8  =   64,\n    CV_ALPHA_IntT9  =   65,\n    CV_ALPHA_IntT10 =   66,\n    CV_ALPHA_IntT11 =   67,\n    CV_ALPHA_IntRA  =   68,\n    CV_ALPHA_IntT12 =   69,\n    CV_ALPHA_IntAT  =   70,\n    CV_ALPHA_IntGP  =   71,\n    CV_ALPHA_IntSP  =   72,\n    CV_ALPHA_IntZERO =  73,\n\n\n    CV_ALPHA_Fpcr   =   74,   // Control registers\n    CV_ALPHA_Fir    =   75,\n    CV_ALPHA_Psr    =   76,\n    CV_ALPHA_FltFsr =   77,\n    CV_ALPHA_SoftFpcr =   78,\n\n    // Register Set for Motorola/IBM PowerPC\n\n    /*\n    ** PowerPC General Registers ( User Level )\n    */\n    CV_PPC_GPR0     =  1,\n    CV_PPC_GPR1     =  2,\n    CV_PPC_GPR2     =  3,\n    CV_PPC_GPR3     =  4,\n    CV_PPC_GPR4     =  5,\n    CV_PPC_GPR5     =  6,\n    CV_PPC_GPR6     =  7,\n    CV_PPC_GPR7     =  8,\n    CV_PPC_GPR8     =  9,\n    CV_PPC_GPR9     = 10,\n    CV_PPC_GPR10    = 11,\n    CV_PPC_GPR11    = 12,\n    CV_PPC_GPR12    = 13,\n    CV_PPC_GPR13    = 14,\n    CV_PPC_GPR14    = 15,\n    CV_PPC_GPR15    = 16,\n    CV_PPC_GPR16    = 17,\n    CV_PPC_GPR17    = 18,\n    CV_PPC_GPR18    = 19,\n    CV_PPC_GPR19    = 20,\n    CV_PPC_GPR20    = 21,\n    CV_PPC_GPR21    = 22,\n    CV_PPC_GPR22    = 23,\n    CV_PPC_GPR23    = 24,\n    CV_PPC_GPR24    = 25,\n    CV_PPC_GPR25    = 26,\n    CV_PPC_GPR26    = 27,\n    CV_PPC_GPR27    = 28,\n    CV_PPC_GPR28    = 29,\n    CV_PPC_GPR29    = 30,\n    CV_PPC_GPR30    = 31,\n    CV_PPC_GPR31    = 32,\n\n    /*\n    ** PowerPC Condition Register ( User Level )\n    */\n    CV_PPC_CR       = 33,\n    CV_PPC_CR0      = 34,\n    CV_PPC_CR1      = 35,\n    CV_PPC_CR2      = 36,\n    CV_PPC_CR3      = 37,\n    CV_PPC_CR4      = 38,\n    CV_PPC_CR5      = 39,\n    CV_PPC_CR6      = 40,\n    CV_PPC_CR7      = 41,\n\n    /*\n    ** PowerPC Floating Point Registers ( User Level )\n    */\n    CV_PPC_FPR0     = 42,\n    CV_PPC_FPR1     = 43,\n    CV_PPC_FPR2     = 44,\n    CV_PPC_FPR3     = 45,\n    CV_PPC_FPR4     = 46,\n    CV_PPC_FPR5     = 47,\n    CV_PPC_FPR6     = 48,\n    CV_PPC_FPR7     = 49,\n    CV_PPC_FPR8     = 50,\n    CV_PPC_FPR9     = 51,\n    CV_PPC_FPR10    = 52,\n    CV_PPC_FPR11    = 53,\n    CV_PPC_FPR12    = 54,\n    CV_PPC_FPR13    = 55,\n    CV_PPC_FPR14    = 56,\n    CV_PPC_FPR15    = 57,\n    CV_PPC_FPR16    = 58,\n    CV_PPC_FPR17    = 59,\n    CV_PPC_FPR18    = 60,\n    CV_PPC_FPR19    = 61,\n    CV_PPC_FPR20    = 62,\n    CV_PPC_FPR21    = 63,\n    CV_PPC_FPR22    = 64,\n    CV_PPC_FPR23    = 65,\n    CV_PPC_FPR24    = 66,\n    CV_PPC_FPR25    = 67,\n    CV_PPC_FPR26    = 68,\n    CV_PPC_FPR27    = 69,\n    CV_PPC_FPR28    = 70,\n    CV_PPC_FPR29    = 71,\n    CV_PPC_FPR30    = 72,\n    CV_PPC_FPR31    = 73,\n\n    /*\n    ** PowerPC Floating Point Status and Control Register ( User Level )\n    */\n    CV_PPC_FPSCR    = 74,\n\n    /*\n    ** PowerPC Machine State Register ( Supervisor Level )\n    */\n    CV_PPC_MSR      = 75,\n\n    /*\n    ** PowerPC Segment Registers ( Supervisor Level )\n    */\n    CV_PPC_SR0      = 76,\n    CV_PPC_SR1      = 77,\n    CV_PPC_SR2      = 78,\n    CV_PPC_SR3      = 79,\n    CV_PPC_SR4      = 80,\n    CV_PPC_SR5      = 81,\n    CV_PPC_SR6      = 82,\n    CV_PPC_SR7      = 83,\n    CV_PPC_SR8      = 84,\n    CV_PPC_SR9      = 85,\n    CV_PPC_SR10     = 86,\n    CV_PPC_SR11     = 87,\n    CV_PPC_SR12     = 88,\n    CV_PPC_SR13     = 89,\n    CV_PPC_SR14     = 90,\n    CV_PPC_SR15     = 91,\n\n    /*\n    ** For all of the special purpose registers add 100 to the SPR# that the\n    ** Motorola/IBM documentation gives with the exception of any imaginary\n    ** registers.\n    */\n\n    /*\n    ** PowerPC Special Purpose Registers ( User Level )\n    */\n    CV_PPC_PC       = 99,     // PC (imaginary register)\n\n    CV_PPC_MQ       = 100,    // MPC601\n    CV_PPC_XER      = 101,\n    CV_PPC_RTCU     = 104,    // MPC601\n    CV_PPC_RTCL     = 105,    // MPC601\n    CV_PPC_LR       = 108,\n    CV_PPC_CTR      = 109,\n\n    CV_PPC_COMPARE  = 110,    // part of XER (internal to the debugger only)\n    CV_PPC_COUNT    = 111,    // part of XER (internal to the debugger only)\n\n    /*\n    ** PowerPC Special Purpose Registers ( Supervisor Level )\n    */\n    CV_PPC_DSISR    = 118,\n    CV_PPC_DAR      = 119,\n    CV_PPC_DEC      = 122,\n    CV_PPC_SDR1     = 125,\n    CV_PPC_SRR0     = 126,\n    CV_PPC_SRR1     = 127,\n    CV_PPC_SPRG0    = 372,\n    CV_PPC_SPRG1    = 373,\n    CV_PPC_SPRG2    = 374,\n    CV_PPC_SPRG3    = 375,\n    CV_PPC_ASR      = 280,    // 64-bit implementations only\n    CV_PPC_EAR      = 382,\n    CV_PPC_PVR      = 287,\n    CV_PPC_BAT0U    = 628,\n    CV_PPC_BAT0L    = 629,\n    CV_PPC_BAT1U    = 630,\n    CV_PPC_BAT1L    = 631,\n    CV_PPC_BAT2U    = 632,\n    CV_PPC_BAT2L    = 633,\n    CV_PPC_BAT3U    = 634,\n    CV_PPC_BAT3L    = 635,\n    CV_PPC_DBAT0U   = 636,\n    CV_PPC_DBAT0L   = 637,\n    CV_PPC_DBAT1U   = 638,\n    CV_PPC_DBAT1L   = 639,\n    CV_PPC_DBAT2U   = 640,\n    CV_PPC_DBAT2L   = 641,\n    CV_PPC_DBAT3U   = 642,\n    CV_PPC_DBAT3L   = 643,\n\n    /*\n    ** PowerPC Special Purpose Registers Implementation Dependent ( Supervisor Level )\n    */\n\n    /*\n    ** Doesn't appear that IBM/Motorola has finished defining these.\n    */\n\n    CV_PPC_PMR0     = 1044,   // MPC620,\n    CV_PPC_PMR1     = 1045,   // MPC620,\n    CV_PPC_PMR2     = 1046,   // MPC620,\n    CV_PPC_PMR3     = 1047,   // MPC620,\n    CV_PPC_PMR4     = 1048,   // MPC620,\n    CV_PPC_PMR5     = 1049,   // MPC620,\n    CV_PPC_PMR6     = 1050,   // MPC620,\n    CV_PPC_PMR7     = 1051,   // MPC620,\n    CV_PPC_PMR8     = 1052,   // MPC620,\n    CV_PPC_PMR9     = 1053,   // MPC620,\n    CV_PPC_PMR10    = 1054,   // MPC620,\n    CV_PPC_PMR11    = 1055,   // MPC620,\n    CV_PPC_PMR12    = 1056,   // MPC620,\n    CV_PPC_PMR13    = 1057,   // MPC620,\n    CV_PPC_PMR14    = 1058,   // MPC620,\n    CV_PPC_PMR15    = 1059,   // MPC620,\n\n    CV_PPC_DMISS    = 1076,   // MPC603\n    CV_PPC_DCMP     = 1077,   // MPC603\n    CV_PPC_HASH1    = 1078,   // MPC603\n    CV_PPC_HASH2    = 1079,   // MPC603\n    CV_PPC_IMISS    = 1080,   // MPC603\n    CV_PPC_ICMP     = 1081,   // MPC603\n    CV_PPC_RPA      = 1082,   // MPC603\n\n    CV_PPC_HID0     = 1108,   // MPC601, MPC603, MPC620\n    CV_PPC_HID1     = 1109,   // MPC601\n    CV_PPC_HID2     = 1110,   // MPC601, MPC603, MPC620 ( IABR )\n    CV_PPC_HID3     = 1111,   // Not Defined\n    CV_PPC_HID4     = 1112,   // Not Defined\n    CV_PPC_HID5     = 1113,   // MPC601, MPC604, MPC620 ( DABR )\n    CV_PPC_HID6     = 1114,   // Not Defined\n    CV_PPC_HID7     = 1115,   // Not Defined\n    CV_PPC_HID8     = 1116,   // MPC620 ( BUSCSR )\n    CV_PPC_HID9     = 1117,   // MPC620 ( L2CSR )\n    CV_PPC_HID10    = 1118,   // Not Defined\n    CV_PPC_HID11    = 1119,   // Not Defined\n    CV_PPC_HID12    = 1120,   // Not Defined\n    CV_PPC_HID13    = 1121,   // MPC604 ( HCR )\n    CV_PPC_HID14    = 1122,   // Not Defined\n    CV_PPC_HID15    = 1123,   // MPC601, MPC604, MPC620 ( PIR )\n\n    //\n    // JAVA VM registers\n    //\n\n    CV_JAVA_PC      = 1,\n\n    //\n    // Register set for the Hitachi SH3\n    //\n\n    CV_SH3_NOREG    =   CV_REG_NONE,\n\n    CV_SH3_IntR0    =   10,   // CPU REGISTER\n    CV_SH3_IntR1    =   11,\n    CV_SH3_IntR2    =   12,\n    CV_SH3_IntR3    =   13,\n    CV_SH3_IntR4    =   14,\n    CV_SH3_IntR5    =   15,\n    CV_SH3_IntR6    =   16,\n    CV_SH3_IntR7    =   17,\n    CV_SH3_IntR8    =   18,\n    CV_SH3_IntR9    =   19,\n    CV_SH3_IntR10   =   20,\n    CV_SH3_IntR11   =   21,\n    CV_SH3_IntR12   =   22,\n    CV_SH3_IntR13   =   23,\n    CV_SH3_IntFp    =   24,\n    CV_SH3_IntSp    =   25,\n    CV_SH3_Gbr      =   38,\n    CV_SH3_Pr       =   39,\n    CV_SH3_Mach     =   40,\n    CV_SH3_Macl     =   41,\n\n    CV_SH3_Pc       =   50,\n    CV_SH3_Sr       =   51,\n\n    CV_SH3_BarA     =   60,\n    CV_SH3_BasrA    =   61,\n    CV_SH3_BamrA    =   62,\n    CV_SH3_BbrA     =   63,\n    CV_SH3_BarB     =   64,\n    CV_SH3_BasrB    =   65,\n    CV_SH3_BamrB    =   66,\n    CV_SH3_BbrB     =   67,\n    CV_SH3_BdrB     =   68,\n    CV_SH3_BdmrB    =   69,\n    CV_SH3_Brcr     =   70,\n\n    //\n    // Additional registers for Hitachi SH processors\n    //\n\n    CV_SH_Fpscr    =   75,    // floating point status/control register\n    CV_SH_Fpul     =   76,    // floating point communication register\n\n    CV_SH_FpR0     =   80,    // Floating point registers\n    CV_SH_FpR1     =   81,\n    CV_SH_FpR2     =   82,\n    CV_SH_FpR3     =   83,\n    CV_SH_FpR4     =   84,\n    CV_SH_FpR5     =   85,\n    CV_SH_FpR6     =   86,\n    CV_SH_FpR7     =   87,\n    CV_SH_FpR8     =   88,\n    CV_SH_FpR9     =   89,\n    CV_SH_FpR10    =   90,\n    CV_SH_FpR11    =   91,\n    CV_SH_FpR12    =   92,\n    CV_SH_FpR13    =   93,\n    CV_SH_FpR14    =   94,\n    CV_SH_FpR15    =   95,\n\n    CV_SH_XFpR0    =   96,\n    CV_SH_XFpR1    =   97,\n    CV_SH_XFpR2    =   98,\n    CV_SH_XFpR3    =   99,\n    CV_SH_XFpR4    =  100,\n    CV_SH_XFpR5    =  101,\n    CV_SH_XFpR6    =  102,\n    CV_SH_XFpR7    =  103,\n    CV_SH_XFpR8    =  104,\n    CV_SH_XFpR9    =  105,\n    CV_SH_XFpR10   =  106,\n    CV_SH_XFpR11   =  107,\n    CV_SH_XFpR12   =  108,\n    CV_SH_XFpR13   =  109,\n    CV_SH_XFpR14   =  110,\n    CV_SH_XFpR15   =  111,\n\n    //\n    // Register set for the ARM processor.\n    //\n\n    CV_ARM_NOREG    =   CV_REG_NONE,\n\n    CV_ARM_R0       =   10,\n    CV_ARM_R1       =   11,\n    CV_ARM_R2       =   12,\n    CV_ARM_R3       =   13,\n    CV_ARM_R4       =   14,\n    CV_ARM_R5       =   15,\n    CV_ARM_R6       =   16,\n    CV_ARM_R7       =   17,\n    CV_ARM_R8       =   18,\n    CV_ARM_R9       =   19,\n    CV_ARM_R10      =   20,\n    CV_ARM_R11      =   21, // Frame pointer, if allocated\n    CV_ARM_R12      =   22,\n    CV_ARM_SP       =   23, // Stack pointer\n    CV_ARM_LR       =   24, // Link Register\n    CV_ARM_PC       =   25, // Program counter\n    CV_ARM_CPSR     =   26, // Current program status register\n\n    CV_ARM_ACC0     =   27, // DSP co-processor 0 40 bit accumulator\n\n    //\n    // Registers for ARM VFP10 support\n    //\n\n    CV_ARM_FPSCR    =   40,\n    CV_ARM_FPEXC    =   41,\n\n    CV_ARM_FS0      =   50,\n    CV_ARM_FS1      =   51,\n    CV_ARM_FS2      =   52,\n    CV_ARM_FS3      =   53,\n    CV_ARM_FS4      =   54,\n    CV_ARM_FS5      =   55,\n    CV_ARM_FS6      =   56,\n    CV_ARM_FS7      =   57,\n    CV_ARM_FS8      =   58,\n    CV_ARM_FS9      =   59,\n    CV_ARM_FS10     =   60,\n    CV_ARM_FS11     =   61,\n    CV_ARM_FS12     =   62,\n    CV_ARM_FS13     =   63,\n    CV_ARM_FS14     =   64,\n    CV_ARM_FS15     =   65,\n    CV_ARM_FS16     =   66,\n    CV_ARM_FS17     =   67,\n    CV_ARM_FS18     =   68,\n    CV_ARM_FS19     =   69,\n    CV_ARM_FS20     =   70,\n    CV_ARM_FS21     =   71,\n    CV_ARM_FS22     =   72,\n    CV_ARM_FS23     =   73,\n    CV_ARM_FS24     =   74,\n    CV_ARM_FS25     =   75,\n    CV_ARM_FS26     =   76,\n    CV_ARM_FS27     =   77,\n    CV_ARM_FS28     =   78,\n    CV_ARM_FS29     =   79,\n    CV_ARM_FS30     =   80,\n    CV_ARM_FS31     =   81,\n\n    //\n    // ARM VFP Floating Point Extra control registers\n    //\n\n    CV_ARM_FPEXTRA0 =   90,\n    CV_ARM_FPEXTRA1 =   91,\n    CV_ARM_FPEXTRA2 =   92,\n    CV_ARM_FPEXTRA3 =   93,\n    CV_ARM_FPEXTRA4 =   94,\n    CV_ARM_FPEXTRA5 =   95,\n    CV_ARM_FPEXTRA6 =   96,\n    CV_ARM_FPEXTRA7 =   97,\n\n    // XSCALE Concan co-processor registers\n    CV_ARM_WR0      =   128,\n    CV_ARM_WR1      =   129,\n    CV_ARM_WR2      =   130,\n    CV_ARM_WR3      =   131,\n    CV_ARM_WR4      =   132,\n    CV_ARM_WR5      =   133,\n    CV_ARM_WR6      =   134,\n    CV_ARM_WR7      =   135,\n    CV_ARM_WR8      =   136,\n    CV_ARM_WR9      =   137,\n    CV_ARM_WR10     =   138,\n    CV_ARM_WR11     =   139,\n    CV_ARM_WR12     =   140,\n    CV_ARM_WR13     =   141,\n    CV_ARM_WR14     =   142,\n    CV_ARM_WR15     =   143,\n\n    // XSCALE Concan co-processor control registers\n    CV_ARM_WCID     =   144,\n    CV_ARM_WCON     =   145,\n    CV_ARM_WCSSF    =   146,\n    CV_ARM_WCASF    =   147,\n    CV_ARM_WC4      =   148,\n    CV_ARM_WC5      =   149,\n    CV_ARM_WC6      =   150,\n    CV_ARM_WC7      =   151,\n    CV_ARM_WCGR0    =   152,\n    CV_ARM_WCGR1    =   153,\n    CV_ARM_WCGR2    =   154,\n    CV_ARM_WCGR3    =   155,\n    CV_ARM_WC12     =   156,\n    CV_ARM_WC13     =   157,\n    CV_ARM_WC14     =   158,\n    CV_ARM_WC15     =   159,\n\n    //\n    // ARM VFPv3/Neon extended floating Point\n    //\n\n    CV_ARM_FS32     =   200,\n    CV_ARM_FS33     =   201,\n    CV_ARM_FS34     =   202,\n    CV_ARM_FS35     =   203,\n    CV_ARM_FS36     =   204,\n    CV_ARM_FS37     =   205,\n    CV_ARM_FS38     =   206,\n    CV_ARM_FS39     =   207,\n    CV_ARM_FS40     =   208,\n    CV_ARM_FS41     =   209,\n    CV_ARM_FS42     =   210,\n    CV_ARM_FS43     =   211,\n    CV_ARM_FS44     =   212,\n    CV_ARM_FS45     =   213,\n    CV_ARM_FS46     =   214,\n    CV_ARM_FS47     =   215,\n    CV_ARM_FS48     =   216,\n    CV_ARM_FS49     =   217,\n    CV_ARM_FS50     =   218,\n    CV_ARM_FS51     =   219,\n    CV_ARM_FS52     =   220,\n    CV_ARM_FS53     =   221,\n    CV_ARM_FS54     =   222,\n    CV_ARM_FS55     =   223,\n    CV_ARM_FS56     =   224,\n    CV_ARM_FS57     =   225,\n    CV_ARM_FS58     =   226,\n    CV_ARM_FS59     =   227,\n    CV_ARM_FS60     =   228,\n    CV_ARM_FS61     =   229,\n    CV_ARM_FS62     =   230,\n    CV_ARM_FS63     =   231,\n\n    // ARM double-precision floating point\n\n    CV_ARM_ND0 = 300,\n    CV_ARM_ND1 = 301,\n    CV_ARM_ND2 = 302,\n    CV_ARM_ND3 = 303,\n    CV_ARM_ND4 = 304,\n    CV_ARM_ND5 = 305,\n    CV_ARM_ND6 = 306,\n    CV_ARM_ND7 = 307,\n    CV_ARM_ND8 = 308,\n    CV_ARM_ND9 = 309,\n    CV_ARM_ND10 = 310,\n    CV_ARM_ND11 = 311,\n    CV_ARM_ND12 = 312,\n    CV_ARM_ND13 = 313,\n    CV_ARM_ND14 = 314,\n    CV_ARM_ND15 = 315,\n    CV_ARM_ND16 = 316,\n    CV_ARM_ND17 = 317,\n    CV_ARM_ND18 = 318,\n    CV_ARM_ND19 = 319,\n    CV_ARM_ND20 = 320,\n    CV_ARM_ND21 = 321,\n    CV_ARM_ND22 = 322,\n    CV_ARM_ND23 = 323,\n    CV_ARM_ND24 = 324,\n    CV_ARM_ND25 = 325,\n    CV_ARM_ND26 = 326,\n    CV_ARM_ND27 = 327,\n    CV_ARM_ND28 = 328,\n    CV_ARM_ND29 = 329,\n    CV_ARM_ND30 = 330,\n    CV_ARM_ND31 = 331,\n\n    // ARM extended precision floating point\n\n    CV_ARM_NQ0 = 400,\n    CV_ARM_NQ1 = 401,\n    CV_ARM_NQ2 = 402,\n    CV_ARM_NQ3 = 403,\n    CV_ARM_NQ4 = 404,\n    CV_ARM_NQ5 = 405,\n    CV_ARM_NQ6 = 406,\n    CV_ARM_NQ7 = 407,\n    CV_ARM_NQ8 = 408,\n    CV_ARM_NQ9 = 409,\n    CV_ARM_NQ10 = 410,\n    CV_ARM_NQ11 = 411,\n    CV_ARM_NQ12 = 412,\n    CV_ARM_NQ13 = 413,\n    CV_ARM_NQ14 = 414,\n    CV_ARM_NQ15 = 415,\n\n    //\n    // Register set for ARM64\n    //\n\n    CV_ARM64_NOREG  =  CV_REG_NONE,\n\n    // General purpose 32-bit integer registers\n\n    CV_ARM64_W0     =  10,\n    CV_ARM64_W1     =  11,\n    CV_ARM64_W2     =  12,\n    CV_ARM64_W3     =  13,\n    CV_ARM64_W4     =  14,\n    CV_ARM64_W5     =  15,\n    CV_ARM64_W6     =  16,\n    CV_ARM64_W7     =  17,\n    CV_ARM64_W8     =  18,\n    CV_ARM64_W9     =  19,\n    CV_ARM64_W10    =  20,\n    CV_ARM64_W11    =  21,\n    CV_ARM64_W12    =  22,\n    CV_ARM64_W13    =  23,\n    CV_ARM64_W14    =  24,\n    CV_ARM64_W15    =  25,\n    CV_ARM64_W16    =  26,\n    CV_ARM64_W17    =  27,\n    CV_ARM64_W18    =  28,\n    CV_ARM64_W19    =  29,\n    CV_ARM64_W20    =  30,\n    CV_ARM64_W21    =  31,\n    CV_ARM64_W22    =  32,\n    CV_ARM64_W23    =  33,\n    CV_ARM64_W24    =  34,\n    CV_ARM64_W25    =  35,\n    CV_ARM64_W26    =  36,\n    CV_ARM64_W27    =  37,\n    CV_ARM64_W28    =  38,\n    CV_ARM64_W29    =  39,\n    CV_ARM64_W30    =  40,\n    CV_ARM64_WZR    =  41,\n\n    // General purpose 64-bit integer registers\n\n    CV_ARM64_X0     =  50,\n    CV_ARM64_X1     =  51,\n    CV_ARM64_X2     =  52,\n    CV_ARM64_X3     =  53,\n    CV_ARM64_X4     =  54,\n    CV_ARM64_X5     =  55,\n    CV_ARM64_X6     =  56,\n    CV_ARM64_X7     =  57,\n    CV_ARM64_X8     =  58,\n    CV_ARM64_X9     =  59,\n    CV_ARM64_X10    =  60,\n    CV_ARM64_X11    =  61,\n    CV_ARM64_X12    =  62,\n    CV_ARM64_X13    =  63,\n    CV_ARM64_X14    =  64,\n    CV_ARM64_X15    =  65,\n    CV_ARM64_IP0    =  66,\n    CV_ARM64_IP1    =  67,\n    CV_ARM64_X18    =  68,\n    CV_ARM64_X19    =  69,\n    CV_ARM64_X20    =  70,\n    CV_ARM64_X21    =  71,\n    CV_ARM64_X22    =  72,\n    CV_ARM64_X23    =  73,\n    CV_ARM64_X24    =  74,\n    CV_ARM64_X25    =  75,\n    CV_ARM64_X26    =  76,\n    CV_ARM64_X27    =  77,\n    CV_ARM64_X28    =  78,\n    CV_ARM64_FP     =  79,\n    CV_ARM64_LR     =  80,\n    CV_ARM64_SP     =  81,\n    CV_ARM64_ZR     =  82,\n    CV_ARM64_PC     =  83,\n\n    // status registers\n\n    CV_ARM64_NZCV   =  90,\n    CV_ARM64_CPSR   =  91,\n\n    // 32-bit floating point registers\n\n    CV_ARM64_S0     =  100,\n    CV_ARM64_S1     =  101,\n    CV_ARM64_S2     =  102,\n    CV_ARM64_S3     =  103,\n    CV_ARM64_S4     =  104,\n    CV_ARM64_S5     =  105,\n    CV_ARM64_S6     =  106,\n    CV_ARM64_S7     =  107,\n    CV_ARM64_S8     =  108,\n    CV_ARM64_S9     =  109,\n    CV_ARM64_S10    =  110,\n    CV_ARM64_S11    =  111,\n    CV_ARM64_S12    =  112,\n    CV_ARM64_S13    =  113,\n    CV_ARM64_S14    =  114,\n    CV_ARM64_S15    =  115,\n    CV_ARM64_S16    =  116,\n    CV_ARM64_S17    =  117,\n    CV_ARM64_S18    =  118,\n    CV_ARM64_S19    =  119,\n    CV_ARM64_S20    =  120,\n    CV_ARM64_S21    =  121,\n    CV_ARM64_S22    =  122,\n    CV_ARM64_S23    =  123,\n    CV_ARM64_S24    =  124,\n    CV_ARM64_S25    =  125,\n    CV_ARM64_S26    =  126,\n    CV_ARM64_S27    =  127,\n    CV_ARM64_S28    =  128,\n    CV_ARM64_S29    =  129,\n    CV_ARM64_S30    =  130,\n    CV_ARM64_S31    =  131,\n\n    // 64-bit floating point registers\n\n    CV_ARM64_D0     =  140,\n    CV_ARM64_D1     =  141,\n    CV_ARM64_D2     =  142,\n    CV_ARM64_D3     =  143,\n    CV_ARM64_D4     =  144,\n    CV_ARM64_D5     =  145,\n    CV_ARM64_D6     =  146,\n    CV_ARM64_D7     =  147,\n    CV_ARM64_D8     =  148,\n    CV_ARM64_D9     =  149,\n    CV_ARM64_D10    =  150,\n    CV_ARM64_D11    =  151,\n    CV_ARM64_D12    =  152,\n    CV_ARM64_D13    =  153,\n    CV_ARM64_D14    =  154,\n    CV_ARM64_D15    =  155,\n    CV_ARM64_D16    =  156,\n    CV_ARM64_D17    =  157,\n    CV_ARM64_D18    =  158,\n    CV_ARM64_D19    =  159,\n    CV_ARM64_D20    =  160,\n    CV_ARM64_D21    =  161,\n    CV_ARM64_D22    =  162,\n    CV_ARM64_D23    =  163,\n    CV_ARM64_D24    =  164,\n    CV_ARM64_D25    =  165,\n    CV_ARM64_D26    =  166,\n    CV_ARM64_D27    =  167,\n    CV_ARM64_D28    =  168,\n    CV_ARM64_D29    =  169,\n    CV_ARM64_D30    =  170,\n    CV_ARM64_D31    =  171,\n\n    // 128-bit SIMD registers\n\n    CV_ARM64_Q0     =  180,\n    CV_ARM64_Q1     =  181,\n    CV_ARM64_Q2     =  182,\n    CV_ARM64_Q3     =  183,\n    CV_ARM64_Q4     =  184,\n    CV_ARM64_Q5     =  185,\n    CV_ARM64_Q6     =  186,\n    CV_ARM64_Q7     =  187,\n    CV_ARM64_Q8     =  188,\n    CV_ARM64_Q9     =  189,\n    CV_ARM64_Q10    =  190,\n    CV_ARM64_Q11    =  191,\n    CV_ARM64_Q12    =  192,\n    CV_ARM64_Q13    =  193,\n    CV_ARM64_Q14    =  194,\n    CV_ARM64_Q15    =  195,\n    CV_ARM64_Q16    =  196,\n    CV_ARM64_Q17    =  197,\n    CV_ARM64_Q18    =  198,\n    CV_ARM64_Q19    =  199,\n    CV_ARM64_Q20    =  200,\n    CV_ARM64_Q21    =  201,\n    CV_ARM64_Q22    =  202,\n    CV_ARM64_Q23    =  203,\n    CV_ARM64_Q24    =  204,\n    CV_ARM64_Q25    =  205,\n    CV_ARM64_Q26    =  206,\n    CV_ARM64_Q27    =  207,\n    CV_ARM64_Q28    =  208,\n    CV_ARM64_Q29    =  209,\n    CV_ARM64_Q30    =  210,\n    CV_ARM64_Q31    =  211,\n\n    // Floating point status register\n\n    CV_ARM64_FPSR   =  220,\n\n    //\n    // Register set for Intel IA64\n    //\n\n    CV_IA64_NOREG   =   CV_REG_NONE,\n\n    // Branch Registers\n\n    CV_IA64_Br0     =   512,\n    CV_IA64_Br1     =   513,\n    CV_IA64_Br2     =   514,\n    CV_IA64_Br3     =   515,\n    CV_IA64_Br4     =   516,\n    CV_IA64_Br5     =   517,\n    CV_IA64_Br6     =   518,\n    CV_IA64_Br7     =   519,\n\n    // Predicate Registers\n\n    CV_IA64_P0    =   704,\n    CV_IA64_P1    =   705,\n    CV_IA64_P2    =   706,\n    CV_IA64_P3    =   707,\n    CV_IA64_P4    =   708,\n    CV_IA64_P5    =   709,\n    CV_IA64_P6    =   710,\n    CV_IA64_P7    =   711,\n    CV_IA64_P8    =   712,\n    CV_IA64_P9    =   713,\n    CV_IA64_P10   =   714,\n    CV_IA64_P11   =   715,\n    CV_IA64_P12   =   716,\n    CV_IA64_P13   =   717,\n    CV_IA64_P14   =   718,\n    CV_IA64_P15   =   719,\n    CV_IA64_P16   =   720,\n    CV_IA64_P17   =   721,\n    CV_IA64_P18   =   722,\n    CV_IA64_P19   =   723,\n    CV_IA64_P20   =   724,\n    CV_IA64_P21   =   725,\n    CV_IA64_P22   =   726,\n    CV_IA64_P23   =   727,\n    CV_IA64_P24   =   728,\n    CV_IA64_P25   =   729,\n    CV_IA64_P26   =   730,\n    CV_IA64_P27   =   731,\n    CV_IA64_P28   =   732,\n    CV_IA64_P29   =   733,\n    CV_IA64_P30   =   734,\n    CV_IA64_P31   =   735,\n    CV_IA64_P32   =   736,\n    CV_IA64_P33   =   737,\n    CV_IA64_P34   =   738,\n    CV_IA64_P35   =   739,\n    CV_IA64_P36   =   740,\n    CV_IA64_P37   =   741,\n    CV_IA64_P38   =   742,\n    CV_IA64_P39   =   743,\n    CV_IA64_P40   =   744,\n    CV_IA64_P41   =   745,\n    CV_IA64_P42   =   746,\n    CV_IA64_P43   =   747,\n    CV_IA64_P44   =   748,\n    CV_IA64_P45   =   749,\n    CV_IA64_P46   =   750,\n    CV_IA64_P47   =   751,\n    CV_IA64_P48   =   752,\n    CV_IA64_P49   =   753,\n    CV_IA64_P50   =   754,\n    CV_IA64_P51   =   755,\n    CV_IA64_P52   =   756,\n    CV_IA64_P53   =   757,\n    CV_IA64_P54   =   758,\n    CV_IA64_P55   =   759,\n    CV_IA64_P56   =   760,\n    CV_IA64_P57   =   761,\n    CV_IA64_P58   =   762,\n    CV_IA64_P59   =   763,\n    CV_IA64_P60   =   764,\n    CV_IA64_P61   =   765,\n    CV_IA64_P62   =   766,\n    CV_IA64_P63   =   767,\n\n    CV_IA64_Preds   =   768,\n\n    // Banked General Registers\n\n    CV_IA64_IntH0   =   832,\n    CV_IA64_IntH1   =   833,\n    CV_IA64_IntH2   =   834,\n    CV_IA64_IntH3   =   835,\n    CV_IA64_IntH4   =   836,\n    CV_IA64_IntH5   =   837,\n    CV_IA64_IntH6   =   838,\n    CV_IA64_IntH7   =   839,\n    CV_IA64_IntH8   =   840,\n    CV_IA64_IntH9   =   841,\n    CV_IA64_IntH10  =   842,\n    CV_IA64_IntH11  =   843,\n    CV_IA64_IntH12  =   844,\n    CV_IA64_IntH13  =   845,\n    CV_IA64_IntH14  =   846,\n    CV_IA64_IntH15  =   847,\n\n    // Special Registers\n\n    CV_IA64_Ip      =   1016,\n    CV_IA64_Umask   =   1017,\n    CV_IA64_Cfm     =   1018,\n    CV_IA64_Psr     =   1019,\n\n    // Banked General Registers\n\n    CV_IA64_Nats    =   1020,\n    CV_IA64_Nats2   =   1021,\n    CV_IA64_Nats3   =   1022,\n\n    // General-Purpose Registers\n\n    // Integer registers\n    CV_IA64_IntR0   =   1024,\n    CV_IA64_IntR1   =   1025,\n    CV_IA64_IntR2   =   1026,\n    CV_IA64_IntR3   =   1027,\n    CV_IA64_IntR4   =   1028,\n    CV_IA64_IntR5   =   1029,\n    CV_IA64_IntR6   =   1030,\n    CV_IA64_IntR7   =   1031,\n    CV_IA64_IntR8   =   1032,\n    CV_IA64_IntR9   =   1033,\n    CV_IA64_IntR10  =   1034,\n    CV_IA64_IntR11  =   1035,\n    CV_IA64_IntR12  =   1036,\n    CV_IA64_IntR13  =   1037,\n    CV_IA64_IntR14  =   1038,\n    CV_IA64_IntR15  =   1039,\n    CV_IA64_IntR16  =   1040,\n    CV_IA64_IntR17  =   1041,\n    CV_IA64_IntR18  =   1042,\n    CV_IA64_IntR19  =   1043,\n    CV_IA64_IntR20  =   1044,\n    CV_IA64_IntR21  =   1045,\n    CV_IA64_IntR22  =   1046,\n    CV_IA64_IntR23  =   1047,\n    CV_IA64_IntR24  =   1048,\n    CV_IA64_IntR25  =   1049,\n    CV_IA64_IntR26  =   1050,\n    CV_IA64_IntR27  =   1051,\n    CV_IA64_IntR28  =   1052,\n    CV_IA64_IntR29  =   1053,\n    CV_IA64_IntR30  =   1054,\n    CV_IA64_IntR31  =   1055,\n\n    // Register Stack\n    CV_IA64_IntR32  =   1056,\n    CV_IA64_IntR33  =   1057,\n    CV_IA64_IntR34  =   1058,\n    CV_IA64_IntR35  =   1059,\n    CV_IA64_IntR36  =   1060,\n    CV_IA64_IntR37  =   1061,\n    CV_IA64_IntR38  =   1062,\n    CV_IA64_IntR39  =   1063,\n    CV_IA64_IntR40  =   1064,\n    CV_IA64_IntR41  =   1065,\n    CV_IA64_IntR42  =   1066,\n    CV_IA64_IntR43  =   1067,\n    CV_IA64_IntR44  =   1068,\n    CV_IA64_IntR45  =   1069,\n    CV_IA64_IntR46  =   1070,\n    CV_IA64_IntR47  =   1071,\n    CV_IA64_IntR48  =   1072,\n    CV_IA64_IntR49  =   1073,\n    CV_IA64_IntR50  =   1074,\n    CV_IA64_IntR51  =   1075,\n    CV_IA64_IntR52  =   1076,\n    CV_IA64_IntR53  =   1077,\n    CV_IA64_IntR54  =   1078,\n    CV_IA64_IntR55  =   1079,\n    CV_IA64_IntR56  =   1080,\n    CV_IA64_IntR57  =   1081,\n    CV_IA64_IntR58  =   1082,\n    CV_IA64_IntR59  =   1083,\n    CV_IA64_IntR60  =   1084,\n    CV_IA64_IntR61  =   1085,\n    CV_IA64_IntR62  =   1086,\n    CV_IA64_IntR63  =   1087,\n    CV_IA64_IntR64  =   1088,\n    CV_IA64_IntR65  =   1089,\n    CV_IA64_IntR66  =   1090,\n    CV_IA64_IntR67  =   1091,\n    CV_IA64_IntR68  =   1092,\n    CV_IA64_IntR69  =   1093,\n    CV_IA64_IntR70  =   1094,\n    CV_IA64_IntR71  =   1095,\n    CV_IA64_IntR72  =   1096,\n    CV_IA64_IntR73  =   1097,\n    CV_IA64_IntR74  =   1098,\n    CV_IA64_IntR75  =   1099,\n    CV_IA64_IntR76  =   1100,\n    CV_IA64_IntR77  =   1101,\n    CV_IA64_IntR78  =   1102,\n    CV_IA64_IntR79  =   1103,\n    CV_IA64_IntR80  =   1104,\n    CV_IA64_IntR81  =   1105,\n    CV_IA64_IntR82  =   1106,\n    CV_IA64_IntR83  =   1107,\n    CV_IA64_IntR84  =   1108,\n    CV_IA64_IntR85  =   1109,\n    CV_IA64_IntR86  =   1110,\n    CV_IA64_IntR87  =   1111,\n    CV_IA64_IntR88  =   1112,\n    CV_IA64_IntR89  =   1113,\n    CV_IA64_IntR90  =   1114,\n    CV_IA64_IntR91  =   1115,\n    CV_IA64_IntR92  =   1116,\n    CV_IA64_IntR93  =   1117,\n    CV_IA64_IntR94  =   1118,\n    CV_IA64_IntR95  =   1119,\n    CV_IA64_IntR96  =   1120,\n    CV_IA64_IntR97  =   1121,\n    CV_IA64_IntR98  =   1122,\n    CV_IA64_IntR99  =   1123,\n    CV_IA64_IntR100 =   1124,\n    CV_IA64_IntR101 =   1125,\n    CV_IA64_IntR102 =   1126,\n    CV_IA64_IntR103 =   1127,\n    CV_IA64_IntR104 =   1128,\n    CV_IA64_IntR105 =   1129,\n    CV_IA64_IntR106 =   1130,\n    CV_IA64_IntR107 =   1131,\n    CV_IA64_IntR108 =   1132,\n    CV_IA64_IntR109 =   1133,\n    CV_IA64_IntR110 =   1134,\n    CV_IA64_IntR111 =   1135,\n    CV_IA64_IntR112 =   1136,\n    CV_IA64_IntR113 =   1137,\n    CV_IA64_IntR114 =   1138,\n    CV_IA64_IntR115 =   1139,\n    CV_IA64_IntR116 =   1140,\n    CV_IA64_IntR117 =   1141,\n    CV_IA64_IntR118 =   1142,\n    CV_IA64_IntR119 =   1143,\n    CV_IA64_IntR120 =   1144,\n    CV_IA64_IntR121 =   1145,\n    CV_IA64_IntR122 =   1146,\n    CV_IA64_IntR123 =   1147,\n    CV_IA64_IntR124 =   1148,\n    CV_IA64_IntR125 =   1149,\n    CV_IA64_IntR126 =   1150,\n    CV_IA64_IntR127 =   1151,\n\n    // Floating-Point Registers\n\n    // Low Floating Point Registers\n    CV_IA64_FltF0   =   2048,\n    CV_IA64_FltF1   =   2049,\n    CV_IA64_FltF2   =   2050,\n    CV_IA64_FltF3   =   2051,\n    CV_IA64_FltF4   =   2052,\n    CV_IA64_FltF5   =   2053,\n    CV_IA64_FltF6   =   2054,\n    CV_IA64_FltF7   =   2055,\n    CV_IA64_FltF8   =   2056,\n    CV_IA64_FltF9   =   2057,\n    CV_IA64_FltF10  =   2058,\n    CV_IA64_FltF11  =   2059,\n    CV_IA64_FltF12  =   2060,\n    CV_IA64_FltF13  =   2061,\n    CV_IA64_FltF14  =   2062,\n    CV_IA64_FltF15  =   2063,\n    CV_IA64_FltF16  =   2064,\n    CV_IA64_FltF17  =   2065,\n    CV_IA64_FltF18  =   2066,\n    CV_IA64_FltF19  =   2067,\n    CV_IA64_FltF20  =   2068,\n    CV_IA64_FltF21  =   2069,\n    CV_IA64_FltF22  =   2070,\n    CV_IA64_FltF23  =   2071,\n    CV_IA64_FltF24  =   2072,\n    CV_IA64_FltF25  =   2073,\n    CV_IA64_FltF26  =   2074,\n    CV_IA64_FltF27  =   2075,\n    CV_IA64_FltF28  =   2076,\n    CV_IA64_FltF29  =   2077,\n    CV_IA64_FltF30  =   2078,\n    CV_IA64_FltF31  =   2079,\n\n    // High Floating Point Registers\n    CV_IA64_FltF32  =   2080,\n    CV_IA64_FltF33  =   2081,\n    CV_IA64_FltF34  =   2082,\n    CV_IA64_FltF35  =   2083,\n    CV_IA64_FltF36  =   2084,\n    CV_IA64_FltF37  =   2085,\n    CV_IA64_FltF38  =   2086,\n    CV_IA64_FltF39  =   2087,\n    CV_IA64_FltF40  =   2088,\n    CV_IA64_FltF41  =   2089,\n    CV_IA64_FltF42  =   2090,\n    CV_IA64_FltF43  =   2091,\n    CV_IA64_FltF44  =   2092,\n    CV_IA64_FltF45  =   2093,\n    CV_IA64_FltF46  =   2094,\n    CV_IA64_FltF47  =   2095,\n    CV_IA64_FltF48  =   2096,\n    CV_IA64_FltF49  =   2097,\n    CV_IA64_FltF50  =   2098,\n    CV_IA64_FltF51  =   2099,\n    CV_IA64_FltF52  =   2100,\n    CV_IA64_FltF53  =   2101,\n    CV_IA64_FltF54  =   2102,\n    CV_IA64_FltF55  =   2103,\n    CV_IA64_FltF56  =   2104,\n    CV_IA64_FltF57  =   2105,\n    CV_IA64_FltF58  =   2106,\n    CV_IA64_FltF59  =   2107,\n    CV_IA64_FltF60  =   2108,\n    CV_IA64_FltF61  =   2109,\n    CV_IA64_FltF62  =   2110,\n    CV_IA64_FltF63  =   2111,\n    CV_IA64_FltF64  =   2112,\n    CV_IA64_FltF65  =   2113,\n    CV_IA64_FltF66  =   2114,\n    CV_IA64_FltF67  =   2115,\n    CV_IA64_FltF68  =   2116,\n    CV_IA64_FltF69  =   2117,\n    CV_IA64_FltF70  =   2118,\n    CV_IA64_FltF71  =   2119,\n    CV_IA64_FltF72  =   2120,\n    CV_IA64_FltF73  =   2121,\n    CV_IA64_FltF74  =   2122,\n    CV_IA64_FltF75  =   2123,\n    CV_IA64_FltF76  =   2124,\n    CV_IA64_FltF77  =   2125,\n    CV_IA64_FltF78  =   2126,\n    CV_IA64_FltF79  =   2127,\n    CV_IA64_FltF80  =   2128,\n    CV_IA64_FltF81  =   2129,\n    CV_IA64_FltF82  =   2130,\n    CV_IA64_FltF83  =   2131,\n    CV_IA64_FltF84  =   2132,\n    CV_IA64_FltF85  =   2133,\n    CV_IA64_FltF86  =   2134,\n    CV_IA64_FltF87  =   2135,\n    CV_IA64_FltF88  =   2136,\n    CV_IA64_FltF89  =   2137,\n    CV_IA64_FltF90  =   2138,\n    CV_IA64_FltF91  =   2139,\n    CV_IA64_FltF92  =   2140,\n    CV_IA64_FltF93  =   2141,\n    CV_IA64_FltF94  =   2142,\n    CV_IA64_FltF95  =   2143,\n    CV_IA64_FltF96  =   2144,\n    CV_IA64_FltF97  =   2145,\n    CV_IA64_FltF98  =   2146,\n    CV_IA64_FltF99  =   2147,\n    CV_IA64_FltF100 =   2148,\n    CV_IA64_FltF101 =   2149,\n    CV_IA64_FltF102 =   2150,\n    CV_IA64_FltF103 =   2151,\n    CV_IA64_FltF104 =   2152,\n    CV_IA64_FltF105 =   2153,\n    CV_IA64_FltF106 =   2154,\n    CV_IA64_FltF107 =   2155,\n    CV_IA64_FltF108 =   2156,\n    CV_IA64_FltF109 =   2157,\n    CV_IA64_FltF110 =   2158,\n    CV_IA64_FltF111 =   2159,\n    CV_IA64_FltF112 =   2160,\n    CV_IA64_FltF113 =   2161,\n    CV_IA64_FltF114 =   2162,\n    CV_IA64_FltF115 =   2163,\n    CV_IA64_FltF116 =   2164,\n    CV_IA64_FltF117 =   2165,\n    CV_IA64_FltF118 =   2166,\n    CV_IA64_FltF119 =   2167,\n    CV_IA64_FltF120 =   2168,\n    CV_IA64_FltF121 =   2169,\n    CV_IA64_FltF122 =   2170,\n    CV_IA64_FltF123 =   2171,\n    CV_IA64_FltF124 =   2172,\n    CV_IA64_FltF125 =   2173,\n    CV_IA64_FltF126 =   2174,\n    CV_IA64_FltF127 =   2175,\n\n    // Application Registers\n\n    CV_IA64_ApKR0   =   3072,\n    CV_IA64_ApKR1   =   3073,\n    CV_IA64_ApKR2   =   3074,\n    CV_IA64_ApKR3   =   3075,\n    CV_IA64_ApKR4   =   3076,\n    CV_IA64_ApKR5   =   3077,\n    CV_IA64_ApKR6   =   3078,\n    CV_IA64_ApKR7   =   3079,\n    CV_IA64_AR8     =   3080,\n    CV_IA64_AR9     =   3081,\n    CV_IA64_AR10    =   3082,\n    CV_IA64_AR11    =   3083,\n    CV_IA64_AR12    =   3084,\n    CV_IA64_AR13    =   3085,\n    CV_IA64_AR14    =   3086,\n    CV_IA64_AR15    =   3087,\n    CV_IA64_RsRSC   =   3088,\n    CV_IA64_RsBSP   =   3089,\n    CV_IA64_RsBSPSTORE  =   3090,\n    CV_IA64_RsRNAT  =   3091,\n    CV_IA64_AR20    =   3092,\n    CV_IA64_StFCR   =   3093,\n    CV_IA64_AR22    =   3094,\n    CV_IA64_AR23    =   3095,\n    CV_IA64_EFLAG   =   3096,\n    CV_IA64_CSD     =   3097,\n    CV_IA64_SSD     =   3098,\n    CV_IA64_CFLG    =   3099,\n    CV_IA64_StFSR   =   3100,\n    CV_IA64_StFIR   =   3101,\n    CV_IA64_StFDR   =   3102,\n    CV_IA64_AR31    =   3103,\n    CV_IA64_ApCCV   =   3104,\n    CV_IA64_AR33    =   3105,\n    CV_IA64_AR34    =   3106,\n    CV_IA64_AR35    =   3107,\n    CV_IA64_ApUNAT  =   3108,\n    CV_IA64_AR37    =   3109,\n    CV_IA64_AR38    =   3110,\n    CV_IA64_AR39    =   3111,\n    CV_IA64_StFPSR  =   3112,\n    CV_IA64_AR41    =   3113,\n    CV_IA64_AR42    =   3114,\n    CV_IA64_AR43    =   3115,\n    CV_IA64_ApITC   =   3116,\n    CV_IA64_AR45    =   3117,\n    CV_IA64_AR46    =   3118,\n    CV_IA64_AR47    =   3119,\n    CV_IA64_AR48    =   3120,\n    CV_IA64_AR49    =   3121,\n    CV_IA64_AR50    =   3122,\n    CV_IA64_AR51    =   3123,\n    CV_IA64_AR52    =   3124,\n    CV_IA64_AR53    =   3125,\n    CV_IA64_AR54    =   3126,\n    CV_IA64_AR55    =   3127,\n    CV_IA64_AR56    =   3128,\n    CV_IA64_AR57    =   3129,\n    CV_IA64_AR58    =   3130,\n    CV_IA64_AR59    =   3131,\n    CV_IA64_AR60    =   3132,\n    CV_IA64_AR61    =   3133,\n    CV_IA64_AR62    =   3134,\n    CV_IA64_AR63    =   3135,\n    CV_IA64_RsPFS   =   3136,\n    CV_IA64_ApLC    =   3137,\n    CV_IA64_ApEC    =   3138,\n    CV_IA64_AR67    =   3139,\n    CV_IA64_AR68    =   3140,\n    CV_IA64_AR69    =   3141,\n    CV_IA64_AR70    =   3142,\n    CV_IA64_AR71    =   3143,\n    CV_IA64_AR72    =   3144,\n    CV_IA64_AR73    =   3145,\n    CV_IA64_AR74    =   3146,\n    CV_IA64_AR75    =   3147,\n    CV_IA64_AR76    =   3148,\n    CV_IA64_AR77    =   3149,\n    CV_IA64_AR78    =   3150,\n    CV_IA64_AR79    =   3151,\n    CV_IA64_AR80    =   3152,\n    CV_IA64_AR81    =   3153,\n    CV_IA64_AR82    =   3154,\n    CV_IA64_AR83    =   3155,\n    CV_IA64_AR84    =   3156,\n    CV_IA64_AR85    =   3157,\n    CV_IA64_AR86    =   3158,\n    CV_IA64_AR87    =   3159,\n    CV_IA64_AR88    =   3160,\n    CV_IA64_AR89    =   3161,\n    CV_IA64_AR90    =   3162,\n    CV_IA64_AR91    =   3163,\n    CV_IA64_AR92    =   3164,\n    CV_IA64_AR93    =   3165,\n    CV_IA64_AR94    =   3166,\n    CV_IA64_AR95    =   3167,\n    CV_IA64_AR96    =   3168,\n    CV_IA64_AR97    =   3169,\n    CV_IA64_AR98    =   3170,\n    CV_IA64_AR99    =   3171,\n    CV_IA64_AR100   =   3172,\n    CV_IA64_AR101   =   3173,\n    CV_IA64_AR102   =   3174,\n    CV_IA64_AR103   =   3175,\n    CV_IA64_AR104   =   3176,\n    CV_IA64_AR105   =   3177,\n    CV_IA64_AR106   =   3178,\n    CV_IA64_AR107   =   3179,\n    CV_IA64_AR108   =   3180,\n    CV_IA64_AR109   =   3181,\n    CV_IA64_AR110   =   3182,\n    CV_IA64_AR111   =   3183,\n    CV_IA64_AR112   =   3184,\n    CV_IA64_AR113   =   3185,\n    CV_IA64_AR114   =   3186,\n    CV_IA64_AR115   =   3187,\n    CV_IA64_AR116   =   3188,\n    CV_IA64_AR117   =   3189,\n    CV_IA64_AR118   =   3190,\n    CV_IA64_AR119   =   3191,\n    CV_IA64_AR120   =   3192,\n    CV_IA64_AR121   =   3193,\n    CV_IA64_AR122   =   3194,\n    CV_IA64_AR123   =   3195,\n    CV_IA64_AR124   =   3196,\n    CV_IA64_AR125   =   3197,\n    CV_IA64_AR126   =   3198,\n    CV_IA64_AR127   =   3199,\n\n    // CPUID Registers\n\n    CV_IA64_CPUID0  =   3328,\n    CV_IA64_CPUID1  =   3329,\n    CV_IA64_CPUID2  =   3330,\n    CV_IA64_CPUID3  =   3331,\n    CV_IA64_CPUID4  =   3332,\n\n    // Control Registers\n\n    CV_IA64_ApDCR   =   4096,\n    CV_IA64_ApITM   =   4097,\n    CV_IA64_ApIVA   =   4098,\n    CV_IA64_CR3     =   4099,\n    CV_IA64_CR4     =   4100,\n    CV_IA64_CR5     =   4101,\n    CV_IA64_CR6     =   4102,\n    CV_IA64_CR7     =   4103,\n    CV_IA64_ApPTA   =   4104,\n    CV_IA64_ApGPTA  =   4105,\n    CV_IA64_CR10    =   4106,\n    CV_IA64_CR11    =   4107,\n    CV_IA64_CR12    =   4108,\n    CV_IA64_CR13    =   4109,\n    CV_IA64_CR14    =   4110,\n    CV_IA64_CR15    =   4111,\n    CV_IA64_StIPSR  =   4112,\n    CV_IA64_StISR   =   4113,\n    CV_IA64_CR18    =   4114,\n    CV_IA64_StIIP   =   4115,\n    CV_IA64_StIFA   =   4116,\n    CV_IA64_StITIR  =   4117,\n    CV_IA64_StIIPA  =   4118,\n    CV_IA64_StIFS   =   4119,\n    CV_IA64_StIIM   =   4120,\n    CV_IA64_StIHA   =   4121,\n    CV_IA64_CR26    =   4122,\n    CV_IA64_CR27    =   4123,\n    CV_IA64_CR28    =   4124,\n    CV_IA64_CR29    =   4125,\n    CV_IA64_CR30    =   4126,\n    CV_IA64_CR31    =   4127,\n    CV_IA64_CR32    =   4128,\n    CV_IA64_CR33    =   4129,\n    CV_IA64_CR34    =   4130,\n    CV_IA64_CR35    =   4131,\n    CV_IA64_CR36    =   4132,\n    CV_IA64_CR37    =   4133,\n    CV_IA64_CR38    =   4134,\n    CV_IA64_CR39    =   4135,\n    CV_IA64_CR40    =   4136,\n    CV_IA64_CR41    =   4137,\n    CV_IA64_CR42    =   4138,\n    CV_IA64_CR43    =   4139,\n    CV_IA64_CR44    =   4140,\n    CV_IA64_CR45    =   4141,\n    CV_IA64_CR46    =   4142,\n    CV_IA64_CR47    =   4143,\n    CV_IA64_CR48    =   4144,\n    CV_IA64_CR49    =   4145,\n    CV_IA64_CR50    =   4146,\n    CV_IA64_CR51    =   4147,\n    CV_IA64_CR52    =   4148,\n    CV_IA64_CR53    =   4149,\n    CV_IA64_CR54    =   4150,\n    CV_IA64_CR55    =   4151,\n    CV_IA64_CR56    =   4152,\n    CV_IA64_CR57    =   4153,\n    CV_IA64_CR58    =   4154,\n    CV_IA64_CR59    =   4155,\n    CV_IA64_CR60    =   4156,\n    CV_IA64_CR61    =   4157,\n    CV_IA64_CR62    =   4158,\n    CV_IA64_CR63    =   4159,\n    CV_IA64_SaLID   =   4160,\n    CV_IA64_SaIVR   =   4161,\n    CV_IA64_SaTPR   =   4162,\n    CV_IA64_SaEOI   =   4163,\n    CV_IA64_SaIRR0  =   4164,\n    CV_IA64_SaIRR1  =   4165,\n    CV_IA64_SaIRR2  =   4166,\n    CV_IA64_SaIRR3  =   4167,\n    CV_IA64_SaITV   =   4168,\n    CV_IA64_SaPMV   =   4169,\n    CV_IA64_SaCMCV  =   4170,\n    CV_IA64_CR75    =   4171,\n    CV_IA64_CR76    =   4172,\n    CV_IA64_CR77    =   4173,\n    CV_IA64_CR78    =   4174,\n    CV_IA64_CR79    =   4175,\n    CV_IA64_SaLRR0  =   4176,\n    CV_IA64_SaLRR1  =   4177,\n    CV_IA64_CR82    =   4178,\n    CV_IA64_CR83    =   4179,\n    CV_IA64_CR84    =   4180,\n    CV_IA64_CR85    =   4181,\n    CV_IA64_CR86    =   4182,\n    CV_IA64_CR87    =   4183,\n    CV_IA64_CR88    =   4184,\n    CV_IA64_CR89    =   4185,\n    CV_IA64_CR90    =   4186,\n    CV_IA64_CR91    =   4187,\n    CV_IA64_CR92    =   4188,\n    CV_IA64_CR93    =   4189,\n    CV_IA64_CR94    =   4190,\n    CV_IA64_CR95    =   4191,\n    CV_IA64_CR96    =   4192,\n    CV_IA64_CR97    =   4193,\n    CV_IA64_CR98    =   4194,\n    CV_IA64_CR99    =   4195,\n    CV_IA64_CR100   =   4196,\n    CV_IA64_CR101   =   4197,\n    CV_IA64_CR102   =   4198,\n    CV_IA64_CR103   =   4199,\n    CV_IA64_CR104   =   4200,\n    CV_IA64_CR105   =   4201,\n    CV_IA64_CR106   =   4202,\n    CV_IA64_CR107   =   4203,\n    CV_IA64_CR108   =   4204,\n    CV_IA64_CR109   =   4205,\n    CV_IA64_CR110   =   4206,\n    CV_IA64_CR111   =   4207,\n    CV_IA64_CR112   =   4208,\n    CV_IA64_CR113   =   4209,\n    CV_IA64_CR114   =   4210,\n    CV_IA64_CR115   =   4211,\n    CV_IA64_CR116   =   4212,\n    CV_IA64_CR117   =   4213,\n    CV_IA64_CR118   =   4214,\n    CV_IA64_CR119   =   4215,\n    CV_IA64_CR120   =   4216,\n    CV_IA64_CR121   =   4217,\n    CV_IA64_CR122   =   4218,\n    CV_IA64_CR123   =   4219,\n    CV_IA64_CR124   =   4220,\n    CV_IA64_CR125   =   4221,\n    CV_IA64_CR126   =   4222,\n    CV_IA64_CR127   =   4223,\n\n    // Protection Key Registers\n\n    CV_IA64_Pkr0    =   5120,\n    CV_IA64_Pkr1    =   5121,\n    CV_IA64_Pkr2    =   5122,\n    CV_IA64_Pkr3    =   5123,\n    CV_IA64_Pkr4    =   5124,\n    CV_IA64_Pkr5    =   5125,\n    CV_IA64_Pkr6    =   5126,\n    CV_IA64_Pkr7    =   5127,\n    CV_IA64_Pkr8    =   5128,\n    CV_IA64_Pkr9    =   5129,\n    CV_IA64_Pkr10   =   5130,\n    CV_IA64_Pkr11   =   5131,\n    CV_IA64_Pkr12   =   5132,\n    CV_IA64_Pkr13   =   5133,\n    CV_IA64_Pkr14   =   5134,\n    CV_IA64_Pkr15   =   5135,\n\n    // Region Registers\n\n    CV_IA64_Rr0     =   6144,\n    CV_IA64_Rr1     =   6145,\n    CV_IA64_Rr2     =   6146,\n    CV_IA64_Rr3     =   6147,\n    CV_IA64_Rr4     =   6148,\n    CV_IA64_Rr5     =   6149,\n    CV_IA64_Rr6     =   6150,\n    CV_IA64_Rr7     =   6151,\n\n    // Performance Monitor Data Registers\n\n    CV_IA64_PFD0    =   7168,\n    CV_IA64_PFD1    =   7169,\n    CV_IA64_PFD2    =   7170,\n    CV_IA64_PFD3    =   7171,\n    CV_IA64_PFD4    =   7172,\n    CV_IA64_PFD5    =   7173,\n    CV_IA64_PFD6    =   7174,\n    CV_IA64_PFD7    =   7175,\n    CV_IA64_PFD8    =   7176,\n    CV_IA64_PFD9    =   7177,\n    CV_IA64_PFD10   =   7178,\n    CV_IA64_PFD11   =   7179,\n    CV_IA64_PFD12   =   7180,\n    CV_IA64_PFD13   =   7181,\n    CV_IA64_PFD14   =   7182,\n    CV_IA64_PFD15   =   7183,\n    CV_IA64_PFD16   =   7184,\n    CV_IA64_PFD17   =   7185,\n\n    // Performance Monitor Config Registers\n\n    CV_IA64_PFC0    =   7424,\n    CV_IA64_PFC1    =   7425,\n    CV_IA64_PFC2    =   7426,\n    CV_IA64_PFC3    =   7427,\n    CV_IA64_PFC4    =   7428,\n    CV_IA64_PFC5    =   7429,\n    CV_IA64_PFC6    =   7430,\n    CV_IA64_PFC7    =   7431,\n    CV_IA64_PFC8    =   7432,\n    CV_IA64_PFC9    =   7433,\n    CV_IA64_PFC10   =   7434,\n    CV_IA64_PFC11   =   7435,\n    CV_IA64_PFC12   =   7436,\n    CV_IA64_PFC13   =   7437,\n    CV_IA64_PFC14   =   7438,\n    CV_IA64_PFC15   =   7439,\n\n    // Instruction Translation Registers\n\n    CV_IA64_TrI0    =   8192,\n    CV_IA64_TrI1    =   8193,\n    CV_IA64_TrI2    =   8194,\n    CV_IA64_TrI3    =   8195,\n    CV_IA64_TrI4    =   8196,\n    CV_IA64_TrI5    =   8197,\n    CV_IA64_TrI6    =   8198,\n    CV_IA64_TrI7    =   8199,\n\n    // Data Translation Registers\n\n    CV_IA64_TrD0    =   8320,\n    CV_IA64_TrD1    =   8321,\n    CV_IA64_TrD2    =   8322,\n    CV_IA64_TrD3    =   8323,\n    CV_IA64_TrD4    =   8324,\n    CV_IA64_TrD5    =   8325,\n    CV_IA64_TrD6    =   8326,\n    CV_IA64_TrD7    =   8327,\n\n    // Instruction Breakpoint Registers\n\n    CV_IA64_DbI0    =   8448,\n    CV_IA64_DbI1    =   8449,\n    CV_IA64_DbI2    =   8450,\n    CV_IA64_DbI3    =   8451,\n    CV_IA64_DbI4    =   8452,\n    CV_IA64_DbI5    =   8453,\n    CV_IA64_DbI6    =   8454,\n    CV_IA64_DbI7    =   8455,\n\n    // Data Breakpoint Registers\n\n    CV_IA64_DbD0    =   8576,\n    CV_IA64_DbD1    =   8577,\n    CV_IA64_DbD2    =   8578,\n    CV_IA64_DbD3    =   8579,\n    CV_IA64_DbD4    =   8580,\n    CV_IA64_DbD5    =   8581,\n    CV_IA64_DbD6    =   8582,\n    CV_IA64_DbD7    =   8583,\n\n    //\n    // Register set for the TriCore processor.\n    //\n\n    CV_TRI_NOREG    =   CV_REG_NONE,\n\n    // General Purpose Data Registers\n\n    CV_TRI_D0   =   10,\n    CV_TRI_D1   =   11,\n    CV_TRI_D2   =   12,\n    CV_TRI_D3   =   13,\n    CV_TRI_D4   =   14,\n    CV_TRI_D5   =   15,\n    CV_TRI_D6   =   16,\n    CV_TRI_D7   =   17,\n    CV_TRI_D8   =   18,\n    CV_TRI_D9   =   19,\n    CV_TRI_D10  =   20,\n    CV_TRI_D11  =   21,\n    CV_TRI_D12  =   22,\n    CV_TRI_D13  =   23,\n    CV_TRI_D14  =   24,\n    CV_TRI_D15  =   25,\n\n    // General Purpose Address Registers\n\n    CV_TRI_A0   =   26,\n    CV_TRI_A1   =   27,\n    CV_TRI_A2   =   28,\n    CV_TRI_A3   =   29,\n    CV_TRI_A4   =   30,\n    CV_TRI_A5   =   31,\n    CV_TRI_A6   =   32,\n    CV_TRI_A7   =   33,\n    CV_TRI_A8   =   34,\n    CV_TRI_A9   =   35,\n    CV_TRI_A10  =   36,\n    CV_TRI_A11  =   37,\n    CV_TRI_A12  =   38,\n    CV_TRI_A13  =   39,\n    CV_TRI_A14  =   40,\n    CV_TRI_A15  =   41,\n\n    // Extended (64-bit) data registers\n\n    CV_TRI_E0   =   42,\n    CV_TRI_E2   =   43,\n    CV_TRI_E4   =   44,\n    CV_TRI_E6   =   45,\n    CV_TRI_E8   =   46,\n    CV_TRI_E10  =   47,\n    CV_TRI_E12  =   48,\n    CV_TRI_E14  =   49,\n\n    // Extended (64-bit) address registers\n\n    CV_TRI_EA0  =   50,\n    CV_TRI_EA2  =   51,\n    CV_TRI_EA4  =   52,\n    CV_TRI_EA6  =   53,\n    CV_TRI_EA8  =   54,\n    CV_TRI_EA10 =   55,\n    CV_TRI_EA12 =   56,\n    CV_TRI_EA14 =   57,\n\n    CV_TRI_PSW  =   58,\n    CV_TRI_PCXI =   59,\n    CV_TRI_PC   =   60,\n    CV_TRI_FCX  =   61,\n    CV_TRI_LCX  =   62,\n    CV_TRI_ISP  =   63,\n    CV_TRI_ICR  =   64,\n    CV_TRI_BIV  =   65,\n    CV_TRI_BTV  =   66,\n    CV_TRI_SYSCON   =   67,\n    CV_TRI_DPRx_0   =   68,\n    CV_TRI_DPRx_1   =   69,\n    CV_TRI_DPRx_2   =   70,\n    CV_TRI_DPRx_3   =   71,\n    CV_TRI_CPRx_0   =   68,\n    CV_TRI_CPRx_1   =   69,\n    CV_TRI_CPRx_2   =   70,\n    CV_TRI_CPRx_3   =   71,\n    CV_TRI_DPMx_0   =   68,\n    CV_TRI_DPMx_1   =   69,\n    CV_TRI_DPMx_2   =   70,\n    CV_TRI_DPMx_3   =   71,\n    CV_TRI_CPMx_0   =   68,\n    CV_TRI_CPMx_1   =   69,\n    CV_TRI_CPMx_2   =   70,\n    CV_TRI_CPMx_3   =   71,\n    CV_TRI_DBGSSR   =   72,\n    CV_TRI_EXEVT    =   73,\n    CV_TRI_SWEVT    =   74,\n    CV_TRI_CREVT    =   75,\n    CV_TRI_TRnEVT   =   76,\n    CV_TRI_MMUCON   =   77,\n    CV_TRI_ASI      =   78,\n    CV_TRI_TVA      =   79,\n    CV_TRI_TPA      =   80,\n    CV_TRI_TPX      =   81,\n    CV_TRI_TFA      =   82,\n\n    //\n    // Register set for the AM33 and related processors.\n    //\n\n    CV_AM33_NOREG   =   CV_REG_NONE,\n\n    // \"Extended\" (general purpose integer) registers\n    CV_AM33_E0      =   10,\n    CV_AM33_E1      =   11,\n    CV_AM33_E2      =   12,\n    CV_AM33_E3      =   13,\n    CV_AM33_E4      =   14,\n    CV_AM33_E5      =   15,\n    CV_AM33_E6      =   16,\n    CV_AM33_E7      =   17,\n\n    // Address registers\n    CV_AM33_A0      =   20,\n    CV_AM33_A1      =   21,\n    CV_AM33_A2      =   22,\n    CV_AM33_A3      =   23,\n\n    // Integer data registers\n    CV_AM33_D0      =   30,\n    CV_AM33_D1      =   31,\n    CV_AM33_D2      =   32,\n    CV_AM33_D3      =   33,\n\n    // (Single-precision) floating-point registers\n    CV_AM33_FS0     =   40,\n    CV_AM33_FS1     =   41,\n    CV_AM33_FS2     =   42,\n    CV_AM33_FS3     =   43,\n    CV_AM33_FS4     =   44,\n    CV_AM33_FS5     =   45,\n    CV_AM33_FS6     =   46,\n    CV_AM33_FS7     =   47,\n    CV_AM33_FS8     =   48,\n    CV_AM33_FS9     =   49,\n    CV_AM33_FS10    =   50,\n    CV_AM33_FS11    =   51,\n    CV_AM33_FS12    =   52,\n    CV_AM33_FS13    =   53,\n    CV_AM33_FS14    =   54,\n    CV_AM33_FS15    =   55,\n    CV_AM33_FS16    =   56,\n    CV_AM33_FS17    =   57,\n    CV_AM33_FS18    =   58,\n    CV_AM33_FS19    =   59,\n    CV_AM33_FS20    =   60,\n    CV_AM33_FS21    =   61,\n    CV_AM33_FS22    =   62,\n    CV_AM33_FS23    =   63,\n    CV_AM33_FS24    =   64,\n    CV_AM33_FS25    =   65,\n    CV_AM33_FS26    =   66,\n    CV_AM33_FS27    =   67,\n    CV_AM33_FS28    =   68,\n    CV_AM33_FS29    =   69,\n    CV_AM33_FS30    =   70,\n    CV_AM33_FS31    =   71,\n\n    // Special purpose registers\n\n    // Stack pointer\n    CV_AM33_SP      =   80,\n\n    // Program counter\n    CV_AM33_PC      =   81,\n\n    // Multiply-divide/accumulate registers\n    CV_AM33_MDR     =   82,\n    CV_AM33_MDRQ    =   83,\n    CV_AM33_MCRH    =   84,\n    CV_AM33_MCRL    =   85,\n    CV_AM33_MCVF    =   86,\n\n    // CPU status words\n    CV_AM33_EPSW    =   87,\n    CV_AM33_FPCR    =   88,\n\n    // Loop buffer registers\n    CV_AM33_LIR     =   89,\n    CV_AM33_LAR     =   90,\n\n    //\n    // Register set for the Mitsubishi M32R\n    //\n\n    CV_M32R_NOREG    =   CV_REG_NONE,\n\n    CV_M32R_R0    =   10,\n    CV_M32R_R1    =   11,\n    CV_M32R_R2    =   12,\n    CV_M32R_R3    =   13,\n    CV_M32R_R4    =   14,\n    CV_M32R_R5    =   15,\n    CV_M32R_R6    =   16,\n    CV_M32R_R7    =   17,\n    CV_M32R_R8    =   18,\n    CV_M32R_R9    =   19,\n    CV_M32R_R10   =   20,\n    CV_M32R_R11   =   21,\n    CV_M32R_R12   =   22,   // Gloabal Pointer, if used\n    CV_M32R_R13   =   23,   // Frame Pointer, if allocated\n    CV_M32R_R14   =   24,   // Link Register\n    CV_M32R_R15   =   25,   // Stack Pointer\n    CV_M32R_PSW   =   26,   // Preocessor Status Register\n    CV_M32R_CBR   =   27,   // Condition Bit Register\n    CV_M32R_SPI   =   28,   // Interrupt Stack Pointer\n    CV_M32R_SPU   =   29,   // User Stack Pointer\n    CV_M32R_SPO   =   30,   // OS Stack Pointer\n    CV_M32R_BPC   =   31,   // Backup Program Counter\n    CV_M32R_ACHI  =   32,   // Accumulator High\n    CV_M32R_ACLO  =   33,   // Accumulator Low\n    CV_M32R_PC    =   34,   // Program Counter\n\n    //\n    // Register set for the SuperH SHMedia processor including compact\n    // mode\n    //\n\n    // Integer - 64 bit general registers\n    CV_SHMEDIA_NOREG   =   CV_REG_NONE,\n    CV_SHMEDIA_R0      =   10,\n    CV_SHMEDIA_R1      =   11,\n    CV_SHMEDIA_R2      =   12,\n    CV_SHMEDIA_R3      =   13,\n    CV_SHMEDIA_R4      =   14,\n    CV_SHMEDIA_R5      =   15,\n    CV_SHMEDIA_R6      =   16,\n    CV_SHMEDIA_R7      =   17,\n    CV_SHMEDIA_R8      =   18,\n    CV_SHMEDIA_R9      =   19,\n    CV_SHMEDIA_R10     =   20,\n    CV_SHMEDIA_R11     =   21,\n    CV_SHMEDIA_R12     =   22,\n    CV_SHMEDIA_R13     =   23,\n    CV_SHMEDIA_R14     =   24,\n    CV_SHMEDIA_R15     =   25,\n    CV_SHMEDIA_R16     =   26,\n    CV_SHMEDIA_R17     =   27,\n    CV_SHMEDIA_R18     =   28,\n    CV_SHMEDIA_R19     =   29,\n    CV_SHMEDIA_R20     =   30,\n    CV_SHMEDIA_R21     =   31,\n    CV_SHMEDIA_R22     =   32,\n    CV_SHMEDIA_R23     =   33,\n    CV_SHMEDIA_R24     =   34,\n    CV_SHMEDIA_R25     =   35,\n    CV_SHMEDIA_R26     =   36,\n    CV_SHMEDIA_R27     =   37,\n    CV_SHMEDIA_R28     =   38,\n    CV_SHMEDIA_R29     =   39,\n    CV_SHMEDIA_R30     =   40,\n    CV_SHMEDIA_R31     =   41,\n    CV_SHMEDIA_R32     =   42,\n    CV_SHMEDIA_R33     =   43,\n    CV_SHMEDIA_R34     =   44,\n    CV_SHMEDIA_R35     =   45,\n    CV_SHMEDIA_R36     =   46,\n    CV_SHMEDIA_R37     =   47,\n    CV_SHMEDIA_R38     =   48,\n    CV_SHMEDIA_R39     =   49,\n    CV_SHMEDIA_R40     =   50,\n    CV_SHMEDIA_R41     =   51,\n    CV_SHMEDIA_R42     =   52,\n    CV_SHMEDIA_R43     =   53,\n    CV_SHMEDIA_R44     =   54,\n    CV_SHMEDIA_R45     =   55,\n    CV_SHMEDIA_R46     =   56,\n    CV_SHMEDIA_R47     =   57,\n    CV_SHMEDIA_R48     =   58,\n    CV_SHMEDIA_R49     =   59,\n    CV_SHMEDIA_R50     =   60,\n    CV_SHMEDIA_R51     =   61,\n    CV_SHMEDIA_R52     =   62,\n    CV_SHMEDIA_R53     =   63,\n    CV_SHMEDIA_R54     =   64,\n    CV_SHMEDIA_R55     =   65,\n    CV_SHMEDIA_R56     =   66,\n    CV_SHMEDIA_R57     =   67,\n    CV_SHMEDIA_R58     =   68,\n    CV_SHMEDIA_R59     =   69,\n    CV_SHMEDIA_R60     =   70,\n    CV_SHMEDIA_R61     =   71,\n    CV_SHMEDIA_R62     =   72,\n    CV_SHMEDIA_R63     =   73,\n\n    // Target Registers - 32 bit\n    CV_SHMEDIA_TR0     =   74,\n    CV_SHMEDIA_TR1     =   75,\n    CV_SHMEDIA_TR2     =   76,\n    CV_SHMEDIA_TR3     =   77,\n    CV_SHMEDIA_TR4     =   78,\n    CV_SHMEDIA_TR5     =   79,\n    CV_SHMEDIA_TR6     =   80,\n    CV_SHMEDIA_TR7     =   81,\n    CV_SHMEDIA_TR8     =   82, // future-proof\n    CV_SHMEDIA_TR9     =   83, // future-proof\n    CV_SHMEDIA_TR10    =   84, // future-proof\n    CV_SHMEDIA_TR11    =   85, // future-proof\n    CV_SHMEDIA_TR12    =   86, // future-proof\n    CV_SHMEDIA_TR13    =   87, // future-proof\n    CV_SHMEDIA_TR14    =   88, // future-proof\n    CV_SHMEDIA_TR15    =   89, // future-proof\n\n    // Single - 32 bit fp registers\n    CV_SHMEDIA_FR0     =   128,\n    CV_SHMEDIA_FR1     =   129,\n    CV_SHMEDIA_FR2     =   130,\n    CV_SHMEDIA_FR3     =   131,\n    CV_SHMEDIA_FR4     =   132,\n    CV_SHMEDIA_FR5     =   133,\n    CV_SHMEDIA_FR6     =   134,\n    CV_SHMEDIA_FR7     =   135,\n    CV_SHMEDIA_FR8     =   136,\n    CV_SHMEDIA_FR9     =   137,\n    CV_SHMEDIA_FR10    =   138,\n    CV_SHMEDIA_FR11    =   139,\n    CV_SHMEDIA_FR12    =   140,\n    CV_SHMEDIA_FR13    =   141,\n    CV_SHMEDIA_FR14    =   142,\n    CV_SHMEDIA_FR15    =   143,\n    CV_SHMEDIA_FR16    =   144,\n    CV_SHMEDIA_FR17    =   145,\n    CV_SHMEDIA_FR18    =   146,\n    CV_SHMEDIA_FR19    =   147,\n    CV_SHMEDIA_FR20    =   148,\n    CV_SHMEDIA_FR21    =   149,\n    CV_SHMEDIA_FR22    =   150,\n    CV_SHMEDIA_FR23    =   151,\n    CV_SHMEDIA_FR24    =   152,\n    CV_SHMEDIA_FR25    =   153,\n    CV_SHMEDIA_FR26    =   154,\n    CV_SHMEDIA_FR27    =   155,\n    CV_SHMEDIA_FR28    =   156,\n    CV_SHMEDIA_FR29    =   157,\n    CV_SHMEDIA_FR30    =   158,\n    CV_SHMEDIA_FR31    =   159,\n    CV_SHMEDIA_FR32    =   160,\n    CV_SHMEDIA_FR33    =   161,\n    CV_SHMEDIA_FR34    =   162,\n    CV_SHMEDIA_FR35    =   163,\n    CV_SHMEDIA_FR36    =   164,\n    CV_SHMEDIA_FR37    =   165,\n    CV_SHMEDIA_FR38    =   166,\n    CV_SHMEDIA_FR39    =   167,\n    CV_SHMEDIA_FR40    =   168,\n    CV_SHMEDIA_FR41    =   169,\n    CV_SHMEDIA_FR42    =   170,\n    CV_SHMEDIA_FR43    =   171,\n    CV_SHMEDIA_FR44    =   172,\n    CV_SHMEDIA_FR45    =   173,\n    CV_SHMEDIA_FR46    =   174,\n    CV_SHMEDIA_FR47    =   175,\n    CV_SHMEDIA_FR48    =   176,\n    CV_SHMEDIA_FR49    =   177,\n    CV_SHMEDIA_FR50    =   178,\n    CV_SHMEDIA_FR51    =   179,\n    CV_SHMEDIA_FR52    =   180,\n    CV_SHMEDIA_FR53    =   181,\n    CV_SHMEDIA_FR54    =   182,\n    CV_SHMEDIA_FR55    =   183,\n    CV_SHMEDIA_FR56    =   184,\n    CV_SHMEDIA_FR57    =   185,\n    CV_SHMEDIA_FR58    =   186,\n    CV_SHMEDIA_FR59    =   187,\n    CV_SHMEDIA_FR60    =   188,\n    CV_SHMEDIA_FR61    =   189,\n    CV_SHMEDIA_FR62    =   190,\n    CV_SHMEDIA_FR63    =   191,\n\n    // Double - 64 bit synonyms for 32bit fp register pairs\n    //          subtract 128 to find first base single register\n    CV_SHMEDIA_DR0     =   256,\n    CV_SHMEDIA_DR2     =   258,\n    CV_SHMEDIA_DR4     =   260,\n    CV_SHMEDIA_DR6     =   262,\n    CV_SHMEDIA_DR8     =   264,\n    CV_SHMEDIA_DR10    =   266,\n    CV_SHMEDIA_DR12    =   268,\n    CV_SHMEDIA_DR14    =   270,\n    CV_SHMEDIA_DR16    =   272,\n    CV_SHMEDIA_DR18    =   274,\n    CV_SHMEDIA_DR20    =   276,\n    CV_SHMEDIA_DR22    =   278,\n    CV_SHMEDIA_DR24    =   280,\n    CV_SHMEDIA_DR26    =   282,\n    CV_SHMEDIA_DR28    =   284,\n    CV_SHMEDIA_DR30    =   286,\n    CV_SHMEDIA_DR32    =   288,\n    CV_SHMEDIA_DR34    =   290,\n    CV_SHMEDIA_DR36    =   292,\n    CV_SHMEDIA_DR38    =   294,\n    CV_SHMEDIA_DR40    =   296,\n    CV_SHMEDIA_DR42    =   298,\n    CV_SHMEDIA_DR44    =   300,\n    CV_SHMEDIA_DR46    =   302,\n    CV_SHMEDIA_DR48    =   304,\n    CV_SHMEDIA_DR50    =   306,\n    CV_SHMEDIA_DR52    =   308,\n    CV_SHMEDIA_DR54    =   310,\n    CV_SHMEDIA_DR56    =   312,\n    CV_SHMEDIA_DR58    =   314,\n    CV_SHMEDIA_DR60    =   316,\n    CV_SHMEDIA_DR62    =   318,\n\n    // Vector - 128 bit synonyms for 32bit fp register quads\n    //          subtract 384 to find first base single register\n    CV_SHMEDIA_FV0     =   512,\n    CV_SHMEDIA_FV4     =   516,\n    CV_SHMEDIA_FV8     =   520,\n    CV_SHMEDIA_FV12    =   524,\n    CV_SHMEDIA_FV16    =   528,\n    CV_SHMEDIA_FV20    =   532,\n    CV_SHMEDIA_FV24    =   536,\n    CV_SHMEDIA_FV28    =   540,\n    CV_SHMEDIA_FV32    =   544,\n    CV_SHMEDIA_FV36    =   548,\n    CV_SHMEDIA_FV40    =   552,\n    CV_SHMEDIA_FV44    =   556,\n    CV_SHMEDIA_FV48    =   560,\n    CV_SHMEDIA_FV52    =   564,\n    CV_SHMEDIA_FV56    =   568,\n    CV_SHMEDIA_FV60    =   572,\n\n    // Matrix - 512 bit synonyms for 16 adjacent 32bit fp registers\n    //          subtract 896 to find first base single register\n    CV_SHMEDIA_MTRX0   =   1024,\n    CV_SHMEDIA_MTRX16  =   1040,\n    CV_SHMEDIA_MTRX32  =   1056,\n    CV_SHMEDIA_MTRX48  =   1072,\n\n    // Control - Implementation defined 64bit control registers\n    CV_SHMEDIA_CR0     =   2000,\n    CV_SHMEDIA_CR1     =   2001,\n    CV_SHMEDIA_CR2     =   2002,\n    CV_SHMEDIA_CR3     =   2003,\n    CV_SHMEDIA_CR4     =   2004,\n    CV_SHMEDIA_CR5     =   2005,\n    CV_SHMEDIA_CR6     =   2006,\n    CV_SHMEDIA_CR7     =   2007,\n    CV_SHMEDIA_CR8     =   2008,\n    CV_SHMEDIA_CR9     =   2009,\n    CV_SHMEDIA_CR10    =   2010,\n    CV_SHMEDIA_CR11    =   2011,\n    CV_SHMEDIA_CR12    =   2012,\n    CV_SHMEDIA_CR13    =   2013,\n    CV_SHMEDIA_CR14    =   2014,\n    CV_SHMEDIA_CR15    =   2015,\n    CV_SHMEDIA_CR16    =   2016,\n    CV_SHMEDIA_CR17    =   2017,\n    CV_SHMEDIA_CR18    =   2018,\n    CV_SHMEDIA_CR19    =   2019,\n    CV_SHMEDIA_CR20    =   2020,\n    CV_SHMEDIA_CR21    =   2021,\n    CV_SHMEDIA_CR22    =   2022,\n    CV_SHMEDIA_CR23    =   2023,\n    CV_SHMEDIA_CR24    =   2024,\n    CV_SHMEDIA_CR25    =   2025,\n    CV_SHMEDIA_CR26    =   2026,\n    CV_SHMEDIA_CR27    =   2027,\n    CV_SHMEDIA_CR28    =   2028,\n    CV_SHMEDIA_CR29    =   2029,\n    CV_SHMEDIA_CR30    =   2030,\n    CV_SHMEDIA_CR31    =   2031,\n    CV_SHMEDIA_CR32    =   2032,\n    CV_SHMEDIA_CR33    =   2033,\n    CV_SHMEDIA_CR34    =   2034,\n    CV_SHMEDIA_CR35    =   2035,\n    CV_SHMEDIA_CR36    =   2036,\n    CV_SHMEDIA_CR37    =   2037,\n    CV_SHMEDIA_CR38    =   2038,\n    CV_SHMEDIA_CR39    =   2039,\n    CV_SHMEDIA_CR40    =   2040,\n    CV_SHMEDIA_CR41    =   2041,\n    CV_SHMEDIA_CR42    =   2042,\n    CV_SHMEDIA_CR43    =   2043,\n    CV_SHMEDIA_CR44    =   2044,\n    CV_SHMEDIA_CR45    =   2045,\n    CV_SHMEDIA_CR46    =   2046,\n    CV_SHMEDIA_CR47    =   2047,\n    CV_SHMEDIA_CR48    =   2048,\n    CV_SHMEDIA_CR49    =   2049,\n    CV_SHMEDIA_CR50    =   2050,\n    CV_SHMEDIA_CR51    =   2051,\n    CV_SHMEDIA_CR52    =   2052,\n    CV_SHMEDIA_CR53    =   2053,\n    CV_SHMEDIA_CR54    =   2054,\n    CV_SHMEDIA_CR55    =   2055,\n    CV_SHMEDIA_CR56    =   2056,\n    CV_SHMEDIA_CR57    =   2057,\n    CV_SHMEDIA_CR58    =   2058,\n    CV_SHMEDIA_CR59    =   2059,\n    CV_SHMEDIA_CR60    =   2060,\n    CV_SHMEDIA_CR61    =   2061,\n    CV_SHMEDIA_CR62    =   2062,\n    CV_SHMEDIA_CR63    =   2063,\n\n    CV_SHMEDIA_FPSCR   =   2064,\n\n    // Compact mode synonyms\n    CV_SHMEDIA_GBR     =   CV_SHMEDIA_R16,\n    CV_SHMEDIA_MACL    =   90, // synonym for lower 32bits of media R17\n    CV_SHMEDIA_MACH    =   91, // synonym for upper 32bits of media R17\n    CV_SHMEDIA_PR      =   CV_SHMEDIA_R18,\n    CV_SHMEDIA_T       =   92, // synonym for lowest bit of media R19\n    CV_SHMEDIA_FPUL    =   CV_SHMEDIA_FR32,\n    CV_SHMEDIA_PC      =   93,\n    CV_SHMEDIA_SR      =   CV_SHMEDIA_CR0,\n\n    //\n    // AMD64 registers\n    //\n\n    CV_AMD64_AL       =   1,\n    CV_AMD64_CL       =   2,\n    CV_AMD64_DL       =   3,\n    CV_AMD64_BL       =   4,\n    CV_AMD64_AH       =   5,\n    CV_AMD64_CH       =   6,\n    CV_AMD64_DH       =   7,\n    CV_AMD64_BH       =   8,\n    CV_AMD64_AX       =   9,\n    CV_AMD64_CX       =  10,\n    CV_AMD64_DX       =  11,\n    CV_AMD64_BX       =  12,\n    CV_AMD64_SP       =  13,\n    CV_AMD64_BP       =  14,\n    CV_AMD64_SI       =  15,\n    CV_AMD64_DI       =  16,\n    CV_AMD64_EAX      =  17,\n    CV_AMD64_ECX      =  18,\n    CV_AMD64_EDX      =  19,\n    CV_AMD64_EBX      =  20,\n    CV_AMD64_ESP      =  21,\n    CV_AMD64_EBP      =  22,\n    CV_AMD64_ESI      =  23,\n    CV_AMD64_EDI      =  24,\n    CV_AMD64_ES       =  25,\n    CV_AMD64_CS       =  26,\n    CV_AMD64_SS       =  27,\n    CV_AMD64_DS       =  28,\n    CV_AMD64_FS       =  29,\n    CV_AMD64_GS       =  30,\n    CV_AMD64_FLAGS    =  32,\n    CV_AMD64_RIP      =  33,\n    CV_AMD64_EFLAGS   =  34,\n\n    // Control registers\n    CV_AMD64_CR0      =  80,\n    CV_AMD64_CR1      =  81,\n    CV_AMD64_CR2      =  82,\n    CV_AMD64_CR3      =  83,\n    CV_AMD64_CR4      =  84,\n    CV_AMD64_CR8      =  88,\n\n    // Debug registers\n    CV_AMD64_DR0      =  90,\n    CV_AMD64_DR1      =  91,\n    CV_AMD64_DR2      =  92,\n    CV_AMD64_DR3      =  93,\n    CV_AMD64_DR4      =  94,\n    CV_AMD64_DR5      =  95,\n    CV_AMD64_DR6      =  96,\n    CV_AMD64_DR7      =  97,\n    CV_AMD64_DR8      =  98,\n    CV_AMD64_DR9      =  99,\n    CV_AMD64_DR10     =  100,\n    CV_AMD64_DR11     =  101,\n    CV_AMD64_DR12     =  102,\n    CV_AMD64_DR13     =  103,\n    CV_AMD64_DR14     =  104,\n    CV_AMD64_DR15     =  105,\n\n    CV_AMD64_GDTR     =  110,\n    CV_AMD64_GDTL     =  111,\n    CV_AMD64_IDTR     =  112,\n    CV_AMD64_IDTL     =  113,\n    CV_AMD64_LDTR     =  114,\n    CV_AMD64_TR       =  115,\n\n    CV_AMD64_ST0      =  128,\n    CV_AMD64_ST1      =  129,\n    CV_AMD64_ST2      =  130,\n    CV_AMD64_ST3      =  131,\n    CV_AMD64_ST4      =  132,\n    CV_AMD64_ST5      =  133,\n    CV_AMD64_ST6      =  134,\n    CV_AMD64_ST7      =  135,\n    CV_AMD64_CTRL     =  136,\n    CV_AMD64_STAT     =  137,\n    CV_AMD64_TAG      =  138,\n    CV_AMD64_FPIP     =  139,\n    CV_AMD64_FPCS     =  140,\n    CV_AMD64_FPDO     =  141,\n    CV_AMD64_FPDS     =  142,\n    CV_AMD64_ISEM     =  143,\n    CV_AMD64_FPEIP    =  144,\n    CV_AMD64_FPEDO    =  145,\n\n    CV_AMD64_MM0      =  146,\n    CV_AMD64_MM1      =  147,\n    CV_AMD64_MM2      =  148,\n    CV_AMD64_MM3      =  149,\n    CV_AMD64_MM4      =  150,\n    CV_AMD64_MM5      =  151,\n    CV_AMD64_MM6      =  152,\n    CV_AMD64_MM7      =  153,\n\n    CV_AMD64_XMM0     =  154,   // KATMAI registers\n    CV_AMD64_XMM1     =  155,\n    CV_AMD64_XMM2     =  156,\n    CV_AMD64_XMM3     =  157,\n    CV_AMD64_XMM4     =  158,\n    CV_AMD64_XMM5     =  159,\n    CV_AMD64_XMM6     =  160,\n    CV_AMD64_XMM7     =  161,\n\n    CV_AMD64_XMM0_0   =  162,   // KATMAI sub-registers\n    CV_AMD64_XMM0_1   =  163,\n    CV_AMD64_XMM0_2   =  164,\n    CV_AMD64_XMM0_3   =  165,\n    CV_AMD64_XMM1_0   =  166,\n    CV_AMD64_XMM1_1   =  167,\n    CV_AMD64_XMM1_2   =  168,\n    CV_AMD64_XMM1_3   =  169,\n    CV_AMD64_XMM2_0   =  170,\n    CV_AMD64_XMM2_1   =  171,\n    CV_AMD64_XMM2_2   =  172,\n    CV_AMD64_XMM2_3   =  173,\n    CV_AMD64_XMM3_0   =  174,\n    CV_AMD64_XMM3_1   =  175,\n    CV_AMD64_XMM3_2   =  176,\n    CV_AMD64_XMM3_3   =  177,\n    CV_AMD64_XMM4_0   =  178,\n    CV_AMD64_XMM4_1   =  179,\n    CV_AMD64_XMM4_2   =  180,\n    CV_AMD64_XMM4_3   =  181,\n    CV_AMD64_XMM5_0   =  182,\n    CV_AMD64_XMM5_1   =  183,\n    CV_AMD64_XMM5_2   =  184,\n    CV_AMD64_XMM5_3   =  185,\n    CV_AMD64_XMM6_0   =  186,\n    CV_AMD64_XMM6_1   =  187,\n    CV_AMD64_XMM6_2   =  188,\n    CV_AMD64_XMM6_3   =  189,\n    CV_AMD64_XMM7_0   =  190,\n    CV_AMD64_XMM7_1   =  191,\n    CV_AMD64_XMM7_2   =  192,\n    CV_AMD64_XMM7_3   =  193,\n\n    CV_AMD64_XMM0L    =  194,\n    CV_AMD64_XMM1L    =  195,\n    CV_AMD64_XMM2L    =  196,\n    CV_AMD64_XMM3L    =  197,\n    CV_AMD64_XMM4L    =  198,\n    CV_AMD64_XMM5L    =  199,\n    CV_AMD64_XMM6L    =  200,\n    CV_AMD64_XMM7L    =  201,\n\n    CV_AMD64_XMM0H    =  202,\n    CV_AMD64_XMM1H    =  203,\n    CV_AMD64_XMM2H    =  204,\n    CV_AMD64_XMM3H    =  205,\n    CV_AMD64_XMM4H    =  206,\n    CV_AMD64_XMM5H    =  207,\n    CV_AMD64_XMM6H    =  208,\n    CV_AMD64_XMM7H    =  209,\n\n    CV_AMD64_MXCSR    =  211,   // XMM status register\n\n    CV_AMD64_EMM0L    =  220,   // XMM sub-registers (WNI integer)\n    CV_AMD64_EMM1L    =  221,\n    CV_AMD64_EMM2L    =  222,\n    CV_AMD64_EMM3L    =  223,\n    CV_AMD64_EMM4L    =  224,\n    CV_AMD64_EMM5L    =  225,\n    CV_AMD64_EMM6L    =  226,\n    CV_AMD64_EMM7L    =  227,\n\n    CV_AMD64_EMM0H    =  228,\n    CV_AMD64_EMM1H    =  229,\n    CV_AMD64_EMM2H    =  230,\n    CV_AMD64_EMM3H    =  231,\n    CV_AMD64_EMM4H    =  232,\n    CV_AMD64_EMM5H    =  233,\n    CV_AMD64_EMM6H    =  234,\n    CV_AMD64_EMM7H    =  235,\n\n    // do not change the order of these regs, first one must be even too\n    CV_AMD64_MM00     =  236,\n    CV_AMD64_MM01     =  237,\n    CV_AMD64_MM10     =  238,\n    CV_AMD64_MM11     =  239,\n    CV_AMD64_MM20     =  240,\n    CV_AMD64_MM21     =  241,\n    CV_AMD64_MM30     =  242,\n    CV_AMD64_MM31     =  243,\n    CV_AMD64_MM40     =  244,\n    CV_AMD64_MM41     =  245,\n    CV_AMD64_MM50     =  246,\n    CV_AMD64_MM51     =  247,\n    CV_AMD64_MM60     =  248,\n    CV_AMD64_MM61     =  249,\n    CV_AMD64_MM70     =  250,\n    CV_AMD64_MM71     =  251,\n\n    // Extended KATMAI registers\n    CV_AMD64_XMM8     =  252,   // KATMAI registers\n    CV_AMD64_XMM9     =  253,\n    CV_AMD64_XMM10    =  254,\n    CV_AMD64_XMM11    =  255,\n    CV_AMD64_XMM12    =  256,\n    CV_AMD64_XMM13    =  257,\n    CV_AMD64_XMM14    =  258,\n    CV_AMD64_XMM15    =  259,\n\n    CV_AMD64_XMM8_0   =  260,   // KATMAI sub-registers\n    CV_AMD64_XMM8_1   =  261,\n    CV_AMD64_XMM8_2   =  262,\n    CV_AMD64_XMM8_3   =  263,\n    CV_AMD64_XMM9_0   =  264,\n    CV_AMD64_XMM9_1   =  265,\n    CV_AMD64_XMM9_2   =  266,\n    CV_AMD64_XMM9_3   =  267,\n    CV_AMD64_XMM10_0  =  268,\n    CV_AMD64_XMM10_1  =  269,\n    CV_AMD64_XMM10_2  =  270,\n    CV_AMD64_XMM10_3  =  271,\n    CV_AMD64_XMM11_0  =  272,\n    CV_AMD64_XMM11_1  =  273,\n    CV_AMD64_XMM11_2  =  274,\n    CV_AMD64_XMM11_3  =  275,\n    CV_AMD64_XMM12_0  =  276,\n    CV_AMD64_XMM12_1  =  277,\n    CV_AMD64_XMM12_2  =  278,\n    CV_AMD64_XMM12_3  =  279,\n    CV_AMD64_XMM13_0  =  280,\n    CV_AMD64_XMM13_1  =  281,\n    CV_AMD64_XMM13_2  =  282,\n    CV_AMD64_XMM13_3  =  283,\n    CV_AMD64_XMM14_0  =  284,\n    CV_AMD64_XMM14_1  =  285,\n    CV_AMD64_XMM14_2  =  286,\n    CV_AMD64_XMM14_3  =  287,\n    CV_AMD64_XMM15_0  =  288,\n    CV_AMD64_XMM15_1  =  289,\n    CV_AMD64_XMM15_2  =  290,\n    CV_AMD64_XMM15_3  =  291,\n\n    CV_AMD64_XMM8L    =  292,\n    CV_AMD64_XMM9L    =  293,\n    CV_AMD64_XMM10L   =  294,\n    CV_AMD64_XMM11L   =  295,\n    CV_AMD64_XMM12L   =  296,\n    CV_AMD64_XMM13L   =  297,\n    CV_AMD64_XMM14L   =  298,\n    CV_AMD64_XMM15L   =  299,\n\n    CV_AMD64_XMM8H    =  300,\n    CV_AMD64_XMM9H    =  301,\n    CV_AMD64_XMM10H   =  302,\n    CV_AMD64_XMM11H   =  303,\n    CV_AMD64_XMM12H   =  304,\n    CV_AMD64_XMM13H   =  305,\n    CV_AMD64_XMM14H   =  306,\n    CV_AMD64_XMM15H   =  307,\n\n    CV_AMD64_EMM8L    =  308,   // XMM sub-registers (WNI integer)\n    CV_AMD64_EMM9L    =  309,\n    CV_AMD64_EMM10L   =  310,\n    CV_AMD64_EMM11L   =  311,\n    CV_AMD64_EMM12L   =  312,\n    CV_AMD64_EMM13L   =  313,\n    CV_AMD64_EMM14L   =  314,\n    CV_AMD64_EMM15L   =  315,\n\n    CV_AMD64_EMM8H    =  316,\n    CV_AMD64_EMM9H    =  317,\n    CV_AMD64_EMM10H   =  318,\n    CV_AMD64_EMM11H   =  319,\n    CV_AMD64_EMM12H   =  320,\n    CV_AMD64_EMM13H   =  321,\n    CV_AMD64_EMM14H   =  322,\n    CV_AMD64_EMM15H   =  323,\n\n    // Low byte forms of some standard registers\n    CV_AMD64_SIL      =  324,\n    CV_AMD64_DIL      =  325,\n    CV_AMD64_BPL      =  326,\n    CV_AMD64_SPL      =  327,\n\n    // 64-bit regular registers\n    CV_AMD64_RAX      =  328,\n    CV_AMD64_RBX      =  329,\n    CV_AMD64_RCX      =  330,\n    CV_AMD64_RDX      =  331,\n    CV_AMD64_RSI      =  332,\n    CV_AMD64_RDI      =  333,\n    CV_AMD64_RBP      =  334,\n    CV_AMD64_RSP      =  335,\n\n    // 64-bit integer registers with 8-, 16-, and 32-bit forms (B, W, and D)\n    CV_AMD64_R8       =  336,\n    CV_AMD64_R9       =  337,\n    CV_AMD64_R10      =  338,\n    CV_AMD64_R11      =  339,\n    CV_AMD64_R12      =  340,\n    CV_AMD64_R13      =  341,\n    CV_AMD64_R14      =  342,\n    CV_AMD64_R15      =  343,\n\n    CV_AMD64_R8B      =  344,\n    CV_AMD64_R9B      =  345,\n    CV_AMD64_R10B     =  346,\n    CV_AMD64_R11B     =  347,\n    CV_AMD64_R12B     =  348,\n    CV_AMD64_R13B     =  349,\n    CV_AMD64_R14B     =  350,\n    CV_AMD64_R15B     =  351,\n\n    CV_AMD64_R8W      =  352,\n    CV_AMD64_R9W      =  353,\n    CV_AMD64_R10W     =  354,\n    CV_AMD64_R11W     =  355,\n    CV_AMD64_R12W     =  356,\n    CV_AMD64_R13W     =  357,\n    CV_AMD64_R14W     =  358,\n    CV_AMD64_R15W     =  359,\n\n    CV_AMD64_R8D      =  360,\n    CV_AMD64_R9D      =  361,\n    CV_AMD64_R10D     =  362,\n    CV_AMD64_R11D     =  363,\n    CV_AMD64_R12D     =  364,\n    CV_AMD64_R13D     =  365,\n    CV_AMD64_R14D     =  366,\n    CV_AMD64_R15D     =  367,\n\n    // AVX registers 256 bits\n    CV_AMD64_YMM0     =  368,\n    CV_AMD64_YMM1     =  369,\n    CV_AMD64_YMM2     =  370,\n    CV_AMD64_YMM3     =  371,\n    CV_AMD64_YMM4     =  372,\n    CV_AMD64_YMM5     =  373,\n    CV_AMD64_YMM6     =  374,\n    CV_AMD64_YMM7     =  375,\n    CV_AMD64_YMM8     =  376,\n    CV_AMD64_YMM9     =  377,\n    CV_AMD64_YMM10    =  378,\n    CV_AMD64_YMM11    =  379,\n    CV_AMD64_YMM12    =  380,\n    CV_AMD64_YMM13    =  381,\n    CV_AMD64_YMM14    =  382,\n    CV_AMD64_YMM15    =  383,\n\n    // AVX registers upper 128 bits\n    CV_AMD64_YMM0H    =  384,\n    CV_AMD64_YMM1H    =  385,\n    CV_AMD64_YMM2H    =  386,\n    CV_AMD64_YMM3H    =  387,\n    CV_AMD64_YMM4H    =  388,\n    CV_AMD64_YMM5H    =  389,\n    CV_AMD64_YMM6H    =  390,\n    CV_AMD64_YMM7H    =  391,\n    CV_AMD64_YMM8H    =  392,\n    CV_AMD64_YMM9H    =  393,\n    CV_AMD64_YMM10H   =  394,\n    CV_AMD64_YMM11H   =  395,\n    CV_AMD64_YMM12H   =  396,\n    CV_AMD64_YMM13H   =  397,\n    CV_AMD64_YMM14H   =  398,\n    CV_AMD64_YMM15H   =  399,\n\n    //Lower/upper 8 bytes of XMM registers.  Unlike CV_AMD64_XMM<regnum><H/L>, these\n    //values reprsesent the bit patterns of the registers as 64-bit integers, not\n    //the representation of these registers as a double.\n    CV_AMD64_XMM0IL    = 400,\n    CV_AMD64_XMM1IL    = 401,\n    CV_AMD64_XMM2IL    = 402,\n    CV_AMD64_XMM3IL    = 403,\n    CV_AMD64_XMM4IL    = 404,\n    CV_AMD64_XMM5IL    = 405,\n    CV_AMD64_XMM6IL    = 406,\n    CV_AMD64_XMM7IL    = 407,\n    CV_AMD64_XMM8IL    = 408,\n    CV_AMD64_XMM9IL    = 409,\n    CV_AMD64_XMM10IL    = 410,\n    CV_AMD64_XMM11IL    = 411,\n    CV_AMD64_XMM12IL    = 412,\n    CV_AMD64_XMM13IL    = 413,\n    CV_AMD64_XMM14IL    = 414,\n    CV_AMD64_XMM15IL    = 415,\n\n    CV_AMD64_XMM0IH    = 416,\n    CV_AMD64_XMM1IH    = 417,\n    CV_AMD64_XMM2IH    = 418,\n    CV_AMD64_XMM3IH    = 419,\n    CV_AMD64_XMM4IH    = 420,\n    CV_AMD64_XMM5IH    = 421,\n    CV_AMD64_XMM6IH    = 422,\n    CV_AMD64_XMM7IH    = 423,\n    CV_AMD64_XMM8IH    = 424,\n    CV_AMD64_XMM9IH    = 425,\n    CV_AMD64_XMM10IH    = 426,\n    CV_AMD64_XMM11IH    = 427,\n    CV_AMD64_XMM12IH    = 428,\n    CV_AMD64_XMM13IH    = 429,\n    CV_AMD64_XMM14IH    = 430,\n    CV_AMD64_XMM15IH    = 431,\n\n    CV_AMD64_YMM0I0    =  432,        // AVX integer registers\n    CV_AMD64_YMM0I1    =  433,\n    CV_AMD64_YMM0I2    =  434,\n    CV_AMD64_YMM0I3    =  435,\n    CV_AMD64_YMM1I0    =  436,\n    CV_AMD64_YMM1I1    =  437,\n    CV_AMD64_YMM1I2    =  438,\n    CV_AMD64_YMM1I3    =  439,\n    CV_AMD64_YMM2I0    =  440,\n    CV_AMD64_YMM2I1    =  441,\n    CV_AMD64_YMM2I2    =  442,\n    CV_AMD64_YMM2I3    =  443,\n    CV_AMD64_YMM3I0    =  444,\n    CV_AMD64_YMM3I1    =  445,\n    CV_AMD64_YMM3I2    =  446,\n    CV_AMD64_YMM3I3    =  447,\n    CV_AMD64_YMM4I0    =  448,\n    CV_AMD64_YMM4I1    =  449,\n    CV_AMD64_YMM4I2    =  450,\n    CV_AMD64_YMM4I3    =  451,\n    CV_AMD64_YMM5I0    =  452,\n    CV_AMD64_YMM5I1    =  453,\n    CV_AMD64_YMM5I2    =  454,\n    CV_AMD64_YMM5I3    =  455,\n    CV_AMD64_YMM6I0    =  456,\n    CV_AMD64_YMM6I1    =  457,\n    CV_AMD64_YMM6I2    =  458,\n    CV_AMD64_YMM6I3    =  459,\n    CV_AMD64_YMM7I0    =  460,\n    CV_AMD64_YMM7I1    =  461,\n    CV_AMD64_YMM7I2    =  462,\n    CV_AMD64_YMM7I3    =  463,\n    CV_AMD64_YMM8I0    =  464,\n    CV_AMD64_YMM8I1    =  465,\n    CV_AMD64_YMM8I2    =  466,\n    CV_AMD64_YMM8I3    =  467,\n    CV_AMD64_YMM9I0    =  468,\n    CV_AMD64_YMM9I1    =  469,\n    CV_AMD64_YMM9I2    =  470,\n    CV_AMD64_YMM9I3    =  471,\n    CV_AMD64_YMM10I0    =  472,\n    CV_AMD64_YMM10I1    =  473,\n    CV_AMD64_YMM10I2    =  474,\n    CV_AMD64_YMM10I3    =  475,\n    CV_AMD64_YMM11I0    =  476,\n    CV_AMD64_YMM11I1    =  477,\n    CV_AMD64_YMM11I2    =  478,\n    CV_AMD64_YMM11I3    =  479,\n    CV_AMD64_YMM12I0    =  480,\n    CV_AMD64_YMM12I1    =  481,\n    CV_AMD64_YMM12I2    =  482,\n    CV_AMD64_YMM12I3    =  483,\n    CV_AMD64_YMM13I0    =  484,\n    CV_AMD64_YMM13I1    =  485,\n    CV_AMD64_YMM13I2    =  486,\n    CV_AMD64_YMM13I3    =  487,\n    CV_AMD64_YMM14I0    =  488,\n    CV_AMD64_YMM14I1    =  489,\n    CV_AMD64_YMM14I2    =  490,\n    CV_AMD64_YMM14I3    =  491,\n    CV_AMD64_YMM15I0    =  492,\n    CV_AMD64_YMM15I1    =  493,\n    CV_AMD64_YMM15I2    =  494,\n    CV_AMD64_YMM15I3    =  495,\n\n    CV_AMD64_YMM0F0    =  496,        // AVX floating-point single precise registers\n    CV_AMD64_YMM0F1    =  497,\n    CV_AMD64_YMM0F2    =  498,\n    CV_AMD64_YMM0F3    =  499,\n    CV_AMD64_YMM0F4    =  500,\n    CV_AMD64_YMM0F5    =  501,\n    CV_AMD64_YMM0F6    =  502,\n    CV_AMD64_YMM0F7    =  503,\n    CV_AMD64_YMM1F0    =  504,\n    CV_AMD64_YMM1F1    =  505,\n    CV_AMD64_YMM1F2    =  506,\n    CV_AMD64_YMM1F3    =  507,\n    CV_AMD64_YMM1F4    =  508,\n    CV_AMD64_YMM1F5    =  509,\n    CV_AMD64_YMM1F6    =  510,\n    CV_AMD64_YMM1F7    =  511,\n    CV_AMD64_YMM2F0    =  512,\n    CV_AMD64_YMM2F1    =  513,\n    CV_AMD64_YMM2F2    =  514,\n    CV_AMD64_YMM2F3    =  515,\n    CV_AMD64_YMM2F4    =  516,\n    CV_AMD64_YMM2F5    =  517,\n    CV_AMD64_YMM2F6    =  518,\n    CV_AMD64_YMM2F7    =  519,\n    CV_AMD64_YMM3F0    =  520,\n    CV_AMD64_YMM3F1    =  521,\n    CV_AMD64_YMM3F2    =  522,\n    CV_AMD64_YMM3F3    =  523,\n    CV_AMD64_YMM3F4    =  524,\n    CV_AMD64_YMM3F5    =  525,\n    CV_AMD64_YMM3F6    =  526,\n    CV_AMD64_YMM3F7    =  527,\n    CV_AMD64_YMM4F0    =  528,\n    CV_AMD64_YMM4F1    =  529,\n    CV_AMD64_YMM4F2    =  530,\n    CV_AMD64_YMM4F3    =  531,\n    CV_AMD64_YMM4F4    =  532,\n    CV_AMD64_YMM4F5    =  533,\n    CV_AMD64_YMM4F6    =  534,\n    CV_AMD64_YMM4F7    =  535,\n    CV_AMD64_YMM5F0    =  536,\n    CV_AMD64_YMM5F1    =  537,\n    CV_AMD64_YMM5F2    =  538,\n    CV_AMD64_YMM5F3    =  539,\n    CV_AMD64_YMM5F4    =  540,\n    CV_AMD64_YMM5F5    =  541,\n    CV_AMD64_YMM5F6    =  542,\n    CV_AMD64_YMM5F7    =  543,\n    CV_AMD64_YMM6F0    =  544,\n    CV_AMD64_YMM6F1    =  545,\n    CV_AMD64_YMM6F2    =  546,\n    CV_AMD64_YMM6F3    =  547,\n    CV_AMD64_YMM6F4    =  548,\n    CV_AMD64_YMM6F5    =  549,\n    CV_AMD64_YMM6F6    =  550,\n    CV_AMD64_YMM6F7    =  551,\n    CV_AMD64_YMM7F0    =  552,\n    CV_AMD64_YMM7F1    =  553,\n    CV_AMD64_YMM7F2    =  554,\n    CV_AMD64_YMM7F3    =  555,\n    CV_AMD64_YMM7F4    =  556,\n    CV_AMD64_YMM7F5    =  557,\n    CV_AMD64_YMM7F6    =  558,\n    CV_AMD64_YMM7F7    =  559,\n    CV_AMD64_YMM8F0    =  560,\n    CV_AMD64_YMM8F1    =  561,\n    CV_AMD64_YMM8F2    =  562,\n    CV_AMD64_YMM8F3    =  563,\n    CV_AMD64_YMM8F4    =  564,\n    CV_AMD64_YMM8F5    =  565,\n    CV_AMD64_YMM8F6    =  566,\n    CV_AMD64_YMM8F7    =  567,\n    CV_AMD64_YMM9F0    =  568,\n    CV_AMD64_YMM9F1    =  569,\n    CV_AMD64_YMM9F2    =  570,\n    CV_AMD64_YMM9F3    =  571,\n    CV_AMD64_YMM9F4    =  572,\n    CV_AMD64_YMM9F5    =  573,\n    CV_AMD64_YMM9F6    =  574,\n    CV_AMD64_YMM9F7    =  575,\n    CV_AMD64_YMM10F0    =  576,\n    CV_AMD64_YMM10F1    =  577,\n    CV_AMD64_YMM10F2    =  578,\n    CV_AMD64_YMM10F3    =  579,\n    CV_AMD64_YMM10F4    =  580,\n    CV_AMD64_YMM10F5    =  581,\n    CV_AMD64_YMM10F6    =  582,\n    CV_AMD64_YMM10F7    =  583,\n    CV_AMD64_YMM11F0    =  584,\n    CV_AMD64_YMM11F1    =  585,\n    CV_AMD64_YMM11F2    =  586,\n    CV_AMD64_YMM11F3    =  587,\n    CV_AMD64_YMM11F4    =  588,\n    CV_AMD64_YMM11F5    =  589,\n    CV_AMD64_YMM11F6    =  590,\n    CV_AMD64_YMM11F7    =  591,\n    CV_AMD64_YMM12F0    =  592,\n    CV_AMD64_YMM12F1    =  593,\n    CV_AMD64_YMM12F2    =  594,\n    CV_AMD64_YMM12F3    =  595,\n    CV_AMD64_YMM12F4    =  596,\n    CV_AMD64_YMM12F5    =  597,\n    CV_AMD64_YMM12F6    =  598,\n    CV_AMD64_YMM12F7    =  599,\n    CV_AMD64_YMM13F0    =  600,\n    CV_AMD64_YMM13F1    =  601,\n    CV_AMD64_YMM13F2    =  602,\n    CV_AMD64_YMM13F3    =  603,\n    CV_AMD64_YMM13F4    =  604,\n    CV_AMD64_YMM13F5    =  605,\n    CV_AMD64_YMM13F6    =  606,\n    CV_AMD64_YMM13F7    =  607,\n    CV_AMD64_YMM14F0    =  608,\n    CV_AMD64_YMM14F1    =  609,\n    CV_AMD64_YMM14F2    =  610,\n    CV_AMD64_YMM14F3    =  611,\n    CV_AMD64_YMM14F4    =  612,\n    CV_AMD64_YMM14F5    =  613,\n    CV_AMD64_YMM14F6    =  614,\n    CV_AMD64_YMM14F7    =  615,\n    CV_AMD64_YMM15F0    =  616,\n    CV_AMD64_YMM15F1    =  617,\n    CV_AMD64_YMM15F2    =  618,\n    CV_AMD64_YMM15F3    =  619,\n    CV_AMD64_YMM15F4    =  620,\n    CV_AMD64_YMM15F5    =  621,\n    CV_AMD64_YMM15F6    =  622,\n    CV_AMD64_YMM15F7    =  623,\n\n    CV_AMD64_YMM0D0    =  624,        // AVX floating-point double precise registers\n    CV_AMD64_YMM0D1    =  625,\n    CV_AMD64_YMM0D2    =  626,\n    CV_AMD64_YMM0D3    =  627,\n    CV_AMD64_YMM1D0    =  628,\n    CV_AMD64_YMM1D1    =  629,\n    CV_AMD64_YMM1D2    =  630,\n    CV_AMD64_YMM1D3    =  631,\n    CV_AMD64_YMM2D0    =  632,\n    CV_AMD64_YMM2D1    =  633,\n    CV_AMD64_YMM2D2    =  634,\n    CV_AMD64_YMM2D3    =  635,\n    CV_AMD64_YMM3D0    =  636,\n    CV_AMD64_YMM3D1    =  637,\n    CV_AMD64_YMM3D2    =  638,\n    CV_AMD64_YMM3D3    =  639,\n    CV_AMD64_YMM4D0    =  640,\n    CV_AMD64_YMM4D1    =  641,\n    CV_AMD64_YMM4D2    =  642,\n    CV_AMD64_YMM4D3    =  643,\n    CV_AMD64_YMM5D0    =  644,\n    CV_AMD64_YMM5D1    =  645,\n    CV_AMD64_YMM5D2    =  646,\n    CV_AMD64_YMM5D3    =  647,\n    CV_AMD64_YMM6D0    =  648,\n    CV_AMD64_YMM6D1    =  649,\n    CV_AMD64_YMM6D2    =  650,\n    CV_AMD64_YMM6D3    =  651,\n    CV_AMD64_YMM7D0    =  652,\n    CV_AMD64_YMM7D1    =  653,\n    CV_AMD64_YMM7D2    =  654,\n    CV_AMD64_YMM7D3    =  655,\n    CV_AMD64_YMM8D0    =  656,\n    CV_AMD64_YMM8D1    =  657,\n    CV_AMD64_YMM8D2    =  658,\n    CV_AMD64_YMM8D3    =  659,\n    CV_AMD64_YMM9D0    =  660,\n    CV_AMD64_YMM9D1    =  661,\n    CV_AMD64_YMM9D2    =  662,\n    CV_AMD64_YMM9D3    =  663,\n    CV_AMD64_YMM10D0    =  664,\n    CV_AMD64_YMM10D1    =  665,\n    CV_AMD64_YMM10D2    =  666,\n    CV_AMD64_YMM10D3    =  667,\n    CV_AMD64_YMM11D0    =  668,\n    CV_AMD64_YMM11D1    =  669,\n    CV_AMD64_YMM11D2    =  670,\n    CV_AMD64_YMM11D3    =  671,\n    CV_AMD64_YMM12D0    =  672,\n    CV_AMD64_YMM12D1    =  673,\n    CV_AMD64_YMM12D2    =  674,\n    CV_AMD64_YMM12D3    =  675,\n    CV_AMD64_YMM13D0    =  676,\n    CV_AMD64_YMM13D1    =  677,\n    CV_AMD64_YMM13D2    =  678,\n    CV_AMD64_YMM13D3    =  679,\n    CV_AMD64_YMM14D0    =  680,\n    CV_AMD64_YMM14D1    =  681,\n    CV_AMD64_YMM14D2    =  682,\n    CV_AMD64_YMM14D3    =  683,\n    CV_AMD64_YMM15D0    =  684,\n    CV_AMD64_YMM15D1    =  685,\n    CV_AMD64_YMM15D2    =  686,\n    CV_AMD64_YMM15D3    =  687\n\n\n    // Note:  Next set of platform registers need to go into a new enum...\n    // this one is above 44K now.\n\n} CV_HREG_e;\n\ntypedef enum CV_HLSLREG_e {\n    CV_HLSLREG_TEMP                                = 0,\n    CV_HLSLREG_INPUT                               = 1,\n    CV_HLSLREG_OUTPUT                              = 2,\n    CV_HLSLREG_INDEXABLE_TEMP                      = 3,\n    CV_HLSLREG_IMMEDIATE32                         = 4,\n    CV_HLSLREG_IMMEDIATE64                         = 5,\n    CV_HLSLREG_SAMPLER                             = 6,\n    CV_HLSLREG_RESOURCE                            = 7,\n    CV_HLSLREG_CONSTANT_BUFFER                     = 8,\n    CV_HLSLREG_IMMEDIATE_CONSTANT_BUFFER           = 9,\n    CV_HLSLREG_LABEL                               = 10,\n    CV_HLSLREG_INPUT_PRIMITIVEID                   = 11,\n    CV_HLSLREG_OUTPUT_DEPTH                        = 12,\n    CV_HLSLREG_NULL                                = 13,\n    CV_HLSLREG_RASTERIZER                          = 14,\n    CV_HLSLREG_OUTPUT_COVERAGE_MASK                = 15,\n    CV_HLSLREG_STREAM                              = 16,\n    CV_HLSLREG_FUNCTION_BODY                       = 17,\n    CV_HLSLREG_FUNCTION_TABLE                      = 18,\n    CV_HLSLREG_INTERFACE                           = 19,\n    CV_HLSLREG_FUNCTION_INPUT                      = 20,\n    CV_HLSLREG_FUNCTION_OUTPUT                     = 21,\n    CV_HLSLREG_OUTPUT_CONTROL_POINT_ID             = 22,\n    CV_HLSLREG_INPUT_FORK_INSTANCE_ID              = 23,\n    CV_HLSLREG_INPUT_JOIN_INSTANCE_ID              = 24,\n    CV_HLSLREG_INPUT_CONTROL_POINT                 = 25,\n    CV_HLSLREG_OUTPUT_CONTROL_POINT                = 26,\n    CV_HLSLREG_INPUT_PATCH_CONSTANT                = 27,\n    CV_HLSLREG_INPUT_DOMAIN_POINT                  = 28,\n    CV_HLSLREG_THIS_POINTER                        = 29,\n    CV_HLSLREG_UNORDERED_ACCESS_VIEW               = 30,\n    CV_HLSLREG_THREAD_GROUP_SHARED_MEMORY          = 31,\n    CV_HLSLREG_INPUT_THREAD_ID                     = 32,\n    CV_HLSLREG_INPUT_THREAD_GROUP_ID               = 33,\n    CV_HLSLREG_INPUT_THREAD_ID_IN_GROUP            = 34,\n    CV_HLSLREG_INPUT_COVERAGE_MASK                 = 35,\n    CV_HLSLREG_INPUT_THREAD_ID_IN_GROUP_FLATTENED  = 36,\n    CV_HLSLREG_INPUT_GS_INSTANCE_ID                = 37,\n    CV_HLSLREG_OUTPUT_DEPTH_GREATER_EQUAL          = 38,\n    CV_HLSLREG_OUTPUT_DEPTH_LESS_EQUAL             = 39,\n    CV_HLSLREG_CYCLE_COUNTER                       = 40,\n} CV_HLSLREG_e;\n\nenum StackFrameTypeEnum\n{\n    FrameTypeFPO,                   // Frame pointer omitted, FPO info available\n    FrameTypeTrap,                  // Kernel Trap frame\n    FrameTypeTSS,                   // Kernel Trap frame\n    FrameTypeStandard,              // Standard EBP stackframe\n    FrameTypeFrameData,             // Frame pointer omitted, FrameData info available\n\n    FrameTypeUnknown = -1,          // Frame which does not have any debug info\n};\n\nenum MemoryTypeEnum\n{\n    MemTypeCode,                    // Read only code memory\n    MemTypeData,                    // Read only data/stack memory\n    MemTypeStack,                   // Read only stack memory\n    MemTypeCodeOnHeap,              // Read only memory for code generated on heap by runtime\n\n    MemTypeAny = -1,\n};\n\ntypedef enum CV_HLSLMemorySpace_e\n{\n    // HLSL specific memory spaces\n\n    CV_HLSL_MEMSPACE_DATA         = 0x00,\n    CV_HLSL_MEMSPACE_SAMPLER      = 0x01,\n    CV_HLSL_MEMSPACE_RESOURCE     = 0x02,\n    CV_HLSL_MEMSPACE_RWRESOURCE   = 0x03,\n\n    CV_HLSL_MEMSPACE_MAX          = 0x0F,\n} CV_HLSLMemorySpace_e;\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cvinfo.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/***    cvinfo.h - Generic CodeView information definitions\n *\n *      Structures, constants, etc. for accessing and interpreting\n *      CodeView information.\n *\n */\n\n\n/***    The master copy of this file resides in the langapi project.\n *      All Microsoft projects are required to use the master copy without\n *      modification.  Modification of the master version or a copy\n *      without consultation with all parties concerned is extremely\n *      risky.\n *\n */\n\n#pragma once\n\n#include \"cvconst.h\"\n\n#ifndef _CV_INFO_INCLUDED\n#define _CV_INFO_INCLUDED\n\n#ifdef  __cplusplus\n#pragma warning ( disable: 4200 )\n#endif\n\n#ifndef __INLINE\n#ifdef  __cplusplus\n#define __INLINE inline\n#else\n#define __INLINE __inline\n#endif\n#endif\n\n#pragma pack ( push, 1 )\ntypedef unsigned long   CV_uoff32_t;\ntypedef          long   CV_off32_t;\ntypedef unsigned short  CV_uoff16_t;\ntypedef          short  CV_off16_t;\ntypedef unsigned short  CV_typ16_t;\ntypedef unsigned long   CV_typ_t;\ntypedef unsigned long   CV_pubsymflag_t;    // must be same as CV_typ_t.\ntypedef unsigned short  _2BYTEPAD;\ntypedef unsigned long   CV_tkn_t;\n\n#if !defined (CV_ZEROLEN)\n#define CV_ZEROLEN\n#endif\n\n#if !defined (FLOAT10)\n#if defined(_M_I86)                    // 16 bit x86 supporting long double\ntypedef long double FLOAT10;\n#else                                  // 32 bit w/o long double support\ntypedef struct FLOAT10\n{\n    char b[10];\n} FLOAT10;\n#endif\n#endif\n\n\n#define CV_SIGNATURE_C6         0L  // Actual signature is >64K\n#define CV_SIGNATURE_C7         1L  // First explicit signature\n#define CV_SIGNATURE_C11        2L  // C11 (vc5.x) 32-bit types\n#define CV_SIGNATURE_C13        4L  // C13 (vc7.x) zero terminated names\n#define CV_SIGNATURE_RESERVED   5L  // All signatures from 5 to 64K are reserved\n\n#define CV_MAXOFFSET   0xffffffff\n\n#ifndef GUID_DEFINED\n#define GUID_DEFINED\n\ntypedef struct _GUID {          // size is 16\n    unsigned long   Data1;\n    unsigned short  Data2;\n    unsigned short  Data3;\n    unsigned char   Data4[8];\n} GUID;\n\n#endif // !GUID_DEFINED\n\ntypedef GUID            SIG70;      // new to 7.0 are 16-byte guid-like signatures\ntypedef SIG70 *         PSIG70;\ntypedef const SIG70 *   PCSIG70;\n\n\n\n/**     CodeView Symbol and Type OMF type information is broken up into two\n *      ranges.  Type indices less than 0x1000 describe type information\n *      that is frequently used.  Type indices above 0x1000 are used to\n *      describe more complex features such as functions, arrays and\n *      structures.\n */\n\n\n\n\n/**     Primitive types have predefined meaning that is encoded in the\n *      values of the various bit fields in the value.\n *\n *      A CodeView primitive type is defined as:\n *\n *      1 1\n *      1 089  7654  3  210\n *      r mode type  r  sub\n *\n *      Where\n *          mode is the pointer mode\n *          type is a type indicator\n *          sub  is a subtype enumeration\n *          r    is a reserved field\n *\n *      See Microsoft Symbol and Type OMF (Version 4.0) for more\n *      information.\n */\n\n\n#define CV_MMASK        0x700       // mode mask\n#define CV_TMASK        0x0f0       // type mask\n\n// can we use the reserved bit ??\n#define CV_SMASK        0x00f       // subtype mask\n\n#define CV_MSHIFT       8           // primitive mode right shift count\n#define CV_TSHIFT       4           // primitive type right shift count\n#define CV_SSHIFT       0           // primitive subtype right shift count\n\n// macros to extract primitive mode, type and size\n\n#define CV_MODE(typ)    (((typ) & CV_MMASK) >> CV_MSHIFT)\n#define CV_TYPE(typ)    (((typ) & CV_TMASK) >> CV_TSHIFT)\n#define CV_SUBT(typ)    (((typ) & CV_SMASK) >> CV_SSHIFT)\n\n// macros to insert new primitive mode, type and size\n\n#define CV_NEWMODE(typ, nm)     ((CV_typ_t)(((typ) & ~CV_MMASK) | ((nm) << CV_MSHIFT)))\n#define CV_NEWTYPE(typ, nt)     (((typ) & ~CV_TMASK) | ((nt) << CV_TSHIFT))\n#define CV_NEWSUBT(typ, ns)     (((typ) & ~CV_SMASK) | ((ns) << CV_SSHIFT))\n\n\n\n//     pointer mode enumeration values\n\ntypedef enum CV_prmode_e {\n    CV_TM_DIRECT = 0,       // mode is not a pointer\n    CV_TM_NPTR   = 1,       // mode is a near pointer\n    CV_TM_FPTR   = 2,       // mode is a far pointer\n    CV_TM_HPTR   = 3,       // mode is a huge pointer\n    CV_TM_NPTR32 = 4,       // mode is a 32 bit near pointer\n    CV_TM_FPTR32 = 5,       // mode is a 32 bit far pointer\n    CV_TM_NPTR64 = 6,       // mode is a 64 bit near pointer\n    CV_TM_NPTR128 = 7,      // mode is a 128 bit near pointer\n} CV_prmode_e;\n\n\n\n\n//      type enumeration values\n\n\ntypedef enum CV_type_e {\n    CV_SPECIAL      = 0x00,         // special type size values\n    CV_SIGNED       = 0x01,         // signed integral size values\n    CV_UNSIGNED     = 0x02,         // unsigned integral size values\n    CV_BOOLEAN      = 0x03,         // Boolean size values\n    CV_REAL         = 0x04,         // real number size values\n    CV_COMPLEX      = 0x05,         // complex number size values\n    CV_SPECIAL2     = 0x06,         // second set of special types\n    CV_INT          = 0x07,         // integral (int) values\n    CV_CVRESERVED   = 0x0f,\n} CV_type_e;\n\n\n\n\n//      subtype enumeration values for CV_SPECIAL\n\n\ntypedef enum CV_special_e {\n    CV_SP_NOTYPE    = 0x00,\n    CV_SP_ABS       = 0x01,\n    CV_SP_SEGMENT   = 0x02,\n    CV_SP_VOID      = 0x03,\n    CV_SP_CURRENCY  = 0x04,\n    CV_SP_NBASICSTR = 0x05,\n    CV_SP_FBASICSTR = 0x06,\n    CV_SP_NOTTRANS  = 0x07,\n    CV_SP_HRESULT   = 0x08,\n} CV_special_e;\n\n\n\n\n//      subtype enumeration values for CV_SPECIAL2\n\n\ntypedef enum CV_special2_e {\n    CV_S2_BIT       = 0x00,\n    CV_S2_PASCHAR   = 0x01,         // Pascal CHAR\n    CV_S2_BOOL32FF  = 0x02,         // 32-bit BOOL where true is 0xffffffff\n} CV_special2_e;\n\n\n\n\n\n//      subtype enumeration values for CV_SIGNED, CV_UNSIGNED and CV_BOOLEAN\n\n\ntypedef enum CV_integral_e {\n    CV_IN_1BYTE     = 0x00,\n    CV_IN_2BYTE     = 0x01,\n    CV_IN_4BYTE     = 0x02,\n    CV_IN_8BYTE     = 0x03,\n    CV_IN_16BYTE    = 0x04\n} CV_integral_e;\n\n\n\n\n\n//      subtype enumeration values for CV_REAL and CV_COMPLEX\n\n\ntypedef enum CV_real_e {\n    CV_RC_REAL32    = 0x00,\n    CV_RC_REAL64    = 0x01,\n    CV_RC_REAL80    = 0x02,\n    CV_RC_REAL128   = 0x03,\n    CV_RC_REAL48    = 0x04,\n    CV_RC_REAL32PP  = 0x05,   // 32-bit partial precision real\n    CV_RC_REAL16    = 0x06,\n} CV_real_e;\n\n\n\n\n//      subtype enumeration values for CV_INT (really int)\n\n\ntypedef enum CV_int_e {\n    CV_RI_CHAR      = 0x00,\n    CV_RI_INT1      = 0x00,\n    CV_RI_WCHAR     = 0x01,\n    CV_RI_UINT1     = 0x01,\n    CV_RI_INT2      = 0x02,\n    CV_RI_UINT2     = 0x03,\n    CV_RI_INT4      = 0x04,\n    CV_RI_UINT4     = 0x05,\n    CV_RI_INT8      = 0x06,\n    CV_RI_UINT8     = 0x07,\n    CV_RI_INT16     = 0x08,\n    CV_RI_UINT16    = 0x09,\n    CV_RI_CHAR16    = 0x0a,  // char16_t\n    CV_RI_CHAR32    = 0x0b,  // char32_t\n} CV_int_e;\n\n\n\n// macros to check the type of a primitive\n\n#define CV_TYP_IS_DIRECT(typ)   (CV_MODE(typ) == CV_TM_DIRECT)\n#define CV_TYP_IS_PTR(typ)      (CV_MODE(typ) != CV_TM_DIRECT)\n#define CV_TYP_IS_NPTR(typ)     (CV_MODE(typ) == CV_TM_NPTR)\n#define CV_TYP_IS_FPTR(typ)     (CV_MODE(typ) == CV_TM_FPTR)\n#define CV_TYP_IS_HPTR(typ)     (CV_MODE(typ) == CV_TM_HPTR)\n#define CV_TYP_IS_NPTR32(typ)   (CV_MODE(typ) == CV_TM_NPTR32)\n#define CV_TYP_IS_FPTR32(typ)   (CV_MODE(typ) == CV_TM_FPTR32)\n\n#define CV_TYP_IS_SIGNED(typ)   (((CV_TYPE(typ) == CV_SIGNED) && CV_TYP_IS_DIRECT(typ)) || \\\n                                 (typ == T_INT1)  || \\\n                                 (typ == T_INT2)  || \\\n                                 (typ == T_INT4)  || \\\n                                 (typ == T_INT8)  || \\\n                                 (typ == T_INT16) || \\\n                                 (typ == T_RCHAR))\n\n#define CV_TYP_IS_UNSIGNED(typ) (((CV_TYPE(typ) == CV_UNSIGNED) && CV_TYP_IS_DIRECT(typ)) || \\\n                                 (typ == T_UINT1) || \\\n                                 (typ == T_UINT2) || \\\n                                 (typ == T_UINT4) || \\\n                                 (typ == T_UINT8) || \\\n                                 (typ == T_UINT16))\n\n#define CV_TYP_IS_REAL(typ)     ((CV_TYPE(typ) == CV_REAL)  && CV_TYP_IS_DIRECT(typ))\n\n#define CV_FIRST_NONPRIM 0x1000\n#define CV_IS_PRIMITIVE(typ)    ((typ) < CV_FIRST_NONPRIM)\n#define CV_TYP_IS_COMPLEX(typ)  ((CV_TYPE(typ) == CV_COMPLEX)   && CV_TYP_IS_DIRECT(typ))\n#define CV_IS_INTERNAL_PTR(typ) (CV_IS_PRIMITIVE(typ) && \\\n                                 CV_TYPE(typ) == CV_CVRESERVED && \\\n                                 CV_TYP_IS_PTR(typ))\n\n\n\n\n\n\n// selected values for type_index - for a more complete definition, see\n// Microsoft Symbol and Type OMF document\n\n\n\n\n//      Special Types\n\ntypedef enum TYPE_ENUM_e {\n//      Special Types\n\n    T_NOTYPE        = 0x0000,   // uncharacterized type (no type)\n    T_ABS           = 0x0001,   // absolute symbol\n    T_SEGMENT       = 0x0002,   // segment type\n    T_VOID          = 0x0003,   // void\n    T_HRESULT       = 0x0008,   // OLE/COM HRESULT\n    T_32PHRESULT    = 0x0408,   // OLE/COM HRESULT __ptr32 *\n    T_64PHRESULT    = 0x0608,   // OLE/COM HRESULT __ptr64 *\n\n    T_PVOID         = 0x0103,   // near pointer to void\n    T_PFVOID        = 0x0203,   // far pointer to void\n    T_PHVOID        = 0x0303,   // huge pointer to void\n    T_32PVOID       = 0x0403,   // 32 bit pointer to void\n    T_32PFVOID      = 0x0503,   // 16:32 pointer to void\n    T_64PVOID       = 0x0603,   // 64 bit pointer to void\n    T_CURRENCY      = 0x0004,   // BASIC 8 byte currency value\n    T_NBASICSTR     = 0x0005,   // Near BASIC string\n    T_FBASICSTR     = 0x0006,   // Far BASIC string\n    T_NOTTRANS      = 0x0007,   // type not translated by cvpack\n    T_BIT           = 0x0060,   // bit\n    T_PASCHAR       = 0x0061,   // Pascal CHAR\n    T_BOOL32FF      = 0x0062,   // 32-bit BOOL where true is 0xffffffff\n\n\n//      Character types\n\n    T_CHAR          = 0x0010,   // 8 bit signed\n    T_PCHAR         = 0x0110,   // 16 bit pointer to 8 bit signed\n    T_PFCHAR        = 0x0210,   // 16:16 far pointer to 8 bit signed\n    T_PHCHAR        = 0x0310,   // 16:16 huge pointer to 8 bit signed\n    T_32PCHAR       = 0x0410,   // 32 bit pointer to 8 bit signed\n    T_32PFCHAR      = 0x0510,   // 16:32 pointer to 8 bit signed\n    T_64PCHAR       = 0x0610,   // 64 bit pointer to 8 bit signed\n\n    T_UCHAR         = 0x0020,   // 8 bit unsigned\n    T_PUCHAR        = 0x0120,   // 16 bit pointer to 8 bit unsigned\n    T_PFUCHAR       = 0x0220,   // 16:16 far pointer to 8 bit unsigned\n    T_PHUCHAR       = 0x0320,   // 16:16 huge pointer to 8 bit unsigned\n    T_32PUCHAR      = 0x0420,   // 32 bit pointer to 8 bit unsigned\n    T_32PFUCHAR     = 0x0520,   // 16:32 pointer to 8 bit unsigned\n    T_64PUCHAR      = 0x0620,   // 64 bit pointer to 8 bit unsigned\n\n\n//      really a character types\n\n    T_RCHAR         = 0x0070,   // really a char\n    T_PRCHAR        = 0x0170,   // 16 bit pointer to a real char\n    T_PFRCHAR       = 0x0270,   // 16:16 far pointer to a real char\n    T_PHRCHAR       = 0x0370,   // 16:16 huge pointer to a real char\n    T_32PRCHAR      = 0x0470,   // 32 bit pointer to a real char\n    T_32PFRCHAR     = 0x0570,   // 16:32 pointer to a real char\n    T_64PRCHAR      = 0x0670,   // 64 bit pointer to a real char\n\n\n//      really a wide character types\n\n    T_WCHAR         = 0x0071,   // wide char\n    T_PWCHAR        = 0x0171,   // 16 bit pointer to a wide char\n    T_PFWCHAR       = 0x0271,   // 16:16 far pointer to a wide char\n    T_PHWCHAR       = 0x0371,   // 16:16 huge pointer to a wide char\n    T_32PWCHAR      = 0x0471,   // 32 bit pointer to a wide char\n    T_32PFWCHAR     = 0x0571,   // 16:32 pointer to a wide char\n    T_64PWCHAR      = 0x0671,   // 64 bit pointer to a wide char\n\n//      really a 16-bit unicode char\n\n    T_CHAR16         = 0x007a,   // 16-bit unicode char\n    T_PCHAR16        = 0x017a,   // 16 bit pointer to a 16-bit unicode char\n    T_PFCHAR16       = 0x027a,   // 16:16 far pointer to a 16-bit unicode char\n    T_PHCHAR16       = 0x037a,   // 16:16 huge pointer to a 16-bit unicode char\n    T_32PCHAR16      = 0x047a,   // 32 bit pointer to a 16-bit unicode char\n    T_32PFCHAR16     = 0x057a,   // 16:32 pointer to a 16-bit unicode char\n    T_64PCHAR16      = 0x067a,   // 64 bit pointer to a 16-bit unicode char\n\n//      really a 32-bit unicode char\n\n    T_CHAR32         = 0x007b,   // 32-bit unicode char\n    T_PCHAR32        = 0x017b,   // 16 bit pointer to a 32-bit unicode char\n    T_PFCHAR32       = 0x027b,   // 16:16 far pointer to a 32-bit unicode char\n    T_PHCHAR32       = 0x037b,   // 16:16 huge pointer to a 32-bit unicode char\n    T_32PCHAR32      = 0x047b,   // 32 bit pointer to a 32-bit unicode char\n    T_32PFCHAR32     = 0x057b,   // 16:32 pointer to a 32-bit unicode char\n    T_64PCHAR32      = 0x067b,   // 64 bit pointer to a 32-bit unicode char\n\n//      8 bit int types\n\n    T_INT1          = 0x0068,   // 8 bit signed int\n    T_PINT1         = 0x0168,   // 16 bit pointer to 8 bit signed int\n    T_PFINT1        = 0x0268,   // 16:16 far pointer to 8 bit signed int\n    T_PHINT1        = 0x0368,   // 16:16 huge pointer to 8 bit signed int\n    T_32PINT1       = 0x0468,   // 32 bit pointer to 8 bit signed int\n    T_32PFINT1      = 0x0568,   // 16:32 pointer to 8 bit signed int\n    T_64PINT1       = 0x0668,   // 64 bit pointer to 8 bit signed int\n\n    T_UINT1         = 0x0069,   // 8 bit unsigned int\n    T_PUINT1        = 0x0169,   // 16 bit pointer to 8 bit unsigned int\n    T_PFUINT1       = 0x0269,   // 16:16 far pointer to 8 bit unsigned int\n    T_PHUINT1       = 0x0369,   // 16:16 huge pointer to 8 bit unsigned int\n    T_32PUINT1      = 0x0469,   // 32 bit pointer to 8 bit unsigned int\n    T_32PFUINT1     = 0x0569,   // 16:32 pointer to 8 bit unsigned int\n    T_64PUINT1      = 0x0669,   // 64 bit pointer to 8 bit unsigned int\n\n\n//      16 bit short types\n\n    T_SHORT         = 0x0011,   // 16 bit signed\n    T_PSHORT        = 0x0111,   // 16 bit pointer to 16 bit signed\n    T_PFSHORT       = 0x0211,   // 16:16 far pointer to 16 bit signed\n    T_PHSHORT       = 0x0311,   // 16:16 huge pointer to 16 bit signed\n    T_32PSHORT      = 0x0411,   // 32 bit pointer to 16 bit signed\n    T_32PFSHORT     = 0x0511,   // 16:32 pointer to 16 bit signed\n    T_64PSHORT      = 0x0611,   // 64 bit pointer to 16 bit signed\n\n    T_USHORT        = 0x0021,   // 16 bit unsigned\n    T_PUSHORT       = 0x0121,   // 16 bit pointer to 16 bit unsigned\n    T_PFUSHORT      = 0x0221,   // 16:16 far pointer to 16 bit unsigned\n    T_PHUSHORT      = 0x0321,   // 16:16 huge pointer to 16 bit unsigned\n    T_32PUSHORT     = 0x0421,   // 32 bit pointer to 16 bit unsigned\n    T_32PFUSHORT    = 0x0521,   // 16:32 pointer to 16 bit unsigned\n    T_64PUSHORT     = 0x0621,   // 64 bit pointer to 16 bit unsigned\n\n\n//      16 bit int types\n\n    T_INT2          = 0x0072,   // 16 bit signed int\n    T_PINT2         = 0x0172,   // 16 bit pointer to 16 bit signed int\n    T_PFINT2        = 0x0272,   // 16:16 far pointer to 16 bit signed int\n    T_PHINT2        = 0x0372,   // 16:16 huge pointer to 16 bit signed int\n    T_32PINT2       = 0x0472,   // 32 bit pointer to 16 bit signed int\n    T_32PFINT2      = 0x0572,   // 16:32 pointer to 16 bit signed int\n    T_64PINT2       = 0x0672,   // 64 bit pointer to 16 bit signed int\n\n    T_UINT2         = 0x0073,   // 16 bit unsigned int\n    T_PUINT2        = 0x0173,   // 16 bit pointer to 16 bit unsigned int\n    T_PFUINT2       = 0x0273,   // 16:16 far pointer to 16 bit unsigned int\n    T_PHUINT2       = 0x0373,   // 16:16 huge pointer to 16 bit unsigned int\n    T_32PUINT2      = 0x0473,   // 32 bit pointer to 16 bit unsigned int\n    T_32PFUINT2     = 0x0573,   // 16:32 pointer to 16 bit unsigned int\n    T_64PUINT2      = 0x0673,   // 64 bit pointer to 16 bit unsigned int\n\n\n//      32 bit long types\n\n    T_LONG          = 0x0012,   // 32 bit signed\n    T_ULONG         = 0x0022,   // 32 bit unsigned\n    T_PLONG         = 0x0112,   // 16 bit pointer to 32 bit signed\n    T_PULONG        = 0x0122,   // 16 bit pointer to 32 bit unsigned\n    T_PFLONG        = 0x0212,   // 16:16 far pointer to 32 bit signed\n    T_PFULONG       = 0x0222,   // 16:16 far pointer to 32 bit unsigned\n    T_PHLONG        = 0x0312,   // 16:16 huge pointer to 32 bit signed\n    T_PHULONG       = 0x0322,   // 16:16 huge pointer to 32 bit unsigned\n\n    T_32PLONG       = 0x0412,   // 32 bit pointer to 32 bit signed\n    T_32PULONG      = 0x0422,   // 32 bit pointer to 32 bit unsigned\n    T_32PFLONG      = 0x0512,   // 16:32 pointer to 32 bit signed\n    T_32PFULONG     = 0x0522,   // 16:32 pointer to 32 bit unsigned\n    T_64PLONG       = 0x0612,   // 64 bit pointer to 32 bit signed\n    T_64PULONG      = 0x0622,   // 64 bit pointer to 32 bit unsigned\n\n\n//      32 bit int types\n\n    T_INT4          = 0x0074,   // 32 bit signed int\n    T_PINT4         = 0x0174,   // 16 bit pointer to 32 bit signed int\n    T_PFINT4        = 0x0274,   // 16:16 far pointer to 32 bit signed int\n    T_PHINT4        = 0x0374,   // 16:16 huge pointer to 32 bit signed int\n    T_32PINT4       = 0x0474,   // 32 bit pointer to 32 bit signed int\n    T_32PFINT4      = 0x0574,   // 16:32 pointer to 32 bit signed int\n    T_64PINT4       = 0x0674,   // 64 bit pointer to 32 bit signed int\n\n    T_UINT4         = 0x0075,   // 32 bit unsigned int\n    T_PUINT4        = 0x0175,   // 16 bit pointer to 32 bit unsigned int\n    T_PFUINT4       = 0x0275,   // 16:16 far pointer to 32 bit unsigned int\n    T_PHUINT4       = 0x0375,   // 16:16 huge pointer to 32 bit unsigned int\n    T_32PUINT4      = 0x0475,   // 32 bit pointer to 32 bit unsigned int\n    T_32PFUINT4     = 0x0575,   // 16:32 pointer to 32 bit unsigned int\n    T_64PUINT4      = 0x0675,   // 64 bit pointer to 32 bit unsigned int\n\n\n//      64 bit quad types\n\n    T_QUAD          = 0x0013,   // 64 bit signed\n    T_PQUAD         = 0x0113,   // 16 bit pointer to 64 bit signed\n    T_PFQUAD        = 0x0213,   // 16:16 far pointer to 64 bit signed\n    T_PHQUAD        = 0x0313,   // 16:16 huge pointer to 64 bit signed\n    T_32PQUAD       = 0x0413,   // 32 bit pointer to 64 bit signed\n    T_32PFQUAD      = 0x0513,   // 16:32 pointer to 64 bit signed\n    T_64PQUAD       = 0x0613,   // 64 bit pointer to 64 bit signed\n\n    T_UQUAD         = 0x0023,   // 64 bit unsigned\n    T_PUQUAD        = 0x0123,   // 16 bit pointer to 64 bit unsigned\n    T_PFUQUAD       = 0x0223,   // 16:16 far pointer to 64 bit unsigned\n    T_PHUQUAD       = 0x0323,   // 16:16 huge pointer to 64 bit unsigned\n    T_32PUQUAD      = 0x0423,   // 32 bit pointer to 64 bit unsigned\n    T_32PFUQUAD     = 0x0523,   // 16:32 pointer to 64 bit unsigned\n    T_64PUQUAD      = 0x0623,   // 64 bit pointer to 64 bit unsigned\n\n\n//      64 bit int types\n\n    T_INT8          = 0x0076,   // 64 bit signed int\n    T_PINT8         = 0x0176,   // 16 bit pointer to 64 bit signed int\n    T_PFINT8        = 0x0276,   // 16:16 far pointer to 64 bit signed int\n    T_PHINT8        = 0x0376,   // 16:16 huge pointer to 64 bit signed int\n    T_32PINT8       = 0x0476,   // 32 bit pointer to 64 bit signed int\n    T_32PFINT8      = 0x0576,   // 16:32 pointer to 64 bit signed int\n    T_64PINT8       = 0x0676,   // 64 bit pointer to 64 bit signed int\n\n    T_UINT8         = 0x0077,   // 64 bit unsigned int\n    T_PUINT8        = 0x0177,   // 16 bit pointer to 64 bit unsigned int\n    T_PFUINT8       = 0x0277,   // 16:16 far pointer to 64 bit unsigned int\n    T_PHUINT8       = 0x0377,   // 16:16 huge pointer to 64 bit unsigned int\n    T_32PUINT8      = 0x0477,   // 32 bit pointer to 64 bit unsigned int\n    T_32PFUINT8     = 0x0577,   // 16:32 pointer to 64 bit unsigned int\n    T_64PUINT8      = 0x0677,   // 64 bit pointer to 64 bit unsigned int\n\n\n//      128 bit octet types\n\n    T_OCT           = 0x0014,   // 128 bit signed\n    T_POCT          = 0x0114,   // 16 bit pointer to 128 bit signed\n    T_PFOCT         = 0x0214,   // 16:16 far pointer to 128 bit signed\n    T_PHOCT         = 0x0314,   // 16:16 huge pointer to 128 bit signed\n    T_32POCT        = 0x0414,   // 32 bit pointer to 128 bit signed\n    T_32PFOCT       = 0x0514,   // 16:32 pointer to 128 bit signed\n    T_64POCT        = 0x0614,   // 64 bit pointer to 128 bit signed\n\n    T_UOCT          = 0x0024,   // 128 bit unsigned\n    T_PUOCT         = 0x0124,   // 16 bit pointer to 128 bit unsigned\n    T_PFUOCT        = 0x0224,   // 16:16 far pointer to 128 bit unsigned\n    T_PHUOCT        = 0x0324,   // 16:16 huge pointer to 128 bit unsigned\n    T_32PUOCT       = 0x0424,   // 32 bit pointer to 128 bit unsigned\n    T_32PFUOCT      = 0x0524,   // 16:32 pointer to 128 bit unsigned\n    T_64PUOCT       = 0x0624,   // 64 bit pointer to 128 bit unsigned\n\n\n//      128 bit int types\n\n    T_INT16         = 0x0078,   // 128 bit signed int\n    T_PINT16        = 0x0178,   // 16 bit pointer to 128 bit signed int\n    T_PFINT16       = 0x0278,   // 16:16 far pointer to 128 bit signed int\n    T_PHINT16       = 0x0378,   // 16:16 huge pointer to 128 bit signed int\n    T_32PINT16      = 0x0478,   // 32 bit pointer to 128 bit signed int\n    T_32PFINT16     = 0x0578,   // 16:32 pointer to 128 bit signed int\n    T_64PINT16      = 0x0678,   // 64 bit pointer to 128 bit signed int\n\n    T_UINT16        = 0x0079,   // 128 bit unsigned int\n    T_PUINT16       = 0x0179,   // 16 bit pointer to 128 bit unsigned int\n    T_PFUINT16      = 0x0279,   // 16:16 far pointer to 128 bit unsigned int\n    T_PHUINT16      = 0x0379,   // 16:16 huge pointer to 128 bit unsigned int\n    T_32PUINT16     = 0x0479,   // 32 bit pointer to 128 bit unsigned int\n    T_32PFUINT16    = 0x0579,   // 16:32 pointer to 128 bit unsigned int\n    T_64PUINT16     = 0x0679,   // 64 bit pointer to 128 bit unsigned int\n\n\n//      16 bit real types\n\n    T_REAL16        = 0x0046,   // 16 bit real\n    T_PREAL16       = 0x0146,   // 16 bit pointer to 16 bit real\n    T_PFREAL16      = 0x0246,   // 16:16 far pointer to 16 bit real\n    T_PHREAL16      = 0x0346,   // 16:16 huge pointer to 16 bit real\n    T_32PREAL16     = 0x0446,   // 32 bit pointer to 16 bit real\n    T_32PFREAL16    = 0x0546,   // 16:32 pointer to 16 bit real\n    T_64PREAL16     = 0x0646,   // 64 bit pointer to 16 bit real\n\n\n//      32 bit real types\n\n    T_REAL32        = 0x0040,   // 32 bit real\n    T_PREAL32       = 0x0140,   // 16 bit pointer to 32 bit real\n    T_PFREAL32      = 0x0240,   // 16:16 far pointer to 32 bit real\n    T_PHREAL32      = 0x0340,   // 16:16 huge pointer to 32 bit real\n    T_32PREAL32     = 0x0440,   // 32 bit pointer to 32 bit real\n    T_32PFREAL32    = 0x0540,   // 16:32 pointer to 32 bit real\n    T_64PREAL32     = 0x0640,   // 64 bit pointer to 32 bit real\n\n\n//      32 bit partial-precision real types\n\n    T_REAL32PP      = 0x0045,   // 32 bit PP real\n    T_PREAL32PP     = 0x0145,   // 16 bit pointer to 32 bit PP real\n    T_PFREAL32PP    = 0x0245,   // 16:16 far pointer to 32 bit PP real\n    T_PHREAL32PP    = 0x0345,   // 16:16 huge pointer to 32 bit PP real\n    T_32PREAL32PP   = 0x0445,   // 32 bit pointer to 32 bit PP real\n    T_32PFREAL32PP  = 0x0545,   // 16:32 pointer to 32 bit PP real\n    T_64PREAL32PP   = 0x0645,   // 64 bit pointer to 32 bit PP real\n\n\n//      48 bit real types\n\n    T_REAL48        = 0x0044,   // 48 bit real\n    T_PREAL48       = 0x0144,   // 16 bit pointer to 48 bit real\n    T_PFREAL48      = 0x0244,   // 16:16 far pointer to 48 bit real\n    T_PHREAL48      = 0x0344,   // 16:16 huge pointer to 48 bit real\n    T_32PREAL48     = 0x0444,   // 32 bit pointer to 48 bit real\n    T_32PFREAL48    = 0x0544,   // 16:32 pointer to 48 bit real\n    T_64PREAL48     = 0x0644,   // 64 bit pointer to 48 bit real\n\n\n//      64 bit real types\n\n    T_REAL64        = 0x0041,   // 64 bit real\n    T_PREAL64       = 0x0141,   // 16 bit pointer to 64 bit real\n    T_PFREAL64      = 0x0241,   // 16:16 far pointer to 64 bit real\n    T_PHREAL64      = 0x0341,   // 16:16 huge pointer to 64 bit real\n    T_32PREAL64     = 0x0441,   // 32 bit pointer to 64 bit real\n    T_32PFREAL64    = 0x0541,   // 16:32 pointer to 64 bit real\n    T_64PREAL64     = 0x0641,   // 64 bit pointer to 64 bit real\n\n\n//      80 bit real types\n\n    T_REAL80        = 0x0042,   // 80 bit real\n    T_PREAL80       = 0x0142,   // 16 bit pointer to 80 bit real\n    T_PFREAL80      = 0x0242,   // 16:16 far pointer to 80 bit real\n    T_PHREAL80      = 0x0342,   // 16:16 huge pointer to 80 bit real\n    T_32PREAL80     = 0x0442,   // 32 bit pointer to 80 bit real\n    T_32PFREAL80    = 0x0542,   // 16:32 pointer to 80 bit real\n    T_64PREAL80     = 0x0642,   // 64 bit pointer to 80 bit real\n\n\n//      128 bit real types\n\n    T_REAL128       = 0x0043,   // 128 bit real\n    T_PREAL128      = 0x0143,   // 16 bit pointer to 128 bit real\n    T_PFREAL128     = 0x0243,   // 16:16 far pointer to 128 bit real\n    T_PHREAL128     = 0x0343,   // 16:16 huge pointer to 128 bit real\n    T_32PREAL128    = 0x0443,   // 32 bit pointer to 128 bit real\n    T_32PFREAL128   = 0x0543,   // 16:32 pointer to 128 bit real\n    T_64PREAL128    = 0x0643,   // 64 bit pointer to 128 bit real\n\n\n//      32 bit complex types\n\n    T_CPLX32        = 0x0050,   // 32 bit complex\n    T_PCPLX32       = 0x0150,   // 16 bit pointer to 32 bit complex\n    T_PFCPLX32      = 0x0250,   // 16:16 far pointer to 32 bit complex\n    T_PHCPLX32      = 0x0350,   // 16:16 huge pointer to 32 bit complex\n    T_32PCPLX32     = 0x0450,   // 32 bit pointer to 32 bit complex\n    T_32PFCPLX32    = 0x0550,   // 16:32 pointer to 32 bit complex\n    T_64PCPLX32     = 0x0650,   // 64 bit pointer to 32 bit complex\n\n\n//      64 bit complex types\n\n    T_CPLX64        = 0x0051,   // 64 bit complex\n    T_PCPLX64       = 0x0151,   // 16 bit pointer to 64 bit complex\n    T_PFCPLX64      = 0x0251,   // 16:16 far pointer to 64 bit complex\n    T_PHCPLX64      = 0x0351,   // 16:16 huge pointer to 64 bit complex\n    T_32PCPLX64     = 0x0451,   // 32 bit pointer to 64 bit complex\n    T_32PFCPLX64    = 0x0551,   // 16:32 pointer to 64 bit complex\n    T_64PCPLX64     = 0x0651,   // 64 bit pointer to 64 bit complex\n\n\n//      80 bit complex types\n\n    T_CPLX80        = 0x0052,   // 80 bit complex\n    T_PCPLX80       = 0x0152,   // 16 bit pointer to 80 bit complex\n    T_PFCPLX80      = 0x0252,   // 16:16 far pointer to 80 bit complex\n    T_PHCPLX80      = 0x0352,   // 16:16 huge pointer to 80 bit complex\n    T_32PCPLX80     = 0x0452,   // 32 bit pointer to 80 bit complex\n    T_32PFCPLX80    = 0x0552,   // 16:32 pointer to 80 bit complex\n    T_64PCPLX80     = 0x0652,   // 64 bit pointer to 80 bit complex\n\n\n//      128 bit complex types\n\n    T_CPLX128       = 0x0053,   // 128 bit complex\n    T_PCPLX128      = 0x0153,   // 16 bit pointer to 128 bit complex\n    T_PFCPLX128     = 0x0253,   // 16:16 far pointer to 128 bit complex\n    T_PHCPLX128     = 0x0353,   // 16:16 huge pointer to 128 bit real\n    T_32PCPLX128    = 0x0453,   // 32 bit pointer to 128 bit complex\n    T_32PFCPLX128   = 0x0553,   // 16:32 pointer to 128 bit complex\n    T_64PCPLX128    = 0x0653,   // 64 bit pointer to 128 bit complex\n\n\n//      boolean types\n\n    T_BOOL08        = 0x0030,   // 8 bit boolean\n    T_PBOOL08       = 0x0130,   // 16 bit pointer to  8 bit boolean\n    T_PFBOOL08      = 0x0230,   // 16:16 far pointer to  8 bit boolean\n    T_PHBOOL08      = 0x0330,   // 16:16 huge pointer to  8 bit boolean\n    T_32PBOOL08     = 0x0430,   // 32 bit pointer to 8 bit boolean\n    T_32PFBOOL08    = 0x0530,   // 16:32 pointer to 8 bit boolean\n    T_64PBOOL08     = 0x0630,   // 64 bit pointer to 8 bit boolean\n\n    T_BOOL16        = 0x0031,   // 16 bit boolean\n    T_PBOOL16       = 0x0131,   // 16 bit pointer to 16 bit boolean\n    T_PFBOOL16      = 0x0231,   // 16:16 far pointer to 16 bit boolean\n    T_PHBOOL16      = 0x0331,   // 16:16 huge pointer to 16 bit boolean\n    T_32PBOOL16     = 0x0431,   // 32 bit pointer to 18 bit boolean\n    T_32PFBOOL16    = 0x0531,   // 16:32 pointer to 16 bit boolean\n    T_64PBOOL16     = 0x0631,   // 64 bit pointer to 18 bit boolean\n\n    T_BOOL32        = 0x0032,   // 32 bit boolean\n    T_PBOOL32       = 0x0132,   // 16 bit pointer to 32 bit boolean\n    T_PFBOOL32      = 0x0232,   // 16:16 far pointer to 32 bit boolean\n    T_PHBOOL32      = 0x0332,   // 16:16 huge pointer to 32 bit boolean\n    T_32PBOOL32     = 0x0432,   // 32 bit pointer to 32 bit boolean\n    T_32PFBOOL32    = 0x0532,   // 16:32 pointer to 32 bit boolean\n    T_64PBOOL32     = 0x0632,   // 64 bit pointer to 32 bit boolean\n\n    T_BOOL64        = 0x0033,   // 64 bit boolean\n    T_PBOOL64       = 0x0133,   // 16 bit pointer to 64 bit boolean\n    T_PFBOOL64      = 0x0233,   // 16:16 far pointer to 64 bit boolean\n    T_PHBOOL64      = 0x0333,   // 16:16 huge pointer to 64 bit boolean\n    T_32PBOOL64     = 0x0433,   // 32 bit pointer to 64 bit boolean\n    T_32PFBOOL64    = 0x0533,   // 16:32 pointer to 64 bit boolean\n    T_64PBOOL64     = 0x0633,   // 64 bit pointer to 64 bit boolean\n\n\n//      ???\n\n    T_NCVPTR        = 0x01f0,   // CV Internal type for created near pointers\n    T_FCVPTR        = 0x02f0,   // CV Internal type for created far pointers\n    T_HCVPTR        = 0x03f0,   // CV Internal type for created huge pointers\n    T_32NCVPTR      = 0x04f0,   // CV Internal type for created near 32-bit pointers\n    T_32FCVPTR      = 0x05f0,   // CV Internal type for created far 32-bit pointers\n    T_64NCVPTR      = 0x06f0,   // CV Internal type for created near 64-bit pointers\n\n} TYPE_ENUM_e;\n\n/**     No leaf index can have a value of 0x0000.  The leaf indices are\n *      separated into ranges depending upon the use of the type record.\n *      The second range is for the type records that are directly referenced\n *      in symbols. The first range is for type records that are not\n *      referenced by symbols but instead are referenced by other type\n *      records.  All type records must have a starting leaf index in these\n *      first two ranges.  The third range of leaf indices are used to build\n *      up complex lists such as the field list of a class type record.  No\n *      type record can begin with one of the leaf indices. The fourth ranges\n *      of type indices are used to represent numeric data in a symbol or\n *      type record. These leaf indices are greater than 0x8000.  At the\n *      point that type or symbol processor is expecting a numeric field, the\n *      next two bytes in the type record are examined.  If the value is less\n *      than 0x8000, then the two bytes contain the numeric value.  If the\n *      value is greater than 0x8000, then the data follows the leaf index in\n *      a format specified by the leaf index. The final range of leaf indices\n *      are used to force alignment of subfields within a complex type record..\n */\n\n\ntypedef enum LEAF_ENUM_e {\n    // leaf indices starting records but referenced from symbol records\n\n    LF_MODIFIER_16t     = 0x0001,\n    LF_POINTER_16t      = 0x0002,\n    LF_ARRAY_16t        = 0x0003,\n    LF_CLASS_16t        = 0x0004,\n    LF_STRUCTURE_16t    = 0x0005,\n    LF_UNION_16t        = 0x0006,\n    LF_ENUM_16t         = 0x0007,\n    LF_PROCEDURE_16t    = 0x0008,\n    LF_MFUNCTION_16t    = 0x0009,\n    LF_VTSHAPE          = 0x000a,\n    LF_COBOL0_16t       = 0x000b,\n    LF_COBOL1           = 0x000c,\n    LF_BARRAY_16t       = 0x000d,\n    LF_LABEL            = 0x000e,\n    LF_NULL             = 0x000f,\n    LF_NOTTRAN          = 0x0010,\n    LF_DIMARRAY_16t     = 0x0011,\n    LF_VFTPATH_16t      = 0x0012,\n    LF_PRECOMP_16t      = 0x0013,       // not referenced from symbol\n    LF_ENDPRECOMP       = 0x0014,       // not referenced from symbol\n    LF_OEM_16t          = 0x0015,       // oem definable type string\n    LF_TYPESERVER_ST    = 0x0016,       // not referenced from symbol\n\n    // leaf indices starting records but referenced only from type records\n\n    LF_SKIP_16t         = 0x0200,\n    LF_ARGLIST_16t      = 0x0201,\n    LF_DEFARG_16t       = 0x0202,\n    LF_LIST             = 0x0203,\n    LF_FIELDLIST_16t    = 0x0204,\n    LF_DERIVED_16t      = 0x0205,\n    LF_BITFIELD_16t     = 0x0206,\n    LF_METHODLIST_16t   = 0x0207,\n    LF_DIMCONU_16t      = 0x0208,\n    LF_DIMCONLU_16t     = 0x0209,\n    LF_DIMVARU_16t      = 0x020a,\n    LF_DIMVARLU_16t     = 0x020b,\n    LF_REFSYM           = 0x020c,\n\n    LF_BCLASS_16t       = 0x0400,\n    LF_VBCLASS_16t      = 0x0401,\n    LF_IVBCLASS_16t     = 0x0402,\n    LF_ENUMERATE_ST     = 0x0403,\n    LF_FRIENDFCN_16t    = 0x0404,\n    LF_INDEX_16t        = 0x0405,\n    LF_MEMBER_16t       = 0x0406,\n    LF_STMEMBER_16t     = 0x0407,\n    LF_METHOD_16t       = 0x0408,\n    LF_NESTTYPE_16t     = 0x0409,\n    LF_VFUNCTAB_16t     = 0x040a,\n    LF_FRIENDCLS_16t    = 0x040b,\n    LF_ONEMETHOD_16t    = 0x040c,\n    LF_VFUNCOFF_16t     = 0x040d,\n\n// 32-bit type index versions of leaves, all have the 0x1000 bit set\n//\n    LF_TI16_MAX         = 0x1000,\n\n    LF_MODIFIER         = 0x1001,\n    LF_POINTER          = 0x1002,\n    LF_ARRAY_ST         = 0x1003,\n    LF_CLASS_ST         = 0x1004,\n    LF_STRUCTURE_ST     = 0x1005,\n    LF_UNION_ST         = 0x1006,\n    LF_ENUM_ST          = 0x1007,\n    LF_PROCEDURE        = 0x1008,\n    LF_MFUNCTION        = 0x1009,\n    LF_COBOL0           = 0x100a,\n    LF_BARRAY           = 0x100b,\n    LF_DIMARRAY_ST      = 0x100c,\n    LF_VFTPATH          = 0x100d,\n    LF_PRECOMP_ST       = 0x100e,       // not referenced from symbol\n    LF_OEM              = 0x100f,       // oem definable type string\n    LF_ALIAS_ST         = 0x1010,       // alias (typedef) type\n    LF_OEM2             = 0x1011,       // oem definable type string\n\n    // leaf indices starting records but referenced only from type records\n\n    LF_SKIP             = 0x1200,\n    LF_ARGLIST          = 0x1201,\n    LF_DEFARG_ST        = 0x1202,\n    LF_FIELDLIST        = 0x1203,\n    LF_DERIVED          = 0x1204,\n    LF_BITFIELD         = 0x1205,\n    LF_METHODLIST       = 0x1206,\n    LF_DIMCONU          = 0x1207,\n    LF_DIMCONLU         = 0x1208,\n    LF_DIMVARU          = 0x1209,\n    LF_DIMVARLU         = 0x120a,\n\n    LF_BCLASS           = 0x1400,\n    LF_VBCLASS          = 0x1401,\n    LF_IVBCLASS         = 0x1402,\n    LF_FRIENDFCN_ST     = 0x1403,\n    LF_INDEX            = 0x1404,\n    LF_MEMBER_ST        = 0x1405,\n    LF_STMEMBER_ST      = 0x1406,\n    LF_METHOD_ST        = 0x1407,\n    LF_NESTTYPE_ST      = 0x1408,\n    LF_VFUNCTAB         = 0x1409,\n    LF_FRIENDCLS        = 0x140a,\n    LF_ONEMETHOD_ST     = 0x140b,\n    LF_VFUNCOFF         = 0x140c,\n    LF_NESTTYPEEX_ST    = 0x140d,\n    LF_MEMBERMODIFY_ST  = 0x140e,\n    LF_MANAGED_ST       = 0x140f,\n\n    // Types w/ SZ names\n\n    LF_ST_MAX           = 0x1500,\n\n    LF_TYPESERVER       = 0x1501,       // not referenced from symbol\n    LF_ENUMERATE        = 0x1502,\n    LF_ARRAY            = 0x1503,\n    LF_CLASS            = 0x1504,\n    LF_STRUCTURE        = 0x1505,\n    LF_UNION            = 0x1506,\n    LF_ENUM             = 0x1507,\n    LF_DIMARRAY         = 0x1508,\n    LF_PRECOMP          = 0x1509,       // not referenced from symbol\n    LF_ALIAS            = 0x150a,       // alias (typedef) type\n    LF_DEFARG           = 0x150b,\n    LF_FRIENDFCN        = 0x150c,\n    LF_MEMBER           = 0x150d,\n    LF_STMEMBER         = 0x150e,\n    LF_METHOD           = 0x150f,\n    LF_NESTTYPE         = 0x1510,\n    LF_ONEMETHOD        = 0x1511,\n    LF_NESTTYPEEX       = 0x1512,\n    LF_MEMBERMODIFY     = 0x1513,\n    LF_MANAGED          = 0x1514,\n    LF_TYPESERVER2      = 0x1515,\n\n    LF_STRIDED_ARRAY    = 0x1516,    // same as LF_ARRAY, but with stride between adjacent elements\n    LF_HLSL             = 0x1517,\n    LF_MODIFIER_EX      = 0x1518,\n    LF_INTERFACE        = 0x1519,\n    LF_BINTERFACE       = 0x151a,\n    LF_VECTOR           = 0x151b,\n    LF_MATRIX           = 0x151c,\n\n    LF_VFTABLE          = 0x151d,      // a virtual function table\n    LF_ENDOFLEAFRECORD  = LF_VFTABLE,\n\n    LF_TYPE_LAST,                    // one greater than the last type record\n    LF_TYPE_MAX         = LF_TYPE_LAST - 1,\n\n    LF_FUNC_ID          = 0x1601,    // global func ID\n    LF_MFUNC_ID         = 0x1602,    // member func ID\n    LF_BUILDINFO        = 0x1603,    // build info: tool, version, command line, src/pdb file\n    LF_SUBSTR_LIST      = 0x1604,    // similar to LF_ARGLIST, for list of sub strings\n    LF_STRING_ID        = 0x1605,    // string ID\n\n    LF_UDT_SRC_LINE     = 0x1606,    // source and line on where an UDT is defined\n                                     // only generated by compiler\n\n    LF_UDT_MOD_SRC_LINE = 0x1607,    // module, source and line on where an UDT is defined\n                                     // only generated by linker\n\n    LF_ID_LAST,                      // one greater than the last ID record\n    LF_ID_MAX           = LF_ID_LAST - 1,\n\n    LF_NUMERIC          = 0x8000,\n    LF_CHAR             = 0x8000,\n    LF_SHORT            = 0x8001,\n    LF_USHORT           = 0x8002,\n    LF_LONG             = 0x8003,\n    LF_ULONG            = 0x8004,\n    LF_REAL32           = 0x8005,\n    LF_REAL64           = 0x8006,\n    LF_REAL80           = 0x8007,\n    LF_REAL128          = 0x8008,\n    LF_QUADWORD         = 0x8009,\n    LF_UQUADWORD        = 0x800a,\n    LF_REAL48           = 0x800b,\n    LF_COMPLEX32        = 0x800c,\n    LF_COMPLEX64        = 0x800d,\n    LF_COMPLEX80        = 0x800e,\n    LF_COMPLEX128       = 0x800f,\n    LF_VARSTRING        = 0x8010,\n\n    LF_OCTWORD          = 0x8017,\n    LF_UOCTWORD         = 0x8018,\n\n    LF_DECIMAL          = 0x8019,\n    LF_DATE             = 0x801a,\n    LF_UTF8STRING       = 0x801b,\n\n    LF_REAL16           = 0x801c,\n\n    LF_PAD0             = 0xf0,\n    LF_PAD1             = 0xf1,\n    LF_PAD2             = 0xf2,\n    LF_PAD3             = 0xf3,\n    LF_PAD4             = 0xf4,\n    LF_PAD5             = 0xf5,\n    LF_PAD6             = 0xf6,\n    LF_PAD7             = 0xf7,\n    LF_PAD8             = 0xf8,\n    LF_PAD9             = 0xf9,\n    LF_PAD10            = 0xfa,\n    LF_PAD11            = 0xfb,\n    LF_PAD12            = 0xfc,\n    LF_PAD13            = 0xfd,\n    LF_PAD14            = 0xfe,\n    LF_PAD15            = 0xff,\n\n} LEAF_ENUM_e;\n\n// end of leaf indices\n\n\n\n\n//      Type enum for pointer records\n//      Pointers can be one of the following types\n\n\ntypedef enum CV_ptrtype_e {\n    CV_PTR_NEAR         = 0x00, // 16 bit pointer\n    CV_PTR_FAR          = 0x01, // 16:16 far pointer\n    CV_PTR_HUGE         = 0x02, // 16:16 huge pointer\n    CV_PTR_BASE_SEG     = 0x03, // based on segment\n    CV_PTR_BASE_VAL     = 0x04, // based on value of base\n    CV_PTR_BASE_SEGVAL  = 0x05, // based on segment value of base\n    CV_PTR_BASE_ADDR    = 0x06, // based on address of base\n    CV_PTR_BASE_SEGADDR = 0x07, // based on segment address of base\n    CV_PTR_BASE_TYPE    = 0x08, // based on type\n    CV_PTR_BASE_SELF    = 0x09, // based on self\n    CV_PTR_NEAR32       = 0x0a, // 32 bit pointer\n    CV_PTR_FAR32        = 0x0b, // 16:32 pointer\n    CV_PTR_64           = 0x0c, // 64 bit pointer\n    CV_PTR_UNUSEDPTR    = 0x0d  // first unused pointer type\n} CV_ptrtype_e;\n\n\n\n\n\n//      Mode enum for pointers\n//      Pointers can have one of the following modes\n//\n//  To support for l-value and r-value reference, we added CV_PTR_MODE_LVREF\n//  and CV_PTR_MODE_RVREF.  CV_PTR_MODE_REF should be removed at some point.\n//  We keep it now so that old code that uses it won't be broken.\n//\n\ntypedef enum CV_ptrmode_e {\n    CV_PTR_MODE_PTR     = 0x00, // \"normal\" pointer\n    CV_PTR_MODE_REF     = 0x01, // \"old\" reference\n    CV_PTR_MODE_LVREF   = 0x01, // l-value reference\n    CV_PTR_MODE_PMEM    = 0x02, // pointer to data member\n    CV_PTR_MODE_PMFUNC  = 0x03, // pointer to member function\n    CV_PTR_MODE_RVREF   = 0x04, // r-value reference\n    CV_PTR_MODE_RESERVED= 0x05  // first unused pointer mode\n} CV_ptrmode_e;\n\n\n//      enumeration for pointer-to-member types\n\ntypedef enum CV_pmtype_e {\n    CV_PMTYPE_Undef     = 0x00, // not specified (pre VC8)\n    CV_PMTYPE_D_Single  = 0x01, // member data, single inheritance\n    CV_PMTYPE_D_Multiple= 0x02, // member data, multiple inheritance\n    CV_PMTYPE_D_Virtual = 0x03, // member data, virtual inheritance\n    CV_PMTYPE_D_General = 0x04, // member data, most general\n    CV_PMTYPE_F_Single  = 0x05, // member function, single inheritance\n    CV_PMTYPE_F_Multiple= 0x06, // member function, multiple inheritance\n    CV_PMTYPE_F_Virtual = 0x07, // member function, virtual inheritance\n    CV_PMTYPE_F_General = 0x08, // member function, most general\n} CV_pmtype_e;\n\n//      enumeration for method properties\n\ntypedef enum CV_methodprop_e {\n    CV_MTvanilla        = 0x00,\n    CV_MTvirtual        = 0x01,\n    CV_MTstatic         = 0x02,\n    CV_MTfriend         = 0x03,\n    CV_MTintro          = 0x04,\n    CV_MTpurevirt       = 0x05,\n    CV_MTpureintro      = 0x06\n} CV_methodprop_e;\n\n\n\n\n//      enumeration for virtual shape table entries\n\ntypedef enum CV_VTS_desc_e {\n    CV_VTS_near         = 0x00,\n    CV_VTS_far          = 0x01,\n    CV_VTS_thin         = 0x02,\n    CV_VTS_outer        = 0x03,\n    CV_VTS_meta         = 0x04,\n    CV_VTS_near32       = 0x05,\n    CV_VTS_far32        = 0x06,\n    CV_VTS_unused       = 0x07\n} CV_VTS_desc_e;\n\n\n\n\n//      enumeration for LF_LABEL address modes\n\ntypedef enum CV_LABEL_TYPE_e {\n    CV_LABEL_NEAR = 0,       // near return\n    CV_LABEL_FAR  = 4        // far return\n} CV_LABEL_TYPE_e;\n\n\n\n//      enumeration for LF_MODIFIER values\n\n\ntypedef struct CV_modifier_t {\n    unsigned short  MOD_const       :1;\n    unsigned short  MOD_volatile    :1;\n    unsigned short  MOD_unaligned   :1;\n    unsigned short  MOD_unused      :13;\n} CV_modifier_t;\n\n\n\n\n//  enumeration for HFA kinds\n\ntypedef enum CV_HFA_e {\n   CV_HFA_none   =  0,\n   CV_HFA_float  =  1,\n   CV_HFA_double =  2,\n   CV_HFA_other  =  3\n} CV_HFA_e;\n\n//  enumeration for MoCOM UDT kinds\n\ntypedef enum CV_MOCOM_UDT_e {\n    CV_MOCOM_UDT_none      = 0,\n    CV_MOCOM_UDT_ref       = 1,\n    CV_MOCOM_UDT_value     = 2,\n    CV_MOCOM_UDT_interface = 3\n} CV_MOCOM_UDT_e;\n\n//  bit field structure describing class/struct/union/enum properties\n\ntypedef struct CV_prop_t {\n    unsigned short  packed      :1;     // true if structure is packed\n    unsigned short  ctor        :1;     // true if constructors or destructors present\n    unsigned short  ovlops      :1;     // true if overloaded operators present\n    unsigned short  isnested    :1;     // true if this is a nested class\n    unsigned short  cnested     :1;     // true if this class contains nested types\n    unsigned short  opassign    :1;     // true if overloaded assignment (=)\n    unsigned short  opcast      :1;     // true if casting methods\n    unsigned short  fwdref      :1;     // true if forward reference (incomplete defn)\n    unsigned short  scoped      :1;     // scoped definition\n    unsigned short  hasuniquename :1;   // true if there is a decorated name following the regular name\n    unsigned short  sealed      :1;     // true if class cannot be used as a base class\n    unsigned short  hfa         :2;     // CV_HFA_e\n    unsigned short  intrinsic   :1;     // true if class is an intrinsic type (e.g. __m128d)\n    unsigned short  mocom       :2;     // CV_MOCOM_UDT_e\n} CV_prop_t;\n\n\n\n\n//  class field attribute\n\ntypedef struct CV_fldattr_t {\n    unsigned short  access      :2;     // access protection CV_access_t\n    unsigned short  mprop       :3;     // method properties CV_methodprop_t\n    unsigned short  pseudo      :1;     // compiler generated fcn and does not exist\n    unsigned short  noinherit   :1;     // true if class cannot be inherited\n    unsigned short  noconstruct :1;     // true if class cannot be constructed\n    unsigned short  compgenx    :1;     // compiler generated fcn and does exist\n    unsigned short  sealed      :1;     // true if method cannot be overridden\n    unsigned short  unused      :6;     // unused\n} CV_fldattr_t;\n\n\n//  function flags\n\ntypedef struct CV_funcattr_t {\n    unsigned char  cxxreturnudt :1;  // true if C++ style ReturnUDT\n    unsigned char  ctor         :1;  // true if func is an instance constructor\n    unsigned char  ctorvbase    :1;  // true if func is an instance constructor of a class with virtual bases\n    unsigned char  unused       :5;  // unused\n} CV_funcattr_t;\n\n\n//  matrix flags\n\ntypedef struct CV_matrixattr_t {\n    unsigned char  row_major   :1;   // true if matrix has row-major layout (column-major is default)\n    unsigned char  unused      :7;   // unused\n} CV_matrixattr_t;\n\n\n//  Structures to access to the type records\n\n\ntypedef struct TYPTYPE {\n    unsigned short  len;\n    unsigned short  leaf;\n    unsigned char   data[CV_ZEROLEN];\n} TYPTYPE;          // general types record\n\n__INLINE char *NextType ( _In_ char * pType) {\n    return (pType + ((TYPTYPE *)pType)->len + sizeof(unsigned short));\n}\n\ntypedef enum CV_PMEMBER {\n    CV_PDM16_NONVIRT    = 0x00, // 16:16 data no virtual fcn or base\n    CV_PDM16_VFCN       = 0x01, // 16:16 data with virtual functions\n    CV_PDM16_VBASE      = 0x02, // 16:16 data with virtual bases\n    CV_PDM32_NVVFCN     = 0x03, // 16:32 data w/wo virtual functions\n    CV_PDM32_VBASE      = 0x04, // 16:32 data with virtual bases\n\n    CV_PMF16_NEARNVSA   = 0x05, // 16:16 near method nonvirtual single address point\n    CV_PMF16_NEARNVMA   = 0x06, // 16:16 near method nonvirtual multiple address points\n    CV_PMF16_NEARVBASE  = 0x07, // 16:16 near method virtual bases\n    CV_PMF16_FARNVSA    = 0x08, // 16:16 far method nonvirtual single address point\n    CV_PMF16_FARNVMA    = 0x09, // 16:16 far method nonvirtual multiple address points\n    CV_PMF16_FARVBASE   = 0x0a, // 16:16 far method virtual bases\n\n    CV_PMF32_NVSA       = 0x0b, // 16:32 method nonvirtual single address point\n    CV_PMF32_NVMA       = 0x0c, // 16:32 method nonvirtual multiple address point\n    CV_PMF32_VBASE      = 0x0d  // 16:32 method virtual bases\n} CV_PMEMBER;\n\n\n\n//  memory representation of pointer to member.  These representations are\n//  indexed by the enumeration above in the LF_POINTER record\n\n\n\n\n//  representation of a 16:16 pointer to data for a class with no\n//  virtual functions or virtual bases\n\n\nstruct CV_PDMR16_NONVIRT {\n    CV_off16_t      mdisp;      // displacement to data (NULL = -1)\n};\n\n\n\n\n//  representation of a 16:16 pointer to data for a class with virtual\n//  functions\n\n\nstruct CV_PMDR16_VFCN {\n    CV_off16_t      mdisp;      // displacement to data ( NULL = 0)\n};\n\n\n\n\n//  representation of a 16:16 pointer to data for a class with\n//  virtual bases\n\n\nstruct CV_PDMR16_VBASE {\n    CV_off16_t      mdisp;      // displacement to data\n    CV_off16_t      pdisp;      // this pointer displacement to vbptr\n    CV_off16_t      vdisp;      // displacement within vbase table\n                                // NULL = (,,0xffff)\n};\n\n\n\n\n//  representation of a 32 bit pointer to data for a class with\n//  or without virtual functions and no virtual bases\n\n\nstruct CV_PDMR32_NVVFCN {\n    CV_off32_t      mdisp;      // displacement to data (NULL = 0x80000000)\n};\n\n\n\n\n//  representation of a 32 bit pointer to data for a class\n//  with virtual bases\n\n\nstruct CV_PDMR32_VBASE {\n    CV_off32_t      mdisp;      // displacement to data\n    CV_off32_t      pdisp;      // this pointer displacement\n    CV_off32_t      vdisp;      // vbase table displacement\n                                // NULL = (,,0xffffffff)\n};\n\n\n\n\n//  representation of a 16:16 pointer to near member function for a\n//  class with no virtual functions or bases and a single address point\n\n\nstruct CV_PMFR16_NEARNVSA {\n    CV_uoff16_t     off;        // near address of function (NULL = 0)\n};\n\n\n\n//  representation of a 16 bit pointer to member functions of a\n//  class with no virtual bases and multiple address points\n\n\nstruct CV_PMFR16_NEARNVMA {\n    CV_uoff16_t     off;        // offset of function (NULL = 0,x)\n    signed short    disp;\n};\n\n\n\n\n//  representation of a 16 bit pointer to member function of a\n//  class with virtual bases\n\n\nstruct CV_PMFR16_NEARVBASE {\n    CV_uoff16_t     off;        // offset of function (NULL = 0,x,x,x)\n    CV_off16_t      mdisp;      // displacement to data\n    CV_off16_t      pdisp;      // this pointer displacement\n    CV_off16_t      vdisp;      // vbase table displacement\n};\n\n\n\n\n//  representation of a 16:16 pointer to far member function for a\n//  class with no virtual bases and a single address point\n\n\nstruct CV_PMFR16_FARNVSA {\n    CV_uoff16_t     off;        // offset of function (NULL = 0:0)\n    unsigned short  seg;        // segment of function\n};\n\n\n\n\n//  representation of a 16:16 far pointer to member functions of a\n//  class with no virtual bases and multiple address points\n\n\nstruct CV_PMFR16_FARNVMA {\n    CV_uoff16_t     off;        // offset of function (NULL = 0:0,x)\n    unsigned short  seg;\n    signed short    disp;\n};\n\n\n\n\n//  representation of a 16:16 far pointer to member function of a\n//  class with virtual bases\n\n\nstruct CV_PMFR16_FARVBASE {\n    CV_uoff16_t     off;        // offset of function (NULL = 0:0,x,x,x)\n    unsigned short  seg;\n    CV_off16_t      mdisp;      // displacement to data\n    CV_off16_t      pdisp;      // this pointer displacement\n    CV_off16_t      vdisp;      // vbase table displacement\n\n};\n\n\n\n\n//  representation of a 32 bit pointer to member function for a\n//  class with no virtual bases and a single address point\n\n\nstruct CV_PMFR32_NVSA {\n    CV_uoff32_t      off;        // near address of function (NULL = 0L)\n};\n\n\n\n\n//  representation of a 32 bit pointer to member function for a\n//  class with no virtual bases and multiple address points\n\n\nstruct CV_PMFR32_NVMA {\n    CV_uoff32_t     off;        // near address of function (NULL = 0L,x)\n    CV_off32_t      disp;\n};\n\n\n\n\n//  representation of a 32 bit pointer to member function for a\n//  class with virtual bases\n\n\nstruct CV_PMFR32_VBASE {\n    CV_uoff32_t     off;        // near address of function (NULL = 0L,x,x,x)\n    CV_off32_t      mdisp;      // displacement to data\n    CV_off32_t      pdisp;      // this pointer displacement\n    CV_off32_t      vdisp;      // vbase table displacement\n};\n\n\n\n\n\n//  Easy leaf - used for generic casting to reference leaf field\n//  of a subfield of a complex list\n\ntypedef struct lfEasy {\n    unsigned short  leaf;           // LF_...\n} lfEasy;\n\n\n/**     The following type records are basically variant records of the\n *      above structure.  The \"unsigned short leaf\" of the above structure and\n *      the \"unsigned short leaf\" of the following type definitions are the same\n *      symbol.  When the OMF record is locked via the MHOMFLock API\n *      call, the address of the \"unsigned short leaf\" is returned\n */\n\n/**     Notes on alignment\n *      Alignment of the fields in most of the type records is done on the\n *      basis of the TYPTYPE record base.  That is why in most of the lf*\n *      records that the CV_typ_t (32-bit types) is located on what appears to\n *      be a offset mod 4 == 2 boundary.  The exception to this rule are those\n *      records that are in a list (lfFieldList, lfMethodList), which are\n *      aligned to their own bases since they don't have the length field\n */\n\n/**** Change log for 16-bit to 32-bit type and symbol records\n\n    Record type         Change (f == field arrangement, p = padding added)\n    ----------------------------------------------------------------------\n    lfModifier           f\n    lfPointer           fp\n    lfClass             f\n    lfStructure         f\n    lfUnion             f\n    lfEnum              f\n    lfVFTPath           p\n    lfPreComp           p\n    lfOEM               p\n    lfArgList           p\n    lfDerived           p\n    mlMethod            p   (method list member)\n    lfBitField          f\n    lfDimCon            f\n    lfDimVar            p\n    lfIndex             p   (field list member)\n    lfBClass            f   (field list member)\n    lfVBClass           f   (field list member)\n    lfFriendCls         p   (field list member)\n    lfFriendFcn         p   (field list member)\n    lfMember            f   (field list member)\n    lfSTMember          f   (field list member)\n    lfVFuncTab          p   (field list member)\n    lfVFuncOff          p   (field list member)\n    lfNestType          p   (field list member)\n\n    DATASYM32           f\n    PROCSYM32           f\n    VPATHSYM32          f\n    REGREL32            f\n    THREADSYM32         f\n    PROCSYMMIPS         f\n\n\n*/\n\n//      Type record for LF_MODIFIER\n\ntypedef struct lfModifier_16t {\n    unsigned short  leaf;           // LF_MODIFIER_16t\n    CV_modifier_t   attr;           // modifier attribute modifier_t\n    CV_typ16_t      type;           // modified type\n} lfModifier_16t;\n\ntypedef struct lfModifier {\n    unsigned short  leaf;           // LF_MODIFIER\n    CV_typ_t        type;           // modified type\n    CV_modifier_t   attr;           // modifier attribute modifier_t\n} lfModifier;\n\n\n\n\n//      type record for LF_POINTER\n\n#ifndef __cplusplus\ntypedef struct lfPointer_16t {\n#endif\n    struct lfPointerBody_16t {\n        unsigned short      leaf;           // LF_POINTER_16t\n        struct lfPointerAttr_16t {\n            unsigned char   ptrtype     :5; // ordinal specifying pointer type (CV_ptrtype_e)\n            unsigned char   ptrmode     :3; // ordinal specifying pointer mode (CV_ptrmode_e)\n            unsigned char   isflat32    :1; // true if 0:32 pointer\n            unsigned char   isvolatile  :1; // TRUE if volatile pointer\n            unsigned char   isconst     :1; // TRUE if const pointer\n            unsigned char   isunaligned :1; // TRUE if unaligned pointer\n            unsigned char   unused      :4;\n        } attr;\n        CV_typ16_t  utype;          // type index of the underlying type\n#if (defined(__cplusplus) || defined(_MSC_VER)) // for C++ and MS compilers that support unnamed unions\n    };\n#else\n    } u;\n#endif\n#ifdef  __cplusplus\ntypedef struct lfPointer_16t : public lfPointerBody_16t {\n#endif\n    union {\n        struct {\n            CV_typ16_t      pmclass;    // index of containing class for pointer to member\n            unsigned short  pmenum;     // enumeration specifying pm format (CV_pmtype_e)\n        } pm;\n        unsigned short      bseg;       // base segment if PTR_BASE_SEG\n        unsigned char       Sym[1];     // copy of base symbol record (including length)\n        struct  {\n            CV_typ16_t      index;      // type index if CV_PTR_BASE_TYPE\n            unsigned char   name[1];    // name of base type\n        } btype;\n    } pbase;\n} lfPointer_16t;\n\n#ifndef __cplusplus\ntypedef struct lfPointer {\n#endif\n    struct lfPointerBody {\n        unsigned short      leaf;           // LF_POINTER\n        CV_typ_t            utype;          // type index of the underlying type\n        struct lfPointerAttr {\n            unsigned long   ptrtype     :5; // ordinal specifying pointer type (CV_ptrtype_e)\n            unsigned long   ptrmode     :3; // ordinal specifying pointer mode (CV_ptrmode_e)\n            unsigned long   isflat32    :1; // true if 0:32 pointer\n            unsigned long   isvolatile  :1; // TRUE if volatile pointer\n            unsigned long   isconst     :1; // TRUE if const pointer\n            unsigned long   isunaligned :1; // TRUE if unaligned pointer\n            unsigned long   isrestrict  :1; // TRUE if restricted pointer (allow agressive opts)\n            unsigned long   size        :6; // size of pointer (in bytes)\n            unsigned long   ismocom     :1; // TRUE if it is a MoCOM pointer (^ or %)\n            unsigned long   islref      :1; // TRUE if it is this pointer of member function with & ref-qualifier\n            unsigned long   isrref      :1; // TRUE if it is this pointer of member function with && ref-qualifier\n            unsigned long   unused      :10;// pad out to 32-bits for following cv_typ_t's\n        } attr;\n#if (defined(__cplusplus) || defined(_MSC_VER)) // for C++ and MS compilers that support unnamed unions\n    };\n#else\n    } u;\n#endif\n#ifdef  __cplusplus\ntypedef struct lfPointer : public lfPointerBody {\n#endif\n    union {\n        struct {\n            CV_typ_t        pmclass;    // index of containing class for pointer to member\n            unsigned short  pmenum;     // enumeration specifying pm format (CV_pmtype_e)\n        } pm;\n        unsigned short      bseg;       // base segment if PTR_BASE_SEG\n        unsigned char       Sym[1];     // copy of base symbol record (including length)\n        struct  {\n            CV_typ_t        index;      // type index if CV_PTR_BASE_TYPE\n            unsigned char   name[1];    // name of base type\n        } btype;\n    } pbase;\n} lfPointer;\n\n\n\n\n//      type record for LF_ARRAY\n\n\ntypedef struct lfArray_16t {\n    unsigned short  leaf;           // LF_ARRAY_16t\n    CV_typ16_t      elemtype;       // type index of element type\n    CV_typ16_t      idxtype;        // type index of indexing type\n    unsigned char   data[CV_ZEROLEN];         // variable length data specifying\n                                    // size in bytes and name\n} lfArray_16t;\n\ntypedef struct lfArray {\n    unsigned short  leaf;           // LF_ARRAY\n    CV_typ_t        elemtype;       // type index of element type\n    CV_typ_t        idxtype;        // type index of indexing type\n    unsigned char   data[CV_ZEROLEN];         // variable length data specifying\n                                    // size in bytes and name\n} lfArray;\n\ntypedef struct lfStridedArray {\n    unsigned short  leaf;           // LF_STRIDED_ARRAY\n    CV_typ_t        elemtype;       // type index of element type\n    CV_typ_t        idxtype;        // type index of indexing type\n    unsigned long   stride;\n    unsigned char   data[CV_ZEROLEN];         // variable length data specifying\n                                    // size in bytes and name\n} lfStridedArray;\n\n\n\n\n//      type record for LF_VECTOR\n\n\ntypedef struct lfVector {\n    unsigned short  leaf;           // LF_VECTOR\n    CV_typ_t        elemtype;       // type index of element type\n    unsigned long   count;          // number of elements in the vector\n    unsigned char   data[CV_ZEROLEN];         // variable length data specifying\n                                    // size in bytes and name\n} lfVector;\n\n\n\n\n//      type record for LF_MATRIX\n\n\ntypedef struct lfMatrix {\n    unsigned short  leaf;           // LF_MATRIX\n    CV_typ_t        elemtype;       // type index of element type\n    unsigned long   rows;           // number of rows\n    unsigned long   cols;           // number of columns\n    unsigned long   majorStride;\n    CV_matrixattr_t matattr;        // attributes\n    unsigned char   data[CV_ZEROLEN];         // variable length data specifying\n                                    // size in bytes and name\n} lfMatrix;\n\n\n\n\n//      type record for LF_CLASS, LF_STRUCTURE\n\n\ntypedef struct lfClass_16t {\n    unsigned short  leaf;           // LF_CLASS_16t, LF_STRUCT_16t\n    unsigned short  count;          // count of number of elements in class\n    CV_typ16_t      field;          // type index of LF_FIELD descriptor list\n    CV_prop_t       property;       // property attribute field (prop_t)\n    CV_typ16_t      derived;        // type index of derived from list if not zero\n    CV_typ16_t      vshape;         // type index of vshape table for this class\n    unsigned char   data[CV_ZEROLEN];         // data describing length of structure in\n                                    // bytes and name\n} lfClass_16t;\ntypedef lfClass_16t lfStructure_16t;\n\n\ntypedef struct lfClass {\n    unsigned short  leaf;           // LF_CLASS, LF_STRUCT, LF_INTERFACE\n    unsigned short  count;          // count of number of elements in class\n    CV_prop_t       property;       // property attribute field (prop_t)\n    CV_typ_t        field;          // type index of LF_FIELD descriptor list\n    CV_typ_t        derived;        // type index of derived from list if not zero\n    CV_typ_t        vshape;         // type index of vshape table for this class\n    unsigned char   data[CV_ZEROLEN];         // data describing length of structure in\n                                    // bytes and name\n} lfClass;\ntypedef lfClass lfStructure;\ntypedef lfClass lfInterface;\n\n//      type record for LF_UNION\n\n\ntypedef struct lfUnion_16t {\n    unsigned short  leaf;           // LF_UNION_16t\n    unsigned short  count;          // count of number of elements in class\n    CV_typ16_t      field;          // type index of LF_FIELD descriptor list\n    CV_prop_t       property;       // property attribute field\n    unsigned char   data[CV_ZEROLEN];         // variable length data describing length of\n                                    // structure and name\n} lfUnion_16t;\n\n\ntypedef struct lfUnion {\n    unsigned short  leaf;           // LF_UNION\n    unsigned short  count;          // count of number of elements in class\n    CV_prop_t       property;       // property attribute field\n    CV_typ_t        field;          // type index of LF_FIELD descriptor list\n    unsigned char   data[CV_ZEROLEN];         // variable length data describing length of\n                                    // structure and name\n} lfUnion;\n\n\n//      type record for LF_ALIAS\n\ntypedef struct lfAlias {\n    unsigned short  leaf;           // LF_ALIAS\n    CV_typ_t        utype;          // underlying type\n    unsigned char   Name[1];        // alias name\n} lfAlias;\n\n// Item Id is a stricter typeindex which may referenced from symbol stream.\n// The code item always had a name.\n\ntypedef CV_typ_t CV_ItemId;\n\ntypedef struct lfFuncId {\n    unsigned short  leaf;       // LF_FUNC_ID\n    CV_ItemId       scopeId;    // parent scope of the ID, 0 if global\n    CV_typ_t        type;       // function type\n    unsigned char   name[CV_ZEROLEN];\n} lfFuncId;\n\ntypedef struct lfMFuncId {\n    unsigned short  leaf;       // LF_MFUNC_ID\n    CV_typ_t        parentType; // type index of parent\n    CV_typ_t        type;       // function type\n    unsigned char   name[CV_ZEROLEN];\n} lfMFuncId;\n\ntypedef struct lfStringId {\n    unsigned short  leaf;       // LF_STRING_ID\n    CV_ItemId       id;         // ID to list of sub string IDs\n    unsigned char   name[CV_ZEROLEN];\n} lfStringId;\n\ntypedef struct lfUdtSrcLine {\n    unsigned short leaf;        // LF_UDT_SRC_LINE\n    CV_typ_t       type;        // UDT's type index\n    CV_ItemId      src;         // index to LF_STRING_ID record where source file name is saved\n    unsigned long  line;        // line number\n} lfUdtSrcLine;\n\ntypedef struct lfUdtModSrcLine {\n    unsigned short leaf;        // LF_UDT_MOD_SRC_LINE\n    CV_typ_t       type;        // UDT's type index\n    CV_ItemId      src;         // index into string table where source file name is saved\n    unsigned long  line;        // line number\n    unsigned short imod;        // module that contributes this UDT definition\n} lfUdtModSrcLine;\n\ntypedef enum CV_BuildInfo_e {\n    CV_BuildInfo_CurrentDirectory = 0,\n    CV_BuildInfo_BuildTool        = 1,    // Cl.exe\n    CV_BuildInfo_SourceFile       = 2,    // foo.cpp\n    CV_BuildInfo_ProgramDatabaseFile = 3, // foo.pdb\n    CV_BuildInfo_CommandArguments = 4,    // -I etc\n    CV_BUILDINFO_KNOWN\n} CV_BuildInfo_e;\n\n// type record for build information\n\ntypedef struct lfBuildInfo {\n    unsigned short  leaf;                    // LF_BUILDINFO\n    unsigned short  count;                   // number of arguments\n    CV_ItemId       arg[CV_BUILDINFO_KNOWN]; // arguments as CodeItemId\n} lfBuildInfo;\n\n//      type record for LF_MANAGED\n\ntypedef struct lfManaged {\n    unsigned short  leaf;           // LF_MANAGED\n    unsigned char   Name[1];        // utf8, zero terminated managed type name\n} lfManaged;\n\n\n//      type record for LF_ENUM\n\n\ntypedef struct lfEnum_16t {\n    unsigned short  leaf;           // LF_ENUM_16t\n    unsigned short  count;          // count of number of elements in class\n    CV_typ16_t      utype;          // underlying type of the enum\n    CV_typ16_t      field;          // type index of LF_FIELD descriptor list\n    CV_prop_t       property;       // property attribute field\n    unsigned char   Name[1];        // length prefixed name of enum\n} lfEnum_16t;\n\ntypedef struct lfEnum {\n    unsigned short  leaf;           // LF_ENUM\n    unsigned short  count;          // count of number of elements in class\n    CV_prop_t       property;       // property attribute field\n    CV_typ_t        utype;          // underlying type of the enum\n    CV_typ_t        field;          // type index of LF_FIELD descriptor list\n    unsigned char   Name[1];        // length prefixed name of enum\n} lfEnum;\n\n\n\n//      Type record for LF_PROCEDURE\n\n\ntypedef struct lfProc_16t {\n    unsigned short  leaf;           // LF_PROCEDURE_16t\n    CV_typ16_t      rvtype;         // type index of return value\n    unsigned char   calltype;       // calling convention (CV_call_t)\n    CV_funcattr_t   funcattr;       // attributes\n    unsigned short  parmcount;      // number of parameters\n    CV_typ16_t      arglist;        // type index of argument list\n} lfProc_16t;\n\ntypedef struct lfProc {\n    unsigned short  leaf;           // LF_PROCEDURE\n    CV_typ_t        rvtype;         // type index of return value\n    unsigned char   calltype;       // calling convention (CV_call_t)\n    CV_funcattr_t   funcattr;       // attributes\n    unsigned short  parmcount;      // number of parameters\n    CV_typ_t        arglist;        // type index of argument list\n} lfProc;\n\n\n\n//      Type record for member function\n\n\ntypedef struct lfMFunc_16t {\n    unsigned short  leaf;           // LF_MFUNCTION_16t\n    CV_typ16_t      rvtype;         // type index of return value\n    CV_typ16_t      classtype;      // type index of containing class\n    CV_typ16_t      thistype;       // type index of this pointer (model specific)\n    unsigned char   calltype;       // calling convention (call_t)\n    CV_funcattr_t   funcattr;       // attributes\n    unsigned short  parmcount;      // number of parameters\n    CV_typ16_t      arglist;        // type index of argument list\n    long            thisadjust;     // this adjuster (long because pad required anyway)\n} lfMFunc_16t;\n\ntypedef struct lfMFunc {\n    unsigned short  leaf;           // LF_MFUNCTION\n    CV_typ_t        rvtype;         // type index of return value\n    CV_typ_t        classtype;      // type index of containing class\n    CV_typ_t        thistype;       // type index of this pointer (model specific)\n    unsigned char   calltype;       // calling convention (call_t)\n    CV_funcattr_t   funcattr;       // attributes\n    unsigned short  parmcount;      // number of parameters\n    CV_typ_t        arglist;        // type index of argument list\n    long            thisadjust;     // this adjuster (long because pad required anyway)\n} lfMFunc;\n\n\n\n\n//     type record for virtual function table shape\n\n\ntypedef struct lfVTShape {\n    unsigned short  leaf;       // LF_VTSHAPE\n    unsigned short  count;      // number of entries in vfunctable\n    unsigned char   desc[CV_ZEROLEN];     // 4 bit (CV_VTS_desc) descriptors\n} lfVTShape;\n\n//     type record for a virtual function table\ntypedef struct lfVftable {\n    unsigned short  leaf;             // LF_VFTABLE\n    CV_typ_t        type;             // class/structure that owns the vftable\n    CV_typ_t        baseVftable;      // vftable from which this vftable is derived\n    unsigned long   offsetInObjectLayout; // offset of the vfptr to this table, relative to the start of the object layout.\n    unsigned long   len;              // length of the Names array below in bytes.\n    unsigned char   Names[1];         // array of names.\n                                      // The first is the name of the vtable.\n                                      // The others are the names of the methods.\n                                      // TS-TODO: replace a name with a NamedCodeItem once Weiping is done, to\n                                      //    avoid duplication of method names.\n} lfVftable;\n\n//      type record for cobol0\n\n\ntypedef struct lfCobol0_16t {\n    unsigned short  leaf;       // LF_COBOL0_16t\n    CV_typ16_t      type;       // parent type record index\n    unsigned char   data[CV_ZEROLEN];\n} lfCobol0_16t;\n\ntypedef struct lfCobol0 {\n    unsigned short  leaf;       // LF_COBOL0\n    CV_typ_t        type;       // parent type record index\n    unsigned char   data[CV_ZEROLEN];\n} lfCobol0;\n\n\n\n\n//      type record for cobol1\n\n\ntypedef struct lfCobol1 {\n    unsigned short  leaf;       // LF_COBOL1\n    unsigned char   data[CV_ZEROLEN];\n} lfCobol1;\n\n\n\n\n//      type record for basic array\n\n\ntypedef struct lfBArray_16t {\n    unsigned short  leaf;       // LF_BARRAY_16t\n    CV_typ16_t      utype;      // type index of underlying type\n} lfBArray_16t;\n\ntypedef struct lfBArray {\n    unsigned short  leaf;       // LF_BARRAY\n    CV_typ_t        utype;      // type index of underlying type\n} lfBArray;\n\n//      type record for assembler labels\n\n\ntypedef struct lfLabel {\n    unsigned short  leaf;       // LF_LABEL\n    unsigned short  mode;       // addressing mode of label\n} lfLabel;\n\n\n\n//      type record for dimensioned arrays\n\n\ntypedef struct lfDimArray_16t {\n    unsigned short  leaf;       // LF_DIMARRAY_16t\n    CV_typ16_t      utype;      // underlying type of the array\n    CV_typ16_t      diminfo;    // dimension information\n    unsigned char   name[1];    // length prefixed name\n} lfDimArray_16t;\n\ntypedef struct lfDimArray {\n    unsigned short  leaf;       // LF_DIMARRAY\n    CV_typ_t        utype;      // underlying type of the array\n    CV_typ_t        diminfo;    // dimension information\n    unsigned char   name[1];    // length prefixed name\n} lfDimArray;\n\n\n\n//      type record describing path to virtual function table\n\n\ntypedef struct lfVFTPath_16t {\n    unsigned short  leaf;       // LF_VFTPATH_16t\n    unsigned short  count;      // count of number of bases in path\n    CV_typ16_t      base[1];    // bases from root to leaf\n} lfVFTPath_16t;\n\ntypedef struct lfVFTPath {\n    unsigned short  leaf;       // LF_VFTPATH\n    unsigned long   count;      // count of number of bases in path\n    CV_typ_t        base[1];    // bases from root to leaf\n} lfVFTPath;\n\n\n//      type record describing inclusion of precompiled types\n\n\ntypedef struct lfPreComp_16t {\n    unsigned short  leaf;       // LF_PRECOMP_16t\n    unsigned short  start;      // starting type index included\n    unsigned short  count;      // number of types in inclusion\n    unsigned long   signature;  // signature\n    unsigned char   name[CV_ZEROLEN];     // length prefixed name of included type file\n} lfPreComp_16t;\n\ntypedef struct lfPreComp {\n    unsigned short  leaf;       // LF_PRECOMP\n    unsigned long   start;      // starting type index included\n    unsigned long   count;      // number of types in inclusion\n    unsigned long   signature;  // signature\n    unsigned char   name[CV_ZEROLEN];     // length prefixed name of included type file\n} lfPreComp;\n\n\n\n//      type record describing end of precompiled types that can be\n//      included by another file\n\n\ntypedef struct lfEndPreComp {\n    unsigned short  leaf;       // LF_ENDPRECOMP\n    unsigned long   signature;  // signature\n} lfEndPreComp;\n\n\n\n\n\n//      type record for OEM definable type strings\n\n\ntypedef struct lfOEM_16t {\n    unsigned short  leaf;       // LF_OEM_16t\n    unsigned short  cvOEM;      // MS assigned OEM identified\n    unsigned short  recOEM;     // OEM assigned type identifier\n    unsigned short  count;      // count of type indices to follow\n    CV_typ16_t      index[CV_ZEROLEN];  // array of type indices followed\n                                // by OEM defined data\n} lfOEM_16t;\n\ntypedef struct lfOEM {\n    unsigned short  leaf;       // LF_OEM\n    unsigned short  cvOEM;      // MS assigned OEM identified\n    unsigned short  recOEM;     // OEM assigned type identifier\n    unsigned long   count;      // count of type indices to follow\n    CV_typ_t        index[CV_ZEROLEN];  // array of type indices followed\n                                // by OEM defined data\n} lfOEM;\n\n#define OEM_MS_FORTRAN90        0xF090\n#define OEM_ODI                 0x0010\n#define OEM_THOMSON_SOFTWARE    0x5453\n#define OEM_ODI_REC_BASELIST    0x0000\n\ntypedef struct lfOEM2 {\n    unsigned short  leaf;       // LF_OEM2\n    unsigned char   idOem[16];  // an oem ID (GUID)\n    unsigned long   count;      // count of type indices to follow\n    CV_typ_t        index[CV_ZEROLEN];  // array of type indices followed\n                                // by OEM defined data\n} lfOEM2;\n\n//      type record describing using of a type server\n\ntypedef struct lfTypeServer {\n    unsigned short  leaf;       // LF_TYPESERVER\n    unsigned long   signature;  // signature\n    unsigned long   age;        // age of database used by this module\n    unsigned char   name[CV_ZEROLEN];     // length prefixed name of PDB\n} lfTypeServer;\n\n//      type record describing using of a type server with v7 (GUID) signatures\n\ntypedef struct lfTypeServer2 {\n    unsigned short  leaf;       // LF_TYPESERVER2\n    SIG70           sig70;      // guid signature\n    unsigned long   age;        // age of database used by this module\n    unsigned char   name[CV_ZEROLEN];     // length prefixed name of PDB\n} lfTypeServer2;\n\n//      description of type records that can be referenced from\n//      type records referenced by symbols\n\n\n\n//      type record for skip record\n\n\ntypedef struct lfSkip_16t {\n    unsigned short  leaf;       // LF_SKIP_16t\n    CV_typ16_t      type;       // next valid index\n    unsigned char   data[CV_ZEROLEN];     // pad data\n} lfSkip_16t;\n\ntypedef struct lfSkip {\n    unsigned short  leaf;       // LF_SKIP\n    CV_typ_t        type;       // next valid index\n    unsigned char   data[CV_ZEROLEN];     // pad data\n} lfSkip;\n\n\n\n//      argument list leaf\n\n\ntypedef struct lfArgList_16t {\n    unsigned short  leaf;           // LF_ARGLIST_16t\n    unsigned short  count;          // number of arguments\n    CV_typ16_t      arg[CV_ZEROLEN];      // number of arguments\n} lfArgList_16t;\n\ntypedef struct lfArgList {\n    unsigned short  leaf;           // LF_ARGLIST, LF_SUBSTR_LIST\n    unsigned long   count;          // number of arguments\n    CV_typ_t        arg[CV_ZEROLEN];      // number of arguments\n} lfArgList;\n\n\n\n\n//      derived class list leaf\n\n\ntypedef struct lfDerived_16t {\n    unsigned short  leaf;           // LF_DERIVED_16t\n    unsigned short  count;          // number of arguments\n    CV_typ16_t      drvdcls[CV_ZEROLEN];      // type indices of derived classes\n} lfDerived_16t;\n\ntypedef struct lfDerived {\n    unsigned short  leaf;           // LF_DERIVED\n    unsigned long   count;          // number of arguments\n    CV_typ_t        drvdcls[CV_ZEROLEN];      // type indices of derived classes\n} lfDerived;\n\n\n\n\n//      leaf for default arguments\n\n\ntypedef struct lfDefArg_16t {\n    unsigned short  leaf;               // LF_DEFARG_16t\n    CV_typ16_t      type;               // type of resulting expression\n    unsigned char   expr[CV_ZEROLEN];   // length prefixed expression string\n} lfDefArg_16t;\n\ntypedef struct lfDefArg {\n    unsigned short  leaf;               // LF_DEFARG\n    CV_typ_t        type;               // type of resulting expression\n    unsigned char   expr[CV_ZEROLEN];   // length prefixed expression string\n} lfDefArg;\n\n\n\n//      list leaf\n//          This list should no longer be used because the utilities cannot\n//          verify the contents of the list without knowing what type of list\n//          it is.  New specific leaf indices should be used instead.\n\n\ntypedef struct lfList {\n    unsigned short  leaf;           // LF_LIST\n    char            data[CV_ZEROLEN];         // data format specified by indexing type\n} lfList;\n\n\n\n\n//      field list leaf\n//      This is the header leaf for a complex list of class and structure\n//      subfields.\n\n\ntypedef struct lfFieldList_16t {\n    unsigned short  leaf;           // LF_FIELDLIST_16t\n    char            data[CV_ZEROLEN];         // field list sub lists\n} lfFieldList_16t;\n\n\ntypedef struct lfFieldList {\n    unsigned short  leaf;           // LF_FIELDLIST\n    char            data[CV_ZEROLEN];         // field list sub lists\n} lfFieldList;\n\n\n\n\n\n\n\n//  type record for non-static methods and friends in overloaded method list\n\ntypedef struct mlMethod_16t {\n    CV_fldattr_t   attr;           // method attribute\n    CV_typ16_t     index;          // index to type record for procedure\n    unsigned long  vbaseoff[CV_ZEROLEN];    // offset in vfunctable if intro virtual\n} mlMethod_16t;\n\ntypedef struct mlMethod {\n    CV_fldattr_t    attr;           // method attribute\n    _2BYTEPAD       pad0;           // internal padding, must be 0\n    CV_typ_t        index;          // index to type record for procedure\n    unsigned long   vbaseoff[CV_ZEROLEN];    // offset in vfunctable if intro virtual\n} mlMethod;\n\n\ntypedef struct lfMethodList_16t {\n    unsigned short leaf;\n    unsigned char  mList[CV_ZEROLEN];         // really a mlMethod_16t type\n} lfMethodList_16t;\n\ntypedef struct lfMethodList {\n    unsigned short leaf;\n    unsigned char  mList[CV_ZEROLEN];         // really a mlMethod type\n} lfMethodList;\n\n\n\n\n\n//      type record for LF_BITFIELD\n\n\ntypedef struct lfBitfield_16t {\n    unsigned short  leaf;           // LF_BITFIELD_16t\n    unsigned char   length;\n    unsigned char   position;\n    CV_typ16_t      type;           // type of bitfield\n\n} lfBitfield_16t;\n\ntypedef struct lfBitfield {\n    unsigned short  leaf;           // LF_BITFIELD\n    CV_typ_t        type;           // type of bitfield\n    unsigned char   length;\n    unsigned char   position;\n\n} lfBitfield;\n\n\n\n\n//      type record for dimensioned array with constant bounds\n\n\ntypedef struct lfDimCon_16t {\n    unsigned short  leaf;           // LF_DIMCONU_16t or LF_DIMCONLU_16t\n    unsigned short  rank;           // number of dimensions\n    CV_typ16_t      typ;            // type of index\n    unsigned char   dim[CV_ZEROLEN];          // array of dimension information with\n                                    // either upper bounds or lower/upper bound\n} lfDimCon_16t;\n\ntypedef struct lfDimCon {\n    unsigned short  leaf;           // LF_DIMCONU or LF_DIMCONLU\n    CV_typ_t        typ;            // type of index\n    unsigned short  rank;           // number of dimensions\n    unsigned char   dim[CV_ZEROLEN];          // array of dimension information with\n                                    // either upper bounds or lower/upper bound\n} lfDimCon;\n\n\n\n\n//      type record for dimensioned array with variable bounds\n\n\ntypedef struct lfDimVar_16t {\n    unsigned short  leaf;           // LF_DIMVARU_16t or LF_DIMVARLU_16t\n    unsigned short  rank;           // number of dimensions\n    CV_typ16_t      typ;            // type of index\n    CV_typ16_t      dim[CV_ZEROLEN];          // array of type indices for either\n                                    // variable upper bound or variable\n                                    // lower/upper bound.  The referenced\n                                    // types must be LF_REFSYM or T_VOID\n} lfDimVar_16t;\n\ntypedef struct lfDimVar {\n    unsigned short  leaf;           // LF_DIMVARU or LF_DIMVARLU\n    unsigned long   rank;           // number of dimensions\n    CV_typ_t        typ;            // type of index\n    CV_typ_t        dim[CV_ZEROLEN];          // array of type indices for either\n                                    // variable upper bound or variable\n                                    // lower/upper bound.  The count of type\n                                    // indices is rank or rank*2 depending on\n                                    // whether it is LFDIMVARU or LF_DIMVARLU.\n                                    // The referenced types must be\n                                    // LF_REFSYM or T_VOID\n} lfDimVar;\n\n\n\n\n//      type record for referenced symbol\n\n\ntypedef struct lfRefSym {\n    unsigned short  leaf;           // LF_REFSYM\n    unsigned char   Sym[1];         // copy of referenced symbol record\n                                    // (including length)\n} lfRefSym;\n\n\n\n//      type record for generic HLSL type\n\n\ntypedef struct lfHLSL {\n    unsigned short  leaf;                 // LF_HLSL\n    CV_typ_t        subtype;              // sub-type index, if any\n    unsigned short  kind;                 // kind of built-in type from CV_builtin_e\n    unsigned short  numprops :  4;        // number of numeric properties\n    unsigned short  unused   : 12;        // padding, must be 0\n    unsigned char   data[CV_ZEROLEN];     // variable-length array of numeric properties\n                                          // followed by byte size\n} lfHLSL;\n\n\n\n\n//      type record for a generalized built-in type modifier\n\n\ntypedef struct lfModifierEx {\n    unsigned short  leaf;                 // LF_MODIFIER_EX\n    CV_typ_t        type;                 // type being modified\n    unsigned short  count;                // count of modifier values\n    unsigned short  mods[CV_ZEROLEN];     // modifiers from CV_modifier_e\n} lfModifierEx;\n\n\n\n\n/**     the following are numeric leaves.  They are used to indicate the\n *      size of the following variable length data.  When the numeric\n *      data is a single byte less than 0x8000, then the data is output\n *      directly.  If the data is more the 0x8000 or is a negative value,\n *      then the data is preceded by the proper index.\n */\n\n\n\n//      signed character leaf\n\ntypedef struct lfChar {\n    unsigned short  leaf;           // LF_CHAR\n    signed char     val;            // signed 8-bit value\n} lfChar;\n\n\n\n\n//      signed short leaf\n\ntypedef struct lfShort {\n    unsigned short  leaf;           // LF_SHORT\n    short           val;            // signed 16-bit value\n} lfShort;\n\n\n\n\n//      unsigned short leaf\n\ntypedef struct lfUShort {\n    unsigned short  leaf;           // LF_unsigned short\n    unsigned short  val;            // unsigned 16-bit value\n} lfUShort;\n\n\n\n\n//      signed long leaf\n\ntypedef struct lfLong {\n    unsigned short  leaf;           // LF_LONG\n    long            val;            // signed 32-bit value\n} lfLong;\n\n\n\n\n//      unsigned long leaf\n\ntypedef struct lfULong {\n    unsigned short  leaf;           // LF_ULONG\n    unsigned long   val;            // unsigned 32-bit value\n} lfULong;\n\n\n\n\n//      signed quad leaf\n\ntypedef struct lfQuad {\n    unsigned short  leaf;           // LF_QUAD\n    unsigned char   val[8];         // signed 64-bit value\n} lfQuad;\n\n\n\n\n//      unsigned quad leaf\n\ntypedef struct lfUQuad {\n    unsigned short  leaf;           // LF_UQUAD\n    unsigned char   val[8];         // unsigned 64-bit value\n} lfUQuad;\n\n\n//      signed int128 leaf\n\ntypedef struct lfOct {\n    unsigned short  leaf;           // LF_OCT\n    unsigned char   val[16];        // signed 128-bit value\n} lfOct;\n\n//      unsigned int128 leaf\n\ntypedef struct lfUOct {\n    unsigned short  leaf;           // LF_UOCT\n    unsigned char   val[16];        // unsigned 128-bit value\n} lfUOct;\n\n\n\n\n//      real 16-bit leaf\n\ntypedef struct lfReal16 {\n    unsigned short  leaf;           // LF_REAL16\n    unsigned short  val;            // 16-bit real value\n} lfReal16;\n\n\n\n\n//      real 32-bit leaf\n\ntypedef struct lfReal32 {\n    unsigned short  leaf;           // LF_REAL32\n    float           val;            // 32-bit real value\n} lfReal32;\n\n\n\n\n//      real 48-bit leaf\n\ntypedef struct lfReal48 {\n    unsigned short  leaf;           // LF_REAL48\n    unsigned char   val[6];         // 48-bit real value\n} lfReal48;\n\n\n\n\n//      real 64-bit leaf\n\ntypedef struct lfReal64 {\n    unsigned short  leaf;           // LF_REAL64\n    double          val;            // 64-bit real value\n} lfReal64;\n\n\n\n\n//      real 80-bit leaf\n\ntypedef struct lfReal80 {\n    unsigned short  leaf;           // LF_REAL80\n    FLOAT10         val;            // real 80-bit value\n} lfReal80;\n\n\n\n\n//      real 128-bit leaf\n\ntypedef struct lfReal128 {\n    unsigned short  leaf;           // LF_REAL128\n    char            val[16];        // real 128-bit value\n} lfReal128;\n\n\n\n\n//      complex 32-bit leaf\n\ntypedef struct lfCmplx32 {\n    unsigned short  leaf;           // LF_COMPLEX32\n    float           val_real;       // real component\n    float           val_imag;       // imaginary component\n} lfCmplx32;\n\n\n\n\n//      complex 64-bit leaf\n\ntypedef struct lfCmplx64 {\n    unsigned short  leaf;           // LF_COMPLEX64\n    double          val_real;       // real component\n    double          val_imag;       // imaginary component\n} flCmplx64;\n\n\n\n\n//      complex 80-bit leaf\n\ntypedef struct lfCmplx80 {\n    unsigned short  leaf;           // LF_COMPLEX80\n    FLOAT10         val_real;       // real component\n    FLOAT10         val_imag;       // imaginary component\n} lfCmplx80;\n\n\n\n\n//      complex 128-bit leaf\n\ntypedef struct lfCmplx128 {\n    unsigned short  leaf;           // LF_COMPLEX128\n    char            val_real[16];   // real component\n    char            val_imag[16];   // imaginary component\n} lfCmplx128;\n\n\n\n//  variable length numeric field\n\ntypedef struct lfVarString {\n    unsigned short  leaf;       // LF_VARSTRING\n    unsigned short  len;        // length of value in bytes\n    unsigned char   value[CV_ZEROLEN];  // value\n} lfVarString;\n\n//***********************************************************************\n\n\n//      index leaf - contains type index of another leaf\n//      a major use of this leaf is to allow the compilers to emit a\n//      long complex list (LF_FIELD) in smaller pieces.\n\ntypedef struct lfIndex_16t {\n    unsigned short  leaf;           // LF_INDEX_16t\n    CV_typ16_t      index;          // type index of referenced leaf\n} lfIndex_16t;\n\ntypedef struct lfIndex {\n    unsigned short  leaf;           // LF_INDEX\n    _2BYTEPAD       pad0;           // internal padding, must be 0\n    CV_typ_t        index;          // type index of referenced leaf\n} lfIndex;\n\n\n//      subfield record for base class field\n\ntypedef struct lfBClass_16t {\n    unsigned short  leaf;           // LF_BCLASS_16t\n    CV_typ16_t      index;          // type index of base class\n    CV_fldattr_t    attr;           // attribute\n    unsigned char   offset[CV_ZEROLEN];       // variable length offset of base within class\n} lfBClass_16t;\n\ntypedef struct lfBClass {\n    unsigned short  leaf;           // LF_BCLASS, LF_BINTERFACE\n    CV_fldattr_t    attr;           // attribute\n    CV_typ_t        index;          // type index of base class\n    unsigned char   offset[CV_ZEROLEN];       // variable length offset of base within class\n} lfBClass;\ntypedef lfBClass lfBInterface;\n\n\n\n\n//      subfield record for direct and indirect virtual base class field\n\ntypedef struct lfVBClass_16t {\n    unsigned short  leaf;           // LF_VBCLASS_16t | LV_IVBCLASS_16t\n    CV_typ16_t      index;          // type index of direct virtual base class\n    CV_typ16_t      vbptr;          // type index of virtual base pointer\n    CV_fldattr_t    attr;           // attribute\n    unsigned char   vbpoff[CV_ZEROLEN];       // virtual base pointer offset from address point\n                                    // followed by virtual base offset from vbtable\n} lfVBClass_16t;\n\ntypedef struct lfVBClass {\n    unsigned short  leaf;           // LF_VBCLASS | LV_IVBCLASS\n    CV_fldattr_t    attr;           // attribute\n    CV_typ_t        index;          // type index of direct virtual base class\n    CV_typ_t        vbptr;          // type index of virtual base pointer\n    unsigned char   vbpoff[CV_ZEROLEN];       // virtual base pointer offset from address point\n                                    // followed by virtual base offset from vbtable\n} lfVBClass;\n\n\n\n\n\n//      subfield record for friend class\n\n\ntypedef struct lfFriendCls_16t {\n    unsigned short  leaf;           // LF_FRIENDCLS_16t\n    CV_typ16_t      index;          // index to type record of friend class\n} lfFriendCls_16t;\n\ntypedef struct lfFriendCls {\n    unsigned short  leaf;           // LF_FRIENDCLS\n    _2BYTEPAD       pad0;           // internal padding, must be 0\n    CV_typ_t        index;          // index to type record of friend class\n} lfFriendCls;\n\n\n\n\n\n//      subfield record for friend function\n\n\ntypedef struct lfFriendFcn_16t {\n    unsigned short  leaf;           // LF_FRIENDFCN_16t\n    CV_typ16_t      index;          // index to type record of friend function\n    unsigned char   Name[1];        // name of friend function\n} lfFriendFcn_16t;\n\ntypedef struct lfFriendFcn {\n    unsigned short  leaf;           // LF_FRIENDFCN\n    _2BYTEPAD       pad0;           // internal padding, must be 0\n    CV_typ_t        index;          // index to type record of friend function\n    unsigned char   Name[1];        // name of friend function\n} lfFriendFcn;\n\n\n\n//      subfield record for non-static data members\n\ntypedef struct lfMember_16t {\n    unsigned short  leaf;           // LF_MEMBER_16t\n    CV_typ16_t      index;          // index of type record for field\n    CV_fldattr_t    attr;           // attribute mask\n    unsigned char   offset[CV_ZEROLEN];       // variable length offset of field followed\n                                    // by length prefixed name of field\n} lfMember_16t;\n\ntypedef struct lfMember {\n    unsigned short  leaf;           // LF_MEMBER\n    CV_fldattr_t    attr;           // attribute mask\n    CV_typ_t        index;          // index of type record for field\n    unsigned char   offset[CV_ZEROLEN];       // variable length offset of field followed\n                                    // by length prefixed name of field\n} lfMember;\n\n\n\n//  type record for static data members\n\ntypedef struct lfSTMember_16t {\n    unsigned short  leaf;           // LF_STMEMBER_16t\n    CV_typ16_t      index;          // index of type record for field\n    CV_fldattr_t    attr;           // attribute mask\n    unsigned char   Name[1];        // length prefixed name of field\n} lfSTMember_16t;\n\ntypedef struct lfSTMember {\n    unsigned short  leaf;           // LF_STMEMBER\n    CV_fldattr_t    attr;           // attribute mask\n    CV_typ_t        index;          // index of type record for field\n    unsigned char   Name[1];        // length prefixed name of field\n} lfSTMember;\n\n\n\n//      subfield record for virtual function table pointer\n\ntypedef struct lfVFuncTab_16t {\n    unsigned short  leaf;           // LF_VFUNCTAB_16t\n    CV_typ16_t      type;           // type index of pointer\n} lfVFuncTab_16t;\n\ntypedef struct lfVFuncTab {\n    unsigned short  leaf;           // LF_VFUNCTAB\n    _2BYTEPAD       pad0;           // internal padding, must be 0\n    CV_typ_t        type;           // type index of pointer\n} lfVFuncTab;\n\n\n\n//      subfield record for virtual function table pointer with offset\n\ntypedef struct lfVFuncOff_16t {\n    unsigned short  leaf;           // LF_VFUNCOFF_16t\n    CV_typ16_t      type;           // type index of pointer\n    CV_off32_t      offset;         // offset of virtual function table pointer\n} lfVFuncOff_16t;\n\ntypedef struct lfVFuncOff {\n    unsigned short  leaf;           // LF_VFUNCOFF\n    _2BYTEPAD       pad0;           // internal padding, must be 0.\n    CV_typ_t        type;           // type index of pointer\n    CV_off32_t      offset;         // offset of virtual function table pointer\n} lfVFuncOff;\n\n\n\n//      subfield record for overloaded method list\n\n\ntypedef struct lfMethod_16t {\n    unsigned short  leaf;           // LF_METHOD_16t\n    unsigned short  count;          // number of occurrences of function\n    CV_typ16_t      mList;          // index to LF_METHODLIST record\n    unsigned char   Name[1];        // length prefixed name of method\n} lfMethod_16t;\n\ntypedef struct lfMethod {\n    unsigned short  leaf;           // LF_METHOD\n    unsigned short  count;          // number of occurrences of function\n    CV_typ_t        mList;          // index to LF_METHODLIST record\n    unsigned char   Name[1];        // length prefixed name of method\n} lfMethod;\n\n\n\n//      subfield record for nonoverloaded method\n\n\ntypedef struct lfOneMethod_16t {\n    unsigned short leaf;            // LF_ONEMETHOD_16t\n    CV_fldattr_t   attr;            // method attribute\n    CV_typ16_t     index;           // index to type record for procedure\n    unsigned long  vbaseoff[CV_ZEROLEN];    // offset in vfunctable if\n                                    // intro virtual followed by\n                                    // length prefixed name of method\n} lfOneMethod_16t;\n\ntypedef struct lfOneMethod {\n    unsigned short leaf;            // LF_ONEMETHOD\n    CV_fldattr_t   attr;            // method attribute\n    CV_typ_t       index;           // index to type record for procedure\n    unsigned long  vbaseoff[CV_ZEROLEN];    // offset in vfunctable if\n                                    // intro virtual followed by\n                                    // length prefixed name of method\n} lfOneMethod;\n\n\n//      subfield record for enumerate\n\ntypedef struct lfEnumerate {\n    unsigned short  leaf;       // LF_ENUMERATE\n    CV_fldattr_t    attr;       // access\n    unsigned char   value[CV_ZEROLEN];    // variable length value field followed\n                                // by length prefixed name\n} lfEnumerate;\n\n\n//  type record for nested (scoped) type definition\n\ntypedef struct lfNestType_16t {\n    unsigned short  leaf;       // LF_NESTTYPE_16t\n    CV_typ16_t      index;      // index of nested type definition\n    unsigned char   Name[1];    // length prefixed type name\n} lfNestType_16t;\n\ntypedef struct lfNestType {\n    unsigned short  leaf;       // LF_NESTTYPE\n    _2BYTEPAD       pad0;       // internal padding, must be 0\n    CV_typ_t        index;      // index of nested type definition\n    unsigned char   Name[1];    // length prefixed type name\n} lfNestType;\n\n//  type record for nested (scoped) type definition, with attributes\n//  new records for vC v5.0, no need to have 16-bit ti versions.\n\ntypedef struct lfNestTypeEx {\n    unsigned short  leaf;       // LF_NESTTYPEEX\n    CV_fldattr_t    attr;       // member access\n    CV_typ_t        index;      // index of nested type definition\n    unsigned char   Name[1];    // length prefixed type name\n} lfNestTypeEx;\n\n//  type record for modifications to members\n\ntypedef struct lfMemberModify {\n    unsigned short  leaf;       // LF_MEMBERMODIFY\n    CV_fldattr_t    attr;       // the new attributes\n    CV_typ_t        index;      // index of base class type definition\n    unsigned char   Name[1];    // length prefixed member name\n} lfMemberModify;\n\n//  type record for pad leaf\n\ntypedef struct lfPad {\n    unsigned char   leaf;\n} SYM_PAD;\n\n\n\n//  Symbol definitions\n\ntypedef enum SYM_ENUM_e {\n    S_COMPILE       =  0x0001,  // Compile flags symbol\n    S_REGISTER_16t  =  0x0002,  // Register variable\n    S_CONSTANT_16t  =  0x0003,  // constant symbol\n    S_UDT_16t       =  0x0004,  // User defined type\n    S_SSEARCH       =  0x0005,  // Start Search\n    S_END           =  0x0006,  // Block, procedure, \"with\" or thunk end\n    S_SKIP          =  0x0007,  // Reserve symbol space in $$Symbols table\n    S_CVRESERVE     =  0x0008,  // Reserved symbol for CV internal use\n    S_OBJNAME_ST    =  0x0009,  // path to object file name\n    S_ENDARG        =  0x000a,  // end of argument/return list\n    S_COBOLUDT_16t  =  0x000b,  // special UDT for cobol that does not symbol pack\n    S_MANYREG_16t   =  0x000c,  // multiple register variable\n    S_RETURN        =  0x000d,  // return description symbol\n    S_ENTRYTHIS     =  0x000e,  // description of this pointer on entry\n\n    S_BPREL16       =  0x0100,  // BP-relative\n    S_LDATA16       =  0x0101,  // Module-local symbol\n    S_GDATA16       =  0x0102,  // Global data symbol\n    S_PUB16         =  0x0103,  // a public symbol\n    S_LPROC16       =  0x0104,  // Local procedure start\n    S_GPROC16       =  0x0105,  // Global procedure start\n    S_THUNK16       =  0x0106,  // Thunk Start\n    S_BLOCK16       =  0x0107,  // block start\n    S_WITH16        =  0x0108,  // with start\n    S_LABEL16       =  0x0109,  // code label\n    S_CEXMODEL16    =  0x010a,  // change execution model\n    S_VFTABLE16     =  0x010b,  // address of virtual function table\n    S_REGREL16      =  0x010c,  // register relative address\n\n    S_BPREL32_16t   =  0x0200,  // BP-relative\n    S_LDATA32_16t   =  0x0201,  // Module-local symbol\n    S_GDATA32_16t   =  0x0202,  // Global data symbol\n    S_PUB32_16t     =  0x0203,  // a public symbol (CV internal reserved)\n    S_LPROC32_16t   =  0x0204,  // Local procedure start\n    S_GPROC32_16t   =  0x0205,  // Global procedure start\n    S_THUNK32_ST    =  0x0206,  // Thunk Start\n    S_BLOCK32_ST    =  0x0207,  // block start\n    S_WITH32_ST     =  0x0208,  // with start\n    S_LABEL32_ST    =  0x0209,  // code label\n    S_CEXMODEL32    =  0x020a,  // change execution model\n    S_VFTABLE32_16t =  0x020b,  // address of virtual function table\n    S_REGREL32_16t  =  0x020c,  // register relative address\n    S_LTHREAD32_16t =  0x020d,  // local thread storage\n    S_GTHREAD32_16t =  0x020e,  // global thread storage\n    S_SLINK32       =  0x020f,  // static link for MIPS EH implementation\n\n    S_LPROCMIPS_16t =  0x0300,  // Local procedure start\n    S_GPROCMIPS_16t =  0x0301,  // Global procedure start\n\n    // if these ref symbols have names following then the names are in ST format\n    S_PROCREF_ST    =  0x0400,  // Reference to a procedure\n    S_DATAREF_ST    =  0x0401,  // Reference to data\n    S_ALIGN         =  0x0402,  // Used for page alignment of symbols\n\n    S_LPROCREF_ST   =  0x0403,  // Local Reference to a procedure\n    S_OEM           =  0x0404,  // OEM defined symbol\n\n    // sym records with 32-bit types embedded instead of 16-bit\n    // all have 0x1000 bit set for easy identification\n    // only do the 32-bit target versions since we don't really\n    // care about 16-bit ones anymore.\n    S_TI16_MAX          =  0x1000,\n\n    S_REGISTER_ST   =  0x1001,  // Register variable\n    S_CONSTANT_ST   =  0x1002,  // constant symbol\n    S_UDT_ST        =  0x1003,  // User defined type\n    S_COBOLUDT_ST   =  0x1004,  // special UDT for cobol that does not symbol pack\n    S_MANYREG_ST    =  0x1005,  // multiple register variable\n    S_BPREL32_ST    =  0x1006,  // BP-relative\n    S_LDATA32_ST    =  0x1007,  // Module-local symbol\n    S_GDATA32_ST    =  0x1008,  // Global data symbol\n    S_PUB32_ST      =  0x1009,  // a public symbol (CV internal reserved)\n    S_LPROC32_ST    =  0x100a,  // Local procedure start\n    S_GPROC32_ST    =  0x100b,  // Global procedure start\n    S_VFTABLE32     =  0x100c,  // address of virtual function table\n    S_REGREL32_ST   =  0x100d,  // register relative address\n    S_LTHREAD32_ST  =  0x100e,  // local thread storage\n    S_GTHREAD32_ST  =  0x100f,  // global thread storage\n\n    S_LPROCMIPS_ST  =  0x1010,  // Local procedure start\n    S_GPROCMIPS_ST  =  0x1011,  // Global procedure start\n\n    S_FRAMEPROC     =  0x1012,  // extra frame and proc information\n    S_COMPILE2_ST   =  0x1013,  // extended compile flags and info\n\n    // new symbols necessary for 16-bit enumerates of IA64 registers\n    // and IA64 specific symbols\n\n    S_MANYREG2_ST   =  0x1014,  // multiple register variable\n    S_LPROCIA64_ST  =  0x1015,  // Local procedure start (IA64)\n    S_GPROCIA64_ST  =  0x1016,  // Global procedure start (IA64)\n\n    // Local symbols for IL\n    S_LOCALSLOT_ST  =  0x1017,  // local IL sym with field for local slot index\n    S_PARAMSLOT_ST  =  0x1018,  // local IL sym with field for parameter slot index\n\n    S_ANNOTATION    =  0x1019,  // Annotation string literals\n\n    // symbols to support managed code debugging\n    S_GMANPROC_ST   =  0x101a,  // Global proc\n    S_LMANPROC_ST   =  0x101b,  // Local proc\n    S_RESERVED1     =  0x101c,  // reserved\n    S_RESERVED2     =  0x101d,  // reserved\n    S_RESERVED3     =  0x101e,  // reserved\n    S_RESERVED4     =  0x101f,  // reserved\n    S_LMANDATA_ST   =  0x1020,\n    S_GMANDATA_ST   =  0x1021,\n    S_MANFRAMEREL_ST=  0x1022,\n    S_MANREGISTER_ST=  0x1023,\n    S_MANSLOT_ST    =  0x1024,\n    S_MANMANYREG_ST =  0x1025,\n    S_MANREGREL_ST  =  0x1026,\n    S_MANMANYREG2_ST=  0x1027,\n    S_MANTYPREF     =  0x1028,  // Index for type referenced by name from metadata\n    S_UNAMESPACE_ST =  0x1029,  // Using namespace\n\n    // Symbols w/ SZ name fields. All name fields contain utf8 encoded strings.\n    S_ST_MAX        =  0x1100,  // starting point for SZ name symbols\n\n    S_OBJNAME       =  0x1101,  // path to object file name\n    S_THUNK32       =  0x1102,  // Thunk Start\n    S_BLOCK32       =  0x1103,  // block start\n    S_WITH32        =  0x1104,  // with start\n    S_LABEL32       =  0x1105,  // code label\n    S_REGISTER      =  0x1106,  // Register variable\n    S_CONSTANT      =  0x1107,  // constant symbol\n    S_UDT           =  0x1108,  // User defined type\n    S_COBOLUDT      =  0x1109,  // special UDT for cobol that does not symbol pack\n    S_MANYREG       =  0x110a,  // multiple register variable\n    S_BPREL32       =  0x110b,  // BP-relative\n    S_LDATA32       =  0x110c,  // Module-local symbol\n    S_GDATA32       =  0x110d,  // Global data symbol\n    S_PUB32         =  0x110e,  // a public symbol (CV internal reserved)\n    S_LPROC32       =  0x110f,  // Local procedure start\n    S_GPROC32       =  0x1110,  // Global procedure start\n    S_REGREL32      =  0x1111,  // register relative address\n    S_LTHREAD32     =  0x1112,  // local thread storage\n    S_GTHREAD32     =  0x1113,  // global thread storage\n\n    S_LPROCMIPS     =  0x1114,  // Local procedure start\n    S_GPROCMIPS     =  0x1115,  // Global procedure start\n    S_COMPILE2      =  0x1116,  // extended compile flags and info\n    S_MANYREG2      =  0x1117,  // multiple register variable\n    S_LPROCIA64     =  0x1118,  // Local procedure start (IA64)\n    S_GPROCIA64     =  0x1119,  // Global procedure start (IA64)\n    S_LOCALSLOT     =  0x111a,  // local IL sym with field for local slot index\n    S_SLOT          = S_LOCALSLOT,  // alias for LOCALSLOT\n    S_PARAMSLOT     =  0x111b,  // local IL sym with field for parameter slot index\n\n    // symbols to support managed code debugging\n    S_LMANDATA      =  0x111c,\n    S_GMANDATA      =  0x111d,\n    S_MANFRAMEREL   =  0x111e,\n    S_MANREGISTER   =  0x111f,\n    S_MANSLOT       =  0x1120,\n    S_MANMANYREG    =  0x1121,\n    S_MANREGREL     =  0x1122,\n    S_MANMANYREG2   =  0x1123,\n    S_UNAMESPACE    =  0x1124,  // Using namespace\n\n    // ref symbols with name fields\n    S_PROCREF       =  0x1125,  // Reference to a procedure\n    S_DATAREF       =  0x1126,  // Reference to data\n    S_LPROCREF      =  0x1127,  // Local Reference to a procedure\n    S_ANNOTATIONREF =  0x1128,  // Reference to an S_ANNOTATION symbol\n    S_TOKENREF      =  0x1129,  // Reference to one of the many MANPROCSYM's\n\n    // continuation of managed symbols\n    S_GMANPROC      =  0x112a,  // Global proc\n    S_LMANPROC      =  0x112b,  // Local proc\n\n    // short, light-weight thunks\n    S_TRAMPOLINE    =  0x112c,  // trampoline thunks\n    S_MANCONSTANT   =  0x112d,  // constants with metadata type info\n\n    // native attributed local/parms\n    S_ATTR_FRAMEREL =  0x112e,  // relative to virtual frame ptr\n    S_ATTR_REGISTER =  0x112f,  // stored in a register\n    S_ATTR_REGREL   =  0x1130,  // relative to register (alternate frame ptr)\n    S_ATTR_MANYREG  =  0x1131,  // stored in >1 register\n\n    // Separated code (from the compiler) support\n    S_SEPCODE       =  0x1132,\n\n    S_LOCAL_2005    =  0x1133,  // defines a local symbol in optimized code\n    S_DEFRANGE_2005 =  0x1134,  // defines a single range of addresses in which symbol can be evaluated\n    S_DEFRANGE2_2005 =  0x1135,  // defines ranges of addresses in which symbol can be evaluated\n\n    S_SECTION       =  0x1136,  // A COFF section in a PE executable\n    S_COFFGROUP     =  0x1137,  // A COFF group\n    S_EXPORT        =  0x1138,  // A export\n\n    S_CALLSITEINFO  =  0x1139,  // Indirect call site information\n    S_FRAMECOOKIE   =  0x113a,  // Security cookie information\n\n    S_DISCARDED     =  0x113b,  // Discarded by LINK /OPT:REF (experimental, see richards)\n\n    S_COMPILE3      =  0x113c,  // Replacement for S_COMPILE2\n    S_ENVBLOCK      =  0x113d,  // Environment block split off from S_COMPILE2\n\n    S_LOCAL         =  0x113e,  // defines a local symbol in optimized code\n    S_DEFRANGE      =  0x113f,  // defines a single range of addresses in which symbol can be evaluated\n    S_DEFRANGE_SUBFIELD =  0x1140,           // ranges for a subfield\n\n    S_DEFRANGE_REGISTER =  0x1141,           // ranges for en-registered symbol\n    S_DEFRANGE_FRAMEPOINTER_REL =  0x1142,   // range for stack symbol.\n    S_DEFRANGE_SUBFIELD_REGISTER =  0x1143,  // ranges for en-registered field of symbol\n    S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE =  0x1144, // range for stack symbol span valid full scope of function body, gap might apply.\n    S_DEFRANGE_REGISTER_REL =  0x1145, // range for symbol address as register + offset.\n\n    // S_PROC symbols that reference ID instead of type\n    S_LPROC32_ID     =  0x1146,\n    S_GPROC32_ID     =  0x1147,\n    S_LPROCMIPS_ID   =  0x1148,\n    S_GPROCMIPS_ID   =  0x1149,\n    S_LPROCIA64_ID   =  0x114a,\n    S_GPROCIA64_ID   =  0x114b,\n\n    S_BUILDINFO      = 0x114c, // build information.\n    S_INLINESITE     = 0x114d, // inlined function callsite.\n    S_INLINESITE_END = 0x114e,\n    S_PROC_ID_END    = 0x114f,\n\n    S_DEFRANGE_HLSL  = 0x1150,\n    S_GDATA_HLSL     = 0x1151,\n    S_LDATA_HLSL     = 0x1152,\n\n    S_FILESTATIC     = 0x1153,\n\n#if defined(CC_DP_CXX) && CC_DP_CXX\n\n    S_LOCAL_DPC_GROUPSHARED = 0x1154, // DPC groupshared variable\n    S_LPROC32_DPC = 0x1155, // DPC local procedure start\n    S_LPROC32_DPC_ID =  0x1156,\n    S_DEFRANGE_DPC_PTR_TAG =  0x1157, // DPC pointer tag definition range\n    S_DPC_SYM_TAG_MAP = 0x1158, // DPC pointer tag value to symbol record map\n\n#endif // CC_DP_CXX\n\n    S_ARMSWITCHTABLE  = 0x1159,\n    S_CALLEES = 0x115a,\n    S_CALLERS = 0x115b,\n    S_POGODATA = 0x115c,\n    S_INLINESITE2 = 0x115d,      // extended inline site information\n\n    S_HEAPALLOCSITE = 0x115e,    // heap allocation site\n\n    S_MOD_TYPEREF = 0x115f,      // only generated at link time\n\n    S_REF_MINIPDB = 0x1160,      // only generated at link time for mini PDB\n    S_PDBMAP      = 0x1161,      // only generated at link time for mini PDB\n\n    S_GDATA_HLSL32 = 0x1162,\n    S_LDATA_HLSL32 = 0x1163,\n\n    S_GDATA_HLSL32_EX = 0x1164,\n    S_LDATA_HLSL32_EX = 0x1165,\n\n    S_RECTYPE_MAX,               // one greater than last\n    S_RECTYPE_LAST  = S_RECTYPE_MAX - 1,\n    S_RECTYPE_PAD   = S_RECTYPE_MAX + 0x100 // Used *only* to verify symbol record types so that current PDB code can potentially read\n                                // future PDBs (assuming no format change, etc).\n\n} SYM_ENUM_e;\n\n\n//  enum describing compile flag ambient data model\n\n\ntypedef enum CV_CFL_DATA {\n    CV_CFL_DNEAR    = 0x00,\n    CV_CFL_DFAR     = 0x01,\n    CV_CFL_DHUGE    = 0x02\n} CV_CFL_DATA;\n\n\n\n\n//  enum describing compile flag ambiant code model\n\n\ntypedef enum CV_CFL_CODE_e {\n    CV_CFL_CNEAR    = 0x00,\n    CV_CFL_CFAR     = 0x01,\n    CV_CFL_CHUGE    = 0x02\n} CV_CFL_CODE_e;\n\n\n\n\n//  enum describing compile flag target floating point package\n\ntypedef enum CV_CFL_FPKG_e {\n    CV_CFL_NDP      = 0x00,\n    CV_CFL_EMU      = 0x01,\n    CV_CFL_ALT      = 0x02\n} CV_CFL_FPKG_e;\n\n\n// enum describing function return method\n\n\ntypedef struct CV_PROCFLAGS {\n    union {\n        unsigned char   bAll;\n        unsigned char   grfAll;\n        struct {\n            unsigned char CV_PFLAG_NOFPO     :1; // frame pointer present\n            unsigned char CV_PFLAG_INT       :1; // interrupt return\n            unsigned char CV_PFLAG_FAR       :1; // far return\n            unsigned char CV_PFLAG_NEVER     :1; // function does not return\n            unsigned char CV_PFLAG_NOTREACHED:1; // label isn't fallen into\n            unsigned char CV_PFLAG_CUST_CALL :1; // custom calling convention\n            unsigned char CV_PFLAG_NOINLINE  :1; // function marked as noinline\n            unsigned char CV_PFLAG_OPTDBGINFO:1; // function has debug information for optimized code\n        };\n    };\n} CV_PROCFLAGS;\n\n// Extended proc flags\n//\ntypedef struct CV_EXPROCFLAGS {\n    CV_PROCFLAGS cvpf;\n    union {\n        unsigned char   grfAll;\n        struct {\n            unsigned char   __reserved_byte      :8; // must be zero\n        };\n    };\n} CV_EXPROCFLAGS;\n\n// local variable flags\ntypedef struct CV_LVARFLAGS {\n    unsigned short fIsParam          :1; // variable is a parameter\n    unsigned short fAddrTaken        :1; // address is taken\n    unsigned short fCompGenx         :1; // variable is compiler generated\n    unsigned short fIsAggregate      :1; // the symbol is splitted in temporaries,\n                                         // which are treated by compiler as\n                                         // independent entities\n    unsigned short fIsAggregated     :1; // Counterpart of fIsAggregate - tells\n                                         // that it is a part of a fIsAggregate symbol\n    unsigned short fIsAliased        :1; // variable has multiple simultaneous lifetimes\n    unsigned short fIsAlias          :1; // represents one of the multiple simultaneous lifetimes\n    unsigned short fIsRetValue       :1; // represents a function return value\n    unsigned short fIsOptimizedOut   :1; // variable has no lifetimes\n    unsigned short fIsEnregGlob      :1; // variable is an enregistered global\n    unsigned short fIsEnregStat      :1; // variable is an enregistered static\n\n    unsigned short unused            :5; // must be zero\n\n} CV_LVARFLAGS;\n\n// extended attributes common to all local variables\ntypedef struct CV_lvar_attr {\n    CV_uoff32_t     off;        // first code address where var is live\n    unsigned short  seg;\n    CV_LVARFLAGS    flags;      // local var flags\n} CV_lvar_attr;\n\n// This is max length of a lexical linear IP range.\n// The upper number are reserved for seeded and flow based range\n\n#define CV_LEXICAL_RANGE_MAX  0xF000\n\n// represents an address range, used for optimized code debug info\n\ntypedef struct CV_LVAR_ADDR_RANGE {       // defines a range of addresses\n    CV_uoff32_t     offStart;\n    unsigned short  isectStart;\n    unsigned short  cbRange;\n} CV_LVAR_ADDR_RANGE;\n\n// Represents the holes in overall address range, all address is pre-bbt.\n// it is for compress and reduce the amount of relocations need.\n\ntypedef struct CV_LVAR_ADDR_GAP {\n    unsigned short  gapStartOffset;   // relative offset from the beginning of the live range.\n    unsigned short  cbRange;          // length of this gap.\n} CV_LVAR_ADDR_GAP;\n\n#if defined(CC_DP_CXX) && CC_DP_CXX\n\n// Represents a mapping from a DPC pointer tag value to the corresponding symbol record\ntypedef struct CV_DPC_SYM_TAG_MAP_ENTRY {\n    unsigned int tagValue;       // address taken symbol's pointer tag value.\n    CV_off32_t  symRecordOffset; // offset of the symbol record from the S_LPROC32_DPC record it is nested within\n} CV_DPC_SYM_TAG_MAP_ENTRY;\n\n#endif // CC_DP_CXX\n\n// enum describing function data return method\n\ntypedef enum CV_GENERIC_STYLE_e {\n    CV_GENERIC_VOID   = 0x00,       // void return type\n    CV_GENERIC_REG    = 0x01,       // return data is in registers\n    CV_GENERIC_ICAN   = 0x02,       // indirect caller allocated near\n    CV_GENERIC_ICAF   = 0x03,       // indirect caller allocated far\n    CV_GENERIC_IRAN   = 0x04,       // indirect returnee allocated near\n    CV_GENERIC_IRAF   = 0x05,       // indirect returnee allocated far\n    CV_GENERIC_UNUSED = 0x06        // first unused\n} CV_GENERIC_STYLE_e;\n\n\ntypedef struct CV_GENERIC_FLAG {\n    unsigned short  cstyle  :1;     // true push varargs right to left\n    unsigned short  rsclean :1;     // true if returnee stack cleanup\n    unsigned short  unused  :14;    // unused\n} CV_GENERIC_FLAG;\n\n\n// flag bitfields for separated code attributes\n\ntypedef struct CV_SEPCODEFLAGS {\n    unsigned long fIsLexicalScope : 1;     // S_SEPCODE doubles as lexical scope\n    unsigned long fReturnsToParent : 1;    // code frag returns to parent\n    unsigned long pad : 30;                // must be zero\n} CV_SEPCODEFLAGS;\n\n// Generic layout for symbol records\n\ntypedef struct SYMTYPE {\n    unsigned short      reclen;     // Record length\n    unsigned short      rectyp;     // Record type\n    char                data[CV_ZEROLEN];\n} SYMTYPE;\n\n__INLINE SYMTYPE *NextSym (SYMTYPE * pSym) {\n    return (SYMTYPE *) ((char *)pSym + pSym->reclen + sizeof(unsigned short));\n}\n\n//      non-model specific symbol types\n\n\n\ntypedef struct REGSYM_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_REGISTER_16t\n    CV_typ16_t      typind;     // Type index\n    unsigned short  reg;        // register enumerate\n    unsigned char   name[1];    // Length-prefixed name\n} REGSYM_16t;\n\ntypedef struct REGSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_REGISTER\n    CV_typ_t        typind;     // Type index or Metadata token\n    unsigned short  reg;        // register enumerate\n    unsigned char   name[1];    // Length-prefixed name\n} REGSYM;\n\ntypedef struct ATTRREGSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANREGISTER | S_ATTR_REGISTER\n    CV_typ_t        typind;     // Type index or Metadata token\n    CV_lvar_attr    attr;       // local var attributes\n    unsigned short  reg;        // register enumerate\n    unsigned char   name[1];    // Length-prefixed name\n} ATTRREGSYM;\n\ntypedef struct MANYREGSYM_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANYREG_16t\n    CV_typ16_t      typind;     // Type index\n    unsigned char   count;      // count of number of registers\n    unsigned char   reg[1];     // count register enumerates followed by\n                                // length-prefixed name.  Registers are\n                                // most significant first.\n} MANYREGSYM_16t;\n\ntypedef struct MANYREGSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANYREG\n    CV_typ_t        typind;     // Type index or metadata token\n    unsigned char   count;      // count of number of registers\n    unsigned char   reg[1];     // count register enumerates followed by\n                                // length-prefixed name.  Registers are\n                                // most significant first.\n} MANYREGSYM;\n\ntypedef struct MANYREGSYM2 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANYREG2\n    CV_typ_t        typind;     // Type index or metadata token\n    unsigned short  count;      // count of number of registers\n    unsigned short  reg[1];     // count register enumerates followed by\n                                // length-prefixed name.  Registers are\n                                // most significant first.\n} MANYREGSYM2;\n\ntypedef struct ATTRMANYREGSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANMANYREG\n    CV_typ_t        typind;     // Type index or metadata token\n    CV_lvar_attr    attr;       // local var attributes\n    unsigned char   count;      // count of number of registers\n    unsigned char   reg[1];     // count register enumerates followed by\n                                // length-prefixed name.  Registers are\n                                // most significant first.\n    unsigned char   name[CV_ZEROLEN];   // utf-8 encoded zero terminate name\n} ATTRMANYREGSYM;\n\ntypedef struct ATTRMANYREGSYM2 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANMANYREG2 | S_ATTR_MANYREG\n    CV_typ_t        typind;     // Type index or metadata token\n    CV_lvar_attr    attr;       // local var attributes\n    unsigned short  count;      // count of number of registers\n    unsigned short  reg[1];     // count register enumerates followed by\n                                // length-prefixed name.  Registers are\n                                // most significant first.\n    unsigned char   name[CV_ZEROLEN];   // utf-8 encoded zero terminate name\n} ATTRMANYREGSYM2;\n\ntypedef struct CONSTSYM_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_CONSTANT_16t\n    CV_typ16_t      typind;     // Type index (containing enum if enumerate)\n    unsigned short  value;      // numeric leaf containing value\n    unsigned char   name[CV_ZEROLEN];     // Length-prefixed name\n} CONSTSYM_16t;\n\ntypedef struct CONSTSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_CONSTANT or S_MANCONSTANT\n    CV_typ_t        typind;     // Type index (containing enum if enumerate) or metadata token\n    unsigned short  value;      // numeric leaf containing value\n    unsigned char   name[CV_ZEROLEN];     // Length-prefixed name\n} CONSTSYM;\n\n\ntypedef struct UDTSYM_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_UDT_16t | S_COBOLUDT_16t\n    CV_typ16_t      typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} UDTSYM_16t;\n\n\ntypedef struct UDTSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_UDT | S_COBOLUDT\n    CV_typ_t        typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} UDTSYM;\n\ntypedef struct MANTYPREF {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANTYPREF\n    CV_typ_t        typind;     // Type index\n} MANTYPREF;\n\ntypedef struct SEARCHSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_SSEARCH\n    unsigned long   startsym;   // offset of the procedure\n    unsigned short  seg;        // segment of symbol\n} SEARCHSYM;\n\n\ntypedef struct CFLAGSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_COMPILE\n    unsigned char   machine;    // target processor\n    struct  {\n        unsigned char   language    :8; // language index\n        unsigned char   pcode       :1; // true if pcode present\n        unsigned char   floatprec   :2; // floating precision\n        unsigned char   floatpkg    :2; // float package\n        unsigned char   ambdata     :3; // ambient data model\n        unsigned char   ambcode     :3; // ambient code model\n        unsigned char   mode32      :1; // true if compiled 32 bit mode\n        unsigned char   pad         :4; // reserved\n    } flags;\n    unsigned char       ver[1];     // Length-prefixed compiler version string\n} CFLAGSYM;\n\n\ntypedef struct COMPILESYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_COMPILE2\n    struct {\n        unsigned long   iLanguage       :  8;   // language index\n        unsigned long   fEC             :  1;   // compiled for E/C\n        unsigned long   fNoDbgInfo      :  1;   // not compiled with debug info\n        unsigned long   fLTCG           :  1;   // compiled with LTCG\n        unsigned long   fNoDataAlign    :  1;   // compiled with -Bzalign\n        unsigned long   fManagedPresent :  1;   // managed code/data present\n        unsigned long   fSecurityChecks :  1;   // compiled with /GS\n        unsigned long   fHotPatch       :  1;   // compiled with /hotpatch\n        unsigned long   fCVTCIL         :  1;   // converted with CVTCIL\n        unsigned long   fMSILModule     :  1;   // MSIL netmodule\n        unsigned long   pad             : 15;   // reserved, must be 0\n    } flags;\n    unsigned short  machine;    // target processor\n    unsigned short  verFEMajor; // front end major version #\n    unsigned short  verFEMinor; // front end minor version #\n    unsigned short  verFEBuild; // front end build version #\n    unsigned short  verMajor;   // back end major version #\n    unsigned short  verMinor;   // back end minor version #\n    unsigned short  verBuild;   // back end build version #\n    unsigned char   verSt[1];   // Length-prefixed compiler version string, followed\n                                //  by an optional block of zero terminated strings\n                                //  terminated with a double zero.\n} COMPILESYM;\n\ntypedef struct COMPILESYM3 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_COMPILE3\n    struct {\n        unsigned long   iLanguage       :  8;   // language index\n        unsigned long   fEC             :  1;   // compiled for E/C\n        unsigned long   fNoDbgInfo      :  1;   // not compiled with debug info\n        unsigned long   fLTCG           :  1;   // compiled with LTCG\n        unsigned long   fNoDataAlign    :  1;   // compiled with -Bzalign\n        unsigned long   fManagedPresent :  1;   // managed code/data present\n        unsigned long   fSecurityChecks :  1;   // compiled with /GS\n        unsigned long   fHotPatch       :  1;   // compiled with /hotpatch\n        unsigned long   fCVTCIL         :  1;   // converted with CVTCIL\n        unsigned long   fMSILModule     :  1;   // MSIL netmodule\n        unsigned long   fSdl            :  1;   // compiled with /sdl\n        unsigned long   fPGO            :  1;   // compiled with /ltcg:pgo or pgu\n        unsigned long   fExp            :  1;   // .exp module\n        unsigned long   pad             : 12;   // reserved, must be 0\n    } flags;\n    unsigned short  machine;    // target processor\n    unsigned short  verFEMajor; // front end major version #\n    unsigned short  verFEMinor; // front end minor version #\n    unsigned short  verFEBuild; // front end build version #\n    unsigned short  verFEQFE;   // front end QFE version #\n    unsigned short  verMajor;   // back end major version #\n    unsigned short  verMinor;   // back end minor version #\n    unsigned short  verBuild;   // back end build version #\n    unsigned short  verQFE;     // back end QFE version #\n    char            verSz[1];   // Zero terminated compiler version string\n} COMPILESYM3;\n\ntypedef struct ENVBLOCKSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_ENVBLOCK\n    struct {\n        unsigned char  rev              : 1;    // reserved\n        unsigned char  pad              : 7;    // reserved, must be 0\n    } flags;\n    unsigned char   rgsz[1];    // Sequence of zero-terminated strings\n} ENVBLOCKSYM;\n\ntypedef struct OBJNAMESYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_OBJNAME\n    unsigned long   signature;  // signature\n    unsigned char   name[1];    // Length-prefixed name\n} OBJNAMESYM;\n\n\ntypedef struct ENDARGSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_ENDARG\n} ENDARGSYM;\n\n\ntypedef struct RETURNSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_RETURN\n    CV_GENERIC_FLAG flags;      // flags\n    unsigned char   style;      // CV_GENERIC_STYLE_e return style\n                                // followed by return method data\n} RETURNSYM;\n\n\ntypedef struct ENTRYTHISSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_ENTRYTHIS\n    unsigned char   thissym;    // symbol describing this pointer on entry\n} ENTRYTHISSYM;\n\n\n//      symbol types for 16:16 memory model\n\n\ntypedef struct BPRELSYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_BPREL16\n    CV_off16_t      off;        // BP-relative offset\n    CV_typ16_t      typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} BPRELSYM16;\n\n\ntypedef struct DATASYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LDATA or S_GDATA\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    CV_typ16_t      typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} DATASYM16;\ntypedef DATASYM16 PUBSYM16;\n\n\ntypedef struct PROCSYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GPROC16 or S_LPROC16\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned short  len;        // Proc length\n    unsigned short  DbgStart;   // Debug start offset\n    unsigned short  DbgEnd;     // Debug end offset\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    CV_typ16_t      typind;     // Type index\n    CV_PROCFLAGS    flags;      // Proc flags\n    unsigned char   name[1];    // Length-prefixed name\n} PROCSYM16;\n\n\ntypedef struct THUNKSYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_THUNK\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    unsigned short  len;        // length of thunk\n    unsigned char   ord;        // THUNK_ORDINAL specifying type of thunk\n    unsigned char   name[1];    // name of thunk\n    unsigned char   variant[CV_ZEROLEN]; // variant portion of thunk\n} THUNKSYM16;\n\ntypedef struct LABELSYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LABEL16\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    CV_PROCFLAGS    flags;      // flags\n    unsigned char   name[1];    // Length-prefixed name\n} LABELSYM16;\n\n\ntypedef struct BLOCKSYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_BLOCK16\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned short  len;        // Block length\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    unsigned char   name[1];    // Length-prefixed name\n} BLOCKSYM16;\n\n\ntypedef struct WITHSYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_WITH16\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned short  len;        // Block length\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    unsigned char   expr[1];    // Length-prefixed expression\n} WITHSYM16;\n\n\ntypedef enum CEXM_MODEL_e {\n    CEXM_MDL_table          = 0x00, // not executable\n    CEXM_MDL_jumptable      = 0x01, // Compiler generated jump table\n    CEXM_MDL_datapad        = 0x02, // Data padding for alignment\n    CEXM_MDL_native         = 0x20, // native (actually not-pcode)\n    CEXM_MDL_cobol          = 0x21, // cobol\n    CEXM_MDL_codepad        = 0x22, // Code padding for alignment\n    CEXM_MDL_code           = 0x23, // code\n    CEXM_MDL_sql            = 0x30, // sql\n    CEXM_MDL_pcode          = 0x40, // pcode\n    CEXM_MDL_pcode32Mac     = 0x41, // macintosh 32 bit pcode\n    CEXM_MDL_pcode32MacNep  = 0x42, // macintosh 32 bit pcode native entry point\n    CEXM_MDL_javaInt        = 0x50,\n    CEXM_MDL_unknown        = 0xff\n} CEXM_MODEL_e;\n\n// use the correct enumerate name\n#define CEXM_MDL_SQL CEXM_MDL_sql\n\ntypedef enum CV_COBOL_e {\n    CV_COBOL_dontstop,\n    CV_COBOL_pfm,\n    CV_COBOL_false,\n    CV_COBOL_extcall\n} CV_COBOL_e;\n\ntypedef struct CEXMSYM16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_CEXMODEL16\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    unsigned short  model;      // execution model\n    union {\n        struct  {\n            CV_uoff16_t pcdtable;   // offset to pcode function table\n            CV_uoff16_t pcdspi;     // offset to segment pcode information\n        } pcode;\n        struct {\n            unsigned short  subtype;   // see CV_COBOL_e above\n            unsigned short  flag;\n        } cobol;\n    };\n} CEXMSYM16;\n\n\ntypedef struct VPATHSYM16 {\n    unsigned short  reclen;     // record length\n    unsigned short  rectyp;     // S_VFTPATH16\n    CV_uoff16_t     off;        // offset of virtual function table\n    unsigned short  seg;        // segment of virtual function table\n    CV_typ16_t      root;       // type index of the root of path\n    CV_typ16_t      path;       // type index of the path record\n} VPATHSYM16;\n\n\ntypedef struct REGREL16 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_REGREL16\n    CV_uoff16_t     off;        // offset of symbol\n    unsigned short  reg;        // register index\n    CV_typ16_t      typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} REGREL16;\n\n\ntypedef struct BPRELSYM32_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_BPREL32_16t\n    CV_off32_t      off;        // BP-relative offset\n    CV_typ16_t      typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} BPRELSYM32_16t;\n\ntypedef struct BPRELSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_BPREL32\n    CV_off32_t      off;        // BP-relative offset\n    CV_typ_t        typind;     // Type index or Metadata token\n    unsigned char   name[1];    // Length-prefixed name\n} BPRELSYM32;\n\ntypedef struct FRAMERELSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANFRAMEREL | S_ATTR_FRAMEREL\n    CV_off32_t      off;        // Frame relative offset\n    CV_typ_t        typind;     // Type index or Metadata token\n    CV_lvar_attr    attr;       // local var attributes\n    unsigned char   name[1];    // Length-prefixed name\n} FRAMERELSYM;\n\ntypedef FRAMERELSYM ATTRFRAMERELSYM;\n\n\ntypedef struct SLOTSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LOCALSLOT or S_PARAMSLOT\n    unsigned long   iSlot;      // slot index\n    CV_typ_t        typind;     // Type index or Metadata token\n    unsigned char   name[1];    // Length-prefixed name\n} SLOTSYM32;\n\ntypedef struct ATTRSLOTSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANSLOT\n    unsigned long   iSlot;      // slot index\n    CV_typ_t        typind;     // Type index or Metadata token\n    CV_lvar_attr    attr;       // local var attributes\n    unsigned char   name[1];    // Length-prefixed name\n} ATTRSLOTSYM;\n\ntypedef struct ANNOTATIONSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_ANNOTATION\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    unsigned short  csz;        // Count of zero terminated annotation strings\n    unsigned char   rgsz[1];    // Sequence of zero terminated annotation strings\n} ANNOTATIONSYM;\n\ntypedef struct DATASYM32_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LDATA32_16t, S_GDATA32_16t or S_PUB32_16t\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    CV_typ16_t      typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} DATASYM32_16t;\ntypedef DATASYM32_16t PUBSYM32_16t;\n\ntypedef struct DATASYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA\n    CV_typ_t        typind;     // Type index, or Metadata token if a managed symbol\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    unsigned char   name[1];    // Length-prefixed name\n} DATASYM32;\n\ntypedef struct DATASYMHLSL {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GDATA_HLSL, S_LDATA_HLSL\n    CV_typ_t        typind;     // Type index\n    unsigned short  regType;    // register type from CV_HLSLREG_e\n    unsigned short  dataslot;   // Base data (cbuffer, groupshared, etc.) slot\n    unsigned short  dataoff;    // Base data byte offset start\n    unsigned short  texslot;    // Texture slot start\n    unsigned short  sampslot;   // Sampler slot start\n    unsigned short  uavslot;    // UAV slot start\n    unsigned char   name[1];    // name\n} DATASYMHLSL;\n\ntypedef struct DATASYMHLSL32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GDATA_HLSL32, S_LDATA_HLSL32\n    CV_typ_t        typind;     // Type index\n    unsigned long   dataslot;   // Base data (cbuffer, groupshared, etc.) slot\n    unsigned long   dataoff;    // Base data byte offset start\n    unsigned long   texslot;    // Texture slot start\n    unsigned long   sampslot;   // Sampler slot start\n    unsigned long   uavslot;    // UAV slot start\n    unsigned short  regType;    // register type from CV_HLSLREG_e\n    unsigned char   name[1];    // name\n} DATASYMHLSL32;\n\ntypedef struct DATASYMHLSL32_EX {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GDATA_HLSL32_EX, S_LDATA_HLSL32_EX\n    CV_typ_t        typind;     // Type index\n    unsigned long   regID;      // Register index\n    unsigned long   dataoff;    // Base data byte offset start\n    unsigned long   bindSpace;  // Binding space\n    unsigned long   bindSlot;   // Lower bound in binding space\n    unsigned short  regType;    // register type from CV_HLSLREG_e\n    unsigned char   name[1];    // name\n} DATASYMHLSL32_EX;\n\ntypedef enum CV_PUBSYMFLAGS_e\n {\n    cvpsfNone     = 0,\n    cvpsfCode     = 0x00000001,\n    cvpsfFunction = 0x00000002,\n    cvpsfManaged  = 0x00000004,\n    cvpsfMSIL     = 0x00000008,\n} CV_PUBSYMFLAGS_e;\n\ntypedef union CV_PUBSYMFLAGS {\n    CV_pubsymflag_t grfFlags;\n    struct {\n        CV_pubsymflag_t fCode       :  1;    // set if public symbol refers to a code address\n        CV_pubsymflag_t fFunction   :  1;    // set if public symbol is a function\n        CV_pubsymflag_t fManaged    :  1;    // set if managed code (native or IL)\n        CV_pubsymflag_t fMSIL       :  1;    // set if managed IL code\n        CV_pubsymflag_t __unused    : 28;    // must be zero\n    };\n} CV_PUBSYMFLAGS;\n\ntypedef struct PUBSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_PUB32\n    CV_PUBSYMFLAGS  pubsymflags;\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    unsigned char   name[1];    // Length-prefixed name\n} PUBSYM32;\n\n\ntypedef struct PROCSYM32_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GPROC32_16t or S_LPROC32_16t\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned long   len;        // Proc length\n    unsigned long   DbgStart;   // Debug start offset\n    unsigned long   DbgEnd;     // Debug end offset\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    CV_typ16_t      typind;     // Type index\n    CV_PROCFLAGS    flags;      // Proc flags\n    unsigned char   name[1];    // Length-prefixed name\n} PROCSYM32_16t;\n\ntypedef struct PROCSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GPROC32, S_LPROC32, S_GPROC32_ID, S_LPROC32_ID, S_LPROC32_DPC or S_LPROC32_DPC_ID\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned long   len;        // Proc length\n    unsigned long   DbgStart;   // Debug start offset\n    unsigned long   DbgEnd;     // Debug end offset\n    CV_typ_t        typind;     // Type index or ID\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    CV_PROCFLAGS    flags;      // Proc flags\n    unsigned char   name[1];    // Length-prefixed name\n} PROCSYM32;\n\ntypedef struct MANPROCSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GMANPROC, S_LMANPROC, S_GMANPROCIA64 or S_LMANPROCIA64\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned long   len;        // Proc length\n    unsigned long   DbgStart;   // Debug start offset\n    unsigned long   DbgEnd;     // Debug end offset\n    CV_tkn_t        token;      // COM+ metadata token for method\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    CV_PROCFLAGS    flags;      // Proc flags\n    unsigned short  retReg;     // Register return value is in (may not be used for all archs)\n    unsigned char   name[1];    // optional name field\n} MANPROCSYM;\n\ntypedef struct MANPROCSYMMIPS {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GMANPROCMIPS or S_LMANPROCMIPS\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned long   len;        // Proc length\n    unsigned long   DbgStart;   // Debug start offset\n    unsigned long   DbgEnd;     // Debug end offset\n    unsigned long   regSave;    // int register save mask\n    unsigned long   fpSave;     // fp register save mask\n    CV_uoff32_t     intOff;     // int register save offset\n    CV_uoff32_t     fpOff;      // fp register save offset\n    CV_tkn_t        token;      // COM+ token type\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    unsigned char   retReg;     // Register return value is in\n    unsigned char   frameReg;   // Frame pointer register\n    unsigned char   name[1];    // optional name field\n} MANPROCSYMMIPS;\n\ntypedef struct THUNKSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_THUNK32\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    unsigned short  len;        // length of thunk\n    unsigned char   ord;        // THUNK_ORDINAL specifying type of thunk\n    unsigned char   name[1];    // Length-prefixed name\n    unsigned char   variant[CV_ZEROLEN]; // variant portion of thunk\n} THUNKSYM32;\n\ntypedef enum TRAMP_e {      // Trampoline subtype\n    trampIncremental,           // incremental thunks\n    trampBranchIsland,          // Branch island thunks\n} TRAMP_e;\n\ntypedef struct TRAMPOLINESYM {  // Trampoline thunk symbol\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_TRAMPOLINE\n    unsigned short  trampType;  // trampoline sym subtype\n    unsigned short  cbThunk;    // size of the thunk\n    CV_uoff32_t     offThunk;   // offset of the thunk\n    CV_uoff32_t     offTarget;  // offset of the target of the thunk\n    unsigned short  sectThunk;  // section index of the thunk\n    unsigned short  sectTarget; // section index of the target of the thunk\n} TRAMPOLINE;\n\ntypedef struct LABELSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LABEL32\n    CV_uoff32_t     off;\n    unsigned short  seg;\n    CV_PROCFLAGS    flags;      // flags\n    unsigned char   name[1];    // Length-prefixed name\n} LABELSYM32;\n\n\ntypedef struct BLOCKSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_BLOCK32\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   len;        // Block length\n    CV_uoff32_t     off;        // Offset in code segment\n    unsigned short  seg;        // segment of label\n    unsigned char   name[1];    // Length-prefixed name\n} BLOCKSYM32;\n\n\ntypedef struct WITHSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_WITH32\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   len;        // Block length\n    CV_uoff32_t     off;        // Offset in code segment\n    unsigned short  seg;        // segment of label\n    unsigned char   expr[1];    // Length-prefixed expression string\n} WITHSYM32;\n\n\n\ntypedef struct CEXMSYM32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_CEXMODEL32\n    CV_uoff32_t     off;        // offset of symbol\n    unsigned short  seg;        // segment of symbol\n    unsigned short  model;      // execution model\n    union {\n        struct  {\n            CV_uoff32_t pcdtable;   // offset to pcode function table\n            CV_uoff32_t pcdspi;     // offset to segment pcode information\n        } pcode;\n        struct {\n            unsigned short  subtype;   // see CV_COBOL_e above\n            unsigned short  flag;\n        } cobol;\n        struct {\n            CV_uoff32_t calltableOff; // offset to function table\n            unsigned short calltableSeg; // segment of function table\n        } pcode32Mac;\n    };\n} CEXMSYM32;\n\n\n\ntypedef struct VPATHSYM32_16t {\n    unsigned short  reclen;     // record length\n    unsigned short  rectyp;     // S_VFTABLE32_16t\n    CV_uoff32_t     off;        // offset of virtual function table\n    unsigned short  seg;        // segment of virtual function table\n    CV_typ16_t      root;       // type index of the root of path\n    CV_typ16_t      path;       // type index of the path record\n} VPATHSYM32_16t;\n\ntypedef struct VPATHSYM32 {\n    unsigned short  reclen;     // record length\n    unsigned short  rectyp;     // S_VFTABLE32\n    CV_typ_t        root;       // type index of the root of path\n    CV_typ_t        path;       // type index of the path record\n    CV_uoff32_t     off;        // offset of virtual function table\n    unsigned short  seg;        // segment of virtual function table\n} VPATHSYM32;\n\n\n\n\n\ntypedef struct REGREL32_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_REGREL32_16t\n    CV_uoff32_t     off;        // offset of symbol\n    unsigned short  reg;        // register index for symbol\n    CV_typ16_t      typind;     // Type index\n    unsigned char   name[1];    // Length-prefixed name\n} REGREL32_16t;\n\ntypedef struct REGREL32 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_REGREL32\n    CV_uoff32_t     off;        // offset of symbol\n    CV_typ_t        typind;     // Type index or metadata token\n    unsigned short  reg;        // register index for symbol\n    unsigned char   name[1];    // Length-prefixed name\n} REGREL32;\n\ntypedef struct ATTRREGREL {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_MANREGREL | S_ATTR_REGREL\n    CV_uoff32_t     off;        // offset of symbol\n    CV_typ_t        typind;     // Type index or metadata token\n    unsigned short  reg;        // register index for symbol\n    CV_lvar_attr    attr;       // local var attributes\n    unsigned char   name[1];    // Length-prefixed name\n} ATTRREGREL;\n\ntypedef ATTRREGREL  ATTRREGRELSYM;\n\ntypedef struct THREADSYM32_16t {\n    unsigned short  reclen;     // record length\n    unsigned short  rectyp;     // S_LTHREAD32_16t | S_GTHREAD32_16t\n    CV_uoff32_t     off;        // offset into thread storage\n    unsigned short  seg;        // segment of thread storage\n    CV_typ16_t      typind;     // type index\n    unsigned char   name[1];    // length prefixed name\n} THREADSYM32_16t;\n\ntypedef struct THREADSYM32 {\n    unsigned short  reclen;     // record length\n    unsigned short  rectyp;     // S_LTHREAD32 | S_GTHREAD32\n    CV_typ_t        typind;     // type index\n    CV_uoff32_t     off;        // offset into thread storage\n    unsigned short  seg;        // segment of thread storage\n    unsigned char   name[1];    // length prefixed name\n} THREADSYM32;\n\ntypedef struct SLINK32 {\n    unsigned short  reclen;     // record length\n    unsigned short  rectyp;     // S_SLINK32\n    unsigned long   framesize;  // frame size of parent procedure\n    CV_off32_t      off;        // signed offset where the static link was saved relative to the value of reg\n    unsigned short  reg;\n} SLINK32;\n\ntypedef struct PROCSYMMIPS_16t {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GPROCMIPS_16t or S_LPROCMIPS_16t\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned long   len;        // Proc length\n    unsigned long   DbgStart;   // Debug start offset\n    unsigned long   DbgEnd;     // Debug end offset\n    unsigned long   regSave;    // int register save mask\n    unsigned long   fpSave;     // fp register save mask\n    CV_uoff32_t     intOff;     // int register save offset\n    CV_uoff32_t     fpOff;      // fp register save offset\n    CV_uoff32_t     off;        // Symbol offset\n    unsigned short  seg;        // Symbol segment\n    CV_typ16_t      typind;     // Type index\n    unsigned char   retReg;     // Register return value is in\n    unsigned char   frameReg;   // Frame pointer register\n    unsigned char   name[1];    // Length-prefixed name\n} PROCSYMMIPS_16t;\n\ntypedef struct PROCSYMMIPS {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GPROCMIPS or S_LPROCMIPS\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned long   len;        // Proc length\n    unsigned long   DbgStart;   // Debug start offset\n    unsigned long   DbgEnd;     // Debug end offset\n    unsigned long   regSave;    // int register save mask\n    unsigned long   fpSave;     // fp register save mask\n    CV_uoff32_t     intOff;     // int register save offset\n    CV_uoff32_t     fpOff;      // fp register save offset\n    CV_typ_t        typind;     // Type index\n    CV_uoff32_t     off;        // Symbol offset\n    unsigned short  seg;        // Symbol segment\n    unsigned char   retReg;     // Register return value is in\n    unsigned char   frameReg;   // Frame pointer register\n    unsigned char   name[1];    // Length-prefixed name\n} PROCSYMMIPS;\n\ntypedef struct PROCSYMIA64 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GPROCIA64 or S_LPROCIA64\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n    unsigned long   len;        // Proc length\n    unsigned long   DbgStart;   // Debug start offset\n    unsigned long   DbgEnd;     // Debug end offset\n    CV_typ_t        typind;     // Type index\n    CV_uoff32_t     off;        // Symbol offset\n    unsigned short  seg;        // Symbol segment\n    unsigned short  retReg;     // Register return value is in\n    CV_PROCFLAGS    flags;      // Proc flags\n    unsigned char   name[1];    // Length-prefixed name\n} PROCSYMIA64;\n\ntypedef struct REFSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_PROCREF_ST, S_DATAREF_ST, or S_LPROCREF_ST\n    unsigned long   sumName;    // SUC of the name\n    unsigned long   ibSym;      // Offset of actual symbol in $$Symbols\n    unsigned short  imod;       // Module containing the actual symbol\n    unsigned short  usFill;     // align this record\n} REFSYM;\n\ntypedef struct REFSYM2 {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_PROCREF, S_DATAREF, or S_LPROCREF\n    unsigned long   sumName;    // SUC of the name\n    unsigned long   ibSym;      // Offset of actual symbol in $$Symbols\n    unsigned short  imod;       // Module containing the actual symbol\n    unsigned char   name[1];    // hidden name made a first class member\n} REFSYM2;\n\ntypedef struct ALIGNSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_ALIGN\n} ALIGNSYM;\n\ntypedef struct OEMSYMBOL {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_OEM\n    unsigned char   idOem[16];  // an oem ID (GUID)\n    CV_typ_t        typind;     // Type index\n    unsigned long   rgl[];      // user data, force 4-byte alignment\n} OEMSYMBOL;\n\n//  generic block definition symbols\n//  these are similar to the equivalent 16:16 or 16:32 symbols but\n//  only define the length, type and linkage fields\n\ntypedef struct PROCSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_GPROC16 or S_LPROC16\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n} PROCSYM;\n\n\ntypedef struct THUNKSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_THUNK\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n    unsigned long   pNext;      // pointer to next symbol\n} THUNKSYM;\n\ntypedef struct BLOCKSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_BLOCK16\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n} BLOCKSYM;\n\n\ntypedef struct WITHSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_WITH16\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this blocks end\n} WITHSYM;\n\ntypedef struct FRAMEPROCSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_FRAMEPROC\n    unsigned long   cbFrame;    // count of bytes of total frame of procedure\n    unsigned long   cbPad;      // count of bytes of padding in the frame\n    CV_uoff32_t     offPad;     // offset (relative to frame poniter) to where\n                                //  padding starts\n    unsigned long   cbSaveRegs; // count of bytes of callee save registers\n    CV_uoff32_t     offExHdlr;  // offset of exception handler\n    unsigned short  sectExHdlr; // section id of exception handler\n\n    struct {\n        unsigned long   fHasAlloca  :  1;   // function uses _alloca()\n        unsigned long   fHasSetJmp  :  1;   // function uses setjmp()\n        unsigned long   fHasLongJmp :  1;   // function uses longjmp()\n        unsigned long   fHasInlAsm  :  1;   // function uses inline asm\n        unsigned long   fHasEH      :  1;   // function has EH states\n        unsigned long   fInlSpec    :  1;   // function was speced as inline\n        unsigned long   fHasSEH     :  1;   // function has SEH\n        unsigned long   fNaked      :  1;   // function is __declspec(naked)\n        unsigned long   fSecurityChecks :  1;   // function has buffer security check introduced by /GS.\n        unsigned long   fAsyncEH    :  1;   // function compiled with /EHa\n        unsigned long   fGSNoStackOrdering :  1;   // function has /GS buffer checks, but stack ordering couldn't be done\n        unsigned long   fWasInlined :  1;   // function was inlined within another function\n        unsigned long   fGSCheck    :  1;   // function is __declspec(strict_gs_check)\n        unsigned long   fSafeBuffers : 1;   // function is __declspec(safebuffers)\n        unsigned long   encodedLocalBasePointer : 2;  // record function's local pointer explicitly.\n        unsigned long   encodedParamBasePointer : 2;  // record function's parameter pointer explicitly.\n        unsigned long   fPogoOn      : 1;   // function was compiled with PGO/PGU\n        unsigned long   fValidCounts : 1;   // Do we have valid Pogo counts?\n        unsigned long   fOptSpeed    : 1;  // Did we optimize for speed?\n        unsigned long   fGuardCF    :  1;   // function contains CFG checks (and no write checks)\n        unsigned long   fGuardCFW   :  1;   // function contains CFW checks and/or instrumentation\n        unsigned long   pad          : 9;   // must be zero\n    } flags;\n} FRAMEPROCSYM;\n\n#ifdef  __cplusplus\nnamespace CodeViewInfo\n{\n__inline unsigned short ExpandEncodedBasePointerReg(unsigned machineType, unsigned encodedFrameReg)\n{\n    static const unsigned short rgFramePointerRegX86[] = {\n        CV_REG_NONE, CV_ALLREG_VFRAME, CV_REG_EBP, CV_REG_EBX};\n    static const unsigned short rgFramePointerRegX64[] = {\n        CV_REG_NONE, CV_AMD64_RSP, CV_AMD64_RBP, CV_AMD64_R13};\n    static const unsigned short rgFramePointerRegArm[] = {\n        CV_REG_NONE, CV_ARM_SP, CV_ARM_R7, CV_REG_NONE};\n\n    if (encodedFrameReg >= 4) {\n        return CV_REG_NONE;\n    }\n    switch (machineType) {\n        case CV_CFL_8080 :\n        case CV_CFL_8086 :\n        case CV_CFL_80286 :\n        case CV_CFL_80386 :\n        case CV_CFL_80486 :\n        case CV_CFL_PENTIUM :\n        case CV_CFL_PENTIUMII :\n        case CV_CFL_PENTIUMIII :\n            return rgFramePointerRegX86[encodedFrameReg];\n        case CV_CFL_AMD64 :\n            return rgFramePointerRegX64[encodedFrameReg];\n        case CV_CFL_ARMNT :\n            return rgFramePointerRegArm[encodedFrameReg];\n        default:\n            return CV_REG_NONE;\n    }\n}\n}\n#endif\n\ntypedef struct UNAMESPACE {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_UNAMESPACE\n    unsigned char   name[1];    // name\n} UNAMESPACE;\n\ntypedef struct SEPCODESYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_SEPCODE\n    unsigned long   pParent;    // pointer to the parent\n    unsigned long   pEnd;       // pointer to this block's end\n    unsigned long   length;     // count of bytes of this block\n    CV_SEPCODEFLAGS scf;        // flags\n    CV_uoff32_t     off;        // sect:off of the separated code\n    CV_uoff32_t     offParent;  // sectParent:offParent of the enclosing scope\n    unsigned short  sect;       //  (proc, block, or sepcode)\n    unsigned short  sectParent;\n} SEPCODESYM;\n\ntypedef struct BUILDINFOSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_BUILDINFO\n    CV_ItemId       id;         // CV_ItemId of Build Info.\n} BUILDINFOSYM;\n\ntypedef struct INLINESITESYM {\n    unsigned short  reclen;    // Record length\n    unsigned short  rectyp;    // S_INLINESITE\n    unsigned long   pParent;   // pointer to the inliner\n    unsigned long   pEnd;      // pointer to this block's end\n    CV_ItemId       inlinee;   // CV_ItemId of inlinee\n    unsigned char   binaryAnnotations[CV_ZEROLEN];   // an array of compressed binary annotations.\n} INLINESITESYM;\n\ntypedef struct INLINESITESYM2 {\n    unsigned short  reclen;         // Record length\n    unsigned short  rectyp;         // S_INLINESITE2\n    unsigned long   pParent;        // pointer to the inliner\n    unsigned long   pEnd;           // pointer to this block's end\n    CV_ItemId       inlinee;        // CV_ItemId of inlinee\n    unsigned long   invocations;    // entry count\n    unsigned char   binaryAnnotations[CV_ZEROLEN];   // an array of compressed binary annotations.\n} INLINESITESYM2;\n\n\n// Defines a locals and it is live range, how to evaluate.\n// S_DEFRANGE modifies previous local S_LOCAL, it has to consecutive.\n\ntypedef struct LOCALSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LOCAL\n    CV_typ_t        typind;     // type index\n    CV_LVARFLAGS    flags;      // local var flags\n\n    unsigned char   name[CV_ZEROLEN];   // Name of this symbol, a null terminated array of UTF8 characters.\n} LOCALSYM;\n\ntypedef struct FILESTATICSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_FILESTATIC\n    CV_typ_t        typind;     // type index\n    CV_uoff32_t     modOffset;  // index of mod filename in stringtable\n    CV_LVARFLAGS    flags;      // local var flags\n\n    unsigned char   name[CV_ZEROLEN];   // Name of this symbol, a null terminated array of UTF8 characters\n} FILESTATICSYM;\n\ntypedef struct DEFRANGESYM {    // A live range of sub field of variable\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DEFRANGE\n\n    CV_uoff32_t     program;    // DIA program to evaluate the value of the symbol\n\n    CV_LVAR_ADDR_RANGE range;   // Range of addresses where this program is valid\n    CV_LVAR_ADDR_GAP   gaps[CV_ZEROLEN];  // The value is not available in following gaps.\n} DEFRANGESYM;\n\ntypedef struct DEFRANGESYMSUBFIELD { // A live range of sub field of variable. like locala.i\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DEFRANGE_SUBFIELD\n\n    CV_uoff32_t     program;    // DIA program to evaluate the value of the symbol\n\n    CV_uoff32_t     offParent;  // Offset in parent variable.\n\n    CV_LVAR_ADDR_RANGE range;   // Range of addresses where this program is valid\n    CV_LVAR_ADDR_GAP   gaps[CV_ZEROLEN];  // The value is not available in following gaps.\n} DEFRANGESYMSUBFIELD;\n\ntypedef struct CV_RANGEATTR {\n    unsigned short  maybe : 1;    // May have no user name on one of control flow path.\n    unsigned short  padding : 15; // Padding for future use.\n} CV_RANGEATTR;\n\ntypedef struct DEFRANGESYMREGISTER {    // A live range of en-registed variable\n    unsigned short     reclen;     // Record length\n    unsigned short     rectyp;     // S_DEFRANGE_REGISTER\n    unsigned short     reg;        // Register to hold the value of the symbol\n    CV_RANGEATTR       attr;       // Attribute of the register range.\n    CV_LVAR_ADDR_RANGE range;      // Range of addresses where this program is valid\n    CV_LVAR_ADDR_GAP   gaps[CV_ZEROLEN];  // The value is not available in following gaps.\n} DEFRANGESYMREGISTER;\n\ntypedef struct DEFRANGESYMFRAMEPOINTERREL {    // A live range of frame variable\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DEFRANGE_FRAMEPOINTER_REL\n\n    CV_off32_t      offFramePointer;  // offset to frame pointer\n\n    CV_LVAR_ADDR_RANGE range;   // Range of addresses where this program is valid\n    CV_LVAR_ADDR_GAP   gaps[CV_ZEROLEN];  // The value is not available in following gaps.\n} DEFRANGESYMFRAMEPOINTERREL;\n\ntypedef struct DEFRANGESYMFRAMEPOINTERREL_FULL_SCOPE { // A frame variable valid in all function scope\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DEFRANGE_FRAMEPOINTER_REL\n\n    CV_off32_t      offFramePointer;  // offset to frame pointer\n} DEFRANGESYMFRAMEPOINTERREL_FULL_SCOPE;\n\n#define CV_OFFSET_PARENT_LENGTH_LIMIT 12\n\n// Note DEFRANGESYMREGISTERREL and DEFRANGESYMSUBFIELDREGISTER had same layout.\ntypedef struct DEFRANGESYMSUBFIELDREGISTER { // A live range of sub field of variable. like locala.i\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DEFRANGE_SUBFIELD_REGISTER\n\n    unsigned short     reg;        // Register to hold the value of the symbol\n    CV_RANGEATTR       attr;       // Attribute of the register range.\n    CV_uoff32_t        offParent : CV_OFFSET_PARENT_LENGTH_LIMIT;  // Offset in parent variable.\n    CV_uoff32_t        padding   : 20;  // Padding for future use.\n    CV_LVAR_ADDR_RANGE range;   // Range of addresses where this program is valid\n    CV_LVAR_ADDR_GAP   gaps[CV_ZEROLEN];  // The value is not available in following gaps.\n} DEFRANGESYMSUBFIELDREGISTER;\n\n// Note DEFRANGESYMREGISTERREL and DEFRANGESYMSUBFIELDREGISTER had same layout.\n// Used when /GS Copy parameter as local variable or other variable don't cover by FRAMERELATIVE.\ntypedef struct DEFRANGESYMREGISTERREL {    // A live range of variable related to a register.\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DEFRANGE_REGISTER_REL\n\n    unsigned short  baseReg;         // Register to hold the base pointer of the symbol\n    unsigned short  spilledUdtMember : 1;   // Spilled member for s.i.\n    unsigned short  padding          : 3;   // Padding for future use.\n    unsigned short  offsetParent     : CV_OFFSET_PARENT_LENGTH_LIMIT;  // Offset in parent variable.\n    CV_off32_t      offBasePointer;  // offset to register\n\n    CV_LVAR_ADDR_RANGE range;   // Range of addresses where this program is valid\n    CV_LVAR_ADDR_GAP   gaps[CV_ZEROLEN];  // The value is not available in following gaps.\n} DEFRANGESYMREGISTERREL;\n\ntypedef struct DEFRANGESYMHLSL {    // A live range of variable related to a symbol in HLSL code.\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DEFRANGE_HLSL or S_DEFRANGE_DPC_PTR_TAG\n\n    unsigned short  regType;    // register type from CV_HLSLREG_e\n\n    unsigned short  regIndices       : 2;   // 0, 1 or 2, dimensionality of register space\n    unsigned short  spilledUdtMember : 1;   // this is a spilled member\n    unsigned short  memorySpace      : 4;   // memory space\n    unsigned short  padding          : 9;   // for future use\n\n    unsigned short  offsetParent;           // Offset in parent variable.\n    unsigned short  sizeInParent;           // Size of enregistered portion\n\n    CV_LVAR_ADDR_RANGE range;               // Range of addresses where this program is valid\n    unsigned char   data[CV_ZEROLEN];       // variable length data specifying gaps where the value is not available\n                                            // followed by multi-dimensional offset of variable location in register\n                                            // space (see CV_DEFRANGESYMHLSL_* macros below)\n} DEFRANGESYMHLSL;\n\n#define CV_DEFRANGESYM_GAPS_COUNT(x) \\\n    (((x)->reclen + sizeof((x)->reclen) - sizeof(DEFRANGESYM)) / sizeof(CV_LVAR_ADDR_GAP))\n\n#define CV_DEFRANGESYMSUBFIELD_GAPS_COUNT(x) \\\n    (((x)->reclen + sizeof((x)->reclen) - sizeof(DEFRANGESYMSUBFIELD)) / sizeof(CV_LVAR_ADDR_GAP))\n\n#define CV_DEFRANGESYMHLSL_GAPS_COUNT(x) \\\n    (((x)->reclen + sizeof((x)->reclen) - sizeof(DEFRANGESYMHLSL) - (x)->regIndices * sizeof(CV_uoff32_t)) / sizeof(CV_LVAR_ADDR_GAP))\n\n#define CV_DEFRANGESYMHLSL_GAPS_PTR_BASE(x, t)  reinterpret_cast<t>((x)->data)\n\n#define CV_DEFRANGESYMHLSL_GAPS_CONST_PTR(x) \\\n    CV_DEFRANGESYMHLSL_GAPS_PTR_BASE(x, const CV_LVAR_ADDR_GAP*)\n\n#define CV_DEFRANGESYMHLSL_GAPS_PTR(x) \\\n    CV_DEFRANGESYMHLSL_GAPS_PTR_BASE(x, CV_LVAR_ADDR_GAP*)\n\n#define CV_DEFRANGESYMHLSL_OFFSET_PTR_BASE(x, t) \\\n    reinterpret_cast<t>(((CV_LVAR_ADDR_GAP*)(x)->data) + CV_DEFRANGESYMHLSL_GAPS_COUNT(x))\n\n#define CV_DEFRANGESYMHLSL_OFFSET_CONST_PTR(x) \\\n    CV_DEFRANGESYMHLSL_OFFSET_PTR_BASE(x, const CV_uoff32_t*)\n\n#define CV_DEFRANGESYMHLSL_OFFSET_PTR(x) \\\n    CV_DEFRANGESYMHLSL_OFFSET_PTR_BASE(x, CV_uoff32_t*)\n\n#if defined(CC_DP_CXX) && CC_DP_CXX\n\n// Defines a local DPC group shared variable and its location.\ntypedef struct LOCALDPCGROUPSHAREDSYM {\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_LOCAL_DPC_GROUPSHARED\n    CV_typ_t        typind;     // type index\n    CV_LVARFLAGS    flags;      // local var flags\n\n    unsigned short  dataslot;   // Base data (cbuffer, groupshared, etc.) slot\n    unsigned short  dataoff;    // Base data byte offset start\n\n    unsigned char   name[CV_ZEROLEN];   // Name of this symbol, a null terminated array of UTF8 characters.\n} LOCALDPCGROUPSHAREDSYM;\n\ntypedef struct DPCSYMTAGMAP {   // A map for DPC pointer tag values to symbol records.\n    unsigned short  reclen;     // Record length\n    unsigned short  rectyp;     // S_DPC_SYM_TAG_MAP\n\n    CV_DPC_SYM_TAG_MAP_ENTRY mapEntries[CV_ZEROLEN];  // Array of mappings from DPC pointer tag values to symbol record offsets\n} DPCSYMTAGMAP;\n\n#define CV_DPCSYMTAGMAP_COUNT(x) \\\n    (((x)->reclen + sizeof((x)->reclen) - sizeof(DPCSYMTAGMAP)) / sizeof(CV_DPC_SYM_TAG_MAP_ENTRY))\n\n#endif // CC_DP_CXX\n\ntypedef enum CV_armswitchtype {\n    CV_SWT_INT1         = 0,\n    CV_SWT_UINT1        = 1,\n    CV_SWT_INT2         = 2,\n    CV_SWT_UINT2        = 3,\n    CV_SWT_INT4         = 4,\n    CV_SWT_UINT4        = 5,\n    CV_SWT_POINTER      = 6,\n    CV_SWT_UINT1SHL1    = 7,\n    CV_SWT_UINT2SHL1    = 8,\n    CV_SWT_INT1SHL1     = 9,\n    CV_SWT_INT2SHL1     = 10,\n    CV_SWT_TBB          = CV_SWT_UINT1SHL1,\n    CV_SWT_TBH          = CV_SWT_UINT2SHL1,\n} CV_armswitchtype;\n\ntypedef struct FUNCTIONLIST {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_CALLERS or S_CALLEES\n\n    unsigned long   count;              // Number of functions\n    CV_typ_t        funcs[CV_ZEROLEN];  // List of functions, dim == count\n    // unsigned long   invocations[CV_ZEROLEN]; Followed by a parallel array of\n    // invocation counts. Counts > reclen are assumed to be zero\n} FUNCTIONLIST;\n\ntypedef struct POGOINFO {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_POGODATA\n\n    unsigned long   invocations;        // Number of times function was called\n    __int64         dynCount;           // Dynamic instruction count\n    unsigned long   numInstrs;          // Static instruction count\n    unsigned long   staInstLive;        // Final static instruction count (post inlining)\n} POGOINFO;\n\ntypedef struct ARMSWITCHTABLE {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_ARMSWITCHTABLE\n\n    CV_uoff32_t     offsetBase;         // Section-relative offset to the base for switch offsets\n    unsigned short  sectBase;           // Section index of the base for switch offsets\n    unsigned short  switchType;         // type of each entry\n    CV_uoff32_t     offsetBranch;       // Section-relative offset to the table branch instruction\n    CV_uoff32_t     offsetTable;        // Section-relative offset to the start of the table\n    unsigned short  sectBranch;         // Section index of the table branch instruction\n    unsigned short  sectTable;          // Section index of the table\n    unsigned long   cEntries;           // number of switch table entries\n} ARMSWITCHTABLE;\n\ntypedef struct MODTYPEREF {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_MOD_TYPEREF\n\n    unsigned long   fNone     : 1;      // module doesn't reference any type\n    unsigned long   fRefTMPCT : 1;      // reference /Z7 PCH types\n    unsigned long   fOwnTMPCT : 1;      // module contains /Z7 PCH types\n    unsigned long   fOwnTMR   : 1;      // module contains type info (/Z7)\n    unsigned long   fOwnTM    : 1;      // module contains type info (/Zi or /ZI)\n    unsigned long   fRefTM    : 1;      // module references type info owned by other module\n    unsigned long   reserved  : 9;\n\n    unsigned short  word0;              // these two words contain SN or module index depending\n    unsigned short  word1;              // on above flags\n} MODTYPEREF;\n\ntypedef struct SECTIONSYM {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_SECTION\n\n    unsigned short  isec;               // Section number\n    unsigned char   align;              // Alignment of this section (power of 2)\n    unsigned char   bReserved;          // Reserved.  Must be zero.\n    unsigned long   rva;\n    unsigned long   cb;\n    unsigned long   characteristics;\n    unsigned char   name[1];            // name\n} SECTIONSYM;\n\ntypedef struct COFFGROUPSYM {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_COFFGROUP\n\n    unsigned long   cb;\n    unsigned long   characteristics;\n    CV_uoff32_t     off;                // Symbol offset\n    unsigned short  seg;                // Symbol segment\n    unsigned char   name[1];            // name\n} COFFGROUPSYM;\n\ntypedef struct EXPORTSYM {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_EXPORT\n\n    unsigned short  ordinal;\n    unsigned short  fConstant : 1;      // CONSTANT\n    unsigned short  fData : 1;          // DATA\n    unsigned short  fPrivate : 1;       // PRIVATE\n    unsigned short  fNoName : 1;        // NONAME\n    unsigned short  fOrdinal : 1;       // Ordinal was explicitly assigned\n    unsigned short  fForwarder : 1;     // This is a forwarder\n    unsigned short  reserved : 10;      // Reserved. Must be zero.\n    unsigned char   name[1];            // name of\n} EXPORTSYM;\n\n//\n// Symbol for describing indirect calls when they are using\n// a function pointer cast on some other type or temporary.\n// Typical content will be an LF_POINTER to an LF_PROCEDURE\n// type record that should mimic an actual variable with the\n// function pointer type in question.\n//\n// Since the compiler can sometimes tail-merge a function call\n// through a function pointer, there may be more than one\n// S_CALLSITEINFO record at an address.  This is similar to what\n// you could do in your own code by:\n//\n//  if (expr)\n//      pfn = &function1;\n//  else\n//      pfn = &function2;\n//\n//  (*pfn)(arg list);\n//\n\ntypedef struct CALLSITEINFO {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_CALLSITEINFO\n    CV_off32_t      off;                // offset of call site\n    unsigned short  sect;               // section index of call site\n    unsigned short  __reserved_0;       // alignment padding field, must be zero\n    CV_typ_t        typind;             // type index describing function signature\n} CALLSITEINFO;\n\ntypedef struct HEAPALLOCSITE {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_HEAPALLOCSITE\n    CV_off32_t      off;                // offset of call site\n    unsigned short  sect;               // section index of call site\n    unsigned short  cbInstr;            // length of heap allocation call instruction\n    CV_typ_t        typind;             // type index describing function signature\n} HEAPALLOCSITE;\n\n// Frame cookie information\n\ntypedef enum CV_cookietype_e\n{\n   CV_COOKIETYPE_COPY = 0,\n   CV_COOKIETYPE_XOR_SP,\n   CV_COOKIETYPE_XOR_BP,\n   CV_COOKIETYPE_XOR_R13,\n} CV_cookietype_e;\n\n// Symbol for describing security cookie's position and type\n// (raw, xor'd with esp, xor'd with ebp).\n\ntypedef struct FRAMECOOKIE {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_FRAMECOOKIE\n    CV_off32_t      off;                // Frame relative offset\n    unsigned short  reg;                // Register index\n    CV_cookietype_e cookietype;         // Type of the cookie\n    unsigned char   flags;              // Flags describing this cookie\n} FRAMECOOKIE;\n\ntypedef enum CV_DISCARDED_e\n{\n   CV_DISCARDED_UNKNOWN,\n   CV_DISCARDED_NOT_SELECTED,\n   CV_DISCARDED_NOT_REFERENCED,\n} CV_DISCARDED_e;\n\ntypedef struct DISCARDEDSYM {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_DISCARDED\n    unsigned long   discarded : 8;      // CV_DISCARDED_e\n    unsigned long   reserved : 24;      // Unused\n    unsigned long   fileid;             // First FILEID if line number info present\n    unsigned long   linenum;            // First line number\n    char            data[CV_ZEROLEN];   // Original record(s) with invalid type indices\n} DISCARDEDSYM;\n\ntypedef struct REFMINIPDB {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_REF_MINIPDB\n    union {\n        unsigned long  isectCoff;       // coff section\n        CV_typ_t       typind;          // type index\n    };\n    unsigned short  imod;               // mod index\n    unsigned short  fLocal   :  1;      // reference to local (vs. global) func or data\n    unsigned short  fData    :  1;      // reference to data (vs. func)\n    unsigned short  fUDT     :  1;      // reference to UDT\n    unsigned short  fLabel   :  1;      // reference to label\n    unsigned short  fConst   :  1;      // reference to const\n    unsigned short  reserved : 11;      // reserved, must be zero\n    unsigned char   name[1];            // zero terminated name string\n} REFMINIPDB;\n\ntypedef struct PDBMAP {\n    unsigned short  reclen;             // Record length\n    unsigned short  rectyp;             // S_PDBMAP\n    unsigned char   name[CV_ZEROLEN];   // zero terminated source PDB filename followed by zero\n                                        // terminated destination PDB filename, both in wchar_t\n} PDBMAP;\n\n//\n// V7 line number data types\n//\n\nenum DEBUG_S_SUBSECTION_TYPE {\n    DEBUG_S_IGNORE = 0x80000000,    // if this bit is set in a subsection type then ignore the subsection contents\n\n    DEBUG_S_SYMBOLS = 0xf1,\n    DEBUG_S_LINES,\n    DEBUG_S_STRINGTABLE,\n    DEBUG_S_FILECHKSMS,\n    DEBUG_S_FRAMEDATA,\n    DEBUG_S_INLINEELINES,\n    DEBUG_S_CROSSSCOPEIMPORTS,\n    DEBUG_S_CROSSSCOPEEXPORTS,\n\n    DEBUG_S_IL_LINES,\n    DEBUG_S_FUNC_MDTOKEN_MAP,\n    DEBUG_S_TYPE_MDTOKEN_MAP,\n    DEBUG_S_MERGED_ASSEMBLYINPUT,\n\n    DEBUG_S_COFF_SYMBOL_RVA,\n};\n\nstruct CV_DebugSSubsectionHeader_t {\n    enum DEBUG_S_SUBSECTION_TYPE type;\n    CV_off32_t                   cbLen;\n};\n\nstruct CV_DebugSLinesHeader_t {\n    CV_off32_t     offCon;\n    unsigned short segCon;\n    unsigned short flags;\n    CV_off32_t     cbCon;\n};\n\nstruct CV_DebugSLinesFileBlockHeader_t {\n    CV_off32_t     offFile;\n    CV_off32_t     nLines;\n    CV_off32_t     cbBlock;\n    // CV_Line_t      lines[nLines];\n    // CV_Column_t    columns[nColumns];\n};\n\n//\n// Line flags (data present)\n//\n#define CV_LINES_HAVE_COLUMNS 0x0001\n\nstruct CV_Line_t {\n        unsigned long   offset;             // Offset to start of code bytes for line number\n        unsigned long   linenumStart:24;    // line where statement/expression starts\n        unsigned long   deltaLineEnd:7;     // delta to line where statement ends (optional)\n        unsigned long   fStatement:1;       // true if a statement linenumber, else an expression line num\n};\n\ntypedef unsigned short CV_columnpos_t;    // byte offset in a source line\n\nstruct CV_Column_t {\n    CV_columnpos_t offColumnStart;\n    CV_columnpos_t offColumnEnd;\n};\n\nstruct tagFRAMEDATA {\n    unsigned long   ulRvaStart;\n    unsigned long   cbBlock;\n    unsigned long   cbLocals;\n    unsigned long   cbParams;\n    unsigned long   cbStkMax;\n    unsigned long   frameFunc;\n    unsigned short  cbProlog;\n    unsigned short  cbSavedRegs;\n    unsigned long   fHasSEH:1;\n    unsigned long   fHasEH:1;\n    unsigned long   fIsFunctionStart:1;\n    unsigned long   reserved:29;\n};\n\ntypedef struct tagFRAMEDATA FRAMEDATA, * PFRAMEDATA;\n\ntypedef struct tagXFIXUP_DATA {\n   unsigned short wType;\n   unsigned short wExtra;\n   unsigned long rva;\n   unsigned long rvaTarget;\n} XFIXUP_DATA;\n\n// Those cross scope IDs are private convention,\n// it used to delay the ID merging for frontend and backend even linker.\n// It is transparent for DIA client.\n// Use those ID will let DIA run a litter slower and but\n// avoid the copy type tree in some scenarios.\n\n#ifdef  __cplusplus\nnamespace CodeViewInfo\n{\n\ntypedef struct ComboID\n{\n    static const unsigned int IndexBitWidth = 20;\n    static const unsigned int ImodBitWidth = 12;\n\n    ComboID(unsigned short imod, unsigned int index)\n    {\n        m_comboID = (((unsigned int) imod) << IndexBitWidth) | index;\n    }\n\n    ComboID(unsigned int comboID)\n    {\n        m_comboID = comboID;\n    }\n\n    operator unsigned int()\n    {\n        return m_comboID;\n    }\n\n    unsigned short GetModIndex()\n    {\n        return (unsigned short) (m_comboID >> IndexBitWidth);\n    }\n\n    unsigned int GetIndex()\n    {\n        return (m_comboID & ((1 << IndexBitWidth) - 1));\n    }\n\nprivate:\n\n    unsigned int m_comboID;\n} ComboID;\n\n\ntypedef struct CrossScopeId\n{\n    static const unsigned int LocalIdBitWidth = 20;\n    static const unsigned int IdScopeBitWidth = 11;\n    static const unsigned int StartCrossScopeId =\n        (unsigned int) (1 << (LocalIdBitWidth + IdScopeBitWidth));\n    static const unsigned int LocalIdMask = (1 << LocalIdBitWidth) - 1;\n    static const unsigned int ScopeIdMask = StartCrossScopeId - (1 << LocalIdBitWidth);\n\n    // Compilation unit at most reference 1M constructed type.\n    static const unsigned int MaxLocalId = (1 << LocalIdBitWidth) - 1;\n\n    // Compilation unit at most reference to another 2K compilation units.\n    static const unsigned int MaxScopeId = (1 << IdScopeBitWidth) - 1;\n\n    CrossScopeId(unsigned short aIdScopeId, unsigned int aLocalId)\n    {\n        crossScopeId = StartCrossScopeId\n               | (aIdScopeId << LocalIdBitWidth)\n               | aLocalId;\n    }\n\n    operator unsigned int() {\n        return crossScopeId;\n    }\n\n    unsigned int GetLocalId() {\n        return crossScopeId & LocalIdMask;\n    }\n\n    unsigned int GetIdScopeId() {\n        return (crossScopeId & ScopeIdMask) >> LocalIdBitWidth;\n    }\n\n    static bool IsCrossScopeId(unsigned int i)\n    {\n        return (StartCrossScopeId & i) != 0;\n    }\n\n    static CrossScopeId Decode(unsigned int i)\n    {\n        CrossScopeId retval;\n        retval.crossScopeId = i;\n        return retval;\n    }\n\nprivate:\n\n    CrossScopeId() {}\n\n    unsigned int crossScopeId;\n\n} CrossScopeId;\n\n// Combined encoding of TI or FuncId, In compiler implementation\n// Id prefixed by 1 if it is function ID.\n\ntypedef struct DecoratedItemId\n{\n    DecoratedItemId(bool isFuncId, CV_ItemId inputId) {\n        if (isFuncId) {\n            decoratedItemId = 0x80000000 | inputId;\n        } else {\n            decoratedItemId = inputId;\n        }\n    }\n\n    DecoratedItemId(CV_ItemId encodedId) {\n        decoratedItemId = encodedId;\n    }\n\n    operator unsigned int() {\n        return decoratedItemId;\n    }\n\n    bool IsFuncId()\n    {\n        return (decoratedItemId & 0x80000000) == 0x80000000;\n    }\n\n    CV_ItemId GetItemId()\n    {\n        return decoratedItemId & 0x7fffffff;\n    }\n\nprivate:\n\n    unsigned int decoratedItemId;\n\n} DecoratedItemId;\n\n// Compilation Unit object file path include library name\n// Or compile time PDB full path\n\ntypedef struct tagPdbIdScope {\n    CV_off32_t  offObjectFilePath;\n} PdbIdScope;\n\n// An array of all imports by import module.\n// List all cross reference for a specific ID scope.\n// Format of DEBUG_S_CROSSSCOPEIMPORTS subsection is\ntypedef struct tagCrossScopeReferences {\n    PdbIdScope    externalScope;              // Module of definition Scope.\n    unsigned int  countOfCrossReferences;     // Count of following array.\n    CV_ItemId     referenceIds[CV_ZEROLEN];   // CV_ItemId in another compilation unit.\n} CrossScopeReferences;\n\n// An array of all exports in this module.\n// Format of DEBUG_S_CROSSSCOPEEXPORTS subsection is\ntypedef struct tagLocalIdAndGlobalIdPair {\n    CV_ItemId localId;    // local id inside the compile time PDB scope. 0 based\n    CV_ItemId globalId;   // global id inside the link time PDB scope, if scope are different.\n} LocalIdAndGlobalIdPair;\n\n// Format of DEBUG_S_INLINEELINEINFO subsection\n// List start source file information for an inlined function.\n\n#define CV_INLINEE_SOURCE_LINE_SIGNATURE     0x0\n#define CV_INLINEE_SOURCE_LINE_SIGNATURE_EX  0x1\n\ntypedef struct tagInlineeSourceLine {\n    CV_ItemId      inlinee;       // function id.\n    CV_off32_t     fileId;        // offset into file table DEBUG_S_FILECHKSMS\n    CV_off32_t     sourceLineNum; // definition start line number.\n} InlineeSourceLine;\n\ntypedef struct tagInlineeSourceLineEx {\n    CV_ItemId      inlinee;       // function id\n    CV_off32_t     fileId;        // offset into file table DEBUG_S_FILECHKSMS\n    CV_off32_t     sourceLineNum; // definition start line number\n    unsigned int   countOfExtraFiles;\n    CV_off32_t     extraFileId[CV_ZEROLEN];\n} InlineeSourceLineEx;\n\n// BinaryAnnotations ::= BinaryAnnotationInstruction+\n// BinaryAnnotationInstruction ::= BinaryAnnotationOpcode Operand+\n//\n// The binary annotation mechanism supports recording a list of annotations\n// in an instruction stream.  The X64 unwind code and the DWARF standard have\n// similar design.\n//\n// One annotation contains opcode and a number of 32bits operands.\n//\n// The initial set of annotation instructions are for line number table\n// encoding only.  These annotations append to S_INLINESITE record, and\n// operands are unsigned except for BA_OP_ChangeLineOffset.\n\nenum BinaryAnnotationOpcode\n{\n    BA_OP_Invalid,               // link time pdb contains PADDINGs\n    BA_OP_CodeOffset,            // param : start offset\n    BA_OP_ChangeCodeOffsetBase,  // param : nth separated code chunk (main code chunk == 0)\n    BA_OP_ChangeCodeOffset,      // param : delta of offset\n    BA_OP_ChangeCodeLength,      // param : length of code, default next start\n    BA_OP_ChangeFile,            // param : fileId\n    BA_OP_ChangeLineOffset,      // param : line offset (signed)\n    BA_OP_ChangeLineEndDelta,    // param : how many lines, default 1\n    BA_OP_ChangeRangeKind,       // param : either 1 (default, for statement)\n                                 //         or 0 (for expression)\n\n    BA_OP_ChangeColumnStart,     // param : start column number, 0 means no column info\n    BA_OP_ChangeColumnEndDelta,  // param : end column number delta (signed)\n\n    // Combo opcodes for smaller encoding size.\n\n    BA_OP_ChangeCodeOffsetAndLineOffset,  // param : ((sourceDelta << 4) | CodeDelta)\n    BA_OP_ChangeCodeLengthAndCodeOffset,  // param : codeLength, codeOffset\n\n    BA_OP_ChangeColumnEnd,       // param : end column number\n};\n\ninline int BinaryAnnotationInstructionOperandCount(BinaryAnnotationOpcode op)\n{\n    return (op == BA_OP_ChangeCodeLengthAndCodeOffset) ? 2 : 1;\n}\n\n///////////////////////////////////////////////////////////////////////////////\n//\n// This routine a simplified variant from cor.h.\n//\n// Compress an unsigned integer (iLen) and store the result into pDataOut.\n//\n// Return value is the number of bytes that the compressed data occupies.  It\n// is caller's responsibilityt to ensure *pDataOut has at least 4 bytes to be\n// written to.\n//\n// Note that this function returns -1 if iLen is too big to be compressed.\n// We currently can only encode numbers no larger than 0x1FFFFFFF.\n//\n///////////////////////////////////////////////////////////////////////////////\n\ntypedef unsigned __int8 UInt8;\ntypedef unsigned __int32 UInt32;\n\ntypedef UInt8 CompressedAnnotation;\ntypedef CompressedAnnotation* PCompressedAnnotation;\n\ninline UInt32 CVCompressData(\n    UInt32  iLen,       // [IN]  given uncompressed data\n    void *  pDataOut)   // [OUT] buffer for the compressed data\n{\n    UInt8 *pBytes = reinterpret_cast<UInt8 *>(pDataOut);\n\n    if (iLen <= 0x7F) {\n        *pBytes = UInt8(iLen);\n        return 1;\n    }\n\n    if (iLen <= 0x3FFF) {\n        *pBytes     = UInt8((iLen >> 8) | 0x80);\n        *(pBytes+1) = UInt8(iLen & 0xff);\n        return 2;\n    }\n\n    if (iLen <= 0x1FFFFFFF) {\n        *pBytes     = UInt8((iLen >> 24) | 0xC0);\n        *(pBytes+1) = UInt8((iLen >> 16) & 0xff);\n        *(pBytes+2) = UInt8((iLen >> 8)  & 0xff);\n        *(pBytes+3) = UInt8(iLen & 0xff);\n        return 4;\n    }\n\n    return (UInt32) -1;\n}\n\n///////////////////////////////////////////////////////////////////////////////\n//\n// Uncompress the data in pData and store the result into pDataOut.\n//\n// Return value is the uncompressed unsigned integer.  pData is incremented to\n// point to the next piece of uncompressed data.\n//\n// Returns -1 if what is passed in is incorrectly compressed data, such as\n// (*pBytes & 0xE0) == 0xE0.\n//\n///////////////////////////////////////////////////////////////////////////////\n\ninline UInt32 CVUncompressData(\n    PCompressedAnnotation & pData)    // [IN,OUT] compressed data\n{\n    UInt32 res = (UInt32)(-1);\n\n    if ((*pData & 0x80) == 0x00) {\n        // 0??? ????\n\n        res = (UInt32)(*pData++);\n    }\n    else if ((*pData & 0xC0) == 0x80) {\n        // 10?? ????\n\n        res = (UInt32)((*pData++ & 0x3f) << 8);\n        res |= *pData++;\n    }\n    else if ((*pData & 0xE0) == 0xC0) {\n        // 110? ????\n\n        res = (*pData++ & 0x1f) << 24;\n        res |= *pData++ << 16;\n        res |= *pData++ << 8;\n        res |= *pData++;\n    }\n\n    return res;\n}\n\n// Encode smaller absolute numbers with smaller buffer.\n//\n// General compression only work for input < 0x1FFFFFFF\n// algorithm will not work on 0x80000000\n\ninline unsigned __int32 EncodeSignedInt32(__int32 input)\n{\n    unsigned __int32 rotatedInput;\n\n    if (input >= 0) {\n        rotatedInput = input << 1;\n    } else {\n        rotatedInput = ((-input) << 1) | 1;\n    }\n\n    return rotatedInput;\n}\n\ninline __int32 DecodeSignedInt32(unsigned __int32 input)\n{\n    __int32 rotatedInput;\n\n    if (input & 1) {\n        rotatedInput = - (int)(input >> 1);\n    } else {\n        rotatedInput = input >> 1;\n    }\n\n    return rotatedInput;\n}\n\n}\n#endif\n#pragma pack ( pop )\n\n#endif /* CV_INFO_INCLUDED */\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/cycletimer.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// CycleTimer has methods related to getting cycle timer values.\n// It uses an all-statics class as a namespace mechanism.\n//\n\n#ifndef _CYCLETIMER_H_\n#define _CYCLETIMER_H_\n\n#include \"windef.h\"\n\nclass CycleTimer\n{\n   // This returns the value of the *non-thread-virtualized* cycle counter.\n    static unsigned __int64 GetCycleCount64();\n\n\n    // This wraps GetCycleCount64 in the signature of QueryThreadCycleTime -- but note\n    // that it ignores the \"thrd\" argument.\n    static BOOL WINAPI DefaultQueryThreadCycleTime(_In_ HANDLE thrd, _Out_ PULONG64 cyclesPtr);\n\n    // The function pointer type for QueryThreadCycleTime.\n    typedef BOOL (WINAPI *QueryThreadCycleTimeSig)(_In_ HANDLE, _Out_ PULONG64);\n\n    // Returns a function pointer for QueryThreadCycleTime, or else BadFPtr.\n    static QueryThreadCycleTimeSig GetQueryThreadCycleTime();\n\n    // Initialized once from NULL to either BadFPtr or QueryThreadCycleTime.\n    static QueryThreadCycleTimeSig s_QueryThreadCycleTimeFPtr;\n\n  public:\n\n    // This method computes the number of cycles/sec for the current machine.  The cycles are those counted\n    // by GetThreadCycleTime; we assume that these are of equal duration, though that is not necessarily true.\n    // If any OS interaction fails, returns 0.0.\n    static double CyclesPerSecond();\n\n    // Does a large number of queries, and returns the average of their overhead, so other measurements\n    // can adjust for this.\n    static unsigned __int64 QueryOverhead();\n\n    // There's no \"native\" atomic add for 64 bit, so we have this convenience function.\n    static void InterlockedAddU64(unsigned __int64* loc, unsigned __int64 amount);\n\n    // Attempts to query the cycle counter of the current thread.  If successful, returns \"true\" and sets\n    // *cycles to the cycle counter value.  Otherwise, returns false.  Note that the value returned is (currently)\n    // virtualized to the current thread only on Windows; on non-windows x86/x64 platforms, directly reads\n    // the cycle counter and returns that value.\n    static bool GetThreadCyclesS(unsigned __int64* cycles);\n};\n\n#endif // _CYCLETIMER_H_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/daccess.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// File: daccess.h\n//\n\n//\n// Support for external access of runtime data structures.  These\n// macros and templates hide the details of pointer and data handling\n// so that data structures and code can be compiled to work both\n// in-process and through a special memory access layer.\n//\n// This code assumes the existence of two different pieces of code,\n// the target, the runtime code that is going to be examined, and\n// the host, the code that's doing the examining.  Access to the\n// target is abstracted so the target may be a live process on the\n// same machine, a live process on a different machine, a dump file\n// or whatever.  No assumptions should be made about accessibility\n// of the target.\n//\n// This code assumes that the data in the target is static.  Any\n// time the target's data changes the interfaces must be reset so\n// that potentially stale data is discarded.\n//\n// This code is intended for read access and there is no\n// way to write data back currently.\n//\n// DAC-ized code:\n// - is read-only (non-invasive). So DACized codepaths can not trigger a GC.\n// - has no Thread* object.  In reality, DAC-ized codepaths are\n//   ReadProcessMemory calls from out-of-process. Conceptually, they\n//   are like a pure-native (preemptive) thread.\n////\n// This means that in particular, you cannot DACize a GCTRIGGERS function.\n// Neither can you DACize a function that throws if this will involve\n// allocating a new exception object. There may be\n// exceptions to these rules if you can guarantee that the DACized\n// part of the code path cannot cause a garbage collection (see\n// EditAndContinueModule::ResolveField for an example).\n// If you need to DACize a function that may trigger\n// a GC, it is probably best to refactor the function so that the DACized\n// part of the code path is in a separate function. For instance,\n// functions with GetOrCreate() semantics are hard to DAC-ize because\n// they the Create portion is inherently invasive. Instead, consider refactoring\n// into a GetOrFail() function that DAC can call; and then make GetOrCreate()\n// a wrapper around that.\n\n//\n// This code works by hiding the details of access to target memory.\n// Access is divided into two types:\n// 1. DPTR - access to a piece of data.\n// 2. VPTR - access to a class with a vtable.  The class can only have\n//           a single vtable pointer at the beginning of the class instance.\n// Things only need to be declared as VPTRs when it is necessary to\n// call virtual functions in the host.  In that case the access layer\n// must do extra work to provide a host vtable for the object when\n// it is retrieved so that virtual functions can be called.\n//\n// When compiling with DACCESS_COMPILE the macros turn into templates\n// which replace pointers with smart pointers that know how to fetch\n// data from the target process and provide a host process version of it.\n// Normal data structure access will transparently receive a host copy\n// of the data and proceed, so code such as\n//     typedef DPTR(Class) PTR_Class;\n//     PTR_Class cls;\n//     int val = cls->m_Int;\n// will work without modification.  The appropriate operators are overloaded\n// to provide transparent access, such as the -> operator in this case.\n// Note that the convention is to create an appropriate typedef for\n// each type that will be accessed.  This hides the particular details\n// of the type declaration and makes the usage look more like regular code.\n//\n// The ?PTR classes also have an implicit base type cast operator to\n// produce a host-pointer instance of the given type.  For example\n//     Class* cls = PTR_Class(addr);\n// works by implicit conversion from the PTR_Class created by wrapping\n// to a host-side Class instance.  Again, this means that existing code\n// can work without modification.\n//\n// Code Example:\n//\n// typedef struct _rangesection\n// {\n//     PTR_IJitManager pjit;\n//     PTR_RangeSection pright;\n//     PTR_RangeSection pleft;\n//     ... Other fields omitted ...\n// } RangeSection;\n//\n//     RangeSection* pRS = m_RangeTree;\n//\n//     while (pRS != NULL)\n//     {\n//         if (currentPC < pRS->LowAddress)\n//             pRS=pRS->pleft;\n//         else if (currentPC > pRS->HighAddress)\n//             pRS=pRS->pright;\n//         else\n//         {\n//             return pRS->pjit;\n//         }\n//     }\n//\n// This code does not require any modifications.  The global reference\n// provided by m_RangeTree will be a host version of the RangeSection\n// instantiated by conversion.  The references to pRS->pleft and\n// pRS->pright will refer to DPTRs due to the modified declaration.\n// In the assignment statement the compiler will automatically use\n// the implicit conversion from PTR_RangeSection to RangeSection*,\n// causing a host instance to be created.  Finally, if an appropriate\n// section is found the use of pRS->pjit will cause an implicit\n// conversion from PTR_IJitManager to IJitManager.  The VPTR code\n// will look at target memory to determine the actual derived class\n// for the JitManager and instantiate the right class in the host so\n// that host virtual functions can be used just as they would in\n// the target.\n//\n// There are situations where code modifications are required, though.\n//\n// 1.  Any time the actual value of an address matters, such as using\n//     it as a search key in a tree, the target address must be used.\n//\n// An example of this is the RangeSection tree used to locate JIT\n// managers.  A portion of this code is shown above.  Each\n// RangeSection node in the tree describes a range of addresses\n// managed by the JitMan.  These addresses are just being used as\n// values, not to dereference through, so there are not DPTRs.  When\n// searching the range tree for an address the address used in the\n// search must be a target address as that's what values are kept in\n// the RangeSections.  In the code shown above, currentPC must be a\n// target address as the RangeSections in the tree are all target\n// addresses.  Use dac_cast<TADDR> to retrieve the target address\n// of a ?PTR, as well as to convert a host address to the\n// target address used to retrieve that particular instance. Do not\n// use dac_cast with any raw target pointer types (such as BYTE*).\n//\n// 2.  Any time an address is modified, such as by address arithmetic,\n//     the arithmetic must be performed on the target address.\n//\n// When a host instance is created it is created for the type in use.\n// There is no particular relation to any other instance, so address\n// arithmetic cannot be used to get from one instance to any other\n// part of memory.  For example\n//     char* Func(Class* cls)\n//     {\n//         // String follows the basic Class data.\n//         return (char*)(cls + 1);\n//     }\n// does not work with external access because the Class* used would\n// have retrieved only a Class worth of data.  There is no string\n// following the host instance.  Instead, this code should use\n// dac_cast<TADDR> to get the target address of the Class\n// instance, add sizeof(*cls) and then create a new ?PTR to access\n// the desired data.  Note that the newly retrieved data will not\n// be contiguous with the Class instance, so address arithmetic\n// will still not work.\n//\n// Previous Code:\n//\n//     BOOL IsTarget(LPVOID ip)\n//     {\n//         StubCallInstrs* pStubCallInstrs = GetStubCallInstrs();\n//\n//         if (ip == (LPVOID) &(pStubCallInstrs->m_op))\n//         {\n//             return TRUE;\n//         }\n//\n// Modified Code:\n//\n//     BOOL IsTarget(LPVOID ip)\n//     {\n//         StubCallInstrs* pStubCallInstrs = GetStubCallInstrs();\n//\n//         if ((TADDR)ip == dac_cast<TADDR>(pStubCallInstrs) +\n//             (TADDR)offsetof(StubCallInstrs, m_op))\n//         {\n//             return TRUE;\n//         }\n//\n// The parameter ip is a target address, so the host pStubCallInstrs\n// cannot be used to derive an address from.  The member & reference\n// has to be replaced with a conversion from host to target address\n// followed by explicit offsetting for the field.\n//\n// PTR_HOST_MEMBER_TADDR is a convenience macro that encapsulates\n// these two operations, so the above code could also be:\n//\n//     if ((TADDR)ip ==\n//         PTR_HOST_MEMBER_TADDR(StubCallInstrs, pStubCallInstrs, m_op))\n//\n// 3.  Any time the amount of memory referenced through an address\n//     changes, such as by casting to a different type, a new ?PTR\n//     must be created.\n//\n// Host instances are created and stored based on both the target\n// address and size of access.  The access code has no way of knowing\n// all possible ways that data will be retrieved for a given address\n// so if code changes the way it accesses through an address a new\n// ?PTR must be used, which may lead to a difference instance and\n// different host address.  This means that pointer identity does not hold\n// across casts, so code like\n//     Class* cls = PTR_Class(addr);\n//     Class2* cls2 = PTR_Class2(addr);\n//     return cls == cls2;\n// will fail because the host-side instances have no relation to each\n// other.  That isn't a problem, since by rule #1 you shouldn't be\n// relying on specific host address values.\n//\n// Previous Code:\n//\n//     return (ArrayClass *) m_pMethTab->GetClass();\n//\n// Modified Code:\n//\n//     return PTR_ArrayClass(m_pMethTab->GetClass());\n//\n// The ?PTR templates have an implicit conversion from a host pointer\n// to a target address, so the cast above constructs a new\n// PTR_ArrayClass by implicitly converting the host pointer result\n// from GetClass() to its target address and using that as the address\n// of the new PTR_ArrayClass.  As mentioned, the actual host-side\n// pointer values may not be the same.\n//\n// Host pointer identity can be assumed as long as the type of access\n// is the same.  In the example above, if both accesses were of type\n// Class then the host pointer will be the same, so it is safe to\n// retrieve the target address of an instance and then later get\n// a new host pointer for the target address using the same type as\n// the host pointer in that case will be the same.  This is enabled\n// by caching all of the retrieved host instances.  This cache is searched\n// by the addr:size pair and when there's a match the existing instance\n// is reused.  This increases performance and also allows simple\n// pointer identity to hold.  It does mean that host memory grows\n// in proportion to the amount of target memory being referenced,\n// so retrieving extraneous data should be avoided.\n// The host-side data cache grows until the Flush() method is called,\n// at which point all host-side data is discarded.  No host\n// instance pointers should be held across a Flush().\n//\n// Accessing into an object can lead to some unusual behavior.  For\n// example, the SList class relies on objects to contain an SLink\n// instance that it uses for list maintenance.  This SLink can be\n// embedded anywhere in the larger object.  The SList access is always\n// purely to an SLink, so when using the access layer it will only\n// retrieve an SLink's worth of data.  The SList template will then\n// do some address arithmetic to determine the start of the real\n// object and cast the resulting pointer to the final object type.\n// When using the access layer this results in a new ?PTR being\n// created and used, so a new instance will result.  The internal\n// SLink instance will have no relation to the new object instance\n// even though in target address terms one is embedded in the other.\n// The assumption of data stability means that this won't cause\n// a problem, but care must be taken with the address arithmetic,\n// as laid out in rules #2 and #3.\n//\n// 4.  Global address references cannot be used.  Any reference to a\n//     global piece of code or data, such as a function address, global\n//     variable or class static variable, must be changed.\n//\n// The external access code may load at a different base address than\n// the target process code.  Global addresses are therefore not\n// meaningful and must be replaced with something else.  There isn't\n// a single solution, so replacements must be done on a case-by-case\n// basis.\n//\n// The simplest case is a global or class static variable.  All\n// declarations must be replaced with a special declaration that\n// compiles into a modified accessor template value when compiled for\n// external data access.  Uses of the variable automatically are fixed\n// up by the template instance.  Note that assignment to the global\n// must be independently ifdef'ed as the external access layer should\n// not make any modifications.\n//\n// Macros allow for simple declaration of a class static and global\n// values that compile into an appropriate templated value.\n//\n// Previous Code:\n//\n//     static RangeSection* m_RangeTree;\n//     RangeSection* ExecutionManager::m_RangeTree;\n//\n//     extern ThreadStore* g_pThreadStore;\n//     ThreadStore* g_pThreadStore = &StaticStore;\n//     class SystemDomain : public BaseDomain {\n//         ...\n//         ArrayListStatic m_appDomainIndexList;\n//         ...\n//     }\n//\n//     SystemDomain::m_appDomainIndexList;\n//\n//     extern DWORD gThreadTLSIndex;\n//\n//     DWORD gThreadTLSIndex = TLS_OUT_OF_INDEXES;\n//\n// Modified Code:\n//\n//     typedef DPTR(RangeSection) PTR_RangeSection;\n//     SPTR_DECL(RangeSection, m_RangeTree);\n//     SPTR_IMPL(RangeSection, ExecutionManager, m_RangeTree);\n//\n//     typedef DPTR(ThreadStore) PTR_ThreadStore\n//     GPTR_DECL(ThreadStore, g_pThreadStore);\n//     GPTR_IMPL_INIT(ThreadStore, g_pThreadStore, &StaticStore);\n//\n//     class SystemDomain : public BaseDomain {\n//         ...\n//         SVAL_DECL(ArrayListStatic; m_appDomainIndexList);\n//         ...\n//     }\n//\n//     SVAL_IMPL(ArrayListStatic, SystemDomain, m_appDomainIndexList);\n//\n//     GVAL_DECL(DWORD, gThreadTLSIndex);\n//\n//     GVAL_IMPL_INIT(DWORD, gThreadTLSIndex, TLS_OUT_OF_INDEXES);\n//\n// When declaring the variable, the first argument declares the\n// variable's type and the second argument declares the variable's\n// name.  When defining the variable the arguments are similar, with\n// an extra class name parameter for the static class variable case.\n// If an initializer is needed the IMPL_INIT macro should be used.\n//\n// Things get slightly more complicated when declaring an embedded\n// array.  In this case the data element is not a single element and\n// therefore cannot be represented by a ?PTR. In the case of a global\n// array, you should use the GARY_DECL and GARY_IMPL macros.\n// We durrently have no support for declaring static array data members\n// or initialized arrays. Array data members that are dynamically allocated\n// need to be treated as pointer members. To reference individual elements\n// you must use pointer arithmetic (see rule 2 above). An array declared\n// as a local variable within a function does not need to be DACized.\n//\n//\n// All uses of ?VAL_DECL must have a corresponding entry given in the\n// DacGlobals structure in src\\inc\\dacvars.h.  For SVAL_DECL the entry\n// is class__name.  For GVAL_DECL the entry is dac__name. You must add\n// these entries in dacvars.h using the DEFINE_DACVAR macro. Note that\n// these entries also are used for dumping memory in mini dumps and\n// heap dumps. If it's not appropriate to dump a variable, (e.g.,\n// it's an array or some other value that is not important to have\n// in a minidump) a second macro, DEFINE_DACVAR_NO_DUMP, will allow\n// you to make the required entry in the DacGlobals structure without\n// dumping its value. If the variable is implemented with one of the VOLATILE_* macros\n// then the DEFINE_DACVAR_VOLATILE macro must be used.\n//\n// For convenience, here is a list of the various variable declaration and\n// initialization macros:\n// SVAL_DECL(type, name)      static non-pointer data   class MyClass\n//                            member declared within    {\n//                            the class declaration        // static int i;\n//                                                         SVAL_DECL(int, i);\n//                                                      }\n//\n// SVAL_IMPL(type, cls, name) static non-pointer data   // int MyClass::i;\n//                            member defined outside    SVAL_IMPL(int, MyClass, i);\n//                            the class declaration\n//\n// SVAL_IMPL_INIT(type, cls,  static non-pointer data   // int MyClass::i = 0;\n//                name, val)  member defined and        SVAL_IMPL_INIT(int, MyClass, i, 0);\n//                            initialized outside the\n//                            class declaration\n// ------------------------------------------------------------------------------------------------\n// VOLATILE_SVAL_DECL(type, name)    static volatile   class MyClass\n//                                   non-pointer data  {\n//                                   member declared      // static Volatile<int> i;\n//                                   within the class     VOLATILE_SVAL_DECL(int, i);\n//                                    declaration      }\n//\n// VOLATILE_SVAL_IMPL(type, cls,     static volatile\n//                    name)          non-pointer data  // Volatile<int> MyClass::i;\n//                                   member defined    VOLATILE_SVAL_IMPL(int, MyClass, i);\n//                                   outside the\n//                                   class declaration\n//\n// VOLATILE_SVAL_IMPL_INIT(          static volatile\n//    type, cls, name)               non-pointer data  // Volatile<int> MyClass::i = 0;\n//                                   member defined    VOLATILE_SVAL_IMPL_INIT(int, MyClass, i, 0);\n//                                   and initialized\n//                                   outside the\n//                                   class declaration\n// ------------------------------------------------------------------------------------------------\n// SPTR_DECL(type, name)      static pointer data       class MyClass\n//                            member declared within    {\n//                            the class declaration        // static int * pInt;\n//                                                         SPTR_DECL(int, pInt);\n//                                                      }\n//\n// SPTR_IMPL(type, cls, name) static pointer data       // int * MyClass::pInt;\n//                            member defined outside    SPTR_IMPL(int, MyClass, pInt);\n//                            the class declaration\n//\n// SPTR_IMPL_INIT(type, cls,  static pointer data       // int * MyClass::pInt = NULL;\n//                name, val)  member defined and        SPTR_IMPL_INIT(int, MyClass, pInt, NULL);\n//                            initialized outside the\n//                            class declaration\n// ------------------------------------------------------------------------------------------------\n// VOLATILE_SPTR_DECL(type, name)    static volatile   class MyClass\n//                                   pointer data      {\n//                                   member declared      // static Volatile<int*> i;\n//                                   within the class     VOLATILE_SPTR_DECL(int, i);\n//                                    declaration      }\n//\n// VOLATILE_SPTR_IMPL(type, cls,     static volatile\n//                    name)          pointer data      // Volatile<int*> MyClass::i;\n//                                   member defined    VOLATILE_SPTR_IMPL(int, MyClass, i);\n//                                   outside the\n//                                   class declaration\n//\n// VOLATILE_SPTR_IMPL_INIT(          static volatile\n//    type, cls, name)               pointer data      // Volatile<int*> MyClass::i = 0;\n//                                   member defined    VOLATILE_SPTR_IMPL_INIT(int, MyClass, i, 0);\n//                                   and initialized\n//                                   outside the\n//                                   class declaration\n// ------------------------------------------------------------------------------------------------\n// GVAL_DECL(type, name)      extern declaration of     // extern int g_i\n//                            global non-pointer        GVAL_DECL(int, g_i);\n//                            variable\n//\n// GVAL_IMPL(type, name)      declaration of a          // int g_i\n//                            global non-pointer        GVAL_IMPL(int, g_i);\n//                            variable\n//\n// GVAL_IMPL_INIT (type,      declaration and           // int g_i = 0;\n//                 name,      initialization of a       GVAL_IMPL_INIT(int, g_i, 0);\n//                 val)       global non-pointer\n//                            variable\n// ****Note****\n// If you use GVAL_? to declare a global variable of a structured type and you need to\n// access a member of the type, you cannot use the dot operator. Instead, you must take the\n// address of the variable and use the arrow operator. For example:\n// struct\n// {\n//    int x;\n//    char ch;\n// } MyStruct;\n// GVAL_IMPL(MyStruct, g_myStruct);\n// int i = (&g_myStruct)->x;\n// ------------------------------------------------------------------------------------------------\n// GPTR_DECL(type, name)      extern declaration of     // extern int * g_pInt\n//                            global pointer            GPTR_DECL(int, g_pInt);\n//                            variable\n//\n// GPTR_IMPL(type, name)      declaration of a          // int * g_pInt\n//                            global pointer            GPTR_IMPL(int, g_pInt);\n//                            variable\n//\n// GPTR_IMPL_INIT (type,      declaration and           // int * g_pInt = 0;\n//                 name,      initialization of a       GPTR_IMPL_INIT(int, g_pInt, NULL);\n//                 val)       global pointer\n//                            variable\n// ------------------------------------------------------------------------------------------------\n// GARY_DECL(type, name)      extern declaration of     // extern int g_rgIntList[MAX_ELEMENTS];\n//                            a global array            GPTR_DECL(int, g_rgIntList, MAX_ELEMENTS);\n//                            variable\n//\n// GARY_IMPL(type, name)      declaration of a          // int g_rgIntList[MAX_ELEMENTS];\n//                            global pointer            GPTR_IMPL(int, g_rgIntList, MAX_ELEMENTS);\n//                            variable\n//\n//\n// Certain pieces of code, such as the stack walker, rely on identifying\n// an object from its vtable address.  As the target vtable addresses\n// do not necessarily correspond to the vtables used in the host, these\n// references must be translated.  The access layer maintains translation\n// tables for all classes used with VPTR and can return the target\n// vtable pointer for any host vtable in the known list of VPTR classes.\n//\n// ----- Errors:\n//\n// All errors in the access layer are reported via exceptions.  The\n// formal access layer methods catch all such exceptions and turn\n// them into the appropriate error, so this generally isn't visible\n// to users of the access layer.\n//\n// ----- DPTR Declaration:\n//\n// Create a typedef for the type with typedef DPTR(type) PTR_type;\n// Replace type* with PTR_type.\n//\n// ----- VPTR Declaration:\n//\n// VPTR can only be used on classes that have a single vtable\n// pointer at the beginning of the object.  This should be true\n// for a normal single-inheritance object.\n//\n// All of the classes that may be instantiated need to be identified\n// and marked.  In the base class declaration add either\n// VPTR_BASE_VTABLE_CLASS if the class is abstract or\n// VPTR_BASE_CONCRETE_VTABLE_CLASS if the class is concrete.  In each\n// derived class add VPTR_VTABLE_CLASS.  If you end up with compile or\n// link errors for an unresolved method called VPtrSize you missed a\n// derived class declaration.\n//\n//\n// All classes to be instantiated must be listed in src\\inc\\vptr_list.h.\n//\n// Create a typedef for the type with typedef VPTR(type) PTR_type;\n// When using a VPTR, replace Class* with PTR_Class.\n//\n// ----- Specific Macros:\n//\n// PTR_TO_TADDR(ptr)\n// Retrieves the raw target address for a ?PTR.\n// See code:dac_cast for the preferred alternative\n//\n// PTR_HOST_TO_TADDR(host)\n// Given a host address of an instance produced by a ?PTR reference,\n// return the original target address.  The host address must\n// be an exact match for an instance.\n// See code:dac_cast for the preferred alternative\n//\n// PTR_HOST_INT_TO_TADDR(host)\n// Given a host address which resides somewhere within an instance\n// produced by a ?PTR reference (a host interior pointer) return the\n// corresponding target address. This is useful for evaluating\n// relative pointers (e.g. RelativePointer<T>) where calculating the\n// target address requires knowledge of the target address of the\n// relative pointer field itself. This lookup is slower than that for\n// a non-interior host pointer so use it sparingly.\n//\n// VPTR_HOST_VTABLE_TO_TADDR(host)\n// Given the host vtable pointer for a known VPTR class, return\n// the target vtable pointer.\n//\n// PTR_HOST_MEMBER_TADDR(type, host, memb)\n// Retrieves the target address of a host instance pointer and\n// offsets it by the given member's offset within the type.\n//\n// PTR_HOST_INT_MEMBER_TADDR(type, host, memb)\n// As above but will work for interior host pointers (see the\n// description of PTR_HOST_INT_TO_TADDR for an explanation of host\n// interior pointers).\n//\n// PTR_READ(addr, size)\n// Reads a block of memory from the target and returns a host\n// pointer for it.  Useful for reading blocks of data from the target\n// whose size is only known at runtime, such as raw code for a jitted\n// method.  If the data being read is actually an object, use SPTR\n// instead to get better type semantics.\n//\n// DAC_EMPTY()\n// DAC_EMPTY_ERR()\n// DAC_EMPTY_RET(retVal)\n// DAC_UNEXPECTED()\n// Provides an empty method implementation when compiled\n// for DACCESS_COMPILE.  For example, use to stub out methods needed\n// for vtable entries but otherwise unused.\n//\n// These macros are designed to turn into normal code when compiled\n// without DACCESS_COMPILE.\n//\n//*****************************************************************************\n\n\n#ifndef __daccess_h__\n#define __daccess_h__\n\n#include <stdint.h>\n\n#include \"switches.h\"\n#include \"safemath.h\"\n#include \"corerror.h\"\n\n// Keep in sync with the definitions in dbgutil.cpp and createdump.h\n#define DACCESS_TABLE_SYMBOL \"g_dacTable\"\n\n#ifdef PAL_STDCPP_COMPAT\n#include <type_traits>\n#else\n#include \"clr_std/type_traits\"\n#include \"crosscomp.h\"\n#endif\n\n// Information stored in the DAC table of interest to the DAC implementation\n// Note that this information is shared between all instantiations of ClrDataAccess, so initialize\n// it just once in code:ClrDataAccess.GetDacGlobals (rather than use fields in ClrDataAccess);\nstruct DacTableInfo\n{\n    // On Windows, the first DWORD is the 32-bit timestamp read out of the runtime dll's debug directory.\n    // The remaining 3 DWORDS must all be 0.\n    // On Mac, this is the 16-byte UUID of the runtime dll.\n    // It is used to validate that mscorwks is the same version as mscordacwks\n    DWORD dwID0;\n    DWORD dwID1;\n    DWORD dwID2;\n    DWORD dwID3;\n};\n\n// The header of the DAC table.  This includes the number of globals, the number of vptrs, and\n// the DacTableInfo structure.  We need the DacTableInfo and DacTableHeader structs outside\n// of a DACCESS_COMPILE since soshost walks the Dac table headers to find the UUID of CoreCLR\n// in the target process.\nstruct DacTableHeader\n{\n    ULONG numGlobals;\n    ULONG numVptrs;\n    DacTableInfo info;\n};\n\n//\n// This version of things wraps pointer access in\n// templates which understand how to retrieve data\n// through an access layer.  In this case no assumptions\n// can be made that the current compilation processor or\n// pointer types match the target's processor or pointer types.\n//\n\n// Define TADDR as a non-pointer value so use of it as a pointer\n// will not work properly.  Define it as unsigned so\n// pointer comparisons aren't affected by sign.\n// This requires special casting to ULONG64 to sign-extend if necessary.\ntypedef ULONG_PTR TADDR;\n\n// TSIZE_T used for counts or ranges that need to span the size of a\n// target pointer.  For cross-plat, this may be different than SIZE_T\n// which reflects the host pointer size.\ntypedef SIZE_T TSIZE_T;\n\n\n//\n// The following table contains all the global information that data access needs to begin\n// operation.  All of the values stored here are RVAs.  DacGlobalBase() returns the current\n// base address to combine with to get a full target address.\n//\n\ntypedef struct _DacGlobals\n{\n#ifdef _MSC_VER\nprivate:\n    const static _DacGlobals s_dacGlobals;\n#else\n    void InitializeEntries();\n#endif\npublic:\n    static void Initialize();\n\n// These will define all of the dac related mscorwks static and global variables\n#define DEFINE_DACVAR(size, id, var)                 TADDR id;\n#define DEFINE_DACVAR_VOLATILE(size, id, var)        TADDR id;\n#define DEFINE_DACVAR_NO_DUMP(size, id, var)         TADDR id;\n#include \"dacvars.h\"\n#undef DEFINE_DACVAR_VOLATILE\n#undef DEFINE_DACVAR_NODUMP\n#undef DEFINE_DACVAR\n\n#define DEFINE_DACGFN(func) TADDR fn__##func;\n#define DEFINE_DACGFN_STATIC(class, func) TADDR fn__##class##__##func;\n#include \"gfunc_list.h\"\n#undef DEFINE_DACGFN\n#undef DEFINE_DACGFN_STATIC\n\n    // Vtable pointer values for all classes that must\n    // be instanted using vtable pointers as the identity.\n#define VPTR_CLASS(name) TADDR name##__vtAddr;\n#include \"vptr_list.h\"\n#undef VPTR_CLASS\n} DacGlobals;\n\n#ifdef DACCESS_COMPILE\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// These two functions are largely just for marking code\n// that is not fully converted.  DacWarning prints a debug\n// message, while DacNotImpl throws a not-implemented exception.\nvoid __cdecl DacWarning(_In_ _In_z_ char* format, ...);\nvoid DacNotImpl(void);\n\nvoid    DacError(HRESULT err);\nvoid    DECLSPEC_NORETURN DacError_NoRet(HRESULT err);\nTADDR   DacGlobalBase(void);\nDacGlobals* DacGlobalValues(void);\nHRESULT DacReadAll(TADDR addr, PVOID buffer, ULONG32 size, bool throwEx);\nHRESULT DacWriteAll(TADDR addr, PVOID buffer, ULONG32 size, bool throwEx);\nHRESULT DacAllocVirtual(TADDR addr, ULONG32 size,\n                        ULONG32 typeFlags, ULONG32 protectFlags,\n                        bool throwEx, TADDR* mem);\nHRESULT DacFreeVirtual(TADDR mem, ULONG32 size, ULONG32 typeFlags,\n                       bool throwEx);\nPVOID   DacInstantiateTypeByAddress(TADDR addr, ULONG32 size, bool throwEx);\nPVOID   DacInstantiateTypeByAddressNoReport(TADDR addr, ULONG32 size, bool throwEx);\nPVOID   DacInstantiateClassByVTable(TADDR addr, ULONG32 minSize, bool throwEx);\n\n// Copy a null-terminated ascii or unicode string from the target to the host.\n// Note that most of the work here is to find the null terminator.  If you know the exact length,\n// then you can also just call DacInstantiateTypebyAddress.\nPSTR    DacInstantiateStringA(TADDR addr, ULONG32 maxChars, bool throwEx);\nPWSTR   DacInstantiateStringW(TADDR addr, ULONG32 maxChars, bool throwEx);\n\nTADDR   DacGetTargetAddrForHostAddr(LPCVOID ptr, bool throwEx);\nTADDR   DacGetTargetAddrForHostInteriorAddr(LPCVOID ptr, bool throwEx);\nTADDR   DacGetTargetVtForHostVt(LPCVOID vtHost, bool throwEx);\nPWSTR   DacGetVtNameW(TADDR targetVtable);\n\n// Report a region of memory to the debugger\nbool    DacEnumMemoryRegion(TADDR addr, TSIZE_T size, bool fExpectSuccess = true);\n\n// Report a region of memory to the debugger\nbool DacUpdateMemoryRegion(TADDR addr, TSIZE_T bufferSize, BYTE* buffer);\n\nHRESULT DacWriteHostInstance(PVOID host, bool throwEx);\n\n// This is meant to mimic the RethrowTerminalExceptions/\n// SwallowAllExceptions/RethrowTransientExceptions macros to allow minidump\n// gathering cancelation for details see\n// code:ClrDataAccess.EnumMemoryRegionsWrapper\n\nextern void DacLogMessage(LPCSTR format, ...);\n\n// This is usable in EX_TRY exactly how RethrowTerminalExceptions et cetera\n#define RethrowCancelExceptions                                         \\\n    if (GET_EXCEPTION()->GetHR() == COR_E_OPERATIONCANCELED)            \\\n    {                                                                   \\\n        EX_RETHROW;                                                     \\\n    }                                                                   \\\n    DacLogMessage(\"DAC exception caught at %s:%d\\n\", __FILE__, __LINE__);\n\n// Occasionally it's necessary to allocate some host memory for\n// instance data that's created on the fly and so doesn't directly\n// correspond to target memory.  These are held and freed on flush\n// like other instances but can't be looked up by address.\nPVOID DacAllocHostOnlyInstance(ULONG32 size, bool throwEx);\n\n// Determines whether ASSERTs should be raised when inconsistencies in the target are detected\nbool DacTargetConsistencyAssertsEnabled();\n\n// Host instances can be marked as they are enumerated in\n// order to break cycles.  This function returns true if\n// the instance is already marked, otherwise it marks the\n// instance and returns false.\nbool DacHostPtrHasEnumMark(LPCVOID host);\n\n// Determines if EnumMemoryRegions has been called on a method descriptor.\n// This helps perf for minidumps of apps with large managed stacks.\nbool DacHasMethodDescBeenEnumerated(LPCVOID pMD);\n\n// Sets a flag indicating that EnumMemoryRegions on a method desciptor\n// has been successfully called. The function returns true if\n// this flag had been previously set.\nbool DacSetMethodDescEnumerated(LPCVOID pMD);\n\n// Determines if a method descriptor is valid\nBOOL DacValidateMD(LPCVOID pMD);\n\n// Enumerate the instructions around a call site to help debugger stack walking heuristics\nvoid DacEnumCodeForStackwalk(TADDR taCallEnd);\n\n// Given the address and the size of a memory range which is stored in the buffer, replace all the patches\n// in the buffer with the real opcodes.  This is especially important on X64 where the unwinder needs to\n// disassemble the native instructions.\nclass MemoryRange;\nHRESULT DacReplacePatchesInHostMemory(MemoryRange range, PVOID pBuffer);\n\n//\n// Convenience macros for EnumMemoryRegions implementations.\n//\n\n// Enumerate the given host instance and return\n// true if the instance hasn't already been enumerated.\n#define DacEnumHostDPtrMem(host) \\\n    (!DacHostPtrHasEnumMark(host) ? \\\n     (DacEnumMemoryRegion(PTR_HOST_TO_TADDR(host), sizeof(*host)), \\\n      true) : false)\n#define DacEnumHostSPtrMem(host, type) \\\n    (!DacHostPtrHasEnumMark(host) ? \\\n     (DacEnumMemoryRegion(PTR_HOST_TO_TADDR(host), \\\n                          type::DacSize(PTR_HOST_TO_TADDR(host))), \\\n      true) : false)\n#define DacEnumHostVPtrMem(host) \\\n    (!DacHostPtrHasEnumMark(host) ? \\\n     (DacEnumMemoryRegion(PTR_HOST_TO_TADDR(host), (host)->VPtrSize()), \\\n      true) : false)\n\n// Check enumeration of 'this' and return if this has already been\n// enumerated.  Making this the first line of an object's EnumMemoryRegions\n// method will prevent cycles.\n#define DAC_CHECK_ENUM_THIS() \\\n    if (DacHostPtrHasEnumMark(this)) return\n#define DAC_ENUM_DTHIS() \\\n    if (!DacEnumHostDPtrMem(this)) return\n#define DAC_ENUM_STHIS(type) \\\n    if (!DacEnumHostSPtrMem(this, type)) return\n#define DAC_ENUM_VTHIS() \\\n    if (!DacEnumHostVPtrMem(this)) return\n\n#ifdef __cplusplus\n}\nclass ReflectionModule;\ninterface IMDInternalImport* DacGetMDImport(const class PEAssembly* pPEAssembly,\n                                            bool throwEx);\ninterface IMDInternalImport* DacGetMDImport(const ReflectionModule* reflectionModule,\n                                            bool throwEx);\n\nint DacGetIlMethodSize(TADDR methAddr);\nstruct COR_ILMETHOD* DacGetIlMethod(TADDR methAddr);\n#ifdef FEATURE_EH_FUNCLETS\nstruct _UNWIND_INFO * DacGetUnwindInfo(TADDR taUnwindInfo);\n\n// virtually unwind a CONTEXT out-of-process\nstruct _KNONVOLATILE_CONTEXT_POINTERS;\nBOOL DacUnwindStackFrame(T_CONTEXT * pContext, T_KNONVOLATILE_CONTEXT_POINTERS* pContextPointers);\n#endif // FEATURE_EH_FUNCLETS\n\n#if defined(TARGET_UNIX)\n// call back through data target to unwind out-of-process\nHRESULT DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_POINTERS contextPointers);\n#endif // TARGET_UNIX\n\n#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS\nclass SString;\nvoid DacMdCacheAddEEName(TADDR taEE, const SString& ssEEName);\nbool DacMdCacheGetEEName(TADDR taEE, SString & ssEEName);\n#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS\n\n//\n// Computes (taBase + (dwIndex * dwElementSize()), with overflow checks.\n//\n// Arguments:\n//     taBase          the base TADDR value\n//     dwIndex         the index of the offset\n//     dwElementSize   the size of each element (to multiply the offset by)\n//\n// Return value:\n//     The resulting TADDR, or throws CORDB_E_TARGET_INCONSISTENT on overlow.\n//\n// Notes:\n//     The idea here is that overflows during address arithmetic suggest that we're operating on corrupt\n//     pointers.  It helps to improve reliability to detect the cases we can (like overflow) and fail.  Note\n//     that this is just a heuristic, not a security measure.  We can't trust target data regardless -\n//     failing on overflow is just one easy case of corruption to detect.  There is no need to use checked\n//     arithmetic everywhere in the DAC infrastructure, this is intended just for the places most likely to\n//     help catch bugs (eg. __DPtr::operator[]).\n//\ninline TADDR DacTAddrOffset( TADDR taBase, TSIZE_T dwIndex, TSIZE_T dwElementSize )\n{\n    ClrSafeInt<TADDR> t(taBase);\n    t += ClrSafeInt<TSIZE_T>(dwIndex) * ClrSafeInt<TSIZE_T>(dwElementSize);\n    if( t.IsOverflow() )\n    {\n        // Pointer arithmetic overflow - probably due to corrupt target data\n        DacError(CORDBG_E_TARGET_INCONSISTENT);\n    }\n    return t.Value();\n}\n\n\n// Base pointer wrapper which provides common behavior.\nclass __TPtrBase\n{\npublic:\n    __TPtrBase(void)\n    {\n        // Make uninitialized pointers obvious.\n        m_addr = (TADDR)-1;\n    }\n    __TPtrBase(TADDR addr)\n    {\n        m_addr = addr;\n    }\n\n    bool operator!() const\n    {\n        return m_addr == 0;\n    }\n    // We'd like to have an implicit conversion to bool here since the C++\n    // standard says all pointer types are implicitly converted to bool.\n    // Unfortunately, that would cause ambiguous overload errors for uses\n    // of operator== and operator!=.  Instead callers will have to compare\n    // directly against NULL.\n\n    bool operator==(TADDR addr) const\n    {\n        return m_addr == addr;\n    }\n    bool operator!=(TADDR addr) const\n    {\n        return m_addr != addr;\n    }\n    bool operator<(TADDR addr) const\n    {\n        return m_addr < addr;\n    }\n    bool operator>(TADDR addr) const\n    {\n        return m_addr > addr;\n    }\n    bool operator<=(TADDR addr) const\n    {\n        return m_addr <= addr;\n    }\n    bool operator>=(TADDR addr) const\n    {\n        return m_addr >= addr;\n    }\n\n    TADDR GetAddr(void) const\n    {\n        return m_addr;\n    }\n    TADDR SetAddr(TADDR addr)\n    {\n        m_addr = addr;\n        return addr;\n    }\n\nprotected:\n    TADDR m_addr;\n};\n\n// Pointer wrapper base class for various forms of normal data.\n// This has the common functionality between __DPtr and __ArrayDPtr.\n// The DPtrType type parameter is the actual derived type in use.  This is necessary so that\n// inhereted functions preserve exact return types.\ntemplate<typename type, typename DPtrType>\nclass __DPtrBase : public __TPtrBase\n{\npublic:\n    typedef type _Type;\n    typedef type* _Ptr;\n\nprotected:\n    // Constructors\n    // All protected - this type should not be used directly - use one of the derived types instead.\n    __DPtrBase< type, DPtrType >(void) : __TPtrBase() {}\n    __DPtrBase< type, DPtrType >(TADDR addr) : __TPtrBase(addr) {}\n\n    explicit __DPtrBase< type, DPtrType >(__TPtrBase addr)\n    {\n        m_addr = addr.GetAddr();\n    }\n    explicit __DPtrBase< type, DPtrType >(type const * host)\n    {\n        m_addr = DacGetTargetAddrForHostAddr(host, true);\n    }\n\npublic:\n    DPtrType& operator=(const __TPtrBase& ptr)\n    {\n        m_addr = ptr.GetAddr();\n        return DPtrType(m_addr);\n    }\n    DPtrType& operator=(TADDR addr)\n    {\n        m_addr = addr;\n        return DPtrType(m_addr);\n    }\n\n    type& operator*(void) const\n    {\n        return *(type*)DacInstantiateTypeByAddress(m_addr, sizeof(type), true);\n    }\n\n    bool operator==(const DPtrType& ptr) const\n    {\n        return m_addr == ptr.GetAddr();\n    }\n    bool operator==(TADDR addr) const\n    {\n        return m_addr == addr;\n    }\n    bool operator!=(const DPtrType& ptr) const\n    {\n        return !operator==(ptr);\n    }\n    bool operator!=(TADDR addr) const\n    {\n        return m_addr != addr;\n    }\n    bool operator<(const DPtrType& ptr) const\n    {\n        return m_addr < ptr.GetAddr();\n    }\n    bool operator>(const DPtrType& ptr) const\n    {\n        return m_addr > ptr.GetAddr();\n    }\n    bool operator<=(const DPtrType& ptr) const\n    {\n        return m_addr <= ptr.GetAddr();\n    }\n    bool operator>=(const DPtrType& ptr) const\n    {\n        return m_addr >= ptr.GetAddr();\n    }\n\n    // Array index operator\n    // we want an operator[] for all possible numeric types (rather than rely on\n    // implicit numeric conversions on the argument) to prevent ambiguity with\n    // DPtr's implicit conversion to type* and the built-in operator[].\n    // @dbgtodo : we could also use this technique to simplify other operators below.\n    template<typename indexType>\n    type& operator[](indexType index)\n    {\n        // Compute the address of the element.\n        TADDR elementAddr;\n        if( index >= 0 )\n        {\n            elementAddr = DacTAddrOffset(m_addr, index, sizeof(type));\n        }\n        else\n        {\n            // Don't bother trying to do overflow checking for negative indexes - they are rare compared to\n            // positive ones.  ClrSafeInt doesn't support signed datatypes yet (although we should be able to add it\n            // pretty easily).\n            elementAddr = m_addr + index * sizeof(type);\n        }\n\n        // Marshal over a single instance and return a reference to it.\n        return *(type*) DacInstantiateTypeByAddress(elementAddr, sizeof(type), true);\n    }\n\n    template<typename indexType>\n    type const & operator[](indexType index) const\n    {\n        return (*const_cast<__DPtrBase*>(this))[index];\n    }\n\n    //-------------------------------------------------------------------------\n    // operator+\n\n    DPtrType operator+(unsigned short val)\n    {\n        return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));\n    }\n#if defined(HOST_UNIX) && defined(HOST_64BIT)\n    DPtrType operator+(unsigned long long val)\n    {\n        return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));\n    }\n#endif // HOST_UNIX && HOST_BIT64\n    DPtrType operator+(short val)\n    {\n        return DPtrType(m_addr + val * sizeof(type));\n    }\n    // size_t is unsigned int on Win32, so we need\n    // to ifdef here to make sure the unsigned int\n    // and size_t overloads don't collide.  size_t\n    // is marked __w64 so a simple unsigned int\n    // will not work on Win32, it has to be size_t.\n    DPtrType operator+(size_t val)\n    {\n        return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));\n    }\n#if defined (HOST_64BIT)\n    DPtrType operator+(unsigned int val)\n    {\n        return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));\n    }\n#endif\n    DPtrType operator+(int val)\n    {\n        return DPtrType(m_addr + val * sizeof(type));\n    }\n    // Because of the size difference between long and int on non MS compilers,\n    // we only need to define these operators on Windows. These provide compatible\n    // overloads for DWORD addition operations.\n#ifdef _MSC_VER\n    DPtrType operator+(unsigned long val)\n    {\n        return DPtrType(DacTAddrOffset(m_addr, val, sizeof(type)));\n    }\n    DPtrType operator+(long val)\n    {\n        return DPtrType(m_addr + val * sizeof(type));\n    }\n#endif\n\n    //-------------------------------------------------------------------------\n    // operator-\n\n    DPtrType operator-(unsigned short val)\n    {\n        return DPtrType(m_addr - val * sizeof(type));\n    }\n    DPtrType operator-(short val)\n    {\n        return DPtrType(m_addr - val * sizeof(type));\n    }\n    // size_t is unsigned int on Win32, so we need\n    // to ifdef here to make sure the unsigned int\n    // and size_t overloads don't collide.  size_t\n    // is marked __w64 so a simple unsigned int\n    // will not work on Win32, it has to be size_t.\n    DPtrType operator-(size_t val)\n    {\n        return DPtrType(m_addr - val * sizeof(type));\n    }\n#ifdef HOST_64BIT\n    DPtrType operator-(unsigned int val)\n    {\n        return DPtrType(m_addr - val * sizeof(type));\n    }\n#endif\n    DPtrType operator-(int val)\n    {\n        return DPtrType(m_addr - val * sizeof(type));\n    }\n    // Because of the size difference between long and int on non MS compilers,\n    // we only need to define these operators on Windows. These provide compatible\n    // overloads for DWORD addition operations.\n#ifdef _MSC_VER // for now, everything else is 32 bit\n    DPtrType operator-(unsigned long val)\n    {\n        return DPtrType(m_addr - val * sizeof(type));\n    }\n    DPtrType operator-(long val)\n    {\n        return DPtrType(m_addr - val * sizeof(type));\n    }\n#endif\n    size_t operator-(const DPtrType& val)\n    {\n        return (m_addr - val.m_addr) / sizeof(type);\n    }\n\n    //-------------------------------------------------------------------------\n\n    DPtrType& operator+=(size_t val)\n    {\n        m_addr += val * sizeof(type);\n        return static_cast<DPtrType&>(*this);\n    }\n    DPtrType& operator-=(size_t val)\n    {\n        m_addr -= val * sizeof(type);\n        return static_cast<DPtrType&>(*this);\n    }\n\n    DPtrType& operator++()\n    {\n        m_addr += sizeof(type);\n        return static_cast<DPtrType&>(*this);\n    }\n    DPtrType& operator--()\n    {\n        m_addr -= sizeof(type);\n        return static_cast<DPtrType&>(*this);\n    }\n    DPtrType operator++(int postfix)\n    {\n        DPtrType orig = DPtrType(*this);\n        m_addr += sizeof(type);\n        return orig;\n    }\n    DPtrType operator--(int postfix)\n    {\n        DPtrType orig = DPtrType(*this);\n        m_addr -= sizeof(type);\n        return orig;\n    }\n\n    bool IsValid(void) const\n    {\n        return m_addr &&\n            DacInstantiateTypeByAddress(m_addr, sizeof(type),\n                                        false) != NULL;\n    }\n    void EnumMem(void) const\n    {\n        DacEnumMemoryRegion(m_addr, sizeof(type));\n    }\n};\n\n// forward declaration\ntemplate<typename acc_type, typename store_type>\nclass __GlobalPtr;\n\n// Pointer wrapper for objects which are just plain data\n// and need no special handling.\ntemplate<typename type>\nclass __DPtr : public __DPtrBase<type,__DPtr<type> >\n{\npublic:\n    // constructors - all chain to __DPtrBase constructors\n    __DPtr< type >(void) : __DPtrBase<type,__DPtr<type> >() {}\n    __DPtr< type >(TADDR addr) : __DPtrBase<type,__DPtr<type> >(addr) {}\n\n    // construct const from non-const\n    typedef typename std::remove_const<type>::type mutable_type;\n    __DPtr< type >(__DPtr<mutable_type> const & rhs) : __DPtrBase<type,__DPtr<type> >(rhs.GetAddr()) {}\n\n    // construct from GlobalPtr\n    explicit __DPtr< type >(__GlobalPtr< type*, __DPtr< type > > globalPtr) :\n        __DPtrBase<type,__DPtr<type> >(globalPtr.GetAddr()) {}\n\n    explicit __DPtr< type >(__TPtrBase addr) : __DPtrBase<type,__DPtr<type> >(addr) {}\n    explicit __DPtr< type >(type const * host) : __DPtrBase<type,__DPtr<type> >(host) {}\n\n    operator type*() const\n    {\n        return (type*)DacInstantiateTypeByAddress(this->m_addr, sizeof(type), true);\n    }\n    type* operator->() const\n    {\n        return (type*)DacInstantiateTypeByAddress(this->m_addr, sizeof(type), true);\n    }\n};\n\n#define DPTR(type) __DPtr< type >\n\n// A restricted form of DPtr that doesn't have any conversions to pointer types.\n// This is useful for pointer types that almost always represent arrays, as opposed\n// to pointers to single instances (eg. PTR_BYTE).  In these cases, allowing implicit\n// conversions to (for eg.) BYTE* would usually result in incorrect usage (eg. pointer\n// arithmetic and array indexing), since only a single instance has been marshalled to the host.\n// If you really must marshal a single instance (eg. converting T* to PTR_T is too painful for now),\n// then use code:DacUnsafeMarshalSingleElement so we can identify such unsafe code.\ntemplate<typename type>\nclass __ArrayDPtr : public __DPtrBase<type,__ArrayDPtr<type> >\n{\npublic:\n    // constructors - all chain to __DPtrBase constructors\n    __ArrayDPtr< type >(void) : __DPtrBase<type,__ArrayDPtr<type> >() {}\n    __ArrayDPtr< type >(TADDR addr) : __DPtrBase<type,__ArrayDPtr<type> >(addr) {}\n\n    // construct const from non-const\n    typedef typename std::remove_const<type>::type mutable_type;\n    __ArrayDPtr< type >(__ArrayDPtr<mutable_type> const & rhs) : __DPtrBase<type,__ArrayDPtr<type> >(rhs.GetAddr()) {}\n\n    explicit __ArrayDPtr< type >(__TPtrBase addr) : __DPtrBase<type,__ArrayDPtr<type> >(addr) {}\n\n    // Note that there is also no explicit constructor from host instances (type*).\n    // Going this direction is less problematic, but often still represents risky coding.\n};\n\n#define ArrayDPTR(type) __ArrayDPtr< type >\n\n\n// Pointer wrapper for objects which are just plain data\n// but whose size is not the same as the base type size.\n// This can be used for prefetching data for arrays or\n// for cases where an object has a variable size.\ntemplate<typename type>\nclass __SPtr : public __TPtrBase\n{\npublic:\n    typedef type _Type;\n    typedef type* _Ptr;\n\n    __SPtr< type >(void) : __TPtrBase() {}\n    __SPtr< type >(TADDR addr) : __TPtrBase(addr) {}\n    explicit __SPtr< type >(__TPtrBase addr)\n    {\n        m_addr = addr.GetAddr();\n    }\n    explicit __SPtr< type >(type* host)\n    {\n        m_addr = DacGetTargetAddrForHostAddr(host, true);\n    }\n\n    __SPtr< type >& operator=(const __TPtrBase& ptr)\n    {\n        m_addr = ptr.GetAddr();\n        return *this;\n    }\n    __SPtr< type >& operator=(TADDR addr)\n    {\n        m_addr = addr;\n        return *this;\n    }\n\n    operator type*() const\n    {\n        if (m_addr)\n        {\n            return (type*)DacInstantiateTypeByAddress(m_addr,\n                                                      type::DacSize(m_addr),\n                                                      true);\n        }\n        else\n        {\n            return (type*)NULL;\n        }\n    }\n    type* operator->() const\n    {\n        if (m_addr)\n        {\n            return (type*)DacInstantiateTypeByAddress(m_addr,\n                                                      type::DacSize(m_addr),\n                                                      true);\n        }\n        else\n        {\n            return (type*)NULL;\n        }\n    }\n    type& operator*(void) const\n    {\n        if (!m_addr)\n        {\n            DacError(E_INVALIDARG);\n        }\n\n        return *(type*)DacInstantiateTypeByAddress(m_addr,\n                                                   type::DacSize(m_addr),\n                                                   true);\n    }\n\n    bool IsValid(void) const\n    {\n        return m_addr &&\n            DacInstantiateTypeByAddress(m_addr, type::DacSize(m_addr),\n                                        false) != NULL;\n    }\n    void EnumMem(void) const\n    {\n        if (m_addr)\n        {\n            DacEnumMemoryRegion(m_addr, type::DacSize(m_addr));\n        }\n    }\n};\n\n#define SPTR(type) __SPtr< type >\n\n// Pointer wrapper for objects which have a single leading\n// vtable, such as objects in a single-inheritance tree.\n// The base class of all such trees must have use\n// VPTR_BASE_VTABLE_CLASS in their declaration and all\n// instantiable members of the tree must be listed in vptr_list.h.\ntemplate<class type>\nclass __VPtr : public __TPtrBase\n{\npublic:\n    // VPtr::_Type has to be a pointer as\n    // often the type is an abstract class.\n    // This type is not expected to be used anyway.\n    typedef type* _Type;\n    typedef type* _Ptr;\n\n    __VPtr< type >(void) : __TPtrBase() {}\n    __VPtr< type >(TADDR addr) : __TPtrBase(addr) {}\n    explicit __VPtr< type >(__TPtrBase addr)\n    {\n        m_addr = addr.GetAddr();\n    }\n    explicit __VPtr< type >(type* host)\n    {\n        m_addr = DacGetTargetAddrForHostAddr(host, true);\n    }\n\n    __VPtr< type >& operator=(const __TPtrBase& ptr)\n    {\n        m_addr = ptr.GetAddr();\n        return *this;\n    }\n    __VPtr< type >& operator=(TADDR addr)\n    {\n        m_addr = addr;\n        return *this;\n    }\n\n    operator type*() const\n    {\n        return (type*)DacInstantiateClassByVTable(m_addr, sizeof(type), true);\n    }\n    type* operator->() const\n    {\n        return (type*)DacInstantiateClassByVTable(m_addr, sizeof(type), true);\n    }\n\n    bool operator==(const __VPtr< type >& ptr) const\n    {\n        return m_addr == ptr.m_addr;\n    }\n    bool operator==(TADDR addr) const\n    {\n        return m_addr == addr;\n    }\n    bool operator!=(const __VPtr< type >& ptr) const\n    {\n        return !operator==(ptr);\n    }\n    bool operator!=(TADDR addr) const\n    {\n        return m_addr != addr;\n    }\n\n    bool IsValid(void) const\n    {\n        return m_addr &&\n            DacInstantiateClassByVTable(m_addr, sizeof(type), false) != NULL;\n    }\n    void EnumMem(void) const\n    {\n        if (IsValid())\n        {\n            DacEnumMemoryRegion(m_addr, (operator->())->VPtrSize());\n        }\n    }\n};\n\n#define VPTR(type) __VPtr< type >\n\n// Pointer wrapper for 8-bit strings.\ntemplate<typename type, ULONG32 maxChars = 32760>\nclass __Str8Ptr : public __DPtr<char>\n{\npublic:\n    typedef type _Type;\n    typedef type* _Ptr;\n\n    __Str8Ptr< type, maxChars >(void) : __DPtr<char>() {}\n    __Str8Ptr< type, maxChars >(TADDR addr) : __DPtr<char>(addr) {}\n    explicit __Str8Ptr< type, maxChars >(__TPtrBase addr)\n    {\n        m_addr = addr.GetAddr();\n    }\n    explicit __Str8Ptr< type, maxChars >(type* host)\n    {\n        m_addr = DacGetTargetAddrForHostAddr(host, true);\n    }\n\n    __Str8Ptr< type, maxChars >& operator=(const __TPtrBase& ptr)\n    {\n        m_addr = ptr.GetAddr();\n        return *this;\n    }\n    __Str8Ptr< type, maxChars >& operator=(TADDR addr)\n    {\n        m_addr = addr;\n        return *this;\n    }\n\n    operator type*() const\n    {\n        return (type*)DacInstantiateStringA(m_addr, maxChars, true);\n    }\n\n    bool IsValid(void) const\n    {\n        return m_addr &&\n            DacInstantiateStringA(m_addr, maxChars, false) != NULL;\n    }\n    void EnumMem(void) const\n    {\n        char* str = DacInstantiateStringA(m_addr, maxChars, false);\n        if (str)\n        {\n            DacEnumMemoryRegion(m_addr, strlen(str) + 1);\n        }\n    }\n};\n\n#define S8PTR(type) __Str8Ptr< type >\n#define S8PTRMAX(type, maxChars) __Str8Ptr< type, maxChars >\n\n// Pointer wrapper for 16-bit strings.\ntemplate<typename type, ULONG32 maxChars = 32760>\nclass __Str16Ptr : public __DPtr<WCHAR>\n{\npublic:\n    typedef type _Type;\n    typedef type* _Ptr;\n\n    __Str16Ptr< type, maxChars >(void) : __DPtr<WCHAR>() {}\n    __Str16Ptr< type, maxChars >(TADDR addr) : __DPtr<WCHAR>(addr) {}\n    explicit __Str16Ptr< type, maxChars >(__TPtrBase addr)\n    {\n        m_addr = addr.GetAddr();\n    }\n    explicit __Str16Ptr< type, maxChars >(type* host)\n    {\n        m_addr = DacGetTargetAddrForHostAddr(host, true);\n    }\n\n    __Str16Ptr< type, maxChars >& operator=(const __TPtrBase& ptr)\n    {\n        m_addr = ptr.GetAddr();\n        return *this;\n    }\n    __Str16Ptr< type, maxChars >& operator=(TADDR addr)\n    {\n        m_addr = addr;\n        return *this;\n    }\n\n    operator type*() const\n    {\n        return (type*)DacInstantiateStringW(m_addr, maxChars, true);\n    }\n\n    bool IsValid(void) const\n    {\n        return m_addr &&\n            DacInstantiateStringW(m_addr, maxChars, false) != NULL;\n    }\n    void EnumMem(void) const\n    {\n        char* str = DacInstantiateStringW(m_addr, maxChars, false);\n        if (str)\n        {\n            DacEnumMemoryRegion(m_addr, strlen(str) + 1);\n        }\n    }\n};\n\n#define S16PTR(type) __Str16Ptr< type >\n#define S16PTRMAX(type, maxChars) __Str16Ptr< type, maxChars >\n\ntemplate<typename type>\nclass __GlobalVal\n{\npublic:\n    __GlobalVal< type >(TADDR DacGlobals::* ptr)\n    {\n        m_ptr = ptr;\n    }\n\n    operator type() const\n    {\n        return (type)*__DPtr< type >(DacGlobalValues()->*m_ptr);\n    }\n\n    __DPtr< type > operator&() const\n    {\n        return __DPtr< type >(DacGlobalValues()->*m_ptr);\n    }\n\n    // @dbgtodo  dac support: This updates values in the host.  This seems extremely dangerous\n    // to do silently.  I'd prefer that a specific (searchable) write function\n    // was used.  Try disabling this and see what fails...\n    __GlobalVal<type> & operator=(const type & val)\n    {\n        type* ptr = __DPtr< type >(DacGlobalValues()->*m_ptr);\n        // Update the host copy;\n        *ptr = val;\n        // Write back to the target.\n        DacWriteHostInstance(ptr, true);\n        return *this;\n    }\n\n    bool IsValid(void) const\n    {\n        return __DPtr< type >(DacGlobalValues()->*m_ptr).IsValid();\n    }\n    void EnumMem(void) const\n    {\n        TADDR p = DacGlobalValues()->*m_ptr;\n        __DPtr< type >(p).EnumMem();\n    }\n\nprivate:\n    TADDR DacGlobals::* m_ptr;\n};\n\ntemplate<typename type, size_t size>\nclass __GlobalArray\n{\npublic:\n    __GlobalArray< type, size >(TADDR DacGlobals::* ptr)\n    {\n        m_ptr = ptr;\n    }\n\n    __DPtr< type > operator&() const\n    {\n        return __DPtr< type >(DacGlobalValues()->*m_ptr);\n    }\n\n    type& operator[](unsigned int index) const\n    {\n        return __DPtr< type >(DacGlobalValues()->*m_ptr)[index];\n    }\n\n    bool IsValid(void) const\n    {\n        // Only validates the base pointer, not the full array range.\n        return __DPtr< type >(DacGlobalValues()->*m_ptr).IsValid();\n    }\n    void EnumMem(void) const\n    {\n        DacEnumMemoryRegion(DacGlobalValues()->*m_ptr, sizeof(type) * size);\n    }\n\nprivate:\n    TADDR DacGlobals::* m_ptr;\n};\n\ntemplate<typename acc_type, typename store_type>\nclass __GlobalPtr\n{\npublic:\n    __GlobalPtr< acc_type, store_type >(TADDR DacGlobals::* ptr)\n    {\n        m_ptr = ptr;\n    }\n\n    __DPtr< store_type > operator&() const\n    {\n        return __DPtr< store_type >(DacGlobalValues()->*m_ptr);\n    }\n\n    store_type & operator=(store_type & val)\n    {\n        store_type* ptr = __DPtr< store_type >(DacGlobalValues()->*m_ptr);\n        // Update the host copy;\n        *ptr = val;\n        // Write back to the target.\n        DacWriteHostInstance(ptr, true);\n        return val;\n    }\n\n    acc_type operator->() const\n    {\n        return (acc_type)*__DPtr< store_type >(DacGlobalValues()->*m_ptr);\n    }\n    operator acc_type() const\n    {\n        return (acc_type)*__DPtr< store_type >(DacGlobalValues()->*m_ptr);\n    }\n    operator store_type() const\n    {\n        return *__DPtr< store_type >(DacGlobalValues()->*m_ptr);\n    }\n    bool operator!() const\n    {\n        return !*__DPtr< store_type >(DacGlobalValues()->*m_ptr);\n    }\n\n    typename store_type::_Type& operator[](int index)\n    {\n        return (*__DPtr< store_type >(DacGlobalValues()->*m_ptr))[index];\n    }\n\n    typename store_type::_Type& operator[](unsigned int index)\n    {\n        return (*__DPtr< store_type >(DacGlobalValues()->*m_ptr))[index];\n    }\n\n    TADDR GetAddr() const\n    {\n        return (*__DPtr< store_type >(DacGlobalValues()->*m_ptr)).GetAddr();\n    }\n\n    TADDR GetAddrRaw () const\n    {\n        return DacGlobalValues()->*m_ptr;\n    }\n\n    // This is only testing the pointer memory is available but does not verify\n    // the memory that it points to.\n    //\n    bool IsValidPtr(void) const\n    {\n        return __DPtr< store_type >(DacGlobalValues()->*m_ptr).IsValid();\n    }\n\n    bool IsValid(void) const\n    {\n        return __DPtr< store_type >(DacGlobalValues()->*m_ptr).IsValid() &&\n            (*__DPtr< store_type >(DacGlobalValues()->*m_ptr)).IsValid();\n    }\n    void EnumMem(void) const\n    {\n        __DPtr< store_type > ptr(DacGlobalValues()->*m_ptr);\n        ptr.EnumMem();\n        if (ptr.IsValid())\n        {\n            (*ptr).EnumMem();\n        }\n    }\n\n    TADDR DacGlobals::* m_ptr;\n};\n\ntemplate<typename acc_type, typename store_type>\ninline bool operator==(const __GlobalPtr<acc_type, store_type>& gptr,\n                       acc_type host)\n{\n    return DacGetTargetAddrForHostAddr(host, true) ==\n        *__DPtr< TADDR >(DacGlobalValues()->*gptr.m_ptr);\n}\ntemplate<typename acc_type, typename store_type>\ninline bool operator!=(const __GlobalPtr<acc_type, store_type>& gptr,\n                       acc_type host)\n{\n    return !operator==(gptr, host);\n}\n\ntemplate<typename acc_type, typename store_type>\ninline bool operator==(acc_type host,\n                       const __GlobalPtr<acc_type, store_type>& gptr)\n{\n    return DacGetTargetAddrForHostAddr(host, true) ==\n        *__DPtr< TADDR >(DacGlobalValues()->*gptr.m_ptr);\n}\ntemplate<typename acc_type, typename store_type>\ninline bool operator!=(acc_type host,\n                       const __GlobalPtr<acc_type, store_type>& gptr)\n{\n    return !operator==(host, gptr);\n}\n\n\n//\n// __VoidPtr is a type that behaves like void* but for target pointers.\n// Behavior of PTR_VOID:\n// * has void* semantics. Will compile to void* in non-DAC builds (just like\n//     other PTR types. Unlike TADDR, we want pointer semantics.\n// * NOT assignable from host pointer types or convertible to host pointer\n//     types - ensures we can't confuse host and target pointers (we'll get\n//     compiler errors if we try and cast between them).\n// * like void*, no pointer arithmetic or dereferencing is allowed\n// * like TADDR, can be used to construct any __DPtr / __VPtr instance\n// * representation is the same as a void* (for marshalling / casting)\n//\n// One way in which __VoidPtr is unlike void* is that it can't be cast to\n// pointer or integer types. On the one hand, this is a good thing as it forces\n// us to keep target pointers separate from other data types. On the other hand\n// in practice this means we have to use dac_cast<TADDR> in places where we used\n// to use a (TADDR) cast. Unfortunately C++ provides us no way to allow the\n// explicit cast to primitive types without also allowing implicit conversions.\n//\n// This is very similar in spirit to TADDR. The primary difference is that\n// PTR_VOID has pointer semantics, where TADDR has integer semantics. When\n// dacizing uses of void* to TADDR, casts must be inserted everywhere back to\n// pointer types. If we switch a use of TADDR to PTR_VOID, those casts in\n// DACCESS_COMPILE regions no longer compile (see above). Also, TADDR supports\n// pointer arithmetic, but that might not be necessary (could use PTR_BYTE\n// instead etc.). Ideally we'd probably have just one type for this purpose\n// (named TADDR but with the semantics of PTR_VOID), but outright conversion\n// would require too much work.\n//\nclass __VoidPtr : public __TPtrBase\n{\npublic:\n    __VoidPtr(void) : __TPtrBase() {}\n    __VoidPtr(TADDR addr) : __TPtrBase(addr) {}\n\n    // Note, unlike __DPtr, this ctor form is not explicit.  We allow implicit\n    // conversions from any pointer type (just like for void*).\n    __VoidPtr(__TPtrBase addr)\n    {\n        m_addr = addr.GetAddr();\n    }\n\n    // Like TPtrBase, VoidPtrs can also be created impicitly from all GlobalPtrs\n    template<typename acc_type, typename store_type>\n    __VoidPtr(__GlobalPtr<acc_type, store_type> globalPtr)\n    {\n        m_addr = globalPtr.GetAddr();\n    }\n\n    // Note, unlike __DPtr, there is no explicit conversion from host pointer\n    // types.  Since void* cannot be marshalled, there is no such thing as\n    // a void* DAC instance in the host.\n\n    // Also, we don't want an implicit conversion to TADDR because then the\n    // compiler will allow pointer arithmetic (which it wouldn't allow for\n    // void*).  Instead, callers can use dac_cast<TADDR> if they want.\n\n    // Note, unlike __DPtr, any pointer type can be assigned to a __VoidPtr\n    // This is to mirror the assignability of any pointer type to a void*\n    __VoidPtr& operator=(const __TPtrBase& ptr)\n    {\n        m_addr = ptr.GetAddr();\n        return *this;\n    }\n    __VoidPtr& operator=(TADDR addr)\n    {\n        m_addr = addr;\n        return *this;\n    }\n\n    // note, no marshalling operators (type* conversion, operator ->, operator*)\n    // A void* can't be marshalled because we don't know how much to copy\n\n    // PTR_Void can be compared to any other pointer type (because conceptually,\n    // any other pointer type should be implicitly convertible to void*)\n    bool operator==(const __TPtrBase& ptr) const\n    {\n        return m_addr == ptr.GetAddr();\n    }\n    bool operator==(TADDR addr) const\n    {\n        return m_addr == addr;\n    }\n    bool operator!=(const __TPtrBase& ptr) const\n    {\n        return !operator==(ptr);\n    }\n    bool operator!=(TADDR addr) const\n    {\n        return m_addr != addr;\n    }\n    bool operator<(const __TPtrBase& ptr) const\n    {\n        return m_addr < ptr.GetAddr();\n    }\n    bool operator>(const __TPtrBase& ptr) const\n    {\n        return m_addr > ptr.GetAddr();\n    }\n    bool operator<=(const __TPtrBase& ptr) const\n    {\n        return m_addr <= ptr.GetAddr();\n    }\n    bool operator>=(const __TPtrBase& ptr) const\n    {\n        return m_addr >= ptr.GetAddr();\n    }\n};\n\ntypedef __VoidPtr PTR_VOID;\ntypedef DPTR(PTR_VOID) PTR_PTR_VOID;\n\n// For now we treat pointers to const and non-const void the same in DAC\n// builds. In general, DAC is read-only anyway and so there isn't a danger of\n// writing to these pointers. Also, the non-dac builds will ensure\n// const-correctness. However, if we wanted to support true void* / const void*\n// behavior, we could probably build the follow functionality by templating\n// __VoidPtr:\n//  * A PTR_VOID would be implicitly convertible to PTR_CVOID\n//  * An explicit coercion (ideally const_cast) would be required to convert a\n//      PTR_CVOID to a PTR_VOID\n//  * Similarily, an explicit coercion would be required to convert a cost PTR\n//      type (eg. PTR_CBYTE) to a PTR_VOID.\ntypedef __VoidPtr PTR_CVOID;\n\n\n// The special empty ctor declared here allows the whole\n// class hierarchy to be instantiated easily by the\n// external access code.  The actual class body will be\n// read externally so no members should be initialized.\n\n//\n// VPTR_ANY_CLASS_METHODS - Defines the following methods for all VPTR classes\n//\n// VPtrSize\n//     Returns the size of the dynamic type of the object (as opposed to sizeof\n//     which is based only on the static type).\n//\n// VPtrHostVTable\n//     Returns the address of the vtable for this type.\n//     We create a temporary instance of this type in order to read it's vtable pointer\n//     (at offset 0).  For this temporary instance, we do not want to initialize any fields,\n//     so we use the marshalling ctor.  Since we didn't initialize any fields, we also don't\n//     wan't to run the dtor (marshaled data structures don't normally expect their destructor\n//     or non-DAC constructors to be called in DAC builds anyway).  So, rather than create a\n//     normal stack object, or put the object on the heap, we create the temporary object\n//     on the stack using placement-new and alloca, and don't destruct it.\n//\n#define VPTR_ANY_CLASS_METHODS(name)                            \\\n        virtual ULONG32 VPtrSize(void) { SUPPORTS_DAC; return sizeof(name); } \\\n        static PVOID VPtrHostVTable() {                         \\\n            void * pBuf = _alloca(sizeof(name));                \\\n            name * dummy = new (pBuf) name((TADDR)0, (TADDR)0); \\\n            return *((PVOID*)dummy); }\n\n#define VPTR_CLASS_METHODS(name)                                \\\n        VPTR_ANY_CLASS_METHODS(name)                            \\\n        static TADDR VPtrTargetVTable() {                       \\\n            SUPPORTS_DAC;                                       \\\n            return DacGlobalValues()->name##__vtAddr; }\n\n#define VPTR_VTABLE_CLASS(name, base)                           \\\npublic: name(TADDR addr, TADDR vtAddr) : base(addr, vtAddr) {}  \\\n        VPTR_CLASS_METHODS(name)\n\n#define VPTR_VTABLE_CLASS_AND_CTOR(name, base)                  \\\n        VPTR_VTABLE_CLASS(name, base)\n\n// Used for base classes that can be instantiated directly.\n// The fake vfn is still used to force a vtable even when\n// all the normal vfns are ifdef'ed out.\n#define VPTR_BASE_CONCRETE_VTABLE_CLASS(name)                   \\\npublic: name(TADDR addr, TADDR vtAddr) {}                       \\\n        VPTR_CLASS_METHODS(name)\n\n#define VPTR_BASE_CONCRETE_VTABLE_CLASS_NO_CTOR_BODY(name)      \\\npublic: name(TADDR addr, TADDR vtAddr);                         \\\n        VPTR_CLASS_METHODS(name)\n\n// The pure virtual method forces all derivations to use\n// VPTR_VTABLE_CLASS to compile.\n#define VPTR_BASE_VTABLE_CLASS(name)                            \\\npublic: name(TADDR addr, TADDR vtAddr) {}                       \\\n        virtual ULONG32 VPtrSize(void) = 0;\n\n#define VPTR_BASE_VTABLE_CLASS_AND_CTOR(name)                   \\\n        VPTR_BASE_VTABLE_CLASS(name)\n\n#define VPTR_BASE_VTABLE_CLASS_NO_CTOR_BODY(name)               \\\npublic: name(TADDR addr, TADDR vtAddr);                         \\\n        virtual ULONG32 VPtrSize(void) = 0;\n\n#define VPTR_ABSTRACT_VTABLE_CLASS(name, base)                  \\\npublic: name(TADDR addr, TADDR vtAddr) : base(addr, vtAddr) {}\n\n#define VPTR_ABSTRACT_VTABLE_CLASS_AND_CTOR(name, base) \\\n        VPTR_ABSTRACT_VTABLE_CLASS(name, base)\n\n#define VPTR_ABSTRACT_VTABLE_CLASS_NO_CTOR_BODY(name, base)     \\\npublic: name(TADDR addr, TADDR vtAddr);\n\n// helper macro to make the vtables unique for DAC\n#define VPTR_UNIQUE(unique)\n\n// Safe access for retrieving the target address of a PTR.\n#define PTR_TO_TADDR(ptr) ((ptr).GetAddr())\n\n#define GFN_TADDR(name) (DacGlobalValues()->fn__ ## name)\n\n#define GVAL_ADDR(g) \\\n    ((g).operator&())\n\n//\n// References to class static and global data.\n// These all need to be redirected through the global\n// data table.\n//\n\n#define _SPTR_DECL(acc_type, store_type, var) \\\n    static __GlobalPtr< acc_type, store_type > var\n#define _SPTR_IMPL(acc_type, store_type, cls, var) \\\n    __GlobalPtr< acc_type, store_type > cls::var(&DacGlobals::cls##__##var)\n#define _SPTR_IMPL_INIT(acc_type, store_type, cls, var, init) \\\n    __GlobalPtr< acc_type, store_type > cls::var(&DacGlobals::cls##__##var)\n#define _SPTR_IMPL_NS(acc_type, store_type, ns, cls, var) \\\n    __GlobalPtr< acc_type, store_type > cls::var(&DacGlobals::ns##__##cls##__##var)\n#define _SPTR_IMPL_NS_INIT(acc_type, store_type, ns, cls, var, init) \\\n    __GlobalPtr< acc_type, store_type > cls::var(&DacGlobals::ns##__##cls##__##var)\n\n#define VOLATILE_SPTR_DECL(type, var) SPTR_DECL(type, var)\n#define VOLATILE_SPTR_IMPL(type, cls, var) SPTR_IMPL(type, cls, var)\n#define VOLATILE_SPTR_IMPL_INIT(type, cls, var, init) SPTR_IMPL_INIT(type, cls, var, init)\n\n#define _GPTR_DECL(acc_type, store_type, var) \\\n    extern __GlobalPtr< acc_type, store_type > var\n#define _GPTR_IMPL(acc_type, store_type, var) \\\n    __GlobalPtr< acc_type, store_type > var(&DacGlobals::dac__##var)\n#define _GPTR_IMPL_INIT(acc_type, store_type, var, init) \\\n    __GlobalPtr< acc_type, store_type > var(&DacGlobals::dac__##var)\n\n#define SVAL_DECL(type, var) \\\n    static __GlobalVal< type > var\n#define SVAL_IMPL(type, cls, var) \\\n    __GlobalVal< type > cls::var(&DacGlobals::cls##__##var)\n#define SVAL_IMPL_INIT(type, cls, var, init) \\\n    __GlobalVal< type > cls::var(&DacGlobals::cls##__##var)\n#define SVAL_IMPL_NS(type, ns, cls, var) \\\n    __GlobalVal< type > cls::var(&DacGlobals::ns##__##cls##__##var)\n#define SVAL_IMPL_NS_INIT(type, ns, cls, var, init) \\\n    __GlobalVal< type > cls::var(&DacGlobals::ns##__##cls##__##var)\n\n#define VOLATILE_SVAL_DECL(type, var) SVAL_DECL(type, var)\n#define VOLATILE_SVAL_IMPL(type, cls, var) SVAL_IMPL(type, cls, var)\n#define VOLATILE_SVAL_IMPL_INIT(type, cls, var, init) SVAL_IMPL_INIT(type, cls, var, init)\n\n#define GVAL_DECL(type, var) \\\n    extern __GlobalVal< type > var\n#define GVAL_IMPL(type, var) \\\n    __GlobalVal< type > var(&DacGlobals::dac__##var)\n#define GVAL_IMPL_INIT(type, var, init) \\\n    __GlobalVal< type > var(&DacGlobals::dac__##var)\n\n#define GARY_DECL(type, var, size) \\\n    extern __GlobalArray< type, size > var\n#define GARY_IMPL(type, var, size) \\\n    __GlobalArray< type, size > var(&DacGlobals::dac__##var)\n\n// Translation from a host pointer back to the target address\n// that was used to retrieve the data for the host pointer.\n#define PTR_HOST_TO_TADDR(host) DacGetTargetAddrForHostAddr(host, true)\n// Translation from a host interior pointer back to the corresponding\n// target address. The host address must reside within a previously\n// retrieved instance.\n#define PTR_HOST_INT_TO_TADDR(host) DacGetTargetAddrForHostInteriorAddr(host, true)\n// Translation from a host vtable pointer to a target vtable pointer.\n#define VPTR_HOST_VTABLE_TO_TADDR(host) DacGetTargetVtForHostVt(host, true)\n\n// Construct a pointer to a member of the given type.\n#define PTR_HOST_MEMBER_TADDR(type, host, memb) \\\n    (PTR_HOST_TO_TADDR(host) + (TADDR)offsetof(type, memb))\n\n// Construct a pointer to a member of the given type given an interior\n// host address.\n#define PTR_HOST_INT_MEMBER_TADDR(type, host, memb) \\\n    (PTR_HOST_INT_TO_TADDR(host) + (TADDR)offsetof(type, memb))\n\n#define PTR_TO_MEMBER_TADDR(type, ptr, memb) \\\n    (PTR_TO_TADDR(ptr) + (TADDR)offsetof(type, memb))\n\n// Constructs an arbitrary data instance for a piece of\n// memory in the target.\n#define PTR_READ(addr, size) \\\n    DacInstantiateTypeByAddress(addr, size, true)\n\n// This value is used to intiailize target pointers to NULL.  We want this to be TADDR type\n// (as opposed to, say, __TPtrBase) so that it can be used in the non-explicit ctor overloads,\n// eg. as an argument default value.\n// We can't always just use NULL because that's 0 which (in C++) can be any integer or pointer\n// type (causing an ambiguous overload compiler error when used in explicit ctor forms).\n#define PTR_NULL ((TADDR)0)\n\n// Provides an empty method implementation when compiled\n// for DACCESS_COMPILE.  For example, use to stub out methods needed\n// for vtable entries but otherwise unused.\n// Note that these functions are explicitly NOT marked SUPPORTS_DAC so that we'll get a\n// DacCop warning if any calls to them are detected.\n// @dbgtodo : It's probably almost always wrong to call any such function, so\n// we should probably throw a better error (DacNotImpl), and ideally mark the function\n// DECLSPEC_NORETURN so we don't have to deal with fabricating return values and we can\n// get compiler warnings (unreachable code) anytime functions marked this way are called.\n#define DAC_EMPTY() { LIMITED_METHOD_CONTRACT; }\n#define DAC_EMPTY_ERR() { LIMITED_METHOD_CONTRACT; DacError(E_UNEXPECTED); }\n#define DAC_EMPTY_RET(retVal) { LIMITED_METHOD_CONTRACT; DacError(E_UNEXPECTED); return retVal; }\n#define DAC_UNEXPECTED() { LIMITED_METHOD_CONTRACT; DacError_NoRet(E_UNEXPECTED); }\n\n#endif // #ifdef __cplusplus\n\n// Implementation details for dac_cast, should never be accessed directly.\n// See code:dac_cast for details and discussion.\nnamespace dac_imp\n{\n    // Helper functions to get the target address of specific types\n    inline TADDR getTaddr(TADDR addr) { return addr; }\n    inline TADDR getTaddr(__TPtrBase const &tptr) { return PTR_TO_TADDR(tptr); }\n    inline TADDR getTaddr(void const * host) { return PTR_HOST_TO_TADDR((void *)host); }\n    template<typename acc_type, typename store_type>\n    inline TADDR getTaddr(__GlobalPtr<acc_type, store_type> const &gptr) { return PTR_TO_TADDR(gptr); }\n\n    // It is an error to try dac_cast on a __GlobalVal or a __GlobalArray. Declare\n    // but do not define the methods so that a compile-time error results.\n    template<typename type>\n    TADDR getTaddr(__GlobalVal<type> const &gval);\n    template<typename type, size_t size>\n    TADDR getTaddr(__GlobalArray<type, size> const &garr);\n\n    // Helper class to instantiate DAC instances from a TADDR\n    // The default implementation assumes we want to create an instance of a PTR type\n    template<typename T> struct makeDacInst\n    {\n        static inline T fromTaddr(TADDR addr)\n        {\n            static_assert((std::is_base_of<__TPtrBase, T>::value), \"is_base_of constraint violation\");\n            return T(addr);\n        }\n    };\n\n    // Partial specialization for creating TADDRs\n    // This is the only other way to create a DAC type instance other than PTR types (above)\n    template<> struct makeDacInst<TADDR>\n    {\n        static inline TADDR fromTaddr(TADDR addr) { return addr; }\n    };\n} // namespace dac_imp\n\n\n// DacCop in-line exclusion mechanism\n\n// Warnings - official home is DacCop\\Shared\\Warnings.cs, but we want a way for users to indicate\n// warning codes in a way that is descriptive to readers (not just code numbers).  The names here\n// don't matter - DacCop just looks at the value\nenum DacCopWarningCode\n{\n    // General Rules\n    FieldAccess = 1,\n    PointerArith = 2,\n    PointerComparison = 3,\n    InconsistentMarshalling = 4,\n    CastBetweenAddressSpaces = 5,\n    CastOfMarshalledType = 6,\n    VirtualCallToNonVPtr = 7,\n    UndacizedGlobalVariable = 8,\n\n    // Function graph related\n    CallUnknown = 701,\n    CallNonDac = 702,\n    CallVirtualUnknown = 704,\n    CallVirtualNonDac = 705,\n};\n\n// DACCOP_IGNORE is a mechanism to suppress DacCop violations from within the source-code.\n// See the DacCop wiki for guidance on how best to use this: http://mswikis/clr/dev/Pages/DacCop.aspx\n//\n// DACCOP_IGNORE will suppress a DacCop violation for the following (non-compound) statement.\n// For example:\n//      // The \"dual-mode DAC problem\" occurs in a few places where a class is used both\n//      // in the host, and marshalled from the target ... <further details>\n//      DACCOP_IGNORE(CastBetweenAddressSpaces,\"SBuffer has the dual-mode DAC problem\");\n//      TADDR bufAddr = (TADDR)m_buffer;\n//\n// A call to DACCOP_IGNORE must occur as it's own statement, and can apply only to following\n// single-statements (not to compound statement blocks).  Occasionally it is necessary to hoist\n// violation-inducing code out to its own statement (e.g., if it occurs in the conditional of an\n// if).\n//\n// Arguments:\n//   code: a literal value from DacCopWarningCode indicating which violation should be suppressed.\n//   szReasonString: a short description of why this exclusion is necessary.  This is intended just\n//        to help readers of the code understand the source of the problem, and what would be required\n//        to fix it.  More details can be provided in comments if desired.\n//\ninline void DACCOP_IGNORE(DacCopWarningCode code, const char * szReasonString)\n{\n    // DacCop detects calls to this function.  No implementation is necessary.\n}\n\n#else // #ifdef DACCESS_COMPILE\n\n//\n// This version of the macros turns into normal pointers\n// for unmodified in-proc compilation.\n\n// *******************************************************\n// !!!!!!!!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!\n//\n// Please search this file for the type name to find the\n// DAC versions of these definitions\n//\n// !!!!!!!!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!\n// *******************************************************\n\n\n// Declare TADDR as a non-pointer type so that arithmetic\n// can be done on it directly, as with the DACCESS_COMPILE definition.\n// This also helps expose pointer usage that may need to be changed.\ntypedef ULONG_PTR TADDR;\n\ntypedef void* PTR_VOID;\ntypedef LPVOID* PTR_PTR_VOID;\ntypedef const void* PTR_CVOID;\n\n#define DPTR(type) type*\n#define ArrayDPTR(type) type*\n#define SPTR(type) type*\n#define VPTR(type) type*\n#define S8PTR(type) type*\n#define S8PTRMAX(type, maxChars) type*\n#define S16PTR(type) type*\n#define S16PTRMAX(type, maxChars) type*\n\n#if defined(TARGET_UNIX)\n\n#define VPTR_VTABLE_CLASS(name, base) \\\n        friend struct _DacGlobals; \\\npublic: name(int dummy) : base(dummy) {}\n\n#define VPTR_VTABLE_CLASS_AND_CTOR(name, base) \\\n        VPTR_VTABLE_CLASS(name, base) \\\n        name() : base() {}\n\n#define VPTR_BASE_CONCRETE_VTABLE_CLASS(name) \\\n        friend struct _DacGlobals; \\\npublic: name(int dummy) {}\n\n#define VPTR_BASE_VTABLE_CLASS(name) \\\n        friend struct _DacGlobals; \\\npublic: name(int dummy) {}\n\n#define VPTR_BASE_VTABLE_CLASS_AND_CTOR(name) \\\n        VPTR_BASE_VTABLE_CLASS(name) \\\n        name() {}\n\n#define VPTR_ABSTRACT_VTABLE_CLASS(name, base) \\\n        friend struct _DacGlobals; \\\npublic: name(int dummy) : base(dummy) {}\n\n#define VPTR_ABSTRACT_VTABLE_CLASS_AND_CTOR(name, base) \\\n        VPTR_ABSTRACT_VTABLE_CLASS(name, base) \\\n        name() : base() {}\n\n#else // TARGET_UNIX\n\n#define VPTR_VTABLE_CLASS(name, base) friend struct _DacGlobals;\n#define VPTR_VTABLE_CLASS_AND_CTOR(name, base)\n#define VPTR_BASE_CONCRETE_VTABLE_CLASS(name) friend struct _DacGlobals;\n#define VPTR_BASE_VTABLE_CLASS(name) friend struct _DacGlobals;\n#define VPTR_BASE_VTABLE_CLASS_AND_CTOR(name)\n#define VPTR_ABSTRACT_VTABLE_CLASS(name, base) friend struct _DacGlobals;\n#define VPTR_ABSTRACT_VTABLE_CLASS_AND_CTOR(name, base)\n\n#endif // TARGET_UNIX\n\n// helper macro to make the vtables unique for DAC\n#define VPTR_UNIQUE(unique) virtual int MakeVTableUniqueForDAC() { return unique; }\n#define VPTR_UNIQUE_BaseDomain                          (100000)\n#define VPTR_UNIQUE_SystemDomain                        (VPTR_UNIQUE_BaseDomain + 1)\n#define VPTR_UNIQUE_ComMethodFrame                      (VPTR_UNIQUE_SystemDomain + 1)\n#define VPTR_UNIQUE_RedirectedThreadFrame               (VPTR_UNIQUE_ComMethodFrame + 1)\n#define VPTR_UNIQUE_HijackFrame                         (VPTR_UNIQUE_RedirectedThreadFrame + 1)\n\n#define PTR_TO_TADDR(ptr) ((TADDR)(ptr))\n#define GFN_TADDR(name) ((TADDR)(name))\n\n#define GVAL_ADDR(g) (&(g))\n#define _SPTR_DECL(acc_type, store_type, var) \\\n    static store_type var\n#define _SPTR_IMPL(acc_type, store_type, cls, var) \\\n    store_type cls::var\n#define _SPTR_IMPL_INIT(acc_type, store_type, cls, var, init) \\\n    store_type cls::var = init\n#define _SPTR_IMPL_NS(acc_type, store_type, ns, cls, var) \\\n    store_type cls::var\n#define _SPTR_IMPL_NS_INIT(acc_type, store_type, ns, cls, var, init) \\\n    store_type cls::var = init\n#define VOLATILE_SPTR_DECL(type, var) _SPTR_DECL(type*, Volatile<PTR_##type>, var)\n#define VOLATILE_SPTR_IMPL(type, cls, var) _SPTR_IMPL(type*, Volatile<PTR_##type>, cls, var)\n#define VOLATILE_SPTR_IMPL_INIT(type, cls, var, init) _SPTR_IMPL_INIT(type*, Volatile<PTR_##type>, cls, var, init)\n#define _GPTR_DECL(acc_type, store_type, var) \\\n    extern store_type var\n#define _GPTR_IMPL(acc_type, store_type, var) \\\n    store_type var\n#define _GPTR_IMPL_INIT(acc_type, store_type, var, init) \\\n    store_type var = init\n#define SVAL_DECL(type, var) \\\n    static type var\n#define SVAL_IMPL(type, cls, var) \\\n    type cls::var\n#define SVAL_IMPL_INIT(type, cls, var, init) \\\n    type cls::var = init\n#define VOLATILE_SVAL_DECL(type, var) \\\n    static Volatile<type> var\n#define VOLATILE_SVAL_IMPL(type, cls, var) \\\n    Volatile<type> cls::var\n#define VOLATILE_SVAL_IMPL_INIT(type, cls, var, init) \\\n    Volatile<type> cls::var = init\n#define SVAL_IMPL_NS(type, ns, cls, var) \\\n    type cls::var\n#define SVAL_IMPL_NS_INIT(type, ns, cls, var, init) \\\n    type cls::var = init\n#define GVAL_DECL(type, var) \\\n    extern type var\n#define GVAL_IMPL(type, var) \\\n    type var\n#define GVAL_IMPL_INIT(type, var, init) \\\n    type var = init\n#define GARY_DECL(type, var, size) \\\n    extern type var[size]\n#define GARY_IMPL(type, var, size) \\\n    type var[size]\n#define PTR_HOST_TO_TADDR(host) ((TADDR)(host))\n#define PTR_HOST_INT_TO_TADDR(host) ((TADDR)(host))\n#define VPTR_HOST_VTABLE_TO_TADDR(host) ((TADDR)(host))\n#define PTR_HOST_MEMBER_TADDR(type, host, memb) ((TADDR)&(host)->memb)\n#define PTR_HOST_INT_MEMBER_TADDR(type, host, memb) ((TADDR)&(host)->memb)\n#define PTR_TO_MEMBER_TADDR(type, ptr, memb) ((TADDR)&((ptr)->memb))\n#define PTR_READ(addr, size) ((PVOID)(addr))\n\n#define PTR_NULL NULL\n\n#define DAC_EMPTY()\n#define DAC_EMPTY_ERR()\n#define DAC_EMPTY_RET(retVal)\n#define DAC_UNEXPECTED()\n\n#define DACCOP_IGNORE(warningCode, reasonString)\n\n#endif // #ifdef DACCESS_COMPILE\n\n//----------------------------------------------------------------------------\n// dac_cast\n// Casting utility, to be used for casting one class pointer type to another.\n// Use as you would use static_cast\n//\n// dac_cast is designed to act just as static_cast does when\n// dealing with pointers and their DAC abstractions. Specifically,\n// it handles these coversions:\n//\n//      dac_cast<TargetType>(SourceTypeVal)\n//\n// where TargetType <- SourceTypeVal are\n//\n//      ?PTR(Tgt) <- TADDR     - Create PTR type (DPtr etc.) from TADDR\n//      ?PTR(Tgt) <- ?PTR(Src) - Convert one PTR type to another\n//      ?PTR(Tgt) <- Src *     - Create PTR type from dac host object instance\n//      TADDR <- ?PTR(Src)     - Get TADDR of PTR object (DPtr etc.)\n//      TADDR <- Src *         - Get TADDR of dac host object instance\n//\n// Note that there is no direct conversion to other host-pointer types (because we don't\n// know if you want a DPTR or VPTR etc.).  However, due to the implicit DAC conversions,\n// you can just use dac_cast<PTR_Foo> and assign that to a Foo*.\n//\n// The beauty of this syntax is that it is consistent regardless\n// of source and target casting types. You just use dac_cast\n// and the partial template specialization will do the right thing.\n//\n// One important thing to realise is that all \"Foo *\" types are\n// assumed to be pointers to host instances that were marshalled by DAC.  This should\n// fail at runtime if it's not the case.\n//\n// Some examples would be:\n//\n//   - Host pointer of one type to a related host pointer of another\n//     type, i.e., MethodDesc * <-> InstantiatedMethodDesc *\n//     Syntax: with MethodDesc *pMD, InstantiatedMethodDesc *pInstMD\n//             pInstMd = dac_cast<PTR_InstantiatedMethodDesc>(pMD)\n//             pMD = dac_cast<PTR_MethodDesc>(pInstMD)\n//\n//   - (D|V)PTR of one encapsulated pointer type to a (D|V)PTR of\n//     another type, i.e., PTR_AppDomain <-> PTR_BaseDomain\n//     Syntax: with PTR_AppDomain pAD, PTR_BaseDomain pBD\n//             dac_cast<PTR_AppDomain>(pBD)\n//             dac_cast<PTR_BaseDomain>(pAD)\n//\n// Example comparisons of some old and new syntax, where\n//    h is a host pointer, such as \"Foo *h;\"\n//    p is a DPTR, such as \"PTR_Foo p;\"\n//\n//      PTR_HOST_TO_TADDR(h)           ==> dac_cast<TADDR>(h)\n//      PTR_TO_TADDR(p)                ==> dac_cast<TADDR>(p)\n//      PTR_Foo(PTR_HOST_TO_TADDR(h))  ==> dac_cast<PTR_Foo>(h)\n//\n//----------------------------------------------------------------------------\ntemplate <typename Tgt, typename Src>\ninline Tgt dac_cast(Src src)\n{\n#ifdef DACCESS_COMPILE\n    // In DAC builds, first get a TADDR for the source, then create the\n    // appropriate destination instance.\n    TADDR addr = dac_imp::getTaddr(src);\n    return dac_imp::makeDacInst<Tgt>::fromTaddr(addr);\n#else\n    // In non-DAC builds, dac_cast is the same as a C-style cast because we need to support:\n    //  - casting away const\n    //  - conversions between pointers and TADDR\n    // Perhaps we should more precisely restrict it's usage, but we get the precise\n    // restrictions in DAC builds, so it wouldn't buy us much.\n    return (Tgt)(src);\n#endif\n}\n\n//----------------------------------------------------------------------------\n//\n// Convenience macros which work for either mode.\n//\n//----------------------------------------------------------------------------\n\n#define SPTR_DECL(type, var) _SPTR_DECL(type*, PTR_##type, var)\n#define SPTR_IMPL(type, cls, var) _SPTR_IMPL(type*, PTR_##type, cls, var)\n#define SPTR_IMPL_INIT(type, cls, var, init) _SPTR_IMPL_INIT(type*, PTR_##type, cls, var, init)\n#define SPTR_IMPL_NS(type, ns, cls, var) _SPTR_IMPL_NS(type*, PTR_##type, ns, cls, var)\n#define SPTR_IMPL_NS_INIT(type, ns, cls, var, init) _SPTR_IMPL_NS_INIT(type*, PTR_##type, ns, cls, var, init)\n#define GPTR_DECL(type, var) _GPTR_DECL(type*, PTR_##type, var)\n#define GPTR_IMPL(type, var) _GPTR_IMPL(type*, PTR_##type, var)\n#define GPTR_IMPL_INIT(type, var, init) _GPTR_IMPL_INIT(type*, PTR_##type, var, init)\n\n\n// If you want to marshal a single instance of an ArrayDPtr over to the host and\n// return a pointer to it, you can use this function.  However, this is unsafe because\n// users of value may assume they can do pointer arithmetic on it.  This is exactly\n// the bugs ArrayDPtr is designed to prevent.  See code:__ArrayDPtr for details.\ntemplate<typename type>\ninline type* DacUnsafeMarshalSingleElement( ArrayDPTR(type) arrayPtr )\n{\n    return (DPTR(type))(arrayPtr);\n}\n\n//----------------------------------------------------------------------------\n//\n// Forward typedefs for system types.  This is a convenient place\n// to declare things for system types, plus it gives us a central\n// place to look at when deciding what types may cause issues for\n// cross-platform compilation.\n//\n//----------------------------------------------------------------------------\n\ntypedef ArrayDPTR(BYTE)    PTR_BYTE;\ntypedef ArrayDPTR(uint8_t) PTR_uint8_t;\ntypedef DPTR(PTR_BYTE) PTR_PTR_BYTE;\ntypedef DPTR(PTR_uint8_t) PTR_PTR_uint8_t;\ntypedef DPTR(PTR_PTR_BYTE) PTR_PTR_PTR_BYTE;\ntypedef ArrayDPTR(signed char) PTR_SBYTE;\ntypedef ArrayDPTR(const BYTE) PTR_CBYTE;\ntypedef DPTR(INT8)    PTR_INT8;\ntypedef DPTR(INT16)   PTR_INT16;\ntypedef DPTR(UINT16)  PTR_UINT16;\ntypedef DPTR(WORD)    PTR_WORD;\ntypedef DPTR(USHORT)  PTR_USHORT;\ntypedef DPTR(DWORD)   PTR_DWORD;\ntypedef DPTR(uint32_t) PTR_uint32_t;\ntypedef DPTR(LONG)    PTR_LONG;\ntypedef DPTR(ULONG)   PTR_ULONG;\ntypedef DPTR(INT32)   PTR_INT32;\ntypedef DPTR(UINT32)  PTR_UINT32;\ntypedef DPTR(ULONG64) PTR_ULONG64;\ntypedef DPTR(INT64)   PTR_INT64;\ntypedef DPTR(UINT64)  PTR_UINT64;\ntypedef DPTR(SIZE_T)  PTR_SIZE_T;\ntypedef DPTR(size_t)  PTR_size_t;\ntypedef DPTR(TADDR)   PTR_TADDR;\ntypedef DPTR(int)     PTR_int;\ntypedef DPTR(BOOL)    PTR_BOOL;\ntypedef DPTR(unsigned) PTR_unsigned;\n\ntypedef S8PTR(char)           PTR_STR;\ntypedef S8PTR(const char)     PTR_CSTR;\ntypedef S8PTR(char)           PTR_UTF8;\ntypedef S8PTR(const char)     PTR_CUTF8;\ntypedef S16PTR(WCHAR)         PTR_WSTR;\ntypedef S16PTR(const WCHAR)   PTR_CWSTR;\n\ntypedef DPTR(T_CONTEXT)                  PTR_CONTEXT;\ntypedef DPTR(PTR_CONTEXT)                PTR_PTR_CONTEXT;\ntypedef DPTR(struct _EXCEPTION_POINTERS) PTR_EXCEPTION_POINTERS;\ntypedef DPTR(struct _EXCEPTION_RECORD)   PTR_EXCEPTION_RECORD;\n\ntypedef DPTR(struct _EXCEPTION_REGISTRATION_RECORD) PTR_EXCEPTION_REGISTRATION_RECORD;\n\ntypedef DPTR(struct IMAGE_COR_VTABLEFIXUP) PTR_IMAGE_COR_VTABLEFIXUP;\ntypedef DPTR(IMAGE_DATA_DIRECTORY)  PTR_IMAGE_DATA_DIRECTORY;\ntypedef DPTR(IMAGE_DEBUG_DIRECTORY)  PTR_IMAGE_DEBUG_DIRECTORY;\ntypedef DPTR(IMAGE_DOS_HEADER)      PTR_IMAGE_DOS_HEADER;\ntypedef DPTR(IMAGE_NT_HEADERS)      PTR_IMAGE_NT_HEADERS;\ntypedef DPTR(IMAGE_NT_HEADERS32)    PTR_IMAGE_NT_HEADERS32;\ntypedef DPTR(IMAGE_NT_HEADERS64)    PTR_IMAGE_NT_HEADERS64;\ntypedef DPTR(IMAGE_SECTION_HEADER)  PTR_IMAGE_SECTION_HEADER;\ntypedef DPTR(IMAGE_EXPORT_DIRECTORY)  PTR_IMAGE_EXPORT_DIRECTORY;\ntypedef DPTR(IMAGE_TLS_DIRECTORY)   PTR_IMAGE_TLS_DIRECTORY;\n\n#if defined(DACCESS_COMPILE)\n#include <corhdr.h>\n#include <clrdata.h>\n#include <xclrdata.h>\n#endif\n\n#if defined(TARGET_X86) && defined(TARGET_UNIX)\ntypedef DPTR(struct _UNWIND_INFO)      PTR_UNWIND_INFO;\n#endif\n\n#ifdef TARGET_64BIT\ntypedef DPTR(T_RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;\ntypedef DPTR(struct _UNWIND_INFO)      PTR_UNWIND_INFO;\n#if defined(TARGET_AMD64)\ntypedef DPTR(union _UNWIND_CODE)       PTR_UNWIND_CODE;\n#endif // TARGET_AMD64\n#endif // TARGET_64BIT\n\n#ifdef TARGET_ARM\ntypedef DPTR(T_RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;\n#endif\n\n//----------------------------------------------------------------------------\n//\n// A PCODE is a valid PC/IP value -- a pointer to an instruction, possibly including some processor mode bits.\n// (On ARM, for example, a PCODE value should have the low-order THUMB_CODE bit set if the code should\n// be executed in that mode.)\n//\ntypedef TADDR PCODE;\ntypedef DPTR(PCODE) PTR_PCODE;\ntypedef DPTR(PTR_PCODE) PTR_PTR_PCODE;\n\n// There is another concept we should have, \"pointer to the start of an instruction\" -- a PCODE with any mode bits masked off.\n// Attempts to introduce this concept, and classify uses of PCODE as one or the other,\n// turned out to be too hard: either name choice required *many* code changes, and decisions in unfamiliar code.  So despite the\n// the comment above, the PCODE is currently sometimes used for the PINSTR concept.\n\n// See PCODEToPINSTR in utilcode.h for conversion from PCODE to PINSTR.\n\n//----------------------------------------------------------------------------\n//\n// The access code compile must compile data structures that exactly\n// match the real structures for access to work.  The access code\n// doesn't want all of the debugging validation code, though, so\n// distinguish between _DEBUG, for declaring general debugging data\n// and always-on debug code, and _DEBUG_IMPL, for debugging code\n// which will be disabled when compiling for external access.\n//\n//----------------------------------------------------------------------------\n\n#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define _DEBUG_IMPL 1\n#endif\n\n// Helper macro for tracking EnumMemoryRegions progress.\n#if 0\n#define EMEM_OUT(args) DacLogMessage args\n#else\n#define EMEM_OUT(args)\n#endif\n\n// Macros like MAIN_CLR_MODULE_NAME* for the DAC module\n#define MAIN_DAC_MODULE_NAME_W  W(\"mscordaccore\")\n#define MAIN_DAC_MODULE_DLL_NAME_W  W(\"mscordaccore.dll\")\n\n// TARGET_CONSISTENCY_CHECK represents a condition that should not fail unless the DAC target is corrupt.\n// This is in contrast to ASSERTs in DAC infrastructure code which shouldn't fail regardless of the memory\n// read from the target.  At the moment we treat these the same, but in the future we will want a mechanism\n// for disabling just the target consistency checks (eg. for tests that intentionally use corrupted targets).\n// @dbgtodo : Separating asserts and target consistency checks is tracked by DevDiv Bugs 31674\n#define TARGET_CONSISTENCY_CHECK(expr,msg) _ASSERTE_MSG(expr,msg)\n\n// For cross compilation, controlling type layout is important\n// We add a simple macro here which defines DAC_ALIGNAS to the C++11 alignas operator\n// This helps force the alignment of the next member\n// For most cross compilation cases the layout of types simply works\n// There are a few cases (where this macro is helpful) which are not consistent across platforms:\n// - Base class whose size is padded to its align size.  On Linux the gcc/clang\n//   layouts will reuse this padding in the derived class for the first member\n// - Class with an vtable pointer and an alignment greater than the pointer size.\n//   The Windows compilers will align the first member to the alignment size of the\n//   class.  Linux will align the first member to its natural alignment\n#define DAC_ALIGNAS(a) alignas(a)\n\n#endif // #ifndef __daccess_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/dacprivate.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n//\n// Internal data access functionality.\n//\n//*****************************************************************************\n\n#ifndef _DACPRIVATE_H_\n#define _DACPRIVATE_H_\n\n#include <cor.h>\n#include <clrdata.h>\n#include <xclrdata.h>\n#include <sospriv.h>\n\n#ifndef TARGET_UNIX\n// It is unfortunate having to include this header just to get the definition of GenericModeBlock\n#include <msodw.h>\n#endif // TARGET_UNIX\n\n//\n// Whenever a structure is marshalled between different platforms, we need to ensure the\n// layout is the same in both cases.  We tell GCC to use the MSVC-style packing with\n// the following attribute.  The main thing this appears to control is whether\n// 8-byte values are aligned at 4-bytes (GCC default) or 8-bytes (MSVC default).\n// This attribute affects only the immediate struct it is applied to, you must also apply\n// it to any nested structs if you want their layout affected as well.  You also must\n// apply this to unions embedded in other structures, since it can influence the starting\n// alignment.\n//\n// Note that there doesn't appear to be any disadvantage to applying this a little\n// more agressively than necessary, so we generally use it on all classes / structures\n// defined in a file that defines marshalled data types (eg. DacDbiStructures.h)\n// The -mms-bitfields compiler option also does this for the whole file, but we don't\n// want to go changing the layout of, for example, structures defined in OS header files\n// so we explicitly opt-in with this attribute.\n//\n#if defined(__GNUC__) && defined(HOST_X86)\n#define MSLAYOUT __attribute__((__ms_struct__))\n#else\n#define MSLAYOUT\n#endif\n\n#include <livedatatarget.h>\n\n//----------------------------------------------------------------------------\n//\n// Internal CLRData requests.\n//\n//----------------------------------------------------------------------------\n\n\n// Private requests for DataModules\nenum\n{\n    DACDATAMODULEPRIV_REQUEST_GET_MODULEPTR = 0xf0000000,\n    DACDATAMODULEPRIV_REQUEST_GET_MODULEDATA = 0xf0000001\n};\n\n\n// Private requests for stack walkers.\nenum\n{\n    DACSTACKPRIV_REQUEST_FRAME_DATA = 0xf0000000\n};\n\nenum DacpObjectType { OBJ_STRING=0,OBJ_FREE,OBJ_OBJECT,OBJ_ARRAY,OBJ_OTHER };\nstruct MSLAYOUT DacpObjectData\n{\n    CLRDATA_ADDRESS MethodTable = 0;\n    DacpObjectType ObjectType = DacpObjectType::OBJ_STRING;\n    ULONG64 Size = 0;\n    CLRDATA_ADDRESS ElementTypeHandle = 0;\n    CorElementType ElementType = CorElementType::ELEMENT_TYPE_END;\n    DWORD dwRank = 0;\n    ULONG64 dwNumComponents = 0;\n    ULONG64 dwComponentSize = 0;\n    CLRDATA_ADDRESS ArrayDataPtr = 0;\n    CLRDATA_ADDRESS ArrayBoundsPtr = 0;\n    CLRDATA_ADDRESS ArrayLowerBoundsPtr = 0;\n\n    CLRDATA_ADDRESS RCW = 0;\n    CLRDATA_ADDRESS CCW = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetObjectData(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpExceptionObjectData\n{\n    CLRDATA_ADDRESS   Message = 0;\n    CLRDATA_ADDRESS   InnerException = 0;\n    CLRDATA_ADDRESS   StackTrace = 0;\n    CLRDATA_ADDRESS   WatsonBuckets = 0;\n    CLRDATA_ADDRESS   StackTraceString = 0;\n    CLRDATA_ADDRESS   RemoteStackTraceString = 0;\n    INT32             HResult = 0;\n    INT32             XCode = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        HRESULT hr;\n        ISOSDacInterface2 *psos2 = NULL;\n        if (SUCCEEDED(hr = sos->QueryInterface(__uuidof(ISOSDacInterface2), (void**) &psos2)))\n        {\n            hr = psos2->GetObjectExceptionData(addr, this);\n            psos2->Release();\n        }\n        return hr;\n    }\n};\n\nstruct MSLAYOUT DacpUsefulGlobalsData\n{\n    CLRDATA_ADDRESS ArrayMethodTable = 0;\n    CLRDATA_ADDRESS StringMethodTable = 0;\n    CLRDATA_ADDRESS ObjectMethodTable = 0;\n    CLRDATA_ADDRESS ExceptionMethodTable = 0;\n    CLRDATA_ADDRESS FreeMethodTable = 0;\n};\n\nstruct MSLAYOUT DacpFieldDescData\n{\n    CorElementType Type = CorElementType::ELEMENT_TYPE_END;\n    CorElementType sigType = CorElementType::ELEMENT_TYPE_END;     // ELEMENT_TYPE_XXX from signature. We need this to disply pretty name for String in minidump's case\n    CLRDATA_ADDRESS MTOfType = 0; // NULL if Type is not loaded\n\n    CLRDATA_ADDRESS ModuleOfType = 0;\n    mdTypeDef TokenOfType = 0;\n\n    mdFieldDef mb = 0;\n    CLRDATA_ADDRESS MTOfEnclosingClass = 0;\n    DWORD dwOffset = 0;\n    BOOL bIsThreadLocal = FALSE;\n    BOOL bIsContextLocal = FALSE;\n    BOOL bIsStatic = FALSE;\n    CLRDATA_ADDRESS NextField = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetFieldDescData(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpMethodTableFieldData\n{\n    WORD wNumInstanceFields = 0;\n    WORD wNumStaticFields = 0;\n    WORD wNumThreadStaticFields = 0;\n\n    CLRDATA_ADDRESS FirstField = 0; // If non-null, you can retrieve more\n\n    WORD wContextStaticOffset = 0;\n    WORD wContextStaticsSize = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetMethodTableFieldData(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpMethodTableCollectibleData\n{\n    CLRDATA_ADDRESS LoaderAllocatorObjectHandle = 0;\n    BOOL bCollectible = FALSE;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        HRESULT hr;\n        ISOSDacInterface6 *pSOS6 = NULL;\n        if (SUCCEEDED(hr = sos->QueryInterface(__uuidof(ISOSDacInterface6), (void**)&pSOS6)))\n        {\n            hr = pSOS6->GetMethodTableCollectibleData(addr, this);\n            pSOS6->Release();\n        }\n\n        return hr;\n    }\n};\n\nstruct MSLAYOUT DacpMethodTableTransparencyData\n{\n    BOOL bHasCriticalTransparentInfo = FALSE;\n    BOOL bIsCritical = FALSE;\n    BOOL bIsTreatAsSafe = FALSE;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetMethodTableTransparencyData(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpDomainLocalModuleData\n{\n    // These two parameters are used as input params when calling the\n    // no-argument form of Request below.\n    CLRDATA_ADDRESS appDomainAddr = 0;\n    ULONG64  ModuleID = 0;\n\n    CLRDATA_ADDRESS pClassData = 0;\n    CLRDATA_ADDRESS pDynamicClassTable = 0;\n    CLRDATA_ADDRESS pGCStaticDataStart = 0;\n    CLRDATA_ADDRESS pNonGCStaticDataStart = 0;\n\n    // Called when you have a pointer to the DomainLocalModule\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetDomainLocalModuleData(addr, this);\n    }\n};\n\n\nstruct MSLAYOUT DacpThreadLocalModuleData\n{\n    // These two parameters are used as input params when calling the\n    // no-argument form of Request below.\n    CLRDATA_ADDRESS threadAddr = 0;\n    ULONG64 ModuleIndex = 0;\n\n    CLRDATA_ADDRESS pClassData = 0;\n    CLRDATA_ADDRESS pDynamicClassTable = 0;\n    CLRDATA_ADDRESS pGCStaticDataStart = 0;\n    CLRDATA_ADDRESS pNonGCStaticDataStart = 0;\n};\n\n\nstruct MSLAYOUT DacpModuleData\n{\n    CLRDATA_ADDRESS Address = 0;\n    CLRDATA_ADDRESS PEAssembly = 0; // A PEAssembly addr\n    CLRDATA_ADDRESS ilBase = 0;\n    CLRDATA_ADDRESS metadataStart = 0;\n    ULONG64 metadataSize = 0;\n    CLRDATA_ADDRESS Assembly = 0; // Assembly pointer\n    BOOL bIsReflection = FALSE;\n    BOOL bIsPEFile = FALSE;\n    ULONG64 dwBaseClassIndex = 0;\n    ULONG64 dwModuleID = 0;\n\n    DWORD dwTransientFlags = 0;\n\n    CLRDATA_ADDRESS TypeDefToMethodTableMap = 0;\n    CLRDATA_ADDRESS TypeRefToMethodTableMap = 0;\n    CLRDATA_ADDRESS MethodDefToDescMap = 0;\n    CLRDATA_ADDRESS FieldDefToDescMap = 0;\n    CLRDATA_ADDRESS MemberRefToDescMap = 0;\n    CLRDATA_ADDRESS FileReferencesMap = 0;\n    CLRDATA_ADDRESS ManifestModuleReferencesMap = 0;\n\n    CLRDATA_ADDRESS pLookupTableHeap = 0;\n    CLRDATA_ADDRESS pThunkHeap = 0;\n\n    ULONG64 dwModuleIndex = 0;\n\n    DacpModuleData()\n    {\n    }\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetModuleData(addr, this);\n    }\n\nprivate:\n    // Ensure that this data structure is not copied.\n    DacpModuleData(const DacpModuleData&);\n    void operator=(const DacpModuleData&);\n};\n\nstruct MSLAYOUT DacpMethodTableData\n{\n    BOOL bIsFree = FALSE; // everything else is NULL if this is true.\n    CLRDATA_ADDRESS Module = 0;\n    CLRDATA_ADDRESS Class = 0;\n    CLRDATA_ADDRESS ParentMethodTable = 0;\n    WORD wNumInterfaces = 0;\n    WORD wNumMethods = 0;\n    WORD wNumVtableSlots = 0;\n    WORD wNumVirtuals = 0;\n    DWORD BaseSize = 0;\n    DWORD ComponentSize = 0;\n    mdTypeDef cl = 0; // Metadata token\n    DWORD dwAttrClass = 0; // cached metadata\n    BOOL bIsShared = FALSE;  // Always false, preserved for backward compatibility\n    BOOL bIsDynamic = FALSE;\n    BOOL bContainsPointers = FALSE;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetMethodTableData(addr, this);\n    }\n};\n\n\n// Copied from util.hpp, for DacpThreadStoreData.fHostConfig below.\n#define CLRMEMORYHOSTED                             0x1\n#define CLRTASKHOSTED                               0x2\n#define CLRSYNCHOSTED                               0x4\n#define CLRTHREADPOOLHOSTED                         0x8\n#define CLRIOCOMPLETIONHOSTED                       0x10\n#define CLRASSEMBLYHOSTED                           0x20\n#define CLRGCHOSTED                                 0x40\n#define CLRSECURITYHOSTED                           0x80\n#define CLRHOSTED           0x80000000\n\nstruct MSLAYOUT DacpThreadStoreData\n{\n    LONG threadCount = 0;\n    LONG unstartedThreadCount = 0;\n    LONG backgroundThreadCount = 0;\n    LONG pendingThreadCount = 0;\n    LONG deadThreadCount = 0;\n    CLRDATA_ADDRESS firstThread = 0;\n    CLRDATA_ADDRESS finalizerThread = 0;\n    CLRDATA_ADDRESS gcThread = 0;\n    DWORD fHostConfig = 0;          // Uses hosting flags defined above\n\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        return sos->GetThreadStoreData(this);\n    }\n};\n\nstruct MSLAYOUT DacpAppDomainStoreData\n{\n    CLRDATA_ADDRESS sharedDomain = 0;\n    CLRDATA_ADDRESS systemDomain = 0;\n    LONG DomainCount = 0;\n\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        return sos->GetAppDomainStoreData(this);\n    }\n};\n\nstruct MSLAYOUT DacpCOMInterfacePointerData\n{\n    CLRDATA_ADDRESS methodTable = 0;\n    CLRDATA_ADDRESS interfacePtr = 0;\n    CLRDATA_ADDRESS comContext = 0;\n};\n\nstruct MSLAYOUT DacpRCWData\n{\n    CLRDATA_ADDRESS identityPointer = 0;\n    CLRDATA_ADDRESS unknownPointer = 0;\n    CLRDATA_ADDRESS managedObject = 0;\n    CLRDATA_ADDRESS jupiterObject = 0;\n    CLRDATA_ADDRESS vtablePtr = 0;\n    CLRDATA_ADDRESS creatorThread = 0;\n    CLRDATA_ADDRESS ctxCookie = 0;\n\n    LONG refCount = 0;\n    LONG interfaceCount = 0;\n\n    BOOL isJupiterObject = FALSE;\n    BOOL supportsIInspectable = FALSE;\n    BOOL isAggregated = FALSE;\n    BOOL isContained = FALSE;\n    BOOL isFreeThreaded = FALSE;\n    BOOL isDisconnected = FALSE;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS rcw)\n    {\n        return sos->GetRCWData(rcw, this);\n    }\n\n    HRESULT IsDCOMProxy(ISOSDacInterface *sos, CLRDATA_ADDRESS rcw, BOOL* isDCOMProxy)\n    {\n        ISOSDacInterface2 *pSOS2 = nullptr;\n        HRESULT hr = sos->QueryInterface(__uuidof(ISOSDacInterface2), reinterpret_cast<LPVOID*>(&pSOS2));\n        if (SUCCEEDED(hr))\n        {\n            hr = pSOS2->IsRCWDCOMProxy(rcw, isDCOMProxy);\n            pSOS2->Release();\n        }\n\n        return hr;\n    }\n};\n\nstruct MSLAYOUT DacpCCWData\n{\n    CLRDATA_ADDRESS outerIUnknown = 0;\n    CLRDATA_ADDRESS managedObject = 0;\n    CLRDATA_ADDRESS handle = 0;\n    CLRDATA_ADDRESS ccwAddress = 0;\n\n    LONG refCount = 0;\n    LONG interfaceCount = 0;\n    BOOL isNeutered = FALSE;\n\n    LONG jupiterRefCount = 0;\n    BOOL isPegged = FALSE;\n    BOOL isGlobalPegged = FALSE;\n    BOOL hasStrongRef = FALSE;\n    BOOL isExtendsCOMObject = FALSE;\n    BOOL isAggregated = FALSE;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS ccw)\n    {\n        return sos->GetCCWData(ccw, this);\n    }\n};\n\nenum DacpAppDomainDataStage {\n    STAGE_CREATING,\n    STAGE_READYFORMANAGEDCODE,\n    STAGE_ACTIVE,\n    STAGE_OPEN,\n    STAGE_UNLOAD_REQUESTED,\n    STAGE_EXITING,\n    STAGE_EXITED,\n    STAGE_FINALIZING,\n    STAGE_FINALIZED,\n    STAGE_HANDLETABLE_NOACCESS,\n    STAGE_CLEARED,\n    STAGE_COLLECTED,\n    STAGE_CLOSED\n};\n\n// Information about a BaseDomain (AppDomain, SharedDomain or SystemDomain).\n// For types other than AppDomain, some fields (like dwID, DomainLocalBlock, etc.) will be 0/null.\nstruct MSLAYOUT DacpAppDomainData\n{\n    // The pointer to the BaseDomain (not necessarily an AppDomain).\n    // It's useful to keep this around in the structure\n    CLRDATA_ADDRESS AppDomainPtr = 0;\n    CLRDATA_ADDRESS AppSecDesc = 0;\n    CLRDATA_ADDRESS pLowFrequencyHeap = 0;\n    CLRDATA_ADDRESS pHighFrequencyHeap = 0;\n    CLRDATA_ADDRESS pStubHeap = 0;\n    CLRDATA_ADDRESS DomainLocalBlock = 0;\n    CLRDATA_ADDRESS pDomainLocalModules = 0;\n    // The creation sequence number of this app domain (starting from 1)\n    DWORD dwId = 0;\n    LONG AssemblyCount = 0;\n    LONG FailedAssemblyCount = 0;\n    DacpAppDomainDataStage appDomainStage = DacpAppDomainDataStage::STAGE_CREATING;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetAppDomainData(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpAssemblyData\n{\n    CLRDATA_ADDRESS AssemblyPtr = 0; //useful to have\n    CLRDATA_ADDRESS ClassLoader = 0;\n    CLRDATA_ADDRESS ParentDomain = 0;\n    CLRDATA_ADDRESS BaseDomainPtr = 0;\n    CLRDATA_ADDRESS AssemblySecDesc = 0;\n    BOOL isDynamic = FALSE;\n    UINT ModuleCount = FALSE;\n    UINT LoadContext = FALSE;\n    BOOL isDomainNeutral = FALSE; // Always false, preserved for backward compatibility\n    DWORD dwLocationFlags = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr, CLRDATA_ADDRESS baseDomainPtr)\n    {\n        return sos->GetAssemblyData(baseDomainPtr, addr, this);\n    }\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return Request(sos, addr, NULL);\n    }\n};\n\n\nstruct MSLAYOUT DacpThreadData\n{\n    DWORD corThreadId = 0;\n    DWORD osThreadId = 0;\n    int state = 0;\n    ULONG preemptiveGCDisabled = 0;\n    CLRDATA_ADDRESS allocContextPtr = 0;\n    CLRDATA_ADDRESS allocContextLimit = 0;\n    CLRDATA_ADDRESS context = 0;\n    CLRDATA_ADDRESS domain = 0;\n    CLRDATA_ADDRESS pFrame = 0;\n    DWORD lockCount = 0;\n    CLRDATA_ADDRESS firstNestedException = 0; // Pass this pointer to DacpNestedExceptionInfo\n    CLRDATA_ADDRESS teb = 0;\n    CLRDATA_ADDRESS fiberData = 0;\n    CLRDATA_ADDRESS lastThrownObjectHandle = 0;\n    CLRDATA_ADDRESS nextThread = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetThreadData(addr, this);\n    }\n};\n\n\nstruct MSLAYOUT DacpReJitData\n{\n    enum Flags\n    {\n        kUnknown,\n        kRequested,\n        kActive,\n        kReverted,\n    };\n\n    CLRDATA_ADDRESS                 rejitID = 0;\n    Flags                           flags = Flags::kUnknown;\n    CLRDATA_ADDRESS                 NativeCodeAddr = 0;\n};\n\nstruct MSLAYOUT DacpReJitData2\n{\n    enum Flags\n    {\n        kUnknown,\n        kRequested,\n        kActive,\n        kReverted,\n    };\n\n    ULONG                           rejitID = 0;\n    Flags                           flags = Flags::kUnknown;\n    CLRDATA_ADDRESS                 il = 0;\n    CLRDATA_ADDRESS                 ilCodeVersionNodePtr = 0;\n};\n\nstruct MSLAYOUT DacpProfilerILData\n{\n    enum ModificationType\n    {\n        Unmodified,\n        ILModified,\n        ReJITModified,\n    };\n\n    ModificationType                type = ModificationType::Unmodified;\n    CLRDATA_ADDRESS                 il = 0;\n    ULONG                           rejitID = 0;\n};\n\nstruct MSLAYOUT DacpMethodDescData\n{\n    BOOL            bHasNativeCode = FALSE;\n    BOOL            bIsDynamic = FALSE;\n    WORD            wSlotNumber = 0;\n    CLRDATA_ADDRESS NativeCodeAddr = 0;\n    // Useful for breaking when a method is jitted.\n    CLRDATA_ADDRESS AddressOfNativeCodeSlot = 0;\n\n    CLRDATA_ADDRESS MethodDescPtr = 0;\n    CLRDATA_ADDRESS MethodTablePtr = 0;\n    CLRDATA_ADDRESS ModulePtr = 0;\n\n    mdToken                  MDToken = 0;\n    CLRDATA_ADDRESS GCInfo = 0;\n    CLRDATA_ADDRESS GCStressCodeCopy = 0;\n\n    // This is only valid if bIsDynamic is true\n    CLRDATA_ADDRESS managedDynamicMethodObject = 0;\n\n    CLRDATA_ADDRESS requestedIP = 0;\n\n    // Gives info for the single currently active version of a method\n    DacpReJitData       rejitDataCurrent = {};\n\n    // Gives info corresponding to requestedIP (for !ip2md)\n    DacpReJitData       rejitDataRequested = {};\n\n    // Total number of rejit versions that have been jitted\n    ULONG               cJittedRejitVersions = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetMethodDescData(\n            addr,\n            NULL,   // IP address\n            this,\n            0,      // cRejitData\n            NULL,   // rejitData[]\n            NULL    // pcNeededRejitData\n            );\n    }\n};\n\n\nstruct MSLAYOUT DacpMethodDescTransparencyData\n{\n    BOOL            bHasCriticalTransparentInfo = FALSE;\n    BOOL            bIsCritical = FALSE;\n    BOOL            bIsTreatAsSafe = FALSE;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetMethodDescTransparencyData(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpTieredVersionData\n{\n    enum OptimizationTier\n    {\n        OptimizationTier_Unknown,\n        OptimizationTier_MinOptJitted,\n        OptimizationTier_Optimized,\n        OptimizationTier_QuickJitted,\n        OptimizationTier_OptimizedTier1,\n        OptimizationTier_ReadyToRun,\n        OptimizationTier_OptimizedTier1OSR,\n        OptimizationTier_QuickJittedInstrumented,\n        OptimizationTier_OptimizedTier1Instrumented,\n    };\n\n    CLRDATA_ADDRESS NativeCodeAddr;\n    OptimizationTier OptimizationTier;\n    CLRDATA_ADDRESS NativeCodeVersionNodePtr;\n};\n\n// for JITType\nenum JITTypes {TYPE_UNKNOWN=0,TYPE_JIT,TYPE_PJIT};\n\nstruct MSLAYOUT DacpCodeHeaderData\n{\n    CLRDATA_ADDRESS GCInfo = 0;\n    JITTypes                   JITType = JITTypes::TYPE_UNKNOWN;\n    CLRDATA_ADDRESS MethodDescPtr = 0;\n    CLRDATA_ADDRESS MethodStart = 0;\n    DWORD                    MethodSize = 0;\n    CLRDATA_ADDRESS ColdRegionStart = 0;\n    DWORD           ColdRegionSize = 0;\n    DWORD           HotRegionSize = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS IPAddr)\n    {\n        return sos->GetCodeHeaderData(IPAddr, this);\n    }\n};\n\nstruct MSLAYOUT DacpWorkRequestData\n{\n    CLRDATA_ADDRESS Function = 0;\n    CLRDATA_ADDRESS Context = 0;\n    CLRDATA_ADDRESS NextWorkRequest = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetWorkRequestData(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpHillClimbingLogEntry\n{\n    DWORD TickCount = 0;\n    int Transition = 0;\n    int NewControlSetting = 0;\n    int LastHistoryCount = 0;\n    double LastHistoryMean = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS entry)\n    {\n        return sos->GetHillClimbingLogEntry(entry, this);\n    }\n};\n\n\n// Used for CLR versions >= 4.0\nstruct MSLAYOUT DacpThreadpoolData\n{\n    LONG cpuUtilization = 0;\n    int NumIdleWorkerThreads = 0;\n    int NumWorkingWorkerThreads = 0;\n    int NumRetiredWorkerThreads = 0;\n    LONG MinLimitTotalWorkerThreads = 0;\n    LONG MaxLimitTotalWorkerThreads = 0;\n\n    CLRDATA_ADDRESS FirstUnmanagedWorkRequest = 0;\n\n    CLRDATA_ADDRESS HillClimbingLog = 0;\n    int HillClimbingLogFirstIndex = 0;\n    int HillClimbingLogSize = 0;\n\n    DWORD NumTimers = 0;\n    // TODO: Add support to enumerate timers too.\n\n    LONG   NumCPThreads = 0;\n    LONG   NumFreeCPThreads = 0;\n    LONG   MaxFreeCPThreads = 0;\n    LONG   NumRetiredCPThreads = 0;\n    LONG   MaxLimitTotalCPThreads = 0;\n    LONG   CurrentLimitTotalCPThreads = 0;\n    LONG   MinLimitTotalCPThreads = 0;\n\n    CLRDATA_ADDRESS AsyncTimerCallbackCompletionFPtr = 0;\n\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        return sos->GetThreadpoolData(this);\n    }\n};\n\nstruct MSLAYOUT DacpGenerationData\n{\n    CLRDATA_ADDRESS start_segment = 0;\n    CLRDATA_ADDRESS allocation_start = 0;\n\n    // These are examined only for generation 0, otherwise NULL\n    CLRDATA_ADDRESS allocContextPtr = 0;\n    CLRDATA_ADDRESS allocContextLimit = 0;\n};\n\n#define DAC_NUMBERGENERATIONS 4\n\n\nstruct MSLAYOUT DacpAllocData\n{\n    CLRDATA_ADDRESS allocBytes = 0;\n    CLRDATA_ADDRESS allocBytesLoh = 0;\n};\n\nstruct MSLAYOUT DacpGenerationAllocData\n{\n    DacpAllocData allocData[DAC_NUMBERGENERATIONS] = {};\n};\n\nstruct MSLAYOUT DacpGcHeapDetails\n{\n    CLRDATA_ADDRESS heapAddr = 0; // Only filled in server mode, otherwise NULL\n    CLRDATA_ADDRESS alloc_allocated = 0;\n\n    CLRDATA_ADDRESS mark_array = 0;\n    CLRDATA_ADDRESS current_c_gc_state = 0;\n    CLRDATA_ADDRESS next_sweep_obj = 0;\n    CLRDATA_ADDRESS saved_sweep_ephemeral_seg = 0;\n    CLRDATA_ADDRESS saved_sweep_ephemeral_start = 0;\n    CLRDATA_ADDRESS background_saved_lowest_address = 0;\n    CLRDATA_ADDRESS background_saved_highest_address = 0;\n\n    DacpGenerationData generation_table [DAC_NUMBERGENERATIONS] = {};\n    CLRDATA_ADDRESS ephemeral_heap_segment = 0;\n    CLRDATA_ADDRESS finalization_fill_pointers [DAC_NUMBERGENERATIONS + 3] = {};\n    CLRDATA_ADDRESS lowest_address = 0;\n    CLRDATA_ADDRESS highest_address = 0;\n    CLRDATA_ADDRESS card_table = 0;\n\n    // Use this for workstation mode (DacpGcHeapDat.bServerMode==FALSE).\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        return sos->GetGCHeapStaticData(this);\n    }\n\n    // Use this for Server mode, as there are multiple heaps,\n    // and you need to pass a heap address in addr.\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetGCHeapDetails(addr, this);\n    }\n};\n\nstruct MSLAYOUT DacpGcHeapData\n{\n    BOOL bServerMode = FALSE;\n    BOOL bGcStructuresValid = FALSE;\n    UINT HeapCount = 0;\n    UINT g_max_generation = 0;\n\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        return sos->GetGCHeapData(this);\n    }\n};\n\nstruct MSLAYOUT DacpHeapSegmentData\n{\n    CLRDATA_ADDRESS segmentAddr = 0;\n    CLRDATA_ADDRESS allocated = 0;\n    CLRDATA_ADDRESS committed = 0;\n    CLRDATA_ADDRESS reserved = 0;\n    CLRDATA_ADDRESS used = 0;\n    CLRDATA_ADDRESS mem = 0;\n    // pass this to request if non-null to get the next segments.\n    CLRDATA_ADDRESS next = 0;\n    CLRDATA_ADDRESS gc_heap = 0; // only filled in server mode, otherwise NULL\n    // computed field: if this is the ephemeral segment highMark includes the ephemeral generation\n    CLRDATA_ADDRESS highAllocMark = 0;\n\n    size_t flags = 0;\n    CLRDATA_ADDRESS background_allocated = 0;\n\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr, const DacpGcHeapDetails& heap)\n    {\n        // clear this here to make sure we don't get stale values\n        this->highAllocMark = 0;\n\n        HRESULT hr = sos->GetHeapSegmentData(addr, this);\n\n        // if this is the start segment, and the Dac hasn't set highAllocMark, set it here.\n        if (SUCCEEDED(hr) && this->highAllocMark == 0)\n        {\n            if (this->segmentAddr == heap.ephemeral_heap_segment)\n                highAllocMark = heap.alloc_allocated;\n            else\n                highAllocMark = allocated;\n        }\n        return hr;\n    }\n};\n\nstruct MSLAYOUT DacpOomData\n{\n    int reason = 0;\n    ULONG64 alloc_size = 0;\n    ULONG64 available_pagefile_mb = 0;\n    ULONG64 gc_index = 0;\n    int fgm = 0;\n    ULONG64 size = 0;\n    BOOL loh_p = FALSE;\n\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        return sos->GetOOMStaticData(this);\n    }\n\n    // Use this for Server mode, as there are multiple heaps,\n    // and you need to pass a heap address in addr.\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetOOMData(addr, this);\n    }\n};\n\n#define   DAC_NUM_GC_DATA_POINTS 9\n#define   DAC_MAX_COMPACT_REASONS_COUNT 11\n#define   DAC_MAX_EXPAND_MECHANISMS_COUNT 6\n#define   DAC_MAX_GC_MECHANISM_BITS_COUNT 2\n#define   DAC_MAX_GLOBAL_GC_MECHANISMS_COUNT 6\nstruct MSLAYOUT DacpGCInterestingInfoData\n{\n    size_t interestingDataPoints[DAC_NUM_GC_DATA_POINTS] = {};\n    size_t compactReasons[DAC_MAX_COMPACT_REASONS_COUNT] = {};\n    size_t expandMechanisms[DAC_MAX_EXPAND_MECHANISMS_COUNT] = {};\n    size_t bitMechanisms[DAC_MAX_GC_MECHANISM_BITS_COUNT] = {};\n    size_t globalMechanisms[DAC_MAX_GLOBAL_GC_MECHANISMS_COUNT] = {};\n\n    HRESULT RequestGlobal(ISOSDacInterface *sos)\n    {\n        HRESULT hr;\n        ISOSDacInterface3 *psos3 = NULL;\n        if (SUCCEEDED(hr = sos->QueryInterface(__uuidof(ISOSDacInterface3), (void**) &psos3)))\n        {\n            hr = psos3->GetGCGlobalMechanisms(globalMechanisms);\n            psos3->Release();\n        }\n        return hr;\n    }\n\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        HRESULT hr;\n        ISOSDacInterface3 *psos3 = NULL;\n        if (SUCCEEDED(hr = sos->QueryInterface(__uuidof(ISOSDacInterface3), (void**) &psos3)))\n        {\n            hr = psos3->GetGCInterestingInfoStaticData(this);\n            psos3->Release();\n        }\n        return hr;\n    }\n\n    // Use this for Server mode, as there are multiple heaps,\n    // and you need to pass a heap address in addr.\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        HRESULT hr;\n        ISOSDacInterface3 *psos3 = NULL;\n        if (SUCCEEDED(hr = sos->QueryInterface(__uuidof(ISOSDacInterface3), (void**) &psos3)))\n        {\n            hr = psos3->GetGCInterestingInfoData(addr, this);\n            psos3->Release();\n        }\n        return hr;\n    }\n};\n\nstruct MSLAYOUT DacpGcHeapAnalyzeData\n{\n    CLRDATA_ADDRESS heapAddr = 0; // Only filled in server mode, otherwise NULL\n\n    CLRDATA_ADDRESS internal_root_array = 0;\n    ULONG64         internal_root_array_index = 0;\n    BOOL            heap_analyze_success = FALSE;\n\n    // Use this for workstation mode (DacpGcHeapDat.bServerMode==FALSE).\n    HRESULT Request(ISOSDacInterface *sos)\n    {\n        return sos->GetHeapAnalyzeStaticData(this);\n    }\n\n    // Use this for Server mode, as there are multiple heaps,\n    // and you need to pass a heap address in addr.\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS addr)\n    {\n        return sos->GetHeapAnalyzeData(addr, this);\n    }\n};\n\n\n#define SYNCBLOCKDATA_COMFLAGS_CCW 1\n#define SYNCBLOCKDATA_COMFLAGS_RCW 2\n#define SYNCBLOCKDATA_COMFLAGS_CF 4\n\nstruct MSLAYOUT DacpSyncBlockData\n{\n    CLRDATA_ADDRESS Object = 0;\n    BOOL            bFree = FALSE; // if set, no other fields are useful\n\n    // fields below provide data from this, so it's just for display\n    CLRDATA_ADDRESS SyncBlockPointer = 0;\n    DWORD           COMFlags = 0;\n    UINT            MonitorHeld = 0;\n    UINT            Recursion = 0;\n    CLRDATA_ADDRESS HoldingThread = 0;\n    UINT            AdditionalThreadCount = 0;\n    CLRDATA_ADDRESS appDomainPtr = 0;\n\n    // SyncBlockCount will always be filled in with the number of SyncBlocks.\n    // SyncBlocks may be requested from [1,SyncBlockCount]\n    UINT            SyncBlockCount = 0;\n\n    // SyncBlockNumber must be from [1,SyncBlockCount]\n    // If there are no SyncBlocks, a call to Request with SyncBlockCount = 1\n    // will return E_FAIL.\n    HRESULT Request(ISOSDacInterface *sos, UINT SyncBlockNumber)\n    {\n        return sos->GetSyncBlockData(SyncBlockNumber, this);\n    }\n};\n\nstruct MSLAYOUT DacpSyncBlockCleanupData\n{\n    CLRDATA_ADDRESS SyncBlockPointer = 0;\n\n    CLRDATA_ADDRESS nextSyncBlock = 0;\n    CLRDATA_ADDRESS blockRCW = 0;\n    CLRDATA_ADDRESS blockClassFactory = 0;\n    CLRDATA_ADDRESS blockCCW = 0;\n\n    // Pass NULL on the first request to start a traversal.\n    HRESULT Request(ISOSDacInterface *sos, CLRDATA_ADDRESS psyncBlock)\n    {\n        return sos->GetSyncBlockCleanupData(psyncBlock, this);\n    }\n};\n\n///////////////////////////////////////////////////////////////////////////\n\nenum EHClauseType {EHFault, EHFinally, EHFilter, EHTyped, EHUnknown};\n\nstruct MSLAYOUT DACEHInfo\n{\n    EHClauseType clauseType = EHClauseType::EHFault;\n    CLRDATA_ADDRESS tryStartOffset = 0;\n    CLRDATA_ADDRESS tryEndOffset = 0;\n    CLRDATA_ADDRESS handlerStartOffset = 0;\n    CLRDATA_ADDRESS handlerEndOffset = 0;\n    BOOL isDuplicateClause = FALSE;\n    CLRDATA_ADDRESS filterOffset = 0;   // valid when clauseType is EHFilter\n    BOOL isCatchAllHandler = FALSE;     // valid when clauseType is EHTyped\n    CLRDATA_ADDRESS moduleAddr = 0;     // when == 0 mtCatch contains a MethodTable, when != 0 tokCatch contains a type token\n    CLRDATA_ADDRESS mtCatch = 0;        // the method table of the TYPED clause type\n    mdToken tokCatch = 0;               // the type token of the TYPED clause type\n};\n\nstruct MSLAYOUT DacpGetModuleAddress\n{\n    CLRDATA_ADDRESS ModulePtr = 0;\n    HRESULT Request(IXCLRDataModule* pDataModule)\n    {\n        return pDataModule->Request(DACDATAMODULEPRIV_REQUEST_GET_MODULEPTR, 0, NULL, sizeof(*this), (PBYTE) this);\n    }\n};\n\nstruct MSLAYOUT DacpGetModuleData\n{\n    BOOL IsDynamic = FALSE;\n    BOOL IsInMemory = FALSE;\n    BOOL IsFileLayout = FALSE;\n    CLRDATA_ADDRESS PEAssembly = 0;\n    CLRDATA_ADDRESS LoadedPEAddress = 0;\n    ULONG64 LoadedPESize = 0;\n    CLRDATA_ADDRESS InMemoryPdbAddress = 0;\n    ULONG64 InMemoryPdbSize = 0;\n\n    HRESULT Request(IXCLRDataModule* pDataModule)\n    {\n        return pDataModule->Request(DACDATAMODULEPRIV_REQUEST_GET_MODULEDATA, 0, NULL, sizeof(*this), (PBYTE) this);\n    }\n};\n\nstruct MSLAYOUT DacpFrameData\n{\n    CLRDATA_ADDRESS frameAddr = 0;\n\n    // Could also be implemented for IXCLRDataFrame if desired.\n    HRESULT Request(IXCLRDataStackWalk* dac)\n    {\n        return dac->Request(DACSTACKPRIV_REQUEST_FRAME_DATA,\n                            0, NULL,\n                            sizeof(*this), (PBYTE)this);\n    }\n};\n\nstruct MSLAYOUT DacpJitManagerInfo\n{\n    CLRDATA_ADDRESS managerAddr = 0;\n    DWORD codeType = 0; // for union below\n    CLRDATA_ADDRESS ptrHeapList = 0;    // A HeapList * if IsMiIL(codeType)\n};\n\nenum CodeHeapType {CODEHEAP_LOADER=0,CODEHEAP_HOST,CODEHEAP_UNKNOWN};\n\nstruct MSLAYOUT DacpJitCodeHeapInfo\n{\n    DWORD codeHeapType = 0; // for union below\n\n    union\n    {\n        CLRDATA_ADDRESS LoaderHeap = 0;    // if CODEHEAP_LOADER\n        struct MSLAYOUT\n        {\n            CLRDATA_ADDRESS baseAddr = 0; // if CODEHEAP_HOST\n            CLRDATA_ADDRESS currentAddr = 0;\n        } HostData;\n    };\n\n    DacpJitCodeHeapInfo() : codeHeapType(0), LoaderHeap(0) {}\n};\n\n#include \"static_assert.h\"\n\n/* DAC datastructures are frozen as of dev11 shipping.  Do NOT add fields, remove fields, or change the fields of\n * these structs in any way.  The correct way to get new data out of the runtime is to create a new struct and\n * add a new function to the latest Dac<-->SOS interface to produce this data.\n */\nstatic_assert(sizeof(DacpAllocData) == 0x10, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpGenerationAllocData) == 0x40, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpSyncBlockCleanupData) == 0x28, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpThreadStoreData) == 0x38, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpAppDomainStoreData) == 0x18, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpAppDomainData) == 0x48, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpAssemblyData) == 0x40, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpThreadData) == 0x68, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpMethodDescData) == 0x98, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpCodeHeaderData) == 0x38, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpThreadpoolData) == 0x58, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpObjectData) == 0x60, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpMethodTableData) == 0x48, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpWorkRequestData) == 0x18, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpFieldDescData) == 0x40, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpModuleData) == 0xa0, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpGcHeapData) == 0x10, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpJitManagerInfo) == 0x18, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpHeapSegmentData) == 0x58, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpDomainLocalModuleData) == 0x30, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpUsefulGlobalsData) == 0x28, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DACEHInfo) == 0x58, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpRCWData) == 0x58, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpCCWData) == 0x48, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpMethodTableFieldData) == 0x18, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpMethodTableTransparencyData) == 0xc, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpThreadLocalModuleData) == 0x30, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpCOMInterfacePointerData) == 0x18, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpMethodDescTransparencyData) == 0xc, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpHillClimbingLogEntry) == 0x18, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpGenerationData) == 0x20, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpGcHeapDetails) == 0x120, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpOomData) == 0x38, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpGcHeapAnalyzeData) == 0x20, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpSyncBlockData) == 0x48, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpGetModuleAddress) == 0x8, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpFrameData) == 0x8, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpJitCodeHeapInfo) == 0x18, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpExceptionObjectData) == 0x38, \"Dacp structs cannot be modified due to backwards compatibility.\");\nstatic_assert(sizeof(DacpMethodTableCollectibleData) == 0x10, \"Dacp structs cannot be modified due to backwards compatibility.\");\n\n#endif  // _DACPRIVATE_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/dacvars.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// This file contains the globals and statics that are visible to DAC.\n// It is used for the following:\n// 1. in daccess.h to build the table of DAC globals\n// 2. in enummem.cpp to dump out the related memory of static and globals\n//    in a mini dump or heap dump\n// 3. in DacUpdateDll and tools\\DacTablenGen\\main.cs\n//\n// To use this functionality for other tools or purposes, define the\n// DEFINE_DACVAR macro & include dacvars.h like so (see enummem.cpp and/or\n// daccess.h for examples):\n//\n// #define DEFINE_DACVAR(type, size, id, var)  type id;     //this defn. discards\n//                                                          //the size\n// #include \"dacvars.h\"\n//\n// @dbgtodo:\n// Ideally we may be able to build a tool that generates this automatically.\n// At the least, we should automatically verify that the contents of this file\n// are consistent with the uses of all the macros like SVAL_DECL and GARY_DECL.\n//\n//=================================================\n// INSTRUCTIONS FOR ADDING VARIABLES TO THIS FILE\n//=================================================\n// You need to add a global or static declared with DAC macros, such as SPTR_*\n// GPTR_*, SVAL_*, GVAL_*, or GARY_*, only if the global or static is actually used\n// in a DACized code path. If you have declared a static or global that way just\n// because you were pattern-matching or because you anticipate that the variable\n// may eventually be used in a DACized code path, you don't need to add it here,\n// although in that case, you should not really use the DAC macro when you declare\n// the global or static.\n//\t\t\t\t\t*\t\t\t\t*\t\t\t\t*\n// The FIRST ARGUMENT should always be specified as ULONG. This is the type of\n// the offsets for the corresponding id in the _DacGlobals table.\n// @dbgtodo:\n// We should get rid of the ULONG argument since it's always the same. We would\n// also need to modify DacTablenGen\\main.cs.\n//\t\t\t\t\t*\t\t\t\t*\t\t\t\t*\n// The SECOND ARGUMENT, \"true_type,\" is used to calculate the true size of the\n// static/global variable. It is currently used only in enummem.cpp to write out\n// theproper size of memory for dumps.\n//\t\t\t\t\t*\t\t\t\t*\t\t\t\t*\n// The THIRD ARGUMENT should be a qualified name. If the variable is a static data\n// member, the name should be <class_name>__<member_name>. If the variable is a\n// global, the name should be <dac>__<global_name>.\n//\t\t\t\t\t*\t\t\t\t*\t\t\t\t*\n// The FOURTH ARGUMENT should be the actual name of the static/global variable. If\n// static data the should be [<namespace>::]<class_name>::<member_name>. If global,\n// it should look like <global_name>.\n//\t\t\t\t\t*\t\t\t\t*\t\t\t\t*\n// If you need to add an entry to this file, your type may not be visible when\n// this file is compiled. In that case, you need to do one of two things:\n// - If the type is a pointer type, you can simply use UNKNOWN_POINTER_TYPE as the\n//\t \"true type.\" It may be useful to specify the non-visible type in a comment.\n// - If the type is a composite/user-defined type, you must #include the header\n//   file that defines the type in enummem.cpp. Do NOT #include it in daccess.h\n// Array types may be dumped via an explicit call to enumMem, so they should\n// be declared with DEFINE_DACVAR_NO_DUMP. The size in this case is immaterial, since\n// nothing will be dumped.\n\n#ifndef DEFINE_DACVAR\n#define DEFINE_DACVAR(true_type, id, var)\n#endif\n\n// Use this macro to define a static var that is known to the DAC and uses Volatile<T> for storage in the runtime\n#ifndef DEFINE_DACVAR_VOLATILE\n#define DEFINE_DACVAR_VOLATILE(true_type, id, var)\n#endif\n\n// Use this macro to define a static var that is known to DAC, but not captured in a dump.\n#ifndef DEFINE_DACVAR_NO_DUMP\n#define DEFINE_DACVAR_NO_DUMP(true_type, id, var)\n#endif\n\n#define UNKNOWN_POINTER_TYPE SIZE_T\n\nDEFINE_DACVAR_VOLATILE(PTR_RangeSection, ExecutionManager__m_CodeRangeList, ExecutionManager::m_CodeRangeList)\nDEFINE_DACVAR(PTR_EECodeManager, ExecutionManager__m_pDefaultCodeMan, ExecutionManager::m_pDefaultCodeMan)\nDEFINE_DACVAR_VOLATILE(LONG, ExecutionManager__m_dwReaderCount, ExecutionManager::m_dwReaderCount)\nDEFINE_DACVAR_VOLATILE(LONG, ExecutionManager__m_dwWriterLock, ExecutionManager::m_dwWriterLock)\n\nDEFINE_DACVAR(PTR_EEJitManager, ExecutionManager__m_pEEJitManager, ExecutionManager::m_pEEJitManager)\n#ifdef FEATURE_READYTORUN\nDEFINE_DACVAR(PTR_ReadyToRunJitManager, ExecutionManager__m_pReadyToRunJitManager, ExecutionManager::m_pReadyToRunJitManager)\n#endif\n\nDEFINE_DACVAR_NO_DUMP(VMHELPDEF *, dac__hlpFuncTable, ::hlpFuncTable)\nDEFINE_DACVAR(VMHELPDEF *, dac__hlpDynamicFuncTable, ::hlpDynamicFuncTable)\n\nDEFINE_DACVAR(PTR_StubManager, StubManager__g_pFirstManager, StubManager::g_pFirstManager)\nDEFINE_DACVAR(PTR_PrecodeStubManager, PrecodeStubManager__g_pManager, PrecodeStubManager::g_pManager)\nDEFINE_DACVAR(PTR_StubLinkStubManager, StubLinkStubManager__g_pManager, StubLinkStubManager::g_pManager)\nDEFINE_DACVAR(PTR_ThunkHeapStubManager, ThunkHeapStubManager__g_pManager, ThunkHeapStubManager::g_pManager)\nDEFINE_DACVAR(PTR_JumpStubStubManager, JumpStubStubManager__g_pManager, JumpStubStubManager::g_pManager)\nDEFINE_DACVAR(PTR_RangeSectionStubManager, RangeSectionStubManager__g_pManager, RangeSectionStubManager::g_pManager)\nDEFINE_DACVAR(PTR_DelegateInvokeStubManager, DelegateInvokeStubManager__g_pManager, DelegateInvokeStubManager::g_pManager)\nDEFINE_DACVAR(PTR_VirtualCallStubManagerManager, VirtualCallStubManagerManager__g_pManager, VirtualCallStubManagerManager::g_pManager)\nDEFINE_DACVAR(PTR_CallCountingStubManager, CallCountingStubManager__g_pManager, CallCountingStubManager::g_pManager)\n\nDEFINE_DACVAR(PTR_ThreadStore, ThreadStore__s_pThreadStore, ThreadStore::s_pThreadStore)\n\nDEFINE_DACVAR(PTR_Thread, dac__g_pFinalizerThread, ::g_pFinalizerThread)\nDEFINE_DACVAR(PTR_Thread, dac__g_pSuspensionThread, ::g_pSuspensionThread)\n\nDEFINE_DACVAR(DWORD, dac__g_heap_type, g_heap_type)\nDEFINE_DACVAR(PTR_GcDacVars, dac__g_gcDacGlobals, g_gcDacGlobals)\n\nDEFINE_DACVAR(PTR_AppDomain, AppDomain__m_pTheAppDomain, AppDomain::m_pTheAppDomain)\nDEFINE_DACVAR(PTR_SystemDomain, SystemDomain__m_pSystemDomain, SystemDomain::m_pSystemDomain)\n\n#ifdef FEATURE_INTEROP_DEBUGGING\nDEFINE_DACVAR(DWORD, dac__g_debuggerWordTLSIndex, g_debuggerWordTLSIndex)\n#endif\nDEFINE_DACVAR(DWORD, dac__g_TlsIndex, g_TlsIndex)\n\nDEFINE_DACVAR(PTR_SString, SString__s_Empty, SString::s_Empty)\n\nDEFINE_DACVAR(INT32, ArrayBase__s_arrayBoundsZero, ArrayBase::s_arrayBoundsZero)\n\nDEFINE_DACVAR(BOOL, StackwalkCache__s_Enabled, StackwalkCache::s_Enabled)\n\nDEFINE_DACVAR(PTR_JITNotification, dac__g_pNotificationTable, ::g_pNotificationTable)\nDEFINE_DACVAR(ULONG32, dac__g_dacNotificationFlags, ::g_dacNotificationFlags)\nDEFINE_DACVAR(PTR_GcNotification, dac__g_pGcNotificationTable, ::g_pGcNotificationTable)\n\nDEFINE_DACVAR(PTR_EEConfig, dac__g_pConfig, ::g_pConfig)\n\nDEFINE_DACVAR(CoreLibBinder, dac__g_CoreLib, ::g_CoreLib)\n\n#if defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)\nDEFINE_DACVAR(ProfControlBlock, dac__g_profControlBlock, ::g_profControlBlock)\n#endif // defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)\n\nDEFINE_DACVAR(PTR_DWORD, dac__g_card_table, ::g_card_table)\nDEFINE_DACVAR(PTR_BYTE, dac__g_lowest_address, ::g_lowest_address)\nDEFINE_DACVAR(PTR_BYTE, dac__g_highest_address, ::g_highest_address)\nDEFINE_DACVAR(gc_alloc_context, dac__g_global_alloc_context, ::g_global_alloc_context)\n\nDEFINE_DACVAR(IGCHeap, dac__g_pGCHeap, ::g_pGCHeap)\n\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pThinLockThreadIdDispenser, ::g_pThinLockThreadIdDispenser)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pModuleIndexDispenser, ::g_pModuleIndexDispenser)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pObjectClass, ::g_pObjectClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pRuntimeTypeClass, ::g_pRuntimeTypeClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pCanonMethodTableClass, ::g_pCanonMethodTableClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pStringClass, ::g_pStringClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pArrayClass, ::g_pArrayClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pSZArrayHelperClass, ::g_pSZArrayHelperClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pNullableClass, ::g_pNullableClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pExceptionClass, ::g_pExceptionClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pThreadAbortExceptionClass, ::g_pThreadAbortExceptionClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pOutOfMemoryExceptionClass, ::g_pOutOfMemoryExceptionClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pStackOverflowExceptionClass, ::g_pStackOverflowExceptionClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pExecutionEngineExceptionClass, ::g_pExecutionEngineExceptionClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pDelegateClass, ::g_pDelegateClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pMulticastDelegateClass, ::g_pMulticastDelegateClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pFreeObjectMethodTable, ::g_pFreeObjectMethodTable)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pValueTypeClass, ::g_pValueTypeClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pEnumClass, ::g_pEnumClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pThreadClass, ::g_pThreadClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pPredefinedArrayTypes, ::g_pPredefinedArrayTypes)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_TypedReferenceMT, ::g_TypedReferenceMT)\n\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pWeakReferenceClass, ::g_pWeakReferenceClass)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pWeakReferenceOfTClass, ::g_pWeakReferenceOfTClass)\n\n#ifdef FEATURE_COMINTEROP\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pBaseCOMObject, ::g_pBaseCOMObject)\n#endif\n\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pIDynamicInterfaceCastableInterface, ::g_pIDynamicInterfaceCastableInterface)\n\n#ifdef FEATURE_ICASTABLE\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pICastableInterface, ::g_pICastableInterface)\n#endif // FEATURE_ICASTABLE\n\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pObjectFinalizerMD, ::g_pObjectFinalizerMD)\n\nDEFINE_DACVAR(bool, dac__g_fProcessDetach, ::g_fProcessDetach)\nDEFINE_DACVAR(DWORD, dac__g_fEEShutDown, ::g_fEEShutDown)\n\nDEFINE_DACVAR(ULONG, dac__g_CORDebuggerControlFlags, ::g_CORDebuggerControlFlags)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pDebugger, ::g_pDebugger)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pDebugInterface, ::g_pDebugInterface)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pEEDbgInterfaceImpl, ::g_pEEDbgInterfaceImpl)\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pEEInterface, ::g_pEEInterface)\nDEFINE_DACVAR(ULONG, dac__CLRJitAttachState, ::CLRJitAttachState)\n\nDEFINE_DACVAR(BOOL, Debugger__s_fCanChangeNgenFlags, Debugger::s_fCanChangeNgenFlags)\n\nDEFINE_DACVAR(PTR_DebuggerPatchTable, DebuggerController__g_patches, DebuggerController::g_patches)\nDEFINE_DACVAR(BOOL, DebuggerController__g_patchTableValid, DebuggerController::g_patchTableValid)\n\nDEFINE_DACVAR(SIZE_T, dac__gLowestFCall, ::gLowestFCall)\nDEFINE_DACVAR(SIZE_T, dac__gHighestFCall, ::gHighestFCall)\nDEFINE_DACVAR(SIZE_T, dac__gFCallMethods, ::gFCallMethods)\n\nDEFINE_DACVAR(PTR_SyncTableEntry, dac__g_pSyncTable, ::g_pSyncTable)\n#ifdef FEATURE_COMINTEROP\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pRCWCleanupList, ::g_pRCWCleanupList)\n#endif // FEATURE_COMINTEROP\n\n#ifndef TARGET_UNIX\nDEFINE_DACVAR(SIZE_T, dac__g_runtimeLoadedBaseAddress, ::g_runtimeLoadedBaseAddress)\nDEFINE_DACVAR(SIZE_T, dac__g_runtimeVirtualSize, ::g_runtimeVirtualSize)\n#endif // !TARGET_UNIX\n\nDEFINE_DACVAR(SyncBlockCache *, SyncBlockCache__s_pSyncBlockCache, SyncBlockCache::s_pSyncBlockCache)\n\nDEFINE_DACVAR(UNKNOWN_POINTER_TYPE, dac__g_pStressLog, ::g_pStressLog)\n\nDEFINE_DACVAR(SIZE_T, dac__s_gsCookie, ::s_gsCookie)\n\nDEFINE_DACVAR_NO_DUMP(SIZE_T, dac__g_FCDynamicallyAssignedImplementations, ::g_FCDynamicallyAssignedImplementations)\n\n#ifndef TARGET_UNIX\nDEFINE_DACVAR(HANDLE, dac__g_hContinueStartupEvent, ::g_hContinueStartupEvent)\n#endif // !TARGET_UNIX\nDEFINE_DACVAR(DWORD, CorHost2__m_dwStartupFlags, CorHost2::m_dwStartupFlags)\n\nDEFINE_DACVAR(HRESULT, dac__g_hrFatalError, ::g_hrFatalError)\n\n#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS\nDEFINE_DACVAR(DWORD, dac__g_MiniMetaDataBuffMaxSize, ::g_MiniMetaDataBuffMaxSize)\nDEFINE_DACVAR(TADDR, dac__g_MiniMetaDataBuffAddress, ::g_MiniMetaDataBuffAddress)\n#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS\n\nDEFINE_DACVAR(SIZE_T, dac__g_clrNotificationArguments, ::g_clrNotificationArguments)\n\n#ifdef EnC_SUPPORTED\nDEFINE_DACVAR(bool, dac__g_metadataUpdatesApplied, ::g_metadataUpdatesApplied)\n#endif\n\n#undef DEFINE_DACVAR\n#undef DEFINE_DACVAR_NO_DUMP\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/dbgenginemetrics.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// DbgEngineMetrics.h\n//\n// This file contains the definition of CLR_ENGINE_METRICS.  This struct is used for Silverlight debugging.\n//\n// ======================================================================================\n\n\n\n#ifndef __DbgEngineMetrics_h__\n#define __DbgEngineMetrics_h__\n\n//---------------------------------------------------------------------------------------\n//\n// This struct contains information necessary for Silverlight debugging.  coreclr.dll has a static struct\n// of this type.  It is read by dbgshim.dll to help synchronize the debugger and coreclr.dll in launch\n// and early attach scenarios.\n//\n\ntypedef struct tagCLR_ENGINE_METRICS\n{\n    DWORD   cbSize;                 // the size of the struct; also identifies the format of the struct\n    DWORD   dwDbiVersion;           // the version of the debugging interface expected by this CoreCLR\n    LPVOID  phContinueStartupEvent; // pointer to the continue startup event handle\n} CLR_ENGINE_METRICS;\n\n#endif // __DbgEngineMetrics_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/dbgmeta.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/* ------------------------------------------------------------------------- *\n * DbgMeta.h - header file for debugger metadata routines\n * ------------------------------------------------------------------------- */\n\n#ifndef _DbgMeta_h_\n#define _DbgMeta_h_\n\n#include <cor.h>\n\n/* ------------------------------------------------------------------------- *\n * Structs to support line numbers and variables\n * ------------------------------------------------------------------------- */\n\nclass DebuggerLexicalScope;\n\n//\n// DebuggerVarInfo\n//\n// Holds basic information about local variables, method arguments,\n// and class static and instance variables.\n//\nstruct DebuggerVarInfo\n{\n    LPCSTR                 name;\n    PCCOR_SIGNATURE        sig;\n    unsigned int          varNumber;  // placement info for IL code\n    DebuggerLexicalScope*  scope;      // containing scope\n\n    DebuggerVarInfo() : name(NULL), sig(NULL), varNumber(0),\n                        scope(NULL) {}\n};\n\n#endif /* _DbgMeta_h_ */\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/dbgportable.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __DBG_PORTABLE_INCLUDED\n#define __DBG_PORTABLE_INCLUDED\n\n//\n// This header defines the template class Portable<T> which is designed to wrap primitive types in such a way\n// that their physical representation is in a canonical format that can be safely transferred between hosts on\n// different platforms.\n//\n// This is achieved by storing the wrapped datum in little-endian format (since most of our platforms are\n// little-endian this makes the most sense from a performance perspective). On little-endian platforms the\n// wrapper code will become a no-op and get optimized away by the compiler. On big-endian platforms\n// assignments to a Portable<T> value will reverse the order of the bytes in the T value and reverse them back\n// again on a read.\n//\n// Portable<T> is typically used to wrap the fields of structures sent directly over a network channel. In\n// this fashion many of the values that would otherwise require manual endian-ness fixups are now marshalled\n// and unmarshalled transparent right at the network transition.\n//\n// Care must be taken to identify any code that takes the address of a Portable<T>, since this is not\n// generally safe (it could expose naive code to the network encoded form of the datum). In such situations\n// the code is normally re-written to create a temporary instance of T on the stack, initialized to the\n// correct host value by reading from the Portable<T> field. The address of this variable can now be taken\n// safely (assuming its value is required only for some lexically scoped operation). Once the value is no\n// longer being used, and if there is a possibility that the value may have been updated, the new value can be\n// copied back into the Portable<T> field.\n//\n// Note that this header uses very basic data types only as it is included from both Win32/PAL code and native\n// Mac code.\n//\n\n#if BIGENDIAN || __BIG_ENDIAN__\n#define DBG_BYTE_SWAP_REQUIRED\n#endif\n\n#if defined(_ASSERTE)\n#define _PASSERT(_expr) _ASSERTE(_expr)\n#elif defined(assert)\n#define _PASSERT(_expr) assert(_expr)\n#else\n#define _PASSERT(_expr)\n#endif\n\n// Lowest level helper used to reverse the order of a sequence of bytes, either as an in-place operation or as\n// part of a copy.\ninline void ByteSwapPrimitive(const void *pSrc, void *pDst, unsigned int cbSize)\n{\n    _PASSERT(cbSize == 2 || cbSize == 4 || cbSize == 8);\n\n    unsigned char *pbSrc = (unsigned char*)pSrc;\n    unsigned char *pbDst = (unsigned char*)pDst;\n\n    for (unsigned int i = 0; i < (cbSize / 2); i++)\n    {\n        unsigned int j = cbSize - i - 1;\n        unsigned char bTemp = pbSrc[i];\n        pbDst[i] = pbSrc[j];\n        pbDst[j] = bTemp;\n    }\n}\n\ntemplate <typename T>\nclass Portable\n{\n    T m_data;\n\npublic:\n    // No constructors -- this will be used in unions.\n\n    // Convert data to portable format on assignment.\n    T operator = (T value)\n    {\n        _PASSERT(sizeof(value) <= sizeof(double));\n#ifdef DBG_BYTE_SWAP_REQUIRED\n        m_data = ByteSwap(value);\n#else // DBG_BYTE_SWAP_REQUIRED\n        m_data = value;\n#endif // DBG_BYTE_SWAP_REQUIRED\n        return value;\n    }\n\n    // Return data in native format on access.\n    operator T () const\n    {\n#ifdef DBG_BYTE_SWAP_REQUIRED\n        return ByteSwap(m_data);\n#else // DBG_BYTE_SWAP_REQUIRED\n        return m_data;\n#endif // DBG_BYTE_SWAP_REQUIRED\n    }\n\n    bool operator == (T other) const\n    {\n#ifdef DBG_BYTE_SWAP_REQUIRED\n        return ByteSwap(m_data) == other;\n#else // DBG_BYTE_SWAP_REQUIRED\n        return m_data == other;\n#endif // DBG_BYTE_SWAP_REQUIRED\n    }\n\n    bool operator != (T other) const\n    {\n#ifdef DBG_BYTE_SWAP_REQUIRED\n        return ByteSwap(m_data) != other;\n#else // DBG_BYTE_SWAP_REQUIRED\n        return m_data != other;\n#endif // DBG_BYTE_SWAP_REQUIRED\n    }\n\n    T Unwrap()\n    {\n#ifdef DBG_BYTE_SWAP_REQUIRED\n        return ByteSwap(m_data);\n#else // DBG_BYTE_SWAP_REQUIRED\n        return m_data;\n#endif // DBG_BYTE_SWAP_REQUIRED\n    }\n\nprivate:\n#ifdef DBG_BYTE_SWAP_REQUIRED\n    // Big endian helper routine to swap the order of bytes of an arbitrary sized type\n    // (though obviously this type must be an integral primitive for this to make any\n    // sense).\n    static T ByteSwap(T inval)\n    {\n        if (sizeof(T) > 1)\n        {\n            T outval;\n            ByteSwapPrimitive(&inval, &outval, sizeof(T));\n            return outval;\n        }\n        else\n            return inval;\n    }\n#endif // DBG_BYTE_SWAP_REQUIRED\n};\n\n#endif // !__DBG_PORTABLE_INCLUDED\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/debugmacros.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// DebugMacros.h\n//\n// Wrappers for Debugging purposes.\n//\n//*****************************************************************************\n\n#ifndef __DebugMacros_h__\n#define __DebugMacros_h__\n\n#include \"stacktrace.h\"\n#include \"debugmacrosext.h\"\n#include \"palclr.h\"\n\n#undef _ASSERTE\n#undef VERIFY\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\n#if defined(_DEBUG)\n\nclass SString;\nbool GetStackTraceAtContext(SString & s, struct _CONTEXT * pContext);\n\nbool _DbgBreakCheck(LPCSTR szFile, int iLine, LPCSTR szExpr, BOOL fConstrained = FALSE);\n\nextern VOID ANALYZER_NORETURN DbgAssertDialog(const char *szFile, int iLine, const char *szExpr);\n\n#define PRE_ASSERTE         /* if you need to change modes before doing asserts override */\n#define POST_ASSERTE        /* put it back */\n\n#if !defined(_ASSERTE_MSG)\n  #define _ASSERTE_MSG(expr, msg)                                           \\\n        do {                                                                \\\n             if (!(expr)) {                                                 \\\n                PRE_ASSERTE                                                 \\\n                DbgAssertDialog(__FILE__, __LINE__, msg);                   \\\n                POST_ASSERTE                                                \\\n             }                                                              \\\n        } while (0)\n#endif // _ASSERTE_MSG\n\n#if !defined(_ASSERTE)\n  #define _ASSERTE(expr) _ASSERTE_MSG(expr, #expr)\n#endif  // !_ASSERTE\n\n\n#define VERIFY(stmt) _ASSERTE((stmt))\n\n#define _ASSERTE_ALL_BUILDS(expr) _ASSERTE((expr))\n\n#else // !_DEBUG\n\n#define _ASSERTE(expr) ((void)0)\n#define _ASSERTE_MSG(expr, msg) ((void)0)\n#define VERIFY(stmt) (void)(stmt)\n\n// At this point, EEPOLICY_HANDLE_FATAL_ERROR may or may not be defined. It will be defined\n// if we are building the VM folder, but outside VM, its not necessarily defined.\n//\n// Thus, if EEPOLICY_HANDLE_FATAL_ERROR is not defined, we will call into __FreeBuildAssertFail,\n// but if it is defined, we will use it.\n//\n// Failing here implies an error in the runtime - hence we use COR_E_EXECUTIONENGINE.\n#ifdef EEPOLICY_HANDLE_FATAL_ERROR\n#define _ASSERTE_ALL_BUILDS(expr) if (!(expr)) EEPOLICY_HANDLE_FATAL_ERROR(COR_E_EXECUTIONENGINE);\n#else // !EEPOLICY_HANDLE_FATAL_ERROR\nvoid DECLSPEC_NORETURN __FreeBuildAssertFail(const char *szFile, int iLine, const char *szExpr);\n#define _ASSERTE_ALL_BUILDS(expr) if (!(expr)) __FreeBuildAssertFail(__FILE__, __LINE__, #expr);\n#endif // EEPOLICY_HANDLE_FATAL_ERROR\n\n#endif\n\n\n#define ASSERT_AND_CHECK(x) {       \\\n    BOOL bResult = x;               \\\n    if (!bResult)                   \\\n    {                               \\\n        _ASSERTE(x);                \\\n        return FALSE;               \\\n    }                               \\\n}\n\n\n#ifdef _DEBUG_IMPL\n\n#define _ASSERTE_IMPL(expr) _ASSERTE((expr))\n\n#if     defined(_M_IX86)\n#if defined(_MSC_VER)\n#define _DbgBreak() __asm { int 3 }\n#elif defined(__GNUC__)\n#define _DbgBreak() __asm__ (\"int $3\");\n#else\n#error Unknown compiler\n#endif\n#else\n#define _DbgBreak() DebugBreak()\n#endif\n\nextern VOID DebBreakHr(HRESULT hr);\n\n#ifndef IfFailGoto\n#define IfFailGoto(EXPR, LABEL) \\\ndo { hr = (EXPR); if(FAILED(hr)) { DebBreakHr(hr); goto LABEL; } } while (0)\n#endif\n\n#ifndef IfFailRet\n#define IfFailRet(EXPR) \\\ndo { hr = (EXPR); if(FAILED(hr)) { DebBreakHr(hr); return (hr); } } while (0)\n#endif\n\n#ifndef IfFailWin32Ret\n#define IfFailWin32Ret(EXPR) \\\ndo { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); DebBreakHr(hr); return hr;} } while (0)\n#endif\n\n#ifndef IfFailWin32Goto\n#define IfFailWin32Goto(EXPR, LABEL) \\\ndo { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); DebBreakHr(hr); goto LABEL; } } while (0)\n#endif\n\n#ifndef IfFailGo\n#define IfFailGo(EXPR) IfFailGoto(EXPR, ErrExit)\n#endif\n\n#ifndef IfFailWin32Go\n#define IfFailWin32Go(EXPR) IfFailWin32Goto(EXPR, ErrExit)\n#endif\n\n#else // _DEBUG_IMPL\n\n#define _DbgBreak() {}\n\n#define _ASSERTE_IMPL(expr)\n\n#define IfFailGoto(EXPR, LABEL) \\\ndo { hr = (EXPR); if(FAILED(hr)) { goto LABEL; } } while (0)\n\n#define IfFailRet(EXPR) \\\ndo { hr = (EXPR); if(FAILED(hr)) { return (hr); } } while (0)\n\n#define IfFailWin32Ret(EXPR) \\\ndo { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); return hr;} } while (0)\n\n#define IfFailWin32Goto(EXPR, LABEL) \\\ndo { hr = (EXPR); if(hr != ERROR_SUCCESS) { hr = HRESULT_FROM_WIN32(hr); goto LABEL; } } while (0)\n\n#define IfFailGo(EXPR) IfFailGoto(EXPR, ErrExit)\n\n#define IfFailWin32Go(EXPR) IfFailWin32Goto(EXPR, ErrExit)\n\n#endif // _DEBUG_IMPL\n\n\n#define IfNullGoto(EXPR, LABEL) \\\n    do { if ((EXPR) == NULL) { OutOfMemory(); IfFailGoto(E_OUTOFMEMORY, LABEL); } } while (false)\n\n#ifndef IfNullRet\n#define IfNullRet(EXPR) \\\n    do { if ((EXPR) == NULL) { OutOfMemory(); return E_OUTOFMEMORY; } } while (false)\n#endif //!IfNullRet\n\n#define IfNullGo(EXPR) IfNullGoto(EXPR, ErrExit)\n\n#ifdef __cplusplus\n}\n\n#endif // __cplusplus\n\n\n#undef assert\n#define assert _ASSERTE\n#undef _ASSERT\n#define _ASSERT _ASSERTE\n\n\n#if defined(_DEBUG) && defined(HOST_WINDOWS)\n\n// This function returns the EXE time stamp (effectively a random number)\n// Under retail it always returns 0.  This is meant to be used in the\n// RandomOnExe macro\nunsigned DbgGetEXETimeStamp();\n\n// returns true 'fractionOn' amount of the time using the EXE timestamp\n// as the random number seed.  For example DbgRandomOnExe(.1) returns true 1/10\n// of the time.  We use the line number so that different uses of DbgRandomOnExe\n// will not be coorelated with each other (9973 is prime).  Returns false on a retail build\n#define DbgRandomOnHashAndExe(hash, fractionOn) \\\n    (((DbgGetEXETimeStamp() * __LINE__ * ((hash) ? (hash) : 1)) % 9973) < \\\n     unsigned((fractionOn) * 9973))\n#define DbgRandomOnExe(fractionOn) DbgRandomOnHashAndExe(0, fractionOn)\n\n#else\n\n#define DbgGetEXETimeStamp() 0\n#define DbgRandomOnHashAndExe(hash, fractionOn)  0\n#define DbgRandomOnExe(fractionOn)  0\n\n#endif // _DEBUG && !FEATUREPAL\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/debugmacrosext.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// DebugMacrosExt.h\n//\n// Simple debugging macros that take no dependencies on CLR headers.\n// This header can be used from outside the CLR.\n//\n//*****************************************************************************\n\n#ifndef __DebugMacrosExt_h__\n#define __DebugMacrosExt_h__\n\n#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define _DEBUG_IMPL 1\n#endif\n\n#ifdef _DEBUG\n// A macro to execute a statement only in _DEBUG.\n#define DEBUG_STMT(stmt) stmt\n#define INDEBUG(x)          x\n#define INDEBUG_COMMA(x)    x,\n#define COMMA_INDEBUG(x)    ,x\n#define NOT_DEBUG(x)\n#else\n#define DEBUG_STMT(stmt)\n#define INDEBUG(x)\n#define INDEBUG_COMMA(x)\n#define COMMA_INDEBUG(x)\n#define NOT_DEBUG(x)        x\n#endif\n\n\n#ifdef _DEBUG_IMPL\n#define INDEBUGIMPL(x)          x\n#define INDEBUGIMPL_COMMA(x)    x,\n#define COMMA_INDEBUGIMPL(x)    ,x\n#else\n#define INDEBUGIMPL(x)\n#define INDEBUGIMPL_COMMA(x)\n#define COMMA_INDEBUGIMPL(x)\n#endif\n\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/debugreturn.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef _DEBUGRETURN_H_\n#define _DEBUGRETURN_H_\n\n// Note that with OACR Prefast is run over checked (_DEBUG is defined) sources\n// so we have to first check the _PREFAST_ define followed by the _DEBUG define\n//\n#ifdef _PREFAST_\n\n// Use prefast to detect gotos out of no-return blocks. The gotos out of no-return blocks\n// should be reported as memory leaks by prefast.  The (nothrow) is because PREfix sees the\n// throw from the new statement, and doesn't like these macros used in a destructor (and\n// the NULL returned by failure works just fine in delete[])\n\n#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg)    { char* __noReturnInThisBlock_##arg = ::new (nothrow) char[1];\n#define DEBUG_ASSURE_NO_RETURN_END(arg)      ::delete[] __noReturnInThisBlock_##arg; }\n\n#define DEBUG_OK_TO_RETURN_BEGIN(arg)        { ::delete[] __noReturnInThisBlock_##arg;\n#define DEBUG_OK_TO_RETURN_END(arg)          __noReturnInThisBlock_##arg = ::new (nothrow) char[1]; }\n\n#define DEBUG_ASSURE_SAFE_TO_RETURN TRUE\n#define return return\n\n#else // !_PREFAST_\n\n// This is disabled in build 190024315 (a pre-release build after VS 2015 Update 3) and\n// earlier because those builds only support C++11 constexpr,  which doesn't allow the\n// use of 'if' statements within the body of a constexpr function.  Later builds support\n// C++14 constexpr.\n#if defined(_DEBUG) && !defined(JIT_BUILD) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024315)\n\n// Code to generate a compile-time error if return statements appear where they\n// shouldn't.\n//\n// Here's the way it works...\n//\n// We create two classes with a safe_to_return() method.  The method is static,\n// returns void, and does nothing.  One class has the method as public, the other\n// as private.  We introduce a global scope typedef for __ReturnOK that refers to\n// the class with the public method.  So, by default, the expression\n//\n//      __ReturnOK::safe_to_return()\n//\n// quietly compiles and does nothing.  When we enter a block in which we want to\n// inhibit returns, we introduce a new typedef that defines __ReturnOK as the\n// class with the private method.  Inside this scope,\n//\n//      __ReturnOK::safe_to_return()\n//\n// generates a compile-time error.\n//\n// To cause the method to be called, we have to #define the return keyword.\n// The simplest working version would be\n//\n//   #define return if (0) __ReturnOK::safe_to_return(); else return\n//\n// but we've used\n//\n//   #define return for (;1;__ReturnOK::safe_to_return()) return\n//\n// because it happens to generate somewhat faster code in a checked build.  (They\n// both introduce no overhead in a fastchecked build.)\n//\nclass __SafeToReturn {\npublic:\n    static int safe_to_return() {return 0;};\n    static int used() {return 0;};\n};\n\nclass __YouCannotUseAReturnStatementHere {\nprivate:\n    // If you got here, and you're wondering what you did wrong -- you're using\n    // a return statement where it's not allowed.  Likely, it's inside one of:\n    //     GCPROTECT_BEGIN ... GCPROTECT_END\n    //     HELPER_METHOD_FRAME_BEGIN ... HELPER_METHOD_FRAME_END\n    //\n    static int safe_to_return() {return 0;};\npublic:\n    // Some compilers warn if all member functions in a class are private\n    // or if a typedef is unused. Rather than disable the warning, we'll work\n    // around it here.\n    static int used() {return 0;};\n};\n\ntypedef __SafeToReturn __ReturnOK;\n\n// Use this to ensure that it is safe to return from a given scope\n#define DEBUG_ASSURE_SAFE_TO_RETURN     __ReturnOK::safe_to_return()\n\n// Unfortunately, the only way to make this work is to #define all return statements --\n// even the ones at global scope.  This actually generates better code that appears.\n// The call is dead, and does not appear in the generated code, even in a checked\n// build.  (And, in fastchecked, there is no penalty at all.)\n//\n#ifdef _MSC_VER\n#define return if (0 && __ReturnOK::safe_to_return()) { } else return\n#else // _MSC_VER\n#define return for (;1;__ReturnOK::safe_to_return()) return\n#endif // _MSC_VER\n\n#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg) { typedef __YouCannotUseAReturnStatementHere __ReturnOK; if (0 && __ReturnOK::used()) { } else {\n#define DEBUG_ASSURE_NO_RETURN_END(arg)   } }\n\n#define DEBUG_OK_TO_RETURN_BEGIN(arg) { typedef __SafeToReturn __ReturnOK; if (0 && __ReturnOK::used()) { } else {\n#define DEBUG_OK_TO_RETURN_END(arg) } }\n\n#else // defined(_DEBUG) && !defined(JIT_BUILD) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024315)\n\n#define DEBUG_ASSURE_SAFE_TO_RETURN TRUE\n\n#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg) {\n#define DEBUG_ASSURE_NO_RETURN_END(arg) }\n\n#define DEBUG_OK_TO_RETURN_BEGIN(arg) {\n#define DEBUG_OK_TO_RETURN_END(arg) }\n\n#endif // defined(_DEBUG) && !defined(JIT_BUILD) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER > 190024315)\n\n#endif // !_PREFAST_\n\n#endif  // _DEBUGRETURN_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/dlwrap.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n//\n\n#ifndef _DLWRAP_H\n#define _DLWRAP_H\n\n//include this file if you get contract violation because of delayload\n\n//nothrow implementations\n\n#if defined(VER_H) && !defined (GetFileVersionInfoSizeW_NoThrow)\nDWORD\nGetFileVersionInfoSizeW_NoThrow(\n        LPCWSTR lptstrFilename, /* Filename of version stamped file */\n        LPDWORD lpdwHandle\n        );\n#endif\n\n#if defined(VER_H) && !defined (GetFileVersionInfoW_NoThrow)\nBOOL\nGetFileVersionInfoW_NoThrow(\n        LPCWSTR lptstrFilename, /* Filename of version stamped file */\n        DWORD dwHandle,         /* Information from GetFileVersionSize */\n        DWORD dwLen,            /* Length of buffer for info */\n        LPVOID lpData\n        );\n#endif\n\n#if defined(VER_H) && !defined (VerQueryValueW_NoThrow)\nBOOL\nVerQueryValueW_NoThrow(\n        const LPVOID pBlock,\n        LPCWSTR lpSubBlock,\n        LPVOID * lplpBuffer,\n        PUINT puLen\n        );\n#endif\n\n#if defined(_WININET_) && !defined (CreateUrlCacheEntryW_NoThrow)\n__success(return)\nBOOL\nCreateUrlCacheEntryW_NoThrow(\n        IN LPCWSTR lpszUrlName,\n        IN DWORD dwExpectedFileSize,\n        IN LPCWSTR lpszFileExtension,\n        _Out_writes_(MAX_LONGPATH+1) LPWSTR lpszFileName,\n        IN DWORD dwReserved\n        );\n#endif\n\n#if defined(_WININET_) && !defined (CommitUrlCacheEntryW_NoThrow)\nBOOL\nCommitUrlCacheEntryW_NoThrow(\n        IN LPCWSTR lpszUrlName,\n        IN LPCWSTR lpszLocalFileName,\n        IN FILETIME ExpireTime,\n        IN FILETIME LastModifiedTime,\n        IN DWORD CacheEntryType,\n        IN LPCWSTR lpHeaderInfo,\n        IN DWORD dwHeaderSize,\n        IN LPCWSTR lpszFileExtension,\n        IN LPCWSTR lpszOriginalUrl\n        );\n#endif\n\n#if defined(_WININET_) && !defined (InternetTimeToSystemTimeA_NoThrow)\nBOOL\nInternetTimeToSystemTimeA_NoThrow(\n        IN  LPCSTR lpszTime,         // NULL terminated string\n        OUT SYSTEMTIME *pst,         // output in GMT time\n        IN  DWORD dwReserved\n        );\n#endif\n\n#if defined(__urlmon_h__) && !defined(CoInternetCreateSecurityManager_NoThrow)\nHRESULT\nCoInternetCreateSecurityManager_NoThrow(\n        IServiceProvider *pSP,\n        IInternetSecurityManager **ppSM,\n        DWORD dwReserved\n        );\n#endif\n\n#if defined(__urlmon_h__) && !defined(URLDownloadToCacheFileW_NoThrow)\nHRESULT\nURLDownloadToCacheFileW_NoThrow(\n        LPUNKNOWN lpUnkcaller,\n        LPCWSTR szURL,\n        _Out_writes_(dwBufLength) LPWSTR szFileName,\n        DWORD dwBufLength,\n        DWORD dwReserved,\n        IBindStatusCallback *pBSC\n        );\n#endif\n\n#if defined(__urlmon_h__) && !defined(CoInternetGetSession_NoThrow)\nHRESULT\nCoInternetGetSession_NoThrow(\n        WORD dwSessionMode,\n        IInternetSession **ppIInternetSession,\n        DWORD dwReserved\n        );\n#endif\n\n#if defined(__urlmon_h__) && !defined(CopyBindInfo_NoThrow)\nHRESULT\nCopyBindInfo_NoThrow(\n        const BINDINFO * pcbiSrc, BINDINFO * pbiDest\n        );\n#endif\n\n\n\n//overrides\n#undef InternetTimeToSystemTimeA\n#undef CommitUrlCacheEntryW\n#undef HttpQueryInfoA\n#undef InternetCloseHandle\n#undef HttpSendRequestA\n#undef HttpOpenRequestA\n#undef InternetConnectA\n#undef InternetOpenA\n#undef InternetReadFile\n#undef CreateUrlCacheEntryW\n#undef CoInternetGetSession\n#undef CopyBindInfo\n#undef CoInternetCreateSecurityManager\n#undef URLDownloadToCacheFileW\n#undef FDICreate\n#undef FDIIsCabinet\n#undef FDICopy\n#undef FDIDestroy\n#undef VerQueryValueW\n#undef GetFileVersionInfoW\n#undef GetFileVersionInfoSizeW\n#undef VerQueryValueA\n#undef GetFileVersionInfoA\n#undef GetFileVersionInfoSizeA\n\n\n#define InternetTimeToSystemTimeA               InternetTimeToSystemTimeA_NoThrow\n#define CommitUrlCacheEntryW                        CommitUrlCacheEntryW_NoThrow\n#define CreateUrlCacheEntryW                        CreateUrlCacheEntryW_NoThrow\n#define CoInternetGetSession                          CoInternetGetSession_NoThrow\n#define CopyBindInfo                                        CopyBindInfo_NoThrow\n#define CoInternetCreateSecurityManager      CoInternetCreateSecurityManager_NoThrow\n#define URLDownloadToCacheFileW                 URLDownloadToCacheFileW_NoThrow\n#define VerQueryValueW                                  VerQueryValueW_NoThrow\n#define GetFileVersionInfoW                            GetFileVersionInfoW_NoThrow\n#define GetFileVersionInfoSizeW                     GetFileVersionInfoSizeW_NoThrow\n#define VerQueryValueA                                  Use_VerQueryValueW\n#define GetFileVersionInfoA                             Use_GetFileVersionInfoW\n#define GetFileVersionInfoSizeA                     Use_GetFileVersionInfoSizeW\n\n#if defined(_WININET_)\n    inline\n    HRESULT HrCreateUrlCacheEntryW(\n            IN LPCWSTR lpszUrlName,\n            IN DWORD dwExpectedFileSize,\n            IN LPCWSTR lpszFileExtension,\n            _Out_writes_(MAX_LONGPATH+1) LPWSTR lpszFileName,\n            IN DWORD dwReserved\n            )\n    {\n        if (!CreateUrlCacheEntryW(lpszUrlName, dwExpectedFileSize, lpszFileExtension, lpszFileName, dwReserved))\n        {\n            return HRESULT_FROM_WIN32(GetLastError());\n        }\n        else\n        {\n            return S_OK;\n        }\n    }\n\n    inline\n    HRESULT HrCommitUrlCacheEntryW(\n            IN LPCWSTR  lpszUrlName,\n            IN LPCWSTR  lpszLocalFileName,\n            IN FILETIME ExpireTime,\n            IN FILETIME LastModifiedTime,\n            IN DWORD    CacheEntryType,\n            IN LPCWSTR  lpHeaderInfo,\n            IN DWORD    dwHeaderSize,\n            IN LPCWSTR  lpszFileExtension,\n            IN LPCWSTR  lpszOriginalUrl\n            )\n    {\n        if (!CommitUrlCacheEntryW(lpszUrlName, lpszLocalFileName, ExpireTime, LastModifiedTime, CacheEntryType,\n                                  lpHeaderInfo, dwHeaderSize, lpszFileExtension, lpszOriginalUrl))\n        {\n            return HRESULT_FROM_WIN32(GetLastError());\n        }\n        else\n        {\n            return S_OK;\n        }\n    }\n#endif // defined(_WININET_)\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ecmakey.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n#pragma once\n\n// The byte values of the ECMA pseudo public key and its token.\nconst BYTE g_rbNeutralPublicKey[] = { 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0 };\nconst BYTE g_rbNeutralPublicKeyToken[] = { 0xb7, 0x7a, 0x5c, 0x56, 0x19, 0x34, 0xe0, 0x89 };\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/eetwain.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n//\n// EETwain.h\n//\n// This file has the definition of ICodeManager and EECodeManager.\n//\n// ICorJitCompiler compiles the IL of a method to native code, and stores\n// auxilliary data called as GCInfo (via ICorJitInfo::allocGCInfo()).\n// The data is used by the EE to manage the method's garbage collection,\n// exception handling, stack-walking etc.\n// This data can be parsed by an ICodeManager corresponding to that\n// ICorJitCompiler.\n//\n// EECodeManager is an implementation of ICodeManager for a default format\n// of GCInfo. Various ICorJitCompiler's are free to share this format so that\n// they do not need to provide their own implementation of ICodeManager\n// (though they are permitted to, if they want).\n//\n//*****************************************************************************\n\n#ifndef _EETWAIN_H\n#define _EETWAIN_H\n//*****************************************************************************\n\n#include <daccess.h>\n#include \"regdisp.h\"\n#include \"corjit.h\"     // For NativeVarInfo\n#include \"stackwalktypes.h\"\n#include \"bitvector.h\"\n#include \"gcinfotypes.h\"\n\n#if !defined(TARGET_X86)\n#define USE_GC_INFO_DECODER\n#endif\n\n#if (defined(TARGET_X86) && !defined(TARGET_UNIX)) || defined(TARGET_AMD64)\n#define HAS_QUICKUNWIND\n#endif\n\n#define CHECK_APP_DOMAIN    0\n\n#define NO_OVERRIDE_OFFSET (DWORD)-1\n\nstruct EHContext;\n\n#ifdef DACCESS_COMPILE\ntypedef struct _DAC_SLOT_LOCATION\n{\n    int reg;\n    int regOffset;\n    bool targetPtr;\n\n    _DAC_SLOT_LOCATION(int _reg, int _regOffset, bool _targetPtr)\n        : reg(_reg), regOffset(_regOffset), targetPtr(_targetPtr)\n    {\n    }\n} DacSlotLocation;\n#endif\n\ntypedef void (*GCEnumCallback)(\n    LPVOID          hCallback,      // callback data\n    OBJECTREF*      pObject,        // address of object-reference we are reporting\n    uint32_t        flags           // is this a pinned and/or interior pointer\n    DAC_ARG(DacSlotLocation loc)    // where the reference came from\n);\n\n/******************************************************************************\n  The stackwalker maintains some state on behalf of ICodeManager.\n*/\n\nconst int CODEMAN_STATE_SIZE = 512;\n\nstruct CodeManState\n{\n    DWORD       dwIsSet; // Is set to 0 by the stackwalk as appropriate\n    BYTE        stateBuf[CODEMAN_STATE_SIZE];\n};\n\n/******************************************************************************\n   These flags are used by some functions, although not all combinations might\n   make sense for all functions.\n*/\n\nenum ICodeManagerFlags\n{\n    ActiveStackFrame =  0x0001, // this is the currently active function\n    ExecutionAborted =  0x0002, // execution of this function has been aborted\n                                    // (i.e. it will not continue execution at the\n                                    // current location)\n    AbortingCall    =   0x0004, // The current call will never return\n    UpdateAllRegs   =   0x0008, // update full register set\n    CodeAltered     =   0x0010, // code of that function might be altered\n                                    // (e.g. by debugger), need to call EE\n                                    // for original code\n    SpeculativeStackwalk\n                    =   0x0020, // we're in the middle of a stackwalk seeded\n                                    // by an untrusted source (e.g., sampling profiler)\n\n    ParentOfFuncletStackFrame\n                    =   0x0040, // A funclet for this frame was previously reported\n    NoReportUntracked\n                    =   0x0080, // EnumGCRefs/EnumerateLiveSlots should *not* include\n                                // any untracked slots\n};\n\n//*****************************************************************************\n//\n// EECodeInfo is used by ICodeManager to get information about the\n// method whose GCInfo is being processed.\n// It is useful so that some information which is available elsewhere does\n// not need to be cached in the GCInfo.\n//\n\nclass EECodeInfo;\n\nenum GenericParamContextType\n{\n    GENERIC_PARAM_CONTEXT_NONE = 0,\n    GENERIC_PARAM_CONTEXT_THIS = 1,\n    GENERIC_PARAM_CONTEXT_METHODDESC = 2,\n    GENERIC_PARAM_CONTEXT_METHODTABLE = 3\n};\n\n//*****************************************************************************\n//\n// ICodeManager is the abstract class that all CodeManagers\n// must inherit from.  This will probably need to move into\n// cor.h and become a real com interface.\n//\n//*****************************************************************************\n\nclass ICodeManager\n{\n    VPTR_BASE_VTABLE_CLASS_AND_CTOR(ICodeManager)\n\npublic:\n\n/*\n    Last chance for the runtime support to do fixups in the context\n    before execution continues inside a filter, catch handler, or fault/finally\n*/\n\nenum ContextType\n{\n    FILTER_CONTEXT,\n    CATCH_CONTEXT,\n    FINALLY_CONTEXT\n};\n\n/* Type of funclet corresponding to a shadow stack-pointer */\n\nenum\n{\n    SHADOW_SP_IN_FILTER = 0x1,\n    SHADOW_SP_FILTER_DONE = 0x2,\n    SHADOW_SP_BITS = 0x3\n};\n\n#ifndef DACCESS_COMPILE\n#ifndef FEATURE_EH_FUNCLETS\nvirtual void FixContext(ContextType     ctxType,\n                        EHContext      *ctx,\n                        EECodeInfo     *pCodeInfo,\n                        DWORD           dwRelOffset,\n                        DWORD           nestingLevel,\n                        OBJECTREF       thrownObject,\n                        CodeManState   *pState,\n                        size_t       ** ppShadowSP,             // OUT\n                        size_t       ** ppEndRegion) = 0;       // OUT\n#endif // !FEATURE_EH_FUNCLETS\n#endif // #ifndef DACCESS_COMPILE\n\n#ifdef TARGET_X86\n/*\n    Gets the ambient stack pointer value at the given nesting level within\n    the method.\n*/\nvirtual TADDR GetAmbientSP(PREGDISPLAY     pContext,\n                           EECodeInfo     *pCodeInfo,\n                           DWORD           dwRelOffset,\n                           DWORD           nestingLevel,\n                           CodeManState   *pState) = 0;\n#endif // TARGET_X86\n\n/*\n    Get the number of bytes used for stack parameters.\n    This is currently only used on x86.\n*/\nvirtual ULONG32 GetStackParameterSize(EECodeInfo* pCodeInfo) = 0;\n\n/*\n    Unwind the current stack frame, i.e. update the virtual register\n    set in pContext. This will be similar to the state after the function\n    returns back to caller (IP points to after the call, Frame and Stack\n    pointer has been reset, callee-saved registers restored\n    (if UpdateAllRegs), callee-UNsaved registers are trashed)\n    Returns success of operation.\n*/\nvirtual bool UnwindStackFrame(PREGDISPLAY     pContext,\n                              EECodeInfo     *pCodeInfo,\n                              unsigned        flags,\n                              CodeManState   *pState,\n                              StackwalkCacheUnwindInfo  *pUnwindInfo) = 0;\n\n/*\n    Is the function currently at a \"GC safe point\" ?\n    Can call EnumGcRefs() successfully\n*/\nvirtual bool IsGcSafe(EECodeInfo     *pCodeInfo,\n                      DWORD           dwRelOffset) = 0;\n\n#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\nvirtual bool HasTailCalls(EECodeInfo *pCodeInfo) = 0;\n#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64\n\n#if defined(TARGET_AMD64) && defined(_DEBUG)\n/*\n    Locates the end of the last interruptible region in the given code range.\n    Returns 0 if the entire range is uninterruptible.  Returns the end point\n    if the entire range is interruptible.\n*/\nvirtual unsigned FindEndOfLastInterruptibleRegion(unsigned curOffset,\n                                                  unsigned endOffset,\n                                                  GCInfoToken gcInfoToken) = 0;\n#endif // TARGET_AMD64 && _DEBUG\n\n/*\n    Enumerate all live object references in that function using\n    the virtual register set. Same reference location cannot be enumerated\n    multiple times (but all differenct references pointing to the same\n    object have to be individually enumerated).\n    Returns success of operation.\n*/\nvirtual bool EnumGcRefs(PREGDISPLAY     pContext,\n                        EECodeInfo     *pCodeInfo,\n                        unsigned        flags,\n                        GCEnumCallback  pCallback,\n                        LPVOID          hCallBack,\n                        DWORD           relOffsetOverride = NO_OVERRIDE_OFFSET) = 0;\n\n/*\n    For a non-static method, \"this\" pointer is passed in as argument 0.\n    However, if there is a \"ldarga 0\" or \"starg 0\" in the IL,\n    JIT will create a copy of arg0 and redirect all \"ldarg(a) 0\" and \"starg 0\" to this copy.\n    (See Compiler::lvaArg0Var for more details.)\n\n    The following method returns the original \"this\" argument, i.e. the one that is passed in,\n    if it is a non-static method AND the object is still alive.\n    Returns NULL in all other cases.\n*/\nvirtual OBJECTREF GetInstance(PREGDISPLAY     pContext,\n                              EECodeInfo*     pCodeInfo) = 0;\n\n/*\n    Returns the extra argument passed to to shared generic code if it is still alive.\n    Returns NULL in all other cases.\n*/\nvirtual PTR_VOID GetParamTypeArg(PREGDISPLAY     pContext,\n                                 EECodeInfo *    pCodeInfo) = 0;\n\n// Returns the type of the context parameter (this, methodtable, methoddesc, or none)\nvirtual GenericParamContextType GetParamContextType(PREGDISPLAY     pContext,\n                                                    EECodeInfo *    pCodeInfo) = 0;\n\n/*\n    Returns the offset of the GuardStack cookie if it exists.\n    Returns NULL if there is no cookie.\n*/\nvirtual void * GetGSCookieAddr(PREGDISPLAY     pContext,\n                               EECodeInfo    * pCodeInfo,\n                               CodeManState  * pState) = 0;\n\n#ifndef USE_GC_INFO_DECODER\n/*\n  Returns true if the given IP is in the given method's prolog or an epilog.\n*/\nvirtual bool IsInPrologOrEpilog(DWORD  relPCOffset,\n                                GCInfoToken gcInfoToken,\n                                size_t* prologSize) = 0;\n\n/*\n  Returns true if the given IP is in the synchronized region of the method (valid for synchronized methods only)\n*/\nvirtual bool IsInSynchronizedRegion(\n                DWORD       relOffset,\n                GCInfoToken gcInfoToken,\n                unsigned    flags) = 0;\n#endif // !USE_GC_INFO_DECODER\n\n/*\n  Returns the size of a given function as reported in the GC info (does\n  not take procedure splitting into account).  For the actual size of\n  the hot region call IJitManager::JitTokenToMethodHotSize.\n*/\nvirtual size_t GetFunctionSize(GCInfoToken gcInfoToken) = 0;\n\n/*\n*  Get information necessary for return address hijacking of the method represented by the gcInfoToken.\n*  If it can be hijacked, it sets the returnKind output parameter to the kind of the return value and\n*  returns true.\n*  If hijacking is not possible for some reason, it return false.\n*/\nvirtual bool GetReturnAddressHijackInfo(GCInfoToken gcInfoToken, ReturnKind * returnKind) = 0;\n\n#ifndef USE_GC_INFO_DECODER\n/*\n  Returns the size of the frame (barring localloc)\n*/\nvirtual unsigned int GetFrameSize(GCInfoToken gcInfoToken) = 0;\n#endif // USE_GC_INFO_DECODER\n\n#ifndef DACCESS_COMPILE\n\n/* Debugger API */\n\n#ifndef FEATURE_EH_FUNCLETS\nvirtual const BYTE*     GetFinallyReturnAddr(PREGDISPLAY pReg)=0;\n\nvirtual BOOL            IsInFilter(GCInfoToken gcInfoToken,\n                                   unsigned offset,\n                                   PCONTEXT pCtx,\n                                   DWORD curNestLevel) = 0;\n\nvirtual BOOL            LeaveFinally(GCInfoToken gcInfoToken,\n                                     unsigned offset,\n                                     PCONTEXT pCtx) = 0;\n\nvirtual void            LeaveCatch(GCInfoToken gcInfoToken,\n                                   unsigned offset,\n                                   PCONTEXT pCtx)=0;\n#endif // FEATURE_EH_FUNCLETS\n\n#ifdef EnC_SUPPORTED\n\n/*\n    Last chance for the runtime support to do fixups in the context\n    before execution continues inside an EnC updated function.\n*/\n\nvirtual HRESULT FixContextForEnC(PCONTEXT        pCtx,\n                                    EECodeInfo    * pOldCodeInfo,\n               const ICorDebugInfo::NativeVarInfo * oldMethodVars,\n                                    SIZE_T          oldMethodVarsCount,\n                                    EECodeInfo    * pNewCodeInfo,\n               const ICorDebugInfo::NativeVarInfo * newMethodVars,\n                                    SIZE_T          newMethodVarsCount) = 0;\n\n#endif // EnC_SUPPORTED\n\n#endif // #ifndef DACCESS_COMPILE\n\n\n#ifdef DACCESS_COMPILE\n    virtual void EnumMemoryRegions(CLRDataEnumMemoryFlags flags) = 0;\n#endif\n};\n\n//*****************************************************************************\n//\n// EECodeManager is the EE's implementation of the ICodeManager which\n// supports the default format of GCInfo.\n//\n//*****************************************************************************\n\nstruct hdrInfo;\n\nclass EECodeManager : public ICodeManager {\n\n    VPTR_VTABLE_CLASS_AND_CTOR(EECodeManager, ICodeManager)\n\npublic:\n\n\n#ifndef DACCESS_COMPILE\n#ifndef FEATURE_EH_FUNCLETS\n/*\n    Last chance for the runtime support to do fixups in the context\n    before execution continues inside a filter, catch handler, or finally\n*/\nvirtual\nvoid FixContext(ContextType     ctxType,\n                EHContext      *ctx,\n                EECodeInfo     *pCodeInfo,\n                DWORD           dwRelOffset,\n                DWORD           nestingLevel,\n                OBJECTREF       thrownObject,\n                CodeManState   *pState,\n                size_t       ** ppShadowSP,             // OUT\n                size_t       ** ppEndRegion);           // OUT\n#endif // !FEATURE_EH_FUNCLETS\n#endif // #ifndef DACCESS_COMPILE\n\n#ifdef TARGET_X86\n/*\n    Gets the ambient stack pointer value at the given nesting level within\n    the method.\n*/\nvirtual\nTADDR GetAmbientSP(PREGDISPLAY     pContext,\n                   EECodeInfo     *pCodeInfo,\n                   DWORD           dwRelOffset,\n                   DWORD           nestingLevel,\n                   CodeManState   *pState);\n#endif // TARGET_X86\n\n/*\n    Get the number of bytes used for stack parameters.\n    This is currently only used on x86.\n*/\nvirtual\nULONG32 GetStackParameterSize(EECodeInfo* pCodeInfo);\n\n/*\n    Unwind the current stack frame, i.e. update the virtual register\n    set in pContext. This will be similar to the state after the function\n    returns back to caller (IP points to after the call, Frame and Stack\n    pointer has been reset, callee-saved registers restored\n    (if UpdateAllRegs), callee-UNsaved registers are trashed)\n    Returns success of operation.\n*/\nvirtual\nbool UnwindStackFrame(\n                PREGDISPLAY     pContext,\n                EECodeInfo     *pCodeInfo,\n                unsigned        flags,\n                CodeManState   *pState,\n                StackwalkCacheUnwindInfo  *pUnwindInfo);\n\n#ifdef HAS_QUICKUNWIND\nenum QuickUnwindFlag\n{\n    UnwindCurrentStackFrame,\n    EnsureCallerStackFrameIsValid\n};\n\n/*\n  *  Light unwind the current stack frame, using provided cache entry.\n  *  only pPC and Esp of pContext are updated. And pEbp if necessary.\n  */\n\nstatic\nvoid QuickUnwindStackFrame(\n             PREGDISPLAY pRD,\n             StackwalkCacheEntry *pCacheEntry,\n             QuickUnwindFlag flag);\n#endif // HAS_QUICKUNWIND\n\n/*\n    Is the function currently at a \"GC safe point\" ?\n    Can call EnumGcRefs() successfully\n*/\nvirtual\nbool IsGcSafe(  EECodeInfo     *pCodeInfo,\n                DWORD           dwRelOffset);\n\n#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\nvirtual\nbool HasTailCalls(EECodeInfo *pCodeInfo);\n#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64\n\n#if defined(TARGET_AMD64) && defined(_DEBUG)\n/*\n    Locates the end of the last interruptible region in the given code range.\n    Returns 0 if the entire range is uninterruptible.  Returns the end point\n    if the entire range is interruptible.\n*/\nvirtual\nunsigned FindEndOfLastInterruptibleRegion(unsigned curOffset,\n                                          unsigned endOffset,\n                                          GCInfoToken gcInfoToken);\n#endif // TARGET_AMD64 && _DEBUG\n\n/*\n    Enumerate all live object references in that function using\n    the virtual register set. Same reference location cannot be enumerated\n    multiple times (but all differenct references pointing to the same\n    object have to be individually enumerated).\n    Returns success of operation.\n*/\nvirtual\nbool EnumGcRefs(PREGDISPLAY     pContext,\n                EECodeInfo     *pCodeInfo,\n                unsigned        flags,\n                GCEnumCallback  pCallback,\n                LPVOID          hCallBack,\n                DWORD           relOffsetOverride = NO_OVERRIDE_OFFSET);\n\n#ifdef FEATURE_CONSERVATIVE_GC\n// Temporary conservative collection, for testing purposes, until we have\n// accurate gc info from the JIT.\nbool EnumGcRefsConservative(PREGDISPLAY     pRD,\n                            EECodeInfo     *pCodeInfo,\n                            unsigned        flags,\n                            GCEnumCallback  pCallBack,\n                            LPVOID          hCallBack);\n#endif // FEATURE_CONSERVATIVE_GC\n\nvirtual\nOBJECTREF GetInstance(\n                PREGDISPLAY     pContext,\n                EECodeInfo *    pCodeInfo);\n\n/*\n    Returns the extra argument passed to to shared generic code if it is still alive.\n    Returns NULL in all other cases.\n*/\nvirtual\nPTR_VOID GetParamTypeArg(PREGDISPLAY     pContext,\n                         EECodeInfo *    pCodeInfo);\n\n// Returns the type of the context parameter (this, methodtable, methoddesc, or none)\nvirtual GenericParamContextType GetParamContextType(PREGDISPLAY     pContext,\n                                                    EECodeInfo *    pCodeInfo);\n\n#if defined(FEATURE_EH_FUNCLETS) && defined(USE_GC_INFO_DECODER)\n/*\n    Returns the generics token.  This is used by GetInstance() and GetParamTypeArg() on WIN64.\n*/\nstatic\nPTR_VOID GetExactGenericsToken(PREGDISPLAY     pContext,\n                               EECodeInfo *    pCodeInfo);\n\nstatic\nPTR_VOID GetExactGenericsToken(SIZE_T          baseStackSlot,\n                               EECodeInfo *    pCodeInfo);\n\n\n#endif // FEATURE_EH_FUNCLETS && USE_GC_INFO_DECODER\n\n/*\n    Returns the offset of the GuardStack cookie if it exists.\n    Returns NULL if there is no cookie.\n*/\nvirtual\nvoid * GetGSCookieAddr(PREGDISPLAY     pContext,\n                       EECodeInfo    * pCodeInfo,\n                       CodeManState  * pState);\n\n\n#ifndef USE_GC_INFO_DECODER\n/*\n  Returns true if the given IP is in the given method's prolog or an epilog.\n*/\nvirtual\nbool IsInPrologOrEpilog(\n                DWORD       relOffset,\n                GCInfoToken gcInfoToken,\n                size_t*     prologSize);\n\n/*\n  Returns true if the given IP is in the synchronized region of the method (valid for synchronized functions only)\n*/\nvirtual\nbool IsInSynchronizedRegion(\n                DWORD       relOffset,\n                GCInfoToken gcInfoToken,\n                unsigned    flags);\n#endif // !USE_GC_INFO_DECODER\n\n/*\n  Returns the size of a given function.\n*/\nvirtual\nsize_t GetFunctionSize(GCInfoToken gcInfoToken);\n\n/*\n*  Get information necessary for return address hijacking of the method represented by the gcInfoToken.\n*  If it can be hijacked, it sets the returnKind output parameter to the kind of the return value and\n*  returns true.\n*  If hijacking is not possible for some reason, it return false.\n*/\nvirtual bool GetReturnAddressHijackInfo(GCInfoToken gcInfoToken, ReturnKind * returnKind);\n\n#ifndef USE_GC_INFO_DECODER\n/*\n  Returns the size of the frame (barring localloc)\n*/\nvirtual\nunsigned int GetFrameSize(GCInfoToken gcInfoToken);\n#endif // USE_GC_INFO_DECODER\n\n#ifndef DACCESS_COMPILE\n\n#ifndef FEATURE_EH_FUNCLETS\nvirtual const BYTE* GetFinallyReturnAddr(PREGDISPLAY pReg);\nvirtual BOOL IsInFilter(GCInfoToken gcInfoToken,\n                        unsigned offset,\n                        PCONTEXT pCtx,\n                          DWORD curNestLevel);\nvirtual BOOL LeaveFinally(GCInfoToken gcInfoToken,\n                          unsigned offset,\n                          PCONTEXT pCtx);\nvirtual void LeaveCatch(GCInfoToken gcInfoToken,\n                         unsigned offset,\n                         PCONTEXT pCtx);\n#endif // FEATURE_EH_FUNCLETS\n\n#ifdef EnC_SUPPORTED\n/*\n    Last chance for the runtime support to do fixups in the context\n    before execution continues inside an EnC updated function.\n*/\nvirtual\nHRESULT FixContextForEnC(PCONTEXT        pCtx,\n                            EECodeInfo    * pOldCodeInfo,\n       const ICorDebugInfo::NativeVarInfo * oldMethodVars,\n                            SIZE_T          oldMethodVarsCount,\n                            EECodeInfo    * pNewCodeInfo,\n       const ICorDebugInfo::NativeVarInfo * newMethodVars,\n                            SIZE_T          newMethodVarsCount);\n#endif // EnC_SUPPORTED\n\n#endif // #ifndef DACCESS_COMPILE\n\n#ifdef FEATURE_EH_FUNCLETS\n    static void EnsureCallerContextIsValid( PREGDISPLAY pRD, StackwalkCacheEntry* pCacheEntry, EECodeInfo * pCodeInfo = NULL );\n    static size_t GetCallerSp( PREGDISPLAY  pRD );\n#ifdef TARGET_X86\n    static size_t GetResumeSp( PCONTEXT  pContext );\n#endif // TARGET_X86\n#endif // FEATURE_EH_FUNCLETS\n\n#ifdef DACCESS_COMPILE\n    virtual void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);\n#endif\n\n};\n\n#ifdef TARGET_X86\nbool UnwindStackFrame(PREGDISPLAY     pContext,\n                      EECodeInfo     *pCodeInfo,\n                      unsigned        flags,\n                      CodeManState   *pState,\n                      StackwalkCacheUnwindInfo  *pUnwindInfo);\n\nsize_t DecodeGCHdrInfo(GCInfoToken gcInfoToken,\n                       unsigned    curOffset,\n                       hdrInfo   * infoPtr);\n#endif\n\n/*****************************************************************************\n <TODO>ToDo: Do we want to include JIT/IL/target.h? </TODO>\n */\n\nenum regNum\n{\n        REGI_EAX, REGI_ECX, REGI_EDX, REGI_EBX,\n        REGI_ESP, REGI_EBP, REGI_ESI, REGI_EDI,\n        REGI_COUNT,\n        REGI_NA = REGI_COUNT\n};\n\n/*****************************************************************************\n Register masks\n */\n\nenum RegMask\n{\n    RM_EAX = 0x01,\n    RM_ECX = 0x02,\n    RM_EDX = 0x04,\n    RM_EBX = 0x08,\n    RM_ESP = 0x10,\n    RM_EBP = 0x20,\n    RM_ESI = 0x40,\n    RM_EDI = 0x80,\n\n    RM_NONE = 0x00,\n    RM_ALL = (RM_EAX|RM_ECX|RM_EDX|RM_EBX|RM_ESP|RM_EBP|RM_ESI|RM_EDI),\n    RM_CALLEE_SAVED = (RM_EBP|RM_EBX|RM_ESI|RM_EDI),\n    RM_CALLEE_TRASHED = (RM_ALL & ~RM_CALLEE_SAVED),\n};\n\n/*****************************************************************************\n *\n *  Helper to extract basic info from a method info block.\n */\n\nstruct hdrInfo\n{\n    unsigned int        methodSize;     // native code bytes\n    unsigned int        argSize;        // in bytes\n    unsigned int        stackSize;      // including callee saved registers\n    unsigned int        rawStkSize;     // excluding callee saved registers\n    ReturnKind          returnKind;     // The ReturnKind for this method.\n\n    unsigned int        prologSize;\n\n    // Size of the epilogs in the method.\n    // For methods which use CEE_JMP, some epilogs may end with a \"ret\" instruction\n    // and some may end with a \"jmp\". The epilogSize reported should be for the\n    // epilog with the smallest size.\n    unsigned int        epilogSize;\n\n    unsigned char       epilogCnt;\n    bool                epilogEnd;      // is the epilog at the end of the method\n\n    bool                ebpFrame;       // locals and arguments addressed relative to EBP\n    bool                doubleAlign;    // is the stack double-aligned? locals addressed relative to ESP, and arguments relative to EBP\n    bool                interruptible;  // intr. at all times (excluding prolog/epilog), not just call sites\n\n    bool                handlers;       // has callable handlers\n    bool                localloc;       // uses localloc\n    bool                editNcontinue;  // has been compiled in EnC mode\n    bool                varargs;        // is this a varargs routine\n    bool                profCallbacks;  // does the method have Enter-Leave callbacks\n    bool                genericsContext;// has a reported generic context parameter\n    bool                genericsContextIsMethodDesc;// reported generic context parameter is methoddesc\n    bool                isSpeculativeStackWalk; // is the stackwalk seeded by an untrusted source (e.g., sampling profiler)?\n\n    // These always includes EBP for EBP-frames and double-aligned-frames\n    RegMask             savedRegMask:8; // which callee-saved regs are saved on stack\n\n    // Count of the callee-saved registers, excluding the frame pointer.\n    // This does not include EBP for EBP-frames and double-aligned-frames.\n    unsigned int        savedRegsCountExclFP;\n\n    unsigned int        untrackedCnt;\n    unsigned int        varPtrTableSize;\n    unsigned int        argTabOffset;   // INVALID_ARGTAB_OFFSET if argtab must be reached by stepping through ptr tables\n    unsigned int        gsCookieOffset; // INVALID_GS_COOKIE_OFFSET if there is no GuardStack cookie\n\n    unsigned int        syncStartOffset; // start/end code offset of the protected region in synchronized methods.\n    unsigned int        syncEndOffset;   // INVALID_SYNC_OFFSET if there not synchronized method\n    unsigned int        syncEpilogStart; // The start of the epilog. Synchronized methods are guaranteed to have no more than one epilog.\n    unsigned int        revPInvokeOffset; // INVALID_REV_PINVOKE_OFFSET if there is no Reverse PInvoke frame\n\n    enum { NOT_IN_PROLOG = -1, NOT_IN_EPILOG = -1 };\n\n    int                 prologOffs;     // NOT_IN_PROLOG if not in prolog\n    int                 epilogOffs;     // NOT_IN_EPILOG if not in epilog. It is never 0\n\n    //\n    // Results passed back from scanArgRegTable\n    //\n    regNum              thisPtrResult;  // register holding \"this\"\n    RegMask             regMaskResult;  // registers currently holding GC ptrs\n    RegMask            iregMaskResult;  // iptr qualifier for regMaskResult\n    unsigned            argHnumResult;\n    PTR_CBYTE            argTabResult;  // Table of encoded offsets of pending ptr args\n    unsigned              argTabBytes;  // Number of bytes in argTabResult[]\n\n    // These next two are now large structs (i.e 132 bytes each)\n\n    ptrArgTP            argMaskResult;  // pending arguments mask\n    ptrArgTP           iargMaskResult;  // iptr qualifier for argMaskResult\n};\n\n/*****************************************************************************\n  How the stackwalkers buffer will be interpreted\n*/\n\nstruct CodeManStateBuf\n{\n    DWORD       hdrInfoSize;\n    hdrInfo     hdrInfoBody;\n};\n//*****************************************************************************\n#endif // _EETWAIN_H\n//*****************************************************************************\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/eexcp.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __eexcp_h__\n#define __eexcp_h__\n\n#include \"corhlpr.h\"\n#include \"daccess.h\"\n\nstruct EE_ILEXCEPTION_CLAUSE;\ntypedef DPTR(EE_ILEXCEPTION_CLAUSE) PTR_EE_ILEXCEPTION_CLAUSE;\n\n// The exception handling sub-system needs to keep track of EH clause that is handling given exception.\n// PTR_EXCEPTION_CLAUSE_TOKEN is opaque pointer that uniquely identifies\n// exception handling clause. It abstracts away encoding differences of EH clauses between JIT and NGen.\ntypedef PTR_VOID PTR_EXCEPTION_CLAUSE_TOKEN;\n\nstruct EE_ILEXCEPTION_CLAUSE  {\n    //Flags is not marked as volatile since it is always accessed\n    //    from within a critical section\n    CorExceptionFlag    Flags;\n    DWORD               TryStartPC;\n    DWORD               TryEndPC;\n    DWORD               HandlerStartPC;\n    DWORD               HandlerEndPC;\n    union {\n        void*           TypeHandle;\n        mdToken         ClassToken;\n        DWORD           FilterOffset;\n    };\n};\n\nstruct EE_ILEXCEPTION;\ntypedef DPTR(EE_ILEXCEPTION) PTR_EE_ILEXCEPTION;\n\nstruct EE_ILEXCEPTION : public COR_ILMETHOD_SECT_FAT\n{\n    EE_ILEXCEPTION_CLAUSE Clauses[1];     // actually variable size\n\n    void Init(unsigned ehCount)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        SetKind(CorILMethod_Sect_FatFormat);\n        SetDataSize((unsigned)sizeof(EE_ILEXCEPTION_CLAUSE) * ehCount);\n    }\n\n    unsigned EHCount() const\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GetDataSize() / (DWORD) sizeof(EE_ILEXCEPTION_CLAUSE);\n    }\n\n    static unsigned Size(unsigned ehCount)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        _ASSERTE(ehCount > 0);\n\n        return (offsetof(EE_ILEXCEPTION, Clauses) + sizeof(EE_ILEXCEPTION_CLAUSE) * ehCount);\n    }\n    EE_ILEXCEPTION_CLAUSE *EHClause(unsigned i)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n        return &(PTR_EE_ILEXCEPTION_CLAUSE(PTR_HOST_MEMBER_TADDR(EE_ILEXCEPTION,this,Clauses))[i]);\n    }\n};\n\n#define COR_ILEXCEPTION_CLAUSE_CACHED_CLASS     0x10000000\n\ninline BOOL HasCachedTypeHandle(EE_ILEXCEPTION_CLAUSE *EHClause)\n{\n    _ASSERTE(sizeof(EHClause->Flags) == sizeof(DWORD));\n    return (EHClause->Flags & COR_ILEXCEPTION_CLAUSE_CACHED_CLASS);\n}\n\ninline void SetHasCachedTypeHandle(EE_ILEXCEPTION_CLAUSE *EHClause)\n{\n    _ASSERTE(! HasCachedTypeHandle(EHClause));\n    EHClause->Flags = (CorExceptionFlag)(EHClause->Flags | COR_ILEXCEPTION_CLAUSE_CACHED_CLASS);\n}\n\ninline BOOL IsFinally(EE_ILEXCEPTION_CLAUSE *EHClause)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (EHClause->Flags & COR_ILEXCEPTION_CLAUSE_FINALLY);\n}\n\ninline BOOL IsFault(EE_ILEXCEPTION_CLAUSE *EHClause)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (EHClause->Flags & COR_ILEXCEPTION_CLAUSE_FAULT);\n}\n\ninline BOOL IsFaultOrFinally(EE_ILEXCEPTION_CLAUSE *EHClause)\n{\n    return IsFault(EHClause) || IsFinally(EHClause);\n}\n\ninline BOOL IsFilterHandler(EE_ILEXCEPTION_CLAUSE *EHClause)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return EHClause->Flags & COR_ILEXCEPTION_CLAUSE_FILTER;\n}\n\ninline BOOL IsTypedHandler(EE_ILEXCEPTION_CLAUSE *EHClause)\n{\n    return ! (IsFilterHandler(EHClause) || IsFaultOrFinally(EHClause));\n}\n\ninline BOOL IsDuplicateClause(EE_ILEXCEPTION_CLAUSE* pEHClause)\n{\n    return pEHClause->Flags & COR_ILEXCEPTION_CLAUSE_DUPLICATED;\n}\n\n#if defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n// Finally is the only EH construct that can be part of the execution as being fall-through.\n//\n// \"Cloned\" finally is a construct that represents a finally block that is used as\n// fall through for normal try-block execution. Such a \"cloned\" finally will:\n//\n// 1) Have its try-clause's Start and End PC the same as its handler's start PC (i.e. will have\n//    zero length try block), AND\n// 2) Is marked duplicate\n//\n// Because of their fall-through nature, JIT guarantees that only finally constructs can be cloned,\n// and not catch or fault (since they cannot be fallen through but are invoked as funclets).\n//\n// The cloned finally construct is also used to mark \"call to finally\" thunks that are not within\n// the EH region protected by the finally, and also not within the enclosing region. This is done\n// to prevent ThreadAbortException from creating an infinite loop of calling the same finally.\ninline BOOL IsClonedFinally(EE_ILEXCEPTION_CLAUSE* pEHClause)\n{\n    return ((pEHClause->TryStartPC == pEHClause->TryEndPC) &&\n            (pEHClause->TryStartPC == pEHClause->HandlerStartPC) &&\n            IsFinally(pEHClause) && IsDuplicateClause(pEHClause));\n}\n#endif // defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n\n#endif // __eexcp_h__\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/eventtrace.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// File: eventtrace.h\n// Abstract: This module implements Event Tracing support.  This includes\n// eventtracebase.h, and adds VM-specific ETW helpers to support features like type\n// logging, allocation logging, and gc heap walk logging.\n//\n\n//\n\n//\n//\n// #EventTracing\n// Windows\n// ETW (Event Tracing for Windows) is a high-performance, low overhead and highly scalable\n// tracing facility provided by the Windows Operating System. ETW is available on Win2K and above. There are\n// four main types of components in ETW: event providers, controllers, consumers, and event trace sessions.\n// An event provider is a logical entity that writes events to ETW sessions. The event provider must register\n// a provider ID with ETW through the registration API. A provider first registers with ETW and writes events\n// from various points in the code by invoking the ETW logging API. When a provider is enabled dynamically by\n// the ETW controller application, calls to the logging API sends events to a specific trace session\n// designated by the controller. Each event sent by the event provider to the trace session consists of a\n// fixed header that includes event metadata and additional variable user-context data. CLR is an event\n// provider.\n\n// Mac\n// DTrace is similar to ETW and has been made to look like ETW at most of the places.\n// For convenience, it is called ETM (Event Tracing for Mac) and exists only on the Mac Leopard OS\n// ============================================================================\n\n#ifndef _VMEVENTTRACE_H_\n#define _VMEVENTTRACE_H_\n\n#include \"eventtracebase.h\"\n#include \"gcinterface.h\"\n\n#if defined(GC_PROFILING) || defined(FEATURE_EVENT_TRACE)\nstruct ProfilingScanContext : ScanContext\n{\n    BOOL fProfilerPinned;\n    void * pvEtwContext;\n    void *pHeapId;\n\n    ProfilingScanContext(BOOL fProfilerPinnedParam) : ScanContext()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        pHeapId = NULL;\n        fProfilerPinned = fProfilerPinnedParam;\n        pvEtwContext = NULL;\n#ifdef FEATURE_CONSERVATIVE_GC\n        // To not confuse GCScan::GcScanRoots\n        promotion = g_pConfig->GetGCConservative();\n#endif\n    }\n};\n#endif // defined(GC_PROFILING) || defined(FEATURE_EVENT_TRACE)\n\n#ifndef FEATURE_NATIVEAOT\n\nnamespace ETW\n{\n    class LoggedTypesFromModule;\n\n    // We keep a hash of these to keep track of:\n    //     * Which types have been logged through ETW (so we can avoid logging dupe Type\n    //         events), and\n    //     * GCSampledObjectAllocation stats to help with \"smart sampling\" which\n    //         dynamically adjusts sampling rate of objects by type.\n    // See code:LoggedTypesFromModuleTraits\n    struct TypeLoggingInfo\n    {\n    public:\n        TypeLoggingInfo(TypeHandle thParam)\n        {\n            Init(thParam);\n        }\n\n        TypeLoggingInfo()\n        {\n            Init(TypeHandle());\n        }\n\n        void Init(TypeHandle thParam)\n        {\n            th = thParam;\n            dwTickOfCurrentTimeBucket = 0;\n            dwAllocCountInCurrentBucket = 0;\n            flAllocPerMSec = 0;\n\n            dwAllocsToSkipPerSample = 0;\n            dwAllocsSkippedForSample = 0;\n            cbIgnoredSizeForSample = 0;\n        };\n\n        // The type this TypeLoggingInfo represents\n        TypeHandle th;\n\n        // Smart sampling\n\n        // These bucket values remember stats of a particular time slice that are used to\n        // help adjust the sampling rate\n        DWORD dwTickOfCurrentTimeBucket;\n        DWORD dwAllocCountInCurrentBucket;\n        float flAllocPerMSec;\n\n        // The number of data points to ignore before taking a \"sample\" (i.e., logging a\n        // GCSampledObjectAllocation ETW event for this type)\n        DWORD dwAllocsToSkipPerSample;\n\n        // The current number of data points actually ignored for the current sample\n        DWORD dwAllocsSkippedForSample;\n\n        // The current count of bytes of objects of this type actually allocated (and\n        // ignored) for the current sample\n        SIZE_T cbIgnoredSizeForSample;\n    };\n\n    // Class to wrap all type system logic for ETW\n    class TypeSystemLog\n    {\n    private:\n        // Global type hash\n        static AllLoggedTypes *s_pAllLoggedTypes;\n\n        // An unsigned value that gets incremented whenever a global change is made.\n        // When this occurs, threads must synchronize themselves with the global state.\n        // Examples include unloading of modules and disabling of allocation sampling.\n        static unsigned int s_nEpoch;\n\n        // See code:ETW::TypeSystemLog::PostRegistrationInit\n        static BOOL s_fHeapAllocEventEnabledOnStartup;\n        static BOOL s_fHeapAllocHighEventEnabledNow;\n        static BOOL s_fHeapAllocLowEventEnabledNow;\n\n        // If DOTNET_UNSUPPORTED_ETW_ObjectAllocationEventsPerTypePerSec is set, then\n        // this is used to determine the event frequency, overriding\n        // s_nDefaultMsBetweenEvents above (regardless of which\n        // GCSampledObjectAllocation*Keyword was used)\n        static int s_nCustomMsBetweenEvents;\n\n    public:\n        // This customizes the type logging behavior in LogTypeAndParametersIfNecessary\n        enum TypeLogBehavior\n        {\n            // Take lock, and consult hash table to see if this is the first time we've\n            // encountered the type, in which case, log it\n            kTypeLogBehaviorTakeLockAndLogIfFirstTime,\n\n            // Don't take lock, don't consult hash table. Just log the type. (This is\n            // used in cases when checking for dupe type logging isn't worth it, such as\n            // when logging the finalization of an object.)\n            kTypeLogBehaviorAlwaysLog,\n\n            // When logging the type for GCSampledObjectAllocation events,\n            // we already know we need to log the type (since we already\n            // looked it up in the hash).  But we would still need to consult the hash\n            // for any type parameters, so kTypeLogBehaviorAlwaysLog isn't appropriate,\n            // and this is used instead.\n            kTypeLogBehaviorAlwaysLogTopLevelType,\n        };\n\n        static HRESULT PreRegistrationInit();\n        static void PostRegistrationInit();\n        static BOOL IsHeapAllocEventEnabled();\n        static void SendObjectAllocatedEvent(Object * pObject);\n        static CrstBase * GetHashCrst();\n        static VOID LogTypeAndParametersIfNecessary(BulkTypeEventLogger * pBulkTypeEventLogger, ULONGLONG thAsAddr, TypeLogBehavior typeLogBehavior);\n        static VOID OnModuleUnload(Module * pModule);\n        static void OnKeywordsChanged();\n        static void Cleanup();\n        static VOID DeleteTypeHashNoLock(AllLoggedTypes **ppAllLoggedTypes);\n        static VOID FlushObjectAllocationEvents();\n        static UINT32 TypeLoadBegin();\n        static VOID TypeLoadEnd(UINT32 typeLoad, TypeHandle th, UINT16 loadLevel);\n\n    private:\n        static BOOL ShouldLogType(TypeHandle th);\n        static TypeLoggingInfo LookupOrCreateTypeLoggingInfo(TypeHandle th, BOOL * pfCreatedNew, LoggedTypesFromModule ** ppLoggedTypesFromModule = NULL);\n        static BOOL AddTypeToGlobalCacheIfNotExists(TypeHandle th, BOOL * pfCreatedNew);\n        static BOOL AddOrReplaceTypeLoggingInfo(ETW::LoggedTypesFromModule * pLoggedTypesFromModule, const ETW::TypeLoggingInfo * pTypeLoggingInfo);\n        static int GetDefaultMsBetweenEvents();\n        static VOID OnTypesKeywordTurnedOff();\n    };\n\n#endif // FEATURE_NATIVEAOT\n\n\n    // Class to wrap all GC logic for ETW\n    class GCLog\n    {\n    private:\n        // When WPA triggers a GC, it gives us this unique number to append to our\n        // GCStart event so WPA can correlate the CLR's GC with the JScript GC they\n        // triggered at the same time.\n        //\n        // We set this value when the GC is triggered, and then retrieve the value on the\n        // first subsequent FireGcStart() method call for a full, induced GC, assuming\n        // that that's the GC that WPA triggered. This is imperfect, and if we were in\n        // the act of beginning another full, induced GC (for some other reason), then\n        // we'll attach this sequence number to that GC instead of to the WPA-induced GC,\n        // but who cares? When parsing ETW logs later on, it's indistinguishable if both\n        // GCs really were induced at around the same time.\n#ifdef FEATURE_NATIVEAOT\n        static volatile LONGLONG s_l64LastClientSequenceNumber;\n#else // FEATURE_NATIVEAOT\n        static Volatile<LONGLONG> s_l64LastClientSequenceNumber;\n#endif // FEATURE_NATIVEAOT\n\n    public:\n        typedef union st_GCEventInfo {\n            // These values are gotten from the gc_reason\n            // in gcimpl.h\n            typedef  enum _GC_REASON {\n                GC_ALLOC_SOH = 0,\n                GC_INDUCED = 1,\n                GC_LOWMEMORY = 2,\n                GC_EMPTY = 3,\n                GC_ALLOC_LOH = 4,\n                GC_OOS_SOH = 5,\n                GC_OOS_LOH = 6,\n                GC_INDUCED_NOFORCE = 7,\n                GC_GCSTRESS = 8,\n                GC_LOWMEMORY_BLOCKING = 9,\n                GC_INDUCED_COMPACTING = 10,\n                GC_LOWMEMORY_HOST = 11\n            } GC_REASON;\n            typedef  enum _GC_TYPE {\n                GC_NGC = 0,\n                GC_BGC = 1,\n                GC_FGC = 2\n            } GC_TYPE;\n            struct {\n                ULONG Count;\n                ULONG Depth;\n                GC_REASON Reason;\n                GC_TYPE Type;\n            } GCStart;\n            struct {\n                ULONG Reason;\n                // This is only valid when SuspendEE is called by GC (ie, Reason is either\n                // SUSPEND_FOR_GC or SUSPEND_FOR_GC_PREP.\n                ULONG GcCount;\n            } SuspendEE;\n            struct {\n                ULONGLONG SegmentSize;\n                ULONGLONG LargeObjectSegmentSize;\n                BOOL ServerGC; // TRUE means it's server GC; FALSE means it's workstation.\n            } GCSettings;\n        } ETW_GC_INFO, *PETW_GC_INFO;\n\n#ifdef FEATURE_EVENT_TRACE\n        static VOID GCSettingsEvent();\n#else\n        static VOID GCSettingsEvent() {};\n#endif // FEATURE_EVENT_TRACE\n\n        static BOOL ShouldWalkHeapObjectsForEtw();\n        static BOOL ShouldWalkHeapRootsForEtw();\n        static BOOL ShouldTrackMovementForEtw();\n        static HRESULT ForceGCForDiagnostics();\n        static VOID ForceGC(LONGLONG l64ClientSequenceNumber);\n        static VOID FireGcStart(ETW_GC_INFO * pGcInfo);\n        static VOID RootReference(\n            LPVOID pvHandle,\n            Object * pRootedNode,\n            Object * pSecondaryNodeForDependentHandle,\n            BOOL fDependentHandle,\n            ProfilingScanContext * profilingScanContext,\n            DWORD dwGCFlags,\n            DWORD rootFlags);\n        static VOID ObjectReference(\n            ProfilerWalkHeapContext * profilerWalkHeapContext,\n            Object * pObjReferenceSource,\n            ULONGLONG typeID,\n            ULONGLONG cRefs,\n            Object ** rgObjReferenceTargets);\n        static BOOL ShouldWalkStaticsAndCOMForEtw();\n        static VOID WalkStaticsAndCOMForETW();\n        static VOID EndHeapDump(ProfilerWalkHeapContext * profilerWalkHeapContext);\n#ifdef FEATURE_EVENT_TRACE\n        static VOID BeginMovedReferences(size_t * pProfilingContext);\n        static VOID MovedReference(BYTE * pbMemBlockStart, BYTE * pbMemBlockEnd, ptrdiff_t cbRelocDistance, size_t profilingContext, BOOL fCompacting, BOOL fAllowProfApiNotification = TRUE);\n        static VOID EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification = TRUE);\n#else\n        // TODO: Need to be implemented for PROFILING_SUPPORTED.\n        static VOID BeginMovedReferences(size_t * pProfilingContext) {};\n        static VOID MovedReference(BYTE * pbMemBlockStart, BYTE * pbMemBlockEnd, ptrdiff_t cbRelocDistance, size_t profilingContext, BOOL fCompacting, BOOL fAllowProfApiNotification = TRUE) {};\n        static VOID EndMovedReferences(size_t profilingContext, BOOL fAllowProfApiNotification = TRUE) {};\n#endif // FEATURE_EVENT_TRACE\n        static VOID SendFinalizeObjectEvent(MethodTable * pMT, Object * pObj);\n    };\n};\n\n\n#endif //_VMEVENTTRACE_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/eventtracebase.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// File: eventtracebase.h\n// Abstract: This module implements base Event Tracing support (excluding some of the\n// CLR VM-specific ETW helpers).\n//\n\n//\n\n//\n//\n// #EventTracing\n// Windows\n// ETW (Event Tracing for Windows) is a high-performance, low overhead and highly scalable\n// tracing facility provided by the Windows Operating System. ETW is available on Win2K and above. There are\n// four main types of components in ETW: event providers, controllers, consumers, and event trace sessions.\n// An event provider is a logical entity that writes events to ETW sessions. The event provider must register\n// a provider ID with ETW through the registration API. A provider first registers with ETW and writes events\n// from various points in the code by invoking the ETW logging API. When a provider is enabled dynamically by\n// the ETW controller application, calls to the logging API sends events to a specific trace session\n// designated by the controller. Each event sent by the event provider to the trace session consists of a\n// fixed header that includes event metadata and additional variable user-context data. CLR is an event\n// provider.\n// ============================================================================\n\n#ifndef _ETWTRACER_HXX_\n#define _ETWTRACER_HXX_\n\nstruct EventStructTypeData;\nvoid InitializeEventTracing();\n\nclass PrepareCodeConfig;\n\n// !!!!!!! NOTE !!!!!!!!\n// The flags must match those in the ETW manifest exactly\n// !!!!!!! NOTE !!!!!!!!\n\n// These flags need to be defined either when FEATURE_EVENT_TRACE is enabled or the\n// PROFILING_SUPPORTED is set, since they are used both by event tracing and profiling.\n\nenum EtwTypeFlags\n{\n    kEtwTypeFlagsDelegate =                         0x1,\n    kEtwTypeFlagsFinalizable =                      0x2,\n    kEtwTypeFlagsExternallyImplementedCOMObject =   0x4,\n    kEtwTypeFlagsArray =                            0x8,\n    kEtwTypeFlagsArrayRankBit0 =                  0x100,\n    kEtwTypeFlagsArrayRankBit1 =                  0x200,\n    kEtwTypeFlagsArrayRankBit2 =                  0x400,\n    kEtwTypeFlagsArrayRankBit3 =                  0x800,\n    kEtwTypeFlagsArrayRankBit4 =                 0x1000,\n    kEtwTypeFlagsArrayRankBit5 =                 0x2000,\n\n    kEtwTypeFlagsArrayRankMask =                 0x3F00,\n    kEtwTypeFlagsArrayRankShift =                     8,\n    kEtwTypeFlagsArrayRankMax = kEtwTypeFlagsArrayRankMask >> kEtwTypeFlagsArrayRankShift\n};\n\nenum EtwThreadFlags\n{\n    kEtwThreadFlagGCSpecial =         0x00000001,\n    kEtwThreadFlagFinalizer =         0x00000002,\n    kEtwThreadFlagThreadPoolWorker =  0x00000004,\n};\n\nenum EtwGCSettingFlags\n{\n    kEtwGCFlagConcurrent =      0x00000001,\n    kEtwGCFlagLargePages =      0x00000002,\n    kEtwGCFlagFrozenSegs =      0x00000004,\n    kEtwGCFlagHardLimitConfig = 0x00000008,\n    kEtwGCFlagNoAffinitize =    0x00000010,\n};\n\n#ifndef FEATURE_NATIVEAOT\n\n#if defined(FEATURE_EVENT_TRACE)\n\n#if defined(FEATURE_PERFTRACING)\n#define EVENT_PIPE_ENABLED() (EventPipeHelper::Enabled())\n#else\n#define EVENT_PIPE_ENABLED() (FALSE)\n#endif\n\n#if  !defined(HOST_UNIX)\n\n//\n// Use this macro at the least before calling the Event Macros\n//\n\n#define ETW_TRACING_INITIALIZED(RegHandle) \\\n    ((g_pEtwTracer && (RegHandle)) || EVENT_PIPE_ENABLED())\n\n//\n// Use this macro to check if an event is enabled\n// if the fields in the event are not cheap to calculate\n//\n#define ETW_EVENT_ENABLED(Context, EventDescriptor) \\\n    ((Context.EtwProvider->IsEnabled && McGenEventXplatEnabled(Context.EtwProvider, &EventDescriptor)) || EventPipeHelper::IsEnabled(Context, EventDescriptor.Level, EventDescriptor.Keyword))\n\n//\n// Use this macro to check if a category of events is enabled\n//\n\n#define ETW_CATEGORY_ENABLED(Context, Level, Keyword) \\\n    ((Context.EtwProvider->IsEnabled && McGenEventProviderEnabled(Context.EtwProvider, Level, Keyword)) || EventPipeHelper::IsEnabled(Context, Level, Keyword))\n\n\n// This macro only checks if a provider is enabled\n// It does not check the flags and keywords for which it is enabled\n#define ETW_PROVIDER_ENABLED(ProviderSymbol)                 \\\n        ((ProviderSymbol##_Context.IsEnabled) || EVENT_PIPE_ENABLED())\n\n\n#else //!defined(HOST_UNIX)\n#if defined(FEATURE_PERFTRACING)\n#define ETW_INLINE\n#define ETWOnStartup(StartEventName, EndEventName)\n#define ETWFireEvent(EventName) FireEtw##EventName(GetClrInstanceId())\n\n#define ETW_TRACING_INITIALIZED(RegHandle) (TRUE)\n#define ETW_EVENT_ENABLED(Context, EventDescriptor) (EventPipeHelper::IsEnabled(Context, EventDescriptor.Level, EventDescriptor.Keyword) || \\\n        (XplatEventLogger::IsKeywordEnabled(Context, EventDescriptor.Level, EventDescriptor.Keyword)))\n#define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::IsEnabled(Context, Level, Keyword) || \\\n        (XplatEventLogger::IsKeywordEnabled(Context, Level, Keyword)))\n#define ETW_TRACING_ENABLED(Context, EventDescriptor) (EventEnabled##EventDescriptor())\n#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (EventPipeHelper::IsEnabled(Context, Level, Keyword) || \\\n        (XplatEventLogger::IsKeywordEnabled(Context, Level, Keyword)))\n#define ETW_PROVIDER_ENABLED(ProviderSymbol) (TRUE)\n#else //defined(FEATURE_PERFTRACING)\n#define ETW_INLINE\n#define ETWOnStartup(StartEventName, EndEventName)\n#define ETWFireEvent(EventName)\n\n#define ETW_TRACING_INITIALIZED(RegHandle) (TRUE)\n#define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (XplatEventLogger::IsKeywordEnabled(Context, Level, Keyword))\n#define ETW_EVENT_ENABLED(Context, EventDescriptor) (XplatEventLogger::IsKeywordEnabled(Context, EventDescriptor.Level, EventDescriptor.KeywordsBitmask))\n#define ETW_TRACING_ENABLED(Context, EventDescriptor) (ETW_EVENT_ENABLED(Context, EventDescriptor) && EventEnabled##EventDescriptor())\n#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (ETW_CATEGORY_ENABLED(Context, Level, Keyword))\n#define ETW_PROVIDER_ENABLED(ProviderSymbol) (XplatEventLogger::IsProviderEnabled(Context))\n#endif // defined(FEATURE_PERFTRACING)\n#endif // !defined(HOST_UNIX)\n\n#else // FEATURE_EVENT_TRACE\n\n#define ETWOnStartup(StartEventName, EndEventName)\n#define ETWFireEvent(EventName)\n\n#define ETW_TRACING_INITIALIZED(RegHandle) (FALSE)\n#define ETW_EVENT_ENABLED(Context, EventDescriptor) (FALSE)\n#define ETW_CATEGORY_ENABLED(Context, Level, Keyword) (FALSE)\n#define ETW_TRACING_ENABLED(Context, EventDescriptor) (FALSE)\n#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) (FALSE)\n#define ETW_PROVIDER_ENABLED(ProviderSymbol) (TRUE)\n\n#endif // FEATURE_EVENT_TRACE\n\n#endif // FEATURE_NATIVEAOT\n\n// During a heap walk, this is the storage for keeping track of all the nodes and edges\n// being batched up by ETW, and for remembering whether we're also supposed to call into\n// a profapi profiler.  This is allocated toward the end of a GC and passed to us by the\n// GC heap walker.\nstruct ProfilerWalkHeapContext\n{\npublic:\n    ProfilerWalkHeapContext(BOOL fProfilerPinnedParam, LPVOID pvEtwContextParam)\n    {\n        fProfilerPinned = fProfilerPinnedParam;\n        pvEtwContext = pvEtwContextParam;\n    }\n\n    BOOL fProfilerPinned;\n    LPVOID pvEtwContext;\n};\n\n#ifdef FEATURE_EVENT_TRACE\n\nclass Object;\n#if !defined(HOST_UNIX)\n\n/***************************************/\n/* Tracing levels supported by CLR ETW */\n/***************************************/\n#define ETWMAX_TRACE_LEVEL 6        // Maximum Number of Trace Levels supported\n#define TRACE_LEVEL_FATAL       1   // Abnormal exit or termination\n#define TRACE_LEVEL_ERROR       2   // Severe errors that need logging\n#define TRACE_LEVEL_WARNING     3   // Warnings such as allocation failure\n#define TRACE_LEVEL_INFORMATION 4   // Includes non-error cases such as Entry-Exit\n#define TRACE_LEVEL_VERBOSE     5   // Detailed traces from intermediate steps\n\nstruct ProfilingScanContext;\n\n//\n// Use this macro to check if ETW is initialized and the event is enabled\n//\n#define ETW_TRACING_ENABLED(Context, EventDescriptor) \\\n    ((Context.EtwProvider->IsEnabled && ETW_TRACING_INITIALIZED(Context.EtwProvider->RegistrationHandle) && ETW_EVENT_ENABLED(Context, EventDescriptor))|| \\\n        EventPipeHelper::IsEnabled(Context, EventDescriptor.Level, EventDescriptor.Keyword))\n\n//\n// Using KEYWORDZERO means when checking the events category ignore the keyword\n//\n#define KEYWORDZERO 0x0\n\n//\n// Use this macro to check if ETW is initialized and the category is enabled\n//\n#define ETW_TRACING_CATEGORY_ENABLED(Context, Level, Keyword) \\\n    (ETW_TRACING_INITIALIZED(Context.EtwProvider->RegistrationHandle) && ETW_CATEGORY_ENABLED(Context, Level, Keyword))\n\n#define ETWOnStartup(StartEventName, EndEventName) \\\n    ETWTraceStartup trace##StartEventName##(Microsoft_Windows_DotNETRuntimePrivateHandle, &StartEventName, &StartupId, &EndEventName, &StartupId);\n#define ETWFireEvent(EventName) FireEtw##EventName(GetClrInstanceId())\n\n#ifndef FEATURE_NATIVEAOT\n// Headers\n#include <initguid.h>\n#include <wmistr.h>\n#include <evntrace.h>\n#include <evntprov.h>\n#endif //!FEATURE_NATIVEAOT\n#endif //!defined(HOST_UNIX)\n\n\n#else // FEATURE_EVENT_TRACE\n\n#include \"../gc/env/etmdummy.h\"\n#endif // FEATURE_EVENT_TRACE\n\n#ifndef FEATURE_NATIVEAOT\n\n#include \"corprof.h\"\n\n// g_nClrInstanceId is defined in Utilcode\\Util.cpp. The definition goes into Utilcode.lib.\n// This enables both the VM and Utilcode to raise ETW events.\nextern UINT32 g_nClrInstanceId;\n\n#define GetClrInstanceId()  (static_cast<UINT16>(g_nClrInstanceId))\n#if defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))\n#define KEYWORDZERO 0x0\n\n#define DEF_LTTNG_KEYWORD_ENABLED 1\n#ifdef FEATURE_EVENT_TRACE\n#include \"clrproviders.h\"\n#endif // FEATURE_EVENT_TRACE\n#include \"clrconfig.h\"\n\n#endif // defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))\n\n#if defined(FEATURE_PERFTRACING) || defined(FEATURE_EVENTSOURCE_XPLAT)\n\n/***************************************/\n/* Tracing levels supported by CLR ETW */\n/***************************************/\n#define MAX_TRACE_LEVEL         6   // Maximum Number of Trace Levels supported\n#define TRACE_LEVEL_FATAL       1   // Abnormal exit or termination\n#define TRACE_LEVEL_ERROR       2   // Severe errors that need logging\n#define TRACE_LEVEL_WARNING     3   // Warnings such as allocation failure\n#define TRACE_LEVEL_INFORMATION 4   // Includes non-error cases such as Entry-Exit\n#define TRACE_LEVEL_VERBOSE     5   // Detailed traces from intermediate steps\n\nclass XplatEventLoggerConfiguration\n{\npublic:\n    XplatEventLoggerConfiguration() = default;\n\n    XplatEventLoggerConfiguration(XplatEventLoggerConfiguration const & other) = delete;\n    XplatEventLoggerConfiguration(XplatEventLoggerConfiguration && other)\n    {\n        _provider = std::move(other._provider);\n        _isValid = other._isValid;\n        _enabledKeywords = other._enabledKeywords;\n        _level = other._level;\n    }\n\n    ~XplatEventLoggerConfiguration()\n    {\n        _provider = nullptr;\n    }\n\n    void Parse(LPWSTR configString)\n    {\n        auto providerComponent = GetNextComponentString(configString);\n        _provider = ParseProviderName(providerComponent);\n        if (_provider == nullptr)\n        {\n            _isValid = false;\n            return;\n        }\n\n        auto keywordsComponent = GetNextComponentString(providerComponent.End + 1);\n        _enabledKeywords = ParseEnabledKeywordsMask(keywordsComponent);\n\n        auto levelComponent = GetNextComponentString(keywordsComponent.End + 1);\n        _level = ParseLevel(levelComponent);\n\n        auto argumentComponent = GetNextComponentString(levelComponent.End + 1);\n        _argument = ParseArgument(argumentComponent);\n\n        _isValid = true;\n    }\n\n    bool IsValid() const\n    {\n        return _isValid;\n    }\n\n    LPCWSTR GetProviderName() const\n    {\n        return _provider;\n    }\n\n    uint64_t GetEnabledKeywordsMask() const\n    {\n        return _enabledKeywords;\n    }\n\n    uint32_t GetLevel() const\n    {\n        return _level;\n    }\n\n    LPCWSTR GetArgument() const\n    {\n        return _argument;\n    }\n\nprivate:\n    struct ComponentSpan\n    {\n    public:\n        ComponentSpan(LPCWSTR start, LPCWSTR end)\n        : Start(start), End(end)\n        {\n        }\n\n        LPCWSTR Start;\n        LPCWSTR End;\n    };\n\n    ComponentSpan GetNextComponentString(LPCWSTR start) const\n    {\n        const WCHAR ComponentDelimiter = W(':');\n        const WCHAR * end = wcschr(start, ComponentDelimiter);\n        if (end == nullptr)\n        {\n            end = start + wcslen(start);\n        }\n\n        return ComponentSpan(start, end);\n    }\n\n    NewArrayHolder<WCHAR> ParseProviderName(ComponentSpan const & component) const\n    {\n        NewArrayHolder<WCHAR> providerName = nullptr;\n        if ((component.End - component.Start) != 0)\n        {\n            auto const length = component.End - component.Start;\n            providerName = new WCHAR[length + 1];\n            wcsncpy(providerName, component.Start, length);\n            providerName[length] = '\\0';\n        }\n        return providerName;\n    }\n\n    uint64_t ParseEnabledKeywordsMask(ComponentSpan const & component) const\n    {\n        auto enabledKeywordsMask = (uint64_t)(-1);\n        if ((component.End - component.Start) != 0)\n        {\n            enabledKeywordsMask = _wcstoui64(component.Start, nullptr, 16);\n        }\n        return enabledKeywordsMask;\n    }\n\n    uint32_t ParseLevel(ComponentSpan const & component) const\n    {\n        int level = TRACE_LEVEL_VERBOSE; // Verbose\n        if ((component.End - component.Start) != 0)\n        {\n            level = _wtoi(component.Start);\n        }\n        return level;\n    }\n\n    NewArrayHolder<WCHAR> ParseArgument(ComponentSpan const & component) const\n    {\n        NewArrayHolder<WCHAR> argument = nullptr;\n        if ((component.End - component.Start) != 0)\n        {\n            auto const length = component.End - component.Start;\n            argument = new WCHAR[length + 1];\n            wcsncpy(argument, component.Start, length);\n            argument[length] = '\\0';\n        }\n        return argument;\n    }\n\n    NewArrayHolder<WCHAR> _provider;\n    uint64_t _enabledKeywords;\n    uint32_t _level;\n    NewArrayHolder<WCHAR> _argument;\n    bool _isValid;\n};\n#endif // defined(FEATURE_PERFTRACING) || defined(FEATURE_EVENTSOURCE_XPLAT)\n\n#if defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))\n\nclass XplatEventLoggerController\n{\npublic:\n\n    static void UpdateProviderContext(XplatEventLoggerConfiguration const &config)\n    {\n        if (!config.IsValid())\n        {\n            return;\n        }\n\n        auto providerName = config.GetProviderName();\n        auto enabledKeywordsMask = config.GetEnabledKeywordsMask();\n        auto level = config.GetLevel();\n        if (_wcsicmp(providerName, W(\"*\")) == 0 && enabledKeywordsMask == (ULONGLONG)(-1) && level == TRACE_LEVEL_VERBOSE)\n        {\n            ActivateAllKeywordsOfAllProviders();\n        }\n#ifdef FEATURE_EVENT_TRACE\n        else\n        {\n            LTTNG_TRACE_CONTEXT *provider = GetProvider(providerName);\n            if (provider == nullptr)\n            {\n                return;\n            }\n            provider->EnabledKeywordsBitmask = enabledKeywordsMask;\n            provider->Level = level;\n            provider->IsEnabled = true;\n        }\n#endif\n    }\n\n    static void ActivateAllKeywordsOfAllProviders()\n    {\n#ifdef FEATURE_EVENT_TRACE\n        for (LTTNG_TRACE_CONTEXT * const provider : ALL_LTTNG_PROVIDERS_CONTEXT)\n        {\n            provider->EnabledKeywordsBitmask = (ULONGLONG)(-1);\n            provider->Level = TRACE_LEVEL_VERBOSE;\n            provider->IsEnabled = true;\n        }\n#endif\n    }\n\nprivate:\n#ifdef FEATURE_EVENT_TRACE\n    static LTTNG_TRACE_CONTEXT * const GetProvider(LPCWSTR providerName)\n    {\n        auto length = wcslen(providerName);\n        for (auto provider : ALL_LTTNG_PROVIDERS_CONTEXT)\n        {\n            if (_wcsicmp(provider->Name, providerName) == 0)\n            {\n                return provider;\n            }\n        }\n        return nullptr;\n    }\n#endif\n};\n\nclass XplatEventLogger\n{\npublic:\n\n    inline static BOOL IsEventLoggingEnabled()\n    {\n        static ConfigDWORD configEventLogging;\n        return configEventLogging.val(CLRConfig::EXTERNAL_EnableEventLog);\n    }\n\n#ifdef FEATURE_EVENT_TRACE\n    inline static bool IsProviderEnabled(DOTNET_TRACE_CONTEXT providerCtx)\n    {\n        return providerCtx.LttngProvider->IsEnabled;\n    }\n\n    inline static bool IsKeywordEnabled(DOTNET_TRACE_CONTEXT providerCtx, UCHAR level, ULONGLONG keyword)\n    {\n        if (!providerCtx.LttngProvider->IsEnabled)\n        {\n            return false;\n        }\n\n        if ((level <= providerCtx.LttngProvider->Level) || (providerCtx.LttngProvider->Level == 0))\n        {\n            if ((keyword == 0) || ((keyword & providerCtx.LttngProvider->EnabledKeywordsBitmask) != 0))\n            {\n                return true;\n            }\n        }\n        return false;\n    }\n#endif\n\n    /*\n    This method is where COMPlus_LTTngConfig environment variable is parsed and is registered with the runtime provider\n    context structs generated by src/scripts/genEventing.py.\n    It expects the environment variable to look like:\n    provider:keywords:level,provider:keywords:level\n    (Notice the \"arguments\" part is missing compared to EventPipe configuration)\n\n    Ex)\n    Microsoft-Windows-DotNETRuntime:deadbeefdeadbeef:4,Microsoft-Windows-DotNETRuntimePrivate:deafbeefdeadbeef:5\n    */\n    static void InitializeLogger()\n    {\n        if (!IsEventLoggingEnabled())\n        {\n            return;\n        }\n\n        LPWSTR xplatEventConfig = NULL;\n        CLRConfig::GetConfigValue(CLRConfig::INTERNAL_LTTngConfig, &xplatEventConfig);\n        auto configuration = XplatEventLoggerConfiguration();\n        auto configToParse = xplatEventConfig;\n\n        if (configToParse == nullptr || *configToParse == L'\\0')\n        {\n            XplatEventLoggerController::ActivateAllKeywordsOfAllProviders();\n            return;\n        }\n        while (configToParse != nullptr)\n        {\n            const WCHAR comma = W(',');\n            auto end = wcschr(configToParse, comma);\n            configuration.Parse(configToParse);\n            XplatEventLoggerController::UpdateProviderContext(configuration);\n            if (end == nullptr)\n            {\n                break;\n            }\n            configToParse = end + 1;\n        }\n    }\n};\n\n\n#endif  // defined(HOST_UNIX) && (defined(FEATURE_EVENT_TRACE) || defined(FEATURE_EVENTSOURCE_XPLAT))\n\n#if defined(FEATURE_EVENT_TRACE)\n\n#ifdef FEATURE_PERFTRACING\n#include \"../vm/eventpipeadaptertypes.h\"\n#endif // FEATURE_PERFTRACING\n\nVOID EventPipeEtwCallbackDotNETRuntimeStress(\n    _In_ LPCGUID SourceId,\n    _In_ ULONG ControlCode,\n    _In_ UCHAR Level,\n    _In_ ULONGLONG MatchAnyKeyword,\n    _In_ ULONGLONG MatchAllKeyword,\n    _In_opt_ EventFilterDescriptor* FilterData,\n    _Inout_opt_ PVOID CallbackContext);\n\nVOID EventPipeEtwCallbackDotNETRuntime(\n    _In_ LPCGUID SourceId,\n    _In_ ULONG ControlCode,\n    _In_ UCHAR Level,\n    _In_ ULONGLONG MatchAnyKeyword,\n    _In_ ULONGLONG MatchAllKeyword,\n    _In_opt_ EventFilterDescriptor* FilterData,\n    _Inout_opt_ PVOID CallbackContext);\n\nVOID EventPipeEtwCallbackDotNETRuntimeRundown(\n    _In_ LPCGUID SourceId,\n    _In_ ULONG ControlCode,\n    _In_ UCHAR Level,\n    _In_ ULONGLONG MatchAnyKeyword,\n    _In_ ULONGLONG MatchAllKeyword,\n    _In_opt_ EventFilterDescriptor* FilterData,\n    _Inout_opt_ PVOID CallbackContext);\n\nVOID EventPipeEtwCallbackDotNETRuntimePrivate(\n    _In_ LPCGUID SourceId,\n    _In_ ULONG ControlCode,\n    _In_ UCHAR Level,\n    _In_ ULONGLONG MatchAnyKeyword,\n    _In_ ULONGLONG MatchAllKeyword,\n    _In_opt_ EventFilterDescriptor* FilterData,\n    _Inout_opt_ PVOID CallbackContext);\n\n#ifndef  HOST_UNIX\n// Callback and stack support\n#if !defined(DONOT_DEFINE_ETW_CALLBACK) && !defined(DACCESS_COMPILE)\nextern \"C\" {\n    /* ETW control callback\n         * Desc:        This function handles the ETW control\n         *              callback.\n         * Ret:         success or failure\n     ***********************************************/\n    VOID EtwCallback(\n        _In_ LPCGUID SourceId,\n        _In_ ULONG ControlCode,\n        _In_ UCHAR Level,\n        _In_ ULONGLONG MatchAnyKeyword,\n        _In_ ULONGLONG MatchAllKeyword,\n        _In_opt_ PEVENT_FILTER_DESCRIPTOR FilterData,\n        _Inout_opt_ PVOID CallbackContext);\n}\n\n//\n// User defined callback\n//\n#define MCGEN_PRIVATE_ENABLE_CALLBACK(RequestCode, Context, InOutBufferSize, Buffer) \\\n        EtwCallback(NULL /* SourceId */, ((RequestCode)==WMI_ENABLE_EVENTS) ? EVENT_CONTROL_CODE_ENABLE_PROVIDER : EVENT_CONTROL_CODE_DISABLE_PROVIDER, 0 /* Level */, 0 /* MatchAnyKeyword */, 0 /* MatchAllKeyword */, NULL /* FilterData */, Context)\n\n//\n// User defined callback2\n//\n#define MCGEN_PRIVATE_ENABLE_CALLBACK_V2(SourceId, ControlCode, Level, MatchAnyKeyword, MatchAllKeyword, FilterData, CallbackContext) \\\n        EtwCallback(SourceId, ControlCode, Level, MatchAnyKeyword, MatchAllKeyword, FilterData, CallbackContext)\n\nextern \"C\" {\n    /* ETW callout\n         * Desc:        This function handles the ETW callout\n         * Ret:         success or failure\n     ***********************************************/\n    VOID EtwCallout(\n        REGHANDLE RegHandle,\n        PCEVENT_DESCRIPTOR Descriptor,\n        ULONG ArgumentCount,\n        PEVENT_DATA_DESCRIPTOR EventData);\n}\n\n//\n// Call user defined callout\n//\n#define MCGEN_CALLOUT(RegHandle, Descriptor, NumberOfArguments, EventData) \\\n        EtwCallout(RegHandle, Descriptor, NumberOfArguments, EventData)\n#endif //!DONOT_DEFINE_ETW_CALLBACK && !DACCESS_COMPILE\n\n#endif //!HOST_UNIX\n#include \"clretwallmain.h\"\n\n#if defined(FEATURE_PERFTRACING)\nclass EventPipeHelper\n{\npublic:\n    static bool Enabled();\n    static bool IsEnabled(DOTNET_TRACE_CONTEXT Context, UCHAR Level, ULONGLONG Keyword);\n};\n#endif // defined(FEATURE_PERFTRACING)\n\n#endif // FEATURE_EVENT_TRACE\n\n/**************************/\n/* CLR ETW infrastructure */\n/**************************/\n// #CEtwTracer\n// On Windows Vista, ETW has gone through a major upgrade, and one of the most significant changes is the\n// introduction of the unified event provider model and APIs. The older architecture used the classic ETW\n// events. The new ETW architecture uses the manifest based events. To support both types of events at the\n// same time, we use the manpp tool for generating event macros that can be directly used to fire ETW events\n// from various components within the CLR.\n// (http://diagnostics/sites/etw/Lists/Announcements/DispForm.aspx?ID=10&Source=http%3A%2F%2Fdiagnostics%2Fsites%2Fetw%2Fdefault%2Easpx)\n// Every ETW provider has to Register itself to the system, so that when enabled, it is capable of firing\n// ETW events. file:../VM/eventtrace.cpp#Registration is where the actual Provider Registration takes place.\n// At process shutdown, a registered provider need to be unregistered.\n// file:../VM/eventtrace.cpp#Unregistration. Since ETW can also be enabled at any instant after the process\n// has started, one may want to do something useful when that happens (e.g enumerate all the loaded modules\n// in the system). To enable this, we have to implement a callback routine.\n// file:../VM/eventtrace.cpp#EtwCallback is CLR's implementation of the callback.\n//\n\n#include \"daccess.h\"\nclass Module;\nclass Assembly;\nclass MethodDesc;\nclass MethodTable;\nclass BaseDomain;\nclass AppDomain;\nclass SString;\nclass CrawlFrame;\nclass LoaderAllocator;\nclass AssemblyLoaderAllocator;\nstruct AllLoggedTypes;\nclass CrstBase;\nclass BulkTypeEventLogger;\nclass TypeHandle;\nclass Thread;\ntemplate<typename ELEMENT, typename TRAITS>\nclass SetSHash;\ntemplate<typename ELEMENT>\nclass PtrSetSHashTraits;\ntypedef SetSHash<MethodDesc*, PtrSetSHashTraits<MethodDesc*>> MethodDescSet;\n\n// All ETW helpers must be a part of this namespace\n// We have auto-generated macros to directly fire the events\n// but in some cases, gathering the event payload information involves some work\n// and it can be done in a relevant helper class like the one's in this namespace\nnamespace ETW\n{\n    // Class to wrap the ETW infrastructure logic\n#if  !defined(HOST_UNIX)\n    class CEtwTracer\n    {\n#if defined(FEATURE_EVENT_TRACE)\n        ULONG RegGuids(LPCGUID ProviderId, PENABLECALLBACK EnableCallback, PVOID CallbackContext, PREGHANDLE RegHandle);\n#endif\n\n    public:\n#ifdef FEATURE_EVENT_TRACE\n        // Registers all the Event Tracing providers\n        HRESULT Register();\n\n        // Unregisters all the Event Tracing providers\n        HRESULT UnRegister();\n#else\n        HRESULT Register()\n        {\n            return S_OK;\n        }\n        HRESULT UnRegister()\n        {\n            return S_OK;\n        }\n#endif // FEATURE_EVENT_TRACE\n    };\n#endif // !defined(HOST_UNIX)\n\n    class LoaderLog;\n    class MethodLog;\n    // Class to wrap all the enumeration logic for ETW\n    class EnumerationLog\n    {\n        friend class ETW::LoaderLog;\n        friend class ETW::MethodLog;\n#ifdef FEATURE_EVENT_TRACE\n        static VOID SendThreadRundownEvent();\n        static VOID SendGCRundownEvent();\n        static VOID IterateDomain(BaseDomain *pDomain, DWORD enumerationOptions);\n        static VOID IterateAppDomain(AppDomain * pAppDomain, DWORD enumerationOptions);\n        static VOID IterateCollectibleLoaderAllocator(AssemblyLoaderAllocator *pLoaderAllocator, DWORD enumerationOptions);\n        static VOID IterateAssembly(Assembly *pAssembly, DWORD enumerationOptions);\n        static VOID IterateModule(Module *pModule, DWORD enumerationOptions);\n        static VOID EnumerationHelper(Module *moduleFilter, BaseDomain *domainFilter, DWORD enumerationOptions);\n        static DWORD GetEnumerationOptionsFromRuntimeKeywords();\n    public:\n        typedef union _EnumerationStructs\n        {\n            typedef enum _EnumerationOptions\n            {\n                None=                               0x00000000,\n                DomainAssemblyModuleLoad=           0x00000001,\n                DomainAssemblyModuleUnload=         0x00000002,\n                DomainAssemblyModuleDCStart=        0x00000004,\n                DomainAssemblyModuleDCEnd=          0x00000008,\n                JitMethodLoad=                      0x00000010,\n                JitMethodUnload=                    0x00000020,\n                JitMethodDCStart=                   0x00000040,\n                JitMethodDCEnd=                     0x00000080,\n                NgenMethodLoad=                     0x00000100,\n                NgenMethodUnload=                   0x00000200,\n                NgenMethodDCStart=                  0x00000400,\n                NgenMethodDCEnd=                    0x00000800,\n                ModuleRangeLoad=                    0x00001000,\n                ModuleRangeDCStart=                 0x00002000,\n                ModuleRangeDCEnd=                   0x00004000,\n                ModuleRangeLoadPrivate=             0x00008000,\n                MethodDCStartILToNativeMap=         0x00010000,\n                MethodDCEndILToNativeMap=           0x00020000,\n                JitMethodILToNativeMap=             0x00040000,\n                TypeUnload=                         0x00080000,\n                JittedMethodRichDebugInfo=          0x00100000,\n\n                // Helpers\n                ModuleRangeEnabledAny = ModuleRangeLoad | ModuleRangeDCStart | ModuleRangeDCEnd | ModuleRangeLoadPrivate,\n                JitMethodLoadOrDCStartAny = JitMethodLoad | JitMethodDCStart | MethodDCStartILToNativeMap,\n                JitMethodUnloadOrDCEndAny = JitMethodUnload | JitMethodDCEnd | MethodDCEndILToNativeMap,\n            }EnumerationOptions;\n        }EnumerationStructs;\n\n        static VOID ProcessShutdown();\n        static VOID ModuleRangeRundown();\n        static VOID SendOneTimeRundownEvents();\n        static VOID StartRundown();\n        static VOID EndRundown();\n        static VOID EnumerateForCaptureState();\n#else\n    public:\n        static VOID ProcessShutdown() {};\n        static VOID StartRundown() {};\n        static VOID EndRundown() {};\n#endif // FEATURE_EVENT_TRACE\n    };\n\n\n    // Class to wrap all the sampling logic for ETW\n\n    class SamplingLog\n    {\n#if defined(FEATURE_EVENT_TRACE) && !defined(HOST_UNIX)\n    public:\n        typedef enum _EtwStackWalkStatus\n        {\n            Completed = 0,\n            UnInitialized = 1,\n            InProgress = 2\n        } EtwStackWalkStatus;\n    private:\n        static const UINT8 s_MaxStackSize=100;\n        UINT32 m_FrameCount;\n        SIZE_T m_EBPStack[SamplingLog::s_MaxStackSize];\n        VOID Append(SIZE_T currentFrame);\n        EtwStackWalkStatus SaveCurrentStack(int skipTopNFrames=1);\n    public:\n        static ULONG SendStackTrace(MCGEN_TRACE_CONTEXT TraceContext, PCEVENT_DESCRIPTOR Descriptor, LPCGUID EventGuid);\n        EtwStackWalkStatus GetCurrentThreadsCallStack(UINT32 *frameCount, PVOID **Stack);\n#endif // FEATURE_EVENT_TRACE && !defined(HOST_UNIX)\n    };\n\n    // Class to wrap all Loader logic for ETW\n    class LoaderLog\n    {\n        friend class ETW::EnumerationLog;\n#if defined(FEATURE_EVENT_TRACE)\n        static VOID SendModuleEvent(Module *pModule, DWORD dwEventOptions, BOOL bFireDomainModuleEvents=FALSE);\n        static ULONG SendModuleRange(_In_ Module *pModule, _In_ DWORD dwEventOptions);\n        static VOID SendAssemblyEvent(Assembly *pAssembly, DWORD dwEventOptions);\n        static VOID SendDomainEvent(BaseDomain *pBaseDomain, DWORD dwEventOptions, LPCWSTR wszFriendlyName=NULL);\n    public:\n        typedef union _LoaderStructs\n        {\n            typedef enum _AppDomainFlags\n            {\n                DefaultDomain=0x1,\n                ExecutableDomain=0x2,\n                SharedDomain=0x4\n            }AppDomainFlags;\n\n            typedef enum _AssemblyFlags\n            {\n                DomainNeutralAssembly=0x1,\n                DynamicAssembly=0x2,\n                NativeAssembly=0x4,\n                CollectibleAssembly=0x8,\n                ReadyToRunAssembly=0x10,\n            }AssemblyFlags;\n\n            typedef enum _ModuleFlags\n            {\n                DomainNeutralModule=0x1,\n                NativeModule=0x2,\n                DynamicModule=0x4,\n                ManifestModule=0x8,\n                IbcOptimized=0x10,\n                ReadyToRunModule=0x20,\n                PartialReadyToRunModule=0x40,\n            }ModuleFlags;\n\n            typedef enum _RangeFlags\n            {\n                HotRange=0x0\n            }RangeFlags;\n\n        }LoaderStructs;\n\n        static VOID DomainLoadReal(BaseDomain *pDomain, _In_opt_ LPWSTR wszFriendlyName=NULL);\n\n        static VOID DomainLoad(BaseDomain *pDomain, _In_opt_ LPWSTR wszFriendlyName = NULL)\n        {\n            if (ETW_PROVIDER_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER))\n            {\n                DomainLoadReal(pDomain, wszFriendlyName);\n            }\n        }\n\n        static VOID DomainUnload(AppDomain *pDomain);\n        static VOID CollectibleLoaderAllocatorUnload(AssemblyLoaderAllocator *pLoaderAllocator);\n        static VOID ModuleLoad(Module *pModule, LONG liReportedSharedModule);\n#else\n    public:\n        static VOID DomainLoad(BaseDomain *pDomain, _In_opt_ LPWSTR wszFriendlyName=NULL) {};\n        static VOID DomainUnload(AppDomain *pDomain) {};\n        static VOID CollectibleLoaderAllocatorUnload(AssemblyLoaderAllocator *pLoaderAllocator) {};\n        static VOID ModuleLoad(Module *pModule, LONG liReportedSharedModule) {};\n#endif // FEATURE_EVENT_TRACE\n    };\n\n    // Class to wrap all Method logic for ETW\n    class MethodLog\n    {\n        friend class ETW::EnumerationLog;\n#ifdef FEATURE_EVENT_TRACE\n        static VOID SendEventsForJitMethods(BaseDomain *pDomainFilter, LoaderAllocator *pLoaderAllocatorFilter, DWORD dwEventOptions);\n        static VOID SendEventsForJitMethodsHelper(\n            LoaderAllocator *pLoaderAllocatorFilter,\n            DWORD dwEventOptions,\n            BOOL fLoadOrDCStart,\n            BOOL fUnloadOrDCEnd,\n            BOOL fSendMethodEvent,\n            BOOL fSendILToNativeMapEvent,\n            BOOL fSendRichDebugInfoEvent,\n            BOOL fGetCodeIds);\n        static VOID SendEventsForNgenMethods(Module *pModule, DWORD dwEventOptions);\n        static VOID SendMethodJitStartEvent(MethodDesc *pMethodDesc, SString *namespaceOrClassName=NULL, SString *methodName=NULL, SString *methodSignature=NULL);\n        static VOID SendMethodILToNativeMapEvent(MethodDesc * pMethodDesc, DWORD dwEventOptions, PCODE pNativeCodeStartAddress, DWORD nativeCodeId, ReJITID ilCodeId);\n        static VOID SendMethodRichDebugInfo(MethodDesc * pMethodDesc, PCODE pNativeCodeStartAddress, DWORD nativeCodeId, ReJITID ilCodeId, MethodDescSet* sentMethodDetailsSet);\n        static VOID SendMethodEvent(MethodDesc *pMethodDesc, DWORD dwEventOptions, BOOL bIsJit, SString *namespaceOrClassName=NULL, SString *methodName=NULL, SString *methodSignature=NULL, PCODE pNativeCodeStartAddress = 0, PrepareCodeConfig *pConfig = NULL, MethodDescSet* sentMethodDetailsSet = NULL);\n        static VOID SendHelperEvent(ULONGLONG ullHelperStartAddress, ULONG ulHelperSize, LPCWSTR pHelperName);\n    public:\n        typedef union _MethodStructs\n        {\n            typedef enum _MethodFlags\n            {\n                DynamicMethod=0x1,\n                GenericMethod=0x2,\n                SharedGenericCode=0x4,\n                JittedMethod=0x8,\n                JitHelperMethod=0x10,\n                ProfilerRejectedPrecompiledCode=0x20,\n                ReadyToRunRejectedPrecompiledCode=0x40,\n                // 0x80 to 0x200 are used for the optimization tier\n            }MethodFlags;\n\n            typedef enum _MethodExtent\n            {\n                HotSection=0x00000000,\n                ColdSection=0x10000000\n            }MethodExtent;\n\n        }MethodStructs;\n\n        static const UINT8 MethodFlagsJitOptimizationTierShift = 7;\n        static const unsigned int MethodFlagsJitOptimizationTierLowMask = 0x7;\n\n        static VOID GetR2RGetEntryPointStart(MethodDesc *pMethodDesc);\n        static VOID GetR2RGetEntryPoint(MethodDesc *pMethodDesc, PCODE pEntryPoint);\n        static VOID MethodJitting(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature);\n        static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig);\n        static VOID SendMethodDetailsEvent(MethodDesc *pMethodDesc);\n        static VOID SendNonDuplicateMethodDetailsEvent(MethodDesc* pMethodDesc, MethodDescSet* set);\n        static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName);\n        static VOID StubsInitialized(PVOID *pHelperStartAddress, PVOID *pHelperNames, LONG ulNoOfHelpers);\n        static VOID MethodRestored(MethodDesc * pMethodDesc);\n        static VOID MethodTableRestored(MethodTable * pMethodTable);\n        static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc);\n        static VOID LogMethodInstrumentationData(MethodDesc* method, uint32_t cbData, BYTE *data, TypeHandle* pTypeHandles, uint32_t numTypeHandles, MethodDesc** pMethods, uint32_t numMethods);\n#else // FEATURE_EVENT_TRACE\n    public:\n        static VOID GetR2RGetEntryPointStart(MethodDesc *pMethodDesc) {};\n        static VOID GetR2RGetEntryPoint(MethodDesc *pMethodDesc, PCODE pEntryPoint) {};\n        static VOID MethodJitting(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature);\n        static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig);\n        static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName) {};\n        static VOID StubsInitialized(PVOID *pHelperStartAddress, PVOID *pHelperNames, LONG ulNoOfHelpers) {};\n        static VOID MethodRestored(MethodDesc * pMethodDesc) {};\n        static VOID MethodTableRestored(MethodTable * pMethodTable) {};\n        static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc) {};\n        static VOID LogMethodInstrumentationData(MethodDesc* method, uint32_t cbData, BYTE *data, TypeHandle* pTypeHandles, uint32_t numTypeHandles, MethodDesc** pMethods, uint32_t numMethods) {};\n#endif // FEATURE_EVENT_TRACE\n    };\n\n    // Class to wrap all Security logic for ETW\n    class SecurityLog\n    {\n#ifdef FEATURE_EVENT_TRACE\n    public:\n        static VOID StrongNameVerificationStart(DWORD dwInFlags, _In_ LPWSTR strFullyQualifiedAssemblyName);\n        static VOID StrongNameVerificationStop(DWORD dwInFlags,ULONG result, _In_ LPWSTR strFullyQualifiedAssemblyName);\n\n        static void FireFieldTransparencyComputationStart(LPCWSTR wszFieldName,\n                                                          LPCWSTR wszModuleName,\n                                                          DWORD dwAppDomain);\n        static void FireFieldTransparencyComputationEnd(LPCWSTR wszFieldName,\n                                                        LPCWSTR wszModuleName,\n                                                        DWORD dwAppDomain,\n                                                        BOOL fIsCritical,\n                                                        BOOL fIsTreatAsSafe);\n\n        static void FireMethodTransparencyComputationStart(LPCWSTR wszMethodName,\n                                                           LPCWSTR wszModuleName,\n                                                           DWORD dwAppDomain);\n        static void FireMethodTransparencyComputationEnd(LPCWSTR wszMethodName,\n                                                         LPCWSTR wszModuleName,\n                                                         DWORD dwAppDomain,\n                                                         BOOL fIsCritical,\n                                                         BOOL fIsTreatAsSafe);\n\n        static void FireModuleTransparencyComputationStart(LPCWSTR wszModuleName, DWORD dwAppDomain);\n        static void FireModuleTransparencyComputationEnd(LPCWSTR wszModuleName,\n                                                         DWORD dwAppDomain,\n                                                         BOOL fIsAllCritical,\n                                                         BOOL fIsAllTransparent,\n                                                         BOOL fIsTreatAsSafe,\n                                                         BOOL fIsOpportunisticallyCritical,\n                                                         DWORD dwSecurityRuleSet);\n\n        static void FireTokenTransparencyComputationStart(DWORD dwToken,\n                                                          LPCWSTR wszModuleName,\n                                                          DWORD dwAppDomain);\n        static void FireTokenTransparencyComputationEnd(DWORD dwToken,\n                                                        LPCWSTR wszModuleName,\n                                                        DWORD dwAppDomain,\n                                                        BOOL fIsCritical,\n                                                        BOOL fIsTreatAsSafe);\n\n        static void FireTypeTransparencyComputationStart(LPCWSTR wszTypeName,\n                                                         LPCWSTR wszModuleName,\n                                                         DWORD dwAppDomain);\n        static void FireTypeTransparencyComputationEnd(LPCWSTR wszTypeName,\n                                                       LPCWSTR wszModuleName,\n                                                       DWORD dwAppDomain,\n                                                       BOOL fIsAllCritical,\n                                                       BOOL fIsAllTransparent,\n                                                       BOOL fIsCritical,\n                                                       BOOL fIsTreatAsSafe);\n#else\n    public:\n        static VOID StrongNameVerificationStart(DWORD dwInFlags, _In_z_ LPWSTR strFullyQualifiedAssemblyName) {};\n        static VOID StrongNameVerificationStop(DWORD dwInFlags,ULONG result, _In_z_ LPWSTR strFullyQualifiedAssemblyName) {};\n\n        static void FireFieldTransparencyComputationStart(LPCWSTR wszFieldName,\n                                                          LPCWSTR wszModuleName,\n                                                          DWORD dwAppDomain) {};\n        static void FireFieldTransparencyComputationEnd(LPCWSTR wszFieldName,\n                                                        LPCWSTR wszModuleName,\n                                                        DWORD dwAppDomain,\n                                                        BOOL fIsCritical,\n                                                        BOOL fIsTreatAsSafe) {};\n\n        static void FireMethodTransparencyComputationStart(LPCWSTR wszMethodName,\n                                                           LPCWSTR wszModuleName,\n                                                           DWORD dwAppDomain) {};\n        static void FireMethodTransparencyComputationEnd(LPCWSTR wszMethodName,\n                                                         LPCWSTR wszModuleName,\n                                                         DWORD dwAppDomain,\n                                                         BOOL fIsCritical,\n                                                         BOOL fIsTreatAsSafe) {};\n\n        static void FireModuleTransparencyComputationStart(LPCWSTR wszModuleName, DWORD dwAppDomain) {};\n        static void FireModuleTransparencyComputationEnd(LPCWSTR wszModuleName,\n                                                         DWORD dwAppDomain,\n                                                         BOOL fIsAllCritical,\n                                                         BOOL fIsAllTransparent,\n                                                         BOOL fIsTreatAsSafe,\n                                                         BOOL fIsOpportunisticallyCritical,\n                                                         DWORD dwSecurityRuleSet) {};\n\n        static void FireTokenTransparencyComputationStart(DWORD dwToken,\n                                                          LPCWSTR wszModuleName,\n                                                          DWORD dwAppDomain) {};\n        static void FireTokenTransparencyComputationEnd(DWORD dwToken,\n                                                        LPCWSTR wszModuleName,\n                                                        DWORD dwAppDomain,\n                                                        BOOL fIsCritical,\n                                                        BOOL fIsTreatAsSafe) {};\n\n        static void FireTypeTransparencyComputationStart(LPCWSTR wszTypeName,\n                                                         LPCWSTR wszModuleName,\n                                                         DWORD dwAppDomain) {};\n        static void FireTypeTransparencyComputationEnd(LPCWSTR wszTypeName,\n                                                       LPCWSTR wszModuleName,\n                                                       DWORD dwAppDomain,\n                                                       BOOL fIsAllCritical,\n                                                       BOOL fIsAllTransparent,\n                                                       BOOL fIsCritical,\n                                                       BOOL fIsTreatAsSafe) {};\n#endif // FEATURE_EVENT_TRACE\n    };\n\n    // Class to wrap all Binder logic for ETW\n    class BinderLog\n    {\n    public:\n        typedef union _BinderStructs {\n            typedef  enum _NGENBINDREJECT_REASON {\n                NGEN_BIND_START_BIND = 0,\n                NGEN_BIND_NO_INDEX = 1,\n                NGEN_BIND_SYSTEM_ASSEMBLY_NOT_AVAILABLE = 2,\n                NGEN_BIND_NO_NATIVE_IMAGE = 3,\n                NGEN_BIND_REJECT_CONFIG_MASK = 4,\n                NGEN_BIND_FAIL = 5,\n                NGEN_BIND_INDEX_CORRUPTION = 6,\n                NGEN_BIND_REJECT_TIMESTAMP = 7,\n                NGEN_BIND_REJECT_NATIVEIMAGE_NOT_FOUND = 8,\n                NGEN_BIND_REJECT_IL_SIG = 9,\n                NGEN_BIND_REJECT_LOADER_EVAL_FAIL = 10,\n                NGEN_BIND_MISSING_FOUND = 11,\n                NGEN_BIND_REJECT_HOSTASM = 12,\n                NGEN_BIND_REJECT_IL_NOT_FOUND = 13,\n                NGEN_BIND_REJECT_APPBASE_NOT_FILE = 14,\n                NGEN_BIND_BIND_DEPEND_REJECT_REF_DEF_MISMATCH = 15,\n                NGEN_BIND_BIND_DEPEND_REJECT_NGEN_SIG = 16,\n                NGEN_BIND_APPLY_EXTERNAL_RELOCS_FAILED = 17,\n                NGEN_BIND_SYSTEM_ASSEMBLY_NATIVEIMAGE_NOT_AVAILABLE = 18,\n                NGEN_BIND_ASSEMBLY_HAS_DIFFERENT_GRANT = 19,\n                NGEN_BIND_ASSEMBLY_NOT_DOMAIN_NEUTRAL = 20,\n                NGEN_BIND_NATIVEIMAGE_VERSION_MISMATCH = 21,\n                NGEN_BIND_LOADFROM_NOT_ALLOWED = 22,\n                NGEN_BIND_DEPENDENCY_HAS_DIFFERENT_IDENTITY = 23\n            } NGENBINDREJECT_REASON;\n        } BinderStructs;\n    };\n\n    // Class to wrap all Exception logic for ETW\n    class ExceptionLog\n    {\n    public:\n#ifdef FEATURE_EVENT_TRACE\n        static VOID ExceptionThrown(CrawlFrame  *pCf, BOOL bIsReThrownException, BOOL bIsNewException);\n        static VOID ExceptionThrownEnd();\n        static VOID ExceptionCatchBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP);\n        static VOID ExceptionCatchEnd();\n        static VOID ExceptionFinallyBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP);\n        static VOID ExceptionFinallyEnd();\n        static VOID ExceptionFilterBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP);\n        static VOID ExceptionFilterEnd();\n\n#else\n        static VOID ExceptionThrown(CrawlFrame  *pCf, BOOL bIsReThrownException, BOOL bIsNewException) {};\n        static VOID ExceptionThrownEnd() {};\n        static VOID ExceptionCatchBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP) {};\n        static VOID ExceptionCatchEnd() {};\n        static VOID ExceptionFinallyBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP) {};\n        static VOID ExceptionFinallyEnd() {};\n        static VOID ExceptionFilterBegin(MethodDesc * pMethodDesc, PVOID pEntryEIP) {};\n        static VOID ExceptionFilterEnd() {};\n#endif // FEATURE_EVENT_TRACE\n        typedef union _ExceptionStructs\n        {\n            typedef enum _ExceptionThrownFlags\n            {\n                HasInnerException=0x1,\n                IsNestedException=0x2,\n                IsReThrownException=0x4,\n                IsCSE=0x8,\n                IsCLSCompliant=0x10\n            }ExceptionThrownFlags;\n        }ExceptionStructs;\n    };\n    // Class to wrap all Contention logic for ETW\n    class ContentionLog\n    {\n    public:\n        typedef union _ContentionStructs\n        {\n            typedef  enum _ContentionFlags {\n                ManagedContention=0,\n                NativeContention=1\n            } ContentionFlags;\n        } ContentionStructs;\n    };\n    // Class to wrap all Interop logic for ETW\n    class InteropLog\n    {\n    public:\n    };\n\n    // Class to wrap all Information logic for ETW\n    class InfoLog\n    {\n    public:\n        typedef union _InfoStructs\n        {\n            typedef enum _StartupMode\n            {\n                ManagedExe=0x1,\n                HostedCLR=0x2,\n                IJW=0x4,\n                COMActivated=0x8,\n                Other=0x10\n            }StartupMode;\n\n            typedef enum _Sku\n            {\n                DesktopCLR=0x1,\n                CoreCLR=0x2,\n                Mono=0x4\n            }Sku;\n\n            typedef enum _EtwMode\n            {\n                Normal=0x0,\n                Callback=0x1\n            }EtwMode;\n        }InfoStructs;\n\n#ifdef FEATURE_EVENT_TRACE\n        static VOID RuntimeInformation(INT32 type);\n#else\n        static VOID RuntimeInformation(INT32 type) {};\n#endif // FEATURE_EVENT_TRACE\n    };\n\n    class CodeSymbolLog\n    {\n    public:\n#ifdef FEATURE_EVENT_TRACE\n        static VOID EmitCodeSymbols(Module* pModule);\n        static HRESULT GetInMemorySymbolsLength(Module* pModule, DWORD* pCountSymbolBytes);\n        static HRESULT ReadInMemorySymbols(Module* pmodule, DWORD symbolsReadOffset, BYTE* pSymbolBytes,\n            DWORD countSymbolBytes,    DWORD* pCountSymbolBytesRead);\n#else\n        static VOID EmitCodeSymbols(Module* pModule) {}\n        static HRESULT GetInMemorySymbolsLength(Module* pModule, DWORD* pCountSymbolBytes) { return S_OK; }\n        static HRESULT ReadInMemorySymbols(Module* pmodule, DWORD symbolsReadOffset, BYTE* pSymbolBytes,\n            DWORD countSymbolBytes, DWORD* pCountSymbolBytesRead) {    return S_OK; }\n#endif // FEATURE_EVENT_TRACE\n    };\n\n#define DISABLE_CONSTRUCT_COPY(T) \\\n    T() = delete; \\\n    T(const T &) = delete; \\\n    T &operator =(const T &) = delete\n\n    // Class to wrap all Compilation logic for ETW\n    class CompilationLog\n    {\n    public:\n        class Runtime\n        {\n        public:\n#ifdef FEATURE_EVENT_TRACE\n            static bool IsEnabled();\n#else\n            static bool IsEnabled() { return false; }\n#endif\n\n            DISABLE_CONSTRUCT_COPY(Runtime);\n        };\n\n        class Rundown\n        {\n        public:\n#ifdef FEATURE_EVENT_TRACE\n            static bool IsEnabled();\n#else\n            static bool IsEnabled() { return false; }\n#endif\n\n            DISABLE_CONSTRUCT_COPY(Rundown);\n        };\n\n        // Class to wrap all TieredCompilation logic for ETW\n        class TieredCompilation\n        {\n        private:\n            static void GetSettings(UINT32 *flagsRef);\n\n        public:\n            class Runtime\n            {\n            public:\n#ifdef FEATURE_EVENT_TRACE\n                static bool IsEnabled();\n                static void SendSettings();\n                static void SendPause();\n                static void SendResume(UINT32 newMethodCount);\n                static void SendBackgroundJitStart(UINT32 pendingMethodCount);\n                static void SendBackgroundJitStop(UINT32 pendingMethodCount, UINT32 jittedMethodCount);\n#else\n                static bool IsEnabled() { return false; }\n                static void SendSettings() {}\n                static void SendPause() {}\n                static void SendResume(UINT32 newMethodCount) {}\n                static void SendBackgroundJitStart(UINT32 pendingMethodCount) {}\n                static void SendBackgroundJitStop(UINT32 pendingMethodCount, UINT32 jittedMethodCount) {}\n#endif\n\n                DISABLE_CONSTRUCT_COPY(Runtime);\n            };\n\n            class Rundown\n            {\n            public:\n#ifdef FEATURE_EVENT_TRACE\n                static bool IsEnabled();\n                static void SendSettings();\n#else\n                static bool IsEnabled() { return false; }\n                static void SendSettings() {}\n#endif\n\n                DISABLE_CONSTRUCT_COPY(Rundown);\n            };\n\n            DISABLE_CONSTRUCT_COPY(TieredCompilation);\n        };\n\n        DISABLE_CONSTRUCT_COPY(CompilationLog);\n    };\n\n#undef DISABLE_CONSTRUCT_COPY\n};\n\n\n#define ETW_IS_TRACE_ON(level) ( FALSE ) // for fusion which is eventually going to get removed\n#define ETW_IS_FLAG_ON(flag) ( FALSE ) // for fusion which is eventually going to get removed\n\n// Commonly used constats for ETW Assembly Loader and Assembly Binder events.\n#define ETWLoadContextNotAvailable (LOADCTX_TYPE_HOSTED + 1)\n#define ETWAppDomainIdNotAvailable 0 // Valid AppDomain IDs start from 1\n\n#define ETWFieldUnused 0 // Indicates that a particular field in the ETW event payload template is currently unused.\n\n#define ETWLoaderLoadTypeNotAvailable 0 // Static or Dynamic Load is only valid at LoaderPhaseStart and LoaderPhaseEnd events - for other events, 0 indicates \"not available\"\n#define ETWLoaderStaticLoad 0 // Static reference load\n#define ETWLoaderDynamicLoad 1 // Dynamic assembly load\n\n#if defined(FEATURE_EVENT_TRACE) && !defined(HOST_UNIX)\n//\n// The ONE and only ONE global instantiation of this class\n//\nextern ETW::CEtwTracer *  g_pEtwTracer;\n\nEXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context;\nEXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context;\nEXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context;\nEXTERN_C DOTNET_TRACE_CONTEXT MICROSOFT_WINDOWS_DOTNETRUNTIME_STRESS_PROVIDER_DOTNET_Context;\n\n//\n// Special Handling of Startup events\n//\n\n// \"mc.exe -MOF\" already generates this block for XP-supported builds inside ClrEtwAll.h;\n// on Vista+ builds, mc is run without -MOF, and we still have code that depends on it, so\n// we manually place it here.\nETW_INLINE\nULONG\nCoMofTemplate_h(\n    _In_ REGHANDLE RegHandle,\n    _In_ PCEVENT_DESCRIPTOR Descriptor,\n    _In_opt_ LPCGUID EventGuid,\n    _In_ const unsigned short  ClrInstanceID\n    )\n{\n#define ARGUMENT_COUNT_h 1\n    ULONG Error = ERROR_SUCCESS;\ntypedef struct _MCGEN_TRACE_BUFFER {\n    EVENT_TRACE_HEADER Header;\n    EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_h];\n} MCGEN_TRACE_BUFFER;\n\n    MCGEN_TRACE_BUFFER TraceBuf;\n    PEVENT_DATA_DESCRIPTOR EventData = TraceBuf.EventData;\n\n    EventDataDescCreate(&EventData[0], &ClrInstanceID, sizeof(const unsigned short)  );\n\n\n  {\n    Error = EventWrite(RegHandle, Descriptor, ARGUMENT_COUNT_h, EventData);\n\n  }\n\n#ifdef MCGEN_CALLOUT\nMCGEN_CALLOUT(RegHandle,\n              Descriptor,\n              ARGUMENT_COUNT_h,\n              EventData);\n#endif\n\n    return Error;\n}\n\nclass ETWTraceStartup {\n    REGHANDLE TraceHandle;\n    PCEVENT_DESCRIPTOR EventStartDescriptor;\n    LPCGUID EventStartGuid;\n    PCEVENT_DESCRIPTOR EventEndDescriptor;\n    LPCGUID EventEndGuid;\npublic:\n    ETWTraceStartup(REGHANDLE _TraceHandle, PCEVENT_DESCRIPTOR _EventStartDescriptor, LPCGUID _EventStartGuid, PCEVENT_DESCRIPTOR _EventEndDescriptor, LPCGUID _EventEndGuid) {\n        TraceHandle = _TraceHandle;\n        EventStartDescriptor = _EventStartDescriptor;\n        EventEndDescriptor = _EventEndDescriptor;\n        EventStartGuid = _EventStartGuid;\n        EventEndGuid = _EventEndGuid;\n        StartupTraceEvent(TraceHandle, EventStartDescriptor, EventStartGuid);\n    }\n    ~ETWTraceStartup() {\n        StartupTraceEvent(TraceHandle, EventEndDescriptor, EventEndGuid);\n    }\n    static void StartupTraceEvent(REGHANDLE _TraceHandle, PCEVENT_DESCRIPTOR _EventDescriptor, LPCGUID _EventGuid) {\n        EVENT_DESCRIPTOR desc = *_EventDescriptor;\n        if(ETW_TRACING_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context, desc))\n        {\n            CoMofTemplate_h(MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_Context.RegistrationHandle, _EventDescriptor, _EventGuid, GetClrInstanceId());\n        }\n    }\n};\n// \"mc.exe -MOF\" already generates this block for XP-supported builds inside ClrEtwAll.h;\n// on Vista+ builds, mc is run without -MOF, and we still have code that depends on it, so\n// we manually place it here.\nFORCEINLINE\nBOOLEAN __stdcall\nMcGenEventTracingEnabled(\n    _In_ PMCGEN_TRACE_CONTEXT EnableInfo,\n    _In_ PCEVENT_DESCRIPTOR EventDescriptor\n    )\n{\n\n    if(!EnableInfo){\n        return FALSE;\n    }\n\n\n    //\n    // Check if the event Level is lower than the level at which\n    // the channel is enabled.\n    // If the event Level is 0 or the channel is enabled at level 0,\n    // all levels are enabled.\n    //\n\n    if ((EventDescriptor->Level <= EnableInfo->Level) || // This also covers the case of Level == 0.\n        (EnableInfo->Level == 0)) {\n\n        //\n        // Check if Keyword is enabled\n        //\n\n        if ((EventDescriptor->Keyword == (ULONGLONG)0) ||\n            ((EventDescriptor->Keyword & EnableInfo->MatchAnyKeyword) &&\n             ((EventDescriptor->Keyword & EnableInfo->MatchAllKeyword) == EnableInfo->MatchAllKeyword))) {\n            return TRUE;\n        }\n    }\n\n    return FALSE;\n}\n\n\nETW_INLINE\nULONG\nETW::SamplingLog::SendStackTrace(\n    MCGEN_TRACE_CONTEXT TraceContext,\n    PCEVENT_DESCRIPTOR Descriptor,\n    LPCGUID EventGuid)\n{\n#define ARGUMENT_COUNT_CLRStackWalk 5\n    ULONG Result = ERROR_SUCCESS;\ntypedef struct _MCGEN_TRACE_BUFFER {\n    EVENT_TRACE_HEADER Header;\n    EVENT_DATA_DESCRIPTOR EventData[ARGUMENT_COUNT_CLRStackWalk];\n} MCGEN_TRACE_BUFFER;\n\n    REGHANDLE RegHandle = TraceContext.RegistrationHandle;\n    if(!TraceContext.IsEnabled || !McGenEventTracingEnabled(&TraceContext, Descriptor))\n    {\n        return Result;\n    }\n\n    PVOID *Stack = NULL;\n    UINT32 FrameCount = 0;\n    ETW::SamplingLog stackObj;\n    if(stackObj.GetCurrentThreadsCallStack(&FrameCount, &Stack) == ETW::SamplingLog::Completed)\n    {\n        UCHAR Reserved1=0, Reserved2=0;\n        UINT16 ClrInstanceId = GetClrInstanceId();\n        MCGEN_TRACE_BUFFER TraceBuf;\n        PEVENT_DATA_DESCRIPTOR EventData = TraceBuf.EventData;\n\n        EventDataDescCreate(&EventData[0], &ClrInstanceId, sizeof(const UINT16)  );\n\n        EventDataDescCreate(&EventData[1], &Reserved1, sizeof(const UCHAR)  );\n\n        EventDataDescCreate(&EventData[2], &Reserved2, sizeof(const UCHAR)  );\n\n        EventDataDescCreate(&EventData[3], &FrameCount, sizeof(const unsigned int)  );\n\n        EventDataDescCreate(&EventData[4], Stack, sizeof(PVOID) * FrameCount );\n\n        return EventWrite(RegHandle, Descriptor, ARGUMENT_COUNT_CLRStackWalk, EventData);\n    }\n    return Result;\n};\n\n#endif // FEATURE_EVENT_TRACE && !defined(HOST_UNIX)\n#ifdef FEATURE_EVENT_TRACE\n#ifdef TARGET_X86\nstruct CallStackFrame\n{\n    struct CallStackFrame* m_Next;\n    SIZE_T m_ReturnAddress;\n};\n#endif // TARGET_X86\n#endif // FEATURE_EVENT_TRACE\n\n#if defined(FEATURE_EVENT_TRACE) && !defined(HOST_UNIX)\nFORCEINLINE\nBOOLEAN __stdcall\nMcGenEventProviderEnabled(\n    _In_ PMCGEN_TRACE_CONTEXT Context,\n    _In_ UCHAR Level,\n    _In_ ULONGLONG Keyword\n    )\n{\n    if(!Context) {\n        return FALSE;\n    }\n\n    //\n    // Check if the event Level is lower than the level at which\n    // the channel is enabled.\n    // If the event Level is 0 or the channel is enabled at level 0,\n    // all levels are enabled.\n    //\n\n    if ((Level <= Context->Level) || // This also covers the case of Level == 0.\n        (Context->Level == 0)) {\n\n        //\n        // Check if Keyword is enabled\n        //\n\n        if ((Keyword == (ULONGLONG)0) ||\n            ((Keyword & Context->MatchAnyKeyword) &&\n             ((Keyword & Context->MatchAllKeyword) == Context->MatchAllKeyword))) {\n            return TRUE;\n        }\n    }\n    return FALSE;\n}\n#endif // FEATURE_EVENT_TRACE && !defined(HOST_UNIX)\n\n\n#endif // !FEATURE_NATIVEAOT\n\n// These parts of the ETW namespace are common for both FEATURE_NATIVEAOT and\n// !FEATURE_NATIVEAOT builds.\n\n\nstruct ProfilingScanContext;\nclass Object;\n\nnamespace ETW\n{\n    // Class to wrap the logging of threads (runtime and rundown providers)\n    class ThreadLog\n    {\n    private:\n        static DWORD GetEtwThreadFlags(Thread * pThread);\n\n    public:\n        static VOID FireThreadCreated(Thread * pThread);\n        static VOID FireThreadDC(Thread * pThread);\n    };\n};\n\n\n#endif //_ETWTRACER_HXX_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ex.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#if !defined(_EX_H_)\n#define _EX_H_\n\n#ifdef HOST_UNIX\n#define EX_TRY_HOLDER                                   \\\n    HardwareExceptionHolder                             \\\n    NativeExceptionHolderCatchAll __exceptionHolder;    \\\n    __exceptionHolder.Push();                           \\\n\n#else // HOST_UNIX\n#define EX_TRY_HOLDER\n#endif // HOST_UNIX\n\n#include \"sstring.h\"\n#include \"crtwrap.h\"\n#include \"winwrap.h\"\n#include \"corerror.h\"\n#include \"stresslog.h\"\n#include \"staticcontract.h\"\n\n#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define _DEBUG_IMPL 1\n#endif\n\n\n//===========================================================================================\n// These abstractions hide the difference between legacy desktop CLR's (that don't support\n// side-by-side-inproc and rely on a fixed SEH code to identify managed exceptions) and\n// new CLR's that support side-by-side inproc.\n//\n// The new CLR's use a different set of SEH codes to avoid conflicting with the legacy CLR's.\n// In addition, to distinguish between EH's raised by different inproc instances of the CLR,\n// the module handle of the owning CLR is stored in ExceptionRecord.ExceptionInformation[4].\n//\n// (Note: all existing SEH's use either only slot [0] or no slots at all. We are leaving\n//  slots [1] thru [3] open for future expansion.)\n//===========================================================================================\n\n// Is this exception code one of the special CLR-specific SEH codes that participate in the\n// instance-tagging scheme?\nBOOL IsInstanceTaggedSEHCode(DWORD dwExceptionCode);\n\n\n// This set of overloads generates the NumberParameters and ExceptionInformation[] array to\n// pass to RaiseException().\n//\n// Parameters:\n//    exceptionArgs:   a fixed-size array of size INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE.\n//                     This will get filled in by this function. (The module handle goes\n//                     in the last slot if this is a side-by-side-inproc enabled build.)\n//\n//    exceptionArg1... up to four arguments that go in slots [0]..[3]. These depends\n//                     the specific requirements of your exception code.\n//\n// Returns:\n//    The NumberParameters to pass to RaiseException().\n//\n//    Basically, this is  either INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE or the count of your\n//    fixed arguments depending on whether this tagged-SEH-enabled build.\n//\n// This function is not permitted to fail.\n\n#define INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE 5\nDWORD MarkAsThrownByUs(/*out*/ ULONG_PTR exceptionArgs[INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE]);\nDWORD MarkAsThrownByUs(/*out*/ ULONG_PTR exceptionArgs[INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE], ULONG_PTR arg0);\n// (the existing system can support more overloads up to 4 fixed arguments but we don't need them at this time.)\n\n\n// Given an exception record, checks if it's exception code matches a specific exception code\n// *and* whether it was tagged by the calling instance of the CLR.\n//\n// If this is a non-tagged-SEH-enabled build, it is blindly assumed to be tagged by the\n// calling instance of the CLR.\nBOOL WasThrownByUs(const EXCEPTION_RECORD *pcER, DWORD dwExceptionCode);\n\n\n//-----------------------------------------------------------------------------------\n// The following group wraps the basic abstracts specifically for EXCEPTION_COMPLUS.\n//-----------------------------------------------------------------------------------\nBOOL IsComPlusException(const EXCEPTION_RECORD *pcER);\nVOID RaiseComPlusException();\n\n\n//===========================================================================================\n//===========================================================================================\n\n\n//-------------------------------------------------------------------------------------------\n// This routine will generate the most descriptive possible error message for an hresult.\n// It will generate at minimum the hex value. It will also try to generate the symbolic name\n// (E_POINTER) and the friendly description (from the message tables.)\n//\n// bNoGeekStuff suppresses hex HR codes. Use this sparingly as most error strings generated by the\n// CLR are aimed at developers, not end-users.\n//-------------------------------------------------------------------------------------------\nvoid GetHRMsg(HRESULT hresult, SString &result, BOOL bNoGeekStuff = FALSE);\n\n\n//-------------------------------------------------------------------------------------------\n// Similar to GetHRMsg but phrased for top-level exception message.\n//-------------------------------------------------------------------------------------------\nvoid GenerateTopLevelHRExceptionMessage(HRESULT hresult, SString &result);\n\n\n// ---------------------------------------------------------------------------\n//   We save current ExceptionPointers using VectoredExceptionHandler.  The save data is only valid\n//   duing exception handling.  GetCurrentExceptionPointers returns the saved data.\n// ---------------------------------------------------------------------------\nvoid GetCurrentExceptionPointers(PEXCEPTION_POINTERS pExceptionInfo DEBUG_ARG(bool checkExceptionRecordLocation));\n\n// ---------------------------------------------------------------------------\n//   We save current ExceptionPointers using VectoredExceptionHandler.  The save data is only valid\n//   duing exception handling.  GetCurrentExceptionCode returns the current exception code.\n// ---------------------------------------------------------------------------\nDWORD GetCurrentExceptionCode();\n\n// ---------------------------------------------------------------------------\n//   Standard exception hierarchy & infrastructure for library code & EE\n// ---------------------------------------------------------------------------\n\n// ---------------------------------------------------------------------------\n// Exception class.  Abstract root exception of our hierarchy.\n// ---------------------------------------------------------------------------\n\nclass Exception;\nclass SEHException;\n\n\n// Exception hierarchy:\n/*                                               GetInstanceType\nException\n    |\n    |-> HRException                                     Y\n    |        |\n    |        |-> HRMsgException\n    |        |-> COMException\n    |\n    |-> SEHException                                    Y\n    |\n    |-> DelegatingException                             Y\n    |\n    |-> OutOfMemoryException                            Y\n    |\n    |-> CLRException                                    Y\n              |\n              |-> EEException                           Y\n              |        |\n              |        |-> EEMessageException\n              |        |\n              |        |-> EEResourceException\n              |        |\n              |        |-> EECOMException\n              |        |\n              |        |-> EEFieldException\n              |        |\n              |        |-> EEMethodException\n              |        |\n              |        |-> EEArgumentException\n              |        |\n              |        |-> EETypeLoadException\n              |        |\n              |        |-> EEFileLoadException\n              |\n              |-> ObjrefException                          Y\n              |\n              |-> CLRLastThrownObjectException             Y\n*/\n\nclass Exception\n{\n    friend bool DebugIsEECxxExceptionPointer(void* pv);\n\n private:\n    static const int c_type = 0x524f4f54;   // 'ROOT'\n    static Exception * g_OOMException;\n    static Exception * g_SOException;\n\n protected:\n    Exception           *m_innerException;\n\n public:\n    Exception() {LIMITED_METHOD_DAC_CONTRACT; m_innerException = NULL;}\n    virtual ~Exception() {LIMITED_METHOD_DAC_CONTRACT; if (m_innerException != NULL) Exception::Delete(m_innerException); }\n#ifdef DACCESS_COMPILE\n    void * operator new(size_t size);\n    void operator delete(void* ptr);\n#endif\n    virtual BOOL IsDomainBound() {return m_innerException!=NULL && m_innerException->IsDomainBound();} ;\n    virtual HRESULT GetHR() = 0;\n    virtual void GetMessage(SString &s);\n    virtual IErrorInfo *GetErrorInfo() { LIMITED_METHOD_CONTRACT; return NULL; }\n    virtual HRESULT SetErrorInfo() { LIMITED_METHOD_CONTRACT; return S_OK; }\n    void SetInnerException(Exception * pInnerException) { LIMITED_METHOD_CONTRACT; m_innerException = pInnerException; }\n\n    // Dynamic type query for catchers\n    static int GetType() { LIMITED_METHOD_CONTRACT; return c_type; }\n    // !!! If GetInstanceType is implemented, IsSameInstanceType should be implemented\n    virtual int GetInstanceType() = 0;\n    virtual BOOL IsType(int type) {LIMITED_METHOD_CONTRACT;  return type == c_type; }\n\n    // This is used in CLRException::GetThrowable to detect if we are in a recursive situation.\n    virtual BOOL IsSameInstanceType(Exception *pException) = 0;\n\n    // Will create a new instance of the Exception.  Note that this will\n    // be free of app domain or thread affinity.  Not every type of exception\n    // can be cloned with full fidelity.\n    virtual Exception *Clone();\n\n    // DomainBoundClone is a specialized form of cloning which is guaranteed\n    // to provide full fidelity.  However, the result is bound to the current\n    // app domain and should not be leaked.\n    Exception *DomainBoundClone();\n\n    class HandlerState\n    {\n        enum CaughtFlags\n        {\n            Caught = 1,\n            CaughtSO = 2,\n            CaughtCxx = 4,\n        };\n\n        DWORD               m_dwFlags;\n    public:\n        Exception*          m_pExceptionPtr;\n\n        HandlerState();\n\n        void CleanupTry();\n        void SetupCatch(INDEBUG_COMMA(_In_z_ const char * szFile) int lineNum);\n        void SucceedCatch();\n\n        BOOL DidCatch() { return (m_dwFlags & Caught); }\n        void SetCaught() { m_dwFlags |= Caught; }\n\n        BOOL DidCatchCxx() { return (m_dwFlags & CaughtCxx); }\n        void SetCaughtCxx() { m_dwFlags |= CaughtCxx; }\n    };\n\n    // Is this exception type considered \"uncatchable\"?\n    BOOL IsTerminal();\n\n    // Is this exception type considered \"transient\" (would a retry possibly succeed)?\n    BOOL IsTransient();\n    static BOOL IsTransient(HRESULT hr);\n\n    // Get an HRESULT's source representation, if known\n    static LPCSTR GetHRSymbolicName(HRESULT hr);\n\n    static Exception* GetOOMException();\n\n    // Preallocated exceptions:  If there is a preallocated instance of some\n    //  subclass of Exception, override this function and return a correct\n    //  value.  The default implementation returns constant FALSE\n    virtual BOOL IsPreallocatedException();\n    BOOL IsPreallocatedOOMException();\n\n    static void Delete(Exception* pvMemory);\n\nprotected:\n\n    // This virtual method must be implemented by any non abstract Exception\n    // derived class. It must allocate a NEW exception of the identical type and\n    // copy all the relevant fields from the current exception to the new one.\n    // It is NOT responsible however for copying the inner exception. This\n    // will be handled by the base Exception class.\n    virtual Exception *CloneHelper();\n\n    // This virtual method must be implemented by Exception subclasses whose\n    // DomainBoundClone behavior is different than their normal clone behavior.\n    // It must allocate a NEW exception of the identical type and\n    // copy all the relevant fields from the current exception to the new one.\n    // It is NOT responsible however for copying the inner exception. This\n    // will be handled by the base Exception class.\n    virtual Exception *DomainBoundCloneHelper() { return CloneHelper(); }\n};\n\n#if 1\n\ninline void Exception__Delete(Exception* pvMemory)\n{\n  Exception::Delete(pvMemory);\n}\n\nusing ExceptionHolder = SpecializedWrapper<Exception, Exception__Delete>;\n#else\n\n//------------------------------------------------------------------------------\n// class ExceptionHolder\n//\n// This is a very lightweight holder class for use inside the EX_TRY family\n//  of macros.  It is based on the standard Holder classes, but has been\n//  highly specialized for this one function, so that extra code can be\n//  removed, and the resulting code can be simple enough for all of the\n//  non-exceptional-case code to be inlined.\nclass ExceptionHolder\n{\nprivate:\n    Exception *m_value;\n    BOOL      m_acquired;\n\npublic:\n    FORCEINLINE ExceptionHolder(Exception *pException = NULL, BOOL take = TRUE)\n      : m_value(pException)\n    {\n        m_acquired = pException && take;\n    }\n\n    FORCEINLINE ~ExceptionHolder()\n    {\n        if (m_acquired)\n        {\n            Exception::Delete(m_value);\n        }\n    }\n\n    Exception* operator->() { return m_value; }\n\n    void operator=(Exception *p)\n    {\n        Release();\n        m_value = p;\n        Acquire();\n    }\n\n    BOOL IsNull() { return m_value == NULL; }\n\n    operator Exception*() { return m_value; }\n\n    Exception* GetValue() { return m_value; }\n\n    void SuppressRelease() { m_acquired = FALSE; }\n\nprivate:\n    void Acquire()\n    {\n        _ASSERTE(!m_acquired);\n\n        if (!IsNull())\n        {\n            m_acquired = TRUE;\n        }\n    }\n    void Release()\n    {\n        if (m_acquired)\n        {\n            _ASSERTE(!IsNull());\n            Exception::Delete(m_value);\n            m_acquired = FALSE;\n        }\n    }\n\n};\n\n#endif\n\n// ---------------------------------------------------------------------------\n// HRException class.  Implements exception API for exceptions generated from HRESULTs\n// ---------------------------------------------------------------------------\n\nclass HRException : public Exception\n{\n    friend bool DebugIsEECxxExceptionPointer(void* pv);\n\n protected:\n    HRESULT             m_hr;\n\n public:\n    HRException();\n    HRException(HRESULT hr);\n\n    static const int c_type = 0x48522020;   // 'HR  '\n\n    // Dynamic type query for catchers\n    static int GetType() {LIMITED_METHOD_DAC_CONTRACT;  return c_type; }\n    virtual int GetInstanceType() { LIMITED_METHOD_CONTRACT; return c_type; }\n    virtual BOOL IsType(int type) { WRAPPER_NO_CONTRACT; return type == c_type || Exception::IsType(type);  }\n    // Virtual overrides\n    HRESULT GetHR();\n\n    BOOL IsSameInstanceType(Exception *pException)\n    {\n        WRAPPER_NO_CONTRACT;\n        return pException->GetInstanceType() == GetType() && pException->GetHR() == m_hr;\n    }\n\n protected:\n    virtual Exception *CloneHelper()\n    {\n        WRAPPER_NO_CONTRACT;\n        return new HRException(m_hr);\n    }\n};\n\n// ---------------------------------------------------------------------------\n// HRMessageException class.  Implements exception API for exceptions\n// generated from HRESULTs, and includes in info message.\n// ---------------------------------------------------------------------------\n\nclass HRMsgException : public HRException\n{\n    friend bool DebugIsEECxxExceptionPointer(void* pv);\n\n protected:\n    SString             m_msg;\n\n public:\n    HRMsgException();\n    HRMsgException(HRESULT hr, SString const &msg);\n\n    // Virtual overrides\n    void GetMessage(SString &s);\n\n protected:\n    virtual Exception *CloneHelper()\n    {\n        WRAPPER_NO_CONTRACT;\n        return new HRMsgException(m_hr, m_msg);\n    }\n};\n\n// ---------------------------------------------------------------------------\n// COMException class.  Implements exception API for standard COM-based error info\n// ---------------------------------------------------------------------------\n\nclass COMException : public HRException\n{\n    friend bool DebugIsEECxxExceptionPointer(void* pv);\n\n private:\n    IErrorInfo          *m_pErrorInfo;\n\n public:\n    COMException();\n    COMException(HRESULT hr) ;\n    COMException(HRESULT hr, IErrorInfo *pErrorInfo);\n    ~COMException();\n\n    // Virtual overrides\n    IErrorInfo *GetErrorInfo();\n#ifdef FEATURE_COMINTEROP\n    void GetMessage(SString &result);\n#endif\n\n protected:\n    virtual Exception *CloneHelper()\n    {\n        WRAPPER_NO_CONTRACT;\n        return new COMException(m_hr, m_pErrorInfo);\n    }\n};\n\n// ---------------------------------------------------------------------------\n// SEHException class.  Implements exception API for SEH exception info\n// ---------------------------------------------------------------------------\n\nclass SEHException : public Exception\n{\n    friend bool DebugIsEECxxExceptionPointer(void* pv);\n\n public:\n    EXCEPTION_RECORD        m_exception;\n\n    SEHException();\n    SEHException(EXCEPTION_RECORD *pRecord, T_CONTEXT *pContext = NULL);\n\n    static const int c_type = 0x53454820;   // 'SEH '\n\n    // Dynamic type query for catchers\n    static int GetType() {LIMITED_METHOD_CONTRACT;  return c_type; }\n    virtual int GetInstanceType() { LIMITED_METHOD_CONTRACT; return c_type; }\n    virtual BOOL IsType(int type) { WRAPPER_NO_CONTRACT; return type == c_type || Exception::IsType(type);  }\n\n    BOOL IsSameInstanceType(Exception *pException)\n    {\n        WRAPPER_NO_CONTRACT;\n        return pException->GetInstanceType() == GetType() && pException->GetHR() == GetHR();\n    }\n\n    // Virtual overrides\n    HRESULT GetHR();\n    IErrorInfo *GetErrorInfo();\n    void GetMessage(SString &result);\n\n protected:\n    virtual Exception *CloneHelper()\n    {\n        WRAPPER_NO_CONTRACT;\n        return new SEHException(&m_exception);\n    }\n};\n\n// ---------------------------------------------------------------------------\n// DelegatingException class.  Implements exception API for \"foreign\" exceptions.\n// ---------------------------------------------------------------------------\n\nclass DelegatingException : public Exception\n{\n    Exception *m_delegatedException;\n    Exception* GetDelegate();\n\n    enum {DELEGATE_NOT_YET_SET = -1};\n    bool IsDelegateSet() {LIMITED_METHOD_DAC_CONTRACT; return m_delegatedException != (Exception*)DELEGATE_NOT_YET_SET; }\n    bool IsDelegateValid() {LIMITED_METHOD_DAC_CONTRACT; return IsDelegateSet() && m_delegatedException != NULL; }\n\n public:\n\n    DelegatingException();\n    ~DelegatingException();\n\n    static const int c_type = 0x44454C20;   // 'DEL '\n\n    // Dynamic type query for catchers\n    static int GetType() {LIMITED_METHOD_CONTRACT; return c_type; }\n    virtual int GetInstanceType() { LIMITED_METHOD_CONTRACT; return c_type; }\n    virtual BOOL IsType(int type) { WRAPPER_NO_CONTRACT; return type == c_type || Exception::IsType(type);  }\n\n    BOOL IsSameInstanceType(Exception *pException)\n    {\n        WRAPPER_NO_CONTRACT;\n        return pException->GetInstanceType() == GetType() && pException->GetHR() == GetHR();\n    }\n\n    // Virtual overrides\n    virtual BOOL IsDomainBound() {return Exception::IsDomainBound() ||(m_delegatedException!=NULL && m_delegatedException->IsDomainBound());} ;\n    HRESULT GetHR();\n    IErrorInfo *GetErrorInfo();\n    void GetMessage(SString &result);\n    virtual Exception *Clone();\n\n protected:\n    virtual Exception *CloneHelper()\n    {\n        WRAPPER_NO_CONTRACT;\n        return new DelegatingException();\n    }\n};\n\n//------------------------------------------------------------------------------\n// class OutOfMemoryException\n//\n//   While there could be any number of instances of this class, there is one\n//    special instance, the pre-allocated OOM exception.  Storage for that\n//    instance is allocated in the image, so we can always obtain it, even\n//    in low memory situations.\n//   Note that, in fact, there is only one instance.\n//------------------------------------------------------------------------------\nclass OutOfMemoryException : public Exception\n{\n private:\n    static const int c_type = 0x4F4F4D20;   // 'OOM '\n    BOOL    bIsPreallocated;\n\n public:\n     OutOfMemoryException() : bIsPreallocated(FALSE) {}\n     OutOfMemoryException(BOOL b) : bIsPreallocated(b) {}\n\n    // Dynamic type query for catchers\n    static int GetType() {LIMITED_METHOD_CONTRACT;  return c_type; }\n    virtual int GetInstanceType() { LIMITED_METHOD_CONTRACT; return c_type; }\n    BOOL IsType(int type) { WRAPPER_NO_CONTRACT; return type == c_type || Exception::IsType(type);  }\n\n    BOOL IsSameInstanceType(Exception *pException)\n    {\n        WRAPPER_NO_CONTRACT;\n        return pException->GetInstanceType() == GetType();\n    }\n\n    HRESULT GetHR() {LIMITED_METHOD_DAC_CONTRACT;  return E_OUTOFMEMORY; }\n    void GetMessage(SString &result) { WRAPPER_NO_CONTRACT; result.SetASCII(\"Out Of Memory\"); }\n\n    virtual Exception *Clone();\n\n    virtual BOOL IsPreallocatedException() { return bIsPreallocated; }\n};\n\ntemplate <typename STATETYPE>\nclass CAutoTryCleanup\n{\npublic:\n    DEBUG_NOINLINE CAutoTryCleanup(STATETYPE& refState) :\n        m_refState(refState)\n    {\n        SCAN_SCOPE_BEGIN;\n        STATIC_CONTRACT_THROWS;\n        STATIC_CONTRACT_SUPPORTS_DAC;\n\n#ifdef ENABLE_CONTRACTS_IMPL\n        // This is similar to ClrTryMarkerHolder. We're marking that its okay to throw on this thread now because\n        // we're within a try block. We fold this into here strictly for performance reasons... we have one\n        // stack-allocated object do the work.\n        m_pClrDebugState = GetClrDebugState();\n        m_oldOkayToThrowValue = m_pClrDebugState->IsOkToThrow();\n        m_pClrDebugState->SetOkToThrow();\n#endif\n    }\n\n    DEBUG_NOINLINE ~CAutoTryCleanup()\n    {\n        SCAN_SCOPE_END;\n        WRAPPER_NO_CONTRACT;\n\n        m_refState.CleanupTry();\n\n#ifdef ENABLE_CONTRACTS_IMPL\n        // Restore the original OkayToThrow value since we're leaving the try block.\n\n        m_pClrDebugState->SetOkToThrow( m_oldOkayToThrowValue );\n#endif // ENABLE_CONTRACTS_IMPL\n    }\n\nprotected:\n    STATETYPE& m_refState;\n\n#ifdef ENABLE_CONTRACTS_DATA\nprivate:\n    BOOL           m_oldOkayToThrowValue;\n    ClrDebugState *m_pClrDebugState;\n#endif\n};\n\n// ---------------------------------------------------------------------------\n// Throw/Catch macros\n//\n// Usage:\n//\n// EX_TRY\n// {\n//      EX_THROW(HRException, (E_FAIL));\n// }\n// EX_CATCH\n// {\n//      Exception *e = GET_EXCEPTION();\n//      EX_RETHROW;\n// }\n// EX_END_CATCH(RethrowTerminalExceptions, RethrowTransientExceptions or SwallowAllExceptions)\n//\n// ---------------------------------------------------------------------------\n\n// ---------------------------------------------------------------------------\n// #NO_HOST_CPP_EH_ONLY\n//\n// The EX_CATCH* macros defined below can work one of two ways:\n//   1. They catch all exceptions, both C++ and SEH exceptions.\n//   2. They catch only C++ exceptions.\n//\n// Which way they are defined depends on what sort of handling of SEH\n// exceptions, like AV's, you wish to have in your DLL. In general we\n// do not typically want to catch and swallow AV's.\n//\n// By default, the macros catch all exceptions. This is how they work when\n// compiled into the primary runtime DLL (clr.dll). This is reasonable for\n// the CLR becuase it needs to also catch managed exceptions, which are SEH\n// exceptions, and because that DLL also includes a vectored exception\n// handler that will take down the process on any AV within clr.dll.\n//\n// But for uses of these macros outside of the CLR DLL there are other\n// possibilities. If a DLL only uses facilities in Utilcode that throw the\n// C++ exceptions defined above, and never needs to catch a managed exception,\n// then that DLL should setup the macros to only catch C++ exceptions. That\n// way, AV's are not accidentally swallowed and hidden.\n//\n// On the other hand, if a DLL needs to catch managed exceptions, then it has\n// no choice but to also catch all SEH exceptions, including AV's. In that case\n// the DLL should also include a vectored handler, like CLR.dll, to take the\n// process down on an AV.\n//\n// The behavior difference is controled by NO_HOST_CPP_EH_ONLY. When defined,\n// the EX_CATCH* macros only catch C++ exceptions. When not defined, they catch\n// C++ and SEH exceptions.\n//\n// Note: use of NO_HOST_CPP_EH_ONLY is only valid outside the primary CLR DLLs.\n// Thus it is an error to attempt to define it without also defining SELF_NO_HOST.\n// ---------------------------------------------------------------------------\n\n#if defined(NO_HOST_CPP_EH_ONLY) && !defined(SELF_NO_HOST)\n#error It is incorrect to attempt to have C++-only EH macros when hosted. This is only valid for components outside the runtime DLLs.\n#endif\n\n//-----------------------------------------------------------------------\n// EX_END_CATCH has a mandatory argument which is one of \"RethrowTerminalExceptions\",\n// \"RethrowTransientExceptions\", or \"SwallowAllExceptions\".\n//\n// If an exception is considered \"terminal\" (e->IsTerminal()), it should normally\n// be allowed to proceed. Hence, most of the time, you should use RethrowTerminalExceptions.\n//\n// In some cases you will want transient exceptions (terminal plus things like\n// resource exhaustion) to proceed as well.  Use RethrowTransientExceptions for this cas.\n//\n// If you have a good reason to use SwallowAllExceptions, (e.g. a hard COM interop boundary)\n// use one of the higher level macros for this if available, or consider developing one.\n// Otherwise, clearly document why you're swallowing terminal exceptions. Raw uses of\n// SwallowAllExceptions will cause the cleanup police to come knocking on your door\n// at some point.\n//\n// A lot of existing TRY's swallow terminals right now simply because there is\n// backout code following the END_CATCH that has to be executed. The solution is\n// to replace that backout code with holder objects.\n\n//-----------------------------------------------------------------------\n\n#define RethrowTransientExceptions                                      \\\n    if (GET_EXCEPTION()->IsTransient())                                 \\\n    {                                                                   \\\n        EX_RETHROW;                                                     \\\n    }                                                                   \\\n\n#define SwallowAllExceptions ;\n\n// When applied to EX_END_CATCH, this policy will always rethrow Terminal exceptions if they are\n// encountered.\n#define RethrowTerminalExceptions                                       \\\n    if (GET_EXCEPTION()->IsTerminal())                                  \\\n    {                                                                   \\\n        STATIC_CONTRACT_THROWS_TERMINAL;                                \\\n        EX_RETHROW;                                                     \\\n    }                                                                   \\\n\n// Special define to be used in EEStartup that will also check for VM initialization before\n// commencing on a path that may use the managed thread object.\n#define RethrowTerminalExceptionsWithInitCheck  \\\n    if ((g_fEEStarted == TRUE) && (GetThreadNULLOk() != NULL))    \\\n    {                                                       \\\n        RethrowTerminalExceptions                           \\\n    }\n\n#ifdef _DEBUG\n\nvoid ExThrowTrap(const char *fcn, const char *file, int line, const char *szType, HRESULT hr, const char *args);\n\n#define EX_THROW_DEBUG_TRAP(fcn, file, line, szType, hr, args) ExThrowTrap(fcn, file, line, szType, hr, args)\n\n#else\n\n#define EX_THROW_DEBUG_TRAP(fcn, file, line, szType, hr, args)\n\n#endif\n\n#define EX_THROW(_type, _args)                                                          \\\n    {                                                                                   \\\n        FAULT_NOT_FATAL();                                                              \\\n                                                                                        \\\n        _type * ___pExForExThrow =  new _type _args ;                                   \\\n                /* don't embed file names in retail to save space and avoid IP */       \\\n                /* a findstr /n will allow you to locate it in a pinch */               \\\n        STRESS_LOG3(LF_EH, LL_INFO100, \"EX_THROW Type = 0x%x HR = 0x%x, \"               \\\n                    INDEBUG(__FILE__) \" line %d\\n\", _type::GetType(),                   \\\n                    ___pExForExThrow->GetHR(), __LINE__);                               \\\n        EX_THROW_DEBUG_TRAP(__FUNCTION__, __FILE__, __LINE__, #_type, ___pExForExThrow->GetHR(), #_args);          \\\n        PAL_CPP_THROW(_type *, ___pExForExThrow);                                       \\\n    }\n\n//--------------------------------------------------------------------------------\n// Clones an exception into the current domain. Also handles special cases for\n// OOM and other stuff. Making this a function so we don't inline all this logic\n// every place we call EX_THROW_WITH_INNER.\n//--------------------------------------------------------------------------------\nException *ExThrowWithInnerHelper(Exception *inner);\n\n// This macro will set the m_innerException into the newly created exception\n// The passed in _type has to be derived from CLRException. You cannot put OOM\n// as the inner exception. If we are throwing in OOM case, allocate more memory (this macro will clone)\n// does not make any sense.\n//\n#define EX_THROW_WITH_INNER(_type, _args, _inner)                                       \\\n    {                                                                                   \\\n        FAULT_NOT_FATAL();                                                              \\\n                                                                                        \\\n        Exception *_inner2 = ExThrowWithInnerHelper(_inner);                            \\\n        _type *___pExForExThrow =  new _type _args ;                                    \\\n        ___pExForExThrow->SetInnerException(_inner2);                                   \\\n        STRESS_LOG3(LF_EH, LL_INFO100, \"EX_THROW_WITH_INNER Type = 0x%x HR = 0x%x, \"    \\\n                    INDEBUG(__FILE__) \" line %d\\n\", _type::GetType(),                   \\\n                    ___pExForExThrow->GetHR(), __LINE__);                               \\\n        EX_THROW_DEBUG_TRAP(__FUNCTION__, __FILE__, __LINE__, #_type, ___pExForExThrow->GetHR(), #_args);          \\\n        PAL_CPP_THROW(_type *, ___pExForExThrow);                                       \\\n    }\n\n//#define IsCLRException(ex) ((ex !=NULL) && ex->IsType(CLRException::GetType())\n\n#define EX_TRY_IMPL EX_TRY_CUSTOM(Exception::HandlerState, , DelegatingException /* was SEHException*/)\n\n#define EX_TRY_CPP_ONLY EX_TRY_CUSTOM_CPP_ONLY(Exception::HandlerState, , DelegatingException /* was SEHException*/)\n\n#ifndef INCONTRACT\n#ifdef ENABLE_CONTRACTS\n#define INCONTRACT(x)          x\n#else\n#define INCONTRACT(x)\n#endif\n#endif\n\n#define EX_TRY_CUSTOM(STATETYPE, STATEARG, DEFAULT_EXCEPTION_TYPE)                      \\\n    {                                                                                   \\\n        STATETYPE               __state STATEARG;                                       \\\n        typedef DEFAULT_EXCEPTION_TYPE  __defaultException_t;                           \\\n        SCAN_EHMARKER();                                                                \\\n        PAL_CPP_TRY                                                                     \\\n        {                                                                               \\\n            SCAN_EHMARKER_TRY();                                                        \\\n            SCAN_EHMARKER();                                                            \\\n            PAL_CPP_TRY                                                                 \\\n            {                                                                           \\\n                SCAN_EHMARKER_TRY();                                                    \\\n                CAutoTryCleanup<STATETYPE> __autoCleanupTry(__state);                   \\\n                /* prevent annotations from being dropped by optimizations in debug */  \\\n                INDEBUG(static bool __alwayszero;)                                      \\\n                INDEBUG(VolatileLoad(&__alwayszero);)                                   \\\n                {                                                                       \\\n                    /* Disallow returns to make exception handling work. */             \\\n                    /* Some work is done after the catch, see EX_ENDTRY. */             \\\n                    DEBUG_ASSURE_NO_RETURN_BEGIN(EX_TRY)                                \\\n                    EX_TRY_HOLDER                                                       \\\n\n\n#define EX_CATCH_IMPL_EX(DerivedExceptionClass)                                         \\\n                    DEBUG_ASSURE_NO_RETURN_END(EX_TRY)                                  \\\n                }                                                                       \\\n                SCAN_EHMARKER_END_TRY();                                                \\\n            }                                                                           \\\n            PAL_CPP_CATCH_DERIVED (DerivedExceptionClass, __pExceptionRaw)              \\\n            {                                                                           \\\n                SCAN_EHMARKER_CATCH();                                                  \\\n                __state.SetCaughtCxx();                                                 \\\n                __state.m_pExceptionPtr = __pExceptionRaw;                              \\\n                SCAN_EHMARKER_END_CATCH();                                              \\\n                SCAN_IGNORE_THROW_MARKER;                                               \\\n                PAL_CPP_RETHROW;                                                        \\\n            }                                                                           \\\n            PAL_CPP_ENDTRY                                                              \\\n            SCAN_EHMARKER_END_TRY();                                                    \\\n        }                                                                               \\\n        PAL_CPP_CATCH_ALL                                                               \\\n        {                                                                               \\\n            SCAN_EHMARKER_CATCH();                                                      \\\n            __defaultException_t __defaultException;                                    \\\n            CHECK::ResetAssert();                                                       \\\n            ExceptionHolder __pException(__state.m_pExceptionPtr);                      \\\n            /* work around unreachable code warning */                                  \\\n            if (true) {                                                                 \\\n                DEBUG_ASSURE_NO_RETURN_BEGIN(EX_CATCH)                                  \\\n                /* don't embed file names in retail to save space and avoid IP */       \\\n                /* a findstr /n will allow you to locate it in a pinch */               \\\n                __state.SetupCatch(INDEBUG_COMMA(__FILE__) __LINE__);                   \\\n\n#define EX_CATCH_IMPL EX_CATCH_IMPL_EX(Exception)\n\n#define EX_TRY_CUSTOM_CPP_ONLY(STATETYPE, STATEARG, DEFAULT_EXCEPTION_TYPE)         \\\n    {                                                                               \\\n        STATETYPE               __state STATEARG;                                   \\\n        typedef DEFAULT_EXCEPTION_TYPE  __defaultException_t;                       \\\n        SCAN_EHMARKER();                                                            \\\n        PAL_CPP_TRY                                                                 \\\n        {                                                                           \\\n            SCAN_EHMARKER_TRY();                                                    \\\n            CAutoTryCleanup<STATETYPE> __autoCleanupTry(__state);                   \\\n            /* prevent annotations from being dropped by optimizations in debug */  \\\n            INDEBUG(static bool __alwayszero;)                                      \\\n            INDEBUG(VolatileLoad(&__alwayszero);)                                   \\\n            {                                                                       \\\n                /* Disallow returns to make exception handling work. */             \\\n                /* Some work is done after the catch, see EX_ENDTRY. */             \\\n                DEBUG_ASSURE_NO_RETURN_BEGIN(EX_TRY)                                \\\n\n#define EX_CATCH_IMPL_CPP_ONLY                                                      \\\n                DEBUG_ASSURE_NO_RETURN_END(EX_TRY)                                  \\\n            }                                                                       \\\n            SCAN_EHMARKER_END_TRY();                                                \\\n        }                                                                           \\\n        PAL_CPP_CATCH_DERIVED (Exception, __pExceptionRaw)                          \\\n        {                                                                           \\\n            SCAN_EHMARKER_CATCH();                                                  \\\n            __state.SetCaughtCxx();                                                 \\\n            __state.m_pExceptionPtr = __pExceptionRaw;                              \\\n            SCAN_EHMARKER_END_CATCH();                                              \\\n            SCAN_IGNORE_THROW_MARKER;                                               \\\n            __defaultException_t __defaultException;                                \\\n            CHECK::ResetAssert();                                                   \\\n            ExceptionHolder __pException(__state.m_pExceptionPtr);                  \\\n            /* work around unreachable code warning */                              \\\n            if (true) {                                                             \\\n                DEBUG_ASSURE_NO_RETURN_BEGIN(EX_CATCH)                              \\\n                /* don't embed file names in retail to save space and avoid IP */   \\\n                /* a findstr /n will allow you to locate it in a pinch */           \\\n                __state.SetupCatch(INDEBUG_COMMA(__FILE__) __LINE__);               \\\n\n\n// Here we finally define the EX_CATCH* macros that will be used throughout the system.\n// These can catch C++ and SEH exceptions, or just C++ exceptions.\n// See code:NO_HOST_CPP_EH_ONLY for more details.\n//\n// Note: we make it illegal to use forms that are redundant with the basic EX_CATCH\n// version. I.e., in the C++ & SEH version, EX_CATCH_CPP_AND_SEH is the same as EX_CATCH.\n// Likewise, in the C++ only version, EX_CATCH_CPP_ONLY is redundant with EX_CATCH.\n\n#ifndef NO_HOST_CPP_EH_ONLY\n#define EX_TRY                  EX_TRY_IMPL\n#define EX_CATCH                EX_CATCH_IMPL\n#define EX_CATCH_EX             EX_CATCH_IMPL_EX\n#define EX_CATCH_CPP_ONLY       EX_CATCH_IMPL_CPP_ONLY\n#define EX_CATCH_CPP_AND_SEH    Dont_Use_EX_CATCH_CPP_AND_SEH\n#else\n#define EX_TRY                  EX_TRY_CPP_ONLY\n#define EX_CATCH                EX_CATCH_IMPL_CPP_ONLY\n#define EX_CATCH_CPP_ONLY       Dont_Use_EX_CATCH_CPP_ONLY\n#define EX_CATCH_CPP_AND_SEH    EX_CATCH_IMPL\n\n// Note: at this time we don't have a use case for EX_CATCH_EX, and we do not have\n// the C++-only version of the implementation available. Thus we disallow its use at this time.\n// If a real use case arises then we should go ahead and enable this.\n#define EX_CATCH_EX             Dont_Use_EX_CATCH_EX\n#endif\n\n#define EX_END_CATCH_UNREACHABLE                                                        \\\n                DEBUG_ASSURE_NO_RETURN_END(EX_CATCH)                                    \\\n            }                                                                           \\\n            SCAN_EHMARKER_END_CATCH();                                                  \\\n            UNREACHABLE();                                                              \\\n        }                                                                               \\\n        PAL_CPP_ENDTRY                                                                  \\\n    }                                                                                   \\\n\n\n// \"terminalexceptionpolicy\" must be one of \"RethrowTerminalExceptions\",\n// \"RethrowTransientExceptions\", or \"SwallowAllExceptions\"\n\n#define EX_END_CATCH(terminalexceptionpolicy)                                           \\\n                terminalexceptionpolicy;                                                \\\n                __state.SucceedCatch();                                                 \\\n                DEBUG_ASSURE_NO_RETURN_END(EX_CATCH)                                    \\\n            }                                                                           \\\n            SCAN_EHMARKER_END_CATCH();                                                  \\\n        }                                                                               \\\n        EX_ENDTRY                                                                       \\\n    }                                                                                   \\\n\n\n#define EX_END_CATCH_FOR_HOOK                                                           \\\n                __state.SucceedCatch();                                                 \\\n                DEBUG_ASSURE_NO_RETURN_END(EX_CATCH)                                    \\\n                ANNOTATION_HANDLER_END;                                                 \\\n            }                                                                           \\\n            SCAN_EHMARKER_END_CATCH();                                                  \\\n        }                                                                               \\\n        EX_ENDTRY\n\n#define EX_ENDTRY                                                                       \\\n        PAL_CPP_ENDTRY\n\n#define EX_RETHROW                                                                      \\\n        {                                                                               \\\n            __pException.SuppressRelease();                                             \\\n            PAL_CPP_RETHROW;                                                            \\\n        }                                                                               \\\n\n // Define a copy of GET_EXCEPTION() that will not be redefined by clrex.h\n#define GET_EXCEPTION() (__pException == NULL ? &__defaultException : __pException.GetValue())\n#define EXTRACT_EXCEPTION() (__pException.Extract())\n\n\n//==============================================================================\n// High-level macros for common uses of EX_TRY. Try using these rather\n// than the raw EX_TRY constructs.\n//==============================================================================\n\n//===================================================================================\n// Macro for converting exceptions into HR internally. Unlike EX_CATCH_HRESULT,\n// it does not set up IErrorInfo on the current thread.\n//\n// Usage:\n//\n//   HRESULT hr = S_OK;\n//   EX_TRY\n//   <do managed stuff>\n//   EX_CATCH_HRESULT_NO_ERRORINFO(hr);\n//   return hr;\n//\n// Comments:\n//   Since IErrorInfo is not set up, this does not require COM interop to be started.\n//===================================================================================\n\n#define EX_CATCH_HRESULT_NO_ERRORINFO(_hr)                                      \\\n    EX_CATCH                                                                    \\\n    {                                                                           \\\n        (_hr) = GET_EXCEPTION()->GetHR();                                       \\\n        _ASSERTE(FAILED(_hr));                                                  \\\n    }                                                                           \\\n    EX_END_CATCH(SwallowAllExceptions)\n\n\n//===================================================================================\n// Macro for catching managed exception object.\n//\n// Usage:\n//\n//   OBJECTREF pThrowable = NULL;\n//   EX_TRY\n//   <do managed stuff>\n//   EX_CATCH_THROWABLE(&pThrowable);\n//\n//===================================================================================\n\n#define EX_CATCH_THROWABLE(ppThrowable)                                         \\\n    EX_CATCH                                                                    \\\n    {                                                                           \\\n        *ppThrowable = GET_THROWABLE();                                         \\\n    }                                                                           \\\n    EX_END_CATCH(SwallowAllExceptions)\n\n\n#ifdef FEATURE_COMINTEROP\n\n//===================================================================================\n// Macro for defining external entrypoints such as COM interop boundaries.\n// The boundary will catch all exceptions (including terminals) and convert\n// them into HR/IErrorInfo pairs as appropriate.\n//\n// Usage:\n//\n//   HRESULT hr = S_OK;\n//   EX_TRY\n//   <do managed stuff>\n//   EX_CATCH_HRESULT(hr);\n//   return hr;\n//\n// Comments:\n//   Note that IErrorInfo will automatically be set up on the thread if appropriate.\n//===================================================================================\n\n#define EX_CATCH_HRESULT(_hr)                                                   \\\n    EX_CATCH                                                                    \\\n    {                                                                           \\\n        (_hr) = GET_EXCEPTION()->GetHR();                                       \\\n        _ASSERTE(FAILED(_hr));                                                  \\\n        IErrorInfo *pErr = GET_EXCEPTION()->GetErrorInfo();                     \\\n        if (pErr != NULL)                                                       \\\n        {                                                                       \\\n            SetErrorInfo(0, pErr);                                              \\\n            pErr->Release();                                                    \\\n        }                                                                       \\\n    }                                                                           \\\n    EX_END_CATCH(SwallowAllExceptions)\n\n//===================================================================================\n// Macro to make conditional catching more succinct.\n//\n// Usage:\n//\n//   EX_TRY\n//   ...\n//   EX_CATCH_HRESULT_IF(IsHRESULTForExceptionKind(GET_EXCEPTION()->GetHR(), kFileNotFoundException));\n//===================================================================================\n\n#define EX_CATCH_HRESULT_IF(HR, ...)                                            \\\n    EX_CATCH                                                                    \\\n    {                                                                           \\\n        (HR) = GET_EXCEPTION()->GetHR();                                        \\\n                                                                                \\\n        /* Rethrow if condition is false. */                                    \\\n        if (!(__VA_ARGS__))                                                     \\\n            EX_RETHROW;                                                         \\\n                                                                                \\\n        _ASSERTE(FAILED(HR));                                                   \\\n        IErrorInfo *pErr = GET_EXCEPTION()->GetErrorInfo();                     \\\n        if (pErr != NULL)                                                       \\\n        {                                                                       \\\n            SetErrorInfo(0, pErr);                                              \\\n            pErr->Release();                                                    \\\n        }                                                                       \\\n    }                                                                           \\\n    EX_END_CATCH(SwallowAllExceptions)\n\n#else // FEATURE_COMINTEROP\n\n#define EX_CATCH_HRESULT(_hr) EX_CATCH_HRESULT_NO_ERRORINFO(_hr)\n\n#endif // FEATURE_COMINTEROP\n\n//===================================================================================\n// Macro for containing normal exceptions but letting terminal exceptions continue to propagate.\n//\n// Usage:\n//\n//  EX_TRY\n//  {\n//      ...your stuff...\n//  }\n//  EX_SWALLOW_NONTERMINAL\n//\n// Remember, terminal exceptions (such as ThreadAbort) will still throw out of this\n// block. So don't use this as a substitute for exception-safe cleanup!\n//===================================================================================\n\n#define EX_SWALLOW_NONTERMINAL                           \\\n    EX_CATCH                                             \\\n    {                                                    \\\n    }                                                    \\\n    EX_END_CATCH(RethrowTerminalExceptions)              \\\n\n\n//===================================================================================\n// Macro for containing normal exceptions but letting transient exceptions continue to propagate.\n//\n// Usage:\n//\n//  EX_TRY\n//  {\n//      ...your stuff...\n//  }\n//  EX_SWALLOW_NONTRANSIENT\n//\n// Terminal exceptions (such as ThreadAbort and OutOfMemory) will still throw out of this\n// block. So don't use this as a substitute for exception-safe cleanup!\n//===================================================================================\n\n#define EX_SWALLOW_NONTRANSIENT                          \\\n    EX_CATCH                                             \\\n    {                                                    \\\n    }                                                    \\\n    EX_END_CATCH(RethrowTransientExceptions)             \\\n\n\n//===================================================================================\n// Macro for observing or wrapping exceptions in flight.\n//\n// Usage:\n//\n//   EX_TRY\n//   {\n//      ... your stuff ...\n//   }\n//   EX_HOOK\n//   {\n//      ... your stuff ...\n//   }\n//   EX_END_HOOK\n//   ... control will never get here ...\n//\n//\n// EX_HOOK is like EX_CATCH except that you can't prevent the\n// exception from being rethrown. You can throw a new exception inside the hook\n// (for example, if you want to wrap the exception in flight with your own).\n// But if control reaches the end of the hook, the original exception gets rethrown.\n//\n// Avoid using EX_HOOK for conditional backout if a destructor-based holder\n// will suffice. Because these macros are implemented on top of SEH, using them will\n// prevent the use of holders anywhere else inside the same function. That is, instead\n// of saying this:\n//\n//     EX_TRY          // DON'T DO THIS\n//     {\n//          thing = new Thing();\n//          blah\n//     }\n//     EX_HOOK\n//     {\n//          delete thing; // if it failed, we don't want to keep the Thing.\n//     }\n//     EX_END_HOOK\n//\n// do this:\n//\n//     Holder<Thing> thing = new Thing();   //DO THIS INSTEAD\n//     blah\n//     // If we got here, we succeeded. So tell holder we want to keep the thing.\n//     thing.SuppressRelease();\n//\n//\tWe won't rethrow the exception if it is a Stack Overflow exception. Instead, we'll throw a new\n//   exception. This will allow the stack to unwind point, and so we won't be jeopardizing a\n//   second stack overflow.\n//===================================================================================\n#define EX_HOOK                                          \\\n    EX_CATCH                                             \\\n    {                                                    \\\n\n#define EX_END_HOOK                                      \\\n    }                                                    \\\n    ANNOTATION_HANDLER_END;                              \\\n    EX_RETHROW;                                          \\\n    EX_END_CATCH_FOR_HOOK;                               \\\n    }\n\n// ---------------------------------------------------------------------------\n// Inline implementations. Pay no attention to that man behind the curtain.\n// ---------------------------------------------------------------------------\n\ninline Exception::HandlerState::HandlerState()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_CANNOT_TAKE_LOCK;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n\n    m_dwFlags = 0;\n    m_pExceptionPtr = NULL;\n\n#if defined(STACK_GUARDS_DEBUG) && defined(ENABLE_CONTRACTS_IMPL)\n    // If we have a debug state, use its setting for SO tolerance.  The default\n    // is SO-tolerant if we have no debug state.  Can't probe w/o debug state and\n    // can't enter SO-interolant mode w/o probing.\n    GetClrDebugState();\n#endif\n}\n\ninline void Exception::HandlerState::CleanupTry()\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n}\n\ninline void Exception::HandlerState::SetupCatch(INDEBUG_COMMA(_In_z_ const char * szFile) int lineNum)\n{\n    WRAPPER_NO_CONTRACT;\n\n    /* don't embed file names in retail to save space and avoid IP */\n    /* a findstr /n will allow you to locate it in a pinch */\n#ifdef _DEBUG\n    STRESS_LOG2(LF_EH, LL_INFO100, \"EX_CATCH %s line %d\\n\", szFile, lineNum);\n#else\n    STRESS_LOG1(LF_EH, LL_INFO100, \"EX_CATCH line %d\\n\", lineNum);\n#endif\n\n    SetCaught();\n}\n\ninline void Exception::HandlerState::SucceedCatch()\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n}\n\ninline HRException::HRException()\n  : m_hr(E_UNEXPECTED)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n}\n\ninline HRException::HRException(HRESULT hr)\n  : m_hr(hr)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    // Catchers assume only failing hresults\n    _ASSERTE(FAILED(hr));\n}\n\ninline HRMsgException::HRMsgException()\n  : HRException()\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ninline HRMsgException::HRMsgException(HRESULT hr, SString const &s)\n  : HRException(hr), m_msg(s)\n{\n    WRAPPER_NO_CONTRACT;\n}\n\ninline COMException::COMException()\n  : HRException(),\n  m_pErrorInfo(NULL)\n{\n    WRAPPER_NO_CONTRACT;\n}\n\ninline COMException::COMException(HRESULT hr)\n  : HRException(hr),\n  m_pErrorInfo(NULL)\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ninline COMException::COMException(HRESULT hr, IErrorInfo *pErrorInfo)\n  : HRException(hr),\n  m_pErrorInfo(pErrorInfo)\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ninline SEHException::SEHException()\n{\n    LIMITED_METHOD_CONTRACT;\n    memset(&m_exception, 0, sizeof(EXCEPTION_RECORD));\n}\n\ninline SEHException::SEHException(EXCEPTION_RECORD *pointers, T_CONTEXT *pContext)\n{\n    LIMITED_METHOD_CONTRACT;\n    memcpy(&m_exception, pointers, sizeof(EXCEPTION_RECORD));\n}\n\n// The exception throwing helpers are intentionally not inlined\n// Exception throwing is a rare slow codepath that should be optimized for code size\n\nvoid DECLSPEC_NORETURN ThrowHR(HRESULT hr);\nvoid DECLSPEC_NORETURN ThrowHR(HRESULT hr, SString const &msg);\nvoid DECLSPEC_NORETURN ThrowHR(HRESULT hr, UINT uText);\nvoid DECLSPEC_NORETURN ThrowWin32(DWORD err);\nvoid DECLSPEC_NORETURN ThrowLastError();\nvoid DECLSPEC_NORETURN ThrowOutOfMemory();\nvoid DECLSPEC_NORETURN ThrowStackOverflow();\n\n#undef IfFailThrow\ninline HRESULT IfFailThrow(HRESULT hr)\n{\n    WRAPPER_NO_CONTRACT;\n\n    if (FAILED(hr))\n    {\n        ThrowHR(hr);\n    }\n\n    return hr;\n}\n\ninline HRESULT IfFailThrow(HRESULT hr, SString &msg)\n{\n    WRAPPER_NO_CONTRACT;\n\n    if (FAILED(hr))\n    {\n        ThrowHR(hr, msg);\n    }\n\n    return hr;\n}\n\ninline HRESULT IfTransientFailThrow(HRESULT hr)\n{\n    WRAPPER_NO_CONTRACT;\n\n    if (FAILED(hr) && Exception::IsTransient(hr))\n    {\n        ThrowHR(hr);\n    }\n\n    return hr;\n}\n\n// Set if fatal error (like stack overflow or out of memory) occurred in this process.\nGVAL_DECL(HRESULT, g_hrFatalError);\n\n#endif  // _EX_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/executableallocator.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n// Allocator and holders for double mapped executable memory\n//\n\n#pragma once\n\n#include \"utilcode.h\"\n#include \"ex.h\"\n\n#include \"minipal.h\"\n\n#ifndef DACCESS_COMPILE\n\n//#define LOG_EXECUTABLE_ALLOCATOR_STATISTICS\n\n// This class is responsible for allocation of all the executable memory in the runtime.\nclass ExecutableAllocator\n{\n    // RX address range block descriptor\n    struct BlockRX\n    {\n        // Next block in a linked list\n        BlockRX* next;\n        // Base address of the block\n        void* baseRX;\n        // Size of the block\n        size_t size;\n        // Offset of the block in the shared memory\n        size_t offset;\n    };\n\n    // RW address range block descriptor\n    struct BlockRW\n    {\n        // Next block in a linked list\n        BlockRW* next;\n        // Base address of the RW mapping of the block\n        void* baseRW;\n        // Base address of the RX mapping of the block\n        void* baseRX;\n        // Size of the block\n        size_t size;\n        // Usage reference count of the RW block. RW blocks can be reused\n        // when multiple mappings overlap in the VA space at the same time\n        // (even from multiple threads)\n        size_t refCount;\n    };\n\n    typedef void (*FatalErrorHandler)(UINT errorCode, LPCWSTR pszMessage);\n#ifdef LOG_EXECUTABLE_ALLOCATOR_STATISTICS\n    static int64_t g_mapTimeSum;\n    static int64_t g_mapTimeWithLockSum;\n    static int64_t g_unmapTimeSum;\n    static int64_t g_unmapTimeWithLockSum;\n    static int64_t g_mapFindRXTimeSum;\n    static int64_t g_mapCreateTimeSum;\n\n    static int64_t g_releaseCount;\n    static int64_t g_reserveCount;\n#endif\n    // Instance of the allocator\n    static ExecutableAllocator* g_instance;\n\n    // Callback to the runtime to report fatal errors\n    static FatalErrorHandler g_fatalErrorHandler;\n\n#if USE_LAZY_PREFERRED_RANGE\n    static BYTE* g_lazyPreferredRangeStart;\n    // Next address to try to allocate for code in the lazy preferred region.\n    static BYTE* g_lazyPreferredRangeHint;\n#endif // USE_LAZY_PREFERRED_RANGE\n\n    // For PAL, this region represents the area that is eagerly reserved on\n    // startup where executable memory and static fields are preferrably kept.\n    // For Windows, this is the region that we lazily reserve from.\n    static BYTE* g_preferredRangeMin;\n    static BYTE* g_preferredRangeMax;\n\n    // Caches the COMPlus_EnableWXORX setting\n    static bool g_isWXorXEnabled;\n\n    // Head of the linked list of all RX blocks that were allocated by this allocator\n    BlockRX* m_pFirstBlockRX = NULL;\n\n    // Head of the linked list of free RX blocks that were allocated by this allocator and then backed out\n    BlockRX* m_pFirstFreeBlockRX = NULL;\n\n    // Head of the linked list of currently mapped RW blocks\n    BlockRW* m_pFirstBlockRW = NULL;\n\n    // Handle of the double mapped memory mapper\n    void *m_doubleMemoryMapperHandle = NULL;\n\n    // Maximum size of executable memory this allocator can allocate\n    size_t m_maxExecutableCodeSize;\n\n    // First free offset in the underlying shared memory. It is not used\n    // for platforms that don't use shared memory.\n    size_t m_freeOffset = 0;\n\n    // Last RW mapping cached so that it can be reused for the next mapping\n    // request if it goes into the same range.\n    BlockRW* m_cachedMapping = NULL;\n\n    // Synchronization of the public allocator methods\n    CRITSEC_COOKIE m_CriticalSection;\n\n    // Update currently cached mapping. If the passed in block is the same as the one\n    // in the cache, it keeps it cached. Otherwise it destroys the currently cached one\n    // and replaces it by the passed in one.\n    void UpdateCachedMapping(BlockRW *pBlock);\n\n    // Find existing RW block that maps the whole specified range of RX memory.\n    // Return NULL if no such block exists.\n    void* FindRWBlock(void* baseRX, size_t size);\n\n    // Add RW block to the list of existing RW blocks\n    bool AddRWBlock(void* baseRW, void* baseRX, size_t size);\n\n    // Remove RW block from the list of existing RW blocks and return the base\n    // address and size the underlying memory was mapped at.\n    // Return false if no existing RW block contains the passed in address.\n    bool RemoveRWBlock(void* pRW, void** pUnmapAddress, size_t* pUnmapSize);\n\n    // Find a free block with the closest size >= the requested size.\n    // Returns NULL if no such block exists.\n    BlockRX* FindBestFreeBlock(size_t size);\n\n    // Return memory mapping granularity.\n    static size_t Granularity();\n\n    // Allocate a block of executable memory of the specified size.\n    // It doesn't acquire the actual virtual memory, just the\n    // range of the underlying shared memory.\n    BlockRX* AllocateBlock(size_t size, bool* pIsFreeBlock);\n\n    // Backout the block allocated by AllocateBlock in case of an\n    // error.\n    void BackoutBlock(BlockRX* pBlock, bool isFreeBlock);\n\n    // Allocate range of offsets in the underlying shared memory\n    bool AllocateOffset(size_t* pOffset, size_t size);\n\n    // Add RX block to the linked list of existing blocks\n    void AddRXBlock(BlockRX *pBlock);\n\n    // Return true if double mapping is enabled.\n    static bool IsDoubleMappingEnabled();\n\n    // Initialize the allocator instance\n    bool Initialize();\n\n#ifdef LOG_EXECUTABLE_ALLOCATOR_STATISTICS\n    static CRITSEC_COOKIE s_LoggerCriticalSection;\n\n    struct LogEntry\n    {\n        const char* source;\n        const char* function;\n        int line;\n        int count;\n    };\n\n    static LogEntry s_usageLog[256];\n    static int s_logMaxIndex;\n#endif\n\npublic:\n\n#ifdef LOG_EXECUTABLE_ALLOCATOR_STATISTICS\n    static void LogUsage(const char* source, int line, const char* function);\n    static void DumpHolderUsage();\n#endif\n\n    // Return the ExecuteAllocator singleton instance\n    static ExecutableAllocator* Instance();\n\n    // Initialize the static members of the Executable allocator and allocate\n    // and initialize the instance of it.\n    static HRESULT StaticInitialize(FatalErrorHandler fatalErrorHandler);\n\n    // Destroy the allocator\n    ~ExecutableAllocator();\n\n    // Return true if W^X is enabled\n    static bool IsWXORXEnabled();\n\n    // Use this function to initialize g_lazyPreferredRangeHint during startup.\n    // base is runtime .dll base address, size is runtime .dll virtual size.\n    static void InitLazyPreferredRange(size_t base, size_t size, int randomPageOffset);\n\n    // Use this function to reset g_lazyPreferredRangeHint after unloading code.\n    static void ResetLazyPreferredRangeHint();\n\n    // Use this function to initialize the preferred range of executable memory\n    // from PAL.\n    static void InitPreferredRange();\n\n    // Returns TRUE if p is located in near clr.dll that allows us\n    // to use rel32 IP-relative addressing modes.\n    static bool IsPreferredExecutableRange(void* p);\n\n    // Reserve the specified amount of virtual address space for executable mapping.\n    void* Reserve(size_t size);\n\n    // Reserve the specified amount of virtual address space for executable mapping.\n    // The reserved range must be within the loAddress and hiAddress. If it is not\n    // possible to reserve memory in such range, the method returns NULL.\n    void* ReserveWithinRange(size_t size, const void* loAddress, const void* hiAddress);\n\n    // Reserve the specified amount of virtual address space for executable mapping\n    // exactly at the given address.\n    void* ReserveAt(void* baseAddressRX, size_t size);\n\n    // Commit the specified range of memory. The memory can be committed as executable (RX)\n    // or non-executable (RW) based on the passed in isExecutable flag. The non-executable\n    // allocations are used to allocate data structures that need to be close to the\n    // executable code due to memory addressing performance related reasons.\n    void* Commit(void* pStart, size_t size, bool isExecutable);\n\n    // Release the executable memory block starting at the passed in address that was allocated\n    // by one of the ReserveXXX methods.\n    void Release(void* pRX);\n\n    // Map the specified block of executable memory as RW\n    void* MapRW(void* pRX, size_t size);\n\n    // Unmap the RW mapping at the specified address\n    void UnmapRW(void* pRW);\n};\n\n#define ExecutableWriterHolder ExecutableWriterHolderNoLog\n\n// Holder class to map read-execute memory as read-write so that it can be modified without using read-write-execute mapping.\n// At the moment the implementation is dummy, returning the same addresses for both cases and expecting them to be read-write-execute.\n// The class uses the move semantics to ensure proper unmapping in case of re-assigning of the holder value.\ntemplate<typename T>\nclass ExecutableWriterHolder\n{\n    T *m_addressRX;\n    T *m_addressRW;\n\n    void Move(ExecutableWriterHolder& other)\n    {\n        m_addressRX = other.m_addressRX;\n        m_addressRW = other.m_addressRW;\n        other.m_addressRX = NULL;\n        other.m_addressRW = NULL;\n    }\n\n    void Unmap()\n    {\n#if defined(HOST_OSX) && defined(HOST_ARM64) && !defined(DACCESS_COMPILE)\n        if (m_addressRX != NULL)\n        {\n            PAL_JitWriteProtect(false);\n        }\n#else\n        if (m_addressRX != m_addressRW)\n        {\n            ExecutableAllocator::Instance()->UnmapRW((void*)m_addressRW);\n        }\n#endif\n    }\n\npublic:\n    ExecutableWriterHolder(const ExecutableWriterHolder& other) = delete;\n    ExecutableWriterHolder& operator=(const ExecutableWriterHolder& other) = delete;\n\n    ExecutableWriterHolder(ExecutableWriterHolder&& other)\n    {\n        Move(other);\n    }\n\n    ExecutableWriterHolder& operator=(ExecutableWriterHolder&& other)\n    {\n        Unmap();\n        Move(other);\n        return *this;\n    }\n\n    ExecutableWriterHolder() : m_addressRX(nullptr), m_addressRW(nullptr)\n    {\n    }\n\n    ExecutableWriterHolder(T* addressRX, size_t size)\n    {\n        m_addressRX = addressRX;\n#if defined(HOST_OSX) && defined(HOST_ARM64)\n        m_addressRW = addressRX;\n        PAL_JitWriteProtect(true);\n#else\n        m_addressRW = (T *)ExecutableAllocator::Instance()->MapRW((void*)addressRX, size);\n#endif\n    }\n\n    ~ExecutableWriterHolder()\n    {\n        Unmap();\n    }\n\n    // Get the writeable address\n    inline T *GetRW() const\n    {\n        return m_addressRW;\n    }\n\n    void AssignExecutableWriterHolder(T* addressRX, size_t size)\n    {\n        *this = ExecutableWriterHolder(addressRX, size);\n    }\n};\n\n#ifdef LOG_EXECUTABLE_ALLOCATOR_STATISTICS\n#undef ExecutableWriterHolder\n#ifdef TARGET_UNIX\n#define ExecutableWriterHolder ExecutableAllocator::LogUsage(__FILE__, __LINE__, __PRETTY_FUNCTION__); ExecutableWriterHolderNoLog\n#define AssignExecutableWriterHolder(addressRX, size) AssignExecutableWriterHolder(addressRX, size); ExecutableAllocator::LogUsage(__FILE__, __LINE__, __PRETTY_FUNCTION__); \n#else\n#define ExecutableWriterHolder ExecutableAllocator::LogUsage(__FILE__, __LINE__, __FUNCTION__); ExecutableWriterHolderNoLog\n#define AssignExecutableWriterHolder(addressRX, size) AssignExecutableWriterHolder(addressRX, size); ExecutableAllocator::LogUsage(__FILE__, __LINE__, __FUNCTION__); \n#endif\n#else\n#define ExecutableWriterHolder ExecutableWriterHolderNoLog\n#endif\n\n#endif // !DACCESS_COMPILE\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/factory.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef _FACTORY_H_\n#define _FACTORY_H_\n\ntemplate<typename PRODUCT>\nclass Factory\n{\npublic:\n    virtual PRODUCT* Create() = 0;\n    virtual ~Factory() {}\n};\n\ntemplate<typename PRODUCT, DWORD MAX_FACTORY_PRODUCT = 64>\nclass InlineFactory : public Factory<PRODUCT>\n{\npublic:\n    InlineFactory() : m_next(NULL), m_cProduct(0) { WRAPPER_NO_CONTRACT; }\n    ~InlineFactory() { WRAPPER_NO_CONTRACT; if (m_next) delete m_next; }\n    PRODUCT* Create();\n\nprivate:\n    InlineFactory* GetNext()\n    {\n        CONTRACTL {\n            NOTHROW;\n            GC_NOTRIGGER;\n        } CONTRACTL_END;\n\n        if (m_next == NULL)\n        {\n            m_next = new (nothrow) InlineFactory<PRODUCT, MAX_FACTORY_PRODUCT>();\n        }\n\n        return m_next;\n    }\n\n    InlineFactory* m_next;\n    PRODUCT m_product[MAX_FACTORY_PRODUCT];\n    INT32 m_cProduct;\n};\n\n#include \"factory.inl\"\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/factory.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _FACTORY_INL_\n#define _FACTORY_INL_\n\n#include \"factory.h\"\n\ntemplate<typename PRODUCT, DWORD MAX_FACTORY_PRODUCT>\nPRODUCT* InlineFactory<PRODUCT, MAX_FACTORY_PRODUCT>::Create()\n{\n    WRAPPER_NO_CONTRACT;\n\n    if (m_cProduct == MAX_FACTORY_PRODUCT)\n    {\n        InlineFactory* pNext = GetNext();\n        if (pNext)\n        {\n            return pNext->Create();\n        }\n        else\n        {\n            return NULL;\n        }\n    }\n\n    return &m_product[m_cProduct++];\n}\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/formattype.cpp",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n/******************************************************************************/\n/*                                 formatType.cpp                             */\n/******************************************************************************/\n#include \"formattype.h\"\n\n/******************************************************************************/\nchar* asString(CQuickBytes *out) {\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    SIZE_T oldSize = out->Size();\n    out->ReSizeThrows(oldSize + 1);\n    char* cur = &((char*) out->Ptr())[oldSize];\n    *cur = 0;\n    out->ReSizeThrows(oldSize);     // Don't count the null character\n    return((char*) out->Ptr());\n}\n\nvoid appendStr(CQuickBytes *out, const char* str, unsigned len) {\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if(len == (unsigned)(-1)) len = (unsigned)strlen(str);\n    SIZE_T oldSize = out->Size();\n    out->ReSizeThrows(oldSize + len);\n    char* cur = &((char*) out->Ptr())[oldSize];\n    memcpy(cur, str, len);\n        // Note no trailing null!\n}\n\nvoid appendChar(CQuickBytes *out, char chr) {\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    SIZE_T oldSize = out->Size();\n    out->ReSizeThrows(oldSize + 1);\n    ((char*) out->Ptr())[oldSize] = chr;\n        // Note no trailing null!\n}\n\nvoid insertStr(CQuickBytes *out, const char* str) {\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    unsigned len = (unsigned)strlen(str);\n    SIZE_T oldSize = out->Size();\n    out->ReSizeThrows(oldSize + len);\n    char* cur = &((char*) out->Ptr())[len];\n    memmove(cur,out->Ptr(),oldSize);\n    memcpy(out->Ptr(), str, len);\n        // Note no trailing null!\n}\n\nstatic void appendStrNum(CQuickBytes *out, int num) {\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    char buff[16];\n    sprintf_s(buff, ARRAY_SIZE(buff), \"%d\", num);\n    appendStr(out, buff);\n}\n\nPCCOR_SIGNATURE PrettyPrintSignature(\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    unsigned typeLen,                   // the length of 'typePtr'\n    const char* name,                   // can be \"\", the name of the method for this sig 0 means local var sig\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI,           // ptr to IMDInternalImport class with ComSig\n\t_In_opt_z_ const char* inlabel,       // prefix for names (NULL if no names required)\n    BOOL printTyArity=FALSE);\n\n\nPCCOR_SIGNATURE PrettyPrintTypeOrDef(\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI);          // ptr to IMDInternal class with ComSig\n\n//*****************************************************************************\n// Parse a length, return the length, size of the length.\n//*****************************************************************************\nULONG GetLength(            // Length or -1 on error.\n    void const *pData,      // First byte of length.\n    int        *pSizeLen)   // Put size of length here, if not 0.\n{\n    LIMITED_METHOD_CONTRACT;\n\n    BYTE const *pBytes = reinterpret_cast<BYTE const*>(pData);\n\n    if(pBytes)\n    {\n        if ((*pBytes & 0x80) == 0x00)       // 0??? ????\n        {\n            if (pSizeLen) *pSizeLen = 1;\n            return (*pBytes & 0x7f);\n        }\n\n        if ((*pBytes & 0xC0) == 0x80)       // 10?? ????\n        {\n            if (pSizeLen) *pSizeLen = 2;\n            return ((*pBytes & 0x3f) << 8 | *(pBytes+1));\n        }\n\n        if ((*pBytes & 0xE0) == 0xC0)       // 110? ????\n        {\n            if (pSizeLen) *pSizeLen = 4;\n            return ((*pBytes & 0x1f) << 24 | *(pBytes+1) << 16 | *(pBytes+2) << 8 | *(pBytes+3));\n        }\n    }\n    if(pSizeLen) *pSizeLen = 0;\n    return 0;\n}\n\n\n/******************************************************************************/\nconst char* PrettyPrintSig(\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    unsigned typeLen,                   // the length of 'typePtr'\n    const char* name,                   // can be \"\", the name of the method for this sig 0 means local var sig\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI,           // ptr to IMDInternalImport class with ComSig\n    const char* inlabel,                // prefix for names (NULL if no names required)\n    BOOL printTyArity)\n{\n    STATIC_CONTRACT_THROWS;\n\n    EX_TRY\n    {\n        PrettyPrintSignature(typePtr,\n                             typeLen,\n                             name,\n                             out,\n                             pIMDI,\n                             inlabel,\n                             printTyArity);\n    }\n    EX_CATCH\n    {\n        out->Shrink(0);\n        appendStr(out,\"ERROR PARSING THE SIGNATURE\");\n    }\n    EX_END_CATCH(SwallowAllExceptions);\n\n    return(asString(out));\n}\n\n/********************************************************************************/\n// Converts a com signature to a printable signature.\n// Note that return value is pointing at the CQuickBytes buffer,\n\nPCCOR_SIGNATURE PrettyPrintSignature(\n    PCCOR_SIGNATURE typePtr,    // type to convert,\n    unsigned typeLen,           // the length of 'typePtr'\n    const char* name,           // can be \"\", the name of the method for this sig 0 means local var sig\n    CQuickBytes *out,           // where to put the pretty printed string\n    IMDInternalImport *pIMDI,   // ptr to IMDInternalImport class with ComSig\n    const char* inlabel,        // prefix for names (NULL if no names required)\n    BOOL printTyArity)\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    unsigned numArgs;\n    unsigned numTyArgs = 0;\n    PCCOR_SIGNATURE typeEnd = typePtr + typeLen;\n    unsigned ixArg= 0; //arg index\n    char argname[1024];\n    char label[MAX_PREFIX_SIZE];\n    const char* openpar = \"(\";\n    const char* closepar = \")\";\n    ParamDescriptor* pszArgName = NULL; // ptr to array of names (if provided by debug info)\n\n    if(inlabel && *inlabel) // check for *inlabel is totally unnecessary, added to pacify the PREFIX\n    {\n        strcpy_s(label,MAX_PREFIX_SIZE,inlabel);\n        ixArg = label[strlen(label)-1] - '0';\n        label[strlen(label)-1] = 0;\n        if(label[0] == '@') // it's pointer!\n        {\n#ifdef HOST_64BIT\n            pszArgName = (ParamDescriptor*)_atoi64(&label[1]);\n#else // !HOST_64BIT\n            pszArgName = (ParamDescriptor*)(size_t)atoi(&label[1]);\n#endif // HOST_64BIT\n        }\n    }\n\n    // 0 means a local var sig\n    if (name != 0)\n    {\n        // get the calling convention out\n        unsigned callConv = CorSigUncompressData(typePtr);\n\n        // should not be a local var sig\n        _ASSERTE(!isCallConv(callConv, IMAGE_CEE_CS_CALLCONV_LOCAL_SIG));\n\n        if (isCallConv(callConv, IMAGE_CEE_CS_CALLCONV_FIELD))\n        {\n            typePtr = PrettyPrintTypeOrDef(typePtr, out, pIMDI);\n            if (*name)\n            {\n                appendChar(out, ' ');\n                appendStr(out, name);\n            }\n            return(typePtr);\n        }\n\n        if (callConv & IMAGE_CEE_CS_CALLCONV_EXPLICITTHIS)\n            appendStr(out, KEYWORD(\"explicit \"));\n\n        if (callConv & IMAGE_CEE_CS_CALLCONV_HASTHIS)\n            appendStr(out, KEYWORD(\"instance \"));\n\n        if (isCallConv(callConv, IMAGE_CEE_CS_CALLCONV_GENERICINST))\n        {\n          openpar = LTN();\n          closepar = GTN();\n        }\n        else\n        {\n            const char* const callConvUndefined = (const char*)-1;\n            static const char* const callConvNames[16] = {\n                \"\",\n                \"unmanaged cdecl \",\n                \"unmanaged stdcall \",\n                \"unmanaged thiscall \",\n                \"unmanaged fastcall \",\n                \"vararg \",\n                callConvUndefined, // field\n                callConvUndefined, // local sig\n                callConvUndefined, // property\n                \"unmanaged \",\n                callConvUndefined,\n                callConvUndefined,\n                callConvUndefined,\n                callConvUndefined,\n                callConvUndefined,\n                callConvUndefined\n                };\n            static_assert_no_msg(ARRAY_SIZE(callConvNames) == (IMAGE_CEE_CS_CALLCONV_MASK + 1));\n\n            char tmp[32];\n            unsigned callConvIdx = callConv & IMAGE_CEE_CS_CALLCONV_MASK;\n            const char* name_cc = callConvNames[callConvIdx];\n            if (name_cc == callConvUndefined)\n            {\n                sprintf_s(tmp, ARRAY_SIZE(tmp), \"callconv(%u) \", callConvIdx);\n                name_cc = tmp;\n            }\n\n            appendStr(out, KEYWORD(name_cc));\n        }\n\n        if (callConv & IMAGE_CEE_CS_CALLCONV_GENERIC)\n        {\n          numTyArgs = CorSigUncompressData(typePtr);\n        }\n        numArgs = CorSigUncompressData(typePtr);\n        if (!isCallConv(callConv, IMAGE_CEE_CS_CALLCONV_GENERICINST))\n        {\n                // do return type\n            if(pszArgName)\n            {\n                argname[0] = 0;\n                DumpParamAttr(argname, ARRAY_SIZE(argname), pszArgName[ixArg+numArgs].attr);\n                appendStr(out,argname);\n            }\n            typePtr = PrettyPrintTypeOrDef(typePtr, out, pIMDI);\n            if(pszArgName)\n            {\n                argname[0] = ' '; argname[1] = 0;\n                DumpMarshaling(pIMDI,argname, ARRAY_SIZE(argname), pszArgName[ixArg+numArgs].tok);\n                appendStr(out,argname);\n            }\n            if(*name != 0)\n            {\n                appendChar(out, ' ');\n                appendStr(out, name);\n            }\n            if((numTyArgs != 0)&&printTyArity)\n            {\n                appendStr(out,LTN());\n                appendChar(out,'[');\n                appendStrNum(out,numTyArgs);\n                appendChar(out,']');\n                appendStr(out,GTN());\n            }\n        }\n    }\n    else\n    {\n        // get the calling convention out\n#ifdef _DEBUG\n        unsigned callConv =\n#endif\n            CorSigUncompressData(typePtr);\n#ifdef _DEBUG\n        (void)callConv; //prevent \"unused variable\" warning from GCC\n        // should be a local var sig\n        _ASSERTE(callConv == IMAGE_CEE_CS_CALLCONV_LOCAL_SIG);\n#endif\n\n        numArgs = CorSigUncompressData(typePtr);\n    }\n\n    appendStr(out, openpar);\n\n    bool needComma = false;\n    while(typePtr < typeEnd)\n    {\n        if(name) // printing the arguments\n        {\n            PREFIX_ASSUME(typePtr != NULL);\n            if (*typePtr == ELEMENT_TYPE_SENTINEL)\n            {\n                if (needComma)\n                    appendChar(out, ',');\n                appendStr(out, \"...\");\n                typePtr++;\n            }\n            else\n            {\n                if (numArgs <= 0)\n                    break;\n                if (needComma)\n                    appendChar(out, ',');\n                if(pszArgName)\n                {\n                    argname[0] = 0;\n                    DumpParamAttr(argname, ARRAY_SIZE(argname), pszArgName[ixArg].attr);\n                    appendStr(out,argname);\n                }\n                typePtr = PrettyPrintTypeOrDef(typePtr, out, pIMDI);\n                if(inlabel)\n                {\n                    if(pszArgName)\n                    {\n                        argname[0] = ' '; argname[1] = 0;\n                        DumpMarshaling(pIMDI,argname, ARRAY_SIZE(argname), pszArgName[ixArg].tok);\n                        strcat_s(argname, ARRAY_SIZE(argname), ProperName(pszArgName[ixArg++].name));\n                    }\n                    else sprintf_s(argname, ARRAY_SIZE(argname), \" %s_%d\", label,ixArg++);\n                    appendStr(out,argname);\n                }\n                --numArgs;\n            }\n        }\n        else // printing local vars\n        {\n            if (numArgs <= 0)\n                break;\n            if(pszArgName)\n            {\n                if(pszArgName[ixArg].attr == 0xFFFFFFFF)\n                {\n                    CQuickBytes fake_out;\n                    typePtr = PrettyPrintTypeOrDef(typePtr, &fake_out, pIMDI);\n                    ixArg++;\n                    numArgs--;\n                    continue;\n                }\n            }\n            if (needComma)\n                appendChar(out, ',');\n            if(pszArgName)\n            {\n                sprintf_s(argname,ARRAY_SIZE(argname),\"[%d] \",pszArgName[ixArg].attr);\n                appendStr(out,argname);\n            }\n            typePtr = PrettyPrintTypeOrDef(typePtr, out, pIMDI);\n            if(inlabel)\n            {\n                if(pszArgName)\n                {\n                    sprintf_s(argname,ARRAY_SIZE(argname),\" %s\",ProperLocalName(pszArgName[ixArg++].name));\n                }\n                else sprintf_s(argname,ARRAY_SIZE(argname),\" %s_%d\",label,ixArg++);\n                appendStr(out,argname);\n            }\n            --numArgs;\n        }\n        needComma = true;\n    }\n        // Have we finished printing all the arguments?\n    if (numArgs > 0) {\n        appendStr(out, ERRORMSG(\" [SIGNATURE ENDED PREMATURELY]\"));\n    }\n\n    appendStr(out, closepar);\n    return(typePtr);\n}\n\n\n/******************************************************************************/\n// pretty prints 'type' or its 'typedef' to the buffer 'out' returns a pointer to the next type,\n// or 0 on a format failure; outside ILDASM -- simple wrapper for PrettyPrintType\n\nPCCOR_SIGNATURE PrettyPrintTypeOrDef(\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI)           // ptr to IMDInternal class with ComSig\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    PCCOR_SIGNATURE pBegin, pEnd=NULL;\n\n#ifdef __ILDASM__\n    ULONG L = (ULONG)(out->Size());\n#endif\n    pBegin = typePtr;\n    pEnd = PrettyPrintType(typePtr,out,pIMDI);\n#ifdef __ILDASM__\n    if(pEnd > pBegin) // PrettyPrintType can return NULL\n    {\n        DWORD i;\n        ULONG l = (ULONG)(pEnd - pBegin);\n        for(i=0; i < g_NumTypedefs; i++)\n        {\n            if(((*g_typedefs)[i].cb == l)\n               && (memcmp((*g_typedefs)[i].psig,pBegin,l)==0))\n            {\n                out->Shrink(L); // discard output of PrettyPrintType\n                appendStr(out, JUMPPT(ProperName((*g_typedefs)[i].szName),(*g_typedefs)[i].tkSelf));\n                break;\n            }\n        }\n    }\n#endif\n    return pEnd;\n}\n\n/******************************************************************************/\n// pretty prints 'type' to the buffer 'out' returns a pointer to the next type,\n// or 0 on a format failure\n\nPCCOR_SIGNATURE PrettyPrintType(\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI)           // ptr to IMDInternal class with ComSig\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    mdToken  tk;\n    const char* str;\n    int typ;\n    CQuickBytes tmp;\n    CQuickBytes Appendix;\n    BOOL Reiterate;\n    int n;\n\n    do {\n        Reiterate = FALSE;\n        switch(typ = *typePtr++) {\n            case ELEMENT_TYPE_VOID          :\n                str = \"void\"; goto APPEND;\n            case ELEMENT_TYPE_BOOLEAN       :\n                str = \"bool\"; goto APPEND;\n            case ELEMENT_TYPE_CHAR          :\n                str = \"char\"; goto APPEND;\n            case ELEMENT_TYPE_I1            :\n                str = \"int8\"; goto APPEND;\n            case ELEMENT_TYPE_U1            :\n                str = \"uint8\"; goto APPEND;\n            case ELEMENT_TYPE_I2            :\n                str = \"int16\"; goto APPEND;\n            case ELEMENT_TYPE_U2            :\n                str = \"uint16\"; goto APPEND;\n            case ELEMENT_TYPE_I4            :\n                str = \"int32\"; goto APPEND;\n            case ELEMENT_TYPE_U4            :\n                str = \"uint32\"; goto APPEND;\n            case ELEMENT_TYPE_I8            :\n                str = \"int64\"; goto APPEND;\n            case ELEMENT_TYPE_U8            :\n                str = \"uint64\"; goto APPEND;\n            case ELEMENT_TYPE_R4            :\n                str = \"float32\"; goto APPEND;\n            case ELEMENT_TYPE_R8            :\n                str = \"float64\"; goto APPEND;\n            case ELEMENT_TYPE_U             :\n                str = \"native uint\"; goto APPEND;\n            case ELEMENT_TYPE_I             :\n                str = \"native int\"; goto APPEND;\n            case ELEMENT_TYPE_OBJECT        :\n                str = \"object\"; goto APPEND;\n            case ELEMENT_TYPE_STRING        :\n                str = \"string\"; goto APPEND;\n            case ELEMENT_TYPE_TYPEDBYREF        :\n                str = \"typedref\"; goto APPEND;\n            APPEND:\n                appendStr(out, KEYWORD((char*)str));\n                break;\n\n            case ELEMENT_TYPE_VALUETYPE    :\n                str = \"valuetype \";\n                goto DO_CLASS;\n            case ELEMENT_TYPE_CLASS         :\n                str = \"class \";\n                goto DO_CLASS;\n\n            DO_CLASS:\n                appendStr(out, KEYWORD((char*)str));\n                typePtr += CorSigUncompressToken(typePtr, &tk);\n                if(IsNilToken(tk))\n                {\n                    appendStr(out, \"[ERROR! NIL TOKEN]\");\n                }\n                else PrettyPrintClass(out, tk, pIMDI);\n                REGISTER_REF(g_tkRefUser,tk)\n                break;\n\n            case ELEMENT_TYPE_SZARRAY    :\n                insertStr(&Appendix,\"[]\");\n                Reiterate = TRUE;\n                break;\n\n            case ELEMENT_TYPE_ARRAY       :\n                {\n                typePtr = PrettyPrintTypeOrDef(typePtr, out, pIMDI);\n                PREFIX_ASSUME(typePtr != NULL);\n                unsigned rank = CorSigUncompressData(typePtr);\n                    // <TODO> what is the syntax for the rank 0 case? </TODO>\n                if (rank == 0) {\n                    appendStr(out, ERRORMSG(\"[BAD: RANK == 0!]\"));\n                }\n                else {\n                    _ASSERTE(rank != 0);\n\n#ifdef _PREFAST_\n#pragma prefast(push)\n#pragma prefast(disable:22009 \"Suppress PREFAST warnings about integer overflow\")\n#endif\n                    int* lowerBounds = (int*) _alloca(sizeof(int)*2*rank);\n                    int* sizes       = &lowerBounds[rank];\n                    memset(lowerBounds, 0, sizeof(int)*2*rank);\n\n                    unsigned numSizes = CorSigUncompressData(typePtr);\n                    _ASSERTE(numSizes <= rank);\n                    unsigned i;\n                    for(i =0; i < numSizes; i++)\n                        sizes[i] = CorSigUncompressData(typePtr);\n\n                    unsigned numLowBounds = CorSigUncompressData(typePtr);\n                    _ASSERTE(numLowBounds <= rank);\n                    for(i = 0; i < numLowBounds; i++)\n                        typePtr+=CorSigUncompressSignedInt(typePtr,&lowerBounds[i]);\n\n                    appendChar(out, '[');\n                    if (rank == 1 && numSizes == 0 && numLowBounds == 0)\n                        appendStr(out, \"...\");\n                    else {\n                        for(i = 0; i < rank; i++)\n                        {\n                            //if (sizes[i] != 0 || lowerBounds[i] != 0)\n                            {\n                                if (lowerBounds[i] == 0 && i < numSizes)\n                                    appendStrNum(out, sizes[i]);\n                                else\n                                {\n                                    if(i < numLowBounds)\n                                    {\n                                        appendStrNum(out, lowerBounds[i]);\n                                        appendStr(out, \"...\");\n                                        if (/*sizes[i] != 0 && */i < numSizes)\n                                            appendStrNum(out, lowerBounds[i] + sizes[i] - 1);\n                                    }\n                                }\n                            }\n                            if (i < rank-1)\n                                appendChar(out, ',');\n                        }\n                    }\n                    appendChar(out, ']');\n#ifdef _PREFAST_\n#pragma prefast(pop)\n#endif\n                }\n                } break;\n\n            case ELEMENT_TYPE_VAR        :\n                appendChar(out, '!');\n                n  = CorSigUncompressData(typePtr);\n#ifdef __ILDASM__\n                if(!PrettyPrintGP(g_tkVarOwner,out,n))\n#endif\n                    appendStrNum(out, n);\n                break;\n\n            case ELEMENT_TYPE_MVAR        :\n                appendChar(out, '!');\n                appendChar(out, '!');\n                n  = CorSigUncompressData(typePtr);\n#ifdef __ILDASM__\n                if(!PrettyPrintGP(g_tkMVarOwner,out,n))\n#endif\n                    appendStrNum(out, n);\n                break;\n\n            case ELEMENT_TYPE_FNPTR :\n                appendStr(out, KEYWORD(\"method \"));\n                typePtr = PrettyPrintSignature(typePtr, 0x7FFF, \"*\", out, pIMDI, NULL);\n                break;\n\n            case ELEMENT_TYPE_GENERICINST :\n            {\n              typePtr = PrettyPrintTypeOrDef(typePtr, out, pIMDI);\n              appendStr(out, LTN());\n              unsigned numArgs = CorSigUncompressData(typePtr);\n              bool needComma = false;\n              while(numArgs--)\n              {\n                  if (needComma)\n                      appendChar(out, ',');\n                  typePtr = PrettyPrintTypeOrDef(typePtr, out, pIMDI);\n                  needComma = true;\n              }\n              appendStr(out, GTN());\n              break;\n            }\n\n#ifndef __ILDASM__\n            case ELEMENT_TYPE_INTERNAL :\n            {\n                // ELEMENT_TYPE_INTERNAL <TypeHandle>\n                _ASSERTE(sizeof(TypeHandle) == sizeof(void *));\n                TypeHandle typeHandle;\n                typePtr += CorSigUncompressPointer(typePtr, (void **)&typeHandle);\n\n                MethodTable *pMT = NULL;\n                if (typeHandle.IsTypeDesc())\n                {\n                    pMT = typeHandle.AsTypeDesc()->GetMethodTable();\n                    if (pMT)\n                    {\n                        PrettyPrintClass(out, pMT->GetCl(), pMT->GetMDImport());\n\n                        // It could be a \"native version\" of the managed type used in interop\n                        if (typeHandle.AsTypeDesc()->IsNativeValueType())\n                            appendStr(out, \"_NativeValueType\");\n                    }\n                    else\n                        appendStr(out, \"(null)\");\n                }\n                else\n                {\n                    pMT = typeHandle.AsMethodTable();\n                    if (pMT)\n                        PrettyPrintClass(out, pMT->GetCl(), pMT->GetMDImport());\n                    else\n                        appendStr(out, \"(null)\");\n                }\n\n                char sz[32];\n                sprintf_s(sz, ARRAY_SIZE(sz), \" /* MT: 0x%p */\", pMT);\n                appendStr(out, sz);\n                break;\n            }\n#endif\n\n\n                // Modifiers or depedent types\n            case ELEMENT_TYPE_CMOD_OPT\t:\n                str = \" modopt(\"; goto ADDCLASSTOCMOD;\n            case ELEMENT_TYPE_CMOD_REQD\t:\n                str = \" modreq(\";\n            ADDCLASSTOCMOD:\n                typePtr += CorSigUncompressToken(typePtr, &tk);\n                if (IsNilToken(tk))\n                {\n                    Debug_ReportError(\"Nil token in custom modifier\");\n                }\n                tmp.Shrink(0);\n                appendStr(&tmp, KEYWORD((char*)str));\n                PrettyPrintClass(&tmp, tk, pIMDI);\n                appendChar(&tmp,')');\n                str = (const char *) asString(&tmp);\n                goto MODIFIER;\n            case ELEMENT_TYPE_PINNED :\n                str = \" pinned\"; goto MODIFIER;\n            case ELEMENT_TYPE_PTR           :\n                str = \"*\"; goto MODIFIER;\n            case ELEMENT_TYPE_BYREF         :\n                str = AMP(); goto MODIFIER;\n            MODIFIER:\n                insertStr(&Appendix, str);\n                Reiterate = TRUE;\n                break;\n\n            default:\n            case ELEMENT_TYPE_SENTINEL      :\n            case ELEMENT_TYPE_END           :\n                //_ASSERTE(!\"Unknown Type\");\n                if(typ)\n                {\n                    char sz[64];\n                    sprintf_s(sz,ARRAY_SIZE(sz),\"/* UNKNOWN TYPE (0x%X)*/\",typ);\n                    appendStr(out, ERRORMSG(sz));\n                }\n                break;\n        } // end switch\n    } while(Reiterate);\n    appendStr(out,asString(&Appendix));\n    return(typePtr);\n}\n\n/******************************************************************/\nconst char* PrettyPrintClass(\n    CQuickBytes *out,           // where to put the pretty printed string\n    mdToken tk,                 // The class token to look up\n    IMDInternalImport *pIMDI)   // ptr to IMDInternalImport class with ComSig\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if(tk == mdTokenNil)  // Zero resolution scope for \"somewhere here\" TypeRefs\n    {\n        appendStr(out,\"[*]\");\n        return(asString(out));\n    }\n    if(!pIMDI->IsValidToken(tk))\n    {\n        char str[1024];\n        sprintf_s(str,ARRAY_SIZE(str),\" [ERROR: INVALID TOKEN 0x%8.8X] \",tk);\n        appendStr(out,ERRORMSG(str));\n        return(asString(out));\n    }\n    switch(TypeFromToken(tk))\n    {\n        case mdtTypeRef:\n        case mdtTypeDef:\n#ifdef __ILDASM__\n            DWORD ix;\n            for(ix = 0; ix < g_NumTypedefs; ix++)\n            {\n                if((*g_typedefs)[ix].tkTypeSpec == tk) break;\n            }\n            if(ix < g_NumTypedefs)\n            {\n                appendStr(out,JUMPPT(ProperName((*g_typedefs)[ix].szName),(*g_typedefs)[ix].tkSelf));\n            }\n            else\n#endif\n            {\n                const char *nameSpace = 0;\n                const char *name = 0;\n                mdToken tkEncloser;\n\n                if (TypeFromToken(tk) == mdtTypeRef)\n                {\n                    if (FAILED(pIMDI->GetResolutionScopeOfTypeRef(tk, &tkEncloser)))\n                    {\n                        tkEncloser = mdTypeDefNil;\n                    }\n                    if (FAILED(pIMDI->GetNameOfTypeRef(tk, &nameSpace, &name)))\n                    {\n                        nameSpace = name = \"Invalid TypeRef record\";\n                    }\n                }\n                else\n                {\n                    if (FAILED(pIMDI->GetNestedClassProps(tk,&tkEncloser)))\n                    {\n                        tkEncloser = mdTypeDefNil;\n                    }\n                    if (FAILED(pIMDI->GetNameOfTypeDef(tk, &name, &nameSpace)))\n                    {\n                        nameSpace = name = \"Invalid TypeDef record\";\n                    }\n                }\n                MAKE_NAME_IF_NONE(name,tk);\n                if((tkEncloser == mdTokenNil) || RidFromToken(tkEncloser))\n                {\n                    PrettyPrintClass(out,tkEncloser,pIMDI);\n                    if (TypeFromToken(tkEncloser) == mdtTypeRef || TypeFromToken(tkEncloser) == mdtTypeDef)\n                    {\n                        appendChar(out, '/');\n                        //nameSpace = \"\"; //don't print namespaces for nested classes!\n                    }\n                }\n                if(TypeFromToken(tk)==mdtTypeDef)\n                {\n                    unsigned L = (unsigned)strlen(ProperName(name))+1;\n                    char* szFN = NULL;\n                    if(nameSpace && *nameSpace)\n                    {\n                        const char* sz = ProperName(nameSpace);\n                        L+= (unsigned)strlen(sz)+1;\n                        szFN = new char[L];\n                        sprintf_s(szFN,L,\"%s.\",sz);\n                    }\n                    else\n                    {\n                        szFN = new char[L];\n                        *szFN = 0;\n                    }\n                    strcat_s(szFN,L, ProperName(name));\n                    appendStr(out,JUMPPT(szFN,tk));\n                    VDELETE(szFN);\n                }\n                else\n                {\n                    if (nameSpace && *nameSpace) {\n                        appendStr(out, ProperName(nameSpace));\n                        appendChar(out, '.');\n                    }\n\n                    appendStr(out, ProperName(name));\n                }\n                if(g_fDumpTokens)\n                {\n                    char tmp[16];\n                    sprintf_s(tmp,ARRAY_SIZE(tmp),\"/*%08X*/\",tk);\n                    appendStr(out,COMMENT(tmp));\n                }\n            }\n            break;\n\n        case mdtAssemblyRef:\n            {\n                LPCSTR szName = NULL;\n#ifdef __ILDASM__\n                if (rAsmRefName && (RidFromToken(tk) <= ulNumAsmRefs))\n                {\n                    szName = rAsmRefName[RidFromToken(tk)-1];\n                }\n                else\n#endif\n                {\n                    if (FAILED(pIMDI->GetAssemblyRefProps(tk,NULL,NULL,&szName,NULL,NULL,NULL,NULL)))\n                    {\n                        szName = NULL;\n                    }\n                }\n                if ((szName != NULL) && ((*szName) != 0 ))\n                {\n                    appendChar(out, '[');\n                    appendStr(out,JUMPPT(ProperName(szName),tk));\n                    if(g_fDumpTokens)\n                    {\n                        char tmp[16];\n                        sprintf_s(tmp,ARRAY_SIZE(tmp),\"/*%08X*/\",tk);\n                        appendStr(out,COMMENT(tmp));\n                    }\n                    appendChar(out, ']');\n                }\n            }\n            break;\n        case mdtAssembly:\n            {\n                LPCSTR szName;\n                if (FAILED(pIMDI->GetAssemblyProps(tk,NULL,NULL,NULL,&szName,NULL,NULL)))\n                {\n                    szName = NULL;\n                }\n                if ((szName != NULL) && ((*szName) != 0))\n                {\n                    appendChar(out, '[');\n                    appendStr(out,JUMPPT(ProperName(szName),tk));\n                    if(g_fDumpTokens)\n                    {\n                        char tmp[16];\n                        sprintf_s(tmp,ARRAY_SIZE(tmp),\"/* %08X */\",tk);\n                        appendStr(out,COMMENT(tmp));\n                    }\n                    appendChar(out, ']');\n                }\n            }\n            break;\n        case mdtModuleRef:\n            {\n                LPCSTR szName;\n                if (FAILED(pIMDI->GetModuleRefProps(tk, &szName)))\n                {\n                    szName = NULL;\n                }\n                if ((szName != NULL) && ((*szName) != 0))\n                {\n                    appendChar(out, '[');\n                    appendStr(out,KEYWORD(\".module \"));\n                    appendStr(out,JUMPPT(ProperName(szName),tk));\n                    if(g_fDumpTokens)\n                    {\n                        char tmp[16];\n                        sprintf_s(tmp,ARRAY_SIZE(tmp),\"/*%08X*/\",tk);\n                        appendStr(out,COMMENT(tmp));\n                    }\n                    appendChar(out, ']');\n                }\n            }\n            break;\n\n        case mdtTypeSpec:\n            {\n#ifdef __ILDASM__\n                DWORD ix;\n                for(ix = 0; ix < g_NumTypedefs; ix++)\n                {\n                    if((*g_typedefs)[ix].tkTypeSpec == tk) break;\n                }\n                if(ix < g_NumTypedefs)\n                {\n                    appendStr(out,JUMPPT(ProperName((*g_typedefs)[ix].szName),(*g_typedefs)[ix].tkSelf));\n                }\n                else\n#endif\n                {\n                    ULONG cSig;\n                    PCCOR_SIGNATURE sig;\n                    if (FAILED(pIMDI->GetSigFromToken(tk, &cSig, &sig)))\n                    {\n                        char tmp[64];\n                        sprintf_s(tmp, ARRAY_SIZE(tmp), \"/*Invalid %08X record*/\", tk);\n                        appendStr(out, COMMENT(tmp));\n                    }\n                    else\n                    {\n                        PrettyPrintType(sig, out, pIMDI);\n                    }\n                }\n                if(g_fDumpTokens)\n                {\n                    char tmp[16];\n                    sprintf_s(tmp,ARRAY_SIZE(tmp),\"/*%08X*/\",tk);\n                    appendStr(out,COMMENT(tmp));\n                }\n            }\n            break;\n\n        case mdtModule:\n            break;\n\n        default:\n            {\n                char str[128];\n                sprintf_s(str,ARRAY_SIZE(str),\" [ERROR: INVALID TOKEN TYPE 0x%8.8X] \",tk);\n                appendStr(out,ERRORMSG(str));\n            }\n    }\n    return(asString(out));\n}\n\nconst char* TrySigUncompressAndDumpSimpleNativeType(\n        PCCOR_SIGNATURE pData,              // [IN] compressed data\n        ULONG       *pDataOut,              // [OUT] the expanded *pData\n        ULONG       &cbCur,\n        SString     &buf)\n{\n    const char* sz = NULL;\n    ULONG ulSize = CorSigUncompressData(pData, pDataOut);\n    if (ulSize != (ULONG)-1)\n    {\n        switch (*pDataOut)\n        {\n            case NATIVE_TYPE_VOID:      sz = \" void\"; break;\n            case NATIVE_TYPE_BOOLEAN:   sz = \" bool\"; break;\n            case NATIVE_TYPE_I1:        sz = \" int8\"; break;\n            case NATIVE_TYPE_U1:        sz = \" unsigned int8\"; break;\n            case NATIVE_TYPE_I2:        sz = \" int16\"; break;\n            case NATIVE_TYPE_U2:        sz = \" unsigned int16\"; break;\n            case NATIVE_TYPE_I4:        sz = \" int32\"; break;\n            case NATIVE_TYPE_U4:        sz = \" unsigned int32\"; break;\n            case NATIVE_TYPE_I8:        sz = \" int64\"; break;\n            case NATIVE_TYPE_U8:        sz = \" unsigned int64\"; break;\n            case NATIVE_TYPE_R4:        sz = \" float32\"; break;\n            case NATIVE_TYPE_R8:        sz = \" float64\"; break;\n            case NATIVE_TYPE_SYSCHAR:   sz = \" syschar\"; break;\n            case NATIVE_TYPE_VARIANT:   sz = \" variant\"; break;\n            case NATIVE_TYPE_CURRENCY:  sz = \" currency\"; break;\n            case NATIVE_TYPE_DECIMAL:   sz = \" decimal\"; break;\n            case NATIVE_TYPE_DATE:      sz = \" date\"; break;\n            case NATIVE_TYPE_BSTR:      sz = \" bstr\"; break;\n            case NATIVE_TYPE_LPSTR:     sz = \" lpstr\"; break;\n            case NATIVE_TYPE_LPWSTR:    sz = \" lpwstr\"; break;\n            case NATIVE_TYPE_LPTSTR:    sz = \" lptstr\"; break;\n            case NATIVE_TYPE_OBJECTREF: sz = \" objectref\"; break;\n            case NATIVE_TYPE_STRUCT:    sz = \" struct\"; break;\n            case NATIVE_TYPE_ERROR:     sz = \" error\"; break;\n            case NATIVE_TYPE_INT:       sz = \" int\"; break;\n            case NATIVE_TYPE_UINT:      sz = \" uint\"; break;\n            case NATIVE_TYPE_NESTEDSTRUCT: sz = \" nested struct\"; break;\n            case NATIVE_TYPE_BYVALSTR:  sz = \" byvalstr\"; break;\n            case NATIVE_TYPE_ANSIBSTR:  sz = \" ansi bstr\"; break;\n            case NATIVE_TYPE_TBSTR:     sz = \" tbstr\"; break;\n            case NATIVE_TYPE_VARIANTBOOL: sz = \" variant bool\"; break;\n            case NATIVE_TYPE_FUNC:      sz = \" method\"; break;\n            case NATIVE_TYPE_ASANY:     sz = \" as any\"; break;\n            case NATIVE_TYPE_LPSTRUCT:  sz = \" lpstruct\"; break;\n            case NATIVE_TYPE_PTR:\n            case NATIVE_TYPE_SAFEARRAY:\n            case NATIVE_TYPE_ARRAY:\n            case NATIVE_TYPE_FIXEDSYSSTRING:\n            case NATIVE_TYPE_FIXEDARRAY:\n            case NATIVE_TYPE_INTF:\n            case NATIVE_TYPE_IUNKNOWN:\n            case NATIVE_TYPE_IDISPATCH:\n            case NATIVE_TYPE_CUSTOMMARSHALER:\n            case NATIVE_TYPE_END:\n            case NATIVE_TYPE_MAX:\n                sz = \"\"; break;\n            default: sz = NULL;\n        }\n    }\n    if (sz)\n        cbCur += ulSize;\n    else\n        buf.Clear();\n\n    return sz;\n}\n\nbool TrySigUncompress(PCCOR_SIGNATURE pData,              // [IN] compressed data\n                      ULONG       *pDataOut,              // [OUT] the expanded *pData\n                      ULONG       &cbCur,\n                      SString     &buf)\n{\n    ULONG ulSize = CorSigUncompressData(pData, pDataOut);\n    if (ulSize == (ULONG)-1)\n    {\n        buf.Clear();\n        return false;\n    } else\n    {\n        cbCur += ulSize;\n        return true;\n    }\n}\n\n\n#ifdef _PREFAST_\n#pragma warning(push)\n#pragma warning(disable:21000) // Suppress PREFast warning about overly large function\n#endif\nchar* DumpMarshaling(IMDInternalImport* pImport,\n                     _Inout_updates_(cchszString) char* szString,\n                     DWORD cchszString,\n                     mdToken tok)\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    PCCOR_SIGNATURE pSigNativeType = NULL;\n    ULONG           cbNativeType = 0;\n    SString         buf;\n    if (RidFromToken(tok) &&\n        SUCCEEDED(pImport->GetFieldMarshal( // return error if no native type associate with the token\n            tok,                // [IN] given fielddef\n            &pSigNativeType,    // [OUT] the native type signature\n            &cbNativeType)))    // [OUT] the count of bytes of *ppvNativeType\n    {\n        ULONG cbCur = 0;\n        ULONG ulData;\n        const char *sz = NULL;\n        BOOL  fAddAsterisk = FALSE, fAddBrackets = FALSE;\n        buf.AppendPrintf(\" %s(\", KEYWORD(\"marshal\"));\n        while (cbCur < cbNativeType)\n        {\n            ulData = NATIVE_TYPE_MAX;\n            sz = TrySigUncompressAndDumpSimpleNativeType(&pSigNativeType[cbCur], &ulData, cbCur, buf);\n            if (!sz)\n                goto error;\n            if(*sz == 0)\n            {\n                switch (ulData)\n                {\n                case NATIVE_TYPE_PTR:\n                    sz = \"\";\n                    fAddAsterisk = TRUE;\n                    break;\n                case NATIVE_TYPE_SAFEARRAY:\n                    sz = \"\";\n                    buf.AppendASCII(KEYWORD(\" safearray\"));\n                    ulData = VT_EMPTY;\n                    if (cbCur < cbNativeType)\n                    {\n                        if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                            goto error;\n                    }\n                    switch(ulData & VT_TYPEMASK)\n                    {\n                        case VT_EMPTY:      sz=\"\"; break;\n                        case VT_NULL:       sz=\" null\"; break;\n                        case VT_VARIANT:    sz=\" variant\"; break;\n                        case VT_CY:         sz=\" currency\"; break;\n                        case VT_VOID:       sz=\" void\"; break;\n                        case VT_BOOL:       sz=\" bool\"; break;\n                        case VT_I1:         sz=\" int8\"; break;\n                        case VT_I2:         sz=\" int16\"; break;\n                        case VT_I4:         sz=\" int32\"; break;\n                        case VT_I8:         sz=\" int64\"; break;\n                        case VT_R4:         sz=\" float32\"; break;\n                        case VT_R8:         sz=\" float64\"; break;\n                        case VT_UI1:        sz=\" unsigned int8\"; break;\n                        case VT_UI2:        sz=\" unsigned int16\"; break;\n                        case VT_UI4:        sz=\" unsigned int32\"; break;\n                        case VT_UI8:        sz=\" unsigned int64\"; break;\n                        case VT_PTR:        sz=\" *\"; break;\n                        case VT_DECIMAL:    sz=\" decimal\"; break;\n                        case VT_DATE:       sz=\" date\"; break;\n                        case VT_BSTR:       sz=\" bstr\"; break;\n                        case VT_LPSTR:      sz=\" lpstr\"; break;\n                        case VT_LPWSTR:     sz=\" lpwstr\"; break;\n                        case VT_UNKNOWN:    sz=\" iunknown\"; break;\n                        case VT_DISPATCH:   sz=\" idispatch\"; break;\n                        case VT_SAFEARRAY:  sz=\" safearray\"; break;\n                        case VT_INT:        sz=\" int\"; break;\n                        case VT_UINT:       sz=\" unsigned int\"; break;\n                        case VT_ERROR:      sz=\" error\"; break;\n                        case VT_HRESULT:    sz=\" hresult\"; break;\n                        case VT_CARRAY:     sz=\" carray\"; break;\n                        case VT_USERDEFINED:    sz=\" userdefined\"; break;\n                        case VT_RECORD:     sz=\" record\"; break;\n                        case VT_FILETIME:   sz=\" filetime\"; break;\n                        case VT_BLOB:       sz=\" blob\"; break;\n                        case VT_STREAM:     sz=\" stream\"; break;\n                        case VT_STORAGE:    sz=\" storage\"; break;\n                        case VT_STREAMED_OBJECT:    sz=\" streamed_object\"; break;\n                        case VT_STORED_OBJECT:      sz=\" stored_object\"; break;\n                        case VT_BLOB_OBJECT:        sz=\" blob_object\"; break;\n                        case VT_CF:         sz=\" cf\"; break;\n                        case VT_CLSID:      sz=\" clsid\"; break;\n                        default:            sz=NULL; break;\n                    }\n                    if(sz) buf.AppendASCII(KEYWORD(sz));\n                    else\n                    {\n                        // buf.AppendPrintf(ERRORMSG(\" [ILLEGAL VARIANT TYPE 0x%X]\"),ulData & VT_TYPEMASK);\n                        buf.Clear();\n                        goto error;\n                    }\n                    sz=\"\";\n                    switch(ulData & (~VT_TYPEMASK))\n                    {\n                        case VT_ARRAY: sz = \"[]\"; break;\n                        case VT_VECTOR: sz = \" vector\"; break;\n                        case VT_BYREF: sz = \"&\"; break;\n                        case VT_BYREF|VT_ARRAY: sz = \"&[]\"; break;\n                        case VT_BYREF|VT_VECTOR: sz = \"& vector\"; break;\n                        case VT_ARRAY|VT_VECTOR: sz = \"[] vector\"; break;\n                        case VT_BYREF|VT_ARRAY|VT_VECTOR: sz = \"&[] vector\"; break;\n                    }\n                    buf.AppendASCII(KEYWORD(sz));\n                    sz=\"\";\n\n                    // Extract the user defined sub type name.\n                    if (cbCur < cbNativeType)\n                    {\n                        LPUTF8 strTemp = NULL;\n                        int strLen = 0;\n                        int ByteCountLength = 0;\n                        strLen = GetLength(&pSigNativeType[cbCur], &ByteCountLength);\n                        cbCur += ByteCountLength;\n                        if(strLen)\n                        {\n#ifdef _PREFAST_\n#pragma prefast(push)\n#pragma prefast(disable:22009 \"Suppress PREFAST warnings about integer overflow\")\n#endif\n                            strTemp = (LPUTF8)_alloca(strLen + 1);\n                            memcpy(strTemp, (LPUTF8)&pSigNativeType[cbCur], strLen);\n                            strTemp[strLen] = 0;\n                            buf.AppendPrintf(\", \\\"%s\\\"\", UnquotedProperName(strTemp));\n                            cbCur += strLen;\n#ifdef _PREFAST_\n#pragma prefast(pop)\n#endif\n                        }\n                    }\n                    break;\n\n                case NATIVE_TYPE_ARRAY:\n                    sz = \"\";\n                    fAddBrackets = TRUE;\n                    break;\n                case NATIVE_TYPE_FIXEDSYSSTRING:\n                    {\n                        sz = \"\";\n                        buf.AppendASCII(KEYWORD(\" fixed sysstring\"));\n                        buf.AppendASCII(\" [\");\n                        if (cbCur < cbNativeType)\n                        {\n                            if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                                goto error;\n                            buf.AppendPrintf(\"%d\",ulData);\n                        }\n                        buf.AppendASCII(\"]\");\n                    }\n                    break;\n                case NATIVE_TYPE_FIXEDARRAY:\n                    {\n                        sz = \"\";\n                        buf.AppendASCII(KEYWORD(\" fixed array\"));\n                        buf.AppendASCII(\" [\");\n                        if (cbCur < cbNativeType)\n                        {\n                            if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                                goto error;\n                            buf.AppendPrintf(\"%d\",ulData);\n                        }\n                        buf.AppendASCII(\"]\");\n                        if (cbCur < cbNativeType)\n                        {\n                            sz = TrySigUncompressAndDumpSimpleNativeType(&pSigNativeType[cbCur], &ulData, cbCur, buf);\n                            if (!sz)\n                                goto error;\n                        }\n                    }\n                    break;\n\n                case NATIVE_TYPE_INTF:\n                        buf.AppendASCII(KEYWORD(\" interface\"));\n                        goto DumpIidParamIndex;\n                case NATIVE_TYPE_IUNKNOWN:\n                        buf.AppendASCII(KEYWORD(\" iunknown\"));\n                        goto DumpIidParamIndex;\n                case NATIVE_TYPE_IDISPATCH:\n                         buf.AppendASCII(KEYWORD(\" idispatch\"));\n                     DumpIidParamIndex:\n                         sz = \" \";\n                         if (cbCur < cbNativeType)\n                         {\n                             if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                                 goto error;\n                             buf.AppendPrintf(\"(%s = %d)\",KEYWORD(\"iidparam\"),ulData);\n                         }\n                         break;\n\n                case NATIVE_TYPE_CUSTOMMARSHALER:\n                    {\n                        LPUTF8 strTemp = NULL;\n                        int strLen = 0;\n                        int ByteCountLength = 0;\n                        BOOL fFourStrings = FALSE;\n\n                        sz = \"\";\n                        buf.AppendASCII(KEYWORD(\" custom\"));\n                        buf.AppendASCII(\" (\");\n                        // Extract the typelib GUID.\n                        strLen = GetLength(&pSigNativeType[cbCur], &ByteCountLength);\n                        cbCur += ByteCountLength;\n                        if(strLen)\n                        {\n                            fFourStrings = TRUE;\n                            strTemp = (LPUTF8)(new char[strLen + 1]);\n                            if(strTemp)\n                            {\n                                memcpy(strTemp, (LPUTF8)&pSigNativeType[cbCur], strLen);\n                                strTemp[strLen] = 0;\n                                buf.AppendPrintf(\"\\\"%s\\\",\",UnquotedProperName(strTemp));\n                                cbCur += strLen;\n                                VDELETE(strTemp);\n                            }\n                        }\n                        if(cbCur >= cbNativeType)\n                        {\n                            // buf.AppendASCII(ERRORMSG(\"/* INCOMPLETE MARSHALER INFO */\"));\n                            buf.Clear();\n                            goto error;\n                        }\n                        else\n                        {\n                            //_ASSERTE(cbCur < cbNativeType);\n\n                            // Extract the name of the native type.\n                            strLen = GetLength(&pSigNativeType[cbCur], &ByteCountLength);\n                            cbCur += ByteCountLength;\n                            if(fFourStrings)\n                            {\n                                if(strLen)\n                                {\n                                    strTemp = (LPUTF8)(new char[strLen + 1]);\n                                    if(strTemp)\n                                    {\n                                        memcpy(strTemp, (LPUTF8)&pSigNativeType[cbCur], strLen);\n                                        strTemp[strLen] = 0;\n                                        buf.AppendPrintf(\"\\\"%s\\\",\",UnquotedProperName(strTemp));\n                                        cbCur += strLen;\n                                        VDELETE(strTemp);\n                                    }\n                                }\n                                else buf.AppendASCII(\"\\\"\\\",\");\n                            }\n                            if(cbCur >= cbNativeType)\n                            {\n                                // buf.AppendASCII(ERRORMSG(\"/* INCOMPLETE MARSHALER INFO */\"));\n                                buf.Clear();\n                                goto error;\n                            }\n                            else\n                            {\n                                //_ASSERTE(cbCur < cbNativeType);\n\n                                // Extract the name of the custom marshaler.\n                                strLen = GetLength(&pSigNativeType[cbCur], &ByteCountLength);\n                                cbCur += ByteCountLength;\n                                if(strLen)\n                                {\n                                    strTemp = (LPUTF8)(new char[strLen + 1]);\n                                    if(strTemp)\n                                    {\n                                        memcpy(strTemp, (LPUTF8)&pSigNativeType[cbCur], strLen);\n                                        strTemp[strLen] = 0;\n                                        buf.AppendPrintf(\"\\\"%s\\\",\",UnquotedProperName(strTemp));\n                                        cbCur += strLen;\n                                        VDELETE(strTemp);\n                                    }\n                                }\n                                else buf.AppendASCII(\"\\\"\\\",\");\n                                if(cbCur >= cbNativeType)\n                                {\n                                    // buf.AppendASCII(ERRORMSG(\"/* INCOMPLETE MARSHALER INFO */\"));\n                                    buf.Clear();\n                                    goto error;\n                                }\n                                else\n                                {\n                                    // Extract the cookie string.\n                                    strLen = GetLength(&pSigNativeType[cbCur], &ByteCountLength);\n                                    cbCur += ByteCountLength;\n\n                                    if(cbCur+strLen > cbNativeType)\n                                    {\n                                        // buf.AppendASCII(ERRORMSG(\"/* INCOMPLETE MARSHALER INFO */\"));\n                                        buf.Clear();\n                                        goto error;\n                                    }\n                                    else\n                                    {\n                                        if(strLen)\n                                        {\n                                            strTemp = (LPUTF8)(new (nothrow) char[strLen + 1]);\n                                            if(strTemp)\n                                            {\n                                                memcpy(strTemp, (LPUTF8)&pSigNativeType[cbCur], strLen);\n                                                strTemp[strLen] = 0;\n\n                                                buf.AppendASCII(\"\\\"\");\n                                                // Copy the cookie string and transform the embedded nulls into \\0's.\n                                                for (int i = 0; i < strLen - 1; i++, cbCur++)\n                                                {\n                                                    if (strTemp[i] == 0)\n                                                        buf.AppendASCII(\"\\\\0\");\n                                                    else\n                                                    {\n                                                        buf.AppendPrintf(\"%c\", strTemp[i]);\n                                                    }\n                                                }\n                                                buf.AppendPrintf(\"%c\\\"\", strTemp[strLen - 1]);\n                                                cbCur++;\n                                                VDELETE(strTemp);\n                                            }\n                                        }\n                                        else\n                                            buf.AppendASCII(\"\\\"\\\"\");\n                                        //_ASSERTE(cbCur <= cbNativeType);\n                                    }\n                                }\n                            }\n                        }\n                        buf.AppendASCII(\")\");\n                    }\n                    break;\n                default:\n                    {\n                        sz = \"\";\n                    }\n                } // end switch\n            }\n            if(*sz)\n            {\n                buf.AppendASCII(KEYWORD(sz));\n                if(fAddAsterisk)\n                {\n                    buf.AppendASCII(\"*\");\n                    fAddAsterisk = FALSE;\n                }\n                if(fAddBrackets)\n                {\n                    ULONG ulSizeParam=(ULONG)-1,ulSizeConst=(ULONG)-1;\n                    buf.AppendASCII(\"[\");\n                    fAddBrackets = FALSE;\n                    if (cbCur < cbNativeType)\n                    {\n                        if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                            goto error;\n                        ulSizeParam = ulData;\n                        if (cbCur < cbNativeType)\n                        {\n                            if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                                goto error;\n                            ulSizeConst = ulData;\n                            if (cbCur < cbNativeType)\n                            {\n                                // retrieve flags\n                                if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                                    goto error;\n                                if((ulData & 1) == 0) ulSizeParam = 0xFFFFFFFF;\n                            }\n                        }\n                    }\n                    if(ulSizeConst != 0xFFFFFFFF)\n                    {\n                        buf.AppendPrintf(\"%d\",ulSizeConst);\n                        // if(ulSizeParam == 0) ulSizeParam = 0xFFFFFFFF; // don't need +0\n                    }\n                    if(ulSizeParam != 0xFFFFFFFF)\n                    {\n                        buf.AppendPrintf(\" + %d\",ulSizeParam);\n                    }\n                    buf.AppendASCII(\"]\");\n                 }\n\n            }\n\n            if (ulData >= NATIVE_TYPE_MAX)\n                break;\n        } // end while (cbCur < cbNativeType)\n        // still can have outstanding asterisk or brackets\n        if(fAddAsterisk)\n        {\n            buf.AppendASCII(\"*\");\n            fAddAsterisk = FALSE;\n        }\n        if(fAddBrackets)\n        {\n            ULONG ulSizeParam=(ULONG)-1,ulSizeConst=(ULONG)-1;\n            buf.AppendASCII(\"[\");\n            fAddBrackets = FALSE;\n            if (cbCur < cbNativeType)\n            {\n                if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                    goto error;\n                ulSizeParam = ulData;\n                if (cbCur < cbNativeType)\n                {\n                    if (!TrySigUncompress(&pSigNativeType[cbCur], &ulData, cbCur, buf))\n                        goto error;\n                    ulSizeConst = ulData;\n                }\n            }\n            if(ulSizeConst != 0xFFFFFFFF)\n            {\n                buf.AppendPrintf(\"%d\",ulSizeConst);\n                // if(ulSizeParam == 0) ulSizeParam = 0xFFFFFFFF; // don't need +0\n            }\n            if(ulSizeParam != 0xFFFFFFFF)\n            {\n                buf.AppendPrintf(\" + %d\",ulSizeParam);\n            }\n            buf.AppendASCII(\"]\");\n        }\n        buf.AppendASCII(\") \");\n    }// end if(SUCCEEDED\nerror:\n    if (buf.IsEmpty() && cbNativeType != 0)\n    {\n        // There was something that we didn't grok in the signature.\n        // Just dump out the blob as hex\n        buf.AppendPrintf(\" %s({\", KEYWORD(\"marshal\"));\n        while (cbNativeType--)\n            buf.AppendPrintf(\" %2.2X\", *pSigNativeType++);\n        buf.AppendASCII(\" }) \");\n\n        char * tgt = szString + strlen(szString);\n        int sprintf_ret = sprintf_s(tgt, cchszString - (tgt - szString), \"%s\", buf.GetUTF8());\n        if (sprintf_ret == -1)\n        {\n            // Hit an error. Oh well, nothing to do...\n            return tgt;\n        }\n        else\n        {\n            return tgt + sprintf_ret;\n        }\n    }\n    else\n    {\n        char * tgt = szString + strlen(szString);\n        int sprintf_ret = sprintf_s(tgt, cchszString - (tgt - szString), \"%s\", buf.GetUTF8());\n        if (sprintf_ret == -1)\n        {\n            // There was an error, possibly with converting the Unicode characters.\n            buf.Clear();\n            if (cbNativeType != 0)\n                goto error;\n            return tgt; // Oh well, nothing to do...\n        }\n        else\n        {\n            return tgt + sprintf_ret;\n        }\n    }\n}\n#ifdef _PREFAST_\n#pragma warning(pop)\n#endif\n\nchar* DumpParamAttr(_Inout_updates_(cchszString) char* szString, DWORD cchszString, DWORD dwAttr)\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    char *szptr = &szString[strlen(szString)];\n    char *was_szptr = szptr;\n    if(IsPdIn(dwAttr))\n    {\n        szptr+=sprintf_s(szptr,cchszString - (szptr - was_szptr), KEYWORD(\"[in]\"));\n    }\n    if(IsPdOut(dwAttr))\n    {\n        szptr+=sprintf_s(szptr,cchszString - (szptr - was_szptr),KEYWORD(\"[out]\"));\n    }\n    if(IsPdOptional(dwAttr))\n    {\n        szptr+=sprintf_s(szptr,cchszString - (szptr - was_szptr),KEYWORD(\"[opt]\"));\n    }\n    if(szptr != was_szptr)\n    {\n        szptr+=sprintf_s(szptr,cchszString - (szptr - was_szptr),\" \");\n    }\n    return szptr;\n}\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/formattype.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _formatType_h\n#define _formatType_h\n\n#include \"corpriv.h\"\t\t\t\t\t// for IMDInternalImport\n\n// ILDASM code doesn't memcpy on gc pointers, so it prefers the real\n// memcpy rather than GCSafeMemCpy.\n#if defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#ifdef memcpy\n#undef memcpy\n#endif\n#endif\n\n#define MAX_PREFIX_SIZE 32\n\nstruct ParamDescriptor\n{\n    char*\tname;\n    mdToken tok;\n    DWORD\tattr;\n};\n\nchar* DumpMarshaling(IMDInternalImport* pImport,\n                     _Inout_updates_(cchszString) char* szString,\n                     DWORD cchszString,\n                     mdToken tok);\nchar* DumpParamAttr(_Inout_updates_(cchszString) char* szString,\n                    DWORD cchszString,\n                    DWORD dwAttr);\n\nvoid appendStr(CQuickBytes *out, const char* str, unsigned len=(unsigned)-1);\nvoid insertStr(CQuickBytes *out, const char* str);\nchar* asString(CQuickBytes *out);\n\nconst char* PrettyPrintSig(\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    unsigned typeLen,\t\t\t\t\t// the length of 'typePtr'\n    const char* name,                   // can be \"\", the name of the method for this sig 0 means local var sig\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI,           // ptr to IMDInternalImport class with ComSig\n    _In_opt_ const char* inlabel,\t\t\t// prefix for names (NULL if no names required)\n    BOOL printTyArity=FALSE);           // flag to print Type Param number (MemberRefs only)\n\nPCCOR_SIGNATURE PrettyPrintType(\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI);          // ptr to IMDInternal class with ComSig\n\nPCCOR_SIGNATURE PrettyPrintTypeOrDef(   // outside ILDASM - simple wrapper of PrettyPrintType\n    PCCOR_SIGNATURE typePtr,            // type to convert,\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI);          // ptr to IMDInternal class with ComSig\n\n\nconst char* PrettyPrintClass(\n    CQuickBytes *out,                   // where to put the pretty printed string\n    mdToken tk,\t\t\t\t\t \t\t// The class token to look up\n    IMDInternalImport *pIMDI);          // ptr to IMDInternalImport class with ComSig\n\n//================= ILDASM-specific ==================================================================\n\n#ifdef __ILDASM__\n\n#include \"../ildasm/dynamicarray.h\"\n\nbool IsNameToQuote(const char *name);\nbool IsLocalToQuote(const char *name);\nconst char* UnquotedProperName(_In_ __nullterminated const char* name, unsigned len=(unsigned)-1);\nconst char* ProperName(_In_ __nullterminated const char* name, bool isLocalName = false);\n#define ProperLocalName(x) ProperName(x, true)\nconst char* KEYWORD(_In_opt_z_ const char* szOrig);\nconst char* COMMENT(_In_opt_z_ const char* szOrig);\nconst char* ERRORMSG(_In_opt_z_ const char* szOrig);\nconst char* ANCHORPT(_In_ __nullterminated const char* szOrig, mdToken tk);\nconst char* JUMPPT(_In_ __nullterminated const char* szOrig, mdToken tk);\nconst char* SCOPE(void);\nconst char* UNSCOPE(void);\nconst char* LTN(void);\nconst char* GTN(void);\nconst char* AMP(void);\n\nextern BOOL g_fDumpRTF,g_fDumpHTML; // declared in FormatType.cpp\n//-------------------------------------------------------------------------------\n// Protection against null names\nextern const char* const szStdNamePrefix[]; //declared in formatType.cpp\n\nextern DynamicArray<mdToken>   *g_dups;\nextern DWORD                   g_NumDups;\ninline BOOL IsDup(mdToken tk)\n{\n    if(g_NumDups)\n    {\n        mdToken tktype = TypeFromToken(tk);\n        if((tktype==mdtTypeDef)||(tktype==mdtMethodDef)||(tktype==mdtFieldDef))\n        {\n            for (unsigned i=0; i<g_NumDups; i++)\n            {\n                if((*g_dups)[i] == tk) return TRUE;\n            }\n        }\n    }\n    return FALSE;\n}\n#define MAKE_NAME_IF_NONE(psz, tk) { if((!(psz && *psz))||IsDup(tk)) { char* sz = (char*)_alloca(16); \\\nsprintf_s(sz,16,\"$%s$%X\",szStdNamePrefix[tk>>24],tk&0x00FFFFFF); psz = sz; } }\n\n\nstruct TypeDefDescr\n{\n    char* szName;\n    mdToken tkTypeSpec;\n    mdToken tkSelf;\n    PCCOR_SIGNATURE psig;\n    ULONG   cb;\n};\nextern DynamicArray<TypeDefDescr>   *g_typedefs;\nextern DWORD                   g_NumTypedefs;\n\n\n//-------------------------------------------------------------------------------\n// Reference analysis (ILDASM)\nstruct TokPair\n{\n    mdToken tkUser;\n    mdToken tkRef;\n    TokPair() { tkUser = tkRef = 0; };\n};\nextern DynamicArray<TokPair>    *g_refs;\nextern DWORD                    g_NumRefs;\nextern mdToken                  g_tkRefUser; // for PrettyPrintSig\n#define REGISTER_REF(x,y)  if(g_refs && (x)){ (*g_refs)[g_NumRefs].tkUser = x; (*g_refs)[g_NumRefs++].tkRef = y;}\n\n//--------------------------------------------------------------------------------\n// No-throw deallocators\n\n#define SDELETE(x) {PAL_CPP_TRY{ delete (x); } PAL_CPP_CATCH_ALL { _ASSERTE(!\"AV in scalar deallocator\");} PAL_CPP_ENDTRY; (x)=NULL; }\n#define VDELETE(x) {PAL_CPP_TRY{ delete [] (x); } PAL_CPP_CATCH_ALL { _ASSERTE(!\"AV in vector deallocator\");}; PAL_CPP_ENDTRY; (x)=NULL; }\n\n//--------------------------------------------------------------------------------\n// Generic param names\nextern mdToken  g_tkVarOwner;\nextern mdToken  g_tkMVarOwner;\n//void SetVarOwner(mdToken tk) { g_tkVarOwner = tk; }\n//void SetMVarOwner(mdToken tk) { g_tkMVarOwner = tk; }\nBOOL PrettyPrintGP(                      // defined in dasm.cpp\n    mdToken tkOwner,                    // Class, method or 0\n    CQuickBytes *out,                   // where to put the pretty printed generic param\n    int n);\t      \t\t\t \t\t    // Index of generic param\n\n//============== End of ILDASM-specific ================================================================\n\n#else\n\n#define IsNameToQuote(x) false\n#define IsLocalToQuote(x) false\n#define UnquotedProperName(x) x\n#define ProperName(x) x\n#define ProperLocalName(x) x\n#define KEYWORD(x) x\n#define COMMENT(x) x\n#define ERRORMSG(x) x\n#define ANCHORPT(x,y) x\n#define JUMPPT(x,y) x\n#define SCOPE() \"{\"\n#define UNSCOPE() \"}\"\n#define LTN() \"<\"\n#define GTN() \">\"\n#define AMP() \"&\"\n#define REGISTER_REF(x,y) {}\n#define MAKE_NAME_IF_NONE(x,y) { }\n#define g_fDumpTokens false\n#define SDELETE(x) delete (x)\n#define VDELETE(x) delete [] (x)\n\n#endif\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/fstream.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef __FSTREAM_H_INCLUDED__\n#define __FSTREAM_H_INCLUDED__\n\n#include <objidl.h>\n\nclass CFileStream : public IStream\n{\n    public:\n        CFileStream();\n        virtual ~CFileStream();\n\n        HRESULT OpenForRead(LPCWSTR wzFilePath);\n        HRESULT OpenForWrite(LPCWSTR wzFilePath);\n\n        // IUnknown methods:\n        STDMETHODIMP_(ULONG) AddRef();\n        STDMETHODIMP_(ULONG) Release();\n        STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObj);\n\n        // ISequentialStream methods:\n        STDMETHODIMP Read(void *pv, ULONG cb, ULONG *pcbRead);\n        STDMETHODIMP Write(void const *pv, ULONG cb, ULONG *pcbWritten);\n\n        // IStream methods:\n        STDMETHODIMP Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);\n        STDMETHODIMP SetSize(ULARGE_INTEGER libNewSize);\n        STDMETHODIMP CopyTo(IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten);\n        STDMETHODIMP Commit(DWORD grfCommitFlags);\n        STDMETHODIMP Revert();\n        STDMETHODIMP LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);\n        STDMETHODIMP UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType);\n        STDMETHODIMP Stat(STATSTG *pstatstg, DWORD grfStatFlag);\n        STDMETHODIMP Clone(IStream **ppIStream);\n\n    private:\n        BOOL Close();\n\n    private:\n        LONG                                _cRef;\n        HANDLE                              _hFile;\n\n};\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/fstring.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// FString.h  (Fast String)\n//\n\n// ---------------------------------------------------------------------------\n\n// ------------------------------------------------------------------------------------------\n// FString is fast string handling namespace\n\n\n// 1) Simple\n// 2) No C++ exception\n// 3) Optimized for speed\n\n\n#ifndef _FSTRING_H_\n#define _FSTRING_H_\n\nnamespace FString\n{\n    // Note: All \"length\" parameters do not count the space for the null terminator.\n    // Caller of Unicode_Utf8 and Utf8_Unicode must pass in a buffer of size at least length + 1.\n\n    // Scan for ASCII only string, calculate result UTF8 string length\n    HRESULT Unicode_Utf8_Length(_In_z_ LPCWSTR pString, _Out_ bool * pAllAscii, _Out_ DWORD * pLength);\n\n    // Convert UNICODE string to UTF8 string. Direct/fast conversion if ASCII\n    HRESULT Unicode_Utf8(_In_z_ LPCWSTR pString, bool allAscii, _Out_writes_bytes_(length) LPSTR pBuffer, DWORD length);\n\n    // Scan for ASCII string, calculate result UNICODE string length\n    HRESULT Utf8_Unicode_Length(_In_z_ LPCSTR pString, _Out_ bool * pAllAscii, _Out_ DWORD * pLength);\n\n    // Convert UTF8 string to UNICODE. Direct/fast conversion if ASCII\n    HRESULT Utf8_Unicode(_In_z_ LPCSTR pString, bool allAscii, _Out_writes_bytes_(length) LPWSTR pBuffer, DWORD length);\n\n    HRESULT ConvertUnicode_Utf8(_In_z_ LPCWSTR pString, _Outptr_result_z_ LPSTR * pBuffer);\n\n    HRESULT ConvertUtf8_Unicode(_In_z_ LPCSTR pString, _Outptr_result_z_ LPWSTR * pBuffer);\n\n}  // namespace FString\n\n#endif  // _FSTRING_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcdecoder.cpp",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nXX                                                                           XX\nXX                          GCDecode                                         XX\nXX                                                                           XX\nXX   Logic to decode the JIT method header and GC pointer tables             XX\nXX                                                                           XX\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n*/\n\n// ******************************************************************************\n// WARNING!!!: This code is also used by SOS in the diagnostics repo. Should be\n// updated in a backwards and forwards compatible way.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcdecoder.cpp\n// ******************************************************************************\n\n#ifdef TARGET_X86\n\n/* This file is shared between the VM and JIT/IL and SOS/Strike directories */\n\n#include \"gcinfotypes.h\"\n\n/*****************************************************************************/\n/*\n *   This entire file depends upon GC2_ENCODING being set to 1\n *\n *****************************************************************************/\n\nsize_t FASTCALL decodeUnsigned(PTR_CBYTE src, unsigned* val)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    size_t   size  = 1;\n    BYTE     byte  = *src++;\n    unsigned value = byte & 0x7f;\n    while (byte & 0x80) {\n        size++;\n        byte    = *src++;\n        value <<= 7;\n        value  += byte & 0x7f;\n    }\n    *val = value;\n    return size;\n}\n\nsize_t FASTCALL decodeUDelta(PTR_CBYTE src, unsigned* value, unsigned lastValue)\n{\n    CONTRACTL {\n        NOTHROW;\n        GC_NOTRIGGER;\n    } CONTRACTL_END;\n\n    unsigned delta;\n    size_t size = decodeUnsigned(src, &delta);\n    *value = lastValue + delta;\n    return size;\n}\n\nsize_t FASTCALL decodeSigned(PTR_CBYTE src, int* val)\n{\n    CONTRACTL {\n        NOTHROW;\n        GC_NOTRIGGER;\n    } CONTRACTL_END;\n\n    size_t   size  = 1;\n    BYTE     byte  = *src++;\n    BYTE     first = byte;\n    int      value = byte & 0x3f;\n    while (byte & 0x80)\n    {\n        size++;\n        byte = *src++;\n        value <<= 7;\n        value += byte & 0x7f;\n    }\n    if (first & 0x40)\n        value = -value;\n    *val = value;\n    return size;\n}\n\n/*****************************************************************************/\n\n#if defined(_MSC_VER)\n#ifdef HOST_X86\n#pragma optimize(\"tgy\", on)\n#endif\n#endif\n\nPTR_CBYTE FASTCALL decodeHeader(PTR_CBYTE table, UINT32 version, InfoHdr* header)\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    BYTE nextByte = *table++;\n    BYTE encoding = nextByte & 0x7f;\n    GetInfoHdr(encoding, header);\n    while (nextByte & MORE_BYTES_TO_FOLLOW)\n    {\n        nextByte = *table++;\n        encoding = nextByte & ADJ_ENCODING_MAX;\n        // encoding here always corresponds to codes in InfoHdrAdjust set\n\n        if (encoding < NEXT_FOUR_START)\n        {\n            if (encoding < SET_ARGCOUNT)\n            {\n                header->frameSize = encoding - SET_FRAMESIZE;\n            }\n            else if (encoding < SET_PROLOGSIZE)\n            {\n                header->argCount = encoding - SET_ARGCOUNT;\n            }\n            else if (encoding < SET_EPILOGSIZE)\n            {\n                header->prologSize = encoding - SET_PROLOGSIZE;\n            }\n            else if (encoding < SET_EPILOGCNT)\n            {\n                header->epilogSize = encoding - SET_EPILOGSIZE;\n            }\n            else if (encoding < SET_UNTRACKED)\n            {\n                header->epilogCount = (encoding - SET_EPILOGCNT) / 2;\n                header->epilogAtEnd = ((encoding - SET_EPILOGCNT) & 1) == 1;\n                assert(!header->epilogAtEnd || (header->epilogCount == 1));\n            }\n            else if (encoding < FIRST_FLIP)\n            {\n                header->untrackedCnt = encoding - SET_UNTRACKED;\n                _ASSERTE(header->untrackedCnt != HAS_UNTRACKED);\n            }\n            else switch (encoding)\n            {\n            default:\n                assert(!\"Unexpected encoding\");\n                break;\n            case FLIP_EDI_SAVED:\n                header->ediSaved ^= 1;\n                break;\n            case FLIP_ESI_SAVED:\n                header->esiSaved ^= 1;\n                break;\n            case FLIP_EBX_SAVED:\n                header->ebxSaved ^= 1;\n                break;\n            case FLIP_EBP_SAVED:\n                header->ebpSaved ^= 1;\n                break;\n            case FLIP_EBP_FRAME:\n                header->ebpFrame ^= 1;\n                break;\n            case FLIP_INTERRUPTIBLE:\n                header->interruptible ^= 1;\n                break;\n            case FLIP_DOUBLE_ALIGN:\n                header->doubleAlign ^= 1;\n                break;\n            case FLIP_SECURITY:\n                header->security ^= 1;\n                break;\n            case FLIP_HANDLERS:\n                header->handlers ^= 1;\n                break;\n            case FLIP_LOCALLOC:\n                header->localloc ^= 1;\n                break;\n            case FLIP_EDITnCONTINUE:\n                header->editNcontinue ^= 1;\n                break;\n            case FLIP_VAR_PTR_TABLE_SZ:\n                header->varPtrTableSize ^= HAS_VARPTR;\n                break;\n            case FFFF_UNTRACKED_CNT:\n                header->untrackedCnt = HAS_UNTRACKED;\n                break;\n            case FLIP_VARARGS:\n                header->varargs ^= 1;\n                break;\n            case FLIP_PROF_CALLBACKS:\n                header->profCallbacks ^= 1;\n                break;\n            case FLIP_HAS_GENERICS_CONTEXT:\n                header->genericsContext ^= 1;\n                break;\n            case FLIP_GENERICS_CONTEXT_IS_METHODDESC:\n                header->genericsContextIsMethodDesc ^= 1;\n                break;\n            case FLIP_HAS_GS_COOKIE:\n                header->gsCookieOffset ^= HAS_GS_COOKIE_OFFSET;\n                break;\n            case FLIP_SYNC:\n                header->syncStartOffset ^= HAS_SYNC_OFFSET;\n                break;\n            case FLIP_REV_PINVOKE_FRAME:\n                header->revPInvokeOffset = INVALID_REV_PINVOKE_OFFSET ? HAS_REV_PINVOKE_FRAME_OFFSET : INVALID_REV_PINVOKE_OFFSET;\n                break;\n\n            case NEXT_OPCODE:\n                _ASSERTE((nextByte & MORE_BYTES_TO_FOLLOW) && \"Must have another code\");\n                nextByte = *table++;\n                encoding = nextByte & ADJ_ENCODING_MAX;\n                // encoding here always corresponds to codes in InfoHdrAdjust2 set\n\n                _ASSERTE(encoding < SET_RET_KIND_MAX);\n                header->returnKind = (ReturnKind)encoding;\n                break;\n            }\n        }\n        else\n        {\n            unsigned char lowBits;\n            switch (encoding >> 4)\n            {\n            default:\n                assert(!\"Unexpected encoding\");\n                break;\n            case 5:\n                assert(NEXT_FOUR_FRAMESIZE == 0x50);\n                lowBits = encoding & 0xf;\n                header->frameSize <<= 4;\n                header->frameSize += lowBits;\n                break;\n            case 6:\n                assert(NEXT_FOUR_ARGCOUNT == 0x60);\n                lowBits = encoding & 0xf;\n                header->argCount <<= 4;\n                header->argCount += lowBits;\n                break;\n            case 7:\n                if ((encoding & 0x8) == 0)\n                {\n                    assert(NEXT_THREE_PROLOGSIZE == 0x70);\n                    lowBits = encoding & 0x7;\n                    header->prologSize <<= 3;\n                    header->prologSize += lowBits;\n                }\n                else\n                {\n                    assert(NEXT_THREE_EPILOGSIZE == 0x78);\n                    lowBits = encoding & 0x7;\n                    header->epilogSize <<= 3;\n                    header->epilogSize += lowBits;\n                }\n                break;\n            }\n        }\n    }\n    return table;\n}\n\nvoid FASTCALL decodeCallPattern(int          pattern,\n                                unsigned *   argCnt,\n                                unsigned *   regMask,\n                                unsigned *   argMask,\n                                unsigned *   codeDelta)\n{\n    CONTRACTL {\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    } CONTRACTL_END;\n\n    assert((pattern>=0) && (pattern<80));\n    CallPattern pat;\n    pat.val    = callPatternTable[pattern];\n    *argCnt    = pat.fld.argCnt;\n    *regMask   = pat.fld.regMask;      // EBP,EBX,ESI,EDI\n    *argMask   = pat.fld.argMask;\n    *codeDelta = pat.fld.codeDelta;\n}\n\n#define YES HAS_VARPTR\n\nconst InfoHdrSmall infoHdrShortcut[128] = {\n//        Prolog size\n//        |\n//        |   Epilog size\n//        |   |\n//        |   |  Epilog count\n//        |   |  |\n//        |   |  |  Epilog at end\n//        |   |  |  |\n//        |   |  |  |  EDI saved\n//        |   |  |  |  |\n//        |   |  |  |  |  ESI saved\n//        |   |  |  |  |  |\n//        |   |  |  |  |  |  EBX saved\n//        |   |  |  |  |  |  |\n//        |   |  |  |  |  |  |  EBP saved\n//        |   |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  EBP-frame\n//        |   |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  Interruptible method\n//        |   |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  doubleAlign\n//        |   |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  security flag\n//        |   |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  handlers\n//        |   |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  localloc\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  edit and continue\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  varargs\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ProfCallbacks\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  genericsContext\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  genericsContextIsMethodDesc\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  returnKind\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Arg count\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |                                 Counted occurrences\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   Frame size                    |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |                             |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   untrackedCnt              |   Header encoding\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |                         |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |  varPtrTable            |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |   |                     |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |   |  gsCookieOffs       |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |   |   |                 |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |   |   | syncOffs        |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |   |   |  |  |           |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |   |   |  |  |           |   |\n//        |   |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   |   |   |   |  |  |           |   |\n//        v   v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v  v   v   v   v   v  v  v           v   v\n       {  0,  1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    1139  00\n       {  0,  1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //  128738  01\n       {  0,  1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    3696  02\n       {  0,  1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     402  03\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    4259  04\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  1,  0          },  //    3379  05\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //    2058  06\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  1,  0          },  //     728  07\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  2,  0          },  //     984  08\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,  0,  0,  0          },  //     606  09\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,  0,  0,  0          },  //    1110  0a\n       {  0,  3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,  0,  1,  0          },  //     414  0b\n       {  1,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //    1553  0c\n       {  1,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  1,  0, YES         },  //     584  0d\n       {  1,  2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //    2182  0e\n       {  1,  2, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    3445  0f\n       {  1,  2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //    1369  10\n       {  1,  2, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     515  11\n       {  1,  2, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //   21127  12\n       {  1,  2, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    3517  13\n       {  1,  2, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     750  14\n       {  1,  4, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    1876  15\n       {  1,  4, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  1,  0          },  //    1665  16\n       {  1,  4, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //     729  17\n       {  1,  4, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  2,  0          },  //     484  18\n       {  1,  4, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //     331  19\n       {  2,  3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //     361  1a\n       {  2,  3, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     964  1b\n       {  2,  3, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    3713  1c\n       {  2,  3, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     466  1d\n       {  2,  3, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //    1325  1e\n       {  2,  3, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //     712  1f\n       {  2,  3, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     588  20\n       {  2,  3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //   20542  21\n       {  2,  3, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    3802  22\n       {  2,  3, 3, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     798  23\n       {  2,  5, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    1900  24\n       {  2,  5, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //     385  25\n       {  2,  5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    1617  26\n       {  2,  5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  1,  0          },  //    1743  27\n       {  2,  5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //     909  28\n       {  2,  5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  1,  0          },  //     602  29\n       {  2,  5, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  2,  0          },  //     352  2a\n       {  2,  6, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //     657  2b\n       {  2,  7, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0, YES         },  //    1283  2c\n       {  2,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //    1286  2d\n       {  3,  4, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //    1495  2e\n       {  3,  4, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    1989  2f\n       {  3,  4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //    1154  30\n       {  3,  4, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    9300  31\n       {  3,  4, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //     392  32\n       {  3,  4, 2, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    1720  33\n       {  3,  6, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    1246  34\n       {  3,  6, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //     800  35\n       {  3,  6, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    1179  36\n       {  3,  6, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  1,  0          },  //    1368  37\n       {  3,  6, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //     349  38\n       {  3,  6, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  2,  0          },  //     505  39\n       {  3,  6, 2, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //     629  3a\n       {  3,  8, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  9,  2, YES         },  //     365  3b\n       {  4,  5, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //     487  3c\n       {  4,  5, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    1752  3d\n       {  4,  5, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //    1959  3e\n       {  4,  5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    2436  3f\n       {  4,  5, 2, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     861  40\n       {  4,  7, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    1459  41\n       {  4,  7, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //     950  42\n       {  4,  7, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //    1491  43\n       {  4,  7, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  1,  0          },  //     879  44\n       {  4,  7, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  0,  0,  0          },  //     408  45\n       {  5,  4, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //    4870  46\n       {  5,  6, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //     359  47\n       {  5,  6, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0,  0          },  //     915  48\n       {  5,  6, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  4,  0,  0          },  //     412  49\n       {  5,  6, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //    1288  4a\n       {  5,  6, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //    1591  4b\n       {  5,  6, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  1,  0, YES         },  //     361  4c\n       {  5,  6, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  1,  0,  0          },  //     623  4d\n       {  5,  8, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  1,  0,  0          },  //    1239  4e\n       {  6,  0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     457  4f\n       {  6,  0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     606  50\n       {  6,  4, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0, YES         },  //    1073  51\n       {  6,  4, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0, YES         },  //     508  52\n       {  6,  6, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //     330  53\n       {  6,  6, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //    1709  54\n       {  6,  7, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0,  0          },  //    1164  55\n       {  7,  4, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0          },  //     556  56\n       {  7,  5, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  3,  0, YES         },  //     529  57\n       {  7,  5, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  5,  0, YES         },  //    1423  58\n       {  7,  8, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  3,  0, YES         },  //    2455  59\n       {  7,  8, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0,  0          },  //     956  5a\n       {  7,  8, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0, YES         },  //    1399  5b\n       {  7,  8, 2, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  3,  0, YES         },  //     587  5c\n       {  7, 10, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  6,  1, YES         },  //     743  5d\n       {  7, 10, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  2,  0,  0          },  //    1004  5e\n       {  7, 10, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  2,  1, YES         },  //     487  5f\n       {  7, 10, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  2,  0,  0          },  //     337  60\n       {  7, 10, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  3,  0, YES         },  //     361  61\n       {  8,  3, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  1,  0          },  //     560  62\n       {  8,  6, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0,  0          },  //    1377  63\n       {  9,  4, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  1,  0          },  //     877  64\n       {  9,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  0,  0          },  //    3041  65\n       {  9,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0, YES         },  //     349  66\n       { 10,  5, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  4,  1,  0          },  //    2061  67\n       { 10,  5, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  1,  0          },  //     577  68\n       { 11,  6, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  4,  1,  0          },  //    1195  69\n       { 12,  5, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0,  0          },  //     491  6a\n       { 13,  8, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  9,  0, YES         },  //     627  6b\n       { 13,  8, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  2,  1,  0          },  //    1099  6c\n       { 13, 10, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,  6,  1, YES         },  //     488  6d\n       { 14,  7, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //     574  6e\n       { 16,  7, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  4,  0, YES         },  //    1281  6f\n       { 16,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0, YES         },  //    1881  70\n       { 16,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //     339  71\n       { 16,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  3,  0,  0          },  //    2594  72\n       { 16,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  4,  0,  0          },  //     339  73\n       { 16,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  4,  0, YES         },  //    2107  74\n       { 16,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  5,  0, YES         },  //    2372  75\n       { 16,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  6,  0, YES         },  //    1078  76\n       { 16,  7, 2, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  4,  0, YES         },  //     384  77\n       { 16,  9, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1,  4,  1, YES         },  //    1541  78\n       { 16,  9, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2,  4,  1, YES         },  //     975  79\n       { 19,  7, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  5,  0, YES         },  //     546  7a\n       { 24,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,  5,  0, YES         },  //     675  7b\n       { 45,  9, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  0,  0,  0          },  //     902  7c\n       { 51,  7, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13,  0, YES         },  //     432  7d\n       { 51,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  1,  0, YES         },  //     361  7e\n       { 51,  7, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,  0,  0          },  //     703  7f\n};\n\nbool InfoHdrSmall::isHeaderMatch(const InfoHdr& target) const\n{\n#ifdef _ASSERTE\n    // target cannot have place-holder values.\n    _ASSERTE(target.untrackedCnt != HAS_UNTRACKED &&\n                target.varPtrTableSize != HAS_VARPTR &&\n                target.gsCookieOffset != HAS_GS_COOKIE_OFFSET &&\n                target.syncStartOffset != HAS_SYNC_OFFSET &&\n                target.revPInvokeOffset != HAS_REV_PINVOKE_FRAME_OFFSET);\n#endif\n\n    // compare two InfoHdr's up to but not including the untrackCnt field\n    if (memcmp(this, &target, offsetof(InfoHdr, untrackedCnt)) != 0)\n        return false;\n\n    if (untrackedCnt != target.untrackedCnt) {\n        if (target.untrackedCnt <= SET_UNTRACKED_MAX)\n            return false;\n        else if (untrackedCnt != HAS_UNTRACKED)\n            return false;\n    }\n\n    if (varPtrTableSize != target.varPtrTableSize) {\n        if ((varPtrTableSize != 0) != (target.varPtrTableSize != 0))\n            return false;\n    }\n\n    if (target.gsCookieOffset != INVALID_GS_COOKIE_OFFSET)\n        return false;\n\n    if (target.syncStartOffset != INVALID_SYNC_OFFSET)\n        return false;\n\n    if (target.revPInvokeOffset!= INVALID_REV_PINVOKE_OFFSET)\n        return false;\n\n    return true;\n}\n\n\nconst unsigned callCommonDelta[4] = { 6,8,10,12 };\n\n/*\n *  In the callPatternTable each 32-bit unsigned value represents four bytes:\n *\n *  byte0,byte1,byte2,byte3 => codeDelta,argMask,regMask,argCnt\n *  for example 0x0c000301  => codeDelta of 12, argMask of 0,\n *                             regMask of 0x3,  argCnt of 1\n *\n *  Furthermore within the table the following maximum values are in place:\n *\n *  codeDelta <= CP_MAX_CODE_DELTA  // (0x23)\n *  argCnt    <= CP_MAX_ARG_CNT     // (0x02)\n *  argMask   <= CP_MAX_ARG_MASK    // (0x00)\n *\n *  Note that ARG_CNT is the count of pushed args for a nested call site.\n *   And since the first two arguments are always passed in registers\n *   an ARG_CNT of 1 would mean that the nested call site had three arguments\n *\n *  Note that ARG_MASK is the mask of pushed args that contain GC pointers\n *   since the first two arguments are always passed in registers it is\n *   a fairly rare occurrence to push a GC pointer as an argument, since it\n *   only occurs for nested calls, when the third or later argument for the\n *   outer call contains a GC ref.\n *\n *  Additionally the encoding of the regMask uses the following bits:\n *   EDI = 0x1, ESI = 0x2, EBX = 0x4, EBP = 0x8\n *\n */\nconst unsigned callPatternTable[80] = {               // # of occurrences\n    0x0a000200, //   30109\n    0x0c000200, //   22970\n    0x0c000201, //   19005\n    0x0a000300, //   12193\n    0x0c000300, //   10614\n    0x0e000200, //   10253\n    0x10000200, //    9746\n    0x0b000200, //    9698\n    0x0d000200, //    9625\n    0x08000200, //    8909\n    0x0c000301, //    8522\n    0x11000200, //    7382\n    0x0e000300, //    7357\n    0x12000200, //    7139\n    0x10000300, //    7062\n    0x11000300, //    6970\n    0x0a000201, //    6842\n    0x0a000100, //    6803\n    0x0f000200, //    6795\n    0x13000200, //    6559\n    0x08000300, //    6079\n    0x15000200, //    5874\n    0x0d000201, //    5492\n    0x0c000100, //    5193\n    0x0d000300, //    5165\n    0x23000200, //    5143\n    0x1b000200, //    5035\n    0x14000200, //    4872\n    0x0f000300, //    4850\n    0x0a000700, //    4781\n    0x09000200, //    4560\n    0x12000300, //    4496\n    0x16000200, //    4180\n    0x07000200, //    4021\n    0x09000300, //    4012\n    0x0c000700, //    3988\n    0x0c000600, //    3946\n    0x0e000100, //    3823\n    0x1a000200, //    3764\n    0x18000200, //    3744\n    0x17000200, //    3736\n    0x1f000200, //    3671\n    0x13000300, //    3559\n    0x0a000600, //    3214\n    0x0e000600, //    3109\n    0x08000201, //    2984\n    0x0b000300, //    2928\n    0x0a000301, //    2859\n    0x07000100, //    2826\n    0x13000100, //    2782\n    0x09000301, //    2644\n    0x19000200, //    2638\n    0x11000700, //    2618\n    0x21000200, //    2518\n    0x0d000202, //    2484\n    0x10000100, //    2480\n    0x0f000600, //    2413\n    0x14000300, //    2363\n    0x0c000500, //    2362\n    0x08000301, //    2285\n    0x20000200, //    2245\n    0x10000700, //    2240\n    0x0f000100, //    2236\n    0x1e000200, //    2214\n    0x0c000400, //    2193\n    0x16000300, //    2171\n    0x12000600, //    2132\n    0x22000200, //    2011\n    0x1d000200, //    2011\n    0x0c000f00, //    1996\n    0x0e000700, //    1971\n    0x0a000400, //    1970\n    0x09000201, //    1932\n    0x10000600, //    1903\n    0x15000300, //    1847\n    0x0a000101, //    1814\n    0x0a000b00, //    1771\n    0x0c000601, //    1737\n    0x09000700, //    1737\n    0x07000300, //    1684\n};\n\n#endif // TARGET_X86\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcdump.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n *                                  GCDump.h\n *\n * Defines functions to display the GCInfo as defined by the GC-encoding\n * spec. The GC information may be either dynamically created by a\n * Just-In-Time compiler conforming to the standard code-manager spec,\n * or may be persisted by a managed native code compiler conforming\n * to the standard code-manager spec.\n */\n\n/*****************************************************************************/\n#ifndef __GCDUMP_H__\n#define __GCDUMP_H__\n/*****************************************************************************/\n\n#include \"gcinfotypes.h\"     // For InfoHdr\n\n#ifndef FASTCALL\n#ifndef TARGET_UNIX\n#define FASTCALL __fastcall\n#else\n#define FASTCALL\n#endif\n#endif\n\n\nclass GCDump\n{\npublic:\n\n    GCDump                          (UINT32         gcInfoVersion,\n                                     bool           encBytes     = true,\n                                     unsigned       maxEncBytes  = 5,\n                                     bool           dumpCodeOffs = true);\n\n#ifdef TARGET_X86\n    /*-------------------------------------------------------------------------\n     * Dumps the InfoHdr to 'stdout'\n     * table            : Start of the GC info block\n     * verifyGCTables   : If the JIT has been compiled with VERIFY_GC_TABLES\n     * Return value     : Size in bytes of the header encoding\n     */\n\n    size_t FASTCALL   DumpInfoHdr (PTR_CBYTE   gcInfoBlock,\n                                   InfoHdr    *   header,         /* OUT */\n                                   unsigned   *   methodSize,     /* OUT */\n                                   bool           verifyGCTables = false);\n#endif\n\n    /*-------------------------------------------------------------------------\n     * Dumps the GC tables to 'stdout'\n     * gcInfoBlock      : Start of the GC info block\n     * verifyGCTables   : If the JIT has been compiled with VERIFY_GC_TABLES\n     * Return value     : Size in bytes of the GC table encodings\n     */\n\n    size_t   FASTCALL   DumpGCTable (PTR_CBYTE      gcInfoBlock,\n#ifdef TARGET_X86\n                                     const InfoHdr& header,\n#endif\n                                     unsigned       methodSize,\n                                     bool           verifyGCTables = false);\n\n    /*-------------------------------------------------------------------------\n     * Dumps the location of ptrs for the given code offset\n     * verifyGCTables   : If the JIT has been compiled with VERIFY_GC_TABLES\n     */\n\n    void     FASTCALL   DumpPtrsInFrame(PTR_CBYTE   gcInfoBlock,\n                                        PTR_CBYTE   codeBlock,\n                                        unsigned    offs,\n                                        bool        verifyGCTables = false);\n\n\npublic:\n\ttypedef void (*printfFtn)(const char* fmt, ...);\n\tprintfFtn gcPrintf;\n    UINT32              gcInfoVersion;\n    //-------------------------------------------------------------------------\nprotected:\n\n    bool                fDumpEncBytes;\n    unsigned            cMaxEncBytes;\n\n    bool                fDumpCodeOffsets;\n\n    /* Helper methods */\n\n    PTR_CBYTE           DumpEncoding(PTR_CBYTE      gcInfoBlock,\n                                     size_t         cDumpBytes);\n    void                DumpOffset  (unsigned       o);\n    void                DumpOffsetEx(unsigned       o);\n\n};\n\n/*****************************************************************************/\n#endif // __GC_DUMP_H__\n/*****************************************************************************/\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcinfo.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// ******************************************************************************\n// WARNING!!!: These values are used by SOS in the diagnostics repo. Values should\n// added or removed in a backwards and forwards compatible way.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfo.h\n// ******************************************************************************\n\n/*****************************************************************************/\n#ifndef _GCINFO_H_\n#define _GCINFO_H_\n/*****************************************************************************/\n\n#include \"daccess.h\"\n#include \"windef.h\"     // For BYTE\n\n// Some declarations in this file are used on non-x86 platforms, but most are x86-specific.\n\n// Use the lower 2 bits of the offsets stored in the tables\n// to encode properties\n\nconst unsigned        OFFSET_MASK  = 0x3;  // mask to access the low 2 bits\n\n//\n//  Note for untracked locals the flags allowed are \"pinned\" and \"byref\"\n//   and for tracked locals the flags allowed are \"this\" and \"byref\"\n//  Note that these definitions should also match the definitions of\n//   GC_CALL_INTERIOR and GC_CALL_PINNED in VM/gc.h\n//\nconst unsigned  byref_OFFSET_FLAG  = 0x1;  // the offset is an interior ptr\nconst unsigned pinned_OFFSET_FLAG  = 0x2;  // the offset is a pinned ptr\n#if !defined(TARGET_X86) || !defined(FEATURE_EH_FUNCLETS)\nconst unsigned   this_OFFSET_FLAG  = 0x2;  // the offset is \"this\"\n#endif\n\n//-----------------------------------------------------------------------------\n// The current GCInfo Version\n//-----------------------------------------------------------------------------\n\n#define GCINFO_VERSION 2\n\n//-----------------------------------------------------------------------------\n// GCInfoToken: A wrapper that contains the GcInfo data and version number.\n//\n// The version# is not stored in the GcInfo structure -- because it is\n// wasteful to store the version once for every method.\n// Instead, the version# istracked per range-section of generated/loaded methods.\n//\n// The GCInfo version is computed as :\n// 1) The current GCINFO_VERSION for JITted and Ngened images\n// 2) A function of the Ready - to - run major version stored in READYTORUN_HEADER\n//   for ready - to - run images.ReadyToRunJitManager::JitTokenToGCInfoVersion()\n//   provides the GcInfo version for any Method.\n//-----------------------------------------------------------------------------\n\nstruct GCInfoToken\n{\n    PTR_VOID Info;\n    UINT32 Version;\n\n    static UINT32 ReadyToRunVersionToGcInfoVersion(UINT32 readyToRunMajorVersion)\n    {\n        // GcInfo version is current from  ReadyToRun version 2.0\n        return GCINFO_VERSION;\n    }\n};\n\n/*****************************************************************************/\n#endif //_GCINFO_H_\n/*****************************************************************************/\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcinfoarraylist.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _GCINFOARRAYLIST_H_\n#define _GCINFOARRAYLIST_H_\n\n// GCInfoArrayList is basically a more efficient linked list--it's useful for accumulating\n// lots of small fixed-size allocations into larger chunks which in a typical linked list\n// would incur an unnecessarily high amount of overhead.\n\nclass GcInfoArrayListBase\n{\nprivate:\n    static const size_t GrowthFactor = 2;\n\nprotected:\n    friend class IteratorBase;\n\n    struct ChunkBase\n    {\n        ChunkBase* m_next; // actually GcInfoArrayListChunk<ElementType>*\n    };\n\n    class IteratorBase\n    {\n    protected:\n        IteratorBase(GcInfoArrayListBase* list, size_t firstChunkCapacity);\n        ChunkBase* GetNextChunk(size_t& elementCount);\n\n    private:\n        GcInfoArrayListBase* m_list;\n        ChunkBase* m_currentChunk;\n        size_t m_currentChunkCount;\n    };\n\n    GcInfoArrayListBase(IAllocator* allocator);\n    virtual ~GcInfoArrayListBase();\n\n    void AppendNewChunk(size_t firstChunkCapacity, size_t elementSize, size_t chunkAlignment);\n\npublic:\n    size_t Count()\n    {\n        return m_itemCount;\n    }\n\nprotected:\n    IAllocator* m_allocator;\n    ChunkBase* m_firstChunk; // actually GcInfoArrayListChunk<ElementType>*\n    ChunkBase* m_lastChunk; // actually GcInfoArrayListChunk<ElementType>*\n    size_t m_lastChunkCount;\n    size_t m_lastChunkCapacity;\n    size_t m_itemCount;\n};\n\ntemplate <typename ElementType, size_t FirstChunkCapacity>\nclass GcInfoArrayList : public GcInfoArrayListBase\n{\nprivate:\n    struct Chunk : public ChunkBase\n    {\n        ElementType m_items[];\n    };\n\npublic:\n    friend class Iterator;\n\n    struct Iterator : IteratorBase\n    {\n        Iterator(GcInfoArrayList* list)\n            : IteratorBase(list, FirstChunkCapacity)\n        {\n        }\n\n        ElementType* GetNext(size_t* elementCount)\n        {\n            Chunk* chunk = reinterpret_cast<Chunk*>(GetNextChunk(*elementCount));\n            return chunk == nullptr ? nullptr : &chunk->m_items[0];\n        }\n    };\n\n    GcInfoArrayList(IAllocator* allocator)\n        : GcInfoArrayListBase(allocator)\n    {\n    }\n\n    ElementType* Append()\n    {\n        if (m_lastChunk == nullptr || m_lastChunkCount == m_lastChunkCapacity)\n        {\n            AppendNewChunk(FirstChunkCapacity, sizeof(ElementType), __alignof(ElementType));\n        }\n\n        m_itemCount++;\n        m_lastChunkCount++;\n        return &reinterpret_cast<Chunk*>(m_lastChunk)->m_items[m_lastChunkCount - 1];\n    }\n\n    void CopyTo(ElementType* dest)\n    {\n        Iterator iter(this);\n        ElementType* source;\n        size_t elementCount;\n\n        while (source = iter.GetNext(&elementCount), source != nullptr)\n        {\n            memcpy(dest, source, elementCount * sizeof(ElementType));\n            dest += elementCount;\n        }\n    }\n};\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcinfodecoder.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************\n *\n * GC Information Decoding API\n *\n *****************************************************************/\n\n// ******************************************************************************\n// WARNING!!!: These values are used by SOS in the diagnostics repo. Values should\n// added or removed in a backwards and forwards compatible way.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfodecoder.h\n// ******************************************************************************\n\n#ifndef _GC_INFO_DECODER_\n#define _GC_INFO_DECODER_\n\n#define _max(a, b) (((a) > (b)) ? (a) : (b))\n#define _min(a, b) (((a) < (b)) ? (a) : (b))\n\n#if !defined(TARGET_X86)\n#define USE_GC_INFO_DECODER\n#endif\n\n#if !defined(GCINFODECODER_NO_EE)\n\n#include \"eetwain.h\"\n\n#else\n\n#ifdef FEATURE_NATIVEAOT\n\ntypedef ArrayDPTR(const uint8_t) PTR_CBYTE;\n\n#define LIMITED_METHOD_CONTRACT\n#define SUPPORTS_DAC\n\n#define LOG(x)\n#define LOG_PIPTR(pObjRef, gcFlags, hCallBack)\n#define DAC_ARG(x)\n\n#define VALIDATE_ROOT(isInterior, hCallBack, pObjRef)\n\n#define UINT32 uint32_t\n#define INT32 int32_t\n#define UINT16 uint16_t\n#define UINT uint32_t\n#define SIZE_T uintptr_t\n#define SSIZE_T intptr_t\n#define LPVOID void*\n\ntypedef void * OBJECTREF;\n\n#define GET_CALLER_SP(pREGDISPLAY) ((TADDR)0)\n\nstruct GCInfoToken\n{\n    PTR_VOID Info;\n    UINT32 Version;\n\n    GCInfoToken(PTR_VOID info)\n    {\n        Info = info;\n        Version = 2;\n    }\n};\n\n#else // FEATURE_NATIVEAOT\n\n// Stuff from cgencpu.h:\n\n#ifndef __cgencpu_h__\n\ninline void SetIP(T_CONTEXT* context, PCODE rip)\n{\n    _ASSERTE(!\"don't call this\");\n}\n\ninline TADDR GetSP(T_CONTEXT* context)\n{\n#ifdef TARGET_AMD64\n    return (TADDR)context->Rsp;\n#elif defined(TARGET_ARM)\n    return (TADDR)context->Sp;\n#elif defined(TARGET_ARM64)\n    return (TADDR)context->Sp;\n#elif defined(TARGET_LOONGARCH64)\n    return (TADDR)context->Sp;\n#else\n    _ASSERTE(!\"nyi for platform\");\n#endif\n}\n\ninline PCODE GetIP(T_CONTEXT* context)\n{\n#ifdef TARGET_AMD64\n    return (PCODE) context->Rip;\n#elif defined(TARGET_ARM)\n    return (PCODE)context->Pc;\n#elif defined(TARGET_ARM64)\n    return (PCODE)context->Pc;\n#elif defined(TARGET_LOONGARCH64)\n    return (PCODE)context->Pc;\n#else\n    _ASSERTE(!\"nyi for platform\");\n#endif\n}\n\n#endif // !__cgencpu_h__\n\n// Misc. VM types:\n\n#ifndef DEFINE_OBJECTREF\n#define DEFINE_OBJECTREF\nclass Object;\ntypedef Object *OBJECTREF;\n#endif\ntypedef SIZE_T TADDR;\n\n// Stuff from gc.h:\n\n#ifndef __GC_H\n\n#define GC_CALL_INTERIOR            0x1\n#define GC_CALL_PINNED              0x2\n\n#endif // !__GC_H\n\n// Stuff from stdmacros.h (can't include because it includes contract.h, which uses #pragma once)\n\n#ifndef _stdmacros_h_\n\ninline BOOL IS_ALIGNED( size_t val, size_t alignment )\n{\n    // alignment must be a power of 2 for this implementation to work (need modulo otherwise)\n    _ASSERTE( 0 == (alignment & (alignment - 1)) );\n    return 0 == (val & (alignment - 1));\n}\ninline BOOL IS_ALIGNED( void* val, size_t alignment )\n{\n    return IS_ALIGNED( (size_t) val, alignment );\n}\n\n#define FMT_REG     \"r%d \"\n#define FMT_STK     \"sp%s0x%02x \"\n\n#define DBG_STK(off)                   \\\n        (off >= 0) ? \"+\" : \"-\",        \\\n        (off >= 0) ? off : -off\n\n#endif\n\n// Stuff from eetwain.h:\n\n#ifndef _EETWAIN_H\n\ntypedef void (*GCEnumCallback)(\n    void *          hCallback,      // callback data\n    OBJECTREF*      pObject,        // address of object-reference we are reporting\n    uint32_t        flags           // is this a pinned and/or interior pointer\n);\n\n#endif // !_EETWAIN_H\n\n#include \"regdisp.h\"\n\n#endif // FEATURE_NATIVEAOT\n\n#ifndef _strike_h\n\nenum ICodeManagerFlags\n{\n    ActiveStackFrame  =  0x0001, // this is the currently active function\n    ExecutionAborted  =  0x0002, // execution of this function has been aborted\n                                 // (i.e. it will not continue execution at the\n                                 // current location)\n    ParentOfFuncletStackFrame\n                      =  0x0040, // A funclet for this frame was previously reported\n\n    NoReportUntracked\n                    =   0x0080, // EnumGCRefs/EnumerateLiveSlots should *not* include\n                                // any untracked slots\n};\n\n#endif // !_strike_h\n\n#endif // GCINFODECODER_NO_EE\n\n\n#include \"gcinfotypes.h\"\n\n#ifdef _DEBUG\n    #define MAX_PREDECODED_SLOTS  4\n#else\n    #define MAX_PREDECODED_SLOTS 64\n#endif\n\n\n\nenum GcInfoDecoderFlags\n{\n    DECODE_EVERYTHING            = 0x0,\n    DECODE_SECURITY_OBJECT       = 0x01,    // stack location of security object\n    DECODE_CODE_LENGTH           = 0x02,\n    DECODE_VARARG                = 0x04,\n    DECODE_INTERRUPTIBILITY      = 0x08,\n    DECODE_GC_LIFETIMES          = 0x10,\n    DECODE_NO_VALIDATION         = 0x20,\n    DECODE_PSP_SYM               = 0x40,\n    DECODE_GENERICS_INST_CONTEXT = 0x80,    // stack location of instantiation context for generics\n                                            // (this may be either the 'this' ptr or the instantiation secret param)\n    DECODE_GS_COOKIE             = 0x100,   // stack location of the GS cookie\n    DECODE_FOR_RANGES_CALLBACK   = 0x200,\n    DECODE_PROLOG_LENGTH         = 0x400,   // length of the prolog (used to avoid reporting generics context)\n    DECODE_EDIT_AND_CONTINUE     = 0x800,\n    DECODE_REVERSE_PINVOKE_VAR   = 0x1000,\n    DECODE_RETURN_KIND           = 0x2000,\n#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n    DECODE_HAS_TAILCALLS         = 0x4000,\n#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64\n};\n\nenum GcInfoHeaderFlags\n{\n    GC_INFO_IS_VARARG                   = 0x1,\n    // unused                           = 0x2, // was GC_INFO_HAS_SECURITY_OBJECT\n    GC_INFO_HAS_GS_COOKIE               = 0x4,\n    GC_INFO_HAS_PSP_SYM                 = 0x8,\n    GC_INFO_HAS_GENERICS_INST_CONTEXT_MASK   = 0x30,\n    GC_INFO_HAS_GENERICS_INST_CONTEXT_NONE   = 0x00,\n    GC_INFO_HAS_GENERICS_INST_CONTEXT_MT     = 0x10,\n    GC_INFO_HAS_GENERICS_INST_CONTEXT_MD     = 0x20,\n    GC_INFO_HAS_GENERICS_INST_CONTEXT_THIS   = 0x30,\n    GC_INFO_HAS_STACK_BASE_REGISTER     = 0x40,\n#ifdef TARGET_AMD64\n    GC_INFO_WANTS_REPORT_ONLY_LEAF      = 0x80,\n#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n    GC_INFO_HAS_TAILCALLS               = 0x80,\n#endif // TARGET_AMD64\n    GC_INFO_HAS_EDIT_AND_CONTINUE_INFO = 0x100,\n    GC_INFO_REVERSE_PINVOKE_FRAME = 0x200,\n\n    GC_INFO_FLAGS_BIT_SIZE_VERSION_1    = 9,\n    GC_INFO_FLAGS_BIT_SIZE              = 10,\n};\n\nclass BitStreamReader\n{\npublic:\n    BitStreamReader()\n    {\n        SUPPORTS_DAC;\n    }\n\n    BitStreamReader( PTR_CBYTE pBuffer )\n    {\n        SUPPORTS_DAC;\n\n        _ASSERTE( pBuffer != NULL );\n\n        m_pCurrent = m_pBuffer = dac_cast<PTR_size_t>((size_t)dac_cast<TADDR>(pBuffer) & ~((size_t)sizeof(size_t)-1));\n        m_RelPos = m_InitialRelPos = (int)((size_t)dac_cast<TADDR>(pBuffer) % sizeof(size_t)) * 8/*BITS_PER_BYTE*/;\n    }\n\n    BitStreamReader(const BitStreamReader& other)\n    {\n        SUPPORTS_DAC;\n\n        m_pBuffer = other.m_pBuffer;\n        m_InitialRelPos = other.m_InitialRelPos;\n        m_pCurrent = other.m_pCurrent;\n        m_RelPos = other.m_RelPos;\n    }\n\n    const BitStreamReader& operator=(const BitStreamReader& other)\n    {\n        SUPPORTS_DAC;\n\n        m_pBuffer = other.m_pBuffer;\n        m_InitialRelPos = other.m_InitialRelPos;\n        m_pCurrent = other.m_pCurrent;\n        m_RelPos = other.m_RelPos;\n        return *this;\n    }\n\n    // NOTE: This routine is perf-critical\n    __forceinline size_t Read( int numBits )\n    {\n        SUPPORTS_DAC;\n\n        _ASSERTE(numBits > 0 && numBits <= BITS_PER_SIZE_T);\n\n        size_t result = (*m_pCurrent) >> m_RelPos;\n        int newRelPos = m_RelPos + numBits;\n        if(newRelPos >= BITS_PER_SIZE_T)\n        {\n            m_pCurrent++;\n            newRelPos -= BITS_PER_SIZE_T;\n            if(newRelPos > 0)\n            {\n                size_t extraBits = (*m_pCurrent) << (numBits - newRelPos);\n                result ^= extraBits;\n            }\n        }\n        m_RelPos = newRelPos;\n        result &= SAFE_SHIFT_LEFT(1, numBits) - 1;\n        return result;\n    }\n\n    // This version reads one bit, returning zero/non-zero (not 0/1)\n    // NOTE: This routine is perf-critical\n    __forceinline size_t ReadOneFast()\n    {\n        SUPPORTS_DAC;\n\n        size_t result = (*m_pCurrent) & (((size_t)1) << m_RelPos);\n        if(++m_RelPos == BITS_PER_SIZE_T)\n        {\n            m_pCurrent++;\n            m_RelPos = 0;\n        }\n        return result;\n    }\n\n\n    __forceinline size_t GetCurrentPos()\n    {\n        SUPPORTS_DAC;\n        return (size_t) ((m_pCurrent - m_pBuffer) * BITS_PER_SIZE_T + m_RelPos - m_InitialRelPos);\n    }\n\n    __forceinline void SetCurrentPos( size_t pos )\n    {\n        size_t adjPos = pos + m_InitialRelPos;\n        m_pCurrent = m_pBuffer + adjPos / BITS_PER_SIZE_T;\n        m_RelPos = (int)(adjPos % BITS_PER_SIZE_T);\n        _ASSERTE(GetCurrentPos() == pos);\n    }\n\n    __forceinline void Skip( SSIZE_T numBitsToSkip )\n    {\n        SUPPORTS_DAC;\n\n        SetCurrentPos(GetCurrentPos() + numBitsToSkip);\n    }\n\n    __forceinline void AlignUpToByte()\n    {\n        if(m_RelPos <= BITS_PER_SIZE_T - 8)\n        {\n            m_RelPos = (m_RelPos + 7) & ~7;\n        }\n        else\n        {\n            m_RelPos = 0;\n            m_pCurrent++;\n        }\n    }\n\n    __forceinline size_t ReadBitAtPos( size_t pos )\n    {\n        size_t adjPos = pos + m_InitialRelPos;\n        size_t* ptr = m_pBuffer + adjPos / BITS_PER_SIZE_T;\n        int relPos = (int)(adjPos % BITS_PER_SIZE_T);\n        return (*ptr) & (((size_t)1) << relPos);\n    }\n\n\n    //--------------------------------------------------------------------------\n    // Decode variable length numbers\n    // See the corresponding methods on BitStreamWriter for more information on the format\n    //--------------------------------------------------------------------------\n\n    inline size_t DecodeVarLengthUnsigned( int base )\n    {\n        _ASSERTE((base > 0) && (base < (int)BITS_PER_SIZE_T));\n        size_t numEncodings = size_t{ 1 } << base;\n        size_t result = 0;\n        for(int shift=0; ; shift+=base)\n        {\n            _ASSERTE(shift+base <= (int)BITS_PER_SIZE_T);\n\n            size_t currentChunk = Read(base+1);\n            result |= (currentChunk & (numEncodings-1)) << shift;\n            if(!(currentChunk & numEncodings))\n            {\n                // Extension bit is not set, we're done.\n                return result;\n            }\n        }\n    }\n\n    inline SSIZE_T DecodeVarLengthSigned( int base )\n    {\n        _ASSERTE((base > 0) && (base < (int)BITS_PER_SIZE_T));\n        size_t numEncodings = size_t{ 1 } << base;\n        SSIZE_T result = 0;\n        for(int shift=0; ; shift+=base)\n        {\n            _ASSERTE(shift+base <= (int)BITS_PER_SIZE_T);\n\n            size_t currentChunk = Read(base+1);\n            result |= (currentChunk & (numEncodings-1)) << shift;\n            if(!(currentChunk & numEncodings))\n            {\n                // Extension bit is not set, sign-extend and we're done.\n                int sbits = BITS_PER_SIZE_T - (shift+base);\n                result <<= sbits;\n                result >>= sbits;   // This provides the sign extension\n                return result;\n            }\n        }\n    }\n\nprivate:\n    PTR_size_t m_pBuffer;\n    int m_InitialRelPos;\n    PTR_size_t m_pCurrent;\n    int m_RelPos;\n};\n\nstruct GcSlotDesc\n{\n    union\n    {\n        UINT32 RegisterNumber;\n        GcStackSlot Stack;\n    } Slot;\n    GcSlotFlags Flags;\n};\n\nclass GcSlotDecoder\n{\npublic:\n    GcSlotDecoder()\n    {}\n\n    void DecodeSlotTable(BitStreamReader& reader);\n\n    UINT32 GetNumSlots()\n    {\n        return m_NumSlots;\n    }\n\n    UINT32 GetNumUntracked()\n    {\n        return m_NumUntracked;\n    }\n\n    UINT32 GetNumTracked()\n    {\n        return m_NumSlots - m_NumUntracked;\n    }\n\n    UINT32 GetNumRegisters()\n    {\n        return m_NumRegisters;\n    }\n\n    const GcSlotDesc* GetSlotDesc(UINT32 slotIndex);\n\nprivate:\n    GcSlotDesc m_SlotArray[MAX_PREDECODED_SLOTS];\n    BitStreamReader m_SlotReader;\n    UINT32 m_NumSlots;\n    UINT32 m_NumRegisters;\n    UINT32 m_NumUntracked;\n\n    UINT32 m_NumDecodedSlots;\n    GcSlotDesc* m_pLastSlot;\n};\n\n#ifdef USE_GC_INFO_DECODER\nclass GcInfoDecoder\n{\npublic:\n\n    // If you are not interested in interruptibility or gc lifetime information, pass 0 as instructionOffset\n    GcInfoDecoder(\n            GCInfoToken gcInfoToken,\n            GcInfoDecoderFlags flags = DECODE_EVERYTHING,\n            UINT32 instructionOffset = 0\n            );\n\n    //------------------------------------------------------------------------\n    // Interruptibility\n    //------------------------------------------------------------------------\n\n    bool IsInterruptible();\n\n#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED\n    // This is used for gccoverage\n    bool IsSafePoint(UINT32 codeOffset);\n\n    typedef void EnumerateSafePointsCallback (UINT32 offset, void * hCallback);\n    void EnumerateSafePoints(EnumerateSafePointsCallback * pCallback, void * hCallback);\n\n#endif\n    // Returns true to stop enumerating.\n    typedef bool EnumerateInterruptibleRangesCallback (UINT32 startOffset, UINT32 stopOffset, void * hCallback);\n\n    void EnumerateInterruptibleRanges (\n                EnumerateInterruptibleRangesCallback *pCallback,\n                void *                                hCallback);\n\n    //------------------------------------------------------------------------\n    // GC lifetime information\n    //------------------------------------------------------------------------\n\n    bool EnumerateLiveSlots(\n                PREGDISPLAY         pRD,\n                bool                reportScratchSlots,\n                unsigned            flags,\n                GCEnumCallback      pCallBack,\n                void *              hCallBack\n                );\n\n    // Public for the gc info dumper\n    void EnumerateUntrackedSlots(\n                PREGDISPLAY         pRD,\n                unsigned            flags,\n                GCEnumCallback      pCallBack,\n                void *              hCallBack\n                );\n\n    //------------------------------------------------------------------------\n    // Miscellaneous method information\n    //------------------------------------------------------------------------\n\n    INT32   GetGSCookieStackSlot();\n    UINT32  GetGSCookieValidRangeStart();\n    UINT32  GetGSCookieValidRangeEnd();\n    UINT32  GetPrologSize();\n    INT32   GetPSPSymStackSlot();\n    INT32   GetGenericsInstContextStackSlot();\n    INT32   GetReversePInvokeFrameStackSlot();\n    bool    HasMethodDescGenericsInstContext();\n    bool    HasMethodTableGenericsInstContext();\n    bool    GetIsVarArg();\n    bool    WantsReportOnlyLeaf();\n#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n    bool    HasTailCalls();\n#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64\n    ReturnKind GetReturnKind();\n    UINT32  GetCodeLength();\n    UINT32  GetStackBaseRegister();\n    UINT32  GetSizeOfEditAndContinuePreservedArea();\n#ifdef TARGET_ARM64\n    UINT32  GetSizeOfEditAndContinueFixedStackFrame();\n#endif\n    size_t  GetNumBytesRead();\n\n#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA\n    UINT32  GetSizeOfStackParameterArea();\n#endif // FIXED_STACK_PARAMETER_SCRATCH_AREA\n\n\nprivate:\n    BitStreamReader m_Reader;\n    UINT32  m_InstructionOffset;\n\n    // Pre-decoded information\n    bool    m_IsInterruptible;\n    bool    m_IsVarArg;\n    bool    m_GenericSecretParamIsMD;\n    bool    m_GenericSecretParamIsMT;\n#ifdef TARGET_AMD64\n    bool    m_WantsReportOnlyLeaf;\n#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n    bool    m_HasTailCalls;\n#endif // TARGET_AMD64\n    INT32   m_GSCookieStackSlot;\n    INT32   m_ReversePInvokeFrameStackSlot;\n    UINT32  m_ValidRangeStart;\n    UINT32  m_ValidRangeEnd;\n    INT32   m_PSPSymStackSlot;\n    INT32   m_GenericsInstContextStackSlot;\n    UINT32  m_CodeLength;\n    UINT32  m_StackBaseRegister;\n    UINT32  m_SizeOfEditAndContinuePreservedArea;\n#ifdef TARGET_ARM64\n    UINT32  m_SizeOfEditAndContinueFixedStackFrame;\n#endif\n    ReturnKind m_ReturnKind;\n#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED\n    UINT32  m_NumSafePoints;\n    UINT32  m_SafePointIndex;\n    UINT32 FindSafePoint(UINT32 codeOffset);\n#endif\n    UINT32  m_NumInterruptibleRanges;\n\n#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA\n    UINT32 m_SizeOfStackOutgoingAndScratchArea;\n#endif // FIXED_STACK_PARAMETER_SCRATCH_AREA\n\n#ifdef _DEBUG\n    GcInfoDecoderFlags m_Flags;\n    PTR_CBYTE m_GcInfoAddress;\n#endif\n    UINT32 m_Version;\n\n    static bool SetIsInterruptibleCB (UINT32 startOffset, UINT32 stopOffset, void * hCallback);\n\n    OBJECTREF* GetRegisterSlot(\n                        int             regNum,\n                        PREGDISPLAY     pRD\n                        );\n\n#ifdef TARGET_UNIX\n    OBJECTREF* GetCapturedRegister(\n                        int             regNum,\n                        PREGDISPLAY     pRD\n                        );\n#endif // TARGET_UNIX\n\n    OBJECTREF* GetStackSlot(\n                        INT32           spOffset,\n                        GcStackSlotBase spBase,\n                        PREGDISPLAY     pRD\n                        );\n\n#ifdef DACCESS_COMPILE\n    int GetStackReg(int spBase);\n#endif // DACCESS_COMPILE\n\n    bool IsScratchRegister(int regNum,  PREGDISPLAY pRD);\n    bool IsScratchStackSlot(INT32 spOffset, GcStackSlotBase spBase, PREGDISPLAY pRD);\n\n    void ReportUntrackedSlots(\n                GcSlotDecoder&      slotDecoder,\n                PREGDISPLAY         pRD,\n                unsigned            flags,\n                GCEnumCallback      pCallBack,\n                void *              hCallBack\n                );\n\n    void ReportRegisterToGC(\n                                int             regNum,\n                                unsigned        gcFlags,\n                                PREGDISPLAY     pRD,\n                                unsigned        flags,\n                                GCEnumCallback  pCallBack,\n                                void *          hCallBack\n                                );\n\n    void ReportStackSlotToGC(\n                                INT32           spOffset,\n                                GcStackSlotBase spBase,\n                                unsigned        gcFlags,\n                                PREGDISPLAY     pRD,\n                                unsigned        flags,\n                                GCEnumCallback  pCallBack,\n                                void *          hCallBack\n                                );\n\n\n    inline void ReportSlotToGC(\n                    GcSlotDecoder&      slotDecoder,\n                    UINT32              slotIndex,\n                    PREGDISPLAY         pRD,\n                    bool                reportScratchSlots,\n                    unsigned            inputFlags,\n                    GCEnumCallback      pCallBack,\n                    void *              hCallBack\n                    )\n    {\n        _ASSERTE(slotIndex < slotDecoder.GetNumSlots());\n        const GcSlotDesc* pSlot = slotDecoder.GetSlotDesc(slotIndex);\n\n        if(slotIndex < slotDecoder.GetNumRegisters())\n        {\n            UINT32 regNum = pSlot->Slot.RegisterNumber;\n            if( reportScratchSlots || !IsScratchRegister( regNum, pRD ) )\n            {\n                ReportRegisterToGC(\n                            regNum,\n                            pSlot->Flags,\n                            pRD,\n                            inputFlags,\n                            pCallBack,\n                            hCallBack\n                            );\n            }\n            else\n            {\n                LOG((LF_GCROOTS, LL_INFO1000, \"\\\"Live\\\" scratch register \" FMT_REG \" not reported\\n\", regNum));\n            }\n        }\n        else\n        {\n            INT32 spOffset = pSlot->Slot.Stack.SpOffset;\n            GcStackSlotBase spBase = pSlot->Slot.Stack.Base;\n            if( reportScratchSlots || !IsScratchStackSlot(spOffset, spBase, pRD) )\n            {\n                ReportStackSlotToGC(\n                            spOffset,\n                            spBase,\n                            pSlot->Flags,\n                            pRD,\n                            inputFlags,\n                            pCallBack,\n                            hCallBack\n                            );\n            }\n            else\n            {\n                LOG((LF_GCROOTS, LL_INFO1000, \"\\\"Live\\\" scratch stack slot \" FMT_STK  \" not reported\\n\", DBG_STK(spOffset)));\n            }\n        }\n    }\n};\n#endif // USE_GC_INFO_DECODER\n\n\n#endif // _GC_INFO_DECODER_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcinfodumper.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __GCINFODUMPER_H__\n#define __GCINFODUMPER_H__\n\n#include \"gcinfotypes.h\"\n#include \"gcinfodecoder.h\"\n\n// *****************************************************************************\n// WARNING!!!: These values and code are also used by SOS in the diagnostics\n// repo. Should updated in a backwards and forwards compatible way.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfodumper.h\n// *****************************************************************************\n\n//\n// This class dumps the contents of the gc encodings, providing outputs\n// similar to the inputs to GcInfoEncoder.  This uses the same GcInfoDecoder\n// functions that the EE uses (vs. decoding the bits directly).\n//\nclass GcInfoDumper\n{\npublic:\n\n    GcInfoDumper (GCInfoToken gcInfoToken);\n    ~GcInfoDumper ();\n\n    // Returns TRUE to stop decoding.\n    typedef BOOL InterruptibleStateChangeProc (\n            UINT32 CodeOffset,\n            BOOL fInterruptible,\n            PVOID pvData);\n\n    // Returns TRUE to stop decoding.\n    typedef BOOL OnSafePointProc (\n            UINT32 CodeOffset,\n            PVOID pvData);\n\n    // Returns TRUE to stop decoding.\n    typedef BOOL RegisterStateChangeProc (\n            UINT32 CodeOffset,\n            UINT32 RegisterNumber,\n            GcSlotFlags Flags,\n            GcSlotState NewState,\n            PVOID pvData);\n\n    // Returns TRUE to stop decoding.\n    typedef BOOL StackSlotStateChangeProc (\n            UINT32 CodeOffset,\n            GcSlotFlags flags,\n            GcStackSlotBase BaseRegister,\n            SSIZE_T StackOffset,\n            GcSlotState NewState,\n            PVOID pvData);\n\n    enum EnumerateStateChangesResults\n    {\n        SUCCESS = 0,\n        OUT_OF_MEMORY,\n        REPORTED_REGISTER_IN_CALLERS_FRAME,\n        REPORTED_FRAME_POINTER,\n        REPORTED_INVALID_BASE_REGISTER,\n        REPORTED_INVALID_POINTER,\n        DECODER_FAILED,\n    };\n\n    // Returns TRUE if successful.  FALSE if out of memory, invalid data, etc.\n    EnumerateStateChangesResults EnumerateStateChanges (\n            InterruptibleStateChangeProc *pfnInterruptibleStateChange,\n            RegisterStateChangeProc *pfnRegisterStateChange,\n            StackSlotStateChangeProc *pfnStackSlotStateChange,\n            OnSafePointProc *pfnSafePointFunc,\n            PVOID pvData);\n\n    size_t GetGCInfoSize();\n\nprivate:\n\n    struct LivePointerRecord\n    {\n        OBJECTREF *ppObject;\n        DWORD flags;\n        LivePointerRecord *pNext;\n        UINT marked;\n    };\n\n    GCInfoToken m_gcTable;\n    UINT32 m_StackBaseRegister;\n    UINT32 m_SizeOfEditAndContinuePreservedArea;\n    LivePointerRecord *m_pRecords;\n    RegisterStateChangeProc *m_pfnRegisterStateChange;\n    StackSlotStateChangeProc *m_pfnStackSlotStateChange;\n    PVOID m_pvCallbackData;\n    EnumerateStateChangesResults m_Error;\n    size_t m_gcInfoSize;\n\n    static void LivePointerCallback (\n            LPVOID          hCallback,      // callback data\n            OBJECTREF*      pObject,        // address of object-reference we are reporting\n            uint32_t        flags           // is this a pinned and/or interior pointer\n            DAC_ARG(DacSlotLocation loc));  // the location the pointer came from\n\n    static void FreePointerRecords (LivePointerRecord *pRecords);\n\n    // Return TRUE if callback requested to stop decoding.\n    BOOL ReportPointerRecord (\n            UINT32 CodeOffset,\n            BOOL fLive,\n            REGDISPLAY *pRD,\n            LivePointerRecord *pRecord);\n\n    // Return TRUE if callback requested to stop decoding.\n    BOOL ReportPointerDifferences (\n            UINT32 offset,\n            REGDISPLAY *pRD,\n            LivePointerRecord *pPrevState);\n};\n\n\n#endif // !__GCINFODUMPER_H__\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcinfoencoder.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n/*****************************************************************\n *\n * GC Information Encoding API\n *\n *****************************************************************/\n\n/*****************************************************************\n\n ENCODING LAYOUT\n\n 1. Header\n\n Slim Header for simple and common cases:\n    - EncodingType[Slim]\n    - ReturnKind (Fat: 2 bits)\n    - CodeLength\n    - NumCallSites (#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED)\n\n Fat Header for other cases:\n    - EncodingType[Fat]\n    - Flag:     isVarArg,\n                unused (was hasSecurityObject),\n                hasGSCookie,\n                hasPSPSymStackSlot,\n                hasGenericsInstContextStackSlot,\n                hasStackBaseregister,\n                wantsReportOnlyLeaf (AMD64 use only),\n                hasTailCalls (ARM/ARM64 only)\n                hasSizeOfEditAndContinuePreservedArea\n                hasReversePInvokeFrame,\n    - ReturnKind (Fat: 4 bits)\n    - CodeLength\n    - Prolog (if hasGenericsInstContextStackSlot || hasGSCookie)\n    - Epilog (if hasGSCookie)\n    - SecurityObjectStackSlot (if any)\n    - GSCookieStackSlot (if any)\n    - PSPSymStackSlot (if any)\n    - GenericsInstContextStackSlot (if any)\n    - StackBaseRegister (if any)\n    - SizeOfEditAndContinuePreservedArea (if any)\n    - ReversePInvokeFrameSlot (if any)\n    - SizeOfStackOutgoingAndScratchArea (#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA)\n    - NumCallSites (#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED)\n    - NumInterruptibleRanges\n\n 2. Call sites offsets (#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED)\n 3. Fully-interruptible ranges\n 4. Slot table\n 5. GC state at call sites (#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED)\n 6. GC state at try clauses (#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED)\n 7. Chunk pointers\n 8. Chunk encodings\n\n\n STANDALONE_BUILD\n\n The STANDALONE_BUILD switch can be used to build the GcInfoEncoder library\n independently by clients outside the CoreClr tree.\n\n The GcInfo library uses some custom data-structures (ex: ArrayList, SimplerHashTable)\n and includes some utility libraries (ex: UtilCode) which pull in several other\n headers with considerable unrelated content. Rather than porting all the\n utility code to suite other clients, the  STANDALONE_BUILD switch can be used\n to include only the minimal set of headers specific to GcInfo encodings.\n\n Clients of STANDALONE_BUILD will likely use standard library\n implementations of data-structures like ArrayList, HashMap etc., in place\n of the custom implementation currently used by GcInfoEncoder.\n\n Rather than spew the GcInfoEnoder code with\n #ifdef STANDALONE_BUILD ... #else .. #endif blocks, we include a special\n header GcInfoUtil.h in STANDALONE_BUILD mode.  GcInfoUtil.h is expected to\n supply the interface/implementation for the data-structures and utilities\n used by GcInfoEncoder. This header should be provided by the clients doing\n the standalone build in their source tree.\n\n*****************************************************************/\n\n\n#ifndef __GCINFOENCODER_H__\n#define __GCINFOENCODER_H__\n\n#ifdef STANDALONE_BUILD\n#include <wchar.h>\n#include <stdio.h>\n#include \"GcInfoUtil.h\"\n#include \"corjit.h\"\n#else\n#include <windows.h>\n#include <wchar.h>\n#include <stdio.h>\n#include \"corjit.h\"\n#include \"iallocator.h\"\n#include \"gcinfoarraylist.h\"\n#include \"stdmacros.h\"\n#include \"eexcp.h\"\n#endif\n\n#include \"gcinfotypes.h\"\n\n// As stated in issue #6008, GcInfoSize should be incorporated into debug builds.\n#ifdef _DEBUG\n#define MEASURE_GCINFO\n#endif\n\n#ifdef MEASURE_GCINFO\nstruct GcInfoSize\n{\n    size_t TotalSize;\n\n    size_t NumMethods;\n    size_t NumCallSites;\n    size_t NumRanges;\n    size_t NumRegs;\n    size_t NumStack;\n    size_t NumUntracked;\n    size_t NumTransitions;\n    size_t SizeOfCode;\n    size_t EncInfoSize;\n\n    size_t UntrackedSlotSize;\n    size_t NumUntrackedSize;\n    size_t FlagsSize;\n    size_t RetKindSize;\n    size_t CodeLengthSize;\n    size_t ProEpilogSize;\n    size_t SecObjSize;\n    size_t GsCookieSize;\n    size_t PspSymSize;\n    size_t GenericsCtxSize;\n    size_t StackBaseSize;\n    size_t ReversePInvokeFrameSize;\n    size_t FixedAreaSize;\n    size_t NumCallSitesSize;\n    size_t NumRangesSize;\n    size_t CallSitePosSize;\n    size_t RangeSize;\n    size_t NumRegsSize;\n    size_t NumStackSize;\n    size_t RegSlotSize;\n    size_t StackSlotSize;\n    size_t CallSiteStateSize;\n    size_t EhPosSize;\n    size_t EhStateSize;\n    size_t ChunkPtrSize;\n    size_t ChunkMaskSize;\n    size_t ChunkFinalStateSize;\n    size_t ChunkTransitionSize;\n\n    GcInfoSize();\n    GcInfoSize& operator+=(const GcInfoSize& other);\n    void Log(DWORD level, const char * header);\n};\n#endif\n\nstruct GcSlotDesc\n{\n    union\n    {\n        UINT32 RegisterNumber;\n        GcStackSlot Stack;\n    } Slot;\n    GcSlotFlags Flags;\n\n    BOOL IsRegister() const\n    {\n        return (Flags & GC_SLOT_IS_REGISTER);\n    }\n    BOOL IsInterior() const\n    {\n        return (Flags & GC_SLOT_INTERIOR);\n    }\n    BOOL IsPinned() const\n    {\n        return (Flags & GC_SLOT_PINNED);\n    }\n    BOOL IsUntracked() const\n    {\n        return (Flags & GC_SLOT_UNTRACKED);\n    }\n    BOOL IsDeleted() const\n    {\n        return (Flags & GC_SLOT_IS_DELETED);\n    }\n    void MarkDeleted()\n    {\n        Flags = (GcSlotFlags) (Flags | GC_SLOT_IS_DELETED);\n    }\n};\n\nclass BitArray;\nclass BitStreamWriter\n{\npublic:\n    BitStreamWriter( IAllocator* pAllocator );\n\n    // bit 0 is the least significative bit\n    void Write( size_t data, UINT32 count );\n\n    inline size_t GetBitCount()\n    {\n        return m_BitCount;\n    }\n\n    inline size_t GetByteCount()\n    {\n        return ( m_BitCount + 7 )  / 8;\n    }\n\n\n    void CopyTo( BYTE* buffer );\n    void Dispose();\n\n    //--------------------------------------------------------\n    // Compute the number of bits used to encode variable length numbers\n    // Uses base+1 bits at minimum\n    // Bits 0..(base-1) represent the encoded quantity\n    // If it doesn't fit, set bit #base to 1 and use base+1 more bits\n    //--------------------------------------------------------\n    static int SizeofVarLengthUnsigned( size_t n, UINT32 base );\n\n    //--------------------------------------------------------\n    // Encode variable length numbers\n    // Uses base+1 bits at minimum\n    // Bits 0..(base-1) represent the encoded quantity\n    // If it doesn't fit, set bit #base to 1 and use base+1 more bits\n    //--------------------------------------------------------\n    int EncodeVarLengthUnsigned( size_t n, UINT32 base );\n\n    //--------------------------------------------------------\n    // Signed quantities are encoded the same as unsigned\n    // The most relevant difference is that a number is considered\n    // to fit in base bits if the topmost bit of a base-long chunk\n    // matches the sign of the whole number\n    //--------------------------------------------------------\n    int EncodeVarLengthSigned( SSIZE_T n, UINT32 base );\n\nprivate:\n    class MemoryBlockList;\n    class MemoryBlock\n    {\n        friend class MemoryBlockList;\n        MemoryBlock* m_next;\n\n    public:\n        size_t Contents[];\n\n        inline MemoryBlock* Next()\n        {\n            return m_next;\n        }\n    };\n\n    class MemoryBlockList\n    {\n        MemoryBlock* m_head;\n        MemoryBlock* m_tail;\n\n    public:\n        MemoryBlockList();\n\n        inline MemoryBlock* Head()\n        {\n            return m_head;\n        }\n\n        MemoryBlock* AppendNew(IAllocator* allocator, size_t bytes);\n        void Dispose(IAllocator* allocator);\n    };\n\n    IAllocator* m_pAllocator;\n    size_t m_BitCount;\n    UINT32 m_FreeBitsInCurrentSlot;\n    MemoryBlockList m_MemoryBlocks;\n    const static int m_MemoryBlockSize = 128;    // must be a multiple of the pointer size\n    size_t* m_pCurrentSlot;            // bits are written through this pointer\n    size_t* m_OutOfBlockSlot;        // sentinel value to determine when the block is full\n#ifdef _DEBUG\n    int m_MemoryBlocksCount;\n#endif\n\nprivate:\n    // Writes bits knowing that they will all fit in the current memory slot\n    inline void WriteInCurrentSlot( size_t data, UINT32 count )\n    {\n        data &= SAFE_SHIFT_LEFT(1, count) - 1;\n        data <<= (BITS_PER_SIZE_T - m_FreeBitsInCurrentSlot);\n        *m_pCurrentSlot |= data;\n    }\n\n    inline void AllocMemoryBlock()\n    {\n        _ASSERTE( IS_ALIGNED( m_MemoryBlockSize, sizeof( size_t ) ) );\n        MemoryBlock* pMemBlock = m_MemoryBlocks.AppendNew(m_pAllocator, m_MemoryBlockSize);\n\n        m_pCurrentSlot = pMemBlock->Contents;\n        m_OutOfBlockSlot = m_pCurrentSlot + m_MemoryBlockSize / sizeof( size_t );\n\n#ifdef _DEBUG\n           m_MemoryBlocksCount++;\n#endif\n\n    }\n\n    inline void InitCurrentSlot()\n    {\n        m_FreeBitsInCurrentSlot = BITS_PER_SIZE_T;\n        *m_pCurrentSlot = 0;\n    }\n};\n\n\ntypedef UINT32 GcSlotId;\n\n\ninline UINT32 GetNormCodeOffsetChunk(UINT32 normCodeOffset)\n{\n    return normCodeOffset / NUM_NORM_CODE_OFFSETS_PER_CHUNK;\n}\n\ninline UINT32 GetCodeOffsetChunk(UINT32 codeOffset)\n{\n    return (NORMALIZE_CODE_OFFSET(codeOffset)) / NUM_NORM_CODE_OFFSETS_PER_CHUNK;\n}\n\nenum GENERIC_CONTEXTPARAM_TYPE\n{\n    GENERIC_CONTEXTPARAM_NONE = 0,\n    GENERIC_CONTEXTPARAM_MT = 1,\n    GENERIC_CONTEXTPARAM_MD = 2,\n    GENERIC_CONTEXTPARAM_THIS = 3,\n};\n\nextern void DECLSPEC_NORETURN ThrowOutOfMemory();\n\nclass GcInfoEncoder\n{\npublic:\n    typedef void (*NoMemoryFunction)(void);\n\n    GcInfoEncoder(\n            ICorJitInfo*                pCorJitInfo,\n            CORINFO_METHOD_INFO*        pMethodInfo,\n            IAllocator*                 pJitAllocator,\n            NoMemoryFunction            pNoMem = ::ThrowOutOfMemory\n            );\n\n    struct LifetimeTransition\n    {\n        UINT32 CodeOffset;\n        GcSlotId SlotId;\n        BYTE BecomesLive;\n        BYTE IsDeleted;\n    };\n\n\n#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED\n    void DefineCallSites(UINT32* pCallSites, BYTE* pCallSiteSizes, UINT32 numCallSites);\n#endif\n\n    //------------------------------------------------------------------------\n    // Interruptibility\n    //------------------------------------------------------------------------\n\n    // An instruction at offset x will be interruptible\n    //  if-and-only-if startInstructionOffset <= x < startInstructionOffset+length\n    void DefineInterruptibleRange( UINT32 startInstructionOffset, UINT32 length );\n\n\n    //------------------------------------------------------------------------\n    // Slot information\n    //------------------------------------------------------------------------\n\n    //\n    // If spOffset is relative to the current SP, spOffset must be non-negative.\n    // If spOffset is relative to the SP of the caller (same as SP at the method entry and exit)\n    //   Negative offsets describe GC refs in the local and outgoing areas.\n    //   Positive offsets describe GC refs in the scratch area\n    // Note that if the dynamic allocation area is resized, the outgoing area will not be valid anymore\n    //  Old slots must be declared dead and new ones can be defined.\n    //  It's up to the JIT to do the right thing. We don't enforce this.\n\n    GcSlotId GetRegisterSlotId( UINT32 regNum, GcSlotFlags flags );\n    GcSlotId GetStackSlotId( INT32 spOffset, GcSlotFlags flags, GcStackSlotBase spBase = GC_CALLER_SP_REL );\n\n    //\n    // After a FinalizeSlotIds is called, no more slot definitions can be made.\n    // FinalizeSlotIds must be called once and only once before calling Build()\n    //\n    void FinalizeSlotIds();\n\n\n    //------------------------------------------------------------------------\n    // Fully-interruptible information\n    //------------------------------------------------------------------------\n\n    //\n    // For inputs, pass zero as offset\n    //\n\n    // Indicates that the GC state of slot \"slotId\" becomes (and remains, until another transition)\n    // \"slotState\" after the instruction preceding \"instructionOffset\" (so it is first in this state when\n    // the IP of a suspended thread is at this instruction offset).\n\n    void SetSlotState(              UINT32      instructionOffset,\n                                    GcSlotId    slotId,\n                                    GcSlotState slotState\n                                    );\n\n\n    //------------------------------------------------------------------------\n    // ReturnKind\n    //------------------------------------------------------------------------\n\n    void SetReturnKind(ReturnKind returnKind);\n\n    //------------------------------------------------------------------------\n    // Miscellaneous method information\n    //------------------------------------------------------------------------\n\n    void SetPrologSize( UINT32 prologSize );\n    void SetGSCookieStackSlot( INT32 spOffsetGSCookie, UINT32 validRangeStart, UINT32 validRangeEnd );\n    void SetPSPSymStackSlot( INT32 spOffsetPSPSym );\n    void SetGenericsInstContextStackSlot( INT32 spOffsetGenericsContext, GENERIC_CONTEXTPARAM_TYPE type);\n    void SetReversePInvokeFrameSlot(INT32 spOffset);\n    void SetIsVarArg();\n    void SetCodeLength( UINT32 length );\n\n    // Optional in the general case. Required if the method uses GC_FRAMEREG_REL stack slots\n    void SetStackBaseRegister( UINT32 registerNumber );\n\n    // Number of slots preserved during EnC remap\n    void SetSizeOfEditAndContinuePreservedArea( UINT32 size );\n#ifdef TARGET_ARM64\n    void SetSizeOfEditAndContinueFixedStackFrame( UINT32 size );\n#endif\n\n#ifdef TARGET_AMD64\n    // Used to only report a frame once for the leaf function/funclet\n    // instead of once for each live function/funclet on the stack.\n    // Called only by RyuJIT (not JIT64)\n    void SetWantsReportOnlyLeaf();\n#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n    void SetHasTailCalls();\n#endif // TARGET_AMD64\n\n#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA\n    void SetSizeOfStackOutgoingAndScratchArea( UINT32 size );\n#endif // FIXED_STACK_PARAMETER_SCRATCH_AREA\n\n\n    //------------------------------------------------------------------------\n    // Encoding\n    //------------------------------------------------------------------------\n\n    //\n    // Build() encodes GC information into temporary buffers.\n    // The method description cannot change after Build is called\n    //\n    void Build();\n\n    //\n    // Write encoded information to its final destination and frees temporary buffers.\n    // The encoder shouldn't be used anymore after calling this method.\n    // It returns a pointer to the destination buffer, which address is byte-aligned\n    //\n    BYTE* Emit();\n\nprivate:\n\n    friend struct CompareLifetimeTransitionsByOffsetThenSlot;\n    friend struct CompareLifetimeTransitionsByChunk;\n\n\n    struct InterruptibleRange\n    {\n        UINT32 NormStartOffset;\n        UINT32 NormStopOffset;\n    };\n\n    ICorJitInfo*                m_pCorJitInfo;\n    CORINFO_METHOD_INFO*        m_pMethodInfo;\n    IAllocator*                 m_pAllocator;\n    NoMemoryFunction            m_pNoMem;\n\n    BitStreamWriter     m_Info1;    // Used for everything except for chunk encodings\n    BitStreamWriter     m_Info2;    // Used for chunk encodings\n\n    GcInfoArrayList<InterruptibleRange, 8> m_InterruptibleRanges;\n    GcInfoArrayList<LifetimeTransition, 64> m_LifetimeTransitions;\n\n    bool   m_IsVarArg;\n#if defined(TARGET_AMD64)\n    bool   m_WantsReportOnlyLeaf;\n#elif defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n    bool   m_HasTailCalls;\n#endif // TARGET_AMD64\n    INT32  m_GSCookieStackSlot;\n    UINT32 m_GSCookieValidRangeStart;\n    UINT32 m_GSCookieValidRangeEnd;\n    INT32  m_PSPSymStackSlot;\n    INT32  m_GenericsInstContextStackSlot;\n    GENERIC_CONTEXTPARAM_TYPE m_contextParamType;\n    ReturnKind m_ReturnKind;\n    UINT32 m_CodeLength;\n    UINT32 m_StackBaseRegister;\n    UINT32 m_SizeOfEditAndContinuePreservedArea;\n#ifdef TARGET_ARM64\n    UINT32 m_SizeOfEditAndContinueFixedStackFrame;\n#endif\n    INT32  m_ReversePInvokeFrameSlot;\n    InterruptibleRange* m_pLastInterruptibleRange;\n\n#ifdef FIXED_STACK_PARAMETER_SCRATCH_AREA\n    UINT32 m_SizeOfStackOutgoingAndScratchArea;\n#endif // FIXED_STACK_PARAMETER_SCRATCH_AREA\n\n    void * eeAllocGCInfo (size_t        blockSize);\n\nprivate:\n\n    friend class EncoderCheckState;\n\n    static const UINT32 m_SlotTableInitialSize = 32;\n    UINT32 m_SlotTableSize;\n    UINT32 m_NumSlots;\n    GcSlotDesc *m_SlotTable;\n\n#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED\n    UINT32* m_pCallSites;\n    BYTE* m_pCallSiteSizes;\n    UINT32 m_NumCallSites;\n#endif // PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED\n\n    void GrowSlotTable();\n\n    void WriteSlotStateVector(BitStreamWriter &writer, const BitArray& vector);\n\n    UINT32 SizeofSlotStateVarLengthVector(const BitArray& vector, UINT32 baseSkip, UINT32 baseRun);\n    void SizeofSlotStateVarLengthVector(const BitArray& vector, UINT32 baseSkip, UINT32 baseRun, UINT32 * pSizeofSimple, UINT32 * pSizeofRLE, UINT32 * pSizeofRLENeg);\n    UINT32 WriteSlotStateVarLengthVector(BitStreamWriter &writer, const BitArray& vector, UINT32 baseSkip, UINT32 baseRun);\n\n    bool IsAlwaysScratch(GcSlotDesc &slot);\n\n    // Assumes that \"*ppTransitions\" is has size \"numTransitions\", is sorted by CodeOffset then by SlotId,\n    // and that \"*ppEndTransitions\" points one beyond the end of the array.  If \"*ppTransitions\" contains\n    // any dead/live transitions pairs for the same CodeOffset and SlotID, removes those, by allocating a\n    // new array, and copying the non-removed elements into it.  If it does this, sets \"*ppTransitions\" to\n    // point to the new array, \"*pNumTransitions\" to its shorted length, and \"*ppEndTransitions\" to\n    // point one beyond the used portion of this array.\n    void EliminateRedundantLiveDeadPairs(LifetimeTransition** ppTransitions,\n                                         size_t* pNumTransitions,\n                                         LifetimeTransition** ppEndTransitions);\n\n#ifdef _DEBUG\n    bool m_IsSlotTableFrozen;\n#endif\n\n#ifdef MEASURE_GCINFO\n    GcInfoSize m_CurrentMethodSize;\n#endif\n};\n\n#endif // !__GCINFOENCODER_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcinfotypes.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef __GCINFOTYPES_H__\n#define __GCINFOTYPES_H__\n\n#ifndef FEATURE_NATIVEAOT\n#include \"gcinfo.h\"\n#endif\n\n// *****************************************************************************\n// WARNING!!!: These values and code are also used by SOS in the diagnostics\n// repo. Should updated in a backwards and forwards compatible way.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfotypes.h\n// *****************************************************************************\n\n#define PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED\n\n#define FIXED_STACK_PARAMETER_SCRATCH_AREA\n\n\n#define BITS_PER_SIZE_T ((int)sizeof(size_t)*8)\n\n\n//--------------------------------------------------------------------------------\n// It turns out, that ((size_t)x) << y == x, when y is not a literal\n//      and its value is BITS_PER_SIZE_T\n// I guess the processor only shifts of the right operand modulo BITS_PER_SIZE_T\n// In many cases, we want the above operation to yield 0,\n//      hence the following macros\n//--------------------------------------------------------------------------------\n__forceinline size_t SAFE_SHIFT_LEFT(size_t x, size_t count)\n{\n    _ASSERTE(count <= BITS_PER_SIZE_T);\n    return (x << 1) << (count - 1);\n}\n__forceinline size_t SAFE_SHIFT_RIGHT(size_t x, size_t count)\n{\n    _ASSERTE(count <= BITS_PER_SIZE_T);\n    return (x >> 1) >> (count - 1);\n}\n\ninline UINT32 CeilOfLog2(size_t x)\n{\n    _ASSERTE(x > 0);\n    UINT32 result = (x & (x - 1)) ? 1 : 0;\n    while (x != 1)\n    {\n        result++;\n        x >>= 1;\n    }\n    return result;\n}\n\nenum GcSlotFlags\n{\n    GC_SLOT_BASE      = 0x0,\n    GC_SLOT_INTERIOR  = 0x1,\n    GC_SLOT_PINNED    = 0x2,\n    GC_SLOT_UNTRACKED = 0x4,\n\n    // For internal use by the encoder/decoder\n    GC_SLOT_IS_REGISTER = 0x8,\n    GC_SLOT_IS_DELETED  = 0x10,\n};\n\nenum GcStackSlotBase\n{\n    GC_CALLER_SP_REL = 0x0,\n    GC_SP_REL        = 0x1,\n    GC_FRAMEREG_REL  = 0x2,\n\n    GC_SPBASE_FIRST  = GC_CALLER_SP_REL,\n    GC_SPBASE_LAST   = GC_FRAMEREG_REL,\n};\n\n#ifdef _DEBUG\nconst char* const GcStackSlotBaseNames[] =\n{\n    \"caller.sp\",\n    \"sp\",\n    \"frame\",\n};\n#endif\n\nenum GcSlotState\n{\n    GC_SLOT_DEAD = 0x0,\n    GC_SLOT_LIVE = 0x1,\n};\n\nstruct GcStackSlot\n{\n    INT32 SpOffset;\n    GcStackSlotBase Base;\n\n    bool operator==(const GcStackSlot& other)\n    {\n        return ((SpOffset == other.SpOffset) && (Base == other.Base));\n    }\n    bool operator!=(const GcStackSlot& other)\n    {\n        return ((SpOffset != other.SpOffset) || (Base != other.Base));\n    }\n};\n\n//--------------------------------------------------------------------------------\n// ReturnKind -- encoding return type information in GcInfo\n//\n// When a method is stopped at a call - site for GC (ex: via return-address\n// hijacking) the runtime needs to know whether the value is a GC - value\n// (gc - pointer or gc - pointers stored in an aggregate).\n// It needs this information so that mark - phase can preserve the gc-pointers\n// being returned.\n//\n// The Runtime doesn't need the precise return-type of a method.\n// It only needs to find the GC-pointers in the return value.\n// The only scenarios currently supported by CoreCLR are:\n// 1. Object references\n// 2. ByRef pointers\n// 3. ARM64/X64 only : Structs returned in two registers\n// 4. X86 only : Floating point returns to perform the correct save/restore\n//    of the return value around return-hijacking.\n//\n// Based on these cases, the legal set of ReturnKind enumerations are specified\n// for each architecture/encoding.\n// A value of this enumeration is stored in the GcInfo header.\n//\n//--------------------------------------------------------------------------------\n\n// RT_Unset: An intermediate step for staged bringup.\n// When ReturnKind is RT_Unset, it means that the JIT did not set\n// the ReturnKind in the GCInfo, and therefore the VM cannot rely on it,\n// and must use other mechanisms (similar to GcInfo ver 1) to determine\n// the Return type's GC information.\n//\n// RT_Unset is only used in the following situations:\n// X64: Used by JIT64 until updated to use GcInfo v2 API\n// ARM: Used by JIT32 until updated to use GcInfo v2 API\n//\n// RT_Unset should have a valid encoding, whose bits are actually stored in the image.\n// For X86, there are no free bits, and there's no RT_Unused enumeration.\n\n#if defined(TARGET_X86)\n\n// 00    RT_Scalar\n// 01    RT_Object\n// 10    RT_ByRef\n// 11    RT_Float\n\n#elif defined(TARGET_ARM)\n\n// 00    RT_Scalar\n// 01    RT_Object\n// 10    RT_ByRef\n// 11    RT_Unset\n\n#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64)\n\n// Slim Header:\n\n// 00    RT_Scalar\n// 01    RT_Object\n// 10    RT_ByRef\n// 11    RT_Unset\n\n// Fat Header:\n\n// 0000  RT_Scalar\n// 0001  RT_Object\n// 0010  RT_ByRef\n// 0011  RT_Unset\n// 0100  RT_Scalar_Obj\n// 1000  RT_Scalar_ByRef\n// 0101  RT_Obj_Obj\n// 1001  RT_Obj_ByRef\n// 0110  RT_ByRef_Obj\n// 1010  RT_ByRef_ByRef\n\n#else\n#ifdef PORTABILITY_WARNING\nPORTABILITY_WARNING(\"Need ReturnKind for new Platform\")\n#endif // PORTABILITY_WARNING\n#endif // Target checks\n\nenum ReturnKind {\n\n    // Cases for Return in one register\n\n    RT_Scalar = 0,\n    RT_Object = 1,\n    RT_ByRef = 2,\n\n#ifdef TARGET_X86\n    RT_Float = 3,       // Encoding 3 means RT_Float on X86\n#else\n    RT_Unset = 3,       // RT_Unset on other platforms\n#endif // TARGET_X86\n\n    // Cases for Struct Return in two registers\n    //\n    // We have the following equivalencies, because the VM's behavior is the same\n    // for both cases:\n    // RT_Scalar_Scalar == RT_Scalar\n    // RT_Obj_Scalar    == RT_Object\n    // RT_ByRef_Scalar  == RT_Byref\n    // The encoding for these equivalencies will play out well because\n    // RT_Scalar is zero.\n    //\n    // Naming: RT_firstReg_secondReg\n    // Encoding: <Two bits for secondRef> <Two bits for first Reg>\n    //\n    // This encoding with exclusive bits for each register is chosen for ease of use,\n    // and because it doesn't cost any more bits.\n    // It can be changed (ex: to a linear sequence) if necessary.\n    // For example, we can encode the GC-information for the two registers in 3 bits (instead of 4)\n    // if we approximate RT_Obj_ByRef and RT_ByRef_Obj as RT_ByRef_ByRef.\n\n    // RT_Scalar_Scalar = RT_Scalar\n    RT_Scalar_Obj   = RT_Object << 2 | RT_Scalar,\n    RT_Scalar_ByRef = RT_ByRef << 2  | RT_Scalar,\n\n    // RT_Obj_Scalar   = RT_Object\n    RT_Obj_Obj      = RT_Object << 2 | RT_Object,\n    RT_Obj_ByRef    = RT_ByRef << 2  | RT_Object,\n\n    // RT_ByRef_Scalar  = RT_Byref\n    RT_ByRef_Obj    = RT_Object << 2 | RT_ByRef,\n    RT_ByRef_ByRef  = RT_ByRef << 2  | RT_ByRef,\n\n    // Illegal or uninitialized value,\n    // Not a valid encoding, never written to image.\n    RT_Illegal = 0xFF\n};\n\n// Identify ReturnKinds containing useful information\ninline bool IsValidReturnKind(ReturnKind returnKind)\n{\n    return (returnKind != RT_Illegal)\n#ifndef TARGET_X86\n        && (returnKind != RT_Unset)\n#endif // TARGET_X86\n        ;\n}\n\n// Identify ReturnKinds that can be a part of a multi-reg struct return\ninline bool IsValidFieldReturnKind(ReturnKind returnKind)\n{\n    return (returnKind == RT_Scalar || returnKind == RT_Object || returnKind == RT_ByRef);\n}\n\ninline bool IsPointerFieldReturnKind(ReturnKind returnKind)\n{\n    _ASSERTE(IsValidFieldReturnKind(returnKind));\n    return (returnKind == RT_Object || returnKind == RT_ByRef);\n}\n\ninline bool IsValidReturnRegister(size_t regNo)\n{\n    return (regNo == 0)\n#ifdef FEATURE_MULTIREG_RETURN\n        || (regNo == 1)\n#endif // FEATURE_MULTIREG_RETURN\n        ;\n}\n\ninline bool IsStructReturnKind(ReturnKind returnKind)\n{\n    // Two bits encode integer/ref/float return-kinds.\n    // Encodings needing more than two bits are (non-scalar) struct-returns.\n    return returnKind > 3;\n}\n\ninline bool IsScalarReturnKind(ReturnKind returnKind)\n{\n    return (returnKind == RT_Scalar)\n#ifdef TARGET_X86\n        || (returnKind == RT_Float)\n#endif // TARGET_X86\n        ;\n}\n\ninline bool IsPointerReturnKind(ReturnKind returnKind)\n{\n    return IsValidReturnKind(returnKind) && !IsScalarReturnKind(returnKind);\n}\n\n// Helpers for combining/extracting individual ReturnKinds from/to Struct ReturnKinds.\n// Encoding is two bits per register\n\ninline ReturnKind GetStructReturnKind(ReturnKind reg0, ReturnKind reg1)\n{\n    _ASSERTE(IsValidFieldReturnKind(reg0) && IsValidFieldReturnKind(reg1));\n\n    ReturnKind structReturnKind = (ReturnKind)(reg1 << 2 | reg0);\n\n    _ASSERTE(IsValidReturnKind(structReturnKind));\n\n    return structReturnKind;\n}\n\n// Extract returnKind for the specified return register.\n// Also determines if higher ordinal return registers contain object references\ninline ReturnKind ExtractRegReturnKind(ReturnKind returnKind, size_t returnRegOrdinal, bool& moreRegs)\n{\n    _ASSERTE(IsValidReturnKind(returnKind));\n    _ASSERTE(IsValidReturnRegister(returnRegOrdinal));\n\n    // Return kind of each return register is encoded in two bits at returnRegOrdinal*2 position from LSB\n    ReturnKind regReturnKind = (ReturnKind)((returnKind >> (returnRegOrdinal * 2)) & 3);\n\n    // Check if any other higher ordinal return registers have object references.\n    // ReturnKind of higher ordinal return registers are encoded at (returnRegOrdinal+1)*2) position from LSB\n    // If all of the remaining bits are 0 then there isn't any more RT_Object or RT_ByRef encoded in returnKind.\n    moreRegs = (returnKind >> ((returnRegOrdinal+1) * 2)) != 0;\n\n    _ASSERTE(IsValidReturnKind(regReturnKind));\n    _ASSERTE((returnRegOrdinal == 0) || IsValidFieldReturnKind(regReturnKind));\n\n    return regReturnKind;\n}\n\ninline const char *ReturnKindToString(ReturnKind returnKind)\n{\n    switch (returnKind) {\n    case RT_Scalar: return \"Scalar\";\n    case RT_Object: return \"Object\";\n    case RT_ByRef:  return \"ByRef\";\n#ifdef TARGET_X86\n    case RT_Float:  return \"Float\";\n#else\n    case RT_Unset:         return \"UNSET\";\n#endif // TARGET_X86\n    case RT_Scalar_Obj:    return \"{Scalar, Object}\";\n    case RT_Scalar_ByRef:  return \"{Scalar, ByRef}\";\n    case RT_Obj_Obj:       return \"{Object, Object}\";\n    case RT_Obj_ByRef:     return \"{Object, ByRef}\";\n    case RT_ByRef_Obj:     return \"{ByRef, Object}\";\n    case RT_ByRef_ByRef:   return \"{ByRef, ByRef}\";\n\n    case RT_Illegal:   return \"<Illegal>\";\n    default: return \"!Impossible!\";\n    }\n}\n\n#ifdef TARGET_X86\n\n#include <stdlib.h>     // For memcmp()\n#include \"bitvector.h\"  // for ptrArgTP\n\n#ifndef FASTCALL\n#define FASTCALL __fastcall\n#endif\n\n// we use offsetof to get the offset of a field\n#include <stddef.h> // offsetof\n\nenum infoHdrAdjustConstants {\n    // Constants\n    SET_FRAMESIZE_MAX = 7,\n    SET_ARGCOUNT_MAX = 8,  // Change to 6\n    SET_PROLOGSIZE_MAX = 16,\n    SET_EPILOGSIZE_MAX = 10,  // Change to 6\n    SET_EPILOGCNT_MAX = 4,\n    SET_UNTRACKED_MAX = 3,\n    SET_RET_KIND_MAX = 4,   // 2 bits for ReturnKind\n    ADJ_ENCODING_MAX = 0x7f, // Maximum valid encoding in a byte\n                             // Also used to mask off next bit from each encoding byte.\n    MORE_BYTES_TO_FOLLOW = 0x80 // If the High-bit of a header or adjustment byte\n                               // is set, then there are more adjustments to follow.\n};\n\n//\n// Enum to define codes that are used to incrementally adjust the InfoHdr structure.\n// First set of opcodes\nenum infoHdrAdjust {\n\n    SET_FRAMESIZE = 0,                                            // 0x00\n    SET_ARGCOUNT = SET_FRAMESIZE + SET_FRAMESIZE_MAX + 1,      // 0x08\n    SET_PROLOGSIZE = SET_ARGCOUNT + SET_ARGCOUNT_MAX + 1,      // 0x11\n    SET_EPILOGSIZE = SET_PROLOGSIZE + SET_PROLOGSIZE_MAX + 1,      // 0x22\n    SET_EPILOGCNT = SET_EPILOGSIZE + SET_EPILOGSIZE_MAX + 1,      // 0x2d\n    SET_UNTRACKED = SET_EPILOGCNT + (SET_EPILOGCNT_MAX + 1) * 2, // 0x37\n\n    FIRST_FLIP = SET_UNTRACKED + SET_UNTRACKED_MAX + 1,\n\n    FLIP_EDI_SAVED = FIRST_FLIP, // 0x3b\n    FLIP_ESI_SAVED,           // 0x3c\n    FLIP_EBX_SAVED,           // 0x3d\n    FLIP_EBP_SAVED,           // 0x3e\n    FLIP_EBP_FRAME,           // 0x3f\n    FLIP_INTERRUPTIBLE,       // 0x40\n    FLIP_DOUBLE_ALIGN,        // 0x41\n    FLIP_SECURITY,            // 0x42\n    FLIP_HANDLERS,            // 0x43\n    FLIP_LOCALLOC,            // 0x44\n    FLIP_EDITnCONTINUE,       // 0x45\n    FLIP_VAR_PTR_TABLE_SZ,    // 0x46 Flip whether a table-size exits after the header encoding\n    FFFF_UNTRACKED_CNT,       // 0x47 There is a count (>SET_UNTRACKED_MAX) after the header encoding\n    FLIP_VARARGS,             // 0x48\n    FLIP_PROF_CALLBACKS,      // 0x49\n    FLIP_HAS_GS_COOKIE,       // 0x4A - The offset of the GuardStack cookie follows after the header encoding\n    FLIP_SYNC,                // 0x4B\n    FLIP_HAS_GENERICS_CONTEXT,// 0x4C\n    FLIP_GENERICS_CONTEXT_IS_METHODDESC,// 0x4D\n    FLIP_REV_PINVOKE_FRAME,   // 0x4E\n    NEXT_OPCODE,              // 0x4F -- see next Adjustment enumeration\n    NEXT_FOUR_START = 0x50,\n    NEXT_FOUR_FRAMESIZE = 0x50,\n    NEXT_FOUR_ARGCOUNT = 0x60,\n    NEXT_THREE_PROLOGSIZE = 0x70,\n    NEXT_THREE_EPILOGSIZE = 0x78\n};\n\n// Second set of opcodes, when first code is 0x4F\nenum infoHdrAdjust2 {\n    SET_RETURNKIND = 0,  // 0x00-SET_RET_KIND_MAX Set ReturnKind to value\n};\n\n#define HAS_UNTRACKED               ((unsigned int) -1)\n#define HAS_VARPTR                  ((unsigned int) -1)\n\n// 0 is a valid offset for the Reverse P/Invoke block\n// So use -1 as the sentinel for invalid and -2 as the sentinel for present.\n#define INVALID_REV_PINVOKE_OFFSET   ((unsigned int) -1)\n#define HAS_REV_PINVOKE_FRAME_OFFSET ((unsigned int) -2)\n// 0 is not a valid offset for EBP-frames as all locals are at a negative offset\n// For ESP frames, the cookie is above (at a higher address than) the buffers,\n// and so cannot be at offset 0.\n#define INVALID_GS_COOKIE_OFFSET    0\n// Temporary value to indicate that the offset needs to be read after the header\n#define HAS_GS_COOKIE_OFFSET        ((unsigned int) -1)\n\n// 0 is not a valid sync offset\n#define INVALID_SYNC_OFFSET         0\n// Temporary value to indicate that the offset needs to be read after the header\n#define HAS_SYNC_OFFSET             ((unsigned int) -1)\n\n#define INVALID_ARGTAB_OFFSET       0\n\n#include <pshpack1.h>\n\n// Working set optimization: saving 12 * 128 = 1536 bytes in infoHdrShortcut\nstruct InfoHdr;\n\nstruct InfoHdrSmall {\n    unsigned char  prologSize;        // 0\n    unsigned char  epilogSize;        // 1\n    unsigned char  epilogCount : 3; // 2 [0:2]\n    unsigned char  epilogAtEnd : 1; // 2 [3]\n    unsigned char  ediSaved : 1; // 2 [4]      which callee-saved regs are pushed onto stack\n    unsigned char  esiSaved : 1; // 2 [5]\n    unsigned char  ebxSaved : 1; // 2 [6]\n    unsigned char  ebpSaved : 1; // 2 [7]\n    unsigned char  ebpFrame : 1; // 3 [0]      locals accessed relative to ebp\n    unsigned char  interruptible : 1; // 3 [1]      is intr. at all points (except prolog/epilog), not just call-sites\n    unsigned char  doubleAlign : 1; // 3 [2]      uses double-aligned stack (ebpFrame will be false)\n    unsigned char  security : 1; // 3 [3]      has slot for security object\n    unsigned char  handlers : 1; // 3 [4]      has callable handlers\n    unsigned char  localloc : 1; // 3 [5]      uses localloc\n    unsigned char  editNcontinue : 1; // 3 [6]      was JITed in EnC mode\n    unsigned char  varargs : 1; // 3 [7]      function uses varargs calling convention\n    unsigned char  profCallbacks : 1; // 4 [0]\n    unsigned char  genericsContext : 1;//4 [1]      function reports a generics context parameter is present\n    unsigned char  genericsContextIsMethodDesc : 1;//4[2]\n    unsigned char  returnKind : 2; // 4 [4]  Available GcInfo v2 onwards, previously undefined\n    unsigned short argCount;          // 5,6        in bytes\n    unsigned int   frameSize;         // 7,8,9,10   in bytes\n    unsigned int   untrackedCnt;      // 11,12,13,14\n    unsigned int   varPtrTableSize;   // 15.16,17,18\n\n                                      // Checks whether \"this\" is compatible with \"target\".\n                                      // It is not an exact bit match as \"this\" could have some\n                                      // marker/place-holder values, which will have to be written out\n                                      // after the header.\n\n    bool isHeaderMatch(const InfoHdr& target) const;\n};\n\n\nstruct InfoHdr : public InfoHdrSmall {\n    // 0 (zero) means that there is no GuardStack cookie\n    // The cookie is either at ESP+gsCookieOffset or EBP-gsCookieOffset\n    unsigned int   gsCookieOffset;    // 19,20,21,22\n    unsigned int   syncStartOffset;   // 23,24,25,26\n    unsigned int   syncEndOffset;     // 27,28,29,30\n    unsigned int   revPInvokeOffset;  // 31,32,33,34 Available GcInfo v2 onwards, previously undefined\n                                      // 35 bytes total\n\n                                      // Checks whether \"this\" is compatible with \"target\".\n                                      // It is not an exact bit match as \"this\" could have some\n                                      // marker/place-holder values, which will have to be written out\n                                      // after the header.\n\n    bool isHeaderMatch(const InfoHdr& target) const\n    {\n#ifdef _ASSERTE\n        // target cannot have place-holder values.\n        _ASSERTE(target.untrackedCnt != HAS_UNTRACKED &&\n            target.varPtrTableSize != HAS_VARPTR &&\n            target.gsCookieOffset != HAS_GS_COOKIE_OFFSET &&\n            target.syncStartOffset != HAS_SYNC_OFFSET &&\n            target.revPInvokeOffset != HAS_REV_PINVOKE_FRAME_OFFSET);\n#endif\n\n        // compare two InfoHdr's up to but not including the untrackCnt field\n        if (memcmp(this, &target, offsetof(InfoHdr, untrackedCnt)) != 0)\n            return false;\n\n        if (untrackedCnt != target.untrackedCnt) {\n            if (target.untrackedCnt <= SET_UNTRACKED_MAX)\n                return false;\n            else if (untrackedCnt != HAS_UNTRACKED)\n                return false;\n        }\n\n        if (varPtrTableSize != target.varPtrTableSize) {\n            if ((varPtrTableSize != 0) != (target.varPtrTableSize != 0))\n                return false;\n        }\n\n        if ((gsCookieOffset == INVALID_GS_COOKIE_OFFSET) !=\n            (target.gsCookieOffset == INVALID_GS_COOKIE_OFFSET))\n            return false;\n\n        if ((syncStartOffset == INVALID_SYNC_OFFSET) !=\n            (target.syncStartOffset == INVALID_SYNC_OFFSET))\n            return false;\n\n        if ((revPInvokeOffset == INVALID_REV_PINVOKE_OFFSET) !=\n            (target.revPInvokeOffset == INVALID_REV_PINVOKE_OFFSET))\n            return false;\n\n        return true;\n    }\n};\n\n\nunion CallPattern {\n    struct {\n        unsigned char argCnt;\n        unsigned char regMask;  // EBP=0x8, EBX=0x4, ESI=0x2, EDI=0x1\n        unsigned char argMask;\n        unsigned char codeDelta;\n    }            fld;\n    unsigned     val;\n};\n\n#include <poppack.h>\n\n#define IH_MAX_PROLOG_SIZE (51)\n\nextern const InfoHdrSmall infoHdrShortcut[];\nextern int                infoHdrLookup[];\n\ninline void GetInfoHdr(int index, InfoHdr * header)\n{\n    *((InfoHdrSmall *)header) = infoHdrShortcut[index];\n\n    header->gsCookieOffset = INVALID_GS_COOKIE_OFFSET;\n    header->syncStartOffset = INVALID_SYNC_OFFSET;\n    header->syncEndOffset = INVALID_SYNC_OFFSET;\n    header->revPInvokeOffset = INVALID_REV_PINVOKE_OFFSET;\n}\n\nPTR_CBYTE FASTCALL decodeHeader(PTR_CBYTE table, UINT32 version, InfoHdr* header);\n\nBYTE FASTCALL encodeHeaderFirst(const InfoHdr& header, InfoHdr* state, int* more, int *pCached);\nBYTE FASTCALL encodeHeaderNext(const InfoHdr& header, InfoHdr* state, BYTE &codeSet);\n\nsize_t FASTCALL decodeUnsigned(PTR_CBYTE src, unsigned* value);\nsize_t FASTCALL decodeUDelta(PTR_CBYTE src, unsigned* value, unsigned lastValue);\nsize_t FASTCALL decodeSigned(PTR_CBYTE src, int     * value);\n\n#define CP_MAX_CODE_DELTA  (0x23)\n#define CP_MAX_ARG_CNT     (0x02)\n#define CP_MAX_ARG_MASK    (0x00)\n\nextern const unsigned callPatternTable[];\nextern const unsigned callCommonDelta[];\n\n\nint  FASTCALL lookupCallPattern(unsigned    argCnt,\n    unsigned    regMask,\n    unsigned    argMask,\n    unsigned    codeDelta);\n\nvoid FASTCALL decodeCallPattern(int         pattern,\n    unsigned *  argCnt,\n    unsigned *  regMask,\n    unsigned *  argMask,\n    unsigned *  codeDelta);\n\n#endif // _TARGET_86_\n\n// Stack offsets must be 8-byte aligned, so we use this unaligned\n//  offset to represent that the method doesn't have a security object\n#define NO_GS_COOKIE              (-1)\n#define NO_STACK_BASE_REGISTER    (0xffffffff)\n#define NO_SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA (0xffffffff)\n#define NO_GENERICS_INST_CONTEXT  (-1)\n#define NO_REVERSE_PINVOKE_FRAME  (-1)\n#define NO_PSP_SYM                (-1)\n\n#if defined(TARGET_AMD64)\n\n#ifndef TARGET_POINTER_SIZE\n#define TARGET_POINTER_SIZE 8    // equal to sizeof(void*) and the managed pointer size in bytes for this target\n#endif\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK (64)\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK_LOG2 (6)\n#define NORMALIZE_STACK_SLOT(x) ((x)>>3)\n#define DENORMALIZE_STACK_SLOT(x) ((x)<<3)\n#define NORMALIZE_CODE_LENGTH(x) (x)\n#define DENORMALIZE_CODE_LENGTH(x) (x)\n// Encode RBP as 0\n#define NORMALIZE_STACK_BASE_REGISTER(x) ((x) ^ 5)\n#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x) ^ 5)\n#define NORMALIZE_SIZE_OF_STACK_AREA(x) ((x)>>3)\n#define DENORMALIZE_SIZE_OF_STACK_AREA(x) ((x)<<3)\n#define CODE_OFFSETS_NEED_NORMALIZATION 0\n#define NORMALIZE_CODE_OFFSET(x) (x)\n#define DENORMALIZE_CODE_OFFSET(x) (x)\n#define NORMALIZE_REGISTER(x) (x)\n#define DENORMALIZE_REGISTER(x) (x)\n#define NORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define DENORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define NORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n#define DENORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n\n#define PSP_SYM_STACK_SLOT_ENCBASE 6\n#define GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE 6\n#define SECURITY_OBJECT_STACK_SLOT_ENCBASE 6\n#define GS_COOKIE_STACK_SLOT_ENCBASE 6\n#define CODE_LENGTH_ENCBASE 8\n#define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2\n#define SIZE_OF_RETURN_KIND_IN_FAT_HEADER  4\n#define STACK_BASE_REGISTER_ENCBASE 3\n#define SIZE_OF_STACK_AREA_ENCBASE 3\n#define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 4\n#define REVERSE_PINVOKE_FRAME_ENCBASE 6\n#define NUM_REGISTERS_ENCBASE 2\n#define NUM_STACK_SLOTS_ENCBASE 2\n#define NUM_UNTRACKED_SLOTS_ENCBASE 1\n#define NORM_PROLOG_SIZE_ENCBASE 5\n#define NORM_EPILOG_SIZE_ENCBASE 3\n#define NORM_CODE_OFFSET_DELTA_ENCBASE 3\n#define INTERRUPTIBLE_RANGE_DELTA1_ENCBASE 6\n#define INTERRUPTIBLE_RANGE_DELTA2_ENCBASE 6\n#define REGISTER_ENCBASE 3\n#define REGISTER_DELTA_ENCBASE 2\n#define STACK_SLOT_ENCBASE 6\n#define STACK_SLOT_DELTA_ENCBASE 4\n#define NUM_SAFE_POINTS_ENCBASE 2\n#define NUM_INTERRUPTIBLE_RANGES_ENCBASE 1\n#define NUM_EH_CLAUSES_ENCBASE 2\n#define POINTER_SIZE_ENCBASE 3\n#define LIVESTATE_RLE_RUN_ENCBASE 2\n#define LIVESTATE_RLE_SKIP_ENCBASE 4\n\n#elif defined(TARGET_ARM)\n\n#ifndef TARGET_POINTER_SIZE\n#define TARGET_POINTER_SIZE 4   // equal to sizeof(void*) and the managed pointer size in bytes for this target\n#endif\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK (64)\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK_LOG2 (6)\n#define NORMALIZE_STACK_SLOT(x) ((x)>>2)\n#define DENORMALIZE_STACK_SLOT(x) ((x)<<2)\n#define NORMALIZE_CODE_LENGTH(x) ((x)>>1)\n#define DENORMALIZE_CODE_LENGTH(x) ((x)<<1)\n// Encode R11 as zero\n#define NORMALIZE_STACK_BASE_REGISTER(x) ((((x) - 4) & 7) ^ 7)\n#define DENORMALIZE_STACK_BASE_REGISTER(x) (((x) ^ 7) + 4)\n#define NORMALIZE_SIZE_OF_STACK_AREA(x) ((x)>>2)\n#define DENORMALIZE_SIZE_OF_STACK_AREA(x) ((x)<<2)\n#define CODE_OFFSETS_NEED_NORMALIZATION 1\n#define NORMALIZE_CODE_OFFSET(x) (x)   // Instructions are 2/4 bytes long in Thumb/ARM states,\n#define DENORMALIZE_CODE_OFFSET(x) (x) // but the safe-point offsets are encoded with a -1 adjustment.\n#define NORMALIZE_REGISTER(x) (x)\n#define DENORMALIZE_REGISTER(x) (x)\n#define NORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define DENORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define NORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n#define DENORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n\n// The choices of these encoding bases only affects space overhead\n// and performance, not semantics/correctness.\n#define PSP_SYM_STACK_SLOT_ENCBASE 5\n#define GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE 5\n#define SECURITY_OBJECT_STACK_SLOT_ENCBASE 5\n#define GS_COOKIE_STACK_SLOT_ENCBASE 5\n#define CODE_LENGTH_ENCBASE 7\n#define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2\n#define SIZE_OF_RETURN_KIND_IN_FAT_HEADER  2\n#define STACK_BASE_REGISTER_ENCBASE 1\n#define SIZE_OF_STACK_AREA_ENCBASE 3\n#define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 3\n#define REVERSE_PINVOKE_FRAME_ENCBASE 5\n#define NUM_REGISTERS_ENCBASE 2\n#define NUM_STACK_SLOTS_ENCBASE 3\n#define NUM_UNTRACKED_SLOTS_ENCBASE 3\n#define NORM_PROLOG_SIZE_ENCBASE 5\n#define NORM_EPILOG_SIZE_ENCBASE 3\n#define NORM_CODE_OFFSET_DELTA_ENCBASE 3\n#define INTERRUPTIBLE_RANGE_DELTA1_ENCBASE 4\n#define INTERRUPTIBLE_RANGE_DELTA2_ENCBASE 6\n#define REGISTER_ENCBASE 2\n#define REGISTER_DELTA_ENCBASE 1\n#define STACK_SLOT_ENCBASE 6\n#define STACK_SLOT_DELTA_ENCBASE 4\n#define NUM_SAFE_POINTS_ENCBASE 3\n#define NUM_INTERRUPTIBLE_RANGES_ENCBASE 2\n#define NUM_EH_CLAUSES_ENCBASE 3\n#define POINTER_SIZE_ENCBASE 3\n#define LIVESTATE_RLE_RUN_ENCBASE 2\n#define LIVESTATE_RLE_SKIP_ENCBASE 4\n\n#elif defined(TARGET_ARM64)\n\n#ifndef TARGET_POINTER_SIZE\n#define TARGET_POINTER_SIZE 8    // equal to sizeof(void*) and the managed pointer size in bytes for this target\n#endif\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK (64)\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK_LOG2 (6)\n#define NORMALIZE_STACK_SLOT(x) ((x)>>3)   // GC Pointers are 8-bytes aligned\n#define DENORMALIZE_STACK_SLOT(x) ((x)<<3)\n#define NORMALIZE_CODE_LENGTH(x) ((x)>>2)   // All Instructions are 4 bytes long\n#define DENORMALIZE_CODE_LENGTH(x) ((x)<<2)\n#define NORMALIZE_STACK_BASE_REGISTER(x) ((x)^29) // Encode Frame pointer X29 as zero\n#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x)^29)\n#define NORMALIZE_SIZE_OF_STACK_AREA(x) ((x)>>3)\n#define DENORMALIZE_SIZE_OF_STACK_AREA(x) ((x)<<3)\n#define CODE_OFFSETS_NEED_NORMALIZATION 0\n#define NORMALIZE_CODE_OFFSET(x) (x)   // Instructions are 4 bytes long, but the safe-point\n#define DENORMALIZE_CODE_OFFSET(x) (x) // offsets are encoded with a -1 adjustment.\n#define NORMALIZE_REGISTER(x) (x)\n#define DENORMALIZE_REGISTER(x) (x)\n#define NORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define DENORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define NORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n#define DENORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n\n#define PSP_SYM_STACK_SLOT_ENCBASE 6\n#define GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE 6\n#define SECURITY_OBJECT_STACK_SLOT_ENCBASE 6\n#define GS_COOKIE_STACK_SLOT_ENCBASE 6\n#define CODE_LENGTH_ENCBASE 8\n#define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2\n#define SIZE_OF_RETURN_KIND_IN_FAT_HEADER  4\n#define STACK_BASE_REGISTER_ENCBASE 2 // FP encoded as 0, SP as 2.\n#define SIZE_OF_STACK_AREA_ENCBASE 3\n#define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 4\n#define SIZE_OF_EDIT_AND_CONTINUE_FIXED_STACK_FRAME_ENCBASE 4\n#define REVERSE_PINVOKE_FRAME_ENCBASE 6\n#define NUM_REGISTERS_ENCBASE 3\n#define NUM_STACK_SLOTS_ENCBASE 2\n#define NUM_UNTRACKED_SLOTS_ENCBASE 1\n#define NORM_PROLOG_SIZE_ENCBASE 5\n#define NORM_EPILOG_SIZE_ENCBASE 3\n#define NORM_CODE_OFFSET_DELTA_ENCBASE 3\n#define INTERRUPTIBLE_RANGE_DELTA1_ENCBASE 6\n#define INTERRUPTIBLE_RANGE_DELTA2_ENCBASE 6\n#define REGISTER_ENCBASE 3\n#define REGISTER_DELTA_ENCBASE 2\n#define STACK_SLOT_ENCBASE 6\n#define STACK_SLOT_DELTA_ENCBASE 4\n#define NUM_SAFE_POINTS_ENCBASE 3\n#define NUM_INTERRUPTIBLE_RANGES_ENCBASE 1\n#define NUM_EH_CLAUSES_ENCBASE 2\n#define POINTER_SIZE_ENCBASE 3\n#define LIVESTATE_RLE_RUN_ENCBASE 2\n#define LIVESTATE_RLE_SKIP_ENCBASE 4\n\n#elif defined(TARGET_LOONGARCH64)\n#ifndef TARGET_POINTER_SIZE\n#define TARGET_POINTER_SIZE 8    // equal to sizeof(void*) and the managed pointer size in bytes for this target\n#endif\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK (64)\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK_LOG2 (6)\n#define NORMALIZE_STACK_SLOT(x) ((x)>>3)   // GC Pointers are 8-bytes aligned\n#define DENORMALIZE_STACK_SLOT(x) ((x)<<3)\n#define NORMALIZE_CODE_LENGTH(x) ((x)>>2)   // All Instructions are 4 bytes long\n#define DENORMALIZE_CODE_LENGTH(x) ((x)<<2)\n#define NORMALIZE_STACK_BASE_REGISTER(x) ((x)^22) // Encode Frame pointer fp=$22 as zero\n#define DENORMALIZE_STACK_BASE_REGISTER(x) ((x)^22)\n#define NORMALIZE_SIZE_OF_STACK_AREA(x) ((x)>>3)\n#define DENORMALIZE_SIZE_OF_STACK_AREA(x) ((x)<<3)\n#define CODE_OFFSETS_NEED_NORMALIZATION 0\n#define NORMALIZE_CODE_OFFSET(x) (x)   // Instructions are 4 bytes long, but the safe-point\n#define DENORMALIZE_CODE_OFFSET(x) (x) // offsets are encoded with a -1 adjustment.\n#define NORMALIZE_REGISTER(x) (x)\n#define DENORMALIZE_REGISTER(x) (x)\n#define NORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define DENORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define NORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n#define DENORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n\n#define PSP_SYM_STACK_SLOT_ENCBASE 6\n#define GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE 6\n#define SECURITY_OBJECT_STACK_SLOT_ENCBASE 6\n#define GS_COOKIE_STACK_SLOT_ENCBASE 6\n#define CODE_LENGTH_ENCBASE 8\n#define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2\n#define SIZE_OF_RETURN_KIND_IN_FAT_HEADER  4\n////TODO for LOONGARCH64.\n// FP/SP encoded as 0 or 2 ??\n#define STACK_BASE_REGISTER_ENCBASE 2\n#define SIZE_OF_STACK_AREA_ENCBASE 3\n#define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 4\n#define REVERSE_PINVOKE_FRAME_ENCBASE 6\n#define NUM_REGISTERS_ENCBASE 3\n#define NUM_STACK_SLOTS_ENCBASE 2\n#define NUM_UNTRACKED_SLOTS_ENCBASE 1\n#define NORM_PROLOG_SIZE_ENCBASE 5\n#define NORM_EPILOG_SIZE_ENCBASE 3\n#define NORM_CODE_OFFSET_DELTA_ENCBASE 3\n#define INTERRUPTIBLE_RANGE_DELTA1_ENCBASE 6\n#define INTERRUPTIBLE_RANGE_DELTA2_ENCBASE 6\n#define REGISTER_ENCBASE 3\n#define REGISTER_DELTA_ENCBASE 2\n#define STACK_SLOT_ENCBASE 6\n#define STACK_SLOT_DELTA_ENCBASE 4\n#define NUM_SAFE_POINTS_ENCBASE 3\n#define NUM_INTERRUPTIBLE_RANGES_ENCBASE 1\n#define NUM_EH_CLAUSES_ENCBASE 2\n#define POINTER_SIZE_ENCBASE 3\n#define LIVESTATE_RLE_RUN_ENCBASE 2\n#define LIVESTATE_RLE_SKIP_ENCBASE 4\n\n#else\n\n#ifndef TARGET_X86\n#ifdef PORTABILITY_WARNING\nPORTABILITY_WARNING(\"Please specialize these definitions for your platform!\")\n#endif\n#endif\n\n#ifndef TARGET_POINTER_SIZE\n#define TARGET_POINTER_SIZE 4   // equal to sizeof(void*) and the managed pointer size in bytes for this target\n#endif\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK (64)\n#define NUM_NORM_CODE_OFFSETS_PER_CHUNK_LOG2 (6)\n#define NORMALIZE_STACK_SLOT(x) (x)\n#define DENORMALIZE_STACK_SLOT(x) (x)\n#define NORMALIZE_CODE_LENGTH(x) (x)\n#define DENORMALIZE_CODE_LENGTH(x) (x)\n#define NORMALIZE_STACK_BASE_REGISTER(x) (x)\n#define DENORMALIZE_STACK_BASE_REGISTER(x) (x)\n#define NORMALIZE_SIZE_OF_STACK_AREA(x) (x)\n#define DENORMALIZE_SIZE_OF_STACK_AREA(x) (x)\n#define CODE_OFFSETS_NEED_NORMALIZATION 0\n#define NORMALIZE_CODE_OFFSET(x) (x)\n#define DENORMALIZE_CODE_OFFSET(x) (x)\n#define NORMALIZE_REGISTER(x) (x)\n#define DENORMALIZE_REGISTER(x) (x)\n#define NORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define DENORMALIZE_NUM_SAFE_POINTS(x) (x)\n#define NORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n#define DENORMALIZE_NUM_INTERRUPTIBLE_RANGES(x) (x)\n\n#define PSP_SYM_STACK_SLOT_ENCBASE 6\n#define GENERICS_INST_CONTEXT_STACK_SLOT_ENCBASE 6\n#define SECURITY_OBJECT_STACK_SLOT_ENCBASE 6\n#define GS_COOKIE_STACK_SLOT_ENCBASE 6\n#define CODE_LENGTH_ENCBASE 6\n#define SIZE_OF_RETURN_KIND_IN_SLIM_HEADER 2\n#define SIZE_OF_RETURN_KIND_IN_FAT_HEADER  2\n#define STACK_BASE_REGISTER_ENCBASE 3\n#define SIZE_OF_STACK_AREA_ENCBASE 6\n#define SIZE_OF_EDIT_AND_CONTINUE_PRESERVED_AREA_ENCBASE 3\n#define REVERSE_PINVOKE_FRAME_ENCBASE 6\n#define NUM_REGISTERS_ENCBASE 3\n#define NUM_STACK_SLOTS_ENCBASE 5\n#define NUM_UNTRACKED_SLOTS_ENCBASE 5\n#define NORM_PROLOG_SIZE_ENCBASE 4\n#define NORM_EPILOG_SIZE_ENCBASE 3\n#define NORM_CODE_OFFSET_DELTA_ENCBASE 3\n#define INTERRUPTIBLE_RANGE_DELTA1_ENCBASE 5\n#define INTERRUPTIBLE_RANGE_DELTA2_ENCBASE 5\n#define REGISTER_ENCBASE 3\n#define REGISTER_DELTA_ENCBASE REGISTER_ENCBASE\n#define STACK_SLOT_ENCBASE 6\n#define STACK_SLOT_DELTA_ENCBASE 4\n#define NUM_SAFE_POINTS_ENCBASE 4\n#define NUM_INTERRUPTIBLE_RANGES_ENCBASE 1\n#define NUM_EH_CLAUSES_ENCBASE 2\n#define POINTER_SIZE_ENCBASE 3\n#define LIVESTATE_RLE_RUN_ENCBASE 2\n#define LIVESTATE_RLE_SKIP_ENCBASE 4\n\n#endif\n\n#endif // !__GCINFOTYPES_H__\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcmsg.inl",
    "content": "\n    static const char* gcStartMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"{ =========== BEGINGC %d, (requested generation = %lu, collect_classes = %lu) ==========\\n\";\n    }\n\n    static const char* gcEndMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"========== ENDGC %d (gen = %lu, collect_classes = %lu) ===========}\\n\";\n    }\n\n    static const char* gcRootMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"    GC Root %p RELOCATED %p -> %p  MT = %pT\\n\";\n    }\n\n    static const char* gcRootPromoteMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"    IGCHeap::Promote: Promote GC Root *%p = %p MT = %pT\\n\";\n    }\n\n    static const char* gcPlugMoveMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"GC_HEAP RELOCATING Objects in heap within range [%p %p) by -0x%x bytes\\n\";\n    }\n\n    static const char* gcServerThread0StartMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"%d gc thread waiting...\";\n    }\n\n    static const char* gcServerThreadNStartMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"%d gc thread waiting... Done\";\n    }\n\n    static const char* gcDetailedStartMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"*GC* %d(gen0:%d)(%d)(alloc: %zd)(%s)(%d)\";\n    }\n\n    static const char* gcDetailedEndMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"*EGC* %zd(gen0:%zd)(%zd)(%d)(%s)(%s)(%s)(ml: %d->%d)\";\n    }\n\n    static const char* gcStartMarkMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"---- Mark Phase on heap %d condemning %d ----\";\n    }\n\n    static const char* gcStartPlanMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"---- Plan Phase on heap %d ---- Condemned generation %d, promotion: %d\";\n    }\n\n    static const char* gcStartRelocateMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"---- Relocate phase on heap %d -----\";\n    }\n\n    static const char* gcEndRelocateMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"---- End of Relocate phase on heap %d ----\";\n    }\n\n    static const char* gcStartCompactMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"---- Compact Phase on heap %d: %zx(%zx)----\";\n    }\n\n    static const char* gcEndCompactMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"---- End of Compact phase on heap %d ----\";\n    }\n\n    static const char* gcMemCopyMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \" mc: [%zx->%zx, %zx->%zx[\";\n    }\n\n    static const char* gcPlanPlugMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"(%zx)[%zx->%zx, NA: [%zx(%zd), %zx[: %zx(%d), x: %zx (%s)\";\n    }\n\n    static const char* gcPlanPinnedPlugMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"(%zx)PP: [%zx, %zx[%zx](m:%d)\";\n    }\n\n    static const char* gcDesiredNewAllocationMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"h%d g%d surv: %zd current: %zd alloc: %zd (%d%%) f: %d%% new-size: %zd new-alloc: %zd\";\n    }\n\n    static const char* gcMakeUnusedArrayMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"Making unused array [%zx, %zx[\";\n    }\n\n    static const char* gcStartBgcThread()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"beginning of bgc on heap %d: gen2 FL: %d, FO: %d, frag: %d\";\n    }\n\n    static const char* gcRelocateReferenceMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"Relocating reference *(%p) from %p to %p\";\n    }\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gcrefmap.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef _GCREFMAP_H_\n#define _GCREFMAP_H_\n\n#include \"sigbuilder.h\"\n\n//\n// The GCRef map is used to encode GC type of arguments for callsites. Logically, it is sequence <pos, token> where pos is\n// position of the reference in the stack frame and token is type of GC reference (one of GCREFMAP_XXX values).\n//\n// - The encoding always starts at the byte boundary. The high order bit of each byte is used to signal end of the encoding\n// stream. The last byte has the high order bit zero. It means that there are 7 useful bits in each byte.\n// - \"pos\" is always encoded as delta from previous pos.\n// - The basic encoding unit is two bits. Values 0, 1 and 2 are the common constructs (skip single slot, GC reference, interior\n// pointer). Value 3 means that extended encoding follows.\n// - The extended information is integer encoded in one or more four bit blocks. The high order bit of the four bit block is\n// used to signal the end.\n// - For x86, the encoding starts by size of the callee poped stack. The size is encoded using the same mechanism as above (two bit\n// basic encoding, with extended encoding for large values).\n\n/////////////////////////////////////////////////////////////////////////////////////\n// A utility class to encode sequence of GC summaries for a callsite\n\nclass GCRefMapBuilder\n{\n    int m_PendingByte;  // Pending value, not yet written out\n\n    int m_Bits;         // Number of bits in pending byte. Note that the trailing zero bits are not written out,\n                        // so this can be more than 7.\n\n    int m_Pos;          // Current position\n\n    SigBuilder m_SigBuilder;\n\n    // Append single bit to the stream\n    void AppendBit(int bit)\n    {\n        if (bit != 0)\n        {\n            while (m_Bits >= 7)\n            {\n                m_SigBuilder.AppendByte((BYTE)(m_PendingByte | 0x80));\n                m_PendingByte = 0;\n                m_Bits -= 7;\n            }\n\n            m_PendingByte |= (1 << m_Bits);\n        }\n\n        m_Bits++;\n    }\n\n    void AppendTwoBit(int bits)\n    {\n        AppendBit(bits & 1);\n        AppendBit(bits >> 1);\n    }\n\n    void AppendInt(int val)\n    {\n        do {\n            AppendBit(val & 1);\n            AppendBit((val >> 1) & 1);\n            AppendBit((val >> 2) & 1);\n\n            val >>= 3;\n\n            AppendBit((val != 0) ? 1 : 0);\n        }\n        while (val != 0);\n    }\n\npublic:\n    GCRefMapBuilder()\n        : m_PendingByte(0), m_Bits(0), m_Pos(0)\n    {\n    }\n\n#ifdef TARGET_X86\n    void WriteStackPop(int stackPop)\n    {\n        if (stackPop < 3)\n        {\n            AppendTwoBit(stackPop);\n        }\n        else\n        {\n            AppendTwoBit(3);\n            AppendInt(stackPop - 3);\n        }\n    }\n#endif\n\n    void WriteToken(int pos, int gcRefMapToken)\n    {\n        int posDelta = pos - m_Pos;\n        m_Pos = pos + 1;\n\n        _ASSERTE(posDelta >= 0);\n\n        if (posDelta != 0)\n        {\n            if (posDelta < 4)\n            {\n                // Skipping by one slot at a time for small deltas produces smaller encoding.\n                while (posDelta > 0)\n                {\n                    AppendTwoBit(0);\n                    posDelta--;\n                }\n            }\n            else\n            {\n                AppendTwoBit(3);\n                AppendInt((posDelta - 4) << 1);\n            }\n        }\n\n        if (gcRefMapToken < 3)\n        {\n            AppendTwoBit(gcRefMapToken);\n        }\n        else\n        {\n            AppendTwoBit(3);\n            AppendInt(((gcRefMapToken - 3) << 1) | 1);\n        }\n    }\n\n    void Flush()\n    {\n        if ((m_PendingByte & 0x7F) != 0 || m_Pos == 0)\n            m_SigBuilder.AppendByte((BYTE)(m_PendingByte & 0x7F));\n\n        m_PendingByte = 0;\n        m_Bits = 0;\n\n        m_Pos = 0;\n    }\n\n    PVOID GetBlob(DWORD * pdwLength)\n    {\n        return m_SigBuilder.GetSignature(pdwLength);\n    }\n\n    DWORD GetBlobLength()\n    {\n        return m_SigBuilder.GetSignatureLength();\n    }\n};\n\n/////////////////////////////////////////////////////////////////////////////////////\n// A utility class to decode a GC summary for a callsite\n\nclass GCRefMapDecoder\n{\n    PTR_BYTE m_pCurrentByte;\n    int m_PendingByte;\n    int m_Pos;\n\n    FORCEINLINE int GetBit()\n    {\n        int x = m_PendingByte;\n        if (x & 0x80)\n        {\n            x = *m_pCurrentByte++;\n            x |= ((x & 0x80) << 7);\n        }\n        m_PendingByte = x >> 1;\n        return x & 1;\n    }\n\n    FORCEINLINE int GetTwoBit()\n    {\n        int result = GetBit();\n        result |= GetBit() << 1;\n        return result;\n    }\n\n    int GetInt()\n    {\n        int result = 0;\n\n        int bit = 0;\n        do {\n            result |= GetBit() << (bit++);\n            result |= GetBit() << (bit++);\n            result |= GetBit() << (bit++);\n        }\n        while (GetBit() != 0);\n\n        return result;\n    }\n\npublic:\n    GCRefMapDecoder(PTR_BYTE pBlob)\n        : m_pCurrentByte(pBlob), m_PendingByte(0x80), m_Pos(0)\n    {\n    }\n\n    BOOL AtEnd()\n    {\n        return m_PendingByte == 0;\n    }\n\n#ifdef TARGET_X86\n    UINT ReadStackPop()\n    {\n        int x = GetTwoBit();\n\n        if (x == 3)\n            x = GetInt() + 3;\n\n        return x;\n    }\n#endif\n\n    int CurrentPos()\n    {\n        return m_Pos;\n    }\n\n    int ReadToken()\n    {\n        int val = GetTwoBit();\n        if (val == 3)\n        {\n            int ext = GetInt();\n            if ((ext & 1) == 0)\n            {\n                m_Pos += (ext >> 1) + 4;\n                return GCREFMAP_SKIP;\n            }\n            else\n            {\n                m_Pos++;\n                return (ext >> 1) + 3;\n            }\n        }\n        m_Pos++;\n        return val;\n    }\n};\n\n#endif // _GCREFMAP_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/genheaders.cs",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\nusing System;\nusing System.Xml;\nusing System.Xml.Schema;\nusing System.IO;\n\npublic class GenerateHeaders {\n\n    public static void Main(string[] args) {\n\n        if (args.Length != 3) {\n            Console.WriteLine(\"Usage:genheaders XML-file header-file resource-file\");\n            return;\n        }\n\n        ValidateXML(args[0]);\n        String Message=null;\n        String SymbolicName=null;\n        String NumericValue=null;\n        String tempheaderfile = \"temp.h\";\n        String temprcfile = \"temp.rc\";\n\n        StreamWriter HSW=File.CreateText(tempheaderfile);\n        StreamWriter RSW=File.CreateText(temprcfile);\n\n\tint FaciltyUrt=0x13;\n\tint SeveritySuccess=0;\n\tint SeverityError=1;\n\n\tint minSR = MakeHresult(SeveritySuccess,FaciltyUrt,0);\n        int maxSR = MakeHresult(SeveritySuccess,FaciltyUrt,0xffff);\n\tint minHR = MakeHresult(SeverityError,FaciltyUrt,0);\n\tint maxHR = MakeHresult(SeverityError,FaciltyUrt,0xffff);\n\n        PrintLicenseHeader(HSW);\n        PrintHeader(HSW);\n        PrintLicenseHeader(RSW);\n        PrintResourceHeader(RSW);\n\n        XmlTextReader rdr = new XmlTextReader(args[0]);\n        rdr.WhitespaceHandling = WhitespaceHandling.None;\n\n        while (rdr.Read()) {\n\n            switch (rdr.NodeType) {\n\n                case XmlNodeType.Element:\n\n                    if (rdr.Name.ToString() == \"HRESULT\") {\n                        NumericValue=rdr.GetAttribute(\"NumericValue\");\n                    }\n                    if (rdr.Name.ToString() == \"Message\") {\n                        Message = rdr.ReadString();\n                    }\n                    if (rdr.Name.ToString() == \"SymbolicName\") {\n                        SymbolicName = rdr.ReadString();\n                    }\n\n                    break;\n\n                case XmlNodeType.EndElement:\n                    if(rdr.Name.ToString() == \"HRESULT\"){\n\n\t\t\t// For CLR Hresult's we take the last 4 digits as the resource strings.\n\n\t\t\tif ( (NumericValue.StartsWith(\"0x\")) || (NumericValue.StartsWith(\"0X\")) ) {\n\n\t\t\t    String HexResult = NumericValue.Substring(2);\n\t\t\t    int num = int.Parse(HexResult, System.Globalization.NumberStyles.HexNumber);\n\n\t\t\t    if ((num>minSR) && (num <= maxSR)) {\n\t\t\t\tnum = num & 0xffff;\n\t\t\t\tHSW.WriteLine(\"#define \" + SymbolicName + \" SMAKEHR(0x\" + num.ToString(\"x\") + \")\");\n\t\t\t    } else if ((num>minHR) && (num <= maxHR)) {\n\t\t\t\tnum = num & 0xffff;\n\t\t\t        HSW.WriteLine(\"#define \" + SymbolicName + \" EMAKEHR(0x\" + num.ToString(\"x\") + \")\");\n\t\t\t    } else {\n              \t\t        HSW.WriteLine(\"#define \" + SymbolicName + \" \" + NumericValue );\n                            }\n\n\n\n\t\t\t} else {\n\t                    HSW.WriteLine(\"#define \" + SymbolicName + \" \" + NumericValue );\n\t\t\t}\n\n                        if (Message != null) {\n                            RSW.Write(\"\\tMSG_FOR_URT_HR(\" + SymbolicName + \") \");\n                            RSW.WriteLine(Message);\n                        }\n\n                        SymbolicName = null;\n                        NumericValue = null;\n                        Message = null;\n                    }\n                    break;\n\n            }\n        }\n\n        PrintFooter(HSW);\n        PrintResourceFooter(RSW);\n\n        HSW.Close();\n        RSW.Close();\n\n        bool AreFilesEqual = false;\n\n        if (File.Exists(args[1])) {\n            StreamReader sr1 = new StreamReader(tempheaderfile);\n            StreamReader sr2 = new StreamReader(args[1]);\n            AreFilesEqual = CompareFiles(sr1, sr2);\n            sr1.Close();\n            sr2.Close();\n        }\n\n        if (!AreFilesEqual) {\n            File.Copy(tempheaderfile, args[1], true);\n            File.Copy(temprcfile, args[2], true);\n        }\n\n        if (!File.Exists(args[2])) {\n            File.Copy(temprcfile, args[2], true);\n        }\n\n        File.Delete(tempheaderfile);\n        File.Delete(temprcfile);\n    }\n\n    private static void ValidateXML (String XMLFile) {\n\n        // Set the validation settings on the XmlReaderSettings object.\n        XmlReaderSettings settings = new XmlReaderSettings();\n\n        settings.ValidationType = ValidationType.Schema;\n        settings.ValidationFlags |= XmlSchemaValidationFlags.ProcessInlineSchema;\n\n        settings.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);\n\n        // Create the XmlReader object.\n        XmlReader reader = XmlReader.Create(XMLFile, settings);\n\n        // Parse the file.\n\n        while (reader.Read()) {\n        }\n    }\n\n    // Display any validation errors.\n    private static void ValidationCallBack(object sender, ValidationEventArgs e) {\n    Console.WriteLine(\"Validation Error: {0}\", e.Message);\n    Environment.Exit(-1);\n    }\n\n    private static void PrintLicenseHeader(StreamWriter SW) {\n        SW.WriteLine(\"// Licensed to the .NET Foundation under one or more agreements.\");\n        SW.WriteLine(\"// The .NET Foundation licenses this file to you under the MIT license.\");\n        SW.WriteLine();\n    }\n\n    private static void PrintHeader(StreamWriter SW) {\n\n        SW.WriteLine(\"#ifndef __COMMON_LANGUAGE_RUNTIME_HRESULTS__\");\n        SW.WriteLine(\"#define __COMMON_LANGUAGE_RUNTIME_HRESULTS__\");\n        SW.WriteLine();\n        SW.WriteLine(\"#include <winerror.h>\");\n        SW.WriteLine();\n        SW.WriteLine();\n        SW.WriteLine(\"//\");\n        SW.WriteLine(\"//This file is AutoGenerated -- Do Not Edit by hand!!!\");\n        SW.WriteLine(\"//\");\n        SW.WriteLine(\"//Add new HRESULTS along with their corresponding error messages to\");\n        SW.WriteLine(\"//corerror.xml\");\n        SW.WriteLine(\"//\");\n        SW.WriteLine();\n        SW.WriteLine(\"#ifndef FACILITY_URT\");\n        SW.WriteLine(\"#define FACILITY_URT            0x13\");\n        SW.WriteLine(\"#endif\");\n        SW.WriteLine(\"#ifndef EMAKEHR\");\n        SW.WriteLine(\"#define SMAKEHR(val) MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_URT, val)\");\n        SW.WriteLine(\"#define EMAKEHR(val) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_URT, val)\");\n        SW.WriteLine(\"#endif\");\n        SW.WriteLine();\n    }\n\n    private static void PrintFooter(StreamWriter SW) {\n        SW.WriteLine();\n        SW.WriteLine();\n        SW.WriteLine(\"#endif // __COMMON_LANGUAGE_RUNTIME_HRESULTS__\");\n    }\n\n    private static void PrintResourceHeader(StreamWriter SW) {\n        SW.WriteLine(\"STRINGTABLE DISCARDABLE\");\n        SW.WriteLine(\"BEGIN\");\n    }\n\n    private static void PrintResourceFooter(StreamWriter SW) {\n        SW.WriteLine(\"END\");\n    }\n\n    private static bool CompareFiles(StreamReader sr1, StreamReader sr2) {\n        String line1,line2;\n\n        while (true) {\n            line1 = sr1.ReadLine();\n            line2 = sr2.ReadLine();\n\n            if ( (line1 == null) && (line2 == null) ) {\n                return true;\n            }\n\n            if (line1 != line2) {\n                return false;\n            }\n\n        }\n\n    }\n\n   private static int MakeHresult(int sev, int fac, int code) {\n\t return ((sev<<31) | (fac<<16) | (code));\n   }\n}\n\n\n\n\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/genrops.pl",
    "content": "# Licensed to the .NET Foundation under one or more agreements.\n# The .NET Foundation licenses this file to you under the MIT license.\n#\n# GENREFOPS.PL\n#\n# PERL script used to generate the numbering of the reference opcodes\n#\n#use strict 'vars';\n#use strict 'subs';\n#use strict 'refs';\n\nprint \"Reference opcodes\\n\";\nprint \"This file is presently only for human consumption\\n\";\nprint \"This file is generated from opcode.def using the genrops.pl script\\n\\n\";\nprint \"Name                     String Name              refop    encode\\n\";\nprint \"-----------------------------------------------------------------\\n\";\n\nmy $ret = 0;\nmy %oneByte;\nmy %twoByte;\n$count = 0;\nwhile (<>)\n{\n   # Process only OPDEF(....) lines\n   if (/OPDEF\\(\\s*/)\n   {\n      chop;               # Strip off trailing CR\n       s/^OPDEF\\(\\s*//;    # Strip off \"OP(\"\n       s/\\)$//;            # Strip off \")\" at end\n       s/,\\s*/,/g;         # Remove whitespace\n\n       # Split the line up into its basic parts\n       ($enumname, $stringname, $pop, $push, $operand, $type, $size, $s1, $s2, $ctrl) = split(/,/);\n        $s1 =~ s/0x//;\n        $s1 = hex($s1);\n        $s2 =~ s/0x//;\n        $s2 = hex($s2);\n\n\n        my $line = sprintf(\"%-24s %-24s 0x%03x\",\n                           $enumname, $stringname, $count);\n        if ($size == 1) {\n            $line .=  sprintf(\"    0x%02x\\n\", $s2);\n            if ($oneByte{$s2}) {\n                printf(\"Error opcode 0x%x  already defined!\\n\", $s2);\n                print \"   Old = $oneByte{$s2}\";\n                print \"   New = $line\";\n                $ret = -1;\n                }\n            $oneByte{$s2} = $line;\n            }\n        elsif ($size == 2) {\n            if ($twoByte{$s2}) {\n                printf(\"Error opcode 0x%x 0x%x  already defined!\\n\", $s1, $s2);\n                print \"   Old = $twoByte{$s2}\";\n                print \"   New = $line\";\n                $ret = -1;\n                }\n            $line .= sprintf(\"    0x%02x 0x%02x\\n\", $s1, $s2);\n            $twoByte{$s2 + 256 * $s1} = $line;\n            }\n        else {\n            $line .= \"\\n\";\n            push(@deprecated, $line);\n            }\n        $count++;\n   }\n}\n\nmy $opcode;\nmy $lastOp = -1;\nforeach $opcode (sort {$a <=> $b} keys(%oneByte)) {\n    printf(\"***** GAP %d instrs ****\\n\", $opcode - $lastOp) if ($lastOp + 1 != $opcode && $lastOp > 0);\n    print $oneByte{$opcode};\n    $lastOp = $opcode;\n}\n\n$lastOp = -1;\nforeach $opcode (sort {$a <=> $b} keys(%twoByte)) {\n    printf(\"***** GAP %d instrs ****\\n\", $opcode - $lastOp) if ($lastOp + 1 != $opcode && $lastOp > 0);\n    print $twoByte{$opcode};\n    $lastOp = $opcode;\n}\n\nprint @deprecated;\n\nexit($ret);\n\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/gfunc_list.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// Any global function that should be tracked in the DAC should be provided here\n\n#ifndef DEFINE_DACGFN\n#define DEFINE_DACGFN(func)\n#endif\n#ifndef DEFINE_DACGFN_STATIC\n#define DEFINE_DACGFN_STATIC(class, func)\n#endif\n\nDEFINE_DACGFN(DACNotifyCompilationFinished)\nDEFINE_DACGFN(ThePreStub)\n\n#ifdef TARGET_ARM\nDEFINE_DACGFN(ThePreStubCompactARM)\n#endif\n\nDEFINE_DACGFN(ThePreStubPatchLabel)\n#ifdef FEATURE_COMINTEROP\nDEFINE_DACGFN(Unknown_AddRef)\nDEFINE_DACGFN(Unknown_AddRefSpecial)\nDEFINE_DACGFN(Unknown_AddRefInner)\n#endif\n#ifdef FEATURE_COMWRAPPERS\nDEFINE_DACGFN(ManagedObjectWrapper_QueryInterface)\nDEFINE_DACGFN(TrackerTarget_QueryInterface)\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/guidfromname.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef GUIDFROMNAME_H_\n#define GUIDFROMNAME_H_\n\n// GuidFromName.h - function prototype\n\nvoid CorGuidFromNameW\n(\n    GUID *  pGuidResult,        // resulting GUID\n    LPCWSTR wzName,             // the unicode name from which to generate a GUID\n    SIZE_T  cchName             // name length in count of unicode character.\n                                // -1 if lstrlen(wzName)+1 should be used\n);\n\n#endif // GUIDFROMNAME_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/holder.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef __HOLDER_H_\n#define __HOLDER_H_\n\n#include <wincrypt.h>\n#include \"cor.h\"\n#include \"staticcontract.h\"\n#include \"volatile.h\"\n#include \"palclr.h\"\n\n#ifdef PAL_STDCPP_COMPAT\n#include <utility>\n#include <type_traits>\n#else\n#include \"clr_std/utility\"\n#include \"clr_std/type_traits\"\n#endif\n\n#if defined(FEATURE_COMINTEROP) && !defined(STRIKE)\n#include <Activation.h>\n#include <Inspectable.h>\n#endif\n\n// Note: you can't use CONTRACT's in this file. You can't use dynamic contracts because the impl of dynamic\n// contracts depends on holders. You can't use static contracts because they include the function name as a string,\n// and the template names in this file are just too long, so you get a compiler error.\n//\n// All the functions in this file are pretty basic, so the lack of CONTRACT's isn't a big loss.\n\n#ifdef _MSC_VER\n// Make sure we can recurse deep enough for FORCEINLINE\n#pragma inline_recursion(on)\n#pragma inline_depth(16)\n#pragma warning(disable:4714)\n#endif  // _MSC_VER\n\n//------------------------------------------------------------------------------------------------\n// Declare but do not define methods that would normally be automatically generated by the\n// compiler. This will produce a link-time error if they are used. This is involved in object\n// initialization and operator eliding; see\n// http://groups.google.com/group/comp.lang.c++/msg/3cd673ab749bed83?dmode=source\n// for the intricate details.\n\n#ifdef __GNUC__\n// GCC checks accessibility of the copy ctor before performing elision optimization, so\n// it must be declared as public. VC does not, so we can declare it private to give an\n// earlier error message.\n#define HIDE_GENERATED_METHODS(_NAME)                                                       \\\n    public:                                                                                 \\\n        _NAME(_NAME const &);                                                               \\\n    private:                                                                                \\\n        _NAME & operator=(_NAME const &);\n#else\n#define HIDE_GENERATED_METHODS(_NAME)                                                       \\\n    private:                                                                                \\\n        _NAME(_NAME const &);                                                               \\\n        _NAME & operator=(_NAME const &);\n#endif\n\n#ifdef _DEBUG\n\n//------------------------------------------------------------------------------------------------\n// This is used to make Visual Studio autoexp.dat work sensibly with holders again.\n// The problem is that certain codebases (particulary Fusion) implement key data structures\n// using a class but refer to it using a holder to an interface type. This combination prevents\n// autoexp rules from working as desired.\n//\n// Example: Take this useful autoexp rule for CAssemblyName.\n//\n//   CAssemblyName=<_rProp._rProp[3].asStr>\n//\n// To get the same rule to fire when your assemblyname is wrapped in a ReleaseHolder,\n// add these companion rules.\n//\n//    HolderBase<CAssemblyName *>=<m_value->_rProp._rProp[3].asStr>\n//    HolderBase<IAssemblyName *>=<m_pAutoExpVisibleValue->_asCAssemblyName->_rProp._rProp[3].asStr>\n//\n//------------------------------------------------------------------------------------------------\nstruct AutoExpVisibleValue\n{\n  private:\n    union\n    {\n        const void                                          *_pPreventEmptyUnion;\n    };\n};\n#endif //_DEBUG\n\n//-----------------------------------------------------------------------------\n// Holder is the base class of all holder objects.  Any backout object should derive from it.\n// (Eventually some additional bookkeeping and exception handling code will be placed in this\n// base class.)\n//\n// There are several ways to use this class:\n//  1. Derive from HolderBase, and instantiate a Holder or Wrapper around your base.  This is necessary\n//      if you need to add more state to your holder.\n//  2. Instantiate the Holder template with your type and functions.\n//  3. Instantiate the Wrapper template with your type and functions.  The Wrapper adds some additional\n//      operator overloads to provide \"smart pointer\" like behavior\n//  4. Use a prebaked Holder.  This is ALWAYS the preferable strategy.  It is expected that\n//      the general design patter is that Holders will be provided as part of a typical data abstraction.\n//      (See Crst for an example of this.)\n//-----------------------------------------------------------------------------\n\n\n\n//-----------------------------------------------------------------------------\n// HolderBase defines the base holder functionality. You can subtype and plug in\n// a different base if you need to add more members for access during\n// acquire & release\n//-----------------------------------------------------------------------------\ntemplate <typename TYPE>\nclass HolderBase\n{\n    friend class ClrDataAccess;\n\n  protected:\n    TYPE    m_value;\n\n    HolderBase(TYPE value)\n      : m_value(value)\n    {\n#ifdef _DEBUG\n        m_pAutoExpVisibleValue = (const AutoExpVisibleValue *)(&m_value);\n#endif //_DEBUG\n    }\n\n    void DoAcquire()\n    {\n        // Insert any global or thread bookkeeping here\n    }\n\n    void DoRelease()\n    {\n        // Insert any global or thread bookkeeping here\n    }\n\n#ifdef _DEBUG\n private:\n    // NOT DEAD CODE: This field is not referenced in the source code but it is not a dead field. See comments above \"class AutoExpVisibleValue\" for why this field exists.\n    // Note: What we really want is for m_value and m_pAutoExpVisibleValue to be members of a union. But the compiler won't let you build that\n    //       since it can't prove that \"TYPE\" doesn't have a non-trivial constructor.\n    const AutoExpVisibleValue *m_pAutoExpVisibleValue;  // This field is to be referenced from individual autoexp.dat files, NOT from the CLR source code.\n#endif //_DEBUG\n\n};  // class HolderBase<>\n\n#ifndef _PREFAST_ // Work around an ICE error in EspX.dll\n\ntemplate <typename TYPE>\nBOOL CompareDefault(TYPE value, TYPE defaultValue)\n{\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return value == defaultValue;\n}\n\n#else\n\ntemplate <typename TYPE>\nBOOL CompareDefault(TYPE value, TYPE defaultValue)\n{\n    return FALSE;\n}\n\n#endif\n\n\ntemplate <typename TYPE>\nBOOL NoNull(TYPE value, TYPE defaultValue)\n{\n    return FALSE;\n}\n\n// Used e.g. for retail version of code:SyncAccessHolder\ntemplate <typename TYPE>\nclass NoOpBaseHolder\n{\n  public:\n    FORCEINLINE NoOpBaseHolder()\n    {\n    }\n    FORCEINLINE NoOpBaseHolder(TYPE value, BOOL take = TRUE)\n    {\n    }\n    FORCEINLINE ~NoOpBaseHolder()\n    {\n    }\n    FORCEINLINE void Assign(TYPE value, BOOL fTake = TRUE)\n    {\n    }\n    FORCEINLINE void Acquire()\n    {\n    }\n    FORCEINLINE void Release()\n    {\n    }\n    FORCEINLINE void Clear()\n    {\n    }\n    FORCEINLINE void SuppressRelease()\n    {\n    }\n    FORCEINLINE TYPE Extract()\n    {\n    }\n    FORCEINLINE TYPE GetValue()\n    {\n    }\n    FORCEINLINE BOOL IsNull() const\n    {\n        return FALSE;\n    }\n\n  private:\n    NoOpBaseHolder& operator=(NoOpBaseHolder const &);\n    NoOpBaseHolder(NoOpBaseHolder const &);\n};  // NoOpBaseHolder<>\n\n\ntemplate\n    <\n        typename TYPE,\n        typename BASE,\n        UINT_PTR DEFAULTVALUE = 0,\n        BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>\n    >\nclass BaseHolder : protected BASE\n{\n    friend class ClrDataAccess;\n  protected:\n    BOOL    m_acquired;      // Have we acquired the resource?\n\n    static_assert(!std::is_pointer<TYPE>::value || DEFAULTVALUE == 0 || DEFAULTVALUE == UINT_PTR(-1 /*INVALID_HANDLE_VALUE*/),\n                  \"DEFAULTVALUE must be NULL for pointer holders and wrappers.\");\n\n  public:\n    FORCEINLINE BaseHolder()\n      : BASE(TYPE(DEFAULTVALUE)),\n        m_acquired(FALSE)\n    {\n    }\n    FORCEINLINE BaseHolder(TYPE value)\n      : BASE(value),\n        m_acquired(FALSE)\n    {\n        if (!IsNull())\n            Acquire();\n    }\n    FORCEINLINE BaseHolder(TYPE value, BOOL takeOwnership)\n      : BASE(value),\n        m_acquired(FALSE)\n    {\n        if (takeOwnership)\n            Acquire();\n    }\n    FORCEINLINE ~BaseHolder()\n    {\n        Release();\n    }\n    // Sets the value to 'value'. Doesn't call Acquire if value is DEFAULTVALUE.\n    FORCEINLINE void Assign(TYPE value)\n    {\n        Assign(value, !IS_NULL(value, TYPE(DEFAULTVALUE)));\n    }\n    // Sets the value to 'value'. Doesn't call Acquire if fTake is FALSE.\n    FORCEINLINE void Assign(TYPE value, BOOL takeOwnership)\n    {\n        Release();\n        this->m_value = value;\n        if (takeOwnership)\n            Acquire();\n    }\n    FORCEINLINE void Acquire()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        _ASSERTE(!m_acquired);\n\n        if (!IsNull())\n        {\n            this->DoAcquire();\n            m_acquired = TRUE;\n        }\n    }\n    FORCEINLINE void Release()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        if (m_acquired)\n        {\n            _ASSERTE(!IsNull());\n            this->DoRelease();\n            m_acquired = FALSE;\n        }\n    }\n\n    FORCEINLINE void Clear()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        Assign(TYPE(DEFAULTVALUE), FALSE);\n    }\n    FORCEINLINE void SuppressRelease()\n    {\n        STATIC_CONTRACT_LEAF;\n        m_acquired = FALSE;\n    }\n    FORCEINLINE TYPE Extract()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        SuppressRelease();\n        return GetValue();\n    }\n    FORCEINLINE TYPE GetValue()\n    {\n        STATIC_CONTRACT_LEAF;\n        return this->m_value;\n    }\n    FORCEINLINE BOOL IsNull() const\n    {\n        STATIC_CONTRACT_WRAPPER;\n        return IS_NULL(this->m_value, TYPE(DEFAULTVALUE));\n    }\n\n    HIDE_GENERATED_METHODS(BaseHolder)\n};  // BaseHolder<>\n\ntemplate <void (*ACQUIRE)(), void (*RELEASEF)()>\nclass StateHolder\n{\n  private:\n    BOOL    m_acquired;      // Have we acquired the state?\n\n  public:\n    FORCEINLINE StateHolder(BOOL take = TRUE)\n      : m_acquired(FALSE)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        if (take)\n            Acquire();\n    }\n    FORCEINLINE ~StateHolder()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        Release();\n    }\n    FORCEINLINE void Acquire()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        // Insert any global or thread bookkeeping here\n\n        _ASSERTE(!m_acquired);\n\n        ACQUIRE();\n        m_acquired = TRUE;\n    }\n    FORCEINLINE void Release()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        // Insert any global or thread bookkeeping here\n\n        if (m_acquired)\n        {\n            RELEASEF();\n            m_acquired = FALSE;\n        }\n    }\n    FORCEINLINE void Clear()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        if (m_acquired)\n        {\n            RELEASEF();\n        }\n\n        m_acquired = FALSE;\n    }\n    FORCEINLINE void SuppressRelease()\n    {\n        STATIC_CONTRACT_LEAF;\n        m_acquired = FALSE;\n    }\n\n    HIDE_GENERATED_METHODS(StateHolder)\n};  // class StateHolder<>\n\n// Holder for the case where the acquire function can fail.\ntemplate <typename VALUE, BOOL (*ACQUIRE)(VALUE value), void (*RELEASEF)(VALUE value)>\nclass ConditionalStateHolder\n{\n  private:\n    VALUE   m_value;\n    BOOL    m_acquired;      // Have we acquired the state?\n\n  public:\n    FORCEINLINE ConditionalStateHolder(VALUE value, BOOL take = TRUE)\n      : m_value(value), m_acquired(FALSE)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        if (take)\n            Acquire();\n    }\n    FORCEINLINE ~ConditionalStateHolder()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        Release();\n    }\n    FORCEINLINE BOOL Acquire()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        // Insert any global or thread bookkeeping here\n\n        _ASSERTE(!m_acquired);\n\n        m_acquired = ACQUIRE(m_value);\n\n        return m_acquired;\n    }\n    FORCEINLINE void Release()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        // Insert any global or thread bookkeeping here\n\n        if (m_acquired)\n        {\n            RELEASEF(m_value);\n            m_acquired = FALSE;\n        }\n    }\n    FORCEINLINE void Clear()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        if (m_acquired)\n        {\n            RELEASEF(m_value);\n        }\n\n        m_acquired = FALSE;\n    }\n    FORCEINLINE void SuppressRelease()\n    {\n        STATIC_CONTRACT_LEAF;\n        m_acquired = FALSE;\n    }\n    FORCEINLINE BOOL Acquired()\n    {\n        STATIC_CONTRACT_LEAF;\n\n        return m_acquired;\n    }\n\n    HIDE_GENERATED_METHODS(ConditionalStateHolder)\n};  // class ConditionalStateHolder<>\n\n\n// Making the copy constructor private produces a warning about \"can't generate copy\n// constructor\" on all holders (duh, that's the point.)\n#ifdef _MSC_VER\n#pragma warning(disable:4511)\n#endif  // _MSC_VER\n\n//-----------------------------------------------------------------------------\n// BaseWrapper is just Base like a Holder, but it \"transparently\" proxies the type it contains,\n// using operator overloads.  Use this when you want a holder to expose the functionality of\n// the value it contains.\n//-----------------------------------------------------------------------------\ntemplate <typename TYPE, typename BASE,\n          UINT_PTR DEFAULTVALUE = 0, BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>>\nclass BaseWrapper : public BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL>\n{\n    typedef BaseHolder<TYPE, BASE, DEFAULTVALUE, IS_NULL> BaseT;\n\n\n#ifdef __GNUC__\n//#pragma GCC visibility push(hidden)\n#endif // __GNUC__\n    // This temporary object takes care of the case where we are initializing\n    // a holder's contents by passing it as an out parameter.  The object is\n    // guaranteed to live longer than the call it is passed to, hence we should\n    // properly acquire the object on return\n    friend class AddressInitHolder;\n    class AddressInitHolder\n    {\n      protected:\n        BaseWrapper<TYPE,BASE,DEFAULTVALUE,IS_NULL> &m_holder;\n\n      public:\n        FORCEINLINE AddressInitHolder(BaseWrapper<TYPE,BASE,DEFAULTVALUE,IS_NULL> &holder)\n          : m_holder(holder)\n        {\n            //\n            // We must clear the value, to avoid the following scenario:\n            //\n            //      ReleaseHolder<MyType> pMyType;\n            //      hr = MyFunction(&pMyType, ...);\n            //      <do something with pMyType>\n            //      hr = MyFunction(&pMyType, ...); <- calls Release before call and Acquire on return.\n            //\n            // If the second call to MyFunction were to fail and return without updating the\n            // out parameter, then ~AddressInitHolder will all Acquire, which is a no-op on\n            // the underlying pointer but sets m_acquired to TRUE. Thus, when pMyType goes\n            // out of scope, ReleaseHolder will cause a double-release of pMyType.\n            //\n            // By calling Clear, then the call to Acquire in the dtor will not set m_acquired\n            // to true since IsNull(m_holder.m_value) will return true.\n            //\n            m_holder.Clear();\n        }\n        FORCEINLINE ~AddressInitHolder()\n        {\n            m_holder.Acquire();\n        }\n\n        // It's not optimal to have to declare these casting operators.  But if we don't,\n        // people cannot cast the result of &holder to these values.  (The C++ compiler won't\n        // automatically use the TYPE * cast as an intermediate value.)  So we put them here,\n        // rather than forcing callers to double cast in these common cases.\n\n        FORCEINLINE operator IUnknown **()\n        {\n            IUnknown *unknown;\n            // Typesafe check.  This will fail at compile time if\n            // m_holder.m_value can't be converted to an IUnknown *.\n            unknown = static_cast<IUnknown*>(m_holder.m_value);\n            // do the cast with an unsafe cast\n            return (IUnknown **)(&m_holder.m_value);\n        }\n\n#if defined(FEATURE_COMINTEROP) && !defined(STRIKE)\n        FORCEINLINE operator IInspectable **()\n        {\n            IInspectable *inspectable;\n            // Typesafe check.  This will fail at compile time if\n            // m_holder.m_value can't be converted to an IInspectable *.\n            inspectable = static_cast<IInspectable *>(m_holder.m_value);\n            return (IInspectable **)(&m_holder.m_value);\n\n        }\n#endif // FEATURE_COMINTEROP\n\n        FORCEINLINE operator void **()\n        {\n            return (void **)(&m_holder.m_value);\n        }\n        FORCEINLINE operator void *()\n        {\n            return (void *)(&m_holder.m_value);\n        }\n    };\n\n    // Separate out method with TYPE * cast operator, since it may clash with IUnknown ** or\n    // void ** cast operator.\n    friend class TypedAddressInitHolder;\n    class TypedAddressInitHolder : public AddressInitHolder\n    {\n      public:\n        FORCEINLINE TypedAddressInitHolder(BaseWrapper & holder)\n          : AddressInitHolder(holder)\n        {\n        }\n\n        FORCEINLINE operator TYPE *()\n        {\n            return static_cast<TYPE *>(&this->m_holder.m_value);\n        }\n    };\n#ifdef __GNUC__\n//#pragma GCC visibility pop\n#endif // __GNUC__\n\n  public:\n    FORCEINLINE BaseWrapper()\n        : BaseT(TYPE(DEFAULTVALUE), FALSE)\n    {\n    }\n    FORCEINLINE BaseWrapper(TYPE value)\n        : BaseT(value)\n    {\n    }\n    FORCEINLINE BaseWrapper(TYPE value, BOOL take)\n        : BaseT(value, take)\n    {\n    }\n    FORCEINLINE BaseWrapper& operator=(TYPE value)\n    {\n        BaseT::Assign(value);\n        return *this;\n    }\n    FORCEINLINE operator TYPE() const\n    {\n        return this->m_value;\n    }\n    FORCEINLINE TypedAddressInitHolder operator&()\n    {\n        return TypedAddressInitHolder(*this);\n    }\n    template <typename T>\n    FORCEINLINE bool operator==(T const & value) const\n    {\n        return !!(this->m_value == TYPE(value));\n    }\n    template <typename T>\n    FORCEINLINE bool operator!=(T const & value) const\n    {\n        return !!(this->m_value != TYPE(value));\n    }\n\n    // This handles the NULL value that is an int and the\n    // compiler doesn't want to convert int to a pointer.\n    FORCEINLINE bool operator==(int value) const\n    {\n        return !!(this->m_value == TYPE((void*)(SIZE_T)value));\n    }\n    FORCEINLINE bool operator!=(int value) const\n    {\n        return !!(this->m_value != TYPE((void*)(SIZE_T)value));\n    }\n\n    FORCEINLINE const TYPE &operator->() const\n    {\n        return this->m_value;\n    }\n    FORCEINLINE int operator!() const\n    {\n        return this->IsNull();\n    }\n\n  private:\n    HIDE_GENERATED_METHODS(BaseWrapper)\n};  // class BaseWrapper<>\n\n//-----------------------------------------------------------------------------\n// Generic templates to use to wrap up acquire/release functionality for Holder\n//-----------------------------------------------------------------------------\n\ntemplate <typename TYPE>\nFORCEINLINE void DoNothing(TYPE value)\n{\n    // @TODO: Due to prefast template problems, implementations of the DoNothing macro have been changed\n    // Search by prefast, and remove them when prefast is ready\n}\n\nFORCEINLINE void DoNothing()\n{\n}\n\n// Prefast stuff.We should have DoNothing<type*> in the holder declaration, but currently\n// prefast doesnt support, it, so im stuffing all these here so if we need to change the template you can change\n// everything here. When prefast works, remove the following functions\nstruct ConnectionCookie;\nFORCEINLINE void ConnectionCookieDoNothing(ConnectionCookie* p)\n{\n}\n\nclass ComCallWrapper;\nFORCEINLINE void CCWHolderDoNothing(ComCallWrapper* p)\n{\n}\n\n\nFORCEINLINE void DispParamHolderDoNothing(VARIANT* p)\n{\n}\n\nFORCEINLINE void VariantPtrDoNothing(VARIANT* p)\n{\n}\n\nFORCEINLINE void VariantDoNothing(VARIANT)\n{\n}\n\nFORCEINLINE void ZeroDoNothing(VOID* p)\n{\n}\n\nclass CtxEntry;\nFORCEINLINE void CtxEntryDoNothing(CtxEntry* p)\n{\n}\n\nstruct RCW;\nFORCEINLINE void NewRCWHolderDoNothing(RCW*)\n{\n}\n\n// Prefast stuff.We should have DoNothing<SafeArray*> in the holder declaration\nFORCEINLINE void SafeArrayDoNothing(SAFEARRAY* p)\n{\n}\n\n\n//-----------------------------------------------------------------------------\n// Holder/Wrapper are the simplest way to define holders - they synthesizes a base class out of\n// function pointers\n//-----------------------------------------------------------------------------\n\ntemplate <typename TYPE, void (*ACQUIREF)(TYPE), void (*RELEASEF)(TYPE)>\nclass FunctionBase : protected HolderBase<TYPE>\n{\n    friend class ClrDataAccess;\n  protected:\n\n    FORCEINLINE FunctionBase(TYPE value)\n      : HolderBase<TYPE>(value)\n    {\n    }\n\n    FORCEINLINE void DoAcquire()\n    {\n        ACQUIREF(this->m_value);\n    }\n\n    void DoRelease()\n    {\n        RELEASEF(this->m_value);\n    }\n};  // class Function<>\n\ntemplate\n    <\n        typename TYPE,\n        void (*ACQUIREF)(TYPE),\n        void (*RELEASEF)(TYPE),\n        UINT_PTR DEFAULTVALUE = 0,\n        BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>,\n        // For legacy compat (see EEJitManager::WriterLockHolder), where default ctor\n        // causes ACQUIREF(DEFAULTVALUE), but ACQUIREF ignores the argument and\n        // operates on static or global value instead.\n        bool DEFAULT_CTOR_ACQUIRE = true\n    >\nclass Holder : public BaseHolder<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,\n                                 DEFAULTVALUE, IS_NULL>\n{\n    typedef BaseHolder<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,\n                                 DEFAULTVALUE, IS_NULL> BaseT;\n\n  public:\n    FORCEINLINE Holder()\n        : BaseT(TYPE(DEFAULTVALUE), DEFAULT_CTOR_ACQUIRE)\n    {\n        STATIC_CONTRACT_WRAPPER;\n    }\n\n    FORCEINLINE Holder(TYPE value)\n        : BaseT(value)\n    {\n        STATIC_CONTRACT_WRAPPER;\n    }\n\n    FORCEINLINE Holder(TYPE value, BOOL takeOwnership)\n        : BaseT(value, takeOwnership)\n    {\n        STATIC_CONTRACT_WRAPPER;\n    }\n\n    FORCEINLINE Holder& operator=(TYPE p)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        BaseT::operator=(p);\n        return *this;\n    }\n\n    HIDE_GENERATED_METHODS(Holder)\n};\n\n//---------------------------------------------------------------------------------------\n//\ntemplate\n    <\n        typename TYPE,\n        void (*ACQUIREF)(TYPE),\n        void (*RELEASEF)(TYPE),\n        UINT_PTR DEFAULTVALUE = 0,\n        BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>,\n        // For legacy compat (see EEJitManager::WriterLockHolder), where default ctor\n        // causes ACQUIREF(DEFAULTVALUE), but ACQUIREF ignores the argument and\n        // operates on static or global value instead.\n        bool DEFAULT_CTOR_ACQUIRE = true\n    >\nclass Wrapper : public BaseWrapper<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,\n                                   DEFAULTVALUE, IS_NULL>\n{\n    typedef BaseWrapper<TYPE, FunctionBase<TYPE, ACQUIREF, RELEASEF>,\n                                   DEFAULTVALUE, IS_NULL> BaseT;\n\n  public:\n    FORCEINLINE Wrapper()\n        : BaseT(TYPE(DEFAULTVALUE), DEFAULT_CTOR_ACQUIRE)\n    {\n        STATIC_CONTRACT_WRAPPER;\n    }\n\n    FORCEINLINE Wrapper(TYPE value)\n        : BaseT(value)\n    {\n        STATIC_CONTRACT_WRAPPER;\n    }\n\n    FORCEINLINE Wrapper(TYPE value, BOOL takeOwnership)\n        : BaseT(value, takeOwnership)\n    {\n        STATIC_CONTRACT_WRAPPER;\n    }\n\n    FORCEINLINE Wrapper& operator=(TYPE const & value)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        BaseT::operator=(value);\n        return *this;\n    }\n\n    HIDE_GENERATED_METHODS(Wrapper)\n};  // Wrapper<>\n\n//---------------------------------------------------------------------------------------\n// - Cannot use the standard INDEBUG macro: holder.h is used in places where INDEBUG is defined in the nonstandard way\n#if defined(_DEBUG)\n#define INDEBUG_AND_WINDOWS_FOR_HOLDERS(x) x\n#else\n#define INDEBUG_AND_WINDOWS_FOR_HOLDERS(x)\n#endif\n\ntemplate <typename _TYPE, void (*_RELEASEF)(_TYPE*)>\nclass SpecializedWrapper : public Wrapper<_TYPE*, DoNothing<_TYPE*>, _RELEASEF, NULL>\n{\n    using BaseT = Wrapper<_TYPE*, DoNothing<_TYPE*>, _RELEASEF, NULL>;\npublic:\n    FORCEINLINE SpecializedWrapper() : BaseT(NULL, FALSE)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        INDEBUG_AND_WINDOWS_FOR_HOLDERS(m_pvalue = &this->m_value;)\n    }\n    FORCEINLINE SpecializedWrapper(_TYPE* value) : BaseT(value)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        INDEBUG_AND_WINDOWS_FOR_HOLDERS(m_pvalue = &this->m_value;)\n    }\n    FORCEINLINE SpecializedWrapper(_TYPE* value, BOOL takeOwnership) : BaseT(value, takeOwnership)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        INDEBUG_AND_WINDOWS_FOR_HOLDERS(m_pvalue = &this->m_value;)\n    }\n    FORCEINLINE ~SpecializedWrapper()\n    {\n    }\n\n    SpecializedWrapper(SpecializedWrapper const &) = delete;\n    SpecializedWrapper & operator=(SpecializedWrapper const &) = delete;\n\n    FORCEINLINE SpecializedWrapper& operator=(_TYPE * value)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        BaseT::operator=(value);\n        return *this;\n    }\n\n    FORCEINLINE SpecializedWrapper(SpecializedWrapper && other)\n    : BaseT(NULL, FALSE)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        INDEBUG_AND_WINDOWS_FOR_HOLDERS(m_pvalue = &this->m_value;)\n        *this = std::move(other);\n    }\n\n    FORCEINLINE SpecializedWrapper& operator=(SpecializedWrapper && other)\n    {\n        BaseT::m_value = std::move(other.BaseT::m_value);\n        BaseT::m_acquired = std::move(other.BaseT::m_acquired);\n        other.BaseT::m_value = nullptr;\n        other.BaseT::m_acquired = FALSE;\n        return *this;\n    }\n\n    /* Since operator& is overloaded we need a way to get a type safe this pointer. */\n    FORCEINLINE SpecializedWrapper* GetAddr()\n    {\n        STATIC_CONTRACT_LEAF;\n        return this;\n    }\n    private:\n    /* m_ppValue: Do not use from source code: Only for convenient use from debugger */\n    /*     watch windows - saves five mouseclicks when inspecting holders. */\n    INDEBUG_AND_WINDOWS_FOR_HOLDERS(_TYPE ** m_pvalue;)\n};\n\n//-----------------------------------------------------------------------------\n// NOTE: THIS IS UNSAFE TO USE IN THE VM for interop COM objects!!\n//  WE DO NOT CORRECTLY CHANGE TO PREEMPTIVE MODE BEFORE CALLING RELEASE!!\n//  USE SafeComHolder\n//\n// ReleaseHolder : COM Interface holder for use outside the VM (or on well known instances\n//                  which do not need preemptive Relesae)\n//\n// Usage example:\n//\n//  {\n//      ReleaseHolder<IFoo> foo;\n//      hr = FunctionToGetRefOfFoo(&foo);\n//      // Note ComHolder doesn't call AddRef - it assumes you already have a ref (if non-0).\n//  } // foo->Release() on out of scope (WITHOUT RESPECT FOR GC MODE!!)\n//\n//-----------------------------------------------------------------------------\n\ntemplate <typename TYPE>\nFORCEINLINE void DoTheRelease(TYPE *value)\n{\n    if (value)\n    {\n        value->Release();\n    }\n}\n\ntemplate<typename _TYPE>\nusing DoNothingHolder = SpecializedWrapper<_TYPE, DoNothing<_TYPE*>>;\n\ntemplate<typename _TYPE>\nusing ReleaseHolder = SpecializedWrapper<_TYPE, DoTheRelease<_TYPE>>;\n\ntemplate<typename _TYPE>\nusing NonVMComHolder = SpecializedWrapper<_TYPE, DoTheRelease<_TYPE>>;\n\n\n//-----------------------------------------------------------------------------\n// StubHolder : holder for stubs\n//\n// Usage example:\n//\n//  {\n//      StubHolder<Stub> foo;\n//      foo = new Stub();\n//      foo->AddRef();\n//      // Note StubHolder doesn't call AddRef for you.\n//  } // foo->DecRef() on out of scope\n//\n//-----------------------------------------------------------------------------\n\ntemplate<typename _TYPE>\nclass ExecutableWriterHolderNoLog;\n\nclass ExecutableAllocator;\n\ntemplate <typename TYPE, typename LOGGER=ExecutableAllocator>\nFORCEINLINE void StubRelease(TYPE* value)\n{\n    if (value)\n    {\n#ifdef LOG_EXECUTABLE_ALLOCATOR_STATISTICS\n#ifdef TARGET_UNIX\n        LOGGER::LogUsage(__FILE__, __LINE__, __PRETTY_FUNCTION__);\n#else\n        LOGGER::LogUsage(__FILE__, __LINE__, __FUNCTION__);\n#endif\n#endif // LOG_EXECUTABLE_ALLOCATOR_STATISTICS\n        ExecutableWriterHolderNoLog<TYPE> stubWriterHolder(value, sizeof(TYPE));\n        stubWriterHolder.GetRW()->DecRef();\n    }\n}\n\ntemplate<typename _TYPE>\nusing StubHolder = SpecializedWrapper<_TYPE, StubRelease<_TYPE>>;\n\n//-----------------------------------------------------------------------------\n// CoTaskMemHolder : CoTaskMemAlloc allocated memory holder\n//\n//  {\n//      CoTaskMemHolder<Foo> foo = (Foo*) CoTaskMemAlloc(sizeof(Foo));\n//  } // delete foo on out of scope\n//-----------------------------------------------------------------------------\n\ntemplate <typename TYPE>\nFORCEINLINE void DeleteCoTaskMem(TYPE *value)\n{\n    if (value)\n        CoTaskMemFree(value);\n}\n\ntemplate<typename _TYPE>\nusing CoTaskMemHolder = SpecializedWrapper<_TYPE, DeleteCoTaskMem<_TYPE>>;\n\n//-----------------------------------------------------------------------------\n// NewHolder : New'ed memory holder\n//\n//  {\n//      NewHolder<Foo> foo = new Foo ();\n//  } // delete foo on out of scope\n//-----------------------------------------------------------------------------\n\ntemplate <typename TYPE>\nFORCEINLINE void Delete(TYPE *value)\n{\n    STATIC_CONTRACT_LEAF;\n\n    static_assert(!std::is_same<typename std::remove_cv<TYPE>::type, WCHAR>::value,\n                  \"Must use NewArrayHolder (not NewHolder) for strings.\");\n    static_assert(!std::is_same<typename std::remove_cv<TYPE>::type, CHAR>::value,\n                  \"Must use NewArrayHolder (not NewHolder) for strings.\");\n\n    delete value;\n}\n\ntemplate<typename _TYPE>\nusing NewHolder = SpecializedWrapper<_TYPE, Delete<_TYPE>>;\n\n //-----------------------------------------------------------------------------\n// NewExecutableHolder : New'ed memory holder for executable memory.\n//\n//  {\n//      NewExecutableHolder<Foo> foo = (Foo*) new (executable) Byte[num];\n//  } // delete foo on out of scope\n//-----------------------------------------------------------------------------\n// IJW\ntemplate<class T> void DeleteExecutable(T *p);\n\ntemplate<typename _TYPE>\nusing NewExecutableHolder = SpecializedWrapper<_TYPE, DeleteExecutable<_TYPE>>;\n\n//-----------------------------------------------------------------------------\n// NewArrayHolder : New []'ed pointer holder\n//  {\n//      NewArrayHolder<Foo> foo = new Foo [30];\n//  } // delete [] foo on out of scope\n//-----------------------------------------------------------------------------\n\ntemplate <typename TYPE>\nFORCEINLINE void DeleteArray(TYPE *value)\n{\n    STATIC_CONTRACT_WRAPPER;\n    delete [] value;\n    value = NULL;\n}\n\ntemplate<typename _TYPE>\nusing NewArrayHolder = SpecializedWrapper<_TYPE, DeleteArray<_TYPE>>;\ntypedef NewArrayHolder<CHAR>  AStringHolder;\ntypedef NewArrayHolder<WCHAR> WStringHolder;\n\n//-----------------------------------------------------------------------------\n// A special array holder that expects its contents are interface pointers,\n// and will call Release() on them.\n//\n// NOTE: You may ONLY use this if you've determined that it is SAFE to call\n// Release() on the contained interface pointers (e.g., as opposed to SafeRelease)\n//\ntemplate <typename INTERFACE>\nclass NewInterfaceArrayHolder : public NewArrayHolder<INTERFACE *>\n{\npublic:\n    NewInterfaceArrayHolder() :\n        NewArrayHolder<INTERFACE *>(),\n        m_cElements(0)\n    {\n        STATIC_CONTRACT_WRAPPER;\n    }\n\n    NewInterfaceArrayHolder& operator=(INTERFACE ** value)\n    {\n        STATIC_CONTRACT_WRAPPER;\n        NewArrayHolder<INTERFACE *>::operator=(value);\n        return *this;\n    }\n\n    void SetElementCount(ULONG32 cElements)\n    {\n        STATIC_CONTRACT_LEAF;\n        m_cElements = cElements;\n    }\n\n    ~NewInterfaceArrayHolder()\n    {\n        STATIC_CONTRACT_LEAF;\n        for (ULONG32 i=0; i < m_cElements; i++)\n        {\n            if (this->m_value[i] != NULL)\n                this->m_value[i]->Release();\n        }\n    }\n\nprotected:\n    ULONG32 m_cElements;\n};\n\n\n//-----------------------------------------------------------------------------\n// ResetPointerHolder : pointer which needs to be set to NULL\n//  {\n//      ResetPointerHolder<Foo> holder = &pFoo;\n//  } // \"*pFoo=NULL\" on out of scope\n//-----------------------------------------------------------------------------\n#ifdef __GNUC__\n// With -fvisibility-inlines-hidden, the Invoke methods below\n// get hidden, which causes warnings when visible classes expose them.\n#define VISIBLE __attribute__ ((visibility(\"default\")))\n#else\n#define VISIBLE\n#endif // __GNUC__\n\nnamespace detail\n{\n    template <typename T>\n    struct ZeroMem\n    {\n        static VISIBLE void Invoke(T * pVal)\n        {\n            ZeroMemory(pVal, sizeof(T));\n        }\n    };\n\n    template <typename T>\n    struct ZeroMem<T*>\n    {\n        static VISIBLE void Invoke(T ** pVal)\n        {\n            *pVal = NULL;\n        }\n    };\n\n}\n#undef VISIBLE\n\ntemplate<typename _TYPE>\nusing ResetPointerHolder = SpecializedWrapper<_TYPE, detail::ZeroMem<_TYPE>::Invoke>;\ntemplate<typename _TYPE>\nusing FieldNuller = SpecializedWrapper<_TYPE, detail::ZeroMem<_TYPE>::Invoke>;\n\n//-----------------------------------------------------------------------------\n// Wrap win32 functions using HANDLE\n//-----------------------------------------------------------------------------\n\nFORCEINLINE void VoidCloseHandle(HANDLE h) { if (h != NULL) CloseHandle(h); }\n// (UINT_PTR) -1 is INVALID_HANDLE_VALUE\nFORCEINLINE void VoidCloseFileHandle(HANDLE h) { if (h != ((HANDLE)((LONG_PTR) -1))) CloseHandle(h); }\nFORCEINLINE void VoidFindClose(HANDLE h) { FindClose(h); }\nFORCEINLINE void VoidUnmapViewOfFile(void *ptr) { UnmapViewOfFile(ptr); }\n\ntemplate <typename TYPE>\nFORCEINLINE void TypeUnmapViewOfFile(TYPE *ptr) { UnmapViewOfFile(ptr); }\n\n// (UINT_PTR) -1 is INVALID_HANDLE_VALUE\n//@TODO: Dangerous default value. Some Win32 functions return INVALID_HANDLE_VALUE, some return NULL (such as CreatEvent).\ntypedef Wrapper<HANDLE, DoNothing<HANDLE>, VoidCloseHandle, (UINT_PTR) -1> HandleHolder;\ntypedef Wrapper<HANDLE, DoNothing<HANDLE>, VoidCloseFileHandle, (UINT_PTR) -1> FileHandleHolder;\ntypedef Wrapper<HANDLE, DoNothing<HANDLE>, VoidFindClose, (UINT_PTR) -1> FindHandleHolder;\n\ntypedef Wrapper<void *, DoNothing, VoidUnmapViewOfFile> MapViewHolder;\n\n//-----------------------------------------------------------------------------\n// Misc holders\n//-----------------------------------------------------------------------------\n\n// A holder for HMODULE.\nFORCEINLINE void HolderFreeLibrary(HMODULE h) { FreeLibrary(h); }\n\ntypedef Wrapper<HMODULE, DoNothing<HMODULE>, HolderFreeLibrary, NULL> HModuleHolder;\n\ntemplate <typename T> FORCEINLINE\nvoid DoLocalFree(T* pMem)\n{\n#ifdef HOST_WINDOWS\n    (LocalFree)((void*)pMem);\n#else\n    (free)((void*)pMem);\n#endif\n}\n\ntemplate<typename _TYPE>\nusing LocalAllocHolder = SpecializedWrapper<_TYPE, DoLocalFree<_TYPE>>;\n\ninline void BoolSet( _Out_ bool * val ) { *val = true; }\ninline void BoolUnset( _Out_ bool * val ) { *val = false; }\n\ntypedef Wrapper< bool *, BoolSet, BoolUnset > BoolFlagStateHolder;\n\n//\n// We need the following methods to have volatile arguments, so that they can accept\n// raw pointers in addition to the results of the & operator on Volatile<T>.\n//\n\nFORCEINLINE void CounterIncrease(RAW_KEYWORD(volatile) LONG* p) {InterlockedIncrement(p);};\nFORCEINLINE void CounterDecrease(RAW_KEYWORD(volatile) LONG* p) {InterlockedDecrement(p);};\n\ntypedef Wrapper<RAW_KEYWORD(volatile) LONG*, CounterIncrease, CounterDecrease, (UINT_PTR)0, CompareDefault<RAW_KEYWORD(volatile) LONG*>> CounterHolder;\n\n\n#ifdef HOST_WINDOWS\nFORCEINLINE void RegKeyRelease(HKEY k) {RegCloseKey(k);};\ntypedef Wrapper<HKEY,DoNothing,RegKeyRelease> RegKeyHolder;\n#endif // HOST_WINDOWS\n\nclass ErrorModeHolder\n{\n    UINT m_oldMode;\npublic:\n    ErrorModeHolder(UINT newMode){m_oldMode=SetErrorMode(newMode);};\n    ~ErrorModeHolder(){SetErrorMode(m_oldMode);};\n    UINT OldMode() {return m_oldMode;};\n};\n\n#ifdef HOST_WINDOWS\n//-----------------------------------------------------------------------------\n// HKEYHolder : HKEY holder, Calls RegCloseKey on scope exit.\n//\n//  {\n//      HKEYHolder hFoo = NULL;\n//      WszRegOpenKeyEx(HKEY_CLASSES_ROOT, L\"Interface\",0, KEY_READ, hFoo);\n//\n//  } // close key on out of scope via RegCloseKey.\n//-----------------------------------------------------------------------------\n\nclass HKEYHolder\n{\npublic:\n    HKEYHolder()\n    {\n        STATIC_CONTRACT_LEAF;\n        m_value = 0;\n    }\n\n    ~HKEYHolder()\n    {\n        STATIC_CONTRACT_WRAPPER;\n        if (m_value != NULL)\n            ::RegCloseKey(m_value);\n    }\n\n    FORCEINLINE void operator=(HKEY p)\n    {\n        STATIC_CONTRACT_LEAF;\n        if (p != 0)\n            m_value = p;\n    }\n\n    FORCEINLINE operator HKEY()\n    {\n        STATIC_CONTRACT_LEAF;\n        return m_value;\n    }\n\n    FORCEINLINE operator HKEY*()\n    {\n        STATIC_CONTRACT_LEAF;\n        return &m_value;\n    }\n\n    FORCEINLINE HKEY* operator&()\n    {\n        STATIC_CONTRACT_LEAF;\n        return &m_value;\n    }\n\nprivate:\n    HKEY m_value;\n};\n#endif // HOST_WINDOWS\n\n//----------------------------------------------------------------------------\n//\n// External data access does not want certain holder implementations\n// to be active as locks should not be taken and so on.  Provide\n// a no-op in that case.\n//\n//----------------------------------------------------------------------------\n\n#ifndef DACCESS_COMPILE\n\n#define DacHolder Holder\n\n#else\n\ntemplate <typename TYPE, void (*ACQUIRE)(TYPE), void (*RELEASEF)(TYPE), UINT_PTR DEFAULTVALUE = 0, BOOL IS_NULL(TYPE, TYPE) = CompareDefault<TYPE>, BOOL VALIDATE_BACKOUT_STACK = TRUE>\nclass DacHolder\n{\n  protected:\n    TYPE    m_value;\n\n  private:\n    BOOL    m_acquired;      // Have we acquired the resource?\n\n  public:\n    FORCEINLINE DacHolder()\n      : m_value(TYPE(DEFAULTVALUE)),\n        m_acquired(FALSE)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n    }\n\n    // construct a new instance of DacHolder\n    // Arguments:\n    //     input:  value - the resource held\n    //             take  - indicates whether the lock should be taken--the default is true. See Notes:\n    // Note: In DAC builds, the Acquire function does not actually take the lock, instead\n    //       it determines whether the lock is held (by the LS). If it is, the locked data\n    //       is assumed to be inconsistent and the Acquire function will throw.\n    FORCEINLINE DacHolder(TYPE value, BOOL take = TRUE)\n      : m_value(value),\n        m_acquired(FALSE)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        if (take)\n            Acquire();\n\n    }\n    FORCEINLINE ~DacHolder()\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n    }\n    // Sets the value to 'value'. Doesn't call Acquire/Release if fTake is FALSE.\n    FORCEINLINE void Assign(TYPE value, BOOL fTake = TRUE)\n    {\n        m_value = value;\n    }\n    FORCEINLINE void Acquire()\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n\n        if (!IsNull())\n        {\n            m_acquired = TRUE;\n            // because ACQUIRE is a template argument, if the line m_acquired = TRUE is placed after the call\n            // where it logically belongs, the compiler flags it as \"unreachable code.\"\n            ACQUIRE(this->m_value);\n        }\n    }\n    FORCEINLINE void Release()\n    {\n        // Insert any global or thread bookkeeping here\n\n        if (m_acquired)\n        {\n            m_acquired = FALSE;\n        }\n    }\n    FORCEINLINE void Clear()\n    {\n        m_value = TYPE(DEFAULTVALUE);\n        m_acquired = FALSE;\n    }\n    FORCEINLINE void SuppressRelease()\n    {\n        m_acquired = FALSE;\n    }\n    FORCEINLINE TYPE GetValue()\n    {\n        return m_value;\n    }\n    FORCEINLINE BOOL IsNull() const\n    {\n        return IS_NULL(m_value, TYPE(DEFAULTVALUE));\n    }\n\n  private:\n    FORCEINLINE DacHolder& operator=(const Holder<TYPE, ACQUIRE, RELEASEF> &holder)\n    {\n    }\n\n    FORCEINLINE DacHolder(const Holder<TYPE, ACQUIRE, RELEASEF> &holder)\n    {\n    }\n};\n\n#endif // #ifndef DACCESS_COMPILE\n\n// Holder-specific clr::SafeAddRef and clr::SafeRelease helper functions.\nnamespace clr\n{\n    // Copied from utilcode.h. We can't include the header directly because there\n    // is circular reference.\n    // Forward declare the overload which is used by 'SafeAddRef' below.\n    template <typename ItfT>\n    static inline\n    typename std::enable_if< std::is_pointer<ItfT>::value, ItfT >::type\n    SafeAddRef(ItfT pItf);\n\n    template < typename ItfT > __checkReturn\n    ItfT *\n    SafeAddRef(ReleaseHolder<ItfT> & pItf)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        //@TODO: Would be good to add runtime validation that the return value is used.\n        return SafeAddRef(pItf.GetValue());\n    }\n\n    namespace detail\n    {\n        template <typename T>\n        char IsHolderHelper(HolderBase<T>*);\n        int  IsHolderHelper(...);\n\n        template <typename T>\n        struct IsHolder : public std::conditional<\n            sizeof(IsHolderHelper(reinterpret_cast<T*>(NULL))) == sizeof(char),\n            std::true_type,\n            std::false_type>::type\n        {};\n    }\n\n    template < typename T >\n    typename std::enable_if<detail::IsHolder<T>::value, ULONG>::type\n    SafeRelease(T& arg)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        return arg.Release();\n    }\n}\n\n#endif  // __HOLDER_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/iallocator.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// We would like to allow \"util\" collection classes to be usable both\n// from the VM and from the JIT.  The latter case presents a\n// difficulty, because in the (x86, soon to be cross-platform) JIT\n// compiler, we require allocation to be done using a \"no-release\"\n// (aka, arena-style) allocator that is provided as methods of the\n// JIT's Compiler type.\n\n// To allow utilcode collection classes to deal with this, they may be\n// written to do allocation and freeing via an instance of the\n// \"IAllocator\" class defined in this file.\n//\n#ifndef _IALLOCATOR_DEFINED_\n#define _IALLOCATOR_DEFINED_\n\n#include \"contract.h\"\n#include \"safemath.h\"\n\nclass IAllocator\n{\n  public:\n    virtual void* Alloc(size_t sz) = 0;\n\n    // Allocate space for an array of \"elems\" elements, each of size \"elemSize\".\n    virtual void* ArrayAlloc(size_t elems, size_t elemSize) = 0;\n\n    virtual void  Free(void* p) = 0;\n};\n\n#endif // _IALLOCATOR_DEFINED_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/iceefilegen.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** ICeeFileGen.h - code generator interface.                               **\n **                                                                         **\n ** This interface provides functionality to create a CLR PE executable.    **\n ** This will typically be used by compilers to generate their compiled     **\n ** output executable.                                                      **\n **                                                                         **\n *****************************************************************************/\n\n/*\n  This is how this is typically used:\n\n  // Step #1 ... Get CLR hosting API:\n  #include <mscoree.h>\n  #include <metahost.h>\n\n  ICLRMetaHost * pMetaHost;\n  CLRCreateInstance(CLSID_CLRMetaHost, IID_ICLRMetaHost, &pMetaHost); // defined in mscoree.h\n\n  ICLRRuntimeInfo * pCLRRuntimeInfo;\n  pMetaHost->GetRuntime(wszClrVersion, IID_ICLRRuntimeInfo, &pCLRRuntimeInfo);\n\n  // Step #2 ... use mscorpe APIs to create a file generator\n  CreateICeeFileGen(...);       // Get a ICeeFileGen\n\n  CreateCeeFile(...);           // Get a HCEEFILE (called for every output file needed)\n  SetOutputFileName(...);       // Set the name for the output file\n  pEmit = IMetaDataEmit object; // Get a metadata emitter\n  GetSectionBlock(...);, AddSectionReloc(...); ... // Get blocks, write non-metadata information, and add necessary relocation\n  EmitMetaDataEx(pEmit);        // Write out the metadata\n  GenerateCeeFile(...);         // Write out the file.\n\n  DestroyICeeFileGen(...);      // Release the ICeeFileGen object\n*/\n\n\n#ifndef _ICEEFILEGEN_H_\n#define _ICEEFILEGEN_H_\n\n#include <ole2.h>\n#include \"corpriv.h\"\n\nclass ICeeFileGen;\n\ntypedef void *HCEEFILE;\n\nEXTERN_C HRESULT __stdcall CreateICeeFileGen(ICeeFileGen** pCeeFileGen);\nEXTERN_C HRESULT __stdcall DestroyICeeFileGen(ICeeFileGen ** ppCeeFileGen);\n\ntypedef HRESULT (__stdcall * PFN_CreateICeeFileGen)(ICeeFileGen ** ceeFileGen);  // call this to instantiate an ICeeFileGen interface\ntypedef HRESULT (__stdcall * PFN_DestroyICeeFileGen)(ICeeFileGen ** ceeFileGen); // call this to delete an ICeeFileGen\n\n#define ICEE_CREATE_FILE_PE32\t       0x00000001  // Create a PE  (32-bit)\n#define ICEE_CREATE_FILE_PE64\t       0x00000002  // Create a PE+ (64-bit)\n#define ICEE_CREATE_FILE_CORMAIN_STUB  0x00000004  // add a mscoree!_Cor___Main call stub\n#define ICEE_CREATE_FILE_STRIP_RELOCS  0x00000008  // strip the .reloc section\n\n#define ICEE_CREATE_MACHINE_MASK       0x0000FF00  // space for up to 256 machine targets (note: most users just do a bit check, not an equality compare after applying the mask)\n#define ICEE_CREATE_MACHINE_ILLEGAL    0x00000000  // An illegal machine name\n#define ICEE_CREATE_MACHINE_I386       0x00000100  // Create a IMAGE_FILE_MACHINE_I386\n#define ICEE_CREATE_MACHINE_IA64       0x00000200  // Create a IMAGE_FILE_MACHINE_IA64\n#define ICEE_CREATE_MACHINE_AMD64      0x00000400  // Create a IMAGE_FILE_MACHINE_AMD64\n#define ICEE_CREATE_MACHINE_ARM        0x00000800  // Create a IMAGE_FILE_MACHINE_ARMNT\n#define ICEE_CREATE_MACHINE_ARM64      0x00001000  // Create a IMAGE_FILE_MACHINE_ARM64\n\n    // Pass this to CreateCeeFileEx to create a pure IL Exe or DLL\n#define ICEE_CREATE_FILE_PURE_IL  ICEE_CREATE_FILE_PE32         | \\\n                                  ICEE_CREATE_FILE_CORMAIN_STUB | \\\n                                  ICEE_CREATE_MACHINE_I386\n\nclass ICeeFileGen {\n  public:\n    virtual ~ICeeFileGen() = default;\n\n    virtual HRESULT CreateCeeFile(HCEEFILE *ceeFile); // call this to instantiate a file handle\n\n    virtual HRESULT GetMethodRVA (HCEEFILE ceeFile, ULONG codeOffset, ULONG *codeRVA);\n\n    virtual HRESULT EmitString (HCEEFILE ceeFile,_In_ LPWSTR strValue, ULONG *strRef);\n    virtual HRESULT GenerateCeeFile (HCEEFILE ceeFile);\n\n    virtual HRESULT SetOutputFileName (HCEEFILE ceeFile, _In_ LPWSTR outputFileName);\n    _Return_type_success_(return == S_OK)\n    virtual HRESULT GetOutputFileName (HCEEFILE ceeFile, _Out_ LPWSTR *outputFileName);\n\n    virtual HRESULT SetResourceFileName (HCEEFILE ceeFile, _In_ LPWSTR resourceFileName);\n\n    _Return_type_success_(return == S_OK)\n    virtual HRESULT GetResourceFileName (HCEEFILE ceeFile, _Out_ LPWSTR *resourceFileName);\n\n    virtual HRESULT SetImageBase(HCEEFILE ceeFile, size_t imageBase);\n\n    virtual HRESULT SetSubsystem(HCEEFILE ceeFile, DWORD subsystem, DWORD major, DWORD minor);\n\n    virtual HRESULT SetDllSwitch (HCEEFILE ceeFile, BOOL dllSwitch);\n    virtual HRESULT GetDllSwitch (HCEEFILE ceeFile, BOOL *dllSwitch);\n\n    virtual HRESULT DestroyCeeFile(HCEEFILE *ceeFile); // call this to delete a file handle\n\n    virtual HRESULT GetSectionCreate (HCEEFILE ceeFile, const char *name, DWORD flags, HCEESECTION *section);\n    virtual HRESULT GetIlSection (HCEEFILE ceeFile, HCEESECTION *section);\n    virtual HRESULT GetRdataSection (HCEEFILE ceeFile, HCEESECTION *section);\n\n    virtual HRESULT GetSectionDataLen (HCEESECTION section, ULONG *dataLen);\n    virtual HRESULT GetSectionBlock (HCEESECTION section, ULONG len, ULONG align=1, void **ppBytes=0);\n    virtual HRESULT AddSectionReloc (HCEESECTION section, ULONG offset, HCEESECTION relativeTo, CeeSectionRelocType relocType);\n\n    virtual HRESULT SetEntryPoint (HCEEFILE ceeFile, mdMethodDef method);\n    virtual HRESULT GetEntryPoint (HCEEFILE ceeFile, mdMethodDef *method);\n\n    virtual HRESULT SetComImageFlags (HCEEFILE ceeFile, DWORD mask);\n    virtual HRESULT GetComImageFlags (HCEEFILE ceeFile, DWORD *mask);\n\n    // get IMapToken interface for tracking mapped tokens\n    virtual HRESULT GetIMapTokenIface(HCEEFILE ceeFile, IMetaDataEmit *emitter, IUnknown **pIMapToken);\n    virtual HRESULT SetDirectoryEntry (HCEEFILE ceeFile, HCEESECTION section, ULONG num, ULONG size, ULONG offset = 0);\n\n    // Write out the metadata in \"emitter\" to the metadata section in \"ceeFile\"\n    // Use EmitMetaDataAt() for more control\n    virtual HRESULT EmitMetaDataEx (HCEEFILE ceeFile, IMetaDataEmit *emitter);\n\n    virtual HRESULT GetIMapTokenIfaceEx(HCEEFILE ceeFile, IMetaDataEmit *emitter, IUnknown **pIMapToken);\n\n    virtual HRESULT CreateCeeFileFromICeeGen(\n        ICeeGenInternal *pFromICeeGen, HCEEFILE *ceeFile, DWORD createFlags = ICEE_CREATE_FILE_PURE_IL); // call this to instantiate a file handle\n\n    virtual HRESULT SetManifestEntry(HCEEFILE ceeFile, ULONG size, ULONG offset);\n\n    virtual HRESULT ComputeSectionOffset(HCEESECTION section, _In_ char *ptr,\n                                         unsigned *offset);\n\n    virtual HRESULT ComputeOffset(HCEEFILE file, _In_ char *ptr,\n                                  HCEESECTION *pSection, unsigned *offset);\n\n    virtual HRESULT GetCorHeader(HCEEFILE ceeFile,\n                                 IMAGE_COR20_HEADER **header);\n\n    // Layout the sections and assign their starting addresses\n    virtual HRESULT LinkCeeFile (HCEEFILE ceeFile);\n\n    // Base RVA assinged to the section. To be called only after LinkCeeFile()\n    virtual HRESULT GetSectionRVA (HCEESECTION section, ULONG *rva);\n\n    _Return_type_success_(return == S_OK)\n    virtual HRESULT ComputeSectionPointer(HCEESECTION section, ULONG offset,\n                                          _Out_ char **ptr);\n\n    virtual HRESULT SetVTableEntry(HCEEFILE ceeFile, ULONG size, ULONG offset);\n    // See the end of interface for another overload of AetVTableEntry\n\n    virtual HRESULT SetStrongNameEntry(HCEEFILE ceeFile, ULONG size, ULONG offset);\n\n    // Emit the metadata from \"emitter\".\n    // If 'section != 0, it will put the data in 'buffer'.  This\n    // buffer is assumed to be in 'section' at 'offset' and of size 'buffLen'\n    // (should use GetSaveSize to insure that buffer is big enough\n    virtual HRESULT EmitMetaDataAt (HCEEFILE ceeFile, IMetaDataEmit *emitter,\n                                    HCEESECTION section, DWORD offset,\n                                    BYTE* buffer, unsigned buffLen);\n\n    virtual HRESULT GetFileTimeStamp (HCEEFILE ceeFile, DWORD *pTimeStamp);\n\n    // Add a notification handler. If it implements an interface that\n    // the ICeeFileGen understands, S_OK is returned. Otherwise,\n    // E_NOINTERFACE.\n    virtual HRESULT AddNotificationHandler(HCEEFILE ceeFile,\n                                           IUnknown *pHandler);\n\n    virtual HRESULT SetFileAlignment(HCEEFILE ceeFile, ULONG fileAlignment);\n\n    virtual HRESULT ClearComImageFlags (HCEEFILE ceeFile, DWORD mask);\n\n    // call this to instantiate a PE+ (64-bit PE file)\n    virtual HRESULT CreateCeeFileEx(HCEEFILE *ceeFile, ULONG createFlags);\n    virtual HRESULT SetImageBase64(HCEEFILE ceeFile, ULONGLONG imageBase);\n\n    virtual HRESULT GetHeaderInfo (HCEEFILE ceeFile, PIMAGE_NT_HEADERS *ppNtHeaders,\n                                                     PIMAGE_SECTION_HEADER *ppSections,\n                                                     ULONG *pNumSections);\n\n    // Seed file is a base file which is copied over into the output file\n    // Note that there are restrictions on the seed file (the sections\n    // cannot be relocated), and that the copy is not complete as the new\n    // headers overwrite the seed file headers.\n    virtual HRESULT CreateCeeFileEx2(HCEEFILE *ceeFile, ULONG createFlags,\n                                     LPCWSTR seedFileName = NULL);\n\n    virtual HRESULT SetVTableEntry64(HCEEFILE ceeFile, ULONG size, void* ptr);\n};\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/icorjitinfoimpl_generated.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED\n// To regenerate run the gen script in src/coreclr/tools/Common/JitInterface/ThunkGenerator\n// and follow the instructions in docs/project/updating-jitinterface.md\n\n\n// ICorJitInfoImpl: declare for implementation all the members of the ICorJitInfo interface (which are\n// specified as pure virtual methods). This is done once, here, and all implementations share it,\n// to avoid duplicated declarations. This file is #include'd within all the ICorJitInfo implementation\n// classes.\n//\n// NOTE: this file is in exactly the same order, with exactly the same whitespace, as the ICorJitInfo\n// interface declaration (with the \"virtual\" and \"= 0\" syntax removed). This is to make it easy to compare\n// against the interface declaration.\n\n/**********************************************************************************/\n// clang-format off\n/**********************************************************************************/\n\npublic:\n\nbool isIntrinsic(\n          CORINFO_METHOD_HANDLE ftn) override;\n\nuint32_t getMethodAttribs(\n          CORINFO_METHOD_HANDLE ftn) override;\n\nvoid setMethodAttribs(\n          CORINFO_METHOD_HANDLE ftn,\n          CorInfoMethodRuntimeFlags attribs) override;\n\nvoid getMethodSig(\n          CORINFO_METHOD_HANDLE ftn,\n          CORINFO_SIG_INFO* sig,\n          CORINFO_CLASS_HANDLE memberParent) override;\n\nbool getMethodInfo(\n          CORINFO_METHOD_HANDLE ftn,\n          CORINFO_METHOD_INFO* info) override;\n\nCorInfoInline canInline(\n          CORINFO_METHOD_HANDLE callerHnd,\n          CORINFO_METHOD_HANDLE calleeHnd) override;\n\nvoid beginInlining(\n          CORINFO_METHOD_HANDLE inlinerHnd,\n          CORINFO_METHOD_HANDLE inlineeHnd) override;\n\nvoid reportInliningDecision(\n          CORINFO_METHOD_HANDLE inlinerHnd,\n          CORINFO_METHOD_HANDLE inlineeHnd,\n          CorInfoInline inlineResult,\n          const char* reason) override;\n\nbool canTailCall(\n          CORINFO_METHOD_HANDLE callerHnd,\n          CORINFO_METHOD_HANDLE declaredCalleeHnd,\n          CORINFO_METHOD_HANDLE exactCalleeHnd,\n          bool fIsTailPrefix) override;\n\nvoid reportTailCallDecision(\n          CORINFO_METHOD_HANDLE callerHnd,\n          CORINFO_METHOD_HANDLE calleeHnd,\n          bool fIsTailPrefix,\n          CorInfoTailCall tailCallResult,\n          const char* reason) override;\n\nvoid getEHinfo(\n          CORINFO_METHOD_HANDLE ftn,\n          unsigned EHnumber,\n          CORINFO_EH_CLAUSE* clause) override;\n\nCORINFO_CLASS_HANDLE getMethodClass(\n          CORINFO_METHOD_HANDLE method) override;\n\nCORINFO_MODULE_HANDLE getMethodModule(\n          CORINFO_METHOD_HANDLE method) override;\n\nvoid getMethodVTableOffset(\n          CORINFO_METHOD_HANDLE method,\n          unsigned* offsetOfIndirection,\n          unsigned* offsetAfterIndirection,\n          bool* isRelative) override;\n\nbool resolveVirtualMethod(\n          CORINFO_DEVIRTUALIZATION_INFO* info) override;\n\nCORINFO_METHOD_HANDLE getUnboxedEntry(\n          CORINFO_METHOD_HANDLE ftn,\n          bool* requiresInstMethodTableArg) override;\n\nCORINFO_CLASS_HANDLE getDefaultComparerClass(\n          CORINFO_CLASS_HANDLE elemType) override;\n\nCORINFO_CLASS_HANDLE getDefaultEqualityComparerClass(\n          CORINFO_CLASS_HANDLE elemType) override;\n\nvoid expandRawHandleIntrinsic(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          CORINFO_GENERICHANDLE_RESULT* pResult) override;\n\nbool isIntrinsicType(\n          CORINFO_CLASS_HANDLE classHnd) override;\n\nCorInfoCallConvExtension getUnmanagedCallConv(\n          CORINFO_METHOD_HANDLE method,\n          CORINFO_SIG_INFO* callSiteSig,\n          bool* pSuppressGCTransition) override;\n\nbool pInvokeMarshalingRequired(\n          CORINFO_METHOD_HANDLE method,\n          CORINFO_SIG_INFO* callSiteSig) override;\n\nbool satisfiesMethodConstraints(\n          CORINFO_CLASS_HANDLE parent,\n          CORINFO_METHOD_HANDLE method) override;\n\nbool isCompatibleDelegate(\n          CORINFO_CLASS_HANDLE objCls,\n          CORINFO_CLASS_HANDLE methodParentCls,\n          CORINFO_METHOD_HANDLE method,\n          CORINFO_CLASS_HANDLE delegateCls,\n          bool* pfIsOpenDelegate) override;\n\nvoid methodMustBeLoadedBeforeCodeIsRun(\n          CORINFO_METHOD_HANDLE method) override;\n\nCORINFO_METHOD_HANDLE mapMethodDeclToMethodImpl(\n          CORINFO_METHOD_HANDLE method) override;\n\nvoid getGSCookie(\n          GSCookie* pCookieVal,\n          GSCookie** ppCookieVal) override;\n\nvoid setPatchpointInfo(\n          PatchpointInfo* patchpointInfo) override;\n\nPatchpointInfo* getOSRInfo(\n          unsigned* ilOffset) override;\n\nvoid resolveToken(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken) override;\n\nbool tryResolveToken(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken) override;\n\nvoid findSig(\n          CORINFO_MODULE_HANDLE module,\n          unsigned sigTOK,\n          CORINFO_CONTEXT_HANDLE context,\n          CORINFO_SIG_INFO* sig) override;\n\nvoid findCallSiteSig(\n          CORINFO_MODULE_HANDLE module,\n          unsigned methTOK,\n          CORINFO_CONTEXT_HANDLE context,\n          CORINFO_SIG_INFO* sig) override;\n\nCORINFO_CLASS_HANDLE getTokenTypeAsHandle(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken) override;\n\nbool isValidToken(\n          CORINFO_MODULE_HANDLE module,\n          unsigned metaTOK) override;\n\nbool isValidStringRef(\n          CORINFO_MODULE_HANDLE module,\n          unsigned metaTOK) override;\n\nint getStringLiteral(\n          CORINFO_MODULE_HANDLE module,\n          unsigned metaTOK,\n          char16_t* buffer,\n          int bufferSize,\n          int startIndex) override;\n\nsize_t printObjectDescription(\n          CORINFO_OBJECT_HANDLE handle,\n          char* buffer,\n          size_t bufferSize,\n          size_t* pRequiredBufferSize) override;\n\nCorInfoType asCorInfoType(\n          CORINFO_CLASS_HANDLE cls) override;\n\nconst char* getClassNameFromMetadata(\n          CORINFO_CLASS_HANDLE cls,\n          const char** namespaceName) override;\n\nCORINFO_CLASS_HANDLE getTypeInstantiationArgument(\n          CORINFO_CLASS_HANDLE cls,\n          unsigned index) override;\n\nsize_t printClassName(\n          CORINFO_CLASS_HANDLE cls,\n          char* buffer,\n          size_t bufferSize,\n          size_t* pRequiredBufferSize) override;\n\nbool isValueClass(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCorInfoInlineTypeCheck canInlineTypeCheck(\n          CORINFO_CLASS_HANDLE cls,\n          CorInfoInlineTypeCheckSource source) override;\n\nuint32_t getClassAttribs(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCORINFO_MODULE_HANDLE getClassModule(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCORINFO_ASSEMBLY_HANDLE getModuleAssembly(\n          CORINFO_MODULE_HANDLE mod) override;\n\nconst char* getAssemblyName(\n          CORINFO_ASSEMBLY_HANDLE assem) override;\n\nvoid* LongLifetimeMalloc(\n          size_t sz) override;\n\nvoid LongLifetimeFree(\n          void* obj) override;\n\nsize_t getClassModuleIdForStatics(\n          CORINFO_CLASS_HANDLE cls,\n          CORINFO_MODULE_HANDLE* pModule,\n          void** ppIndirection) override;\n\nunsigned getClassSize(\n          CORINFO_CLASS_HANDLE cls) override;\n\nunsigned getHeapClassSize(\n          CORINFO_CLASS_HANDLE cls) override;\n\nbool canAllocateOnStack(\n          CORINFO_CLASS_HANDLE cls) override;\n\nunsigned getClassAlignmentRequirement(\n          CORINFO_CLASS_HANDLE cls,\n          bool fDoubleAlignHint) override;\n\nunsigned getClassGClayout(\n          CORINFO_CLASS_HANDLE cls,\n          uint8_t* gcPtrs) override;\n\nunsigned getClassNumInstanceFields(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCORINFO_FIELD_HANDLE getFieldInClass(\n          CORINFO_CLASS_HANDLE clsHnd,\n          int32_t num) override;\n\nbool checkMethodModifier(\n          CORINFO_METHOD_HANDLE hMethod,\n          const char* modifier,\n          bool fOptional) override;\n\nCorInfoHelpFunc getNewHelper(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          CORINFO_METHOD_HANDLE callerHandle,\n          bool* pHasSideEffects) override;\n\nCorInfoHelpFunc getNewArrHelper(\n          CORINFO_CLASS_HANDLE arrayCls) override;\n\nCorInfoHelpFunc getCastingHelper(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          bool fThrowing) override;\n\nCorInfoHelpFunc getSharedCCtorHelper(\n          CORINFO_CLASS_HANDLE clsHnd) override;\n\nCORINFO_CLASS_HANDLE getTypeForBox(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCorInfoHelpFunc getBoxHelper(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCorInfoHelpFunc getUnBoxHelper(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCORINFO_OBJECT_HANDLE getRuntimeTypePointer(\n          CORINFO_CLASS_HANDLE cls) override;\n\nbool isObjectImmutable(\n          CORINFO_OBJECT_HANDLE objPtr) override;\n\nbool getStringChar(\n          CORINFO_OBJECT_HANDLE strObj,\n          int index,\n          uint16_t* value) override;\n\nCORINFO_CLASS_HANDLE getObjectType(\n          CORINFO_OBJECT_HANDLE objPtr) override;\n\nbool getReadyToRunHelper(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          CORINFO_LOOKUP_KIND* pGenericLookupKind,\n          CorInfoHelpFunc id,\n          CORINFO_CONST_LOOKUP* pLookup) override;\n\nvoid getReadyToRunDelegateCtorHelper(\n          CORINFO_RESOLVED_TOKEN* pTargetMethod,\n          mdToken targetConstraint,\n          CORINFO_CLASS_HANDLE delegateType,\n          CORINFO_LOOKUP* pLookup) override;\n\nCorInfoInitClassResult initClass(\n          CORINFO_FIELD_HANDLE field,\n          CORINFO_METHOD_HANDLE method,\n          CORINFO_CONTEXT_HANDLE context) override;\n\nvoid classMustBeLoadedBeforeCodeIsRun(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCORINFO_CLASS_HANDLE getBuiltinClass(\n          CorInfoClassId classId) override;\n\nCorInfoType getTypeForPrimitiveValueClass(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCorInfoType getTypeForPrimitiveNumericClass(\n          CORINFO_CLASS_HANDLE cls) override;\n\nbool canCast(\n          CORINFO_CLASS_HANDLE child,\n          CORINFO_CLASS_HANDLE parent) override;\n\nbool areTypesEquivalent(\n          CORINFO_CLASS_HANDLE cls1,\n          CORINFO_CLASS_HANDLE cls2) override;\n\nTypeCompareState compareTypesForCast(\n          CORINFO_CLASS_HANDLE fromClass,\n          CORINFO_CLASS_HANDLE toClass) override;\n\nTypeCompareState compareTypesForEquality(\n          CORINFO_CLASS_HANDLE cls1,\n          CORINFO_CLASS_HANDLE cls2) override;\n\nCORINFO_CLASS_HANDLE mergeClasses(\n          CORINFO_CLASS_HANDLE cls1,\n          CORINFO_CLASS_HANDLE cls2) override;\n\nbool isMoreSpecificType(\n          CORINFO_CLASS_HANDLE cls1,\n          CORINFO_CLASS_HANDLE cls2) override;\n\nTypeCompareState isEnum(\n          CORINFO_CLASS_HANDLE cls,\n          CORINFO_CLASS_HANDLE* underlyingType) override;\n\nCORINFO_CLASS_HANDLE getParentType(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCorInfoType getChildType(\n          CORINFO_CLASS_HANDLE clsHnd,\n          CORINFO_CLASS_HANDLE* clsRet) override;\n\nbool satisfiesClassConstraints(\n          CORINFO_CLASS_HANDLE cls) override;\n\nbool isSDArray(\n          CORINFO_CLASS_HANDLE cls) override;\n\nunsigned getArrayRank(\n          CORINFO_CLASS_HANDLE cls) override;\n\nCorInfoArrayIntrinsic getArrayIntrinsicID(\n          CORINFO_METHOD_HANDLE ftn) override;\n\nvoid* getArrayInitializationData(\n          CORINFO_FIELD_HANDLE field,\n          uint32_t size) override;\n\nCorInfoIsAccessAllowedResult canAccessClass(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          CORINFO_METHOD_HANDLE callerHandle,\n          CORINFO_HELPER_DESC* pAccessHelper) override;\n\nsize_t printFieldName(\n          CORINFO_FIELD_HANDLE field,\n          char* buffer,\n          size_t bufferSize,\n          size_t* pRequiredBufferSize) override;\n\nCORINFO_CLASS_HANDLE getFieldClass(\n          CORINFO_FIELD_HANDLE field) override;\n\nCorInfoType getFieldType(\n          CORINFO_FIELD_HANDLE field,\n          CORINFO_CLASS_HANDLE* structType,\n          CORINFO_CLASS_HANDLE memberParent) override;\n\nunsigned getFieldOffset(\n          CORINFO_FIELD_HANDLE field) override;\n\nvoid getFieldInfo(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          CORINFO_METHOD_HANDLE callerHandle,\n          CORINFO_ACCESS_FLAGS flags,\n          CORINFO_FIELD_INFO* pResult) override;\n\nbool isFieldStatic(\n          CORINFO_FIELD_HANDLE fldHnd) override;\n\nint getArrayOrStringLength(\n          CORINFO_OBJECT_HANDLE objHnd) override;\n\nvoid getBoundaries(\n          CORINFO_METHOD_HANDLE ftn,\n          unsigned int* cILOffsets,\n          uint32_t** pILOffsets,\n          ICorDebugInfo::BoundaryTypes* implicitBoundaries) override;\n\nvoid setBoundaries(\n          CORINFO_METHOD_HANDLE ftn,\n          uint32_t cMap,\n          ICorDebugInfo::OffsetMapping* pMap) override;\n\nvoid getVars(\n          CORINFO_METHOD_HANDLE ftn,\n          uint32_t* cVars,\n          ICorDebugInfo::ILVarInfo** vars,\n          bool* extendOthers) override;\n\nvoid setVars(\n          CORINFO_METHOD_HANDLE ftn,\n          uint32_t cVars,\n          ICorDebugInfo::NativeVarInfo* vars) override;\n\nvoid reportRichMappings(\n          ICorDebugInfo::InlineTreeNode* inlineTreeNodes,\n          uint32_t numInlineTreeNodes,\n          ICorDebugInfo::RichOffsetMapping* mappings,\n          uint32_t numMappings) override;\n\nvoid* allocateArray(\n          size_t cBytes) override;\n\nvoid freeArray(\n          void* array) override;\n\nCORINFO_ARG_LIST_HANDLE getArgNext(\n          CORINFO_ARG_LIST_HANDLE args) override;\n\nCorInfoTypeWithMod getArgType(\n          CORINFO_SIG_INFO* sig,\n          CORINFO_ARG_LIST_HANDLE args,\n          CORINFO_CLASS_HANDLE* vcTypeRet) override;\n\nint getExactClasses(\n          CORINFO_CLASS_HANDLE baseType,\n          int maxExactClasses,\n          CORINFO_CLASS_HANDLE* exactClsRet) override;\n\nCORINFO_CLASS_HANDLE getArgClass(\n          CORINFO_SIG_INFO* sig,\n          CORINFO_ARG_LIST_HANDLE args) override;\n\nCorInfoHFAElemType getHFAType(\n          CORINFO_CLASS_HANDLE hClass) override;\n\nJITINTERFACE_HRESULT GetErrorHRESULT(\n          struct _EXCEPTION_POINTERS* pExceptionPointers) override;\n\nuint32_t GetErrorMessage(\n          char16_t* buffer,\n          uint32_t bufferLength) override;\n\nint FilterException(\n          struct _EXCEPTION_POINTERS* pExceptionPointers) override;\n\nvoid ThrowExceptionForJitResult(\n          JITINTERFACE_HRESULT result) override;\n\nvoid ThrowExceptionForHelper(\n          const CORINFO_HELPER_DESC* throwHelper) override;\n\nbool runWithErrorTrap(\n          ICorJitInfo::errorTrapFunction function,\n          void* parameter) override;\n\nbool runWithSPMIErrorTrap(\n          ICorJitInfo::errorTrapFunction function,\n          void* parameter) override;\n\nvoid getEEInfo(\n          CORINFO_EE_INFO* pEEInfoOut) override;\n\nconst char16_t* getJitTimeLogFilename() override;\n\nmdMethodDef getMethodDefFromMethod(\n          CORINFO_METHOD_HANDLE hMethod) override;\n\nsize_t printMethodName(\n          CORINFO_METHOD_HANDLE ftn,\n          char* buffer,\n          size_t bufferSize,\n          size_t* pRequiredBufferSize) override;\n\nconst char* getMethodNameFromMetadata(\n          CORINFO_METHOD_HANDLE ftn,\n          const char** className,\n          const char** namespaceName,\n          const char** enclosingClassName) override;\n\nunsigned getMethodHash(\n          CORINFO_METHOD_HANDLE ftn) override;\n\nsize_t findNameOfToken(\n          CORINFO_MODULE_HANDLE moduleHandle,\n          mdToken token,\n          char* szFQName,\n          size_t FQNameCapacity) override;\n\nbool getSystemVAmd64PassStructInRegisterDescriptor(\n          CORINFO_CLASS_HANDLE structHnd,\n          SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR* structPassInRegDescPtr) override;\n\nuint32_t getLoongArch64PassStructInRegisterFlags(\n          CORINFO_CLASS_HANDLE structHnd) override;\n\nuint32_t getThreadTLSIndex(\n          void** ppIndirection) override;\n\nconst void* getInlinedCallFrameVptr(\n          void** ppIndirection) override;\n\nint32_t* getAddrOfCaptureThreadGlobal(\n          void** ppIndirection) override;\n\nvoid* getHelperFtn(\n          CorInfoHelpFunc ftnNum,\n          void** ppIndirection) override;\n\nvoid getFunctionEntryPoint(\n          CORINFO_METHOD_HANDLE ftn,\n          CORINFO_CONST_LOOKUP* pResult,\n          CORINFO_ACCESS_FLAGS accessFlags) override;\n\nvoid getFunctionFixedEntryPoint(\n          CORINFO_METHOD_HANDLE ftn,\n          bool isUnsafeFunctionPointer,\n          CORINFO_CONST_LOOKUP* pResult) override;\n\nvoid* getMethodSync(\n          CORINFO_METHOD_HANDLE ftn,\n          void** ppIndirection) override;\n\nCorInfoHelpFunc getLazyStringLiteralHelper(\n          CORINFO_MODULE_HANDLE handle) override;\n\nCORINFO_MODULE_HANDLE embedModuleHandle(\n          CORINFO_MODULE_HANDLE handle,\n          void** ppIndirection) override;\n\nCORINFO_CLASS_HANDLE embedClassHandle(\n          CORINFO_CLASS_HANDLE handle,\n          void** ppIndirection) override;\n\nCORINFO_METHOD_HANDLE embedMethodHandle(\n          CORINFO_METHOD_HANDLE handle,\n          void** ppIndirection) override;\n\nCORINFO_FIELD_HANDLE embedFieldHandle(\n          CORINFO_FIELD_HANDLE handle,\n          void** ppIndirection) override;\n\nvoid embedGenericHandle(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          bool fEmbedParent,\n          CORINFO_GENERICHANDLE_RESULT* pResult) override;\n\nvoid getLocationOfThisType(\n          CORINFO_METHOD_HANDLE context,\n          CORINFO_LOOKUP_KIND* pLookupKind) override;\n\nvoid getAddressOfPInvokeTarget(\n          CORINFO_METHOD_HANDLE method,\n          CORINFO_CONST_LOOKUP* pLookup) override;\n\nvoid* GetCookieForPInvokeCalliSig(\n          CORINFO_SIG_INFO* szMetaSig,\n          void** ppIndirection) override;\n\nbool canGetCookieForPInvokeCalliSig(\n          CORINFO_SIG_INFO* szMetaSig) override;\n\nCORINFO_JUST_MY_CODE_HANDLE getJustMyCodeHandle(\n          CORINFO_METHOD_HANDLE method,\n          CORINFO_JUST_MY_CODE_HANDLE** ppIndirection) override;\n\nvoid GetProfilingHandle(\n          bool* pbHookFunction,\n          void** pProfilerHandle,\n          bool* pbIndirectedHandles) override;\n\nvoid getCallInfo(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          CORINFO_RESOLVED_TOKEN* pConstrainedResolvedToken,\n          CORINFO_METHOD_HANDLE callerHandle,\n          CORINFO_CALLINFO_FLAGS flags,\n          CORINFO_CALL_INFO* pResult) override;\n\nbool canAccessFamily(\n          CORINFO_METHOD_HANDLE hCaller,\n          CORINFO_CLASS_HANDLE hInstanceType) override;\n\nbool isRIDClassDomainID(\n          CORINFO_CLASS_HANDLE cls) override;\n\nunsigned getClassDomainID(\n          CORINFO_CLASS_HANDLE cls,\n          void** ppIndirection) override;\n\nvoid* getFieldAddress(\n          CORINFO_FIELD_HANDLE field,\n          void** ppIndirection) override;\n\nbool getReadonlyStaticFieldValue(\n          CORINFO_FIELD_HANDLE field,\n          uint8_t* buffer,\n          int bufferSize,\n          int valueOffset,\n          bool ignoreMovableObjects) override;\n\nCORINFO_CLASS_HANDLE getStaticFieldCurrentClass(\n          CORINFO_FIELD_HANDLE field,\n          bool* pIsSpeculative) override;\n\nCORINFO_VARARGS_HANDLE getVarArgsHandle(\n          CORINFO_SIG_INFO* pSig,\n          void** ppIndirection) override;\n\nbool canGetVarArgsHandle(\n          CORINFO_SIG_INFO* pSig) override;\n\nInfoAccessType constructStringLiteral(\n          CORINFO_MODULE_HANDLE module,\n          mdToken metaTok,\n          void** ppValue) override;\n\nInfoAccessType emptyStringLiteral(\n          void** ppValue) override;\n\nuint32_t getFieldThreadLocalStoreID(\n          CORINFO_FIELD_HANDLE field,\n          void** ppIndirection) override;\n\nvoid addActiveDependency(\n          CORINFO_MODULE_HANDLE moduleFrom,\n          CORINFO_MODULE_HANDLE moduleTo) override;\n\nCORINFO_METHOD_HANDLE GetDelegateCtor(\n          CORINFO_METHOD_HANDLE methHnd,\n          CORINFO_CLASS_HANDLE clsHnd,\n          CORINFO_METHOD_HANDLE targetMethodHnd,\n          DelegateCtorArgs* pCtorData) override;\n\nvoid MethodCompileComplete(\n          CORINFO_METHOD_HANDLE methHnd) override;\n\nbool getTailCallHelpers(\n          CORINFO_RESOLVED_TOKEN* callToken,\n          CORINFO_SIG_INFO* sig,\n          CORINFO_GET_TAILCALL_HELPERS_FLAGS flags,\n          CORINFO_TAILCALL_HELPERS* pResult) override;\n\nbool convertPInvokeCalliToCall(\n          CORINFO_RESOLVED_TOKEN* pResolvedToken,\n          bool mustConvert) override;\n\nbool notifyInstructionSetUsage(\n          CORINFO_InstructionSet instructionSet,\n          bool supportEnabled) override;\n\nvoid updateEntryPointForTailCall(\n          CORINFO_CONST_LOOKUP* entryPoint) override;\n\nvoid allocMem(\n          AllocMemArgs* pArgs) override;\n\nvoid reserveUnwindInfo(\n          bool isFunclet,\n          bool isColdCode,\n          uint32_t unwindSize) override;\n\nvoid allocUnwindInfo(\n          uint8_t* pHotCode,\n          uint8_t* pColdCode,\n          uint32_t startOffset,\n          uint32_t endOffset,\n          uint32_t unwindSize,\n          uint8_t* pUnwindBlock,\n          CorJitFuncKind funcKind) override;\n\nvoid* allocGCInfo(\n          size_t size) override;\n\nvoid setEHcount(\n          unsigned cEH) override;\n\nvoid setEHinfo(\n          unsigned EHnumber,\n          const CORINFO_EH_CLAUSE* clause) override;\n\nbool logMsg(\n          unsigned level,\n          const char* fmt,\n          va_list args) override;\n\nint doAssert(\n          const char* szFile,\n          int iLine,\n          const char* szExpr) override;\n\nvoid reportFatalError(\n          CorJitResult result) override;\n\nJITINTERFACE_HRESULT getPgoInstrumentationResults(\n          CORINFO_METHOD_HANDLE ftnHnd,\n          ICorJitInfo::PgoInstrumentationSchema** pSchema,\n          uint32_t* pCountSchemaItems,\n          uint8_t** pInstrumentationData,\n          ICorJitInfo::PgoSource* pgoSource) override;\n\nJITINTERFACE_HRESULT allocPgoInstrumentationBySchema(\n          CORINFO_METHOD_HANDLE ftnHnd,\n          ICorJitInfo::PgoInstrumentationSchema* pSchema,\n          uint32_t countSchemaItems,\n          uint8_t** pInstrumentationData) override;\n\nvoid recordCallSite(\n          uint32_t instrOffset,\n          CORINFO_SIG_INFO* callSig,\n          CORINFO_METHOD_HANDLE methodHandle) override;\n\nvoid recordRelocation(\n          void* location,\n          void* locationRW,\n          void* target,\n          uint16_t fRelocType,\n          uint16_t slotNum,\n          int32_t addlDelta) override;\n\nuint16_t getRelocTypeHint(\n          void* target) override;\n\nuint32_t getExpectedTargetArchitecture() override;\n\nuint32_t getJitFlags(\n          CORJIT_FLAGS* flags,\n          uint32_t sizeInBytes) override;\n\n/**********************************************************************************/\n// clang-format on\n/**********************************************************************************/\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/il_kywd.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n//\n// COM+ IL keywords, symbols and values\n//\n// This is the master table used in ILASM (asmparse.y)\n// and ILDASM (dis.cpp)\n// symbols and values are defined in asmparse.y\n// and not used in dis.cpp\n//\n\n#ifndef __IL_KYWD_H_\n#define __IL_KYWD_H_\n\n    KYWD( \"void\",           VOID_,              NO_VALUE )\n    KYWD( \"bool\",           BOOL_,              NO_VALUE )\n    KYWD( \"char\",           CHAR_,              NO_VALUE )\n    KYWD( \"wchar\",          CHAR_,              NO_VALUE )\n    KYWD( \"int\",            INT_,               NO_VALUE )\n    KYWD( \"int8\",           INT8_,              NO_VALUE )\n    KYWD( \"int16\",          INT16_,             NO_VALUE )\n    KYWD( \"int32\",          INT32_,             NO_VALUE )\n    KYWD( \"int64\",          INT64_,             NO_VALUE )\n    KYWD( \"uint\",           UINT_,              NO_VALUE )\n    KYWD( \"uint8\",          UINT8_,             NO_VALUE )\n    KYWD( \"uint16\",         UINT16_,            NO_VALUE )\n    KYWD( \"uint32\",         UINT32_,            NO_VALUE )\n    KYWD( \"uint64\",         UINT64_,            NO_VALUE )\n    KYWD( \"float\",          FLOAT_,             NO_VALUE )\n    KYWD( \"float32\",        FLOAT32_,           NO_VALUE )\n    KYWD( \"float64\",        FLOAT64_,           NO_VALUE )\n    KYWD( \"refany\",         TYPEDREF_,          NO_VALUE )\n    KYWD( \"typedref\",       TYPEDREF_,          NO_VALUE )\n    KYWD( \"object\",         OBJECT_,            NO_VALUE )\n    KYWD( \"string\",         STRING_,            NO_VALUE )\n    KYWD( \"native\",         NATIVE_,            NO_VALUE )\n    KYWD( \"unsigned\",       UNSIGNED_,          NO_VALUE )\n    KYWD( \"value\",          VALUE_,             NO_VALUE )\n    KYWD( \"valuetype\",      VALUETYPE_,         NO_VALUE )\n    KYWD( \"class\",          CLASS_,             NO_VALUE )\n    KYWD( \"byreflike\",      BYREFLIKE_,         NO_VALUE )\n    KYWD( \"vararg\",         VARARG_,            NO_VALUE )\n    KYWD( \"default\",        DEFAULT_,           NO_VALUE )\n    KYWD( \"stdcall\",        STDCALL_,           NO_VALUE )\n    KYWD( \"thiscall\",       THISCALL_,          NO_VALUE )\n    KYWD( \"fastcall\",       FASTCALL_,          NO_VALUE )\n    KYWD( \"unmanaged\",      UNMANAGED_,         NO_VALUE )\n    KYWD( \"beforefieldinit\",BEFOREFIELDINIT_,   NO_VALUE )\n    KYWD( \"instance\",       INSTANCE_,          NO_VALUE )\n    KYWD( \"filter\",         FILTER_,            NO_VALUE )\n    KYWD( \"catch\",          CATCH_,             NO_VALUE )\n    KYWD( \"static\",         STATIC_ ,           NO_VALUE )\n    KYWD( \"public\",         PUBLIC_,            NO_VALUE )\n    KYWD( \"private\",        PRIVATE_,           NO_VALUE )\n    KYWD( \"forwarder\",      FORWARDER_,         NO_VALUE )\n    KYWD( \"synchronized\",   SYNCHRONIZED_,      NO_VALUE )\n    KYWD( \"interface\",      INTERFACE_,         NO_VALUE )\n    KYWD( \"extends\",        EXTENDS_,           NO_VALUE )\n    KYWD( \"implements\",     IMPLEMENTS_,        NO_VALUE )\n    KYWD( \"handler\",        HANDLER_,           NO_VALUE )\n    KYWD( \"finally\",        FINALLY_,           NO_VALUE )\n    KYWD( \"fault\",          FAULT_,             NO_VALUE )\n    KYWD( \"to\",             TO_,                NO_VALUE )\n    KYWD( \"abstract\",       ABSTRACT_,          NO_VALUE )\n    KYWD( \"auto\",           AUTO_,              NO_VALUE )\n    KYWD( \"sequential\",     SEQUENTIAL_,        NO_VALUE )\n    KYWD( \"explicit\",       EXPLICIT_,          NO_VALUE )\n    KYWD( \"ansi\",           ANSI_,              NO_VALUE )\n    KYWD( \"unicode\",        UNICODE_,           NO_VALUE )\n    KYWD( \"autochar\",       AUTOCHAR_,          NO_VALUE )\n    KYWD( \"import\",         IMPORT_,            NO_VALUE )\n    KYWD( \"enum\",           ENUM_,              NO_VALUE )\n    KYWD( \"virtual\",        VIRTUAL_,           NO_VALUE )\n    KYWD( \"strict\",         STRICT_,            NO_VALUE )\n    KYWD( \"il\",             CIL_,               NO_VALUE )\n    KYWD( \"cil\",            CIL_,               NO_VALUE )\n    KYWD( \"optil\",          OPTIL_,             NO_VALUE )\n    KYWD( \"managed\",        MANAGED_,           NO_VALUE )\n    KYWD( \"preservesig\",    PRESERVESIG_,       NO_VALUE )\n    KYWD( \"runtime\",        RUNTIME_,           NO_VALUE )\n    KYWD( \"method\",         METHOD_,            NO_VALUE )\n    KYWD( \"field\",          FIELD_,             NO_VALUE )\n    KYWD( \"property\",       PROPERTY_,          NO_VALUE )\n    KYWD( \"bytearray\",      BYTEARRAY_,         NO_VALUE )\n    KYWD( \"final\",          FINAL_,             NO_VALUE )\n    KYWD( \"sealed\",         SEALED_,            NO_VALUE )\n    KYWD( \"specialname\",    SPECIALNAME_,       NO_VALUE )\n    KYWD( \"family\",         FAMILY_,            NO_VALUE )\n    KYWD( \"assembly\",       ASSEMBLY_,          NO_VALUE )\n    KYWD( \"famandassem\",    FAMANDASSEM_,       NO_VALUE )\n    KYWD( \"famorassem\",     FAMORASSEM_,        NO_VALUE )\n    KYWD( \"privatescope\",   PRIVATESCOPE_,      NO_VALUE )\n    KYWD( \"nested\",         NESTED_,            NO_VALUE )\n    KYWD( \"hidebysig\",      HIDEBYSIG_,         NO_VALUE )\n    KYWD( \"newslot\",        NEWSLOT_,           NO_VALUE )\n    KYWD( \"aggressiveinlining\",AGGRESSIVEINLINING_,NO_VALUE )\n    KYWD( \"rtspecialname\",  RTSPECIALNAME_,     NO_VALUE )\n    KYWD( \"pinvokeimpl\",    PINVOKEIMPL_,       NO_VALUE )\n    KYWD( \"unmanagedexp\",   UNMANAGEDEXP_,      NO_VALUE )\n    KYWD( \"reqsecobj\",      REQSECOBJ_,         NO_VALUE )\n    KYWD( \".ctor\",          _CTOR,              NO_VALUE )\n    KYWD( \".cctor\",         _CCTOR,             NO_VALUE )\n    KYWD( \"initonly\",       INITONLY_,          NO_VALUE )\n    KYWD( \"literal\",        LITERAL_,           NO_VALUE )\n    KYWD( \"notserialized\",  NOTSERIALIZED_,     NO_VALUE )\n    KYWD( \"forwardref\",     FORWARDREF_,        NO_VALUE )\n    KYWD( \"internalcall\",   INTERNALCALL_,      NO_VALUE )\n    KYWD( \"noinlining\",     NOINLINING_,        NO_VALUE )\n    KYWD( \"nooptimization\", NOOPTIMIZATION_,    NO_VALUE )\n    KYWD( \"aggressiveoptimization\", AGGRESSIVEOPTIMIZATION_, NO_VALUE )\n    KYWD( \"nomangle\",       NOMANGLE_,          NO_VALUE )\n    KYWD( \"lasterr\",        LASTERR_,           NO_VALUE )\n    KYWD( \"winapi\",         WINAPI_,            NO_VALUE )\n    KYWD( \"cdecl\",          CDECL_,             NO_VALUE )\n    KYWD( \"as\",             AS_,                NO_VALUE )\n    KYWD( \"pinned\",         PINNED_,            NO_VALUE )\n    KYWD( \"modreq\",         MODREQ_,            NO_VALUE )\n    KYWD( \"modopt\",         MODOPT_,            NO_VALUE )\n    KYWD( \"serializable\",   SERIALIZABLE_,      NO_VALUE )\n    KYWD( \"at\",             AT_,                NO_VALUE )\n    KYWD( \"tls\",            TLS_,               NO_VALUE )\n    KYWD( \"true\",           TRUE_,              NO_VALUE )\n    KYWD( \"false\",          FALSE_,             NO_VALUE )\n    KYWD( \"on\",             ON_,                NO_VALUE )\n    KYWD( \"off\",            OFF_,               NO_VALUE )\n    KYWD( \"bestfit\",        BESTFIT_,           NO_VALUE )\n    KYWD( \"charmaperror\",   CHARMAPERROR_,      NO_VALUE )\n\n        /* assembler directives */\n    KYWD( \".class\",         _CLASS,             NO_VALUE )\n    KYWD( \".this\",          _THIS,              NO_VALUE )\n    KYWD( \".base\",          _BASE,              NO_VALUE )\n    KYWD( \".nester\",        _NESTER,            NO_VALUE )\n    KYWD( \".namespace\",     _NAMESPACE,         NO_VALUE )\n    KYWD( \".method\",        _METHOD,            NO_VALUE )\n    KYWD( \".field\",         _FIELD,             NO_VALUE )\n    KYWD( \".emitbyte\",      _EMITBYTE,          NO_VALUE )\n    KYWD( \".try\",           _TRY,               NO_VALUE )\n    KYWD( \".maxstack\",      _MAXSTACK,          NO_VALUE )\n    KYWD( \".locals\",        _LOCALS,            NO_VALUE )\n    KYWD( \".entrypoint\",    _ENTRYPOINT,        NO_VALUE )\n    KYWD( \".zeroinit\",      _ZEROINIT,          NO_VALUE )\n    KYWD( \".data\",          _DATA,              NO_VALUE )\n    KYWD( \".param\",         _PARAM,             NO_VALUE )\n\n    KYWD( \".event\",         _EVENT,             NO_VALUE )\n    KYWD( \".addon\",         _ADDON,             NO_VALUE )\n    KYWD( \".removeon\",      _REMOVEON,          NO_VALUE )\n    KYWD( \".fire\",          _FIRE,              NO_VALUE )\n    KYWD( \".other\",         _OTHER,             NO_VALUE )\n\n    KYWD( \".property\",      _PROPERTY,          NO_VALUE )\n    KYWD( \".set\",           _SET,               NO_VALUE )\n    KYWD( \".get\",           _GET,               NO_VALUE )\n\n    KYWD( \".permission\",    _PERMISSION,        NO_VALUE )\n    KYWD( \".permissionset\", _PERMISSIONSET,     NO_VALUE )\n\n        /* security actions */\n    KYWD( \"request\",        REQUEST_,           NO_VALUE )\n    KYWD( \"demand\",         DEMAND_,            NO_VALUE )\n    KYWD( \"assert\",         ASSERT_,            NO_VALUE )\n    KYWD( \"deny\",           DENY_,              NO_VALUE )\n    KYWD( \"permitonly\",     PERMITONLY_,        NO_VALUE )\n    KYWD( \"linkcheck\",      LINKCHECK_,         NO_VALUE )\n    KYWD( \"inheritcheck\",   INHERITCHECK_,      NO_VALUE )\n    KYWD( \"reqmin\",         REQMIN_,            NO_VALUE )\n    KYWD( \"reqopt\",         REQOPT_,            NO_VALUE )\n    KYWD( \"reqrefuse\",      REQREFUSE_,         NO_VALUE )\n    KYWD( \"prejitgrant\",    PREJITGRANT_,       NO_VALUE )\n    KYWD( \"prejitdeny\",     PREJITDENY_,        NO_VALUE )\n    KYWD( \"noncasdemand\",   NONCASDEMAND_,      NO_VALUE )\n    KYWD( \"noncaslinkdemand\",NONCASLINKDEMAND_, NO_VALUE )\n    KYWD( \"noncasinheritance\",NONCASINHERITANCE_,NO_VALUE )\n\n        /* extern debug data specifier */\n    KYWD( \".line\",          _LINE,              NO_VALUE )\n    KYWD( \".language\",      _LANGUAGE,          NO_VALUE )\n    KYWD( \"#line\",          P_LINE,             NO_VALUE )\n        /* custom value specifier */\n    KYWD( \".custom\",        _CUSTOM,            NO_VALUE )\n        /* IL method attribute */\n    KYWD( \"init\",           INIT_,              NO_VALUE )\n        /* Class layout directives */\n    KYWD( \".size\",          _SIZE,              NO_VALUE )\n    KYWD( \".pack\",          _PACK,              NO_VALUE )\n        /* Manifest-related keywords */\n    KYWD( \".file\",          _FILE,              NO_VALUE )\n    KYWD( \"nometadata\",     NOMETADATA_,        NO_VALUE )\n    KYWD( \".hash\",          _HASH,              NO_VALUE )\n    KYWD( \".assembly\",      _ASSEMBLY,          NO_VALUE )\n    KYWD( \"retargetable\",   RETARGETABLE_,      NO_VALUE )\n    KYWD( \"windowsruntime\", WINDOWSRUNTIME_,    NO_VALUE )\n    KYWD( \"noplatform\",     NOPLATFORM_,        NO_VALUE )\n    KYWD( \"legacy\",         LEGACY_,            NO_VALUE )\n    KYWD( \"library\",        LIBRARY_,           NO_VALUE )\n    KYWD( \"x86\",            X86_,               NO_VALUE )\n    KYWD( \"amd64\",          AMD64_,             NO_VALUE )\n    KYWD( \"arm\",            ARM_,               NO_VALUE )\n    KYWD( \"arm64\",          ARM64_,             NO_VALUE )\n    KYWD( \".publickey\",     _PUBLICKEY,         NO_VALUE )\n    KYWD( \".publickeytoken\",_PUBLICKEYTOKEN,    NO_VALUE )\n    KYWD( \"algorithm\",      ALGORITHM_,         NO_VALUE )\n    KYWD( \".ver\",           _VER,               NO_VALUE )\n    KYWD( \".locale\",        _LOCALE,            NO_VALUE )\n    KYWD( \"extern\",         EXTERN_,            NO_VALUE )\n    KYWD( \".export\",        _EXPORT,            NO_VALUE )\n    KYWD( \".manifestres\",   _MRESOURCE,         NO_VALUE )\n    KYWD( \".mresource\",     _MRESOURCE,         NO_VALUE )\n    KYWD( \".module\",        _MODULE,            NO_VALUE )\n        /* Field marshaling keywords */\n    KYWD( \"marshal\",        MARSHAL_,           NO_VALUE )\n    KYWD( \"custom\",         CUSTOM_,            NO_VALUE )\n    KYWD( \"sysstring\",      SYSSTRING_,         NO_VALUE )\n    KYWD( \"fixed\",          FIXED_,             NO_VALUE )\n    KYWD( \"variant\",        VARIANT_,           NO_VALUE )\n    KYWD( \"currency\",       CURRENCY_,          NO_VALUE )\n    KYWD( \"syschar\",        SYSCHAR_,           NO_VALUE )\n    KYWD( \"decimal\",        DECIMAL_,           NO_VALUE )\n    KYWD( \"date\",           DATE_,              NO_VALUE )\n    KYWD( \"bstr\",           BSTR_,              NO_VALUE )\n    KYWD( \"tbstr\",          TBSTR_,             NO_VALUE )\n    KYWD( \"lpstr\",          LPSTR_,             NO_VALUE )\n    KYWD( \"lpwstr\",         LPWSTR_,            NO_VALUE )\n    KYWD( \"lptstr\",         LPTSTR_,            NO_VALUE )\n    KYWD( \"objectref\",      OBJECTREF_,         NO_VALUE )\n    KYWD( \"iunknown\",       IUNKNOWN_,          NO_VALUE )\n    KYWD( \"idispatch\",      IDISPATCH_,         NO_VALUE )\n    KYWD( \"iidparam\",       IIDPARAM_,          NO_VALUE )\n    KYWD( \"struct\",         STRUCT_,            NO_VALUE )\n    KYWD( \"safearray\",      SAFEARRAY_,         NO_VALUE )\n    KYWD( \"byvalstr\",       BYVALSTR_,          NO_VALUE )\n    KYWD( \"lpvoid\",         LPVOID_,            NO_VALUE )\n    KYWD( \"any\",            ANY_,               NO_VALUE )\n    KYWD( \"array\",          ARRAY_,             NO_VALUE )\n    KYWD( \"lpstruct\",       LPSTRUCT_,          NO_VALUE )\n        /* VTable fixup keywords */\n    KYWD( \".vtfixup\",       _VTFIXUP,           NO_VALUE )\n    KYWD( \"fromunmanaged\",  FROMUNMANAGED_,     NO_VALUE )\n    KYWD( \"retainappdomain\",RETAINAPPDOMAIN_,   NO_VALUE )\n    KYWD( \"callmostderived\",CALLMOSTDERIVED_,   NO_VALUE )\n    KYWD( \".vtentry\",       _VTENTRY,           NO_VALUE )\n        /* Parameter attributes */\n    KYWD( \"in\",             IN_,                NO_VALUE )\n    KYWD( \"out\",            OUT_,               NO_VALUE )\n    KYWD( \"opt\",            OPT_,               NO_VALUE )\n        /* Method implementations */\n    KYWD( \".override\",      _OVERRIDE,          NO_VALUE )\n    KYWD( \"with\",           WITH_,              NO_VALUE )\n        /* VariantType keywords */\n    KYWD( \"null\",           NULL_,              NO_VALUE )\n    KYWD( \"error\",          ERROR_,             NO_VALUE )\n    KYWD( \"hresult\",        HRESULT_,           NO_VALUE )\n    KYWD( \"carray\",         CARRAY_,            NO_VALUE )\n    KYWD( \"userdefined\",    USERDEFINED_,       NO_VALUE )\n    KYWD( \"record\",         RECORD_,            NO_VALUE )\n    KYWD( \"filetime\",       FILETIME_,          NO_VALUE )\n    KYWD( \"blob\",           BLOB_,              NO_VALUE )\n    KYWD( \"stream\",         STREAM_,            NO_VALUE )\n    KYWD( \"storage\",        STORAGE_,           NO_VALUE )\n    KYWD( \"streamed_object\",STREAMED_OBJECT_,   NO_VALUE )\n    KYWD( \"stored_object\",  STORED_OBJECT_,     NO_VALUE )\n    KYWD( \"blob_object\",    BLOB_OBJECT_,       NO_VALUE )\n    KYWD( \"cf\",             CF_,                NO_VALUE )\n    KYWD( \"clsid\",          CLSID_,             NO_VALUE )\n    KYWD( \"vector\",         VECTOR_,            NO_VALUE )\n                /* Null reference keyword for InitOpt */\n    KYWD( \"nullref\",        NULLREF_,           NO_VALUE )\n    KYWD( \"type\",           TYPE_,              NO_VALUE )\n    KYWD( \".interfaceimpl\", _INTERFACEIMPL,     NO_VALUE )\n                /* Header flags keywords */\n    KYWD( \".subsystem\",     _SUBSYSTEM,         NO_VALUE )\n    KYWD( \".corflags\",      _CORFLAGS,          NO_VALUE )\n    KYWD( \"alignment\",      ALIGNMENT_,         NO_VALUE )\n    KYWD( \".imagebase\",     _IMAGEBASE,         NO_VALUE )\n    KYWD( \".stackreserve\",  _STACKRESERVE,      NO_VALUE )\n        /* Explicit binary flag specification keywords */\n    KYWD( \"flags\",          FLAGS_,             NO_VALUE )\n    KYWD( \"callconv\",       CALLCONV_,          NO_VALUE )\n    KYWD( \"mdtoken\",        MDTOKEN_,           NO_VALUE )\n\n        /* Some ILASM-specific syntactic sugar */\n    KYWD( \".typedef\",       _TYPEDEF,           NO_VALUE )\n    KYWD( \".template\",      _TEMPLATE,          NO_VALUE )\n    KYWD( \".typelist\",      _TYPELIST,          NO_VALUE )\n    KYWD( \".mscorlib\",      _MSCORLIB,          NO_VALUE )\n\n    /* Compilation control keywords  */\n    KYWD( \"#define\",        P_DEFINE,           NO_VALUE )\n    KYWD( \"#undef\",         P_UNDEF,            NO_VALUE )\n    KYWD( \"#ifdef\",         P_IFDEF,            NO_VALUE )\n    KYWD( \"#ifndef\",        P_IFNDEF,           NO_VALUE )\n    KYWD( \"#else\",          P_ELSE,             NO_VALUE )\n    KYWD( \"#endif\",         P_ENDIF,            NO_VALUE )\n    KYWD( \"#include\",       P_INCLUDE,          NO_VALUE )\n\n    KYWD( \"constraint\",     CONSTRAINT_,        NO_VALUE )\n\n\n    /* Deprecated keywords */\n    KYWD( \".vtable\",        _VTABLE,            NO_VALUE )\n\n\n    KYWD( \"^THE_END^\",      0,                  NO_VALUE )\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ilformatter.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n/***************************************************************************/\n/*                             ILFormatter.h                               */\n/***************************************************************************/\n\n#ifndef ILFormatter_h\n#define ILFormatter_h\n\n#include \"opinfo.h\"\n#include \"outstring.h\"\n\nstruct IMetaDataImport;\n\n#define INVALID_IL_OFFSET 0x80000000\n\n/***************************************************************************/\nclass ILFormatter {\npublic:\n\tILFormatter() : start(0), targetStart(0), stackStart(0) {}\n\n\tILFormatter(IMetaDataImport* aMeta, const BYTE* aStart,\n                const BYTE* aLimit, unsigned maxStack, const COR_ILMETHOD_SECT_EH* eh)\n\t\t: targetStart(0), stackStart(0) {\n\t\tinit(aMeta, aStart, aLimit, maxStack, eh);\n\t\t}\n    ~ILFormatter() { delete [] stackStart; delete [] targetStart; }\n\n\tvoid init(IMetaDataImport* aMeta, const BYTE* aStart,\n              const BYTE* aLimit, unsigned maxStack, const COR_ILMETHOD_SECT_EH* eh);\n\tconst BYTE* formatStatement(const BYTE* stmtIL, OutString* out);\n\tconst BYTE* formatInstr(const BYTE* instrIL, OutString* out);\nprivate:\n\n\tvoid formatInstrArgs(OpInfo op, OpArgsVal arg, OutString* out, size_t curIP=INVALID_IL_OFFSET);\n    void formatArgs(unsigned numArgs, OutString* out);\n    void spillStack(OutString* out);\n    void setStackAsTarget(size_t ilOffset);\n    void setTarget(size_t ilOffset, size_t depth);\n\nprivate:\n\tconst BYTE* start;\t\t\t\t// keeps us sane\n\tconst BYTE* limit;\n\tIMetaDataImport* meta;\t\t\t// used to parse tokens etc\n\n    struct StackEntry {\n        OutString val;\n        int prec;\n    };\n\n    struct Target {\n        size_t ilOffset;\n        size_t stackDepth;\n    };\n\n    Target* targetStart;\n    Target* targetEnd;\n    Target* targetCur;\n\n    size_t stackDepth();\n    void pushAndClear(OutString* val, int prec);\n\tOutString* pop(int prec = 0);\n\tOutString* top();\n    void popN(size_t num);\n\n\tStackEntry* stackStart;\n\tStackEntry* stackEnd;\n\tStackEntry* stackCur;   \t// points at the next slot to fill\n\n};\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/internalunknownimpl.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n//\n// InternalUnknownImpl.h\n//\n// Defines utility class IUnknownCommon, which provides default\n// implementations for IUnknown's AddRef, Release, and QueryInterface methods.\n//\n// Use: a class that implements one or more interfaces should derive from\n// IUnknownCommon with a template parameter list consisting of the\n// list of implemented interfaces and their IIDs.\n//\n// Example:\n//   class MyInterfacesImpl :\n//     public IUnknownCommon<MyInterface, IID_MyInterface>\n//   { ... };\n//\n// IUnknownCommon will provide base AddRef and Release semantics, and will\n// also provide an implementation of QueryInterface that will evaluate the\n// arguments against the set of supported interfaces and return the\n// appropriate result.\n//\n\n//\n//*****************************************************************************\n\n#ifndef __InternalUnknownImpl_h__\n#define __InternalUnknownImpl_h__\n\n#include <winnt.h>\n#include \"winwrap.h\"\n#include \"contract.h\"\n#include \"ex.h\"\n#include \"volatile.h\"\n#include \"debugmacros.h\"\n\ntemplate <class T, REFIID IID_T>\nclass IUnknownCommon : public T\n{\nprotected:\n    LONG m_cRef;\n\npublic:\n    IUnknownCommon()\n        : m_cRef(0)\n    {\n    }\n\n    // Add a virtual destructor to force derived types to also have virtual destructors.\n    virtual ~IUnknownCommon()\n    {\n    }\n\n    STDMETHOD_(ULONG, AddRef())\n    {\n        return InterlockedIncrement(&m_cRef);\n    }\n\n    STDMETHOD_(ULONG, Release())\n    {\n        _ASSERTE(m_cRef > 0);\n\n        ULONG cRef = InterlockedDecrement(&m_cRef);\n\n        if (cRef == 0)\n            delete this; // Relies on virtual dtor to work properly.\n\n        return cRef;\n    }\n\n    STDMETHOD(QueryInterface(REFIID riid, void** ppObj))\n    {\n        if (ppObj == NULL)\n            return E_INVALIDARG;\n\n        if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_T))\n        {\n            AddRef();\n            *ppObj = static_cast<T*>(this);\n            return S_OK;\n        }\n\n        *ppObj = NULL;\n        return E_NOINTERFACE;\n    }\n};\n\ntemplate <class T, REFIID IID_T, class T2, REFIID IID_T2>\nclass IUnknownCommon2 : public T, public T2\n{\nprotected:\n    LONG m_cRef;\n\npublic:\n    IUnknownCommon2()\n        : m_cRef(0)\n    {\n    }\n\n    // Add a virtual destructor to force derived types to also have virtual destructors.\n    virtual ~IUnknownCommon2()\n    {\n    }\n\n    STDMETHOD_(ULONG, AddRef())\n    {\n        return InterlockedIncrement(&m_cRef);\n    }\n\n    STDMETHOD_(ULONG, Release())\n    {\n        _ASSERTE(m_cRef > 0);\n\n        ULONG cRef = InterlockedDecrement(&m_cRef);\n\n        if (cRef == 0)\n            delete this; // Relies on virtual dtor to work properly.\n\n        return cRef;\n    }\n\n    STDMETHOD(QueryInterface(REFIID riid, void** ppObj))\n    {\n        if (ppObj == NULL)\n            return E_INVALIDARG;\n\n        if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_T))\n        {\n            AddRef();\n            *ppObj = static_cast<T*>(this);\n            return S_OK;\n        }\n        else if (IsEqualIID(riid, IID_T2))\n        {\n            AddRef();\n            *ppObj = static_cast<T2*>(this);\n            return S_OK;\n        }\n\n        *ppObj = NULL;\n        return E_NOINTERFACE;\n    }\n};\n\n#endif // __InternalUnknownImpl_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/intrinsic.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// Intrinsic.h\n//\n// Force several very useful functions to be intrinsic, which means that the\n// compiler will generate code inline for the functions instead of generating\n// a call to the function.\n//\n//*****************************************************************************\n\n#ifndef __intrinsic_h__\n#define __intrinsic_h__\n\n#ifdef _MSC_VER\n#pragma intrinsic(memcmp)\n#pragma intrinsic(memcpy)\n#pragma intrinsic(memset)\n#pragma intrinsic(strcmp)\n#pragma intrinsic(strcpy)\n#pragma intrinsic(strlen)\n#endif  // defined(_MSC_VER)\n\n#endif // __intrinsic_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/iterator.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// Iterator.h\n// ---------------------------------------------------------------------------\n\n// ================================================================================\n// Iterator pattern:\n//\n// This pattern is similar to the STL iterator pattern.  It basically consists of\n// wrapping an \"iteration variable\" in an object, and providing pointer-like operators\n// on the iterator. Example usage:\n//\n// for (Iterator start = foo->Begin(), end = foo->End(); start != end; start++)\n// {\n//      // use foo, start\n// }\n//\n// There are 3 levels of iterator functionality\n//      1. Enumerator (STL forward) - only go forward one at a time\n//          Enumerators have the following operations:\n//              operator * : access current element as ref\n//              operator -> : access current element as ptr\n//              operator++ : go to the next element\n//              operator==, operator!= : compare to another enumerator\n//\n//\n//      2. Scanner (STL bidirectional) - backward or forward one at a time\n//          Scanners have all the functionality of enumerators, plus:\n//              operator-- : go backward one element\n//\n//      3. Indexer (STL random access)  - skip around arbitrarily\n//          Indexers have all the functionality of scanners, plus:\n//              operator[] : access the element at index from iterator as ref\n//              operator+= : advance iterator by index\n//              operator+ : return new iterator at index from iterator\n//              operator-= : rewind iterator by index\n//              operator- : return new iterator at index back from iterator\n//              operator <, operator <=, operator >, operator>= :\n//                  range comparison on two indexers\n//\n// The object being iterated should define the following methods:\n//      Begin()             return an iterator starting at the first element\n//      End()               return an iterator just past the last element\n//\n// Iterator types are normally defined as member types named \"Iterator\", no matter\n// what their functionality level is.\n// ================================================================================\n\n\n#ifndef ITERATOR_H_\n#define ITERATOR_H_\n\n#include \"contract.h\"\n\nnamespace HIDDEN {\n// These prototypes are not for direct use - they are only here to illustrate the\n// iterator pattern\n\ntemplate <typename CONTAINER, typename ELEMENT>\nclass ScannerPrototype\n{\n  public:\n\n    typedef ScannerPrototype<CONTAINER, ELEMENT> Iterator;\n\n    ELEMENT &operator*();\n    ELEMENT *operator->();\n\n    Iterator &operator++();\n    Iterator operator++(int);\n    Iterator &operator--();\n    Iterator operator--(int);\n\n    bool operator==(const Iterator &i);\n    bool operator!=(const Iterator &i);\n};\n\ntemplate <typename CONTAINER, typename ELEMENT>\nclass EnumeratorPrototype\n{\n  public:\n\n    typedef EnumeratorPrototype<CONTAINER, ELEMENT> Iterator;\n\n    ELEMENT &operator*();\n    ELEMENT *operator->();\n\n    Iterator &operator++();\n    Iterator operator++(int);\n\n    bool operator==(const Iterator &i);\n    bool operator!=(const Iterator &i);\n};\n\ntemplate <typename CONTAINER, typename ELEMENT>\nclass IndexerPrototype\n{\n  public:\n    typedef IndexerPrototype<CONTAINER, ELEMENT> Iterator;\n\n    ELEMENT &operator*();\n    ELEMENT *operator->();\n    ELEMENT &operator[](int index);\n\n    Iterator &operator++();\n    Iterator operator++(int);\n    Iterator &operator--();\n    Iterator operator--(int);\n\n    Iterator &operator+=(SCOUNT_T index);\n    Iterator &operator-=(SCOUNT_T index);\n\n    Iterator operator+(SCOUNT_T index);\n    Iterator operator-(SCOUNT_T index);\n\n    SCOUNT_T operator-(Iterator &i);\n\n    bool operator==(const Iterator &i);\n    bool operator!=(const Iterator &i);\n    bool operator<(const Iterator &i);\n    bool operator<=(const Iterator &i);\n    bool operator>(const Iterator &i);\n    bool operator>=(const Iterator &i);\n};\n\ntemplate <typename ELEMENT>\nclass EnumerablePrototype\n{\n    typedef EnumeratorPrototype<EnumerablePrototype, ELEMENT> Iterator;\n\n    Iterator Begin();\n    Iterator End();\n};\n\ntemplate <typename ELEMENT>\nclass ScannablePrototype\n{\n    typedef ScannerPrototype<ScannablePrototype, ELEMENT> Iterator;\n\n    Iterator Begin();\n    Iterator End();\n};\n\ntemplate <typename ELEMENT>\nclass IndexablePrototype\n{\n    typedef IndexerPrototype<IndexablePrototype, ELEMENT> Iterator;\n\n    Iterator Begin();\n    Iterator End();\n};\n\n};\n\n// --------------------------------------------------------------------------------\n// EnumeratorBase, ScannerBase, and IndexerBase are abstract classes\n// describing basic operations for iterator functionality at the different levels.\n//\n// You\n// 1. Use the classes as a pattern (don't derive from them), and plug in your own\n//      class into the Enumerator/Scanner/Indexer templates below.\n// 2. Subclass the AbstractEnumerator/AbstractScanner/AbstractIndexer classes\n// --------------------------------------------------------------------------------\n\nnamespace HIDDEN\n{\n// These prototypes are not for direct use - they are only here to illustrate the\n// pattern of the BASE class for the Iterator templates\n\ntemplate <typename ELEMENT, typename CONTAINER>\nclass EnumeratorBasePrototype\n{\n  protected:\n    EnumeratorBasePrototype(CONTAINER *container, BOOL begin);\n    ELEMENT &Get() const;\n    void Next();\n    BOOL Equal(const EnumeratorBasePrototype &i) const;\n    CHECK DoCheck() const;\n};\n\ntemplate <typename ELEMENT, typename CONTAINER>\nclass ScannerBasePrototype\n{\n protected:\n    ScannerBasePrototype(CONTAINER *container, BOOL begin);\n    ELEMENT &Get() const;\n    void Next();\n    void Previous();\n    BOOL Equal(const ScannerBasePrototype &i) const;\n    CHECK DoCheck() const;\n};\n\ntemplate <typename ELEMENT, typename CONTAINER>\nclass IndexerBasePrototype\n{\n protected:\n    IndexerBasePrototype(CONTAINER *container, SCOUNT_T delta);\n    ELEMENT &GetAt(SCOUNT_T delta) const;\n    void Skip(SCOUNT_T delta);\n    SCOUNT_T Subtract(const IndexerBasePrototype &i) const;\n    CHECK DoCheck(SCOUNT_T delta) const;\n};\n\n};\n\n\ntemplate <typename CONTAINER>\nclass CheckedIteratorBase\n{\n  protected:\n#if defined(_DEBUG)\n    const CONTAINER *m_container;\n    int m_revision;\n#endif\n\n    CHECK CheckRevision() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n#if defined(_DEBUG) && (defined(_MSC_VER) || defined(__llvm__))\n        __if_exists(CONTAINER::m_revision)\n        {\n            CHECK_MSG(m_revision == m_container->m_revision,\n                      \"Use of Iterator after container has been modified\");\n        }\n#endif\n        CHECK_OK;\n    }\n\n    CheckedIteratorBase()\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n#if defined(_DEBUG)\n        m_container = NULL;\n#endif\n    }\n\n    CheckedIteratorBase(const CONTAINER *container)\n    {\n        LIMITED_METHOD_CONTRACT;\n#if defined(_DEBUG)\n        m_container = container;\n#if defined(_MSC_VER) || defined(__llvm__)\n        __if_exists(CONTAINER::m_revision)\n        {\n            m_revision = m_container->m_revision;\n        }\n#endif\n#endif\n    }\n\n    void Resync(const CONTAINER *container)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n\n#if defined(_DEBUG) && (defined(_MSC_VER) || defined(__llvm__))\n        __if_exists(CONTAINER::m_revision)\n        {\n            m_revision = m_container->m_revision;\n        }\n#endif\n    }\n\n#if defined(_DEBUG)\n    const CONTAINER *GetContainerDebug() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_container;\n    }\n#endif\n\n  public:\n    CHECK Check() const\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n        CHECK(CheckRevision());\n        CHECK_OK;\n    }\n\n    CHECK CheckContainer(const CONTAINER *container) const\n    {\n        WRAPPER_NO_CONTRACT;\n#if defined(_DEBUG)\n        CHECK(container == m_container);\n#endif\n        CHECK_OK;\n    }\n\n};\n\n\n// --------------------------------------------------------------------------------\n// Enumerator, Scanner, and Indexer provide a template to produce an iterator\n// on an existing class with a single iteration variable.\n//\n// The template takes 3 type parameters:\n// CONTAINER - type of object being interated on\n// ELEMENT - type of iteration\n// BASE - base type of the iteration.  This type must follow the pattern described\n//      by the above Prototypes\n// --------------------------------------------------------------------------------\n\ntemplate <typename ELEMENT, typename SUBTYPE>\nclass Enumerator\n{\n private:\n    const SUBTYPE *This() const\n    {\n        return (const SUBTYPE *) this;\n    }\n\n    SUBTYPE *This()\n    {\n        return (SUBTYPE *)this;\n    }\n\n  public:\n\n    Enumerator()\n    {\n    }\n\n    CHECK CheckIndex() const\n    {\n#if defined(_DEBUG)\n        CHECK(This()->DoCheck());\n#endif\n        CHECK_OK;\n    }\n\n    ELEMENT &operator*() const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(This()->CheckIndex());\n\n        return This()->Get();\n    }\n    ELEMENT *operator->() const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(This()->CheckIndex());\n\n        return &(This()->Get());\n    }\n    SUBTYPE &operator++()\n    {\n        PRECONDITION(CheckPointer(This()));\n\n        This()->Next();\n        return *This();\n    }\n    SUBTYPE operator++(int)\n    {\n        PRECONDITION(CheckPointer(This()));\n\n        SUBTYPE i = *This();\n        This()->Next();\n        return i;\n    }\n    bool operator==(const SUBTYPE &i) const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n\n        return This()->Equal(i);\n    }\n    bool operator!=(const SUBTYPE &i) const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n\n        return !This()->Equal(i);\n    }\n};\n\ntemplate <typename ELEMENT, typename SUBTYPE>\nclass Scanner\n{\n private:\n    const SUBTYPE *This() const\n    {\n        return (const SUBTYPE *)this;\n    }\n\n    SUBTYPE *This()\n    {\n        return (SUBTYPE *)this;\n    }\n\n  public:\n\n    Scanner()\n    {\n    }\n\n    CHECK CheckIndex() const\n    {\n#if defined(_DEBUG)\n        CHECK(This()->DoCheck());\n#endif\n        CHECK_OK;\n    }\n\n    ELEMENT &operator*() const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(This()->CheckIndex());\n\n        return This()->Get();\n    }\n    ELEMENT *operator->() const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(This()->CheckIndex());\n\n        return &This()->Get();\n    }\n    SUBTYPE &operator++()\n    {\n        PRECONDITION(CheckPointer(This()));\n\n        This()->Next();\n        return *This();\n    }\n    SUBTYPE operator++(int)\n    {\n        PRECONDITION(CheckPointer(This()));\n\n        SUBTYPE i = *This();\n        This()->Next();\n        return i;\n    }\n    SUBTYPE &operator--()\n    {\n        PRECONDITION(CheckPointer(This()));\n\n        This()->Previous();\n        return *This();\n    }\n    SUBTYPE operator--(int)\n    {\n        PRECONDITION(CheckPointer(this));\n\n        SUBTYPE i = *This();\n        This()->Previous();\n        return i;\n    }\n    bool operator==(const SUBTYPE &i) const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n\n        return This()->Equal(i);\n    }\n    bool operator!=(const SUBTYPE &i) const\n    {\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n\n        return !This()->Equal(i);\n    }\n};\n\ntemplate <typename ELEMENT, typename SUBTYPE>\nclass Indexer\n{\n private:\n    const SUBTYPE *This() const\n    {\n        return (const SUBTYPE *)this;\n    }\n\n    SUBTYPE *This()\n    {\n        return (SUBTYPE *)this;\n    }\n\n  public:\n\n    Indexer()\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n    }\n\n    CHECK CheckIndex() const\n    {\n#if defined(_DEBUG)\n        CHECK(This()->DoCheck(0));\n#endif\n        CHECK_OK;\n    }\n\n    CHECK CheckIndex(int index) const\n    {\n#if defined(_DEBUG)\n        CHECK(This()->DoCheck(index));\n#endif\n        CHECK_OK;\n    }\n\n    ELEMENT &operator*() const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(This()->CheckIndex(0));\n\n        return *(ELEMENT*)&This()->GetAt(0);\n    }\n    ELEMENT *operator->() const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(This()->CheckIndex(0));\n\n        return &This()->GetAt(0);\n    }\n    ELEMENT &operator[](int index) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(This()->CheckIndex(index));\n        return *(ELEMENT*)&This()->GetAt(index);\n    }\n    SUBTYPE &operator++()\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        This()->Skip(1);\n        return *This();\n    }\n    SUBTYPE operator++(int)\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        SUBTYPE i = *This();\n        This()->Skip(1);\n        return i;\n    }\n    SUBTYPE &operator--()\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        This()->Skip(-1);\n        return *This();\n    }\n    SUBTYPE operator--(int)\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        SUBTYPE i = *This();\n        This()->Skip(-1);\n        return i;\n    }\n    SUBTYPE &operator+=(SCOUNT_T index)\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        This()->Skip(index);\n        return *This();\n    }\n    SUBTYPE operator+(SCOUNT_T index) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        SUBTYPE i = *This();\n        i.Skip(index);\n        return i;\n    }\n    SUBTYPE &operator-=(SCOUNT_T index)\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        This()->Skip(-index);\n        return *This();\n    }\n    SUBTYPE operator-(SCOUNT_T index) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        SUBTYPE i = *This();\n        i.Skip(-index);\n        return i;\n    }\n    SCOUNT_T operator-(const SUBTYPE &i) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n\n        return This()->Subtract(i);\n    }\n    bool operator==(const SUBTYPE &i) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n\n        return This()->Subtract(i) == 0;\n    }\n    bool operator!=(const SUBTYPE &i) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n\n        return This()->Subtract(i) != 0;\n    }\n    bool operator<(const SUBTYPE &i) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n        return This()->Subtract(i) < 0;\n    }\n    bool operator<=(const SUBTYPE &i) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n        return This()->Subtract(i) <= 0;\n    }\n    bool operator>(const SUBTYPE &i) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n        return This()->Subtract(i) > 0;\n    }\n    bool operator>=(const SUBTYPE &i) const\n    {\n        WRAPPER_NO_CONTRACT;\n        PRECONDITION(CheckPointer(This()));\n        PRECONDITION(i.Check());\n        return This()->Subtract(i) >= 0;\n    }\n};\n\n#endif  // ITERATOR_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/jiteeversionguid.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n// #JITEEVersionIdentifier\n//\n// This GUID represents the version of the JIT/EE interface. Any time the interface between the JIT and\n// the EE changes (by adding or removing methods to any interface shared between them), this GUID should\n// be changed. This is the identifier verified by ICorJitCompiler::getVersionIdentifier().\n//\n// You can use \"uuidgen.exe -s\" to generate this value.\n//\n// Note that this file is parsed by some tools, namely superpmi.py, so make sure the first line is exactly\n// of the form:\n//\n//   constexpr GUID JITEEVersionIdentifier = { /* 1776ab48-edfa-49be-a11f-ec216b28174c */\n//\n// (without the leading slashes or spaces).\n//\n// See docs/project/updating-jitinterface.md for details\n//\n// **** NOTE TO INTEGRATORS:\n//\n// If there is a merge conflict here, because the version changed in two different places, you must\n// create a **NEW** GUID, not simply choose one or the other!\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//\n\n#ifndef GUID_DEFINED\ntypedef struct _GUID {\n    uint32_t   Data1;    // NOTE: diff from Win32, for LP64\n    uint16_t   Data2;\n    uint16_t   Data3;\n    uint8_t    Data4[ 8 ];\n} GUID;\ntypedef const GUID *LPCGUID;\n#define GUID_DEFINED\n#endif // !GUID_DEFINED\n\nconstexpr GUID JITEEVersionIdentifier = { /* 0330a175-dd05-4760-840f-a1a4c47284d3 */\n    0x330a175,\n    0xdd05,\n    0x4760,\n    {0x84, 0xf, 0xa1, 0xa4, 0xc4, 0x72, 0x84, 0xd3}\n  };\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//\n// END JITEEVersionIdentifier\n//\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/jithelpers.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// Allow multiple inclusion.\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n// The JIT/EE interface is versioned. By \"interface\", we mean mean any and all communication between the\n// JIT and the EE. Any time a change is made to the interface, the JIT/EE interface version identifier\n// must be updated. See code:JITEEVersionIdentifier for more information.\n//\n// THIS FILE IS PART OF THE JIT-EE INTERFACE.\n//\n// NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE\n//\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n\n#ifndef DYNAMICJITHELPER\n//I should never try to generate an alignment stub for a dynamic helper\n#define DYNAMICJITHELPER(code,fn,sig) JITHELPER(code,fn,sig)\n#endif\n\n\n// pfnHelper is set to NULL if it is a stubbed helper.\n// It will be set in InitJITHelpers2\n\n    JITHELPER(CORINFO_HELP_UNDEF,               NULL,               CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n\n    // Arithmetic\n    JITHELPER(CORINFO_HELP_DIV,                 JIT_Div,            CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_MOD,                 JIT_Mod,            CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_UDIV,                JIT_UDiv,           CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_UMOD,                JIT_UMod,           CORINFO_HELP_SIG_8_STACK)\n\n    // CORINFO_HELP_DBL2INT, CORINFO_HELP_DBL2UINT, and CORINFO_HELP_DBL2LONG get\n    // patched for CPUs that support SSE2 (P4 and above).\n#ifndef TARGET_64BIT\n    JITHELPER(CORINFO_HELP_LLSH,                JIT_LLsh,           CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_LRSH,                JIT_LRsh,           CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_LRSZ,                JIT_LRsz,           CORINFO_HELP_SIG_REG_ONLY)\n#else // !TARGET_64BIT\n    JITHELPER(CORINFO_HELP_LLSH,                NULL,               CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_LRSH,                NULL,               CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_LRSZ,                NULL,               CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n#endif // TARGET_64BIT\n    JITHELPER(CORINFO_HELP_LMUL,                JIT_LMul,           CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_LMUL_OVF,            JIT_LMulOvf,        CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_ULMUL_OVF,           JIT_ULMulOvf,       CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_LDIV,                JIT_LDiv,           CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_LMOD,                JIT_LMod,           CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_ULDIV,               JIT_ULDiv,          CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_ULMOD,               JIT_ULMod,          CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_LNG2DBL,             JIT_Lng2Dbl,        CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_ULNG2DBL,            JIT_ULng2Dbl,       CORINFO_HELP_SIG_8_STACK)\n    DYNAMICJITHELPER(CORINFO_HELP_DBL2INT,      JIT_Dbl2Lng,        CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_DBL2INT_OVF,         JIT_Dbl2IntOvf,     CORINFO_HELP_SIG_8_STACK)\n    DYNAMICJITHELPER(CORINFO_HELP_DBL2LNG,      JIT_Dbl2Lng,        CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_DBL2LNG_OVF,         JIT_Dbl2LngOvf,     CORINFO_HELP_SIG_8_STACK)\n    DYNAMICJITHELPER(CORINFO_HELP_DBL2UINT,     JIT_Dbl2Lng,        CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_DBL2UINT_OVF,        JIT_Dbl2UIntOvf,    CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_DBL2ULNG,            JIT_Dbl2ULng,       CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_DBL2ULNG_OVF,        JIT_Dbl2ULngOvf,    CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_FLTREM,              JIT_FltRem,         CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_DBLREM,              JIT_DblRem,         CORINFO_HELP_SIG_16_STACK)\n    JITHELPER(CORINFO_HELP_FLTROUND,            JIT_FloatRound,     CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_DBLROUND,            JIT_DoubleRound,    CORINFO_HELP_SIG_16_STACK)\n\n    // Allocating a new object\n    JITHELPER(CORINFO_HELP_NEWFAST,                     JIT_New,    CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST,             JIT_New,    CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_NEWSFAST_FINALIZE,           NULL,       CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8,      JIT_New,    CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_VC,          NULL,       CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_NEWSFAST_ALIGN8_FINALIZE,    NULL,       CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_NEW_MDARR,                   JIT_NewMDArr,CORINFO_HELP_SIG_4_STACK)\n    JITHELPER(CORINFO_HELP_NEWARR_1_DIRECT,             JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_OBJ,         JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_VC,          JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_NEWARR_1_ALIGN8,      JIT_NewArr1,CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_STRCNS,              JIT_StrCns,         CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_STRCNS_CURRENT_MODULE, NULL,             CORINFO_HELP_SIG_REG_ONLY)\n\n    // Object model\n    JITHELPER(CORINFO_HELP_INITCLASS,           JIT_InitClass,      CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_INITINSTCLASS,       JIT_InitInstantiatedClass, CORINFO_HELP_SIG_REG_ONLY)\n\n    // Casting helpers\n    DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFINTERFACE,    NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFARRAY,        NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFCLASS,        NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_ISINSTANCEOFANY,          NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_CHKCASTINTERFACE,         NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_CHKCASTARRAY,             NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_CHKCASTCLASS,             NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_CHKCASTANY,               NULL,   CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_CHKCASTCLASS_SPECIAL,     NULL,   CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_ISINSTANCEOF_EXCEPTION, JIT_IsInstanceOfException, CORINFO_HELP_SIG_REG_ONLY)\n\n    DYNAMICJITHELPER(CORINFO_HELP_BOX,          JIT_Box,            CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_BOX_NULLABLE,        JIT_Box,            CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_UNBOX,        NULL,               CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_UNBOX_NULLABLE,      JIT_Unbox_Nullable, CORINFO_HELP_SIG_4_STACK)\n\n    JITHELPER(CORINFO_HELP_GETREFANY,           JIT_GetRefAny,      CORINFO_HELP_SIG_8_STACK)\n    DYNAMICJITHELPER(CORINFO_HELP_ARRADDR_ST,   NULL,               CORINFO_HELP_SIG_4_STACK)\n    DYNAMICJITHELPER(CORINFO_HELP_LDELEMA_REF,  NULL,               CORINFO_HELP_SIG_4_STACK)\n\n    // Exceptions\n    JITHELPER(CORINFO_HELP_THROW,               IL_Throw,           CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_RETHROW,             IL_Rethrow,         CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_USER_BREAKPOINT,     JIT_UserBreakpoint, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_RNGCHKFAIL,          JIT_RngChkFail,     CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_OVERFLOW,            JIT_Overflow,       CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_THROWDIVZERO,        JIT_ThrowDivZero,   CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_THROWNULLREF,        JIT_ThrowNullRef,   CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_VERIFICATION,        IL_VerificationError,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_FAIL_FAST,           JIT_FailFast,       CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_METHOD_ACCESS_EXCEPTION,JIT_ThrowMethodAccessException, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_FIELD_ACCESS_EXCEPTION,JIT_ThrowFieldAccessException, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_CLASS_ACCESS_EXCEPTION,JIT_ThrowClassAccessException, CORINFO_HELP_SIG_REG_ONLY)\n\n#ifdef FEATURE_EH_FUNCLETS\n    JITHELPER(CORINFO_HELP_ENDCATCH,            NULL,               CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n#else\n    JITHELPER(CORINFO_HELP_ENDCATCH,            JIT_EndCatch,       CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n#endif\n\n    JITHELPER(CORINFO_HELP_MON_ENTER,               JIT_MonEnterWorker, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_MON_EXIT,                JIT_MonExitWorker, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_MON_ENTER_STATIC,        JIT_MonEnterStatic,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_MON_EXIT_STATIC,         JIT_MonExitStatic,CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_GETCLASSFROMMETHODPARAM, JIT_GetClassFromMethodParam, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSYNCFROMCLASSHANDLE,  JIT_GetSyncFromClassHandle, CORINFO_HELP_SIG_REG_ONLY)\n\n    // GC support\n    DYNAMICJITHELPER(CORINFO_HELP_STOP_FOR_GC,  JIT_RareDisableHelper,  CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_POLL_GC,             JIT_PollGC,         CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_STRESS_GC,           JIT_StressGC,       CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_CHECK_OBJ,           JIT_CheckObj,       CORINFO_HELP_SIG_REG_ONLY)\n\n    // GC Write barrier support\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF,   JIT_WriteBarrier,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF, JIT_CheckedWriteBarrier,CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_ASSIGN_REF_ENSURE_NONHEAP, JIT_WriteBarrierEnsureNonHeapTarget,CORINFO_HELP_SIG_REG_ONLY)\n\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_BYREF, JIT_ByRefWriteBarrier,CORINFO_HELP_SIG_NO_ALIGN_STUB)\n\n    JITHELPER(CORINFO_HELP_ASSIGN_STRUCT,       JIT_StructWriteBarrier,CORINFO_HELP_SIG_4_STACK)\n\n    // Accessing fields\n    JITHELPER(CORINFO_HELP_GETFIELD8,                   JIT_GetField8,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_SETFIELD8,                   JIT_SetField8,CORINFO_HELP_SIG_4_STACK)\n    JITHELPER(CORINFO_HELP_GETFIELD16,                  JIT_GetField16,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_SETFIELD16,                  JIT_SetField16,CORINFO_HELP_SIG_4_STACK)\n    JITHELPER(CORINFO_HELP_GETFIELD32,                  JIT_GetField32,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_SETFIELD32,                  JIT_SetField32,CORINFO_HELP_SIG_4_STACK)\n    JITHELPER(CORINFO_HELP_GETFIELD64,                  JIT_GetField64,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_SETFIELD64,                  JIT_SetField64,CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_GETFIELDOBJ,                 JIT_GetFieldObj,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_SETFIELDOBJ,                 JIT_SetFieldObj,CORINFO_HELP_SIG_4_STACK)\n    JITHELPER(CORINFO_HELP_GETFIELDSTRUCT,              JIT_GetFieldStruct,CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_SETFIELDSTRUCT,              JIT_SetFieldStruct,CORINFO_HELP_SIG_8_STACK)\n    JITHELPER(CORINFO_HELP_GETFIELDFLOAT,               JIT_GetFieldFloat,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_SETFIELDFLOAT,               JIT_SetFieldFloat,CORINFO_HELP_SIG_4_STACK)\n    JITHELPER(CORINFO_HELP_GETFIELDDOUBLE,              JIT_GetFieldDouble,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_SETFIELDDOUBLE,              JIT_SetFieldDouble,CORINFO_HELP_SIG_8_STACK)\n\n    JITHELPER(CORINFO_HELP_GETFIELDADDR,                JIT_GetFieldAddr,CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_GETSTATICFIELDADDR_TLS,      NULL,       CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n\n    JITHELPER(CORINFO_HELP_GETGENERICS_GCSTATIC_BASE,   JIT_GetGenericsGCStaticBase,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE, JIT_GetGenericsNonGCStaticBase,CORINFO_HELP_SIG_REG_ONLY)\n\n#ifdef TARGET_X86\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_GCSTATIC_BASE,          NULL, CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE,       NULL, CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_GCSTATIC_BASE_NOCTOR,   NULL, CORINFO_HELP_SIG_REG_ONLY)\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE_NOCTOR,NULL, CORINFO_HELP_SIG_REG_ONLY)\n#else\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_GCSTATIC_BASE,          JIT_GetSharedGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE,       JIT_GetSharedNonGCStaticBase, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_GCSTATIC_BASE_NOCTOR,   JIT_GetSharedGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE_NOCTOR,JIT_GetSharedNonGCStaticBaseNoCtor, CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n#endif\n    JITHELPER(CORINFO_HELP_GETSHARED_GCSTATIC_BASE_DYNAMICCLASS,    JIT_GetSharedGCStaticBaseDynamicClass,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSHARED_NONGCSTATIC_BASE_DYNAMICCLASS, JIT_GetSharedNonGCStaticBaseDynamicClass,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_CLASSINIT_SHARED_DYNAMICCLASS,           JIT_ClassInitDynamicClass,CORINFO_HELP_SIG_REG_ONLY)\n\n    // Thread statics\n    JITHELPER(CORINFO_HELP_GETGENERICS_GCTHREADSTATIC_BASE,   JIT_GetGenericsGCThreadStaticBase,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETGENERICS_NONGCTHREADSTATIC_BASE, JIT_GetGenericsNonGCThreadStaticBase,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE,                 JIT_GetSharedGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE,              JIT_GetSharedNonGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_NOCTOR,          JIT_GetSharedGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_NOCTOR,       JIT_GetSharedNonGCThreadStaticBase, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSHARED_GCTHREADSTATIC_BASE_DYNAMICCLASS,    JIT_GetSharedGCThreadStaticBaseDynamicClass, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_GETSHARED_NONGCTHREADSTATIC_BASE_DYNAMICCLASS, JIT_GetSharedNonGCThreadStaticBaseDynamicClass, CORINFO_HELP_SIG_REG_ONLY)\n\n    // Debugger\n    JITHELPER(CORINFO_HELP_DBG_IS_JUST_MY_CODE, JIT_DbgIsJustMyCode,CORINFO_HELP_SIG_REG_ONLY)\n\n    /* Profiling enter/leave probe addresses */\n    DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_ENTER,    JIT_ProfilerEnterLeaveTailcallStub, CORINFO_HELP_SIG_4_STACK)\n    DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_LEAVE,    JIT_ProfilerEnterLeaveTailcallStub, CORINFO_HELP_SIG_4_STACK)\n    DYNAMICJITHELPER(CORINFO_HELP_PROF_FCN_TAILCALL, JIT_ProfilerEnterLeaveTailcallStub, CORINFO_HELP_SIG_4_STACK)\n\n    // Miscellaneous\n    JITHELPER(CORINFO_HELP_BBT_FCN_ENTER,       JIT_LogMethodEnter,CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_PINVOKE_CALLI,       GenericPInvokeCalliHelper, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n\n#if defined(TARGET_X86) && !defined(UNIX_X86_ABI)\n    JITHELPER(CORINFO_HELP_TAILCALL,            JIT_TailCall,             CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n#else\n    JITHELPER(CORINFO_HELP_TAILCALL,            NULL,                     CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n#endif\n\n    JITHELPER(CORINFO_HELP_GETCURRENTMANAGEDTHREADID,  JIT_GetCurrentManagedThreadId, CORINFO_HELP_SIG_REG_ONLY)\n\n#ifdef TARGET_64BIT\n    JITHELPER(CORINFO_HELP_INIT_PINVOKE_FRAME,  JIT_InitPInvokeFrame,  CORINFO_HELP_SIG_REG_ONLY)\n#else\n    DYNAMICJITHELPER(CORINFO_HELP_INIT_PINVOKE_FRAME,  NULL,        CORINFO_HELP_SIG_REG_ONLY)\n#endif\n\n#ifdef TARGET_X86\n    JITHELPER(CORINFO_HELP_MEMSET,              NULL,               CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_MEMCPY,              NULL,               CORINFO_HELP_SIG_CANNOT_USE_ALIGN_STUB)\n#else\n    JITHELPER(CORINFO_HELP_MEMSET,              JIT_MemSet,         CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_MEMCPY,              JIT_MemCpy,         CORINFO_HELP_SIG_REG_ONLY)\n#endif\n\n    // Generics\n    JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_METHOD,    JIT_GenericHandleMethod,        CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_METHOD_LOG,JIT_GenericHandleMethodLogging, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_CLASS,     JIT_GenericHandleClass,         CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_RUNTIMEHANDLE_CLASS_LOG, JIT_GenericHandleClassLogging,  CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE, JIT_GetRuntimeType,           CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE_MAYBENULL, JIT_GetRuntimeType_MaybeNull, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_METHODDESC_TO_STUBRUNTIMEMETHOD, JIT_GetRuntimeMethodStub,CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD, JIT_GetRuntimeFieldStub,  CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE, JIT_GetRuntimeType, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPEHANDLE_MAYBENULL, JIT_GetRuntimeType_MaybeNull, CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_ARE_TYPES_EQUIVALENT, NULL, CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_VIRTUAL_FUNC_PTR,    JIT_VirtualFunctionPointer, CORINFO_HELP_SIG_4_STACK)\n\n    JITHELPER(CORINFO_HELP_READYTORUN_NEW,                 NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_NEWARR_1,            NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_ISINSTANCEOF,        NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_CHKCAST,             NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_STATIC_BASE,         NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_VIRTUAL_FUNC_PTR,    NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_HANDLE,      NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_DELEGATE_CTOR,       NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_READYTORUN_GENERIC_STATIC_BASE, NULL,   CORINFO_HELP_SIG_NO_ALIGN_STUB)\n\n#ifdef FEATURE_EH_FUNCLETS\n    JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE, ProcessCLRException,               CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, ProcessCLRException,CORINFO_HELP_SIG_UNDEF)\n#else // FEATURE_EH_FUNCLETS\n    JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE, NULL,                              CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, NULL,               CORINFO_HELP_SIG_UNDEF)\n#endif // !FEATURE_EH_FUNCLETS\n\n#ifdef TARGET_X86\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, JIT_WriteBarrierEAX, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, JIT_WriteBarrierEBX, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, JIT_WriteBarrierECX, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, JIT_WriteBarrierESI, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, JIT_WriteBarrierEDI, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    DYNAMICJITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, JIT_WriteBarrierEBP, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, JIT_CheckedWriteBarrierEAX, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, JIT_CheckedWriteBarrierEBX, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, JIT_CheckedWriteBarrierECX, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, JIT_CheckedWriteBarrierESI, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, JIT_CheckedWriteBarrierEDI, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, JIT_CheckedWriteBarrierEBP, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n#else\n    JITHELPER(CORINFO_HELP_ASSIGN_REF_EAX, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_ASSIGN_REF_EBX, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_ASSIGN_REF_ECX, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_ASSIGN_REF_ESI, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_ASSIGN_REF_EDI, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_ASSIGN_REF_EBP, NULL, CORINFO_HELP_SIG_UNDEF)\n\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EAX, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBX, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ECX, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_ESI, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EDI, NULL, CORINFO_HELP_SIG_UNDEF)\n    JITHELPER(CORINFO_HELP_CHECKED_ASSIGN_REF_EBP, NULL, CORINFO_HELP_SIG_UNDEF)\n#endif\n\n    JITHELPER(CORINFO_HELP_LOOP_CLONE_CHOICE_ADDR, JIT_LoopCloneChoiceAddr, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_DEBUG_LOG_LOOP_CLONING, JIT_DebugLogLoopCloning, CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_THROW_ARGUMENTEXCEPTION,           JIT_ThrowArgumentException,             CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_THROW_ARGUMENTOUTOFRANGEEXCEPTION, JIT_ThrowArgumentOutOfRangeException,   CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_THROW_NOT_IMPLEMENTED,             JIT_ThrowNotImplementedException,       CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED,      JIT_ThrowPlatformNotSupportedException, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED,          JIT_ThrowTypeNotSupportedException,     CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION, JIT_ThrowAmbiguousResolutionException, CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_JIT_PINVOKE_BEGIN,         JIT_PInvokeBegin,     CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_JIT_PINVOKE_END,           JIT_PInvokeEnd,       CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER,                   JIT_ReversePInvokeEnter,                 CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER_TRACK_TRANSITIONS, JIT_ReversePInvokeEnterTrackTransitions, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT,                    JIT_ReversePInvokeExit,                  CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT_TRACK_TRANSITIONS,  JIT_ReversePInvokeExitTrackTransitions,  CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_GVMLOOKUP_FOR_SLOT, NULL, CORINFO_HELP_SIG_NO_ALIGN_STUB)\n\n#if !defined(TARGET_ARM64) && !defined(TARGET_LOONGARCH64)\n    JITHELPER(CORINFO_HELP_STACK_PROBE, JIT_StackProbe, CORINFO_HELP_SIG_REG_ONLY)\n#else\n    JITHELPER(CORINFO_HELP_STACK_PROBE, NULL, CORINFO_HELP_SIG_UNDEF)\n#endif\n\n    JITHELPER(CORINFO_HELP_PATCHPOINT, JIT_Patchpoint, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_PARTIAL_COMPILATION_PATCHPOINT, JIT_PartialCompilationPatchpoint, CORINFO_HELP_SIG_REG_ONLY)\n\n    JITHELPER(CORINFO_HELP_CLASSPROFILE32, JIT_ClassProfile32, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_CLASSPROFILE64, JIT_ClassProfile64, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_DELEGATEPROFILE32, JIT_DelegateProfile32, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_DELEGATEPROFILE64, JIT_DelegateProfile64, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_VTABLEPROFILE32, JIT_VTableProfile32, CORINFO_HELP_SIG_4_STACK)\n    JITHELPER(CORINFO_HELP_VTABLEPROFILE64, JIT_VTableProfile64, CORINFO_HELP_SIG_4_STACK)\n\n#if defined(TARGET_AMD64) || defined(TARGET_ARM64)\n    JITHELPER(CORINFO_HELP_VALIDATE_INDIRECT_CALL, JIT_ValidateIndirectCall, CORINFO_HELP_SIG_REG_ONLY)\n#ifdef TARGET_AMD64\n    DYNAMICJITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, JIT_DispatchIndirectCall, CORINFO_HELP_SIG_REG_ONLY)\n#else\n    JITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, JIT_DispatchIndirectCall, CORINFO_HELP_SIG_REG_ONLY)\n#endif\n#else\n    JITHELPER(CORINFO_HELP_VALIDATE_INDIRECT_CALL, NULL, CORINFO_HELP_SIG_REG_ONLY)\n    JITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, NULL, CORINFO_HELP_SIG_REG_ONLY)\n#endif\n\n#undef JITHELPER\n#undef DYNAMICJITHELPER\n#undef JITHELPER\n#undef DYNAMICJITHELPER\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/livedatatarget.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n//\n// Define a Data-Target for a live process.\n//\n//*****************************************************************************\n\n#ifndef _LIVEPROC_DATATARGET_H_\n#define _LIVEPROC_DATATARGET_H_\n\n// Defines the Data-Target and other public interfaces.\n// Does not include IXClrData definitions.\n#include <clrdata.h>\n\n#ifndef TARGET_UNIX\n\n//---------------------------------------------------------------------------------------\n//\n// Provides a simple legacy data-target implementation for a live, local, process.\n// Note that in arrowhead, most debuggers use ICorDebugDataTarget, and we have\n// implementations of this in MDbg.\n//\nclass LiveProcDataTarget : public ICLRDataTarget\n{\npublic:\n    LiveProcDataTarget(HANDLE process,\n                       DWORD processId,\n                       CLRDATA_ADDRESS baseAddressOfEngine = NULL);\n\n    //\n    // IUnknown.\n    //\n    // This class is intended to be kept on the stack\n    // or as a member and does not maintain a refcount.\n    //\n\n    STDMETHOD(QueryInterface)(\n        THIS_\n        IN REFIID InterfaceId,\n        OUT PVOID* Interface\n        );\n    STDMETHOD_(ULONG, AddRef)(\n        THIS\n        );\n    STDMETHOD_(ULONG, Release)(\n        THIS\n        );\n\n    //\n    // ICLRDataTarget.\n    //\n\n    virtual HRESULT STDMETHODCALLTYPE GetMachineType(\n        /* [out] */ ULONG32 *machine);\n    virtual HRESULT STDMETHODCALLTYPE GetPointerSize(\n        /* [out] */ ULONG32 *size);\n    virtual HRESULT STDMETHODCALLTYPE GetImageBase(\n        /* [string][in] */ LPCWSTR name,\n        /* [out] */ CLRDATA_ADDRESS *base);\n    virtual HRESULT STDMETHODCALLTYPE ReadVirtual(\n        /* [in] */ CLRDATA_ADDRESS address,\n        /* [length_is][size_is][out] */ PBYTE buffer,\n        /* [in] */ ULONG32 request,\n        /* [optional][out] */ ULONG32 *done);\n    virtual HRESULT STDMETHODCALLTYPE WriteVirtual(\n        /* [in] */ CLRDATA_ADDRESS address,\n        /* [size_is][in] */ PBYTE buffer,\n        /* [in] */ ULONG32 request,\n        /* [optional][out] */ ULONG32 *done);\n    virtual HRESULT STDMETHODCALLTYPE GetTLSValue(\n        /* [in] */ ULONG32 threadID,\n        /* [in] */ ULONG32 index,\n        /* [out] */ CLRDATA_ADDRESS* value);\n    virtual HRESULT STDMETHODCALLTYPE SetTLSValue(\n        /* [in] */ ULONG32 threadID,\n        /* [in] */ ULONG32 index,\n        /* [in] */ CLRDATA_ADDRESS value);\n    virtual HRESULT STDMETHODCALLTYPE GetCurrentThreadID(\n        /* [out] */ ULONG32* threadID);\n    virtual HRESULT STDMETHODCALLTYPE GetThreadContext(\n        /* [in] */ ULONG32 threadID,\n        /* [in] */ ULONG32 contextFlags,\n        /* [in] */ ULONG32 contextSize,\n        /* [out, size_is(contextSize)] */ PBYTE context);\n    virtual HRESULT STDMETHODCALLTYPE SetThreadContext(\n        /* [in] */ ULONG32 threadID,\n        /* [in] */ ULONG32 contextSize,\n        /* [in, size_is(contextSize)] */ PBYTE context);\n    virtual HRESULT STDMETHODCALLTYPE Request(\n        /* [in] */ ULONG32 reqCode,\n        /* [in] */ ULONG32 inBufferSize,\n        /* [size_is][in] */ BYTE *inBuffer,\n        /* [in] */ ULONG32 outBufferSize,\n        /* [size_is][out] */ BYTE *outBuffer);\n\nprivate:\n    HANDLE m_process;\n    DWORD m_processId;\n    CLRDATA_ADDRESS m_baseAddressOfEngine;\n};\n\n#endif // TARGET_UNIX\n\n#endif // _LIVEPROC_DATATARGET_H_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/llvm/Dwarf.def",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// ==============================================================================\n// LLVM Release License\n// ==============================================================================\n// University of Illinois/NCSA\n// Open Source License\n//\n// Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.\n// All rights reserved.\n//\n// Developed by:\n//\n//     LLVM Team\n//\n//     University of Illinois at Urbana-Champaign\n//\n//     http://llvm.org\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal with\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n// of the Software, and to permit persons to whom the Software is furnished to do\n// so, subject to the following conditions:\n//\n//     * Redistributions of source code must retain the above copyright notice,\n//       this list of conditions and the following disclaimers.\n//\n//     * Redistributions in binary form must reproduce the above copyright notice,\n//       this list of conditions and the following disclaimers in the\n//       documentation and/or other materials provided with the distribution.\n//\n//     * Neither the names of the LLVM Team, University of Illinois at\n//       Urbana-Champaign, nor the names of its contributors may be used to\n//       endorse or promote products derived from this Software without specific\n//       prior written permission.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\n// SOFTWARE.\n\n//===----------------------------------------------------------------------===//\n//\n// Macros for running through Dwarf enumerators.\n//\n//===----------------------------------------------------------------------===//\n\n// TODO: Add other DW-based macros.\n#if !(defined HANDLE_DW_TAG || defined HANDLE_DW_OP ||                         \\\n      defined HANDLE_DW_LANG || defined HANDLE_DW_ATE ||                       \\\n      defined HANDLE_DW_VIRTUALITY)\n#error \"Missing macro definition of HANDLE_DW*\"\n#endif\n\n#ifndef HANDLE_DW_TAG\n#define HANDLE_DW_TAG(ID, NAME)\n#endif\n\n#ifndef HANDLE_DW_OP\n#define HANDLE_DW_OP(ID, NAME)\n#endif\n\n#ifndef HANDLE_DW_LANG\n#define HANDLE_DW_LANG(ID, NAME)\n#endif\n\n#ifndef HANDLE_DW_ATE\n#define HANDLE_DW_ATE(ID, NAME)\n#endif\n\n#ifndef HANDLE_DW_VIRTUALITY\n#define HANDLE_DW_VIRTUALITY(ID, NAME)\n#endif\n\nHANDLE_DW_TAG(0x0001, array_type)\nHANDLE_DW_TAG(0x0002, class_type)\nHANDLE_DW_TAG(0x0003, entry_point)\nHANDLE_DW_TAG(0x0004, enumeration_type)\nHANDLE_DW_TAG(0x0005, formal_parameter)\nHANDLE_DW_TAG(0x0008, imported_declaration)\nHANDLE_DW_TAG(0x000a, label)\nHANDLE_DW_TAG(0x000b, lexical_block)\nHANDLE_DW_TAG(0x000d, member)\nHANDLE_DW_TAG(0x000f, pointer_type)\nHANDLE_DW_TAG(0x0010, reference_type)\nHANDLE_DW_TAG(0x0011, compile_unit)\nHANDLE_DW_TAG(0x0012, string_type)\nHANDLE_DW_TAG(0x0013, structure_type)\nHANDLE_DW_TAG(0x0015, subroutine_type)\nHANDLE_DW_TAG(0x0016, typedef)\nHANDLE_DW_TAG(0x0017, union_type)\nHANDLE_DW_TAG(0x0018, unspecified_parameters)\nHANDLE_DW_TAG(0x0019, variant)\nHANDLE_DW_TAG(0x001a, common_block)\nHANDLE_DW_TAG(0x001b, common_inclusion)\nHANDLE_DW_TAG(0x001c, inheritance)\nHANDLE_DW_TAG(0x001d, inlined_subroutine)\nHANDLE_DW_TAG(0x001e, module)\nHANDLE_DW_TAG(0x001f, ptr_to_member_type)\nHANDLE_DW_TAG(0x0020, set_type)\nHANDLE_DW_TAG(0x0021, subrange_type)\nHANDLE_DW_TAG(0x0022, with_stmt)\nHANDLE_DW_TAG(0x0023, access_declaration)\nHANDLE_DW_TAG(0x0024, base_type)\nHANDLE_DW_TAG(0x0025, catch_block)\nHANDLE_DW_TAG(0x0026, const_type)\nHANDLE_DW_TAG(0x0027, constant)\nHANDLE_DW_TAG(0x0028, enumerator)\nHANDLE_DW_TAG(0x0029, file_type)\nHANDLE_DW_TAG(0x002a, friend)\nHANDLE_DW_TAG(0x002b, namelist)\nHANDLE_DW_TAG(0x002c, namelist_item)\nHANDLE_DW_TAG(0x002d, packed_type)\nHANDLE_DW_TAG(0x002e, subprogram)\nHANDLE_DW_TAG(0x002f, template_type_parameter)\nHANDLE_DW_TAG(0x0030, template_value_parameter)\nHANDLE_DW_TAG(0x0031, thrown_type)\nHANDLE_DW_TAG(0x0032, try_block)\nHANDLE_DW_TAG(0x0033, variant_part)\nHANDLE_DW_TAG(0x0034, variable)\nHANDLE_DW_TAG(0x0035, volatile_type)\nHANDLE_DW_TAG(0x0036, dwarf_procedure)\nHANDLE_DW_TAG(0x0037, restrict_type)\nHANDLE_DW_TAG(0x0038, interface_type)\nHANDLE_DW_TAG(0x0039, namespace)\nHANDLE_DW_TAG(0x003a, imported_module)\nHANDLE_DW_TAG(0x003b, unspecified_type)\nHANDLE_DW_TAG(0x003c, partial_unit)\nHANDLE_DW_TAG(0x003d, imported_unit)\nHANDLE_DW_TAG(0x003f, condition)\nHANDLE_DW_TAG(0x0040, shared_type)\nHANDLE_DW_TAG(0x0041, type_unit)\nHANDLE_DW_TAG(0x0042, rvalue_reference_type)\nHANDLE_DW_TAG(0x0043, template_alias)\n\n// New in DWARF v5.\nHANDLE_DW_TAG(0x0044, coarray_type)\nHANDLE_DW_TAG(0x0045, generic_subrange)\nHANDLE_DW_TAG(0x0046, dynamic_type)\n\n// User-defined tags.\nHANDLE_DW_TAG(0x4081, MIPS_loop)\nHANDLE_DW_TAG(0x4101, format_label)\nHANDLE_DW_TAG(0x4102, function_template)\nHANDLE_DW_TAG(0x4103, class_template)\nHANDLE_DW_TAG(0x4106, GNU_template_template_param)\nHANDLE_DW_TAG(0x4107, GNU_template_parameter_pack)\nHANDLE_DW_TAG(0x4108, GNU_formal_parameter_pack)\nHANDLE_DW_TAG(0x4200, APPLE_property)\nHANDLE_DW_TAG(0xb000, BORLAND_property)\nHANDLE_DW_TAG(0xb001, BORLAND_Delphi_string)\nHANDLE_DW_TAG(0xb002, BORLAND_Delphi_dynamic_array)\nHANDLE_DW_TAG(0xb003, BORLAND_Delphi_set)\nHANDLE_DW_TAG(0xb004, BORLAND_Delphi_variant)\n\nHANDLE_DW_OP(0x03, addr)\nHANDLE_DW_OP(0x06, deref)\nHANDLE_DW_OP(0x08, const1u)\nHANDLE_DW_OP(0x09, const1s)\nHANDLE_DW_OP(0x0a, const2u)\nHANDLE_DW_OP(0x0b, const2s)\nHANDLE_DW_OP(0x0c, const4u)\nHANDLE_DW_OP(0x0d, const4s)\nHANDLE_DW_OP(0x0e, const8u)\nHANDLE_DW_OP(0x0f, const8s)\nHANDLE_DW_OP(0x10, constu)\nHANDLE_DW_OP(0x11, consts)\nHANDLE_DW_OP(0x12, dup)\nHANDLE_DW_OP(0x13, drop)\nHANDLE_DW_OP(0x14, over)\nHANDLE_DW_OP(0x15, pick)\nHANDLE_DW_OP(0x16, swap)\nHANDLE_DW_OP(0x17, rot)\nHANDLE_DW_OP(0x18, xderef)\nHANDLE_DW_OP(0x19, abs)\nHANDLE_DW_OP(0x1a, and)\nHANDLE_DW_OP(0x1b, div)\nHANDLE_DW_OP(0x1c, minus)\nHANDLE_DW_OP(0x1d, mod)\nHANDLE_DW_OP(0x1e, mul)\nHANDLE_DW_OP(0x1f, neg)\nHANDLE_DW_OP(0x20, not)\nHANDLE_DW_OP(0x21, or )\nHANDLE_DW_OP(0x22, plus)\nHANDLE_DW_OP(0x23, plus_uconst)\nHANDLE_DW_OP(0x24, shl)\nHANDLE_DW_OP(0x25, shr)\nHANDLE_DW_OP(0x26, shra)\nHANDLE_DW_OP(0x27, xor)\nHANDLE_DW_OP(0x2f, skip)\nHANDLE_DW_OP(0x28, bra)\nHANDLE_DW_OP(0x29, eq)\nHANDLE_DW_OP(0x2a, ge)\nHANDLE_DW_OP(0x2b, gt)\nHANDLE_DW_OP(0x2c, le)\nHANDLE_DW_OP(0x2d, lt)\nHANDLE_DW_OP(0x2e, ne)\nHANDLE_DW_OP(0x30, lit0)\nHANDLE_DW_OP(0x31, lit1)\nHANDLE_DW_OP(0x32, lit2)\nHANDLE_DW_OP(0x33, lit3)\nHANDLE_DW_OP(0x34, lit4)\nHANDLE_DW_OP(0x35, lit5)\nHANDLE_DW_OP(0x36, lit6)\nHANDLE_DW_OP(0x37, lit7)\nHANDLE_DW_OP(0x38, lit8)\nHANDLE_DW_OP(0x39, lit9)\nHANDLE_DW_OP(0x3a, lit10)\nHANDLE_DW_OP(0x3b, lit11)\nHANDLE_DW_OP(0x3c, lit12)\nHANDLE_DW_OP(0x3d, lit13)\nHANDLE_DW_OP(0x3e, lit14)\nHANDLE_DW_OP(0x3f, lit15)\nHANDLE_DW_OP(0x40, lit16)\nHANDLE_DW_OP(0x41, lit17)\nHANDLE_DW_OP(0x42, lit18)\nHANDLE_DW_OP(0x43, lit19)\nHANDLE_DW_OP(0x44, lit20)\nHANDLE_DW_OP(0x45, lit21)\nHANDLE_DW_OP(0x46, lit22)\nHANDLE_DW_OP(0x47, lit23)\nHANDLE_DW_OP(0x48, lit24)\nHANDLE_DW_OP(0x49, lit25)\nHANDLE_DW_OP(0x4a, lit26)\nHANDLE_DW_OP(0x4b, lit27)\nHANDLE_DW_OP(0x4c, lit28)\nHANDLE_DW_OP(0x4d, lit29)\nHANDLE_DW_OP(0x4e, lit30)\nHANDLE_DW_OP(0x4f, lit31)\nHANDLE_DW_OP(0x50, reg0)\nHANDLE_DW_OP(0x51, reg1)\nHANDLE_DW_OP(0x52, reg2)\nHANDLE_DW_OP(0x53, reg3)\nHANDLE_DW_OP(0x54, reg4)\nHANDLE_DW_OP(0x55, reg5)\nHANDLE_DW_OP(0x56, reg6)\nHANDLE_DW_OP(0x57, reg7)\nHANDLE_DW_OP(0x58, reg8)\nHANDLE_DW_OP(0x59, reg9)\nHANDLE_DW_OP(0x5a, reg10)\nHANDLE_DW_OP(0x5b, reg11)\nHANDLE_DW_OP(0x5c, reg12)\nHANDLE_DW_OP(0x5d, reg13)\nHANDLE_DW_OP(0x5e, reg14)\nHANDLE_DW_OP(0x5f, reg15)\nHANDLE_DW_OP(0x60, reg16)\nHANDLE_DW_OP(0x61, reg17)\nHANDLE_DW_OP(0x62, reg18)\nHANDLE_DW_OP(0x63, reg19)\nHANDLE_DW_OP(0x64, reg20)\nHANDLE_DW_OP(0x65, reg21)\nHANDLE_DW_OP(0x66, reg22)\nHANDLE_DW_OP(0x67, reg23)\nHANDLE_DW_OP(0x68, reg24)\nHANDLE_DW_OP(0x69, reg25)\nHANDLE_DW_OP(0x6a, reg26)\nHANDLE_DW_OP(0x6b, reg27)\nHANDLE_DW_OP(0x6c, reg28)\nHANDLE_DW_OP(0x6d, reg29)\nHANDLE_DW_OP(0x6e, reg30)\nHANDLE_DW_OP(0x6f, reg31)\nHANDLE_DW_OP(0x70, breg0)\nHANDLE_DW_OP(0x71, breg1)\nHANDLE_DW_OP(0x72, breg2)\nHANDLE_DW_OP(0x73, breg3)\nHANDLE_DW_OP(0x74, breg4)\nHANDLE_DW_OP(0x75, breg5)\nHANDLE_DW_OP(0x76, breg6)\nHANDLE_DW_OP(0x77, breg7)\nHANDLE_DW_OP(0x78, breg8)\nHANDLE_DW_OP(0x79, breg9)\nHANDLE_DW_OP(0x7a, breg10)\nHANDLE_DW_OP(0x7b, breg11)\nHANDLE_DW_OP(0x7c, breg12)\nHANDLE_DW_OP(0x7d, breg13)\nHANDLE_DW_OP(0x7e, breg14)\nHANDLE_DW_OP(0x7f, breg15)\nHANDLE_DW_OP(0x80, breg16)\nHANDLE_DW_OP(0x81, breg17)\nHANDLE_DW_OP(0x82, breg18)\nHANDLE_DW_OP(0x83, breg19)\nHANDLE_DW_OP(0x84, breg20)\nHANDLE_DW_OP(0x85, breg21)\nHANDLE_DW_OP(0x86, breg22)\nHANDLE_DW_OP(0x87, breg23)\nHANDLE_DW_OP(0x88, breg24)\nHANDLE_DW_OP(0x89, breg25)\nHANDLE_DW_OP(0x8a, breg26)\nHANDLE_DW_OP(0x8b, breg27)\nHANDLE_DW_OP(0x8c, breg28)\nHANDLE_DW_OP(0x8d, breg29)\nHANDLE_DW_OP(0x8e, breg30)\nHANDLE_DW_OP(0x8f, breg31)\nHANDLE_DW_OP(0x90, regx)\nHANDLE_DW_OP(0x91, fbreg)\nHANDLE_DW_OP(0x92, bregx)\nHANDLE_DW_OP(0x93, piece)\nHANDLE_DW_OP(0x94, deref_size)\nHANDLE_DW_OP(0x95, xderef_size)\nHANDLE_DW_OP(0x96, nop)\nHANDLE_DW_OP(0x97, push_object_address)\nHANDLE_DW_OP(0x98, call2)\nHANDLE_DW_OP(0x99, call4)\nHANDLE_DW_OP(0x9a, call_ref)\nHANDLE_DW_OP(0x9b, form_tls_address)\nHANDLE_DW_OP(0x9c, call_frame_cfa)\nHANDLE_DW_OP(0x9d, bit_piece)\nHANDLE_DW_OP(0x9e, implicit_value)\nHANDLE_DW_OP(0x9f, stack_value)\n\n// Extensions for GNU-style thread-local storage.\nHANDLE_DW_OP(0xe0, GNU_push_tls_address)\n\n// Extensions for Fission proposal.\nHANDLE_DW_OP(0xfb, GNU_addr_index)\nHANDLE_DW_OP(0xfc, GNU_const_index)\n\n// DWARF languages.\nHANDLE_DW_LANG(0x0001, C89)\nHANDLE_DW_LANG(0x0002, C)\nHANDLE_DW_LANG(0x0003, Ada83)\nHANDLE_DW_LANG(0x0004, C_plus_plus)\nHANDLE_DW_LANG(0x0005, Cobol74)\nHANDLE_DW_LANG(0x0006, Cobol85)\nHANDLE_DW_LANG(0x0007, Fortran77)\nHANDLE_DW_LANG(0x0008, Fortran90)\nHANDLE_DW_LANG(0x0009, Pascal83)\nHANDLE_DW_LANG(0x000a, Modula2)\nHANDLE_DW_LANG(0x000b, Java)\nHANDLE_DW_LANG(0x000c, C99)\nHANDLE_DW_LANG(0x000d, Ada95)\nHANDLE_DW_LANG(0x000e, Fortran95)\nHANDLE_DW_LANG(0x000f, PLI)\nHANDLE_DW_LANG(0x0010, ObjC)\nHANDLE_DW_LANG(0x0011, ObjC_plus_plus)\nHANDLE_DW_LANG(0x0012, UPC)\nHANDLE_DW_LANG(0x0013, D)\n\n// New in DWARF 5:\nHANDLE_DW_LANG(0x0014, Python)\nHANDLE_DW_LANG(0x0015, OpenCL)\nHANDLE_DW_LANG(0x0016, Go)\nHANDLE_DW_LANG(0x0017, Modula3)\nHANDLE_DW_LANG(0x0018, Haskell)\nHANDLE_DW_LANG(0x0019, C_plus_plus_03)\nHANDLE_DW_LANG(0x001a, C_plus_plus_11)\nHANDLE_DW_LANG(0x001b, OCaml)\nHANDLE_DW_LANG(0x001c, Rust)\nHANDLE_DW_LANG(0x001d, C11)\nHANDLE_DW_LANG(0x001e, Swift)\nHANDLE_DW_LANG(0x001f, Julia)\nHANDLE_DW_LANG(0x0020, Dylan)\nHANDLE_DW_LANG(0x0021, C_plus_plus_14)\nHANDLE_DW_LANG(0x0022, Fortran03)\nHANDLE_DW_LANG(0x0023, Fortran08)\nHANDLE_DW_LANG(0x8001, Mips_Assembler)\nHANDLE_DW_LANG(0xb000, BORLAND_Delphi)\n\n// DWARF attribute type encodings.\nHANDLE_DW_ATE(0x01, address)\nHANDLE_DW_ATE(0x02, boolean)\nHANDLE_DW_ATE(0x03, complex_float)\nHANDLE_DW_ATE(0x04, float)\nHANDLE_DW_ATE(0x05, signed)\nHANDLE_DW_ATE(0x06, signed_char)\nHANDLE_DW_ATE(0x07, unsigned)\nHANDLE_DW_ATE(0x08, unsigned_char)\nHANDLE_DW_ATE(0x09, imaginary_float)\nHANDLE_DW_ATE(0x0a, packed_decimal)\nHANDLE_DW_ATE(0x0b, numeric_string)\nHANDLE_DW_ATE(0x0c, edited)\nHANDLE_DW_ATE(0x0d, signed_fixed)\nHANDLE_DW_ATE(0x0e, unsigned_fixed)\nHANDLE_DW_ATE(0x0f, decimal_float)\nHANDLE_DW_ATE(0x10, UTF)\n\n// DWARF virtuality codes.\nHANDLE_DW_VIRTUALITY(0x00, none)\nHANDLE_DW_VIRTUALITY(0x01, virtual)\nHANDLE_DW_VIRTUALITY(0x02, pure_virtual)\n\n#undef HANDLE_DW_TAG\n#undef HANDLE_DW_OP\n#undef HANDLE_DW_LANG\n#undef HANDLE_DW_ATE\n#undef HANDLE_DW_VIRTUALITY\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/llvm/Dwarf.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// ==============================================================================\n// LLVM Release License\n// ==============================================================================\n// University of Illinois/NCSA\n// Open Source License\n//\n// Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.\n// All rights reserved.\n//\n// Developed by:\n//\n//     LLVM Team\n//\n//     University of Illinois at Urbana-Champaign\n//\n//     http://llvm.org\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal with\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n// of the Software, and to permit persons to whom the Software is furnished to do\n// so, subject to the following conditions:\n//\n//     * Redistributions of source code must retain the above copyright notice,\n//       this list of conditions and the following disclaimers.\n//\n//     * Redistributions in binary form must reproduce the above copyright notice,\n//       this list of conditions and the following disclaimers in the\n//       documentation and/or other materials provided with the distribution.\n//\n//     * Neither the names of the LLVM Team, University of Illinois at\n//       Urbana-Champaign, nor the names of its contributors may be used to\n//       endorse or promote products derived from this Software without specific\n//       prior written permission.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\n// SOFTWARE.\n\n//===----------------------------------------------------------------------===//\n//\n// \\file\n// \\brief This file contains constants used for implementing Dwarf\n// debug support.\n//\n// For details on the Dwarf specfication see the latest DWARF Debugging\n// Information Format standard document on http://www.dwarfstd.org. This\n// file often includes support for non-released standard features.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef LLVM_SUPPORT_DWARF_H\n#define LLVM_SUPPORT_DWARF_H\n\n//===----------------------------------------------------------------------===//\n// Dwarf constants as gleaned from the DWARF Debugging Information Format V.4\n// reference manual http://www.dwarfstd.org/.\n//\n\n// Do not mix the following two enumerations sets.  DW_TAG_invalid changes the\n// enumeration base type.\n\nenum LLVMConstants : uint32_t {\n  // LLVM mock tags (see also llvm/Support/Dwarf.def).\n  DW_TAG_invalid = ~0U,        // Tag for invalid results.\n  DW_VIRTUALITY_invalid = ~0U, // Virtuality for invalid results.\n  DW_MACINFO_invalid = ~0U,    // Macinfo type for invalid results.\n\n  // Other constants.\n  DWARF_VERSION = 4,       // Default dwarf version we output.\n  DW_PUBTYPES_VERSION = 2, // Section version number for .debug_pubtypes.\n  DW_PUBNAMES_VERSION = 2, // Section version number for .debug_pubnames.\n  DW_ARANGES_VERSION = 2   // Section version number for .debug_aranges.\n};\n\n// Special ID values that distinguish a CIE from a FDE in DWARF CFI.\n// Not inside an enum because a 64-bit value is needed.\nconst uint32_t DW_CIE_ID = UINT32_MAX;\nconst uint64_t DW64_CIE_ID = UINT64_MAX;\n\nenum Tag : uint16_t {\n#define HANDLE_DW_TAG(ID, NAME) DW_TAG_##NAME = ID,\n#include \"Dwarf.def\"\n  DW_TAG_lo_user = 0x4080,\n  DW_TAG_hi_user = 0xffff,\n  DW_TAG_user_base = 0x1000 // Recommended base for user tags.\n};\n\ninline bool isType(Tag T) {\n  switch (T) {\n  case DW_TAG_array_type:\n  case DW_TAG_class_type:\n  case DW_TAG_interface_type:\n  case DW_TAG_enumeration_type:\n  case DW_TAG_pointer_type:\n  case DW_TAG_reference_type:\n  case DW_TAG_rvalue_reference_type:\n  case DW_TAG_string_type:\n  case DW_TAG_structure_type:\n  case DW_TAG_subroutine_type:\n  case DW_TAG_union_type:\n  case DW_TAG_ptr_to_member_type:\n  case DW_TAG_set_type:\n  case DW_TAG_subrange_type:\n  case DW_TAG_base_type:\n  case DW_TAG_const_type:\n  case DW_TAG_file_type:\n  case DW_TAG_packed_type:\n  case DW_TAG_volatile_type:\n  case DW_TAG_typedef:\n    return true;\n  default:\n    return false;\n  }\n}\n\nenum Attribute : uint16_t {\n  // Attributes\n  DW_AT_sibling = 0x01,\n  DW_AT_location = 0x02,\n  DW_AT_name = 0x03,\n  DW_AT_ordering = 0x09,\n  DW_AT_byte_size = 0x0b,\n  DW_AT_bit_offset = 0x0c,\n  DW_AT_bit_size = 0x0d,\n  DW_AT_stmt_list = 0x10,\n  DW_AT_low_pc = 0x11,\n  DW_AT_high_pc = 0x12,\n  DW_AT_language = 0x13,\n  DW_AT_discr = 0x15,\n  DW_AT_discr_value = 0x16,\n  DW_AT_visibility = 0x17,\n  DW_AT_import = 0x18,\n  DW_AT_string_length = 0x19,\n  DW_AT_common_reference = 0x1a,\n  DW_AT_comp_dir = 0x1b,\n  DW_AT_const_value = 0x1c,\n  DW_AT_containing_type = 0x1d,\n  DW_AT_default_value = 0x1e,\n  DW_AT_inline = 0x20,\n  DW_AT_is_optional = 0x21,\n  DW_AT_lower_bound = 0x22,\n  DW_AT_producer = 0x25,\n  DW_AT_prototyped = 0x27,\n  DW_AT_return_addr = 0x2a,\n  DW_AT_start_scope = 0x2c,\n  DW_AT_bit_stride = 0x2e,\n  DW_AT_upper_bound = 0x2f,\n  DW_AT_abstract_origin = 0x31,\n  DW_AT_accessibility = 0x32,\n  DW_AT_address_class = 0x33,\n  DW_AT_artificial = 0x34,\n  DW_AT_base_types = 0x35,\n  DW_AT_calling_convention = 0x36,\n  DW_AT_count = 0x37,\n  DW_AT_data_member_location = 0x38,\n  DW_AT_decl_column = 0x39,\n  DW_AT_decl_file = 0x3a,\n  DW_AT_decl_line = 0x3b,\n  DW_AT_declaration = 0x3c,\n  DW_AT_discr_list = 0x3d,\n  DW_AT_encoding = 0x3e,\n  DW_AT_external = 0x3f,\n  DW_AT_frame_base = 0x40,\n  DW_AT_friend = 0x41,\n  DW_AT_identifier_case = 0x42,\n  DW_AT_macro_info = 0x43,\n  DW_AT_namelist_item = 0x44,\n  DW_AT_priority = 0x45,\n  DW_AT_segment = 0x46,\n  DW_AT_specification = 0x47,\n  DW_AT_static_link = 0x48,\n  DW_AT_type = 0x49,\n  DW_AT_use_location = 0x4a,\n  DW_AT_variable_parameter = 0x4b,\n  DW_AT_virtuality = 0x4c,\n  DW_AT_vtable_elem_location = 0x4d,\n  DW_AT_allocated = 0x4e,\n  DW_AT_associated = 0x4f,\n  DW_AT_data_location = 0x50,\n  DW_AT_byte_stride = 0x51,\n  DW_AT_entry_pc = 0x52,\n  DW_AT_use_UTF8 = 0x53,\n  DW_AT_extension = 0x54,\n  DW_AT_ranges = 0x55,\n  DW_AT_trampoline = 0x56,\n  DW_AT_call_column = 0x57,\n  DW_AT_call_file = 0x58,\n  DW_AT_call_line = 0x59,\n  DW_AT_description = 0x5a,\n  DW_AT_binary_scale = 0x5b,\n  DW_AT_decimal_scale = 0x5c,\n  DW_AT_small = 0x5d,\n  DW_AT_decimal_sign = 0x5e,\n  DW_AT_digit_count = 0x5f,\n  DW_AT_picture_string = 0x60,\n  DW_AT_mutable = 0x61,\n  DW_AT_threads_scaled = 0x62,\n  DW_AT_explicit = 0x63,\n  DW_AT_object_pointer = 0x64,\n  DW_AT_endianity = 0x65,\n  DW_AT_elemental = 0x66,\n  DW_AT_pure = 0x67,\n  DW_AT_recursive = 0x68,\n  DW_AT_signature = 0x69,\n  DW_AT_main_subprogram = 0x6a,\n  DW_AT_data_bit_offset = 0x6b,\n  DW_AT_const_expr = 0x6c,\n  DW_AT_enum_class = 0x6d,\n  DW_AT_linkage_name = 0x6e,\n\n  // New in DWARF 5:\n  DW_AT_string_length_bit_size = 0x6f,\n  DW_AT_string_length_byte_size = 0x70,\n  DW_AT_rank = 0x71,\n  DW_AT_str_offsets_base = 0x72,\n  DW_AT_addr_base = 0x73,\n  DW_AT_ranges_base = 0x74,\n  DW_AT_dwo_id = 0x75,\n  DW_AT_dwo_name = 0x76,\n  DW_AT_reference = 0x77,\n  DW_AT_rvalue_reference = 0x78,\n  DW_AT_macros = 0x79,\n\n  DW_AT_lo_user = 0x2000,\n  DW_AT_hi_user = 0x3fff,\n\n  DW_AT_MIPS_loop_begin = 0x2002,\n  DW_AT_MIPS_tail_loop_begin = 0x2003,\n  DW_AT_MIPS_epilog_begin = 0x2004,\n  DW_AT_MIPS_loop_unroll_factor = 0x2005,\n  DW_AT_MIPS_software_pipeline_depth = 0x2006,\n  DW_AT_MIPS_linkage_name = 0x2007,\n  DW_AT_MIPS_stride = 0x2008,\n  DW_AT_MIPS_abstract_name = 0x2009,\n  DW_AT_MIPS_clone_origin = 0x200a,\n  DW_AT_MIPS_has_inlines = 0x200b,\n  DW_AT_MIPS_stride_byte = 0x200c,\n  DW_AT_MIPS_stride_elem = 0x200d,\n  DW_AT_MIPS_ptr_dopetype = 0x200e,\n  DW_AT_MIPS_allocatable_dopetype = 0x200f,\n  DW_AT_MIPS_assumed_shape_dopetype = 0x2010,\n\n  // This one appears to have only been implemented by Open64 for\n  // fortran and may conflict with other extensions.\n  DW_AT_MIPS_assumed_size = 0x2011,\n\n  // GNU extensions\n  DW_AT_sf_names = 0x2101,\n  DW_AT_src_info = 0x2102,\n  DW_AT_mac_info = 0x2103,\n  DW_AT_src_coords = 0x2104,\n  DW_AT_body_begin = 0x2105,\n  DW_AT_body_end = 0x2106,\n  DW_AT_GNU_vector = 0x2107,\n  DW_AT_GNU_template_name = 0x2110,\n\n  DW_AT_GNU_odr_signature = 0x210f,\n  DW_AT_GNU_macros = 0x2119,\n\n  // Extensions for Fission proposal.\n  DW_AT_GNU_dwo_name = 0x2130,\n  DW_AT_GNU_dwo_id = 0x2131,\n  DW_AT_GNU_ranges_base = 0x2132,\n  DW_AT_GNU_addr_base = 0x2133,\n  DW_AT_GNU_pubnames = 0x2134,\n  DW_AT_GNU_pubtypes = 0x2135,\n  DW_AT_GNU_discriminator = 0x2136,\n\n  // Borland extensions.\n  DW_AT_BORLAND_property_read = 0x3b11,\n  DW_AT_BORLAND_property_write = 0x3b12,\n  DW_AT_BORLAND_property_implements = 0x3b13,\n  DW_AT_BORLAND_property_index = 0x3b14,\n  DW_AT_BORLAND_property_default = 0x3b15,\n  DW_AT_BORLAND_Delphi_unit = 0x3b20,\n  DW_AT_BORLAND_Delphi_class = 0x3b21,\n  DW_AT_BORLAND_Delphi_record = 0x3b22,\n  DW_AT_BORLAND_Delphi_metaclass = 0x3b23,\n  DW_AT_BORLAND_Delphi_constructor = 0x3b24,\n  DW_AT_BORLAND_Delphi_destructor = 0x3b25,\n  DW_AT_BORLAND_Delphi_anonymous_method = 0x3b26,\n  DW_AT_BORLAND_Delphi_interface = 0x3b27,\n  DW_AT_BORLAND_Delphi_ABI = 0x3b28,\n  DW_AT_BORLAND_Delphi_return = 0x3b29,\n  DW_AT_BORLAND_Delphi_frameptr = 0x3b30,\n  DW_AT_BORLAND_closure = 0x3b31,\n\n  // LLVM project extensions.\n  DW_AT_LLVM_include_path = 0x3e00,\n  DW_AT_LLVM_config_macros = 0x3e01,\n  DW_AT_LLVM_isysroot = 0x3e02,\n\n  // Apple extensions.\n  DW_AT_APPLE_optimized = 0x3fe1,\n  DW_AT_APPLE_flags = 0x3fe2,\n  DW_AT_APPLE_isa = 0x3fe3,\n  DW_AT_APPLE_block = 0x3fe4,\n  DW_AT_APPLE_major_runtime_vers = 0x3fe5,\n  DW_AT_APPLE_runtime_class = 0x3fe6,\n  DW_AT_APPLE_omit_frame_ptr = 0x3fe7,\n  DW_AT_APPLE_property_name = 0x3fe8,\n  DW_AT_APPLE_property_getter = 0x3fe9,\n  DW_AT_APPLE_property_setter = 0x3fea,\n  DW_AT_APPLE_property_attribute = 0x3feb,\n  DW_AT_APPLE_objc_complete_type = 0x3fec,\n  DW_AT_APPLE_property = 0x3fed\n};\n\nenum Form : uint16_t {\n  // Attribute form encodings\n  DW_FORM_addr = 0x01,\n  DW_FORM_block2 = 0x03,\n  DW_FORM_block4 = 0x04,\n  DW_FORM_data2 = 0x05,\n  DW_FORM_data4 = 0x06,\n  DW_FORM_data8 = 0x07,\n  DW_FORM_string = 0x08,\n  DW_FORM_block = 0x09,\n  DW_FORM_block1 = 0x0a,\n  DW_FORM_data1 = 0x0b,\n  DW_FORM_flag = 0x0c,\n  DW_FORM_sdata = 0x0d,\n  DW_FORM_strp = 0x0e,\n  DW_FORM_udata = 0x0f,\n  DW_FORM_ref_addr = 0x10,\n  DW_FORM_ref1 = 0x11,\n  DW_FORM_ref2 = 0x12,\n  DW_FORM_ref4 = 0x13,\n  DW_FORM_ref8 = 0x14,\n  DW_FORM_ref_udata = 0x15,\n  DW_FORM_indirect = 0x16,\n  DW_FORM_sec_offset = 0x17,\n  DW_FORM_exprloc = 0x18,\n  DW_FORM_flag_present = 0x19,\n  DW_FORM_ref_sig8 = 0x20,\n\n  // Extensions for Fission proposal\n  DW_FORM_GNU_addr_index = 0x1f01,\n  DW_FORM_GNU_str_index = 0x1f02,\n\n  // Alternate debug sections proposal (output of \"dwz\" tool).\n  DW_FORM_GNU_ref_alt = 0x1f20,\n  DW_FORM_GNU_strp_alt = 0x1f21\n};\n\nenum LocationAtom {\n#define HANDLE_DW_OP(ID, NAME) DW_OP_##NAME = ID,\n#include \"Dwarf.def\"\n  DW_OP_lo_user = 0xe0,\n  DW_OP_hi_user = 0xff\n};\n\nenum TypeKind {\n#define HANDLE_DW_ATE(ID, NAME) DW_ATE_##NAME = ID,\n#include \"Dwarf.def\"\n  DW_ATE_lo_user = 0x80,\n  DW_ATE_hi_user = 0xff\n};\n\nenum DecimalSignEncoding {\n  // Decimal sign attribute values\n  DW_DS_unsigned = 0x01,\n  DW_DS_leading_overpunch = 0x02,\n  DW_DS_trailing_overpunch = 0x03,\n  DW_DS_leading_separate = 0x04,\n  DW_DS_trailing_separate = 0x05\n};\n\nenum EndianityEncoding {\n  // Endianity attribute values\n  DW_END_default = 0x00,\n  DW_END_big = 0x01,\n  DW_END_little = 0x02,\n  DW_END_lo_user = 0x40,\n  DW_END_hi_user = 0xff\n};\n\nenum AccessAttribute {\n  // Accessibility codes\n  DW_ACCESS_public = 0x01,\n  DW_ACCESS_protected = 0x02,\n  DW_ACCESS_private = 0x03\n};\n\nenum VisibilityAttribute {\n  // Visibility codes\n  DW_VIS_local = 0x01,\n  DW_VIS_exported = 0x02,\n  DW_VIS_qualified = 0x03\n};\n\nenum VirtualityAttribute {\n#define HANDLE_DW_VIRTUALITY(ID, NAME) DW_VIRTUALITY_##NAME = ID,\n#include \"Dwarf.def\"\n  DW_VIRTUALITY_max = 0x02\n};\n\nenum SourceLanguage {\n#define HANDLE_DW_LANG(ID, NAME) DW_LANG_##NAME = ID,\n#include \"Dwarf.def\"\n  DW_LANG_lo_user = 0x8000,\n  DW_LANG_hi_user = 0xffff\n};\n\nenum CaseSensitivity {\n  // Identifier case codes\n  DW_ID_case_sensitive = 0x00,\n  DW_ID_up_case = 0x01,\n  DW_ID_down_case = 0x02,\n  DW_ID_case_insensitive = 0x03\n};\n\nenum CallingConvention {\n  // Calling convention codes\n  DW_CC_normal = 0x01,\n  DW_CC_program = 0x02,\n  DW_CC_nocall = 0x03,\n  DW_CC_lo_user = 0x40,\n  DW_CC_GNU_borland_fastcall_i386 = 0x41,\n  DW_CC_BORLAND_safecall = 0xb0,\n  DW_CC_BORLAND_stdcall = 0xb1,\n  DW_CC_BORLAND_pascal = 0xb2,\n  DW_CC_BORLAND_msfastcall = 0xb3,\n  DW_CC_BORLAND_msreturn = 0xb4,\n  DW_CC_BORLAND_thiscall = 0xb5,\n  DW_CC_BORLAND_fastcall = 0xb6,\n  DW_CC_hi_user = 0xff\n};\n\nenum InlineAttribute {\n  // Inline codes\n  DW_INL_not_inlined = 0x00,\n  DW_INL_inlined = 0x01,\n  DW_INL_declared_not_inlined = 0x02,\n  DW_INL_declared_inlined = 0x03\n};\n\nenum ArrayDimensionOrdering {\n  // Array ordering\n  DW_ORD_row_major = 0x00,\n  DW_ORD_col_major = 0x01\n};\n\nenum DiscriminantList {\n  // Discriminant descriptor values\n  DW_DSC_label = 0x00,\n  DW_DSC_range = 0x01\n};\n\nenum LineNumberOps {\n  // Line Number Standard Opcode Encodings\n  DW_LNS_extended_op = 0x00,\n  DW_LNS_copy = 0x01,\n  DW_LNS_advance_pc = 0x02,\n  DW_LNS_advance_line = 0x03,\n  DW_LNS_set_file = 0x04,\n  DW_LNS_set_column = 0x05,\n  DW_LNS_negate_stmt = 0x06,\n  DW_LNS_set_basic_block = 0x07,\n  DW_LNS_const_add_pc = 0x08,\n  DW_LNS_fixed_advance_pc = 0x09,\n  DW_LNS_set_prologue_end = 0x0a,\n  DW_LNS_set_epilogue_begin = 0x0b,\n  DW_LNS_set_isa = 0x0c\n};\n\nenum LineNumberExtendedOps {\n  // Line Number Extended Opcode Encodings\n  DW_LNE_end_sequence = 0x01,\n  DW_LNE_set_address = 0x02,\n  DW_LNE_define_file = 0x03,\n  DW_LNE_set_discriminator = 0x04,\n  DW_LNE_lo_user = 0x80,\n  DW_LNE_hi_user = 0xff\n};\n\nenum MacinfoRecordType {\n  // Macinfo Type Encodings\n  DW_MACINFO_define = 0x01,\n  DW_MACINFO_undef = 0x02,\n  DW_MACINFO_start_file = 0x03,\n  DW_MACINFO_end_file = 0x04,\n  DW_MACINFO_vendor_ext = 0xff\n};\n\nenum MacroEntryType {\n  // Macro Information Entry Type Encodings\n  DW_MACRO_define = 0x01,\n  DW_MACRO_undef = 0x02,\n  DW_MACRO_start_file = 0x03,\n  DW_MACRO_end_file = 0x04,\n  DW_MACRO_define_indirect = 0x05,\n  DW_MACRO_undef_indirect = 0x06,\n  DW_MACRO_transparent_include = 0x07,\n  DW_MACRO_define_indirect_sup = 0x08,\n  DW_MACRO_undef_indirect_sup = 0x09,\n  DW_MACRO_transparent_include_sup = 0x0a,\n  DW_MACRO_define_indirectx = 0x0b,\n  DW_MACRO_undef_indirectx = 0x0c,\n  DW_MACRO_lo_user = 0xe0,\n  DW_MACRO_hi_user = 0xff\n};\n\nenum CallFrameInfo {\n  // Call frame instruction encodings\n  DW_CFA_extended = 0x00,\n  DW_CFA_nop = 0x00,\n  DW_CFA_advance_loc = 0x40,\n  DW_CFA_offset = 0x80,\n  DW_CFA_restore = 0xc0,\n  DW_CFA_set_loc = 0x01,\n  DW_CFA_advance_loc1 = 0x02,\n  DW_CFA_advance_loc2 = 0x03,\n  DW_CFA_advance_loc4 = 0x04,\n  DW_CFA_offset_extended = 0x05,\n  DW_CFA_restore_extended = 0x06,\n  DW_CFA_undefined = 0x07,\n  DW_CFA_same_value = 0x08,\n  DW_CFA_register = 0x09,\n  DW_CFA_remember_state = 0x0a,\n  DW_CFA_restore_state = 0x0b,\n  DW_CFA_def_cfa = 0x0c,\n  DW_CFA_def_cfa_register = 0x0d,\n  DW_CFA_def_cfa_offset = 0x0e,\n  DW_CFA_def_cfa_expression = 0x0f,\n  DW_CFA_expression = 0x10,\n  DW_CFA_offset_extended_sf = 0x11,\n  DW_CFA_def_cfa_sf = 0x12,\n  DW_CFA_def_cfa_offset_sf = 0x13,\n  DW_CFA_val_offset = 0x14,\n  DW_CFA_val_offset_sf = 0x15,\n  DW_CFA_val_expression = 0x16,\n  DW_CFA_MIPS_advance_loc8 = 0x1d,\n  DW_CFA_GNU_window_save = 0x2d,\n  DW_CFA_GNU_args_size = 0x2e,\n  DW_CFA_lo_user = 0x1c,\n  DW_CFA_hi_user = 0x3f\n};\n\nenum Constants {\n  // Children flag\n  DW_CHILDREN_no = 0x00,\n  DW_CHILDREN_yes = 0x01,\n\n  DW_EH_PE_absptr = 0x00,\n  DW_EH_PE_omit = 0xff,\n  DW_EH_PE_uleb128 = 0x01,\n  DW_EH_PE_udata2 = 0x02,\n  DW_EH_PE_udata4 = 0x03,\n  DW_EH_PE_udata8 = 0x04,\n  DW_EH_PE_sleb128 = 0x09,\n  DW_EH_PE_sdata2 = 0x0A,\n  DW_EH_PE_sdata4 = 0x0B,\n  DW_EH_PE_sdata8 = 0x0C,\n  DW_EH_PE_signed = 0x08,\n  DW_EH_PE_pcrel = 0x10,\n  DW_EH_PE_textrel = 0x20,\n  DW_EH_PE_datarel = 0x30,\n  DW_EH_PE_funcrel = 0x40,\n  DW_EH_PE_aligned = 0x50,\n  DW_EH_PE_indirect = 0x80\n};\n\n// Constants for debug_loc.dwo in the DWARF5 Split Debug Info Proposal\nenum LocationListEntry : unsigned char {\n  DW_LLE_end_of_list_entry,\n  DW_LLE_base_address_selection_entry,\n  DW_LLE_start_end_entry,\n  DW_LLE_start_length_entry,\n  DW_LLE_offset_pair_entry\n};\n\n/// Contstants for the DW_APPLE_PROPERTY_attributes attribute.\n/// Keep this list in sync with clang's DeclSpec.h ObjCPropertyAttributeKind.\nenum ApplePropertyAttributes {\n  // Apple Objective-C Property Attributes\n  DW_APPLE_PROPERTY_readonly = 0x01,\n  DW_APPLE_PROPERTY_getter = 0x02,\n  DW_APPLE_PROPERTY_assign = 0x04,\n  DW_APPLE_PROPERTY_readwrite = 0x08,\n  DW_APPLE_PROPERTY_retain = 0x10,\n  DW_APPLE_PROPERTY_copy = 0x20,\n  DW_APPLE_PROPERTY_nonatomic = 0x40,\n  DW_APPLE_PROPERTY_setter = 0x80,\n  DW_APPLE_PROPERTY_atomic = 0x100,\n  DW_APPLE_PROPERTY_weak =   0x200,\n  DW_APPLE_PROPERTY_strong = 0x400,\n  DW_APPLE_PROPERTY_unsafe_unretained = 0x800\n};\n\n// Constants for the DWARF5 Accelerator Table Proposal\nenum AcceleratorTable {\n  // Data layout descriptors.\n  DW_ATOM_null = 0u,       // Marker as the end of a list of atoms.\n  DW_ATOM_die_offset = 1u, // DIE offset in the debug_info section.\n  DW_ATOM_cu_offset = 2u, // Offset of the compile unit header that contains the\n                          // item in question.\n  DW_ATOM_die_tag = 3u,   // A tag entry.\n  DW_ATOM_type_flags = 4u, // Set of flags for a type.\n\n  // DW_ATOM_type_flags values.\n\n  // Always set for C++, only set for ObjC if this is the @implementation for a\n  // class.\n  DW_FLAG_type_implementation = 2u,\n\n  // Hash functions.\n\n  // Daniel J. Bernstein hash.\n  DW_hash_function_djb = 0u\n};\n\n// Constants for the GNU pubnames/pubtypes extensions supporting gdb index.\nenum GDBIndexEntryKind {\n  GIEK_NONE,\n  GIEK_TYPE,\n  GIEK_VARIABLE,\n  GIEK_FUNCTION,\n  GIEK_OTHER,\n  GIEK_UNUSED5,\n  GIEK_UNUSED6,\n  GIEK_UNUSED7\n};\n\nenum GDBIndexEntryLinkage {\n  GIEL_EXTERNAL,\n  GIEL_STATIC\n};\n\n/// \\defgroup DwarfConstantsDumping Dwarf constants dumping functions\n///\n/// All these functions map their argument's value back to the\n/// corresponding enumerator name or return nullptr if the value isn't\n/// known.\n///\n/// @{\nconst char *TagString(unsigned Tag);\nconst char *ChildrenString(unsigned Children);\nconst char *AttributeString(unsigned Attribute);\nconst char *FormEncodingString(unsigned Encoding);\nconst char *OperationEncodingString(unsigned Encoding);\nconst char *AttributeEncodingString(unsigned Encoding);\nconst char *DecimalSignString(unsigned Sign);\nconst char *EndianityString(unsigned Endian);\nconst char *AccessibilityString(unsigned Access);\nconst char *VisibilityString(unsigned Visibility);\nconst char *VirtualityString(unsigned Virtuality);\nconst char *LanguageString(unsigned Language);\nconst char *CaseString(unsigned Case);\nconst char *ConventionString(unsigned Convention);\nconst char *InlineCodeString(unsigned Code);\nconst char *ArrayOrderString(unsigned Order);\nconst char *DiscriminantString(unsigned Discriminant);\nconst char *LNStandardString(unsigned Standard);\nconst char *LNExtendedString(unsigned Encoding);\nconst char *MacinfoString(unsigned Encoding);\nconst char *CallFrameString(unsigned Encoding);\nconst char *ApplePropertyString(unsigned);\nconst char *AtomTypeString(unsigned Atom);\nconst char *GDBIndexEntryKindString(GDBIndexEntryKind Kind);\nconst char *GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);\n/// @}\n\n/// \\brief Returns the symbolic string representing Val when used as a value\n/// for attribute Attr.\nconst char *AttributeValueString(uint16_t Attr, unsigned Val);\n\n/// \\brief Decsribes an entry of the various gnu_pub* debug sections.\n///\n/// The gnu_pub* kind looks like:\n///\n/// 0-3  reserved\n/// 4-6  symbol kind\n/// 7    0 == global, 1 == static\n///\n/// A gdb_index descriptor includes the above kind, shifted 24 bits up with the\n/// offset of the cu within the debug_info section stored in those 24 bits.\nstruct PubIndexEntryDescriptor {\n  GDBIndexEntryKind Kind;\n  GDBIndexEntryLinkage Linkage;\n  PubIndexEntryDescriptor(GDBIndexEntryKind Kind, GDBIndexEntryLinkage Linkage)\n      : Kind(Kind), Linkage(Linkage) {}\n  /* implicit */ PubIndexEntryDescriptor(GDBIndexEntryKind Kind)\n      : Kind(Kind), Linkage(GIEL_EXTERNAL) {}\n  explicit PubIndexEntryDescriptor(uint8_t Value)\n      : Kind(static_cast<GDBIndexEntryKind>((Value & KIND_MASK) >>\n                                            KIND_OFFSET)),\n        Linkage(static_cast<GDBIndexEntryLinkage>((Value & LINKAGE_MASK) >>\n                                                  LINKAGE_OFFSET)) {}\n  uint8_t toBits() { return Kind << KIND_OFFSET | Linkage << LINKAGE_OFFSET; }\n\nprivate:\n  enum {\n    KIND_OFFSET = 4,\n    KIND_MASK = 7 << KIND_OFFSET,\n    LINKAGE_OFFSET = 7,\n    LINKAGE_MASK = 1 << LINKAGE_OFFSET\n  };\n};\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/llvm/ELF.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// ==============================================================================\n// LLVM Release License\n// ==============================================================================\n// University of Illinois/NCSA\n// Open Source License\n//\n// Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.\n// All rights reserved.\n//\n// Developed by:\n//\n//     LLVM Team\n//\n//     University of Illinois at Urbana-Champaign\n//\n//     http://llvm.org\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy of\n// this software and associated documentation files (the \"Software\"), to deal with\n// the Software without restriction, including without limitation the rights to\n// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n// of the Software, and to permit persons to whom the Software is furnished to do\n// so, subject to the following conditions:\n//\n//     * Redistributions of source code must retain the above copyright notice,\n//       this list of conditions and the following disclaimers.\n//\n//     * Redistributions in binary form must reproduce the above copyright notice,\n//       this list of conditions and the following disclaimers in the\n//       documentation and/or other materials provided with the distribution.\n//\n//     * Neither the names of the LLVM Team, University of Illinois at\n//       Urbana-Champaign, nor the names of its contributors may be used to\n//       endorse or promote products derived from this Software without specific\n//       prior written permission.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE\n// SOFTWARE.\n\n//===----------------------------------------------------------------------===//\n// This header contains common, non-processor-specific data structures and\n// constants for the ELF file format.\n//\n// The details of the ELF32 bits in this file are largely based on the Tool\n// Interface Standard (TIS) Executable and Linking Format (ELF) Specification\n// Version 1.2, May 1995. The ELF64 stuff is based on ELF-64 Object File Format\n// Version 1.5, Draft 2, May 1998 as well as OpenBSD header files.\n//\n//===----------------------------------------------------------------------===//\n\n#ifndef LLVM_SUPPORT_ELF_H\n#define LLVM_SUPPORT_ELF_H\n\ntypedef uint32_t Elf32_Addr; // Program address\ntypedef uint32_t Elf32_Off;  // File offset\ntypedef uint16_t Elf32_Half;\ntypedef uint32_t Elf32_Word;\ntypedef int32_t  Elf32_Sword;\n\ntypedef uint64_t Elf64_Addr;\ntypedef uint64_t Elf64_Off;\ntypedef uint16_t Elf64_Half;\ntypedef uint32_t Elf64_Word;\ntypedef int32_t  Elf64_Sword;\ntypedef uint64_t Elf64_Xword;\ntypedef int64_t  Elf64_Sxword;\n\n// Object file magic string.\nstatic const char ElfMagic[] = { 0x7f, 'E', 'L', 'F', '\\0' };\n\n// e_ident size and indices.\nenum {\n  EI_MAG0       = 0,          // File identification index.\n  EI_MAG1       = 1,          // File identification index.\n  EI_MAG2       = 2,          // File identification index.\n  EI_MAG3       = 3,          // File identification index.\n  EI_CLASS      = 4,          // File class.\n  EI_DATA       = 5,          // Data encoding.\n  EI_VERSION    = 6,          // File version.\n  EI_OSABI      = 7,          // OS/ABI identification.\n  EI_ABIVERSION = 8,          // ABI version.\n  EI_PAD        = 9,          // Start of padding bytes.\n  EI_NIDENT     = 16          // Number of bytes in e_ident.\n};\n\nstruct Elf32_Ehdr {\n  unsigned char e_ident[EI_NIDENT]; // ELF Identification bytes\n  Elf32_Half    e_type;      // Type of file (see ET_* below)\n  Elf32_Half    e_machine;   // Required architecture for this file (see EM_*)\n  Elf32_Word    e_version;   // Must be equal to 1\n  Elf32_Addr    e_entry;     // Address to jump to in order to start program\n  Elf32_Off     e_phoff;     // Program header table's file offset, in bytes\n  Elf32_Off     e_shoff;     // Section header table's file offset, in bytes\n  Elf32_Word    e_flags;     // Processor-specific flags\n  Elf32_Half    e_ehsize;    // Size of ELF header, in bytes\n  Elf32_Half    e_phentsize; // Size of an entry in the program header table\n  Elf32_Half    e_phnum;     // Number of entries in the program header table\n  Elf32_Half    e_shentsize; // Size of an entry in the section header table\n  Elf32_Half    e_shnum;     // Number of entries in the section header table\n  Elf32_Half    e_shstrndx;  // Sect hdr table index of sect name string table\n  bool checkMagic() const {\n    return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;\n  }\n  unsigned char getFileClass() const { return e_ident[EI_CLASS]; }\n  unsigned char getDataEncoding() const { return e_ident[EI_DATA]; }\n  Elf32_Ehdr();\n};\n\n// 64-bit ELF header. Fields are the same as for ELF32, but with different\n// types (see above).\nstruct Elf64_Ehdr {\n  unsigned char e_ident[EI_NIDENT];\n  Elf64_Half    e_type;\n  Elf64_Half    e_machine;\n  Elf64_Word    e_version;\n  Elf64_Addr    e_entry;\n  Elf64_Off     e_phoff;\n  Elf64_Off     e_shoff;\n  Elf64_Word    e_flags;\n  Elf64_Half    e_ehsize;\n  Elf64_Half    e_phentsize;\n  Elf64_Half    e_phnum;\n  Elf64_Half    e_shentsize;\n  Elf64_Half    e_shnum;\n  Elf64_Half    e_shstrndx;\n  bool checkMagic() const {\n    return (memcmp(e_ident, ElfMagic, strlen(ElfMagic))) == 0;\n  }\n  unsigned char getFileClass() const { return e_ident[EI_CLASS]; }\n  unsigned char getDataEncoding() const { return e_ident[EI_DATA]; }\n  Elf64_Ehdr();\n};\n\n// File types\nenum {\n  ET_NONE   = 0,      // No file type\n  ET_REL    = 1,      // Relocatable file\n  ET_EXEC   = 2,      // Executable file\n  ET_DYN    = 3,      // Shared object file\n  ET_CORE   = 4,      // Core file\n  ET_LOPROC = 0xff00, // Beginning of processor-specific codes\n  ET_HIPROC = 0xffff  // Processor-specific\n};\n\n// Versioning\nenum {\n  EV_NONE = 0,\n  EV_CURRENT = 1\n};\n\n// Machine architectures\n// See current registered ELF machine architectures at:\n//    http://www.uxsglobal.com/developers/gabi/latest/ch4.eheader.html\nenum {\n  EM_NONE          = 0, // No machine\n  EM_M32           = 1, // AT&T WE 32100\n  EM_SPARC         = 2, // SPARC\n  EM_386           = 3, // Intel 386\n  EM_68K           = 4, // Motorola 68000\n  EM_88K           = 5, // Motorola 88000\n  EM_IAMCU         = 6, // Intel MCU\n  EM_860           = 7, // Intel 80860\n  EM_MIPS          = 8, // MIPS R3000\n  EM_S370          = 9, // IBM System/370\n  EM_MIPS_RS3_LE   = 10, // MIPS RS3000 Little-endian\n  EM_PARISC        = 15, // Hewlett-Packard PA-RISC\n  EM_VPP500        = 17, // Fujitsu VPP500\n  EM_SPARC32PLUS   = 18, // Enhanced instruction set SPARC\n  EM_960           = 19, // Intel 80960\n  EM_PPC           = 20, // PowerPC\n  EM_PPC64         = 21, // PowerPC64\n  EM_S390          = 22, // IBM System/390\n  EM_SPU           = 23, // IBM SPU/SPC\n  EM_V800          = 36, // NEC V800\n  EM_FR20          = 37, // Fujitsu FR20\n  EM_RH32          = 38, // TRW RH-32\n  EM_RCE           = 39, // Motorola RCE\n  EM_ARM           = 40, // ARM\n  EM_ALPHA         = 41, // DEC Alpha\n  EM_SH            = 42, // Hitachi SH\n  EM_SPARCV9       = 43, // SPARC V9\n  EM_TRICORE       = 44, // Siemens TriCore\n  EM_ARC           = 45, // Argonaut RISC Core\n  EM_H8_300        = 46, // Hitachi H8/300\n  EM_H8_300H       = 47, // Hitachi H8/300H\n  EM_H8S           = 48, // Hitachi H8S\n  EM_H8_500        = 49, // Hitachi H8/500\n  EM_IA_64         = 50, // Intel IA-64 processor architecture\n  EM_MIPS_X        = 51, // Stanford MIPS-X\n  EM_COLDFIRE      = 52, // Motorola ColdFire\n  EM_68HC12        = 53, // Motorola M68HC12\n  EM_MMA           = 54, // Fujitsu MMA Multimedia Accelerator\n  EM_PCP           = 55, // Siemens PCP\n  EM_NCPU          = 56, // Sony nCPU embedded RISC processor\n  EM_NDR1          = 57, // Denso NDR1 microprocessor\n  EM_STARCORE      = 58, // Motorola Star*Core processor\n  EM_ME16          = 59, // Toyota ME16 processor\n  EM_ST100         = 60, // STMicroelectronics ST100 processor\n  EM_TINYJ         = 61, // Advanced Logic Corp. TinyJ embedded processor family\n  EM_X86_64        = 62, // AMD x86-64 architecture\n  EM_PDSP          = 63, // Sony DSP Processor\n  EM_PDP10         = 64, // Digital Equipment Corp. PDP-10\n  EM_PDP11         = 65, // Digital Equipment Corp. PDP-11\n  EM_FX66          = 66, // Siemens FX66 microcontroller\n  EM_ST9PLUS       = 67, // STMicroelectronics ST9+ 8/16 bit microcontroller\n  EM_ST7           = 68, // STMicroelectronics ST7 8-bit microcontroller\n  EM_68HC16        = 69, // Motorola MC68HC16 Microcontroller\n  EM_68HC11        = 70, // Motorola MC68HC11 Microcontroller\n  EM_68HC08        = 71, // Motorola MC68HC08 Microcontroller\n  EM_68HC05        = 72, // Motorola MC68HC05 Microcontroller\n  EM_SVX           = 73, // Silicon Graphics SVx\n  EM_ST19          = 74, // STMicroelectronics ST19 8-bit microcontroller\n  EM_VAX           = 75, // Digital VAX\n  EM_CRIS          = 76, // Axis Communications 32-bit embedded processor\n  EM_JAVELIN       = 77, // Infineon Technologies 32-bit embedded processor\n  EM_FIREPATH      = 78, // Element 14 64-bit DSP Processor\n  EM_ZSP           = 79, // LSI Logic 16-bit DSP Processor\n  EM_MMIX          = 80, // Donald Knuth's educational 64-bit processor\n  EM_HUANY         = 81, // Harvard University machine-independent object files\n  EM_PRISM         = 82, // SiTera Prism\n  EM_AVR           = 83, // Atmel AVR 8-bit microcontroller\n  EM_FR30          = 84, // Fujitsu FR30\n  EM_D10V          = 85, // Mitsubishi D10V\n  EM_D30V          = 86, // Mitsubishi D30V\n  EM_V850          = 87, // NEC v850\n  EM_M32R          = 88, // Mitsubishi M32R\n  EM_MN10300       = 89, // Matsushita MN10300\n  EM_MN10200       = 90, // Matsushita MN10200\n  EM_PJ            = 91, // picoJava\n  EM_OPENRISC      = 92, // OpenRISC 32-bit embedded processor\n  EM_ARC_COMPACT   = 93, // ARC International ARCompact processor (old\n                         // spelling/synonym: EM_ARC_A5)\n  EM_XTENSA        = 94, // Tensilica Xtensa Architecture\n  EM_VIDEOCORE     = 95, // Alphamosaic VideoCore processor\n  EM_TMM_GPP       = 96, // Thompson Multimedia General Purpose Processor\n  EM_NS32K         = 97, // National Semiconductor 32000 series\n  EM_TPC           = 98, // Tenor Network TPC processor\n  EM_SNP1K         = 99, // Trebia SNP 1000 processor\n  EM_ST200         = 100, // STMicroelectronics (www.st.com) ST200\n  EM_IP2K          = 101, // Ubicom IP2xxx microcontroller family\n  EM_MAX           = 102, // MAX Processor\n  EM_CR            = 103, // National Semiconductor CompactRISC microprocessor\n  EM_F2MC16        = 104, // Fujitsu F2MC16\n  EM_MSP430        = 105, // Texas Instruments embedded microcontroller msp430\n  EM_BLACKFIN      = 106, // Analog Devices Blackfin (DSP) processor\n  EM_SE_C33        = 107, // S1C33 Family of Seiko Epson processors\n  EM_SEP           = 108, // Sharp embedded microprocessor\n  EM_ARCA          = 109, // Arca RISC Microprocessor\n  EM_UNICORE       = 110, // Microprocessor series from PKU-Unity Ltd. and MPRC\n                          // of Peking University\n  EM_EXCESS        = 111, // eXcess: 16/32/64-bit configurable embedded CPU\n  EM_DXP           = 112, // Icera Semiconductor Inc. Deep Execution Processor\n  EM_ALTERA_NIOS2  = 113, // Altera Nios II soft-core processor\n  EM_CRX           = 114, // National Semiconductor CompactRISC CRX\n  EM_XGATE         = 115, // Motorola XGATE embedded processor\n  EM_C166          = 116, // Infineon C16x/XC16x processor\n  EM_M16C          = 117, // Renesas M16C series microprocessors\n  EM_DSPIC30F      = 118, // Microchip Technology dsPIC30F Digital Signal\n                          // Controller\n  EM_CE            = 119, // Freescale Communication Engine RISC core\n  EM_M32C          = 120, // Renesas M32C series microprocessors\n  EM_TSK3000       = 131, // Altium TSK3000 core\n  EM_RS08          = 132, // Freescale RS08 embedded processor\n  EM_SHARC         = 133, // Analog Devices SHARC family of 32-bit DSP\n                          // processors\n  EM_ECOG2         = 134, // Cyan Technology eCOG2 microprocessor\n  EM_SCORE7        = 135, // Sunplus S+core7 RISC processor\n  EM_DSP24         = 136, // New Japan Radio (NJR) 24-bit DSP Processor\n  EM_VIDEOCORE3    = 137, // Broadcom VideoCore III processor\n  EM_LATTICEMICO32 = 138, // RISC processor for Lattice FPGA architecture\n  EM_SE_C17        = 139, // Seiko Epson C17 family\n  EM_TI_C6000      = 140, // The Texas Instruments TMS320C6000 DSP family\n  EM_TI_C2000      = 141, // The Texas Instruments TMS320C2000 DSP family\n  EM_TI_C5500      = 142, // The Texas Instruments TMS320C55x DSP family\n  EM_MMDSP_PLUS    = 160, // STMicroelectronics 64bit VLIW Data Signal Processor\n  EM_CYPRESS_M8C   = 161, // Cypress M8C microprocessor\n  EM_R32C          = 162, // Renesas R32C series microprocessors\n  EM_TRIMEDIA      = 163, // NXP Semiconductors TriMedia architecture family\n  EM_HEXAGON       = 164, // Qualcomm Hexagon processor\n  EM_8051          = 165, // Intel 8051 and variants\n  EM_STXP7X        = 166, // STMicroelectronics STxP7x family of configurable\n                          // and extensible RISC processors\n  EM_NDS32         = 167, // Andes Technology compact code size embedded RISC\n                          // processor family\n  EM_ECOG1         = 168, // Cyan Technology eCOG1X family\n  EM_ECOG1X        = 168, // Cyan Technology eCOG1X family\n  EM_MAXQ30        = 169, // Dallas Semiconductor MAXQ30 Core Micro-controllers\n  EM_XIMO16        = 170, // New Japan Radio (NJR) 16-bit DSP Processor\n  EM_MANIK         = 171, // M2000 Reconfigurable RISC Microprocessor\n  EM_CRAYNV2       = 172, // Cray Inc. NV2 vector architecture\n  EM_RX            = 173, // Renesas RX family\n  EM_METAG         = 174, // Imagination Technologies META processor\n                          // architecture\n  EM_MCST_ELBRUS   = 175, // MCST Elbrus general purpose hardware architecture\n  EM_ECOG16        = 176, // Cyan Technology eCOG16 family\n  EM_CR16          = 177, // National Semiconductor CompactRISC CR16 16-bit\n                          // microprocessor\n  EM_ETPU          = 178, // Freescale Extended Time Processing Unit\n  EM_SLE9X         = 179, // Infineon Technologies SLE9X core\n  EM_L10M          = 180, // Intel L10M\n  EM_K10M          = 181, // Intel K10M\n  EM_AARCH64       = 183, // ARM AArch64\n  EM_AVR32         = 185, // Atmel Corporation 32-bit microprocessor family\n  EM_STM8          = 186, // STMicroeletronics STM8 8-bit microcontroller\n  EM_TILE64        = 187, // Tilera TILE64 multicore architecture family\n  EM_TILEPRO       = 188, // Tilera TILEPro multicore architecture family\n  EM_CUDA          = 190, // NVIDIA CUDA architecture\n  EM_TILEGX        = 191, // Tilera TILE-Gx multicore architecture family\n  EM_CLOUDSHIELD   = 192, // CloudShield architecture family\n  EM_COREA_1ST     = 193, // KIPO-KAIST Core-A 1st generation processor family\n  EM_COREA_2ND     = 194, // KIPO-KAIST Core-A 2nd generation processor family\n  EM_ARC_COMPACT2  = 195, // Synopsys ARCompact V2\n  EM_OPEN8         = 196, // Open8 8-bit RISC soft processor core\n  EM_RL78          = 197, // Renesas RL78 family\n  EM_VIDEOCORE5    = 198, // Broadcom VideoCore V processor\n  EM_78KOR         = 199, // Renesas 78KOR family\n  EM_56800EX       = 200, // Freescale 56800EX Digital Signal Controller (DSC)\n  EM_BA1           = 201, // Beyond BA1 CPU architecture\n  EM_BA2           = 202, // Beyond BA2 CPU architecture\n  EM_XCORE         = 203, // XMOS xCORE processor family\n  EM_MCHP_PIC      = 204, // Microchip 8-bit PIC(r) family\n  EM_INTEL205      = 205, // Reserved by Intel\n  EM_INTEL206      = 206, // Reserved by Intel\n  EM_INTEL207      = 207, // Reserved by Intel\n  EM_INTEL208      = 208, // Reserved by Intel\n  EM_INTEL209      = 209, // Reserved by Intel\n  EM_KM32          = 210, // KM211 KM32 32-bit processor\n  EM_KMX32         = 211, // KM211 KMX32 32-bit processor\n  EM_KMX16         = 212, // KM211 KMX16 16-bit processor\n  EM_KMX8          = 213, // KM211 KMX8 8-bit processor\n  EM_KVARC         = 214, // KM211 KVARC processor\n  EM_CDP           = 215, // Paneve CDP architecture family\n  EM_COGE          = 216, // Cognitive Smart Memory Processor\n  EM_COOL          = 217, // iCelero CoolEngine\n  EM_NORC          = 218, // Nanoradio Optimized RISC\n  EM_CSR_KALIMBA   = 219, // CSR Kalimba architecture family\n  EM_AMDGPU        = 224, // AMD GPU architecture\n  EM_RISCV         = 243,\n  EM_LOONGARCH     = 258, // LoongArch processor\n\n  // A request has been made to the maintainer of the official registry for\n  // such numbers for an official value for WebAssembly. As soon as one is\n  // allocated, this enum will be updated to use it.\n  EM_WEBASSEMBLY   = 0x4157, // WebAssembly architecture\n};\n\n// Object file classes.\nenum {\n  ELFCLASSNONE = 0,\n  ELFCLASS32 = 1, // 32-bit object file\n  ELFCLASS64 = 2  // 64-bit object file\n};\n\n// Object file byte orderings.\nenum {\n  ELFDATANONE = 0, // Invalid data encoding.\n  ELFDATA2LSB = 1, // Little-endian object file\n  ELFDATA2MSB = 2  // Big-endian object file\n};\n\n// OS ABI identification.\nenum {\n  ELFOSABI_NONE = 0,          // UNIX System V ABI\n  ELFOSABI_HPUX = 1,          // HP-UX operating system\n  ELFOSABI_NETBSD = 2,        // NetBSD\n  ELFOSABI_GNU = 3,           // GNU/Linux\n  ELFOSABI_LINUX = 3,         // Historical alias for ELFOSABI_GNU.\n  ELFOSABI_HURD = 4,          // GNU/Hurd\n  ELFOSABI_SOLARIS = 6,       // Solaris\n  ELFOSABI_AIX = 7,           // AIX\n  ELFOSABI_IRIX = 8,          // IRIX\n  ELFOSABI_FREEBSD = 9,       // FreeBSD\n  ELFOSABI_TRU64 = 10,        // TRU64 UNIX\n  ELFOSABI_MODESTO = 11,      // Novell Modesto\n  ELFOSABI_OPENBSD = 12,      // OpenBSD\n  ELFOSABI_OPENVMS = 13,      // OpenVMS\n  ELFOSABI_NSK = 14,          // Hewlett-Packard Non-Stop Kernel\n  ELFOSABI_AROS = 15,         // AROS\n  ELFOSABI_FENIXOS = 16,      // FenixOS\n  ELFOSABI_CLOUDABI = 17,     // Nuxi CloudABI\n  ELFOSABI_C6000_ELFABI = 64, // Bare-metal TMS320C6000\n  ELFOSABI_AMDGPU_HSA = 64,   // AMD HSA runtime\n  ELFOSABI_C6000_LINUX = 65,  // Linux TMS320C6000\n  ELFOSABI_ARM = 97,          // ARM\n  ELFOSABI_STANDALONE = 255   // Standalone (embedded) application\n};\n\n#define ELF_RELOC(name, value) name = value,\n\n// Specific e_flags for PPC64\nenum {\n  // e_flags bits specifying ABI:\n  // 1 for original ABI using function descriptors,\n  // 2 for revised ABI without function descriptors,\n  // 0 for unspecified or not using any features affected by the differences.\n  EF_PPC64_ABI = 3\n};\n\n// Special values for the st_other field in the symbol table entry for PPC64.\nenum {\n  STO_PPC64_LOCAL_BIT = 5,\n  STO_PPC64_LOCAL_MASK = (7 << STO_PPC64_LOCAL_BIT)\n};\nstatic inline int64_t\ndecodePPC64LocalEntryOffset(unsigned Other) {\n  unsigned Val = (Other & STO_PPC64_LOCAL_MASK) >> STO_PPC64_LOCAL_BIT;\n  return ((1 << Val) >> 2) << 2;\n}\nstatic inline unsigned\nencodePPC64LocalEntryOffset(int64_t Offset) {\n  unsigned Val = (Offset >= 4 * 4\n                  ? (Offset >= 8 * 4\n                     ? (Offset >= 16 * 4 ? 6 : 5)\n                     : 4)\n                  : (Offset >= 2 * 4\n                     ? 3\n                     : (Offset >= 1 * 4 ? 2 : 0)));\n  return Val << STO_PPC64_LOCAL_BIT;\n}\n\n// ARM Specific e_flags\nenum : unsigned {\n  EF_ARM_SOFT_FLOAT =     0x00000200U,\n  EF_ARM_VFP_FLOAT =      0x00000400U,\n  EF_ARM_EABI_UNKNOWN =   0x00000000U,\n  EF_ARM_EABI_VER1 =      0x01000000U,\n  EF_ARM_EABI_VER2 =      0x02000000U,\n  EF_ARM_EABI_VER3 =      0x03000000U,\n  EF_ARM_EABI_VER4 =      0x04000000U,\n  EF_ARM_EABI_VER5 =      0x05000000U,\n  EF_ARM_EABIMASK =       0xFF000000U\n};\n\n// AVR specific e_flags\nenum : unsigned {\n  EF_AVR_ARCH_AVR1    = 1,\n  EF_AVR_ARCH_AVR2    = 2,\n  EF_AVR_ARCH_AVR25   = 25,\n  EF_AVR_ARCH_AVR3    = 3,\n  EF_AVR_ARCH_AVR31   = 31,\n  EF_AVR_ARCH_AVR35   = 35,\n  EF_AVR_ARCH_AVR4    = 4,\n  EF_AVR_ARCH_AVR5    = 5,\n  EF_AVR_ARCH_AVR51   = 51,\n  EF_AVR_ARCH_AVR6    = 6,\n  EF_AVR_ARCH_AVRTINY = 100,\n  EF_AVR_ARCH_XMEGA1  = 101,\n  EF_AVR_ARCH_XMEGA2  = 102,\n  EF_AVR_ARCH_XMEGA3  = 103,\n  EF_AVR_ARCH_XMEGA4  = 104,\n  EF_AVR_ARCH_XMEGA5  = 105,\n  EF_AVR_ARCH_XMEGA6  = 106,\n  EF_AVR_ARCH_XMEGA7  = 107\n};\n\n// Mips Specific e_flags\nenum : unsigned {\n  EF_MIPS_NOREORDER = 0x00000001, // Don't reorder instructions\n  EF_MIPS_PIC       = 0x00000002, // Position independent code\n  EF_MIPS_CPIC      = 0x00000004, // Call object with Position independent code\n  EF_MIPS_ABI2      = 0x00000020, // File uses N32 ABI\n  EF_MIPS_32BITMODE = 0x00000100, // Code compiled for a 64-bit machine\n                                  // in 32-bit mode\n  EF_MIPS_FP64      = 0x00000200, // Code compiled for a 32-bit machine\n                                  // but uses 64-bit FP registers\n  EF_MIPS_NAN2008   = 0x00000400, // Uses IEE 754-2008 NaN encoding\n\n  // ABI flags\n  EF_MIPS_ABI_O32    = 0x00001000, // This file follows the first MIPS 32 bit ABI\n  EF_MIPS_ABI_O64    = 0x00002000, // O32 ABI extended for 64-bit architecture.\n  EF_MIPS_ABI_EABI32 = 0x00003000, // EABI in 32 bit mode.\n  EF_MIPS_ABI_EABI64 = 0x00004000, // EABI in 64 bit mode.\n  EF_MIPS_ABI        = 0x0000f000, // Mask for selecting EF_MIPS_ABI_ variant.\n\n  // MIPS machine variant\n  EF_MIPS_MACH_3900    = 0x00810000, // Toshiba R3900\n  EF_MIPS_MACH_4010    = 0x00820000, // LSI R4010\n  EF_MIPS_MACH_4100    = 0x00830000, // NEC VR4100\n  EF_MIPS_MACH_4650    = 0x00850000, // MIPS R4650\n  EF_MIPS_MACH_4120    = 0x00870000, // NEC VR4120\n  EF_MIPS_MACH_4111    = 0x00880000, // NEC VR4111/VR4181\n  EF_MIPS_MACH_SB1     = 0x008a0000, // Broadcom SB-1\n  EF_MIPS_MACH_OCTEON  = 0x008b0000, // Cavium Networks Octeon\n  EF_MIPS_MACH_XLR     = 0x008c0000, // RMI Xlr\n  EF_MIPS_MACH_OCTEON2 = 0x008d0000, // Cavium Networks Octeon2\n  EF_MIPS_MACH_OCTEON3 = 0x008e0000, // Cavium Networks Octeon3\n  EF_MIPS_MACH_5400    = 0x00910000, // NEC VR5400\n  EF_MIPS_MACH_5900    = 0x00920000, // MIPS R5900\n  EF_MIPS_MACH_5500    = 0x00980000, // NEC VR5500\n  EF_MIPS_MACH_9000    = 0x00990000, // Unknown\n  EF_MIPS_MACH_LS2E    = 0x00a00000, // ST Microelectronics Loongson 2E\n  EF_MIPS_MACH_LS2F    = 0x00a10000, // ST Microelectronics Loongson 2F\n  EF_MIPS_MACH_LS3A    = 0x00a20000, // Loongson 3A\n  EF_MIPS_MACH         = 0x00ff0000, // EF_MIPS_MACH_xxx selection mask\n\n  // ARCH_ASE\n  EF_MIPS_MICROMIPS = 0x02000000, // microMIPS\n  EF_MIPS_ARCH_ASE_M16 =\n                      0x04000000, // Has Mips-16 ISA extensions\n  EF_MIPS_ARCH_ASE_MDMX =\n                      0x08000000, // Has MDMX multimedia extensions\n  EF_MIPS_ARCH_ASE  = 0x0f000000, // Mask for EF_MIPS_ARCH_ASE_xxx flags\n\n  // ARCH\n  EF_MIPS_ARCH_1    = 0x00000000, // MIPS1 instruction set\n  EF_MIPS_ARCH_2    = 0x10000000, // MIPS2 instruction set\n  EF_MIPS_ARCH_3    = 0x20000000, // MIPS3 instruction set\n  EF_MIPS_ARCH_4    = 0x30000000, // MIPS4 instruction set\n  EF_MIPS_ARCH_5    = 0x40000000, // MIPS5 instruction set\n  EF_MIPS_ARCH_32   = 0x50000000, // MIPS32 instruction set per linux not elf.h\n  EF_MIPS_ARCH_64   = 0x60000000, // MIPS64 instruction set per linux not elf.h\n  EF_MIPS_ARCH_32R2 = 0x70000000, // mips32r2, mips32r3, mips32r5\n  EF_MIPS_ARCH_64R2 = 0x80000000, // mips64r2, mips64r3, mips64r5\n  EF_MIPS_ARCH_32R6 = 0x90000000, // mips32r6\n  EF_MIPS_ARCH_64R6 = 0xa0000000, // mips64r6\n  EF_MIPS_ARCH      = 0xf0000000  // Mask for applying EF_MIPS_ARCH_ variant\n};\n\n// Special values for the st_other field in the symbol table entry for MIPS.\nenum {\n  STO_MIPS_OPTIONAL        = 0x04,  // Symbol whose definition is optional\n  STO_MIPS_PLT             = 0x08,  // PLT entry related dynamic table record\n  STO_MIPS_PIC             = 0x20,  // PIC func in an object mixes PIC/non-PIC\n  STO_MIPS_MICROMIPS       = 0x80,  // MIPS Specific ISA for MicroMips\n  STO_MIPS_MIPS16          = 0xf0   // MIPS Specific ISA for Mips16\n};\n\n// .MIPS.options section descriptor kinds\nenum {\n  ODK_NULL       = 0,   // Undefined\n  ODK_REGINFO    = 1,   // Register usage information\n  ODK_EXCEPTIONS = 2,   // Exception processing options\n  ODK_PAD        = 3,   // Section padding options\n  ODK_HWPATCH    = 4,   // Hardware patches applied\n  ODK_FILL       = 5,   // Linker fill value\n  ODK_TAGS       = 6,   // Space for tool identification\n  ODK_HWAND      = 7,   // Hardware AND patches applied\n  ODK_HWOR       = 8,   // Hardware OR patches applied\n  ODK_GP_GROUP   = 9,   // GP group to use for text/data sections\n  ODK_IDENT      = 10,  // ID information\n  ODK_PAGESIZE   = 11   // Page size information\n};\n\n// LoongArch Specific e_flags\nenum : unsigned {\n  EF_LARCH_ABI = 0x0003,\n  EF_LARCH_ABI_LP32 = 0x0001,\n  EF_LARCH_ABI_XLP32 = 0x0002,\n  EF_LARCH_ABI_LP64 = 0x0003,\n};\n\n// Hexagon-specific e_flags\nenum {\n  // Object processor version flags, bits[11:0]\n  EF_HEXAGON_MACH_V2      = 0x00000001,   // Hexagon V2\n  EF_HEXAGON_MACH_V3      = 0x00000002,   // Hexagon V3\n  EF_HEXAGON_MACH_V4      = 0x00000003,   // Hexagon V4\n  EF_HEXAGON_MACH_V5      = 0x00000004,   // Hexagon V5\n  EF_HEXAGON_MACH_V55     = 0x00000005,   // Hexagon V55\n  EF_HEXAGON_MACH_V60     = 0x00000060,   // Hexagon V60\n\n  // Highest ISA version flags\n  EF_HEXAGON_ISA_MACH     = 0x00000000,   // Same as specified in bits[11:0]\n                                          // of e_flags\n  EF_HEXAGON_ISA_V2       = 0x00000010,   // Hexagon V2 ISA\n  EF_HEXAGON_ISA_V3       = 0x00000020,   // Hexagon V3 ISA\n  EF_HEXAGON_ISA_V4       = 0x00000030,   // Hexagon V4 ISA\n  EF_HEXAGON_ISA_V5       = 0x00000040,   // Hexagon V5 ISA\n  EF_HEXAGON_ISA_V55      = 0x00000050,   // Hexagon V55 ISA\n  EF_HEXAGON_ISA_V60      = 0x00000060,   // Hexagon V60 ISA\n};\n\n// Hexagon-specific section indexes for common small data\nenum {\n  SHN_HEXAGON_SCOMMON     = 0xff00,       // Other access sizes\n  SHN_HEXAGON_SCOMMON_1   = 0xff01,       // Byte-sized access\n  SHN_HEXAGON_SCOMMON_2   = 0xff02,       // Half-word-sized access\n  SHN_HEXAGON_SCOMMON_4   = 0xff03,       // Word-sized access\n  SHN_HEXAGON_SCOMMON_8   = 0xff04        // Double-word-size access\n};\n\n\n#undef ELF_RELOC\n\n// Section header.\nstruct Elf32_Shdr {\n  Elf32_Word sh_name;      // Section name (index into string table)\n  Elf32_Word sh_type;      // Section type (SHT_*)\n  Elf32_Word sh_flags;     // Section flags (SHF_*)\n  Elf32_Addr sh_addr;      // Address where section is to be loaded\n  Elf32_Off  sh_offset;    // File offset of section data, in bytes\n  Elf32_Word sh_size;      // Size of section, in bytes\n  Elf32_Word sh_link;      // Section type-specific header table index link\n  Elf32_Word sh_info;      // Section type-specific extra information\n  Elf32_Word sh_addralign; // Section address alignment\n  Elf32_Word sh_entsize;   // Size of records contained within the section\n};\n\n// Section header for ELF64 - same fields as ELF32, different types.\nstruct Elf64_Shdr {\n  Elf64_Word  sh_name;\n  Elf64_Word  sh_type;\n  Elf64_Xword sh_flags;\n  Elf64_Addr  sh_addr;\n  Elf64_Off   sh_offset;\n  Elf64_Xword sh_size;\n  Elf64_Word  sh_link;\n  Elf64_Word  sh_info;\n  Elf64_Xword sh_addralign;\n  Elf64_Xword sh_entsize;\n};\n\n// Special section indices.\nenum {\n  SHN_UNDEF     = 0,      // Undefined, missing, irrelevant, or meaningless\n  SHN_LORESERVE = 0xff00, // Lowest reserved index\n  SHN_LOPROC    = 0xff00, // Lowest processor-specific index\n  SHN_HIPROC    = 0xff1f, // Highest processor-specific index\n  SHN_LOOS      = 0xff20, // Lowest operating system-specific index\n  SHN_HIOS      = 0xff3f, // Highest operating system-specific index\n  SHN_ABS       = 0xfff1, // Symbol has absolute value; does not need relocation\n  SHN_COMMON    = 0xfff2, // FORTRAN COMMON or C external global variables\n  SHN_XINDEX    = 0xffff, // Mark that the index is >= SHN_LORESERVE\n  SHN_HIRESERVE = 0xffff  // Highest reserved index\n};\n\n// Section types.\nenum : unsigned {\n  SHT_NULL          = 0,  // No associated section (inactive entry).\n  SHT_PROGBITS      = 1,  // Program-defined contents.\n  SHT_SYMTAB        = 2,  // Symbol table.\n  SHT_STRTAB        = 3,  // String table.\n  SHT_RELA          = 4,  // Relocation entries; explicit addends.\n  SHT_HASH          = 5,  // Symbol hash table.\n  SHT_DYNAMIC       = 6,  // Information for dynamic linking.\n  SHT_NOTE          = 7,  // Information about the file.\n  SHT_NOBITS        = 8,  // Data occupies no space in the file.\n  SHT_REL           = 9,  // Relocation entries; no explicit addends.\n  SHT_SHLIB         = 10, // Reserved.\n  SHT_DYNSYM        = 11, // Symbol table.\n  SHT_INIT_ARRAY    = 14, // Pointers to initialization functions.\n  SHT_FINI_ARRAY    = 15, // Pointers to termination functions.\n  SHT_PREINIT_ARRAY = 16, // Pointers to pre-init functions.\n  SHT_GROUP         = 17, // Section group.\n  SHT_SYMTAB_SHNDX  = 18, // Indices for SHN_XINDEX entries.\n  SHT_LOOS          = 0x60000000, // Lowest operating system-specific type.\n  SHT_GNU_ATTRIBUTES= 0x6ffffff5, // Object attributes.\n  SHT_GNU_HASH      = 0x6ffffff6, // GNU-style hash table.\n  SHT_GNU_verdef    = 0x6ffffffd, // GNU version definitions.\n  SHT_GNU_verneed   = 0x6ffffffe, // GNU version references.\n  SHT_GNU_versym    = 0x6fffffff, // GNU symbol versions table.\n  SHT_HIOS          = 0x6fffffff, // Highest operating system-specific type.\n  SHT_LOPROC        = 0x70000000, // Lowest processor arch-specific type.\n  // Fixme: All this is duplicated in MCSectionELF. Why??\n  // Exception Index table\n  SHT_ARM_EXIDX           = 0x70000001U,\n  // BPABI DLL dynamic linking pre-emption map\n  SHT_ARM_PREEMPTMAP      = 0x70000002U,\n  //  Object file compatibility attributes\n  SHT_ARM_ATTRIBUTES      = 0x70000003U,\n  SHT_ARM_DEBUGOVERLAY    = 0x70000004U,\n  SHT_ARM_OVERLAYSECTION  = 0x70000005U,\n  SHT_HEX_ORDERED         = 0x70000000, // Link editor is to sort the entries in\n                                        // this section based on their sizes\n  SHT_X86_64_UNWIND       = 0x70000001, // Unwind information\n\n  SHT_MIPS_REGINFO        = 0x70000006, // Register usage information\n  SHT_MIPS_OPTIONS        = 0x7000000d, // General options\n  SHT_MIPS_ABIFLAGS       = 0x7000002a, // ABI information.\n\n  SHT_LOONGARCH_REGINFO = 0x70000006,        // Register usage information\n  SHT_LOONGARCH_OPTIONS = 0x7000000d,        // General options\n  SHT_LOONGARCH_DWARF = 0x7000001e,          // DWARF debugging section.\n  SHT_LOONGARCH_ABIFLAGS = 0x7000002a,       // ABI information.\n\n  SHT_HIPROC        = 0x7fffffff, // Highest processor arch-specific type.\n  SHT_LOUSER        = 0x80000000, // Lowest type reserved for applications.\n  SHT_HIUSER        = 0xffffffff  // Highest type reserved for applications.\n};\n\n// Section flags.\nenum : unsigned {\n  // Section data should be writable during execution.\n  SHF_WRITE = 0x1,\n\n  // Section occupies memory during program execution.\n  SHF_ALLOC = 0x2,\n\n  // Section contains executable machine instructions.\n  SHF_EXECINSTR = 0x4,\n\n  // The data in this section may be merged.\n  SHF_MERGE = 0x10,\n\n  // The data in this section is null-terminated strings.\n  SHF_STRINGS = 0x20,\n\n  // A field in this section holds a section header table index.\n  SHF_INFO_LINK = 0x40U,\n\n  // Adds special ordering requirements for link editors.\n  SHF_LINK_ORDER = 0x80U,\n\n  // This section requires special OS-specific processing to avoid incorrect\n  // behavior.\n  SHF_OS_NONCONFORMING = 0x100U,\n\n  // This section is a member of a section group.\n  SHF_GROUP = 0x200U,\n\n  // This section holds Thread-Local Storage.\n  SHF_TLS = 0x400U,\n\n  // This section is excluded from the final executable or shared library.\n  SHF_EXCLUDE = 0x80000000U,\n\n  // Start of target-specific flags.\n\n  /// XCORE_SHF_CP_SECTION - All sections with the \"c\" flag are grouped\n  /// together by the linker to form the constant pool and the cp register is\n  /// set to the start of the constant pool by the boot code.\n  XCORE_SHF_CP_SECTION = 0x800U,\n\n  /// XCORE_SHF_DP_SECTION - All sections with the \"d\" flag are grouped\n  /// together by the linker to form the data section and the dp register is\n  /// set to the start of the section by the boot code.\n  XCORE_SHF_DP_SECTION = 0x1000U,\n\n  SHF_MASKOS   = 0x0ff00000,\n\n  // Bits indicating processor-specific flags.\n  SHF_MASKPROC = 0xf0000000,\n\n  // If an object file section does not have this flag set, then it may not hold\n  // more than 2GB and can be freely referred to in objects using smaller code\n  // models. Otherwise, only objects using larger code models can refer to them.\n  // For example, a medium code model object can refer to data in a section that\n  // sets this flag besides being able to refer to data in a section that does\n  // not set it; likewise, a small code model object can refer only to code in a\n  // section that does not set this flag.\n  SHF_X86_64_LARGE = 0x10000000,\n\n  // All sections with the GPREL flag are grouped into a global data area\n  // for faster accesses\n  SHF_HEX_GPREL = 0x10000000,\n\n  // Section contains text/data which may be replicated in other sections.\n  // Linker must retain only one copy.\n  SHF_MIPS_NODUPES = 0x01000000,\n\n  // Linker must generate implicit hidden weak names.\n  SHF_MIPS_NAMES   = 0x02000000,\n\n  // Section data local to process.\n  SHF_MIPS_LOCAL   = 0x04000000,\n\n  // Do not strip this section.\n  SHF_MIPS_NOSTRIP = 0x08000000,\n\n  // Section must be part of global data area.\n  SHF_MIPS_GPREL   = 0x10000000,\n\n  // This section should be merged.\n  SHF_MIPS_MERGE   = 0x20000000,\n\n  // Address size to be inferred from section entry size.\n  SHF_MIPS_ADDR    = 0x40000000,\n\n  // Section data is string data by default.\n  SHF_MIPS_STRING  = 0x80000000,\n\n  // Linker must retain only one copy.\n  SHF_LOONGARCH_NODUPES = 0x01000000,\n\n  // Linker must generate implicit hidden weak names.\n  SHF_LOONGARCH_NAMES = 0x02000000,\n\n  // Section data local to process.\n  SHF_LOONGARCH_LOCAL = 0x04000000,\n\n  // Do not strip this section.\n  SHF_LOONGARCH_NOSTRIP = 0x08000000,\n\n  // Section must be part of global data area.\n  SHF_LOONGARCH_GPREL = 0x10000000,\n\n  // This section should be merged.\n  SHF_LOONGARCH_MERGE = 0x20000000,\n\n  // Address size to be inferred from section entry size.\n  SHF_LOONGARCH_ADDR = 0x40000000,\n\n  // Section data is string data by default.\n  SHF_LOONGARCH_STRING = 0x80000000,\n\n  SHF_AMDGPU_HSA_GLOBAL   = 0x00100000,\n  SHF_AMDGPU_HSA_READONLY = 0x00200000,\n  SHF_AMDGPU_HSA_CODE     = 0x00400000,\n  SHF_AMDGPU_HSA_AGENT    = 0x00800000\n};\n\n// Section Group Flags\nenum : unsigned {\n  GRP_COMDAT = 0x1,\n  GRP_MASKOS = 0x0ff00000,\n  GRP_MASKPROC = 0xf0000000\n};\n\n// Symbol table entries for ELF32.\nstruct Elf32_Sym {\n  Elf32_Word    st_name;  // Symbol name (index into string table)\n  Elf32_Addr    st_value; // Value or address associated with the symbol\n  Elf32_Word    st_size;  // Size of the symbol\n  unsigned char st_info;  // Symbol's type and binding attributes\n  unsigned char st_other; // Must be zero; reserved\n  Elf32_Half    st_shndx; // Which section (header table index) it's defined in\n\n  // These accessors and mutators correspond to the ELF32_ST_BIND,\n  // ELF32_ST_TYPE, and ELF32_ST_INFO macros defined in the ELF specification:\n  unsigned char getBinding() const { return st_info >> 4; }\n  unsigned char getType() const { return st_info & 0x0f; }\n  void setBinding(unsigned char b) { setBindingAndType(b, getType()); }\n  void setType(unsigned char t) { setBindingAndType(getBinding(), t); }\n  void setBindingAndType(unsigned char b, unsigned char t) {\n    st_info = (unsigned char)((b << 4) + (t & 0x0f));\n  }\n};\n\n// Symbol table entries for ELF64.\nstruct Elf64_Sym {\n  Elf64_Word      st_name;  // Symbol name (index into string table)\n  unsigned char   st_info;  // Symbol's type and binding attributes\n  unsigned char   st_other; // Must be zero; reserved\n  Elf64_Half      st_shndx; // Which section (header tbl index) it's defined in\n  Elf64_Addr      st_value; // Value or address associated with the symbol\n  Elf64_Xword     st_size;  // Size of the symbol\n\n  // These accessors and mutators are identical to those defined for ELF32\n  // symbol table entries.\n  unsigned char getBinding() const { return st_info >> 4; }\n  unsigned char getType() const { return st_info & 0x0f; }\n  void setBinding(unsigned char b) { setBindingAndType(b, getType()); }\n  void setType(unsigned char t) { setBindingAndType(getBinding(), t); }\n  void setBindingAndType(unsigned char b, unsigned char t) {\n    st_info = (unsigned char)((b << 4) + (t & 0x0f));\n  }\n};\n\n// The size (in bytes) of symbol table entries.\nenum {\n  SYMENTRY_SIZE32 = 16, // 32-bit symbol entry size\n  SYMENTRY_SIZE64 = 24  // 64-bit symbol entry size.\n};\n\n// Symbol bindings.\nenum {\n  STB_LOCAL = 0,   // Local symbol, not visible outside obj file containing def\n  STB_GLOBAL = 1,  // Global symbol, visible to all object files being combined\n  STB_WEAK = 2,    // Weak symbol, like global but lower-precedence\n  STB_GNU_UNIQUE = 10,\n  STB_LOOS   = 10, // Lowest operating system-specific binding type\n  STB_HIOS   = 12, // Highest operating system-specific binding type\n  STB_LOPROC = 13, // Lowest processor-specific binding type\n  STB_HIPROC = 15  // Highest processor-specific binding type\n};\n\n// Symbol types.\nenum {\n  STT_NOTYPE  = 0,   // Symbol's type is not specified\n  STT_OBJECT  = 1,   // Symbol is a data object (variable, array, etc.)\n  STT_FUNC    = 2,   // Symbol is executable code (function, etc.)\n  STT_SECTION = 3,   // Symbol refers to a section\n  STT_FILE    = 4,   // Local, absolute symbol that refers to a file\n  STT_COMMON  = 5,   // An uninitialized common block\n  STT_TLS     = 6,   // Thread local data object\n  STT_GNU_IFUNC = 10, // GNU indirect function\n  STT_LOOS    = 10,  // Lowest operating system-specific symbol type\n  STT_HIOS    = 12,  // Highest operating system-specific symbol type\n  STT_LOPROC  = 13,  // Lowest processor-specific symbol type\n  STT_HIPROC  = 15,  // Highest processor-specific symbol type\n\n  // AMDGPU symbol types\n  STT_AMDGPU_HSA_KERNEL            = 10,\n  STT_AMDGPU_HSA_INDIRECT_FUNCTION = 11,\n  STT_AMDGPU_HSA_METADATA          = 12\n};\n\nenum {\n  STV_DEFAULT   = 0,  // Visibility is specified by binding type\n  STV_INTERNAL  = 1,  // Defined by processor supplements\n  STV_HIDDEN    = 2,  // Not visible to other components\n  STV_PROTECTED = 3   // Visible in other components but not preemptable\n};\n\n// Symbol number.\nenum {\n  STN_UNDEF = 0\n};\n\n// Special relocation symbols used in the MIPS64 ELF relocation entries\nenum {\n  RSS_UNDEF = 0, // None\n  RSS_GP = 1,    // Value of gp\n  RSS_GP0 = 2,   // Value of gp used to create object being relocated\n  RSS_LOC = 3    // Address of location being relocated\n};\n\n// Relocation entry, without explicit addend.\nstruct Elf32_Rel {\n  Elf32_Addr r_offset; // Location (file byte offset, or program virtual addr)\n  Elf32_Word r_info;   // Symbol table index and type of relocation to apply\n\n  // These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,\n  // and ELF32_R_INFO macros defined in the ELF specification:\n  Elf32_Word getSymbol() const { return (r_info >> 8); }\n  unsigned char getType() const { return (unsigned char) (r_info & 0x0ff); }\n  void setSymbol(Elf32_Word s) { setSymbolAndType(s, getType()); }\n  void setType(unsigned char t) { setSymbolAndType(getSymbol(), t); }\n  void setSymbolAndType(Elf32_Word s, unsigned char t) {\n    r_info = (s << 8) + t;\n  }\n};\n\n// Relocation entry with explicit addend.\nstruct Elf32_Rela {\n  Elf32_Addr  r_offset; // Location (file byte offset, or program virtual addr)\n  Elf32_Word  r_info;   // Symbol table index and type of relocation to apply\n  Elf32_Sword r_addend; // Compute value for relocatable field by adding this\n\n  // These accessors and mutators correspond to the ELF32_R_SYM, ELF32_R_TYPE,\n  // and ELF32_R_INFO macros defined in the ELF specification:\n  Elf32_Word getSymbol() const { return (r_info >> 8); }\n  unsigned char getType() const { return (unsigned char) (r_info & 0x0ff); }\n  void setSymbol(Elf32_Word s) { setSymbolAndType(s, getType()); }\n  void setType(unsigned char t) { setSymbolAndType(getSymbol(), t); }\n  void setSymbolAndType(Elf32_Word s, unsigned char t) {\n    r_info = (s << 8) + t;\n  }\n};\n\n// Relocation entry, without explicit addend.\nstruct Elf64_Rel {\n  Elf64_Addr r_offset; // Location (file byte offset, or program virtual addr).\n  Elf64_Xword r_info;   // Symbol table index and type of relocation to apply.\n\n  // These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE,\n  // and ELF64_R_INFO macros defined in the ELF specification:\n  Elf64_Word getSymbol() const { return (r_info >> 32); }\n  Elf64_Word getType() const {\n    return (Elf64_Word) (r_info & 0xffffffffL);\n  }\n  void setSymbol(Elf64_Word s) { setSymbolAndType(s, getType()); }\n  void setType(Elf64_Word t) { setSymbolAndType(getSymbol(), t); }\n  void setSymbolAndType(Elf64_Word s, Elf64_Word t) {\n    r_info = ((Elf64_Xword)s << 32) + (t&0xffffffffL);\n  }\n};\n\n// Relocation entry with explicit addend.\nstruct Elf64_Rela {\n  Elf64_Addr  r_offset; // Location (file byte offset, or program virtual addr).\n  Elf64_Xword  r_info;   // Symbol table index and type of relocation to apply.\n  Elf64_Sxword r_addend; // Compute value for relocatable field by adding this.\n\n  // These accessors and mutators correspond to the ELF64_R_SYM, ELF64_R_TYPE,\n  // and ELF64_R_INFO macros defined in the ELF specification:\n  Elf64_Word getSymbol() const { return (r_info >> 32); }\n  Elf64_Word getType() const {\n    return (Elf64_Word) (r_info & 0xffffffffL);\n  }\n  void setSymbol(Elf64_Word s) { setSymbolAndType(s, getType()); }\n  void setType(Elf64_Word t) { setSymbolAndType(getSymbol(), t); }\n  void setSymbolAndType(Elf64_Word s, Elf64_Word t) {\n    r_info = ((Elf64_Xword)s << 32) + (t&0xffffffffL);\n  }\n};\n\n// Program header for ELF32.\nstruct Elf32_Phdr {\n  Elf32_Word p_type;   // Type of segment\n  Elf32_Off  p_offset; // File offset where segment is located, in bytes\n  Elf32_Addr p_vaddr;  // Virtual address of beginning of segment\n  Elf32_Addr p_paddr;  // Physical address of beginning of segment (OS-specific)\n  Elf32_Word p_filesz; // Num. of bytes in file image of segment (may be zero)\n  Elf32_Word p_memsz;  // Num. of bytes in mem image of segment (may be zero)\n  Elf32_Word p_flags;  // Segment flags\n  Elf32_Word p_align;  // Segment alignment constraint\n};\n\n// Program header for ELF64.\nstruct Elf64_Phdr {\n  Elf64_Word   p_type;   // Type of segment\n  Elf64_Word   p_flags;  // Segment flags\n  Elf64_Off    p_offset; // File offset where segment is located, in bytes\n  Elf64_Addr   p_vaddr;  // Virtual address of beginning of segment\n  Elf64_Addr   p_paddr;  // Physical addr of beginning of segment (OS-specific)\n  Elf64_Xword  p_filesz; // Num. of bytes in file image of segment (may be zero)\n  Elf64_Xword  p_memsz;  // Num. of bytes in mem image of segment (may be zero)\n  Elf64_Xword  p_align;  // Segment alignment constraint\n};\n\n// Segment types.\nenum {\n  PT_NULL    = 0, // Unused segment.\n  PT_LOAD    = 1, // Loadable segment.\n  PT_DYNAMIC = 2, // Dynamic linking information.\n  PT_INTERP  = 3, // Interpreter pathname.\n  PT_NOTE    = 4, // Auxiliary information.\n  PT_SHLIB   = 5, // Reserved.\n  PT_PHDR    = 6, // The program header table itself.\n  PT_TLS     = 7, // The thread-local storage template.\n  PT_LOOS    = 0x60000000, // Lowest operating system-specific pt entry type.\n  PT_HIOS    = 0x6fffffff, // Highest operating system-specific pt entry type.\n  PT_LOPROC  = 0x70000000, // Lowest processor-specific program hdr entry type.\n  PT_HIPROC  = 0x7fffffff, // Highest processor-specific program hdr entry type.\n\n  // x86-64 program header types.\n  // These all contain stack unwind tables.\n  PT_GNU_EH_FRAME  = 0x6474e550,\n  PT_SUNW_EH_FRAME = 0x6474e550,\n  PT_SUNW_UNWIND   = 0x6464e550,\n\n  PT_GNU_STACK  = 0x6474e551, // Indicates stack executability.\n  PT_GNU_RELRO  = 0x6474e552, // Read-only after relocation.\n\n  // ARM program header types.\n  PT_ARM_ARCHEXT = 0x70000000, // Platform architecture compatibility info\n  // These all contain stack unwind tables.\n  PT_ARM_EXIDX   = 0x70000001,\n  PT_ARM_UNWIND  = 0x70000001,\n\n  // MIPS program header types.\n  PT_MIPS_REGINFO  = 0x70000000,  // Register usage information.\n  PT_MIPS_RTPROC   = 0x70000001,  // Runtime procedure table.\n  PT_MIPS_OPTIONS  = 0x70000002,  // Options segment.\n  PT_MIPS_ABIFLAGS = 0x70000003,  // Abiflags segment.\n\n  // LOONGARCH program header types.\n  PT_LOONGARCH_REGINFO = 0x70000000,  // Register usage information.\n  PT_LOONGARCH_RTPROC = 0x70000001,   // Runtime procedure table.\n  PT_LOONGARCH_OPTIONS = 0x70000002,  // Options segment.\n  PT_LOONGARCH_ABIFLAGS = 0x70000003, // Abiflags segment.\n\n  // AMDGPU program header types.\n  PT_AMDGPU_HSA_LOAD_GLOBAL_PROGRAM = 0x60000000,\n  PT_AMDGPU_HSA_LOAD_GLOBAL_AGENT   = 0x60000001,\n  PT_AMDGPU_HSA_LOAD_READONLY_AGENT = 0x60000002,\n  PT_AMDGPU_HSA_LOAD_CODE_AGENT     = 0x60000003,\n\n  // WebAssembly program header types.\n  PT_WEBASSEMBLY_FUNCTIONS = PT_LOPROC + 0, // Function definitions.\n};\n\n// Segment flag bits.\nenum : unsigned {\n  PF_X        = 1,         // Execute\n  PF_W        = 2,         // Write\n  PF_R        = 4,         // Read\n  PF_MASKOS   = 0x0ff00000,// Bits for operating system-specific semantics.\n  PF_MASKPROC = 0xf0000000 // Bits for processor-specific semantics.\n};\n\n// Dynamic table entry for ELF32.\nstruct Elf32_Dyn\n{\n  Elf32_Sword d_tag;            // Type of dynamic table entry.\n  union\n  {\n      Elf32_Word d_val;         // Integer value of entry.\n      Elf32_Addr d_ptr;         // Pointer value of entry.\n  } d_un;\n};\n\n// Dynamic table entry for ELF64.\nstruct Elf64_Dyn\n{\n  Elf64_Sxword d_tag;           // Type of dynamic table entry.\n  union\n  {\n      Elf64_Xword d_val;        // Integer value of entry.\n      Elf64_Addr  d_ptr;        // Pointer value of entry.\n  } d_un;\n};\n\n// Dynamic table entry tags.\nenum {\n  DT_NULL         = 0,        // Marks end of dynamic array.\n  DT_NEEDED       = 1,        // String table offset of needed library.\n  DT_PLTRELSZ     = 2,        // Size of relocation entries in PLT.\n  DT_PLTGOT       = 3,        // Address associated with linkage table.\n  DT_HASH         = 4,        // Address of symbolic hash table.\n  DT_STRTAB       = 5,        // Address of dynamic string table.\n  DT_SYMTAB       = 6,        // Address of dynamic symbol table.\n  DT_RELA         = 7,        // Address of relocation table (Rela entries).\n  DT_RELASZ       = 8,        // Size of Rela relocation table.\n  DT_RELAENT      = 9,        // Size of a Rela relocation entry.\n  DT_STRSZ        = 10,       // Total size of the string table.\n  DT_SYMENT       = 11,       // Size of a symbol table entry.\n  DT_INIT         = 12,       // Address of initialization function.\n  DT_FINI         = 13,       // Address of termination function.\n  DT_SONAME       = 14,       // String table offset of a shared objects name.\n  DT_RPATH        = 15,       // String table offset of library search path.\n  DT_SYMBOLIC     = 16,       // Changes symbol resolution algorithm.\n  DT_REL          = 17,       // Address of relocation table (Rel entries).\n  DT_RELSZ        = 18,       // Size of Rel relocation table.\n  DT_RELENT       = 19,       // Size of a Rel relocation entry.\n  DT_PLTREL       = 20,       // Type of relocation entry used for linking.\n  DT_DEBUG        = 21,       // Reserved for debugger.\n  DT_TEXTREL      = 22,       // Relocations exist for non-writable segments.\n  DT_JMPREL       = 23,       // Address of relocations associated with PLT.\n  DT_BIND_NOW     = 24,       // Process all relocations before execution.\n  DT_INIT_ARRAY   = 25,       // Pointer to array of initialization functions.\n  DT_FINI_ARRAY   = 26,       // Pointer to array of termination functions.\n  DT_INIT_ARRAYSZ = 27,       // Size of DT_INIT_ARRAY.\n  DT_FINI_ARRAYSZ = 28,       // Size of DT_FINI_ARRAY.\n  DT_RUNPATH      = 29,       // String table offset of lib search path.\n  DT_FLAGS        = 30,       // Flags.\n  DT_ENCODING     = 32,       // Values from here to DT_LOOS follow the rules\n                              // for the interpretation of the d_un union.\n\n  DT_PREINIT_ARRAY = 32,      // Pointer to array of preinit functions.\n  DT_PREINIT_ARRAYSZ = 33,    // Size of the DT_PREINIT_ARRAY array.\n\n  DT_LOOS         = 0x60000000, // Start of environment specific tags.\n  DT_HIOS         = 0x6FFFFFFF, // End of environment specific tags.\n  DT_LOPROC       = 0x70000000, // Start of processor specific tags.\n  DT_HIPROC       = 0x7FFFFFFF, // End of processor specific tags.\n\n  DT_GNU_HASH     = 0x6FFFFEF5, // Reference to the GNU hash table.\n  DT_RELACOUNT    = 0x6FFFFFF9, // ELF32_Rela count.\n  DT_RELCOUNT     = 0x6FFFFFFA, // ELF32_Rel count.\n\n  DT_FLAGS_1      = 0X6FFFFFFB, // Flags_1.\n  DT_VERSYM       = 0x6FFFFFF0, // The address of .gnu.version section.\n  DT_VERDEF       = 0X6FFFFFFC, // The address of the version definition table.\n  DT_VERDEFNUM    = 0X6FFFFFFD, // The number of entries in DT_VERDEF.\n  DT_VERNEED      = 0X6FFFFFFE, // The address of the version Dependency table.\n  DT_VERNEEDNUM   = 0X6FFFFFFF, // The number of entries in DT_VERNEED.\n\n  // Mips specific dynamic table entry tags.\n  DT_MIPS_RLD_VERSION   = 0x70000001, // 32 bit version number for runtime\n                                      // linker interface.\n  DT_MIPS_TIME_STAMP    = 0x70000002, // Time stamp.\n  DT_MIPS_ICHECKSUM     = 0x70000003, // Checksum of external strings\n                                      // and common sizes.\n  DT_MIPS_IVERSION      = 0x70000004, // Index of version string\n                                      // in string table.\n  DT_MIPS_FLAGS         = 0x70000005, // 32 bits of flags.\n  DT_MIPS_BASE_ADDRESS  = 0x70000006, // Base address of the segment.\n  DT_MIPS_MSYM          = 0x70000007, // Address of .msym section.\n  DT_MIPS_CONFLICT      = 0x70000008, // Address of .conflict section.\n  DT_MIPS_LIBLIST       = 0x70000009, // Address of .liblist section.\n  DT_MIPS_LOCAL_GOTNO   = 0x7000000a, // Number of local global offset\n                                      // table entries.\n  DT_MIPS_CONFLICTNO    = 0x7000000b, // Number of entries\n                                      // in the .conflict section.\n  DT_MIPS_LIBLISTNO     = 0x70000010, // Number of entries\n                                      // in the .liblist section.\n  DT_MIPS_SYMTABNO      = 0x70000011, // Number of entries\n                                      // in the .dynsym section.\n  DT_MIPS_UNREFEXTNO    = 0x70000012, // Index of first external dynamic symbol\n                                      // not referenced locally.\n  DT_MIPS_GOTSYM        = 0x70000013, // Index of first dynamic symbol\n                                      // in global offset table.\n  DT_MIPS_HIPAGENO      = 0x70000014, // Number of page table entries\n                                      // in global offset table.\n  DT_MIPS_RLD_MAP       = 0x70000016, // Address of run time loader map,\n                                      // used for debugging.\n  DT_MIPS_DELTA_CLASS       = 0x70000017, // Delta C++ class definition.\n  DT_MIPS_DELTA_CLASS_NO    = 0x70000018, // Number of entries\n                                          // in DT_MIPS_DELTA_CLASS.\n  DT_MIPS_DELTA_INSTANCE    = 0x70000019, // Delta C++ class instances.\n  DT_MIPS_DELTA_INSTANCE_NO = 0x7000001A, // Number of entries\n                                          // in DT_MIPS_DELTA_INSTANCE.\n  DT_MIPS_DELTA_RELOC       = 0x7000001B, // Delta relocations.\n  DT_MIPS_DELTA_RELOC_NO    = 0x7000001C, // Number of entries\n                                          // in DT_MIPS_DELTA_RELOC.\n  DT_MIPS_DELTA_SYM         = 0x7000001D, // Delta symbols that Delta\n                                          // relocations refer to.\n  DT_MIPS_DELTA_SYM_NO      = 0x7000001E, // Number of entries\n                                          // in DT_MIPS_DELTA_SYM.\n  DT_MIPS_DELTA_CLASSSYM    = 0x70000020, // Delta symbols that hold\n                                          // class declarations.\n  DT_MIPS_DELTA_CLASSSYM_NO = 0x70000021, // Number of entries\n                                          // in DT_MIPS_DELTA_CLASSSYM.\n  DT_MIPS_CXX_FLAGS         = 0x70000022, // Flags indicating information\n                                          // about C++ flavor.\n  DT_MIPS_PIXIE_INIT        = 0x70000023, // Pixie information.\n  DT_MIPS_SYMBOL_LIB        = 0x70000024, // Address of .MIPS.symlib\n  DT_MIPS_LOCALPAGE_GOTIDX  = 0x70000025, // The GOT index of the first PTE\n                                          // for a segment\n  DT_MIPS_LOCAL_GOTIDX      = 0x70000026, // The GOT index of the first PTE\n                                          // for a local symbol\n  DT_MIPS_HIDDEN_GOTIDX     = 0x70000027, // The GOT index of the first PTE\n                                          // for a hidden symbol\n  DT_MIPS_PROTECTED_GOTIDX  = 0x70000028, // The GOT index of the first PTE\n                                          // for a protected symbol\n  DT_MIPS_OPTIONS           = 0x70000029, // Address of `.MIPS.options'.\n  DT_MIPS_INTERFACE         = 0x7000002A, // Address of `.interface'.\n  DT_MIPS_DYNSTR_ALIGN      = 0x7000002B, // Unknown.\n  DT_MIPS_INTERFACE_SIZE    = 0x7000002C, // Size of the .interface section.\n  DT_MIPS_RLD_TEXT_RESOLVE_ADDR = 0x7000002D, // Size of rld_text_resolve\n                                              // function stored in the GOT.\n  DT_MIPS_PERF_SUFFIX       = 0x7000002E, // Default suffix of DSO to be added\n                                          // by rld on dlopen() calls.\n  DT_MIPS_COMPACT_SIZE      = 0x7000002F, // Size of compact relocation\n                                          // section (O32).\n  DT_MIPS_GP_VALUE          = 0x70000030, // GP value for auxiliary GOTs.\n  DT_MIPS_AUX_DYNAMIC       = 0x70000031, // Address of auxiliary .dynamic.\n  DT_MIPS_PLTGOT            = 0x70000032, // Address of the base of the PLTGOT.\n  DT_MIPS_RWPLT             = 0x70000034, // Points to the base\n                                          // of a writable PLT.\n  DT_MIPS_RLD_MAP_REL       = 0x70000035  // Relative offset of run time loader\n                                          // map, used for debugging.\n};\n\n// DT_FLAGS values.\nenum {\n  DF_ORIGIN     = 0x01, // The object may reference $ORIGIN.\n  DF_SYMBOLIC   = 0x02, // Search the shared lib before searching the exe.\n  DF_TEXTREL    = 0x04, // Relocations may modify a non-writable segment.\n  DF_BIND_NOW   = 0x08, // Process all relocations on load.\n  DF_STATIC_TLS = 0x10  // Reject attempts to load dynamically.\n};\n\n// State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 entry.\nenum {\n  DF_1_NOW        = 0x00000001, // Set RTLD_NOW for this object.\n  DF_1_GLOBAL     = 0x00000002, // Set RTLD_GLOBAL for this object.\n  DF_1_GROUP      = 0x00000004, // Set RTLD_GROUP for this object.\n  DF_1_NODELETE   = 0x00000008, // Set RTLD_NODELETE for this object.\n  DF_1_LOADFLTR   = 0x00000010, // Trigger filtee loading at runtime.\n  DF_1_INITFIRST  = 0x00000020, // Set RTLD_INITFIRST for this object.\n  DF_1_NOOPEN     = 0x00000040, // Set RTLD_NOOPEN for this object.\n  DF_1_ORIGIN     = 0x00000080, // $ORIGIN must be handled.\n  DF_1_DIRECT     = 0x00000100, // Direct binding enabled.\n  DF_1_TRANS      = 0x00000200,\n  DF_1_INTERPOSE  = 0x00000400, // Object is used to interpose.\n  DF_1_NODEFLIB   = 0x00000800, // Ignore default lib search path.\n  DF_1_NODUMP     = 0x00001000, // Object can't be dldump'ed.\n  DF_1_CONFALT    = 0x00002000, // Configuration alternative created.\n  DF_1_ENDFILTEE  = 0x00004000, // Filtee terminates filters search.\n  DF_1_DISPRELDNE = 0x00008000, // Disp reloc applied at build time.\n  DF_1_DISPRELPND = 0x00010000, // Disp reloc applied at run-time.\n  DF_1_NODIRECT   = 0x00020000, // Object has no-direct binding.\n  DF_1_IGNMULDEF  = 0x00040000,\n  DF_1_NOKSYMS    = 0x00080000,\n  DF_1_NOHDR      = 0x00100000,\n  DF_1_EDITED     = 0x00200000, // Object is modified after built.\n  DF_1_NORELOC    = 0x00400000,\n  DF_1_SYMINTPOSE = 0x00800000, // Object has individual interposers.\n  DF_1_GLOBAUDIT  = 0x01000000, // Global auditing required.\n  DF_1_SINGLETON  = 0x02000000  // Singleton symbols are used.\n};\n\n// DT_MIPS_FLAGS values.\nenum {\n  RHF_NONE                    = 0x00000000, // No flags.\n  RHF_QUICKSTART              = 0x00000001, // Uses shortcut pointers.\n  RHF_NOTPOT                  = 0x00000002, // Hash size is not a power of two.\n  RHS_NO_LIBRARY_REPLACEMENT  = 0x00000004, // Ignore LD_LIBRARY_PATH.\n  RHF_NO_MOVE                 = 0x00000008, // DSO address may not be relocated.\n  RHF_SGI_ONLY                = 0x00000010, // SGI specific features.\n  RHF_GUARANTEE_INIT          = 0x00000020, // Guarantee that .init will finish\n                                            // executing before any non-init\n                                            // code in DSO is called.\n  RHF_DELTA_C_PLUS_PLUS       = 0x00000040, // Contains Delta C++ code.\n  RHF_GUARANTEE_START_INIT    = 0x00000080, // Guarantee that .init will start\n                                            // executing before any non-init\n                                            // code in DSO is called.\n  RHF_PIXIE                   = 0x00000100, // Generated by pixie.\n  RHF_DEFAULT_DELAY_LOAD      = 0x00000200, // Delay-load DSO by default.\n  RHF_REQUICKSTART            = 0x00000400, // Object may be requickstarted\n  RHF_REQUICKSTARTED          = 0x00000800, // Object has been requickstarted\n  RHF_CORD                    = 0x00001000, // Generated by cord.\n  RHF_NO_UNRES_UNDEF          = 0x00002000, // Object contains no unresolved\n                                            // undef symbols.\n  RHF_RLD_ORDER_SAFE          = 0x00004000  // Symbol table is in a safe order.\n};\n\n// ElfXX_VerDef structure version (GNU versioning)\nenum {\n  VER_DEF_NONE    = 0,\n  VER_DEF_CURRENT = 1\n};\n\n// VerDef Flags (ElfXX_VerDef::vd_flags)\nenum {\n  VER_FLG_BASE = 0x1,\n  VER_FLG_WEAK = 0x2,\n  VER_FLG_INFO = 0x4\n};\n\n// Special constants for the version table. (SHT_GNU_versym/.gnu.version)\nenum {\n  VER_NDX_LOCAL  = 0,      // Unversioned local symbol\n  VER_NDX_GLOBAL = 1,      // Unversioned global symbol\n  VERSYM_VERSION = 0x7fff, // Version Index mask\n  VERSYM_HIDDEN  = 0x8000  // Hidden bit (non-default version)\n};\n\n// ElfXX_VerNeed structure version (GNU versioning)\nenum {\n  VER_NEED_NONE = 0,\n  VER_NEED_CURRENT = 1\n};\n\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/loaderheap.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// LoaderHeap.h\n//\n\n//\n// Utility functions for managing memory allocations that typically do not\n// need releasing.\n//\n//*****************************************************************************\n\n\n#ifndef __LoaderHeap_h__\n#define __LoaderHeap_h__\n\n#include \"utilcode.h\"\n#include \"ex.h\"\n#include \"executableallocator.h\"\n\n//==============================================================================\n// Interface used to back out loader heap allocations.\n//==============================================================================\nclass ILoaderHeapBackout\n{\n#ifdef _DEBUG\n#define BackoutMem(pMem, dwSize)  RealBackoutMem( (pMem), (dwSize), __FILE__, __LINE__, \"UNKNOWN\", -1 )\n#else\n#define BackoutMem(pMem, dwSize)  RealBackoutMem( (pMem), (dwSize) )\n#endif\n\npublic:\n    virtual void RealBackoutMem(void *pMem\n                        , size_t dwSize\n#ifdef _DEBUG\n                        , _In_ _In_z_ const char *szFile\n                        , int lineNum\n                        , _In_ _In_z_ const char *szAllocFile\n                        , int allocLineNum\n#endif\n                        ) = 0;\n};\n\n//==============================================================================\n// This structure packages up all the data needed to back out an AllocMem.\n// It's mainly a short term parking place to get the data from the AllocMem\n// to the AllocMemHolder while preserving the illusion that AllocMem() still\n// returns just a pointer as it did in V1.\n//==============================================================================\nstruct TaggedMemAllocPtr\n{\n    // Note: For AllocAlignedMem blocks, m_pMem and m_dwRequestedSize are the actual values to pass\n    // to BackoutMem. Do not add \"m_dwExtra\"\n    void        *m_pMem;                //Pointer to AllocMem'd block (needed to pass back to BackoutMem)\n    size_t       m_dwRequestedSize;     //Requested allocation size (needed to pass back to BackoutMem)\n\n    ILoaderHeapBackout  *m_pHeap;          //The heap that alloc'd the block (needed to know who to call BackoutMem on)\n\n    //For AllocMem'd blocks, this is always 0.\n    //For AllocAlignedMem blocks, you have to add m_dwExtra to m_pMem to arrive\n    //   at the actual aligned pointer.\n    size_t       m_dwExtra;\n\n#ifdef _DEBUG\n    const char  *m_szFile;              //File that called AllocMem\n    int          m_lineNum;             //Line # of AllocMem callsite\n#endif\n\n//! Note: this structure is copied around using bitwise copy (\"=\").\n//! Don't get too fancy putting stuff in here. It's really just a temporary\n//! holding place to get stuff from RealAllocMem() to the MemAllocHolder.\n\n\n  public:\n\n    //\n    // This makes \"void *ptr = pLoaderHeap->AllocMem()\" work as in V1.\n    //\n    operator void*() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (void*)(m_dwExtra + (BYTE*)m_pMem);\n    }\n\n    template < typename T >\n    T cast() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        return reinterpret_cast< T >( operator void *() );\n    }\n};\n\n\n\n// # bytes to leave between allocations in debug mode\n// Set to a > 0 boundary to debug problems - I've made this zero, otherwise a 1 byte allocation becomes\n// a (1 + LOADER_HEAP_DEBUG_BOUNDARY) allocation\n#define LOADER_HEAP_DEBUG_BOUNDARY  0\n\n#define VIRTUAL_ALLOC_RESERVE_GRANULARITY (64*1024)    // 0x10000  (64 KB)\n\ntypedef DPTR(struct LoaderHeapBlock) PTR_LoaderHeapBlock;\n\nstruct LoaderHeapBlock\n{\n    PTR_LoaderHeapBlock     pNext;\n    PTR_VOID                pVirtualAddress;\n    size_t                  dwVirtualSize;\n    BOOL                    m_fReleaseMemory;\n\n#ifndef DACCESS_COMPILE\n    // pVirtualMemory  - the start address of the virtual memory\n    // cbVirtualMemory - the length in bytes of the virtual memory\n    // fReleaseMemory  - should LoaderHeap be responsible for releasing this memory\n    void Init(void   *pVirtualMemory,\n              size_t  cbVirtualMemory,\n              BOOL    fReleaseMemory)\n    {\n        LIMITED_METHOD_CONTRACT;\n        this->pNext = NULL;\n        this->pVirtualAddress = pVirtualMemory;\n        this->dwVirtualSize = cbVirtualMemory;\n        this->m_fReleaseMemory = fReleaseMemory;\n    }\n\n    // Just calls LoaderHeapBlock::Init\n    LoaderHeapBlock(void   *pVirtualMemory,\n                    size_t  cbVirtualMemory,\n                    BOOL    fReleaseMemory)\n    {\n        WRAPPER_NO_CONTRACT;\n        Init(pVirtualMemory, cbVirtualMemory, fReleaseMemory);\n    }\n\n    LoaderHeapBlock()\n    {\n        WRAPPER_NO_CONTRACT;\n        Init(NULL, 0, FALSE);\n    }\n#else\n    // No ctors in DAC builds\n    LoaderHeapBlock() {}\n#endif\n};\n\nstruct LoaderHeapFreeBlock;\n\n// Collection of methods for helping in debugging heap corruptions\n#ifdef _DEBUG\nclass  LoaderHeapSniffer;\nstruct LoaderHeapEvent;\n#endif\n\n\n\n\n\n\n\n\n//===============================================================================\n// This is the base class for LoaderHeap and ExplicitControlLoaderHeap. Unfortunately,\n// this class has become schizophrenic. Sometimes, it's used as a simple\n// allocator that's semantically (but not perfwise!) equivalent to a blackbox\n// alloc/free heap. Othertimes, it's used by callers who are actually aware\n// of how it reserves addresses and want direct control over the range over which\n// this thing allocates. These two types of allocations are handed out\n// from two independent pools inside the heap.\n//\n// The backout strategy we use for the simple heap probably isn't\n// directly applicable to the more advanced uses.\n//\n// We don't have time to refactor this so as a second-best measure,\n// we make most of UnlockedLoaderHeap's methods protected and force everyone\n// to use it them through two public derived classes that are mutual siblings.\n//\n// The LoaderHeap is the black-box heap and has a Backout() method but none\n// of the advanced features that let you control address ranges.\n//\n// The ExplicitControlLoaderHeap exposes all the advanced features but\n// has no Backout() feature. (If someone wants a backout feature, they need\n// to design an appropriate one into this class.)\n//===============================================================================\nclass UnlockedLoaderHeap\n{\n#ifdef _DEBUG\n    friend class LoaderHeapSniffer;\n#endif\n\n#ifdef DACCESS_COMPILE\n    friend class ClrDataAccess;\n#endif\n\npublic:\n\n    enum class HeapKind\n    {\n        Data,\n        Executable,\n        Interleaved\n    };\n\nprivate:\n    // Linked list of ClrVirtualAlloc'd pages\n    PTR_LoaderHeapBlock m_pFirstBlock;\n\n    // Allocation pointer in current block\n    PTR_BYTE            m_pAllocPtr;\n\n    // Points to the end of the committed region in the current block\n    PTR_BYTE            m_pPtrToEndOfCommittedRegion;\n    PTR_BYTE            m_pEndReservedRegion;\n\n    // When we need to ClrVirtualAlloc() MEM_RESERVE a new set of pages, number of bytes to reserve\n    DWORD               m_dwReserveBlockSize;\n\n    // When we need to commit pages from our reserved list, number of bytes to commit at a time\n    DWORD               m_dwCommitBlockSize;\n\n    // For interleaved heap (RX pages interleaved with RW ones), this specifies the allocation granularity,\n    // which is the individual code block size\n    DWORD               m_dwGranularity;\n\n    // Range list to record memory ranges in\n    RangeList *         m_pRangeList;\n\n    size_t              m_dwTotalAlloc;\n\n    HeapKind            m_kind;\n\n    LoaderHeapFreeBlock *m_pFirstFreeBlock;\n\n    // This is used to hold on to a block of reserved memory provided to the\n    // constructor. We do this instead of adding it as the first block because\n    // that requires comitting the first page of the reserved block, and for\n    // startup working set reasons we want to delay that as long as possible.\n    LoaderHeapBlock      m_reservedBlock;\n\npublic:\n\n#ifdef _DEBUG\n    enum\n    {\n        kCallTracing    = 0x00000001,   // Keep a permanent log of all callers\n\n        kEncounteredOOM = 0x80000000,   // One time flag to record that an OOM interrupted call tracing\n    }\n    LoaderHeapDebugFlags;\n\n    DWORD               m_dwDebugFlags;\n\n    LoaderHeapEvent    *m_pEventList;   // Linked list of events (in reverse time order)\n#endif\n\n\n\n#ifdef _DEBUG\n    size_t              m_dwDebugWastedBytes;\n    static DWORD        s_dwNumInstancesOfLoaderHeaps;\n#endif\n\n#ifdef _DEBUG\n    size_t DebugGetWastedBytes()\n    {\n        WRAPPER_NO_CONTRACT;\n        return m_dwDebugWastedBytes + GetBytesAvailCommittedRegion();\n    }\n#endif\n\n#ifdef _DEBUG\n    // Stubs allocated from a LoaderHeap will have unwind info registered with NT.\n    // The info must be unregistered when the heap is destroyed.\n    BOOL                m_fPermitStubsWithUnwindInfo;\n    BOOL                m_fStubUnwindInfoUnregistered;\n#endif\n\npublic:\n    BOOL                m_fExplicitControl;  // Am I a LoaderHeap or an ExplicitControlLoaderHeap?\n    void                (*m_codePageGenerator)(BYTE* pageBase, BYTE* pageBaseRX);\n\n#ifdef DACCESS_COMPILE\npublic:\n    void EnumMemoryRegions(enum CLRDataEnumMemoryFlags flags);\n#endif\n\npublic:\n    typedef bool EnumPageRegionsCallback (PTR_VOID pvArgs, PTR_VOID pvAllocationBase, SIZE_T cbReserved);\n    void EnumPageRegions (EnumPageRegionsCallback *pCallback, PTR_VOID pvArgs);\n\n#ifndef DACCESS_COMPILE\nprotected:\n    // Use this version if dwReservedRegionAddress already points to a\n    // blob of reserved memory.  This will set up internal data structures,\n    // using the provided, reserved memory.\n    UnlockedLoaderHeap(DWORD dwReserveBlockSize,\n                       DWORD dwCommitBlockSize,\n                       const BYTE* dwReservedRegionAddress,\n                       SIZE_T dwReservedRegionSize,\n                       RangeList *pRangeList = NULL,\n                       HeapKind kind = HeapKind::Data,\n                       void (*codePageGenerator)(BYTE* pageBase, BYTE* pageBaseRX) = NULL,\n                       DWORD dwGranularity = 1);\n\n    ~UnlockedLoaderHeap();\n#endif\n\nprivate:\n    size_t GetBytesAvailCommittedRegion();\n    size_t GetBytesAvailReservedRegion();\n\nprotected:\n    // number of bytes available in region\n    size_t UnlockedGetReservedBytesFree()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_pEndReservedRegion - m_pAllocPtr;\n    }\n\n    PTR_BYTE UnlockedGetAllocPtr()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_pAllocPtr;\n    }\n\nprivate:\n    // Get some more committed pages - either commit some more in the current reserved region, or, if it\n    // has run out, reserve another set of pages\n    BOOL GetMoreCommittedPages(size_t dwMinSize);\n\n    // Commit memory pages starting at the specified adress\n    BOOL CommitPages(void* pData, size_t dwSizeToCommitPart);\n\nprotected:\n    // Reserve some pages at any address\n    BOOL UnlockedReservePages(size_t dwCommitBlockSize);\n\nprotected:\n    // In debug mode, allocate an extra LOADER_HEAP_DEBUG_BOUNDARY bytes and fill it with invalid data.  The reason we\n    // do this is that when we're allocating vtables out of the heap, it is very easy for code to\n    // get careless, and end up reading from memory that it doesn't own - but since it will be\n    // reading some other allocation's vtable, no crash will occur.  By keeping a gap between\n    // allocations, it is more likely that these errors will be encountered.\n    void *UnlockedAllocMem(size_t dwSize\n#ifdef _DEBUG\n                          ,_In_ _In_z_ const char *szFile\n                          ,int  lineNum\n#endif\n                          );\n    void *UnlockedAllocMem_NoThrow(size_t dwSize\n#ifdef _DEBUG\n                                   ,_In_ _In_z_ const char *szFile\n                                   ,int  lineNum\n#endif\n                                   );\n\n\n\n\n\nprotected:\n    // Allocates memory aligned on power-of-2 boundary.\n    //\n    // The return value is a pointer that's guaranteed to be aligned.\n    //\n    // FREEING THIS BLOCK: Underneath, the actual block allocated may\n    // be larger and start at an address prior to the one you got back.\n    // It is this adjusted size and pointer that you pass to BackoutMem.\n    // The required adjustment is passed back thru the pdwExtra pointer.\n    //\n    // Here is how to properly backout the memory:\n    //\n    //   size_t dwExtra;\n    //   void *pMem = UnlockedAllocAlignedMem(dwRequestedSize, alignment, &dwExtra);\n    //   _ASSERTE( 0 == (pMem & (alignment - 1)) );\n    //   UnlockedBackoutMem( ((BYTE*)pMem) - dExtra, dwRequestedSize + dwExtra );\n    //\n    // If you use the AllocMemHolder or AllocMemTracker, all this is taken care of\n    // behind the scenes.\n    //\n    //\n    void *UnlockedAllocAlignedMem(size_t  dwRequestedSize\n                                 ,size_t  dwAlignment\n                                 ,size_t *pdwExtra\n#ifdef _DEBUG\n                                 ,_In_ _In_z_ const char *szFile\n                                 ,int  lineNum\n#endif\n                                 );\n\n    void *UnlockedAllocAlignedMem_NoThrow(size_t  dwRequestedSize\n                                         ,size_t  dwAlignment\n                                         ,size_t *pdwExtra\n#ifdef _DEBUG\n                                         ,_In_ _In_z_ const char *szFile\n                                         ,int  lineNum\n#endif\n                                 );\n\nprotected:\n    // This frees memory allocated by UnlockAllocMem. It's given this horrible name to emphasize\n    // that it's purpose is for error path leak prevention purposes. You shouldn't\n    // use LoaderHeap's as general-purpose alloc-free heaps.\n    void UnlockedBackoutMem(void *pMem\n                          , size_t dwSize\n#ifdef _DEBUG\n                          , _In_ _In_z_ const char *szFile\n                          , int lineNum\n                          , _In_ _In_z_ const char *szAllocFile\n                          , int AllocLineNum\n#endif\n                          );\n\npublic:\n    // Perf Counter reports the size of the heap\n    size_t GetSize ()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_dwTotalAlloc;\n    }\n\n    BOOL IsExecutable();\n    BOOL IsInterleaved();\n\n    size_t AllocMem_TotalSize(size_t dwRequestedSize);\n\npublic:\n#ifdef _DEBUG\n    void DumpFreeList();\n#endif\n\npublic:\n// Extra CallTracing support\n#ifdef _DEBUG\n    void UnlockedClearEvents();     //Discard saved events\n    void UnlockedCompactEvents();   //Discard matching alloc/free events\n    void UnlockedPrintEvents();     //Print event list\n#endif\n\nprotected:\n    void *UnlockedAllocMemForCode_NoThrow(size_t dwHeaderSize, size_t dwCodeSize, DWORD dwCodeAlignment, size_t dwReserveForJumpStubs);\n\n    void UnlockedSetReservedRegion(BYTE* dwReservedRegionAddress, SIZE_T dwReservedRegionSize, BOOL fReleaseMemory);\n};\n\n//===============================================================================\n// Create the LoaderHeap lock. It's the same lock for several different Heaps.\n//===============================================================================\ninline CRITSEC_COOKIE CreateLoaderHeapLock()\n{\n    return ClrCreateCriticalSection(CrstLoaderHeap,CrstFlags(CRST_UNSAFE_ANYMODE | CRST_DEBUGGER_THREAD));\n}\n\n//===============================================================================\n// The LoaderHeap is the black-box heap and has a Backout() method but none\n// of the advanced features that let you control address ranges.\n//===============================================================================\ntypedef DPTR(class LoaderHeap) PTR_LoaderHeap;\nclass LoaderHeap : public UnlockedLoaderHeap, public ILoaderHeapBackout\n{\nprivate:\n    CRITSEC_COOKIE    m_CriticalSection;\n\n#ifndef DACCESS_COMPILE\npublic:\n    LoaderHeap(DWORD dwReserveBlockSize,\n               DWORD dwCommitBlockSize,\n               RangeList *pRangeList = NULL,\n               UnlockedLoaderHeap::HeapKind kind = UnlockedLoaderHeap::HeapKind::Data,\n               BOOL fUnlocked = FALSE,\n               void (*codePageGenerator)(BYTE* pageBase, BYTE* pageBaseRX) = NULL,\n               DWORD dwGranularity = 1\n               )\n      : UnlockedLoaderHeap(dwReserveBlockSize,\n                           dwCommitBlockSize,\n                           NULL, 0,\n                           pRangeList,\n                           kind,\n                           codePageGenerator,\n                           dwGranularity),\n        m_CriticalSection(fUnlocked ? NULL : CreateLoaderHeapLock())\n    {\n        WRAPPER_NO_CONTRACT;\n        m_fExplicitControl = FALSE;\n    }\n\npublic:\n    LoaderHeap(DWORD dwReserveBlockSize,\n               DWORD dwCommitBlockSize,\n               const BYTE* dwReservedRegionAddress,\n               SIZE_T dwReservedRegionSize,\n               RangeList *pRangeList = NULL,\n               UnlockedLoaderHeap::HeapKind kind = UnlockedLoaderHeap::HeapKind::Data,\n               BOOL fUnlocked = FALSE,\n               void (*codePageGenerator)(BYTE* pageBase, BYTE* pageBaseRX) = NULL,\n               DWORD dwGranularity = 1\n               )\n      : UnlockedLoaderHeap(dwReserveBlockSize,\n                           dwCommitBlockSize,\n                           dwReservedRegionAddress,\n                           dwReservedRegionSize,\n                           pRangeList,\n                           kind,\n                           codePageGenerator, dwGranularity),\n        m_CriticalSection(fUnlocked ? NULL : CreateLoaderHeapLock())\n    {\n        WRAPPER_NO_CONTRACT;\n        m_fExplicitControl = FALSE;\n    }\n\n#endif // DACCESS_COMPILE\n\n    virtual ~LoaderHeap()\n    {\n        WRAPPER_NO_CONTRACT;\n\n#ifndef DACCESS_COMPILE\n        if (m_CriticalSection != NULL)\n        {\n            ClrDeleteCriticalSection(m_CriticalSection);\n        }\n#endif // DACCESS_COMPILE\n    }\n\n\n\n#ifdef _DEBUG\n#define AllocMem(dwSize)                  RealAllocMem( (dwSize), __FILE__, __LINE__ )\n#define AllocMem_NoThrow(dwSize)          RealAllocMem_NoThrow( (dwSize), __FILE__, __LINE__ )\n#else\n#define AllocMem(dwSize)                  RealAllocMem( (dwSize) )\n#define AllocMem_NoThrow(dwSize)          RealAllocMem_NoThrow( (dwSize) )\n#endif\n\npublic:\n    FORCEINLINE TaggedMemAllocPtr RealAllocMem(S_SIZE_T dwSize\n#ifdef _DEBUG\n                                  ,_In_ _In_z_ const char *szFile\n                                  ,int  lineNum\n#endif\n                  )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if(dwSize.IsOverflow()) ThrowOutOfMemory();\n\n        return RealAllocMemUnsafe(dwSize.Value() COMMA_INDEBUG(szFile) COMMA_INDEBUG(lineNum));\n\n    }\n\n    FORCEINLINE TaggedMemAllocPtr RealAllocMem_NoThrow(S_SIZE_T  dwSize\n#ifdef _DEBUG\n                                           ,_In_ _In_z_ const char *szFile\n                                           ,int  lineNum\n#endif\n                  )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if(dwSize.IsOverflow()) {\n            TaggedMemAllocPtr tmap;\n            tmap.m_pMem             = NULL;\n            tmap.m_dwRequestedSize  = dwSize.Value();\n            tmap.m_pHeap            = this;\n            tmap.m_dwExtra          = 0;\n#ifdef _DEBUG\n            tmap.m_szFile           = szFile;\n            tmap.m_lineNum          = lineNum;\n#endif\n\n            return tmap;\n        }\n\n        return RealAllocMemUnsafe_NoThrow(dwSize.Value() COMMA_INDEBUG(szFile) COMMA_INDEBUG(lineNum));\n    }\nprivate:\n\n    TaggedMemAllocPtr RealAllocMemUnsafe(size_t dwSize\n#ifdef _DEBUG\n                                  ,_In_ _In_z_ const char *szFile\n                                  ,int  lineNum\n#endif\n                  )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        void *pResult;\n        TaggedMemAllocPtr tmap;\n\n        CRITSEC_Holder csh(m_CriticalSection);\n        pResult = UnlockedAllocMem(dwSize\n#ifdef _DEBUG\n                                 , szFile\n                                 , lineNum\n#endif\n                                 );\n        tmap.m_pMem             = pResult;\n        tmap.m_dwRequestedSize  = dwSize;\n        tmap.m_pHeap            = this;\n        tmap.m_dwExtra          = 0;\n#ifdef _DEBUG\n        tmap.m_szFile           = szFile;\n        tmap.m_lineNum          = lineNum;\n#endif\n\n        return tmap;\n    }\n\n    TaggedMemAllocPtr RealAllocMemUnsafe_NoThrow(size_t  dwSize\n#ifdef _DEBUG\n                                           ,_In_ _In_z_ const char *szFile\n                                           ,int  lineNum\n#endif\n                  )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        void *pResult;\n        TaggedMemAllocPtr tmap;\n\n        CRITSEC_Holder csh(m_CriticalSection);\n\n        pResult = UnlockedAllocMem_NoThrow(dwSize\n#ifdef _DEBUG\n                                           , szFile\n                                           , lineNum\n#endif\n                                           );\n\n        tmap.m_pMem             = pResult;\n        tmap.m_dwRequestedSize  = dwSize;\n        tmap.m_pHeap            = this;\n        tmap.m_dwExtra          = 0;\n#ifdef _DEBUG\n        tmap.m_szFile           = szFile;\n        tmap.m_lineNum          = lineNum;\n#endif\n\n        return tmap;\n    }\n\n\n\n#ifdef _DEBUG\n#define AllocAlignedMem(dwSize, dwAlign)                RealAllocAlignedMem( (dwSize), (dwAlign), __FILE__, __LINE__)\n#define AllocAlignedMem_NoThrow(dwSize, dwAlign)        RealAllocAlignedMem_NoThrow( (dwSize), (dwAlign), __FILE__, __LINE__)\n#else\n#define AllocAlignedMem(dwSize, dwAlign)                RealAllocAlignedMem( (dwSize), (dwAlign) )\n#define AllocAlignedMem_NoThrow(dwSize, dwAlign)        RealAllocAlignedMem_NoThrow( (dwSize), (dwAlign) )\n#endif\n\npublic:\n    TaggedMemAllocPtr RealAllocAlignedMem(size_t  dwRequestedSize\n                                         ,size_t  dwAlignment\n#ifdef _DEBUG\n                                         ,_In_ _In_z_ const char *szFile\n                                         ,int  lineNum\n#endif\n                                         )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        CRITSEC_Holder csh(m_CriticalSection);\n\n\n        TaggedMemAllocPtr tmap;\n        void *pResult;\n        size_t dwExtra;\n\n        pResult = UnlockedAllocAlignedMem(dwRequestedSize\n                                         ,dwAlignment\n                                         ,&dwExtra\n#ifdef _DEBUG\n                                         ,szFile\n                                         ,lineNum\n#endif\n                                     );\n\n        tmap.m_pMem             = (void*)(((BYTE*)pResult) - dwExtra);\n        tmap.m_dwRequestedSize  = dwRequestedSize + dwExtra;\n        tmap.m_pHeap            = this;\n        tmap.m_dwExtra          = dwExtra;\n#ifdef _DEBUG\n        tmap.m_szFile           = szFile;\n        tmap.m_lineNum          = lineNum;\n#endif\n\n        return tmap;\n    }\n\n\n    TaggedMemAllocPtr RealAllocAlignedMem_NoThrow(size_t  dwRequestedSize\n                                                 ,size_t  dwAlignment\n#ifdef _DEBUG\n                                                 ,_In_ _In_z_ const char *szFile\n                                                 ,int  lineNum\n#endif\n                                                 )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        CRITSEC_Holder csh(m_CriticalSection);\n\n\n        TaggedMemAllocPtr tmap;\n        void *pResult;\n        size_t dwExtra;\n\n        pResult = UnlockedAllocAlignedMem_NoThrow(dwRequestedSize\n                                                 ,dwAlignment\n                                                 ,&dwExtra\n#ifdef _DEBUG\n                                                 ,szFile\n                                                 ,lineNum\n#endif\n                                            );\n\n        _ASSERTE(!(pResult == NULL && dwExtra != 0));\n\n        tmap.m_pMem             = (void*)(((BYTE*)pResult) - dwExtra);\n        tmap.m_dwRequestedSize  = dwRequestedSize + dwExtra;\n        tmap.m_pHeap            = this;\n        tmap.m_dwExtra          = dwExtra;\n#ifdef _DEBUG\n        tmap.m_szFile           = szFile;\n        tmap.m_lineNum          = lineNum;\n#endif\n\n        return tmap;\n    }\n\n\npublic:\n    // This frees memory allocated by AllocMem. It's given this horrible name to emphasize\n    // that it's purpose is for error path leak prevention purposes. You shouldn't\n    // use LoaderHeap's as general-purpose alloc-free heaps.\n    void RealBackoutMem(void *pMem\n                        , size_t dwSize\n#ifdef _DEBUG\n                        , _In_ _In_z_ const char *szFile\n                        , int lineNum\n                        , _In_ _In_z_ const char *szAllocFile\n                        , int allocLineNum\n#endif\n                        )\n    {\n        WRAPPER_NO_CONTRACT;\n        CRITSEC_Holder csh(m_CriticalSection);\n        UnlockedBackoutMem(pMem\n                           , dwSize\n#ifdef _DEBUG\n                           , szFile\n                           , lineNum\n                           , szAllocFile\n                           , allocLineNum\n#endif\n                           );\n    }\n\npublic:\n// Extra CallTracing support\n#ifdef _DEBUG\n    void ClearEvents()\n    {\n        WRAPPER_NO_CONTRACT;\n        CRITSEC_Holder csh(m_CriticalSection);\n        UnlockedClearEvents();\n    }\n\n    void CompactEvents()\n    {\n        WRAPPER_NO_CONTRACT;\n        CRITSEC_Holder csh(m_CriticalSection);\n        UnlockedCompactEvents();\n    }\n\n    void PrintEvents()\n    {\n        WRAPPER_NO_CONTRACT;\n        CRITSEC_Holder csh(m_CriticalSection);\n        UnlockedPrintEvents();\n    }\n#endif\n\n};\n\n\n\n\n\n//===============================================================================\n// The ExplicitControlLoaderHeap exposes all the advanced features but\n// has no Backout() feature. (If someone wants a backout feature, they need\n// to design an appropriate one into this class.)\n//\n// Caller is responsible for synchronization. ExplicitControlLoaderHeap is\n// not multithread safe.\n//===============================================================================\ntypedef DPTR(class ExplicitControlLoaderHeap) PTR_ExplicitControlLoaderHeap;\nclass ExplicitControlLoaderHeap : public UnlockedLoaderHeap\n{\n#ifndef DACCESS_COMPILE\npublic:\n    ExplicitControlLoaderHeap(RangeList *pRangeList = NULL,\n                              BOOL fMakeExecutable = FALSE\n               )\n      : UnlockedLoaderHeap(0, 0, NULL, 0,\n                           pRangeList,\n                           fMakeExecutable ? UnlockedLoaderHeap::HeapKind::Executable : UnlockedLoaderHeap::HeapKind::Data)\n    {\n        WRAPPER_NO_CONTRACT;\n        m_fExplicitControl = TRUE;\n    }\n#endif // DACCESS_COMPILE\n\npublic:\n    void *RealAllocMem(size_t dwSize\n#ifdef _DEBUG\n                       ,_In_ _In_z_ const char *szFile\n                       ,int  lineNum\n#endif\n                       )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        void *pResult;\n\n        pResult = UnlockedAllocMem(dwSize\n#ifdef _DEBUG\n                                   , szFile\n                                   , lineNum\n#endif\n                                   );\n        return pResult;\n    }\n\n    void *RealAllocMem_NoThrow(size_t dwSize\n#ifdef _DEBUG\n                               ,_In_ _In_z_ const char *szFile\n                               ,int  lineNum\n#endif\n                               )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        void *pResult;\n\n        pResult = UnlockedAllocMem_NoThrow(dwSize\n#ifdef _DEBUG\n                                           , szFile\n                                           , lineNum\n#endif\n                                           );\n        return pResult;\n    }\n\n\npublic:\n    void *AllocMemForCode_NoThrow(size_t dwHeaderSize, size_t dwCodeSize, DWORD dwCodeAlignment, size_t dwReserveForJumpStubs)\n    {\n        WRAPPER_NO_CONTRACT;\n        return UnlockedAllocMemForCode_NoThrow(dwHeaderSize, dwCodeSize, dwCodeAlignment, dwReserveForJumpStubs);\n    }\n\n    void SetReservedRegion(BYTE* dwReservedRegionAddress, SIZE_T dwReservedRegionSize, BOOL fReleaseMemory)\n    {\n        WRAPPER_NO_CONTRACT;\n        return UnlockedSetReservedRegion(dwReservedRegionAddress, dwReservedRegionSize, fReleaseMemory);\n    }\n\npublic:\n    // number of bytes available in region\n    size_t GetReservedBytesFree()\n    {\n        WRAPPER_NO_CONTRACT;\n        return UnlockedGetReservedBytesFree();\n    }\n\n    PTR_BYTE GetAllocPtr()\n    {\n        WRAPPER_NO_CONTRACT;\n        return UnlockedGetAllocPtr();\n    }\n\n    void ReservePages(size_t size)\n    {\n        WRAPPER_NO_CONTRACT;\n        UnlockedReservePages(size);\n    }\n};\n\n\n\n//==============================================================================\n// AllocMemHolder : Allocated memory from LoaderHeap\n//\n// Old:\n//\n//   Foo* pFoo = (Foo*)pLoaderHeap->AllocMem(size);\n//   pFoo->BackoutMem(pFoo, size)\n//\n//\n// New:\n//\n//  {\n//      AllocMemHolder<Foo> pfoo = pLoaderHeap->AllocMem();\n//  } // BackoutMem on out of scope\n//\n//==============================================================================\ntemplate <typename TYPE>\nclass AllocMemHolder\n{\n    private:\n        TaggedMemAllocPtr m_value;\n        BOOL              m_fAcquired;\n\n\n    //--------------------------------------------------------------------\n    // All allowed (and disallowed) ctors here.\n    //--------------------------------------------------------------------\n    public:\n        // Allow the construction \"Holder h;\"\n        AllocMemHolder()\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            m_value.m_pMem = NULL;\n            m_value.m_dwRequestedSize = 0;\n            m_value.m_pHeap = 0;\n            m_value.m_dwExtra = 0;\n#ifdef _DEBUG\n            m_value.m_szFile = NULL;\n            m_value.m_lineNum = 0;\n#endif\n            m_fAcquired    = FALSE;\n        }\n\n    public:\n        // Allow the construction \"Holder h = pHeap->AllocMem()\"\n        AllocMemHolder(const TaggedMemAllocPtr value)\n        {\n            LIMITED_METHOD_CONTRACT;\n            m_value     = value;\n            m_fAcquired = TRUE;\n        }\n\n    private:\n        // Disallow \"Holder holder1 = holder2\"\n        AllocMemHolder(const AllocMemHolder<TYPE> &);\n\n\n    private:\n        // Disallow \"Holder holder1 = void*\"\n        AllocMemHolder(const LPVOID &);\n\n    //--------------------------------------------------------------------\n    // Destructor (and the whole point of AllocMemHolder)\n    //--------------------------------------------------------------------\n    public:\n        ~AllocMemHolder()\n        {\n            WRAPPER_NO_CONTRACT;\n            if (m_fAcquired && m_value.m_pMem)\n            {\n                m_value.m_pHeap->RealBackoutMem(m_value.m_pMem,\n                                                m_value.m_dwRequestedSize\n#ifdef _DEBUG\n                                                ,__FILE__\n                                                ,__LINE__\n                                                ,m_value.m_szFile\n                                                ,m_value.m_lineNum\n#endif\n                                                );\n            }\n        }\n\n\n    //--------------------------------------------------------------------\n    // All allowed (and disallowed) assignment operators here.\n    //--------------------------------------------------------------------\n    public:\n        // Reluctantly allow \"AllocMemHolder h; ... h = pheap->AllocMem()\"\n        void operator=(const TaggedMemAllocPtr & value)\n        {\n            WRAPPER_NO_CONTRACT;\n            // However, prevent repeated assignments as that would leak.\n            _ASSERTE(m_value.m_pMem == NULL && !m_fAcquired);\n            m_value = value;\n            m_fAcquired = TRUE;\n        }\n\n    private:\n        // Disallow \"holder == holder2\"\n        const AllocMemHolder<TYPE> & operator=(const AllocMemHolder<TYPE> &);\n\n    private:\n        // Disallow \"holder = void*\"\n        const AllocMemHolder<TYPE> & operator=(const LPVOID &);\n\n\n    //--------------------------------------------------------------------\n    // Operations on the holder itself\n    //--------------------------------------------------------------------\n    public:\n        // Call this when you're ready to take ownership away from the holder.\n        void SuppressRelease()\n        {\n            LIMITED_METHOD_CONTRACT;\n            m_fAcquired = FALSE;\n        }\n\n\n\n    //--------------------------------------------------------------------\n    // ... And the smart-pointer stuff so we can drop holders on top\n    // of former pointer variables (mostly)\n    //--------------------------------------------------------------------\n    public:\n        // Allow holder to be treated as the underlying pointer type\n        operator TYPE* ()\n        {\n            LIMITED_METHOD_CONTRACT;\n            return (TYPE*)(void*)m_value;\n        }\n\n    public:\n        // Allow holder to be treated as the underlying pointer type\n        TYPE* operator->()\n        {\n            LIMITED_METHOD_CONTRACT;\n            return (TYPE*)(void*)m_value;\n        }\n    public:\n        int operator==(TYPE* value)\n        {\n            LIMITED_METHOD_CONTRACT;\n            return ((void*)m_value) == ((void*)value);\n        }\n\n    public:\n        int operator!=(TYPE* value)\n        {\n            LIMITED_METHOD_CONTRACT;\n            return ((void*)m_value) != ((void*)value);\n        }\n\n    public:\n        int operator!() const\n        {\n            LIMITED_METHOD_CONTRACT;\n            return m_value.m_pMem == NULL;\n        }\n\n\n};\n\n\n\n// This utility helps track loaderheap allocations. Its main purpose\n// is to backout allocations in case of an exception.\nclass AllocMemTracker\n{\n    public:\n        AllocMemTracker();\n        ~AllocMemTracker();\n\n        // Tells tracker to store an allocated loaderheap block.\n        //\n        // Returns the pointer address of block for convenience.\n        //\n        // Ok to call on failed loaderheap allocation (will just do nothing and propagate the OOM as apropos).\n        //\n        // If Track fails due to an OOM allocating node space, it will backout the loaderheap block before returning.\n        void *Track(TaggedMemAllocPtr tmap);\n        void *Track_NoThrow(TaggedMemAllocPtr tmap);\n\n        void SuppressRelease();\n\n    private:\n        struct AllocMemTrackerNode\n        {\n            ILoaderHeapBackout *m_pHeap;\n            void            *m_pMem;\n            size_t           m_dwRequestedSize;\n#ifdef _DEBUG\n            const char      *m_szAllocFile;\n            int              m_allocLineNum;\n#endif\n        };\n\n        enum\n        {\n            kAllocMemTrackerBlockSize =\n#ifdef _DEBUG\n                                        3\n#else\n                                       20\n#endif\n        };\n\n        struct AllocMemTrackerBlock\n        {\n            AllocMemTrackerBlock    *m_pNext;\n            int                      m_nextFree;\n            AllocMemTrackerNode      m_Node[kAllocMemTrackerBlockSize];\n        };\n\n\n        AllocMemTrackerBlock        *m_pFirstBlock;\n        AllocMemTrackerBlock        m_FirstBlock; // Stack-allocate the first block - \"new\" the rest.\n\n    protected:\n        BOOL                        m_fReleased;\n\n};\n\n#endif // __LoaderHeap_h__\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/log.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// Logging Facility\n//\n\n\n// Logging Subsystems\n\n\n#ifndef __LOG_H__\n#define __LOG_H__\n\n\n#define DEFINE_LOG_FACILITY(logname, value)  logname = value,\n\nenum {\n#include \"loglf.h\"\n    LF_ALWAYS        = 0x80000000, // Log message irrepespective of LogFacility (if the level matches)\n    LF_ALL           = 0xFFFFFFFF, // Used only to mask bits. Never use as LOG((LF_ALL, ...))\n\n    // LogFacility2: all 32-bit of LogFacility are used, need a 2nd DWORD for more facilities\n    LF2_MULTICOREJIT = 0x00000001  // Multicore JIT\n};\n\n\n#define LL_EVERYTHING  10\n#define LL_INFO1000000  9       // can be expected to generate 1,000,000 logs per small but not trivial run\n#define LL_INFO100000   8       // can be expected to generate 100,000 logs per small but not trivial run\n#define LL_INFO10000    7       // can be expected to generate 10,000 logs per small but not trivial run\n#define LL_INFO1000     6       // can be expected to generate 1,000 logs per small but not trivial run\n#define LL_INFO100      5       // can be expected to generate 100 logs per small but not trivial run\n#define LL_INFO10       4       // can be expected to generate 10 logs per small but not trivial run\n#define LL_WARNING      3\n#define LL_ERROR        2\n#define LL_FATALERROR   1\n#define LL_ALWAYS   \t0\t\t// impossible to turn off (log level never negative)\n\n\n#define INFO5       LL_INFO10\n#define INFO4       LL_INFO100\n#define INFO3       LL_INFO1000\n#define INFO2       LL_INFO10000\n#define INFO1       LL_INFO100000\n#define WARNING     0\n#define ERROR       0\n#define FATALERROR  0\n\n#ifndef LOGGING\n\n#define LOG(x)\n#define LOG2(x)\n#define LOGALWAYS(x)\n\n#define InitializeLogging()\n#define InitLogging()\n#define ShutdownLogging()\n#define FlushLogging()\n#define LoggingOn(facility, level) 0\n#define Logging2On(facility, level) 0\n#define EnterLogLock()\n#define LeaveLogLock()\n\n#else\n\nextern VOID InitializeLogging();\nextern VOID InitLogging();\nextern VOID ShutdownLogging();\nextern VOID FlushLogging();\n\nextern VOID LogSpew(DWORD facility, DWORD level, const char *fmt, ... );\nextern VOID LogSpewValist(DWORD facility, DWORD level, const char *fmt, va_list args);\n\nextern VOID LogSpew2(DWORD facility2, DWORD level, const char *fmt, ... );\nextern VOID LogSpew2Valist(DWORD facility2, DWORD level, const char *fmt, va_list args);\n\nextern VOID LogSpewAlwaysValist(const char *fmt, va_list args);\nextern VOID LogSpewAlways (const char *fmt, ... );\nextern VOID EnterLogLock();\nextern VOID LeaveLogLock();\n\nVOID AddLoggingFacility( DWORD facility );\nVOID SetLoggingLevel( DWORD level );\nbool LoggingEnabled();\nbool LoggingOn(DWORD facility, DWORD level);\nbool Logging2On(DWORD facility, DWORD level);\n\n#define LOG(x)      do { if (LoggingEnabled()) { LogSpew x; } } while (0)\n\n#define LOG2(x)     do { if (LoggingEnabled()) { LogSpew2 x; } } while (0)\n\n#define LOGALWAYS(x)   LogSpewAlways x\n\n#endif\n\n#ifdef __cplusplus\n#include \"stresslog.h\"\t\t// special logging for retail code\n#endif\n\n#endif //__LOG_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/loglf.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// The code in sos.DumpLog depends on the first 32 facility codes\n// being bit flags sorted in incresing order.\n\nDEFINE_LOG_FACILITY(LF_GC                ,0x00000001)\nDEFINE_LOG_FACILITY(LF_GCINFO            ,0x00000002)\nDEFINE_LOG_FACILITY(LF_STUBS             ,0x00000004)\nDEFINE_LOG_FACILITY(LF_JIT               ,0x00000008)\nDEFINE_LOG_FACILITY(LF_LOADER            ,0x00000010)\nDEFINE_LOG_FACILITY(LF_METADATA          ,0x00000020)\nDEFINE_LOG_FACILITY(LF_SYNC              ,0x00000040)\nDEFINE_LOG_FACILITY(LF_EEMEM             ,0x00000080)\nDEFINE_LOG_FACILITY(LF_GCALLOC           ,0x00000100)\nDEFINE_LOG_FACILITY(LF_CORDB             ,0x00000200)\nDEFINE_LOG_FACILITY(LF_CLASSLOADER       ,0x00000400)\nDEFINE_LOG_FACILITY(LF_CORPROF           ,0x00000800)\nDEFINE_LOG_FACILITY(LF_DIAGNOSTICS_PORT  ,0x00001000)\nDEFINE_LOG_FACILITY(LF_DBGALLOC          ,0x00002000)\nDEFINE_LOG_FACILITY(LF_EH                ,0x00004000)\nDEFINE_LOG_FACILITY(LF_ENC               ,0x00008000)\nDEFINE_LOG_FACILITY(LF_ASSERT            ,0x00010000)\nDEFINE_LOG_FACILITY(LF_VERIFIER          ,0x00020000)\nDEFINE_LOG_FACILITY(LF_THREADPOOL        ,0x00040000)\nDEFINE_LOG_FACILITY(LF_GCROOTS           ,0x00080000)\nDEFINE_LOG_FACILITY(LF_INTEROP           ,0x00100000)\nDEFINE_LOG_FACILITY(LF_MARSHALER         ,0x00200000)\nDEFINE_LOG_FACILITY(LF_TIEREDCOMPILATION ,0x00400000)  // This used to be IJW, but now repurposed for tiered compilation\nDEFINE_LOG_FACILITY(LF_ZAP               ,0x00800000)\nDEFINE_LOG_FACILITY(LF_STARTUP           ,0x01000000)  // Log startupa and shutdown failures\nDEFINE_LOG_FACILITY(LF_APPDOMAIN         ,0x02000000)\nDEFINE_LOG_FACILITY(LF_CODESHARING       ,0x04000000)\nDEFINE_LOG_FACILITY(LF_STORE             ,0x08000000)\nDEFINE_LOG_FACILITY(LF_SECURITY          ,0x10000000)\nDEFINE_LOG_FACILITY(LF_LOCKS             ,0x20000000)\nDEFINE_LOG_FACILITY(LF_BCL               ,0x40000000)\n//                  LF_ALWAYS             0x80000000     // make certain you don't try to use this bit for a real facility\n//                  LF_ALL                0xFFFFFFFF\n//\n#undef DEFINE_LOG_FACILITY\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/longfilepathwrappers.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _WIN_PATH_APIS_WRAPPER_\n#define _WIN_PATH_APIS_WRAPPER_\nclass SString;\n\nHMODULE\nLoadLibraryExWrapper(\n    _In_ LPCWSTR lpLibFileName,\n    _Reserved_ HANDLE hFile = NULL,\n    _In_ DWORD dwFlags = 0\n    );\n\nHANDLE\nCreateFileWrapper(\n    _In_ LPCWSTR lpFileName,\n    _In_ DWORD dwDesiredAccess,\n    _In_ DWORD dwShareMode,\n    _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,\n    _In_ DWORD dwCreationDisposition,\n    _In_ DWORD dwFlagsAndAttributes,\n    _In_opt_ HANDLE hTemplateFile\n    );\n\nDWORD\nGetFileAttributesWrapper(\n    _In_ LPCWSTR lpFileName\n    );\n\nBOOL\nGetFileAttributesExWrapper(\n    _In_ LPCWSTR lpFileName,\n    _In_ GET_FILEEX_INFO_LEVELS fInfoLevelId,\n    _Out_writes_bytes_(sizeof(WIN32_FILE_ATTRIBUTE_DATA)) LPVOID lpFileInformation\n    );\n\n#ifndef HOST_UNIX\nBOOL\nCopyFileExWrapper(\n    _In_        LPCWSTR lpExistingFileName,\n    _In_        LPCWSTR lpNewFileName,\n    _In_opt_    LPPROGRESS_ROUTINE lpProgressRoutine,\n    _In_opt_    LPVOID lpData,\n    _When_(pbCancel != NULL, _Pre_satisfies_(*pbCancel == FALSE))\n    _Inout_opt_ LPBOOL pbCancel,\n    _In_        DWORD dwCopyFlags\n    );\n#endif //HOST_UNIX\n\nDWORD\nSearchPathWrapper(\n    _In_opt_ LPCWSTR lpPath,\n    _In_ LPCWSTR lpFileName,\n    _In_opt_ LPCWSTR lpExtension,\n    _In_ BOOL getPath,\n    SString& lpBuffer,\n    _Out_opt_ LPWSTR * lpFilePart\n    );\n\nDWORD WINAPI GetTempPathWrapper(\n    SString& lpBuffer\n    );\n\nDWORD\nGetModuleFileNameWrapper(\n    _In_opt_ HMODULE hModule,\n    SString& buffer\n    );\n\nDWORD WINAPI GetEnvironmentVariableWrapper(\n    _In_opt_  LPCTSTR lpName,\n    _Out_opt_ SString&  lpBuffer\n    );\n\n#endif //_WIN_PATH_APIS_WRAPPER_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/md5.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// md5.h\n//\n\n//\n// A pretty fast implementation of MD5\n//\n\n\n#ifndef __MD5_H__\n#define __MD5_H__\n\n/////////////////////////////////////////////////////////////////////////////////////\n//\n// Declaration of the central transform function\n//\nvoid __stdcall MD5Transform(ULONG state[4], const ULONG* data);\n\n/////////////////////////////////////////////////////////////////////////////////////\n\n#include <pshpack1.h>\n\n\n// This structure is used to return the final resulting hash.\n//\nstruct MD5HASHDATA\n    {\n    union\n        {\n        BYTE rgb[16];\n        struct\n            {\n            ULONGLONG ullLow;\n            ULONGLONG ullHigh;\n            } u;\n        struct\n            {\n            ULONG     u0;\n            ULONG     u1;\n            ULONG     u2;\n            ULONG     u3;\n            } v;\n        };\n    };\n\ninline BOOL operator==(const MD5HASHDATA& me, const MD5HASHDATA& him)\n    {\n    return memcmp(&me, &him, sizeof(MD5HASHDATA)) == 0;\n    }\n\ninline BOOL operator!=(const MD5HASHDATA& me, const MD5HASHDATA& him)\n    {\n    return memcmp(&me, &him, sizeof(MD5HASHDATA)) != 0;\n    }\n\n\n// The engine that carries out the hash\n//\nclass MD5\n    {\n    // These four values must be contiguous, and in this order\n    union\n        {\n        ULONG       m_state[4];\n        struct\n            {\n            ULONG       m_a;              // state\n            ULONG       m_b;              //     ... variables\n            ULONG       m_c;              //            ... as found in\n            ULONG       m_d;              //                    ... RFC1321\n            } u;\n        };\n\n    BYTE        m_data[64];       // where to accumulate the data as we are passed it\n    ULONGLONG   m_cbitHashed;     // amount of data that we've hashed\n    ULONG       m_cbData;         // number of bytes presently in data\n\n    BYTE        m_padding[64];    // padding data, used if length data not = 0 mod 64\n\npublic:\n\n    /////////////////////////////////////////////////////////////////////////////////////\n\n    void Hash(const BYTE* pbData, ULONG cbData, MD5HASHDATA* phash, BOOL fConstructed = FALSE)\n        {\n        Init(fConstructed);\n        HashMore(pbData, cbData);\n        GetHashValue(phash);\n        }\n\n    /////////////////////////////////////////////////////////////////////////////////////\n\n    void Hash(const BYTE* pbData, ULONGLONG cbData, MD5HASHDATA* phash, BOOL fConstructed = FALSE)\n        {\n        Init(fConstructed);\n\n        ULARGE_INTEGER ul;\n        ul.QuadPart = cbData;\n\n        while (ul.u.HighPart)\n            {\n            ULONG cbHash = 0xFFFFFFFF;                      // Hash as much as we can at once\n            HashMore(pbData, cbHash);\n            pbData      += cbHash;\n            ul.QuadPart -= cbHash;\n            }\n\n        HashMore(pbData, ul.u.LowPart);                       // Hash whatever is left\n\n        GetHashValue(phash);\n        }\n\n    /////////////////////////////////////////////////////////////////////////////////////\n\n    void Init(BOOL fConstructed = FALSE);\n\n    /////////////////////////////////////////////////////////////////////////////////////\n\n    void HashMore(const void* pvInput, ULONG cbInput);\n\n    /////////////////////////////////////////////////////////////////////////////////////\n\n    void GetHashValue(MD5HASHDATA* phash);\n\n    /////////////////////////////////////////////////////////////////////////////////////\n\n    };\n\n#include <poppack.h>\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/mdcommon.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// MDCommon.h\n//\n// Common header file for both MD and COMPLIB subdirectories\n//\n//*****************************************************************************\n\n#ifndef __MDCommon_h__\n#define __MDCommon_h__\n\n// File types for the database.\nenum FILETYPE\n{\n    FILETYPE_UNKNOWN,       // Unknown or undefined type.\n    FILETYPE_CLB,           // Native .clb file format.\n    FILETYPE_NTPE,          // Windows PE executable.\n};\n\nenum MAPPINGTYPE\n{\n    MTYPE_NOMAPPING,                        // No mapped file\n    MTYPE_FLAT,                             // Mapped as a flat file\n    MTYPE_IMAGE                             // Mapped with the SEC_IMAGE flag\n};\n\n\n#define SCHEMA_STREAM_A             \"#Schema\"\n#define STRING_POOL_STREAM_A        \"#Strings\"\n#define BLOB_POOL_STREAM_A          \"#Blob\"\n#define US_BLOB_POOL_STREAM_A       \"#US\"\n#define GUID_POOL_STREAM_A          \"#GUID\"\n#define COMPRESSED_MODEL_STREAM_A   \"#~\"\n#define ENC_MODEL_STREAM_A          \"#-\"\n#define MINIMAL_MD_STREAM_A         \"#JTD\"\n#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB\n#define PDB_STREAM_A                \"#Pdb\"\n#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB\n\n#define SCHEMA_STREAM               W(\"#Schema\")\n#define STRING_POOL_STREAM          W(\"#Strings\")\n#define BLOB_POOL_STREAM            W(\"#Blob\")\n#define US_BLOB_POOL_STREAM         W(\"#US\")\n#define GUID_POOL_STREAM            W(\"#GUID\")\n#define COMPRESSED_MODEL_STREAM     W(\"#~\")\n#define ENC_MODEL_STREAM            W(\"#-\")\n#define MINIMAL_MD_STREAM           W(\"#JTD\")\n#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB\n#define PDB_STREAM                  W(\"#Pdb\")\n#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB\n\n#endif // __MDCommon_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/mdfileformat.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// MDFileFormat.h\n//\n\n//\n// This file contains a set of helpers to verify and read the file format.\n// This code does not handle the paging of the data, or different types of\n// I/O.  See the StgTiggerStorage and StgIO code for this level of support.\n//\n//*****************************************************************************\n#ifndef __MDFileFormat_h__\n#define __MDFileFormat_h__\n\n#include <metamodelpub.h>\n#include \"utilcode.h\"\n\n//*****************************************************************************\n// The signature ULONG is the first 4 bytes of the file format.  The second\n// signature string starts the header containing the stream list.  It is used\n// for an integrity check when reading the header in lieu of a more complicated\n// system.\n//*****************************************************************************\n#define STORAGE_MAGIC_SIG   0x424A5342  // BSJB\n\n\n\n//*****************************************************************************\n// These values get written to the signature at the front of the file.  Changing\n// these values should not be done lightly because all old files will no longer\n// be supported.  In a future revision if a format change is required, a\n// backwards compatible migration path must be provided.\n//*****************************************************************************\n\n#define FILE_VER_MAJOR  1\n#define FILE_VER_MINOR  1\n\n// These are the last legitimate 0.x version macros.  The file format has\n// sinced move up to 1.x (see macros above).  After COM+ 1.0/NT 5 RTM's, these\n// macros should no longer be required or ever seen.\n#define FILE_VER_MAJOR_v0   0\n\n#define FILE_VER_MINOR_v0   19\n\n\n#define MAXSTREAMNAME   32\n\nenum\n{\n    STGHDR_NORMAL           = 0x00,     // Normal default flags.\n    STGHDR_EXTRADATA        = 0x01,     // Additional data exists after header.\n};\n\n\n//*****************************************************************************\n// This is the formal signature area at the front of the file. This structure\n// is not allowed to change, the shim depends on it staying the same size.\n// Use the reserved pointer if it must extended.\n//*****************************************************************************\nstruct STORAGESIGNATURE;\ntypedef STORAGESIGNATURE UNALIGNED * PSTORAGESIGNATURE;\n\n#include \"pshpack1.h\"\nstruct STORAGESIGNATURE\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       lSignature;             // \"Magic\" signature.\n    USHORT      iMajorVer;              // Major file version.\n    USHORT      iMinorVer;              // Minor file version.\n    ULONG       iExtraData;             // Offset to next structure of information\n    ULONG       iVersionString;         // Length of version string\npublic:\n    BYTE        pVersion[0];            // Version string\n    ULONG GetSignature()\n    {\n        return VAL32(lSignature);\n    }\n    void SetSignature(ULONG Signature)\n    {\n        lSignature = VAL32(Signature);\n    }\n\n    USHORT GetMajorVer()\n    {\n        return VAL16(iMajorVer);\n    }\n    void SetMajorVer(USHORT MajorVer)\n    {\n        iMajorVer = VAL16(MajorVer);\n    }\n\n    USHORT GetMinorVer()\n    {\n        return VAL16(iMinorVer);\n    }\n    void SetMinorVer(USHORT MinorVer)\n    {\n        iMinorVer = VAL16(MinorVer);\n    }\n\n    ULONG GetExtraDataOffset()\n    {\n        return VAL32(iExtraData);\n    }\n    void SetExtraDataOffset(ULONG ExtraDataOffset)\n    {\n        iExtraData = VAL32(ExtraDataOffset);\n    }\n\n    ULONG GetVersionStringLength()\n    {\n        return VAL32(iVersionString);\n    }\n    void SetVersionStringLength(ULONG VersionStringLength)\n    {\n        iVersionString = VAL32(VersionStringLength);\n    }\n};\n#include \"poppack.h\"\n\n\n//*****************************************************************************\n// The header of the storage format.\n//*****************************************************************************\nstruct STORAGEHEADER;\ntypedef STORAGEHEADER UNALIGNED * PSTORAGEHEADER;\n\n#include \"pshpack1.h\"\nstruct STORAGEHEADER\n{\nMETADATA_FIELDS_PROTECTION:\n    BYTE        fFlags;                 // STGHDR_xxx flags.\n    BYTE        pad;\n    USHORT      iStreams;               // How many streams are there.\npublic:\n    BYTE GetFlags()\n    {\n        return fFlags;\n    }\n    void SetFlags(BYTE flags)\n    {\n        fFlags = flags;\n    }\n    void AddFlags(BYTE flags)\n    {\n        fFlags |= flags;\n    }\n\n\n    USHORT GetiStreams()\n    {\n        return VAL16(iStreams);\n    }\n    void SetiStreams(USHORT iStreamsCount)\n    {\n        iStreams = VAL16(iStreamsCount);\n    }\n};\n#include \"poppack.h\"\n\n\n//*****************************************************************************\n// Each stream is described by this struct, which includes the offset and size\n// of the data.  The name is stored in ANSI null terminated.\n//*****************************************************************************\nstruct STORAGESTREAM;\ntypedef STORAGESTREAM UNALIGNED * PSTORAGESTREAM;\n\n#include \"pshpack1.h\"\nstruct STORAGESTREAM\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       iOffset;                // Offset in file for this stream.\n    ULONG       iSize;                  // Size of the file.\n    char        rcName[MAXSTREAMNAME];  // Start of name, null terminated.\npublic:\n    // Returns pointer to the next stream. Doesn't validate the structure.\n    inline PSTORAGESTREAM NextStream()\n    {\n        int         iLen = (int)(strlen(rcName) + 1);\n        iLen = ALIGN4BYTE(iLen);\n        return ((PSTORAGESTREAM) (((BYTE*)this) + (sizeof(ULONG) * 2) + iLen));\n    }\n    // Returns pointer to the next stream.\n    // Returns NULL if the structure has invalid format.\n    inline PSTORAGESTREAM NextStream_Verify()\n    {\n        // Check existence of null-terminator in the name\n        if (memchr(rcName, 0, MAXSTREAMNAME) == NULL)\n        {\n            return NULL;\n        }\n        return NextStream();\n    }\n\n    inline ULONG GetStreamSize()\n    {\n        return (ULONG)(strlen(rcName) + 1 + (sizeof(STORAGESTREAM) - sizeof(rcName)));\n    }\n\n    inline char* GetName()\n    {\n        return rcName;\n    }\n    inline LPCWSTR GetName(__inout_ecount (iMaxSize) LPWSTR szName, int iMaxSize)\n    {\n        VERIFY(::WszMultiByteToWideChar(CP_ACP, 0, rcName, -1, szName, iMaxSize));\n        return (szName);\n    }\n    inline void SetName(LPCWSTR szName)\n    {\n        int size;\n        size = WszWideCharToMultiByte(CP_ACP, 0, szName, -1, rcName, MAXSTREAMNAME, 0, 0);\n        _ASSERTE(size > 0);\n    }\n\n    ULONG GetSize()\n    {\n        return VAL32(iSize);\n    }\n    void SetSize(ULONG Size)\n    {\n        iSize = VAL32(Size);\n    }\n\n    ULONG GetOffset()\n    {\n        return VAL32(iOffset);\n    }\n    void SetOffset(ULONG Offset)\n    {\n        iOffset = VAL32(Offset);\n    }\n};\n#include \"poppack.h\"\n\n\nclass MDFormat\n{\npublic:\n//*****************************************************************************\n// Verify the signature at the front of the file to see what type it is.\n//*****************************************************************************\n    static HRESULT VerifySignature(\n        PSTORAGESIGNATURE pSig,         // The signature to check.\n        ULONG             cbData);      // Size of metadata.\n\n//*****************************************************************************\n// Skip over the header and find the actual stream data.\n// It doesn't perform any checks for buffer overflow - use GetFirstStream_Verify\n// instead.\n//*****************************************************************************\n    static PSTORAGESTREAM GetFirstStream(// Return pointer to the first stream.\n        PSTORAGEHEADER pHeader,             // Return copy of header struct.\n        const void *pvMd);                  // Pointer to the full file.\n//*****************************************************************************\n// Skip over the header and find the actual stream data.  Secure version of\n// GetFirstStream method.\n// The header is supposed to be verified by VerifySignature.\n//\n// Caller has to check available buffer size before using the first stream.\n//*****************************************************************************\n    static PSTORAGESTREAM GetFirstStream_Verify(// Return pointer to the first stream.\n        PSTORAGEHEADER pHeader,             // Return copy of header struct.\n        const void    *pvMd,                // Pointer to the full file.\n        ULONG         *pcbMd);              // [in, out] Size of pvMd buffer (we don't want to read behind it)\n\n};\n\n#endif // __MDFileFormat_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/memorypool.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef _MEMORYPOOL_\n#define _MEMORYPOOL_\n\n#include \"daccess.h\"\n#include \"contract.h\"\n\n//\n// A MemoryPool is an allocator for a fixed size elements.\n// Allocating and freeing elements from the pool is very cheap compared\n// to a general allocator like new.  However, a MemoryPool is slightly\n// more greedy - it preallocates a bunch of elements at a time, and NEVER\n// RELEASES MEMORY FROM THE POOL ONCE IT IS ALLOCATED, (unless you call\n// FreeAllElements.)\n//\n// It also has several additional features:\n//\t* you can free the entire pool of objects cheaply.\n//\t* you can test an object to see if it's an element of the pool.\n//\n\nclass MemoryPool\n{\n  public:\n\n#ifndef DACCESS_COMPILE\n\tMemoryPool(SIZE_T elementSize, SIZE_T initGrowth = 20, SIZE_T initCount = 0);\n#else\n        MemoryPool() {}\n#endif\n\t~MemoryPool() DAC_EMPTY();\n\n\tBOOL IsElement(void *element);\n\tBOOL IsAllocatedElement(void *element);\n\tvoid *AllocateElement();\n\tvoid *AllocateElementNoThrow();\n\tvoid FreeElement(void *element);\n\tvoid FreeAllElements();\n        size_t GetSize();\n  private:\n\n\tstruct Element\n\t{\n\t\tElement *next;\n#if _DEBUG\n\t\tint\t\tdeadBeef;\n#endif\n\t};\n\n\tstruct Block\n\t{\n\t\tBlock\t*next;\n\t\tElement *elementsEnd;\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4200)\n#endif\n\t\tElement elements[0];\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif\n\t};\n\n\tSIZE_T m_elementSize;\n\tSIZE_T m_growCount;\n\tBlock *m_blocks;\n\tElement *m_freeList;\n\n\tBOOL AddBlock(SIZE_T elementCount);\n\tvoid DeadBeef(Element *element);\n\n public:\n\n\t//\n\t// NOTE: You can currently only iterate the elements\n\t// if none have been freed.\n\t//\n\n\tclass Iterator\n    {\n\tprivate:\n\t\tBlock\t*m_next;\n\t\tBYTE\t*m_e, *m_eEnd;\n\t\tBYTE\t*m_end;\n\t\tSIZE_T\tm_size;\n\n\tpublic:\n\t\tIterator(MemoryPool *pool);\n\n\t\tBOOL Next();\n\n\t\tvoid *GetElement() {LIMITED_METHOD_CONTRACT;  return (void *) (m_e-m_size); }\n\t};\n\n\tfriend class Iterator;\n};\n\nclass MemoryPoolElementHolder\n{\n    protected:\n        MemoryPool* m_pool;\n        void* m_element;\n        BOOL bRelease;\n    public:\n    void SuppressRelease()\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(bRelease);\n        bRelease=false;\n    }\n    void Release()\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(bRelease);\n        m_pool->FreeElement(m_element);\n        bRelease=false;\n    }\n    MemoryPoolElementHolder(MemoryPool* pool, void* element)\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_pool=pool;\n        m_element=element;\n        bRelease=true;\n    }\n\n    ~MemoryPoolElementHolder()\n    {\n        LIMITED_METHOD_CONTRACT;\n        if (bRelease)\n            Release();\n    }\n\n    operator void* ()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_element;\n    }\n};\n\n#endif // _MEMORYPOOL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/memoryrange.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// MemoryRange.h\n//\n// defines the code:MemoryRange class.\n//*****************************************************************************\n\n#ifndef _memory_range_h\n#define _memory_range_h\n\n#include \"daccess.h\"\n\n// MemoryRange is a descriptor of a memory range. This groups (pointer + size).\n//\n// Some key qualities:\n// - simple!\n// - Not mutable\n// - blitabble descriptor which can be useful for out-of-process tools like the debugger.\n// - no ownership semantics.\n// - no manipulation, growing semantics.\n// - no memory marshalling, allocation, copying. etc.\n// - can be efficiently passed / copied / returned by value\n//\n// This class has general value as an abstraction to group pointer and size together. It also has significant\n// value to the debugger. An expected design pattern is that other mutable complex data structures (eg,\n// code:SBuffer, code:CGrowableStream) will provide an accessor to expose their underlying storage as a\n// MemoryRange to debugger. This mirrors the Debugger's code:TargetBuffer data structure, but as a\n// general-purpose VM utility versus a debugger right-side data structure.\n\n//\nclass MemoryRange\n{\npublic:\n    // Constructor to create a memory range around a (start address, size) pair.\n    MemoryRange() :\n        m_pStartAddress(NULL),\n        m_cbBytes(0)\n    {\n        SUPPORTS_DAC;\n    }\n\n    MemoryRange(PTR_VOID pStartAddress, SIZE_T cbBytes) :\n        m_pStartAddress(pStartAddress),\n        m_cbBytes(cbBytes)\n    {\n        SUPPORTS_DAC;\n    }\n\n    // Note: use compiler-default copy ctor and assignment operator\n\n\n\n    // Check whether a pointer is in the memory range represented by this instance.\n    BOOL IsInRange(PTR_VOID pAddress) const\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n\n        return (dac_cast<TADDR>(pAddress) - dac_cast<TADDR>(m_pStartAddress)) < m_cbBytes;\n    }\n\n    // Check whether a pointer is in the memory range represented by this instance.\n    BOOL IsInRange(TADDR pAddress) const\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n\n        return (pAddress - dac_cast<TADDR>(m_pStartAddress)) < m_cbBytes;\n    }\n\n    // Get the starting address.\n    PTR_VOID StartAddress() const\n    {\n        SUPPORTS_DAC;\n        return m_pStartAddress;\n    }\n\n    // Get the size of the range in bytes\n    SIZE_T Size() const\n    {\n        SUPPORTS_DAC;\n        return m_cbBytes;\n    }\n\nprivate:\n    // The start of the memory range.\n    PTR_VOID const m_pStartAddress;\n\n    // The size of the memory range in bytes.\n    // This is s SIZE_T so that it can describe any memory range in the process (for example, larger than 4gb on 64-bit machines)\n    const SIZE_T        m_cbBytes;\n\n};\n\ntypedef ArrayDPTR(MemoryRange) ARRAY_PTR_MemoryRange;\n\n#endif // _memory_range_h\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/metadata.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//****************************************************************************\n//  File: metadata.h\n//\n\n//\n//  Notes:\n//   Common includes for EE & metadata internal. This file contains\n//   definition of CorMetaDataScope\n//****************************************************************************\n\n#ifndef _METADATA_H_\n#define _METADATA_H_\n\n#include \"ex.h\"\n\nclass IMetaModelCommon;\nclass MDInternalRW;\nclass UTSemReadWrite;\n\ninline int IsGlobalMethodParentTk(mdTypeDef td)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (td == mdTypeDefNil || td == mdTokenNil);\n}\n\ntypedef enum CorInternalStates\n{\n    tdNoTypes               = 0x00000000,\n    tdAllAssemblies         = 0x00000001,\n    tdAllTypes              = 0xffffffff,\n} CorInternalStates;\n\n//\n// MetaData custom value names.\n//\nenum CorIfaceAttr\n{\n    ifDual        = 0,            // Interface derives from IDispatch.\n    ifVtable      = 1,            // Interface derives from IUnknown.\n    ifDispatch    = 2,            // Interface is a dispinterface.\n    ifInspectable = 3,            // Interface derives from IInspectable.\n    ifLast        = 4,            // The last member of the enum.\n};\n\ninline BOOL IsDispatchBasedItf(CorIfaceAttr ifaceAttr)\n{\n    return (ifaceAttr == ifDual || ifaceAttr == ifDispatch);\n}\n\nenum CorClassIfaceAttr\n{\n    clsIfNone      = 0,                 // No class interface is generated.\n    clsIfAutoDisp  = 1,                 // A dispatch only class interface is generated.\n    clsIfAutoDual  = 2,                 // A dual class interface is generated.\n    clsIfLast      = 3,                 // The last member of the enum.\n};\n\n//\n// The default values for the COM interface and class interface types.\n//\n#define DEFAULT_COM_INTERFACE_TYPE ifDual\n#define DEFAULT_CLASS_INTERFACE_TYPE clsIfAutoDisp\n\n#define HANDLE_UNCOMPRESSED(func) (E_FAIL)\n#define HANDLE_UNCOMPRESSED_BOOL(func) (false)\n\nclass TOKENLIST : public CDynArray<mdToken>\n{\n};\n\n\ntypedef enum tagEnumType\n{\n    MDSimpleEnum        = 0x0,                  // simple enumerator that doesn't allocate memory\n\n    // You could get this kind of enum if you perform a non-simple query (such as EnumMethodWithName).\n    //\n    MDDynamicArrayEnum = 0x2,                   // dynamic array that holds tokens\n} EnumType;\n\n//*****************************************\n// Enumerator used by MetaDataInternal\n//*****************************************\nstruct HENUMInternal\n{\n    DWORD       m_tkKind;                   // kind of tables that the enum is holding the result\n    uint32_t    m_ulCount;                  // count of total entries holding by the enumerator\n\n    EnumType    m_EnumType;\n\n    struct {\n        uint32_t   m_ulStart;\n        uint32_t   m_ulEnd;\n        uint32_t   m_ulCur;\n    } u;\n\n    // m_cursor will go away when we no longer support running EE with uncompressed\n    // format. WHEN WE REMOVE THIS, REMOVE ITS VESTIAGES FROM ZeroEnum as well\n    //\n    union {\n        void*       m_alignpad;                 // The first item is m_cursor[] is a pointer\n        char        m_cursor[32];               // cursor holding query result for read/write mode\n    };\n\n    // TOKENLIST    daTKList;               // dynamic arrays of token list\n    HENUMInternal() : m_EnumType(MDSimpleEnum) { LIMITED_METHOD_DAC_CONTRACT; }\n\n    // in-place initialization\n    static void InitDynamicArrayEnum(\n        HENUMInternal   *pEnum);            // HENUMInternal to be initialized\n\n    static void InitSimpleEnum(\n        DWORD           tkKind,             // kind of token that we are iterating\n        ULONG           ridStart,           // starting rid\n        ULONG           ridEnd,             // end rid\n        HENUMInternal   *pEnum);            // HENUMInternal to be initialized\n\n    // Specialized helper which should be better than always calling memset\n    inline\n    static void ZeroEnum(\n        HENUMInternal   *pEnum)\n    {\n        // we use this to avoid the memset that will happen otherwise.\n        // this should be inlined in its caller. we are seeing a large\n        // number of calls to memset from MDInternalRO::EnumPermissionSetsInit\n        // on x64 which we can eliminate with this code.\n        pEnum->m_tkKind = 0;\n        pEnum->m_ulCount = 0;\n        pEnum->m_EnumType =  MDSimpleEnum;\n        pEnum->u.m_ulStart = 0;\n        pEnum->u.m_ulEnd = 0;\n        pEnum->u.m_ulCur = 0;\n\n        // TODO: remove this when we remove m_cursor from the HENUMInternal structure\n        _ASSERTE(IS_ALIGNED(pEnum->m_cursor, sizeof(DWORD)));\n        _ASSERTE((sizeof(HENUMInternal) - offsetof(HENUMInternal, m_cursor)) == (8 * sizeof(DWORD)));\n\n        DWORD* pBuffer = (DWORD*)pEnum->m_cursor;\n        pBuffer[0] = 0;\n        pBuffer[1] = 0;\n        pBuffer[2] = 0;\n        pBuffer[3] = 0;\n        pBuffer[4] = 0;\n        pBuffer[5] = 0;\n        pBuffer[6] = 0;\n        pBuffer[7] = 0;\n    }\n\n    // This will only clear the content of enum and will not free the memory of enum\n    static void ClearEnum(\n        HENUMInternal   *pmdEnum);\n\n    // create a HENUMInternal. This will allocate the memory\n    __checkReturn\n    static HRESULT CreateSimpleEnum(\n        DWORD           tkKind,             // kind of token that we are iterating\n        ULONG           ridStart,           // starting rid\n        ULONG           ridEnd,             // end rid\n        HENUMInternal   **ppEnum);          // return the created HENUMInternal\n\n    __checkReturn\n    static HRESULT CreateDynamicArrayEnum(\n        DWORD           tkKind,             // kind of token that we are iterating\n        HENUMInternal   **ppEnum);          // return the created HENUMInternal\n\n    // Destroy Enum. This will free the memory\n    static void DestroyEnum(\n        HENUMInternal   *pmdEnum);\n\n    static void DestroyEnumIfEmpty(\n        HENUMInternal   **ppEnum);          // reset the enumerator pointer to NULL if empty\n\n    __checkReturn\n    static HRESULT EnumWithCount(\n        HENUMInternal   *pEnum,             // enumerator\n        ULONG           cMax,               // max tokens that caller wants\n        mdToken         rTokens[],          // output buffer to fill the tokens\n        ULONG           *pcTokens);         // number of tokens fill to the buffer upon return\n\n    __checkReturn\n    static HRESULT EnumWithCount(\n        HENUMInternal   *pEnum,             // enumerator\n        ULONG           cMax,               // max tokens that caller wants\n        mdToken         rTokens1[],         // first output buffer to fill the tokens\n        mdToken         rTokens2[],         // second output buffer to fill the tokens\n        ULONG           *pcTokens);         // number of tokens fill to the buffer upon return\n\n    __checkReturn\n    static HRESULT AddElementToEnum(\n        HENUMInternal   *pEnum,             // return the created HENUMInternal\n        mdToken         tk);                // token to fill\n\n    //*****************************************\n    // Get next value contained in the enumerator\n    //*****************************************\n    static bool EnumNext(\n        HENUMInternal   *phEnum,            // [IN] the enumerator to retrieve information\n        mdToken         *ptk);              // [OUT] token to scope the search\n\n    __checkReturn\n    static HRESULT GetCount(\n        HENUMInternal   *phEnum,            // [IN] the enumerator to retrieve information\n        ULONG           *pCount);           // ]OUT] the index of the desired item\n\n    __checkReturn\n    static HRESULT GetElement(\n        HENUMInternal   *phEnum,            // [IN] the enumerator to retrieve information\n        ULONG           ix,                 // ]IN] the index of the desired item\n        mdToken         *ptk);              // [OUT] token to fill\n\n};\n\n\n\n//*****************************************\n// Default Value for field, param or property. Returned by GetDefaultValue\n//*****************************************\ntypedef struct _MDDefaultValue\n{\n#if BIGENDIAN\n    _MDDefaultValue(void)\n    {\n        m_bType = ELEMENT_TYPE_END;\n    }\n    ~_MDDefaultValue(void)\n    {\n        if (m_bType == ELEMENT_TYPE_STRING)\n        {\n            delete[] m_wzValue;\n        }\n    }\n#endif\n\n    // type of default value\n    BYTE            m_bType;                // CorElementType for the default value\n\n    // the default value\n    union\n    {\n        BOOL        m_bValue;               // ELEMENT_TYPE_BOOLEAN\n        CHAR        m_cValue;               // ELEMENT_TYPE_I1\n        BYTE        m_byteValue;            // ELEMENT_TYPE_UI1\n        SHORT       m_sValue;               // ELEMENT_TYPE_I2\n        USHORT      m_usValue;              // ELEMENT_TYPE_UI2\n        LONG        m_lValue;               // ELEMENT_TYPE_I4\n        ULONG       m_ulValue;              // ELEMENT_TYPE_UI4\n        LONGLONG    m_llValue;              // ELEMENT_TYPE_I8\n        ULONGLONG   m_ullValue;             // ELEMENT_TYPE_UI8\n        FLOAT       m_fltValue;             // ELEMENT_TYPE_R4\n        DOUBLE      m_dblValue;             // ELEMENT_TYPE_R8\n        LPCWSTR     m_wzValue;              // ELEMENT_TYPE_STRING\n        IUnknown    *m_unkValue;            // ELEMENT_TYPE_CLASS\n    };\n    ULONG   m_cbSize;   // default value size (for blob)\n\n} MDDefaultValue;\n\n\n\n//*****************************************\n// structure use to in GetAllEventAssociates and GetAllPropertyAssociates\n//*****************************************\ntypedef struct\n{\n    mdMethodDef m_memberdef;\n    DWORD       m_dwSemantics;\n} ASSOCIATE_RECORD;\n\n\n//\n// structure use to retrieve class layout information\n//\ntypedef struct\n{\n    RID         m_ridFieldCur;          // indexing to the field table\n    RID         m_ridFieldEnd;          // end index to field table\n} MD_CLASS_LAYOUT;\n\n\n// Structure for describing the Assembly MetaData.\ntypedef struct\n{\n    USHORT      usMajorVersion;         // Major Version.\n    USHORT      usMinorVersion;         // Minor Version.\n    USHORT      usBuildNumber;          // Build Number.\n    USHORT      usRevisionNumber;       // Revision Number.\n    LPCSTR      szLocale;               // Locale.\n} AssemblyMetaDataInternal;\n\n\n\n// Callback definition for comparing signatures.\n// (*PSIGCOMPARE) (BYTE ScopeSignature[], DWORD ScopeSignatureLength,\n//                 BYTE ExternalSignature[], DWORD ExternalSignatureLength,\n//                 void* SignatureData);\ntypedef BOOL (*PSIGCOMPARE)(PCCOR_SIGNATURE, DWORD, PCCOR_SIGNATURE, DWORD, void*);\n\n\n// {1B119F60-C507-4024-BB39-F8223FB3E1FD}\nEXTERN_GUID(IID_IMDInternalImport, 0x1b119f60, 0xc507, 0x4024, 0xbb, 0x39, 0xf8, 0x22, 0x3f, 0xb3, 0xe1, 0xfd);\n\n#undef  INTERFACE\n#define INTERFACE IMDInternalImport\nDECLARE_INTERFACE_(IMDInternalImport, IUnknown)\n{\n    //*****************************************************************************\n    // return the count of entries of a given kind in a scope\n    // For example, pass in mdtMethodDef will tell you how many MethodDef\n    // contained in a scope\n    //*****************************************************************************\n    STDMETHOD_(ULONG, GetCountWithTokenKind)(// return hresult\n        DWORD       tkKind) PURE;           // [IN] pass in the kind of token.\n\n    //*****************************************************************************\n    // enumerator for typedef\n    //*****************************************************************************\n    __checkReturn\n    STDMETHOD(EnumTypeDefInit)(             // return hresult\n        HENUMInternal *phEnum) PURE;        // [OUT] buffer to fill for enumerator data\n\n    //*****************************************************************************\n    // enumerator for MethodImpl\n    //*****************************************************************************\n    __checkReturn\n    STDMETHOD(EnumMethodImplInit)(          // return hresult\n        mdTypeDef       td,                 // [IN] TypeDef over which to scope the enumeration.\n        HENUMInternal   *phEnumBody,        // [OUT] buffer to fill for enumerator data for MethodBody tokens.\n        HENUMInternal   *phEnumDecl) PURE;  // [OUT] buffer to fill for enumerator data for MethodDecl tokens.\n\n    ULONG EnumMethodImplGetCount(\n        HENUMInternal   *phEnumBody,        // [IN] MethodBody enumerator.\n        HENUMInternal   *phEnumDecl)        // [IN] MethodDecl enumerator.\n    {\n        return phEnumBody->m_ulCount;\n    }\n\n    STDMETHOD_(void, EnumMethodImplReset)(\n        HENUMInternal   *phEnumBody,        // [IN] MethodBody enumerator.\n        HENUMInternal   *phEnumDecl) PURE;  // [IN] MethodDecl enumerator.\n\n    __checkReturn\n    STDMETHOD(EnumMethodImplNext)(          // return hresult (S_OK = TRUE, S_FALSE = FALSE or error code)\n        HENUMInternal   *phEnumBody,        // [IN] input enum for MethodBody\n        HENUMInternal   *phEnumDecl,        // [IN] input enum for MethodDecl\n        mdToken         *ptkBody,           // [OUT] return token for MethodBody\n        mdToken         *ptkDecl) PURE;     // [OUT] return token for MethodDecl\n\n    STDMETHOD_(void, EnumMethodImplClose)(\n        HENUMInternal   *phEnumBody,        // [IN] MethodBody enumerator.\n        HENUMInternal   *phEnumDecl) PURE;  // [IN] MethodDecl enumerator.\n\n    //*****************************************\n    // Enumerator helpers for memberdef, memberref, interfaceimp,\n    // event, property, exception, param\n    //*****************************************\n\n    __checkReturn\n    STDMETHOD(EnumGlobalFunctionsInit)(     // return hresult\n        HENUMInternal   *phEnum) PURE;      // [OUT] buffer to fill for enumerator data\n\n    __checkReturn\n    STDMETHOD(EnumGlobalFieldsInit)(        // return hresult\n        HENUMInternal   *phEnum) PURE;      // [OUT] buffer to fill for enumerator data\n\n    __checkReturn\n    STDMETHOD(EnumInit)(                    // return S_FALSE if record not found\n        DWORD       tkKind,                 // [IN] which table to work on\n        mdToken     tkParent,               // [IN] token to scope the search\n        HENUMInternal *phEnum) PURE;        // [OUT] the enumerator to fill\n\n    __checkReturn\n    STDMETHOD(EnumAllInit)(                 // return S_FALSE if record not found\n        DWORD       tkKind,                 // [IN] which table to work on\n        HENUMInternal *phEnum) PURE;        // [OUT] the enumerator to fill\n\n    bool EnumNext(\n        HENUMInternal *phEnum,              // [IN] the enumerator to retrieve information\n        mdToken     *ptk)                   // [OUT] token to scope the search\n    {\n        _ASSERTE(phEnum && ptk);\n        if (phEnum->u.m_ulCur >= phEnum->u.m_ulEnd)\n            return false;\n\n        if ( phEnum->m_EnumType == MDSimpleEnum )\n        {\n            *ptk = phEnum->u.m_ulCur | phEnum->m_tkKind;\n            phEnum->u.m_ulCur++;\n        }\n        else\n        {\n            TOKENLIST       *pdalist = (TOKENLIST *)&(phEnum->m_cursor);\n\n            _ASSERTE( phEnum->m_EnumType == MDDynamicArrayEnum );\n            *ptk = *( pdalist->Get(phEnum->u.m_ulCur++) );\n        }\n        return true;\n    }\n\n    ULONG EnumGetCount(\n        HENUMInternal *phEnum)        // [IN] the enumerator to retrieve information\n    {\n        _ASSERTE(phEnum);\n        return phEnum->m_ulCount;\n    }\n\n    void EnumReset(\n        HENUMInternal *phEnum)        // [IN] the enumerator to be reset\n    {\n        _ASSERTE(phEnum);\n        _ASSERTE( phEnum->m_EnumType == MDSimpleEnum || phEnum->m_EnumType == MDDynamicArrayEnum);\n\n        phEnum->u.m_ulCur = phEnum->u.m_ulStart;\n    } // MDInternalRW::EnumReset\n\n    void EnumClose(\n        HENUMInternal *phEnum)        // [IN] the enumerator to be closed\n    {\n        _ASSERTE( phEnum->m_EnumType == MDSimpleEnum ||\n            phEnum->m_EnumType == MDDynamicArrayEnum);\n        if (phEnum->m_EnumType == MDDynamicArrayEnum)\n            HENUMInternal::ClearEnum(phEnum);\n    }\n\n    //*****************************************\n    // Enumerator helpers for CustomAttribute\n    //*****************************************\n    __checkReturn\n    STDMETHOD(EnumCustomAttributeByNameInit)(// return S_FALSE if record not found\n        mdToken     tkParent,               // [IN] token to scope the search\n        LPCSTR      szName,                 // [IN] CustomAttribute's name to scope the search\n        HENUMInternal *phEnum) PURE;        // [OUT] the enumerator to fill\n\n    //*****************************************\n    // Nagivator helper to navigate back to the parent token given a token.\n    // For example, given a memberdef token, it will return the containing typedef.\n    //\n    // the mapping is as following:\n    //  ---given child type---------parent type\n    //  mdMethodDef                 mdTypeDef\n    //  mdFieldDef                  mdTypeDef\n    //  mdInterfaceImpl             mdTypeDef\n    //  mdParam                     mdMethodDef\n    //  mdProperty                  mdTypeDef\n    //  mdEvent                     mdTypeDef\n    //\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetParentToken)(\n        mdToken     tkChild,                // [IN] given child token\n        mdToken     *ptkParent) PURE;       // [OUT] returning parent\n\n    //*****************************************\n    // Custom value helpers\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetCustomAttributeProps)(     // S_OK or error.\n        mdCustomAttribute at,               // [IN] The attribute.\n        mdToken     *ptkType) PURE;         // [OUT] Put attribute type here.\n\n    __checkReturn\n    STDMETHOD(GetCustomAttributeAsBlob)(\n        mdCustomAttribute cv,               // [IN] given custom value token\n        void const  **ppBlob,               // [OUT] return the pointer to internal blob\n        ULONG       *pcbSize) PURE;         // [OUT] return the size of the blob\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD (GetScopeProps)(\n        LPCSTR      *pszName,               // [OUT] scope name\n        GUID        *pmvid) PURE;           // [OUT] version id\n\n    // finding a particular method\n    __checkReturn\n    STDMETHOD(FindMethodDef)(\n        mdTypeDef   classdef,               // [IN] given typedef\n        LPCSTR      szName,                 // [IN] member name\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        mdMethodDef *pmd) PURE;             // [OUT] matching memberdef\n\n    // return a iSeq's param given a MethodDef\n    __checkReturn\n    STDMETHOD(FindParamOfMethod)(           // S_OK or error.\n        mdMethodDef md,                     // [IN] The owning method of the param.\n        ULONG       iSeq,                   // [IN] The sequence # of the param.\n        mdParamDef  *pparamdef) PURE;       // [OUT] Put ParamDef token here.\n\n    //*****************************************\n    //\n    // GetName* functions\n    //\n    //*****************************************\n\n    // return the name and namespace of typedef\n    __checkReturn\n    STDMETHOD(GetNameOfTypeDef)(\n        mdTypeDef   classdef,               // given classdef\n        LPCSTR      *pszname,               // return class name(unqualified)\n        LPCSTR      *psznamespace) PURE;    // return the name space name\n\n    __checkReturn\n    STDMETHOD(GetIsDualOfTypeDef)(\n        mdTypeDef   classdef,               // [IN] given classdef.\n        ULONG       *pDual) PURE;           // [OUT] return dual flag here.\n\n    __checkReturn\n    STDMETHOD(GetIfaceTypeOfTypeDef)(\n        mdTypeDef   classdef,               // [IN] given classdef.\n        ULONG       *pIface) PURE;          // [OUT] 0=dual, 1=vtable, 2=dispinterface\n\n    // get the name of either methoddef\n    __checkReturn\n    STDMETHOD(GetNameOfMethodDef)(  // return the name of the memberdef in UTF8\n        mdMethodDef md,             // given memberdef\n        LPCSTR     *pszName) PURE;\n\n    __checkReturn\n    STDMETHOD(GetNameAndSigOfMethodDef)(\n        mdMethodDef      methoddef,         // [IN] given memberdef\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to a blob value of CLR signature\n        ULONG           *pcbSigBlob,        // [OUT] count of bytes in the signature blob\n        LPCSTR          *pszName) PURE;\n\n    // return the name of a FieldDef\n    __checkReturn\n    STDMETHOD(GetNameOfFieldDef)(\n        mdFieldDef fd,              // given memberdef\n        LPCSTR    *pszName) PURE;\n\n    // return the name of typeref\n    __checkReturn\n    STDMETHOD(GetNameOfTypeRef)(\n        mdTypeRef   classref,               // [IN] given typeref\n        LPCSTR      *psznamespace,          // [OUT] return typeref name\n        LPCSTR      *pszname) PURE;         // [OUT] return typeref namespace\n\n    // return the resolutionscope of typeref\n    __checkReturn\n    STDMETHOD(GetResolutionScopeOfTypeRef)(\n        mdTypeRef classref,                     // given classref\n        mdToken  *ptkResolutionScope) PURE;\n\n    // Find the type token given the name.\n    __checkReturn\n    STDMETHOD(FindTypeRefByName)(\n        LPCSTR      szNamespace,            // [IN] Namespace for the TypeRef.\n        LPCSTR      szName,                 // [IN] Name of the TypeRef.\n        mdToken     tkResolutionScope,      // [IN] Resolution Scope fo the TypeRef.\n        mdTypeRef   *ptk) PURE;             // [OUT] TypeRef token returned.\n\n    // return the TypeDef properties\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetTypeDefProps)(\n        mdTypeDef   classdef,               // given classdef\n        DWORD       *pdwAttr,               // return flags on class, tdPublic, tdAbstract\n        mdToken     *ptkExtends) PURE;      // [OUT] Put base class TypeDef/TypeRef here\n\n    // return the item's guid\n    __checkReturn\n    STDMETHOD(GetItemGuid)(\n        mdToken     tkObj,                  // [IN] given item.\n        CLSID       *pGuid) PURE;           // [out[ put guid here.\n\n    // Get enclosing class of the NestedClass.\n    __checkReturn\n    STDMETHOD(GetNestedClassProps)(         // S_OK or error\n        mdTypeDef   tkNestedClass,          // [IN] NestedClass token.\n        mdTypeDef   *ptkEnclosingClass) PURE; // [OUT] EnclosingClass token.\n\n    // Get count of Nested classes given the enclosing class.\n    __checkReturn\n    STDMETHOD(GetCountNestedClasses)(   // return count of Nested classes.\n        mdTypeDef   tkEnclosingClass,   // Enclosing class.\n        ULONG      *pcNestedClassesCount) PURE;\n\n    // Return array of Nested classes given the enclosing class.\n    __checkReturn\n    STDMETHOD(GetNestedClasses)(        // Return actual count.\n        mdTypeDef   tkEnclosingClass,       // [IN] Enclosing class.\n        mdTypeDef   *rNestedClasses,        // [OUT] Array of nested class tokens.\n        ULONG       ulNestedClasses,        // [IN] Size of array.\n        ULONG      *pcNestedClasses) PURE;\n\n    // return the ModuleRef properties\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetModuleRefProps)(\n        mdModuleRef mur,                    // [IN] moduleref token\n        LPCSTR      *pszName) PURE;         // [OUT] buffer to fill with the moduleref name\n\n    //*****************************************\n    //\n    // GetSig* functions\n    //\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetSigOfMethodDef)(\n        mdMethodDef       tkMethodDef,  // [IN] given MethodDef\n        ULONG *           pcbSigBlob,   // [OUT] count of bytes in the signature blob\n        PCCOR_SIGNATURE * ppSig) PURE;\n\n    __checkReturn\n    STDMETHOD(GetSigOfFieldDef)(\n        mdFieldDef        tkFieldDef,   // [IN] given FieldDef\n        ULONG *           pcbSigBlob,   // [OUT] count of bytes in the signature blob\n        PCCOR_SIGNATURE * ppSig) PURE;\n\n    __checkReturn\n    STDMETHOD(GetSigFromToken)(\n        mdToken           tk, // FieldDef, MethodDef, Signature or TypeSpec token\n        ULONG *           pcbSig,\n        PCCOR_SIGNATURE * ppSig) PURE;\n\n\n\n    //*****************************************\n    // get method property\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetMethodDefProps)(\n        mdMethodDef md,                 // The method for which to get props.\n        DWORD      *pdwFlags) PURE;\n\n    //*****************************************\n    // return method implementation information, like RVA and implflags\n    //*****************************************\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetMethodImplProps)(\n        mdToken     tk,                     // [IN] MethodDef\n        ULONG       *pulCodeRVA,            // [OUT] CodeRVA\n        DWORD       *pdwImplFlags) PURE;    // [OUT] Impl. Flags\n\n    //*****************************************\n    // return method implementation information, like RVA and implflags\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetFieldRVA)(\n        mdFieldDef  fd,                     // [IN] fielddef\n        ULONG       *pulCodeRVA) PURE;      // [OUT] CodeRVA\n\n    //*****************************************\n    // get field property\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetFieldDefProps)(\n        mdFieldDef fd,              // [IN] given fielddef\n        DWORD     *pdwFlags) PURE;  // [OUT] return fdPublic, fdPrive, etc flags\n\n    //*****************************************************************************\n    // return default value of a token(could be paramdef, fielddef, or property\n    //*****************************************************************************\n    __checkReturn\n    STDMETHOD(GetDefaultValue)(\n        mdToken     tk,                     // [IN] given FieldDef, ParamDef, or Property\n        MDDefaultValue *pDefaultValue) PURE;// [OUT] default value to fill\n\n\n    //*****************************************\n    // get dispid of a MethodDef or a FieldDef\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetDispIdOfMemberDef)(        // return hresult\n        mdToken     tk,                     // [IN] given methoddef or fielddef\n        ULONG       *pDispid) PURE;         // [OUT] Put the dispid here.\n\n    //*****************************************\n    // return TypeRef/TypeDef given an InterfaceImpl token\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetTypeOfInterfaceImpl)(  // return the TypeRef/typedef token for the interfaceimpl\n        mdInterfaceImpl iiImpl,         // given a interfaceimpl\n        mdToken        *ptkType) PURE;\n\n    //*****************************************\n    // look up function for TypeDef\n    //*****************************************\n    __checkReturn\n    STDMETHOD(FindTypeDef)(\n        LPCSTR      szNamespace,            // [IN] Namespace for the TypeDef.\n        LPCSTR      szName,                 // [IN] Name of the TypeDef.\n        mdToken     tkEnclosingClass,       // [IN] TypeRef/TypeDef Token for the enclosing class.\n        mdTypeDef   *ptypedef) PURE;        // [IN] return typedef\n\n    //*****************************************\n    // return name and sig of a memberref\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetNameAndSigOfMemberRef)(    // return name here\n        mdMemberRef      memberref,         // given memberref\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to a blob value of CLR signature\n        ULONG           *pcbSigBlob,        // [OUT] count of bytes in the signature blob\n        LPCSTR          *pszName) PURE;\n\n    //*****************************************************************************\n    // Given memberref, return the parent. It can be TypeRef, ModuleRef, MethodDef\n    //*****************************************************************************\n    __checkReturn\n    STDMETHOD(GetParentOfMemberRef)(\n        mdMemberRef memberref,          // given memberref\n        mdToken    *ptkParent) PURE;    // return the parent token\n\n    __checkReturn\n    STDMETHOD(GetParamDefProps)(\n        mdParamDef paramdef,            // given a paramdef\n        USHORT    *pusSequence,         // [OUT] slot number for this parameter\n        DWORD     *pdwAttr,             // [OUT] flags\n        LPCSTR    *pszName) PURE;       // [OUT] return the name of the parameter\n\n    __checkReturn\n    STDMETHOD(GetPropertyInfoForMethodDef)( // Result.\n        mdMethodDef md,                     // [IN] memberdef\n        mdProperty  *ppd,                   // [OUT] put property token here\n        LPCSTR      *pName,                 // [OUT] put pointer to name here\n        ULONG       *pSemantic) PURE;       // [OUT] put semantic here\n\n    //*****************************************\n    // class layout/sequence information\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetClassPackSize)(            // return error if class doesn't have packsize\n        mdTypeDef   td,                     // [IN] give typedef\n        ULONG       *pdwPackSize) PURE;     // [OUT] 1, 2, 4, 8, or 16\n\n    __checkReturn\n    STDMETHOD(GetClassTotalSize)(           // return error if class doesn't have total size info\n        mdTypeDef   td,                     // [IN] give typedef\n        ULONG       *pdwClassSize) PURE;    // [OUT] return the total size of the class\n\n    __checkReturn\n    STDMETHOD(GetClassLayoutInit)(\n        mdTypeDef   td,                     // [IN] give typedef\n        MD_CLASS_LAYOUT *pLayout) PURE;     // [OUT] set up the status of query here\n\n    __checkReturn\n    STDMETHOD(GetClassLayoutNext)(\n        MD_CLASS_LAYOUT *pLayout,           // [IN|OUT] set up the status of query here\n        mdFieldDef  *pfd,                   // [OUT] return the fielddef\n        ULONG       *pulOffset) PURE;       // [OUT] return the offset/ulSequence associate with it\n\n    //*****************************************\n    // marshal information of a field\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetFieldMarshal)(             // return error if no native type associate with the token\n        mdFieldDef  fd,                     // [IN] given fielddef\n        PCCOR_SIGNATURE *pSigNativeType,    // [OUT] the native type signature\n        ULONG       *pcbNativeType) PURE;   // [OUT] the count of bytes of *ppvNativeType\n\n\n    //*****************************************\n    // property APIs\n    //*****************************************\n    // find a property by name\n    __checkReturn\n    STDMETHOD(FindProperty)(\n        mdTypeDef   td,                     // [IN] given a typdef\n        LPCSTR      szPropName,             // [IN] property name\n        mdProperty  *pProp) PURE;           // [OUT] return property token\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetPropertyProps)(\n        mdProperty  prop,                   // [IN] property token\n        LPCSTR      *szProperty,            // [OUT] property name\n        DWORD       *pdwPropFlags,          // [OUT] property flags.\n        PCCOR_SIGNATURE *ppvSig,            // [OUT] property type. pointing to meta data internal blob\n        ULONG       *pcbSig) PURE;          // [OUT] count of bytes in *ppvSig\n\n    //**********************************\n    // Event APIs\n    //**********************************\n    __checkReturn\n    STDMETHOD(FindEvent)(\n        mdTypeDef   td,                     // [IN] given a typdef\n        LPCSTR      szEventName,            // [IN] event name\n        mdEvent     *pEvent) PURE;          // [OUT] return event token\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetEventProps)(\n        mdEvent     ev,                     // [IN] event token\n        LPCSTR      *pszEvent,              // [OUT] Event name\n        DWORD       *pdwEventFlags,         // [OUT] Event flags.\n        mdToken     *ptkEventType) PURE;    // [OUT] EventType class\n\n\n    //**********************************\n    // find a particular associate of a property or an event\n    //**********************************\n    __checkReturn\n    STDMETHOD(FindAssociate)(\n        mdToken     evprop,                 // [IN] given a property or event token\n        DWORD       associate,              // [IN] given a associate semantics(setter, getter, testdefault, reset, AddOn, RemoveOn, Fire)\n        mdMethodDef *pmd) PURE;             // [OUT] return method def token\n\n    // Note, void function in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(EnumAssociateInit)(\n        mdToken     evprop,                 // [IN] given a property or an event token\n        HENUMInternal *phEnum) PURE;        // [OUT] cursor to hold the query result\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetAllAssociates)(\n        HENUMInternal *phEnum,              // [IN] query result form GetPropertyAssociateCounts\n        ASSOCIATE_RECORD *pAssociateRec,    // [OUT] struct to fill for output\n        ULONG       cAssociateRec) PURE;    // [IN] size of the buffer\n\n\n    //**********************************\n    // Get info about a PermissionSet.\n    //**********************************\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetPermissionSetProps)(\n        mdPermission pm,                    // [IN] the permission token.\n        DWORD       *pdwAction,             // [OUT] CorDeclSecurity.\n        void const  **ppvPermission,        // [OUT] permission blob.\n        ULONG       *pcbPermission) PURE;   // [OUT] count of bytes of pvPermission.\n\n    //****************************************\n    // Get the String given the String token.\n    // Returns a pointer to the string, or NULL in case of error.\n    //****************************************\n    __checkReturn\n    STDMETHOD(GetUserString)(\n        mdString stk,                   // [IN] the string token.\n        ULONG   *pchString,             // [OUT] count of characters in the string.\n        BOOL    *pbIs80Plus,            // [OUT] specifies where there are extended characters >= 0x80.\n        LPCWSTR *pwszUserString) PURE;\n\n    //*****************************************************************************\n    // p-invoke APIs.\n    //*****************************************************************************\n    __checkReturn\n    STDMETHOD(GetPinvokeMap)(\n        mdToken     tk,                     // [IN] FieldDef, MethodDef.\n        DWORD       *pdwMappingFlags,       // [OUT] Flags used for mapping.\n        LPCSTR      *pszImportName,         // [OUT] Import name.\n        mdModuleRef *pmrImportDLL) PURE;    // [OUT] ModuleRef token for the target DLL.\n\n    //*****************************************************************************\n    // helpers to convert a text signature to a com format\n    //*****************************************************************************\n    __checkReturn\n    STDMETHOD(ConvertTextSigToComSig)(      // Return hresult.\n        BOOL        fCreateTrIfNotFound,    // [IN] create typeref if not found\n        LPCSTR      pSignature,             // [IN] class file format signature\n        CQuickBytes *pqbNewSig,             // [OUT] place holder for CLR signature\n        ULONG       *pcbCount) PURE;        // [OUT] the result size of signature\n\n    //*****************************************************************************\n    // Assembly MetaData APIs.\n    //*****************************************************************************\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetAssemblyProps)(\n        mdAssembly  mda,                    // [IN] The Assembly for which to get the properties.\n        const void  **ppbPublicKey,         // [OUT] Pointer to the public key.\n        ULONG       *pcbPublicKey,          // [OUT] Count of bytes in the public key.\n        ULONG       *pulHashAlgId,          // [OUT] Hash Algorithm.\n        LPCSTR      *pszName,               // [OUT] Buffer to fill with name.\n        AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData.\n        DWORD       *pdwAssemblyFlags) PURE;// [OUT] Flags.\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetAssemblyRefProps)(\n        mdAssemblyRef mdar,                 // [IN] The AssemblyRef for which to get the properties.\n        const void  **ppbPublicKeyOrToken,  // [OUT] Pointer to the public key or token.\n        ULONG       *pcbPublicKeyOrToken,   // [OUT] Count of bytes in the public key or token.\n        LPCSTR      *pszName,               // [OUT] Buffer to fill with name.\n        AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData.\n        const void  **ppbHashValue,         // [OUT] Hash blob.\n        ULONG       *pcbHashValue,          // [OUT] Count of bytes in the hash blob.\n        DWORD       *pdwAssemblyRefFlags) PURE; // [OUT] Flags.\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetFileProps)(\n        mdFile      mdf,                    // [IN] The File for which to get the properties.\n        LPCSTR      *pszName,               // [OUT] Buffer to fill with name.\n        const void  **ppbHashValue,         // [OUT] Pointer to the Hash Value Blob.\n        ULONG       *pcbHashValue,          // [OUT] Count of bytes in the Hash Value Blob.\n        DWORD       *pdwFileFlags) PURE;    // [OUT] Flags.\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetExportedTypeProps)(\n        mdExportedType   mdct,              // [IN] The ExportedType for which to get the properties.\n        LPCSTR      *pszNamespace,          // [OUT] Namespace.\n        LPCSTR      *pszName,               // [OUT] Name.\n        mdToken     *ptkImplementation,     // [OUT] mdFile or mdAssemblyRef that provides the ExportedType.\n        mdTypeDef   *ptkTypeDef,            // [OUT] TypeDef token within the file.\n        DWORD       *pdwExportedTypeFlags) PURE; // [OUT] Flags.\n\n    // returned void in v1.0/v1.1\n    __checkReturn\n    STDMETHOD(GetManifestResourceProps)(\n        mdManifestResource  mdmr,           // [IN] The ManifestResource for which to get the properties.\n        LPCSTR      *pszName,               // [OUT] Buffer to fill with name.\n        mdToken     *ptkImplementation,     // [OUT] mdFile or mdAssemblyRef that provides the ExportedType.\n        DWORD       *pdwOffset,             // [OUT] Offset to the beginning of the resource within the file.\n        DWORD       *pdwResourceFlags) PURE;// [OUT] Flags.\n\n    __checkReturn\n    STDMETHOD(FindExportedTypeByName)(      // S_OK or error\n        LPCSTR      szNamespace,            // [IN] Namespace of the ExportedType.\n        LPCSTR      szName,                 // [IN] Name of the ExportedType.\n        mdExportedType   tkEnclosingType,   // [IN] ExportedType for the enclosing class.\n        mdExportedType   *pmct) PURE;       // [OUT] Put ExportedType token here.\n\n    __checkReturn\n    STDMETHOD(FindManifestResourceByName)(  // S_OK or error\n        LPCSTR      szName,                 // [IN] Name of the ManifestResource.\n        mdManifestResource *pmmr) PURE;     // [OUT] Put ManifestResource token here.\n\n    __checkReturn\n    STDMETHOD(GetAssemblyFromScope)(        // S_OK or error\n        mdAssembly  *ptkAssembly) PURE;     // [OUT] Put token here.\n\n    __checkReturn\n    STDMETHOD(GetCustomAttributeByName)(    // S_OK or error\n        mdToken     tkObj,                  // [IN] Object with Custom Attribute.\n        LPCUTF8     szName,                 // [IN] Name of desired Custom Attribute.\n        const void  **ppData,               // [OUT] Put pointer to data here.\n        ULONG       *pcbData) PURE;         // [OUT] Put size of data here.\n\n    // Note: The return type of this method was void in v1\n    __checkReturn\n    STDMETHOD(GetTypeSpecFromToken)(      // S_OK or error.\n        mdTypeSpec typespec,                // [IN] Signature token.\n        PCCOR_SIGNATURE *ppvSig,            // [OUT] return pointer to token.\n        ULONG       *pcbSig) PURE;               // [OUT] return size of signature.\n\n    __checkReturn\n    STDMETHOD(SetUserContextData)(          // S_OK or E_NOTIMPL\n        IUnknown    *pIUnk) PURE;           // The user context.\n\n    __checkReturn\n    STDMETHOD_(BOOL, IsValidToken)(         // True or False.\n        mdToken     tk) PURE;               // [IN] Given token.\n\n    __checkReturn\n    STDMETHOD(TranslateSigWithScope)(\n        IMDInternalImport *pAssemImport,    // [IN] import assembly scope.\n        const void  *pbHashValue,           // [IN] hash value for the import assembly.\n        ULONG       cbHashValue,            // [IN] count of bytes in the hash value.\n        PCCOR_SIGNATURE pbSigBlob,          // [IN] signature in the importing scope\n        ULONG       cbSigBlob,              // [IN] count of bytes of signature\n        IMetaDataAssemblyEmit *pAssemEmit,  // [IN] assembly emit scope.\n        IMetaDataEmit *emit,                // [IN] emit interface\n        CQuickBytes *pqkSigEmit,            // [OUT] buffer to hold translated signature\n        ULONG       *pcbSig) PURE;          // [OUT] count of bytes in the translated signature\n\n    STDMETHOD_(IMetaModelCommon*, GetMetaModelCommon)(  // Return MetaModelCommon interface.\n        ) PURE;\n\n    STDMETHOD_(IUnknown *, GetCachedPublicInterface)(BOOL fWithLock) PURE;   // return the cached public interface\n    __checkReturn\n    STDMETHOD(SetCachedPublicInterface)(IUnknown *pUnk) PURE;  // no return value\n    STDMETHOD_(UTSemReadWrite*, GetReaderWriterLock)() PURE;   // return the reader writer lock\n    __checkReturn\n    STDMETHOD(SetReaderWriterLock)(UTSemReadWrite * pSem) PURE;\n\n    STDMETHOD_(mdModule, GetModuleFromScope)() PURE;             // [OUT] Put mdModule token here.\n\n\n    //-----------------------------------------------------------------\n    // Additional custom methods\n\n    // finding a particular method\n    __checkReturn\n    STDMETHOD(FindMethodDefUsingCompare)(\n        mdTypeDef   classdef,               // [IN] given typedef\n        LPCSTR      szName,                 // [IN] member name\n        PCCOR_SIGNATURE pvSigBlob,          // [IN] point to a blob value of CLR signature\n        ULONG       cbSigBlob,              // [IN] count of bytes in the signature blob\n        PSIGCOMPARE pSignatureCompare,      // [IN] Routine to compare signatures\n        void*       pSignatureArgs,         // [IN] Additional info to supply the compare function\n        mdMethodDef *pmd) PURE;             // [OUT] matching memberdef\n\n    // Additional v2 methods.\n\n    //*****************************************\n    // return a field offset for a given field\n    //*****************************************\n    __checkReturn\n    STDMETHOD(GetFieldOffset)(\n        mdFieldDef  fd,                     // [IN] fielddef\n        ULONG       *pulOffset) PURE;       // [OUT] FieldOffset\n\n    __checkReturn\n    STDMETHOD(GetMethodSpecProps)(\n        mdMethodSpec ms,                    // [IN] The method instantiation\n        mdToken *tkParent,                  // [OUT] MethodDef or MemberRef\n        PCCOR_SIGNATURE *ppvSigBlob,        // [OUT] point to the blob value of meta data\n        ULONG       *pcbSigBlob) PURE;      // [OUT] actual size of signature blob\n\n    __checkReturn\n    STDMETHOD(GetTableInfoWithIndex)(\n        ULONG      index,                   // [IN] pass in the table index\n        void       **pTable,                // [OUT] pointer to table at index\n        void       **pTableSize) PURE;      // [OUT] size of table at index\n\n    __checkReturn\n    STDMETHOD(ApplyEditAndContinue)(\n        void        *pDeltaMD,              // [IN] the delta metadata\n        ULONG       cbDeltaMD,              // [IN] length of pData\n        IMDInternalImport **ppv) PURE;      // [OUT] the resulting metadata interface\n\n    //**********************************\n    // Generics APIs\n    //**********************************\n    __checkReturn\n    STDMETHOD(GetGenericParamProps)(        // S_OK or error.\n        mdGenericParam rd,                  // [IN] The type parameter\n        ULONG* pulSequence,                 // [OUT] Parameter sequence number\n        DWORD* pdwAttr,                     // [OUT] Type parameter flags (for future use)\n        mdToken *ptOwner,                   // [OUT] The owner (TypeDef or MethodDef)\n        DWORD *reserved,                    // [OUT] The kind (TypeDef/Ref/Spec, for future use)\n        LPCSTR *szName) PURE;               // [OUT] The name\n\n    __checkReturn\n    STDMETHOD(GetGenericParamConstraintProps)(      // S_OK or error.\n        mdGenericParamConstraint rd,            // [IN] The constraint token\n        mdGenericParam *ptGenericParam,         // [OUT] GenericParam that is constrained\n        mdToken      *ptkConstraintType) PURE;  // [OUT] TypeDef/Ref/Spec constraint\n\n    //*****************************************************************************\n    // This function gets the \"built for\" version of a metadata scope.\n    //  NOTE: if the scope has never been saved, it will not have a built-for\n    //  version, and an empty string will be returned.\n    //*****************************************************************************\n    __checkReturn\n    STDMETHOD(GetVersionString)(    // S_OK or error.\n        LPCSTR      *pVer) PURE;       // [OUT] Put version string here.\n\n\n    __checkReturn\n    STDMETHOD(GetTypeDefRefTokenInTypeSpec)(// return S_FALSE if enclosing type does not have a token\n        mdTypeSpec  tkTypeSpec,               // [IN] TypeSpec token to look at\n        mdToken    *tkEnclosedToken) PURE;    // [OUT] The enclosed type token\n\n#define MD_STREAM_VER_1X    0x10000\n#define MD_STREAM_VER_2_B1  0x10001\n#define MD_STREAM_VER_2     0x20000\n    STDMETHOD_(DWORD, GetMetadataStreamVersion)() PURE;  //returns DWORD with major version of\n                                // MD stream in senior word and minor version--in junior word\n\n    __checkReturn\n    STDMETHOD(GetNameOfCustomAttribute)(// S_OK or error\n        mdCustomAttribute mdAttribute,      // [IN] The Custom Attribute\n        LPCUTF8          *pszNamespace,     // [OUT] Namespace of Custom Attribute.\n        LPCUTF8          *pszName) PURE;    // [OUT] Name of Custom Attribute.\n\n    STDMETHOD(SetOptimizeAccessForSpeed)(// S_OK or error\n        BOOL    fOptSpeed) PURE;\n\n    STDMETHOD(SetVerifiedByTrustedSource)(// S_OK or error\n        BOOL    fVerified) PURE;\n\n    STDMETHOD(GetRvaOffsetData)(\n        DWORD   *pFirstMethodRvaOffset,     // [OUT] Offset (from start of metadata) to the first RVA field in MethodDef table.\n        DWORD   *pMethodDefRecordSize,      // [OUT] Size of each record in MethodDef table.\n        DWORD   *pMethodDefCount,           // [OUT] Number of records in MethodDef table.\n        DWORD   *pFirstFieldRvaOffset,      // [OUT] Offset (from start of metadata) to the first RVA field in FieldRVA table.\n        DWORD   *pFieldRvaRecordSize,       // [OUT] Size of each record in FieldRVA table.\n        DWORD   *pFieldRvaCount             // [OUT] Number of records in FieldRVA table.\n        ) PURE;\n\n    //----------------------------------------------------------------------------------------\n    // !!! READ THIS !!!\n    //\n    // New methods have to be added at the end. The order and signatures of the existing methods\n    // have to be preserved. We need to maintain a backward compatibility for this interface to\n    // allow ildasm to work on SingleCLR.\n    //\n    //----------------------------------------------------------------------------------------\n\n};  // IMDInternalImport\n\n\n// {E03D7730-D7E3-11d2-8C0D-00C04FF7431A}\nEXTERN_GUID(IID_IMDInternalImportENC, 0xe03d7730, 0xd7e3, 0x11d2, 0x8c, 0xd, 0x0, 0xc0, 0x4f, 0xf7, 0x43, 0x1a);\n\n#undef  INTERFACE\n#define INTERFACE IMDInternalImportENC\nDECLARE_INTERFACE_(IMDInternalImportENC, IMDInternalImport)\n{\nprivate:\n    using IMDInternalImport::ApplyEditAndContinue;\npublic:\n    // ENC only methods here.\n    STDMETHOD(ApplyEditAndContinue)(        // S_OK or error.\n        MDInternalRW *pDelta) PURE;         // Interface to MD with the ENC delta.\n\n    STDMETHOD(EnumDeltaTokensInit)(         // return hresult\n        HENUMInternal *phEnum) PURE;        // [OUT] buffer to fill for enumerator data\n\n}; // IMDInternalImportENC\n\n// {F102C526-38CB-49ed-9B5F-498816AE36E0}\nEXTERN_GUID(IID_IMDInternalEmit, 0xf102c526, 0x38cb, 0x49ed, 0x9b, 0x5f, 0x49, 0x88, 0x16, 0xae, 0x36, 0xe0);\n\n#undef  INTERFACE\n#define INTERFACE IMDInternalEmit\nDECLARE_INTERFACE_(IMDInternalEmit, IUnknown)\n{\n    STDMETHOD(ChangeMvid)(                  // S_OK or error.\n        REFGUID newMvid) PURE;              // GUID to use as the MVID\n\n    STDMETHOD(SetMDUpdateMode)(\n        ULONG updateMode, ULONG *pPreviousUpdateMode) PURE;\n\n}; // IMDInternalEmit\n\n#ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE\n\nstruct IMDCustomDataSource;\nclass CMiniMdSchema;\nstruct CMiniTableDef;\nnamespace MetaData\n{\n    class DataBlob;\n}\n\n// {CC0C8F7A-A00B-493D-80B6-CE0C92491670}\nEXTERN_GUID(IID_IMDCustomDataSource, 0xcc0c8f7a, 0xa00b, 0x493d, 0x80, 0xb6, 0xce, 0xc, 0x92, 0x49, 0x16, 0x70);\n\n#undef  INTERFACE\n#define INTERFACE IMDCustomDataSource\nDECLARE_INTERFACE_(IMDCustomDataSource, IUnknown)\n{\n    STDMETHOD(GetSchema)(CMiniMdSchema* pSchema) PURE;\n    STDMETHOD(GetTableDef)(ULONG32 tableIndex, CMiniTableDef* pTableDef) PURE;\n    STDMETHOD(GetBlobHeap)(MetaData::DataBlob* pBlobHeapData) PURE;\n    STDMETHOD(GetGuidHeap)(MetaData::DataBlob* pGuidHeapData) PURE;\n    STDMETHOD(GetStringHeap)(MetaData::DataBlob* pStringHeapData) PURE;\n    STDMETHOD(GetUserStringHeap)(MetaData::DataBlob* pUserStringHeapData) PURE;\n    STDMETHOD(GetTableRecords)(ULONG32 tableIndex, MetaData::DataBlob* pTableRecordData) PURE;\n    STDMETHOD(GetTableSortable)(ULONG32 tableIndex, BOOL* pSortable) PURE;\n    STDMETHOD(GetStorageSignature)(MetaData::DataBlob* pStorageSignature) PURE;\n\n}; // IMDCustomDataSource\n\n// {503F79FB-7AAE-4364-BDA6-8E235D173AEC}\nEXTERN_GUID(IID_IMetaDataDispenserCustom,\n    0x503f79fb, 0x7aae, 0x4364, 0xbd, 0xa6, 0x8e, 0x23, 0x5d, 0x17, 0x3a, 0xec);\n\n#undef  INTERFACE\n#define INTERFACE IMetaDataDispenserCustom\nDECLARE_INTERFACE_(IMetaDataDispenserCustom, IUnknown)\n{\n    STDMETHOD(OpenScopeOnCustomDataSource)(    // Return code.\n        IMDCustomDataSource  *pCustomSource,  // [in] The scope to open.\n        DWORD                dwOpenFlags,    // [in] Open mode flags.\n        REFIID               riid,           // [in] The interface desired.\n        IUnknown             **ppIUnk) PURE; // [out] Return interface on success.\n\n}; // IMetaDataDispenserCustom\n\n#endif // FEATURE_METADATA_CUSTOM_DATA_SOURCE\n\n#ifdef FEATURE_METADATA_DEBUGGEE_DATA_SOURCE\nstruct ICorDebugDataTarget;\nHRESULT CreateRemoteMDInternalRWSource(TADDR mdInternalRWRemoteAddress, ICorDebugDataTarget* pDataTarget, DWORD defines, DWORD dataStructureVersion, IMDCustomDataSource** ppDataSource);\n#endif\n\nenum MetaDataReorderingOptions {\n    NoReordering=0x0,\n    ReArrangeStringPool=0x1\n};\n\n#ifdef __HOLDER_H_\n\nvoid DECLSPEC_NORETURN ThrowHR(HRESULT hr);\n\n// This wrapper class ensures that the HENUMInternal is EnumClose'd no matter how the scope is exited.\nclass HENUMTypeDefInternalHolder\n{\npublic:\n    FORCEINLINE HENUMTypeDefInternalHolder(IMDInternalImport *pInternalImport)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        m_pInternalImport = pInternalImport;\n        m_fAcquired       = FALSE;\n    }\n\n    FORCEINLINE VOID EnumTypeDefInit()\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        _ASSERTE(!m_fAcquired);\n        HRESULT hr = m_pInternalImport->EnumTypeDefInit(&m_hEnum);\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n        m_fAcquired = TRUE;\n\n    }\n\n    FORCEINLINE HRESULT EnumTypeDefInitNoThrow()\n    {\n        WRAPPER_NO_CONTRACT;\n\n        _ASSERTE(!m_fAcquired);\n        HRESULT hr = m_pInternalImport->EnumTypeDefInit(&m_hEnum);\n        if (FAILED(hr))\n        {\n            return hr;\n        }\n        m_fAcquired = TRUE;\n\n        return hr;\n    }\n\n    FORCEINLINE ~HENUMTypeDefInternalHolder()\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (m_fAcquired)\n        {\n            m_pInternalImport->EnumClose(&m_hEnum);\n        }\n    }\n\n    FORCEINLINE HENUMInternal* operator& ()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        _ASSERTE(m_fAcquired);\n        return &m_hEnum;\n    }\n\nprivate:\n    FORCEINLINE HENUMTypeDefInternalHolder(const HENUMTypeDefInternalHolder &)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        _ASSERTE(!\"Don't try to assign this class.\");\n    }\n\nprivate:\n    IMDInternalImport *m_pInternalImport;\n    HENUMInternal      m_hEnum;\n    BOOL               m_fAcquired;\n};\n\n\n// This wrapper class ensures that the HENUMInternal is EnumClose'd no matter how the scope is exited.\nclass HENUMInternalHolder\n{\npublic:\n    FORCEINLINE HENUMInternalHolder(IMDInternalImport *pInternalImport)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        m_pInternalImport = pInternalImport;\n        m_fAcquired       = FALSE;\n    }\n\n    FORCEINLINE VOID EnumGlobalFunctionsInit()\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        _ASSERTE(!m_fAcquired);\n        HRESULT hr = m_pInternalImport->EnumGlobalFunctionsInit(&m_hEnum);\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n        m_fAcquired = TRUE;\n\n    }\n\n\n    FORCEINLINE VOID EnumGlobalFieldsInit()\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        _ASSERTE(!m_fAcquired);\n        HRESULT hr = m_pInternalImport->EnumGlobalFieldsInit(&m_hEnum);\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n        m_fAcquired = TRUE;\n\n    }\n\n    FORCEINLINE VOID EnumTypeDefInit()\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        _ASSERTE(!m_fAcquired);\n        HRESULT hr = m_pInternalImport->EnumTypeDefInit(&m_hEnum);\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n        m_fAcquired = TRUE;\n    }\n\n    FORCEINLINE VOID EnumAssociateInit(mdToken tkParent)        // [IN] token to scope the search\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        _ASSERTE(!m_fAcquired);\n        IfFailThrow(m_pInternalImport->EnumAssociateInit(tkParent, &m_hEnum));\n        m_fAcquired = TRUE;\n    }\n\n    FORCEINLINE VOID EnumInit(DWORD       tkKind,                 // [IN] which table to work on\n                              mdToken     tkParent                // [IN] token to scope the search\n                             )\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        HRESULT hr = EnumInitNoThrow(tkKind, tkParent);\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n    }\n\n    __checkReturn\n    FORCEINLINE HRESULT EnumInitNoThrow(DWORD       tkKind,       // [IN] which table to work on\n                                        mdToken     tkParent      // [IN] token to scope the search\n                                       )\n    {\n        CONTRACTL {\n            NOTHROW;\n        } CONTRACTL_END;\n\n        _ASSERTE(!m_fAcquired);\n        HRESULT hr = m_pInternalImport->EnumInit(tkKind, tkParent, &m_hEnum);\n        if (SUCCEEDED(hr))\n        {\n            m_fAcquired = TRUE;\n        }\n        return hr;\n    }\n\n    FORCEINLINE VOID EnumAllInit(DWORD       tkKind                 // [IN] which table to work on\n                             )\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        _ASSERTE(!m_fAcquired);\n        HRESULT hr = m_pInternalImport->EnumAllInit(tkKind, &m_hEnum);\n        if (FAILED(hr))\n        {\n            ThrowHR(hr);\n        }\n        m_fAcquired = TRUE;\n\n    }\n\n    FORCEINLINE ULONG EnumGetCount()\n    {\n        CONTRACTL {\n            NOTHROW;\n            GC_NOTRIGGER;\n            CONSISTENCY_CHECK(m_fAcquired);\n        } CONTRACTL_END;\n\n        return m_pInternalImport->EnumGetCount(&m_hEnum);\n    }\n\n    FORCEINLINE bool EnumNext(mdToken * pTok)\n    {\n        CONTRACTL {\n            NOTHROW;\n            GC_NOTRIGGER;\n            CONSISTENCY_CHECK(m_fAcquired);\n        } CONTRACTL_END;\n\n        return m_pInternalImport->EnumNext(&m_hEnum, pTok);\n    }\n\n    FORCEINLINE void EnumReset()\n    {\n        CONTRACTL {\n            NOTHROW;\n            GC_NOTRIGGER;\n            CONSISTENCY_CHECK(m_fAcquired);\n        } CONTRACTL_END;\n\n        return m_pInternalImport->EnumReset(&m_hEnum);\n    }\n\n    FORCEINLINE ~HENUMInternalHolder()\n    {\n        WRAPPER_NO_CONTRACT;\n\n        if (m_fAcquired)\n        {\n            // Ignore the error\n            (void)m_pInternalImport->EnumClose(&m_hEnum);\n        }\n    }\n\n    FORCEINLINE HENUMInternal* operator& ()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        _ASSERTE(m_fAcquired);\n        return &m_hEnum;\n    }\n\nprivate:\n    FORCEINLINE HENUMInternalHolder(const HENUMInternalHolder &)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        _ASSERTE(!\"Don't try to assign this class.\");\n    }\n\n\nprotected:\n    IMDInternalImport *m_pInternalImport;\n    HENUMInternal      m_hEnum;\n    BOOL               m_fAcquired;\n};\n\nclass HENUMInternalMethodImplHolder : protected HENUMInternalHolder\n{\n    public:\n        FORCEINLINE HENUMInternalMethodImplHolder(IMDInternalImport *pInternalImport)\n            : HENUMInternalHolder(pInternalImport)\n        {\n            WRAPPER_NO_CONTRACT;\n        }\n\n        FORCEINLINE ~HENUMInternalMethodImplHolder()\n        {\n            WRAPPER_NO_CONTRACT;\n\n            if (m_fAcquired)\n            {\n                // Ignore the error\n                (void)m_pInternalImport->EnumClose(&m_hEnum2);\n            }\n        }\n\n        FORCEINLINE void EnumMethodImplInit(mdToken     tkParent                   // [IN] token to scope the search\n                                 )\n        {\n            CONTRACTL {\n                THROWS;\n            } CONTRACTL_END;\n\n            HRESULT hr = EnumMethodImplInitNoThrow(tkParent);\n            if (FAILED(hr))\n            {\n                ThrowHR(hr);\n            }\n        }\n\n        __checkReturn\n        FORCEINLINE HRESULT EnumMethodImplInitNoThrow(mdToken     tkParent         // [IN] token to scope the search\n                                 )\n        {\n            CONTRACTL {\n                NOTHROW;\n            } CONTRACTL_END;\n\n            _ASSERTE(!m_fAcquired);\n            HRESULT hr = m_pInternalImport->EnumMethodImplInit(tkParent, &m_hEnum, &m_hEnum2);\n            if (SUCCEEDED(hr))\n            {\n                m_fAcquired = TRUE;\n            }\n            return hr;\n        }\n\n        __checkReturn\n        FORCEINLINE HRESULT EnumMethodImplNext(\n            mdToken *ptkImpl,\n            mdToken *ptkDecl)\n        {\n            CONTRACTL {\n                NOTHROW;\n                GC_NOTRIGGER;\n                CONSISTENCY_CHECK(m_fAcquired);\n            } CONTRACTL_END;\n\n            return m_pInternalImport->EnumMethodImplNext(&m_hEnum, &m_hEnum2, ptkImpl, ptkDecl);\n        }\n\n        FORCEINLINE ULONG EnumMethodImplGetCount()\n        {\n            CONTRACTL {\n                NOTHROW;\n                GC_NOTRIGGER;\n                CONSISTENCY_CHECK(m_fAcquired);\n            } CONTRACTL_END;\n\n            return m_pInternalImport->EnumMethodImplGetCount(&m_hEnum, &m_hEnum2);\n        }\n\n    protected:\n        HENUMInternal      m_hEnum2;\n};\n\n#endif //__HOLDER_H_\n\n#endif // _METADATA_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/metadataexports.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// MDCommon.h\n//\n\n//\n// Header for functions exported by metadata. These are consumed 2 ways:\n// 1. Mscoree provides public exports that plumb to some of these functions to invoke these dynamically.\n// 2. Standalone metadata (statically linked)\n//\n//*****************************************************************************\n\n\n#ifndef _METADATA_EXPORTS_\n#define _METADATA_EXPORTS_\n\n\n\n// General creation function for ClassFactory semantics.\nSTDAPI  MetaDataDllGetClassObject(REFCLSID rclsid, REFIID riid, void ** ppv);\n\n// Specific creation function to get IMetaDataDispenser(Ex) interface.\nHRESULT InternalCreateMetaDataDispenser(REFIID riid, void ** pMetaDataDispenserOut);\n\nSTDAPI  GetMDInternalInterface(\n    LPVOID      pData,\n    ULONG       cbData,\n    DWORD       flags,                  // [IN] MDInternal_OpenForRead or MDInternal_OpenForENC\n    REFIID      riid,                   // [in] The interface desired.\n    void        **ppIUnk);              // [out] Return interface on success.\n\nSTDAPI GetMDInternalInterfaceFromPublic(\n    IUnknown    *pIUnkPublic,           // [IN] Given scope.\n    REFIID      riid,                   // [in] The interface desired.\n    void        **ppIUnkInternal);      // [out] Return interface on success.\n\nSTDAPI GetMDPublicInterfaceFromInternal(\n    void        *pIUnkPublic,           // [IN] Given scope.\n    REFIID      riid,                   // [in] The interface desired.\n    void        **ppIUnkInternal);      // [out] Return interface on success.\n\nSTDAPI MDReOpenMetaDataWithMemory(\n    void        *pImport,               // [IN] Given scope. public interfaces\n    LPCVOID     pData,                  // [in] Location of scope data.\n    ULONG       cbData);                // [in] Size of the data pointed to by pData.\n\nSTDAPI MDReOpenMetaDataWithMemoryEx(\n    void        *pImport,               // [IN] Given scope. public interfaces\n    LPCVOID     pData,                  // [in] Location of scope data.\n    ULONG       cbData,                 // [in] Size of the data pointed to by pData.\n    DWORD       dwReOpenFlags);         // [in] ReOpen flags\n\n\n\n#endif // _METADATA_EXPORTS_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/metahost.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/**************************************************************************************\n ** Motivation for redesigning the shim APIs:                                        **\n ** - old APIs assume that there is only one runtime in the process                  **\n ** - old APIs are redundant (multiple ways for achieving the same effect)           **\n ** - old APIs are flat and difficult to version (*Ex variants etc.)                 **\n ** - old APIs mix together totally different concepts - choosing a runtime vs.      **\n **   activating the runtime vs. performing an operation on the activated runtime    **\n ** - old APIs are poorly named (incosistent use of the Cor* prefix etc.)            **\n ** - all in all there's a lot of legacy behavior in the old APIs that it makes      **\n **   sense to start from scratch                                                    **\n **                                                                                  **\n ** Design goals:                                                                    **\n ** - clear separation between the no-policy base part and the policy-decision-      **\n **   making part                                                                    **\n ** - easy to extend with additional functionality by introducing new versions of    **\n **   the interfaces (interface types are not hardcoded in method signatures)        **\n ** - functions performing clearly defined steps rather than poorly documented       **\n **   heavy-weight black boxes                                                       **\n **************************************************************************************/\n\n/**************************************************************************************\n ** Interfaces described in this IDL file follow the \"Nano-COM\" model. Basically     **\n ** lifetime management (AddRef/Release) and encapsulation (implicit context) are    **\n ** used from COM. There are no COM types (BSTR, SAFEARRAY, VARIANT), apartment      **\n ** models, aggregation, or registry activation (CoCreateInstance).                  **\n **************************************************************************************/\n\n\nimport \"unknwn.idl\";\nimport \"oaidl.idl\";\nimport \"ocidl.idl\";\n\nimport \"mscoree.idl\";\n\ncpp_quote(\"#include <winapifamily.h>\")\n\ncpp_quote(\"STDAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, /*iid_is(riid)*/ LPVOID *ppInterface);\")\n\n// IID ICLRMetaHost : uuid(D332DB9E-B9B3-4125-8207-A14884F53216)\ncpp_quote(\"EXTERN_GUID(IID_ICLRMetaHost, 0xD332DB9E, 0xB9B3, 0x4125, 0x82, 0x07, 0xA1, 0x48, 0x84, 0xF5, 0x32, 0x16);\")\n\n// CLSID_CLRMetaHost : uuid(9280188D-0E8E-4867-B30C-7FA83884E8DE)\ncpp_quote(\"EXTERN_GUID(CLSID_CLRMetaHost, 0x9280188d, 0xe8e, 0x4867, 0xb3, 0xc, 0x7f, 0xa8, 0x38, 0x84, 0xe8, 0xde);\")\n\n// IID ICLRDebugging : uuid(D28F3C5A-9634-4206-A509-477552EEFB10)\ncpp_quote(\"EXTERN_GUID(IID_ICLRDebugging, 0xd28f3c5a, 0x9634, 0x4206, 0xa5, 0x9, 0x47, 0x75, 0x52, 0xee, 0xfb, 0x10);\")\n\n// CLSID_CLRDebugging : uuid(BACC578D-FBDD-48a4-969F-02D932B74634)\ncpp_quote(\"EXTERN_GUID(CLSID_CLRDebugging, 0xbacc578d, 0xfbdd, 0x48a4, 0x96, 0x9f, 0x2, 0xd9, 0x32, 0xb7, 0x46, 0x34);\")\n\n// IID ICLRRuntimeInfo : uuid(BD39D1D2-BA2F-486a-89B0-B4B0CB466891)\ncpp_quote(\"EXTERN_GUID(IID_ICLRRuntimeInfo, 0xBD39D1D2, 0xBA2F, 0x486a, 0x89, 0xB0, 0xB4, 0xB0, 0xCB, 0x46, 0x68, 0x91);\")\n\n// IID ICLRDebuggingLibraryProvider interface : uuid{3151C08D-4D09-4f9b-8838-2880BF18FE51}\ncpp_quote(\"EXTERN_GUID(IID_ICLRDebuggingLibraryProvider, 0x3151c08d, 0x4d09, 0x4f9b, 0x88, 0x38, 0x28, 0x80, 0xbf, 0x18, 0xfe, 0x51);\")\n\n// IID ICLRDebuggingLibraryProvider2 interface : uuid{E04E2FF1-DCFD-45D5-BCD1-16FFF2FAF7BA}\ncpp_quote(\"EXTERN_GUID(IID_ICLRDebuggingLibraryProvider2, 0xE04E2FF1, 0xDCFD, 0x45D5, 0xBC, 0xD1, 0x16, 0xFF, 0xF2, 0xFA, 0xF7, 0xBA);\")\n\n// For use in ICLRMetaHost::RequestRuntimeLoadedNotification\ninterface ICLRRuntimeInfo;\n\ntypedef HRESULT (__stdcall *CallbackThreadSetFnPtr)();\ntypedef HRESULT (__stdcall *CallbackThreadUnsetFnPtr)();\n\ntypedef void (__stdcall *RuntimeLoadedCallbackFnPtr)(\n    ICLRRuntimeInfo          *pRuntimeInfo,\n    CallbackThreadSetFnPtr    pfnCallbackThreadSet,\n    CallbackThreadUnsetFnPtr  pfnCallbackThreadUnset);\n\n/**************************************************************************************\n ** ICLRMetaHost                                                                     **\n ** Activated using mscoree!CLRCreateInstance. Does not do any policy decisions, get **\n ** ICLRMetaHostPolicy if you need that.                                             **\n **************************************************************************************/\n[\n    uuid(D332DB9E-B9B3-4125-8207-A14884F53216),\n    version(1.0),\n    helpstring(\"CLR meta hosting interface\"),\n    local\n]\ninterface ICLRMetaHost : IUnknown\n{\n    /**********************************************************************************\n     ** Returns installed runtime with the specific version. Fails if not found.     **\n     ** NULL or any other wildcard is not accepted as pwzVersion                     **\n     ** Supersedes: CorBindToRuntimeEx with STARTUP_LOADER_SAFEMODE                  **\n     **********************************************************************************/\n    HRESULT GetRuntime(\n        [in]  LPCWSTR pwzVersion,\n        [in]  REFIID  riid,   // IID_ICLRRuntimeInfo\n        [out, iid_is(riid), retval] LPVOID *ppRuntime);\n\n    /**********************************************************************************\n     ** Returns runtime version burned into a file's metadata.                       **\n     ** Supersedes: GetFileVersion                                                   **\n     **********************************************************************************/\n    HRESULT GetVersionFromFile(\n        [in]      LPCWSTR pwzFilePath,\n        [out, size_is(*pcchBuffer), annotation(\"_Out_writes_all_(*pcchBuffer)\")]\n                  LPWSTR pwzBuffer,\n        [in, out] DWORD *pcchBuffer);\n\n    /**********************************************************************************\n     ** Returns an enumerator of runtimes installed on the machine.                  **\n     ** Supersedes: (none)                                                           **\n     **********************************************************************************/\n    HRESULT EnumerateInstalledRuntimes(\n        [out, retval] IEnumUnknown **ppEnumerator);\n\n    /**********************************************************************************\n     ** Provides an enumerator of runtimes loaded into the given process.            **\n     ** Supersedes: GetVersionFromProcess                                            **\n     **********************************************************************************/\n    HRESULT EnumerateLoadedRuntimes(\n        [in]  HANDLE hndProcess,\n        [out, retval] IEnumUnknown **ppEnumerator);\n\n    /**********************************************************************************\n     ** Provides a callback when a new runtime version has just been loaded, but not **\n     ** started.                                                                     **\n     **                                                                              **\n     ** The callback works in the following way:                                     **\n     **   - the callback is invoked only when a runtime is loaded for the first time **\n     **   - the callback will not be invoked for reentrant loads of the same runtime **\n     **   - the callback will be for reentrant loads of other runtimes               **\n     **   - it is guaranteed that no other thread may load the runtime until the     **\n     **     callback returns; any thread that does so blocks until this time.        **\n     **   - for non-reentrant multi-threaded runtime loads, callbacks are serialized **\n     **   - if the host intends to load (or cause to be loaded) another runtime in a **\n     **     reentrant fashion, or intends to perform any operations on the runtime   **\n     **     corresponding to the callback instance, the pfnCallbackThreadSet and     **\n     **     pfnCallbackThreadUnset arguments provided in the callback must be used   **\n     **     in the following way:                                                    **\n     **     - pfnCallbackThreadSet must be called by the thread that might cause a   **\n     **       runtime load before such a load is attempted                           **\n     **     - pfnCallbackThreadUnset must be called when the thread will no longer   **\n     **       cause such a runtime load (and before returning from the initial       **\n     **       callback)                                                              **\n     **     - pfnCallbackThreadSet and pfnCallbackThreadUnset are non-reentrant.     **\n     **                                                                              **\n     **   pCallbackFunction: This function is invoked when a new runtime has just    **\n     **                      been loaded. A value of NULL results in a failure       **\n     **                      return value of E_POINTER.                              **\n     **                                                                              **\n     ** Supersedes: LockClrVersion                                                   **\n     **********************************************************************************/\n    HRESULT RequestRuntimeLoadedNotification(\n        [in] RuntimeLoadedCallbackFnPtr pCallbackFunction);\n\n    /**********************************************************************************\n     ** Returns interface representing the runtime to which the legacy activation    **\n     ** policy has been bound (for example, by a useLegacyV2RuntimeActivationPolicy  **\n     ** config entry or by a call to ICLRRuntimeInfo::BindAsLegacyV2Runtime).        **\n     **********************************************************************************/\n    HRESULT QueryLegacyV2RuntimeBinding(\n        [in] REFIID riid,\n        [out, iid_is(riid), retval] LPVOID *ppUnk);\n\n    /**********************************************************************************\n     ** Shuts down the current process.                                              **\n     ** Supersedes: CorExitProcess                                                   **\n     **********************************************************************************/\n    HRESULT ExitProcess(\n        [in] INT32 iExitCode);\n} // interface ICLRMetaHost\n\n/*************************************************************************************\n ** This structure defines the version of a CLR for debugging purposes.             **\n ** The wStructVersion field allows for future revisions to this structure to be    **\n ** made. Currently it must be set to 0. The remaining fields represent the         **\n ** typical major.minor.build.revision product version information.                 **\n *************************************************************************************/\ntypedef struct _CLR_DEBUGGING_VERSION\n{\n    WORD wStructVersion;\n    WORD wMajor;\n    WORD wMinor;\n    WORD wBuild;\n    WORD wRevision;\n}\nCLR_DEBUGGING_VERSION;\n\ntypedef enum\n{\n    /**********************************************************************************\n     ** This runtime has a non-catchup managed debug event to send                   **\n     ** Catchup events include process, app domain, assembly, module, and thread     **\n     ** creation notifications that bring the debugger up to the current state after **\n     ** attaching. Non-catchup events are everything else.                           **\n     **********************************************************************************/\n    CLR_DEBUGGING_MANAGED_EVENT_PENDING  = 1,\n\n    /**********************************************************************************\n     ** The managed event that is pending is a Debugger.Launch request               **\n     **********************************************************************************/\n    CLR_DEBUGGING_MANAGED_EVENT_DEBUGGER_LAUNCH = 2,\n}\nCLR_DEBUGGING_PROCESS_FLAGS;\n\n /**************************************************************************************\n ** ICLRDebuggingLibraryProvider                                                     **\n ** Implemented by API user                                                          **\n ** This interface allows the debugger to provide modules which are needed for       **\n ** debugging a particular CLR such as mscordbi and mscordacwks. The module handles  **\n ** need to remain valid until a call to ICLRDebugging::CanUnloadNow indicates they  **\n ** may be freed, at which point it is the caller's responsibility to free the       **\n ** handles.                                                                         **\n **************************************************************************************/\n[\n    uuid(3151C08D-4D09-4f9b-8838-2880BF18FE51),\n    version(1.0),\n    helpstring(\"CLR debugging LibraryProvider callback interface\"),\n    local\n]\ninterface ICLRDebuggingLibraryProvider : IUnknown\n{\n    /**********************************************************************************\n    ** The goal of this method is to allow the debugger to provide a handle to a     **\n    ** module which is needed for debugging. The debugger may use any available means**\n    ** to locate and/or procure the module. See the security note below for important**\n    ** information about implementing this method securely.                          **\n    ** Arguments:                                                                    **\n    ** pwzFileName - The name of the module being requested                          **\n    ** dwTimeStamp - The date time stamp stored in the COFF file header of PE files  **\n    ** dwSizeOfImage - The SizeOfImage field stored in the COFF optional file header **\n    **                 of PE files                                                   **\n    ** phModule - Set this to the handle to the requested module on success. On      **\n    **            failure leave it untouched. See security note below!               **\n    **                                                                               **\n    ** Return value - S_OK if the module was provided, or any other convenient       **\n    **                error HRESULT if the module could not be provided              **\n    **                                                                               **\n    **                                                                               **\n    **                               !!!!!!!!!!!!!!                                  **\n    ** SECURITY NOTE: Anything the caller would not be willing to execute itself, it **\n    ** should not provide to the this API call                                       **\n    ***********************************************************************************/\n    HRESULT ProvideLibrary(\n        [in] const WCHAR* pwszFileName,\n        [in] DWORD dwTimestamp,\n        [in] DWORD dwSizeOfImage,\n        [out] HMODULE* phModule);\n}\n\n /**************************************************************************************\n ** ICLRDebuggingLibraryProvider2                                                     **\n ** Implemented by API user                                                           **\n ** This interface allows the debugger to provide module paths which are needed for   **\n ** debugging a particular CLR such as mscordbi and mscordacwks.                      **\n **************************************************************************************/\n[\n    uuid(E04E2FF1-DCFD-45D5-BCD1-16FFF2FAF7BA),\n    version(1.0),\n    helpstring(\"CLR debugging LibraryProvider callback interface\"),\n    local\n]\ninterface ICLRDebuggingLibraryProvider2 : IUnknown\n{\n    /**********************************************************************************\n    ** The goal of this method is to allow the debugger to provide a module path     **\n    ** which is needed for debugging. The debugger may use any available means to    **\n    ** locate and/or procure the module. See the security note below for important   **\n    ** information about implementing this method securely.                          **\n    ** Arguments:                                                                    **\n    ** pwzFileName - The name of the module being requested                          **\n    ** dwTimeStamp - The date time stamp stored in the COFF file header of PE files  **\n    ** dwSizeOfImage - The SizeOfImage field stored in the COFF optional file header **\n    **                 of PE files                                                   **\n    ** ppResolvedModulePath - Where *ppResolvedModulePath is a null terminated       **\n    **                        path to the module dll. On Windows it should be        **\n    **                        allocated with CoTaskMemAlloc. On Unix it should be    **\n    **                        allocated with malloc. Failure leave it untouched. See **\n    **                        security note below!                                   **\n    **                                                                               **\n    ** Return value - S_OK if the module was provided, or any other convenient       **\n    **                error HRESULT if the module could not be provided              **\n    **                                                                               **\n    **                               !!!!!!!!!!!!!!                                  **\n    ** SECURITY NOTE: Anything the caller would not be willing to execute itself, it **\n    ** should not provide to the this API call                                       **\n    ***********************************************************************************/\n    HRESULT ProvideLibrary2(\n        [in] const WCHAR* pwszFileName,\n        [in] DWORD dwTimestamp,\n        [in] DWORD dwSizeOfImage,\n        [out] LPWSTR* ppResolvedModulePath);\n}\n\n/**************************************************************************************\n ** ICLRDebugging                                                                    **\n ** Activated using mscoree!CLRCreateInstance.                                       **\n **************************************************************************************/\n[\n    uuid(D28F3C5A-9634-4206-A509-477552EEFB10),\n    version(1.0),\n    helpstring(\"CLR debugging interface for MetaHost interface\"),\n    local\n]\ninterface ICLRDebugging : IUnknown\n{\n    /**********************************************************************************\n    ** Get the ICorDebugProcess and other information corresponding to a clr module  **\n    ** loaded in the process                                                         **\n    ** Arguments:                                                                    **\n    ** moduleBaseAddress - The base address of a module in the target process.       **\n    **                     COR_E_NOT_CLR will be returned if the indicated module is **\n    **                     not a clr.                                                **\n    ** pDataTarget       - A data target abstraction which allows the managed        **\n    **                     debugger to inspect process state. It must implement      **\n    **                     at least ICorDebugDataTarget.                             **\n    ** pLibraryProvider  - A library provider callback interface that allows version **\n    **                     specific debugging libraries to be located and loaded on  **\n    **                     demand. This parameter is only required if ppProcess or   **\n    **                     pFlags is non-NULL.                                       **\n    ** pMaxDebuggerSupportedVersion - The version of the CLR this debugger is        **\n    **                     designed to support.  The debugger should specify the     **\n    **                     major and minor versions from the newest CLR version this **\n    **                     debugger supports.  The function may still succeed with   **\n    **                     a newer version of the CLR than this if the CLR           **\n    **                     determines that it should be compatible.  The build and   **\n    **                     revision values are currently ignored.                    **\n    ** riidProcess       - The interface ID of the desired ICorDebugProcess          **\n    **                     interface. Currently the only legal values are            **\n    **                     IID_CORDEBUGPROCESS3, IID_CORDEBUGPROCESS2, and           **\n    **                     IID_CORDEBUGPROCESS.                                      **\n    ** ppProcess         - Returns a pointer to a COM interface identified by        **\n    **                     riidProcess. Future versions of the runtime may implement **\n    **                     other interfaces.                                         **\n    ** pwszVersion       - On input this is either null, or points to a              **\n    **                     CLR_DEBUGGING_VERSION structure. The wStructVersion field **\n    **                     must be initialized to 0. On output the structure will be **\n    **                     filled in with the CLR version information.               **\n    ** pFlags            - Informational flags about the specified runtime, see      **\n    **                     CLR_DEBUGGING_PROCESS_FLAGS for a description of the      **\n    **                     flags.                                                    **\n    **                                                                               **\n    ** The return value is S_OK if succeeded or:                                     **\n    **   E_POINTER                       if pDataTarget is NULL                      **\n    **   CORDBG_E_LIBRARY_PROVIDER_ERROR if the ICLRDebuggingLibraryProvider callback**\n    **                                   returns an error or does not provide a valid**\n    **                                   handle                                      **\n    **    CORDBG_E_MISSING_DATA_TARGET_INTERFACE if the pDataTarget argument does not**\n    **                                   implement the required data target          **\n    **                                   interfaces for this version of the runtime. **\n    **    CORDBG_E_NOT_CLR               if the indicated module is not a clr. It is **\n    **                                   possible that modules which do represent a  **\n    **                                   CLR will not be detected if memory has been **\n    **                                   corrupted, is not available, or the CLR is  **\n    **                                   of a newer version than the shim.           **\n    **    CORDBG_E_UNSUPPORTED_DEBUGGING_MODEL if this runtime version does not      **\n    **                                   support this debugging model. Currently v4  **\n    **                                   supports this model and no previous version **\n    **                                   does. The pVersion output argument will     **\n    **                                   still be set to the correct value after     **\n    **                                   receiving this error.                       **\n    **    CORDBG_E_UNSUPPORTED_FORWARD_COMPAT if the version of the CLR is not       **\n    **                                   compatible with the version this debugger   **\n    **                                   claims to support. The pVersion output      **\n    **                                   argument will still be set to the correct   **\n    **                                   value after receiving this error.           **\n    **    E_NO_INTERFACE                 if the riidProcess interface is not         **\n    **                                   available.                                  **\n    **    CORDBG_E_UNSUPPORTED_VERSION_STRUCT if the version struct does not have a  **\n    **                                   recognized value for wStructVersion. The    **\n    **                                   only accepted value at this time is 0.      **\n    **    Any other convenient HRESULT error, depending on the execution.            **\n    **********************************************************************************/\n    HRESULT OpenVirtualProcess(\n        [in] ULONG64 moduleBaseAddress,\n        [in] IUnknown * pDataTarget,\n        [in] ICLRDebuggingLibraryProvider * pLibraryProvider,\n        [in] CLR_DEBUGGING_VERSION * pMaxDebuggerSupportedVersion,\n        [in] REFIID riidProcess,\n        [out, iid_is(riidProcess)] IUnknown ** ppProcess,\n        [in, out] CLR_DEBUGGING_VERSION * pVersion,\n        [out] CLR_DEBUGGING_PROCESS_FLAGS * pdwFlags);\n\n    /**********************************************************************************\n    ** Determines if a library provided via an ICLRDebuggingLibraryProvider is still **\n    ** in use. Functionally this checks to see if all instances of ICorDebug*        **\n    ** interfaces have been released and no thread is currently within a call to     **\n    ** OpenVirtualProcess.                                                           **\n    ** Arguments:                                                                    **\n    **   hModule - A module handle previously provided by the                        **\n    **             ICLRDebuggingLibraryProvider used in OpenVirtualProcess           **\n    ** Returns:                                                                      **\n    **   S_OK if the module can be unloaded now                                      **\n    **   S_FALSE if the module is still in use                                       **\n    **   Any other error HRESULT if a failure occurs                                 **\n    **                                                                               **\n    ** Notes: As of the V4.0 implementation unloading is still not fully supported   **\n    **   and all calls to this method will return S_FALSE.                           **\n    **********************************************************************************/\n    HRESULT CanUnloadNow(HMODULE hModule);\n} // interface ICLRDebugging\n\n/**************************************************************************************\n ** ICLRRuntimeInfo                                                                  **\n ** Represents a runtime - installed on the machine and/or loaded into a process.    **\n ** Includes functionality for obtaining various properties and for loading the      **\n ** runtime into the current process. The same installed runtime can be loaded       **\n ** multiple times in the same process (may not be supported in Dev10).              **\n **************************************************************************************/\n[\n    uuid(BD39D1D2-BA2F-486a-89B0-B4B0CB466891),\n    version(1.0),\n    helpstring(\"CLR runtime instance\"),\n    local\n]\ninterface ICLRRuntimeInfo : IUnknown\n{\n    // Methods that query information:\n\n    /**********************************************************************************\n     ** Returns the version of this runtime in the usual v-prefixed dotted form.     **\n     ** Supersedes: GetRequestedRuntimeInfo, GetRequestedRuntimeVersion,             **\n     **     GetCORVersion                                                            **\n     **********************************************************************************/\n    HRESULT GetVersionString(\n        [out, size_is(*pcchBuffer), annotation(\"_Out_writes_all_opt_(*pcchBuffer)\")]\n                   LPWSTR pwzBuffer,\n        [in, out]  DWORD *pcchBuffer);\n\n    /**********************************************************************************\n     ** Returns the directory where this runtime is installed.                       **\n     ** Supersedes: GetCORSystemDirectory                                            **\n     **********************************************************************************/\n    HRESULT GetRuntimeDirectory(\n        [out, size_is(*pcchBuffer), annotation(\"_Out_writes_all_(*pcchBuffer)\")]\n                   LPWSTR pwzBuffer,\n        [in, out]  DWORD *pcchBuffer);\n\n    /**********************************************************************************\n     ** Returns TRUE if this runtime is loaded into the specified process.           **\n     ** Supersedes: GetCORSystemDirectory                                            **\n     **********************************************************************************/\n    HRESULT IsLoaded(\n        [in]  HANDLE hndProcess,\n        [out, retval] BOOL *pbLoaded);\n\n    // Methods that may load the runtime:\n\n    /**********************************************************************************\n     ** Translates an HRESULT value into an error message. Use iLocaleID -1 for the  **\n     ** default culture of the current thread.                                       **\n     ** Supersedes: LoadStringRC, LoadStringRCEx                                     **\n     **********************************************************************************/\n    HRESULT LoadErrorString(\n        [in]       UINT iResourceID,\n        [out, size_is(*pcchBuffer), annotation(\"_Out_writes_all_(*pcchBuffer)\")]\n                   LPWSTR pwzBuffer,\n        [in, out]  DWORD *pcchBuffer,\n        [in, lcid] LONG iLocaleID);\n\n    /**********************************************************************************\n     ** Loads a library located alongside this runtime.                              **\n     ** Supersedes: LoadLibraryShim                                                  **\n     **********************************************************************************/\n    HRESULT LoadLibrary(\n        [in]  LPCWSTR pwzDllName,\n        [out, retval] HMODULE *phndModule);\n\n    /**********************************************************************************\n     ** Gets the address of the specified function exported from this runtime.       **\n     ** It should NOT be documented what module the function lives in. We may want   **\n     ** to implement some forwarding policy here. The reason for exposing            **\n     ** GetProcAddress are functions like mscorwks!GetCLRIdentityManager.            **\n     ** Supersedes: GetRealProcAddress                                               **\n     **********************************************************************************/\n    HRESULT GetProcAddress(\n        [in]  LPCSTR pszProcName,\n        [out, retval] LPVOID *ppProc);\n\n    /**********************************************************************************\n     ** Loads the runtime into the current process and returns an interface through  **\n     ** which runtime functionality is provided.                                     **\n     **                                                                              **\n     ** Supported CLSIDs/IIDs:                                                       **\n     ** CLSID_CorMetaDataDispenser   IID_IMetaDataDispenser,IID_IMetaDataDispenserEx **\n     ** CLSID_CorMetaDataDispenserRuntime  dtto                                      **\n     ** CLSID_CorRuntimeHost         IID_ICorRuntimeHost                             **\n     ** CLSID_CLRRuntimeHost         IID_ICLRRuntimeHost                             **\n     ** CLSID_TypeNameFactory        IID_ITypeNameFactory                            **\n     ** CLSID_CLRStrongName          IID_ICLRStrongName                              **\n     ** CLSID_CLRDebuggingLegacy     IID_ICorDebug                                   **\n     **                                                                              **\n     ** Supersedes: CorBindTo* and others                                            **\n     **********************************************************************************/\n    HRESULT GetInterface(\n        [in]  REFCLSID rclsid,\n        [in]  REFIID   riid,\n        [out, iid_is(riid), retval] LPVOID *ppUnk);\n\n    // Does not load runtime\n\n    /**********************************************************************************\n     ** Returns TRUE if this runtime could be loaded into the current process. Note  **\n     ** that this method is side-effect free, and thus does not represent a\t\t\t **\n     ** commitment to be able to load this runtime if it sets *pbLoadable to be TRUE.**\n     ** Supersedes: none                                                             **\n     **********************************************************************************/\n    HRESULT IsLoadable(\n        [out, retval] BOOL *pbLoadable);\n\n    /**********************************************************************************\n     ** Sets startup flags and host config file that will be used at startup.        **\n     ** Supersedes: The startupFlags parameter in CorBindToRuntimeEx/Host            **\n     **********************************************************************************/\n    HRESULT SetDefaultStartupFlags(\n        [in]  DWORD dwStartupFlags,\n        [in]  LPCWSTR pwzHostConfigFile);\n\n    /**********************************************************************************\n     ** Gets startup flags and host config file that will be used at startup.        **\n     ** Supersedes: GetStartupFlags, GetHostConfigurationFile                        **\n     **********************************************************************************/\n    HRESULT GetDefaultStartupFlags(\n        [out]      DWORD *pdwStartupFlags,\n        [out, size_is(*pcchHostConfigFile), annotation(\"_Out_writes_all_opt_(*pcchHostConfigFile)\")]\n                   LPWSTR pwzHostConfigFile,\n        [in, out]  DWORD *pcchHostConfigFile);\n\n    /**********************************************************************************\n     ** If not already bound (for example, with a useLegacyV2RuntimeActivationPolicy **\n     ** config setting), binds this runtime for all legacy V2 activation policy      **\n     ** decisions. If a different runtime was already bound to the legacy V2         **\n     ** activation policy, returns CLR_E_SHIM_LEGACYRUNTIMEALREADYBOUND. If this     **\n     ** runtime was already bound as the legacy V2 activation policy runtime,        **\n     ** returns S_OK.                                                                **\n     **********************************************************************************/\n    HRESULT BindAsLegacyV2Runtime();\n\n    /**********************************************************************************\n     ** Returns TRUE if the runtime has been started, i.e. Start() has been called.  **\n     ** If it has been started, its STARTUP_FLAGS are returned.                      **\n     **                                                                              **\n     ** IMPORTANT: This method is valid only for v4+ runtimes. This method will      **\n     ** return E_NOTIMPL for all pre-v4 runtimes.                                    **\n     **********************************************************************************/\n    HRESULT IsStarted(\n        [out] BOOL *pbStarted,\n        [out] DWORD *pdwStartupFlags);\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/metamodelpub.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// MetaModelPub.h -- header file for Common Language Runtime metadata.\n//\n\n//\n//*****************************************************************************\n\n#ifndef _METAMODELPUB_H_\n#define _METAMODELPUB_H_\n\n#if _MSC_VER >= 1100\n# pragma once\n#endif\n\n#include <cor.h>\n#include \"contract.h\"\n\ntemplate<class T> inline T Align4(T p)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    INT_PTR i = (INT_PTR)p;\n    i = (i+(3)) & ~3;\n    return (T)i;\n}\n\ntypedef uint32_t RID;\n\n// check if a rid is valid or not\n#define     InvalidRid(rid) ((rid) == 0)\n\n#ifndef METADATA_FIELDS_PROTECTION\n#define METADATA_FIELDS_PROTECTION public\n#endif\n\n//*****************************************************************************\n// Record definitions.  Records have some combination of fixed size fields and\n//  variable sized fields (actually, constant across a database, but variable\n//  between databases).\n//\n// In this section we define record definitions which include the fixed size\n//  fields and an enumeration of the variable sized fields.\n//\n// Naming is as follows:\n//  Given some table \"Xyz\":\n//  class XyzRec { public:\n//    SOMETYPE  m_SomeField;\n//        // rest of the fixed fields.\n//    enum { COL_Xyz_SomeOtherField,\n//        // rest of the fields, enumerated.\n//        COL_Xyz_COUNT };\n//   };\n//\n// The important features are the class name (XyzRec), the enumerations\n//  (COL_Xyz_FieldName), and the enumeration count (COL_Xyz_COUNT).\n//\n// THESE NAMING CONVENTIONS ARE CARVED IN STONE!  DON'T TRY TO BE CREATIVE!\n//\n//*****************************************************************************\n// Have the compiler generate two byte alignment.  Be careful to manually lay\n//  out the fields for proper alignment.  The alignment for variable-sized\n//  fields will be computed at save time.\n#include <pshpack2.h>\n\n// Non-sparse tables.\nclass ModuleRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT  m_Generation;               // ENC generation.\npublic:\n    enum {\n        COL_Generation,\n\n        COL_Name,\n        COL_Mvid,\n        COL_EncId,\n        COL_EncBaseId,\n        COL_COUNT,\n        COL_KEY\n    };\n    USHORT GetGeneration()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Generation);\n    }\n    void SetGeneration(USHORT Generation)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Generation = VAL16(Generation);\n    }\n};\n\nclass TypeRefRec\n{\npublic:\n    enum {\n        COL_ResolutionScope,            // mdModuleRef or mdAssemblyRef.\n        COL_Name,\n        COL_Namespace,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass TypeDefRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Flags;                // Flags for this TypeDef\npublic:\n    enum {\n        COL_Flags,\n\n        COL_Name,                       // offset into string pool.\n        COL_Namespace,\n        COL_Extends,                    // coded token to typedef/typeref.\n        COL_FieldList,                  // rid of first field.\n        COL_MethodList,                 // rid of first method.\n        COL_COUNT,\n        COL_KEY\n    };\n    ULONG GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL32(Flags);\n    }\n    void AddFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags |= VAL32(Flags);\n    }\n    void RemoveFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags &= ~VAL32(Flags);\n    }\n\n};\n\nclass FieldPtrRec\n{\npublic:\n    enum {\n        COL_Field,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass FieldRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_Flags;                // Flags for the field.\npublic:\n    enum {\n        COL_Flags,\n\n        COL_Name,\n        COL_Signature,\n        COL_COUNT,\n        COL_KEY\n    };\n    USHORT GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = (USHORT)VAL16(Flags);\n    }\n    void AddFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags |= (USHORT)VAL16(Flags);\n    }\n    void RemoveFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags &= (USHORT)~VAL16(Flags);\n    }\n\n\n};\n\nclass MethodPtrRec\n{\npublic:\n    enum {\n        COL_Method,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass MethodRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_RVA;        // RVA of the Method.\n    USHORT      m_ImplFlags;  // Descr flags of the Method.\n    USHORT      m_Flags;      // Flags for the Method.\npublic:\n    enum {\n        COL_RVA,\n        COL_ImplFlags,\n        COL_Flags,\n\n        COL_Name,\n        COL_Signature,\n        COL_ParamList,                  // Rid of first param.\n        COL_COUNT,\n        COL_KEY\n    };\n\n    void Copy(MethodRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_RVA = pFrom->m_RVA;\n        m_ImplFlags = pFrom->m_ImplFlags;\n        m_Flags = pFrom->m_Flags;\n    }\n\n    ULONG GetRVA()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_RVA);\n    }\n    void SetRVA(ULONG RVA)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_RVA = VAL32(RVA);\n    }\n\n    USHORT GetImplFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_ImplFlags);\n    }\n    void SetImplFlags(USHORT ImplFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_ImplFlags = VAL16(ImplFlags);\n    }\n    void AddImplFlags(USHORT ImplFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_ImplFlags |= VAL16(ImplFlags);\n    }\n    void RemoveImplFlags(USHORT ImplFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_ImplFlags &= ~VAL16(ImplFlags);\n    }\n\n\n    USHORT GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = (USHORT)VAL16(Flags);\n    }\n    void AddFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags |= (USHORT)VAL16(Flags);\n    }\n    void RemoveFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags &= (USHORT)~VAL16(Flags);\n    }\n};\n\nclass ParamPtrRec\n{\npublic:\n    enum {\n        COL_Param,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass ParamRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_Flags;                // Flags for this Param.\n    USHORT      m_Sequence;             // Sequence # of param.  0 - return value.\npublic:\n    enum {\n        COL_Flags,\n        COL_Sequence,\n\n        COL_Name,                       // Name of the param.\n        COL_COUNT,\n        COL_KEY\n    };\n\n    void Copy(ParamRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = pFrom->m_Flags;\n        m_Sequence = pFrom->m_Sequence;\n    }\n\n    USHORT GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = (USHORT)VAL16(Flags);\n    }\n    void AddFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags |= (USHORT)VAL16(Flags);\n    }\n    void RemoveFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags &= (USHORT)~VAL16(Flags);\n    }\n\n    USHORT GetSequence()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Sequence);\n    }\n    void SetSequence(USHORT Sequence)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Sequence = VAL16(Sequence);\n    }\n\n};\n\nclass InterfaceImplRec\n{\npublic:\n    enum {\n        COL_Class,                      // Rid of class' TypeDef.\n        COL_Interface,                  // Coded rid of implemented interface.\n        COL_COUNT,\n        COL_KEY = COL_Class\n    };\n};\n\nclass MemberRefRec\n{\npublic:\n    enum {\n        COL_Class,                      // Rid of TypeDef.\n        COL_Name,\n        COL_Signature,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass StandAloneSigRec\n{\npublic:\n    enum {\n        COL_Signature,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\n// Sparse tables.  These contain modifiers for tables above.\nclass ConstantRec\n{\nMETADATA_FIELDS_PROTECTION:\n    BYTE        m_Type;                 // Type of the constant.\n    BYTE        m_PAD1;\npublic:\n    enum {\n        COL_Type,\n\n        COL_Parent,                     // Coded rid of object (param, field).\n        COL_Value,                      // Index into blob pool.\n        COL_COUNT,\n        COL_KEY = COL_Parent\n    };\n    BYTE GetType()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return m_Type;\n    }\n    void SetType(BYTE Type)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Type = Type;\n    }\n};\n\nclass CustomAttributeRec\n{\npublic:\n    enum {\n        COL_Parent,                     // Coded rid of any object.\n        COL_Type,                       // TypeDef or TypeRef.\n        COL_Value,                      // Blob.\n        COL_COUNT,\n        COL_KEY = COL_Parent\n    };\n};\n\nclass FieldMarshalRec\n{\npublic:\n    enum {\n        COL_Parent,                     // Coded rid of field or param.\n        COL_NativeType,\n        COL_COUNT,\n        COL_KEY = COL_Parent\n    };\n};\n\nclass DeclSecurityRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT  m_Action;\npublic:\n    enum {\n        COL_Action,\n\n        COL_Parent,\n        COL_PermissionSet,\n        COL_COUNT,\n        COL_KEY = COL_Parent\n    };\n\n    void Copy(DeclSecurityRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Action = pFrom->m_Action;\n    }\n    USHORT GetAction()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Action);\n    }\n    void SetAction(USHORT Action)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Action = VAL16(Action);\n    }\n};\n\n\nclass ClassLayoutRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT  m_PackingSize;\n    ULONG   m_ClassSize;\npublic:\n    enum {\n        COL_PackingSize,\n        COL_ClassSize,\n\n        COL_Parent,                     // Rid of TypeDef.\n        COL_COUNT,\n        COL_KEY = COL_Parent\n    };\n\n    void Copy(ClassLayoutRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_PackingSize = pFrom->m_PackingSize;\n        m_ClassSize = pFrom->m_ClassSize;\n    }\n    USHORT GetPackingSize()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_PackingSize);\n    }\n    void SetPackingSize(USHORT PackingSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_PackingSize = VAL16(PackingSize);\n    }\n\n    ULONG GetClassSize()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_ClassSize);\n    }\n    void SetClassSize(ULONG ClassSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_ClassSize = VAL32(ClassSize);\n    }\n};\n\nclass FieldLayoutRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_OffSet;\npublic:\n    enum {\n        COL_OffSet,\n\n        COL_Field,\n        COL_COUNT,\n        COL_KEY = COL_Field\n    };\n\n    void Copy(FieldLayoutRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OffSet = pFrom->m_OffSet;\n    }\n    ULONG GetOffSet()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_OffSet);\n    }\n    void SetOffSet(ULONG Offset)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OffSet = VAL32(Offset);\n    }\n};\n\nclass EventMapRec\n{\npublic:\n    enum {\n        COL_Parent,\n        COL_EventList,                  // rid of first event.\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass EventPtrRec\n{\npublic:\n    enum {\n        COL_Event,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass EventRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_EventFlags;\npublic:\n    enum {\n        COL_EventFlags,\n\n        COL_Name,\n        COL_EventType,\n        COL_COUNT,\n        COL_KEY\n    };\n    USHORT GetEventFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_EventFlags);\n    }\n    void SetEventFlags(USHORT EventFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_EventFlags = VAL16(EventFlags);\n    }\n    void AddEventFlags(USHORT EventFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_EventFlags |= VAL16(EventFlags);\n    }\n};\n\nclass PropertyMapRec\n{\npublic:\n    enum {\n        COL_Parent,\n        COL_PropertyList,               // rid of first property.\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass PropertyPtrRec\n{\npublic:\n    enum {\n        COL_Property,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass PropertyRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_PropFlags;\npublic:\n    enum {\n        COL_PropFlags,\n\n        COL_Name,\n        COL_Type,\n        COL_COUNT,\n        COL_KEY\n    };\n    USHORT GetPropFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_PropFlags);\n    }\n    void SetPropFlags(USHORT PropFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_PropFlags = VAL16(PropFlags);\n    }\n    void AddPropFlags(USHORT PropFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_PropFlags |= VAL16(PropFlags);\n    }\n};\n\nclass MethodSemanticsRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_Semantic;\npublic:\n    enum {\n        COL_Semantic,\n\n        COL_Method,\n        COL_Association,\n        COL_COUNT,\n        COL_KEY = COL_Association\n    };\n    USHORT GetSemantic()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Semantic);\n    }\n    void SetSemantic(USHORT Semantic)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Semantic = VAL16(Semantic);\n    }\n};\n\nclass MethodImplRec\n{\npublic:\n    enum {\n        COL_Class,                  // TypeDef where the MethodBody lives.\n        COL_MethodBody,             // MethodDef or MemberRef.\n        COL_MethodDeclaration,      // MethodDef or MemberRef.\n        COL_COUNT,\n        COL_KEY = COL_Class\n    };\n};\n\nclass ModuleRefRec\n{\npublic:\n    enum {\n        COL_Name,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass TypeSpecRec\n{\npublic:\n    enum {\n        COL_Signature,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass ImplMapRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_MappingFlags;\npublic:\n    enum {\n        COL_MappingFlags,\n\n        COL_MemberForwarded,        // mdField or mdMethod.\n        COL_ImportName,\n        COL_ImportScope,            // mdModuleRef.\n        COL_COUNT,\n        COL_KEY = COL_MemberForwarded\n    };\n    USHORT GetMappingFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_MappingFlags);\n    }\n    void SetMappingFlags(USHORT MappingFlags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_MappingFlags = VAL16(MappingFlags);\n    }\n\n};\n\nclass FieldRVARec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_RVA;\npublic:\n    enum{\n        COL_RVA,\n\n        COL_Field,\n        COL_COUNT,\n        COL_KEY = COL_Field\n    };\n\n    void Copy(FieldRVARec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_RVA = pFrom->m_RVA;\n    }\n    ULONG GetRVA()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_RVA);\n    }\n    void SetRVA(ULONG RVA)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_RVA = VAL32(RVA);\n    }\n};\n\nclass ENCLogRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Token;            // Token, or like a token, but with (ixTbl|0x80) instead of token type.\n    ULONG       m_FuncCode;         // Function code describing the nature of ENC change.\npublic:\n    enum {\n        COL_Token,\n        COL_FuncCode,\n        COL_COUNT,\n        COL_KEY\n    };\n    ULONG GetToken()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Token);\n    }\n    void SetToken(ULONG Token)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Token = VAL32(Token);\n    }\n\n    ULONG GetFuncCode()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_FuncCode);\n    }\n    void SetFuncCode(ULONG FuncCode)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_FuncCode = VAL32(FuncCode);\n    }\n};\n\nclass ENCMapRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Token;            // Token, or like a token, but with (ixTbl|0x80) instead of token type.\npublic:\n    enum {\n        COL_Token,\n        COL_COUNT,\n        COL_KEY\n    };\n    ULONG GetToken()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Token);\n    }\n    void SetToken(ULONG Token)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Token = VAL32(Token);\n    }\n};\n\n// Assembly tables.\n\nclass AssemblyRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_HashAlgId;\n    USHORT      m_MajorVersion;\n    USHORT      m_MinorVersion;\n    USHORT      m_BuildNumber;\n    USHORT      m_RevisionNumber;\n    ULONG       m_Flags;\npublic:\n    enum {\n        COL_HashAlgId,\n        COL_MajorVersion,\n        COL_MinorVersion,\n        COL_BuildNumber,\n        COL_RevisionNumber,\n        COL_Flags,\n\n        COL_PublicKey,          // Public key identifying the publisher\n        COL_Name,\n        COL_Locale,\n        COL_COUNT,\n        COL_KEY\n    };\n\n    void Copy(AssemblyRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_HashAlgId = pFrom->m_HashAlgId;\n        m_MajorVersion = pFrom->m_MajorVersion;\n        m_MinorVersion = pFrom->m_MinorVersion;\n        m_BuildNumber = pFrom->m_BuildNumber;\n        m_RevisionNumber = pFrom->m_RevisionNumber;\n        m_Flags = pFrom->m_Flags;\n    }\n\n    ULONG GetHashAlgId()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_HashAlgId);\n    }\n    void SetHashAlgId (ULONG HashAlgId)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_HashAlgId = VAL32(HashAlgId);\n    }\n\n    USHORT GetMajorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_MajorVersion);\n    }\n    void SetMajorVersion (USHORT MajorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_MajorVersion = VAL16(MajorVersion);\n    }\n\n    USHORT GetMinorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_MinorVersion);\n    }\n    void SetMinorVersion (USHORT MinorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_MinorVersion = VAL16(MinorVersion);\n    }\n\n    USHORT GetBuildNumber()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_BuildNumber);\n    }\n    void SetBuildNumber (USHORT BuildNumber)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_BuildNumber = VAL16(BuildNumber);\n    }\n\n    USHORT GetRevisionNumber()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_RevisionNumber);\n    }\n    void SetRevisionNumber (USHORT RevisionNumber)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_RevisionNumber = VAL16(RevisionNumber);\n    }\n\n    ULONG GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Flags);\n    }\n    void SetFlags (ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL32(Flags);\n    }\n\n};\n\nclass AssemblyProcessorRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Processor;\npublic:\n    enum {\n        COL_Processor,\n\n        COL_COUNT,\n        COL_KEY\n    };\n    ULONG GetProcessor()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Processor);\n    }\n    void SetProcessor(ULONG Processor)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Processor = VAL32(Processor);\n    }\n};\n\nclass AssemblyOSRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_OSPlatformId;\n    ULONG       m_OSMajorVersion;\n    ULONG       m_OSMinorVersion;\npublic:\n    enum {\n        COL_OSPlatformId,\n        COL_OSMajorVersion,\n        COL_OSMinorVersion,\n\n        COL_COUNT,\n        COL_KEY\n    };\n    ULONG GetOSPlatformId()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_OSPlatformId);\n    }\n    void SetOSPlatformId(ULONG OSPlatformId)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OSPlatformId = VAL32(OSPlatformId);\n    }\n\n    ULONG GetOSMajorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_OSMajorVersion);\n    }\n    void SetOSMajorVersion(ULONG OSMajorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OSMajorVersion = VAL32(OSMajorVersion);\n    }\n\n    ULONG GetOSMinorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_OSMinorVersion);\n    }\n    void SetOSMinorVersion(ULONG OSMinorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OSMinorVersion = VAL32(OSMinorVersion);\n    }\n\n};\n\nclass AssemblyRefRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_MajorVersion;\n    USHORT      m_MinorVersion;\n    USHORT      m_BuildNumber;\n    USHORT      m_RevisionNumber;\n    ULONG       m_Flags;\npublic:\n    enum {\n        COL_MajorVersion,\n        COL_MinorVersion,\n        COL_BuildNumber,\n        COL_RevisionNumber,\n        COL_Flags,\n\n        COL_PublicKeyOrToken,               // The public key or token identifying the publisher of the Assembly.\n        COL_Name,\n        COL_Locale,\n        COL_HashValue,\n        COL_COUNT,\n        COL_KEY\n    };\n    void Copy(AssemblyRefRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_MajorVersion = pFrom->m_MajorVersion;\n        m_MinorVersion = pFrom->m_MinorVersion;\n        m_BuildNumber = pFrom->m_BuildNumber;\n        m_RevisionNumber = pFrom->m_RevisionNumber;\n        m_Flags = pFrom->m_Flags;\n    }\n    USHORT  GetMajorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_MajorVersion);\n    }\n    void SetMajorVersion(USHORT MajorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_MajorVersion = VAL16(MajorVersion);\n    }\n\n    USHORT GetMinorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_MinorVersion);\n    }\n    void SetMinorVersion(USHORT MinorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_MinorVersion = VAL16(MinorVersion);\n    }\n\n    USHORT GetBuildNumber()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_BuildNumber);\n    }\n    void SetBuildNumber(USHORT BuildNumber)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_BuildNumber = VAL16(BuildNumber);\n    }\n\n    USHORT GetRevisionNumber()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_RevisionNumber);\n    }\n    void SetRevisionNumber(USHORT RevisionNumber)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_RevisionNumber = RevisionNumber;\n    }\n\n    ULONG GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL32(Flags);\n    }\n\n};\n\nclass AssemblyRefProcessorRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Processor;\npublic:\n    enum {\n        COL_Processor,\n\n        COL_AssemblyRef,                // mdtAssemblyRef\n        COL_COUNT,\n        COL_KEY\n    };\n    ULONG GetProcessor()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Processor);\n    }\n    void SetProcessor(ULONG Processor)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Processor = VAL32(Processor);\n    }\n};\n\nclass AssemblyRefOSRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_OSPlatformId;\n    ULONG       m_OSMajorVersion;\n    ULONG       m_OSMinorVersion;\npublic:\n    enum {\n        COL_OSPlatformId,\n        COL_OSMajorVersion,\n        COL_OSMinorVersion,\n\n        COL_AssemblyRef,                // mdtAssemblyRef.\n        COL_COUNT,\n        COL_KEY\n    };\n    ULONG       GetOSPlatformId()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_OSPlatformId);\n    }\n    void SetOSPlatformId(ULONG OSPlatformId)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OSPlatformId = VAL32(OSPlatformId);\n    }\n\n    ULONG GetOSMajorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_OSMajorVersion);\n    }\n    void SetOSMajorVersion(ULONG OSMajorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OSMajorVersion = VAL32(OSMajorVersion);\n    }\n\n    ULONG GetOSMinorVersion()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_OSMinorVersion);\n    }\n    void SetOSMinorVersion(ULONG OSMinorVersion)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_OSMinorVersion = VAL32(OSMinorVersion);\n    }\n};\n\nclass FileRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Flags;\npublic:\n    enum {\n        COL_Flags,\n\n        COL_Name,\n        COL_HashValue,\n        COL_COUNT,\n        COL_KEY\n    };\n    void Copy(FileRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = pFrom->m_Flags;\n    }\n    ULONG GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL32(Flags);\n    }\n};\n\nclass ExportedTypeRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Flags;\n    ULONG       m_TypeDefId;\npublic:\n    enum {\n        COL_Flags,\n        COL_TypeDefId,\n\n        COL_TypeName,\n        COL_TypeNamespace,\n        COL_Implementation,         // mdFile or mdAssemblyRef.\n        COL_COUNT,\n        COL_KEY\n    };\n    void Copy(ExportedTypeRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = pFrom->m_Flags;\n        m_TypeDefId = pFrom->m_TypeDefId;\n    }\n    ULONG GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL32(Flags);\n    }\n\n    ULONG GetTypeDefId()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_TypeDefId);\n    }\n    void SetTypeDefId(ULONG TypeDefId)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_TypeDefId = VAL32(TypeDefId);\n    }\n};\n\nclass ManifestResourceRec\n{\nMETADATA_FIELDS_PROTECTION:\n    ULONG       m_Offset;\n    ULONG       m_Flags;\npublic:\n    enum {\n        COL_Offset,\n        COL_Flags,\n\n        COL_Name,\n        COL_Implementation,         // mdFile or mdAssemblyRef.\n        COL_COUNT,\n        COL_KEY\n    };\n    void Copy(ManifestResourceRec *pFrom)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = pFrom->m_Flags;\n        m_Offset = pFrom->m_Offset;\n    }\n\n    ULONG GetOffset()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Offset);\n    }\n    void SetOffset(ULONG Offset)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Offset = VAL32(Offset);\n    }\n\n    ULONG GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL32(&m_Flags);\n    }\n    void SetFlags(ULONG Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL32(Flags);\n    }\n\n};\n\n// End Assembly Tables.\n\nclass NestedClassRec\n{\npublic:\n    enum {\n        COL_NestedClass,\n        COL_EnclosingClass,\n        COL_COUNT,\n        COL_KEY = COL_NestedClass\n    };\n};\n\n// Generics\n\n\nclass GenericParamRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_Number;               // index; zero = first var\n    USHORT      m_Flags;                // index; zero = first var\npublic:\n    enum {\n\n        COL_Number,                     // index; zero = first var\n        COL_Flags,                      // flags, for future use\n        COL_Owner,                      // typeDef/methodDef\n        COL_Name,                       // Purely descriptive, not used for binding purposes\n        COL_COUNT,\n        COL_KEY = COL_Owner\n    };\n\n    USHORT GetNumber()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Number);\n    }\n    void SetNumber(USHORT Number)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Number = VAL16(Number);\n    }\n\n    USHORT GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Flags);\n    }\n    void SetFlags(USHORT Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL16(Flags);\n    }\n};\n\n// @todo: this definition is for reading the old (and wrong) GenericParamRec from a\n// Beta1 assembly.\nclass GenericParamV1_1Rec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_Number;               // index; zero = first var\n    USHORT      m_Flags;                // index; zero = first var\npublic:\n    enum {\n\n        COL_Number,                     // index; zero = first var\n        COL_Flags,                      // flags, for future use\n        COL_Owner,                      // typeDef/methodDef\n        COL_Name,                       // Purely descriptive, not used for binding purposes\n        COL_Kind,                       // typeDef/Ref/Spec, reserved for future use\n        COL_COUNT,\n        COL_KEY = COL_Owner\n    };\n\n    USHORT GetNumber()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Number);\n    }\n    void SetNumber(USHORT Number)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Number = VAL16(Number);\n    }\n\n    USHORT GetFlags()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Flags);\n    }\n    void SetFlags(USHORT Flags)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Flags = VAL16(Flags);\n    }\n};\n\nclass MethodSpecRec\n{\npublic:\n    enum {\n        COL_Method,                 // methodDef/memberRef\n        COL_Instantiation,          // signature\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\n\nclass GenericParamConstraintRec\n{\npublic:\n    enum {\n\n        COL_Owner,                                      // GenericParam\n        COL_Constraint,                                 // typeDef/Ref/Spec\n        COL_COUNT,\n        COL_KEY = COL_Owner\n    };\n};\n\n#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB\n/* Portable PDB tables */\n// -- Dummy records to fill the gap to 0x30\nclass DummyRec\n{\npublic:\n    enum {\n        COL_COUNT,\n        COL_KEY\n    };\n};\nclass Dummy1Rec : public DummyRec {};\nclass Dummy2Rec : public DummyRec {};\nclass Dummy3Rec : public DummyRec {};\n\nclass DocumentRec\n{\npublic:\n    enum {\n        COL_Name,\n        COL_HashAlgorithm,\n        COL_Hash,\n        COL_Language,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass MethodDebugInformationRec\n{\npublic:\n    enum {\n        COL_Document,\n        COL_SequencePoints,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass LocalScopeRec\n{\nMETADATA_FIELDS_PROTECTION:\n    // [IMPORTANT]: Assigning values directly can override other columns, use PutCol instead\n    ULONG      m_StartOffset;\n    // [IMPORTANT]: Assigning values directly can override other columns, use PutCol instead\n    ULONG      m_Length;\npublic:\n    enum {\n        COL_Method,\n        COL_ImportScope,\n        COL_VariableList,\n        COL_ConstantList,\n        COL_StartOffset,\n        COL_Length,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass LocalVariableRec\n{\nMETADATA_FIELDS_PROTECTION:\n    USHORT      m_Attributes;\n    USHORT      m_Index;\npublic:\n    enum {\n        COL_Attributes,\n        COL_Index,\n        COL_Name,\n        COL_COUNT,\n        COL_KEY\n    };\n\n    USHORT GetAttributes()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Attributes);\n    }\n    void SetAttributes(USHORT attributes)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Attributes = VAL16(attributes);\n    }\n\n    USHORT GetIndex()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        return GET_UNALIGNED_VAL16(&m_Index);\n    }\n    void SetIndex(USHORT index)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_Index = VAL16(index);\n    }\n};\n\nclass LocalConstantRec\n{\npublic:\n    enum {\n        COL_Name,\n        COL_Signature,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\nclass ImportScopeRec\n{\npublic:\n    enum {\n        COL_Parent,\n        COL_Imports,\n        COL_COUNT,\n        COL_KEY\n    };\n};\n\n// TODO:\n// class StateMachineMethodRec\n// class CustomDebugInformationRec\n#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB\n\n#include <poppack.h>\n\n// List of MiniMd tables.\n\n#define MiniMdTables()          \\\n    MiniMdTable(Module)         \\\n    MiniMdTable(TypeRef)        \\\n    MiniMdTable(TypeDef)        \\\n    MiniMdTable(FieldPtr)       \\\n    MiniMdTable(Field)          \\\n    MiniMdTable(MethodPtr)      \\\n    MiniMdTable(Method)         \\\n    MiniMdTable(ParamPtr)       \\\n    MiniMdTable(Param)          \\\n    MiniMdTable(InterfaceImpl)  \\\n    MiniMdTable(MemberRef)      \\\n    MiniMdTable(Constant)       \\\n    MiniMdTable(CustomAttribute)\\\n    MiniMdTable(FieldMarshal)   \\\n    MiniMdTable(DeclSecurity)   \\\n    MiniMdTable(ClassLayout)    \\\n    MiniMdTable(FieldLayout)    \\\n    MiniMdTable(StandAloneSig)  \\\n    MiniMdTable(EventMap)       \\\n    MiniMdTable(EventPtr)       \\\n    MiniMdTable(Event)          \\\n    MiniMdTable(PropertyMap)    \\\n    MiniMdTable(PropertyPtr)    \\\n    MiniMdTable(Property)       \\\n    MiniMdTable(MethodSemantics)\\\n    MiniMdTable(MethodImpl)     \\\n    MiniMdTable(ModuleRef)      \\\n    MiniMdTable(TypeSpec)       \\\n    MiniMdTable(ImplMap)        \\\n    MiniMdTable(FieldRVA)       \\\n    MiniMdTable(ENCLog)         \\\n    MiniMdTable(ENCMap)         \\\n    MiniMdTable(Assembly)       \\\n    MiniMdTable(AssemblyProcessor)  \\\n    MiniMdTable(AssemblyOS)     \\\n    MiniMdTable(AssemblyRef)    \\\n    MiniMdTable(AssemblyRefProcessor)   \\\n    MiniMdTable(AssemblyRefOS)  \\\n    MiniMdTable(File)           \\\n    MiniMdTable(ExportedType)   \\\n    MiniMdTable(ManifestResource)   \\\n    MiniMdTable(NestedClass)    \\\n    MiniMdTable(GenericParam)     \\\n    MiniMdTable(MethodSpec)     \\\n    MiniMdTable(GenericParamConstraint)\n\n#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB\n#define PortablePdbMiniMdTables() \\\n    /* Dummy tables to fill the gap to 0x30 */ \\\n    MiniMdTable(Dummy1)                             /* 0x2D */ \\\n    MiniMdTable(Dummy2)                             /* 0x2E */ \\\n    MiniMdTable(Dummy3)                             /* 0x2F */ \\\n    /* Actual portable PDB tables */ \\\n    MiniMdTable(Document)                           /* 0x30 */ \\\n    MiniMdTable(MethodDebugInformation)             /* 0x31 */ \\\n    MiniMdTable(LocalScope)                         /* 0x32 */ \\\n    MiniMdTable(LocalVariable)                      /* 0x33 */ \\\n    MiniMdTable(LocalConstant)                      /* 0x34 */ \\\n    MiniMdTable(ImportScope)                        /* 0x35 */ \\\n    // TODO:\n    // MiniMdTable(StateMachineMethod)                 /* 0x36 */\n    // MiniMdTable(CustomDebugInformation)             /* 0x37 */\n#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB\n\n#undef MiniMdTable\n#define MiniMdTable(x) TBL_##x,\nenum {\n    MiniMdTables()\n#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB\n    PortablePdbMiniMdTables()\n#endif\n    TBL_COUNT,                              // Highest table.\n    TBL_COUNT_V1 = TBL_NestedClass + 1,    // Highest table in v1.0 database\n#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB\n    TBL_COUNT_V2 = TBL_GenericParamConstraint + 1 // Highest in v2.0 database\n#else\n    TBL_COUNT_V2 = TBL_ImportScope + 1 // Highest in portable PDB database\n#endif\n};\n#undef MiniMdTable\n\n// List of MiniMd coded token types.\n#define MiniMdCodedTokens()                 \\\n    MiniMdCodedToken(TypeDefOrRef)          \\\n    MiniMdCodedToken(HasConstant)           \\\n    MiniMdCodedToken(HasCustomAttribute)    \\\n    MiniMdCodedToken(HasFieldMarshal)       \\\n    MiniMdCodedToken(HasDeclSecurity)       \\\n    MiniMdCodedToken(MemberRefParent)       \\\n    MiniMdCodedToken(HasSemantic)           \\\n    MiniMdCodedToken(MethodDefOrRef)        \\\n    MiniMdCodedToken(MemberForwarded)       \\\n    MiniMdCodedToken(Implementation)        \\\n    MiniMdCodedToken(CustomAttributeType)   \\\n    MiniMdCodedToken(ResolutionScope)       \\\n    MiniMdCodedToken(TypeOrMethodDef)       \\\n\n#undef MiniMdCodedToken\n#define MiniMdCodedToken(x) CDTKN_##x,\nenum {\n    MiniMdCodedTokens()\n    CDTKN_COUNT\n};\n#undef MiniMdCodedToken\n\n//*****************************************************************************\n// Meta-meta data.  Constant across all MiniMds.\n//*****************************************************************************\n#ifndef _META_DATA_META_CONSTANTS_DEFINED\n#define _META_DATA_META_CONSTANTS_DEFINED\nconst unsigned int iRidMax          = 63;\nconst unsigned int iCodedToken      = 64;   // base of coded tokens.\nconst unsigned int iCodedTokenMax   = 95;\nconst unsigned int iSHORT           = 96;   // fixed types.\nconst unsigned int iUSHORT          = 97;\nconst unsigned int iLONG            = 98;\nconst unsigned int iULONG           = 99;\nconst unsigned int iBYTE            = 100;\nconst unsigned int iSTRING          = 101;  // pool types.\nconst unsigned int iGUID            = 102;\nconst unsigned int iBLOB            = 103;\n\ninline int IsRidType(ULONG ix) {LIMITED_METHOD_CONTRACT;  return ix <= iRidMax; }\ninline int IsCodedTokenType(ULONG ix) {LIMITED_METHOD_CONTRACT;  return (ix >= iCodedToken) && (ix <= iCodedTokenMax); }\ninline int IsRidOrToken(ULONG ix) {LIMITED_METHOD_CONTRACT; return ix <= iCodedTokenMax; }\ninline int IsHeapType(ULONG ix) {LIMITED_METHOD_CONTRACT;  return ix >= iSTRING; }\ninline int IsFixedType(ULONG ix) {LIMITED_METHOD_CONTRACT;  return (ix < iSTRING) && (ix > iCodedTokenMax); }\n#endif\n\n\nenum MDPools {\n    MDPoolStrings,                      // Id for the string pool.\n    MDPoolGuids,                        // ...the GUID pool.\n    MDPoolBlobs,                        // ...the blob pool.\n    MDPoolUSBlobs,                      // ...the user string pool.\n\n    MDPoolCount,                        // Count of pools, for array sizing.\n}; // enum MDPools\n\n\nstruct CCodedTokenDef\n{\n    ULONG       m_cTokens;              // Count of tokens.\n    const mdToken *m_pTokens;           // Array of tokens.\n    const char  *m_pName;               // Name of the coded-token type.\n};\n\nstruct CMiniColDef\n{\n    BYTE        m_Type;                 // Type of the column.\n    BYTE        m_oColumn;              // Offset of the column.\n    BYTE        m_cbColumn;             // Size of the column.\n};\n\nstruct CMiniTableDef\n{\n    CMiniColDef *m_pColDefs;            // Array of field defs.\n    BYTE        m_cCols;                // Count of columns in the table.\n    BYTE        m_iKey;                 // Column which is the key, if any.\n    USHORT      m_cbRec;                // Size of the records.\n};\nstruct CMiniTableDefEx\n{\n    CMiniTableDef   m_Def;              // Table definition.\n    const char  * const *m_pColNames;   // Array of column names.\n    const char  *m_pName;               // Name of the table.\n};\n\n#endif // _METAMODELPUB_H_\n// eof ------------------------------------------------------------------------\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/mpl/type_list",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// Used in template metaprogramming, type lists consist of a series of\n// Scheme-like nodes that contain a Head type and a Tail type. The head\n// type is usually a non-list type, but compound lists are possible.\n//\n// Type lists are always terminated with a tail type of mpl::null_type.\n//\n\n#ifndef __type_list__\n#define __type_list__\n\nnamespace mpl // 'mpl' => 'meta-programming library'\n{\n    // Used as terminator in type_lists.\n    class null_type {};\n\n    // The core type. See file comment for details.\n    template <class T, class U>\n    struct type_list\n    {\n        typedef T head;\n        typedef U tail;\n    };\n\n    template <class TList, size_t IDX>\n    struct type_at;\n\n    template <class head, class tail, size_t IDX>\n    struct type_at<type_list<head, tail>, IDX>\n    { typedef typename type_at<tail, IDX-1>::type type; };\n\n    template <class head, class tail>\n    struct type_at<type_list<head, tail>, 0>\n    { typedef head type; };\n\n    // Helper struct to create a type_list chain from a list of arguments.\n    template\n    <\n        typename T1  = null_type, typename T2  = null_type, typename T3  = null_type,\n        typename T4  = null_type, typename T5  = null_type, typename T6  = null_type,\n        typename T7  = null_type, typename T8  = null_type, typename T9  = null_type,\n        typename T10 = null_type, typename T11 = null_type, typename T12 = null_type,\n        typename T13 = null_type, typename T14 = null_type, typename T15 = null_type,\n        typename T16 = null_type, typename T17 = null_type, typename T18 = null_type\n    >\n    struct make_type_list\n    {\n    private:\n        // recurse on the tail elements\n        typedef typename make_type_list<T2, T3, T4, T5, T6, T7, T8, T9, T10,\n                                        T11, T12, T13, T14, T15, T16, T17, T18>::type tail;\n\n    public:\n        // combine head with computed tail\n        typedef type_list<T1, tail> type;\n    };\n\n    template<>\n    struct make_type_list\n    <\n        null_type, null_type, null_type, null_type, null_type, null_type,\n        null_type, null_type, null_type, null_type, null_type, null_type,\n        null_type, null_type, null_type, null_type, null_type, null_type\n    >\n    {\n    public:\n        typedef null_type type;\n    };\n}\n\n#endif // __type_list__\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/mscoree.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n/**************************************************************************************\n **                                                                                  **\n ** Mscoree.idl - interface definitions for mscoree.dll                              **\n **                                                                                  **\n **************************************************************************************/\n\n//\n// Interface descriptions\n//\nimport \"unknwn.idl\";\n\ncpp_quote(\"struct IActivationFactory;\")\ninterface IActivationFactory;\n\ncpp_quote(\"struct IHostControl;\")\ninterface IHostControl;\n\ncpp_quote(\"struct ICLRControl;\")\ninterface ICLRControl;\n\n// IID ICLRRuntimeHost: uuid(90F1A06C-7712-4762-86B5-7A5EBA6BDB02)\ncpp_quote(\"EXTERN_GUID(IID_ICLRRuntimeHost, 0x90F1A06C, 0x7712, 0x4762, 0x86, 0xB5, 0x7A, 0x5E, 0xBA, 0x6B, 0xDB, 0x02);\")\n\n// IID ICLRRuntimeHost2: uuid(712AB73F-2C22-4807-AD7E-F501D7B72C2D)\ncpp_quote(\"EXTERN_GUID(IID_ICLRRuntimeHost2, 0x712AB73F, 0x2C22, 0x4807, 0xAD, 0x7E, 0xF5, 0x01, 0xD7, 0xb7, 0x2C, 0x2D);\")\n\n// IID ICLRRuntimeHost4: uuid(64F6D366-D7C2-4F1F-B4B2-E8160CAC43AF)\ncpp_quote(\"EXTERN_GUID(IID_ICLRRuntimeHost4, 0x64F6D366, 0xD7C2, 0x4F1F, 0xB4, 0xB2, 0xE8, 0x16, 0x0C, 0xAC, 0x43, 0xAF);\")\n\n#pragma midl_echo(\"typedef HRESULT  (STDAPICALLTYPE *FnGetCLRRuntimeHost)(REFIID riid, IUnknown **pUnk);\")\n\ntypedef HRESULT (__stdcall *FExecuteInAppDomainCallback) (void* cookie);\n\n// By default GC is concurrent and only the base system library is loaded into the domain-neutral area.\ntypedef enum {\n  STARTUP_CONCURRENT_GC         = 0x1,\n\n  STARTUP_LOADER_OPTIMIZATION_MASK = 0x3<<1,                    // loader optimization mask\n  STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN = 0x1<<1,           // no domain neutral loading\n  STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN = 0x2<<1,            // all domain neutral loading\n  STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST = 0x3<<1,       // strong name domain neutral loading\n\n\n  STARTUP_LOADER_SAFEMODE = 0x10,                               // Do not apply runtime version policy to the version passed in\n  STARTUP_LOADER_SETPREFERENCE = 0x100,                         // Set preferred runtime. Do not actally start it\n\n  STARTUP_SERVER_GC             = 0x1000,                       // Use server GC\n  STARTUP_HOARD_GC_VM           = 0x2000,                       // GC keeps virtual address used\n  STARTUP_SINGLE_VERSION_HOSTING_INTERFACE = 0x4000,                    // Disallow mixing hosting interface\n  STARTUP_LEGACY_IMPERSONATION             = 0x10000,                        // Do not flow impersonation across async points by default\n  STARTUP_DISABLE_COMMITTHREADSTACK        = 0x20000,           // Don't eagerly commit thread stack\n  STARTUP_ALWAYSFLOW_IMPERSONATION             = 0x40000,                        // Force flow impersonation across async points\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// (impersonations achieved thru p/invoke and managed will flow.\n  \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// default is to flow only managed impersonation)\n  STARTUP_TRIM_GC_COMMIT        = 0x80000,                      // GC uses less committed space when system memory low\n  STARTUP_ETW                   = 0x100000,\n  STARTUP_ARM                   = 0x400000,                     // Enable the ARM feature.\n  STARTUP_SINGLE_APPDOMAIN      = 0x800000,                      // application runs in default domain, no more domains are created\n  STARTUP_APPX_APP_MODEL        = 0x1000000,                     // jupiter app\n  STARTUP_DISABLE_RANDOMIZED_STRING_HASHING     = 0x2000000      // Disable the randomized string hashing (not supported)\n} STARTUP_FLAGS;\n\ntypedef enum\n{\n    APPDOMAIN_SECURITY_DEFAULT =0x0,\n    APPDOMAIN_SECURITY_SANDBOXED = 0x1,       // appdomain is sandboxed\n    APPDOMAIN_SECURITY_FORBID_CROSSAD_REVERSE_PINVOKE = 0x2,         // no cross ad reverse pinvokes\n    APPDOMAIN_IGNORE_UNHANDLED_EXCEPTIONS = 0x4, //\n    APPDOMAIN_FORCE_TRIVIAL_WAIT_OPERATIONS = 0x08, // do not pump messages during wait operations, do not call sync context\n    // When passed by the host, this flag will allow any assembly to perform PInvoke or COMInterop operations.\n    // Otherwise, by default, only platform assemblies can perform those operations.\n    APPDOMAIN_ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP = 0x10,\n\n    APPDOMAIN_ENABLE_PLATFORM_SPECIFIC_APPS = 0x40,\n    APPDOMAIN_ENABLE_ASSEMBLY_LOADFILE = 0x80,\n\n    APPDOMAIN_DISABLE_TRANSPARENCY_ENFORCEMENT = 0x100,\n} APPDOMAIN_SECURITY_FLAGS;\n\ntypedef enum {\n    WAIT_MSGPUMP = 0x1,\n    WAIT_ALERTABLE = 0x2,\n    WAIT_NOTINDEADLOCK = 0x4\n}WAIT_OPTION;\n\ntypedef enum {\n    // Default to minidump\n        DUMP_FLAVOR_Mini = 0,\n\n        // Include critical CLR state\n        DUMP_FLAVOR_CriticalCLRState = 1,\n\n        // Include critical CLR state and ngen images without including hosted heap\n        // It is host's responsibility to report hosted heap.\n        DUMP_FLAVOR_NonHeapCLRState = 2,\n\n    DUMP_FLAVOR_Default = DUMP_FLAVOR_Mini\n\n} ECustomDumpFlavor;\n\nconst DWORD BucketParamsCount = 10;\nconst DWORD BucketParamLength = 255;\n\n// used for indexing into BucketParameters::pszParams\ntypedef enum\n{\n    Parameter1 = 0,\n    Parameter2,\n    Parameter3,\n    Parameter4,\n    Parameter5,\n    Parameter6,\n    Parameter7,\n    Parameter8,\n    Parameter9,\n    InvalidBucketParamIndex\n} BucketParameterIndex;\n\ntypedef struct _BucketParameters\n{\n    BOOL  fInited;                                            // Set to TRUE if the rest of this structure is valid.\n    WCHAR pszEventTypeName[BucketParamLength];                // Name of the event type.\n    WCHAR pszParams[BucketParamsCount][BucketParamLength];    // Parameter strings.\n} BucketParameters;\n\n//*****************************************************************************\n// New interface for hosting mscoree\n//*****************************************************************************\n[\n    uuid(90F1A06C-7712-4762-86B5-7A5EBA6BDB02),\n    version(1.0),\n    helpstring(\"Common Language Runtime Hosting Interface\"),\n    pointer_default(unique),\n    local\n]\ninterface ICLRRuntimeHost : IUnknown\n{\n    // Starts the runtime. This is equivalent to CoInitializeCor().\n    HRESULT Start();\n\n    // Terminates the runtime, This is equivalent CoUninitializeCor();\n    HRESULT Stop();\n\n    // Returns an object for configuring runtime, e.g. threading, lock\n    // prior it starts.  If the runtime has been initialized this\n    // routine returns an error.  See IHostControl.\n    HRESULT SetHostControl([in] IHostControl* pHostControl);\n\n    HRESULT GetCLRControl([out] ICLRControl** pCLRControl);\n\n    HRESULT UnloadAppDomain([in] DWORD dwAppDomainId,\n                            [in] BOOL fWaitUntilDone);\n\n    HRESULT ExecuteInAppDomain([in] DWORD dwAppDomainId,\n                               [in] FExecuteInAppDomainCallback pCallback,\n                               [in] void* cookie);\n\n    HRESULT GetCurrentAppDomainId([out] DWORD *pdwAppDomainId);\n\n    HRESULT ExecuteApplication([in] LPCWSTR   pwzAppFullName,\n                               [in] DWORD     dwManifestPaths,\n                               [in] LPCWSTR   *ppwzManifestPaths,   // optional\n                               [in] DWORD     dwActivationData,\n                               [in] LPCWSTR   *ppwzActivationData,  // optional\n                               [out] int      *pReturnValue);\n\n    HRESULT ExecuteInDefaultAppDomain([in] LPCWSTR pwzAssemblyPath,\n                                      [in] LPCWSTR pwzTypeName,\n                                      [in] LPCWSTR pwzMethodName,\n                                      [in] LPCWSTR pwzArgument,\n                                      [out] DWORD  *pReturnValue);\n};\n\n//*****************************************************************************\n// New interface for hosting mscoree\n//*****************************************************************************\n[\n    object,\n    uuid(712AB73F-2C22-4807-AD7E-F501D7B72C2D),\n    version(2.0),\n    helpstring(\"Common Language Runtime Hosting Interface\"),\n    pointer_default(unique),\n    local\n]\ninterface ICLRRuntimeHost2 : ICLRRuntimeHost\n{\n    // Creates an app domain (sandboxed or not) with the given manager class and the given\n    // set of properties.\n    HRESULT CreateAppDomainWithManager([in] LPCWSTR wszFriendlyName,\n                                [in] DWORD dwFlags,\n                                [in] LPCWSTR wszAppDomainManagerAssemblyName,\n                                [in] LPCWSTR wszAppDomainManagerTypeName,\n                                [in] int nProperties,\n                                [in] LPCWSTR* pPropertyNames,\n                                [in] LPCWSTR* pPropertyValues,\n                                [out] DWORD* pAppDomainID);\n\n    HRESULT CreateDelegate([in] DWORD appDomainID,\n                                 [in] LPCWSTR wszAssemblyName,\n                                 [in] LPCWSTR wszClassName,\n                                 [in] LPCWSTR wszMethodName,\n                                 [out] INT_PTR* fnPtr);\n\n    // Authenticates a host based upon a key value. No longer required.\n    HRESULT Authenticate([in] ULONGLONG authKey);\n\n    // Ensures CLR-set Mac (Mach) EH port is registered.\n    HRESULT RegisterMacEHPort();\n\n    HRESULT SetStartupFlags([in] STARTUP_FLAGS dwFlags);\n\n    HRESULT DllGetActivationFactory([in] DWORD appDomainID,\n                                       [in] LPCWSTR wszTypeName,\n                                       [out] IActivationFactory ** factory);\n\n    HRESULT ExecuteAssembly([in] DWORD dwAppDomainId,\n                                 [in] LPCWSTR pwzAssemblyPath,\n                                 [in] int argc,\n                                 [in] LPCWSTR* argv,\n                                 [out] DWORD   *pReturnValue);\n\n};\n\n[\n    object,\n    uuid(64F6D366-D7C2-4F1F-B4B2-E8160CAC43AF),\n    version(4.0),\n    helpstring(\"Common Language Runtime Hosting Interface\"),\n    pointer_default(unique),\n    local\n]\ninterface ICLRRuntimeHost4 : ICLRRuntimeHost2\n{\n    HRESULT UnloadAppDomain2([in] DWORD dwAppDomainId,\n                                          [in] BOOL fWaitUntilDone,\n                                          [out] int *pLatchedExitCode);\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/msodw.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n#pragma once\n\n/****************************************************************************\n    This files contains the handshake structure with which apps will launch\n    Watson.\n****************************************************************************/\n\n#ifndef MSODW_H\n#define MSODW_H\n#pragma pack(push, msodw_h)\n#pragma pack(4)\n\n#define DW_MAX_BUCKETPARAM_CWC  255\n\ntypedef struct _GenericModeBlock\n{\n    BOOL fInited;\n    WCHAR wzEventTypeName[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP1[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP2[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP3[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP4[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP5[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP6[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP7[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP8[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP9[DW_MAX_BUCKETPARAM_CWC];\n    WCHAR wzP10[DW_MAX_BUCKETPARAM_CWC];\n} GenericModeBlock;\n\n#pragma pack(pop, msodw_h)\n#endif // MSODW_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/msodwwrap.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n#ifndef __msodwwrap_h__\n#define __msodwwrap_h__\n\n#ifndef MSODW_H\n#include \"msodw.h\"\n#endif // MSODW_H\n\n#endif // __msodwwrap_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/nativevaraccessors.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// The following are used to read and write data given NativeVarInfo\n// for primitive types. Don't use these for VALUECLASSes.\n//*****************************************************************************\n\n\n#ifndef _NATIVE_VAR_ACCESSORS_H_\n#define _NATIVE_VAR_ACCESSORS_H_\n\n#include \"corjit.h\"\n\nbool operator ==(const ICorDebugInfo::VarLoc &varLoc1,\n                 const ICorDebugInfo::VarLoc &varLoc2);\n\n#define MAX_NATIVE_VAR_LOCS 2\n\nSIZE_T GetRegOffsInCONTEXT(ICorDebugInfo::RegNum regNum);\n\nstruct NativeVarLocation\n{\n    ULONG64 addr;\n    TADDR size;\n    bool contextReg;\n};\n\nULONG NativeVarLocations(const ICorDebugInfo::VarLoc &   varLoc,\n                         PT_CONTEXT                      pCtx,\n                         ULONG                           numLocs,\n                         NativeVarLocation*              locs);\n\nSIZE_T *NativeVarStackAddr(const ICorDebugInfo::VarLoc &   varLoc,\n                           PT_CONTEXT                      pCtx);\n\nbool    GetNativeVarVal(const ICorDebugInfo::VarLoc &   varLoc,\n                        PT_CONTEXT                      pCtx,\n                        SIZE_T                      *   pVal1,\n                        SIZE_T                      *   pVal2\n                        BIT64_ARG(SIZE_T                cbSize));\n\nbool    SetNativeVarVal(const ICorDebugInfo::VarLoc &   varLoc,\n                        PT_CONTEXT                      pCtx,\n                        SIZE_T                          val1,\n                        SIZE_T                          val2\n                        BIT64_ARG(SIZE_T                cbSize));\n#endif // #ifndef _NATIVE_VAR_ACCESSORS_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/new.hpp",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n//\n\n#ifndef __new__hpp\n#define __new__hpp\n\n#if defined(_MSC_VER) && _MSC_VER < 1900\n#define NOEXCEPT\n#else\n#define NOEXCEPT noexcept\n#endif\n\nstruct NoThrow { int x; };\nextern const NoThrow nothrow;\n\nvoid * __cdecl operator new(size_t n, const NoThrow&) NOEXCEPT;\nvoid * __cdecl operator new[](size_t n, const NoThrow&) NOEXCEPT;\n\n#ifdef _DEBUG\nvoid DisableThrowCheck();\n#endif\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/nibblemapmacros.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef NIBBLEMAPMACROS_H_\n#define NIBBLEMAPMACROS_H_\n\n///////////////////////////////////////////////////////////////////////\n////   some mmgr stuff for JIT, especially for jit code blocks\n///////////////////////////////////////////////////////////////////////\n//\n// In order to quickly find the start of a jit code block\n// we keep track of all those positions via a map.\n// Each entry in this map represents 32 byte (a bucket) of the code heap.\n// We make the assumption that no two code-blocks can start in\n// the same 32byte bucket;\n// Additionally we assume that every code header is DWORD aligned.\n// Because we cannot guarantee that jitblocks always start at\n// multiples of 32 bytes we cannot use a simple bitmap; instead we\n// use a nibble (4 bit) per bucket and encode the offset of the header\n// inside the bucket (in DWORDS). In order to make initialization\n// easier we add one to the real offset, a nibble-value of zero\n// means that there is no header start in the resp. bucket.\n// In order to speed up \"backwards scanning\" we start numbering\n// nibbles inside a DWORD from the highest bits (28..31). Because\n// of that we can scan backwards inside the DWORD with right shifts.\n\n#if defined(HOST_64BIT)\n// TODO: bump up the windows CODE_ALIGN to 16 and iron out any nibble map bugs that exist.\n// TODO: there is something wrong with USE_INDIRECT_CODEHEADER with CODE_ALIGN=16\n# define CODE_ALIGN             4\n# define LOG2_CODE_ALIGN        2\n#else\n# define CODE_ALIGN             sizeof(DWORD)                                // 4 byte boundry\n# define LOG2_CODE_ALIGN        2\n#endif\n#define NIBBLE_MASK             0xf\n#define NIBBLE_SIZE             4                                            // 4 bits\n#define LOG2_NIBBLE_SIZE        2\n#define NIBBLES_PER_DWORD       ((8*sizeof(DWORD)) >> LOG2_NIBBLE_SIZE)      // 8 (4-bit) nibbles per dword\n#define NIBBLES_PER_DWORD_MASK  (NIBBLES_PER_DWORD - 1)                      // 7\n#define LOG2_NIBBLES_PER_DWORD  3\n#define BYTES_PER_BUCKET        (NIBBLES_PER_DWORD * CODE_ALIGN)             // 32 bytes per bucket\n#define LOG2_BYTES_PER_BUCKET   (LOG2_CODE_ALIGN + LOG2_NIBBLES_PER_DWORD)   //  5 bits per bucket\n#define MASK_BYTES_PER_BUCKET   (BYTES_PER_BUCKET - 1)                       // 31\n#define HIGHEST_NIBBLE_BIT      (32 - NIBBLE_SIZE)                           // 28 (i.e 32 - 4)\n#define HIGHEST_NIBBLE_MASK     (NIBBLE_MASK << HIGHEST_NIBBLE_BIT)          // 0xf0000000\n\n#define ADDR2POS(x)                      ((x) >> LOG2_BYTES_PER_BUCKET)\n#define ADDR2OFFS(x)            (DWORD)  ((((x) & MASK_BYTES_PER_BUCKET) >> LOG2_CODE_ALIGN) + 1)\n#define POSOFF2ADDR(pos, of)    (size_t) (((pos) << LOG2_BYTES_PER_BUCKET) + (((of) - 1) << LOG2_CODE_ALIGN))\n#define HEAP2MAPSIZE(x)                  (((x) / (BYTES_PER_BUCKET * NIBBLES_PER_DWORD)) * CODE_ALIGN)\n#define POS2SHIFTCOUNT(x)       (DWORD)  (HIGHEST_NIBBLE_BIT - (((x) & NIBBLES_PER_DWORD_MASK) << LOG2_NIBBLE_SIZE))\n#define POS2MASK(x)             (DWORD) ~(HIGHEST_NIBBLE_MASK >> (((x) & NIBBLES_PER_DWORD_MASK) << LOG2_NIBBLE_SIZE))\n\n#endif  // NIBBLEMAPMACROS_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/nibblestream.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// NibbleStream reader and writer.\n\n\n#ifndef _NIBBLESTREAM_H_\n#define _NIBBLESTREAM_H_\n\n#include \"contract.h\"\n#include \"sigbuilder.h\"\n\ntypedef BYTE NIBBLE;\n\n//-----------------------------------------------------------------------------\n// Helpers for compression routines.\n//-----------------------------------------------------------------------------\n// This class allows variable-length compression of DWORDs.\n//\n// A value can be stored using one or more nibbles. 3 bits of a nibble are used\n// to store 3 bits of the value, and the top bit indicates if  the following nibble\n// contains rest of the value. If the top bit is not set, then this\n// nibble is the last part of the value.\n// The higher bits of the value are written out first, and the lowest 3 bits\n// are written out last.\n//\n// In the encoded stream of bytes, the lower nibble of a byte is used before\n// the high nibble.\n//\n// A binary value ABCDEFGHI (where A is the highest bit) is encoded as\n// the follow two bytes : 1DEF1ABC XXXX0GHI\n//\n// Examples :\n// 0            => X0\n// 1            => X1\n//\n// 7            => X7\n// 8            => 09\n// 9            => 19\n//\n// 0x3F (63)    => 7F\n// 0x40 (64)    => F9 X0\n// 0x41 (65)    => F9 X1\n//\n// 0x1FF (511)  => FF X7\n// 0x200 (512)  => 89 08\n// 0x201 (513)  => 89 18\n\nclass NibbleWriter\n{\npublic:\n    NibbleWriter()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_fPending = false;\n    }\n\n    void Flush()\n    {\n        if (m_fPending)\n            m_SigBuilder.AppendByte(m_PendingNibble);\n    }\n\n    PVOID GetBlob(DWORD * pdwLength)\n    {\n        return m_SigBuilder.GetSignature(pdwLength);\n    }\n\n    DWORD GetBlobLength()\n    {\n        return m_SigBuilder.GetSignatureLength();\n    }\n\n//.............................................................................\n// Writer methods\n//.............................................................................\n\n\n    // Write a single nibble to the stream.\n    void WriteNibble(NIBBLE i)\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n        }\n        CONTRACTL_END;\n\n        _ASSERTE(i <= 0xF);\n\n        if (m_fPending)\n        {\n            // Use the high nibble after the low nibble is used\n            m_SigBuilder.AppendByte(m_PendingNibble | (i << 4));\n            m_fPending = false;\n        }\n        else\n        {\n            // Use the low nibble first\n            m_PendingNibble = i;\n            m_fPending = true;\n        }\n    }\n\n    // Write an unsigned int via variable length nibble encoding.\n    // We use the bit scheme:\n    // 0ABC (if 0 <= dw <= 0x7)\n    // 1ABC 0DEF (if 0 <= dw <= 0x7f)\n    // 1ABC 1DEF 0GHI (if 0 <= dw <= 0x7FF)\n    // etc..\n\n    void WriteEncodedU32(DWORD dw)\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n        }\n        CONTRACTL_END;\n\n        // Fast path for common small inputs\n        if (dw <= 63)\n        {\n            if (dw > 7)\n            {\n                WriteNibble((NIBBLE) ((dw >> 3) | 8));\n            }\n\n            WriteNibble((NIBBLE) (dw & 7));\n            return;\n        }\n\n        // Note we must write this out with the low terminating nibble (0ABC) last b/c the\n        // reader gets nibbles in the same order we write them.\n        int i = 0;\n        while ((dw >> i) > 7)\n        {\n            i+= 3;\n        }\n        while(i > 0)\n        {\n            WriteNibble((NIBBLE) ((dw >> i) & 0x7) | 0x8);\n            i -= 3;\n        }\n        WriteNibble((NIBBLE) dw & 0x7);\n    }\n\n    // Write a signed 32 bit value.\n    void WriteEncodedI32(int x)\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n        }\n        CONTRACTL_END;\n\n        DWORD dw = (x < 0) ? (((-x) << 1) + 1) : (x << 1);\n        WriteEncodedU32(dw);\n    };\n\n    void WriteUnencodedU32(uint32_t x)\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n        }\n        CONTRACTL_END;\n\n        for (int i = 0; i < 8; i++)\n        {\n            WriteNibble(static_cast<NIBBLE>(x & 0b1111));\n            x >>= 4;\n        }\n    }\n\nprotected:\n    NIBBLE m_PendingNibble;     // Pending value, not yet written out.\n    bool m_fPending;\n\n    // SigBuilder is a convenient helper class for writing out small blobs\n    SigBuilder m_SigBuilder;\n};\n\n//-----------------------------------------------------------------------------\n\nclass NibbleReader\n{\npublic:\n    NibbleReader(PTR_BYTE pBuffer, size_t size)\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n        _ASSERTE(pBuffer != NULL);\n\n        m_pBuffer = pBuffer;\n        m_cBytes = size;\n        m_cNibble = 0;\n    }\n\n    // Get the index of the next Byte.\n    // This tells us how many bytes (rounding up to whole bytes) have been read.\n    // This is can be used to extract raw byte data that may be embedded on a byte boundary in the nibble stream.\n    size_t GetNextByteIndex()\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n\n        return (m_cNibble + 1) / 2;\n    }\n\n    NIBBLE ReadNibble()\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n            SUPPORTS_DAC;\n        }\n        CONTRACTL_END;\n\n        NIBBLE i = 0;\n        // Bufer should have been allocated large enough to hold data.\n        if (!(m_cNibble / 2 < m_cBytes))\n        {\n            // We should never get here in a normal retail scenario.\n            // We could wind up here if somebody provided us invalid data (maybe by corrupting an ngenned image).\n            EX_THROW(HRException, (E_INVALIDARG));\n        }\n\n        BYTE p = m_pBuffer[m_cNibble / 2];\n        if ((m_cNibble & 1) == 0)\n        {\n            // Read the low nibble first\n            i = (NIBBLE) (p & 0xF);\n        }\n        else\n        {\n            // Read the high nibble after the low nibble has been read\n            i = (NIBBLE) (p >> 4) & 0xF;\n        }\n        m_cNibble++;\n\n        return i;\n    }\n\n    // Read an unsigned int that was encoded via variable length nibble encoding\n    // from NibbleWriter::WriteEncodedU32.\n    DWORD ReadEncodedU32()\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n            SUPPORTS_DAC;\n        }\n        CONTRACTL_END;\n\n        DWORD dw =0;\n\n#if defined(_DEBUG) || defined(DACCESS_COMPILE)\n        int dwCount = 0;\n#endif\n\n        // The encoding is variably lengthed, with the high-bit of every nibble indicating whether\n        // there is another nibble in the value.  Each nibble contributes 3 bits to the value.\n        NIBBLE n;\n        do\n        {\n#if defined(_DEBUG) || defined(DACCESS_COMPILE)\n            // If we've already read 11 nibbles (with 3 bits of usable data each), then we\n            // should be done reading a 32-bit integer.\n            // Avoid working with corrupted data and potentially long loops by failing\n            if(dwCount > 11)\n            {\n                _ASSERTE_MSG(false, \"Corrupt nibble stream - value exceeded 32-bits in size\");\n#ifdef DACCESS_COMPILE\n                DacError(CORDBG_E_TARGET_INCONSISTENT);\n#endif\n            }\n            dwCount++;\n#endif\n\n            n = ReadNibble();\n            dw = (dw << 3) + (n & 0x7);\n        } while((n & 0x8) > 0);\n\n        return dw;\n    }\n\n    int ReadEncodedI32()\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n            SUPPORTS_DAC;\n        }\n        CONTRACTL_END;\n\n        DWORD dw = ReadEncodedU32();\n        int x = dw >> 1;\n        return (dw & 1) ? (-x) : (x);\n    }\n\n    DWORD ReadUnencodedU32()\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n            SUPPORTS_DAC;\n        }\n        CONTRACTL_END;\n\n        DWORD result = 0;\n\n        for (int i = 0; i < 8; i++)\n        {\n            result |= static_cast<DWORD>(ReadNibble()) << (i * 4);\n        }\n\n        return result;\n    }\n\nprotected:\n    PTR_BYTE m_pBuffer;\n    size_t m_cBytes; // size of buffer.\n    size_t m_cNibble; // Which nibble are we at?\n};\n\n\n\n#endif // _NIBBLESTREAM_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/nsutilpriv.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// NSUtilPriv.h\n//\n// Helpers for converting namespace separators.\n//\n//*****************************************************************************\n\n#ifndef __NSUTILPRIV_H__\n#define __NSUTILPRIV_H__\n\ntemplate <class T> class CQuickArray;\nclass SString;\n\nstruct ns\n{\n\n//*****************************************************************************\n// Determine how many chars large a fully qualified name would be given the\n// two parts of the name.  The return value includes room for every character\n// in both names, as well as room for the separator and a final terminator.\n//*****************************************************************************\nstatic\nint GetFullLength(                      // Number of chars in full name.\n    const WCHAR *szNameSpace,           // Namspace for value.\n    const WCHAR *szName);               // Name of value.\n\nstatic\nint GetFullLength(                      // Number of chars in full name.\n    LPCUTF8     szNameSpace,            // Namspace for value.\n    LPCUTF8     szName);                // Name of value.\n\n//*****************************************************************************\n// Scan the given string to see if the name contains any invalid characters\n// that are not allowed.\n//*****************************************************************************\nstatic\nint IsValidName(                        // true if valid, false invalid.\n    const WCHAR *szName);               // Name to parse.\n\nstatic\nint IsValidName(                        // true if valid, false invalid.\n    LPCUTF8     szName);                // Name to parse.\n\n\n//*****************************************************************************\n// Scan the string from the rear looking for the first valid separator.  If\n// found, return a pointer to it.  Else return null.  This code is smart enough\n// to skip over special sequences, such as:\n//      a.b..ctor\n//         ^\n//         |\n// The \".ctor\" is considered one token.\n//*****************************************************************************\nstatic\nWCHAR *FindSep(                         // Pointer to separator or null.\n    const WCHAR *szPath);               // The path to look in.\n\nstatic\nLPUTF8 FindSep(                         // Pointer to separator or null.\n    LPCUTF8     szPath);                // The path to look in.\n\n\n//*****************************************************************************\n// Take a path and find the last separator (nsFindSep), and then replace the\n// separator with a '\\0' and return a pointer to the name.  So for example:\n//      a.b.c\n// becomes two strings \"a.b\" and \"c\" and the return value points to \"c\".\n//*****************************************************************************\nstatic\nWCHAR *SplitInline(                     // Pointer to name portion.\n    __inout __inout_z WCHAR       *szPath);               // The path to split.\n\nstatic\nLPUTF8       SplitInline(               // Pointer to name portion.\n    __inout __inout_z LPUTF8      szPath);                // The path to split.\n\nstatic\nvoid SplitInline(\n    __inout __inout_z LPWSTR     szPath,                  // Path to split.\n    LPCWSTR      &szNameSpace,          // Return pointer to namespace.\n    LPCWSTR     &szName);               // Return pointer to name.\n\nstatic\nvoid SplitInline(\n    __inout __inout_z LPUTF8       szPath,                // Path to split.\n    LPCUTF8      &szNameSpace,          // Return pointer to namespace.\n    LPCUTF8      &szName);              // Return pointer to name.\n\n\n//*****************************************************************************\n// Split the last parsable element from the end of the string as the name,\n// the first part as the namespace.\n//*****************************************************************************\nstatic\nint SplitPath(                          // true ok, false trunction.\n    const WCHAR *szPath,                // Path to split.\n    _Out_writes_opt_ (cchNameSpace) WCHAR *szNameSpace,           // Output for namespace value.\n    int         cchNameSpace,           // Max chars for output.\n    _Out_writes_opt_ (cchName) WCHAR       *szName,                // Output for name.\n    int         cchName);               // Max chars for output.\n\nstatic\nint SplitPath(                          // true ok, false trunction.\n    LPCUTF8     szPath,                 // Path to split.\n    _Out_writes_opt_ (cchNameSpace) LPUTF8 szNameSpace,            // Output for namespace value.\n    int         cchNameSpace,           // Max chars for output.\n    _Out_writes_opt_ (cchName) LPUTF8      szName,                 // Output for name.\n    int         cchName);               // Max chars for output.\n\n\n//*****************************************************************************\n// Take two values and put them together in a fully qualified path using the\n// correct separator.\n//*****************************************************************************\nstatic\nint MakePath(                           // true ok, false truncation.\n    _Out_writes_(cchChars) WCHAR       *szOut,                 // output path for name.\n    int         cchChars,               // max chars for output path.\n    const WCHAR *szNameSpace,           // Namespace.\n    const WCHAR *szName);               // Name.\n\nstatic\nint MakePath(                           // true ok, false truncation.\n    _Out_writes_(cchChars) LPUTF8      szOut,                  // output path for name.\n    int         cchChars,               // max chars for output path.\n    LPCUTF8     szNameSpace,            // Namespace.\n    LPCUTF8     szName);                // Name.\n\nstatic\nint MakePath(                           // true ok, false truncation.\n    _Out_writes_(cchChars) WCHAR       *szOut,                 // output path for name.\n    int         cchChars,               // max chars for output path.\n    LPCUTF8     szNameSpace,            // Namespace.\n    LPCUTF8     szName);                // Name.\n\nstatic\nint MakePath(                           // true ok, false out of memory\n    CQuickBytes &qb,                    // Where to put results.\n    LPCUTF8     szNameSpace,            // Namespace for name.\n    LPCUTF8     szName);                // Final part of name.\n\nstatic\nint MakePath(                           // true ok, false out of memory\n    CQuickArray<WCHAR> &qa,             // Where to put results.\n    LPCUTF8     szNameSpace,            // Namespace for name.\n    LPCUTF8     szName);                // Final part of name.\n\nstatic\nint MakePath(                           // true ok, false out of memory\n    CQuickBytes &qb,                    // Where to put results.\n    const WCHAR *szNameSpace,           // Namespace for name.\n    const WCHAR *szName);               // Final part of name.\n\nstatic\nvoid MakePath(                          // throws on out of memory\n    SString       &ssBuf,               // Where to put results.\n    const SString &ssNameSpace,         // Namespace for name.\n    const SString &ssName);             // Final part of name.\n\n//*****************************************************************************\n// Concatinate type names to assembly names\n//*****************************************************************************\nstatic\nbool MakeAssemblyQualifiedName(                                  // true if ok, false if out of memory\n                               CQuickBytes &qb,                  // location to put result\n                               const WCHAR *szTypeName,          // Type name\n                               const WCHAR *szAssemblyName);     // Assembly Name\n\nstatic\nbool MakeAssemblyQualifiedName(                                        // true ok, false truncation\n                               _Out_writes_ (dwBuffer) WCHAR* pBuffer, // Buffer to receive the results\n                               int    dwBuffer,                        // Number of characters total in buffer\n                               const WCHAR *szTypeName,                // Namespace for name.\n                               int   dwTypeName,                       // Number of characters (not including null)\n                               const WCHAR *szAssemblyName,            // Final part of name.\n                               int   dwAssemblyName);                  // Number of characters (not including null)\n\nstatic\nint MakeNestedTypeName(                 // true ok, false out of memory\n    CQuickBytes &qb,                    // Where to put results.\n    LPCUTF8     szEnclosingName,        // Full name for enclosing type\n    LPCUTF8     szNestedName);          // Full name for nested type\n\nstatic\nint MakeNestedTypeName(                 // true ok, false truncation.\n    _Out_writes_ (cchChars) LPUTF8      szOut,                  // output path for name.\n    int         cchChars,               // max chars for output path.\n    LPCUTF8     szEnclosingName,        // Full name for enclosing type\n    LPCUTF8     szNestedName);          // Full name for nested type\n\nstatic\nvoid MakeNestedTypeName(                // throws on out of memory\n    SString        &ssBuf,              // output path for name.\n    const SString  &ssEnclosingName,    // Full name for enclosing type\n    const SString  &ssNestedName);      // Full name for nested type\n}; // struct ns\n\n#ifndef NAMESPACE_SEPARATOR_CHAR\n#define NAMESPACE_SEPARATOR_CHAR '.'\n#define NAMESPACE_SEPARATOR_WCHAR W('.')\n#define NAMESPACE_SEPARATOR_STR \".\"\n#define NAMESPACE_SEPARATOR_WSTR W(\".\")\n#define NAMESPACE_SEPARATOR_LEN 1\n#define ASSEMBLY_SEPARATOR_CHAR ','\n#define ASSEMBLY_SEPARATOR_WCHAR W(',')\n#define ASSEMBLY_SEPARATOR_STR \", \"\n#define ASSEMBLY_SEPARATOR_WSTR W(\", \")\n#define ASSEMBLY_SEPARATOR_LEN 2\n#define BACKSLASH_CHAR '\\\\'\n#define BACKSLASH_WCHAR W('\\\\')\n#define NESTED_SEPARATOR_CHAR '+'\n#define NESTED_SEPARATOR_WCHAR W('+')\n#define NESTED_SEPARATOR_STR \"+\"\n#define NESTED_SEPARATOR_WSTR W(\"+\")\n#endif\n\n#define EMPTY_STR \"\"\n#define EMPTY_WSTR W(\"\")\n\n#define MAKE_FULL_PATH_ON_STACK_UTF8(toptr, pnamespace, pname) \\\n{ \\\n    int __i##toptr = ns::GetFullLength(pnamespace, pname); \\\n    toptr = (char *) alloca(__i##toptr); \\\n    ns::MakePath(toptr, __i##toptr, pnamespace, pname); \\\n}\n\n#define MAKE_FULL_PATH_ON_STACK_UNICODE(toptr, pnamespace, pname) \\\n{ \\\n    int __i##toptr = ns::GetFullLength(pnamespace, pname); \\\n    toptr = (WCHAR *) alloca(__i##toptr * sizeof(WCHAR)); \\\n    ns::MakePath(toptr, __i##toptr, pnamespace, pname); \\\n}\n\n#define MAKE_FULLY_QUALIFIED_NAME(pszFullyQualifiedName, pszNameSpace, pszName) MAKE_FULL_PATH_ON_STACK_UTF8(pszFullyQualifiedName, pszNameSpace, pszName)\n\n#define MAKE_FULLY_QUALIFIED_MEMBER_NAME(ptr, pszNameSpace, pszClassName, pszMemberName, pszSig) \\\n{ \\\n    int __i##ptr = ns::GetFullLength(pszNameSpace, pszClassName); \\\n    __i##ptr += (pszMemberName ? (int) strlen(pszMemberName) : 0); \\\n    __i##ptr += (NAMESPACE_SEPARATOR_LEN * 2); \\\n    __i##ptr += (pszSig ? (int) strlen(pszSig) : 0); \\\n    ptr = (LPUTF8) alloca(__i##ptr); \\\n    ns::MakePath(ptr, __i##ptr, pszNameSpace, pszClassName); \\\n    if (pszMemberName) { \\\n        strcat_s(ptr, __i##ptr, NAMESPACE_SEPARATOR_STR); \\\n        strcat_s(ptr, __i##ptr, pszMemberName); \\\n    } \\\n    if (pszSig) { \\\n        if (! pszMemberName) \\\n            strcat_s(ptr, __i##ptr, NAMESPACE_SEPARATOR_STR); \\\n        strcat_s(ptr, __i##ptr, pszSig); \\\n    } \\\n}\n\n#ifdef _PREFAST_\n// need to eliminate the expansion of MAKE_FULLY_QUALIFIED_MEMBER_NAME in prefast\n// builds to prevent it complaining about the potential for NULLs to strlen and strcat\n#undef MAKE_FULLY_QUALIFIED_MEMBER_NAME\n// need to set ptr=NULL so we don't get a build error because ptr isn't inited in a couple cases\n#define MAKE_FULLY_QUALIFIED_MEMBER_NAME(ptr, pszNameSpace, pszClassName, pszMemberName, pszSig) ptr=NULL;\n#endif\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/opcode.def",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** Opcode.def - COM+ Intrinsic Opcodes and Macros.                         **\n **                                                                         **\n ** This is the master table from which all opcode lists                    **\n ** are derived.  New instructions must be added to this                    **\n ** table and generators run to produce the lookup tables                   **\n ** used by the interpreter loop.                                           **\n **                                                                         **\n ** Stack Behaviour is describing the number of 4 byte                      **\n ** slots pushed and Poped.                                                 **\n **                                                                         **\n *****************************************************************************/\n\n\n#ifndef __OPCODE_DEF_\n#define __OPCODE_DEF_\n\n#define MOOT    0x00    // Marks unused second byte when encoding single\n#define STP1    0xFE    // Prefix code 1 for Standard Map\n#define REFPRE  0xFF    // Prefix for Reference Code Encoding\n#define RESERVED_PREFIX_START 0xF7\n\n#endif\n\n// If the first byte of the standard encoding is 0xFF, then\n// the second byte can be used as 1 byte encoding.  Otherwise                                                               l   b         b\n// the encoding is two bytes.                                                                                               e   y         y\n//                                                                                                                          n   t         t\n//                                                                                                                          g   e         e\n//                                                                                                           (unused)       t\n//  Canonical Name                    String Name              Stack Behaviour           Operand Params    Opcode Kind      h   1         2    Control Flow\n// -------------------------------------------------------------------------------------------------------------------------------------------------------\nOPDEF(CEE_NOP,                        \"nop\",              Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x00,    NEXT)\nOPDEF(CEE_BREAK,                      \"break\",            Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x01,    BREAK)\nOPDEF(CEE_LDARG_0,                    \"ldarg.0\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x02,    NEXT)\nOPDEF(CEE_LDARG_1,                    \"ldarg.1\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x03,    NEXT)\nOPDEF(CEE_LDARG_2,                    \"ldarg.2\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x04,    NEXT)\nOPDEF(CEE_LDARG_3,                    \"ldarg.3\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x05,    NEXT)\nOPDEF(CEE_LDLOC_0,                    \"ldloc.0\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x06,    NEXT)\nOPDEF(CEE_LDLOC_1,                    \"ldloc.1\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x07,    NEXT)\nOPDEF(CEE_LDLOC_2,                    \"ldloc.2\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x08,    NEXT)\nOPDEF(CEE_LDLOC_3,                    \"ldloc.3\",          Pop0,               Push1,       InlineNone,         IMacro,      1,  0xFF,    0x09,    NEXT)\nOPDEF(CEE_STLOC_0,                    \"stloc.0\",          Pop1,               Push0,       InlineNone,         IMacro,      1,  0xFF,    0x0A,    NEXT)\nOPDEF(CEE_STLOC_1,                    \"stloc.1\",          Pop1,               Push0,       InlineNone,         IMacro,      1,  0xFF,    0x0B,    NEXT)\nOPDEF(CEE_STLOC_2,                    \"stloc.2\",          Pop1,               Push0,       InlineNone,         IMacro,      1,  0xFF,    0x0C,    NEXT)\nOPDEF(CEE_STLOC_3,                    \"stloc.3\",          Pop1,               Push0,       InlineNone,         IMacro,      1,  0xFF,    0x0D,    NEXT)\nOPDEF(CEE_LDARG_S,                    \"ldarg.s\",          Pop0,               Push1,       ShortInlineVar,     IMacro,      1,  0xFF,    0x0E,    NEXT)\nOPDEF(CEE_LDARGA_S,                   \"ldarga.s\",         Pop0,               PushI,       ShortInlineVar,     IMacro,      1,  0xFF,    0x0F,    NEXT)\nOPDEF(CEE_STARG_S,                    \"starg.s\",          Pop1,               Push0,       ShortInlineVar,     IMacro,      1,  0xFF,    0x10,    NEXT)\nOPDEF(CEE_LDLOC_S,                    \"ldloc.s\",          Pop0,               Push1,       ShortInlineVar,     IMacro,      1,  0xFF,    0x11,    NEXT)\nOPDEF(CEE_LDLOCA_S,                   \"ldloca.s\",         Pop0,               PushI,       ShortInlineVar,     IMacro,      1,  0xFF,    0x12,    NEXT)\nOPDEF(CEE_STLOC_S,                    \"stloc.s\",          Pop1,               Push0,       ShortInlineVar,     IMacro,      1,  0xFF,    0x13,    NEXT)\nOPDEF(CEE_LDNULL,                     \"ldnull\",           Pop0,               PushRef,     InlineNone,         IPrimitive,  1,  0xFF,    0x14,    NEXT)\nOPDEF(CEE_LDC_I4_M1,                  \"ldc.i4.m1\",        Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x15,    NEXT)\nOPDEF(CEE_LDC_I4_0,                   \"ldc.i4.0\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x16,    NEXT)\nOPDEF(CEE_LDC_I4_1,                   \"ldc.i4.1\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x17,    NEXT)\nOPDEF(CEE_LDC_I4_2,                   \"ldc.i4.2\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x18,    NEXT)\nOPDEF(CEE_LDC_I4_3,                   \"ldc.i4.3\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x19,    NEXT)\nOPDEF(CEE_LDC_I4_4,                   \"ldc.i4.4\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x1A,    NEXT)\nOPDEF(CEE_LDC_I4_5,                   \"ldc.i4.5\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x1B,    NEXT)\nOPDEF(CEE_LDC_I4_6,                   \"ldc.i4.6\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x1C,    NEXT)\nOPDEF(CEE_LDC_I4_7,                   \"ldc.i4.7\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x1D,    NEXT)\nOPDEF(CEE_LDC_I4_8,                   \"ldc.i4.8\",         Pop0,               PushI,       InlineNone,         IMacro,      1,  0xFF,    0x1E,    NEXT)\nOPDEF(CEE_LDC_I4_S,                   \"ldc.i4.s\",         Pop0,               PushI,       ShortInlineI,       IMacro,      1,  0xFF,    0x1F,    NEXT)\nOPDEF(CEE_LDC_I4,                     \"ldc.i4\",           Pop0,               PushI,       InlineI,            IPrimitive,  1,  0xFF,    0x20,    NEXT)\nOPDEF(CEE_LDC_I8,                     \"ldc.i8\",           Pop0,               PushI8,      InlineI8,           IPrimitive,  1,  0xFF,    0x21,    NEXT)\nOPDEF(CEE_LDC_R4,                     \"ldc.r4\",           Pop0,               PushR4,      ShortInlineR,       IPrimitive,  1,  0xFF,    0x22,    NEXT)\nOPDEF(CEE_LDC_R8,                     \"ldc.r8\",           Pop0,               PushR8,      InlineR,            IPrimitive,  1,  0xFF,    0x23,    NEXT)\nOPDEF(CEE_UNUSED49,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x24,    NEXT)\nOPDEF(CEE_DUP,                        \"dup\",              Pop1,               Push1+Push1, InlineNone,         IPrimitive,  1,  0xFF,    0x25,    NEXT)\nOPDEF(CEE_POP,                        \"pop\",              Pop1,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x26,    NEXT)\nOPDEF(CEE_JMP,                        \"jmp\",              Pop0,               Push0,       InlineMethod,       IPrimitive,  1,  0xFF,    0x27,    CALL)\nOPDEF(CEE_CALL,                       \"call\",             VarPop,             VarPush,     InlineMethod,       IPrimitive,  1,  0xFF,    0x28,    CALL)\nOPDEF(CEE_CALLI,                      \"calli\",            VarPop,             VarPush,     InlineSig,          IPrimitive,  1,  0xFF,    0x29,    CALL)\nOPDEF(CEE_RET,                        \"ret\",              VarPop,             Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x2A,    RETURN)\nOPDEF(CEE_BR_S,                       \"br.s\",             Pop0,               Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x2B,    BRANCH)\nOPDEF(CEE_BRFALSE_S,                  \"brfalse.s\",        PopI,               Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x2C,    COND_BRANCH)\nOPDEF(CEE_BRTRUE_S,                   \"brtrue.s\",         PopI,               Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x2D,    COND_BRANCH)\nOPDEF(CEE_BEQ_S,                      \"beq.s\",            Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x2E,    COND_BRANCH)\nOPDEF(CEE_BGE_S,                      \"bge.s\",            Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x2F,    COND_BRANCH)\nOPDEF(CEE_BGT_S,                      \"bgt.s\",            Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x30,    COND_BRANCH)\nOPDEF(CEE_BLE_S,                      \"ble.s\",            Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x31,    COND_BRANCH)\nOPDEF(CEE_BLT_S,                      \"blt.s\",            Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x32,    COND_BRANCH)\nOPDEF(CEE_BNE_UN_S,                   \"bne.un.s\",         Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x33,    COND_BRANCH)\nOPDEF(CEE_BGE_UN_S,                   \"bge.un.s\",         Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x34,    COND_BRANCH)\nOPDEF(CEE_BGT_UN_S,                   \"bgt.un.s\",         Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x35,    COND_BRANCH)\nOPDEF(CEE_BLE_UN_S,                   \"ble.un.s\",         Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x36,    COND_BRANCH)\nOPDEF(CEE_BLT_UN_S,                   \"blt.un.s\",         Pop1+Pop1,          Push0,       ShortInlineBrTarget,IMacro,      1,  0xFF,    0x37,    COND_BRANCH)\nOPDEF(CEE_BR,                         \"br\",               Pop0,               Push0,       InlineBrTarget,     IPrimitive,  1,  0xFF,    0x38,    BRANCH)\nOPDEF(CEE_BRFALSE,                    \"brfalse\",          PopI,               Push0,       InlineBrTarget,     IPrimitive,  1,  0xFF,    0x39,    COND_BRANCH)\nOPDEF(CEE_BRTRUE,                     \"brtrue\",           PopI,               Push0,       InlineBrTarget,     IPrimitive,  1,  0xFF,    0x3A,    COND_BRANCH)\nOPDEF(CEE_BEQ,                        \"beq\",              Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x3B,    COND_BRANCH)\nOPDEF(CEE_BGE,                        \"bge\",              Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x3C,    COND_BRANCH)\nOPDEF(CEE_BGT,                        \"bgt\",              Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x3D,    COND_BRANCH)\nOPDEF(CEE_BLE,                        \"ble\",              Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x3E,    COND_BRANCH)\nOPDEF(CEE_BLT,                        \"blt\",              Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x3F,    COND_BRANCH)\nOPDEF(CEE_BNE_UN,                     \"bne.un\",           Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x40,    COND_BRANCH)\nOPDEF(CEE_BGE_UN,                     \"bge.un\",           Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x41,    COND_BRANCH)\nOPDEF(CEE_BGT_UN,                     \"bgt.un\",           Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x42,    COND_BRANCH)\nOPDEF(CEE_BLE_UN,                     \"ble.un\",           Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x43,    COND_BRANCH)\nOPDEF(CEE_BLT_UN,                     \"blt.un\",           Pop1+Pop1,          Push0,       InlineBrTarget,     IMacro,      1,  0xFF,    0x44,    COND_BRANCH)\nOPDEF(CEE_SWITCH,                     \"switch\",           PopI,               Push0,       InlineSwitch,       IPrimitive,  1,  0xFF,    0x45,    COND_BRANCH)\nOPDEF(CEE_LDIND_I1,                   \"ldind.i1\",         PopI,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x46,    NEXT)\nOPDEF(CEE_LDIND_U1,                   \"ldind.u1\",         PopI,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x47,    NEXT)\nOPDEF(CEE_LDIND_I2,                   \"ldind.i2\",         PopI,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x48,    NEXT)\nOPDEF(CEE_LDIND_U2,                   \"ldind.u2\",         PopI,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x49,    NEXT)\nOPDEF(CEE_LDIND_I4,                   \"ldind.i4\",         PopI,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x4A,    NEXT)\nOPDEF(CEE_LDIND_U4,                   \"ldind.u4\",         PopI,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x4B,    NEXT)\nOPDEF(CEE_LDIND_I8,                   \"ldind.i8\",         PopI,               PushI8,      InlineNone,         IPrimitive,  1,  0xFF,    0x4C,    NEXT)\nOPDEF(CEE_LDIND_I,                    \"ldind.i\",          PopI,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x4D,    NEXT)\nOPDEF(CEE_LDIND_R4,                   \"ldind.r4\",         PopI,               PushR4,      InlineNone,         IPrimitive,  1,  0xFF,    0x4E,    NEXT)\nOPDEF(CEE_LDIND_R8,                   \"ldind.r8\",         PopI,               PushR8,      InlineNone,         IPrimitive,  1,  0xFF,    0x4F,    NEXT)\nOPDEF(CEE_LDIND_REF,                  \"ldind.ref\",        PopI,               PushRef,     InlineNone,         IPrimitive,  1,  0xFF,    0x50,    NEXT)\nOPDEF(CEE_STIND_REF,                  \"stind.ref\",        PopI+PopI,          Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x51,    NEXT)\nOPDEF(CEE_STIND_I1,                   \"stind.i1\",         PopI+PopI,          Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x52,    NEXT)\nOPDEF(CEE_STIND_I2,                   \"stind.i2\",         PopI+PopI,          Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x53,    NEXT)\nOPDEF(CEE_STIND_I4,                   \"stind.i4\",         PopI+PopI,          Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x54,    NEXT)\nOPDEF(CEE_STIND_I8,                   \"stind.i8\",         PopI+PopI8,         Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x55,    NEXT)\nOPDEF(CEE_STIND_R4,                   \"stind.r4\",         PopI+PopR4,         Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x56,    NEXT)\nOPDEF(CEE_STIND_R8,                   \"stind.r8\",         PopI+PopR8,         Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x57,    NEXT)\nOPDEF(CEE_ADD,                        \"add\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x58,    NEXT)\nOPDEF(CEE_SUB,                        \"sub\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x59,    NEXT)\nOPDEF(CEE_MUL,                        \"mul\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x5A,    NEXT)\nOPDEF(CEE_DIV,                        \"div\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x5B,    NEXT)\nOPDEF(CEE_DIV_UN,                     \"div.un\",           Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x5C,    NEXT)\nOPDEF(CEE_REM,                        \"rem\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x5D,    NEXT)\nOPDEF(CEE_REM_UN,                     \"rem.un\",           Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x5E,    NEXT)\nOPDEF(CEE_AND,                        \"and\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x5F,    NEXT)\nOPDEF(CEE_OR,                         \"or\",               Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x60,    NEXT)\nOPDEF(CEE_XOR,                        \"xor\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x61,    NEXT)\nOPDEF(CEE_SHL,                        \"shl\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x62,    NEXT)\nOPDEF(CEE_SHR,                        \"shr\",              Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x63,    NEXT)\nOPDEF(CEE_SHR_UN,                     \"shr.un\",           Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x64,    NEXT)\nOPDEF(CEE_NEG,                        \"neg\",              Pop1,               Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x65,    NEXT)\nOPDEF(CEE_NOT,                        \"not\",              Pop1,               Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0x66,    NEXT)\nOPDEF(CEE_CONV_I1,                    \"conv.i1\",          Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x67,    NEXT)\nOPDEF(CEE_CONV_I2,                    \"conv.i2\",          Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x68,    NEXT)\nOPDEF(CEE_CONV_I4,                    \"conv.i4\",          Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x69,    NEXT)\nOPDEF(CEE_CONV_I8,                    \"conv.i8\",          Pop1,               PushI8,      InlineNone,         IPrimitive,  1,  0xFF,    0x6A,    NEXT)\nOPDEF(CEE_CONV_R4,                    \"conv.r4\",          Pop1,               PushR4,      InlineNone,         IPrimitive,  1,  0xFF,    0x6B,    NEXT)\nOPDEF(CEE_CONV_R8,                    \"conv.r8\",          Pop1,               PushR8,      InlineNone,         IPrimitive,  1,  0xFF,    0x6C,    NEXT)\nOPDEF(CEE_CONV_U4,                    \"conv.u4\",          Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x6D,    NEXT)\nOPDEF(CEE_CONV_U8,                    \"conv.u8\",          Pop1,               PushI8,      InlineNone,         IPrimitive,  1,  0xFF,    0x6E,    NEXT)\nOPDEF(CEE_CALLVIRT,                   \"callvirt\",         VarPop,             VarPush,     InlineMethod,       IObjModel,   1,  0xFF,    0x6F,    CALL)\nOPDEF(CEE_CPOBJ,                      \"cpobj\",            PopI+PopI,          Push0,       InlineType,         IObjModel,   1,  0xFF,    0x70,    NEXT)\nOPDEF(CEE_LDOBJ,                      \"ldobj\",            PopI,               Push1,       InlineType,         IObjModel,   1,  0xFF,    0x71,    NEXT)\nOPDEF(CEE_LDSTR,                      \"ldstr\",            Pop0,               PushRef,     InlineString,       IObjModel,   1,  0xFF,    0x72,    NEXT)\nOPDEF(CEE_NEWOBJ,                     \"newobj\",           VarPop,             PushRef,     InlineMethod,       IObjModel,   1,  0xFF,    0x73,    CALL)\nOPDEF(CEE_CASTCLASS,                  \"castclass\",        PopRef,             PushRef,     InlineType,         IObjModel,   1,  0xFF,    0x74,    NEXT)\nOPDEF(CEE_ISINST,                     \"isinst\",           PopRef,             PushI,       InlineType,         IObjModel,   1,  0xFF,    0x75,    NEXT)\nOPDEF(CEE_CONV_R_UN,                  \"conv.r.un\",        Pop1,               PushR8,      InlineNone,         IPrimitive,  1,  0xFF,    0x76,    NEXT)\nOPDEF(CEE_UNUSED58,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x77,    NEXT)\nOPDEF(CEE_UNUSED1,                    \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0x78,    NEXT)\nOPDEF(CEE_UNBOX,                      \"unbox\",            PopRef,             PushI,       InlineType,         IPrimitive,  1,  0xFF,    0x79,    NEXT)\nOPDEF(CEE_THROW,                      \"throw\",            PopRef,             Push0,       InlineNone,         IObjModel,   1,  0xFF,    0x7A,    THROW)\nOPDEF(CEE_LDFLD,                      \"ldfld\",            PopRef,             Push1,       InlineField,        IObjModel,   1,  0xFF,    0x7B,    NEXT)\nOPDEF(CEE_LDFLDA,                     \"ldflda\",           PopRef,             PushI,       InlineField,        IObjModel,   1,  0xFF,    0x7C,    NEXT)\nOPDEF(CEE_STFLD,                      \"stfld\",            PopRef+Pop1,        Push0,       InlineField,        IObjModel,   1,  0xFF,    0x7D,    NEXT)\nOPDEF(CEE_LDSFLD,                     \"ldsfld\",           Pop0,               Push1,       InlineField,        IObjModel,   1,  0xFF,    0x7E,    NEXT)\nOPDEF(CEE_LDSFLDA,                    \"ldsflda\",          Pop0,               PushI,       InlineField,        IObjModel,   1,  0xFF,    0x7F,    NEXT)\nOPDEF(CEE_STSFLD,                     \"stsfld\",           Pop1,               Push0,       InlineField,        IObjModel,   1,  0xFF,    0x80,    NEXT)\nOPDEF(CEE_STOBJ,                      \"stobj\",            PopI+Pop1,          Push0,       InlineType,         IPrimitive,  1,  0xFF,    0x81,    NEXT)\nOPDEF(CEE_CONV_OVF_I1_UN,             \"conv.ovf.i1.un\",   Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x82,    NEXT)\nOPDEF(CEE_CONV_OVF_I2_UN,             \"conv.ovf.i2.un\",   Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x83,    NEXT)\nOPDEF(CEE_CONV_OVF_I4_UN,             \"conv.ovf.i4.un\",   Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x84,    NEXT)\nOPDEF(CEE_CONV_OVF_I8_UN,             \"conv.ovf.i8.un\",   Pop1,               PushI8,      InlineNone,         IPrimitive,  1,  0xFF,    0x85,    NEXT)\nOPDEF(CEE_CONV_OVF_U1_UN,             \"conv.ovf.u1.un\",   Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x86,    NEXT)\nOPDEF(CEE_CONV_OVF_U2_UN,             \"conv.ovf.u2.un\",   Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x87,    NEXT)\nOPDEF(CEE_CONV_OVF_U4_UN,             \"conv.ovf.u4.un\",   Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x88,    NEXT)\nOPDEF(CEE_CONV_OVF_U8_UN,             \"conv.ovf.u8.un\",   Pop1,               PushI8,      InlineNone,         IPrimitive,  1,  0xFF,    0x89,    NEXT)\nOPDEF(CEE_CONV_OVF_I_UN,              \"conv.ovf.i.un\",    Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x8A,    NEXT)\nOPDEF(CEE_CONV_OVF_U_UN,              \"conv.ovf.u.un\",    Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0x8B,    NEXT)\nOPDEF(CEE_BOX,                        \"box\",              Pop1,               PushRef,     InlineType,         IPrimitive,  1,  0xFF,    0x8C,    NEXT)\nOPDEF(CEE_NEWARR,                     \"newarr\",           PopI,               PushRef,     InlineType,         IObjModel,   1,  0xFF,    0x8D,    NEXT)\nOPDEF(CEE_LDLEN,                      \"ldlen\",            PopRef,             PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x8E,    NEXT)\nOPDEF(CEE_LDELEMA,                    \"ldelema\",          PopRef+PopI,        PushI,       InlineType,         IObjModel,   1,  0xFF,    0x8F,    NEXT)\nOPDEF(CEE_LDELEM_I1,                  \"ldelem.i1\",        PopRef+PopI,        PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x90,    NEXT)\nOPDEF(CEE_LDELEM_U1,                  \"ldelem.u1\",        PopRef+PopI,        PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x91,    NEXT)\nOPDEF(CEE_LDELEM_I2,                  \"ldelem.i2\",        PopRef+PopI,        PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x92,    NEXT)\nOPDEF(CEE_LDELEM_U2,                  \"ldelem.u2\",        PopRef+PopI,        PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x93,    NEXT)\nOPDEF(CEE_LDELEM_I4,                  \"ldelem.i4\",        PopRef+PopI,        PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x94,    NEXT)\nOPDEF(CEE_LDELEM_U4,                  \"ldelem.u4\",        PopRef+PopI,        PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x95,    NEXT)\nOPDEF(CEE_LDELEM_I8,                  \"ldelem.i8\",        PopRef+PopI,        PushI8,      InlineNone,         IObjModel,   1,  0xFF,    0x96,    NEXT)\nOPDEF(CEE_LDELEM_I,                   \"ldelem.i\",         PopRef+PopI,        PushI,       InlineNone,         IObjModel,   1,  0xFF,    0x97,    NEXT)\nOPDEF(CEE_LDELEM_R4,                  \"ldelem.r4\",        PopRef+PopI,        PushR4,      InlineNone,         IObjModel,   1,  0xFF,    0x98,    NEXT)\nOPDEF(CEE_LDELEM_R8,                  \"ldelem.r8\",        PopRef+PopI,        PushR8,      InlineNone,         IObjModel,   1,  0xFF,    0x99,    NEXT)\nOPDEF(CEE_LDELEM_REF,                 \"ldelem.ref\",       PopRef+PopI,        PushRef,     InlineNone,         IObjModel,   1,  0xFF,    0x9A,    NEXT)\nOPDEF(CEE_STELEM_I,                   \"stelem.i\",         PopRef+PopI+PopI,   Push0,       InlineNone,         IObjModel,   1,  0xFF,    0x9B,    NEXT)\nOPDEF(CEE_STELEM_I1,                  \"stelem.i1\",        PopRef+PopI+PopI,   Push0,       InlineNone,         IObjModel,   1,  0xFF,    0x9C,    NEXT)\nOPDEF(CEE_STELEM_I2,                  \"stelem.i2\",        PopRef+PopI+PopI,   Push0,       InlineNone,         IObjModel,   1,  0xFF,    0x9D,    NEXT)\nOPDEF(CEE_STELEM_I4,                  \"stelem.i4\",        PopRef+PopI+PopI,   Push0,       InlineNone,         IObjModel,   1,  0xFF,    0x9E,    NEXT)\nOPDEF(CEE_STELEM_I8,                  \"stelem.i8\",        PopRef+PopI+PopI8,  Push0,       InlineNone,         IObjModel,   1,  0xFF,    0x9F,    NEXT)\nOPDEF(CEE_STELEM_R4,                  \"stelem.r4\",        PopRef+PopI+PopR4,  Push0,       InlineNone,         IObjModel,   1,  0xFF,    0xA0,    NEXT)\nOPDEF(CEE_STELEM_R8,                  \"stelem.r8\",        PopRef+PopI+PopR8,  Push0,       InlineNone,         IObjModel,   1,  0xFF,    0xA1,    NEXT)\nOPDEF(CEE_STELEM_REF,                 \"stelem.ref\",       PopRef+PopI+PopRef, Push0,       InlineNone,         IObjModel,   1,  0xFF,    0xA2,    NEXT)\nOPDEF(CEE_LDELEM,                     \"ldelem\",           PopRef+PopI,        Push1,       InlineType,         IObjModel,   1,  0xFF,    0xA3,    NEXT)\nOPDEF(CEE_STELEM,                     \"stelem\",           PopRef+PopI+Pop1,   Push0,       InlineType,         IObjModel,   1,  0xFF,    0xA4,    NEXT)\nOPDEF(CEE_UNBOX_ANY,                  \"unbox.any\",        PopRef,             Push1,       InlineType,         IObjModel,   1,  0xFF,    0xA5,    NEXT)\nOPDEF(CEE_UNUSED5,                    \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xA6,    NEXT)\nOPDEF(CEE_UNUSED6,                    \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xA7,    NEXT)\nOPDEF(CEE_UNUSED7,                    \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xA8,    NEXT)\nOPDEF(CEE_UNUSED8,                    \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xA9,    NEXT)\nOPDEF(CEE_UNUSED9,                    \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xAA,    NEXT)\nOPDEF(CEE_UNUSED10,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xAB,    NEXT)\nOPDEF(CEE_UNUSED11,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xAC,    NEXT)\nOPDEF(CEE_UNUSED12,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xAD,    NEXT)\nOPDEF(CEE_UNUSED13,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xAE,    NEXT)\nOPDEF(CEE_UNUSED14,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xAF,    NEXT)\nOPDEF(CEE_UNUSED15,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xB0,    NEXT)\nOPDEF(CEE_UNUSED16,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xB1,    NEXT)\nOPDEF(CEE_UNUSED17,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xB2,    NEXT)\nOPDEF(CEE_CONV_OVF_I1,                \"conv.ovf.i1\",      Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xB3,    NEXT)\nOPDEF(CEE_CONV_OVF_U1,                \"conv.ovf.u1\",      Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xB4,    NEXT)\nOPDEF(CEE_CONV_OVF_I2,                \"conv.ovf.i2\",      Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xB5,    NEXT)\nOPDEF(CEE_CONV_OVF_U2,                \"conv.ovf.u2\",      Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xB6,    NEXT)\nOPDEF(CEE_CONV_OVF_I4,                \"conv.ovf.i4\",      Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xB7,    NEXT)\nOPDEF(CEE_CONV_OVF_U4,                \"conv.ovf.u4\",      Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xB8,    NEXT)\nOPDEF(CEE_CONV_OVF_I8,                \"conv.ovf.i8\",      Pop1,               PushI8,      InlineNone,         IPrimitive,  1,  0xFF,    0xB9,    NEXT)\nOPDEF(CEE_CONV_OVF_U8,                \"conv.ovf.u8\",      Pop1,               PushI8,      InlineNone,         IPrimitive,  1,  0xFF,    0xBA,    NEXT)\nOPDEF(CEE_UNUSED50,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xBB,    NEXT)\nOPDEF(CEE_UNUSED18,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xBC,    NEXT)\nOPDEF(CEE_UNUSED19,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xBD,    NEXT)\nOPDEF(CEE_UNUSED20,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xBE,    NEXT)\nOPDEF(CEE_UNUSED21,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xBF,    NEXT)\nOPDEF(CEE_UNUSED22,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xC0,    NEXT)\nOPDEF(CEE_UNUSED23,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xC1,    NEXT)\nOPDEF(CEE_REFANYVAL,                  \"refanyval\",        Pop1,               PushI,       InlineType,         IPrimitive,  1,  0xFF,    0xC2,    NEXT)\nOPDEF(CEE_CKFINITE,                   \"ckfinite\",         Pop1,               PushR8,      InlineNone,         IPrimitive,  1,  0xFF,    0xC3,    NEXT)\nOPDEF(CEE_UNUSED24,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xC4,    NEXT)\nOPDEF(CEE_UNUSED25,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xC5,    NEXT)\nOPDEF(CEE_MKREFANY,                   \"mkrefany\",         PopI,               Push1,       InlineType,         IPrimitive,  1,  0xFF,    0xC6,    NEXT)\nOPDEF(CEE_UNUSED59,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xC7,    NEXT)\nOPDEF(CEE_UNUSED60,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xC8,    NEXT)\nOPDEF(CEE_UNUSED61,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xC9,    NEXT)\nOPDEF(CEE_UNUSED62,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xCA,    NEXT)\nOPDEF(CEE_UNUSED63,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xCB,    NEXT)\nOPDEF(CEE_UNUSED64,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xCC,    NEXT)\nOPDEF(CEE_UNUSED65,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xCD,    NEXT)\nOPDEF(CEE_UNUSED66,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xCE,    NEXT)\nOPDEF(CEE_UNUSED67,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xCF,    NEXT)\nOPDEF(CEE_LDTOKEN,                    \"ldtoken\",          Pop0,               PushI,       InlineTok,          IPrimitive,  1,  0xFF,    0xD0,    NEXT)\nOPDEF(CEE_CONV_U2,                    \"conv.u2\",          Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xD1,    NEXT)\nOPDEF(CEE_CONV_U1,                    \"conv.u1\",          Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xD2,    NEXT)\nOPDEF(CEE_CONV_I,                     \"conv.i\",           Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xD3,    NEXT)\nOPDEF(CEE_CONV_OVF_I,                 \"conv.ovf.i\",       Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xD4,    NEXT)\nOPDEF(CEE_CONV_OVF_U,                 \"conv.ovf.u\",       Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xD5,    NEXT)\nOPDEF(CEE_ADD_OVF,                    \"add.ovf\",          Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0xD6,    NEXT)\nOPDEF(CEE_ADD_OVF_UN,                 \"add.ovf.un\",       Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0xD7,    NEXT)\nOPDEF(CEE_MUL_OVF,                    \"mul.ovf\",          Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0xD8,    NEXT)\nOPDEF(CEE_MUL_OVF_UN,                 \"mul.ovf.un\",       Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0xD9,    NEXT)\nOPDEF(CEE_SUB_OVF,                    \"sub.ovf\",          Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0xDA,    NEXT)\nOPDEF(CEE_SUB_OVF_UN,                 \"sub.ovf.un\",       Pop1+Pop1,          Push1,       InlineNone,         IPrimitive,  1,  0xFF,    0xDB,    NEXT)\nOPDEF(CEE_ENDFINALLY,                 \"endfinally\",       Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xDC,    RETURN)\nOPDEF(CEE_LEAVE,                      \"leave\",            Pop0,               Push0,       InlineBrTarget,     IPrimitive,  1,  0xFF,    0xDD,    BRANCH)\nOPDEF(CEE_LEAVE_S,                    \"leave.s\",          Pop0,               Push0,       ShortInlineBrTarget,IPrimitive,  1,  0xFF,    0xDE,    BRANCH)\nOPDEF(CEE_STIND_I,                    \"stind.i\",          PopI+PopI,          Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xDF,    NEXT)\nOPDEF(CEE_CONV_U,                     \"conv.u\",           Pop1,               PushI,       InlineNone,         IPrimitive,  1,  0xFF,    0xE0,    NEXT)\nOPDEF(CEE_UNUSED26,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE1,    NEXT)\nOPDEF(CEE_UNUSED27,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE2,    NEXT)\nOPDEF(CEE_UNUSED28,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE3,    NEXT)\nOPDEF(CEE_UNUSED29,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE4,    NEXT)\nOPDEF(CEE_UNUSED30,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE5,    NEXT)\nOPDEF(CEE_UNUSED31,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE6,    NEXT)\nOPDEF(CEE_UNUSED32,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE7,    NEXT)\nOPDEF(CEE_UNUSED33,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE8,    NEXT)\nOPDEF(CEE_UNUSED34,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xE9,    NEXT)\nOPDEF(CEE_UNUSED35,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xEA,    NEXT)\nOPDEF(CEE_UNUSED36,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xEB,    NEXT)\nOPDEF(CEE_UNUSED37,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xEC,    NEXT)\nOPDEF(CEE_UNUSED38,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xED,    NEXT)\nOPDEF(CEE_UNUSED39,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xEE,    NEXT)\nOPDEF(CEE_UNUSED40,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xEF,    NEXT)\nOPDEF(CEE_UNUSED41,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF0,    NEXT)\nOPDEF(CEE_UNUSED42,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF1,    NEXT)\nOPDEF(CEE_UNUSED43,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF2,    NEXT)\nOPDEF(CEE_UNUSED44,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF3,    NEXT)\nOPDEF(CEE_UNUSED45,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF4,    NEXT)\nOPDEF(CEE_UNUSED46,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF5,    NEXT)\nOPDEF(CEE_UNUSED47,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF6,    NEXT)\nOPDEF(CEE_UNUSED48,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  1,  0xFF,    0xF7,    NEXT)\nOPDEF(CEE_PREFIX7,                    \"prefix7\",          Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xF8,    META)\nOPDEF(CEE_PREFIX6,                    \"prefix6\",          Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xF9,    META)\nOPDEF(CEE_PREFIX5,                    \"prefix5\",          Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xFA,    META)\nOPDEF(CEE_PREFIX4,                    \"prefix4\",          Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xFB,    META)\nOPDEF(CEE_PREFIX3,                    \"prefix3\",          Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xFC,    META)\nOPDEF(CEE_PREFIX2,                    \"prefix2\",          Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xFD,    META)\nOPDEF(CEE_PREFIX1,                    \"prefix1\",          Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xFE,    META)\nOPDEF(CEE_PREFIXREF,                  \"prefixref\",        Pop0,               Push0,       InlineNone,         IInternal,   1,  0xFF,    0xFF,    META)\n\nOPDEF(CEE_ARGLIST,                    \"arglist\",          Pop0,               PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x00,    NEXT)\nOPDEF(CEE_CEQ,                        \"ceq\",              Pop1+Pop1,          PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x01,    NEXT)\nOPDEF(CEE_CGT,                        \"cgt\",              Pop1+Pop1,          PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x02,    NEXT)\nOPDEF(CEE_CGT_UN,                     \"cgt.un\",           Pop1+Pop1,          PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x03,    NEXT)\nOPDEF(CEE_CLT,                        \"clt\",              Pop1+Pop1,          PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x04,    NEXT)\nOPDEF(CEE_CLT_UN,                     \"clt.un\",           Pop1+Pop1,          PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x05,    NEXT)\nOPDEF(CEE_LDFTN,                      \"ldftn\",            Pop0,               PushI,       InlineMethod,       IPrimitive,  2,  0xFE,    0x06,    NEXT)\nOPDEF(CEE_LDVIRTFTN,                  \"ldvirtftn\",        PopRef,             PushI,       InlineMethod,       IPrimitive,  2,  0xFE,    0x07,    NEXT)\nOPDEF(CEE_UNUSED56,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x08,    NEXT)\nOPDEF(CEE_LDARG,                      \"ldarg\",            Pop0,               Push1,       InlineVar,          IPrimitive,  2,  0xFE,    0x09,    NEXT)\nOPDEF(CEE_LDARGA,                     \"ldarga\",           Pop0,               PushI,       InlineVar,          IPrimitive,  2,  0xFE,    0x0A,    NEXT)\nOPDEF(CEE_STARG,                      \"starg\",            Pop1,               Push0,       InlineVar,          IPrimitive,  2,  0xFE,    0x0B,    NEXT)\nOPDEF(CEE_LDLOC,                      \"ldloc\",            Pop0,               Push1,       InlineVar,          IPrimitive,  2,  0xFE,    0x0C,    NEXT)\nOPDEF(CEE_LDLOCA,                     \"ldloca\",           Pop0,               PushI,       InlineVar,          IPrimitive,  2,  0xFE,    0x0D,    NEXT)\nOPDEF(CEE_STLOC,                      \"stloc\",            Pop1,               Push0,       InlineVar,          IPrimitive,  2,  0xFE,    0x0E,    NEXT)\nOPDEF(CEE_LOCALLOC,                   \"localloc\",         PopI,               PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x0F,    NEXT)\nOPDEF(CEE_UNUSED57,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x10,    NEXT)\nOPDEF(CEE_ENDFILTER,                  \"endfilter\",        PopI,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x11,    RETURN)\nOPDEF(CEE_UNALIGNED,                  \"unaligned.\",       Pop0,               Push0,       ShortInlineI,       IPrefix,     2,  0xFE,    0x12,    META)\nOPDEF(CEE_VOLATILE,                   \"volatile.\",        Pop0,               Push0,       InlineNone,         IPrefix,     2,  0xFE,    0x13,    META)\nOPDEF(CEE_TAILCALL,                   \"tail.\",            Pop0,               Push0,       InlineNone,         IPrefix,     2,  0xFE,    0x14,    META)\nOPDEF(CEE_INITOBJ,                    \"initobj\",          PopI,               Push0,       InlineType,         IObjModel,   2,  0xFE,    0x15,    NEXT)\nOPDEF(CEE_CONSTRAINED,                \"constrained.\",     Pop0,               Push0,       InlineType,         IPrefix,     2,  0xFE,    0x16,    META)\nOPDEF(CEE_CPBLK,                      \"cpblk\",            PopI+PopI+PopI,     Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x17,    NEXT)\nOPDEF(CEE_INITBLK,                    \"initblk\",          PopI+PopI+PopI,     Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x18,    NEXT)\nOPDEF(CEE_UNUSED69,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x19,    NEXT)\nOPDEF(CEE_RETHROW,                    \"rethrow\",          Pop0,               Push0,       InlineNone,         IObjModel,   2,  0xFE,    0x1A,    THROW)\nOPDEF(CEE_UNUSED51,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x1B,    NEXT)\nOPDEF(CEE_SIZEOF,                     \"sizeof\",           Pop0,               PushI,       InlineType,         IPrimitive,  2,  0xFE,    0x1C,    NEXT)\nOPDEF(CEE_REFANYTYPE,                 \"refanytype\",       Pop1,               PushI,       InlineNone,         IPrimitive,  2,  0xFE,    0x1D,    NEXT)\nOPDEF(CEE_READONLY,                   \"readonly.\",        Pop0,               Push0,       InlineNone,         IPrefix,     2,  0xFE,    0x1E,    META)\nOPDEF(CEE_UNUSED53,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x1F,    NEXT)\nOPDEF(CEE_UNUSED54,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x20,    NEXT)\nOPDEF(CEE_UNUSED55,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x21,    NEXT)\nOPDEF(CEE_UNUSED70,                   \"unused\",           Pop0,               Push0,       InlineNone,         IPrimitive,  2,  0xFE,    0x22,    NEXT)\n\n// These are not real opcodes, but they are handy internally in the EE\n#ifndef OPDEF_REAL_OPCODES_ONLY\nOPDEF(CEE_ILLEGAL,                    \"illegal\",          Pop0,               Push0,       InlineNone,         IInternal,   0,  MOOT,    MOOT,    META)\nOPDEF(CEE_MACRO_END,                  \"endmac\",           Pop0,               Push0,       InlineNone,         IInternal,   0,  MOOT,    MOOT,    META)\nOPDEF(CEE_CODE_LABEL,                 \"codelabel\",        Pop0,               Push0,       InlineNone,         IInternal,   0,  MOOT,    MOOT,    META)\n#endif // OPDEF_REAL_OPCODES_ONLY\n\n#ifndef OPALIAS\n#define _OPALIAS_DEFINED_\n#define OPALIAS(canonicalName, stringName, realOpcode)\n#endif\n\nOPALIAS(CEE_BRNULL,        \"brnull\",            CEE_BRFALSE)\nOPALIAS(CEE_BRNULL_S,      \"brnull.s\",          CEE_BRFALSE_S)\nOPALIAS(CEE_BRZERO,        \"brzero\",            CEE_BRFALSE)\nOPALIAS(CEE_BRZERO_S,      \"brzero.s\",          CEE_BRFALSE_S)\nOPALIAS(CEE_BRINST,        \"brinst\",            CEE_BRTRUE)\nOPALIAS(CEE_BRINST_S,      \"brinst.s\",          CEE_BRTRUE_S)\nOPALIAS(CEE_LDIND_U8,      \"ldind.u8\",          CEE_LDIND_I8)\nOPALIAS(CEE_LDELEM_U8,     \"ldelem.u8\",         CEE_LDELEM_I8)\nOPALIAS(CEE_LDELEM_ANY,    \"ldelem.any\",        CEE_LDELEM)\nOPALIAS(CEE_STELEM_ANY,    \"stelem.any\",        CEE_STELEM)\nOPALIAS(CEE_LDC_I4_M1x,    \"ldc.i4.M1\",         CEE_LDC_I4_M1)\nOPALIAS(CEE_ENDFAULT,      \"endfault\",          CEE_ENDFINALLY)\n\n#ifdef _OPALIAS_DEFINED_\n#undef OPALIAS\n#undef _OPALIAS_DEFINED_\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/openum.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __openum_h__\n#define __openum_h__\n\n\ntypedef enum opcode_t\n{\n#define OPDEF(c,s,pop,push,args,type,l,s1,s2,ctrl) c,\n#include \"opcode.def\"\n#undef OPDEF\n  CEE_COUNT,        /* number of instructions and macros pre-defined */\n} OPCODE;\n\n\ntypedef enum opcode_format_t\n{\n\tInlineNone\t\t= 0,\t// no inline args\n\tInlineVar\t\t= 1,\t// local variable       (U2 (U1 if Short on))\n\tInlineI\t\t\t= 2,\t// an signed integer    (I4 (I1 if Short on))\n\tInlineR\t\t\t= 3,\t// a real number        (R8 (R4 if Short on))\n\tInlineBrTarget\t= 4,    // branch target        (I4 (I1 if Short on))\n\tInlineI8\t\t= 5,\n\tInlineMethod\t= 6,   // method token (U4)\n\tInlineField\t\t= 7,   // field token  (U4)\n\tInlineType\t\t= 8,   // type token   (U4)\n\tInlineString\t= 9,   // string TOKEN (U4)\n\tInlineSig\t\t= 10,  // signature tok (U4)\n\tInlineRVA\t\t= 11,  // ldptr token  (U4)\n\tInlineTok\t\t= 12,  // a meta-data token of unknown type (U4)\n\tInlineSwitch\t= 13,  // count (U4), pcrel1 (U4) .... pcrelN (U4)\n\tInlinePhi\t\t= 14,  // count (U1), var1 (U2) ... varN (U2)\n\n\t// WATCH OUT we are close to the limit here, if you add\n\t// more enumerations you need to change ShortIline definition below\n\n\t// The extended enumeration also encodes the size in the IL stream\n\tShortInline \t= 16,\t\t\t\t\t\t// if this bit is set, the format is the 'short' format\n\tPrimaryMask   \t= (ShortInline-1),\t\t\t// mask these off to get primary enumeration above\n\tShortInlineVar \t= (ShortInline + InlineVar),\n\tShortInlineI\t= (ShortInline + InlineI),\n\tShortInlineR\t= (ShortInline + InlineR),\n\tShortInlineBrTarget = (ShortInline + InlineBrTarget),\n\tInlineOpcode\t= (ShortInline + InlineNone),    // This is only used internally.  It means the 'opcode' is two byte instead of 1\n} OPCODE_FORMAT;\n\n#endif /* __openum_h__ */\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/opinfo.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n/***************************************************************************/\n/*                                OpInfo.h                                 */\n/***************************************************************************/\n\n/* contains OpInfo, a wrapper that allows you to get useful information\n   about IL opcodes, and how to decode them */\n\n/***************************************************************************/\n\n#ifndef OpInfo_h\n#define OpInfo_h\n\n#include \"openum.h\"\n\n\t// Decribes the flow of control properties of the instruction\nenum OpFlow {\n\tFLOW_META,\t\t\t// not a real instruction\n\tFLOW_CALL,\t\t\t// a call instruction\n\tFLOW_BRANCH,\t\t\t// unconditional branch, does not fall through\n\tFLOW_COND_BRANCH,\t// may fall through\n\tFLOW_PHI,\n\tFLOW_THROW,\n\tFLOW_BREAK,\n\tFLOW_RETURN,\n\tFLOW_NEXT,\t\t\t// flows into next instruction (none of the above)\n};\n\n\t// These are all the possible arguments for the instruction\n/****************************************************************************/\nunion OpArgsVal {\n\t__int32  i;\n\t__int64 i8;\n\tdouble   r;\n\tstruct {\n\t\tunsigned count;\n\t\tint* targets;   // targets are pcrelative displacements (little-endian)\n\t\t} switch_;\n\tstruct {\n\t\tunsigned count;\n\t\tunsigned short* vars;\n\t\t} phi;\n};\n\n/***************************************************************************/\n\n\t// OpInfo parses a il instrution into an opcode, and a arg and updates the IP\nclass OpInfo {\npublic:\n\tOpInfo()\t\t\t  { data = 0; }\n\tOpInfo(OPCODE opCode) { _ASSERTE(opCode < CEE_COUNT); data = &table[opCode]; }\n\n\t\t// fetch instruction at 'instrPtr, fills in 'args' returns pointer\n\t\t// to next instruction\n\tconst unsigned char* fetch(const unsigned char* instrPtr, OpArgsVal* args);\n\n\tconst char* getName() \t \t{ return(data->name); }\n\tOPCODE_FORMAT getArgsInfo()\t{ return(OPCODE_FORMAT(data->format & PrimaryMask)); }\n\tOpFlow \t\tgetFlow()\t \t{ return(data->flow); }\n\tOPCODE \t\tgetOpcode()\t \t{ return((OPCODE) (data-table)); }\n    int         getNumPop()     { return(data->numPop); }\n    int         getNumPush()    { return(data->numPush); }\n\nprivate:\n\tstruct OpInfoData {\n        const char* name;\n        OPCODE_FORMAT format  \t: 8;\n\t\tOpFlow     \tflow\t\t: 8;\n\t\tint     \tnumPop\t\t: 3;\t// < 0 means depends on instr args\n\t\tint       \tnumPush\t\t: 3;\t// < 0 means depends on instr args\n        OPCODE      opcode      : 10;  \t// This is the same as the index into the table\n    };\n\n\tstatic OpInfoData table[];\nprivate:\n\tOpInfoData* data;\n};\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/optdefault.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// Revert optimizations back to default\n//\n#undef FPO_ON\n\n#ifdef _MSC_VER\n#pragma optimize(\"\",on)\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/optsmallperfcritical.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// Set optimizations settings for small performance critical methods\n//\n\n#ifdef FPO_ON\n#error Recursive use of FPO_ON not supported\n#endif\n\n#define FPO_ON 1\n\n\n#if defined(_MSC_VER) && !defined(_DEBUG)\n #pragma optimize(\"t\", on)   // optimize for speed\n #if !defined(HOST_AMD64)   // 'y' isn't an option on amd64\n  #pragma optimize(\"y\", on)   // omit frame pointer\n #endif // !defined(TARGET_AMD64)\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/ostype.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#include \"staticcontract.h\"\n\n#ifndef WRAPPER_NO_CONTRACT\n#define WRAPPER_NO_CONTRACT             ANNOTATION_WRAPPER\n#endif\n\n#ifndef LIMITED_METHOD_CONTRACT\n#define LIMITED_METHOD_CONTRACT                ANNOTATION_FN_LEAF\n#endif\n\n//*****************************************************************************\n// Enum to track which version of the OS we are running\n// Note that Win7 is the minimum supported platform. Any code using\n// utilcode (which includes the CLR's execution engine) will fail to start\n// on a pre-Win7 platform. This is enforced by InitRunningOnVersionStatus.\n//*****************************************************************************\ntypedef enum {\n    RUNNING_ON_STATUS_UNINITED = 0,\n    RUNNING_ON_WIN7            = 1,\n    RUNNING_ON_WIN8            = 2\n} RunningOnStatusEnum;\n\nextern RunningOnStatusEnum gRunningOnStatus;\n\nvoid InitRunningOnVersionStatus();\n\n//*****************************************************************************\n// Returns true if you are running on Windows 8 or newer.\n//*****************************************************************************\ninline BOOL RunningOnWin8()\n{\n    WRAPPER_NO_CONTRACT;\n#if (!defined(HOST_X86) && !defined(HOST_AMD64))\n    return TRUE;\n#else\n    if (gRunningOnStatus == RUNNING_ON_STATUS_UNINITED)\n    {\n        InitRunningOnVersionStatus();\n    }\n\n    return (gRunningOnStatus >= RUNNING_ON_WIN8) ? TRUE : FALSE;\n#endif\n}\n\n#ifdef FEATURE_COMINTEROP\n\ninline BOOL WinRTSupported()\n{\n    return RunningOnWin8();\n}\n\n#endif // FEATURE_COMINTEROP\n\n#ifdef HOST_64BIT\ninline BOOL RunningInWow64()\n{\n    return FALSE;\n}\n#else\nBOOL RunningInWow64();\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/outstring.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n/*****************************************************************/\n/*                         OutString.h                           */\n/*****************************************************************/\n/* A simple, lightweight, character output stream, with very few\n   external dependancies (like sprintf ... ) */\n\n/*\n   Date :  2/1/99               */\n/*****************************************************************/\n\n#ifndef _OutString_h\n#define _OutString_h 1\n\n#include \"utilcode.h\"   // for overloaded new\n#include <string.h>     // for strlen, strcpy\n\n/*****************************************************************/\n    // a light weight character 'output' stream\nclass OutString {\npublic:\n    enum FormatFlags {          // used to control printing of numbers\n        none        = 0,\n        put0x       = 1,        // put leading 0x on hexidecimal\n        zeroFill    = 2,        // zero fill (instead of space fill)\n    };\n\n    OutString() : start(0), end(0), cur(0) {}\n\n    OutString(unsigned initialAlloc) {\n        cur = start = new char[initialAlloc+1]; // for null termination\n        end = &start[initialAlloc];\n    }\n\n    ~OutString() { delete [] start; }\n\n    // shortcut for printing decimal\n    OutString& operator<<(int i) { return(dec(i)); }\n\n    OutString& operator<<(double d);\n\n    // FIX make this really unsigned\n    OutString& operator<<(unsigned i) { return(dec(i)); }\n\n    // prints out the hexidecimal representation\n    OutString& dec(int i, size_t minWidth = 0);\n\n    // prints out the hexidecimal representation\n    OutString& hex(unsigned i, int minWidth = 0, unsigned flags = none);\n\n    OutString& hex(unsigned __int64 i, int minWidth = 0, unsigned flags = none);\n\n    OutString& hex(int i, int minWidth = 0, unsigned flags = none) {\n        return hex(unsigned(i), minWidth, flags);\n    }\n\n    OutString& hex(__int64 i, int minWidth = 0, unsigned flags = none) {\n        return hex((unsigned __int64) i, minWidth, flags);\n    }\n\n    //  print out 'count' instances of the character 'c'\n    OutString& pad(size_t count, char c);\n\n    OutString& operator<<(char c) {\n        if (cur >= end)\n            Realloc(1);\n        *cur++ = c;\n        _ASSERTE(start <= cur && cur <= end);\n        return(*this);\n    }\n\n    OutString& operator<<(const WCHAR* str) {\n        size_t len = wcslen(str);\n        if (cur+len > end)\n            Realloc(len);\n        while(str != 0)\n            *cur++ = (char) *str++;\n        _ASSERTE(start <= cur && cur <= end);\n        return(*this);\n    }\n\n    OutString& prepend(const char c) {\n        char buff[2]; buff[0] = c; buff[1] = 0;\n        return(prepend(buff));\n    }\n\n    OutString& prepend(const char* str) {\n        size_t len = strlen(str);\n        if (cur+len > end)\n            Realloc(len);\n        memmove(start+len, start, cur-start);\n        memcpy(start, str, len);\n        cur = cur + len;\n        _ASSERTE(start <= cur && cur <= end);\n        return(*this);\n        }\n\n    OutString& operator=(const OutString& str) {\n        clear();\n        *this << str;\n        return(*this);\n    }\n\n    OutString& operator<<(const OutString& str) {\n        write(str.start, str.cur-str.start);\n        return(*this);\n    }\n\n    OutString& operator<<(const char* str) {\n        write(str, strlen(str));\n        return(*this);\n    }\n\n    void write(const char* str, size_t len) {\n        if (cur+len > end)\n            Realloc(len);\n        memcpy(cur, str, len);\n        cur = cur + len;\n        _ASSERTE(start <= cur && cur <= end);\n    }\n\n    void swap(OutString& str) {\n        char* tmp = start;\n        start = str.start;\n        str.start = tmp;\n        tmp = end;\n        end = str.end;\n        str.end = tmp;\n        tmp = cur;\n        cur = str.cur;\n        str.cur = tmp;\n        _ASSERTE(start <= cur && cur <= end);\n    }\n\n    void clear()                { cur = start; }\n    size_t length() const       { return(cur-start); }\n\n    // return the null terminated string, OutString keeps ownership\n    const char* val() const     { *cur = 0; return(start); }\n\n    // grab string (caller must now delete) OutString is cleared\n    char* grab()        { char* ret = start; *cur = 0; end = cur = start = 0; return(ret); }\n\nprivate:\n    void Realloc(size_t neededSpace);\n\n    char *start;    // start of the buffer\n    char *end;      // points at the last place null terminator can go\n    char *cur;      // points at a null terminator\n};\n\n#endif // _OutString_h\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/palclr.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ===========================================================================\n// File: palclr.h\n//\n// Various macros and constants that are necessary to make the CLR portable.\n//\n\n// ===========================================================================\n\n\n#if defined(HOST_WINDOWS)\n\n#ifndef __PALCLR_H__\n#define __PALCLR_H__\n\n// This macro is used to standardize the wide character string literals between UNIX and Windows.\n// Unix L\"\" is UTF32, and on windows it's UTF16.  Because of built-in assumptions on the size\n// of string literals, it's important to match behaviour between Unix and Windows.  Unix will be defined\n// as u\"\" (char16_t)\n#define W(str)  L##str\n\n#include <windef.h>\n\n#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define _DEBUG_IMPL 1\n#endif\n\n#if __GNUC__\n#ifndef __cdecl\n#define __cdecl\t__attribute__((__cdecl__))\n#endif\n#endif\n\n#ifndef NOTHROW_DECL\n#ifdef _MSC_VER\n#define NOTHROW_DECL __declspec(nothrow)\n#else\n#define NOTHROW_DECL __attribute__((nothrow))\n#endif // !_MSC_VER\n#endif // !NOTHROW_DECL\n\n#ifndef NOINLINE\n#ifdef _MSC_VER\n#define NOINLINE __declspec(noinline)\n#else\n#define NOINLINE __attribute__((noinline))\n#endif // !_MSC_VER\n#endif // !NOINLINE\n\n#define ANALYZER_NORETURN\n\n#ifdef _MSC_VER\n#define EMPTY_BASES_DECL __declspec(empty_bases)\n#else\n#define EMPTY_BASES_DECL\n#endif // !_MSC_VER\n\n//\n// CPP_ASSERT() can be used within a class definition, to perform a\n// compile-time assertion involving private names within the class.\n//\n// MS compiler doesn't allow redefinition of the typedef within a template.\n// gcc doesn't allow redefinition of the typedef within a class, though\n// it does at file scope.\n#define CPP_ASSERT(n, e) typedef char __C_ASSERT__##n[(e) ? 1 : -1];\n\n\n// PORTABILITY_ASSERT and PORTABILITY_WARNING macros are meant to be used to\n// mark places in the code that needs attention for portability. The usual\n// usage pattern is:\n//\n// int get_scratch_register() {\n// #if defined(TARGET_X86)\n//     return eax;\n// #elif defined(TARGET_AMD64)\n//     return rax;\n// #elif defined(TARGET_ARM)\n//     return r0;\n// #else\n//     PORTABILITY_ASSERT(\"scratch register\");\n//     return 0;\n// #endif\n// }\n//\n// PORTABILITY_ASSERT is meant to be used inside functions/methods. It can\n// introduce compile-time and/or run-time errors.\n// PORTABILITY_WARNING is meant to be used outside functions/methods. It can\n// introduce compile-time errors or warnings only.\n//\n// People starting new ports will first define these to just cause run-time\n// errors. Once they fix all the places that need attention for portability,\n// they can define PORTABILITY_ASSERT and PORTABILITY_WARNING to cause\n// compile-time errors to make sure that they haven't missed anything.\n//\n// If it is reasonably possible all codepaths containing PORTABILITY_ASSERT\n// should be compilable (e.g. functions should return NULL or something if\n// they are expected to return a value).\n//\n// The message in these two macros should not contain any keywords like TODO\n// or NYI. It should be just the brief description of the problem.\n\n#if defined(TARGET_X86)\n// Finished ports - compile-time errors\n#define PORTABILITY_WARNING(message)    NEED_TO_PORT_THIS_ONE(NEED_TO_PORT_THIS_ONE)\n#define PORTABILITY_ASSERT(message)     NEED_TO_PORT_THIS_ONE(NEED_TO_PORT_THIS_ONE)\n#else\n// Ports in progress - run-time asserts only\n#define PORTABILITY_WARNING(message)\n#define PORTABILITY_ASSERT(message)     _ASSERTE(false && (message))\n#endif\n\n#define DIRECTORY_SEPARATOR_CHAR_A '\\\\'\n#define DIRECTORY_SEPARATOR_STR_A \"\\\\\"\n#define DIRECTORY_SEPARATOR_CHAR_W W('\\\\')\n#define DIRECTORY_SEPARATOR_STR_W W(\"\\\\\")\n\n#define PATH_SEPARATOR_CHAR_W W(';')\n#define PATH_SEPARATOR_STR_W W(\";\")\n\n#define VOLUME_SEPARATOR_CHAR_W W(':')\n\n// PAL Macros\n// Not all compilers support fully anonymous aggregate types, so the\n// PAL provides names for those types. To allow existing definitions of\n// those types to continue to work, we provide macros that should be\n// used to reference fields within those types.\n\n#ifndef DECIMAL_SCALE\n#define DECIMAL_SCALE(dec)       ((dec).scale)\n#endif\n\n#ifndef DECIMAL_SIGN\n#define DECIMAL_SIGN(dec)        ((dec).sign)\n#endif\n\n#ifndef DECIMAL_SIGNSCALE\n#define DECIMAL_SIGNSCALE(dec)   ((dec).signscale)\n#endif\n\n#ifndef DECIMAL_LO32\n#define DECIMAL_LO32(dec)        ((dec).Lo32)\n#endif\n\n#ifndef DECIMAL_MID32\n#define DECIMAL_MID32(dec)       ((dec).Mid32)\n#endif\n\n#ifndef DECIMAL_HI32\n#define DECIMAL_HI32(dec)       ((dec).Hi32)\n#endif\n\n#ifndef DECIMAL_LO64_GET\n#define DECIMAL_LO64_GET(dec)       ((dec).Lo64)\n#endif\n\n#ifndef DECIMAL_LO64_SET\n#define DECIMAL_LO64_SET(dec,value)   {(dec).Lo64 = value; }\n#endif\n\n#ifndef IMAGE_RELOC_FIELD\n#define IMAGE_RELOC_FIELD(img, f)      ((img).f)\n#endif\n\n#ifndef IMAGE_IMPORT_DESC_FIELD\n#define IMAGE_IMPORT_DESC_FIELD(img, f)     ((img).f)\n#endif\n\n#define IMAGE_RDE_ID(img) ((img)->Id)\n\n#define IMAGE_RDE_NAME(img) ((img)->Name)\n\n#define IMAGE_RDE_OFFSET(img) ((img)->OffsetToData)\n\n#ifndef IMAGE_RDE_NAME_FIELD\n#define IMAGE_RDE_NAME_FIELD(img, f)    ((img)->f)\n#endif\n\n#define IMAGE_RDE_OFFSET_FIELD(img, f) ((img)->f)\n\n#ifndef IMAGE_FE64_FIELD\n#define IMAGE_FE64_FIELD(img, f)    ((img).f)\n#endif\n\n#ifndef IMPORT_OBJ_HEADER_FIELD\n#define IMPORT_OBJ_HEADER_FIELD(obj, f)    ((obj).f)\n#endif\n\n#ifndef IMAGE_COR20_HEADER_FIELD\n#define IMAGE_COR20_HEADER_FIELD(obj, f)    ((obj).f)\n#endif\n\n\n// PAL Numbers\n// Used to ensure cross-compiler compatibility when declaring large\n// integer constants. 64-bit integer constants should be wrapped in the\n// declarations listed here.\n//\n// Each of the #defines here is wrapped to avoid conflicts with pal.h.\n\n#if defined(_MSC_VER)\n\n// MSVC's way of declaring large integer constants\n// If you define these in one step, without the _HELPER macros, you\n// get extra whitespace when composing these with other concatenating macros.\n#ifndef I64\n#define I64_HELPER(x) x ## i64\n#define I64(x)        I64_HELPER(x)\n#endif\n\n#ifndef UI64\n#define UI64_HELPER(x) x ## ui64\n#define UI64(x)        UI64_HELPER(x)\n#endif\n\n#else\n\n// GCC's way of declaring large integer constants\n// If you define these in one step, without the _HELPER macros, you\n// get extra whitespace when composing these with other concatenating macros.\n#ifndef I64\n#define I64_HELPER(x) x ## LL\n#define I64(x)        I64_HELPER(x)\n#endif\n\n#ifndef UI64\n#define UI64_HELPER(x) x ## ULL\n#define UI64(x)        UI64_HELPER(x)\n#endif\n\n#endif\n\n\n// PAL SEH\n// Macros for portable exception handling. The Win32 SEH is emulated using\n// these macros and setjmp/longjmp on Unix\n//\n// Usage notes:\n//\n// - The filter has to be a function taking two parameters:\n// LONG MyFilter(PEXCEPTION_POINTERS *pExceptionInfo, PVOID pv)\n//\n// - It is not possible to directly use the local variables in the filter.\n// All the local information that the filter has to need to know about should\n// be passed through pv parameter\n//\n// - Do not use goto to jump out of the PAL_TRY block\n// (jumping out of the try block is not a good idea even on Win32, because of\n// it causes stack unwind)\n//\n// - It is not possible to directly use the local variables in the try block.\n// All the local information that the filter has to need to know about should\n// be passed through pv parameter\n//\n//\n// Simple examples:\n//\n// struct Param { ... local variables used in try block and filter ... } param;\n// PAL_TRY(Param *, pParam, &param) { // read as: Param *pParam = &param;\n//   ....\n// } PAL_FINALLY {\n//   ....\n// }\n// PAL_ENDTRY\n//\n//\n// struct Param { ... local variables used in try block and filter ... } param;\n// PAL_TRY(Param *, pParam, &param) {\n//   ....\n// } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {\n//   ....\n// }\n// PAL_ENDTRY\n//\n//\n// LONG MyFilter(PEXCEPTION_POINTERS *pExceptionInfo, PVOID pv)\n// {\n// ...\n// }\n// PAL_TRY(void *, unused, NULL) {\n//   ....\n// } PAL_EXCEPT_FILTER(MyFilter) {\n//   ....\n// }\n// PAL_ENDTRY\n//\n//\n// Complex example:\n//\n// struct MyParams\n// {\n//     ...\n// } params;\n//\n// PAL_TRY(MyParams *, pMyParamsOuter, &params) {\n//   PAL_TRY(MyParams *, pMyParamsInnter, pMyParamsOuter) {\n//       ...\n//       if (error) goto Done;\n//       ...\n//   Done: ;\n//   } PAL_EXCEPT_FILTER(OtherFilter) {\n//   ...\n//   }\n//   PAL_ENDTRY\n// }\n// PAL_FINALLY {\n// }\n// PAL_ENDTRY\n//\n\n#include \"staticcontract.h\"\n\n#define HardwareExceptionHolder\n\n// Note: PAL_SEH_RESTORE_GUARD_PAGE is only ever defined in clrex.h, so we only restore guard pages automatically\n// when these macros are used from within the VM.\n#define PAL_SEH_RESTORE_GUARD_PAGE\n\n#define PAL_TRY_NAKED                                                           \\\n    {                                                                           \\\n        bool __exHandled; __exHandled = false;                                  \\\n        DWORD __exCode; __exCode = 0;                                           \\\n        SCAN_EHMARKER();                                                        \\\n        __try                                                                   \\\n        {                                                                       \\\n            SCAN_EHMARKER_TRY();\n\n#define PAL_EXCEPT_NAKED(Disposition)                                           \\\n        }                                                                       \\\n        __except(__exCode = GetExceptionCode(), Disposition)                    \\\n        {                                                                       \\\n            __exHandled = true;                                                 \\\n            SCAN_EHMARKER_CATCH();                                              \\\n            PAL_SEH_RESTORE_GUARD_PAGE\n\n#define PAL_EXCEPT_FILTER_NAKED(pfnFilter, param)                               \\\n        }                                                                       \\\n        __except(__exCode = GetExceptionCode(),                                 \\\n                 pfnFilter(GetExceptionInformation(), param))                   \\\n        {                                                                       \\\n            __exHandled = true;                                                 \\\n            SCAN_EHMARKER_CATCH();                                              \\\n            PAL_SEH_RESTORE_GUARD_PAGE\n\n#define PAL_FINALLY_NAKED                                                       \\\n        }                                                                       \\\n        __finally                                                               \\\n        {                                                                       \\\n\n#define PAL_ENDTRY_NAKED                                                        \\\n        }                                                                       \\\n        PAL_ENDTRY_NAKED_DBG                                                    \\\n    }                                                                           \\\n\n\n#if defined(_DEBUG) && !defined(DACCESS_COMPILE)\n//\n// In debug mode, compile the try body as a method of a local class.\n// This way, the compiler will check that the body is not directly\n// accessing any local variables and arguments.\n//\n#define PAL_TRY(__ParamType, __paramDef, __paramRef)                            \\\n{                                                                               \\\n    __ParamType __param = __paramRef;                                           \\\n    __ParamType __paramToPassToFilter = __paramRef;                             \\\n    class __Body                                                                \\\n    {                                                                           \\\n    public:                                                                     \\\n        static void Run(__ParamType __paramDef)                                 \\\n    {                                                                           \\\n        PAL_TRY_HANDLER_DBG_BEGIN\n\n// PAL_TRY implementation that abstracts usage of COMPILER_INSTANCE*, which is used by\n// JIT64. On Windows, we dont need to do anything special as we dont have nested classes/methods\n// as on PAL.\n#define PAL_TRY_CI(__ParamType, __paramDef, __paramRef)                         \\\n{                                                                               \\\n    struct __HandlerData {                                                      \\\n        __ParamType __param;                                                    \\\n        COMPILER_INSTANCE *__ciPtr;                                             \\\n    };                                                                          \\\n    __HandlerData handlerData;                                                  \\\n    handlerData.__param = __paramRef;                                           \\\n    handlerData.__ciPtr = ciPtr;                                                \\\n     __HandlerData* __param = &handlerData;                                     \\\n    __ParamType __paramToPassToFilter = __paramRef;                             \\\n    class __Body                                                                \\\n    {                                                                           \\\n    public:                                                                     \\\n    static void Run(__HandlerData* __pHandlerData)                              \\\n    {                                                                           \\\n    PAL_TRY_HANDLER_DBG_BEGIN                                                   \\\n        COMPILER_INSTANCE *ciPtr = __pHandlerData->__ciPtr;                     \\\n        __ParamType __paramDef = __pHandlerData->__param;\n\n\n#define PAL_TRY_FOR_DLLMAIN(__ParamType, __paramDef, __paramRef, __reason)      \\\n{                                                                               \\\n    __ParamType __param = __paramRef;                                           \\\n    __ParamType __paramToPassToFilter = __paramRef;                             \\\n    class __Body                                                                \\\n    {                                                                           \\\n    public:                                                                     \\\n        static void Run(__ParamType __paramDef)                                 \\\n    {                                                                           \\\n            PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(__reason)\n\n#define PAL_EXCEPT(Disposition)                                                 \\\n            PAL_TRY_HANDLER_DBG_END                                             \\\n        }                                                                       \\\n    };                                                                          \\\n        PAL_TRY_NAKED                                                           \\\n    __Body::Run(__param);                                                       \\\n    PAL_EXCEPT_NAKED(Disposition)\n\n#define PAL_EXCEPT_FILTER(pfnFilter)                                            \\\n            PAL_TRY_HANDLER_DBG_END                                             \\\n        }                                                                       \\\n    };                                                                          \\\n    PAL_TRY_NAKED                                                               \\\n    __Body::Run(__param);                                                       \\\n    PAL_EXCEPT_FILTER_NAKED(pfnFilter, __paramToPassToFilter)\n\n#define PAL_FINALLY                                                             \\\n            PAL_TRY_HANDLER_DBG_END                                             \\\n        }                                                                       \\\n    };                                                                          \\\n    PAL_TRY_NAKED                                                               \\\n    __Body::Run(__param);                                                       \\\n    PAL_FINALLY_NAKED\n\n#define PAL_ENDTRY                                                              \\\n    PAL_ENDTRY_NAKED                                                            \\\n}\n\n#else // _DEBUG\n\n#define PAL_TRY(__ParamType, __paramDef, __paramRef)                            \\\n{                                                                               \\\n    __ParamType __param = __paramRef;                                           \\\n    __ParamType __paramDef = __param;                                           \\\n    PAL_TRY_NAKED                                                               \\\n    PAL_TRY_HANDLER_DBG_BEGIN\n\n// PAL_TRY implementation that abstracts usage of COMPILER_INSTANCE*, which is used by\n// JIT64. On Windows, we dont need to do anything special as we dont have nested classes/methods\n// as on PAL.\n#define PAL_TRY_CI(__ParamType, __paramDef, __paramRef) PAL_TRY(__ParamType, __paramDef, __paramRef)\n\n#define PAL_TRY_FOR_DLLMAIN(__ParamType, __paramDef, __paramRef, __reason)      \\\n{                                                                               \\\n    __ParamType __param = __paramRef;                                           \\\n    __ParamType __paramDef; __paramDef = __param;                               \\\n    PAL_TRY_NAKED                                                               \\\n    PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(__reason)\n\n#define PAL_EXCEPT(Disposition)                                                 \\\n        PAL_TRY_HANDLER_DBG_END                                                 \\\n        PAL_EXCEPT_NAKED(Disposition)\n\n#define PAL_EXCEPT_FILTER(pfnFilter)                                            \\\n        PAL_TRY_HANDLER_DBG_END                                                 \\\n        PAL_EXCEPT_FILTER_NAKED(pfnFilter, __param)\n\n#define PAL_FINALLY                                                             \\\n        PAL_TRY_HANDLER_DBG_END                                                 \\\n        PAL_FINALLY_NAKED\n\n#define PAL_ENDTRY                                                              \\\n    PAL_ENDTRY_NAKED                                                            \\\n    }\n\n#endif // _DEBUG\n\n// Executes the handler if the specified exception code matches\n// the one in the exception. Otherwise, returns EXCEPTION_CONTINUE_SEARCH.\n#define PAL_EXCEPT_IF_EXCEPTION_CODE(dwExceptionCode) PAL_EXCEPT((GetExceptionCode() == (dwExceptionCode))?EXCEPTION_EXECUTE_HANDLER:EXCEPTION_CONTINUE_SEARCH)\n\n#define PAL_CPP_TRY try\n#define PAL_CPP_ENDTRY\n#define PAL_CPP_THROW(type, obj) do { SCAN_THROW_MARKER; throw obj; } while (false)\n#define PAL_CPP_RETHROW do { SCAN_THROW_MARKER; throw; } while (false)\n#define PAL_CPP_CATCH_DERIVED(type, obj) catch (type * obj)\n#define PAL_CPP_CATCH_ALL catch (...)\n#define PAL_CPP_CATCH_EXCEPTION_NOARG catch (Exception *)\n\n\n#if defined(SOURCE_FORMATTING)\n#define __annotation(x)\n#endif\n\n\n#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(CROSS_COMPILE) && !defined(DISABLE_CONTRACTS)\n#define PAL_TRY_HANDLER_DBG_BEGIN                                               \\\n    BOOL ___oldOkayToThrowValue = FALSE;                                        \\\n    ClrDebugState *___pState = ::GetClrDebugState();                            \\\n    __try                                                                       \\\n    {                                                                           \\\n        ___oldOkayToThrowValue = ___pState->IsOkToThrow();                      \\\n        ___pState->SetOkToThrow();\n\n// Special version that avoids touching the debug state after doing work in a DllMain for process or thread detach.\n#define PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason)                              \\\n    BOOL ___oldOkayToThrowValue = FALSE;                                        \\\n    ClrDebugState *___pState = NULL;                                            \\\n    if (_reason != DLL_PROCESS_ATTACH)                                          \\\n        ___pState = CheckClrDebugState();                                       \\\n    __try                                                                       \\\n    {                                                                           \\\n        if (___pState)                                                          \\\n        {                                                                       \\\n            ___oldOkayToThrowValue = ___pState->IsOkToThrow();                  \\\n            ___pState->SetOkToThrow();                                        \\\n        }                                                                       \\\n        if ((_reason == DLL_PROCESS_DETACH) || (_reason == DLL_THREAD_DETACH))  \\\n        {                                                                       \\\n            ___pState = NULL;                                                   \\\n        }\n\n#define PAL_TRY_HANDLER_DBG_END                                                 \\\n    }                                                                           \\\n    __finally                                                                   \\\n    {                                                                           \\\n        if (___pState != NULL)                                                  \\\n        {                                                                       \\\n            _ASSERTE(___pState == CheckClrDebugState());                        \\\n            ___pState->SetOkToThrow( ___oldOkayToThrowValue );                \\\n        }                                                                       \\\n    }\n\n#define PAL_ENDTRY_NAKED_DBG\n\n#else\n#define PAL_TRY_HANDLER_DBG_BEGIN                   ANNOTATION_TRY_BEGIN;\n#define PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason)  ANNOTATION_TRY_BEGIN;\n#define PAL_TRY_HANDLER_DBG_END                     ANNOTATION_TRY_END;\n#define PAL_ENDTRY_NAKED_DBG\n#endif // defined(ENABLE_CONTRACTS_IMPL)\n\n\n#if !BIGENDIAN\n// For little-endian machines, do nothing\n#define VAL16(x) x\n#define VAL32(x) x\n#define VAL64(x) x\n#define SwapString(x)\n#define SwapStringLength(x, y)\n#define SwapGuid(x)\n#endif  // !BIGENDIAN\n\n#ifdef _MSC_VER\n// Get Unaligned values from a potentially unaligned object\n#define GET_UNALIGNED_16(_pObject)  (*(UINT16 UNALIGNED *)(_pObject))\n#define GET_UNALIGNED_32(_pObject)  (*(UINT32 UNALIGNED *)(_pObject))\n#define GET_UNALIGNED_64(_pObject)  (*(UINT64 UNALIGNED *)(_pObject))\n\n// Set Value on an potentially unaligned object\n#define SET_UNALIGNED_16(_pObject, _Value)  (*(UNALIGNED UINT16 *)(_pObject)) = (UINT16)(_Value)\n#define SET_UNALIGNED_32(_pObject, _Value)  (*(UNALIGNED UINT32 *)(_pObject)) = (UINT32)(_Value)\n#define SET_UNALIGNED_64(_pObject, _Value)  (*(UNALIGNED UINT64 *)(_pObject)) = (UINT64)(_Value)\n\n// Get Unaligned values from a potentially unaligned object and swap the value\n#define GET_UNALIGNED_VAL16(_pObject) VAL16(GET_UNALIGNED_16(_pObject))\n#define GET_UNALIGNED_VAL32(_pObject) VAL32(GET_UNALIGNED_32(_pObject))\n#define GET_UNALIGNED_VAL64(_pObject) VAL64(GET_UNALIGNED_64(_pObject))\n\n// Set a swap Value on an potentially unaligned object\n#define SET_UNALIGNED_VAL16(_pObject, _Value) SET_UNALIGNED_16(_pObject, VAL16((UINT16)_Value))\n#define SET_UNALIGNED_VAL32(_pObject, _Value) SET_UNALIGNED_32(_pObject, VAL32((UINT32)_Value))\n#define SET_UNALIGNED_VAL64(_pObject, _Value) SET_UNALIGNED_64(_pObject, VAL64((UINT64)_Value))\n#endif\n\n#ifdef HOST_64BIT\n#define VALPTR(x) VAL64(x)\n#define GET_UNALIGNED_PTR(x) GET_UNALIGNED_64(x)\n#define GET_UNALIGNED_VALPTR(x) GET_UNALIGNED_VAL64(x)\n#define SET_UNALIGNED_PTR(p,x) SET_UNALIGNED_64(p,x)\n#define SET_UNALIGNED_VALPTR(p,x) SET_UNALIGNED_VAL64(p,x)\n#else\n#define VALPTR(x) VAL32(x)\n#define GET_UNALIGNED_PTR(x) GET_UNALIGNED_32(x)\n#define GET_UNALIGNED_VALPTR(x) GET_UNALIGNED_VAL32(x)\n#define SET_UNALIGNED_PTR(p,x) SET_UNALIGNED_32(p,x)\n#define SET_UNALIGNED_VALPTR(p,x) SET_UNALIGNED_VAL32(p,x)\n#endif\n\n#define MAKEDLLNAME_W(name) name W(\".dll\")\n#define MAKEDLLNAME_A(name) name  \".dll\"\n\n#ifdef UNICODE\n#define MAKEDLLNAME(x) MAKEDLLNAME_W(x)\n#else\n#define MAKEDLLNAME(x) MAKEDLLNAME_A(x)\n#endif\n\n#if !defined(MAX_LONGPATH)\n#define MAX_LONGPATH   260 /* max. length of full pathname */\n#endif\n#if !defined(MAX_PATH_FNAME)\n#define MAX_PATH_FNAME   MAX_PATH /* max. length of full pathname */\n#endif\n\n#define __clr_reserved __reserved\n\n#endif // __PALCLR_H__\n\n#include \"palclr_win.h\"\n\n#ifndef IMAGE_FILE_MACHINE_LOONGARCH64\n#define IMAGE_FILE_MACHINE_LOONGARCH64       0x6264  // LOONGARCH64.\n#endif\n\n#endif // defined(HOST_WINDOWS)\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/palclr_win.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ===========================================================================\n// File: palclr.h\n//\n// Various macros and constants that are necessary to make the CLR portable.\n//\n\n// ===========================================================================\n\n#ifndef __PALCLR_WIN_H__\n#define __PALCLR_WIN_H__\n\n// PAL SEH\n// Macros for portable exception handling. The Win32 SEH is emulated using\n// these macros and setjmp/longjmp on Unix\n//\n// Usage notes:\n//\n// - The filter has to be a function taking two parameters:\n// LONG MyFilter(PEXCEPTION_POINTERS *pExceptionInfo, PVOID pv)\n//\n// - It is not possible to directly use the local variables in the filter.\n// All the local information that the filter has to need to know about should\n// be passed through pv parameter\n//\n// - Do not use goto to jump out of the PAL_TRY block\n// (jumping out of the try block is not a good idea even on Win32, because of\n// it causes stack unwind)\n//\n//\n// Simple examples:\n//\n// PAL_TRY {\n//   ....\n// } WIN_PAL_FINALLY {\n//   ....\n// }\n// WIN_PAL_ENDTRY\n//\n//\n// PAL_TRY {\n//   ....\n// } WIN_PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {\n//   ....\n// }\n// WIN_PAL_ENDTRY\n//\n//\n// LONG MyFilter(PEXCEPTION_POINTERS *pExceptionInfo, PVOID pv)\n// {\n// ...\n// }\n// PAL_TRY {\n//   ....\n// } WIN_PAL_EXCEPT_FILTER(MyFilter, NULL) {\n//   ....\n// }\n// WIN_PAL_ENDTRY\n//\n//\n// Complex example:\n//\n// struct MyParams\n// {\n//     ...\n// } params;\n//\n// PAL_TRY {\n//   PAL_TRY {\n//       ...\n//       if (error) goto Done;\n//       ...\n//   Done: ;\n//   } WIN_PAL_EXCEPT_FILTER(OtherFilter, &params) {\n//   ...\n//   }\n//   WIN_PAL_ENDTRY\n// }\n// WIN_PAL_FINALLY {\n// }\n// WIN_PAL_ENDTRY\n//\n\n\n\n#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(HOST_ARM) // @ARMTODO\n#define WIN_PAL_TRY_HANDLER_DBG_BEGIN                                           \\\n    BOOL ___oldOkayToThrowValue = FALSE;                                        \\\n    ClrDebugState *___pState = GetClrDebugState();                              \\\n    __try                                                                       \\\n    {                                                                           \\\n        ___oldOkayToThrowValue = ___pState->IsOkToThrow();                      \\\n        ___pState->SetOkToThrow(TRUE);                                          \\\n        ANNOTATION_TRY_BEGIN;\n\n// Special version that avoids touching the debug state after doing work in a DllMain for process or thread detach.\n#define WIN_PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason)                          \\\n    BOOL ___oldOkayToThrowValue = FALSE;                                        \\\n    BOOL ___oldSOTolerantState = FALSE;                                         \\\n    ClrDebugState *___pState = CheckClrDebugState();                            \\\n    __try                                                                       \\\n    {                                                                           \\\n        if (___pState)                                                          \\\n        {                                                                       \\\n            ___oldOkayToThrowValue = ___pState->IsOkToThrow();                  \\\n            ___pState->SetOkToThrow(TRUE);                                      \\\n        }                                                                       \\\n        if ((_reason == DLL_PROCESS_DETACH) || (_reason == DLL_THREAD_DETACH))  \\\n        {                                                                       \\\n            ___pState = NULL;                                                   \\\n        }                                                                       \\\n        ANNOTATION_TRY_BEGIN;\n\n#define WIN_PAL_TRY_HANDLER_DBG_END                                             \\\n        ANNOTATION_TRY_END;                                                     \\\n    }                                                                           \\\n    __finally                                                                   \\\n    {                                                                           \\\n        if (___pState != NULL)                                                  \\\n        {                                                                       \\\n            _ASSERTE(___pState == CheckClrDebugState());                        \\\n            ___pState->SetOkToThrow(___oldOkayToThrowValue);                    \\\n            ___pState->SetSOTolerance(___oldSOTolerantState);                   \\\n        }                                                                       \\\n    }\n\n#define WIN_PAL_ENDTRY_NAKED_DBG\n\n#else\n#define WIN_PAL_TRY_HANDLER_DBG_BEGIN                   ANNOTATION_TRY_BEGIN;\n#define WIN_PAL_TRY_HANDLER_DBG_BEGIN_DLLMAIN(_reason)  ANNOTATION_TRY_BEGIN;\n#define WIN_PAL_TRY_HANDLER_DBG_END                     ANNOTATION_TRY_END;\n#define WIN_PAL_ENDTRY_NAKED_DBG\n#endif // defined(ENABLE_CONTRACTS_IMPL)\n\n#if defined(HOST_WINDOWS)\n// Native system libray handle.\n// In Windows, NATIVE_LIBRARY_HANDLE is the same as HMODULE.\ntypedef HMODULE NATIVE_LIBRARY_HANDLE;\n#endif // HOST_WINDOWS\n\n#ifndef FALLTHROUGH\n#define FALLTHROUGH __fallthrough\n#endif // FALLTHROUGH\n\n#endif\t// __PALCLR_WIN_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/patchpointinfo.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// --------------------------------------------------------------------------------\n// patchpointinfo.h\n// --------------------------------------------------------------------------------\n\n#include <clrtypes.h>\n\n#ifndef _PATCHPOINTINFO_H_\n#define _PATCHPOINTINFO_H_\n\n// --------------------------------------------------------------------------------\n// Describes information needed to make an OSR transition\n//  - location of IL-visible locals and other important state on the \n//    original (Tier0) method frame, with respect to top of frame\n//    (hence these offsets will be negative as stack grows down)\n//  - total size of the original frame\n//  - callee save registers saved on the original (Tier0) frame\n//\n// Currently the patchpoint info is independent of the IL offset of the patchpoint.\n//\n// This data is produced when jitting a Tier0 method with OSR enabled, and consumed\n// by the Tier1/OSR jit request.\n//\nstruct PatchpointInfo\n{\n    // Determine how much storage is needed to hold this info\n    static unsigned ComputeSize(unsigned localCount)\n    {\n        unsigned baseSize     = sizeof(PatchpointInfo);\n        unsigned variableSize = localCount * sizeof(int);\n        unsigned totalSize    = baseSize + variableSize;\n        return totalSize;\n    }\n\n    // Initialize\n    void Initialize(unsigned localCount, int totalFrameSize)\n    {\n        m_calleeSaveRegisters     = 0;\n        m_totalFrameSize          = totalFrameSize;\n        m_numberOfLocals          = localCount;\n        m_genericContextArgOffset = -1;\n        m_keptAliveThisOffset     = -1;\n        m_securityCookieOffset    = -1;\n        m_monitorAcquiredOffset   = -1;\n    }\n\n    // Copy\n    void Copy(const PatchpointInfo* original)\n    {\n        m_calleeSaveRegisters = original->m_calleeSaveRegisters;\n        m_genericContextArgOffset = original->m_genericContextArgOffset;\n        m_keptAliveThisOffset = original->m_keptAliveThisOffset;\n        m_securityCookieOffset = original->m_securityCookieOffset;\n        m_monitorAcquiredOffset = original->m_monitorAcquiredOffset;\n\n        for (unsigned i = 0; i < original->m_numberOfLocals; i++)\n        {\n            m_offsetAndExposureData[i] = original->m_offsetAndExposureData[i];\n        }\n    }\n\n    // Total size of this patchpoint info record, in bytes\n    unsigned PatchpointInfoSize() const\n    {\n        return ComputeSize(m_numberOfLocals);\n    }\n\n    // Total frame size of the original method\n    int TotalFrameSize() const\n    {\n        return m_totalFrameSize;\n    }\n\n    // Number of locals in the original method (including special locals)\n    unsigned NumberOfLocals() const\n    {\n        return m_numberOfLocals;\n    }\n\n    // Original method caller SP offset for generic context arg\n    int GenericContextArgOffset() const\n    {\n        return m_genericContextArgOffset;\n    }\n\n    bool HasGenericContextArgOffset() const\n    {\n        return m_genericContextArgOffset != -1;\n    }\n\n    void SetGenericContextArgOffset(int offset)\n    {\n        m_genericContextArgOffset = offset;\n    }\n\n    // Original method FP relative offset for kept-alive this\n    int KeptAliveThisOffset() const\n    {\n        return m_keptAliveThisOffset;\n    }\n\n    bool HasKeptAliveThis() const\n    {\n        return m_keptAliveThisOffset != -1;\n    }\n\n    void SetKeptAliveThisOffset(int offset)\n    {\n        m_keptAliveThisOffset = offset;\n    }\n\n    // Original method FP relative offset for security cookie\n    int SecurityCookieOffset() const\n    {\n        return m_securityCookieOffset;\n    }\n\n    bool HasSecurityCookie() const\n    {\n        return m_securityCookieOffset != -1;\n    }\n\n    void SetSecurityCookieOffset(int offset)\n    {\n        m_securityCookieOffset = offset;\n    }\n\n    // Original method FP relative offset for monitor acquired flag\n    int MonitorAcquiredOffset() const\n    {\n        return m_monitorAcquiredOffset;\n    }\n\n    bool HasMonitorAcquired() const\n    {\n        return m_monitorAcquiredOffset != -1;\n    }\n\n    void SetMonitorAcquiredOffset(int offset)\n    {\n        m_monitorAcquiredOffset = offset;\n    }\n\n    // True if this local was address exposed in the original method\n    bool IsExposed(unsigned localNum) const\n    {\n        return ((m_offsetAndExposureData[localNum] & EXPOSURE_MASK) != 0);\n    }\n\n    // FP relative offset of this local in the original method\n    int Offset(unsigned localNum) const\n    {\n        return (m_offsetAndExposureData[localNum] >> OFFSET_SHIFT);\n    }\n\n    void SetOffsetAndExposure(unsigned localNum, int offset, bool isExposed)\n    {\n        m_offsetAndExposureData[localNum] = (offset << OFFSET_SHIFT) | (isExposed ? EXPOSURE_MASK : 0);\n    }\n\n    // Callee save registers saved by the original method.\n    // Includes all saves that must be restored (eg includes pushed RBP on x64).\n    //\n    uint64_t CalleeSaveRegisters() const\n    {\n        return m_calleeSaveRegisters;\n    }\n\n    void SetCalleeSaveRegisters(uint64_t registerMask)\n    {\n        m_calleeSaveRegisters = registerMask;\n    }\n\nprivate:\n    enum\n    {\n        OFFSET_SHIFT = 0x1,\n        EXPOSURE_MASK = 0x1\n    };\n\n    uint64_t m_calleeSaveRegisters;\n    unsigned m_numberOfLocals;\n    int      m_totalFrameSize;\n    int      m_genericContextArgOffset;\n    int      m_keptAliveThisOffset;\n    int      m_securityCookieOffset;\n    int      m_monitorAcquiredOffset;\n    int      m_offsetAndExposureData[];\n};\n\ntypedef DPTR(struct PatchpointInfo) PTR_PatchpointInfo;\n\n#endif // _PATCHPOINTINFO_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/pedecoder.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// --------------------------------------------------------------------------------\n// PEDecoder.h\n//\n\n// --------------------------------------------------------------------------------\n\n// --------------------------------------------------------------------------------\n// PEDecoder - Utility class for reading and verifying PE files.\n//\n// Note that the Check step is optional if you are willing to trust the\n// integrity of the image.\n// (Or at any rate can be factored into an initial verification step.)\n//\n// Functions which access the memory of the PE file take a \"flat\" flag - this\n// indicates whether the PE images data has been loaded flat the way it resides in the file,\n// or if the sections have been mapped into memory at the proper base addresses.\n//\n// Finally, some functions take an optional \"size\" argument, which can be used for\n// range verification.  This is an optional parameter, but if you omit it be sure\n// you verify the size in some other way.\n// --------------------------------------------------------------------------------\n\n\n#ifndef PEDECODER_H_\n#define PEDECODER_H_\n\n// --------------------------------------------------------------------------------\n// Required headers\n// --------------------------------------------------------------------------------\n\n#include \"windows.h\"\n#include \"clrtypes.h\"\n#include \"check.h\"\n#include \"contract.h\"\n#include \"cor.h\"\n#include \"corhdr.h\"\n\n#include \"corcompile.h\"\n\n#include \"readytorun.h\"\ntypedef DPTR(struct READYTORUN_CORE_HEADER) PTR_READYTORUN_CORE_HEADER;\ntypedef DPTR(struct READYTORUN_HEADER) PTR_READYTORUN_HEADER;\ntypedef DPTR(struct READYTORUN_SECTION) PTR_READYTORUN_SECTION;\n\ntypedef DPTR(IMAGE_COR20_HEADER)    PTR_IMAGE_COR20_HEADER;\n\n// --------------------------------------------------------------------------------\n// Forward declared types\n// --------------------------------------------------------------------------------\n\nclass Module;\n\n// --------------------------------------------------------------------------------\n// RVA definition\n// --------------------------------------------------------------------------------\n\n// Needs to be DWORD to avoid conflict with <imagehlp.h>\ntypedef DWORD RVA;\n\n#ifdef _MSC_VER\n// Wrapper to suppress ambiguous overload problems with MSVC.\ninline CHECK CheckOverflow(RVA value1, COUNT_T value2)\n{\n    WRAPPER_NO_CONTRACT;\n    CHECK(CheckOverflow((UINT32) value1, (UINT32) value2));\n    CHECK_OK;\n}\n#endif  // _MSC_VER\n\n// --------------------------------------------------------------------------------\n// IMAGE_FILE_MACHINE_NATIVE\n// --------------------------------------------------------------------------------\n\n#if defined(TARGET_X86)\n#define IMAGE_FILE_MACHINE_NATIVE   IMAGE_FILE_MACHINE_I386\n#elif defined(TARGET_AMD64)\n#define IMAGE_FILE_MACHINE_NATIVE   IMAGE_FILE_MACHINE_AMD64\n#elif defined(TARGET_ARM)\n#define IMAGE_FILE_MACHINE_NATIVE   IMAGE_FILE_MACHINE_ARMNT\n#elif defined(TARGET_ARM64)\n#define IMAGE_FILE_MACHINE_NATIVE   IMAGE_FILE_MACHINE_ARM64\n#elif defined(TARGET_LOONGARCH64)\n#define IMAGE_FILE_MACHINE_NATIVE   IMAGE_FILE_MACHINE_LOONGARCH64\n#elif defined(TARGET_POWERPC64)\n#define IMAGE_FILE_MACHINE_NATIVE   IMAGE_FILE_MACHINE_POWERPC\n#elif defined(TARGET_S390X)\n#define IMAGE_FILE_MACHINE_NATIVE   IMAGE_FILE_MACHINE_UNKNOWN\n#else\n#error \"port me\"\n#endif\n\n// Machine code for native images\n#if defined(__APPLE__)\n#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x4644\n#elif defined(__FreeBSD__)\n#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0xADC4\n#elif defined(__linux__)\n#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x7B79\n#elif defined(__NetBSD__)\n#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x1993\n#elif defined(__sun)\n#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0x1992\n#else\n#define IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE 0\n#endif\n\n#define IMAGE_FILE_MACHINE_NATIVE_NI (IMAGE_FILE_MACHINE_NATIVE ^ IMAGE_FILE_MACHINE_NATIVE_OS_OVERRIDE)\n\n// --------------------------------------------------------------------------------\n// Types\n// --------------------------------------------------------------------------------\n\ntypedef DPTR(class PEDecoder) PTR_PEDecoder;\n\ntypedef bool (*PEDecoder_ResourceTypesCallbackFunction)(LPCWSTR lpType, void* context);\ntypedef bool (*PEDecoder_ResourceNamesCallbackFunction)(LPCWSTR lpName, LPCWSTR lpType, void* context);\ntypedef bool (*PEDecoder_ResourceCallbackFunction)(LPCWSTR lpName, LPCWSTR lpType, DWORD langid, BYTE* data, COUNT_T cbData, void* context);\n\nclass PEDecoder\n{\n  public:\n\n    // ------------------------------------------------------------\n    // Public API\n    // ------------------------------------------------------------\n\n    // Access functions are divided into 3 categories:\n    //  Has - check if the element is present\n    //  Check - Do consistency checks on the element (requires Has).\n    //          This step is optional if you are willing to trust the integrity of the\n    //          image. (It is asserted in a checked build.)\n    //  Get - Access the element (requires Has and Check)\n\n    PEDecoder();\n    PEDecoder(void *flatBase, COUNT_T size);              // flatBase is the raw disk layout data (using MapViewOfFile)\n    PEDecoder(PTR_VOID mappedBase, bool relocated = FALSE);  // mappedBase is the mapped/expanded file (using LoadLibrary)\n\n    void Init(void *flatBase, COUNT_T size);\n    HRESULT Init(void *mappedBase, bool relocated = FALSE);\n    void   Reset();  //make sure you don't have a thread race\n\n    PTR_VOID GetBase() const;            // Currently loaded base, as opposed to GetPreferredBase()\n    BOOL IsMapped() const;\n    BOOL IsRelocated() const;\n    BOOL IsFlat() const;\n    BOOL HasContents() const;\n    COUNT_T GetSize() const;          // size of file on disk, as opposed to GetVirtualSize()\n\n    // High level image checks:\n\n    CHECK CheckFormat() const;        // Check whatever is present\n    CHECK CheckNTFormat() const;      // Check a PE file image\n    CHECK CheckCORFormat() const;     // Check a COR image (IL or native)\n    CHECK CheckILFormat() const;      // Check a managed image\n    CHECK CheckILOnlyFormat() const;  // Check an IL only image\n\n    // NT header access\n\n    BOOL HasNTHeaders() const;\n    CHECK CheckNTHeaders() const;\n\n    IMAGE_NT_HEADERS32 *GetNTHeaders32() const;\n    IMAGE_NT_HEADERS64 *GetNTHeaders64() const;\n    BOOL Has32BitNTHeaders() const;\n\n    const void *GetHeaders(COUNT_T *pSize = NULL) const;\n\n    BOOL IsDll() const;\n    BOOL HasBaseRelocations() const;\n    const void *GetPreferredBase() const; // OptionalHeaders.ImageBase\n    COUNT_T GetVirtualSize() const; // OptionalHeaders.SizeOfImage - size of mapped/expanded image in memory\n    WORD GetSubsystem() const;\n    WORD GetDllCharacteristics() const;\n    DWORD GetTimeDateStamp() const;\n    DWORD GetCheckSum() const;\n    WORD GetMachine() const;\n    WORD GetCharacteristics() const;\n    DWORD GetFileAlignment() const;\n    DWORD GetSectionAlignment() const;\n    SIZE_T GetSizeOfStackReserve() const;\n    SIZE_T GetSizeOfStackCommit() const;\n    SIZE_T GetSizeOfHeapReserve() const;\n    SIZE_T GetSizeOfHeapCommit() const;\n    UINT32 GetLoaderFlags() const;\n    UINT32 GetWin32VersionValue() const;\n    COUNT_T GetNumberOfRvaAndSizes() const;\n    COUNT_T GetNumberOfSections() const;\n    PTR_IMAGE_SECTION_HEADER FindFirstSection() const;\n    IMAGE_SECTION_HEADER *FindSection(LPCSTR sectionName) const;\n\n    DWORD GetImageIdentity() const;\n\n    BOOL HasWriteableSections() const;\n\n    // Directory entry access\n\n    BOOL HasDirectoryEntry(int entry) const;\n    CHECK CheckDirectoryEntry(int entry, int forbiddenFlags = 0, IsNullOK ok = NULL_NOT_OK) const;\n    IMAGE_DATA_DIRECTORY *GetDirectoryEntry(int entry) const;\n    TADDR GetDirectoryEntryData(int entry, COUNT_T *pSize = NULL) const;\n\n    // IMAGE_DATA_DIRECTORY access\n\n    CHECK CheckDirectory(IMAGE_DATA_DIRECTORY *pDir, int forbiddenFlags = 0, IsNullOK ok = NULL_NOT_OK) const;\n    TADDR GetDirectoryData(IMAGE_DATA_DIRECTORY *pDir) const;\n    TADDR GetDirectoryData(IMAGE_DATA_DIRECTORY *pDir, COUNT_T *pSize) const;\n\n    // Basic RVA access\n\n    CHECK CheckRva(RVA rva, IsNullOK ok = NULL_NOT_OK) const;\n    CHECK CheckRva(RVA rva, COUNT_T size, int forbiddenFlags=0, IsNullOK ok = NULL_NOT_OK) const;\n    TADDR GetRvaData(RVA rva, IsNullOK ok = NULL_NOT_OK) const;\n    // Called with ok=NULL_OK only for mapped fields (RVA statics)\n\n    CHECK CheckData(const void *data, IsNullOK ok = NULL_NOT_OK) const;\n    CHECK CheckData(const void *data, COUNT_T size, IsNullOK ok = NULL_NOT_OK) const;\n    RVA GetDataRva(const TADDR data) const;\n    BOOL PointerInPE(PTR_CVOID data) const;\n\n    // Flat mapping utilities - using PointerToRawData instead of (Relative)VirtualAddress\n    CHECK CheckOffset(COUNT_T fileOffset, IsNullOK ok = NULL_NOT_OK) const;\n    CHECK CheckOffset(COUNT_T fileOffset, COUNT_T size, IsNullOK ok = NULL_NOT_OK) const;\n    TADDR GetOffsetData(COUNT_T fileOffset, IsNullOK ok = NULL_NOT_OK) const;\n    // Called with ok=NULL_OK only for mapped fields (RVA statics)\n\n    // Mapping between RVA and file offsets\n    COUNT_T RvaToOffset(RVA rva) const;\n    RVA OffsetToRva(COUNT_T fileOffset) const;\n\n    // Base intra-image pointer access\n    // (These are for pointers retrieved out of the PE image)\n\n    CHECK CheckInternalAddress(SIZE_T address, IsNullOK ok = NULL_NOT_OK) const;\n    CHECK CheckInternalAddress(SIZE_T address, COUNT_T size, IsNullOK ok = NULL_NOT_OK) const;\n    TADDR GetInternalAddressData(SIZE_T address) const;\n\n    // CLR loader IL Image verification - these checks apply to IL_ONLY images.\n\n    BOOL IsILOnly() const;\n    CHECK CheckILOnly() const;\n\n    // Strong name & hashing support\n\n    BOOL HasStrongNameSignature() const;\n    CHECK CheckStrongNameSignature() const;\n    PTR_CVOID GetStrongNameSignature(COUNT_T *pSize = NULL) const;\n\n    // CorHeader flag support\n\n    // IsStrongNameSigned indicates whether the signature has been filled in.\n    // (otherwise if it has a signature it is delay signed.)\n    BOOL IsStrongNameSigned() const;    // TRUE if the COMIMAGE_FLAGS_STRONGNAMESIGNED flag is set\n\n    // TLS\n\n    BOOL HasTls() const;\n    CHECK CheckTls() const;\n    PTR_VOID GetTlsRange(COUNT_T *pSize = NULL) const;\n    UINT32 GetTlsIndex() const;\n\n    // Win32 resources\n    void *GetWin32Resource(LPCWSTR lpName, LPCWSTR lpType, COUNT_T *pSize = NULL) const;\n    bool EnumerateWin32ResourceTypes(PEDecoder_ResourceTypesCallbackFunction callback, void* context) const;\n    bool EnumerateWin32ResourceNames(LPCWSTR lpType, PEDecoder_ResourceNamesCallbackFunction callback, void* context) const;\n    bool EnumerateWin32Resources(LPCWSTR lpName, LPCWSTR lpType, PEDecoder_ResourceCallbackFunction callback, void* context) const;\n  public:\n\n    // COR header fields\n\n    BOOL HasCorHeader() const;\n    CHECK CheckCorHeader() const;\n    IMAGE_COR20_HEADER *GetCorHeader() const;\n\n    PTR_CVOID GetMetadata(COUNT_T *pSize = NULL) const;\n\n    const void *GetResources(COUNT_T *pSize = NULL) const;\n    CHECK CheckResource(COUNT_T offset) const;\n    const void *GetResource(COUNT_T offset, COUNT_T *pSize = NULL) const;\n\n    BOOL HasManagedEntryPoint() const;\n    ULONG GetEntryPointToken() const;\n    IMAGE_COR_VTABLEFIXUP *GetVTableFixups(COUNT_T *pCount = NULL) const;\n\n    BOOL IsNativeMachineFormat() const;\n    BOOL IsI386() const;\n\n    void GetPEKindAndMachine(DWORD * pdwPEKind, DWORD *pdwMachine);  // Returns CorPEKind flags\n    BOOL IsPlatformNeutral(); // Returns TRUE for IL-only platform neutral images\n\n    //\n    // Verifies that the IL is within the bounds of the image.\n    //\n    CHECK CheckILMethod(RVA rva);\n\n    //\n    // Compute size of IL blob. Assumes that the IL is within the bounds of the image - make sure\n    // to call CheckILMethod before calling this method.\n    //\n    static SIZE_T ComputeILMethodSize(TADDR pIL);\n\n    // Debug directory access, returns NULL if no such entry\n    PTR_IMAGE_DEBUG_DIRECTORY GetDebugDirectoryEntry(UINT index) const;\n\n    PTR_CVOID GetNativeManifestMetadata(COUNT_T* pSize = NULL) const;\n\n    BOOL IsComponentAssembly() const;\n    BOOL HasReadyToRunHeader() const;\n    READYTORUN_HEADER *GetReadyToRunHeader() const;\n\n    void  GetEXEStackSizes(SIZE_T *PE_SizeOfStackReserve, SIZE_T *PE_SizeOfStackCommit) const;\n\n    CHECK CheckWillCreateGuardPage() const;\n\n    // Native DLLMain Entrypoint\n    BOOL HasNativeEntryPoint() const;\n    void *GetNativeEntryPoint() const;\n\n    // Look up a named symbol in the export directory\n    PTR_VOID GetExport(LPCSTR exportName) const;\n\n#ifdef _DEBUG\n    // Stress mode for relocations\n    static BOOL GetForceRelocs();\n    static BOOL ForceRelocForDLL(LPCWSTR lpFileName);\n#endif\n\n#ifdef DACCESS_COMPILE\n    void EnumMemoryRegions(CLRDataEnumMemoryFlags flags, bool enumThis);\n#endif\n\n  protected:\n\n    // ------------------------------------------------------------\n    // Protected API for subclass use\n    // ------------------------------------------------------------\n\n    // Checking utilities\n    static CHECK CheckBounds(RVA rangeBase, COUNT_T rangeSize, RVA rva);\n    static CHECK CheckBounds(RVA rangeBase, COUNT_T rangeSize, RVA rva, COUNT_T size);\n\n    static CHECK CheckBounds(const void *rangeBase, COUNT_T rangeSize, const void *pointer);\n    static CHECK CheckBounds(PTR_CVOID rangeBase, COUNT_T rangeSize, PTR_CVOID pointer, COUNT_T size);\n\n  protected:\n\n    // Flat mapping utilities - using PointerToRawData instead of (Relative)VirtualAddress\n    IMAGE_SECTION_HEADER *RvaToSection(RVA rva) const;\n    IMAGE_SECTION_HEADER *OffsetToSection(COUNT_T fileOffset) const;\n\n    void SetRelocated();\n    IMAGE_NT_HEADERS* FindNTHeaders() const;\n\n  private:\n\n    // ------------------------------------------------------------\n    // Internal functions\n    // ------------------------------------------------------------\n\n    enum METADATA_SECTION_TYPE\n    {\n        METADATA_SECTION_FULL,\n    };\n\n    IMAGE_DATA_DIRECTORY *GetMetaDataHelper(METADATA_SECTION_TYPE type) const;\n\n    static PTR_IMAGE_SECTION_HEADER FindFirstSection(IMAGE_NT_HEADERS * pNTHeaders);\n\n    IMAGE_COR20_HEADER *FindCorHeader() const;\n    READYTORUN_HEADER *FindReadyToRunHeader() const;\n\n    // Flat mapping utilities\n    RVA InternalAddressToRva(SIZE_T address) const;\n\n    // NT header subchecks\n    CHECK CheckSection(COUNT_T previousAddressEnd, COUNT_T addressStart, COUNT_T addressSize,\n                       COUNT_T previousOffsetEnd, COUNT_T offsetStart, COUNT_T offsetSize) const;\n\n    // Pure managed subchecks\n    CHECK CheckILOnlyImportDlls() const;\n    CHECK CheckILOnlyImportByNameTable(RVA rva) const;\n    CHECK CheckILOnlyBaseRelocations() const;\n    CHECK CheckILOnlyEntryPoint() const;\n\n    // ------------------------------------------------------------\n    // Instance members\n    // ------------------------------------------------------------\n\n    enum\n    {\n        FLAG_MAPPED             = 0x01, // the file is mapped/hydrated (vs. the raw disk layout)\n        FLAG_CONTENTS           = 0x02, // the file has contents\n        FLAG_RELOCATED          = 0x04, // relocs have been applied\n        FLAG_NT_CHECKED         = 0x10,\n        FLAG_COR_CHECKED        = 0x20,\n        FLAG_IL_ONLY_CHECKED    = 0x40,\n        FLAG_NATIVE_CHECKED     = 0x80,\n\n        FLAG_HAS_NO_READYTORUN_HEADER = 0x100,\n    };\n\n    TADDR               m_base;\n    COUNT_T             m_size;     // size of file on disk, as opposed to OptionalHeaders.SizeOfImage\n    ULONG               m_flags;\n\n    PTR_IMAGE_NT_HEADERS   m_pNTHeaders;\n    PTR_IMAGE_COR20_HEADER m_pCorHeader;\n    PTR_READYTORUN_HEADER  m_pReadyToRunHeader;\n};\n\n//\n//  MethodSectionIterator class is used to iterate hot (or) cold method section in an ngen image.\n//  It can also iterate nibble maps generated by the JIT in a regular HeapList.\n//\nclass MethodSectionIterator\n{\n  private:\n    PTR_DWORD m_codeTableStart;\n    PTR_DWORD m_codeTable;\n    PTR_DWORD m_codeTableEnd;\n\n    BYTE *m_code;\n\n    DWORD m_dword;\n    DWORD m_index;\n\n    BYTE *m_current;\n\n  public:\n\n    //If code is a target pointer, then GetMethodCode and FindMethodCode return\n    //target pointers.  codeTable may be a pointer of either type, since it is\n    //converted internally into a host pointer.\n    MethodSectionIterator(const void *code, SIZE_T codeSize,\n                          const void *codeTable, SIZE_T codeTableSize);\n    BOOL Next();\n    BYTE *GetMethodCode() { return m_current; } // Get the start of method code of the current method in the iterator\n};\n\n#include \"pedecoder.inl\"\n\n#endif  // PEDECODER_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/pedecoder.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// --------------------------------------------------------------------------------\n// PEDecoder.inl\n//\n\n// --------------------------------------------------------------------------------\n\n#ifndef _PEDECODER_INL_\n#define _PEDECODER_INL_\n\n#include \"pedecoder.h\"\n#include \"ex.h\"\n\n#ifndef DACCESS_COMPILE\n\ninline PEDecoder::PEDecoder()\n  : m_base(0),\n    m_size(0),\n    m_flags(0),\n    m_pNTHeaders(nullptr),\n    m_pCorHeader(nullptr),\n    m_pReadyToRunHeader(nullptr)\n{\n    CONTRACTL\n    {\n        CONSTRUCTOR_CHECK;\n        NOTHROW;\n        CANNOT_TAKE_LOCK;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n}\n#else\ninline PEDecoder::PEDecoder()\n{\n    LIMITED_METHOD_CONTRACT;\n}\n#endif // #ifndef DACCESS_COMPILE\n\ninline PTR_VOID PEDecoder::GetBase() const\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    return PTR_VOID(m_base);\n}\n\ninline BOOL PEDecoder::IsMapped() const\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    return (m_flags & FLAG_MAPPED) != 0;\n}\n\ninline BOOL PEDecoder::IsRelocated() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (m_flags & FLAG_RELOCATED) != 0;\n}\n\ninline void PEDecoder::SetRelocated()\n{\n    m_flags |= FLAG_RELOCATED;\n}\n\ninline BOOL PEDecoder::IsFlat() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return HasContents() && !IsMapped();\n}\n\ninline BOOL PEDecoder::HasContents() const\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    return (m_flags & FLAG_CONTENTS) != 0;\n}\n\ninline COUNT_T PEDecoder::GetSize() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return m_size;\n}\n\ninline PEDecoder::PEDecoder(PTR_VOID mappedBase, bool fixedUp /*= FALSE*/)\n  : m_base(dac_cast<TADDR>(mappedBase)),\n    m_size(0),\n    m_flags(FLAG_MAPPED | FLAG_CONTENTS | FLAG_NT_CHECKED | (fixedUp ? FLAG_RELOCATED : 0)),\n    m_pNTHeaders(nullptr),\n    m_pCorHeader(nullptr),\n    m_pReadyToRunHeader(nullptr)\n{\n    CONTRACTL\n    {\n        CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(mappedBase));\n        PRECONDITION(PEDecoder(mappedBase,fixedUp).CheckNTHeaders());\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    // Temporarily set the size to 2 pages, so we can get the headers.\n    m_size = GetOsPageSize()*2;\n\n    m_pNTHeaders = PTR_IMAGE_NT_HEADERS(FindNTHeaders());\n    if (!m_pNTHeaders)\n        ThrowHR(COR_E_BADIMAGEFORMAT);\n\n    m_size = VAL32(m_pNTHeaders->OptionalHeader.SizeOfImage);\n}\n\n#ifndef DACCESS_COMPILE\n\n//REM\n//what's the right way to do this?\n//we want to use some against TADDR, but also want to do\n//some against what's just in the current process.\n//m_base is a TADDR in DAC all the time, though.\n//Have to implement separate fn to do the lookup??\ninline PEDecoder::PEDecoder(void *flatBase, COUNT_T size)\n  : m_base((TADDR)flatBase),\n    m_size(size),\n    m_flags(FLAG_CONTENTS),\n    m_pNTHeaders(NULL),\n    m_pCorHeader(NULL),\n    m_pReadyToRunHeader(NULL)\n{\n    CONTRACTL\n    {\n        CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(flatBase));\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n}\n\ninline void PEDecoder::Init(void *flatBase, COUNT_T size)\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION((size == 0) || CheckPointer(flatBase));\n        PRECONDITION(!HasContents());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    m_base = (TADDR)flatBase;\n    m_size = size;\n    m_flags = FLAG_CONTENTS;\n}\n\n\n\ninline HRESULT PEDecoder::Init(void *mappedBase, bool fixedUp /*= FALSE*/)\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(mappedBase));\n        PRECONDITION(!HasContents());\n    }\n    CONTRACTL_END;\n\n    m_base = (TADDR)mappedBase;\n    m_flags = FLAG_MAPPED | FLAG_CONTENTS;\n    if (fixedUp)\n        m_flags |= FLAG_RELOCATED;\n\n    // Temporarily set the size to 2 pages, so we can get the headers.\n    m_size = GetOsPageSize()*2;\n\n    m_pNTHeaders = FindNTHeaders();\n    if (!m_pNTHeaders)\n        return COR_E_BADIMAGEFORMAT;\n\n    m_size = VAL32(m_pNTHeaders->OptionalHeader.SizeOfImage);\n    return S_OK;\n}\n\ninline void PEDecoder::Reset()\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n    m_base=NULL;\n    m_flags=NULL;\n    m_size=NULL;\n    m_pNTHeaders=NULL;\n    m_pCorHeader=NULL;\n    m_pReadyToRunHeader=NULL;\n}\n#endif // #ifndef DACCESS_COMPILE\n\n\ninline IMAGE_NT_HEADERS32 *PEDecoder::GetNTHeaders32() const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n    return dac_cast<PTR_IMAGE_NT_HEADERS32>(FindNTHeaders());\n}\n\ninline IMAGE_NT_HEADERS64 *PEDecoder::GetNTHeaders64() const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n    return dac_cast<PTR_IMAGE_NT_HEADERS64>(FindNTHeaders());\n}\n\ninline BOOL PEDecoder::Has32BitNTHeaders() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(HasNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    return (FindNTHeaders()->OptionalHeader.Magic == VAL16(IMAGE_NT_OPTIONAL_HDR32_MAGIC));\n}\n\ninline const void *PEDecoder::GetHeaders(COUNT_T *pSize) const\n{\n    CONTRACT(const void *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n    }\n    CONTRACT_END;\n\n    //even though some data in OptionalHeader is different for 32 and 64, this field is the same\n    if (pSize != NULL)\n        *pSize = VAL32(FindNTHeaders()->OptionalHeader.SizeOfHeaders);\n\n    RETURN (const void *) m_base;\n}\n\ninline BOOL PEDecoder::IsDll() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    return ((FindNTHeaders()->FileHeader.Characteristics & VAL16(IMAGE_FILE_DLL)) != 0);\n}\n\ninline BOOL PEDecoder::HasBaseRelocations() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    return ((FindNTHeaders()->FileHeader.Characteristics & VAL16(IMAGE_FILE_RELOCS_STRIPPED)) == 0);\n}\n\ninline const void *PEDecoder::GetPreferredBase() const\n{\n    CONTRACT(const void *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL, NULL_OK));\n    }\n    CONTRACT_END;\n\n    if (Has32BitNTHeaders())\n        RETURN (const void *) (SIZE_T) VAL32(GetNTHeaders32()->OptionalHeader.ImageBase);\n    else\n        RETURN (const void *) (SIZE_T) VAL64(GetNTHeaders64()->OptionalHeader.ImageBase);\n}\n\ninline COUNT_T PEDecoder::GetVirtualSize() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    //even though some data in OptionalHeader is different for 32 and 64,  this field is the same\n    return VAL32(FindNTHeaders()->OptionalHeader.SizeOfImage);\n}\n\ninline WORD PEDecoder::GetSubsystem() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    //even though some data in OptionalHeader is different for 32 and 64,  this field is the same\n    return VAL16(FindNTHeaders()->OptionalHeader.Subsystem);\n}\n\ninline WORD PEDecoder::GetDllCharacteristics() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    //even though some data in OptionalHeader is different for 32 and 64,  this field is the same\n    return VAL16(FindNTHeaders()->OptionalHeader.DllCharacteristics);\n}\n\ninline DWORD PEDecoder::GetTimeDateStamp() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    return VAL32(FindNTHeaders()->FileHeader.TimeDateStamp);\n}\n\ninline DWORD PEDecoder::GetCheckSum() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    //even though some data in OptionalHeader is different for 32 and 64,  this field is the same\n    return VAL32(FindNTHeaders()->OptionalHeader.CheckSum);\n}\n\ninline DWORD PEDecoder::GetFileAlignment() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    //even though some data in OptionalHeader is different for 32 and 64,  this field is the same\n    return VAL32(FindNTHeaders()->OptionalHeader.FileAlignment);\n}\n\ninline DWORD PEDecoder::GetSectionAlignment() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    //even though some data in OptionalHeader is different for 32 and 64,  this field is the same\n    return VAL32(FindNTHeaders()->OptionalHeader.SectionAlignment);\n}\n\ninline WORD PEDecoder::GetMachine() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    return VAL16(FindNTHeaders()->FileHeader.Machine);\n}\n\ninline WORD PEDecoder::GetCharacteristics() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    return VAL16(FindNTHeaders()->FileHeader.Characteristics);\n}\n\ninline SIZE_T PEDecoder::GetSizeOfStackReserve() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return (SIZE_T) VAL32(GetNTHeaders32()->OptionalHeader.SizeOfStackReserve);\n    else\n        return (SIZE_T) VAL64(GetNTHeaders64()->OptionalHeader.SizeOfStackReserve);\n}\n\n\ninline SIZE_T PEDecoder::GetSizeOfStackCommit() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return (SIZE_T) VAL32(GetNTHeaders32()->OptionalHeader.SizeOfStackCommit);\n    else\n        return (SIZE_T) VAL64(GetNTHeaders64()->OptionalHeader.SizeOfStackCommit);\n}\n\n\ninline SIZE_T PEDecoder::GetSizeOfHeapReserve() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return (SIZE_T) VAL32(GetNTHeaders32()->OptionalHeader.SizeOfHeapReserve);\n    else\n        return (SIZE_T) VAL64(GetNTHeaders64()->OptionalHeader.SizeOfHeapReserve);\n}\n\n\ninline SIZE_T PEDecoder::GetSizeOfHeapCommit() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return (SIZE_T) VAL32(GetNTHeaders32()->OptionalHeader.SizeOfHeapCommit);\n    else\n        return (SIZE_T) VAL64(GetNTHeaders64()->OptionalHeader.SizeOfHeapCommit);\n}\n\ninline UINT32 PEDecoder::GetLoaderFlags() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return VAL32(GetNTHeaders32()->OptionalHeader.LoaderFlags);\n    else\n        return VAL32(GetNTHeaders64()->OptionalHeader.LoaderFlags);\n}\n\ninline UINT32 PEDecoder::GetWin32VersionValue() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return VAL32(GetNTHeaders32()->OptionalHeader.Win32VersionValue);\n    else\n        return VAL32(GetNTHeaders64()->OptionalHeader.Win32VersionValue);\n}\n\ninline COUNT_T PEDecoder::GetNumberOfRvaAndSizes() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return VAL32(GetNTHeaders32()->OptionalHeader.NumberOfRvaAndSizes);\n    else\n        return VAL32(GetNTHeaders64()->OptionalHeader.NumberOfRvaAndSizes);\n}\n\ninline BOOL PEDecoder::HasDirectoryEntry(int entry) const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    if (Has32BitNTHeaders())\n        return (GetNTHeaders32()->OptionalHeader.DataDirectory[entry].VirtualAddress != 0);\n    else\n        return (GetNTHeaders64()->OptionalHeader.DataDirectory[entry].VirtualAddress != 0);\n}\n\ninline IMAGE_DATA_DIRECTORY *PEDecoder::GetDirectoryEntry(int entry) const\n{\n    CONTRACT(IMAGE_DATA_DIRECTORY *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    if (Has32BitNTHeaders())\n        RETURN dac_cast<PTR_IMAGE_DATA_DIRECTORY>(\n            dac_cast<TADDR>(GetNTHeaders32()) +\n            offsetof(IMAGE_NT_HEADERS32, OptionalHeader.DataDirectory) +\n            entry * sizeof(IMAGE_DATA_DIRECTORY));\n    else\n        RETURN dac_cast<PTR_IMAGE_DATA_DIRECTORY>(\n            dac_cast<TADDR>(GetNTHeaders64()) +\n            offsetof(IMAGE_NT_HEADERS64, OptionalHeader.DataDirectory) +\n            entry * sizeof(IMAGE_DATA_DIRECTORY));\n}\n\ninline TADDR PEDecoder::GetDirectoryEntryData(int entry, COUNT_T *pSize) const\n{\n    CONTRACT(TADDR)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(CheckDirectoryEntry(entry, 0, NULL_OK));\n        PRECONDITION(CheckPointer(pSize, NULL_OK));\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer((void *)RETVAL, NULL_OK));\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    IMAGE_DATA_DIRECTORY *pDir = GetDirectoryEntry(entry);\n\n    if (pSize != NULL)\n        *pSize = VAL32(pDir->Size);\n\n    RETURN GetDirectoryData(pDir);\n}\n\ninline TADDR PEDecoder::GetDirectoryData(IMAGE_DATA_DIRECTORY *pDir) const\n{\n    CONTRACT(TADDR)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(CheckDirectory(pDir, 0, NULL_OK));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n        POSTCONDITION(CheckPointer((void *)RETVAL, NULL_OK));\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACT_END;\n\n    RETURN GetRvaData(VAL32(pDir->VirtualAddress));\n}\n\ninline TADDR PEDecoder::GetDirectoryData(IMAGE_DATA_DIRECTORY *pDir, COUNT_T *pSize) const\n{\n    CONTRACT(TADDR)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(CheckDirectory(pDir, 0, NULL_OK));\n        PRECONDITION(CheckPointer(pSize));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n        POSTCONDITION(CheckPointer((void *)RETVAL, NULL_OK));\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACT_END;\n\n    *pSize = VAL32(pDir->Size);\n\n    RETURN GetRvaData(VAL32(pDir->VirtualAddress));\n}\n\ninline TADDR PEDecoder::GetInternalAddressData(SIZE_T address) const\n{\n    CONTRACT(TADDR)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(CheckInternalAddress(address, NULL_OK));\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer((void *)RETVAL));\n    }\n    CONTRACT_END;\n\n    RETURN GetRvaData(InternalAddressToRva(address));\n}\n\ninline BOOL PEDecoder::HasCorHeader() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        SUPPORTS_DAC;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    return HasDirectoryEntry(IMAGE_DIRECTORY_ENTRY_COMHEADER);\n}\n\ninline BOOL PEDecoder::IsILOnly() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(HasCorHeader());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    // Pretend that ready-to-run images are IL-only\n    return((GetCorHeader()->Flags & VAL32(COMIMAGE_FLAGS_ILONLY)) != 0) || HasReadyToRunHeader();\n}\n\ninline COUNT_T PEDecoder::RvaToOffset(RVA rva) const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(CheckRva(rva,NULL_OK));\n        NOTHROW;\n        CANNOT_TAKE_LOCK;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n    if(rva > 0)\n    {\n        IMAGE_SECTION_HEADER *section = RvaToSection(rva);\n        if (section == NULL)\n            return rva;\n\n        return rva - VAL32(section->VirtualAddress) + VAL32(section->PointerToRawData);\n    }\n    else return 0;\n}\n\ninline RVA PEDecoder::OffsetToRva(COUNT_T fileOffset) const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(CheckOffset(fileOffset,NULL_OK));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n    if(fileOffset > 0)\n    {\n        IMAGE_SECTION_HEADER *section = OffsetToSection(fileOffset);\n        PREFIX_ASSUME (section!=NULL); //TODO: actually it is possible that it si null we need to rethink how we handle this cases and do better there\n\n        return fileOffset - VAL32(section->PointerToRawData) + VAL32(section->VirtualAddress);\n    }\n    else return 0;\n}\n\n\ninline BOOL PEDecoder::IsStrongNameSigned() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(HasCorHeader());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    return ((GetCorHeader()->Flags & VAL32(COMIMAGE_FLAGS_STRONGNAMESIGNED)) != 0);\n}\n\n\ninline BOOL PEDecoder::HasStrongNameSignature() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(HasCorHeader());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    return (GetCorHeader()->StrongNameSignature.VirtualAddress != 0);\n}\n\ninline CHECK PEDecoder::CheckStrongNameSignature() const\n{\n    CONTRACT_CHECK\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(HasCorHeader());\n        PRECONDITION(HasStrongNameSignature());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_CHECK_END;\n\n    return CheckDirectory(&GetCorHeader()->StrongNameSignature, IMAGE_SCN_MEM_WRITE, NULL_OK);\n}\n\ninline PTR_CVOID PEDecoder::GetStrongNameSignature(COUNT_T *pSize) const\n{\n    CONTRACT(PTR_CVOID)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(HasCorHeader());\n        PRECONDITION(HasStrongNameSignature());\n        PRECONDITION(CheckStrongNameSignature());\n        PRECONDITION(CheckPointer(pSize, NULL_OK));\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n    }\n    CONTRACT_END;\n\n    IMAGE_DATA_DIRECTORY *pDir = &GetCorHeader()->StrongNameSignature;\n\n    if (pSize != NULL)\n        *pSize = VAL32(pDir->Size);\n\n    RETURN dac_cast<PTR_CVOID>(GetDirectoryData(pDir));\n}\n\ninline BOOL PEDecoder::HasTls() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    return HasDirectoryEntry(IMAGE_DIRECTORY_ENTRY_TLS);\n}\n\ninline CHECK PEDecoder::CheckTls() const\n{\n    CONTRACT_CHECK\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_CHECK_END;\n\n    CHECK(CheckDirectoryEntry(IMAGE_DIRECTORY_ENTRY_TLS, 0, NULL_OK));\n\n    IMAGE_TLS_DIRECTORY *pTlsHeader = (IMAGE_TLS_DIRECTORY *) GetDirectoryEntryData(IMAGE_DIRECTORY_ENTRY_TLS);\n\n    CHECK(CheckUnderflow(VALPTR(pTlsHeader->EndAddressOfRawData), VALPTR(pTlsHeader->StartAddressOfRawData)));\n    CHECK(VALPTR(pTlsHeader->EndAddressOfRawData) - VALPTR(pTlsHeader->StartAddressOfRawData) <= COUNT_T_MAX);\n\n    CHECK(CheckInternalAddress(VALPTR(pTlsHeader->StartAddressOfRawData),\n        (COUNT_T) (VALPTR(pTlsHeader->EndAddressOfRawData) - VALPTR(pTlsHeader->StartAddressOfRawData))));\n\n    CHECK_OK;\n}\n\ninline PTR_VOID PEDecoder::GetTlsRange(COUNT_T * pSize) const\n{\n    CONTRACT(void *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(HasTls());\n        PRECONDITION(CheckTls());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n    }\n    CONTRACT_END;\n\n    IMAGE_TLS_DIRECTORY *pTlsHeader =\n        PTR_IMAGE_TLS_DIRECTORY(GetDirectoryEntryData(IMAGE_DIRECTORY_ENTRY_TLS));\n\n    if (pSize != 0)\n        *pSize = (COUNT_T) (VALPTR(pTlsHeader->EndAddressOfRawData) - VALPTR(pTlsHeader->StartAddressOfRawData));\n    PREFIX_ASSUME (pTlsHeader!=NULL);\n    RETURN PTR_VOID(GetInternalAddressData(pTlsHeader->StartAddressOfRawData));\n}\n\ninline UINT32 PEDecoder::GetTlsIndex() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(HasTls());\n        PRECONDITION(CheckTls());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    IMAGE_TLS_DIRECTORY *pTlsHeader = (IMAGE_TLS_DIRECTORY *) GetDirectoryEntryData(IMAGE_DIRECTORY_ENTRY_TLS);\n\n    return (UINT32)*PTR_UINT32(GetInternalAddressData((SIZE_T)VALPTR(pTlsHeader->AddressOfIndex)));\n}\n\ninline IMAGE_COR20_HEADER *PEDecoder::GetCorHeader() const\n{\n    CONTRACT(IMAGE_COR20_HEADER *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(HasCorHeader());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    if (m_pCorHeader == NULL)\n        const_cast<PEDecoder *>(this)->m_pCorHeader =\n            dac_cast<PTR_IMAGE_COR20_HEADER>(FindCorHeader());\n\n    RETURN m_pCorHeader;\n}\n\ninline BOOL PEDecoder::IsNativeMachineFormat() const\n{\n    if (!HasContents() || !HasNTHeaders() )\n        return FALSE;\n    _ASSERTE(m_pNTHeaders);\n    WORD expectedFormat = HasCorHeader() && HasReadyToRunHeader() ?\n        IMAGE_FILE_MACHINE_NATIVE_NI :\n        IMAGE_FILE_MACHINE_NATIVE;\n    //do not call GetNTHeaders as we do not want to bother with PE32->PE32+ conversion\n    return m_pNTHeaders->FileHeader.Machine==expectedFormat;\n}\n\ninline BOOL PEDecoder::IsI386() const\n{\n    if (!HasContents() || !HasNTHeaders() )\n        return FALSE;\n    _ASSERTE(m_pNTHeaders);\n    //do not call GetNTHeaders as we do not want to bother with PE32->PE32+ conversion\n    return m_pNTHeaders->FileHeader.Machine==IMAGE_FILE_MACHINE_I386;\n}\n\n// static\ninline PTR_IMAGE_SECTION_HEADER PEDecoder::FindFirstSection(IMAGE_NT_HEADERS * pNTHeaders)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    return dac_cast<PTR_IMAGE_SECTION_HEADER>(\n        dac_cast<TADDR>(pNTHeaders) +\n        offsetof(IMAGE_NT_HEADERS, OptionalHeader) +\n        VAL16(pNTHeaders->FileHeader.SizeOfOptionalHeader));\n}\n\ninline COUNT_T PEDecoder::GetNumberOfSections() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    return VAL16(FindNTHeaders()->FileHeader.NumberOfSections);\n}\n\n\ninline DWORD PEDecoder::GetImageIdentity() const\n{\n    WRAPPER_NO_CONTRACT;\n    return GetTimeDateStamp() ^ GetCheckSum() ^ DWORD( GetVirtualSize() );\n}\n\n\ninline PTR_IMAGE_SECTION_HEADER PEDecoder::FindFirstSection() const\n{\n    CONTRACT(IMAGE_SECTION_HEADER *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    RETURN FindFirstSection(FindNTHeaders());\n}\n\ninline IMAGE_NT_HEADERS *PEDecoder::FindNTHeaders() const\n{\n    CONTRACT(IMAGE_NT_HEADERS *)\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    RETURN PTR_IMAGE_NT_HEADERS(m_base + VAL32(PTR_IMAGE_DOS_HEADER(m_base)->e_lfanew));\n}\n\ninline IMAGE_COR20_HEADER *PEDecoder::FindCorHeader() const\n{\n    CONTRACT(IMAGE_COR20_HEADER *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(HasCorHeader());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    const IMAGE_COR20_HEADER * pCor=PTR_IMAGE_COR20_HEADER(GetDirectoryEntryData(IMAGE_DIRECTORY_ENTRY_COMHEADER));\n    RETURN ((IMAGE_COR20_HEADER*)pCor);\n}\n\ninline CHECK PEDecoder::CheckBounds(RVA rangeBase, COUNT_T rangeSize, RVA rva)\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n    CHECK(CheckOverflow(rangeBase, rangeSize));\n    CHECK(rva >= rangeBase);\n    CHECK(rva <= rangeBase + rangeSize);\n    CHECK_OK;\n}\n\ninline CHECK PEDecoder::CheckBounds(RVA rangeBase, COUNT_T rangeSize, RVA rva, COUNT_T size)\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n    CHECK(CheckOverflow(rangeBase, rangeSize));\n    CHECK(CheckOverflow(rva, size));\n    CHECK(rva >= rangeBase);\n    CHECK(rva + size <= rangeBase + rangeSize);\n    CHECK_OK;\n}\n\ninline CHECK PEDecoder::CheckBounds(const void *rangeBase, COUNT_T rangeSize, const void *pointer)\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n    CHECK(CheckOverflow(dac_cast<PTR_CVOID>(rangeBase), rangeSize));\n    CHECK(dac_cast<TADDR>(pointer) >= dac_cast<TADDR>(rangeBase));\n    CHECK(dac_cast<TADDR>(pointer) <= dac_cast<TADDR>(rangeBase) + rangeSize);\n    CHECK_OK;\n}\n\ninline CHECK PEDecoder::CheckBounds(PTR_CVOID rangeBase, COUNT_T rangeSize, PTR_CVOID pointer, COUNT_T size)\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n    CHECK(CheckOverflow(rangeBase, rangeSize));\n    CHECK(CheckOverflow(pointer, size));\n    CHECK(dac_cast<TADDR>(pointer) >= dac_cast<TADDR>(rangeBase));\n    CHECK(dac_cast<TADDR>(pointer) + size <= dac_cast<TADDR>(rangeBase) + rangeSize);\n    CHECK_OK;\n}\n\ninline void PEDecoder::GetPEKindAndMachine(DWORD * pdwPEKind, DWORD *pdwMachine)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    DWORD dwKind=0,dwMachine=0;\n    if(HasContents() && HasNTHeaders())\n    {\n        dwMachine = GetMachine();\n\n        BOOL fIsPE32Plus = !Has32BitNTHeaders();\n\n        if (fIsPE32Plus)\n            dwKind |= (DWORD)pe32Plus;\n\n        if (HasCorHeader())\n        {\n            IMAGE_COR20_HEADER * pCorHdr = GetCorHeader();\n            if(pCorHdr != NULL)\n            {\n                DWORD dwCorFlags = pCorHdr->Flags;\n\n                if (dwCorFlags & VAL32(COMIMAGE_FLAGS_ILONLY))\n                {\n                    dwKind |= (DWORD)peILonly;\n#ifdef HOST_64BIT\n                    // compensate for shim promotion of PE32/ILONLY headers to PE32+ on WIN64\n                    if (fIsPE32Plus && (GetMachine() == IMAGE_FILE_MACHINE_I386))\n                        dwKind &= ~((DWORD)pe32Plus);\n#endif\n                }\n\n                if (COR_IS_32BIT_REQUIRED(dwCorFlags))\n                    dwKind |= (DWORD)pe32BitRequired;\n                else if (COR_IS_32BIT_PREFERRED(dwCorFlags))\n                    dwKind |= (DWORD)pe32BitPreferred;\n\n                // compensate for MC++ peculiarity\n                if(dwKind == 0)\n                    dwKind = (DWORD)pe32BitRequired;\n            }\n            else\n            {\n                dwKind |= (DWORD)pe32Unmanaged;\n            }\n\n            if (HasReadyToRunHeader())\n            {\n                if (dwMachine == IMAGE_FILE_MACHINE_NATIVE_NI)\n                {\n                    // Supply the original machine type to the assembly binder\n                    dwMachine = IMAGE_FILE_MACHINE_NATIVE;\n                }\n\n                if ((GetReadyToRunHeader()->CoreHeader.Flags & READYTORUN_FLAG_PLATFORM_NEUTRAL_SOURCE) != 0)\n                {\n                    // Supply the original PEKind/Machine to the assembly binder to make the full assembly name look like the original\n                    dwKind = peILonly;\n                    dwMachine = IMAGE_FILE_MACHINE_I386;\n                }\n            }\n        }\n        else\n        {\n            dwKind |= (DWORD)pe32Unmanaged;\n        }\n    }\n\n    *pdwPEKind = dwKind;\n    *pdwMachine = dwMachine;\n}\n\ninline BOOL PEDecoder::IsPlatformNeutral()\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    DWORD dwKind, dwMachine;\n    GetPEKindAndMachine(&dwKind, &dwMachine);\n    return ((dwKind & (peILonly | pe32Plus | pe32BitRequired)) == peILonly) && (dwMachine == IMAGE_FILE_MACHINE_I386);\n}\n\ninline BOOL PEDecoder::IsComponentAssembly() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    return HasReadyToRunHeader() && (m_pReadyToRunHeader->CoreHeader.Flags & READYTORUN_FLAG_COMPONENT) != 0;\n}\n\ninline BOOL PEDecoder::HasReadyToRunHeader() const\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    if (m_flags & FLAG_HAS_NO_READYTORUN_HEADER)\n        return FALSE;\n\n    if (m_pReadyToRunHeader != NULL)\n        return TRUE;\n\n    return FindReadyToRunHeader() != NULL;\n}\n\ninline READYTORUN_HEADER * PEDecoder::GetReadyToRunHeader() const\n{\n    CONTRACT(READYTORUN_HEADER *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckNTHeaders());\n        PRECONDITION(HasCorHeader());\n        PRECONDITION(HasReadyToRunHeader());\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(CheckPointer(RETVAL));\n        SUPPORTS_DAC;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACT_END;\n\n    if (m_pReadyToRunHeader != NULL)\n        RETURN m_pReadyToRunHeader;\n\n    RETURN FindReadyToRunHeader();\n}\n\n#endif // _PEDECODER_INL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/pesectionman.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// Section Manager for portable executables\n// Common to both Memory Only and Static (EXE making) code\n\n\n#ifndef PESectionMan_H\n#define PESectionMan_H\n\n#include \"windef.h\"\n\n#include \"ceegen.h\"\n#include \"blobfetcher.h\"\n\nclass PESection;\nstruct PESectionReloc;\n\nstruct _IMAGE_SECTION_HEADER;\n\nclass PESectionMan\n{\npublic:\n\n    virtual ~PESectionMan() {}\n\n    HRESULT Init();\n    HRESULT Cleanup();\n\n    // Finds section with given name, or creates a new one\n    HRESULT getSectionCreate(\n        const char *name,\n        unsigned flags, // IMAGE_SCN_* flags. eg. IMAGE_SCN_CNT_INITIALIZED_DATA\n        PESection **section);\n\n    // Since we allocate, we must delete (Bug in VC, see knowledge base Q122675)\n    void sectionDestroy(PESection **section);\n\n    // Apply all the relocs for in memory conversion\n    HRESULT applyRelocs(CeeGenTokenMapper *pTokenMapper);\n\n    HRESULT cloneInstance(PESectionMan *destination);\n\nprotected:\n\n    // Finds section with given name.  returns 0 if not found\n    virtual PESection *getSection(const char *name);\n\n    // Create a new section\n    virtual HRESULT newSection(\n        const char *name,\n        PESection **section,\n        unsigned    flags     = sdNone,\n        unsigned    estSize   = 0x10000,\n        unsigned    estRelocs = 1);\n\n    // Keep proctected & no accessors, so that derived class PEWriter\n    // is the ONLY one with access\n\n    PESection **sectStart;\n    PESection **sectCur;\n    PESection **sectEnd;\n};  // class PESectionMan\n\n/***************************************************************\n * This represents a section of a ICeeFileGen. Multiple sections\n * can be created with pointers to one another. These will\n * automatically get fixed up when the ICeeFileGen is \"baked\".\n *\n * It is implemented using CBlobFetcher as a list of blobs.\n * Thus it can grow arbitrarily. At the same time, it can appear\n * as a flat consecutive piece of memory which can be indexed into\n * using offsets.\n */\n\nclass PESection : public CeeSectionImpl {\n  public:\n    // bytes in this section at present\n    unsigned dataLen();\n\n    // Apply all the relocs for in memory conversion\n    HRESULT applyRelocs(CeeGenTokenMapper *pTokenMapper);\n\n    // get a block to write on (use instead of write to avoid copy)\n    char* getBlock(unsigned len, unsigned align=1);\n\n    // writes 'val' (which is offset into section 'relativeTo')\n    // and adds a relocation fixup for that section\n    void writeSectReloc(unsigned val, CeeSection& relativeTo,\n                CeeSectionRelocType reloc = srRelocHighLow,\n                CeeSectionRelocExtra *extra=0);\n\n    // Indicates that the DWORD at 'offset' in the current section should\n    // have the base of section 'relativeTo' added to it\n    HRESULT addSectReloc(unsigned offset, CeeSection& relativeTo,\n                            CeeSectionRelocType reloc = srRelocHighLow,\n                            CeeSectionRelocExtra *extra=0);\n\n    // If relativeTo is NULL, it is treated as a base reloc.\n    // ie. the value only needs to be fixed at load time if the module gets rebased.\n    HRESULT addSectReloc(unsigned offset, PESection *relativeTo,\n                            CeeSectionRelocType reloc = srRelocHighLow,\n                            CeeSectionRelocExtra *extra=0);\n\n    // Add a base reloc for the given offset in the current section\n    HRESULT addBaseReloc(unsigned offset, CeeSectionRelocType reloc = srRelocHighLow,\n                            CeeSectionRelocExtra *extra = 0);\n\n    // section name\n    unsigned char *name() {\n        LIMITED_METHOD_CONTRACT;\n        return (unsigned char *) m_name;\n    }\n\n    // section flags\n    unsigned flags() {\n        LIMITED_METHOD_CONTRACT;\n        return m_flags;\n    }\n\n    // virtual base\n    unsigned getBaseRVA() {\n        LIMITED_METHOD_CONTRACT;\n        return m_baseRVA;\n    }\n\n    // return the dir entry for this section\n    int getDirEntry() {\n        LIMITED_METHOD_CONTRACT;\n        return dirEntry;\n    }\n    // this section will be directory entry 'num'\n    HRESULT directoryEntry(unsigned num);\n\n    // Indexes offset as if this were an array\n    // Returns a pointer into the correct blob\n    virtual char * computePointer(unsigned offset) const;\n\n    // Checks to see if pointer is in section\n    virtual BOOL containsPointer(_In_ char *ptr) const;\n\n    // Given a pointer pointing into this section,\n    // computes an offset as if this were an array\n    virtual unsigned computeOffset(_In_ char *ptr) const;\n\n    // Make 'destination' a copy of the current PESection\n    HRESULT cloneInstance(PESection *destination);\n\n    // Cause the section to allocate memory in smaller chunks\n    void SetInitialGrowth(unsigned growth);\n\n    virtual ~PESection();\nprivate:\n\n    // purposely not defined,\n    PESection();\n\n    // purposely not defined,\n    PESection(const PESection&);\n\n    // purposely not defined,\n    PESection& operator=(const PESection& x);\n\n    // this dir entry points to this section\n    int dirEntry;\n\nprotected:\n    friend class PEWriter;\n    friend class PEWriterSection;\n    friend class PESectionMan;\n\n    PESection(const char* name, unsigned flags,\n              unsigned estSize, unsigned estRelocs);\n\n    // Blob fetcher handles getBlock() and fetching binary chunks.\n    CBlobFetcher m_blobFetcher;\n\n    PESectionReloc* m_relocStart;\n    PESectionReloc* m_relocCur;\n    PESectionReloc* m_relocEnd;\n\n    // These will be set while baking (finalizing) the file\n    unsigned    m_baseRVA;      // RVA into the file of this section.\n    unsigned    m_filePos;      // Start offset into the file (treated as a data image)\n    unsigned    m_filePad;      // Padding added to the end of the section for alignment\n\n    char        m_name[8+6];    // extra room for digits\n    unsigned    m_flags;\n\n    struct _IMAGE_SECTION_HEADER* m_header; // Corresponding header. Assigned after link()\n};\n\n/***************************************************************/\n/* implementation section */\n\ninline HRESULT PESection::directoryEntry(unsigned num) {\n    WRAPPER_NO_CONTRACT;\n    TESTANDRETURN(num < 16, E_INVALIDARG);\n    dirEntry = num;\n    return S_OK;\n}\n\n// This remembers the location where a reloc needs to be applied.\n// It is relative to the contents of a PESection\n\nstruct PESectionReloc {\n    CeeSectionRelocType     type;       // type of reloc\n    unsigned                offset;     // offset within the current PESection where the reloc is to be applied\n    CeeSectionRelocExtra    extra;\n    PESection*              section;    // target PESection. NULL implies that the target is a fixed address outside the module\n};\n\n#endif // #define PESectionMan_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/pgo_formatprocessing.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// This header defines the algorithms for generating and parsing pgo compressed schema formats\n\n#ifndef PGO_FORMATPROCESSING_H\n#define PGO_FORMATPROCESSING_H\n\n#ifdef FEATURE_PGO\n\ninline INT_PTR HashToPgoUnknownHandle(uint32_t hash)\n{\n    // Map from a 32bit hash to the 32 different unknown type handle values\n    return (hash & 0x1F) + 1;\n}\n\ninline ICorJitInfo::PgoInstrumentationKind operator|(ICorJitInfo::PgoInstrumentationKind a, ICorJitInfo::PgoInstrumentationKind b)\n{\n    return static_cast<ICorJitInfo::PgoInstrumentationKind>(static_cast<int>(a) | static_cast<int>(b));\n}\n\ninline ICorJitInfo::PgoInstrumentationKind operator&(ICorJitInfo::PgoInstrumentationKind a, ICorJitInfo::PgoInstrumentationKind b)\n{\n    return static_cast<ICorJitInfo::PgoInstrumentationKind>(static_cast<int>(a) & static_cast<int>(b));\n}\n\ninline ICorJitInfo::PgoInstrumentationKind operator-(ICorJitInfo::PgoInstrumentationKind a, ICorJitInfo::PgoInstrumentationKind b)\n{\n    return static_cast<ICorJitInfo::PgoInstrumentationKind>(static_cast<int>(a) - static_cast<int>(b));\n}\n\ninline ICorJitInfo::PgoInstrumentationKind operator~(ICorJitInfo::PgoInstrumentationKind a)\n{\n    return static_cast<ICorJitInfo::PgoInstrumentationKind>(~static_cast<int>(a));\n}\n\ninline uint32_t InstrumentationKindToSize(ICorJitInfo::PgoInstrumentationKind kind)\n{\n    switch(kind & ICorJitInfo::PgoInstrumentationKind::MarshalMask)\n    {\n        case ICorJitInfo::PgoInstrumentationKind::None:\n            return 0;\n        case ICorJitInfo::PgoInstrumentationKind::FourByte:\n            return 4;\n        case ICorJitInfo::PgoInstrumentationKind::EightByte:\n            return 8;\n        case ICorJitInfo::PgoInstrumentationKind::TypeHandle:\n        case ICorJitInfo::PgoInstrumentationKind::MethodHandle:\n            return TARGET_POINTER_SIZE;\n        default:\n            _ASSERTE(FALSE);\n            return 0;\n    }\n}\n\ninline UINT InstrumentationKindToAlignment(ICorJitInfo::PgoInstrumentationKind kind)\n{\n    switch(kind & ICorJitInfo::PgoInstrumentationKind::AlignMask)\n    {\n        case ICorJitInfo::PgoInstrumentationKind::Align4Byte:\n            return 4;\n        case ICorJitInfo::PgoInstrumentationKind::Align8Byte:\n            return 8;\n        case ICorJitInfo::PgoInstrumentationKind::AlignPointer:\n            return TARGET_POINTER_SIZE;\n        default:\n            return (UINT)InstrumentationKindToSize(kind);\n    }\n}\n\n#define SIGN_MASK_ONEBYTE_64BIT  0xffffffffffffffc0LL\n#define SIGN_MASK_TWOBYTE_64BIT  0xffffffffffffe000LL\n#define SIGN_MASK_FOURBYTE_64BIT 0xffffffff80000000LL\n\ntemplate<class IntHandler>\nbool ReadCompressedInts(const uint8_t *pByte, size_t cbDataMax, IntHandler intProcessor)\n{\n    while (cbDataMax > 0)\n    {\n        // This logic is a variant on CorSigUncompressSignedInt which allows for the full range of an int64_t\n        int64_t signedInt;\n        if ((*pByte & 0x80) == 0x0) // 0??? ????\n        {\n            signedInt = *pByte >> 1;\n            if (*pByte & 1)\n                signedInt |= SIGN_MASK_ONEBYTE_64BIT;\n\n            pByte += 1;\n            cbDataMax -=1;\n        }\n        else if ((*pByte & 0xC0) == 0x80) // 10?? ????\n        {\n            if (cbDataMax < 2)\n                return false;\n\n            int shiftedInt = ((*pByte & 0x3f) << 8) | *(pByte + 1);\n            signedInt = shiftedInt >> 1;\n            if (shiftedInt & 1)\n                signedInt |= SIGN_MASK_TWOBYTE_64BIT;\n\n            pByte += 2;\n            cbDataMax -= 2;\n        }\n        else if ((*pByte) == 0xC1)\n        {\n            if (cbDataMax < 9)\n                return false;\n            signedInt = (int64_t)((((int64_t)*(pByte + 1)) << 56 | ((int64_t)*(pByte+2)) << 48 | ((int64_t)*(pByte+3)) << 40 | ((int64_t)*(pByte+4)) << 32) | ((int64_t)*(pByte + 5)) << 24 | ((int64_t)*(pByte+6)) << 16 | ((int64_t)*(pByte+7)) << 8 | ((int64_t)*(pByte+8)));\n            pByte += 9;\n            cbDataMax -= 9;\n        }\n        else\n        {\n            if (cbDataMax < 5)\n                return false;\n\n            signedInt = (int32_t)((*(pByte + 1) << 24 | *(pByte+2) << 16 | *(pByte+3) << 8 | *(pByte+4)));\n\n            pByte += 5;\n            cbDataMax -= 5;\n        }\n\n        if (!intProcessor(signedInt))\n        {\n            return false;\n        }\n    }\n\n    return true;\n}\n\nenum class InstrumentationDataProcessingState\n{\n    Done = 0,\n    ILOffset = 0x1,\n    Type = 0x2,\n    Count = 0x4,\n    Other = 0x8,\n    UpdateProcessMask = 0xF,\n    UpdateProcessMaskFlag = 0x100,\n};\n\ninline InstrumentationDataProcessingState operator|(InstrumentationDataProcessingState a, InstrumentationDataProcessingState b)\n{\n    return static_cast<InstrumentationDataProcessingState>(static_cast<int>(a) | static_cast<int>(b));\n}\n\ninline InstrumentationDataProcessingState operator&(InstrumentationDataProcessingState a, InstrumentationDataProcessingState b)\n{\n    return static_cast<InstrumentationDataProcessingState>(static_cast<int>(a) & static_cast<int>(b));\n}\n\ninline InstrumentationDataProcessingState operator~(InstrumentationDataProcessingState a)\n{\n    return static_cast<InstrumentationDataProcessingState>(~static_cast<int>(a));\n}\n\nclass ProcessSchemaUpdateFunctor\n{\n    ICorJitInfo::PgoInstrumentationSchema curSchema = {};\n    InstrumentationDataProcessingState processingState = InstrumentationDataProcessingState::UpdateProcessMaskFlag;\n\npublic:\n    const ICorJitInfo::PgoInstrumentationSchema& GetSchema() const { return curSchema; }\n    bool ProcessInteger(int32_t curValue)\n    {\n        if (processingState == InstrumentationDataProcessingState::UpdateProcessMaskFlag)\n        {\n            processingState = (InstrumentationDataProcessingState)curValue;\n            assert((processingState & ~InstrumentationDataProcessingState::UpdateProcessMask) == InstrumentationDataProcessingState::Done);\n            return false;\n        }\n\n        if ((processingState & InstrumentationDataProcessingState::ILOffset) == InstrumentationDataProcessingState::ILOffset)\n        {\n            curSchema.ILOffset = (int32_t)((int64_t)curSchema.ILOffset + curValue);\n            processingState = processingState & ~InstrumentationDataProcessingState::ILOffset;\n        }\n        else if ((processingState & InstrumentationDataProcessingState::Type) == InstrumentationDataProcessingState::Type)\n        {\n            curSchema.InstrumentationKind = static_cast<ICorJitInfo::PgoInstrumentationKind>(static_cast<int64_t>(curSchema.InstrumentationKind) + curValue);\n            processingState = processingState & ~InstrumentationDataProcessingState::Type;\n        }\n        else if ((processingState & InstrumentationDataProcessingState::Count) == InstrumentationDataProcessingState::Count)\n        {\n            curSchema.Count = (int32_t)((int64_t)curSchema.Count + curValue);\n            processingState = processingState & ~InstrumentationDataProcessingState::Count;\n        }\n        else if ((processingState & InstrumentationDataProcessingState::Other) == InstrumentationDataProcessingState::Other)\n        {\n            curSchema.Other = (int32_t)((int64_t)curSchema.Other + curValue);\n            processingState = processingState & ~InstrumentationDataProcessingState::Other;\n        }\n\n        if (processingState == InstrumentationDataProcessingState::Done)\n        {\n            processingState = InstrumentationDataProcessingState::UpdateProcessMaskFlag;\n            return true;\n        }\n        return false;\n    }\n};\n\ntemplate<class SchemaHandler>\nbool ReadInstrumentationSchema(const uint8_t *pByte, size_t cbDataMax, SchemaHandler handler)\n{\n    ProcessSchemaUpdateFunctor schemaHandlerUpdate;\n    bool done = false;\n\n    ReadCompressedInts(pByte, cbDataMax, [&handler, &schemaHandlerUpdate, &done](int64_t curValue)\n    {\n        if (schemaHandlerUpdate.ProcessInteger((int32_t)curValue))\n        {\n            if (schemaHandlerUpdate.GetSchema().InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::Done)\n            {\n                done = true;\n                return false;\n            }\n\n            if (!handler(schemaHandlerUpdate.GetSchema()))\n            {\n                return false;\n            }\n        }\n        return true;\n    });\n\n    return done;\n}\n\ntemplate<class SchemaAndDataHandler>\nbool ReadInstrumentationData(const uint8_t *pByte, size_t cbDataMax, SchemaAndDataHandler& handler)\n{\n    ProcessSchemaUpdateFunctor schemaHandler;\n    bool done = false;\n    int64_t lastDataValue = 0;\n    int64_t lastTypeDataValue = 0;\n    int64_t lastMethodDataValue = 0;\n    int32_t dataCountToRead = 0;\n\n    ReadCompressedInts(pByte, cbDataMax, [&](int64_t curValue)\n    {\n        if (dataCountToRead > 0)\n        {\n            switch(schemaHandler.GetSchema().InstrumentationKind & ICorJitInfo::PgoInstrumentationKind::MarshalMask)\n            {\n            case ICorJitInfo::PgoInstrumentationKind::FourByte:\n            case ICorJitInfo::PgoInstrumentationKind::EightByte:\n                lastDataValue += curValue;\n\n                if (!handler(schemaHandler.GetSchema(), lastDataValue, schemaHandler.GetSchema().Count - dataCountToRead))\n                {\n                    return false;\n                }\n                break;\n            case ICorJitInfo::PgoInstrumentationKind::TypeHandle:\n                lastTypeDataValue += curValue;\n\n                if (!handler(schemaHandler.GetSchema(), lastTypeDataValue, schemaHandler.GetSchema().Count - dataCountToRead))\n                {\n                    return false;\n                }\n                break;\n            case ICorJitInfo::PgoInstrumentationKind::MethodHandle:\n                lastMethodDataValue += curValue;\n\n                if (!handler(schemaHandler.GetSchema(), lastMethodDataValue, schemaHandler.GetSchema().Count - dataCountToRead))\n                {\n                    return false;\n                }\n                break;\n            default:\n                assert(!\"Unexpected PGO instrumentation data type\");\n                break;\n            }\n            dataCountToRead--;\n            return true;\n        }\n        if (schemaHandler.ProcessInteger((int32_t)curValue))\n        {\n            if (schemaHandler.GetSchema().InstrumentationKind == ICorJitInfo::PgoInstrumentationKind::Done)\n            {\n                done = true;\n                return false;\n            }\n\n            if (InstrumentationKindToSize(schemaHandler.GetSchema().InstrumentationKind) == 0)\n            {\n                if (!handler(schemaHandler.GetSchema(), 0, 0))\n                {\n                    return false;\n                }\n            }\n            else\n            {\n                dataCountToRead = schemaHandler.GetSchema().Count;\n            }\n        }\n        return true;\n    });\n\n    return done;\n}\n\ninline bool CountInstrumentationDataSize(const uint8_t *pByte, size_t cbDataMax, int32_t *pInstrumentationSchemaCount)\n{\n    *pInstrumentationSchemaCount = 0;\n    return ReadInstrumentationSchema(pByte, cbDataMax, [pInstrumentationSchemaCount](const ICorJitInfo::PgoInstrumentationSchema& schema) { (*pInstrumentationSchemaCount)++; return true; });\n}\n\ninline bool ComparePgoSchemaEquals(const uint8_t *pByte, size_t cbDataMax, const ICorJitInfo::PgoInstrumentationSchema* schemaTable, size_t cSchemas)\n{\n    size_t iSchema = 0;\n    return ReadInstrumentationSchema(pByte, cbDataMax, [schemaTable, cSchemas, &iSchema](const ICorJitInfo::PgoInstrumentationSchema& schema)\n    {\n        if (iSchema >= cSchemas)\n            return false;\n\n        if (schema.InstrumentationKind != schemaTable[iSchema].InstrumentationKind)\n            return false;\n\n        if (schema.ILOffset != schemaTable[iSchema].ILOffset)\n            return false;\n\n        if (schema.Count != schemaTable[iSchema].Count)\n            return false;\n\n        if (schema.Other != schemaTable[iSchema].Other)\n            return false;\n\n        return true;\n    });\n}\n\ninline void LayoutPgoInstrumentationSchema(const ICorJitInfo::PgoInstrumentationSchema& prevSchema, ICorJitInfo::PgoInstrumentationSchema* currentSchema)\n{\n    size_t instrumentationSize = InstrumentationKindToSize(currentSchema->InstrumentationKind);\n    if (instrumentationSize != 0)\n    {\n        currentSchema->Offset = (UINT)AlignUp((size_t)prevSchema.Offset + (size_t)InstrumentationKindToSize(prevSchema.InstrumentationKind) * prevSchema.Count,\n                                        InstrumentationKindToAlignment(currentSchema->InstrumentationKind));\n    }\n    else\n    {\n        currentSchema->Offset = prevSchema.Offset;\n    }\n}\n\ntemplate<class SchemaHandler>\nbool ReadInstrumentationSchemaWithLayout(const uint8_t *pByte, size_t cbDataMax, size_t initialOffset, SchemaHandler& handler)\n{\n    ICorJitInfo::PgoInstrumentationSchema prevSchema;\n    memset(&prevSchema, 0, sizeof(ICorJitInfo::PgoInstrumentationSchema));\n    prevSchema.Offset = initialOffset;\n\n    return ReadInstrumentationSchema(pByte, cbDataMax, [&prevSchema, &handler](ICorJitInfo::PgoInstrumentationSchema curSchema)\n    {\n        LayoutPgoInstrumentationSchema(prevSchema, &curSchema);\n        if (!handler(curSchema))\n            return false;\n        prevSchema = curSchema;\n        return true;\n    });\n}\n\n\n// Return true if schemaTable entries are a subset of the schema described by pByte, with matching entries in the same order.\n// Also updates offset of the matching entries in schemaTable to those of the pByte schema.\n//\ninline bool CheckIfPgoSchemaIsCompatibleAndSetOffsets(const uint8_t *pByte, size_t cbDataMax, ICorJitInfo::PgoInstrumentationSchema* schemaTable, size_t cSchemas)\n{\n    size_t nMatched = 0;\n    size_t initialOffset = cbDataMax;\n\n    auto handler = [schemaTable, cSchemas, &nMatched](const ICorJitInfo::PgoInstrumentationSchema& schema)\n    {\n        if ((nMatched < cSchemas)\n            && (schema.InstrumentationKind == schemaTable[nMatched].InstrumentationKind)\n            && (schema.ILOffset == schemaTable[nMatched].ILOffset)\n            && (schema.Count == schemaTable[nMatched].Count)\n            && (schema.Other == schemaTable[nMatched].Other))\n        {\n            schemaTable[nMatched].Offset = schema.Offset;\n            nMatched++;\n        }\n\n        return true;\n    };\n\n    ReadInstrumentationSchemaWithLayout(pByte, cbDataMax, initialOffset, handler);\n\n    return (nMatched == cSchemas);\n}\n\ninline bool ReadInstrumentationSchemaWithLayoutIntoSArray(const uint8_t *pByte, size_t cbDataMax, size_t initialOffset, SArray<ICorJitInfo::PgoInstrumentationSchema>* pSchemas)\n{\n    auto lambda = [pSchemas](const ICorJitInfo::PgoInstrumentationSchema &schema)\n    {\n        pSchemas->Append(schema);\n        return true;\n    };\n\n    return ReadInstrumentationSchemaWithLayout(pByte, cbDataMax, initialOffset, lambda);\n}\n\n#define SIGN_MASK_ONEBYTE_64BIT  0xffffffffffffffc0LL\n#define SIGN_MASK_TWOBYTE_64BIT  0xffffffffffffe000LL\n#define SIGN_MASK_FOURBYTE_64BIT 0xffffffff80000000LL\n\ntemplate<class ByteWriter>\nbool WriteCompressedIntToBytes(int64_t value, ByteWriter& byteWriter)\n{\n    uint8_t isSigned = 0;\n\n    // This function is modeled on CorSigCompressSignedInt, but differs in that\n    // it handles arbitrary int64 values, not just a subset\n    if (value < 0)\n        isSigned = 1;\n\n    if ((value & SIGN_MASK_ONEBYTE_64BIT) == 0 || (value & SIGN_MASK_ONEBYTE_64BIT) == SIGN_MASK_ONEBYTE_64BIT)\n    {\n        return byteWriter((uint8_t)((value & ~SIGN_MASK_ONEBYTE) << 1 | isSigned));\n    }\n    else if ((value & SIGN_MASK_TWOBYTE_64BIT) == 0 || (value & SIGN_MASK_TWOBYTE_64BIT) == SIGN_MASK_TWOBYTE_64BIT)\n    {\n        int32_t iData = (int32_t)((value & ~SIGN_MASK_TWOBYTE_64BIT) << 1 | isSigned);\n        _ASSERTE(iData <= 0x3fff);\n        byteWriter(uint8_t((iData >> 8) | 0x80));\n        return byteWriter(uint8_t(iData & 0xff));\n    }\n    else if ((value & SIGN_MASK_FOURBYTE_64BIT) == 0 || (value & SIGN_MASK_FOURBYTE_64BIT) == SIGN_MASK_FOURBYTE_64BIT)\n    {\n        // Unlike CorSigCompressSignedInt, this just writes a header byte\n        // then 4 bytes, ignoring the whole signed bit detail\n        byteWriter(0xC0);\n        byteWriter(uint8_t((value >> 24) & 0xff));\n        byteWriter(uint8_t((value >> 16) & 0xff));\n        byteWriter(uint8_t((value >> 8) & 0xff));\n        return byteWriter(uint8_t((value >> 0) & 0xff));\n    }\n    else\n    {\n        // Unlike CorSigCompressSignedInt, this just writes a header byte\n        // then 8 bytes, ignoring the whole signed bit detail\n        byteWriter(0xC1);\n        byteWriter(uint8_t((value >> 56) & 0xff));\n        byteWriter(uint8_t((value >> 48) & 0xff));\n        byteWriter(uint8_t((value >> 40) & 0xff));\n        byteWriter(uint8_t((value >> 32) & 0xff));\n        byteWriter(uint8_t((value >> 24) & 0xff));\n        byteWriter(uint8_t((value >> 16) & 0xff));\n        byteWriter(uint8_t((value >> 8) & 0xff));\n        return byteWriter(uint8_t((value >> 0) & 0xff));\n    }\n}\n\ntemplate<class ByteWriter>\nbool WriteIndividualSchemaToBytes(ICorJitInfo::PgoInstrumentationSchema prevSchema, ICorJitInfo::PgoInstrumentationSchema curSchema, ByteWriter& byteWriter)\n{\n    int64_t ilOffsetDiff = (int64_t)curSchema.ILOffset - (int64_t)prevSchema.ILOffset;\n    int64_t OtherDiff = (int64_t)curSchema.Other - (int64_t)prevSchema.Other;\n    int64_t CountDiff = (int64_t)curSchema.Count - (int64_t)prevSchema.Count;\n    int64_t TypeDiff = (int64_t)curSchema.InstrumentationKind - (int64_t)prevSchema.InstrumentationKind;\n\n    InstrumentationDataProcessingState modifyMask = (InstrumentationDataProcessingState)0;\n\n    if (ilOffsetDiff != 0)\n        modifyMask = modifyMask | InstrumentationDataProcessingState::ILOffset;\n    if (TypeDiff != 0)\n        modifyMask = modifyMask | InstrumentationDataProcessingState::Type;\n    if (CountDiff != 0)\n        modifyMask = modifyMask | InstrumentationDataProcessingState::Count;\n    if (OtherDiff != 0)\n        modifyMask = modifyMask | InstrumentationDataProcessingState::Other;\n\n    _ASSERTE(modifyMask != InstrumentationDataProcessingState::Done);\n\n    WriteCompressedIntToBytes((int32_t)modifyMask, byteWriter);\n    if ((ilOffsetDiff != 0) && !WriteCompressedIntToBytes(ilOffsetDiff, byteWriter))\n        return false;\n    if ((TypeDiff != 0) && !WriteCompressedIntToBytes(TypeDiff, byteWriter))\n        return false;\n    if ((CountDiff != 0) && !WriteCompressedIntToBytes(CountDiff, byteWriter))\n        return false;\n    if ((OtherDiff != 0) && !WriteCompressedIntToBytes(OtherDiff, byteWriter))\n        return false;\n\n    return true;\n}\n\ntemplate<class ByteWriter>\nbool WriteInstrumentationSchemaToBytes(const ICorJitInfo::PgoInstrumentationSchema* schemaTable, size_t cSchemas, const ByteWriter& byteWriter)\n{\n    ICorJitInfo::PgoInstrumentationSchema prevSchema;\n    memset(&prevSchema, 0, sizeof(ICorJitInfo::PgoInstrumentationSchema));\n\n    for (size_t iSchema = 0; iSchema < cSchemas; iSchema++)\n    {\n        if (!WriteIndividualSchemaToBytes(prevSchema, schemaTable[iSchema], byteWriter))\n            return false;\n        prevSchema = schemaTable[iSchema];\n    }\n\n    // Terminate the schema list with an entry which is Done\n    ICorJitInfo::PgoInstrumentationSchema terminationSchema = prevSchema;\n    terminationSchema.InstrumentationKind = ICorJitInfo::PgoInstrumentationKind::Done;\n    if (!WriteIndividualSchemaToBytes(prevSchema, terminationSchema, byteWriter))\n        return false;\n\n    return true;\n}\n\ntemplate<class ByteWriter>\nclass SchemaAndDataWriter\n{\n    const ByteWriter& byteWriter;\n    uint8_t* pInstrumentationData;\n    ICorJitInfo::PgoInstrumentationSchema prevSchema = {};\n    int64_t lastIntDataWritten = 0;\n    int64_t lastTypeDataWritten = 0;\n    int64_t lastMethodDataWritten = 0;\n\npublic:\n    SchemaAndDataWriter(const ByteWriter& byteWriter, uint8_t* pInstrumentationData) :\n        byteWriter(byteWriter),\n        pInstrumentationData(pInstrumentationData)\n    {}\n\n    bool AppendSchema(ICorJitInfo::PgoInstrumentationSchema schema)\n    {\n        if (!WriteIndividualSchemaToBytes(prevSchema, schema, byteWriter))\n            return false;\n\n        prevSchema = schema;\n        return true;\n    }\n\n    template<class TypeHandleProcessor, class MethodHandleProcessor>\n    bool AppendDataFromLastSchema(TypeHandleProcessor& thProcessor, MethodHandleProcessor& mhProcessor)\n    {\n        uint8_t *pData = (pInstrumentationData + prevSchema.Offset);\n        for (int32_t iDataElem = 0; iDataElem < prevSchema.Count; iDataElem++)\n        {\n            int64_t logicalDataToWrite;\n            switch(prevSchema.InstrumentationKind & ICorJitInfo::PgoInstrumentationKind::MarshalMask)\n            {\n                case ICorJitInfo::PgoInstrumentationKind::None:\n                    return true;\n                case ICorJitInfo::PgoInstrumentationKind::FourByte:\n                {\n                    logicalDataToWrite = *(volatile int32_t*)pData;\n                    bool returnValue = WriteCompressedIntToBytes(logicalDataToWrite - lastIntDataWritten, byteWriter);\n                    lastIntDataWritten = logicalDataToWrite;\n                    if (!returnValue)\n                        return false;\n                    pData += 4;\n                    break;\n                }\n                case ICorJitInfo::PgoInstrumentationKind::EightByte:\n                {\n                    logicalDataToWrite = *(volatile int64_t*)pData;\n                    bool returnValue = WriteCompressedIntToBytes(logicalDataToWrite - lastIntDataWritten, byteWriter);\n                    lastIntDataWritten = logicalDataToWrite;\n                    if (!returnValue)\n                        return false;\n                    pData += 8;\n                    break;\n                }\n                case ICorJitInfo::PgoInstrumentationKind::TypeHandle:\n                {\n                    logicalDataToWrite = *(volatile intptr_t*)pData;\n\n                    // As there could be tearing otherwise, inform the caller of exactly what value was written.\n                    thProcessor((intptr_t)logicalDataToWrite);\n\n                    bool returnValue = WriteCompressedIntToBytes(logicalDataToWrite - lastTypeDataWritten, byteWriter);\n                    lastTypeDataWritten = logicalDataToWrite;\n                    if (!returnValue)\n                        return false;\n                    pData += sizeof(intptr_t);\n                    break;\n                }\n                case ICorJitInfo::PgoInstrumentationKind::MethodHandle:\n                {\n                    logicalDataToWrite = *(volatile intptr_t*)pData;\n\n                    // As there could be tearing otherwise, inform the caller of exactly what value was written.\n                    mhProcessor((intptr_t)logicalDataToWrite);\n\n                    bool returnValue = WriteCompressedIntToBytes(logicalDataToWrite - lastMethodDataWritten, byteWriter);\n                    lastMethodDataWritten = logicalDataToWrite;\n                    if (!returnValue)\n                        return false;\n                    pData += sizeof(intptr_t);\n                    break;\n                }\n                default:\n                    _ASSERTE(!\"Unexpected type\");\n                    return false;\n            }\n        }\n        return true;\n    }\n\n    bool Finish()\n    {\n        // Terminate the schema list with an entry which is Done\n        ICorJitInfo::PgoInstrumentationSchema terminationSchema = prevSchema;\n        terminationSchema.InstrumentationKind = ICorJitInfo::PgoInstrumentationKind::Done;\n        if (!WriteIndividualSchemaToBytes(prevSchema, terminationSchema, byteWriter))\n            return false;\n\n        return true;\n    }\n};\n\ninline bool WriteInstrumentationSchema(const ICorJitInfo::PgoInstrumentationSchema* schemaTable, size_t cSchemas, uint8_t* array, size_t byteCount)\n{\n    return WriteInstrumentationSchemaToBytes(schemaTable, cSchemas, [&array, &byteCount](uint8_t data)\n    {\n        if (byteCount == 0)\n            return false;\n        *array = data;\n        array += 1;\n        byteCount--;\n        return true;\n    });\n}\n\n#endif // FEATURE_PGO\n#endif // PGO_FORMATPROCESSING_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/pinvokeoverride.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*****************************************************************************\n **                                                                         **\n ** pinvokeoverride.h - PInvoke binding override                            **\n **                                                                         **\n *****************************************************************************/\n\n#ifndef _PINVOKEOVERRIDE_H_\n#define _PINVOKEOVERRIDE_H_\n\n#include \"coreclrhost.h\"\n\nclass PInvokeOverride\n{\npublic:\n    // Override source. This represents the priority order in which overrides will be called.\n    enum class Source\n    {\n        RuntimeConfiguration,\n        ObjectiveCInterop,\n        Last = ObjectiveCInterop,\n    };\n\n    static void SetPInvokeOverride(_In_ PInvokeOverrideFn* overrideImpl, _In_ Source source);\n    static const void* GetMethodImpl(_In_z_ const char* libraryName, _In_z_ const char* entrypointName);\n};\n\n#endif // _PINVOKEOVERRIDE_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/posterror.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// UtilCode.h\n//\n// Utility functions implemented in UtilCode.lib.\n//\n\n//*****************************************************************************\n\n#ifndef __PostError_h__\n#define __PostError_h__\n\n#include \"switches.h\"\n\n//*****************************************************************************\n// This function will post an error for the client.  If the LOWORD(hrRpt) can\n// be found as a valid error message, then it is loaded and formatted with\n// the arguments passed in.  If it cannot be found, then the error is checked\n// against FormatMessage to see if it is a system error.  System errors are\n// not formatted so no add'l parameters are required.  If any errors in this\n// process occur, hrRpt is returned for the client with no error posted.\n//*****************************************************************************\nHRESULT PostError(             // Returned error.\n    HRESULT     hrRpt,                  // Reported error.\n    ...);                               // Error arguments.\n\n#endif // __PostError_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/predeftlsslot.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n\n#ifndef __PREDEFTLSSLOT_H__\n#define __PREDEFTLSSLOT_H__\n\n// ******************************************************************************\n// WARNING!!!: These enums are used by SOS in the diagnostics repo. Values should\n// added or removed in a backwards and forwards compatible way.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/predeftlsslot.h\n// ******************************************************************************\n\n// The historic location of ThreadType slot kept for compatibility with SOS\n// TODO: Introduce DAC API to make this hack unnecessary\nenum PredefinedTlsSlots\n{\n    TlsIdx_ThreadType = 11 // bit flags to indicate special thread's type\n};\n\nenum TlsThreadTypeFlag // flag used for thread type in Tls data\n{\n    ThreadType_GC                       = 0x00000001,\n    ThreadType_Timer                    = 0x00000002,\n    ThreadType_Gate                     = 0x00000004,\n    ThreadType_DbgHelper                = 0x00000008,\n    ThreadType_Shutdown                 = 0x00000010,\n    ThreadType_DynamicSuspendEE         = 0x00000020,\n    ThreadType_Finalizer                = 0x00000040,\n    ThreadType_ADUnloadHelper           = 0x00000200,\n    ThreadType_ShutdownHelper           = 0x00000400,\n    ThreadType_Threadpool_IOCompletion  = 0x00000800,\n    ThreadType_Threadpool_Worker        = 0x00001000,\n    ThreadType_Wait                     = 0x00002000,\n    ThreadType_ProfAPI_Attach           = 0x00004000,\n    ThreadType_ProfAPI_Detach           = 0x00008000,\n    ThreadType_ETWRundownThread         = 0x00010000,\n    ThreadType_GenericInstantiationCompare= 0x00020000, // Used to indicate that the thread is determining if a generic instantiation in an ngen image matches a lookup.\n};\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/prettyprintsig.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//*****************************************************************************\n// This code supports formatting a method and it's signature in a friendly\n// and consistent format.\n//\n//*****************************************************************************\n\n#ifndef __PrettyPrintSig_h__\n#define __PrettyPrintSig_h__\n\n#include <cor.h>\n\nclass CQuickBytes;\n\n//\n// The return value is either NULL or a null-terminated ASCII string\n//\n\n//---------------------------------------------------------------------------------------\n//\n// Prints a signature in a human readable format.\n// No one should use this function.  This exists strictly for backwards compatibility with external formats.\n//\n// Arguments:\n//      sigPtr - Method/field sig to convert\n//      sigLen - length of sig\n//      name - the name of the method for this sig. Can be L\"\"\n//      scratch - scratch buffer to use\n//      pIMDI - Import api to use.\n//\n// Return Value:\n//      The formatted string.\n//\n// Assumptions:\n//      None\n//\n// Notes:\n//      Dev's SHOULD NOT create new callers to this function.  Use\n//      code:PrettyPrintSig in formatype.h instead.  This function exists for\n//      legacy support in the CLR.  There are places that depend on the format\n//      of this string.\n//\n\nLPCWSTR PrettyPrintSigLegacy(\n    PCCOR_SIGNATURE sigPtr,             // Method/field sig to convert\n    unsigned    sigLen,                 // length of sig\n    LPCWSTR     name,                   // the name of the method for this sig. Can be L\"\"\n    CQuickBytes *scratch,               // scratch buffer to use\n    IMetaDataImport *pIMDI);            // Import api to use.\n\nstruct IMDInternalImport;\n\n//---------------------------------------------------------------------------------------\n//\n// Prints a signature in a human readable format.\n// No one should use this function.  This exists strictly for backwards compatibility with external formats.\n//\n// Arguments:\n//      sigPtr - Method/field sig to convert\n//      sigLen - length of sig\n//      name - the name of the method for this sig. Can be L\"\"\n//      out - The buffer in which to write the pretty printed string.\n//      pIMDI - Import api to use.\n//\n// Return Value:\n//      An HRESULT and the formatted string is in out as a unicode string.\n//\n// Assumptions:\n//      None\n//\n// Notes:\n//      Dev's SHOULD NOT create new callers to this function.  Use\n//      code:PrettyPrintSig in formattype.h instead.  This function exists for\n//      legacy support in the CLR.  There are places that depend on the format\n//      of this string.\n//\nHRESULT PrettyPrintSigInternalLegacy(   // S_OK or error.\n    PCCOR_SIGNATURE sigPtr,             // sig to convert,\n    unsigned    sigLen,                 // length of sig\n    LPCSTR  name,                       // can be \"\", the name of the method for this sig\n    CQuickBytes *out,                   // where to put the pretty printed string\n    IMDInternalImport *pIMDI);          // Import api to use.\n\n//\n// On success, the null-terminated ASCII string is in \"out.Ptr()\"\n//\n\n#endif // __PrettyPrintSig_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/profilepriv.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// ProfilePriv.h\n//\n\n//\n// Structures, etc. used by the Profiling API and throughout the EE\n//\n\n// ======================================================================================\n\n#ifndef _ProfilePriv_h_\n#define _ProfilePriv_h_\n\n\n// Forward declarations\nclass EEToProfInterfaceImpl;\nclass ProfToEEInterfaceImpl;\nclass Object;\nstruct ScanContext;\nenum EtwGCRootFlags: int32_t;\nenum EtwGCRootKind: int32_t;\nstruct IAssemblyBindingClosure;\nstruct AssemblyReferenceClosureWalkContextForProfAPI;\n\n#include \"eventpipeadaptertypes.h\"\n\n#if defined (PROFILING_SUPPORTED_DATA) || defined(PROFILING_SUPPORTED)\n#ifndef PROFILING_SUPPORTED_DATA\n#define PROFILING_SUPPORTED_DATA 1\n#endif  // PROFILING_SUPPORTED_DATA\n\n#include \"corprof.h\"\n#include \"slist.h\"\n\n#define MAX_NOTIFICATION_PROFILERS 32\n\n//---------------------------------------------------------------------------------------\n// Enumerates the various init states of profiling.\n//\n// *** NOTE: The order is important here, as some of the status checks (e.g.,\n// CORProfilerPresentOrInitializing) use \">\" with these enum values. ***\n\nenum ProfilerStatus\n{\n    kProfStatusNone                        = 0, // No profiler running.\n    kProfStatusDetaching                   = 1, // Prof was running, is now detaching, but still loaded\n    kProfStatusInitializingForStartupLoad  = 2, // Prof ready for (or in) its Initialize callback\n    kProfStatusInitializingForAttachLoad   = 3, // Prof ready for (or in) its InitializeForAttach callback\n    kProfStatusActive                      = 4, // Prof completed initialization and is actively running\n    kProfStatusPreInitialize               = 5, // Prof is in LoadProfiler, but initialization has yet to occur\n};\n\nclass CurrentProfilerStatus\n{\nprivate:\n    // Why volatile?\n    // See code:ProfilingAPIUtility::InitializeProfiling#LoadUnloadCallbackSynchronization\n    Volatile<ProfilerStatus> m_profStatus;\n\npublic:\n    void Init();\n    ProfilerStatus Get();\n    void Set(ProfilerStatus profStatus);\n};\n\nclass EventMask\n{\n    friend class ProfControlBlock;\nprivate:\n    const UINT64 EventMaskLowMask           = 0x00000000FFFFFFFF;\n    const UINT64 EventMaskHighShiftAmount   = 32;\n    const UINT64 EventMaskHighMask          = 0xFFFFFFFF00000000;\n\n    Volatile<UINT64> m_eventMask;\n\npublic:\n    EventMask() :\n        m_eventMask(0)\n    {\n\n    }\n\n    EventMask& operator=(const EventMask& other);\n\n    BOOL IsEventMaskSet(DWORD eventMask);\n    DWORD GetEventMask();\n    void SetEventMask(DWORD eventMask);\n    BOOL IsEventMaskHighSet(DWORD eventMaskHigh);\n    DWORD GetEventMaskHigh();\n    void SetEventMaskHigh(DWORD eventMaskHigh);\n};\n\nclass ProfilerInfo\n{\npublic:\n    // **** IMPORTANT!! ****\n    // All uses of pProfInterface must be properly synchronized to avoid the profiler\n    // from detaching while the EE attempts to call into it.  The recommended way to do\n    // this is to use the (lockless) BEGIN_PROFILER_CALLBACK / END_PROFILER_CALLBACK macros.  See\n    // code:BEGIN_PROFILER_CALLBACK for instructions.  For full details on how the\n    // synchronization works, see\n    // code:ProfilingAPIUtility::InitializeProfiling#LoadUnloadCallbackSynchronization\n    VolatilePtr<EEToProfInterfaceImpl> pProfInterface;\n    // **** IMPORTANT!! ****\n\n    CurrentProfilerStatus curProfStatus;\n\n    EventMask eventMask;\n\n    Volatile<BOOL> inUse;\n\n    DWORD slot;\n\n    // Reset those variables that is only for the current attach session\n    void ResetPerSessionStatus();\n    void Init();\n};\n\nenum class ProfilerCallbackType\n{\n    Active,\n    ActiveOrInitializing\n};\n\n// We need a way to track which profilers are in active calls, to synchronize with detach.\n// If we detached a profiler while it was actively in a callback there would be issues.\n// However, we don't want to pin all profilers, because then a chatty profiler could\n// cause another profiler to not be able to detach. We can't just check the event masks\n// before and after the call because it is legal for a profiler to change its event mask,\n// and then it would be possible for a profiler to permanently prevent itself from detaching.\n//\n// WHEN IS EvacuationCounterHolder REQUIRED?\n// Answer: any time you access a ProfilerInfo *. There is a specific sequence that must be followed:\n//   - Do a dirty read of the Profiler interface\n//   - Increment an evacuation counter by using EvacuationCounterHolder as a RAII guard class\n//   - Now do a clean read of the ProfilerInfo's status - this will be changed during detach and\n//     is always read with a memory barrier\n//\n// The DoProfilerCallback/IterateProfilers functions automate this process for you, you should use\n// them unless you are absolutely sure you know what you're doing\nclass EvacuationCounterHolder\n{\nprivate:\n    ProfilerInfo *m_pProfilerInfo;\n    Thread *m_pThread;\n\npublic:\n    EvacuationCounterHolder(ProfilerInfo *pProfilerInfo);\n    ~EvacuationCounterHolder();\n};\n\nstruct StoredProfilerNode\n{\n    CLSID guid;\n    SString path;\n    SLink m_Link;\n};\n\ntypedef SList<StoredProfilerNode, true> STOREDPROFILERLIST;\n// ---------------------------------------------------------------------------------------\n// Global struct that lets the EE see the load status of the profiler, and provides a\n// pointer (pProfInterface) through which profiler calls can be made\n//\n// When you are adding new session, please refer to\n// code:ProfControlBlock::ResetPerSessionStatus#ProfileResetSessionStatus for more details.\nclass ProfControlBlock\n{\nprivate:\n    // IsProfilerPresent(pProfilerInfo) returns whether or not a CLR Profiler is actively loaded\n    // (meaning it's initialized and ready to receive callbacks).\n    FORCEINLINE BOOL IsProfilerPresent(ProfilerInfo *pProfilerInfo)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n\n        return pProfilerInfo->curProfStatus.Get() >= kProfStatusActive;\n    }\n\n    FORCEINLINE BOOL IsProfilerPresentOrInitializing(ProfilerInfo *pProfilerInfo)\n    {\n        return pProfilerInfo->curProfStatus.Get() > kProfStatusDetaching;\n    }\n\n    template<typename Func, typename... Args>\n    FORCEINLINE VOID DoOneProfilerIteration(ProfilerInfo *pProfilerInfo, ProfilerCallbackType callbackType, Func callback, Args... args)\n    {\n        // This is the dirty read\n        if (pProfilerInfo->pProfInterface.Load() != NULL)\n        {\n#ifdef FEATURE_PROFAPI_ATTACH_DETACH\n            // Now indicate we are accessing the profiler\n            EvacuationCounterHolder evacuationCounter(pProfilerInfo);\n#endif // FEATURE_PROFAPI_ATTACH_DETACH\n\n            if ((callbackType == ProfilerCallbackType::Active && IsProfilerPresent(pProfilerInfo))\n                || (callbackType == ProfilerCallbackType::ActiveOrInitializing && IsProfilerPresentOrInitializing(pProfilerInfo)))\n            {\n                callback(pProfilerInfo, args...);\n            }\n        }\n    }\n\n    template<typename Func, typename... Args>\n    FORCEINLINE VOID IterateProfilers(ProfilerCallbackType callbackType, Func callback, Args... args)\n    {\n        DoOneProfilerIteration(&mainProfilerInfo, callbackType, callback, args...);\n\n        if (notificationProfilerCount > 0)\n        {\n            for (SIZE_T i = 0; i < MAX_NOTIFICATION_PROFILERS; ++i)\n            {\n                ProfilerInfo *current = &(notificationOnlyProfilers[i]);\n                DoOneProfilerIteration(current, callbackType, callback, args...);\n            }\n        }\n    }\n\npublic:\n    BOOL fGCInProgress;\n    BOOL fBaseSystemClassesLoaded;\n\n    STOREDPROFILERLIST storedProfilers;\n\n    ProfilerInfo mainProfilerInfo;\n\n    ProfilerInfo notificationOnlyProfilers[MAX_NOTIFICATION_PROFILERS];\n    Volatile<LONG> notificationProfilerCount;\n\n    EventMask globalEventMask;\n\n#ifdef PROF_TEST_ONLY_FORCE_ELT_DATA\n    // #TestOnlyELT This implements a test-only (and debug-only) hook that allows a test\n    // profiler to ensure enter/leave/tailcall is enabled on startup even though no\n    // profiler is loaded on startup. This allows an attach profiler to use ELT to build\n    // shadow stacks for the sole purpose of verifying OTHER areas of the profiling API\n    // (e.g., stack walking). When this BOOL is TRUE, the JIT will insert calls to the\n    // slow-path profiling API enter/leave/tailcall hooks, which will forward the call to\n    // a profiler if one is loaded (and do nothing otherwise).\n    //\n    // See code:AreCallbackStateFlagsSet#P2CLRRestrictionsOverview for general information\n    // on how the test hooks lift restrictions normally in place for the Info functions.\n    BOOL fTestOnlyForceEnterLeave;\n#endif\n\n#ifdef PROF_TEST_ONLY_FORCE_OBJECT_ALLOCATED_DATA\n    // #TestOnlyObjectAllocated This implements a test-only (and debug-only) hook that allows\n    // a test profiler to ensure ObjectAllocated callback is enabled on startup even though no\n    // profiler is loaded on startup. This allows an attach profiler to use ObjectAllocated\n    // callback for the sole purpose of verifying OTHER GC areas of the profiling API\n    // (e.g., constructing a object graph). When this BOOL is TRUE, the JIT will use special\n    // version of new allocators that issue object allocation notifications, which will forward\n    // the notifications to a profiler if one is loaded (and do nothing otherwise).\n    //\n    // See code:AreCallbackStateFlagsSet#P2CLRRestrictionsOverview for general information\n    // on how the test hooks lift restrictions normally in place for the Info functions.\n    BOOL fTestOnlyForceObjectAllocated;\n#endif\n\n#ifdef _DEBUG\n    // Test-only, debug-only code to allow attaching profilers to call ICorProfilerInfo interface,\n    // which would otherwise be disallowed for attaching profilers\n    BOOL                    fTestOnlyEnableICorProfilerInfo;\n#endif // _DEBUG\n\n    // Whether we've turned off concurrent GC during attach\n    Volatile<BOOL> fConcurrentGCDisabledForAttach;\n\n    Volatile<BOOL> fProfControlBlockInitialized;\n\n    Volatile<BOOL> fProfilerRequestedRuntimeSuspend;\n\n    void Init();\n    BOOL IsMainProfiler(EEToProfInterfaceImpl *pEEToProf);\n    BOOL IsMainProfiler(ProfToEEInterfaceImpl *pProfToEE);\n    ProfilerInfo *GetProfilerInfo(ProfToEEInterfaceImpl *pProfToEE);\n\n    template<typename ConditionFunc, typename CallbackFunc, typename... Args>\n    static void DoProfilerCallbackHelper(ProfilerInfo *pProfilerInfo, ConditionFunc condition, CallbackFunc callback, HRESULT *pHR, Args... args)\n    {\n        if (condition(pProfilerInfo))\n        {\n            HRESULT innerHR = callback(pProfilerInfo->pProfInterface, args...);\n            if (FAILED(innerHR))\n            {\n                *pHR = innerHR;\n            }\n        }\n    }\n\n    template<typename ConditionFunc, typename CallbackFunc, typename... Args>\n    FORCEINLINE HRESULT DoProfilerCallback(ProfilerCallbackType callbackType, ConditionFunc condition, CallbackFunc callback, Args... args)\n    {\n        HRESULT hr = S_OK;\n        IterateProfilers(callbackType,\n                         &DoProfilerCallbackHelper<ConditionFunc, CallbackFunc, Args...>,\n                         condition, callback, &hr, args...);\n        return hr;\n    }\n\n#ifndef DACCESS_COMPILE\n    ProfilerInfo *FindNextFreeProfilerInfoSlot();\n    void DeRegisterProfilerInfo(ProfilerInfo *pProfilerInfo);\n    void UpdateGlobalEventMask();\n#endif // DACCESS_COMPILE\n\n    BOOL IsCallback3Supported();\n    BOOL IsCallback5Supported();\n    BOOL RequiresGenericsContextForEnterLeave();\n    UINT_PTR EEFunctionIDMapper(FunctionID funcId, BOOL * pbHookFunction);\n\n    void ThreadCreated(ThreadID threadID);\n    void ThreadDestroyed(ThreadID threadID);\n    void ThreadAssignedToOSThread(ThreadID managedThreadId, DWORD osThreadId);\n    void ThreadNameChanged(ThreadID managedThreadId, ULONG cchName, WCHAR name[]);\n    void Shutdown();\n    void FunctionUnloadStarted(FunctionID functionId);\n    void JITCompilationFinished(FunctionID functionId, HRESULT hrStatus, BOOL fIsSafeToBlock);\n    void JITCompilationStarted(FunctionID functionId, BOOL fIsSafeToBlock);\n    void DynamicMethodJITCompilationStarted(FunctionID functionId, BOOL fIsSafeToBlock, LPCBYTE pILHeader, ULONG cbILHeader);\n    void DynamicMethodJITCompilationFinished(FunctionID functionId, HRESULT hrStatus, BOOL fIsSafeToBlock);\n    void DynamicMethodUnloaded(FunctionID functionId);\n    void JITCachedFunctionSearchStarted(FunctionID functionId, BOOL *pbUseCachedFunction);\n    void JITCachedFunctionSearchFinished(FunctionID functionId, COR_PRF_JIT_CACHE result);\n    HRESULT JITInlining(FunctionID callerId, FunctionID calleeId, BOOL *pfShouldInline);\n    void ReJITCompilationStarted(FunctionID functionId, ReJITID reJitId, BOOL fIsSafeToBlock);\n    HRESULT GetReJITParameters(ModuleID moduleId, mdMethodDef methodId, ICorProfilerFunctionControl *pFunctionControl);\n    void ReJITCompilationFinished(FunctionID functionId, ReJITID reJitId, HRESULT hrStatus, BOOL fIsSafeToBlock);\n    void ReJITError(ModuleID moduleId, mdMethodDef methodId, FunctionID functionId, HRESULT hrStatus);\n    void ModuleLoadStarted(ModuleID moduleId);\n    void ModuleLoadFinished(ModuleID moduleId, HRESULT hrStatus);\n    void ModuleUnloadStarted(ModuleID moduleId);\n    void ModuleUnloadFinished(ModuleID moduleId, HRESULT hrStatus);\n    void ModuleAttachedToAssembly(ModuleID moduleId, AssemblyID AssemblyId);\n    void ModuleInMemorySymbolsUpdated(ModuleID moduleId);\n    void ClassLoadStarted(ClassID classId);\n    void ClassLoadFinished(ClassID classId, HRESULT hrStatus);\n    void ClassUnloadStarted(ClassID classId);\n    void ClassUnloadFinished(ClassID classId, HRESULT hrStatus);\n    void AppDomainCreationStarted(AppDomainID appDomainId);\n    void AppDomainCreationFinished(AppDomainID appDomainId, HRESULT hrStatus);\n    void AppDomainShutdownStarted(AppDomainID appDomainId);\n    void AppDomainShutdownFinished(AppDomainID appDomainId, HRESULT hrStatus);\n    void AssemblyLoadStarted(AssemblyID assemblyId);\n    void AssemblyLoadFinished(AssemblyID assemblyId, HRESULT hrStatus);\n    void AssemblyUnloadStarted(AssemblyID assemblyId);\n    void AssemblyUnloadFinished(AssemblyID assemblyId, HRESULT hrStatus);\n    void UnmanagedToManagedTransition(FunctionID functionId, COR_PRF_TRANSITION_REASON reason);\n    void ManagedToUnmanagedTransition(FunctionID functionId, COR_PRF_TRANSITION_REASON reason);\n    void ExceptionThrown(ObjectID thrownObjectId);\n    void ExceptionSearchFunctionEnter(FunctionID functionId);\n    void ExceptionSearchFunctionLeave();\n    void ExceptionSearchFilterEnter(FunctionID funcId);\n    void ExceptionSearchFilterLeave();\n    void ExceptionSearchCatcherFound(FunctionID functionId);\n    void ExceptionOSHandlerEnter(FunctionID funcId);\n    void ExceptionOSHandlerLeave(FunctionID funcId);\n    void ExceptionUnwindFunctionEnter(FunctionID functionId);\n    void ExceptionUnwindFunctionLeave();\n    void ExceptionUnwindFinallyEnter(FunctionID functionId);\n    void ExceptionUnwindFinallyLeave();\n    void ExceptionCatcherEnter(FunctionID functionId, ObjectID objectId);\n    void ExceptionCatcherLeave();\n    void COMClassicVTableCreated(ClassID wrappedClassId, REFGUID implementedIID, void *pVTable, ULONG cSlots);\n    void RuntimeSuspendStarted(COR_PRF_SUSPEND_REASON suspendReason);\n    void RuntimeSuspendFinished();\n    void RuntimeSuspendAborted();\n    void RuntimeResumeStarted();\n    void RuntimeResumeFinished();\n    void RuntimeThreadSuspended(ThreadID suspendedThreadId);\n    void RuntimeThreadResumed(ThreadID resumedThreadId);\n    void ObjectAllocated(ObjectID objectId, ClassID classId);\n    void FinalizeableObjectQueued(BOOL isCritical, ObjectID objectID);\n    void MovedReference(BYTE *pbMemBlockStart, BYTE *pbMemBlockEnd, ptrdiff_t cbRelocDistance, void *pHeapId, BOOL fCompacting);\n    void EndMovedReferences(void *pHeapId);\n    void RootReference2(BYTE *objectId, EtwGCRootKind dwEtwRootKind, EtwGCRootFlags dwEtwRootFlags, void *rootID, void *pHeapId);\n    void EndRootReferences2(void *pHeapId);\n    void ConditionalWeakTableElementReference(BYTE *primaryObjectId, BYTE *secondaryObjectId, void *rootID, void *pHeapId);\n    void EndConditionalWeakTableElementReferences(void *pHeapId);\n    void AllocByClass(ObjectID objId, ClassID classId, void *pHeapId);\n    void EndAllocByClass(void *pHeapId);\n    HRESULT ObjectReference(ObjectID objId, ClassID classId, ULONG cNumRefs, ObjectID *arrObjRef);\n    void HandleCreated(UINT_PTR handleId, ObjectID initialObjectId);\n    void HandleDestroyed(UINT_PTR handleId);\n    void GarbageCollectionStarted(int cGenerations, BOOL generationCollected[], COR_PRF_GC_REASON reason);\n    void GarbageCollectionFinished();\n    void GetAssemblyReferences(LPCWSTR wszAssemblyPath, IAssemblyBindingClosure *pClosure, AssemblyReferenceClosureWalkContextForProfAPI *pContext);\n    void EventPipeEventDelivered(EventPipeProvider *provider, DWORD eventId, DWORD eventVersion, ULONG cbMetadataBlob, LPCBYTE metadataBlob, ULONG cbEventData,\n                                 LPCBYTE eventData, LPCGUID pActivityId, LPCGUID pRelatedActivityId, Thread *pEventThread, ULONG numStackFrames, UINT_PTR stackFrames[]);\n    void EventPipeProviderCreated(EventPipeProvider *provider);\n};\n\n\nGVAL_DECL(ProfControlBlock, g_profControlBlock);\n\n// Provides definitions of the CORProfilerTrack* functions that test whether a profiler\n// is active and responding to various callbacks\n#include \"profilepriv.inl\"\n\n//---------------------------------------------------------------\n// Bit flags used to track profiler callback execution state, such as which\n// ICorProfilerCallback method we're currently executing. These help us enforce the\n// invariants of which calls a profiler is allowed to make at given times. These flags\n// are stored in Thread::m_profilerCallbackState.\n//\n// For now, we ensure:\n//     * Only asynchronous-safe calls are made asynchronously (i.e., are made from\n//         outside of profiler callbacks).\n//     * GC_TRIGGERS info methods are not called from GC_NOTRIGGER callbacks\n//\n// Later, we may choose to enforce even more refined call trees and add more flags.\n#define COR_PRF_CALLBACKSTATE_INCALLBACK                 0x1\n#define COR_PRF_CALLBACKSTATE_IN_TRIGGERS_SCOPE          0x2\n#define COR_PRF_CALLBACKSTATE_FORCEGC_WAS_CALLED         0x4\n#define COR_PRF_CALLBACKSTATE_REJIT_WAS_CALLED           0x8\n//\n//---------------------------------------------------------------\n\n#endif // defined(PROFILING_SUPPORTED_DATA) || defined(PROFILING_SUPPORTED)\n\n// This is the helper callback that the gc uses when walking the heap.\nbool HeapWalkHelper(Object* pBO, void* pv);\nvoid ScanRootsHelper(Object* pObj, Object** ppRoot, ScanContext *pSC, uint32_t dwUnused);\nbool AllocByClassHelper(Object* pBO, void* pv);\n\n#endif  // _ProfilePriv_h_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/profilepriv.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// ProfilePriv.inl\n//\n\n//\n// Inlined functions used by the Profiling API and throughout the EE. Most notably are\n// the CORProfilerTrack* functions that test whether a profiler is active and responding\n// to various callbacks\n//\n\n// ======================================================================================\n#ifndef _ProfilePriv_inl_\n#define _ProfilePriv_inl_\n\n#include \"eetoprofinterfaceimpl.h\"\n#ifdef PROFILING_SUPPORTED\n#include \"profilinghelper.h\"\n#endif // PROFILING_SUPPORTED\n\n//---------------------------------------------------------------------------------------\n// CurrentProfilerStatus\n//---------------------------------------------------------------------------------------\n\ninline void CurrentProfilerStatus::Init()\n{\n    LIMITED_METHOD_CONTRACT;\n    m_profStatus = kProfStatusNone;\n}\n\ninline ProfilerStatus CurrentProfilerStatus::Get()\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n    return m_profStatus;\n}\n\ninline EventMask& EventMask::operator=(const EventMask& other)\n{\n    m_eventMask = other.m_eventMask;\n    return *this;\n}\n\ninline BOOL EventMask::IsEventMaskSet(DWORD eventMask)\n{\n    return (GetEventMask() & eventMask) != 0;\n}\n\ninline DWORD EventMask::GetEventMask()\n{\n    return (DWORD)(m_eventMask & EventMaskLowMask);\n}\n\ninline void EventMask::SetEventMask(DWORD eventMask)\n{\n    m_eventMask = (m_eventMask & EventMaskHighMask) | (UINT64)eventMask;\n}\n\ninline BOOL EventMask::IsEventMaskHighSet(DWORD eventMaskHigh)\n{\n    return (GetEventMaskHigh() & eventMaskHigh) != 0;\n}\n\ninline DWORD EventMask::GetEventMaskHigh()\n{\n    return (DWORD)((m_eventMask & EventMaskHighMask) >> EventMaskHighShiftAmount);\n}\n\ninline void EventMask::SetEventMaskHigh(DWORD eventMaskHigh)\n{\n    m_eventMask = (m_eventMask & EventMaskLowMask) | ((UINT64)eventMaskHigh << EventMaskHighShiftAmount);\n}\n\n// Reset those variables that is only for the current attach session\ninline void ProfilerInfo::ResetPerSessionStatus()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    pProfInterface = NULL;\n    eventMask.SetEventMask(COR_PRF_MONITOR_NONE);\n    eventMask.SetEventMaskHigh(COR_PRF_HIGH_MONITOR_NONE);\n}\n\ninline void ProfilerInfo::Init()\n{\n    curProfStatus.Init();\n    ResetPerSessionStatus();\n    inUse = FALSE;\n}\n\ninline HRESULT AnyProfilerPassesConditionHelper(EEToProfInterfaceImpl *profInterface, BOOL *pAnyPassed)\n{\n    *pAnyPassed = TRUE;\n    return S_OK;\n}\n\ntemplate<typename ConditionFunc>\nFORCEINLINE BOOL AnyProfilerPassesCondition(ConditionFunc condition)\n{\n    BOOL anyPassed = FALSE;\n    (&g_profControlBlock)->DoProfilerCallback(ProfilerCallbackType::ActiveOrInitializing,\n                                              condition,\n                                              &AnyProfilerPassesConditionHelper,\n                                              &anyPassed);\n\n    return anyPassed;\n}\n\n//---------------------------------------------------------------------------------------\n// ProfControlBlock\n//---------------------------------------------------------------------------------------\n\ninline void ProfControlBlock::Init()\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    mainProfilerInfo.Init();\n    // Special magic value for the main one\n    mainProfilerInfo.slot = MAX_NOTIFICATION_PROFILERS;\n\n    for (SIZE_T i = 0; i < MAX_NOTIFICATION_PROFILERS; ++i)\n    {\n        notificationOnlyProfilers[i].Init();\n        notificationOnlyProfilers[i].slot = (DWORD)i;\n    }\n\n    globalEventMask.SetEventMask(COR_PRF_MONITOR_NONE);\n    globalEventMask.SetEventMaskHigh(COR_PRF_HIGH_MONITOR_NONE);\n\n    fGCInProgress = FALSE;\n    fBaseSystemClassesLoaded = FALSE;\n#ifdef PROF_TEST_ONLY_FORCE_ELT\n    fTestOnlyForceEnterLeave = FALSE;\n#endif\n\n#ifdef PROF_TEST_ONLY_FORCE_OBJECT_ALLOCATED\n    fTestOnlyForceObjectAllocated = FALSE;\n#endif\n\n#ifdef _DEBUG\n    fTestOnlyEnableICorProfilerInfo = FALSE;\n#endif // _DEBUG\n\n    fConcurrentGCDisabledForAttach = FALSE;\n\n    mainProfilerInfo.ResetPerSessionStatus();\n\n    fProfControlBlockInitialized = TRUE;\n\n    fProfilerRequestedRuntimeSuspend = FALSE;\n}\n\n\ninline BOOL ProfControlBlock::IsMainProfiler(EEToProfInterfaceImpl *pEEToProf)\n{\n    EEToProfInterfaceImpl *pProfInterface = mainProfilerInfo.pProfInterface.Load();\n    return pProfInterface == pEEToProf;\n}\n\ninline BOOL ProfControlBlock::IsMainProfiler(ProfToEEInterfaceImpl *pProfToEE)\n{\n    EEToProfInterfaceImpl *pProfInterface = mainProfilerInfo.pProfInterface.Load();\n    return pProfInterface != NULL && pProfInterface->m_pProfToEE == pProfToEE;\n}\n\ninline void GetProfilerInfoHelper(ProfilerInfo *pProfilerInfo, ProfToEEInterfaceImpl *pProfToEE, ProfilerInfo **ppFoundProfilerInfo)\n{\n    if (pProfilerInfo->pProfInterface->GetProfToEE() == pProfToEE)\n    {\n        *ppFoundProfilerInfo = pProfilerInfo;\n    }\n}\n\ninline ProfilerInfo *ProfControlBlock::GetProfilerInfo(ProfToEEInterfaceImpl *pProfToEE)\n{\n    ProfilerInfo *pProfilerInfo = NULL;\n    IterateProfilers(ProfilerCallbackType::ActiveOrInitializing,\n                      &GetProfilerInfoHelper,\n                      pProfToEE,\n                      &pProfilerInfo);\n\n    return pProfilerInfo;\n}\n\n#ifndef DACCESS_COMPILE\ninline ProfilerInfo *ProfControlBlock::FindNextFreeProfilerInfoSlot()\n{\n    for (SIZE_T i = 0; i < MAX_NOTIFICATION_PROFILERS; ++i)\n    {\n        if (InterlockedCompareExchange((LONG *)notificationOnlyProfilers[i].inUse.GetPointer(), TRUE, FALSE) == FALSE)\n        {\n            InterlockedIncrement(notificationProfilerCount.GetPointer());\n            return &(notificationOnlyProfilers[i]);\n        }\n    }\n\n    return NULL;\n}\n\ninline void ProfControlBlock::DeRegisterProfilerInfo(ProfilerInfo *pProfilerInfo)\n{\n    pProfilerInfo->inUse = FALSE;\n    InterlockedDecrement(notificationProfilerCount.GetPointer());\n}\n\ninline void UpdateGlobalEventMaskHelper(ProfilerInfo *pProfilerInfo, DWORD *pEventMask)\n{\n    *pEventMask |= pProfilerInfo->eventMask.GetEventMask();\n}\n\ninline void UpdateGlobalEventMaskHighHelper(ProfilerInfo *pProfilerInfo, DWORD *pEventMaskHigh)\n{\n    *pEventMaskHigh |= pProfilerInfo->eventMask.GetEventMaskHigh();\n}\n\ninline void ProfControlBlock::UpdateGlobalEventMask()\n{\n    while (true)\n    {\n        UINT64 originalEventMask = globalEventMask.m_eventMask;\n        UINT64 qwEventMask = 0;\n\n        IterateProfilers(ProfilerCallbackType::ActiveOrInitializing,\n                        [](ProfilerInfo *pProfilerInfo, UINT64 *pEventMask)\n                          {\n                              *pEventMask |= pProfilerInfo->eventMask.m_eventMask;\n                          },\n                          &qwEventMask);\n\n        // We are relying on the memory barrier introduced by InterlockedCompareExchange64 to observer any\n        // change to the global event mask.\n        if ((UINT64)InterlockedCompareExchange64((LONG64 *)&(globalEventMask.m_eventMask), (LONG64)qwEventMask, (LONG64)originalEventMask) == originalEventMask)\n        {\n            break;\n        }\n    }\n}\n#endif // DACCESS_COMPILE\n\ninline BOOL IsCallback3SupportedHelper(ProfilerInfo *pProfilerInfo)\n{\n    return pProfilerInfo->pProfInterface->IsCallback3Supported(); \n}\n\nFORCEINLINE BOOL ProfControlBlock::IsCallback3Supported()\n{\n    return AnyProfilerPassesCondition(&IsCallback3SupportedHelper);\n}\n\ninline BOOL IsCallback5SupportedHelper(ProfilerInfo *pProfilerInfo)\n{\n    return pProfilerInfo->pProfInterface->IsCallback5Supported();\n}\n\nFORCEINLINE BOOL ProfControlBlock::IsCallback5Supported()\n{\n    return AnyProfilerPassesCondition(&IsCallback5SupportedHelper);\n}\n\ninline BOOL RequiresGenericsContextForEnterLeaveHelper(ProfilerInfo *pProfilerInfo)\n{\n    return pProfilerInfo->pProfInterface->RequiresGenericsContextForEnterLeave();\n}\n\nFORCEINLINE BOOL ProfControlBlock::RequiresGenericsContextForEnterLeave()\n{\n    return AnyProfilerPassesCondition(&RequiresGenericsContextForEnterLeaveHelper); \n}\n\ninline bool DoesProfilerWantEEFunctionIDMapper(ProfilerInfo *pProfilerInfo)\n{\n    return ((pProfilerInfo->pProfInterface->GetFunctionIDMapper()  != NULL) ||\n             (pProfilerInfo->pProfInterface->GetFunctionIDMapper2() != NULL));\n}\n\ninline void EEFunctionIDMapperHelper(ProfilerInfo *pProfilerInfo, FunctionID funcId, BOOL *pbHookFunction, UINT_PTR *pPtr)\n{\n   if (DoesProfilerWantEEFunctionIDMapper(pProfilerInfo))\n   {\n       *pPtr = pProfilerInfo->pProfInterface->EEFunctionIDMapper(funcId, pbHookFunction);\n   }\n}\n\ninline UINT_PTR ProfControlBlock::EEFunctionIDMapper(FunctionID funcId, BOOL *pbHookFunction)\n{\n    LIMITED_METHOD_CONTRACT;\n    UINT_PTR ptr = NULL;\n    DoOneProfilerIteration(&mainProfilerInfo,\n                          ProfilerCallbackType::Active,\n                          &EEFunctionIDMapperHelper,\n                          funcId, pbHookFunction, &ptr);\n\n    return ptr;\n}\n\ninline BOOL IsProfilerTrackingThreads(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_THREADS);\n}\n\ninline HRESULT ThreadCreatedHelper(EEToProfInterfaceImpl *profInterface, ThreadID threadID)\n{\n    return profInterface->ThreadCreated(threadID);\n}\n\ninline void ProfControlBlock::ThreadCreated(ThreadID threadID)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingThreads,\n                       &ThreadCreatedHelper,\n                       threadID);\n}\n\ninline HRESULT ThreadDestroyedHelper(EEToProfInterfaceImpl *profInterface, ThreadID threadID)\n{\n    return profInterface->ThreadDestroyed(threadID);\n}\n\ninline void ProfControlBlock::ThreadDestroyed(ThreadID threadID)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingThreads,\n                       &ThreadDestroyedHelper,\n                       threadID);\n}\n\ninline HRESULT ThreadAssignedToOSThreadHelper(EEToProfInterfaceImpl *profInterface, ThreadID managedThreadId, DWORD osThreadId)\n{\n    return profInterface->ThreadAssignedToOSThread(managedThreadId, osThreadId);\n}\n\ninline void ProfControlBlock::ThreadAssignedToOSThread(ThreadID managedThreadId, DWORD osThreadId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingThreads,\n                       &ThreadAssignedToOSThreadHelper,\n                       managedThreadId, osThreadId);\n}\n\ninline HRESULT ThreadNameChangedHelper(EEToProfInterfaceImpl *profInterface, ThreadID managedThreadId, ULONG cchName, WCHAR name[])\n{\n    return profInterface->ThreadNameChanged(managedThreadId, cchName, name);\n}\n\ninline void ProfControlBlock::ThreadNameChanged(ThreadID managedThreadId, ULONG cchName, WCHAR name[])\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingThreads,\n                       &ThreadNameChangedHelper,\n                       managedThreadId, cchName, name);\n}\n\ninline HRESULT ShutdownHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->Shutdown();\n}\n\ninline void ProfControlBlock::Shutdown()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       [](ProfilerInfo *pProfilerInfo) { return true; },\n                       &ShutdownHelper);\n}\n\ninline BOOL IsProfilerTrackingJITInfo(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_JIT_COMPILATION);\n}\n\ninline HRESULT JITCompilationFinishedHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, HRESULT hrStatus, BOOL fIsSafeToBlock)\n{\n    return profInterface->JITCompilationFinished(functionId, hrStatus, fIsSafeToBlock);\n}\n\ninline void ProfControlBlock::JITCompilationFinished(FunctionID functionId, HRESULT hrStatus, BOOL fIsSafeToBlock)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingJITInfo,\n                       &JITCompilationFinishedHelper,\n                       functionId, hrStatus, fIsSafeToBlock);\n}\n\ninline HRESULT JITCompilationStartedHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, BOOL fIsSafeToBlock)\n{\n    return profInterface->JITCompilationStarted(functionId, fIsSafeToBlock);\n}\n\ninline void ProfControlBlock::JITCompilationStarted(FunctionID functionId, BOOL fIsSafeToBlock)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingJITInfo,\n                       &JITCompilationStartedHelper,\n                       functionId, fIsSafeToBlock);\n}\n\ninline HRESULT DynamicMethodJITCompilationStartedHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, BOOL fIsSafeToBlock, LPCBYTE pILHeader, ULONG cbILHeader)\n{\n    return profInterface->DynamicMethodJITCompilationStarted(functionId, fIsSafeToBlock, pILHeader, cbILHeader);\n}\n\ninline void ProfControlBlock::DynamicMethodJITCompilationStarted(FunctionID functionId, BOOL fIsSafeToBlock, LPCBYTE pILHeader, ULONG cbILHeader)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingJITInfo,\n                       &DynamicMethodJITCompilationStartedHelper,\n                       functionId, fIsSafeToBlock, pILHeader, cbILHeader);\n}\n\ninline HRESULT DynamicMethodJITCompilationFinishedHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, HRESULT hrStatus, BOOL fIsSafeToBlock)\n{\n    return profInterface->DynamicMethodJITCompilationFinished(functionId, hrStatus, fIsSafeToBlock);\n}\n\ninline void ProfControlBlock::DynamicMethodJITCompilationFinished(FunctionID functionId, HRESULT hrStatus, BOOL fIsSafeToBlock)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingJITInfo,\n                       &DynamicMethodJITCompilationFinishedHelper,\n                       functionId, hrStatus, fIsSafeToBlock);\n}\n\ninline BOOL IsProfilerMonitoringDynamicFunctionUnloads(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS);\n}\n\ninline HRESULT DynamicMethodUnloadedHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId)\n{\n    return profInterface->DynamicMethodUnloaded(functionId);\n}\n\ninline void ProfControlBlock::DynamicMethodUnloaded(FunctionID functionId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerMonitoringDynamicFunctionUnloads,\n                       &DynamicMethodUnloadedHelper,\n                       functionId);\n}\n\ninline BOOL IsProfilerTrackingCacheSearches(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_CACHE_SEARCHES);\n}\n\ninline HRESULT JITCachedFunctionSearchStartedHelper(EEToProfInterfaceImpl *profInterface, BOOL *pAllTrue, FunctionID functionId)\n{\n    BOOL fUseCachedFunction = TRUE;\n    HRESULT hr = profInterface->JITCachedFunctionSearchStarted(functionId, &fUseCachedFunction);\n    *pAllTrue = *pAllTrue && fUseCachedFunction;\n    return hr;\n}\n\ninline void ProfControlBlock::JITCachedFunctionSearchStarted(FunctionID functionId, BOOL *pbUseCachedFunction)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    BOOL allTrue = TRUE;\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingCacheSearches,\n                       &JITCachedFunctionSearchStartedHelper,\n                       &allTrue, functionId);\n\n    // If any reject it, consider it rejected.\n    *pbUseCachedFunction = allTrue;\n}\n\ninline HRESULT JITCachedFunctionSearchFinishedHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, COR_PRF_JIT_CACHE result)\n{\n    return profInterface->JITCachedFunctionSearchFinished(functionId, result);\n}\n\ninline void ProfControlBlock::JITCachedFunctionSearchFinished(FunctionID functionId, COR_PRF_JIT_CACHE result)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingCacheSearches,\n                       &JITCachedFunctionSearchFinishedHelper,\n                       functionId, result);\n}\n\ninline HRESULT JITInliningHelper(EEToProfInterfaceImpl *profInterface, BOOL *pAllTrue, FunctionID callerId, FunctionID calleeId)\n{\n    BOOL fShouldInline = TRUE;\n    HRESULT hr = profInterface->JITInlining(callerId, calleeId, &fShouldInline);\n    *pAllTrue = *pAllTrue && fShouldInline;\n    return hr;\n}\n\ninline HRESULT ProfControlBlock::JITInlining(FunctionID callerId, FunctionID calleeId, BOOL *pfShouldInline)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    *pfShouldInline = TRUE;\n    BOOL allTrue = TRUE;\n    HRESULT hr =  DoProfilerCallback(ProfilerCallbackType::Active,\n                                     IsProfilerTrackingJITInfo,\n                                     &JITInliningHelper,\n                                     &allTrue, callerId, calleeId);\n\n    // If any reject it, consider it rejected.\n    *pfShouldInline = allTrue;\n    return hr;\n}\n\ninline BOOL IsRejitEnabled(ProfilerInfo *pProfilerInfo)\n{\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_ENABLE_REJIT);\n}\n\ninline void ReJITCompilationStartedHelper(ProfilerInfo *pProfilerInfo, FunctionID functionId, ReJITID reJitId, BOOL fIsSafeToBlock)\n{\n    if (IsRejitEnabled(pProfilerInfo))\n    {\n        pProfilerInfo->pProfInterface->ReJITCompilationStarted(functionId, reJitId, fIsSafeToBlock);\n    }\n}\n\ninline void ProfControlBlock::ReJITCompilationStarted(FunctionID functionId, ReJITID reJitId, BOOL fIsSafeToBlock)\n{\n    LIMITED_METHOD_CONTRACT;\n    DoOneProfilerIteration(&mainProfilerInfo,\n                          ProfilerCallbackType::Active,\n                          &ReJITCompilationStartedHelper,\n                          functionId, reJitId, fIsSafeToBlock);\n}\n\ninline void GetReJITParametersHelper(ProfilerInfo *pProfilerInfo, ModuleID moduleId, mdMethodDef methodId, ICorProfilerFunctionControl *pFunctionControl, HRESULT *pHr)\n{\n    if (IsRejitEnabled(pProfilerInfo))\n    {\n        *pHr = pProfilerInfo->pProfInterface->GetReJITParameters(moduleId, methodId, pFunctionControl);\n    }\n}\n\ninline HRESULT ProfControlBlock::GetReJITParameters(ModuleID moduleId, mdMethodDef methodId, ICorProfilerFunctionControl *pFunctionControl)\n{\n    LIMITED_METHOD_CONTRACT;\n    HRESULT hr = S_OK;\n    DoOneProfilerIteration(&mainProfilerInfo,\n                          ProfilerCallbackType::Active,\n                          &GetReJITParametersHelper,\n                          moduleId, methodId, pFunctionControl, &hr);\n    return hr;\n}\n\ninline void ReJITCompilationFinishedHelper(ProfilerInfo *pProfilerInfo, FunctionID functionId, ReJITID reJitId, HRESULT hrStatus, BOOL fIsSafeToBlock)\n{\n    if (IsRejitEnabled(pProfilerInfo))\n    {\n        pProfilerInfo->pProfInterface->ReJITCompilationFinished(functionId, reJitId, hrStatus, fIsSafeToBlock);\n    }\n}\n\ninline void ProfControlBlock::ReJITCompilationFinished(FunctionID functionId, ReJITID reJitId, HRESULT hrStatus, BOOL fIsSafeToBlock)\n{\n    LIMITED_METHOD_CONTRACT;\n    DoOneProfilerIteration(&mainProfilerInfo,\n                          ProfilerCallbackType::Active,\n                          &ReJITCompilationFinishedHelper,\n                          functionId, reJitId, hrStatus, fIsSafeToBlock);\n}\n\ninline void ReJITErrorHelper(ProfilerInfo *pProfilerInfo, ModuleID moduleId, mdMethodDef methodId, FunctionID functionId, HRESULT hrStatus)\n{\n    if (IsRejitEnabled(pProfilerInfo))\n    {\n        pProfilerInfo->pProfInterface->ReJITError(moduleId, methodId, functionId, hrStatus);\n    }\n}\n\ninline void ProfControlBlock::ReJITError(ModuleID moduleId, mdMethodDef methodId, FunctionID functionId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n    DoOneProfilerIteration(&mainProfilerInfo,\n                          ProfilerCallbackType::Active,\n                          &ReJITErrorHelper,\n                          moduleId, methodId, functionId, hrStatus);\n}\n\ninline BOOL IsProfilerTrackingModuleLoads(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_MODULE_LOADS);\n}\n\ninline HRESULT ModuleLoadStartedHelper(EEToProfInterfaceImpl *profInterface, ModuleID moduleId)\n{\n    return profInterface->ModuleLoadStarted(moduleId);\n}\n\ninline void ProfControlBlock::ModuleLoadStarted(ModuleID moduleId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingModuleLoads,\n                       &ModuleLoadStartedHelper,\n                       moduleId);\n}\n\ninline HRESULT ModuleLoadFinishedHelper(EEToProfInterfaceImpl *profInterface, ModuleID moduleId, HRESULT hrStatus)\n{\n    return profInterface->ModuleLoadFinished(moduleId, hrStatus);\n}\n\ninline void ProfControlBlock::ModuleLoadFinished(ModuleID moduleId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingModuleLoads,\n                       &ModuleLoadFinishedHelper,\n                       moduleId, hrStatus);\n}\n\ninline HRESULT ModuleUnloadStartedHelper(EEToProfInterfaceImpl *profInterface, ModuleID moduleId)\n{\n    return profInterface->ModuleUnloadStarted(moduleId);\n}\n\ninline void ProfControlBlock::ModuleUnloadStarted(ModuleID moduleId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingModuleLoads,\n                       &ModuleUnloadStartedHelper,\n                       moduleId);\n}\n\ninline HRESULT ModuleUnloadFinishedHelper(EEToProfInterfaceImpl *profInterface, ModuleID moduleId, HRESULT hrStatus)\n{\n    return profInterface->ModuleUnloadFinished(moduleId, hrStatus);\n}\n\ninline void ProfControlBlock::ModuleUnloadFinished(ModuleID moduleId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingModuleLoads,\n                       &ModuleUnloadFinishedHelper,\n                       moduleId, hrStatus);\n}\n\ninline HRESULT ModuleAttachedToAssemblyHelper(EEToProfInterfaceImpl *profInterface, ModuleID moduleId, AssemblyID AssemblyId)\n{\n    return profInterface->ModuleAttachedToAssembly(moduleId, AssemblyId);\n}\n\ninline void ProfControlBlock::ModuleAttachedToAssembly(ModuleID moduleId, AssemblyID AssemblyId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingModuleLoads,\n                       &ModuleAttachedToAssemblyHelper,\n                       moduleId, AssemblyId);\n}\n\ninline BOOL IsProfilerTrackingInMemorySymbolsUpdatesEnabled(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskHighSet(COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED);\n}\n\ninline HRESULT ModuleInMemorySymbolsUpdatedHelper(EEToProfInterfaceImpl *profInterface, ModuleID moduleId)\n{\n    return profInterface->ModuleInMemorySymbolsUpdated(moduleId);\n}\n\ninline void ProfControlBlock::ModuleInMemorySymbolsUpdated(ModuleID moduleId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingInMemorySymbolsUpdatesEnabled,\n                       &ModuleInMemorySymbolsUpdatedHelper,\n                       moduleId);\n}\n\ninline BOOL IsProfilerTrackingClasses(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_CLASS_LOADS);\n}\n\ninline HRESULT ClassLoadStartedHelper(EEToProfInterfaceImpl *profInterface, ClassID classId)\n{\n    return profInterface->ClassLoadStarted(classId);\n}\n\ninline void ProfControlBlock::ClassLoadStarted(ClassID classId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingClasses,\n                       &ClassLoadStartedHelper,\n                       classId);\n}\n\ninline HRESULT ClassLoadFinishedHelper(EEToProfInterfaceImpl *profInterface, ClassID classId, HRESULT hrStatus)\n{\n    return profInterface->ClassLoadFinished(classId, hrStatus);\n}\n\ninline void ProfControlBlock::ClassLoadFinished(ClassID classId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingClasses,\n                       &ClassLoadFinishedHelper,\n                       classId, hrStatus);\n}\n\ninline HRESULT ClassUnloadStartedHelper(EEToProfInterfaceImpl *profInterface, ClassID classId)\n{\n    return profInterface->ClassUnloadStarted(classId);\n}\n\ninline void ProfControlBlock::ClassUnloadStarted(ClassID classId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingClasses,\n                       &ClassUnloadStartedHelper,\n                       classId);\n}\n\ninline HRESULT ClassUnloadFinishedHelper(EEToProfInterfaceImpl *profInterface, ClassID classId, HRESULT hrStatus)\n{\n    return profInterface->ClassUnloadFinished(classId, hrStatus);\n}\n\ninline void ProfControlBlock::ClassUnloadFinished(ClassID classId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingClasses,\n                       &ClassUnloadFinishedHelper,\n                       classId, hrStatus);\n}\n\ninline BOOL IsProfilerTrackingAppDomainLoads(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_APPDOMAIN_LOADS);\n}\n\ninline HRESULT AppDomainCreationStartedHelper(EEToProfInterfaceImpl *profInterface, AppDomainID appDomainId)\n{\n    return profInterface->AppDomainCreationStarted(appDomainId);\n}\n\ninline void ProfControlBlock::AppDomainCreationStarted(AppDomainID appDomainId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAppDomainLoads,\n                       &AppDomainCreationStartedHelper,\n                       appDomainId);\n}\n\ninline HRESULT AppDomainCreationFinishedHelper(EEToProfInterfaceImpl *profInterface, AppDomainID appDomainId, HRESULT hrStatus)\n{\n    return profInterface->AppDomainCreationFinished(appDomainId, hrStatus);\n}\n\ninline void ProfControlBlock::AppDomainCreationFinished(AppDomainID appDomainId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAppDomainLoads,\n                       &AppDomainCreationFinishedHelper,\n                       appDomainId, hrStatus);\n}\n\ninline HRESULT AppDomainShutdownStartedHelper(EEToProfInterfaceImpl *profInterface, AppDomainID appDomainId)\n{\n    return profInterface->AppDomainShutdownStarted(appDomainId);\n}\n\ninline void ProfControlBlock::AppDomainShutdownStarted(AppDomainID appDomainId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAppDomainLoads,\n                       &AppDomainShutdownStartedHelper,\n                       appDomainId);\n}\n\ninline HRESULT AppDomainShutdownFinishedHelper(EEToProfInterfaceImpl *profInterface, AppDomainID appDomainId, HRESULT hrStatus)\n{\n    return profInterface->AppDomainShutdownFinished(appDomainId, hrStatus);\n}\n\ninline void ProfControlBlock::AppDomainShutdownFinished(AppDomainID appDomainId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAppDomainLoads,\n                       &AppDomainShutdownFinishedHelper,\n                       appDomainId, hrStatus);\n}\n\ninline BOOL IsProfilerTrackingAssemblyLoads(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_ASSEMBLY_LOADS);\n}\n\ninline HRESULT AssemblyLoadStartedHelper(EEToProfInterfaceImpl *profInterface, AssemblyID assemblyId)\n{\n    return profInterface->AssemblyLoadStarted(assemblyId);\n}\n\ninline void ProfControlBlock::AssemblyLoadStarted(AssemblyID assemblyId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAssemblyLoads,\n                       &AssemblyLoadStartedHelper,\n                       assemblyId);\n}\n\ninline HRESULT AssemblyLoadFinishedHelper(EEToProfInterfaceImpl *profInterface, AssemblyID assemblyId, HRESULT hrStatus)\n{\n    return profInterface->AssemblyLoadFinished(assemblyId, hrStatus);\n}\n\ninline void ProfControlBlock::AssemblyLoadFinished(AssemblyID assemblyId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAssemblyLoads,\n                       &AssemblyLoadFinishedHelper,\n                       assemblyId, hrStatus);\n}\n\ninline HRESULT AssemblyUnloadStartedHelper(EEToProfInterfaceImpl *profInterface, AssemblyID assemblyId)\n{\n    return profInterface->AssemblyUnloadStarted(assemblyId);\n}\n\ninline void ProfControlBlock::AssemblyUnloadStarted(AssemblyID assemblyId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAssemblyLoads,\n                       &AssemblyUnloadStartedHelper,\n                       assemblyId);\n}\n\ninline HRESULT AssemblyUnloadFinishedHelper(EEToProfInterfaceImpl *profInterface, AssemblyID assemblyId, HRESULT hrStatus)\n{\n    return profInterface->AssemblyUnloadFinished(assemblyId, hrStatus);\n}\n\ninline void ProfControlBlock::AssemblyUnloadFinished(AssemblyID assemblyId, HRESULT hrStatus)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAssemblyLoads,\n                       &AssemblyUnloadFinishedHelper,\n                       assemblyId, hrStatus);\n}\n\ninline BOOL IsProfilerTrackingTransitions(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_CODE_TRANSITIONS);\n}\n\ninline HRESULT UnmanagedToManagedTransitionHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, COR_PRF_TRANSITION_REASON reason)\n{\n    return profInterface->UnmanagedToManagedTransition(functionId, reason);\n}\n\ninline void ProfControlBlock::UnmanagedToManagedTransition(FunctionID functionId, COR_PRF_TRANSITION_REASON reason)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingTransitions,\n                       &UnmanagedToManagedTransitionHelper,\n                       functionId, reason);\n}\n\ninline HRESULT ManagedToUnmanagedTransitionHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, COR_PRF_TRANSITION_REASON reason)\n{\n    return profInterface->ManagedToUnmanagedTransition(functionId, reason);\n}\n\ninline void ProfControlBlock::ManagedToUnmanagedTransition(FunctionID functionId, COR_PRF_TRANSITION_REASON reason)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingTransitions,\n                       &ManagedToUnmanagedTransitionHelper,\n                       functionId, reason);\n}\n\ninline BOOL IsProfilerTrackingExceptions(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_EXCEPTIONS);\n}\n\ninline HRESULT ExceptionThrownHelper(EEToProfInterfaceImpl *profInterface, ObjectID thrownObjectId)\n{\n    return profInterface->ExceptionThrown(thrownObjectId);\n}\n\ninline void ProfControlBlock::ExceptionThrown(ObjectID thrownObjectId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionThrownHelper,\n                       thrownObjectId);\n}\n\ninline HRESULT ExceptionSearchFunctionEnterHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId)\n{\n    return profInterface->ExceptionSearchFunctionEnter(functionId);\n}\n\ninline void ProfControlBlock::ExceptionSearchFunctionEnter(FunctionID functionId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionSearchFunctionEnterHelper,\n                       functionId);\n}\n\ninline HRESULT ExceptionSearchFunctionLeaveHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->ExceptionSearchFunctionLeave();\n}\n\ninline void ProfControlBlock::ExceptionSearchFunctionLeave()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionSearchFunctionLeaveHelper);\n}\n\ninline HRESULT ExceptionSearchFilterEnterHelper(EEToProfInterfaceImpl *profInterface, FunctionID funcId)\n{\n    return profInterface->ExceptionSearchFilterEnter(funcId);\n}\n\ninline void ProfControlBlock::ExceptionSearchFilterEnter(FunctionID funcId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionSearchFilterEnterHelper,\n                       funcId);\n}\n\ninline HRESULT ExceptionSearchFilterLeaveHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->ExceptionSearchFilterLeave();\n}\n\ninline void ProfControlBlock::ExceptionSearchFilterLeave()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionSearchFilterLeaveHelper);\n}\n\ninline HRESULT ExceptionSearchCatcherFoundHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId)\n{\n    return profInterface->ExceptionSearchCatcherFound(functionId);\n}\n\ninline void ProfControlBlock::ExceptionSearchCatcherFound(FunctionID functionId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionSearchCatcherFoundHelper,\n                       functionId);\n}\n\ninline HRESULT ExceptionOSHandlerEnterHelper(EEToProfInterfaceImpl *profInterface, FunctionID funcId)\n{\n    return profInterface->ExceptionOSHandlerEnter(funcId);\n}\n\ninline void ProfControlBlock::ExceptionOSHandlerEnter(FunctionID funcId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionOSHandlerEnterHelper,\n                       funcId);\n}\n\ninline HRESULT ExceptionOSHandlerLeaveHelper(EEToProfInterfaceImpl *profInterface, FunctionID funcId)\n{\n    return profInterface->ExceptionOSHandlerLeave(funcId);\n}\n\ninline void ProfControlBlock::ExceptionOSHandlerLeave(FunctionID funcId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionOSHandlerLeaveHelper,\n                       funcId);\n}\n\ninline HRESULT ExceptionUnwindFunctionEnterHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId)\n{\n    return profInterface->ExceptionUnwindFunctionEnter(functionId);\n}\n\ninline void ProfControlBlock::ExceptionUnwindFunctionEnter(FunctionID functionId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionUnwindFunctionEnterHelper,\n                       functionId);\n}\n\ninline HRESULT ExceptionUnwindFunctionLeaveHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->ExceptionUnwindFunctionLeave();\n}\n\ninline void ProfControlBlock::ExceptionUnwindFunctionLeave()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionUnwindFunctionLeaveHelper);\n}\n\ninline HRESULT ExceptionUnwindFinallyEnterHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId)\n{\n    return profInterface->ExceptionUnwindFinallyEnter(functionId);\n}\n\ninline void ProfControlBlock::ExceptionUnwindFinallyEnter(FunctionID functionId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionUnwindFinallyEnterHelper,\n                       functionId);\n}\n\ninline HRESULT ExceptionUnwindFinallyLeaveHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->ExceptionUnwindFinallyLeave();\n}\n\ninline void ProfControlBlock::ExceptionUnwindFinallyLeave()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionUnwindFinallyLeaveHelper);\n}\n\ninline HRESULT ExceptionCatcherEnterHelper(EEToProfInterfaceImpl *profInterface, FunctionID functionId, ObjectID objectId)\n{\n    return profInterface->ExceptionCatcherEnter(functionId, objectId);\n}\n\ninline void ProfControlBlock::ExceptionCatcherEnter(FunctionID functionId, ObjectID objectId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionCatcherEnterHelper,\n                       functionId, objectId);\n}\n\ninline HRESULT ExceptionCatcherLeaveHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->ExceptionCatcherLeave();\n}\n\ninline void ProfControlBlock::ExceptionCatcherLeave()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingExceptions,\n                       &ExceptionCatcherLeaveHelper);\n}\n\ninline BOOL IsProfilerTrackingCCW(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_CCW);\n}\n\ninline HRESULT COMClassicVTableCreatedHelper(EEToProfInterfaceImpl *profInterface, ClassID wrappedClassId, REFGUID implementedIID, void *pVTable, ULONG cSlots)\n{\n    return profInterface->COMClassicVTableCreated(wrappedClassId, implementedIID, pVTable, cSlots);\n}\n\ninline void ProfControlBlock::COMClassicVTableCreated(ClassID wrappedClassId, REFGUID implementedIID, void *pVTable, ULONG cSlots)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingCCW,\n                       &COMClassicVTableCreatedHelper,\n                       wrappedClassId, implementedIID, pVTable, cSlots);\n}\n\ninline BOOL IsProfilerTrackingSuspends(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_SUSPENDS);\n}\n\ninline HRESULT RuntimeSuspendStartedHelper(EEToProfInterfaceImpl *profInterface, COR_PRF_SUSPEND_REASON suspendReason)\n{\n    return profInterface->RuntimeSuspendStarted(suspendReason);\n}\n\ninline void ProfControlBlock::RuntimeSuspendStarted(COR_PRF_SUSPEND_REASON suspendReason)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingSuspends,\n                       &RuntimeSuspendStartedHelper,\n                       suspendReason);\n}\n\ninline HRESULT RuntimeSuspendFinishedHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->RuntimeSuspendFinished();\n}\n\ninline void ProfControlBlock::RuntimeSuspendFinished()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingSuspends,\n                       &RuntimeSuspendFinishedHelper);\n}\n\ninline HRESULT RuntimeSuspendAbortedHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->RuntimeSuspendAborted();\n}\n\ninline void ProfControlBlock::RuntimeSuspendAborted()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingSuspends,\n                       &RuntimeSuspendAbortedHelper);\n}\n\ninline HRESULT RuntimeResumeStartedHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->RuntimeResumeStarted();\n}\n\ninline void ProfControlBlock::RuntimeResumeStarted()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingSuspends,\n                       &RuntimeResumeStartedHelper);\n}\n\ninline HRESULT RuntimeResumeFinishedHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->RuntimeResumeFinished();\n}\n\ninline void ProfControlBlock::RuntimeResumeFinished()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingSuspends,\n                       &RuntimeResumeFinishedHelper);\n}\n\ninline HRESULT RuntimeThreadSuspendedHelper(EEToProfInterfaceImpl *profInterface, ThreadID suspendedThreadId)\n{\n    return profInterface->RuntimeThreadSuspended(suspendedThreadId);\n}\n\ninline void ProfControlBlock::RuntimeThreadSuspended(ThreadID suspendedThreadId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingSuspends,\n                       &RuntimeThreadSuspendedHelper,\n                       suspendedThreadId);\n}\n\ninline HRESULT RuntimeThreadResumedHelper(EEToProfInterfaceImpl *profInterface, ThreadID resumedThreadId)\n{\n    return profInterface->RuntimeThreadResumed(resumedThreadId);\n}\n\ninline void ProfControlBlock::RuntimeThreadResumed(ThreadID resumedThreadId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingSuspends,\n                       &RuntimeThreadResumedHelper,\n                       resumedThreadId);\n}\n\ninline BOOL IsProfilerTrackingAllocations(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return (pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_ENABLE_OBJECT_ALLOCATED)\n                || pProfilerInfo->eventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED));\n}\n\ninline HRESULT ObjectAllocatedHelper(EEToProfInterfaceImpl *profInterface, ObjectID objectId, ClassID classId)\n{\n    return profInterface->ObjectAllocated(objectId, classId);\n}\n\ninline void ProfControlBlock::ObjectAllocated(ObjectID objectId, ClassID classId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingAllocations,\n                       &ObjectAllocatedHelper,\n                       objectId, classId);\n}\n\n\ninline BOOL IsProfilerTrackingGC(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskSet(COR_PRF_MONITOR_GC);\n}\n\ninline HRESULT FinalizeableObjectQueuedHelper(EEToProfInterfaceImpl *profInterface, BOOL isCritical, ObjectID objectID)\n{\n    return profInterface->FinalizeableObjectQueued(isCritical, objectID);\n}\n\ninline void ProfControlBlock::FinalizeableObjectQueued(BOOL isCritical, ObjectID objectID)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &FinalizeableObjectQueuedHelper,\n                       isCritical, objectID);\n}\n\ninline HRESULT MovedReferenceHelper(EEToProfInterfaceImpl *profInterface, BYTE *pbMemBlockStart, BYTE *pbMemBlockEnd, ptrdiff_t cbRelocDistance, void *pHeapId, BOOL fCompacting)\n{\n    return profInterface->MovedReference(pbMemBlockStart, pbMemBlockEnd, cbRelocDistance, pHeapId, fCompacting);\n}\n\ninline void ProfControlBlock::MovedReference(BYTE *pbMemBlockStart, BYTE *pbMemBlockEnd, ptrdiff_t cbRelocDistance, void *pHeapId, BOOL fCompacting)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &MovedReferenceHelper,\n                       pbMemBlockStart, pbMemBlockEnd, cbRelocDistance, pHeapId, fCompacting);\n}\n\ninline HRESULT EndMovedReferencesHelper(EEToProfInterfaceImpl *profInterface, void *pHeapId)\n{\n    return profInterface->EndMovedReferences(pHeapId);\n}\n\ninline void ProfControlBlock::EndMovedReferences(void *pHeapId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &EndMovedReferencesHelper,\n                       pHeapId);\n}\n\ninline HRESULT RootReference2Helper(EEToProfInterfaceImpl *profInterface, BYTE *objectId, EtwGCRootKind dwEtwRootKind, EtwGCRootFlags dwEtwRootFlags, void *rootID, void *pHeapId)\n{\n    return profInterface->RootReference2(objectId, dwEtwRootKind, dwEtwRootFlags, rootID, pHeapId);\n}\n\ninline void ProfControlBlock::RootReference2(BYTE *objectId, EtwGCRootKind dwEtwRootKind, EtwGCRootFlags dwEtwRootFlags, void *rootID, void *pHeapId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &RootReference2Helper,\n                       objectId, dwEtwRootKind, dwEtwRootFlags, rootID, pHeapId);\n}\n\ninline HRESULT EndRootReferences2Helper(EEToProfInterfaceImpl *profInterface, void *pHeapId)\n{\n    return profInterface->EndRootReferences2(pHeapId);\n}\n\ninline void ProfControlBlock::EndRootReferences2(void *pHeapId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &EndRootReferences2Helper,\n                       pHeapId);\n}\n\ninline HRESULT ConditionalWeakTableElementReferenceHelper(EEToProfInterfaceImpl *profInterface, BYTE *primaryObjectId, BYTE *secondaryObjectId, void *rootID, void *pHeapId)\n{\n    if (!profInterface->IsCallback5Supported())\n    {\n        return S_OK;\n    }\n\n    return profInterface->ConditionalWeakTableElementReference(primaryObjectId, secondaryObjectId, rootID, pHeapId);\n}\n\ninline void ProfControlBlock::ConditionalWeakTableElementReference(BYTE *primaryObjectId, BYTE *secondaryObjectId, void *rootID, void *pHeapId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &ConditionalWeakTableElementReferenceHelper,\n                       primaryObjectId, secondaryObjectId, rootID, pHeapId);\n}\n\ninline HRESULT EndConditionalWeakTableElementReferencesHelper(EEToProfInterfaceImpl *profInterface, void *pHeapId)\n{\n    if (!profInterface->IsCallback5Supported())\n    {\n        return S_OK;\n    }\n\n    return profInterface->EndConditionalWeakTableElementReferences(pHeapId);\n}\n\ninline void ProfControlBlock::EndConditionalWeakTableElementReferences(void *pHeapId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &EndConditionalWeakTableElementReferencesHelper,\n                       pHeapId);\n}\n\ninline HRESULT AllocByClassHelper(EEToProfInterfaceImpl *profInterface, ObjectID objId, ClassID classId, void *pHeapId)\n{\n    return profInterface->AllocByClass(objId, classId, pHeapId);\n}\n\ninline void ProfControlBlock::AllocByClass(ObjectID objId, ClassID classId, void *pHeapId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &AllocByClassHelper,\n                       objId, classId, pHeapId);\n}\n\ninline HRESULT EndAllocByClassHelper(EEToProfInterfaceImpl *profInterface, void *pHeapId)\n{\n    return profInterface->EndAllocByClass(pHeapId);\n}\n\ninline void ProfControlBlock::EndAllocByClass(void *pHeapId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &EndAllocByClassHelper,\n                       pHeapId);\n}\n\ninline HRESULT ObjectReferenceHelper(EEToProfInterfaceImpl *profInterface, ObjectID objId, ClassID classId, ULONG cNumRefs, ObjectID *arrObjRef)\n{\n    return profInterface->ObjectReference(objId, classId, cNumRefs, arrObjRef);\n}\n\ninline HRESULT ProfControlBlock::ObjectReference(ObjectID objId, ClassID classId, ULONG cNumRefs, ObjectID *arrObjRef)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return DoProfilerCallback(ProfilerCallbackType::Active,\n                              IsProfilerTrackingGC,\n                              &ObjectReferenceHelper,\n                              objId, classId, cNumRefs, arrObjRef);\n}\n\ninline HRESULT HandleCreatedHelper(EEToProfInterfaceImpl *profInterface, UINT_PTR handleId, ObjectID initialObjectId)\n{\n    return profInterface->HandleCreated(handleId, initialObjectId);\n}\n\ninline void ProfControlBlock::HandleCreated(UINT_PTR handleId, ObjectID initialObjectId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &HandleCreatedHelper,\n                       handleId, initialObjectId);\n}\n\ninline HRESULT HandleDestroyedHelper(EEToProfInterfaceImpl *profInterface, UINT_PTR handleId)\n{\n    return profInterface->HandleDestroyed(handleId);\n}\n\ninline void ProfControlBlock::HandleDestroyed(UINT_PTR handleId)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGC,\n                       &HandleDestroyedHelper,\n                       handleId);\n}\n\n\ninline BOOL IsProfilerTrackingBasicGC(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskHighSet(COR_PRF_HIGH_BASIC_GC);\n}\n\ninline BOOL IsProfilerTrackingMovedObjects(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS);\n}\n\ninline BOOL IsProfilerTrackingGCOrBasicGC(ProfilerInfo *pProfilerInfo)\n{\n    return IsProfilerTrackingGC(pProfilerInfo) || IsProfilerTrackingBasicGC(pProfilerInfo);\n}\n\ninline BOOL IsProfilerTrackingGCOrMovedObjects(ProfilerInfo *pProfilerInfo)\n{\n    return IsProfilerTrackingGC(pProfilerInfo) || IsProfilerTrackingMovedObjects(pProfilerInfo);\n}\n\ninline HRESULT GarbageCollectionStartedHelper(EEToProfInterfaceImpl *profInterface, int cGenerations, BOOL generationCollected[], COR_PRF_GC_REASON reason)\n{\n    return profInterface->GarbageCollectionStarted(cGenerations, generationCollected, reason);\n}\n\ninline void ProfControlBlock::GarbageCollectionStarted(int cGenerations, BOOL generationCollected[], COR_PRF_GC_REASON reason)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGCOrBasicGC,\n                       &GarbageCollectionStartedHelper,\n                       cGenerations, generationCollected, reason);\n}\n\ninline HRESULT GarbageCollectionFinishedHelper(EEToProfInterfaceImpl *profInterface)\n{\n    return profInterface->GarbageCollectionFinished();\n}\n\ninline void ProfControlBlock::GarbageCollectionFinished()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerTrackingGCOrBasicGC,\n                       &GarbageCollectionFinishedHelper);\n}\n\n\ninline BOOL IsProfilerMonitoringEventPipe(ProfilerInfo *pProfilerInfo)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n    }\n    CONTRACTL_END;\n\n    return pProfilerInfo->eventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_EVENT_PIPE);\n}\n\ninline HRESULT EventPipeEventDeliveredHelper(EEToProfInterfaceImpl *profInterface,\n                                             EventPipeProvider *provider,\n                                             DWORD eventId,\n                                             DWORD eventVersion,\n                                             ULONG cbMetadataBlob,\n                                             LPCBYTE metadataBlob,\n                                             ULONG cbEventData,\n                                             LPCBYTE eventData,\n                                             LPCGUID pActivityId,\n                                             LPCGUID pRelatedActivityId,\n                                             Thread *pEventThread,\n                                             ULONG numStackFrames,\n                                             UINT_PTR stackFrames[])\n{\n    return profInterface->EventPipeEventDelivered(provider,\n                                           eventId,\n                                           eventVersion,\n                                           cbMetadataBlob,\n                                           metadataBlob,\n                                           cbEventData,\n                                           eventData,\n                                           pActivityId,\n                                           pRelatedActivityId,\n                                           pEventThread,\n                                           numStackFrames,\n                                           stackFrames);\n}\n\ninline void ProfControlBlock::EventPipeEventDelivered(EventPipeProvider *provider,\n                                                      DWORD eventId,\n                                                      DWORD eventVersion,\n                                                      ULONG cbMetadataBlob,\n                                                      LPCBYTE metadataBlob,\n                                                      ULONG cbEventData,\n                                                      LPCBYTE eventData,\n                                                      LPCGUID pActivityId,\n                                                      LPCGUID pRelatedActivityId,\n                                                      Thread *pEventThread,\n                                                      ULONG numStackFrames,\n                                                      UINT_PTR stackFrames[])\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerMonitoringEventPipe,\n                       &EventPipeEventDeliveredHelper,\n                        provider,\n                        eventId,\n                        eventVersion,\n                        cbMetadataBlob,\n                        metadataBlob,\n                        cbEventData,\n                        eventData,\n                        pActivityId,\n                        pRelatedActivityId,\n                        pEventThread,\n                        numStackFrames,\n                        stackFrames);\n}\n\ninline HRESULT EventPipeProviderCreatedHelper(EEToProfInterfaceImpl *profInterface, EventPipeProvider *provider)\n{\n    return profInterface->EventPipeProviderCreated(provider);\n}\n\ninline void ProfControlBlock::EventPipeProviderCreated(EventPipeProvider *provider)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    DoProfilerCallback(ProfilerCallbackType::Active,\n                       IsProfilerMonitoringEventPipe,\n                       &EventPipeProviderCreatedHelper,\n                       provider);\n}\n\n//---------------------------------------------------------------------------------------\n// Inlined helpers used throughout the runtime to check for the profiler's load status\n// and what features it enabled callbacks for.\n//---------------------------------------------------------------------------------------\n\nFORCEINLINE BOOL CORProfilerPresent()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->mainProfilerInfo.pProfInterface.Load() != NULL \n            || (&g_profControlBlock)->notificationProfilerCount.Load() > 0;\n}\n\nFORCEINLINE BOOL CORMainProfilerPresent()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->mainProfilerInfo.curProfStatus.Get() >= kProfStatusActive;\n}\n\n// These return whether a CLR Profiler is actively loaded AND has requested the\n// specified callback or functionality\n\nFORCEINLINE BOOL CORProfilerFunctionIDMapperEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (CORMainProfilerPresent() &&\n        (\n         ((&g_profControlBlock)->mainProfilerInfo.pProfInterface->GetFunctionIDMapper()  != NULL) ||\n         ((&g_profControlBlock)->mainProfilerInfo.pProfInterface->GetFunctionIDMapper2() != NULL)\n        ));\n}\n\nFORCEINLINE BOOL CORProfilerTrackJITInfo()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_JIT_COMPILATION);\n}\n\nFORCEINLINE BOOL CORProfilerTrackCacheSearches()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_CACHE_SEARCHES);\n}\n\nFORCEINLINE BOOL CORProfilerTrackModuleLoads()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_MODULE_LOADS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackAssemblyLoads()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_ASSEMBLY_LOADS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackAppDomainLoads()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_APPDOMAIN_LOADS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackThreads()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_THREADS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackClasses()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_CLASS_LOADS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackGC()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_GC);\n}\n\nFORCEINLINE BOOL CORProfilerTrackAllocationsEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return\n        (\n#ifdef PROF_TEST_ONLY_FORCE_OBJECT_ALLOCATED\n            (&g_profControlBlock)->fTestOnlyForceObjectAllocated ||\n#endif\n            (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_ENABLE_OBJECT_ALLOCATED)\n        );\n}\n\nFORCEINLINE BOOL CORProfilerTrackAllocations()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_OBJECT_ALLOCATED);\n}\n\nFORCEINLINE BOOL CORProfilerTrackLargeAllocations()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED);\n}\n\nFORCEINLINE BOOL CORProfilerTrackPinnedAllocations()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_PINNEDOBJECT_ALLOCATED);\n}\n\nFORCEINLINE BOOL CORProfilerEnableRejit()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_ENABLE_REJIT);\n}\n\nFORCEINLINE BOOL CORProfilerTrackExceptions()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_EXCEPTIONS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackTransitions()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_CODE_TRANSITIONS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackEnterLeave()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n#ifdef PROF_TEST_ONLY_FORCE_ELT\n    if ((&g_profControlBlock)->fTestOnlyForceEnterLeave)\n        return TRUE;\n#endif // PROF_TEST_ONLY_FORCE_ELT\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_ENTERLEAVE);\n}\n\nFORCEINLINE BOOL CORProfilerTrackCCW()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_CCW);\n}\n\nFORCEINLINE BOOL CORProfilerTrackSuspends()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_MONITOR_SUSPENDS);\n}\n\nFORCEINLINE BOOL CORProfilerDisableInlining()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_DISABLE_INLINING);\n}\n\nFORCEINLINE BOOL CORProfilerDisableOptimizations()\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_DISABLE_OPTIMIZATIONS);\n}\n\nFORCEINLINE BOOL CORProfilerUseProfileImages()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n#ifdef PROF_TEST_ONLY_FORCE_ELT\n    if ((&g_profControlBlock)->fTestOnlyForceEnterLeave)\n        return TRUE;\n#endif // PROF_TEST_ONLY_FORCE_ELT\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_REQUIRE_PROFILE_IMAGE);\n}\n\nFORCEINLINE BOOL CORProfilerDisableAllNGenImages()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_DISABLE_ALL_NGEN_IMAGES);\n}\n\nFORCEINLINE BOOL CORProfilerTrackConditionalWeakTableElements()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return CORProfilerTrackGC() && (&g_profControlBlock)->IsCallback5Supported();\n}\n\n// These return whether a CLR Profiler has requested the specified functionality.\n//\n// Note that, unlike the above functions, a profiler that's not done loading (and is\n// still somewhere in the initialization phase) still counts. This is only safe because\n// these functions are not used to determine whether to issue a callback. These functions\n// are used primarily during the initialization path to choose between slow / fast-path\n// ELT hooks (and later on as part of asserts).\n\nFORCEINLINE BOOL CORProfilerELT3SlowPathEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet((COR_PRF_ENABLE_FUNCTION_ARGS | COR_PRF_ENABLE_FUNCTION_RETVAL | COR_PRF_ENABLE_FRAME_INFO));\n}\n\nFORCEINLINE BOOL CORProfilerELT3SlowPathEnterEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet((COR_PRF_ENABLE_FUNCTION_ARGS | COR_PRF_ENABLE_FRAME_INFO));\n}\n\nFORCEINLINE BOOL CORProfilerELT3SlowPathLeaveEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet((COR_PRF_ENABLE_FUNCTION_RETVAL | COR_PRF_ENABLE_FRAME_INFO));\n}\n\nFORCEINLINE BOOL CORProfilerELT3SlowPathTailcallEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet((COR_PRF_ENABLE_FRAME_INFO));\n}\n\nFORCEINLINE BOOL CORProfilerELT2FastPathEnterEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return !((&g_profControlBlock)->globalEventMask.IsEventMaskSet((COR_PRF_ENABLE_STACK_SNAPSHOT | COR_PRF_ENABLE_FUNCTION_ARGS | COR_PRF_ENABLE_FRAME_INFO)));\n}\n\nFORCEINLINE BOOL CORProfilerELT2FastPathLeaveEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return !((&g_profControlBlock)->globalEventMask.IsEventMaskSet((COR_PRF_ENABLE_STACK_SNAPSHOT | COR_PRF_ENABLE_FUNCTION_RETVAL | COR_PRF_ENABLE_FRAME_INFO)));\n}\n\nFORCEINLINE BOOL CORProfilerELT2FastPathTailcallEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return !((&g_profControlBlock)->globalEventMask.IsEventMaskSet((COR_PRF_ENABLE_STACK_SNAPSHOT | COR_PRF_ENABLE_FRAME_INFO)));\n}\n\nFORCEINLINE BOOL CORProfilerFunctionArgsEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_ENABLE_FUNCTION_ARGS);\n}\n\nFORCEINLINE BOOL CORProfilerFunctionReturnValueEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_ENABLE_FUNCTION_RETVAL);\n}\n\nFORCEINLINE BOOL CORProfilerFrameInfoEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_ENABLE_FRAME_INFO);\n}\n\nFORCEINLINE BOOL CORProfilerStackSnapshotEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskSet(COR_PRF_ENABLE_STACK_SNAPSHOT);\n}\n\nFORCEINLINE BOOL CORProfilerInMemorySymbolsUpdatesEnabled()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED);\n}\n\nFORCEINLINE BOOL CORProfilerTrackDynamicFunctionUnloads()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS);\n}\n\nFORCEINLINE BOOL CORProfilerDisableTieredCompilation()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_DISABLE_TIERED_COMPILATION);\n}\n\nFORCEINLINE BOOL CORProfilerTrackBasicGC()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_BASIC_GC);\n}\n\nFORCEINLINE BOOL CORProfilerTrackGCMovedObjects()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS);\n}\n\nFORCEINLINE BOOL CORProfilerTrackEventPipe()\n{\n    STATIC_CONTRACT_LIMITED_METHOD;\n\n    return (&g_profControlBlock)->globalEventMask.IsEventMaskHighSet(COR_PRF_HIGH_MONITOR_EVENT_PIPE);\n}\n\n#if defined(PROFILING_SUPPORTED)\n\n//---------------------------------------------------------------------------------------\n// These macros must be placed around any callbacks to g_profControlBlock by\n// the EE. Example:\n//    {\n//        BEGIN_PROFILER_CALLBACK(CORProfilerTrackAppDomainLoads;\n//        g_profControlBlock.AppDomainCreationStarted(MyAppDomainID);\n//        END_PROFILER_CALLBACK();\n//    }\n// The parameter to the BEGIN_PROFILER_CALLBACK is the condition you want to check for, to\n// determine whether the profiler is loaded and requesting the callback you're about to\n// issue. Typically, this will be a call to one of the inline functions in\n// profilepriv.inl. If the condition is true, the macro will increment an evacuation\n// counter that effectively pins the profiler, recheck the condition, and (if still\n// true), execute whatever code you place inside the BEGIN/END_PROFILER_CALLBACK block. If\n// your condition is more complex than a simple profiler status check, then place the\n// profiler status check as parameter to the macro, and add a separate if inside the\n// block. Example:\n//\n//    {\n//        BEGIN_PROFILER_CALLBACK(CorProfilerTrackTransitions);\n//        if (!pNSL->pMD->IsQCall())\n//        {\n//            g_profControlBlock.\n//                ManagedToUnmanagedTransition((FunctionID) pNSL->pMD,\n//                COR_PRF_TRANSITION_CALL);\n//        }\n//        END_PROFILER_CALLBACK();\n//    }\n//\n// This ensures that the extra condition check (in this case \"if\n// (!pNSL->pMD->IsQCall())\") is only evaluated if the profiler is loaded. That way, we're\n// not executing extra, unnecessary instructions when no profiler is present.\n//\n// See code:ProfilingAPIUtility::InitializeProfiling#LoadUnloadCallbackSynchronization\n// for more details about how the synchronization works.\n#define BEGIN_PROFILER_CALLBACK(condition)                                                  \\\n    /* Do a cheap check of the condition (dirty-read)                                   */  \\\n    if (condition)                                                                          \\\n    {                                                                                       \\\n\n#define END_PROFILER_CALLBACK()  }\n\n#else // PROFILING_SUPPORTED\n\n// Profiling feature not supported\n\n#define BEGIN_PROFILER_CALLBACK(condition)       if (false) {\n#define END_PROFILER_CALLBACK()                  }\n\n#endif // PROFILING_SUPPORTED\n\n#endif // _ProfilePriv_inl_\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/random.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// random.h\n//\n\n//\n// Defines a random number generator, initially from the System.Random code in the BCL.\n//\n// Main advantages over rand() are:\n//\n// 1) It generates better random numbers\n// 2) It can have multiple instantiations with different seeds\n// 3) It behaves the same regardless of whether we build with VC++ or GCC\n//\n// If you are working in the VM, we have a convenience method: code:GetRandomInt.  This usess a thread-local\n// Random instance if a Thread object is available, and otherwise falls back to a global instance\n// with a spin-lock.\n//\n\n#ifndef _CLRRANDOM_H_\n#define _CLRRANDOM_H_\n\n#include <math.h>\n\n//\n// Forbid the use of srand()/rand(), as these are globally shared facilities and our use of them would\n// interfere with native user code in the same process. This override is not compatible with stl headers.\n//\n#if !defined(DO_NOT_DISABLE_RAND) && !defined(USE_STL)\n\n#ifdef srand\n#undef srand\n#endif\n#define srand Do_not_use_srand\n\n#ifdef rand\n#undef rand\n#endif\n#define rand Do_not_use_rand\n\n#endif //!DO_NOT_DISABLE_RAND && !USE_STL\n\n\nclass CLRRandom\n{\nprivate:\n    //\n    // Private Constants\n    //\n    static const int MBIG =  INT_MAX;\n    static const int MSEED = 161803398;\n    static const int MZ = 0;\n\n\n    //\n    // Member Variables\n    //\n    int inext;\n    int inextp;\n    int SeedArray[56];\n\n    bool initialized;\n\npublic:\n    //\n    // Constructors\n    //\n\n    CLRRandom()\n    {\n        LIMITED_METHOD_CONTRACT;\n        initialized = false;\n    }\n\n    void Init()\n    {\n        LIMITED_METHOD_CONTRACT;\n        LARGE_INTEGER time;\n        if (!QueryPerformanceCounter(&time))\n            time.QuadPart = GetTickCount();\n        Init((int)time.u.LowPart ^ GetCurrentThreadId() ^ GetCurrentProcessId());\n    }\n\n    void Init(int Seed)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        int ii;\n        int mj, mk;\n\n        //Initialize our Seed array.\n        mj = MSEED - abs(Seed);\n        SeedArray[55]=mj;\n        mk=1;\n        for (int i=1; i<55; i++) {  //Apparently the range [1..55] is special (Knuth) and so we're wasting the 0'th position.\n            ii = (21*i)%55;\n            SeedArray[ii]=mk;\n            mk = mj - mk;\n            if (mk<0) mk+=MBIG;\n            mj=SeedArray[ii];\n        }\n        for (int k=1; k<5; k++) {\n            for (int i=1; i<56; i++) {\n                SeedArray[i] -= SeedArray[1+(i+30)%55];\n                if (SeedArray[i]<0) SeedArray[i]+=MBIG;\n            }\n        }\n        inext=0;\n        inextp = 21;\n        Seed = 1;\n\n        initialized = true;\n    }\n\n    bool IsInitialized()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return initialized;\n    }\n\nprivate:\n    //\n    // Package Private Methods\n    //\n\n    /*====================================Sample====================================\n    **Action: Return a new random number [0..1) and reSeed the Seed array.\n    **Returns: A double [0..1)\n    **Arguments: None\n    **Exceptions: None\n    ==============================================================================*/\n    double Sample()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        //Including this division at the end gives us significantly improved\n        //random number distribution.\n        return (InternalSample()*(1.0/MBIG));\n    }\n\n    int InternalSample()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        int retVal;\n        int locINext = inext;\n        int locINextp = inextp;\n\n        if (++locINext >=56) locINext=1;\n        if (++locINextp>= 56) locINextp = 1;\n\n        retVal = SeedArray[locINext]-SeedArray[locINextp];\n\n        if (retVal == MBIG) retVal--;\n        if (retVal<0) retVal+=MBIG;\n\n        SeedArray[locINext]=retVal;\n\n        inext = locINext;\n        inextp = locINextp;\n\n        return retVal;\n    }\n\n    double GetSampleForLargeRange()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        // The distribution of double value returned by Sample\n        // is not distributed well enough for a large range.\n        // If we use Sample for a range [Int32.MinValue..Int32.MaxValue)\n        // We will end up getting even numbers only.\n\n        int result = InternalSample();\n        // Note we can't use addition here. The distribution will be bad if we do that.\n        bool negative = (InternalSample()%2 == 0) ? true : false;  // decide the sign based on second sample\n        if( negative) {\n            result = -result;\n        }\n        double d = result;\n        d += (INT_MAX - 1); // get a number in range [0 .. 2 * Int32MaxValue - 1)\n        d /= 2*(unsigned int)INT_MAX - 1  ;\n        return d;\n    }\n\npublic:\n    //\n    // Public Instance Methods\n    //\n\n\n    /*=====================================Next=====================================\n    **Returns: An int [0..Int32.MaxValue)\n    **Arguments: None\n    **Exceptions: None.\n    ==============================================================================*/\n    int Next()\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(initialized);\n        return InternalSample();\n    }\n\n\n    /*=====================================Next=====================================\n    **Returns: An int [minvalue..maxvalue)\n    **Arguments: minValue -- the least legal value for the Random number.\n    **           maxValue -- One greater than the greatest legal return value.\n    **Exceptions: None.\n    ==============================================================================*/\n    int Next(int minValue, int maxValue)\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(initialized);\n        _ASSERTE(minValue < maxValue);\n\n        LONGLONG range = (LONGLONG)maxValue-minValue;\n        double result;\n\n        if( range <= (LONGLONG)INT_MAX)\n            result = (Sample() * range) + minValue;\n        else\n            result = (GetSampleForLargeRange() * range) + minValue;\n\n        _ASSERTE(result >= minValue && result < maxValue);\n        return (int)result;\n    }\n\n\n    /*=====================================Next=====================================\n    **Returns: An int [0..maxValue)\n    **Arguments: maxValue -- One more than the greatest legal return value.\n    **Exceptions: None.\n    ==============================================================================*/\n    int Next(int maxValue)\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(initialized);\n        double result = Sample()*maxValue;\n        _ASSERTE(result >= 0 && result < maxValue);\n        return (int)result;\n    }\n\n\n    /*=====================================Next=====================================\n    **Returns: A double [0..1)\n    **Arguments: None\n    **Exceptions: None\n    ==============================================================================*/\n    double NextDouble()\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(initialized);\n        double result = Sample();\n        _ASSERTE(result >= 0 && result < 1);\n        return result;\n    }\n\n\n    /*==================================NextBytes===================================\n    **Action:  Fills the byte array with random bytes [0..0x7f].  The entire array is filled.\n    **Returns:Void\n    **Arguments:  buffer -- the array to be filled.\n    **Exceptions: None\n    ==============================================================================*/\n    void NextBytes(_Out_writes_(length) BYTE buffer[], int length)\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(initialized);\n        for (int i=0; i<length; i++) {\n            buffer[i]=(BYTE)(InternalSample()%(256));\n        }\n    }\n};\n\n#endif //_CLRRANDOM_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/readme.md",
    "content": "# Updating idl files\n\nThis directory has a variety of .idl files (such as corprof.idl) that need a little special handling when you make changes. Originally when we built on Windows only\nthe build rules would automatically convert the idls into corresponding .h/.c files and include them in compilations. On non-windows platforms we don't have an equivalent\nfor midl.exe which did that conversion so we work around the issue by doing:\n\n- Build on Windows as normal, which will generate files in `artifacts\\obj\\windows.x64.Debug\\inc\\idls_out\\`\n- Copy any updated headers into `src\\coreclr\\pal\\prebuilt\\inc\\`\n- If needed, adjust any of the .cpp files in `src\\coreclr\\pal\\prebuilt\\idl\\` by hand, using the corresponding `artifacts\\obj\\windows.x64.Debug\\inc\\idls_out\\*_i.c` as a guide.\n  - Typically\nthis is just adding `MIDL_DEFINE_GUID(...)` for any new classes/interfaces that have been added to the idl file.\n\nInclude these src changes with the remainder of your work when you submit a PR.\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/readytorun.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// readytorun.h\n//\n\n//\n// Contains definitions for the Ready to Run file format\n//\n\n#ifndef __READYTORUN_H__\n#define __READYTORUN_H__\n\n#define READYTORUN_SIGNATURE 0x00525452 // 'RTR'\n\n// Keep these in sync with src/coreclr/tools/Common/Internal/Runtime/ModuleHeaders.cs\n#define READYTORUN_MAJOR_VERSION 0x0008\n#define READYTORUN_MINOR_VERSION 0x0000\n\n#define MINIMUM_READYTORUN_MAJOR_VERSION 0x008\n\n// R2R Version 2.1 adds the InliningInfo section\n// R2R Version 2.2 adds the ProfileDataInfo section\n// R2R Version 3.0 changes calling conventions to correctly handle explicit structures to spec.\n//     R2R 3.0 is not backward compatible with 2.x.\n// R2R Version 6.0 changes managed layout for sequential types with any unmanaged non-blittable fields.\n//     R2R 6.0 is not backward compatible with 5.x or earlier.\n// R2R Version 8.0 Changes the alignment of the Int128 type\n\nstruct READYTORUN_CORE_HEADER\n{\n    DWORD                   Flags;          // READYTORUN_FLAG_XXX\n\n    DWORD                   NumberOfSections;\n\n    // Array of sections follows. The array entries are sorted by Type\n    // READYTORUN_SECTION   Sections[];\n};\n\nstruct READYTORUN_HEADER\n{\n    DWORD                   Signature;      // READYTORUN_SIGNATURE\n    USHORT                  MajorVersion;   // READYTORUN_VERSION_XXX\n    USHORT                  MinorVersion;\n\n    READYTORUN_CORE_HEADER  CoreHeader;\n};\n\nstruct READYTORUN_COMPONENT_ASSEMBLIES_ENTRY\n{\n    IMAGE_DATA_DIRECTORY CorHeader;\n    IMAGE_DATA_DIRECTORY ReadyToRunCoreHeader;\n};\n\nenum ReadyToRunFlag\n{\n    READYTORUN_FLAG_PLATFORM_NEUTRAL_SOURCE     = 0x00000001,   // Set if the original IL assembly was platform-neutral\n    READYTORUN_FLAG_SKIP_TYPE_VALIDATION        = 0x00000002,   // Set of methods with native code was determined using profile data\n    READYTORUN_FLAG_PARTIAL                     = 0x00000004,\n    READYTORUN_FLAG_NONSHARED_PINVOKE_STUBS     = 0x00000008,   // PInvoke stubs compiled into image are non-shareable (no secret parameter)\n    READYTORUN_FLAG_EMBEDDED_MSIL               = 0x00000010,   // MSIL is embedded in the composite R2R executable\n    READYTORUN_FLAG_COMPONENT                   = 0x00000020,   // This is the header describing a component assembly of composite R2R\n    READYTORUN_FLAG_MULTIMODULE_VERSION_BUBBLE  = 0x00000040,   // This R2R module has multiple modules within its version bubble (For versions before version 6.2, all modules are assumed to possibly have this characteristic)\n    READYTORUN_FLAG_UNRELATED_R2R_CODE          = 0x00000080,   // This R2R module has code in it that would not be naturally encoded into this module\n};\n\nenum class ReadyToRunSectionType : uint32_t\n{\n    CompilerIdentifier          = 100,\n    ImportSections              = 101,\n    RuntimeFunctions            = 102,\n    MethodDefEntryPoints        = 103,\n    ExceptionInfo               = 104,\n    DebugInfo                   = 105,\n    DelayLoadMethodCallThunks   = 106,\n    // 107 used by an older format of AvailableTypes\n    AvailableTypes              = 108,\n    InstanceMethodEntryPoints   = 109,\n    InliningInfo                = 110, // Added in V2.1, deprecated in 4.1\n    ProfileDataInfo             = 111, // Added in V2.2\n    ManifestMetadata            = 112, // Added in V2.3\n    AttributePresence           = 113, // Added in V3.1\n    InliningInfo2               = 114, // Added in V4.1\n    ComponentAssemblies         = 115, // Added in V4.1\n    OwnerCompositeExecutable    = 116, // Added in V4.1\n    PgoInstrumentationData      = 117, // Added in V5.2\n    ManifestAssemblyMvids       = 118, // Added in V5.3\n    CrossModuleInlineInfo       = 119, // Added in V6.2\n    HotColdMap                  = 120, // Added in V8.0\n\n    // If you add a new section consider whether it is a breaking or non-breaking change.\n    // Usually it is non-breaking, but if it is preferable to have older runtimes fail\n    // to load the image vs. ignoring the new section it could be marked breaking.\n    // Increment the READYTORUN_MINOR_VERSION (non-breaking) or READYTORUN_MAJOR_VERSION\n    // (breaking) as appropriate.\n};\n\nstruct READYTORUN_SECTION\n{\n    ReadyToRunSectionType   Type;           // READYTORUN_SECTION_XXX\n    IMAGE_DATA_DIRECTORY    Section;\n};\n\nenum class ReadyToRunImportSectionType : uint8_t\n{\n    Unknown      = 0,\n    StubDispatch = 2,\n    StringHandle = 3,\n    ILBodyFixups = 7,\n};\n\nenum class ReadyToRunImportSectionFlags : uint16_t\n{\n    None     = 0x0000,\n    Eager    = 0x0001, // Section at module load time.\n    PCode    = 0x0004, // Section contains pointers to code\n};\n\n//\n// READYTORUN_IMPORT_SECTION describes image range with references to code or runtime data structures\n//\n// There is number of different types of these ranges: eagerly initialized at image load vs. lazily initialized at method entry\n// vs. lazily initialized on first use; handles vs. code pointers, etc.\n//\nstruct READYTORUN_IMPORT_SECTION\n{\n    IMAGE_DATA_DIRECTORY         Section;            // Section containing values to be fixed up\n    ReadyToRunImportSectionFlags Flags;              // One or more of ReadyToRunImportSectionFlags\n    ReadyToRunImportSectionType  Type;               // One of ReadyToRunImportSectionType\n    BYTE                         EntrySize;\n    DWORD                        Signatures;         // RVA of optional signature descriptors\n    DWORD                        AuxiliaryData;      // RVA of optional auxiliary data (typically GC info)\n};\n\n//\n// Constants for method and field encoding\n//\n\nenum ReadyToRunMethodSigFlags\n{\n    READYTORUN_METHOD_SIG_UnboxingStub          = 0x01,\n    READYTORUN_METHOD_SIG_InstantiatingStub     = 0x02,\n    READYTORUN_METHOD_SIG_MethodInstantiation   = 0x04,\n    READYTORUN_METHOD_SIG_SlotInsteadOfToken    = 0x08,\n    READYTORUN_METHOD_SIG_MemberRefToken        = 0x10,\n    READYTORUN_METHOD_SIG_Constrained           = 0x20,\n    READYTORUN_METHOD_SIG_OwnerType             = 0x40,\n    READYTORUN_METHOD_SIG_UpdateContext         = 0x80,\n};\n\nenum ReadyToRunFieldSigFlags\n{\n    READYTORUN_FIELD_SIG_IndexInsteadOfToken    = 0x08,\n    READYTORUN_FIELD_SIG_MemberRefToken         = 0x10,\n    READYTORUN_FIELD_SIG_OwnerType              = 0x40,\n};\n\nenum ReadyToRunTypeLayoutFlags\n{\n    READYTORUN_LAYOUT_HFA                       = 0x01,\n    READYTORUN_LAYOUT_Alignment                 = 0x02,\n    READYTORUN_LAYOUT_Alignment_Native          = 0x04,\n    READYTORUN_LAYOUT_GCLayout                  = 0x08,\n    READYTORUN_LAYOUT_GCLayout_Empty            = 0x10,\n};\n\nenum ReadyToRunVirtualFunctionOverrideFlags\n{\n    READYTORUN_VIRTUAL_OVERRIDE_None = 0x00,\n    READYTORUN_VIRTUAL_OVERRIDE_VirtualFunctionOverridden = 0x01,\n};\n\nenum class ReadyToRunCrossModuleInlineFlags : uint32_t\n{\n    CrossModuleInlinee           = 0x1,\n    HasCrossModuleInliners       = 0x2,\n    CrossModuleInlinerIndexShift = 2,\n\n    InlinerRidHasModule          = 0x1,\n    InlinerRidShift              = 1,\n};\n\n//\n// Constants for fixup signature encoding\n//\n\nenum ReadyToRunFixupKind\n{\n    READYTORUN_FIXUP_ThisObjDictionaryLookup    = 0x07,\n    READYTORUN_FIXUP_TypeDictionaryLookup       = 0x08,\n    READYTORUN_FIXUP_MethodDictionaryLookup     = 0x09,\n\n    READYTORUN_FIXUP_TypeHandle                 = 0x10,\n    READYTORUN_FIXUP_MethodHandle               = 0x11,\n    READYTORUN_FIXUP_FieldHandle                = 0x12,\n\n    READYTORUN_FIXUP_MethodEntry                = 0x13, /* For calling a method entry point */\n    READYTORUN_FIXUP_MethodEntry_DefToken       = 0x14, /* Smaller version of MethodEntry - method is def token */\n    READYTORUN_FIXUP_MethodEntry_RefToken       = 0x15, /* Smaller version of MethodEntry - method is ref token */\n\n    READYTORUN_FIXUP_VirtualEntry               = 0x16, /* For invoking a virtual method */\n    READYTORUN_FIXUP_VirtualEntry_DefToken      = 0x17, /* Smaller version of VirtualEntry - method is def token */\n    READYTORUN_FIXUP_VirtualEntry_RefToken      = 0x18, /* Smaller version of VirtualEntry - method is ref token */\n    READYTORUN_FIXUP_VirtualEntry_Slot          = 0x19, /* Smaller version of VirtualEntry - type & slot */\n\n    READYTORUN_FIXUP_Helper                     = 0x1A, /* Helper */\n    READYTORUN_FIXUP_StringHandle               = 0x1B, /* String handle */\n\n    READYTORUN_FIXUP_NewObject                  = 0x1C, /* Dynamically created new helper */\n    READYTORUN_FIXUP_NewArray                   = 0x1D,\n\n    READYTORUN_FIXUP_IsInstanceOf               = 0x1E, /* Dynamically created casting helper */\n    READYTORUN_FIXUP_ChkCast                    = 0x1F,\n\n    READYTORUN_FIXUP_FieldAddress               = 0x20, /* For accessing a cross-module static fields */\n    READYTORUN_FIXUP_CctorTrigger               = 0x21, /* Static constructor trigger */\n\n    READYTORUN_FIXUP_StaticBaseNonGC            = 0x22, /* Dynamically created static base helpers */\n    READYTORUN_FIXUP_StaticBaseGC               = 0x23,\n    READYTORUN_FIXUP_ThreadStaticBaseNonGC      = 0x24,\n    READYTORUN_FIXUP_ThreadStaticBaseGC         = 0x25,\n\n    READYTORUN_FIXUP_FieldBaseOffset            = 0x26, /* Field base offset */\n    READYTORUN_FIXUP_FieldOffset                = 0x27, /* Field offset */\n\n    READYTORUN_FIXUP_TypeDictionary             = 0x28,\n    READYTORUN_FIXUP_MethodDictionary           = 0x29,\n\n    READYTORUN_FIXUP_Check_TypeLayout           = 0x2A, /* size, alignment, HFA, reference map */\n    READYTORUN_FIXUP_Check_FieldOffset          = 0x2B,\n\n    READYTORUN_FIXUP_DelegateCtor               = 0x2C, /* optimized delegate ctor */\n    READYTORUN_FIXUP_DeclaringTypeHandle        = 0x2D,\n\n    READYTORUN_FIXUP_IndirectPInvokeTarget      = 0x2E, /* Target (indirect) of an inlined pinvoke */\n    READYTORUN_FIXUP_PInvokeTarget              = 0x2F, /* Target of an inlined pinvoke */\n\n    READYTORUN_FIXUP_Check_InstructionSetSupport= 0x30, /* Define the set of instruction sets that must be supported/unsupported to use the fixup */\n\n    READYTORUN_FIXUP_Verify_FieldOffset         = 0x31, /* Generate a runtime check to ensure that the field offset matches between compile and runtime. Unlike Check_FieldOffset, this will generate a runtime failure instead of silently dropping the method */\n    READYTORUN_FIXUP_Verify_TypeLayout          = 0x32, /* Generate a runtime check to ensure that the type layout (size, alignment, HFA, reference map) matches between compile and runtime. Unlike Check_TypeLayout, this will generate a runtime failure instead of silently dropping the method */\n\n    READYTORUN_FIXUP_Check_VirtualFunctionOverride = 0x33, /* Generate a runtime check to ensure that virtual function resolution has equivalent behavior at runtime as at compile time. If not equivalent, code will not be used */\n    READYTORUN_FIXUP_Verify_VirtualFunctionOverride = 0x34, /* Generate a runtime check to ensure that virtual function resolution has equivalent behavior at runtime as at compile time. If not equivalent, generate runtime failure. */\n\n    READYTORUN_FIXUP_Check_IL_Body              = 0x35, /* Check to see if an IL method is defined the same at runtime as at compile time. A failed match will cause code not to be used. */\n    READYTORUN_FIXUP_Verify_IL_Body             = 0x36, /* Verify an IL body is defined the same at compile time and runtime. A failed match will cause a hard runtime failure. */\n};\n\n//\n// Intrinsics and helpers\n//\n\nenum ReadyToRunHelper\n{\n    READYTORUN_HELPER_Invalid                   = 0x00,\n\n    // Not a real helper - handle to current module passed to delay load helpers.\n    READYTORUN_HELPER_Module                    = 0x01,\n    READYTORUN_HELPER_GSCookie                  = 0x02,\n    READYTORUN_HELPER_IndirectTrapThreads       = 0x03,\n\n    //\n    // Delay load helpers\n    //\n\n    // All delay load helpers use custom calling convention:\n    // - scratch register - address of indirection cell. 0 = address is inferred from callsite.\n    // - stack - section index, module handle\n    READYTORUN_HELPER_DelayLoad_MethodCall      = 0x08,\n\n    READYTORUN_HELPER_DelayLoad_Helper          = 0x10,\n    READYTORUN_HELPER_DelayLoad_Helper_Obj      = 0x11,\n    READYTORUN_HELPER_DelayLoad_Helper_ObjObj   = 0x12,\n\n    // JIT helpers\n\n    // Exception handling helpers\n    READYTORUN_HELPER_Throw                     = 0x20,\n    READYTORUN_HELPER_Rethrow                   = 0x21,\n    READYTORUN_HELPER_Overflow                  = 0x22,\n    READYTORUN_HELPER_RngChkFail                = 0x23,\n    READYTORUN_HELPER_FailFast                  = 0x24,\n    READYTORUN_HELPER_ThrowNullRef              = 0x25,\n    READYTORUN_HELPER_ThrowDivZero              = 0x26,\n\n    // Write barriers\n    READYTORUN_HELPER_WriteBarrier              = 0x30,\n    READYTORUN_HELPER_CheckedWriteBarrier       = 0x31,\n    READYTORUN_HELPER_ByRefWriteBarrier         = 0x32,\n\n    // Array helpers\n    READYTORUN_HELPER_Stelem_Ref                = 0x38,\n    READYTORUN_HELPER_Ldelema_Ref               = 0x39,\n\n    READYTORUN_HELPER_MemSet                    = 0x40,\n    READYTORUN_HELPER_MemCpy                    = 0x41,\n\n    // PInvoke helpers\n    READYTORUN_HELPER_PInvokeBegin              = 0x42,\n    READYTORUN_HELPER_PInvokeEnd                = 0x43,\n    READYTORUN_HELPER_GCPoll                    = 0x44,\n    READYTORUN_HELPER_ReversePInvokeEnter       = 0x45,\n    READYTORUN_HELPER_ReversePInvokeExit        = 0x46,\n\n    // Get string handle lazily\n    READYTORUN_HELPER_GetString                 = 0x50,\n\n    // Used by /Tuning for Profile optimizations\n    READYTORUN_HELPER_LogMethodEnter            = 0x51,\n\n    // Reflection helpers\n    READYTORUN_HELPER_GetRuntimeTypeHandle      = 0x54,\n    READYTORUN_HELPER_GetRuntimeMethodHandle    = 0x55,\n    READYTORUN_HELPER_GetRuntimeFieldHandle     = 0x56,\n\n    READYTORUN_HELPER_Box                       = 0x58,\n    READYTORUN_HELPER_Box_Nullable              = 0x59,\n    READYTORUN_HELPER_Unbox                     = 0x5A,\n    READYTORUN_HELPER_Unbox_Nullable            = 0x5B,\n    READYTORUN_HELPER_NewMultiDimArr            = 0x5C,\n\n    // Helpers used with generic handle lookup cases\n    READYTORUN_HELPER_NewObject                 = 0x60,\n    READYTORUN_HELPER_NewArray                  = 0x61,\n    READYTORUN_HELPER_CheckCastAny              = 0x62,\n    READYTORUN_HELPER_CheckInstanceAny          = 0x63,\n    READYTORUN_HELPER_GenericGcStaticBase       = 0x64,\n    READYTORUN_HELPER_GenericNonGcStaticBase    = 0x65,\n    READYTORUN_HELPER_GenericGcTlsBase          = 0x66,\n    READYTORUN_HELPER_GenericNonGcTlsBase       = 0x67,\n    READYTORUN_HELPER_VirtualFuncPtr            = 0x68,\n    READYTORUN_HELPER_IsInstanceOfException     = 0x69,\n\n    // Long mul/div/shift ops\n    READYTORUN_HELPER_LMul                      = 0xC0,\n    READYTORUN_HELPER_LMulOfv                   = 0xC1,\n    READYTORUN_HELPER_ULMulOvf                  = 0xC2,\n    READYTORUN_HELPER_LDiv                      = 0xC3,\n    READYTORUN_HELPER_LMod                      = 0xC4,\n    READYTORUN_HELPER_ULDiv                     = 0xC5,\n    READYTORUN_HELPER_ULMod                     = 0xC6,\n    READYTORUN_HELPER_LLsh                      = 0xC7,\n    READYTORUN_HELPER_LRsh                      = 0xC8,\n    READYTORUN_HELPER_LRsz                      = 0xC9,\n    READYTORUN_HELPER_Lng2Dbl                   = 0xCA,\n    READYTORUN_HELPER_ULng2Dbl                  = 0xCB,\n\n    // 32-bit division helpers\n    READYTORUN_HELPER_Div                       = 0xCC,\n    READYTORUN_HELPER_Mod                       = 0xCD,\n    READYTORUN_HELPER_UDiv                      = 0xCE,\n    READYTORUN_HELPER_UMod                      = 0xCF,\n\n    // Floating point conversions\n    READYTORUN_HELPER_Dbl2Int                   = 0xD0,\n    READYTORUN_HELPER_Dbl2IntOvf                = 0xD1,\n    READYTORUN_HELPER_Dbl2Lng                   = 0xD2,\n    READYTORUN_HELPER_Dbl2LngOvf                = 0xD3,\n    READYTORUN_HELPER_Dbl2UInt                  = 0xD4,\n    READYTORUN_HELPER_Dbl2UIntOvf               = 0xD5,\n    READYTORUN_HELPER_Dbl2ULng                  = 0xD6,\n    READYTORUN_HELPER_Dbl2ULngOvf               = 0xD7,\n\n    // Floating point ops\n    READYTORUN_HELPER_DblRem                    = 0xE0,\n    READYTORUN_HELPER_FltRem                    = 0xE1,\n    READYTORUN_HELPER_DblRound                  = 0xE2,\n    READYTORUN_HELPER_FltRound                  = 0xE3,\n\n#ifdef FEATURE_EH_FUNCLETS\n    // Personality routines\n    READYTORUN_HELPER_PersonalityRoutine        = 0xF0,\n    READYTORUN_HELPER_PersonalityRoutineFilterFunclet = 0xF1,\n#endif\n\n    // Synchronized methods\n    READYTORUN_HELPER_MonitorEnter              = 0xF8,\n    READYTORUN_HELPER_MonitorExit               = 0xF9,\n\n    //\n    // Deprecated/legacy\n    //\n\n    // JIT32 x86-specific write barriers\n    READYTORUN_HELPER_WriteBarrier_EAX          = 0x100,\n    READYTORUN_HELPER_WriteBarrier_EBX          = 0x101,\n    READYTORUN_HELPER_WriteBarrier_ECX          = 0x102,\n    READYTORUN_HELPER_WriteBarrier_ESI          = 0x103,\n    READYTORUN_HELPER_WriteBarrier_EDI          = 0x104,\n    READYTORUN_HELPER_WriteBarrier_EBP          = 0x105,\n    READYTORUN_HELPER_CheckedWriteBarrier_EAX   = 0x106,\n    READYTORUN_HELPER_CheckedWriteBarrier_EBX   = 0x107,\n    READYTORUN_HELPER_CheckedWriteBarrier_ECX   = 0x108,\n    READYTORUN_HELPER_CheckedWriteBarrier_ESI   = 0x109,\n    READYTORUN_HELPER_CheckedWriteBarrier_EDI   = 0x10A,\n    READYTORUN_HELPER_CheckedWriteBarrier_EBP   = 0x10B,\n\n    // JIT32 x86-specific exception handling\n    READYTORUN_HELPER_EndCatch                  = 0x110,\n\n    // Stack probing helper\n    READYTORUN_HELPER_StackProbe                = 0x111,\n\n    READYTORUN_HELPER_GetCurrentManagedThreadId = 0x112,\n\n    // Array helpers for use with native ints\n    READYTORUN_HELPER_Stelem_Ref_I                = 0x113,\n    READYTORUN_HELPER_Ldelema_Ref_I               = 0x114,\n};\n\n#include \"readytoruninstructionset.h\"\n\n//\n// Exception info\n//\n\nstruct READYTORUN_EXCEPTION_LOOKUP_TABLE_ENTRY\n{\n    DWORD MethodStart;\n    DWORD ExceptionInfo;\n};\n\nstruct READYTORUN_EXCEPTION_CLAUSE\n{\n    CorExceptionFlag    Flags;\n    DWORD               TryStartPC;\n    DWORD               TryEndPC;\n    DWORD               HandlerStartPC;\n    DWORD               HandlerEndPC;\n    union {\n        mdToken         ClassToken;\n        DWORD           FilterOffset;\n    };\n};\n\nenum ReadyToRunRuntimeConstants : DWORD\n{\n    READYTORUN_PInvokeTransitionFrameSizeInPointerUnits = 11,\n#ifdef TARGET_X86\n    READYTORUN_ReversePInvokeTransitionFrameSizeInPointerUnits = 5,\n#else\n    READYTORUN_ReversePInvokeTransitionFrameSizeInPointerUnits = 2,\n#endif\n};\n\nenum ReadyToRunHFAElemType : DWORD\n{\n    READYTORUN_HFA_ELEMTYPE_None = 0,\n    READYTORUN_HFA_ELEMTYPE_Float32 = 1,\n    READYTORUN_HFA_ELEMTYPE_Float64 = 2,\n    READYTORUN_HFA_ELEMTYPE_Vector64 = 3,\n    READYTORUN_HFA_ELEMTYPE_Vector128 = 4,\n};\n\n#endif // __READYTORUN_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/readytorunhelpers.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n// ReadyToRunHelpers.h\n//\n\n//\n// Mapping between regular JIT helpers and ready to run helpers\n//\n\n#ifndef OPTIMIZEFORSPEED\n#define OPTIMIZEFORSPEED\n#endif\n\nHELPER(READYTORUN_HELPER_Throw,                     CORINFO_HELP_THROW,                             OPTIMIZEFORSIZE)\nHELPER(READYTORUN_HELPER_Rethrow,                   CORINFO_HELP_RETHROW,                           OPTIMIZEFORSIZE)\nHELPER(READYTORUN_HELPER_Overflow,                  CORINFO_HELP_OVERFLOW,                          OPTIMIZEFORSIZE)\nHELPER(READYTORUN_HELPER_RngChkFail,                CORINFO_HELP_RNGCHKFAIL,                        OPTIMIZEFORSIZE)\nHELPER(READYTORUN_HELPER_FailFast,                  CORINFO_HELP_FAIL_FAST,                         OPTIMIZEFORSIZE)\nHELPER(READYTORUN_HELPER_ThrowNullRef,              CORINFO_HELP_THROWNULLREF,                      OPTIMIZEFORSIZE)\nHELPER(READYTORUN_HELPER_ThrowDivZero,              CORINFO_HELP_THROWDIVZERO,                      OPTIMIZEFORSIZE)\n\nHELPER(READYTORUN_HELPER_WriteBarrier,              CORINFO_HELP_ASSIGN_REF,                        )\nHELPER(READYTORUN_HELPER_CheckedWriteBarrier,       CORINFO_HELP_CHECKED_ASSIGN_REF,                )\nHELPER(READYTORUN_HELPER_ByRefWriteBarrier,         CORINFO_HELP_ASSIGN_BYREF,                      )\n\nHELPER(READYTORUN_HELPER_Stelem_Ref,                CORINFO_HELP_ARRADDR_ST,                        )\nHELPER(READYTORUN_HELPER_Ldelema_Ref,               CORINFO_HELP_LDELEMA_REF,                       )\n\nHELPER(READYTORUN_HELPER_MemSet,                    CORINFO_HELP_MEMSET,                            )\nHELPER(READYTORUN_HELPER_MemCpy,                    CORINFO_HELP_MEMCPY,                            )\n\nHELPER(READYTORUN_HELPER_LogMethodEnter,            CORINFO_HELP_BBT_FCN_ENTER,                     )\n\nHELPER(READYTORUN_HELPER_GetRuntimeTypeHandle,      CORINFO_HELP_TYPEHANDLE_TO_RUNTIMETYPE,         )\nHELPER(READYTORUN_HELPER_GetRuntimeMethodHandle,    CORINFO_HELP_METHODDESC_TO_STUBRUNTIMEMETHOD,   )\nHELPER(READYTORUN_HELPER_GetRuntimeFieldHandle,     CORINFO_HELP_FIELDDESC_TO_STUBRUNTIMEFIELD,     )\n\nHELPER(READYTORUN_HELPER_Box,                       CORINFO_HELP_BOX,                               )\nHELPER(READYTORUN_HELPER_Box_Nullable,              CORINFO_HELP_BOX_NULLABLE,                      )\nHELPER(READYTORUN_HELPER_Unbox,                     CORINFO_HELP_UNBOX,                             )\nHELPER(READYTORUN_HELPER_Unbox_Nullable,            CORINFO_HELP_UNBOX_NULLABLE,                    )\nHELPER(READYTORUN_HELPER_NewMultiDimArr,            CORINFO_HELP_NEW_MDARR,                         )\n\nHELPER(READYTORUN_HELPER_NewObject,                 CORINFO_HELP_NEWFAST,                           )\nHELPER(READYTORUN_HELPER_NewArray,                  CORINFO_HELP_NEWARR_1_DIRECT,                   )\nHELPER(READYTORUN_HELPER_CheckCastAny,              CORINFO_HELP_CHKCASTANY,                        )\nHELPER(READYTORUN_HELPER_CheckInstanceAny,          CORINFO_HELP_ISINSTANCEOFANY,                   )\n\nHELPER(READYTORUN_HELPER_GenericGcStaticBase,       CORINFO_HELP_GETGENERICS_GCSTATIC_BASE,         )\nHELPER(READYTORUN_HELPER_GenericNonGcStaticBase,    CORINFO_HELP_GETGENERICS_NONGCSTATIC_BASE,      )\nHELPER(READYTORUN_HELPER_GenericGcTlsBase,          CORINFO_HELP_GETGENERICS_GCTHREADSTATIC_BASE,   )\nHELPER(READYTORUN_HELPER_GenericNonGcTlsBase,       CORINFO_HELP_GETGENERICS_NONGCTHREADSTATIC_BASE,)\n\nHELPER(READYTORUN_HELPER_VirtualFuncPtr,            CORINFO_HELP_VIRTUAL_FUNC_PTR,                  )\nHELPER(READYTORUN_HELPER_IsInstanceOfException,     CORINFO_HELP_ISINSTANCEOF_EXCEPTION,            )\n\nHELPER(READYTORUN_HELPER_LMul,                      CORINFO_HELP_LMUL,                              )\nHELPER(READYTORUN_HELPER_LMulOfv,                   CORINFO_HELP_LMUL_OVF,                          )\nHELPER(READYTORUN_HELPER_ULMulOvf,                  CORINFO_HELP_ULMUL_OVF,                         )\nHELPER(READYTORUN_HELPER_LDiv,                      CORINFO_HELP_LDIV,                              )\nHELPER(READYTORUN_HELPER_LMod,                      CORINFO_HELP_LMOD,                              )\nHELPER(READYTORUN_HELPER_ULDiv,                     CORINFO_HELP_ULDIV,                             )\nHELPER(READYTORUN_HELPER_ULMod,                     CORINFO_HELP_ULMOD,                             )\nHELPER(READYTORUN_HELPER_LLsh,                      CORINFO_HELP_LLSH,                              )\nHELPER(READYTORUN_HELPER_LRsh,                      CORINFO_HELP_LRSH,                              )\nHELPER(READYTORUN_HELPER_LRsz,                      CORINFO_HELP_LRSZ,                              )\nHELPER(READYTORUN_HELPER_Lng2Dbl,                   CORINFO_HELP_LNG2DBL,                           )\nHELPER(READYTORUN_HELPER_ULng2Dbl,                  CORINFO_HELP_ULNG2DBL,                          )\n\nHELPER(READYTORUN_HELPER_Div,                       CORINFO_HELP_DIV,                               )\nHELPER(READYTORUN_HELPER_Mod,                       CORINFO_HELP_MOD,                               )\nHELPER(READYTORUN_HELPER_UDiv,                      CORINFO_HELP_UDIV,                              )\nHELPER(READYTORUN_HELPER_UMod,                      CORINFO_HELP_UMOD,                              )\n\nHELPER(READYTORUN_HELPER_Dbl2Int,                   CORINFO_HELP_DBL2INT,                           )\nHELPER(READYTORUN_HELPER_Dbl2IntOvf,                CORINFO_HELP_DBL2INT_OVF,                       )\nHELPER(READYTORUN_HELPER_Dbl2Lng,                   CORINFO_HELP_DBL2LNG,                           )\nHELPER(READYTORUN_HELPER_Dbl2LngOvf,                CORINFO_HELP_DBL2LNG_OVF,                       )\nHELPER(READYTORUN_HELPER_Dbl2UInt,                  CORINFO_HELP_DBL2UINT,                          )\nHELPER(READYTORUN_HELPER_Dbl2UIntOvf,               CORINFO_HELP_DBL2UINT_OVF,                      )\nHELPER(READYTORUN_HELPER_Dbl2ULng,                  CORINFO_HELP_DBL2ULNG,                          )\nHELPER(READYTORUN_HELPER_Dbl2ULngOvf,               CORINFO_HELP_DBL2ULNG_OVF,                      )\n\nHELPER(READYTORUN_HELPER_FltRem,                    CORINFO_HELP_FLTREM,                            )\nHELPER(READYTORUN_HELPER_DblRem,                    CORINFO_HELP_DBLREM,                            )\nHELPER(READYTORUN_HELPER_FltRound,                  CORINFO_HELP_FLTROUND,                          )\nHELPER(READYTORUN_HELPER_DblRound,                  CORINFO_HELP_DBLROUND,                          )\n\n#ifndef TARGET_X86\nHELPER(READYTORUN_HELPER_PersonalityRoutine,        CORINFO_HELP_EE_PERSONALITY_ROUTINE,            OPTIMIZEFORSIZE)\nHELPER(READYTORUN_HELPER_PersonalityRoutineFilterFunclet, CORINFO_HELP_EE_PERSONALITY_ROUTINE_FILTER_FUNCLET, OPTIMIZEFORSIZE)\n#endif\n\n#ifdef TARGET_X86\nHELPER(READYTORUN_HELPER_WriteBarrier_EAX,          CORINFO_HELP_ASSIGN_REF_EAX,                    )\nHELPER(READYTORUN_HELPER_WriteBarrier_EBX,          CORINFO_HELP_ASSIGN_REF_EBX,                    )\nHELPER(READYTORUN_HELPER_WriteBarrier_ECX,          CORINFO_HELP_ASSIGN_REF_ECX,                    )\nHELPER(READYTORUN_HELPER_WriteBarrier_ESI,          CORINFO_HELP_ASSIGN_REF_ESI,                    )\nHELPER(READYTORUN_HELPER_WriteBarrier_EDI,          CORINFO_HELP_ASSIGN_REF_EDI,                    )\nHELPER(READYTORUN_HELPER_WriteBarrier_EBP,          CORINFO_HELP_ASSIGN_REF_EBP,                    )\nHELPER(READYTORUN_HELPER_CheckedWriteBarrier_EAX,   CORINFO_HELP_CHECKED_ASSIGN_REF_EAX,            )\nHELPER(READYTORUN_HELPER_CheckedWriteBarrier_EBX,   CORINFO_HELP_CHECKED_ASSIGN_REF_EBX,            )\nHELPER(READYTORUN_HELPER_CheckedWriteBarrier_ECX,   CORINFO_HELP_CHECKED_ASSIGN_REF_ECX,            )\nHELPER(READYTORUN_HELPER_CheckedWriteBarrier_ESI,   CORINFO_HELP_CHECKED_ASSIGN_REF_ESI,            )\nHELPER(READYTORUN_HELPER_CheckedWriteBarrier_EDI,   CORINFO_HELP_CHECKED_ASSIGN_REF_EDI,            )\nHELPER(READYTORUN_HELPER_CheckedWriteBarrier_EBP,   CORINFO_HELP_CHECKED_ASSIGN_REF_EBP,            )\n\nHELPER(READYTORUN_HELPER_EndCatch,                  CORINFO_HELP_ENDCATCH,                          OPTIMIZEFORSIZE)\n#endif\n\nHELPER(READYTORUN_HELPER_PInvokeBegin,              CORINFO_HELP_JIT_PINVOKE_BEGIN,                 )\nHELPER(READYTORUN_HELPER_PInvokeEnd,                CORINFO_HELP_JIT_PINVOKE_END,                   )\nHELPER(READYTORUN_HELPER_GCPoll,                    CORINFO_HELP_POLL_GC,                           )\nHELPER(READYTORUN_HELPER_ReversePInvokeEnter,       CORINFO_HELP_JIT_REVERSE_PINVOKE_ENTER,         )\nHELPER(READYTORUN_HELPER_ReversePInvokeExit,        CORINFO_HELP_JIT_REVERSE_PINVOKE_EXIT,          )\n\nHELPER(READYTORUN_HELPER_MonitorEnter,              CORINFO_HELP_MON_ENTER,                         )\nHELPER(READYTORUN_HELPER_MonitorExit,               CORINFO_HELP_MON_EXIT,                          )\n\n#ifndef TARGET_ARM64\nHELPER(READYTORUN_HELPER_StackProbe,                CORINFO_HELP_STACK_PROBE,                       )\n#endif\n\nHELPER(READYTORUN_HELPER_GetCurrentManagedThreadId, CORINFO_HELP_GETCURRENTMANAGEDTHREADID,         )\n\n#undef HELPER\n#undef OPTIMIZEFORSPEED\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/readytoruninstructionset.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// DO NOT EDIT THIS FILE! IT IS AUTOGENERATED\n// FROM /src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt\n// using /src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat\n\n#ifndef READYTORUNINSTRUCTIONSET_H\n#define READYTORUNINSTRUCTIONSET_H\nenum ReadyToRunInstructionSet\n{\n    READYTORUN_INSTRUCTION_Sse=1,\n    READYTORUN_INSTRUCTION_Sse2=2,\n    READYTORUN_INSTRUCTION_Sse3=3,\n    READYTORUN_INSTRUCTION_Ssse3=4,\n    READYTORUN_INSTRUCTION_Sse41=5,\n    READYTORUN_INSTRUCTION_Sse42=6,\n    READYTORUN_INSTRUCTION_Avx=7,\n    READYTORUN_INSTRUCTION_Avx2=8,\n    READYTORUN_INSTRUCTION_Aes=9,\n    READYTORUN_INSTRUCTION_Bmi1=10,\n    READYTORUN_INSTRUCTION_Bmi2=11,\n    READYTORUN_INSTRUCTION_Fma=12,\n    READYTORUN_INSTRUCTION_Lzcnt=13,\n    READYTORUN_INSTRUCTION_Pclmulqdq=14,\n    READYTORUN_INSTRUCTION_Popcnt=15,\n    READYTORUN_INSTRUCTION_ArmBase=16,\n    READYTORUN_INSTRUCTION_AdvSimd=17,\n    READYTORUN_INSTRUCTION_Crc32=18,\n    READYTORUN_INSTRUCTION_Sha1=19,\n    READYTORUN_INSTRUCTION_Sha256=20,\n    READYTORUN_INSTRUCTION_Atomics=21,\n    READYTORUN_INSTRUCTION_X86Base=22,\n    READYTORUN_INSTRUCTION_Dp=23,\n    READYTORUN_INSTRUCTION_Rdm=24,\n    READYTORUN_INSTRUCTION_AvxVnni=25,\n    READYTORUN_INSTRUCTION_Rcpc=26,\n    READYTORUN_INSTRUCTION_Movbe=27,\n    READYTORUN_INSTRUCTION_X86Serialize=28,\n    READYTORUN_INSTRUCTION_Avx512F=29,\n    READYTORUN_INSTRUCTION_Avx512F_VL=30,\n    READYTORUN_INSTRUCTION_Avx512BW=31,\n    READYTORUN_INSTRUCTION_Avx512BW_VL=32,\n    READYTORUN_INSTRUCTION_Avx512CD=33,\n    READYTORUN_INSTRUCTION_Avx512CD_VL=34,\n    READYTORUN_INSTRUCTION_Avx512DQ=35,\n    READYTORUN_INSTRUCTION_Avx512DQ_VL=36,\n\n};\n\n#endif // READYTORUNINSTRUCTIONSET_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/regdisp.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __REGDISP_H\n#define __REGDISP_H\n\n\n#ifdef DEBUG_REGDISPLAY\nclass Thread;\nstruct REGDISPLAY;\nvoid CheckRegDisplaySP (REGDISPLAY *pRD);\n#endif // DEBUG_REGDISPLAY\n\nstruct REGDISPLAY_BASE {\n    PT_CONTEXT pContext;    // This is the context of the active call frame;\n                            // either returned by GetContext or provided at\n                            // exception time.\n                            //\n                            // This will be used to resume execution, so\n                            // do NOT trash it! But DO update any static\n                            // registers here.\n\n#ifdef FEATURE_EH_FUNCLETS\n    PT_CONTEXT pCurrentContext;   // [trashed] points to current Context of stackwalk\n    PT_CONTEXT pCallerContext;    // [trashed] points to the Context of the caller during stackwalk -- used for GC crawls\n\n    // [trashed] points to current context pointers of stackwalk\n    T_KNONVOLATILE_CONTEXT_POINTERS *pCurrentContextPointers;\n    // [trashed] points to the context pointers of the caller during stackwalk -- used for GC crawls\n    T_KNONVOLATILE_CONTEXT_POINTERS *pCallerContextPointers;\n\n    BOOL IsCallerContextValid;  // TRUE if pCallerContext really contains the caller's context\n    BOOL IsCallerSPValid;       // Don't add usage of this field.  This is only temporary.\n\n    T_CONTEXT  ctxOne;    // used by stackwalk\n    T_CONTEXT  ctxTwo;    // used by stackwalk\n\n    T_KNONVOLATILE_CONTEXT_POINTERS ctxPtrsOne;  // used by stackwalk\n    T_KNONVOLATILE_CONTEXT_POINTERS ctxPtrsTwo;  // used by stackwalk\n#endif // FEATURE_EH_FUNCLETS\n\n#ifdef DEBUG_REGDISPLAY\n    Thread *_pThread;\n#endif // DEBUG_REGDISPLAY\n\n    TADDR SP;\n    TADDR ControlPC; // LOONGARCH: use RA for PC\n};\n\ninline PCODE GetControlPC(const REGDISPLAY_BASE *pRD) {\n    LIMITED_METHOD_DAC_CONTRACT;\n    return (PCODE)(pRD->ControlPC);\n}\n\ninline TADDR GetRegdisplaySP(REGDISPLAY_BASE *pRD) {\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return pRD->SP;\n}\n\ninline void SetRegdisplaySP(REGDISPLAY_BASE *pRD, LPVOID sp) {\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    pRD->SP = (TADDR)sp;\n}\n\n#if defined(TARGET_X86)\n\nstruct REGDISPLAY : public REGDISPLAY_BASE {\n\n#ifndef FEATURE_EH_FUNCLETS\n    // TODO: Unify with pCurrentContext / pCallerContext used on 64-bit\n    PCONTEXT pContextForUnwind; // scratch context for unwinding\n                                // used to preserve context saved in the frame that\n                                // could be otherwise wiped by the unwinding\n\n    DWORD * pEdi;\n    DWORD * pEsi;\n    DWORD * pEbx;\n    DWORD * pEdx;\n    DWORD * pEcx;\n    DWORD * pEax;\n\n    DWORD * pEbp;\n#endif // !FEATURE_EH_FUNCLETS\n\n#ifndef FEATURE_EH_FUNCLETS\n\n#define REG_METHODS(reg) \\\n    inline PDWORD Get##reg##Location(void) { return p##reg;  } \\\n    inline void   Set##reg##Location(PDWORD p##reg) { this->p##reg = p##reg; }\n\n#else // !FEATURE_EH_FUNCLETS\n\n#define REG_METHODS(reg) \\\n    inline PDWORD Get##reg##Location(void) { return pCurrentContextPointers->reg; } \\\n    inline void   Set##reg##Location(PDWORD p##reg) \\\n    { \\\n        pCurrentContextPointers->reg = p##reg; \\\n        pCurrentContext->reg = *p##reg; \\\n    }\n\n#endif // FEATURE_EH_FUNCLETS\n\n    REG_METHODS(Eax)\n    REG_METHODS(Ecx)\n    REG_METHODS(Edx)\n\n    REG_METHODS(Ebx)\n    REG_METHODS(Esi)\n    REG_METHODS(Edi)\n    REG_METHODS(Ebp)\n\n#undef REG_METHODS\n\n    TADDR   PCTAddr;\n};\n\ninline TADDR GetRegdisplayFP(REGDISPLAY *display) {\n    LIMITED_METHOD_DAC_CONTRACT;\n#ifdef FEATURE_EH_FUNCLETS\n    return (TADDR)display->pCurrentContext->Ebp;\n#else\n    return (TADDR)*display->GetEbpLocation();\n#endif\n}\n\ninline LPVOID GetRegdisplayFPAddress(REGDISPLAY *display) {\n    LIMITED_METHOD_CONTRACT;\n\n    return (LPVOID)display->GetEbpLocation();\n}\n\n\n// This function tells us if the given stack pointer is in one of the frames of the functions called by the given frame\ninline BOOL IsInCalleesFrames(REGDISPLAY *display, LPVOID stackPointer) {\n    LIMITED_METHOD_CONTRACT;\n\n#ifdef FEATURE_EH_FUNCLETS\n    return stackPointer < ((LPVOID)(display->SP));\n#else\n    return (TADDR)stackPointer < display->PCTAddr;\n#endif\n}\ninline TADDR GetRegdisplayStackMark(REGDISPLAY *display) {\n    LIMITED_METHOD_DAC_CONTRACT;\n\n#ifdef FEATURE_EH_FUNCLETS\n    _ASSERTE(GetRegdisplaySP(display) == GetSP(display->pCurrentContext));\n    return GetRegdisplaySP(display);\n#else\n    return display->PCTAddr;\n#endif\n}\n\n#elif defined(TARGET_64BIT)\n\n#if defined(TARGET_ARM64)\ntypedef struct _Arm64VolatileContextPointer\n{\n    union {\n        struct {\n            PDWORD64 X0;\n            PDWORD64 X1;\n            PDWORD64 X2;\n            PDWORD64 X3;\n            PDWORD64 X4;\n            PDWORD64 X5;\n            PDWORD64 X6;\n            PDWORD64 X7;\n            PDWORD64 X8;\n            PDWORD64 X9;\n            PDWORD64 X10;\n            PDWORD64 X11;\n            PDWORD64 X12;\n            PDWORD64 X13;\n            PDWORD64 X14;\n            PDWORD64 X15;\n            PDWORD64 X16;\n            PDWORD64 X17;\n            //X18 is reserved by OS, in userspace it represents TEB\n        };\n        PDWORD64 X[18];\n    };\n} Arm64VolatileContextPointer;\n#endif //TARGET_ARM64\n\n#if defined(TARGET_LOONGARCH64)\ntypedef struct _Loongarch64VolatileContextPointer\n{\n    PDWORD64 R0;\n    PDWORD64 A0;\n    PDWORD64 A1;\n    PDWORD64 A2;\n    PDWORD64 A3;\n    PDWORD64 A4;\n    PDWORD64 A5;\n    PDWORD64 A6;\n    PDWORD64 A7;\n    PDWORD64 T0;\n    PDWORD64 T1;\n    PDWORD64 T2;\n    PDWORD64 T3;\n    PDWORD64 T4;\n    PDWORD64 T5;\n    PDWORD64 T6;\n    PDWORD64 T7;\n    PDWORD64 T8;\n    PDWORD64 X0;\n} Loongarch64VolatileContextPointer;\n#endif\n\nstruct REGDISPLAY : public REGDISPLAY_BASE {\n#ifdef TARGET_ARM64\n    Arm64VolatileContextPointer     volatileCurrContextPointers;\n#endif\n\n#ifdef TARGET_LOONGARCH64\n    Loongarch64VolatileContextPointer    volatileCurrContextPointers;\n#endif\n\n    REGDISPLAY()\n    {\n        // Initialize\n        memset(this, 0, sizeof(REGDISPLAY));\n    }\n};\n\n\ninline TADDR GetRegdisplayFP(REGDISPLAY *display) {\n    LIMITED_METHOD_CONTRACT;\n    return NULL;\n}\n\ninline TADDR GetRegdisplayFPAddress(REGDISPLAY *display) {\n    LIMITED_METHOD_CONTRACT;\n    return NULL;\n}\n\n// This function tells us if the given stack pointer is in one of the frames of the functions called by the given frame\ninline BOOL IsInCalleesFrames(REGDISPLAY *display, LPVOID stackPointer)\n{\n    LIMITED_METHOD_CONTRACT;\n    return stackPointer < ((LPVOID)(display->SP));\n}\n\ninline TADDR GetRegdisplayStackMark(REGDISPLAY *display)\n{\n#if defined(TARGET_AMD64)\n    // On AMD64, the MemoryStackFp value is the current sp (i.e. the sp value when calling another method).\n    _ASSERTE(GetRegdisplaySP(display) == GetSP(display->pCurrentContext));\n    return GetRegdisplaySP(display);\n\n#elif defined(TARGET_ARM64)\n\n    _ASSERTE(display->IsCallerContextValid);\n    return GetSP(display->pCallerContext);\n\n#else  // TARGET_AMD64\n    PORTABILITY_ASSERT(\"GetRegdisplayStackMark NYI for this platform (Regdisp.h)\");\n    return NULL;\n#endif // TARGET_AMD64\n}\n\n#elif defined(TARGET_ARM)\n\n// ResumableFrame is pushed on the stack before\n// starting the GC. registers r0-r3 in ResumableFrame can\n// contain roots which might need to be updated if they are\n// relocated. On Stack walking the addresses of the registers in the\n// resumable Frame are passed to GC using pCurrentContextPointers\n// member in _REGDISPLAY. However On ARM KNONVOLATILE_CONTEXT_POINTERS\n// does not contain pointers for volatile registers. Therefore creating\n// this structure to store pointers to volatile registers and adding an object\n// as member in _REGDISPLAY\ntypedef struct _ArmVolatileContextPointer\n{\n    PDWORD R0;\n    PDWORD R1;\n    PDWORD R2;\n    PDWORD R3;\n    PDWORD R12;\n} ArmVolatileContextPointer;\n\nstruct REGDISPLAY : public REGDISPLAY_BASE {\n    ArmVolatileContextPointer     volatileCurrContextPointers;\n\n    DWORD *  pPC;                // processor neutral name\n    REGDISPLAY()\n    {\n        // Initialize regdisplay\n        memset(this, 0, sizeof(REGDISPLAY));\n\n        // Setup the pointer to ControlPC field\n        pPC = &ControlPC;\n    }\n};\n\n// This function tells us if the given stack pointer is in one of the frames of the functions called by the given frame\ninline BOOL IsInCalleesFrames(REGDISPLAY *display, LPVOID stackPointer) {\n    LIMITED_METHOD_CONTRACT;\n    return stackPointer < ((LPVOID)(TADDR)(display->SP));\n}\n\ninline TADDR GetRegdisplayStackMark(REGDISPLAY *display) {\n    LIMITED_METHOD_CONTRACT;\n    // ARM uses the establisher frame as the marker\n    _ASSERTE(display->IsCallerContextValid);\n    return GetSP(display->pCallerContext);\n}\n\n#else // none of the above processors\n#error \"RegDisplay functions are not implemented on this platform.\"\n#endif\n\n#if defined(TARGET_64BIT) || defined(TARGET_ARM) || (defined(TARGET_X86) && defined(FEATURE_EH_FUNCLETS))\n// This needs to be implemented for platforms that have funclets.\ninline LPVOID GetRegdisplayReturnValue(REGDISPLAY *display)\n{\n    LIMITED_METHOD_CONTRACT;\n\n#if defined(TARGET_AMD64)\n    return (LPVOID)display->pCurrentContext->Rax;\n#elif defined(TARGET_ARM64)\n    return (LPVOID)display->pCurrentContext->X0;\n#elif defined(TARGET_ARM)\n    return (LPVOID)((TADDR)display->pCurrentContext->R0);\n#elif defined(TARGET_X86)\n    return (LPVOID)display->pCurrentContext->Eax;\n#elif defined(TARGET_LOONGARCH64)\n    return (LPVOID)display->pCurrentContext->A0;\n#else\n    PORTABILITY_ASSERT(\"GetRegdisplayReturnValue NYI for this platform (Regdisp.h)\");\n    return NULL;\n#endif\n}\n\ninline void SyncRegDisplayToCurrentContext(REGDISPLAY* pRD)\n{\n    LIMITED_METHOD_CONTRACT;\n\n#if defined(TARGET_64BIT)\n    pRD->SP         = (INT_PTR)GetSP(pRD->pCurrentContext);\n    pRD->ControlPC  = INT_PTR(GetIP(pRD->pCurrentContext));\n#elif defined(TARGET_ARM)\n    pRD->SP         = (DWORD)GetSP(pRD->pCurrentContext);\n    pRD->ControlPC  = (DWORD)GetIP(pRD->pCurrentContext);\n#elif defined(TARGET_X86)\n    pRD->SP         = (DWORD)GetSP(pRD->pCurrentContext);\n    pRD->ControlPC  = (DWORD)GetIP(pRD->pCurrentContext);\n#else // TARGET_X86\n    PORTABILITY_ASSERT(\"SyncRegDisplayToCurrentContext\");\n#endif\n\n#ifdef DEBUG_REGDISPLAY\n    CheckRegDisplaySP(pRD);\n#endif // DEBUG_REGDISPLAY\n}\n#endif // TARGET_64BIT || TARGET_ARM || (TARGET_X86 && FEATURE_EH_FUNCLETS)\n\ntypedef REGDISPLAY *PREGDISPLAY;\n\n#ifdef FEATURE_EH_FUNCLETS\ninline void FillContextPointers(PT_KNONVOLATILE_CONTEXT_POINTERS pCtxPtrs, PT_CONTEXT pCtx)\n{\n#ifdef TARGET_AMD64\n    for (int i = 0; i < 16; i++)\n    {\n        *(&pCtxPtrs->Rax + i) = (&pCtx->Rax + i);\n    }\n#elif defined(TARGET_ARM64) // TARGET_AMD64\n    for (int i = 0; i < 12; i++)\n    {\n        *(&pCtxPtrs->X19 + i) = (&pCtx->X19 + i);\n    }\n#elif defined(TARGET_LOONGARCH64)  // TARGET_ARM64\n    *(&pCtxPtrs->S0) = &pCtx->S0;\n    *(&pCtxPtrs->S1) = &pCtx->S1;\n    *(&pCtxPtrs->S2) = &pCtx->S2;\n    *(&pCtxPtrs->S3) = &pCtx->S3;\n    *(&pCtxPtrs->S4) = &pCtx->S4;\n    *(&pCtxPtrs->S5) = &pCtx->S5;\n    *(&pCtxPtrs->S6) = &pCtx->S6;\n    *(&pCtxPtrs->S7) = &pCtx->S7;\n    *(&pCtxPtrs->S8) = &pCtx->S8;\n    *(&pCtxPtrs->Tp) = &pCtx->Tp;\n    *(&pCtxPtrs->Fp) = &pCtx->Fp;\n    *(&pCtxPtrs->Ra) = &pCtx->Ra;\n#elif defined(TARGET_ARM) // TARGET_LOONGARCH64\n    // Copy over the nonvolatile integer registers (R4-R11)\n    for (int i = 0; i < 8; i++)\n    {\n        *(&pCtxPtrs->R4 + i) = (&pCtx->R4 + i);\n    }\n#elif defined(TARGET_X86) // TARGET_ARM\n    for (int i = 0; i < 7; i++)\n    {\n        *(&pCtxPtrs->Edi + i) = (&pCtx->Edi + i);\n    }\n#else // TARGET_X86\n    PORTABILITY_ASSERT(\"FillContextPointers\");\n#endif // _TARGET_???_ (ELSE)\n}\n#endif // FEATURE_EH_FUNCLETS\n\ninline void FillRegDisplay(const PREGDISPLAY pRD, PT_CONTEXT pctx, PT_CONTEXT pCallerCtx = NULL)\n{\n    WRAPPER_NO_CONTRACT;\n\n    SUPPORTS_DAC;\n\n#ifndef FEATURE_EH_FUNCLETS\n#ifdef TARGET_X86\n    pRD->pContext = pctx;\n    pRD->pContextForUnwind = NULL;\n    pRD->pEdi = &(pctx->Edi);\n    pRD->pEsi = &(pctx->Esi);\n    pRD->pEbx = &(pctx->Ebx);\n    pRD->pEbp = &(pctx->Ebp);\n    pRD->pEax = &(pctx->Eax);\n    pRD->pEcx = &(pctx->Ecx);\n    pRD->pEdx = &(pctx->Edx);\n    pRD->SP   = pctx->Esp;\n    pRD->ControlPC = (PCODE)(pctx->Eip);\n    pRD->PCTAddr = (UINT_PTR)&(pctx->Eip);\n#else // TARGET_X86\n    PORTABILITY_ASSERT(\"FillRegDisplay\");\n#endif // _TARGET_???_ (ELSE)\n\n#else // !FEATURE_EH_FUNCLETS\n    pRD->pContext   = pctx;\n\n    // Setup the references\n    pRD->pCurrentContextPointers = &pRD->ctxPtrsOne;\n    pRD->pCallerContextPointers = &pRD->ctxPtrsTwo;\n\n    pRD->pCurrentContext = &(pRD->ctxOne);\n    pRD->pCallerContext  = &(pRD->ctxTwo);\n\n    // copy the active context to initialize our stackwalk\n    *(pRD->pCurrentContext)     = *(pctx);\n\n    // copy the caller context as well if it's specified\n    if (pCallerCtx == NULL)\n    {\n        pRD->IsCallerContextValid = FALSE;\n        pRD->IsCallerSPValid      = FALSE;        // Don't add usage of this field.  This is only temporary.\n    }\n    else\n    {\n        *(pRD->pCallerContext)    = *(pCallerCtx);\n        pRD->IsCallerContextValid = TRUE;\n        pRD->IsCallerSPValid      = TRUE;        // Don't add usage of this field.  This is only temporary.\n    }\n\n    FillContextPointers(&pRD->ctxPtrsOne, pctx);\n\n#if defined(TARGET_ARM)\n    // Fill volatile context pointers. They can be used by GC in the case of the leaf frame\n    pRD->volatileCurrContextPointers.R0 = &pctx->R0;\n    pRD->volatileCurrContextPointers.R1 = &pctx->R1;\n    pRD->volatileCurrContextPointers.R2 = &pctx->R2;\n    pRD->volatileCurrContextPointers.R3 = &pctx->R3;\n    pRD->volatileCurrContextPointers.R12 = &pctx->R12;\n\n    pRD->ctxPtrsOne.Lr = &pctx->Lr;\n    pRD->pPC = &pRD->pCurrentContext->Pc;\n#elif defined(TARGET_ARM64) // TARGET_ARM\n    // Fill volatile context pointers. They can be used by GC in the case of the leaf frame\n    for (int i=0; i < 18; i++)\n        pRD->volatileCurrContextPointers.X[i] = &pctx->X[i];\n#elif defined(TARGET_LOONGARCH64) // TARGET_ARM64\n    pRD->volatileCurrContextPointers.A0 = &pctx->A0;\n    pRD->volatileCurrContextPointers.A1 = &pctx->A1;\n    pRD->volatileCurrContextPointers.A2 = &pctx->A2;\n    pRD->volatileCurrContextPointers.A3 = &pctx->A3;\n    pRD->volatileCurrContextPointers.A4 = &pctx->A4;\n    pRD->volatileCurrContextPointers.A5 = &pctx->A5;\n    pRD->volatileCurrContextPointers.A6 = &pctx->A6;\n    pRD->volatileCurrContextPointers.A7 = &pctx->A7;\n    pRD->volatileCurrContextPointers.T0 = &pctx->T0;\n    pRD->volatileCurrContextPointers.T1 = &pctx->T1;\n    pRD->volatileCurrContextPointers.T2 = &pctx->T2;\n    pRD->volatileCurrContextPointers.T3 = &pctx->T3;\n    pRD->volatileCurrContextPointers.T4 = &pctx->T4;\n    pRD->volatileCurrContextPointers.T5 = &pctx->T5;\n    pRD->volatileCurrContextPointers.T6 = &pctx->T6;\n    pRD->volatileCurrContextPointers.T7 = &pctx->T7;\n    pRD->volatileCurrContextPointers.T8 = &pctx->T8;\n    pRD->volatileCurrContextPointers.X0 = &pctx->X0;\n#endif // TARGET_LOONGARCH64\n\n#ifdef DEBUG_REGDISPLAY\n    pRD->_pThread = NULL;\n#endif // DEBUG_REGDISPLAY\n\n    // This will setup the PC and SP\n    SyncRegDisplayToCurrentContext(pRD);\n#endif // !FEATURE_EH_FUNCLETS\n}\n\n// Initialize a new REGDISPLAY/CONTEXT pair from an existing valid REGDISPLAY.\ninline void CopyRegDisplay(const PREGDISPLAY pInRD, PREGDISPLAY pOutRD, T_CONTEXT *pOutCtx)\n{\n    WRAPPER_NO_CONTRACT;\n\n    // The general strategy is to extract the register state from the input REGDISPLAY\n    // into the new CONTEXT then simply call FillRegDisplay.\n\n    T_CONTEXT* pOutCallerCtx = NULL;\n\n#ifndef FEATURE_EH_FUNCLETS\n\n#if defined(TARGET_X86)\n    if (pInRD->pEdi != NULL) {pOutCtx->Edi = *pInRD->pEdi;} else {pInRD->pEdi = NULL;}\n    if (pInRD->pEsi != NULL) {pOutCtx->Esi = *pInRD->pEsi;} else {pInRD->pEsi = NULL;}\n    if (pInRD->pEbx != NULL) {pOutCtx->Ebx = *pInRD->pEbx;} else {pInRD->pEbx = NULL;}\n    if (pInRD->pEbp != NULL) {pOutCtx->Ebp = *pInRD->pEbp;} else {pInRD->pEbp = NULL;}\n    if (pInRD->pEax != NULL) {pOutCtx->Eax = *pInRD->pEax;} else {pInRD->pEax = NULL;}\n    if (pInRD->pEcx != NULL) {pOutCtx->Ecx = *pInRD->pEcx;} else {pInRD->pEcx = NULL;}\n    if (pInRD->pEdx != NULL) {pOutCtx->Edx = *pInRD->pEdx;} else {pInRD->pEdx = NULL;}\n    pOutCtx->Esp = pInRD->SP;\n    pOutCtx->Eip = pInRD->ControlPC;\n#else // TARGET_X86\n    PORTABILITY_ASSERT(\"CopyRegDisplay\");\n#endif // _TARGET_???_\n\n#else // FEATURE_EH_FUNCLETS\n\n    *pOutCtx = *(pInRD->pCurrentContext);\n    if (pInRD->IsCallerContextValid)\n    {\n        pOutCallerCtx = pInRD->pCallerContext;\n    }\n\n#endif // FEATURE_EH_FUNCLETS\n\n    if (pOutRD)\n        FillRegDisplay(pOutRD, pOutCtx, pOutCallerCtx);\n}\n\n// Get address of a register in a CONTEXT given the reg number. For X86,\n// the reg number is the R/M number from ModR/M byte or base in SIB byte\ninline size_t * getRegAddr (unsigned regNum, PTR_CONTEXT regs)\n{\n#ifdef TARGET_X86\n    _ASSERTE(regNum < 8);\n\n    static const SIZE_T OFFSET_OF_REGISTERS[] =\n    {\n        offsetof(CONTEXT, Eax),\n        offsetof(CONTEXT, Ecx),\n        offsetof(CONTEXT, Edx),\n        offsetof(CONTEXT, Ebx),\n        offsetof(CONTEXT, Esp),\n        offsetof(CONTEXT, Ebp),\n        offsetof(CONTEXT, Esi),\n        offsetof(CONTEXT, Edi),\n    };\n\n    return (PTR_size_t)(PTR_BYTE(regs) + OFFSET_OF_REGISTERS[regNum]);\n#elif defined(TARGET_AMD64)\n    _ASSERTE(regNum < 16);\n    return (size_t *)&regs->Rax + regNum;\n#elif defined(TARGET_ARM)\n        _ASSERTE(regNum < 16);\n        return (size_t *)&regs->R0 + regNum;\n#elif defined(TARGET_ARM64)\n    _ASSERTE(regNum < 31);\n    return (size_t *)&regs->X0 + regNum;\n#elif defined(TARGET_LOONGARCH64)\n    _ASSERTE(regNum < 32);\n    return (size_t *)&regs->R0 + regNum;\n#else\n    _ASSERTE(!\"@TODO Port - getRegAddr (Regdisp.h)\");\n#endif\n    return(0);\n}\n\n//---------------------------------------------------------------------------------------\n//\n// This is just a simpler helper function to convert a REGDISPLAY to a CONTEXT.\n//\n// Arguments:\n//    pRegDisp - the REGDISPLAY to be converted\n//    pContext - the buffer for storing the converted CONTEXT\n//\ninline void UpdateContextFromRegDisp(PREGDISPLAY pRegDisp, PT_CONTEXT pContext)\n{\n    _ASSERTE((pRegDisp != NULL) && (pContext != NULL));\n\n#ifndef FEATURE_EH_FUNCLETS\n\n#if defined(TARGET_X86)\n    pContext->ContextFlags = (CONTEXT_INTEGER | CONTEXT_CONTROL);\n    pContext->Edi = *pRegDisp->pEdi;\n    pContext->Esi = *pRegDisp->pEsi;\n    pContext->Ebx = *pRegDisp->pEbx;\n    pContext->Ebp = *pRegDisp->pEbp;\n    pContext->Eax = *pRegDisp->pEax;\n    pContext->Ecx = *pRegDisp->pEcx;\n    pContext->Edx = *pRegDisp->pEdx;\n    pContext->Esp = pRegDisp->SP;\n    pContext->Eip = pRegDisp->ControlPC;\n#else // TARGET_X86\n    PORTABILITY_ASSERT(\"UpdateContextFromRegDisp\");\n#endif // _TARGET_???_\n\n#else // FEATURE_EH_FUNCLETS\n\n    *pContext = *pRegDisp->pCurrentContext;\n\n#endif // FEATURE_EH_FUNCLETS\n}\n\n\n#endif  // __REGDISP_H\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/releaseholder.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// This class acts a smart pointer which calls the Release method on any object\n// you place in it when the ReleaseHolder class falls out of scope.  You may use it\n// just like you would a standard pointer to a COM object (including if (foo),\n// if (!foo), if (foo == 0), etc) except for two caveats:\n//     1. This class never calls AddRef and it always calls Release when it\n//        goes out of scope.\n//     2. You should never use & to try to get a pointer to a pointer unless\n//        you call Release first, or you will leak whatever this object contains\n//        prior to updating its internal pointer.\ntemplate<class T>\nclass ReleaseHolder\n{\npublic:\n    ReleaseHolder()\n        : m_ptr(NULL)\n    {}\n\n    ReleaseHolder(T* ptr)\n        : m_ptr(ptr)\n    {}\n\n    ~ReleaseHolder()\n    {\n        Release();\n    }\n\n    void operator=(T *ptr)\n    {\n        Release();\n\n        m_ptr = ptr;\n    }\n\n    T* operator->()\n    {\n        return m_ptr;\n    }\n\n    operator T*()\n    {\n        return m_ptr;\n    }\n\n    T** operator&()\n    {\n        return &m_ptr;\n    }\n\n    T* GetPtr() const\n    {\n        return m_ptr;\n    }\n\n    T* Detach()\n    {\n        T* pT = m_ptr;\n        m_ptr = NULL;\n        return pT;\n    }\n\n    void Release()\n    {\n        if (m_ptr != NULL)\n        {\n            m_ptr->Release();\n            m_ptr = NULL;\n        }\n    }\n\nprivate:\n    T* m_ptr;\n};\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/safemath.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// safemath.h\n//\n// overflow checking infrastructure\n// ---------------------------------------------------------------------------\n\n\n#ifndef SAFEMATH_H_\n#define SAFEMATH_H_\n\n// This file is included from several places outside the CLR, so we can't\n// pull in files like DebugMacros.h.  However, we assume that the standard\n// clrtypes (UINT32 etc.) are defined.\n#include \"debugmacrosext.h\"\n\n#ifndef _ASSERTE_SAFEMATH\n#ifdef _ASSERTE\n// Use _ASSERTE if we have it (should always be the case in the CLR)\n#define _ASSERTE_SAFEMATH _ASSERTE\n#else\n// Otherwise (eg. we're being used from a tool like SOS) there isn't much\n// we can rely on that is available everywhere.  In\n// several other tools we just take the recourse of disabling asserts,\n// we'll do the same here.\n// Ideally we'd have a collection of common utilities available everywhere.\n#define _ASSERTE_SAFEMATH(a)\n#endif\n#endif\n\n#include \"static_assert.h\"\n\n#ifdef PAL_STDCPP_COMPAT\n#include <type_traits>\n#else\n#include \"clr_std/type_traits\"\n#endif\n\n//==================================================================\n// Semantics: if val can be represented as the exact same value\n// when cast to Dst type, then FitsIn<Dst>(val) will return true;\n// otherwise FitsIn returns false.\n//\n// Dst and Src must both be integral types.\n//\n// It's important to note that most of the conditionals in this\n// function are based on static type information and as such will\n// be optimized away. In particular, the case where the signs are\n// identical will result in no code branches.\n\n#ifdef _PREFAST_\n#pragma warning(push)\n#pragma warning(disable:6326) // PREfast warning: Potential comparison of a constant with another constant\n#endif // _PREFAST_\n\ntemplate <typename Dst, typename Src>\ninline bool FitsIn(Src val)\n{\n#ifdef _MSC_VER\n    static_assert_no_msg(!__is_class(Dst));\n    static_assert_no_msg(!__is_class(Src));\n#endif\n\n    if (std::is_signed<Src>::value == std::is_signed<Dst>::value)\n    {   // Src and Dst are equally signed\n        if (sizeof(Src) <= sizeof(Dst))\n        {   // No truncation is possible\n            return true;\n        }\n        else\n        {   // Truncation is possible, requiring runtime check\n            return val == (Src)((Dst)val);\n        }\n    }\n    else if (std::is_signed<Src>::value)\n    {   // Src is signed, Dst is unsigned\n#ifdef __GNUC__\n        // Workaround for GCC warning: \"comparison is always\n        // false due to limited range of data type.\"\n        if (!(val == 0 || val > 0))\n#else\n        if (val < 0)\n#endif\n        {   // A negative number cannot be represented by an unsigned type\n            return false;\n        }\n        else\n        {\n            if (sizeof(Src) <= sizeof(Dst))\n            {   // No truncation is possible\n                return true;\n            }\n            else\n            {   // Truncation is possible, requiring runtime check\n                return val == (Src)((Dst)val);\n            }\n        }\n    }\n    else\n    {   // Src is unsigned, Dst is signed\n        if (sizeof(Src) < sizeof(Dst))\n        {   // No truncation is possible. Note that Src is strictly\n            // smaller than Dst.\n            return true;\n        }\n        else\n        {   // Truncation is possible, requiring runtime check\n#ifdef __GNUC__\n            // Workaround for GCC warning: \"comparison is always\n            // true due to limited range of data type.\" If in fact\n            // Dst were unsigned we'd never execute this code\n            // anyway.\n            return ((Dst)val > 0 || (Dst)val == 0) &&\n#else\n            return ((Dst)val >= 0) &&\n#endif\n                   (val == (Src)((Dst)val));\n        }\n    }\n}\n\n// Requires that Dst is an integral type, and that DstMin and DstMax are the\n// minimum and maximum values of that type, respectively.  Returns \"true\" iff\n// \"val\" can be represented in the range [DstMin..DstMax] (allowing loss of precision, but\n// not truncation).\ntemplate <INT64 DstMin, UINT64 DstMax>\ninline bool FloatFitsInIntType(float val)\n{\n    float DstMinF = static_cast<float>(DstMin);\n    float DstMaxF = static_cast<float>(DstMax);\n    return DstMinF <= val && val <= DstMaxF;\n}\n\ntemplate <INT64 DstMin, UINT64 DstMax>\ninline bool DoubleFitsInIntType(double val)\n{\n    double DstMinD = static_cast<double>(DstMin);\n    double DstMaxD = static_cast<double>(DstMax);\n    return DstMinD <= val && val <= DstMaxD;\n}\n\n#ifdef _PREFAST_\n#pragma warning(pop)\n#endif //_PREFAST_\n\n#define ovadd_lt(a, b, rhs) (((a) + (b) <  (rhs) ) && ((a) + (b) >= (a)))\n#define ovadd_le(a, b, rhs) (((a) + (b) <= (rhs) ) && ((a) + (b) >= (a)))\n#define ovadd_gt(a, b, rhs) (((a) + (b) >  (rhs) ) || ((a) + (b) < (a)))\n#define ovadd_ge(a, b, rhs) (((a) + (b) >= (rhs) ) || ((a) + (b) < (a)))\n\n#define ovadd3_gt(a, b, c, rhs) (((a) + (b) + (c) > (rhs)) || ((a) + (b) < (a)) || ((a) + (b) + (c) < (c)))\n\n\n //-----------------------------------------------------------------------------\n//\n// Liberally lifted from https://github.com/dcleblanc/SafeInt and modified.\n//\n// Modified to track an overflow bit instead of throwing exceptions.  In most\n// cases the Visual C++ optimizer (Whidbey beta1 - v14.00.40607) is able to\n// optimize the bool away completely.\n// Note that using a sentinel value (IntMax for example) to represent overflow\n// actually results in poorer code-gen.\n//\n// This has also been simplified significantly to remove functionality we\n// don't currently want (division, implicit conversions, many additional operators etc.)\n//\n// Example:\n//   unsafe: UINT32 bufSize = headerSize + elementCount * sizeof(void*);\n//   becomes:\n//      S_UINT32 bufSize = S_UINT32(headerSize) + S_UINT32(elementCount) *\n//                                          S_UINT32( sizeof(void*) );\n//      if( bufSize.IsOverflow() ) { <overflow-error> }\n//      else { use bufSize.Value() }\n//   or:\n//      UINT32 tmp, bufSize;\n//      if( !ClrSafeInt<UINT32>::multiply( elementCount, sizeof(void*), tmp ) ||\n//              !ClrSafeInt<UINT32>::addition( tmp, headerSize, bufSize ) )\n//      { <overflow-error> }\n//      else { use bufSize }\n//\n//-----------------------------------------------------------------------------\n// TODO: Any way to prevent unintended instantiations?  This is only designed to\n//  work with unsigned integral types (signed types will work but we probably\n//  don't need signed support).\ntemplate<typename T> class ClrSafeInt\n{\npublic:\n    // Default constructor - 0 value by default\n    ClrSafeInt() :\n        m_value(0),\n        m_overflow(false)\n        COMMA_INDEBUG( m_checkedOverflow( false ) )\n    {\n    }\n\n    // Value constructor\n    // This is explicit because otherwise it would be harder to\n    // differentiate between checked and unchecked usage of an operator.\n    // I.e. si + x + y  vs. si + ( x + y )\n    //\n    // Set the m_checkedOverflow bit to true since this is being initialized\n    // with a constant value and we know that it is valid. A scenario in\n    // which this is useful is when an overflow causes a fallback value to\n    // be used:\n    //      if (val.IsOverflow())\n    //          val = ClrSafeInt<T>(some_value);\n    explicit ClrSafeInt( T v ) :\n        m_value(v),\n        m_overflow(false)\n        COMMA_INDEBUG( m_checkedOverflow( true ) )\n    {\n    }\n\n    template <typename U>\n    explicit ClrSafeInt(U u) :\n        m_value(0),\n        m_overflow(false)\n        COMMA_INDEBUG( m_checkedOverflow( false ) )\n    {\n        if (!FitsIn<T>(u))\n        {\n            m_overflow = true;\n        }\n        else\n        {\n            m_value = (T)u;\n        }\n    }\n\n    template <typename U>\n    ClrSafeInt(ClrSafeInt<U> u) :\n        m_value(0),\n        m_overflow(false)\n        COMMA_INDEBUG( m_checkedOverflow( false ) )\n    {\n        if (u.IsOverflow() || !FitsIn<T>(u.Value()))\n        {\n            m_overflow = true;\n        }\n        else\n        {\n            m_value = (T)u.Value();\n    }\n    }\n\n    // Note: compiler-generated copy constructor and assignment operator\n    // are correct for our purposes.\n\n    // Note: The MS compiler will sometimes silently perform value-destroying\n    // conversions when calling the operators below.\n    // Eg. \"ClrSafeInt<unsigned> s(0); s += int(-1);\" will result in s\n    // having the value 0xffffffff without generating a compile-time warning.\n    // Narrowing conversions are generally level 4 warnings so may or may not\n    // be visible.\n    //\n    // In the original SafeInt class, all operators have an\n    // additional overload that takes an arbitrary type U and then safe\n    // conversions are performed (resulting in overflow whenever the value\n    // cannot be preserved).\n    // We could do the same thing, but currently don't because:\n    //  - we don't believe there are common cases where this would result in a\n    //    security hole.\n    //  - the extra complexity isn't worth the benefits\n    //  - it would prevent compiler warnings in the cases we do get warnings for.\n\n\n    // true if there has been an overflow leading up to the creation of this\n    // value, false otherwise.\n    // Note that in debug builds we track whether our client called this,\n    // so we should not be calling this method ourselves from within this class.\n    inline bool IsOverflow() const\n    {\n        INDEBUG( m_checkedOverflow = true; )\n        return m_overflow;\n    }\n\n    // Get the value of this integer.\n    // Must only be called when IsOverflow()==false.  If this is called\n    // on overflow we'll assert in Debug and return 0 in release.\n    inline T Value() const\n    {\n        _ASSERTE_SAFEMATH( m_checkedOverflow );  // Ensure our caller first checked the overflow bit\n        _ASSERTE_SAFEMATH( !m_overflow );\n        return m_value;\n    }\n\n    // force the value into the overflow state.\n    inline void SetOverflow()\n    {\n        INDEBUG( this->m_checkedOverflow = false; )\n        this->m_overflow = true;\n        // incase someone manages to call Value in release mode - should be optimized out\n        this->m_value = 0;\n    }\n\n\n    //\n    // OPERATORS\n    //\n\n    // Addition and multiplication.  Only permitted when both sides are explicitly\n    // wrapped inside of a ClrSafeInt and when the types match exactly.\n    // If we permitted a RHS of type 'T', then there would be differences\n    // in correctness between mathematically equivalent expressions such as\n    // \"si + x + y\" and \"si + ( x + y )\".  Unfortunately, not permitting this\n    // makes expressions involving constants tedius and ugly since the constants\n    // must be wrapped in ClrSafeInt instances.  If we become confident that\n    // our tools (PreFast) will catch all integer overflows, then we can probably\n    // safely add this.\n    inline ClrSafeInt<T> operator +(ClrSafeInt<T> rhs) const\n    {\n        ClrSafeInt<T> result;       // value is initialized to 0\n        if( this->m_overflow ||\n            rhs.m_overflow ||\n            !addition( this->m_value, rhs.m_value, result.m_value ) )\n        {\n            result.m_overflow = true;\n        }\n\n        return result;\n    }\n\n    inline ClrSafeInt<T> operator -(ClrSafeInt<T> rhs) const\n    {\n        ClrSafeInt<T> result;       // value is initialized to 0\n        if( this->m_overflow ||\n            rhs.m_overflow ||\n            !subtraction( this->m_value, rhs.m_value, result.m_value ) )\n        {\n            result.m_overflow = true;\n        }\n\n        return result;\n    }\n\n    inline ClrSafeInt<T> operator *(ClrSafeInt<T> rhs) const\n    {\n        ClrSafeInt<T> result;       // value is initialized to 0\n        if( this->m_overflow ||\n            rhs.m_overflow ||\n            !multiply( this->m_value, rhs.m_value, result.m_value ) )\n        {\n            result.m_overflow = true;\n        }\n\n        return result;\n    }\n\n    // Accumulation operators\n    // Here it's ok to have versions that take a value of type 'T', however we still\n    // don't allow any mixed-type operations.\n    inline ClrSafeInt<T>& operator +=(ClrSafeInt<T> rhs)\n    {\n        INDEBUG( this->m_checkedOverflow = false; )\n        if( this->m_overflow ||\n            rhs.m_overflow ||\n            !ClrSafeInt<T>::addition( this->m_value, rhs.m_value, this->m_value ) )\n        {\n            this->SetOverflow();\n        }\n        return *this;\n    }\n\n    inline ClrSafeInt<T>& operator +=(T rhs)\n    {\n        INDEBUG( this->m_checkedOverflow = false; )\n        if( this->m_overflow ||\n            !ClrSafeInt<T>::addition( this->m_value, rhs, this->m_value ) )\n        {\n            this->SetOverflow();\n        }\n        return *this;\n    }\n\n    inline ClrSafeInt<T>& operator *=(ClrSafeInt<T> rhs)\n    {\n        INDEBUG( this->m_checkedOverflow = false; )\n        if( this->m_overflow ||\n            rhs.m_overflow ||\n            !ClrSafeInt<T>::multiply( this->m_value, rhs.m_value, this->m_value ) )\n        {\n            this->SetOverflow();\n        }\n        return *this;\n    }\n\n    inline ClrSafeInt<T>& operator *=(T rhs)\n    {\n        INDEBUG( this->m_checkedOverflow = false; )\n        if( this->m_overflow ||\n            !ClrSafeInt<T>::multiply( this->m_value, rhs, this->m_value ) )\n        {\n            this->SetOverflow();\n        }\n\n        return *this;\n    }\n\n    //\n    // STATIC HELPER METHODS\n    //these compile down to something as efficient as macros and allow run-time testing\n    //of type by the developer\n    //\n\n    template <typename U> static bool IsSigned(U)\n    {\n        return std::is_signed<U>::value;\n    }\n\n    static bool IsSigned()\n    {\n        return std::is_signed<T>::value;\n    }\n\n    static bool IsMixedSign(T lhs, T rhs)\n    {\n        return ((lhs ^ rhs) < 0);\n    }\n\n    static unsigned char BitCount(){return (sizeof(T)*8);}\n\n    static bool Is64Bit(){return sizeof(T) == 8;}\n    static bool Is32Bit(){return sizeof(T) == 4;}\n    static bool Is16Bit(){return sizeof(T) == 2;}\n    static bool Is8Bit(){return sizeof(T) == 1;}\n\n    //both of the following should optimize away\n    static T MaxInt()\n    {\n        if(IsSigned())\n        {\n            return (T)~((T)1 << (BitCount()-1));\n        }\n        //else\n        return (T)(~(T)0);\n    }\n\n    static T MinInt()\n    {\n        if(IsSigned())\n        {\n            return (T)((T)1 << (BitCount()-1));\n        }\n        else\n        {\n            return ((T)0);\n        }\n    }\n\n    // Align a value up to the nearest boundary, which must be a power of 2\n    inline void AlignUp( T alignment )\n    {\n        _ASSERTE_SAFEMATH( IsPowerOf2( alignment ) );\n        *this += (alignment - 1);\n        if( !this->m_overflow )\n        {\n            m_value &= ~(alignment - 1);\n        }\n    }\n\n    //\n    // Arithmetic implementation functions\n    //\n\n    //note - this looks complex, but most of the conditionals\n    //are constant and optimize away\n    //for example, a signed 64-bit check collapses to:\n/*\n    if(lhs == 0 || rhs == 0)\n        return 0;\n\n    if(MaxInt()/+lhs < +rhs)\n    {\n        //overflow\n        throw SafeIntException(ERROR_ARITHMETIC_OVERFLOW);\n    }\n    //ok\n    return lhs * rhs;\n\n    Which ought to inline nicely\n*/\n    // Returns true if safe, false for overflow.\n    static bool multiply(T lhs, T rhs, T &result)\n    {\n        if(Is64Bit())\n        {\n            //we're 64 bit - slow, but the only way to do it\n            if(IsSigned())\n            {\n                return ClrSafeInt<int64_t>::multiply((int64_t)lhs, (int64_t)rhs, (int64_t&)result);\n            }\n            else\n            {\n                return ClrSafeInt<uint64_t>::multiply((uint64_t)lhs, (uint64_t)rhs, (uint64_t&)result);\n            }\n        }\n        else if(Is32Bit())\n        {\n            //we're 32-bit\n            if(IsSigned())\n            {\n                return ClrSafeInt<int32_t>::multiply((int32_t)lhs, (int32_t)rhs, (int32_t&)result);\n            }\n            else\n            {\n                return ClrSafeInt<uint32_t>::multiply((uint32_t)lhs, (uint32_t)rhs, (uint32_t&)result);\n            }\n        }\n        else if(Is16Bit())\n        {\n            //16-bit\n            if(IsSigned())\n            {\n                return ClrSafeInt<int16_t>::multiply((int16_t)lhs, (int16_t)rhs, (int16_t&)result);\n            }\n            else\n            {\n                return ClrSafeInt<uint16_t>::multiply((uint16_t)lhs, (uint16_t)rhs, (uint16_t&)result);\n            }\n        }\n        else //8-bit\n        {\n            _ASSERTE_SAFEMATH(Is8Bit());\n            if(IsSigned())\n            {\n                return ClrSafeInt<int8_t>::multiply((int8_t)lhs, (int8_t)rhs, (int8_t&)result);\n            }\n            else\n            {\n                return ClrSafeInt<uint8_t>::multiply((uint8_t)lhs, (uint8_t)rhs, (uint8_t&)result);\n            }\n        }\n    }\n\n    // Returns true if safe, false on overflow\n    static inline bool addition(T lhs, T rhs, T &result)\n    {\n        if(IsSigned())\n        {\n            //test for +/- combo\n            if(!IsMixedSign(lhs, rhs))\n            {\n                //either two negatives, or 2 positives\n#ifdef __GNUC__\n                // Workaround for GCC warning: \"comparison is always\n                // false due to limited range of data type.\"\n                if (!(rhs == 0 || rhs > 0))\n#else\n                if(rhs < 0)\n#endif // __GNUC__ else\n                {\n                    //two negatives\n                    if(lhs < (T)(MinInt() - rhs)) //remember rhs < 0\n                    {\n                        return false;\n                    }\n                    //ok\n                }\n                else\n                {\n                    //two positives\n                    if((T)(MaxInt() - lhs) < rhs)\n                    {\n                        return false;\n                    }\n                    //OK\n                }\n            }\n            //else overflow not possible\n            result = lhs + rhs;\n            return true;\n        }\n        else //unsigned\n        {\n            if((T)(MaxInt() - lhs) < rhs)\n            {\n                return false;\n\n            }\n            result = lhs + rhs;\n            return true;\n        }\n    }\n\n    // Returns true if safe, false on overflow\n    static inline bool subtraction(T lhs, T rhs, T& result)\n    {\n        T tmp = lhs - rhs;\n\n        if(IsSigned())\n        {\n            if(IsMixedSign(lhs, rhs)) //test for +/- combo\n            {\n                //mixed positive and negative\n                //two cases - +X - -Y => X + Y - check for overflow against MaxInt()\n                //            -X - +Y - check for overflow against MinInt()\n\n                if(lhs >= 0) //first case\n                {\n                    //test is X - -Y > MaxInt()\n                    //equivalent to X > MaxInt() - |Y|\n                    //Y == MinInt() creates special case\n                    //Even 0 - MinInt() can't be done\n                    //note that the special case collapses into the general case, due to the fact\n                    //MaxInt() - MinInt() == -1, and lhs is non-negative\n                    //OR tmp should be GTE lhs\n\n                    // old test - leave in for clarity\n                    //if(lhs > (T)(MaxInt() + rhs)) //remember that rhs is negative\n                    if(tmp < lhs)\n                    {\n                        return false;\n                    }\n                    //fall through to return value\n                }\n                else\n                {\n                    //second case\n                    //test is -X - Y < MinInt()\n                    //or      -X < MinInt() + Y\n                    //we do not have the same issues because abs(MinInt()) > MaxInt()\n                    //tmp should be LTE lhs\n\n                    //if(lhs < (T)(MinInt() + rhs)) // old test - leave in for clarity\n                    if(tmp > lhs)\n                    {\n                        return false;\n                    }\n                    //fall through to return value\n                }\n            }\n            // else\n            //both negative, or both positive\n            //no possible overflow\n            result = tmp;\n            return true;\n        }\n        else\n        {\n            //easy unsigned case\n            if(lhs < rhs)\n            {\n                return false;\n            }\n            result = tmp;\n            return true;\n        }\n    }\n\nprivate:\n    // Private helper functions\n    // Note that's it occasionally handy to call the arithmetic implementation\n    // functions above so we leave them public, even though we almost always use\n    // the operators instead.\n\n    // True if the specified value is a power of two.\n    static inline bool IsPowerOf2( T x )\n    {\n        // find the smallest power of 2 >= x\n        T testPow = 1;\n        while( testPow < x )\n        {\n            testPow = testPow << 1;           // advance to next power of 2\n            if( testPow <= 0 )\n            {\n                return false;       // overflow\n            }\n        }\n\n        return( testPow == x );\n    }\n\n    //\n    // Instance data\n    //\n\n    // The integer value this instance represents, or 0 if overflow.\n     T m_value;\n\n    // True if overflow has been reached.  Once this is set, it cannot be cleared.\n    bool m_overflow;\n\n    // In debug builds we verify that our caller checked the overflow bit before\n    // accessing the value.  This flag is cleared on initialization, and whenever\n    // m_value or m_overflow changes, and set only when IsOverflow\n    // is called.\n    INDEBUG( mutable bool m_checkedOverflow; )\n};\n\ntemplate <>\ninline bool ClrSafeInt<int64_t>::multiply(int64_t lhs, int64_t rhs, int64_t &result)\n{\n    //fast track this one - and avoid DIV_0 below\n    if(lhs == 0 || rhs == 0)\n    {\n        result = 0;\n        return true;\n    }\n    if(!IsMixedSign(lhs, rhs))\n    {\n        //both positive or both negative\n        //result will be positive, check for lhs * rhs > MaxInt\n        if(lhs > 0)\n        {\n            //both positive\n            if(MaxInt()/lhs < rhs)\n            {\n                //overflow\n                return false;\n            }\n        }\n        else\n        {\n            //both negative\n\n            //comparison gets tricky unless we force it to positive\n            //EXCEPT that -MinInt is undefined - can't be done\n            //And MinInt always has a greater magnitude than MaxInt\n            if(lhs == MinInt() || rhs == MinInt())\n            {\n                //overflow\n                return false;\n            }\n            if(MaxInt()/(-lhs) < (-rhs) )\n            {\n                //overflow\n                return false;\n            }\n        }\n    }\n    else\n    {\n        //mixed sign - this case is difficult\n        //test case is lhs * rhs < MinInt => overflow\n        //if lhs < 0 (implies rhs > 0),\n        //lhs < MinInt/rhs is the correct test\n        //else if lhs > 0\n        //rhs < MinInt/lhs is the correct test\n        //avoid dividing MinInt by a negative number,\n        //because MinInt/-1 is a corner case\n\n        if(lhs < 0)\n        {\n            if(lhs < MinInt()/rhs)\n            {\n                //overflow\n                return false;\n            }\n        }\n        else\n        {\n            if(rhs < MinInt()/lhs)\n            {\n                //overflow\n                return false;\n            }\n        }\n    }\n\n    //ok\n    result = lhs * rhs;\n    return true;\n}\n\ntemplate <>\ninline bool ClrSafeInt<uint64_t>::multiply(uint64_t lhs, uint64_t rhs, uint64_t &result)\n{\n    //fast track this one - and avoid DIV_0 below\n    if(lhs == 0 || rhs == 0)\n    {\n        result = 0;\n        return true;\n    }\n    //unsigned, easy case\n    if(MaxInt()/lhs < rhs)\n    {\n        //overflow\n        return false;\n    }\n    //ok\n    result = lhs * rhs;\n    return true;\n}\n\ntemplate <>\ninline bool ClrSafeInt<int32_t>::multiply(int32_t lhs, int32_t rhs, int32_t &result)\n{\n    INT64 tmp = (INT64)lhs * (INT64)rhs;\n\n    //upper 33 bits must be the same\n    //most common case is likely that both are positive - test first\n    if( (tmp & 0xffffffff80000000LL) == 0 ||\n        (tmp & 0xffffffff80000000LL) == 0xffffffff80000000LL)\n    {\n        //this is OK\n        result = (int32_t)tmp;\n        return true;\n    }\n\n    //overflow\n    return false;\n}\n\ntemplate <>\ninline bool ClrSafeInt<uint32_t>::multiply(uint32_t lhs, uint32_t rhs, uint32_t &result)\n{\n    UINT64 tmp = (UINT64)lhs * (UINT64)rhs;\n    if (tmp & 0xffffffff00000000ULL) //overflow\n    {\n        //overflow\n        return false;\n    }\n    result = (uint32_t)tmp;\n    return true;\n}\n\ntemplate <>\ninline bool ClrSafeInt<int16_t>::multiply(int16_t lhs, int16_t rhs, int16_t &result)\n{\n    INT32 tmp = (INT32)lhs * (INT32)rhs;\n    //upper 17 bits must be the same\n    //most common case is likely that both are positive - test first\n    if( (tmp & 0xffff8000) == 0 || (tmp & 0xffff8000) == 0xffff8000)\n    {\n        //this is OK\n        result = (int16_t)tmp;\n        return true;\n    }\n\n    //overflow\n    return false;\n}\n\ntemplate <>\ninline bool ClrSafeInt<uint16_t>::multiply(uint16_t lhs, uint16_t rhs, uint16_t &result)\n{\n    UINT32 tmp = (UINT32)lhs * (UINT32)rhs;\n    if (tmp & 0xffff0000) //overflow\n    {\n        return false;\n    }\n    result = (uint16_t)tmp;\n    return true;\n}\n\ntemplate <>\ninline bool ClrSafeInt<int8_t>::multiply(int8_t lhs, int8_t rhs, int8_t &result)\n{\n    INT16 tmp = (INT16)lhs * (INT16)rhs;\n    //upper 9 bits must be the same\n    //most common case is likely that both are positive - test first\n    if( (tmp & 0xff80) == 0 || (tmp & 0xff80) == 0xff80)\n    {\n        //this is OK\n        result = (int8_t)tmp;\n        return true;\n    }\n\n    //overflow\n    return false;\n}\n\ntemplate <>\ninline bool ClrSafeInt<uint8_t>::multiply(uint8_t lhs, uint8_t rhs, uint8_t &result)\n{\n    UINT16 tmp = ((UINT16)lhs) * ((UINT16)rhs);\n\n    if (tmp & 0xff00) //overflow\n    {\n        return false;\n    }\n    result = (uint8_t)tmp;\n    return true;\n}\n\n// Allows creation of a ClrSafeInt corresponding to the type of the argument.\ntemplate <typename T>\nClrSafeInt<T> AsClrSafeInt(T t)\n{\n    return ClrSafeInt<T>(t);\n}\n\ntemplate <typename T>\nClrSafeInt<T> AsClrSafeInt(ClrSafeInt<T> t)\n{\n    return t;\n}\n\n// Convenience safe-integer types.  Currently these are the only types\n// we are using ClrSafeInt with.  We may want to add others.\n// These type names are based on our standardized names in clrtypes.h\ntypedef ClrSafeInt<UINT8> S_UINT8;\ntypedef ClrSafeInt<UINT16> S_UINT16;\n//typedef ClrSafeInt<UINT32> S_UINT32;\n#define S_UINT32 ClrSafeInt<UINT32>\ntypedef ClrSafeInt<UINT64> S_UINT64;\ntypedef ClrSafeInt<SIZE_T> S_SIZE_T;\n\n #endif // SAFEMATH_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/safewrap.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// SafeWrap.h\n//\n\n//\n// This file contains wrapper functions for Win32 API's that take SStrings\n// and use CLR-safe holders.\n//*****************************************************************************\n\n\n/*\n    Guidelines for SafeWrapper APIs:\nMost of these are 'common-sense', plus a few arbitrary decisions thrown in for\nconsistency's sake.\n\n- THROWING: Throw on oom, but return all other failure codes.\n    The rationale here is that SString operations already throw, so to make these APIs\n    non-throwing would require an extra EX_TRY/EX_CATCH. Most callees will want to throw\n    on OOM anyways. So making these APIs non-throwing would mean an extra try/catch in\n    the caller + an extra check at the callee. We can eliminate that overhead and just make\n    it throwing.\n\n    Return non-oom failure codes because callees actually freqeuntly expect an API to fail.\n    For example, the callee will have special handling for file-not-found.\n\n    For convenience, you could add a no-throwing wrapper version of the API.\n\n- NAMING: Prefix the name with 'Clr', just like we do for win32 APIs going through hosting.\n\n- DON'T FORGET CONTRACTS: Most of these APIs will likely be Throws/GC_Notrigger.\n    Also use PRECONDITIONs + POSTCONDITIONS when possible.\n\n- SIGNATURES: Keep the method signture as close the original win32 API as possible.\n    - Preserve the return type + value. (except allow it to throw on oom). If the return value\n        should be a holder, then use that as an out-parameter at the end of the argument list.\n        We don't want to return holders because that will cause the dtors to be called.\n    - For input strings use 'const SString &' instead of 'LPCWSTR'.\n    - Change ('out' string, length) pairs to 'SString &' (this is the convention the rest of the CLR uses for SStrings)\n    - Use Holders where appropriate.\n    - Preserve other parameters.\n\n- USE SSTRINGS TO AVOID BUFFER OVERRUN ISSUES: Repeated here for emphasis. Use SStrings when\n    applicable to make it very easy to verify the code does not have buffer overruns.\n    This will also simplify callsites from having to figure out the length of the output string.\n\n- USE YOUR BEST JUDGEMENT: The primary goal of these API wrappers is to embrace 'security-safe' practices.\n    Certainly take any additional steps to that goal. For example, it may make sense to eliminate\n    corner case inputs for a given API or to break a single confusing API up into several discrete and\n    move obvious APIs.\n\n*/\n#ifndef _safewrap_h_\n#define _safewrap_h_\n\n#include \"holder.h\"\n\n/* --------------------------------------------------------------------------- *\n * Simple wrapper around RegisterEventSource/ReportEvent/DeregisterEventSource\n * --------------------------------------------------------------------------- */\n// Returns ERROR_SUCCESS if succeessful in reporting to event log, or\n// Windows error code to indicate the specific error.\nDWORD ClrReportEvent(\n    LPCWSTR     pEventSource,\n    WORD        wType,\n    WORD        wCategory,\n    DWORD       dwEventID,\n    PSID        lpUserSid,\n    WORD        wNumStrings,\n    LPCWSTR     *lpStrings,\n    DWORD       dwDataSize = 0,\n    LPVOID      lpRawData = NULL);\n\nDWORD ClrReportEvent(\n    LPCWSTR     pEventSource,\n    WORD        wType,\n    WORD        wCategory,\n    DWORD       dwEventID,\n    PSID        lpUserSid,\n    LPCWSTR     pMessage);\n\n//*****************************************************************************\n// This provides a wrapper around GetFileSize() that forces it to fail\n// if the file is >4g and pdwHigh is NULL. Other than that, it acts like\n// the genuine GetFileSize().\n//\n//\n//*****************************************************************************\nDWORD inline SafeGetFileSize(HANDLE hFile, DWORD *pdwHigh)\n{\n    if (pdwHigh != NULL)\n    {\n        return ::GetFileSize(hFile, pdwHigh);\n    }\n    else\n    {\n        DWORD hi;\n        DWORD lo = ::GetFileSize(hFile, &hi);\n        if (lo == 0xffffffff && GetLastError() != NO_ERROR)\n        {\n            return lo;\n        }\n        // api succeeded. is the file too large?\n        if (hi != 0)\n        {\n            // there isn't really a good error to set here...\n            SetLastError(ERROR_NOT_ENOUGH_MEMORY);\n            return 0xffffffff;\n        }\n\n        if (lo == 0xffffffff)\n        {\n            // note that a success return of (hi=0,lo=0xffffffff) will be\n            // treated as an error by the caller. Again, that's part of the\n            // price of being a slacker and not handling the high dword.\n            // We'll set a lasterror for them to pick up.\n            SetLastError(ERROR_NOT_ENOUGH_MEMORY);\n        }\n\n        return lo;\n    }\n\n}\n\n#endif // _safewrap_h_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sarray.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// --------------------------------------------------------------------------------\n// SArray.h\n// --------------------------------------------------------------------------------\n\n\n#ifndef _SARRAY_H_\n#define _SARRAY_H_\n\n#include \"sbuffer.h\"\n\n// --------------------------------------------------------------------------------\n// SArray is a typed array wrapper around an SBuffer.  It manages individual\n// constructors and destructors of array elements if avaiable, as well as providing\n// typed access.\n// --------------------------------------------------------------------------------\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY = TRUE>\nclass SArray\n{\n  private:\n\n    SBuffer m_buffer;\n\n    static COUNT_T VerifySizeRange(ELEMENT * begin, ELEMENT * end);\n\n  public:\n\n    class Iterator;\n    friend class Iterator;\n\n    SArray();\n    SArray(COUNT_T count);\n    SArray(ELEMENT * begin, ELEMENT * end);\n    ~SArray();\n\n    void Clear();\n    void Set(const SArray<ELEMENT, BITWISE_COPY> &array);\n\n    COUNT_T GetCount() const;\n    BOOL IsEmpty() const;\n\n    void SetCount(COUNT_T count);\n\n    COUNT_T GetAllocation() const;\n\n    void Preallocate(int count) const;\n    void Trim() const;\n\n    void Copy(const Iterator &to, const Iterator &from, COUNT_T size);\n    void Move(const Iterator &to, const Iterator &from, COUNT_T size);\n\n    void Copy(const Iterator &i, const ELEMENT *source, COUNT_T size);\n    void Copy(void *dest, const Iterator &i, COUNT_T size);\n\n    Iterator Append()\n    {\n        WRAPPER_NO_CONTRACT;\n\n        COUNT_T count = GetCount();\n        if ( GetAllocation() == count )\n            Preallocate( 2 * count );\n\n        Iterator i = End();\n        Insert(i);\n        return i;\n    }\n\n    void Append(ELEMENT elem)\n    {\n        WRAPPER_NO_CONTRACT;\n        *Append() = elem;\n    }\n\n    ELEMENT AppendEx(ELEMENT elem)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        *Append() = elem;\n        return elem;\n    }\n\n    void Insert(const Iterator &i);\n    void Delete(const Iterator &i);\n\n    void Insert(const Iterator &i, COUNT_T count);\n    void Delete(const Iterator &i, COUNT_T count);\n\n    void Replace(const Iterator &i, COUNT_T deleteCount, COUNT_T insertCount);\n\n    ELEMENT *OpenRawBuffer(COUNT_T maxElementCount);\n    ELEMENT *OpenRawBuffer();\n    void CloseRawBuffer(COUNT_T actualElementCount);\n    void CloseRawBuffer();\n\n    Iterator Begin()\n    {\n        WRAPPER_NO_CONTRACT;\n        return Iterator(this, 0);\n    }\n\n    Iterator End()\n    {\n        WRAPPER_NO_CONTRACT;\n        return Iterator(this, GetCount());\n    }\n\n    Iterator operator+(COUNT_T index)\n    {\n        return Iterator(this, index);\n    }\n\n    ELEMENT & operator[] (int index);\n    const ELEMENT & operator[] (int index) const;\n\n    ELEMENT & operator[] (COUNT_T index);\n    const ELEMENT & operator[] (COUNT_T index) const;\n\n protected:\n    SArray(void *prealloc, COUNT_T size);\n\n public:\n\n    class EMPTY_BASES_DECL Iterator : public CheckedIteratorBase<SArray<ELEMENT, BITWISE_COPY> >,\n                                      public Indexer<ELEMENT, Iterator>\n    {\n        friend class SArray;\n        friend class Indexer<ELEMENT, Iterator>;\n\n        SBuffer::Iterator m_i;\n\n      public:\n\n        Iterator(SArray *array, SCOUNT_T index)\n          : CheckedIteratorBase<SArray<ELEMENT, BITWISE_COPY> >(array)\n        {\n            WRAPPER_NO_CONTRACT;\n            m_i = array->m_buffer.Begin() + index*sizeof(ELEMENT);\n        }\n\n    protected:\n\n        ELEMENT &GetAt(SCOUNT_T delta) const\n        {\n            LIMITED_METHOD_CONTRACT;\n            return * (ELEMENT *) &m_i[delta*sizeof(ELEMENT)];\n        }\n\n        void Skip(SCOUNT_T delta)\n        {\n            LIMITED_METHOD_CONTRACT;\n            m_i += delta*sizeof(ELEMENT);\n        }\n\n        COUNT_T Subtract(const Iterator &i) const\n        {\n            LIMITED_METHOD_CONTRACT;\n            return (m_i - i.m_i)/sizeof(ELEMENT);\n        }\n\n        CHECK DoCheck(SCOUNT_T delta) const\n        {\n            WRAPPER_NO_CONTRACT;\n            return m_i.CheckIndex(delta*sizeof(ELEMENT));\n        }\n\n      public:\n\n        CHECK Check() const\n        {\n            WRAPPER_NO_CONTRACT;\n            return m_i.Check();\n        }\n    };\n\n    ELEMENT *GetElements() const;\n\n  private:\n\n    //--------------------------------------------------------------------\n    // Routines for managing the buffer content.\n    //--------------------------------------------------------------------\n\n    void ConstructBuffer(const Iterator &i, COUNT_T size);\n    void CopyConstructBuffer(const Iterator &i, COUNT_T size, const ELEMENT *from);\n    void DestructBuffer(const Iterator &i, COUNT_T size);\n};\n\n// ================================================================================\n// InlineSArray : Tempate for an SArray with preallocated element space\n// ================================================================================\n\ntemplate <typename ELEMENT, COUNT_T SIZE, BOOL BITWISE_COPY = TRUE>\nclass EMPTY_BASES_DECL InlineSArray : public SArray<ELEMENT, BITWISE_COPY>\n{\n private:\n#ifdef TARGET_WINDOWS\n#pragma warning(push)\n#pragma warning(disable:4200) // zero sized array\n#pragma warning(disable:4324) // don't complain if DECLSPEC_ALIGN actually pads\n    DECLSPEC_ALIGN(BUFFER_ALIGNMENT) BYTE m_prealloc[SIZE*sizeof(ELEMENT)];\n#pragma warning(pop)\n#else\n     // use UINT64 to get maximum alignment of the memory\n     UINT64 m_prealloc[ALIGN(SIZE*sizeof(ELEMENT),sizeof(UINT64))/sizeof(UINT64)];\n#endif  // _MSC_VER\n\n public:\n    InlineSArray();\n};\n\n// ================================================================================\n// StackSArray : SArray with relatively large preallocated buffer for stack use\n// ================================================================================\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY = TRUE>\nclass EMPTY_BASES_DECL StackSArray : public InlineSArray<ELEMENT, STACK_ALLOC/sizeof(ELEMENT), BITWISE_COPY>\n{\n};\n\n// ================================================================================\n// Inline definitions\n// ================================================================================\n\n#include \"sarray.inl\"\n\n#endif  // _SARRAY_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sarray.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// --------------------------------------------------------------------------------\n// SArray.inl\n// --------------------------------------------------------------------------------\n\n#ifndef _SARRAY_INL_\n#define _SARRAY_INL_\n\n#include \"sarray.h\"\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline SArray<ELEMENT, BITWISE_COPY>::SArray()\n  : m_buffer()\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline SArray<ELEMENT, BITWISE_COPY>::SArray(COUNT_T count)\n  : m_buffer(count * sizeof(ELEMENT))\n{\n    WRAPPER_NO_CONTRACT;\n    ConstructBuffer(Begin(), count);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline COUNT_T SArray<ELEMENT, BITWISE_COPY>::VerifySizeRange(ELEMENT * begin, ELEMENT *end)\n{\n    WRAPPER_NO_CONTRACT;\n\n    if (end < begin)\n        ThrowHR(COR_E_OVERFLOW);\n\n    SIZE_T bufferSize = (end - begin) * sizeof(ELEMENT);\n    if (!FitsIn<COUNT_T>(bufferSize))\n        ThrowHR(COR_E_OVERFLOW);\n\n    return static_cast<COUNT_T>(bufferSize);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline SArray<ELEMENT, BITWISE_COPY>::SArray(ELEMENT * begin, ELEMENT * end)\n  : m_buffer(VerifySizeRange(begin, end))\n{\n    WRAPPER_NO_CONTRACT;\n\n    CopyConstructBuffer(Begin(), static_cast<COUNT_T>(end - begin), begin);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline SArray<ELEMENT, BITWISE_COPY>::SArray(void *prealloc, COUNT_T count)\n  : m_buffer(SBuffer::Prealloc, prealloc, count*sizeof(ELEMENT))\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\nSArray<ELEMENT, BITWISE_COPY>::~SArray()\n{\n    CONTRACTL\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    // Cannot call Clear because DestructBuffer has THROWS in its contract\n    if (!BITWISE_COPY)\n    {\n        COUNT_T elementCount = GetCount();\n        for (COUNT_T i = 0; i < elementCount; i++)\n        {\n            (&((*this)[i]))->~ELEMENT();\n        }\n    }\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Clear()\n{\n    WRAPPER_NO_CONTRACT;\n    DestructBuffer(Begin(), GetCount());\n    m_buffer.Clear();\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline ELEMENT* SArray<ELEMENT, BITWISE_COPY>::OpenRawBuffer(COUNT_T elementCount)\n{\n    WRAPPER_NO_CONTRACT;\n    return (ELEMENT*)m_buffer.OpenRawBuffer(elementCount * sizeof(ELEMENT));\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline ELEMENT* SArray<ELEMENT, BITWISE_COPY>::OpenRawBuffer()\n{\n    WRAPPER_NO_CONTRACT;\n    return (ELEMENT*)m_buffer.OpenRawBuffer(GetCount() * sizeof(ELEMENT));\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::CloseRawBuffer(COUNT_T finalElementCount)\n{\n    WRAPPER_NO_CONTRACT;\n    m_buffer.CloseRawBuffer(finalElementCount * sizeof(ELEMENT));\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::CloseRawBuffer()\n{\n    WRAPPER_NO_CONTRACT;\n    m_buffer.CloseRawBuffer();\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Set(const SArray<ELEMENT, BITWISE_COPY> &array)\n{\n    WRAPPER_NO_CONTRACT;\n    if (BITWISE_COPY)\n    {\n        m_buffer.Set(array.m_buffer);\n    }\n    else\n    {\n        DestructBuffer(Begin(), GetCount());\n        m_buffer.SetSize(0);\n        m_buffer.SetSize(array.m_buffer.GetSize());\n        CopyConstructBuffer(Begin(), GetCount(), array.GetElements());\n    }\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline COUNT_T SArray<ELEMENT, BITWISE_COPY>::GetCount() const\n{\n    WRAPPER_NO_CONTRACT;\n    return m_buffer.GetSize()/sizeof(ELEMENT);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline BOOL SArray<ELEMENT, BITWISE_COPY>::IsEmpty() const\n{\n    WRAPPER_NO_CONTRACT;\n    return GetCount() == 0;\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::SetCount(COUNT_T count)\n{\n    WRAPPER_NO_CONTRACT;\n    COUNT_T oldCount = GetCount();\n    if (count > oldCount)\n        ConstructBuffer(Begin() + oldCount, count - oldCount);\n\n    m_buffer.SetSize(count*sizeof(ELEMENT));\n\n    if (oldCount > count)\n        DestructBuffer(Begin() + count, oldCount - count);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline COUNT_T SArray<ELEMENT, BITWISE_COPY>::GetAllocation() const\n{\n    WRAPPER_NO_CONTRACT;\n    return m_buffer.GetAllocation() / sizeof(ELEMENT);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Preallocate(int count) const\n{\n    WRAPPER_NO_CONTRACT;\n    m_buffer.Preallocate(count * sizeof(ELEMENT));\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Trim() const\n{\n    WRAPPER_NO_CONTRACT;\n    m_buffer.Trim();\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Copy(const Iterator &to, const Iterator &from, COUNT_T size)\n{\n    WRAPPER_NO_CONTRACT;\n    // @todo: destruction/construction semantics are broken on overlapping copies\n\n    DestructBuffer(to, size);\n\n    CopyConstructBuffer(to, size, from);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Move(const Iterator &to, const Iterator &from, COUNT_T size)\n{\n    // @todo: destruction/construction semantics are broken on overlapping moves\n\n    DestructBuffer(to, size);\n\n    m_buffer.Move(to, from, size*sizeof(ELEMENT));\n\n    ConstructBuffer(from, size);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Copy(const Iterator &i, const ELEMENT *source, COUNT_T size)\n{\n    WRAPPER_NO_CONTRACT;\n    DestructBuffer(i, size);\n\n    CopyConstructBuffer(i, size, source);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Copy(void *dest, const Iterator &i, COUNT_T size)\n{\n    WRAPPER_NO_CONTRACT;\n    // @todo: destruction/construction semantics are unclear\n\n    m_buffer.Copy(dest, i.m_i, size*sizeof(ELEMENT));\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Insert(const Iterator &i)\n{\n    WRAPPER_NO_CONTRACT;\n    Replace(i, 0, 1);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Delete(const Iterator &i)\n{\n    WRAPPER_NO_CONTRACT;\n    Replace(i, 1, 0);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Insert(const Iterator &i, COUNT_T count)\n{\n    WRAPPER_NO_CONTRACT;\n    Replace(i, 0, count);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Delete(const Iterator &i, COUNT_T count)\n{\n    Delete(i, 0, count);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::Replace(const Iterator &i, COUNT_T deleteCount, COUNT_T insertCount)\n{\n    WRAPPER_NO_CONTRACT;\n    DestructBuffer(i, deleteCount);\n\n    m_buffer.Replace(i.m_i, deleteCount*sizeof(ELEMENT), insertCount*sizeof(ELEMENT));\n\n    ConstructBuffer(i, insertCount);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline ELEMENT &SArray<ELEMENT, BITWISE_COPY>::operator[](int index)\n{\n    WRAPPER_NO_CONTRACT;\n    return *(GetElements() + index);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline const ELEMENT &SArray<ELEMENT, BITWISE_COPY>::operator[](int index) const\n{\n    WRAPPER_NO_CONTRACT;\n    return *(GetElements() + index);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline ELEMENT &SArray<ELEMENT, BITWISE_COPY>::operator[](COUNT_T index)\n{\n    WRAPPER_NO_CONTRACT;\n    return *(GetElements() + index);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline const ELEMENT &SArray<ELEMENT, BITWISE_COPY>::operator[](COUNT_T index) const\n{\n    return *(GetElements() + index);\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline ELEMENT *SArray<ELEMENT, BITWISE_COPY>::GetElements() const\n{\n    LIMITED_METHOD_CONTRACT;\n    return (ELEMENT *) (const BYTE *) m_buffer;\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::ConstructBuffer(const Iterator &i, COUNT_T size)\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (!BITWISE_COPY)\n    {\n        ELEMENT *start = GetElements() + (i - Begin());\n        ELEMENT *end = start + size;\n\n        while (start < end)\n        {\n            new (start) ELEMENT();\n            start++;\n        }\n    }\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::CopyConstructBuffer(const Iterator &i, COUNT_T size, const ELEMENT *from)\n{\n    ptrdiff_t start_offset = i - Begin();\n    ELEMENT *p = (ELEMENT *) m_buffer.OpenRawBuffer(m_buffer.GetSize()) + start_offset;\n\n    if (BITWISE_COPY)\n    {\n        memmove(p, from, size * sizeof(ELEMENT));\n    }\n    else\n    {\n        ELEMENT *start = (ELEMENT *) p;\n        ELEMENT *end = (ELEMENT *) (p + size);\n\n        while (start < end)\n        {\n            new (start) ELEMENT(*from);\n\n            start++;\n            from++;\n        }\n    }\n\n    m_buffer.CloseRawBuffer();\n}\n\ntemplate <typename ELEMENT, BOOL BITWISE_COPY>\ninline void SArray<ELEMENT, BITWISE_COPY>::DestructBuffer(const Iterator &i, COUNT_T size)\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    if (!BITWISE_COPY)\n    {\n        ELEMENT *start = GetElements() + (i - Begin());\n        ELEMENT *end = start + size;\n\n        while (start < end)\n        {\n            start->ELEMENT::~ELEMENT();\n\n            start++;\n        }\n    }\n}\n\ntemplate <typename ELEMENT, COUNT_T SIZE, BOOL BITWISE_COPY>\ninline InlineSArray<ELEMENT, SIZE, BITWISE_COPY>::InlineSArray()\n  : SArray<ELEMENT, BITWISE_COPY>((void*)m_prealloc, SIZE)\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\n#endif  // _SARRAY_INL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sbuffer.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// --------------------------------------------------------------------------------\n// SBuffer.h  (Safe Buffer)\n//\n\n// --------------------------------------------------------------------------------\n\n// --------------------------------------------------------------------------------\n// SBuffer is a relatively safe way to manipulate a dynamically\n// allocated data buffer.  An SBuffer is conceptually a simple array\n// of bytes.  It maintains both a conceptual size and an actual allocated size.\n//\n// SBuffer provides safe access to the data buffer by providing rich high\n// level functionality (like insertion, deleteion, copying,  comparison, and\n// iteration) without exposing direct pointers to its buffers.\n//\n// For interoperability, SBuffers can expose their buffers - either as readonly\n// by BYTE * or void * cases, or as writable by the OpenRawBuffer/CloseRawBuffer\n// entry points.  Use of these should be limited wherever possible though; as there\n// is always a possibilility of buffer overrun.\n//\n// To mimimize heap allocations, the InlineSBuffer template will preallocate a fixed\n// size buffer inline with the SBuffer object itself.  It will use this buffer unless\n// it needs a bigger one, in which case it transparently moves on to using the heap.\n// The StackSBuffer class instatiates the InlineSBuffer with a standard heuristic\n// stack preallocation size.\n//\n// SBuffer is \"subclassable\" to add content typeing to the buffer. See SArray and\n// SString for examples.\n// --------------------------------------------------------------------------------\n\n\n#ifndef _SBUFFER_H_\n#define _SBUFFER_H_\n\n#include \"clrtypes.h\"\n#include \"iterator.h\"\n#include \"check.h\"\n#include \"daccess.h\"\n#include \"memoryrange.h\"\n\n// ================================================================================\n// Macros for computing padding\n// ================================================================================\n\n#define ALIGNMENT(size) \\\n    (( ((size)^((size)-1)) >> 1) +1)\n\n#define ALIGN(size, align) \\\n    (((size)+((align)-1)) & ~((align)-1))\n\n#define PAD(size, align) \\\n    (ALIGN((size), (align)) - (size))\n\n// ================================================================================\n// SBuffer : base class for safe buffers\n// ================================================================================\n\ntypedef DPTR(class SBuffer) PTR_SBuffer;\n\nclass SBuffer\n{\n  public:\n    //--------------------------------------------------------------------\n    // Flags and constants\n    //--------------------------------------------------------------------\n\n    enum ImmutableFlag\n    {\n        Immutable\n    };\n\n    enum PreallocFlag\n    {\n        Prealloc\n    };\n\n    //--------------------------------------------------------------------\n    // Types\n    //--------------------------------------------------------------------\n\n  public:\n    class CIterator;\n    friend class CIterator;\n\n    class Iterator;\n    friend class Iterator;\n\n    //--------------------------------------------------------------------\n    // Initializers and constructors\n    //--------------------------------------------------------------------\n\n  public:\n    // Constructors\n    SBuffer();\n    SBuffer(COUNT_T size);\n    SBuffer(const BYTE *buffer, COUNT_T size);\n    explicit SBuffer(const SBuffer &buffer);\n\n    // Immutable constructor should ONLY be used if buffer will\n    // NEVER BE FREED OR MODIFIED. PERIOD. .\n    SBuffer(ImmutableFlag immutable, const BYTE *buffer, COUNT_T size);\n\n    // Prealloc should be allocated inline with SBuffer - it must have the same\n    // lifetime as SBuffer's memory.\n    SBuffer(PreallocFlag prealloc, void *buffer, COUNT_T size);\n\n    ~SBuffer();\n\n    void Clear();\n\n    void Set(const SBuffer &buffer);\n    void Set(const BYTE *buffer, COUNT_T size);\n    void SetImmutable(const BYTE *buffer, COUNT_T size);\n\n    //--------------------------------------------------------------------\n    // Buffer size routines.  A buffer has an externally visible size, but\n    // it also has an internal allocation size which may be larger.\n    //--------------------------------------------------------------------\n\n    // Get and set size of buffer.  Note that the actual size of the\n    // internally allocated memory block may be bigger.\n    COUNT_T GetSize() const;\n    void SetSize(COUNT_T count);\n\n    // Grow size of buffer to maximum amount without reallocating.\n    void MaximizeSize();\n\n    //--------------------------------------------------------------------\n    // Buffer allocation routines\n    //--------------------------------------------------------------------\n\n    // Return the current available allocation space of the buffer.\n    COUNT_T GetAllocation() const;\n\n    // Preallocate some memory you expect to use.  This can prevent\n    // multiple reallocations.  Note this does not change the visible\n    // size of the buffer.\n    void Preallocate(COUNT_T allocation) const;\n\n    // Shrink memory usage of buffer to minimal amount.  Note that\n    // this does not change the visible size of the buffer.\n    void Trim() const;\n\n    //--------------------------------------------------------------------\n    // Content manipulation routines\n    //--------------------------------------------------------------------\n\n    void Zero();\n    void Fill(BYTE value);\n    void Fill(const Iterator &to, BYTE value, COUNT_T size);\n\n    // Internal copy. \"Copy\" leaves from range as is; \"Move\"\n    // leaves from range in uninitialized state.\n    // (This distinction is more important when using from a\n    // typed wrapper than in the base SBuffer class.)\n    //\n    // NOTE: Copy vs Move is NOT based on whether ranges overlap\n    // or not.  Ranges may overlap in either case.\n    //\n    // Note that both Iterators must be on THIS buffer.\n    void Copy(const Iterator &to, const CIterator &from, COUNT_T size);\n    void Move(const Iterator &to, const CIterator &from, COUNT_T size);\n\n    // External copy.\n    void Copy(const Iterator &i, const SBuffer &source);\n    void Copy(const Iterator &i, const void *source, COUNT_T size);\n    void Copy(void *dest, const CIterator &i, COUNT_T size);\n\n    // Insert bytes at the given iterator location.\n    void Insert(const Iterator &i, const SBuffer &source);\n    void Insert(const Iterator &i, COUNT_T size);\n\n    // Delete bytes at the given iterator location\n    void Delete(const Iterator &i, COUNT_T size);\n\n    // Replace bytes at the given iterator location\n    void Replace(const Iterator &i, COUNT_T deleteSize, const SBuffer &insert);\n    void Replace(const Iterator &i, COUNT_T deleteSize, COUNT_T insertSize);\n\n    // Compare entire buffer; return -1, 0, 1\n    int Compare(const SBuffer &compare) const;\n    int Compare(const BYTE *match, COUNT_T size) const;\n\n    // Compare entire buffer; return TRUE or FALSE\n    BOOL Equals(const SBuffer &compare) const;\n    BOOL Equals(const BYTE *match, COUNT_T size) const;\n\n    // Match portion of this buffer to given bytes; return TRUE or FALSE\n    BOOL Match(const CIterator &i, const SBuffer &match) const;\n    BOOL Match(const CIterator &i, const BYTE *match, COUNT_T size) const;\n\n    //--------------------------------------------------------------------\n    // Iterators\n    //\n    // Note that any iterator returned is not\n    // valid after any operation which may resize the buffer, unless\n    // the operation was performed on that particular iterator.\n    //--------------------------------------------------------------------\n\n    CIterator Begin() const;\n    CIterator End() const;\n\n    Iterator Begin();\n    Iterator End();\n\n    BYTE & operator[] (int index);\n    const BYTE & operator[] (int index) const;\n\n    //--------------------------------------------------------------------\n    // Raw buffer access\n    //\n    // Accessing a raw buffer via pointer is inherently more dangerous than\n    // other uses of this API, and should be avoided if at all possible.\n    // It is primarily provided for compatibility with existing APIs.\n    //\n    // Note that any buffer pointer returned is not\n    // valid after any operation which may resize the buffer.\n    //--------------------------------------------------------------------\n\n    // Casting operators return the existing buffer as\n    // a raw const pointer.  Note that the pointer is valid only\n    // until the buffer is modified via an API.\n    operator const void *() const;\n    operator const BYTE *() const;\n\n    // To write directly to the SString's underlying buffer:\n    // 1) Call OpenRawBuffer() and pass it the count of bytes\n    // you need.\n    // 2) That returns a pointer to the raw buffer which you can write to.\n    // 3) When you are done writing to the pointer, call CloseBuffer()\n    // and pass it the count of bytes you actually wrote.\n    // The pointer from step 1 is now invalid.\n\n    // example usage:\n    // void GetInfo(SBuffer &buf)\n    // {\n    //      BYTE *p = buf.OpenRawBuffer(3);\n    //      OSGetSomeInfo(p, 3);\n    //      buf.CloseRawBuffer();\n    // }\n\n    // You should open the buffer, write the data, and immediately close it.\n    // No sbuffer operations are valid while the buffer is opened.\n    //\n    // In a debug build, Open/Close will do lots of little checks to make sure\n    // you don't buffer overflow while it's opened. In a retail build, this\n    // is a very streamlined action.\n\n    // Open the raw buffer for writing count bytes\n    BYTE *OpenRawBuffer(COUNT_T maxCount);\n\n    // Call after OpenRawBuffer().\n\n    // Provide the count of bytes actually used. This will make sure the\n    // SBuffer's size is correct.\n    void CloseRawBuffer(COUNT_T actualCount);\n\n    // Close the buffer. Assumes that we completely filled the buffer\n    // that OpenRawBuffer() gave back.\n    void CloseRawBuffer();\n\n    //--------------------------------------------------------------------\n    // Check routines. These are typically used internally, but may be\n    // called externally if desired.\n    //--------------------------------------------------------------------\n\n    CHECK CheckBufferClosed() const;\n    static CHECK CheckSize(COUNT_T size);\n    static CHECK CheckAllocation(COUNT_T allocation);\n    CHECK CheckIteratorRange(const CIterator &i) const;\n    CHECK CheckIteratorRange(const CIterator &i, COUNT_T size) const;\n\n    CHECK Check() const;\n    CHECK Invariant() const;\n    CHECK InternalInvariant() const;\n\n  protected:\n\n    //--------------------------------------------------------------------\n    // Internal helper routines\n    //--------------------------------------------------------------------\n\n    // Preserve = preserve contents while reallocating\n    typedef enum\n    {\n        DONT_PRESERVE = 0,\n        PRESERVE = 1,\n    } Preserve;\n\n    void Resize(COUNT_T size, Preserve preserve = PRESERVE);\n    void ResizePadded(COUNT_T size, Preserve preserve = PRESERVE);\n    void TweakSize(COUNT_T size);\n    void ReallocateBuffer(COUNT_T allocation, Preserve preserve);\n    void EnsureMutable() const;\n\n    //--------------------------------------------------------------------\n    // We define some extra flags and fields for subclasses (these are specifically\n    // designed for SString, but use otherwise if desired.)\n    //--------------------------------------------------------------------\n\n    BOOL IsFlag1() const;\n    void SetFlag1();\n    void ClearFlag1();\n\n    BOOL IsFlag2() const;\n    void SetFlag2();\n    void ClearFlag2();\n\n    BOOL IsFlag3() const;\n    void SetFlag3();\n    void ClearFlag3();\n\n    INT GetRepresentationField() const;\n    void SetRepresentationField(int value);\n\n  protected:\n\n    //--------------------------------------------------------------------\n    // Flag access\n    //--------------------------------------------------------------------\n\n    BOOL IsAllocated() const;\n    void SetAllocated();\n    void ClearAllocated();\n\n    BOOL IsImmutable() const;\n    void SetImmutable();\n    void ClearImmutable();\n\n#if _DEBUG\n    BOOL IsOpened() const;\n    void SetOpened();\n    void ClearOpened();\n#endif\n\n    //--------------------------------------------------------------------\n    // Buffer management routines\n    //--------------------------------------------------------------------\n\n    // Allocate and free a memory buffer\n    BYTE *NewBuffer(COUNT_T allocation);\n    void DeleteBuffer(BYTE *buffer, COUNT_T allocation);\n\n    // Use existing buffer\n    BYTE *UseBuffer(BYTE *buffer, COUNT_T *allocation);\n\n    CHECK CheckBuffer(const BYTE* buffer, COUNT_T allocation) const;\n\n    // Manipulates contents of the buffer via the plugins below, but\n    // adds some debugging checks.  Should always call through here rather\n    // than directly calling the extensibility points.\n    void DebugMoveBuffer(_Out_writes_bytes_(size) BYTE *to, BYTE *from, COUNT_T size);\n    void DebugCopyConstructBuffer(_Out_writes_bytes_(size) BYTE *to, const BYTE *from, COUNT_T size);\n    void DebugConstructBuffer(BYTE *buffer, COUNT_T size);\n    void DebugDestructBuffer(BYTE *buffer, COUNT_T size);\n\n    void DebugStompUnusedBuffer(BYTE *buffer, COUNT_T size);\n#ifdef _DEBUG\n    static BOOL EnsureGarbageCharOnly(const BYTE *buffer, COUNT_T size);\n#endif\n    CHECK CheckUnusedBuffer(const BYTE *buffer, COUNT_T size) const;\n\n#ifdef DACCESS_COMPILE\npublic:\n\n    // Expose the raw Target address of the buffer to DAC.\n    // This does not do any marshalling. This can be useful if the caller wants to allocate the buffer on\n    // its own heap so that it can survive Flush calls.\n    MemoryRange DacGetRawBuffer() const\n    {\n        SUPPORTS_DAC;\n        PTR_VOID p = dac_cast<PTR_VOID>((TADDR) m_buffer);\n        return MemoryRange(p, GetSize());\n    }\n\nprotected:\n\n    // Return a host copy of the buffer, allocated on the DAC heap (and thus invalidated at the next call to Flush).\n    void* DacGetRawContent(void) const\n    {\n        SUPPORTS_DAC;\n\n        // SBuffers are used in DAC in two ways - buffers in the host, and marshalled buffers from the target.\n        // This is a problem - we can't reason about the address space of the buffer statically, and instead rely on\n        // the dynamic usage (i.e. the methods are basically bifurcated into those you can use on host instances,\n        // and those you can use on marshalled copies).\n        // Ideally we'll have two versions of the SBuffer code - one that's marshalled (normal DACization) and one\n        // that isn't (host-only utility).  This is the \"dual-mode DAC problem\".\n        // But this only affects a couple classes, and so for now we'll ignore the problem - causing a bunch of DacCop\n        // violations.\n        DACCOP_IGNORE(CastBetweenAddressSpaces, \"SBuffer has the dual-mode DAC problem\");\n        DACCOP_IGNORE(FieldAccess, \"SBuffer has the dual-mode DAC problem\");\n        TADDR bufAddr = (TADDR)m_buffer;\n\n        return DacInstantiateTypeByAddress(bufAddr, m_size, true);\n    }\n\n    void EnumMemoryRegions(CLRDataEnumMemoryFlags flags) const\n    {\n        SUPPORTS_DAC;\n\n        if (flags != CLRDATA_ENUM_MEM_TRIAGE)\n        {\n            DacEnumMemoryRegion((TADDR)m_buffer, m_size);\n        }\n    }\n#endif\n\n    //----------------------------------------------------------------------------\n    // Iterator base class\n    //----------------------------------------------------------------------------\n\n    friend class CheckedIteratorBase<SBuffer>;\n\n    class EMPTY_BASES_DECL Index : public CheckedIteratorBase<SBuffer>\n    {\n        friend class SBuffer;\n\n        friend class CIterator;\n        friend class Indexer<const BYTE, CIterator>;\n\n        friend class Iterator;\n        friend class Indexer<BYTE, Iterator>;\n\n      protected:\n        BYTE* m_ptr;\n\n        Index();\n        Index(SBuffer *container, SCOUNT_T index);\n        BYTE &GetAt(SCOUNT_T delta) const;\n        void Skip(SCOUNT_T delta);\n        SCOUNT_T Subtract(const Index &i) const;\n\n        CHECK DoCheck(SCOUNT_T delta) const;\n\n        void Resync(const SBuffer *container, BYTE *value) const;\n    };\n\n  public:\n\n    class EMPTY_BASES_DECL CIterator : public Index, public Indexer<const BYTE, CIterator>\n    {\n        friend class SBuffer;\n\n    public:\n        CIterator()\n        {\n        }\n\n        CIterator(const SBuffer *buffer, int index)\n          : Index(const_cast<SBuffer*>(buffer), index)\n        {\n        }\n    };\n\n    class EMPTY_BASES_DECL Iterator : public Index, public Indexer<BYTE, Iterator>\n    {\n        friend class SBuffer;\n\n    public:\n        operator const CIterator &() const\n        {\n            return *(const CIterator *)this;\n        }\n\n        operator CIterator &()\n        {\n            return *(CIterator *)this;\n        }\n\n        Iterator()\n        {\n        }\n\n        Iterator(SBuffer *buffer, int index)\n          : Index(buffer, index)\n        {\n        }\n\n    };\n\n\n    //----------------------------------------------------------------------------\n    // Member and data declarations\n    //----------------------------------------------------------------------------\n\n  private:\n    enum\n    {\n        REPRESENTATION_MASK     = 0x07,\n        ALLOCATED               = 0x08,\n        IMMUTABLE               = 0x10,\n        OPENED                  = 0x20,\n        FLAG1                   = 0x40,\n        FLAG2                   = 0x80,\n        FLAG3                   = 0x100,\n    };\n\n    COUNT_T   m_size;           // externally visible size\n    COUNT_T   m_allocation;     // actual allocated size\n    UINT32    m_flags;          // @todo: steal flags from sizes\n\n  protected:\n    union {\n        BYTE     *m_buffer;\n        WCHAR    *m_asStr;     // For debugging, view as a unicode string\n    };\n\n#if _DEBUG\n  protected:\n    // We will update the \"revision\" of the buffer every time it is potentially reallocation,\n    // so we can tell when iterators are no longer valid.\n    int m_revision;\n#endif\n};\n\n// ================================================================================\n// InlineSBuffer : Tlempate for an SBuffer with preallocated buffer space\n// ================================================================================\n\n#define BUFFER_ALIGNMENT 4\n\ntemplate <COUNT_T size>\nclass EMPTY_BASES_DECL InlineSBuffer : public SBuffer\n{\n private:\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4200) // zero sized array\n#pragma warning(disable:4324) // don't complain if DECLSPEC_ALIGN actually pads\n    DECLSPEC_ALIGN(BUFFER_ALIGNMENT) BYTE m_prealloc[size];\n#pragma warning(pop)\n#else\n     // use UINT64 to get maximum alignment of the memory\n     UINT64 m_prealloc[ALIGN(size,sizeof(UINT64))/sizeof(UINT64)];\n#endif // _MSC_VER\n\n public:\n    InlineSBuffer()\n      : SBuffer(Prealloc, (BYTE*)m_prealloc, size)\n    {\n        WRAPPER_NO_CONTRACT;\n    }\n};\n\n\n// a 1K sized buffer filled with $ that we'll use in debug builds for verification\n#define GARBAGE_FILL_DWORD  0x24242424 // $$$$\n#define GARBAGE_FILL_BUFFER_ITEMS 16\n#define GARBAGE_FILL_BUFFER_SIZE GARBAGE_FILL_BUFFER_ITEMS*sizeof(DWORD)\n// ================================================================================\n// StackSBuffer : SBuffer with relatively large preallocated buffer for stack use\n// ================================================================================\n\n#define STACK_ALLOC 256\n\ntypedef InlineSBuffer<STACK_ALLOC> StackSBuffer;\n\n// ================================================================================\n// Inline definitions\n// ================================================================================\n\n/// a wrapper for templates and such, that use \"==\".\n/// more expensive than a typical \"==\", though\ninline BOOL  operator == (const SBuffer& b1,const SBuffer& b2)\n{\n    return b1.Equals(b2);\n};\n\n#include <sbuffer.inl>\n\n#endif  // _SBUFFER_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sbuffer.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n\n#ifndef _SBUFFER_INL_\n#define _SBUFFER_INL_\n\n#include \"sbuffer.h\"\n\n#if defined(_MSC_VER)\n#pragma inline_depth (20)\n#endif\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4702) // Disable bogus unreachable code warning\n#endif // _MSC_VER\n\ninline SBuffer::SBuffer(PreallocFlag flag, void *buffer, COUNT_T size)\n  : m_size(0),\n    m_allocation(NULL),\n    m_flags(0),\n    m_buffer(NULL)\n{\n    CONTRACT_VOID\n    {\n        CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(buffer));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    m_buffer = UseBuffer((BYTE *) buffer, &size);\n    m_allocation = size;\n\n#ifdef _DEBUG\n    m_revision = 0;\n#endif\n\n    RETURN;\n}\n\ninline SBuffer::SBuffer()\n  : m_size(0),\n    m_allocation(0),\n    m_flags(0),\n    m_buffer(NULL)\n{\n    CONTRACT_VOID\n    {\n        CONSTRUCTOR_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n#ifdef _DEBUG\n    m_revision = 0;\n#endif\n\n    RETURN;\n}\n\ninline SBuffer::SBuffer(COUNT_T size)\n  : m_size(0),\n    m_allocation(0),\n    m_flags(0),\n    m_buffer(NULL)\n{\n    CONTRACT_VOID\n    {;\n        CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckSize(size));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Resize(size);\n\n#ifdef _DEBUG\n    m_revision = 0;\n#endif\n\n    RETURN;\n}\n\ninline SBuffer::SBuffer(const SBuffer &buffer)\n  : m_size(0),\n    m_allocation(0),\n    m_flags(0),\n    m_buffer(NULL)\n{\n    CONTRACT_VOID\n    {\n        CONSTRUCTOR_CHECK;\n        PRECONDITION(buffer.Check());\n        POSTCONDITION(Equals(buffer));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Set(buffer);\n\n#ifdef _DEBUG\n    m_revision = 0;\n#endif\n\n    RETURN;\n}\n\ninline SBuffer::SBuffer(const BYTE *buffer, COUNT_T size)\n  : m_size(0),\n    m_allocation(0),\n    m_flags(0),\n    m_buffer(NULL)\n{\n    CONTRACT_VOID\n    {\n        CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(buffer));\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(Equals(buffer, size));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Set(buffer, size);\n\n#ifdef _DEBUG\n    m_revision = 0;\n#endif\n\n    RETURN;\n}\n\n\ninline SBuffer::SBuffer(ImmutableFlag immutable, const BYTE *buffer, COUNT_T size)\n  : m_size(size),\n    m_allocation(size),\n    m_flags(IMMUTABLE),\n    m_buffer(const_cast<BYTE*>(buffer))\n{\n    CONTRACT_VOID\n    {\n        CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(buffer));\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(Equals(buffer, size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n#ifdef _DEBUG\n    m_revision = 0;\n#endif\n\n    RETURN;\n}\n\ninline SBuffer::~SBuffer()\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        DESTRUCTOR_CHECK;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    if (IsAllocated())\n    {\n        DeleteBuffer(m_buffer, m_allocation);\n    }\n\n#ifdef _DEBUG\n    m_revision = 0;\n#endif\n\n    RETURN;\n}\n\ninline void SBuffer::Set(const SBuffer &buffer)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(buffer.Check());\n        POSTCONDITION(Equals(buffer));\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    if (buffer.IsImmutable()\n        && (IsImmutable() || m_allocation < buffer.GetSize()))\n    {\n        // Share immutable block rather than reallocate and copy\n        // (Note that we prefer to copy to our buffer if we\n        // don't have to reallocate it.)\n\n        if (IsAllocated())\n            DeleteBuffer(m_buffer, m_allocation);\n\n        m_size = buffer.m_size;\n        m_allocation = buffer.m_allocation;\n        m_buffer = buffer.m_buffer;\n        m_flags = buffer.m_flags;\n\n#if _DEBUG\n        // Increment our revision to invalidate iterators\n        m_revision++;\n#endif\n\n    }\n    else\n    {\n        Resize(buffer.m_size, DONT_PRESERVE);\n        EnsureMutable();\n\n        // PreFix seems to think it can choose m_allocation==0 and buffer.m_size > 0 here.\n        // From the code for Resize and EnsureMutable, this is clearly impossible.\n        PREFIX_ASSUME( (this->m_buffer != NULL) || (buffer.m_size == 0) );\n\n        MoveMemory(m_buffer, buffer.m_buffer, buffer.m_size);\n    }\n\n    RETURN;\n}\n\ninline void SBuffer::Set(const BYTE *buffer, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(buffer, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(Equals(buffer, size));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Resize(size);\n    EnsureMutable();\n\n    // PreFix seems to think it can choose m_allocation==0 and size > 0 here.\n    // From the code for Resize, this is clearly impossible.\n    PREFIX_ASSUME( (this->m_buffer != NULL) || (size == 0) );\n\n    if (size != 0)\n        MoveMemory(m_buffer, buffer, size);\n\n    RETURN;\n}\n\ninline void SBuffer::SetImmutable(const BYTE *buffer, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(buffer, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(Equals(buffer, size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n\n    }\n    CONTRACT_END;\n\n    SBuffer temp(Immutable, buffer, size);\n\n    {\n        // This can't really throw\n        CONTRACT_VIOLATION(ThrowsViolation);\n        Set(temp);\n    }\n\n    RETURN;\n}\n\ninline COUNT_T SBuffer::GetSize() const\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    return m_size;\n}\n\ninline void SBuffer::SetSize(COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckSize(size));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Resize(size);\n\n    RETURN;\n}\n\ninline void SBuffer::MaximizeSize()\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    if (!IsImmutable())\n        Resize(m_allocation);\n\n    RETURN;\n}\n\ninline COUNT_T SBuffer::GetAllocation() const\n{\n    CONTRACT(COUNT_T)\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    RETURN m_allocation;\n}\n\ninline void SBuffer::Preallocate(COUNT_T allocation) const\n{\n    CONTRACT_VOID\n    {\n        if (allocation) THROWS; else NOTHROW;\n        INSTANCE_CHECK;\n        PRECONDITION(CheckAllocation(allocation));\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    if (allocation > m_allocation)\n        const_cast<SBuffer *>(this)->ReallocateBuffer(allocation, PRESERVE);\n\n    RETURN;\n}\n\ninline void SBuffer::Trim() const\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    if (!IsImmutable())\n        const_cast<SBuffer *>(this)->ReallocateBuffer(m_size, PRESERVE);\n\n    RETURN;\n}\n\ninline void SBuffer::Zero()\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    ZeroMemory(m_buffer, m_size);\n\n    RETURN;\n}\n\ninline void SBuffer::Fill(BYTE value)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    memset(m_buffer, value, m_size);\n\n    RETURN;\n}\n\ninline void SBuffer::Fill(const Iterator &i, BYTE value, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i, size));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    memset(i.m_ptr, value, size);\n\n    RETURN;\n}\n\ninline void SBuffer::Copy(const Iterator &to, const CIterator &from, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(to, size));\n        PRECONDITION(CheckIteratorRange(from, size));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    DebugDestructBuffer(to.m_ptr, size);\n\n    DebugCopyConstructBuffer(to.m_ptr, from.m_ptr, size);\n\n    RETURN;\n}\n\ninline void SBuffer::Move(const Iterator &to, const CIterator &from, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(to, size));\n        PRECONDITION(CheckIteratorRange(from, size));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    DebugDestructBuffer(to.m_ptr, size);\n\n    DebugMoveBuffer(to.m_ptr, from.m_ptr, size);\n\n    DebugConstructBuffer(from.m_ptr, size);\n\n    RETURN;\n}\n\ninline void SBuffer::Copy(const Iterator &i, const SBuffer &source)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i, source.GetSize()));\n        PRECONDITION(source.Check());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    DebugDestructBuffer(i.m_ptr, source.m_size);\n\n    DebugCopyConstructBuffer(i.m_ptr, source.m_buffer, source.m_size);\n\n    RETURN;\n}\n\ninline void SBuffer::Copy(const Iterator &i, const void *source, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckSize(size));\n        PRECONDITION(CheckIteratorRange(i, size));\n        PRECONDITION(CheckPointer(source, size == 0 ? NULL_OK : NULL_NOT_OK));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    CONTRACT_END;\n\n    DebugDestructBuffer(i.m_ptr, size);\n\n    DebugCopyConstructBuffer(i.m_ptr, (const BYTE *) source, size);\n\n    RETURN;\n}\n\ninline void SBuffer::Copy(void *dest, const CIterator &i, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckSize(size));\n        PRECONDITION(CheckIteratorRange(i, size));\n        PRECONDITION(CheckPointer(dest, size == 0 ? NULL_OK : NULL_NOT_OK));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    memcpy(dest, i.m_ptr, size);\n\n    RETURN;\n}\n\ninline void SBuffer::Insert(const Iterator &i, const SBuffer &source)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        THROWS;\n        PRECONDITION(CheckIteratorRange(i,0));\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Replace(i, 0, source.GetSize());\n    Copy(i, source, source.GetSize());\n\n    RETURN;\n}\n\ninline void SBuffer::Insert(const Iterator &i, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        THROWS;\n        PRECONDITION(CheckIteratorRange(i,0));\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Replace(i, 0, size);\n\n    RETURN;\n}\n\ninline void SBuffer::Clear()\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Delete(Begin(), GetSize());\n\n    RETURN;\n}\n\ninline void SBuffer::Delete(const Iterator &i, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i, size));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Replace(i, size, 0);\n\n    RETURN;\n}\n\ninline void SBuffer::Replace(const Iterator &i, COUNT_T deleteSize, const SBuffer &insert)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i, deleteSize));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Replace(i, deleteSize, insert.GetSize());\n    Copy(i, insert, insert.GetSize());\n\n    RETURN;\n}\n\ninline int SBuffer::Compare(const SBuffer &compare) const\n{\n    CONTRACT(int)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(compare.Check());\n        POSTCONDITION(RETVAL == -1 || RETVAL == 0 || RETVAL == 1);\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    RETURN Compare(compare.m_buffer, compare.m_size);\n}\n\ninline int SBuffer::Compare(const BYTE *compare, COUNT_T size) const\n{\n    CONTRACT(int)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(compare));\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(RETVAL == -1 || RETVAL == 0 || RETVAL == 1);\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    COUNT_T smaller;\n    int equals;\n    int result;\n\n    if (m_size < size)\n    {\n        smaller = m_size;\n        equals = -1;\n    }\n    else if (m_size > size)\n    {\n        smaller = size;\n        equals = 1;\n    }\n    else\n    {\n        smaller = size;\n        equals = 0;\n    }\n\n    result = memcmp(m_buffer, compare, size);\n\n    if (result == 0)\n        RETURN equals;\n    else\n        RETURN result;\n}\n\ninline BOOL SBuffer::Equals(const SBuffer &compare) const\n{\n    CONTRACT(int)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(compare.Check());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    RETURN Equals(compare.m_buffer, compare.m_size);\n}\n\ninline BOOL SBuffer::Equals(const BYTE *compare, COUNT_T size) const\n{\n    CONTRACT(int)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(compare));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    if (m_size != size)\n        RETURN FALSE;\n    else\n        RETURN (memcmp(m_buffer, compare, size) == 0);\n}\n\ninline BOOL SBuffer::Match(const CIterator &i, const SBuffer &match) const\n{\n    CONTRACT(int)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(match.Check());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    RETURN Match(i, match.m_buffer, match.m_size);\n}\n\ninline BOOL SBuffer::Match(const CIterator &i, const BYTE *match, COUNT_T size) const\n{\n    CONTRACT(int)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(match));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    COUNT_T remaining = (COUNT_T) (m_buffer + m_size - i.m_ptr);\n\n    if (remaining < size)\n        RETURN FALSE;\n\n    RETURN (memcmp(i.m_ptr, match, size) == 0);\n}\n\n//----------------------------------------------------------------------------\n// EnsureMutable\n// Ensures that the buffer is mutable\n//----------------------------------------------------------------------------\ninline void SBuffer::EnsureMutable() const\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckBufferClosed());\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    if (IsImmutable())\n        const_cast<SBuffer *>(this)->ReallocateBuffer(m_allocation, PRESERVE);\n\n    RETURN;\n}\n\n//----------------------------------------------------------------------------\n// Resize\n// Change the visible size of the buffer; realloc if necessary\n//----------------------------------------------------------------------------\nFORCEINLINE void SBuffer::Resize(COUNT_T size, Preserve preserve)\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(GetSize() == size);\n        POSTCONDITION(m_allocation >= GetSize());\n        POSTCONDITION(CheckInvariant(*this));\n        if (size > 0) THROWS; else NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n#ifdef _DEBUG\n    // Change our revision\n    m_revision++;\n#endif\n\n    SCOUNT_T delta = size - m_size;\n\n    if (delta < 0)\n        DebugDestructBuffer(m_buffer + size, -delta);\n\n    // Only actually allocate if we are growing\n    if (size > m_allocation)\n        ReallocateBuffer(size, preserve);\n\n    if (delta > 0)\n        DebugConstructBuffer(m_buffer + m_size, delta);\n\n    m_size = size;\n\n    RETURN;\n}\n\n//----------------------------------------------------------------------------\n// ResizePadded\n// Change the visible size of the buffer; realloc if necessary\n// add extra space to minimize further growth\n//----------------------------------------------------------------------------\ninline void SBuffer::ResizePadded(COUNT_T size, Preserve preserve)\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(GetSize() == size);\n        POSTCONDITION(m_allocation >= GetSize());\n        POSTCONDITION(CheckInvariant(*this));\n        if (size > 0) THROWS; else NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n#ifdef _DEBUG\n    // Change our revision\n    m_revision++;\n#endif\n\n    SCOUNT_T delta = size - m_size;\n\n    if (delta < 0)\n        DebugDestructBuffer(m_buffer + size, -delta);\n\n    // Only actually allocate if we are growing\n    if (size > m_allocation)\n    {\n        COUNT_T padded = (size*3)/2;\n\n        ReallocateBuffer(padded, preserve);\n    }\n\n    if (delta > 0)\n        DebugConstructBuffer(m_buffer + m_size, delta);\n\n    m_size = size;\n\n    RETURN;\n}\n\n//----------------------------------------------------------------------------\n// TweakSize\n// An optimized form of Resize, which can only adjust the size within the\n// currently allocated range, and never reallocates\n//----------------------------------------------------------------------------\ninline void SBuffer::TweakSize(COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckSize(size));\n        PRECONDITION(size <= GetAllocation());\n        POSTCONDITION(GetSize() == size);\n        POSTCONDITION(CheckInvariant(*this));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n#ifdef _DEBUG\n    // Change our revision\n    m_revision++;\n#endif\n\n    SCOUNT_T delta = size - m_size;\n\n    if (delta < 0)\n        DebugDestructBuffer(m_buffer + size, -delta);\n    else\n        DebugConstructBuffer(m_buffer + m_size, delta);\n\n    m_size = size;\n\n    RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// SBuffer allocates all memory via NewBuffer & DeleteBuffer members.\n// If SBUFFER_CANARY_CHECKS is defined, NewBuffer will place Canaries at the start\n// and end of the buffer to detect overflows.\n//-----------------------------------------------------------------------------\n\n#ifdef _DEBUG\n#define SBUFFER_CANARY_CHECKS 1\n#endif\n\n#ifdef SBUFFER_CANARY_CHECKS\n\n// The value we place at the start/end of the buffer,\nstatic const UINT64 SBUFFER_CANARY_VALUE = UI64(0xD00BED00BED00BAA);\n\n// Expose the quantity of padding needed when providing a prealloced\n// buffer. This is an unrolled version of the actualAllocation calculated\n// below for use as a constant value for InlineSString<X> to use. It is\n// padded with one additional sizeof(SBUFFER_CANARY_VALUE) to account for\n// possible alignment problems issues (pre- and post-padding).\n#define SBUFFER_PADDED_SIZE(desiredUsefulSize) \\\n    ((((SIZE_T)(desiredUsefulSize) + sizeof(SBUFFER_CANARY_VALUE) - 1) & \\\n    ~(sizeof(SBUFFER_CANARY_VALUE)-1)) + 3 * sizeof(SBUFFER_CANARY_VALUE))\n\n#else // SBUFFER_CANARY_CHECKS\n\n#define SBUFFER_PADDED_SIZE(desiredUsefulSize) (desiredUsefulSize)\n\n#endif // SBUFFER_CANARY_CHECKS else\n\n// Must match expected guaranteed alignment of new []\n#ifdef ALIGN_ACCESS\nstatic const int SBUFFER_ALIGNMENT = ALIGN_ACCESS;\n#else\nstatic const int SBUFFER_ALIGNMENT = 4;\n#endif\n\n//----------------------------------------------------------------------------\n// Allocate memory, use canaries.\n//----------------------------------------------------------------------------\ninline BYTE *SBuffer::NewBuffer(COUNT_T allocation)\n{\n    CONTRACT(BYTE*)\n    {\n        PRECONDITION(CheckSize(allocation));\n        PRECONDITION(allocation > 0);\n        POSTCONDITION(CheckPointer(RETVAL));\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n#ifdef SBUFFER_CANARY_CHECKS\n\n    COUNT_T alignPadding = AlignmentPad(allocation, sizeof(SBUFFER_CANARY_VALUE));\n    COUNT_T actualAllocation= sizeof(SBUFFER_CANARY_VALUE) + allocation + alignPadding + sizeof(SBUFFER_CANARY_VALUE);\n    BYTE *raw = new BYTE [actualAllocation];\n\n    *(UINT64*) raw = SBUFFER_CANARY_VALUE;\n    *(UINT64*) (raw + sizeof(SBUFFER_CANARY_VALUE) + allocation + alignPadding) = SBUFFER_CANARY_VALUE;\n\n    BYTE *buffer = raw + sizeof(SBUFFER_CANARY_VALUE);\n\n#else\n\n    BYTE *buffer = new BYTE [allocation];\n\n#endif\n\n    DebugStompUnusedBuffer(buffer, allocation);\n\n    CONSISTENCY_CHECK(CheckBuffer(buffer, allocation));\n\n    RETURN buffer;\n}\n\n//----------------------------------------------------------------------------\n// Use existing memory, use canaries.\n//----------------------------------------------------------------------------\ninline BYTE *SBuffer::UseBuffer(BYTE *buffer, COUNT_T *allocation)\n{\n    CONTRACT(BYTE*)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC_HOST_ONLY;\n        PRECONDITION(CheckPointer(buffer));\n        PRECONDITION(CheckSize(*allocation));\n//        POSTCONDITION(CheckPointer(RETVAL));\n        POSTCONDITION(CheckSize(*allocation));\n    }\n    CONTRACT_END;\n\n#ifdef SBUFFER_CANARY_CHECKS\n\n    COUNT_T prepad = AlignmentPad((SIZE_T) buffer, sizeof(SBUFFER_CANARY_VALUE));\n    COUNT_T postpad = AlignmentTrim((SIZE_T) buffer+*allocation, sizeof(SBUFFER_CANARY_VALUE));\n\n    SCOUNT_T usableAllocation = *allocation - prepad - sizeof(SBUFFER_CANARY_VALUE) - sizeof(SBUFFER_CANARY_VALUE) - postpad;\n    if (usableAllocation <= 0)\n    {\n        buffer = NULL;\n        *allocation = 0;\n    }\n    else\n    {\n        BYTE *result = buffer + prepad + sizeof(SBUFFER_CANARY_VALUE);\n\n        *(UINT64*) (buffer + prepad) = SBUFFER_CANARY_VALUE;\n        *(UINT64*) (buffer + prepad + sizeof(SBUFFER_CANARY_VALUE) + usableAllocation) = SBUFFER_CANARY_VALUE;\n\n        buffer = result;\n        *allocation = usableAllocation;\n    }\n\n#endif\n\n    DebugStompUnusedBuffer(buffer, *allocation);\n\n    CONSISTENCY_CHECK(CheckBuffer(buffer, *allocation));\n\n    RETURN buffer;\n}\n\n//----------------------------------------------------------------------------\n// Free memory allocated by NewHelper\n//----------------------------------------------------------------------------\ninline void SBuffer::DeleteBuffer(BYTE *buffer, COUNT_T allocation)\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION(CheckSize(allocation));\n        POSTCONDITION(CheckPointer(buffer));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    CONSISTENCY_CHECK(CheckBuffer(buffer, allocation));\n\n#ifdef SBUFFER_CANARY_CHECKS\n\n    delete [] (buffer - sizeof(SBUFFER_CANARY_VALUE));\n\n#else\n\n    delete [] buffer;\n\n#endif\n\n    RETURN;\n}\n\n//----------------------------------------------------------------------------\n// Check the buffer at the given address. The memory must have been a pointer\n// returned by NewHelper.\n//----------------------------------------------------------------------------\ninline CHECK SBuffer::CheckBuffer(const BYTE *buffer, COUNT_T allocation) const\n{\n    CONTRACT_CHECK\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n        PRECONDITION(CheckPointer(buffer));\n    }\n    CONTRACT_CHECK_END;\n\n    if (allocation > 0)\n    {\n#ifdef SBUFFER_CANARY_CHECKS\n        const BYTE *raw = buffer - sizeof(SBUFFER_CANARY_VALUE);\n\n        COUNT_T alignPadding    = ((allocation + (sizeof(SBUFFER_CANARY_VALUE) - 1)) & ~((sizeof(SBUFFER_CANARY_VALUE) - 1))) - allocation;\n\n        CHECK_MSG(*(UINT64*) raw == SBUFFER_CANARY_VALUE, \"SBuffer underflow\");\n        CHECK_MSG(*(UINT64*) (raw + sizeof(SBUFFER_CANARY_VALUE) + allocation + alignPadding) == SBUFFER_CANARY_VALUE, \"SBuffer overflow\");\n\n#endif\n\n        CHECK_MSG((((SIZE_T)buffer) & (SBUFFER_ALIGNMENT-1)) == 0, \"SBuffer not properly aligned\");\n    }\n\n    CHECK_OK;\n}\n\n\ninline BYTE *SBuffer::OpenRawBuffer(COUNT_T size)\n{\n    CONTRACT(BYTE*)\n    {\n#if _DEBUG\n        PRECONDITION_MSG(!IsOpened(), \"Can't nest calls to OpenBuffer()\");\n#endif\n        PRECONDITION(CheckSize(size));\n        POSTCONDITION(GetSize() == size);\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    Resize(size);\n    EnsureMutable();\n\n#if _DEBUG\n    SetOpened();\n#endif\n\n    RETURN m_buffer;\n}\n\n//----------------------------------------------------------------------------\n// Close an open buffer. Assumes that we wrote exactly number of characters\n// we requested in OpenBuffer.\n//----------------------------------------------------------------------------\ninline void SBuffer::CloseRawBuffer()\n{\n    CONTRACT_VOID\n    {\n#if _DEBUG\n        PRECONDITION(IsOpened());\n#endif\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    CloseRawBuffer(m_size);\n\n    RETURN;\n}\n\n//----------------------------------------------------------------------------\n// CloseBuffer() tells the SBuffer that we're done using the unsafe buffer.\n// finalSize is the count of bytes actually used (so we can set m_count).\n// This is important if we request a buffer larger than what we actually\n// used.\n//----------------------------------------------------------------------------\ninline void SBuffer::CloseRawBuffer(COUNT_T finalSize)\n{\n    CONTRACT_VOID\n    {\n#if _DEBUG\n        PRECONDITION_MSG(IsOpened(),  \"Can only CloseRawBuffer() after a call to OpenRawBuffer()\");\n#endif\n        PRECONDITION(CheckSize(finalSize));\n        PRECONDITION_MSG(finalSize <= GetSize(), \"Can't use more characters than requested via OpenRawBuffer()\");\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n#if _DEBUG\n    ClearOpened();\n#endif\n\n    TweakSize(finalSize);\n\n    CONSISTENCY_CHECK(CheckBuffer(m_buffer, m_allocation));\n\n    RETURN;\n}\n\ninline SBuffer::operator const void *() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (void *) m_buffer;\n}\n\ninline SBuffer::operator const BYTE *() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return m_buffer;\n}\n\ninline BYTE &SBuffer::operator[](int index)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return m_buffer[index];\n}\n\ninline const BYTE &SBuffer::operator[](int index) const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return m_buffer[index];\n}\n\ninline SBuffer::Iterator SBuffer::Begin()\n{\n    CONTRACT(SBuffer::Iterator)\n    {\n        INSTANCE_CHECK;\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    // This is a bit unfortunate to have to do here, but it's our\n    // last opportunity before possibly doing a *i= with the iterator\n    EnsureMutable();\n\n    RETURN Iterator(this, 0);\n}\n\ninline SBuffer::Iterator SBuffer::End()\n{\n    CONTRACT(SBuffer::Iterator)\n    {\n        INSTANCE_CHECK;\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    // This is a bit unfortunate to have to do here, but it's our\n    // last opportunity before possibly doing a *i= with the iterator\n    EnsureMutable();\n\n    RETURN Iterator(this, m_size);\n}\n\ninline SBuffer::CIterator SBuffer::Begin() const\n{\n    CONTRACT(SBuffer::CIterator)\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    RETURN SBuffer::CIterator(this, 0);\n}\n\ninline SBuffer::CIterator SBuffer::End() const\n{\n    CONTRACT(SBuffer::CIterator)\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    RETURN CIterator(const_cast<SBuffer*>(this), m_size);\n}\n\ninline BOOL SBuffer::IsAllocated() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (m_flags & ALLOCATED) != 0;\n}\n\ninline void SBuffer::SetAllocated()\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    m_flags |= ALLOCATED;\n}\n\ninline void SBuffer::ClearAllocated()\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    m_flags &= ~ALLOCATED;\n}\n\ninline BOOL SBuffer::IsImmutable() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (m_flags & IMMUTABLE) != 0;\n}\n\ninline void SBuffer::SetImmutable()\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    m_flags |= IMMUTABLE;\n}\n\ninline void SBuffer::ClearImmutable()\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    m_flags &= ~IMMUTABLE;\n}\n\ninline BOOL SBuffer::IsFlag1() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (m_flags & FLAG1) != 0;\n}\n\ninline void SBuffer::SetFlag1()\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    m_flags |= FLAG1;\n}\n\ninline void SBuffer::ClearFlag1()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    m_flags &= ~FLAG1;\n}\n\ninline BOOL SBuffer::IsFlag2() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (m_flags & FLAG2) != 0;\n}\n\ninline void SBuffer::SetFlag2()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    m_flags |= FLAG2;\n}\n\ninline void SBuffer::ClearFlag2()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    m_flags &= ~FLAG2;\n}\n\ninline BOOL SBuffer::IsFlag3() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (m_flags & FLAG3) != 0;\n}\n\ninline void SBuffer::SetFlag3()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    m_flags |= FLAG3;\n}\n\ninline void SBuffer::ClearFlag3()\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    m_flags &= ~FLAG3;\n}\n\ninline int SBuffer::GetRepresentationField() const\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    return (m_flags & REPRESENTATION_MASK);\n}\n\ninline void SBuffer::SetRepresentationField(int value)\n{\n    CONTRACT_VOID\n    {\n        PRECONDITION((value & ~REPRESENTATION_MASK) == 0);\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    m_flags &= ~REPRESENTATION_MASK;\n    m_flags |= value;\n\n    RETURN;\n}\n\n#if _DEBUG\ninline BOOL SBuffer::IsOpened() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (m_flags & OPENED) != 0;\n}\n\ninline void SBuffer::SetOpened()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    m_flags |= OPENED;\n}\n\ninline void SBuffer::ClearOpened()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    m_flags &= ~OPENED;\n}\n#endif\n\ninline void SBuffer::DebugMoveBuffer(_Out_writes_bytes_(size) BYTE *to, BYTE *from, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(to, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckPointer(from, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    if (size == 0) // special case\n      RETURN;\n\n    // Handle overlapping ranges\n    if (to > from && to < from + size)\n        CONSISTENCY_CHECK(CheckUnusedBuffer(from + size, (COUNT_T) (to - from)));\n    else if (to < from && to + size > from)\n        CONSISTENCY_CHECK(CheckUnusedBuffer(to, (COUNT_T) (from - to)));\n    else\n        CONSISTENCY_CHECK(CheckUnusedBuffer(to, size));\n\n    memmove(to, from, size);\n\n    // Handle overlapping ranges\n    if (to > from && to < from + size)\n        DebugStompUnusedBuffer(from, (COUNT_T) (to - from));\n    else if (to < from && to + size > from)\n        DebugStompUnusedBuffer(to + size, (COUNT_T) (from - to));\n    else\n        DebugStompUnusedBuffer(from, size);\n\n    RETURN;\n}\n\ninline void SBuffer::DebugCopyConstructBuffer(_Out_writes_bytes_(size) BYTE *to, const BYTE *from, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(to, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckPointer(from, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    if (size != 0) {\n        CONSISTENCY_CHECK(CheckUnusedBuffer(to, size));\n        memmove(to, from, size);\n    }\n\n    RETURN;\n}\n\ninline void SBuffer::DebugConstructBuffer(BYTE *buffer, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(buffer, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n        DEBUG_ONLY;\n    }\n    CONTRACT_END;\n\n    if (size != 0) {\n      CONSISTENCY_CHECK(CheckUnusedBuffer(buffer, size));\n    }\n\n    RETURN;\n}\n\ninline void SBuffer::DebugDestructBuffer(BYTE *buffer, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(buffer, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        DEBUG_ONLY;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    if (size != 0)\n    {\n        DebugStompUnusedBuffer(buffer, size);\n    }\n\n    RETURN;\n}\n\nstatic const BYTE GARBAGE_FILL_CHARACTER = '$';\n\nextern const DWORD g_garbageFillBuffer[];\n\ninline void SBuffer::DebugStompUnusedBuffer(BYTE *buffer, COUNT_T size)\n{\n    CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckPointer(buffer, size == 0 ? NULL_OK : NULL_NOT_OK));\n        PRECONDITION(CheckSize(size));\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n        DEBUG_ONLY;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n#if _DEBUG\n    if (!IsImmutable()\n        || buffer < m_buffer || buffer > m_buffer + m_allocation) // Allocating a new buffer\n    {\n        // Whack the memory\n        if (size > GARBAGE_FILL_BUFFER_SIZE) size = GARBAGE_FILL_BUFFER_SIZE;\n        memset(buffer, GARBAGE_FILL_CHARACTER, size);\n    }\n#endif\n\n    RETURN;\n}\n\n#if _DEBUG\ninline BOOL SBuffer::EnsureGarbageCharOnly(const BYTE *buffer, COUNT_T size)\n{\n    LIMITED_METHOD_CONTRACT;\n    BOOL bRet = TRUE;\n    if (size > GARBAGE_FILL_BUFFER_SIZE)\n    {\n        size = GARBAGE_FILL_BUFFER_SIZE;\n    }\n    if (bRet && size > 0)\n    {\n        bRet &= (memcmp(buffer, g_garbageFillBuffer, size) == 0);\n    }\n    return bRet;\n}\n#endif\n\ninline CHECK SBuffer::CheckUnusedBuffer(const BYTE *buffer, COUNT_T size) const\n{\n    WRAPPER_NO_CONTRACT;\n    // This check is too expensive.\n#if 0 // _DEBUG\n    if (!IsImmutable()\n        || buffer < m_buffer || buffer > m_buffer + m_allocation) // Allocating a new buffer\n    {\n        if (!SBuffer::EnsureGarbageCharOnly(buffer, size))\n        {\n            CHECK_FAIL(\"Overwrite of unused buffer region found\");\n        }\n    }\n#endif\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::Check() const\n{\n    WRAPPER_NO_CONTRACT;\n    CHECK(CheckBufferClosed());\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::Invariant() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::InternalInvariant() const\n{\n    WRAPPER_NO_CONTRACT;\n    CHECK(m_size <= m_allocation);\n\n    CHECK(CheckUnusedBuffer(m_buffer + m_size, m_allocation - m_size));\n\n    if (IsAllocated())\n        CHECK(CheckBuffer(m_buffer, m_allocation));\n\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::CheckBufferClosed() const\n{\n    WRAPPER_NO_CONTRACT;\n#if _DEBUG\n    CHECK_MSG(!IsOpened(), \"Cannot use buffer API while raw open is in progress\");\n#endif\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::CheckSize(COUNT_T size)\n{\n    LIMITED_METHOD_CONTRACT;\n    // !todo: add any range checking here\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::CheckAllocation(COUNT_T size)\n{\n    LIMITED_METHOD_CONTRACT;\n\n    // !todo: add any range checking here\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::CheckIteratorRange(const CIterator &i) const\n{\n    WRAPPER_NO_CONTRACT;\n    CHECK(i.Check());\n    CHECK(i.CheckContainer(this));\n    CHECK(i >= Begin());\n    CHECK(i < End());\n    CHECK_OK;\n}\n\ninline CHECK SBuffer::CheckIteratorRange(const CIterator &i, COUNT_T size) const\n{\n    WRAPPER_NO_CONTRACT;\n    CHECK(i.Check());\n    CHECK(i.CheckContainer(this));\n    CHECK(i >= Begin());\n    CHECK(i + size <= End());\n    CHECK_OK;\n}\n\ninline SBuffer::Index::Index()\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    m_ptr = NULL;\n}\n\ninline SBuffer::Index::Index(SBuffer *container, SCOUNT_T index)\n  : CheckedIteratorBase<SBuffer>(container)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    m_ptr = container->m_buffer + index;\n}\n\ninline BYTE &SBuffer::Index::GetAt(SCOUNT_T delta) const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return m_ptr[delta];\n}\n\ninline void SBuffer::Index::Skip(SCOUNT_T delta)\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    m_ptr += delta;\n}\n\ninline SCOUNT_T SBuffer::Index::Subtract(const Index &i) const\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    return (SCOUNT_T) (m_ptr - i.m_ptr);\n}\n\ninline CHECK SBuffer::Index::DoCheck(SCOUNT_T delta) const\n{\n    WRAPPER_NO_CONTRACT;\n#if _DEBUG\n    CHECK(m_ptr + delta >= GetContainerDebug()->m_buffer);\n    CHECK(m_ptr + delta < GetContainerDebug()->m_buffer + GetContainerDebug()->m_size);\n#endif\n    CHECK_OK;\n}\n\ninline void SBuffer::Index::Resync(const SBuffer *buffer, BYTE *value) const\n{\n    CONTRACT_VOID\n    {\n        // INSTANCE_CHECK -  Iterator is out of sync with its object now by definition\n        POSTCONDITION(CheckPointer(this));\n        PRECONDITION(CheckPointer(buffer));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    CONTRACT_END;\n\n    const_cast<Index*>(this)->CheckedIteratorBase<SBuffer>::Resync(const_cast<SBuffer*>(buffer));\n    const_cast<Index*>(this)->m_ptr = value;\n\n    RETURN;\n}\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif // _MSC_VER\n\n#endif  // _SBUFFER_INL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sha1.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n\n#ifndef SHA1_H_\n#define SHA1_H_\n\n// Hasher class, performs no allocation and therefore does not throw or return\n// errors. Usage is as follows:\n//  Create an instance (this initializes the hash).\n//  Add one or more blocks of input data using AddData().\n//  Retrieve the hash using GetHash(). This can be done as many times as desired\n//  until the object is destructed. Once a hash is asked for, further AddData\n//  calls will be ignored. There is no way to reset object state (simply\n//  destroy the object and create another instead).\n\n#define SHA1_HASH_SIZE 20  // Number of bytes output by SHA-1\n\ntypedef struct {\n        DWORD magic_sha1;    // Magic value for A_SHA_CTX\n        DWORD awaiting_data[16];\n                             // Data awaiting full 512-bit block.\n                             // Length (nbit_total[0] % 512) bits.\n                             // Unused part of buffer (at end) is zero\n        DWORD partial_hash[5];\n                             // Hash through last full block\n        DWORD nbit_total[2];\n                             // Total length of message so far\n                             // (bits, mod 2^64)\n} SHA1_CTX;\n\nclass SHA1Hash\n{\nprivate:\n    SHA1_CTX m_Context;\n    BYTE     m_Value[SHA1_HASH_SIZE];\n    BOOL     m_fFinalized;\n\n    void SHA1Init(SHA1_CTX*);\n    void SHA1Update(SHA1_CTX*, const BYTE*, const DWORD);\n    void SHA1Final(SHA1_CTX*, BYTE* digest);\n\npublic:\n    SHA1Hash();\n    void AddData(BYTE *pbData, DWORD cbData);\n    BYTE *GetHash();\n};\n\n#endif  // SHA1_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/shash.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef _SHASH_H_\n#define _SHASH_H_\n\n#include \"utilcode.h\" // for string hash functions\n#include \"clrtypes.h\"\n#include \"check.h\"\n#include \"iterator.h\"\n\n// SHash is a templated closed chaining hash table of pointers.  It provides\n// for multiple entries under the same key, and also for deleting elements.\n\n// Synchronization:\n// Synchronization requirements depend on use.  There are several properties to take into account:\n//\n// - Lookups may be asynchronous with each other\n// - Lookups must be exclusive with Add operations\n//    (@todo: this can be remedied by delaying destruction of old tables during reallocation, e.g. during GC)\n// - Remove operations may be asynchronous with Lookup/Add, unless elements are also deallocated. (In which\n//    case full synchronization is required)\n\n// Common \"gotchas\":\n// - The Add method never replaces an element. The new element will be added even if an element with the same\n//   key is already present. If you don't want this, use AddOrReplace.\n// - You need special sentinel values for the element to represent Null and Deleted. 0 and -1 are the default\n//   choices but you will need something else if elements can legally have any of these two values.\n// - Deriving directly from the general purpose classes (such as SHash itself) requires implementing a\n//   TRAITS class which can be daunting. Consider using one of the specialized classes (e.g. WStringSHash) first.\n\n// A SHash is templated by a class of TRAITS.  These traits define the various specifics of the\n// particular hash table.\n// The required traits are:\n//\n// element_t                                    Type of elements in the hash table.  These elements are stored\n//                                              by value in the hash table. Elements must look more or less\n//                                              like primitives - they must support assignment relatively\n//                                              efficiently.  There are 2 required sentinel values:\n//                                              Null and Deleted (described below).  (Note that element_t is\n//                                              very commonly a pointer type.)\n//\n//                                              The key must be derivable from the element; if your\n//                                              table's keys are independent of the stored values, element_t\n//                                              should be a key/value pair.\n//\n// key_t                                        Type of the lookup key.  The key is used for identity\n//                                              comparison between elements, and also as a key for lookup.\n//                                              This is also used by value and should support\n//                                              efficient assignment.\n//\n// count_t                                      integral type for counts.  Typically inherited by default\n//                                              Traits (COUNT_T).\n//\n// static key_t GetKey(const element_t &e)      Get key from element.  Should be stable for a given e.\n// static BOOL Equals(key_t k1, key_t k2)       Compare 2 keys for equality.  Again, should be stable.\n// static count_t Hash(key_t k)                 Compute hash from a key.  For efficient operation, the hashes\n//                                              for a set of elements should have random uniform distribution.\n//\n// static const bool s_NoThrow                  TRUE if GetKey, Equals, and hash are NOTHROW functions.\n//                                              Affects the THROWS clauses of several SHash functions.\n//                                              (Note that the Null- and Deleted-related functions below\n//                                              are not affected by this and must always be NOTHROW.)\n//\n// static element_t Null()                      Return the Null sentinel value.  May be inherited from\n//                                              default traits if it can be assigned from 0.\n// static element_t Deleted()                   Return the Deleted sentinel value.  May be inherited from the\n//                                              default traits if it can be assigned from -1.\n// static const bool IsNull(const ELEMENT &e)   Compare element with Null sentinel value. May be inherited from\n//                                              default traits if it can be assigned from 0.\n// static const bool IsDeleted(const ELEMENT &e) Compare element with Deleted sentinel value. May be inherited from the\n//                                              default traits if it can be assigned from -1.\n// static bool ShouldDelete(const ELEMENT &e)   Called in addition to IsDeleted() when s_supports_autoremove is true, see more\n//                                              information there.\n//\n// static void OnDestructPerEntryCleanupAction(ELEMENT& e) Called on every element when in hashtable destructor.\n//                                              s_DestructPerEntryCleanupAction must be set to true if implemented.\n// static void OnRemovePerEntryCleanupAction(ELEMENT& e) Called when an element is removed from the hashtable, including when\n//                                              the hashtable is destructed. s_RemovePerEntryCleanupAction must be set to true\n//                                              if implemented.\n//\n// s_growth_factor_numerator\n// s_growth_factor_denominator                  Factor to grow allocation (numerator/denominator).\n//                                              Typically inherited from default traits (3/2)\n//\n// s_density_factor_numerator\n// s_density_factor_denominator                 Maximum occupied density of table before growth\n//                                              occurs (num/denom).  Typically inherited (3/4).\n//\n// s_minimum_allocation                         Minimum table allocation count (size on first growth.)  It is\n//                                              probably preferable to call Reallocate on initialization rather\n//                                              than override his from the default traits. (7)\n//\n// s_supports_remove                            Set to false for a slightly faster implementation that does not\n//                                              support deletes. There is a downside to the s_supports_remove flag,\n//                                              in that there may be more copies of the template instantiated through\n//                                              the system as different variants are used.\n//\n// s_supports_autoremove                        When autoremove is supported, ShouldDelete() is called in addition to\n//                                              IsDeleted() in any situation that involves walking the table's elements, to\n//                                              determine if an element should be deleted. It enables the hash table to\n//                                              self-clean elements whose underlying lifetime may be controlled externally. Note\n//                                              that since some lookup/iteration operations are const (can operate on a\n//                                              \"const SHash\"), when autoremove is supported, any such const operation may still\n//                                              modify the hash table. If this is set to true, s_supports_remove must also be\n//                                              true.\n//\n// s_DestructPerEntryCleanupAction              Set to true if OnDestructPerEntryCleanupAction has non-empty implementation.\n// s_RemovePerEntryCleanupAction                Set to true if OnRemovePerEntryCleanupAction has non-empty implementation.\n//                                              Only one of s_DestructPerEntryCleanupAction and s_RemovePerEntryCleanupAction\n//                                              may be set to true.\n//\n// DefaultHashTraits provides defaults for seldomly customized values in traits classes.\n\ntemplate < typename ELEMENT >\nclass DefaultSHashTraits\n{\n  public:\n    typedef COUNT_T count_t;\n    typedef ELEMENT element_t;\n    typedef DPTR(element_t) PTR_element_t;   // by default SHash is DAC-aware. For RS\n                                             // only SHash use NonDacAwareSHashTraits\n                                             // (which typedefs element_t* PTR_element_t)\n\n    static const COUNT_T s_growth_factor_numerator = 3;\n    static const COUNT_T s_growth_factor_denominator = 2;\n\n    static const COUNT_T s_density_factor_numerator = 3;\n    static const COUNT_T s_density_factor_denominator = 4;\n\n    static const COUNT_T s_minimum_allocation = 7;\n\n    static const bool s_supports_remove = true;\n    static const bool s_supports_autoremove = false;\n\n    static ELEMENT Null() { return (ELEMENT)(TADDR)0; }\n    static ELEMENT Deleted() { return (ELEMENT)(TADDR)-1; }\n    static bool IsNull(const ELEMENT &e) { return e == (ELEMENT)(TADDR)0; }\n    static bool IsDeleted(const ELEMENT &e) { return e == (ELEMENT)(TADDR)-1; }\n    static bool ShouldDelete(const ELEMENT &e) { return false; }\n\n    static inline void OnDestructPerEntryCleanupAction(const ELEMENT& e) { /* Do nothing */ }\n    static const bool s_DestructPerEntryCleanupAction = false;\n\n    static void OnRemovePerEntryCleanupAction(const ELEMENT &e) {}\n    static const bool s_RemovePerEntryCleanupAction = false;\n\n    static const bool s_NoThrow = true;\n\n    // No defaults - must specify:\n    //\n    // typedef key_t;\n    // static key_t GetKey(const element_t &i);\n    // static BOOL Equals(key_t k1, key_t k2);\n    // static count_t Hash(key_t k);\n};\n\n// Hash table class definition\n\ntemplate <typename TRAITS>\nclass EMPTY_BASES_DECL SHash : public TRAITS\n                             , private noncopyable\n{\n    friend class VerifyLayoutsMD;  // verifies class layout doesn't accidentally change\n\n  public:\n    // explicitly declare local typedefs for these traits types, otherwise\n    // the compiler may get confused\n    typedef typename TRAITS::element_t element_t;\n    typedef typename TRAITS::PTR_element_t PTR_element_t;\n    typedef typename TRAITS::key_t key_t;\n    typedef typename TRAITS::count_t count_t;\n\n    class Index;\n    friend class Index;\n    class Iterator;\n\n    class KeyIndex;\n    friend class KeyIndex;\n    class KeyIterator;\n\n    // Constructor/destructor.  SHash tables always start out empty, with no\n    // allocation overhead.  Call Reallocate to prime with an initial size if\n    // desired.\n\n    SHash();\n\n    ~SHash();\n\n    // Lookup an element in the table by key.  Returns NULL if no element in the table\n    // has the given key.  Note that multiple entries for the same key may be stored -\n    // this will return the first element added.  Use KeyIterator to find all elements\n    // with a given key.\n\n    element_t Lookup(key_t key) const;\n\n    // Pointer-based flavor of Lookup (allows efficient access to tables of structures)\n\n    const element_t* LookupPtr(key_t key) const;\n\n    // Pointer-based flavor to replace an existing element (allows efficient access to tables of structures)\n\n    void ReplacePtr(const element_t *elementPtr, const element_t &newElement, bool invokeCleanupAction = true);\n\n    // Add an element to the hash table.  This will never replace an element; multiple\n    // elements may be stored with the same key.\n\n    void Add(const element_t &element);\n\n    // NoThrow version of Add. Returns TRUE if element was added, FALSE otherwise.\n    BOOL AddNoThrow(const element_t &element);\n\n    // Add a new element to the hash table, if no element with the same key is already\n    // there. Otherwise, it will replace the existing element. This has the effect of\n    // updating an element rather than adding a duplicate.\n    void AddOrReplace(const element_t & element);\n\n    // NoThrow version of AddOrReplace. Returns TRUE if element was added/replaced, FALSE otherwise.\n    BOOL AddOrReplaceNoThrow(const element_t &element);\n\n    // Remove the first element matching the key from the hash table.\n\n    void Remove(key_t key);\n\n    // Remove the specific element.\n\n    void Remove(Iterator& i);\n    void Remove(KeyIterator& i);\n\n    // Pointer-based flavor of Remove (allows efficient access to tables of structures)\n\n    void RemovePtr(element_t * element);\n\n    // Remove all elements in the hashtable\n\n    void RemoveAll();\n\n    // Begin and End pointers for iteration over entire table.\n\n    Iterator Begin() const;\n    Iterator End() const;\n\n    // Begin and End pointers for iteration over all elements with a given key.\n\n    KeyIterator Begin(key_t key) const;\n    KeyIterator End(key_t key) const;\n\n    // Return the number of elements currently stored in the table\n\n    count_t GetCount() const;\n\n    // Return the number of elements allocated in the table\n\n    count_t GetCapacity() const;\n\n    // Resizes a hash table for growth.  The new size is computed based\n    // on the current population, growth factor, and maximum density factor.\n\n    void Grow();\n\n    // Reallocates a hash table to a specific size.  The size must be big enough\n    // to hold all elements in the table appropriately.\n    //\n    // Note that the actual table size must always be a prime number; the number\n    // passed in will be upward adjusted if necessary.\n\n    void Reallocate(count_t newTableSize);\n\n    // Makes a call on the Functor for each element in the hash table, passing\n    // the element as an argument. Functor is expected to look like this:\n    //\n    // class Functor\n    // {\n    //     public:\n    //     void operator() (element_t &element) { ... }\n    // }\n\n    template<typename Functor> void ForEach(Functor &functor);\n\n  private:\n\n    // NoThrow version of Grow function. Returns FALSE on failure.\n    BOOL GrowNoThrow();\n\n    // See if it is OK to grow the hash table by one element.  If not, reallocate\n    // the hash table.\n    BOOL CheckGrowth();\n\n    // NoThrow version of CheckGrowth function. Returns FALSE on failure.\n    BOOL CheckGrowthNoThrow();\n\n    // Allocates new resized hash table for growth. Does not update the hash table on the object.\n    // The new size is computed based on the current population, growth factor, and maximum density factor.\n    element_t * Grow_OnlyAllocateNewTable(count_t * pcNewSize);\n\n    // NoThrow version of Grow_OnlyAllocateNewTable. Returns NULL on failure.\n    element_t * Grow_OnlyAllocateNewTableNoThrow(count_t * pcNewSize);\n\n    // Utility function to allocate new table (does not copy the values into it yet). Returns the size of new table in\n    // *pcNewTableSize (finds next prime).\n    // Phase 1 of code:Reallocate\n    element_t * AllocateNewTable(count_t requestedSize, count_t * pcNewTableSize);\n\n    // NoThrow version of AllocateNewTable utility function. Returns NULL on failure.\n    element_t * AllocateNewTableNoThrow(count_t requestedSize, count_t * pcNewTableSize);\n\n    // Utility function to replace old table with newly allocated table (as allocated by\n    // code:AllocateNewTable). Copies all 'old' values into the new table first.\n    // Returns the old table. Caller is expected to delete it (via code:DeleteOldTable).\n    // Phase 2 of code:Reallocate\n    element_t * ReplaceTable(element_t * newTable, count_t newTableSize);\n\n    // Utility function to delete old table (as returned by code:ReplaceTable).\n    // Phase 3 of code:Reallocate\n    void DeleteOldTable(element_t * oldTable);\n\n    // Utility function that does not call code:CheckGrowth.\n    // Add an element to the hash table.  This will never replace an element; multiple\n    // elements may be stored with the same key.\n    void Add_GrowthChecked(const element_t & element);\n\n    // Utility function to add a new element to the hash table.  Note that\n    // it is perfectly fine for the element to be a duplicate - if so it\n    // is added an additional time. Returns TRUE if a new empty spot was used;\n    // FALSE if an existing deleted slot.\n    BOOL Add(element_t *table, count_t tableSize, const element_t &element);\n\n    // Utility function to add a new element to the hash table, if no element with the same key\n    // is already there. Otherwise, it will replace the existing element. This has the effect of\n    // updating an element rather than adding a duplicate.\n    void AddOrReplace(element_t *table, count_t tableSize, const element_t &element);\n\n    // Utility function to find the first element with the given key in\n    // the hash table.\n\n    const element_t* Lookup(PTR_element_t table, count_t tableSize, key_t key) const;\n\n    // Utility function to remove the first element with the given key\n    // in the hash table.\n\n    void Remove(element_t *table, count_t tableSize, key_t key);\n\n    // Utility function to remove the specific element.\n\n    void RemoveElement(element_t *table, count_t tableSize, element_t *element);\n\n    // Index for whole table iterator.  This is also the base for the keyed iterator.\n\n  public:\n\n    class EMPTY_BASES_DECL Index\n        : public CheckedIteratorBase< SHash<TRAITS> >\n    {\n        friend class SHash;\n        friend class Iterator;\n        friend class Enumerator<const element_t, Iterator>;\n\n        // The methods implementation has to be here for portability\n        // Some compilers won't compile the separate implementation in shash.inl\n      protected:\n\n        SHash *m_hash;\n        PTR_element_t m_table;\n        count_t m_tableSize;\n        count_t m_index;\n\n        // Iteration may modify the hash table if s_supports_autoremove is true. Since it typically does not modify the hash\n        // table, it should be possible to iterate over a \"const SHash\". So this takes a \"const SHash *\" and casts away the\n        // const to support autoremove.\n        Index(const SHash *hash, BOOL begin)\n        : m_hash(const_cast<SHash *>(hash)),\n            m_table(hash->m_table),\n            m_tableSize(hash->m_tableSize),\n            m_index(begin ? 0 : m_tableSize)\n        {\n            LIMITED_METHOD_CONTRACT;\n        }\n\n        const element_t &Get() const\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            return m_table[m_index];\n        }\n\n        void First()\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            if (m_index >= m_tableSize)\n            {\n                return;\n            }\n\n            if (!TRAITS::IsNull(m_table[m_index]) && !TRAITS::IsDeleted(m_table[m_index]))\n            {\n                if (TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(m_table[m_index]))\n                {\n                    m_hash->RemoveElement(m_table, m_tableSize, &m_table[m_index]);\n                }\n                else\n                {\n                    return;\n                }\n            }\n\n            Next();\n        }\n\n        void Next()\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            if (m_index >= m_tableSize)\n                return;\n\n            for (;;)\n            {\n                m_index++;\n                if (m_index >= m_tableSize)\n                    break;\n                if (!TRAITS::IsNull(m_table[m_index]) && !TRAITS::IsDeleted(m_table[m_index]))\n                {\n                    if (TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(m_table[m_index]))\n                    {\n                        m_hash->RemoveElement(m_table, m_tableSize, &m_table[m_index]);\n                    }\n                    else\n                    {\n                        break;\n                    }\n                }\n            }\n        }\n\n        bool Equal(const Index &i) const\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            return i.m_index == m_index;\n        }\n\n        CHECK DoCheck() const\n        {\n            CHECK_OK;\n        }\n    };\n\n    class EMPTY_BASES_DECL Iterator : public Index, public Enumerator<const element_t, Iterator>\n    {\n        friend class SHash;\n\n      public:\n        Iterator(const SHash *hash, BOOL begin)\n          : Index(hash, begin)\n        {\n        }\n    };\n\n    // Index for iterating elements with a given key.\n    //\n    // Note that the m_index field\n    // is artificially bumped to m_tableSize when the end of iteration is reached.\n    // This allows a canonical End iterator to be used.\n\n    class EMPTY_BASES_DECL KeyIndex : public Index\n    {\n        friend class SHash;\n        friend class KeyIterator;\n        friend class Enumerator<const element_t, KeyIterator>;\n\n        // The methods implementation has to be here for portability\n        // Some compilers won't compile the separate implementation in shash.inl\n      protected:\n        key_t       m_key;\n        count_t     m_increment;\n\n        KeyIndex(const SHash *hash, BOOL begin)\n        : Index(hash, begin),\n            m_increment(0)\n        {\n            LIMITED_METHOD_CONTRACT;\n        }\n\n        void SetKey(key_t key)\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            if (Index::m_tableSize > 0)\n            {\n                m_key = key;\n                count_t hash = TRAITS::Hash(key);\n\n                this->m_index = hash % this->m_tableSize;\n                m_increment = (hash % (this->m_tableSize-1)) + 1;\n\n                // Find first valid element\n\n                if (TRAITS::IsNull(this->m_table[this->m_index]))\n                {\n                    this->m_index = this->m_tableSize;\n                    return;\n                }\n\n                if (!TRAITS::IsDeleted(this->m_table[this->m_index]))\n                {\n                    if (TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(this->m_table[this->m_index]))\n                    {\n                        this->m_hash->RemoveElement(this->m_table, this->m_tableSize, &this->m_table[this->m_index]);\n                    }\n                    else if (TRAITS::Equals(m_key, TRAITS::GetKey(this->m_table[this->m_index])))\n                    {\n                        return;\n                    }\n                }\n\n                Next();\n            }\n        }\n\n        void Next()\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            while (TRUE)\n            {\n                this->m_index += m_increment;\n                if (this->m_index >= this->m_tableSize)\n                    this->m_index -= this->m_tableSize;\n\n                if (TRAITS::IsNull(this->m_table[this->m_index]))\n                {\n                    this->m_index = this->m_tableSize;\n                    break;\n                }\n\n                if (TRAITS::IsDeleted(this->m_table[this->m_index]))\n                {\n                    continue;\n                }\n\n                if (TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(this->m_table[this->m_index]))\n                {\n                    this->m_hash->RemoveElement(this->m_table, this->m_tableSize, &this->m_table[this->m_index]);\n                    continue;\n                }\n\n                if (TRAITS::Equals(m_key, TRAITS::GetKey(this->m_table[this->m_index])))\n                {\n                    break;\n                }\n            }\n        }\n    };\n\n    class EMPTY_BASES_DECL KeyIterator : public KeyIndex, public Enumerator<const element_t, KeyIterator>\n    {\n        friend class SHash;\n\n      public:\n\n        operator Iterator &()\n        {\n            return *(Iterator*)this;\n        }\n\n        operator const Iterator &()\n        {\n            return *(const Iterator*)this;\n        }\n\n        KeyIterator(const SHash *hash, BOOL begin)\n          : KeyIndex(hash, begin)\n        {\n        }\n    };\n\n\n  private:\n\n    // Test for prime number.\n    static BOOL IsPrime(COUNT_T number);\n\n    // Find the next prime number >= the given value.\n\n    static COUNT_T NextPrime(COUNT_T number);\n\n    // Instance members\n\n    PTR_element_t m_table;                // pointer to table\n    count_t       m_tableSize;            // allocated size of table\n    count_t       m_tableCount;           // number of elements in table\n    count_t       m_tableOccupied;        // number, includes deleted slots\n    count_t       m_tableMax;             // maximum occupied count before reallocating\n};  // class SHash\n\n// disables support for DAC marshaling. Useful for defining right-side only SHashes\ntemplate <typename PARENT>\nclass EMPTY_BASES_DECL NonDacAwareSHashTraits : public PARENT\n{\npublic:\n    typedef typename PARENT::element_t element_t;\n    typedef element_t * PTR_element_t;\n};\n\n// disables support for removing elements - produces slightly faster implementation\n\ntemplate <typename PARENT>\nclass EMPTY_BASES_DECL NoRemoveSHashTraits : public PARENT\n{\npublic:\n    // explicitly declare local typedefs for these traits types, otherwise\n    // the compiler may get confused\n    typedef typename PARENT::element_t element_t;\n    typedef typename PARENT::count_t count_t;\n\n    static const bool s_supports_remove = false;\n    static element_t Deleted() { UNREACHABLE(); }\n    static bool IsDeleted(const element_t &e) { LIMITED_METHOD_DAC_CONTRACT; return false; }\n};\n\n// PtrHashTraits is a template to provides useful defaults for pointer hash tables\n// It relies on methods GetKey and Hash defined on ELEMENT\n\ntemplate <typename ELEMENT, typename KEY>\nclass EMPTY_BASES_DECL PtrSHashTraits : public DefaultSHashTraits<ELEMENT *>\n{\n  public:\n\n    // explicitly declare local typedefs for these traits types, otherwise\n    // the compiler may get confused\n    typedef DefaultSHashTraits<ELEMENT *> PARENT;\n    typedef typename PARENT::element_t element_t;\n    typedef typename PARENT::count_t count_t;\n\n    typedef KEY key_t;\n\n    static key_t GetKey(const element_t &e)\n    {\n        WRAPPER_NO_CONTRACT;\n        return e->GetKey();\n    }\n    static BOOL Equals(key_t k1, key_t k2)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return k1 == k2;\n    }\n    static count_t Hash(key_t k)\n    {\n        WRAPPER_NO_CONTRACT;\n        return ELEMENT::Hash(k);\n    }\n};\n\ntemplate <typename ELEMENT, typename KEY>\nclass EMPTY_BASES_DECL PtrSHash : public SHash< PtrSHashTraits<ELEMENT, KEY> >\n{\n};\n\ntemplate <typename ELEMENT, typename KEY>\nclass PtrSHashWithCleanupTraits\n    : public PtrSHashTraits<ELEMENT, KEY>\n{\npublic:\n    void OnDestructPerEntryCleanupAction(ELEMENT * elem)\n    {\n        delete elem;\n    }\n    static const bool s_DestructPerEntryCleanupAction = true;\n};\n\n// a class that automatically deletes data referenced by the pointers (so effectively it takes ownership of the data)\n// since I was too lazy to implement Remove() APIs properly, removing entries is disallowed\ntemplate <typename ELEMENT, typename KEY>\nclass EMPTY_BASES_DECL PtrSHashWithCleanup : public SHash< NoRemoveSHashTraits< PtrSHashWithCleanupTraits<ELEMENT, KEY> > >\n{\n};\n\n// Provides case-sensitive comparison and hashing functionality through static\n// and functor object methods. Can be instantiated with CHAR or WCHAR.\ntemplate <typename CharT>\nstruct CaseSensitiveStringCompareHash\n{\nprivate:\n    typedef CharT const * str_t;\n\n    static size_t _strcmp(CHAR const *left, CHAR const *right)\n    {\n        return ::strcmp(left, right);\n    }\n\n    static size_t _strcmp(WCHAR const *left, WCHAR const *right)\n    {\n        return ::wcscmp(left, right);\n    }\n\n    static size_t _hash(CHAR const *str)\n    {\n        return HashStringA(str);\n    }\n\n    static size_t _hash(WCHAR const *str)\n    {\n        return HashString(str);\n    }\n\npublic:\n    static size_t compare(str_t left, str_t right)\n    {\n        return _strcmp(left, right);\n    }\n\n    size_t operator()(str_t left, str_t right)\n    {\n        return compare(left, right);\n    }\n\n    static size_t hash(str_t str)\n    {\n        return _hash(str);\n    }\n\n    size_t operator()(str_t str)\n    {\n        return hash(str);\n    }\n};\n\n// Provides case-insensitive comparison and hashing functionality through static\n// and functor object methods. Can be instantiated with CHAR or WCHAR.\ntemplate <typename CharT>\nstruct CaseInsensitiveStringCompareHash\n{\nprivate:\n    typedef CharT const * str_t;\n\n    static size_t _strcmp(str_t left, str_t right)\n    {\n        return ::SString::_tstricmp(left, right);\n    }\n\n    static size_t _hash(CHAR const *str)\n    {\n        return HashiStringA(str);\n    }\n\n    static size_t _hash(WCHAR const *str)\n    {\n        return HashiString(str);\n    }\n\npublic:\n    static size_t compare(str_t left, str_t right)\n    {\n        return _strcmp(left, right);\n    }\n\n    size_t operator()(str_t left, str_t right)\n    {\n        return compare(left, right);\n    }\n\n    static size_t hash(str_t str)\n    {\n        return _hash(str);\n    }\n\n    size_t operator()(str_t str)\n    {\n        return hash(str);\n    }\n};\n\n// StringSHashTraits is a traits class useful for string-keyed\n// pointer hash tables.\n\ntemplate <typename ElementT, typename CharT, typename ComparerT = CaseSensitiveStringCompareHash<CharT> >\nclass EMPTY_BASES_DECL StringSHashTraits : public PtrSHashTraits<ElementT, CharT const *>\n{\npublic:\n    // explicitly declare local typedefs for these traits types, otherwise\n    // the compiler may get confused\n    typedef PtrSHashTraits<ElementT, CharT const *> PARENT;\n    typedef typename PARENT::element_t element_t;\n    typedef typename PARENT::key_t key_t;\n    typedef typename PARENT::count_t count_t;\n\n    static BOOL Equals(key_t k1, key_t k2)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        if (k1 == NULL && k2 == NULL)\n            return TRUE;\n        if (k1 == NULL || k2 == NULL)\n            return FALSE;\n        return ComparerT::compare(k1, k2) == 0;\n    }\n    static count_t Hash(key_t k)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        if (k == NULL)\n            return 0;\n        else\n            return (count_t)ComparerT::hash(k);\n    }\n};\n\ntemplate <typename COMINTERFACE, typename CharT> // Could use IUnknown but would rather take advantage of C++ type checking\nstruct StringHashElement\n{\n    const CharT *GetKey()\n    {\n        return String;\n    }\n\n    COMINTERFACE *Object;\n    CharT *String;\n};\n\ntemplate <typename COMINTERFACE, typename CharT, typename ComparerT = CaseSensitiveStringCompareHash<CharT> >\nclass EMPTY_BASES_DECL StringHashWithCleanupTraits : public StringSHashTraits<StringHashElement<COMINTERFACE, CharT>, CharT, ComparerT>\n{\npublic:\n    void OnDestructPerEntryCleanupAction(StringHashElement<COMINTERFACE, CharT> * e)\n    {\n        if (e->String != NULL)\n        {\n            delete[] e->String;\n        }\n\n        if (e->Object != NULL)\n        {\n            e->Object->Release();\n        }\n    }\n    static const bool s_DestructPerEntryCleanupAction = true;\n};\n\ntemplate <typename COMINTERFACE, typename CharT, typename ComparerT = CaseSensitiveStringCompareHash<CharT> >\nclass EMPTY_BASES_DECL StringSHashWithCleanup : public SHash< StringHashWithCleanupTraits<COMINTERFACE, CharT, ComparerT> >\n{\n};\n\ntemplate <typename ELEMENT>\nclass EMPTY_BASES_DECL StringSHash : public SHash< StringSHashTraits<ELEMENT, CHAR> >\n{\n};\n\ntemplate <typename ELEMENT>\nclass EMPTY_BASES_DECL WStringSHash : public SHash< StringSHashTraits<ELEMENT, WCHAR> >\n{\n};\n\ntemplate <typename ELEMENT>\nclass EMPTY_BASES_DECL SStringSHashTraits : public PtrSHashTraits<ELEMENT, SString>\n{\n  public:\n    typedef PtrSHashTraits<ELEMENT, SString> PARENT;\n    typedef typename PARENT::element_t element_t;\n    typedef typename PARENT::key_t key_t;\n    typedef typename PARENT::count_t count_t;\n\n    static const bool s_NoThrow = false;\n\n    static BOOL Equals(const key_t &k1, const key_t &k2)\n    {\n        WRAPPER_NO_CONTRACT;\n        return k1.Equals(k2);\n    }\n    static count_t Hash(const key_t &k)\n    {\n        WRAPPER_NO_CONTRACT;\n        return k.Hash();\n    }\n};\n\ntemplate <typename ELEMENT>\nclass EMPTY_BASES_DECL SStringSHash : public SHash< SStringSHashTraits<ELEMENT> >\n{\n};\n\ntemplate <typename ELEMENT>\nclass EMPTY_BASES_DECL SetSHashTraits : public DefaultSHashTraits<ELEMENT>\n{\npublic:\n    // explicitly declare local typedefs for these traits types, otherwise\n    // the compiler may get confused\n    typedef typename DefaultSHashTraits<ELEMENT>::element_t element_t;\n    typedef typename DefaultSHashTraits<ELEMENT>::count_t count_t;\n\n    typedef ELEMENT key_t;\n\n    static key_t GetKey(element_t e)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return e;\n    }\n    static BOOL Equals(key_t k1, key_t k2)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return k1 == k2;\n    }\n    static count_t Hash(key_t k)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (count_t)(size_t)k;\n    }\n};\n\ntemplate <typename ELEMENT, typename TRAITS = NoRemoveSHashTraits< SetSHashTraits <ELEMENT> > >\nclass EMPTY_BASES_DECL SetSHash : public SHash< TRAITS >\n{\n    typedef SHash<TRAITS> PARENT;\n\npublic:\n    BOOL Contains(ELEMENT key) const\n    {\n        return PARENT::LookupPtr(key) != NULL;\n    }\n};\n\ntemplate <typename ELEMENT>\nclass EMPTY_BASES_DECL PtrSetSHashTraits : public SetSHashTraits<ELEMENT>\n{\n  public:\n\n    // explicitly declare local typedefs for these traits types, otherwise\n    // the compiler may get confused\n    typedef SetSHashTraits<ELEMENT> PARENT;\n    typedef typename PARENT::element_t element_t;\n    typedef typename PARENT::key_t key_t;\n    typedef typename PARENT::count_t count_t;\n\n    static count_t Hash(key_t k)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (count_t)(size_t)k >> 2;\n    }\n};\n\ntemplate <typename PARENT_TRAITS>\nclass EMPTY_BASES_DECL DeleteElementsOnDestructSHashTraits : public PARENT_TRAITS\n{\npublic:\n    static inline void OnDestructPerEntryCleanupAction(typename PARENT_TRAITS::element_t e)\n    {\n        delete e;\n    }\n    static const bool s_DestructPerEntryCleanupAction = true;\n};\n\n#if !defined(CC_JIT) // workaround: Key is redefined in JIT64\n\ntemplate <typename KEY, typename VALUE>\nclass KeyValuePair {\n    KEY     key;\n    VALUE   value;\n\npublic:\n    KeyValuePair()\n    {\n    }\n\n    KeyValuePair(const KEY& k, const VALUE& v)\n        : key(k), value(v)\n    {\n    }\n\n    KEY const & Key() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        return key;\n    }\n\n    VALUE const & Value() const\n    {\n        LIMITED_METHOD_CONTRACT;\n        return value;\n    }\n};\n\ntemplate <typename KEY, typename VALUE>\nclass EMPTY_BASES_DECL MapSHashTraits : public DefaultSHashTraits< KeyValuePair<KEY,VALUE> >\n{\npublic:\n    // explicitly declare local typedefs for these traits types, otherwise\n    // the compiler may get confused\n    typedef typename DefaultSHashTraits< KeyValuePair<KEY,VALUE> >::element_t element_t;\n    typedef typename DefaultSHashTraits< KeyValuePair<KEY,VALUE> >::count_t count_t;\n\n    typedef KEY key_t;\n\n    static key_t GetKey(element_t e)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return e.Key();\n    }\n    static BOOL Equals(key_t k1, key_t k2)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return k1 == k2;\n    }\n    static count_t Hash(key_t k)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (count_t)(size_t)k;\n    }\n\n    static const element_t Null() { LIMITED_METHOD_CONTRACT; return element_t(KEY(),VALUE()); }\n    static const element_t Deleted() { LIMITED_METHOD_CONTRACT; return element_t(KEY(-1), VALUE()); }\n    static bool IsNull(const element_t &e) { LIMITED_METHOD_CONTRACT; return e.Key() == KEY(); }\n    static bool IsDeleted(const element_t &e) { return e.Key() == KEY(-1); }\n};\n\ntemplate <typename KEY, typename VALUE, typename TRAITS = NoRemoveSHashTraits< MapSHashTraits <KEY, VALUE> > >\nclass EMPTY_BASES_DECL MapSHash : public SHash< TRAITS >\n{\n    typedef SHash< TRAITS > PARENT;\n\npublic:\n    void Add(KEY key, VALUE value)\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n            PRECONDITION(key != (KEY)0);\n        }\n        CONTRACTL_END;\n\n        PARENT::Add(KeyValuePair<KEY,VALUE>(key, value));\n    }\n\n    BOOL Lookup(KEY key, VALUE* pValue) const;\n};\n\ntemplate <typename KEY, typename VALUE>\nclass EMPTY_BASES_DECL MapSHashWithRemove : public SHash< MapSHashTraits <KEY, VALUE> >\n{\n    typedef SHash< MapSHashTraits <KEY, VALUE> > PARENT;\n\npublic:\n    void Add(KEY key, VALUE value)\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n            PRECONDITION(key != (KEY)0 && key != (KEY)-1);\n        }\n        CONTRACTL_END;\n\n        PARENT::Add(KeyValuePair<KEY,VALUE>(key, value));\n    }\n\n    BOOL Lookup(KEY key, VALUE* pValue) const\n    {\n        CONTRACTL\n        {\n            NOTHROW;\n            GC_NOTRIGGER;\n            PRECONDITION(key != (KEY)0 && key != (KEY)-1);\n        }\n        CONTRACTL_END;\n\n        const KeyValuePair<KEY,VALUE> *pRet = PARENT::LookupPtr(key);\n        if (pRet == NULL)\n            return FALSE;\n\n        *pValue = pRet->Value();\n        return TRUE;\n    }\n\n    void Remove(KEY key)\n    {\n        CONTRACTL\n        {\n            NOTHROW;\n            GC_NOTRIGGER;\n            PRECONDITION(key != (KEY)0 && key != (KEY)-1);\n        }\n        CONTRACTL_END;\n\n        PARENT::Remove(key);\n    }\n};\n\n#endif // CC_JIT\n\n#include \"shash.inl\"\n\n#endif // _SHASH_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/shash.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _SHASH_INL_\n#define _SHASH_INL_\n\n// Many SHash functions do not throw on their own, but may propagate an exception\n// from Hash, Equals, or GetKey.\n#define NOTHROW_UNLESS_TRAITS_THROWS     if (TRAITS::s_NoThrow) NOTHROW; else THROWS\n\nvoid DECLSPEC_NORETURN ThrowOutOfMemory();\n\ntemplate <typename TRAITS>\nSHash<TRAITS>::SHash()\n  : m_table(nullptr),\n    m_tableSize(0),\n    m_tableCount(0),\n    m_tableOccupied(0),\n    m_tableMax(0)\n{\n    LIMITED_METHOD_CONTRACT;\n\n#ifndef __GNUC__ // these crash GCC\n    static_assert_no_msg(SHash<TRAITS>::s_growth_factor_numerator > SHash<TRAITS>::s_growth_factor_denominator);\n    static_assert_no_msg(SHash<TRAITS>::s_density_factor_numerator < SHash<TRAITS>::s_density_factor_denominator);\n#endif\n\n    static_assert_no_msg(TRAITS::s_supports_remove || !TRAITS::s_supports_autoremove);\n    static_assert_no_msg(!TRAITS::s_DestructPerEntryCleanupAction || !TRAITS::s_RemovePerEntryCleanupAction);\n}\n\ntemplate <typename TRAITS>\nSHash<TRAITS>::~SHash()\n{\n    LIMITED_METHOD_CONTRACT;\n\n    if (TRAITS::s_DestructPerEntryCleanupAction)\n    {\n        for (Iterator i = Begin(); i != End(); i++)\n        {\n            TRAITS::OnDestructPerEntryCleanupAction(*i);\n        }\n    }\n    else if (TRAITS::s_RemovePerEntryCleanupAction)\n    {\n        for (Iterator i = Begin(); i != End(); i++)\n        {\n            TRAITS::OnRemovePerEntryCleanupAction(*i);\n        }\n    }\n\n    delete [] m_table;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::count_t SHash<TRAITS>::GetCount() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return m_tableCount;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::count_t SHash<TRAITS>::GetCapacity() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return m_tableMax;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::element_t SHash<TRAITS>::Lookup(key_t key) const\n{\n    CONTRACT(element_t)\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        POSTCONDITION(TRAITS::IsNull(RETVAL) || TRAITS::Equals(key, TRAITS::GetKey(RETVAL)));\n        SUPPORTS_DAC_WRAPPER;\n    }\n    CONTRACT_END;\n\n    const element_t *pRet = Lookup(m_table, m_tableSize, key);\n    RETURN ((pRet != NULL) ? (*pRet) : TRAITS::Null());\n}\n\ntemplate <typename TRAITS>\nconst typename SHash<TRAITS>::element_t * SHash<TRAITS>::LookupPtr(key_t key) const\n{\n    CONTRACT(const element_t *)\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        POSTCONDITION(RETVAL == NULL || TRAITS::Equals(key, TRAITS::GetKey(*RETVAL)));\n    }\n    CONTRACT_END;\n\n    RETURN Lookup(m_table, m_tableSize, key);\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::ReplacePtr(const element_t *elementPtr, const element_t &newElement, bool invokeCleanupAction)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(m_table <= elementPtr);\n        PRECONDITION(elementPtr < m_table + m_tableSize);\n        PRECONDITION(!TRAITS::IsNull(*elementPtr));\n        PRECONDITION(!TRAITS::IsDeleted(*elementPtr));\n        PRECONDITION(!TRAITS::IsNull(newElement));\n        PRECONDITION(!TRAITS::IsDeleted(newElement));\n        PRECONDITION(TRAITS::Equals(TRAITS::GetKey(newElement), TRAITS::GetKey(*elementPtr)));\n    }\n    CONTRACT_END;\n\n    if (TRAITS::s_RemovePerEntryCleanupAction && invokeCleanupAction)\n    {\n        TRAITS::OnRemovePerEntryCleanupAction(*elementPtr);\n    }\n\n    *const_cast<element_t *>(elementPtr) = newElement;\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Add(const element_t & element)\n{\n    CONTRACT_VOID\n    {\n        THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        POSTCONDITION(TRAITS::Equals(TRAITS::GetKey(element), TRAITS::GetKey(*LookupPtr(TRAITS::GetKey(element)))));\n    }\n    CONTRACT_END;\n\n    CheckGrowth();\n\n    Add_GrowthChecked(element);\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nBOOL SHash<TRAITS>::AddNoThrow(const element_t & element)\n{\n    CONTRACT(BOOL)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        POSTCONDITION(TRAITS::Equals(TRAITS::GetKey(element), TRAITS::GetKey(*LookupPtr(TRAITS::GetKey(element)))));\n    }\n    CONTRACT_END;\n\n    static_assert(TRAITS::s_NoThrow, \"This SHash does not support NOTHROW.\");\n\n    BOOL haveSpace = CheckGrowthNoThrow();\n    if (haveSpace)\n        Add_GrowthChecked(element);\n\n    RETURN haveSpace;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Add_GrowthChecked(const element_t & element)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        POSTCONDITION(TRAITS::Equals(TRAITS::GetKey(element), TRAITS::GetKey(*LookupPtr(TRAITS::GetKey(element)))));\n    }\n    CONTRACT_END;\n\n    if (Add(m_table, m_tableSize, element))\n        m_tableOccupied++;\n    m_tableCount++;\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::AddOrReplace(const element_t &element)\n{\n    CONTRACT_VOID\n    {\n        THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        static_assert(!TRAITS::s_supports_remove, \"SHash::AddOrReplace is not implemented for SHash with support for remove operations.\");\n        POSTCONDITION(TRAITS::Equals(TRAITS::GetKey(element), TRAITS::GetKey(*LookupPtr(TRAITS::GetKey(element)))));\n    }\n    CONTRACT_END;\n\n    CheckGrowth();\n\n    AddOrReplace(m_table, m_tableSize, element);\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nBOOL SHash<TRAITS>::AddOrReplaceNoThrow(const element_t &element)\n{\n     CONTRACT(BOOL)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        static_assert(!TRAITS::s_supports_remove, \"SHash::AddOrReplaceNoThrow is not implemented for SHash with support for remove operations.\");\n        POSTCONDITION(TRAITS::Equals(TRAITS::GetKey(element), TRAITS::GetKey(*LookupPtr(TRAITS::GetKey(element)))));\n    }\n    CONTRACT_END;\n\n    static_assert(TRAITS::s_NoThrow, \"This SHash does not support NOTHROW.\");\n\n    BOOL haveSpace = CheckGrowthNoThrow();\n    if (haveSpace)\n        AddOrReplace(m_table, m_tableSize, element);\n\n    RETURN haveSpace;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Remove(key_t key)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        static_assert(TRAITS::s_supports_remove, \"This SHash does not support remove operations.\");\n        PRECONDITION(!(TRAITS::IsNull(Lookup(key))));\n    }\n    CONTRACT_END;\n\n    Remove(m_table, m_tableSize, key);\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Remove(Iterator& i)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        static_assert(TRAITS::s_supports_remove, \"This SHash does not support remove operations.\");\n        PRECONDITION(!(TRAITS::IsNull(*i)));\n        PRECONDITION(!(TRAITS::IsDeleted(*i)));\n    }\n    CONTRACT_END;\n\n    RemoveElement(m_table, m_tableSize, (element_t*)&(*i));\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Remove(KeyIterator& i)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        static_assert(TRAITS::s_supports_remove, \"This SHash does not support remove operations.\");\n        PRECONDITION(!(TRAITS::IsNull(*i)));\n        PRECONDITION(!(TRAITS::IsDeleted(*i)));\n    }\n    CONTRACT_END;\n\n    RemoveElement(m_table, m_tableSize, (element_t*)&(*i));\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::RemovePtr(element_t * p)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        static_assert(TRAITS::s_supports_remove, \"This SHash does not support remove operations.\");\n        PRECONDITION(!(TRAITS::IsNull(*p)));\n        PRECONDITION(!(TRAITS::IsDeleted(*p)));\n    }\n    CONTRACT_END;\n\n    RemoveElement(m_table, m_tableSize, p);\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::RemoveAll()\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n    }\n    CONTRACT_END;\n\n    if (TRAITS::s_RemovePerEntryCleanupAction)\n    {\n        for (Iterator i = Begin(); i != End(); i++)\n        {\n            TRAITS::OnRemovePerEntryCleanupAction(*i);\n        }\n    }\n\n    delete [] m_table;\n\n    m_table = NULL;\n    m_tableSize = 0;\n    m_tableCount = 0;\n    m_tableOccupied = 0;\n    m_tableMax = 0;\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::Iterator SHash<TRAITS>::Begin() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    Iterator i(this, TRUE);\n    i.First();\n    return i;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::Iterator SHash<TRAITS>::End() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return Iterator(this, FALSE);\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::KeyIterator SHash<TRAITS>::Begin(key_t key) const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    KeyIterator k(this, TRUE);\n    k.SetKey(key);\n    return k;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::KeyIterator SHash<TRAITS>::End(key_t key) const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return KeyIterator(this, FALSE);\n}\n\ntemplate <typename TRAITS>\nBOOL SHash<TRAITS>::CheckGrowth()\n{\n    CONTRACT(BOOL)\n    {\n        THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n    }\n    CONTRACT_END;\n\n    if (m_tableOccupied == m_tableMax)\n    {\n        Grow();\n        RETURN TRUE;\n    }\n\n    RETURN FALSE;\n}\n\ntemplate <typename TRAITS>\nBOOL SHash<TRAITS>::CheckGrowthNoThrow()\n{\n    CONTRACT(BOOL)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n    }\n    CONTRACT_END;\n\n    static_assert(TRAITS::s_NoThrow, \"This SHash does not support NOTHROW.\");\n\n    BOOL result = TRUE;\n    if (m_tableOccupied == m_tableMax)\n    {\n        result = GrowNoThrow();\n    }\n\n    RETURN result;\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Grow()\n{\n    CONTRACT_VOID\n    {\n        THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n    }\n    CONTRACT_END;\n\n    count_t     newSize;\n    element_t * newTable = Grow_OnlyAllocateNewTable(&newSize);\n    element_t * oldTable = ReplaceTable(newTable, newSize);\n    DeleteOldTable(oldTable);\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nBOOL SHash<TRAITS>::GrowNoThrow()\n{\n    CONTRACT(BOOL)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(TRAITS::s_NoThrow);\n    }\n    CONTRACT_END;\n\n    count_t     newSize;\n    element_t * newTable = Grow_OnlyAllocateNewTableNoThrow(&newSize);\n    if (newTable)\n    {\n        element_t * oldTable = ReplaceTable(newTable, newSize);\n        DeleteOldTable(oldTable);\n    }\n\n    RETURN (newTable != NULL);\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::element_t *\nSHash<TRAITS>::Grow_OnlyAllocateNewTable(count_t * pcNewSize)\n{\n    CONTRACT(element_t *)\n    {\n        THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n    }\n    CONTRACT_END;\n\n    count_t newSize = (count_t) (m_tableCount\n                                 * TRAITS::s_growth_factor_numerator / TRAITS::s_growth_factor_denominator\n                                 * TRAITS::s_density_factor_denominator / TRAITS::s_density_factor_numerator);\n    if (newSize < TRAITS::s_minimum_allocation)\n        newSize = TRAITS::s_minimum_allocation;\n\n    // handle potential overflow\n    if (newSize < m_tableCount)\n        ThrowOutOfMemory();\n\n    RETURN AllocateNewTable(newSize, pcNewSize);\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::element_t *\nSHash<TRAITS>::Grow_OnlyAllocateNewTableNoThrow(count_t * pcNewSize)\n{\n    CONTRACT(element_t *)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(TRAITS::s_NoThrow);\n    }\n    CONTRACT_END;\n\n    count_t newSize = (count_t) (m_tableCount\n                                 * TRAITS::s_growth_factor_numerator / TRAITS::s_growth_factor_denominator\n                                 * TRAITS::s_density_factor_denominator / TRAITS::s_density_factor_numerator);\n    if (newSize < TRAITS::s_minimum_allocation)\n        newSize = TRAITS::s_minimum_allocation;\n\n    // handle potential overflow\n    if (newSize < m_tableCount)\n        return NULL;\n\n    RETURN AllocateNewTableNoThrow(newSize, pcNewSize);\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Reallocate(count_t requestedSize)\n{\n    CONTRACT_VOID\n    {\n        THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n    }\n    CONTRACT_END;\n\n    count_t newTableSize;\n    element_t * newTable = AllocateNewTable(requestedSize, &newTableSize);\n    element_t * oldTable = ReplaceTable(newTable, newTableSize);\n    DeleteOldTable(oldTable);\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\ntemplate <typename Functor>\nvoid SHash<TRAITS>::ForEach(Functor &functor)\n{\n    WRAPPER_NO_CONTRACT;  // LIMITED_METHOD_CONTRACT + Functor\n\n    for (count_t i = 0; i < m_tableSize; i++)\n    {\n        element_t element = m_table[i];\n        if (TRAITS::IsNull(element) || TRAITS::IsDeleted(element))\n        {\n            continue;\n        }\n\n        if (TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(element))\n        {\n            RemoveElement(m_table, m_tableSize, &m_table[i]);\n            continue;\n        }\n\n        functor(element);\n    }\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::element_t *\nSHash<TRAITS>::AllocateNewTable(count_t requestedSize, count_t * pcNewTableSize)\n{\n    CONTRACT(element_t *)\n    {\n        THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(requestedSize >=\n                     (count_t) (GetCount() * TRAITS::s_density_factor_denominator / TRAITS::s_density_factor_numerator));\n    }\n    CONTRACT_END;\n\n    // Allocation size must be a prime number.  This is necessary so that hashes uniformly\n    // distribute to all indices, and so that chaining will visit all indices in the hash table.\n    *pcNewTableSize = NextPrime(requestedSize);\n\n    element_t * newTable = new element_t [*pcNewTableSize];\n\n    element_t * p = newTable;\n    element_t * pEnd = newTable + *pcNewTableSize;\n    while (p < pEnd)\n    {\n        *p = TRAITS::Null();\n        p++;\n    }\n\n    RETURN newTable;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::element_t *\nSHash<TRAITS>::AllocateNewTableNoThrow(count_t requestedSize, count_t * pcNewTableSize)\n{\n    CONTRACT(element_t *)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(requestedSize >=\n                     (count_t) (GetCount() * TRAITS::s_density_factor_denominator / TRAITS::s_density_factor_numerator));\n        PRECONDITION(TRAITS::s_NoThrow);\n    }\n    CONTRACT_END;\n\n    // Allocation size must be a prime number.  This is necessary so that hashes uniformly\n    // distribute to all indices, and so that chaining will visit all indices in the hash table.\n    *pcNewTableSize = NextPrime(requestedSize);\n\n    element_t * newTable = new (nothrow) element_t [*pcNewTableSize];\n    if (newTable)\n    {\n        element_t * p = newTable;\n        element_t * pEnd = newTable + *pcNewTableSize;\n        while (p < pEnd)\n        {\n            *p = TRAITS::Null();\n            p++;\n        }\n    }\n\n    RETURN newTable;\n}\n\ntemplate <typename TRAITS>\ntypename SHash<TRAITS>::element_t *\nSHash<TRAITS>::ReplaceTable(element_t * newTable, count_t newTableSize)\n{\n    CONTRACT(element_t *)\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(newTableSize >=\n                     (count_t) (GetCount() * TRAITS::s_density_factor_denominator / TRAITS::s_density_factor_numerator));\n    }\n    CONTRACT_END;\n\n    element_t * oldTable = m_table;\n\n    // Move all entries over to new table.\n    for (Iterator i = Begin(), end = End(); i != end; i++)\n    {\n        const element_t & cur = (*i);\n        _ASSERTE(!TRAITS::IsNull(cur));\n        _ASSERTE(!TRAITS::IsDeleted(cur));\n        Add(newTable, newTableSize, cur);\n    }\n\n    m_table = PTR_element_t(newTable);\n    m_tableSize = newTableSize;\n    m_tableMax = (count_t) (newTableSize * TRAITS::s_density_factor_numerator / TRAITS::s_density_factor_denominator);\n    m_tableOccupied = m_tableCount;\n\n    RETURN oldTable;\n}\n\ntemplate <typename TRAITS>\nvoid\nSHash<TRAITS>::DeleteOldTable(element_t * oldTable)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    // @todo:\n    // We might want to try to delay this cleanup to allow asynchronous readers\n    if (oldTable != NULL)\n        delete [] oldTable;\n\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nconst typename SHash<TRAITS>::element_t * SHash<TRAITS>::Lookup(PTR_element_t table, count_t tableSize, key_t key) const\n{\n    CONTRACT(const element_t *)\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        POSTCONDITION(RETVAL == NULL || TRAITS::Equals(key, TRAITS::GetKey(*RETVAL)));\n        SUPPORTS_DAC_WRAPPER;   // supports DAC only if the traits class does\n    }\n    CONTRACT_END;\n\n    if (tableSize == 0)\n        RETURN NULL;\n\n    count_t hash = TRAITS::Hash(key);\n    count_t index = hash % tableSize;\n    count_t increment = 0; // delay computation\n\n    while (TRUE)\n    {\n        element_t& current = table[index];\n\n        if (TRAITS::IsNull(current))\n            RETURN NULL;\n\n        if (!TRAITS::IsDeleted(current))\n        {\n            if (TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(current))\n            {\n                const_cast<SHash<TRAITS> *>(this)->RemoveElement(table, tableSize, &current);\n            }\n            else if (TRAITS::Equals(key, TRAITS::GetKey(current)))\n            {\n                RETURN &current;\n            }\n        }\n\n        if (increment == 0)\n            increment = (hash % (tableSize-1)) + 1;\n\n        index += increment;\n        if (index >= tableSize)\n            index -= tableSize;\n    }\n}\n\ntemplate <typename TRAITS>\nBOOL SHash<TRAITS>::Add(element_t * table, count_t tableSize, const element_t & element)\n{\n    CONTRACT(BOOL)\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        POSTCONDITION(TRAITS::Equals(TRAITS::GetKey(element), TRAITS::GetKey(*Lookup(table, tableSize, TRAITS::GetKey(element)))));\n    }\n    CONTRACT_END;\n\n    key_t key = TRAITS::GetKey(element);\n\n    count_t hash = TRAITS::Hash(key);\n    count_t index = hash % tableSize;\n    count_t increment = 0; // delay computation\n\n    while (TRUE)\n    {\n        element_t & current = table[index];\n\n        if (TRAITS::IsNull(current))\n        {\n            table[index] = element;\n            RETURN TRUE;\n        }\n\n        if (TRAITS::IsDeleted(current))\n        {\n            table[index] = element;\n            RETURN FALSE;\n        }\n\n        if (TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(current))\n        {\n            RemoveElement(table, tableSize, &current);\n            table[index] = element;\n            RETURN FALSE;\n        }\n\n        if (increment == 0)\n            increment = (hash % (tableSize-1)) + 1;\n\n        index += increment;\n        if (index >= tableSize)\n            index -= tableSize;\n    }\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::AddOrReplace(element_t *table, count_t tableSize, const element_t &element)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        static_assert(!TRAITS::s_supports_remove, \"SHash::AddOrReplace is not implemented for SHash with support for remove operations.\");\n        POSTCONDITION(TRAITS::Equals(TRAITS::GetKey(element), TRAITS::GetKey(*Lookup(table, tableSize, TRAITS::GetKey(element)))));\n    }\n    CONTRACT_END;\n\n    key_t key = TRAITS::GetKey(element);\n\n    count_t hash = TRAITS::Hash(key);\n    count_t index = hash % tableSize;\n    count_t increment = 0; // delay computation\n\n    while (TRUE)\n    {\n        element_t& current = table[index];\n        _ASSERTE(!TRAITS::IsDeleted(current));\n\n        if (TRAITS::IsNull(current))\n        {\n            table[index] = element;\n            m_tableCount++;\n            m_tableOccupied++;\n            RETURN;\n        }\n        else if (TRAITS::Equals(key, TRAITS::GetKey(current)))\n        {\n            if (TRAITS::s_RemovePerEntryCleanupAction)\n            {\n                TRAITS::OnRemovePerEntryCleanupAction(current);\n            }\n\n            table[index] = element;\n            RETURN;\n        }\n\n        if (increment == 0)\n            increment = (hash % (tableSize-1)) + 1;\n\n        index += increment;\n        if (index >= tableSize)\n            index -= tableSize;\n    }\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::Remove(element_t *table, count_t tableSize, key_t key)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        static_assert(TRAITS::s_supports_remove, \"This SHash does not support remove operations.\");\n        PRECONDITION(Lookup(table, tableSize, key) != NULL);\n    }\n    CONTRACT_END;\n\n    count_t hash = TRAITS::Hash(key);\n    count_t index = hash % tableSize;\n    count_t increment = 0; // delay computation\n\n    while (TRUE)\n    {\n        element_t& current = table[index];\n\n        if (TRAITS::IsNull(current))\n            RETURN;\n\n        if (!TRAITS::IsDeleted(current))\n        {\n            if ((TRAITS::s_supports_autoremove && TRAITS::ShouldDelete(current)) ||\n                TRAITS::Equals(key, TRAITS::GetKey(current)))\n            {\n                RemoveElement(table, tableSize, &current);\n            }\n        }\n\n        if (increment == 0)\n            increment = (hash % (tableSize-1)) + 1;\n\n        index += increment;\n        if (index >= tableSize)\n            index -= tableSize;\n    }\n}\n\ntemplate <typename TRAITS>\nvoid SHash<TRAITS>::RemoveElement(element_t *table, count_t tableSize, element_t *element)\n{\n    CONTRACT_VOID\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        PRECONDITION(TRAITS::s_supports_remove);\n        PRECONDITION(table <= element && element < table + tableSize);\n        PRECONDITION(!TRAITS::IsNull(*element) && !TRAITS::IsDeleted(*element));\n    }\n    CONTRACT_END;\n\n    if (TRAITS::s_RemovePerEntryCleanupAction)\n    {\n        TRAITS::OnRemovePerEntryCleanupAction(*element);\n    }\n\n    *element = TRAITS::Deleted();\n    m_tableCount--;\n    RETURN;\n}\n\ntemplate <typename TRAITS>\nBOOL SHash<TRAITS>::IsPrime(COUNT_T number)\n{\n    CONTRACT(BOOL)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    // This is a very low-tech check for primality, which doesn't scale very well.\n    // There are more efficient tests if this proves to be burdensome for larger\n    // tables.\n\n    if ((number & 1) == 0)\n        RETURN FALSE;\n\n    COUNT_T factor = 3;\n    while (factor * factor <= number)\n    {\n        if ((number % factor) == 0)\n            RETURN FALSE;\n        factor += 2;\n    }\n\n    RETURN TRUE;\n}\n\n// allow coexistence with simplerhash.inl\n#ifndef _HASH_PRIMES_DEFINED\n#define _HASH_PRIMES_DEFINED\n\nnamespace\n{\n    const COUNT_T g_shash_primes[] = {\n        11,17,23,29,37,47,59,71,89,107,131,163,197,239,293,353,431,521,631,761,919,\n        1103,1327,1597,1931,2333,2801,3371,4049,4861,5839,7013,8419,10103,12143,14591,\n        17519,21023,25229,30293,36353,43627,52361,62851,75431,90523, 108631, 130363,\n        156437, 187751, 225307, 270371, 324449, 389357, 467237, 560689, 672827, 807403,\n        968897, 1162687, 1395263, 1674319, 2009191, 2411033, 2893249, 3471899, 4166287,\n        4999559, 5999471, 7199369 };\n}\n\n#endif //_HASH_PRIMES_DEFINED\n\ntemplate <typename TRAITS>\nCOUNT_T SHash<TRAITS>::NextPrime(COUNT_T number)\n{\n    CONTRACT(COUNT_T)\n    {\n        NOTHROW;\n        GC_NOTRIGGER;\n        POSTCONDITION(IsPrime(RETVAL));\n    }\n    CONTRACT_END;\n\n    for (int i = 0; i < (int) (sizeof(g_shash_primes) / sizeof(g_shash_primes[0])); i++) {\n        if (g_shash_primes[i] >= number)\n            RETURN g_shash_primes[i];\n    }\n\n    if ((number&1) == 0)\n        number++;\n\n    while (number != 1) {\n        if (IsPrime(number))\n            RETURN number;\n        number +=2;\n    }\n\n    // overflow\n    ThrowOutOfMemory();\n}\n\ntemplate <typename KEY, typename VALUE, typename TRAITS>\nBOOL MapSHash<KEY, VALUE, TRAITS>::Lookup(KEY key, VALUE* pValue) const\n{\n    CONTRACTL\n    {\n        NOTHROW_UNLESS_TRAITS_THROWS;\n        GC_NOTRIGGER;\n        PRECONDITION(key != (KEY)0);\n    }\n    CONTRACTL_END;\n\n    const KeyValuePair<KEY,VALUE> *pRet = PARENT::LookupPtr(key);\n    if (pRet == NULL)\n        return FALSE;\n\n    *pValue = pRet->Value();\n    return TRUE;\n}\n\n#endif // _SHASH_INL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/shimload.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/*============================================================\n**\n** Header:  ShimLoad.hpp\n**\n** Purpose: Delay load hook used to images to bind to\n**          dll's shim shipped with the EE\n**\n**\n===========================================================*/\n#ifndef _SHIMLOAD_H\n#define _SHIMLOAD_H\n\n\n//*****************************************************************************\n// Sets/Gets the directory based on the location of the module. This routine\n// is called at COR setup time. Set is called during EEStartup and by the\n// MetaData dispenser.\n//*****************************************************************************\nHRESULT SetInternalSystemDirectory();\nHRESULT GetInternalSystemDirectory(_Out_writes_opt_(*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength);\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sigbuilder.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n#ifndef _SIGBUILDER_H_\n#define _SIGBUILDER_H_\n\n#include \"contract.h\"\n\n//\n// Simple signature builder\n//\n\nclass SigBuilder\n{\n    PBYTE m_pBuffer;\n    DWORD m_dwLength;\n    DWORD m_dwAllocation;\n\n    // Preallocate space for small signatures\n    BYTE m_prealloc[64];\n\n    // Grow the buffer to get at least cbMin of free space\n    void Grow(SIZE_T cbMin);\n\n    // Ensure that the buffer has at least cbMin of free space\n    FORCEINLINE void Ensure(SIZE_T cb)\n    {\n        if (m_dwAllocation - m_dwLength < cb)\n            Grow(cb);\n    }\n\npublic:\n    SigBuilder()\n        : m_pBuffer(m_prealloc), m_dwLength(0), m_dwAllocation(sizeof(m_prealloc))\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n    ~SigBuilder();\n\n    SigBuilder(DWORD cbPreallocationSize);\n\n    PVOID GetSignature(DWORD * pdwLength)\n    {\n        LIMITED_METHOD_CONTRACT;\n        *pdwLength = m_dwLength;\n        return m_pBuffer;\n    }\n\n    DWORD GetSignatureLength()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_dwLength;\n    }\n\n    void AppendByte(BYTE b);\n\n    void AppendData(ULONG data);\n\n    void AppendElementType(CorElementType etype)\n    {\n        WRAPPER_NO_CONTRACT;\n        AppendByte(static_cast<BYTE>(etype));\n    }\n\n    void AppendToken(mdToken tk);\n\n    void AppendPointer(void * ptr)\n    {\n        WRAPPER_NO_CONTRACT;\n        AppendBlob(&ptr, sizeof(ptr));\n    }\n\n    void AppendBlob(const PVOID pBlob, SIZE_T cbBlob);\n};\n\n#endif // _SIGBUILDER_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sigparser.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// sigparser.h\n//\n\n//\n\n#ifndef _H_SIGPARSER\n#define _H_SIGPARSER\n\n#include \"utilcode.h\"\n#include \"corhdr.h\"\n#include \"corinfo.h\"\n#include \"corpriv.h\"\n#include <minipal/utils.h>\n\n//---------------------------------------------------------------------------------------\n// These macros define how arguments are mapped to the stack in the managed calling convention.\n// We assume to be walking a method's signature left-to-right, in the virtual calling convention.\n// See MethodDesc::Call for details on this virtual calling convention.\n// These macros tell us whether the arguments we see as we proceed with the signature walk are mapped\n//   to increasing or decreasing stack addresses. This is valid only for arguments that go on the stack.\n//---------------------------------------------------------------------------------------\n#if defined(TARGET_X86)\n#define STACK_GROWS_DOWN_ON_ARGS_WALK\n#else\n#define STACK_GROWS_UP_ON_ARGS_WALK\n#endif\n\n//------------------------------------------------------------------------\n// Encapsulates how compressed integers and typeref tokens are encoded into\n// a bytestream.\n//\n// As you use this class please understand the implicit normalizations\n// on the CorElementType's returned by the various methods, especially\n// for variable types (e.g. !0 in generic signatures), string types\n// (i.e. E_T_STRING), object types (E_T_OBJECT), constructed types\n// (e.g. List<int>) and enums.\n//------------------------------------------------------------------------\nclass SigParser\n{\n    protected:\n        // This type is performance critical - do not add fields to it.\n        // (If you must, check for managed types that may use a SigParser or SigPointer inline, like ArgIterator.)\n        PCCOR_SIGNATURE m_ptr;\n        uint32_t           m_dwLen;\n\n        //------------------------------------------------------------------------\n        // Skips specified number of bytes WITHOUT VALIDATION. Only to be used\n        // when it is known that it won't overflow the signature buffer.\n        //------------------------------------------------------------------------\n        FORCEINLINE void SkipBytes(uint32_t cb)\n        {\n            SUPPORTS_DAC;\n            _ASSERT(cb <= m_dwLen);\n            m_ptr += cb;\n            m_dwLen -= cb;\n        }\n\n    public:\n        //------------------------------------------------------------------------\n        // Constructor.\n        //------------------------------------------------------------------------\n        SigParser() {\n            LIMITED_METHOD_DAC_CONTRACT;\n            m_ptr = NULL;\n            m_dwLen = 0;\n        }\n\n        SigParser(const SigParser &sig);\n\n        //------------------------------------------------------------------------\n        // Initialize\n        //------------------------------------------------------------------------\n        FORCEINLINE SigParser(PCCOR_SIGNATURE ptr)\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            m_ptr = ptr;\n            // We don't know the size of the signature, so we'll say it's \"big enough\"\n            m_dwLen = 0xffffffff;\n        }\n\n        FORCEINLINE SigParser(PCCOR_SIGNATURE ptr, uint32_t len)\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            m_ptr = ptr;\n            m_dwLen = len;\n        }\n\n        inline void SetSig(PCCOR_SIGNATURE ptr)\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            m_ptr = ptr;\n            // We don't know the size of the signature, so we'll say it's \"big enough\"\n            m_dwLen = 0xffffffff;\n        }\n\n        inline void SetSig(PCCOR_SIGNATURE ptr, uint32_t len)\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            m_ptr = ptr;\n            m_dwLen = len;\n        }\n\n\n        inline BOOL IsNull() const\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            return (m_ptr == NULL);\n        }\n\n        // Returns represented signature as pointer and size.\n        void\n        GetSignature(\n            PCCOR_SIGNATURE * pSig,\n            uint32_t           * pcbSigSize)\n        {\n            *pSig = m_ptr;\n            *pcbSigSize = m_dwLen;\n        }\n\n\n    //=========================================================================\n    // The RAW interface for reading signatures.  You see exactly the signature,\n    // apart from custom modifiers which for historical reasons tend to get eaten.\n    //\n    // DO NOT USE THESE METHODS UNLESS YOU'RE TOTALLY SURE YOU WANT\n    // THE RAW signature.  You nearly always want GetElemTypeClosed() or\n    // PeekElemTypeClosed() or one of the MetaSig functions.  See the notes above.\n    // These functions will return E_T_INTERNAL, E_T_VAR, E_T_MVAR and such\n    // so the caller must be able to deal with those\n    //=========================================================================\n\n        //------------------------------------------------------------------------\n        // Remove one compressed integer (using CorSigUncompressData) from\n        // the head of the stream and return it.\n        //------------------------------------------------------------------------\n        __checkReturn\n        FORCEINLINE HRESULT GetData(uint32_t* data)\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            uint32_t sizeOfData = 0;\n            uint32_t tempData;\n\n            if (data == NULL)\n                data = &tempData;\n\n            HRESULT hr = CorSigUncompressData(m_ptr, m_dwLen, data, &sizeOfData);\n\n            if (SUCCEEDED(hr))\n            {\n                SkipBytes(sizeOfData);\n            }\n\n            return hr;\n        }\n\n\n        //-------------------------------------------------------------------------\n        // Remove one byte and return it.\n        //-------------------------------------------------------------------------\n        __checkReturn\n        FORCEINLINE HRESULT GetByte(BYTE *data)\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            if (m_dwLen > 0)\n            {\n                if (data != NULL)\n                    *data = *m_ptr;\n\n                SkipBytes(1);\n\n                return S_OK;\n            }\n\n            if (data != NULL)\n                *data = 0;\n            return META_E_BAD_SIGNATURE;\n        }\n\n        //-------------------------------------------------------------------------\n        // Peek at value of one byte and return it.\n        //-------------------------------------------------------------------------\n        __checkReturn\n        FORCEINLINE HRESULT PeekByte(BYTE *data)\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            if (m_dwLen > 0)\n            {\n                if (data != NULL)\n                    *data = *m_ptr;\n\n                return S_OK;\n            }\n\n            if (data != NULL)\n                *data = 0;\n            return META_E_BAD_SIGNATURE;\n        }\n\n        //-------------------------------------------------------------------------\n        // The element type as defined in CorElementType. No normalization for\n        // generics (E_T_VAR, E_T_MVAR,..) or dynamic methods (E_T_INTERNAL occurs)\n        //-------------------------------------------------------------------------\n        __checkReturn\n        HRESULT GetElemTypeSlow(CorElementType * etype)\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            CorElementType tmpEType;\n\n            if (etype == NULL)\n                etype = &tmpEType;\n\n            SigParser sigTemp(*this);\n\n            HRESULT hr = sigTemp.SkipCustomModifiers();\n\n            if (SUCCEEDED(hr))\n            {\n                BYTE bElemType = 0;\n                hr = sigTemp.GetByte(&bElemType);\n                *etype = (CorElementType)bElemType;\n\n                if (SUCCEEDED(hr))\n                {\n                    *this = sigTemp;\n                    return S_OK;\n                }\n            }\n\n            *etype = ELEMENT_TYPE_END;\n\n            return META_E_BAD_SIGNATURE;\n        }\n\n        // Inlined version\n        __checkReturn\n        FORCEINLINE HRESULT GetElemType(CorElementType * etype)\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            if (m_dwLen > 0)\n            {\n                CorElementType typ = (CorElementType) * m_ptr;\n\n                if (typ < ELEMENT_TYPE_CMOD_REQD) // fast path with no modifiers: single byte\n                {\n                    if (etype != NULL)\n                    {\n                        * etype = typ;\n                    }\n\n                    SkipBytes(1);\n\n                    return S_OK;\n                }\n            }\n\n            // Slower/normal path\n            return GetElemTypeSlow(etype);\n        }\n\n        // Note: Calling convention is always one byte, not four bytes\n        __checkReturn\n        HRESULT GetCallingConvInfo(uint32_t * data)\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            uint32_t tmpData;\n\n            if (data == NULL)\n                data = &tmpData;\n\n            HRESULT hr = CorSigUncompressCallingConv(m_ptr, m_dwLen, data);\n            if (SUCCEEDED(hr))\n            {\n                SkipBytes(1);\n            }\n\n            return hr;\n        }\n\n        __checkReturn\n        HRESULT GetCallingConv(uint32_t* data)  // @REVISIT_TODO: Calling convention is one byte, not four.\n        {\n            WRAPPER_NO_CONTRACT;\n            uint32_t info;\n            HRESULT hr = GetCallingConvInfo(&info);\n\n            if (SUCCEEDED(hr) && data != NULL)\n            {\n                *data = IMAGE_CEE_CS_CALLCONV_MASK & info;\n            }\n\n            return hr;\n        }\n\n        //------------------------------------------------------------------------\n        // Non-destructive read of compressed integer.\n        //------------------------------------------------------------------------\n        __checkReturn\n        HRESULT PeekData(uint32_t *data) const\n        {\n            WRAPPER_NO_CONTRACT;\n            _ASSERTE(data != NULL);\n\n            uint32_t sizeOfData = 0;\n            return CorSigUncompressData(m_ptr, m_dwLen, data, &sizeOfData);\n        }\n\n\n        //------------------------------------------------------------------------\n        // Non-destructive read of element type.\n        //\n        // This routine makes it look as if the String type is encoded\n        // via ELEMENT_TYPE_CLASS followed by a token for the String class,\n        // rather than the ELEMENT_TYPE_STRING. This is partially to avoid\n        // rewriting client code which depended on this behavior previously.\n        // But it also seems like the right thing to do generally.\n        // No normalization for generics (E_T_VAR, E_T_MVAR,..) or\n        // dynamic methods (E_T_INTERNAL occurs)\n        //------------------------------------------------------------------------\n        __checkReturn\n        HRESULT PeekElemTypeSlow(CorElementType *etype) const\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            _ASSERTE(etype != NULL);\n\n            SigParser sigTemp(*this);\n            HRESULT hr = sigTemp.GetElemType(etype);\n            if (SUCCEEDED(hr) && (*etype == ELEMENT_TYPE_STRING || *etype == ELEMENT_TYPE_OBJECT))\n                *etype = ELEMENT_TYPE_CLASS;\n\n            return hr;\n        }\n\n        // inline version\n        __checkReturn\n        FORCEINLINE HRESULT PeekElemType(CorElementType *etype) const\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            _ASSERTE(etype != NULL);\n\n            if (m_dwLen > 0)\n            {\n                CorElementType typ = (CorElementType) * m_ptr;\n\n                if (typ < ELEMENT_TYPE_CMOD_REQD) // fast path with no modifiers: single byte\n                {\n                    if ((typ == ELEMENT_TYPE_STRING) || (typ == ELEMENT_TYPE_OBJECT))\n                    {\n                        *etype = ELEMENT_TYPE_CLASS;\n                    }\n                    else\n                    {\n                        *etype = typ;\n                    }\n\n                    return S_OK;\n                }\n            }\n\n            return PeekElemTypeSlow(etype);\n        }\n\n        //-------------------------------------------------------------------------\n        // Returns the raw size of the type next in the signature, or returns\n        // E_INVALIDARG for base types that have variables sizes.\n        //-------------------------------------------------------------------------\n        __checkReturn\n        HRESULT PeekElemTypeSize(uint32_t *pSize)\n        {\n            WRAPPER_NO_CONTRACT;\n            HRESULT hr = S_OK;\n\n            uint32_t dwSize = 0;\n\n            if (pSize == NULL)\n            {\n                pSize = &dwSize;\n            }\n\n            SigParser sigTemp(*this);\n\n            hr = sigTemp.SkipAnyVASentinel();\n\n            if (FAILED(hr))\n            {\n                return hr;\n            }\n\n            *pSize = 0;\n\n            BYTE bElementType = 0;\n            hr = sigTemp.GetByte(&bElementType);\n\n            if (FAILED(hr))\n            {\n                return hr;\n            }\n\n            switch (bElementType)\n            {\n            case ELEMENT_TYPE_I8:\n            case ELEMENT_TYPE_U8:\n            case ELEMENT_TYPE_R8:\n        #ifdef HOST_64BIT\n            case ELEMENT_TYPE_I:\n            case ELEMENT_TYPE_U:\n        #endif // WIN64\n\n                *pSize = 8;\n                break;\n\n            case ELEMENT_TYPE_I4:\n            case ELEMENT_TYPE_U4:\n            case ELEMENT_TYPE_R4:\n        #ifndef HOST_64BIT\n            case ELEMENT_TYPE_I:\n            case ELEMENT_TYPE_U:\n        #endif // HOST_64BIT\n\n                *pSize = 4;\n                break;\n\n            case ELEMENT_TYPE_I2:\n            case ELEMENT_TYPE_U2:\n            case ELEMENT_TYPE_CHAR:\n                *pSize = 2;\n                break;\n\n            case ELEMENT_TYPE_I1:\n            case ELEMENT_TYPE_U1:\n            case ELEMENT_TYPE_BOOLEAN:\n                *pSize = 1;\n                break;\n\n            case ELEMENT_TYPE_STRING:\n            case ELEMENT_TYPE_PTR:\n            case ELEMENT_TYPE_BYREF:\n            case ELEMENT_TYPE_CLASS:\n            case ELEMENT_TYPE_OBJECT:\n            case ELEMENT_TYPE_FNPTR:\n            case ELEMENT_TYPE_TYPEDBYREF:\n            case ELEMENT_TYPE_ARRAY:\n            case ELEMENT_TYPE_SZARRAY:\n                *pSize = sizeof(void *);\n                break;\n\n            case ELEMENT_TYPE_VOID:\n                break;\n\n            case ELEMENT_TYPE_END:\n            case ELEMENT_TYPE_CMOD_REQD:\n            case ELEMENT_TYPE_CMOD_OPT:\n                _ASSERTE(!\"Asked for the size of an element that doesn't have a size!\");\n                return E_INVALIDARG;\n\n            case ELEMENT_TYPE_VALUETYPE:\n                _ASSERTE(!\"Asked for the size of an element that doesn't have a size!\");\n                return E_INVALIDARG;\n\n            default:\n\n                _ASSERTE( !\"CorSigGetElementTypeSize given invalid signature to size!\" );\n                return META_E_BAD_SIGNATURE;\n            }\n\n            return hr;\n        }\n\n        //------------------------------------------------------------------------\n        // Is this at the Sentinel (the ... in a varargs signature) that marks\n        // the beginning of varguments that are not decared at the target\n\n        bool AtSentinel() const\n        {\n            if (m_dwLen > 0)\n                return *m_ptr == ELEMENT_TYPE_SENTINEL;\n            else\n                return false;\n        }\n\n        //------------------------------------------------------------------------\n        // Removes a compressed metadata token and returns it.\n        // WARNING: dynamic methods do not have tokens so this api is completely\n        //          broken in that case. Make sure you call this function if\n        //          you are absolutely sure E_T_INTERNAL was not in the sig\n        //------------------------------------------------------------------------\n        __checkReturn\n        FORCEINLINE\n        HRESULT GetToken(mdToken * token)\n        {\n            WRAPPER_NO_CONTRACT;\n            uint32_t dwLen;\n            mdToken tempToken;\n\n            if (token == NULL)\n                token = &tempToken;\n\n            HRESULT hr = CorSigUncompressToken(m_ptr, m_dwLen, token, &dwLen);\n\n            if (SUCCEEDED(hr))\n            {\n                SkipBytes(dwLen);\n            }\n\n            return hr;\n        }\n\n        //------------------------------------------------------------------------\n        // Removes a pointer value and returns it. Used for ELEMENT_TYPE_INTERNAL.\n        __checkReturn\n        FORCEINLINE\n        HRESULT GetPointer(void ** pPtr)\n        {\n            WRAPPER_NO_CONTRACT;\n\n            if (m_dwLen < sizeof(void *))\n            {   // Not enough data to read a pointer\n                if (pPtr != NULL)\n                {\n                    *pPtr = NULL;\n                }\n                return META_E_BAD_SIGNATURE;\n            }\n            if (pPtr != NULL)\n            {\n                *pPtr = *(void * UNALIGNED *)m_ptr;\n            }\n            SkipBytes(sizeof(void *));\n\n            return S_OK;\n        }\n\n        //------------------------------------------------------------------------\n        // Tests if two SigParsers point to the same location in the stream.\n        //------------------------------------------------------------------------\n        FORCEINLINE BOOL Equals(SigParser sp) const\n        {\n            LIMITED_METHOD_CONTRACT;\n\n            return m_ptr == sp.m_ptr;\n        }\n\n        __checkReturn\n        HRESULT SkipCustomModifiers()\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            HRESULT hr = S_OK;\n\n            SigParser sigTemp(*this);\n\n            hr = sigTemp.SkipAnyVASentinel();\n\n            if (FAILED(hr))\n            {\n                return hr;\n            }\n\n            BYTE bElementType = 0;\n\n            hr = sigTemp.PeekByte(&bElementType);\n            if (FAILED(hr))\n                return hr;\n\n            while ((ELEMENT_TYPE_CMOD_REQD == bElementType) ||\n                   (ELEMENT_TYPE_CMOD_OPT == bElementType))\n            {\n                sigTemp.SkipBytes(1);\n\n                mdToken token;\n\n                hr = sigTemp.GetToken(&token);\n\n                if (FAILED(hr))\n                    return hr;\n\n                hr = sigTemp.PeekByte(&bElementType);\n                if (FAILED(hr))\n                    return hr;\n            }\n\n            // Following custom modifiers must be an element type value which is less than ELEMENT_TYPE_MAX, or one of the other element types\n            // that we support while parsing various signatures\n            if (bElementType >= ELEMENT_TYPE_MAX)\n            {\n                switch (bElementType)\n                {\n                case ELEMENT_TYPE_VAR_ZAPSIG:\n                case ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG:\n                case ELEMENT_TYPE_CANON_ZAPSIG:\n                case ELEMENT_TYPE_MODULE_ZAPSIG:\n                case ELEMENT_TYPE_PINNED:\n                    break;\n                default:\n                    return META_E_BAD_SIGNATURE;\n                }\n            }\n\n            *this = sigTemp;\n            return hr;\n        }// SkipCustomModifiers\n\n        __checkReturn\n        HRESULT SkipFunkyAndCustomModifiers()\n        {\n            WRAPPER_NO_CONTRACT;\n            SUPPORTS_DAC;\n\n            SigParser sigTemp(*this);\n            HRESULT hr = S_OK;\n            hr = sigTemp.SkipAnyVASentinel();\n\n            if (FAILED(hr))\n            {\n                return hr;\n            }\n\n            BYTE bElementType = 0;\n\n            hr = sigTemp.PeekByte(&bElementType);\n            if (FAILED(hr))\n                return hr;\n\n            while (ELEMENT_TYPE_CMOD_REQD == bElementType ||\n                   ELEMENT_TYPE_CMOD_OPT == bElementType ||\n                   ELEMENT_TYPE_MODIFIER == bElementType ||\n                   ELEMENT_TYPE_PINNED == bElementType)\n            {\n                sigTemp.SkipBytes(1);\n\n                mdToken token;\n\n                hr = sigTemp.GetToken(&token);\n\n                if (FAILED(hr))\n                    return hr;\n\n                hr = sigTemp.PeekByte(&bElementType);\n                if (FAILED(hr))\n                    return hr;\n            }\n\n            // Following custom modifiers must be an element type value which is less than ELEMENT_TYPE_MAX, or one of the other element types\n            // that we support while parsing various signatures\n            if (bElementType >= ELEMENT_TYPE_MAX)\n            {\n                switch (bElementType)\n                {\n                case ELEMENT_TYPE_NATIVE_VALUETYPE_ZAPSIG:\n                case ELEMENT_TYPE_CANON_ZAPSIG:\n                case ELEMENT_TYPE_MODULE_ZAPSIG:\n                case ELEMENT_TYPE_PINNED:\n                    break;\n                default:\n                    return META_E_BAD_SIGNATURE;\n                }\n            }\n\n            *this = sigTemp;\n            return hr;\n        }// SkipFunkyAndCustomModifiers\n\n\n        __checkReturn\n        HRESULT SkipAnyVASentinel()\n        {\n            WRAPPER_NO_CONTRACT;\n\n            HRESULT hr = S_OK;\n            BYTE bElementType = 0;\n\n            hr = PeekByte(&bElementType);\n            if (FAILED(hr))\n                return hr;\n\n            if (bElementType == ELEMENT_TYPE_SENTINEL)\n            {\n                SkipBytes(1);\n            }\n\n            return hr;\n        }// SkipAnyVASentinel\n\n        //------------------------------------------------------------------------\n        // Assumes that the SigParser points to the start of an element type\n        // (i.e. function parameter, function return type or field type.)\n        // Advances the pointer to the first data after the element type.\n        //------------------------------------------------------------------------\n        __checkReturn\n        HRESULT SkipExactlyOne();\n\n        //------------------------------------------------------------------------\n        // Skip only the method header of the signature, not the signature of\n        // the arguments.\n        //------------------------------------------------------------------------\n        __checkReturn\n        HRESULT SkipMethodHeaderSignature(uint32_t *pcArgs);\n\n        //------------------------------------------------------------------------\n        // Skip a sub signature (as immediately follows an ELEMENT_TYPE_FNPTR).\n        //------------------------------------------------------------------------\n        __checkReturn\n        HRESULT SkipSignature();\n\npublic:\n\n        //------------------------------------------------------------------------\n        // Return pointer\n        // PLEASE DON'T USE THIS.\n        //\n        // Return the internal pointer.  It's hard to resist, but please try\n        // not to use this.  Certainly don't use it if there's any chance of the\n        // signature containing generic type variables.\n        //\n        // It's currently only used for working on the\n        // signatures stored in TypeSpec tokens (we should add a new abstraction,\n        // i.e. on MetaSig for this) and a couple of places to do with COM\n        // and native interop signature parsing.\n        // <REVISIT_TODO>We should try to get rid of these uses as well. </REVISIT_TODO>\n        //------------------------------------------------------------------------\n        PCCOR_SIGNATURE GetPtr() const\n        {\n            LIMITED_METHOD_DAC_CONTRACT;\n            return m_ptr;\n        }\n\n};  // class SigParser\n\n//------------------------------------------------------------------------\nFORCEINLINE\nSigParser::SigParser(\n    const SigParser &sig)\n    : m_ptr(sig.m_ptr), m_dwLen(sig.m_dwLen)\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n}\n\n/*****************************************************************/\n/* CorTypeInfo is a single global table that you can hang information\n   about ELEMENT_TYPE_* */\n\nclass CorTypeInfo\n{\nprotected:\n    struct CorTypeInfoEntry\n    {\n        LPCUTF8        nameSpace;\n        LPCUTF8        className;\n        CorElementType type         : 8;\n        unsigned       size         : 8;\n        CorInfoGCType  gcType       : 3;\n        unsigned       isArray      : 1;\n        unsigned       isPrim       : 1;\n        unsigned       isFloat      : 1;\n        unsigned       isModifier   : 1;\n        unsigned       isGenVar     : 1;\n        // 1 more byte here to use for 32-bit\n    };\n\nprotected:\n    FORCEINLINE static const CorTypeInfoEntry &GetTypeInfo(CorElementType type)\n    {\n        CONTRACTL\n        {\n            THROWS;\n            GC_NOTRIGGER;\n            SUPPORTS_DAC;\n#ifdef MODE_ANY\n            MODE_ANY;\n#endif\n        }\n        CONTRACTL_END;\n\n        if (type >= (CorElementType)ARRAY_SIZE(info))\n        {\n            ThrowHR(COR_E_BADIMAGEFORMAT);\n        }\n        return info[type];\n    }\n    FORCEINLINE static const CorTypeInfoEntry &GetTypeInfo_NoThrow(CorElementType type)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n\n        if (type >= (CorElementType)ARRAY_SIZE(info))\n        {\n            return info[ELEMENT_TYPE_END];\n        }\n        return info[type];\n    }\n\npublic:\n\n    FORCEINLINE static LPCUTF8 GetName(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).className;\n    }\n\n    FORCEINLINE static LPCUTF8 GetNamespace(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).nameSpace;\n    }\n\n    static void CheckConsistency()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        for (int i = 0; i < (int)ARRAY_SIZE(info); i++)\n        {\n            _ASSERTE(info[i].type == i);\n        }\n    }\n\n    FORCEINLINE static CorInfoGCType GetGCType(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).gcType;\n    }\n    FORCEINLINE static CorInfoGCType GetGCType_NoThrow(CorElementType type)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n\n        return GetTypeInfo_NoThrow(type).gcType;\n    }\n\n    static BOOL IsObjRef(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        return (GetGCType(type) == TYPE_GC_REF);\n    }\n    static BOOL IsObjRef_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        return (GetGCType_NoThrow(type) == TYPE_GC_REF);\n    }\n\n    static BOOL IsByRef(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        return (GetGCType(type) == TYPE_GC_BYREF);\n    }\n    static BOOL IsByRef_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n        SUPPORTS_DAC;\n\n        return (GetGCType_NoThrow(type) == TYPE_GC_BYREF);\n    }\n\n    FORCEINLINE static BOOL IsGenericVariable(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).isGenVar;\n    }\n    FORCEINLINE static BOOL IsGenericVariable_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo_NoThrow(type).isGenVar;\n    }\n\n    FORCEINLINE static BOOL IsArray(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).isArray;\n    }\n    FORCEINLINE static BOOL IsArray_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo_NoThrow(type).isArray;\n    }\n\n    FORCEINLINE static BOOL IsFloat(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).isFloat;\n    }\n    FORCEINLINE static BOOL IsFloat_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo_NoThrow(type).isFloat;\n    }\n\n    FORCEINLINE static BOOL IsModifier(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).isModifier;\n    }\n    FORCEINLINE static BOOL IsModifier_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo_NoThrow(type).isModifier;\n    }\n\n    FORCEINLINE static BOOL IsPrimitiveType(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).isPrim;\n    }\n    FORCEINLINE static BOOL IsPrimitiveType_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo_NoThrow(type).isPrim;\n    }\n\n    FORCEINLINE static unsigned Size(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo(type).size;\n    }\n    FORCEINLINE static unsigned Size_NoThrow(CorElementType type)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return GetTypeInfo_NoThrow(type).size;\n    }\n\n    static CorElementType FindPrimitiveType(LPCUTF8 name);\n\nprotected:\n    static const CorTypeInfoEntry info[ELEMENT_TYPE_MAX];\n\n};  // class CorTypeInfo\n\n\n// Returns the address of the payload inside the stackelem\ninline void* StackElemEndiannessFixup(void* pStackElem, UINT cbSize) {\n    LIMITED_METHOD_CONTRACT;\n\n    BYTE *pRetVal = (BYTE*)pStackElem;\n\n#if BIGENDIAN\n    switch (cbSize)\n    {\n    case 1:\n        pRetVal += sizeof(void*)-1;\n        break;\n    case 2:\n        pRetVal += sizeof(void*)-2;\n        break;\n#ifdef HOST_64BIT\n    case 4:\n        pRetVal += sizeof(void*)-4;\n        break;\n#endif\n    default:\n        // nothing to do\n        break;\n    }\n#endif\n\n    return pRetVal;\n}\n\n#endif /* _H_SIGINFOBASE */\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/simplerhash.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _SIMPLERHASHTABLE_H_\n#define _SIMPLERHASHTABLE_H_\n\n#include \"iallocator.h\"\n\n// SimplerHashTable implements a mapping from a Key type to a Value type,\n// via a hash table.\n\n// Synchronization is the responsibility of the caller: if a\n// SimplerHash is used in a multithreaded context, the table should be\n// associated with a lock.\n\n// SimplerHashTable actually takes four template arguments: Key,\n// KeyFuncs, Value, and Behavior.  We don't assume that Key has hash or equality\n// functions specific names; rather, we assume that KeyFuncs has\n// statics methods\n//    int GetHashCode(Key)\n// and\n//    bool Equals(Key, Key)\n// and use those.  An\n// instantiator can thus make a small \"adaptor class\" to invoke\n// existing instance method hash and/or equality functions.  If the\n// implementor of a candidate Key class K understands this convention,\n// these static methods can be implemented by K, so that K can be used\n// as the actual arguments for the both Key and KeyTrait classes.\n//\n// The \"Behavior\" argument provides the following static members:\n//\n// s_growth_factor_numerator\n// s_growth_factor_denominator                  Factor to grow allocation (numerator/denominator).\n//                                              Typically inherited from default traits (3/2)\n//\n// s_density_factor_numerator\n// s_density_factor_denominator                 Maximum occupied density of table before growth\n//                                              occurs (num/denom).  Typically inherited (3/4).\n//\n// s_minimum_allocation                         Minimum table allocation count (size on first growth.)  It is\n//                                              probably preferable to call Reallocate on initialization rather\n//                                              than override his from the default traits. (7)\n//\n// NoMemory()                                   Called when the hash table is unable to grow due to potential\n//                                              overflow or the lack of a sufficiently large prime.\n\nvoid DECLSPEC_NORETURN ThrowOutOfMemory();\n\nclass DefaultSimplerHashBehavior\n{\npublic:\n    static const unsigned s_growth_factor_numerator = 3;\n    static const unsigned s_growth_factor_denominator = 2;\n\n    static const unsigned s_density_factor_numerator = 3;\n    static const unsigned s_density_factor_denominator = 4;\n\n    static const unsigned s_minimum_allocation = 7;\n\n    inline static void DECLSPEC_NORETURN NoMemory()\n    {\n        ::ThrowOutOfMemory();\n    }\n};\n\n// Stores info about primes, including the magic number and shift amount needed\n// to implement a divide without using the divide instruction\nclass PrimeInfo\n{\npublic:\n    constexpr PrimeInfo() : prime(0), magic(0), shift(0) {}\n    constexpr PrimeInfo(unsigned p, unsigned m, unsigned s) : prime(p), magic(m), shift(s) {}\n    unsigned prime;\n    unsigned magic;\n    unsigned shift;\n};\n\n\n// Hash table class definition\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nclass SimplerHashTable\n{\npublic:\n    // Forward declaration.\n    class KeyIterator;\n\n    // Constructor/destructor.  SHash tables always start out empty, with no\n    // allocation overhead.  Call Reallocate to prime with an initial size if\n    // desired. Pass NULL as the IAllocator* if you want to use DefaultAllocator\n    // (basically, operator new/delete).\n\n    SimplerHashTable(IAllocator* alloc);\n    ~SimplerHashTable();\n\n    // operators new/delete when an IAllocator is to be used.\n    void * operator new(size_t sz, IAllocator * alloc);\n    void * operator new[](size_t sz, IAllocator * alloc);\n    void   operator delete(void * p, IAllocator * alloc);\n    void   operator delete[](void * p, IAllocator * alloc);\n\n    // If the table contains a mapping for \"key\", returns \"true\" and\n    // sets \"*pVal\" to the value to which \"key\" maps.  Otherwise,\n    // returns false, and does not modify \"*pVal\".\n    bool Lookup(Key k, Value* pVal = NULL) const;\n\n    Value *LookupPointer(Key k) const;\n\n    // Causes the table to map \"key\" to \"val\".  Returns \"true\" if\n    // \"key\" had already been mapped by the table, \"false\" otherwise.\n    bool Set(Key k, Value val);\n\n    // Ensures that \"key\" is not mapped to a value by the \"table.\"\n    // Returns \"true\" iff it had been mapped.\n    bool Remove(Key k);\n\n    // Remove all mappings in the table.\n    void RemoveAll();\n\n    // Begin and End pointers for iteration over entire table.\n    KeyIterator Begin() const;\n    KeyIterator End() const;\n\n    // Return the number of elements currently stored in the table\n    unsigned GetCount() const;\n\nprivate:\n    // Forward declaration of the linked-list node class.\n    struct Node;\n\n    unsigned GetIndexForKey(Key k) const;\n\n    // If the table has a mapping for \"k\", return the node containing\n    // that mapping, else \"NULL\".\n    Node* FindNode(Key k) const;\n\n    // Resizes a hash table for growth.  The new size is computed based\n    // on the current population, growth factor, and maximum density factor.\n    void Grow();\n\n    // See if it is OK to grow the hash table by one element.  If not, reallocate\n    // the hash table.\n    void CheckGrowth();\n\npublic:\n    // Reallocates a hash table to a specific size.  The size must be big enough\n    // to hold all elements in the table appropriately.\n    //\n    // Note that the actual table size must always be a prime number; the number\n    // passed in will be upward adjusted if necessary.\n    void Reallocate(unsigned newTableSize);\n\n    // For iteration, we use a pattern similar to the STL \"forward\n    // iterator\" pattern.  It basically consists of wrapping an\n    // \"iteration variable\" in an object, and providing pointer-like\n    // operators on the iterator. Example usage:\n    //\n    // for (SimplerHashTable::KeyIterator iter = foo->Begin(), end = foo->End(); !iter.Equal(end); iter++)\n    // {\n    //      // use foo, iter.\n    // }\n    // iter.Get() will yield (a reference to) the\n    // current key.  It will assert the equivalent of \"iter != end.\"\n    class KeyIterator\n    {\n    private:\n        friend class SimplerHashTable;\n\n        // The method implementations have to be here for portability.\n        // Some compilers won't compile the separate implementation in shash.inl\n\n        Node**      m_table;\n        Node*       m_node;\n        unsigned    m_tableSize;\n        unsigned    m_index;\n\n    public:\n        KeyIterator(const SimplerHashTable *hash, BOOL begin)\n        : m_table(hash->m_table),\n          m_node(NULL),\n          m_tableSize(hash->m_tableSizeInfo.prime),\n          m_index(begin ? 0 : m_tableSize)\n        {\n            if (begin && hash->m_tableCount > 0)\n            {\n                assert(m_table != NULL);\n                while (m_index < m_tableSize && m_table[m_index] == NULL)\n                    m_index++;\n\n                if (m_index >= m_tableSize)\n                {\n                    return;\n                }\n                else\n                {\n                    m_node = m_table[m_index];\n                }\n                assert(m_node != NULL);\n            }\n        }\n\n        const Key& Get() const\n        {\n            assert(m_node != NULL);\n\n            return m_node->m_key;\n        }\n\n        const Value& GetValue() const\n        {\n            assert(m_node != NULL);\n\n            return m_node->m_val;\n        }\n\n        void SetValue(const Value & value) const\n        {\n            assert(m_node != NULL);\n\n            m_node->m_val = value;\n        }\n\n        void Next()\n        {\n            if (m_node != NULL)\n            {\n                m_node = m_node->m_next;\n                if (m_node != NULL)\n                {\n                    return;\n                }\n\n                // Otherwise...\n                m_index++;\n            }\n            while (m_index < m_tableSize && m_table[m_index] == NULL)\n                m_index++;\n\n            if (m_index >= m_tableSize)\n            {\n                m_node = NULL;\n                return;\n            }\n            else\n            {\n                m_node = m_table[m_index];\n            }\n            assert(m_node != NULL);\n        }\n\n        bool Equal(const KeyIterator &i) const\n        {\n            return i.m_node == m_node;\n        }\n\n        void operator++() {\n            Next();\n        }\n\n        void operator++(int) {\n            Next();\n        }\n    };\n\n    // HashTableRef only exists to support operator[]\n    // operator[] returns a HashTableRef which enables operator[] to support reading and writing\n    // in a normal array, it just returns a ref an actual element, which is not possible here.\n    class HashTableRef\n    {\n    public:\n        // this is really the getter for the array.\n        operator Value()\n        {\n\n            Value result;\n            table->Lookup(key, &result);\n            return result;\n        }\n\n        void operator =(const Value v)\n        {\n            table->Set(key, v);\n        }\n\n        friend class SimplerHashTable;\n\n    protected:\n        HashTableRef(SimplerHashTable *t, Key k)\n        {\n            table = t;\n            key = k;\n        }\n\n        SimplerHashTable *table;\n        Key key;\n    };\n\n    Value &operator[](Key k) const\n    {\n        Value* p = LookupPointer(k);\n        assert(p);\n        return *p;\n    }\n\n  private:\n    // Find the next prime number >= the given value.\n    static PrimeInfo NextPrime(unsigned number);\n\n    // Instance members\n    IAllocator*   m_alloc;                // IAllocator to use in this\n                                          // table.\n    // The node type.\n    struct Node {\n        Node* m_next;   // Assume that the alignment requirement of Key and Value are no greater than Node*, so put m_next to avoid unnecessary padding.\n        Key   m_key;\n        Value m_val;\n\n        Node(Key k, Value v, Node* next) : m_next(next), m_key(k), m_val(v) {}\n\n        void* operator new(size_t sz, IAllocator* alloc)\n        {\n            return alloc->Alloc(sz);\n        }\n\n        void operator delete(void* p, IAllocator* alloc)\n        {\n            alloc->Free(p);\n        }\n    };\n\n    Node**        m_table;                // pointer to table\n    PrimeInfo     m_tableSizeInfo;        // size of table (a prime) and information about it\n    unsigned      m_tableCount;           // number of elements in table\n    unsigned      m_tableMax;             // maximum occupied count\n};\n\n#include \"simplerhash.inl\"\n\n// A few simple KeyFuncs types...\n\n// Base class for types whose equality function is the same as their \"==\".\ntemplate<typename T>\nstruct KeyFuncsDefEquals\n{\n    static bool Equals(const T& x, const T& y)\n    {\n        return x == y;\n    }\n};\n\ntemplate<typename T>\nstruct PtrKeyFuncs: public KeyFuncsDefEquals<const T*>\n{\npublic:\n    static unsigned GetHashCode(const T* ptr)\n    {\n        // Hmm.  Maybe (unsigned) ought to be \"ssize_t\" -- or this ought to be ifdef'd by size.\n        return static_cast<unsigned>(reinterpret_cast<uintptr_t>(ptr));\n    }\n};\n\ntemplate<typename T> // Must be coercable to \"unsigned\" with no loss of information.\nstruct SmallPrimitiveKeyFuncs: public KeyFuncsDefEquals<T>\n{\n    static unsigned GetHashCode(const T& val)\n    {\n        return static_cast<unsigned>(val);\n    }\n};\n\ntemplate<typename T> // Assumed to be of size sizeof(UINT64).\nstruct LargePrimitiveKeyFuncs: public KeyFuncsDefEquals<T>\n{\n    static unsigned GetHashCode(const T val)\n    {\n        // A static cast when T is a float or a double converts the value (i.e. 0.25 converts to 0)\n        //\n        // Instead we want to use all of the bits of a float to create the hash value\n        // So we cast the address of val to a pointer to an equivalent sized unsigned int\n        // This allows us to read the actual bit representation of a float type\n        //\n        // We can't read beyond the end of val, so we use sizeof(T) to determine\n        // exactly how many bytes to read\n        //\n        if (sizeof(T) == 8)\n        {\n            // cast &val to (UINT64 *) then deref to get the bits\n            UINT64 asUINT64 = *(reinterpret_cast<const UINT64 *>(&val));\n\n            // Get the upper and lower 32-bit values from the 64-bit value\n            UINT32 upper32 = static_cast<UINT32> (asUINT64 >> 32);\n            UINT32 lower32 = static_cast<UINT32> (asUINT64 & 0xFFFFFFFF);\n\n            // Exclusive-Or the upper32 and the lower32 values\n            return static_cast<unsigned>(upper32 ^ lower32);\n\n        }\n        else if (sizeof(T) == 4)\n        {\n            // cast &val to (UINT32 *) then deref to get the bits\n            UINT32 asUINT32 = *(reinterpret_cast<const UINT32 *>(&val));\n\n            // Just return the 32-bit value\n            return static_cast<unsigned>(asUINT32);\n        }\n        else if ((sizeof(T) == 2) || (sizeof(T) == 1))\n        {\n            // For small sizes we must have an integer type\n            // so we can just use the static_cast.\n            //\n            return static_cast<unsigned>(val);\n        }\n        else\n        {\n            // Only support Hashing for types that are 8,4,2 or 1 bytes in size\n            assert(!\"Unsupported size\");\n            return static_cast<unsigned>(val);  // compile-time error here when we have a illegal size\n        }\n    }\n};\n\n#endif // _SIMPLERHASHTABLE_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/simplerhash.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _SIMPLERHASHTABLE_INL_\n#define _SIMPLERHASHTABLE_INL_\n\n// To implement magic-number divide with a 32-bit magic number,\n// multiply by the magic number, take the top 64 bits, and shift that\n// by the amount given in the table.\n\ninline\nunsigned magicNumberDivide(unsigned numerator, const PrimeInfo &p)\n{\n    unsigned __int64 num = numerator;\n    unsigned __int64 mag = p.magic;\n    unsigned __int64 product = (num * mag) >> (32 + p.shift);\n    return (unsigned) product;\n}\n\ninline\nunsigned magicNumberRem(unsigned numerator, const PrimeInfo &p)\n{\n    unsigned div = magicNumberDivide(numerator, p);\n    unsigned result = numerator - (div * p.prime);\n    assert(result == numerator % p.prime);\n    return result;\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nSimplerHashTable<Key,KeyFuncs,Value,Behavior>::SimplerHashTable(IAllocator* alloc)\n  : m_alloc(alloc),\n    m_table(NULL),\n    m_tableSizeInfo(),\n    m_tableCount(0),\n    m_tableMax(0)\n{\n    assert(m_alloc != nullptr);\n\n#ifndef __GNUC__ // these crash GCC\n    static_assert_no_msg(Behavior::s_growth_factor_numerator > Behavior::s_growth_factor_denominator);\n    static_assert_no_msg(Behavior::s_density_factor_numerator < Behavior::s_density_factor_denominator);\n#endif\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nSimplerHashTable<Key,KeyFuncs,Value,Behavior>::~SimplerHashTable()\n{\n    RemoveAll();\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid * SimplerHashTable<Key,KeyFuncs,Value,Behavior>::operator new(size_t sz, IAllocator * alloc)\n{\n    return alloc->Alloc(sz);\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid * SimplerHashTable<Key,KeyFuncs,Value,Behavior>::operator new[](size_t sz, IAllocator * alloc)\n{\n    return alloc->Alloc(sz);\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid SimplerHashTable<Key,KeyFuncs,Value,Behavior>::operator delete(void * p, IAllocator * alloc)\n{\n    alloc->Free(p);\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid SimplerHashTable<Key,KeyFuncs,Value,Behavior>::operator delete[](void * p, IAllocator * alloc)\n{\n    alloc->Free(p);\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nunsigned SimplerHashTable<Key,KeyFuncs,Value,Behavior>::GetCount() const\n{\n    return m_tableCount;\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nbool SimplerHashTable<Key,KeyFuncs,Value,Behavior>::Lookup(Key key, Value* pVal) const\n{\n    Node* pN = FindNode(key);\n\n    if (pN != NULL)\n    {\n        if (pVal != NULL)\n        {\n            *pVal = pN->m_val;\n        }\n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nValue *SimplerHashTable<Key,KeyFuncs,Value,Behavior>::LookupPointer(Key key) const\n{\n    Node* pN = FindNode(key);\n\n    if (pN != NULL)\n        return &(pN->m_val);\n    else\n        return NULL;\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\ntypename SimplerHashTable<Key,KeyFuncs,Value,Behavior>::Node*\nSimplerHashTable<Key,KeyFuncs,Value,Behavior>::FindNode(Key k) const\n{\n    if (m_tableSizeInfo.prime == 0)\n        return NULL;\n\n    unsigned index = GetIndexForKey(k);\n\n    Node* pN = m_table[index];\n    if (pN == NULL)\n        return NULL;\n\n    // Otherwise...\n    while (pN != NULL && !KeyFuncs::Equals(k, pN->m_key))\n        pN = pN->m_next;\n\n    assert(pN == NULL || KeyFuncs::Equals(k, pN->m_key));\n\n    // If pN != NULL, it's the node for the key, else the key isn't mapped.\n    return pN;\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nunsigned SimplerHashTable<Key,KeyFuncs,Value,Behavior>::GetIndexForKey(Key k) const\n{\n    unsigned hash = KeyFuncs::GetHashCode(k);\n\n    unsigned index = magicNumberRem(hash, m_tableSizeInfo);\n\n    return index;\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nbool SimplerHashTable<Key,KeyFuncs,Value,Behavior>::Set(Key k, Value v)\n{\n    CheckGrowth();\n\n    assert(m_tableSizeInfo.prime != 0);\n\n    unsigned index = GetIndexForKey(k);\n\n    Node* pN = m_table[index];\n    while (pN != NULL && !KeyFuncs::Equals(k, pN->m_key))\n    {\n        pN = pN->m_next;\n    }\n    if (pN != NULL)\n    {\n        pN->m_val = v;\n        return true;\n    }\n    else\n    {\n        Node* pNewNode = new (m_alloc) Node(k, v, m_table[index]);\n        m_table[index] = pNewNode;\n        m_tableCount++;\n        return false;\n    }\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nbool SimplerHashTable<Key,KeyFuncs,Value,Behavior>::Remove(Key k)\n{\n    unsigned index = GetIndexForKey(k);\n\n    Node* pN = m_table[index];\n    Node** ppN = &m_table[index];\n    while (pN != NULL && !KeyFuncs::Equals(k, pN->m_key))\n    {\n        ppN = &pN->m_next;\n        pN = pN->m_next;\n    }\n    if (pN != NULL)\n    {\n        *ppN = pN->m_next;\n        m_tableCount--;\n        Node::operator delete(pN, m_alloc);\n        return true;\n    }\n    else\n    {\n        return false;\n    }\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid SimplerHashTable<Key,KeyFuncs,Value,Behavior>::RemoveAll()\n{\n    for (unsigned i = 0; i < m_tableSizeInfo.prime; i++)\n    {\n        for (Node* pN = m_table[i]; pN != NULL; )\n        {\n            Node* pNext = pN->m_next;\n            Node::operator delete(pN, m_alloc);\n            pN = pNext;\n        }\n    }\n    m_alloc->Free(m_table);\n\n    m_table = NULL;\n    m_tableSizeInfo = PrimeInfo();\n    m_tableCount = 0;\n    m_tableMax = 0;\n\n    return;\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\ntypename SimplerHashTable<Key,KeyFuncs,Value,Behavior>::KeyIterator SimplerHashTable<Key,KeyFuncs,Value,Behavior>::Begin() const\n{\n    KeyIterator i(this, TRUE);\n    return i;\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\ntypename SimplerHashTable<Key,KeyFuncs,Value,Behavior>::KeyIterator SimplerHashTable<Key,KeyFuncs,Value,Behavior>::End() const\n{\n    return KeyIterator(this, FALSE);\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid SimplerHashTable<Key,KeyFuncs,Value,Behavior>::CheckGrowth()\n{\n    if (m_tableCount == m_tableMax)\n    {\n        Grow();\n    }\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid SimplerHashTable<Key,KeyFuncs,Value,Behavior>::Grow()\n{\n    unsigned newSize = (unsigned) (m_tableCount\n                                   * Behavior::s_growth_factor_numerator / Behavior::s_growth_factor_denominator\n                                   * Behavior::s_density_factor_denominator / Behavior::s_density_factor_numerator);\n    if (newSize < Behavior::s_minimum_allocation)\n        newSize = Behavior::s_minimum_allocation;\n\n    // handle potential overflow\n    if (newSize < m_tableCount)\n        Behavior::NoMemory();\n\n    Reallocate(newSize);\n}\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nvoid SimplerHashTable<Key,KeyFuncs,Value,Behavior>::Reallocate(unsigned newTableSize)\n{\n    assert(newTableSize >= (GetCount() * Behavior::s_density_factor_denominator / Behavior::s_density_factor_numerator));\n\n    // Allocation size must be a prime number.  This is necessary so that hashes uniformly\n    // distribute to all indices, and so that chaining will visit all indices in the hash table.\n    PrimeInfo newPrime = NextPrime(newTableSize);\n    newTableSize = newPrime.prime;\n\n    Node** newTable = (Node**)m_alloc->ArrayAlloc(newTableSize, sizeof(Node*));\n\n    for (unsigned i = 0; i < newTableSize; i++) {\n        newTable[i] = NULL;\n    }\n\n    // Move all entries over to new table (re-using the Node structures.)\n\n    for (unsigned i = 0; i < m_tableSizeInfo.prime; i++)\n    {\n        Node* pN = m_table[i];\n        while (pN != NULL)\n        {\n            Node* pNext = pN->m_next;\n\n            unsigned newIndex = magicNumberRem(KeyFuncs::GetHashCode(pN->m_key), newPrime);\n            pN->m_next = newTable[newIndex];\n            newTable[newIndex] = pN;\n\n            pN = pNext;\n        }\n    }\n\n    // @todo:\n    // We might want to try to delay this cleanup to allow asynchronous readers\n    if (m_table != NULL)\n        m_alloc->Free(m_table);\n\n    m_table = newTable;\n    m_tableSizeInfo = newPrime;\n    m_tableMax = (unsigned) (newTableSize * Behavior::s_density_factor_numerator / Behavior::s_density_factor_denominator);\n}\n\n// Table of primes and their magic-number-divide constant.\n// For more info see the book \"Hacker's Delight\" chapter 10.9 \"Unsigned Division by Divisors >= 1\"\n// These were selected by looking for primes, each roughly twice as big as the next, having\n// 32-bit magic numbers, (because the algorithm for using 33-bit magic numbers is slightly slower).\n//\n\nextern const PrimeInfo primeInfo[27];\n\ntemplate <typename Key, typename KeyFuncs, typename Value, typename Behavior>\nPrimeInfo SimplerHashTable<Key,KeyFuncs,Value,Behavior>::NextPrime(unsigned number)\n{\n    for (int i = 0; i < (int) (sizeof(primeInfo) / sizeof(primeInfo[0])); i++) {\n        if (primeInfo[i].prime >= number)\n            return primeInfo[i];\n    }\n\n    // overflow\n    Behavior::NoMemory();\n}\n\n#endif // _SIMPLERHASHTABLE_INL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/slist.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//-----------------------------------------------------------------------------\n// @File: slist.h\n//\n\n//\n// @commn: Bunch of utility classes\n//\n// HISTORY:\n//   02/03/98:  \tcreated helper classes\n//\t\t\t\t\t\tSLink, link node for singly linked list, every class that is intrusively\n//\t\t\t\t\t\t\t\tlinked should have a data member of this type\n//\t\t\t\t\t\tSList, template linked list class, contains only inline\n//\t\t\t\t\t\t\t\tmethods for fast list operations, with proper type checking\n//\n//\t\t\t\t\t\tsee below for futher info. on how to use these template classes\n//\n//-----------------------------------------------------------------------------\n\n//#ifndef _H_UTIL\n//#error \"I am a part of util.hpp Please don't include me alone !\"\n//#endif\n\n\n#ifndef _H_SLIST_\n#define _H_SLIST_\n\n//------------------------------------------------------------------\n// struct SLink, to use a singly linked list\n// have a data member m_Link of type SLink in your class\n// and instantiate the template SList class\n//--------------------------------------------------------------------\n\nstruct SLink;\ntypedef DPTR(struct SLink) PTR_SLink;\n\nstruct SLink\n{\n    PTR_SLink m_pNext;\n    SLink()\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_pNext = NULL;\n    }\n\n    void InsertAfter(SLink* pLinkToInsert)\n    {\n        LIMITED_METHOD_CONTRACT;\n        PRECONDITION_MSG(NULL == pLinkToInsert->m_pNext, \"This method does not support inserting lists\");\n\n        PTR_SLink pTemp = m_pNext;\n\n        m_pNext = PTR_SLink(pLinkToInsert);\n        pLinkToInsert->m_pNext = pTemp;\n    }\n\n    // find pLink within the list starting at pHead\n    // if found remove the link from the list and return the link\n    // otherwise return NULL\n    static SLink* FindAndRemove(SLink *pHead, SLink* pLink, SLink ** ppPrior)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n\t    _ASSERTE(pHead != NULL);\n\t    _ASSERTE(pLink != NULL);\n\n\t    SLink* pFreeLink = NULL;\n        *ppPrior = NULL;\n\n\t    while (pHead->m_pNext != NULL)\n\t    {\n\t\t    if (pHead->m_pNext == pLink)\n\t\t    {\n\t\t\t    pFreeLink = pLink;\n\t\t\t    pHead->m_pNext = pLink->m_pNext;\n                *ppPrior = pHead;\n                break;\n\t\t    }\n            pHead = pHead->m_pNext;\n\t    }\n\n\t    return pFreeLink;\n    }\n};\n\n//------------------------------------------------------------------\n// class SList. Intrusive singly linked list.\n//\n// To use SList with the default instantiation, your class should\n// define a data member of type SLink and named 'm_Link'. To use a\n// different field name, you need to provide an explicit LinkPtr\n// template argument. For example:\n//   'SList<MyClass, false, MyClass*, &MyClass::m_FieldName>'\n//\n// SList has two different behaviours depending on boolean\n// fHead variable,\n//\n// if fHead is true, then the list allows only InsertHead  operations\n// if fHead is false, then the list allows only InsertTail operations\n// the code is optimized to perform these operations\n// all methods are inline, and conditional compiled based on template\n// argument 'fHead'\n// so there is no actual code size increase\n//--------------------------------------------------------------\ntemplate <class T, bool fHead = false, typename __PTR = T*, SLink T::*LinkPtr = &T::m_Link>\nclass SList\n{\npublic:\n    // typedef used by the Queue class below\n    typedef T ENTRY_TYPE;\n\nprotected:\n\n    // used as sentinel\n    SLink  m_link; // slink.m_pNext == Null\n    PTR_SLink m_pHead;\n    PTR_SLink m_pTail;\n\n    // get the list node within the object\n    static SLink* GetLink (T* pLink)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n        return &(pLink->*LinkPtr);\n    }\n\n    // move to the beginning of the object given the pointer within the object\n    static T* GetObject (SLink* pLink)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n        if (pLink == NULL)\n        {\n            return NULL;\n        }\n        else\n        {\n#if 1\n            // Newer compilers define offsetof to be __builtin_offsetof, which doesn't use the\n            // old-school memory model trick to determine offset.\n            const UINT_PTR offset = (((UINT_PTR)&(((T *)0x1000)->*LinkPtr))-0x1000);\n            return (T*)__PTR(dac_cast<TADDR>(pLink) - offset);\n#else\n            return (T*)__PTR(dac_cast<TADDR>(pLink) - offsetof(T, *LinkPtr));\n#endif\n        }\n    }\n\npublic:\n\n    SList()\n    {\n        WRAPPER_NO_CONTRACT;\n#ifndef DACCESS_COMPILE\n        Init();\n#endif // !defined(DACCESS_COMPILE)\n    }\n\n    void Init()\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_pHead = PTR_SLink(&m_link);\n        // NOTE :: fHead variable is template argument\n        // the following code is a compiled in, only if the fHead flag\n        // is set to false,\n        if (!fHead)\n        {\n            m_pTail = PTR_SLink(&m_link);\n        }\n    }\n\n    bool IsEmpty()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_pHead->m_pNext == NULL;\n    }\n\n#ifndef DACCESS_COMPILE\n\n    void InsertTail(T *pObj)\n    {\n        LIMITED_METHOD_CONTRACT;\n        // NOTE : conditional compilation on fHead template variable\n        if (!fHead)\n        {\n            _ASSERTE(pObj != NULL);\n            SLink *pLink = GetLink(pObj);\n\n            m_pTail->m_pNext = pLink;\n            m_pTail = pLink;\n        }\n        else\n        {// you instantiated this class asking only for InsertHead operations\n            _ASSERTE(0);\n        }\n    }\n\n    void InsertHead(T *pObj)\n    {\n        LIMITED_METHOD_CONTRACT;\n        // NOTE : conditional compilation on fHead template variable\n        if (fHead)\n        {\n            _ASSERTE(pObj != NULL);\n            SLink *pLink = GetLink(pObj);\n\n            pLink->m_pNext = m_pHead->m_pNext;\n            m_pHead->m_pNext = pLink;\n        }\n        else\n        {// you instantiated this class asking only for InsertTail operations\n            _ASSERTE(0);\n        }\n    }\n\n    T*\tRemoveHead()\n    {\n        LIMITED_METHOD_CONTRACT;\n        SLink* pLink = m_pHead->m_pNext;\n        if (pLink != NULL)\n        {\n            m_pHead->m_pNext = pLink->m_pNext;\n        }\n        // conditionally compiled, if the instantiated class\n        // uses Insert Tail operations\n        if (!fHead)\n        {\n            if(m_pTail == pLink)\n            {\n                m_pTail = m_pHead;\n            }\n        }\n\n        return GetObject(pLink);\n    }\n\n#endif // !DACCESS_COMPILE\n\n    T*\tGetHead()\n    {\n        WRAPPER_NO_CONTRACT;\n        return GetObject(m_pHead->m_pNext);\n    }\n\n    T*\tGetTail()\n    {\n        WRAPPER_NO_CONTRACT;\n\n        // conditional compile\n        if (fHead)\n        {\t// you instantiated this class asking only for InsertHead operations\n            // you need to walk the list yourself to find the tail\n            _ASSERTE(0);\n        }\n        return (m_pHead != m_pTail) ? GetObject(m_pTail) : NULL;\n    }\n\n    static T *GetNext(T *pObj)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        _ASSERTE(pObj != NULL);\n        return GetObject(GetLink(pObj)->m_pNext);\n    }\n\n    T* FindAndRemove(T *pObj)\n    {\n        WRAPPER_NO_CONTRACT;\n\n        _ASSERTE(pObj != NULL);\n\n        SLink   *prior;\n        SLink   *ret = SLink::FindAndRemove(m_pHead, GetLink(pObj), &prior);\n\n        if (ret == m_pTail)\n            m_pTail = PTR_SLink(prior);\n\n        return GetObject(ret);\n    }\n\n    class Iterator\n    {\n        friend class SList;\n\n    public:\n        Iterator & operator++()\n        { _ASSERTE(m_cur != NULL); m_cur = SList::GetNext(m_cur); return *this; }\n\n        Iterator operator++(int)\n        { Iterator it(m_cur); ++(*this); return it; }\n\n        bool operator==(Iterator const & other) const\n        {\n            return m_cur == other.m_cur ||\n                   (m_cur != NULL && other.m_cur != NULL && *m_cur == *other.m_cur);\n        }\n\n        bool operator!=(Iterator const & other) const\n        { return !(*this == other); }\n\n        T & operator*()\n        { _ASSERTE(m_cur != NULL); return *m_cur; }\n\n        T * operator->() const\n        { return m_cur; }\n\n    private:\n        Iterator(SList * pList)\n            : m_cur(pList->GetHead())\n        { }\n\n        Iterator(T* pObj)\n            : m_cur(pObj)\n        { }\n\n        Iterator()\n            : m_cur(NULL)\n        { }\n\n        T* m_cur;\n    };\n\n    Iterator begin()\n    { return Iterator(GetHead()); }\n\n    Iterator end()\n    { return Iterator(); }\n};\n\ntemplate <typename ElemT>\nstruct SListElem\n{\n    SLink m_Link;\n    ElemT m_Value;\n\n    operator ElemT const &() const\n    { return m_Value; }\n\n    operator ElemT &()\n    { return m_Value; }\n\n    ElemT const & operator*() const\n    { return m_Value; }\n\n    ElemT & operator*()\n    { return m_Value; }\n\n    ElemT const & GetValue() const\n    { return m_Value; }\n\n    ElemT & GetValue()\n    { return m_Value; }\n\n    SListElem()\n        : m_Link()\n        , m_Value()\n    { }\n\n    template <typename T1>\n    SListElem(T1&& val)\n        : m_Link()\n        , m_Value(std::forward<T1>(val))\n    { }\n\n    template <typename T1, typename T2>\n    SListElem(T1&& val1, T2&& val2)\n        : m_Link()\n        , m_Value(std::forward<T1>(val1), std::forward<T2>(val2))\n    { }\n\n    template <typename T1, typename T2, typename T3>\n    SListElem(T1&& val1, T2&& val2, T3&& val3)\n        : m_Link()\n        , m_Value(std::forward<T1>(val1), std::forward<T2>(val2), std::forward<T3>(val3))\n    { }\n\n    template <typename T1, typename T2, typename T3, typename T4>\n    SListElem(T1&& val1, T2&& val2, T3&& val3, T4&& val4)\n        : m_Link()\n        , m_Value(std::forward<T1>(val1), std::forward<T2>(val2), std::forward<T3>(val3), std::forward<T4>(val4))\n    { }\n};\n\n#endif // _H_SLIST_\n\n// End of file: list.h\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sospriv.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n/*****************************************************************************\n **                                                                         **\n ** sospriv.idl - The private interface that SOS uses to query the runtime  **\n **               for internal data.                                        **\n **                                                                         **\n *****************************************************************************/\nimport \"unknwn.idl\";\n\nimport \"xclrdata.idl\";\n\nstruct DacpSyncBlockCleanupData;\nstruct DacpThreadStoreData;\nstruct DacpAppDomainStoreData;\nstruct DacpAppDomainData;\nstruct DacpAssemblyData;\nstruct DacpThreadData;\nstruct DacpMethodDescData;\nstruct DacpCodeHeaderData;\nstruct DacpThreadpoolData;\nstruct DacpObjectData;\nstruct DacpWorkRequestData;\nstruct DacpMethodTableData;\nstruct DacpWorkRequestData;\nstruct DacpModuleData;\nstruct DacpGcHeapData;\nstruct DacpJitManagerInfo;\nstruct DacpHeapSegmentData;\nstruct DacpDomainLocalModuleData;\nstruct DacpDomainLocalModuleData;\nstruct DACEHInfo;\nstruct DacpRCWData;\nstruct DacpAllocData;\nstruct DacpGenerationAllocData;\nstruct DacpExceptionObjectData;\ncpp_quote(\"#if 0\")\ntypedef ULONG64 CLRDATA_ADDRESS;\ntypedef int CONTEXT;\ntypedef int T_CONTEXT;\ntypedef int mdToken;\ntypedef unsigned int size_t;\ntypedef int ModuleMapType;\ntypedef int VCSHeapType;\ncpp_quote(\"#endif\")\n\n\ncpp_quote(\"typedef enum { TYPEDEFTOMETHODTABLE, TYPEREFTOMETHODTABLE } ModuleMapType;\")\ncpp_quote(\"typedef enum {IndcellHeap, LookupHeap, ResolveHeap, DispatchHeap, CacheEntryHeap} VCSHeapType;\")\n\ntypedef void (*MODULEMAPTRAVERSE)(UINT index, CLRDATA_ADDRESS methodTable,LPVOID token);\ntypedef void (*VISITHEAP)(CLRDATA_ADDRESS blockData,size_t blockSize,BOOL blockIsCurrentBlock);\n\ntypedef BOOL (*VISITRCWFORCLEANUP)(CLRDATA_ADDRESS RCW,CLRDATA_ADDRESS Context,CLRDATA_ADDRESS Thread,\n    BOOL bIsFreeThreaded, LPVOID token);\ntypedef BOOL (*DUMPEHINFO)(UINT clauseIndex,UINT totalClauses, struct DACEHInfo *pEHInfo,LPVOID token);\n\ncpp_quote(\"#ifndef _SOS_HandleData\")\ncpp_quote(\"#define _SOS_HandleData\")\n\ntypedef struct _SOSHandleData\n{\n    CLRDATA_ADDRESS AppDomain;\n    CLRDATA_ADDRESS Handle;\n    CLRDATA_ADDRESS Secondary;\n    unsigned int Type;\n    BOOL StrongReference;\n\n    // For RefCounted Handles\n    unsigned int RefCount;\n    unsigned int JupiterRefCount;\n    BOOL IsPegged;\n} SOSHandleData;\n\ncpp_quote(\"#endif //HandleData\")\n\n[\n    object,\n    local,\n    uuid(286CA186-E763-4F61-9760-487D43AE4341)\n]\ninterface ISOSEnum : IUnknown\n{\n    HRESULT Skip([in] unsigned int count);\n    HRESULT Reset();\n    HRESULT GetCount([out] unsigned int *pCount);\n}\n\n\n[\n    object,\n    local,\n    uuid(3E269830-4A2B-4301-8EE2-D6805B29B2FA)\n]\ninterface ISOSHandleEnum : ISOSEnum\n{\n    HRESULT Next([in] unsigned int count,\n                 [out, size_is(count), length_is(*pNeeded)] SOSHandleData handles[],\n                 [out] unsigned int *pNeeded);\n}\n\ncpp_quote(\"#ifndef _SOS_StackReference_\")\ncpp_quote(\"#define _SOS_StackReference_\")\n\ntypedef enum SOSStackSourceType\n{\n    SOS_StackSourceIP,     // Instruction pointer in managed code\n    SOS_StackSourceFrame,  // clr!Frame\n} SOSStackSourceType;\n\ntypedef enum SOSRefFlags\n{\n    SOSRefInterior = 1,\n    SOSRefPinned = 2\n} SOSRefFlags;\n\ntypedef struct _SOS_StackRefData\n{\n    BOOL HasRegisterInformation;\n    int Register;\n    int Offset;\n    CLRDATA_ADDRESS Address;\n    CLRDATA_ADDRESS Object;\n    unsigned int Flags;\n\n    SOSStackSourceType SourceType;\n    CLRDATA_ADDRESS Source;\n    CLRDATA_ADDRESS StackPointer;\n} SOSStackRefData;\n\n/* Informs the user that we were unable to process the given clr!Frame or\n * managed frame.\n */\ntypedef struct _SOS_StackRefError\n{\n    SOSStackSourceType SourceType;\n    CLRDATA_ADDRESS Source;\n    CLRDATA_ADDRESS StackPointer;\n} SOSStackRefError;\n\ncpp_quote(\"#endif // _SOS_StackReference_\")\n\n[\n    object,\n    local,\n    uuid(774F4E1B-FB7B-491B-976D-A8130FE355E9)\n]\ninterface ISOSStackRefErrorEnum : ISOSEnum\n{\n    HRESULT Next([in] unsigned int count,\n                 [out, size_is(count), length_is(*pFetched)] SOSStackRefError ref[],\n                 [out] unsigned int *pFetched);\n}\n\n[\n    object,\n    local,\n    uuid(8FA642BD-9F10-4799-9AA3-512AE78C77EE)\n]\ninterface ISOSStackRefEnum  : ISOSEnum\n{\n    HRESULT Next([in] unsigned int count,\n                 [out, size_is(count), length_is(*pFetched)] SOSStackRefData ref[],\n                 [out] unsigned int *pFetched);\n\n\n     /* Reports all frames which we could not enumerate gc references for.\n      */\n     HRESULT EnumerateErrors([out] ISOSStackRefErrorEnum **ppEnum);\n}\n\n\n[\n    object,\n    local,\n    uuid(436f00f2-b42a-4b9f-870c-e73db66ae930)\n]\ninterface ISOSDacInterface : IUnknown\n{\n    // ThreadStore\n    HRESULT GetThreadStoreData(struct DacpThreadStoreData *data);\n\n    // AppDomains\n    HRESULT GetAppDomainStoreData(struct DacpAppDomainStoreData *data);\n    HRESULT GetAppDomainList(unsigned int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded);\n    HRESULT GetAppDomainData(CLRDATA_ADDRESS addr, struct DacpAppDomainData *data);\n    HRESULT GetAppDomainName(CLRDATA_ADDRESS addr, unsigned int count, WCHAR *name, unsigned int *pNeeded);\n    HRESULT GetDomainFromContext(CLRDATA_ADDRESS context, CLRDATA_ADDRESS *domain);\n\n    // Assemblies\n    HRESULT GetAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], int *pNeeded);\n    HRESULT GetAssemblyData(CLRDATA_ADDRESS baseDomainPtr, CLRDATA_ADDRESS assembly, struct DacpAssemblyData *data);\n    HRESULT GetAssemblyName(CLRDATA_ADDRESS assembly, unsigned int count, WCHAR *name, unsigned int *pNeeded);\n\n    // Modules\n    HRESULT GetModule(CLRDATA_ADDRESS addr, IXCLRDataModule **mod);\n    HRESULT GetModuleData(CLRDATA_ADDRESS moduleAddr, struct DacpModuleData *data);\n    HRESULT TraverseModuleMap(ModuleMapType mmt, CLRDATA_ADDRESS moduleAddr, MODULEMAPTRAVERSE pCallback, LPVOID token);\n    HRESULT GetAssemblyModuleList(CLRDATA_ADDRESS assembly, unsigned int count, CLRDATA_ADDRESS modules[], unsigned int *pNeeded);\n    HRESULT GetILForModule(CLRDATA_ADDRESS moduleAddr, DWORD rva, CLRDATA_ADDRESS *il);\n\n    // Threads\n    HRESULT GetThreadData(CLRDATA_ADDRESS thread, struct DacpThreadData *data);\n    HRESULT GetThreadFromThinlockID(UINT thinLockId, CLRDATA_ADDRESS *pThread);\n    HRESULT GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower, CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp);\n\n    // MethodDescs\n    HRESULT GetMethodDescData(CLRDATA_ADDRESS methodDesc, CLRDATA_ADDRESS ip, struct DacpMethodDescData *data, ULONG cRevertedRejitVersions, struct DacpReJitData * rgRevertedRejitData, ULONG * pcNeededRevertedRejitData);\n    HRESULT GetMethodDescPtrFromIP(CLRDATA_ADDRESS ip, CLRDATA_ADDRESS * ppMD);\n    HRESULT GetMethodDescName(CLRDATA_ADDRESS methodDesc, unsigned int count, WCHAR *name, unsigned int *pNeeded);\n    HRESULT GetMethodDescPtrFromFrame(CLRDATA_ADDRESS frameAddr, CLRDATA_ADDRESS * ppMD);\n    HRESULT GetMethodDescFromToken(CLRDATA_ADDRESS moduleAddr, mdToken token, CLRDATA_ADDRESS *methodDesc);\n    HRESULT GetMethodDescTransparencyData(CLRDATA_ADDRESS methodDesc, struct DacpMethodDescTransparencyData *data);\n\n    // JIT Data\n    HRESULT GetCodeHeaderData(CLRDATA_ADDRESS ip, struct DacpCodeHeaderData *data);\n    HRESULT GetJitManagerList(unsigned int count, struct DacpJitManagerInfo *managers, unsigned int *pNeeded);\n    HRESULT GetJitHelperFunctionName(CLRDATA_ADDRESS ip, unsigned int count, char *name, unsigned int *pNeeded);\n    HRESULT GetJumpThunkTarget(T_CONTEXT *ctx, CLRDATA_ADDRESS *targetIP, CLRDATA_ADDRESS *targetMD);\n\n    // ThreadPool\n    HRESULT GetThreadpoolData(struct DacpThreadpoolData *data);\n    HRESULT GetWorkRequestData(CLRDATA_ADDRESS addrWorkRequest, struct DacpWorkRequestData *data);\n    HRESULT GetHillClimbingLogEntry(CLRDATA_ADDRESS addr, struct DacpHillClimbingLogEntry *data);\n\n    // Objects\n    HRESULT GetObjectData(CLRDATA_ADDRESS objAddr, struct DacpObjectData *data);\n    HRESULT GetObjectStringData(CLRDATA_ADDRESS obj, unsigned int count, WCHAR *stringData, unsigned int *pNeeded);\n    HRESULT GetObjectClassName(CLRDATA_ADDRESS obj, unsigned int count, WCHAR *className, unsigned int *pNeeded);\n\n    // MethodTable\n    HRESULT GetMethodTableName(CLRDATA_ADDRESS mt, unsigned int count, WCHAR *mtName, unsigned int *pNeeded);\n    HRESULT GetMethodTableData(CLRDATA_ADDRESS mt, struct DacpMethodTableData *data);\n    HRESULT GetMethodTableSlot(CLRDATA_ADDRESS mt, unsigned int slot, CLRDATA_ADDRESS *value);\n    HRESULT GetMethodTableFieldData(CLRDATA_ADDRESS mt, struct DacpMethodTableFieldData *data);\n    HRESULT GetMethodTableTransparencyData(CLRDATA_ADDRESS mt, struct DacpMethodTableTransparencyData *data);\n\n    // EEClass\n    HRESULT GetMethodTableForEEClass(CLRDATA_ADDRESS eeClass, CLRDATA_ADDRESS *value);\n\n    // FieldDesc\n    HRESULT GetFieldDescData(CLRDATA_ADDRESS fieldDesc, struct DacpFieldDescData *data);\n\n    // Frames\n    HRESULT GetFrameName(CLRDATA_ADDRESS vtable, unsigned int count, WCHAR *frameName, unsigned int *pNeeded);\n\n\n    // PEFiles\n    HRESULT GetPEFileBase(CLRDATA_ADDRESS addr, CLRDATA_ADDRESS *base);\n    HRESULT GetPEFileName(CLRDATA_ADDRESS addr, unsigned int count, WCHAR *fileName, unsigned int *pNeeded);\n\n    // GC\n    HRESULT GetGCHeapData(struct DacpGcHeapData *data);\n    HRESULT GetGCHeapList(unsigned int count, CLRDATA_ADDRESS heaps[], unsigned int *pNeeded); // svr only\n    HRESULT GetGCHeapDetails(CLRDATA_ADDRESS heap, struct DacpGcHeapDetails *details); // wks only\n    HRESULT GetGCHeapStaticData(struct DacpGcHeapDetails *data);\n    HRESULT GetHeapSegmentData(CLRDATA_ADDRESS seg, struct DacpHeapSegmentData *data);\n    HRESULT GetOOMData(CLRDATA_ADDRESS oomAddr, struct DacpOomData *data);\n    HRESULT GetOOMStaticData(struct DacpOomData *data);\n    HRESULT GetHeapAnalyzeData(CLRDATA_ADDRESS addr, struct  DacpGcHeapAnalyzeData *data);\n    HRESULT GetHeapAnalyzeStaticData(struct DacpGcHeapAnalyzeData *data);\n\n    // DomainLocal\n    HRESULT GetDomainLocalModuleData(CLRDATA_ADDRESS addr, struct DacpDomainLocalModuleData *data);\n    HRESULT GetDomainLocalModuleDataFromAppDomain(CLRDATA_ADDRESS appDomainAddr, int moduleID, struct DacpDomainLocalModuleData *data);\n    HRESULT GetDomainLocalModuleDataFromModule(CLRDATA_ADDRESS moduleAddr, struct DacpDomainLocalModuleData *data);\n\n    // ThreadLocal\n    HRESULT GetThreadLocalModuleData(CLRDATA_ADDRESS thread, unsigned int index, struct DacpThreadLocalModuleData *data);\n\n    // SyncBlock\n    HRESULT GetSyncBlockData(unsigned int number, struct DacpSyncBlockData *data);\n    HRESULT GetSyncBlockCleanupData(CLRDATA_ADDRESS addr, struct DacpSyncBlockCleanupData *data);\n\n    // Handles\n    HRESULT GetHandleEnum(ISOSHandleEnum **ppHandleEnum);\n    HRESULT GetHandleEnumForTypes(unsigned int types[], unsigned int count, ISOSHandleEnum **ppHandleEnum);\n    HRESULT GetHandleEnumForGC(unsigned int gen, ISOSHandleEnum **ppHandleEnum);\n\n    // EH\n    HRESULT TraverseEHInfo(CLRDATA_ADDRESS ip, DUMPEHINFO pCallback, LPVOID token);\n    HRESULT GetNestedExceptionData(CLRDATA_ADDRESS exception, CLRDATA_ADDRESS *exceptionObject, CLRDATA_ADDRESS *nextNestedException);\n\n    // StressLog\n    HRESULT GetStressLogAddress(CLRDATA_ADDRESS *stressLog);\n\n    // Heaps\n    HRESULT TraverseLoaderHeap(CLRDATA_ADDRESS loaderHeapAddr, VISITHEAP pCallback);\n    HRESULT GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, struct DacpJitCodeHeapInfo *codeHeaps, unsigned int *pNeeded);\n    HRESULT TraverseVirtCallStubHeap(CLRDATA_ADDRESS pAppDomain, VCSHeapType heaptype, VISITHEAP pCallback);\n\n    // Other\n    HRESULT GetUsefulGlobals(struct DacpUsefulGlobalsData *data);\n    HRESULT GetClrWatsonBuckets(CLRDATA_ADDRESS thread, void *pGenericModeBlock);\n    HRESULT GetTLSIndex(ULONG *pIndex);\n    HRESULT GetDacModuleHandle(HMODULE *phModule);\n\n    // COM\n    HRESULT GetRCWData(CLRDATA_ADDRESS addr, struct DacpRCWData *data);\n    HRESULT GetRCWInterfaces(CLRDATA_ADDRESS rcw, unsigned int count, struct DacpCOMInterfacePointerData *interfaces, unsigned int *pNeeded);\n    HRESULT GetCCWData(CLRDATA_ADDRESS ccw, struct DacpCCWData *data);\n    HRESULT GetCCWInterfaces(CLRDATA_ADDRESS ccw, unsigned int count, struct DacpCOMInterfacePointerData *interfaces, unsigned int *pNeeded);\n    HRESULT TraverseRCWCleanupList(CLRDATA_ADDRESS cleanupListPtr, VISITRCWFORCLEANUP pCallback, LPVOID token);\n\n    // GC Reference Functions\n\n    /*      GetStackReferences\n     * Enumerates all references on a given callstack.\n     */\n    HRESULT GetStackReferences([in] DWORD osThreadID, [out] ISOSStackRefEnum **ppEnum);\n    HRESULT GetRegisterName([in] int regName, [in] unsigned int count, [out] WCHAR *buffer, [out] unsigned int *pNeeded);\n\n    HRESULT GetThreadAllocData(CLRDATA_ADDRESS thread, struct DacpAllocData *data);\n    HRESULT GetHeapAllocData(unsigned int count, struct DacpGenerationAllocData *data, unsigned int *pNeeded);\n\n    // For BindingDisplay plugin\n    HRESULT GetFailedAssemblyList(CLRDATA_ADDRESS appDomain, int count, CLRDATA_ADDRESS values[], unsigned int *pNeeded);\n    HRESULT GetPrivateBinPaths(CLRDATA_ADDRESS appDomain, int count, WCHAR *paths, unsigned int *pNeeded);\n    HRESULT GetAssemblyLocation(CLRDATA_ADDRESS assembly, int count, WCHAR *location, unsigned int *pNeeded);\n    HRESULT GetAppDomainConfigFile(CLRDATA_ADDRESS appDomain, int count, WCHAR *configFile, unsigned int *pNeeded);\n    HRESULT GetApplicationBase(CLRDATA_ADDRESS appDomain, int count, WCHAR *base, unsigned int *pNeeded);\n    HRESULT GetFailedAssemblyData(CLRDATA_ADDRESS assembly, unsigned int *pContext, HRESULT *pResult);\n    HRESULT GetFailedAssemblyLocation(CLRDATA_ADDRESS assesmbly, unsigned int count, WCHAR *location, unsigned int *pNeeded);\n    HRESULT GetFailedAssemblyDisplayName(CLRDATA_ADDRESS assembly, unsigned int count, WCHAR *name, unsigned int *pNeeded);\n};\n\n[\n    object,\n    local,\n    uuid(A16026EC-96F4-40BA-87FB-5575986FB7AF)\n]\ninterface ISOSDacInterface2 : IUnknown\n{\n    HRESULT GetObjectExceptionData(CLRDATA_ADDRESS objAddr, struct DacpExceptionObjectData *data);\n    HRESULT IsRCWDCOMProxy(CLRDATA_ADDRESS rcwAddr, BOOL* isDCOMProxy);\n};\n\n[\n    object,\n    local,\n    uuid(B08C5CDC-FD8A-49C5-AB38-5FEEF35235B4)\n]\ninterface ISOSDacInterface3 : IUnknown\n{\n    HRESULT GetGCInterestingInfoData(CLRDATA_ADDRESS interestingInfoAddr, struct DacpGCInterestingInfoData *data);\n    HRESULT GetGCInterestingInfoStaticData(struct DacpGCInterestingInfoData *data);\n    HRESULT GetGCGlobalMechanisms(size_t* globalMechanisms);\n};\n\n[\n    object,\n    local,\n    uuid(74B9D34C-A612-4B07-93DD-5462178FCE11)\n]\ninterface ISOSDacInterface4 : IUnknown\n{\n    HRESULT GetClrNotification(CLRDATA_ADDRESS arguments[], int count, int *pNeeded);\n};\n\n[\n    object,\n    local,\n    uuid(127d6abe-6c86-4e48-8e7b-220781c58101)\n]\ninterface ISOSDacInterface5 : IUnknown\n{\n    HRESULT GetTieredVersions(CLRDATA_ADDRESS methodDesc, int rejitId, struct DacpTieredVersionData *nativeCodeAddrs, int cNativeCodeAddrs, int *pcNativeCodeAddrs);\n};\n\n[\n    object,\n    local,\n    uuid(11206399-4B66-4EDB-98EA-85654E59AD45)\n]\ninterface ISOSDacInterface6 : IUnknown\n{\n    HRESULT GetMethodTableCollectibleData(CLRDATA_ADDRESS mt, struct DacpMethodTableCollectibleData *data);\n};\n\n[\n    object,\n    local,\n    uuid(c1020dde-fe98-4536-a53b-f35a74c327eb)\n]\ninterface ISOSDacInterface7 : IUnknown\n{\n    HRESULT GetPendingReJITID(CLRDATA_ADDRESS methodDesc, int *pRejitId);\n    HRESULT GetReJITInformation(CLRDATA_ADDRESS methodDesc, int rejitId, struct DacpReJitData2 *pRejitData);\n    HRESULT GetProfilerModifiedILInformation(CLRDATA_ADDRESS methodDesc, struct DacpProfilerILData *pILData);\n    HRESULT GetMethodsWithProfilerModifiedIL(CLRDATA_ADDRESS mod, CLRDATA_ADDRESS *methodDescs, int cMethodDescs, int *pcMethodDescs);\n};\n\n[\n    object,\n    local,\n    uuid(c12f35a9-e55c-4520-a894-b3dc5165dfce)\n]\ninterface ISOSDacInterface8 : IUnknown\n{\n    HRESULT GetNumberGenerations(unsigned int *pGenerations);\n\n    // WKS\n    HRESULT GetGenerationTable(unsigned int cGenerations, struct DacpGenerationData *pGenerationData, unsigned int *pNeeded);\n    HRESULT GetFinalizationFillPointers(unsigned int cFillPointers, CLRDATA_ADDRESS *pFinalizationFillPointers, unsigned int *pNeeded);\n\n    // SVR\n    HRESULT GetGenerationTableSvr(CLRDATA_ADDRESS heapAddr, unsigned int cGenerations, struct DacpGenerationData *pGenerationData, unsigned int *pNeeded);\n    HRESULT GetFinalizationFillPointersSvr(CLRDATA_ADDRESS heapAddr, unsigned int cFillPointers, CLRDATA_ADDRESS *pFinalizationFillPointers, unsigned int *pNeeded);\n\n    HRESULT GetAssemblyLoadContext(CLRDATA_ADDRESS methodTable, CLRDATA_ADDRESS* assemblyLoadContext);\n}\n\n// Increment anytime there is a change in the data structures that SOS depends on like\n// stress log structs (StressMsg, StressLogChunck, ThreadStressLog, etc), exception\n// stack traces (StackTraceElement), the PredefinedTlsSlots enums, etc.\ncpp_quote(\"#define SOS_BREAKING_CHANGE_VERSION 3\")\n\n[\n    object,\n    local,\n    uuid(4eca42d8-7e7b-4c8a-a116-7bfbf6929267)\n]\ninterface ISOSDacInterface9 : IUnknown\n{\n    HRESULT GetBreakingChangeVersion(int* pVersion);\n}\n\n[\n    object,\n    local,\n    uuid(90B8FCC3-7251-4B0A-AE3D-5C13A67EC9AA)\n]\ninterface ISOSDacInterface10 : IUnknown\n{\n    HRESULT GetObjectComWrappersData(CLRDATA_ADDRESS objAddr, CLRDATA_ADDRESS *rcw, unsigned int count, CLRDATA_ADDRESS *mowList, unsigned int *pNeeded);\n    HRESULT IsComWrappersCCW(CLRDATA_ADDRESS ccw, BOOL *isComWrappersCCW);\n    HRESULT GetComWrappersCCWData(CLRDATA_ADDRESS ccw, CLRDATA_ADDRESS *managedObject, int *refCount);\n    HRESULT IsComWrappersRCW(CLRDATA_ADDRESS rcw, BOOL *isComWrappersRCW);\n    HRESULT GetComWrappersRCWData(CLRDATA_ADDRESS rcw, CLRDATA_ADDRESS *identity);\n}\n\n[\n    object,\n    local,\n    uuid(96BA1DB9-14CD-4492-8065-1CAAECF6E5CF)\n]\ninterface ISOSDacInterface11 : IUnknown\n{\n    HRESULT IsTrackedType(CLRDATA_ADDRESS objAddr, BOOL* isTrackedType, BOOL* hasTaggedMemory);\n    HRESULT GetTaggedMemory(CLRDATA_ADDRESS objAddr, CLRDATA_ADDRESS* taggedMemory, size_t* taggedMemorySizeInBytes);\n}\n\n[\n    object,\n    local,\n    uuid(1b93bacc-8ca4-432d-943a-3e6e7ec0b0a3)\n]\ninterface ISOSDacInterface12 : IUnknown\n{\n    HRESULT GetGlobalAllocationContext(CLRDATA_ADDRESS* allocPtr, CLRDATA_ADDRESS* allocLimit);\n}\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sstring.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// SString.h  (Safe String)\n//\n\n// ---------------------------------------------------------------------------\n\n// ------------------------------------------------------------------------------------------\n// SString is the \"standard\" string representation for the EE.  Its has two purposes.\n// (1) it provides an easy-to-use, relatively efficient, string class for APIs to standardize\n//      on.\n// (2) it completely encapsulates all \"unsafe\" string operations - that is, string operations\n//      which yield possible buffer overrun bugs.  Typesafe use of this API should help guarantee\n//      safety.\n//\n// A SString is conceptually unicode, although the internal conversion might be delayed as long as possible\n// Basically it's up to the implementation whether conversion takes place immediately or is delayed, and if\n// delayed, what operations trigger the conversion.\n//\n// Note that anywhere you express a \"position\" in a string, it is in terms of the Unicode representation of the\n// string.\n//\n// If you need a direct non-unicode representation, you will have to provide a fresh SString which can\n// receive a conversion operation if necessary.\n//\n// The alternate encodings available are:\n// 1. ASCII - string consisting entirely of ASCII (7 bit) characters.  This is the only 1 byte encoding\n//    guaranteed to be fixed width. Such a string is also a valid instance of all the other 1 byte string\n//    representations, and we take advantage of this fact.\n// 2. UTF-8 - standard multibyte unicode encoding.\n// 3. ANSI - Potentially multibyte encoding using the ANSI page determined by GetACP().\n//\n// @todo: Note that we could also provide support for several other cases (but currently do not.)\n//  - Page specified by GetOEMCP() (OEM page)\n//  - Arbitrary page support\n//\n// @todo: argument & overflow/underflow checking needs to be added\n// ------------------------------------------------------------------------------------------\n\n\n#ifndef _SSTRING_H_\n#define _SSTRING_H_\n\n#include \"utilcode.h\"\n#include \"sbuffer.h\"\n#include \"debugmacros.h\"\n\n// ==========================================================================================\n// Documentational typedefs: use these to indicate specific representations of 8 bit strings:\n// ==========================================================================================\n\n// Note that LPCSTR means ASCII (7-bit) only!\n\ntypedef CHAR ASCII;\ntypedef ASCII *LPASCII;\ntypedef const ASCII *LPCASCII;\n\ntypedef CHAR ANSI;\ntypedef ANSI *LPANSI;\ntypedef const ANSI *LPCANSI;\n\ntypedef CHAR UTF8;\ntypedef UTF8 *LPUTF8;\ntypedef const UTF8 *LPCUTF8;\n\n// ==========================================================================================\n// SString is the base class for safe strings.\n// ==========================================================================================\n\n\ntypedef DPTR(class SString) PTR_SString;\nclass EMPTY_BASES_DECL SString : private SBuffer\n{\n    friend struct _DacGlobals;\n\nprivate:\n    enum Representation\n    {\n        // Note: bits are meaningful:      xVS  V == Variable?  S == Single byte width?\n        REPRESENTATION_EMPTY    = 0x00, // 000\n        REPRESENTATION_UNICODE  = 0x04, // 100\n        REPRESENTATION_ASCII    = 0x01, // 001\n        REPRESENTATION_UTF8     = 0x03, // 011\n\n        REPRESENTATION_VARIABLE_MASK    = 0x02,\n        REPRESENTATION_SINGLE_MASK      = 0x01,\n        REPRESENTATION_MASK             = 0x07,\n    };\n\n    // Minimum guess for Printf buffer size\n    const static COUNT_T MINIMUM_GUESS = 20;\n\n\n#ifdef _DEBUG\n    // Used to have a public ctor of this form - made it too easy to lose\n    // utf8 info by accident. Now you have to specify the representation type\n    // explicitly - this privator ctor prevents reinsertion of this ctor.\n    explicit SString(const ASCII *)\n    {\n        _ASSERTE(!\"Don't call this.\");\n    }\n#endif\n\n  protected:\n    class Index;\n\n    friend class Index;\n\n  public:\n\n    // CIterators/Iterator'string must be modified by SString APIs.\n    class CIterator;\n    class Iterator;\n\n    // Tokens for constructor overloads\n    enum tagUTF8Literal { Utf8Literal };\n    enum tagLiteral { Literal };\n    enum tagUTF8 { Utf8 };\n    enum tagASCII { Ascii };\n\n    static void Startup();\n    static CHECK CheckStartup();\n\n    static const SString &Empty();\n\n    SString();\n\n    explicit SString(const SString &s);\n\n    SString(const SString &s1, const SString &s2);\n    SString(const SString &s1, const SString &s2, const SString &s3);\n    SString(const SString &s1, const SString &s2, const SString &s3, const SString &s4);\n    SString(const SString &s, const CIterator &i, COUNT_T length);\n    SString(const SString &s, const CIterator &start, const CIterator &end);\n    SString(const WCHAR *string);\n    SString(const WCHAR *string, COUNT_T count);\n    SString(enum tagASCII dummyTag, const ASCII *string);\n    SString(enum tagASCII dummyTag, const ASCII *string, COUNT_T count);\n    SString(enum tagUTF8 dummytag, const UTF8 *string);\n    SString(enum tagUTF8 dummytag, const UTF8 *string, COUNT_T count);\n    SString(WCHAR character);\n\n    // NOTE: Literals MUST be read-only never-freed strings.\n    SString(enum tagLiteral dummytag, const CHAR *literal);\n    SString(enum tagUTF8Literal dummytag, const UTF8 *literal);\n    SString(enum tagLiteral dummytag, const WCHAR *literal);\n    SString(enum tagLiteral dummytag, const WCHAR *literal, COUNT_T count);\n\n    // Set this string to the concatenation of s1,s2,s3,s4\n    void Set(const SString &s);\n    void Set(const SString &s1, const SString &s2);\n    void Set(const SString &s1, const SString &s2, const SString &s3);\n    void Set(const SString &s1, const SString &s2, const SString &s3, const SString &s4);\n\n    // Set this string to the substring of s, starting at i, of length characters.\n    void Set(const SString &s, const CIterator &i, COUNT_T length);\n\n    // Set this string to the substring of s, starting at start and ending at end (exclusive)\n    void Set(const SString &s, const CIterator &start, const CIterator &end);\n\n    // Set this string to a copy of the given string\n    void Set(const WCHAR *string);\n    void SetASCII(const ASCII *string);\n    void SetUTF8(const UTF8 *string);\n    void SetAndConvertToUTF8(const WCHAR* string);\n\n    // Set this string to a copy of the first count chars of the given string\n    void Set(const WCHAR *string, COUNT_T count);\n\n    // Set this string to a prellocated copy of a given string.\n    // The caller is the owner of the buffer and has to coordinate its lifetime.\n    void SetPreallocated(const WCHAR *string, COUNT_T count);\n\n    void SetASCII(const ASCII *string, COUNT_T count);\n\n    void SetUTF8(const UTF8 *string, COUNT_T count);\n\n    // Set this string to the unicode character\n    void Set(WCHAR character);\n\n    // Set this string to the UTF8 character\n    void SetUTF8(CHAR character);\n\n    // Set this string to the given literal. We share the mem and don't make a copy.\n    void SetLiteral(const CHAR *literal);\n    void SetLiteral(const WCHAR *literal);\n\n    // ------------------------------------------------------------------\n    // Public operations\n    // ------------------------------------------------------------------\n\n    // Normalizes the string representation to unicode.  This can be used to\n    // make basic read-only operations non-failing.\n    void Normalize() const;\n\n    // Return the number of characters in the string (excluding the terminating NULL).\n    COUNT_T GetCount() const;\n    BOOL IsEmpty() const;\n\n    // Return whether a single byte string has all characters which fit in the ASCII set.\n    // (Note that this will return FALSE if the string has been converted to unicode for any\n    // reason.)\n    BOOL IsASCII() const;\n\n    // !!!!!!!!!!!!!! WARNING about case insensitive operations !!!!!!!!!!!!!!!\n    //\n    //                 THIS IS NOT SUPPORTED FULLY ON WIN9x\n    //      SString case-insensitive comparison is based off LCMapString,\n    //      which does not work on characters outside the current OS code page.\n    //\n    //      Case insensitive code in SString is primarily targeted at\n    //      supporting path comparisons, which is supported correctly on 9x,\n    //      since file system names are limited to the OS code page.\n    //\n    // !!!!!!!!!!!!!! WARNING about case insensitive operations !!!!!!!!!!!!!!!\n\n    // Compute a content-based hash value\n    ULONG Hash() const;\n    ULONG HashCaseInsensitive() const;\n\n    // Do a string comparison. Return 0 if the strings\n    // have the same value,  -1 if this is \"less than\" s, or 1 if\n    // this is \"greater than\" s.\n    int Compare(const SString &s) const;\n    int CompareCaseInsensitive(const SString &s) const; // invariant locale\n\n    // Do a case sensitive string comparison. Return TRUE if the strings\n    // have the same value FALSE if not.\n    BOOL Equals(const SString &s) const;\n    BOOL EqualsCaseInsensitive(const SString &s) const; // invariant locale\n\n    // Match s to a portion of the string starting at the position.\n    // Return TRUE if the strings have the same value\n    // (regardless of representation), FALSE if not.\n    BOOL Match(const CIterator &i, const SString &s) const;\n    BOOL MatchCaseInsensitive(const CIterator &i, const SString &s) const; // invariant locale\n\n    BOOL Match(const CIterator &i, WCHAR c) const;\n    BOOL MatchCaseInsensitive(const CIterator &i, WCHAR c) const; // invariant locale\n\n    // Like match, but advances the iterator past the match\n    // if successful\n    BOOL Skip(CIterator &i, const SString &s) const;\n    BOOL Skip(CIterator &i, WCHAR c) const;\n\n    // Start searching for a match of the given string, starting at\n    // the given iterator point.\n    // If a match exists, move the iterator to point to the nearest\n    // occurrence of s in the string and return TRUE.\n    // If no match exists, return FALSE and leave the iterator unchanged.\n    BOOL Find(CIterator &i, const SString &s) const;\n    BOOL Find(CIterator &i, const WCHAR *s) const;\n    BOOL FindASCII(CIterator &i, const ASCII *s) const;\n    BOOL FindUTF8(CIterator &i, const UTF8 *s) const;\n    BOOL Find(CIterator &i, WCHAR c) const;\n\n    BOOL FindBack(CIterator &i, const SString &s) const;\n    BOOL FindBack(CIterator &i, const WCHAR *s) const;\n    BOOL FindBackASCII(CIterator &i, const ASCII *s) const;\n    BOOL FindBackUTF8(CIterator &i, const UTF8 *s) const;\n    BOOL FindBack(CIterator &i, WCHAR c) const;\n\n    // Returns TRUE if this string begins with the contents of s\n    BOOL BeginsWith(const SString &s) const;\n    BOOL BeginsWithCaseInsensitive(const SString &s) const; // invariant locale\n\n    // Returns TRUE if this string ends with the contents of s\n    BOOL EndsWith(const SString &s) const;\n    BOOL EndsWithCaseInsensitive(const SString &s) const; // invariant locale\n\n    // Sets this string to an empty string \"\".\n    void Clear();\n\n    // Truncate the string to the iterator position\n    void Truncate(const Iterator &i);\n\n    // Append s to the end of this string.\n    void Append(const SString &s);\n    void Append(const WCHAR *s);\n    void AppendASCII(const CHAR *s);\n    void AppendUTF8(const CHAR *s);\n\n    // Append char c to the end of this string.\n    void Append(const WCHAR c);\n    void AppendUTF8(const CHAR c);\n\n    // Insert s into this string at the 'position'th character.\n    void Insert(const Iterator &i, const SString &s);\n    void Insert(const Iterator &i, const WCHAR *s);\n    void InsertASCII(const Iterator &i, const CHAR *s);\n    void InsertUTF8(const Iterator &i, const CHAR *s);\n\n    // Delete substring position + length\n    void Delete(const Iterator &i, COUNT_T length);\n\n    // Replace character at i with c\n    void Replace(const Iterator &i, WCHAR c);\n\n    // Replace substring at (i,i+length) with s\n    void Replace(const Iterator &i, COUNT_T length, const SString &s);\n\n    // Make sure that string buffer has room to grow\n    void Preallocate(COUNT_T characters) const;\n\n    // Shrink buffer size as much as possible (reallocate if necessary.)\n    void Trim() const;\n\n    // ------------------------------------------------------------------\n    // Iterators:\n    // ------------------------------------------------------------------\n\n    // SString splits iterators into two categories.\n    //\n    // CIterator and Iterator are cheap to create, but allow only read-only\n    // access to the string.\n    //\n    // For CIterator & Iterator, we try our best to iterate the string without\n    // modifying it. (Currently, we do require an ASCII or Unicode string\n    // for simple WCHAR retrieval, but you could imagine being more flexible\n    // going forward - perhaps even supporting iterating multibyte encodings\n    // directly.)\n    //\n    // Because of the runtime-changable nature of the string, CIterators\n    // require an extra member to record the character size. They also\n    // are unable to properly implement GetAt as required by the template\n    // (since there may not be a direct WCHAR pointer), so they provide\n    // further customization in a subclass.\n    //\n    // Normally the user expects to cast Iterators to CIterators transparently, so\n    // we provide a constructor on CIterator to support this.\n\n protected:\n\n    class EMPTY_BASES_DECL Index : public SBuffer::Index\n    {\n        friend class SString;\n\n        friend class Indexer<const WCHAR, CIterator>;\n        friend class Indexer<WCHAR, Iterator>;\n\n      protected:\n        int               m_characterSizeShift;\n\n        Index();\n        Index(SString *string, SCOUNT_T index);\n        BYTE &GetAt(SCOUNT_T delta) const;\n        void Skip(SCOUNT_T delta);\n        SCOUNT_T Subtract(const Index &i) const;\n        CHECK DoCheck(SCOUNT_T delta) const;\n\n        void Resync(const SString *string, BYTE *ptr) const;\n\n        const WCHAR *GetUnicode() const;\n        const CHAR *GetASCII() const;\n\n      public:\n        // Note these should supersede the Indexer versions\n        // since this class comes first in the inheritance list\n        WCHAR operator*() const;\n        void operator->() const;\n        WCHAR operator[](int index) const;\n    };\n\n public:\n\n    class EMPTY_BASES_DECL CIterator : public Index, public Indexer<const WCHAR, CIterator>\n    {\n        friend class SString;\n\n      public:\n        const Iterator &ConstCast() const\n        {\n            return *(const Iterator *)this;\n        }\n\n        Iterator &ConstCast()\n        {\n            return *(Iterator *)this;\n        }\n\n        operator const SBuffer::CIterator &() const\n        {\n            return *(const SBuffer::CIterator *)this;\n        }\n\n        operator SBuffer::CIterator &()\n        {\n            return *(SBuffer::CIterator *)this;\n        }\n\n        CIterator()\n        {\n        }\n\n        CIterator(const SString *string, int index)\n          : Index(const_cast<SString *>(string), index)\n        {\n        }\n\n        // explicitly resolve these for gcc\n        WCHAR operator*() const { return Index::operator*(); }\n        void operator->() const { Index::operator->(); }\n        WCHAR operator[](int index) const { return Index::operator[](index); }\n    };\n\n    class EMPTY_BASES_DECL Iterator : public Index, public Indexer<WCHAR, Iterator>\n    {\n        friend class SString;\n\n      public:\n        operator const CIterator &() const\n        {\n            return *(const CIterator *)this;\n        }\n\n        operator CIterator &()\n        {\n            return *(CIterator *)this;\n        }\n\n        operator const SBuffer::Iterator &() const\n        {\n            return *(const SBuffer::Iterator *)this;\n        }\n\n        operator SBuffer::Iterator &()\n        {\n            return *(SBuffer::Iterator *)this;\n        }\n\n        Iterator()\n        {\n        }\n\n        Iterator(SString *string, int index)\n          : Index(string, index)\n        {\n            SUPPORTS_DAC;\n        }\n\n        // explicitly resolve these for gcc\n        WCHAR operator*() const { return Index::operator*(); }\n        void operator->() const { Index::operator->(); }\n        WCHAR operator[](int index) const { return Index::operator[](index); }\n    };\n\n    CIterator Begin() const;\n    CIterator End() const;\n\n    Iterator Begin();\n    Iterator End();\n\n    // ------------------------------------------------------------------\n    // Conversion:\n    // ------------------------------------------------------------------\n\n    // Get a const pointer to the string in the current representation.\n    // This pointer can not be cached because it will become invalid if\n    // the SString changes representation or reallocates its buffer.\n\n    // You can always get a unicode string.  This will force a conversion\n    // if necessary.\n    const WCHAR *GetUnicode() const;\n    const WCHAR *GetUnicode(const CIterator &i) const;\n\n    void LowerCase();\n    void UpperCase();\n\n    // Helper function to convert string in-place to lower-case (no allocation overhead for SString instance)\n    static void LowerCase(__inout_z LPWSTR wszString);\n\n    // You can always get a UTF8 string.  This will force a conversion\n    // if necessary.\n    const UTF8 *GetUTF8() const;\n\n    // Converts/copies into the given output string\n    void ConvertToUnicode(SString &dest) const;\n    COUNT_T ConvertToUTF8(SString &dest) const;\n\n    //-------------------------------------------------------------------\n    // Accessing the string contents directly\n    //-------------------------------------------------------------------\n\n    // To write directly to the SString's underlying buffer:\n    // 1) Call OpenXXXBuffer() and pass it the count of characters\n    // you need. (Not including the null-terminator).\n    // 2) That returns a pointer to the raw buffer which you can write to.\n    // 3) When you are done writing to the pointer, call CloseBuffer()\n    // and pass it the count of characters you actually wrote (not including\n    // the null). The pointer from step 1 is now invalid.\n\n    // example usage:\n    // void GetName(SString & str) {\n    //      char * p = str.OpenUTF8Buffer(3);\n    //      strcpy(p, \"Cat\");\n    //      str.CloseBuffer();\n    // }\n\n    // Regarding the null-terminator:\n    // 1) Note that we wrote 4 characters (3 + a null). That's ok. OpenBuffer\n    // allocates 1 extra byte for the null.\n    // 2) If we only wrote 3 characters and no null, that's ok too. CloseBuffer()\n    // will add a null-terminator.\n\n    // You should open the buffer, write the data, and immediately close it.\n    // No sstring operations are valid while the buffer is opened.\n    //\n    // In a debug build, Open/Close will do lots of little checks to make sure\n    // you don't buffer overflow while it's opened. In a retail build, this\n    // is a very streamlined action.\n\n\n    // Open the raw buffer for writing countChars characters (not including the null).\n    WCHAR *OpenUnicodeBuffer(COUNT_T maxCharCount);\n    UTF8 *OpenUTF8Buffer(COUNT_T maxSingleCharCount);\n\n    //Returns the unicode string, the caller is responsible for lifetime of the string\n    WCHAR *GetCopyOfUnicodeString();\n\n    // Get the max size that can be passed to OpenUnicodeBuffer without causing allocations.\n    COUNT_T GetUnicodeAllocation();\n\n    // Call after OpenXXXBuffer().\n\n    // Provide the count of characters actually used (not including the\n    // null terminator). This will make sure the SString's size is correct\n    // and that we have a null-terminator.\n    void CloseBuffer(COUNT_T finalCount);\n\n    // Close the buffer. Assumes that we completely filled the buffer\n    // that OpenBuffer() gave back. If we didn't write all the characters,\n    // call CloseBuffer(int) instead.\n    void CloseBuffer();\n\n#ifdef DACCESS_COMPILE\n    // DAC access to string functions.\n    // Note that other accessors above are not DAC-safe and will return TARGET pointers into\n    // the string instead of copying the string over to the host.\n    // @dbgtodo  dac support: Prevent usage of such DAC-unsafe SString APIs in DAC code\n\n    // Instantiate a copy of the raw buffer in the host and return a pointer to it\n    void * DacGetRawContent() const;\n\n    // Instantiate a copy of the raw buffer in the host.  Requires that the underlying\n    // representation is already unicode.\n    const WCHAR * DacGetRawUnicode() const;\n\n    // Copy the string from the target into the provided buffer, converting to unicode if necessary\n    bool DacGetUnicode(COUNT_T                                  bufChars,\n                       _Inout_updates_z_(bufChars) WCHAR * buffer,\n                       COUNT_T *                                needChars) const;\n\n    void EnumMemoryRegions(CLRDataEnumMemoryFlags flags) const\n    {\n        SUPPORTS_DAC;\n        SBuffer::EnumMemoryRegions(flags);\n    }\n#endif\n\n    //---------------------------------------------------------------------\n    // Utilities\n    //---------------------------------------------------------------------\n\n    // WARNING: The MBCS version of printf function are factory for globalization\n    // issues when used to format Unicode strings (%S). The Unicode versions are\n    // preferred in this case.\n    void Printf(const CHAR *format, ...);\n    void VPrintf(const CHAR *format, va_list args);\n    void AppendPrintf(const CHAR *format, ...);\n    void AppendVPrintf(const CHAR *format, va_list args);\n\npublic:\n    BOOL LoadResource(CCompRC::ResourceCategory eCategory, int resourceID);\n    HRESULT LoadResourceAndReturnHR(CCompRC::ResourceCategory eCategory, int resourceID);\n    HRESULT LoadResourceAndReturnHR(CCompRC* pResourceDLL, CCompRC::ResourceCategory eCategory, int resourceID);\n    BOOL FormatMessage(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId,\n                       const SString &arg1 = Empty(), const SString &arg2 = Empty(),\n                       const SString &arg3 = Empty(), const SString &arg4 = Empty(),\n                       const SString &arg5 = Empty(), const SString &arg6 = Empty(),\n                       const SString &arg7 = Empty(), const SString &arg8 = Empty(),\n                       const SString &arg9 = Empty(), const SString &arg10 = Empty());\n\n#if 1\n    // @todo - get rid of this and move it outside of SString\n    void MakeFullNamespacePath(const SString &nameSpace, const SString &name);\n#endif\n\n    //--------------------------------------------------------------------\n    // Operators\n    //--------------------------------------------------------------------\n\n    operator const WCHAR * () const { WRAPPER_NO_CONTRACT; return GetUnicode(); }\n\n    WCHAR operator[](int index) { WRAPPER_NO_CONTRACT; return Begin()[index]; }\n    WCHAR operator[](int index) const { WRAPPER_NO_CONTRACT; return Begin()[index]; }\n\n    SString &operator= (const SString &s) { WRAPPER_NO_CONTRACT; Set(s); return *this; }\n    SString &operator+= (const SString &s) { WRAPPER_NO_CONTRACT; Append(s); return *this; }\n\n    // -------------------------------------------------------------------\n    // Check functions\n    // -------------------------------------------------------------------\n\n    CHECK CheckIteratorRange(const CIterator &i) const;\n    CHECK CheckIteratorRange(const CIterator &i, COUNT_T length) const;\n    CHECK CheckEmpty() const;\n\n    static CHECK CheckCount(COUNT_T count);\n    static CHECK CheckRepresentation(int representation);\n\n#if CHECK_INVARIANTS\n    static CHECK CheckASCIIString(const ASCII *string);\n    static CHECK CheckASCIIString(const ASCII *string, COUNT_T count);\n\n    CHECK Check() const;\n    CHECK Invariant() const;\n    CHECK InternalInvariant() const;\n#endif  // CHECK_INVARIANTS\n\n    // Helpers for CRT function equivalance.\n    static int __cdecl _stricmp(const CHAR *buffer1, const CHAR *buffer2);\n    static int __cdecl _strnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count);\n\n    static int __cdecl _wcsicmp(const WCHAR *buffer1, const WCHAR *buffer2);\n    static int __cdecl _wcsnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count);\n\n    // C++ convenience overloads\n    static int _tstricmp(const CHAR *buffer1, const CHAR *buffer2);\n    static int _tstricmp(const WCHAR *buffer1, const WCHAR *buffer2);\n\n    static int _tstrnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count);\n    static int _tstrnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count);\n\n    // -------------------------------------------------------------------\n    // Internal routines\n    // -------------------------------------------------------------------\n\n\n protected:\n    // Use this via InlineSString<X>\n    SString(void *buffer, COUNT_T size);\n\n private:\n    static int CaseCompareHelperA(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count, BOOL stopOnNull, BOOL stopOnCount);\n    static int CaseCompareHelper(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count, BOOL stopOnNull, BOOL stopOnCount);\n\n    // Internal helpers:\n\n    static const BYTE s_EmptyBuffer[2];\n\n    static UINT s_ACP;\n\n    SPTR_DECL(SString,s_Empty);\n\n    COUNT_T GetRawCount() const;\n\n    // Get buffer as appropriate string rep\n    ASCII *GetRawASCII() const;\n    UTF8 *GetRawUTF8() const;\n    ANSI *GetRawANSI() const;\n    WCHAR *GetRawUnicode() const;\n\n    void InitEmpty();\n\n    Representation GetRepresentation() const;\n    void SetRepresentation(Representation representation);\n    BOOL IsRepresentation(Representation representation) const;\n    BOOL IsFixedSize() const;\n    BOOL IsIteratable() const;\n    BOOL IsSingleByte() const;\n\n    int GetCharacterSizeShift() const;\n\n    COUNT_T SizeToCount(COUNT_T size) const;\n    COUNT_T CountToSize(COUNT_T count) const;\n\n    COUNT_T GetBufferSizeInCharIncludeNullChar() const;\n\n    BOOL IsLiteral() const;\n    BOOL IsAllocated() const;\n    BOOL IsBufferOpen() const;\n    BOOL IsASCIIScanned() const;\n    void SetASCIIScanned() const;\n    void SetNormalized() const;\n    BOOL IsNormalized() const;\n    void ClearNormalized() const;\n\n    void EnsureWritable() const;\n    void ConvertToFixed() const;\n    void ConvertToIteratable() const;\n\n    void ConvertASCIIToUnicode(SString &dest) const;\n    void ConvertToUnicode() const;\n    void ConvertToUnicode(const CIterator &i) const;\n    void ConvertToUTF8() const;\n\n    const SString &GetCompatibleString(const SString &s, SString &scratch) const;\n    const SString &GetCompatibleString(const SString &s, SString &scratch, const CIterator &i) const;\n    BOOL ScanASCII() const;\n    void NullTerminate();\n\n    void Resize(COUNT_T count, Representation representation,\n                Preserve preserve = DONT_PRESERVE);\n\n    void OpenBuffer(Representation representation, COUNT_T countChars);\n};\n\n// ===========================================================================\n// InlineSString is used for stack allocation of strings, or when the string contents\n// are expected or known to be small.  Note that it still supports expandability via\n// heap allocation if necessary.\n// ===========================================================================\n\ntemplate <COUNT_T MEMSIZE>\nclass EMPTY_BASES_DECL InlineSString : public SString\n{\nprivate:\n    DAC_ALIGNAS(SString)\n    BYTE m_inline[SBUFFER_PADDED_SIZE(MEMSIZE)];\n\npublic:\n    FORCEINLINE InlineSString()\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n    }\n\n    FORCEINLINE InlineSString(const SString &s)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s);\n    }\n\n    FORCEINLINE InlineSString(const SString &s1, const SString &s2)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s1, s2);\n    }\n\n    FORCEINLINE InlineSString(const SString &s1, const SString &s2, const SString &s3)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s1, s2, s3);\n    }\n\n    FORCEINLINE InlineSString(const SString &s1, const SString &s2, const SString &s3, const SString &s4)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s1, s2, s3, s4);\n    }\n\n    FORCEINLINE InlineSString(const SString &s, const CIterator &start, const CIterator &end)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s, start, end);\n    }\n\n    FORCEINLINE InlineSString(const SString &s, const CIterator &i, COUNT_T length)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s, i, length);\n    }\n\n    FORCEINLINE InlineSString(const WCHAR *string)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(string);\n    }\n\n    FORCEINLINE InlineSString(const WCHAR *string, COUNT_T count)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(string, count);\n    }\n\n    FORCEINLINE InlineSString(enum tagASCII, const CHAR *string)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        SetASCII(string);\n    }\n\n    FORCEINLINE InlineSString(enum tagASCII, const CHAR *string, COUNT_T count)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        SetASCII(string, count);\n    }\n\n    FORCEINLINE InlineSString(tagUTF8 dummytag, const UTF8 *string)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        SetUTF8(string);\n    }\n\n    FORCEINLINE InlineSString(tagUTF8 dummytag, const UTF8 *string, COUNT_T count)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        SetUTF8(string, count);\n    }\n\n    FORCEINLINE InlineSString(WCHAR character)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(character);\n    }\n\n    FORCEINLINE InlineSString(tagUTF8 dummytag, const UTF8 character)\n      : SString(m_inline, SBUFFER_PADDED_SIZE(MEMSIZE))\n    {\n        WRAPPER_NO_CONTRACT;\n        SetUTF8(character);\n    }\n\n    FORCEINLINE InlineSString<MEMSIZE> &operator= (const SString &s)\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s);\n        return *this;\n    }\n\n    FORCEINLINE InlineSString<MEMSIZE> &operator= (const InlineSString<MEMSIZE> &s)\n    {\n        WRAPPER_NO_CONTRACT;\n        Set(s);\n        return *this;\n    }\n};\n\n// ================================================================================\n// StackSString is a lot like CQuickBytes.  Use it to create an SString object\n// using some stack space as a preallocated buffer.\n// ================================================================================\n\ntypedef InlineSString<512> StackSString;\n\n// This is a smaller version for when it is known that the string that's going to\n// be needed is small and it's preferable not to take up the stack space.\ntypedef InlineSString<32>  SmallStackSString;\n\n// To be used specifically for path strings.\n#ifdef _DEBUG\n// This is a smaller version for debug builds to exercise the buffer allocation path\ntypedef InlineSString<32> PathString;\ntypedef InlineSString<2 * 32> LongPathString;\n#else\n// Set it to the current MAX_PATH\ntypedef InlineSString<260> PathString;\ntypedef InlineSString<2 * 260> LongPathString;\n#endif\n\n// ================================================================================\n// Quick macro to create an SString around a literal string.\n// usage:\n//        s = SL(\"My literal String\");\n// ================================================================================\n\n#define SL(_literal) SString(SString::Literal, _literal)\n\n// ================================================================================\n// Special contract definition - THROWS_UNLESS_NORMALIZED\n// this is used for operations which might fail for generalized strings but\n// not if the string has already been converted to unicode.  Rather than just\n// setting this on all conversions to unicode, we only set it when explicitly\n// asked.  This should expose more potential problems.\n// ================================================================================\n\n#define THROWS_UNLESS_NORMALIZED \\\n    if (IsNormalized()) NOTHROW; else THROWS\n\n#define THROWS_UNLESS_BOTH_NORMALIZED(s) \\\n    if (IsNormalized() && s.IsNormalized()) NOTHROW; else THROWS\n\n#define FAULTS_UNLESS_NORMALIZED(stmt) \\\n    if (IsNormalized()) FORBID_FAULT; else INJECT_FAULT(stmt)\n\n#define FAULTS_UNLESS_BOTH_NORMALIZED(s, stmt) \\\n    if (IsNormalized() && s.IsNormalized()) FORBID_FAULT; else INJECT_FAULT(stmt)\n\n// ================================================================================\n// Inline definitions\n// ================================================================================\n\n#include <sstring.inl>\n\n#endif  // _SSTRING_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/sstring.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n\n#ifndef _SSTRING_INL_\n#define _SSTRING_INL_\n\n#include \"sstring.h\"\n\n#if defined(_MSC_VER)\n#pragma inline_depth (20)\n#endif\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable:4702) // Disable bogus unreachable code warning\n#endif // _MSC_VER\n\n//#define SSTRING_EXTRA_CHECKS\n#ifdef SSTRING_EXTRA_CHECKS\n#define SS_CONTRACT CONTRACT\n#define SS_CONTRACT_VOID CONTRACT_VOID\n#define SS_CONTRACT_END CONTRACT_END\n#define SS_RETURN RETURN\n#define SS_CONSTRUCTOR_CHECK CONSTRUCTOR_CHECK\n#define SS_PRECONDITION PRECONDITION\n#define SS_POSTCONDITION POSTCONDITION\n\n#else //SSTRING_EXTRA_CHECKS\n\n#define SS_CONTRACT(x) CONTRACTL\n#define SS_CONTRACT_VOID CONTRACTL\n#define SS_CONTRACT_END CONTRACTL_END\n#define SS_RETURN return\n#define SS_CONSTRUCTOR_CHECK\n#define SS_PRECONDITION(x)\n#define SS_POSTCONDITION(x)\n//Do I need this instance check at all?\n\n#endif\n\n\n// ---------------------------------------------------------------------------\n// Inline implementations. Pay no attention to that man behind the curtain.\n// ---------------------------------------------------------------------------\n\n//----------------------------------------------------------------------------\n// Default constructor. Sets the string to the empty string.\n//----------------------------------------------------------------------------\ninline SString::SString()\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n#ifdef SSTRING_EXTRA_CHECKS\n    CONTRACT_VOID\n    {\n        CONSTRUCTOR_CHECK;\n        POSTCONDITION(IsEmpty());\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n\n    RETURN;\n#else\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;\n#endif\n}\n\ninline SString::SString(void *buffer, COUNT_T size)\n  : SBuffer(Prealloc, buffer, size)\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(buffer));\n        PRECONDITION(CheckSize(size));\n        SS_POSTCONDITION(IsEmpty());\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    SS_CONTRACT_END;\n\n    if (size < sizeof(WCHAR))\n    {\n        // Ignore the useless buffer\n        SetImmutable(s_EmptyBuffer, sizeof(s_EmptyBuffer));\n    }\n    else\n    {\n        SBuffer::TweakSize(sizeof(WCHAR));\n        GetRawUnicode()[0] = 0;\n    }\n\n    SS_RETURN;\n}\n\ninline SString::SString(const SString &s)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(s.Check());\n        SS_POSTCONDITION(Equals(s));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(s);\n\n    SS_RETURN;\n}\n\ninline SString::SString(const SString &s1, const SString &s2)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(s1.Check());\n        PRECONDITION(s2.Check());\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(s1, s2);\n\n    SS_RETURN;\n}\n\ninline SString::SString(const SString &s1, const SString &s2, const SString &s3)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(s1.Check());\n        PRECONDITION(s2.Check());\n        PRECONDITION(s3.Check());\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(s1, s2, s3);\n\n    SS_RETURN;\n}\n\ninline SString::SString(const SString &s1, const SString &s2, const SString &s3, const SString &s4)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(s1.Check());\n        PRECONDITION(s2.Check());\n        PRECONDITION(s3.Check());\n        PRECONDITION(s4.Check());\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    Set(s1, s2, s3, s4);\n\n    SS_RETURN;\n}\n\ninline SString::SString(const SString &s, const CIterator &i, COUNT_T count)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(s.Check());\n        PRECONDITION(i.Check());\n        PRECONDITION(CheckCount(count));\n        SS_POSTCONDITION(s.Match(i, *this));\n        SS_POSTCONDITION(GetRawCount() == count);\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(s, i, count);\n\n    SS_RETURN;\n}\n\ninline SString::SString(const SString &s, const CIterator &start, const CIterator &end)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(s.Check());\n        PRECONDITION(start.Check());\n        PRECONDITION(s.CheckIteratorRange(start));\n        PRECONDITION(end.Check());\n        PRECONDITION(s.CheckIteratorRange(end));\n        PRECONDITION(start <= end);\n        SS_POSTCONDITION(s.Match(start, *this));\n        SS_POSTCONDITION(GetRawCount() == (COUNT_T) (end - start));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(s, start, end);\n\n    SS_RETURN;\n}\n\ninline SString::SString(const WCHAR *string)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(string, NULL_OK));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(string);\n\n    SS_RETURN;\n}\n\ninline SString::SString(const WCHAR *string, COUNT_T count)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(string, NULL_OK));\n        PRECONDITION(CheckCount(count));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(string, count);\n\n    SS_RETURN;\n}\n\ninline SString::SString(enum tagASCII, const ASCII *string)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(string, NULL_OK));\n        PRECONDITION(CheckASCIIString(string));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    SetASCII(string);\n\n    SS_RETURN;\n}\n\ninline SString::SString(enum tagASCII, const ASCII *string, COUNT_T count)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(string, NULL_OK));\n        PRECONDITION(CheckASCIIString(string, count));\n        PRECONDITION(CheckCount(count));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    SetASCII(string, count);\n\n    SS_RETURN;\n}\n\ninline SString::SString(tagUTF8 dummytag, const UTF8 *string)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        // !!! Check for illegal UTF8 encoding?\n        PRECONDITION(CheckPointer(string, NULL_OK));\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    SetUTF8(string);\n\n    SS_RETURN;\n}\n\ninline SString::SString(tagUTF8 dummytag, const UTF8 *string, COUNT_T count)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        // !!! Check for illegal UTF8 encoding?\n        PRECONDITION(CheckPointer(string, NULL_OK));\n        PRECONDITION(CheckCount(count));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    SetUTF8(string, count);\n\n    SS_RETURN;\n}\n\ninline SString::SString(WCHAR character)\n  : SBuffer(Immutable, s_EmptyBuffer, sizeof(s_EmptyBuffer))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(character);\n\n    SS_RETURN;\n}\n\ninline SString::SString(tagLiteral dummytag, const ASCII *literal)\n  : SBuffer(Immutable, (const BYTE *) literal, (COUNT_T) (strlen(literal)+1)*sizeof(CHAR))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(literal));\n        PRECONDITION(CheckASCIIString(literal));\n        NOTHROW;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    SS_CONTRACT_END;\n\n    SetRepresentation(REPRESENTATION_ASCII);\n\n    SS_RETURN;\n}\n\ninline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal)\n  : SBuffer(Immutable, (const BYTE *) literal, (COUNT_T) (strlen(literal)+1)*sizeof(CHAR))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(literal));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    SetRepresentation(REPRESENTATION_UTF8);\n\n    SS_RETURN;\n}\n\ninline SString::SString(tagLiteral dummytag, const WCHAR *literal)\n  : SBuffer(Immutable, (const BYTE *) literal, (COUNT_T) (wcslen(literal)+1)*sizeof(WCHAR))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(literal));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    SetRepresentation(REPRESENTATION_UNICODE);\n    SetNormalized();\n\n    SS_RETURN;\n}\n\ninline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count)\n  : SBuffer(Immutable, (const BYTE *) literal, (count + 1) * sizeof(WCHAR))\n{\n    SS_CONTRACT_VOID\n    {\n        SS_CONSTRUCTOR_CHECK;\n        PRECONDITION(CheckPointer(literal));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    SetRepresentation(REPRESENTATION_UNICODE);\n    SetNormalized();\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Set this string to s\n// s - source string\n//-----------------------------------------------------------------------------\ninline void SString::Set(const SString &s)\n{\n    SS_CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(s.Check());\n        SS_POSTCONDITION(Equals(s));\n        THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    SBuffer::Set(s);\n    SetRepresentation(s.GetRepresentation());\n    ClearNormalized();\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Set this string to concatenation of s1 and s2\n//-----------------------------------------------------------------------------\ninline void SString::Set(const SString &s1, const SString &s2)\n{\n    SS_CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(s1.Check());\n        PRECONDITION(s2.Check());\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Preallocate(s1.GetCount() + s2.GetCount());\n\n    Set(s1);\n    Append(s2);\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Set this string to concatenation of s1, s2, and s3\n//-----------------------------------------------------------------------------\ninline void SString::Set(const SString &s1, const SString &s2, const SString &s3)\n{\n    SS_CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(s1.Check());\n        PRECONDITION(s2.Check());\n        PRECONDITION(s3.Check());\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Preallocate(s1.GetCount() + s2.GetCount() + s3.GetCount());\n\n    Set(s1);\n    Append(s2);\n    Append(s3);\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Set this string to concatenation of s1, s2, s3, and s4\n//-----------------------------------------------------------------------------\ninline void SString::Set(const SString &s1, const SString &s2, const SString &s3, const SString &s4)\n{\n    SS_CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(s1.Check());\n        PRECONDITION(s2.Check());\n        PRECONDITION(s3.Check());\n        PRECONDITION(s4.Check());\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Preallocate(s1.GetCount() + s2.GetCount() + s3.GetCount() + s4.GetCount());\n\n    Set(s1);\n    Append(s2);\n    Append(s3);\n    Append(s4);\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Set this string to the substring from s.\n// s - the source string\n// start - the character to start at\n// length - number of characters to copy from s.\n//-----------------------------------------------------------------------------\ninline void SString::Set(const SString &s, const CIterator &i, COUNT_T count)\n{\n    SS_CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(s.Check());\n        PRECONDITION(i.Check());\n        PRECONDITION(CheckCount(count));\n        SS_POSTCONDITION(s.Match(i, *this));\n        SS_POSTCONDITION(GetRawCount() == count);\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    // @todo: detect case where we can reuse literal?\n    Resize(count, s.GetRepresentation());\n    SBuffer::Copy(SBuffer::Begin(), i.m_ptr, count<<i.m_characterSizeShift);\n    NullTerminate();\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Set this string to the substring from s.\n// s - the source string\n// start - the position to start\n// end - the position to end (exclusive)\n//-----------------------------------------------------------------------------\ninline void SString::Set(const SString &s, const CIterator &start, const CIterator &end)\n{\n    SS_CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(s.Check());\n        PRECONDITION(start.Check());\n        PRECONDITION(s.CheckIteratorRange(start));\n        PRECONDITION(end.Check());\n        PRECONDITION(s.CheckIteratorRange(end));\n        PRECONDITION(end >= start);\n        SS_POSTCONDITION(s.Match(start, *this));\n        SS_POSTCONDITION(GetRawCount() == (COUNT_T) (end - start));\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    Set(s, start, end - start);\n\n    SS_RETURN;\n}\n\n// Return a global empty string\ninline const SString &SString::Empty()\n{\n#ifdef SSTRING_EXTRA_CHECKS\n    CONTRACTL\n    {\n        // POSTCONDITION(RETVAL.IsEmpty());\n        PRECONDITION(CheckStartup());\n        NOTHROW;\n        GC_NOTRIGGER;\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    CONTRACTL_END;\n#else\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_CANNOT_TAKE_LOCK;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n#endif\n\n    _ASSERTE(s_Empty != NULL);  // Did you call SString::Startup()?\n    return *s_Empty;\n}\n\n// Get a const pointer to the internal buffer as a unicode string.\ninline const WCHAR *SString::GetUnicode() const\n{\n    SS_CONTRACT(const WCHAR *)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckPointer(RETVAL));\n        if (IsRepresentation(REPRESENTATION_UNICODE)) NOTHROW; else THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToUnicode();\n\n    SS_RETURN GetRawUnicode();\n}\n\n// Get a const pointer to the internal buffer as a UTF8 string.\ninline const UTF8 *SString::GetUTF8() const\n{\n    SS_CONTRACT(const UTF8 *)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckPointer(RETVAL));\n        if (IsRepresentation(REPRESENTATION_UTF8)) NOTHROW; else THROWS;\n        GC_NOTRIGGER;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToUTF8();\n\n    SS_RETURN GetRawUTF8();\n}\n\n// Normalize the string to unicode.  This will make many operations nonfailing.\ninline void SString::Normalize() const\n{\n    SS_CONTRACT_VOID\n    {\n        INSTANCE_CHECK;\n        SS_POSTCONDITION(IsNormalized());\n        THROWS_UNLESS_NORMALIZED;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToUnicode();\n    SetNormalized();\n\n    SS_RETURN;\n}\n\n// Get a const pointer to the internal buffer as a unicode string.\ninline const WCHAR *SString::GetUnicode(const CIterator &i) const\n{\n    SS_CONTRACT(const WCHAR *)\n    {\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i));\n        THROWS_UNLESS_NORMALIZED;\n        GC_NOTRIGGER;\n    }\n    SS_CONTRACT_END;\n\n    PRECONDITION(CheckPointer(this));\n\n    ConvertToUnicode(i);\n\n    SS_RETURN i.GetUnicode();\n}\n\n// Append s to the end of this string.\ninline void SString::Append(const SString &s)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(s.Check());\n        THROWS;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    SS_CONTRACT_END;\n\n    Insert(End(), s);\n\n    SS_RETURN;\n}\n\ninline void SString::Append(const WCHAR *string)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckPointer(string));\n        THROWS;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    SS_CONTRACT_END;\n\n    // Wrap the string in temporary SString without copying it\n    SString s(SString::Literal, string);\n    s.ClearImmutable();\n    Append(s);\n\n    SS_RETURN;\n}\n\ninline void SString::AppendASCII(const CHAR *string)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckPointer(string));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Ascii, string);\n    Append(s);\n\n    SS_RETURN;\n}\n\ninline void SString::AppendUTF8(const CHAR *string)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckPointer(string));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Utf8, string);\n    Append(s);\n\n    SS_RETURN;\n}\n\ninline void SString::Append(const WCHAR c)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    InlineSString<2 * sizeof(c)> s(c);\n    Append(s);\n\n    SS_RETURN;\n}\n\ninline void SString::AppendUTF8(const CHAR c)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        THROWS;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    SS_CONTRACT_END;\n\n    InlineSString<2 * sizeof(c)> s(SString::Utf8, c);\n    Append(s);\n\n    SS_RETURN;\n}\n\n// Turn this on to test that these if you are testing common scenarios dealing with\n// ASCII strings that do not touch the cases where this family of function differs\n// in behavior for expected reasons.\n//#define VERIFY_CRT_EQUIVALNCE 1\n\n// Helpers for CRT function equivalance.\n/* static */\ninline int __cdecl SString::_stricmp(const CHAR *buffer1, const CHAR *buffer2) {\n    WRAPPER_NO_CONTRACT;\n    int returnValue = CaseCompareHelperA(buffer1, buffer2, 0, TRUE, FALSE);\n#ifdef VERIFY_CRT_EQUIVALNCE\n    _ASSERTE((returnValue == 0) == (::_stricmp(buffer1, buffer2) == 0));\n#endif\n    return returnValue;\n\n}\n\n/* static */\ninline int __cdecl SString::_strnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count) {\n    WRAPPER_NO_CONTRACT;\n    int returnValue = CaseCompareHelperA(buffer1, buffer2, count, TRUE, TRUE);\n#ifdef VERIFY_CRT_EQUIVALNCE\n    _ASSERTE((returnValue == 0) == (::_strnicmp(buffer1, buffer2, count) == 0));\n#endif\n    return returnValue;\n}\n\n/* static */\ninline int __cdecl SString::_wcsicmp(const WCHAR *buffer1, const WCHAR *buffer2) {\n    WRAPPER_NO_CONTRACT;\n    int returnValue = CaseCompareHelper(buffer1, buffer2, 0, TRUE, FALSE);\n#ifdef VERIFY_CRT_EQUIVALNCE\n    _ASSERTE((returnValue == 0) == (::_wcsicmp(buffer1, buffer2) == 0));\n#endif\n    return returnValue;\n\n}\n\n/* static */\ninline int __cdecl SString::_wcsnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count) {\n    WRAPPER_NO_CONTRACT;\n    int returnValue = CaseCompareHelper(buffer1, buffer2, count, TRUE, TRUE);\n#ifdef VERIFY_CRT_EQUIVALNCE\n    _ASSERTE((returnValue == 0) == (::_wcsnicmp(buffer1, buffer2, count) == 0));\n#endif\n    return returnValue;\n}\n\ninline int SString::_tstricmp(const CHAR *buffer1, const CHAR *buffer2)\n{\n    return _stricmp(buffer1, buffer2);\n}\n\ninline int SString::_tstricmp(const WCHAR *buffer1, const WCHAR *buffer2)\n{\n    return _wcsicmp(buffer1, buffer2);\n}\n\ninline int SString::_tstrnicmp(const CHAR *buffer1, const CHAR *buffer2, COUNT_T count)\n{\n    return _strnicmp(buffer1, buffer2, count);\n}\n\ninline int SString::_tstrnicmp(const WCHAR *buffer1, const WCHAR *buffer2, COUNT_T count)\n{\n    return _wcsnicmp(buffer1, buffer2, count);\n}\n\ninline BOOL SString::Match(const CIterator &i, WCHAR c) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i));\n        NOTHROW;\n    }\n    SS_CONTRACT_END;\n\n    // End() will not throw here\n    CONTRACT_VIOLATION(ThrowsViolation);\n    SS_RETURN (i < End() && i[0] == c);\n}\n\ninline BOOL SString::Skip(CIterator &i, const SString &s) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(s.Check());\n        THROWS_UNLESS_BOTH_NORMALIZED(s);\n    }\n    SS_CONTRACT_END;\n\n    if (Match(i, s))\n    {\n        i += s.GetRawCount();\n        SS_RETURN TRUE;\n    }\n    else\n        SS_RETURN FALSE;\n}\n\ninline BOOL SString::Skip(CIterator &i, WCHAR c) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        INSTANCE_CHECK;\n        PRECONDITION(CheckIteratorRange(i));\n        NOTHROW;\n    }\n    SS_CONTRACT_END;\n\n    if (Match(i, c))\n    {\n        i++;\n        SS_RETURN TRUE;\n    }\n    else\n        SS_RETURN FALSE;\n}\n\n// Find string within this string. Return TRUE and update iterator if found\ninline BOOL SString::Find(CIterator &i, const WCHAR *string) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        SS_POSTCONDITION(RETVAL == Match(i, SString(string)));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(string);\n    SS_RETURN Find(i, s);\n}\n\ninline BOOL SString::FindASCII(CIterator &i, const CHAR *string) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        SS_POSTCONDITION(RETVAL == Match(i, SString(SString::Ascii, string)));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Ascii, string);\n    SS_RETURN Find(i, s);\n}\n\ninline BOOL SString::FindUTF8(CIterator &i, const CHAR *string) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        SS_POSTCONDITION(RETVAL == Match(i, SString(SString::Ascii, string)));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Utf8, string);\n    SS_RETURN Find(i, s);\n}\n\ninline BOOL SString::FindBack(CIterator &i, const WCHAR *string) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        SS_POSTCONDITION(RETVAL == Match(i, SString(string)));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(string);\n    SS_RETURN FindBack(i, s);\n}\n\ninline BOOL SString::FindBackASCII(CIterator &i, const CHAR *string) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        SS_POSTCONDITION(RETVAL == Match(i, SString(SString::Ascii, string)));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Ascii, string);\n    SS_RETURN FindBack(i, s);\n}\n\ninline BOOL SString::FindBackUTF8(CIterator &i, const CHAR *string) const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        SS_POSTCONDITION(RETVAL == Match(i, SString(SString::Ascii, string)));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Utf8, string);\n    SS_RETURN FindBack(i, s);\n}\n\n// Insert string at iterator position\ninline void SString::Insert(const Iterator &i, const SString &s)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(s.Check());\n        THROWS;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    SS_CONTRACT_END;\n\n    Replace(i, 0, s);\n\n    SS_RETURN;\n}\n\ninline void SString::Insert(const Iterator &i, const WCHAR *string)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(string);\n    Replace(i, 0, s);\n\n    SS_RETURN;\n}\n\ninline void SString::InsertASCII(const Iterator &i, const CHAR *string)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Ascii, string);\n    Replace(i, 0, s);\n\n    SS_RETURN;\n}\n\ninline void SString::InsertUTF8(const Iterator &i, const CHAR *string)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i));\n        PRECONDITION(CheckPointer(string));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    StackSString s(SString::Utf8, string);\n    Replace(i, 0, s);\n\n    SS_RETURN;\n}\n\n// Delete string at iterator position\ninline void SString::Delete(const Iterator &i, COUNT_T length)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckIteratorRange(i, length));\n        THROWS;\n        SUPPORTS_DAC_HOST_ONLY;\n    }\n    SS_CONTRACT_END;\n\n    Replace(i, length, Empty());\n\n    SS_RETURN;\n}\n\n// Preallocate some space for the string buffer\ninline void SString::Preallocate(COUNT_T characters) const\n{\n    WRAPPER_NO_CONTRACT;\n\n    // Assume unicode since we may get converted\n    SBuffer::Preallocate(characters * sizeof(WCHAR));\n}\n\n// Trim unused space from the buffer\ninline void SString::Trim() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    if (GetRawCount() == 0)\n    {\n        // Share the global empty string buffer.\n        const_cast<SString *>(this)->SBuffer::SetImmutable(s_EmptyBuffer, sizeof(s_EmptyBuffer));\n    }\n    else\n    {\n        SBuffer::Trim();\n    }\n}\n\n// RETURN true if the string is empty.\ninline BOOL SString::IsEmpty() const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        NOTHROW;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    SS_RETURN (GetRawCount() == 0);\n}\n\n// RETURN true if the string rep is ASCII.\ninline BOOL SString::IsASCII() const\n{\n    SS_CONTRACT(BOOL)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        NOTHROW;\n    }\n    SS_CONTRACT_END;\n\n    SS_RETURN IsRepresentation(REPRESENTATION_ASCII);\n}\n\n// Get the number of characters in the string (excluding the terminating NULL)\ninline COUNT_T SString::GetCount() const\n{\n    SS_CONTRACT(COUNT_T)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckCount(RETVAL));\n        THROWS_UNLESS_NORMALIZED;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToFixed();\n\n    SS_RETURN SizeToCount(GetSize());\n}\n\n// Private helpers:\n// Return the current size of the string (even if it is multibyte)\ninline COUNT_T SString::GetRawCount() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    return SizeToCount(GetSize());\n}\n\n// Private helpers:\n// get string contents as a particular character set:\n\ninline ASCII *SString::GetRawASCII() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (ASCII *) m_buffer;\n}\n\ninline UTF8 *SString::GetRawUTF8() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (UTF8 *) m_buffer;\n}\n\ninline ANSI *SString::GetRawANSI() const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (ANSI *) m_buffer;\n}\n\ninline WCHAR *SString::GetRawUnicode() const\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    return (WCHAR *)m_buffer;\n}\n\n// Private helper:\n// get the representation (ansi, unicode, utf8)\ninline SString::Representation SString::GetRepresentation() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    return (Representation) SBuffer::GetRepresentationField();\n}\n\n// Private helper.\n// Set the representation.\ninline void SString::SetRepresentation(SString::Representation representation)\n{\n#ifdef SSTRING_EXTRA_CHECKS\n    CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        NOTHROW;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckRepresentation(representation));\n        POSTCONDITION(GetRepresentation() == representation);\n    }\n    CONTRACT_END;\n#else //SSTRING_EXTRA_CHECKS\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;\n#endif //SSTRING_EXTRA_CHECKS\n\n    SBuffer::SetRepresentationField((int) representation);\n\n    SS_RETURN;\n}\n\n// Private helper:\n// Get the amount to shift the byte size to get a character count\ninline int SString::GetCharacterSizeShift() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    // Note that the flag is backwards; we want the default\n    // value to match the default representation (empty)\n    return (GetRepresentation()&REPRESENTATION_SINGLE_MASK) == 0;\n}\n\n//----------------------------------------------------------------------------\n// Private helper.\n// We know the buffer should be m_count characters. Place a null terminator\n// in the buffer to make our internal string null-terminated at that length.\n//----------------------------------------------------------------------------\nFORCEINLINE void SString::NullTerminate()\n{\n    SUPPORTS_DAC_HOST_ONLY;\n#ifdef SSTRING_EXTRA_CHECKS\n    CONTRACT_VOID\n    {\n        POSTCONDITION(CheckPointer(this));\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACT_END;\n#else //SSTRING_EXTRA_CHECKS\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n#endif //SSTRING_EXTRA_CHECKS\n\n    BYTE *end = m_buffer + GetSize();\n\n    if (GetRepresentation()&REPRESENTATION_SINGLE_MASK)\n    {\n        ((CHAR *)end)[-1] = 0;\n    }\n    else\n    {\n        ((WCHAR *)end)[-1] = 0;\n    }\n\n    SS_RETURN;\n}\n\n//----------------------------------------------------------------------------\n// private helper\n// Return true if the string is a literal.\n// A literal string has immutable memory.\n//----------------------------------------------------------------------------\ninline BOOL SString::IsLiteral() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    return SBuffer::IsImmutable() && (m_buffer != s_EmptyBuffer);\n}\n\n//----------------------------------------------------------------------------\n// private helper:\n// RETURN true if the string allocated (and should delete) its buffer.\n// IsAllocated() will RETURN false for Literal strings and\n// stack-based strings (the buffer is on the stack)\n//----------------------------------------------------------------------------\ninline BOOL SString::IsAllocated() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    return SBuffer::IsAllocated();\n}\n\n//----------------------------------------------------------------------------\n// Return true after we call OpenBuffer(), but before we close it.\n// All SString operations are illegal while the buffer is open.\n//----------------------------------------------------------------------------\n#if _DEBUG\ninline BOOL SString::IsBufferOpen() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    return SBuffer::IsOpened();\n}\n#endif\n\n//----------------------------------------------------------------------------\n// Return true if we've scanned the string to see if it is in the ASCII subset.\n//----------------------------------------------------------------------------\ninline BOOL SString::IsASCIIScanned() const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n\n    return SBuffer::IsFlag1();\n}\n\n//----------------------------------------------------------------------------\n// Set that we've scanned the string to see if it is in the ASCII subset.\n//----------------------------------------------------------------------------\ninline void SString::SetASCIIScanned() const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    const_cast<SString *>(this)->SBuffer::SetFlag1();\n}\n\n//----------------------------------------------------------------------------\n// Return true if we've normalized the string to unicode\n//----------------------------------------------------------------------------\ninline BOOL SString::IsNormalized() const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n\n    return SBuffer::IsFlag3();\n}\n\n//----------------------------------------------------------------------------\n// Set that we've normalized the string to unicode\n//----------------------------------------------------------------------------\ninline void SString::SetNormalized() const\n{\n    WRAPPER_NO_CONTRACT;\n\n    const_cast<SString *>(this)->SBuffer::SetFlag3();\n}\n\n//----------------------------------------------------------------------------\n// Clear normalization\n//----------------------------------------------------------------------------\ninline void SString::ClearNormalized() const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC_HOST_ONLY;\n\n    const_cast<SString *>(this)->SBuffer::ClearFlag3();\n}\n\n//----------------------------------------------------------------------------\n// Private helper.\n// Check to see if the string representation has single byte size\n//----------------------------------------------------------------------------\ninline BOOL SString::IsSingleByte() const\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n\n    return ((GetRepresentation()&REPRESENTATION_SINGLE_MASK) != 0);\n}\n\n//----------------------------------------------------------------------------\n// Private helper.\n// Check to see if the string representation has fixed size characters\n//----------------------------------------------------------------------------\ninline BOOL SString::IsFixedSize() const\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n\n    if (GetRepresentation()&REPRESENTATION_VARIABLE_MASK)\n        return FALSE;\n    else\n        return TRUE;\n}\n\n//----------------------------------------------------------------------------\n// Private helper.\n// Check to see if the string representation is appropriate for iteration\n//----------------------------------------------------------------------------\ninline BOOL SString::IsIteratable() const\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n\n    // Note that in many cases ANSI may be fixed width.  However we\n    // currently still do not allow iterating on them, because we would have to\n    // do character-by-character conversion on a character dereference (which must\n    // go to unicode) .  We may want to adjust this going forward to\n    // depending on perf in the non-ASCII but fixed width ANSI case.\n\n    return ((GetRepresentation()&REPRESENTATION_VARIABLE_MASK) == 0);\n}\n\n//----------------------------------------------------------------------------\n// Private helper\n// Return the size of the given string in bytes\n// in the given representation.\n// count does not include the null-terminator, but the RETURN value does.\n//----------------------------------------------------------------------------\ninline COUNT_T SString::CountToSize(COUNT_T count) const\n{\n    SS_CONTRACT(COUNT_T)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckCount(count));\n        SS_POSTCONDITION(SizeToCount(RETVAL) == count);\n        NOTHROW;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    SS_RETURN (count+1) << GetCharacterSizeShift();\n}\n\n//----------------------------------------------------------------------------\n// Private helper.\n// Return the maxmimum count of characters that could fit in a buffer of\n// 'size' bytes in the given representation.\n// 'size' includes the null terminator, but the RETURN value does not.\n//----------------------------------------------------------------------------\ninline COUNT_T SString::SizeToCount(COUNT_T size) const\n{\n    SS_CONTRACT(COUNT_T)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckSize(size));\n        SS_POSTCONDITION(CountToSize(RETVAL) == size);\n        NOTHROW;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    SS_RETURN (size >> GetCharacterSizeShift()) - 1;\n}\n\n//----------------------------------------------------------------------------\n// Private helper.\n// Return the maxmimum count of characters that could fit in the current\n// buffer including NULL terminator.\n//----------------------------------------------------------------------------\ninline COUNT_T SString::GetBufferSizeInCharIncludeNullChar() const\n{\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n\n    return (GetSize() >> GetCharacterSizeShift());\n}\n\n\n\n//----------------------------------------------------------------------------\n// Assert helper\n// Assert that the iterator is within the given string.\n//----------------------------------------------------------------------------\ninline CHECK SString::CheckIteratorRange(const CIterator &i) const\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(i >= Begin());\n    CHECK(i <= End()); // Note that it's OK to look at the terminating null\n    CHECK_OK;\n}\n\n//----------------------------------------------------------------------------\n// Assert helper\n// Assert that the iterator is within the given string.\n//----------------------------------------------------------------------------\ninline CHECK SString::CheckIteratorRange(const CIterator &i, COUNT_T length) const\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(i >= Begin());\n    CHECK(i + length <= End());  // Note that it's OK to look at the terminating null\n    CHECK_OK;\n}\n\n//----------------------------------------------------------------------------\n// Assert that the string is empty\n//----------------------------------------------------------------------------\ninline CHECK SString::CheckEmpty() const\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(IsEmpty());\n    CHECK_OK;\n}\n\n//----------------------------------------------------------------------------\n// Check the range of a count\n//----------------------------------------------------------------------------\ninline CHECK SString::CheckCount(COUNT_T count)\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(CheckSize(count*sizeof(WCHAR)));\n    CHECK_OK;\n}\n\n//----------------------------------------------------------------------------\n// Check the representation field\n//----------------------------------------------------------------------------\ninline CHECK SString::CheckRepresentation(int representation)\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(representation == REPRESENTATION_EMPTY\n          || representation == REPRESENTATION_UNICODE\n          || representation == REPRESENTATION_ASCII\n          || representation == REPRESENTATION_UTF8);\n    CHECK((representation & REPRESENTATION_MASK) == representation);\n\n    CHECK_OK;\n}\n\n#if CHECK_INVARIANTS\n//----------------------------------------------------------------------------\n// Assert helper. Check that the string only uses the ASCII subset of\n// codes.\n//----------------------------------------------------------------------------\ninline CHECK SString::CheckASCIIString(const CHAR *string)\n{\n    CANNOT_HAVE_CONTRACT;\n    if (string != NULL)\n        CHECK(CheckASCIIString(string, (int) strlen(string)));\n    CHECK_OK;\n}\n\ninline CHECK SString::CheckASCIIString(const CHAR *string, COUNT_T count)\n{\n    CANNOT_HAVE_CONTRACT;\n#if _DEBUG\n    const CHAR *sEnd = string + count;\n    while (string < sEnd)\n    {\n        CHECK_MSG((*string & 0x80) == 0x00, \"Found non-ASCII character in string.\");\n        string++;\n    }\n#endif\n    CHECK_OK;\n}\n\n//----------------------------------------------------------------------------\n// Check routine and invariants.\n//----------------------------------------------------------------------------\n\ninline CHECK SString::Check() const\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(SBuffer::Check());\n    CHECK_OK;\n}\n\ninline CHECK SString::Invariant() const\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(SBuffer::Invariant());\n    CHECK_OK;\n}\n\ninline CHECK SString::InternalInvariant() const\n{\n    CANNOT_HAVE_CONTRACT;\n    CHECK(SBuffer::InternalInvariant());\n    CHECK(SBuffer::GetSize() >= 2);\n    if (IsNormalized())\n        CHECK(IsRepresentation(REPRESENTATION_UNICODE));\n    CHECK_OK;\n}\n#endif  // CHECK_INVARIANTS\n\n//----------------------------------------------------------------------------\n// Return a writeable buffer that can store 'countChars'+1 unicode characters.\n// Call CloseBuffer when done.\n//----------------------------------------------------------------------------\ninline WCHAR *SString::OpenUnicodeBuffer(COUNT_T countChars)\n{\n    SS_CONTRACT(WCHAR*)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckCount(countChars));\n#if _DEBUG\n        SS_POSTCONDITION(IsBufferOpen());\n#endif\n        SS_POSTCONDITION(GetRawCount() == countChars);\n        SS_POSTCONDITION(GetRepresentation() == REPRESENTATION_UNICODE || countChars == 0);\n        SS_POSTCONDITION(CheckPointer(RETVAL));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    OpenBuffer(REPRESENTATION_UNICODE, countChars);\n    SS_RETURN GetRawUnicode();\n}\n\n//----------------------------------------------------------------------------\n// Return a copy of the underlying  buffer, the caller is responsible for managing\n// the returned memory\n//----------------------------------------------------------------------------\ninline WCHAR *SString::GetCopyOfUnicodeString()\n{\n    SS_CONTRACT(WCHAR*)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckPointer(buffer));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n    NewArrayHolder<WCHAR> buffer = NULL;\n\n    buffer = new WCHAR[GetCount() +1];\n    wcscpy_s(buffer, GetCount() + 1, GetUnicode());\n\n    SS_RETURN buffer.Extract();\n}\n\n//----------------------------------------------------------------------------\n// Return a writeable buffer that can store 'countChars'+1 ansi characters.\n// Call CloseBuffer when done.\n//----------------------------------------------------------------------------\ninline UTF8 *SString::OpenUTF8Buffer(COUNT_T countBytes)\n{\n    SS_CONTRACT(UTF8*)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION(CheckCount(countBytes));\n#if _DEBUG\n        SS_POSTCONDITION(IsBufferOpen());\n#endif\n        SS_POSTCONDITION(GetRawCount() == countBytes);\n        SS_POSTCONDITION(GetRepresentation() == REPRESENTATION_UTF8 || countBytes == 0);\n        SS_POSTCONDITION(CheckPointer(RETVAL));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    OpenBuffer(REPRESENTATION_UTF8, countBytes);\n    SS_RETURN GetRawUTF8();\n}\n\n//----------------------------------------------------------------------------\n// Private helper to open a raw buffer.\n// Called by public functions to open the buffer in the specific\n// representation.\n// While the buffer is opened, all other operations are illegal. Call\n// CloseBuffer() when done.\n//----------------------------------------------------------------------------\ninline void SString::OpenBuffer(SString::Representation representation, COUNT_T countChars)\n{\n#ifdef SSTRING_EXTRA_CHECKS\n    CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        PRECONDITION_MSG(!IsBufferOpen(), \"Can't nest calls to OpenBuffer()\");\n        PRECONDITION(CheckRepresentation(representation));\n        PRECONDITION(CheckSize(countChars));\n#if _DEBUG\n        POSTCONDITION(IsBufferOpen());\n#endif\n        POSTCONDITION(GetRawCount() == countChars);\n        POSTCONDITION(GetRepresentation() == representation || countChars == 0);\n        THROWS;\n    }\n    CONTRACT_END;\n#else\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_THROWS;\n#endif\n\n    Resize(countChars, representation);\n\n    SBuffer::OpenRawBuffer(CountToSize(countChars));\n\n    SS_RETURN;\n}\n\n//----------------------------------------------------------------------------\n// Get the max size that can be passed to OpenUnicodeBuffer without causing\n// allocations.\n//----------------------------------------------------------------------------\ninline COUNT_T SString::GetUnicodeAllocation()\n{\n    CONTRACTL\n    {\n        INSTANCE_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n\n    COUNT_T allocation = GetAllocation();\n    return ( (allocation > sizeof(WCHAR))\n        ? (allocation - sizeof(WCHAR)) / sizeof(WCHAR) : 0 );\n}\n\n//----------------------------------------------------------------------------\n// Close an open buffer. Assumes that we wrote exactly number of characters\n// we requested in OpenBuffer.\n//----------------------------------------------------------------------------\ninline void SString::CloseBuffer()\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n#if _DEBUG\n        PRECONDITION_MSG(IsBufferOpen(), \"Can only CloseBuffer() after a call to OpenBuffer()\");\n#endif\n        SS_POSTCONDITION(CheckPointer(this));\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    SBuffer::CloseRawBuffer();\n    NullTerminate();\n\n    SS_RETURN;\n}\n\n//----------------------------------------------------------------------------\n// CloseBuffer() tells the SString that we're done using the unsafe buffer.\n// countChars is the count of characters actually used (so we can set m_count).\n// This is important if we request a buffer larger than what we actually\n// used.\n//----------------------------------------------------------------------------\ninline void SString::CloseBuffer(COUNT_T finalCount)\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n#if _DEBUG\n        PRECONDITION_MSG(IsBufferOpen(), \"Can only CloseBuffer() after a call to OpenBuffer()\");\n#endif\n        PRECONDITION(CheckSize(finalCount));\n        SS_POSTCONDITION(CheckPointer(this));\n        SS_POSTCONDITION(GetRawCount() == finalCount);\n        THROWS;\n    }\n    SS_CONTRACT_END;\n\n    SBuffer::CloseRawBuffer(CountToSize(finalCount));\n    NullTerminate();\n\n    SS_RETURN;\n}\n\n//----------------------------------------------------------------------------\n// EnsureWritable\n// Ensures that the buffer is writable\n//----------------------------------------------------------------------------\ninline void SString::EnsureWritable() const\n{\n#ifdef SSTRING_EXTRA_CHECKS\n    CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        POSTCONDITION(!IsLiteral());\n        THROWS;\n    }\n    CONTRACT_END;\n#else //SSTRING_EXTRA_CHECKS\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_THROWS;\n#endif //SSTRING_EXTRA_CHECKS\n\n    if (IsLiteral())\n        const_cast<SString *>(this)->Resize(GetRawCount(), GetRepresentation(), PRESERVE);\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Convert the internal representation to be a fixed size\n//-----------------------------------------------------------------------------\ninline void SString::ConvertToFixed() const\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        SS_PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(IsFixedSize());\n        THROWS_UNLESS_NORMALIZED;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    // If we're already fixed size, great.\n    if (IsFixedSize())\n        SS_RETURN;\n\n    // See if we can coerce it to ASCII.\n    if (ScanASCII())\n        SS_RETURN;\n\n    // Convert to unicode then.\n    ConvertToUnicode();\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Convert the internal representation to be an iteratable one (current\n// requirements here are that it be trivially convertible to unicode chars.)\n//-----------------------------------------------------------------------------\ninline void SString::ConvertToIteratable() const\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        SS_PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(IsIteratable());\n        THROWS_UNLESS_NORMALIZED;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    // If we're already iteratable, great.\n    if (IsIteratable())\n        SS_RETURN;\n\n    // See if we can coerce it to ASCII.\n    if (ScanASCII())\n        SS_RETURN;\n\n    // Convert to unicode then.\n    ConvertToUnicode();\n\n    SS_RETURN;\n}\n\n//-----------------------------------------------------------------------------\n// Create CIterators on the string.\n//-----------------------------------------------------------------------------\n\nFORCEINLINE SString::CIterator SString::Begin() const\n{\n    SS_CONTRACT(SString::CIterator)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckValue(RETVAL));\n        THROWS_UNLESS_NORMALIZED;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToIteratable();\n\n    SS_RETURN CIterator(this, 0);\n}\n\nFORCEINLINE SString::CIterator SString::End() const\n{\n    SS_CONTRACT(SString::CIterator)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckValue(RETVAL));\n        THROWS_UNLESS_NORMALIZED;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToIteratable();\n\n    SS_RETURN CIterator(this, GetCount());\n}\n\n//-----------------------------------------------------------------------------\n// Create Iterators on the string.\n//-----------------------------------------------------------------------------\n\nFORCEINLINE SString::Iterator SString::Begin()\n{\n    SS_CONTRACT(SString::Iterator)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckValue(RETVAL));\n        THROWS; // EnsureMutable always throws\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToIteratable();\n    EnsureMutable();\n\n    SS_RETURN Iterator(this, 0);\n}\n\nFORCEINLINE SString::Iterator SString::End()\n{\n    SS_CONTRACT(SString::Iterator)\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(this));\n        SS_POSTCONDITION(CheckValue(RETVAL));\n        THROWS; // EnsureMutable always Throws\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    ConvertToIteratable();\n    EnsureMutable();\n\n    SS_RETURN Iterator(this, GetCount());\n}\n\n//-----------------------------------------------------------------------------\n// CIterator support routines\n//-----------------------------------------------------------------------------\n\ninline SString::Index::Index()\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ninline SString::Index::Index(SString *string, SCOUNT_T index)\n  : SBuffer::Index(string, index<<string->GetCharacterSizeShift())\n{\n    SS_CONTRACT_VOID\n    {\n        GC_NOTRIGGER;\n        PRECONDITION(CheckPointer(string));\n        PRECONDITION(string->IsIteratable());\n        PRECONDITION(DoCheck(0));\n        SS_POSTCONDITION(CheckPointer(this));\n        // POSTCONDITION(Subtract(string->Begin()) == index); contract violation - fix later\n        NOTHROW;\n        CANNOT_TAKE_LOCK;\n        SUPPORTS_DAC;\n    }\n    SS_CONTRACT_END;\n\n    m_characterSizeShift = string->GetCharacterSizeShift();\n\n    SS_RETURN;\n}\n\ninline BYTE &SString::Index::GetAt(SCOUNT_T delta) const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return m_ptr[delta<<m_characterSizeShift];\n}\n\ninline void SString::Index::Skip(SCOUNT_T delta)\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    m_ptr += (delta<<m_characterSizeShift);\n}\n\ninline SCOUNT_T SString::Index::Subtract(const Index &i) const\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (SCOUNT_T) ((m_ptr - i.m_ptr)>>m_characterSizeShift);\n}\n\ninline CHECK SString::Index::DoCheck(SCOUNT_T delta) const\n{\n    CANNOT_HAVE_CONTRACT;\n#if _DEBUG\n    const SString *string = (const SString *) GetContainerDebug();\n\n    CHECK(m_ptr + (delta<<m_characterSizeShift) >= string->m_buffer);\n    CHECK(m_ptr + (delta<<m_characterSizeShift) < string->m_buffer + string->GetSize());\n#endif\n    CHECK_OK;\n}\n\ninline void SString::Index::Resync(const SString *string, BYTE *ptr) const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n\n    SBuffer::Index::Resync(string, ptr);\n\n    const_cast<SString::Index*>(this)->m_characterSizeShift = string->GetCharacterSizeShift();\n}\n\n\ninline const WCHAR *SString::Index::GetUnicode() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (const WCHAR *) m_ptr;\n}\n\ninline const CHAR *SString::Index::GetASCII() const\n{\n    LIMITED_METHOD_CONTRACT;\n\n    return (const CHAR *) m_ptr;\n}\n\ninline WCHAR SString::Index::operator*() const\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n\n    if (m_characterSizeShift == 0)\n        return *(CHAR*)&GetAt(0);\n    else\n        return *(WCHAR*)&GetAt(0);\n}\n\ninline void SString::Index::operator->() const\n{\n    LIMITED_METHOD_CONTRACT;\n}\n\ninline WCHAR SString::Index::operator[](int index) const\n{\n    WRAPPER_NO_CONTRACT;\n\n    if (m_characterSizeShift == 0)\n        return *(CHAR*)&GetAt(index);\n    else\n        return *(WCHAR*)&GetAt(index);\n}\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#endif // _MSC_VER\n\n#endif  // _SSTRING_INL_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stack.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//-----------------------------------------------------------------------------\n\n//-----------------------------------------------------------------------------\n// This is a generic growable stack of T.\n\n#ifndef GENERIC_STACK_H\n#define GENERIC_STACK_H 1\n\n#include <math.h>\n\ntemplate<typename T>\nclass Stack\n{\n    T* m_elems;\n    unsigned m_elemsSize;\n    unsigned m_elemsCount;\n\n    static const unsigned InitSize = 8;\n\n    void GrowForPush()\n    {\n        if (m_elemsCount == m_elemsSize)\n        {\n            m_elemsSize = max(InitSize, 2*m_elemsSize);\n            T* newElems = new T[m_elemsSize];\n            if (m_elemsCount != 0)\n            {\n                _ASSERTE(m_elems != NULL);\n                for (unsigned k = 0; k < m_elemsCount; k++) newElems[k] = m_elems[k];\n                delete[] m_elems;\n            }\n            m_elems = newElems;\n        }\n    }\n\n  public:\n    Stack(unsigned sz = 0) : m_elems(NULL), m_elemsSize(sz), m_elemsCount(0)\n    {\n        if (sz > 0)\n        {\n            m_elems = new T[sz];\n        }\n    }\n\n    ~Stack()\n    {\n        if (m_elems != NULL) delete[] m_elems;\n    }\n\n    void Push(T t)\n    {\n        GrowForPush();\n        m_elems[m_elemsCount] = t;\n        m_elemsCount++;\n    }\n\n    bool IsEmpty()\n    {\n        return m_elemsCount == 0;\n    }\n\n    T Pop()\n    {\n        _ASSERTE(m_elemsCount > 0);\n        m_elemsCount--;\n        return m_elems[m_elemsCount];\n    }\n\n    T Peek()\n    {\n        _ASSERTE(m_elemsCount > 0);\n        return m_elems[m_elemsCount-1];\n    }\n\n    // Caller should take care to only side-effect the return reference if they are *sure*\n    // that the stack will not be popped in the interim!\n    T& PeekRef()\n    {\n        _ASSERTE(m_elemsCount > 0);\n        return m_elems[m_elemsCount-1];\n    }\n};\n\n#endif // GENERIC_STACK_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stackframe.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __STACKFRAME_H\n#define __STACKFRAME_H\n\n#include \"regdisp.h\"\n\n\nstruct StackFrame\n{\n    const static UINT_PTR maxVal = (UINT_PTR)(INT_PTR)-1;\n    StackFrame() : SP(NULL)\n    {\n    }\n\n    StackFrame(UINT_PTR sp)\n    {\n        SP = sp;\n    }\n\n    void Clear()\n    {\n        SP = NULL;\n    }\n\n    void SetMaxVal()\n    {\n        SP = maxVal;\n    }\n\n    bool IsNull()\n    {\n        return (SP == NULL);\n    }\n\n    bool IsMaxVal()\n    {\n        return (SP == maxVal);\n    }\n\n    bool operator==(StackFrame sf)\n    {\n        return (SP == sf.SP);\n    }\n\n    bool operator!=(StackFrame sf)\n    {\n        return (SP != sf.SP);\n    }\n\n    bool operator<(StackFrame sf)\n    {\n        return (SP < sf.SP);\n    }\n\n    bool operator<=(StackFrame sf)\n    {\n        return (SP <= sf.SP);\n    }\n\n    bool operator>(StackFrame sf)\n    {\n        return (SP > sf.SP);\n    }\n\n    bool operator>=(StackFrame sf)\n    {\n        return (SP >= sf.SP);\n    }\n\n    static inline StackFrame FromEstablisherFrame(UINT_PTR EstablisherFrame)\n    {\n        return StackFrame(EstablisherFrame);\n    }\n\n    static inline StackFrame FromRegDisplay(REGDISPLAY* pRD)\n    {\n        return StackFrame(GetRegdisplaySP(pRD));\n    }\n\n    UINT_PTR SP;\n};\n\n\n//---------------------------------------------------------------------------------------\n//\n// On WIN64, all the stack range tracking done by the Exception Handling (EH) subsystem is based on the\n// establisher frame given by the OS.  On IA64, the establisher frame is the caller SP and the current BSP.\n// On X64, it is the initial SP before any dynamic stack allocation, i.e. it is the SP when a function exits\n// the prolog.  The EH subsystem uses the same format.\n//\n// The stackwalker needs to get information from the EH subsystem in order to skip funclets.  Unfortunately,\n// stackwalking is based on the current SP, i.e. the SP when the control flow leaves a function via a\n// function call.  Thus, for stack frames with dynamic stack allocations on X64, the SP values used by the\n// stackwalker and the EH subsystem don't match.\n//\n// To work around this problem, we need to somehow bridge the different SP values.  We do so by using the\n// caller SP instead of the current SP for comparisons during a stackwalk on X64.  Creating a new type\n// explicitly spells out the important distinction that this is NOT in the same format as the\n// OS establisher frame.\n//\n// Notes:\n//    In the long term, we should look at merging the two SP formats and have one consistent abstraction.\n//\n\nstruct CallerStackFrame : StackFrame\n{\n    CallerStackFrame() : StackFrame()\n    {\n    }\n\n    CallerStackFrame(UINT_PTR sp) : StackFrame(sp)\n    {\n    }\n\n#ifdef FEATURE_EH_FUNCLETS\n    static inline CallerStackFrame FromRegDisplay(REGDISPLAY* pRD)\n    {\n        _ASSERTE(pRD->IsCallerSPValid || pRD->IsCallerContextValid);\n        return CallerStackFrame(GetSP(pRD->pCallerContext));\n    }\n#endif // FEATURE_EH_FUNCLETS\n};\n\n#endif  // __STACKFRAME_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stacktrace.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//-----------------------------------------------------------------------------\n\n//-----------------------------------------------------------------------------\n\n#ifndef __STACK_TRACE_H__\n#define __STACK_TRACE_H__\n\nHINSTANCE LoadImageHlp();\nHINSTANCE LoadDbgHelp();\n\n#include <specstrings.h>\n\n//\n//--- Constants ---------------------------------------------------------------\n//\n\n#define cchMaxAssertModuleLen 60\n#define cchMaxAssertSymbolLen 257\n#define cfrMaxAssertStackLevels 20\n#define cchMaxAssertExprLen 257\n\n#ifdef HOST_64BIT\n\n#define cchMaxAssertStackLevelStringLen \\\n    ((3 * 8) + cchMaxAssertModuleLen + cchMaxAssertSymbolLen + 13)\n    // 3 addresses of at most 8 char, module, symbol, and the extra chars:\n    // 0x<address>: <module>! <symbol> + 0x<offset>\\n\n    //FMT_ADDR_BARE   is defined as   \"%08x`%08x\" on Win64, and as\n    //\"%08x\" on 32 bit platforms. Hence the difference in the definitions.\n\n#else\n\n#define cchMaxAssertStackLevelStringLen \\\n    ((2 * 8) + cchMaxAssertModuleLen + cchMaxAssertSymbolLen + 12)\n    // 2 addresses of at most 8 char, module, symbol, and the extra chars:\n    // 0x<address>: <module>! <symbol> + 0x<offset>\\n\n\n#endif\n\n//\n//--- Prototypes --------------------------------------------------------------\n//\n\n/****************************************************************************\n* MagicDeinit *\n*-------------*\n*   Description:\n*       Cleans up for the symbol loading code. Should be called before\n*       exiting in order to free the dynamically loaded imagehlp.dll\n******************************************************************** robch */\nvoid MagicDeinit(void);\n\n/****************************************************************************\n* GetStringFromStackLevels *\n*--------------------------*\n*   Description:\n*       Retrieves a string from the stack frame. If more than one frame, they\n*       are separated by newlines. Each fram appears in this format:\n*\n*           0x<address>: <module>! <symbol> + 0x<offset>\n******************************************************************** robch */\nvoid GetStringFromStackLevels(UINT ifrStart, UINT cfrTotal, _Out_writes_(cchMaxAssertStackLevelStringLen * cfrTotal) CHAR *pszString, struct _CONTEXT * pContext = NULL);\n\n/****************************************************************************\n* GetStringFromAddr *\n*-------------------*\n*   Description:\n*       Builds a string from an address in the format:\n*\n*           0x<address>: <module>! <symbol> + 0x<offset>\n******************************************************************** robch */\nvoid GetStringFromAddr(DWORD_PTR dwAddr, _Out_writes_(cchMaxAssertStackLevelStringLen) LPSTR szString);\n\n#if defined(HOST_X86) && !defined(TARGET_UNIX)\n/****************************************************************************\n* ClrCaptureContext *\n*-------------------*\n*   Description:\n*       Exactly the contents of RtlCaptureContext for Win7 - Win2K doesn't\n*       support this, so we need it for CoreCLR 4, if we require Win2K support\n****************************************************************************/\nextern \"C\" void __stdcall ClrCaptureContext(_Out_ PCONTEXT ctx);\n#else // HOST_X86 && !TARGET_UNIX\n#define ClrCaptureContext RtlCaptureContext\n#endif // HOST_X86 && !TARGET_UNIX\n\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/static_assert.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// static_assert.h\n//\n// Static assertion infrastructure\n// ---------------------------------------------------------------------------\n\n//--------------------------------------------------------------------------------\n// static_assert represents a check which should be made at compile time.  It\n// can only be done on a constant expression.\n//--------------------------------------------------------------------------------\n\n#ifndef __STATIC_ASSERT_H__\n#define __STATIC_ASSERT_H__\n\n// Replaces previous uses of C_ASSERT and COMPILE_TIME_ASSERT\n#define static_assert_no_msg( cond ) static_assert( cond, #cond )\n\n#endif // __STATIC_ASSERT_H__\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/staticcontract.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// StaticContract.h\n// ---------------------------------------------------------------------------\n\n\n#ifndef __STATIC_CONTRACT_H_\n#define __STATIC_CONTRACT_H_\n\n// Make sure we have the WCHAR defines available.\n#include \"palclr.h\"\n\n#define SCAN_WIDEN2(x) L ## x\n#define SCAN_WIDEN(x) SCAN_WIDEN2(x)\n\n#ifndef NOINLINE\n#if __GNUC__\n#define NOINLINE __attribute__((noinline))\n#else\n#define NOINLINE __declspec(noinline)\n#endif\n#endif\n\n//\n// PDB annotations for the static contract analysis tool. These are separated\n// from Contract.h to allow their inclusion in any part of the system.\n//\n\n#if defined(_DEBUG) && defined(TARGET_X86)\n#define METHOD_CANNOT_BE_FOLDED_DEBUG                               \\\n    static int _noFold = 0;                                         \\\n    _noFold++;\n#else\n#define METHOD_CANNOT_BE_FOLDED_DEBUG\n#endif\n\n#ifdef TARGET_X86\n\n//\n// currently, only x86 has a static contract analysis tool, so let's not\n// bloat the PDBs of all the other architectures too..\n//\n#define ANNOTATION_TRY_BEGIN                __annotation(W(\"TRY_BEGIN\"))\n#define ANNOTATION_TRY_END                  __annotation(W(\"TRY_END\"))\n#define ANNOTATION_HANDLER_BEGIN            __annotation(W(\"HANDLER_BEGIN\"))\n#define ANNOTATION_HANDLER_END              __annotation(W(\"HANDLER_END\"))\n#define ANNOTATION_NOTHROW                  __annotation(W(\"NOTHROW\"))\n#define ANNOTATION_CANNOT_TAKE_LOCK         __annotation(W(\"CANNOT_TAKE_LOCK\"))\n#define ANNOTATION_WRAPPER                  __annotation(W(\"WRAPPER\"))\n#define ANNOTATION_FAULT                    __annotation(W(\"FAULT\"))\n#define ANNOTATION_FORBID_FAULT             __annotation(W(\"FORBID_FAULT\"))\n#define ANNOTATION_COOPERATIVE              __annotation(W(\"MODE_COOPERATIVE\"))\n#define ANNOTATION_MODE_COOPERATIVE         __annotation(W(\"MODE_PREEMPTIVE\"))\n#define ANNOTATION_MODE_ANY                 __annotation(W(\"MODE_ANY\"))\n#define ANNOTATION_GC_TRIGGERS              __annotation(W(\"GC_TRIGGERS\"))\n#define ANNOTATION_IGNORE_THROW             __annotation(W(\"THROWS\"), W(\"NOTHROW\"), W(\"CONDITIONAL_EXEMPT\"))\n#define ANNOTATION_IGNORE_LOCK              __annotation(W(\"CAN_TAKE_LOCK\"), W(\"CANNOT_TAKE_LOCK\"), W(\"CONDITIONAL_EXEMPT\"))\n#define ANNOTATION_IGNORE_FAULT             __annotation(W(\"FAULT\"), W(\"FORBID_FAULT\"), W(\"CONDITIONAL_EXEMPT\"))\n#define ANNOTATION_IGNORE_TRIGGER           __annotation(W(\"GC_TRIGGERS\"), W(\"GC_NOTRIGGER\"), W(\"CONDITIONAL_EXEMPT\"))\n#define ANNOTATION_VIOLATION(violationmask) __annotation(W(\"VIOLATION(\") L#violationmask W(\")\"))\n#define ANNOTATION_UNCHECKED(thecheck)      __annotation(W(\"UNCHECKED(\") L#thecheck W(\")\"))\n\n#define ANNOTATION_MARK_BLOCK_ANNOTATION    __annotation(W(\"MARK\"))\n#define ANNOTATION_USE_BLOCK_ANNOTATION     __annotation(W(\"USE\"))\n#define ANNOTATION_END_USE_BLOCK_ANNOTATION __annotation(W(\"END_USE\"))\n\n// here is the plan:\n//\n//  a special holder which implements a violation\n//\n\n#define ANNOTATION_FN_SPECIAL_HOLDER_BEGIN  __annotation(W(\"SPECIAL_HOLDER_BEGIN \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_SPECIAL_HOLDER_END       __annotation(W(\"SPECIAL_HOLDER_END\"))\n#define ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT __annotation(W(\"SPECIAL_HOLDER_DYNAMIC\"))\n\n#define ANNOTATION_SO_PROBE_BEGIN(probeAmount) __annotation(W(\"SO_PROBE_BEGIN(\") L#probeAmount W(\")\"))\n#define ANNOTATION_SO_PROBE_END             __annotation(W(\"SO_PROBE_END\"))\n\n//\n// these annotations are all function-name qualified\n//\n#define ANNOTATION_FN_LEAF                  __annotation(W(\"LEAF \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_WRAPPER               __annotation(W(\"WRAPPER \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_THROWS                __annotation(W(\"THROWS \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_NOTHROW               __annotation(W(\"NOTHROW \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_CAN_TAKE_LOCK         __annotation(W(\"CAN_TAKE_LOCK \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_CANNOT_TAKE_LOCK      __annotation(W(\"CANNOT_TAKE_LOCK \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_FAULT                 __annotation(W(\"FAULT \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_FORBID_FAULT          __annotation(W(\"FORBID_FAULT \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_GC_TRIGGERS           __annotation(W(\"GC_TRIGGERS \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_GC_NOTRIGGER          __annotation(W(\"GC_NOTRIGGER \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_MODE_COOPERATIVE      __annotation(W(\"MODE_COOPERATIVE \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_MODE_PREEMPTIVE       __annotation(W(\"MODE_PREEMPTIVE \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_MODE_ANY              __annotation(W(\"MODE_ANY \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_HOST_NOCALLS          __annotation(W(\"HOST_NOCALLS \") SCAN_WIDEN(__FUNCTION__))\n#define ANNOTATION_FN_HOST_CALLS            __annotation(W(\"HOST_CALLS \") SCAN_WIDEN(__FUNCTION__))\n\n#define ANNOTATION_ENTRY_POINT              __annotation(W(\"SO_EP \") SCAN_WIDEN(__FUNCTION__))\n\n\n// for DacCop\n#define ANNOTATION_SUPPORTS_DAC             __annotation(W(\"SUPPORTS_DAC\"))\n#define ANNOTATION_SUPPORTS_DAC_HOST_ONLY   __annotation(W(\"SUPPORTS_DAC_HOST_ONLY\"))\n\n#ifdef _DEBUG\n// @todo : put correct annotation in and fixup the static analysis tool\n// This is used to flag debug-only functions that we want to ignore in our static analysis\n#define ANNOTATION_DEBUG_ONLY               __annotation(W(\"DBG_ONLY\"))\n\n#endif\n\n#else // TARGET_X86\n\n#define ANNOTATION_TRY_BEGIN                { }\n#define ANNOTATION_TRY_END                  { }\n#define ANNOTATION_HANDLER_BEGIN            { }\n#define ANNOTATION_HANDLER_END              { }\n#define ANNOTATION_NOTHROW                  { }\n#define ANNOTATION_CANNOT_TAKE_LOCK         { }\n#define ANNOTATION_WRAPPER                  { }\n#define ANNOTATION_FAULT                    { }\n#define ANNOTATION_FORBID_FAULT             { }\n#define ANNOTATION_COOPERATIVE              { }\n#define ANNOTATION_MODE_COOPERATIVE         { }\n#define ANNOTATION_MODE_ANY                 { }\n#define ANNOTATION_GC_TRIGGERS              { }\n#define ANNOTATION_IGNORE_THROW             { }\n#define ANNOTATION_IGNORE_LOCK              { }\n#define ANNOTATION_IGNORE_FAULT             { }\n#define ANNOTATION_IGNORE_TRIGGER           { }\n#define ANNOTATION_VIOLATION(violationmask) { }\n#define ANNOTATION_UNCHECKED(thecheck)      { }\n\n#define ANNOTATION_TRY_MARKER               { }\n#define ANNOTATION_CATCH_MARKER             { }\n\n#define ANNOTATION_FN_HOST_NOCALLS          { }\n#define ANNOTATION_FN_HOST_CALLS            { }\n\n#define ANNOTATION_FN_SPECIAL_HOLDER_BEGIN  { }\n#define ANNOTATION_SPECIAL_HOLDER_END       { }\n#define ANNOTATION_SPECIAL_HOLDER_CALLER_NEEDS_DYNAMIC_CONTRACT { }\n\n#define ANNOTATION_FN_LEAF                  { }\n#define ANNOTATION_FN_WRAPPER               { }\n#define ANNOTATION_FN_THROWS                { }\n#define ANNOTATION_FN_NOTHROW               { }\n#define ANNOTATION_FN_CAN_TAKE_LOCK         { }\n#define ANNOTATION_FN_CANNOT_TAKE_LOCK      { }\n#define ANNOTATION_FN_FAULT                 { }\n#define ANNOTATION_FN_FORBID_FAULT          { }\n#define ANNOTATION_FN_GC_TRIGGERS           { }\n#define ANNOTATION_FN_GC_NOTRIGGER          { }\n#define ANNOTATION_FN_MODE_COOPERATIVE      { }\n#define ANNOTATION_FN_MODE_PREEMPTIVE       { }\n#define ANNOTATION_FN_MODE_ANY              { }\n#define ANNOTATION_FN_HOST_NOCALLS          { }\n#define ANNOTATION_FN_HOST_CALLS            { }\n\n#define ANNOTATION_SUPPORTS_DAC             { }\n#define ANNOTATION_SUPPORTS_DAC_HOST_ONLY   { }\n\n#define ANNOTATION_SO_PROBE_BEGIN(probeAmount) { }\n#define ANNOTATION_SO_PROBE_END             { }\n\n#define ANNOTATION_ENTRY_POINT              { }\n#ifdef _DEBUG\n#define ANNOTATION_DEBUG_ONLY               { }\n#endif\n\n#endif // TARGET_X86\n\n#define STATIC_CONTRACT_THROWS              ANNOTATION_FN_THROWS\n#define STATIC_CONTRACT_NOTHROW             ANNOTATION_FN_NOTHROW\n#define STATIC_CONTRACT_CAN_TAKE_LOCK       ANNOTATION_FN_CAN_TAKE_LOCK\n#define STATIC_CONTRACT_CANNOT_TAKE_LOCK    ANNOTATION_FN_CANNOT_TAKE_LOCK\n#define STATIC_CONTRACT_FAULT               ANNOTATION_FN_FAULT\n#define STATIC_CONTRACT_FORBID_FAULT        ANNOTATION_FN_FORBID_FAULT\n#define STATIC_CONTRACT_GC_TRIGGERS         ANNOTATION_FN_GC_TRIGGERS\n#define STATIC_CONTRACT_GC_NOTRIGGER        ANNOTATION_FN_GC_NOTRIGGER\n#define STATIC_CONTRACT_HOST_NOCALLS        ANNOTATION_FN_HOST_NOCALLS\n#define STATIC_CONTRACT_HOST_CALLS          ANNOTATION_FN_HOST_CALLS\n\n#define STATIC_CONTRACT_SUPPORTS_DAC        ANNOTATION_SUPPORTS_DAC\n#define STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY ANNOTATION_SUPPORTS_DAC_HOST_ONLY\n\n#define STATIC_CONTRACT_MODE_COOPERATIVE    ANNOTATION_FN_MODE_COOPERATIVE\n#define STATIC_CONTRACT_MODE_PREEMPTIVE     ANNOTATION_FN_MODE_PREEMPTIVE\n#define STATIC_CONTRACT_MODE_ANY            ANNOTATION_FN_MODE_ANY\n#define STATIC_CONTRACT_LEAF                ANNOTATION_FN_LEAF\n#define STATIC_CONTRACT_LIMITED_METHOD      ANNOTATION_FN_LEAF\n#define STATIC_CONTRACT_WRAPPER             ANNOTATION_FN_WRAPPER\n\n#define STATIC_CONTRACT_ENTRY_POINT\n\n#ifdef _DEBUG\n#define STATIC_CONTRACT_DEBUG_ONLY                                  \\\n    ANNOTATION_DEBUG_ONLY;                                          \\\n    STATIC_CONTRACT_CANNOT_TAKE_LOCK;                               \\\n    ANNOTATION_VIOLATION(TakesLockViolation);\n#else\n#define STATIC_CONTRACT_DEBUG_ONLY\n#endif\n\n#define STATIC_CONTRACT_VIOLATION(mask)                             \\\n    ANNOTATION_VIOLATION(mask)\n\n#define SCAN_SCOPE_BEGIN                                            \\\n    METHOD_CANNOT_BE_FOLDED_DEBUG;                                  \\\n    ANNOTATION_FN_SPECIAL_HOLDER_BEGIN;\n\n#define SCAN_SCOPE_END                                              \\\n    METHOD_CANNOT_BE_FOLDED_DEBUG;                                  \\\n    ANNOTATION_SPECIAL_HOLDER_END;\n\nnamespace StaticContract\n{\n    struct ScanThrowMarkerStandard\n    {\n        NOINLINE ScanThrowMarkerStandard()\n        {\n            METHOD_CANNOT_BE_FOLDED_DEBUG;\n            STATIC_CONTRACT_THROWS;\n            STATIC_CONTRACT_GC_NOTRIGGER;\n        }\n\n        static void used()\n        {\n        }\n    };\n\n    struct ScanThrowMarkerTerminal\n    {\n        NOINLINE ScanThrowMarkerTerminal()\n        {\n            METHOD_CANNOT_BE_FOLDED_DEBUG;\n        }\n\n        static void used()\n        {\n        }\n    };\n\n    struct ScanThrowMarkerIgnore\n    {\n        NOINLINE ScanThrowMarkerIgnore()\n        {\n            METHOD_CANNOT_BE_FOLDED_DEBUG;\n        }\n\n        static void used()\n        {\n        }\n    };\n}\ntypedef StaticContract::ScanThrowMarkerStandard ScanThrowMarker;\n\n// This is used to annotate code as throwing a terminal exception, and should\n// be used immediately before the throw so that infer that it can be inferred\n// that the block in which this annotation appears throws unconditionally.\n#define SCAN_THROW_MARKER do { ScanThrowMarker __throw_marker; } while (0)\n\n#define SCAN_IGNORE_THROW_MARKER                                    \\\n    typedef StaticContract::ScanThrowMarkerIgnore ScanThrowMarker; if (0) ScanThrowMarker::used();\n\n// Terminal exceptions are asynchronous and cannot be included in THROWS contract\n// analysis. As such, this uses typedef to reassign the ScanThrowMarker to a\n// non-annotating struct so that SCAN does not see the block as throwing.\n#define STATIC_CONTRACT_THROWS_TERMINAL                             \\\n    typedef StaticContract::ScanThrowMarkerTerminal ScanThrowMarker; if (0) ScanThrowMarker::used();\n\n#ifdef _MSC_VER\n#define SCAN_IGNORE_THROW                   typedef StaticContract::ScanThrowMarkerIgnore ScanThrowMarker; ANNOTATION_IGNORE_THROW\n#define SCAN_IGNORE_LOCK                    ANNOTATION_IGNORE_LOCK\n#define SCAN_IGNORE_FAULT                   ANNOTATION_IGNORE_FAULT\n#define SCAN_IGNORE_TRIGGER                 ANNOTATION_IGNORE_TRIGGER\n#else\n#define SCAN_IGNORE_THROW\n#define SCAN_IGNORE_LOCK\n#define SCAN_IGNORE_FAULT\n#define SCAN_IGNORE_TRIGGER\n#endif\n\n\n// we use BlockMarker's only for SCAN\n#if defined(_DEBUG) && defined(TARGET_X86) && !defined(DACCESS_COMPILE)\n\ntemplate <UINT COUNT>\nclass BlockMarker\n{\npublic:\n    NOINLINE void MarkBlock()\n    {\n        ANNOTATION_MARK_BLOCK_ANNOTATION;\n        METHOD_CANNOT_BE_FOLDED_DEBUG;\n        return;\n    }\n\n    NOINLINE void UseMarkedBlockAnnotation()\n    {\n        ANNOTATION_USE_BLOCK_ANNOTATION;\n        METHOD_CANNOT_BE_FOLDED_DEBUG;\n        return;\n    }\n\n    NOINLINE void EndUseMarkedBlockAnnotation()\n    {\n        ANNOTATION_END_USE_BLOCK_ANNOTATION;\n        METHOD_CANNOT_BE_FOLDED_DEBUG;\n        return;\n    }\n};\n\n#define SCAN_BLOCKMARKER()              BlockMarker<__COUNTER__> __blockMarker_onlyOneAllowedPerScope\n#define SCAN_BLOCKMARKER_MARK()         __blockMarker_onlyOneAllowedPerScope.MarkBlock()\n#define SCAN_BLOCKMARKER_USE()          __blockMarker_onlyOneAllowedPerScope.UseMarkedBlockAnnotation()\n#define SCAN_BLOCKMARKER_END_USE()      __blockMarker_onlyOneAllowedPerScope.EndUseMarkedBlockAnnotation()\n\n#define SCAN_BLOCKMARKER_N(num)         BlockMarker<__COUNTER__> __blockMarker_onlyOneAllowedPerScope##num\n#define SCAN_BLOCKMARKER_MARK_N(num)    __blockMarker_onlyOneAllowedPerScope##num.MarkBlock()\n#define SCAN_BLOCKMARKER_USE_N(num)     __blockMarker_onlyOneAllowedPerScope##num.UseMarkedBlockAnnotation()\n#define SCAN_BLOCKMARKER_END_USE_N(num) __blockMarker_onlyOneAllowedPerScope##num.EndUseMarkedBlockAnnotation()\n\n#define SCAN_EHMARKER()                 BlockMarker<__COUNTER__> __marker_onlyOneAllowedPerScope\n#define SCAN_EHMARKER_TRY()             __annotation(W(\"SCOPE(BLOCK);SCAN_TRY_BEGIN\")); __marker_onlyOneAllowedPerScope.MarkBlock()\n#define SCAN_EHMARKER_END_TRY()         __annotation(W(\"SCOPE(BLOCK);SCAN_TRY_END\"))\n#define SCAN_EHMARKER_CATCH()           __marker_onlyOneAllowedPerScope.UseMarkedBlockAnnotation()\n#define SCAN_EHMARKER_END_CATCH()       __marker_onlyOneAllowedPerScope.EndUseMarkedBlockAnnotation()\n\n#else\n\n#define SCAN_BLOCKMARKER()\n#define SCAN_BLOCKMARKER_MARK()\n#define SCAN_BLOCKMARKER_USE()\n#define SCAN_BLOCKMARKER_END_USE()\n\n#define SCAN_BLOCKMARKER_N(num)\n#define SCAN_BLOCKMARKER_MARK_N(num)\n#define SCAN_BLOCKMARKER_USE_N(num)\n#define SCAN_BLOCKMARKER_END_USE_N(num)\n\n#define SCAN_EHMARKER()\n#define SCAN_EHMARKER_TRY()\n#define SCAN_EHMARKER_END_TRY()\n#define SCAN_EHMARKER_CATCH()\n#define SCAN_EHMARKER_END_CATCH()\n\n#endif\n\n\n//\n// @todo remove this... if there really are cases where a function just shouldn't have a contract, then perhaps\n// we can add a more descriptive name for it...\n//\n#define CANNOT_HAVE_CONTRACT                __annotation(W(\"NO_CONTRACT\"))\n\n#endif // __STATIC_CONTRACT_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stdmacros.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//\n\n//\n// common.h - precompiled headers include for the COM+ Execution Engine\n//\n\n//\n// Make sure _ASSERTE is defined before including this header file\n// Other than that, please keep this header self-contained so that it can be included in\n//  all dlls\n//\n\n\n#ifndef _stdmacros_h_\n#define _stdmacros_h_\n\n#include \"specstrings.h\"\n#include \"contract.h\"\n\n#ifndef _ASSERTE\n#error Please define _ASSERTE before including StdMacros.h\n#endif\n\n#ifdef _DEBUG\n#define     DEBUG_ARG(x)  , x\n#define     DEBUG_ARG1(x)  x\n#else\n#define     DEBUG_ARG(x)\n#define     DEBUG_ARG1(x)\n#endif\n\n#ifdef DACCESS_COMPILE\n#define     DAC_ARG(x)  , x\n#else\n#define     DAC_ARG(x)\n#endif\n\n\n/********************************************/\n/*         Portability macros               */\n/********************************************/\n\n#ifdef TARGET_AMD64\n#define AMD64_FIRST_ARG(x)  x ,\n#define AMD64_ARG(x)        , x\n#define AMD64_ONLY(x)       x\n#define NOT_AMD64(x)\n#define NOT_AMD64_ARG(x)\n#else\n#define AMD64_FIRST_ARG(x)\n#define AMD64_ARG(x)\n#define AMD64_ONLY(x)\n#define NOT_AMD64(x)        x\n#define NOT_AMD64_ARG(x)    , x\n#endif\n\n#ifdef TARGET_X86\n#define X86_FIRST_ARG(x)    x ,\n#define X86_ARG(x)          , x\n#define X86_ONLY(x)         x\n#define NOT_X86(x)\n#define NOT_X86_ARG(x)\n#else\n#define X86_FIRST_ARG(x)\n#define X86_ARG(x)\n#define X86_ONLY(x)\n#define NOT_X86(x)          x\n#define NOT_X86_ARG(x)      , x\n#endif\n\n#ifdef HOST_64BIT\n#define BIT64_ARG(x)  , x\n#define BIT64_ONLY(x) x\n#define NOT_BIT64(x)\n#define NOT_BIT64_ARG(x)\n#else\n#define BIT64_ARG(x)\n#define BIT64_ONLY(x)\n#define NOT_BIT64(x)    x\n#define NOT_BIT64_ARG(x)    , x\n#endif // HOST_64BIT\n\n#ifdef TARGET_ARM\n#define ARM_FIRST_ARG(x)  x ,\n#define ARM_ARG(x)        , x\n#define ARM_ONLY(x)       x\n#define NOT_ARM(x)\n#define NOT_ARM_ARG(x)\n#else\n#define ARM_FIRST_ARG(x)\n#define ARM_ARG(x)\n#define ARM_ONLY(x)\n#define NOT_ARM(x)        x\n#define NOT_ARM_ARG(x)    , x\n#endif\n\n#ifdef TARGET_ARM64\n#define ARM64_FIRST_ARG(x)  x ,\n#define ARM64_ARG(x)        , x\n#define ARM64_ONLY(x)       x\n#define NOT_ARM64(x)\n#define NOT_ARM64_ARG(x)\n#else\n#define ARM64_FIRST_ARG(x)\n#define ARM64_ARG(x)\n#define ARM64_ONLY(x)\n#define NOT_ARM64(x)        x\n#define NOT_ARM64_ARG(x)    , x\n#endif\n\n#ifdef TARGET_LOONGARCH64\n#define LOONGARCH64_FIRST_ARG(x)  x ,\n#define LOONGARCH64_ARG(x)        , x\n#define LOONGARCH64_ONLY(x)       x\n#define NOT_LOONGARCH64(x)\n#define NOT_LOONGARCH64_ARG(x)\n#else\n#define LOONGARCH64_FIRST_ARG(x)\n#define LOONGARCH64_ARG(x)\n#define LOONGARCH64_ONLY(x)\n#define NOT_LOONGARCH64(x)        x\n#define NOT_LOONGARCH64_ARG(x)    , x\n#endif\n\n#ifdef TARGET_64BIT\n#define LOG2_PTRSIZE 3\n#else\n#define LOG2_PTRSIZE 2\n#endif\n\n#ifdef HOST_64BIT\n    #define INVALID_POINTER_CC 0xcccccccccccccccc\n    #define INVALID_POINTER_CD 0xcdcdcdcdcdcdcdcd\n    #define FMT_ADDR           \" %08x`%08x \"\n    #define LFMT_ADDR          W(\" %08x`%08x \")\n    #define DBG_ADDR(ptr)      (DWORD)(((UINT_PTR) (ptr)) >> 32), (DWORD)(((UINT_PTR) (ptr)) & 0xffffffff)\n#else // HOST_64BIT\n    #define INVALID_POINTER_CC 0xcccccccc\n    #define INVALID_POINTER_CD 0xcdcdcdcd\n    #define FMT_ADDR           \" %08x \"\n    #define LFMT_ADDR          W(\" %08x \")\n    #define DBG_ADDR(ptr)      (DWORD)((UINT_PTR)(ptr))\n#endif // HOST_64BIT\n\n#ifdef TARGET_ARM\n    #define ALIGN_ACCESS        ((1<<LOG2_PTRSIZE)-1)\n#endif\n\n\n#ifndef ALLOC_ALIGN_CONSTANT\n#define ALLOC_ALIGN_CONSTANT (sizeof(void*)-1)\n#endif\n\n\ninline void *GetTopMemoryAddress(void)\n{\n    WRAPPER_NO_CONTRACT;\n\n    static void *result; // = NULL;\n    if( NULL == result )\n    {\n        SYSTEM_INFO sysInfo;\n        GetSystemInfo( &sysInfo );\n        result = sysInfo.lpMaximumApplicationAddress;\n    }\n    return result;\n}\ninline void *GetBotMemoryAddress(void)\n{\n    WRAPPER_NO_CONTRACT;\n\n    static void *result; // = NULL;\n    if( NULL == result )\n    {\n        SYSTEM_INFO sysInfo;\n        GetSystemInfo( &sysInfo );\n        result = sysInfo.lpMinimumApplicationAddress;\n    }\n    return result;\n}\n\n#define TOP_MEMORY (GetTopMemoryAddress())\n#define BOT_MEMORY (GetBotMemoryAddress())\n\n\n//\n// This macro returns val rounded up as necessary to be a multiple of alignment; alignment must be a power of 2\n//\ninline size_t ALIGN_UP( size_t val, size_t alignment )\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    // alignment must be a power of 2 for this implementation to work (need modulo otherwise)\n    _ASSERTE( 0 == (alignment & (alignment - 1)) );\n    size_t result = (val + (alignment - 1)) & ~(alignment - 1);\n    _ASSERTE( result >= val );      // check for overflow\n    return result;\n}\n\ntemplate <typename T> inline T ALIGN_UP(T val, size_t alignment)\n{\n    WRAPPER_NO_CONTRACT;\n    return (T)ALIGN_UP((size_t)val, alignment);\n}\n\ninline size_t ALIGN_DOWN( size_t val, size_t alignment )\n{\n    LIMITED_METHOD_CONTRACT;\n\n    // alignment must be a power of 2 for this implementation to work (need modulo otherwise)\n    _ASSERTE( 0 == (alignment & (alignment - 1)) );\n    size_t result = val & ~(alignment - 1);\n    return result;\n}\ninline void* ALIGN_DOWN( void* val, size_t alignment )\n{\n    WRAPPER_NO_CONTRACT;\n    return (void*) ALIGN_DOWN( (size_t)val, alignment );\n}\ninline uint8_t* ALIGN_DOWN( uint8_t* val, size_t alignment )\n{\n    WRAPPER_NO_CONTRACT;\n    return (uint8_t*) ALIGN_DOWN( (size_t)val, alignment );\n}\n\ninline BOOL IS_ALIGNED( size_t val, size_t alignment )\n{\n    LIMITED_METHOD_CONTRACT;\n    SUPPORTS_DAC;\n\n    // alignment must be a power of 2 for this implementation to work (need modulo otherwise)\n    _ASSERTE( 0 == (alignment & (alignment - 1)) );\n    return 0 == (val & (alignment - 1));\n}\ninline BOOL IS_ALIGNED( const void* val, size_t alignment )\n{\n    WRAPPER_NO_CONTRACT;\n    return IS_ALIGNED( (size_t) val, alignment );\n}\n\n// Rounds a ULONG up to the nearest power of two number.\ninline ULONG RoundUpToPower2(ULONG x)\n{\n    if (x == 0) return 1;\n\n    x = x - 1;\n    x = x | (x >> 1);\n    x = x | (x >> 2);\n    x = x | (x >> 4);\n    x = x | (x >> 8);\n    x = x | (x >> 16);\n    return x + 1;\n}\n\n#ifdef ALIGN_ACCESS\n\n// NOTE: pSrc is evaluated three times!!!\n#define MAYBE_UNALIGNED_READ(pSrc, bits)        (IS_ALIGNED((size_t)(pSrc), sizeof(UINT##bits)) ? \\\n                                                    (*(UINT##bits*)      (pSrc)) : \\\n                                                    (GET_UNALIGNED_##bits(pSrc)) )\n\n#define MAYBE_UNALIGNED_WRITE(pDst, bits, expr) do { if (IS_ALIGNED((size_t)(pDst), sizeof(UINT##bits))) \\\n                                                    *(UINT##bits*)(pDst) = (UINT##bits)(expr); else \\\n                                                    SET_UNALIGNED_##bits(pDst, (UINT##bits)(expr)); } while (0)\n\n// these are necessary for MAYBE_UNALIGNED_XXX to work with UINT_PTR\n#define GET_UNALIGNED__PTR(x) GET_UNALIGNED_PTR(x)\n#define SET_UNALIGNED__PTR(p,x) SET_UNALIGNED_PTR(p,x)\n\n#else // ALIGN_ACCESS\n#define MAYBE_UNALIGNED_READ(pSrc, bits)        (*(UINT##bits*)(pSrc))\n#define MAYBE_UNALIGNED_WRITE(pDst, bits, expr) do { *(UINT##bits*)(pDst) = (UINT##bits)(expr); } while(0)\n#endif // ALIGN_ACCESS\n\n//\n// define some useful macros for logging object\n//\n\n#define FMT_OBJECT  \"object\" FMT_ADDR\n#define FMT_HANDLE  \"handle\" FMT_ADDR\n#define FMT_CLASS   \"%s\"\n#define FMT_REG     \"r%d \"\n#define FMT_STK     \"sp%s0x%02x \"\n#define FMT_PIPTR   \"%s%s pointer \"\n\n\n#define DBG_GET_CLASS_NAME(pMT)        \\\n        (((pMT) == NULL)  ? NULL : (pMT)->GetClass()->GetDebugClassName())\n\n#define DBG_CLASS_NAME_MT(pMT)         \\\n        (DBG_GET_CLASS_NAME(pMT) == NULL) ? \"<null-class>\" : DBG_GET_CLASS_NAME(pMT)\n\n#define DBG_GET_MT_FROM_OBJ(obj)       \\\n        (MethodTable*)((size_t)((Object*) (obj))->GetGCSafeMethodTable())\n\n#define DBG_CLASS_NAME_OBJ(obj)        \\\n        ((obj) == NULL)  ? \"null\" : DBG_CLASS_NAME_MT(DBG_GET_MT_FROM_OBJ(obj))\n\n#define DBG_CLASS_NAME_IPTR2(obj,iptr) \\\n        ((iptr) != 0)    ? \"\"     : DBG_CLASS_NAME_MT(DBG_GET_MT_FROM_OBJ(obj))\n\n#define DBG_CLASS_NAME_IPTR(obj,iptr)  \\\n        ((obj)  == NULL) ? \"null\" : DBG_CLASS_NAME_IPTR2(obj,iptr)\n\n#define DBG_STK(off)                   \\\n        (off >= 0) ? \"+\" : \"-\",        \\\n        (off >= 0) ? off : -off\n\n#define DBG_PIN_NAME(pin)              \\\n        (pin)  ? \"pinned \"  : \"\"\n\n#define DBG_IPTR_NAME(iptr)            \\\n        (iptr) ? \"interior\" : \"base\"\n\n#define LOG_HANDLE_OBJECT_CLASS(str1, hnd, str2, obj)    \\\n        str1 FMT_HANDLE str2 FMT_OBJECT FMT_CLASS \"\\n\",  \\\n        DBG_ADDR(hnd), DBG_ADDR(obj), DBG_CLASS_NAME_OBJ(obj)\n\n#define LOG_OBJECT_CLASS(obj)                            \\\n        FMT_OBJECT FMT_CLASS \"\\n\",                       \\\n        DBG_ADDR(obj), DBG_CLASS_NAME_OBJ(obj)\n\n#define LOG_PIPTR_OBJECT_CLASS(obj, pin, iptr)           \\\n        FMT_PIPTR FMT_ADDR FMT_CLASS \"\\n\",               \\\n        DBG_PIN_NAME(pin), DBG_IPTR_NAME(iptr),          \\\n        DBG_ADDR(obj), DBG_CLASS_NAME_IPTR(obj,iptr)\n\n#define LOG_HANDLE_OBJECT(str1, hnd, str2, obj)          \\\n        str1 FMT_HANDLE str2 FMT_OBJECT \"\\n\",            \\\n        DBG_ADDR(hnd), DBG_ADDR(obj)\n\n#define LOG_PIPTR_OBJECT(obj, pin, iptr)                 \\\n        FMT_PIPTR FMT_ADDR \"\\n\",                         \\\n        DBG_PIN_NAME(pin), DBG_IPTR_NAME(iptr),          \\\n        DBG_ADDR(obj)\n\n#define UNIQUE_LABEL_DEF(a,x)           a##x\n#define UNIQUE_LABEL_DEF_X(a,x)         UNIQUE_LABEL_DEF(a,x)\n#ifdef _MSC_VER\n#define UNIQUE_LABEL(a)                 UNIQUE_LABEL_DEF_X(_unique_label_##a##_, __COUNTER__)\n#else\n#define UNIQUE_LABEL(a)                 UNIQUE_LABEL_DEF_X(_unique_label_##a##_, __LINE__)\n#endif\n\n// This is temporary.  LKG should provide these macros and we should then\n// remove STRUNCATE and _TRUNCATE from here.\n\n/* error codes */\n#if !defined(STRUNCATE)\n#define STRUNCATE       80\n#endif\n\n/* _TRUNCATE */\n#if !defined(_TRUNCATE)\n#define _TRUNCATE ((size_t)-1)\n#endif\n\n#endif //_stdmacros_h_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stgpool.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// StgPool.h\n//\n\n//\n// Pools are used to reduce the amount of data actually required in the database.\n// This allows for duplicate string and binary values to be folded into one\n// copy shared by the rest of the database.  Strings are tracked in a hash\n// table when insert/changing data to find duplicates quickly.  The strings\n// are then persisted consecutively in a stream in the database format.\n//\n//*****************************************************************************\n\n#ifndef __StgPool_h__\n#define __StgPool_h__\n\n#ifdef _MSC_VER\n#pragma warning (disable : 4355)        // warning C4355: 'this' : used in base member initializer list\n#endif\n\n#include \"stgpooli.h\"                   // Internal helpers.\n#include \"corerror.h\"                   // Error codes.\n#include \"metamodelpub.h\"\n#include \"ex.h\"\n#include \"sarray.h\"\n#include \"memoryrange.h\"\n#include \"../md/datablob.h\"\n\n//*****************************************************************************\n// NOTE:\n// One limitation with the pools, we have no way to removing strings from\n// the pool.  To remove, you need to know the ref count on the string, and\n// need the ability to compact the pool and reset all references.\n//*****************************************************************************\n\n//********** Constants ********************************************************\nconst int DFT_STRING_HEAP_SIZE = 1024;\nconst int DFT_GUID_HEAP_SIZE = 32;\nconst int DFT_BLOB_HEAP_SIZE = 1024;\nconst int DFT_VARIANT_HEAP_SIZE = 512;\nconst int DFT_CODE_HEAP_SIZE = 8192;\n\n\n\n// Forwards.\nclass StgStringPool;\nclass StgBlobPool;\nclass StgCodePool;\n\n//  Perform binary search on index table.\n//\nclass RIDBinarySearch : public CBinarySearch<UINT32>\n{\npublic:\n    RIDBinarySearch(const UINT32 *pBase, int iCount) : CBinarySearch<UINT32>(pBase, iCount)\n    {\n        LIMITED_METHOD_CONTRACT;\n    } // RIDBinarySearch::RIDBinarySearch\n\n    int Compare(UINT32 const *pFirst, UINT32 const *pSecond)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        if (*pFirst < *pSecond)\n            return -1;\n\n        if (*pFirst > *pSecond)\n            return 1;\n\n        return 0;\n    } // RIDBinarySearch::Compare\n\n};  // class RIDBinarySearch\n\n//*****************************************************************************\n// This class provides common definitions for heap segments.  It is both the\n//  base class for the heap, and the class for heap extensions (additional\n//  memory that must be allocated to grow the heap).\n//*****************************************************************************\nclass StgPoolSeg\n{\n    friend class VerifyLayoutsMD;\npublic:\n    StgPoolSeg() :\n        m_pSegData((BYTE*)m_zeros),\n        m_pNextSeg(NULL),\n        m_cbSegSize(0),\n        m_cbSegNext(0)\n    {LIMITED_METHOD_CONTRACT;  }\n    ~StgPoolSeg()\n    { LIMITED_METHOD_CONTRACT; _ASSERTE(m_pSegData == m_zeros);_ASSERTE(m_pNextSeg == NULL); }\nprotected:\n    BYTE       *m_pSegData;     // Pointer to the data.\n    StgPoolSeg *m_pNextSeg;     // Pointer to next segment, or NULL.\n    // Size of the segment buffer. If this is last segment (code:m_pNextSeg is NULL), then it's the\n    // allocation size. If this is not the last segment, then this is shrunk to segment data size\n    // (code:m_cbSegNext).\n    ULONG       m_cbSegSize;\n    ULONG       m_cbSegNext;    // Offset of next available byte in segment.\n                                //  Segment relative.\n\n    friend class StgPool;\n    friend class StgStringPool;\n    friend class StgGuidPool;\n    friend class StgBlobPool;\n    friend class RecordPool;\n\npublic:\n    const BYTE *GetSegData() const { LIMITED_METHOD_CONTRACT; return m_pSegData; }\n    const StgPoolSeg* GetNextSeg() const { LIMITED_METHOD_CONTRACT; return m_pNextSeg; }\n    // Returns size of the segment. It can be bigger than the size of represented data by this segment if\n    // this is the last segment.\n    ULONG GetSegSize() const { LIMITED_METHOD_CONTRACT; return m_cbSegSize; }\n    // Returns size of represented data in this segment.\n    ULONG GetDataSize() const { LIMITED_METHOD_CONTRACT; return m_cbSegNext; }\n\n    static const BYTE m_zeros[64];          // array of zeros for \"0\" indices.\n                // The size should be at least maximum of all MD table record sizes\n                // (MD\\Runtime\\MDColumnDescriptors.cpp) which is currently 28 B.\n};  // class StgPoolSeg\n\nnamespace MetaData\n{\n    // Forward declarations\n    class StringHeapRO;\n    class StringHeapRW;\n    class BlobHeapRO;\n};  // namespace MetaData\n\n//\n//\n// StgPoolReadOnly\n//\n//\n//*****************************************************************************\n// This is the read only StgPool class\n//*****************************************************************************\nclass StgPoolReadOnly : public StgPoolSeg\n{\nfriend class CBlobPoolHash;\nfriend class MetaData::StringHeapRO;\nfriend class MetaData::StringHeapRW;\nfriend class MetaData::BlobHeapRO;\nfriend class VerifyLayoutsMD;\n\npublic:\n    StgPoolReadOnly()\n    { LIMITED_METHOD_CONTRACT; };\n\n    ~StgPoolReadOnly();\n\n\n//*****************************************************************************\n// Init the pool from existing data.\n//*****************************************************************************\n    __checkReturn\n    HRESULT InitOnMemReadOnly(                // Return code.\n        void        *pData,                    // Predefined data.\n        ULONG        iSize);                    // Size of data.\n\n//*****************************************************************************\n// Prepare to shut down or reinitialize.\n//*****************************************************************************\n    virtual    void Uninit();\n\n//*****************************************************************************\n// Return the size of the pool.\n//*****************************************************************************\n    virtual UINT32 GetPoolSize() const\n    { LIMITED_METHOD_CONTRACT; return m_cbSegSize; }\n\n//*****************************************************************************\n// Indicate if heap is empty.\n//*****************************************************************************\n    virtual int IsEmpty()                    // true if empty.\n    { LIMITED_METHOD_CONTRACT; _ASSERTE(!\"This implementation should never be called!!!\"); return FALSE; }\n\n//*****************************************************************************\n// true if the heap is read only.\n//*****************************************************************************\n    virtual int IsReadOnly() { LIMITED_METHOD_CONTRACT; return true ;};\n\n//*****************************************************************************\n// Is the given cookie a valid offset, index, etc?\n//*****************************************************************************\n    virtual int IsValidCookie(UINT32 nCookie)\n    { WRAPPER_NO_CONTRACT; return (IsValidOffset(nCookie)); }\n\n\n#ifdef _PREFAST_\n#pragma warning(push)\n#pragma warning(disable:6387) // Suppress PREFast warning: '*pszString' might be '0': this does not adhere to the specification for the function\n        // *pszString may be NULL only if method fails, but warning 6387 doesn't respect __success(SUCCEEDED(return)) which is part of HRESULT definition\n#endif\n//*****************************************************************************\n// Return a pointer to a null terminated string given an offset previously\n// handed out by AddString or FindString.\n//*****************************************************************************\n    __checkReturn\n    inline HRESULT GetString(\n                    UINT32  nIndex,\n        _Outptr_ LPCSTR *pszString)\n    {\n        HRESULT hr;\n\n        // Size of the data in the heap will be ignored, because we have verified during creation of the string\n        // heap (code:Initialize) and when adding new strings (e.g. code:AddString,\n        // code:AddTemporaryStringBuffer), that the heap is null-terminated, therefore we don't have to check it\n        // for each string in the heap\n        MetaData::DataBlob stringData;\n\n        // Get data from the heap (clears stringData on error)\n        IfFailGo(GetData(\n            nIndex,\n            &stringData));\n        _ASSERTE(hr == S_OK);\n        // Raw data are always at least 1 byte long, otherwise it would be invalid offset and hr != S_OK\n        PREFAST_ASSUME(stringData.GetDataPointer() != NULL);\n        // Fills output string\n        *pszString = reinterpret_cast<LPSTR>(stringData.GetDataPointer());\n        //_ASSERTE(stringData.GetSize() > strlen(*pszString));\n\n        return hr;\n    ErrExit:\n        // Clears output string on error\n        *pszString = NULL;\n\n        return hr;\n    }\n\n//*****************************************************************************\n// Return a pointer to a null terminated string given an offset previously\n// handed out by AddString or FindString. Only valid for use if the Storage pool is actually ReadOnly, and not derived\n//*****************************************************************************\n    __checkReturn\n    inline HRESULT GetStringReadOnly(\n                    UINT32  nIndex,\n        _Outptr_ LPCSTR *pszString)\n    {\n        HRESULT hr;\n\n        // Size of the data in the heap will be ignored, because we have verified during creation of the string\n        // heap (code:Initialize) and when adding new strings (e.g. code:AddString,\n        // code:AddTemporaryStringBuffer), that the heap is null-terminated, therefore we don't have to check it\n        // for each string in the heap\n        MetaData::DataBlob stringData;\n\n        // Get data from the heap (clears stringData on error)\n        IfFailGo(GetDataReadOnly(\n            nIndex,\n            &stringData));\n        _ASSERTE(hr == S_OK);\n        // Raw data are always at least 1 byte long, otherwise it would be invalid offset and hr != S_OK\n        PREFAST_ASSUME(stringData.GetDataPointer() != NULL);\n        // Fills output string\n        *pszString = reinterpret_cast<LPSTR>(stringData.GetDataPointer());\n        //_ASSERTE(stringData.GetSize() > strlen(*pszString));\n\n        return hr;\n    ErrExit:\n        // Clears output string on error\n        *pszString = NULL;\n\n        return hr;\n    }\n#ifdef _PREFAST_\n#pragma warning(pop)\n#endif\n\n//*****************************************************************************\n// Convert a string to UNICODE into the caller's buffer.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetStringW(                         // Return code.\n        ULONG                          iOffset,         // Offset of string in pool.\n        _Out_writes_(cchBuffer) LPWSTR szOut,           // Output buffer for string.\n        int                            cchBuffer);      // Size of output buffer.\n\n//*****************************************************************************\n// Copy a GUID into the caller's buffer.\n//*****************************************************************************\n    __checkReturn\n    HRESULT GetGuid(\n        UINT32           nIndex,        // 1-based index of Guid in pool.\n        GUID UNALIGNED **ppGuid)        // Output buffer for Guid.\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        HRESULT hr;\n        MetaData::DataBlob heapData;\n\n        if (nIndex == 0)\n        {\n            *ppGuid = (GUID *)m_zeros;\n            return S_OK;\n        }\n\n        S_UINT32 nOffset = S_UINT32(nIndex - 1) * S_UINT32(sizeof(GUID));\n        if (nOffset.IsOverflow() || !IsValidOffset(nOffset.Value()))\n        {\n            Debug_ReportError(\"Invalid index passed - integer overflow.\");\n            IfFailGo(CLDB_E_INDEX_NOTFOUND);\n        }\n        if (FAILED(GetData(nOffset.Value(), &heapData)))\n        {\n            if (nOffset.Value() == 0)\n            {\n                Debug_ReportError(\"Invalid index 0 passed.\");\n                IfFailGo(CLDB_E_INDEX_NOTFOUND);\n            }\n            Debug_ReportInternalError(\"Invalid index passed.\");\n            IfFailGo(CLDB_E_INTERNALERROR);\n        }\n        _ASSERTE(heapData.GetSize() >= sizeof(GUID));\n\n        *ppGuid = (GUID UNALIGNED *)heapData.GetDataPointer();\n        return S_OK;\n\n    ErrExit:\n        *ppGuid = (GUID *)m_zeros;\n        return hr;\n    } // StgPoolReadOnly::GetGuid\n\n//*****************************************************************************\n// Return a pointer to a null terminated blob given an offset previously\n// handed out by Addblob or Findblob.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetBlob(\n        UINT32              nOffset,    // Offset of blob in pool.\n        MetaData::DataBlob *pData);\n\nprotected:\n\n//*****************************************************************************\n// Check whether a given offset is valid in the pool.\n//*****************************************************************************\n    virtual int IsValidOffset(UINT32 nOffset)\n    {LIMITED_METHOD_CONTRACT;  return (nOffset == 0) || ((m_pSegData != m_zeros) && (nOffset < m_cbSegSize)); }\n\n//*****************************************************************************\n// Get a pointer to an offset within the heap.  Inline for base segment,\n//  helper for extension segments.\n//*****************************************************************************\n    __checkReturn\n    FORCEINLINE HRESULT GetDataReadOnly(UINT32 nOffset, __inout MetaData::DataBlob *pData)\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(IsReadOnly());\n\n        // If off the end of the heap, return the 'nul' item from the beginning.\n        if (nOffset >= m_cbSegSize)\n        {\n            Debug_ReportError(\"Invalid offset passed.\");\n            pData->Clear();\n            return CLDB_E_INDEX_NOTFOUND;\n        }\n\n\n        pData->Init(m_pSegData + nOffset, m_cbSegSize - nOffset);\n\n        return S_OK;\n    } // StgPoolReadOnly::GetDataReadOnly\n\n//*****************************************************************************\n// Get a pointer to an offset within the heap.  Inline for base segment,\n//  helper for extension segments.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetData(UINT32 nOffset, __inout MetaData::DataBlob *pData)\n    {\n        WRAPPER_NO_CONTRACT;\n        return GetDataReadOnly(nOffset, pData);\n    } // StgPoolReadOnly::GetData\n};  // class StgPoolReadOnly\n\n//\n//\n// StgBlobPoolReadOnly\n//\n//\n//*****************************************************************************\n// This is the read only StgBlobPool class\n//*****************************************************************************\nclass StgBlobPoolReadOnly : public StgPoolReadOnly\n{\npublic:\n//*****************************************************************************\n// Return a pointer to a null terminated blob given an offset\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetBlob(\n        UINT32              nOffset,    // Offset of blob in pool.\n        MetaData::DataBlob *pData);\n\nprotected:\n\n//*****************************************************************************\n// Check whether a given offset is valid in the pool.\n//*****************************************************************************\n    virtual int IsValidOffset(UINT32 nOffset)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        MetaData::DataBlob data;\n        return (StgBlobPoolReadOnly::GetBlob(nOffset, &data) == S_OK);\n    }\n\n};  // class StgBlobPoolReadOnly\n\n//\n//\n// StgPool\n//\n//\n\n//*****************************************************************************\n// This base class provides common pool management code, such as allocation\n// of dynamic memory.\n//*****************************************************************************\nclass StgPool : public StgPoolReadOnly\n{\nfriend class StgStringPool;\nfriend class StgBlobPool;\nfriend class RecordPool;\nfriend class CBlobPoolHash;\nfriend class VerifyLayoutsMD;\n\npublic:\n    StgPool(ULONG ulGrowInc=512, UINT32 nAlignment=4) :\n        m_ulGrowInc(ulGrowInc),\n        m_pCurSeg(this),\n        m_cbCurSegOffset(0),\n        m_bFree(true),\n        m_bReadOnly(false),\n        m_nVariableAlignmentMask(nAlignment-1),\n        m_cbStartOffsetOfEdit(0),\n        m_fValidOffsetOfEdit(0)\n    { LIMITED_METHOD_CONTRACT; }\n\n    virtual ~StgPool();\n\nprotected:\n    HRESULT Align(UINT32 nValue, UINT32 *pnAlignedValue) const\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        *pnAlignedValue = (nValue + m_nVariableAlignmentMask) & ~m_nVariableAlignmentMask;\n        if (*pnAlignedValue < nValue)\n        {\n            return COR_E_OVERFLOW;\n        }\n        return S_OK;\n    }\n\npublic:\n//*****************************************************************************\n// Init the pool for use.  This is called for the create empty case.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT InitNew(                 // Return code.\n        ULONG        cbSize=0,                // Estimated size.\n        ULONG        cItems=0);                // Estimated item count.\n\n//*****************************************************************************\n// Init the pool from existing data.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT InitOnMem(                // Return code.\n        void        *pData,                    // Predefined data.\n        ULONG        iSize,                    // Size of data.\n        int            bReadOnly);                // true if append is forbidden.\n\n//*****************************************************************************\n// Called when the pool must stop accessing memory passed to InitOnMem().\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT TakeOwnershipOfInitMem();\n\n//*****************************************************************************\n// Clear out this pool.  Cannot use until you call InitNew.\n//*****************************************************************************\n    virtual void Uninit();\n\n//*****************************************************************************\n// Called to copy the pool to writable memory, reset the r/o bit.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT ConvertToRW();\n\n//*****************************************************************************\n// Turn hashing off or on.  Implemented as required in subclass.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT SetHash(int bHash);\n\n//*****************************************************************************\n// Allocate memory if we don't have any, or grow what we have.  If successful,\n// then at least iRequired bytes will be allocated.\n//*****************************************************************************\n    bool Grow(                                // true if successful.\n        ULONG        iRequired);                // Min required bytes to allocate.\n\n//*****************************************************************************\n// Add a segment to the chain of segments.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT AddSegment(                // S_OK or error.\n        const void    *pData,                    // The data.\n        ULONG        cbData,                    // Size of the data.\n        bool        bCopy);                    // If true, make a copy of the data.\n\n//*****************************************************************************\n// Trim any empty final segment.\n//*****************************************************************************\n    void Trim();                            //\n\n//*****************************************************************************\n// Return the size in bytes of the persistent version of this pool.  If\n// PersistToStream were the next call, the amount of bytes written to pIStream\n// has to be same as the return value from this function.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetSaveSize(\n        UINT32 *pcbSaveSize) const\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        _ASSERTE(pcbSaveSize != NULL);\n        // Size is offset of last seg + size of last seg.\n        UINT32 cbSize = m_pCurSeg->m_cbSegNext + m_cbCurSegOffset;\n\n        if (FAILED(Align(cbSize, pcbSaveSize)))\n        {\n            *pcbSaveSize = 0;\n            Debug_ReportInternalError(\"Aligned size of string heap overflows - we should prevent creating such heaps.\");\n            return CLDB_E_INTERNALERROR;\n        }\n        return S_OK;\n    }\n\n//*****************************************************************************\n// Return the size in bytes of the edits contained in the persistent version of this pool.\n//*****************************************************************************\n    __checkReturn\n    HRESULT GetEditSaveSize(\n        UINT32 *pcbSaveSize) const  // Return save size of this pool.\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        _ASSERTE(pcbSaveSize != NULL);\n        UINT32 cbSize = 0;\n\n        if (HaveEdits())\n        {\n            // Size is offset of last seg + size of last seg.\n\n            // An offset of zero in the pool will give us a zero length blob. The first\n            // \"real\" user string is at offset 1. Wherever this delta gets applied, it will\n            // already have this zero length blob. Let's make sure we don't sent it another one.\n#ifdef _DEBUG\n            MetaData::DataBlob debug_data;\n            HRESULT hr = const_cast<StgPool *>(this)->GetData(0, &debug_data);\n            _ASSERTE(hr == S_OK);\n            _ASSERTE(debug_data.ContainsData(1));\n            _ASSERTE(*(debug_data.GetDataPointer()) == 0);\n#endif //_DEBUG\n            UINT32 nOffsetOfEdit = GetOffsetOfEdit();\n\n            if (nOffsetOfEdit == 0)\n                nOffsetOfEdit = 1;\n\n            cbSize = m_pCurSeg->m_cbSegNext + m_cbCurSegOffset - nOffsetOfEdit;\n        }\n\n        if (FAILED(Align(cbSize, pcbSaveSize)))\n        {\n            *pcbSaveSize = 0;\n            Debug_ReportInternalError(\"Aligned size of string heap overflows - we should prevent creating such heaps.\");\n            return CLDB_E_INTERNALERROR;\n        }\n        return S_OK;\n    } // StgPool::GetEditSaveSize\n\n//*****************************************************************************\n// The entire pool is written to the given stream. The stream is aligned\n// to a 4 byte boundary.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT PersistToStream(        // Return code.\n        IStream        *pIStream)                 // The stream to write to.\n        DAC_UNEXPECTED();\n\n//*****************************************************************************\n// A portion of the pool is written to the stream.  Must not be optimized.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT PersistPartialToStream(    // Return code.\n        IStream        *pIStream,                // The stream to write to.\n        ULONG        iOffset);                // Starting byte.\n\n//*****************************************************************************\n// Get the size of the data block obtained from the pool.\n// Needed for generic persisting of data blocks.\n// Override in concrete pool classes to return the correct size.\n//*****************************************************************************\n    virtual ULONG GetSizeOfData( void const * data )\n    {\n        LIMITED_METHOD_CONTRACT;\n        return 0;\n    }\n\n//*****************************************************************************\n// Return the size of the pool.\n//*****************************************************************************\n    virtual UINT32 GetPoolSize() const\n    {LIMITED_METHOD_CONTRACT;  return m_pCurSeg->m_cbSegNext + m_cbCurSegOffset; }\n\n//*****************************************************************************\n// Indicate if heap is empty.\n//*****************************************************************************\n    virtual int IsEmpty()                    // true if empty.\n    {LIMITED_METHOD_CONTRACT;  return (m_pSegData == m_zeros); }\n\n//*****************************************************************************\n// true if the heap is read only.\n//*****************************************************************************\n    int IsReadOnly()\n    {LIMITED_METHOD_CONTRACT;  return (m_bReadOnly == false); }\n\n//*****************************************************************************\n// Is the given cookie a valid offset, index, etc?\n//*****************************************************************************\n    virtual int IsValidCookie(UINT32 nCookie)\n    { WRAPPER_NO_CONTRACT; return (IsValidOffset(nCookie)); }\n\n//*****************************************************************************\n// Get a pointer to an offset within the heap.  Inline for base segment,\n//  helper for extension segments.\n//*****************************************************************************\n    __checkReturn\n    FORCEINLINE HRESULT GetData(UINT32 nOffset, MetaData::DataBlob *pData)\n    {\n        WRAPPER_NO_CONTRACT;\n        if (nOffset < m_cbSegNext)\n        {\n            pData->Init(m_pSegData + nOffset, m_cbSegNext - nOffset);\n            return S_OK;\n        }\n        else\n        {\n            return GetData_i(nOffset, pData);\n        }\n    } // StgPool::GetData\n\n    // Copies data from pSourcePool starting at index nStartSourceIndex.\n    __checkReturn\n    HRESULT CopyPool(\n        UINT32         nStartSourceIndex,\n        const StgPool *pSourcePool);\n\n//*****************************************************************************\n// Copies data from the pool into a buffer. It will correctly walk the different\n// segments for the copy\n//*****************************************************************************\nprivate:\n    __checkReturn\n    HRESULT CopyData(\n        UINT32  nOffset,\n        BYTE   *pBuffer,\n        UINT32  cbBuffer,\n        UINT32 *pcbWritten) const;\n\npublic:\n//*****************************************************************************\n// Helpers for dump utilities.\n//*****************************************************************************\n    UINT32 GetRawSize() const\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        // Size is offset of last seg + size of last seg.\n        return m_pCurSeg->m_cbSegNext + m_cbCurSegOffset;\n    }\n\n    BOOL HaveEdits() const {LIMITED_METHOD_CONTRACT; return m_fValidOffsetOfEdit;}\n    UINT32 GetOffsetOfEdit() const {LIMITED_METHOD_CONTRACT; return m_cbStartOffsetOfEdit;}\n    void ResetOffsetOfEdit() {LIMITED_METHOD_CONTRACT; m_fValidOffsetOfEdit=FALSE;}\n\nprotected:\n\n//*****************************************************************************\n// Check whether a given offset is valid in the pool.\n//*****************************************************************************\n    virtual int IsValidOffset(UINT32 nOffset)\n    { WRAPPER_NO_CONTRACT; return (nOffset == 0) || ((m_pSegData != m_zeros) && (nOffset < GetNextOffset())); }\n\n    // Following virtual because a) this header included outside the project, and\n    //  non-virtual function call (in non-expanded inline function!!) generates\n    //  an external def, which causes linkage errors.\n    __checkReturn\n    virtual HRESULT GetData_i(UINT32 nOffset, MetaData::DataBlob *pData);\n\n    // Get pointer to next location to which to write.\n    BYTE *GetNextLocation()\n    {LIMITED_METHOD_CONTRACT;  return (m_pCurSeg->m_pSegData + m_pCurSeg->m_cbSegNext); }\n\n    // Get pool-relative offset of next location to which to write.\n    ULONG GetNextOffset()\n    {LIMITED_METHOD_CONTRACT;  return (m_cbCurSegOffset + m_pCurSeg->m_cbSegNext); }\n\n    // Get count of bytes available in tail segment of pool.\n    ULONG GetCbSegAvailable()\n    {LIMITED_METHOD_CONTRACT;  return (m_pCurSeg->m_cbSegSize - m_pCurSeg->m_cbSegNext); }\n\n    // Allocate space from the segment.\n\n    void SegAllocate(ULONG cb)\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(cb <= GetCbSegAvailable());\n\n        if (!m_fValidOffsetOfEdit)\n        {\n            m_cbStartOffsetOfEdit = GetNextOffset();\n            m_fValidOffsetOfEdit = TRUE;\n        }\n\n        m_pCurSeg->m_cbSegNext += cb;\n    }// SegAllocate\n\n\n\n    ULONG        m_ulGrowInc;                // How many bytes at a time.\n    StgPoolSeg    *m_pCurSeg;                    // Current seg for append -- end of chain.\n    ULONG       m_cbCurSegOffset;           // Base offset of current seg.\n\n    unsigned    m_bFree        : 1;            // True if we should free base data.\n                                            //  Extension data is always freed.\n    unsigned    m_bReadOnly    : 1;            // True if we shouldn't append.\n\n    UINT32 m_nVariableAlignmentMask;    // Alignment mask (variable 0, 1 or 3).\n    UINT32 m_cbStartOffsetOfEdit;       // Place in the pool where edits started\n    BOOL   m_fValidOffsetOfEdit;        // Is the pool edit offset valid\n\n};\n\n\n//\n//\n// StgStringPool\n//\n//\n\n\n\n//*****************************************************************************\n// This string pool class collects user strings into a big consecutive heap.\n// Internally it manages this data in a hash table at run time to help throw\n// out duplicates.  The list of strings is kept in memory while adding, and\n// finally flushed to a stream at the caller's request.\n//*****************************************************************************\nclass StgStringPool : public StgPool\n{\n    friend class VerifyLayoutsMD;\npublic:\n    StgStringPool() :\n        StgPool(DFT_STRING_HEAP_SIZE),\n        m_Hash(this),\n        m_bHash(true)\n    {\n        LIMITED_METHOD_CONTRACT;\n        // force some code in debug.\n        _ASSERTE(m_bHash);\n    }\n\n//*****************************************************************************\n// Create a new, empty string pool.\n//*****************************************************************************\n    __checkReturn\n    HRESULT InitNew(                         // Return code.\n        ULONG        cbSize=0,                // Estimated size.\n        ULONG        cItems=0);                // Estimated item count.\n\n//*****************************************************************************\n// Load a string heap from persisted memory.  If a copy of the data is made\n// (so that it may be updated), then a new hash table is generated which can\n// be used to eliminate duplicates with new strings.\n//*****************************************************************************\n    __checkReturn\n    HRESULT InitOnMem(                        // Return code.\n        void        *pData,                    // Predefined data.\n        ULONG        iSize,                    // Size of data.\n        int            bReadOnly);                // true if append is forbidden.\n\n//*****************************************************************************\n// Clears the hash table then calls the base class.\n//*****************************************************************************\n    void Uninit();\n\n//*****************************************************************************\n// Turn hashing off or on.  If you turn hashing on, then any existing data is\n// thrown away and all data is rehashed during this call.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT SetHash(int bHash);\n\n//*****************************************************************************\n// The string will be added to the pool.  The offset of the string in the pool\n// is returned in *piOffset.  If the string is already in the pool, then the\n// offset will be to the existing copy of the string.\n//\n// The first version essentially adds a zero-terminated sequence of bytes\n//  to the pool.  MBCS pairs will not be converted to the appropriate UTF8\n//  sequence.  The second version converts from Unicode.\n//*****************************************************************************\n    __checkReturn\n    HRESULT AddString(\n        LPCSTR  szString,       // The string to add to pool.\n        UINT32 *pnOffset);      // Return offset of string here.\n\n    __checkReturn\n    HRESULT AddStringW(\n        LPCWSTR szString,       // The string to add to pool.\n        UINT32 *pnOffset);      // Return offset of string here.\n\n//*****************************************************************************\n// Look for the string and return its offset if found.\n//*****************************************************************************\n    __checkReturn\n    HRESULT FindString(                        // S_OK, S_FALSE.\n        LPCSTR        szString,                // The string to find in pool.\n        ULONG        *piOffset)                // Return offset of string here.\n    {\n        WRAPPER_NO_CONTRACT;\n\n        STRINGHASH    *pHash;                    // Hash item for lookup.\n        if ((pHash = m_Hash.Find(szString)) == 0)\n            return (S_FALSE);\n        *piOffset = pHash->iOffset;\n        return (S_OK);\n    }\n\n//*****************************************************************************\n// How many objects are there in the pool?  If the count is 0, you don't need\n// to persist anything at all to disk.\n//*****************************************************************************\n    int Count()\n    {\n        WRAPPER_NO_CONTRACT;\n        _ASSERTE(m_bHash);\n        return (m_Hash.Count()); }\n\n//*****************************************************************************\n// String heap is considered empty if the only thing it has is the initial\n// empty string, or if after organization, there are no strings.\n//*****************************************************************************\n    int IsEmpty()                        // true if empty.\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return (GetNextOffset() <= 1);\n    }\n\n//*****************************************************************************\n// Return the size in bytes of the persistent version of this pool.  If\n// PersistToStream were the next call, the amount of bytes written to pIStream\n// has to be same as the return value from this function.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetSaveSize(\n        UINT32 *pcbSaveSize) const\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        _ASSERTE(pcbSaveSize != NULL);\n\n        // Size is offset of last seg + size of last seg.\n        S_UINT32 cbSize = S_UINT32(m_pCurSeg->m_cbSegNext + m_cbCurSegOffset);\n\n        cbSize.AlignUp(4);\n\n        if (cbSize.IsOverflow())\n        {\n            *pcbSaveSize = 0;\n            Debug_ReportInternalError(\"Aligned size of string heap overflows - we should prevent creating such heaps.\");\n            return CLDB_E_INTERNALERROR;\n        }\n        *pcbSaveSize = cbSize.Value();\n        return S_OK;\n    }\n\n//*****************************************************************************\n// Get the size of the string obtained from the pool.\n// Needed for generic persisting of data blocks.\n//*****************************************************************************\n    virtual ULONG GetSizeOfData( void const * data )\n    {\n        LIMITED_METHOD_CONTRACT;\n        return ULONG( strlen( reinterpret_cast< LPCSTR >( data ) ) + 1 ); // using strlen since the string is UTF8\n    }\n\nprivate:\n    __checkReturn\n    HRESULT RehashStrings();\n\nprivate:\n    CStringPoolHash m_Hash;                    // Hash table for lookups.\n    int            m_bHash;                    // true to keep hash table.\n};  // class StgStringPool\n\n//\n//\n// StgGuidPool\n//\n//\n\n//*****************************************************************************\n// This Guid pool class collects user Guids into a big consecutive heap.\n// Internally it manages this data in a hash table at run time to help throw\n// out duplicates.  The list of Guids is kept in memory while adding, and\n// finally flushed to a stream at the caller's request.\n//*****************************************************************************\nclass StgGuidPool : public StgPool\n{\n    friend class VerifyLayoutsMD;\npublic:\n    StgGuidPool() :\n        StgPool(DFT_GUID_HEAP_SIZE),\n        m_Hash(this),\n        m_bHash(true)\n    { LIMITED_METHOD_CONTRACT; }\n\n//*****************************************************************************\n// Init the pool for use.  This is called for the create empty case.\n//*****************************************************************************\n    __checkReturn\n    HRESULT InitNew(                         // Return code.\n        ULONG        cbSize=0,                // Estimated size.\n        ULONG        cItems=0);                // Estimated item count.\n\n//*****************************************************************************\n// Load a Guid heap from persisted memory.  If a copy of the data is made\n// (so that it may be updated), then a new hash table is generated which can\n// be used to eliminate duplicates with new Guids.\n//*****************************************************************************\n    __checkReturn\n    HRESULT InitOnMem(                      // Return code.\n        void        *pData,                    // Predefined data.\n        ULONG        iSize,                    // Size of data.\n        int         bReadOnly);             // true if append is forbidden.\n\n//*****************************************************************************\n// Clears the hash table then calls the base class.\n//*****************************************************************************\n    void Uninit();\n\n//*****************************************************************************\n// Add a segment to the chain of segments.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT AddSegment(                // S_OK or error.\n        const void    *pData,                    // The data.\n        ULONG        cbData,                    // Size of the data.\n        bool        bCopy);                    // If true, make a copy of the data.\n\n//*****************************************************************************\n// Turn hashing off or on.  If you turn hashing on, then any existing data is\n// thrown away and all data is rehashed during this call.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT SetHash(int bHash);\n\n//*****************************************************************************\n// The Guid will be added to the pool.  The index of the Guid in the pool\n// is returned in *piIndex.  If the Guid is already in the pool, then the\n// index will be to the existing copy of the Guid.\n//*****************************************************************************\n    __checkReturn\n    HRESULT AddGuid(\n        const GUID *pGuid,          // The Guid to add to pool.\n        UINT32     *pnIndex);       // Return index of Guid here.\n\n//*****************************************************************************\n// Get the size of the GUID obtained from the pool.\n// Needed for generic persisting of data blocks.\n//*****************************************************************************\n    virtual ULONG GetSizeOfData( void const * data )\n    {\n        LIMITED_METHOD_CONTRACT;\n        return sizeof( GUID );\n    }\n\n//*****************************************************************************\n// How many objects are there in the pool?  If the count is 0, you don't need\n// to persist anything at all to disk.\n//*****************************************************************************\n    int Count()\n    {\n      WRAPPER_NO_CONTRACT;\n      _ASSERTE(m_bHash);\n        return (m_Hash.Count()); }\n\n//*****************************************************************************\n// Indicate if heap is empty.  This has to be based on the size of the data\n// we are keeping.  If you open in r/o mode on memory, there is no hash\n// table.\n//*****************************************************************************\n    virtual int IsEmpty()                    // true if empty.\n    {\n        WRAPPER_NO_CONTRACT;\n\n        return (GetNextOffset() == 0);\n    }\n\n//*****************************************************************************\n// Is the index valid for the GUID?\n//*****************************************************************************\n    virtual int IsValidCookie(UINT32 nCookie)\n    { WRAPPER_NO_CONTRACT; return ((nCookie == 0) || IsValidOffset((nCookie - 1) * sizeof(GUID))); }\n\n//*****************************************************************************\n// Return the size of the heap.\n//*****************************************************************************\n    ULONG GetNextIndex()\n    { LIMITED_METHOD_CONTRACT; return (GetNextOffset() / sizeof(GUID)); }\n\n//*****************************************************************************\n// Return the size in bytes of the persistent version of this pool.  If\n// PersistToStream were the next call, the amount of bytes written to pIStream\n// has to be same as the return value from this function.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetSaveSize(\n        UINT32 *pcbSaveSize) const\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        _ASSERTE(pcbSaveSize != NULL);\n\n        // Size is offset of last seg + size of last seg.\n        *pcbSaveSize = m_pCurSeg->m_cbSegNext + m_cbCurSegOffset;\n\n        // Should be aligned.\n        _ASSERTE(*pcbSaveSize == ALIGN4BYTE(*pcbSaveSize));\n        return S_OK;\n    }\n\nprivate:\n\n    __checkReturn\n    HRESULT RehashGuids();\n\n\nprivate:\n    DAC_ALIGNAS(StgPool) // Align first member to alignment of base class\n    CGuidPoolHash m_Hash;                    // Hash table for lookups.\n    int            m_bHash;                    // true to keep hash table.\n};  // class StgGuidPool\n\n//\n//\n// StgBlobPool\n//\n//\n\n//*****************************************************************************\n// Just like the string pool, this pool manages a list of items, throws out\n// duplicates using a hash table, and can be persisted to a stream.  The only\n// difference is that instead of saving null terminated strings, this code\n// manages binary values of up to 64K in size.  Any data you have larger than\n// this should be stored someplace else with a pointer in the record to the\n// external source.\n//*****************************************************************************\nclass StgBlobPool : public StgPool\n{\n    friend class VerifyLayoutsMD;\n\n    using StgPool::InitNew;\n    using StgPool::InitOnMem;\n\npublic:\n    StgBlobPool(ULONG ulGrowInc=DFT_BLOB_HEAP_SIZE) :\n        StgPool(ulGrowInc),\n        m_Hash(this)\n    { LIMITED_METHOD_CONTRACT; }\n\n//*****************************************************************************\n// Init the pool for use.  This is called for the create empty case.\n//*****************************************************************************\n    __checkReturn\n    HRESULT InitNew(                         // Return code.\n        ULONG        cbSize=0,                // Estimated size.\n        ULONG        cItems=0,               // Estimated item count.\n        BOOL        fAddEmptryItem=TRUE);        // Should we add an empty item at offset 0\n\n//*****************************************************************************\n// Init the blob pool for use.  This is called for both create and read case.\n// If there is existing data and bCopyData is true, then the data is rehashed\n// to eliminate dupes in future adds.\n//*****************************************************************************\n    __checkReturn\n    HRESULT InitOnMem(                      // Return code.\n        void        *pData,                    // Predefined data.\n        ULONG        iSize,                    // Size of data.\n        int         bReadOnly);             // true if append is forbidden.\n\n//*****************************************************************************\n// Clears the hash table then calls the base class.\n//*****************************************************************************\n    void Uninit();\n\n//*****************************************************************************\n// The blob will be added to the pool.  The offset of the blob in the pool\n// is returned in *piOffset.  If the blob is already in the pool, then the\n// offset will be to the existing copy of the blob.\n//*****************************************************************************\n    __checkReturn\n    HRESULT AddBlob(\n        const MetaData::DataBlob *pData,\n        UINT32                   *pnOffset);\n\n//*****************************************************************************\n// Return a pointer to a null terminated blob given an offset previously\n// handed out by Addblob or Findblob.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetBlob(\n        UINT32              nOffset,    // Offset of blob in pool.\n        MetaData::DataBlob *pData);\n\n    __checkReturn\n    HRESULT GetBlobWithSizePrefix(\n        UINT32              nOffset,    // Offset of blob in pool.\n        MetaData::DataBlob *pData);\n\n//*****************************************************************************\n// Turn hashing off or on.  If you turn hashing on, then any existing data is\n// thrown away and all data is rehashed during this call.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT SetHash(int bHash);\n\n//*****************************************************************************\n// Get the size of the blob obtained from the pool.\n// Needed for generic persisting of data blocks.\n//*****************************************************************************\n    virtual ULONG GetSizeOfData( void const * data )\n    {\n        WRAPPER_NO_CONTRACT;\n\n        void const * blobdata = 0;\n        ULONG blobsize = CPackedLen::GetLength( data, & blobdata ); // the size is encoded at the beginning of the block\n        return blobsize + static_cast< ULONG >( reinterpret_cast< BYTE const * >( blobdata ) - reinterpret_cast< BYTE const * >( data ) );\n    }\n\n//*****************************************************************************\n// How many objects are there in the pool?  If the count is 0, you don't need\n// to persist anything at all to disk.\n//*****************************************************************************\n    int Count()\n    { WRAPPER_NO_CONTRACT; return (m_Hash.Count()); }\n\n//*****************************************************************************\n// String heap is considered empty if the only thing it has is the initial\n// empty string, or if after organization, there are no strings.\n//*****************************************************************************\n    virtual int IsEmpty()                    // true if empty.\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        return (GetNextOffset() <= 1);\n    }\n\n//*****************************************************************************\n// Return the size in bytes of the persistent version of this pool.  If\n// PersistToStream were the next call, the amount of bytes written to pIStream\n// has to be same as the return value from this function.\n//*****************************************************************************\n    __checkReturn\n    virtual HRESULT GetSaveSize(\n        UINT32 *pcbSaveSize) const\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        return StgPool::GetSaveSize(pcbSaveSize);\n    }\n\nprotected:\n\n//*****************************************************************************\n// Check whether a given offset is valid in the pool.\n//*****************************************************************************\n    virtual int IsValidOffset(UINT32 nOffset)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        MetaData::DataBlob data;\n        return (StgBlobPool::GetBlob(nOffset, &data) == S_OK);\n    }\n\nprivate:\n    __checkReturn\n    HRESULT RehashBlobs();\n\n    DAC_ALIGNAS(StgPool) // Align first member to alignment of base class\n    CBlobPoolHash m_Hash;                    // Hash table for lookups.\n};  // class StgBlobPool\n\n#ifdef _MSC_VER\n#pragma warning (default : 4355)\n#endif\n\n//*****************************************************************************\n// Unfortunately the CreateStreamOnHGlobal is a little too smart in that\n// it gets its size from GlobalSize.  This means that even if you give it the\n// memory for the stream, it has to be globally allocated.  We don't want this\n// because we have the stream read only in the middle of a memory mapped file.\n// CreateStreamOnMemory and the corresponding, internal only stream object solves\n// that problem.\n//*****************************************************************************\nclass CInMemoryStream : public IStream\n{\npublic:\n    CInMemoryStream() :\n        m_pMem(0),\n        m_cbSize(0),\n        m_cbCurrent(0),\n        m_cRef(1),\n        m_dataCopy(NULL)\n    { LIMITED_METHOD_CONTRACT; }\n\n    virtual ~CInMemoryStream() {}\n\n    void InitNew(\n        void        *pMem,\n        ULONG       cbSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_pMem = pMem;\n        m_cbSize = cbSize;\n        m_cbCurrent = 0;\n    }\n\n    ULONG STDMETHODCALLTYPE AddRef() {\n        LIMITED_METHOD_CONTRACT;\n        return InterlockedIncrement(&m_cRef);\n    }\n\n\n    ULONG STDMETHODCALLTYPE Release();\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppOut);\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE Read(void *pv, ULONG cb, ULONG *pcbRead);\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE Write(const void  *pv, ULONG cb, ULONG *pcbWritten);\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove,DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition);\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FAULT; //E_OUTOFMEMORY;\n\n        return (BadError(E_NOTIMPL));\n    }\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE CopyTo(\n        IStream     *pstm,\n        ULARGE_INTEGER cb,\n        ULARGE_INTEGER *pcbRead,\n        ULARGE_INTEGER *pcbWritten);\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE Commit(\n        DWORD       grfCommitFlags)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FAULT; //E_OUTOFMEMORY;\n\n        return (BadError(E_NOTIMPL));\n    }\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE Revert()\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FAULT; //E_OUTOFMEMORY;\n\n        return (BadError(E_NOTIMPL));\n    }\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE LockRegion(\n        ULARGE_INTEGER libOffset,\n        ULARGE_INTEGER cb,\n        DWORD       dwLockType)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FAULT; //E_OUTOFMEMORY;\n\n        return (BadError(E_NOTIMPL));\n    }\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE UnlockRegion(\n        ULARGE_INTEGER libOffset,\n        ULARGE_INTEGER cb,\n        DWORD       dwLockType)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FAULT; //E_OUTOFMEMORY;\n\n        return (BadError(E_NOTIMPL));\n    }\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE Stat(\n        STATSTG     *pstatstg,\n        DWORD       grfStatFlag)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FAULT; //E_OUTOFMEMORY;\n\n        pstatstg->cbSize.QuadPart = m_cbSize;\n        return (S_OK);\n    }\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE Clone(\n        IStream     **ppstm)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_FAULT; //E_OUTOFMEMORY;\n\n        return (BadError(E_NOTIMPL));\n    }\n\n    __checkReturn\n    static HRESULT CreateStreamOnMemory(           // Return code.\n                                 void        *pMem,                  // Memory to create stream on.\n                                 ULONG       cbSize,                 // Size of data.\n                                 IStream     **ppIStream,            // Return stream object here.\n                                 BOOL        fDeleteMemoryOnRelease = FALSE\n                                 );\n\n    __checkReturn\n    static HRESULT CreateStreamOnMemoryCopy(\n                                 void        *pMem,\n                                 ULONG       cbSize,\n                                 IStream     **ppIStream);\n\nprivate:\n    void        *m_pMem;                // Memory for the read.\n    ULONG       m_cbSize;               // Size of the memory.\n    ULONG       m_cbCurrent;            // Current offset.\n    LONG        m_cRef;                 // Ref count.\n    BYTE       *m_dataCopy;             // Optional copy of the data.\n};  // class CInMemoryStream\n\n//*****************************************************************************\n// CGrowableStream is a simple IStream implementation that grows as\n// its written to. All the memory is contiguous, so read access is\n// fast. A grow does a realloc, so be aware of that if you're going to\n// use this.\n//*****************************************************************************\n\n// DPTR instead of VPTR because we don't actually call any of the virtuals.\ntypedef DPTR(class CGrowableStream) PTR_CGrowableStream;\n\nclass CGrowableStream : public IStream\n{\npublic:\n    //Constructs a new GrowableStream\n    // multiplicativeGrowthRate - when the stream grows it will be at least this\n    //   multiple of its old size. Values greater than 1 ensure O(N) amortized\n    //   performance growing the stream to size N, 1 ensures O(N^2) amortized perf\n    //   but gives the tightest memory usage. Valid range is [1.0, 2.0].\n    // additiveGrowthRate - when the stream grows it will increase in size by at least\n    //   this number of bytes. Larger numbers cause fewer re-allocations at the cost of\n    //   increased memory usage.\n    CGrowableStream(float multiplicativeGrowthRate = 2.0, DWORD additiveGrowthRate = 4096);\n\n#ifndef DACCESS_COMPILE\n    virtual ~CGrowableStream();\n#endif\n\n    // Expose the total raw buffer.\n    // This can be used by DAC to get the raw contents.\n    // This becomes potentiallyinvalid on the next call on the class, because the underlying storage can be\n    // reallocated.\n    MemoryRange GetRawBuffer() const\n    {\n        SUPPORTS_DAC;\n        PTR_VOID p = m_swBuffer;\n        return MemoryRange(p, m_dwBufferSize);\n    }\n\nprivate:\n    // Raw pointer to buffer. This may change as the buffer grows and gets reallocated.\n    PTR_BYTE  m_swBuffer;\n\n    // Total size of the buffer in bytes.\n    DWORD   m_dwBufferSize;\n\n    // Current index in the buffer. This can be moved around by Seek.\n    DWORD   m_dwBufferIndex;\n\n    // Logical length of the stream\n    DWORD   m_dwStreamLength;\n\n    // Reference count\n    LONG    m_cRef;\n\n    // growth rate parameters determine new stream size when it must grow\n    float   m_multiplicativeGrowthRate;\n    int     m_additiveGrowthRate;\n\n    // Ensures the stream is physically and logically at least newLogicalSize\n    // in size\n    HRESULT EnsureCapacity(DWORD newLogicalSize);\n\n    // IStream methods\npublic:\n\n#ifndef DACCESS_COMPILE\n    ULONG STDMETHODCALLTYPE AddRef() {\n        LIMITED_METHOD_CONTRACT;\n        return InterlockedIncrement(&m_cRef);\n    }\n\n\n    ULONG STDMETHODCALLTYPE Release();\n\n    __checkReturn\n    HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *ppOut);\n\n    STDMETHOD(Read)(\n         void * pv,\n         ULONG cb,\n         ULONG * pcbRead);\n\n    STDMETHOD(Write)(\n         const void * pv,\n         ULONG cb,\n         ULONG * pcbWritten);\n\n    STDMETHOD(Seek)(\n         LARGE_INTEGER dlibMove,\n         DWORD dwOrigin,\n         ULARGE_INTEGER * plibNewPosition);\n\n    STDMETHOD(SetSize)(ULARGE_INTEGER libNewSize);\n\n    STDMETHOD(CopyTo)(\n         IStream * pstm,\n         ULARGE_INTEGER cb,\n         ULARGE_INTEGER * pcbRead,\n         ULARGE_INTEGER * pcbWritten) { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_FAULT; return E_NOTIMPL; }\n\n    STDMETHOD(Commit)(\n         DWORD grfCommitFlags) { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_FAULT; return NOERROR; }\n\n    STDMETHOD(Revert)( void) {STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_FAULT;  return E_NOTIMPL; }\n\n    STDMETHOD(LockRegion)(\n         ULARGE_INTEGER libOffset,\n         ULARGE_INTEGER cb,\n         DWORD dwLockType) { STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_FAULT; return E_NOTIMPL; }\n\n    STDMETHOD(UnlockRegion)(\n         ULARGE_INTEGER libOffset,\n         ULARGE_INTEGER cb,\n         DWORD dwLockType) {STATIC_CONTRACT_NOTHROW; STATIC_CONTRACT_FAULT;   return E_NOTIMPL; }\n\n    STDMETHOD(Stat)(\n         STATSTG * pstatstg,\n         DWORD grfStatFlag);\n\n    // Make a deep copy of the stream into a new CGrowableStream instance\n    STDMETHOD(Clone)(\n         IStream ** ppstm);\n\n#endif // DACCESS_COMPILE\n}; // class CGrowableStream\n\n#endif // __StgPool_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stgpooli.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// StgPooli.h\n//\n\n//\n// This is helper code for the string and blob pools.  It is here because it is\n// secondary to the pooling interface and reduces clutter in the main file.\n//\n//*****************************************************************************\n\n#ifndef __StgPooli_h__\n#define __StgPooli_h__\n\n#include \"utilcode.h\"                   // Base hashing code.\n\n\n\n//\n//\n// CPackedLen\n//\n//\n\n//*****************************************************************************\n// Helper class to pack and unpack lengths.\n//*****************************************************************************\nstruct CPackedLen\n{\n    enum {MAX_LEN = 0x1fffffff};\n    static int Size(ULONG len)\n    {\n                LIMITED_METHOD_CONTRACT;\n        // Smallest.\n        if (len <= 0x7F)\n            return 1;\n        // Medium.\n        if (len <= 0x3FFF)\n            return 2;\n        // Large (too large?).\n        _ASSERTE(len <= MAX_LEN);\n        return 4;\n    }\n\n    // Get a pointer to the data, and store the length.\n    static void const *GetData(void const *pData, ULONG *pLength);\n\n    // Get the length value encoded at *pData.  Update ppData to point past data.\n    static ULONG GetLength(void const *pData, void const **ppData=0);\n\n    // Get the length value encoded at *pData, and the size of that encoded value.\n    static ULONG GetLength(void const *pData, int *pSizeOfLength);\n\n    // Pack a length at *pData; return a pointer to the next byte.\n    static void* PutLength(void *pData, ULONG len);\n\n    // This is used for just getting an encoded length, and verifies that\n    // there is no buffer or integer overflow.\n    static HRESULT SafeGetLength(       // S_OK, or error\n        void const  *pDataSource,       // First byte of length.\n        void const  *pDataSourceEnd,    // End of valid source data memory\n        ULONG       *pLength,           // Encoded value\n        void const **ppDataNext);       // Pointer immediately following encoded length\n\n    static HRESULT SafeGetLength(       // S_OK, or error\n        BYTE const  *pDataSource,       // First byte of length.\n        BYTE const  *pDataSourceEnd,    // End of valid source data memory\n        ULONG       *pLength,           // Encoded value\n        BYTE const **ppDataNext)        // Pointer immediately following encoded length\n    {\n        return SafeGetLength(\n            reinterpret_cast<void const *>(pDataSource),\n            reinterpret_cast<void const *>(pDataSourceEnd),\n            pLength,\n            reinterpret_cast<void const **>(ppDataNext));\n    }\n\n    // This performs the same tasks as GetLength above in addition to checking\n    // that the value in *pcbData does not extend *ppData beyond pDataSourceEnd\n    // and does not cause an integer overflow.\n    static HRESULT SafeGetData(\n        void const  *pDataSource,       // First byte of length.\n        void const  *pDataSourceEnd,    // End of valid source data memory\n        ULONG       *pcbData,           // Length of data\n        void const **ppData);           // Start of data\n\n    static HRESULT SafeGetData(\n        BYTE const  *pDataSource,       // First byte of length.\n        BYTE const  *pDataSourceEnd,    // End of valid source data memory\n        ULONG       *pcbData,           // Length of data\n        BYTE const **ppData)            // Start of data\n    {\n        return SafeGetData(\n            reinterpret_cast<void const *>(pDataSource),\n            reinterpret_cast<void const *>(pDataSourceEnd),\n            pcbData,\n            reinterpret_cast<void const **>(ppData));\n    }\n\n    // This is the same as GetData above except it takes a byte count instead\n    // of pointer to determine the source data length.\n    static HRESULT SafeGetData(         // S_OK, or error\n        void const  *pDataSource,       // First byte of data\n        ULONG        cbDataSource,      // Count of valid bytes in data source\n        ULONG       *pcbData,           // Length of data\n        void const **ppData);           // Start of data\n\n    static HRESULT SafeGetData(\n        BYTE const  *pDataSource,       // First byte of length.\n        ULONG        cbDataSource,      // Count of valid bytes in data source\n        ULONG       *pcbData,           // Length of data\n        BYTE const **ppData)            // Start of data\n    {\n        return SafeGetData(\n            reinterpret_cast<void const *>(pDataSource),\n            cbDataSource,\n            pcbData,\n            reinterpret_cast<void const **>(ppData));\n    }\n};\n\n\nclass StgPoolReadOnly;\n\n//*****************************************************************************\n// This hash class will handle strings inside of a chunk of the pool.\n//*****************************************************************************\nstruct STRINGHASH : HASHLINK\n{\n    ULONG       iOffset;                // Offset of this item.\n};\n\nclass CStringPoolHash : public CChainedHash<STRINGHASH>\n{\n    friend class VerifyLayoutsMD;\npublic:\n    CStringPoolHash(StgPoolReadOnly *pool) : m_Pool(pool)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n    virtual bool InUse(STRINGHASH *pItem)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (pItem->iOffset != 0xffffffff);\n    }\n\n    virtual void SetFree(STRINGHASH *pItem)\n    {\n        LIMITED_METHOD_CONTRACT;\n        pItem->iOffset = 0xffffffff;\n    }\n\n    virtual ULONG Hash(const void *pData)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (HashStringA(reinterpret_cast<LPCSTR>(pData)));\n    }\n\n    virtual int Cmp(const void *pData, void *pItem);\n\nprivate:\n    StgPoolReadOnly *m_Pool;                // String pool which this hashes.\n};\n\n\n//*****************************************************************************\n// This version is for byte streams with a 2 byte WORD giving the length of\n// the data.\n//*****************************************************************************\ntypedef STRINGHASH BLOBHASH;\n\nclass CBlobPoolHash : public CChainedHash<STRINGHASH>\n{\n    friend class VerifyLayoutsMD;\npublic:\n    CBlobPoolHash(StgPoolReadOnly *pool) : m_Pool(pool)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n    virtual bool InUse(BLOBHASH *pItem)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (pItem->iOffset != 0xffffffff);\n    }\n\n    virtual void SetFree(BLOBHASH *pItem)\n    {\n        LIMITED_METHOD_CONTRACT;\n        pItem->iOffset = 0xffffffff;\n    }\n\n    virtual ULONG Hash(const void *pData)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_GC_NOTRIGGER;\n        STATIC_CONTRACT_FORBID_FAULT;\n\n        ULONG       ulSize;\n        ulSize = CPackedLen::GetLength(pData);\n        ulSize += CPackedLen::Size(ulSize);\n        return (HashBytes(reinterpret_cast<BYTE const *>(pData), ulSize));\n    }\n\n    virtual int Cmp(const void *pData, void *pItem);\n\nprivate:\n    StgPoolReadOnly *m_Pool;                // Blob pool which this hashes.\n};\n\n//*****************************************************************************\n// This hash class will handle guids inside of a chunk of the pool.\n//*****************************************************************************\nstruct GUIDHASH : HASHLINK\n{\n    ULONG       iIndex;                 // Index of this item.\n};\n\nclass CGuidPoolHash : public CChainedHash<GUIDHASH>\n{\n    friend class VerifyLayoutsMD;\npublic:\n    CGuidPoolHash(StgPoolReadOnly *pool) : m_Pool(pool)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n    virtual bool InUse(GUIDHASH *pItem)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (pItem->iIndex != 0xffffffff);\n    }\n\n    virtual void SetFree(GUIDHASH *pItem)\n    {\n        LIMITED_METHOD_CONTRACT;\n        pItem->iIndex = 0xffffffff;\n    }\n\n    virtual ULONG Hash(const void *pData)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (HashBytes(reinterpret_cast<BYTE const *>(pData), sizeof(GUID)));\n    }\n\n    virtual int Cmp(const void *pData, void *pItem);\n\nprivate:\n    StgPoolReadOnly *m_Pool;                // The GUID pool which this hashes.\n};\n\n\n#endif // __StgPooli_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stresslog.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n/*************************************************************************************/\n/*                                   StressLog.h                                     */\n/*************************************************************************************/\n\n/* StressLog is a binary, memory based circular queue of logging messages.  It is\n   intended to be used in retail builds during stress runs (activated\n   by registry key), so to help find bugs that only turn up during stress runs.\n\n   It is meant to have very low overhead and can not cause deadlocks, etc.  It is\n   however thread safe */\n\n/* The log has a very simple structure, and it meant to be dumped from a NTSD\n   extension (eg. strike). There is no memory allocation system calls etc to purtub things */\n\n// ******************************************************************************\n// WARNING!!!: These classes are used by SOS in the diagnostics repo. Values should\n// added or removed in a backwards and forwards compatible way.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/stresslog.h\n// Parser: https://github.com/dotnet/diagnostics/blob/main/src/SOS/Strike/stressLogDump.cpp\n// ******************************************************************************\n\n/*************************************************************************************/\n\n#ifndef StressLog_h\n#define StressLog_h  1\n\n#include \"log.h\"\n\n#if defined(STRESS_LOG) && !defined(FEATURE_NO_STRESSLOG)\n#ifndef STRESS_LOG_ANALYZER\n#include \"holder.h\"\n#include \"staticcontract.h\"\n#include \"mscoree.h\"\n#include \"clrinternal.h\"\n#ifdef STRESS_LOG_READONLY\n#include <stddef.h> // offsetof\n#else //STRESS_LOG_READONLY\n#include \"clrhost.h\"\n#endif //STRESS_LOG_READONLY\n\n#ifndef _ASSERTE\n#define _ASSERTE(expr)\n#endif\n#else\n#include <stddef.h> // offsetof\n#endif // STRESS_LOG_ANALYZER\n\n/* The STRESS_LOG* macros work like printf.  In fact the use printf in their implementation\n   so all printf format specifications work.  In addition the Stress log dumper knows\n   about certain suffixes for the %p format specification (normally used to print a pointer)\n\n            %pM     // The pointer is a MethodDesc\n            %pT     // The pointer is a type (MethodTable)\n            %pV     // The pointer is a C++ Vtable pointer (useful for distinguishing different types of frames\n            %pK     // The pointer is a code address (used for stack track)\n*/\n\n/*  STRESS_LOG_VA was added to allow sending GC trace output to the stress log. msg must be enclosed\n    in ()'s and contain a format string followed by 0 to 12 arguments. The arguments must be numbers\n     or string literals. This was done because GC Trace uses dprintf which doesn't contain info on\n    how many arguments are getting passed in and using va_args would require parsing the format\n    string during the GC\n*/\n#define STRESS_LOG_VA(dprintfLevel,msg) do {                                                        \\\n            if (StressLog::LogOn(LF_GC, LL_ALWAYS))                                                 \\\n                StressLog::LogMsg(LL_ALWAYS, LF_ALWAYS|(dprintfLevel<<16)|LF_GC, StressLogMsg msg); \\\n            LOGALWAYS(msg);                                                                         \\\n            } while(0)\n\n#define STRESS_LOG0(facility, level, msg) do {                                \\\n            if (StressLog::LogOn(facility, level))                            \\\n                StressLog::LogMsg(level, facility, 0, msg);                   \\\n            LOG((facility, level, msg));                                      \\\n            } while(0)\n\n#define STRESS_LOG1(facility, level, msg, data1) do {                              \\\n            if (StressLog::LogOn(facility, level))                                 \\\n                StressLog::LogMsg(level, facility, 1, msg, (void*)(size_t)(data1));\\\n            LOG((facility, level, msg, data1));                                    \\\n            } while(0)\n\n#define STRESS_LOG2(facility, level, msg, data1, data2) do {                       \\\n            if (StressLog::LogOn(facility, level))                                 \\\n                StressLog::LogMsg(level, facility, 2, msg,                         \\\n                    (void*)(size_t)(data1), (void*)(size_t)(data2));               \\\n            LOG((facility, level, msg, data1, data2));                             \\\n            } while(0)\n\n#define STRESS_LOG2_CHECK_EE_STARTED(facility, level, msg, data1, data2) do { \\\n            if (g_fEEStarted)                                                 \\\n                STRESS_LOG2(facility, level, msg, data1, data2);              \\\n            else                                                              \\\n                LOG((facility, level, msg, data1, data2));                    \\\n            } while(0)\n\n#define STRESS_LOG3(facility, level, msg, data1, data2, data3) do {                           \\\n            if (StressLog::LogOn(facility, level))                                            \\\n                StressLog::LogMsg(level, facility, 3, msg,                                    \\\n                    (void*)(size_t)(data1),(void*)(size_t)(data2),(void*)(size_t)(data3));    \\\n            LOG((facility, level, msg, data1, data2, data3));                                 \\\n            } while(0)\n\n#define STRESS_LOG4(facility, level, msg, data1, data2, data3, data4) do {                              \\\n            if (StressLog::LogOn(facility, level))                                                      \\\n                StressLog::LogMsg(level, facility, 4, msg, (void*)(size_t)(data1),                      \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4));              \\\n            LOG((facility, level, msg, data1, data2, data3, data4));                                    \\\n            } while(0)\n\n#define STRESS_LOG5(facility, level, msg, data1, data2, data3, data4, data5) do {                       \\\n            if (StressLog::LogOn(facility, level))                                                      \\\n                StressLog::LogMsg(level, facility, 5, msg, (void*)(size_t)(data1),                      \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4),               \\\n                    (void*)(size_t)(data5));                                                            \\\n            LOG((facility, level, msg, data1, data2, data3, data4, data5));                             \\\n            } while(0)\n\n#define STRESS_LOG6(facility, level, msg, data1, data2, data3, data4, data5, data6) do {                \\\n            if (StressLog::LogOn(facility, level))                                                      \\\n                StressLog::LogMsg(level, facility, 6, msg, (void*)(size_t)(data1),                      \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4),               \\\n                    (void*)(size_t)(data5), (void*)(size_t)(data6));                                    \\\n            LOG((facility, level, msg, data1, data2, data3, data4, data5, data6));                      \\\n            } while(0)\n\n#define STRESS_LOG7(facility, level, msg, data1, data2, data3, data4, data5, data6, data7) do {         \\\n            if (StressLog::LogOn(facility, level))                                                      \\\n                StressLog::LogMsg(level, facility, 7, msg, (void*)(size_t)(data1),                      \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4),               \\\n                    (void*)(size_t)(data5), (void*)(size_t)(data6), (void*)(size_t)(data7));            \\\n            LOG((facility, level, msg, data1, data2, data3, data4, data5, data6, data7));               \\\n            } while(0)\n\n#define STRESS_LOG_COND0(facility, level, cond, msg) do {                     \\\n            if (StressLog::LogOn(facility, level) && (cond))                  \\\n                StressLog::LogMsg(level, facility, 0, msg);                   \\\n            LOG((facility, level, msg));                                      \\\n            } while(0)\n\n#define STRESS_LOG_COND1(facility, level, cond, msg, data1) do {                    \\\n            if (StressLog::LogOn(facility, level) && (cond))                        \\\n                StressLog::LogMsg(level, facility, 1, msg, (void*)(size_t)(data1)); \\\n            LOG((facility, level, msg, data1));                                     \\\n            } while(0)\n\n#define STRESS_LOG_COND2(facility, level, cond, msg, data1, data2) do {            \\\n            if (StressLog::LogOn(facility, level) && (cond))                       \\\n                StressLog::LogMsg(level, facility, 2, msg,                         \\\n                    (void*)(size_t)(data1), (void*)(size_t)(data2));               \\\n            LOG((facility, level, msg, data1, data2));                             \\\n            } while(0)\n\n#define STRESS_LOG_COND3(facility, level, cond, msg, data1, data2, data3) do {                \\\n            if (StressLog::LogOn(facility, level) && (cond))                                  \\\n                StressLog::LogMsg(level, facility, 3, msg,                                    \\\n                    (void*)(size_t)(data1),(void*)(size_t)(data2),(void*)(size_t)(data3));    \\\n            LOG((facility, level, msg, data1, data2, data3));                                 \\\n            } while(0)\n\n#define STRESS_LOG_COND4(facility, level, cond, msg, data1, data2, data3, data4) do {                   \\\n            if (StressLog::LogOn(facility, level) && (cond))                                            \\\n                StressLog::LogMsg(level, facility, 4, msg, (void*)(size_t)(data1),                      \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4));              \\\n            LOG((facility, level, msg, data1, data2, data3, data4));                                    \\\n            } while(0)\n\n#define STRESS_LOG_COND5(facility, level, cond, msg, data1, data2, data3, data4, data5) do {            \\\n            if (StressLog::LogOn(facility, level) && (cond))                                            \\\n                StressLog::LogMsg(level, facility, 5, msg, (void*)(size_t)(data1),                      \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4),               \\\n                    (void*)(size_t)(data5));                                                            \\\n            LOG((facility, level, msg, data1, data2, data3, data4, data5));                             \\\n            } while(0)\n\n#define STRESS_LOG_COND6(facility, level, cond, msg, data1, data2, data3, data4, data5, data6) do {     \\\n            if (StressLog::LogOn(facility, level) && (cond))                                            \\\n                StressLog::LogMsg(level, facility, 6, msg, (void*)(size_t)(data1),                      \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4),               \\\n                    (void*)(size_t)(data5), (void*)(size_t)(data6));                                    \\\n            LOG((facility, level, msg, data1, data2, data3, data4, data5, data6));                      \\\n            } while(0)\n\n#define STRESS_LOG_COND7(facility, level, cond, msg, data1, data2, data3, data4, data5, data6, data7) do { \\\n            if (StressLog::LogOn(facility, level) && (cond))                                               \\\n                StressLog::LogMsg(level, facility, 7, msg, (void*)(size_t)(data1),                         \\\n                    (void*)(size_t)(data2),(void*)(size_t)(data3),(void*)(size_t)(data4),                  \\\n                    (void*)(size_t)(data5), (void*)(size_t)(data6), (void*)(size_t)(data7));               \\\n            LOG((facility, level, msg, data1, data2, data3, data4, data5, data6, data7));                  \\\n            } while(0)\n\n#define STRESS_LOG_RESERVE_MEM(numChunks) do {                              \\\n            if (StressLog::StressLogOn(LF_ALL, LL_ALWAYS))                  \\\n                {StressLog::ReserveStressLogChunks (numChunks);}            \\\n            } while(0)\n// !!! WARNING !!!\n// !!! DO NOT ADD STRESS_LOG8, as the stress log infrastructure supports a maximum of 7 arguments\n// !!! WARNING !!!\n\n#define STRESS_LOG_PLUG_MOVE(plug_start, plug_end, plug_delta) do {                                                 \\\n            if (StressLog::LogOn(LF_GC, LL_INFO1000))                                                               \\\n                StressLog::LogMsg(LL_INFO1000, LF_GC, 3, ThreadStressLog::gcPlugMoveMsg(),                          \\\n                (void*)(size_t)(plug_start), (void*)(size_t)(plug_end), (void*)(size_t)(plug_delta));               \\\n            LOG((LF_GC, LL_INFO10000, ThreadStressLog::gcPlugMoveMsg(), (plug_start), (plug_end), (plug_delta)));   \\\n            } while(0)\n\n#define STRESS_LOG_ROOT_PROMOTE(root_addr, objPtr, methodTable) do {                                                            \\\n            if (StressLog::LogOn(LF_GC|LF_GCROOTS, LL_INFO1000))                                                                \\\n                StressLog::LogMsg(LL_INFO1000, LF_GC|LF_GCROOTS, 3, ThreadStressLog::gcRootPromoteMsg(),                        \\\n                    (void*)(size_t)(root_addr), (void*)(size_t)(objPtr), (void*)(size_t)(methodTable));                         \\\n            LOG((LF_GC|LF_GCROOTS, LL_INFO1000000, ThreadStressLog::gcRootPromoteMsg(), (root_addr), (objPtr), (methodTable))); \\\n            } while(0)\n\n#define STRESS_LOG_ROOT_RELOCATE(root_addr, old_value, new_value, methodTable) do {                                                     \\\n            if (StressLog::LogOn(LF_GC|LF_GCROOTS, LL_INFO1000) && ((size_t)(old_value) != (size_t)(new_value)))                        \\\n                StressLog::LogMsg(LL_INFO1000, LF_GC|LF_GCROOTS, 4, ThreadStressLog::gcRootMsg(),                                       \\\n                    (void*)(size_t)(root_addr), (void*)(size_t)(old_value),                                                             \\\n                    (void*)(size_t)(new_value), (void*)(size_t)(methodTable));                                                          \\\n            LOG((LF_GC|LF_GCROOTS, LL_INFO10000, ThreadStressLog::gcRootMsg(), (root_addr), (old_value), (new_value), (methodTable)));  \\\n            } while(0)\n\n#define STRESS_LOG_GC_START(gcCount, Gen, collectClasses) do {                                                                  \\\n            if (StressLog::LogOn(LF_GCROOTS|LF_GC|LF_GCALLOC, LL_INFO10))                                                       \\\n                StressLog::LogMsg(LL_INFO10, LF_GCROOTS|LF_GC|LF_GCALLOC, 3, ThreadStressLog::gcStartMsg(),                     \\\n                    (void*)(size_t)(gcCount), (void*)(size_t)(Gen), (void*)(size_t)(collectClasses));                           \\\n            LOG((LF_GCROOTS|LF_GC|LF_GCALLOC, LL_INFO10, ThreadStressLog::gcStartMsg(), (gcCount), (Gen), (collectClasses)));   \\\n            } while(0)\n\n#define STRESS_LOG_GC_END(gcCount, Gen, collectClasses) do {                                                                    \\\n            if (StressLog::LogOn(LF_GCROOTS|LF_GC|LF_GCALLOC, LL_INFO10))                                                       \\\n                StressLog::LogMsg(LL_INFO10, LF_GCROOTS|LF_GC|LF_GCALLOC, 3, ThreadStressLog::gcEndMsg(),                       \\\n                    (void*)(size_t)(gcCount), (void*)(size_t)(Gen), (void*)(size_t)(collectClasses), 0);                        \\\n            LOG((LF_GCROOTS|LF_GC|LF_GCALLOC, LL_INFO10, ThreadStressLog::gcEndMsg(), (gcCount), (Gen), (collectClasses)));     \\\n            } while(0)\n\n#if defined(_DEBUG)\n#define MAX_CALL_STACK_TRACE          20\n#define STRESS_LOG_OOM_STACK(size) do {                                                           \\\n                CantAllocHolder caHolder;                                                         \\\n                if (StressLog::LogOn(LF_EEMEM, LL_ALWAYS))                                        \\\n                {                                                                                 \\\n                    StressLog::LogMsgOL(\"OOM on alloc of size %x \\n\", (void*)(size_t)(size));     \\\n                    StressLog::LogCallStack (\"OOM\");                                              \\\n                }                                                                                 \\\n            } while(0)\n#define STRESS_LOG_GC_STACK do {                                                                  \\\n                if (StressLog::LogOn(LF_GC |LF_GCINFO, LL_ALWAYS))                                \\\n                {                                                                                 \\\n                    StressLog::LogMsgOL(\"GC is triggered \\n\");                                    \\\n                    StressLog::LogCallStack (\"GC\");                                               \\\n                }                                                                                 \\\n            } while(0)\n\n#else //!_DEBUG\n#define STRESS_LOG_OOM_STACK(size)\n#define STRESS_LOG_GC_STACK\n#endif //_DEBUG\n\nvoid ReplacePid(LPCWSTR original, LPWSTR replaced, size_t replacedLength);\n\nclass ThreadStressLog;\n\nstruct StressLogMsg;\n\n/*************************************************************************************/\n/* a log is a circular queue of messages */\n\nclass StressLog {\npublic:\n    static void Initialize(unsigned facilities, unsigned level, unsigned maxBytesPerThread,\n        unsigned maxBytesTotal, void* moduleBase, LPWSTR logFilename = nullptr);\n    static void Terminate(BOOL fProcessDetach=FALSE);\n    static void ThreadDetach();         // call at DllMain  THREAD_DETACH if you want to recycle thread logs\n#ifndef STRESS_LOG_ANALYZER\n    static int NewChunk ()\n    {\n        return InterlockedIncrement (&theLog.totalChunk);\n    }\n    static int ChunkDeleted ()\n    {\n        return InterlockedDecrement (&theLog.totalChunk);\n    }\n#endif //STRESS_LOG_ANALYZER\n\n    //the result is not 100% accurate. If multiple threads call this function at the same time,\n    //we could allow the total size be bigger than required. But the memory won't grow forever\n    //and this is not critical so we don't try to fix the race\n    static BOOL AllowNewChunk (LONG numChunksInCurThread);\n\n    //preallocate Stress log chunks for current thread. The memory we could preallocate is still\n    //bounded by per thread size limit and total size limit. If chunksToReserve is 0, we will try to\n    //preallocate up to per thread size limit\n    static BOOL ReserveStressLogChunks (unsigned chunksToReserve);\n\n    // used by out of process debugger to dump the stress log to 'fileName'\n    // IDebugDataSpaces is the NTSD execution callback for getting process memory.\n    // This function is defined in the tools\\strike\\stressLogDump.cpp file\n    static HRESULT Dump(ULONG64 logAddr, const char* fileName, struct IDebugDataSpaces* memCallBack);\n\n    static BOOL StressLogOn(unsigned facility, unsigned level);\n    static BOOL ETWLogOn(unsigned facility, unsigned level);\n    static BOOL LogOn(unsigned facility, unsigned level);\n\n// private:\n    unsigned facilitiesToLog;               // Bitvector of facilities to log (see loglf.h)\n    unsigned levelToLog;                    // log level (see log.h)\n    unsigned MaxSizePerThread;              // maximum number of bytes each thread should have before wrapping\n    unsigned MaxSizeTotal;                  // maximum memory allowed for stress log\n    Volatile<LONG> totalChunk;              // current number of total chunks allocated\n    Volatile<ThreadStressLog*> logs;        // the list of logs for every thread.\n    unsigned padding;                       // Preserve the layout for SOS\n    Volatile<LONG> deadCount;               // count of dead threads in the log\n    CRITSEC_COOKIE lock;                    // lock\n    unsigned __int64 tickFrequency;         // number of ticks per second\n    unsigned __int64 startTimeStamp;        // start time from when tick counter started\n    FILETIME startTime;                     // time the application started\n    SIZE_T   moduleOffset;                  // Used to compute format strings.\n    struct ModuleDesc\n    {\n        uint8_t* baseAddress;\n        size_t        size;\n    };\n    static const size_t MAX_MODULES = 5;\n    ModuleDesc    modules[MAX_MODULES];     // descriptor of the modules images\n\n#if defined(HOST_64BIT)\n#define MEMORY_MAPPED_STRESSLOG\n#ifdef HOST_WINDOWS\n#define MEMORY_MAPPED_STRESSLOG_BASE_ADDRESS (void*)0x400000000000\n#else\n#define MEMORY_MAPPED_STRESSLOG_BASE_ADDRESS nullptr\n#endif\n#endif\n\n#ifdef STRESS_LOG_ANALYZER\n    static size_t writing_base_address;\n    static size_t reading_base_address;\n\n    template<typename T>\n    static T* TranslateMemoryMappedPointer(T* input)\n    {\n        if (input == nullptr)\n        {\n            return nullptr;\n        }\n\n        return ((T*)(((uint8_t*)input) - writing_base_address + reading_base_address));\n    }\n#else\n    template<typename T>\n    static T* TranslateMemoryMappedPointer(T* input)\n    {\n        return input;\n    }\n#endif\n\n#ifdef MEMORY_MAPPED_STRESSLOG\n\n    //\n    // Intentionally avoid unmapping the file during destructor to avoid a race\n    // condition between additional logging in other thread and the destructor.\n    //\n    // The operating system will make sure the file get unmapped during process shutdown\n    //\n    LPVOID hMapView;\n    static void* AllocMemoryMapped(size_t n);\n\n    struct StressLogHeader\n    {\n        size_t        headerSize;               // size of this header including size field and moduleImage\n        uint32_t      magic;                    // must be 'STRL'\n        uint32_t      version;                  // must be 0x00010001\n        uint8_t*      memoryBase;               // base address of the memory mapped file\n        uint8_t*      memoryCur;                // highest address currently used\n        uint8_t*      memoryLimit;              // limit that can be used\n        Volatile<ThreadStressLog*>  logs;       // the list of logs for every thread.\n        uint64_t      tickFrequency;            // number of ticks per second\n        uint64_t      startTimeStamp;           // start time from when tick counter started\n        uint64_t      threadsWithNoLog;         // threads that didn't get a log\n        uint64_t      reserved[15];             // for future expansion\n        ModuleDesc    modules[MAX_MODULES];     // descriptor of the modules images\n        uint8_t       moduleImage[64*1024*1024];// copy of the module images described by modules field\n    };\n\n    StressLogHeader* stressLogHeader;       // header to find things in the memory mapped file\n#endif // MEMORY_MAPPED_STRESSLOG\n\n    static thread_local ThreadStressLog* t_pCurrentThreadLog;\n\n// private:\n    static void Enter(CRITSEC_COOKIE dummy = NULL);\n    static void Leave(CRITSEC_COOKIE dummy = NULL);\n    static ThreadStressLog* CreateThreadStressLog();\n    static ThreadStressLog* CreateThreadStressLogHelper();\n\n    static BOOL InlinedStressLogOn(unsigned facility, unsigned level);\n    static BOOL InlinedETWLogOn(unsigned facility, unsigned level);\n\n    static void LogMsg(unsigned level, unsigned facility, int cArgs, const char* format, ... );\n\n    static void LogMsg(unsigned level, unsigned facility, const StressLogMsg& msg);\n\n    static void AddModule(uint8_t* moduleBase);\n\n// Support functions for STRESS_LOG_VA\n// We disable the warning \"conversion from 'type' to 'type' of greater size\" since everything will\n// end up on the stack, and LogMsg will know the size of the variable based on the format string.\n#ifdef _MSC_VER\n#pragma warning( push )\n#pragma warning( disable : 4312 )\n#endif\n    static void LogMsgOL(const char* format)\n    { LogMsg(LL_ALWAYS, LF_GC, 0, format); }\n\n    template < typename T1 >\n    static void LogMsgOL(const char* format, T1 data1)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 1, format, (void*)(size_t)data1);\n    }\n\n    template < typename T1, typename T2 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 2, format, (void*)(size_t)data1, (void*)(size_t)data2);\n    }\n\n    template < typename T1, typename T2, typename T3 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 3, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 4, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 5, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 6, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 7, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 8, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 9, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 10, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9, (void*)(size_t)data10);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 11, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9, (void*)(size_t)data10, (void*)(size_t)data11);\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12 >\n    static void LogMsgOL(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11, T12 data12)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*) && sizeof(T12) <= sizeof(void*));\n        LogMsg(LL_ALWAYS, LF_GC, 12, format, (void*)(size_t)data1, (void*)(size_t)data2, (void*)(size_t)data3, (void*)(size_t)data4, (void*)(size_t)data5, (void*)(size_t)data6, (void*)(size_t)data7, (void*)(size_t)data8, (void*)(size_t)data9, (void*)(size_t)data10, (void*)(size_t)data11, (void*)(size_t)data12);\n    }\n\n#ifdef _MSC_VER\n#pragma warning( pop )\n#endif\n\n// We can only log the stacktrace on DEBUG builds!\n#ifdef _DEBUG\ntypedef USHORT\n(__stdcall *PFNRtlCaptureStackBackTrace)(\n    IN ULONG FramesToSkip,\n    IN ULONG FramesToCapture,\n    OUT PVOID * BackTrace,\n    OUT PULONG BackTraceHash);\n\n    PFNRtlCaptureStackBackTrace RtlCaptureStackBackTrace;\n\n    static void LogCallStack(const char *const callTag);\n#endif //_DEBUG\n\n// private: // static variables\n    static StressLog theLog;    // We only have one log, and this is it\n};\n\n#ifndef STRESS_LOG_ANALYZER\ntypedef Holder<CRITSEC_COOKIE, StressLog::Enter, StressLog::Leave, NULL, CompareDefault<CRITSEC_COOKIE>> StressLogLockHolder;\n#endif //!STRESS_LOG_ANALYZER\n\n#if defined(DACCESS_COMPILE)\ninline BOOL StressLog::LogOn(unsigned facility, unsigned level)\n{\n    STATIC_CONTRACT_LEAF;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n\n    // StressLog isn't dacized, and besides we don't want to log to it in DAC builds.\n    return FALSE;\n}\n#endif\n\n/*************************************************************************************/\n/* private classes */\n\n#if defined(_MSC_VER)\n#pragma warning(disable:4200 4201)\t\t\t\t\t// don't warn about 0 sized array below or unnamed structures\n#endif\n\n// The order of fields is important.  Keep the prefix length as the first field.\n// And make sure the timeStamp field is naturally aligned, so we don't waste\n// space on 32-bit platforms\nstruct StressMsg {\n    static const size_t formatOffsetBits = 26;\n    union {\n        struct {\n            uint32_t numberOfArgs  : 3;                   // at most 7 arguments here\n            uint32_t formatOffset  : formatOffsetBits;    // offset of string in mscorwks\n            uint32_t numberOfArgsX : 3;                   // extend number of args in a backward compat way\n        };\n        uint32_t fmtOffsCArgs;    // for optimized access\n    };\n    uint32_t facility;                      // facility used to log the entry\n    uint64_t timeStamp;                     // time when mssg was logged\n    void*     args[0];                      // size given by numberOfArgs\n\n    static const size_t maxArgCnt = 63;\n    static const size_t maxOffset = 1 << formatOffsetBits;\n    static size_t maxMsgSize ()\n    { return sizeof(StressMsg) + maxArgCnt*sizeof(void*); }\n\n    friend class ThreadStressLog;\n    friend class StressLog;\n};\n#ifdef HOST_64BIT\n#define STRESSLOG_CHUNK_SIZE (32 * 1024)\n#else //HOST_64BIT\n#define STRESSLOG_CHUNK_SIZE (16 * 1024)\n#endif //HOST_64BIT\n#define GC_STRESSLOG_MULTIPLY 5\n\n// a chunk of memory for stress log\nstruct StressLogChunk\n{\n    StressLogChunk * prev;\n    StressLogChunk * next;\n    char buf[STRESSLOG_CHUNK_SIZE];\n    DWORD dwSig1;\n    DWORD dwSig2;\n\n#if !defined(STRESS_LOG_READONLY)\n\n#ifdef MEMORY_MAPPED_STRESSLOG\n    static bool s_memoryMapped;\n#endif //MEMORY_MAPPED_STRESSLOG\n\n#ifdef HOST_WINDOWS\n    static HANDLE s_LogChunkHeap;\n#endif //HOST_WINDOWS\n\n    void * operator new (size_t size) throw()\n    {\n        if (IsInCantAllocStressLogRegion ())\n        {\n            return NULL;\n        }\n#ifdef MEMORY_MAPPED_STRESSLOG\n        if (s_memoryMapped)\n            return StressLog::AllocMemoryMapped(size);\n#endif //MEMORY_MAPPED_STRESSLOG\n#ifdef HOST_WINDOWS\n        _ASSERTE(s_LogChunkHeap);\n        return HeapAlloc(s_LogChunkHeap, 0, size);\n#else\n        return malloc(size);\n#endif //HOST_WINDOWS\n    }\n\n    void operator delete (void * chunk)\n    {\n#ifdef MEMORY_MAPPED_STRESSLOG\n        if (s_memoryMapped)\n            return;\n#endif //MEMORY_MAPPED_STRESSLOG\n#ifdef HOST_WINDOWS\n        _ASSERTE(s_LogChunkHeap);\n        HeapFree (s_LogChunkHeap, 0, chunk);\n#else\n        free(chunk);\n#endif //HOST_WINDOWS\n    }\n\n#endif //!STRESS_LOG_READONLY\n\n    StressLogChunk (StressLogChunk * p = NULL, StressLogChunk * n = NULL)\n        :prev (p), next (n), dwSig1 (0xCFCFCFCF), dwSig2 (0xCFCFCFCF)\n    {}\n\n    char * StartPtr ()\n    {\n        return buf;\n    }\n\n    char * EndPtr ()\n    {\n        return buf + STRESSLOG_CHUNK_SIZE;\n    }\n\n    BOOL IsValid () const\n    {\n        return dwSig1 == 0xCFCFCFCF && dwSig2 == 0xCFCFCFCF;\n    }\n};\n\n// This class implements a circular stack of variable sized elements\n//    .The buffer between startPtr-endPtr is used in a circular manner\n//     to store instances of the variable-sized struct StressMsg.\n//     The StressMsg are always aligned to endPtr, while the space\n//     left between startPtr and the last element is 0-padded.\n//    .curPtr points to the most recently written log message\n//    .readPtr points to the next log message to be dumped\n//    .hasWrapped is TRUE while dumping the log, if we had wrapped\n//     past the endPtr marker, back to startPtr\n// The AdvanceRead/AdvanceWrite operations simply update the\n//     readPtr / curPtr fields. thecaller is responsible for reading/writing\n//     to the corresponding field\nclass ThreadStressLog {\n#ifdef STRESS_LOG_ANALYZER\npublic:\n#endif\n    ThreadStressLog* next;      // we keep a linked list of these\n    uint64_t   threadId;        // the id for the thread using this buffer\n    uint8_t    isDead;          // Is this thread dead\n    uint8_t    readHasWrapped;  // set when read ptr has passed chunkListTail\n    uint8_t    writeHasWrapped; // set when write ptr has passed chunkListHead\n    StressMsg* curPtr;          // where packets are being put on the queue\n    StressMsg* readPtr;         // where we are reading off the queue (used during dumping)\n    StressLogChunk * chunkListHead; //head of a list of stress log chunks\n    StressLogChunk * chunkListTail; //tail of a list of stress log chunks\n    StressLogChunk * curReadChunk; //the stress log chunk we are currently reading\n    StressLogChunk * curWriteChunk; //the stress log chunk we are currently writing\n    long       chunkListLength; // how many stress log chunks are in this stress log\n\n#ifdef STRESS_LOG_READONLY\n    FORCEINLINE StressMsg* AdvanceRead();\n#endif //STRESS_LOG_READONLY\n    FORCEINLINE StressMsg* AdvanceWrite(int cArgs);\n\n#ifdef STRESS_LOG_READONLY\n    inline StressMsg* AdvReadPastBoundary();\n#endif //STRESS_LOG_READONLY\n    inline StressMsg* AdvWritePastBoundary(int cArgs);\n\n#ifdef STRESS_LOG_READONLY\n    ThreadStressLog* FindLatestThreadLog() const;\n#endif //STRESS_LOG_READONLY\n    friend class StressLog;\n\n#if !defined(STRESS_LOG_READONLY) && !defined(STRESS_LOG_ANALYZER)\n    FORCEINLINE BOOL GrowChunkList ()\n    {\n        _ASSERTE (chunkListLength >= 1);\n        if (!StressLog::AllowNewChunk (chunkListLength))\n        {\n            return FALSE;\n        }\n        StressLogChunk * newChunk = new StressLogChunk (chunkListTail, chunkListHead);\n        if (newChunk == NULL)\n        {\n            return FALSE;\n        }\n        StressLog::NewChunk ();\n        chunkListLength++;\n        chunkListHead->prev = newChunk;\n        chunkListTail->next = newChunk;\n        chunkListHead = newChunk;\n\n        return TRUE;\n    }\n#endif //!STRESS_LOG_READONLY && !STRESS_LOG_ANALYZER\n\npublic:\n#if !defined(STRESS_LOG_READONLY) && !defined(STRESS_LOG_ANALYZER)\n    ThreadStressLog ()\n    {\n        chunkListHead = chunkListTail = curWriteChunk = NULL;\n        StressLogChunk * newChunk = new StressLogChunk;\n        //OOM or in cantalloc region\n        if (newChunk == NULL)\n        {\n            return;\n        }\n        StressLog::NewChunk ();\n\n        newChunk->prev = newChunk;\n        newChunk->next = newChunk;\n\n        chunkListHead = chunkListTail = newChunk;\n\n        next = NULL;\n        threadId = 0;\n        isDead = TRUE;\n        curPtr = NULL;\n        readPtr = NULL;\n        writeHasWrapped = FALSE;\n        curReadChunk = NULL;\n        curWriteChunk = NULL;\n        chunkListLength = 1;\n    }\n\n#endif //!STRESS_LOG_READONLY && !STRESS_LOG_ANALYZER\n\n#if defined(MEMORY_MAPPED_STRESSLOG) && !defined(STRESS_LOG_ANALYZER)\n    void* __cdecl operator new(size_t n, const NoThrow&) NOEXCEPT;\n    void __cdecl operator delete (void * chunk);\n#endif\n\n    ~ThreadStressLog ()\n    {\n        //no thing to do if the list is empty (failed to initialize)\n        if (chunkListHead == NULL)\n        {\n            return;\n        }\n#if !defined(STRESS_LOG_READONLY) && !defined(STRESS_LOG_ANALYZER)\n        _ASSERTE (chunkListLength >= 1 && chunkListLength <= StressLog::theLog.totalChunk);\n#endif //!STRESS_LOG_READONLY && !STRESS_LOG_ANALYZER\n        StressLogChunk * chunk = chunkListHead;\n\n        do\n        {\n            StressLogChunk * tmp = chunk;\n            chunk = chunk->next;\n            delete tmp;\n#if !defined(STRESS_LOG_READONLY) && !defined(STRESS_LOG_ANALYZER)\n            StressLog::ChunkDeleted ();\n#endif //!STRESS_LOG_READONLY && !STRESS_LOG_ANALYZER\n        } while (chunk != chunkListHead);\n    }\n\n    void Activate ()\n    {\n#ifndef STRESS_LOG_READONLY\n        //there is no need to zero buffers because we could handle garbage contents\n        threadId = GetCurrentThreadId ();\n        isDead = FALSE;\n        curWriteChunk = chunkListTail;\n        curPtr = (StressMsg *)curWriteChunk->EndPtr ();\n        writeHasWrapped = FALSE;\n#else //STRESS_LOG_READONLY\n        curReadChunk = curWriteChunk;\n        readPtr = curPtr;\n        readHasWrapped = FALSE;\n        // the last written log, if it wrapped around may have partially overwritten\n        // a previous record.  Update curPtr to reflect the last safe beginning of a record,\n        // but curPtr shouldn't wrap around, otherwise it'll break our assumptions about stress\n        // log\n        curPtr = (StressMsg*)((char*)curPtr - StressMsg::maxMsgSize());\n        if (curPtr < (StressMsg*)curWriteChunk->StartPtr())\n        {\n            curPtr = (StressMsg *)curWriteChunk->StartPtr();\n        }\n        //corner case: the log is empty\n        if (readPtr == (StressMsg *)curReadChunk->EndPtr ())\n        {\n            AdvReadPastBoundary();\n        }\n#endif //!STRESS_LOG_READONLY\n    }\n\n    BOOL IsValid () const\n    {\n        return chunkListHead != NULL && (!curWriteChunk || StressLog::TranslateMemoryMappedPointer(curWriteChunk)->IsValid ());\n    }\n\n#ifdef STRESS_LOG_READONLY\n    // Called while dumping.  Returns true after all messages in log were dumped\n    FORCEINLINE BOOL CompletedDump ()\n    {\n        return readPtr->timeStamp == 0\n                //if read has passed end of list but write has not passed head of list yet, we are done\n                //if write has also wrapped, we are at the end if read pointer passed write pointer\n                || (readHasWrapped &&\n                        (!writeHasWrapped || (curReadChunk == curWriteChunk && readPtr >= curPtr)));\n    }\n#endif //STRESS_LOG_READONLY\n\n    #include \"gcmsg.inl\"\n\n    static const char* TaskSwitchMsg()\n    {\n        STATIC_CONTRACT_LEAF;\n        return \"StressLog TaskSwitch Marker\\n\";\n    }\n\n    void LogMsg(unsigned facility, int cArgs, const char* format, ...);\n\n    FORCEINLINE void LogMsg (unsigned facility, int cArgs, const char* format, va_list Args);\n#ifdef STRESS_LOG_READONLY\n    static size_t OffsetOfNext () {return offsetof (ThreadStressLog, next);}\n    static size_t OffsetOfListHead () {return offsetof (ThreadStressLog, chunkListHead);}\n#endif //STRESS_LOG_READONLY\n};\n\n#ifdef STRESS_LOG_READONLY\n/*********************************************************************************/\n// Called when dumping the log (by StressLog::Dump())\n// Updates readPtr to point to next stress messaage to be dumped\n// For convenience it returns the new value of readPtr\ninline StressMsg* ThreadStressLog::AdvanceRead() {\n    STATIC_CONTRACT_LEAF;\n    // advance the marker\n    readPtr = (StressMsg*)((char*)readPtr + sizeof(StressMsg) + readPtr->numberOfArgs*sizeof(void*));\n    // wrap around if we need to\n    if (readPtr >= (StressMsg *)curReadChunk->EndPtr ())\n    {\n        AdvReadPastBoundary();\n    }\n    return readPtr;\n}\n\n// It's the factored-out slow codepath for AdvanceRead() and\n// is only called by AdvanceRead().\n// Updates readPtr to and returns the first stress message >= startPtr\ninline StressMsg* ThreadStressLog::AdvReadPastBoundary() {\n    STATIC_CONTRACT_LEAF;\n    //if we pass boundary of tail list, we need to set has Wrapped\n    if (curReadChunk == chunkListTail)\n    {\n        readHasWrapped = TRUE;\n        //If write has not wrapped, we know the contents from list head to\n        //cur pointer is garbage, we don't need to read them\n        if (!writeHasWrapped)\n        {\n            return readPtr;\n        }\n    }\n    curReadChunk = curReadChunk->next;\n    void** p = (void**)curReadChunk->StartPtr();\n    while (*p == NULL && (size_t)(p-(void**)curReadChunk->StartPtr ()) < (StressMsg::maxMsgSize()/sizeof(void*)))\n    {\n        ++p;\n    }\n    // if we failed to find a valid start of a StressMsg fallback to startPtr (since timeStamp==0)\n    if (*p == NULL)\n    {\n        p = (void**) curReadChunk->StartPtr ();\n    }\n    readPtr = (StressMsg*)p;\n\n    return readPtr;\n}\n#endif //STRESS_LOG_READONLY\n/*********************************************************************************/\n// Called at runtime when writing the log (by StressLog::LogMsg())\n// Updates curPtr to point to the next spot in the log where we can write\n// a stress message with cArgs arguments\n// For convenience it returns a pointer to the empty slot where we can\n// write the next stress message.\n// cArgs is the number of arguments in the message to be written.\ninline StressMsg* ThreadStressLog::AdvanceWrite(int cArgs) {\n    STATIC_CONTRACT_LEAF;\n    // _ASSERTE(cArgs <= StressMsg::maxArgCnt);\n    // advance the marker\n    StressMsg* p = (StressMsg*)((char*)curPtr - sizeof(StressMsg) - cArgs*sizeof(void*));\n\n    //past start of current chunk\n    //wrap around if we need to\n    if (p < (StressMsg*)curWriteChunk->StartPtr ())\n    {\n        return AdvWritePastBoundary(cArgs);\n    }\n    else\n    {\n        return p;\n    }\n}\n\n// It's the factored-out slow codepath for AdvanceWrite() and\n// is only called by AdvanceWrite().\n// Returns the stress message flushed against endPtr\n// In addition it writes NULLs b/w the startPtr and curPtr\ninline StressMsg* ThreadStressLog::AdvWritePastBoundary(int cArgs) {\n    STATIC_CONTRACT_WRAPPER;\n#if !defined(STRESS_LOG_READONLY) && !defined(STRESS_LOG_ANALYZER)\n    //zeroed out remaining buffer\n    memset (curWriteChunk->StartPtr (), 0, (BYTE *)curPtr - (BYTE *)curWriteChunk->StartPtr ());\n\n    //if we are already at head of the list, try to grow the list\n    if (curWriteChunk == chunkListHead)\n    {\n        GrowChunkList ();\n    }\n#endif //!STRESS_LOG_READONLY && !STRESS_LOG_ANALYZER\n\n    curWriteChunk = curWriteChunk->prev;\n#ifndef STRESS_LOG_READONLY\n    if (curWriteChunk == chunkListTail)\n    {\n        writeHasWrapped = TRUE;\n    }\n#endif //STRESS_LOG_READONLY\n    return (StressMsg*)((char*)curWriteChunk->EndPtr () - sizeof(StressMsg) - cArgs * sizeof(void*));\n}\n\nstruct StressLogMsg\n{\n    int m_cArgs;\n    const char* m_format;\n    void* m_args[16];\n\n    StressLogMsg(const char* format) : m_cArgs(0), m_format(format)\n    {\n    }\n\n    template < typename T1 >\n    StressLogMsg(const char* format, T1 data1) : m_cArgs(1), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n    }\n\n    template < typename T1, typename T2 >\n    StressLogMsg(const char* format, T1 data1, T2 data2) : m_cArgs(2), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n    }\n\n    template < typename T1, typename T2, typename T3 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3) : m_cArgs(3), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4) : m_cArgs(4), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5) : m_cArgs(5), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6) : m_cArgs(6), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n        m_args[5] = (void*)(size_t)data6;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7) : m_cArgs(7), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n        m_args[5] = (void*)(size_t)data6;\n        m_args[6] = (void*)(size_t)data7;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8) : m_cArgs(8), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n        m_args[5] = (void*)(size_t)data6;\n        m_args[6] = (void*)(size_t)data7;\n        m_args[7] = (void*)(size_t)data8;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9) : m_cArgs(9), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n        m_args[5] = (void*)(size_t)data6;\n        m_args[6] = (void*)(size_t)data7;\n        m_args[7] = (void*)(size_t)data8;\n        m_args[8] = (void*)(size_t)data9;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10) : m_cArgs(10), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n        m_args[5] = (void*)(size_t)data6;\n        m_args[6] = (void*)(size_t)data7;\n        m_args[7] = (void*)(size_t)data8;\n        m_args[8] = (void*)(size_t)data9;\n        m_args[9] = (void*)(size_t)data10;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11) : m_cArgs(11), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n        m_args[5] = (void*)(size_t)data6;\n        m_args[6] = (void*)(size_t)data7;\n        m_args[7] = (void*)(size_t)data8;\n        m_args[8] = (void*)(size_t)data9;\n        m_args[9] = (void*)(size_t)data10;\n        m_args[10] = (void*)(size_t)data11;\n    }\n\n    template < typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12 >\n    StressLogMsg(const char* format, T1 data1, T2 data2, T3 data3, T4 data4, T5 data5, T6 data6, T7 data7, T8 data8, T9 data9, T10 data10, T11 data11, T12 data12) : m_cArgs(12), m_format(format)\n    {\n        static_assert_no_msg(sizeof(T1) <= sizeof(void*) && sizeof(T2) <= sizeof(void*) && sizeof(T3) <= sizeof(void*) && sizeof(T4) <= sizeof(void*) && sizeof(T5) <= sizeof(void*) && sizeof(T6) <= sizeof(void*) && sizeof(T7) <= sizeof(void*) && sizeof(T8) <= sizeof(void*) && sizeof(T9) <= sizeof(void*) && sizeof(T10) <= sizeof(void*) && sizeof(T11) <= sizeof(void*) && sizeof(T12) <= sizeof(void*));\n        m_args[0] = (void*)(size_t)data1;\n        m_args[1] = (void*)(size_t)data2;\n        m_args[2] = (void*)(size_t)data3;\n        m_args[3] = (void*)(size_t)data4;\n        m_args[4] = (void*)(size_t)data5;\n        m_args[5] = (void*)(size_t)data6;\n        m_args[6] = (void*)(size_t)data7;\n        m_args[7] = (void*)(size_t)data8;\n        m_args[8] = (void*)(size_t)data9;\n        m_args[9] = (void*)(size_t)data10;\n        m_args[10] = (void*)(size_t)data11;\n        m_args[11] = (void*)(size_t)data12;\n    }\n};\n\n#else   // STRESS_LOG\n\n#define STRESS_LOG_VA(level,msg)                                        do { } while(0)\n#define STRESS_LOG0(facility, level, msg)                               do { } while(0)\n#define STRESS_LOG1(facility, level, msg, data1)                        do { } while(0)\n#define STRESS_LOG2(facility, level, msg, data1, data2)                 do { } while(0)\n#define STRESS_LOG2_CHECK_EE_STARTED(facility, level, msg, data1, data2)do { } while(0)\n#define STRESS_LOG3(facility, level, msg, data1, data2, data3)          do { } while(0)\n#define STRESS_LOG4(facility, level, msg, data1, data2, data3, data4)   do { } while(0)\n#define STRESS_LOG5(facility, level, msg, data1, data2, data3, data4, data5)   do { } while(0)\n#define STRESS_LOG6(facility, level, msg, data1, data2, data3, data4, data5, data6)   do { } while(0)\n#define STRESS_LOG7(facility, level, msg, data1, data2, data3, data4, data5, data6, data7)   do { } while(0)\n#define STRESS_LOG_PLUG_MOVE(plug_start, plug_end, plug_delta)          do { } while(0)\n#define STRESS_LOG_ROOT_PROMOTE(root_addr, objPtr, methodTable)         do { } while(0)\n#define STRESS_LOG_ROOT_RELOCATE(root_addr, old_value, new_value, methodTable) do { } while(0)\n#define STRESS_LOG_GC_START(gcCount, Gen, collectClasses)               do { } while(0)\n#define STRESS_LOG_GC_END(gcCount, Gen, collectClasses)                 do { } while(0)\n#define STRESS_LOG_OOM_STACK(size)   do { } while(0)\n#define STRESS_LOG_GC_STACK(size)   do { } while(0)\n#define STRESS_LOG_RESERVE_MEM(numChunks) do {} while (0)\n#endif // STRESS_LOG\n\n#endif // StressLog_h\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stringarraylist.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef STRINGARRAYLIST_H_\n#define STRINGARRAYLIST_H_\n\n\n//\n// StringArrayList is a simple class which is used to contain a growable\n// list of Strings, stored in chunks.  Based on top of ArrayList\n#include \"arraylist.h\"\n\n\nclass StringArrayList\n{\n    ArrayList m_Elements;\npublic:\n    DWORD GetCount() const;\n    SString& operator[] (DWORD idx) const;\n    SString& Get (DWORD idx) const;\n#ifndef DACCESS_COMPILE\n    void Append(const SString& string);\n    void AppendIfNotThere(const SString& string);\n#endif\n    ~StringArrayList();\n};\n\n\n#include \"stringarraylist.inl\"\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/stringarraylist.inl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#include \"ex.h\"\n\ninline SString& StringArrayList::operator[] (DWORD idx) const\n{\n    WRAPPER_NO_CONTRACT;\n    return Get(idx);\n}\n\ninline SString& StringArrayList::Get (DWORD idx) const\n{\n    WRAPPER_NO_CONTRACT;\n    PTR_SString ppRet=(PTR_SString)m_Elements.Get(idx);\n    return *ppRet;\n}\n\ninline DWORD StringArrayList::GetCount() const\n{\n    WRAPPER_NO_CONTRACT;\n    return m_Elements.GetCount();\n}\n\n#ifndef DACCESS_COMPILE\ninline void StringArrayList::Append(const SString& string)\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n    NewHolder<SString> pAdd=new SString(string);\n    pAdd->Normalize();\n    IfFailThrow(m_Elements.Append(pAdd));\n    pAdd.SuppressRelease();\n}\n\ninline void StringArrayList::AppendIfNotThere(const SString& string)\n{\n    CONTRACTL\n    {\n        THROWS;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n    for (DWORD i=0;i<GetCount();i++)\n    {\n        if(Get(i).Equals(string))\n            return;\n    }\n    Append(string);\n}\n\n#endif\n\n\ninline StringArrayList::~StringArrayList()\n{\n    CONTRACTL\n    {\n        DESTRUCTOR_CHECK;\n        NOTHROW;\n        GC_NOTRIGGER;\n    }\n    CONTRACTL_END;\n#ifndef DACCESS_COMPILE\n    for (DWORD i=0;i< GetCount() ;i++)\n    {\n        delete (SString*)m_Elements.Get(i);\n    }\n#endif\n}\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/strongnameholders.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __STRONGNAME_HOLDERS_H__\n#define __STRONGNAME_HOLDERS_H__\n\n#include <holder.h>\n#include <strongnameinternal.h>\n\n//\n// Holder classes for types returned from and used in strong name APIs\n//\n\n// Holder for any memory allocated by the strong name APIs\ntemplate<class T>\nvoid VoidStrongNameFreeBuffer(_In_ T *pBuffer)\n{\n    StrongNameFreeBuffer(reinterpret_cast<BYTE *>(pBuffer));\n}\ntemplate<typename _TYPE>\nusing StrongNameBufferHolder = SpecializedWrapper<_TYPE, VoidStrongNameFreeBuffer<_TYPE>>;\n\n#endif // !__STRONGNAME_HOLDERS_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/strongnameinternal.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// Strong name APIs which are not exposed publicly, but are built into StrongName.lib\n//\n\n#ifndef _STRONGNAME_INTERNAL_H\n#define _STRONGNAME_INTERNAL_H\n\n// Public key blob binary format.\ntypedef struct {\n    unsigned int SigAlgID;       // (ALG_ID) signature algorithm used to create the signature\n    unsigned int HashAlgID;      // (ALG_ID) hash algorithm used to create the signature\n    ULONG        cbPublicKey;    // length of the key in bytes\n    BYTE         PublicKey[1];   // variable length byte array containing the key value in format output by CryptoAPI\n} PublicKeyBlob;\n\n// Determine the number of bytes in a public key\nDWORD StrongNameSizeOfPublicKey(const PublicKeyBlob &keyPublicKey);\n\nbool StrongNameIsValidPublicKey(_In_reads_(cbPublicKeyBlob) const BYTE *pbPublicKeyBlob, DWORD cbPublicKeyBlob);\nbool StrongNameIsValidPublicKey(const PublicKeyBlob &keyPublicKey);\n\n// Determine if a public key is the ECMA key\nbool StrongNameIsEcmaKey(_In_reads_(cbKey) const BYTE *pbKey, DWORD cbKey);\nbool StrongNameIsEcmaKey(const PublicKeyBlob &keyPublicKey);\n\nHRESULT StrongNameTokenFromPublicKey(BYTE* pbPublicKeyBlob,  // [in] public key blob\n    ULONG    cbPublicKeyBlob,\n    BYTE** ppbStrongNameToken,     // [out] strong name token\n    ULONG* pcbStrongNameToken);\n\nVOID StrongNameFreeBuffer(BYTE* pbMemory);\n\n#endif // !_STRONGNAME_INTERNAL_H\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/switches.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// switches.h switch configuration of common runtime features\n//\n\n\n#define STRESS_HEAP\n\n\n#define VERIFY_HEAP\n\n#define GC_CONFIG_DRIVEN\n\n// define this to test data safety for the DAC. See code:DataTest::TestDataSafety.\n#define TEST_DATA_CONSISTENCY\n\n#if !defined(STRESS_LOG) && !defined(FEATURE_UTILCODE_NO_DEPENDENCIES)\n#define STRESS_LOG\n#endif\n\n#if defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define USE_CHECKED_OBJECTREFS\n#endif\n\n#ifndef TARGET_64BIT\n#define FAT_DISPATCH_TOKENS\n#endif\n\n#define FEATURE_SHARE_GENERIC_CODE\n\n#if defined(_DEBUG) && !defined(DACCESS_COMPILE)\n    #define LOGGING\n#endif\n\n#if !defined(FEATURE_UTILCODE_NO_DEPENDENCIES)\n// Failpoint support\n#if defined(_DEBUG) && !defined(DACCESS_COMPILE) && !defined(TARGET_UNIX)\n#define FAILPOINTS_ENABLED\n#endif\n#endif //!defined(FEATURE_UTILCODE_NO_DEPENDENCIES)\n\n#if 0\n    // Enable to track details of EESuspension\n    #define TIME_SUSPEND\n#endif // 0\n\n#ifndef DACCESS_COMPILE\n// Enabled to track GC statistics\n#define GC_STATS\n#endif\n\n#if defined(TARGET_X86) || defined(TARGET_ARM)\n    #define USE_LAZY_PREFERRED_RANGE       0\n\n#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_S390X) || defined(TARGET_LOONGARCH64) || defined(TARGET_POWERPC64)\n\n#if defined(HOST_UNIX)\n    // In PAL we have a smechanism that reserves memory on start up that is\n    // close to libcoreclr and intercepts calls to VirtualAlloc to serve back\n    // from this area.\n    #define USE_LAZY_PREFERRED_RANGE       0\n#else\n    // On Windows we lazily try to reserve memory close to coreclr.dll.\n    #define USE_LAZY_PREFERRED_RANGE       1\n#endif\n\n#else\n    #error Please add a new #elif clause and define all portability macros for the new platform\n#endif\n\n#if defined(HOST_64BIT)\n#define JIT_IS_ALIGNED\n#endif\n\n// ALLOW_SXS_JIT enables AltJit support for JIT-ing, via COMPlus_AltJit / COMPlus_AltJitName.\n// ALLOW_SXS_JIT_NGEN enables AltJit support for NGEN, via COMPlus_AltJitNgen / COMPlus_AltJitName.\n// Note that if ALLOW_SXS_JIT_NGEN is defined, then ALLOW_SXS_JIT must be defined.\n#define ALLOW_SXS_JIT\n#define ALLOW_SXS_JIT_NGEN\n\n#if !defined(TARGET_UNIX)\n// PLATFORM_SUPPORTS_THREADSUSPEND is defined for platforms where it is safe to call\n//   SuspendThread.  This API is dangerous on non-Windows platforms, as it can lead to\n//   deadlocks, due to low level OS resources that the PAL is not aware of, or due to\n//   the fact that PAL-unaware code in the process may hold onto some OS resources.\n#define PLATFORM_SUPPORTS_SAFE_THREADSUSPEND\n#endif // !TARGET_UNIX\n\n\n#if defined(STRESS_HEAP) && defined(_DEBUG) && defined(FEATURE_HIJACK)\n#define HAVE_GCCOVER\n#endif\n\n// Some platforms may see spurious AVs when GcCoverage is enabled because of races.\n// Enable further processing to see if they recur.\n#if defined(HAVE_GCCOVER) && (defined(TARGET_X86) || defined(TARGET_AMD64)) && !defined(TARGET_UNIX)\n#define GCCOVER_TOLERATE_SPURIOUS_AV\n#endif\n\n//Turns on a startup delay to allow simulation of slower and faster startup times.\n#define ENABLE_STARTUP_DELAY\n\n\n#ifdef _DEBUG\n\n//hurray DAC makes everything more fun - you can't have defines that control whether\n//or not data members are visible which differ between DAC and non-DAC builds.\n//All of the _DATA defines match DAC and non-DAC, the other defines here are off in the DAC.\n#if defined(PROFILING_SUPPORTED_DATA) || defined(PROFILING_SUPPORTED)\n// See code:ProfControlBlock#TestOnlyELT.\n#define PROF_TEST_ONLY_FORCE_ELT_DATA\n// See code:ProfControlBlock#TestOnlyObjectAllocated.\n#define PROF_TEST_ONLY_FORCE_OBJECT_ALLOCATED_DATA\n#endif // PROFILING_SUPPORTED_DATA || PROFILING_SUPPORTED\n\n#if defined(PROFILING_SUPPORTED)\n// See code:ProfControlBlock#TestOnlyELT.\n#define PROF_TEST_ONLY_FORCE_ELT\n// See code:ProfControlBlock#TestOnlyObjectAllocated.\n#define PROF_TEST_ONLY_FORCE_OBJECT_ALLOCATED\n#endif // PROFILING_SUPPORTED\n\n#endif // _DEBUG\n\n// MUST NEVER CHECK IN WITH THIS ENABLED.\n// This is just for convenience in doing performance investigations in a checked-out enlistment.\n// #define FEATURE_ENABLE_NO_RANGE_CHECKS\n\n// This controls whether a compilation-timing feature that relies on Windows APIs, if available, else direct\n// hardware instructions (rdtsc), for accessing high-resolution hardware timers is enabled. This is disabled\n// in Silverlight (just to avoid thinking about whether the extra code space is worthwhile).\n#define FEATURE_JIT_TIMER\n\n// This feature in RyuJIT supersedes the FEATURE_JIT_TIMER. In addition to supporting the time log file, this\n// feature also supports using COMPlus_JitTimeLogCsv=a.csv, which will dump method-level and phase-level timing\n// statistics. Also see comments on FEATURE_JIT_TIMER.\n#define FEATURE_JIT_METHOD_PERF\n\n\n#ifndef FEATURE_USE_ASM_GC_WRITE_BARRIERS\n// If we're not using assembly write barriers, then this turns on a performance measurement\n// mode that gathers and prints statistics about # of GC write barriers invokes.\n// #define FEATURE_COUNT_GC_WRITE_BARRIERS\n#endif\n\n// Enables a mode in which GC is completely conservative in stacks and registers: all stack slots and registers\n// are treated as potential pinned interior pointers. When enabled, the runtime flag COMPLUS_GCCONSERVATIVE\n// determines dynamically whether GC is conservative. Note that appdomain unload, LCG and unloadable assemblies\n// do not work reliably with conservative GC.\n#define FEATURE_CONSERVATIVE_GC 1\n\n#if (defined(TARGET_ARM) && (!defined(ARM_SOFTFP) || defined(CONFIGURABLE_ARM_ABI))) || defined(TARGET_ARM64)\n#define FEATURE_HFA\n#endif\n\n// ARM requires that 64-bit primitive types are aligned at 64-bit boundaries for interlocked-like operations.\n// Additionally the platform ABI requires these types and composite type containing them to be similarly\n// aligned when passed as arguments.\n#ifdef TARGET_ARM\n#define FEATURE_64BIT_ALIGNMENT\n#endif\n\n// Prefer double alignment for structs and arrays with doubles. Put arrays of doubles more agressively\n// into large object heap for performance because large object heap is 8 byte aligned\n#if !defined(FEATURE_64BIT_ALIGNMENT) && !defined(HOST_64BIT)\n#define FEATURE_DOUBLE_ALIGNMENT_HINT\n#endif\n\n#define FEATURE_MINIMETADATA_IN_TRIAGEDUMPS\n\n// If defined, support interpretation.\n\n#if !defined(TARGET_UNIX)\n#define FEATURE_STACK_SAMPLING\n#endif // defined (ALLOW_SXS_JIT)\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/targetosarch.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef targetosarch_h\n#define targetosarch_h\n\nclass TargetOS\n{\npublic:\n#ifdef TARGET_WINDOWS\n#define TARGET_WINDOWS_POSSIBLY_SUPPORTED\n    static const bool IsWindows = true;\n    static const bool IsUnix = false;\n    static const bool IsMacOS = false;\n#elif defined(TARGET_UNIX)\n#define TARGET_UNIX_POSSIBLY_SUPPORTED\n    static const bool IsWindows = false;\n    static const bool IsUnix = true;\n#if defined(TARGET_OSX)\n    static const bool IsMacOS = true;\n#else\n    static const bool IsMacOS = false;\n#endif\n#else\n#define TARGET_WINDOWS_POSSIBLY_SUPPORTED\n#define TARGET_UNIX_POSSIBLY_SUPPORTED\n#define TARGET_OS_RUNTIMEDETERMINED\n    static bool OSSettingConfigured;\n    static bool IsWindows;\n    static bool IsUnix;\n    static bool IsMacOS;\n#endif\n};\n\nclass TargetArchitecture\n{\npublic:\n#ifdef TARGET_ARM\n    static const bool IsX86 = false;\n    static const bool IsX64 = false;\n    static const bool IsArm64 = false;\n    static const bool IsArm32 = true;\n    static const bool IsArmArch = true;\n    static const bool IsLoongArch64 = false;\n#elif defined(TARGET_ARM64)\n    static const bool IsX86 = false;\n    static const bool IsX64 = false;\n    static const bool IsArm64 = true;\n    static const bool IsArm32 = false;\n    static const bool IsArmArch = true;\n    static const bool IsLoongArch64 = false;\n#elif defined(TARGET_AMD64)\n    static const bool IsX86 = false;\n    static const bool IsX64 = true;\n    static const bool IsArm64 = false;\n    static const bool IsArm32 = false;\n    static const bool IsArmArch = false;\n    static const bool IsLoongArch64 = false;\n#elif defined(TARGET_X86)\n    static const bool IsX86 = true;\n    static const bool IsX64 = false;\n    static const bool IsArm64 = false;\n    static const bool IsArm32 = false;\n    static const bool IsArmArch = false;\n    static const bool IsLoongArch64 = false;\n#elif defined(TARGET_LOONGARCH64)\n    static const bool IsX86 = false;\n    static const bool IsX64 = false;\n    static const bool IsArm64 = false;\n    static const bool IsArm32 = false;\n    static const bool IsArmArch = false;\n    static const bool IsLoongArch64 = true;\n#else\n#error Unknown architecture\n#endif\n};\n\n#endif // targetosarch_h\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/thekey.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n#pragma once\n// This file allows customization of the strongname key used to replace the ECMA key\n\nstatic const BYTE g_rbTheKey[] =\n{\n0x00,0x24,0x00,0x00,0x04,0x80,0x00,0x00,0x94,0x00,0x00,0x00,0x06,0x02,0x00,0x00,\n0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31,0x00,0x04,0x00,0x00,0x01,0x00,0x01,0x00,\n0x07,0xd1,0xfa,0x57,0xc4,0xae,0xd9,0xf0,0xa3,0x2e,0x84,0xaa,0x0f,0xae,0xfd,0x0d,\n0xe9,0xe8,0xfd,0x6a,0xec,0x8f,0x87,0xfb,0x03,0x76,0x6c,0x83,0x4c,0x99,0x92,0x1e,\n0xb2,0x3b,0xe7,0x9a,0xd9,0xd5,0xdc,0xc1,0xdd,0x9a,0xd2,0x36,0x13,0x21,0x02,0x90,\n0x0b,0x72,0x3c,0xf9,0x80,0x95,0x7f,0xc4,0xe1,0x77,0x10,0x8f,0xc6,0x07,0x77,0x4f,\n0x29,0xe8,0x32,0x0e,0x92,0xea,0x05,0xec,0xe4,0xe8,0x21,0xc0,0xa5,0xef,0xe8,0xf1,\n0x64,0x5c,0x4c,0x0c,0x93,0xc1,0xab,0x99,0x28,0x5d,0x62,0x2c,0xaa,0x65,0x2c,0x1d,\n0xfa,0xd6,0x3d,0x74,0x5d,0x6f,0x2d,0xe5,0xf1,0x7e,0x5e,0xaf,0x0f,0xc4,0x96,0x3d,\n0x26,0x1c,0x8a,0x12,0x43,0x65,0x18,0x20,0x6d,0xc0,0x93,0x34,0x4d,0x5a,0xd2,0x93\n};\n\nstatic const BYTE g_rbTheKeyToken[] = {0xb0,0x3f,0x5f,0x7f,0x11,0xd5,0x0a,0x3a};\n\n\nstatic const BYTE g_rbTheSilverlightPlatformKey[] =\n{\n0x00,0x24,0x00,0x00,0x04,0x80,0x00,0x00,0x94,0x00,0x00,0x00,0x06,0x02,0x00,0x00,\n0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31,0x00,0x04,0x00,0x00,0x01,0x00,0x01,0x00,\n0x8d,0x56,0xc7,0x6f,0x9e,0x86,0x49,0x38,0x30,0x49,0xf3,0x83,0xc4,0x4b,0xe0,0xec,\n0x20,0x41,0x81,0x82,0x2a,0x6c,0x31,0xcf,0x5e,0xb7,0xef,0x48,0x69,0x44,0xd0,0x32,\n0x18,0x8e,0xa1,0xd3,0x92,0x07,0x63,0x71,0x2c,0xcb,0x12,0xd7,0x5f,0xb7,0x7e,0x98,\n0x11,0x14,0x9e,0x61,0x48,0xe5,0xd3,0x2f,0xba,0xab,0x37,0x61,0x1c,0x18,0x78,0xdd,\n0xc1,0x9e,0x20,0xef,0x13,0x5d,0x0c,0xb2,0xcf,0xf2,0xbf,0xec,0x3d,0x11,0x58,0x10,\n0xc3,0xd9,0x06,0x96,0x38,0xfe,0x4b,0xe2,0x15,0xdb,0xf7,0x95,0x86,0x19,0x20,0xe5,\n0xab,0x6f,0x7d,0xb2,0xe2,0xce,0xef,0x13,0x6a,0xc2,0x3d,0x5d,0xd2,0xbf,0x03,0x17,\n0x00,0xae,0xc2,0x32,0xf6,0xc6,0xb1,0xc7,0x85,0xb4,0x30,0x5c,0x12,0x3b,0x37,0xab\n};\n\nstatic const BYTE g_rbTheSilverlightPlatformKeyToken[] = {0x7c,0xec,0x85,0xd7,0xbe,0xa7,0x79,0x8e};\n\nstatic const BYTE g_rbTheSilverlightKey[] =\n{\n0x00,0x24,0x00,0x00,0x04,0x80,0x00,0x00,0x94,0x00,0x00,0x00,0x06,0x02,0x00,0x00,\n0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31,0x00,0x04,0x00,0x00,0x01,0x00,0x01,0x00,\n0xb5,0xfc,0x90,0xe7,0x02,0x7f,0x67,0x87,0x1e,0x77,0x3a,0x8f,0xde,0x89,0x38,0xc8,\n0x1d,0xd4,0x02,0xba,0x65,0xb9,0x20,0x1d,0x60,0x59,0x3e,0x96,0xc4,0x92,0x65,0x1e,\n0x88,0x9c,0xc1,0x3f,0x14,0x15,0xeb,0xb5,0x3f,0xac,0x11,0x31,0xae,0x0b,0xd3,0x33,\n0xc5,0xee,0x60,0x21,0x67,0x2d,0x97,0x18,0xea,0x31,0xa8,0xae,0xbd,0x0d,0xa0,0x07,\n0x2f,0x25,0xd8,0x7d,0xba,0x6f,0xc9,0x0f,0xfd,0x59,0x8e,0xd4,0xda,0x35,0xe4,0x4c,\n0x39,0x8c,0x45,0x43,0x07,0xe8,0xe3,0x3b,0x84,0x26,0x14,0x3d,0xae,0xc9,0xf5,0x96,\n0x83,0x6f,0x97,0xc8,0xf7,0x47,0x50,0xe5,0x97,0x5c,0x64,0xe2,0x18,0x9f,0x45,0xde,\n0xf4,0x6b,0x2a,0x2b,0x12,0x47,0xad,0xc3,0x65,0x2b,0xf5,0xc3,0x08,0x05,0x5d,0xa9\n};\n\nstatic const BYTE g_rbTheSilverlightKeyToken[] = {0x31,0xBF,0x38,0x56,0xAD,0x36,0x4E,0x35};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/tls.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// TLS.H -\n//\n\n//\n// Encapsulates TLS access for maximum performance.\n//\n\n// **************************************************************************************\n// WARNING!!!: These values are used by SOS in the diagnostics repo and need to the same.\n// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/tls.h\n// **************************************************************************************\n\n#ifndef __tls_h__\n#define __tls_h__\n\n#define OFFSETOF__TLS__tls_CurrentThread         (0x0)\n#define OFFSETOF__TLS__tls_EETlsData             (2*sizeof(void*))\n\n#ifdef TARGET_64BIT\n#define WINNT_OFFSETOF__TEB__ThreadLocalStoragePointer  0x58\n#else\n#define WINNT_OFFSETOF__TEB__ThreadLocalStoragePointer  0x2c\n#endif\n\n#endif // __tls_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/unreachable.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// ---------------------------------------------------------------------------\n// unreachable.h\n// ---------------------------------------------------------------------------\n\n\n#ifndef __UNREACHABLE_H__\n#define __UNREACHABLE_H__\n\n#if defined(_MSC_VER) || defined(_PREFIX_)\n#if defined(TARGET_AMD64)\n// Empty methods that consist of UNREACHABLE() result in a zero-sized declspec(noreturn) method\n// which causes the pdb file to make the next method declspec(noreturn) as well, thus breaking BBT\n// Remove when we get a VC compiler that fixes VSW 449170\n# define __UNREACHABLE() do { DebugBreak(); __assume(0); } while (0)\n#else\n# define __UNREACHABLE() __assume(0)\n#endif\n#else\n#define __UNREACHABLE() __builtin_unreachable()\n#endif\n\n#endif // __UNREACHABLE_H__\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/utilcode.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//*****************************************************************************\n// UtilCode.h\n//\n// Utility functions implemented in UtilCode.lib.\n//\n//*****************************************************************************\n\n#ifndef __UtilCode_h__\n#define __UtilCode_h__\n\n#include \"crtwrap.h\"\n#include \"winwrap.h\"\n#include <wchar.h>\n#include <stdio.h>\n#include <malloc.h>\n#include <ole2.h>\n#include <oleauto.h>\n#include <limits.h>\n#include \"clrtypes.h\"\n#include \"safewrap.h\"\n#include \"volatile.h\"\n#include <daccess.h>\n#include \"clrhost.h\"\n#include \"debugmacros.h\"\n#include \"corhlprpriv.h\"\n#include \"check.h\"\n#include \"safemath.h\"\n#include \"new.hpp\"\n\n#ifdef PAL_STDCPP_COMPAT\n#include <type_traits>\n#else\n#include \"clr_std/type_traits\"\n#endif\n\n#include \"contract.h\"\n\n#include<minipal/utils.h>\n\n#include \"clrnt.h\"\n\n#include \"random.h\"\n\n#define WINDOWS_KERNEL32_DLLNAME_A \"kernel32\"\n#define WINDOWS_KERNEL32_DLLNAME_W W(\"kernel32\")\n\n#define CoreLibName_W W(\"System.Private.CoreLib\")\n#define CoreLibName_IL_W W(\"System.Private.CoreLib.dll\")\n#define CoreLibName_NI_W W(\"System.Private.CoreLib.ni.dll\")\n#define CoreLibName_TLB_W W(\"System.Private.CoreLib.tlb\")\n#define CoreLibName_A \"System.Private.CoreLib\"\n#define CoreLibName_IL_A \"System.Private.CoreLib.dll\"\n#define CoreLibName_NI_A \"System.Private.CoreLib.ni.dll\"\n#define CoreLibName_TLB_A \"System.Private.CoreLib.tlb\"\n#define CoreLibNameLen 22\n#define CoreLibSatelliteName_A \"System.Private.CoreLib.resources\"\n#define CoreLibSatelliteNameLen 32\n\nclass StringArrayList;\n\n#if !defined(_DEBUG_IMPL) && defined(_DEBUG) && !defined(DACCESS_COMPILE)\n#define _DEBUG_IMPL 1\n#endif\n\n#ifdef TARGET_ARM\n\n// Under ARM we generate code only with Thumb encoding. In order to ensure we execute such code in the correct\n// mode we must ensure the low-order bit is set in any code address we'll call as a sub-routine. In C++ this\n// is handled automatically for us by the compiler. When generating and working with code generated\n// dynamically we have to be careful to set or mask-out this bit as appropriate.\n#ifndef THUMB_CODE\n#define THUMB_CODE 1\n#endif\n\n// Given a WORD extract the bitfield [lowbit, highbit] (i.e. BitExtract(0xffff, 15, 0) == 0xffff).\ninline WORD BitExtract(WORD wValue, DWORD highbit, DWORD lowbit)\n{\n    _ASSERTE((highbit < 16) && (lowbit < 16) && (highbit >= lowbit));\n    return (wValue >> lowbit) & ((1 << ((highbit - lowbit) + 1)) - 1);\n}\n\n// Determine whether an ARM Thumb mode instruction is 32-bit or 16-bit based on the first WORD of the\n// instruction.\ninline bool Is32BitInstruction(WORD opcode)\n{\n    return BitExtract(opcode, 15, 11) >= 0x1d;\n}\n\ntemplate <typename ResultType, typename SourceType>\ninline ResultType DataPointerToThumbCode(SourceType pCode)\n{\n    return (ResultType)(((UINT_PTR)pCode) | THUMB_CODE);\n}\n\ntemplate <typename ResultType, typename SourceType>\ninline ResultType ThumbCodeToDataPointer(SourceType pCode)\n{\n    return (ResultType)(((UINT_PTR)pCode) & ~THUMB_CODE);\n}\n\n#endif // TARGET_ARM\n\n// Convert from a PCODE to the corresponding PINSTR.  On many architectures this will be the identity function;\n// on ARM, this will mask off the THUMB bit.\ninline TADDR PCODEToPINSTR(PCODE pc)\n{\n#ifdef TARGET_ARM\n    return ThumbCodeToDataPointer<TADDR,PCODE>(pc);\n#else\n    return dac_cast<PCODE>(pc);\n#endif\n}\n\n// Convert from a PINSTR to the corresponding PCODE.  On many architectures this will be the identity function;\n// on ARM, this will raise the THUMB bit.\ninline PCODE PINSTRToPCODE(TADDR addr)\n{\n#ifdef TARGET_ARM\n    return DataPointerToThumbCode<PCODE,TADDR>(addr);\n#else\n    return dac_cast<PCODE>(addr);\n#endif\n}\n\ntypedef LPCSTR  LPCUTF8;\ntypedef LPSTR   LPUTF8;\n\n#include \"nsutilpriv.h\"\n\n#include \"stdmacros.h\"\n\n//********** Macros. **********************************************************\n#ifndef FORCEINLINE\n #if _MSC_VER < 1200\n   #define FORCEINLINE inline\n #else\n   #define FORCEINLINE __forceinline\n #endif\n#endif\n\n#ifndef DEBUG_NOINLINE\n#if defined(_DEBUG)\n#define DEBUG_NOINLINE NOINLINE\n#else\n#define DEBUG_NOINLINE\n#endif\n#endif\n\n#include <stddef.h> // for offsetof\n#include <minipal/utils.h>\n\n#define IS_DIGIT(ch) (((ch) >= W('0')) && ((ch) <= W('9')))\n#define DIGIT_TO_INT(ch) ((ch) - W('0'))\n#define INT_TO_DIGIT(i) ((WCHAR)(W('0') + (i)))\n\n\n// Helper will 4 byte align a value, rounding up.\n#define ALIGN4BYTE(val) (((val) + 3) & ~0x3)\n\n#ifdef  _DEBUG\n#define DEBUGARG(x)         , x\n#else\n#define DEBUGARG(x)\n#endif\n\n#ifndef sizeofmember\n// Returns the size of a class or struct member.\n#define sizeofmember(c,m) (sizeof(((c*)0)->m))\n#endif\n\n//=--------------------------------------------------------------------------=\n// Prefast helpers.\n//\n\n#include \"safemath.h\"\n\n\n//=--------------------------------------------------------------------------=\n// string helpers.\n\n//\n// given and ANSI String, copy it into a wide buffer.\n// be careful about scoping when using this macro!\n//\n// how to use the below two macros:\n//\n//  ...\n//  LPSTR pszA;\n//  pszA = MyGetAnsiStringRoutine();\n//  MAKE_WIDEPTR_FROMANSI(pwsz, pszA);\n//  MyUseWideStringRoutine(pwsz);\n//  ...\n//\n// similarily for MAKE_ANSIPTR_FROMWIDE.  note that the first param does not\n// have to be declared, and no clean up must be done.\n//\n\n// We'll define an upper limit that allows multiplication by 4 (the max\n// bytes/char in UTF-8) but still remains positive, and allows some room for pad.\n// Under normal circumstances, we should never get anywhere near this limit.\n#define MAKE_MAX_LENGTH 0x1fffff00\n\n#ifndef MAKE_TOOLONGACTION\n#define MAKE_TOOLONGACTION ThrowHR(COR_E_OVERFLOW)\n#endif\n\n#ifndef MAKE_TRANSLATIONFAILED\n#define MAKE_TRANSLATIONFAILED ThrowWin32(ERROR_NO_UNICODE_TRANSLATION)\n#endif\n\n// This version throws on conversion errors (ie, no best fit character\n// mapping to characters that look similar, and no use of the default char\n// ('?') when printing out unrepresentable characters.  Use this method for\n// most development in the EE, especially anything like metadata or class\n// names.  See the BESTFIT version if you're printing out info to the console.\n#define MAKE_MULTIBYTE_FROMWIDE(ptrname, widestr, codepage) \\\n    int __l##ptrname = (int)wcslen(widestr);        \\\n    if (__l##ptrname > MAKE_MAX_LENGTH)         \\\n        MAKE_TOOLONGACTION;                     \\\n    __l##ptrname = (int)((__l##ptrname + 1) * 2 * sizeof(char)); \\\n    CQuickBytes __CQuickBytes##ptrname; \\\n    __CQuickBytes##ptrname.AllocThrows(__l##ptrname); \\\n    BOOL __b##ptrname; \\\n    DWORD __cBytes##ptrname = WszWideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, widestr, -1, (LPSTR)__CQuickBytes##ptrname.Ptr(), __l##ptrname, NULL, &__b##ptrname); \\\n    if (__b##ptrname || (__cBytes##ptrname == 0 && (widestr[0] != W('\\0')))) { \\\n        MAKE_TRANSLATIONFAILED; \\\n    } \\\n    LPSTR ptrname = (LPSTR)__CQuickBytes##ptrname.Ptr()\n\n// This version does best fit character mapping and also allows the use\n// of the default char ('?') for any Unicode character that isn't\n// representable.  This is reasonable for writing to the console, but\n// shouldn't be used for most string conversions.\n#define MAKE_MULTIBYTE_FROMWIDE_BESTFIT(ptrname, widestr, codepage) \\\n    int __l##ptrname = (int)wcslen(widestr);        \\\n    if (__l##ptrname > MAKE_MAX_LENGTH)         \\\n        MAKE_TOOLONGACTION;                     \\\n    __l##ptrname = (int)((__l##ptrname + 1) * 2 * sizeof(char)); \\\n    CQuickBytes __CQuickBytes##ptrname; \\\n    __CQuickBytes##ptrname.AllocThrows(__l##ptrname); \\\n    DWORD __cBytes##ptrname = WszWideCharToMultiByte(codepage, 0, widestr, -1, (LPSTR)__CQuickBytes##ptrname.Ptr(), __l##ptrname, NULL, NULL); \\\n    if (__cBytes##ptrname == 0 && __l##ptrname != 0) { \\\n        MAKE_TRANSLATIONFAILED; \\\n    } \\\n    LPSTR ptrname = (LPSTR)__CQuickBytes##ptrname.Ptr()\n\n// Use for anything critical other than output to console, where weird\n// character mappings are unacceptable.\n#define MAKE_ANSIPTR_FROMWIDE(ptrname, widestr) MAKE_MULTIBYTE_FROMWIDE(ptrname, widestr, CP_ACP)\n\n// Use for output to the console.\n#define MAKE_ANSIPTR_FROMWIDE_BESTFIT(ptrname, widestr) MAKE_MULTIBYTE_FROMWIDE_BESTFIT(ptrname, widestr, CP_ACP)\n\n#define MAKE_WIDEPTR_FROMANSI(ptrname, ansistr) \\\n    CQuickBytes __qb##ptrname; \\\n    int __l##ptrname; \\\n    __l##ptrname = WszMultiByteToWideChar(CP_ACP, 0, ansistr, -1, 0, 0); \\\n    if (__l##ptrname > MAKE_MAX_LENGTH) \\\n        MAKE_TOOLONGACTION; \\\n    LPWSTR ptrname = (LPWSTR) __qb##ptrname.AllocThrows((__l##ptrname+1)*sizeof(WCHAR));  \\\n    if (WszMultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, ansistr, -1, ptrname, __l##ptrname) == 0) { \\\n        MAKE_TRANSLATIONFAILED; \\\n    }\n\n#define MAKE_WIDEPTR_FROMANSI_NOTHROW(ptrname, ansistr) \\\n    CQuickBytes __qb##ptrname; \\\n    LPWSTR ptrname = 0; \\\n    int __l##ptrname; \\\n    __l##ptrname = WszMultiByteToWideChar(CP_ACP, 0, ansistr, -1, 0, 0); \\\n    if (__l##ptrname <= MAKE_MAX_LENGTH) { \\\n        ptrname = (LPWSTR) __qb##ptrname.AllocNoThrow((__l##ptrname+1)*sizeof(WCHAR));  \\\n        if (ptrname) { \\\n            if (WszMultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, ansistr, -1, ptrname, __l##ptrname) != 0) { \\\n                ptrname[__l##ptrname] = 0; \\\n            } else { \\\n                ptrname = 0; \\\n            } \\\n        } \\\n    }\n\n#define MAKE_UTF8PTR_FROMWIDE(ptrname, widestr) CQuickBytes _##ptrname; _##ptrname.ConvertUnicode_Utf8(widestr); LPSTR ptrname = (LPSTR) _##ptrname.Ptr();\n\n#define MAKE_UTF8PTR_FROMWIDE_NOTHROW(ptrname, widestr) \\\n    CQuickBytes __qb##ptrname; \\\n    int __l##ptrname = (int)wcslen(widestr); \\\n    LPUTF8 ptrname = 0; \\\n    if (__l##ptrname <= MAKE_MAX_LENGTH) { \\\n        __l##ptrname = (int)((__l##ptrname + 1) * 2 * sizeof(char)); \\\n        ptrname = (LPUTF8) __qb##ptrname.AllocNoThrow(__l##ptrname); \\\n    } \\\n    if (ptrname) { \\\n        INT32 __lresult##ptrname=WszWideCharToMultiByte(CP_UTF8, 0, widestr, -1, ptrname, __l##ptrname-1, NULL, NULL); \\\n        DWORD __dwCaptureLastError##ptrname = ::GetLastError(); \\\n        if ((__lresult##ptrname==0) && (((LPCWSTR)widestr)[0] != W('\\0'))) { \\\n            if (__dwCaptureLastError##ptrname==ERROR_INSUFFICIENT_BUFFER) { \\\n                INT32 __lsize##ptrname=WszWideCharToMultiByte(CP_UTF8, 0, widestr, -1, NULL, 0, NULL, NULL); \\\n                ptrname = (LPSTR) __qb##ptrname .AllocNoThrow(__lsize##ptrname); \\\n                if (ptrname) { \\\n                    if (WszWideCharToMultiByte(CP_UTF8, 0, widestr, -1, ptrname, __lsize##ptrname, NULL, NULL) != 0) { \\\n                        ptrname[__l##ptrname] = 0; \\\n                    } else { \\\n                        ptrname = 0; \\\n                    } \\\n                } \\\n            } \\\n            else { \\\n                ptrname = 0; \\\n            } \\\n        } \\\n    } \\\n\n#define MAKE_WIDEPTR_FROMUTF8N(ptrname, utf8str, n8chrs) \\\n    CQuickBytes __qb##ptrname; \\\n    int __l##ptrname; \\\n    __l##ptrname = WszMultiByteToWideChar(CP_UTF8, 0, utf8str, n8chrs, 0, 0); \\\n    if (__l##ptrname > MAKE_MAX_LENGTH) \\\n        MAKE_TOOLONGACTION; \\\n    LPWSTR ptrname = (LPWSTR) __qb##ptrname .AllocThrows((__l##ptrname+1)*sizeof(WCHAR)); \\\n    if (0==WszMultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8str, n8chrs, ptrname, __l##ptrname)) { \\\n        MAKE_TRANSLATIONFAILED; \\\n    } \\\n    ptrname[__l##ptrname] = 0;\n\n\n#define MAKE_WIDEPTR_FROMUTF8(ptrname, utf8str) CQuickBytes _##ptrname;  _##ptrname.ConvertUtf8_Unicode(utf8str); LPCWSTR ptrname = (LPCWSTR) _##ptrname.Ptr();\n\n\n#define MAKE_WIDEPTR_FROMUTF8N_NOTHROW(ptrname, utf8str, n8chrs) \\\n    CQuickBytes __qb##ptrname; \\\n    int __l##ptrname; \\\n    LPWSTR ptrname = 0; \\\n    __l##ptrname = WszMultiByteToWideChar(CP_UTF8, 0, utf8str, n8chrs, 0, 0); \\\n    if (__l##ptrname <= MAKE_MAX_LENGTH) { \\\n        ptrname = (LPWSTR) __qb##ptrname.AllocNoThrow((__l##ptrname+1)*sizeof(WCHAR));  \\\n        if (ptrname) { \\\n            if (WszMultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, utf8str, n8chrs, ptrname, __l##ptrname) != 0) { \\\n                ptrname[__l##ptrname] = 0; \\\n            } else { \\\n                ptrname = 0; \\\n            } \\\n        } \\\n    }\n\n#define MAKE_WIDEPTR_FROMUTF8_NOTHROW(ptrname, utf8str)   MAKE_WIDEPTR_FROMUTF8N_NOTHROW(ptrname, utf8str, -1)\n\n// This method takes the number of characters\n#define MAKE_MULTIBYTE_FROMWIDEN(ptrname, widestr, _nCharacters, _pCnt, codepage)        \\\n    CQuickBytes __qb##ptrname; \\\n    int __l##ptrname; \\\n    __l##ptrname = WszWideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, widestr, _nCharacters, NULL, 0, NULL, NULL);           \\\n    if (__l##ptrname > MAKE_MAX_LENGTH) \\\n        MAKE_TOOLONGACTION; \\\n    ptrname = (LPUTF8) __qb##ptrname .AllocThrows(__l##ptrname+1); \\\n    BOOL __b##ptrname; \\\n    DWORD _pCnt = WszWideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, widestr, _nCharacters, ptrname, __l##ptrname, NULL, &__b##ptrname);  \\\n    if (__b##ptrname || (_pCnt == 0 && _nCharacters > 0)) { \\\n        MAKE_TRANSLATIONFAILED; \\\n    } \\\n    ptrname[__l##ptrname] = 0;\n\n#define MAKE_MULTIBYTE_FROMWIDEN_BESTFIT(ptrname, widestr, _nCharacters, _pCnt, codepage)        \\\n    CQuickBytes __qb##ptrname; \\\n    int __l##ptrname; \\\n    __l##ptrname = WszWideCharToMultiByte(codepage, 0, widestr, _nCharacters, NULL, 0, NULL, NULL);           \\\n    if (__l##ptrname > MAKE_MAX_LENGTH) \\\n        MAKE_TOOLONGACTION; \\\n    ptrname = (LPUTF8) __qb##ptrname .AllocThrows(__l##ptrname+1); \\\n    DWORD _pCnt = WszWideCharToMultiByte(codepage, 0, widestr, _nCharacters, ptrname, __l##ptrname, NULL, NULL);  \\\n    if (_pCnt == 0 && _nCharacters > 0) { \\\n        MAKE_TRANSLATIONFAILED; \\\n    } \\\n    ptrname[__l##ptrname] = 0;\n\n#define MAKE_ANSIPTR_FROMWIDEN(ptrname, widestr, _nCharacters, _pCnt)        \\\n       MAKE_MULTIBYTE_FROMWIDEN(ptrname, widestr, _nCharacters, _pCnt, CP_ACP)\n\nconst SIZE_T MaxSigned32BitDecString = ARRAY_SIZE(\"-2147483648\") - 1;\nconst SIZE_T MaxUnsigned32BitDecString = ARRAY_SIZE(\"4294967295\") - 1;\nconst SIZE_T MaxIntegerDecHexString = ARRAY_SIZE(\"-9223372036854775808\") - 1;\n\nconst SIZE_T Max16BitHexString = ARRAY_SIZE(\"1234\") - 1;\nconst SIZE_T Max32BitHexString = ARRAY_SIZE(\"12345678\") - 1;\nconst SIZE_T Max64BitHexString = ARRAY_SIZE(\"1234567812345678\") - 1;\n\ntemplate <typename I>\ninline WCHAR* FormatInteger(WCHAR* str, size_t strCount, const char* fmt, I v)\n{\n    static_assert(std::is_integral<I>::value, \"Integral type required.\");\n    assert(str != NULL && fmt != NULL);\n\n    // Represents the most amount of space needed to format\n    // an integral type (i.e., %d or %llx).\n    char tmp[MaxIntegerDecHexString + 1];\n    int cnt = sprintf_s(tmp, ARRAY_SIZE(tmp), fmt, v);\n    assert(0 <= cnt);\n\n    WCHAR* end = str + strCount;\n    for (int i = 0; i < cnt; ++i)\n    {\n        if (str == end)\n            return NULL;\n\n        *str++ = (WCHAR)tmp[i];\n    }\n\n    *str = W('\\0');\n    return str;\n}\n\ninline\nLPWSTR DuplicateString(\n    LPCWSTR wszString,\n    size_t  cchString)\n{\n    STATIC_CONTRACT_NOTHROW;\n\n    LPWSTR wszDup = NULL;\n    if (wszString != NULL)\n    {\n        wszDup = new (nothrow) WCHAR[cchString + 1];\n        if (wszDup != NULL)\n        {\n            wcscpy_s(wszDup, cchString + 1, wszString);\n        }\n    }\n    return wszDup;\n}\n\ninline\nLPWSTR DuplicateString(\n    LPCWSTR wszString)\n{\n    STATIC_CONTRACT_NOTHROW;\n\n    if (wszString != NULL)\n    {\n        return DuplicateString(wszString, wcslen(wszString));\n    }\n    else\n    {\n        return NULL;\n    }\n}\n\nvoid DECLSPEC_NORETURN ThrowOutOfMemory();\n\ninline\nLPWSTR DuplicateStringThrowing(\n    LPCWSTR wszString,\n    size_t cchString)\n{\n    STATIC_CONTRACT_THROWS;\n\n    if (wszString == NULL)\n        return NULL;\n\n    LPWSTR wszDup = DuplicateString(wszString, cchString);\n    if (wszDup == NULL)\n        ThrowOutOfMemory();\n\n    return wszDup;\n}\n\ninline\nLPWSTR DuplicateStringThrowing(\n    LPCWSTR wszString)\n{\n    STATIC_CONTRACT_THROWS;\n\n    if (wszString == NULL)\n        return NULL;\n\n    LPWSTR wszDup = DuplicateString(wszString);\n    if (wszDup == NULL)\n        ThrowOutOfMemory();\n\n    return wszDup;\n}\n\n\n//*****************************************************************************\n// Placement new is used to new and object at an exact location.  The pointer\n// is simply returned to the caller without actually using the heap.  The\n// advantage here is that you cause the ctor() code for the object to be run.\n// This is ideal for heaps of C++ objects that need to get init'd multiple times.\n// Example:\n//      void        *pMem = GetMemFromSomePlace();\n//      Foo *p = new (pMem) Foo;\n//      DoSomething(p);\n//      p->~Foo();\n//*****************************************************************************\n#ifndef __PLACEMENT_NEW_INLINE\n#define __PLACEMENT_NEW_INLINE\ninline void *__cdecl operator new(size_t, void *_P)\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n\n    return (_P);\n}\n#endif // __PLACEMENT_NEW_INLINE\n\n\n/********************************************************************************/\n/* portability helpers */\n\n#ifdef TARGET_64BIT\n#define IN_TARGET_64BIT(x)     x\n#define IN_TARGET_32BIT(x)\n#else\n#define IN_TARGET_64BIT(x)\n#define IN_TARGET_32BIT(x)     x\n#endif\n\nvoid * __cdecl\noperator new(size_t n);\n\n_Ret_bytecap_(n) void * __cdecl\noperator new[](size_t n);\n\nvoid __cdecl\noperator delete(void *p) NOEXCEPT;\n\nvoid __cdecl\noperator delete[](void *p) NOEXCEPT;\n\n#ifdef _DEBUG_IMPL\nHRESULT _OutOfMemory(LPCSTR szFile, int iLine);\n#define OutOfMemory() _OutOfMemory(__FILE__, __LINE__)\n#else\ninline HRESULT OutOfMemory()\n{\n    LIMITED_METHOD_CONTRACT;\n    return (E_OUTOFMEMORY);\n}\n#endif\n\n//*****************************************************************************\n// Handle accessing localizable resource strings\n//*****************************************************************************\ntypedef LPCWSTR LocaleID;\ntypedef WCHAR LocaleIDValue[LOCALE_NAME_MAX_LENGTH];\n\n// Notes about the culture callbacks:\n// - The language we're operating in can change at *runtime*!\n// - A process may operate in *multiple* languages.\n//     (ex: Each thread may have it's own language)\n// - If we don't care what language we're in (or have no way of knowing),\n//     then return a 0-length name and UICULTUREID_DONTCARE for the culture ID.\n// - GetCultureName() and the GetCultureId() must be in sync (refer to the\n//     same language).\n// - We have two functions separate functions for better performance.\n//     - The name is used to resolve a directory for MsCorRC.dll.\n//     - The id is used as a key to map to a dll hinstance.\n\n// Callback to obtain both the culture name and the culture's parent culture name\ntypedef HRESULT (*FPGETTHREADUICULTURENAMES)(__inout StringArrayList* pCultureNames);\nconst LPCWSTR UICULTUREID_DONTCARE = NULL;\n\ntypedef int (*FPGETTHREADUICULTUREID)(LocaleIDValue*);\n\nHMODULE CLRLoadLibrary(LPCWSTR lpLibFileName);\n\nHMODULE CLRLoadLibraryEx(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);\n\nBOOL CLRFreeLibrary(HMODULE hModule);\n\n// Load a string using the resources for the current module.\nSTDAPI UtilLoadStringRC(UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax, int bQuiet=FALSE);\n\n// Specify callbacks so that UtilLoadStringRC can find out which language we're in.\n// If no callbacks specified (or both parameters are NULL), we default to the\n// resource dll in the root (which is probably english).\nvoid SetResourceCultureCallbacks(\n    FPGETTHREADUICULTURENAMES fpGetThreadUICultureNames,\n    FPGETTHREADUICULTUREID fpGetThreadUICultureId\n);\n\nvoid GetResourceCultureCallbacks(\n        FPGETTHREADUICULTURENAMES* fpGetThreadUICultureNames,\n        FPGETTHREADUICULTUREID* fpGetThreadUICultureId\n);\n\n//*****************************************************************************\n// Use this class by privately deriving from noncopyable to disallow copying of\n// your class.\n//*****************************************************************************\nclass noncopyable\n{\nprotected:\n    noncopyable()\n    {}\n    ~noncopyable()\n    {}\n\nprivate:\n    noncopyable(const noncopyable&);\n    const noncopyable& operator=(const noncopyable&);\n};\n\n//*****************************************************************************\n// Must associate each handle to an instance of a resource dll with the int\n// that it represents\n//*****************************************************************************\ntypedef HINSTANCE HRESOURCEDLL;\n\n\nclass CCulturedHInstance\n{\n    LocaleIDValue   m_LangId;\n    HRESOURCEDLL    m_hInst;\n    BOOL            m_fMissing;\n\npublic:\n    CCulturedHInstance()\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_hInst = NULL;\n        m_fMissing = FALSE;\n    }\n\n    BOOL HasID(LocaleID id)\n    {\n        _ASSERTE(m_hInst != NULL || m_fMissing);\n        if (id == UICULTUREID_DONTCARE)\n            return FALSE;\n\n        return wcscmp(id, m_LangId) == 0;\n    }\n\n    HRESOURCEDLL GetLibraryHandle()\n    {\n        return m_hInst;\n    }\n\n    BOOL IsSet()\n    {\n        return m_hInst != NULL;\n    }\n\n    BOOL IsMissing()\n    {\n        return m_fMissing;\n    }\n\n    void SetMissing(LocaleID id)\n    {\n        _ASSERTE(m_hInst == NULL);\n        SetId(id);\n        m_fMissing = TRUE;\n    }\n\n    void Set(LocaleID id, HRESOURCEDLL hInst)\n    {\n        _ASSERTE(m_hInst == NULL);\n        _ASSERTE(m_fMissing == FALSE);\n        SetId(id);\n        m_hInst = hInst;\n    }\n  private:\n    void SetId(LocaleID id)\n    {\n        if (id != UICULTUREID_DONTCARE)\n        {\n            wcsncpy_s(m_LangId, ARRAY_SIZE(m_LangId), id, ARRAY_SIZE(m_LangId));\n            m_LangId[STRING_LENGTH(m_LangId)] = W('\\0');\n        }\n        else\n        {\n            m_LangId[0] = W('\\0');\n        }\n    }\n };\n\n#ifndef DACCESS_COMPILE\nvoid AddThreadPreferredUILanguages(StringArrayList* pArray);\n#endif\n//*****************************************************************************\n// CCompRC manages string Resource access for COM+. This includes loading\n// the MsCorRC.dll for resources as well allowing each thread to use a\n// a different localized version.\n//*****************************************************************************\nclass CCompRC\n{\npublic:\n\n    enum ResourceCategory\n    {\n        // must be present\n        Required,\n\n        // present in Desktop CLR and Core CLR + debug pack, an error\n        // If missing, get a generic error message instead\n        Error,\n\n        // present in Desktop CLR and Core CLR + debug pack, normal operation (e.g tracing)\n        // if missing, get a generic \"resource not found\" message instead\n        Debugging,\n\n        // present in Desktop CLR, optional for CoreCLR\n        DesktopCLR,\n\n        // might not be present, non essential\n        Optional\n    };\n\n    CCompRC()\n    {\n        // This constructor will be fired up on startup. Make sure it doesn't\n        // do anything besides zero-out out values.\n        m_fpGetThreadUICultureId = NULL;\n        m_fpGetThreadUICultureNames = NULL;\n\n        m_pHash = NULL;\n        m_nHashSize = 0;\n        m_csMap = NULL;\n        m_pResourceFile = NULL;\n    }// CCompRC\n\n    HRESULT Init(LPCWSTR pResourceFile);\n    void Destroy();\n\n    HRESULT LoadString(ResourceCategory eCategory, UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax , int *pcwchUsed=NULL);\n    HRESULT LoadString(ResourceCategory eCategory, LocaleID langId, UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax, int *pcwchUsed);\n\n    void SetResourceCultureCallbacks(\n        FPGETTHREADUICULTURENAMES fpGetThreadUICultureNames,\n        FPGETTHREADUICULTUREID fpGetThreadUICultureId\n    );\n\n    void GetResourceCultureCallbacks(\n        FPGETTHREADUICULTURENAMES* fpGetThreadUICultureNames,\n        FPGETTHREADUICULTUREID* fpGetThreadUICultureId\n    );\n\n    // Get the default resource location (mscorrc.dll)\n    static CCompRC* GetDefaultResourceDll();\n\n    static void GetDefaultCallbacks(\n                    FPGETTHREADUICULTURENAMES* fpGetThreadUICultureNames,\n                    FPGETTHREADUICULTUREID* fpGetThreadUICultureId)\n    {\n        WRAPPER_NO_CONTRACT;\n        m_DefaultResourceDll.GetResourceCultureCallbacks(\n                    fpGetThreadUICultureNames,\n                    fpGetThreadUICultureId);\n    }\n\n    static void SetDefaultCallbacks(\n                FPGETTHREADUICULTURENAMES fpGetThreadUICultureNames,\n                FPGETTHREADUICULTUREID fpGetThreadUICultureId)\n    {\n        WRAPPER_NO_CONTRACT;\n        // Either both are NULL or neither are NULL\n        _ASSERTE((fpGetThreadUICultureNames != NULL) ==\n                 (fpGetThreadUICultureId != NULL));\n\n        m_DefaultResourceDll.SetResourceCultureCallbacks(\n                fpGetThreadUICultureNames,\n                fpGetThreadUICultureId);\n    }\n\nprivate:\n// String resources packaged as PE files only exist on Windows\n#ifdef HOST_WINDOWS\n    HRESULT GetLibrary(LocaleID langId, HRESOURCEDLL* phInst);\n#ifndef DACCESS_COMPILE\n    HRESULT LoadLibraryHelper(HRESOURCEDLL *pHInst,\n                              SString& rcPath);\n    HRESULT LoadLibraryThrows(HRESOURCEDLL * pHInst);\n    HRESULT LoadLibrary(HRESOURCEDLL * pHInst);\n    HRESULT LoadResourceFile(HRESOURCEDLL * pHInst, LPCWSTR lpFileName);\n#endif // DACCESS_COMPILE\n#endif // HOST_WINDOWS\n\n    // We do not have global constructors any more\n    static LONG     m_dwDefaultInitialized;\n    static CCompRC  m_DefaultResourceDll;\n    static LPCWSTR  m_pDefaultResource;\n\n    // We must map between a thread's int and a dll instance.\n    // Since we only expect 1 language almost all of the time, we'll special case\n    // that and then use a variable size map for everything else.\n    CCulturedHInstance m_Primary;\n    CCulturedHInstance * m_pHash;\n    int m_nHashSize;\n\n    CRITSEC_COOKIE m_csMap;\n\n    LPCWSTR m_pResourceFile;\n\n    // Main accessors for hash\n    HRESOURCEDLL LookupNode(LocaleID langId, BOOL &fMissing);\n    HRESULT AddMapNode(LocaleID langId, HRESOURCEDLL hInst, BOOL fMissing = FALSE);\n\n    FPGETTHREADUICULTUREID m_fpGetThreadUICultureId;\n    FPGETTHREADUICULTURENAMES m_fpGetThreadUICultureNames;\n};\n\nHRESULT UtilLoadResourceString(CCompRC::ResourceCategory eCategory, UINT iResourceID, _Out_writes_ (iMax) LPWSTR szBuffer, int iMax);\n\n// The HRESULT_FROM_WIN32 macro evaluates its arguments three times.\n// <TODO>TODO: All HRESULT_FROM_WIN32(GetLastError()) should be replaced by calls to\n//  this helper function avoid code bloat</TODO>\ninline HRESULT HRESULT_FROM_GetLastError()\n{\n    WRAPPER_NO_CONTRACT;\n    DWORD dw = GetLastError();\n    // Make sure we return a failure\n    if (dw == ERROR_SUCCESS)\n    {\n        _ASSERTE(!\"We were expecting to get an error code, but a success code is being returned. Check this code path for Everett!\");\n        return E_FAIL;\n    }\n    else\n        return HRESULT_FROM_WIN32(dw);\n}\n\ninline HRESULT HRESULT_FROM_GetLastErrorNA()\n{\n    WRAPPER_NO_CONTRACT;\n    DWORD dw = GetLastError();\n    // Make sure we return a failure\n    if (dw == ERROR_SUCCESS)\n        return E_FAIL;\n    else\n        return HRESULT_FROM_WIN32(dw);\n}\n\ninline HRESULT BadError(HRESULT hr)\n{\n    LIMITED_METHOD_CONTRACT;\n    _ASSERTE(!\"Serious Error\");\n    return (hr);\n}\n\n#define TESTANDRETURN(test, hrVal)              \\\n{                                               \\\n    int ___test = (int)(test);                  \\\n    if (! ___test)                              \\\n        return hrVal;                           \\\n}\n\n#define TESTANDRETURNPOINTER(pointer)           \\\n    TESTANDRETURN((pointer)!=NULL, E_POINTER)\n\n#define TESTANDRETURNMEMORY(pointer)            \\\n    TESTANDRETURN((pointer)!=NULL, E_OUTOFMEMORY)\n\n#define TESTANDRETURNHR(hr)                     \\\n    TESTANDRETURN(SUCCEEDED(hr), hr)\n\n#define TESTANDRETURNARG(argtest)               \\\n    TESTANDRETURN(argtest, E_INVALIDARG)\n\n// Quick validity check for HANDLEs that are returned by Win32 APIs that\n// use INVALID_HANDLE_VALUE instead of NULL to indicate an error\ninline BOOL IsValidHandle(HANDLE h)\n{\n    LIMITED_METHOD_CONTRACT;\n    return ((h != NULL) && (h != INVALID_HANDLE_VALUE));\n}\n\n// Count the bits in a value in order iBits time.\ninline int CountBits(int iNum)\n{\n    LIMITED_METHOD_CONTRACT;\n    int iBits;\n    for (iBits=0;  iNum;  iBits++)\n        iNum = iNum & (iNum - 1);\n    return (iBits);\n}\n\n#include \"bitposition.h\"\n\n// Convert the currency to a decimal and canonicalize.\ninline void VarDecFromCyCanonicalize(CY cyIn, DECIMAL* dec)\n{\n    WRAPPER_NO_CONTRACT;\n\n    (*(ULONG*)dec) = 0;\n    DECIMAL_HI32(*dec) = 0;\n    if (cyIn.int64 == 0) // For compatibility, a currency of 0 emits the Decimal \"0.0000\" (scale set to 4).\n    {\n        DECIMAL_SCALE(*dec) = 4;\n        DECIMAL_LO32(*dec) = 0;\n        DECIMAL_MID32(*dec) = 0;\n        return;\n    }\n\n    if (cyIn.int64 < 0) {\n        DECIMAL_SIGN(*dec) = DECIMAL_NEG;\n        cyIn.int64 = -cyIn.int64;\n    }\n\n    BYTE scale = 4;\n    ULONGLONG absoluteCy = (ULONGLONG)cyIn.int64;\n    while (scale != 0 && ((absoluteCy % 10) == 0))\n    {\n        scale--;\n        absoluteCy /= 10;\n    }\n    DECIMAL_SCALE(*dec) = scale;\n    DECIMAL_LO32(*dec) = (ULONG)absoluteCy;\n    DECIMAL_MID32(*dec) = (ULONG)(absoluteCy >> 32);\n}\n\n//*****************************************************************************\n//\n// Paths functions. Use these instead of the CRT.\n//\n//*****************************************************************************\n\n//*******************************************************************************\n// Split a path into individual components - points to each section of the string\n//*******************************************************************************\nvoid    SplitPathInterior(\n    _In_      LPCWSTR wszPath,\n    _Out_opt_ LPCWSTR *pwszDrive,    _Out_opt_ size_t *pcchDrive,\n    _Out_opt_ LPCWSTR *pwszDir,      _Out_opt_ size_t *pcchDir,\n    _Out_opt_ LPCWSTR *pwszFileName, _Out_opt_ size_t *pcchFileName,\n    _Out_opt_ LPCWSTR *pwszExt,      _Out_opt_ size_t *pcchExt);\n\n\n#include \"ostype.h\"\n\n#define CLRGetTickCount64() GetTickCount64()\n\n//\n// Allocate free memory within the range [pMinAddr..pMaxAddr] using\n// ClrVirtualQuery to find free memory and ClrVirtualAlloc to allocate it.\n//\nBYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr,\n                                   const BYTE *pMaxAddr,\n                                   SIZE_T dwSize,\n                                   DWORD flAllocationType,\n                                   DWORD flProtect);\n\n//\n// Allocate free memory with specific alignment\n//\nLPVOID ClrVirtualAllocAligned(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect, SIZE_T alignment);\n\n#ifdef HOST_WINDOWS\n\nstruct CPU_Group_Info\n{\n    DWORD_PTR   active_mask;\n    WORD        nr_active;  // at most 64\n    WORD        begin;\n    DWORD       groupWeight;\n    DWORD       activeThreadWeight;\n};\n\nclass CPUGroupInfo\n{\nprivate:\n    static LONG m_initialization;\n    static WORD m_nGroups;\n    static WORD m_nProcessors;\n    static BOOL m_enableGCCPUGroups;\n    static BOOL m_threadUseAllCpuGroups;\n    static BOOL m_threadAssignCpuGroups;\n    static WORD m_initialGroup;\n    static CPU_Group_Info *m_CPUGroupInfoArray;\n\n    static BOOL InitCPUGroupInfoArray();\n    static void InitCPUGroupInfo();\n    static BOOL IsInitialized();\n\npublic:\n    static void EnsureInitialized();\n    static BOOL CanEnableGCCPUGroups();\n    static BOOL CanEnableThreadUseAllCpuGroups();\n    static BOOL CanAssignCpuGroupsToThreads();\n    static WORD GetNumActiveProcessors();\n    static void GetGroupForProcessor(WORD processor_number,\n\t\t    WORD *group_number, WORD *group_processor_number);\n    static DWORD CalculateCurrentProcessorNumber();\n    static bool GetCPUGroupInfo(PUSHORT total_groups, DWORD* max_procs_per_group);\n    //static void PopulateCPUUsageArray(void * infoBuffer, ULONG infoSize);\n\n#if !defined(FEATURE_NATIVEAOT)\npublic:\n    static BOOL GetLogicalProcessorInformationEx(LOGICAL_PROCESSOR_RELATIONSHIP relationship,\n\t\t   SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX *slpiex, PDWORD count);\n    static BOOL SetThreadGroupAffinity(HANDLE h,\n\t\t    const GROUP_AFFINITY *groupAffinity, GROUP_AFFINITY *previousGroupAffinity);\n    static BOOL GetThreadGroupAffinity(HANDLE h, GROUP_AFFINITY *groupAffinity);\n    static BOOL GetSystemTimes(FILETIME *idleTime, FILETIME *kernelTime, FILETIME *userTime);\n    static void ChooseCPUGroupAffinity(GROUP_AFFINITY *gf);\n    static void ClearCPUGroupAffinity(GROUP_AFFINITY *gf);\n    static BOOL GetCPUGroupRange(WORD group_number, WORD* group_begin, WORD* group_size);\n#endif\n};\n\nDWORD_PTR GetCurrentProcessCpuMask();\n\n#endif // HOST_WINDOWS\n\nint GetTotalProcessorCount();\n\n//******************************************************************************\n// Returns the number of processors that a process has been configured to run on\n//******************************************************************************\nint GetCurrentProcessCpuCount();\n\nuint32_t GetOsPageSize();\n\n\n//*****************************************************************************\n// Return != 0 if the bit at the specified index in the array is on and 0 if\n// it is off.\n//*****************************************************************************\ninline int GetBit(PTR_BYTE pcBits,int iBit)\n{\n    LIMITED_METHOD_CONTRACT;\n    return (pcBits[iBit>>3] & (1 << (iBit & 0x7)));\n}\n\n#ifdef DACCESS_COMPILE\ninline int GetBit(BYTE const * pcBits,int iBit)\n{\n    WRAPPER_NO_CONTRACT;\n    return GetBit(dac_cast<PTR_BYTE>(pcBits), iBit);\n}\n#endif\n\n//*****************************************************************************\n// Set the state of the bit at the specified index based on the value of bOn.\n//*****************************************************************************\ninline void SetBit(PTR_BYTE pcBits,int iBit,int bOn)\n{\n    LIMITED_METHOD_CONTRACT;\n    if (bOn)\n        pcBits[iBit>>3] |= (1 << (iBit & 0x7));\n    else\n        pcBits[iBit>>3] &= ~(1 << (iBit & 0x7));\n}\n\n#ifdef DACCESS_COMPILE\ninline void SetBit(BYTE * pcBits,int iBit,int bOn)\n{\n    WRAPPER_NO_CONTRACT;\n    SetBit(dac_cast<PTR_BYTE>(pcBits), iBit, bOn);\n}\n#endif\n\ntemplate<typename T>\nclass SimpleListNode\n{\npublic:\n    SimpleListNode<T>(const T& _t)\n    {\n        data = _t;\n        next = 0;\n    }\n\n    T                  data;\n    SimpleListNode<T>* next;\n};\n\ntemplate<typename T>\nclass SimpleList\n{\npublic:\n    typedef SimpleListNode<T> NodeType;\n\n    SimpleList<T>()\n    {\n        head = NULL;\n    }\n\n    void LinkHead(NodeType* pNode)\n    {\n        pNode->next = head;\n                      head = pNode;\n    }\n\n    NodeType* UnlinkHead()\n    {\n        NodeType* ret = head;\n\n        if (head)\n        {\n            head = head->next;\n        }\n        return ret;\n    }\n\n    NodeType* Head()\n    {\n        return head;\n    }\n\nprotected:\n\n    NodeType* head;\n};\n\n\n//*****************************************************************************\n// This class implements a dynamic array of structures for which the order of\n// the elements is unimportant.  This means that any item placed in the list\n// may be swapped to any other location in the list at any time.  If the order\n// of the items you place in the array is important, then use the CStructArray\n// class.\n//*****************************************************************************\n\ntemplate <class T,\n          int iGrowInc,\n          class ALLOCATOR>\nclass CUnorderedArrayWithAllocator\n{\n    int         m_iCount;               // # of elements used in the list.\n    int         m_iSize;                // # of elements allocated in the list.\npublic:\n#ifndef DACCESS_COMPILE\n    T           *m_pTable;              // Pointer to the list of elements.\n#else\n    TADDR        m_pTable;              // Pointer to the list of elements.\n#endif\n\npublic:\n\n#ifndef DACCESS_COMPILE\n\n    CUnorderedArrayWithAllocator() :\n        m_iCount(0),\n        m_iSize(0),\n        m_pTable(NULL)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n    ~CUnorderedArrayWithAllocator()\n    {\n        LIMITED_METHOD_CONTRACT;\n        // Free the chunk of memory.\n        if (m_pTable != NULL)\n            ALLOCATOR::Free(this, m_pTable);\n    }\n\n    void Clear()\n    {\n        WRAPPER_NO_CONTRACT;\n        m_iCount = 0;\n        if (m_iSize > iGrowInc)\n        {\n            T* tmp = ALLOCATOR::AllocNoThrow(this, iGrowInc);\n            if (tmp) {\n                ALLOCATOR::Free(this, m_pTable);\n                m_pTable = tmp;\n                m_iSize = iGrowInc;\n            }\n        }\n    }\n\n    void Clear(int iFirst, int iCount)\n    {\n        WRAPPER_NO_CONTRACT;\n        int     iSize;\n\n        if (iFirst + iCount < m_iCount)\n            memmove(&m_pTable[iFirst], &m_pTable[iFirst + iCount], sizeof(T) * (m_iCount - (iFirst + iCount)));\n\n        m_iCount -= iCount;\n\n        iSize = ((m_iCount / iGrowInc) * iGrowInc) + ((m_iCount % iGrowInc != 0) ? iGrowInc : 0);\n        if (m_iSize > iGrowInc && iSize < m_iSize)\n        {\n            T *tmp = ALLOCATOR::AllocNoThrow(this, iSize);\n            if (tmp) {\n                memcpy (tmp, m_pTable, iSize * sizeof(T));\n                delete [] m_pTable;\n                m_pTable = tmp;\n                m_iSize = iSize;\n            }\n        }\n        _ASSERTE(m_iCount <= m_iSize);\n    }\n\n    T *Table()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_pTable);\n    }\n\n    T *Append()\n    {\n        CONTRACTL {\n            NOTHROW;\n        } CONTRACTL_END;\n\n        // The array should grow, if we can't fit one more element into the array.\n        if (m_iSize <= m_iCount && GrowNoThrow() == NULL)\n            return (NULL);\n        return (&m_pTable[m_iCount++]);\n    }\n\n    T *AppendThrowing()\n    {\n        CONTRACTL {\n            THROWS;\n        } CONTRACTL_END;\n\n        // The array should grow, if we can't fit one more element into the array.\n        if (m_iSize <= m_iCount)\n            Grow();\n        return (&m_pTable[m_iCount++]);\n    }\n\n    void Delete(const T &Entry)\n    {\n        LIMITED_METHOD_CONTRACT;\n        --m_iCount;\n        for (int i=0; i <= m_iCount; ++i)\n            if (m_pTable[i] == Entry)\n            {\n                m_pTable[i] = m_pTable[m_iCount];\n                return;\n            }\n\n        // Just in case we didn't find it.\n        ++m_iCount;\n    }\n\n    void DeleteByIndex(int i)\n    {\n        LIMITED_METHOD_CONTRACT;\n        --m_iCount;\n        m_pTable[i] = m_pTable[m_iCount];\n    }\n\n    void Swap(int i,int j)\n    {\n        LIMITED_METHOD_CONTRACT;\n        T       tmp;\n\n        if (i == j)\n            return;\n        tmp = m_pTable[i];\n        m_pTable[i] = m_pTable[j];\n        m_pTable[j] = tmp;\n    }\n\n#else\n\n    TADDR Table()\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n        return (m_pTable);\n    }\n\n    void EnumMemoryRegions(void)\n    {\n        SUPPORTS_DAC;\n        DacEnumMemoryRegion(m_pTable, m_iCount * sizeof(T));\n    }\n\n#endif // #ifndef DACCESS_COMPILE\n\n    USHORT Count()\n    {\n        LIMITED_METHOD_CONTRACT;\n        SUPPORTS_DAC;\n        _ASSERTE(FitsIn<USHORT>(m_iCount));\n        return static_cast<USHORT>(m_iCount);\n    }\n\nprivate:\n    T *Grow();\n    T *GrowNoThrow();\n};\n\n\n#ifndef DACCESS_COMPILE\n\n//*****************************************************************************\n// Increase the size of the array.\n//*****************************************************************************\ntemplate <class T,\n          int iGrowInc,\n          class ALLOCATOR>\nT *CUnorderedArrayWithAllocator<T,iGrowInc,ALLOCATOR>::GrowNoThrow()  // NULL if can't grow.\n{\n    WRAPPER_NO_CONTRACT;\n    T       *pTemp;\n\n    // try to allocate memory for reallocation.\n    if ((pTemp = ALLOCATOR::AllocNoThrow(this, m_iSize+iGrowInc)) == NULL)\n        return (NULL);\n    memcpy (pTemp, m_pTable, m_iSize*sizeof(T));\n    ALLOCATOR::Free(this, m_pTable);\n    m_pTable = pTemp;\n    m_iSize += iGrowInc;\n    _ASSERTE(m_iSize > 0);\n    return (pTemp);\n}\n\ntemplate <class T,\n          int iGrowInc,\n          class ALLOCATOR>\nT *CUnorderedArrayWithAllocator<T,iGrowInc,ALLOCATOR>::Grow()  // exception if can't grow.\n{\n    WRAPPER_NO_CONTRACT;\n    T       *pTemp;\n\n    // try to allocate memory for reallocation.\n    pTemp = ALLOCATOR::AllocThrowing(this, m_iSize+iGrowInc);\n    if (m_iSize > 0)\n        memcpy (pTemp, m_pTable, m_iSize*sizeof(T));\n    ALLOCATOR::Free(this, m_pTable);\n    m_pTable = pTemp;\n    m_iSize += iGrowInc;\n    _ASSERTE(m_iSize > 0);\n    return (pTemp);\n}\n\n#endif // #ifndef DACCESS_COMPILE\n\n\ntemplate <class T>\nclass CUnorderedArray__Allocator\n{\npublic:\n\n    static T *AllocThrowing (void*, int nElements)\n    {\n        return new T[nElements];\n    }\n\n    static T *AllocNoThrow (void*, int nElements)\n    {\n        return new (nothrow) T[nElements];\n    }\n\n    static void Free (void*, T *pTable)\n    {\n        delete [] pTable;\n    }\n};\n\n\ntemplate <class T,int iGrowInc>\nclass CUnorderedArray : public CUnorderedArrayWithAllocator<T, iGrowInc, CUnorderedArray__Allocator<T> >\n{\npublic:\n\n    CUnorderedArray ()\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n};\n\n\n//Used by the debugger.  Included here in hopes somebody else might, too\ntypedef CUnorderedArray<SIZE_T, 17> SIZE_T_UNORDERED_ARRAY;\n\n\n//*****************************************************************************\n// This class implements a dynamic array of structures for which the insert\n// order is important.  Inserts will slide all elements after the location\n// down, deletes slide all values over the deleted item.  If the order of the\n// items in the array is unimportant to you, then CUnorderedArray may provide\n// the same feature set at lower cost.\n//*****************************************************************************\nclass CStructArray\n{\n    BYTE        *m_pList;               // Pointer to the list of elements.\n    int         m_iCount;               // # of elements used in the list.\n    int         m_iSize;                // # of elements allocated in the list.\n    int         m_iGrowInc;             // Growth increment.\n    short       m_iElemSize;            // Size of an array element.\n    bool        m_bFree;                // true if data is automatically maintained.\n\npublic:\n    CStructArray(short iElemSize, short iGrowInc = 1) :\n        m_pList(NULL),\n        m_iCount(0),\n        m_iSize(0),\n        m_iGrowInc(iGrowInc),\n        m_iElemSize(iElemSize),\n        m_bFree(true)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n    ~CStructArray()\n    {\n        WRAPPER_NO_CONTRACT;\n        Clear();\n    }\n\n    void *Insert(int iIndex);\n    void *InsertThrowing(int iIndex);\n    void *Append();\n    void *AppendThrowing();\n    int AllocateBlock(int iCount);\n    void AllocateBlockThrowing(int iCount);\n    void Delete(int iIndex);\n    void *Ptr()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_pList);\n    }\n    void *Get(int iIndex)\n    {\n        WRAPPER_NO_CONTRACT;\n        _ASSERTE(iIndex < m_iCount);\n        return (BYTE*) Ptr() + (iIndex * (size_t)m_iElemSize);\n    }\n    size_t Size()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iCount * (size_t)m_iElemSize);\n    }\n    int Count()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iCount);\n    }\n    void Clear();\n    void ClearCount()\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_iCount = 0;\n    }\n\n    void InitOnMem(short iElemSize, void *pList, int iCount, int iSize, int iGrowInc=1)\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_iElemSize = iElemSize;\n        m_iGrowInc = (short) iGrowInc;\n        m_pList = (BYTE*)pList;\n        m_iCount = iCount;\n        m_iSize = iSize;\n        m_bFree = false;\n    }\n\nprivate:\n    void Grow(int iCount);\n};\n\n\n//*****************************************************************************\n// This template simplifies access to a CStructArray by removing void * and\n// adding some operator overloads.\n//*****************************************************************************\ntemplate <class T>\nclass CDynArray : public CStructArray\n{\npublic:\n    CDynArray(short iGrowInc=16) :\n        CStructArray(sizeof(T), iGrowInc)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n    T *Insert(int iIndex)\n    {\n        WRAPPER_NO_CONTRACT;\n        return ((T *)CStructArray::Insert((int)iIndex));\n    }\n\n    T *InsertThrowing(int iIndex)\n    {\n        WRAPPER_NO_CONTRACT;\n        return ((T *)CStructArray::InsertThrowing((int)iIndex));\n    }\n\n    T *Append()\n    {\n        WRAPPER_NO_CONTRACT;\n        return ((T *)CStructArray::Append());\n    }\n\n    T *AppendThrowing()\n    {\n        WRAPPER_NO_CONTRACT;\n        return ((T *)CStructArray::AppendThrowing());\n    }\n\n    T *Ptr()\n    {\n        WRAPPER_NO_CONTRACT;\n        return ((T *)CStructArray::Ptr());\n    }\n\n    T *Get(int iIndex)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (Ptr() + iIndex);\n    }\n    T &operator[](int iIndex)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (*(Ptr() + iIndex));\n    }\n    int ItemIndex(T *p)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (((int)(LONG_PTR)p - (int)(LONG_PTR)Ptr()) / sizeof(T));\n    }\n    void Move(int iFrom, int iTo)\n    {\n        WRAPPER_NO_CONTRACT;\n        T       tmp;\n\n        _ASSERTE(iFrom >= 0 && iFrom < Count() &&\n                 iTo >= 0 && iTo < Count());\n\n        tmp = *(Ptr() + iFrom);\n        if (iTo > iFrom)\n            memmove(Ptr() + iFrom, Ptr() + iFrom + 1, (iTo - iFrom) * sizeof(T));\n        else\n            memmove(Ptr() + iTo + 1, Ptr() + iTo, (iFrom - iTo) * sizeof(T));\n        *(Ptr() + iTo) = tmp;\n    }\n};\n\n// Some common arrays.\ntypedef CDynArray<int> INTARRAY;\ntypedef CDynArray<short> SHORTARRAY;\ntypedef CDynArray<int> LONGARRAY;\ntypedef CDynArray<USHORT> USHORTARRAY;\ntypedef CDynArray<ULONG> ULONGARRAY;\ntypedef CDynArray<BYTE> BYTEARRAY;\ntypedef CDynArray<mdToken> TOKENARRAY;\n\n\n//*****************************************************************************\n//*****************************************************************************\ntemplate <class T> class CQuickSort\n{\nprotected:\n    T           *m_pBase;                   // Base of array to sort.\nprivate:\n    SSIZE_T     m_iCount;                   // How many items in array.\n    SSIZE_T     m_iElemSize;                // Size of one element.\npublic:\n    CQuickSort(\n        T           *pBase,                 // Address of first element.\n        SSIZE_T     iCount) :               // How many there are.\n        m_pBase(pBase),\n        m_iCount(iCount),\n        m_iElemSize(sizeof(T))\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n    }\n\n//*****************************************************************************\n// Call to sort the array.\n//*****************************************************************************\n    inline void Sort()\n    {\n        WRAPPER_NO_CONTRACT;\n        SortRange(0, m_iCount - 1);\n    }\n\nprotected:\n//*****************************************************************************\n// Override this function to do the comparison.\n//*****************************************************************************\n    virtual FORCEINLINE int Compare(        // -1, 0, or 1\n        T           *psFirst,               // First item to compare.\n        T           *psSecond)              // Second item to compare.\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n        return (memcmp(psFirst, psSecond, sizeof(T)));\n//      return (::Compare(*psFirst, *psSecond));\n    }\n\n    virtual FORCEINLINE void Swap(\n        SSIZE_T     iFirst,\n        SSIZE_T     iSecond)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n        if (iFirst == iSecond) return;\n        T sTemp( m_pBase[iFirst] );\n        m_pBase[iFirst] = m_pBase[iSecond];\n        m_pBase[iSecond] = sTemp;\n    }\n\nprivate:\n    inline void SortRange(\n        SSIZE_T     iLeft,\n        SSIZE_T     iRight)\n    {\n        WRAPPER_NO_CONTRACT;\n        SSIZE_T     iLast;\n        SSIZE_T     i;                      // loop variable.\n\n        for (;;)\n        {\n            // if less than two elements you're done.\n            if (iLeft >= iRight)\n                return;\n\n            // ASSERT that we now have valid indices.  This is statically provable\n            // since this private function is only called with valid indices,\n            // and iLeft and iRight only converge towards eachother.  However,\n            // PreFast can't detect this because it doesn't know about our callers.\n            COMPILER_ASSUME(iLeft >= 0 && iLeft < m_iCount);\n            COMPILER_ASSUME(iRight >= 0 && iRight < m_iCount);\n\n            // The mid-element is the pivot, move it to the left.\n            Swap(iLeft, (iLeft + iRight) / 2);\n            iLast = iLeft;\n\n            // move everything that is smaller than the pivot to the left.\n            for (i = iLeft + 1; i <= iRight; i++)\n            {\n                if (Compare(&m_pBase[i], &m_pBase[iLeft]) < 0)\n                {\n                    Swap(i, ++iLast);\n                }\n            }\n\n            // Put the pivot to the point where it is in between smaller and larger elements.\n            Swap(iLeft, iLast);\n\n            // Sort each partition.\n            SSIZE_T iLeftLast = iLast - 1;\n            SSIZE_T iRightFirst = iLast + 1;\n            if (iLeftLast - iLeft < iRight - iRightFirst)\n            {   // Left partition is smaller, sort it recursively\n                SortRange(iLeft, iLeftLast);\n                // Tail call to sort the right (bigger) partition\n                iLeft = iRightFirst;\n                //iRight = iRight;\n                continue;\n            }\n            else\n            {   // Right partition is smaller, sort it recursively\n                SortRange(iRightFirst, iRight);\n                // Tail call to sort the left (bigger) partition\n                //iLeft = iLeft;\n                iRight = iLeftLast;\n                continue;\n            }\n        }\n    }\n};\n\n//*****************************************************************************\n// Faster and simpler version of the binary search below.\n//*****************************************************************************\ntemplate <class T>\nconst T * BinarySearch(const T * pBase, int iCount, const T & find)\n{\n    WRAPPER_NO_CONTRACT;\n\n    int iFirst = 0;\n    int iLast  = iCount - 1;\n\n    // It is faster to use linear search once we get down to a small number of elements.\n    while (iLast - iFirst > 10)\n    {\n        int iMid = (iLast + iFirst) / 2;\n\n        if (find < pBase[iMid])\n            iLast = iMid - 1;\n        else\n            iFirst = iMid;\n    }\n\n    for (int i = iFirst; i <= iLast; i++)\n    {\n        if (find == pBase[i])\n            return &pBase[i];\n\n        if (find < pBase[i])\n            break;\n    }\n\n    return NULL;\n}\n\n//*****************************************************************************\n// This template encapsulates a binary search algorithm on the given type\n// of data.\n//*****************************************************************************\ntemplate <class T> class CBinarySearch\n{\nprivate:\n    const T     *m_pBase;                   // Base of array to sort.\n    int         m_iCount;                   // How many items in array.\n\npublic:\n    CBinarySearch(\n        const T     *pBase,                 // Address of first element.\n        int         iCount) :               // Value to find.\n        m_pBase(pBase),\n        m_iCount(iCount)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n//*****************************************************************************\n// Searches for the item passed to ctor.\n//*****************************************************************************\n    const T *Find(                          // Pointer to found item in array.\n        const T     *psFind,                // The key to find.\n        int         *piInsert = NULL)       // Index to insert at.\n    {\n        WRAPPER_NO_CONTRACT;\n        int         iMid, iFirst, iLast;    // Loop control.\n        int         iCmp;                   // Comparison.\n\n        iFirst = 0;\n        iLast = m_iCount - 1;\n        while (iFirst <= iLast)\n        {\n            iMid = (iLast + iFirst) / 2;\n            iCmp = Compare(psFind, &m_pBase[iMid]);\n            if (iCmp == 0)\n            {\n                if (piInsert != NULL)\n                    *piInsert = iMid;\n                return (&m_pBase[iMid]);\n            }\n            else if (iCmp < 0)\n                iLast = iMid - 1;\n            else\n                iFirst = iMid + 1;\n        }\n        if (piInsert != NULL)\n            *piInsert = iFirst;\n        return (NULL);\n    }\n\n//*****************************************************************************\n// Override this function to do the comparison if a comparison operator is\n// not valid for your data type (such as a struct).\n//*****************************************************************************\n    virtual int Compare(                    // -1, 0, or 1\n        const T     *psFirst,               // Key you are looking for.\n        const T     *psSecond)              // Item to compare to.\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (memcmp(psFirst, psSecond, sizeof(T)));\n//      return (::Compare(*psFirst, *psSecond));\n    }\n};\n\n//*****************************************************************************\n// The information that the hash table implementation stores at the beginning\n// of every record that can be but in the hash table.\n//*****************************************************************************\ntypedef DPTR(struct HASHENTRY) PTR_HASHENTRY;\nstruct HASHENTRY\n{\n    ULONG      iPrev;                  // Previous bucket in the chain.\n    ULONG      iNext;                  // Next bucket in the chain.\n};\n\ntypedef DPTR(struct FREEHASHENTRY) PTR_FREEHASHENTRY;\nstruct FREEHASHENTRY : HASHENTRY\n{\n    ULONG      iFree;\n};\n\n//*****************************************************************************\n// Used by the FindFirst/FindNextEntry functions.  These api's allow you to\n// do a sequential scan of all entries.\n//*****************************************************************************\nstruct HASHFIND\n{\n    ULONG      iBucket;            // The next bucket to look in.\n    ULONG      iNext;\n};\n\n\n//*****************************************************************************\n// IMPORTANT: This data structure is deprecated, please do not add any new uses.\n// The hashtable implementation that should be used instead is code:SHash.\n// If code:SHash does not work for you, talk to mailto:clrdeag.\n//*****************************************************************************\n// This is a class that implements a chain and bucket hash table.\n//\n// The data is actually supplied as an array of structures by the user of this class.\n// This allows the buckets to use small indices to point to the chain, instead of pointers.\n//\n// Each entry in the array contains a HASHENTRY structure immediately\n// followed by the key used to hash the structure.\n//\n// The HASHENTRY part of every structure is used to implement the chain of\n// entries in a single bucket.\n//\n// This implementation does not support rehashing the buckets if the table grows\n// to big.\n// @TODO: Fix this by adding an abstract function Hash() which must be implemented\n// by all clients.\n//\n//*****************************************************************************\nclass CHashTable\n{\n    friend class DebuggerRCThread; //RCthread actually needs access to\n    //fields of derrived class DebuggerPatchTable\n\nprotected:\n    TADDR       m_pcEntries;            // Pointer to the array of structs.\n    ULONG      m_iEntrySize;           // Size of the structs.\n\n    ULONG      m_iBuckets;             // # of chains we are hashing into.\n    PTR_ULONG  m_piBuckets;           // Ptr to the array of bucket chains.\n\n    INDEBUG(unsigned    m_maxSearch;)   // For evaluating perf characteristics\n\n    HASHENTRY *EntryPtr(ULONG iEntry)\n    {\n        LIMITED_METHOD_DAC_CONTRACT;\n        return (PTR_HASHENTRY(m_pcEntries + (iEntry * (size_t)m_iEntrySize)));\n    }\n\n    ULONG     ItemIndex(HASHENTRY *p)\n    {\n        SUPPORTS_DAC;\n        LIMITED_METHOD_CONTRACT;\n        return (ULONG)((dac_cast<TADDR>(p) - m_pcEntries) / m_iEntrySize);\n    }\n\n\npublic:\n\n    CHashTable(\n        ULONG      iBuckets) :         // # of chains we are hashing into.\n        m_pcEntries((TADDR)NULL),\n        m_iBuckets(iBuckets)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_piBuckets = NULL;\n\n        INDEBUG(m_maxSearch = 0;)\n    }\n\n    CHashTable() :         // # of chains we are hashing into.\n        m_pcEntries((TADDR)NULL),\n        m_iBuckets(5)\n    {\n        LIMITED_METHOD_CONTRACT;\n\n        m_piBuckets = NULL;\n\n        INDEBUG(m_maxSearch = 0;)\n    }\n\n#ifndef DACCESS_COMPILE\n\n    ~CHashTable()\n    {\n        LIMITED_METHOD_CONTRACT;\n        if (m_piBuckets != NULL)\n        {\n            delete [] m_piBuckets;\n            m_piBuckets = NULL;\n        }\n    }\n\n//*****************************************************************************\n// This is the second part of construction where we do all of the work that\n// can fail.  We also take the array of structs here because the calling class\n// presumably needs to allocate it in its NewInit.\n//*****************************************************************************\n    HRESULT NewInit(                    // Return status.\n        BYTE        *pcEntries,         // Array of structs we are managing.\n        ULONG      iEntrySize);        // Size of the entries.\n\n//*****************************************************************************\n// This can be called to change the pointer to the table that the hash table\n// is managing.  You might call this if (for example) you realloc the size\n// of the table and its pointer is different.\n//*****************************************************************************\n    void SetTable(\n        BYTE        *pcEntries)         // Array of structs we are managing.\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_pcEntries = (TADDR)pcEntries;\n    }\n\n//*****************************************************************************\n// Clear the hash table as if there were nothing in it.\n//*****************************************************************************\n    void Clear()\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(m_piBuckets != NULL);\n        memset(m_piBuckets, 0xff, m_iBuckets * sizeof(ULONG));\n    }\n\n//*****************************************************************************\n// Add the struct at the specified index in m_pcEntries to the hash chains.\n//*****************************************************************************\n    BYTE *Add(                          // New entry.\n        ULONG      iHash,              // Hash value of entry to add.\n        ULONG      iIndex);            // Index of struct in m_pcEntries.\n\n//*****************************************************************************\n// Delete the struct at the specified index in m_pcEntries from the hash chains.\n//*****************************************************************************\n    void Delete(\n        ULONG      iHash,              // Hash value of entry to delete.\n        ULONG      iIndex);            // Index of struct in m_pcEntries.\n\n    void Delete(\n        ULONG      iHash,              // Hash value of entry to delete.\n        HASHENTRY   *psEntry);          // The struct to delete.\n\n//*****************************************************************************\n// The item at the specified index has been moved, update the previous and\n// next item.\n//*****************************************************************************\n    void Move(\n        ULONG      iHash,              // Hash value for the item.\n        ULONG      iNew);              // New location.\n\n#endif // #ifndef DACCESS_COMPILE\n\n//*****************************************************************************\n// Return a boolean indicating whether or not this hash table has been inited.\n//*****************************************************************************\n    int IsInited()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_piBuckets != NULL);\n    }\n\n//*****************************************************************************\n// Search the hash table for an entry with the specified key value.\n//*****************************************************************************\n    BYTE *Find(                         // Index of struct in m_pcEntries.\n        ULONG      iHash,              // Hash value of the item.\n        SIZE_T     key);               // The key to match.\n\n//*****************************************************************************\n// Search the hash table for the next entry with the specified key value.\n//*****************************************************************************\n    ULONG FindNext(                    // Index of struct in m_pcEntries.\n        SIZE_T     key,                // The key to match.\n        ULONG      iIndex);            // Index of previous match.\n\n//*****************************************************************************\n// Returns the first entry in the first hash bucket and inits the search\n// struct.  Use the FindNextEntry function to continue walking the list.  The\n// return order is not guaranteed.\n//*****************************************************************************\n    BYTE *FindFirstEntry(               // First entry found, or 0.\n        HASHFIND    *psSrch)            // Search object.\n    {\n        WRAPPER_NO_CONTRACT;\n        if (m_piBuckets == 0)\n            return (0);\n        psSrch->iBucket = 1;\n        psSrch->iNext = m_piBuckets[0];\n        return (FindNextEntry(psSrch));\n    }\n\n//*****************************************************************************\n// Returns the next entry in the list.\n//*****************************************************************************\n    BYTE *FindNextEntry(                // The next entry, or0 for end of list.\n        HASHFIND    *psSrch);           // Search object.\n\n#ifdef DACCESS_COMPILE\n    void EnumMemoryRegions(CLRDataEnumMemoryFlags flags,\n                           ULONG numEntries);\n#endif\n\nprotected:\n    virtual BOOL Cmp(SIZE_T key1, const HASHENTRY * pc2) = 0;\n};\n\n\nclass CNewData\n{\npublic:\n    static BYTE *Alloc(int iSize, int iMaxSize)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (new BYTE[iSize]);\n    }\n    static void Free(BYTE *pPtr, int iSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n        delete [] pPtr;\n    }\n    static BYTE *Grow(BYTE *&pPtr, int iCurSize)\n    {\n        WRAPPER_NO_CONTRACT;\n        BYTE *p;\n        S_SIZE_T newSize = S_SIZE_T(iCurSize) + S_SIZE_T(GrowSize(iCurSize));\n        //check for overflow\n        if(newSize.IsOverflow())\n            p = NULL;\n        else\n            p = new (nothrow) BYTE[newSize.Value()];\n        if (p == 0) return (0);\n        memcpy (p, pPtr, iCurSize);\n        delete [] pPtr;\n        pPtr = p;\n        return pPtr;\n    }\n    static void Clean(BYTE * pData, int iSize)\n    {\n    }\n    static int RoundSize(int iSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (iSize);\n    }\n    static int GrowSize(int iCurSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n        int newSize = (3 * iCurSize) / 2;\n        return (newSize < 256) ? 256 : newSize;\n    }\n};\n\nclass CNewDataNoThrow\n{\npublic:\n    static BYTE *Alloc(int iSize, int iMaxSize)\n    {\n        WRAPPER_NO_CONTRACT;\n        return (new (nothrow) BYTE[iSize]);\n    }\n    static void Free(BYTE *pPtr, int iSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n        delete [] pPtr;\n    }\n    static BYTE *Grow(BYTE *&pPtr, int iCurSize)\n    {\n        WRAPPER_NO_CONTRACT;\n        BYTE *p;\n        S_SIZE_T newSize = S_SIZE_T(iCurSize) + S_SIZE_T(GrowSize(iCurSize));\n        //check for overflow\n        if(newSize.IsOverflow())\n            p = NULL;\n        else\n            p = new (nothrow) BYTE[newSize.Value()];\n        if (p == 0) return (0);\n        memcpy (p, pPtr, iCurSize);\n        delete [] pPtr;\n        pPtr = p;\n        return pPtr;\n    }\n    static void Clean(BYTE * pData, int iSize)\n    {\n    }\n    static int RoundSize(int iSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (iSize);\n    }\n    static int GrowSize(int iCurSize)\n    {\n        LIMITED_METHOD_CONTRACT;\n        int newSize = (3 * iCurSize) / 2;\n        return (newSize < 256) ? 256 : newSize;\n    }\n};\n\n\n//*****************************************************************************\n// IMPORTANT: This data structure is deprecated, please do not add any new uses.\n// The hashtable implementation that should be used instead is code:SHash.\n// If code:SHash does not work for you, talk to mailto:clrdeag.\n//*****************************************************************************\n// CHashTable expects the data to be in a single array - this is provided by\n// CHashTableAndData.\n// The array is allocated using the MemMgr type. CNewData and\n// CNewDataNoThrow can be used for this.\n//*****************************************************************************\ntemplate <class MemMgr>\nclass CHashTableAndData : public CHashTable\n{\npublic:\n    DAC_ALIGNAS(CHashTable)\n    ULONG      m_iFree;                // Index into m_pcEntries[] of next available slot\n    ULONG      m_iEntries;             // size of m_pcEntries[]\n\npublic:\n\n    CHashTableAndData() :\n        CHashTable()\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n    CHashTableAndData(\n        ULONG      iBuckets) :         // # of chains we are hashing into.\n        CHashTable(iBuckets)\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n\n#ifndef DACCESS_COMPILE\n\n    ~CHashTableAndData()\n    {\n        WRAPPER_NO_CONTRACT;\n        if (m_pcEntries != NULL)\n            MemMgr::Free((BYTE*)m_pcEntries, MemMgr::RoundSize(m_iEntries * m_iEntrySize));\n    }\n\n//*****************************************************************************\n// This is the second part of construction where we do all of the work that\n// can fail.  We also take the array of structs here because the calling class\n// presumably needs to allocate it in its NewInit.\n//*****************************************************************************\n    HRESULT NewInit(                    // Return status.\n        ULONG      iEntries,           // # of entries.\n        ULONG      iEntrySize,         // Size of the entries.\n        int         iMaxSize);          // Max size of data.\n\n//*****************************************************************************\n// Clear the hash table as if there were nothing in it.\n//*****************************************************************************\n    void Clear()\n    {\n        WRAPPER_NO_CONTRACT;\n        m_iFree = 0;\n        InitFreeChain(0, m_iEntries);\n        CHashTable::Clear();\n    }\n\n//*****************************************************************************\n// Grabs a slot for the new entry to be added.\n// The caller should fill in the non-HASHENTRY part of the returned slot\n//*****************************************************************************\n    BYTE *Add(\n        ULONG      iHash)              // Hash value of entry to add.\n    {\n        WRAPPER_NO_CONTRACT;\n        FREEHASHENTRY *psEntry;\n\n        // Make the table bigger if necessary.\n        if (m_iFree == UINT32_MAX && !Grow())\n            return (NULL);\n\n        // Add the first entry from the free list to the hash chain.\n        psEntry = (FREEHASHENTRY *) CHashTable::Add(iHash, m_iFree);\n        m_iFree = psEntry->iFree;\n\n        // If we're recycling memory, give our memory-allocator a chance to re-init it.\n\n        // Each entry is prefixed with a header - we don't want to trash that.\n        SIZE_T cbHeader = sizeof(FREEHASHENTRY);\n        MemMgr::Clean((BYTE*) psEntry + cbHeader, (int) (m_iEntrySize - cbHeader));\n\n        return ((BYTE *) psEntry);\n    }\n\n//*****************************************************************************\n// Delete the struct at the specified index in m_pcEntries from the hash chains.\n//*****************************************************************************\n    void Delete(\n        ULONG      iHash,              // Hash value of entry to delete.\n        ULONG      iIndex)             // Index of struct in m_pcEntries.\n    {\n        WRAPPER_NO_CONTRACT;\n        CHashTable::Delete(iHash, iIndex);\n        ((FREEHASHENTRY *) EntryPtr(iIndex))->iFree = m_iFree;\n        m_iFree = iIndex;\n    }\n\n    void Delete(\n        ULONG      iHash,              // Hash value of entry to delete.\n        HASHENTRY   *psEntry)           // The struct to delete.\n    {\n        WRAPPER_NO_CONTRACT;\n        CHashTable::Delete(iHash, psEntry);\n        ((FREEHASHENTRY *) psEntry)->iFree = m_iFree;\n        m_iFree = ItemIndex(psEntry);\n    }\n\n#endif // #ifndef DACCESS_COMPILE\n\n    // This is a sad legacy workaround. The debugger's patch table (implemented as this\n    // class) is shared across process. We publish the runtime offsets of\n    // some key fields. Since those fields are private, we have to provide\n    // accessors here. So if you're not using these functions, don't start.\n    // We can hopefully remove them.\n    // Note that we can't just make RCThread a friend of this class (we tried\n    // originally) because the inheritance chain has a private modifier,\n    // so DebuggerPatchTable::m_pcEntries is illegal.\n    static SIZE_T helper_GetOffsetOfEntries()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return offsetof(CHashTableAndData, m_pcEntries);\n    }\n\n    static SIZE_T helper_GetOffsetOfCount()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return offsetof(CHashTableAndData, m_iEntries);\n    }\n\n#ifdef DACCESS_COMPILE\n    void EnumMemoryRegions(CLRDataEnumMemoryFlags flags)\n    {\n        SUPPORTS_DAC;\n        CHashTable::EnumMemoryRegions(flags, m_iEntries);\n    }\n#endif\n\nprivate:\n    void InitFreeChain(ULONG iStart,ULONG iEnd);\n    int Grow();\n};\n\n#ifndef DACCESS_COMPILE\n\n//*****************************************************************************\n// This is the second part of construction where we do all of the work that\n// can fail.  We also take the array of structs here because the calling class\n// presumably needs to allocate it in its NewInit.\n//*****************************************************************************\ntemplate<class MemMgr>\nHRESULT CHashTableAndData<MemMgr>::NewInit(// Return status.\n    ULONG      iEntries,               // # of entries.\n    ULONG      iEntrySize,             // Size of the entries.\n    int         iMaxSize)               // Max size of data.\n{\n    WRAPPER_NO_CONTRACT;\n    BYTE        *pcEntries;\n    HRESULT     hr;\n\n\n    // note that this function can throw because it depends on the <M>::Alloc\n\n    // Allocate the memory for the entries.\n    if ((pcEntries = MemMgr::Alloc(MemMgr::RoundSize(iEntries * iEntrySize),\n                                   MemMgr::RoundSize(iMaxSize))) == 0)\n        return (E_OUTOFMEMORY);\n    m_iEntries = iEntries;\n\n    // Init the base table.\n    if (FAILED(hr = CHashTable::NewInit(pcEntries, iEntrySize)))\n        MemMgr::Free(pcEntries, MemMgr::RoundSize(iEntries * iEntrySize));\n    else\n    {\n        // Init the free chain.\n        m_iFree = 0;\n        InitFreeChain(0, iEntries);\n    }\n    return (hr);\n}\n\n//*****************************************************************************\n// Initialize a range of records such that they are linked together to be put\n// on the free chain.\n//*****************************************************************************\ntemplate<class MemMgr>\nvoid CHashTableAndData<MemMgr>::InitFreeChain(\n    ULONG      iStart,                 // Index to start initializing.\n    ULONG      iEnd)                   // Index to stop initializing\n{\n    LIMITED_METHOD_CONTRACT;\n    BYTE* pcPtr;\n    _ASSERTE(iEnd > iStart);\n\n    pcPtr = (BYTE*)m_pcEntries + iStart * (size_t)m_iEntrySize;\n    for (++iStart; iStart < iEnd; ++iStart)\n    {\n        ((FREEHASHENTRY *) pcPtr)->iFree = iStart;\n        pcPtr += m_iEntrySize;\n    }\n    ((FREEHASHENTRY *) pcPtr)->iFree = UINT32_MAX;\n}\n\n//*****************************************************************************\n// Attempt to increase the amount of space available for the record heap.\n//*****************************************************************************\ntemplate<class MemMgr>\nint CHashTableAndData<MemMgr>::Grow()   // 1 if successful, 0 if not.\n{\n    WRAPPER_NO_CONTRACT;\n    int         iCurSize;               // Current size in bytes.\n    int         iEntries;               // New # of entries.\n\n    _ASSERTE(m_pcEntries != NULL);\n    _ASSERTE(m_iFree == UINT32_MAX);\n\n    // Compute the current size and new # of entries.\n    S_UINT32 iTotEntrySize = S_UINT32(m_iEntries) * S_UINT32(m_iEntrySize);\n    if( iTotEntrySize.IsOverflow() )\n    {\n        _ASSERTE( !\"CHashTableAndData overflow!\" );\n        return (0);\n    }\n    iCurSize = MemMgr::RoundSize( iTotEntrySize.Value() );\n    iEntries = (iCurSize + MemMgr::GrowSize(iCurSize)) / m_iEntrySize;\n\n    if ( (iEntries < 0) || ((ULONG)iEntries <= m_iEntries) )\n    {\n        _ASSERTE( !\"CHashTableAndData overflow!\" );\n        return (0);\n    }\n\n    // Try to expand the array.\n    if (MemMgr::Grow(*(BYTE**)&m_pcEntries, iCurSize) == 0)\n        return (0);\n\n    // Init the newly allocated space.\n    InitFreeChain(m_iEntries, iEntries);\n    m_iFree = m_iEntries;\n    m_iEntries = iEntries;\n    return (1);\n}\n\n#endif // #ifndef DACCESS_COMPILE\n\n//*****************************************************************************\n//*****************************************************************************\n\ninline COUNT_T HashCOUNT_T(COUNT_T currentHash, COUNT_T data)\n{\n    LIMITED_METHOD_DAC_CONTRACT;\n    return ((currentHash << 5) + currentHash) ^ data;\n}\n\ninline COUNT_T HashPtr(COUNT_T currentHash, PTR_VOID ptr)\n{\n    WRAPPER_NO_CONTRACT;\n    SUPPORTS_DAC;\n    return HashCOUNT_T(currentHash, COUNT_T(SIZE_T(dac_cast<TADDR>(ptr))));\n}\n\ninline ULONG HashBytes(BYTE const *pbData, size_t iSize)\n{\n    LIMITED_METHOD_CONTRACT;\n    ULONG   hash = 5381;\n\n    BYTE const *pbDataEnd = pbData + iSize;\n\n    for (/**/ ; pbData < pbDataEnd; pbData++)\n    {\n        hash = ((hash << 5) + hash) ^ *pbData;\n    }\n    return hash;\n}\n\n// Helper function for hashing a string char by char.\ninline ULONG HashStringA(LPCSTR szStr)\n{\n    LIMITED_METHOD_CONTRACT;\n    ULONG   hash = 5381;\n    int     c;\n\n    while ((c = *szStr) != 0)\n    {\n        hash = ((hash << 5) + hash) ^ c;\n        ++szStr;\n    }\n    return hash;\n}\n\ninline ULONG HashString(LPCWSTR szStr)\n{\n    LIMITED_METHOD_CONTRACT;\n    ULONG   hash = 5381;\n    int     c;\n\n    while ((c = *szStr) != 0)\n    {\n        hash = ((hash << 5) + hash) ^ c;\n        ++szStr;\n    }\n    return hash;\n}\n\ninline ULONG HashStringN(LPCWSTR szStr, SIZE_T cchStr)\n{\n    LIMITED_METHOD_CONTRACT;\n    ULONG   hash = 5381;\n\n    // hash the string two characters at a time\n    ULONG *ptr = (ULONG *)szStr;\n\n    // we assume that szStr is null-terminated\n    _ASSERTE(cchStr <= wcslen(szStr));\n    SIZE_T cDwordCount = (cchStr + 1) / 2;\n\n    for (SIZE_T i = 0; i < cDwordCount; i++)\n    {\n        hash = ((hash << 5) + hash) ^ ptr[i];\n    }\n\n    return hash;\n}\n\n// Case-insensitive string hash function.\ninline ULONG HashiStringA(LPCSTR szStr)\n{\n    LIMITED_METHOD_CONTRACT;\n    ULONG   hash = 5381;\n    while (*szStr != 0)\n    {\n        hash = ((hash << 5) + hash) ^ toupper(*szStr);\n        szStr++;\n    }\n    return hash;\n}\n\n// Case-insensitive string hash function.\ninline ULONG HashiString(LPCWSTR szStr)\n{\n    LIMITED_METHOD_CONTRACT;\n    ULONG   hash = 5381;\n    while (*szStr != 0)\n    {\n        hash = ((hash << 5) + hash) ^ towupper(*szStr);\n        szStr++;\n    }\n    return hash;\n}\n\n// Case-insensitive string hash function.\ninline ULONG HashiStringN(LPCWSTR szStr, DWORD count)\n{\n    LIMITED_METHOD_CONTRACT;\n    ULONG   hash = 5381;\n    while (*szStr != 0 && count--)\n    {\n        hash = ((hash << 5) + hash) ^ towupper(*szStr);\n        szStr++;\n    }\n    return hash;\n}\n\n// Case-insensitive string hash function when all of the\n// characters in the string are known to be below 0x80.\n// Knowing this is much more efficient than calling\n// towupper above.\ninline ULONG HashiStringKnownLower80(LPCWSTR szStr) {\n    LIMITED_METHOD_CONTRACT;\n    ULONG hash = 5381;\n    int c;\n    int mask = ~0x20;\n    while ((c = *szStr)!=0) {\n        //If we have a lowercase character, ANDing off 0x20\n        //(mask) will make it an uppercase character.\n        if (c>='a' && c<='z') {\n            c&=mask;\n        }\n        hash = ((hash << 5) + hash) ^ c;\n        ++szStr;\n    }\n    return hash;\n}\n\ninline ULONG HashiStringNKnownLower80(LPCWSTR szStr, DWORD count) {\n    LIMITED_METHOD_CONTRACT;\n    ULONG hash = 5381;\n    int c;\n    int mask = ~0x20;\n    while ((c = *szStr) !=0 && count--) {\n        //If we have a lowercase character, ANDing off 0x20\n        //(mask) will make it an uppercase character.\n        if (c>='a' && c<='z') {\n            c&=mask;\n        }\n        hash = ((hash << 5) + hash) ^ c;\n        ++szStr;\n    }\n    return hash;\n}\n\n//*****************************************************************************\n// IMPORTANT: This data structure is deprecated, please do not add any new uses.\n// The hashtable implementation that should be used instead is code:SHash.\n// If code:SHash does not work for you, talk to mailto:clrdeag.\n//*****************************************************************************\n// This class implements a closed hashing table.  Values are hashed to a bucket,\n// and if that bucket is full already, then the value is placed in the next\n// free bucket starting after the desired target (with wrap around).  If the\n// table becomes 75% full, it is grown and rehashed to reduce lookups.  This\n// class is best used in a reltively small lookup table where hashing is\n// not going to cause many collisions.  By not having the collision chain\n// logic, a lot of memory is saved.\n//\n// The user of the template is required to supply several methods which decide\n// how each element can be marked as free, deleted, or used.  It would have\n// been possible to write this with more internal logic, but that would require\n// either (a) more overhead to add status on top of elements, or (b) hard\n// coded types like one for strings, one for ints, etc... This gives you the\n// flexibility of adding logic to your type.\n//*****************************************************************************\nclass CClosedHashBase\n{\n    BYTE *EntryPtr(int iEntry)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_rgData + (iEntry * (size_t)m_iEntrySize));\n    }\n\n    BYTE *EntryPtr(int iEntry, BYTE *rgData)\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (rgData + (iEntry * (size_t)m_iEntrySize));\n    }\n\npublic:\n    enum ELEMENTSTATUS\n    {\n        FREE,                               // Item is not in use right now.\n        DELETED,                            // Item is deleted.\n        USED                                // Item is in use.\n    };\n\n    CClosedHashBase(\n        int         iBuckets,               // How many buckets should we start with.\n        int         iEntrySize,             // Size of an entry.\n        bool        bPerfect) :             // true if bucket size will hash with no collisions.\n        m_bPerfect(bPerfect),\n        m_iBuckets(iBuckets),\n        m_iEntrySize(iEntrySize),\n        m_iCount(0),\n        m_iCollisions(0),\n        m_rgData(0)\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_iSize = iBuckets + 7;\n    }\n\n    virtual ~CClosedHashBase()\n    {\n        WRAPPER_NO_CONTRACT;\n        Clear();\n    }\n\n    virtual void Clear()\n    {\n        LIMITED_METHOD_CONTRACT;\n        delete [] m_rgData;\n        m_iCount = 0;\n        m_iCollisions = 0;\n        m_rgData = 0;\n    }\n\n//*****************************************************************************\n// Accessors for getting at the underlying data.  Be careful to use Count()\n// only when you want the number of buckets actually used.\n//*****************************************************************************\n\n    int Count()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iCount);\n    }\n\n    int Collisions()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iCollisions);\n    }\n\n    int Buckets()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iBuckets);\n    }\n\n    void SetBuckets(int iBuckets, bool bPerfect=false)\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(m_rgData == 0);\n        m_iBuckets = iBuckets;\n        m_iSize = m_iBuckets + 7;\n        m_bPerfect = bPerfect;\n    }\n\n    BYTE *Data()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_rgData);\n    }\n\n//*****************************************************************************\n// Add a new item to hash table given the key value.  If this new entry\n// exceeds maximum size, then the table will grow and be re-hashed, which\n// may cause a memory error.\n//*****************************************************************************\n    BYTE *Add(                              // New item to fill out on success.\n        void        *pData)                 // The value to hash on.\n    {\n        WRAPPER_NO_CONTRACT;\n        // If we haven't allocated any memory, or it is too small, fix it.\n        if (!m_rgData || ((m_iCount + 1) > (m_iSize * 3 / 4) && !m_bPerfect))\n        {\n            if (!ReHash())\n                return (0);\n        }\n\n        return (DoAdd(pData, m_rgData, m_iBuckets, m_iSize, m_iCollisions, m_iCount));\n    }\n\n//*****************************************************************************\n// Delete the given value.  This will simply mark the entry as deleted (in\n// order to keep the collision chain intact).  There is an optimization that\n// consecutive deleted entries leading up to a free entry are themselves freed\n// to reduce collisions later on.\n//*****************************************************************************\n    void Delete(\n        void        *pData);                // Key value to delete.\n\n\n//*****************************************************************************\n//  Callback function passed to DeleteLoop.\n//*****************************************************************************\n    typedef BOOL (* DELETELOOPFUNC)(        // Delete current item?\n         BYTE *pEntry,                      // Bucket entry to evaluate\n         void *pCustomizer);                // User-defined value\n\n//*****************************************************************************\n// Iterates over all active values, passing each one to pDeleteLoopFunc.\n// If pDeleteLoopFunc returns TRUE, the entry is deleted. This is safer\n// and faster than using FindNext() and Delete().\n//*****************************************************************************\n    void DeleteLoop(\n        DELETELOOPFUNC pDeleteLoopFunc,     // Decides whether to delete item\n        void *pCustomizer);                 // Extra value passed to deletefunc.\n\n\n//*****************************************************************************\n// Lookup a key value and return a pointer to the element if found.\n//*****************************************************************************\n    BYTE *Find(                             // The item if found, 0 if not.\n        void        *pData);                // The key to lookup.\n\n//*****************************************************************************\n// Look for an item in the table.  If it isn't found, then create a new one and\n// return that.\n//*****************************************************************************\n    BYTE *FindOrAdd(                        // The item if found, 0 if not.\n        void        *pData,                 // The key to lookup.\n        bool        &bNew);                 // true if created.\n\n//*****************************************************************************\n// The following functions are used to traverse each used entry.  This code\n// will skip over deleted and free entries freeing the caller up from such\n// logic.\n//*****************************************************************************\n    BYTE *GetFirst()                        // The first entry, 0 if none.\n    {\n        WRAPPER_NO_CONTRACT;\n        int         i;                      // Loop control.\n\n        // If we've never allocated the table there can't be any to get.\n        if (m_rgData == 0)\n            return (0);\n\n        // Find the first one.\n        for (i=0;  i<m_iSize;  i++)\n        {\n            if (Status(EntryPtr(i)) != FREE && Status(EntryPtr(i)) != DELETED)\n                return (EntryPtr(i));\n        }\n        return (0);\n    }\n\n    BYTE *GetNext(BYTE *Prev)               // The next entry, 0 if done.\n    {\n        WRAPPER_NO_CONTRACT;\n        int         i;                      // Loop control.\n\n        for (i = (int)(((size_t) Prev - (size_t) &m_rgData[0]) / m_iEntrySize) + 1; i<m_iSize;  i++)\n        {\n            if (Status(EntryPtr(i)) != FREE && Status(EntryPtr(i)) != DELETED)\n                return (EntryPtr(i));\n        }\n        return (0);\n    }\n\nprivate:\n//*****************************************************************************\n// Hash is called with a pointer to an element in the table.  You must override\n// this method and provide a hash algorithm for your element type.\n//*****************************************************************************\n    virtual unsigned int Hash(             // The key value.\n        void const  *pData)=0;              // Raw data to hash.\n\n//*****************************************************************************\n// Compare is used in the typical memcmp way, 0 is eqaulity, -1/1 indicate\n// direction of miscompare.  In this system everything is always equal or not.\n//*****************************************************************************\n    virtual unsigned int Compare(          // 0, -1, or 1.\n        void const  *pData,                 // Raw key data on lookup.\n        BYTE        *pElement)=0;           // The element to compare data against.\n\n//*****************************************************************************\n// Return true if the element is free to be used.\n//*****************************************************************************\n    virtual ELEMENTSTATUS Status(           // The status of the entry.\n        BYTE        *pElement)=0;           // The element to check.\n\n//*****************************************************************************\n// Sets the status of the given element.\n//*****************************************************************************\n    virtual void SetStatus(\n        BYTE        *pElement,              // The element to set status for.\n        ELEMENTSTATUS eStatus)=0;           // New status.\n\n//*****************************************************************************\n// Returns the internal key value for an element.\n//*****************************************************************************\n    virtual void *GetKey(                   // The data to hash on.\n        BYTE        *pElement)=0;           // The element to return data ptr for.\n\n//*****************************************************************************\n// This helper actually does the add for you.\n//*****************************************************************************\n    BYTE *DoAdd(void *pData, BYTE *rgData, int &iBuckets, int iSize,\n                int &iCollisions, int &iCount);\n\n//*****************************************************************************\n// This function is called either to init the table in the first place, or\n// to rehash the table if we ran out of room.\n//*****************************************************************************\n    bool ReHash();                          // true if successful.\n\n//*****************************************************************************\n// Walk each item in the table and mark it free.\n//*****************************************************************************\n    void InitFree(BYTE *ptr, int iSize)\n    {\n        WRAPPER_NO_CONTRACT;\n        int         i;\n        for (i=0;  i<iSize;  i++, ptr += m_iEntrySize)\n            SetStatus(ptr, FREE);\n    }\n\nprivate:\n    bool        m_bPerfect;                 // true if the table size guarantees\n                                            //  no collisions.\n    int         m_iBuckets;                 // How many buckets do we have.\n    int         m_iEntrySize;               // Size of an entry.\n    int         m_iSize;                    // How many elements can we have.\n    int         m_iCount;                   // How many items cannot be used (NON free, i.e. USED+DELETED).\n    int         m_iCollisions;              // How many have we had.\n    BYTE        *m_rgData;                  // Data element list.\n};\n\n//*****************************************************************************\n// IMPORTANT: This data structure is deprecated, please do not add any new uses.\n// The hashtable implementation that should be used instead is code:SHash.\n// If code:SHash does not work for you, talk to mailto:clrdeag.\n//*****************************************************************************\n// This template is another form of a closed hash table.  It handles collisions\n// through a linked chain.  To use it, derive your hashed item from HASHLINK\n// and implement the virtual functions required.  1.5 * ibuckets will be\n// allocated, with the extra .5 used for collisions.  If you add to the point\n// where no free nodes are available, the entire table is grown to make room.\n// The advantage to this system is that collisions are always directly known,\n// there either is one or there isn't.\n//*****************************************************************************\nstruct HASHLINK\n{\n    ULONG       iNext;                  // Offset for next entry.\n};\n\ntemplate <class T> class CChainedHash\n{\n    friend class VerifyLayoutsMD;\npublic:\n    CChainedHash(int iBuckets=32) :\n        m_rgData(0),\n        m_iBuckets(iBuckets),\n        m_iCount(0),\n        m_iMaxChain(0),\n        m_iFree(0)\n    {\n        LIMITED_METHOD_CONTRACT;\n        m_iSize = iBuckets + (iBuckets / 2);\n    }\n\n    ~CChainedHash()\n    {\n        LIMITED_METHOD_CONTRACT;\n        if (m_rgData)\n            delete [] m_rgData;\n    }\n\n    void SetBuckets(int iBuckets)\n    {\n        LIMITED_METHOD_CONTRACT;\n        _ASSERTE(m_rgData == 0);\n        // if iBuckets==0, then we'll allocate a zero size array and AV on dereference.\n        _ASSERTE(iBuckets > 0);\n        m_iBuckets = iBuckets;\n        m_iSize = iBuckets + (iBuckets / 2);\n    }\n\n    T *Add(void const *pData)\n    {\n        WRAPPER_NO_CONTRACT;\n        ULONG       iHash;\n        int         iBucket;\n        T           *pItem;\n\n        // Build the list if required.\n        if (m_rgData == 0 || m_iFree == 0xffffffff)\n        {\n            if (!ReHash())\n                return (0);\n        }\n\n        // Hash the item and pick a bucket.\n        iHash = Hash(pData);\n        iBucket = iHash % m_iBuckets;\n\n        // Use the bucket if it is free.\n        if (InUse(&m_rgData[iBucket]) == false)\n        {\n            pItem = &m_rgData[iBucket];\n            pItem->iNext = 0xffffffff;\n        }\n        // Else take one off of the free list for use.\n        else\n        {\n            ULONG       iEntry;\n\n            // Pull an item from the free list.\n            iEntry = m_iFree;\n            pItem = &m_rgData[m_iFree];\n            m_iFree = pItem->iNext;\n\n            // Link the new node in after the bucket.\n            pItem->iNext = m_rgData[iBucket].iNext;\n            m_rgData[iBucket].iNext = iEntry;\n        }\n        ++m_iCount;\n        return (pItem);\n    }\n\n    T *Find(void const *pData, bool bAddIfNew=false)\n    {\n        WRAPPER_NO_CONTRACT;\n        ULONG       iHash;\n        int         iBucket;\n        T           *pItem;\n\n        // Check states for lookup.\n        if (m_rgData == 0)\n        {\n            // If we won't be adding, then we are through.\n            if (bAddIfNew == false)\n                return (0);\n\n            // Otherwise, create the table.\n            if (!ReHash())\n                return (0);\n        }\n\n        // Hash the item and pick a bucket.\n        iHash = Hash(pData);\n        iBucket = iHash % m_iBuckets;\n\n        // If it isn't in use, then there it wasn't found.\n        if (!InUse(&m_rgData[iBucket]))\n        {\n            if (bAddIfNew == false)\n                pItem = 0;\n            else\n            {\n                pItem = &m_rgData[iBucket];\n                pItem->iNext = 0xffffffff;\n                ++m_iCount;\n            }\n        }\n        // Scan the list for the one we want.\n        else\n        {\n            ULONG iChain = 0;\n            for (pItem=(T *) &m_rgData[iBucket];  pItem;  pItem=GetNext(pItem))\n            {\n                if (Cmp(pData, pItem) == 0)\n                    break;\n                ++iChain;\n            }\n\n            if (!pItem && bAddIfNew)\n            {\n                ULONG       iEntry;\n\n                // Record maximum chain length.\n                if (iChain > m_iMaxChain)\n                    m_iMaxChain = iChain;\n\n                // Now need more room.\n                if (m_iFree == 0xffffffff)\n                {\n                    if (!ReHash())\n                        return (0);\n                }\n\n                // Pull an item from the free list.\n                iEntry = m_iFree;\n                pItem = &m_rgData[m_iFree];\n                m_iFree = pItem->iNext;\n\n                // Link the new node in after the bucket.\n                pItem->iNext = m_rgData[iBucket].iNext;\n                m_rgData[iBucket].iNext = iEntry;\n                ++m_iCount;\n            }\n        }\n        return (pItem);\n    }\n\n    int Count()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iCount);\n    }\n\n    int Buckets()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iBuckets);\n    }\n\n    ULONG MaxChainLength()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return (m_iMaxChain);\n    }\n\n    virtual void Clear()\n    {\n        LIMITED_METHOD_CONTRACT;\n        // Free up the memory.\n        if (m_rgData)\n        {\n            delete [] m_rgData;\n            m_rgData = 0;\n        }\n\n        m_rgData = 0;\n        m_iFree = 0;\n        m_iCount = 0;\n        m_iMaxChain = 0;\n    }\n\n    virtual bool InUse(T *pItem)=0;\n    virtual void SetFree(T *pItem)=0;\n    virtual ULONG Hash(void const *pData)=0;\n    virtual int Cmp(void const *pData, void *pItem)=0;\nprivate:\n    inline T *GetNext(T *pItem)\n    {\n        LIMITED_METHOD_CONTRACT;\n        if (pItem->iNext != 0xffffffff)\n            return ((T *) &m_rgData[pItem->iNext]);\n        return (0);\n    }\n\n    bool ReHash()\n    {\n        WRAPPER_NO_CONTRACT;\n        T           *rgTemp;\n        int         iNewSize;\n\n        // If this is a first time allocation, then just malloc it.\n        if (!m_rgData)\n        {\n            if ((m_rgData = new (nothrow) T[m_iSize]) == 0)\n                return (false);\n\n            int i;\n            for (i=0;  i<m_iSize;  i++)\n                SetFree(&m_rgData[i]);\n\n            m_iFree = m_iBuckets;\n            for (i=m_iBuckets;  i<m_iSize;  i++)\n                ((T *) &m_rgData[i])->iNext = i + 1;\n            ((T *) &m_rgData[m_iSize - 1])->iNext = 0xffffffff;\n            return (true);\n        }\n\n        // Otherwise we need more room on the free chain, so allocate some.\n        iNewSize = m_iSize + (m_iSize / 2);\n\n        // Allocate/realloc memory.\n        if ((rgTemp = new (nothrow) T[iNewSize]) == 0)\n            return (false);\n\n        memcpy (rgTemp,m_rgData,m_iSize*sizeof(T));\n        delete [] m_rgData;\n\n        // Init new entries, save the new free chain, and reset internals.\n        m_iFree = m_iSize;\n        for (int i=m_iFree;  i<iNewSize;  i++)\n        {\n            SetFree(&rgTemp[i]);\n            ((T *) &rgTemp[i])->iNext = i + 1;\n        }\n        ((T *) &rgTemp[iNewSize - 1])->iNext = 0xffffffff;\n\n        m_rgData = rgTemp;\n        m_iSize = iNewSize;\n        return (true);\n    }\n\nprivate:\n    T           *m_rgData;              // Data to store items in.\n    int         m_iBuckets;             // How many buckets we want.\n    int         m_iSize;                // How many are allocated.\n    int         m_iCount;               // How many are we using.\n    ULONG       m_iMaxChain;            // Max chain length.\n    ULONG       m_iFree;                // Free chain.\n};\n\n\n//*****************************************************************************\n//\n//********** String helper functions.\n//\n//*****************************************************************************\n\n//*****************************************************************************\n// Checks if string length exceeds the specified limit\n//*****************************************************************************\ninline BOOL IsStrLongerThan(_In_ _In_z_ char* pstr, unsigned N)\n{\n    LIMITED_METHOD_CONTRACT;\n    unsigned i = 0;\n    if(pstr)\n    {\n        for(i=0; (i < N)&&(pstr[i]); i++);\n    }\n    return (i >= N);\n}\n\n\n//*****************************************************************************\n// Class to parse a list of simple assembly names and then find a match\n//*****************************************************************************\n\nclass AssemblyNamesList\n{\n    struct AssemblyName\n    {\n        LPUTF8          m_assemblyName;\n        AssemblyName   *m_next;         // Next name\n    };\n\n    AssemblyName       *m_pNames;       // List of names\n\npublic:\n\n    bool IsInList(LPCUTF8 assemblyName);\n\n    bool IsEmpty()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return m_pNames == 0;\n    }\n\n    AssemblyNamesList(_In_ LPWSTR list);\n    ~AssemblyNamesList();\n};\n\n//*****************************************************************************\n// Class to parse a list of method names and then find a match\n//*****************************************************************************\n\nstruct CORINFO_SIG_INFO;\n\nclass MethodNamesListBase\n{\n    struct MethodName\n    {\n        LPUTF8      methodName;     // NULL means wildcard\n        LPUTF8      className;      // NULL means wildcard\n        int         numArgs;        // number of args for the method, -1 is wildcard\n        MethodName *next;           // Next name\n    };\n\n    MethodName     *pNames;         // List of names\n\n    bool IsInList(LPCUTF8 methodName, LPCUTF8 className, int numArgs);\n\npublic:\n    void Init()\n    {\n        LIMITED_METHOD_CONTRACT;\n        pNames = 0;\n    }\n\n    void Init(_In_ _In_z_ LPWSTR list)\n    {\n        WRAPPER_NO_CONTRACT;\n        pNames = 0;\n        Insert(list);\n    }\n\n    void Destroy();\n\n    void Insert(_In_ _In_z_ LPWSTR list);\n\n    bool IsInList(LPCUTF8 methodName, LPCUTF8 className, PCCOR_SIGNATURE sig = NULL);\n    bool IsInList(LPCUTF8 methodName, LPCUTF8 className, CORINFO_SIG_INFO* pSigInfo);\n    bool IsEmpty()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return pNames == 0;\n    }\n};\n\nclass MethodNamesList : public MethodNamesListBase\n{\npublic:\n    MethodNamesList()\n    {\n        WRAPPER_NO_CONTRACT;\n        Init();\n    }\n\n    MethodNamesList(_In_ LPWSTR list)\n    {\n        WRAPPER_NO_CONTRACT;\n        Init(list);\n    }\n\n    ~MethodNamesList()\n    {\n        WRAPPER_NO_CONTRACT;\n        Destroy();\n    }\n};\n\n#include \"clrconfig.h\"\n\n/**************************************************************************/\n/* simple wrappers around the CLRConfig and MethodNameList routines that make\n   the lookup lazy */\n\n/* to be used as static variable - no constructor/destructor, assumes zero\n   initialized memory */\n\nclass ConfigDWORD\n{\npublic:\n    inline DWORD val(const CLRConfig::ConfigDWORDInfo & info)\n    {\n        WRAPPER_NO_CONTRACT;\n        // make sure that the memory was zero initialized\n        _ASSERTE(m_inited == 0 || m_inited == 1);\n\n        if (!m_inited) init(info);\n        return m_value;\n    }\n\nprivate:\n    void init(const CLRConfig::ConfigDWORDInfo & info);\n\nprivate:\n    DWORD  m_value;\n    BYTE m_inited;\n};\n\n/**************************************************************************/\nclass ConfigString\n{\npublic:\n    inline LPWSTR val(const CLRConfig::ConfigStringInfo & info)\n    {\n        WRAPPER_NO_CONTRACT;\n        // make sure that the memory was zero initialized\n        _ASSERTE(m_inited == 0 || m_inited == 1);\n\n        if (!m_inited) init(info);\n        return m_value;\n    }\n\n    bool isInitialized()\n    {\n        WRAPPER_NO_CONTRACT;\n\n        // make sure that the memory was zero initialized\n        _ASSERTE(m_inited == 0 || m_inited == 1);\n\n        return m_inited == 1;\n    }\n\nprivate:\n    void init(const CLRConfig::ConfigStringInfo & info);\n\nprivate:\n    LPWSTR m_value;\n    BYTE m_inited;\n};\n\n/**************************************************************************/\nclass ConfigMethodSet\n{\npublic:\n    bool isEmpty()\n    {\n        WRAPPER_NO_CONTRACT;\n        _ASSERTE(m_inited == 1);\n        return m_list.IsEmpty();\n    }\n\n    bool contains(LPCUTF8 methodName, LPCUTF8 className, PCCOR_SIGNATURE sig = NULL);\n    bool contains(LPCUTF8 methodName, LPCUTF8 className, CORINFO_SIG_INFO* pSigInfo);\n\n    inline void ensureInit(const CLRConfig::ConfigStringInfo & info)\n    {\n        WRAPPER_NO_CONTRACT;\n        // make sure that the memory was zero initialized\n        _ASSERTE(m_inited == 0 || m_inited == 1);\n\n        if (!m_inited) init(info);\n    }\n\nprivate:\n    void init(const CLRConfig::ConfigStringInfo & info);\n\nprivate:\n    MethodNamesListBase m_list;\n\n    BYTE m_inited;\n};\n\n// 38 characters + 1 null terminating.\n#define GUID_STR_BUFFER_LEN (ARRAY_SIZE(\"{12345678-1234-1234-1234-123456789abc}\"))\n\n//*****************************************************************************\n// Convert a GUID into a pointer to a string\n//*****************************************************************************\nint GuidToLPSTR(\n    REFGUID guid,   // [IN] The GUID to convert.\n    LPSTR szGuid,   // [OUT] String into which the GUID is stored\n    DWORD cchGuid); // [IN] Size in chars of szGuid\n\ntemplate<DWORD N>\nint GuidToLPSTR(REFGUID guid, CHAR (&s)[N])\n{\n    return GuidToLPSTR(guid, s, N);\n}\n\n//*****************************************************************************\n// Convert a pointer to a string into a GUID.\n//*****************************************************************************\nBOOL LPCSTRToGuid(\n    LPCSTR szGuid,  // [IN] String to convert.\n    GUID* pGuid);  // [OUT] Buffer for converted GUID.\n\n//*****************************************************************************\n// Convert a GUID into a pointer to a string\n//*****************************************************************************\nint GuidToLPWSTR(\n    REFGUID guid,   // [IN] The GUID to convert.\n    LPWSTR szGuid,  // [OUT] String into which the GUID is stored\n    DWORD cchGuid); // [IN] Size in wide chars of szGuid\n\ntemplate<DWORD N>\nint GuidToLPWSTR(REFGUID guid, WCHAR (&s)[N])\n{\n    return GuidToLPWSTR(guid, s, N);\n}\n\n//*****************************************************************************\n// Parse a Wide char string into a GUID\n//*****************************************************************************\nBOOL LPCWSTRToGuid(\n    LPCWSTR szGuid, // [IN] String to convert.\n    GUID* pGuid);   // [OUT] Buffer for converted GUID.\n\ntypedef VPTR(class RangeList) PTR_RangeList;\n\nclass RangeList\n{\n  public:\n    VPTR_BASE_CONCRETE_VTABLE_CLASS(RangeList)\n\n#ifndef DACCESS_COMPILE\n    RangeList();\n    ~RangeList();\n#else\n    RangeList()\n    {\n        LIMITED_METHOD_CONTRACT;\n    }\n#endif\n\n    // Wrappers to make the virtual calls DAC-safe.\n    BOOL AddRange(const BYTE *start, const BYTE *end, void *id)\n    {\n        return this->AddRangeWorker(start, end, id);\n    }\n\n    void RemoveRanges(void *id, const BYTE *start = NULL, const BYTE *end = NULL)\n    {\n        return this->RemoveRangesWorker(id, start, end);\n    }\n\n    BOOL IsInRange(TADDR address, TADDR *pID = NULL)\n    {\n        SUPPORTS_DAC;\n\n        return this->IsInRangeWorker(address, pID);\n    }\n\n#ifndef DACCESS_COMPILE\n\n    // You can overload these two for synchronization (as LockedRangeList does)\n    virtual BOOL AddRangeWorker(const BYTE *start, const BYTE *end, void *id);\n    // If both \"start\" and \"end\" are NULL, then this method deletes all ranges with\n    // the given id (i.e. the original behaviour).  Otherwise, it ignores the given\n    // id and deletes all ranges falling in the region [start, end).\n    virtual void RemoveRangesWorker(void *id, const BYTE *start = NULL, const BYTE *end = NULL);\n#else\n    virtual BOOL AddRangeWorker(const BYTE *start, const BYTE *end, void *id)\n    {\n        return TRUE;\n    }\n    virtual void RemoveRangesWorker(void *id, const BYTE *start = NULL, const BYTE *end = NULL) { }\n#endif // !DACCESS_COMPILE\n\n    virtual BOOL IsInRangeWorker(TADDR address, TADDR *pID = NULL);\n\n#ifdef DACCESS_COMPILE\n    void EnumMemoryRegions(enum CLRDataEnumMemoryFlags flags);\n#endif\n\n    enum\n    {\n        RANGE_COUNT = 10\n    };\n\n\n  private:\n    struct Range\n    {\n        TADDR start;\n        TADDR end;\n        TADDR id;\n    };\n\n    struct RangeListBlock\n    {\n        Range                ranges[RANGE_COUNT];\n        DPTR(RangeListBlock) next;\n\n#ifdef DACCESS_COMPILE\n        void EnumMemoryRegions(enum CLRDataEnumMemoryFlags flags);\n#endif\n\n    };\n\n    void InitBlock(RangeListBlock *block);\n\n    RangeListBlock       m_starterBlock;\n    DPTR(RangeListBlock) m_firstEmptyBlock;\n    TADDR                m_firstEmptyRange;\n};\n\n\n//\n// A private function to do the equavilent of a CoCreateInstance in\n// cases where we can't make the real call. Use this when, for\n// instance, you need to create a symbol reader in the Runtime but\n// we're not CoInitialized. Obviously, this is only good for COM\n// objects for which CoCreateInstance is just a glorified\n// find-and-load-me operation.\n//\n\nHRESULT FakeCoCreateInstanceEx(REFCLSID       rclsid,\n                               LPCWSTR        wszDllPath,\n                               REFIID         riid,\n                               void **        ppv,\n                               HMODULE *      phmodDll);\n\n// Provided for backward compatibility and for code that doesn't need the HMODULE of the\n// DLL that was loaded to create the COM object.  See comment at implementation of\n// code:FakeCoCreateInstanceEx for more details.\ninline HRESULT FakeCoCreateInstance(REFCLSID   rclsid,\n                                    REFIID     riid,\n                                    void **    ppv)\n{\n    CONTRACTL\n    {\n        NOTHROW;\n    }\n    CONTRACTL_END;\n\n    return FakeCoCreateInstanceEx(rclsid, NULL, riid, ppv, NULL);\n};\n\n//*****************************************************************************\n// Gets the directory based on the location of the module. This routine\n// is called at COR setup time. Set is called during EEStartup and by the\n// MetaData dispenser.\n//*****************************************************************************\nHRESULT GetInternalSystemDirectory(_Out_writes_to_opt_(*pdwLength,*pdwLength) LPWSTR buffer, __inout DWORD* pdwLength);\nLPCWSTR GetInternalSystemDirectory(_Out_opt_ DWORD * pdwLength = NULL);\n\n//*****************************************************************************\n// This function validates the given Method/Field/Standalone signature. (util.cpp)\n//*****************************************************************************\nstruct IMDInternalImport;\nHRESULT validateTokenSig(\n    mdToken             tk,                     // [IN] Token whose signature needs to be validated.\n    PCCOR_SIGNATURE     pbSig,                  // [IN] Signature.\n    ULONG               cbSig,                  // [IN] Size in bytes of the signature.\n    DWORD               dwFlags,                // [IN] Method flags.\n    IMDInternalImport*  pImport);               // [IN] Internal MD Import interface ptr\n\n//*****************************************************************************\n// Determine the version number of the runtime that was used to build the\n// specified image. The pMetadata pointer passed in is the pointer to the\n// metadata contained in the image.\n//*****************************************************************************\nHRESULT GetImageRuntimeVersionString(PVOID pMetaData, LPCSTR* pString);\n\n//*****************************************************************************\n// The registry keys and values that contain the information regarding\n// the default registered unmanaged debugger.\n//*****************************************************************************\n\n#define kDebugApplicationsPoliciesKey W(\"SOFTWARE\\\\Policies\\\\Microsoft\\\\Windows\\\\Windows Error Reporting\\\\DebugApplications\")\n#define kDebugApplicationsKey  W(\"SOFTWARE\\\\Microsoft\\\\Windows\\\\Windows Error Reporting\\\\DebugApplications\")\n\n#define kUnmanagedDebuggerKey W(\"SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AeDebug\")\n#define kUnmanagedDebuggerValue W(\"Debugger\")\n#define kUnmanagedDebuggerAutoValue W(\"Auto\")\n#define kUnmanagedDebuggerAutoExclusionListKey W(\"SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AeDebug\\\\AutoExclusionList\")\n\nBOOL GetRegistryLongValue(HKEY    hKeyParent,              // Parent key.\n                          LPCWSTR szKey,                   // Key name to look at.\n                          LPCWSTR szName,                  // Name of value to get.\n                          long    *pValue,                 // Put value here, if found.\n                          BOOL    fReadNonVirtualizedKey); // Whether to read 64-bit hive on WOW64\n\nHRESULT GetCurrentModuleFileName(SString& pBuffer);\n\n//*****************************************************************************\n// Retrieve information regarding what registered default debugger\n//*****************************************************************************\nvoid GetDebuggerSettingInfo(SString &debuggerKeyValue, BOOL *pfAuto);\nHRESULT GetDebuggerSettingInfoWorker(_Out_writes_to_opt_(*pcchDebuggerString, *pcchDebuggerString) LPWSTR wszDebuggerString, DWORD * pcchDebuggerString, BOOL * pfAuto);\n\nvoid TrimWhiteSpace(__inout_ecount(*pcch)  LPCWSTR *pwsz, __inout LPDWORD pcch);\n\nvoid OutputDebugStringUtf8(LPCUTF8 utf8str);\n\n//*****************************************************************************\n// Convert a UTF8 string to Unicode, into a CQuickArray<WCHAR>.\n//*****************************************************************************\nHRESULT Utf2Quick(\n    LPCUTF8     pStr,                   // The string to convert.\n    CQuickArray<WCHAR> &rStr,           // The QuickArray<WCHAR> to convert it into.\n    int         iCurLen = 0);           // Initial characters in the array to leave (default 0).\n\n//*****************************************************************************\n//  Extract the movl 64-bit unsigned immediate from an IA64 bundle\n//  (Format X2)\n//*****************************************************************************\nUINT64 GetIA64Imm64(UINT64 * pBundle);\nUINT64 GetIA64Imm64(UINT64 qword0, UINT64 qword1);\n\n//*****************************************************************************\n//  Deposit the movl 64-bit unsigned immediate into an IA64 bundle\n//  (Format X2)\n//*****************************************************************************\nvoid PutIA64Imm64(UINT64 * pBundle, UINT64 imm64);\n\n//*****************************************************************************\n//  Extract the IP-Relative signed 25-bit immediate from an IA64 bundle\n//  (Formats B1, B2 or B3)\n//  Note that due to branch target alignment requirements\n//       the lowest four bits in the result will always be zero.\n//*****************************************************************************\nINT32 GetIA64Rel25(UINT64 * pBundle, UINT32 slot);\nINT32 GetIA64Rel25(UINT64 qword0, UINT64 qword1, UINT32 slot);\n\n//*****************************************************************************\n//  Deposit the IP-Relative signed 25-bit immediate into an IA64 bundle\n//  (Formats B1, B2 or B3)\n//  Note that due to branch target alignment requirements\n//       the lowest four bits are required to be zero.\n//*****************************************************************************\nvoid PutIA64Rel25(UINT64 * pBundle, UINT32 slot, INT32 imm25);\n\n//*****************************************************************************\n//  Extract the IP-Relative signed 64-bit immediate from an IA64 bundle\n//  (Formats X3 or X4)\n//*****************************************************************************\nINT64 GetIA64Rel64(UINT64 * pBundle);\nINT64 GetIA64Rel64(UINT64 qword0, UINT64 qword1);\n\n//*****************************************************************************\n//  Deposit the IP-Relative signed 64-bit immediate into a IA64 bundle\n//  (Formats X3 or X4)\n//*****************************************************************************\nvoid PutIA64Rel64(UINT64 * pBundle, INT64 imm64);\n\n//*****************************************************************************\n//  Extract the 32-bit immediate from movw/movt Thumb2 sequence\n//*****************************************************************************\nUINT32 GetThumb2Mov32(UINT16 * p);\n\n//*****************************************************************************\n//  Deposit the 32-bit immediate into movw/movt Thumb2 sequence\n//*****************************************************************************\nvoid PutThumb2Mov32(UINT16 * p, UINT32 imm32);\n\n//*****************************************************************************\n//  Extract the 24-bit rel offset from bl instruction\n//*****************************************************************************\nINT32 GetThumb2BlRel24(UINT16 * p);\n\n//*****************************************************************************\n//  Extract the 24-bit rel offset from bl instruction\n//*****************************************************************************\nvoid PutThumb2BlRel24(UINT16 * p, INT32 imm24);\n\n//*****************************************************************************\n//  Extract the PC-Relative offset from a b or bl instruction\n//*****************************************************************************\nINT32 GetArm64Rel28(UINT32 * pCode);\n\n//*****************************************************************************\n//  Extract the PC-Relative page address from an adrp instruction\n//*****************************************************************************\nINT32 GetArm64Rel21(UINT32 * pCode);\n\n//*****************************************************************************\n//  Extract the page offset from an add instruction\n//*****************************************************************************\nINT32 GetArm64Rel12(UINT32 * pCode);\n\n//*****************************************************************************\n//  Deposit the PC-Relative offset 'imm28' into a b or bl instruction\n//*****************************************************************************\nvoid PutArm64Rel28(UINT32 * pCode, INT32 imm28);\n\n//*****************************************************************************\n//  Deposit the PC-Relative page address 'imm21' into an adrp instruction\n//*****************************************************************************\nvoid PutArm64Rel21(UINT32 * pCode, INT32 imm21);\n\n//*****************************************************************************\n//  Deposit the page offset 'imm12' into an add instruction\n//*****************************************************************************\nvoid PutArm64Rel12(UINT32 * pCode, INT32 imm12);\n\n//*****************************************************************************\n// Returns whether the offset fits into bl instruction\n//*****************************************************************************\ninline bool FitsInThumb2BlRel24(INT32 imm24)\n{\n    return ((imm24 << 7) >> 7) == imm24;\n}\n\n//*****************************************************************************\n// Returns whether the offset fits into an Arm64 b or bl instruction\n//*****************************************************************************\ninline bool FitsInRel28(INT32 val32)\n{\n    return (val32 >= -0x08000000) && (val32 < 0x08000000);\n}\n\n//*****************************************************************************\n// Returns whether the offset fits into an Arm64 adrp instruction\n//*****************************************************************************\ninline bool FitsInRel21(INT32 val32)\n{\n    return (val32 >= 0) && (val32 <= 0x001FFFFF);\n}\n\n//*****************************************************************************\n// Returns whether the offset fits into an Arm64 add instruction\n//*****************************************************************************\ninline bool FitsInRel12(INT32 val32)\n{\n    return (val32 >= 0) && (val32 <= 0x00000FFF);\n}\n\n//*****************************************************************************\n// Returns whether the offset fits into an Arm64 b or bl instruction\n//*****************************************************************************\ninline bool FitsInRel28(INT64 val64)\n{\n    return (val64 >= -0x08000000LL) && (val64 < 0x08000000LL);\n}\n\n//\n// TEB access can be dangerous when using fibers because a fiber may\n// run on multiple threads.  If the TEB pointer is retrieved and saved\n// and then a fiber is moved to a different thread, when it accesses\n// the saved TEB pointer, it will be looking at the TEB state for a\n// different fiber.\n//\n// These accessors serve the purpose of retrieving information from the\n// TEB in a manner that ensures that the current fiber will not switch\n// threads while the access is occurring.\n//\nclass ClrTeb\n{\npublic:\n#if defined(HOST_UNIX)\n\n    // returns pointer that uniquely identifies the fiber\n    static void* GetFiberPtrId()\n    {\n        LIMITED_METHOD_CONTRACT;\n        // not fiber for HOST_UNIX - use the regular thread ID\n        return (void *)(size_t)GetCurrentThreadId();\n    }\n\n    static void* GetStackBase()\n    {\n        return PAL_GetStackBase();\n    }\n\n    static void* GetStackLimit()\n    {\n        return PAL_GetStackLimit();\n    }\n\n#else // HOST_UNIX\n\n    // returns pointer that uniquely identifies the fiber\n    static void* GetFiberPtrId()\n    {\n        LIMITED_METHOD_CONTRACT;\n        // stackbase is the unique fiber identifier\n        return NtCurrentTeb()->NtTib.StackBase;\n    }\n\n    static void* GetStackBase()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return NtCurrentTeb()->NtTib.StackBase;\n    }\n\n    static void* GetStackLimit()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return NtCurrentTeb()->NtTib.StackLimit;\n    }\n\n    static void* GetOleReservedPtr()\n    {\n        LIMITED_METHOD_CONTRACT;\n        return NtCurrentTeb()->ReservedForOle;\n    }\n\n#endif // HOST_UNIX\n};\n\n#if !defined(DACCESS_COMPILE)\n\nextern thread_local size_t t_ThreadType;\n\n// check if current thread is a GC thread (concurrent or server)\ninline BOOL IsGCSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n    STATIC_CONTRACT_CANNOT_TAKE_LOCK;\n\n    return !!(t_ThreadType & ThreadType_GC);\n}\n\n// check if current thread is a Gate thread\ninline BOOL IsGateSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_Gate);\n}\n\n// check if current thread is a debugger helper thread\ninline BOOL IsDbgHelperSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_DbgHelper);\n}\n\n// check if current thread is a debugger helper thread\ninline BOOL IsETWRundownSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_ETWRundownThread);\n}\n\n// check if current thread is a generic instantiation lookup compare thread\ninline BOOL IsGenericInstantiationLookupCompareThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_GenericInstantiationCompare);\n}\n\n// check if current thread is a thread which is performing shutdown\ninline BOOL IsShutdownSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_Shutdown);\n}\n\ninline BOOL IsThreadPoolIOCompletionSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_Threadpool_IOCompletion);\n}\n\ninline BOOL IsThreadPoolWorkerSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_Threadpool_Worker);\n}\n\ninline BOOL IsWaitSpecialThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_Wait);\n}\n\n// check if current thread is a thread which is performing shutdown\ninline BOOL IsSuspendEEThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_DynamicSuspendEE);\n}\n\ninline BOOL IsFinalizerThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_Finalizer);\n}\n\ninline BOOL IsShutdownHelperThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_ShutdownHelper);\n}\n\ninline BOOL IsProfilerAttachThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n\n    return !!(t_ThreadType & ThreadType_ProfAPI_Attach);\n}\n\n// set special type for current thread\nvoid ClrFlsSetThreadType(TlsThreadTypeFlag flag);\nvoid ClrFlsClearThreadType(TlsThreadTypeFlag flag);\n\n#endif //!DACCESS_COMPILE\n\nHRESULT SetThreadName(HANDLE hThread, PCWSTR lpThreadDescription);\n\ninline BOOL IsGCThread ()\n{\n    STATIC_CONTRACT_NOTHROW;\n    STATIC_CONTRACT_GC_NOTRIGGER;\n    STATIC_CONTRACT_MODE_ANY;\n    STATIC_CONTRACT_SUPPORTS_DAC;\n\n#if !defined(DACCESS_COMPILE)\n    return IsGCSpecialThread () || IsSuspendEEThread ();\n#else\n    return FALSE;\n#endif\n}\n\nclass ClrFlsThreadTypeSwitch\n{\npublic:\n    ClrFlsThreadTypeSwitch (TlsThreadTypeFlag flag)\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_GC_NOTRIGGER;\n        STATIC_CONTRACT_MODE_ANY;\n\n#ifndef DACCESS_COMPILE\n        m_flag = flag;\n        m_fPreviouslySet = (t_ThreadType & flag);\n\n        // In debug builds, remember the full group of flags that were set at the time\n        // the constructor was called.  This will be used in ASSERTs in the destructor\n        INDEBUG(m_nPreviousFlagGroup = t_ThreadType);\n\n        if (!m_fPreviouslySet)\n        {\n            ClrFlsSetThreadType(flag);\n        }\n#endif // DACCESS_COMPILE\n    }\n\n    ~ClrFlsThreadTypeSwitch ()\n    {\n        STATIC_CONTRACT_NOTHROW;\n        STATIC_CONTRACT_GC_NOTRIGGER;\n        STATIC_CONTRACT_MODE_ANY;\n\n#ifndef DACCESS_COMPILE\n        // This holder should only be used to set (and thus restore) ONE thread type flag\n        // at a time. If more than that one flag was modified since this holder was\n        // instantiated, then this holder still restores only the flag it knows about. To\n        // prevent confusion, assert if some other flag was modified, so the user doesn't\n        // expect the holder to restore the entire original set of flags.\n        //\n        // The expression below says that the only difference between the previous flag\n        // group and the current flag group should be m_flag (or no difference at all, if\n        // m_flag's state didn't actually change).\n        _ASSERTE(((m_nPreviousFlagGroup ^ t_ThreadType) | (size_t) m_flag) == (size_t) m_flag);\n\n        if (m_fPreviouslySet)\n        {\n            ClrFlsSetThreadType(m_flag);\n        }\n        else\n        {\n            ClrFlsClearThreadType(m_flag);\n        }\n#endif // DACCESS_COMPILE\n    }\n\nprivate:\n    TlsThreadTypeFlag m_flag;\n    BOOL m_fPreviouslySet;\n    INDEBUG(size_t m_nPreviousFlagGroup);\n};\n\n//*********************************************************************************\n\n#include \"contract.inl\"\n\nnamespace util\n{\n    //  compare adapters\n    //\n\n    template < typename T >\n    struct less\n    {\n        bool operator()( T const & first, T const & second ) const\n        {\n            return first < second;\n        }\n    };\n\n    template < typename T >\n    struct greater\n    {\n        bool operator()( T const & first, T const & second ) const\n        {\n            return first > second;\n        }\n    };\n\n\n    //  sort adapters\n    //\n\n    template< typename Iter, typename Pred >\n    void sort( Iter begin, Iter end, Pred pred );\n\n    template< typename T, typename Pred >\n    void sort( T * begin, T * end, Pred pred )\n    {\n        struct sort_helper : CQuickSort< T >\n        {\n            sort_helper( T * begin, T * end, Pred pred )\n                : CQuickSort< T >( begin, end - begin )\n                , m_pred( pred )\n            {}\n\n            virtual int Compare( T * first, T * second )\n            {\n                return m_pred( *first, *second ) ? -1\n                            : ( m_pred( *second, *first ) ? 1 : 0 );\n            }\n\n            Pred m_pred;\n        };\n\n        sort_helper sort_obj( begin, end, pred );\n        sort_obj.Sort();\n    }\n\n\n    template < typename Iter >\n    void sort( Iter begin, Iter end );\n\n    template < typename T >\n    void sort( T * begin, T * end )\n    {\n        util::sort( begin, end, util::less< T >() );\n    }\n\n\n    // binary search adapters\n    //\n\n    template < typename Iter, typename T, typename Pred >\n    Iter lower_bound( Iter begin, Iter end, T const & val, Pred pred );\n\n    template < typename T, typename Pred >\n    T * lower_bound( T * begin, T * end, T const & val, Pred pred )\n    {\n        for (; begin != end; )\n        {\n            T * mid = begin + ( end - begin ) / 2;\n            if ( pred( *mid, val ) )\n                begin = ++mid;\n            else\n                end = mid;\n        }\n\n        return begin;\n    }\n\n\n    template < typename Iter, typename T >\n    Iter lower_bound( Iter begin, Iter end, T const & val );\n\n    template < typename T >\n    T * lower_bound( T * begin, T * end, T const & val )\n    {\n        return util::lower_bound( begin, end, val, util::less< T >() );\n    }\n}\n\n\n/* ------------------------------------------------------------------------ *\n * Overloaded operators for the executable heap\n * ------------------------------------------------------------------------ */\n\n#ifdef HOST_WINDOWS\n\nstruct CExecutable { int x; };\nextern const CExecutable executable;\n\nvoid * __cdecl operator new(size_t n, const CExecutable&);\nvoid * __cdecl operator new[](size_t n, const CExecutable&);\nvoid * __cdecl operator new(size_t n, const CExecutable&, const NoThrow&);\nvoid * __cdecl operator new[](size_t n, const CExecutable&, const NoThrow&);\n\n\n//\n// Executable heap delete to match the executable heap new above.\n//\ntemplate<class T> void DeleteExecutable(T *p)\n{\n    if (p != NULL)\n    {\n        p->T::~T();\n\n        HeapFree(ClrGetProcessExecutableHeap(), 0, p);\n    }\n}\n\n#endif // HOST_WINDOWS\n\nINDEBUG(BOOL DbgIsExecutable(LPVOID lpMem, SIZE_T length);)\n\nBOOL ThreadWillCreateGuardPage(SIZE_T sizeReservedStack, SIZE_T sizeCommittedStack);\n\n#ifdef FEATURE_COMINTEROP\nFORCEINLINE void HolderSysFreeString(BSTR str) { CONTRACT_VIOLATION(ThrowsViolation); SysFreeString(str); }\n\ntypedef Wrapper<BSTR, DoNothing, HolderSysFreeString> BSTRHolder;\n#endif\n\nBOOL IsIPInModule(PTR_VOID pModuleBaseAddress, PCODE ip);\n\nnamespace UtilCode\n{\n    // These are type-safe versions of Interlocked[Compare]Exchange\n    // They avoid invoking struct cast operations via reinterpreting\n    // the struct's address as a LONG* or LONGLONG* and dereferencing it.\n    //\n    // If we had a global ::operator & (unary), we would love to use that\n    // to ensure we were not also accidentally getting a structs's provided\n    // operator &. TODO: probe with a static_assert?\n\n    template <typename T, int SIZE = sizeof(T)>\n    struct InterlockedCompareExchangeHelper;\n\n    template <typename T>\n    struct InterlockedCompareExchangeHelper<T, sizeof(LONG)>\n    {\n        static inline T InterlockedExchange(\n            T volatile * target,\n            T            value)\n        {\n            static_assert_no_msg(sizeof(T) == sizeof(LONG));\n            LONG res = ::InterlockedExchange(\n                reinterpret_cast<LONG volatile *>(target),\n                *reinterpret_cast<LONG *>(/*::operator*/&(value)));\n            return *reinterpret_cast<T*>(&res);\n        }\n\n        static inline T InterlockedCompareExchange(\n            T volatile * destination,\n            T            exchange,\n            T            comparand)\n        {\n            static_assert_no_msg(sizeof(T) == sizeof(LONG));\n            LONG res = ::InterlockedCompareExchange(\n                reinterpret_cast<LONG volatile *>(destination),\n                *reinterpret_cast<LONG*>(/*::operator*/&(exchange)),\n                *reinterpret_cast<LONG*>(/*::operator*/&(comparand)));\n            return *reinterpret_cast<T*>(&res);\n        }\n    };\n\n    template <typename T>\n    struct InterlockedCompareExchangeHelper<T, sizeof(LONGLONG)>\n    {\n        static inline T InterlockedExchange(\n            T volatile * target,\n            T            value)\n        {\n            static_assert_no_msg(sizeof(T) == sizeof(LONGLONG));\n            LONGLONG res = ::InterlockedExchange64(\n                reinterpret_cast<LONGLONG volatile *>(target),\n                *reinterpret_cast<LONGLONG *>(/*::operator*/&(value)));\n            return *reinterpret_cast<T*>(&res);\n        }\n\n        static inline T InterlockedCompareExchange(\n            T volatile * destination,\n            T            exchange,\n            T            comparand)\n        {\n            static_assert_no_msg(sizeof(T) == sizeof(LONGLONG));\n            LONGLONG res = ::InterlockedCompareExchange64(\n                reinterpret_cast<LONGLONG volatile *>(destination),\n                *reinterpret_cast<LONGLONG*>(/*::operator*/&(exchange)),\n                *reinterpret_cast<LONGLONG*>(/*::operator*/&(comparand)));\n            return *reinterpret_cast<T*>(&res);\n        }\n    };\n}\n\ntemplate <typename T>\ninline T InterlockedExchangeT(\n    T volatile * target,\n    T            value)\n{\n    return ::UtilCode::InterlockedCompareExchangeHelper<T>::InterlockedExchange(\n        target, value);\n}\n\ntemplate <typename T>\ninline T InterlockedCompareExchangeT(\n    T volatile * destination,\n    T            exchange,\n    T            comparand)\n{\n    return ::UtilCode::InterlockedCompareExchangeHelper<T>::InterlockedCompareExchange(\n        destination, exchange, comparand);\n}\n\n// Pointer variants for Interlocked[Compare]ExchangePointer\n// If the underlying type is a const type, we have to remove its constness\n// since Interlocked[Compare]ExchangePointer doesn't take const void * arguments.\ntemplate <typename T>\ninline T* InterlockedExchangeT(\n    T* volatile * target,\n    T*            value)\n{\n    //STATIC_ASSERT(value == 0);\n    typedef typename std::remove_const<T>::type * non_const_ptr_t;\n    return reinterpret_cast<T*>(InterlockedExchangePointer(\n        reinterpret_cast<PVOID volatile *>(const_cast<non_const_ptr_t volatile *>(target)),\n        reinterpret_cast<PVOID>(const_cast<non_const_ptr_t>(value))));\n}\n\ntemplate <typename T>\ninline T* InterlockedCompareExchangeT(\n    T* volatile * destination,\n    T*            exchange,\n    T*            comparand)\n{\n    //STATIC_ASSERT(exchange == 0);\n    typedef typename std::remove_const<T>::type * non_const_ptr_t;\n    return reinterpret_cast<T*>(InterlockedCompareExchangePointer(\n        reinterpret_cast<PVOID volatile *>(const_cast<non_const_ptr_t volatile *>(destination)),\n        reinterpret_cast<PVOID>(const_cast<non_const_ptr_t>(exchange)),\n        reinterpret_cast<PVOID>(const_cast<non_const_ptr_t>(comparand))));\n}\n\n// NULL pointer variants of the above to avoid having to cast NULL\n// to the appropriate pointer type.\ntemplate <typename T>\ninline T* InterlockedExchangeT(\n    T* volatile *  target,\n    std::nullptr_t value) // When nullptr is provided as argument.\n{\n    //STATIC_ASSERT(value == 0);\n    return InterlockedExchangeT(target, static_cast<T*>(value));\n}\n\ntemplate <typename T>\ninline T* InterlockedCompareExchangeT(\n    T* volatile *  destination,\n    std::nullptr_t exchange,  // When nullptr is provided as argument.\n    T*             comparand)\n{\n    //STATIC_ASSERT(exchange == 0);\n    return InterlockedCompareExchangeT(destination, static_cast<T*>(exchange), comparand);\n}\n\ntemplate <typename T>\ninline T* InterlockedCompareExchangeT(\n    T* volatile *  destination,\n    T*             exchange,\n    std::nullptr_t comparand) // When nullptr is provided as argument.\n{\n    //STATIC_ASSERT(comparand == 0);\n    return InterlockedCompareExchangeT(destination, exchange, static_cast<T*>(comparand));\n}\n\n// NULL pointer variants of the above to avoid having to cast NULL\n// to the appropriate pointer type.\ntemplate <typename T>\ninline T* InterlockedExchangeT(\n    T* volatile *   target,\n    int             value) // When NULL is provided as argument.\n{\n    //STATIC_ASSERT(value == 0);\n    return InterlockedExchangeT(target, nullptr);\n}\n\ntemplate <typename T>\ninline T* InterlockedCompareExchangeT(\n    T* volatile *   destination,\n    int             exchange,  // When NULL is provided as argument.\n    T*              comparand)\n{\n    //STATIC_ASSERT(exchange == 0);\n    return InterlockedCompareExchangeT(destination, nullptr, comparand);\n}\n\ntemplate <typename T>\ninline T* InterlockedCompareExchangeT(\n    T* volatile *   destination,\n    T*              exchange,\n    int             comparand) // When NULL is provided as argument.\n{\n    //STATIC_ASSERT(comparand == 0);\n    return InterlockedCompareExchangeT(destination, exchange, nullptr);\n}\n\n#undef InterlockedExchangePointer\n#define InterlockedExchangePointer Use_InterlockedExchangeT\n#undef InterlockedCompareExchangePointer\n#define InterlockedCompareExchangePointer Use_InterlockedCompareExchangeT\n\n// Returns the directory for clr module. So, if path was for \"C:\\Dir1\\Dir2\\Filename.DLL\",\n// then this would return \"C:\\Dir1\\Dir2\\\" (note the trailing backslash).\nHRESULT GetClrModuleDirectory(SString& wszPath);\n\nnamespace Clr { namespace Util\n{\n\n#ifdef HOST_WINDOWS\nnamespace Com\n{\n    HRESULT FindInprocServer32UsingCLSID(REFCLSID rclsid, SString & ssInprocServer32Name);\n}\n#endif // HOST_WINDOWS\n\n}}\n\ninline DWORD GetLoadWithAlteredSearchPathFlag()\n{\n    LIMITED_METHOD_CONTRACT;\n    #ifdef LOAD_WITH_ALTERED_SEARCH_PATH\n        return LOAD_WITH_ALTERED_SEARCH_PATH;\n    #else\n        return 0;\n    #endif\n}\n\n// clr::SafeAddRef and clr::SafeRelease helpers.\nnamespace clr\n{\n    //=================================================================================================================\n    template <typename ItfT>\n    static inline\n    typename std::enable_if< std::is_pointer<ItfT>::value, ItfT >::type\n    SafeAddRef(ItfT pItf)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        if (pItf != nullptr)\n        {\n            pItf->AddRef();\n        }\n        return pItf;\n    }\n\n    //=================================================================================================================\n    template <typename ItfT>\n    typename std::enable_if< std::is_pointer<ItfT>::value && std::is_reference<ItfT>::value, ULONG >::type\n    SafeRelease(ItfT pItf)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        ULONG res = 0;\n        if (pItf != nullptr)\n        {\n            res = pItf->Release();\n            pItf = nullptr;\n        }\n        return res;\n    }\n\n    //=================================================================================================================\n    template <typename ItfT>\n    typename std::enable_if< std::is_pointer<ItfT>::value && !std::is_reference<ItfT>::value, ULONG >::type\n    SafeRelease(ItfT pItf)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        ULONG res = 0;\n        if (pItf != nullptr)\n        {\n            res = pItf->Release();\n        }\n        return res;\n    }\n}\n\n// clr::SafeDelete\nnamespace clr\n{\n    //=================================================================================================================\n    template <typename PtrT>\n    static inline\n    typename std::enable_if< std::is_pointer<PtrT>::value, PtrT >::type\n    SafeDelete(PtrT & ptr)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        if (ptr != nullptr)\n        {\n            delete ptr;\n            ptr = nullptr;\n        }\n    }\n}\n\n// ======================================================================================\n// Spinning support (used by VM and by MetaData via file:..\\Utilcode\\UTSem.cpp)\n\nstruct SpinConstants\n{\n    DWORD dwInitialDuration;\n    DWORD dwMaximumDuration;\n    DWORD dwBackoffFactor;\n    DWORD dwRepetitions;\n    DWORD dwMonitorSpinCount;\n};\n\nextern SpinConstants g_SpinConstants;\n\n#endif // __UtilCode_h__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/utsem.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n/* ----------------------------------------------------------------------------\n\n---------------------------------------------------------------------------- */\n#ifndef __UTSEM_H__\n#define __UTSEM_H__\n\n\n// -------------------------------------------------------------\n//              INCLUDES\n// -------------------------------------------------------------\n#include \"utilcode.h\"\n\n/* ----------------------------------------------------------------------------\n@class UTSemReadWrite\n\n    An instance of class UTSemReadWrite provides multi-read XOR single-write\n    (a.k.a. shared vs. exclusive) lock capabilities, with protection against\n    writer starvation.\n\n    A thread MUST NOT call any of the Lock methods if it already holds a Lock.\n    (Doing so may result in a deadlock.)\n\n\n---------------------------------------------------------------------------- */\nclass UTSemReadWrite\n{\npublic:\n    UTSemReadWrite();   // Constructor\n\t~UTSemReadWrite();  // Destructor\n\n    HRESULT Init();\n\n    HRESULT LockRead();     // Lock the object for reading\n    HRESULT LockWrite();    // Lock the object for writing\n    void UnlockRead();      // Unlock the object for reading\n    void UnlockWrite();     // Unlock the object for writing\n\n#ifdef _DEBUG\n    BOOL Debug_IsLockedForRead();\n    BOOL Debug_IsLockedForWrite();\n#endif //_DEBUG\n\nprivate:\n    Volatile<ULONG> m_dwFlag;               // internal state, see implementation\n    HANDLE          m_hReadWaiterSemaphore; // semaphore for awakening read waiters\n    HANDLE          m_hWriteWaiterEvent;    // event for awakening write waiters\n};  // class UTSemReadWrite\n\n#endif // __UTSEM_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/volatile.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n//\n// Volatile.h\n//\n\n//\n// Defines the Volatile<T> type, which provides uniform volatile-ness on\n// Visual C++ and GNU C++.\n//\n// Visual C++ treats accesses to volatile variables as follows: no read or write\n// can be removed by the compiler, no global memory access can be moved backwards past\n// a volatile read, and no global memory access can be moved forward past a volatile\n// write.\n//\n// The GCC volatile semantic is straight out of the C standard: the compiler is not\n// allowed to remove accesses to volatile variables, and it is not allowed to reorder\n// volatile accesses relative to other volatile accesses.  It is allowed to freely\n// reorder non-volatile accesses relative to volatile accesses.\n//\n// We have lots of code that assumes that ordering of non-volatile accesses will be\n// constrained relative to volatile accesses.  For example, this pattern appears all\n// over the place:\n//\n//     static volatile int lock = 0;\n//\n//     while (InterlockedCompareExchange(&lock, 0, 1))\n//     {\n//         //spin\n//     }\n//\n//     //read and write variables protected by the lock\n//\n//     lock = 0;\n//\n// This depends on the reads and writes in the critical section not moving past the\n// final statement, which releases the lock.  If this should happen, then you have an\n// unintended race.\n//\n// The solution is to ban the use of the \"volatile\" keyword, and instead define our\n// own type Volatile<T>, which acts like a variable of type T except that accesses to\n// the variable are always given VC++'s volatile semantics.\n//\n// (NOTE: The code above is not intended to be an example of how a spinlock should be\n// implemented; it has many flaws, and should not be used. This code is intended only\n// to illustrate where we might get into trouble with GCC's volatile semantics.)\n//\n// @TODO: many of the variables marked volatile in the CLR do not actually need to be\n// volatile.  For example, if a variable is just always passed to Interlocked functions\n// (such as a refcount variable), there is no need for it to be volatile.  A future\n// cleanup task should be to examine each volatile variable and make them non-volatile\n// if possible.\n//\n// @TODO: link to a \"Memory Models for CLR Devs\" doc here (this doc does not yet exist).\n//\n\n#ifndef _VOLATILE_H_\n#define _VOLATILE_H_\n\n#include \"staticcontract.h\"\n\n//\n// This code is extremely compiler- and CPU-specific, and will need to be altered to\n// support new compilers and/or CPUs.  Here we enforce that we can only compile using\n// VC++, or GCC on x86 or AMD64.\n//\n#if !defined(_MSC_VER) && !defined(__GNUC__)\n#error The Volatile type is currently only defined for Visual C++ and GNU C++\n#endif\n\n#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_RISCV64) && !defined(HOST_S390X) && !defined(HOST_POWERPC64)\n#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64, RISCV64, PPC64LE, or S390X CPUs\n#endif\n\n#if defined(__GNUC__)\n#if defined(HOST_ARMV6)\n// DMB ISH not valid on ARMv6\n#define VOLATILE_MEMORY_BARRIER() asm volatile (\"mcr p15, 0, r0, c7, c10, 5\" : : : \"memory\")\n#elif defined(HOST_ARM) || defined(HOST_ARM64)\n// This is functionally equivalent to the MemoryBarrier() macro used on ARM on Windows.\n#define VOLATILE_MEMORY_BARRIER() asm volatile (\"dmb ish\" : : : \"memory\")\n#elif defined(HOST_LOONGARCH64)\n#define VOLATILE_MEMORY_BARRIER() asm volatile (\"dbar 0 \" : : : \"memory\")\n#elif defined(HOST_RISCV64)\n#define VOLATILE_MEMORY_BARRIER() asm volatile (\"fence rw,rw\" : : : \"memory\")\n#else\n//\n// For GCC, we prevent reordering by the compiler by inserting the following after a volatile\n// load (to prevent subsequent operations from moving before the read), and before a volatile\n// write (to prevent prior operations from moving past the write).  We don't need to do anything\n// special to prevent CPU reorderings, because the x86 and AMD64 architectures are already\n// sufficiently constrained for our purposes.  If we ever need to run on weaker CPU architectures\n// (such as PowerPC), then we will need to do more work.\n//\n// Please do not use this macro outside of this file.  It is subject to change or removal without\n// notice.\n//\n#define VOLATILE_MEMORY_BARRIER() asm volatile (\"\" : : : \"memory\")\n#endif // HOST_ARM || HOST_ARM64\n#elif (defined(HOST_ARM) || defined(HOST_ARM64)) && _ISO_VOLATILE\n// ARM & ARM64 have a very weak memory model and very few tools to control that model. We're forced to perform a full\n// memory barrier to preserve the volatile semantics. Technically this is only necessary on MP systems but we\n// currently don't have a cheap way to determine the number of CPUs from this header file. Revisit this if it\n// turns out to be a performance issue for the uni-proc case.\n#define VOLATILE_MEMORY_BARRIER() MemoryBarrier()\n#else\n//\n// On VC++, reorderings at the compiler and machine level are prevented by the use of the\n// \"volatile\" keyword in VolatileLoad and VolatileStore.  This should work on any CPU architecture\n// targeted by VC++ with /iso_volatile-.\n//\n#define VOLATILE_MEMORY_BARRIER()\n#endif // __GNUC__\n\ntemplate<typename T>\nstruct RemoveVolatile\n{\n   typedef T type;\n};\n\ntemplate<typename T>\nstruct RemoveVolatile<volatile T>\n{\n   typedef T type;\n};\n\n\n//\n// VolatileLoad loads a T from a pointer to T.  It is guaranteed that this load will not be optimized\n// away by the compiler, and that any operation that occurs after this load, in program order, will\n// not be moved before this load.  In general it is not guaranteed that the load will be atomic, though\n// this is the case for most aligned scalar data types.  If you need atomic loads or stores, you need\n// to consult the compiler and CPU manuals to find which circumstances allow atomicity.\n//\n// Starting at version 3.8, clang errors out on initializing of type int * to volatile int *. To fix this, we add two templates to cast away volatility\n// Helper structures for casting away volatileness\n\n#if defined(HOST_ARM64) && defined(_MSC_VER)\n#include <arm64intr.h>\n#endif\n\ntemplate<typename T>\ninline\nT VolatileLoad(T const * pt)\n{\n    STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;\n\n#ifndef DACCESS_COMPILE\n#if defined(HOST_ARM64) && defined(__GNUC__)\n    T val;\n    static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);\n    if((1 << sizeof(T)) & lockFreeAtomicSizeMask)\n    {\n        __atomic_load((T const *)pt, const_cast<typename RemoveVolatile<T>::type *>(&val), __ATOMIC_ACQUIRE);\n    }\n    else\n    {\n        val = *(T volatile const *)pt;\n        asm volatile (\"dmb ishld\" : : : \"memory\");\n    }\n#elif defined(HOST_ARM64) && defined(_MSC_VER)\n// silence warnings on casts in branches that are not taken.\n#pragma warning(push)\n#pragma warning(disable : 4311)\n#pragma warning(disable : 4312)\n    T val;\n    T* pv = &val;\n    switch (sizeof(T))\n    {\n    case 1:\n        *(unsigned __int8* )pv = __ldar8 ((unsigned __int8   volatile*)pt);\n        break;\n    case 2:\n        *(unsigned __int16*)pv = __ldar16((unsigned __int16  volatile*)pt);\n        break;\n    case 4:\n        *(unsigned __int32*)pv = __ldar32((unsigned __int32  volatile*)pt);\n        break;\n    case 8:\n        *(unsigned __int64*)pv = __ldar64((unsigned __int64  volatile*)pt);\n        break;\n    default:\n        val = *(T volatile const*)pt;\n        __dmb(_ARM64_BARRIER_ISHLD);\n    }\n#pragma warning(pop)\n#else\n    T val = *(T volatile const *)pt;\n    VOLATILE_MEMORY_BARRIER();\n#endif\n#else\n    T val = *pt;\n#endif\n    return val;\n}\n\ntemplate<typename T>\ninline\nT VolatileLoadWithoutBarrier(T const * pt)\n{\n    STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;\n\n#ifndef DACCESS_COMPILE\n    T val = *(T volatile const *)pt;\n#else\n    T val = *pt;\n#endif\n    return val;\n}\n\ntemplate <typename T> class Volatile;\n\ntemplate<typename T>\ninline\nT VolatileLoad(Volatile<T> const * pt)\n{\n    STATIC_CONTRACT_SUPPORTS_DAC;\n    return pt->Load();\n}\n\n//\n// VolatileStore stores a T into the target of a pointer to T.  It is guaranteed that this store will\n// not be optimized away by the compiler, and that any operation that occurs before this store, in program\n// order, will not be moved after this store.  In general, it is not guaranteed that the store will be\n// atomic, though this is the case for most aligned scalar data types.  If you need atomic loads or stores,\n// you need to consult the compiler and CPU manuals to find which circumstances allow atomicity.\n//\ntemplate<typename T>\ninline\nvoid VolatileStore(T* pt, T val)\n{\n    STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;\n\n#ifndef DACCESS_COMPILE\n#if defined(HOST_ARM64) && defined(__GNUC__)\n    static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);\n    if((1 << sizeof(T)) & lockFreeAtomicSizeMask)\n    {\n        __atomic_store((T volatile *)pt, &val, __ATOMIC_RELEASE);\n    }\n    else\n    {\n        VOLATILE_MEMORY_BARRIER();\n        *(T volatile *)pt = val;\n    }\n#elif defined(HOST_ARM64) && defined(_MSC_VER)\n// silence warnings on casts in branches that are not taken.\n#pragma warning(push)\n#pragma warning(disable : 4311)\n#pragma warning(disable : 4312)\n    T* pv = &val;\n    switch (sizeof(T))\n    {\n    case 1:\n        __stlr8 ((unsigned __int8  volatile*)pt, *(unsigned __int8* )pv);\n        break;\n    case 2:\n        __stlr16((unsigned __int16 volatile*)pt, *(unsigned __int16*)pv);\n        break;\n    case 4:\n        __stlr32((unsigned __int32 volatile*)pt, *(unsigned __int32*)pv);\n        break;\n    case 8:\n        __stlr64((unsigned __int64 volatile*)pt, *(unsigned __int64*)pv);\n        break;\n    default:\n        __dmb(_ARM64_BARRIER_ISH);\n        *(T volatile *)pt = val;\n    }\n#pragma warning(pop)\n#else\n    VOLATILE_MEMORY_BARRIER();\n    *(T volatile *)pt = val;\n#endif\n#else\n    *pt = val;\n#endif\n}\n\ntemplate<typename T>\ninline\nvoid VolatileStoreWithoutBarrier(T* pt, T val)\n{\n    STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;\n\n#ifndef DACCESS_COMPILE\n    *(T volatile *)pt = val;\n#else\n    *pt = val;\n#endif\n}\n\n//\n// Memory ordering barrier that waits for loads in progress to complete.\n// Any effects of loads or stores that appear after, in program order, will \"happen after\" relative to this.\n// Other operations such as computation or instruction prefetch are not affected.\n//\n// Architectural mapping:\n//   arm64  : dmb ishld\n//   arm    : dmb ish\n//   x86/64 : compiler fence\ninline\nvoid VolatileLoadBarrier()\n{\n#if defined(HOST_ARM64) && defined(__GNUC__)\n    asm volatile (\"dmb ishld\" : : : \"memory\");\n#elif defined(HOST_ARM64) && defined(_MSC_VER)\n    __dmb(_ARM64_BARRIER_ISHLD);\n#else\n    VOLATILE_MEMORY_BARRIER();\n#endif\n}\n\n//\n// Volatile<T> implements accesses with our volatile semantics over a variable of type T.\n// Wherever you would have used a \"volatile Foo\" or, equivalently, \"Foo volatile\", use Volatile<Foo>\n// instead.  If Foo is a pointer type, use VolatilePtr.\n//\n// Note that there are still some things that don't work with a Volatile<T>,\n// that would have worked with a \"volatile T\".  For example, you can't cast a Volatile<int> to a float.\n// You must instead cast to an int, then to a float.  Or you can call Load on the Volatile<int>, and\n// cast the result to a float.  In general, calling Load or Store explicitly will work around\n// any problems that can't be solved by operator overloading.\n//\n// @TODO: it's not clear that we actually *want* any operator overloading here.  It's in here primarily\n// to ease the task of converting all of the old uses of the volatile keyword, but in the long\n// run it's probably better if users of this class are forced to call Load() and Store() explicitly.\n// This would make it much more clear where the memory barriers are, and which operations are actually\n// being performed, but it will have to wait for another cleanup effort.\n//\ntemplate <typename T>\nclass Volatile\n{\n    // To enable the DAC table to correctly handle volatile DAC-ized statics while also being computed at compile time, we need to\n    // give the dac table type access to the internal field directly to take the address of it.\n    friend struct _DacGlobals;\nprivate:\n    //\n    // The data which we are treating as volatile\n    //\n    T m_val;\n\npublic:\n    //\n    // Default constructor.\n    //\n    inline Volatile() = default;\n\n    //\n    // Allow initialization of Volatile<T> from a T\n    //\n    inline Volatile(const T& val)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        ((volatile T &)m_val) = val;\n    }\n\n    //\n    // Copy constructor\n    //\n    inline Volatile(const Volatile<T>& other)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        ((volatile T &)m_val) = other.Load();\n    }\n\n    //\n    // Loads the value of the volatile variable.  See code:VolatileLoad for the semantics of this operation.\n    //\n    inline T Load() const\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        return VolatileLoad(&m_val);\n    }\n\n    //\n    // Loads the value of the volatile variable atomically without erecting the memory barrier.\n    //\n    inline T LoadWithoutBarrier() const\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        return ((volatile T &)m_val);\n    }\n\n    //\n    // Stores a new value to the volatile variable.  See code:VolatileStore for the semantics of this\n    // operation.\n    //\n    inline void Store(const T& val)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        VolatileStore(&m_val, val);\n    }\n\n\n    //\n    // Stores a new value to the volatile variable atomically without erecting the memory barrier.\n    //\n    inline void StoreWithoutBarrier(const T& val) const\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        ((volatile T &)m_val) = val;\n    }\n\n\n    //\n    // Gets a pointer to the volatile variable.  This is dangerous, as it permits the variable to be\n    // accessed without using Load and Store, but it is necessary for passing Volatile<T> to APIs like\n    // InterlockedIncrement.\n    //\n    inline volatile T* GetPointer() { return (volatile T*)&m_val; }\n\n\n    //\n    // Gets the raw value of the variable.  This is dangerous, as it permits the variable to be\n    // accessed without using Load and Store\n    //\n    inline T& RawValue() { return m_val; }\n\n    //\n    // Allow casts from Volatile<T> to T.  Note that this allows implicit casts, so you can\n    // pass a Volatile<T> directly to a method that expects a T.\n    //\n    inline operator T() const\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        return this->Load();\n    }\n\n    //\n    // Assignment from T\n    //\n    inline Volatile<T>& operator=(T val) {Store(val); return *this;}\n\n    //\n    // Get the address of the volatile variable.  This is dangerous, as it allows the value of the\n    // volatile variable to be accessed directly, without going through Load and Store, but it is\n    // necessary for passing Volatile<T> to APIs like InterlockedIncrement.  Note that we are returning\n    // a pointer to a volatile T here, so we cannot accidentally pass this pointer to an API that\n    // expects a normal pointer.\n    //\n    inline T volatile * operator&() {return this->GetPointer();}\n    inline T volatile const * operator&() const {return this->GetPointer();}\n\n    //\n    // Comparison operators\n    //\n    template<typename TOther>\n    inline bool operator==(const TOther& other) const {return this->Load() == other;}\n\n    template<typename TOther>\n    inline bool operator!=(const TOther& other) const {return this->Load() != other;}\n\n    //\n    // Miscellaneous operators.  Add more as necessary.\n    //\n\tinline Volatile<T>& operator+=(T val) {Store(this->Load() + val); return *this;}\n\tinline Volatile<T>& operator-=(T val) {Store(this->Load() - val); return *this;}\n    inline Volatile<T>& operator|=(T val) {Store(this->Load() | val); return *this;}\n    inline Volatile<T>& operator&=(T val) {Store(this->Load() & val); return *this;}\n    inline bool operator!() const { STATIC_CONTRACT_SUPPORTS_DAC; return !this->Load();}\n\n    //\n    // Prefix increment\n    //\n    inline Volatile& operator++() {this->Store(this->Load()+1); return *this;}\n\n    //\n    // Postfix increment\n    //\n    inline T operator++(int) {T val = this->Load(); this->Store(val+1); return val;}\n\n    //\n    // Prefix decrement\n    //\n    inline Volatile& operator--() {this->Store(this->Load()-1); return *this;}\n\n    //\n    // Postfix decrement\n    //\n    inline T operator--(int) {T val = this->Load(); this->Store(val-1); return val;}\n};\n\n//\n// A VolatilePtr builds on Volatile<T> by adding operators appropriate to pointers.\n// Wherever you would have used \"Foo * volatile\", use \"VolatilePtr<Foo>\" instead.\n//\n// VolatilePtr also allows the substution of other types for the underlying pointer.  This\n// allows you to wrap a VolatilePtr around a custom type that looks like a pointer.  For example,\n// if what you want is a \"volatile DPTR<Foo>\", use \"VolatilePtr<Foo, DPTR<Foo>>\".\n//\ntemplate <typename T, typename P = T*>\nclass VolatilePtr : public Volatile<P>\n{\npublic:\n    //\n    // Default constructor.  Results in an uninitialized pointer!\n    //\n    inline VolatilePtr()\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n    }\n\n    //\n    // Allow assignment from the pointer type.\n    //\n    inline VolatilePtr(P val) : Volatile<P>(val)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n    }\n\n    //\n    // Copy constructor\n    //\n    inline VolatilePtr(const VolatilePtr& other) : Volatile<P>(other)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n    }\n\n    //\n    // Cast to the pointer type\n    //\n    inline operator P() const\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        return (P)this->Load();\n    }\n\n    //\n    // Member access\n    //\n    inline P operator->() const\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        return (P)this->Load();\n    }\n\n    //\n    // Dereference the pointer\n    //\n    inline T& operator*() const\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        return *(P)this->Load();\n    }\n\n    //\n    // Access the pointer as an array\n    //\n    template <typename TIndex>\n    inline T& operator[](TIndex index)\n    {\n        STATIC_CONTRACT_SUPPORTS_DAC;\n        return ((P)this->Load())[index];\n    }\n};\n\n//\n// From here on out, we ban the use of the \"volatile\" keyword.  If you found this while trying to define\n// a volatile variable, go to the top of this file and start reading.\n//\n#ifdef volatile\n#undef volatile\n#endif\n// ***** Temporarily removing this to unblock integration with new VC++ bits\n//#define volatile (DoNotUseVolatileKeyword) volatile\n\n// The substitution for volatile above is defined in such a way that we can still explicitly access the\n// volatile keyword without error using the macros below. Use with care.\n//#define REMOVE_DONOTUSE_ERROR(x)\n//#define RAW_KEYWORD(x) REMOVE_DONOTUSE_ERROR x\n#define RAW_KEYWORD(x) x\n\n#ifdef DACCESS_COMPILE\n// No need to use volatile in DAC builds - DAC is single-threaded and the target\n// process is suspended.\n#define VOLATILE(T) T\n#else\n\n// Disable use of Volatile<T> for GC/HandleTable code except on platforms where it's absolutely necessary.\n#if defined(_MSC_VER) && !defined(HOST_ARM) && !defined(HOST_ARM64)\n#define VOLATILE(T) T RAW_KEYWORD(volatile)\n#else\n#define VOLATILE(T) Volatile<T>\n#endif\n\n#endif // DACCESS_COMPILE\n\n// VolatilePtr-specific clr::SafeAddRef and clr::SafeRelease\nnamespace clr\n{\n    template < typename ItfT, typename PtrT > inline\n    #ifdef __checkReturn // Volatile.h is used in corunix headers, which don't define/nullify SAL.\n        __checkReturn\n    #endif\n    VolatilePtr<ItfT, PtrT>&\n    SafeAddRef(VolatilePtr<ItfT, PtrT>& pItf)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        SafeAddRef(pItf.Load());\n        return pItf;\n    }\n\n    template < typename ItfT, typename PtrT > inline\n    ULONG\n    SafeRelease(VolatilePtr<ItfT, PtrT>& pItf)\n    {\n        STATIC_CONTRACT_LIMITED_METHOD;\n        return SafeRelease(pItf.Load());\n    }\n}\n\n#endif //_VOLATILE_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/vptr_list.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n// Any class with a vtable that needs to be instantiated\n// during debugging data access must be listed here.\n\nVPTR_CLASS(EEJitManager)\n\n#ifdef FEATURE_READYTORUN\nVPTR_CLASS(ReadyToRunJitManager)\n#endif\nVPTR_CLASS(EECodeManager)\n\nVPTR_CLASS(RangeList)\nVPTR_CLASS(LockedRangeList)\n\n#ifdef EnC_SUPPORTED\nVPTR_CLASS(EditAndContinueModule)\n#endif\nVPTR_CLASS(Module)\nVPTR_CLASS(ReflectionModule)\n\nVPTR_CLASS(AppDomain)\nVPTR_CLASS(SystemDomain)\n\nVPTR_CLASS(PrecodeStubManager)\nVPTR_CLASS(StubLinkStubManager)\nVPTR_CLASS(ThePreStubManager)\nVPTR_CLASS(ThunkHeapStubManager)\nVPTR_CLASS(VirtualCallStubManager)\nVPTR_CLASS(VirtualCallStubManagerManager)\nVPTR_CLASS(JumpStubStubManager)\nVPTR_CLASS(RangeSectionStubManager)\nVPTR_CLASS(ILStubManager)\nVPTR_CLASS(InteropDispatchStubManager)\nVPTR_CLASS(DelegateInvokeStubManager)\n#if defined(TARGET_X86) && !defined(UNIX_X86_ABI)\nVPTR_CLASS(TailCallStubManager)\n#endif\nVPTR_CLASS(CallCountingStubManager)\n\nVPTR_CLASS(PEImageLayout)\nVPTR_CLASS(ConvertedImageLayout)\nVPTR_CLASS(LoadedImageLayout)\nVPTR_CLASS(FlatImageLayout)\n\n#ifdef FEATURE_COMINTEROP\nVPTR_CLASS(ComMethodFrame)\nVPTR_CLASS(ComPlusMethodFrame)\nVPTR_CLASS(ComPrestubMethodFrame)\n#endif // FEATURE_COMINTEROP\n\n#ifdef FEATURE_INTERPRETER\nVPTR_CLASS(InterpreterFrame)\n#endif // FEATURE_INTERPRETER\nVPTR_CLASS(DebuggerClassInitMarkFrame)\nVPTR_CLASS(DebuggerSecurityCodeMarkFrame)\nVPTR_CLASS(DebuggerExitFrame)\nVPTR_CLASS(DebuggerU2MCatchHandlerFrame)\nVPTR_CLASS(FaultingExceptionFrame)\nVPTR_CLASS(FuncEvalFrame)\nVPTR_CLASS(HelperMethodFrame)\nVPTR_CLASS(HelperMethodFrame_1OBJ)\nVPTR_CLASS(HelperMethodFrame_2OBJ)\nVPTR_CLASS(HelperMethodFrame_3OBJ)\nVPTR_CLASS(HelperMethodFrame_PROTECTOBJ)\n#ifdef FEATURE_HIJACK\nVPTR_CLASS(HijackFrame)\n#endif\nVPTR_CLASS(InlinedCallFrame)\nVPTR_CLASS(MulticastFrame)\nVPTR_CLASS(PInvokeCalliFrame)\nVPTR_CLASS(PrestubMethodFrame)\nVPTR_CLASS(ProtectByRefsFrame)\nVPTR_CLASS(ProtectValueClassFrame)\n#ifdef FEATURE_HIJACK\nVPTR_CLASS(ResumableFrame)\nVPTR_CLASS(RedirectedThreadFrame)\n#endif\nVPTR_CLASS(StubDispatchFrame)\nVPTR_CLASS(CallCountingHelperFrame)\nVPTR_CLASS(ExternalMethodFrame)\n#ifdef FEATURE_READYTORUN\nVPTR_CLASS(DynamicHelperFrame)\n#endif\n#if defined(TARGET_X86) && !defined(UNIX_X86_ABI)\nVPTR_CLASS(TailCallFrame)\n#endif\nVPTR_CLASS(ExceptionFilterFrame)\n\n#ifdef _DEBUG\nVPTR_CLASS(AssumeByrefFromJITStack)\n#endif\n\n#ifdef DEBUGGING_SUPPORTED\nVPTR_CLASS(Debugger)\nVPTR_CLASS(EEDbgInterfaceImpl)\n#endif // DEBUGGING_SUPPORTED\n\nVPTR_CLASS(DebuggerController)\nVPTR_CLASS(DebuggerMethodInfoTable)\nVPTR_CLASS(DebuggerPatchTable)\n\nVPTR_CLASS(LoaderCodeHeap)\nVPTR_CLASS(HostCodeHeap)\n\nVPTR_CLASS(GlobalLoaderAllocator)\nVPTR_CLASS(AssemblyLoaderAllocator)\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/win64unwind.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef _WIN64UNWIND_H_\n#define _WIN64UNWIND_H_\n\n//\n// Define AMD64 exception handling structures and function prototypes.\n//\n// Define unwind operation codes.\n//\n\ntypedef enum _UNWIND_OP_CODES {\n    UWOP_PUSH_NONVOL = 0,\n    UWOP_ALLOC_LARGE,\n    UWOP_ALLOC_SMALL,\n    UWOP_SET_FPREG,\n    UWOP_SAVE_NONVOL,\n    UWOP_SAVE_NONVOL_FAR,\n    UWOP_EPILOG,\n    UWOP_SPARE_CODE,\n    UWOP_SAVE_XMM128,\n    UWOP_SAVE_XMM128_FAR,\n    UWOP_PUSH_MACHFRAME,\n\n#ifdef TARGET_UNIX\n    // UWOP_SET_FPREG_LARGE is a CLR Unix-only extension to the Windows AMD64 unwind codes.\n    // It is not part of the standard Windows AMD64 unwind codes specification.\n    // UWOP_SET_FPREG allows for a maximum of a 240 byte offset between RSP and the\n    // frame pointer, when the frame pointer is established. UWOP_SET_FPREG_LARGE\n    // has a 32-bit range scaled by 16. When UWOP_SET_FPREG_LARGE is used,\n    // UNWIND_INFO.FrameRegister must be set to the frame pointer register, and\n    // UNWIND_INFO.FrameOffset must be set to 15 (its maximum value). UWOP_SET_FPREG_LARGE\n    // is followed by two UNWIND_CODEs that are combined to form a 32-bit offset (the same\n    // as UWOP_SAVE_NONVOL_FAR). This offset is then scaled by 16. The result must be less\n    // than 2^32 (that is, the top 4 bits of the unscaled 32-bit number must be zero). This\n    // result is used as the frame pointer register offset from RSP at the time the frame pointer\n    // is established. Either UWOP_SET_FPREG or UWOP_SET_FPREG_LARGE can be used, but not both.\n\n    UWOP_SET_FPREG_LARGE,\n#endif // TARGET_UNIX\n} UNWIND_OP_CODES, *PUNWIND_OP_CODES;\n\nstatic const UCHAR UnwindOpExtraSlotTable[] = {\n    0,          // UWOP_PUSH_NONVOL\n    1,          // UWOP_ALLOC_LARGE (or 3, special cased in lookup code)\n    0,          // UWOP_ALLOC_SMALL\n    0,          // UWOP_SET_FPREG\n    1,          // UWOP_SAVE_NONVOL\n    2,          // UWOP_SAVE_NONVOL_FAR\n    1,          // UWOP_EPILOG\n    2,          // UWOP_SPARE_CODE      // previously 64-bit UWOP_SAVE_XMM_FAR\n    1,          // UWOP_SAVE_XMM128\n    2,          // UWOP_SAVE_XMM128_FAR\n    0,          // UWOP_PUSH_MACHFRAME\n\n#ifdef TARGET_UNIX\n    2,          // UWOP_SET_FPREG_LARGE\n#endif // TARGET_UNIX\n};\n\n//\n// Define unwind code structure.\n//\n\ntypedef union _UNWIND_CODE {\n    struct {\n        UCHAR CodeOffset;\n        UCHAR UnwindOp : 4;\n        UCHAR OpInfo : 4;\n    };\n\n    struct {\n        UCHAR OffsetLow;\n        UCHAR UnwindOp : 4;\n        UCHAR OffsetHigh : 4;\n    } EpilogueCode;\n\n    USHORT FrameOffset;\n} UNWIND_CODE, *PUNWIND_CODE;\n\n//\n// Define unwind information flags.\n//\n\n#define UNW_FLAG_NHANDLER 0x0\n#define UNW_FLAG_EHANDLER 0x1\n#define UNW_FLAG_UHANDLER 0x2\n#define UNW_FLAG_CHAININFO 0x4\n\n#ifdef TARGET_X86\n\ntypedef struct _UNWIND_INFO {\n    ULONG FunctionLength;\n} UNWIND_INFO, *PUNWIND_INFO;\n\n#else // TARGET_X86\n\ntypedef struct _UNWIND_INFO {\n    UCHAR Version : 3;\n    UCHAR Flags : 5;\n    UCHAR SizeOfProlog;\n    UCHAR CountOfUnwindCodes;\n    UCHAR FrameRegister : 4;\n    UCHAR FrameOffset : 4;\n    UNWIND_CODE UnwindCode[1];\n\n//\n// The unwind codes are followed by an optional DWORD aligned field that\n// contains the exception handler address or the address of chained unwind\n// information. If an exception handler address is specified, then it is\n// followed by the language specified exception handler data.\n//\n//  union {\n//      ULONG ExceptionHandler;\n//      ULONG FunctionEntry;\n//  };\n//\n//  ULONG ExceptionData[];\n//\n\n} UNWIND_INFO, *PUNWIND_INFO;\n\n#endif // TARGET_X86\n#endif // _WIN64UNWIND_H_\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/winwrap.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n//*****************************************************************************\n// WinWrap.h\n//\n// This file contains wrapper functions for Win32 API's that take strings.\n//\n// The Common Language Runtime internally uses UNICODE as the internal state\n// and string format.  This file will undef the mapping macros so that one\n// cannot mistakingly call a method that isn't going to work.  Instead, you\n// have to call the correct wrapper API.\n//\n//*****************************************************************************\n\n#ifndef __WIN_WRAP_H__\n#define __WIN_WRAP_H__\n\n//********** Macros. **********************************************************\n#if !defined(WIN32_LEAN_AND_MEAN)\n#define WIN32_LEAN_AND_MEAN\n#endif\n\n//\n// WinCE uniformly uses cdecl calling convention on x86. __stdcall is defined as __cdecl in SDK.\n// STDCALL macro is meant to be used where we have hard dependency on __stdcall calling convention\n// - the unification with __cdecl does not apply to STDCALL.\n//\n#define STDCALL _stdcall\n\n//********** Includes. ********************************************************\n\n#include <crtwrap.h>\n#include <windows.h>\n#include <wincrypt.h>\n#include <specstrings.h>\n\n#include \"longfilepathwrappers.h\"\n\n#if defined(_PREFAST_) || defined(SOURCE_FORMATTING)\n//\n// For PREFAST we don't want the C_ASSERT to be expanded since it always\n// involves the comparison of two constants which causes PREfast warning 326\n//\n#undef C_ASSERT\n#define C_ASSERT(expr)\n#endif\n\n#include \"palclr.h\"\n\n#if !defined(__TODO_PORT_TO_WRAPPERS__)\n//*****************************************************************************\n// Undefine all of the windows wrappers so you can't use them.\n//*****************************************************************************\n\n// winbase.h\n#undef GetBinaryType\n#undef GetShortPathName\n#undef GetEnvironmentStrings\n#undef FreeEnvironmentStrings\n#undef FormatMessage\n#undef lstrcmp\n#undef lstrcmpi\n#undef lstrcpyn\n#undef lstrlen\n#undef CreateMutex\n#undef OpenMutex\n#undef CreateEvent\n#undef OpenEvent\n#undef CreateSemaphore\n#undef OpenSemaphore\n#undef CreateWaitableTimer\n#undef CreateFileMapping\n#undef LoadLibrary\n#undef LoadLibraryEx\n#undef GetModuleFileName\n#undef GetModuleHandle\n#undef GetModuleHandleEx\n#undef CreateProcess\n#undef GetCommandLine\n#undef GetEnvironmentVariable\n#undef SetEnvironmentVariable\n#undef ExpandEnvironmentStrings\n#undef OutputDebugString\n#undef FindResource\n#undef FindResourceEx\n#undef BeginUpdateResource\n#undef UpdateResource\n#undef EndUpdateResource\n#undef GetPrivateProfileInt\n#undef GetSystemDirectory\n#undef GetTempPath\n#undef GetTempFileName\n#undef GetFullPathName\n#undef CreateFile\n#undef GetFileAttributes\n#undef GetFileAttributesEx\n#undef FindFirstFileEx\n#undef FindFirstFile\n#undef FindNextFile\n#undef CopyFile\n#undef CopyFileEx\n#undef MoveFile\n#undef CreateHardLink\n#undef CreateNamedPipe\n#undef WaitNamedPipe\n#undef LookupPrivilegeValue\n#undef GetVersionEx\n\n// winuser.h\n#undef MAKEINTRESOURCE\n#undef GetUserObjectInformation\n#undef GetMessage\n\n#undef SendMessage\n#undef CharLower\n#undef MessageBox\n#undef GetClassName\n#undef LoadString\n#undef GetCalendarInfo\n#undef GetDateFormat\n#undef GetTimeFormat\n#undef LCMapString\n\n#endif // !defined(__TODO_PORT_TO_WRAPPERS__)\n\n//\n// NT supports the wide entry points.  So we redefine the wrappers right back\n// to the *W entry points as macros.  This way no client code needs a wrapper on NT.\n//\n\n// winbase.h\n#define WszFormatMessage   FormatMessageW\n#define WszCreateMutex CreateMutexW\n#define WszOpenMutex OpenMutexW\n#define WszCreateEvent CreateEventW\n#define WszOpenEvent OpenEventW\n#define WszCreateWaitableTimer CreateWaitableTimerW\n#define WszCreateFileMapping CreateFileMappingW\n#define WszGetModuleHandle GetModuleHandleW\n#define WszGetModuleHandleEx GetModuleHandleExW\n#define WszGetCommandLine GetCommandLineW\n#define WszSetEnvironmentVariable SetEnvironmentVariableW\n#define WszExpandEnvironmentStrings ExpandEnvironmentStringsW\n#define WszOutputDebugString OutputDebugStringW\n#define WszFindResource FindResourceW\n#define WszFindResourceEx FindResourceExW\n#define WszBeginUpdateResource BeginUpdateResourceW\n#define WszUpdateResource UpdateResourceW\n#define WszEndUpdateResource EndUpdateResourceW\n#define WszGetPrivateProfileInt GetPrivateProfileIntW\n#define WszGetSystemDirectory GetSystemDirectoryW\n#define WszCreateNamedPipe CreateNamedPipeW\n#define WszWaitNamedPipe WaitNamedPipeW\n#define WszLookupPrivilegeValue LookupPrivilegeValueW\n\n// winuser.h\n#define WszMAKEINTRESOURCE MAKEINTRESOURCEW\n#define WszGetUserObjectInformation GetUserObjectInformationW\n#define WszGetMessage GetMessageW\n#define WszSendMessage SendMessageW\n#define WszCharLower CharLowerW\n#define WszGetClassName GetClassNameW\n#define WszLoadString LoadStringW\n#define WszRegOpenKeyEx RegOpenKeyExW\n#define WszRegOpenKey(hKey, wszSubKey, phkRes) RegOpenKeyExW(hKey, wszSubKey, 0, KEY_ALL_ACCESS, phkRes)\n#define WszRegQueryValue RegQueryValueW\n#define WszRegQueryValueEx RegQueryValueExW\n\n#define WszRegQueryInfoKey RegQueryInfoKeyW\n#define WszRegEnumValue RegEnumValueW\n#define WszRegEnumKeyEx RegEnumKeyExW\n#define WszGetCalendarInfo GetCalendarInfoW\n#define WszGetDateFormat GetDateFormatW\n#define WszGetTimeFormat GetTimeFormatW\n#define WszLCMapString LCMapStringW\n#define WszMultiByteToWideChar MultiByteToWideChar\n#define WszWideCharToMultiByte WideCharToMultiByte\n#define WszCreateSemaphore(_secattr, _count, _maxcount, _name) CreateSemaphoreExW((_secattr), (_count), (_maxcount), (_name), 0, MAXIMUM_ALLOWED | SYNCHRONIZE | SEMAPHORE_MODIFY_STATE)\n\n#undef GetFileVersionInfo\n#define GetFileVersionInfo(_filename, _handle, _len, _data) GetFileVersionInfoEx(0, (_filename), (_handle), (_len), (_data))\n#undef GetFileVersionInfoSize\n#define GetFileVersionInfoSize(_filename, _handle) GetFileVersionInfoSizeEx(0, (_filename), (_handle))\n\n#ifndef _T\n#define _T(str) W(str)\n#endif\n\n//File and Directory Functions which need special handling for LongFile Names\n//Note only the functions which are currently used are defined\n#define WszLoadLibrary         LoadLibraryExWrapper\n#define WszLoadLibraryEx       LoadLibraryExWrapper\n#define WszCreateFile          CreateFileWrapper\n#define WszGetFileAttributes   GetFileAttributesWrapper\n#define WszGetFileAttributesEx GetFileAttributesExWrapper\n\n//Can not use extended syntax\n#define WszGetFullPathName     GetFullPathNameW\n\n//Long Files will not work on these till redstone\n#define WszGetTempPath         GetTempPathWrapper\n\n//APIS which have a buffer as an out parameter\n#define WszGetEnvironmentVariable GetEnvironmentVariableWrapper\n#define WszSearchPath          SearchPathWrapper\n#define WszGetModuleFileName   GetModuleFileNameWrapper\n\n//*****************************************************************************\n// Prototypes for API's.\n//*****************************************************************************\n\nextern DWORD g_dwMaxDBCSCharByteSize;\n\nvoid EnsureCharSetInfoInitialized();\n\ninline DWORD GetMaxDBCSCharByteSize()\n{\n    // contract.h not visible here\n    __annotation(W(\"WRAPPER \") W(\"GetMaxDBCSCharByteSize\"));\n#ifndef HOST_UNIX\n    EnsureCharSetInfoInitialized();\n\n    _ASSERTE(g_dwMaxDBCSCharByteSize != 0);\n    return (g_dwMaxDBCSCharByteSize);\n#else // HOST_UNIX\n    return 3;\n#endif // HOST_UNIX\n}\n\n#ifndef Wsz_mbstowcs\n#define Wsz_mbstowcs(szOut, szIn, iSize) WszMultiByteToWideChar(CP_ACP, 0, szIn, -1, szOut, iSize)\n#endif\n\n#ifndef Wsz_wcstombs\n#define Wsz_wcstombs(szOut, szIn, iSize) WszWideCharToMultiByte(CP_ACP, 0, szIn, -1, szOut, iSize, 0, 0)\n#endif\n\n// For all platforms:\n\nBOOL\nWszCreateProcess(\n    LPCWSTR lpApplicationName,\n    LPCWSTR lpCommandLine,\n    LPSECURITY_ATTRIBUTES lpProcessAttributes,\n    LPSECURITY_ATTRIBUTES lpThreadAttributes,\n    BOOL bInheritHandles,\n    DWORD dwCreationFlags,\n    LPVOID lpEnvironment,\n    LPCWSTR lpCurrentDirectory,\n    LPSTARTUPINFOW lpStartupInfo,\n    LPPROCESS_INFORMATION lpProcessInformation\n    );\n\n#if defined(HOST_X86) && defined(_MSC_VER)\n\n//\n// Windows SDK does not use intrinsics on x86. Redefine the interlocked operations to use intrinsics.\n//\n\n#include \"intrin.h\"\n\n#define InterlockedIncrement            _InterlockedIncrement\n#define InterlockedDecrement            _InterlockedDecrement\n#define InterlockedExchange             _InterlockedExchange\n#define InterlockedCompareExchange      _InterlockedCompareExchange\n#define InterlockedExchangeAdd          _InterlockedExchangeAdd\n#define InterlockedCompareExchange64    _InterlockedCompareExchange64\n#define InterlockedAnd                  _InterlockedAnd\n#define InterlockedOr                   _InterlockedOr\n\n//\n// There is no _InterlockedCompareExchangePointer intrinsic in VC++ for x86.\n// winbase.h #defines InterlockedCompareExchangePointer as __InlineInterlockedCompareExchangePointer,\n// which calls the Win32 InterlockedCompareExchange, not the intrinsic _InterlockedCompareExchange.\n// We want the intrinsic, so we #undef the Windows version of this API, and define our own.\n//\n#ifdef InterlockedCompareExchangePointer\n#undef InterlockedCompareExchangePointer\n#endif\n\nFORCEINLINE\nPVOID\nInterlockedCompareExchangePointer (\n    __inout  PVOID volatile *Destination,\n    _In_opt_ PVOID ExChange,\n    _In_opt_ PVOID Comperand\n    )\n{\n    return((PVOID)(LONG_PTR)_InterlockedCompareExchange((LONG volatile *)Destination, (LONG)(LONG_PTR)ExChange, (LONG)(LONG_PTR)Comperand));\n}\n\n#endif // HOST_X86 && _MSC_VER\n\n#if defined(HOST_X86) & !defined(InterlockedIncrement64)\n\n// Interlockedxxx64 that do not have intrinsics are only supported on Windows Server 2003\n// or higher for X86 so define our own portable implementation\n\n#undef InterlockedIncrement64\n#define InterlockedIncrement64          __InterlockedIncrement64\n#undef InterlockedDecrement64\n#define InterlockedDecrement64          __InterlockedDecrement64\n#undef InterlockedExchange64\n#define InterlockedExchange64           __InterlockedExchange64\n#undef InterlockedExchangeAdd64\n#define InterlockedExchangeAdd64        __InterlockedExchangeAdd64\n\n__forceinline LONGLONG __InterlockedIncrement64(LONGLONG volatile *Addend)\n{\n    LONGLONG Old;\n\n    do {\n        Old = *Addend;\n    } while (InterlockedCompareExchange64(Addend,\n                                          Old + 1,\n                                          Old) != Old);\n\n    return Old + 1;\n}\n\n__forceinline LONGLONG __InterlockedDecrement64(LONGLONG volatile *Addend)\n{\n    LONGLONG Old;\n\n    do {\n        Old = *Addend;\n    } while (InterlockedCompareExchange64(Addend,\n                                          Old - 1,\n                                          Old) != Old);\n\n    return Old - 1;\n}\n\n__forceinline LONGLONG __InterlockedExchange64(LONGLONG volatile * Target, LONGLONG Value)\n{\n    LONGLONG Old;\n\n    do {\n        Old = *Target;\n    } while (InterlockedCompareExchange64(Target,\n                                          Value,\n                                          Old) != Old);\n\n    return Old;\n}\n\n__forceinline LONGLONG __InterlockedExchangeAdd64(LONGLONG volatile * Addend, LONGLONG Value)\n{\n    LONGLONG Old;\n\n    do {\n        Old = *Addend;\n    } while (InterlockedCompareExchange64(Addend,\n                                          Old + Value,\n                                          Old) != Old);\n\n    return Old;\n}\n\n#endif // HOST_X86\n\n#endif  // __WIN_WRAP_H__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/xclrdata.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n/*****************************************************************************\n **                                                                         **\n ** clrdata.idl - Common Language Runtime data access interfaces for         **\n **              clients needing to access runtime state from outside       **\n **              runtime, such as out-of-process debuggers.                 **\n **                                                                         **\n ** The access interface defines two different types of code running:       **\n ** The host is the user of the access interface.                           **\n ** The target is the target of the access.                                 **\n **                                                                         **\n ** The host and target can be have different instruction sets,             **\n ** pointer sizes, runtime versions and so on.                              **\n **                                                                         **\n *****************************************************************************/\n\nimport \"clrdata.idl\";\n\ncpp_quote(\"#if 0\")\n\ntypedef UINT32  mdToken;\ntypedef mdToken mdTypeDef;\ntypedef mdToken mdMethodDef;\ntypedef mdToken mdFieldDef;\n\ntypedef ULONG CorElementType;\n\n#define EXCEPTION_MAXIMUM_PARAMETERS 15 // maximum number of exception parameters\n\n// The following definition is pasted in from winnt.h, which doesn't\n// import cleanly as a whole.\ntypedef struct _EXCEPTION_RECORD64 {\n    DWORD    ExceptionCode;\n    DWORD ExceptionFlags;\n    DWORD64 ExceptionRecord;\n    DWORD64 ExceptionAddress;\n    DWORD NumberParameters;\n    DWORD __unusedAlignment;\n    DWORD64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];\n} EXCEPTION_RECORD64, *PEXCEPTION_RECORD64;\n\ncpp_quote(\"#endif\")\n\n/* ------------------------------------------------------------------------- *\n * Forward declarations.\n * ------------------------------------------------------------------------- */\n\n/*\n * The following interfaces (with an \"IX\" prefix instead of the conventional\n * \"I\") are works in progress. They will change at least once before Whidbey\n * ships.\n */\n\n#pragma warning(push)\n#pragma warning(disable:28718)    //Unable to annotate as this is not a local interface\n\ninterface IXCLRDataProcess;\ninterface IXCLRDataAppDomain;\ninterface IXCLRDataAssembly;\ninterface IXCLRDataModule;\ninterface IXCLRDataModule2;\n\ninterface IXCLRDataTypeDefinition;\ninterface IXCLRDataTypeInstance;\ninterface IXCLRDataMethodDefinition;\ninterface IXCLRDataMethodInstance;\n\ninterface IXCLRDataTask;\ninterface IXCLRDataStackWalk;\ninterface IXCLRDataFrame;\ninterface IXCLRDataFrame2;\n\ninterface IXCLRDataExceptionState;\ninterface IXCLRDataExceptionNotification;\n\ninterface IXCLRDataValue;\n\ninterface IXCLRDataTarget3;\n\ninterface IXCLRDataDisplay;\n\n#pragma warning(pop)\n\ntypedef struct\n{\n    CLRDATA_ADDRESS startAddress;\n    CLRDATA_ADDRESS endAddress;\n} CLRDATA_ADDRESS_RANGE;\n\n/*\n * Many enumerators are based on an opaque state bundle.\n */\ntypedef ULONG64 CLRDATA_ENUM;\n\n/*\n * Exception code used for notifications in this interface.\n */\ncpp_quote(\"#define CLRDATA_NOTIFY_EXCEPTION 0xe0444143\")\n\n/*\n * General requests shared by two or more interfaces.\n */\n\ntypedef enum\n{\n    CLRDATA_REQUEST_REVISION = 0xe0000000,\n} CLRDataGeneralRequest;\n\n/*\n * The following three sets of flags share\n * many common definitions are so are\n * grouped into a block.\n */\n\ntypedef enum\n{\n    CLRDATA_TYPE_DEFAULT       = 0x00000000,\n\n    // Identify particular kinds of types.  These flags\n    // are shared between type, field and value.\n    CLRDATA_TYPE_IS_PRIMITIVE  = 0x00000001,\n    CLRDATA_TYPE_IS_VALUE_TYPE = 0x00000002,\n    CLRDATA_TYPE_IS_STRING     = 0x00000004,\n    CLRDATA_TYPE_IS_ARRAY      = 0x00000008,\n    CLRDATA_TYPE_IS_REFERENCE  = 0x00000010,\n    CLRDATA_TYPE_IS_POINTER    = 0x00000020,\n    CLRDATA_TYPE_IS_ENUM       = 0x00000040,\n\n    // Alias for all field kinds.\n    CLRDATA_TYPE_ALL_KINDS     = 0x7f,\n} CLRDataTypeFlag;\n\ntypedef enum\n{\n    CLRDATA_FIELD_DEFAULT         = 0x00000000,\n\n    // Identify particular kinds of types.  These flags\n    // are shared between type, field and value.\n    CLRDATA_FIELD_IS_PRIMITIVE    = CLRDATA_TYPE_IS_PRIMITIVE,\n    CLRDATA_FIELD_IS_VALUE_TYPE   = CLRDATA_TYPE_IS_VALUE_TYPE,\n    CLRDATA_FIELD_IS_STRING       = CLRDATA_TYPE_IS_STRING,\n    CLRDATA_FIELD_IS_ARRAY        = CLRDATA_TYPE_IS_ARRAY,\n    CLRDATA_FIELD_IS_REFERENCE    = CLRDATA_TYPE_IS_REFERENCE,\n    CLRDATA_FIELD_IS_POINTER      = CLRDATA_TYPE_IS_POINTER,\n    CLRDATA_FIELD_IS_ENUM         = CLRDATA_TYPE_IS_ENUM,\n\n    // Alias for all field kinds.\n    CLRDATA_FIELD_ALL_KINDS       = CLRDATA_TYPE_ALL_KINDS,\n\n    // Identify field properties.  These flags are\n    // shared between field and value.\n    CLRDATA_FIELD_IS_INHERITED    = 0x00000080,\n    CLRDATA_FIELD_IS_LITERAL      = 0x00000100,\n\n    // Identify field storage location.  These flags are\n    // shared between field and value.\n    CLRDATA_FIELD_FROM_INSTANCE   = 0x00000200,\n    CLRDATA_FIELD_FROM_TASK_LOCAL = 0x00000400,\n    CLRDATA_FIELD_FROM_STATIC     = 0x00000800,\n\n    // Alias for all types of field locations.\n    CLRDATA_FIELD_ALL_LOCATIONS   = 0x00000e00,\n    // Alias for all fields from all locations.\n    CLRDATA_FIELD_ALL_FIELDS      = 0x00000eff,\n} CLRDataFieldFlag;\n\ntypedef enum\n{\n    CLRDATA_VALUE_DEFAULT         = 0x00000000,\n\n    // Identify particular kinds of types.  These flags\n    // are shared between type, field and value.\n    CLRDATA_VALUE_IS_PRIMITIVE    = CLRDATA_TYPE_IS_PRIMITIVE,\n    CLRDATA_VALUE_IS_VALUE_TYPE   = CLRDATA_TYPE_IS_VALUE_TYPE,\n    CLRDATA_VALUE_IS_STRING       = CLRDATA_TYPE_IS_STRING,\n    CLRDATA_VALUE_IS_ARRAY        = CLRDATA_TYPE_IS_ARRAY,\n    CLRDATA_VALUE_IS_REFERENCE    = CLRDATA_TYPE_IS_REFERENCE,\n    CLRDATA_VALUE_IS_POINTER      = CLRDATA_TYPE_IS_POINTER,\n    CLRDATA_VALUE_IS_ENUM         = CLRDATA_TYPE_IS_ENUM,\n\n    // Alias for all value kinds.\n    CLRDATA_VALUE_ALL_KINDS       = CLRDATA_TYPE_ALL_KINDS,\n\n    // Identify field properties.  These flags are\n    // shared between field and value.\n    CLRDATA_VALUE_IS_INHERITED    = CLRDATA_FIELD_IS_INHERITED,\n    CLRDATA_VALUE_IS_LITERAL      = CLRDATA_FIELD_IS_LITERAL,\n\n    // Identify field storage location.  These flags are\n    // shared between field and value.\n    CLRDATA_VALUE_FROM_INSTANCE   = CLRDATA_FIELD_FROM_INSTANCE,\n    CLRDATA_VALUE_FROM_TASK_LOCAL = CLRDATA_FIELD_FROM_TASK_LOCAL,\n    CLRDATA_VALUE_FROM_STATIC     = CLRDATA_FIELD_FROM_STATIC,\n\n    // Alias for all types of field locations.\n    CLRDATA_VALUE_ALL_LOCATIONS   = CLRDATA_FIELD_ALL_LOCATIONS,\n    // Alias for all fields from all locations.\n    CLRDATA_VALUE_ALL_FIELDS      = CLRDATA_FIELD_ALL_FIELDS,\n\n    // Identify whether the value is a boxed object.\n    CLRDATA_VALUE_IS_BOXED        = 0x00001000,\n} CLRDataValueFlag;\n\n[\n    object,\n    local,\n    uuid(59d9b5e1-4a6f-4531-84c3-51d12da22fd4),\n    pointer_default(unique)\n]\ninterface IXCLRDataTarget3 : ICLRDataTarget2\n{\n    /*\n     * Ask the target to recover metadata for\n     * an image.  May not succeed.\n     */\n    HRESULT GetMetaData([in] LPCWSTR imagePath,\n                        [in] ULONG32 imageTimestamp,\n                        [in] ULONG32 imageSize,\n                        [in] GUID* mvid,\n                        [in] ULONG32 mdRva,\n                        [in] ULONG32 flags,\n                        [in] ULONG32 bufferSize,\n                        [out, size_is(bufferSize), length_is(*dataSize)]\n                        BYTE* buffer,\n                        [out] ULONG32* dataSize);\n};\n\n/*\n * Flags used for *ByName methods.\n */\ntypedef enum\n{\n    CLRDATA_BYNAME_CASE_SENSITIVE   = 0x00000000,\n    CLRDATA_BYNAME_CASE_INSENSITIVE = 0x00000001,\n} CLRDataByNameFlag;\n\n/*\n * Flags used in GetName methods.\n */\ntypedef enum\n{\n    CLRDATA_GETNAME_DEFAULT       = 0x00000000,\n    CLRDATA_GETNAME_NO_NAMESPACES = 0x00000001,\n    CLRDATA_GETNAME_NO_PARAMETERS = 0x00000002,\n} CLRDataGetNameFlag;\n\ntypedef enum\n{\n    CLRDATA_PROCESS_DEFAULT = 0x00000000,\n    CLRDATA_PROCESS_IN_GC   = 0x00000001,\n} CLRDataProcessFlag;\n\ntypedef enum\n{\n    CLRDATA_ADDRESS_UNRECOGNIZED,\n    CLRDATA_ADDRESS_MANAGED_METHOD,\n    CLRDATA_ADDRESS_RUNTIME_MANAGED_CODE,\n    CLRDATA_ADDRESS_RUNTIME_UNMANAGED_CODE,\n    CLRDATA_ADDRESS_GC_DATA,\n    CLRDATA_ADDRESS_RUNTIME_MANAGED_STUB,\n    CLRDATA_ADDRESS_RUNTIME_UNMANAGED_STUB,\n} CLRDataAddressType;\n\ntypedef enum\n{\n    CLRDATA_NOTIFY_ON_MODULE_LOAD           = 0x00000001,\n    CLRDATA_NOTIFY_ON_MODULE_UNLOAD         = 0x00000002,\n    CLRDATA_NOTIFY_ON_EXCEPTION             = 0x00000004,\n    CLRDATA_NOTIFY_ON_EXCEPTION_CATCH_ENTER = 0x00000008,\n} CLRDataOtherNotifyFlag;\n\n/*\n * Data buffer and flags for follow-stub data.\n */\n\ntypedef struct\n{\n    ULONG64 Data[8];\n} CLRDATA_FOLLOW_STUB_BUFFER;\n\ntypedef enum\n{\n    CLRDATA_FOLLOW_STUB_DEFAULT = 0x00000000,\n} CLRDataFollowStubInFlag;\n\ntypedef enum\n{\n    CLRDATA_FOLLOW_STUB_INTERMEDIATE = 0x00000000,\n    CLRDATA_FOLLOW_STUB_EXIT         = 0x00000001,\n} CLRDataFollowStubOutFlag;\n\ntypedef enum\n{\n    CLRNATIVEIMAGE_PE_INFO          = 0x00000001,\n    CLRNATIVEIMAGE_COR_INFO         = 0x00000002,\n    CLRNATIVEIMAGE_FIXUP_TABLES     = 0x00000004,\n    CLRNATIVEIMAGE_FIXUP_HISTOGRAM  = 0x00000008,\n    CLRNATIVEIMAGE_MODULE           = 0x00000010,\n    CLRNATIVEIMAGE_METHODS          = 0x00000020,\n    CLRNATIVEIMAGE_DISASSEMBLE_CODE = 0x00000040,\n    CLRNATIVEIMAGE_IL               = 0x00000080,\n    CLRNATIVEIMAGE_METHODTABLES     = 0x00000100,\n    CLRNATIVEIMAGE_NATIVE_INFO      = 0x00000200,\n    CLRNATIVEIMAGE_MODULE_TABLES    = 0x00000400,\n    CLRNATIVEIMAGE_FROZEN_SEGMENT   = 0x00000800,\n    CLRNATIVEIMAGE_PE_FILE          = 0x00001000,\n    CLRNATIVEIMAGE_GC_INFO          = 0x00002000,\n    CLRNATIVEIMAGE_EECLASSES        = 0x00004000,\n    CLRNATIVEIMAGE_NATIVE_TABLES    = 0x00008000,\n    CLRNATIVEIMAGE_PRECODES         = 0x00010000,\n    CLRNATIVEIMAGE_TYPEDESCS        = 0x00020000,\n    CLRNATIVEIMAGE_VERBOSE_TYPES    = 0x00040000,\n    CLRNATIVEIMAGE_METHODDESCS      = 0x00080000,\n    CLRNATIVEIMAGE_METADATA         = 0x00100000,\n    CLRNATIVEIMAGE_DISABLE_NAMES    = 0x00200000,\n    CLRNATIVEIMAGE_DISABLE_REBASING = 0x00400000,\n    CLRNATIVEIMAGE_SLIM_MODULE_TBLS = 0x00800000,\n    CLRNATIVEIMAGE_RESOURCES        = 0x01000000,\n    CLRNATIVEIMAGE_FILE_OFFSET      = 0x02000000,\n    CLRNATIVEIMAGE_DEBUG_TRACE      = 0x04000000,\n    CLRNATIVEIMAGE_RELOCATIONS      = 0x08000000,\n    CLRNATIVEIMAGE_FIXUP_THUNKS     = 0x10000000,\n    CLRNATIVEIMAGE_DEBUG_COVERAGE   = 0x80000000\n} CLRNativeImageDumpOptions;\ncpp_quote(\"#ifdef __cplusplus\")\ncpp_quote(\"inline CLRNativeImageDumpOptions operator|=(CLRNativeImageDumpOptions& lhs, CLRNativeImageDumpOptions rhs) { return (lhs = (CLRNativeImageDumpOptions)( ((unsigned)lhs) | ((unsigned)rhs) )); }\")\ncpp_quote(\"#endif\")\ntypedef enum\n{\n    CLRDATAHINT_DISPLAY_HINTS_NONE          = 0,\n    //array hints 0x000000ff\n    CLRDATAHINT_DISPLAY_ARRAY_AS_TABLE      = 0x00000001,\n    CLRDATAHINT_DISPLAY_ARRAY_AS_ARRAY      = 0x00000002,\n    CLRDATAHINT_DISPLAY_ARRAY_AS_ARRAY_IDX  = 0x00000003, //print idx as field 1\n    CLRDATAHINT_DISPLAY_ARRAY_AS_MAP        = 0x00000004,\n    CLRDATAHINT_DISPLAY_ARRAY_HINT_MASK     = 0x000000ff,\n\n    //structure hints\n    CLRDATAHINT_DISPLAY_STRUCT_AS_TABLE     = 0x00000100,\n    CLRDATAHINT_DISPLAY_STRUCT_HINT_MASK    = 0x0000ff00,\n\n    //separate fields with tabs\n    CLRDATAHINT_DISPLAY_SEP_TAB             = 0x00000000,\n    //separate fields with spaces\n    CLRDATAHINT_DISPLAY_SEP_SPACE           = 0x01000000,\n    //separate first field by a tab, and all other fields with spaces\n    CLRDATAHINT_DISPLAY_SEP_TAB_SPACE       = 0x02000000,\n    CLRDATAHINT_DISPLAY_SEP_MASK            = 0xff000000,\n} CLRDataDisplayHints;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning for interface IXCLRDataProcess */\n\n/*\n * This interface supports the loading of dependencies and processing of PE\n * files for the NativeImageDumper.\n */\n[\n    object,\n    local,\n    uuid(E5F3039D-2C0C-4230-A69E-12AF1C3E563C)\n]\ninterface IXCLRLibrarySupport : IUnknown\n{\n    //loads a dependency.  It can fail if the image needs to be relocated.\n    HRESULT LoadHardboundDependency(const WCHAR * name, REFGUID mvid,\n                                    [out]SIZE_T *loadedBase);\n    HRESULT LoadSoftboundDependency(const WCHAR * name,\n                                    const BYTE * assemblymetadataBinding,\n                                    const BYTE * hash, ULONG hashLength,\n                                    [out]SIZE_T *loadedBase);\n};\n\ninterface IXCLRDisassemblySupport;\ntypedef  SIZE_T (__stdcall *CDSTranslateAddrCB)(IXCLRDisassemblySupport *, CLRDATA_ADDRESS, WCHAR *, SIZE_T, DWORDLONG *);\ntypedef  SIZE_T (__stdcall *CDSTranslateFixupCB)(IXCLRDisassemblySupport *, CLRDATA_ADDRESS, SIZE_T, WCHAR *, SIZE_T, DWORDLONG *);\ntypedef  SIZE_T (__stdcall *CDSTranslateConstCB)(IXCLRDisassemblySupport *, DWORD, WCHAR *, SIZE_T);\ntypedef  SIZE_T (__stdcall *CDSTranslateRegrelCB)(IXCLRDisassemblySupport *, unsigned rega, CLRDATA_ADDRESS, WCHAR *, SIZE_T, DWORD *);\n\n[\n    object,\n    local,\n    uuid(1F0F7134-D3F3-47DE-8E9B-C2FD358A2936)\n]\ninterface IXCLRDisassemblySupport : IUnknown\n{\n    HRESULT SetTranslateAddrCallback([in] CDSTranslateAddrCB cb);\n    HRESULT PvClientSet([in] void * pv);\n\n    SIZE_T CbDisassemble(CLRDATA_ADDRESS, const void *, SIZE_T);\n    SIZE_T Cinstruction();\n    BOOL FSelectInstruction(SIZE_T);\n    SIZE_T CchFormatInstr(WCHAR *, SIZE_T);\n    void *PvClient();\n    HRESULT SetTranslateFixupCallback([in]CDSTranslateFixupCB cb);\n    HRESULT SetTranslateConstCallback([in]CDSTranslateConstCB cb);\n    HRESULT SetTranslateRegrelCallback([in]CDSTranslateRegrelCB cb);\n    BOOL TargetIsAddress();\n};\n\n/*\n * This interface is passed to CLRDataCreateInstance::DumpNativeImage.  It\n * handles display of the logical data in the ngen image.\n */\n[\n    object,\n    local,\n    uuid(A3C1704A-4559-4a67-8D28-E8F4FE3B3F62)\n]\ninterface IXCLRDataDisplay : IUnknown\n{\n    HRESULT ErrorPrintF(const char * const fmt, ...);\n    HRESULT NativeImageDimensions(SIZE_T base, SIZE_T size, DWORD sectionAlign);\n    HRESULT Section(const char * const name, SIZE_T rva, SIZE_T size);\n    HRESULT GetDumpOptions([out] CLRNativeImageDumpOptions * pOptions);\n\n    //Start and end the document\n    HRESULT StartDocument();\n    HRESULT EndDocument();\n\n    //XML-Constructs that do not map to actual fields or structures\n\n    //A category is a top level section of the ngen output.  For example,\n    //\"Sections\", \"Directories\", \"CLR Info\", etc.\n    HRESULT StartCategory(const char * const name);\n    HRESULT EndCategory();\n\n    //starts an element containing either xml text or other elements.  Only\n    //used within arrays and lists.  Otherwise use StartVStructure.\n    HRESULT StartElement(const char * const name);\n    HRESULT EndElement();\n    //like a Structure, but without a name and size.  Used within categories\n    //and structures.\n    HRESULT StartVStructure(const char * const name );\n    HRESULT StartVStructureWithOffset( const char * const name,\n                                       unsigned fieldOffset,\n                                       unsigned fieldSize );\n    HRESULT EndVStructure();\n\n    //An element that contains xml text.\n    HRESULT StartTextElement(const char * const name);\n    HRESULT EndTextElement();\n    HRESULT WriteXmlText(const char * const fmt, ...);\n    HRESULT WriteXmlTextBlock(const char * const fmt, ...);\n\n    HRESULT WriteEmptyElement(const char * const element);\n\n\n    //produces <element>ptr</element>\n    HRESULT WriteElementPointer(const char * const element, SIZE_T ptr);\n    HRESULT WriteElementPointerAnnotated(const char * const element, SIZE_T ptr,\n                                         const WCHAR * const annotation );\n    //produces <element base=\"base\" size=\"size\"/>\n    HRESULT WriteElementAddress(const char * const element, SIZE_T base, SIZE_T size);\n    HRESULT WriteElementAddressNamed(const char * const element, const char * const name,\n                                     SIZE_T base, SIZE_T size);\n    HRESULT WriteElementAddressNamedW(const char * const element, const WCHAR * const name,\n                                      SIZE_T base, SIZE_T size);\n    HRESULT WriteElementString(const char * const element, const char * const data);\n    HRESULT WriteElementStringW(const char * const element, const WCHAR * const data);\n    HRESULT WriteElementInt(const char * const element, int value);\n    HRESULT WriteElementUInt(const char * const element, DWORD value);\n    HRESULT WriteElementEnumerated(const char * const element, DWORD value,\n                                   const WCHAR * const mnemonic);\n    //writes <element>value</element> if value != suppressIfEqual.\n    //in text mode the whole element is suppressed (and a \"\" is appended if\n    //inside an array or list.\n    HRESULT WriteElementIntWithSuppress( const char * const element, int value,\n                                          int suppressIfEqual );\n    //For text, it produces \"(element)\" or \"\" instead of \"true\" or \"false\".\n    HRESULT WriteElementFlag(const char * const element, BOOL flag);\n\n    //if countPrefix is not Null, displays a total at the end in text mode.\n    //Arrays have headings in both text and xml.  Lists are \"repeated elements\"\n    HRESULT StartArray( const char * const name, const WCHAR * const fmt);\n    HRESULT EndArray( const char * const countPrefix );\n    HRESULT StartList( const WCHAR * const fmt );\n    HRESULT EndList();\n\n    //XML-Constructs that represent real C++ Data structure\n    HRESULT StartArrayWithOffset( const char * const name, unsigned fieldOffset,\n                                  unsigned fieldSize, const WCHAR * const fmt );\n#if 0\n\n    //writes <element>value</element> if value != suppressIfEqual.\n    //in text mode the whole element is suppressed (and a \"\" is appended if\n    //inside an array or list.\n    HRESULT WriteFieldIntWithSuppress( const char * const element, unsigned offset,\n                                       int value, int suppressIfEqual );\n#endif\n\n    HRESULT WriteFieldString(const char * const element, unsigned fieldOffset,\n                             unsigned fieldSize, const char * const data);\n    HRESULT WriteFieldStringW(const char * const element, unsigned fieldOffset,\n                              unsigned fieldSize, const WCHAR * const data);\n    //produces <element>ptr</element>\n    HRESULT WriteFieldPointer(const char * const element, unsigned fieldOffset,\n                              unsigned fieldSize, SIZE_T ptr);\n    //produces <element>ptr+size</element>\n    HRESULT WriteFieldPointerWithSize(const char * const element,\n                                      unsigned fieldOffset, unsigned fieldSize,\n                                      SIZE_T ptr, SIZE_T size);\n    HRESULT WriteFieldInt(const char * const element, unsigned fieldOffset,\n                          unsigned fieldSize, int value);\n    HRESULT WriteFieldUInt(const char * const element, unsigned fieldOffset,\n                           unsigned fieldSize, DWORD value);\n    HRESULT WriteFieldEnumerated(const char * const element, unsigned fieldOffset,\n                                 unsigned fieldSize, DWORD value,\n                                 const WCHAR * const mnemonic);\n    HRESULT WriteFieldEmpty(const char * const element, unsigned fieldOffset,\n                            unsigned fieldSize);\n    HRESULT WriteFieldFlag(const char * const element, unsigned fieldOffset,\n                           unsigned fieldSize, BOOL flag);\n    HRESULT WriteFieldPointerAnnotated(const char * const element,\n                                       unsigned fieldOffset, unsigned fieldSize,\n                                       SIZE_T ptr, const WCHAR * const annotation);\n\n    //produces <element base=\"base\" size=\"size\"/>\n    HRESULT WriteFieldAddress(const char * const element, unsigned fieldOffset,\n                              unsigned fieldSize, SIZE_T base, SIZE_T size);\n    //For text, it produces \"(element)\" or \"\" instead of \"true\" or \"false\".\n#if 0\n    HRESULT WriteFieldFlag(const char * const element, unsigned offset, BOOL flag);\n    HRESULT WriteFieldInt(const char * const element, unsigned offset, int value);\n    HRESULT WriteFieldUInt(const char * const element, unsigned offset, DWORD value);\n\n\n    HRESULT WriteFieldEnumerated(const char * const element, unsigned offset,\n                                 DWORD value, const WCHAR * const mnemonic);\n#endif\n    //structures are like categories and elements, but they have a base and\n    //size.\n    HRESULT StartStructure( const char * const name, SIZE_T ptr, SIZE_T size );\n    HRESULT StartStructureWithNegSpace( const char * const name, SIZE_T ptr,\n                                        SIZE_T startPtr, SIZE_T totalSize );\n    HRESULT StartStructureWithOffset( const char * const name, unsigned fieldOffset,\n                                      unsigned fieldSize, SIZE_T ptr,\n                                      SIZE_T size );\n    HRESULT EndStructure();\n#if 0\n    //produces <element>ptr+size</element>\n    HRESULT WriteElementPointerWithSize(const char * const element, SIZE_T ptr,\n                                        SIZE_T size);\n    HRESULT WriteElementInt(const char * const element, int value);\n\n\n    HRESULT WriteFixupDescription(SIZE_T ptr, DWORD tagged, SIZE_T handle,\n                                  const char * const name );\n\n\n    //structures are like categories and elements, but they have a base and\n    //size.\n    HRESULT StartStructure( const char * const name, SIZE_T ptr, SIZE_T size );\n    HRESULT EndStructure();\n\n#endif\n};\n\n/*\n * Interface representing the process itself. Can be obtained via\n * CLRDataCreateInstance.\n */\n[\n    object,\n    local,\n    uuid(5c552ab6-fc09-4cb3-8e36-22fa03c798b7)\n]\ninterface IXCLRDataProcess : IUnknown\n{\n    /*\n     * Flush any cached data for this process. All ICLR* interfaces obtained\n     * for this process will become invalid with this call.\n     */\n    HRESULT Flush();\n\n    /*\n     * Begin enumeration of tasks.\n     * Returns S_FALSE if the enumeration is empty.\n     */\n    HRESULT StartEnumTasks([out] CLRDATA_ENUM* handle);\n\n    /*\n     * Get the next entry in the enumeration.\n     * Returns S_FALSE if there isn't a next entry.\n     */\n    HRESULT EnumTask([in, out] CLRDATA_ENUM* handle,\n                     [out] IXCLRDataTask** task);\n\n    /*\n     * Release the enumerator.\n     */\n    HRESULT EndEnumTasks([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the managed task running on the given OS thread ID\n     */\n    HRESULT GetTaskByOSThreadID([in] ULONG32 osThreadID,\n                                [out] IXCLRDataTask** task);\n\n    /*\n     * Get the managed task corresponding to the given task ID.\n     */\n    HRESULT GetTaskByUniqueID([in] ULONG64 taskID,\n                              [out] IXCLRDataTask** task);\n\n    /*\n     * Get state flags, defined in CLRDataProcessFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataProcess* process);\n\n    /*\n     * Get the managed object representing the process.\n     */\n    HRESULT GetManagedObject([out] IXCLRDataValue** value);\n\n    /*\n     * Mark the process so that it attempts to reach the\n     * desired execution state the next time it executes.\n     */\n    HRESULT GetDesiredExecutionState([out] ULONG32* state);\n    HRESULT SetDesiredExecutionState([in] ULONG32 state);\n\n    /*\n     * Return an indicator of the type of data referred\n     * to by the given address.\n     */\n    HRESULT GetAddressType([in] CLRDATA_ADDRESS address,\n                           [out] CLRDataAddressType* type);\n\n    /*\n     * Get a name for the given address if\n     * the address refers to non-managed-method information.\n     * Method names can be retrieved by using GetMethodInstanceByAddress\n     * and GetName on the method instance.\n     *\n     * Returns S_FALSE if the buffer is not large enough for the name,\n     * and sets nameLen to be the buffer length needed.\n     */\n    HRESULT GetRuntimeNameByAddress([in] CLRDATA_ADDRESS address,\n                                    [in] ULONG32 flags,\n                                    [in] ULONG32 bufLen,\n                                    [out] ULONG32 *nameLen,\n                                    [out, size_is(bufLen)] WCHAR nameBuf[],\n                                    [out] CLRDATA_ADDRESS* displacement);\n\n    /*\n     * App domain enumeration.\n     */\n    HRESULT StartEnumAppDomains([out] CLRDATA_ENUM* handle);\n    HRESULT EnumAppDomain([in, out] CLRDATA_ENUM* handle,\n                          [out] IXCLRDataAppDomain** appDomain);\n    HRESULT EndEnumAppDomains([in] CLRDATA_ENUM handle);\n\n    /*\n     * Find an app domain by its unique ID.\n     */\n    HRESULT GetAppDomainByUniqueID([in] ULONG64 id,\n                                   [out] IXCLRDataAppDomain** appDomain);\n\n    /*\n     * Assembly enumeration.\n     */\n    HRESULT StartEnumAssemblies([out] CLRDATA_ENUM* handle);\n    HRESULT EnumAssembly([in, out] CLRDATA_ENUM* handle,\n                         [out] IXCLRDataAssembly **assembly);\n    HRESULT EndEnumAssemblies([in] CLRDATA_ENUM handle);\n\n    /*\n     * Module enumeration.\n     */\n    HRESULT StartEnumModules([out] CLRDATA_ENUM* handle);\n    HRESULT EnumModule([in, out] CLRDATA_ENUM* handle,\n                       [out] IXCLRDataModule **mod);\n    HRESULT EndEnumModules([in] CLRDATA_ENUM handle);\n\n    /*\n     * Look up a module by address.\n     */\n    HRESULT GetModuleByAddress([in] CLRDATA_ADDRESS address,\n                               [out] IXCLRDataModule** mod);\n\n    /*\n     * Look up method instances by native code address.\n     */\n    HRESULT StartEnumMethodInstancesByAddress([in] CLRDATA_ADDRESS address,\n                                              [in] IXCLRDataAppDomain* appDomain,\n                                              [out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodInstanceByAddress([in] CLRDATA_ENUM* handle,\n                                        [out] IXCLRDataMethodInstance** method);\n    HRESULT EndEnumMethodInstancesByAddress([in] CLRDATA_ENUM handle);\n\n    /*\n     * Look up the name and value of a piece of data by its address.\n     */\n    HRESULT GetDataByAddress([in] CLRDATA_ADDRESS address,\n                             [in] ULONG32 flags,\n                             [in] IXCLRDataAppDomain* appDomain,\n                             [in] IXCLRDataTask* tlsTask,\n                             [in] ULONG32 bufLen,\n                             [out] ULONG32 *nameLen,\n                             [out, size_is(bufLen)] WCHAR nameBuf[],\n                             [out] IXCLRDataValue** value,\n                             [out] CLRDATA_ADDRESS* displacement);\n\n    /*\n     * Get managed state, if any, for the given system exception.\n     * OBSOLETE, DO NOT USE.\n     */\n    HRESULT GetExceptionStateByExceptionRecord([in] EXCEPTION_RECORD64* record,\n                                               [out] IXCLRDataExceptionState **exState);\n\n    /*\n     * Translate a system exception record into\n     * a particular kind of notification if possible.\n     */\n    HRESULT TranslateExceptionRecordToNotification([in] EXCEPTION_RECORD64* record,\n                                                   [in] IXCLRDataExceptionNotification* notify);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Create a simple value based on the given\n     * type and address information.\n     */\n    HRESULT CreateMemoryValue([in] IXCLRDataAppDomain* appDomain,\n                              [in] IXCLRDataTask* tlsTask,\n                              [in] IXCLRDataTypeInstance* type,\n                              [in] CLRDATA_ADDRESS addr,\n                              [out] IXCLRDataValue** value);\n\n    /*\n     * Update all existing notifications for a module.\n     * If module is NULL all modules are affected.\n     */\n    HRESULT SetAllTypeNotifications(IXCLRDataModule* mod,\n                                    ULONG32 flags);\n    HRESULT SetAllCodeNotifications(IXCLRDataModule* mod,\n                                    ULONG32 flags);\n\n    /*\n     * Request notification when a type is\n     * loaded or unloaded.\n     * If mods is NULL singleMod is used as\n     * the module for all tokens.\n     * If flags is NULL singleFlags is used as\n     * the flags for all tokens.\n     */\n    HRESULT GetTypeNotifications([in] ULONG32 numTokens,\n                                 [in, size_is(numTokens)]\n                                 IXCLRDataModule* mods[],\n                                 [in] IXCLRDataModule* singleMod,\n                                 [in, size_is(numTokens)] mdTypeDef tokens[],\n                                 [out, size_is(numTokens)] ULONG32 flags[]);\n    HRESULT SetTypeNotifications([in] ULONG32 numTokens,\n                                 [in, size_is(numTokens)]\n                                 IXCLRDataModule* mods[],\n                                 [in] IXCLRDataModule* singleMod,\n                                 [in, size_is(numTokens)] mdTypeDef tokens[],\n                                 [in, size_is(numTokens)] ULONG32 flags[],\n                                 [in] ULONG32 singleFlags);\n\n    /*\n     * Request notification when code is generated or\n     * discarded for a method.\n     * If mods is NULL singleMod is used as\n     * the module for all tokens.\n     * If flags is NULL singleFlags is used as\n     * the flags for all tokens.\n     */\n    HRESULT GetCodeNotifications([in] ULONG32 numTokens,\n                                 [in, size_is(numTokens)]\n                                 IXCLRDataModule* mods[],\n                                 [in] IXCLRDataModule* singleMod,\n                                 [in, size_is(numTokens)] mdMethodDef tokens[],\n                                 [out, size_is(numTokens)] ULONG32 flags[]);\n    HRESULT SetCodeNotifications([in] ULONG32 numTokens,\n                                 [in, size_is(numTokens)]\n                                 IXCLRDataModule* mods[],\n                                 [in] IXCLRDataModule* singleMod,\n                                 [in, size_is(numTokens)] mdMethodDef tokens[],\n                                 [in, size_is(numTokens)] ULONG32 flags[],\n                                 [in] ULONG32 singleFlags);\n\n    /*\n     * Control notifications other than code and\n     * type notifications.\n     */\n    HRESULT GetOtherNotificationFlags([out] ULONG32* flags);\n    HRESULT SetOtherNotificationFlags([in] ULONG32 flags);\n\n    /*\n     * Look up method definitions by IL code address.\n     */\n    HRESULT StartEnumMethodDefinitionsByAddress([in] CLRDATA_ADDRESS address,\n                                                [out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodDefinitionByAddress([in] CLRDATA_ENUM* handle,\n                                          [out] IXCLRDataMethodDefinition** method);\n    HRESULT EndEnumMethodDefinitionsByAddress([in] CLRDATA_ENUM handle);\n\n    /*\n     * Given an address which is a CLR stub\n     * (and potentially state from a previous follow)\n     * determine the next execution address at which\n     * to check whether the stub has been exited.\n     * OBSOLETE: Use FollowStub2.\n     */\n    HRESULT FollowStub([in] ULONG32 inFlags,\n                       [in] CLRDATA_ADDRESS inAddr,\n                       [in] CLRDATA_FOLLOW_STUB_BUFFER* inBuffer,\n                       [out] CLRDATA_ADDRESS* outAddr,\n                       [out] CLRDATA_FOLLOW_STUB_BUFFER* outBuffer,\n                       [out] ULONG32* outFlags);\n\n    /* Requires revision 7. */\n    HRESULT FollowStub2([in] IXCLRDataTask* task,\n                        [in] ULONG32 inFlags,\n                        [in] CLRDATA_ADDRESS inAddr,\n                        [in] CLRDATA_FOLLOW_STUB_BUFFER* inBuffer,\n                        [out] CLRDATA_ADDRESS* outAddr,\n                        [out] CLRDATA_FOLLOW_STUB_BUFFER* outBuffer,\n                        [out] ULONG32* outFlags);\n    HRESULT DumpNativeImage([in] CLRDATA_ADDRESS loadedBase,\n                            [in] LPCWSTR name,\n                            [in] IXCLRDataDisplay* display,\n                            [in] IXCLRLibrarySupport* libSupport,\n                            [in] IXCLRDisassemblySupport* dis);\n}\n#pragma warning(pop)\n\n/*\n * Types used in IXCLRDataProcess2 and IXCLRDataExceptionNotification3\n */\n\ntypedef enum\n{\n    GC_MARK_END = 1,\n    GC_EVENT_TYPE_MAX,\n} GcEvt_t;\n\ntypedef struct\n{\n    GcEvt_t typ;\n\n    [switch_is(typ)]\n    union\n    {\n    \t[case(GC_MARK_END)]\n        int condemnedGeneration;\n    };\n} GcEvtArgs;\n\n\n[\n    object,\n    local,\n    uuid(5c552ab6-fc09-4cb3-8e36-22fa03c798b8)\n]\ninterface IXCLRDataProcess2 : IXCLRDataProcess\n{\n    /*\n     * Request notification when a GC is triggered.\n     * GcEvtArgs specifies exactly which GC events\n     * are of interest.\n     */\n    /*\n     * On entry gcEvtArgs is a mask, specifying all events of\n     * interest, in accordance with GcNotification::IsMatch\n     * On exit it represents the first entry matching the input.\n     */\n\tHRESULT GetGcNotification([in, out] GcEvtArgs* gcEvtArgs);\n\tHRESULT SetGcNotification([in] GcEvtArgs gcEvtArgs);\n}\n\ntypedef enum\n{\n    CLRDATA_DOMAIN_DEFAULT = 0x00000000,\n} CLRDataAppDomainFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataAppDomain */\n[\n    object,\n    local,\n    uuid(7CA04601-C702-4670-A63C-FA44F7DA7BD5)\n]\ninterface IXCLRDataAppDomain : IUnknown\n{\n    /*\n     * Get the process that contains this app domain.\n     */\n    HRESULT GetProcess([out] IXCLRDataProcess** process);\n\n    /*\n     * Get the app domain's name.\n     */\n    HRESULT GetName([in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get a unique, stable identifier for this object.\n     */\n    HRESULT GetUniqueID([out] ULONG64* id);\n\n    /*\n     * Get state flags, defined in CLRDataAppDomainFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataAppDomain* appDomain);\n\n    /*\n     * Get the managed object representing the app domain.\n     */\n    HRESULT GetManagedObject([out] IXCLRDataValue** value);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n}\n#pragma warning(pop)\n\ntypedef enum\n{\n    CLRDATA_ASSEMBLY_DEFAULT = 0x00000000,\n} CLRDataAssemblyFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n[\n    object,\n    local,\n    uuid(2FA17588-43C2-46ab-9B51-C8F01E39C9AC)\n]\ninterface IXCLRDataAssembly : IUnknown\n{\n    /*\n     * Enumerate modules in the assembly.\n     */\n    HRESULT StartEnumModules([out] CLRDATA_ENUM* handle);\n    HRESULT EnumModule([in, out] CLRDATA_ENUM* handle,\n                       [out] IXCLRDataModule **mod);\n    HRESULT EndEnumModules([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the assembly's base name.\n     */\n    HRESULT GetName([in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get the full path and filename for the assembly,\n     * if there is one.\n     */\n    HRESULT GetFileName([in] ULONG32 bufLen,\n                        [out] ULONG32 *nameLen,\n                        [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get state flags, defined in CLRDataAssemblyFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataAssembly* assembly);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Enumerate the app domains using this assembly.\n     */\n    HRESULT StartEnumAppDomains([out] CLRDATA_ENUM* handle);\n    HRESULT EnumAppDomain([in, out] CLRDATA_ENUM* handle,\n                          [out] IXCLRDataAppDomain** appDomain);\n    HRESULT EndEnumAppDomains([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the metadata display name for the assembly.\n     * Requires revision 2.\n     */\n    HRESULT GetDisplayName([in] ULONG32 bufLen,\n                           [out] ULONG32 *nameLen,\n                           [out, size_is(bufLen)] WCHAR name[]);\n}\n#pragma warning(pop)\n\ntypedef enum\n{\n    CLRDATA_MODULE_DEFAULT          = 0x00000000,\n    CLRDATA_MODULE_IS_DYNAMIC       = 0x00000001,\n    CLRDATA_MODULE_IS_MEMORY_STREAM = 0x00000002,\n    CLRDATA_MODULE_IS_MAIN_MODULE   = 0x00000004,\n} CLRDataModuleFlag;\n\ntypedef enum\n{\n    CLRDATA_MODULE_PE_FILE,\n    CLRDATA_MODULE_PREJIT_FILE,\n    CLRDATA_MODULE_MEMORY_STREAM,\n    CLRDATA_MODULE_OTHER\n} CLRDataModuleExtentType;\n\ntypedef struct\n{\n    CLRDATA_ADDRESS base;\n    ULONG32 length;\n    CLRDataModuleExtentType type;\n} CLRDATA_MODULE_EXTENT;\n\ntypedef enum\n{\n    CLRDATA_TYPENOTIFY_NONE     = 0x00000000,\n    CLRDATA_TYPENOTIFY_LOADED   = 0x00000001,\n    CLRDATA_TYPENOTIFY_UNLOADED = 0x00000002,\n} CLRDataTypeNotification;\n\ntypedef enum\n{\n    CLRDATA_METHNOTIFY_NONE      = 0x00000000,\n    CLRDATA_METHNOTIFY_GENERATED = 0x00000001,\n    CLRDATA_METHNOTIFY_DISCARDED = 0x00000002,\n} CLRDataMethodCodeNotification;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n/*\n * Represents a loaded module.\n *\n * Can be QI'd for a metadata interface or a symbol-store interface.\n */\n[\n    object,\n    local,\n    uuid(88E32849-0A0A-4cb0-9022-7CD2E9E139E2)\n]\ninterface IXCLRDataModule : IUnknown\n{\n    /*\n     * Enumerate assemblies this module is part of.\n     * Module-to-assembly is an enumeration as a\n     * shared module might be part of more than one assembly.\n     */\n    HRESULT StartEnumAssemblies([out] CLRDATA_ENUM* handle);\n    HRESULT EnumAssembly([in, out] CLRDATA_ENUM* handle,\n                         [out] IXCLRDataAssembly **assembly);\n    HRESULT EndEnumAssemblies([in] CLRDATA_ENUM handle);\n\n    /*\n     * Enumerate types in this module.\n     */\n    HRESULT StartEnumTypeDefinitions([out] CLRDATA_ENUM* handle);\n    HRESULT EnumTypeDefinition([in, out] CLRDATA_ENUM* handle,\n                               [out] IXCLRDataTypeDefinition **typeDefinition);\n    HRESULT EndEnumTypeDefinitions([in] CLRDATA_ENUM handle);\n\n    HRESULT StartEnumTypeInstances([in] IXCLRDataAppDomain* appDomain,\n                                   [out] CLRDATA_ENUM* handle);\n    HRESULT EnumTypeInstance([in, out] CLRDATA_ENUM* handle,\n                             [out] IXCLRDataTypeInstance **typeInstance);\n    HRESULT EndEnumTypeInstances([in] CLRDATA_ENUM handle);\n\n    /*\n     * Look up types by name.\n     */\n    HRESULT StartEnumTypeDefinitionsByName([in] LPCWSTR name,\n                                           [in] ULONG32 flags,\n                                           [out] CLRDATA_ENUM* handle);\n    HRESULT EnumTypeDefinitionByName([in,out] CLRDATA_ENUM* handle,\n                                     [out] IXCLRDataTypeDefinition** type);\n    HRESULT EndEnumTypeDefinitionsByName([in] CLRDATA_ENUM handle);\n\n    HRESULT StartEnumTypeInstancesByName([in] LPCWSTR name,\n                                         [in] ULONG32 flags,\n                                         [in] IXCLRDataAppDomain* appDomain,\n                                         [out] CLRDATA_ENUM* handle);\n    HRESULT EnumTypeInstanceByName([in,out] CLRDATA_ENUM* handle,\n                                   [out] IXCLRDataTypeInstance** type);\n    HRESULT EndEnumTypeInstancesByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get a type definition by metadata token.\n     */\n    HRESULT GetTypeDefinitionByToken([in] mdTypeDef token,\n                                     [out] IXCLRDataTypeDefinition** typeDefinition);\n\n    /*\n     * Look up methods by name.\n     */\n    HRESULT StartEnumMethodDefinitionsByName([in] LPCWSTR name,\n                                             [in] ULONG32 flags,\n                                             [out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodDefinitionByName([in,out] CLRDATA_ENUM* handle,\n                                       [out] IXCLRDataMethodDefinition** method);\n    HRESULT EndEnumMethodDefinitionsByName([in] CLRDATA_ENUM handle);\n\n    HRESULT StartEnumMethodInstancesByName([in] LPCWSTR name,\n                                           [in] ULONG32 flags,\n                                           [in] IXCLRDataAppDomain* appDomain,\n                                           [out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodInstanceByName([in,out] CLRDATA_ENUM* handle,\n                                     [out] IXCLRDataMethodInstance** method);\n    HRESULT EndEnumMethodInstancesByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get a method definition by metadata token.\n     */\n    HRESULT GetMethodDefinitionByToken([in] mdMethodDef token,\n                                       [out] IXCLRDataMethodDefinition** methodDefinition);\n\n    /*\n     * Look up pieces of data by name.\n     */\n    HRESULT StartEnumDataByName([in] LPCWSTR name,\n                                [in] ULONG32 flags,\n                                [in] IXCLRDataAppDomain* appDomain,\n                                [in] IXCLRDataTask* tlsTask,\n                                [out] CLRDATA_ENUM* handle);\n    HRESULT EnumDataByName([in,out] CLRDATA_ENUM* handle,\n                           [out] IXCLRDataValue** value);\n    HRESULT EndEnumDataByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the module's base name.\n     */\n    HRESULT GetName([in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get the full path and filename for the module,\n     * if there is one.\n     */\n    HRESULT GetFileName([in] ULONG32 bufLen,\n                        [out] ULONG32 *nameLen,\n                        [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get state flags, defined in CLRDataModuleFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataModule* mod);\n\n    /*\n     * Get the memory regions associated with this module.\n     */\n    HRESULT StartEnumExtents([out] CLRDATA_ENUM* handle);\n    HRESULT EnumExtent([in, out] CLRDATA_ENUM* handle,\n                       [out] CLRDATA_MODULE_EXTENT* extent);\n    HRESULT EndEnumExtents([in] CLRDATA_ENUM handle);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Enumerate the app domains using this module.\n     */\n    HRESULT StartEnumAppDomains([out] CLRDATA_ENUM* handle);\n    HRESULT EnumAppDomain([in, out] CLRDATA_ENUM* handle,\n                          [out] IXCLRDataAppDomain** appDomain);\n    HRESULT EndEnumAppDomains([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the module's version ID.\n     * Requires revision 3.\n     */\n    HRESULT GetVersionId([out] GUID* vid);\n}\n#pragma warning(pop)\n\n\n/*\n * Represents additional APIs for a loaded module.\n *\n */\n[\n    object,\n    local,\n    uuid(34625881-7EB3-4524-817B-8DB9D064C760)\n]\ninterface IXCLRDataModule2 : IUnknown\n{\n  /*\n   * SetJITCompilerFlags sets the flags that control the JIT compiler. If the set of flags is invalid,\n   * the function will fail. This function can only be called from within the LoadModule callback\n   * for the given module.\n   */\n    HRESULT SetJITCompilerFlags( [in] DWORD dwFlags );\n}\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataTypeDefinition */\n[\n    object,\n    local,\n    uuid(4675666C-C275-45b8-9F6C-AB165D5C1E09)\n]\ninterface IXCLRDataTypeDefinition : IUnknown\n{\n    /*\n     * Get the module this type is part of.\n     */\n    HRESULT GetModule([out] IXCLRDataModule **mod);\n\n    /*\n     * Enumerate the methods for this type.\n     */\n    HRESULT StartEnumMethodDefinitions([out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodDefinition([in, out] CLRDATA_ENUM* handle,\n                                 [out] IXCLRDataMethodDefinition **methodDefinition);\n    HRESULT EndEnumMethodDefinitions([in] CLRDATA_ENUM handle);\n\n    /*\n     * Look up methods by name.\n     */\n    HRESULT StartEnumMethodDefinitionsByName([in] LPCWSTR name,\n                                             [in] ULONG32 flags,\n                                             [out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodDefinitionByName([in,out] CLRDATA_ENUM* handle,\n                                       [out] IXCLRDataMethodDefinition** method);\n    HRESULT EndEnumMethodDefinitionsByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get a method definition by metadata token.\n     */\n    HRESULT GetMethodDefinitionByToken([in] mdMethodDef token,\n                                       [out] IXCLRDataMethodDefinition** methodDefinition);\n\n    /*\n     * Enumerate instances of this definition.\n     */\n    HRESULT StartEnumInstances([in] IXCLRDataAppDomain* appDomain,\n                               [out] CLRDATA_ENUM* handle);\n    HRESULT EnumInstance([in, out] CLRDATA_ENUM* handle,\n                         [out] IXCLRDataTypeInstance **instance);\n    HRESULT EndEnumInstances([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the namespace-qualified name for this type definition.\n     */\n    HRESULT GetName([in] ULONG32 flags,\n                    [in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR nameBuf[]);\n\n    /*\n     * Get the metadata token and scope.\n     */\n    HRESULT GetTokenAndScope([out] mdTypeDef* token,\n                             [out] IXCLRDataModule **mod);\n\n    /*\n     * Get standard element type.\n     */\n    HRESULT GetCorElementType([out] CorElementType* type);\n\n    /*\n     * Get state flags, defined in CLRDataTypeFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataTypeDefinition* type);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * If this is an array type, return the number\n     * of dimensions in the array.\n     */\n    HRESULT GetArrayRank([out] ULONG32* rank);\n\n    /*\n     * Get the base type of this type, if any.\n     */\n    HRESULT GetBase([out] IXCLRDataTypeDefinition** base);\n\n    /*\n     * Get the number of fields in the type.\n     */\n    HRESULT GetNumFields([in] ULONG32 flags,\n                         [out] ULONG32* numFields);\n\n    /*\n     * Enumerate the fields for this type.\n     * OBSOLETE: Use EnumField2.\n     */\n    HRESULT StartEnumFields([in] ULONG32 flags,\n                            [out] CLRDATA_ENUM* handle);\n    HRESULT EnumField([in, out] CLRDATA_ENUM* handle,\n                      [in] ULONG32 nameBufLen,\n                      [out] ULONG32* nameLen,\n                      [out, size_is(nameBufLen)] WCHAR nameBuf[],\n                      [out] IXCLRDataTypeDefinition** type,\n                      [out] ULONG32* flags,\n                      [out] mdFieldDef* token);\n    HRESULT EndEnumFields([in] CLRDATA_ENUM handle);\n\n    HRESULT StartEnumFieldsByName([in] LPCWSTR name,\n                                  [in] ULONG32 nameFlags,\n                                  [in] ULONG32 fieldFlags,\n                                  [out] CLRDATA_ENUM* handle);\n    HRESULT EnumFieldByName([in, out] CLRDATA_ENUM* handle,\n                            [out] IXCLRDataTypeDefinition** type,\n                            [out] ULONG32* flags,\n                            [out] mdFieldDef* token);\n    HRESULT EndEnumFieldsByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Look up information for a specific field by token.\n     */\n    HRESULT GetFieldByToken([in] mdFieldDef token,\n                            [in] ULONG32 nameBufLen,\n                            [out] ULONG32* nameLen,\n                            [out, size_is(nameBufLen)] WCHAR nameBuf[],\n                            [out] IXCLRDataTypeDefinition** type,\n                            [out] ULONG32* flags);\n\n    /*\n     * Request notification when the given type is\n     * loaded or unloaded.\n     */\n    HRESULT GetTypeNotification([out] ULONG32* flags);\n    HRESULT SetTypeNotification([in] ULONG32 flags);\n\n    HRESULT EnumField2([in, out] CLRDATA_ENUM* handle,\n                       [in] ULONG32 nameBufLen,\n                       [out] ULONG32* nameLen,\n                       [out, size_is(nameBufLen)] WCHAR nameBuf[],\n                       [out] IXCLRDataTypeDefinition** type,\n                       [out] ULONG32* flags,\n                       [out] IXCLRDataModule** tokenScope,\n                       [out] mdFieldDef* token);\n    HRESULT EnumFieldByName2([in, out] CLRDATA_ENUM* handle,\n                             [out] IXCLRDataTypeDefinition** type,\n                             [out] ULONG32* flags,\n                             [out] IXCLRDataModule** tokenScope,\n                             [out] mdFieldDef* token);\n    HRESULT GetFieldByToken2([in] IXCLRDataModule* tokenScope,\n                             [in] mdFieldDef token,\n                             [in] ULONG32 nameBufLen,\n                             [out] ULONG32* nameLen,\n                             [out, size_is(nameBufLen)] WCHAR nameBuf[],\n                             [out] IXCLRDataTypeDefinition** type,\n                             [out] ULONG32* flags);\n}\n#pragma warning(pop)\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n[\n    object,\n    local,\n    uuid(4D078D91-9CB3-4b0d-97AC-28C8A5A82597)\n]\ninterface IXCLRDataTypeInstance : IUnknown\n{\n    /*\n     * Enumerate method instances within this type.\n     */\n    HRESULT StartEnumMethodInstances([out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodInstance([in, out] CLRDATA_ENUM* handle,\n                               [out] IXCLRDataMethodInstance** methodInstance);\n    HRESULT EndEnumMethodInstances([in] CLRDATA_ENUM handle);\n\n    /*\n     * Look up method instances by name.\n     */\n    HRESULT StartEnumMethodInstancesByName([in] LPCWSTR name,\n                                           [in] ULONG32 flags,\n                                           [out] CLRDATA_ENUM* handle);\n    HRESULT EnumMethodInstanceByName([in,out] CLRDATA_ENUM* handle,\n                                     [out] IXCLRDataMethodInstance** method);\n    HRESULT EndEnumMethodInstancesByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the number of static fields in the type.\n     * OBSOLETE: Use GetNumStaticFields2.\n     */\n    HRESULT GetNumStaticFields([out] ULONG32* numFields);\n\n    /*\n     * Get one static field of the type.\n     *\n     * Because static field ordering is not fixed, can also return name\n     * information and/or the metadata token, if the caller passes\n     * in appropriate values.\n     * OBSOLETE: Use EnumStaticField.\n     */\n    HRESULT GetStaticFieldByIndex([in] ULONG32 index,\n                                  [in] IXCLRDataTask* tlsTask,\n                                  [out] IXCLRDataValue **field,\n                                  [in] ULONG32 bufLen,\n                                  [out] ULONG32 *nameLen,\n                                  [out, size_is(bufLen)] WCHAR nameBuf[],\n                                  [out] mdFieldDef* token);\n\n    /*\n     * Look up fields by name.\n     * OBSOLETE: Use EnumStaticFieldByName2.\n     */\n    HRESULT StartEnumStaticFieldsByName([in] LPCWSTR name,\n                                        [in] ULONG32 flags,\n                                        [in] IXCLRDataTask* tlsTask,\n                                        [out] CLRDATA_ENUM* handle);\n    HRESULT EnumStaticFieldByName([in,out] CLRDATA_ENUM* handle,\n                                  [out] IXCLRDataValue** value);\n    HRESULT EndEnumStaticFieldsByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Enumerate this type's parameterization.\n     */\n    HRESULT GetNumTypeArguments([out] ULONG32* numTypeArgs);\n    HRESULT GetTypeArgumentByIndex([in] ULONG32 index,\n                                   [out] IXCLRDataTypeInstance** typeArg);\n\n    /*\n     * Get the fully qualified name for this type instance.\n     */\n    HRESULT GetName([in] ULONG32 flags,\n                    [in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR nameBuf[]);\n\n    /*\n     * Get the module for this type instance.\n     */\n    HRESULT GetModule([out] IXCLRDataModule **mod);\n\n    /*\n     * Get the definition matching this instance.\n     */\n    HRESULT GetDefinition([out] IXCLRDataTypeDefinition **typeDefinition);\n\n    /*\n     * Get state flags, defined in CLRDataTypeFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataTypeInstance* type);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Get the number of static fields in the type.\n     */\n    HRESULT GetNumStaticFields2([in] ULONG32 flags,\n                                [out] ULONG32* numFields);\n\n    /*\n     * Enumerate values for the static fields of this type.\n     */\n    HRESULT StartEnumStaticFields([in] ULONG32 flags,\n                                  [in] IXCLRDataTask* tlsTask,\n                                  [out] CLRDATA_ENUM* handle);\n    HRESULT EnumStaticField([in,out] CLRDATA_ENUM* handle,\n                            [out] IXCLRDataValue** value);\n    HRESULT EndEnumStaticFields([in] CLRDATA_ENUM handle);\n\n    HRESULT StartEnumStaticFieldsByName2([in] LPCWSTR name,\n                                         [in] ULONG32 nameFlags,\n                                         [in] ULONG32 fieldFlags,\n                                         [in] IXCLRDataTask* tlsTask,\n                                         [out] CLRDATA_ENUM* handle);\n    HRESULT EnumStaticFieldByName2([in,out] CLRDATA_ENUM* handle,\n                                   [out] IXCLRDataValue** value);\n    HRESULT EndEnumStaticFieldsByName2([in] CLRDATA_ENUM handle);\n\n    /*\n     * Retrieve a static field by field metadata token.\n     */\n    HRESULT GetStaticFieldByToken([in] mdFieldDef token,\n                                  [in] IXCLRDataTask* tlsTask,\n                                  [out] IXCLRDataValue **field,\n                                  [in] ULONG32 bufLen,\n                                  [out] ULONG32 *nameLen,\n                                  [out, size_is(bufLen)] WCHAR nameBuf[]);\n\n    /*\n     * Get the base type of this type, if any.\n     */\n    HRESULT GetBase([out] IXCLRDataTypeInstance** base);\n\n    HRESULT EnumStaticField2([in,out] CLRDATA_ENUM* handle,\n                             [out] IXCLRDataValue** value,\n                             [in] ULONG32 bufLen,\n                             [out] ULONG32 *nameLen,\n                             [out, size_is(bufLen)] WCHAR nameBuf[],\n                             [out] IXCLRDataModule** tokenScope,\n                             [out] mdFieldDef* token);\n    HRESULT EnumStaticFieldByName3([in,out] CLRDATA_ENUM* handle,\n                                   [out] IXCLRDataValue** value,\n                                   [out] IXCLRDataModule** tokenScope,\n                                   [out] mdFieldDef* token);\n    HRESULT GetStaticFieldByToken2([in] IXCLRDataModule* tokenScope,\n                                   [in] mdFieldDef token,\n                                   [in] IXCLRDataTask* tlsTask,\n                                   [out] IXCLRDataValue **field,\n                                   [in] ULONG32 bufLen,\n                                   [out] ULONG32 *nameLen,\n                                   [out, size_is(bufLen)] WCHAR nameBuf[]);\n}\n#pragma warning(pop)\n\ntypedef enum\n{\n    CLRDATA_SOURCE_TYPE_INVALID        = 0x00, // To indicate that nothing else applies\n} CLRDataSourceType;\n\n/*\n * Special IL offset values for special regions.\n */\ntypedef enum\n{\n    CLRDATA_IL_OFFSET_NO_MAPPING = -1,\n    CLRDATA_IL_OFFSET_PROLOG     = -2,\n    CLRDATA_IL_OFFSET_EPILOG     = -3\n} CLRDATA_IL_OFFSET_MARKER;\n\ntypedef struct\n{\n    ULONG32 ilOffset;\n    CLRDATA_ADDRESS startAddress;\n    CLRDATA_ADDRESS endAddress;\n    CLRDataSourceType type;\n} CLRDATA_IL_ADDRESS_MAP;\n\ntypedef enum\n{\n    CLRDATA_METHOD_DEFAULT  = 0x00000000,\n\n    // Method has a 'this' pointer.\n    CLRDATA_METHOD_HAS_THIS = 0x00000001,\n} CLRDataMethodFlag;\n\ntypedef enum\n{\n    CLRDATA_METHDEF_IL\n} CLRDataMethodDefinitionExtentType;\n\ntypedef struct\n{\n    CLRDATA_ADDRESS startAddress;\n    CLRDATA_ADDRESS endAddress;\n    ULONG32 enCVersion;\n    CLRDataMethodDefinitionExtentType type;\n} CLRDATA_METHDEF_EXTENT;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataMethodDefinition */\n[\n    object,\n    local,\n    uuid(AAF60008-FB2C-420b-8FB1-42D244A54A97)\n]\ninterface IXCLRDataMethodDefinition : IUnknown\n{\n    /*\n     * Get the type this method is part of.\n     */\n    HRESULT GetTypeDefinition([out] IXCLRDataTypeDefinition **typeDefinition);\n\n    /*\n     * Enumerate instances of this definition.\n     */\n    HRESULT StartEnumInstances([in] IXCLRDataAppDomain* appDomain,\n                               [out] CLRDATA_ENUM* handle);\n    HRESULT EnumInstance([in, out] CLRDATA_ENUM* handle,\n                         [out] IXCLRDataMethodInstance **instance);\n    HRESULT EndEnumInstances([in] CLRDATA_ENUM handle);\n\n    /*\n     * Get the method's name.\n     */\n    HRESULT GetName([in] ULONG32 flags,\n                    [in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get the metadata token and scope.\n     */\n    HRESULT GetTokenAndScope([out] mdMethodDef* token,\n                             [out] IXCLRDataModule **mod);\n\n    /*\n     * Get state flags, defined in CLRDataMethodFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataMethodDefinition* method);\n\n    /*\n     * Get the latest EnC version of this method.\n     */\n    HRESULT GetLatestEnCVersion([out] ULONG32* version);\n\n    /*\n     * Get the IL code regions associated with this method.\n     */\n    HRESULT StartEnumExtents([out] CLRDATA_ENUM* handle);\n    HRESULT EnumExtent([in, out] CLRDATA_ENUM* handle,\n                       [out] CLRDATA_METHDEF_EXTENT* extent);\n    HRESULT EndEnumExtents([in] CLRDATA_ENUM handle);\n\n    /*\n     * Request notification when code is generated or\n     * discarded for the method.\n     */\n    HRESULT GetCodeNotification([out] ULONG32* flags);\n    HRESULT SetCodeNotification([in] ULONG32 flags);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Gets the most representative start address of\n     * the native code for this method.\n     * A method may have multiple entry points, so this\n     * address is not guaranteed to be hit by all entries.\n     * Requires revision 1.\n     */\n    HRESULT GetRepresentativeEntryAddress([out] CLRDATA_ADDRESS* addr);\n\n    HRESULT HasClassOrMethodInstantiation([out] BOOL* bGeneric);\n}\n#pragma warning(pop)\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataMethodInstance */\n[\n    object,\n    local,\n    uuid(ECD73800-22CA-4b0d-AB55-E9BA7E6318A5)\n]\ninterface IXCLRDataMethodInstance : IUnknown\n{\n    /*\n     * Get the type instance for this method.\n     */\n    HRESULT GetTypeInstance([out] IXCLRDataTypeInstance **typeInstance);\n\n    /*\n     * Get the definition that matches this instance.\n     */\n    HRESULT GetDefinition([out] IXCLRDataMethodDefinition **methodDefinition);\n\n    /*\n     * Get the metadata token and scope.\n     */\n    HRESULT GetTokenAndScope([out] mdMethodDef* token,\n                             [out] IXCLRDataModule **mod);\n\n    /*\n     * Get the fully qualified name for this method instance.\n     */\n    HRESULT GetName([in] ULONG32 flags,\n                    [in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR nameBuf[]);\n\n    /*\n     * Get state flags, defined in CLRDataMethodFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataMethodInstance* method);\n\n    /*\n     * Get the EnC version of this instance.\n     */\n    HRESULT GetEnCVersion([out] ULONG32* version);\n\n    /*\n     * Enumerate this method's parameterization.\n     */\n    HRESULT GetNumTypeArguments([out] ULONG32* numTypeArgs);\n    HRESULT GetTypeArgumentByIndex([in] ULONG32 index,\n                                   [out] IXCLRDataTypeInstance** typeArg);\n\n    /*\n     * Access the IL <-> address mapping information.\n     */\n    HRESULT GetILOffsetsByAddress([in] CLRDATA_ADDRESS address,\n                                  [in] ULONG32 offsetsLen,\n                                  [out] ULONG32 *offsetsNeeded,\n                                  [out, size_is(offsetsLen)]\n                                  ULONG32 ilOffsets[]);\n    HRESULT GetAddressRangesByILOffset([in] ULONG32 ilOffset,\n                                       [in] ULONG32 rangesLen,\n                                       [out] ULONG32 *rangesNeeded,\n                                       [out, size_is(rangesLen)]\n                                       CLRDATA_ADDRESS_RANGE addressRanges[]);\n    HRESULT GetILAddressMap([in] ULONG32 mapLen,\n                            [out] ULONG32 *mapNeeded,\n                            [out, size_is(mapLen)]\n                            CLRDATA_IL_ADDRESS_MAP maps[]);\n\n    /*\n     * Get the native code regions associated with this method.\n     */\n    HRESULT StartEnumExtents([out] CLRDATA_ENUM* handle);\n    HRESULT EnumExtent([in, out] CLRDATA_ENUM* handle,\n                       [out] CLRDATA_ADDRESS_RANGE* extent);\n    HRESULT EndEnumExtents([in] CLRDATA_ENUM handle);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Gets the most representative start address of\n     * the native code for this method.\n     * A method may have multiple entry points, so this\n     * address is not guaranteed to be hit by all entries.\n     * Requires revision 1.\n     */\n    HRESULT GetRepresentativeEntryAddress([out] CLRDATA_ADDRESS* addr);\n}\n#pragma warning(pop)\n\ntypedef enum\n{\n    CLRDATA_TASK_DEFAULT        = 0x00000000,\n    CLRDATA_TASK_WAITING_FOR_GC = 0x00000001,\n} CLRDataTaskFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataMethodInstance */\n/*\n * Interface representing a task (thread or fiber) in the process.\n */\n[\n    object,\n    local,\n    uuid(A5B0BEEA-EC62-4618-8012-A24FFC23934C)\n]\ninterface IXCLRDataTask : IUnknown\n{\n    /*\n     * Get the process for this task.\n     */\n    HRESULT GetProcess([out] IXCLRDataProcess** process);\n\n    /*\n     * Get the application domain that the task is\n     * currently running in.  This can change over time.\n     */\n    HRESULT GetCurrentAppDomain([out] IXCLRDataAppDomain **appDomain);\n\n    /*\n     * Get a unique, stable identifier for this task.\n     */\n    HRESULT GetUniqueID([out] ULONG64* id);\n\n    /*\n     * Get state flags, defined in CLRDataTaskFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Determine whether the given interface represents\n     * the same target state.\n     */\n    HRESULT IsSameObject([in] IXCLRDataTask* task);\n\n    /*\n     * Get the managed object representing the task.\n     */\n    HRESULT GetManagedObject([out] IXCLRDataValue** value);\n\n    /*\n     * Mark the task so that it attempts to reach the\n     * given execution state the next time it executes.\n     */\n    HRESULT GetDesiredExecutionState([out] ULONG32* state);\n    HRESULT SetDesiredExecutionState([in] ULONG32 state);\n\n    /*\n     * Create a stack walker to walk this task's stack. The\n     * flags parameter takes a bitfield of values from the\n     * CLRDataSimpleFrameType enum.\n     */\n    HRESULT CreateStackWalk([in] ULONG32 flags,\n                            [out] IXCLRDataStackWalk** stackWalk);\n\n    /*\n     * Get the current OS thread ID for this task. If this task is on a fiber,\n     * the ID may change over time.\n     */\n    HRESULT GetOSThreadID([out] ULONG32* id);\n\n    /*\n     * Get the current context for this task, controlled by the given flags.\n     * Returns S_FALSE if the size is not large enough.\n     */\n    HRESULT GetContext([in] ULONG32 contextFlags,\n                       [in] ULONG32 contextBufSize,\n                       [out] ULONG32* contextSize,\n                       [out, size_is(contextBufSize)] BYTE contextBuf[]);\n\n    /*\n     * Destructively set the current context for this task.\n     */\n    HRESULT SetContext([in] ULONG32 contextSize,\n                       [in, size_is(contextSize)] BYTE context[]);\n\n    /*\n     * Get the current exception state for the\n     * task, if any.  This may be the first element\n     * in a list of exception states if there are\n     * nested exceptions.\n     */\n    HRESULT GetCurrentExceptionState([out] IXCLRDataExceptionState **exception);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Get the task's name if it has one.\n     * Requires revision 1.\n     */\n    HRESULT GetName([in] ULONG32 bufLen,\n                    [out] ULONG32 *nameLen,\n                    [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get the last exception state for the\n     * task, if any.  If an exception is currently\n     * being processed the last exception state may\n     * be the same as the current exception state.\n     * Requires revision 2.\n     */\n    HRESULT GetLastExceptionState([out] IXCLRDataExceptionState **exception);\n}\n#pragma warning(pop)\n\ntypedef enum\n{\n    /* Frame not recognized */\n    CLRDATA_SIMPFRAME_UNRECOGNIZED = 0x1,\n\n    /* Frame corresponds to a managed method */\n    CLRDATA_SIMPFRAME_MANAGED_METHOD = 0x2,\n\n    /* Frame corresponds to runtime-controlled managed code */\n    CLRDATA_SIMPFRAME_RUNTIME_MANAGED_CODE = 0x4,\n\n    /* Frame corresponds to runtime-controlled unmanaged code */\n    CLRDATA_SIMPFRAME_RUNTIME_UNMANAGED_CODE = 0x8\n} CLRDataSimpleFrameType;\n\ntypedef enum\n{\n    /* These are tentative values...they will likely change as\n     * implementation progresses. */\n    CLRDATA_DETFRAME_UNRECOGNIZED,\n    CLRDATA_DETFRAME_UNKNOWN_STUB,\n    CLRDATA_DETFRAME_CLASS_INIT,\n    CLRDATA_DETFRAME_EXCEPTION_FILTER,\n    CLRDATA_DETFRAME_SECURITY,\n    CLRDATA_DETFRAME_CONTEXT_POLICY,\n    CLRDATA_DETFRAME_INTERCEPTION,\n    CLRDATA_DETFRAME_PROCESS_START,\n    CLRDATA_DETFRAME_THREAD_START,\n    CLRDATA_DETFRAME_TRANSITION_TO_MANAGED,\n    CLRDATA_DETFRAME_TRANSITION_TO_UNMANAGED,\n    CLRDATA_DETFRAME_COM_INTEROP_STUB,\n    CLRDATA_DETFRAME_DEBUGGER_EVAL,\n    CLRDATA_DETFRAME_CONTEXT_SWITCH,\n    CLRDATA_DETFRAME_FUNC_EVAL,\n    CLRDATA_DETFRAME_FINALLY\n    /* There will be others */\n} CLRDataDetailedFrameType;\n\n/*\n * StackWalk requests.\n */\n\ntypedef enum\n{\n    CLRDATA_STACK_WALK_REQUEST_SET_FIRST_FRAME = 0xe1000000,\n} CLRDataStackWalkRequest;\n\n/*\n * SetContext flags.\n */\n\ntypedef enum\n{\n    /* Context being set is the result of stack unwinding. */\n    CLRDATA_STACK_SET_UNWIND_CONTEXT  = 0x00000000,\n    /* Context being set is the \"current\" context. */\n    CLRDATA_STACK_SET_CURRENT_CONTEXT = 0x00000001,\n} CLRDataStackSetContextFlag;\n\n/*\n * Stack-walker interface.\n */\n[\n    object,\n    local,\n    uuid(E59D8D22-ADA7-49a2-89B5-A415AFCFC95F)\n]\ninterface IXCLRDataStackWalk : IUnknown\n{\n    /*\n     * Get the current context of this stack walk.\n     * This is the original context with any unwinding\n     * applied to it.  As unwinding may only restore\n     * a subset of the registers, such as only non-volatile\n     * registers, the context may not exactly match the\n     * register state at the time of the actual call.\n     */\n    HRESULT GetContext([in] ULONG32 contextFlags,\n                       [in] ULONG32 contextBufSize,\n                       [out] ULONG32* contextSize,\n                       [out, size_is(contextBufSize)] BYTE contextBuf[]);\n\n    /*\n     * Change the current context of this stack walk, allowing the\n     * debugger to move it to an arbitrary context. Does not actually\n     * alter the current context of the thread whose stack is being walked.\n     * OBSOLETE: Use SetContext2.\n     */\n    HRESULT SetContext([in] ULONG32 contextSize,\n                       [in, size_is(contextSize)] BYTE context[]);\n\n    /*\n     * Attempt to advance the stack walk to the next frame that\n     * matches the stack walk's filter. If the current frame type is\n     * CLRDATA_UNRECOGNIZED_FRAME, Next() will be unable to\n     * advance. (The debugger will have to walk the unrecognized frame\n     * itself, reset the walk's context, and try again.)\n     *\n     * Upon creation, the stack walk is positioned \"before\" the first\n     * frame on the stack.  Debuggers must call Next() to advance to\n     * the first frame before any other functions will work. The\n     * function will output S_FALSE when there are no more frames that\n     * meet its filter criteria.\n     */\n    HRESULT Next();\n\n    /*\n     * Return the number of bytes skipped by the last call to Next().\n     * If Next() moved to the very next frame, outputs 0.\n     *\n     * Note that calling GetStackSizeSkipped() after any function other\n     * than Next() has no meaning.\n     */\n    HRESULT GetStackSizeSkipped([out] ULONG64* stackSizeSkipped);\n\n    /*\n     * Return information about the type of the current frame\n     */\n    HRESULT GetFrameType([out] CLRDataSimpleFrameType* simpleType,\n                         [out] CLRDataDetailedFrameType* detailedType);\n\n    /*\n     * Return the current frame, if it is recognized.\n     */\n    HRESULT GetFrame([out] IXCLRDataFrame** frame);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Change the current context of this stack walk, allowing the\n     * debugger to move it to an arbitrary context. Does not actually\n     * alter the current context of the thread whose stack is being walked.\n     */\n    HRESULT SetContext2([in] ULONG32 flags,\n                        [in] ULONG32 contextSize,\n                        [in, size_is(contextSize)] BYTE context[]);\n}\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataFrame */\n[\n    object,\n    local,\n    uuid(271498C2-4085-4766-BC3A-7F8ED188A173)\n]\ninterface IXCLRDataFrame : IUnknown\n{\n    /*\n     * Return information about the type of this frame.\n     */\n    HRESULT GetFrameType([out] CLRDataSimpleFrameType* simpleType,\n                         [out] CLRDataDetailedFrameType* detailedType);\n\n    /*\n     * Get the stack walk context as of this frame.\n     * This is the original context with any unwinding\n     * applied to it.  As unwinding may only restore\n     * a subset of the registers, such as only non-volatile\n     * registers, the context may not exactly match the\n     * register state at the time of the actual call.\n     */\n    HRESULT GetContext([in] ULONG32 contextFlags,\n                       [in] ULONG32 contextBufSize,\n                       [out] ULONG32* contextSize,\n                       [out, size_is(contextBufSize)] BYTE contextBuf[]);\n\n    /*\n     * Return the app domain of this frame\n     */\n    HRESULT GetAppDomain([out] IXCLRDataAppDomain** appDomain);\n\n    /*\n     * Return the number of arguments on the stack.\n     */\n    HRESULT GetNumArguments([out] ULONG32* numArgs);\n\n    /*\n     * Return an argument by (0-based) index.\n     * The name parameter is filled in if name information is available.\n     */\n    HRESULT GetArgumentByIndex([in] ULONG32 index,\n                               [out] IXCLRDataValue** arg,\n                               [in] ULONG32 bufLen,\n                               [out] ULONG32 *nameLen,\n                               [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Return the number of local variables on the stack.\n     */\n    HRESULT GetNumLocalVariables([out] ULONG32* numLocals);\n\n    /*\n     * Return a local variable by (0-based) index.\n     * The name parameter is filled in if name information is available.\n     */\n    HRESULT GetLocalVariableByIndex([in] ULONG32 index,\n                                    [out] IXCLRDataValue** localVariable,\n                                    [in] ULONG32 bufLen,\n                                    [out] ULONG32 *nameLen,\n                                    [out, size_is(bufLen)] WCHAR name[]);\n\n    /*\n     * Get a name for the frame's current instruction pointer.\n     * This is either a method's name or a runtime code name.\n     *\n     * Returns S_FALSE if the buffer is not large enough for the name,\n     * and sets nameLen to be the buffer length needed.\n     */\n    HRESULT GetCodeName([in] ULONG32 flags,\n                        [in] ULONG32 bufLen,\n                        [out] ULONG32 *nameLen,\n                        [out, size_is(bufLen)] WCHAR nameBuf[]);\n\n    /*\n     * Gets the method instance corresponding to this frame.\n     */\n    HRESULT GetMethodInstance([out] IXCLRDataMethodInstance** method);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Enumerate the full parameterization of the frame's\n     * type and method.\n     */\n    HRESULT GetNumTypeArguments([out] ULONG32* numTypeArgs);\n    HRESULT GetTypeArgumentByIndex([in] ULONG32 index,\n                                   [out] IXCLRDataTypeInstance** typeArg);\n}\n#pragma warning(pop)\n\n[\n    object,\n    local,\n    uuid(1C4D9A4B-702D-4CF6-B290-1DB6F43050D0)\n]\ninterface IXCLRDataFrame2 : IUnknown\n{\n    /*\n     * Retun generic token if available.\n     */\n    HRESULT GetExactGenericArgsToken([out] IXCLRDataValue** genericToken);\n}\n\ntypedef enum\n{\n    CLRDATA_EXCEPTION_DEFAULT = 0x00000000,\n\n    // Exception is occurring during processing\n    // of other exception states.\n    CLRDATA_EXCEPTION_NESTED  = 0x00000001,\n\n    // Exception state is not completely available.\n    // This can happen when the state is no longer\n    // active or before a state is fully initialized.\n    CLRDATA_EXCEPTION_PARTIAL = 0x00000002,\n} CLRDataExceptionStateFlag;\n\ntypedef enum\n{\n    CLRDATA_EXBASE_EXCEPTION,\n    CLRDATA_EXBASE_OUT_OF_MEMORY,\n    CLRDATA_EXBASE_INVALID_ARGUMENT,\n} CLRDataBaseExceptionType;\n\ntypedef enum\n{\n    CLRDATA_EXSAME_SECOND_CHANCE = 0x00000000,\n    CLRDATA_EXSAME_FIRST_CHANCE  = 0x00000001,\n} CLRDataExceptionSameFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataExceptionState */\n[\n    object,\n    local,\n    uuid(75DA9E4C-BD33-43C8-8F5C-96E8A5241F57)\n]\ninterface IXCLRDataExceptionState : IUnknown\n{\n    /*\n     * Get state flags, defined in CLRDataExceptionStateFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * For nested exceptions, get the exception that\n     * was being handled when this exception occurred.\n     */\n    HRESULT GetPrevious([out] IXCLRDataExceptionState** exState);\n\n    /*\n     * Get the managed object representing the exception.\n     */\n    HRESULT GetManagedObject([out] IXCLRDataValue** value);\n\n    /*\n     * Get the standard base type of the exception.\n     */\n    HRESULT GetBaseType([out] CLRDataBaseExceptionType* type);\n\n    /*\n     * Get exception information.\n     */\n    HRESULT GetCode([out] ULONG32* code);\n    HRESULT GetString([in] ULONG32 bufLen,\n                      [out] ULONG32 *strLen,\n                      [out, size_is(bufLen)] WCHAR str[]);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Determine whether the given interface represents\n     * the same exception state.\n     * OBSOLETE: Use IsSameState2.\n     * Requires revision 1.\n     */\n    HRESULT IsSameState([in] EXCEPTION_RECORD64* exRecord,\n                        [in] ULONG32 contextSize,\n                        [in, size_is(contextSize)] BYTE cxRecord[]);\n\n    /*\n     * Determine whether the given interface represents\n     * the same exception state.\n     * Requires revision 2.\n     */\n    HRESULT IsSameState2([in] ULONG32 flags,\n                         [in] EXCEPTION_RECORD64* exRecord,\n                         [in] ULONG32 contextSize,\n                         [in, size_is(contextSize)] BYTE cxRecord[]);\n\n    /*\n     * Gets the task this exception state is associated with.\n     * Requires revision 2.\n     */\n    HRESULT GetTask([out] IXCLRDataTask** task);\n}\n#pragma warning(pop)\n\ntypedef enum\n{\n    CLRDATA_VLOC_MEMORY   = 0x00000000,\n    CLRDATA_VLOC_REGISTER = 0x00000001,\n} ClrDataValueLocationFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t/* suppress warning 28718 for interface IXCLRDataValue */\n/*\n * Object inspection interface.\n */\n[\n    object,\n    local,\n    uuid(96EC93C7-1000-4e93-8991-98D8766E6666)\n]\ninterface IXCLRDataValue : IUnknown\n{\n    /*\n     * Get state flags, defined in CLRDataValueFlag.\n     */\n    HRESULT GetFlags([out] ULONG32* flags);\n\n    /*\n     * Get the address of the object.\n     * Fails unless the object is a single contiguous\n     * piece of data in memory.\n     * OBSOLETE: Use GetLocation instead.\n     */\n    HRESULT GetAddress([out] CLRDATA_ADDRESS* address);\n\n    /*\n     * Return the size (in bytes) of the object.\n     */\n    HRESULT GetSize([out] ULONG64* size);\n\n    /*\n     * Copy between an object and a buffer.\n     * Returns S_FALSE if the buffer was not at least as large\n     * as the object.\n     */\n    HRESULT GetBytes([in] ULONG32 bufLen,\n                     [out] ULONG32 *dataSize,\n                     [out, size_is(bufLen)] BYTE buffer[]);\n    HRESULT SetBytes([in] ULONG32 bufLen,\n                     [out] ULONG32 *dataSize,\n                     [in, size_is(bufLen)] BYTE buffer[]);\n\n    /*\n     * Get the type of the object\n     */\n    HRESULT GetType([out] IXCLRDataTypeInstance **typeInstance);\n\n    /*\n     * Get the number of fields in the object.\n     * OBSOLETE: Use GetNumFields2.\n     */\n    HRESULT GetNumFields([out] ULONG32 *numFields);\n\n    /*\n     * Gets one field of the object.\n     *\n     * Because field ordering is not fixed, can also return name\n     * information and/or the metadata token, if the caller passes in\n     * appropriate values.\n     * OBSOLETE: Use EnumField.\n     */\n    HRESULT GetFieldByIndex([in] ULONG32 index,\n                            [out] IXCLRDataValue **field,\n                            [in] ULONG32 bufLen,\n                            [out] ULONG32 *nameLen,\n                            [out, size_is(bufLen)] WCHAR nameBuf[],\n                            [out] mdFieldDef* token);\n\n    HRESULT Request([in] ULONG32 reqCode,\n                    [in] ULONG32 inBufferSize,\n                    [in, size_is(inBufferSize)] BYTE* inBuffer,\n                    [in] ULONG32 outBufferSize,\n                    [out, size_is(outBufferSize)] BYTE* outBuffer);\n\n    /*\n     * Get the number of fields in the value.\n     * If a type is passed in only fields defined\n     * by that type are enumerated.\n     */\n    HRESULT GetNumFields2([in] ULONG32 flags,\n                          [in] IXCLRDataTypeInstance* fromType,\n                          [out] ULONG32* numFields);\n\n    /*\n     * Enumerate the fields for this value.\n     * If a type is passed in only fields defined\n     * by that type are enumerated.\n     */\n    HRESULT StartEnumFields([in] ULONG32 flags,\n                            [in] IXCLRDataTypeInstance* fromType,\n                            [out] CLRDATA_ENUM* handle);\n    HRESULT EnumField([in, out] CLRDATA_ENUM* handle,\n                      [out] IXCLRDataValue** field,\n                      [in] ULONG32 nameBufLen,\n                      [out] ULONG32* nameLen,\n                      [out, size_is(nameBufLen)] WCHAR nameBuf[],\n                      [out] mdFieldDef* token);\n    HRESULT EndEnumFields([in] CLRDATA_ENUM handle);\n\n    HRESULT StartEnumFieldsByName([in] LPCWSTR name,\n                                  [in] ULONG32 nameFlags,\n                                  [in] ULONG32 fieldFlags,\n                                  [in] IXCLRDataTypeInstance* fromType,\n                                  [out] CLRDATA_ENUM* handle);\n    HRESULT EnumFieldByName([in, out] CLRDATA_ENUM* handle,\n                            [out] IXCLRDataValue** field,\n                            [out] mdFieldDef* token);\n    HRESULT EndEnumFieldsByName([in] CLRDATA_ENUM handle);\n\n    /*\n     * Retrieve a field by field metadata token.\n     */\n    HRESULT GetFieldByToken([in] mdFieldDef token,\n                            [out] IXCLRDataValue **field,\n                            [in] ULONG32 bufLen,\n                            [out] ULONG32 *nameLen,\n                            [out, size_is(bufLen)] WCHAR nameBuf[]);\n\n    /*\n     * Get the value implicitly associated with this value.\n     * For pointers or reference values this is the value\n     *   pointed/referred to.\n     * For boxed values this is the contained value.\n     * For other values there is no associated value.\n     */\n    HRESULT GetAssociatedValue([out] IXCLRDataValue** assocValue);\n\n    /*\n     * Get the type implicitly associated with this value.\n     * For pointers or reference types this is the type\n     *   pointed/referred to.\n     * For boxed values this is the type of the contained value.\n     * For arrays this is the element type.\n     * For other values there is no associated type.\n     */\n    HRESULT GetAssociatedType([out] IXCLRDataTypeInstance** assocType);\n\n    /*\n     * String methods that only work for string data values.\n     */\n\n    /*\n     * Return the length and contents of the string.\n     */\n    HRESULT GetString([in] ULONG32 bufLen,\n                      [out] ULONG32 *strLen,\n                      [out, size_is(bufLen)] WCHAR str[]);\n\n    /*\n     * Array methods that only work for array data values.\n     */\n\n    /*\n     * Return the definition of the array.\n     */\n    HRESULT GetArrayProperties([out] ULONG32 *rank,\n                               [out] ULONG32 *totalElements,\n                               [in] ULONG32 numDim,\n                               [out, size_is(numDim)] ULONG32 dims[],\n                               [in] ULONG32 numBases,\n                               [out, size_is(numBases)] LONG32 bases[]);\n\n    /*\n     * Return a value representing the given element in the array.\n     */\n    HRESULT GetArrayElement([in] ULONG32 numInd,\n                            [in, size_is(numInd)] LONG32 indices[],\n                            [out] IXCLRDataValue **value);\n\n    HRESULT EnumField2([in, out] CLRDATA_ENUM* handle,\n                       [out] IXCLRDataValue** field,\n                       [in] ULONG32 nameBufLen,\n                       [out] ULONG32* nameLen,\n                       [out, size_is(nameBufLen)] WCHAR nameBuf[],\n                       [out] IXCLRDataModule** tokenScope,\n                       [out] mdFieldDef* token);\n    HRESULT EnumFieldByName2([in, out] CLRDATA_ENUM* handle,\n                             [out] IXCLRDataValue** field,\n                             [out] IXCLRDataModule** tokenScope,\n                             [out] mdFieldDef* token);\n    HRESULT GetFieldByToken2([in] IXCLRDataModule* tokenScope,\n                             [in] mdFieldDef token,\n                             [out] IXCLRDataValue **field,\n                             [in] ULONG32 bufLen,\n                             [out] ULONG32 *nameLen,\n                             [out, size_is(bufLen)] WCHAR nameBuf[]);\n\n    /*\n     * Returns the locations the value's\n     * data is spread across.\n     * Placeholder values, such as values for variables\n     * which are dead, may not have any locations.\n     * Memory locations return the memory address in arg.\n     * Register locations do not return an indication\n     * of which register.\n     * Requires revision 3.\n     */\n    HRESULT GetNumLocations([out] ULONG32* numLocs);\n    HRESULT GetLocationByIndex([in] ULONG32 loc,\n                               [out] ULONG32* flags,\n                               [out] CLRDATA_ADDRESS* arg);\n}\n#pragma warning(pop)\n\n[\n    object,\n    local,\n    uuid(2D95A079-42A1-4837-818F-0B97D7048E0E)\n]\ninterface IXCLRDataExceptionNotification : IUnknown\n{\n    /*\n     * New code was generated or discarded for a method.\n     */\n    HRESULT OnCodeGenerated([in] IXCLRDataMethodInstance* method);\n    HRESULT OnCodeDiscarded([in] IXCLRDataMethodInstance* method);\n\n    /*\n     * The process or task reached the desired execution state.\n     */\n    HRESULT OnProcessExecution([in] ULONG32 state);\n    HRESULT OnTaskExecution([in] IXCLRDataTask* task,\n                            [in] ULONG32 state);\n\n    /*\n     * The given module was loaded or unloaded.\n     */\n    HRESULT OnModuleLoaded([in] IXCLRDataModule* mod);\n    HRESULT OnModuleUnloaded([in] IXCLRDataModule* mod);\n\n    /*\n     * The given type was loaded or unloaded.\n     */\n    HRESULT OnTypeLoaded([in] IXCLRDataTypeInstance* typeInst);\n    HRESULT OnTypeUnloaded([in] IXCLRDataTypeInstance* typeInst);\n}\n\n[\n    object,\n    local,\n    uuid(31201a94-4337-49b7-aef7-0c755054091f)\n]\ninterface IXCLRDataExceptionNotification2 : IXCLRDataExceptionNotification\n{\n    /*\n     * The given app domain was loaded or unloaded.\n     */\n    HRESULT OnAppDomainLoaded([in] IXCLRDataAppDomain* domain);\n    HRESULT OnAppDomainUnloaded([in] IXCLRDataAppDomain* domain);\n\n    /*\n     * A managed exception has been raised.\n     */\n    HRESULT OnException([in] IXCLRDataExceptionState* exception);\n}\n\n[\n    object,\n    local,\n    uuid(31201a94-4337-49b7-aef7-0c7550540920)\n]\ninterface IXCLRDataExceptionNotification3 : IXCLRDataExceptionNotification2\n{\n    /*\n     * The specified GC event was triggered.  The GC event is passed in an\n     * opaque structure, whose structure is given by buffSize\n     */\n    HRESULT OnGcEvent([in] GcEvtArgs gcEvtArgs);\n}\n\n[\n    object,\n    local,\n    uuid(C25E926E-5F09-4AA2-BBAD-B7FC7F10CFD7)\n]\ninterface IXCLRDataExceptionNotification4 : IXCLRDataExceptionNotification3\n{\n    /*\n     * A managed catch clause is about to be executed\n     */\n    HRESULT ExceptionCatcherEnter([in] IXCLRDataMethodInstance* catchingMethod, DWORD catcherNativeOffset);\n}\n\n[\n    object,\n    local,\n    uuid(e77a39ea-3548-44d9-b171-8569ed1a9423)\n]\ninterface IXCLRDataExceptionNotification5 : IXCLRDataExceptionNotification4\n{\n    /*\n     * New code was generated for a method. The given address is the start address of\n     * the native newly jitted code.\n     */\n    HRESULT OnCodeGenerated2([in] IXCLRDataMethodInstance* method, [in] CLRDATA_ADDRESS nativeCodeLocation);\n}\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/xcordebug.idl",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n/*****************************************************************************\n **                                                                         **\n ** XCordebug.idl - Experimental (undocumented) Debugging interfaces.       **\n **                                                                         **\n *****************************************************************************/\n\n\n/* ------------------------------------------------------------------------- *\n * Imported types\n * ------------------------------------------------------------------------- */\n\nimport \"cordebug.idl\";\n\n\n\n\n// @dbgtodo : proper API docs here.\n// - include failure semantics of Filter.  What does failure mean?\n//\n/* Comments to add to ICorDebugDataTarget docs:\n * Whenever the target process changes, the debugger client must\n * call ICorDebugProcess4::ProcessStateChanged before issuing any other\n * ICorDebug API calls.\n*/\n[\n    object,\n    local,\n    uuid(E930C679-78AF-4953-8AB7-B0AABF0F9F80),\n    pointer_default(unique)\n]\ninterface ICorDebugProcess4 : IUnknown\n{\n    /*\n     * Process native debug events.\n     */\n    HRESULT Filter(\n        [in, length_is(countBytes), size_is(countBytes)]  const BYTE pRecord[],\n        [in] DWORD countBytes,\n        [in] CorDebugRecordFormat format,\n        [in] DWORD dwFlags,\n        [in] DWORD dwThreadId,\n        [in] ICorDebugManagedCallback * pCallback,\n        [in, out] CORDB_CONTINUE_STATUS * pContinueStatus);\n\n    /*\n     * Debugger calls this to notify ICorDebug that the process is running.\n     *\n     * Notes:\n     *   ProcessStateChanged(PROCESS_RUNNING) has similar semantics to ICorDebugProcess::Continue();\n     */\n    HRESULT ProcessStateChanged([in] CorDebugStateChange eChange);\n\n};\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/inc/yieldprocessornormalized.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#pragma once\n\n// Undefine YieldProcessor to encourage using the normalized versions below instead. System_YieldProcessor() can be used where\n// the intention is to use the system-default implementation of YieldProcessor().\n#define HAS_SYSTEM_YIELDPROCESSOR\nFORCEINLINE void System_YieldProcessor() { YieldProcessor(); }\n#ifdef YieldProcessor\n#undef YieldProcessor\n#endif\n#define YieldProcessor Dont_Use_YieldProcessor\n\n#define DISABLE_COPY(T) \\\n    T(const T &) = delete; \\\n    T &operator =(const T &) = delete\n\n#define DISABLE_CONSTRUCT_COPY(T) \\\n    T() = delete; \\\n    DISABLE_COPY(T)\n\nclass YieldProcessorNormalization\n{\npublic:\n    static const unsigned int TargetNsPerNormalizedYield = 37;\n    static const unsigned int TargetMaxNsPerSpinIteration = 272;\n\n    // These are maximums for the computed values for normalization based their calculation\n    static const unsigned int MaxYieldsPerNormalizedYield = TargetNsPerNormalizedYield * 10;\n    static const unsigned int MaxOptimalMaxNormalizedYieldsPerSpinIteration =\n        TargetMaxNsPerSpinIteration * 3 / (TargetNsPerNormalizedYield * 2) + 1;\n\nprivate:\n    static bool s_isMeasurementScheduled;\n\n    static unsigned int s_yieldsPerNormalizedYield;\n    static unsigned int s_optimalMaxNormalizedYieldsPerSpinIteration;\n\npublic:\n    static bool IsMeasurementScheduled()\n    {\n        return s_isMeasurementScheduled;\n    }\n\n    static void PerformMeasurement();\n\nprivate:\n    static void ScheduleMeasurementIfNecessary();\n\npublic:\n    static unsigned int GetOptimalMaxNormalizedYieldsPerSpinIteration()\n    {\n        return s_optimalMaxNormalizedYieldsPerSpinIteration;\n    }\n\n    static void FireMeasurementEvents();\n\nprivate:\n    static double AtomicLoad(double *valueRef);\n    static void AtomicStore(double *valueRef, double value);\n\n    DISABLE_CONSTRUCT_COPY(YieldProcessorNormalization);\n\n    friend class YieldProcessorNormalizationInfo;\n    friend void YieldProcessorNormalizedForPreSkylakeCount(unsigned int);\n};\n\nclass YieldProcessorNormalizationInfo\n{\nprivate:\n    unsigned int yieldsPerNormalizedYield;\n    unsigned int optimalMaxNormalizedYieldsPerSpinIteration;\n    unsigned int optimalMaxYieldsPerSpinIteration;\n\npublic:\n    YieldProcessorNormalizationInfo()\n        : yieldsPerNormalizedYield(YieldProcessorNormalization::s_yieldsPerNormalizedYield),\n        optimalMaxNormalizedYieldsPerSpinIteration(YieldProcessorNormalization::s_optimalMaxNormalizedYieldsPerSpinIteration),\n        optimalMaxYieldsPerSpinIteration(yieldsPerNormalizedYield * optimalMaxNormalizedYieldsPerSpinIteration)\n    {\n        YieldProcessorNormalization::ScheduleMeasurementIfNecessary();\n    }\n\n    DISABLE_COPY(YieldProcessorNormalizationInfo);\n\n    friend void YieldProcessorNormalized(const YieldProcessorNormalizationInfo &);\n    friend void YieldProcessorNormalized(const YieldProcessorNormalizationInfo &, unsigned int);\n    friend void YieldProcessorNormalizedForPreSkylakeCount(const YieldProcessorNormalizationInfo &, unsigned int);\n    friend void YieldProcessorWithBackOffNormalized(const YieldProcessorNormalizationInfo &, unsigned int);\n};\n\n// See YieldProcessorNormalized() for preliminary info. Typical usage:\n//     if (!condition)\n//     {\n//         YieldProcessorNormalizationInfo normalizationInfo;\n//         do\n//         {\n//             YieldProcessorNormalized(normalizationInfo);\n//         } while (!condition);\n//     }\nFORCEINLINE void YieldProcessorNormalized(const YieldProcessorNormalizationInfo &normalizationInfo)\n{\n    unsigned int n = normalizationInfo.yieldsPerNormalizedYield;\n    _ASSERTE(n != 0);\n    do\n    {\n        System_YieldProcessor();\n    } while (--n != 0);\n}\n\n// Delays execution of the current thread for a short duration. Unlike YieldProcessor(), an effort is made to normalize the\n// delay across processors. The actual delay may be meaningful in several ways, including but not limited to the following:\n//   - The delay should be long enough that a tiny spin-wait like the following has a decent likelihood of observing a new value\n//     for the condition (when changed by a different thread) on each iteration, otherwise it may unnecessary increase CPU usage\n//     and decrease scalability of the operation.\n//         while(!condition)\n//         {\n//             YieldProcessorNormalized();\n//         }\n//   - The delay should be short enough that a tiny spin-wait like above would not miss multiple cross-thread changes to the\n//     condition, otherwise it may unnecessarily increase latency of the operation\n//   - In reasonably short spin-waits, the actual delay may not matter much. In unreasonably long spin-waits that progress in\n//     yield count per iteration for each failed check of the condition, the progression can significantly magnify the second\n//     issue above on later iterations.\n//   - This function and variants are intended to provide a decent balance between the above issues, as ideal solutions to each\n//     issue have trade-offs between them. If latency of the operation is far more important in the scenario, consider using\n//     System_YieldProcessor() instead, which would issue a delay that is typically <= the delay issued by this method.\nFORCEINLINE void YieldProcessorNormalized()\n{\n    YieldProcessorNormalized(YieldProcessorNormalizationInfo());\n}\n\n// See YieldProcessorNormalized(count) for preliminary info. Typical usage:\n//     if (!moreExpensiveCondition)\n//     {\n//         YieldProcessorNormalizationInfo normalizationInfo;\n//         do\n//         {\n//             YieldProcessorNormalized(normalizationInfo, 2);\n//         } while (!moreExpensiveCondition);\n//     }\nFORCEINLINE void YieldProcessorNormalized(const YieldProcessorNormalizationInfo &normalizationInfo, unsigned int count)\n{\n    _ASSERTE(count != 0);\n\n    if (sizeof(SIZE_T) <= sizeof(unsigned int))\n    {\n        // On platforms with a small SIZE_T, prevent overflow on the multiply below\n        const unsigned int MaxCount = UINT_MAX / YieldProcessorNormalization::MaxYieldsPerNormalizedYield;\n        if (count > MaxCount)\n        {\n            count = MaxCount;\n        }\n    }\n\n    SIZE_T n = (SIZE_T)count * normalizationInfo.yieldsPerNormalizedYield;\n    _ASSERTE(n != 0);\n    do\n    {\n        System_YieldProcessor();\n    } while (--n != 0);\n}\n\n// See YieldProcessorNormalized() for preliminary info. This function repeats the delay 'count' times. This overload is\n// preferred over the single-count overload when multiple yields are desired per spin-wait iteration. Typical usage:\n//     while(!moreExpensiveCondition)\n//     {\n//         YieldProcessorNormalized(2);\n//     }\nFORCEINLINE void YieldProcessorNormalized(unsigned int count)\n{\n    YieldProcessorNormalized(YieldProcessorNormalizationInfo(), count);\n}\n\n// Please DO NOT use this function in new code! See YieldProcessorNormalizedForPreSkylakeCount(preSkylakeCount) for preliminary\n// info. Typical usage:\n//     if (!condition)\n//     {\n//         YieldProcessorNormalizationInfo normalizationInfo;\n//         do\n//         {\n//             YieldProcessorNormalizedForPreSkylakeCount(normalizationInfo, 100);\n//         } while (!condition);\n//     }\nFORCEINLINE void YieldProcessorNormalizedForPreSkylakeCount(\n    const YieldProcessorNormalizationInfo &normalizationInfo,\n    unsigned int preSkylakeCount)\n{\n    _ASSERTE(preSkylakeCount != 0);\n\n    if (sizeof(SIZE_T) <= sizeof(unsigned int))\n    {\n        // On platforms with a small SIZE_T, prevent overflow on the multiply below\n        const unsigned int MaxCount = UINT_MAX / YieldProcessorNormalization::MaxYieldsPerNormalizedYield;\n        if (preSkylakeCount > MaxCount)\n        {\n            preSkylakeCount = MaxCount;\n        }\n    }\n\n    const unsigned int PreSkylakeCountToSkylakeCountDivisor = 8;\n    SIZE_T n = (SIZE_T)preSkylakeCount * normalizationInfo.yieldsPerNormalizedYield / PreSkylakeCountToSkylakeCountDivisor;\n    if (n == 0)\n    {\n        n = 1;\n    }\n    do\n    {\n        System_YieldProcessor();\n    } while (--n != 0);\n}\n\n// Please DO NOT use this function in new code! This function is to be used for old spin-wait loops that have not been retuned\n// for recent processors, and especially where the yield count may be unreasonably high. The function scales the yield count in\n// an attempt to normalize the total delay across processors, to approximately the total delay that would be issued on a\n// pre-Skylake processor. New code should be tuned with YieldProcessorNormalized() or variants instead. Typical usage:\n//     while(!condition)\n//     {\n//         YieldProcessorNormalizedForPreSkylakeCount(100);\n//     }\nFORCEINLINE void YieldProcessorNormalizedForPreSkylakeCount(unsigned int preSkylakeCount)\n{\n    // This function does not forward to the one above because it is used by some code under utilcode, where\n    // YieldProcessorNormalizationInfo cannot be used since normalization does not happen in some of its consumers. So this\n    // version uses the fields in YieldProcessorNormalization directly.\n\n    _ASSERTE(preSkylakeCount != 0);\n\n    if (sizeof(SIZE_T) <= sizeof(unsigned int))\n    {\n        // On platforms with a small SIZE_T, prevent overflow on the multiply below\n        const unsigned int MaxCount = UINT_MAX / YieldProcessorNormalization::MaxYieldsPerNormalizedYield;\n        if (preSkylakeCount > MaxCount)\n        {\n            preSkylakeCount = MaxCount;\n        }\n    }\n\n    const unsigned int PreSkylakeCountToSkylakeCountDivisor = 8;\n    SIZE_T n =\n        (SIZE_T)preSkylakeCount *\n        YieldProcessorNormalization::s_yieldsPerNormalizedYield /\n        PreSkylakeCountToSkylakeCountDivisor;\n    if (n == 0)\n    {\n        n = 1;\n    }\n    do\n    {\n        System_YieldProcessor();\n    } while (--n != 0);\n}\n\n// See YieldProcessorNormalized() for preliminary info. This function is to be used when there is a decent possibility that the\n// condition would not be satisfied within a short duration. The current implementation increases the delay per spin-wait\n// iteration exponentially up to a limit. Typical usage:\n//     if (!conditionThatMayNotBeSatisfiedSoon)\n//     {\n//         YieldProcessorNormalizationInfo normalizationInfo;\n//         do\n//         {\n//             YieldProcessorWithBackOffNormalized(normalizationInfo); // maybe Sleep(0) occasionally\n//         } while (!conditionThatMayNotBeSatisfiedSoon);\n//     }\nFORCEINLINE void YieldProcessorWithBackOffNormalized(\n    const YieldProcessorNormalizationInfo &normalizationInfo,\n    unsigned int spinIteration)\n{\n    // This shift value should be adjusted based on the asserted conditions below\n    const UINT8 MaxShift = 3;\n    static_assert_no_msg(\n        ((unsigned int)1 << MaxShift) <= YieldProcessorNormalization::MaxOptimalMaxNormalizedYieldsPerSpinIteration);\n    static_assert_no_msg(\n        ((unsigned int)1 << (MaxShift + 1)) > YieldProcessorNormalization::MaxOptimalMaxNormalizedYieldsPerSpinIteration);\n\n    unsigned int n;\n    if (spinIteration <= MaxShift &&\n        ((unsigned int)1 << spinIteration) < normalizationInfo.optimalMaxNormalizedYieldsPerSpinIteration)\n    {\n        n = ((unsigned int)1 << spinIteration) * normalizationInfo.yieldsPerNormalizedYield;\n    }\n    else\n    {\n        n = normalizationInfo.optimalMaxYieldsPerSpinIteration;\n    }\n    _ASSERTE(n != 0);\n    do\n    {\n        System_YieldProcessor();\n    } while (--n != 0);\n}\n\n#undef DISABLE_CONSTRUCT_COPY\n#undef DISABLE_COPY\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/clrdata.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.01.0626 */\n/* Compiler settings for clrdata.idl:\n    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0626 \n    protocol : dce , ms_ext, c_ext, robust\n    error checks: allocation ref bounds_check enum stub_data \n    VC __declspec() decoration level: \n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\n         DECLSPEC_UUID(), MIDL_INTERFACE()\n*/\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif /* __RPCNDR_H_VERSION__ */\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __clrdata_h__\n#define __clrdata_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n#ifndef DECLSPEC_XFGVIRT\n#if _CONTROL_FLOW_GUARD_XFG\n#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))\n#else\n#define DECLSPEC_XFGVIRT(base, func)\n#endif\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __ICLRDataTarget_FWD_DEFINED__\n#define __ICLRDataTarget_FWD_DEFINED__\ntypedef interface ICLRDataTarget ICLRDataTarget;\n\n#endif \t/* __ICLRDataTarget_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDataTarget2_FWD_DEFINED__\n#define __ICLRDataTarget2_FWD_DEFINED__\ntypedef interface ICLRDataTarget2 ICLRDataTarget2;\n\n#endif \t/* __ICLRDataTarget2_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDataTarget3_FWD_DEFINED__\n#define __ICLRDataTarget3_FWD_DEFINED__\ntypedef interface ICLRDataTarget3 ICLRDataTarget3;\n\n#endif \t/* __ICLRDataTarget3_FWD_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeLocator_FWD_DEFINED__\n#define __ICLRRuntimeLocator_FWD_DEFINED__\ntypedef interface ICLRRuntimeLocator ICLRRuntimeLocator;\n\n#endif \t/* __ICLRRuntimeLocator_FWD_DEFINED__ */\n\n\n#ifndef __ICLRMetadataLocator_FWD_DEFINED__\n#define __ICLRMetadataLocator_FWD_DEFINED__\ntypedef interface ICLRMetadataLocator ICLRMetadataLocator;\n\n#endif \t/* __ICLRMetadataLocator_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDataEnumMemoryRegionsCallback_FWD_DEFINED__\n#define __ICLRDataEnumMemoryRegionsCallback_FWD_DEFINED__\ntypedef interface ICLRDataEnumMemoryRegionsCallback ICLRDataEnumMemoryRegionsCallback;\n\n#endif \t/* __ICLRDataEnumMemoryRegionsCallback_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDataEnumMemoryRegionsCallback2_FWD_DEFINED__\n#define __ICLRDataEnumMemoryRegionsCallback2_FWD_DEFINED__\ntypedef interface ICLRDataEnumMemoryRegionsCallback2 ICLRDataEnumMemoryRegionsCallback2;\n\n#endif \t/* __ICLRDataEnumMemoryRegionsCallback2_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDataLoggingCallback_FWD_DEFINED__\n#define __ICLRDataLoggingCallback_FWD_DEFINED__\ntypedef interface ICLRDataLoggingCallback ICLRDataLoggingCallback;\n\n#endif \t/* __ICLRDataLoggingCallback_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDataEnumMemoryRegions_FWD_DEFINED__\n#define __ICLRDataEnumMemoryRegions_FWD_DEFINED__\ntypedef interface ICLRDataEnumMemoryRegions ICLRDataEnumMemoryRegions;\n\n#endif \t/* __ICLRDataEnumMemoryRegions_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n/* interface __MIDL_itf_clrdata_0000_0000 */\n/* [local] */ \n\n\n\n\n\n\n\n\ntypedef ULONG64 CLRDATA_ADDRESS;\n\nSTDAPI CLRDataCreateInstance(REFIID iid, ICLRDataTarget* target, void** iface);\ntypedef HRESULT (STDAPICALLTYPE* PFN_CLRDataCreateInstance)(REFIID iid, ICLRDataTarget* target, void** iface);\n\n\nextern RPC_IF_HANDLE __MIDL_itf_clrdata_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_clrdata_0000_0000_v0_0_s_ifspec;\n\n#ifndef __ICLRDataTarget_INTERFACE_DEFINED__\n#define __ICLRDataTarget_INTERFACE_DEFINED__\n\n/* interface ICLRDataTarget */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRDataTarget;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"3E11CCEE-D08B-43e5-AF01-32717A64DA03\")\n    ICLRDataTarget : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetMachineType( \n            /* [out] */ ULONG32 *machineType) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetPointerSize( \n            /* [out] */ ULONG32 *pointerSize) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetImageBase( \n            /* [string][in] */ LPCWSTR imagePath,\n            /* [out] */ CLRDATA_ADDRESS *baseAddress) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ReadVirtual( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesRead) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteVirtual( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [size_is][in] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesWritten) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTLSValue( \n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [out] */ CLRDATA_ADDRESS *value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetTLSValue( \n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [in] */ CLRDATA_ADDRESS value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCurrentThreadID( \n            /* [out] */ ULONG32 *threadID) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetThreadContext( \n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *context) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetThreadContext( \n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE *context) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDataTargetVtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDataTarget * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDataTarget * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDataTarget * This);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetMachineType)\n        HRESULT ( STDMETHODCALLTYPE *GetMachineType )( \n            ICLRDataTarget * This,\n            /* [out] */ ULONG32 *machineType);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetPointerSize)\n        HRESULT ( STDMETHODCALLTYPE *GetPointerSize )( \n            ICLRDataTarget * This,\n            /* [out] */ ULONG32 *pointerSize);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetImageBase)\n        HRESULT ( STDMETHODCALLTYPE *GetImageBase )( \n            ICLRDataTarget * This,\n            /* [string][in] */ LPCWSTR imagePath,\n            /* [out] */ CLRDATA_ADDRESS *baseAddress);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, ReadVirtual)\n        HRESULT ( STDMETHODCALLTYPE *ReadVirtual )( \n            ICLRDataTarget * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesRead);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, WriteVirtual)\n        HRESULT ( STDMETHODCALLTYPE *WriteVirtual )( \n            ICLRDataTarget * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [size_is][in] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesWritten);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetTLSValue)\n        HRESULT ( STDMETHODCALLTYPE *GetTLSValue )( \n            ICLRDataTarget * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [out] */ CLRDATA_ADDRESS *value);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, SetTLSValue)\n        HRESULT ( STDMETHODCALLTYPE *SetTLSValue )( \n            ICLRDataTarget * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [in] */ CLRDATA_ADDRESS value);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetCurrentThreadID)\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( \n            ICLRDataTarget * This,\n            /* [out] */ ULONG32 *threadID);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetThreadContext)\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( \n            ICLRDataTarget * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *context);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, SetThreadContext)\n        HRESULT ( STDMETHODCALLTYPE *SetThreadContext )( \n            ICLRDataTarget * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE *context);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, Request)\n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            ICLRDataTarget * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        END_INTERFACE\n    } ICLRDataTargetVtbl;\n\n    interface ICLRDataTarget\n    {\n        CONST_VTBL struct ICLRDataTargetVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDataTarget_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDataTarget_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDataTarget_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDataTarget_GetMachineType(This,machineType)\t\\\n    ( (This)->lpVtbl -> GetMachineType(This,machineType) ) \n\n#define ICLRDataTarget_GetPointerSize(This,pointerSize)\t\\\n    ( (This)->lpVtbl -> GetPointerSize(This,pointerSize) ) \n\n#define ICLRDataTarget_GetImageBase(This,imagePath,baseAddress)\t\\\n    ( (This)->lpVtbl -> GetImageBase(This,imagePath,baseAddress) ) \n\n#define ICLRDataTarget_ReadVirtual(This,address,buffer,bytesRequested,bytesRead)\t\\\n    ( (This)->lpVtbl -> ReadVirtual(This,address,buffer,bytesRequested,bytesRead) ) \n\n#define ICLRDataTarget_WriteVirtual(This,address,buffer,bytesRequested,bytesWritten)\t\\\n    ( (This)->lpVtbl -> WriteVirtual(This,address,buffer,bytesRequested,bytesWritten) ) \n\n#define ICLRDataTarget_GetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> GetTLSValue(This,threadID,index,value) ) \n\n#define ICLRDataTarget_SetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> SetTLSValue(This,threadID,index,value) ) \n\n#define ICLRDataTarget_GetCurrentThreadID(This,threadID)\t\\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,threadID) ) \n\n#define ICLRDataTarget_GetThreadContext(This,threadID,contextFlags,contextSize,context)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadID,contextFlags,contextSize,context) ) \n\n#define ICLRDataTarget_SetThreadContext(This,threadID,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) ) \n\n#define ICLRDataTarget_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDataTarget_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRDataTarget2_INTERFACE_DEFINED__\n#define __ICLRDataTarget2_INTERFACE_DEFINED__\n\n/* interface ICLRDataTarget2 */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRDataTarget2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"6d05fae3-189c-4630-a6dc-1c251e1c01ab\")\n    ICLRDataTarget2 : public ICLRDataTarget\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE AllocVirtual( \n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags,\n            /* [in] */ ULONG32 protectFlags,\n            /* [out] */ CLRDATA_ADDRESS *virt) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE FreeVirtual( \n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDataTarget2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDataTarget2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDataTarget2 * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDataTarget2 * This);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetMachineType)\n        HRESULT ( STDMETHODCALLTYPE *GetMachineType )( \n            ICLRDataTarget2 * This,\n            /* [out] */ ULONG32 *machineType);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetPointerSize)\n        HRESULT ( STDMETHODCALLTYPE *GetPointerSize )( \n            ICLRDataTarget2 * This,\n            /* [out] */ ULONG32 *pointerSize);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetImageBase)\n        HRESULT ( STDMETHODCALLTYPE *GetImageBase )( \n            ICLRDataTarget2 * This,\n            /* [string][in] */ LPCWSTR imagePath,\n            /* [out] */ CLRDATA_ADDRESS *baseAddress);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, ReadVirtual)\n        HRESULT ( STDMETHODCALLTYPE *ReadVirtual )( \n            ICLRDataTarget2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesRead);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, WriteVirtual)\n        HRESULT ( STDMETHODCALLTYPE *WriteVirtual )( \n            ICLRDataTarget2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [size_is][in] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesWritten);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetTLSValue)\n        HRESULT ( STDMETHODCALLTYPE *GetTLSValue )( \n            ICLRDataTarget2 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [out] */ CLRDATA_ADDRESS *value);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, SetTLSValue)\n        HRESULT ( STDMETHODCALLTYPE *SetTLSValue )( \n            ICLRDataTarget2 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [in] */ CLRDATA_ADDRESS value);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetCurrentThreadID)\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( \n            ICLRDataTarget2 * This,\n            /* [out] */ ULONG32 *threadID);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetThreadContext)\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( \n            ICLRDataTarget2 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *context);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, SetThreadContext)\n        HRESULT ( STDMETHODCALLTYPE *SetThreadContext )( \n            ICLRDataTarget2 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE *context);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, Request)\n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            ICLRDataTarget2 * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget2, AllocVirtual)\n        HRESULT ( STDMETHODCALLTYPE *AllocVirtual )( \n            ICLRDataTarget2 * This,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags,\n            /* [in] */ ULONG32 protectFlags,\n            /* [out] */ CLRDATA_ADDRESS *virt);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget2, FreeVirtual)\n        HRESULT ( STDMETHODCALLTYPE *FreeVirtual )( \n            ICLRDataTarget2 * This,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags);\n        \n        END_INTERFACE\n    } ICLRDataTarget2Vtbl;\n\n    interface ICLRDataTarget2\n    {\n        CONST_VTBL struct ICLRDataTarget2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDataTarget2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDataTarget2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDataTarget2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDataTarget2_GetMachineType(This,machineType)\t\\\n    ( (This)->lpVtbl -> GetMachineType(This,machineType) ) \n\n#define ICLRDataTarget2_GetPointerSize(This,pointerSize)\t\\\n    ( (This)->lpVtbl -> GetPointerSize(This,pointerSize) ) \n\n#define ICLRDataTarget2_GetImageBase(This,imagePath,baseAddress)\t\\\n    ( (This)->lpVtbl -> GetImageBase(This,imagePath,baseAddress) ) \n\n#define ICLRDataTarget2_ReadVirtual(This,address,buffer,bytesRequested,bytesRead)\t\\\n    ( (This)->lpVtbl -> ReadVirtual(This,address,buffer,bytesRequested,bytesRead) ) \n\n#define ICLRDataTarget2_WriteVirtual(This,address,buffer,bytesRequested,bytesWritten)\t\\\n    ( (This)->lpVtbl -> WriteVirtual(This,address,buffer,bytesRequested,bytesWritten) ) \n\n#define ICLRDataTarget2_GetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> GetTLSValue(This,threadID,index,value) ) \n\n#define ICLRDataTarget2_SetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> SetTLSValue(This,threadID,index,value) ) \n\n#define ICLRDataTarget2_GetCurrentThreadID(This,threadID)\t\\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,threadID) ) \n\n#define ICLRDataTarget2_GetThreadContext(This,threadID,contextFlags,contextSize,context)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadID,contextFlags,contextSize,context) ) \n\n#define ICLRDataTarget2_SetThreadContext(This,threadID,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) ) \n\n#define ICLRDataTarget2_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n\n#define ICLRDataTarget2_AllocVirtual(This,addr,size,typeFlags,protectFlags,virt)\t\\\n    ( (This)->lpVtbl -> AllocVirtual(This,addr,size,typeFlags,protectFlags,virt) ) \n\n#define ICLRDataTarget2_FreeVirtual(This,addr,size,typeFlags)\t\\\n    ( (This)->lpVtbl -> FreeVirtual(This,addr,size,typeFlags) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDataTarget2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRDataTarget3_INTERFACE_DEFINED__\n#define __ICLRDataTarget3_INTERFACE_DEFINED__\n\n/* interface ICLRDataTarget3 */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRDataTarget3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"a5664f95-0af4-4a1b-960e-2f3346b4214c\")\n    ICLRDataTarget3 : public ICLRDataTarget2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetExceptionRecord( \n            /* [in] */ ULONG32 bufferSize,\n            /* [out] */ ULONG32 *bufferUsed,\n            /* [size_is][out] */ BYTE *buffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetExceptionContextRecord( \n            /* [in] */ ULONG32 bufferSize,\n            /* [out] */ ULONG32 *bufferUsed,\n            /* [size_is][out] */ BYTE *buffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetExceptionThreadID( \n            /* [out] */ ULONG32 *threadID) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDataTarget3Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDataTarget3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDataTarget3 * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDataTarget3 * This);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetMachineType)\n        HRESULT ( STDMETHODCALLTYPE *GetMachineType )( \n            ICLRDataTarget3 * This,\n            /* [out] */ ULONG32 *machineType);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetPointerSize)\n        HRESULT ( STDMETHODCALLTYPE *GetPointerSize )( \n            ICLRDataTarget3 * This,\n            /* [out] */ ULONG32 *pointerSize);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetImageBase)\n        HRESULT ( STDMETHODCALLTYPE *GetImageBase )( \n            ICLRDataTarget3 * This,\n            /* [string][in] */ LPCWSTR imagePath,\n            /* [out] */ CLRDATA_ADDRESS *baseAddress);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, ReadVirtual)\n        HRESULT ( STDMETHODCALLTYPE *ReadVirtual )( \n            ICLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesRead);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, WriteVirtual)\n        HRESULT ( STDMETHODCALLTYPE *WriteVirtual )( \n            ICLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [size_is][in] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesWritten);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetTLSValue)\n        HRESULT ( STDMETHODCALLTYPE *GetTLSValue )( \n            ICLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [out] */ CLRDATA_ADDRESS *value);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, SetTLSValue)\n        HRESULT ( STDMETHODCALLTYPE *SetTLSValue )( \n            ICLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [in] */ CLRDATA_ADDRESS value);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetCurrentThreadID)\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( \n            ICLRDataTarget3 * This,\n            /* [out] */ ULONG32 *threadID);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, GetThreadContext)\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( \n            ICLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *context);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, SetThreadContext)\n        HRESULT ( STDMETHODCALLTYPE *SetThreadContext )( \n            ICLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE *context);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget, Request)\n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            ICLRDataTarget3 * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget2, AllocVirtual)\n        HRESULT ( STDMETHODCALLTYPE *AllocVirtual )( \n            ICLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags,\n            /* [in] */ ULONG32 protectFlags,\n            /* [out] */ CLRDATA_ADDRESS *virt);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget2, FreeVirtual)\n        HRESULT ( STDMETHODCALLTYPE *FreeVirtual )( \n            ICLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget3, GetExceptionRecord)\n        HRESULT ( STDMETHODCALLTYPE *GetExceptionRecord )( \n            ICLRDataTarget3 * This,\n            /* [in] */ ULONG32 bufferSize,\n            /* [out] */ ULONG32 *bufferUsed,\n            /* [size_is][out] */ BYTE *buffer);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget3, GetExceptionContextRecord)\n        HRESULT ( STDMETHODCALLTYPE *GetExceptionContextRecord )( \n            ICLRDataTarget3 * This,\n            /* [in] */ ULONG32 bufferSize,\n            /* [out] */ ULONG32 *bufferUsed,\n            /* [size_is][out] */ BYTE *buffer);\n        \n        DECLSPEC_XFGVIRT(ICLRDataTarget3, GetExceptionThreadID)\n        HRESULT ( STDMETHODCALLTYPE *GetExceptionThreadID )( \n            ICLRDataTarget3 * This,\n            /* [out] */ ULONG32 *threadID);\n        \n        END_INTERFACE\n    } ICLRDataTarget3Vtbl;\n\n    interface ICLRDataTarget3\n    {\n        CONST_VTBL struct ICLRDataTarget3Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDataTarget3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDataTarget3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDataTarget3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDataTarget3_GetMachineType(This,machineType)\t\\\n    ( (This)->lpVtbl -> GetMachineType(This,machineType) ) \n\n#define ICLRDataTarget3_GetPointerSize(This,pointerSize)\t\\\n    ( (This)->lpVtbl -> GetPointerSize(This,pointerSize) ) \n\n#define ICLRDataTarget3_GetImageBase(This,imagePath,baseAddress)\t\\\n    ( (This)->lpVtbl -> GetImageBase(This,imagePath,baseAddress) ) \n\n#define ICLRDataTarget3_ReadVirtual(This,address,buffer,bytesRequested,bytesRead)\t\\\n    ( (This)->lpVtbl -> ReadVirtual(This,address,buffer,bytesRequested,bytesRead) ) \n\n#define ICLRDataTarget3_WriteVirtual(This,address,buffer,bytesRequested,bytesWritten)\t\\\n    ( (This)->lpVtbl -> WriteVirtual(This,address,buffer,bytesRequested,bytesWritten) ) \n\n#define ICLRDataTarget3_GetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> GetTLSValue(This,threadID,index,value) ) \n\n#define ICLRDataTarget3_SetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> SetTLSValue(This,threadID,index,value) ) \n\n#define ICLRDataTarget3_GetCurrentThreadID(This,threadID)\t\\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,threadID) ) \n\n#define ICLRDataTarget3_GetThreadContext(This,threadID,contextFlags,contextSize,context)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadID,contextFlags,contextSize,context) ) \n\n#define ICLRDataTarget3_SetThreadContext(This,threadID,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) ) \n\n#define ICLRDataTarget3_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n\n#define ICLRDataTarget3_AllocVirtual(This,addr,size,typeFlags,protectFlags,virt)\t\\\n    ( (This)->lpVtbl -> AllocVirtual(This,addr,size,typeFlags,protectFlags,virt) ) \n\n#define ICLRDataTarget3_FreeVirtual(This,addr,size,typeFlags)\t\\\n    ( (This)->lpVtbl -> FreeVirtual(This,addr,size,typeFlags) ) \n\n\n#define ICLRDataTarget3_GetExceptionRecord(This,bufferSize,bufferUsed,buffer)\t\\\n    ( (This)->lpVtbl -> GetExceptionRecord(This,bufferSize,bufferUsed,buffer) ) \n\n#define ICLRDataTarget3_GetExceptionContextRecord(This,bufferSize,bufferUsed,buffer)\t\\\n    ( (This)->lpVtbl -> GetExceptionContextRecord(This,bufferSize,bufferUsed,buffer) ) \n\n#define ICLRDataTarget3_GetExceptionThreadID(This,threadID)\t\\\n    ( (This)->lpVtbl -> GetExceptionThreadID(This,threadID) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDataTarget3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeLocator_INTERFACE_DEFINED__\n#define __ICLRRuntimeLocator_INTERFACE_DEFINED__\n\n/* interface ICLRRuntimeLocator */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRRuntimeLocator;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"b760bf44-9377-4597-8be7-58083bdc5146\")\n    ICLRRuntimeLocator : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetRuntimeBase( \n            /* [out] */ CLRDATA_ADDRESS *baseAddress) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRRuntimeLocatorVtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRRuntimeLocator * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRRuntimeLocator * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRRuntimeLocator * This);\n        \n        DECLSPEC_XFGVIRT(ICLRRuntimeLocator, GetRuntimeBase)\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeBase )( \n            ICLRRuntimeLocator * This,\n            /* [out] */ CLRDATA_ADDRESS *baseAddress);\n        \n        END_INTERFACE\n    } ICLRRuntimeLocatorVtbl;\n\n    interface ICLRRuntimeLocator\n    {\n        CONST_VTBL struct ICLRRuntimeLocatorVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRRuntimeLocator_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRRuntimeLocator_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRRuntimeLocator_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRRuntimeLocator_GetRuntimeBase(This,baseAddress)\t\\\n    ( (This)->lpVtbl -> GetRuntimeBase(This,baseAddress) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRRuntimeLocator_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRMetadataLocator_INTERFACE_DEFINED__\n#define __ICLRMetadataLocator_INTERFACE_DEFINED__\n\n/* interface ICLRMetadataLocator */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRMetadataLocator;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"aa8fa804-bc05-4642-b2c5-c353ed22fc63\")\n    ICLRMetadataLocator : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetMetadata( \n            /* [in] */ LPCWSTR imagePath,\n            /* [in] */ ULONG32 imageTimestamp,\n            /* [in] */ ULONG32 imageSize,\n            /* [in] */ GUID *mvid,\n            /* [in] */ ULONG32 mdRva,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufferSize,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [out] */ ULONG32 *dataSize) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRMetadataLocatorVtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRMetadataLocator * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRMetadataLocator * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRMetadataLocator * This);\n        \n        DECLSPEC_XFGVIRT(ICLRMetadataLocator, GetMetadata)\n        HRESULT ( STDMETHODCALLTYPE *GetMetadata )( \n            ICLRMetadataLocator * This,\n            /* [in] */ LPCWSTR imagePath,\n            /* [in] */ ULONG32 imageTimestamp,\n            /* [in] */ ULONG32 imageSize,\n            /* [in] */ GUID *mvid,\n            /* [in] */ ULONG32 mdRva,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufferSize,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [out] */ ULONG32 *dataSize);\n        \n        END_INTERFACE\n    } ICLRMetadataLocatorVtbl;\n\n    interface ICLRMetadataLocator\n    {\n        CONST_VTBL struct ICLRMetadataLocatorVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRMetadataLocator_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRMetadataLocator_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRMetadataLocator_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRMetadataLocator_GetMetadata(This,imagePath,imageTimestamp,imageSize,mvid,mdRva,flags,bufferSize,buffer,dataSize)\t\\\n    ( (This)->lpVtbl -> GetMetadata(This,imagePath,imageTimestamp,imageSize,mvid,mdRva,flags,bufferSize,buffer,dataSize) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRMetadataLocator_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRDataEnumMemoryRegionsCallback_INTERFACE_DEFINED__\n#define __ICLRDataEnumMemoryRegionsCallback_INTERFACE_DEFINED__\n\n/* interface ICLRDataEnumMemoryRegionsCallback */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRDataEnumMemoryRegionsCallback;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"BCDD6908-BA2D-4ec5-96CF-DF4D5CDCB4A4\")\n    ICLRDataEnumMemoryRegionsCallback : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumMemoryRegion( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 size) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDataEnumMemoryRegionsCallbackVtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDataEnumMemoryRegionsCallback * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDataEnumMemoryRegionsCallback * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDataEnumMemoryRegionsCallback * This);\n        \n        DECLSPEC_XFGVIRT(ICLRDataEnumMemoryRegionsCallback, EnumMemoryRegion)\n        HRESULT ( STDMETHODCALLTYPE *EnumMemoryRegion )( \n            ICLRDataEnumMemoryRegionsCallback * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 size);\n        \n        END_INTERFACE\n    } ICLRDataEnumMemoryRegionsCallbackVtbl;\n\n    interface ICLRDataEnumMemoryRegionsCallback\n    {\n        CONST_VTBL struct ICLRDataEnumMemoryRegionsCallbackVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDataEnumMemoryRegionsCallback_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDataEnumMemoryRegionsCallback_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDataEnumMemoryRegionsCallback_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDataEnumMemoryRegionsCallback_EnumMemoryRegion(This,address,size)\t\\\n    ( (This)->lpVtbl -> EnumMemoryRegion(This,address,size) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDataEnumMemoryRegionsCallback_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRDataEnumMemoryRegionsCallback2_INTERFACE_DEFINED__\n#define __ICLRDataEnumMemoryRegionsCallback2_INTERFACE_DEFINED__\n\n/* interface ICLRDataEnumMemoryRegionsCallback2 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRDataEnumMemoryRegionsCallback2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"3721A26F-8B91-4D98-A388-DB17B356FADB\")\n    ICLRDataEnumMemoryRegionsCallback2 : public ICLRDataEnumMemoryRegionsCallback\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE UpdateMemoryRegion( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 bufferSize,\n            /* [size_is][in] */ BYTE *buffer) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDataEnumMemoryRegionsCallback2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDataEnumMemoryRegionsCallback2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDataEnumMemoryRegionsCallback2 * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDataEnumMemoryRegionsCallback2 * This);\n        \n        DECLSPEC_XFGVIRT(ICLRDataEnumMemoryRegionsCallback, EnumMemoryRegion)\n        HRESULT ( STDMETHODCALLTYPE *EnumMemoryRegion )( \n            ICLRDataEnumMemoryRegionsCallback2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 size);\n        \n        DECLSPEC_XFGVIRT(ICLRDataEnumMemoryRegionsCallback2, UpdateMemoryRegion)\n        HRESULT ( STDMETHODCALLTYPE *UpdateMemoryRegion )( \n            ICLRDataEnumMemoryRegionsCallback2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 bufferSize,\n            /* [size_is][in] */ BYTE *buffer);\n        \n        END_INTERFACE\n    } ICLRDataEnumMemoryRegionsCallback2Vtbl;\n\n    interface ICLRDataEnumMemoryRegionsCallback2\n    {\n        CONST_VTBL struct ICLRDataEnumMemoryRegionsCallback2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDataEnumMemoryRegionsCallback2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDataEnumMemoryRegionsCallback2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDataEnumMemoryRegionsCallback2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDataEnumMemoryRegionsCallback2_EnumMemoryRegion(This,address,size)\t\\\n    ( (This)->lpVtbl -> EnumMemoryRegion(This,address,size) ) \n\n\n#define ICLRDataEnumMemoryRegionsCallback2_UpdateMemoryRegion(This,address,bufferSize,buffer)\t\\\n    ( (This)->lpVtbl -> UpdateMemoryRegion(This,address,bufferSize,buffer) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDataEnumMemoryRegionsCallback2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRDataLoggingCallback_INTERFACE_DEFINED__\n#define __ICLRDataLoggingCallback_INTERFACE_DEFINED__\n\n/* interface ICLRDataLoggingCallback */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRDataLoggingCallback;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"F315248D-8B79-49DB-B184-37426559F703\")\n    ICLRDataLoggingCallback : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE LogMessage( \n            /* [in] */ LPCSTR message) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDataLoggingCallbackVtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDataLoggingCallback * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDataLoggingCallback * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDataLoggingCallback * This);\n        \n        DECLSPEC_XFGVIRT(ICLRDataLoggingCallback, LogMessage)\n        HRESULT ( STDMETHODCALLTYPE *LogMessage )( \n            ICLRDataLoggingCallback * This,\n            /* [in] */ LPCSTR message);\n        \n        END_INTERFACE\n    } ICLRDataLoggingCallbackVtbl;\n\n    interface ICLRDataLoggingCallback\n    {\n        CONST_VTBL struct ICLRDataLoggingCallbackVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDataLoggingCallback_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDataLoggingCallback_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDataLoggingCallback_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDataLoggingCallback_LogMessage(This,message)\t\\\n    ( (This)->lpVtbl -> LogMessage(This,message) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDataLoggingCallback_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_clrdata_0000_0008 */\n/* [local] */ \n\ntypedef \nenum CLRDataEnumMemoryFlags\n    {\n        CLRDATA_ENUM_MEM_DEFAULT\t= 0,\n        CLRDATA_ENUM_MEM_MINI\t= CLRDATA_ENUM_MEM_DEFAULT,\n        CLRDATA_ENUM_MEM_HEAP\t= 0x1,\n        CLRDATA_ENUM_MEM_TRIAGE\t= 0x2,\n        CLRDATA_ENUM_MEM_HEAP2\t= 0x3\n    } \tCLRDataEnumMemoryFlags;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_clrdata_0000_0008_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_clrdata_0000_0008_v0_0_s_ifspec;\n\n#ifndef __ICLRDataEnumMemoryRegions_INTERFACE_DEFINED__\n#define __ICLRDataEnumMemoryRegions_INTERFACE_DEFINED__\n\n/* interface ICLRDataEnumMemoryRegions */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICLRDataEnumMemoryRegions;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"471c35b4-7c2f-4ef0-a945-00f8c38056f1\")\n    ICLRDataEnumMemoryRegions : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumMemoryRegions( \n            /* [in] */ ICLRDataEnumMemoryRegionsCallback *callback,\n            /* [in] */ ULONG32 miniDumpFlags,\n            /* [in] */ CLRDataEnumMemoryFlags clrFlags) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDataEnumMemoryRegionsVtbl\n    {\n        BEGIN_INTERFACE\n        \n        DECLSPEC_XFGVIRT(IUnknown, QueryInterface)\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDataEnumMemoryRegions * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        DECLSPEC_XFGVIRT(IUnknown, AddRef)\n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDataEnumMemoryRegions * This);\n        \n        DECLSPEC_XFGVIRT(IUnknown, Release)\n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDataEnumMemoryRegions * This);\n        \n        DECLSPEC_XFGVIRT(ICLRDataEnumMemoryRegions, EnumMemoryRegions)\n        HRESULT ( STDMETHODCALLTYPE *EnumMemoryRegions )( \n            ICLRDataEnumMemoryRegions * This,\n            /* [in] */ ICLRDataEnumMemoryRegionsCallback *callback,\n            /* [in] */ ULONG32 miniDumpFlags,\n            /* [in] */ CLRDataEnumMemoryFlags clrFlags);\n        \n        END_INTERFACE\n    } ICLRDataEnumMemoryRegionsVtbl;\n\n    interface ICLRDataEnumMemoryRegions\n    {\n        CONST_VTBL struct ICLRDataEnumMemoryRegionsVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDataEnumMemoryRegions_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDataEnumMemoryRegions_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDataEnumMemoryRegions_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDataEnumMemoryRegions_EnumMemoryRegions(This,callback,miniDumpFlags,clrFlags)\t\\\n    ( (This)->lpVtbl -> EnumMemoryRegions(This,callback,miniDumpFlags,clrFlags) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDataEnumMemoryRegions_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/clrinternal.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.00.0603 */\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif // __RPCNDR_H_VERSION__\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __clrinternal_h__\n#define __clrinternal_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __IPrivateManagedExceptionReporting_FWD_DEFINED__\n#define __IPrivateManagedExceptionReporting_FWD_DEFINED__\ntypedef interface IPrivateManagedExceptionReporting IPrivateManagedExceptionReporting;\n\n#endif \t/* __IPrivateManagedExceptionReporting_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n#include \"mscoree.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n/* interface __MIDL_itf_clrinternal_0000_0000 */\n/* [local] */ \n\nEXTERN_GUID(CLR_ID_V4_DESKTOP, 0x267f3989, 0xd786, 0x4b9a, 0x9a, 0xf6, 0xd1, 0x9e, 0x42, 0xd5, 0x57, 0xec);\nEXTERN_GUID(CLR_ID_CORECLR, 0x8CB8E075, 0x0A91, 0x408E, 0x92, 0x28, 0xD6, 0x6E, 0x00, 0xA3, 0xBF, 0xF6 );\nEXTERN_GUID(CLR_ID_PHONE_CLR, 0xE7237E9C, 0x31C0, 0x488C, 0xAD, 0x48, 0x32, 0x4D, 0x3E, 0x7E, 0xD9, 0x2A);\nEXTERN_GUID(CLR_ID_ONECORE_CLR, 0xb1ee760d, 0x6c4a, 0x4533, 0xba, 0x41, 0x6f, 0x4f, 0x66, 0x1f, 0xab, 0xaf);\nEXTERN_GUID(IID_IPrivateManagedExceptionReporting, 0xad76a023, 0x332d, 0x4298, 0x80, 0x01, 0x07, 0xaa, 0x93, 0x50, 0xdc, 0xa4);\ntypedef void *CRITSEC_COOKIE;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_clrinternal_0000_0000_0001\n    {\n        CRST_DEFAULT\t= 0,\n        CRST_REENTRANCY\t= 0x1,\n        CRST_UNSAFE_SAMELEVEL\t= 0x2,\n        CRST_UNSAFE_COOPGC\t= 0x4,\n        CRST_UNSAFE_ANYMODE\t= 0x8,\n        CRST_DEBUGGER_THREAD\t= 0x10,\n        CRST_HOST_BREAKABLE\t= 0x20,\n        CRST_TAKEN_DURING_SHUTDOWN\t= 0x80,\n        CRST_GC_NOTRIGGER_WHEN_TAKEN\t= 0x100,\n        CRST_DEBUG_ONLY_CHECK_FORBID_SUSPEND_THREAD\t= 0x200\n    } \tCrstFlags;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_clrinternal_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_clrinternal_0000_0000_v0_0_s_ifspec;\n\n#ifndef __IPrivateManagedExceptionReporting_INTERFACE_DEFINED__\n#define __IPrivateManagedExceptionReporting_INTERFACE_DEFINED__\n\n/* interface IPrivateManagedExceptionReporting */\n/* [object][local][unique][helpstring][uuid] */ \n\n\nEXTERN_C const IID IID_IPrivateManagedExceptionReporting;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"AD76A023-332D-4298-8001-07AA9350DCA4\")\n    IPrivateManagedExceptionReporting : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetBucketParametersForCurrentException( \n            /* [out] */ BucketParameters *pParams) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IPrivateManagedExceptionReportingVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IPrivateManagedExceptionReporting * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IPrivateManagedExceptionReporting * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IPrivateManagedExceptionReporting * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetBucketParametersForCurrentException )( \n            IPrivateManagedExceptionReporting * This,\n            /* [out] */ BucketParameters *pParams);\n        \n        END_INTERFACE\n    } IPrivateManagedExceptionReportingVtbl;\n\n    interface IPrivateManagedExceptionReporting\n    {\n        CONST_VTBL struct IPrivateManagedExceptionReportingVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IPrivateManagedExceptionReporting_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IPrivateManagedExceptionReporting_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IPrivateManagedExceptionReporting_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IPrivateManagedExceptionReporting_GetBucketParametersForCurrentException(This,pParams)\t\\\n    ( (This)->lpVtbl -> GetBucketParametersForCurrentException(This,pParams) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IPrivateManagedExceptionReporting_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/cordebug.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.01.0622 */\n/* Compiler settings for cordebug.idl:\n    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622\n    protocol : dce , ms_ext, c_ext, robust\n    error checks: allocation ref bounds_check enum stub_data\n    VC __declspec() decoration level:\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\n         DECLSPEC_UUID(), MIDL_INTERFACE()\n*/\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif /* __RPCNDR_H_VERSION__ */\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __cordebug_h__\n#define __cordebug_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */\n\n#ifndef __ICorDebugDataTarget_FWD_DEFINED__\n#define __ICorDebugDataTarget_FWD_DEFINED__\ntypedef interface ICorDebugDataTarget ICorDebugDataTarget;\n\n#endif \t/* __ICorDebugDataTarget_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStaticFieldSymbol_FWD_DEFINED__\n#define __ICorDebugStaticFieldSymbol_FWD_DEFINED__\ntypedef interface ICorDebugStaticFieldSymbol ICorDebugStaticFieldSymbol;\n\n#endif \t/* __ICorDebugStaticFieldSymbol_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugInstanceFieldSymbol_FWD_DEFINED__\n#define __ICorDebugInstanceFieldSymbol_FWD_DEFINED__\ntypedef interface ICorDebugInstanceFieldSymbol ICorDebugInstanceFieldSymbol;\n\n#endif \t/* __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugVariableSymbol_FWD_DEFINED__\n#define __ICorDebugVariableSymbol_FWD_DEFINED__\ntypedef interface ICorDebugVariableSymbol ICorDebugVariableSymbol;\n\n#endif \t/* __ICorDebugVariableSymbol_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugMemoryBuffer_FWD_DEFINED__\n#define __ICorDebugMemoryBuffer_FWD_DEFINED__\ntypedef interface ICorDebugMemoryBuffer ICorDebugMemoryBuffer;\n\n#endif \t/* __ICorDebugMemoryBuffer_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugMergedAssemblyRecord_FWD_DEFINED__\n#define __ICorDebugMergedAssemblyRecord_FWD_DEFINED__\ntypedef interface ICorDebugMergedAssemblyRecord ICorDebugMergedAssemblyRecord;\n\n#endif \t/* __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugSymbolProvider_FWD_DEFINED__\n#define __ICorDebugSymbolProvider_FWD_DEFINED__\ntypedef interface ICorDebugSymbolProvider ICorDebugSymbolProvider;\n\n#endif \t/* __ICorDebugSymbolProvider_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugSymbolProvider2_FWD_DEFINED__\n#define __ICorDebugSymbolProvider2_FWD_DEFINED__\ntypedef interface ICorDebugSymbolProvider2 ICorDebugSymbolProvider2;\n\n#endif \t/* __ICorDebugSymbolProvider2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugVirtualUnwinder_FWD_DEFINED__\n#define __ICorDebugVirtualUnwinder_FWD_DEFINED__\ntypedef interface ICorDebugVirtualUnwinder ICorDebugVirtualUnwinder;\n\n#endif \t/* __ICorDebugVirtualUnwinder_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugDataTarget2_FWD_DEFINED__\n#define __ICorDebugDataTarget2_FWD_DEFINED__\ntypedef interface ICorDebugDataTarget2 ICorDebugDataTarget2;\n\n#endif \t/* __ICorDebugDataTarget2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugLoadedModule_FWD_DEFINED__\n#define __ICorDebugLoadedModule_FWD_DEFINED__\ntypedef interface ICorDebugLoadedModule ICorDebugLoadedModule;\n\n#endif \t/* __ICorDebugLoadedModule_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugDataTarget3_FWD_DEFINED__\n#define __ICorDebugDataTarget3_FWD_DEFINED__\ntypedef interface ICorDebugDataTarget3 ICorDebugDataTarget3;\n\n#endif \t/* __ICorDebugDataTarget3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugDataTarget4_FWD_DEFINED__\n#define __ICorDebugDataTarget4_FWD_DEFINED__\ntypedef interface ICorDebugDataTarget4 ICorDebugDataTarget4;\n\n#endif \t/* __ICorDebugDataTarget4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugMutableDataTarget_FWD_DEFINED__\n#define __ICorDebugMutableDataTarget_FWD_DEFINED__\ntypedef interface ICorDebugMutableDataTarget ICorDebugMutableDataTarget;\n\n#endif \t/* __ICorDebugMutableDataTarget_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugMetaDataLocator_FWD_DEFINED__\n#define __ICorDebugMetaDataLocator_FWD_DEFINED__\ntypedef interface ICorDebugMetaDataLocator ICorDebugMetaDataLocator;\n\n#endif \t/* __ICorDebugMetaDataLocator_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugManagedCallback_FWD_DEFINED__\n#define __ICorDebugManagedCallback_FWD_DEFINED__\ntypedef interface ICorDebugManagedCallback ICorDebugManagedCallback;\n\n#endif \t/* __ICorDebugManagedCallback_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugManagedCallback3_FWD_DEFINED__\n#define __ICorDebugManagedCallback3_FWD_DEFINED__\ntypedef interface ICorDebugManagedCallback3 ICorDebugManagedCallback3;\n\n#endif \t/* __ICorDebugManagedCallback3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugManagedCallback4_FWD_DEFINED__\n#define __ICorDebugManagedCallback4_FWD_DEFINED__\ntypedef interface ICorDebugManagedCallback4 ICorDebugManagedCallback4;\n\n#endif \t/* __ICorDebugManagedCallback4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugManagedCallback2_FWD_DEFINED__\n#define __ICorDebugManagedCallback2_FWD_DEFINED__\ntypedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2;\n\n#endif \t/* __ICorDebugManagedCallback2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugUnmanagedCallback_FWD_DEFINED__\n#define __ICorDebugUnmanagedCallback_FWD_DEFINED__\ntypedef interface ICorDebugUnmanagedCallback ICorDebugUnmanagedCallback;\n\n#endif \t/* __ICorDebugUnmanagedCallback_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebug_FWD_DEFINED__\n#define __ICorDebug_FWD_DEFINED__\ntypedef interface ICorDebug ICorDebug;\n\n#endif \t/* __ICorDebug_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugRemoteTarget_FWD_DEFINED__\n#define __ICorDebugRemoteTarget_FWD_DEFINED__\ntypedef interface ICorDebugRemoteTarget ICorDebugRemoteTarget;\n\n#endif \t/* __ICorDebugRemoteTarget_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugRemote_FWD_DEFINED__\n#define __ICorDebugRemote_FWD_DEFINED__\ntypedef interface ICorDebugRemote ICorDebugRemote;\n\n#endif \t/* __ICorDebugRemote_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebug2_FWD_DEFINED__\n#define __ICorDebug2_FWD_DEFINED__\ntypedef interface ICorDebug2 ICorDebug2;\n\n#endif \t/* __ICorDebug2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugController_FWD_DEFINED__\n#define __ICorDebugController_FWD_DEFINED__\ntypedef interface ICorDebugController ICorDebugController;\n\n#endif \t/* __ICorDebugController_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain_FWD_DEFINED__\n#define __ICorDebugAppDomain_FWD_DEFINED__\ntypedef interface ICorDebugAppDomain ICorDebugAppDomain;\n\n#endif \t/* __ICorDebugAppDomain_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain2_FWD_DEFINED__\n#define __ICorDebugAppDomain2_FWD_DEFINED__\ntypedef interface ICorDebugAppDomain2 ICorDebugAppDomain2;\n\n#endif \t/* __ICorDebugAppDomain2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugEnum_FWD_DEFINED__\n#define __ICorDebugEnum_FWD_DEFINED__\ntypedef interface ICorDebugEnum ICorDebugEnum;\n\n#endif \t/* __ICorDebugEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugGuidToTypeEnum_FWD_DEFINED__\n#define __ICorDebugGuidToTypeEnum_FWD_DEFINED__\ntypedef interface ICorDebugGuidToTypeEnum ICorDebugGuidToTypeEnum;\n\n#endif \t/* __ICorDebugGuidToTypeEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain3_FWD_DEFINED__\n#define __ICorDebugAppDomain3_FWD_DEFINED__\ntypedef interface ICorDebugAppDomain3 ICorDebugAppDomain3;\n\n#endif \t/* __ICorDebugAppDomain3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain4_FWD_DEFINED__\n#define __ICorDebugAppDomain4_FWD_DEFINED__\ntypedef interface ICorDebugAppDomain4 ICorDebugAppDomain4;\n\n#endif \t/* __ICorDebugAppDomain4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAssembly_FWD_DEFINED__\n#define __ICorDebugAssembly_FWD_DEFINED__\ntypedef interface ICorDebugAssembly ICorDebugAssembly;\n\n#endif \t/* __ICorDebugAssembly_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAssembly2_FWD_DEFINED__\n#define __ICorDebugAssembly2_FWD_DEFINED__\ntypedef interface ICorDebugAssembly2 ICorDebugAssembly2;\n\n#endif \t/* __ICorDebugAssembly2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAssembly3_FWD_DEFINED__\n#define __ICorDebugAssembly3_FWD_DEFINED__\ntypedef interface ICorDebugAssembly3 ICorDebugAssembly3;\n\n#endif \t/* __ICorDebugAssembly3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapEnum_FWD_DEFINED__\n#define __ICorDebugHeapEnum_FWD_DEFINED__\ntypedef interface ICorDebugHeapEnum ICorDebugHeapEnum;\n\n#endif \t/* __ICorDebugHeapEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapSegmentEnum_FWD_DEFINED__\n#define __ICorDebugHeapSegmentEnum_FWD_DEFINED__\ntypedef interface ICorDebugHeapSegmentEnum ICorDebugHeapSegmentEnum;\n\n#endif \t/* __ICorDebugHeapSegmentEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugGCReferenceEnum_FWD_DEFINED__\n#define __ICorDebugGCReferenceEnum_FWD_DEFINED__\ntypedef interface ICorDebugGCReferenceEnum ICorDebugGCReferenceEnum;\n\n#endif \t/* __ICorDebugGCReferenceEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess_FWD_DEFINED__\n#define __ICorDebugProcess_FWD_DEFINED__\ntypedef interface ICorDebugProcess ICorDebugProcess;\n\n#endif \t/* __ICorDebugProcess_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess2_FWD_DEFINED__\n#define __ICorDebugProcess2_FWD_DEFINED__\ntypedef interface ICorDebugProcess2 ICorDebugProcess2;\n\n#endif \t/* __ICorDebugProcess2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess3_FWD_DEFINED__\n#define __ICorDebugProcess3_FWD_DEFINED__\ntypedef interface ICorDebugProcess3 ICorDebugProcess3;\n\n#endif \t/* __ICorDebugProcess3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess5_FWD_DEFINED__\n#define __ICorDebugProcess5_FWD_DEFINED__\ntypedef interface ICorDebugProcess5 ICorDebugProcess5;\n\n#endif \t/* __ICorDebugProcess5_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugDebugEvent_FWD_DEFINED__\n#define __ICorDebugDebugEvent_FWD_DEFINED__\ntypedef interface ICorDebugDebugEvent ICorDebugDebugEvent;\n\n#endif \t/* __ICorDebugDebugEvent_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess6_FWD_DEFINED__\n#define __ICorDebugProcess6_FWD_DEFINED__\ntypedef interface ICorDebugProcess6 ICorDebugProcess6;\n\n#endif \t/* __ICorDebugProcess6_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess7_FWD_DEFINED__\n#define __ICorDebugProcess7_FWD_DEFINED__\ntypedef interface ICorDebugProcess7 ICorDebugProcess7;\n\n#endif \t/* __ICorDebugProcess7_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess8_FWD_DEFINED__\n#define __ICorDebugProcess8_FWD_DEFINED__\ntypedef interface ICorDebugProcess8 ICorDebugProcess8;\n\n#endif \t/* __ICorDebugProcess8_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess10_FWD_DEFINED__\n#define __ICorDebugProcess10_FWD_DEFINED__\ntypedef interface ICorDebugProcess10 ICorDebugProcess10;\n\n#endif \t/* __ICorDebugProcess10_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugMemoryRangeEnum_FWD_DEFINED__\n#define __ICorDebugMemoryRangeEnum_FWD_DEFINED__\ntypedef interface ICorDebugMemoryRangeEnum ICorDebugMemoryRangeEnum;\n\n#endif \t/* __ICorDebugMemoryRangeEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess11_FWD_DEFINED__\n#define __ICorDebugProcess11_FWD_DEFINED__\ntypedef interface ICorDebugProcess11 ICorDebugProcess11;\n\n#endif \t/* __ICorDebugProcess11_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModuleDebugEvent_FWD_DEFINED__\n#define __ICorDebugModuleDebugEvent_FWD_DEFINED__\ntypedef interface ICorDebugModuleDebugEvent ICorDebugModuleDebugEvent;\n\n#endif \t/* __ICorDebugModuleDebugEvent_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugExceptionDebugEvent_FWD_DEFINED__\n#define __ICorDebugExceptionDebugEvent_FWD_DEFINED__\ntypedef interface ICorDebugExceptionDebugEvent ICorDebugExceptionDebugEvent;\n\n#endif \t/* __ICorDebugExceptionDebugEvent_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugBreakpoint_FWD_DEFINED__\n#define __ICorDebugBreakpoint_FWD_DEFINED__\ntypedef interface ICorDebugBreakpoint ICorDebugBreakpoint;\n\n#endif \t/* __ICorDebugBreakpoint_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFunctionBreakpoint_FWD_DEFINED__\n#define __ICorDebugFunctionBreakpoint_FWD_DEFINED__\ntypedef interface ICorDebugFunctionBreakpoint ICorDebugFunctionBreakpoint;\n\n#endif \t/* __ICorDebugFunctionBreakpoint_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModuleBreakpoint_FWD_DEFINED__\n#define __ICorDebugModuleBreakpoint_FWD_DEFINED__\ntypedef interface ICorDebugModuleBreakpoint ICorDebugModuleBreakpoint;\n\n#endif \t/* __ICorDebugModuleBreakpoint_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugValueBreakpoint_FWD_DEFINED__\n#define __ICorDebugValueBreakpoint_FWD_DEFINED__\ntypedef interface ICorDebugValueBreakpoint ICorDebugValueBreakpoint;\n\n#endif \t/* __ICorDebugValueBreakpoint_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStepper_FWD_DEFINED__\n#define __ICorDebugStepper_FWD_DEFINED__\ntypedef interface ICorDebugStepper ICorDebugStepper;\n\n#endif \t/* __ICorDebugStepper_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStepper2_FWD_DEFINED__\n#define __ICorDebugStepper2_FWD_DEFINED__\ntypedef interface ICorDebugStepper2 ICorDebugStepper2;\n\n#endif \t/* __ICorDebugStepper2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugRegisterSet_FWD_DEFINED__\n#define __ICorDebugRegisterSet_FWD_DEFINED__\ntypedef interface ICorDebugRegisterSet ICorDebugRegisterSet;\n\n#endif \t/* __ICorDebugRegisterSet_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugRegisterSet2_FWD_DEFINED__\n#define __ICorDebugRegisterSet2_FWD_DEFINED__\ntypedef interface ICorDebugRegisterSet2 ICorDebugRegisterSet2;\n\n#endif \t/* __ICorDebugRegisterSet2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThread_FWD_DEFINED__\n#define __ICorDebugThread_FWD_DEFINED__\ntypedef interface ICorDebugThread ICorDebugThread;\n\n#endif \t/* __ICorDebugThread_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThread2_FWD_DEFINED__\n#define __ICorDebugThread2_FWD_DEFINED__\ntypedef interface ICorDebugThread2 ICorDebugThread2;\n\n#endif \t/* __ICorDebugThread2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThread3_FWD_DEFINED__\n#define __ICorDebugThread3_FWD_DEFINED__\ntypedef interface ICorDebugThread3 ICorDebugThread3;\n\n#endif \t/* __ICorDebugThread3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThread4_FWD_DEFINED__\n#define __ICorDebugThread4_FWD_DEFINED__\ntypedef interface ICorDebugThread4 ICorDebugThread4;\n\n#endif \t/* __ICorDebugThread4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThread5_FWD_DEFINED__\n#define __ICorDebugThread5_FWD_DEFINED__\ntypedef interface ICorDebugThread5 ICorDebugThread5;\n\n#endif \t/* __ICorDebugThread5_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStackWalk_FWD_DEFINED__\n#define __ICorDebugStackWalk_FWD_DEFINED__\ntypedef interface ICorDebugStackWalk ICorDebugStackWalk;\n\n#endif \t/* __ICorDebugStackWalk_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugChain_FWD_DEFINED__\n#define __ICorDebugChain_FWD_DEFINED__\ntypedef interface ICorDebugChain ICorDebugChain;\n\n#endif \t/* __ICorDebugChain_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFrame_FWD_DEFINED__\n#define __ICorDebugFrame_FWD_DEFINED__\ntypedef interface ICorDebugFrame ICorDebugFrame;\n\n#endif \t/* __ICorDebugFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugInternalFrame_FWD_DEFINED__\n#define __ICorDebugInternalFrame_FWD_DEFINED__\ntypedef interface ICorDebugInternalFrame ICorDebugInternalFrame;\n\n#endif \t/* __ICorDebugInternalFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugInternalFrame2_FWD_DEFINED__\n#define __ICorDebugInternalFrame2_FWD_DEFINED__\ntypedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2;\n\n#endif \t/* __ICorDebugInternalFrame2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame_FWD_DEFINED__\n#define __ICorDebugILFrame_FWD_DEFINED__\ntypedef interface ICorDebugILFrame ICorDebugILFrame;\n\n#endif \t/* __ICorDebugILFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame2_FWD_DEFINED__\n#define __ICorDebugILFrame2_FWD_DEFINED__\ntypedef interface ICorDebugILFrame2 ICorDebugILFrame2;\n\n#endif \t/* __ICorDebugILFrame2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame3_FWD_DEFINED__\n#define __ICorDebugILFrame3_FWD_DEFINED__\ntypedef interface ICorDebugILFrame3 ICorDebugILFrame3;\n\n#endif \t/* __ICorDebugILFrame3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame4_FWD_DEFINED__\n#define __ICorDebugILFrame4_FWD_DEFINED__\ntypedef interface ICorDebugILFrame4 ICorDebugILFrame4;\n\n#endif \t/* __ICorDebugILFrame4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugNativeFrame_FWD_DEFINED__\n#define __ICorDebugNativeFrame_FWD_DEFINED__\ntypedef interface ICorDebugNativeFrame ICorDebugNativeFrame;\n\n#endif \t/* __ICorDebugNativeFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugNativeFrame2_FWD_DEFINED__\n#define __ICorDebugNativeFrame2_FWD_DEFINED__\ntypedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2;\n\n#endif \t/* __ICorDebugNativeFrame2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModule3_FWD_DEFINED__\n#define __ICorDebugModule3_FWD_DEFINED__\ntypedef interface ICorDebugModule3 ICorDebugModule3;\n\n#endif \t/* __ICorDebugModule3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModule4_FWD_DEFINED__\n#define __ICorDebugModule4_FWD_DEFINED__\ntypedef interface ICorDebugModule4 ICorDebugModule4;\n\n#endif \t/* __ICorDebugModule4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__\n#define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__\ntypedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame;\n\n#endif \t/* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModule_FWD_DEFINED__\n#define __ICorDebugModule_FWD_DEFINED__\ntypedef interface ICorDebugModule ICorDebugModule;\n\n#endif \t/* __ICorDebugModule_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModule2_FWD_DEFINED__\n#define __ICorDebugModule2_FWD_DEFINED__\ntypedef interface ICorDebugModule2 ICorDebugModule2;\n\n#endif \t/* __ICorDebugModule2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction_FWD_DEFINED__\n#define __ICorDebugFunction_FWD_DEFINED__\ntypedef interface ICorDebugFunction ICorDebugFunction;\n\n#endif \t/* __ICorDebugFunction_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction2_FWD_DEFINED__\n#define __ICorDebugFunction2_FWD_DEFINED__\ntypedef interface ICorDebugFunction2 ICorDebugFunction2;\n\n#endif \t/* __ICorDebugFunction2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction3_FWD_DEFINED__\n#define __ICorDebugFunction3_FWD_DEFINED__\ntypedef interface ICorDebugFunction3 ICorDebugFunction3;\n\n#endif \t/* __ICorDebugFunction3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction4_FWD_DEFINED__\n#define __ICorDebugFunction4_FWD_DEFINED__\ntypedef interface ICorDebugFunction4 ICorDebugFunction4;\n\n#endif \t/* __ICorDebugFunction4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugCode_FWD_DEFINED__\n#define __ICorDebugCode_FWD_DEFINED__\ntypedef interface ICorDebugCode ICorDebugCode;\n\n#endif \t/* __ICorDebugCode_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugCode2_FWD_DEFINED__\n#define __ICorDebugCode2_FWD_DEFINED__\ntypedef interface ICorDebugCode2 ICorDebugCode2;\n\n#endif \t/* __ICorDebugCode2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugCode3_FWD_DEFINED__\n#define __ICorDebugCode3_FWD_DEFINED__\ntypedef interface ICorDebugCode3 ICorDebugCode3;\n\n#endif \t/* __ICorDebugCode3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugCode4_FWD_DEFINED__\n#define __ICorDebugCode4_FWD_DEFINED__\ntypedef interface ICorDebugCode4 ICorDebugCode4;\n\n#endif \t/* __ICorDebugCode4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILCode_FWD_DEFINED__\n#define __ICorDebugILCode_FWD_DEFINED__\ntypedef interface ICorDebugILCode ICorDebugILCode;\n\n#endif \t/* __ICorDebugILCode_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILCode2_FWD_DEFINED__\n#define __ICorDebugILCode2_FWD_DEFINED__\ntypedef interface ICorDebugILCode2 ICorDebugILCode2;\n\n#endif \t/* __ICorDebugILCode2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugClass_FWD_DEFINED__\n#define __ICorDebugClass_FWD_DEFINED__\ntypedef interface ICorDebugClass ICorDebugClass;\n\n#endif \t/* __ICorDebugClass_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugClass2_FWD_DEFINED__\n#define __ICorDebugClass2_FWD_DEFINED__\ntypedef interface ICorDebugClass2 ICorDebugClass2;\n\n#endif \t/* __ICorDebugClass2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugEval_FWD_DEFINED__\n#define __ICorDebugEval_FWD_DEFINED__\ntypedef interface ICorDebugEval ICorDebugEval;\n\n#endif \t/* __ICorDebugEval_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugEval2_FWD_DEFINED__\n#define __ICorDebugEval2_FWD_DEFINED__\ntypedef interface ICorDebugEval2 ICorDebugEval2;\n\n#endif \t/* __ICorDebugEval2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugValue_FWD_DEFINED__\n#define __ICorDebugValue_FWD_DEFINED__\ntypedef interface ICorDebugValue ICorDebugValue;\n\n#endif \t/* __ICorDebugValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugValue2_FWD_DEFINED__\n#define __ICorDebugValue2_FWD_DEFINED__\ntypedef interface ICorDebugValue2 ICorDebugValue2;\n\n#endif \t/* __ICorDebugValue2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugValue3_FWD_DEFINED__\n#define __ICorDebugValue3_FWD_DEFINED__\ntypedef interface ICorDebugValue3 ICorDebugValue3;\n\n#endif \t/* __ICorDebugValue3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugGenericValue_FWD_DEFINED__\n#define __ICorDebugGenericValue_FWD_DEFINED__\ntypedef interface ICorDebugGenericValue ICorDebugGenericValue;\n\n#endif \t/* __ICorDebugGenericValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugReferenceValue_FWD_DEFINED__\n#define __ICorDebugReferenceValue_FWD_DEFINED__\ntypedef interface ICorDebugReferenceValue ICorDebugReferenceValue;\n\n#endif \t/* __ICorDebugReferenceValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue_FWD_DEFINED__\n#define __ICorDebugHeapValue_FWD_DEFINED__\ntypedef interface ICorDebugHeapValue ICorDebugHeapValue;\n\n#endif \t/* __ICorDebugHeapValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue2_FWD_DEFINED__\n#define __ICorDebugHeapValue2_FWD_DEFINED__\ntypedef interface ICorDebugHeapValue2 ICorDebugHeapValue2;\n\n#endif \t/* __ICorDebugHeapValue2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue3_FWD_DEFINED__\n#define __ICorDebugHeapValue3_FWD_DEFINED__\ntypedef interface ICorDebugHeapValue3 ICorDebugHeapValue3;\n\n#endif \t/* __ICorDebugHeapValue3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue4_FWD_DEFINED__\n#define __ICorDebugHeapValue4_FWD_DEFINED__\ntypedef interface ICorDebugHeapValue4 ICorDebugHeapValue4;\n\n#endif \t/* __ICorDebugHeapValue4_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugObjectValue_FWD_DEFINED__\n#define __ICorDebugObjectValue_FWD_DEFINED__\ntypedef interface ICorDebugObjectValue ICorDebugObjectValue;\n\n#endif \t/* __ICorDebugObjectValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugObjectValue2_FWD_DEFINED__\n#define __ICorDebugObjectValue2_FWD_DEFINED__\ntypedef interface ICorDebugObjectValue2 ICorDebugObjectValue2;\n\n#endif \t/* __ICorDebugObjectValue2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugDelegateObjectValue_FWD_DEFINED__\n#define __ICorDebugDelegateObjectValue_FWD_DEFINED__\ntypedef interface ICorDebugDelegateObjectValue ICorDebugDelegateObjectValue;\n\n#endif \t/* __ICorDebugDelegateObjectValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugBoxValue_FWD_DEFINED__\n#define __ICorDebugBoxValue_FWD_DEFINED__\ntypedef interface ICorDebugBoxValue ICorDebugBoxValue;\n\n#endif \t/* __ICorDebugBoxValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStringValue_FWD_DEFINED__\n#define __ICorDebugStringValue_FWD_DEFINED__\ntypedef interface ICorDebugStringValue ICorDebugStringValue;\n\n#endif \t/* __ICorDebugStringValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugArrayValue_FWD_DEFINED__\n#define __ICorDebugArrayValue_FWD_DEFINED__\ntypedef interface ICorDebugArrayValue ICorDebugArrayValue;\n\n#endif \t/* __ICorDebugArrayValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugVariableHome_FWD_DEFINED__\n#define __ICorDebugVariableHome_FWD_DEFINED__\ntypedef interface ICorDebugVariableHome ICorDebugVariableHome;\n\n#endif \t/* __ICorDebugVariableHome_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHandleValue_FWD_DEFINED__\n#define __ICorDebugHandleValue_FWD_DEFINED__\ntypedef interface ICorDebugHandleValue ICorDebugHandleValue;\n\n#endif \t/* __ICorDebugHandleValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugContext_FWD_DEFINED__\n#define __ICorDebugContext_FWD_DEFINED__\ntypedef interface ICorDebugContext ICorDebugContext;\n\n#endif \t/* __ICorDebugContext_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugComObjectValue_FWD_DEFINED__\n#define __ICorDebugComObjectValue_FWD_DEFINED__\ntypedef interface ICorDebugComObjectValue ICorDebugComObjectValue;\n\n#endif \t/* __ICorDebugComObjectValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugObjectEnum_FWD_DEFINED__\n#define __ICorDebugObjectEnum_FWD_DEFINED__\ntypedef interface ICorDebugObjectEnum ICorDebugObjectEnum;\n\n#endif \t/* __ICorDebugObjectEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugBreakpointEnum_FWD_DEFINED__\n#define __ICorDebugBreakpointEnum_FWD_DEFINED__\ntypedef interface ICorDebugBreakpointEnum ICorDebugBreakpointEnum;\n\n#endif \t/* __ICorDebugBreakpointEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStepperEnum_FWD_DEFINED__\n#define __ICorDebugStepperEnum_FWD_DEFINED__\ntypedef interface ICorDebugStepperEnum ICorDebugStepperEnum;\n\n#endif \t/* __ICorDebugStepperEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcessEnum_FWD_DEFINED__\n#define __ICorDebugProcessEnum_FWD_DEFINED__\ntypedef interface ICorDebugProcessEnum ICorDebugProcessEnum;\n\n#endif \t/* __ICorDebugProcessEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThreadEnum_FWD_DEFINED__\n#define __ICorDebugThreadEnum_FWD_DEFINED__\ntypedef interface ICorDebugThreadEnum ICorDebugThreadEnum;\n\n#endif \t/* __ICorDebugThreadEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFrameEnum_FWD_DEFINED__\n#define __ICorDebugFrameEnum_FWD_DEFINED__\ntypedef interface ICorDebugFrameEnum ICorDebugFrameEnum;\n\n#endif \t/* __ICorDebugFrameEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugChainEnum_FWD_DEFINED__\n#define __ICorDebugChainEnum_FWD_DEFINED__\ntypedef interface ICorDebugChainEnum ICorDebugChainEnum;\n\n#endif \t/* __ICorDebugChainEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModuleEnum_FWD_DEFINED__\n#define __ICorDebugModuleEnum_FWD_DEFINED__\ntypedef interface ICorDebugModuleEnum ICorDebugModuleEnum;\n\n#endif \t/* __ICorDebugModuleEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugValueEnum_FWD_DEFINED__\n#define __ICorDebugValueEnum_FWD_DEFINED__\ntypedef interface ICorDebugValueEnum ICorDebugValueEnum;\n\n#endif \t/* __ICorDebugValueEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugVariableHomeEnum_FWD_DEFINED__\n#define __ICorDebugVariableHomeEnum_FWD_DEFINED__\ntypedef interface ICorDebugVariableHomeEnum ICorDebugVariableHomeEnum;\n\n#endif \t/* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugCodeEnum_FWD_DEFINED__\n#define __ICorDebugCodeEnum_FWD_DEFINED__\ntypedef interface ICorDebugCodeEnum ICorDebugCodeEnum;\n\n#endif \t/* __ICorDebugCodeEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugTypeEnum_FWD_DEFINED__\n#define __ICorDebugTypeEnum_FWD_DEFINED__\ntypedef interface ICorDebugTypeEnum ICorDebugTypeEnum;\n\n#endif \t/* __ICorDebugTypeEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugType_FWD_DEFINED__\n#define __ICorDebugType_FWD_DEFINED__\ntypedef interface ICorDebugType ICorDebugType;\n\n#endif \t/* __ICorDebugType_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugType2_FWD_DEFINED__\n#define __ICorDebugType2_FWD_DEFINED__\ntypedef interface ICorDebugType2 ICorDebugType2;\n\n#endif \t/* __ICorDebugType2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugErrorInfoEnum_FWD_DEFINED__\n#define __ICorDebugErrorInfoEnum_FWD_DEFINED__\ntypedef interface ICorDebugErrorInfoEnum ICorDebugErrorInfoEnum;\n\n#endif \t/* __ICorDebugErrorInfoEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomainEnum_FWD_DEFINED__\n#define __ICorDebugAppDomainEnum_FWD_DEFINED__\ntypedef interface ICorDebugAppDomainEnum ICorDebugAppDomainEnum;\n\n#endif \t/* __ICorDebugAppDomainEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAssemblyEnum_FWD_DEFINED__\n#define __ICorDebugAssemblyEnum_FWD_DEFINED__\ntypedef interface ICorDebugAssemblyEnum ICorDebugAssemblyEnum;\n\n#endif \t/* __ICorDebugAssemblyEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugBlockingObjectEnum_FWD_DEFINED__\n#define __ICorDebugBlockingObjectEnum_FWD_DEFINED__\ntypedef interface ICorDebugBlockingObjectEnum ICorDebugBlockingObjectEnum;\n\n#endif \t/* __ICorDebugBlockingObjectEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugMDA_FWD_DEFINED__\n#define __ICorDebugMDA_FWD_DEFINED__\ntypedef interface ICorDebugMDA ICorDebugMDA;\n\n#endif \t/* __ICorDebugMDA_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__\n#define __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__\ntypedef interface ICorDebugEditAndContinueErrorInfo ICorDebugEditAndContinueErrorInfo;\n\n#endif \t/* __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__\n#define __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__\ntypedef interface ICorDebugEditAndContinueSnapshot ICorDebugEditAndContinueSnapshot;\n\n#endif \t/* __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__\n#define __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__\ntypedef interface ICorDebugExceptionObjectCallStackEnum ICorDebugExceptionObjectCallStackEnum;\n\n#endif \t/* __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugExceptionObjectValue_FWD_DEFINED__\n#define __ICorDebugExceptionObjectValue_FWD_DEFINED__\ntypedef interface ICorDebugExceptionObjectValue ICorDebugExceptionObjectValue;\n\n#endif \t/* __ICorDebugExceptionObjectValue_FWD_DEFINED__ */\n\n\n#ifndef __CorDebug_FWD_DEFINED__\n#define __CorDebug_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorDebug CorDebug;\n#else\ntypedef struct CorDebug CorDebug;\n#endif /* __cplusplus */\n\n#endif \t/* __CorDebug_FWD_DEFINED__ */\n\n\n#ifndef __EmbeddedCLRCorDebug_FWD_DEFINED__\n#define __EmbeddedCLRCorDebug_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class EmbeddedCLRCorDebug EmbeddedCLRCorDebug;\n#else\ntypedef struct EmbeddedCLRCorDebug EmbeddedCLRCorDebug;\n#endif /* __cplusplus */\n\n#endif \t/* __EmbeddedCLRCorDebug_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugValue_FWD_DEFINED__\n#define __ICorDebugValue_FWD_DEFINED__\ntypedef interface ICorDebugValue ICorDebugValue;\n\n#endif \t/* __ICorDebugValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugReferenceValue_FWD_DEFINED__\n#define __ICorDebugReferenceValue_FWD_DEFINED__\ntypedef interface ICorDebugReferenceValue ICorDebugReferenceValue;\n\n#endif \t/* __ICorDebugReferenceValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue_FWD_DEFINED__\n#define __ICorDebugHeapValue_FWD_DEFINED__\ntypedef interface ICorDebugHeapValue ICorDebugHeapValue;\n\n#endif \t/* __ICorDebugHeapValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStringValue_FWD_DEFINED__\n#define __ICorDebugStringValue_FWD_DEFINED__\ntypedef interface ICorDebugStringValue ICorDebugStringValue;\n\n#endif \t/* __ICorDebugStringValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugGenericValue_FWD_DEFINED__\n#define __ICorDebugGenericValue_FWD_DEFINED__\ntypedef interface ICorDebugGenericValue ICorDebugGenericValue;\n\n#endif \t/* __ICorDebugGenericValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugBoxValue_FWD_DEFINED__\n#define __ICorDebugBoxValue_FWD_DEFINED__\ntypedef interface ICorDebugBoxValue ICorDebugBoxValue;\n\n#endif \t/* __ICorDebugBoxValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugArrayValue_FWD_DEFINED__\n#define __ICorDebugArrayValue_FWD_DEFINED__\ntypedef interface ICorDebugArrayValue ICorDebugArrayValue;\n\n#endif \t/* __ICorDebugArrayValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFrame_FWD_DEFINED__\n#define __ICorDebugFrame_FWD_DEFINED__\ntypedef interface ICorDebugFrame ICorDebugFrame;\n\n#endif \t/* __ICorDebugFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame_FWD_DEFINED__\n#define __ICorDebugILFrame_FWD_DEFINED__\ntypedef interface ICorDebugILFrame ICorDebugILFrame;\n\n#endif \t/* __ICorDebugILFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugInternalFrame_FWD_DEFINED__\n#define __ICorDebugInternalFrame_FWD_DEFINED__\ntypedef interface ICorDebugInternalFrame ICorDebugInternalFrame;\n\n#endif \t/* __ICorDebugInternalFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugInternalFrame2_FWD_DEFINED__\n#define __ICorDebugInternalFrame2_FWD_DEFINED__\ntypedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2;\n\n#endif \t/* __ICorDebugInternalFrame2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugNativeFrame_FWD_DEFINED__\n#define __ICorDebugNativeFrame_FWD_DEFINED__\ntypedef interface ICorDebugNativeFrame ICorDebugNativeFrame;\n\n#endif \t/* __ICorDebugNativeFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugNativeFrame2_FWD_DEFINED__\n#define __ICorDebugNativeFrame2_FWD_DEFINED__\ntypedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2;\n\n#endif \t/* __ICorDebugNativeFrame2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__\n#define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__\ntypedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame;\n\n#endif \t/* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugManagedCallback2_FWD_DEFINED__\n#define __ICorDebugManagedCallback2_FWD_DEFINED__\ntypedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2;\n\n#endif \t/* __ICorDebugManagedCallback2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain2_FWD_DEFINED__\n#define __ICorDebugAppDomain2_FWD_DEFINED__\ntypedef interface ICorDebugAppDomain2 ICorDebugAppDomain2;\n\n#endif \t/* __ICorDebugAppDomain2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain3_FWD_DEFINED__\n#define __ICorDebugAppDomain3_FWD_DEFINED__\ntypedef interface ICorDebugAppDomain3 ICorDebugAppDomain3;\n\n#endif \t/* __ICorDebugAppDomain3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugAssembly2_FWD_DEFINED__\n#define __ICorDebugAssembly2_FWD_DEFINED__\ntypedef interface ICorDebugAssembly2 ICorDebugAssembly2;\n\n#endif \t/* __ICorDebugAssembly2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess2_FWD_DEFINED__\n#define __ICorDebugProcess2_FWD_DEFINED__\ntypedef interface ICorDebugProcess2 ICorDebugProcess2;\n\n#endif \t/* __ICorDebugProcess2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugStepper2_FWD_DEFINED__\n#define __ICorDebugStepper2_FWD_DEFINED__\ntypedef interface ICorDebugStepper2 ICorDebugStepper2;\n\n#endif \t/* __ICorDebugStepper2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThread2_FWD_DEFINED__\n#define __ICorDebugThread2_FWD_DEFINED__\ntypedef interface ICorDebugThread2 ICorDebugThread2;\n\n#endif \t/* __ICorDebugThread2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugThread3_FWD_DEFINED__\n#define __ICorDebugThread3_FWD_DEFINED__\ntypedef interface ICorDebugThread3 ICorDebugThread3;\n\n#endif \t/* __ICorDebugThread3_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame2_FWD_DEFINED__\n#define __ICorDebugILFrame2_FWD_DEFINED__\ntypedef interface ICorDebugILFrame2 ICorDebugILFrame2;\n\n#endif \t/* __ICorDebugILFrame2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModule2_FWD_DEFINED__\n#define __ICorDebugModule2_FWD_DEFINED__\ntypedef interface ICorDebugModule2 ICorDebugModule2;\n\n#endif \t/* __ICorDebugModule2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction2_FWD_DEFINED__\n#define __ICorDebugFunction2_FWD_DEFINED__\ntypedef interface ICorDebugFunction2 ICorDebugFunction2;\n\n#endif \t/* __ICorDebugFunction2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugClass2_FWD_DEFINED__\n#define __ICorDebugClass2_FWD_DEFINED__\ntypedef interface ICorDebugClass2 ICorDebugClass2;\n\n#endif \t/* __ICorDebugClass2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugEval2_FWD_DEFINED__\n#define __ICorDebugEval2_FWD_DEFINED__\ntypedef interface ICorDebugEval2 ICorDebugEval2;\n\n#endif \t/* __ICorDebugEval2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugValue2_FWD_DEFINED__\n#define __ICorDebugValue2_FWD_DEFINED__\ntypedef interface ICorDebugValue2 ICorDebugValue2;\n\n#endif \t/* __ICorDebugValue2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugObjectValue2_FWD_DEFINED__\n#define __ICorDebugObjectValue2_FWD_DEFINED__\ntypedef interface ICorDebugObjectValue2 ICorDebugObjectValue2;\n\n#endif \t/* __ICorDebugObjectValue2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHandleValue_FWD_DEFINED__\n#define __ICorDebugHandleValue_FWD_DEFINED__\ntypedef interface ICorDebugHandleValue ICorDebugHandleValue;\n\n#endif \t/* __ICorDebugHandleValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue2_FWD_DEFINED__\n#define __ICorDebugHeapValue2_FWD_DEFINED__\ntypedef interface ICorDebugHeapValue2 ICorDebugHeapValue2;\n\n#endif \t/* __ICorDebugHeapValue2_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugComObjectValue_FWD_DEFINED__\n#define __ICorDebugComObjectValue_FWD_DEFINED__\ntypedef interface ICorDebugComObjectValue ICorDebugComObjectValue;\n\n#endif \t/* __ICorDebugComObjectValue_FWD_DEFINED__ */\n\n\n#ifndef __ICorDebugModule3_FWD_DEFINED__\n#define __ICorDebugModule3_FWD_DEFINED__\ntypedef interface ICorDebugModule3 ICorDebugModule3;\n\n#endif \t/* __ICorDebugModule3_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n#include \"objidl.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\n\n/* interface __MIDL_itf_cordebug_0000_0000 */\n/* [local] */\n\n#if 0\ntypedef UINT32 mdToken;\n\ntypedef mdToken mdModule;\n\ntypedef SIZE_T mdScope;\n\ntypedef mdToken mdTypeDef;\n\ntypedef mdToken mdSourceFile;\n\ntypedef mdToken mdMemberRef;\n\ntypedef mdToken mdMethodDef;\n\ntypedef mdToken mdFieldDef;\n\ntypedef mdToken mdSignature;\n\ntypedef ULONG CorElementType;\n\ntypedef SIZE_T PCCOR_SIGNATURE;\n\ntypedef SIZE_T LPDEBUG_EVENT;\n\ntypedef SIZE_T LPSTARTUPINFOW;\n\ntypedef SIZE_T LPPROCESS_INFORMATION;\n\ntypedef const void *LPCVOID;\n\n#endif\ntypedef /* [wire_marshal] */ void *HPROCESS;\n\ntypedef /* [wire_marshal] */ void *HTHREAD;\n\ntypedef UINT64 TASKID;\n\ntypedef DWORD CONNID;\n\n#ifndef _COR_IL_MAP\n#define _COR_IL_MAP\ntypedef struct _COR_IL_MAP\n    {\n    ULONG32 oldOffset;\n    ULONG32 newOffset;\n    BOOL fAccurate;\n    } \tCOR_IL_MAP;\n\n#endif //_COR_IL_MAP\n#ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_\n#define _COR_DEBUG_IL_TO_NATIVE_MAP_\ntypedef\nenum CorDebugIlToNativeMappingTypes\n    {\n        NO_MAPPING\t= -1,\n        PROLOG\t= -2,\n        EPILOG\t= -3\n    } \tCorDebugIlToNativeMappingTypes;\n\ntypedef struct COR_DEBUG_IL_TO_NATIVE_MAP\n    {\n    ULONG32 ilOffset;\n    ULONG32 nativeStartOffset;\n    ULONG32 nativeEndOffset;\n    } \tCOR_DEBUG_IL_TO_NATIVE_MAP;\n\n#endif // _COR_DEBUG_IL_TO_NATIVE_MAP_\n#define REMOTE_DEBUGGING_DLL_ENTRY L\"Software\\\\Microsoft\\\\.NETFramework\\\\Debugger\\\\ActivateRemoteDebugging\"\ntypedef\nenum CorDebugJITCompilerFlags\n    {\n        CORDEBUG_JIT_DEFAULT\t= 0x1,\n        CORDEBUG_JIT_DISABLE_OPTIMIZATION\t= 0x3,\n        CORDEBUG_JIT_ENABLE_ENC\t= 0x7\n    } \tCorDebugJITCompilerFlags;\n\ntypedef\nenum CorDebugJITCompilerFlagsDecprecated\n    {\n        CORDEBUG_JIT_TRACK_DEBUG_INFO\t= 0x1\n    } \tCorDebugJITCompilerFlagsDeprecated;\n\ntypedef\nenum CorDebugNGENPolicy\n    {\n        DISABLE_LOCAL_NIC\t= 1\n    } \tCorDebugNGENPolicy;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#pragma warning(pop)\ntypedef ULONG64 CORDB_ADDRESS;\n\ntypedef ULONG64 CORDB_REGISTER;\n\ntypedef DWORD CORDB_CONTINUE_STATUS;\n\ntypedef\nenum CorDebugBlockingReason\n    {\n        BLOCKING_NONE\t= 0,\n        BLOCKING_MONITOR_CRITICAL_SECTION\t= 0x1,\n        BLOCKING_MONITOR_EVENT\t= 0x2\n    } \tCorDebugBlockingReason;\n\ntypedef struct CorDebugBlockingObject\n    {\n    ICorDebugValue *pBlockingObject;\n    DWORD dwTimeout;\n    CorDebugBlockingReason blockingReason;\n    } \tCorDebugBlockingObject;\n\ntypedef struct CorDebugExceptionObjectStackFrame\n    {\n    ICorDebugModule *pModule;\n    CORDB_ADDRESS ip;\n    mdMethodDef methodDef;\n    BOOL isLastForeignExceptionFrame;\n    } \tCorDebugExceptionObjectStackFrame;\n\ntypedef struct CorDebugGuidToTypeMapping\n    {\n    GUID iid;\n    ICorDebugType *pType;\n    } \tCorDebugGuidToTypeMapping;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0000_v0_0_s_ifspec;\n\n#ifndef __ICorDebugDataTarget_INTERFACE_DEFINED__\n#define __ICorDebugDataTarget_INTERFACE_DEFINED__\n\n/* interface ICorDebugDataTarget */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugPlatform\n    {\n        CORDB_PLATFORM_WINDOWS_X86\t= 0,\n        CORDB_PLATFORM_WINDOWS_AMD64\t= ( CORDB_PLATFORM_WINDOWS_X86 + 1 ) ,\n        CORDB_PLATFORM_WINDOWS_IA64\t= ( CORDB_PLATFORM_WINDOWS_AMD64 + 1 ) ,\n        CORDB_PLATFORM_MAC_PPC\t= ( CORDB_PLATFORM_WINDOWS_IA64 + 1 ) ,\n        CORDB_PLATFORM_MAC_X86\t= ( CORDB_PLATFORM_MAC_PPC + 1 ) ,\n        CORDB_PLATFORM_WINDOWS_ARM\t= ( CORDB_PLATFORM_MAC_X86 + 1 ) ,\n        CORDB_PLATFORM_MAC_AMD64\t= ( CORDB_PLATFORM_WINDOWS_ARM + 1 ) ,\n        CORDB_PLATFORM_WINDOWS_ARM64\t= ( CORDB_PLATFORM_MAC_AMD64 + 1 ) ,\n        CORDB_PLATFORM_POSIX_AMD64\t= ( CORDB_PLATFORM_WINDOWS_ARM64 + 1 ) ,\n        CORDB_PLATFORM_POSIX_X86\t= ( CORDB_PLATFORM_POSIX_AMD64 + 1 ) ,\n        CORDB_PLATFORM_POSIX_ARM\t= ( CORDB_PLATFORM_POSIX_X86 + 1 ) ,\n        CORDB_PLATFORM_POSIX_ARM64\t= ( CORDB_PLATFORM_POSIX_ARM + 1 ) ,\n        CORDB_PLATFORM_POSIX_LOONGARCH64\t= ( CORDB_PLATFORM_POSIX_ARM64 + 1 )\n    } \tCorDebugPlatform;\n\n\nEXTERN_C const IID IID_ICorDebugDataTarget;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FE06DC28-49FB-4636-A4A3-E80DB4AE116C\")\n    ICorDebugDataTarget : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetPlatform(\n            /* [out] */ CorDebugPlatform *pTargetPlatform) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ReadVirtual(\n            /* [in] */ CORDB_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *pBuffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *pBytesRead) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadContext(\n            /* [in] */ DWORD dwThreadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *pContext) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugDataTargetVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugDataTarget * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugDataTarget * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugDataTarget * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPlatform )(\n            ICorDebugDataTarget * This,\n            /* [out] */ CorDebugPlatform *pTargetPlatform);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadVirtual )(\n            ICorDebugDataTarget * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *pBuffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *pBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorDebugDataTarget * This,\n            /* [in] */ DWORD dwThreadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *pContext);\n\n        END_INTERFACE\n    } ICorDebugDataTargetVtbl;\n\n    interface ICorDebugDataTarget\n    {\n        CONST_VTBL struct ICorDebugDataTargetVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugDataTarget_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugDataTarget_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugDataTarget_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugDataTarget_GetPlatform(This,pTargetPlatform)\t\\\n    ( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) )\n\n#define ICorDebugDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead)\t\\\n    ( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) )\n\n#define ICorDebugDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugDataTarget_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__\n#define __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__\n\n/* interface ICorDebugStaticFieldSymbol */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugStaticFieldSymbol;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CBF9DA63-F68D-4BBB-A21C-15A45EAADF5B\")\n    ICorDebugStaticFieldSymbol : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pcbSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAddress(\n            /* [out] */ CORDB_ADDRESS *pRVA) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugStaticFieldSymbolVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugStaticFieldSymbol * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugStaticFieldSymbol * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugStaticFieldSymbol * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugStaticFieldSymbol * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugStaticFieldSymbol * This,\n            /* [out] */ ULONG32 *pcbSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugStaticFieldSymbol * This,\n            /* [out] */ CORDB_ADDRESS *pRVA);\n\n        END_INTERFACE\n    } ICorDebugStaticFieldSymbolVtbl;\n\n    interface ICorDebugStaticFieldSymbol\n    {\n        CONST_VTBL struct ICorDebugStaticFieldSymbolVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugStaticFieldSymbol_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugStaticFieldSymbol_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugStaticFieldSymbol_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugStaticFieldSymbol_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#define ICorDebugStaticFieldSymbol_GetSize(This,pcbSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pcbSize) )\n\n#define ICorDebugStaticFieldSymbol_GetAddress(This,pRVA)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pRVA) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__\n#define __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__\n\n/* interface ICorDebugInstanceFieldSymbol */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugInstanceFieldSymbol;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"A074096B-3ADC-4485-81DA-68C7A4EA52DB\")\n    ICorDebugInstanceFieldSymbol : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pcbSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetOffset(\n            /* [out] */ ULONG32 *pcbOffset) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugInstanceFieldSymbolVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugInstanceFieldSymbol * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugInstanceFieldSymbol * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugInstanceFieldSymbol * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugInstanceFieldSymbol * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugInstanceFieldSymbol * This,\n            /* [out] */ ULONG32 *pcbSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetOffset )(\n            ICorDebugInstanceFieldSymbol * This,\n            /* [out] */ ULONG32 *pcbOffset);\n\n        END_INTERFACE\n    } ICorDebugInstanceFieldSymbolVtbl;\n\n    interface ICorDebugInstanceFieldSymbol\n    {\n        CONST_VTBL struct ICorDebugInstanceFieldSymbolVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugInstanceFieldSymbol_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugInstanceFieldSymbol_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugInstanceFieldSymbol_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugInstanceFieldSymbol_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#define ICorDebugInstanceFieldSymbol_GetSize(This,pcbSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pcbSize) )\n\n#define ICorDebugInstanceFieldSymbol_GetOffset(This,pcbOffset)\t\\\n    ( (This)->lpVtbl -> GetOffset(This,pcbOffset) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugVariableSymbol_INTERFACE_DEFINED__\n#define __ICorDebugVariableSymbol_INTERFACE_DEFINED__\n\n/* interface ICorDebugVariableSymbol */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugVariableSymbol;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"707E8932-1163-48D9-8A93-F5B1F480FBB7\")\n    ICorDebugVariableSymbol : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pcbValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetValue(\n            /* [in] */ ULONG32 offset,\n            /* [in] */ ULONG32 cbContext,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 cbValue,\n            /* [out] */ ULONG32 *pcbValue,\n            /* [length_is][size_is][out] */ BYTE pValue[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetValue(\n            /* [in] */ ULONG32 offset,\n            /* [in] */ DWORD threadID,\n            /* [in] */ ULONG32 cbContext,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 cbValue,\n            /* [size_is][in] */ BYTE pValue[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSlotIndex(\n            /* [out] */ ULONG32 *pSlotIndex) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugVariableSymbolVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugVariableSymbol * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugVariableSymbol * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugVariableSymbol * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugVariableSymbol * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugVariableSymbol * This,\n            /* [out] */ ULONG32 *pcbValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetValue )(\n            ICorDebugVariableSymbol * This,\n            /* [in] */ ULONG32 offset,\n            /* [in] */ ULONG32 cbContext,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 cbValue,\n            /* [out] */ ULONG32 *pcbValue,\n            /* [length_is][size_is][out] */ BYTE pValue[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetValue )(\n            ICorDebugVariableSymbol * This,\n            /* [in] */ ULONG32 offset,\n            /* [in] */ DWORD threadID,\n            /* [in] */ ULONG32 cbContext,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 cbValue,\n            /* [size_is][in] */ BYTE pValue[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSlotIndex )(\n            ICorDebugVariableSymbol * This,\n            /* [out] */ ULONG32 *pSlotIndex);\n\n        END_INTERFACE\n    } ICorDebugVariableSymbolVtbl;\n\n    interface ICorDebugVariableSymbol\n    {\n        CONST_VTBL struct ICorDebugVariableSymbolVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugVariableSymbol_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugVariableSymbol_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugVariableSymbol_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugVariableSymbol_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#define ICorDebugVariableSymbol_GetSize(This,pcbValue)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pcbValue) )\n\n#define ICorDebugVariableSymbol_GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue)\t\\\n    ( (This)->lpVtbl -> GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) )\n\n#define ICorDebugVariableSymbol_SetValue(This,offset,threadID,cbContext,context,cbValue,pValue)\t\\\n    ( (This)->lpVtbl -> SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) )\n\n#define ICorDebugVariableSymbol_GetSlotIndex(This,pSlotIndex)\t\\\n    ( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugVariableSymbol_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugMemoryBuffer_INTERFACE_DEFINED__\n#define __ICorDebugMemoryBuffer_INTERFACE_DEFINED__\n\n/* interface ICorDebugMemoryBuffer */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugMemoryBuffer;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"677888B3-D160-4B8C-A73B-D79E6AAA1D13\")\n    ICorDebugMemoryBuffer : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetStartAddress(\n            /* [out] */ LPCVOID *address) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pcbBufferLength) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugMemoryBufferVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugMemoryBuffer * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugMemoryBuffer * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugMemoryBuffer * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStartAddress )(\n            ICorDebugMemoryBuffer * This,\n            /* [out] */ LPCVOID *address);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugMemoryBuffer * This,\n            /* [out] */ ULONG32 *pcbBufferLength);\n\n        END_INTERFACE\n    } ICorDebugMemoryBufferVtbl;\n\n    interface ICorDebugMemoryBuffer\n    {\n        CONST_VTBL struct ICorDebugMemoryBufferVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugMemoryBuffer_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugMemoryBuffer_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugMemoryBuffer_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugMemoryBuffer_GetStartAddress(This,address)\t\\\n    ( (This)->lpVtbl -> GetStartAddress(This,address) )\n\n#define ICorDebugMemoryBuffer_GetSize(This,pcbBufferLength)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pcbBufferLength) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__\n#define __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__\n\n/* interface ICorDebugMergedAssemblyRecord */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugMergedAssemblyRecord;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FAA8637B-3BBE-4671-8E26-3B59875B922A\")\n    ICorDebugMergedAssemblyRecord : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetSimpleName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetVersion(\n            /* [out] */ USHORT *pMajor,\n            /* [out] */ USHORT *pMinor,\n            /* [out] */ USHORT *pBuild,\n            /* [out] */ USHORT *pRevision) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCulture(\n            /* [in] */ ULONG32 cchCulture,\n            /* [out] */ ULONG32 *pcchCulture,\n            /* [length_is][size_is][out] */ WCHAR szCulture[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetPublicKey(\n            /* [in] */ ULONG32 cbPublicKey,\n            /* [out] */ ULONG32 *pcbPublicKey,\n            /* [length_is][size_is][out] */ BYTE pbPublicKey[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetPublicKeyToken(\n            /* [in] */ ULONG32 cbPublicKeyToken,\n            /* [out] */ ULONG32 *pcbPublicKeyToken,\n            /* [length_is][size_is][out] */ BYTE pbPublicKeyToken[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetIndex(\n            /* [out] */ ULONG32 *pIndex) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugMergedAssemblyRecordVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugMergedAssemblyRecord * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugMergedAssemblyRecord * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugMergedAssemblyRecord * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSimpleName )(\n            ICorDebugMergedAssemblyRecord * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVersion )(\n            ICorDebugMergedAssemblyRecord * This,\n            /* [out] */ USHORT *pMajor,\n            /* [out] */ USHORT *pMinor,\n            /* [out] */ USHORT *pBuild,\n            /* [out] */ USHORT *pRevision);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCulture )(\n            ICorDebugMergedAssemblyRecord * This,\n            /* [in] */ ULONG32 cchCulture,\n            /* [out] */ ULONG32 *pcchCulture,\n            /* [length_is][size_is][out] */ WCHAR szCulture[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPublicKey )(\n            ICorDebugMergedAssemblyRecord * This,\n            /* [in] */ ULONG32 cbPublicKey,\n            /* [out] */ ULONG32 *pcbPublicKey,\n            /* [length_is][size_is][out] */ BYTE pbPublicKey[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPublicKeyToken )(\n            ICorDebugMergedAssemblyRecord * This,\n            /* [in] */ ULONG32 cbPublicKeyToken,\n            /* [out] */ ULONG32 *pcbPublicKeyToken,\n            /* [length_is][size_is][out] */ BYTE pbPublicKeyToken[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetIndex )(\n            ICorDebugMergedAssemblyRecord * This,\n            /* [out] */ ULONG32 *pIndex);\n\n        END_INTERFACE\n    } ICorDebugMergedAssemblyRecordVtbl;\n\n    interface ICorDebugMergedAssemblyRecord\n    {\n        CONST_VTBL struct ICorDebugMergedAssemblyRecordVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugMergedAssemblyRecord_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugMergedAssemblyRecord_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugMergedAssemblyRecord_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugMergedAssemblyRecord_GetSimpleName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetSimpleName(This,cchName,pcchName,szName) )\n\n#define ICorDebugMergedAssemblyRecord_GetVersion(This,pMajor,pMinor,pBuild,pRevision)\t\\\n    ( (This)->lpVtbl -> GetVersion(This,pMajor,pMinor,pBuild,pRevision) )\n\n#define ICorDebugMergedAssemblyRecord_GetCulture(This,cchCulture,pcchCulture,szCulture)\t\\\n    ( (This)->lpVtbl -> GetCulture(This,cchCulture,pcchCulture,szCulture) )\n\n#define ICorDebugMergedAssemblyRecord_GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey)\t\\\n    ( (This)->lpVtbl -> GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) )\n\n#define ICorDebugMergedAssemblyRecord_GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken)\t\\\n    ( (This)->lpVtbl -> GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) )\n\n#define ICorDebugMergedAssemblyRecord_GetIndex(This,pIndex)\t\\\n    ( (This)->lpVtbl -> GetIndex(This,pIndex) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugSymbolProvider_INTERFACE_DEFINED__\n#define __ICorDebugSymbolProvider_INTERFACE_DEFINED__\n\n/* interface ICorDebugSymbolProvider */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugSymbolProvider;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3948A999-FD8A-4C38-A708-8A71E9B04DBB\")\n    ICorDebugSymbolProvider : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetStaticFieldSymbols(\n            /* [in] */ ULONG32 cbSignature,\n            /* [size_is][in] */ BYTE typeSig[  ],\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugStaticFieldSymbol *pSymbols[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetInstanceFieldSymbols(\n            /* [in] */ ULONG32 cbSignature,\n            /* [size_is][in] */ BYTE typeSig[  ],\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugInstanceFieldSymbol *pSymbols[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodLocalSymbols(\n            /* [in] */ ULONG32 nativeRVA,\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugVariableSymbol *pSymbols[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodParameterSymbols(\n            /* [in] */ ULONG32 nativeRVA,\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugVariableSymbol *pSymbols[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMergedAssemblyRecords(\n            /* [in] */ ULONG32 cRequestedRecords,\n            /* [out] */ ULONG32 *pcFetchedRecords,\n            /* [length_is][size_is][out] */ ICorDebugMergedAssemblyRecord *pRecords[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodProps(\n            /* [in] */ ULONG32 codeRva,\n            /* [out] */ mdToken *pMethodToken,\n            /* [out] */ ULONG32 *pcGenericParams,\n            /* [in] */ ULONG32 cbSignature,\n            /* [out] */ ULONG32 *pcbSignature,\n            /* [length_is][size_is][out] */ BYTE signature[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTypeProps(\n            /* [in] */ ULONG32 vtableRva,\n            /* [in] */ ULONG32 cbSignature,\n            /* [out] */ ULONG32 *pcbSignature,\n            /* [length_is][size_is][out] */ BYTE signature[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeRange(\n            /* [in] */ ULONG32 codeRva,\n            /* [out] */ ULONG32 *pCodeStartAddress,\n            ULONG32 *pCodeSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyImageBytes(\n            /* [in] */ CORDB_ADDRESS rva,\n            /* [in] */ ULONG32 length,\n            /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectSize(\n            /* [in] */ ULONG32 cbSignature,\n            /* [size_is][in] */ BYTE typeSig[  ],\n            /* [out] */ ULONG32 *pObjectSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyImageMetadata(\n            /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugSymbolProviderVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugSymbolProvider * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugSymbolProvider * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldSymbols )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 cbSignature,\n            /* [size_is][in] */ BYTE typeSig[  ],\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugStaticFieldSymbol *pSymbols[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInstanceFieldSymbols )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 cbSignature,\n            /* [size_is][in] */ BYTE typeSig[  ],\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugInstanceFieldSymbol *pSymbols[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodLocalSymbols )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 nativeRVA,\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugVariableSymbol *pSymbols[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodParameterSymbols )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 nativeRVA,\n            /* [in] */ ULONG32 cRequestedSymbols,\n            /* [out] */ ULONG32 *pcFetchedSymbols,\n            /* [length_is][size_is][out] */ ICorDebugVariableSymbol *pSymbols[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMergedAssemblyRecords )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 cRequestedRecords,\n            /* [out] */ ULONG32 *pcFetchedRecords,\n            /* [length_is][size_is][out] */ ICorDebugMergedAssemblyRecord *pRecords[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodProps )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 codeRva,\n            /* [out] */ mdToken *pMethodToken,\n            /* [out] */ ULONG32 *pcGenericParams,\n            /* [in] */ ULONG32 cbSignature,\n            /* [out] */ ULONG32 *pcbSignature,\n            /* [length_is][size_is][out] */ BYTE signature[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTypeProps )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 vtableRva,\n            /* [in] */ ULONG32 cbSignature,\n            /* [out] */ ULONG32 *pcbSignature,\n            /* [length_is][size_is][out] */ BYTE signature[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeRange )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 codeRva,\n            /* [out] */ ULONG32 *pCodeStartAddress,\n            ULONG32 *pCodeSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyImageBytes )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ CORDB_ADDRESS rva,\n            /* [in] */ ULONG32 length,\n            /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorDebugSymbolProvider * This,\n            /* [in] */ ULONG32 cbSignature,\n            /* [size_is][in] */ BYTE typeSig[  ],\n            /* [out] */ ULONG32 *pObjectSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyImageMetadata )(\n            ICorDebugSymbolProvider * This,\n            /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer);\n\n        END_INTERFACE\n    } ICorDebugSymbolProviderVtbl;\n\n    interface ICorDebugSymbolProvider\n    {\n        CONST_VTBL struct ICorDebugSymbolProviderVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugSymbolProvider_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugSymbolProvider_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugSymbolProvider_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugSymbolProvider_GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols)\t\\\n    ( (This)->lpVtbl -> GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) )\n\n#define ICorDebugSymbolProvider_GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols)\t\\\n    ( (This)->lpVtbl -> GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) )\n\n#define ICorDebugSymbolProvider_GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols)\t\\\n    ( (This)->lpVtbl -> GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) )\n\n#define ICorDebugSymbolProvider_GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols)\t\\\n    ( (This)->lpVtbl -> GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) )\n\n#define ICorDebugSymbolProvider_GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords)\t\\\n    ( (This)->lpVtbl -> GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) )\n\n#define ICorDebugSymbolProvider_GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature)\t\\\n    ( (This)->lpVtbl -> GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) )\n\n#define ICorDebugSymbolProvider_GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature)\t\\\n    ( (This)->lpVtbl -> GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) )\n\n#define ICorDebugSymbolProvider_GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize)\t\\\n    ( (This)->lpVtbl -> GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) )\n\n#define ICorDebugSymbolProvider_GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer)\t\\\n    ( (This)->lpVtbl -> GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) )\n\n#define ICorDebugSymbolProvider_GetObjectSize(This,cbSignature,typeSig,pObjectSize)\t\\\n    ( (This)->lpVtbl -> GetObjectSize(This,cbSignature,typeSig,pObjectSize) )\n\n#define ICorDebugSymbolProvider_GetAssemblyImageMetadata(This,ppMemoryBuffer)\t\\\n    ( (This)->lpVtbl -> GetAssemblyImageMetadata(This,ppMemoryBuffer) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugSymbolProvider_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugSymbolProvider2_INTERFACE_DEFINED__\n#define __ICorDebugSymbolProvider2_INTERFACE_DEFINED__\n\n/* interface ICorDebugSymbolProvider2 */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugSymbolProvider2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F9801807-4764-4330-9E67-4F685094165E\")\n    ICorDebugSymbolProvider2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetGenericDictionaryInfo(\n            /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFrameProps(\n            /* [in] */ ULONG32 codeRva,\n            /* [out] */ ULONG32 *pCodeStartRva,\n            /* [out] */ ULONG32 *pParentFrameStartRva) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugSymbolProvider2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugSymbolProvider2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugSymbolProvider2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugSymbolProvider2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenericDictionaryInfo )(\n            ICorDebugSymbolProvider2 * This,\n            /* [out] */ ICorDebugMemoryBuffer **ppMemoryBuffer);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFrameProps )(\n            ICorDebugSymbolProvider2 * This,\n            /* [in] */ ULONG32 codeRva,\n            /* [out] */ ULONG32 *pCodeStartRva,\n            /* [out] */ ULONG32 *pParentFrameStartRva);\n\n        END_INTERFACE\n    } ICorDebugSymbolProvider2Vtbl;\n\n    interface ICorDebugSymbolProvider2\n    {\n        CONST_VTBL struct ICorDebugSymbolProvider2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugSymbolProvider2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugSymbolProvider2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugSymbolProvider2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugSymbolProvider2_GetGenericDictionaryInfo(This,ppMemoryBuffer)\t\\\n    ( (This)->lpVtbl -> GetGenericDictionaryInfo(This,ppMemoryBuffer) )\n\n#define ICorDebugSymbolProvider2_GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva)\t\\\n    ( (This)->lpVtbl -> GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__\n#define __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__\n\n/* interface ICorDebugVirtualUnwinder */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugVirtualUnwinder;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F69126B7-C787-4F6B-AE96-A569786FC670\")\n    ICorDebugVirtualUnwinder : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetContext(\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 cbContextBuf,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Next( void) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugVirtualUnwinderVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugVirtualUnwinder * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugVirtualUnwinder * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugVirtualUnwinder * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContext )(\n            ICorDebugVirtualUnwinder * This,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 cbContextBuf,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugVirtualUnwinder * This);\n\n        END_INTERFACE\n    } ICorDebugVirtualUnwinderVtbl;\n\n    interface ICorDebugVirtualUnwinder\n    {\n        CONST_VTBL struct ICorDebugVirtualUnwinderVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugVirtualUnwinder_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugVirtualUnwinder_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugVirtualUnwinder_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugVirtualUnwinder_GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf)\t\\\n    ( (This)->lpVtbl -> GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) )\n\n#define ICorDebugVirtualUnwinder_Next(This)\t\\\n    ( (This)->lpVtbl -> Next(This) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugDataTarget2_INTERFACE_DEFINED__\n#define __ICorDebugDataTarget2_INTERFACE_DEFINED__\n\n/* interface ICorDebugDataTarget2 */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugDataTarget2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"2eb364da-605b-4e8d-b333-3394c4828d41\")\n    ICorDebugDataTarget2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetImageFromPointer(\n            /* [in] */ CORDB_ADDRESS addr,\n            /* [out] */ CORDB_ADDRESS *pImageBase,\n            /* [out] */ ULONG32 *pSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetImageLocation(\n            /* [in] */ CORDB_ADDRESS baseAddress,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSymbolProviderForImage(\n            /* [in] */ CORDB_ADDRESS imageBaseAddress,\n            /* [out] */ ICorDebugSymbolProvider **ppSymProvider) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateThreadIDs(\n            /* [in] */ ULONG32 cThreadIds,\n            /* [out] */ ULONG32 *pcThreadIds,\n            /* [length_is][size_is][out] */ ULONG32 pThreadIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateVirtualUnwinder(\n            /* [in] */ DWORD nativeThreadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 cbContext,\n            /* [size_is][in] */ BYTE initialContext[  ],\n            /* [out] */ ICorDebugVirtualUnwinder **ppUnwinder) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugDataTarget2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugDataTarget2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugDataTarget2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugDataTarget2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetImageFromPointer )(\n            ICorDebugDataTarget2 * This,\n            /* [in] */ CORDB_ADDRESS addr,\n            /* [out] */ CORDB_ADDRESS *pImageBase,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetImageLocation )(\n            ICorDebugDataTarget2 * This,\n            /* [in] */ CORDB_ADDRESS baseAddress,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSymbolProviderForImage )(\n            ICorDebugDataTarget2 * This,\n            /* [in] */ CORDB_ADDRESS imageBaseAddress,\n            /* [out] */ ICorDebugSymbolProvider **ppSymProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateThreadIDs )(\n            ICorDebugDataTarget2 * This,\n            /* [in] */ ULONG32 cThreadIds,\n            /* [out] */ ULONG32 *pcThreadIds,\n            /* [length_is][size_is][out] */ ULONG32 pThreadIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateVirtualUnwinder )(\n            ICorDebugDataTarget2 * This,\n            /* [in] */ DWORD nativeThreadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 cbContext,\n            /* [size_is][in] */ BYTE initialContext[  ],\n            /* [out] */ ICorDebugVirtualUnwinder **ppUnwinder);\n\n        END_INTERFACE\n    } ICorDebugDataTarget2Vtbl;\n\n    interface ICorDebugDataTarget2\n    {\n        CONST_VTBL struct ICorDebugDataTarget2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugDataTarget2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugDataTarget2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugDataTarget2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugDataTarget2_GetImageFromPointer(This,addr,pImageBase,pSize)\t\\\n    ( (This)->lpVtbl -> GetImageFromPointer(This,addr,pImageBase,pSize) )\n\n#define ICorDebugDataTarget2_GetImageLocation(This,baseAddress,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetImageLocation(This,baseAddress,cchName,pcchName,szName) )\n\n#define ICorDebugDataTarget2_GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider)\t\\\n    ( (This)->lpVtbl -> GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) )\n\n#define ICorDebugDataTarget2_EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds)\t\\\n    ( (This)->lpVtbl -> EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) )\n\n#define ICorDebugDataTarget2_CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder)\t\\\n    ( (This)->lpVtbl -> CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugDataTarget2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugLoadedModule_INTERFACE_DEFINED__\n#define __ICorDebugLoadedModule_INTERFACE_DEFINED__\n\n/* interface ICorDebugLoadedModule */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugLoadedModule;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"817F343A-6630-4578-96C5-D11BC0EC5EE2\")\n    ICorDebugLoadedModule : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetBaseAddress(\n            /* [out] */ CORDB_ADDRESS *pAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pcBytes) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugLoadedModuleVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugLoadedModule * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugLoadedModule * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugLoadedModule * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBaseAddress )(\n            ICorDebugLoadedModule * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugLoadedModule * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugLoadedModule * This,\n            /* [out] */ ULONG32 *pcBytes);\n\n        END_INTERFACE\n    } ICorDebugLoadedModuleVtbl;\n\n    interface ICorDebugLoadedModule\n    {\n        CONST_VTBL struct ICorDebugLoadedModuleVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugLoadedModule_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugLoadedModule_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugLoadedModule_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugLoadedModule_GetBaseAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetBaseAddress(This,pAddress) )\n\n#define ICorDebugLoadedModule_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#define ICorDebugLoadedModule_GetSize(This,pcBytes)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pcBytes) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugLoadedModule_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugDataTarget3_INTERFACE_DEFINED__\n#define __ICorDebugDataTarget3_INTERFACE_DEFINED__\n\n/* interface ICorDebugDataTarget3 */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugDataTarget3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"D05E60C3-848C-4E7D-894E-623320FF6AFA\")\n    ICorDebugDataTarget3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetLoadedModules(\n            /* [in] */ ULONG32 cRequestedModules,\n            /* [out] */ ULONG32 *pcFetchedModules,\n            /* [length_is][size_is][out] */ ICorDebugLoadedModule *pLoadedModules[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugDataTarget3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugDataTarget3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugDataTarget3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugDataTarget3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLoadedModules )(\n            ICorDebugDataTarget3 * This,\n            /* [in] */ ULONG32 cRequestedModules,\n            /* [out] */ ULONG32 *pcFetchedModules,\n            /* [length_is][size_is][out] */ ICorDebugLoadedModule *pLoadedModules[  ]);\n\n        END_INTERFACE\n    } ICorDebugDataTarget3Vtbl;\n\n    interface ICorDebugDataTarget3\n    {\n        CONST_VTBL struct ICorDebugDataTarget3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugDataTarget3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugDataTarget3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugDataTarget3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugDataTarget3_GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules)\t\\\n    ( (This)->lpVtbl -> GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugDataTarget3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugDataTarget4_INTERFACE_DEFINED__\n#define __ICorDebugDataTarget4_INTERFACE_DEFINED__\n\n/* interface ICorDebugDataTarget4 */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugDataTarget4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"E799DC06-E099-4713-BDD9-906D3CC02CF2\")\n    ICorDebugDataTarget4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE VirtualUnwind(\n            /* [in] */ DWORD threadId,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out][in] */ BYTE *context) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugDataTarget4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugDataTarget4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugDataTarget4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugDataTarget4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *VirtualUnwind )(\n            ICorDebugDataTarget4 * This,\n            /* [in] */ DWORD threadId,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out][in] */ BYTE *context);\n\n        END_INTERFACE\n    } ICorDebugDataTarget4Vtbl;\n\n    interface ICorDebugDataTarget4\n    {\n        CONST_VTBL struct ICorDebugDataTarget4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugDataTarget4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugDataTarget4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugDataTarget4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugDataTarget4_VirtualUnwind(This,threadId,contextSize,context)\t\\\n    ( (This)->lpVtbl -> VirtualUnwind(This,threadId,contextSize,context) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugDataTarget4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugMutableDataTarget_INTERFACE_DEFINED__\n#define __ICorDebugMutableDataTarget_INTERFACE_DEFINED__\n\n/* interface ICorDebugMutableDataTarget */\n/* [unique][local][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorDebugMutableDataTarget;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"A1B8A756-3CB6-4CCB-979F-3DF999673A59\")\n    ICorDebugMutableDataTarget : public ICorDebugDataTarget\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE WriteVirtual(\n            /* [in] */ CORDB_ADDRESS address,\n            /* [size_is][in] */ const BYTE *pBuffer,\n            /* [in] */ ULONG32 bytesRequested) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetThreadContext(\n            /* [in] */ DWORD dwThreadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ const BYTE *pContext) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ContinueStatusChanged(\n            /* [in] */ DWORD dwThreadId,\n            /* [in] */ CORDB_CONTINUE_STATUS continueStatus) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugMutableDataTargetVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugMutableDataTarget * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugMutableDataTarget * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugMutableDataTarget * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPlatform )(\n            ICorDebugMutableDataTarget * This,\n            /* [out] */ CorDebugPlatform *pTargetPlatform);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadVirtual )(\n            ICorDebugMutableDataTarget * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *pBuffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *pBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorDebugMutableDataTarget * This,\n            /* [in] */ DWORD dwThreadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *pContext);\n\n        HRESULT ( STDMETHODCALLTYPE *WriteVirtual )(\n            ICorDebugMutableDataTarget * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [size_is][in] */ const BYTE *pBuffer,\n            /* [in] */ ULONG32 bytesRequested);\n\n        HRESULT ( STDMETHODCALLTYPE *SetThreadContext )(\n            ICorDebugMutableDataTarget * This,\n            /* [in] */ DWORD dwThreadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ const BYTE *pContext);\n\n        HRESULT ( STDMETHODCALLTYPE *ContinueStatusChanged )(\n            ICorDebugMutableDataTarget * This,\n            /* [in] */ DWORD dwThreadId,\n            /* [in] */ CORDB_CONTINUE_STATUS continueStatus);\n\n        END_INTERFACE\n    } ICorDebugMutableDataTargetVtbl;\n\n    interface ICorDebugMutableDataTarget\n    {\n        CONST_VTBL struct ICorDebugMutableDataTargetVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugMutableDataTarget_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugMutableDataTarget_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugMutableDataTarget_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugMutableDataTarget_GetPlatform(This,pTargetPlatform)\t\\\n    ( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) )\n\n#define ICorDebugMutableDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead)\t\\\n    ( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) )\n\n#define ICorDebugMutableDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) )\n\n\n#define ICorDebugMutableDataTarget_WriteVirtual(This,address,pBuffer,bytesRequested)\t\\\n    ( (This)->lpVtbl -> WriteVirtual(This,address,pBuffer,bytesRequested) )\n\n#define ICorDebugMutableDataTarget_SetThreadContext(This,dwThreadID,contextSize,pContext)\t\\\n    ( (This)->lpVtbl -> SetThreadContext(This,dwThreadID,contextSize,pContext) )\n\n#define ICorDebugMutableDataTarget_ContinueStatusChanged(This,dwThreadId,continueStatus)\t\\\n    ( (This)->lpVtbl -> ContinueStatusChanged(This,dwThreadId,continueStatus) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugMetaDataLocator_INTERFACE_DEFINED__\n#define __ICorDebugMetaDataLocator_INTERFACE_DEFINED__\n\n/* interface ICorDebugMetaDataLocator */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugMetaDataLocator;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"7cef8ba9-2ef7-42bf-973f-4171474f87d9\")\n    ICorDebugMetaDataLocator : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetMetaData(\n            /* [in] */ LPCWSTR wszImagePath,\n            /* [in] */ DWORD dwImageTimeStamp,\n            /* [in] */ DWORD dwImageSize,\n            /* [in] */ ULONG32 cchPathBuffer,\n            /* [annotation][out] */\n            _Out_  ULONG32 *pcchPathBuffer,\n            /* [annotation][length_is][size_is][out] */\n            _Out_writes_to_(cchPathBuffer, *pcchPathBuffer)   WCHAR wszPathBuffer[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugMetaDataLocatorVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugMetaDataLocator * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugMetaDataLocator * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugMetaDataLocator * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMetaData )(\n            ICorDebugMetaDataLocator * This,\n            /* [in] */ LPCWSTR wszImagePath,\n            /* [in] */ DWORD dwImageTimeStamp,\n            /* [in] */ DWORD dwImageSize,\n            /* [in] */ ULONG32 cchPathBuffer,\n            /* [annotation][out] */\n            _Out_  ULONG32 *pcchPathBuffer,\n            /* [annotation][length_is][size_is][out] */\n            _Out_writes_to_(cchPathBuffer, *pcchPathBuffer)   WCHAR wszPathBuffer[  ]);\n\n        END_INTERFACE\n    } ICorDebugMetaDataLocatorVtbl;\n\n    interface ICorDebugMetaDataLocator\n    {\n        CONST_VTBL struct ICorDebugMetaDataLocatorVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugMetaDataLocator_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugMetaDataLocator_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugMetaDataLocator_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugMetaDataLocator_GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer)\t\\\n    ( (This)->lpVtbl -> GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0015 */\n/* [local] */\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0015_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0015_v0_0_s_ifspec;\n\n#ifndef __ICorDebugManagedCallback_INTERFACE_DEFINED__\n#define __ICorDebugManagedCallback_INTERFACE_DEFINED__\n\n/* interface ICorDebugManagedCallback */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugStepReason\n    {\n        STEP_NORMAL\t= 0,\n        STEP_RETURN\t= ( STEP_NORMAL + 1 ) ,\n        STEP_CALL\t= ( STEP_RETURN + 1 ) ,\n        STEP_EXCEPTION_FILTER\t= ( STEP_CALL + 1 ) ,\n        STEP_EXCEPTION_HANDLER\t= ( STEP_EXCEPTION_FILTER + 1 ) ,\n        STEP_INTERCEPT\t= ( STEP_EXCEPTION_HANDLER + 1 ) ,\n        STEP_EXIT\t= ( STEP_INTERCEPT + 1 )\n    } \tCorDebugStepReason;\n\ntypedef\nenum LoggingLevelEnum\n    {\n        LTraceLevel0\t= 0,\n        LTraceLevel1\t= ( LTraceLevel0 + 1 ) ,\n        LTraceLevel2\t= ( LTraceLevel1 + 1 ) ,\n        LTraceLevel3\t= ( LTraceLevel2 + 1 ) ,\n        LTraceLevel4\t= ( LTraceLevel3 + 1 ) ,\n        LStatusLevel0\t= 20,\n        LStatusLevel1\t= ( LStatusLevel0 + 1 ) ,\n        LStatusLevel2\t= ( LStatusLevel1 + 1 ) ,\n        LStatusLevel3\t= ( LStatusLevel2 + 1 ) ,\n        LStatusLevel4\t= ( LStatusLevel3 + 1 ) ,\n        LWarningLevel\t= 40,\n        LErrorLevel\t= 50,\n        LPanicLevel\t= 100\n    } \tLoggingLevelEnum;\n\ntypedef\nenum LogSwitchCallReason\n    {\n        SWITCH_CREATE\t= 0,\n        SWITCH_MODIFY\t= ( SWITCH_CREATE + 1 ) ,\n        SWITCH_DELETE\t= ( SWITCH_MODIFY + 1 )\n    } \tLogSwitchCallReason;\n\n\nEXTERN_C const IID IID_ICorDebugManagedCallback;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3d6f5f60-7538-11d3-8d5b-00104b35e7ef\")\n    ICorDebugManagedCallback : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Breakpoint(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugBreakpoint *pBreakpoint) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE StepComplete(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugStepper *pStepper,\n            /* [in] */ CorDebugStepReason reason) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Break(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *thread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Exception(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ BOOL unhandled) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EvalComplete(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugEval *pEval) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EvalException(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugEval *pEval) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateProcess(\n            /* [in] */ ICorDebugProcess *pProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExitProcess(\n            /* [in] */ ICorDebugProcess *pProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateThread(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *thread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExitThread(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *thread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE LoadModule(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugModule *pModule) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE UnloadModule(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugModule *pModule) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE LoadClass(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugClass *c) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE UnloadClass(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugClass *c) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DebuggerError(\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ HRESULT errorHR,\n            /* [in] */ DWORD errorCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE LogMessage(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ LONG lLevel,\n            /* [in] */ WCHAR *pLogSwitchName,\n            /* [in] */ WCHAR *pMessage) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE LogSwitch(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ LONG lLevel,\n            /* [in] */ ULONG ulReason,\n            /* [in] */ WCHAR *pLogSwitchName,\n            /* [in] */ WCHAR *pParentName) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateAppDomain(\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ ICorDebugAppDomain *pAppDomain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExitAppDomain(\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ ICorDebugAppDomain *pAppDomain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE LoadAssembly(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugAssembly *pAssembly) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE UnloadAssembly(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugAssembly *pAssembly) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ControlCTrap(\n            /* [in] */ ICorDebugProcess *pProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NameChange(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE UpdateModuleSymbols(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugModule *pModule,\n            /* [in] */ IStream *pSymbolStream) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EditAndContinueRemap(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFunction *pFunction,\n            /* [in] */ BOOL fAccurate) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE BreakpointSetError(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugBreakpoint *pBreakpoint,\n            /* [in] */ DWORD dwError) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugManagedCallbackVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugManagedCallback * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugManagedCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Breakpoint )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugBreakpoint *pBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *StepComplete )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugStepper *pStepper,\n            /* [in] */ CorDebugStepReason reason);\n\n        HRESULT ( STDMETHODCALLTYPE *Break )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *thread);\n\n        HRESULT ( STDMETHODCALLTYPE *Exception )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ BOOL unhandled);\n\n        HRESULT ( STDMETHODCALLTYPE *EvalComplete )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugEval *pEval);\n\n        HRESULT ( STDMETHODCALLTYPE *EvalException )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugEval *pEval);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateProcess )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugProcess *pProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *ExitProcess )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugProcess *pProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateThread )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *thread);\n\n        HRESULT ( STDMETHODCALLTYPE *ExitThread )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *thread);\n\n        HRESULT ( STDMETHODCALLTYPE *LoadModule )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugModule *pModule);\n\n        HRESULT ( STDMETHODCALLTYPE *UnloadModule )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugModule *pModule);\n\n        HRESULT ( STDMETHODCALLTYPE *LoadClass )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugClass *c);\n\n        HRESULT ( STDMETHODCALLTYPE *UnloadClass )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugClass *c);\n\n        HRESULT ( STDMETHODCALLTYPE *DebuggerError )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ HRESULT errorHR,\n            /* [in] */ DWORD errorCode);\n\n        HRESULT ( STDMETHODCALLTYPE *LogMessage )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ LONG lLevel,\n            /* [in] */ WCHAR *pLogSwitchName,\n            /* [in] */ WCHAR *pMessage);\n\n        HRESULT ( STDMETHODCALLTYPE *LogSwitch )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ LONG lLevel,\n            /* [in] */ ULONG ulReason,\n            /* [in] */ WCHAR *pLogSwitchName,\n            /* [in] */ WCHAR *pParentName);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateAppDomain )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ ICorDebugAppDomain *pAppDomain);\n\n        HRESULT ( STDMETHODCALLTYPE *ExitAppDomain )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ ICorDebugAppDomain *pAppDomain);\n\n        HRESULT ( STDMETHODCALLTYPE *LoadAssembly )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugAssembly *pAssembly);\n\n        HRESULT ( STDMETHODCALLTYPE *UnloadAssembly )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugAssembly *pAssembly);\n\n        HRESULT ( STDMETHODCALLTYPE *ControlCTrap )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugProcess *pProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *NameChange )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread);\n\n        HRESULT ( STDMETHODCALLTYPE *UpdateModuleSymbols )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugModule *pModule,\n            /* [in] */ IStream *pSymbolStream);\n\n        HRESULT ( STDMETHODCALLTYPE *EditAndContinueRemap )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFunction *pFunction,\n            /* [in] */ BOOL fAccurate);\n\n        HRESULT ( STDMETHODCALLTYPE *BreakpointSetError )(\n            ICorDebugManagedCallback * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugBreakpoint *pBreakpoint,\n            /* [in] */ DWORD dwError);\n\n        END_INTERFACE\n    } ICorDebugManagedCallbackVtbl;\n\n    interface ICorDebugManagedCallback\n    {\n        CONST_VTBL struct ICorDebugManagedCallbackVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugManagedCallback_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugManagedCallback_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugManagedCallback_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugManagedCallback_Breakpoint(This,pAppDomain,pThread,pBreakpoint)\t\\\n    ( (This)->lpVtbl -> Breakpoint(This,pAppDomain,pThread,pBreakpoint) )\n\n#define ICorDebugManagedCallback_StepComplete(This,pAppDomain,pThread,pStepper,reason)\t\\\n    ( (This)->lpVtbl -> StepComplete(This,pAppDomain,pThread,pStepper,reason) )\n\n#define ICorDebugManagedCallback_Break(This,pAppDomain,thread)\t\\\n    ( (This)->lpVtbl -> Break(This,pAppDomain,thread) )\n\n#define ICorDebugManagedCallback_Exception(This,pAppDomain,pThread,unhandled)\t\\\n    ( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,unhandled) )\n\n#define ICorDebugManagedCallback_EvalComplete(This,pAppDomain,pThread,pEval)\t\\\n    ( (This)->lpVtbl -> EvalComplete(This,pAppDomain,pThread,pEval) )\n\n#define ICorDebugManagedCallback_EvalException(This,pAppDomain,pThread,pEval)\t\\\n    ( (This)->lpVtbl -> EvalException(This,pAppDomain,pThread,pEval) )\n\n#define ICorDebugManagedCallback_CreateProcess(This,pProcess)\t\\\n    ( (This)->lpVtbl -> CreateProcess(This,pProcess) )\n\n#define ICorDebugManagedCallback_ExitProcess(This,pProcess)\t\\\n    ( (This)->lpVtbl -> ExitProcess(This,pProcess) )\n\n#define ICorDebugManagedCallback_CreateThread(This,pAppDomain,thread)\t\\\n    ( (This)->lpVtbl -> CreateThread(This,pAppDomain,thread) )\n\n#define ICorDebugManagedCallback_ExitThread(This,pAppDomain,thread)\t\\\n    ( (This)->lpVtbl -> ExitThread(This,pAppDomain,thread) )\n\n#define ICorDebugManagedCallback_LoadModule(This,pAppDomain,pModule)\t\\\n    ( (This)->lpVtbl -> LoadModule(This,pAppDomain,pModule) )\n\n#define ICorDebugManagedCallback_UnloadModule(This,pAppDomain,pModule)\t\\\n    ( (This)->lpVtbl -> UnloadModule(This,pAppDomain,pModule) )\n\n#define ICorDebugManagedCallback_LoadClass(This,pAppDomain,c)\t\\\n    ( (This)->lpVtbl -> LoadClass(This,pAppDomain,c) )\n\n#define ICorDebugManagedCallback_UnloadClass(This,pAppDomain,c)\t\\\n    ( (This)->lpVtbl -> UnloadClass(This,pAppDomain,c) )\n\n#define ICorDebugManagedCallback_DebuggerError(This,pProcess,errorHR,errorCode)\t\\\n    ( (This)->lpVtbl -> DebuggerError(This,pProcess,errorHR,errorCode) )\n\n#define ICorDebugManagedCallback_LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage)\t\\\n    ( (This)->lpVtbl -> LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) )\n\n#define ICorDebugManagedCallback_LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName)\t\\\n    ( (This)->lpVtbl -> LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) )\n\n#define ICorDebugManagedCallback_CreateAppDomain(This,pProcess,pAppDomain)\t\\\n    ( (This)->lpVtbl -> CreateAppDomain(This,pProcess,pAppDomain) )\n\n#define ICorDebugManagedCallback_ExitAppDomain(This,pProcess,pAppDomain)\t\\\n    ( (This)->lpVtbl -> ExitAppDomain(This,pProcess,pAppDomain) )\n\n#define ICorDebugManagedCallback_LoadAssembly(This,pAppDomain,pAssembly)\t\\\n    ( (This)->lpVtbl -> LoadAssembly(This,pAppDomain,pAssembly) )\n\n#define ICorDebugManagedCallback_UnloadAssembly(This,pAppDomain,pAssembly)\t\\\n    ( (This)->lpVtbl -> UnloadAssembly(This,pAppDomain,pAssembly) )\n\n#define ICorDebugManagedCallback_ControlCTrap(This,pProcess)\t\\\n    ( (This)->lpVtbl -> ControlCTrap(This,pProcess) )\n\n#define ICorDebugManagedCallback_NameChange(This,pAppDomain,pThread)\t\\\n    ( (This)->lpVtbl -> NameChange(This,pAppDomain,pThread) )\n\n#define ICorDebugManagedCallback_UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream)\t\\\n    ( (This)->lpVtbl -> UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) )\n\n#define ICorDebugManagedCallback_EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate)\t\\\n    ( (This)->lpVtbl -> EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) )\n\n#define ICorDebugManagedCallback_BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError)\t\\\n    ( (This)->lpVtbl -> BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugManagedCallback_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0016 */\n/* [local] */\n\n#pragma warning(pop)\n#pragma warning(push)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0016_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0016_v0_0_s_ifspec;\n\n#ifndef __ICorDebugManagedCallback3_INTERFACE_DEFINED__\n#define __ICorDebugManagedCallback3_INTERFACE_DEFINED__\n\n/* interface ICorDebugManagedCallback3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugManagedCallback3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"264EA0FC-2591-49AA-868E-835E6515323F\")\n    ICorDebugManagedCallback3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CustomNotification(\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugAppDomain *pAppDomain) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugManagedCallback3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugManagedCallback3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugManagedCallback3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugManagedCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CustomNotification )(\n            ICorDebugManagedCallback3 * This,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugAppDomain *pAppDomain);\n\n        END_INTERFACE\n    } ICorDebugManagedCallback3Vtbl;\n\n    interface ICorDebugManagedCallback3\n    {\n        CONST_VTBL struct ICorDebugManagedCallback3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugManagedCallback3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugManagedCallback3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugManagedCallback3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugManagedCallback3_CustomNotification(This,pThread,pAppDomain)\t\\\n    ( (This)->lpVtbl -> CustomNotification(This,pThread,pAppDomain) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugManagedCallback3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugManagedCallback4_INTERFACE_DEFINED__\n#define __ICorDebugManagedCallback4_INTERFACE_DEFINED__\n\n/* interface ICorDebugManagedCallback4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugManagedCallback4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"322911AE-16A5-49BA-84A3-ED69678138A3\")\n    ICorDebugManagedCallback4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE BeforeGarbageCollection(\n            /* [in] */ ICorDebugProcess *pProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AfterGarbageCollection(\n            /* [in] */ ICorDebugProcess *pProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DataBreakpoint(\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ BYTE *pContext,\n            /* [in] */ ULONG32 contextSize) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugManagedCallback4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugManagedCallback4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugManagedCallback4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugManagedCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *BeforeGarbageCollection )(\n            ICorDebugManagedCallback4 * This,\n            /* [in] */ ICorDebugProcess *pProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *AfterGarbageCollection )(\n            ICorDebugManagedCallback4 * This,\n            /* [in] */ ICorDebugProcess *pProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *DataBreakpoint )(\n            ICorDebugManagedCallback4 * This,\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ BYTE *pContext,\n            /* [in] */ ULONG32 contextSize);\n\n        END_INTERFACE\n    } ICorDebugManagedCallback4Vtbl;\n\n    interface ICorDebugManagedCallback4\n    {\n        CONST_VTBL struct ICorDebugManagedCallback4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugManagedCallback4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugManagedCallback4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugManagedCallback4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess)\t\\\n    ( (This)->lpVtbl -> BeforeGarbageCollection(This,pProcess) )\n\n#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess)\t\\\n    ( (This)->lpVtbl -> AfterGarbageCollection(This,pProcess) )\n\n#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize)\t\\\n    ( (This)->lpVtbl -> DataBreakpoint(This,pProcess,pThread,pContext,contextSize) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugManagedCallback4_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0018 */\n/* [local] */\n\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0018_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0018_v0_0_s_ifspec;\n\n#ifndef __ICorDebugManagedCallback2_INTERFACE_DEFINED__\n#define __ICorDebugManagedCallback2_INTERFACE_DEFINED__\n\n/* interface ICorDebugManagedCallback2 */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugExceptionCallbackType\n    {\n        DEBUG_EXCEPTION_FIRST_CHANCE\t= 1,\n        DEBUG_EXCEPTION_USER_FIRST_CHANCE\t= 2,\n        DEBUG_EXCEPTION_CATCH_HANDLER_FOUND\t= 3,\n        DEBUG_EXCEPTION_UNHANDLED\t= 4\n    } \tCorDebugExceptionCallbackType;\n\ntypedef\nenum CorDebugExceptionFlags\n    {\n        DEBUG_EXCEPTION_NONE\t= 0,\n        DEBUG_EXCEPTION_CAN_BE_INTERCEPTED\t= 0x1\n    } \tCorDebugExceptionFlags;\n\ntypedef\nenum CorDebugExceptionUnwindCallbackType\n    {\n        DEBUG_EXCEPTION_UNWIND_BEGIN\t= 1,\n        DEBUG_EXCEPTION_INTERCEPTED\t= 2\n    } \tCorDebugExceptionUnwindCallbackType;\n\n\nEXTERN_C const IID IID_ICorDebugManagedCallback2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"250E5EEA-DB5C-4C76-B6F3-8C46F12E3203\")\n    ICorDebugManagedCallback2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE FunctionRemapOpportunity(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFunction *pOldFunction,\n            /* [in] */ ICorDebugFunction *pNewFunction,\n            /* [in] */ ULONG32 oldILOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateConnection(\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ CONNID dwConnectionId,\n            /* [in] */ WCHAR *pConnName) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ChangeConnection(\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ CONNID dwConnectionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DestroyConnection(\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ CONNID dwConnectionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Exception(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFrame *pFrame,\n            /* [in] */ ULONG32 nOffset,\n            /* [in] */ CorDebugExceptionCallbackType dwEventType,\n            /* [in] */ DWORD dwFlags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionUnwind(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ CorDebugExceptionUnwindCallbackType dwEventType,\n            /* [in] */ DWORD dwFlags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE FunctionRemapComplete(\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFunction *pFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE MDANotification(\n            /* [in] */ ICorDebugController *pController,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugMDA *pMDA) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugManagedCallback2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugManagedCallback2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugManagedCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionRemapOpportunity )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFunction *pOldFunction,\n            /* [in] */ ICorDebugFunction *pNewFunction,\n            /* [in] */ ULONG32 oldILOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateConnection )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ CONNID dwConnectionId,\n            /* [in] */ WCHAR *pConnName);\n\n        HRESULT ( STDMETHODCALLTYPE *ChangeConnection )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ CONNID dwConnectionId);\n\n        HRESULT ( STDMETHODCALLTYPE *DestroyConnection )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugProcess *pProcess,\n            /* [in] */ CONNID dwConnectionId);\n\n        HRESULT ( STDMETHODCALLTYPE *Exception )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFrame *pFrame,\n            /* [in] */ ULONG32 nOffset,\n            /* [in] */ CorDebugExceptionCallbackType dwEventType,\n            /* [in] */ DWORD dwFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwind )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ CorDebugExceptionUnwindCallbackType dwEventType,\n            /* [in] */ DWORD dwFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionRemapComplete )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugAppDomain *pAppDomain,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugFunction *pFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *MDANotification )(\n            ICorDebugManagedCallback2 * This,\n            /* [in] */ ICorDebugController *pController,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [in] */ ICorDebugMDA *pMDA);\n\n        END_INTERFACE\n    } ICorDebugManagedCallback2Vtbl;\n\n    interface ICorDebugManagedCallback2\n    {\n        CONST_VTBL struct ICorDebugManagedCallback2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugManagedCallback2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugManagedCallback2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugManagedCallback2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugManagedCallback2_FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset)\t\\\n    ( (This)->lpVtbl -> FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) )\n\n#define ICorDebugManagedCallback2_CreateConnection(This,pProcess,dwConnectionId,pConnName)\t\\\n    ( (This)->lpVtbl -> CreateConnection(This,pProcess,dwConnectionId,pConnName) )\n\n#define ICorDebugManagedCallback2_ChangeConnection(This,pProcess,dwConnectionId)\t\\\n    ( (This)->lpVtbl -> ChangeConnection(This,pProcess,dwConnectionId) )\n\n#define ICorDebugManagedCallback2_DestroyConnection(This,pProcess,dwConnectionId)\t\\\n    ( (This)->lpVtbl -> DestroyConnection(This,pProcess,dwConnectionId) )\n\n#define ICorDebugManagedCallback2_Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags)\t\\\n    ( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) )\n\n#define ICorDebugManagedCallback2_ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags)\t\\\n    ( (This)->lpVtbl -> ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) )\n\n#define ICorDebugManagedCallback2_FunctionRemapComplete(This,pAppDomain,pThread,pFunction)\t\\\n    ( (This)->lpVtbl -> FunctionRemapComplete(This,pAppDomain,pThread,pFunction) )\n\n#define ICorDebugManagedCallback2_MDANotification(This,pController,pThread,pMDA)\t\\\n    ( (This)->lpVtbl -> MDANotification(This,pController,pThread,pMDA) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugManagedCallback2_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0019 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0019_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0019_v0_0_s_ifspec;\n\n#ifndef __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__\n#define __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__\n\n/* interface ICorDebugUnmanagedCallback */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugUnmanagedCallback;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"5263E909-8CB5-11d3-BD2F-0000F80849BD\")\n    ICorDebugUnmanagedCallback : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DebugEvent(\n            /* [in] */ LPDEBUG_EVENT pDebugEvent,\n            /* [in] */ BOOL fOutOfBand) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugUnmanagedCallbackVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugUnmanagedCallback * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugUnmanagedCallback * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugUnmanagedCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *DebugEvent )(\n            ICorDebugUnmanagedCallback * This,\n            /* [in] */ LPDEBUG_EVENT pDebugEvent,\n            /* [in] */ BOOL fOutOfBand);\n\n        END_INTERFACE\n    } ICorDebugUnmanagedCallbackVtbl;\n\n    interface ICorDebugUnmanagedCallback\n    {\n        CONST_VTBL struct ICorDebugUnmanagedCallbackVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugUnmanagedCallback_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugUnmanagedCallback_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugUnmanagedCallback_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugUnmanagedCallback_DebugEvent(This,pDebugEvent,fOutOfBand)\t\\\n    ( (This)->lpVtbl -> DebugEvent(This,pDebugEvent,fOutOfBand) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0020 */\n/* [local] */\n\ntypedef\nenum CorDebugCreateProcessFlags\n    {\n        DEBUG_NO_SPECIAL_OPTIONS\t= 0\n    } \tCorDebugCreateProcessFlags;\n\ntypedef\nenum CorDebugHandleType\n    {\n        HANDLE_STRONG\t= 1,\n        HANDLE_WEAK_TRACK_RESURRECTION\t= 2,\n        HANDLE_PINNED\t= 3\n    } \tCorDebugHandleType;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0020_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0020_v0_0_s_ifspec;\n\n#ifndef __ICorDebug_INTERFACE_DEFINED__\n#define __ICorDebug_INTERFACE_DEFINED__\n\n/* interface ICorDebug */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebug;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3d6f5f61-7538-11d3-8d5b-00104b35e7ef\")\n    ICorDebug : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Initialize( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Terminate( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetManagedHandler(\n            /* [in] */ ICorDebugManagedCallback *pCallback) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetUnmanagedHandler(\n            /* [in] */ ICorDebugUnmanagedCallback *pCallback) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateProcess(\n            /* [in] */ LPCWSTR lpApplicationName,\n            /* [in] */ LPWSTR lpCommandLine,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpProcessAttributes,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpThreadAttributes,\n            /* [in] */ BOOL bInheritHandles,\n            /* [in] */ DWORD dwCreationFlags,\n            /* [in] */ PVOID lpEnvironment,\n            /* [in] */ LPCWSTR lpCurrentDirectory,\n            /* [in] */ LPSTARTUPINFOW lpStartupInfo,\n            /* [in] */ LPPROCESS_INFORMATION lpProcessInformation,\n            /* [in] */ CorDebugCreateProcessFlags debuggingFlags,\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DebugActiveProcess(\n            /* [in] */ DWORD id,\n            /* [in] */ BOOL win32Attach,\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateProcesses(\n            /* [out] */ ICorDebugProcessEnum **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetProcess(\n            /* [in] */ DWORD dwProcessId,\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CanLaunchOrAttach(\n            /* [in] */ DWORD dwProcessId,\n            /* [in] */ BOOL win32DebuggingEnabled) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebug * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebug * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebug * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorDebug * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Terminate )(\n            ICorDebug * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetManagedHandler )(\n            ICorDebug * This,\n            /* [in] */ ICorDebugManagedCallback *pCallback);\n\n        HRESULT ( STDMETHODCALLTYPE *SetUnmanagedHandler )(\n            ICorDebug * This,\n            /* [in] */ ICorDebugUnmanagedCallback *pCallback);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateProcess )(\n            ICorDebug * This,\n            /* [in] */ LPCWSTR lpApplicationName,\n            /* [in] */ LPWSTR lpCommandLine,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpProcessAttributes,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpThreadAttributes,\n            /* [in] */ BOOL bInheritHandles,\n            /* [in] */ DWORD dwCreationFlags,\n            /* [in] */ PVOID lpEnvironment,\n            /* [in] */ LPCWSTR lpCurrentDirectory,\n            /* [in] */ LPSTARTUPINFOW lpStartupInfo,\n            /* [in] */ LPPROCESS_INFORMATION lpProcessInformation,\n            /* [in] */ CorDebugCreateProcessFlags debuggingFlags,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *DebugActiveProcess )(\n            ICorDebug * This,\n            /* [in] */ DWORD id,\n            /* [in] */ BOOL win32Attach,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateProcesses )(\n            ICorDebug * This,\n            /* [out] */ ICorDebugProcessEnum **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *GetProcess )(\n            ICorDebug * This,\n            /* [in] */ DWORD dwProcessId,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *CanLaunchOrAttach )(\n            ICorDebug * This,\n            /* [in] */ DWORD dwProcessId,\n            /* [in] */ BOOL win32DebuggingEnabled);\n\n        END_INTERFACE\n    } ICorDebugVtbl;\n\n    interface ICorDebug\n    {\n        CONST_VTBL struct ICorDebugVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebug_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebug_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebug_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebug_Initialize(This)\t\\\n    ( (This)->lpVtbl -> Initialize(This) )\n\n#define ICorDebug_Terminate(This)\t\\\n    ( (This)->lpVtbl -> Terminate(This) )\n\n#define ICorDebug_SetManagedHandler(This,pCallback)\t\\\n    ( (This)->lpVtbl -> SetManagedHandler(This,pCallback) )\n\n#define ICorDebug_SetUnmanagedHandler(This,pCallback)\t\\\n    ( (This)->lpVtbl -> SetUnmanagedHandler(This,pCallback) )\n\n#define ICorDebug_CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess)\t\\\n    ( (This)->lpVtbl -> CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) )\n\n#define ICorDebug_DebugActiveProcess(This,id,win32Attach,ppProcess)\t\\\n    ( (This)->lpVtbl -> DebugActiveProcess(This,id,win32Attach,ppProcess) )\n\n#define ICorDebug_EnumerateProcesses(This,ppProcess)\t\\\n    ( (This)->lpVtbl -> EnumerateProcesses(This,ppProcess) )\n\n#define ICorDebug_GetProcess(This,dwProcessId,ppProcess)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,dwProcessId,ppProcess) )\n\n#define ICorDebug_CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled)\t\\\n    ( (This)->lpVtbl -> CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebug_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0021 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0021_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0021_v0_0_s_ifspec;\n\n#ifndef __ICorDebugRemoteTarget_INTERFACE_DEFINED__\n#define __ICorDebugRemoteTarget_INTERFACE_DEFINED__\n\n/* interface ICorDebugRemoteTarget */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugRemoteTarget;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"C3ED8383-5A49-4cf5-B4B7-01864D9E582D\")\n    ICorDebugRemoteTarget : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetHostName(\n            /* [in] */ ULONG32 cchHostName,\n            /* [annotation][out] */\n            _Out_  ULONG32 *pcchHostName,\n            /* [annotation][length_is][size_is][out] */\n            _Out_writes_to_opt_(cchHostName, *pcchHostName)  WCHAR szHostName[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugRemoteTargetVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugRemoteTarget * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugRemoteTarget * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugRemoteTarget * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHostName )(\n            ICorDebugRemoteTarget * This,\n            /* [in] */ ULONG32 cchHostName,\n            /* [annotation][out] */\n            _Out_  ULONG32 *pcchHostName,\n            /* [annotation][length_is][size_is][out] */\n            _Out_writes_to_opt_(cchHostName, *pcchHostName)  WCHAR szHostName[  ]);\n\n        END_INTERFACE\n    } ICorDebugRemoteTargetVtbl;\n\n    interface ICorDebugRemoteTarget\n    {\n        CONST_VTBL struct ICorDebugRemoteTargetVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugRemoteTarget_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugRemoteTarget_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugRemoteTarget_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugRemoteTarget_GetHostName(This,cchHostName,pcchHostName,szHostName)\t\\\n    ( (This)->lpVtbl -> GetHostName(This,cchHostName,pcchHostName,szHostName) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugRemoteTarget_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugRemote_INTERFACE_DEFINED__\n#define __ICorDebugRemote_INTERFACE_DEFINED__\n\n/* interface ICorDebugRemote */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugRemote;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"D5EBB8E2-7BBE-4c1d-98A6-A3C04CBDEF64\")\n    ICorDebugRemote : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreateProcessEx(\n            /* [in] */ ICorDebugRemoteTarget *pRemoteTarget,\n            /* [in] */ LPCWSTR lpApplicationName,\n            /* [annotation][in] */\n            _In_  LPWSTR lpCommandLine,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpProcessAttributes,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpThreadAttributes,\n            /* [in] */ BOOL bInheritHandles,\n            /* [in] */ DWORD dwCreationFlags,\n            /* [in] */ PVOID lpEnvironment,\n            /* [in] */ LPCWSTR lpCurrentDirectory,\n            /* [in] */ LPSTARTUPINFOW lpStartupInfo,\n            /* [in] */ LPPROCESS_INFORMATION lpProcessInformation,\n            /* [in] */ CorDebugCreateProcessFlags debuggingFlags,\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DebugActiveProcessEx(\n            /* [in] */ ICorDebugRemoteTarget *pRemoteTarget,\n            /* [in] */ DWORD dwProcessId,\n            /* [in] */ BOOL fWin32Attach,\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugRemoteVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugRemote * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugRemote * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugRemote * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateProcessEx )(\n            ICorDebugRemote * This,\n            /* [in] */ ICorDebugRemoteTarget *pRemoteTarget,\n            /* [in] */ LPCWSTR lpApplicationName,\n            /* [annotation][in] */\n            _In_  LPWSTR lpCommandLine,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpProcessAttributes,\n            /* [in] */ LPSECURITY_ATTRIBUTES lpThreadAttributes,\n            /* [in] */ BOOL bInheritHandles,\n            /* [in] */ DWORD dwCreationFlags,\n            /* [in] */ PVOID lpEnvironment,\n            /* [in] */ LPCWSTR lpCurrentDirectory,\n            /* [in] */ LPSTARTUPINFOW lpStartupInfo,\n            /* [in] */ LPPROCESS_INFORMATION lpProcessInformation,\n            /* [in] */ CorDebugCreateProcessFlags debuggingFlags,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *DebugActiveProcessEx )(\n            ICorDebugRemote * This,\n            /* [in] */ ICorDebugRemoteTarget *pRemoteTarget,\n            /* [in] */ DWORD dwProcessId,\n            /* [in] */ BOOL fWin32Attach,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        END_INTERFACE\n    } ICorDebugRemoteVtbl;\n\n    interface ICorDebugRemote\n    {\n        CONST_VTBL struct ICorDebugRemoteVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugRemote_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugRemote_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugRemote_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugRemote_CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess)\t\\\n    ( (This)->lpVtbl -> CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) )\n\n#define ICorDebugRemote_DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess)\t\\\n    ( (This)->lpVtbl -> DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugRemote_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0023 */\n/* [local] */\n\ntypedef struct _COR_VERSION\n    {\n    DWORD dwMajor;\n    DWORD dwMinor;\n    DWORD dwBuild;\n    DWORD dwSubBuild;\n    } \tCOR_VERSION;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0023_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0023_v0_0_s_ifspec;\n\n#ifndef __ICorDebug2_INTERFACE_DEFINED__\n#define __ICorDebug2_INTERFACE_DEFINED__\n\n/* interface ICorDebug2 */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugInterfaceVersion\n    {\n        CorDebugInvalidVersion\t= 0,\n        CorDebugVersion_1_0\t= ( CorDebugInvalidVersion + 1 ) ,\n        ver_ICorDebugManagedCallback\t= CorDebugVersion_1_0,\n        ver_ICorDebugUnmanagedCallback\t= CorDebugVersion_1_0,\n        ver_ICorDebug\t= CorDebugVersion_1_0,\n        ver_ICorDebugController\t= CorDebugVersion_1_0,\n        ver_ICorDebugAppDomain\t= CorDebugVersion_1_0,\n        ver_ICorDebugAssembly\t= CorDebugVersion_1_0,\n        ver_ICorDebugProcess\t= CorDebugVersion_1_0,\n        ver_ICorDebugBreakpoint\t= CorDebugVersion_1_0,\n        ver_ICorDebugFunctionBreakpoint\t= CorDebugVersion_1_0,\n        ver_ICorDebugModuleBreakpoint\t= CorDebugVersion_1_0,\n        ver_ICorDebugValueBreakpoint\t= CorDebugVersion_1_0,\n        ver_ICorDebugStepper\t= CorDebugVersion_1_0,\n        ver_ICorDebugRegisterSet\t= CorDebugVersion_1_0,\n        ver_ICorDebugThread\t= CorDebugVersion_1_0,\n        ver_ICorDebugChain\t= CorDebugVersion_1_0,\n        ver_ICorDebugFrame\t= CorDebugVersion_1_0,\n        ver_ICorDebugILFrame\t= CorDebugVersion_1_0,\n        ver_ICorDebugNativeFrame\t= CorDebugVersion_1_0,\n        ver_ICorDebugModule\t= CorDebugVersion_1_0,\n        ver_ICorDebugFunction\t= CorDebugVersion_1_0,\n        ver_ICorDebugCode\t= CorDebugVersion_1_0,\n        ver_ICorDebugClass\t= CorDebugVersion_1_0,\n        ver_ICorDebugEval\t= CorDebugVersion_1_0,\n        ver_ICorDebugValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugGenericValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugReferenceValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugHeapValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugObjectValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugBoxValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugStringValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugArrayValue\t= CorDebugVersion_1_0,\n        ver_ICorDebugContext\t= CorDebugVersion_1_0,\n        ver_ICorDebugEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugObjectEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugBreakpointEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugStepperEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugProcessEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugThreadEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugFrameEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugChainEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugModuleEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugValueEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugCodeEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugTypeEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugErrorInfoEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugAppDomainEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugAssemblyEnum\t= CorDebugVersion_1_0,\n        ver_ICorDebugEditAndContinueErrorInfo\t= CorDebugVersion_1_0,\n        ver_ICorDebugEditAndContinueSnapshot\t= CorDebugVersion_1_0,\n        CorDebugVersion_1_1\t= ( CorDebugVersion_1_0 + 1 ) ,\n        CorDebugVersion_2_0\t= ( CorDebugVersion_1_1 + 1 ) ,\n        ver_ICorDebugManagedCallback2\t= CorDebugVersion_2_0,\n        ver_ICorDebugAppDomain2\t= CorDebugVersion_2_0,\n        ver_ICorDebugAssembly2\t= CorDebugVersion_2_0,\n        ver_ICorDebugProcess2\t= CorDebugVersion_2_0,\n        ver_ICorDebugStepper2\t= CorDebugVersion_2_0,\n        ver_ICorDebugRegisterSet2\t= CorDebugVersion_2_0,\n        ver_ICorDebugThread2\t= CorDebugVersion_2_0,\n        ver_ICorDebugILFrame2\t= CorDebugVersion_2_0,\n        ver_ICorDebugInternalFrame\t= CorDebugVersion_2_0,\n        ver_ICorDebugModule2\t= CorDebugVersion_2_0,\n        ver_ICorDebugFunction2\t= CorDebugVersion_2_0,\n        ver_ICorDebugCode2\t= CorDebugVersion_2_0,\n        ver_ICorDebugClass2\t= CorDebugVersion_2_0,\n        ver_ICorDebugValue2\t= CorDebugVersion_2_0,\n        ver_ICorDebugEval2\t= CorDebugVersion_2_0,\n        ver_ICorDebugObjectValue2\t= CorDebugVersion_2_0,\n        CorDebugVersion_4_0\t= ( CorDebugVersion_2_0 + 1 ) ,\n        ver_ICorDebugThread3\t= CorDebugVersion_4_0,\n        ver_ICorDebugThread4\t= CorDebugVersion_4_0,\n        ver_ICorDebugStackWalk\t= CorDebugVersion_4_0,\n        ver_ICorDebugNativeFrame2\t= CorDebugVersion_4_0,\n        ver_ICorDebugInternalFrame2\t= CorDebugVersion_4_0,\n        ver_ICorDebugRuntimeUnwindableFrame\t= CorDebugVersion_4_0,\n        ver_ICorDebugHeapValue3\t= CorDebugVersion_4_0,\n        ver_ICorDebugBlockingObjectEnum\t= CorDebugVersion_4_0,\n        ver_ICorDebugValue3\t= CorDebugVersion_4_0,\n        CorDebugVersion_4_5\t= ( CorDebugVersion_4_0 + 1 ) ,\n        ver_ICorDebugComObjectValue\t= CorDebugVersion_4_5,\n        ver_ICorDebugAppDomain3\t= CorDebugVersion_4_5,\n        ver_ICorDebugCode3\t= CorDebugVersion_4_5,\n        ver_ICorDebugILFrame3\t= CorDebugVersion_4_5,\n        CorDebugLatestVersion\t= CorDebugVersion_4_5\n    } \tCorDebugInterfaceVersion;\n\n\nEXTERN_C const IID IID_ICorDebug2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"ECCCCF2E-B286-4b3e-A983-860A8793D105\")\n    ICorDebug2 : public IUnknown\n    {\n    public:\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebug2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebug2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebug2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebug2 * This);\n\n        END_INTERFACE\n    } ICorDebug2Vtbl;\n\n    interface ICorDebug2\n    {\n        CONST_VTBL struct ICorDebug2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebug2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebug2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebug2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebug2_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0024 */\n/* [local] */\n\ntypedef\nenum CorDebugThreadState\n    {\n        THREAD_RUN\t= 0,\n        THREAD_SUSPEND\t= ( THREAD_RUN + 1 )\n    } \tCorDebugThreadState;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0024_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0024_v0_0_s_ifspec;\n\n#ifndef __ICorDebugController_INTERFACE_DEFINED__\n#define __ICorDebugController_INTERFACE_DEFINED__\n\n/* interface ICorDebugController */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugController;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3d6f5f62-7538-11d3-8d5b-00104b35e7ef\")\n    ICorDebugController : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Stop(\n            /* [in] */ DWORD dwTimeoutIgnored) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Continue(\n            /* [in] */ BOOL fIsOutOfBand) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsRunning(\n            /* [out] */ BOOL *pbRunning) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE HasQueuedCallbacks(\n            /* [in] */ ICorDebugThread *pThread,\n            /* [out] */ BOOL *pbQueued) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateThreads(\n            /* [out] */ ICorDebugThreadEnum **ppThreads) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetAllThreadsDebugState(\n            /* [in] */ CorDebugThreadState state,\n            /* [in] */ ICorDebugThread *pExceptThisThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Detach( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Terminate(\n            /* [in] */ UINT exitCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CanCommitChanges(\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CommitChanges(\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugControllerVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugController * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugController * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugController * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Stop )(\n            ICorDebugController * This,\n            /* [in] */ DWORD dwTimeoutIgnored);\n\n        HRESULT ( STDMETHODCALLTYPE *Continue )(\n            ICorDebugController * This,\n            /* [in] */ BOOL fIsOutOfBand);\n\n        HRESULT ( STDMETHODCALLTYPE *IsRunning )(\n            ICorDebugController * This,\n            /* [out] */ BOOL *pbRunning);\n\n        HRESULT ( STDMETHODCALLTYPE *HasQueuedCallbacks )(\n            ICorDebugController * This,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [out] */ BOOL *pbQueued);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateThreads )(\n            ICorDebugController * This,\n            /* [out] */ ICorDebugThreadEnum **ppThreads);\n\n        HRESULT ( STDMETHODCALLTYPE *SetAllThreadsDebugState )(\n            ICorDebugController * This,\n            /* [in] */ CorDebugThreadState state,\n            /* [in] */ ICorDebugThread *pExceptThisThread);\n\n        HRESULT ( STDMETHODCALLTYPE *Detach )(\n            ICorDebugController * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Terminate )(\n            ICorDebugController * This,\n            /* [in] */ UINT exitCode);\n\n        HRESULT ( STDMETHODCALLTYPE *CanCommitChanges )(\n            ICorDebugController * This,\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError);\n\n        HRESULT ( STDMETHODCALLTYPE *CommitChanges )(\n            ICorDebugController * This,\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError);\n\n        END_INTERFACE\n    } ICorDebugControllerVtbl;\n\n    interface ICorDebugController\n    {\n        CONST_VTBL struct ICorDebugControllerVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugController_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugController_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugController_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugController_Stop(This,dwTimeoutIgnored)\t\\\n    ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) )\n\n#define ICorDebugController_Continue(This,fIsOutOfBand)\t\\\n    ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) )\n\n#define ICorDebugController_IsRunning(This,pbRunning)\t\\\n    ( (This)->lpVtbl -> IsRunning(This,pbRunning) )\n\n#define ICorDebugController_HasQueuedCallbacks(This,pThread,pbQueued)\t\\\n    ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) )\n\n#define ICorDebugController_EnumerateThreads(This,ppThreads)\t\\\n    ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) )\n\n#define ICorDebugController_SetAllThreadsDebugState(This,state,pExceptThisThread)\t\\\n    ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) )\n\n#define ICorDebugController_Detach(This)\t\\\n    ( (This)->lpVtbl -> Detach(This) )\n\n#define ICorDebugController_Terminate(This,exitCode)\t\\\n    ( (This)->lpVtbl -> Terminate(This,exitCode) )\n\n#define ICorDebugController_CanCommitChanges(This,cSnapshots,pSnapshots,pError)\t\\\n    ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) )\n\n#define ICorDebugController_CommitChanges(This,cSnapshots,pSnapshots,pError)\t\\\n    ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugController_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0025 */\n/* [local] */\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0025_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0025_v0_0_s_ifspec;\n\n#ifndef __ICorDebugAppDomain_INTERFACE_DEFINED__\n#define __ICorDebugAppDomain_INTERFACE_DEFINED__\n\n/* interface ICorDebugAppDomain */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAppDomain;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3d6f5f63-7538-11d3-8d5b-00104b35e7ef\")\n    ICorDebugAppDomain : public ICorDebugController\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetProcess(\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateAssemblies(\n            /* [out] */ ICorDebugAssemblyEnum **ppAssemblies) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetModuleFromMetaDataInterface(\n            /* [in] */ IUnknown *pIMetaData,\n            /* [out] */ ICorDebugModule **ppModule) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateBreakpoints(\n            /* [out] */ ICorDebugBreakpointEnum **ppBreakpoints) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateSteppers(\n            /* [out] */ ICorDebugStepperEnum **ppSteppers) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsAttached(\n            /* [out] */ BOOL *pbAttached) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObject(\n            /* [out] */ ICorDebugValue **ppObject) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Attach( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetID(\n            /* [out] */ ULONG32 *pId) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAppDomainVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAppDomain * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAppDomain * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAppDomain * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Stop )(\n            ICorDebugAppDomain * This,\n            /* [in] */ DWORD dwTimeoutIgnored);\n\n        HRESULT ( STDMETHODCALLTYPE *Continue )(\n            ICorDebugAppDomain * This,\n            /* [in] */ BOOL fIsOutOfBand);\n\n        HRESULT ( STDMETHODCALLTYPE *IsRunning )(\n            ICorDebugAppDomain * This,\n            /* [out] */ BOOL *pbRunning);\n\n        HRESULT ( STDMETHODCALLTYPE *HasQueuedCallbacks )(\n            ICorDebugAppDomain * This,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [out] */ BOOL *pbQueued);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateThreads )(\n            ICorDebugAppDomain * This,\n            /* [out] */ ICorDebugThreadEnum **ppThreads);\n\n        HRESULT ( STDMETHODCALLTYPE *SetAllThreadsDebugState )(\n            ICorDebugAppDomain * This,\n            /* [in] */ CorDebugThreadState state,\n            /* [in] */ ICorDebugThread *pExceptThisThread);\n\n        HRESULT ( STDMETHODCALLTYPE *Detach )(\n            ICorDebugAppDomain * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Terminate )(\n            ICorDebugAppDomain * This,\n            /* [in] */ UINT exitCode);\n\n        HRESULT ( STDMETHODCALLTYPE *CanCommitChanges )(\n            ICorDebugAppDomain * This,\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError);\n\n        HRESULT ( STDMETHODCALLTYPE *CommitChanges )(\n            ICorDebugAppDomain * This,\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError);\n\n        HRESULT ( STDMETHODCALLTYPE *GetProcess )(\n            ICorDebugAppDomain * This,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateAssemblies )(\n            ICorDebugAppDomain * This,\n            /* [out] */ ICorDebugAssemblyEnum **ppAssemblies);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleFromMetaDataInterface )(\n            ICorDebugAppDomain * This,\n            /* [in] */ IUnknown *pIMetaData,\n            /* [out] */ ICorDebugModule **ppModule);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateBreakpoints )(\n            ICorDebugAppDomain * This,\n            /* [out] */ ICorDebugBreakpointEnum **ppBreakpoints);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateSteppers )(\n            ICorDebugAppDomain * This,\n            /* [out] */ ICorDebugStepperEnum **ppSteppers);\n\n        HRESULT ( STDMETHODCALLTYPE *IsAttached )(\n            ICorDebugAppDomain * This,\n            /* [out] */ BOOL *pbAttached);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugAppDomain * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObject )(\n            ICorDebugAppDomain * This,\n            /* [out] */ ICorDebugValue **ppObject);\n\n        HRESULT ( STDMETHODCALLTYPE *Attach )(\n            ICorDebugAppDomain * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetID )(\n            ICorDebugAppDomain * This,\n            /* [out] */ ULONG32 *pId);\n\n        END_INTERFACE\n    } ICorDebugAppDomainVtbl;\n\n    interface ICorDebugAppDomain\n    {\n        CONST_VTBL struct ICorDebugAppDomainVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAppDomain_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAppDomain_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAppDomain_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAppDomain_Stop(This,dwTimeoutIgnored)\t\\\n    ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) )\n\n#define ICorDebugAppDomain_Continue(This,fIsOutOfBand)\t\\\n    ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) )\n\n#define ICorDebugAppDomain_IsRunning(This,pbRunning)\t\\\n    ( (This)->lpVtbl -> IsRunning(This,pbRunning) )\n\n#define ICorDebugAppDomain_HasQueuedCallbacks(This,pThread,pbQueued)\t\\\n    ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) )\n\n#define ICorDebugAppDomain_EnumerateThreads(This,ppThreads)\t\\\n    ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) )\n\n#define ICorDebugAppDomain_SetAllThreadsDebugState(This,state,pExceptThisThread)\t\\\n    ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) )\n\n#define ICorDebugAppDomain_Detach(This)\t\\\n    ( (This)->lpVtbl -> Detach(This) )\n\n#define ICorDebugAppDomain_Terminate(This,exitCode)\t\\\n    ( (This)->lpVtbl -> Terminate(This,exitCode) )\n\n#define ICorDebugAppDomain_CanCommitChanges(This,cSnapshots,pSnapshots,pError)\t\\\n    ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) )\n\n#define ICorDebugAppDomain_CommitChanges(This,cSnapshots,pSnapshots,pError)\t\\\n    ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) )\n\n\n#define ICorDebugAppDomain_GetProcess(This,ppProcess)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,ppProcess) )\n\n#define ICorDebugAppDomain_EnumerateAssemblies(This,ppAssemblies)\t\\\n    ( (This)->lpVtbl -> EnumerateAssemblies(This,ppAssemblies) )\n\n#define ICorDebugAppDomain_GetModuleFromMetaDataInterface(This,pIMetaData,ppModule)\t\\\n    ( (This)->lpVtbl -> GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) )\n\n#define ICorDebugAppDomain_EnumerateBreakpoints(This,ppBreakpoints)\t\\\n    ( (This)->lpVtbl -> EnumerateBreakpoints(This,ppBreakpoints) )\n\n#define ICorDebugAppDomain_EnumerateSteppers(This,ppSteppers)\t\\\n    ( (This)->lpVtbl -> EnumerateSteppers(This,ppSteppers) )\n\n#define ICorDebugAppDomain_IsAttached(This,pbAttached)\t\\\n    ( (This)->lpVtbl -> IsAttached(This,pbAttached) )\n\n#define ICorDebugAppDomain_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#define ICorDebugAppDomain_GetObject(This,ppObject)\t\\\n    ( (This)->lpVtbl -> GetObject(This,ppObject) )\n\n#define ICorDebugAppDomain_Attach(This)\t\\\n    ( (This)->lpVtbl -> Attach(This) )\n\n#define ICorDebugAppDomain_GetID(This,pId)\t\\\n    ( (This)->lpVtbl -> GetID(This,pId) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAppDomain_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0026 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0026_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0026_v0_0_s_ifspec;\n\n#ifndef __ICorDebugAppDomain2_INTERFACE_DEFINED__\n#define __ICorDebugAppDomain2_INTERFACE_DEFINED__\n\n/* interface ICorDebugAppDomain2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAppDomain2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"096E81D5-ECDA-4202-83F5-C65980A9EF75\")\n    ICorDebugAppDomain2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetArrayOrPointerType(\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ULONG32 nRank,\n            /* [in] */ ICorDebugType *pTypeArg,\n            /* [out] */ ICorDebugType **ppType) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionPointerType(\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [out] */ ICorDebugType **ppType) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAppDomain2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAppDomain2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAppDomain2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAppDomain2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayOrPointerType )(\n            ICorDebugAppDomain2 * This,\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ULONG32 nRank,\n            /* [in] */ ICorDebugType *pTypeArg,\n            /* [out] */ ICorDebugType **ppType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionPointerType )(\n            ICorDebugAppDomain2 * This,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [out] */ ICorDebugType **ppType);\n\n        END_INTERFACE\n    } ICorDebugAppDomain2Vtbl;\n\n    interface ICorDebugAppDomain2\n    {\n        CONST_VTBL struct ICorDebugAppDomain2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAppDomain2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAppDomain2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAppDomain2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAppDomain2_GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType)\t\\\n    ( (This)->lpVtbl -> GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) )\n\n#define ICorDebugAppDomain2_GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType)\t\\\n    ( (This)->lpVtbl -> GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAppDomain2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugEnum_INTERFACE_DEFINED__\n#define __ICorDebugEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB01-8A68-11d2-983C-0000F808342D\")\n    ICorDebugEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip(\n            /* [in] */ ULONG celt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Clone(\n            /* [out] */ ICorDebugEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ ULONG *pcelt) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        END_INTERFACE\n    } ICorDebugEnumVtbl;\n\n    interface ICorDebugEnum\n    {\n        CONST_VTBL struct ICorDebugEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__\n#define __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugGuidToTypeEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugGuidToTypeEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"6164D242-1015-4BD6-8CBE-D0DBD4B8275A\")\n    ICorDebugGuidToTypeEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CorDebugGuidToTypeMapping values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugGuidToTypeEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugGuidToTypeEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugGuidToTypeEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugGuidToTypeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugGuidToTypeEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugGuidToTypeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugGuidToTypeEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugGuidToTypeEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugGuidToTypeEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CorDebugGuidToTypeMapping values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugGuidToTypeEnumVtbl;\n\n    interface ICorDebugGuidToTypeEnum\n    {\n        CONST_VTBL struct ICorDebugGuidToTypeEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugGuidToTypeEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugGuidToTypeEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugGuidToTypeEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugGuidToTypeEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugGuidToTypeEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugGuidToTypeEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugGuidToTypeEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugGuidToTypeEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain3_INTERFACE_DEFINED__\n#define __ICorDebugAppDomain3_INTERFACE_DEFINED__\n\n/* interface ICorDebugAppDomain3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAppDomain3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"8CB96A16-B588-42E2-B71C-DD849FC2ECCC\")\n    ICorDebugAppDomain3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypesForIIDs(\n            /* [in] */ ULONG32 cReqTypes,\n            /* [size_is][in] */ GUID *iidsToResolve,\n            /* [out] */ ICorDebugTypeEnum **ppTypesEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypes(\n            /* [out] */ ICorDebugGuidToTypeEnum **ppGuidToTypeEnum) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAppDomain3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAppDomain3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAppDomain3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAppDomain3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypesForIIDs )(\n            ICorDebugAppDomain3 * This,\n            /* [in] */ ULONG32 cReqTypes,\n            /* [size_is][in] */ GUID *iidsToResolve,\n            /* [out] */ ICorDebugTypeEnum **ppTypesEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypes )(\n            ICorDebugAppDomain3 * This,\n            /* [out] */ ICorDebugGuidToTypeEnum **ppGuidToTypeEnum);\n\n        END_INTERFACE\n    } ICorDebugAppDomain3Vtbl;\n\n    interface ICorDebugAppDomain3\n    {\n        CONST_VTBL struct ICorDebugAppDomain3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAppDomain3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAppDomain3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAppDomain3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum)\t\\\n    ( (This)->lpVtbl -> GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) )\n\n#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum)\t\\\n    ( (This)->lpVtbl -> GetCachedWinRTTypes(This,ppGuidToTypeEnum) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAppDomain3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomain4_INTERFACE_DEFINED__\n#define __ICorDebugAppDomain4_INTERFACE_DEFINED__\n\n/* interface ICorDebugAppDomain4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAppDomain4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FB99CC40-83BE-4724-AB3B-768E796EBAC2\")\n    ICorDebugAppDomain4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetObjectForCCW(\n            /* [in] */ CORDB_ADDRESS ccwPointer,\n            /* [out] */ ICorDebugValue **ppManagedObject) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAppDomain4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAppDomain4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAppDomain4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAppDomain4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectForCCW )(\n            ICorDebugAppDomain4 * This,\n            /* [in] */ CORDB_ADDRESS ccwPointer,\n            /* [out] */ ICorDebugValue **ppManagedObject);\n\n        END_INTERFACE\n    } ICorDebugAppDomain4Vtbl;\n\n    interface ICorDebugAppDomain4\n    {\n        CONST_VTBL struct ICorDebugAppDomain4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAppDomain4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAppDomain4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAppDomain4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAppDomain4_GetObjectForCCW(This,ccwPointer,ppManagedObject)\t\\\n    ( (This)->lpVtbl -> GetObjectForCCW(This,ccwPointer,ppManagedObject) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAppDomain4_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0030 */\n/* [local] */\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0030_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0030_v0_0_s_ifspec;\n\n#ifndef __ICorDebugAssembly_INTERFACE_DEFINED__\n#define __ICorDebugAssembly_INTERFACE_DEFINED__\n\n/* interface ICorDebugAssembly */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAssembly;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"df59507c-d47a-459e-bce2-6427eac8fd06\")\n    ICorDebugAssembly : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetProcess(\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomain(\n            /* [out] */ ICorDebugAppDomain **ppAppDomain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateModules(\n            /* [out] */ ICorDebugModuleEnum **ppModules) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeBase(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAssemblyVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAssembly * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAssembly * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAssembly * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetProcess )(\n            ICorDebugAssembly * This,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomain )(\n            ICorDebugAssembly * This,\n            /* [out] */ ICorDebugAppDomain **ppAppDomain);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateModules )(\n            ICorDebugAssembly * This,\n            /* [out] */ ICorDebugModuleEnum **ppModules);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeBase )(\n            ICorDebugAssembly * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugAssembly * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        END_INTERFACE\n    } ICorDebugAssemblyVtbl;\n\n    interface ICorDebugAssembly\n    {\n        CONST_VTBL struct ICorDebugAssemblyVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAssembly_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAssembly_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAssembly_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAssembly_GetProcess(This,ppProcess)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,ppProcess) )\n\n#define ICorDebugAssembly_GetAppDomain(This,ppAppDomain)\t\\\n    ( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) )\n\n#define ICorDebugAssembly_EnumerateModules(This,ppModules)\t\\\n    ( (This)->lpVtbl -> EnumerateModules(This,ppModules) )\n\n#define ICorDebugAssembly_GetCodeBase(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetCodeBase(This,cchName,pcchName,szName) )\n\n#define ICorDebugAssembly_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAssembly_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0031 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0031_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0031_v0_0_s_ifspec;\n\n#ifndef __ICorDebugAssembly2_INTERFACE_DEFINED__\n#define __ICorDebugAssembly2_INTERFACE_DEFINED__\n\n/* interface ICorDebugAssembly2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAssembly2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"426d1f9e-6dd4-44c8-aec7-26cdbaf4e398\")\n    ICorDebugAssembly2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsFullyTrusted(\n            /* [out] */ BOOL *pbFullyTrusted) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAssembly2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAssembly2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAssembly2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAssembly2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFullyTrusted )(\n            ICorDebugAssembly2 * This,\n            /* [out] */ BOOL *pbFullyTrusted);\n\n        END_INTERFACE\n    } ICorDebugAssembly2Vtbl;\n\n    interface ICorDebugAssembly2\n    {\n        CONST_VTBL struct ICorDebugAssembly2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAssembly2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAssembly2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAssembly2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAssembly2_IsFullyTrusted(This,pbFullyTrusted)\t\\\n    ( (This)->lpVtbl -> IsFullyTrusted(This,pbFullyTrusted) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAssembly2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugAssembly3_INTERFACE_DEFINED__\n#define __ICorDebugAssembly3_INTERFACE_DEFINED__\n\n/* interface ICorDebugAssembly3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAssembly3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"76361AB2-8C86-4FE9-96F2-F73D8843570A\")\n    ICorDebugAssembly3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetContainerAssembly(\n            ICorDebugAssembly **ppAssembly) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateContainedAssemblies(\n            ICorDebugAssemblyEnum **ppAssemblies) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAssembly3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAssembly3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAssembly3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAssembly3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContainerAssembly )(\n            ICorDebugAssembly3 * This,\n            ICorDebugAssembly **ppAssembly);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateContainedAssemblies )(\n            ICorDebugAssembly3 * This,\n            ICorDebugAssemblyEnum **ppAssemblies);\n\n        END_INTERFACE\n    } ICorDebugAssembly3Vtbl;\n\n    interface ICorDebugAssembly3\n    {\n        CONST_VTBL struct ICorDebugAssembly3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAssembly3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAssembly3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAssembly3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAssembly3_GetContainerAssembly(This,ppAssembly)\t\\\n    ( (This)->lpVtbl -> GetContainerAssembly(This,ppAssembly) )\n\n#define ICorDebugAssembly3_EnumerateContainedAssemblies(This,ppAssemblies)\t\\\n    ( (This)->lpVtbl -> EnumerateContainedAssemblies(This,ppAssemblies) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAssembly3_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0033 */\n/* [local] */\n\n#ifndef _DEF_COR_TYPEID_\n#define _DEF_COR_TYPEID_\ntypedef struct COR_TYPEID\n    {\n    UINT64 token1;\n    UINT64 token2;\n    } \tCOR_TYPEID;\n\n#endif // _DEF_COR_TYPEID_\ntypedef struct _COR_HEAPOBJECT\n    {\n    CORDB_ADDRESS address;\n    ULONG64 size;\n    COR_TYPEID type;\n    } \tCOR_HEAPOBJECT;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0033_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0033_v0_0_s_ifspec;\n\n#ifndef __ICorDebugHeapEnum_INTERFACE_DEFINED__\n#define __ICorDebugHeapEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugHeapEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugHeapEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"76D7DAB8-D044-11DF-9A15-7E29DFD72085\")\n    ICorDebugHeapEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_HEAPOBJECT objects[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugHeapEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugHeapEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugHeapEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugHeapEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugHeapEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugHeapEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugHeapEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugHeapEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugHeapEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_HEAPOBJECT objects[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugHeapEnumVtbl;\n\n    interface ICorDebugHeapEnum\n    {\n        CONST_VTBL struct ICorDebugHeapEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugHeapEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugHeapEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugHeapEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugHeapEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugHeapEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugHeapEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugHeapEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugHeapEnum_Next(This,celt,objects,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugHeapEnum_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0034 */\n/* [local] */\n\ntypedef\nenum CorDebugGenerationTypes\n    {\n        CorDebug_Gen0\t= 0,\n        CorDebug_Gen1\t= 1,\n        CorDebug_Gen2\t= 2,\n        CorDebug_LOH\t= 3,\n        CorDebug_POH\t= 4\n    } \tCorDebugGenerationTypes;\n\ntypedef struct _COR_SEGMENT\n    {\n    CORDB_ADDRESS start;\n    CORDB_ADDRESS end;\n    CorDebugGenerationTypes type;\n    ULONG heap;\n    } \tCOR_SEGMENT;\n\ntypedef\nenum CorDebugGCType\n    {\n        CorDebugWorkstationGC\t= 0,\n        CorDebugServerGC\t= ( CorDebugWorkstationGC + 1 )\n    } \tCorDebugGCType;\n\ntypedef struct _COR_HEAPINFO\n    {\n    BOOL areGCStructuresValid;\n    DWORD pointerSize;\n    DWORD numHeaps;\n    BOOL concurrent;\n    CorDebugGCType gcType;\n    } \tCOR_HEAPINFO;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0034_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0034_v0_0_s_ifspec;\n\n#ifndef __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__\n#define __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugHeapSegmentEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugHeapSegmentEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"A2FA0F8E-D045-11DF-AC8E-CE2ADFD72085\")\n    ICorDebugHeapSegmentEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_SEGMENT segments[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugHeapSegmentEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugHeapSegmentEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugHeapSegmentEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugHeapSegmentEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugHeapSegmentEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugHeapSegmentEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugHeapSegmentEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugHeapSegmentEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugHeapSegmentEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_SEGMENT segments[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugHeapSegmentEnumVtbl;\n\n    interface ICorDebugHeapSegmentEnum\n    {\n        CONST_VTBL struct ICorDebugHeapSegmentEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugHeapSegmentEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugHeapSegmentEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugHeapSegmentEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugHeapSegmentEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugHeapSegmentEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugHeapSegmentEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugHeapSegmentEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugHeapSegmentEnum_Next(This,celt,segments,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,segments,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0035 */\n/* [local] */\n\ntypedef\nenum CorGCReferenceType\n    {\n        CorHandleStrong\t= ( 1 << 0 ) ,\n        CorHandleStrongPinning\t= ( 1 << 1 ) ,\n        CorHandleWeakShort\t= ( 1 << 2 ) ,\n        CorHandleWeakLong\t= ( 1 << 3 ) ,\n        CorHandleWeakRefCount\t= ( 1 << 4 ) ,\n        CorHandleStrongRefCount\t= ( 1 << 5 ) ,\n        CorHandleStrongDependent\t= ( 1 << 6 ) ,\n        CorHandleStrongAsyncPinned\t= ( 1 << 7 ) ,\n        CorHandleStrongSizedByref\t= ( 1 << 8 ) ,\n        CorHandleWeakNativeCom\t= ( 1 << 9 ) ,\n        CorHandleWeakWinRT\t= CorHandleWeakNativeCom,\n        CorReferenceStack\t= 0x80000001,\n        CorReferenceFinalizer\t= 80000002,\n        CorHandleStrongOnly\t= 0x1e3,\n        CorHandleWeakOnly\t= 0x21c,\n        CorHandleAll\t= 0x7fffffff\n    } \tCorGCReferenceType;\n\n#ifndef _DEF_COR_GC_REFERENCE_\n#define _DEF_COR_GC_REFERENCE_\ntypedef struct COR_GC_REFERENCE\n    {\n    ICorDebugAppDomain *Domain;\n    ICorDebugValue *Location;\n    CorGCReferenceType Type;\n    UINT64 ExtraData;\n    } \tCOR_GC_REFERENCE;\n\n#endif // _DEF_COR_GC_REFERENCE_\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0035_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0035_v0_0_s_ifspec;\n\n#ifndef __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__\n#define __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugGCReferenceEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugGCReferenceEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"7F3C24D3-7E1D-4245-AC3A-F72F8859C80C\")\n    ICorDebugGCReferenceEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_GC_REFERENCE roots[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugGCReferenceEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugGCReferenceEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugGCReferenceEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugGCReferenceEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugGCReferenceEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugGCReferenceEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugGCReferenceEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugGCReferenceEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugGCReferenceEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_GC_REFERENCE roots[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugGCReferenceEnumVtbl;\n\n    interface ICorDebugGCReferenceEnum\n    {\n        CONST_VTBL struct ICorDebugGCReferenceEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugGCReferenceEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugGCReferenceEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugGCReferenceEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugGCReferenceEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugGCReferenceEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugGCReferenceEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugGCReferenceEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugGCReferenceEnum_Next(This,celt,roots,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,roots,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0036 */\n/* [local] */\n\n#ifndef _DEF_COR_ARRAY_LAYOUT_\n#define _DEF_COR_ARRAY_LAYOUT_\ntypedef struct COR_ARRAY_LAYOUT\n    {\n    COR_TYPEID componentID;\n    CorElementType componentType;\n    ULONG32 firstElementOffset;\n    ULONG32 elementSize;\n    ULONG32 countOffset;\n    ULONG32 rankSize;\n    ULONG32 numRanks;\n    ULONG32 rankOffset;\n    } \tCOR_ARRAY_LAYOUT;\n\n#endif // _DEF_COR_ARRAY_LAYOUT_\n#ifndef _DEF_COR_TYPE_LAYOUT_\n#define _DEF_COR_TYPE_LAYOUT_\ntypedef struct COR_TYPE_LAYOUT\n    {\n    COR_TYPEID parentID;\n    ULONG32 objectSize;\n    ULONG32 numFields;\n    ULONG32 boxOffset;\n    CorElementType type;\n    } \tCOR_TYPE_LAYOUT;\n\n#endif // _DEF_COR_TYPE_LAYOUT_\n#ifndef _DEF_COR_FIELD_\n#define _DEF_COR_FIELD_\ntypedef struct COR_FIELD\n    {\n    mdFieldDef token;\n    ULONG32 offset;\n    COR_TYPEID id;\n    CorElementType fieldType;\n    } \tCOR_FIELD;\n\n#endif // _DEF_COR_FIELD_\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0036_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0036_v0_0_s_ifspec;\n\n#ifndef __ICorDebugProcess_INTERFACE_DEFINED__\n#define __ICorDebugProcess_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3d6f5f64-7538-11d3-8d5b-00104b35e7ef\")\n    ICorDebugProcess : public ICorDebugController\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetID(\n            /* [out] */ DWORD *pdwProcessId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHandle(\n            /* [out] */ HPROCESS *phProcessHandle) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThread(\n            /* [in] */ DWORD dwThreadId,\n            /* [out] */ ICorDebugThread **ppThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateObjects(\n            /* [out] */ ICorDebugObjectEnum **ppObjects) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsTransitionStub(\n            /* [in] */ CORDB_ADDRESS address,\n            /* [out] */ BOOL *pbTransitionStub) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsOSSuspended(\n            /* [in] */ DWORD threadID,\n            /* [out] */ BOOL *pbSuspended) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadContext(\n            /* [in] */ DWORD threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][out][in] */ BYTE context[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetThreadContext(\n            /* [in] */ DWORD threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][in] */ BYTE context[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ReadMemory(\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ DWORD size,\n            /* [length_is][size_is][out] */ BYTE buffer[  ],\n            /* [out] */ SIZE_T *read) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE WriteMemory(\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ DWORD size,\n            /* [size_is][in] */ BYTE buffer[  ],\n            /* [out] */ SIZE_T *written) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ClearCurrentException(\n            /* [in] */ DWORD threadID) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnableLogMessages(\n            /* [in] */ BOOL fOnOff) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ModifyLogSwitch(\n            /* [annotation][in] */\n            _In_  WCHAR *pLogSwitchName,\n            /* [in] */ LONG lLevel) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateAppDomains(\n            /* [out] */ ICorDebugAppDomainEnum **ppAppDomains) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObject(\n            /* [out] */ ICorDebugValue **ppObject) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ThreadForFiberCookie(\n            /* [in] */ DWORD fiberCookie,\n            /* [out] */ ICorDebugThread **ppThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHelperThreadID(\n            /* [out] */ DWORD *pThreadID) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcessVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Stop )(\n            ICorDebugProcess * This,\n            /* [in] */ DWORD dwTimeoutIgnored);\n\n        HRESULT ( STDMETHODCALLTYPE *Continue )(\n            ICorDebugProcess * This,\n            /* [in] */ BOOL fIsOutOfBand);\n\n        HRESULT ( STDMETHODCALLTYPE *IsRunning )(\n            ICorDebugProcess * This,\n            /* [out] */ BOOL *pbRunning);\n\n        HRESULT ( STDMETHODCALLTYPE *HasQueuedCallbacks )(\n            ICorDebugProcess * This,\n            /* [in] */ ICorDebugThread *pThread,\n            /* [out] */ BOOL *pbQueued);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateThreads )(\n            ICorDebugProcess * This,\n            /* [out] */ ICorDebugThreadEnum **ppThreads);\n\n        HRESULT ( STDMETHODCALLTYPE *SetAllThreadsDebugState )(\n            ICorDebugProcess * This,\n            /* [in] */ CorDebugThreadState state,\n            /* [in] */ ICorDebugThread *pExceptThisThread);\n\n        HRESULT ( STDMETHODCALLTYPE *Detach )(\n            ICorDebugProcess * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Terminate )(\n            ICorDebugProcess * This,\n            /* [in] */ UINT exitCode);\n\n        HRESULT ( STDMETHODCALLTYPE *CanCommitChanges )(\n            ICorDebugProcess * This,\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError);\n\n        HRESULT ( STDMETHODCALLTYPE *CommitChanges )(\n            ICorDebugProcess * This,\n            /* [in] */ ULONG cSnapshots,\n            /* [size_is][in] */ ICorDebugEditAndContinueSnapshot *pSnapshots[  ],\n            /* [out] */ ICorDebugErrorInfoEnum **pError);\n\n        HRESULT ( STDMETHODCALLTYPE *GetID )(\n            ICorDebugProcess * This,\n            /* [out] */ DWORD *pdwProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandle )(\n            ICorDebugProcess * This,\n            /* [out] */ HPROCESS *phProcessHandle);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThread )(\n            ICorDebugProcess * This,\n            /* [in] */ DWORD dwThreadId,\n            /* [out] */ ICorDebugThread **ppThread);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateObjects )(\n            ICorDebugProcess * This,\n            /* [out] */ ICorDebugObjectEnum **ppObjects);\n\n        HRESULT ( STDMETHODCALLTYPE *IsTransitionStub )(\n            ICorDebugProcess * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [out] */ BOOL *pbTransitionStub);\n\n        HRESULT ( STDMETHODCALLTYPE *IsOSSuspended )(\n            ICorDebugProcess * This,\n            /* [in] */ DWORD threadID,\n            /* [out] */ BOOL *pbSuspended);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorDebugProcess * This,\n            /* [in] */ DWORD threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][out][in] */ BYTE context[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetThreadContext )(\n            ICorDebugProcess * This,\n            /* [in] */ DWORD threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][in] */ BYTE context[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadMemory )(\n            ICorDebugProcess * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ DWORD size,\n            /* [length_is][size_is][out] */ BYTE buffer[  ],\n            /* [out] */ SIZE_T *read);\n\n        HRESULT ( STDMETHODCALLTYPE *WriteMemory )(\n            ICorDebugProcess * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ DWORD size,\n            /* [size_is][in] */ BYTE buffer[  ],\n            /* [out] */ SIZE_T *written);\n\n        HRESULT ( STDMETHODCALLTYPE *ClearCurrentException )(\n            ICorDebugProcess * This,\n            /* [in] */ DWORD threadID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnableLogMessages )(\n            ICorDebugProcess * This,\n            /* [in] */ BOOL fOnOff);\n\n        HRESULT ( STDMETHODCALLTYPE *ModifyLogSwitch )(\n            ICorDebugProcess * This,\n            /* [annotation][in] */\n            _In_  WCHAR *pLogSwitchName,\n            /* [in] */ LONG lLevel);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateAppDomains )(\n            ICorDebugProcess * This,\n            /* [out] */ ICorDebugAppDomainEnum **ppAppDomains);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObject )(\n            ICorDebugProcess * This,\n            /* [out] */ ICorDebugValue **ppObject);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadForFiberCookie )(\n            ICorDebugProcess * This,\n            /* [in] */ DWORD fiberCookie,\n            /* [out] */ ICorDebugThread **ppThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHelperThreadID )(\n            ICorDebugProcess * This,\n            /* [out] */ DWORD *pThreadID);\n\n        END_INTERFACE\n    } ICorDebugProcessVtbl;\n\n    interface ICorDebugProcess\n    {\n        CONST_VTBL struct ICorDebugProcessVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess_Stop(This,dwTimeoutIgnored)\t\\\n    ( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) )\n\n#define ICorDebugProcess_Continue(This,fIsOutOfBand)\t\\\n    ( (This)->lpVtbl -> Continue(This,fIsOutOfBand) )\n\n#define ICorDebugProcess_IsRunning(This,pbRunning)\t\\\n    ( (This)->lpVtbl -> IsRunning(This,pbRunning) )\n\n#define ICorDebugProcess_HasQueuedCallbacks(This,pThread,pbQueued)\t\\\n    ( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) )\n\n#define ICorDebugProcess_EnumerateThreads(This,ppThreads)\t\\\n    ( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) )\n\n#define ICorDebugProcess_SetAllThreadsDebugState(This,state,pExceptThisThread)\t\\\n    ( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) )\n\n#define ICorDebugProcess_Detach(This)\t\\\n    ( (This)->lpVtbl -> Detach(This) )\n\n#define ICorDebugProcess_Terminate(This,exitCode)\t\\\n    ( (This)->lpVtbl -> Terminate(This,exitCode) )\n\n#define ICorDebugProcess_CanCommitChanges(This,cSnapshots,pSnapshots,pError)\t\\\n    ( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) )\n\n#define ICorDebugProcess_CommitChanges(This,cSnapshots,pSnapshots,pError)\t\\\n    ( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) )\n\n\n#define ICorDebugProcess_GetID(This,pdwProcessId)\t\\\n    ( (This)->lpVtbl -> GetID(This,pdwProcessId) )\n\n#define ICorDebugProcess_GetHandle(This,phProcessHandle)\t\\\n    ( (This)->lpVtbl -> GetHandle(This,phProcessHandle) )\n\n#define ICorDebugProcess_GetThread(This,dwThreadId,ppThread)\t\\\n    ( (This)->lpVtbl -> GetThread(This,dwThreadId,ppThread) )\n\n#define ICorDebugProcess_EnumerateObjects(This,ppObjects)\t\\\n    ( (This)->lpVtbl -> EnumerateObjects(This,ppObjects) )\n\n#define ICorDebugProcess_IsTransitionStub(This,address,pbTransitionStub)\t\\\n    ( (This)->lpVtbl -> IsTransitionStub(This,address,pbTransitionStub) )\n\n#define ICorDebugProcess_IsOSSuspended(This,threadID,pbSuspended)\t\\\n    ( (This)->lpVtbl -> IsOSSuspended(This,threadID,pbSuspended) )\n\n#define ICorDebugProcess_GetThreadContext(This,threadID,contextSize,context)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadID,contextSize,context) )\n\n#define ICorDebugProcess_SetThreadContext(This,threadID,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) )\n\n#define ICorDebugProcess_ReadMemory(This,address,size,buffer,read)\t\\\n    ( (This)->lpVtbl -> ReadMemory(This,address,size,buffer,read) )\n\n#define ICorDebugProcess_WriteMemory(This,address,size,buffer,written)\t\\\n    ( (This)->lpVtbl -> WriteMemory(This,address,size,buffer,written) )\n\n#define ICorDebugProcess_ClearCurrentException(This,threadID)\t\\\n    ( (This)->lpVtbl -> ClearCurrentException(This,threadID) )\n\n#define ICorDebugProcess_EnableLogMessages(This,fOnOff)\t\\\n    ( (This)->lpVtbl -> EnableLogMessages(This,fOnOff) )\n\n#define ICorDebugProcess_ModifyLogSwitch(This,pLogSwitchName,lLevel)\t\\\n    ( (This)->lpVtbl -> ModifyLogSwitch(This,pLogSwitchName,lLevel) )\n\n#define ICorDebugProcess_EnumerateAppDomains(This,ppAppDomains)\t\\\n    ( (This)->lpVtbl -> EnumerateAppDomains(This,ppAppDomains) )\n\n#define ICorDebugProcess_GetObject(This,ppObject)\t\\\n    ( (This)->lpVtbl -> GetObject(This,ppObject) )\n\n#define ICorDebugProcess_ThreadForFiberCookie(This,fiberCookie,ppThread)\t\\\n    ( (This)->lpVtbl -> ThreadForFiberCookie(This,fiberCookie,ppThread) )\n\n#define ICorDebugProcess_GetHelperThreadID(This,pThreadID)\t\\\n    ( (This)->lpVtbl -> GetHelperThreadID(This,pThreadID) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0037 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0037_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0037_v0_0_s_ifspec;\n\n#ifndef __ICorDebugProcess2_INTERFACE_DEFINED__\n#define __ICorDebugProcess2_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"AD1B3588-0EF0-4744-A496-AA09A9F80371\")\n    ICorDebugProcess2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetThreadForTaskID(\n            /* [in] */ TASKID taskid,\n            /* [out] */ ICorDebugThread2 **ppThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetVersion(\n            /* [out] */ COR_VERSION *version) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetUnmanagedBreakpoint(\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ ULONG32 bufsize,\n            /* [length_is][size_is][out] */ BYTE buffer[  ],\n            /* [out] */ ULONG32 *bufLen) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ClearUnmanagedBreakpoint(\n            /* [in] */ CORDB_ADDRESS address) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetDesiredNGENCompilerFlags(\n            /* [in] */ DWORD pdwFlags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDesiredNGENCompilerFlags(\n            /* [out] */ DWORD *pdwFlags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetReferenceValueFromGCHandle(\n            /* [in] */ UINT_PTR handle,\n            /* [out] */ ICorDebugReferenceValue **pOutValue) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadForTaskID )(\n            ICorDebugProcess2 * This,\n            /* [in] */ TASKID taskid,\n            /* [out] */ ICorDebugThread2 **ppThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVersion )(\n            ICorDebugProcess2 * This,\n            /* [out] */ COR_VERSION *version);\n\n        HRESULT ( STDMETHODCALLTYPE *SetUnmanagedBreakpoint )(\n            ICorDebugProcess2 * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ ULONG32 bufsize,\n            /* [length_is][size_is][out] */ BYTE buffer[  ],\n            /* [out] */ ULONG32 *bufLen);\n\n        HRESULT ( STDMETHODCALLTYPE *ClearUnmanagedBreakpoint )(\n            ICorDebugProcess2 * This,\n            /* [in] */ CORDB_ADDRESS address);\n\n        HRESULT ( STDMETHODCALLTYPE *SetDesiredNGENCompilerFlags )(\n            ICorDebugProcess2 * This,\n            /* [in] */ DWORD pdwFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDesiredNGENCompilerFlags )(\n            ICorDebugProcess2 * This,\n            /* [out] */ DWORD *pdwFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReferenceValueFromGCHandle )(\n            ICorDebugProcess2 * This,\n            /* [in] */ UINT_PTR handle,\n            /* [out] */ ICorDebugReferenceValue **pOutValue);\n\n        END_INTERFACE\n    } ICorDebugProcess2Vtbl;\n\n    interface ICorDebugProcess2\n    {\n        CONST_VTBL struct ICorDebugProcess2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess2_GetThreadForTaskID(This,taskid,ppThread)\t\\\n    ( (This)->lpVtbl -> GetThreadForTaskID(This,taskid,ppThread) )\n\n#define ICorDebugProcess2_GetVersion(This,version)\t\\\n    ( (This)->lpVtbl -> GetVersion(This,version) )\n\n#define ICorDebugProcess2_SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen)\t\\\n    ( (This)->lpVtbl -> SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) )\n\n#define ICorDebugProcess2_ClearUnmanagedBreakpoint(This,address)\t\\\n    ( (This)->lpVtbl -> ClearUnmanagedBreakpoint(This,address) )\n\n#define ICorDebugProcess2_SetDesiredNGENCompilerFlags(This,pdwFlags)\t\\\n    ( (This)->lpVtbl -> SetDesiredNGENCompilerFlags(This,pdwFlags) )\n\n#define ICorDebugProcess2_GetDesiredNGENCompilerFlags(This,pdwFlags)\t\\\n    ( (This)->lpVtbl -> GetDesiredNGENCompilerFlags(This,pdwFlags) )\n\n#define ICorDebugProcess2_GetReferenceValueFromGCHandle(This,handle,pOutValue)\t\\\n    ( (This)->lpVtbl -> GetReferenceValueFromGCHandle(This,handle,pOutValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess3_INTERFACE_DEFINED__\n#define __ICorDebugProcess3_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"2EE06488-C0D4-42B1-B26D-F3795EF606FB\")\n    ICorDebugProcess3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetEnableCustomNotification(\n            ICorDebugClass *pClass,\n            BOOL fEnable) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnableCustomNotification )(\n            ICorDebugProcess3 * This,\n            ICorDebugClass *pClass,\n            BOOL fEnable);\n\n        END_INTERFACE\n    } ICorDebugProcess3Vtbl;\n\n    interface ICorDebugProcess3\n    {\n        CONST_VTBL struct ICorDebugProcess3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess3_SetEnableCustomNotification(This,pClass,fEnable)\t\\\n    ( (This)->lpVtbl -> SetEnableCustomNotification(This,pClass,fEnable) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess5_INTERFACE_DEFINED__\n#define __ICorDebugProcess5_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess5 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess5;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"21e9d9c0-fcb8-11df-8cff-0800200c9a66\")\n    ICorDebugProcess5 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetGCHeapInformation(\n            /* [out] */ COR_HEAPINFO *pHeapInfo) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateHeap(\n            /* [out] */ ICorDebugHeapEnum **ppObjects) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateHeapRegions(\n            /* [out] */ ICorDebugHeapSegmentEnum **ppRegions) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObject(\n            /* [in] */ CORDB_ADDRESS addr,\n            /* [out] */ ICorDebugObjectValue **pObject) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateGCReferences(\n            /* [in] */ BOOL enumerateWeakReferences,\n            /* [out] */ ICorDebugGCReferenceEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateHandles(\n            /* [in] */ CorGCReferenceType types,\n            /* [out] */ ICorDebugGCReferenceEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTypeID(\n            /* [in] */ CORDB_ADDRESS obj,\n            /* [out] */ COR_TYPEID *pId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTypeForTypeID(\n            /* [in] */ COR_TYPEID id,\n            /* [out] */ ICorDebugType **ppType) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetArrayLayout(\n            /* [in] */ COR_TYPEID id,\n            /* [out] */ COR_ARRAY_LAYOUT *pLayout) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTypeLayout(\n            /* [in] */ COR_TYPEID id,\n            /* [out] */ COR_TYPE_LAYOUT *pLayout) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTypeFields(\n            /* [in] */ COR_TYPEID id,\n            ULONG32 celt,\n            COR_FIELD fields[  ],\n            ULONG32 *pceltNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnableNGENPolicy(\n            /* [in] */ CorDebugNGENPolicy ePolicy) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess5Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess5 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess5 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCHeapInformation )(\n            ICorDebugProcess5 * This,\n            /* [out] */ COR_HEAPINFO *pHeapInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateHeap )(\n            ICorDebugProcess5 * This,\n            /* [out] */ ICorDebugHeapEnum **ppObjects);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateHeapRegions )(\n            ICorDebugProcess5 * This,\n            /* [out] */ ICorDebugHeapSegmentEnum **ppRegions);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObject )(\n            ICorDebugProcess5 * This,\n            /* [in] */ CORDB_ADDRESS addr,\n            /* [out] */ ICorDebugObjectValue **pObject);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateGCReferences )(\n            ICorDebugProcess5 * This,\n            /* [in] */ BOOL enumerateWeakReferences,\n            /* [out] */ ICorDebugGCReferenceEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateHandles )(\n            ICorDebugProcess5 * This,\n            /* [in] */ CorGCReferenceType types,\n            /* [out] */ ICorDebugGCReferenceEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTypeID )(\n            ICorDebugProcess5 * This,\n            /* [in] */ CORDB_ADDRESS obj,\n            /* [out] */ COR_TYPEID *pId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTypeForTypeID )(\n            ICorDebugProcess5 * This,\n            /* [in] */ COR_TYPEID id,\n            /* [out] */ ICorDebugType **ppType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayLayout )(\n            ICorDebugProcess5 * This,\n            /* [in] */ COR_TYPEID id,\n            /* [out] */ COR_ARRAY_LAYOUT *pLayout);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTypeLayout )(\n            ICorDebugProcess5 * This,\n            /* [in] */ COR_TYPEID id,\n            /* [out] */ COR_TYPE_LAYOUT *pLayout);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTypeFields )(\n            ICorDebugProcess5 * This,\n            /* [in] */ COR_TYPEID id,\n            ULONG32 celt,\n            COR_FIELD fields[  ],\n            ULONG32 *pceltNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *EnableNGENPolicy )(\n            ICorDebugProcess5 * This,\n            /* [in] */ CorDebugNGENPolicy ePolicy);\n\n        END_INTERFACE\n    } ICorDebugProcess5Vtbl;\n\n    interface ICorDebugProcess5\n    {\n        CONST_VTBL struct ICorDebugProcess5Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess5_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess5_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess5_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess5_GetGCHeapInformation(This,pHeapInfo)\t\\\n    ( (This)->lpVtbl -> GetGCHeapInformation(This,pHeapInfo) )\n\n#define ICorDebugProcess5_EnumerateHeap(This,ppObjects)\t\\\n    ( (This)->lpVtbl -> EnumerateHeap(This,ppObjects) )\n\n#define ICorDebugProcess5_EnumerateHeapRegions(This,ppRegions)\t\\\n    ( (This)->lpVtbl -> EnumerateHeapRegions(This,ppRegions) )\n\n#define ICorDebugProcess5_GetObject(This,addr,pObject)\t\\\n    ( (This)->lpVtbl -> GetObject(This,addr,pObject) )\n\n#define ICorDebugProcess5_EnumerateGCReferences(This,enumerateWeakReferences,ppEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) )\n\n#define ICorDebugProcess5_EnumerateHandles(This,types,ppEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateHandles(This,types,ppEnum) )\n\n#define ICorDebugProcess5_GetTypeID(This,obj,pId)\t\\\n    ( (This)->lpVtbl -> GetTypeID(This,obj,pId) )\n\n#define ICorDebugProcess5_GetTypeForTypeID(This,id,ppType)\t\\\n    ( (This)->lpVtbl -> GetTypeForTypeID(This,id,ppType) )\n\n#define ICorDebugProcess5_GetArrayLayout(This,id,pLayout)\t\\\n    ( (This)->lpVtbl -> GetArrayLayout(This,id,pLayout) )\n\n#define ICorDebugProcess5_GetTypeLayout(This,id,pLayout)\t\\\n    ( (This)->lpVtbl -> GetTypeLayout(This,id,pLayout) )\n\n#define ICorDebugProcess5_GetTypeFields(This,id,celt,fields,pceltNeeded)\t\\\n    ( (This)->lpVtbl -> GetTypeFields(This,id,celt,fields,pceltNeeded) )\n\n#define ICorDebugProcess5_EnableNGENPolicy(This,ePolicy)\t\\\n    ( (This)->lpVtbl -> EnableNGENPolicy(This,ePolicy) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess5_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0040 */\n/* [local] */\n\ntypedef\nenum CorDebugRecordFormat\n    {\n        FORMAT_WINDOWS_EXCEPTIONRECORD32\t= 1,\n        FORMAT_WINDOWS_EXCEPTIONRECORD64\t= 2\n    } \tCorDebugRecordFormat;\n\ntypedef\nenum CorDebugDecodeEventFlagsWindows\n    {\n        IS_FIRST_CHANCE\t= 1\n    } \tCorDebugDecodeEventFlagsWindows;\n\ntypedef\nenum CorDebugDebugEventKind\n    {\n        DEBUG_EVENT_KIND_MODULE_LOADED\t= 1,\n        DEBUG_EVENT_KIND_MODULE_UNLOADED\t= 2,\n        DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE\t= 3,\n        DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE\t= 4,\n        DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND\t= 5,\n        DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED\t= 6\n    } \tCorDebugDebugEventKind;\n\ntypedef\nenum CorDebugStateChange\n    {\n        PROCESS_RUNNING\t= 0x1,\n        FLUSH_ALL\t= 0x2\n    } \tCorDebugStateChange;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0040_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0040_v0_0_s_ifspec;\n\n#ifndef __ICorDebugDebugEvent_INTERFACE_DEFINED__\n#define __ICorDebugDebugEvent_INTERFACE_DEFINED__\n\n/* interface ICorDebugDebugEvent */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugDebugEvent;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"41BD395D-DE99-48F1-BF7A-CC0F44A6D281\")\n    ICorDebugDebugEvent : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetEventKind(\n            /* [out] */ CorDebugDebugEventKind *pDebugEventKind) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThread(\n            /* [out] */ ICorDebugThread **ppThread) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugDebugEventVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugDebugEvent * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugDebugEvent * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugDebugEvent * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventKind )(\n            ICorDebugDebugEvent * This,\n            /* [out] */ CorDebugDebugEventKind *pDebugEventKind);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThread )(\n            ICorDebugDebugEvent * This,\n            /* [out] */ ICorDebugThread **ppThread);\n\n        END_INTERFACE\n    } ICorDebugDebugEventVtbl;\n\n    interface ICorDebugDebugEvent\n    {\n        CONST_VTBL struct ICorDebugDebugEventVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugDebugEvent_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugDebugEvent_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugDebugEvent_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugDebugEvent_GetEventKind(This,pDebugEventKind)\t\\\n    ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) )\n\n#define ICorDebugDebugEvent_GetThread(This,ppThread)\t\\\n    ( (This)->lpVtbl -> GetThread(This,ppThread) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugDebugEvent_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0041 */\n/* [local] */\n\ntypedef\nenum CorDebugCodeInvokeKind\n    {\n        CODE_INVOKE_KIND_NONE\t= 0,\n        CODE_INVOKE_KIND_RETURN\t= ( CODE_INVOKE_KIND_NONE + 1 ) ,\n        CODE_INVOKE_KIND_TAILCALL\t= ( CODE_INVOKE_KIND_RETURN + 1 )\n    } \tCorDebugCodeInvokeKind;\n\ntypedef\nenum CorDebugCodeInvokePurpose\n    {\n        CODE_INVOKE_PURPOSE_NONE\t= 0,\n        CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION\t= ( CODE_INVOKE_PURPOSE_NONE + 1 ) ,\n        CODE_INVOKE_PURPOSE_CLASS_INIT\t= ( CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION + 1 ) ,\n        CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH\t= ( CODE_INVOKE_PURPOSE_CLASS_INIT + 1 )\n    } \tCorDebugCodeInvokePurpose;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0041_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0041_v0_0_s_ifspec;\n\n#ifndef __ICorDebugProcess6_INTERFACE_DEFINED__\n#define __ICorDebugProcess6_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess6 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess6;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"11588775-7205-4CEB-A41A-93753C3153E9\")\n    ICorDebugProcess6 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DecodeEvent(\n            /* [size_is][length_is][in] */ const BYTE pRecord[  ],\n            /* [in] */ DWORD countBytes,\n            /* [in] */ CorDebugRecordFormat format,\n            /* [in] */ DWORD dwFlags,\n            /* [in] */ DWORD dwThreadId,\n            /* [out] */ ICorDebugDebugEvent **ppEvent) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ProcessStateChanged(\n            /* [in] */ CorDebugStateChange change) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCode(\n            /* [in] */ CORDB_ADDRESS codeAddress,\n            /* [out] */ ICorDebugCode **ppCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnableVirtualModuleSplitting(\n            BOOL enableSplitting) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE MarkDebuggerAttached(\n            BOOL fIsAttached) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetExportStepInfo(\n            /* [in] */ LPCWSTR pszExportName,\n            /* [out] */ CorDebugCodeInvokeKind *pInvokeKind,\n            /* [out] */ CorDebugCodeInvokePurpose *pInvokePurpose) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess6Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess6 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess6 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *DecodeEvent )(\n            ICorDebugProcess6 * This,\n            /* [size_is][length_is][in] */ const BYTE pRecord[  ],\n            /* [in] */ DWORD countBytes,\n            /* [in] */ CorDebugRecordFormat format,\n            /* [in] */ DWORD dwFlags,\n            /* [in] */ DWORD dwThreadId,\n            /* [out] */ ICorDebugDebugEvent **ppEvent);\n\n        HRESULT ( STDMETHODCALLTYPE *ProcessStateChanged )(\n            ICorDebugProcess6 * This,\n            /* [in] */ CorDebugStateChange change);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugProcess6 * This,\n            /* [in] */ CORDB_ADDRESS codeAddress,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *EnableVirtualModuleSplitting )(\n            ICorDebugProcess6 * This,\n            BOOL enableSplitting);\n\n        HRESULT ( STDMETHODCALLTYPE *MarkDebuggerAttached )(\n            ICorDebugProcess6 * This,\n            BOOL fIsAttached);\n\n        HRESULT ( STDMETHODCALLTYPE *GetExportStepInfo )(\n            ICorDebugProcess6 * This,\n            /* [in] */ LPCWSTR pszExportName,\n            /* [out] */ CorDebugCodeInvokeKind *pInvokeKind,\n            /* [out] */ CorDebugCodeInvokePurpose *pInvokePurpose);\n\n        END_INTERFACE\n    } ICorDebugProcess6Vtbl;\n\n    interface ICorDebugProcess6\n    {\n        CONST_VTBL struct ICorDebugProcess6Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess6_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess6_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess6_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess6_DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent)\t\\\n    ( (This)->lpVtbl -> DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) )\n\n#define ICorDebugProcess6_ProcessStateChanged(This,change)\t\\\n    ( (This)->lpVtbl -> ProcessStateChanged(This,change) )\n\n#define ICorDebugProcess6_GetCode(This,codeAddress,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCode(This,codeAddress,ppCode) )\n\n#define ICorDebugProcess6_EnableVirtualModuleSplitting(This,enableSplitting)\t\\\n    ( (This)->lpVtbl -> EnableVirtualModuleSplitting(This,enableSplitting) )\n\n#define ICorDebugProcess6_MarkDebuggerAttached(This,fIsAttached)\t\\\n    ( (This)->lpVtbl -> MarkDebuggerAttached(This,fIsAttached) )\n\n#define ICorDebugProcess6_GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose)\t\\\n    ( (This)->lpVtbl -> GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess6_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0042 */\n/* [local] */\n\ntypedef\nenum WriteableMetadataUpdateMode\n    {\n        LegacyCompatPolicy\t= 0,\n        AlwaysShowUpdates\t= ( LegacyCompatPolicy + 1 )\n    } \tWriteableMetadataUpdateMode;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0042_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0042_v0_0_s_ifspec;\n\n#ifndef __ICorDebugProcess7_INTERFACE_DEFINED__\n#define __ICorDebugProcess7_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess7 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess7;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"9B2C54E4-119F-4D6F-B402-527603266D69\")\n    ICorDebugProcess7 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetWriteableMetadataUpdateMode(\n            WriteableMetadataUpdateMode flags) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess7Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess7 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess7 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetWriteableMetadataUpdateMode )(\n            ICorDebugProcess7 * This,\n            WriteableMetadataUpdateMode flags);\n\n        END_INTERFACE\n    } ICorDebugProcess7Vtbl;\n\n    interface ICorDebugProcess7\n    {\n        CONST_VTBL struct ICorDebugProcess7Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess7_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess7_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess7_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess7_SetWriteableMetadataUpdateMode(This,flags)\t\\\n    ( (This)->lpVtbl -> SetWriteableMetadataUpdateMode(This,flags) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess7_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess8_INTERFACE_DEFINED__\n#define __ICorDebugProcess8_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess8 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess8;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"2E6F28C1-85EB-4141-80AD-0A90944B9639\")\n    ICorDebugProcess8 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnableExceptionCallbacksOutsideOfMyCode(\n            /* [in] */ BOOL enableExceptionsOutsideOfJMC) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess8Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess8 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess8 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *EnableExceptionCallbacksOutsideOfMyCode )(\n            ICorDebugProcess8 * This,\n            /* [in] */ BOOL enableExceptionsOutsideOfJMC);\n\n        END_INTERFACE\n    } ICorDebugProcess8Vtbl;\n\n    interface ICorDebugProcess8\n    {\n        CONST_VTBL struct ICorDebugProcess8Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess8_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess8_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess8_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess8_EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC)\t\\\n    ( (This)->lpVtbl -> EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess8_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess10_INTERFACE_DEFINED__\n#define __ICorDebugProcess10_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess10 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess10;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"8F378F6F-1017-4461-9890-ECF64C54079F\")\n    ICorDebugProcess10 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnableGCNotificationEvents(\n            BOOL fEnable) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess10Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess10 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess10 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *EnableGCNotificationEvents )(\n            ICorDebugProcess10 * This,\n            BOOL fEnable);\n\n        END_INTERFACE\n    } ICorDebugProcess10Vtbl;\n\n    interface ICorDebugProcess10\n    {\n        CONST_VTBL struct ICorDebugProcess10Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess10_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess10_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess10_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess10_EnableGCNotificationEvents(This,fEnable)\t\\\n    ( (This)->lpVtbl -> EnableGCNotificationEvents(This,fEnable) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess10_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0045 */\n/* [local] */\n\ntypedef struct _COR_MEMORY_RANGE\n    {\n    CORDB_ADDRESS start;\n    CORDB_ADDRESS end;\n    } \tCOR_MEMORY_RANGE;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0045_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0045_v0_0_s_ifspec;\n\n#ifndef __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__\n#define __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugMemoryRangeEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugMemoryRangeEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"D1A0BCFC-5865-4437-BE3F-36F022951F8A\")\n    ICorDebugMemoryRangeEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_MEMORY_RANGE objects[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugMemoryRangeEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugMemoryRangeEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugMemoryRangeEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugMemoryRangeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugMemoryRangeEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugMemoryRangeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugMemoryRangeEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugMemoryRangeEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugMemoryRangeEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_MEMORY_RANGE objects[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugMemoryRangeEnumVtbl;\n\n    interface ICorDebugMemoryRangeEnum\n    {\n        CONST_VTBL struct ICorDebugMemoryRangeEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugMemoryRangeEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugMemoryRangeEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugMemoryRangeEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugMemoryRangeEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugMemoryRangeEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugMemoryRangeEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugMemoryRangeEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugMemoryRangeEnum_Next(This,celt,objects,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugProcess11_INTERFACE_DEFINED__\n#define __ICorDebugProcess11_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess11 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcess11;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"344B37AA-F2C0-4D3B-9909-91CCF787DA8C\")\n    ICorDebugProcess11 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumerateLoaderHeapMemoryRegions(\n            /* [out] */ ICorDebugMemoryRangeEnum **ppRanges) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess11Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcess11 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcess11 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcess11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateLoaderHeapMemoryRegions )(\n            ICorDebugProcess11 * This,\n            /* [out] */ ICorDebugMemoryRangeEnum **ppRanges);\n\n        END_INTERFACE\n    } ICorDebugProcess11Vtbl;\n\n    interface ICorDebugProcess11\n    {\n        CONST_VTBL struct ICorDebugProcess11Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess11_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcess11_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcess11_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcess11_EnumerateLoaderHeapMemoryRegions(This,ppRanges)\t\\\n    ( (This)->lpVtbl -> EnumerateLoaderHeapMemoryRegions(This,ppRanges) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess11_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__\n#define __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__\n\n/* interface ICorDebugModuleDebugEvent */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugModuleDebugEvent;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"51A15E8D-9FFF-4864-9B87-F4FBDEA747A2\")\n    ICorDebugModuleDebugEvent : public ICorDebugDebugEvent\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetModule(\n            /* [out] */ ICorDebugModule **ppModule) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugModuleDebugEventVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugModuleDebugEvent * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugModuleDebugEvent * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugModuleDebugEvent * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventKind )(\n            ICorDebugModuleDebugEvent * This,\n            /* [out] */ CorDebugDebugEventKind *pDebugEventKind);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThread )(\n            ICorDebugModuleDebugEvent * This,\n            /* [out] */ ICorDebugThread **ppThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModule )(\n            ICorDebugModuleDebugEvent * This,\n            /* [out] */ ICorDebugModule **ppModule);\n\n        END_INTERFACE\n    } ICorDebugModuleDebugEventVtbl;\n\n    interface ICorDebugModuleDebugEvent\n    {\n        CONST_VTBL struct ICorDebugModuleDebugEventVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugModuleDebugEvent_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugModuleDebugEvent_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugModuleDebugEvent_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugModuleDebugEvent_GetEventKind(This,pDebugEventKind)\t\\\n    ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) )\n\n#define ICorDebugModuleDebugEvent_GetThread(This,ppThread)\t\\\n    ( (This)->lpVtbl -> GetThread(This,ppThread) )\n\n\n#define ICorDebugModuleDebugEvent_GetModule(This,ppModule)\t\\\n    ( (This)->lpVtbl -> GetModule(This,ppModule) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__\n#define __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__\n\n/* interface ICorDebugExceptionDebugEvent */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugExceptionDebugEvent;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"AF79EC94-4752-419C-A626-5FB1CC1A5AB7\")\n    ICorDebugExceptionDebugEvent : public ICorDebugDebugEvent\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetStackPointer(\n            /* [out] */ CORDB_ADDRESS *pStackPointer) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetNativeIP(\n            /* [out] */ CORDB_ADDRESS *pIP) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFlags(\n            /* [out] */ CorDebugExceptionFlags *pdwFlags) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugExceptionDebugEventVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugExceptionDebugEvent * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugExceptionDebugEvent * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugExceptionDebugEvent * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventKind )(\n            ICorDebugExceptionDebugEvent * This,\n            /* [out] */ CorDebugDebugEventKind *pDebugEventKind);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThread )(\n            ICorDebugExceptionDebugEvent * This,\n            /* [out] */ ICorDebugThread **ppThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackPointer )(\n            ICorDebugExceptionDebugEvent * This,\n            /* [out] */ CORDB_ADDRESS *pStackPointer);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNativeIP )(\n            ICorDebugExceptionDebugEvent * This,\n            /* [out] */ CORDB_ADDRESS *pIP);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFlags )(\n            ICorDebugExceptionDebugEvent * This,\n            /* [out] */ CorDebugExceptionFlags *pdwFlags);\n\n        END_INTERFACE\n    } ICorDebugExceptionDebugEventVtbl;\n\n    interface ICorDebugExceptionDebugEvent\n    {\n        CONST_VTBL struct ICorDebugExceptionDebugEventVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugExceptionDebugEvent_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugExceptionDebugEvent_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugExceptionDebugEvent_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugExceptionDebugEvent_GetEventKind(This,pDebugEventKind)\t\\\n    ( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) )\n\n#define ICorDebugExceptionDebugEvent_GetThread(This,ppThread)\t\\\n    ( (This)->lpVtbl -> GetThread(This,ppThread) )\n\n\n#define ICorDebugExceptionDebugEvent_GetStackPointer(This,pStackPointer)\t\\\n    ( (This)->lpVtbl -> GetStackPointer(This,pStackPointer) )\n\n#define ICorDebugExceptionDebugEvent_GetNativeIP(This,pIP)\t\\\n    ( (This)->lpVtbl -> GetNativeIP(This,pIP) )\n\n#define ICorDebugExceptionDebugEvent_GetFlags(This,pdwFlags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,pdwFlags) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugBreakpoint_INTERFACE_DEFINED__\n#define __ICorDebugBreakpoint_INTERFACE_DEFINED__\n\n/* interface ICorDebugBreakpoint */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugBreakpoint;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAE8-8A68-11d2-983C-0000F808342D\")\n    ICorDebugBreakpoint : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Activate(\n            /* [in] */ BOOL bActive) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsActive(\n            /* [out] */ BOOL *pbActive) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugBreakpointVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugBreakpoint * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugBreakpoint * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugBreakpoint * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Activate )(\n            ICorDebugBreakpoint * This,\n            /* [in] */ BOOL bActive);\n\n        HRESULT ( STDMETHODCALLTYPE *IsActive )(\n            ICorDebugBreakpoint * This,\n            /* [out] */ BOOL *pbActive);\n\n        END_INTERFACE\n    } ICorDebugBreakpointVtbl;\n\n    interface ICorDebugBreakpoint\n    {\n        CONST_VTBL struct ICorDebugBreakpointVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugBreakpoint_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugBreakpoint_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugBreakpoint_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugBreakpoint_Activate(This,bActive)\t\\\n    ( (This)->lpVtbl -> Activate(This,bActive) )\n\n#define ICorDebugBreakpoint_IsActive(This,pbActive)\t\\\n    ( (This)->lpVtbl -> IsActive(This,pbActive) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugBreakpoint_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__\n#define __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__\n\n/* interface ICorDebugFunctionBreakpoint */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugFunctionBreakpoint;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAE9-8A68-11d2-983C-0000F808342D\")\n    ICorDebugFunctionBreakpoint : public ICorDebugBreakpoint\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetFunction(\n            /* [out] */ ICorDebugFunction **ppFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetOffset(\n            /* [out] */ ULONG32 *pnOffset) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugFunctionBreakpointVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugFunctionBreakpoint * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugFunctionBreakpoint * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugFunctionBreakpoint * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Activate )(\n            ICorDebugFunctionBreakpoint * This,\n            /* [in] */ BOOL bActive);\n\n        HRESULT ( STDMETHODCALLTYPE *IsActive )(\n            ICorDebugFunctionBreakpoint * This,\n            /* [out] */ BOOL *pbActive);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugFunctionBreakpoint * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetOffset )(\n            ICorDebugFunctionBreakpoint * This,\n            /* [out] */ ULONG32 *pnOffset);\n\n        END_INTERFACE\n    } ICorDebugFunctionBreakpointVtbl;\n\n    interface ICorDebugFunctionBreakpoint\n    {\n        CONST_VTBL struct ICorDebugFunctionBreakpointVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugFunctionBreakpoint_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugFunctionBreakpoint_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugFunctionBreakpoint_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugFunctionBreakpoint_Activate(This,bActive)\t\\\n    ( (This)->lpVtbl -> Activate(This,bActive) )\n\n#define ICorDebugFunctionBreakpoint_IsActive(This,pbActive)\t\\\n    ( (This)->lpVtbl -> IsActive(This,pbActive) )\n\n\n#define ICorDebugFunctionBreakpoint_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#define ICorDebugFunctionBreakpoint_GetOffset(This,pnOffset)\t\\\n    ( (This)->lpVtbl -> GetOffset(This,pnOffset) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__\n#define __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__\n\n/* interface ICorDebugModuleBreakpoint */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugModuleBreakpoint;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAEA-8A68-11d2-983C-0000F808342D\")\n    ICorDebugModuleBreakpoint : public ICorDebugBreakpoint\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetModule(\n            /* [out] */ ICorDebugModule **ppModule) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugModuleBreakpointVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugModuleBreakpoint * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugModuleBreakpoint * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugModuleBreakpoint * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Activate )(\n            ICorDebugModuleBreakpoint * This,\n            /* [in] */ BOOL bActive);\n\n        HRESULT ( STDMETHODCALLTYPE *IsActive )(\n            ICorDebugModuleBreakpoint * This,\n            /* [out] */ BOOL *pbActive);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModule )(\n            ICorDebugModuleBreakpoint * This,\n            /* [out] */ ICorDebugModule **ppModule);\n\n        END_INTERFACE\n    } ICorDebugModuleBreakpointVtbl;\n\n    interface ICorDebugModuleBreakpoint\n    {\n        CONST_VTBL struct ICorDebugModuleBreakpointVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugModuleBreakpoint_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugModuleBreakpoint_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugModuleBreakpoint_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugModuleBreakpoint_Activate(This,bActive)\t\\\n    ( (This)->lpVtbl -> Activate(This,bActive) )\n\n#define ICorDebugModuleBreakpoint_IsActive(This,pbActive)\t\\\n    ( (This)->lpVtbl -> IsActive(This,pbActive) )\n\n\n#define ICorDebugModuleBreakpoint_GetModule(This,ppModule)\t\\\n    ( (This)->lpVtbl -> GetModule(This,ppModule) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugValueBreakpoint_INTERFACE_DEFINED__\n#define __ICorDebugValueBreakpoint_INTERFACE_DEFINED__\n\n/* interface ICorDebugValueBreakpoint */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugValueBreakpoint;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAEB-8A68-11d2-983C-0000F808342D\")\n    ICorDebugValueBreakpoint : public ICorDebugBreakpoint\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetValue(\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugValueBreakpointVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugValueBreakpoint * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugValueBreakpoint * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugValueBreakpoint * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Activate )(\n            ICorDebugValueBreakpoint * This,\n            /* [in] */ BOOL bActive);\n\n        HRESULT ( STDMETHODCALLTYPE *IsActive )(\n            ICorDebugValueBreakpoint * This,\n            /* [out] */ BOOL *pbActive);\n\n        HRESULT ( STDMETHODCALLTYPE *GetValue )(\n            ICorDebugValueBreakpoint * This,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        END_INTERFACE\n    } ICorDebugValueBreakpointVtbl;\n\n    interface ICorDebugValueBreakpoint\n    {\n        CONST_VTBL struct ICorDebugValueBreakpointVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugValueBreakpoint_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugValueBreakpoint_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugValueBreakpoint_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugValueBreakpoint_Activate(This,bActive)\t\\\n    ( (This)->lpVtbl -> Activate(This,bActive) )\n\n#define ICorDebugValueBreakpoint_IsActive(This,pbActive)\t\\\n    ( (This)->lpVtbl -> IsActive(This,pbActive) )\n\n\n#define ICorDebugValueBreakpoint_GetValue(This,ppValue)\t\\\n    ( (This)->lpVtbl -> GetValue(This,ppValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugStepper_INTERFACE_DEFINED__\n#define __ICorDebugStepper_INTERFACE_DEFINED__\n\n/* interface ICorDebugStepper */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugIntercept\n    {\n        INTERCEPT_NONE\t= 0,\n        INTERCEPT_CLASS_INIT\t= 0x1,\n        INTERCEPT_EXCEPTION_FILTER\t= 0x2,\n        INTERCEPT_SECURITY\t= 0x4,\n        INTERCEPT_CONTEXT_POLICY\t= 0x8,\n        INTERCEPT_INTERCEPTION\t= 0x10,\n        INTERCEPT_ALL\t= 0xffff\n    } \tCorDebugIntercept;\n\ntypedef\nenum CorDebugUnmappedStop\n    {\n        STOP_NONE\t= 0,\n        STOP_PROLOG\t= 0x1,\n        STOP_EPILOG\t= 0x2,\n        STOP_NO_MAPPING_INFO\t= 0x4,\n        STOP_OTHER_UNMAPPED\t= 0x8,\n        STOP_UNMANAGED\t= 0x10,\n        STOP_ALL\t= 0xffff\n    } \tCorDebugUnmappedStop;\n\ntypedef struct COR_DEBUG_STEP_RANGE\n    {\n    ULONG32 startOffset;\n    ULONG32 endOffset;\n    } \tCOR_DEBUG_STEP_RANGE;\n\n\nEXTERN_C const IID IID_ICorDebugStepper;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAEC-8A68-11d2-983C-0000F808342D\")\n    ICorDebugStepper : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsActive(\n            /* [out] */ BOOL *pbActive) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Deactivate( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetInterceptMask(\n            /* [in] */ CorDebugIntercept mask) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetUnmappedStopMask(\n            /* [in] */ CorDebugUnmappedStop mask) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Step(\n            /* [in] */ BOOL bStepIn) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE StepRange(\n            /* [in] */ BOOL bStepIn,\n            /* [size_is][in] */ COR_DEBUG_STEP_RANGE ranges[  ],\n            /* [in] */ ULONG32 cRangeCount) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE StepOut( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetRangeIL(\n            /* [in] */ BOOL bIL) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugStepperVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugStepper * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugStepper * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugStepper * This);\n\n        HRESULT ( STDMETHODCALLTYPE *IsActive )(\n            ICorDebugStepper * This,\n            /* [out] */ BOOL *pbActive);\n\n        HRESULT ( STDMETHODCALLTYPE *Deactivate )(\n            ICorDebugStepper * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetInterceptMask )(\n            ICorDebugStepper * This,\n            /* [in] */ CorDebugIntercept mask);\n\n        HRESULT ( STDMETHODCALLTYPE *SetUnmappedStopMask )(\n            ICorDebugStepper * This,\n            /* [in] */ CorDebugUnmappedStop mask);\n\n        HRESULT ( STDMETHODCALLTYPE *Step )(\n            ICorDebugStepper * This,\n            /* [in] */ BOOL bStepIn);\n\n        HRESULT ( STDMETHODCALLTYPE *StepRange )(\n            ICorDebugStepper * This,\n            /* [in] */ BOOL bStepIn,\n            /* [size_is][in] */ COR_DEBUG_STEP_RANGE ranges[  ],\n            /* [in] */ ULONG32 cRangeCount);\n\n        HRESULT ( STDMETHODCALLTYPE *StepOut )(\n            ICorDebugStepper * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetRangeIL )(\n            ICorDebugStepper * This,\n            /* [in] */ BOOL bIL);\n\n        END_INTERFACE\n    } ICorDebugStepperVtbl;\n\n    interface ICorDebugStepper\n    {\n        CONST_VTBL struct ICorDebugStepperVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugStepper_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugStepper_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugStepper_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugStepper_IsActive(This,pbActive)\t\\\n    ( (This)->lpVtbl -> IsActive(This,pbActive) )\n\n#define ICorDebugStepper_Deactivate(This)\t\\\n    ( (This)->lpVtbl -> Deactivate(This) )\n\n#define ICorDebugStepper_SetInterceptMask(This,mask)\t\\\n    ( (This)->lpVtbl -> SetInterceptMask(This,mask) )\n\n#define ICorDebugStepper_SetUnmappedStopMask(This,mask)\t\\\n    ( (This)->lpVtbl -> SetUnmappedStopMask(This,mask) )\n\n#define ICorDebugStepper_Step(This,bStepIn)\t\\\n    ( (This)->lpVtbl -> Step(This,bStepIn) )\n\n#define ICorDebugStepper_StepRange(This,bStepIn,ranges,cRangeCount)\t\\\n    ( (This)->lpVtbl -> StepRange(This,bStepIn,ranges,cRangeCount) )\n\n#define ICorDebugStepper_StepOut(This)\t\\\n    ( (This)->lpVtbl -> StepOut(This) )\n\n#define ICorDebugStepper_SetRangeIL(This,bIL)\t\\\n    ( (This)->lpVtbl -> SetRangeIL(This,bIL) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugStepper_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugStepper2_INTERFACE_DEFINED__\n#define __ICorDebugStepper2_INTERFACE_DEFINED__\n\n/* interface ICorDebugStepper2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugStepper2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"C5B6E9C3-E7D1-4a8e-873B-7F047F0706F7\")\n    ICorDebugStepper2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetJMC(\n            /* [in] */ BOOL fIsJMCStepper) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugStepper2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugStepper2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugStepper2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugStepper2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetJMC )(\n            ICorDebugStepper2 * This,\n            /* [in] */ BOOL fIsJMCStepper);\n\n        END_INTERFACE\n    } ICorDebugStepper2Vtbl;\n\n    interface ICorDebugStepper2\n    {\n        CONST_VTBL struct ICorDebugStepper2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugStepper2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugStepper2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugStepper2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugStepper2_SetJMC(This,fIsJMCStepper)\t\\\n    ( (This)->lpVtbl -> SetJMC(This,fIsJMCStepper) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugStepper2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugRegisterSet_INTERFACE_DEFINED__\n#define __ICorDebugRegisterSet_INTERFACE_DEFINED__\n\n/* interface ICorDebugRegisterSet */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugRegister\n    {\n        REGISTER_INSTRUCTION_POINTER\t= 0,\n        REGISTER_STACK_POINTER\t= ( REGISTER_INSTRUCTION_POINTER + 1 ) ,\n        REGISTER_FRAME_POINTER\t= ( REGISTER_STACK_POINTER + 1 ) ,\n        REGISTER_X86_EIP\t= 0,\n        REGISTER_X86_ESP\t= ( REGISTER_X86_EIP + 1 ) ,\n        REGISTER_X86_EBP\t= ( REGISTER_X86_ESP + 1 ) ,\n        REGISTER_X86_EAX\t= ( REGISTER_X86_EBP + 1 ) ,\n        REGISTER_X86_ECX\t= ( REGISTER_X86_EAX + 1 ) ,\n        REGISTER_X86_EDX\t= ( REGISTER_X86_ECX + 1 ) ,\n        REGISTER_X86_EBX\t= ( REGISTER_X86_EDX + 1 ) ,\n        REGISTER_X86_ESI\t= ( REGISTER_X86_EBX + 1 ) ,\n        REGISTER_X86_EDI\t= ( REGISTER_X86_ESI + 1 ) ,\n        REGISTER_X86_FPSTACK_0\t= ( REGISTER_X86_EDI + 1 ) ,\n        REGISTER_X86_FPSTACK_1\t= ( REGISTER_X86_FPSTACK_0 + 1 ) ,\n        REGISTER_X86_FPSTACK_2\t= ( REGISTER_X86_FPSTACK_1 + 1 ) ,\n        REGISTER_X86_FPSTACK_3\t= ( REGISTER_X86_FPSTACK_2 + 1 ) ,\n        REGISTER_X86_FPSTACK_4\t= ( REGISTER_X86_FPSTACK_3 + 1 ) ,\n        REGISTER_X86_FPSTACK_5\t= ( REGISTER_X86_FPSTACK_4 + 1 ) ,\n        REGISTER_X86_FPSTACK_6\t= ( REGISTER_X86_FPSTACK_5 + 1 ) ,\n        REGISTER_X86_FPSTACK_7\t= ( REGISTER_X86_FPSTACK_6 + 1 ) ,\n        REGISTER_AMD64_RIP\t= 0,\n        REGISTER_AMD64_RSP\t= ( REGISTER_AMD64_RIP + 1 ) ,\n        REGISTER_AMD64_RBP\t= ( REGISTER_AMD64_RSP + 1 ) ,\n        REGISTER_AMD64_RAX\t= ( REGISTER_AMD64_RBP + 1 ) ,\n        REGISTER_AMD64_RCX\t= ( REGISTER_AMD64_RAX + 1 ) ,\n        REGISTER_AMD64_RDX\t= ( REGISTER_AMD64_RCX + 1 ) ,\n        REGISTER_AMD64_RBX\t= ( REGISTER_AMD64_RDX + 1 ) ,\n        REGISTER_AMD64_RSI\t= ( REGISTER_AMD64_RBX + 1 ) ,\n        REGISTER_AMD64_RDI\t= ( REGISTER_AMD64_RSI + 1 ) ,\n        REGISTER_AMD64_R8\t= ( REGISTER_AMD64_RDI + 1 ) ,\n        REGISTER_AMD64_R9\t= ( REGISTER_AMD64_R8 + 1 ) ,\n        REGISTER_AMD64_R10\t= ( REGISTER_AMD64_R9 + 1 ) ,\n        REGISTER_AMD64_R11\t= ( REGISTER_AMD64_R10 + 1 ) ,\n        REGISTER_AMD64_R12\t= ( REGISTER_AMD64_R11 + 1 ) ,\n        REGISTER_AMD64_R13\t= ( REGISTER_AMD64_R12 + 1 ) ,\n        REGISTER_AMD64_R14\t= ( REGISTER_AMD64_R13 + 1 ) ,\n        REGISTER_AMD64_R15\t= ( REGISTER_AMD64_R14 + 1 ) ,\n        REGISTER_AMD64_XMM0\t= ( REGISTER_AMD64_R15 + 1 ) ,\n        REGISTER_AMD64_XMM1\t= ( REGISTER_AMD64_XMM0 + 1 ) ,\n        REGISTER_AMD64_XMM2\t= ( REGISTER_AMD64_XMM1 + 1 ) ,\n        REGISTER_AMD64_XMM3\t= ( REGISTER_AMD64_XMM2 + 1 ) ,\n        REGISTER_AMD64_XMM4\t= ( REGISTER_AMD64_XMM3 + 1 ) ,\n        REGISTER_AMD64_XMM5\t= ( REGISTER_AMD64_XMM4 + 1 ) ,\n        REGISTER_AMD64_XMM6\t= ( REGISTER_AMD64_XMM5 + 1 ) ,\n        REGISTER_AMD64_XMM7\t= ( REGISTER_AMD64_XMM6 + 1 ) ,\n        REGISTER_AMD64_XMM8\t= ( REGISTER_AMD64_XMM7 + 1 ) ,\n        REGISTER_AMD64_XMM9\t= ( REGISTER_AMD64_XMM8 + 1 ) ,\n        REGISTER_AMD64_XMM10\t= ( REGISTER_AMD64_XMM9 + 1 ) ,\n        REGISTER_AMD64_XMM11\t= ( REGISTER_AMD64_XMM10 + 1 ) ,\n        REGISTER_AMD64_XMM12\t= ( REGISTER_AMD64_XMM11 + 1 ) ,\n        REGISTER_AMD64_XMM13\t= ( REGISTER_AMD64_XMM12 + 1 ) ,\n        REGISTER_AMD64_XMM14\t= ( REGISTER_AMD64_XMM13 + 1 ) ,\n        REGISTER_AMD64_XMM15\t= ( REGISTER_AMD64_XMM14 + 1 ) ,\n        REGISTER_IA64_BSP\t= REGISTER_FRAME_POINTER,\n        REGISTER_IA64_R0\t= ( REGISTER_IA64_BSP + 1 ) ,\n        REGISTER_IA64_F0\t= ( REGISTER_IA64_R0 + 128 ) ,\n        REGISTER_ARM_PC\t= 0,\n        REGISTER_ARM_SP\t= ( REGISTER_ARM_PC + 1 ) ,\n        REGISTER_ARM_R0\t= ( REGISTER_ARM_SP + 1 ) ,\n        REGISTER_ARM_R1\t= ( REGISTER_ARM_R0 + 1 ) ,\n        REGISTER_ARM_R2\t= ( REGISTER_ARM_R1 + 1 ) ,\n        REGISTER_ARM_R3\t= ( REGISTER_ARM_R2 + 1 ) ,\n        REGISTER_ARM_R4\t= ( REGISTER_ARM_R3 + 1 ) ,\n        REGISTER_ARM_R5\t= ( REGISTER_ARM_R4 + 1 ) ,\n        REGISTER_ARM_R6\t= ( REGISTER_ARM_R5 + 1 ) ,\n        REGISTER_ARM_R7\t= ( REGISTER_ARM_R6 + 1 ) ,\n        REGISTER_ARM_R8\t= ( REGISTER_ARM_R7 + 1 ) ,\n        REGISTER_ARM_R9\t= ( REGISTER_ARM_R8 + 1 ) ,\n        REGISTER_ARM_R10\t= ( REGISTER_ARM_R9 + 1 ) ,\n        REGISTER_ARM_R11\t= ( REGISTER_ARM_R10 + 1 ) ,\n        REGISTER_ARM_R12\t= ( REGISTER_ARM_R11 + 1 ) ,\n        REGISTER_ARM_LR\t= ( REGISTER_ARM_R12 + 1 ) ,\n        REGISTER_ARM_D0\t= ( REGISTER_ARM_LR + 1 ) ,\n        REGISTER_ARM_D1\t= ( REGISTER_ARM_D0 + 1 ) ,\n        REGISTER_ARM_D2\t= ( REGISTER_ARM_D1 + 1 ) ,\n        REGISTER_ARM_D3\t= ( REGISTER_ARM_D2 + 1 ) ,\n        REGISTER_ARM_D4\t= ( REGISTER_ARM_D3 + 1 ) ,\n        REGISTER_ARM_D5\t= ( REGISTER_ARM_D4 + 1 ) ,\n        REGISTER_ARM_D6\t= ( REGISTER_ARM_D5 + 1 ) ,\n        REGISTER_ARM_D7\t= ( REGISTER_ARM_D6 + 1 ) ,\n        REGISTER_ARM_D8\t= ( REGISTER_ARM_D7 + 1 ) ,\n        REGISTER_ARM_D9\t= ( REGISTER_ARM_D8 + 1 ) ,\n        REGISTER_ARM_D10\t= ( REGISTER_ARM_D9 + 1 ) ,\n        REGISTER_ARM_D11\t= ( REGISTER_ARM_D10 + 1 ) ,\n        REGISTER_ARM_D12\t= ( REGISTER_ARM_D11 + 1 ) ,\n        REGISTER_ARM_D13\t= ( REGISTER_ARM_D12 + 1 ) ,\n        REGISTER_ARM_D14\t= ( REGISTER_ARM_D13 + 1 ) ,\n        REGISTER_ARM_D15\t= ( REGISTER_ARM_D14 + 1 ) ,\n        REGISTER_ARM_D16\t= ( REGISTER_ARM_D15 + 1 ) ,\n        REGISTER_ARM_D17\t= ( REGISTER_ARM_D16 + 1 ) ,\n        REGISTER_ARM_D18\t= ( REGISTER_ARM_D17 + 1 ) ,\n        REGISTER_ARM_D19\t= ( REGISTER_ARM_D18 + 1 ) ,\n        REGISTER_ARM_D20\t= ( REGISTER_ARM_D19 + 1 ) ,\n        REGISTER_ARM_D21\t= ( REGISTER_ARM_D20 + 1 ) ,\n        REGISTER_ARM_D22\t= ( REGISTER_ARM_D21 + 1 ) ,\n        REGISTER_ARM_D23\t= ( REGISTER_ARM_D22 + 1 ) ,\n        REGISTER_ARM_D24\t= ( REGISTER_ARM_D23 + 1 ) ,\n        REGISTER_ARM_D25\t= ( REGISTER_ARM_D24 + 1 ) ,\n        REGISTER_ARM_D26\t= ( REGISTER_ARM_D25 + 1 ) ,\n        REGISTER_ARM_D27\t= ( REGISTER_ARM_D26 + 1 ) ,\n        REGISTER_ARM_D28\t= ( REGISTER_ARM_D27 + 1 ) ,\n        REGISTER_ARM_D29\t= ( REGISTER_ARM_D28 + 1 ) ,\n        REGISTER_ARM_D30\t= ( REGISTER_ARM_D29 + 1 ) ,\n        REGISTER_ARM_D31\t= ( REGISTER_ARM_D30 + 1 ) ,\n        REGISTER_ARM64_PC\t= 0,\n        REGISTER_ARM64_SP\t= ( REGISTER_ARM64_PC + 1 ) ,\n        REGISTER_ARM64_FP\t= ( REGISTER_ARM64_SP + 1 ) ,\n        REGISTER_ARM64_X0\t= ( REGISTER_ARM64_FP + 1 ) ,\n        REGISTER_ARM64_X1\t= ( REGISTER_ARM64_X0 + 1 ) ,\n        REGISTER_ARM64_X2\t= ( REGISTER_ARM64_X1 + 1 ) ,\n        REGISTER_ARM64_X3\t= ( REGISTER_ARM64_X2 + 1 ) ,\n        REGISTER_ARM64_X4\t= ( REGISTER_ARM64_X3 + 1 ) ,\n        REGISTER_ARM64_X5\t= ( REGISTER_ARM64_X4 + 1 ) ,\n        REGISTER_ARM64_X6\t= ( REGISTER_ARM64_X5 + 1 ) ,\n        REGISTER_ARM64_X7\t= ( REGISTER_ARM64_X6 + 1 ) ,\n        REGISTER_ARM64_X8\t= ( REGISTER_ARM64_X7 + 1 ) ,\n        REGISTER_ARM64_X9\t= ( REGISTER_ARM64_X8 + 1 ) ,\n        REGISTER_ARM64_X10\t= ( REGISTER_ARM64_X9 + 1 ) ,\n        REGISTER_ARM64_X11\t= ( REGISTER_ARM64_X10 + 1 ) ,\n        REGISTER_ARM64_X12\t= ( REGISTER_ARM64_X11 + 1 ) ,\n        REGISTER_ARM64_X13\t= ( REGISTER_ARM64_X12 + 1 ) ,\n        REGISTER_ARM64_X14\t= ( REGISTER_ARM64_X13 + 1 ) ,\n        REGISTER_ARM64_X15\t= ( REGISTER_ARM64_X14 + 1 ) ,\n        REGISTER_ARM64_X16\t= ( REGISTER_ARM64_X15 + 1 ) ,\n        REGISTER_ARM64_X17\t= ( REGISTER_ARM64_X16 + 1 ) ,\n        REGISTER_ARM64_X18\t= ( REGISTER_ARM64_X17 + 1 ) ,\n        REGISTER_ARM64_X19\t= ( REGISTER_ARM64_X18 + 1 ) ,\n        REGISTER_ARM64_X20\t= ( REGISTER_ARM64_X19 + 1 ) ,\n        REGISTER_ARM64_X21\t= ( REGISTER_ARM64_X20 + 1 ) ,\n        REGISTER_ARM64_X22\t= ( REGISTER_ARM64_X21 + 1 ) ,\n        REGISTER_ARM64_X23\t= ( REGISTER_ARM64_X22 + 1 ) ,\n        REGISTER_ARM64_X24\t= ( REGISTER_ARM64_X23 + 1 ) ,\n        REGISTER_ARM64_X25\t= ( REGISTER_ARM64_X24 + 1 ) ,\n        REGISTER_ARM64_X26\t= ( REGISTER_ARM64_X25 + 1 ) ,\n        REGISTER_ARM64_X27\t= ( REGISTER_ARM64_X26 + 1 ) ,\n        REGISTER_ARM64_X28\t= ( REGISTER_ARM64_X27 + 1 ) ,\n        REGISTER_ARM64_LR\t= ( REGISTER_ARM64_X28 + 1 ) ,\n        REGISTER_ARM64_V0\t= ( REGISTER_ARM64_LR + 1 ) ,\n        REGISTER_ARM64_V1\t= ( REGISTER_ARM64_V0 + 1 ) ,\n        REGISTER_ARM64_V2\t= ( REGISTER_ARM64_V1 + 1 ) ,\n        REGISTER_ARM64_V3\t= ( REGISTER_ARM64_V2 + 1 ) ,\n        REGISTER_ARM64_V4\t= ( REGISTER_ARM64_V3 + 1 ) ,\n        REGISTER_ARM64_V5\t= ( REGISTER_ARM64_V4 + 1 ) ,\n        REGISTER_ARM64_V6\t= ( REGISTER_ARM64_V5 + 1 ) ,\n        REGISTER_ARM64_V7\t= ( REGISTER_ARM64_V6 + 1 ) ,\n        REGISTER_ARM64_V8\t= ( REGISTER_ARM64_V7 + 1 ) ,\n        REGISTER_ARM64_V9\t= ( REGISTER_ARM64_V8 + 1 ) ,\n        REGISTER_ARM64_V10\t= ( REGISTER_ARM64_V9 + 1 ) ,\n        REGISTER_ARM64_V11\t= ( REGISTER_ARM64_V10 + 1 ) ,\n        REGISTER_ARM64_V12\t= ( REGISTER_ARM64_V11 + 1 ) ,\n        REGISTER_ARM64_V13\t= ( REGISTER_ARM64_V12 + 1 ) ,\n        REGISTER_ARM64_V14\t= ( REGISTER_ARM64_V13 + 1 ) ,\n        REGISTER_ARM64_V15\t= ( REGISTER_ARM64_V14 + 1 ) ,\n        REGISTER_ARM64_V16\t= ( REGISTER_ARM64_V15 + 1 ) ,\n        REGISTER_ARM64_V17\t= ( REGISTER_ARM64_V16 + 1 ) ,\n        REGISTER_ARM64_V18\t= ( REGISTER_ARM64_V17 + 1 ) ,\n        REGISTER_ARM64_V19\t= ( REGISTER_ARM64_V18 + 1 ) ,\n        REGISTER_ARM64_V20\t= ( REGISTER_ARM64_V19 + 1 ) ,\n        REGISTER_ARM64_V21\t= ( REGISTER_ARM64_V20 + 1 ) ,\n        REGISTER_ARM64_V22\t= ( REGISTER_ARM64_V21 + 1 ) ,\n        REGISTER_ARM64_V23\t= ( REGISTER_ARM64_V22 + 1 ) ,\n        REGISTER_ARM64_V24\t= ( REGISTER_ARM64_V23 + 1 ) ,\n        REGISTER_ARM64_V25\t= ( REGISTER_ARM64_V24 + 1 ) ,\n        REGISTER_ARM64_V26\t= ( REGISTER_ARM64_V25 + 1 ) ,\n        REGISTER_ARM64_V27\t= ( REGISTER_ARM64_V26 + 1 ) ,\n        REGISTER_ARM64_V28\t= ( REGISTER_ARM64_V27 + 1 ) ,\n        REGISTER_ARM64_V29\t= ( REGISTER_ARM64_V28 + 1 ) ,\n        REGISTER_ARM64_V30\t= ( REGISTER_ARM64_V29 + 1 ) ,\n        REGISTER_ARM64_V31\t= ( REGISTER_ARM64_V30 + 1 ) ,\n        REGISTER_LOONGARCH64_PC = 0,\n        REGISTER_LOONGARCH64_SP = ( REGISTER_LOONGARCH64_PC + 1 ) ,\n        REGISTER_LOONGARCH64_FP = ( REGISTER_LOONGARCH64_SP + 1 ) ,\n        REGISTER_LOONGARCH64_RA = ( REGISTER_LOONGARCH64_FP + 1 ) ,\n        REGISTER_LOONGARCH64_TP = ( REGISTER_LOONGARCH64_RA + 1 ) ,\n        REGISTER_LOONGARCH64_A0 = ( REGISTER_LOONGARCH64_TP + 1 ) ,\n        REGISTER_LOONGARCH64_A1 = ( REGISTER_LOONGARCH64_A0 + 1 ) ,\n        REGISTER_LOONGARCH64_A2 = ( REGISTER_LOONGARCH64_A1 + 1 ) ,\n        REGISTER_LOONGARCH64_A3 = ( REGISTER_LOONGARCH64_A2 + 1 ) ,\n        REGISTER_LOONGARCH64_A4 = ( REGISTER_LOONGARCH64_A3 + 1 ) ,\n        REGISTER_LOONGARCH64_A5 = ( REGISTER_LOONGARCH64_A4 + 1 ) ,\n        REGISTER_LOONGARCH64_A6 = ( REGISTER_LOONGARCH64_A5 + 1 ) ,\n        REGISTER_LOONGARCH64_A7 = ( REGISTER_LOONGARCH64_A6 + 1 ) ,\n        REGISTER_LOONGARCH64_T0 = ( REGISTER_LOONGARCH64_A7 + 1 ) ,\n        REGISTER_LOONGARCH64_T1 = ( REGISTER_LOONGARCH64_T0 + 1 ) ,\n        REGISTER_LOONGARCH64_T2 = ( REGISTER_LOONGARCH64_T1 + 1 ) ,\n        REGISTER_LOONGARCH64_T3 = ( REGISTER_LOONGARCH64_T2 + 1 ) ,\n        REGISTER_LOONGARCH64_T4 = ( REGISTER_LOONGARCH64_T3 + 1 ) ,\n        REGISTER_LOONGARCH64_T5 = ( REGISTER_LOONGARCH64_T4 + 1 ) ,\n        REGISTER_LOONGARCH64_T6 = ( REGISTER_LOONGARCH64_T5 + 1 ) ,\n        REGISTER_LOONGARCH64_T7 = ( REGISTER_LOONGARCH64_T6 + 1 ) ,\n        REGISTER_LOONGARCH64_T8 = ( REGISTER_LOONGARCH64_T7 + 1 ) ,\n        REGISTER_LOONGARCH64_X0 = ( REGISTER_LOONGARCH64_T8 + 1 ) ,\n        REGISTER_LOONGARCH64_S0 = ( REGISTER_LOONGARCH64_X0 + 1 ) ,\n        REGISTER_LOONGARCH64_S1 = ( REGISTER_LOONGARCH64_S0 + 1 ) ,\n        REGISTER_LOONGARCH64_S2 = ( REGISTER_LOONGARCH64_S1 + 1 ) ,\n        REGISTER_LOONGARCH64_S3 = ( REGISTER_LOONGARCH64_S2 + 1 ) ,\n        REGISTER_LOONGARCH64_S4 = ( REGISTER_LOONGARCH64_S3 + 1 ) ,\n        REGISTER_LOONGARCH64_S5 = ( REGISTER_LOONGARCH64_S4 + 1 ) ,\n        REGISTER_LOONGARCH64_S6 = ( REGISTER_LOONGARCH64_S5 + 1 ) ,\n        REGISTER_LOONGARCH64_S7 = ( REGISTER_LOONGARCH64_S6 + 1 ) ,\n        REGISTER_LOONGARCH64_S8 = ( REGISTER_LOONGARCH64_S7 + 1 ) ,\n        REGISTER_LOONGARCH64_F0 = ( REGISTER_LOONGARCH64_S8 + 1 ) ,\n        REGISTER_LOONGARCH64_F1 = ( REGISTER_LOONGARCH64_F0 + 1 ) ,\n        REGISTER_LOONGARCH64_F2 = ( REGISTER_LOONGARCH64_F1 + 1 ) ,\n        REGISTER_LOONGARCH64_F3 = ( REGISTER_LOONGARCH64_F2 + 1 ) ,\n        REGISTER_LOONGARCH64_F4 = ( REGISTER_LOONGARCH64_F3 + 1 ) ,\n        REGISTER_LOONGARCH64_F5 = ( REGISTER_LOONGARCH64_F4 + 1 ) ,\n        REGISTER_LOONGARCH64_F6 = ( REGISTER_LOONGARCH64_F5 + 1 ) ,\n        REGISTER_LOONGARCH64_F7 = ( REGISTER_LOONGARCH64_F6 + 1 ) ,\n        REGISTER_LOONGARCH64_F8 = ( REGISTER_LOONGARCH64_F7 + 1 ) ,\n        REGISTER_LOONGARCH64_F9 = ( REGISTER_LOONGARCH64_F8 + 1 ) ,\n        REGISTER_LOONGARCH64_F10 = ( REGISTER_LOONGARCH64_F9 + 1 ) ,\n        REGISTER_LOONGARCH64_F11 = ( REGISTER_LOONGARCH64_F10 + 1 ) ,\n        REGISTER_LOONGARCH64_F12 = ( REGISTER_LOONGARCH64_F11 + 1 ) ,\n        REGISTER_LOONGARCH64_F13 = ( REGISTER_LOONGARCH64_F12 + 1 ) ,\n        REGISTER_LOONGARCH64_F14 = ( REGISTER_LOONGARCH64_F13 + 1 ) ,\n        REGISTER_LOONGARCH64_F15 = ( REGISTER_LOONGARCH64_F14 + 1 ) ,\n        REGISTER_LOONGARCH64_F16 = ( REGISTER_LOONGARCH64_F15 + 1 ) ,\n        REGISTER_LOONGARCH64_F17 = ( REGISTER_LOONGARCH64_F16 + 1 ) ,\n        REGISTER_LOONGARCH64_F18 = ( REGISTER_LOONGARCH64_F17 + 1 ) ,\n        REGISTER_LOONGARCH64_F19 = ( REGISTER_LOONGARCH64_F18 + 1 ) ,\n        REGISTER_LOONGARCH64_F20 = ( REGISTER_LOONGARCH64_F19 + 1 ) ,\n        REGISTER_LOONGARCH64_F21 = ( REGISTER_LOONGARCH64_F20 + 1 ) ,\n        REGISTER_LOONGARCH64_F22 = ( REGISTER_LOONGARCH64_F21 + 1 ) ,\n        REGISTER_LOONGARCH64_F23 = ( REGISTER_LOONGARCH64_F22 + 1 ) ,\n        REGISTER_LOONGARCH64_F24 = ( REGISTER_LOONGARCH64_F23 + 1 ) ,\n        REGISTER_LOONGARCH64_F25 = ( REGISTER_LOONGARCH64_F24 + 1 ) ,\n        REGISTER_LOONGARCH64_F26 = ( REGISTER_LOONGARCH64_F25 + 1 ) ,\n        REGISTER_LOONGARCH64_F27 = ( REGISTER_LOONGARCH64_F26 + 1 ) ,\n        REGISTER_LOONGARCH64_F28 = ( REGISTER_LOONGARCH64_F27 + 1 ) ,\n        REGISTER_LOONGARCH64_F29 = ( REGISTER_LOONGARCH64_F28 + 1 ) ,\n        REGISTER_LOONGARCH64_F30 = ( REGISTER_LOONGARCH64_F29 + 1 ) ,\n        REGISTER_LOONGARCH64_F31 = ( REGISTER_LOONGARCH64_F30 + 1 )\n    } \tCorDebugRegister;\n\n\nEXTERN_C const IID IID_ICorDebugRegisterSet;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB0B-8A68-11d2-983C-0000F808342D\")\n    ICorDebugRegisterSet : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetRegistersAvailable(\n            /* [out] */ ULONG64 *pAvailable) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRegisters(\n            /* [in] */ ULONG64 mask,\n            /* [in] */ ULONG32 regCount,\n            /* [length_is][size_is][out] */ CORDB_REGISTER regBuffer[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetRegisters(\n            /* [in] */ ULONG64 mask,\n            /* [in] */ ULONG32 regCount,\n            /* [size_is][in] */ CORDB_REGISTER regBuffer[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadContext(\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][out][in] */ BYTE context[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetThreadContext(\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][in] */ BYTE context[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugRegisterSetVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugRegisterSet * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugRegisterSet * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugRegisterSet * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegistersAvailable )(\n            ICorDebugRegisterSet * This,\n            /* [out] */ ULONG64 *pAvailable);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegisters )(\n            ICorDebugRegisterSet * This,\n            /* [in] */ ULONG64 mask,\n            /* [in] */ ULONG32 regCount,\n            /* [length_is][size_is][out] */ CORDB_REGISTER regBuffer[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetRegisters )(\n            ICorDebugRegisterSet * This,\n            /* [in] */ ULONG64 mask,\n            /* [in] */ ULONG32 regCount,\n            /* [size_is][in] */ CORDB_REGISTER regBuffer[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorDebugRegisterSet * This,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][out][in] */ BYTE context[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetThreadContext )(\n            ICorDebugRegisterSet * This,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][length_is][in] */ BYTE context[  ]);\n\n        END_INTERFACE\n    } ICorDebugRegisterSetVtbl;\n\n    interface ICorDebugRegisterSet\n    {\n        CONST_VTBL struct ICorDebugRegisterSetVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugRegisterSet_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugRegisterSet_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugRegisterSet_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugRegisterSet_GetRegistersAvailable(This,pAvailable)\t\\\n    ( (This)->lpVtbl -> GetRegistersAvailable(This,pAvailable) )\n\n#define ICorDebugRegisterSet_GetRegisters(This,mask,regCount,regBuffer)\t\\\n    ( (This)->lpVtbl -> GetRegisters(This,mask,regCount,regBuffer) )\n\n#define ICorDebugRegisterSet_SetRegisters(This,mask,regCount,regBuffer)\t\\\n    ( (This)->lpVtbl -> SetRegisters(This,mask,regCount,regBuffer) )\n\n#define ICorDebugRegisterSet_GetThreadContext(This,contextSize,context)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,contextSize,context) )\n\n#define ICorDebugRegisterSet_SetThreadContext(This,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetThreadContext(This,contextSize,context) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugRegisterSet_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugRegisterSet2_INTERFACE_DEFINED__\n#define __ICorDebugRegisterSet2_INTERFACE_DEFINED__\n\n/* interface ICorDebugRegisterSet2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugRegisterSet2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"6DC7BA3F-89BA-4459-9EC1-9D60937B468D\")\n    ICorDebugRegisterSet2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetRegistersAvailable(\n            /* [in] */ ULONG32 numChunks,\n            /* [size_is][out] */ BYTE availableRegChunks[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRegisters(\n            /* [in] */ ULONG32 maskCount,\n            /* [size_is][in] */ BYTE mask[  ],\n            /* [in] */ ULONG32 regCount,\n            /* [size_is][out] */ CORDB_REGISTER regBuffer[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetRegisters(\n            /* [in] */ ULONG32 maskCount,\n            /* [size_is][in] */ BYTE mask[  ],\n            /* [in] */ ULONG32 regCount,\n            /* [size_is][in] */ CORDB_REGISTER regBuffer[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugRegisterSet2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugRegisterSet2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugRegisterSet2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugRegisterSet2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegistersAvailable )(\n            ICorDebugRegisterSet2 * This,\n            /* [in] */ ULONG32 numChunks,\n            /* [size_is][out] */ BYTE availableRegChunks[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegisters )(\n            ICorDebugRegisterSet2 * This,\n            /* [in] */ ULONG32 maskCount,\n            /* [size_is][in] */ BYTE mask[  ],\n            /* [in] */ ULONG32 regCount,\n            /* [size_is][out] */ CORDB_REGISTER regBuffer[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetRegisters )(\n            ICorDebugRegisterSet2 * This,\n            /* [in] */ ULONG32 maskCount,\n            /* [size_is][in] */ BYTE mask[  ],\n            /* [in] */ ULONG32 regCount,\n            /* [size_is][in] */ CORDB_REGISTER regBuffer[  ]);\n\n        END_INTERFACE\n    } ICorDebugRegisterSet2Vtbl;\n\n    interface ICorDebugRegisterSet2\n    {\n        CONST_VTBL struct ICorDebugRegisterSet2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugRegisterSet2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugRegisterSet2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugRegisterSet2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugRegisterSet2_GetRegistersAvailable(This,numChunks,availableRegChunks)\t\\\n    ( (This)->lpVtbl -> GetRegistersAvailable(This,numChunks,availableRegChunks) )\n\n#define ICorDebugRegisterSet2_GetRegisters(This,maskCount,mask,regCount,regBuffer)\t\\\n    ( (This)->lpVtbl -> GetRegisters(This,maskCount,mask,regCount,regBuffer) )\n\n#define ICorDebugRegisterSet2_SetRegisters(This,maskCount,mask,regCount,regBuffer)\t\\\n    ( (This)->lpVtbl -> SetRegisters(This,maskCount,mask,regCount,regBuffer) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugRegisterSet2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugThread_INTERFACE_DEFINED__\n#define __ICorDebugThread_INTERFACE_DEFINED__\n\n/* interface ICorDebugThread */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugUserState\n    {\n        USER_STOP_REQUESTED\t= 0x1,\n        USER_SUSPEND_REQUESTED\t= 0x2,\n        USER_BACKGROUND\t= 0x4,\n        USER_UNSTARTED\t= 0x8,\n        USER_STOPPED\t= 0x10,\n        USER_WAIT_SLEEP_JOIN\t= 0x20,\n        USER_SUSPENDED\t= 0x40,\n        USER_UNSAFE_POINT\t= 0x80,\n        USER_THREADPOOL\t= 0x100\n    } \tCorDebugUserState;\n\n\nEXTERN_C const IID IID_ICorDebugThread;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"938c6d66-7fb6-4f69-b389-425b8987329b\")\n    ICorDebugThread : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetProcess(\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetID(\n            /* [out] */ DWORD *pdwThreadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHandle(\n            /* [out] */ HTHREAD *phThreadHandle) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomain(\n            /* [out] */ ICorDebugAppDomain **ppAppDomain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetDebugState(\n            /* [in] */ CorDebugThreadState state) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDebugState(\n            /* [out] */ CorDebugThreadState *pState) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetUserState(\n            /* [out] */ CorDebugUserState *pState) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCurrentException(\n            /* [out] */ ICorDebugValue **ppExceptionObject) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ClearCurrentException( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateStepper(\n            /* [out] */ ICorDebugStepper **ppStepper) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateChains(\n            /* [out] */ ICorDebugChainEnum **ppChains) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetActiveChain(\n            /* [out] */ ICorDebugChain **ppChain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetActiveFrame(\n            /* [out] */ ICorDebugFrame **ppFrame) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRegisterSet(\n            /* [out] */ ICorDebugRegisterSet **ppRegisters) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateEval(\n            /* [out] */ ICorDebugEval **ppEval) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObject(\n            /* [out] */ ICorDebugValue **ppObject) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugThreadVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugThread * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugThread * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugThread * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetProcess )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *GetID )(\n            ICorDebugThread * This,\n            /* [out] */ DWORD *pdwThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandle )(\n            ICorDebugThread * This,\n            /* [out] */ HTHREAD *phThreadHandle);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomain )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugAppDomain **ppAppDomain);\n\n        HRESULT ( STDMETHODCALLTYPE *SetDebugState )(\n            ICorDebugThread * This,\n            /* [in] */ CorDebugThreadState state);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDebugState )(\n            ICorDebugThread * This,\n            /* [out] */ CorDebugThreadState *pState);\n\n        HRESULT ( STDMETHODCALLTYPE *GetUserState )(\n            ICorDebugThread * This,\n            /* [out] */ CorDebugUserState *pState);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentException )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugValue **ppExceptionObject);\n\n        HRESULT ( STDMETHODCALLTYPE *ClearCurrentException )(\n            ICorDebugThread * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateStepper )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugStepper **ppStepper);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateChains )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugChainEnum **ppChains);\n\n        HRESULT ( STDMETHODCALLTYPE *GetActiveChain )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetActiveFrame )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegisterSet )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugRegisterSet **ppRegisters);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateEval )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugEval **ppEval);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObject )(\n            ICorDebugThread * This,\n            /* [out] */ ICorDebugValue **ppObject);\n\n        END_INTERFACE\n    } ICorDebugThreadVtbl;\n\n    interface ICorDebugThread\n    {\n        CONST_VTBL struct ICorDebugThreadVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugThread_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugThread_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugThread_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugThread_GetProcess(This,ppProcess)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,ppProcess) )\n\n#define ICorDebugThread_GetID(This,pdwThreadId)\t\\\n    ( (This)->lpVtbl -> GetID(This,pdwThreadId) )\n\n#define ICorDebugThread_GetHandle(This,phThreadHandle)\t\\\n    ( (This)->lpVtbl -> GetHandle(This,phThreadHandle) )\n\n#define ICorDebugThread_GetAppDomain(This,ppAppDomain)\t\\\n    ( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) )\n\n#define ICorDebugThread_SetDebugState(This,state)\t\\\n    ( (This)->lpVtbl -> SetDebugState(This,state) )\n\n#define ICorDebugThread_GetDebugState(This,pState)\t\\\n    ( (This)->lpVtbl -> GetDebugState(This,pState) )\n\n#define ICorDebugThread_GetUserState(This,pState)\t\\\n    ( (This)->lpVtbl -> GetUserState(This,pState) )\n\n#define ICorDebugThread_GetCurrentException(This,ppExceptionObject)\t\\\n    ( (This)->lpVtbl -> GetCurrentException(This,ppExceptionObject) )\n\n#define ICorDebugThread_ClearCurrentException(This)\t\\\n    ( (This)->lpVtbl -> ClearCurrentException(This) )\n\n#define ICorDebugThread_CreateStepper(This,ppStepper)\t\\\n    ( (This)->lpVtbl -> CreateStepper(This,ppStepper) )\n\n#define ICorDebugThread_EnumerateChains(This,ppChains)\t\\\n    ( (This)->lpVtbl -> EnumerateChains(This,ppChains) )\n\n#define ICorDebugThread_GetActiveChain(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetActiveChain(This,ppChain) )\n\n#define ICorDebugThread_GetActiveFrame(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) )\n\n#define ICorDebugThread_GetRegisterSet(This,ppRegisters)\t\\\n    ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) )\n\n#define ICorDebugThread_CreateEval(This,ppEval)\t\\\n    ( (This)->lpVtbl -> CreateEval(This,ppEval) )\n\n#define ICorDebugThread_GetObject(This,ppObject)\t\\\n    ( (This)->lpVtbl -> GetObject(This,ppObject) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugThread_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugThread2_INTERFACE_DEFINED__\n#define __ICorDebugThread2_INTERFACE_DEFINED__\n\n/* interface ICorDebugThread2 */\n/* [unique][uuid][local][object] */\n\ntypedef struct _COR_ACTIVE_FUNCTION\n    {\n    ICorDebugAppDomain *pAppDomain;\n    ICorDebugModule *pModule;\n    ICorDebugFunction2 *pFunction;\n    ULONG32 ilOffset;\n    ULONG32 flags;\n    } \tCOR_ACTIVE_FUNCTION;\n\n\nEXTERN_C const IID IID_ICorDebugThread2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"2BD956D9-7B07-4bef-8A98-12AA862417C5\")\n    ICorDebugThread2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetActiveFunctions(\n            /* [in] */ ULONG32 cFunctions,\n            /* [out] */ ULONG32 *pcFunctions,\n            /* [length_is][size_is][out][in] */ COR_ACTIVE_FUNCTION pFunctions[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetConnectionID(\n            /* [out] */ CONNID *pdwConnectionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTaskID(\n            /* [out] */ TASKID *pTaskId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetVolatileOSThreadID(\n            /* [out] */ DWORD *pdwTid) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE InterceptCurrentException(\n            /* [in] */ ICorDebugFrame *pFrame) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugThread2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugThread2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugThread2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugThread2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetActiveFunctions )(\n            ICorDebugThread2 * This,\n            /* [in] */ ULONG32 cFunctions,\n            /* [out] */ ULONG32 *pcFunctions,\n            /* [length_is][size_is][out][in] */ COR_ACTIVE_FUNCTION pFunctions[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetConnectionID )(\n            ICorDebugThread2 * This,\n            /* [out] */ CONNID *pdwConnectionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTaskID )(\n            ICorDebugThread2 * This,\n            /* [out] */ TASKID *pTaskId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVolatileOSThreadID )(\n            ICorDebugThread2 * This,\n            /* [out] */ DWORD *pdwTid);\n\n        HRESULT ( STDMETHODCALLTYPE *InterceptCurrentException )(\n            ICorDebugThread2 * This,\n            /* [in] */ ICorDebugFrame *pFrame);\n\n        END_INTERFACE\n    } ICorDebugThread2Vtbl;\n\n    interface ICorDebugThread2\n    {\n        CONST_VTBL struct ICorDebugThread2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugThread2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugThread2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugThread2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugThread2_GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions)\t\\\n    ( (This)->lpVtbl -> GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) )\n\n#define ICorDebugThread2_GetConnectionID(This,pdwConnectionId)\t\\\n    ( (This)->lpVtbl -> GetConnectionID(This,pdwConnectionId) )\n\n#define ICorDebugThread2_GetTaskID(This,pTaskId)\t\\\n    ( (This)->lpVtbl -> GetTaskID(This,pTaskId) )\n\n#define ICorDebugThread2_GetVolatileOSThreadID(This,pdwTid)\t\\\n    ( (This)->lpVtbl -> GetVolatileOSThreadID(This,pdwTid) )\n\n#define ICorDebugThread2_InterceptCurrentException(This,pFrame)\t\\\n    ( (This)->lpVtbl -> InterceptCurrentException(This,pFrame) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugThread2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugThread3_INTERFACE_DEFINED__\n#define __ICorDebugThread3_INTERFACE_DEFINED__\n\n/* interface ICorDebugThread3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugThread3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F8544EC3-5E4E-46c7-8D3E-A52B8405B1F5\")\n    ICorDebugThread3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreateStackWalk(\n            /* [out] */ ICorDebugStackWalk **ppStackWalk) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetActiveInternalFrames(\n            /* [in] */ ULONG32 cInternalFrames,\n            /* [out] */ ULONG32 *pcInternalFrames,\n            /* [length_is][size_is][out][in] */ ICorDebugInternalFrame2 *ppInternalFrames[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugThread3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugThread3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugThread3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugThread3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateStackWalk )(\n            ICorDebugThread3 * This,\n            /* [out] */ ICorDebugStackWalk **ppStackWalk);\n\n        HRESULT ( STDMETHODCALLTYPE *GetActiveInternalFrames )(\n            ICorDebugThread3 * This,\n            /* [in] */ ULONG32 cInternalFrames,\n            /* [out] */ ULONG32 *pcInternalFrames,\n            /* [length_is][size_is][out][in] */ ICorDebugInternalFrame2 *ppInternalFrames[  ]);\n\n        END_INTERFACE\n    } ICorDebugThread3Vtbl;\n\n    interface ICorDebugThread3\n    {\n        CONST_VTBL struct ICorDebugThread3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugThread3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugThread3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugThread3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugThread3_CreateStackWalk(This,ppStackWalk)\t\\\n    ( (This)->lpVtbl -> CreateStackWalk(This,ppStackWalk) )\n\n#define ICorDebugThread3_GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames)\t\\\n    ( (This)->lpVtbl -> GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugThread3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugThread4_INTERFACE_DEFINED__\n#define __ICorDebugThread4_INTERFACE_DEFINED__\n\n/* interface ICorDebugThread4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugThread4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"1A1F204B-1C66-4637-823F-3EE6C744A69C\")\n    ICorDebugThread4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE HasUnhandledException( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetBlockingObjects(\n            /* [out] */ ICorDebugBlockingObjectEnum **ppBlockingObjectEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCurrentCustomDebuggerNotification(\n            /* [out] */ ICorDebugValue **ppNotificationObject) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugThread4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugThread4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugThread4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugThread4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *HasUnhandledException )(\n            ICorDebugThread4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBlockingObjects )(\n            ICorDebugThread4 * This,\n            /* [out] */ ICorDebugBlockingObjectEnum **ppBlockingObjectEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentCustomDebuggerNotification )(\n            ICorDebugThread4 * This,\n            /* [out] */ ICorDebugValue **ppNotificationObject);\n\n        END_INTERFACE\n    } ICorDebugThread4Vtbl;\n\n    interface ICorDebugThread4\n    {\n        CONST_VTBL struct ICorDebugThread4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugThread4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugThread4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugThread4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugThread4_HasUnhandledException(This)\t\\\n    ( (This)->lpVtbl -> HasUnhandledException(This) )\n\n#define ICorDebugThread4_GetBlockingObjects(This,ppBlockingObjectEnum)\t\\\n    ( (This)->lpVtbl -> GetBlockingObjects(This,ppBlockingObjectEnum) )\n\n#define ICorDebugThread4_GetCurrentCustomDebuggerNotification(This,ppNotificationObject)\t\\\n    ( (This)->lpVtbl -> GetCurrentCustomDebuggerNotification(This,ppNotificationObject) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugThread4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugThread5_INTERFACE_DEFINED__\n#define __ICorDebugThread5_INTERFACE_DEFINED__\n\n/* interface ICorDebugThread5 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugThread5;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F98421C4-E506-4D24-916F-0237EE853EC6\")\n    ICorDebugThread5 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetBytesAllocated(\n            /* [out] */ ULONG64 *pSohAllocatedBytes,\n            /* [out] */ ULONG64 *pUohAllocatedBytes) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugThread5Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugThread5 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugThread5 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugThread5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBytesAllocated )(\n            ICorDebugThread5 * This,\n            /* [out] */ ULONG64 *pSohAllocatedBytes,\n            /* [out] */ ULONG64 *pUohAllocatedBytes);\n\n        END_INTERFACE\n    } ICorDebugThread5Vtbl;\n\n    interface ICorDebugThread5\n    {\n        CONST_VTBL struct ICorDebugThread5Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugThread5_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugThread5_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugThread5_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugThread5_GetBytesAllocated(This,pSohAllocatedBytes,pUohAllocatedBytes)\t\\\n    ( (This)->lpVtbl -> GetBytesAllocated(This,pSohAllocatedBytes,pUohAllocatedBytes) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugThread5_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugStackWalk_INTERFACE_DEFINED__\n#define __ICorDebugStackWalk_INTERFACE_DEFINED__\n\n/* interface ICorDebugStackWalk */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugSetContextFlag\n    {\n        SET_CONTEXT_FLAG_ACTIVE_FRAME\t= 0x1,\n        SET_CONTEXT_FLAG_UNWIND_FRAME\t= 0x2\n    } \tCorDebugSetContextFlag;\n\n\nEXTERN_C const IID IID_ICorDebugStackWalk;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"A0647DE9-55DE-4816-929C-385271C64CF7\")\n    ICorDebugStackWalk : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetContext(\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetContext(\n            /* [in] */ CorDebugSetContextFlag flag,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Next( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFrame(\n            /* [out] */ ICorDebugFrame **pFrame) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugStackWalkVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugStackWalk * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugStackWalk * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugStackWalk * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContext )(\n            ICorDebugStackWalk * This,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetContext )(\n            ICorDebugStackWalk * This,\n            /* [in] */ CorDebugSetContextFlag flag,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugStackWalk * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFrame )(\n            ICorDebugStackWalk * This,\n            /* [out] */ ICorDebugFrame **pFrame);\n\n        END_INTERFACE\n    } ICorDebugStackWalkVtbl;\n\n    interface ICorDebugStackWalk\n    {\n        CONST_VTBL struct ICorDebugStackWalkVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugStackWalk_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugStackWalk_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugStackWalk_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf)\t\\\n    ( (This)->lpVtbl -> GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) )\n\n#define ICorDebugStackWalk_SetContext(This,flag,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetContext(This,flag,contextSize,context) )\n\n#define ICorDebugStackWalk_Next(This)\t\\\n    ( (This)->lpVtbl -> Next(This) )\n\n#define ICorDebugStackWalk_GetFrame(This,pFrame)\t\\\n    ( (This)->lpVtbl -> GetFrame(This,pFrame) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugStackWalk_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugChain_INTERFACE_DEFINED__\n#define __ICorDebugChain_INTERFACE_DEFINED__\n\n/* interface ICorDebugChain */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugChainReason\n    {\n        CHAIN_NONE\t= 0,\n        CHAIN_CLASS_INIT\t= 0x1,\n        CHAIN_EXCEPTION_FILTER\t= 0x2,\n        CHAIN_SECURITY\t= 0x4,\n        CHAIN_CONTEXT_POLICY\t= 0x8,\n        CHAIN_INTERCEPTION\t= 0x10,\n        CHAIN_PROCESS_START\t= 0x20,\n        CHAIN_THREAD_START\t= 0x40,\n        CHAIN_ENTER_MANAGED\t= 0x80,\n        CHAIN_ENTER_UNMANAGED\t= 0x100,\n        CHAIN_DEBUGGER_EVAL\t= 0x200,\n        CHAIN_CONTEXT_SWITCH\t= 0x400,\n        CHAIN_FUNC_EVAL\t= 0x800\n    } \tCorDebugChainReason;\n\n\nEXTERN_C const IID IID_ICorDebugChain;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAEE-8A68-11d2-983C-0000F808342D\")\n    ICorDebugChain : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetThread(\n            /* [out] */ ICorDebugThread **ppThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStackRange(\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetContext(\n            /* [out] */ ICorDebugContext **ppContext) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCaller(\n            /* [out] */ ICorDebugChain **ppChain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCallee(\n            /* [out] */ ICorDebugChain **ppChain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetPrevious(\n            /* [out] */ ICorDebugChain **ppChain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetNext(\n            /* [out] */ ICorDebugChain **ppChain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsManaged(\n            /* [out] */ BOOL *pManaged) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateFrames(\n            /* [out] */ ICorDebugFrameEnum **ppFrames) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetActiveFrame(\n            /* [out] */ ICorDebugFrame **ppFrame) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRegisterSet(\n            /* [out] */ ICorDebugRegisterSet **ppRegisters) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetReason(\n            /* [out] */ CorDebugChainReason *pReason) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugChainVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugChain * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugChain * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugChain * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThread )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugThread **ppThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackRange )(\n            ICorDebugChain * This,\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContext )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugContext **ppContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCaller )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCallee )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPrevious )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNext )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *IsManaged )(\n            ICorDebugChain * This,\n            /* [out] */ BOOL *pManaged);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateFrames )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugFrameEnum **ppFrames);\n\n        HRESULT ( STDMETHODCALLTYPE *GetActiveFrame )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegisterSet )(\n            ICorDebugChain * This,\n            /* [out] */ ICorDebugRegisterSet **ppRegisters);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReason )(\n            ICorDebugChain * This,\n            /* [out] */ CorDebugChainReason *pReason);\n\n        END_INTERFACE\n    } ICorDebugChainVtbl;\n\n    interface ICorDebugChain\n    {\n        CONST_VTBL struct ICorDebugChainVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugChain_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugChain_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugChain_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugChain_GetThread(This,ppThread)\t\\\n    ( (This)->lpVtbl -> GetThread(This,ppThread) )\n\n#define ICorDebugChain_GetStackRange(This,pStart,pEnd)\t\\\n    ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )\n\n#define ICorDebugChain_GetContext(This,ppContext)\t\\\n    ( (This)->lpVtbl -> GetContext(This,ppContext) )\n\n#define ICorDebugChain_GetCaller(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetCaller(This,ppChain) )\n\n#define ICorDebugChain_GetCallee(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetCallee(This,ppChain) )\n\n#define ICorDebugChain_GetPrevious(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetPrevious(This,ppChain) )\n\n#define ICorDebugChain_GetNext(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetNext(This,ppChain) )\n\n#define ICorDebugChain_IsManaged(This,pManaged)\t\\\n    ( (This)->lpVtbl -> IsManaged(This,pManaged) )\n\n#define ICorDebugChain_EnumerateFrames(This,ppFrames)\t\\\n    ( (This)->lpVtbl -> EnumerateFrames(This,ppFrames) )\n\n#define ICorDebugChain_GetActiveFrame(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) )\n\n#define ICorDebugChain_GetRegisterSet(This,ppRegisters)\t\\\n    ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) )\n\n#define ICorDebugChain_GetReason(This,pReason)\t\\\n    ( (This)->lpVtbl -> GetReason(This,pReason) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugChain_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugFrame_INTERFACE_DEFINED__\n#define __ICorDebugFrame_INTERFACE_DEFINED__\n\n/* interface ICorDebugFrame */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugFrame;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAEF-8A68-11d2-983C-0000F808342D\")\n    ICorDebugFrame : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetChain(\n            /* [out] */ ICorDebugChain **ppChain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCode(\n            /* [out] */ ICorDebugCode **ppCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunction(\n            /* [out] */ ICorDebugFunction **ppFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionToken(\n            /* [out] */ mdMethodDef *pToken) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStackRange(\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCaller(\n            /* [out] */ ICorDebugFrame **ppFrame) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCallee(\n            /* [out] */ ICorDebugFrame **ppFrame) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateStepper(\n            /* [out] */ ICorDebugStepper **ppStepper) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugFrameVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugFrame * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugFrame * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugFrame * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetChain )(\n            ICorDebugFrame * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugFrame * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugFrame * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )(\n            ICorDebugFrame * This,\n            /* [out] */ mdMethodDef *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackRange )(\n            ICorDebugFrame * This,\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCaller )(\n            ICorDebugFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCallee )(\n            ICorDebugFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateStepper )(\n            ICorDebugFrame * This,\n            /* [out] */ ICorDebugStepper **ppStepper);\n\n        END_INTERFACE\n    } ICorDebugFrameVtbl;\n\n    interface ICorDebugFrame\n    {\n        CONST_VTBL struct ICorDebugFrameVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugFrame_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugFrame_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugFrame_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugFrame_GetChain(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetChain(This,ppChain) )\n\n#define ICorDebugFrame_GetCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCode(This,ppCode) )\n\n#define ICorDebugFrame_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#define ICorDebugFrame_GetFunctionToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetFunctionToken(This,pToken) )\n\n#define ICorDebugFrame_GetStackRange(This,pStart,pEnd)\t\\\n    ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )\n\n#define ICorDebugFrame_GetCaller(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCaller(This,ppFrame) )\n\n#define ICorDebugFrame_GetCallee(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCallee(This,ppFrame) )\n\n#define ICorDebugFrame_CreateStepper(This,ppStepper)\t\\\n    ( (This)->lpVtbl -> CreateStepper(This,ppStepper) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugFrame_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugInternalFrame_INTERFACE_DEFINED__\n#define __ICorDebugInternalFrame_INTERFACE_DEFINED__\n\n/* interface ICorDebugInternalFrame */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugInternalFrameType\n    {\n        STUBFRAME_NONE\t= 0,\n        STUBFRAME_M2U\t= 0x1,\n        STUBFRAME_U2M\t= 0x2,\n        STUBFRAME_APPDOMAIN_TRANSITION\t= 0x3,\n        STUBFRAME_LIGHTWEIGHT_FUNCTION\t= 0x4,\n        STUBFRAME_FUNC_EVAL\t= 0x5,\n        STUBFRAME_INTERNALCALL\t= 0x6,\n        STUBFRAME_CLASS_INIT\t= 0x7,\n        STUBFRAME_EXCEPTION\t= 0x8,\n        STUBFRAME_SECURITY\t= 0x9,\n        STUBFRAME_JIT_COMPILATION\t= 0xa\n    } \tCorDebugInternalFrameType;\n\n\nEXTERN_C const IID IID_ICorDebugInternalFrame;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"B92CC7F7-9D2D-45c4-BC2B-621FCC9DFBF4\")\n    ICorDebugInternalFrame : public ICorDebugFrame\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetFrameType(\n            /* [out] */ CorDebugInternalFrameType *pType) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugInternalFrameVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugInternalFrame * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugInternalFrame * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugInternalFrame * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetChain )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ mdMethodDef *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackRange )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCaller )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCallee )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateStepper )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ ICorDebugStepper **ppStepper);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFrameType )(\n            ICorDebugInternalFrame * This,\n            /* [out] */ CorDebugInternalFrameType *pType);\n\n        END_INTERFACE\n    } ICorDebugInternalFrameVtbl;\n\n    interface ICorDebugInternalFrame\n    {\n        CONST_VTBL struct ICorDebugInternalFrameVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugInternalFrame_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugInternalFrame_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugInternalFrame_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugInternalFrame_GetChain(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetChain(This,ppChain) )\n\n#define ICorDebugInternalFrame_GetCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCode(This,ppCode) )\n\n#define ICorDebugInternalFrame_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#define ICorDebugInternalFrame_GetFunctionToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetFunctionToken(This,pToken) )\n\n#define ICorDebugInternalFrame_GetStackRange(This,pStart,pEnd)\t\\\n    ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )\n\n#define ICorDebugInternalFrame_GetCaller(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCaller(This,ppFrame) )\n\n#define ICorDebugInternalFrame_GetCallee(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCallee(This,ppFrame) )\n\n#define ICorDebugInternalFrame_CreateStepper(This,ppStepper)\t\\\n    ( (This)->lpVtbl -> CreateStepper(This,ppStepper) )\n\n\n#define ICorDebugInternalFrame_GetFrameType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetFrameType(This,pType) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugInternalFrame_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugInternalFrame2_INTERFACE_DEFINED__\n#define __ICorDebugInternalFrame2_INTERFACE_DEFINED__\n\n/* interface ICorDebugInternalFrame2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugInternalFrame2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"C0815BDC-CFAB-447e-A779-C116B454EB5B\")\n    ICorDebugInternalFrame2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetAddress(\n            /* [out] */ CORDB_ADDRESS *pAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsCloserToLeaf(\n            /* [in] */ ICorDebugFrame *pFrameToCompare,\n            /* [out] */ BOOL *pIsCloser) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugInternalFrame2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugInternalFrame2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugInternalFrame2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugInternalFrame2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugInternalFrame2 * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *IsCloserToLeaf )(\n            ICorDebugInternalFrame2 * This,\n            /* [in] */ ICorDebugFrame *pFrameToCompare,\n            /* [out] */ BOOL *pIsCloser);\n\n        END_INTERFACE\n    } ICorDebugInternalFrame2Vtbl;\n\n    interface ICorDebugInternalFrame2\n    {\n        CONST_VTBL struct ICorDebugInternalFrame2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugInternalFrame2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugInternalFrame2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugInternalFrame2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugInternalFrame2_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugInternalFrame2_IsCloserToLeaf(This,pFrameToCompare,pIsCloser)\t\\\n    ( (This)->lpVtbl -> IsCloserToLeaf(This,pFrameToCompare,pIsCloser) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugInternalFrame2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame_INTERFACE_DEFINED__\n#define __ICorDebugILFrame_INTERFACE_DEFINED__\n\n/* interface ICorDebugILFrame */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugMappingResult\n    {\n        MAPPING_PROLOG\t= 0x1,\n        MAPPING_EPILOG\t= 0x2,\n        MAPPING_NO_INFO\t= 0x4,\n        MAPPING_UNMAPPED_ADDRESS\t= 0x8,\n        MAPPING_EXACT\t= 0x10,\n        MAPPING_APPROXIMATE\t= 0x20\n    } \tCorDebugMappingResult;\n\n\nEXTERN_C const IID IID_ICorDebugILFrame;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"03E26311-4F76-11d3-88C6-006097945418\")\n    ICorDebugILFrame : public ICorDebugFrame\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetIP(\n            /* [out] */ ULONG32 *pnOffset,\n            /* [out] */ CorDebugMappingResult *pMappingResult) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetIP(\n            /* [in] */ ULONG32 nOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateLocalVariables(\n            /* [out] */ ICorDebugValueEnum **ppValueEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalVariable(\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateArguments(\n            /* [out] */ ICorDebugValueEnum **ppValueEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetArgument(\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStackDepth(\n            /* [out] */ ULONG32 *pDepth) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStackValue(\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CanSetIP(\n            /* [in] */ ULONG32 nOffset) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugILFrameVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugILFrame * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugILFrame * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugILFrame * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetChain )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )(\n            ICorDebugILFrame * This,\n            /* [out] */ mdMethodDef *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackRange )(\n            ICorDebugILFrame * This,\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCaller )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCallee )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateStepper )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugStepper **ppStepper);\n\n        HRESULT ( STDMETHODCALLTYPE *GetIP )(\n            ICorDebugILFrame * This,\n            /* [out] */ ULONG32 *pnOffset,\n            /* [out] */ CorDebugMappingResult *pMappingResult);\n\n        HRESULT ( STDMETHODCALLTYPE *SetIP )(\n            ICorDebugILFrame * This,\n            /* [in] */ ULONG32 nOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateLocalVariables )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugValueEnum **ppValueEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalVariable )(\n            ICorDebugILFrame * This,\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateArguments )(\n            ICorDebugILFrame * This,\n            /* [out] */ ICorDebugValueEnum **ppValueEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArgument )(\n            ICorDebugILFrame * This,\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackDepth )(\n            ICorDebugILFrame * This,\n            /* [out] */ ULONG32 *pDepth);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackValue )(\n            ICorDebugILFrame * This,\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *CanSetIP )(\n            ICorDebugILFrame * This,\n            /* [in] */ ULONG32 nOffset);\n\n        END_INTERFACE\n    } ICorDebugILFrameVtbl;\n\n    interface ICorDebugILFrame\n    {\n        CONST_VTBL struct ICorDebugILFrameVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugILFrame_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugILFrame_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugILFrame_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugILFrame_GetChain(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetChain(This,ppChain) )\n\n#define ICorDebugILFrame_GetCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCode(This,ppCode) )\n\n#define ICorDebugILFrame_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#define ICorDebugILFrame_GetFunctionToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetFunctionToken(This,pToken) )\n\n#define ICorDebugILFrame_GetStackRange(This,pStart,pEnd)\t\\\n    ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )\n\n#define ICorDebugILFrame_GetCaller(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCaller(This,ppFrame) )\n\n#define ICorDebugILFrame_GetCallee(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCallee(This,ppFrame) )\n\n#define ICorDebugILFrame_CreateStepper(This,ppStepper)\t\\\n    ( (This)->lpVtbl -> CreateStepper(This,ppStepper) )\n\n\n#define ICorDebugILFrame_GetIP(This,pnOffset,pMappingResult)\t\\\n    ( (This)->lpVtbl -> GetIP(This,pnOffset,pMappingResult) )\n\n#define ICorDebugILFrame_SetIP(This,nOffset)\t\\\n    ( (This)->lpVtbl -> SetIP(This,nOffset) )\n\n#define ICorDebugILFrame_EnumerateLocalVariables(This,ppValueEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateLocalVariables(This,ppValueEnum) )\n\n#define ICorDebugILFrame_GetLocalVariable(This,dwIndex,ppValue)\t\\\n    ( (This)->lpVtbl -> GetLocalVariable(This,dwIndex,ppValue) )\n\n#define ICorDebugILFrame_EnumerateArguments(This,ppValueEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateArguments(This,ppValueEnum) )\n\n#define ICorDebugILFrame_GetArgument(This,dwIndex,ppValue)\t\\\n    ( (This)->lpVtbl -> GetArgument(This,dwIndex,ppValue) )\n\n#define ICorDebugILFrame_GetStackDepth(This,pDepth)\t\\\n    ( (This)->lpVtbl -> GetStackDepth(This,pDepth) )\n\n#define ICorDebugILFrame_GetStackValue(This,dwIndex,ppValue)\t\\\n    ( (This)->lpVtbl -> GetStackValue(This,dwIndex,ppValue) )\n\n#define ICorDebugILFrame_CanSetIP(This,nOffset)\t\\\n    ( (This)->lpVtbl -> CanSetIP(This,nOffset) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugILFrame_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame2_INTERFACE_DEFINED__\n#define __ICorDebugILFrame2_INTERFACE_DEFINED__\n\n/* interface ICorDebugILFrame2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugILFrame2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"5D88A994-6C30-479b-890F-BCEF88B129A5\")\n    ICorDebugILFrame2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE RemapFunction(\n            /* [in] */ ULONG32 newILOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateTypeParameters(\n            /* [out] */ ICorDebugTypeEnum **ppTyParEnum) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugILFrame2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugILFrame2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugILFrame2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugILFrame2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemapFunction )(\n            ICorDebugILFrame2 * This,\n            /* [in] */ ULONG32 newILOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateTypeParameters )(\n            ICorDebugILFrame2 * This,\n            /* [out] */ ICorDebugTypeEnum **ppTyParEnum);\n\n        END_INTERFACE\n    } ICorDebugILFrame2Vtbl;\n\n    interface ICorDebugILFrame2\n    {\n        CONST_VTBL struct ICorDebugILFrame2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugILFrame2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugILFrame2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugILFrame2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugILFrame2_RemapFunction(This,newILOffset)\t\\\n    ( (This)->lpVtbl -> RemapFunction(This,newILOffset) )\n\n#define ICorDebugILFrame2_EnumerateTypeParameters(This,ppTyParEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugILFrame2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugILFrame3_INTERFACE_DEFINED__\n#define __ICorDebugILFrame3_INTERFACE_DEFINED__\n\n/* interface ICorDebugILFrame3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugILFrame3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"9A9E2ED6-04DF-4FE0-BB50-CAB64126AD24\")\n    ICorDebugILFrame3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetReturnValueForILOffset(\n            ULONG32 ILoffset,\n            /* [out] */ ICorDebugValue **ppReturnValue) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugILFrame3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugILFrame3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugILFrame3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugILFrame3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReturnValueForILOffset )(\n            ICorDebugILFrame3 * This,\n            ULONG32 ILoffset,\n            /* [out] */ ICorDebugValue **ppReturnValue);\n\n        END_INTERFACE\n    } ICorDebugILFrame3Vtbl;\n\n    interface ICorDebugILFrame3\n    {\n        CONST_VTBL struct ICorDebugILFrame3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugILFrame3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugILFrame3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugILFrame3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugILFrame3_GetReturnValueForILOffset(This,ILoffset,ppReturnValue)\t\\\n    ( (This)->lpVtbl -> GetReturnValueForILOffset(This,ILoffset,ppReturnValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugILFrame3_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0070 */\n/* [local] */\n\ntypedef\nenum ILCodeKind\n    {\n        ILCODE_ORIGINAL_IL\t= 0x1,\n        ILCODE_REJIT_IL\t= 0x2\n    } \tILCodeKind;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0070_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0070_v0_0_s_ifspec;\n\n#ifndef __ICorDebugILFrame4_INTERFACE_DEFINED__\n#define __ICorDebugILFrame4_INTERFACE_DEFINED__\n\n/* interface ICorDebugILFrame4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugILFrame4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"AD914A30-C6D1-4AC5-9C5E-577F3BAA8A45\")\n    ICorDebugILFrame4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumerateLocalVariablesEx(\n            /* [in] */ ILCodeKind flags,\n            /* [out] */ ICorDebugValueEnum **ppValueEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalVariableEx(\n            /* [in] */ ILCodeKind flags,\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeEx(\n            /* [in] */ ILCodeKind flags,\n            /* [out] */ ICorDebugCode **ppCode) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugILFrame4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugILFrame4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugILFrame4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugILFrame4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateLocalVariablesEx )(\n            ICorDebugILFrame4 * This,\n            /* [in] */ ILCodeKind flags,\n            /* [out] */ ICorDebugValueEnum **ppValueEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalVariableEx )(\n            ICorDebugILFrame4 * This,\n            /* [in] */ ILCodeKind flags,\n            /* [in] */ DWORD dwIndex,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeEx )(\n            ICorDebugILFrame4 * This,\n            /* [in] */ ILCodeKind flags,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        END_INTERFACE\n    } ICorDebugILFrame4Vtbl;\n\n    interface ICorDebugILFrame4\n    {\n        CONST_VTBL struct ICorDebugILFrame4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugILFrame4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugILFrame4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugILFrame4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugILFrame4_EnumerateLocalVariablesEx(This,flags,ppValueEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateLocalVariablesEx(This,flags,ppValueEnum) )\n\n#define ICorDebugILFrame4_GetLocalVariableEx(This,flags,dwIndex,ppValue)\t\\\n    ( (This)->lpVtbl -> GetLocalVariableEx(This,flags,dwIndex,ppValue) )\n\n#define ICorDebugILFrame4_GetCodeEx(This,flags,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCodeEx(This,flags,ppCode) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugILFrame4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugNativeFrame_INTERFACE_DEFINED__\n#define __ICorDebugNativeFrame_INTERFACE_DEFINED__\n\n/* interface ICorDebugNativeFrame */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugNativeFrame;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"03E26314-4F76-11d3-88C6-006097945418\")\n    ICorDebugNativeFrame : public ICorDebugFrame\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetIP(\n            /* [out] */ ULONG32 *pnOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetIP(\n            /* [in] */ ULONG32 nOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRegisterSet(\n            /* [out] */ ICorDebugRegisterSet **ppRegisters) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalRegisterValue(\n            /* [in] */ CorDebugRegister reg,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalDoubleRegisterValue(\n            /* [in] */ CorDebugRegister highWordReg,\n            /* [in] */ CorDebugRegister lowWordReg,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalMemoryValue(\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalRegisterMemoryValue(\n            /* [in] */ CorDebugRegister highWordReg,\n            /* [in] */ CORDB_ADDRESS lowWordAddress,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalMemoryRegisterValue(\n            /* [in] */ CORDB_ADDRESS highWordAddress,\n            /* [in] */ CorDebugRegister lowWordRegister,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CanSetIP(\n            /* [in] */ ULONG32 nOffset) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugNativeFrameVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugNativeFrame * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugNativeFrame * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetChain )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ mdMethodDef *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackRange )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCaller )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCallee )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateStepper )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ICorDebugStepper **ppStepper);\n\n        HRESULT ( STDMETHODCALLTYPE *GetIP )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ULONG32 *pnOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetIP )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ ULONG32 nOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegisterSet )(\n            ICorDebugNativeFrame * This,\n            /* [out] */ ICorDebugRegisterSet **ppRegisters);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalRegisterValue )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ CorDebugRegister reg,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalDoubleRegisterValue )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ CorDebugRegister highWordReg,\n            /* [in] */ CorDebugRegister lowWordReg,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalMemoryValue )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ CORDB_ADDRESS address,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalRegisterMemoryValue )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ CorDebugRegister highWordReg,\n            /* [in] */ CORDB_ADDRESS lowWordAddress,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalMemoryRegisterValue )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ CORDB_ADDRESS highWordAddress,\n            /* [in] */ CorDebugRegister lowWordRegister,\n            /* [in] */ ULONG cbSigBlob,\n            /* [in] */ PCCOR_SIGNATURE pvSigBlob,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *CanSetIP )(\n            ICorDebugNativeFrame * This,\n            /* [in] */ ULONG32 nOffset);\n\n        END_INTERFACE\n    } ICorDebugNativeFrameVtbl;\n\n    interface ICorDebugNativeFrame\n    {\n        CONST_VTBL struct ICorDebugNativeFrameVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugNativeFrame_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugNativeFrame_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugNativeFrame_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugNativeFrame_GetChain(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetChain(This,ppChain) )\n\n#define ICorDebugNativeFrame_GetCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCode(This,ppCode) )\n\n#define ICorDebugNativeFrame_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#define ICorDebugNativeFrame_GetFunctionToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetFunctionToken(This,pToken) )\n\n#define ICorDebugNativeFrame_GetStackRange(This,pStart,pEnd)\t\\\n    ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )\n\n#define ICorDebugNativeFrame_GetCaller(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCaller(This,ppFrame) )\n\n#define ICorDebugNativeFrame_GetCallee(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCallee(This,ppFrame) )\n\n#define ICorDebugNativeFrame_CreateStepper(This,ppStepper)\t\\\n    ( (This)->lpVtbl -> CreateStepper(This,ppStepper) )\n\n\n#define ICorDebugNativeFrame_GetIP(This,pnOffset)\t\\\n    ( (This)->lpVtbl -> GetIP(This,pnOffset) )\n\n#define ICorDebugNativeFrame_SetIP(This,nOffset)\t\\\n    ( (This)->lpVtbl -> SetIP(This,nOffset) )\n\n#define ICorDebugNativeFrame_GetRegisterSet(This,ppRegisters)\t\\\n    ( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) )\n\n#define ICorDebugNativeFrame_GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue)\t\\\n    ( (This)->lpVtbl -> GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) )\n\n#define ICorDebugNativeFrame_GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue)\t\\\n    ( (This)->lpVtbl -> GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) )\n\n#define ICorDebugNativeFrame_GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue)\t\\\n    ( (This)->lpVtbl -> GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) )\n\n#define ICorDebugNativeFrame_GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue)\t\\\n    ( (This)->lpVtbl -> GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) )\n\n#define ICorDebugNativeFrame_GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue)\t\\\n    ( (This)->lpVtbl -> GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) )\n\n#define ICorDebugNativeFrame_CanSetIP(This,nOffset)\t\\\n    ( (This)->lpVtbl -> CanSetIP(This,nOffset) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0072 */\n/* [local] */\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0072_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0072_v0_0_s_ifspec;\n\n#ifndef __ICorDebugNativeFrame2_INTERFACE_DEFINED__\n#define __ICorDebugNativeFrame2_INTERFACE_DEFINED__\n\n/* interface ICorDebugNativeFrame2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugNativeFrame2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"35389FF1-3684-4c55-A2EE-210F26C60E5E\")\n    ICorDebugNativeFrame2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsChild(\n            /* [out] */ BOOL *pIsChild) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsMatchingParentFrame(\n            /* [in] */ ICorDebugNativeFrame2 *pPotentialParentFrame,\n            /* [out] */ BOOL *pIsParent) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStackParameterSize(\n            /* [out] */ ULONG32 *pSize) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugNativeFrame2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugNativeFrame2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugNativeFrame2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugNativeFrame2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *IsChild )(\n            ICorDebugNativeFrame2 * This,\n            /* [out] */ BOOL *pIsChild);\n\n        HRESULT ( STDMETHODCALLTYPE *IsMatchingParentFrame )(\n            ICorDebugNativeFrame2 * This,\n            /* [in] */ ICorDebugNativeFrame2 *pPotentialParentFrame,\n            /* [out] */ BOOL *pIsParent);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackParameterSize )(\n            ICorDebugNativeFrame2 * This,\n            /* [out] */ ULONG32 *pSize);\n\n        END_INTERFACE\n    } ICorDebugNativeFrame2Vtbl;\n\n    interface ICorDebugNativeFrame2\n    {\n        CONST_VTBL struct ICorDebugNativeFrame2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugNativeFrame2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugNativeFrame2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugNativeFrame2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugNativeFrame2_IsChild(This,pIsChild)\t\\\n    ( (This)->lpVtbl -> IsChild(This,pIsChild) )\n\n#define ICorDebugNativeFrame2_IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent)\t\\\n    ( (This)->lpVtbl -> IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) )\n\n#define ICorDebugNativeFrame2_GetStackParameterSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetStackParameterSize(This,pSize) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugNativeFrame2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugModule3_INTERFACE_DEFINED__\n#define __ICorDebugModule3_INTERFACE_DEFINED__\n\n/* interface ICorDebugModule3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugModule3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"86F012BF-FF15-4372-BD30-B6F11CAAE1DD\")\n    ICorDebugModule3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreateReaderForInMemorySymbols(\n            /* [in] */ REFIID riid,\n            /* [iid_is][out] */ void **ppObj) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugModule3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugModule3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugModule3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugModule3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateReaderForInMemorySymbols )(\n            ICorDebugModule3 * This,\n            /* [in] */ REFIID riid,\n            /* [iid_is][out] */ void **ppObj);\n\n        END_INTERFACE\n    } ICorDebugModule3Vtbl;\n\n    interface ICorDebugModule3\n    {\n        CONST_VTBL struct ICorDebugModule3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugModule3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugModule3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugModule3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugModule3_CreateReaderForInMemorySymbols(This,riid,ppObj)\t\\\n    ( (This)->lpVtbl -> CreateReaderForInMemorySymbols(This,riid,ppObj) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugModule3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugModule4_INTERFACE_DEFINED__\n#define __ICorDebugModule4_INTERFACE_DEFINED__\n\n/* interface ICorDebugModule4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugModule4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FF8B8EAF-25CD-4316-8859-84416DE4402E\")\n    ICorDebugModule4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsMappedLayout(\n            /* [out] */ BOOL *pIsMapped) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugModule4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugModule4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugModule4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugModule4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *IsMappedLayout )(\n            ICorDebugModule4 * This,\n            /* [out] */ BOOL *pIsMapped);\n\n        END_INTERFACE\n    } ICorDebugModule4Vtbl;\n\n    interface ICorDebugModule4\n    {\n        CONST_VTBL struct ICorDebugModule4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugModule4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugModule4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugModule4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugModule4_IsMappedLayout(This,pIsMapped)\t\\\n    ( (This)->lpVtbl -> IsMappedLayout(This,pIsMapped) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugModule4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__\n#define __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__\n\n/* interface ICorDebugRuntimeUnwindableFrame */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugRuntimeUnwindableFrame;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"879CAC0A-4A53-4668-B8E3-CB8473CB187F\")\n    ICorDebugRuntimeUnwindableFrame : public ICorDebugFrame\n    {\n    public:\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugRuntimeUnwindableFrameVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugRuntimeUnwindableFrame * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugRuntimeUnwindableFrame * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetChain )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ ICorDebugChain **ppChain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionToken )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ mdMethodDef *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackRange )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ CORDB_ADDRESS *pStart,\n            /* [out] */ CORDB_ADDRESS *pEnd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCaller )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCallee )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ ICorDebugFrame **ppFrame);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateStepper )(\n            ICorDebugRuntimeUnwindableFrame * This,\n            /* [out] */ ICorDebugStepper **ppStepper);\n\n        END_INTERFACE\n    } ICorDebugRuntimeUnwindableFrameVtbl;\n\n    interface ICorDebugRuntimeUnwindableFrame\n    {\n        CONST_VTBL struct ICorDebugRuntimeUnwindableFrameVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugRuntimeUnwindableFrame_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugRuntimeUnwindableFrame_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugRuntimeUnwindableFrame_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugRuntimeUnwindableFrame_GetChain(This,ppChain)\t\\\n    ( (This)->lpVtbl -> GetChain(This,ppChain) )\n\n#define ICorDebugRuntimeUnwindableFrame_GetCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCode(This,ppCode) )\n\n#define ICorDebugRuntimeUnwindableFrame_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#define ICorDebugRuntimeUnwindableFrame_GetFunctionToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetFunctionToken(This,pToken) )\n\n#define ICorDebugRuntimeUnwindableFrame_GetStackRange(This,pStart,pEnd)\t\\\n    ( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )\n\n#define ICorDebugRuntimeUnwindableFrame_GetCaller(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCaller(This,ppFrame) )\n\n#define ICorDebugRuntimeUnwindableFrame_GetCallee(This,ppFrame)\t\\\n    ( (This)->lpVtbl -> GetCallee(This,ppFrame) )\n\n#define ICorDebugRuntimeUnwindableFrame_CreateStepper(This,ppStepper)\t\\\n    ( (This)->lpVtbl -> CreateStepper(This,ppStepper) )\n\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugModule_INTERFACE_DEFINED__\n#define __ICorDebugModule_INTERFACE_DEFINED__\n\n/* interface ICorDebugModule */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugModule;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"dba2d8c1-e5c5-4069-8c13-10a7c6abf43d\")\n    ICorDebugModule : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetProcess(\n            /* [out] */ ICorDebugProcess **ppProcess) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetBaseAddress(\n            /* [out] */ CORDB_ADDRESS *pAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssembly(\n            /* [out] */ ICorDebugAssembly **ppAssembly) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnableJITDebugging(\n            /* [in] */ BOOL bTrackJITInfo,\n            /* [in] */ BOOL bAllowJitOpts) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnableClassLoadCallbacks(\n            /* [in] */ BOOL bClassLoadCallbacks) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionFromToken(\n            /* [in] */ mdMethodDef methodDef,\n            /* [out] */ ICorDebugFunction **ppFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionFromRVA(\n            /* [in] */ CORDB_ADDRESS rva,\n            /* [out] */ ICorDebugFunction **ppFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClassFromToken(\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ICorDebugClass **ppClass) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateBreakpoint(\n            /* [out] */ ICorDebugModuleBreakpoint **ppBreakpoint) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetEditAndContinueSnapshot(\n            /* [out] */ ICorDebugEditAndContinueSnapshot **ppEditAndContinueSnapshot) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMetaDataInterface(\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppObj) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetToken(\n            /* [out] */ mdModule *pToken) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsDynamic(\n            /* [out] */ BOOL *pDynamic) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGlobalVariableValue(\n            /* [in] */ mdFieldDef fieldDef,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pcBytes) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsInMemory(\n            /* [out] */ BOOL *pInMemory) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugModuleVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugModule * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugModule * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugModule * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetProcess )(\n            ICorDebugModule * This,\n            /* [out] */ ICorDebugProcess **ppProcess);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBaseAddress )(\n            ICorDebugModule * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssembly )(\n            ICorDebugModule * This,\n            /* [out] */ ICorDebugAssembly **ppAssembly);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugModule * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnableJITDebugging )(\n            ICorDebugModule * This,\n            /* [in] */ BOOL bTrackJITInfo,\n            /* [in] */ BOOL bAllowJitOpts);\n\n        HRESULT ( STDMETHODCALLTYPE *EnableClassLoadCallbacks )(\n            ICorDebugModule * This,\n            /* [in] */ BOOL bClassLoadCallbacks);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorDebugModule * This,\n            /* [in] */ mdMethodDef methodDef,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromRVA )(\n            ICorDebugModule * This,\n            /* [in] */ CORDB_ADDRESS rva,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorDebugModule * This,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ICorDebugClass **ppClass);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugModule * This,\n            /* [out] */ ICorDebugModuleBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEditAndContinueSnapshot )(\n            ICorDebugModule * This,\n            /* [out] */ ICorDebugEditAndContinueSnapshot **ppEditAndContinueSnapshot);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMetaDataInterface )(\n            ICorDebugModule * This,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppObj);\n\n        HRESULT ( STDMETHODCALLTYPE *GetToken )(\n            ICorDebugModule * This,\n            /* [out] */ mdModule *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *IsDynamic )(\n            ICorDebugModule * This,\n            /* [out] */ BOOL *pDynamic);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGlobalVariableValue )(\n            ICorDebugModule * This,\n            /* [in] */ mdFieldDef fieldDef,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugModule * This,\n            /* [out] */ ULONG32 *pcBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *IsInMemory )(\n            ICorDebugModule * This,\n            /* [out] */ BOOL *pInMemory);\n\n        END_INTERFACE\n    } ICorDebugModuleVtbl;\n\n    interface ICorDebugModule\n    {\n        CONST_VTBL struct ICorDebugModuleVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugModule_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugModule_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugModule_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugModule_GetProcess(This,ppProcess)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,ppProcess) )\n\n#define ICorDebugModule_GetBaseAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetBaseAddress(This,pAddress) )\n\n#define ICorDebugModule_GetAssembly(This,ppAssembly)\t\\\n    ( (This)->lpVtbl -> GetAssembly(This,ppAssembly) )\n\n#define ICorDebugModule_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#define ICorDebugModule_EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts)\t\\\n    ( (This)->lpVtbl -> EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) )\n\n#define ICorDebugModule_EnableClassLoadCallbacks(This,bClassLoadCallbacks)\t\\\n    ( (This)->lpVtbl -> EnableClassLoadCallbacks(This,bClassLoadCallbacks) )\n\n#define ICorDebugModule_GetFunctionFromToken(This,methodDef,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,methodDef,ppFunction) )\n\n#define ICorDebugModule_GetFunctionFromRVA(This,rva,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunctionFromRVA(This,rva,ppFunction) )\n\n#define ICorDebugModule_GetClassFromToken(This,typeDef,ppClass)\t\\\n    ( (This)->lpVtbl -> GetClassFromToken(This,typeDef,ppClass) )\n\n#define ICorDebugModule_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n#define ICorDebugModule_GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot)\t\\\n    ( (This)->lpVtbl -> GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) )\n\n#define ICorDebugModule_GetMetaDataInterface(This,riid,ppObj)\t\\\n    ( (This)->lpVtbl -> GetMetaDataInterface(This,riid,ppObj) )\n\n#define ICorDebugModule_GetToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetToken(This,pToken) )\n\n#define ICorDebugModule_IsDynamic(This,pDynamic)\t\\\n    ( (This)->lpVtbl -> IsDynamic(This,pDynamic) )\n\n#define ICorDebugModule_GetGlobalVariableValue(This,fieldDef,ppValue)\t\\\n    ( (This)->lpVtbl -> GetGlobalVariableValue(This,fieldDef,ppValue) )\n\n#define ICorDebugModule_GetSize(This,pcBytes)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pcBytes) )\n\n#define ICorDebugModule_IsInMemory(This,pInMemory)\t\\\n    ( (This)->lpVtbl -> IsInMemory(This,pInMemory) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugModule_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0077 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0077_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0077_v0_0_s_ifspec;\n\n#ifndef __ICorDebugModule2_INTERFACE_DEFINED__\n#define __ICorDebugModule2_INTERFACE_DEFINED__\n\n/* interface ICorDebugModule2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugModule2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"7FCC5FB5-49C0-41de-9938-3B88B5B9ADD7\")\n    ICorDebugModule2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetJMCStatus(\n            /* [in] */ BOOL bIsJustMyCode,\n            /* [in] */ ULONG32 cTokens,\n            /* [size_is][in] */ mdToken pTokens[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ApplyChanges(\n            /* [in] */ ULONG cbMetadata,\n            /* [size_is][in] */ BYTE pbMetadata[  ],\n            /* [in] */ ULONG cbIL,\n            /* [size_is][in] */ BYTE pbIL[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetJITCompilerFlags(\n            /* [in] */ DWORD dwFlags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetJITCompilerFlags(\n            /* [out] */ DWORD *pdwFlags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ResolveAssembly(\n            /* [in] */ mdToken tkAssemblyRef,\n            /* [out] */ ICorDebugAssembly **ppAssembly) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugModule2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugModule2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugModule2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugModule2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetJMCStatus )(\n            ICorDebugModule2 * This,\n            /* [in] */ BOOL bIsJustMyCode,\n            /* [in] */ ULONG32 cTokens,\n            /* [size_is][in] */ mdToken pTokens[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyChanges )(\n            ICorDebugModule2 * This,\n            /* [in] */ ULONG cbMetadata,\n            /* [size_is][in] */ BYTE pbMetadata[  ],\n            /* [in] */ ULONG cbIL,\n            /* [size_is][in] */ BYTE pbIL[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetJITCompilerFlags )(\n            ICorDebugModule2 * This,\n            /* [in] */ DWORD dwFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *GetJITCompilerFlags )(\n            ICorDebugModule2 * This,\n            /* [out] */ DWORD *pdwFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *ResolveAssembly )(\n            ICorDebugModule2 * This,\n            /* [in] */ mdToken tkAssemblyRef,\n            /* [out] */ ICorDebugAssembly **ppAssembly);\n\n        END_INTERFACE\n    } ICorDebugModule2Vtbl;\n\n    interface ICorDebugModule2\n    {\n        CONST_VTBL struct ICorDebugModule2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugModule2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugModule2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugModule2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugModule2_SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens)\t\\\n    ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) )\n\n#define ICorDebugModule2_ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL)\t\\\n    ( (This)->lpVtbl -> ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) )\n\n#define ICorDebugModule2_SetJITCompilerFlags(This,dwFlags)\t\\\n    ( (This)->lpVtbl -> SetJITCompilerFlags(This,dwFlags) )\n\n#define ICorDebugModule2_GetJITCompilerFlags(This,pdwFlags)\t\\\n    ( (This)->lpVtbl -> GetJITCompilerFlags(This,pdwFlags) )\n\n#define ICorDebugModule2_ResolveAssembly(This,tkAssemblyRef,ppAssembly)\t\\\n    ( (This)->lpVtbl -> ResolveAssembly(This,tkAssemblyRef,ppAssembly) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugModule2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction_INTERFACE_DEFINED__\n#define __ICorDebugFunction_INTERFACE_DEFINED__\n\n/* interface ICorDebugFunction */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugFunction;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAF3-8A68-11d2-983C-0000F808342D\")\n    ICorDebugFunction : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetModule(\n            /* [out] */ ICorDebugModule **ppModule) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClass(\n            /* [out] */ ICorDebugClass **ppClass) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetToken(\n            /* [out] */ mdMethodDef *pMethodDef) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILCode(\n            /* [out] */ ICorDebugCode **ppCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetNativeCode(\n            /* [out] */ ICorDebugCode **ppCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateBreakpoint(\n            /* [out] */ ICorDebugFunctionBreakpoint **ppBreakpoint) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocalVarSigToken(\n            /* [out] */ mdSignature *pmdSig) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCurrentVersionNumber(\n            /* [out] */ ULONG32 *pnCurrentVersion) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugFunctionVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugFunction * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugFunction * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugFunction * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModule )(\n            ICorDebugFunction * This,\n            /* [out] */ ICorDebugModule **ppModule);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClass )(\n            ICorDebugFunction * This,\n            /* [out] */ ICorDebugClass **ppClass);\n\n        HRESULT ( STDMETHODCALLTYPE *GetToken )(\n            ICorDebugFunction * This,\n            /* [out] */ mdMethodDef *pMethodDef);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILCode )(\n            ICorDebugFunction * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNativeCode )(\n            ICorDebugFunction * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugFunction * This,\n            /* [out] */ ICorDebugFunctionBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalVarSigToken )(\n            ICorDebugFunction * This,\n            /* [out] */ mdSignature *pmdSig);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentVersionNumber )(\n            ICorDebugFunction * This,\n            /* [out] */ ULONG32 *pnCurrentVersion);\n\n        END_INTERFACE\n    } ICorDebugFunctionVtbl;\n\n    interface ICorDebugFunction\n    {\n        CONST_VTBL struct ICorDebugFunctionVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugFunction_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugFunction_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugFunction_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugFunction_GetModule(This,ppModule)\t\\\n    ( (This)->lpVtbl -> GetModule(This,ppModule) )\n\n#define ICorDebugFunction_GetClass(This,ppClass)\t\\\n    ( (This)->lpVtbl -> GetClass(This,ppClass) )\n\n#define ICorDebugFunction_GetToken(This,pMethodDef)\t\\\n    ( (This)->lpVtbl -> GetToken(This,pMethodDef) )\n\n#define ICorDebugFunction_GetILCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetILCode(This,ppCode) )\n\n#define ICorDebugFunction_GetNativeCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetNativeCode(This,ppCode) )\n\n#define ICorDebugFunction_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n#define ICorDebugFunction_GetLocalVarSigToken(This,pmdSig)\t\\\n    ( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) )\n\n#define ICorDebugFunction_GetCurrentVersionNumber(This,pnCurrentVersion)\t\\\n    ( (This)->lpVtbl -> GetCurrentVersionNumber(This,pnCurrentVersion) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugFunction_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction2_INTERFACE_DEFINED__\n#define __ICorDebugFunction2_INTERFACE_DEFINED__\n\n/* interface ICorDebugFunction2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugFunction2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"EF0C490B-94C3-4e4d-B629-DDC134C532D8\")\n    ICorDebugFunction2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetJMCStatus(\n            /* [in] */ BOOL bIsJustMyCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetJMCStatus(\n            /* [out] */ BOOL *pbIsJustMyCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateNativeCode(\n            /* [out] */ ICorDebugCodeEnum **ppCodeEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetVersionNumber(\n            /* [out] */ ULONG32 *pnVersion) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugFunction2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugFunction2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugFunction2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugFunction2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetJMCStatus )(\n            ICorDebugFunction2 * This,\n            /* [in] */ BOOL bIsJustMyCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetJMCStatus )(\n            ICorDebugFunction2 * This,\n            /* [out] */ BOOL *pbIsJustMyCode);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateNativeCode )(\n            ICorDebugFunction2 * This,\n            /* [out] */ ICorDebugCodeEnum **ppCodeEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVersionNumber )(\n            ICorDebugFunction2 * This,\n            /* [out] */ ULONG32 *pnVersion);\n\n        END_INTERFACE\n    } ICorDebugFunction2Vtbl;\n\n    interface ICorDebugFunction2\n    {\n        CONST_VTBL struct ICorDebugFunction2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugFunction2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugFunction2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugFunction2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugFunction2_SetJMCStatus(This,bIsJustMyCode)\t\\\n    ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) )\n\n#define ICorDebugFunction2_GetJMCStatus(This,pbIsJustMyCode)\t\\\n    ( (This)->lpVtbl -> GetJMCStatus(This,pbIsJustMyCode) )\n\n#define ICorDebugFunction2_EnumerateNativeCode(This,ppCodeEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateNativeCode(This,ppCodeEnum) )\n\n#define ICorDebugFunction2_GetVersionNumber(This,pnVersion)\t\\\n    ( (This)->lpVtbl -> GetVersionNumber(This,pnVersion) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugFunction2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction3_INTERFACE_DEFINED__\n#define __ICorDebugFunction3_INTERFACE_DEFINED__\n\n/* interface ICorDebugFunction3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugFunction3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"09B70F28-E465-482D-99E0-81A165EB0532\")\n    ICorDebugFunction3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetActiveReJitRequestILCode(\n            ICorDebugILCode **ppReJitedILCode) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugFunction3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugFunction3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugFunction3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugFunction3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetActiveReJitRequestILCode )(\n            ICorDebugFunction3 * This,\n            ICorDebugILCode **ppReJitedILCode);\n\n        END_INTERFACE\n    } ICorDebugFunction3Vtbl;\n\n    interface ICorDebugFunction3\n    {\n        CONST_VTBL struct ICorDebugFunction3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugFunction3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugFunction3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugFunction3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugFunction3_GetActiveReJitRequestILCode(This,ppReJitedILCode)\t\\\n    ( (This)->lpVtbl -> GetActiveReJitRequestILCode(This,ppReJitedILCode) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugFunction3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugFunction4_INTERFACE_DEFINED__\n#define __ICorDebugFunction4_INTERFACE_DEFINED__\n\n/* interface ICorDebugFunction4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugFunction4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"72965963-34fd-46e9-9434-b817fe6e7f43\")\n    ICorDebugFunction4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreateNativeBreakpoint(\n            ICorDebugFunctionBreakpoint **ppBreakpoint) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugFunction4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugFunction4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugFunction4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugFunction4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateNativeBreakpoint )(\n            ICorDebugFunction4 * This,\n            ICorDebugFunctionBreakpoint **ppBreakpoint);\n\n        END_INTERFACE\n    } ICorDebugFunction4Vtbl;\n\n    interface ICorDebugFunction4\n    {\n        CONST_VTBL struct ICorDebugFunction4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugFunction4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugFunction4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugFunction4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugFunction4_CreateNativeBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateNativeBreakpoint(This,ppBreakpoint) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugFunction4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugCode_INTERFACE_DEFINED__\n#define __ICorDebugCode_INTERFACE_DEFINED__\n\n/* interface ICorDebugCode */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugCode;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAF4-8A68-11d2-983C-0000F808342D\")\n    ICorDebugCode : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsIL(\n            /* [out] */ BOOL *pbIL) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunction(\n            /* [out] */ ICorDebugFunction **ppFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAddress(\n            /* [out] */ CORDB_ADDRESS *pStart) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pcBytes) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateBreakpoint(\n            /* [in] */ ULONG32 offset,\n            /* [out] */ ICorDebugFunctionBreakpoint **ppBreakpoint) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCode(\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset,\n            /* [in] */ ULONG32 cBufferAlloc,\n            /* [length_is][size_is][out] */ BYTE buffer[  ],\n            /* [out] */ ULONG32 *pcBufferSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetVersionNumber(\n            /* [out] */ ULONG32 *nVersion) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILToNativeMapping(\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetEnCRemapSequencePoints(\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ ULONG32 offsets[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugCodeVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugCode * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugCode * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugCode * This);\n\n        HRESULT ( STDMETHODCALLTYPE *IsIL )(\n            ICorDebugCode * This,\n            /* [out] */ BOOL *pbIL);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugCode * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugCode * This,\n            /* [out] */ CORDB_ADDRESS *pStart);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugCode * This,\n            /* [out] */ ULONG32 *pcBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugCode * This,\n            /* [in] */ ULONG32 offset,\n            /* [out] */ ICorDebugFunctionBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugCode * This,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset,\n            /* [in] */ ULONG32 cBufferAlloc,\n            /* [length_is][size_is][out] */ BYTE buffer[  ],\n            /* [out] */ ULONG32 *pcBufferSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVersionNumber )(\n            ICorDebugCode * This,\n            /* [out] */ ULONG32 *nVersion);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorDebugCode * This,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEnCRemapSequencePoints )(\n            ICorDebugCode * This,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ ULONG32 offsets[  ]);\n\n        END_INTERFACE\n    } ICorDebugCodeVtbl;\n\n    interface ICorDebugCode\n    {\n        CONST_VTBL struct ICorDebugCodeVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugCode_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugCode_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugCode_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugCode_IsIL(This,pbIL)\t\\\n    ( (This)->lpVtbl -> IsIL(This,pbIL) )\n\n#define ICorDebugCode_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#define ICorDebugCode_GetAddress(This,pStart)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pStart) )\n\n#define ICorDebugCode_GetSize(This,pcBytes)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pcBytes) )\n\n#define ICorDebugCode_CreateBreakpoint(This,offset,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,offset,ppBreakpoint) )\n\n#define ICorDebugCode_GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize)\t\\\n    ( (This)->lpVtbl -> GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) )\n\n#define ICorDebugCode_GetVersionNumber(This,nVersion)\t\\\n    ( (This)->lpVtbl -> GetVersionNumber(This,nVersion) )\n\n#define ICorDebugCode_GetILToNativeMapping(This,cMap,pcMap,map)\t\\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,cMap,pcMap,map) )\n\n#define ICorDebugCode_GetEnCRemapSequencePoints(This,cMap,pcMap,offsets)\t\\\n    ( (This)->lpVtbl -> GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugCode_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugCode2_INTERFACE_DEFINED__\n#define __ICorDebugCode2_INTERFACE_DEFINED__\n\n/* interface ICorDebugCode2 */\n/* [unique][uuid][local][object] */\n\ntypedef struct _CodeChunkInfo\n    {\n    CORDB_ADDRESS startAddr;\n    ULONG32 length;\n    } \tCodeChunkInfo;\n\n\nEXTERN_C const IID IID_ICorDebugCode2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"5F696509-452F-4436-A3FE-4D11FE7E2347\")\n    ICorDebugCode2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetCodeChunks(\n            /* [in] */ ULONG32 cbufSize,\n            /* [out] */ ULONG32 *pcnumChunks,\n            /* [length_is][size_is][out] */ CodeChunkInfo chunks[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCompilerFlags(\n            /* [out] */ DWORD *pdwFlags) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugCode2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugCode2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugCode2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugCode2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeChunks )(\n            ICorDebugCode2 * This,\n            /* [in] */ ULONG32 cbufSize,\n            /* [out] */ ULONG32 *pcnumChunks,\n            /* [length_is][size_is][out] */ CodeChunkInfo chunks[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCompilerFlags )(\n            ICorDebugCode2 * This,\n            /* [out] */ DWORD *pdwFlags);\n\n        END_INTERFACE\n    } ICorDebugCode2Vtbl;\n\n    interface ICorDebugCode2\n    {\n        CONST_VTBL struct ICorDebugCode2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugCode2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugCode2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugCode2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugCode2_GetCodeChunks(This,cbufSize,pcnumChunks,chunks)\t\\\n    ( (This)->lpVtbl -> GetCodeChunks(This,cbufSize,pcnumChunks,chunks) )\n\n#define ICorDebugCode2_GetCompilerFlags(This,pdwFlags)\t\\\n    ( (This)->lpVtbl -> GetCompilerFlags(This,pdwFlags) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugCode2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugCode3_INTERFACE_DEFINED__\n#define __ICorDebugCode3_INTERFACE_DEFINED__\n\n/* interface ICorDebugCode3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugCode3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"D13D3E88-E1F2-4020-AA1D-3D162DCBE966\")\n    ICorDebugCode3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetReturnValueLiveOffset(\n            /* [in] */ ULONG32 ILoffset,\n            /* [in] */ ULONG32 bufferSize,\n            /* [out] */ ULONG32 *pFetched,\n            /* [length_is][size_is][out] */ ULONG32 pOffsets[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugCode3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugCode3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugCode3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugCode3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReturnValueLiveOffset )(\n            ICorDebugCode3 * This,\n            /* [in] */ ULONG32 ILoffset,\n            /* [in] */ ULONG32 bufferSize,\n            /* [out] */ ULONG32 *pFetched,\n            /* [length_is][size_is][out] */ ULONG32 pOffsets[  ]);\n\n        END_INTERFACE\n    } ICorDebugCode3Vtbl;\n\n    interface ICorDebugCode3\n    {\n        CONST_VTBL struct ICorDebugCode3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugCode3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugCode3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugCode3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugCode3_GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets)\t\\\n    ( (This)->lpVtbl -> GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugCode3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugCode4_INTERFACE_DEFINED__\n#define __ICorDebugCode4_INTERFACE_DEFINED__\n\n/* interface ICorDebugCode4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugCode4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"18221fa4-20cb-40fa-b19d-9f91c4fa8c14\")\n    ICorDebugCode4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumerateVariableHomes(\n            /* [out] */ ICorDebugVariableHomeEnum **ppEnum) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugCode4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugCode4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugCode4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugCode4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateVariableHomes )(\n            ICorDebugCode4 * This,\n            /* [out] */ ICorDebugVariableHomeEnum **ppEnum);\n\n        END_INTERFACE\n    } ICorDebugCode4Vtbl;\n\n    interface ICorDebugCode4\n    {\n        CONST_VTBL struct ICorDebugCode4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugCode4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugCode4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugCode4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateVariableHomes(This,ppEnum) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugCode4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugILCode_INTERFACE_DEFINED__\n#define __ICorDebugILCode_INTERFACE_DEFINED__\n\n/* interface ICorDebugILCode */\n/* [unique][uuid][local][object] */\n\ntypedef struct _CorDebugEHClause\n    {\n    ULONG32 Flags;\n    ULONG32 TryOffset;\n    ULONG32 TryLength;\n    ULONG32 HandlerOffset;\n    ULONG32 HandlerLength;\n    ULONG32 ClassToken;\n    ULONG32 FilterOffset;\n    } \tCorDebugEHClause;\n\n\nEXTERN_C const IID IID_ICorDebugILCode;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"598D46C2-C877-42A7-89D2-3D0C7F1C1264\")\n    ICorDebugILCode : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetEHClauses(\n            /* [in] */ ULONG32 cClauses,\n            /* [out] */ ULONG32 *pcClauses,\n            /* [length_is][size_is][out] */ CorDebugEHClause clauses[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugILCodeVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugILCode * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugILCode * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugILCode * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEHClauses )(\n            ICorDebugILCode * This,\n            /* [in] */ ULONG32 cClauses,\n            /* [out] */ ULONG32 *pcClauses,\n            /* [length_is][size_is][out] */ CorDebugEHClause clauses[  ]);\n\n        END_INTERFACE\n    } ICorDebugILCodeVtbl;\n\n    interface ICorDebugILCode\n    {\n        CONST_VTBL struct ICorDebugILCodeVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugILCode_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugILCode_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugILCode_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugILCode_GetEHClauses(This,cClauses,pcClauses,clauses)\t\\\n    ( (This)->lpVtbl -> GetEHClauses(This,cClauses,pcClauses,clauses) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugILCode_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugILCode2_INTERFACE_DEFINED__\n#define __ICorDebugILCode2_INTERFACE_DEFINED__\n\n/* interface ICorDebugILCode2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugILCode2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"46586093-D3F5-4DB6-ACDB-955BCE228C15\")\n    ICorDebugILCode2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetLocalVarSigToken(\n            /* [out] */ mdSignature *pmdSig) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetInstrumentedILMap(\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_IL_MAP map[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugILCode2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugILCode2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugILCode2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugILCode2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocalVarSigToken )(\n            ICorDebugILCode2 * This,\n            /* [out] */ mdSignature *pmdSig);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInstrumentedILMap )(\n            ICorDebugILCode2 * This,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_IL_MAP map[  ]);\n\n        END_INTERFACE\n    } ICorDebugILCode2Vtbl;\n\n    interface ICorDebugILCode2\n    {\n        CONST_VTBL struct ICorDebugILCode2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugILCode2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugILCode2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugILCode2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugILCode2_GetLocalVarSigToken(This,pmdSig)\t\\\n    ( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) )\n\n#define ICorDebugILCode2_GetInstrumentedILMap(This,cMap,pcMap,map)\t\\\n    ( (This)->lpVtbl -> GetInstrumentedILMap(This,cMap,pcMap,map) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugILCode2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugClass_INTERFACE_DEFINED__\n#define __ICorDebugClass_INTERFACE_DEFINED__\n\n/* interface ICorDebugClass */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugClass;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAF5-8A68-11d2-983C-0000F808342D\")\n    ICorDebugClass : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetModule(\n            /* [out] */ ICorDebugModule **pModule) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetToken(\n            /* [out] */ mdTypeDef *pTypeDef) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStaticFieldValue(\n            /* [in] */ mdFieldDef fieldDef,\n            /* [in] */ ICorDebugFrame *pFrame,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugClassVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugClass * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugClass * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugClass * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModule )(\n            ICorDebugClass * This,\n            /* [out] */ ICorDebugModule **pModule);\n\n        HRESULT ( STDMETHODCALLTYPE *GetToken )(\n            ICorDebugClass * This,\n            /* [out] */ mdTypeDef *pTypeDef);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldValue )(\n            ICorDebugClass * This,\n            /* [in] */ mdFieldDef fieldDef,\n            /* [in] */ ICorDebugFrame *pFrame,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        END_INTERFACE\n    } ICorDebugClassVtbl;\n\n    interface ICorDebugClass\n    {\n        CONST_VTBL struct ICorDebugClassVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugClass_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugClass_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugClass_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugClass_GetModule(This,pModule)\t\\\n    ( (This)->lpVtbl -> GetModule(This,pModule) )\n\n#define ICorDebugClass_GetToken(This,pTypeDef)\t\\\n    ( (This)->lpVtbl -> GetToken(This,pTypeDef) )\n\n#define ICorDebugClass_GetStaticFieldValue(This,fieldDef,pFrame,ppValue)\t\\\n    ( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugClass_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugClass2_INTERFACE_DEFINED__\n#define __ICorDebugClass2_INTERFACE_DEFINED__\n\n/* interface ICorDebugClass2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugClass2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"B008EA8D-7AB1-43f7-BB20-FBB5A04038AE\")\n    ICorDebugClass2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetParameterizedType(\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [out] */ ICorDebugType **ppType) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetJMCStatus(\n            /* [in] */ BOOL bIsJustMyCode) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugClass2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugClass2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugClass2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugClass2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetParameterizedType )(\n            ICorDebugClass2 * This,\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [out] */ ICorDebugType **ppType);\n\n        HRESULT ( STDMETHODCALLTYPE *SetJMCStatus )(\n            ICorDebugClass2 * This,\n            /* [in] */ BOOL bIsJustMyCode);\n\n        END_INTERFACE\n    } ICorDebugClass2Vtbl;\n\n    interface ICorDebugClass2\n    {\n        CONST_VTBL struct ICorDebugClass2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugClass2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugClass2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugClass2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugClass2_GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType)\t\\\n    ( (This)->lpVtbl -> GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) )\n\n#define ICorDebugClass2_SetJMCStatus(This,bIsJustMyCode)\t\\\n    ( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugClass2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugEval_INTERFACE_DEFINED__\n#define __ICorDebugEval_INTERFACE_DEFINED__\n\n/* interface ICorDebugEval */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugEval;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAF6-8A68-11d2-983C-0000F808342D\")\n    ICorDebugEval : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CallFunction(\n            /* [in] */ ICorDebugFunction *pFunction,\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewObject(\n            /* [in] */ ICorDebugFunction *pConstructor,\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewObjectNoConstructor(\n            /* [in] */ ICorDebugClass *pClass) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewString(\n            /* [in] */ LPCWSTR string) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewArray(\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ICorDebugClass *pElementClass,\n            /* [in] */ ULONG32 rank,\n            /* [size_is][in] */ ULONG32 dims[  ],\n            /* [size_is][in] */ ULONG32 lowBounds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsActive(\n            /* [out] */ BOOL *pbActive) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Abort( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetResult(\n            /* [out] */ ICorDebugValue **ppResult) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThread(\n            /* [out] */ ICorDebugThread **ppThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateValue(\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ICorDebugClass *pElementClass,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugEvalVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugEval * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugEval * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugEval * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CallFunction )(\n            ICorDebugEval * This,\n            /* [in] */ ICorDebugFunction *pFunction,\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *NewObject )(\n            ICorDebugEval * This,\n            /* [in] */ ICorDebugFunction *pConstructor,\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *NewObjectNoConstructor )(\n            ICorDebugEval * This,\n            /* [in] */ ICorDebugClass *pClass);\n\n        HRESULT ( STDMETHODCALLTYPE *NewString )(\n            ICorDebugEval * This,\n            /* [in] */ LPCWSTR string);\n\n        HRESULT ( STDMETHODCALLTYPE *NewArray )(\n            ICorDebugEval * This,\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ICorDebugClass *pElementClass,\n            /* [in] */ ULONG32 rank,\n            /* [size_is][in] */ ULONG32 dims[  ],\n            /* [size_is][in] */ ULONG32 lowBounds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *IsActive )(\n            ICorDebugEval * This,\n            /* [out] */ BOOL *pbActive);\n\n        HRESULT ( STDMETHODCALLTYPE *Abort )(\n            ICorDebugEval * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetResult )(\n            ICorDebugEval * This,\n            /* [out] */ ICorDebugValue **ppResult);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThread )(\n            ICorDebugEval * This,\n            /* [out] */ ICorDebugThread **ppThread);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateValue )(\n            ICorDebugEval * This,\n            /* [in] */ CorElementType elementType,\n            /* [in] */ ICorDebugClass *pElementClass,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        END_INTERFACE\n    } ICorDebugEvalVtbl;\n\n    interface ICorDebugEval\n    {\n        CONST_VTBL struct ICorDebugEvalVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugEval_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugEval_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugEval_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugEval_CallFunction(This,pFunction,nArgs,ppArgs)\t\\\n    ( (This)->lpVtbl -> CallFunction(This,pFunction,nArgs,ppArgs) )\n\n#define ICorDebugEval_NewObject(This,pConstructor,nArgs,ppArgs)\t\\\n    ( (This)->lpVtbl -> NewObject(This,pConstructor,nArgs,ppArgs) )\n\n#define ICorDebugEval_NewObjectNoConstructor(This,pClass)\t\\\n    ( (This)->lpVtbl -> NewObjectNoConstructor(This,pClass) )\n\n#define ICorDebugEval_NewString(This,string)\t\\\n    ( (This)->lpVtbl -> NewString(This,string) )\n\n#define ICorDebugEval_NewArray(This,elementType,pElementClass,rank,dims,lowBounds)\t\\\n    ( (This)->lpVtbl -> NewArray(This,elementType,pElementClass,rank,dims,lowBounds) )\n\n#define ICorDebugEval_IsActive(This,pbActive)\t\\\n    ( (This)->lpVtbl -> IsActive(This,pbActive) )\n\n#define ICorDebugEval_Abort(This)\t\\\n    ( (This)->lpVtbl -> Abort(This) )\n\n#define ICorDebugEval_GetResult(This,ppResult)\t\\\n    ( (This)->lpVtbl -> GetResult(This,ppResult) )\n\n#define ICorDebugEval_GetThread(This,ppThread)\t\\\n    ( (This)->lpVtbl -> GetThread(This,ppThread) )\n\n#define ICorDebugEval_CreateValue(This,elementType,pElementClass,ppValue)\t\\\n    ( (This)->lpVtbl -> CreateValue(This,elementType,pElementClass,ppValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugEval_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugEval2_INTERFACE_DEFINED__\n#define __ICorDebugEval2_INTERFACE_DEFINED__\n\n/* interface ICorDebugEval2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugEval2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FB0D9CE7-BE66-4683-9D32-A42A04E2FD91\")\n    ICorDebugEval2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CallParameterizedFunction(\n            /* [in] */ ICorDebugFunction *pFunction,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateValueForType(\n            /* [in] */ ICorDebugType *pType,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewParameterizedObject(\n            /* [in] */ ICorDebugFunction *pConstructor,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewParameterizedObjectNoConstructor(\n            /* [in] */ ICorDebugClass *pClass,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewParameterizedArray(\n            /* [in] */ ICorDebugType *pElementType,\n            /* [in] */ ULONG32 rank,\n            /* [size_is][in] */ ULONG32 dims[  ],\n            /* [size_is][in] */ ULONG32 lowBounds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE NewStringWithLength(\n            /* [in] */ LPCWSTR string,\n            /* [in] */ UINT uiLength) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RudeAbort( void) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugEval2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugEval2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugEval2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugEval2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CallParameterizedFunction )(\n            ICorDebugEval2 * This,\n            /* [in] */ ICorDebugFunction *pFunction,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateValueForType )(\n            ICorDebugEval2 * This,\n            /* [in] */ ICorDebugType *pType,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *NewParameterizedObject )(\n            ICorDebugEval2 * This,\n            /* [in] */ ICorDebugFunction *pConstructor,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ],\n            /* [in] */ ULONG32 nArgs,\n            /* [size_is][in] */ ICorDebugValue *ppArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *NewParameterizedObjectNoConstructor )(\n            ICorDebugEval2 * This,\n            /* [in] */ ICorDebugClass *pClass,\n            /* [in] */ ULONG32 nTypeArgs,\n            /* [size_is][in] */ ICorDebugType *ppTypeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *NewParameterizedArray )(\n            ICorDebugEval2 * This,\n            /* [in] */ ICorDebugType *pElementType,\n            /* [in] */ ULONG32 rank,\n            /* [size_is][in] */ ULONG32 dims[  ],\n            /* [size_is][in] */ ULONG32 lowBounds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *NewStringWithLength )(\n            ICorDebugEval2 * This,\n            /* [in] */ LPCWSTR string,\n            /* [in] */ UINT uiLength);\n\n        HRESULT ( STDMETHODCALLTYPE *RudeAbort )(\n            ICorDebugEval2 * This);\n\n        END_INTERFACE\n    } ICorDebugEval2Vtbl;\n\n    interface ICorDebugEval2\n    {\n        CONST_VTBL struct ICorDebugEval2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugEval2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugEval2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugEval2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugEval2_CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs)\t\\\n    ( (This)->lpVtbl -> CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) )\n\n#define ICorDebugEval2_CreateValueForType(This,pType,ppValue)\t\\\n    ( (This)->lpVtbl -> CreateValueForType(This,pType,ppValue) )\n\n#define ICorDebugEval2_NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs)\t\\\n    ( (This)->lpVtbl -> NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) )\n\n#define ICorDebugEval2_NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs)\t\\\n    ( (This)->lpVtbl -> NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) )\n\n#define ICorDebugEval2_NewParameterizedArray(This,pElementType,rank,dims,lowBounds)\t\\\n    ( (This)->lpVtbl -> NewParameterizedArray(This,pElementType,rank,dims,lowBounds) )\n\n#define ICorDebugEval2_NewStringWithLength(This,string,uiLength)\t\\\n    ( (This)->lpVtbl -> NewStringWithLength(This,string,uiLength) )\n\n#define ICorDebugEval2_RudeAbort(This)\t\\\n    ( (This)->lpVtbl -> RudeAbort(This) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugEval2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugValue_INTERFACE_DEFINED__\n#define __ICorDebugValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAF7-8A68-11d2-983C-0000F808342D\")\n    ICorDebugValue : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetType(\n            /* [out] */ CorElementType *pType) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSize(\n            /* [out] */ ULONG32 *pSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAddress(\n            /* [out] */ CORDB_ADDRESS *pAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateBreakpoint(\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        END_INTERFACE\n    } ICorDebugValueVtbl;\n\n    interface ICorDebugValue\n    {\n        CONST_VTBL struct ICorDebugValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugValue2_INTERFACE_DEFINED__\n#define __ICorDebugValue2_INTERFACE_DEFINED__\n\n/* interface ICorDebugValue2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugValue2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"5E0B54E7-D88A-4626-9420-A691E0A78B49\")\n    ICorDebugValue2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetExactType(\n            /* [out] */ ICorDebugType **ppType) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugValue2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugValue2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugValue2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugValue2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetExactType )(\n            ICorDebugValue2 * This,\n            /* [out] */ ICorDebugType **ppType);\n\n        END_INTERFACE\n    } ICorDebugValue2Vtbl;\n\n    interface ICorDebugValue2\n    {\n        CONST_VTBL struct ICorDebugValue2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugValue2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugValue2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugValue2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugValue2_GetExactType(This,ppType)\t\\\n    ( (This)->lpVtbl -> GetExactType(This,ppType) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugValue2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugValue3_INTERFACE_DEFINED__\n#define __ICorDebugValue3_INTERFACE_DEFINED__\n\n/* interface ICorDebugValue3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugValue3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"565005FC-0F8A-4F3E-9EDB-83102B156595\")\n    ICorDebugValue3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetSize64(\n            /* [out] */ ULONG64 *pSize) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugValue3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugValue3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugValue3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugValue3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize64 )(\n            ICorDebugValue3 * This,\n            /* [out] */ ULONG64 *pSize);\n\n        END_INTERFACE\n    } ICorDebugValue3Vtbl;\n\n    interface ICorDebugValue3\n    {\n        CONST_VTBL struct ICorDebugValue3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugValue3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugValue3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugValue3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugValue3_GetSize64(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize64(This,pSize) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugValue3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugGenericValue_INTERFACE_DEFINED__\n#define __ICorDebugGenericValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugGenericValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugGenericValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAF8-8A68-11d2-983C-0000F808342D\")\n    ICorDebugGenericValue : public ICorDebugValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetValue(\n            /* [out] */ void *pTo) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetValue(\n            /* [in] */ void *pFrom) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugGenericValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugGenericValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugGenericValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugGenericValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugGenericValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugGenericValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugGenericValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugGenericValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetValue )(\n            ICorDebugGenericValue * This,\n            /* [out] */ void *pTo);\n\n        HRESULT ( STDMETHODCALLTYPE *SetValue )(\n            ICorDebugGenericValue * This,\n            /* [in] */ void *pFrom);\n\n        END_INTERFACE\n    } ICorDebugGenericValueVtbl;\n\n    interface ICorDebugGenericValue\n    {\n        CONST_VTBL struct ICorDebugGenericValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugGenericValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugGenericValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugGenericValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugGenericValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugGenericValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugGenericValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugGenericValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugGenericValue_GetValue(This,pTo)\t\\\n    ( (This)->lpVtbl -> GetValue(This,pTo) )\n\n#define ICorDebugGenericValue_SetValue(This,pFrom)\t\\\n    ( (This)->lpVtbl -> SetValue(This,pFrom) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugGenericValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugReferenceValue_INTERFACE_DEFINED__\n#define __ICorDebugReferenceValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugReferenceValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugReferenceValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAF9-8A68-11d2-983C-0000F808342D\")\n    ICorDebugReferenceValue : public ICorDebugValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsNull(\n            /* [out] */ BOOL *pbNull) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetValue(\n            /* [out] */ CORDB_ADDRESS *pValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetValue(\n            /* [in] */ CORDB_ADDRESS value) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Dereference(\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DereferenceStrong(\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugReferenceValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugReferenceValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugReferenceValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugReferenceValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *IsNull )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ BOOL *pbNull);\n\n        HRESULT ( STDMETHODCALLTYPE *GetValue )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ CORDB_ADDRESS *pValue);\n\n        HRESULT ( STDMETHODCALLTYPE *SetValue )(\n            ICorDebugReferenceValue * This,\n            /* [in] */ CORDB_ADDRESS value);\n\n        HRESULT ( STDMETHODCALLTYPE *Dereference )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *DereferenceStrong )(\n            ICorDebugReferenceValue * This,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        END_INTERFACE\n    } ICorDebugReferenceValueVtbl;\n\n    interface ICorDebugReferenceValue\n    {\n        CONST_VTBL struct ICorDebugReferenceValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugReferenceValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugReferenceValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugReferenceValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugReferenceValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugReferenceValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugReferenceValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugReferenceValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugReferenceValue_IsNull(This,pbNull)\t\\\n    ( (This)->lpVtbl -> IsNull(This,pbNull) )\n\n#define ICorDebugReferenceValue_GetValue(This,pValue)\t\\\n    ( (This)->lpVtbl -> GetValue(This,pValue) )\n\n#define ICorDebugReferenceValue_SetValue(This,value)\t\\\n    ( (This)->lpVtbl -> SetValue(This,value) )\n\n#define ICorDebugReferenceValue_Dereference(This,ppValue)\t\\\n    ( (This)->lpVtbl -> Dereference(This,ppValue) )\n\n#define ICorDebugReferenceValue_DereferenceStrong(This,ppValue)\t\\\n    ( (This)->lpVtbl -> DereferenceStrong(This,ppValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugReferenceValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue_INTERFACE_DEFINED__\n#define __ICorDebugHeapValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugHeapValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugHeapValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAFA-8A68-11d2-983C-0000F808342D\")\n    ICorDebugHeapValue : public ICorDebugValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsValid(\n            /* [out] */ BOOL *pbValid) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE CreateRelocBreakpoint(\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugHeapValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugHeapValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugHeapValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugHeapValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugHeapValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugHeapValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugHeapValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugHeapValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *IsValid )(\n            ICorDebugHeapValue * This,\n            /* [out] */ BOOL *pbValid);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )(\n            ICorDebugHeapValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        END_INTERFACE\n    } ICorDebugHeapValueVtbl;\n\n    interface ICorDebugHeapValue\n    {\n        CONST_VTBL struct ICorDebugHeapValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugHeapValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugHeapValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugHeapValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugHeapValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugHeapValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugHeapValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugHeapValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugHeapValue_IsValid(This,pbValid)\t\\\n    ( (This)->lpVtbl -> IsValid(This,pbValid) )\n\n#define ICorDebugHeapValue_CreateRelocBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugHeapValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue2_INTERFACE_DEFINED__\n#define __ICorDebugHeapValue2_INTERFACE_DEFINED__\n\n/* interface ICorDebugHeapValue2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugHeapValue2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"E3AC4D6C-9CB7-43e6-96CC-B21540E5083C\")\n    ICorDebugHeapValue2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreateHandle(\n            /* [in] */ CorDebugHandleType type,\n            /* [out] */ ICorDebugHandleValue **ppHandle) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugHeapValue2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugHeapValue2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugHeapValue2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugHeapValue2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateHandle )(\n            ICorDebugHeapValue2 * This,\n            /* [in] */ CorDebugHandleType type,\n            /* [out] */ ICorDebugHandleValue **ppHandle);\n\n        END_INTERFACE\n    } ICorDebugHeapValue2Vtbl;\n\n    interface ICorDebugHeapValue2\n    {\n        CONST_VTBL struct ICorDebugHeapValue2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugHeapValue2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugHeapValue2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugHeapValue2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugHeapValue2_CreateHandle(This,type,ppHandle)\t\\\n    ( (This)->lpVtbl -> CreateHandle(This,type,ppHandle) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugHeapValue2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue3_INTERFACE_DEFINED__\n#define __ICorDebugHeapValue3_INTERFACE_DEFINED__\n\n/* interface ICorDebugHeapValue3 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugHeapValue3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"A69ACAD8-2374-46e9-9FF8-B1F14120D296\")\n    ICorDebugHeapValue3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetThreadOwningMonitorLock(\n            /* [out] */ ICorDebugThread **ppThread,\n            /* [out] */ DWORD *pAcquisitionCount) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMonitorEventWaitList(\n            /* [out] */ ICorDebugThreadEnum **ppThreadEnum) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugHeapValue3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugHeapValue3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugHeapValue3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugHeapValue3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadOwningMonitorLock )(\n            ICorDebugHeapValue3 * This,\n            /* [out] */ ICorDebugThread **ppThread,\n            /* [out] */ DWORD *pAcquisitionCount);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMonitorEventWaitList )(\n            ICorDebugHeapValue3 * This,\n            /* [out] */ ICorDebugThreadEnum **ppThreadEnum);\n\n        END_INTERFACE\n    } ICorDebugHeapValue3Vtbl;\n\n    interface ICorDebugHeapValue3\n    {\n        CONST_VTBL struct ICorDebugHeapValue3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugHeapValue3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugHeapValue3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugHeapValue3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugHeapValue3_GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount)\t\\\n    ( (This)->lpVtbl -> GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) )\n\n#define ICorDebugHeapValue3_GetMonitorEventWaitList(This,ppThreadEnum)\t\\\n    ( (This)->lpVtbl -> GetMonitorEventWaitList(This,ppThreadEnum) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugHeapValue3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugHeapValue4_INTERFACE_DEFINED__\n#define __ICorDebugHeapValue4_INTERFACE_DEFINED__\n\n/* interface ICorDebugHeapValue4 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugHeapValue4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"B35DD495-A555-463B-9BE9-C55338486BB8\")\n    ICorDebugHeapValue4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreatePinnedHandle(\n            /* [out] */ ICorDebugHandleValue **ppHandle) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugHeapValue4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugHeapValue4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugHeapValue4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugHeapValue4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CreatePinnedHandle )(\n            ICorDebugHeapValue4 * This,\n            /* [out] */ ICorDebugHandleValue **ppHandle);\n\n        END_INTERFACE\n    } ICorDebugHeapValue4Vtbl;\n\n    interface ICorDebugHeapValue4\n    {\n        CONST_VTBL struct ICorDebugHeapValue4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugHeapValue4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugHeapValue4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugHeapValue4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugHeapValue4_CreatePinnedHandle(This,ppHandle)\t\\\n    ( (This)->lpVtbl -> CreatePinnedHandle(This,ppHandle) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugHeapValue4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugObjectValue_INTERFACE_DEFINED__\n#define __ICorDebugObjectValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugObjectValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugObjectValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"18AD3D6E-B7D2-11d2-BD04-0000F80849BD\")\n    ICorDebugObjectValue : public ICorDebugValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetClass(\n            /* [out] */ ICorDebugClass **ppClass) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFieldValue(\n            /* [in] */ ICorDebugClass *pClass,\n            /* [in] */ mdFieldDef fieldDef,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetVirtualMethod(\n            /* [in] */ mdMemberRef memberRef,\n            /* [out] */ ICorDebugFunction **ppFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetContext(\n            /* [out] */ ICorDebugContext **ppContext) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsValueClass(\n            /* [out] */ BOOL *pbIsValueClass) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetManagedCopy(\n            /* [out] */ IUnknown **ppObject) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetFromManagedCopy(\n            /* [in] */ IUnknown *pObject) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugObjectValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugObjectValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugObjectValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugObjectValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugObjectValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugObjectValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugObjectValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugObjectValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClass )(\n            ICorDebugObjectValue * This,\n            /* [out] */ ICorDebugClass **ppClass);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFieldValue )(\n            ICorDebugObjectValue * This,\n            /* [in] */ ICorDebugClass *pClass,\n            /* [in] */ mdFieldDef fieldDef,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVirtualMethod )(\n            ICorDebugObjectValue * This,\n            /* [in] */ mdMemberRef memberRef,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContext )(\n            ICorDebugObjectValue * This,\n            /* [out] */ ICorDebugContext **ppContext);\n\n        HRESULT ( STDMETHODCALLTYPE *IsValueClass )(\n            ICorDebugObjectValue * This,\n            /* [out] */ BOOL *pbIsValueClass);\n\n        HRESULT ( STDMETHODCALLTYPE *GetManagedCopy )(\n            ICorDebugObjectValue * This,\n            /* [out] */ IUnknown **ppObject);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFromManagedCopy )(\n            ICorDebugObjectValue * This,\n            /* [in] */ IUnknown *pObject);\n\n        END_INTERFACE\n    } ICorDebugObjectValueVtbl;\n\n    interface ICorDebugObjectValue\n    {\n        CONST_VTBL struct ICorDebugObjectValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugObjectValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugObjectValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugObjectValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugObjectValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugObjectValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugObjectValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugObjectValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugObjectValue_GetClass(This,ppClass)\t\\\n    ( (This)->lpVtbl -> GetClass(This,ppClass) )\n\n#define ICorDebugObjectValue_GetFieldValue(This,pClass,fieldDef,ppValue)\t\\\n    ( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) )\n\n#define ICorDebugObjectValue_GetVirtualMethod(This,memberRef,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) )\n\n#define ICorDebugObjectValue_GetContext(This,ppContext)\t\\\n    ( (This)->lpVtbl -> GetContext(This,ppContext) )\n\n#define ICorDebugObjectValue_IsValueClass(This,pbIsValueClass)\t\\\n    ( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) )\n\n#define ICorDebugObjectValue_GetManagedCopy(This,ppObject)\t\\\n    ( (This)->lpVtbl -> GetManagedCopy(This,ppObject) )\n\n#define ICorDebugObjectValue_SetFromManagedCopy(This,pObject)\t\\\n    ( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugObjectValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugObjectValue2_INTERFACE_DEFINED__\n#define __ICorDebugObjectValue2_INTERFACE_DEFINED__\n\n/* interface ICorDebugObjectValue2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugObjectValue2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"49E4A320-4A9B-4eca-B105-229FB7D5009F\")\n    ICorDebugObjectValue2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetVirtualMethodAndType(\n            /* [in] */ mdMemberRef memberRef,\n            /* [out] */ ICorDebugFunction **ppFunction,\n            /* [out] */ ICorDebugType **ppType) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugObjectValue2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugObjectValue2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugObjectValue2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugObjectValue2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVirtualMethodAndType )(\n            ICorDebugObjectValue2 * This,\n            /* [in] */ mdMemberRef memberRef,\n            /* [out] */ ICorDebugFunction **ppFunction,\n            /* [out] */ ICorDebugType **ppType);\n\n        END_INTERFACE\n    } ICorDebugObjectValue2Vtbl;\n\n    interface ICorDebugObjectValue2\n    {\n        CONST_VTBL struct ICorDebugObjectValue2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugObjectValue2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugObjectValue2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugObjectValue2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugObjectValue2_GetVirtualMethodAndType(This,memberRef,ppFunction,ppType)\t\\\n    ( (This)->lpVtbl -> GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugObjectValue2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__\n#define __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugDelegateObjectValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugDelegateObjectValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3AF70CC7-6047-47F6-A5C5-090A1A622638\")\n    ICorDebugDelegateObjectValue : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetTarget(\n            /* [out] */ ICorDebugReferenceValue **ppObject) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunction(\n            /* [out] */ ICorDebugFunction **ppFunction) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugDelegateObjectValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugDelegateObjectValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugDelegateObjectValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugDelegateObjectValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTarget )(\n            ICorDebugDelegateObjectValue * This,\n            /* [out] */ ICorDebugReferenceValue **ppObject);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunction )(\n            ICorDebugDelegateObjectValue * This,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        END_INTERFACE\n    } ICorDebugDelegateObjectValueVtbl;\n\n    interface ICorDebugDelegateObjectValue\n    {\n        CONST_VTBL struct ICorDebugDelegateObjectValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugDelegateObjectValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugDelegateObjectValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugDelegateObjectValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugDelegateObjectValue_GetTarget(This,ppObject)\t\\\n    ( (This)->lpVtbl -> GetTarget(This,ppObject) )\n\n#define ICorDebugDelegateObjectValue_GetFunction(This,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetFunction(This,ppFunction) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugBoxValue_INTERFACE_DEFINED__\n#define __ICorDebugBoxValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugBoxValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugBoxValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAFC-8A68-11d2-983C-0000F808342D\")\n    ICorDebugBoxValue : public ICorDebugHeapValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetObject(\n            /* [out] */ ICorDebugObjectValue **ppObject) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugBoxValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugBoxValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugBoxValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugBoxValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugBoxValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugBoxValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugBoxValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugBoxValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *IsValid )(\n            ICorDebugBoxValue * This,\n            /* [out] */ BOOL *pbValid);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )(\n            ICorDebugBoxValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObject )(\n            ICorDebugBoxValue * This,\n            /* [out] */ ICorDebugObjectValue **ppObject);\n\n        END_INTERFACE\n    } ICorDebugBoxValueVtbl;\n\n    interface ICorDebugBoxValue\n    {\n        CONST_VTBL struct ICorDebugBoxValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugBoxValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugBoxValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugBoxValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugBoxValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugBoxValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugBoxValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugBoxValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugBoxValue_IsValid(This,pbValid)\t\\\n    ( (This)->lpVtbl -> IsValid(This,pbValid) )\n\n#define ICorDebugBoxValue_CreateRelocBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugBoxValue_GetObject(This,ppObject)\t\\\n    ( (This)->lpVtbl -> GetObject(This,ppObject) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugBoxValue_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0105 */\n/* [local] */\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0105_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0105_v0_0_s_ifspec;\n\n#ifndef __ICorDebugStringValue_INTERFACE_DEFINED__\n#define __ICorDebugStringValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugStringValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugStringValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCAFD-8A68-11d2-983C-0000F808342D\")\n    ICorDebugStringValue : public ICorDebugHeapValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetLength(\n            /* [out] */ ULONG32 *pcchString) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetString(\n            /* [in] */ ULONG32 cchString,\n            /* [out] */ ULONG32 *pcchString,\n            /* [length_is][size_is][out] */ WCHAR szString[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugStringValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugStringValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugStringValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugStringValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugStringValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugStringValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugStringValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugStringValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *IsValid )(\n            ICorDebugStringValue * This,\n            /* [out] */ BOOL *pbValid);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )(\n            ICorDebugStringValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLength )(\n            ICorDebugStringValue * This,\n            /* [out] */ ULONG32 *pcchString);\n\n        HRESULT ( STDMETHODCALLTYPE *GetString )(\n            ICorDebugStringValue * This,\n            /* [in] */ ULONG32 cchString,\n            /* [out] */ ULONG32 *pcchString,\n            /* [length_is][size_is][out] */ WCHAR szString[  ]);\n\n        END_INTERFACE\n    } ICorDebugStringValueVtbl;\n\n    interface ICorDebugStringValue\n    {\n        CONST_VTBL struct ICorDebugStringValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugStringValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugStringValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugStringValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugStringValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugStringValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugStringValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugStringValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugStringValue_IsValid(This,pbValid)\t\\\n    ( (This)->lpVtbl -> IsValid(This,pbValid) )\n\n#define ICorDebugStringValue_CreateRelocBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugStringValue_GetLength(This,pcchString)\t\\\n    ( (This)->lpVtbl -> GetLength(This,pcchString) )\n\n#define ICorDebugStringValue_GetString(This,cchString,pcchString,szString)\t\\\n    ( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugStringValue_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0106 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0106_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0106_v0_0_s_ifspec;\n\n#ifndef __ICorDebugArrayValue_INTERFACE_DEFINED__\n#define __ICorDebugArrayValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugArrayValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugArrayValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"0405B0DF-A660-11d2-BD02-0000F80849BD\")\n    ICorDebugArrayValue : public ICorDebugHeapValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetElementType(\n            /* [out] */ CorElementType *pType) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRank(\n            /* [out] */ ULONG32 *pnRank) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ ULONG32 *pnCount) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDimensions(\n            /* [in] */ ULONG32 cdim,\n            /* [length_is][size_is][out] */ ULONG32 dims[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE HasBaseIndicies(\n            /* [out] */ BOOL *pbHasBaseIndicies) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetBaseIndicies(\n            /* [in] */ ULONG32 cdim,\n            /* [length_is][size_is][out] */ ULONG32 indices[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetElement(\n            /* [in] */ ULONG32 cdim,\n            /* [length_is][size_is][in] */ ULONG32 indices[  ],\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetElementAtPosition(\n            /* [in] */ ULONG32 nPosition,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugArrayValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugArrayValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugArrayValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugArrayValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugArrayValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugArrayValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugArrayValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugArrayValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *IsValid )(\n            ICorDebugArrayValue * This,\n            /* [out] */ BOOL *pbValid);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateRelocBreakpoint )(\n            ICorDebugArrayValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetElementType )(\n            ICorDebugArrayValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRank )(\n            ICorDebugArrayValue * This,\n            /* [out] */ ULONG32 *pnRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugArrayValue * This,\n            /* [out] */ ULONG32 *pnCount);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDimensions )(\n            ICorDebugArrayValue * This,\n            /* [in] */ ULONG32 cdim,\n            /* [length_is][size_is][out] */ ULONG32 dims[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HasBaseIndicies )(\n            ICorDebugArrayValue * This,\n            /* [out] */ BOOL *pbHasBaseIndicies);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBaseIndicies )(\n            ICorDebugArrayValue * This,\n            /* [in] */ ULONG32 cdim,\n            /* [length_is][size_is][out] */ ULONG32 indices[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetElement )(\n            ICorDebugArrayValue * This,\n            /* [in] */ ULONG32 cdim,\n            /* [length_is][size_is][in] */ ULONG32 indices[  ],\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetElementAtPosition )(\n            ICorDebugArrayValue * This,\n            /* [in] */ ULONG32 nPosition,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        END_INTERFACE\n    } ICorDebugArrayValueVtbl;\n\n    interface ICorDebugArrayValue\n    {\n        CONST_VTBL struct ICorDebugArrayValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugArrayValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugArrayValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugArrayValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugArrayValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugArrayValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugArrayValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugArrayValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugArrayValue_IsValid(This,pbValid)\t\\\n    ( (This)->lpVtbl -> IsValid(This,pbValid) )\n\n#define ICorDebugArrayValue_CreateRelocBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugArrayValue_GetElementType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetElementType(This,pType) )\n\n#define ICorDebugArrayValue_GetRank(This,pnRank)\t\\\n    ( (This)->lpVtbl -> GetRank(This,pnRank) )\n\n#define ICorDebugArrayValue_GetCount(This,pnCount)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pnCount) )\n\n#define ICorDebugArrayValue_GetDimensions(This,cdim,dims)\t\\\n    ( (This)->lpVtbl -> GetDimensions(This,cdim,dims) )\n\n#define ICorDebugArrayValue_HasBaseIndicies(This,pbHasBaseIndicies)\t\\\n    ( (This)->lpVtbl -> HasBaseIndicies(This,pbHasBaseIndicies) )\n\n#define ICorDebugArrayValue_GetBaseIndicies(This,cdim,indices)\t\\\n    ( (This)->lpVtbl -> GetBaseIndicies(This,cdim,indices) )\n\n#define ICorDebugArrayValue_GetElement(This,cdim,indices,ppValue)\t\\\n    ( (This)->lpVtbl -> GetElement(This,cdim,indices,ppValue) )\n\n#define ICorDebugArrayValue_GetElementAtPosition(This,nPosition,ppValue)\t\\\n    ( (This)->lpVtbl -> GetElementAtPosition(This,nPosition,ppValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugArrayValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugVariableHome_INTERFACE_DEFINED__\n#define __ICorDebugVariableHome_INTERFACE_DEFINED__\n\n/* interface ICorDebugVariableHome */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum VariableLocationType\n    {\n        VLT_REGISTER\t= 0,\n        VLT_REGISTER_RELATIVE\t= ( VLT_REGISTER + 1 ) ,\n        VLT_INVALID\t= ( VLT_REGISTER_RELATIVE + 1 )\n    } \tVariableLocationType;\n\n\nEXTERN_C const IID IID_ICorDebugVariableHome;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"50847b8d-f43f-41b0-924c-6383a5f2278b\")\n    ICorDebugVariableHome : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetCode(\n            /* [out] */ ICorDebugCode **ppCode) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSlotIndex(\n            /* [out] */ ULONG32 *pSlotIndex) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetArgumentIndex(\n            /* [out] */ ULONG32 *pArgumentIndex) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLiveRange(\n            /* [out] */ ULONG32 *pStartOffset,\n            /* [out] */ ULONG32 *pEndOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLocationType(\n            /* [out] */ VariableLocationType *pLocationType) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRegister(\n            /* [out] */ CorDebugRegister *pRegister) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetOffset(\n            /* [out] */ LONG *pOffset) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugVariableHomeVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugVariableHome * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugVariableHome * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugVariableHome * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCode )(\n            ICorDebugVariableHome * This,\n            /* [out] */ ICorDebugCode **ppCode);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSlotIndex )(\n            ICorDebugVariableHome * This,\n            /* [out] */ ULONG32 *pSlotIndex);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArgumentIndex )(\n            ICorDebugVariableHome * This,\n            /* [out] */ ULONG32 *pArgumentIndex);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLiveRange )(\n            ICorDebugVariableHome * This,\n            /* [out] */ ULONG32 *pStartOffset,\n            /* [out] */ ULONG32 *pEndOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLocationType )(\n            ICorDebugVariableHome * This,\n            /* [out] */ VariableLocationType *pLocationType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegister )(\n            ICorDebugVariableHome * This,\n            /* [out] */ CorDebugRegister *pRegister);\n\n        HRESULT ( STDMETHODCALLTYPE *GetOffset )(\n            ICorDebugVariableHome * This,\n            /* [out] */ LONG *pOffset);\n\n        END_INTERFACE\n    } ICorDebugVariableHomeVtbl;\n\n    interface ICorDebugVariableHome\n    {\n        CONST_VTBL struct ICorDebugVariableHomeVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugVariableHome_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugVariableHome_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugVariableHome_GetCode(This,ppCode)\t\\\n    ( (This)->lpVtbl -> GetCode(This,ppCode) )\n\n#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex)\t\\\n    ( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) )\n\n#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex)\t\\\n    ( (This)->lpVtbl -> GetArgumentIndex(This,pArgumentIndex) )\n\n#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset)\t\\\n    ( (This)->lpVtbl -> GetLiveRange(This,pStartOffset,pEndOffset) )\n\n#define ICorDebugVariableHome_GetLocationType(This,pLocationType)\t\\\n    ( (This)->lpVtbl -> GetLocationType(This,pLocationType) )\n\n#define ICorDebugVariableHome_GetRegister(This,pRegister)\t\\\n    ( (This)->lpVtbl -> GetRegister(This,pRegister) )\n\n#define ICorDebugVariableHome_GetOffset(This,pOffset)\t\\\n    ( (This)->lpVtbl -> GetOffset(This,pOffset) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugVariableHome_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugHandleValue_INTERFACE_DEFINED__\n#define __ICorDebugHandleValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugHandleValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugHandleValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"029596E8-276B-46a1-9821-732E96BBB00B\")\n    ICorDebugHandleValue : public ICorDebugReferenceValue\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetHandleType(\n            /* [out] */ CorDebugHandleType *pType) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Dispose( void) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugHandleValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugHandleValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugHandleValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugHandleValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugHandleValue * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugHandleValue * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugHandleValue * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugHandleValue * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *IsNull )(\n            ICorDebugHandleValue * This,\n            /* [out] */ BOOL *pbNull);\n\n        HRESULT ( STDMETHODCALLTYPE *GetValue )(\n            ICorDebugHandleValue * This,\n            /* [out] */ CORDB_ADDRESS *pValue);\n\n        HRESULT ( STDMETHODCALLTYPE *SetValue )(\n            ICorDebugHandleValue * This,\n            /* [in] */ CORDB_ADDRESS value);\n\n        HRESULT ( STDMETHODCALLTYPE *Dereference )(\n            ICorDebugHandleValue * This,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *DereferenceStrong )(\n            ICorDebugHandleValue * This,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleType )(\n            ICorDebugHandleValue * This,\n            /* [out] */ CorDebugHandleType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *Dispose )(\n            ICorDebugHandleValue * This);\n\n        END_INTERFACE\n    } ICorDebugHandleValueVtbl;\n\n    interface ICorDebugHandleValue\n    {\n        CONST_VTBL struct ICorDebugHandleValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugHandleValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugHandleValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugHandleValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugHandleValue_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugHandleValue_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugHandleValue_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugHandleValue_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugHandleValue_IsNull(This,pbNull)\t\\\n    ( (This)->lpVtbl -> IsNull(This,pbNull) )\n\n#define ICorDebugHandleValue_GetValue(This,pValue)\t\\\n    ( (This)->lpVtbl -> GetValue(This,pValue) )\n\n#define ICorDebugHandleValue_SetValue(This,value)\t\\\n    ( (This)->lpVtbl -> SetValue(This,value) )\n\n#define ICorDebugHandleValue_Dereference(This,ppValue)\t\\\n    ( (This)->lpVtbl -> Dereference(This,ppValue) )\n\n#define ICorDebugHandleValue_DereferenceStrong(This,ppValue)\t\\\n    ( (This)->lpVtbl -> DereferenceStrong(This,ppValue) )\n\n\n#define ICorDebugHandleValue_GetHandleType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetHandleType(This,pType) )\n\n#define ICorDebugHandleValue_Dispose(This)\t\\\n    ( (This)->lpVtbl -> Dispose(This) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugHandleValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugContext_INTERFACE_DEFINED__\n#define __ICorDebugContext_INTERFACE_DEFINED__\n\n/* interface ICorDebugContext */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugContext;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB00-8A68-11d2-983C-0000F808342D\")\n    ICorDebugContext : public ICorDebugObjectValue\n    {\n    public:\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugContextVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugContext * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugContext * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugContext * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugContext * This,\n            /* [out] */ CorElementType *pType);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSize )(\n            ICorDebugContext * This,\n            /* [out] */ ULONG32 *pSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAddress )(\n            ICorDebugContext * This,\n            /* [out] */ CORDB_ADDRESS *pAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *CreateBreakpoint )(\n            ICorDebugContext * This,\n            /* [out] */ ICorDebugValueBreakpoint **ppBreakpoint);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClass )(\n            ICorDebugContext * This,\n            /* [out] */ ICorDebugClass **ppClass);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFieldValue )(\n            ICorDebugContext * This,\n            /* [in] */ ICorDebugClass *pClass,\n            /* [in] */ mdFieldDef fieldDef,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetVirtualMethod )(\n            ICorDebugContext * This,\n            /* [in] */ mdMemberRef memberRef,\n            /* [out] */ ICorDebugFunction **ppFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContext )(\n            ICorDebugContext * This,\n            /* [out] */ ICorDebugContext **ppContext);\n\n        HRESULT ( STDMETHODCALLTYPE *IsValueClass )(\n            ICorDebugContext * This,\n            /* [out] */ BOOL *pbIsValueClass);\n\n        HRESULT ( STDMETHODCALLTYPE *GetManagedCopy )(\n            ICorDebugContext * This,\n            /* [out] */ IUnknown **ppObject);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFromManagedCopy )(\n            ICorDebugContext * This,\n            /* [in] */ IUnknown *pObject);\n\n        END_INTERFACE\n    } ICorDebugContextVtbl;\n\n    interface ICorDebugContext\n    {\n        CONST_VTBL struct ICorDebugContextVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugContext_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugContext_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugContext_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugContext_GetType(This,pType)\t\\\n    ( (This)->lpVtbl -> GetType(This,pType) )\n\n#define ICorDebugContext_GetSize(This,pSize)\t\\\n    ( (This)->lpVtbl -> GetSize(This,pSize) )\n\n#define ICorDebugContext_GetAddress(This,pAddress)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,pAddress) )\n\n#define ICorDebugContext_CreateBreakpoint(This,ppBreakpoint)\t\\\n    ( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )\n\n\n#define ICorDebugContext_GetClass(This,ppClass)\t\\\n    ( (This)->lpVtbl -> GetClass(This,ppClass) )\n\n#define ICorDebugContext_GetFieldValue(This,pClass,fieldDef,ppValue)\t\\\n    ( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) )\n\n#define ICorDebugContext_GetVirtualMethod(This,memberRef,ppFunction)\t\\\n    ( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) )\n\n#define ICorDebugContext_GetContext(This,ppContext)\t\\\n    ( (This)->lpVtbl -> GetContext(This,ppContext) )\n\n#define ICorDebugContext_IsValueClass(This,pbIsValueClass)\t\\\n    ( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) )\n\n#define ICorDebugContext_GetManagedCopy(This,ppObject)\t\\\n    ( (This)->lpVtbl -> GetManagedCopy(This,ppObject) )\n\n#define ICorDebugContext_SetFromManagedCopy(This,pObject)\t\\\n    ( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) )\n\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugContext_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugComObjectValue_INTERFACE_DEFINED__\n#define __ICorDebugComObjectValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugComObjectValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugComObjectValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"5F69C5E5-3E12-42DF-B371-F9D761D6EE24\")\n    ICorDebugComObjectValue : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetCachedInterfaceTypes(\n            /* [in] */ BOOL bIInspectableOnly,\n            /* [out] */ ICorDebugTypeEnum **ppInterfacesEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCachedInterfacePointers(\n            /* [in] */ BOOL bIInspectableOnly,\n            /* [in] */ ULONG32 celt,\n            /* [out] */ ULONG32 *pcEltFetched,\n            /* [length_is][size_is][out] */ CORDB_ADDRESS *ptrs) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugComObjectValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugComObjectValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugComObjectValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugComObjectValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCachedInterfaceTypes )(\n            ICorDebugComObjectValue * This,\n            /* [in] */ BOOL bIInspectableOnly,\n            /* [out] */ ICorDebugTypeEnum **ppInterfacesEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCachedInterfacePointers )(\n            ICorDebugComObjectValue * This,\n            /* [in] */ BOOL bIInspectableOnly,\n            /* [in] */ ULONG32 celt,\n            /* [out] */ ULONG32 *pcEltFetched,\n            /* [length_is][size_is][out] */ CORDB_ADDRESS *ptrs);\n\n        END_INTERFACE\n    } ICorDebugComObjectValueVtbl;\n\n    interface ICorDebugComObjectValue\n    {\n        CONST_VTBL struct ICorDebugComObjectValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugComObjectValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugComObjectValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugComObjectValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugComObjectValue_GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum)\t\\\n    ( (This)->lpVtbl -> GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) )\n\n#define ICorDebugComObjectValue_GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs)\t\\\n    ( (This)->lpVtbl -> GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugComObjectValue_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugObjectEnum_INTERFACE_DEFINED__\n#define __ICorDebugObjectEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugObjectEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugObjectEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB02-8A68-11d2-983C-0000F808342D\")\n    ICorDebugObjectEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CORDB_ADDRESS objects[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugObjectEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugObjectEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugObjectEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugObjectEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugObjectEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugObjectEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugObjectEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugObjectEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugObjectEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CORDB_ADDRESS objects[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugObjectEnumVtbl;\n\n    interface ICorDebugObjectEnum\n    {\n        CONST_VTBL struct ICorDebugObjectEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugObjectEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugObjectEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugObjectEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugObjectEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugObjectEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugObjectEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugObjectEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugObjectEnum_Next(This,celt,objects,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugObjectEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugBreakpointEnum_INTERFACE_DEFINED__\n#define __ICorDebugBreakpointEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugBreakpointEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugBreakpointEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB03-8A68-11d2-983C-0000F808342D\")\n    ICorDebugBreakpointEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugBreakpoint *breakpoints[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugBreakpointEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugBreakpointEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugBreakpointEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugBreakpointEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugBreakpointEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugBreakpointEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugBreakpointEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugBreakpointEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugBreakpointEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugBreakpoint *breakpoints[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugBreakpointEnumVtbl;\n\n    interface ICorDebugBreakpointEnum\n    {\n        CONST_VTBL struct ICorDebugBreakpointEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugBreakpointEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugBreakpointEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugBreakpointEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugBreakpointEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugBreakpointEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugBreakpointEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugBreakpointEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugBreakpointEnum_Next(This,celt,breakpoints,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,breakpoints,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugStepperEnum_INTERFACE_DEFINED__\n#define __ICorDebugStepperEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugStepperEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugStepperEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB04-8A68-11d2-983C-0000F808342D\")\n    ICorDebugStepperEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugStepper *steppers[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugStepperEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugStepperEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugStepperEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugStepperEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugStepperEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugStepperEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugStepperEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugStepperEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugStepperEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugStepper *steppers[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugStepperEnumVtbl;\n\n    interface ICorDebugStepperEnum\n    {\n        CONST_VTBL struct ICorDebugStepperEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugStepperEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugStepperEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugStepperEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugStepperEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugStepperEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugStepperEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugStepperEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugStepperEnum_Next(This,celt,steppers,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,steppers,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugStepperEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugProcessEnum_INTERFACE_DEFINED__\n#define __ICorDebugProcessEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcessEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugProcessEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB05-8A68-11d2-983C-0000F808342D\")\n    ICorDebugProcessEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugProcess *processes[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcessEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugProcessEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugProcessEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugProcessEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugProcessEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugProcessEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugProcessEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugProcessEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugProcessEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugProcess *processes[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugProcessEnumVtbl;\n\n    interface ICorDebugProcessEnum\n    {\n        CONST_VTBL struct ICorDebugProcessEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcessEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugProcessEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugProcessEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugProcessEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugProcessEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugProcessEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugProcessEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugProcessEnum_Next(This,celt,processes,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,processes,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcessEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugThreadEnum_INTERFACE_DEFINED__\n#define __ICorDebugThreadEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugThreadEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugThreadEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB06-8A68-11d2-983C-0000F808342D\")\n    ICorDebugThreadEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugThread *threads[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugThreadEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugThreadEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugThreadEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugThreadEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugThreadEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugThreadEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugThreadEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugThreadEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugThreadEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugThread *threads[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugThreadEnumVtbl;\n\n    interface ICorDebugThreadEnum\n    {\n        CONST_VTBL struct ICorDebugThreadEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugThreadEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugThreadEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugThreadEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugThreadEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugThreadEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugThreadEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugThreadEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugThreadEnum_Next(This,celt,threads,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,threads,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugThreadEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugFrameEnum_INTERFACE_DEFINED__\n#define __ICorDebugFrameEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugFrameEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugFrameEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB07-8A68-11d2-983C-0000F808342D\")\n    ICorDebugFrameEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugFrame *frames[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugFrameEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugFrameEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugFrameEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugFrameEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugFrameEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugFrameEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugFrameEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugFrameEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugFrameEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugFrame *frames[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugFrameEnumVtbl;\n\n    interface ICorDebugFrameEnum\n    {\n        CONST_VTBL struct ICorDebugFrameEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugFrameEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugFrameEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugFrameEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugFrameEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugFrameEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugFrameEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugFrameEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugFrameEnum_Next(This,celt,frames,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,frames,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugFrameEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugChainEnum_INTERFACE_DEFINED__\n#define __ICorDebugChainEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugChainEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugChainEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB08-8A68-11d2-983C-0000F808342D\")\n    ICorDebugChainEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugChain *chains[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugChainEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugChainEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugChainEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugChainEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugChainEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugChainEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugChainEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugChainEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugChainEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugChain *chains[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugChainEnumVtbl;\n\n    interface ICorDebugChainEnum\n    {\n        CONST_VTBL struct ICorDebugChainEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugChainEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugChainEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugChainEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugChainEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugChainEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugChainEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugChainEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugChainEnum_Next(This,celt,chains,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,chains,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugChainEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugModuleEnum_INTERFACE_DEFINED__\n#define __ICorDebugModuleEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugModuleEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugModuleEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB09-8A68-11d2-983C-0000F808342D\")\n    ICorDebugModuleEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugModule *modules[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugModuleEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugModuleEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugModuleEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugModuleEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugModuleEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugModuleEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugModuleEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugModuleEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugModuleEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugModule *modules[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugModuleEnumVtbl;\n\n    interface ICorDebugModuleEnum\n    {\n        CONST_VTBL struct ICorDebugModuleEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugModuleEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugModuleEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugModuleEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugModuleEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugModuleEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugModuleEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugModuleEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugModuleEnum_Next(This,celt,modules,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,modules,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugModuleEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugValueEnum_INTERFACE_DEFINED__\n#define __ICorDebugValueEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugValueEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugValueEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC7BCB0A-8A68-11d2-983C-0000F808342D\")\n    ICorDebugValueEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugValue *values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugValueEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugValueEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugValueEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugValueEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugValueEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugValueEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugValueEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugValueEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugValueEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugValue *values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugValueEnumVtbl;\n\n    interface ICorDebugValueEnum\n    {\n        CONST_VTBL struct ICorDebugValueEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugValueEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugValueEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugValueEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugValueEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugValueEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugValueEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugValueEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugValueEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugValueEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__\n#define __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugVariableHomeEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugVariableHomeEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"e76b7a57-4f7a-4309-85a7-5d918c3deaf7\")\n    ICorDebugVariableHomeEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugVariableHome *homes[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugVariableHomeEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugVariableHomeEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugVariableHomeEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugVariableHomeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugVariableHomeEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugVariableHomeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugVariableHomeEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugVariableHomeEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugVariableHomeEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugVariableHome *homes[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugVariableHomeEnumVtbl;\n\n    interface ICorDebugVariableHomeEnum\n    {\n        CONST_VTBL struct ICorDebugVariableHomeEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugVariableHomeEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugVariableHomeEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugVariableHomeEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugVariableHomeEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugVariableHomeEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugVariableHomeEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,homes,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugCodeEnum_INTERFACE_DEFINED__\n#define __ICorDebugCodeEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugCodeEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugCodeEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"55E96461-9645-45e4-A2FF-0367877ABCDE\")\n    ICorDebugCodeEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugCode *values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugCodeEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugCodeEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugCodeEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugCodeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugCodeEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugCodeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugCodeEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugCodeEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugCodeEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugCode *values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugCodeEnumVtbl;\n\n    interface ICorDebugCodeEnum\n    {\n        CONST_VTBL struct ICorDebugCodeEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugCodeEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugCodeEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugCodeEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugCodeEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugCodeEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugCodeEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugCodeEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugCodeEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugCodeEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugTypeEnum_INTERFACE_DEFINED__\n#define __ICorDebugTypeEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugTypeEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugTypeEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"10F27499-9DF2-43ce-8333-A321D7C99CB4\")\n    ICorDebugTypeEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugType *values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugTypeEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugTypeEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugTypeEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugTypeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugTypeEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugTypeEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugTypeEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugTypeEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugTypeEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugType *values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugTypeEnumVtbl;\n\n    interface ICorDebugTypeEnum\n    {\n        CONST_VTBL struct ICorDebugTypeEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugTypeEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugTypeEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugTypeEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugTypeEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugTypeEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugTypeEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugTypeEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugTypeEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugTypeEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugType_INTERFACE_DEFINED__\n#define __ICorDebugType_INTERFACE_DEFINED__\n\n/* interface ICorDebugType */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugType;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"D613F0BB-ACE1-4c19-BD72-E4C08D5DA7F5\")\n    ICorDebugType : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetType(\n            /* [out] */ CorElementType *ty) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClass(\n            /* [out] */ ICorDebugClass **ppClass) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateTypeParameters(\n            /* [out] */ ICorDebugTypeEnum **ppTyParEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFirstTypeParameter(\n            /* [out] */ ICorDebugType **value) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetBase(\n            /* [out] */ ICorDebugType **pBase) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStaticFieldValue(\n            /* [in] */ mdFieldDef fieldDef,\n            /* [in] */ ICorDebugFrame *pFrame,\n            /* [out] */ ICorDebugValue **ppValue) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRank(\n            /* [out] */ ULONG32 *pnRank) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugTypeVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugType * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugType * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugType * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetType )(\n            ICorDebugType * This,\n            /* [out] */ CorElementType *ty);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClass )(\n            ICorDebugType * This,\n            /* [out] */ ICorDebugClass **ppClass);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateTypeParameters )(\n            ICorDebugType * This,\n            /* [out] */ ICorDebugTypeEnum **ppTyParEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFirstTypeParameter )(\n            ICorDebugType * This,\n            /* [out] */ ICorDebugType **value);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBase )(\n            ICorDebugType * This,\n            /* [out] */ ICorDebugType **pBase);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldValue )(\n            ICorDebugType * This,\n            /* [in] */ mdFieldDef fieldDef,\n            /* [in] */ ICorDebugFrame *pFrame,\n            /* [out] */ ICorDebugValue **ppValue);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRank )(\n            ICorDebugType * This,\n            /* [out] */ ULONG32 *pnRank);\n\n        END_INTERFACE\n    } ICorDebugTypeVtbl;\n\n    interface ICorDebugType\n    {\n        CONST_VTBL struct ICorDebugTypeVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugType_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugType_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugType_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugType_GetType(This,ty)\t\\\n    ( (This)->lpVtbl -> GetType(This,ty) )\n\n#define ICorDebugType_GetClass(This,ppClass)\t\\\n    ( (This)->lpVtbl -> GetClass(This,ppClass) )\n\n#define ICorDebugType_EnumerateTypeParameters(This,ppTyParEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) )\n\n#define ICorDebugType_GetFirstTypeParameter(This,value)\t\\\n    ( (This)->lpVtbl -> GetFirstTypeParameter(This,value) )\n\n#define ICorDebugType_GetBase(This,pBase)\t\\\n    ( (This)->lpVtbl -> GetBase(This,pBase) )\n\n#define ICorDebugType_GetStaticFieldValue(This,fieldDef,pFrame,ppValue)\t\\\n    ( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) )\n\n#define ICorDebugType_GetRank(This,pnRank)\t\\\n    ( (This)->lpVtbl -> GetRank(This,pnRank) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugType_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugType2_INTERFACE_DEFINED__\n#define __ICorDebugType2_INTERFACE_DEFINED__\n\n/* interface ICorDebugType2 */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugType2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"e6e91d79-693d-48bc-b417-8284b4f10fb5\")\n    ICorDebugType2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetTypeID(\n            /* [out] */ COR_TYPEID *id) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugType2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugType2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugType2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugType2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTypeID )(\n            ICorDebugType2 * This,\n            /* [out] */ COR_TYPEID *id);\n\n        END_INTERFACE\n    } ICorDebugType2Vtbl;\n\n    interface ICorDebugType2\n    {\n        CONST_VTBL struct ICorDebugType2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugType2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugType2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugType2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugType2_GetTypeID(This,id)\t\\\n    ( (This)->lpVtbl -> GetTypeID(This,id) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugType2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__\n#define __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugErrorInfoEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugErrorInfoEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F0E18809-72B5-11d2-976F-00A0C9B4D50C\")\n    ICorDebugErrorInfoEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugEditAndContinueErrorInfo *errors[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugErrorInfoEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugErrorInfoEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugErrorInfoEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugErrorInfoEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugErrorInfoEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugErrorInfoEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugErrorInfoEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugErrorInfoEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugErrorInfoEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugEditAndContinueErrorInfo *errors[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugErrorInfoEnumVtbl;\n\n    interface ICorDebugErrorInfoEnum\n    {\n        CONST_VTBL struct ICorDebugErrorInfoEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugErrorInfoEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugErrorInfoEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugErrorInfoEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugErrorInfoEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugErrorInfoEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugErrorInfoEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugErrorInfoEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugErrorInfoEnum_Next(This,celt,errors,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,errors,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugAppDomainEnum_INTERFACE_DEFINED__\n#define __ICorDebugAppDomainEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugAppDomainEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAppDomainEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"63ca1b24-4359-4883-bd57-13f815f58744\")\n    ICorDebugAppDomainEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugAppDomain *values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAppDomainEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAppDomainEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAppDomainEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAppDomainEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugAppDomainEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugAppDomainEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugAppDomainEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugAppDomainEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugAppDomainEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugAppDomain *values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugAppDomainEnumVtbl;\n\n    interface ICorDebugAppDomainEnum\n    {\n        CONST_VTBL struct ICorDebugAppDomainEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAppDomainEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAppDomainEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAppDomainEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAppDomainEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugAppDomainEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugAppDomainEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugAppDomainEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugAppDomainEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugAssemblyEnum_INTERFACE_DEFINED__\n#define __ICorDebugAssemblyEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugAssemblyEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugAssemblyEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"4a2a1ec9-85ec-4bfb-9f15-a89fdfe0fe83\")\n    ICorDebugAssemblyEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugAssembly *values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugAssemblyEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugAssemblyEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugAssemblyEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugAssemblyEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugAssemblyEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugAssemblyEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugAssemblyEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugAssemblyEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugAssemblyEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorDebugAssembly *values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugAssemblyEnumVtbl;\n\n    interface ICorDebugAssemblyEnum\n    {\n        CONST_VTBL struct ICorDebugAssemblyEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugAssemblyEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugAssemblyEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugAssemblyEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugAssemblyEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugAssemblyEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugAssemblyEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugAssemblyEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugAssemblyEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__\n#define __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugBlockingObjectEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugBlockingObjectEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"976A6278-134A-4a81-81A3-8F277943F4C3\")\n    ICorDebugBlockingObjectEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CorDebugBlockingObject values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugBlockingObjectEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugBlockingObjectEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugBlockingObjectEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugBlockingObjectEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugBlockingObjectEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugBlockingObjectEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugBlockingObjectEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugBlockingObjectEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugBlockingObjectEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CorDebugBlockingObject values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugBlockingObjectEnumVtbl;\n\n    interface ICorDebugBlockingObjectEnum\n    {\n        CONST_VTBL struct ICorDebugBlockingObjectEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugBlockingObjectEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugBlockingObjectEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugBlockingObjectEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugBlockingObjectEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugBlockingObjectEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugBlockingObjectEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugBlockingObjectEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugBlockingObjectEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0130 */\n/* [local] */\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0130_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0130_v0_0_s_ifspec;\n\n#ifndef __ICorDebugMDA_INTERFACE_DEFINED__\n#define __ICorDebugMDA_INTERFACE_DEFINED__\n\n/* interface ICorDebugMDA */\n/* [unique][uuid][local][object] */\n\ntypedef\nenum CorDebugMDAFlags\n    {\n        MDA_FLAG_SLIP\t= 0x2\n    } \tCorDebugMDAFlags;\n\n\nEXTERN_C const IID IID_ICorDebugMDA;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC726F2F-1DB7-459b-B0EC-05F01D841B42\")\n    ICorDebugMDA : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetName(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDescription(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetXML(\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFlags(\n            /* [in] */ CorDebugMDAFlags *pFlags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetOSThreadId(\n            /* [out] */ DWORD *pOsTid) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugMDAVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugMDA * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugMDA * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugMDA * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetName )(\n            ICorDebugMDA * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDescription )(\n            ICorDebugMDA * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetXML )(\n            ICorDebugMDA * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR szName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFlags )(\n            ICorDebugMDA * This,\n            /* [in] */ CorDebugMDAFlags *pFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *GetOSThreadId )(\n            ICorDebugMDA * This,\n            /* [out] */ DWORD *pOsTid);\n\n        END_INTERFACE\n    } ICorDebugMDAVtbl;\n\n    interface ICorDebugMDA\n    {\n        CONST_VTBL struct ICorDebugMDAVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugMDA_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugMDA_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugMDA_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugMDA_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )\n\n#define ICorDebugMDA_GetDescription(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetDescription(This,cchName,pcchName,szName) )\n\n#define ICorDebugMDA_GetXML(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetXML(This,cchName,pcchName,szName) )\n\n#define ICorDebugMDA_GetFlags(This,pFlags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,pFlags) )\n\n#define ICorDebugMDA_GetOSThreadId(This,pOsTid)\t\\\n    ( (This)->lpVtbl -> GetOSThreadId(This,pOsTid) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugMDA_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0131 */\n/* [local] */\n\n#pragma warning(pop)\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0131_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0131_v0_0_s_ifspec;\n\n#ifndef __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__\n#define __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__\n\n/* interface ICorDebugEditAndContinueErrorInfo */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"8D600D41-F4F6-4cb3-B7EC-7BD164944036\")\n    ICorDebugEditAndContinueErrorInfo : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetModule(\n            /* [out] */ ICorDebugModule **ppModule) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetToken(\n            /* [out] */ mdToken *pToken) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetErrorCode(\n            /* [out] */ HRESULT *pHr) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetString(\n            /* [in] */ ULONG32 cchString,\n            /* [out] */ ULONG32 *pcchString,\n            /* [length_is][size_is][out] */ WCHAR szString[  ]) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugEditAndContinueErrorInfoVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugEditAndContinueErrorInfo * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugEditAndContinueErrorInfo * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugEditAndContinueErrorInfo * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModule )(\n            ICorDebugEditAndContinueErrorInfo * This,\n            /* [out] */ ICorDebugModule **ppModule);\n\n        HRESULT ( STDMETHODCALLTYPE *GetToken )(\n            ICorDebugEditAndContinueErrorInfo * This,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetErrorCode )(\n            ICorDebugEditAndContinueErrorInfo * This,\n            /* [out] */ HRESULT *pHr);\n\n        HRESULT ( STDMETHODCALLTYPE *GetString )(\n            ICorDebugEditAndContinueErrorInfo * This,\n            /* [in] */ ULONG32 cchString,\n            /* [out] */ ULONG32 *pcchString,\n            /* [length_is][size_is][out] */ WCHAR szString[  ]);\n\n        END_INTERFACE\n    } ICorDebugEditAndContinueErrorInfoVtbl;\n\n    interface ICorDebugEditAndContinueErrorInfo\n    {\n        CONST_VTBL struct ICorDebugEditAndContinueErrorInfoVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugEditAndContinueErrorInfo_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugEditAndContinueErrorInfo_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugEditAndContinueErrorInfo_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugEditAndContinueErrorInfo_GetModule(This,ppModule)\t\\\n    ( (This)->lpVtbl -> GetModule(This,ppModule) )\n\n#define ICorDebugEditAndContinueErrorInfo_GetToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetToken(This,pToken) )\n\n#define ICorDebugEditAndContinueErrorInfo_GetErrorCode(This,pHr)\t\\\n    ( (This)->lpVtbl -> GetErrorCode(This,pHr) )\n\n#define ICorDebugEditAndContinueErrorInfo_GetString(This,cchString,pcchString,szString)\t\\\n    ( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_cordebug_0000_0132 */\n/* [local] */\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0132_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0132_v0_0_s_ifspec;\n\n#ifndef __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__\n#define __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__\n\n/* interface ICorDebugEditAndContinueSnapshot */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugEditAndContinueSnapshot;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"6DC3FA01-D7CB-11d2-8A95-0080C792E5D8\")\n    ICorDebugEditAndContinueSnapshot : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CopyMetaData(\n            /* [in] */ IStream *pIStream,\n            /* [out] */ GUID *pMvid) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMvid(\n            /* [out] */ GUID *pMvid) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRoDataRVA(\n            /* [out] */ ULONG32 *pRoDataRVA) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRwDataRVA(\n            /* [out] */ ULONG32 *pRwDataRVA) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetPEBytes(\n            /* [in] */ IStream *pIStream) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetILMap(\n            /* [in] */ mdToken mdFunction,\n            /* [in] */ ULONG cMapSize,\n            /* [size_is][in] */ COR_IL_MAP map[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetPESymbolBytes(\n            /* [in] */ IStream *pIStream) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugEditAndContinueSnapshotVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugEditAndContinueSnapshot * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugEditAndContinueSnapshot * This);\n\n        HRESULT ( STDMETHODCALLTYPE *CopyMetaData )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [in] */ IStream *pIStream,\n            /* [out] */ GUID *pMvid);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMvid )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [out] */ GUID *pMvid);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRoDataRVA )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [out] */ ULONG32 *pRoDataRVA);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRwDataRVA )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [out] */ ULONG32 *pRwDataRVA);\n\n        HRESULT ( STDMETHODCALLTYPE *SetPEBytes )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [in] */ IStream *pIStream);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILMap )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [in] */ mdToken mdFunction,\n            /* [in] */ ULONG cMapSize,\n            /* [size_is][in] */ COR_IL_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetPESymbolBytes )(\n            ICorDebugEditAndContinueSnapshot * This,\n            /* [in] */ IStream *pIStream);\n\n        END_INTERFACE\n    } ICorDebugEditAndContinueSnapshotVtbl;\n\n    interface ICorDebugEditAndContinueSnapshot\n    {\n        CONST_VTBL struct ICorDebugEditAndContinueSnapshotVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugEditAndContinueSnapshot_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugEditAndContinueSnapshot_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugEditAndContinueSnapshot_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugEditAndContinueSnapshot_CopyMetaData(This,pIStream,pMvid)\t\\\n    ( (This)->lpVtbl -> CopyMetaData(This,pIStream,pMvid) )\n\n#define ICorDebugEditAndContinueSnapshot_GetMvid(This,pMvid)\t\\\n    ( (This)->lpVtbl -> GetMvid(This,pMvid) )\n\n#define ICorDebugEditAndContinueSnapshot_GetRoDataRVA(This,pRoDataRVA)\t\\\n    ( (This)->lpVtbl -> GetRoDataRVA(This,pRoDataRVA) )\n\n#define ICorDebugEditAndContinueSnapshot_GetRwDataRVA(This,pRwDataRVA)\t\\\n    ( (This)->lpVtbl -> GetRwDataRVA(This,pRwDataRVA) )\n\n#define ICorDebugEditAndContinueSnapshot_SetPEBytes(This,pIStream)\t\\\n    ( (This)->lpVtbl -> SetPEBytes(This,pIStream) )\n\n#define ICorDebugEditAndContinueSnapshot_SetILMap(This,mdFunction,cMapSize,map)\t\\\n    ( (This)->lpVtbl -> SetILMap(This,mdFunction,cMapSize,map) )\n\n#define ICorDebugEditAndContinueSnapshot_SetPESymbolBytes(This,pIStream)\t\\\n    ( (This)->lpVtbl -> SetPESymbolBytes(This,pIStream) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__\n#define __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__\n\n/* interface ICorDebugExceptionObjectCallStackEnum */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugExceptionObjectCallStackEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"ED775530-4DC4-41F7-86D0-9E2DEF7DFC66\")\n    ICorDebugExceptionObjectCallStackEnum : public ICorDebugEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CorDebugExceptionObjectStackFrame values[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugExceptionObjectCallStackEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugExceptionObjectCallStackEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugExceptionObjectCallStackEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugExceptionObjectCallStackEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorDebugExceptionObjectCallStackEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorDebugExceptionObjectCallStackEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorDebugExceptionObjectCallStackEnum * This,\n            /* [out] */ ICorDebugEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorDebugExceptionObjectCallStackEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorDebugExceptionObjectCallStackEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ CorDebugExceptionObjectStackFrame values[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorDebugExceptionObjectCallStackEnumVtbl;\n\n    interface ICorDebugExceptionObjectCallStackEnum\n    {\n        CONST_VTBL struct ICorDebugExceptionObjectCallStackEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugExceptionObjectCallStackEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugExceptionObjectCallStackEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugExceptionObjectCallStackEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugExceptionObjectCallStackEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorDebugExceptionObjectCallStackEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorDebugExceptionObjectCallStackEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorDebugExceptionObjectCallStackEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n\n#define ICorDebugExceptionObjectCallStackEnum_Next(This,celt,values,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__\n#define __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__\n\n/* interface ICorDebugExceptionObjectValue */\n/* [unique][uuid][local][object] */\n\n\nEXTERN_C const IID IID_ICorDebugExceptionObjectValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"AE4CA65D-59DD-42A2-83A5-57E8A08D8719\")\n    ICorDebugExceptionObjectValue : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumerateExceptionCallStack(\n            /* [out] */ ICorDebugExceptionObjectCallStackEnum **ppCallStackEnum) = 0;\n\n    };\n\n\n#else \t/* C style interface */\n\n    typedef struct ICorDebugExceptionObjectValueVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorDebugExceptionObjectValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorDebugExceptionObjectValue * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorDebugExceptionObjectValue * This);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateExceptionCallStack )(\n            ICorDebugExceptionObjectValue * This,\n            /* [out] */ ICorDebugExceptionObjectCallStackEnum **ppCallStackEnum);\n\n        END_INTERFACE\n    } ICorDebugExceptionObjectValueVtbl;\n\n    interface ICorDebugExceptionObjectValue\n    {\n        CONST_VTBL struct ICorDebugExceptionObjectValueVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorDebugExceptionObjectValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorDebugExceptionObjectValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorDebugExceptionObjectValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorDebugExceptionObjectValue_EnumerateExceptionCallStack(This,ppCallStackEnum)\t\\\n    ( (This)->lpVtbl -> EnumerateExceptionCallStack(This,ppCallStackEnum) )\n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ */\n\n\n\n#ifndef __CORDBLib_LIBRARY_DEFINED__\n#define __CORDBLib_LIBRARY_DEFINED__\n\n/* library CORDBLib */\n/* [helpstring][version][uuid] */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nEXTERN_C const IID LIBID_CORDBLib;\n\nEXTERN_C const CLSID CLSID_CorDebug;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"6fef44d0-39e7-4c77-be8e-c9f8cf988630\")\nCorDebug;\n#endif\n\nEXTERN_C const CLSID CLSID_EmbeddedCLRCorDebug;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"211f1254-bc7e-4af5-b9aa-067308d83dd1\")\nEmbeddedCLRCorDebug;\n#endif\n#endif /* __CORDBLib_LIBRARY_DEFINED__ */\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/corerror.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifndef __COMMON_LANGUAGE_RUNTIME_HRESULTS__\n#define __COMMON_LANGUAGE_RUNTIME_HRESULTS__\n\n#include <winerror.h>\n\n\n//\n//This file is AutoGenerated -- Do Not Edit by hand!!!\n//\n//Add new HRESULTS along with their corresponding error messages to\n//corerror.xml\n//\n\n#ifndef FACILITY_URT\n#define FACILITY_URT            0x13\n#endif\n#ifndef EMAKEHR\n#define SMAKEHR(val) MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_URT, val)\n#define EMAKEHR(val) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_URT, val)\n#endif\n\n#define CLDB_S_TRUNCATION SMAKEHR(0x1106)\n#define META_S_DUPLICATE SMAKEHR(0x1197)\n#define CORDBG_S_BAD_START_SEQUENCE_POINT SMAKEHR(0x130b)\n#define CORDBG_S_BAD_END_SEQUENCE_POINT SMAKEHR(0x130c)\n#define CORDBG_S_FUNC_EVAL_HAS_NO_RESULT SMAKEHR(0x1316)\n#define CORDBG_S_VALUE_POINTS_TO_VOID SMAKEHR(0x1317)\n#define CORDBG_S_FUNC_EVAL_ABORTED SMAKEHR(0x1319)\n#define CORDBG_S_AT_END_OF_STACK SMAKEHR(0x1324)\n#define CORDBG_S_NOT_ALL_BITS_SET SMAKEHR(0x1c13)\n#define COR_E_TYPEUNLOADED EMAKEHR(0x1013)\n#define COR_E_APPDOMAINUNLOADED EMAKEHR(0x1014)\n#define COR_E_CANNOTUNLOADAPPDOMAIN EMAKEHR(0x1015)\n#define MSEE_E_ASSEMBLYLOADINPROGRESS EMAKEHR(0x1016)\n#define COR_E_ASSEMBLYEXPECTED EMAKEHR(0x1018)\n#define COR_E_NEWER_RUNTIME EMAKEHR(0x101b)\n#define COR_E_MULTIMODULEASSEMBLIESDIALLOWED EMAKEHR(0x101e)\n#define HOST_E_INVALIDOPERATION EMAKEHR(0x1022)\n#define HOST_E_CLRNOTAVAILABLE EMAKEHR(0x1023)\n#define FUSION_E_REF_DEF_MISMATCH EMAKEHR(0x1040)\n#define FUSION_E_PRIVATE_ASM_DISALLOWED EMAKEHR(0x1044)\n#define FUSION_E_INVALID_NAME EMAKEHR(0x1047)\n#define FUSION_E_CACHEFILE_FAILED EMAKEHR(0x1052)\n#define FUSION_E_APP_DOMAIN_LOCKED EMAKEHR(0x1053)\n#define COR_E_LOADING_REFERENCE_ASSEMBLY EMAKEHR(0x1058)\n#define COR_E_AMBIGUOUSIMPLEMENTATION EMAKEHR(0x106a)\n#define CLDB_E_FILE_BADREAD EMAKEHR(0x1100)\n#define CLDB_E_FILE_BADWRITE EMAKEHR(0x1101)\n#define CLDB_E_FILE_OLDVER EMAKEHR(0x1107)\n#define CLDB_E_SMDUPLICATE EMAKEHR(0x110a)\n#define CLDB_E_NO_DATA EMAKEHR(0x110b)\n#define CLDB_E_INCOMPATIBLE EMAKEHR(0x110d)\n#define CLDB_E_FILE_CORRUPT EMAKEHR(0x110e)\n#define CLDB_E_BADUPDATEMODE EMAKEHR(0x1110)\n#define CLDB_E_INDEX_NOTFOUND EMAKEHR(0x1124)\n#define CLDB_E_RECORD_NOTFOUND EMAKEHR(0x1130)\n#define CLDB_E_RECORD_OUTOFORDER EMAKEHR(0x1135)\n#define CLDB_E_TOO_BIG EMAKEHR(0x1154)\n#define META_E_INVALID_TOKEN_TYPE EMAKEHR(0x115f)\n#define TLBX_E_LIBNOTREGISTERED EMAKEHR(0x1165)\n#define META_E_BADMETADATA EMAKEHR(0x118a)\n#define META_E_BAD_SIGNATURE EMAKEHR(0x1192)\n#define META_E_BAD_INPUT_PARAMETER EMAKEHR(0x1193)\n#define META_E_CANNOTRESOLVETYPEREF EMAKEHR(0x1196)\n#define META_E_STRINGSPACE_FULL EMAKEHR(0x1198)\n#define META_E_HAS_UNMARKALL EMAKEHR(0x119a)\n#define META_E_MUST_CALL_UNMARKALL EMAKEHR(0x119b)\n#define META_E_CA_INVALID_TARGET EMAKEHR(0x11c0)\n#define META_E_CA_INVALID_VALUE EMAKEHR(0x11c1)\n#define META_E_CA_INVALID_BLOB EMAKEHR(0x11c2)\n#define META_E_CA_REPEATED_ARG EMAKEHR(0x11c3)\n#define META_E_CA_UNKNOWN_ARGUMENT EMAKEHR(0x11c4)\n#define META_E_CA_UNEXPECTED_TYPE EMAKEHR(0x11c7)\n#define META_E_CA_INVALID_ARGTYPE EMAKEHR(0x11c8)\n#define META_E_CA_INVALID_ARG_FOR_TYPE EMAKEHR(0x11c9)\n#define META_E_CA_INVALID_UUID EMAKEHR(0x11ca)\n#define META_E_CA_INVALID_MARSHALAS_FIELDS EMAKEHR(0x11cb)\n#define META_E_CA_NT_FIELDONLY EMAKEHR(0x11cc)\n#define META_E_CA_NEGATIVE_PARAMINDEX EMAKEHR(0x11cd)\n#define META_E_CA_NEGATIVE_CONSTSIZE EMAKEHR(0x11cf)\n#define META_E_CA_FIXEDSTR_SIZE_REQUIRED EMAKEHR(0x11d0)\n#define META_E_CA_CUSTMARSH_TYPE_REQUIRED EMAKEHR(0x11d1)\n#define META_E_NOT_IN_ENC_MODE EMAKEHR(0x11d4)\n#define META_E_CA_BAD_FRIENDS_ARGS EMAKEHR(0x11e5)\n#define META_E_CA_FRIENDS_SN_REQUIRED EMAKEHR(0x11e6)\n#define VLDTR_E_RID_OUTOFRANGE EMAKEHR(0x1203)\n#define VLDTR_E_STRING_INVALID EMAKEHR(0x1206)\n#define VLDTR_E_GUID_INVALID EMAKEHR(0x1207)\n#define VLDTR_E_BLOB_INVALID EMAKEHR(0x1208)\n#define VLDTR_E_MR_BADCALLINGCONV EMAKEHR(0x1224)\n#define VLDTR_E_SIGNULL EMAKEHR(0x1237)\n#define VLDTR_E_MD_BADCALLINGCONV EMAKEHR(0x1239)\n#define VLDTR_E_MD_THISSTATIC EMAKEHR(0x123a)\n#define VLDTR_E_MD_NOTTHISNOTSTATIC EMAKEHR(0x123b)\n#define VLDTR_E_MD_NOARGCNT EMAKEHR(0x123c)\n#define VLDTR_E_SIG_MISSELTYPE EMAKEHR(0x123d)\n#define VLDTR_E_SIG_MISSTKN EMAKEHR(0x123e)\n#define VLDTR_E_SIG_TKNBAD EMAKEHR(0x123f)\n#define VLDTR_E_SIG_MISSFPTR EMAKEHR(0x1240)\n#define VLDTR_E_SIG_MISSFPTRARGCNT EMAKEHR(0x1241)\n#define VLDTR_E_SIG_MISSRANK EMAKEHR(0x1242)\n#define VLDTR_E_SIG_MISSNSIZE EMAKEHR(0x1243)\n#define VLDTR_E_SIG_MISSSIZE EMAKEHR(0x1244)\n#define VLDTR_E_SIG_MISSNLBND EMAKEHR(0x1245)\n#define VLDTR_E_SIG_MISSLBND EMAKEHR(0x1246)\n#define VLDTR_E_SIG_BADELTYPE EMAKEHR(0x1247)\n#define VLDTR_E_TD_ENCLNOTNESTED EMAKEHR(0x1256)\n#define VLDTR_E_FMD_PINVOKENOTSTATIC EMAKEHR(0x1277)\n#define VLDTR_E_SIG_SENTINMETHODDEF EMAKEHR(0x12df)\n#define VLDTR_E_SIG_SENTMUSTVARARG EMAKEHR(0x12e0)\n#define VLDTR_E_SIG_MULTSENTINELS EMAKEHR(0x12e1)\n#define VLDTR_E_SIG_MISSARG EMAKEHR(0x12e3)\n#define VLDTR_E_SIG_BYREFINFIELD EMAKEHR(0x12e4)\n#define CORDBG_E_UNRECOVERABLE_ERROR EMAKEHR(0x1300)\n#define CORDBG_E_PROCESS_TERMINATED EMAKEHR(0x1301)\n#define CORDBG_E_PROCESS_NOT_SYNCHRONIZED EMAKEHR(0x1302)\n#define CORDBG_E_CLASS_NOT_LOADED EMAKEHR(0x1303)\n#define CORDBG_E_IL_VAR_NOT_AVAILABLE EMAKEHR(0x1304)\n#define CORDBG_E_BAD_REFERENCE_VALUE EMAKEHR(0x1305)\n#define CORDBG_E_FIELD_NOT_AVAILABLE EMAKEHR(0x1306)\n#define CORDBG_E_NON_NATIVE_FRAME EMAKEHR(0x1307)\n#define CORDBG_E_CODE_NOT_AVAILABLE EMAKEHR(0x1309)\n#define CORDBG_E_FUNCTION_NOT_IL EMAKEHR(0x130a)\n#define CORDBG_E_CANT_SET_IP_INTO_FINALLY EMAKEHR(0x130e)\n#define CORDBG_E_CANT_SET_IP_OUT_OF_FINALLY EMAKEHR(0x130f)\n#define CORDBG_E_CANT_SET_IP_INTO_CATCH EMAKEHR(0x1310)\n#define CORDBG_E_SET_IP_NOT_ALLOWED_ON_NONLEAF_FRAME EMAKEHR(0x1311)\n#define CORDBG_E_SET_IP_IMPOSSIBLE EMAKEHR(0x1312)\n#define CORDBG_E_FUNC_EVAL_BAD_START_POINT EMAKEHR(0x1313)\n#define CORDBG_E_INVALID_OBJECT EMAKEHR(0x1314)\n#define CORDBG_E_FUNC_EVAL_NOT_COMPLETE EMAKEHR(0x1315)\n#define CORDBG_E_STATIC_VAR_NOT_AVAILABLE EMAKEHR(0x131a)\n#define CORDBG_E_CANT_SETIP_INTO_OR_OUT_OF_FILTER EMAKEHR(0x131c)\n#define CORDBG_E_CANT_CHANGE_JIT_SETTING_FOR_ZAP_MODULE EMAKEHR(0x131d)\n#define CORDBG_E_CANT_SET_IP_OUT_OF_FINALLY_ON_WIN64 EMAKEHR(0x131e)\n#define CORDBG_E_CANT_SET_IP_OUT_OF_CATCH_ON_WIN64 EMAKEHR(0x131f)\n#define CORDBG_E_CANT_SET_TO_JMC EMAKEHR(0x1323)\n#define CORDBG_E_NO_CONTEXT_FOR_INTERNAL_FRAME EMAKEHR(0x1325)\n#define CORDBG_E_NOT_CHILD_FRAME EMAKEHR(0x1326)\n#define CORDBG_E_NON_MATCHING_CONTEXT EMAKEHR(0x1327)\n#define CORDBG_E_PAST_END_OF_STACK EMAKEHR(0x1328)\n#define CORDBG_E_FUNC_EVAL_CANNOT_UPDATE_REGISTER_IN_NONLEAF_FRAME EMAKEHR(0x1329)\n#define CORDBG_E_BAD_THREAD_STATE EMAKEHR(0x132d)\n#define CORDBG_E_DEBUGGER_ALREADY_ATTACHED EMAKEHR(0x132e)\n#define CORDBG_E_SUPERFLOUS_CONTINUE EMAKEHR(0x132f)\n#define CORDBG_E_SET_VALUE_NOT_ALLOWED_ON_NONLEAF_FRAME EMAKEHR(0x1330)\n#define CORDBG_E_ENC_MODULE_NOT_ENC_ENABLED EMAKEHR(0x1332)\n#define CORDBG_E_SET_IP_NOT_ALLOWED_ON_EXCEPTION EMAKEHR(0x1333)\n#define CORDBG_E_VARIABLE_IS_ACTUALLY_LITERAL EMAKEHR(0x1334)\n#define CORDBG_E_PROCESS_DETACHED EMAKEHR(0x1335)\n#define CORDBG_E_ENC_CANT_ADD_FIELD_TO_VALUE_OR_LAYOUT_CLASS EMAKEHR(0x1338)\n#define CORDBG_E_FIELD_NOT_STATIC EMAKEHR(0x133b)\n#define CORDBG_E_FIELD_NOT_INSTANCE EMAKEHR(0x133c)\n#define CORDBG_E_ENC_JIT_CANT_UPDATE EMAKEHR(0x133f)\n#define CORDBG_E_ENC_INTERNAL_ERROR EMAKEHR(0x1341)\n#define CORDBG_E_ENC_HANGING_FIELD EMAKEHR(0x1342)\n#define CORDBG_E_MODULE_NOT_LOADED EMAKEHR(0x1343)\n#define CORDBG_E_UNABLE_TO_SET_BREAKPOINT EMAKEHR(0x1345)\n#define CORDBG_E_DEBUGGING_NOT_POSSIBLE EMAKEHR(0x1346)\n#define CORDBG_E_KERNEL_DEBUGGER_ENABLED EMAKEHR(0x1347)\n#define CORDBG_E_KERNEL_DEBUGGER_PRESENT EMAKEHR(0x1348)\n#define CORDBG_E_INCOMPATIBLE_PROTOCOL EMAKEHR(0x134b)\n#define CORDBG_E_TOO_MANY_PROCESSES EMAKEHR(0x134c)\n#define CORDBG_E_INTEROP_NOT_SUPPORTED EMAKEHR(0x134d)\n#define CORDBG_E_NO_REMAP_BREAKPIONT EMAKEHR(0x134e)\n#define CORDBG_E_OBJECT_NEUTERED EMAKEHR(0x134f)\n#define CORPROF_E_FUNCTION_NOT_COMPILED EMAKEHR(0x1350)\n#define CORPROF_E_DATAINCOMPLETE EMAKEHR(0x1351)\n#define CORPROF_E_FUNCTION_NOT_IL EMAKEHR(0x1354)\n#define CORPROF_E_NOT_MANAGED_THREAD EMAKEHR(0x1355)\n#define CORPROF_E_CALL_ONLY_FROM_INIT EMAKEHR(0x1356)\n#define CORPROF_E_NOT_YET_AVAILABLE EMAKEHR(0x135b)\n#define CORPROF_E_TYPE_IS_PARAMETERIZED EMAKEHR(0x135c)\n#define CORPROF_E_FUNCTION_IS_PARAMETERIZED EMAKEHR(0x135d)\n#define CORPROF_E_STACKSNAPSHOT_INVALID_TGT_THREAD EMAKEHR(0x135e)\n#define CORPROF_E_STACKSNAPSHOT_UNMANAGED_CTX EMAKEHR(0x135f)\n#define CORPROF_E_STACKSNAPSHOT_UNSAFE EMAKEHR(0x1360)\n#define CORPROF_E_STACKSNAPSHOT_ABORTED EMAKEHR(0x1361)\n#define CORPROF_E_LITERALS_HAVE_NO_ADDRESS EMAKEHR(0x1362)\n#define CORPROF_E_UNSUPPORTED_CALL_SEQUENCE EMAKEHR(0x1363)\n#define CORPROF_E_ASYNCHRONOUS_UNSAFE EMAKEHR(0x1364)\n#define CORPROF_E_CLASSID_IS_ARRAY EMAKEHR(0x1365)\n#define CORPROF_E_CLASSID_IS_COMPOSITE EMAKEHR(0x1366)\n#define CORPROF_E_PROFILER_DETACHING EMAKEHR(0x1367)\n#define CORPROF_E_PROFILER_NOT_ATTACHABLE EMAKEHR(0x1368)\n#define CORPROF_E_UNRECOGNIZED_PIPE_MSG_FORMAT EMAKEHR(0x1369)\n#define CORPROF_E_PROFILER_ALREADY_ACTIVE EMAKEHR(0x136a)\n#define CORPROF_E_PROFILEE_INCOMPATIBLE_WITH_TRIGGER EMAKEHR(0x136b)\n#define CORPROF_E_IPC_FAILED EMAKEHR(0x136c)\n#define CORPROF_E_PROFILEE_PROCESS_NOT_FOUND EMAKEHR(0x136d)\n#define CORPROF_E_CALLBACK3_REQUIRED EMAKEHR(0x136e)\n#define CORPROF_E_UNSUPPORTED_FOR_ATTACHING_PROFILER EMAKEHR(0x136f)\n#define CORPROF_E_IRREVERSIBLE_INSTRUMENTATION_PRESENT EMAKEHR(0x1370)\n#define CORPROF_E_RUNTIME_UNINITIALIZED EMAKEHR(0x1371)\n#define CORPROF_E_IMMUTABLE_FLAGS_SET EMAKEHR(0x1372)\n#define CORPROF_E_PROFILER_NOT_YET_INITIALIZED EMAKEHR(0x1373)\n#define CORPROF_E_INCONSISTENT_WITH_FLAGS EMAKEHR(0x1374)\n#define CORPROF_E_PROFILER_CANCEL_ACTIVATION EMAKEHR(0x1375)\n#define CORPROF_E_CONCURRENT_GC_NOT_PROFILABLE EMAKEHR(0x1376)\n#define CORPROF_E_DEBUGGING_DISABLED EMAKEHR(0x1378)\n#define CORPROF_E_TIMEOUT_WAITING_FOR_CONCURRENT_GC EMAKEHR(0x1379)\n#define CORPROF_E_MODULE_IS_DYNAMIC EMAKEHR(0x137a)\n#define CORPROF_E_CALLBACK4_REQUIRED EMAKEHR(0x137b)\n#define CORPROF_E_REJIT_NOT_ENABLED EMAKEHR(0x137c)\n#define CORPROF_E_FUNCTION_IS_COLLECTIBLE EMAKEHR(0x137e)\n#define CORPROF_E_CALLBACK6_REQUIRED EMAKEHR(0x1380)\n#define CORPROF_E_CALLBACK7_REQUIRED EMAKEHR(0x1382)\n#define CORPROF_E_REJIT_INLINING_DISABLED EMAKEHR(0x1383)\n#define CORDIAGIPC_E_BAD_ENCODING EMAKEHR(0x1384)\n#define CORDIAGIPC_E_UNKNOWN_COMMAND EMAKEHR(0x1385)\n#define CORDIAGIPC_E_UNKNOWN_MAGIC EMAKEHR(0x1386)\n#define CORDIAGIPC_E_UNKNOWN_ERROR EMAKEHR(0x1387)\n#define CORPROF_E_SUSPENSION_IN_PROGRESS EMAKEHR(0x1388)\n#define CORSEC_E_POLICY_EXCEPTION EMAKEHR(0x1416)\n#define CORSEC_E_MIN_GRANT_FAIL EMAKEHR(0x1417)\n#define CORSEC_E_NO_EXEC_PERM EMAKEHR(0x1418)\n#define CORSEC_E_XMLSYNTAX EMAKEHR(0x1419)\n#define CORSEC_E_INVALID_STRONGNAME EMAKEHR(0x141a)\n#define CORSEC_E_INVALID_IMAGE_FORMAT EMAKEHR(0x141d)\n#define CORSEC_E_INVALID_PUBLICKEY EMAKEHR(0x141e)\n#define CORSEC_E_SIGNATURE_MISMATCH EMAKEHR(0x1420)\n#define CORSEC_E_CRYPTO EMAKEHR(0x1430)\n#define CORSEC_E_CRYPTO_UNEX_OPER EMAKEHR(0x1431)\n#define COR_E_EXCEPTION EMAKEHR(0x1500)\n#define COR_E_SYSTEM EMAKEHR(0x1501)\n#define COR_E_ARGUMENTOUTOFRANGE EMAKEHR(0x1502)\n#define COR_E_ARRAYTYPEMISMATCH EMAKEHR(0x1503)\n#define COR_E_CONTEXTMARSHAL EMAKEHR(0x1504)\n#define COR_E_TIMEOUT EMAKEHR(0x1505)\n#define COR_E_EXECUTIONENGINE EMAKEHR(0x1506)\n#define COR_E_FIELDACCESS EMAKEHR(0x1507)\n#define COR_E_INDEXOUTOFRANGE EMAKEHR(0x1508)\n#define COR_E_INVALIDOPERATION EMAKEHR(0x1509)\n#define COR_E_SECURITY EMAKEHR(0x150a)\n#define COR_E_SERIALIZATION EMAKEHR(0x150c)\n#define COR_E_VERIFICATION EMAKEHR(0x150d)\n#define COR_E_METHODACCESS EMAKEHR(0x1510)\n#define COR_E_MISSINGFIELD EMAKEHR(0x1511)\n#define COR_E_MISSINGMEMBER EMAKEHR(0x1512)\n#define COR_E_MISSINGMETHOD EMAKEHR(0x1513)\n#define COR_E_MULTICASTNOTSUPPORTED EMAKEHR(0x1514)\n#define COR_E_NOTSUPPORTED EMAKEHR(0x1515)\n#define COR_E_OVERFLOW EMAKEHR(0x1516)\n#define COR_E_RANK EMAKEHR(0x1517)\n#define COR_E_SYNCHRONIZATIONLOCK EMAKEHR(0x1518)\n#define COR_E_THREADINTERRUPTED EMAKEHR(0x1519)\n#define COR_E_MEMBERACCESS EMAKEHR(0x151a)\n#define COR_E_THREADSTATE EMAKEHR(0x1520)\n#define COR_E_THREADSTOP EMAKEHR(0x1521)\n#define COR_E_TYPELOAD EMAKEHR(0x1522)\n#define COR_E_ENTRYPOINTNOTFOUND EMAKEHR(0x1523)\n#define COR_E_DLLNOTFOUND EMAKEHR(0x1524)\n#define COR_E_THREADSTART EMAKEHR(0x1525)\n#define COR_E_INVALIDCOMOBJECT EMAKEHR(0x1527)\n#define COR_E_NOTFINITENUMBER EMAKEHR(0x1528)\n#define COR_E_DUPLICATEWAITOBJECT EMAKEHR(0x1529)\n#define COR_E_SEMAPHOREFULL EMAKEHR(0x152b)\n#define COR_E_WAITHANDLECANNOTBEOPENED EMAKEHR(0x152c)\n#define COR_E_ABANDONEDMUTEX EMAKEHR(0x152d)\n#define COR_E_THREADABORTED EMAKEHR(0x1530)\n#define COR_E_INVALIDOLEVARIANTTYPE EMAKEHR(0x1531)\n#define COR_E_MISSINGMANIFESTRESOURCE EMAKEHR(0x1532)\n#define COR_E_SAFEARRAYTYPEMISMATCH EMAKEHR(0x1533)\n#define COR_E_TYPEINITIALIZATION EMAKEHR(0x1534)\n#define COR_E_MARSHALDIRECTIVE EMAKEHR(0x1535)\n#define COR_E_MISSINGSATELLITEASSEMBLY EMAKEHR(0x1536)\n#define COR_E_FORMAT EMAKEHR(0x1537)\n#define COR_E_SAFEARRAYRANKMISMATCH EMAKEHR(0x1538)\n#define COR_E_PLATFORMNOTSUPPORTED EMAKEHR(0x1539)\n#define COR_E_INVALIDPROGRAM EMAKEHR(0x153a)\n#define COR_E_OPERATIONCANCELED EMAKEHR(0x153b)\n#define COR_E_INSUFFICIENTMEMORY EMAKEHR(0x153d)\n#define COR_E_RUNTIMEWRAPPED EMAKEHR(0x153e)\n#define COR_E_DATAMISALIGNED EMAKEHR(0x1541)\n#define COR_E_CODECONTRACTFAILED EMAKEHR(0x1542)\n#define COR_E_TYPEACCESS EMAKEHR(0x1543)\n#define COR_E_ACCESSING_CCW EMAKEHR(0x1544)\n#define COR_E_KEYNOTFOUND EMAKEHR(0x1577)\n#define COR_E_INSUFFICIENTEXECUTIONSTACK EMAKEHR(0x1578)\n#define COR_E_APPLICATION EMAKEHR(0x1600)\n#define COR_E_INVALIDFILTERCRITERIA EMAKEHR(0x1601)\n#define COR_E_REFLECTIONTYPELOAD EMAKEHR(0x1602)\n#define COR_E_TARGET EMAKEHR(0x1603)\n#define COR_E_TARGETINVOCATION EMAKEHR(0x1604)\n#define COR_E_CUSTOMATTRIBUTEFORMAT EMAKEHR(0x1605)\n#define COR_E_IO EMAKEHR(0x1620)\n#define COR_E_FILELOAD EMAKEHR(0x1621)\n#define COR_E_OBJECTDISPOSED EMAKEHR(0x1622)\n#define COR_E_FAILFAST EMAKEHR(0x1623)\n#define COR_E_HOSTPROTECTION EMAKEHR(0x1640)\n#define COR_E_ILLEGAL_REENTRANCY EMAKEHR(0x1641)\n#define CLR_E_SHIM_RUNTIMELOAD EMAKEHR(0x1700)\n#define CLR_E_SHIM_LEGACYRUNTIMEALREADYBOUND EMAKEHR(0x1704)\n#define VER_E_FIELD_SIG EMAKEHR(0x1815)\n#define VER_E_CIRCULAR_VAR_CONSTRAINTS EMAKEHR(0x18ce)\n#define VER_E_CIRCULAR_MVAR_CONSTRAINTS EMAKEHR(0x18cf)\n#define COR_E_Data EMAKEHR(0x1920)\n#define VLDTR_E_SIG_BADVOID EMAKEHR(0x1b24)\n#define VLDTR_E_GP_ILLEGAL_VARIANT_MVAR EMAKEHR(0x1b2d)\n#define CORDBG_E_THREAD_NOT_SCHEDULED EMAKEHR(0x1c00)\n#define CORDBG_E_HANDLE_HAS_BEEN_DISPOSED EMAKEHR(0x1c01)\n#define CORDBG_E_NONINTERCEPTABLE_EXCEPTION EMAKEHR(0x1c02)\n#define CORDBG_E_INTERCEPT_FRAME_ALREADY_SET EMAKEHR(0x1c04)\n#define CORDBG_E_NO_NATIVE_PATCH_AT_ADDR EMAKEHR(0x1c05)\n#define CORDBG_E_MUST_BE_INTEROP_DEBUGGING EMAKEHR(0x1c06)\n#define CORDBG_E_NATIVE_PATCH_ALREADY_AT_ADDR EMAKEHR(0x1c07)\n#define CORDBG_E_TIMEOUT EMAKEHR(0x1c08)\n#define CORDBG_E_CANT_CALL_ON_THIS_THREAD EMAKEHR(0x1c09)\n#define CORDBG_E_ENC_INFOLESS_METHOD EMAKEHR(0x1c0a)\n#define CORDBG_E_ENC_IN_FUNCLET EMAKEHR(0x1c0c)\n#define CORDBG_E_ENC_EDIT_NOT_SUPPORTED EMAKEHR(0x1c0e)\n#define CORDBG_E_NOTREADY EMAKEHR(0x1c10)\n#define CORDBG_E_CANNOT_RESOLVE_ASSEMBLY EMAKEHR(0x1c11)\n#define CORDBG_E_MUST_BE_IN_LOAD_MODULE EMAKEHR(0x1c12)\n#define CORDBG_E_CANNOT_BE_ON_ATTACH EMAKEHR(0x1c13)\n#define CORDBG_E_NGEN_NOT_SUPPORTED EMAKEHR(0x1c14)\n#define CORDBG_E_ILLEGAL_SHUTDOWN_ORDER EMAKEHR(0x1c15)\n#define CORDBG_E_CANNOT_DEBUG_FIBER_PROCESS EMAKEHR(0x1c16)\n#define CORDBG_E_MUST_BE_IN_CREATE_PROCESS EMAKEHR(0x1c17)\n#define CORDBG_E_DETACH_FAILED_OUTSTANDING_EVALS EMAKEHR(0x1c18)\n#define CORDBG_E_DETACH_FAILED_OUTSTANDING_STEPPERS EMAKEHR(0x1c19)\n#define CORDBG_E_CANT_INTEROP_STEP_OUT EMAKEHR(0x1c20)\n#define CORDBG_E_DETACH_FAILED_OUTSTANDING_BREAKPOINTS EMAKEHR(0x1c21)\n#define CORDBG_E_ILLEGAL_IN_STACK_OVERFLOW EMAKEHR(0x1c22)\n#define CORDBG_E_ILLEGAL_AT_GC_UNSAFE_POINT EMAKEHR(0x1c23)\n#define CORDBG_E_ILLEGAL_IN_PROLOG EMAKEHR(0x1c24)\n#define CORDBG_E_ILLEGAL_IN_NATIVE_CODE EMAKEHR(0x1c25)\n#define CORDBG_E_ILLEGAL_IN_OPTIMIZED_CODE EMAKEHR(0x1c26)\n#define CORDBG_E_APPDOMAIN_MISMATCH EMAKEHR(0x1c28)\n#define CORDBG_E_CONTEXT_UNVAILABLE EMAKEHR(0x1c29)\n#define CORDBG_E_INCOMPATIBLE_PLATFORMS EMAKEHR(0x1c30)\n#define CORDBG_E_DEBUGGING_DISABLED EMAKEHR(0x1c31)\n#define CORDBG_E_DETACH_FAILED_ON_ENC EMAKEHR(0x1c32)\n#define CORDBG_E_CURRENT_EXCEPTION_IS_OUTSIDE_CURRENT_EXECUTION_SCOPE EMAKEHR(0x1c33)\n#define CORDBG_E_HELPER_MAY_DEADLOCK EMAKEHR(0x1c34)\n#define CORDBG_E_MISSING_METADATA EMAKEHR(0x1c35)\n#define CORDBG_E_TARGET_INCONSISTENT EMAKEHR(0x1c36)\n#define CORDBG_E_DETACH_FAILED_OUTSTANDING_TARGET_RESOURCES EMAKEHR(0x1c37)\n#define CORDBG_E_TARGET_READONLY EMAKEHR(0x1c38)\n#define CORDBG_E_MISMATCHED_CORWKS_AND_DACWKS_DLLS EMAKEHR(0x1c39)\n#define CORDBG_E_MODULE_LOADED_FROM_DISK EMAKEHR(0x1c3a)\n#define CORDBG_E_SYMBOLS_NOT_AVAILABLE EMAKEHR(0x1c3b)\n#define CORDBG_E_DEBUG_COMPONENT_MISSING EMAKEHR(0x1c3c)\n#define CORDBG_E_LIBRARY_PROVIDER_ERROR EMAKEHR(0x1c43)\n#define CORDBG_E_NOT_CLR EMAKEHR(0x1c44)\n#define CORDBG_E_MISSING_DATA_TARGET_INTERFACE EMAKEHR(0x1c45)\n#define CORDBG_E_UNSUPPORTED_DEBUGGING_MODEL EMAKEHR(0x1c46)\n#define CORDBG_E_UNSUPPORTED_FORWARD_COMPAT EMAKEHR(0x1c47)\n#define CORDBG_E_UNSUPPORTED_VERSION_STRUCT EMAKEHR(0x1c48)\n#define CORDBG_E_READVIRTUAL_FAILURE EMAKEHR(0x1c49)\n#define CORDBG_E_VALUE_POINTS_TO_FUNCTION EMAKEHR(0x1c4a)\n#define CORDBG_E_CORRUPT_OBJECT EMAKEHR(0x1c4b)\n#define CORDBG_E_GC_STRUCTURES_INVALID EMAKEHR(0x1c4c)\n#define CORDBG_E_INVALID_OPCODE EMAKEHR(0x1c4d)\n#define CORDBG_E_UNSUPPORTED EMAKEHR(0x1c4e)\n#define CORDBG_E_MISSING_DEBUGGER_EXPORTS EMAKEHR(0x1c4f)\n#define CORDBG_E_DATA_TARGET_ERROR EMAKEHR(0x1c61)\n#define CORDBG_E_UNSUPPORTED_DELEGATE EMAKEHR(0x1c68)\n#define CORDBG_E_ASSEMBLY_UPDATES_APPLIED EMAKEHR(0x1c69)\n#define PEFMT_E_64BIT EMAKEHR(0x1d02)\n#define PEFMT_E_32BIT EMAKEHR(0x1d0b)\n#define CLDB_E_INTERNALERROR EMAKEHR(0x1fff)\n#define CLR_E_BIND_ASSEMBLY_VERSION_TOO_LOW EMAKEHR(0x2000)\n#define CLR_E_BIND_ASSEMBLY_PUBLIC_KEY_MISMATCH EMAKEHR(0x2001)\n#define CLR_E_BIND_IMAGE_UNAVAILABLE EMAKEHR(0x2002)\n#define CLR_E_BIND_UNRECOGNIZED_IDENTITY_FORMAT EMAKEHR(0x2003)\n#define CLR_E_BIND_ASSEMBLY_NOT_FOUND EMAKEHR(0x2004)\n#define CLR_E_BIND_TYPE_NOT_FOUND EMAKEHR(0x2005)\n#define CLR_E_GC_OOM EMAKEHR(0x2009)\n#define CLR_E_GC_BAD_AFFINITY_CONFIG EMAKEHR(0x200a)\n#define CLR_E_GC_BAD_AFFINITY_CONFIG_FORMAT EMAKEHR(0x200b)\n#define CLR_E_GC_BAD_HARD_LIMIT EMAKEHR(0x200d)\n#define CLR_E_GC_LARGE_PAGE_MISSING_HARD_LIMIT EMAKEHR(0x200e)\n#define COR_E_UNAUTHORIZEDACCESS E_ACCESSDENIED\n#define COR_E_ARGUMENT E_INVALIDARG\n#define COR_E_INVALIDCAST E_NOINTERFACE\n#define COR_E_OUTOFMEMORY E_OUTOFMEMORY\n#define COR_E_NULLREFERENCE E_POINTER\n#define COR_E_ARITHMETIC __HRESULT_FROM_WIN32(ERROR_ARITHMETIC_OVERFLOW)\n#define COR_E_PATHTOOLONG __HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE)\n#define COR_E_FILENOTFOUND __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)\n#define COR_E_ENDOFSTREAM __HRESULT_FROM_WIN32(ERROR_HANDLE_EOF)\n#define COR_E_DIRECTORYNOTFOUND __HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)\n#define COR_E_STACKOVERFLOW __HRESULT_FROM_WIN32(ERROR_STACK_OVERFLOW)\n#define COR_E_AMBIGUOUSMATCH _HRESULT_TYPEDEF_(0x8000211DL)\n#define COR_E_TARGETPARAMCOUNT _HRESULT_TYPEDEF_(0x8002000EL)\n#define COR_E_DIVIDEBYZERO _HRESULT_TYPEDEF_(0x80020012L)\n#define COR_E_BADIMAGEFORMAT _HRESULT_TYPEDEF_(0x8007000BL)\n\n\n#endif // __COMMON_LANGUAGE_RUNTIME_HRESULTS__\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/corprof.h",
    "content": "\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.01.0622 */\n/* Compiler settings for corprof.idl:\n    Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0622\n    protocol : dce , ms_ext, c_ext, robust\n    error checks: allocation ref bounds_check enum stub_data\n    VC __declspec() decoration level:\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\n         DECLSPEC_UUID(), MIDL_INTERFACE()\n*/\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif /* __RPCNDR_H_VERSION__ */\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __corprof_h__\n#define __corprof_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */\n\n#ifndef __ICorProfilerCallback_FWD_DEFINED__\n#define __ICorProfilerCallback_FWD_DEFINED__\ntypedef interface ICorProfilerCallback ICorProfilerCallback;\n\n#endif  /* __ICorProfilerCallback_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback2_FWD_DEFINED__\n#define __ICorProfilerCallback2_FWD_DEFINED__\ntypedef interface ICorProfilerCallback2 ICorProfilerCallback2;\n\n#endif  /* __ICorProfilerCallback2_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback3_FWD_DEFINED__\n#define __ICorProfilerCallback3_FWD_DEFINED__\ntypedef interface ICorProfilerCallback3 ICorProfilerCallback3;\n\n#endif  /* __ICorProfilerCallback3_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback4_FWD_DEFINED__\n#define __ICorProfilerCallback4_FWD_DEFINED__\ntypedef interface ICorProfilerCallback4 ICorProfilerCallback4;\n\n#endif  /* __ICorProfilerCallback4_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback5_FWD_DEFINED__\n#define __ICorProfilerCallback5_FWD_DEFINED__\ntypedef interface ICorProfilerCallback5 ICorProfilerCallback5;\n\n#endif  /* __ICorProfilerCallback5_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback6_FWD_DEFINED__\n#define __ICorProfilerCallback6_FWD_DEFINED__\ntypedef interface ICorProfilerCallback6 ICorProfilerCallback6;\n\n#endif  /* __ICorProfilerCallback6_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback7_FWD_DEFINED__\n#define __ICorProfilerCallback7_FWD_DEFINED__\ntypedef interface ICorProfilerCallback7 ICorProfilerCallback7;\n\n#endif  /* __ICorProfilerCallback7_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback8_FWD_DEFINED__\n#define __ICorProfilerCallback8_FWD_DEFINED__\ntypedef interface ICorProfilerCallback8 ICorProfilerCallback8;\n\n#endif  /* __ICorProfilerCallback8_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback9_FWD_DEFINED__\n#define __ICorProfilerCallback9_FWD_DEFINED__\ntypedef interface ICorProfilerCallback9 ICorProfilerCallback9;\n\n#endif  /* __ICorProfilerCallback9_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback10_FWD_DEFINED__\n#define __ICorProfilerCallback10_FWD_DEFINED__\ntypedef interface ICorProfilerCallback10 ICorProfilerCallback10;\n\n#endif  /* __ICorProfilerCallback10_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback11_FWD_DEFINED__\n#define __ICorProfilerCallback11_FWD_DEFINED__\ntypedef interface ICorProfilerCallback11 ICorProfilerCallback11;\n\n#endif  /* __ICorProfilerCallback11_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo_FWD_DEFINED__\n#define __ICorProfilerInfo_FWD_DEFINED__\ntypedef interface ICorProfilerInfo ICorProfilerInfo;\n\n#endif  /* __ICorProfilerInfo_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo2_FWD_DEFINED__\n#define __ICorProfilerInfo2_FWD_DEFINED__\ntypedef interface ICorProfilerInfo2 ICorProfilerInfo2;\n\n#endif  /* __ICorProfilerInfo2_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo3_FWD_DEFINED__\n#define __ICorProfilerInfo3_FWD_DEFINED__\ntypedef interface ICorProfilerInfo3 ICorProfilerInfo3;\n\n#endif  /* __ICorProfilerInfo3_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerObjectEnum_FWD_DEFINED__\n#define __ICorProfilerObjectEnum_FWD_DEFINED__\ntypedef interface ICorProfilerObjectEnum ICorProfilerObjectEnum;\n\n#endif  /* __ICorProfilerObjectEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerFunctionEnum_FWD_DEFINED__\n#define __ICorProfilerFunctionEnum_FWD_DEFINED__\ntypedef interface ICorProfilerFunctionEnum ICorProfilerFunctionEnum;\n\n#endif  /* __ICorProfilerFunctionEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerModuleEnum_FWD_DEFINED__\n#define __ICorProfilerModuleEnum_FWD_DEFINED__\ntypedef interface ICorProfilerModuleEnum ICorProfilerModuleEnum;\n\n#endif  /* __ICorProfilerModuleEnum_FWD_DEFINED__ */\n\n\n#ifndef __IMethodMalloc_FWD_DEFINED__\n#define __IMethodMalloc_FWD_DEFINED__\ntypedef interface IMethodMalloc IMethodMalloc;\n\n#endif  /* __IMethodMalloc_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerFunctionControl_FWD_DEFINED__\n#define __ICorProfilerFunctionControl_FWD_DEFINED__\ntypedef interface ICorProfilerFunctionControl ICorProfilerFunctionControl;\n\n#endif  /* __ICorProfilerFunctionControl_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo4_FWD_DEFINED__\n#define __ICorProfilerInfo4_FWD_DEFINED__\ntypedef interface ICorProfilerInfo4 ICorProfilerInfo4;\n\n#endif  /* __ICorProfilerInfo4_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo5_FWD_DEFINED__\n#define __ICorProfilerInfo5_FWD_DEFINED__\ntypedef interface ICorProfilerInfo5 ICorProfilerInfo5;\n\n#endif  /* __ICorProfilerInfo5_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo6_FWD_DEFINED__\n#define __ICorProfilerInfo6_FWD_DEFINED__\ntypedef interface ICorProfilerInfo6 ICorProfilerInfo6;\n\n#endif  /* __ICorProfilerInfo6_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo7_FWD_DEFINED__\n#define __ICorProfilerInfo7_FWD_DEFINED__\ntypedef interface ICorProfilerInfo7 ICorProfilerInfo7;\n\n#endif  /* __ICorProfilerInfo7_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo8_FWD_DEFINED__\n#define __ICorProfilerInfo8_FWD_DEFINED__\ntypedef interface ICorProfilerInfo8 ICorProfilerInfo8;\n\n#endif  /* __ICorProfilerInfo8_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo9_FWD_DEFINED__\n#define __ICorProfilerInfo9_FWD_DEFINED__\ntypedef interface ICorProfilerInfo9 ICorProfilerInfo9;\n\n#endif  /* __ICorProfilerInfo9_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo10_FWD_DEFINED__\n#define __ICorProfilerInfo10_FWD_DEFINED__\ntypedef interface ICorProfilerInfo10 ICorProfilerInfo10;\n\n#endif  /* __ICorProfilerInfo10_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo11_FWD_DEFINED__\n#define __ICorProfilerInfo11_FWD_DEFINED__\ntypedef interface ICorProfilerInfo11 ICorProfilerInfo11;\n\n#endif  /* __ICorProfilerInfo11_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo12_FWD_DEFINED__\n#define __ICorProfilerInfo12_FWD_DEFINED__\ntypedef interface ICorProfilerInfo12 ICorProfilerInfo12;\n\n#endif  /* __ICorProfilerInfo12_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo13_FWD_DEFINED__\n#define __ICorProfilerInfo13_FWD_DEFINED__\ntypedef interface ICorProfilerInfo13 ICorProfilerInfo13;\n\n#endif  /* __ICorProfilerInfo13_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerMethodEnum_FWD_DEFINED__\n#define __ICorProfilerMethodEnum_FWD_DEFINED__\ntypedef interface ICorProfilerMethodEnum ICorProfilerMethodEnum;\n\n#endif  /* __ICorProfilerMethodEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerThreadEnum_FWD_DEFINED__\n#define __ICorProfilerThreadEnum_FWD_DEFINED__\ntypedef interface ICorProfilerThreadEnum ICorProfilerThreadEnum;\n\n#endif  /* __ICorProfilerThreadEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__\n#define __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__\ntypedef interface ICorProfilerAssemblyReferenceProvider ICorProfilerAssemblyReferenceProvider;\n\n#endif  /* __ICorProfilerAssemblyReferenceProvider_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\n\n/* interface __MIDL_itf_corprof_0000_0000 */\n/* [local] */\n\n#if 0\ntypedef LONG32 mdToken;\n\ntypedef mdToken mdModule;\n\ntypedef mdToken mdTypeDef;\n\ntypedef mdToken mdMethodDef;\n\ntypedef mdToken mdFieldDef;\n\ntypedef ULONG CorElementType;\n\n\ntypedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0001\n    {\n    DWORD dwOSPlatformId;\n    DWORD dwOSMajorVersion;\n    DWORD dwOSMinorVersion;\n    }   OSINFO;\n\ntypedef /* [public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0002\n    {\n    USHORT usMajorVersion;\n    USHORT usMinorVersion;\n    USHORT usBuildNumber;\n    USHORT usRevisionNumber;\n    LPWSTR szLocale;\n    ULONG cbLocale;\n    DWORD *rProcessor;\n    ULONG ulProcessor;\n    OSINFO *rOS;\n    ULONG ulOS;\n    }   ASSEMBLYMETADATA;\n\n#endif\ntypedef const BYTE *LPCBYTE;\n\ntypedef BYTE *LPBYTE;\n\ntypedef BYTE COR_SIGNATURE;\n\ntypedef COR_SIGNATURE *PCOR_SIGNATURE;\n\ntypedef const COR_SIGNATURE *PCCOR_SIGNATURE;\n\n#ifndef _COR_IL_MAP\n#define _COR_IL_MAP\ntypedef struct _COR_IL_MAP\n    {\n    ULONG32 oldOffset;\n    ULONG32 newOffset;\n    BOOL fAccurate;\n    }   COR_IL_MAP;\n\n#endif //_COR_IL_MAP\n#ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_\n#define _COR_DEBUG_IL_TO_NATIVE_MAP_\ntypedef\nenum CorDebugIlToNativeMappingTypes\n    {\n        NO_MAPPING  = -1,\n        PROLOG  = -2,\n        EPILOG  = -3\n    }   CorDebugIlToNativeMappingTypes;\n\ntypedef struct COR_DEBUG_IL_TO_NATIVE_MAP\n    {\n    ULONG32 ilOffset;\n    ULONG32 nativeStartOffset;\n    ULONG32 nativeEndOffset;\n    }   COR_DEBUG_IL_TO_NATIVE_MAP;\n\n#endif // _COR_DEBUG_IL_TO_NATIVE_MAP_\n#ifndef _COR_FIELD_OFFSET_\n#define _COR_FIELD_OFFSET_\ntypedef struct _COR_FIELD_OFFSET\n    {\n    mdFieldDef ridOfField;\n    ULONG ulOffset;\n    }   COR_FIELD_OFFSET;\n\n#endif // _COR_FIELD_OFFSET_\ntypedef UINT_PTR ProcessID;\n\ntypedef UINT_PTR AssemblyID;\n\ntypedef UINT_PTR AppDomainID;\n\ntypedef UINT_PTR ModuleID;\n\ntypedef UINT_PTR ClassID;\n\ntypedef UINT_PTR ThreadID;\n\ntypedef UINT_PTR ContextID;\n\ntypedef UINT_PTR FunctionID;\n\ntypedef UINT_PTR ObjectID;\n\ntypedef UINT_PTR GCHandleID;\n\ntypedef UINT_PTR COR_PRF_ELT_INFO;\n\ntypedef UINT_PTR ReJITID;\n\ntypedef /* [public][public][public][public][public][public][public][public][public][public][public][public][public] */ union __MIDL___MIDL_itf_corprof_0000_0000_0003\n    {\n    FunctionID functionID;\n    UINT_PTR clientID;\n    }   FunctionIDOrClientID;\n\ntypedef UINT_PTR __stdcall __stdcall FunctionIDMapper(\n    FunctionID funcId,\n    BOOL *pbHookFunction);\n\ntypedef UINT_PTR __stdcall __stdcall FunctionIDMapper2(\n    FunctionID funcId,\n    void *clientData,\n    BOOL *pbHookFunction);\n\ntypedef\nenum _COR_PRF_SNAPSHOT_INFO\n    {\n        COR_PRF_SNAPSHOT_DEFAULT    = 0,\n        COR_PRF_SNAPSHOT_REGISTER_CONTEXT   = 0x1,\n        COR_PRF_SNAPSHOT_X86_OPTIMIZED  = 0x2\n    }   COR_PRF_SNAPSHOT_INFO;\n\ntypedef UINT_PTR COR_PRF_FRAME_INFO;\n\ntypedef struct _COR_PRF_FUNCTION_ARGUMENT_RANGE\n    {\n    UINT_PTR startAddress;\n    ULONG length;\n    }   COR_PRF_FUNCTION_ARGUMENT_RANGE;\n\ntypedef struct _COR_PRF_FUNCTION_ARGUMENT_INFO\n    {\n    ULONG numRanges;\n    ULONG totalArgumentSize;\n    COR_PRF_FUNCTION_ARGUMENT_RANGE ranges[ 1 ];\n    }   COR_PRF_FUNCTION_ARGUMENT_INFO;\n\ntypedef struct _COR_PRF_CODE_INFO\n    {\n    UINT_PTR startAddress;\n    SIZE_T size;\n    }   COR_PRF_CODE_INFO;\n\ntypedef /* [public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0004\n    {\n        COR_PRF_FIELD_NOT_A_STATIC  = 0,\n        COR_PRF_FIELD_APP_DOMAIN_STATIC = 0x1,\n        COR_PRF_FIELD_THREAD_STATIC = 0x2,\n        COR_PRF_FIELD_CONTEXT_STATIC    = 0x4,\n        COR_PRF_FIELD_RVA_STATIC    = 0x8\n    }   COR_PRF_STATIC_TYPE;\n\ntypedef struct _COR_PRF_FUNCTION\n    {\n    FunctionID functionId;\n    ReJITID reJitId;\n    }   COR_PRF_FUNCTION;\n\ntypedef struct _COR_PRF_ASSEMBLY_REFERENCE_INFO\n    {\n    void *pbPublicKeyOrToken;\n    ULONG cbPublicKeyOrToken;\n    LPCWSTR szName;\n    ASSEMBLYMETADATA *pMetaData;\n    void *pbHashValue;\n    ULONG cbHashValue;\n    DWORD dwAssemblyRefFlags;\n    }   COR_PRF_ASSEMBLY_REFERENCE_INFO;\n\ntypedef struct _COR_PRF_METHOD\n    {\n    ModuleID moduleId;\n    mdMethodDef methodId;\n    }   COR_PRF_METHOD;\n\ntypedef void FunctionEnter(\n    FunctionID funcID);\n\ntypedef void FunctionLeave(\n    FunctionID funcID);\n\ntypedef void FunctionTailcall(\n    FunctionID funcID);\n\ntypedef void FunctionEnter2(\n    FunctionID funcId,\n    UINT_PTR clientData,\n    COR_PRF_FRAME_INFO func,\n    COR_PRF_FUNCTION_ARGUMENT_INFO *argumentInfo);\n\ntypedef void FunctionLeave2(\n    FunctionID funcId,\n    UINT_PTR clientData,\n    COR_PRF_FRAME_INFO func,\n    COR_PRF_FUNCTION_ARGUMENT_RANGE *retvalRange);\n\ntypedef void FunctionTailcall2(\n    FunctionID funcId,\n    UINT_PTR clientData,\n    COR_PRF_FRAME_INFO func);\n\ntypedef void FunctionEnter3(\n    FunctionIDOrClientID functionIDOrClientID);\n\ntypedef void FunctionLeave3(\n    FunctionIDOrClientID functionIDOrClientID);\n\ntypedef void FunctionTailcall3(\n    FunctionIDOrClientID functionIDOrClientID);\n\ntypedef void FunctionEnter3WithInfo(\n    FunctionIDOrClientID functionIDOrClientID,\n    COR_PRF_ELT_INFO eltInfo);\n\ntypedef void FunctionLeave3WithInfo(\n    FunctionIDOrClientID functionIDOrClientID,\n    COR_PRF_ELT_INFO eltInfo);\n\ntypedef void FunctionTailcall3WithInfo(\n    FunctionIDOrClientID functionIDOrClientID,\n    COR_PRF_ELT_INFO eltInfo);\n\ntypedef HRESULT __stdcall __stdcall StackSnapshotCallback(\n    FunctionID funcId,\n    UINT_PTR ip,\n    COR_PRF_FRAME_INFO frameInfo,\n    ULONG32 contextSize,\n    BYTE context[  ],\n    void *clientData);\n\ntypedef BOOL ObjectReferenceCallback(\n    ObjectID root,\n    ObjectID *reference,\n    void *clientData);\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0005\n    {\n        COR_PRF_MONITOR_NONE    = 0,\n        COR_PRF_MONITOR_FUNCTION_UNLOADS    = 0x1,\n        COR_PRF_MONITOR_CLASS_LOADS = 0x2,\n        COR_PRF_MONITOR_MODULE_LOADS    = 0x4,\n        COR_PRF_MONITOR_ASSEMBLY_LOADS  = 0x8,\n        COR_PRF_MONITOR_APPDOMAIN_LOADS = 0x10,\n        COR_PRF_MONITOR_JIT_COMPILATION = 0x20,\n        COR_PRF_MONITOR_EXCEPTIONS  = 0x40,\n        COR_PRF_MONITOR_GC  = 0x80,\n        COR_PRF_MONITOR_OBJECT_ALLOCATED    = 0x100,\n        COR_PRF_MONITOR_THREADS = 0x200,\n        COR_PRF_MONITOR_REMOTING    = 0x400,\n        COR_PRF_MONITOR_CODE_TRANSITIONS    = 0x800,\n        COR_PRF_MONITOR_ENTERLEAVE  = 0x1000,\n        COR_PRF_MONITOR_CCW = 0x2000,\n        COR_PRF_MONITOR_REMOTING_COOKIE = ( 0x4000 | COR_PRF_MONITOR_REMOTING ) ,\n        COR_PRF_MONITOR_REMOTING_ASYNC  = ( 0x8000 | COR_PRF_MONITOR_REMOTING ) ,\n        COR_PRF_MONITOR_SUSPENDS    = 0x10000,\n        COR_PRF_MONITOR_CACHE_SEARCHES  = 0x20000,\n        COR_PRF_ENABLE_REJIT    = 0x40000,\n        COR_PRF_ENABLE_INPROC_DEBUGGING = 0x80000,\n        COR_PRF_ENABLE_JIT_MAPS = 0x100000,\n        COR_PRF_DISABLE_INLINING    = 0x200000,\n        COR_PRF_DISABLE_OPTIMIZATIONS   = 0x400000,\n        COR_PRF_ENABLE_OBJECT_ALLOCATED = 0x800000,\n        COR_PRF_MONITOR_CLR_EXCEPTIONS  = 0x1000000,\n        COR_PRF_MONITOR_ALL = 0x107ffff,\n        COR_PRF_ENABLE_FUNCTION_ARGS    = 0x2000000,\n        COR_PRF_ENABLE_FUNCTION_RETVAL  = 0x4000000,\n        COR_PRF_ENABLE_FRAME_INFO   = 0x8000000,\n        COR_PRF_ENABLE_STACK_SNAPSHOT   = 0x10000000,\n        COR_PRF_USE_PROFILE_IMAGES  = 0x20000000,\n        COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST    = 0x40000000,\n        COR_PRF_DISABLE_ALL_NGEN_IMAGES = 0x80000000,\n        COR_PRF_ALL = 0x8fffffff,\n        COR_PRF_REQUIRE_PROFILE_IMAGE   = ( ( COR_PRF_USE_PROFILE_IMAGES | COR_PRF_MONITOR_CODE_TRANSITIONS )  | COR_PRF_MONITOR_ENTERLEAVE ) ,\n        COR_PRF_ALLOWABLE_AFTER_ATTACH  = ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_THREADS | COR_PRF_MONITOR_MODULE_LOADS )  | COR_PRF_MONITOR_ASSEMBLY_LOADS )  | COR_PRF_MONITOR_APPDOMAIN_LOADS )  | COR_PRF_ENABLE_STACK_SNAPSHOT )  | COR_PRF_MONITOR_GC )  | COR_PRF_MONITOR_SUSPENDS )  | COR_PRF_MONITOR_CLASS_LOADS )  | COR_PRF_MONITOR_EXCEPTIONS )  | COR_PRF_MONITOR_JIT_COMPILATION )  | COR_PRF_ENABLE_REJIT ) ,\n        COR_PRF_ALLOWABLE_NOTIFICATION_PROFILER = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_FUNCTION_UNLOADS | COR_PRF_MONITOR_CLASS_LOADS )  | COR_PRF_MONITOR_MODULE_LOADS )  | COR_PRF_MONITOR_ASSEMBLY_LOADS )  | COR_PRF_MONITOR_APPDOMAIN_LOADS )  | COR_PRF_MONITOR_JIT_COMPILATION )  | COR_PRF_MONITOR_EXCEPTIONS )  | COR_PRF_MONITOR_OBJECT_ALLOCATED )  | COR_PRF_MONITOR_THREADS )  | COR_PRF_MONITOR_CODE_TRANSITIONS )  | COR_PRF_MONITOR_CCW )  | COR_PRF_MONITOR_SUSPENDS )  | COR_PRF_MONITOR_CACHE_SEARCHES )  | COR_PRF_DISABLE_INLINING )  | COR_PRF_DISABLE_OPTIMIZATIONS )  | COR_PRF_ENABLE_OBJECT_ALLOCATED )  | COR_PRF_MONITOR_CLR_EXCEPTIONS )  | COR_PRF_ENABLE_STACK_SNAPSHOT )  | COR_PRF_USE_PROFILE_IMAGES )  | COR_PRF_DISABLE_ALL_NGEN_IMAGES ) ,\n        COR_PRF_MONITOR_IMMUTABLE   = ( ( ( ( ( ( ( ( ( ( ( ( ( ( COR_PRF_MONITOR_CODE_TRANSITIONS | COR_PRF_MONITOR_REMOTING )  | COR_PRF_MONITOR_REMOTING_COOKIE )  | COR_PRF_MONITOR_REMOTING_ASYNC )  | COR_PRF_ENABLE_INPROC_DEBUGGING )  | COR_PRF_ENABLE_JIT_MAPS )  | COR_PRF_DISABLE_OPTIMIZATIONS )  | COR_PRF_DISABLE_INLINING )  | COR_PRF_ENABLE_OBJECT_ALLOCATED )  | COR_PRF_ENABLE_FUNCTION_ARGS )  | COR_PRF_ENABLE_FUNCTION_RETVAL )  | COR_PRF_ENABLE_FRAME_INFO )  | COR_PRF_USE_PROFILE_IMAGES )  | COR_PRF_DISABLE_TRANSPARENCY_CHECKS_UNDER_FULL_TRUST )  | COR_PRF_DISABLE_ALL_NGEN_IMAGES )\n    }   COR_PRF_MONITOR;\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0006\n    {\n        COR_PRF_HIGH_MONITOR_NONE   = 0,\n        COR_PRF_HIGH_ADD_ASSEMBLY_REFERENCES    = 0x1,\n        COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED  = 0x2,\n        COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS   = 0x4,\n        COR_PRF_HIGH_DISABLE_TIERED_COMPILATION = 0x8,\n        COR_PRF_HIGH_BASIC_GC   = 0x10,\n        COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS   = 0x20,\n        COR_PRF_HIGH_REQUIRE_PROFILE_IMAGE  = 0,\n        COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED  = 0x40,\n        COR_PRF_HIGH_MONITOR_EVENT_PIPE = 0x80,\n        COR_PRF_HIGH_MONITOR_PINNEDOBJECT_ALLOCATED = 0x100,\n        COR_PRF_HIGH_ALLOWABLE_AFTER_ATTACH = ( ( ( ( ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS )  | COR_PRF_HIGH_BASIC_GC )  | COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS )  | COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED )  | COR_PRF_HIGH_MONITOR_EVENT_PIPE ) ,\n        COR_PRF_HIGH_ALLOWABLE_NOTIFICATION_PROFILER    = ( ( ( ( ( ( COR_PRF_HIGH_IN_MEMORY_SYMBOLS_UPDATED | COR_PRF_HIGH_MONITOR_DYNAMIC_FUNCTION_UNLOADS )  | COR_PRF_HIGH_DISABLE_TIERED_COMPILATION )  | COR_PRF_HIGH_BASIC_GC )  | COR_PRF_HIGH_MONITOR_GC_MOVED_OBJECTS )  | COR_PRF_HIGH_MONITOR_LARGEOBJECT_ALLOCATED )  | COR_PRF_HIGH_MONITOR_EVENT_PIPE ) ,\n        COR_PRF_HIGH_MONITOR_IMMUTABLE  = COR_PRF_HIGH_DISABLE_TIERED_COMPILATION\n    }   COR_PRF_HIGH_MONITOR;\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0007\n    {\n        PROFILER_PARENT_UNKNOWN = 0xfffffffd,\n        PROFILER_GLOBAL_CLASS   = 0xfffffffe,\n        PROFILER_GLOBAL_MODULE  = 0xffffffff\n    }   COR_PRF_MISC;\n\ntypedef /* [public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0008\n    {\n        COR_PRF_CACHED_FUNCTION_FOUND   = 0,\n        COR_PRF_CACHED_FUNCTION_NOT_FOUND   = ( COR_PRF_CACHED_FUNCTION_FOUND + 1 )\n    }   COR_PRF_JIT_CACHE;\n\ntypedef /* [public][public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0009\n    {\n        COR_PRF_TRANSITION_CALL = 0,\n        COR_PRF_TRANSITION_RETURN   = ( COR_PRF_TRANSITION_CALL + 1 )\n    }   COR_PRF_TRANSITION_REASON;\n\ntypedef /* [public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0010\n    {\n        COR_PRF_SUSPEND_OTHER   = 0,\n        COR_PRF_SUSPEND_FOR_GC  = 1,\n        COR_PRF_SUSPEND_FOR_APPDOMAIN_SHUTDOWN  = 2,\n        COR_PRF_SUSPEND_FOR_CODE_PITCHING   = 3,\n        COR_PRF_SUSPEND_FOR_SHUTDOWN    = 4,\n        COR_PRF_SUSPEND_FOR_INPROC_DEBUGGER = 6,\n        COR_PRF_SUSPEND_FOR_GC_PREP = 7,\n        COR_PRF_SUSPEND_FOR_REJIT   = 8,\n        COR_PRF_SUSPEND_FOR_PROFILER    = 9\n    }   COR_PRF_SUSPEND_REASON;\n\ntypedef /* [public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0011\n    {\n        COR_PRF_DESKTOP_CLR = 0x1,\n        COR_PRF_CORE_CLR    = 0x2\n    }   COR_PRF_RUNTIME_TYPE;\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0012\n    {\n        COR_PRF_REJIT_BLOCK_INLINING    = 0x1,\n        COR_PRF_REJIT_INLINING_CALLBACKS    = 0x2\n    }   COR_PRF_REJIT_FLAGS;\n\ntypedef UINT_PTR EVENTPIPE_PROVIDER;\n\ntypedef UINT_PTR EVENTPIPE_EVENT;\n\ntypedef UINT64 EVENTPIPE_SESSION;\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0013\n    {\n        COR_PRF_EVENTPIPE_OBJECT    = 1,\n        COR_PRF_EVENTPIPE_BOOLEAN   = 3,\n        COR_PRF_EVENTPIPE_CHAR  = 4,\n        COR_PRF_EVENTPIPE_SBYTE = 5,\n        COR_PRF_EVENTPIPE_BYTE  = 6,\n        COR_PRF_EVENTPIPE_INT16 = 7,\n        COR_PRF_EVENTPIPE_UINT16    = 8,\n        COR_PRF_EVENTPIPE_INT32 = 9,\n        COR_PRF_EVENTPIPE_UINT32    = 10,\n        COR_PRF_EVENTPIPE_INT64 = 11,\n        COR_PRF_EVENTPIPE_UINT64    = 12,\n        COR_PRF_EVENTPIPE_SINGLE    = 13,\n        COR_PRF_EVENTPIPE_DOUBLE    = 14,\n        COR_PRF_EVENTPIPE_DECIMAL   = 15,\n        COR_PRF_EVENTPIPE_DATETIME  = 16,\n        COR_PRF_EVENTPIPE_GUID  = 17,\n        COR_PRF_EVENTPIPE_STRING    = 18,\n        COR_PRF_EVENTPIPE_ARRAY = 19\n    }   COR_PRF_EVENTPIPE_PARAM_TYPE;\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0000_0014\n    {\n        COR_PRF_EVENTPIPE_LOGALWAYS = 0,\n        COR_PRF_EVENTPIPE_CRITICAL  = 1,\n        COR_PRF_EVENTPIPE_ERROR = 2,\n        COR_PRF_EVENTPIPE_WARNING   = 3,\n        COR_PRF_EVENTPIPE_INFORMATIONAL = 4,\n        COR_PRF_EVENTPIPE_VERBOSE   = 5\n    }   COR_PRF_EVENTPIPE_LEVEL;\n\ntypedef /* [public][public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0015\n    {\n    const WCHAR *providerName;\n    UINT64 keywords;\n    UINT32 loggingLevel;\n    const WCHAR *filterData;\n    }   COR_PRF_EVENTPIPE_PROVIDER_CONFIG;\n\ntypedef /* [public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0016\n    {\n    UINT32 type;\n    UINT32 elementType;\n    const WCHAR *name;\n    }   COR_PRF_EVENTPIPE_PARAM_DESC;\n\ntypedef /* [public][public] */ struct __MIDL___MIDL_itf_corprof_0000_0000_0017\n    {\n    UINT64 ptr;\n    UINT32 size;\n    UINT32 reserved;\n    }   COR_PRF_EVENT_DATA;\n\ntypedef\nenum _COR_PRF_HANDLE_TYPE\n    {\n        COR_PRF_HANDLE_TYPE_WEAK   = 0x1,\n        COR_PRF_HANDLE_TYPE_STRONG = 0x2,\n        COR_PRF_HANDLE_TYPE_PINNED = 0x3\n    }   COR_PRF_HANDLE_TYPE;\n\ntypedef void **ObjectHandleID;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0000_v0_0_s_ifspec;\n\n#ifndef __ICorProfilerCallback_INTERFACE_DEFINED__\n#define __ICorProfilerCallback_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"176FBED1-A55C-4796-98CA-A9DA0EF883E7\")\n    ICorProfilerCallback : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Initialize(\n            /* [in] */ IUnknown *pICorProfilerInfoUnk) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Shutdown( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AppDomainCreationStarted(\n            /* [in] */ AppDomainID appDomainId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AppDomainCreationFinished(\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AppDomainShutdownStarted(\n            /* [in] */ AppDomainID appDomainId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AppDomainShutdownFinished(\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AssemblyLoadStarted(\n            /* [in] */ AssemblyID assemblyId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AssemblyLoadFinished(\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AssemblyUnloadStarted(\n            /* [in] */ AssemblyID assemblyId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE AssemblyUnloadFinished(\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ModuleLoadStarted(\n            /* [in] */ ModuleID moduleId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ModuleLoadFinished(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ModuleUnloadStarted(\n            /* [in] */ ModuleID moduleId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ModuleUnloadFinished(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ModuleAttachedToAssembly(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ClassLoadStarted(\n            /* [in] */ ClassID classId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ClassLoadFinished(\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ClassUnloadStarted(\n            /* [in] */ ClassID classId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ClassUnloadFinished(\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE FunctionUnloadStarted(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE JITCompilationStarted(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE JITCompilationFinished(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE JITCachedFunctionSearchStarted(\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE JITCachedFunctionSearchFinished(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE JITFunctionPitched(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE JITInlining(\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ThreadCreated(\n            /* [in] */ ThreadID threadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ThreadDestroyed(\n            /* [in] */ ThreadID threadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ThreadAssignedToOSThread(\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingClientInvocationStarted( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingClientSendingMessage(\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingClientReceivingReply(\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingClientInvocationFinished( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingServerReceivingMessage(\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingServerInvocationStarted( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingServerInvocationReturned( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RemotingServerSendingReply(\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE UnmanagedToManagedTransition(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ManagedToUnmanagedTransition(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RuntimeSuspendStarted(\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RuntimeSuspendFinished( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RuntimeSuspendAborted( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RuntimeResumeStarted( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RuntimeResumeFinished( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RuntimeThreadSuspended(\n            /* [in] */ ThreadID threadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RuntimeThreadResumed(\n            /* [in] */ ThreadID threadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE MovedReferences(\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ObjectAllocated(\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ObjectsAllocatedByClass(\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ObjectReferences(\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RootReferences(\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionThrown(\n            /* [in] */ ObjectID thrownObjectId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionSearchFunctionEnter(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionSearchFunctionLeave( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionSearchFilterEnter(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionSearchFilterLeave( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionSearchCatcherFound(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionOSHandlerEnter(\n            /* [in] */ UINT_PTR __unused) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionOSHandlerLeave(\n            /* [in] */ UINT_PTR __unused) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionUnwindFunctionEnter(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionUnwindFunctionLeave( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionUnwindFinallyEnter(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionUnwindFinallyLeave( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionCatcherEnter(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionCatcherLeave( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE COMClassicVTableCreated(\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE COMClassicVTableDestroyed(\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionCLRCatcherFound( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ExceptionCLRCatcherExecute( void) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallbackVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback * This);\n\n        END_INTERFACE\n    } ICorProfilerCallbackVtbl;\n\n    interface ICorProfilerCallback\n    {\n        CONST_VTBL struct ICorProfilerCallbackVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback_QueryInterface(This,riid,ppvObject)    \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback_AddRef(This)   \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback_Release(This)  \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback_Initialize(This,pICorProfilerInfoUnk)  \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback_Shutdown(This) \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback_AppDomainCreationStarted(This,appDomainId) \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback_AppDomainCreationFinished(This,appDomainId,hrStatus)   \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback_AppDomainShutdownStarted(This,appDomainId) \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback_AppDomainShutdownFinished(This,appDomainId,hrStatus)   \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback_AssemblyLoadStarted(This,assemblyId)   \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback_AssemblyLoadFinished(This,assemblyId,hrStatus) \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback_AssemblyUnloadStarted(This,assemblyId) \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback_AssemblyUnloadFinished(This,assemblyId,hrStatus)   \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback_ModuleLoadStarted(This,moduleId)   \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback_ModuleLoadFinished(This,moduleId,hrStatus) \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback_ModuleUnloadStarted(This,moduleId) \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback_ModuleUnloadFinished(This,moduleId,hrStatus)   \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback_ModuleAttachedToAssembly(This,moduleId,AssemblyId) \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback_ClassLoadStarted(This,classId) \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback_ClassLoadFinished(This,classId,hrStatus)   \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback_ClassUnloadStarted(This,classId)   \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback_ClassUnloadFinished(This,classId,hrStatus) \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback_FunctionUnloadStarted(This,functionId) \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback_JITCompilationStarted(This,functionId,fIsSafeToBlock)  \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)    \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)    \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback_JITCachedFunctionSearchFinished(This,functionId,result)    \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback_JITFunctionPitched(This,functionId)    \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback_JITInlining(This,callerId,calleeId,pfShouldInline) \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback_ThreadCreated(This,threadId)   \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback_ThreadDestroyed(This,threadId) \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback_ThreadAssignedToOSThread(This,managedThreadId,osThreadId)  \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback_RemotingClientInvocationStarted(This)  \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback_RemotingClientSendingMessage(This,pCookie,fIsAsync)    \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback_RemotingClientReceivingReply(This,pCookie,fIsAsync)    \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback_RemotingClientInvocationFinished(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback_RemotingServerReceivingMessage(This,pCookie,fIsAsync)  \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback_RemotingServerInvocationStarted(This)  \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback_RemotingServerInvocationReturned(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback_RemotingServerSendingReply(This,pCookie,fIsAsync)  \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback_UnmanagedToManagedTransition(This,functionId,reason)   \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback_ManagedToUnmanagedTransition(This,functionId,reason)   \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback_RuntimeSuspendStarted(This,suspendReason)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback_RuntimeSuspendFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback_RuntimeSuspendAborted(This)    \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback_RuntimeResumeStarted(This) \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback_RuntimeResumeFinished(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback_RuntimeThreadSuspended(This,threadId)  \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback_RuntimeThreadResumed(This,threadId)    \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback_ObjectAllocated(This,objectId,classId) \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)    \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)   \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback_RootReferences(This,cRootRefs,rootRefIds)  \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback_ExceptionThrown(This,thrownObjectId)   \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback_ExceptionSearchFunctionEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback_ExceptionSearchFunctionLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback_ExceptionSearchFilterEnter(This,functionId)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback_ExceptionSearchFilterLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback_ExceptionSearchCatcherFound(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback_ExceptionOSHandlerEnter(This,__unused) \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback_ExceptionOSHandlerLeave(This,__unused) \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback_ExceptionUnwindFunctionEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback_ExceptionUnwindFunctionLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback_ExceptionUnwindFinallyEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback_ExceptionUnwindFinallyLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback_ExceptionCatcherEnter(This,functionId,objectId)    \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback_ExceptionCatcherLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable)  \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback_ExceptionCLRCatcherFound(This) \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback_ExceptionCLRCatcherExecute(This)   \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_corprof_0000_0001 */\n/* [local] */\n\ntypedef /* [public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0001_0001\n    {\n        COR_PRF_GC_ROOT_STACK   = 1,\n        COR_PRF_GC_ROOT_FINALIZER   = 2,\n        COR_PRF_GC_ROOT_HANDLE  = 3,\n        COR_PRF_GC_ROOT_OTHER   = 0\n    }   COR_PRF_GC_ROOT_KIND;\n\ntypedef /* [public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0001_0002\n    {\n        COR_PRF_GC_ROOT_PINNING = 0x1,\n        COR_PRF_GC_ROOT_WEAKREF = 0x2,\n        COR_PRF_GC_ROOT_INTERIOR    = 0x4,\n        COR_PRF_GC_ROOT_REFCOUNTED  = 0x8\n    }   COR_PRF_GC_ROOT_FLAGS;\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0001_0003\n    {\n        COR_PRF_FINALIZER_CRITICAL  = 0x1\n    }   COR_PRF_FINALIZER_FLAGS;\n\ntypedef /* [public][public][public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0001_0004\n    {\n        COR_PRF_GC_GEN_0    = 0,\n        COR_PRF_GC_GEN_1    = 1,\n        COR_PRF_GC_GEN_2    = 2,\n        COR_PRF_GC_LARGE_OBJECT_HEAP    = 3,\n        COR_PRF_GC_PINNED_OBJECT_HEAP   = 4\n    }   COR_PRF_GC_GENERATION;\n\ntypedef struct COR_PRF_GC_GENERATION_RANGE\n    {\n    COR_PRF_GC_GENERATION generation;\n    ObjectID rangeStart;\n    UINT_PTR rangeLength;\n    UINT_PTR rangeLengthReserved;\n    }   COR_PRF_GC_GENERATION_RANGE;\n\ntypedef /* [public][public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0001_0005\n    {\n        COR_PRF_CLAUSE_NONE = 0,\n        COR_PRF_CLAUSE_FILTER   = 1,\n        COR_PRF_CLAUSE_CATCH    = 2,\n        COR_PRF_CLAUSE_FINALLY  = 3\n    }   COR_PRF_CLAUSE_TYPE;\n\ntypedef struct COR_PRF_EX_CLAUSE_INFO\n    {\n    COR_PRF_CLAUSE_TYPE clauseType;\n    UINT_PTR programCounter;\n    UINT_PTR framePointer;\n    UINT_PTR shadowStackPointer;\n    }   COR_PRF_EX_CLAUSE_INFO;\n\ntypedef /* [public][public] */\nenum __MIDL___MIDL_itf_corprof_0000_0001_0006\n    {\n        COR_PRF_GC_INDUCED  = 1,\n        COR_PRF_GC_OTHER    = 0\n    }   COR_PRF_GC_REASON;\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0001_0007\n    {\n        COR_PRF_MODULE_DISK = 0x1,\n        COR_PRF_MODULE_NGEN = 0x2,\n        COR_PRF_MODULE_DYNAMIC  = 0x4,\n        COR_PRF_MODULE_COLLECTIBLE  = 0x8,\n        COR_PRF_MODULE_RESOURCE = 0x10,\n        COR_PRF_MODULE_FLAT_LAYOUT  = 0x20,\n        COR_PRF_MODULE_WINDOWS_RUNTIME  = 0x40\n    }   COR_PRF_MODULE_FLAGS;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0001_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0001_v0_0_s_ifspec;\n\n#ifndef __ICorProfilerCallback2_INTERFACE_DEFINED__\n#define __ICorProfilerCallback2_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback2 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"8A8CC829-CCF2-49fe-BBAE-0F022228071A\")\n    ICorProfilerCallback2 : public ICorProfilerCallback\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ThreadNameChanged(\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GarbageCollectionStarted(\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SurvivingReferences(\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GarbageCollectionFinished( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE FinalizeableObjectQueued(\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RootReferences2(\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE HandleCreated(\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE HandleDestroyed(\n            /* [in] */ GCHandleID handleId) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback2 * This,\n            /* [in] */ GCHandleID handleId);\n\n        END_INTERFACE\n    } ICorProfilerCallback2Vtbl;\n\n    interface ICorProfilerCallback2\n    {\n        CONST_VTBL struct ICorProfilerCallback2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback2_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback2_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback2_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback2_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback2_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback2_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback2_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback2_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback2_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback2_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback2_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback2_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback2_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback2_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback2_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback2_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback2_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback2_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback2_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback2_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback2_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback2_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback2_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback2_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback2_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback2_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback2_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback2_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback2_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback2_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback2_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback2_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback2_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback2_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback2_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback2_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback2_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback2_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback2_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback2_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback2_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback2_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback2_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback2_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback2_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback2_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback2_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback2_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback2_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback2_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback2_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback2_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback2_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback2_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback2_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback2_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback2_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback2_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback2_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback2_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback2_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback2_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback2_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback2_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback2_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback2_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback2_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback2_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback2_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback2_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback2_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback2_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback2_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback2_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback2_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback2_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback2_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback2_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback2_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback2_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback3_INTERFACE_DEFINED__\n#define __ICorProfilerCallback3_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback3 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"4FD2ED52-7731-4b8d-9469-03D2CC3086C5\")\n    ICorProfilerCallback3 : public ICorProfilerCallback2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE InitializeForAttach(\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ProfilerAttachComplete( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ProfilerDetachSucceeded( void) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback3 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback3 * This);\n\n        END_INTERFACE\n    } ICorProfilerCallback3Vtbl;\n\n    interface ICorProfilerCallback3\n    {\n        CONST_VTBL struct ICorProfilerCallback3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback3_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback3_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback3_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback3_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback3_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback3_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback3_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback3_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback3_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback3_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback3_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback3_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback3_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback3_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback3_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback3_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback3_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback3_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback3_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback3_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback3_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback3_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback3_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback3_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback3_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback3_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback3_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback3_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback3_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback3_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback3_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback3_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback3_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback3_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback3_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback3_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback3_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback3_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback3_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback3_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback3_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback3_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback3_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback3_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback3_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback3_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback3_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback3_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback3_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback3_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback3_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback3_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback3_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback3_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback3_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback3_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback3_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback3_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback3_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback3_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback3_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback3_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback3_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback3_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback3_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback3_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback3_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback3_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback3_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback3_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback3_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback3_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback3_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback3_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback3_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback3_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback3_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback3_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback3_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback3_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback3_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)   \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback3_ProfilerAttachComplete(This)  \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback3_ProfilerDetachSucceeded(This) \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback4_INTERFACE_DEFINED__\n#define __ICorProfilerCallback4_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback4 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"7B63B2E3-107D-4d48-B2F6-F61E229470D2\")\n    ICorProfilerCallback4 : public ICorProfilerCallback3\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ReJITCompilationStarted(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetReJITParameters(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ReJITCompilationFinished(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ReJITError(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE MovedReferences2(\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SurvivingReferences2(\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback4 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        END_INTERFACE\n    } ICorProfilerCallback4Vtbl;\n\n    interface ICorProfilerCallback4\n    {\n        CONST_VTBL struct ICorProfilerCallback4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback4_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback4_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback4_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback4_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback4_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback4_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback4_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback4_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback4_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback4_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback4_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback4_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback4_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback4_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback4_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback4_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback4_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback4_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback4_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback4_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback4_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback4_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback4_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback4_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback4_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback4_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback4_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback4_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback4_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback4_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback4_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback4_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback4_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback4_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback4_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback4_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback4_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback4_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback4_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback4_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback4_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback4_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback4_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback4_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback4_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback4_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback4_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback4_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback4_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback4_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback4_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback4_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback4_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback4_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback4_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback4_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback4_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback4_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback4_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback4_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback4_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback4_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback4_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback4_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback4_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback4_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback4_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback4_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback4_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback4_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback4_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback4_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback4_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback4_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback4_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback4_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback4_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback4_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback4_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback4_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback4_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)   \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback4_ProfilerAttachComplete(This)  \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback4_ProfilerDetachSucceeded(This) \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback4_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback4_GetReJITParameters(This,moduleId,methodId,pFunctionControl)   \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback4_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback4_ReJITError(This,moduleId,methodId,functionId,hrStatus)    \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback4_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback4_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback5_INTERFACE_DEFINED__\n#define __ICorProfilerCallback5_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback5 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback5;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"8DFBA405-8C9F-45F8-BFFA-83B14CEF78B5\")\n    ICorProfilerCallback5 : public ICorProfilerCallback4\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ConditionalWeakTableElementReferences(\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback5Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback5 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(\n            ICorProfilerCallback5 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]);\n\n        END_INTERFACE\n    } ICorProfilerCallback5Vtbl;\n\n    interface ICorProfilerCallback5\n    {\n        CONST_VTBL struct ICorProfilerCallback5Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback5_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback5_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback5_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback5_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback5_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback5_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback5_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback5_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback5_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback5_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback5_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback5_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback5_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback5_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback5_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback5_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback5_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback5_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback5_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback5_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback5_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback5_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback5_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback5_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback5_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback5_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback5_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback5_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback5_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback5_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback5_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback5_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback5_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback5_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback5_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback5_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback5_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback5_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback5_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback5_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback5_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback5_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback5_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback5_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback5_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback5_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback5_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback5_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback5_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback5_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback5_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback5_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback5_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback5_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback5_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback5_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback5_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback5_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback5_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback5_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback5_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback5_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback5_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback5_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback5_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback5_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback5_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback5_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback5_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback5_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback5_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback5_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback5_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback5_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback5_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback5_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback5_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback5_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback5_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback5_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback5_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)   \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback5_ProfilerAttachComplete(This)  \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback5_ProfilerDetachSucceeded(This) \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback5_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback5_GetReJITParameters(This,moduleId,methodId,pFunctionControl)   \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback5_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback5_ReJITError(This,moduleId,methodId,functionId,hrStatus)    \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback5_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback5_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n\n#define ICorProfilerCallback5_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds)   \\\n    ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback5_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback6_INTERFACE_DEFINED__\n#define __ICorProfilerCallback6_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback6 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback6;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FC13DF4B-4448-4F4F-950C-BA8D19D00C36\")\n    ICorProfilerCallback6 : public ICorProfilerCallback5\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyReferences(\n            /* [string][in] */ const WCHAR *wszAssemblyPath,\n            /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback6Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback6 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(\n            ICorProfilerCallback6 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(\n            ICorProfilerCallback6 * This,\n            /* [string][in] */ const WCHAR *wszAssemblyPath,\n            /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);\n\n        END_INTERFACE\n    } ICorProfilerCallback6Vtbl;\n\n    interface ICorProfilerCallback6\n    {\n        CONST_VTBL struct ICorProfilerCallback6Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback6_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback6_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback6_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback6_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback6_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback6_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback6_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback6_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback6_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback6_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback6_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback6_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback6_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback6_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback6_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback6_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback6_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback6_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback6_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback6_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback6_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback6_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback6_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback6_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback6_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback6_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback6_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback6_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback6_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback6_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback6_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback6_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback6_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback6_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback6_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback6_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback6_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback6_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback6_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback6_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback6_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback6_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback6_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback6_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback6_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback6_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback6_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback6_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback6_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback6_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback6_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback6_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback6_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback6_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback6_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback6_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback6_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback6_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback6_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback6_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback6_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback6_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback6_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback6_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback6_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback6_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback6_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback6_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback6_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback6_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback6_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback6_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback6_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback6_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback6_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback6_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback6_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback6_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback6_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback6_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback6_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)   \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback6_ProfilerAttachComplete(This)  \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback6_ProfilerDetachSucceeded(This) \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback6_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback6_GetReJITParameters(This,moduleId,methodId,pFunctionControl)   \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback6_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback6_ReJITError(This,moduleId,methodId,functionId,hrStatus)    \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback6_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback6_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n\n#define ICorProfilerCallback6_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds)   \\\n    ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )\n\n\n#define ICorProfilerCallback6_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider)   \\\n    ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback6_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback7_INTERFACE_DEFINED__\n#define __ICorProfilerCallback7_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback7 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback7;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F76A2DBA-1D52-4539-866C-2AA518F9EFC3\")\n    ICorProfilerCallback7 : public ICorProfilerCallback6\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ModuleInMemorySymbolsUpdated(\n            ModuleID moduleId) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback7Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback7 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(\n            ICorProfilerCallback7 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(\n            ICorProfilerCallback7 * This,\n            /* [string][in] */ const WCHAR *wszAssemblyPath,\n            /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )(\n            ICorProfilerCallback7 * This,\n            ModuleID moduleId);\n\n        END_INTERFACE\n    } ICorProfilerCallback7Vtbl;\n\n    interface ICorProfilerCallback7\n    {\n        CONST_VTBL struct ICorProfilerCallback7Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback7_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback7_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback7_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback7_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback7_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback7_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback7_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback7_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback7_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback7_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback7_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback7_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback7_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback7_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback7_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback7_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback7_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback7_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback7_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback7_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback7_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback7_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback7_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback7_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback7_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback7_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback7_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback7_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback7_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback7_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback7_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback7_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback7_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback7_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback7_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback7_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback7_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback7_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback7_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback7_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback7_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback7_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback7_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback7_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback7_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback7_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback7_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback7_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback7_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback7_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback7_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback7_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback7_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback7_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback7_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback7_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback7_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback7_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback7_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback7_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback7_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback7_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback7_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback7_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback7_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback7_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback7_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback7_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback7_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback7_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback7_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback7_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback7_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback7_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback7_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback7_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback7_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback7_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback7_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback7_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback7_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)   \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback7_ProfilerAttachComplete(This)  \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback7_ProfilerDetachSucceeded(This) \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback7_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback7_GetReJITParameters(This,moduleId,methodId,pFunctionControl)   \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback7_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback7_ReJITError(This,moduleId,methodId,functionId,hrStatus)    \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback7_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback7_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n\n#define ICorProfilerCallback7_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds)   \\\n    ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )\n\n\n#define ICorProfilerCallback7_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider)   \\\n    ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )\n\n\n#define ICorProfilerCallback7_ModuleInMemorySymbolsUpdated(This,moduleId)   \\\n    ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback7_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback8_INTERFACE_DEFINED__\n#define __ICorProfilerCallback8_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback8 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback8;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"5BED9B15-C079-4D47-BFE2-215A140C07E0\")\n    ICorProfilerCallback8 : public ICorProfilerCallback7\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DynamicMethodJITCompilationStarted(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock,\n            /* [in] */ LPCBYTE pILHeader,\n            /* [in] */ ULONG cbILHeader) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DynamicMethodJITCompilationFinished(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback8Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback8 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(\n            ICorProfilerCallback8 * This,\n            /* [string][in] */ const WCHAR *wszAssemblyPath,\n            /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )(\n            ICorProfilerCallback8 * This,\n            ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock,\n            /* [in] */ LPCBYTE pILHeader,\n            /* [in] */ ULONG cbILHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )(\n            ICorProfilerCallback8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        END_INTERFACE\n    } ICorProfilerCallback8Vtbl;\n\n    interface ICorProfilerCallback8\n    {\n        CONST_VTBL struct ICorProfilerCallback8Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback8_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback8_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback8_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback8_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback8_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback8_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback8_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback8_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback8_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback8_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback8_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback8_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback8_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback8_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback8_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback8_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback8_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback8_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback8_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback8_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback8_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback8_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback8_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback8_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback8_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback8_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback8_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback8_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback8_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback8_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback8_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback8_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback8_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback8_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback8_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback8_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback8_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback8_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback8_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback8_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback8_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback8_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback8_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback8_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback8_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback8_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback8_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback8_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback8_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback8_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback8_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback8_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback8_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback8_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback8_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback8_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback8_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback8_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback8_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback8_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback8_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback8_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback8_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback8_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback8_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback8_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback8_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback8_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback8_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback8_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback8_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback8_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback8_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback8_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback8_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback8_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback8_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback8_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback8_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback8_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback8_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)   \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback8_ProfilerAttachComplete(This)  \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback8_ProfilerDetachSucceeded(This) \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback8_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback8_GetReJITParameters(This,moduleId,methodId,pFunctionControl)   \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback8_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback8_ReJITError(This,moduleId,methodId,functionId,hrStatus)    \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback8_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback8_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n\n#define ICorProfilerCallback8_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds)   \\\n    ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )\n\n\n#define ICorProfilerCallback8_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider)   \\\n    ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )\n\n\n#define ICorProfilerCallback8_ModuleInMemorySymbolsUpdated(This,moduleId)   \\\n    ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) )\n\n\n#define ICorProfilerCallback8_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader)   \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) )\n\n#define ICorProfilerCallback8_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)  \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback8_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback9_INTERFACE_DEFINED__\n#define __ICorProfilerCallback9_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback9 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback9;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"27583EC3-C8F5-482F-8052-194B8CE4705A\")\n    ICorProfilerCallback9 : public ICorProfilerCallback8\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DynamicMethodUnloaded(\n            /* [in] */ FunctionID functionId) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback9Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback9 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(\n            ICorProfilerCallback9 * This,\n            /* [string][in] */ const WCHAR *wszAssemblyPath,\n            /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )(\n            ICorProfilerCallback9 * This,\n            ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock,\n            /* [in] */ LPCBYTE pILHeader,\n            /* [in] */ ULONG cbILHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodUnloaded )(\n            ICorProfilerCallback9 * This,\n            /* [in] */ FunctionID functionId);\n\n        END_INTERFACE\n    } ICorProfilerCallback9Vtbl;\n\n    interface ICorProfilerCallback9\n    {\n        CONST_VTBL struct ICorProfilerCallback9Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback9_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback9_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback9_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback9_Initialize(This,pICorProfilerInfoUnk) \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback9_Shutdown(This)    \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback9_AppDomainCreationStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback9_AppDomainCreationFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback9_AppDomainShutdownStarted(This,appDomainId)    \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback9_AppDomainShutdownFinished(This,appDomainId,hrStatus)  \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback9_AssemblyLoadStarted(This,assemblyId)  \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback9_AssemblyLoadFinished(This,assemblyId,hrStatus)    \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback9_AssemblyUnloadStarted(This,assemblyId)    \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback9_AssemblyUnloadFinished(This,assemblyId,hrStatus)  \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback9_ModuleLoadStarted(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback9_ModuleLoadFinished(This,moduleId,hrStatus)    \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback9_ModuleUnloadStarted(This,moduleId)    \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback9_ModuleUnloadFinished(This,moduleId,hrStatus)  \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback9_ModuleAttachedToAssembly(This,moduleId,AssemblyId)    \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback9_ClassLoadStarted(This,classId)    \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback9_ClassLoadFinished(This,classId,hrStatus)  \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback9_ClassUnloadStarted(This,classId)  \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback9_ClassUnloadFinished(This,classId,hrStatus)    \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback9_FunctionUnloadStarted(This,functionId)    \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback9_JITCompilationStarted(This,functionId,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback9_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback9_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback9_JITCachedFunctionSearchFinished(This,functionId,result)   \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback9_JITFunctionPitched(This,functionId)   \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback9_JITInlining(This,callerId,calleeId,pfShouldInline)    \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback9_ThreadCreated(This,threadId)  \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback9_ThreadDestroyed(This,threadId)    \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback9_ThreadAssignedToOSThread(This,managedThreadId,osThreadId) \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback9_RemotingClientInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback9_RemotingClientSendingMessage(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback9_RemotingClientReceivingReply(This,pCookie,fIsAsync)   \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback9_RemotingClientInvocationFinished(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback9_RemotingServerReceivingMessage(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback9_RemotingServerInvocationStarted(This) \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback9_RemotingServerInvocationReturned(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback9_RemotingServerSendingReply(This,pCookie,fIsAsync) \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback9_UnmanagedToManagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback9_ManagedToUnmanagedTransition(This,functionId,reason)  \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback9_RuntimeSuspendStarted(This,suspendReason) \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback9_RuntimeSuspendFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback9_RuntimeSuspendAborted(This)   \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback9_RuntimeResumeStarted(This)    \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback9_RuntimeResumeFinished(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback9_RuntimeThreadSuspended(This,threadId) \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback9_RuntimeThreadResumed(This,threadId)   \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback9_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback9_ObjectAllocated(This,objectId,classId)    \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback9_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)   \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback9_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds)  \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback9_RootReferences(This,cRootRefs,rootRefIds) \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback9_ExceptionThrown(This,thrownObjectId)  \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback9_ExceptionSearchFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback9_ExceptionSearchFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback9_ExceptionSearchFilterEnter(This,functionId)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback9_ExceptionSearchFilterLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback9_ExceptionSearchCatcherFound(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback9_ExceptionOSHandlerEnter(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback9_ExceptionOSHandlerLeave(This,__unused)    \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback9_ExceptionUnwindFunctionEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback9_ExceptionUnwindFunctionLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback9_ExceptionUnwindFinallyEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback9_ExceptionUnwindFinallyLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback9_ExceptionCatcherEnter(This,functionId,objectId)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback9_ExceptionCatcherLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback9_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)    \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback9_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback9_ExceptionCLRCatcherFound(This)    \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback9_ExceptionCLRCatcherExecute(This)  \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback9_ThreadNameChanged(This,threadId,cchName,name) \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback9_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)    \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback9_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)    \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback9_GarbageCollectionFinished(This)   \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback9_FinalizeableObjectQueued(This,finalizerFlags,objectID)    \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback9_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)    \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback9_HandleCreated(This,handleId,initialObjectId)  \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback9_HandleDestroyed(This,handleId)    \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback9_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)   \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback9_ProfilerAttachComplete(This)  \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback9_ProfilerDetachSucceeded(This) \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback9_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)   \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback9_GetReJITParameters(This,moduleId,methodId,pFunctionControl)   \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback9_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback9_ReJITError(This,moduleId,methodId,functionId,hrStatus)    \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback9_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback9_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n\n#define ICorProfilerCallback9_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds)   \\\n    ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )\n\n\n#define ICorProfilerCallback9_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider)   \\\n    ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )\n\n\n#define ICorProfilerCallback9_ModuleInMemorySymbolsUpdated(This,moduleId)   \\\n    ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) )\n\n\n#define ICorProfilerCallback9_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader)   \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) )\n\n#define ICorProfilerCallback9_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)  \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n\n#define ICorProfilerCallback9_DynamicMethodUnloaded(This,functionId)    \\\n    ( (This)->lpVtbl -> DynamicMethodUnloaded(This,functionId) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback9_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback10_INTERFACE_DEFINED__\n#define __ICorProfilerCallback10_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback10 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback10;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CEC5B60E-C69C-495F-87F6-84D28EE16FFB\")\n    ICorProfilerCallback10 : public ICorProfilerCallback9\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EventPipeEventDelivered(\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [in] */ DWORD eventId,\n            /* [in] */ DWORD eventVersion,\n            /* [in] */ ULONG cbMetadataBlob,\n            /* [size_is][in] */ LPCBYTE metadataBlob,\n            /* [in] */ ULONG cbEventData,\n            /* [size_is][in] */ LPCBYTE eventData,\n            /* [in] */ LPCGUID pActivityId,\n            /* [in] */ LPCGUID pRelatedActivityId,\n            /* [in] */ ThreadID eventThread,\n            /* [in] */ ULONG numStackFrames,\n            /* [length_is][in] */ UINT_PTR stackFrames[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EventPipeProviderCreated(\n            /* [in] */ EVENTPIPE_PROVIDER provider) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback10Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback10 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(\n            ICorProfilerCallback10 * This,\n            /* [string][in] */ const WCHAR *wszAssemblyPath,\n            /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )(\n            ICorProfilerCallback10 * This,\n            ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock,\n            /* [in] */ LPCBYTE pILHeader,\n            /* [in] */ ULONG cbILHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodUnloaded )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeEventDelivered )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [in] */ DWORD eventId,\n            /* [in] */ DWORD eventVersion,\n            /* [in] */ ULONG cbMetadataBlob,\n            /* [size_is][in] */ LPCBYTE metadataBlob,\n            /* [in] */ ULONG cbEventData,\n            /* [size_is][in] */ LPCBYTE eventData,\n            /* [in] */ LPCGUID pActivityId,\n            /* [in] */ LPCGUID pRelatedActivityId,\n            /* [in] */ ThreadID eventThread,\n            /* [in] */ ULONG numStackFrames,\n            /* [length_is][in] */ UINT_PTR stackFrames[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeProviderCreated )(\n            ICorProfilerCallback10 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider);\n\n        END_INTERFACE\n    } ICorProfilerCallback10Vtbl;\n\n    interface ICorProfilerCallback10\n    {\n        CONST_VTBL struct ICorProfilerCallback10Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback10_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback10_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback10_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback10_Initialize(This,pICorProfilerInfoUnk)    \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback10_Shutdown(This)   \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback10_AppDomainCreationStarted(This,appDomainId)   \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback10_AppDomainCreationFinished(This,appDomainId,hrStatus) \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback10_AppDomainShutdownStarted(This,appDomainId)   \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback10_AppDomainShutdownFinished(This,appDomainId,hrStatus) \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback10_AssemblyLoadStarted(This,assemblyId) \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback10_AssemblyLoadFinished(This,assemblyId,hrStatus)   \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback10_AssemblyUnloadStarted(This,assemblyId)   \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback10_AssemblyUnloadFinished(This,assemblyId,hrStatus) \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback10_ModuleLoadStarted(This,moduleId) \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback10_ModuleLoadFinished(This,moduleId,hrStatus)   \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback10_ModuleUnloadStarted(This,moduleId)   \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback10_ModuleUnloadFinished(This,moduleId,hrStatus) \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback10_ModuleAttachedToAssembly(This,moduleId,AssemblyId)   \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback10_ClassLoadStarted(This,classId)   \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback10_ClassLoadFinished(This,classId,hrStatus) \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback10_ClassUnloadStarted(This,classId) \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback10_ClassUnloadFinished(This,classId,hrStatus)   \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback10_FunctionUnloadStarted(This,functionId)   \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback10_JITCompilationStarted(This,functionId,fIsSafeToBlock)    \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback10_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)  \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback10_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)  \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback10_JITCachedFunctionSearchFinished(This,functionId,result)  \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback10_JITFunctionPitched(This,functionId)  \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback10_JITInlining(This,callerId,calleeId,pfShouldInline)   \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback10_ThreadCreated(This,threadId) \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback10_ThreadDestroyed(This,threadId)   \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback10_ThreadAssignedToOSThread(This,managedThreadId,osThreadId)    \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback10_RemotingClientInvocationStarted(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback10_RemotingClientSendingMessage(This,pCookie,fIsAsync)  \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback10_RemotingClientReceivingReply(This,pCookie,fIsAsync)  \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback10_RemotingClientInvocationFinished(This)   \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback10_RemotingServerReceivingMessage(This,pCookie,fIsAsync)    \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback10_RemotingServerInvocationStarted(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback10_RemotingServerInvocationReturned(This)   \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback10_RemotingServerSendingReply(This,pCookie,fIsAsync)    \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback10_UnmanagedToManagedTransition(This,functionId,reason) \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback10_ManagedToUnmanagedTransition(This,functionId,reason) \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback10_RuntimeSuspendStarted(This,suspendReason)    \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback10_RuntimeSuspendFinished(This) \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback10_RuntimeSuspendAborted(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback10_RuntimeResumeStarted(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback10_RuntimeResumeFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback10_RuntimeThreadSuspended(This,threadId)    \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback10_RuntimeThreadResumed(This,threadId)  \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback10_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback10_ObjectAllocated(This,objectId,classId)   \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback10_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)  \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback10_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback10_RootReferences(This,cRootRefs,rootRefIds)    \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback10_ExceptionThrown(This,thrownObjectId) \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback10_ExceptionSearchFunctionEnter(This,functionId)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback10_ExceptionSearchFunctionLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback10_ExceptionSearchFilterEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback10_ExceptionSearchFilterLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback10_ExceptionSearchCatcherFound(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback10_ExceptionOSHandlerEnter(This,__unused)   \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback10_ExceptionOSHandlerLeave(This,__unused)   \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback10_ExceptionUnwindFunctionEnter(This,functionId)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback10_ExceptionUnwindFunctionLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback10_ExceptionUnwindFinallyEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback10_ExceptionUnwindFinallyLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback10_ExceptionCatcherEnter(This,functionId,objectId)  \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback10_ExceptionCatcherLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback10_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)   \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback10_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable)    \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback10_ExceptionCLRCatcherFound(This)   \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback10_ExceptionCLRCatcherExecute(This) \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback10_ThreadNameChanged(This,threadId,cchName,name)    \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback10_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)   \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback10_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback10_GarbageCollectionFinished(This)  \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback10_FinalizeableObjectQueued(This,finalizerFlags,objectID)   \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback10_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)   \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback10_HandleCreated(This,handleId,initialObjectId) \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback10_HandleDestroyed(This,handleId)   \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback10_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)  \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback10_ProfilerAttachComplete(This) \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback10_ProfilerDetachSucceeded(This)    \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback10_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)  \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback10_GetReJITParameters(This,moduleId,methodId,pFunctionControl)  \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback10_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock)    \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback10_ReJITError(This,moduleId,methodId,functionId,hrStatus)   \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback10_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback10_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n\n#define ICorProfilerCallback10_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds)  \\\n    ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )\n\n\n#define ICorProfilerCallback10_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider)  \\\n    ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )\n\n\n#define ICorProfilerCallback10_ModuleInMemorySymbolsUpdated(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) )\n\n\n#define ICorProfilerCallback10_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader)  \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) )\n\n#define ICorProfilerCallback10_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n\n#define ICorProfilerCallback10_DynamicMethodUnloaded(This,functionId)   \\\n    ( (This)->lpVtbl -> DynamicMethodUnloaded(This,functionId) )\n\n\n#define ICorProfilerCallback10_EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames)  \\\n    ( (This)->lpVtbl -> EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) )\n\n#define ICorProfilerCallback10_EventPipeProviderCreated(This,provider)  \\\n    ( (This)->lpVtbl -> EventPipeProviderCreated(This,provider) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback10_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerCallback11_INTERFACE_DEFINED__\n#define __ICorProfilerCallback11_INTERFACE_DEFINED__\n\n/* interface ICorProfilerCallback11 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerCallback11;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"42350846-AAED-47F7-B128-FD0C98881CDE\")\n    ICorProfilerCallback11 : public ICorProfilerCallback10\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE LoadAsNotificationOnly(\n            BOOL *pbNotificationOnly) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerCallback11Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerCallback11 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Initialize )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ IUnknown *pICorProfilerInfoUnk);\n\n        HRESULT ( STDMETHODCALLTYPE *Shutdown )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainCreationFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AppDomainID appDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *AppDomainShutdownFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyLoadFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AssemblyID assemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *AssemblyUnloadFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleLoadFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleUnloadFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleAttachedToAssembly )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ AssemblyID AssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassLoadFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ClassUnloadFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *FunctionUnloadStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCompilationFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *pbUseCachedFunction);\n\n        HRESULT ( STDMETHODCALLTYPE *JITCachedFunctionSearchFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_JIT_CACHE result);\n\n        HRESULT ( STDMETHODCALLTYPE *JITFunctionPitched )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *JITInlining )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID callerId,\n            /* [in] */ FunctionID calleeId,\n            /* [out] */ BOOL *pfShouldInline);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadCreated )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadDestroyed )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadAssignedToOSThread )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ThreadID managedThreadId,\n            /* [in] */ DWORD osThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationStarted )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientSendingMessage )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientReceivingReply )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingClientInvocationFinished )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerReceivingMessage )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationStarted )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerInvocationReturned )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RemotingServerSendingReply )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ GUID *pCookie,\n            /* [in] */ BOOL fIsAsync);\n\n        HRESULT ( STDMETHODCALLTYPE *UnmanagedToManagedTransition )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *ManagedToUnmanagedTransition )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_TRANSITION_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ COR_PRF_SUSPEND_REASON suspendReason);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendFinished )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeSuspendAborted )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeStarted )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeResumeFinished )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadSuspended )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *RuntimeThreadResumed )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ThreadID threadId);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectAllocated )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectsAllocatedByClass )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cClassCount,\n            /* [size_is][in] */ ClassID classIds[  ],\n            /* [size_is][in] */ ULONG cObjects[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ObjectReferences )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG cObjectRefs,\n            /* [size_is][in] */ ObjectID objectRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionThrown )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ObjectID thrownObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionEnter )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFunctionLeave )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterEnter )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchFilterLeave )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionSearchCatcherFound )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerEnter )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionOSHandlerLeave )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ UINT_PTR __unused);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionEnter )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFunctionLeave )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyEnter )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionUnwindFinallyLeave )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ObjectID objectId);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherLeave )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableCreated )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable,\n            /* [in] */ ULONG cSlots);\n\n        HRESULT ( STDMETHODCALLTYPE *COMClassicVTableDestroyed )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ClassID wrappedClassId,\n            /* [in] */ REFGUID implementedIID,\n            /* [in] */ void *pVTable);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherFound )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ExceptionCLRCatcherExecute )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ThreadNameChanged )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ThreadID threadId,\n            /* [in] */ ULONG cchName,\n            /* [annotation][in] */\n            _In_reads_opt_(cchName)  WCHAR name[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ int cGenerations,\n            /* [size_is][in] */ BOOL generationCollected[  ],\n            /* [in] */ COR_PRF_GC_REASON reason);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ ULONG cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GarbageCollectionFinished )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *FinalizeableObjectQueued )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ DWORD finalizerFlags,\n            /* [in] */ ObjectID objectID);\n\n        HRESULT ( STDMETHODCALLTYPE *RootReferences2 )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID rootRefIds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_KIND rootKinds[  ],\n            /* [size_is][in] */ COR_PRF_GC_ROOT_FLAGS rootFlags[  ],\n            /* [size_is][in] */ UINT_PTR rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleCreated )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ GCHandleID handleId,\n            /* [in] */ ObjectID initialObjectId);\n\n        HRESULT ( STDMETHODCALLTYPE *HandleDestroyed )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ GCHandleID handleId);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeForAttach )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ IUnknown *pCorProfilerInfoUnk,\n            /* [in] */ void *pvClientData,\n            /* [in] */ UINT cbClientData);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerAttachComplete )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ProfilerDetachSucceeded )(\n            ICorProfilerCallback11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITParameters )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ ICorProfilerFunctionControl *pFunctionControl);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITCompilationFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID rejitId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *ReJITError )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus);\n\n        HRESULT ( STDMETHODCALLTYPE *MovedReferences2 )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cMovedObjectIDRanges,\n            /* [size_is][in] */ ObjectID oldObjectIDRangeStart[  ],\n            /* [size_is][in] */ ObjectID newObjectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SurvivingReferences2 )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cSurvivingObjectIDRanges,\n            /* [size_is][in] */ ObjectID objectIDRangeStart[  ],\n            /* [size_is][in] */ SIZE_T cObjectIDRangeLength[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *ConditionalWeakTableElementReferences )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ ULONG cRootRefs,\n            /* [size_is][in] */ ObjectID keyRefIds[  ],\n            /* [size_is][in] */ ObjectID valueRefIds[  ],\n            /* [size_is][in] */ GCHandleID rootIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyReferences )(\n            ICorProfilerCallback11 * This,\n            /* [string][in] */ const WCHAR *wszAssemblyPath,\n            /* [in] */ ICorProfilerAssemblyReferenceProvider *pAsmRefProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *ModuleInMemorySymbolsUpdated )(\n            ICorProfilerCallback11 * This,\n            ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationStarted )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fIsSafeToBlock,\n            /* [in] */ LPCBYTE pILHeader,\n            /* [in] */ ULONG cbILHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodJITCompilationFinished )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ HRESULT hrStatus,\n            /* [in] */ BOOL fIsSafeToBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *DynamicMethodUnloaded )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeEventDelivered )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [in] */ DWORD eventId,\n            /* [in] */ DWORD eventVersion,\n            /* [in] */ ULONG cbMetadataBlob,\n            /* [size_is][in] */ LPCBYTE metadataBlob,\n            /* [in] */ ULONG cbEventData,\n            /* [size_is][in] */ LPCBYTE eventData,\n            /* [in] */ LPCGUID pActivityId,\n            /* [in] */ LPCGUID pRelatedActivityId,\n            /* [in] */ ThreadID eventThread,\n            /* [in] */ ULONG numStackFrames,\n            /* [length_is][in] */ UINT_PTR stackFrames[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeProviderCreated )(\n            ICorProfilerCallback11 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider);\n\n        HRESULT ( STDMETHODCALLTYPE *LoadAsNotificationOnly )(\n            ICorProfilerCallback11 * This,\n            BOOL *pbNotificationOnly);\n\n        END_INTERFACE\n    } ICorProfilerCallback11Vtbl;\n\n    interface ICorProfilerCallback11\n    {\n        CONST_VTBL struct ICorProfilerCallback11Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerCallback11_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerCallback11_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerCallback11_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerCallback11_Initialize(This,pICorProfilerInfoUnk)    \\\n    ( (This)->lpVtbl -> Initialize(This,pICorProfilerInfoUnk) )\n\n#define ICorProfilerCallback11_Shutdown(This)   \\\n    ( (This)->lpVtbl -> Shutdown(This) )\n\n#define ICorProfilerCallback11_AppDomainCreationStarted(This,appDomainId)   \\\n    ( (This)->lpVtbl -> AppDomainCreationStarted(This,appDomainId) )\n\n#define ICorProfilerCallback11_AppDomainCreationFinished(This,appDomainId,hrStatus) \\\n    ( (This)->lpVtbl -> AppDomainCreationFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback11_AppDomainShutdownStarted(This,appDomainId)   \\\n    ( (This)->lpVtbl -> AppDomainShutdownStarted(This,appDomainId) )\n\n#define ICorProfilerCallback11_AppDomainShutdownFinished(This,appDomainId,hrStatus) \\\n    ( (This)->lpVtbl -> AppDomainShutdownFinished(This,appDomainId,hrStatus) )\n\n#define ICorProfilerCallback11_AssemblyLoadStarted(This,assemblyId) \\\n    ( (This)->lpVtbl -> AssemblyLoadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback11_AssemblyLoadFinished(This,assemblyId,hrStatus)   \\\n    ( (This)->lpVtbl -> AssemblyLoadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback11_AssemblyUnloadStarted(This,assemblyId)   \\\n    ( (This)->lpVtbl -> AssemblyUnloadStarted(This,assemblyId) )\n\n#define ICorProfilerCallback11_AssemblyUnloadFinished(This,assemblyId,hrStatus) \\\n    ( (This)->lpVtbl -> AssemblyUnloadFinished(This,assemblyId,hrStatus) )\n\n#define ICorProfilerCallback11_ModuleLoadStarted(This,moduleId) \\\n    ( (This)->lpVtbl -> ModuleLoadStarted(This,moduleId) )\n\n#define ICorProfilerCallback11_ModuleLoadFinished(This,moduleId,hrStatus)   \\\n    ( (This)->lpVtbl -> ModuleLoadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback11_ModuleUnloadStarted(This,moduleId)   \\\n    ( (This)->lpVtbl -> ModuleUnloadStarted(This,moduleId) )\n\n#define ICorProfilerCallback11_ModuleUnloadFinished(This,moduleId,hrStatus) \\\n    ( (This)->lpVtbl -> ModuleUnloadFinished(This,moduleId,hrStatus) )\n\n#define ICorProfilerCallback11_ModuleAttachedToAssembly(This,moduleId,AssemblyId)   \\\n    ( (This)->lpVtbl -> ModuleAttachedToAssembly(This,moduleId,AssemblyId) )\n\n#define ICorProfilerCallback11_ClassLoadStarted(This,classId)   \\\n    ( (This)->lpVtbl -> ClassLoadStarted(This,classId) )\n\n#define ICorProfilerCallback11_ClassLoadFinished(This,classId,hrStatus) \\\n    ( (This)->lpVtbl -> ClassLoadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback11_ClassUnloadStarted(This,classId) \\\n    ( (This)->lpVtbl -> ClassUnloadStarted(This,classId) )\n\n#define ICorProfilerCallback11_ClassUnloadFinished(This,classId,hrStatus)   \\\n    ( (This)->lpVtbl -> ClassUnloadFinished(This,classId,hrStatus) )\n\n#define ICorProfilerCallback11_FunctionUnloadStarted(This,functionId)   \\\n    ( (This)->lpVtbl -> FunctionUnloadStarted(This,functionId) )\n\n#define ICorProfilerCallback11_JITCompilationStarted(This,functionId,fIsSafeToBlock)    \\\n    ( (This)->lpVtbl -> JITCompilationStarted(This,functionId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback11_JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock)  \\\n    ( (This)->lpVtbl -> JITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback11_JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction)  \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchStarted(This,functionId,pbUseCachedFunction) )\n\n#define ICorProfilerCallback11_JITCachedFunctionSearchFinished(This,functionId,result)  \\\n    ( (This)->lpVtbl -> JITCachedFunctionSearchFinished(This,functionId,result) )\n\n#define ICorProfilerCallback11_JITFunctionPitched(This,functionId)  \\\n    ( (This)->lpVtbl -> JITFunctionPitched(This,functionId) )\n\n#define ICorProfilerCallback11_JITInlining(This,callerId,calleeId,pfShouldInline)   \\\n    ( (This)->lpVtbl -> JITInlining(This,callerId,calleeId,pfShouldInline) )\n\n#define ICorProfilerCallback11_ThreadCreated(This,threadId) \\\n    ( (This)->lpVtbl -> ThreadCreated(This,threadId) )\n\n#define ICorProfilerCallback11_ThreadDestroyed(This,threadId)   \\\n    ( (This)->lpVtbl -> ThreadDestroyed(This,threadId) )\n\n#define ICorProfilerCallback11_ThreadAssignedToOSThread(This,managedThreadId,osThreadId)    \\\n    ( (This)->lpVtbl -> ThreadAssignedToOSThread(This,managedThreadId,osThreadId) )\n\n#define ICorProfilerCallback11_RemotingClientInvocationStarted(This)    \\\n    ( (This)->lpVtbl -> RemotingClientInvocationStarted(This) )\n\n#define ICorProfilerCallback11_RemotingClientSendingMessage(This,pCookie,fIsAsync)  \\\n    ( (This)->lpVtbl -> RemotingClientSendingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback11_RemotingClientReceivingReply(This,pCookie,fIsAsync)  \\\n    ( (This)->lpVtbl -> RemotingClientReceivingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback11_RemotingClientInvocationFinished(This)   \\\n    ( (This)->lpVtbl -> RemotingClientInvocationFinished(This) )\n\n#define ICorProfilerCallback11_RemotingServerReceivingMessage(This,pCookie,fIsAsync)    \\\n    ( (This)->lpVtbl -> RemotingServerReceivingMessage(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback11_RemotingServerInvocationStarted(This)    \\\n    ( (This)->lpVtbl -> RemotingServerInvocationStarted(This) )\n\n#define ICorProfilerCallback11_RemotingServerInvocationReturned(This)   \\\n    ( (This)->lpVtbl -> RemotingServerInvocationReturned(This) )\n\n#define ICorProfilerCallback11_RemotingServerSendingReply(This,pCookie,fIsAsync)    \\\n    ( (This)->lpVtbl -> RemotingServerSendingReply(This,pCookie,fIsAsync) )\n\n#define ICorProfilerCallback11_UnmanagedToManagedTransition(This,functionId,reason) \\\n    ( (This)->lpVtbl -> UnmanagedToManagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback11_ManagedToUnmanagedTransition(This,functionId,reason) \\\n    ( (This)->lpVtbl -> ManagedToUnmanagedTransition(This,functionId,reason) )\n\n#define ICorProfilerCallback11_RuntimeSuspendStarted(This,suspendReason)    \\\n    ( (This)->lpVtbl -> RuntimeSuspendStarted(This,suspendReason) )\n\n#define ICorProfilerCallback11_RuntimeSuspendFinished(This) \\\n    ( (This)->lpVtbl -> RuntimeSuspendFinished(This) )\n\n#define ICorProfilerCallback11_RuntimeSuspendAborted(This)  \\\n    ( (This)->lpVtbl -> RuntimeSuspendAborted(This) )\n\n#define ICorProfilerCallback11_RuntimeResumeStarted(This)   \\\n    ( (This)->lpVtbl -> RuntimeResumeStarted(This) )\n\n#define ICorProfilerCallback11_RuntimeResumeFinished(This)  \\\n    ( (This)->lpVtbl -> RuntimeResumeFinished(This) )\n\n#define ICorProfilerCallback11_RuntimeThreadSuspended(This,threadId)    \\\n    ( (This)->lpVtbl -> RuntimeThreadSuspended(This,threadId) )\n\n#define ICorProfilerCallback11_RuntimeThreadResumed(This,threadId)  \\\n    ( (This)->lpVtbl -> RuntimeThreadResumed(This,threadId) )\n\n#define ICorProfilerCallback11_MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> MovedReferences(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback11_ObjectAllocated(This,objectId,classId)   \\\n    ( (This)->lpVtbl -> ObjectAllocated(This,objectId,classId) )\n\n#define ICorProfilerCallback11_ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects)  \\\n    ( (This)->lpVtbl -> ObjectsAllocatedByClass(This,cClassCount,classIds,cObjects) )\n\n#define ICorProfilerCallback11_ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) \\\n    ( (This)->lpVtbl -> ObjectReferences(This,objectId,classId,cObjectRefs,objectRefIds) )\n\n#define ICorProfilerCallback11_RootReferences(This,cRootRefs,rootRefIds)    \\\n    ( (This)->lpVtbl -> RootReferences(This,cRootRefs,rootRefIds) )\n\n#define ICorProfilerCallback11_ExceptionThrown(This,thrownObjectId) \\\n    ( (This)->lpVtbl -> ExceptionThrown(This,thrownObjectId) )\n\n#define ICorProfilerCallback11_ExceptionSearchFunctionEnter(This,functionId)    \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback11_ExceptionSearchFunctionLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionSearchFunctionLeave(This) )\n\n#define ICorProfilerCallback11_ExceptionSearchFilterEnter(This,functionId)  \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterEnter(This,functionId) )\n\n#define ICorProfilerCallback11_ExceptionSearchFilterLeave(This) \\\n    ( (This)->lpVtbl -> ExceptionSearchFilterLeave(This) )\n\n#define ICorProfilerCallback11_ExceptionSearchCatcherFound(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionSearchCatcherFound(This,functionId) )\n\n#define ICorProfilerCallback11_ExceptionOSHandlerEnter(This,__unused)   \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerEnter(This,__unused) )\n\n#define ICorProfilerCallback11_ExceptionOSHandlerLeave(This,__unused)   \\\n    ( (This)->lpVtbl -> ExceptionOSHandlerLeave(This,__unused) )\n\n#define ICorProfilerCallback11_ExceptionUnwindFunctionEnter(This,functionId)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionEnter(This,functionId) )\n\n#define ICorProfilerCallback11_ExceptionUnwindFunctionLeave(This)   \\\n    ( (This)->lpVtbl -> ExceptionUnwindFunctionLeave(This) )\n\n#define ICorProfilerCallback11_ExceptionUnwindFinallyEnter(This,functionId) \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyEnter(This,functionId) )\n\n#define ICorProfilerCallback11_ExceptionUnwindFinallyLeave(This)    \\\n    ( (This)->lpVtbl -> ExceptionUnwindFinallyLeave(This) )\n\n#define ICorProfilerCallback11_ExceptionCatcherEnter(This,functionId,objectId)  \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,functionId,objectId) )\n\n#define ICorProfilerCallback11_ExceptionCatcherLeave(This)  \\\n    ( (This)->lpVtbl -> ExceptionCatcherLeave(This) )\n\n#define ICorProfilerCallback11_COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots)   \\\n    ( (This)->lpVtbl -> COMClassicVTableCreated(This,wrappedClassId,implementedIID,pVTable,cSlots) )\n\n#define ICorProfilerCallback11_COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable)    \\\n    ( (This)->lpVtbl -> COMClassicVTableDestroyed(This,wrappedClassId,implementedIID,pVTable) )\n\n#define ICorProfilerCallback11_ExceptionCLRCatcherFound(This)   \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherFound(This) )\n\n#define ICorProfilerCallback11_ExceptionCLRCatcherExecute(This) \\\n    ( (This)->lpVtbl -> ExceptionCLRCatcherExecute(This) )\n\n\n#define ICorProfilerCallback11_ThreadNameChanged(This,threadId,cchName,name)    \\\n    ( (This)->lpVtbl -> ThreadNameChanged(This,threadId,cchName,name) )\n\n#define ICorProfilerCallback11_GarbageCollectionStarted(This,cGenerations,generationCollected,reason)   \\\n    ( (This)->lpVtbl -> GarbageCollectionStarted(This,cGenerations,generationCollected,reason) )\n\n#define ICorProfilerCallback11_SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)   \\\n    ( (This)->lpVtbl -> SurvivingReferences(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback11_GarbageCollectionFinished(This)  \\\n    ( (This)->lpVtbl -> GarbageCollectionFinished(This) )\n\n#define ICorProfilerCallback11_FinalizeableObjectQueued(This,finalizerFlags,objectID)   \\\n    ( (This)->lpVtbl -> FinalizeableObjectQueued(This,finalizerFlags,objectID) )\n\n#define ICorProfilerCallback11_RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds)   \\\n    ( (This)->lpVtbl -> RootReferences2(This,cRootRefs,rootRefIds,rootKinds,rootFlags,rootIds) )\n\n#define ICorProfilerCallback11_HandleCreated(This,handleId,initialObjectId) \\\n    ( (This)->lpVtbl -> HandleCreated(This,handleId,initialObjectId) )\n\n#define ICorProfilerCallback11_HandleDestroyed(This,handleId)   \\\n    ( (This)->lpVtbl -> HandleDestroyed(This,handleId) )\n\n\n#define ICorProfilerCallback11_InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData)  \\\n    ( (This)->lpVtbl -> InitializeForAttach(This,pCorProfilerInfoUnk,pvClientData,cbClientData) )\n\n#define ICorProfilerCallback11_ProfilerAttachComplete(This) \\\n    ( (This)->lpVtbl -> ProfilerAttachComplete(This) )\n\n#define ICorProfilerCallback11_ProfilerDetachSucceeded(This)    \\\n    ( (This)->lpVtbl -> ProfilerDetachSucceeded(This) )\n\n\n#define ICorProfilerCallback11_ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock)  \\\n    ( (This)->lpVtbl -> ReJITCompilationStarted(This,functionId,rejitId,fIsSafeToBlock) )\n\n#define ICorProfilerCallback11_GetReJITParameters(This,moduleId,methodId,pFunctionControl)  \\\n    ( (This)->lpVtbl -> GetReJITParameters(This,moduleId,methodId,pFunctionControl) )\n\n#define ICorProfilerCallback11_ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock)    \\\n    ( (This)->lpVtbl -> ReJITCompilationFinished(This,functionId,rejitId,hrStatus,fIsSafeToBlock) )\n\n#define ICorProfilerCallback11_ReJITError(This,moduleId,methodId,functionId,hrStatus)   \\\n    ( (This)->lpVtbl -> ReJITError(This,moduleId,methodId,functionId,hrStatus) )\n\n#define ICorProfilerCallback11_MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) \\\n    ( (This)->lpVtbl -> MovedReferences2(This,cMovedObjectIDRanges,oldObjectIDRangeStart,newObjectIDRangeStart,cObjectIDRangeLength) )\n\n#define ICorProfilerCallback11_SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength)  \\\n    ( (This)->lpVtbl -> SurvivingReferences2(This,cSurvivingObjectIDRanges,objectIDRangeStart,cObjectIDRangeLength) )\n\n\n#define ICorProfilerCallback11_ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds)  \\\n    ( (This)->lpVtbl -> ConditionalWeakTableElementReferences(This,cRootRefs,keyRefIds,valueRefIds,rootIds) )\n\n\n#define ICorProfilerCallback11_GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider)  \\\n    ( (This)->lpVtbl -> GetAssemblyReferences(This,wszAssemblyPath,pAsmRefProvider) )\n\n\n#define ICorProfilerCallback11_ModuleInMemorySymbolsUpdated(This,moduleId)  \\\n    ( (This)->lpVtbl -> ModuleInMemorySymbolsUpdated(This,moduleId) )\n\n\n#define ICorProfilerCallback11_DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader)  \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationStarted(This,functionId,fIsSafeToBlock,pILHeader,cbILHeader) )\n\n#define ICorProfilerCallback11_DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) \\\n    ( (This)->lpVtbl -> DynamicMethodJITCompilationFinished(This,functionId,hrStatus,fIsSafeToBlock) )\n\n\n#define ICorProfilerCallback11_DynamicMethodUnloaded(This,functionId)   \\\n    ( (This)->lpVtbl -> DynamicMethodUnloaded(This,functionId) )\n\n\n#define ICorProfilerCallback11_EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames)  \\\n    ( (This)->lpVtbl -> EventPipeEventDelivered(This,provider,eventId,eventVersion,cbMetadataBlob,metadataBlob,cbEventData,eventData,pActivityId,pRelatedActivityId,eventThread,numStackFrames,stackFrames) )\n\n#define ICorProfilerCallback11_EventPipeProviderCreated(This,provider)  \\\n    ( (This)->lpVtbl -> EventPipeProviderCreated(This,provider) )\n\n\n#define ICorProfilerCallback11_LoadAsNotificationOnly(This,pbNotificationOnly)  \\\n    ( (This)->lpVtbl -> LoadAsNotificationOnly(This,pbNotificationOnly) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerCallback11_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_corprof_0000_0011 */\n/* [local] */\n\ntypedef /* [public] */\nenum __MIDL___MIDL_itf_corprof_0000_0011_0001\n    {\n        COR_PRF_CODEGEN_DISABLE_INLINING    = 0x1,\n        COR_PRF_CODEGEN_DISABLE_ALL_OPTIMIZATIONS   = 0x2\n    }   COR_PRF_CODEGEN_FLAGS;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0011_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corprof_0000_0011_v0_0_s_ifspec;\n\n#ifndef __ICorProfilerInfo_INTERFACE_DEFINED__\n#define __ICorProfilerInfo_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"28B5557D-3F3F-48b4-90B2-5F9EEA2F6C48\")\n    ICorProfilerInfo : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetClassFromObject(\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClassFromToken(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeInfo(\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetEventMask(\n            /* [out] */ DWORD *pdwEvents) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionFromIP(\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionFromToken(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHandleFromThread(\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectSize(\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsArrayClass(\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadInfo(\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCurrentThreadID(\n            /* [out] */ ThreadID *pThreadId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClassIDInfo(\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionInfo(\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetEventMask(\n            /* [in] */ DWORD dwEvents) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetEnterLeaveFunctionHooks(\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetFunctionIDMapper(\n            /* [in] */ FunctionIDMapper *pFunc) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTokenAndMetaDataFromFunction(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetModuleInfo(\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetModuleMetaData(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILFunctionBody(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILFunctionBodyAllocator(\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetILFunctionBody(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainInfo(\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyInfo(\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetFunctionReJIT(\n            /* [in] */ FunctionID functionId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ForceGC( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetILInstrumentedCodeMap(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetInprocInspectionInterface(\n            /* [out] */ IUnknown **ppicd) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetInprocInspectionIThisThread(\n            /* [out] */ IUnknown **ppicd) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadContext(\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE BeginInprocDebugging(\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EndInprocDebugging(\n            /* [in] */ DWORD dwProfilerContext) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILToNativeMapping(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfoVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        END_INTERFACE\n    } ICorProfilerInfoVtbl;\n\n    interface ICorProfilerInfo\n    {\n        CONST_VTBL struct ICorProfilerInfoVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo_QueryInterface(This,riid,ppvObject)    \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo_AddRef(This)   \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo_Release(This)  \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo_GetClassFromObject(This,objectId,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo_GetClassFromToken(This,moduleId,typeDef,pClassId)  \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo_GetCodeInfo(This,functionId,pStart,pcSize) \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo_GetEventMask(This,pdwEvents)   \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo_GetFunctionFromIP(This,ip,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo_GetFunctionFromToken(This,moduleId,token,pFunctionId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo_GetHandleFromThread(This,threadId,phThread)    \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo_GetObjectSize(This,objectId,pcSize)    \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)   \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo_GetThreadInfo(This,threadId,pdwWin32ThreadId)  \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo_GetCurrentThreadID(This,pThreadId) \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)   \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo_SetEventMask(This,dwEvents)    \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)   \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo_SetFunctionIDMapper(This,pFunc)    \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken)  \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)    \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo_GetILFunctionBodyAllocator(This,moduleId,ppMalloc) \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader)  \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId)  \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)    \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo_SetFunctionReJIT(This,functionId)  \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo_ForceGC(This)  \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)   \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo_GetInprocInspectionInterface(This,ppicd)   \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo_GetInprocInspectionIThisThread(This,ppicd) \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo_GetThreadContext(This,threadId,pContextId) \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext)  \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo_EndInprocDebugging(This,dwProfilerContext) \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo_GetILToNativeMapping(This,functionId,cMap,pcMap,map)   \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo2_INTERFACE_DEFINED__\n#define __ICorProfilerInfo2_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo2 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"CC0935CD-A518-487d-B0BB-A93214E65478\")\n    ICorProfilerInfo2 : public ICorProfilerInfo\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DoStackSnapshot(\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetEnterLeaveFunctionHooks2(\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionInfo2(\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStringLayout(\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClassLayout(\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClassIDInfo2(\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeInfo2(\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClassFromTokenAndTypeArgs(\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionFromTokenAndTypeArgs(\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumModuleFrozenObjects(\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetArrayObjectInfo(\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetBoxClassLayout(\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadAppDomain(\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRVAStaticAddress(\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainStaticAddress(\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadStaticAddress(\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetContextStaticAddress(\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStaticFieldInfo(\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGenerationBounds(\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectGeneration(\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetNotifiedExceptionClauseInfo(\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo2 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo2 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo2 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo2 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo2 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo2 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo2 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        END_INTERFACE\n    } ICorProfilerInfo2Vtbl;\n\n    interface ICorProfilerInfo2\n    {\n        CONST_VTBL struct ICorProfilerInfo2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo2_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo2_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo2_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo2_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo2_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo2_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo2_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo2_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo2_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo2_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo2_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo2_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo2_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo2_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo2_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo2_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo2_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo2_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo2_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo2_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo2_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo2_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo2_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo2_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo2_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo2_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo2_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo2_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo2_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo2_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo2_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo2_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo2_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo2_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo2_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo2_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo2_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo2_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo2_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo2_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo2_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo2_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo2_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo2_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo2_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo2_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo2_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo2_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo2_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo2_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo2_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo2_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo2_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo2_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo2_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo2_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo2_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo3_INTERFACE_DEFINED__\n#define __ICorProfilerInfo3_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo3 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"B555ED4F-452A-4E54-8B39-B5360BAD32A0\")\n    ICorProfilerInfo3 : public ICorProfilerInfo2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumJITedFunctions(\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RequestProfilerDetach(\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetFunctionIDMapper2(\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStringLayout2(\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetEnterLeaveFunctionHooks3(\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetEnterLeaveFunctionHooks3WithInfo(\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionEnter3Info(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionLeave3Info(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionTailcall3Info(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumModules(\n            /* [out] */ ICorProfilerModuleEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRuntimeInformation(\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadStaticAddress2(\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainsContainingModule(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetModuleInfo2(\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo3 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo3 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        END_INTERFACE\n    } ICorProfilerInfo3Vtbl;\n\n    interface ICorProfilerInfo3\n    {\n        CONST_VTBL struct ICorProfilerInfo3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo3_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo3_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo3_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo3_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo3_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo3_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo3_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo3_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo3_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo3_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo3_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo3_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo3_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo3_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo3_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo3_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo3_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo3_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo3_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo3_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo3_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo3_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo3_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo3_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo3_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo3_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo3_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo3_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo3_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo3_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo3_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo3_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo3_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo3_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo3_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo3_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo3_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo3_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo3_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo3_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo3_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo3_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo3_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo3_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo3_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo3_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo3_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo3_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo3_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo3_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo3_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo3_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo3_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo3_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo3_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo3_EnumJITedFunctions(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo3_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds)  \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo3_SetFunctionIDMapper2(This,pFunc,clientData)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo3_GetStringLayout2(This,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo3_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo3_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)   \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo3_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)    \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo3_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo3_EnumModules(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo3_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)   \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo3_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo3_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)    \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo3_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)    \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerObjectEnum_INTERFACE_DEFINED__\n#define __ICorProfilerObjectEnum_INTERFACE_DEFINED__\n\n/* interface ICorProfilerObjectEnum */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerObjectEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"2C6269BD-2D13-4321-AE12-6686365FD6AF\")\n    ICorProfilerObjectEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip(\n            /* [in] */ ULONG celt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Clone(\n            /* [out] */ ICorProfilerObjectEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ ULONG *pcelt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ObjectID objects[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerObjectEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerObjectEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerObjectEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerObjectEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorProfilerObjectEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorProfilerObjectEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorProfilerObjectEnum * This,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorProfilerObjectEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorProfilerObjectEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ObjectID objects[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorProfilerObjectEnumVtbl;\n\n    interface ICorProfilerObjectEnum\n    {\n        CONST_VTBL struct ICorProfilerObjectEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerObjectEnum_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerObjectEnum_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerObjectEnum_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerObjectEnum_Skip(This,celt)  \\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorProfilerObjectEnum_Reset(This)  \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorProfilerObjectEnum_Clone(This,ppEnum)   \\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorProfilerObjectEnum_GetCount(This,pcelt) \\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n#define ICorProfilerObjectEnum_Next(This,celt,objects,pceltFetched) \\\n    ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerObjectEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerFunctionEnum_INTERFACE_DEFINED__\n#define __ICorProfilerFunctionEnum_INTERFACE_DEFINED__\n\n/* interface ICorProfilerFunctionEnum */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerFunctionEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FF71301A-B994-429D-A10B-B345A65280EF\")\n    ICorProfilerFunctionEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip(\n            /* [in] */ ULONG celt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Clone(\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ ULONG *pcelt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_PRF_FUNCTION ids[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerFunctionEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerFunctionEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerFunctionEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerFunctionEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorProfilerFunctionEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorProfilerFunctionEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorProfilerFunctionEnum * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorProfilerFunctionEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorProfilerFunctionEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_PRF_FUNCTION ids[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorProfilerFunctionEnumVtbl;\n\n    interface ICorProfilerFunctionEnum\n    {\n        CONST_VTBL struct ICorProfilerFunctionEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerFunctionEnum_QueryInterface(This,riid,ppvObject)    \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerFunctionEnum_AddRef(This)   \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerFunctionEnum_Release(This)  \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerFunctionEnum_Skip(This,celt)    \\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorProfilerFunctionEnum_Reset(This)    \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorProfilerFunctionEnum_Clone(This,ppEnum) \\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorProfilerFunctionEnum_GetCount(This,pcelt)   \\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n#define ICorProfilerFunctionEnum_Next(This,celt,ids,pceltFetched)   \\\n    ( (This)->lpVtbl -> Next(This,celt,ids,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerFunctionEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerModuleEnum_INTERFACE_DEFINED__\n#define __ICorProfilerModuleEnum_INTERFACE_DEFINED__\n\n/* interface ICorProfilerModuleEnum */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerModuleEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"b0266d75-2081-4493-af7f-028ba34db891\")\n    ICorProfilerModuleEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip(\n            /* [in] */ ULONG celt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Clone(\n            /* [out] */ ICorProfilerModuleEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ ULONG *pcelt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ModuleID ids[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerModuleEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerModuleEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerModuleEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerModuleEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorProfilerModuleEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorProfilerModuleEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorProfilerModuleEnum * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorProfilerModuleEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorProfilerModuleEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ModuleID ids[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorProfilerModuleEnumVtbl;\n\n    interface ICorProfilerModuleEnum\n    {\n        CONST_VTBL struct ICorProfilerModuleEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerModuleEnum_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerModuleEnum_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerModuleEnum_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerModuleEnum_Skip(This,celt)  \\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorProfilerModuleEnum_Reset(This)  \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorProfilerModuleEnum_Clone(This,ppEnum)   \\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorProfilerModuleEnum_GetCount(This,pcelt) \\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n#define ICorProfilerModuleEnum_Next(This,celt,ids,pceltFetched) \\\n    ( (This)->lpVtbl -> Next(This,celt,ids,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerModuleEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __IMethodMalloc_INTERFACE_DEFINED__\n#define __IMethodMalloc_INTERFACE_DEFINED__\n\n/* interface IMethodMalloc */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_IMethodMalloc;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"A0EFB28B-6EE2-4d7b-B983-A75EF7BEEDB8\")\n    IMethodMalloc : public IUnknown\n    {\n    public:\n        virtual PVOID STDMETHODCALLTYPE Alloc(\n            /* [in] */ ULONG cb) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct IMethodMallocVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            IMethodMalloc * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            IMethodMalloc * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            IMethodMalloc * This);\n\n        PVOID ( STDMETHODCALLTYPE *Alloc )(\n            IMethodMalloc * This,\n            /* [in] */ ULONG cb);\n\n        END_INTERFACE\n    } IMethodMallocVtbl;\n\n    interface IMethodMalloc\n    {\n        CONST_VTBL struct IMethodMallocVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define IMethodMalloc_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define IMethodMalloc_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define IMethodMalloc_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define IMethodMalloc_Alloc(This,cb)    \\\n    ( (This)->lpVtbl -> Alloc(This,cb) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __IMethodMalloc_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerFunctionControl_INTERFACE_DEFINED__\n#define __ICorProfilerFunctionControl_INTERFACE_DEFINED__\n\n/* interface ICorProfilerFunctionControl */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerFunctionControl;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F0963021-E1EA-4732-8581-E01B0BD3C0C6\")\n    ICorProfilerFunctionControl : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetCodegenFlags(\n            /* [in] */ DWORD flags) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetILFunctionBody(\n            /* [in] */ ULONG cbNewILMethodHeader,\n            /* [size_is][in] */ LPCBYTE pbNewILMethodHeader) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetILInstrumentedCodeMap(\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerFunctionControlVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerFunctionControl * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerFunctionControl * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerFunctionControl * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetCodegenFlags )(\n            ICorProfilerFunctionControl * This,\n            /* [in] */ DWORD flags);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerFunctionControl * This,\n            /* [in] */ ULONG cbNewILMethodHeader,\n            /* [size_is][in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerFunctionControl * This,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        END_INTERFACE\n    } ICorProfilerFunctionControlVtbl;\n\n    interface ICorProfilerFunctionControl\n    {\n        CONST_VTBL struct ICorProfilerFunctionControlVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerFunctionControl_QueryInterface(This,riid,ppvObject) \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerFunctionControl_AddRef(This)    \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerFunctionControl_Release(This)   \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerFunctionControl_SetCodegenFlags(This,flags) \\\n    ( (This)->lpVtbl -> SetCodegenFlags(This,flags) )\n\n#define ICorProfilerFunctionControl_SetILFunctionBody(This,cbNewILMethodHeader,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,cbNewILMethodHeader,pbNewILMethodHeader) )\n\n#define ICorProfilerFunctionControl_SetILInstrumentedCodeMap(This,cILMapEntries,rgILMapEntries) \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,cILMapEntries,rgILMapEntries) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerFunctionControl_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo4_INTERFACE_DEFINED__\n#define __ICorProfilerInfo4_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo4 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"0d8fdcaa-6257-47bf-b1bf-94dac88466ee\")\n    ICorProfilerInfo4 : public ICorProfilerInfo3\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumThreads(\n            /* [out] */ ICorProfilerThreadEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE InitializeCurrentThread( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RequestReJIT(\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RequestRevert(\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeInfo3(\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionFromIP2(\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetReJITIDs(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILToNativeMapping2(\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumJITedFunctions2(\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectSize2(\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo4 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo4 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        END_INTERFACE\n    } ICorProfilerInfo4Vtbl;\n\n    interface ICorProfilerInfo4\n    {\n        CONST_VTBL struct ICorProfilerInfo4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo4_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo4_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo4_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo4_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo4_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo4_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo4_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo4_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo4_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo4_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo4_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo4_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo4_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo4_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo4_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo4_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo4_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo4_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo4_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo4_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo4_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo4_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo4_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo4_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo4_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo4_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo4_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo4_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo4_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo4_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo4_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo4_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo4_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo4_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo4_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo4_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo4_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo4_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo4_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo4_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo4_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo4_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo4_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo4_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo4_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo4_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo4_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo4_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo4_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo4_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo4_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo4_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo4_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo4_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo4_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo4_EnumJITedFunctions(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo4_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds)  \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo4_SetFunctionIDMapper2(This,pFunc,clientData)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo4_GetStringLayout2(This,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo4_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo4_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)   \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo4_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)    \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo4_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo4_EnumModules(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo4_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)   \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo4_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo4_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)    \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo4_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)    \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo4_EnumThreads(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo4_InitializeCurrentThread(This) \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo4_RequestReJIT(This,cFunctions,moduleIds,methodIds) \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo4_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo4_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo4_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo4_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)    \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo4_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo4_EnumJITedFunctions2(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo4_GetObjectSize2(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo5_INTERFACE_DEFINED__\n#define __ICorProfilerInfo5_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo5 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo5;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"07602928-CE38-4B83-81E7-74ADAF781214\")\n    ICorProfilerInfo5 : public ICorProfilerInfo4\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetEventMask2(\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetEventMask2(\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo5Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo5 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo5 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo5 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        END_INTERFACE\n    } ICorProfilerInfo5Vtbl;\n\n    interface ICorProfilerInfo5\n    {\n        CONST_VTBL struct ICorProfilerInfo5Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo5_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo5_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo5_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo5_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo5_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo5_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo5_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo5_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo5_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo5_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo5_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo5_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo5_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo5_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo5_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo5_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo5_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo5_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo5_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo5_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo5_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo5_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo5_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo5_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo5_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo5_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo5_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo5_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo5_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo5_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo5_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo5_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo5_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo5_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo5_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo5_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo5_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo5_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo5_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo5_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo5_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo5_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo5_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo5_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo5_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo5_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo5_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo5_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo5_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo5_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo5_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo5_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo5_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo5_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo5_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo5_EnumJITedFunctions(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo5_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds)  \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo5_SetFunctionIDMapper2(This,pFunc,clientData)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo5_GetStringLayout2(This,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo5_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo5_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)   \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo5_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)    \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo5_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo5_EnumModules(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo5_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)   \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo5_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo5_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)    \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo5_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)    \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo5_EnumThreads(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo5_InitializeCurrentThread(This) \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo5_RequestReJIT(This,cFunctions,moduleIds,methodIds) \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo5_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo5_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo5_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo5_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)    \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo5_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo5_EnumJITedFunctions2(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo5_GetObjectSize2(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo5_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)    \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo5_SetEventMask2(This,dwEventsLow,dwEventsHigh)  \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo5_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo6_INTERFACE_DEFINED__\n#define __ICorProfilerInfo6_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo6 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo6;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"F30A070D-BFFB-46A7-B1D8-8781EF7B698A\")\n    ICorProfilerInfo6 : public ICorProfilerInfo5\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumNgenModuleMethodsInliningThisMethod(\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo6Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo6 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo6 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo6 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        END_INTERFACE\n    } ICorProfilerInfo6Vtbl;\n\n    interface ICorProfilerInfo6\n    {\n        CONST_VTBL struct ICorProfilerInfo6Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo6_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo6_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo6_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo6_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo6_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo6_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo6_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo6_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo6_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo6_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo6_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo6_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo6_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo6_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo6_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo6_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo6_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo6_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo6_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo6_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo6_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo6_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo6_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo6_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo6_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo6_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo6_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo6_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo6_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo6_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo6_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo6_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo6_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo6_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo6_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo6_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo6_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo6_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo6_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo6_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo6_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo6_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo6_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo6_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo6_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo6_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo6_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo6_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo6_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo6_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo6_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo6_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo6_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo6_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo6_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo6_EnumJITedFunctions(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo6_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds)  \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo6_SetFunctionIDMapper2(This,pFunc,clientData)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo6_GetStringLayout2(This,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo6_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo6_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)   \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo6_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)    \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo6_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo6_EnumModules(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo6_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)   \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo6_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo6_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)    \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo6_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)    \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo6_EnumThreads(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo6_InitializeCurrentThread(This) \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo6_RequestReJIT(This,cFunctions,moduleIds,methodIds) \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo6_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo6_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo6_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo6_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)    \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo6_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo6_EnumJITedFunctions2(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo6_GetObjectSize2(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo6_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)    \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo6_SetEventMask2(This,dwEventsLow,dwEventsHigh)  \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo6_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo6_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo7_INTERFACE_DEFINED__\n#define __ICorProfilerInfo7_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo7 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo7;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"9AEECC0D-63E0-4187-8C00-E312F503F663\")\n    ICorProfilerInfo7 : public ICorProfilerInfo6\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ApplyMetaData(\n            /* [in] */ ModuleID moduleId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetInMemorySymbolsLength(\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ReadInMemorySymbols(\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo7Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo7 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo7 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(\n            ICorProfilerInfo7 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead);\n\n        END_INTERFACE\n    } ICorProfilerInfo7Vtbl;\n\n    interface ICorProfilerInfo7\n    {\n        CONST_VTBL struct ICorProfilerInfo7Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo7_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo7_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo7_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo7_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo7_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo7_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo7_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo7_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo7_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo7_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo7_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo7_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo7_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo7_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo7_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo7_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo7_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo7_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo7_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo7_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo7_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo7_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo7_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo7_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo7_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo7_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo7_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo7_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo7_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo7_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo7_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo7_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo7_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo7_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo7_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo7_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo7_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo7_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo7_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo7_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo7_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo7_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo7_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo7_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo7_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo7_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo7_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo7_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo7_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo7_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo7_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo7_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo7_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo7_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo7_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo7_EnumJITedFunctions(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo7_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds)  \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo7_SetFunctionIDMapper2(This,pFunc,clientData)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo7_GetStringLayout2(This,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo7_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo7_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)   \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo7_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)    \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo7_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo7_EnumModules(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo7_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)   \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo7_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo7_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)    \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo7_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)    \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo7_EnumThreads(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo7_InitializeCurrentThread(This) \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo7_RequestReJIT(This,cFunctions,moduleIds,methodIds) \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo7_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo7_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo7_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo7_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)    \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo7_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo7_EnumJITedFunctions2(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo7_GetObjectSize2(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo7_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)    \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo7_SetEventMask2(This,dwEventsLow,dwEventsHigh)  \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo7_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n\n#define ICorProfilerInfo7_ApplyMetaData(This,moduleId)  \\\n    ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )\n\n#define ICorProfilerInfo7_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \\\n    ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )\n\n#define ICorProfilerInfo7_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead)  \\\n    ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo7_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo8_INTERFACE_DEFINED__\n#define __ICorProfilerInfo8_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo8 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo8;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"C5AC80A6-782E-4716-8044-39598C60CFBF\")\n    ICorProfilerInfo8 : public ICorProfilerInfo7\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsFunctionDynamic(\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *isDynamic) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFunctionFromIP3(\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *functionId,\n            /* [out] */ ReJITID *pReJitId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDynamicFunctionInfo(\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ModuleID *moduleId,\n            /* [out] */ PCCOR_SIGNATURE *ppvSig,\n            /* [out] */ ULONG *pbSig,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [out] */ WCHAR wszName[  ]) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo8Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo8 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo8 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *isDynamic);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *functionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )(\n            ICorProfilerInfo8 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ModuleID *moduleId,\n            /* [out] */ PCCOR_SIGNATURE *ppvSig,\n            /* [out] */ ULONG *pbSig,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [out] */ WCHAR wszName[  ]);\n\n        END_INTERFACE\n    } ICorProfilerInfo8Vtbl;\n\n    interface ICorProfilerInfo8\n    {\n        CONST_VTBL struct ICorProfilerInfo8Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo8_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo8_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo8_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo8_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo8_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo8_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo8_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo8_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo8_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo8_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo8_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo8_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo8_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo8_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo8_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo8_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo8_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo8_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo8_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo8_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo8_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo8_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo8_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo8_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo8_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo8_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo8_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo8_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo8_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo8_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo8_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo8_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo8_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo8_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo8_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo8_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo8_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo8_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo8_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo8_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo8_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo8_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo8_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo8_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo8_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo8_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo8_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo8_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo8_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo8_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo8_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo8_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo8_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo8_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo8_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo8_EnumJITedFunctions(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo8_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds)  \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo8_SetFunctionIDMapper2(This,pFunc,clientData)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo8_GetStringLayout2(This,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo8_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo8_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)   \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo8_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)    \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo8_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo8_EnumModules(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo8_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)   \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo8_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo8_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)    \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo8_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)    \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo8_EnumThreads(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo8_InitializeCurrentThread(This) \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo8_RequestReJIT(This,cFunctions,moduleIds,methodIds) \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo8_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo8_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo8_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo8_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)    \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo8_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo8_EnumJITedFunctions2(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo8_GetObjectSize2(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo8_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)    \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo8_SetEventMask2(This,dwEventsLow,dwEventsHigh)  \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo8_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n\n#define ICorProfilerInfo8_ApplyMetaData(This,moduleId)  \\\n    ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )\n\n#define ICorProfilerInfo8_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \\\n    ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )\n\n#define ICorProfilerInfo8_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead)  \\\n    ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )\n\n\n#define ICorProfilerInfo8_IsFunctionDynamic(This,functionId,isDynamic)  \\\n    ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )\n\n#define ICorProfilerInfo8_GetFunctionFromIP3(This,ip,functionId,pReJitId)   \\\n    ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )\n\n#define ICorProfilerInfo8_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName)    \\\n    ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo8_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo9_INTERFACE_DEFINED__\n#define __ICorProfilerInfo9_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo9 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo9;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"008170DB-F8CC-4796-9A51-DC8AA0B47012\")\n    ICorProfilerInfo9 : public ICorProfilerInfo8\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetNativeCodeStartAddresses(\n            FunctionID functionID,\n            ReJITID reJitId,\n            ULONG32 cCodeStartAddresses,\n            ULONG32 *pcCodeStartAddresses,\n            UINT_PTR codeStartAddresses[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILToNativeMapping3(\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cMap,\n            ULONG32 *pcMap,\n            COR_DEBUG_IL_TO_NATIVE_MAP map[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeInfo4(\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cCodeInfos,\n            ULONG32 *pcCodeInfos,\n            COR_PRF_CODE_INFO codeInfos[  ]) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo9Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo9 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo9 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo9 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *isDynamic);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *functionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )(\n            ICorProfilerInfo9 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ModuleID *moduleId,\n            /* [out] */ PCCOR_SIGNATURE *ppvSig,\n            /* [out] */ ULONG *pbSig,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [out] */ WCHAR wszName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )(\n            ICorProfilerInfo9 * This,\n            FunctionID functionID,\n            ReJITID reJitId,\n            ULONG32 cCodeStartAddresses,\n            ULONG32 *pcCodeStartAddresses,\n            UINT_PTR codeStartAddresses[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )(\n            ICorProfilerInfo9 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cMap,\n            ULONG32 *pcMap,\n            COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )(\n            ICorProfilerInfo9 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cCodeInfos,\n            ULONG32 *pcCodeInfos,\n            COR_PRF_CODE_INFO codeInfos[  ]);\n\n        END_INTERFACE\n    } ICorProfilerInfo9Vtbl;\n\n    interface ICorProfilerInfo9\n    {\n        CONST_VTBL struct ICorProfilerInfo9Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo9_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo9_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo9_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo9_GetClassFromObject(This,objectId,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo9_GetClassFromToken(This,moduleId,typeDef,pClassId) \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo9_GetCodeInfo(This,functionId,pStart,pcSize)    \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo9_GetEventMask(This,pdwEvents)  \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo9_GetFunctionFromIP(This,ip,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo9_GetFunctionFromToken(This,moduleId,token,pFunctionId) \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo9_GetHandleFromThread(This,threadId,phThread)   \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo9_GetObjectSize(This,objectId,pcSize)   \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo9_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank)  \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo9_GetThreadInfo(This,threadId,pdwWin32ThreadId) \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo9_GetCurrentThreadID(This,pThreadId)    \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo9_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo9_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)    \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo9_SetEventMask(This,dwEvents)   \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo9_SetFunctionIDMapper(This,pFunc)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo9_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo9_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)    \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo9_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)   \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo9_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)    \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo9_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)    \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo9_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo9_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo9_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)   \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo9_SetFunctionReJIT(This,functionId) \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo9_ForceGC(This) \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo9_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries)  \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo9_GetInprocInspectionInterface(This,ppicd)  \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo9_GetInprocInspectionIThisThread(This,ppicd)    \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo9_GetThreadContext(This,threadId,pContextId)    \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo9_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo9_EndInprocDebugging(This,dwProfilerContext)    \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo9_GetILToNativeMapping(This,functionId,cMap,pcMap,map)  \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo9_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)    \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo9_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo9_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)   \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo9_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo9_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo9_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo9_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)   \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo9_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo9_EnumModuleFrozenObjects(This,moduleID,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo9_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)    \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo9_GetBoxClassLayout(This,classId,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo9_GetThreadAppDomain(This,threadId,pAppDomainId)    \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo9_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)    \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo9_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo9_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)    \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo9_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo9_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)    \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo9_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo9_GetObjectGeneration(This,objectId,range)  \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo9_GetNotifiedExceptionClauseInfo(This,pinfo)    \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo9_EnumJITedFunctions(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo9_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds)  \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo9_SetFunctionIDMapper2(This,pFunc,clientData)   \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo9_GetStringLayout2(This,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo9_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo)  \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo9_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)   \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo9_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)    \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo9_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo9_EnumModules(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo9_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)   \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo9_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo9_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)    \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo9_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)    \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo9_EnumThreads(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo9_InitializeCurrentThread(This) \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo9_RequestReJIT(This,cFunctions,moduleIds,methodIds) \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo9_RequestRevert(This,cFunctions,moduleIds,methodIds,status) \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo9_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)    \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo9_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo9_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)    \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo9_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo9_EnumJITedFunctions2(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo9_GetObjectSize2(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo9_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)    \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo9_SetEventMask2(This,dwEventsLow,dwEventsHigh)  \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo9_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n\n#define ICorProfilerInfo9_ApplyMetaData(This,moduleId)  \\\n    ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )\n\n#define ICorProfilerInfo9_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) \\\n    ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )\n\n#define ICorProfilerInfo9_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead)  \\\n    ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )\n\n\n#define ICorProfilerInfo9_IsFunctionDynamic(This,functionId,isDynamic)  \\\n    ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )\n\n#define ICorProfilerInfo9_GetFunctionFromIP3(This,ip,functionId,pReJitId)   \\\n    ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )\n\n#define ICorProfilerInfo9_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName)    \\\n    ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )\n\n\n#define ICorProfilerInfo9_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses)  \\\n    ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) )\n\n#define ICorProfilerInfo9_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map)    \\\n    ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) )\n\n#define ICorProfilerInfo9_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo9_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo10_INTERFACE_DEFINED__\n#define __ICorProfilerInfo10_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo10 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo10;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"2F1B5152-C869-40C9-AA5F-3ABE026BD720\")\n    ICorProfilerInfo10 : public ICorProfilerInfo9\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumerateObjectReferences(\n            ObjectID objectId,\n            ObjectReferenceCallback callback,\n            void *clientData) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsFrozenObject(\n            ObjectID objectId,\n            BOOL *pbFrozen) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetLOHObjectSizeThreshold(\n            DWORD *pThreshold) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE RequestReJITWithInliners(\n            /* [in] */ DWORD dwRejitFlags,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SuspendRuntime( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE ResumeRuntime( void) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo10Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo10 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo10 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *isDynamic);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *functionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ModuleID *moduleId,\n            /* [out] */ PCCOR_SIGNATURE *ppvSig,\n            /* [out] */ ULONG *pbSig,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [out] */ WCHAR wszName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )(\n            ICorProfilerInfo10 * This,\n            FunctionID functionID,\n            ReJITID reJitId,\n            ULONG32 cCodeStartAddresses,\n            ULONG32 *pcCodeStartAddresses,\n            UINT_PTR codeStartAddresses[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )(\n            ICorProfilerInfo10 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cMap,\n            ULONG32 *pcMap,\n            COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )(\n            ICorProfilerInfo10 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cCodeInfos,\n            ULONG32 *pcCodeInfos,\n            COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )(\n            ICorProfilerInfo10 * This,\n            ObjectID objectId,\n            ObjectReferenceCallback callback,\n            void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )(\n            ICorProfilerInfo10 * This,\n            ObjectID objectId,\n            BOOL *pbFrozen);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )(\n            ICorProfilerInfo10 * This,\n            DWORD *pThreshold);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )(\n            ICorProfilerInfo10 * This,\n            /* [in] */ DWORD dwRejitFlags,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )(\n            ICorProfilerInfo10 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )(\n            ICorProfilerInfo10 * This);\n\n        END_INTERFACE\n    } ICorProfilerInfo10Vtbl;\n\n    interface ICorProfilerInfo10\n    {\n        CONST_VTBL struct ICorProfilerInfo10Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo10_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo10_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo10_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo10_GetClassFromObject(This,objectId,pClassId)   \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo10_GetClassFromToken(This,moduleId,typeDef,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo10_GetCodeInfo(This,functionId,pStart,pcSize)   \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo10_GetEventMask(This,pdwEvents) \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo10_GetFunctionFromIP(This,ip,pFunctionId)   \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo10_GetFunctionFromToken(This,moduleId,token,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo10_GetHandleFromThread(This,threadId,phThread)  \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo10_GetObjectSize(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo10_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo10_GetThreadInfo(This,threadId,pdwWin32ThreadId)    \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo10_GetCurrentThreadID(This,pThreadId)   \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo10_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo10_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo10_SetEventMask(This,dwEvents)  \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo10_SetFunctionIDMapper(This,pFunc)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo10_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken)    \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo10_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)   \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo10_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)  \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo10_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)   \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo10_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)   \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo10_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader)    \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo10_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId)    \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo10_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)  \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo10_SetFunctionReJIT(This,functionId)    \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo10_ForceGC(This)    \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo10_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo10_GetInprocInspectionInterface(This,ppicd) \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo10_GetInprocInspectionIThisThread(This,ppicd)   \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo10_GetThreadContext(This,threadId,pContextId)   \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo10_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext)    \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo10_EndInprocDebugging(This,dwProfilerContext)   \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo10_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo10_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)   \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall)    \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo10_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo10_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo10_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize)    \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo10_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo10_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo10_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)  \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo10_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID)    \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo10_EnumModuleFrozenObjects(This,moduleID,ppEnum)    \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo10_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)   \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo10_GetBoxClassLayout(This,classId,pBufferOffset)    \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo10_GetThreadAppDomain(This,threadId,pAppDomainId)   \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo10_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)   \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo10_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo10_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo10_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo10_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)   \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo10_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges)    \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo10_GetObjectGeneration(This,objectId,range) \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo10_GetNotifiedExceptionClauseInfo(This,pinfo)   \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo10_EnumJITedFunctions(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo10_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo10_SetFunctionIDMapper2(This,pFunc,clientData)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo10_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo10_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo10_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo10_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)   \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo10_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo10_EnumModules(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo10_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)  \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo10_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo10_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)   \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo10_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)   \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo10_EnumThreads(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo10_InitializeCurrentThread(This)    \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo10_RequestReJIT(This,cFunctions,moduleIds,methodIds)    \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo10_RequestRevert(This,cFunctions,moduleIds,methodIds,status)    \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo10_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo10_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo10_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)   \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo10_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map)    \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo10_EnumJITedFunctions2(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo10_GetObjectSize2(This,objectId,pcSize) \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo10_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)   \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo10_SetEventMask2(This,dwEventsLow,dwEventsHigh) \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo10_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n\n#define ICorProfilerInfo10_ApplyMetaData(This,moduleId) \\\n    ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )\n\n#define ICorProfilerInfo10_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes)    \\\n    ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )\n\n#define ICorProfilerInfo10_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \\\n    ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )\n\n\n#define ICorProfilerInfo10_IsFunctionDynamic(This,functionId,isDynamic) \\\n    ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )\n\n#define ICorProfilerInfo10_GetFunctionFromIP3(This,ip,functionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )\n\n#define ICorProfilerInfo10_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName)   \\\n    ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )\n\n\n#define ICorProfilerInfo10_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \\\n    ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) )\n\n#define ICorProfilerInfo10_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map)   \\\n    ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) )\n\n#define ICorProfilerInfo10_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos)  \\\n    ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) )\n\n\n#define ICorProfilerInfo10_EnumerateObjectReferences(This,objectId,callback,clientData) \\\n    ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) )\n\n#define ICorProfilerInfo10_IsFrozenObject(This,objectId,pbFrozen)   \\\n    ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) )\n\n#define ICorProfilerInfo10_GetLOHObjectSizeThreshold(This,pThreshold)   \\\n    ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) )\n\n#define ICorProfilerInfo10_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds)   \\\n    ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo10_SuspendRuntime(This) \\\n    ( (This)->lpVtbl -> SuspendRuntime(This) )\n\n#define ICorProfilerInfo10_ResumeRuntime(This)  \\\n    ( (This)->lpVtbl -> ResumeRuntime(This) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo10_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo11_INTERFACE_DEFINED__\n#define __ICorProfilerInfo11_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo11 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo11;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"06398876-8987-4154-B621-40A00D6E4D04\")\n    ICorProfilerInfo11 : public ICorProfilerInfo10\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetEnvironmentVariable(\n            /* [string][in] */ const WCHAR *szName,\n            /* [in] */ ULONG cchValue,\n            /* [out] */ ULONG *pcchValue,\n            /* [annotation][out] */\n            _Out_writes_to_(cchValue, *pcchValue)  WCHAR szValue[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE SetEnvironmentVariable(\n            /* [string][in] */ const WCHAR *szName,\n            /* [string][in] */ const WCHAR *szValue) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo11Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo11 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo11 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *isDynamic);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *functionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ModuleID *moduleId,\n            /* [out] */ PCCOR_SIGNATURE *ppvSig,\n            /* [out] */ ULONG *pbSig,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [out] */ WCHAR wszName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )(\n            ICorProfilerInfo11 * This,\n            FunctionID functionID,\n            ReJITID reJitId,\n            ULONG32 cCodeStartAddresses,\n            ULONG32 *pcCodeStartAddresses,\n            UINT_PTR codeStartAddresses[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )(\n            ICorProfilerInfo11 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cMap,\n            ULONG32 *pcMap,\n            COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )(\n            ICorProfilerInfo11 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cCodeInfos,\n            ULONG32 *pcCodeInfos,\n            COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )(\n            ICorProfilerInfo11 * This,\n            ObjectID objectId,\n            ObjectReferenceCallback callback,\n            void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )(\n            ICorProfilerInfo11 * This,\n            ObjectID objectId,\n            BOOL *pbFrozen);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )(\n            ICorProfilerInfo11 * This,\n            DWORD *pThreshold);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )(\n            ICorProfilerInfo11 * This,\n            /* [in] */ DWORD dwRejitFlags,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )(\n            ICorProfilerInfo11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )(\n            ICorProfilerInfo11 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )(\n            ICorProfilerInfo11 * This,\n            /* [string][in] */ const WCHAR *szName,\n            /* [in] */ ULONG cchValue,\n            /* [out] */ ULONG *pcchValue,\n            /* [annotation][out] */\n            _Out_writes_to_(cchValue, *pcchValue)  WCHAR szValue[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )(\n            ICorProfilerInfo11 * This,\n            /* [string][in] */ const WCHAR *szName,\n            /* [string][in] */ const WCHAR *szValue);\n\n        END_INTERFACE\n    } ICorProfilerInfo11Vtbl;\n\n    interface ICorProfilerInfo11\n    {\n        CONST_VTBL struct ICorProfilerInfo11Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo11_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo11_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo11_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo11_GetClassFromObject(This,objectId,pClassId)   \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo11_GetClassFromToken(This,moduleId,typeDef,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo11_GetCodeInfo(This,functionId,pStart,pcSize)   \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo11_GetEventMask(This,pdwEvents) \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo11_GetFunctionFromIP(This,ip,pFunctionId)   \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo11_GetFunctionFromToken(This,moduleId,token,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo11_GetHandleFromThread(This,threadId,phThread)  \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo11_GetObjectSize(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo11_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo11_GetThreadInfo(This,threadId,pdwWin32ThreadId)    \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo11_GetCurrentThreadID(This,pThreadId)   \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo11_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo11_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo11_SetEventMask(This,dwEvents)  \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo11_SetFunctionIDMapper(This,pFunc)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo11_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken)    \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo11_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)   \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo11_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)  \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo11_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)   \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo11_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)   \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo11_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader)    \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo11_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId)    \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo11_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)  \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo11_SetFunctionReJIT(This,functionId)    \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo11_ForceGC(This)    \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo11_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo11_GetInprocInspectionInterface(This,ppicd) \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo11_GetInprocInspectionIThisThread(This,ppicd)   \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo11_GetThreadContext(This,threadId,pContextId)   \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo11_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext)    \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo11_EndInprocDebugging(This,dwProfilerContext)   \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo11_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo11_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)   \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall)    \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo11_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo11_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo11_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize)    \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo11_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo11_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo11_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)  \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo11_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID)    \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo11_EnumModuleFrozenObjects(This,moduleID,ppEnum)    \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo11_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)   \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo11_GetBoxClassLayout(This,classId,pBufferOffset)    \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo11_GetThreadAppDomain(This,threadId,pAppDomainId)   \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo11_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)   \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo11_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo11_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo11_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo11_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)   \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo11_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges)    \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo11_GetObjectGeneration(This,objectId,range) \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo11_GetNotifiedExceptionClauseInfo(This,pinfo)   \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo11_EnumJITedFunctions(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo11_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo11_SetFunctionIDMapper2(This,pFunc,clientData)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo11_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo11_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo11_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo11_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)   \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo11_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo11_EnumModules(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo11_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)  \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo11_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo11_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)   \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo11_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)   \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo11_EnumThreads(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo11_InitializeCurrentThread(This)    \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo11_RequestReJIT(This,cFunctions,moduleIds,methodIds)    \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo11_RequestRevert(This,cFunctions,moduleIds,methodIds,status)    \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo11_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo11_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo11_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)   \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo11_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map)    \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo11_EnumJITedFunctions2(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo11_GetObjectSize2(This,objectId,pcSize) \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo11_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)   \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo11_SetEventMask2(This,dwEventsLow,dwEventsHigh) \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo11_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n\n#define ICorProfilerInfo11_ApplyMetaData(This,moduleId) \\\n    ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )\n\n#define ICorProfilerInfo11_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes)    \\\n    ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )\n\n#define ICorProfilerInfo11_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \\\n    ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )\n\n\n#define ICorProfilerInfo11_IsFunctionDynamic(This,functionId,isDynamic) \\\n    ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )\n\n#define ICorProfilerInfo11_GetFunctionFromIP3(This,ip,functionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )\n\n#define ICorProfilerInfo11_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName)   \\\n    ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )\n\n\n#define ICorProfilerInfo11_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \\\n    ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) )\n\n#define ICorProfilerInfo11_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map)   \\\n    ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) )\n\n#define ICorProfilerInfo11_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos)  \\\n    ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) )\n\n\n#define ICorProfilerInfo11_EnumerateObjectReferences(This,objectId,callback,clientData) \\\n    ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) )\n\n#define ICorProfilerInfo11_IsFrozenObject(This,objectId,pbFrozen)   \\\n    ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) )\n\n#define ICorProfilerInfo11_GetLOHObjectSizeThreshold(This,pThreshold)   \\\n    ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) )\n\n#define ICorProfilerInfo11_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds)   \\\n    ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo11_SuspendRuntime(This) \\\n    ( (This)->lpVtbl -> SuspendRuntime(This) )\n\n#define ICorProfilerInfo11_ResumeRuntime(This)  \\\n    ( (This)->lpVtbl -> ResumeRuntime(This) )\n\n\n#define ICorProfilerInfo11_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue)   \\\n    ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) )\n\n#define ICorProfilerInfo11_SetEnvironmentVariable(This,szName,szValue)  \\\n    ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo11_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo12_INTERFACE_DEFINED__\n#define __ICorProfilerInfo12_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo12 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo12;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"27b24ccd-1cb1-47c5-96ee-98190dc30959\")\n    ICorProfilerInfo12 : public ICorProfilerInfo11\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EventPipeStartSession(\n            /* [in] */ UINT32 cProviderConfigs,\n            /* [size_is][in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG pProviderConfigs[  ],\n            /* [in] */ BOOL requestRundown,\n            /* [out] */ EVENTPIPE_SESSION *pSession) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EventPipeAddProviderToSession(\n            /* [in] */ EVENTPIPE_SESSION session,\n            /* [in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EventPipeStopSession(\n            /* [in] */ EVENTPIPE_SESSION session) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EventPipeCreateProvider(\n            /* [string][in] */ const WCHAR *providerName,\n            /* [out] */ EVENTPIPE_PROVIDER *pProvider) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EventPipeGetProviderInfo(\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR providerName[  ]) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EventPipeDefineEvent(\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [string][in] */ const WCHAR *eventName,\n            /* [in] */ UINT32 eventID,\n            /* [in] */ UINT64 keywords,\n            /* [in] */ UINT32 eventVersion,\n            /* [in] */ UINT32 level,\n            /* [in] */ UINT8 opcode,\n            /* [in] */ BOOL needStack,\n            /* [in] */ UINT32 cParamDescs,\n            /* [size_is][in] */ COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[  ],\n            /* [out] */ EVENTPIPE_EVENT *pEvent) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EventPipeWriteEvent(\n            /* [in] */ EVENTPIPE_EVENT event,\n            /* [in] */ UINT32 cData,\n            /* [size_is][in] */ COR_PRF_EVENT_DATA data[  ],\n            /* [in] */ LPCGUID pActivityId,\n            /* [in] */ LPCGUID pRelatedActivityId) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo12Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo12 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo12 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo12 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo12 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo12 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *isDynamic);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *functionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ModuleID *moduleId,\n            /* [out] */ PCCOR_SIGNATURE *ppvSig,\n            /* [out] */ ULONG *pbSig,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [out] */ WCHAR wszName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )(\n            ICorProfilerInfo12 * This,\n            FunctionID functionID,\n            ReJITID reJitId,\n            ULONG32 cCodeStartAddresses,\n            ULONG32 *pcCodeStartAddresses,\n            UINT_PTR codeStartAddresses[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )(\n            ICorProfilerInfo12 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cMap,\n            ULONG32 *pcMap,\n            COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )(\n            ICorProfilerInfo12 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cCodeInfos,\n            ULONG32 *pcCodeInfos,\n            COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )(\n            ICorProfilerInfo12 * This,\n            ObjectID objectId,\n            ObjectReferenceCallback callback,\n            void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )(\n            ICorProfilerInfo12 * This,\n            ObjectID objectId,\n            BOOL *pbFrozen);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )(\n            ICorProfilerInfo12 * This,\n            DWORD *pThreshold);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ DWORD dwRejitFlags,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )(\n            ICorProfilerInfo12 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )(\n            ICorProfilerInfo12 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )(\n            ICorProfilerInfo12 * This,\n            /* [string][in] */ const WCHAR *szName,\n            /* [in] */ ULONG cchValue,\n            /* [out] */ ULONG *pcchValue,\n            /* [annotation][out] */\n            _Out_writes_to_(cchValue, *pcchValue)  WCHAR szValue[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )(\n            ICorProfilerInfo12 * This,\n            /* [string][in] */ const WCHAR *szName,\n            /* [string][in] */ const WCHAR *szValue);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeStartSession )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ UINT32 cProviderConfigs,\n            /* [size_is][in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG pProviderConfigs[  ],\n            /* [in] */ BOOL requestRundown,\n            /* [out] */ EVENTPIPE_SESSION *pSession);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeAddProviderToSession )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ EVENTPIPE_SESSION session,\n            /* [in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeStopSession )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ EVENTPIPE_SESSION session);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider )(\n            ICorProfilerInfo12 * This,\n            /* [string][in] */ const WCHAR *providerName,\n            /* [out] */ EVENTPIPE_PROVIDER *pProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeGetProviderInfo )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR providerName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeDefineEvent )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [string][in] */ const WCHAR *eventName,\n            /* [in] */ UINT32 eventID,\n            /* [in] */ UINT64 keywords,\n            /* [in] */ UINT32 eventVersion,\n            /* [in] */ UINT32 level,\n            /* [in] */ UINT8 opcode,\n            /* [in] */ BOOL needStack,\n            /* [in] */ UINT32 cParamDescs,\n            /* [size_is][in] */ COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[  ],\n            /* [out] */ EVENTPIPE_EVENT *pEvent);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeWriteEvent )(\n            ICorProfilerInfo12 * This,\n            /* [in] */ EVENTPIPE_EVENT event,\n            /* [in] */ UINT32 cData,\n            /* [size_is][in] */ COR_PRF_EVENT_DATA data[  ],\n            /* [in] */ LPCGUID pActivityId,\n            /* [in] */ LPCGUID pRelatedActivityId);\n\n        END_INTERFACE\n    } ICorProfilerInfo12Vtbl;\n\n    interface ICorProfilerInfo12\n    {\n        CONST_VTBL struct ICorProfilerInfo12Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo12_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo12_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo12_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo12_GetClassFromObject(This,objectId,pClassId)   \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo12_GetClassFromToken(This,moduleId,typeDef,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo12_GetCodeInfo(This,functionId,pStart,pcSize)   \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo12_GetEventMask(This,pdwEvents) \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo12_GetFunctionFromIP(This,ip,pFunctionId)   \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo12_GetFunctionFromToken(This,moduleId,token,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo12_GetHandleFromThread(This,threadId,phThread)  \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo12_GetObjectSize(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo12_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo12_GetThreadInfo(This,threadId,pdwWin32ThreadId)    \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo12_GetCurrentThreadID(This,pThreadId)   \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo12_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo12_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo12_SetEventMask(This,dwEvents)  \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo12_SetFunctionIDMapper(This,pFunc)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo12_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken)    \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo12_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)   \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo12_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)  \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo12_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)   \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo12_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)   \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo12_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader)    \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo12_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId)    \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo12_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)  \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo12_SetFunctionReJIT(This,functionId)    \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo12_ForceGC(This)    \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo12_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo12_GetInprocInspectionInterface(This,ppicd) \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo12_GetInprocInspectionIThisThread(This,ppicd)   \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo12_GetThreadContext(This,threadId,pContextId)   \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo12_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext)    \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo12_EndInprocDebugging(This,dwProfilerContext)   \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo12_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo12_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)   \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall)    \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo12_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo12_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo12_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize)    \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo12_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo12_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo12_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)  \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo12_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID)    \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo12_EnumModuleFrozenObjects(This,moduleID,ppEnum)    \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo12_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)   \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo12_GetBoxClassLayout(This,classId,pBufferOffset)    \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo12_GetThreadAppDomain(This,threadId,pAppDomainId)   \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo12_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)   \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo12_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo12_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo12_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo12_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)   \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo12_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges)    \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo12_GetObjectGeneration(This,objectId,range) \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo12_GetNotifiedExceptionClauseInfo(This,pinfo)   \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo12_EnumJITedFunctions(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo12_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo12_SetFunctionIDMapper2(This,pFunc,clientData)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo12_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo12_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo12_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo12_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)   \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo12_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo12_EnumModules(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo12_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)  \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo12_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo12_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)   \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo12_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)   \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo12_EnumThreads(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo12_InitializeCurrentThread(This)    \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo12_RequestReJIT(This,cFunctions,moduleIds,methodIds)    \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo12_RequestRevert(This,cFunctions,moduleIds,methodIds,status)    \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo12_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo12_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo12_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)   \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo12_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map)    \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo12_EnumJITedFunctions2(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo12_GetObjectSize2(This,objectId,pcSize) \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo12_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)   \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo12_SetEventMask2(This,dwEventsLow,dwEventsHigh) \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo12_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n\n#define ICorProfilerInfo12_ApplyMetaData(This,moduleId) \\\n    ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )\n\n#define ICorProfilerInfo12_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes)    \\\n    ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )\n\n#define ICorProfilerInfo12_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \\\n    ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )\n\n\n#define ICorProfilerInfo12_IsFunctionDynamic(This,functionId,isDynamic) \\\n    ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )\n\n#define ICorProfilerInfo12_GetFunctionFromIP3(This,ip,functionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )\n\n#define ICorProfilerInfo12_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName)   \\\n    ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )\n\n\n#define ICorProfilerInfo12_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \\\n    ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) )\n\n#define ICorProfilerInfo12_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map)   \\\n    ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) )\n\n#define ICorProfilerInfo12_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos)  \\\n    ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) )\n\n\n#define ICorProfilerInfo12_EnumerateObjectReferences(This,objectId,callback,clientData) \\\n    ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) )\n\n#define ICorProfilerInfo12_IsFrozenObject(This,objectId,pbFrozen)   \\\n    ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) )\n\n#define ICorProfilerInfo12_GetLOHObjectSizeThreshold(This,pThreshold)   \\\n    ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) )\n\n#define ICorProfilerInfo12_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds)   \\\n    ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo12_SuspendRuntime(This) \\\n    ( (This)->lpVtbl -> SuspendRuntime(This) )\n\n#define ICorProfilerInfo12_ResumeRuntime(This)  \\\n    ( (This)->lpVtbl -> ResumeRuntime(This) )\n\n\n#define ICorProfilerInfo12_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue)   \\\n    ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) )\n\n#define ICorProfilerInfo12_SetEnvironmentVariable(This,szName,szValue)  \\\n    ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) )\n\n\n#define ICorProfilerInfo12_EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession)    \\\n    ( (This)->lpVtbl -> EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) )\n\n#define ICorProfilerInfo12_EventPipeAddProviderToSession(This,session,providerConfig)   \\\n    ( (This)->lpVtbl -> EventPipeAddProviderToSession(This,session,providerConfig) )\n\n#define ICorProfilerInfo12_EventPipeStopSession(This,session)   \\\n    ( (This)->lpVtbl -> EventPipeStopSession(This,session) )\n\n#define ICorProfilerInfo12_EventPipeCreateProvider(This,providerName,pProvider) \\\n    ( (This)->lpVtbl -> EventPipeCreateProvider(This,providerName,pProvider) )\n\n#define ICorProfilerInfo12_EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName)    \\\n    ( (This)->lpVtbl -> EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) )\n\n#define ICorProfilerInfo12_EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent)    \\\n    ( (This)->lpVtbl -> EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) )\n\n#define ICorProfilerInfo12_EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId)    \\\n    ( (This)->lpVtbl -> EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo12_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerInfo13_INTERFACE_DEFINED__\n#define __ICorProfilerInfo13_INTERFACE_DEFINED__\n\n/* interface ICorProfilerInfo13 */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerInfo13;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"6e6c7ee2-0701-4ec2-9d29-2e8733b66934\")\n    ICorProfilerInfo13 : public ICorProfilerInfo12\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreateHandle(\n            /* [in] */  ObjectID object,\n            /* [in] */  COR_PRF_HANDLE_TYPE type,\n            /* [out] */ ObjectHandleID* pHandle) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE DestroyHandle(\n            /* [in] */ ObjectHandleID handle) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectIDFromHandle(\n            /* [in] */ ObjectHandleID handle,\n            /* [out] */ ObjectID* pObject) = 0;\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerInfo13Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerInfo13 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerInfo13 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromObject )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromToken )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdTypeDef typeDef,\n            /* [out] */ ClassID *pClassId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ LPCBYTE *pStart,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ DWORD *pdwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromToken )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdToken token,\n            /* [out] */ FunctionID *pFunctionId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleFromThread )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ HANDLE *phThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ ULONG *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *IsArrayClass )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ CorElementType *pBaseElemType,\n            /* [out] */ ClassID *pBaseClassId,\n            /* [out] */ ULONG *pcRank);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ DWORD *pdwWin32ThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ ThreadID *pThreadId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ DWORD dwEvents);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionEnter *pFuncEnter,\n            /* [in] */ FunctionLeave *pFuncLeave,\n            /* [in] */ FunctionTailcall *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionIDMapper *pFunc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndMetaDataFromFunction )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppImport,\n            /* [out] */ mdToken *pToken);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleMetaData )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD dwOpenFlags,\n            /* [in] */ REFIID riid,\n            /* [out] */ IUnknown **ppOut);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBody )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodId,\n            /* [out] */ LPCBYTE *ppMethodHeader,\n            /* [out] */ ULONG *pcbMethodSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILFunctionBodyAllocator )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ IMethodMalloc **ppMalloc);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILFunctionBody )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ mdMethodDef methodid,\n            /* [in] */ LPCBYTE pbNewILMethodHeader);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ ProcessID *pProcessId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ AssemblyID assemblyId,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AppDomainID *pAppDomainId,\n            /* [out] */ ModuleID *pModuleId);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionReJIT )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId);\n\n        HRESULT ( STDMETHODCALLTYPE *ForceGC )(\n            ICorProfilerInfo13 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *SetILInstrumentedCodeMap )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ BOOL fStartJit,\n            /* [in] */ ULONG cILMapEntries,\n            /* [size_is][in] */ COR_IL_MAP rgILMapEntries[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionInterface )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInprocInspectionIThisThread )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ IUnknown **ppicd);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ ContextID *pContextId);\n\n        HRESULT ( STDMETHODCALLTYPE *BeginInprocDebugging )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ BOOL fThisThreadOnly,\n            /* [out] */ DWORD *pdwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *EndInprocDebugging )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ DWORD dwProfilerContext);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *DoStackSnapshot )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ThreadID thread,\n            /* [in] */ StackSnapshotCallback *callback,\n            /* [in] */ ULONG32 infoFlags,\n            /* [in] */ void *clientData,\n            /* [size_is][in] */ BYTE context[  ],\n            /* [in] */ ULONG32 contextSize);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionEnter2 *pFuncEnter,\n            /* [in] */ FunctionLeave2 *pFuncLeave,\n            /* [in] */ FunctionTailcall2 *pFuncTailcall);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionInfo2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID funcId,\n            /* [in] */ COR_PRF_FRAME_INFO frameInfo,\n            /* [out] */ ClassID *pClassId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdToken *pToken,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [out] */ ULONG32 *pcTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ ULONG *pBufferLengthOffset,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassLayout )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classID,\n            /* [out][in] */ COR_FIELD_OFFSET rFieldOffset[  ],\n            /* [in] */ ULONG cFieldOffset,\n            /* [out] */ ULONG *pcFieldOffset,\n            /* [out] */ ULONG *pulClassSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassIDInfo2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ModuleID *pModuleId,\n            /* [out] */ mdTypeDef *pTypeDefToken,\n            /* [out] */ ClassID *pParentClassId,\n            /* [in] */ ULONG32 cNumTypeArgs,\n            /* [out] */ ULONG32 *pcNumTypeArgs,\n            /* [out] */ ClassID typeArgs[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClassFromTokenAndTypeArgs )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdTypeDef typeDef,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ ClassID *pClassID);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromTokenAndTypeArgs )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [in] */ mdMethodDef funcDef,\n            /* [in] */ ClassID classId,\n            /* [in] */ ULONG32 cTypeArgs,\n            /* [size_is][in] */ ClassID typeArgs[  ],\n            /* [out] */ FunctionID *pFunctionID);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModuleFrozenObjects )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleID,\n            /* [out] */ ICorProfilerObjectEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetArrayObjectInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectID objectId,\n            /* [in] */ ULONG32 cDimensions,\n            /* [size_is][out] */ ULONG32 pDimensionSizes[  ],\n            /* [size_is][out] */ int pDimensionLowerBounds[  ],\n            /* [out] */ BYTE **ppData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetBoxClassLayout )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [out] */ ULONG32 *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAppDomain )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ AppDomainID *pAppDomainId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRVAStaticAddress )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStaticAddress )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetContextStaticAddress )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ ContextID contextId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [out] */ COR_PRF_STATIC_TYPE *pFieldInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationBounds )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ULONG cObjectRanges,\n            /* [out] */ ULONG *pcObjectRanges,\n            /* [length_is][size_is][out] */ COR_PRF_GC_GENERATION_RANGE ranges[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectGeneration )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ COR_PRF_GC_GENERATION_RANGE *range);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNotifiedExceptionClauseInfo )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ COR_PRF_EX_CLAUSE_INFO *pinfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestProfilerDetach )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ DWORD dwExpectedCompletionMilliseconds);\n\n        HRESULT ( STDMETHODCALLTYPE *SetFunctionIDMapper2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionIDMapper2 *pFunc,\n            /* [in] */ void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStringLayout2 )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ ULONG *pStringLengthOffset,\n            /* [out] */ ULONG *pBufferOffset);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionEnter3 *pFuncEnter3,\n            /* [in] */ FunctionLeave3 *pFuncLeave3,\n            /* [in] */ FunctionTailcall3 *pFuncTailcall3);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnterLeaveFunctionHooks3WithInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionEnter3WithInfo *pFuncEnter3WithInfo,\n            /* [in] */ FunctionLeave3WithInfo *pFuncLeave3WithInfo,\n            /* [in] */ FunctionTailcall3WithInfo *pFuncTailcall3WithInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionEnter3Info )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out][in] */ ULONG *pcbArgumentInfo,\n            /* [size_is][out] */ COR_PRF_FUNCTION_ARGUMENT_INFO *pArgumentInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionLeave3Info )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo,\n            /* [out] */ COR_PRF_FUNCTION_ARGUMENT_RANGE *pRetvalRange);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionTailcall3Info )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ COR_PRF_ELT_INFO eltInfo,\n            /* [out] */ COR_PRF_FRAME_INFO *pFrameInfo);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumModules )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ ICorProfilerModuleEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeInformation )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ USHORT *pClrInstanceId,\n            /* [out] */ COR_PRF_RUNTIME_TYPE *pRuntimeType,\n            /* [out] */ USHORT *pMajorVersion,\n            /* [out] */ USHORT *pMinorVersion,\n            /* [out] */ USHORT *pBuildNumber,\n            /* [out] */ USHORT *pQFEVersion,\n            /* [in] */ ULONG cchVersionString,\n            /* [out] */ ULONG *pcchVersionString,\n            /* [annotation][out] */\n            _Out_writes_to_(cchVersionString, *pcchVersionString)  WCHAR szVersionString[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStaticAddress2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ClassID classId,\n            /* [in] */ mdFieldDef fieldToken,\n            /* [in] */ AppDomainID appDomainId,\n            /* [in] */ ThreadID threadId,\n            /* [out] */ void **ppAddress);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainsContainingModule )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ ULONG32 cAppDomainIds,\n            /* [out] */ ULONG32 *pcAppDomainIds,\n            /* [length_is][size_is][out] */ AppDomainID appDomainIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleInfo2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ LPCBYTE *ppBaseLoadAddress,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR szName[  ],\n            /* [out] */ AssemblyID *pAssemblyId,\n            /* [out] */ DWORD *pdwModuleFlags);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumThreads )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *InitializeCurrentThread )(\n            ICorProfilerInfo13 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJIT )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestRevert )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ],\n            /* [size_is][out] */ HRESULT status[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo3 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionID,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cCodeInfos,\n            /* [out] */ ULONG32 *pcCodeInfos,\n            /* [length_is][size_is][out] */ COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *pFunctionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITIDs )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ULONG cReJitIds,\n            /* [out] */ ULONG *pcReJitIds,\n            /* [length_is][size_is][out] */ ReJITID reJitIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [in] */ ReJITID reJitId,\n            /* [in] */ ULONG32 cMap,\n            /* [out] */ ULONG32 *pcMap,\n            /* [length_is][size_is][out] */ COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumJITedFunctions2 )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ ICorProfilerFunctionEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectSize2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectID objectId,\n            /* [out] */ SIZE_T *pcSize);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEventMask2 )(\n            ICorProfilerInfo13 * This,\n            /* [out] */ DWORD *pdwEventsLow,\n            /* [out] */ DWORD *pdwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEventMask2 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ DWORD dwEventsLow,\n            /* [in] */ DWORD dwEventsHigh);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumNgenModuleMethodsInliningThisMethod )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID inlinersModuleId,\n            /* [in] */ ModuleID inlineeModuleId,\n            /* [in] */ mdMethodDef inlineeMethodId,\n            /* [out] */ BOOL *incompleteData,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *ApplyMetaData )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetInMemorySymbolsLength )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [out] */ DWORD *pCountSymbolBytes);\n\n        HRESULT ( STDMETHODCALLTYPE *ReadInMemorySymbols )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ModuleID moduleId,\n            /* [in] */ DWORD symbolsReadOffset,\n            /* [out] */ BYTE *pSymbolBytes,\n            /* [in] */ DWORD countSymbolBytes,\n            /* [out] */ DWORD *pCountSymbolBytesRead);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFunctionDynamic )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ BOOL *isDynamic);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFunctionFromIP3 )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ LPCBYTE ip,\n            /* [out] */ FunctionID *functionId,\n            /* [out] */ ReJITID *pReJitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDynamicFunctionInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ FunctionID functionId,\n            /* [out] */ ModuleID *moduleId,\n            /* [out] */ PCCOR_SIGNATURE *ppvSig,\n            /* [out] */ ULONG *pbSig,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [out] */ WCHAR wszName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNativeCodeStartAddresses )(\n            ICorProfilerInfo13 * This,\n            FunctionID functionID,\n            ReJITID reJitId,\n            ULONG32 cCodeStartAddresses,\n            ULONG32 *pcCodeStartAddresses,\n            UINT_PTR codeStartAddresses[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILToNativeMapping3 )(\n            ICorProfilerInfo13 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cMap,\n            ULONG32 *pcMap,\n            COR_DEBUG_IL_TO_NATIVE_MAP map[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeInfo4 )(\n            ICorProfilerInfo13 * This,\n            UINT_PTR pNativeCodeStartAddress,\n            ULONG32 cCodeInfos,\n            ULONG32 *pcCodeInfos,\n            COR_PRF_CODE_INFO codeInfos[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateObjectReferences )(\n            ICorProfilerInfo13 * This,\n            ObjectID objectId,\n            ObjectReferenceCallback callback,\n            void *clientData);\n\n        HRESULT ( STDMETHODCALLTYPE *IsFrozenObject )(\n            ICorProfilerInfo13 * This,\n            ObjectID objectId,\n            BOOL *pbFrozen);\n\n        HRESULT ( STDMETHODCALLTYPE *GetLOHObjectSizeThreshold )(\n            ICorProfilerInfo13 * This,\n            DWORD *pThreshold);\n\n        HRESULT ( STDMETHODCALLTYPE *RequestReJITWithInliners )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ DWORD dwRejitFlags,\n            /* [in] */ ULONG cFunctions,\n            /* [size_is][in] */ ModuleID moduleIds[  ],\n            /* [size_is][in] */ mdMethodDef methodIds[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SuspendRuntime )(\n            ICorProfilerInfo13 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *ResumeRuntime )(\n            ICorProfilerInfo13 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetEnvironmentVariable )(\n            ICorProfilerInfo13 * This,\n            /* [string][in] */ const WCHAR *szName,\n            /* [in] */ ULONG cchValue,\n            /* [out] */ ULONG *pcchValue,\n            /* [annotation][out] */\n            _Out_writes_to_(cchValue, *pcchValue)  WCHAR szValue[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *SetEnvironmentVariable )(\n            ICorProfilerInfo13 * This,\n            /* [string][in] */ const WCHAR *szName,\n            /* [string][in] */ const WCHAR *szValue);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeStartSession )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ UINT32 cProviderConfigs,\n            /* [size_is][in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG pProviderConfigs[  ],\n            /* [in] */ BOOL requestRundown,\n            /* [out] */ EVENTPIPE_SESSION *pSession);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeAddProviderToSession )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ EVENTPIPE_SESSION session,\n            /* [in] */ COR_PRF_EVENTPIPE_PROVIDER_CONFIG providerConfig);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeStopSession )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ EVENTPIPE_SESSION session);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeCreateProvider )(\n            ICorProfilerInfo13 * This,\n            /* [string][in] */ const WCHAR *providerName,\n            /* [out] */ EVENTPIPE_PROVIDER *pProvider);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeGetProviderInfo )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [in] */ ULONG cchName,\n            /* [out] */ ULONG *pcchName,\n            /* [annotation][out] */\n            _Out_writes_to_(cchName, *pcchName)  WCHAR providerName[  ]);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeDefineEvent )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ EVENTPIPE_PROVIDER provider,\n            /* [string][in] */ const WCHAR *eventName,\n            /* [in] */ UINT32 eventID,\n            /* [in] */ UINT64 keywords,\n            /* [in] */ UINT32 eventVersion,\n            /* [in] */ UINT32 level,\n            /* [in] */ UINT8 opcode,\n            /* [in] */ BOOL needStack,\n            /* [in] */ UINT32 cParamDescs,\n            /* [size_is][in] */ COR_PRF_EVENTPIPE_PARAM_DESC pParamDescs[  ],\n            /* [out] */ EVENTPIPE_EVENT *pEvent);\n\n        HRESULT ( STDMETHODCALLTYPE *EventPipeWriteEvent )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ EVENTPIPE_EVENT event,\n            /* [in] */ UINT32 cData,\n            /* [size_is][in] */ COR_PRF_EVENT_DATA data[  ],\n            /* [in] */ LPCGUID pActivityId,\n            /* [in] */ LPCGUID pRelatedActivityId);\n\n        HRESULT ( STDMETHODCALLTYPE CreateHandle )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectID object,\n            /* [in] */ COR_PRF_HANDLE_TYPE type,\n            /* [out] */ ObjectHandleID* pHandle);\n\n        HRESULT ( STDMETHODCALLTYPE DestroyHandle )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectHandleID handle);\n\n        HRESULT ( STDMETHODCALLTYPE GetObjectIDFromHandle )(\n            ICorProfilerInfo13 * This,\n            /* [in] */ ObjectHandleID handle,\n            /* [out] */ ObjectID* pObject);\n\n        END_INTERFACE\n    } ICorProfilerInfo13Vtbl;\n\n    interface ICorProfilerInfo13\n    {\n        CONST_VTBL struct ICorProfilerInfo13Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerInfo13_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerInfo13_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerInfo13_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerInfo13_GetClassFromObject(This,objectId,pClassId)   \\\n    ( (This)->lpVtbl -> GetClassFromObject(This,objectId,pClassId) )\n\n#define ICorProfilerInfo13_GetClassFromToken(This,moduleId,typeDef,pClassId)    \\\n    ( (This)->lpVtbl -> GetClassFromToken(This,moduleId,typeDef,pClassId) )\n\n#define ICorProfilerInfo13_GetCodeInfo(This,functionId,pStart,pcSize)   \\\n    ( (This)->lpVtbl -> GetCodeInfo(This,functionId,pStart,pcSize) )\n\n#define ICorProfilerInfo13_GetEventMask(This,pdwEvents) \\\n    ( (This)->lpVtbl -> GetEventMask(This,pdwEvents) )\n\n#define ICorProfilerInfo13_GetFunctionFromIP(This,ip,pFunctionId)   \\\n    ( (This)->lpVtbl -> GetFunctionFromIP(This,ip,pFunctionId) )\n\n#define ICorProfilerInfo13_GetFunctionFromToken(This,moduleId,token,pFunctionId)    \\\n    ( (This)->lpVtbl -> GetFunctionFromToken(This,moduleId,token,pFunctionId) )\n\n#define ICorProfilerInfo13_GetHandleFromThread(This,threadId,phThread)  \\\n    ( (This)->lpVtbl -> GetHandleFromThread(This,threadId,phThread) )\n\n#define ICorProfilerInfo13_GetObjectSize(This,objectId,pcSize)  \\\n    ( (This)->lpVtbl -> GetObjectSize(This,objectId,pcSize) )\n\n#define ICorProfilerInfo13_IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) \\\n    ( (This)->lpVtbl -> IsArrayClass(This,classId,pBaseElemType,pBaseClassId,pcRank) )\n\n#define ICorProfilerInfo13_GetThreadInfo(This,threadId,pdwWin32ThreadId)    \\\n    ( (This)->lpVtbl -> GetThreadInfo(This,threadId,pdwWin32ThreadId) )\n\n#define ICorProfilerInfo13_GetCurrentThreadID(This,pThreadId)   \\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,pThreadId) )\n\n#define ICorProfilerInfo13_GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) \\\n    ( (This)->lpVtbl -> GetClassIDInfo(This,classId,pModuleId,pTypeDefToken) )\n\n#define ICorProfilerInfo13_GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken)   \\\n    ( (This)->lpVtbl -> GetFunctionInfo(This,functionId,pClassId,pModuleId,pToken) )\n\n#define ICorProfilerInfo13_SetEventMask(This,dwEvents)  \\\n    ( (This)->lpVtbl -> SetEventMask(This,dwEvents) )\n\n#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo13_SetFunctionIDMapper(This,pFunc)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper(This,pFunc) )\n\n#define ICorProfilerInfo13_GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken)    \\\n    ( (This)->lpVtbl -> GetTokenAndMetaDataFromFunction(This,functionId,riid,ppImport,pToken) )\n\n#define ICorProfilerInfo13_GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId)   \\\n    ( (This)->lpVtbl -> GetModuleInfo(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId) )\n\n#define ICorProfilerInfo13_GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut)  \\\n    ( (This)->lpVtbl -> GetModuleMetaData(This,moduleId,dwOpenFlags,riid,ppOut) )\n\n#define ICorProfilerInfo13_GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize)   \\\n    ( (This)->lpVtbl -> GetILFunctionBody(This,moduleId,methodId,ppMethodHeader,pcbMethodSize) )\n\n#define ICorProfilerInfo13_GetILFunctionBodyAllocator(This,moduleId,ppMalloc)   \\\n    ( (This)->lpVtbl -> GetILFunctionBodyAllocator(This,moduleId,ppMalloc) )\n\n#define ICorProfilerInfo13_SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader)    \\\n    ( (This)->lpVtbl -> SetILFunctionBody(This,moduleId,methodid,pbNewILMethodHeader) )\n\n#define ICorProfilerInfo13_GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId)    \\\n    ( (This)->lpVtbl -> GetAppDomainInfo(This,appDomainId,cchName,pcchName,szName,pProcessId) )\n\n#define ICorProfilerInfo13_GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId)  \\\n    ( (This)->lpVtbl -> GetAssemblyInfo(This,assemblyId,cchName,pcchName,szName,pAppDomainId,pModuleId) )\n\n#define ICorProfilerInfo13_SetFunctionReJIT(This,functionId)    \\\n    ( (This)->lpVtbl -> SetFunctionReJIT(This,functionId) )\n\n#define ICorProfilerInfo13_ForceGC(This)    \\\n    ( (This)->lpVtbl -> ForceGC(This) )\n\n#define ICorProfilerInfo13_SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) \\\n    ( (This)->lpVtbl -> SetILInstrumentedCodeMap(This,functionId,fStartJit,cILMapEntries,rgILMapEntries) )\n\n#define ICorProfilerInfo13_GetInprocInspectionInterface(This,ppicd) \\\n    ( (This)->lpVtbl -> GetInprocInspectionInterface(This,ppicd) )\n\n#define ICorProfilerInfo13_GetInprocInspectionIThisThread(This,ppicd)   \\\n    ( (This)->lpVtbl -> GetInprocInspectionIThisThread(This,ppicd) )\n\n#define ICorProfilerInfo13_GetThreadContext(This,threadId,pContextId)   \\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadId,pContextId) )\n\n#define ICorProfilerInfo13_BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext)    \\\n    ( (This)->lpVtbl -> BeginInprocDebugging(This,fThisThreadOnly,pdwProfilerContext) )\n\n#define ICorProfilerInfo13_EndInprocDebugging(This,dwProfilerContext)   \\\n    ( (This)->lpVtbl -> EndInprocDebugging(This,dwProfilerContext) )\n\n#define ICorProfilerInfo13_GetILToNativeMapping(This,functionId,cMap,pcMap,map) \\\n    ( (This)->lpVtbl -> GetILToNativeMapping(This,functionId,cMap,pcMap,map) )\n\n\n#define ICorProfilerInfo13_DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize)   \\\n    ( (This)->lpVtbl -> DoStackSnapshot(This,thread,callback,infoFlags,clientData,context,contextSize) )\n\n#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall)    \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks2(This,pFuncEnter,pFuncLeave,pFuncTailcall) )\n\n#define ICorProfilerInfo13_GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs)  \\\n    ( (This)->lpVtbl -> GetFunctionInfo2(This,funcId,frameInfo,pClassId,pModuleId,pToken,cTypeArgs,pcTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo13_GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset)  \\\n    ( (This)->lpVtbl -> GetStringLayout(This,pBufferLengthOffset,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo13_GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize)    \\\n    ( (This)->lpVtbl -> GetClassLayout(This,classID,rFieldOffset,cFieldOffset,pcFieldOffset,pulClassSize) )\n\n#define ICorProfilerInfo13_GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) \\\n    ( (This)->lpVtbl -> GetClassIDInfo2(This,classId,pModuleId,pTypeDefToken,pParentClassId,cNumTypeArgs,pcNumTypeArgs,typeArgs) )\n\n#define ICorProfilerInfo13_GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo2(This,functionID,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo13_GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID)  \\\n    ( (This)->lpVtbl -> GetClassFromTokenAndTypeArgs(This,moduleID,typeDef,cTypeArgs,typeArgs,pClassID) )\n\n#define ICorProfilerInfo13_GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID)    \\\n    ( (This)->lpVtbl -> GetFunctionFromTokenAndTypeArgs(This,moduleID,funcDef,classId,cTypeArgs,typeArgs,pFunctionID) )\n\n#define ICorProfilerInfo13_EnumModuleFrozenObjects(This,moduleID,ppEnum)    \\\n    ( (This)->lpVtbl -> EnumModuleFrozenObjects(This,moduleID,ppEnum) )\n\n#define ICorProfilerInfo13_GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData)   \\\n    ( (This)->lpVtbl -> GetArrayObjectInfo(This,objectId,cDimensions,pDimensionSizes,pDimensionLowerBounds,ppData) )\n\n#define ICorProfilerInfo13_GetBoxClassLayout(This,classId,pBufferOffset)    \\\n    ( (This)->lpVtbl -> GetBoxClassLayout(This,classId,pBufferOffset) )\n\n#define ICorProfilerInfo13_GetThreadAppDomain(This,threadId,pAppDomainId)   \\\n    ( (This)->lpVtbl -> GetThreadAppDomain(This,threadId,pAppDomainId) )\n\n#define ICorProfilerInfo13_GetRVAStaticAddress(This,classId,fieldToken,ppAddress)   \\\n    ( (This)->lpVtbl -> GetRVAStaticAddress(This,classId,fieldToken,ppAddress) )\n\n#define ICorProfilerInfo13_GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) \\\n    ( (This)->lpVtbl -> GetAppDomainStaticAddress(This,classId,fieldToken,appDomainId,ppAddress) )\n\n#define ICorProfilerInfo13_GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress)   \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress(This,classId,fieldToken,threadId,ppAddress) )\n\n#define ICorProfilerInfo13_GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) \\\n    ( (This)->lpVtbl -> GetContextStaticAddress(This,classId,fieldToken,contextId,ppAddress) )\n\n#define ICorProfilerInfo13_GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo)   \\\n    ( (This)->lpVtbl -> GetStaticFieldInfo(This,classId,fieldToken,pFieldInfo) )\n\n#define ICorProfilerInfo13_GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges)    \\\n    ( (This)->lpVtbl -> GetGenerationBounds(This,cObjectRanges,pcObjectRanges,ranges) )\n\n#define ICorProfilerInfo13_GetObjectGeneration(This,objectId,range) \\\n    ( (This)->lpVtbl -> GetObjectGeneration(This,objectId,range) )\n\n#define ICorProfilerInfo13_GetNotifiedExceptionClauseInfo(This,pinfo)   \\\n    ( (This)->lpVtbl -> GetNotifiedExceptionClauseInfo(This,pinfo) )\n\n\n#define ICorProfilerInfo13_EnumJITedFunctions(This,ppEnum)  \\\n    ( (This)->lpVtbl -> EnumJITedFunctions(This,ppEnum) )\n\n#define ICorProfilerInfo13_RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) \\\n    ( (This)->lpVtbl -> RequestProfilerDetach(This,dwExpectedCompletionMilliseconds) )\n\n#define ICorProfilerInfo13_SetFunctionIDMapper2(This,pFunc,clientData)  \\\n    ( (This)->lpVtbl -> SetFunctionIDMapper2(This,pFunc,clientData) )\n\n#define ICorProfilerInfo13_GetStringLayout2(This,pStringLengthOffset,pBufferOffset) \\\n    ( (This)->lpVtbl -> GetStringLayout2(This,pStringLengthOffset,pBufferOffset) )\n\n#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3(This,pFuncEnter3,pFuncLeave3,pFuncTailcall3) )\n\n#define ICorProfilerInfo13_SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) \\\n    ( (This)->lpVtbl -> SetEnterLeaveFunctionHooks3WithInfo(This,pFuncEnter3WithInfo,pFuncLeave3WithInfo,pFuncTailcall3WithInfo) )\n\n#define ICorProfilerInfo13_GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo)  \\\n    ( (This)->lpVtbl -> GetFunctionEnter3Info(This,functionId,eltInfo,pFrameInfo,pcbArgumentInfo,pArgumentInfo) )\n\n#define ICorProfilerInfo13_GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange)   \\\n    ( (This)->lpVtbl -> GetFunctionLeave3Info(This,functionId,eltInfo,pFrameInfo,pRetvalRange) )\n\n#define ICorProfilerInfo13_GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) \\\n    ( (This)->lpVtbl -> GetFunctionTailcall3Info(This,functionId,eltInfo,pFrameInfo) )\n\n#define ICorProfilerInfo13_EnumModules(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumModules(This,ppEnum) )\n\n#define ICorProfilerInfo13_GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString)  \\\n    ( (This)->lpVtbl -> GetRuntimeInformation(This,pClrInstanceId,pRuntimeType,pMajorVersion,pMinorVersion,pBuildNumber,pQFEVersion,cchVersionString,pcchVersionString,szVersionString) )\n\n#define ICorProfilerInfo13_GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress)  \\\n    ( (This)->lpVtbl -> GetThreadStaticAddress2(This,classId,fieldToken,appDomainId,threadId,ppAddress) )\n\n#define ICorProfilerInfo13_GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds)   \\\n    ( (This)->lpVtbl -> GetAppDomainsContainingModule(This,moduleId,cAppDomainIds,pcAppDomainIds,appDomainIds) )\n\n#define ICorProfilerInfo13_GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags)   \\\n    ( (This)->lpVtbl -> GetModuleInfo2(This,moduleId,ppBaseLoadAddress,cchName,pcchName,szName,pAssemblyId,pdwModuleFlags) )\n\n\n#define ICorProfilerInfo13_EnumThreads(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumThreads(This,ppEnum) )\n\n#define ICorProfilerInfo13_InitializeCurrentThread(This)    \\\n    ( (This)->lpVtbl -> InitializeCurrentThread(This) )\n\n#define ICorProfilerInfo13_RequestReJIT(This,cFunctions,moduleIds,methodIds)    \\\n    ( (This)->lpVtbl -> RequestReJIT(This,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo13_RequestRevert(This,cFunctions,moduleIds,methodIds,status)    \\\n    ( (This)->lpVtbl -> RequestRevert(This,cFunctions,moduleIds,methodIds,status) )\n\n#define ICorProfilerInfo13_GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos)   \\\n    ( (This)->lpVtbl -> GetCodeInfo3(This,functionID,reJitId,cCodeInfos,pcCodeInfos,codeInfos) )\n\n#define ICorProfilerInfo13_GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) \\\n    ( (This)->lpVtbl -> GetFunctionFromIP2(This,ip,pFunctionId,pReJitId) )\n\n#define ICorProfilerInfo13_GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds)   \\\n    ( (This)->lpVtbl -> GetReJITIDs(This,functionId,cReJitIds,pcReJitIds,reJitIds) )\n\n#define ICorProfilerInfo13_GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map)    \\\n    ( (This)->lpVtbl -> GetILToNativeMapping2(This,functionId,reJitId,cMap,pcMap,map) )\n\n#define ICorProfilerInfo13_EnumJITedFunctions2(This,ppEnum) \\\n    ( (This)->lpVtbl -> EnumJITedFunctions2(This,ppEnum) )\n\n#define ICorProfilerInfo13_GetObjectSize2(This,objectId,pcSize) \\\n    ( (This)->lpVtbl -> GetObjectSize2(This,objectId,pcSize) )\n\n\n#define ICorProfilerInfo13_GetEventMask2(This,pdwEventsLow,pdwEventsHigh)   \\\n    ( (This)->lpVtbl -> GetEventMask2(This,pdwEventsLow,pdwEventsHigh) )\n\n#define ICorProfilerInfo13_SetEventMask2(This,dwEventsLow,dwEventsHigh) \\\n    ( (This)->lpVtbl -> SetEventMask2(This,dwEventsLow,dwEventsHigh) )\n\n\n#define ICorProfilerInfo13_EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) \\\n    ( (This)->lpVtbl -> EnumNgenModuleMethodsInliningThisMethod(This,inlinersModuleId,inlineeModuleId,inlineeMethodId,incompleteData,ppEnum) )\n\n\n#define ICorProfilerInfo13_ApplyMetaData(This,moduleId) \\\n    ( (This)->lpVtbl -> ApplyMetaData(This,moduleId) )\n\n#define ICorProfilerInfo13_GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes)    \\\n    ( (This)->lpVtbl -> GetInMemorySymbolsLength(This,moduleId,pCountSymbolBytes) )\n\n#define ICorProfilerInfo13_ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) \\\n    ( (This)->lpVtbl -> ReadInMemorySymbols(This,moduleId,symbolsReadOffset,pSymbolBytes,countSymbolBytes,pCountSymbolBytesRead) )\n\n\n#define ICorProfilerInfo13_IsFunctionDynamic(This,functionId,isDynamic) \\\n    ( (This)->lpVtbl -> IsFunctionDynamic(This,functionId,isDynamic) )\n\n#define ICorProfilerInfo13_GetFunctionFromIP3(This,ip,functionId,pReJitId)  \\\n    ( (This)->lpVtbl -> GetFunctionFromIP3(This,ip,functionId,pReJitId) )\n\n#define ICorProfilerInfo13_GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName)   \\\n    ( (This)->lpVtbl -> GetDynamicFunctionInfo(This,functionId,moduleId,ppvSig,pbSig,cchName,pcchName,wszName) )\n\n\n#define ICorProfilerInfo13_GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) \\\n    ( (This)->lpVtbl -> GetNativeCodeStartAddresses(This,functionID,reJitId,cCodeStartAddresses,pcCodeStartAddresses,codeStartAddresses) )\n\n#define ICorProfilerInfo13_GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map)   \\\n    ( (This)->lpVtbl -> GetILToNativeMapping3(This,pNativeCodeStartAddress,cMap,pcMap,map) )\n\n#define ICorProfilerInfo13_GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos)  \\\n    ( (This)->lpVtbl -> GetCodeInfo4(This,pNativeCodeStartAddress,cCodeInfos,pcCodeInfos,codeInfos) )\n\n\n#define ICorProfilerInfo13_EnumerateObjectReferences(This,objectId,callback,clientData) \\\n    ( (This)->lpVtbl -> EnumerateObjectReferences(This,objectId,callback,clientData) )\n\n#define ICorProfilerInfo13_IsFrozenObject(This,objectId,pbFrozen)   \\\n    ( (This)->lpVtbl -> IsFrozenObject(This,objectId,pbFrozen) )\n\n#define ICorProfilerInfo13_GetLOHObjectSizeThreshold(This,pThreshold)   \\\n    ( (This)->lpVtbl -> GetLOHObjectSizeThreshold(This,pThreshold) )\n\n#define ICorProfilerInfo13_RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds)   \\\n    ( (This)->lpVtbl -> RequestReJITWithInliners(This,dwRejitFlags,cFunctions,moduleIds,methodIds) )\n\n#define ICorProfilerInfo13_SuspendRuntime(This) \\\n    ( (This)->lpVtbl -> SuspendRuntime(This) )\n\n#define ICorProfilerInfo13_ResumeRuntime(This)  \\\n    ( (This)->lpVtbl -> ResumeRuntime(This) )\n\n\n#define ICorProfilerInfo13_GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue)   \\\n    ( (This)->lpVtbl -> GetEnvironmentVariable(This,szName,cchValue,pcchValue,szValue) )\n\n#define ICorProfilerInfo13_SetEnvironmentVariable(This,szName,szValue)  \\\n    ( (This)->lpVtbl -> SetEnvironmentVariable(This,szName,szValue) )\n\n\n#define ICorProfilerInfo13_EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession)    \\\n    ( (This)->lpVtbl -> EventPipeStartSession(This,cProviderConfigs,pProviderConfigs,requestRundown,pSession) )\n\n#define ICorProfilerInfo13_EventPipeAddProviderToSession(This,session,providerConfig)   \\\n    ( (This)->lpVtbl -> EventPipeAddProviderToSession(This,session,providerConfig) )\n\n#define ICorProfilerInfo13_EventPipeStopSession(This,session)   \\\n    ( (This)->lpVtbl -> EventPipeStopSession(This,session) )\n\n#define ICorProfilerInfo13_EventPipeCreateProvider(This,providerName,pProvider) \\\n    ( (This)->lpVtbl -> EventPipeCreateProvider(This,providerName,pProvider) )\n\n#define ICorProfilerInfo13_EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName)    \\\n    ( (This)->lpVtbl -> EventPipeGetProviderInfo(This,provider,cchName,pcchName,providerName) )\n\n#define ICorProfilerInfo13_EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent)    \\\n    ( (This)->lpVtbl -> EventPipeDefineEvent(This,provider,eventName,eventID,keywords,eventVersion,level,opcode,needStack,cParamDescs,pParamDescs,pEvent) )\n\n#define ICorProfilerInfo13_EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId)    \\\n    ( (This)->lpVtbl -> EventPipeWriteEvent(This,event,cData,data,pActivityId,pRelatedActivityId) )\n\n#define ICorProfilerInfo13_CreateHandle(This,object,type,pHandle)    \\\n    ( (This)->lpVtbl -> CreateHandle(This,object,type,pHandle) )\n\n#define ICorProfilerInfo13_DestroyHandle(This,handle)    \\\n    ( (This)->lpVtbl -> DestroyHandle(This,handle) )\n\n#define ICorProfilerInfo13_GetObjectIDFromHandle(This,handle,pObject)    \\\n    ( (This)->lpVtbl -> GetObjectIDFromHandle(This,handle,pObject) )\n\n\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerInfo13_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerMethodEnum_INTERFACE_DEFINED__\n#define __ICorProfilerMethodEnum_INTERFACE_DEFINED__\n\n/* interface ICorProfilerMethodEnum */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerMethodEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"FCCEE788-0088-454B-A811-C99F298D1942\")\n    ICorProfilerMethodEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip(\n            /* [in] */ ULONG celt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Clone(\n            /* [out] */ ICorProfilerMethodEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ ULONG *pcelt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_PRF_METHOD elements[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerMethodEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerMethodEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerMethodEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerMethodEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorProfilerMethodEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorProfilerMethodEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorProfilerMethodEnum * This,\n            /* [out] */ ICorProfilerMethodEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorProfilerMethodEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorProfilerMethodEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ COR_PRF_METHOD elements[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorProfilerMethodEnumVtbl;\n\n    interface ICorProfilerMethodEnum\n    {\n        CONST_VTBL struct ICorProfilerMethodEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerMethodEnum_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerMethodEnum_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerMethodEnum_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerMethodEnum_Skip(This,celt)  \\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorProfilerMethodEnum_Reset(This)  \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorProfilerMethodEnum_Clone(This,ppEnum)   \\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorProfilerMethodEnum_GetCount(This,pcelt) \\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n#define ICorProfilerMethodEnum_Next(This,celt,elements,pceltFetched)    \\\n    ( (This)->lpVtbl -> Next(This,celt,elements,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerMethodEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerThreadEnum_INTERFACE_DEFINED__\n#define __ICorProfilerThreadEnum_INTERFACE_DEFINED__\n\n/* interface ICorProfilerThreadEnum */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerThreadEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"571194f7-25ed-419f-aa8b-7016b3159701\")\n    ICorProfilerThreadEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip(\n            /* [in] */ ULONG celt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Clone(\n            /* [out] */ ICorProfilerThreadEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ ULONG *pcelt) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ThreadID ids[  ],\n            /* [out] */ ULONG *pceltFetched) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerThreadEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerThreadEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerThreadEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerThreadEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ICorProfilerThreadEnum * This,\n            /* [in] */ ULONG celt);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ICorProfilerThreadEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Clone )(\n            ICorProfilerThreadEnum * This,\n            /* [out] */ ICorProfilerThreadEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ICorProfilerThreadEnum * This,\n            /* [out] */ ULONG *pcelt);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ICorProfilerThreadEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ThreadID ids[  ],\n            /* [out] */ ULONG *pceltFetched);\n\n        END_INTERFACE\n    } ICorProfilerThreadEnumVtbl;\n\n    interface ICorProfilerThreadEnum\n    {\n        CONST_VTBL struct ICorProfilerThreadEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerThreadEnum_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerThreadEnum_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerThreadEnum_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerThreadEnum_Skip(This,celt)  \\\n    ( (This)->lpVtbl -> Skip(This,celt) )\n\n#define ICorProfilerThreadEnum_Reset(This)  \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ICorProfilerThreadEnum_Clone(This,ppEnum)   \\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) )\n\n#define ICorProfilerThreadEnum_GetCount(This,pcelt) \\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) )\n\n#define ICorProfilerThreadEnum_Next(This,celt,ids,pceltFetched) \\\n    ( (This)->lpVtbl -> Next(This,celt,ids,pceltFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerThreadEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorProfilerAssemblyReferenceProvider_INTERFACE_DEFINED__\n#define __ICorProfilerAssemblyReferenceProvider_INTERFACE_DEFINED__\n\n/* interface ICorProfilerAssemblyReferenceProvider */\n/* [local][unique][uuid][object] */\n\n\nEXTERN_C const IID IID_ICorProfilerAssemblyReferenceProvider;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"66A78C24-2EEF-4F65-B45F-DD1D8038BF3C\")\n    ICorProfilerAssemblyReferenceProvider : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE AddAssemblyReference(\n            const COR_PRF_ASSEMBLY_REFERENCE_INFO *pAssemblyRefInfo) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ICorProfilerAssemblyReferenceProviderVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ICorProfilerAssemblyReferenceProvider * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ICorProfilerAssemblyReferenceProvider * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ICorProfilerAssemblyReferenceProvider * This);\n\n        HRESULT ( STDMETHODCALLTYPE *AddAssemblyReference )(\n            ICorProfilerAssemblyReferenceProvider * This,\n            const COR_PRF_ASSEMBLY_REFERENCE_INFO *pAssemblyRefInfo);\n\n        END_INTERFACE\n    } ICorProfilerAssemblyReferenceProviderVtbl;\n\n    interface ICorProfilerAssemblyReferenceProvider\n    {\n        CONST_VTBL struct ICorProfilerAssemblyReferenceProviderVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ICorProfilerAssemblyReferenceProvider_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ICorProfilerAssemblyReferenceProvider_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ICorProfilerAssemblyReferenceProvider_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ICorProfilerAssemblyReferenceProvider_AddAssemblyReference(This,pAssemblyRefInfo)   \\\n    ( (This)->lpVtbl -> AddAssemblyReference(This,pAssemblyRefInfo) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ICorProfilerAssemblyReferenceProvider_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/corpub.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.00.0603 */\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif // __RPCNDR_H_VERSION__\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __corpub_h__\n#define __corpub_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __CorpubPublish_FWD_DEFINED__\n#define __CorpubPublish_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorpubPublish CorpubPublish;\n#else\ntypedef struct CorpubPublish CorpubPublish;\n#endif /* __cplusplus */\n\n#endif \t/* __CorpubPublish_FWD_DEFINED__ */\n\n\n#ifndef __ICorPublish_FWD_DEFINED__\n#define __ICorPublish_FWD_DEFINED__\ntypedef interface ICorPublish ICorPublish;\n\n#endif \t/* __ICorPublish_FWD_DEFINED__ */\n\n\n#ifndef __ICorPublishEnum_FWD_DEFINED__\n#define __ICorPublishEnum_FWD_DEFINED__\ntypedef interface ICorPublishEnum ICorPublishEnum;\n\n#endif \t/* __ICorPublishEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorPublishProcess_FWD_DEFINED__\n#define __ICorPublishProcess_FWD_DEFINED__\ntypedef interface ICorPublishProcess ICorPublishProcess;\n\n#endif \t/* __ICorPublishProcess_FWD_DEFINED__ */\n\n\n#ifndef __ICorPublishAppDomain_FWD_DEFINED__\n#define __ICorPublishAppDomain_FWD_DEFINED__\ntypedef interface ICorPublishAppDomain ICorPublishAppDomain;\n\n#endif \t/* __ICorPublishAppDomain_FWD_DEFINED__ */\n\n\n#ifndef __ICorPublishProcessEnum_FWD_DEFINED__\n#define __ICorPublishProcessEnum_FWD_DEFINED__\ntypedef interface ICorPublishProcessEnum ICorPublishProcessEnum;\n\n#endif \t/* __ICorPublishProcessEnum_FWD_DEFINED__ */\n\n\n#ifndef __ICorPublishAppDomainEnum_FWD_DEFINED__\n#define __ICorPublishAppDomainEnum_FWD_DEFINED__\ntypedef interface ICorPublishAppDomainEnum ICorPublishAppDomainEnum;\n\n#endif \t/* __ICorPublishAppDomainEnum_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n/* interface __MIDL_itf_corpub_0000_0000 */\n/* [local] */ \n\n#if 0\n#endif\ntypedef /* [public][public] */ \nenum __MIDL___MIDL_itf_corpub_0000_0000_0001\n    {\n        COR_PUB_MANAGEDONLY\t= 0x1\n    } \tCOR_PUB_ENUMPROCESS;\n\n#pragma warning(push)\n#pragma warning(disable:28718)    \n\n\n\n\n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0000_v0_0_s_ifspec;\n\n\n#ifndef __CorpubProcessLib_LIBRARY_DEFINED__\n#define __CorpubProcessLib_LIBRARY_DEFINED__\n\n/* library CorpubProcessLib */\n/* [helpstring][version][uuid] */ \n\n\nEXTERN_C const IID LIBID_CorpubProcessLib;\n\nEXTERN_C const CLSID CLSID_CorpubPublish;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"047a9a40-657e-11d3-8d5b-00104b35e7ef\")\nCorpubPublish;\n#endif\n#endif /* __CorpubProcessLib_LIBRARY_DEFINED__ */\n\n#ifndef __ICorPublish_INTERFACE_DEFINED__\n#define __ICorPublish_INTERFACE_DEFINED__\n\n/* interface ICorPublish */\n/* [local][unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICorPublish;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"9613A0E7-5A68-11d3-8F84-00A0C9B4D50C\")\n    ICorPublish : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE EnumProcesses( \n            /* [in] */ COR_PUB_ENUMPROCESS Type,\n            /* [out] */ ICorPublishProcessEnum **ppIEnum) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetProcess( \n            /* [in] */ unsigned int pid,\n            /* [out] */ ICorPublishProcess **ppProcess) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICorPublishVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICorPublish * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICorPublish * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICorPublish * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumProcesses )( \n            ICorPublish * This,\n            /* [in] */ COR_PUB_ENUMPROCESS Type,\n            /* [out] */ ICorPublishProcessEnum **ppIEnum);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetProcess )( \n            ICorPublish * This,\n            /* [in] */ unsigned int pid,\n            /* [out] */ ICorPublishProcess **ppProcess);\n        \n        END_INTERFACE\n    } ICorPublishVtbl;\n\n    interface ICorPublish\n    {\n        CONST_VTBL struct ICorPublishVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICorPublish_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICorPublish_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICorPublish_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICorPublish_EnumProcesses(This,Type,ppIEnum)\t\\\n    ( (This)->lpVtbl -> EnumProcesses(This,Type,ppIEnum) ) \n\n#define ICorPublish_GetProcess(This,pid,ppProcess)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,pid,ppProcess) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorPublish_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorPublishEnum_INTERFACE_DEFINED__\n#define __ICorPublishEnum_INTERFACE_DEFINED__\n\n/* interface ICorPublishEnum */\n/* [local][unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICorPublishEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"C0B22967-5A69-11d3-8F84-00A0C9B4D50C\")\n    ICorPublishEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip( \n            /* [in] */ ULONG celt) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Clone( \n            /* [out] */ ICorPublishEnum **ppEnum) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCount( \n            /* [out] */ ULONG *pcelt) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICorPublishEnumVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICorPublishEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICorPublishEnum * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICorPublishEnum * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Skip )( \n            ICorPublishEnum * This,\n            /* [in] */ ULONG celt);\n        \n        HRESULT ( STDMETHODCALLTYPE *Reset )( \n            ICorPublishEnum * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Clone )( \n            ICorPublishEnum * This,\n            /* [out] */ ICorPublishEnum **ppEnum);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCount )( \n            ICorPublishEnum * This,\n            /* [out] */ ULONG *pcelt);\n        \n        END_INTERFACE\n    } ICorPublishEnumVtbl;\n\n    interface ICorPublishEnum\n    {\n        CONST_VTBL struct ICorPublishEnumVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICorPublishEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICorPublishEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICorPublishEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICorPublishEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) ) \n\n#define ICorPublishEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) ) \n\n#define ICorPublishEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) ) \n\n#define ICorPublishEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorPublishEnum_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_corpub_0000_0003 */\n/* [local] */ \n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0003_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0003_v0_0_s_ifspec;\n\n#ifndef __ICorPublishProcess_INTERFACE_DEFINED__\n#define __ICorPublishProcess_INTERFACE_DEFINED__\n\n/* interface ICorPublishProcess */\n/* [local][unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICorPublishProcess;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"18D87AF1-5A6A-11d3-8F84-00A0C9B4D50C\")\n    ICorPublishProcess : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsManaged( \n            /* [out] */ BOOL *pbManaged) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumAppDomains( \n            /* [out] */ ICorPublishAppDomainEnum **ppEnum) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetProcessID( \n            /* [out] */ unsigned int *pid) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDisplayName( \n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR *szName) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICorPublishProcessVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICorPublishProcess * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICorPublishProcess * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICorPublishProcess * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsManaged )( \n            ICorPublishProcess * This,\n            /* [out] */ BOOL *pbManaged);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAppDomains )( \n            ICorPublishProcess * This,\n            /* [out] */ ICorPublishAppDomainEnum **ppEnum);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetProcessID )( \n            ICorPublishProcess * This,\n            /* [out] */ unsigned int *pid);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDisplayName )( \n            ICorPublishProcess * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR *szName);\n        \n        END_INTERFACE\n    } ICorPublishProcessVtbl;\n\n    interface ICorPublishProcess\n    {\n        CONST_VTBL struct ICorPublishProcessVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICorPublishProcess_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICorPublishProcess_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICorPublishProcess_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICorPublishProcess_IsManaged(This,pbManaged)\t\\\n    ( (This)->lpVtbl -> IsManaged(This,pbManaged) ) \n\n#define ICorPublishProcess_EnumAppDomains(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> EnumAppDomains(This,ppEnum) ) \n\n#define ICorPublishProcess_GetProcessID(This,pid)\t\\\n    ( (This)->lpVtbl -> GetProcessID(This,pid) ) \n\n#define ICorPublishProcess_GetDisplayName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetDisplayName(This,cchName,pcchName,szName) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorPublishProcess_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_corpub_0000_0004 */\n/* [local] */ \n\n#pragma warning(pop)\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0004_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0004_v0_0_s_ifspec;\n\n#ifndef __ICorPublishAppDomain_INTERFACE_DEFINED__\n#define __ICorPublishAppDomain_INTERFACE_DEFINED__\n\n/* interface ICorPublishAppDomain */\n/* [local][unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICorPublishAppDomain;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"D6315C8F-5A6A-11d3-8F84-00A0C9B4D50C\")\n    ICorPublishAppDomain : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetID( \n            /* [out] */ ULONG32 *puId) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR *szName) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICorPublishAppDomainVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICorPublishAppDomain * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICorPublishAppDomain * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICorPublishAppDomain * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetID )( \n            ICorPublishAppDomain * This,\n            /* [out] */ ULONG32 *puId);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            ICorPublishAppDomain * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ WCHAR *szName);\n        \n        END_INTERFACE\n    } ICorPublishAppDomainVtbl;\n\n    interface ICorPublishAppDomain\n    {\n        CONST_VTBL struct ICorPublishAppDomainVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICorPublishAppDomain_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICorPublishAppDomain_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICorPublishAppDomain_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICorPublishAppDomain_GetID(This,puId)\t\\\n    ( (This)->lpVtbl -> GetID(This,puId) ) \n\n#define ICorPublishAppDomain_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorPublishAppDomain_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_corpub_0000_0005 */\n/* [local] */ \n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0005_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corpub_0000_0005_v0_0_s_ifspec;\n\n#ifndef __ICorPublishProcessEnum_INTERFACE_DEFINED__\n#define __ICorPublishProcessEnum_INTERFACE_DEFINED__\n\n/* interface ICorPublishProcessEnum */\n/* [local][unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICorPublishProcessEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"A37FBD41-5A69-11d3-8F84-00A0C9B4D50C\")\n    ICorPublishProcessEnum : public ICorPublishEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next( \n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorPublishProcess **objects,\n            /* [out] */ ULONG *pceltFetched) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICorPublishProcessEnumVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICorPublishProcessEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICorPublishProcessEnum * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICorPublishProcessEnum * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Skip )( \n            ICorPublishProcessEnum * This,\n            /* [in] */ ULONG celt);\n        \n        HRESULT ( STDMETHODCALLTYPE *Reset )( \n            ICorPublishProcessEnum * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Clone )( \n            ICorPublishProcessEnum * This,\n            /* [out] */ ICorPublishEnum **ppEnum);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCount )( \n            ICorPublishProcessEnum * This,\n            /* [out] */ ULONG *pcelt);\n        \n        HRESULT ( STDMETHODCALLTYPE *Next )( \n            ICorPublishProcessEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorPublishProcess **objects,\n            /* [out] */ ULONG *pceltFetched);\n        \n        END_INTERFACE\n    } ICorPublishProcessEnumVtbl;\n\n    interface ICorPublishProcessEnum\n    {\n        CONST_VTBL struct ICorPublishProcessEnumVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICorPublishProcessEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICorPublishProcessEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICorPublishProcessEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICorPublishProcessEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) ) \n\n#define ICorPublishProcessEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) ) \n\n#define ICorPublishProcessEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) ) \n\n#define ICorPublishProcessEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) ) \n\n\n#define ICorPublishProcessEnum_Next(This,celt,objects,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorPublishProcessEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICorPublishAppDomainEnum_INTERFACE_DEFINED__\n#define __ICorPublishAppDomainEnum_INTERFACE_DEFINED__\n\n/* interface ICorPublishAppDomainEnum */\n/* [local][unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICorPublishAppDomainEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"9F0C98F5-5A6A-11d3-8F84-00A0C9B4D50C\")\n    ICorPublishAppDomainEnum : public ICorPublishEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next( \n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorPublishAppDomain **objects,\n            /* [out] */ ULONG *pceltFetched) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICorPublishAppDomainEnumVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICorPublishAppDomainEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICorPublishAppDomainEnum * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICorPublishAppDomainEnum * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Skip )( \n            ICorPublishAppDomainEnum * This,\n            /* [in] */ ULONG celt);\n        \n        HRESULT ( STDMETHODCALLTYPE *Reset )( \n            ICorPublishAppDomainEnum * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Clone )( \n            ICorPublishAppDomainEnum * This,\n            /* [out] */ ICorPublishEnum **ppEnum);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCount )( \n            ICorPublishAppDomainEnum * This,\n            /* [out] */ ULONG *pcelt);\n        \n        HRESULT ( STDMETHODCALLTYPE *Next )( \n            ICorPublishAppDomainEnum * This,\n            /* [in] */ ULONG celt,\n            /* [length_is][size_is][out] */ ICorPublishAppDomain **objects,\n            /* [out] */ ULONG *pceltFetched);\n        \n        END_INTERFACE\n    } ICorPublishAppDomainEnumVtbl;\n\n    interface ICorPublishAppDomainEnum\n    {\n        CONST_VTBL struct ICorPublishAppDomainEnumVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICorPublishAppDomainEnum_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICorPublishAppDomainEnum_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICorPublishAppDomainEnum_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICorPublishAppDomainEnum_Skip(This,celt)\t\\\n    ( (This)->lpVtbl -> Skip(This,celt) ) \n\n#define ICorPublishAppDomainEnum_Reset(This)\t\\\n    ( (This)->lpVtbl -> Reset(This) ) \n\n#define ICorPublishAppDomainEnum_Clone(This,ppEnum)\t\\\n    ( (This)->lpVtbl -> Clone(This,ppEnum) ) \n\n#define ICorPublishAppDomainEnum_GetCount(This,pcelt)\t\\\n    ( (This)->lpVtbl -> GetCount(This,pcelt) ) \n\n\n#define ICorPublishAppDomainEnum_Next(This,celt,objects,pceltFetched)\t\\\n    ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorPublishAppDomainEnum_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/corsym.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.00.0601 */\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n/* verify that the <rpcsal.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCSAL_H_VERSION__\n#define __REQUIRED_RPCSAL_H_VERSION__ 100\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif // __RPCNDR_H_VERSION__\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __corsym_h__\n#define __corsym_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __CorSymWriter_deprecated_FWD_DEFINED__\n#define __CorSymWriter_deprecated_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorSymWriter_deprecated CorSymWriter_deprecated;\n#else\ntypedef struct CorSymWriter_deprecated CorSymWriter_deprecated;\n#endif /* __cplusplus */\n\n#endif \t/* __CorSymWriter_deprecated_FWD_DEFINED__ */\n\n\n#ifndef __CorSymReader_deprecated_FWD_DEFINED__\n#define __CorSymReader_deprecated_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorSymReader_deprecated CorSymReader_deprecated;\n#else\ntypedef struct CorSymReader_deprecated CorSymReader_deprecated;\n#endif /* __cplusplus */\n\n#endif \t/* __CorSymReader_deprecated_FWD_DEFINED__ */\n\n\n#ifndef __CorSymBinder_deprecated_FWD_DEFINED__\n#define __CorSymBinder_deprecated_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorSymBinder_deprecated CorSymBinder_deprecated;\n#else\ntypedef struct CorSymBinder_deprecated CorSymBinder_deprecated;\n#endif /* __cplusplus */\n\n#endif \t/* __CorSymBinder_deprecated_FWD_DEFINED__ */\n\n\n#ifndef __CorSymWriter_SxS_FWD_DEFINED__\n#define __CorSymWriter_SxS_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorSymWriter_SxS CorSymWriter_SxS;\n#else\ntypedef struct CorSymWriter_SxS CorSymWriter_SxS;\n#endif /* __cplusplus */\n\n#endif \t/* __CorSymWriter_SxS_FWD_DEFINED__ */\n\n\n#ifndef __CorSymReader_SxS_FWD_DEFINED__\n#define __CorSymReader_SxS_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorSymReader_SxS CorSymReader_SxS;\n#else\ntypedef struct CorSymReader_SxS CorSymReader_SxS;\n#endif /* __cplusplus */\n\n#endif \t/* __CorSymReader_SxS_FWD_DEFINED__ */\n\n\n#ifndef __CorSymBinder_SxS_FWD_DEFINED__\n#define __CorSymBinder_SxS_FWD_DEFINED__\n\n#ifdef __cplusplus\ntypedef class CorSymBinder_SxS CorSymBinder_SxS;\n#else\ntypedef struct CorSymBinder_SxS CorSymBinder_SxS;\n#endif /* __cplusplus */\n\n#endif \t/* __CorSymBinder_SxS_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedBinder_FWD_DEFINED__\n#define __ISymUnmanagedBinder_FWD_DEFINED__\ntypedef interface ISymUnmanagedBinder ISymUnmanagedBinder;\n\n#endif \t/* __ISymUnmanagedBinder_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedBinder2_FWD_DEFINED__\n#define __ISymUnmanagedBinder2_FWD_DEFINED__\ntypedef interface ISymUnmanagedBinder2 ISymUnmanagedBinder2;\n\n#endif \t/* __ISymUnmanagedBinder2_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedBinder3_FWD_DEFINED__\n#define __ISymUnmanagedBinder3_FWD_DEFINED__\ntypedef interface ISymUnmanagedBinder3 ISymUnmanagedBinder3;\n\n#endif \t/* __ISymUnmanagedBinder3_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedDispose_FWD_DEFINED__\n#define __ISymUnmanagedDispose_FWD_DEFINED__\ntypedef interface ISymUnmanagedDispose ISymUnmanagedDispose;\n\n#endif \t/* __ISymUnmanagedDispose_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedDocument_FWD_DEFINED__\n#define __ISymUnmanagedDocument_FWD_DEFINED__\ntypedef interface ISymUnmanagedDocument ISymUnmanagedDocument;\n\n#endif \t/* __ISymUnmanagedDocument_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedDocumentWriter_FWD_DEFINED__\n#define __ISymUnmanagedDocumentWriter_FWD_DEFINED__\ntypedef interface ISymUnmanagedDocumentWriter ISymUnmanagedDocumentWriter;\n\n#endif \t/* __ISymUnmanagedDocumentWriter_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedMethod_FWD_DEFINED__\n#define __ISymUnmanagedMethod_FWD_DEFINED__\ntypedef interface ISymUnmanagedMethod ISymUnmanagedMethod;\n\n#endif \t/* __ISymUnmanagedMethod_FWD_DEFINED__ */\n\n\n#ifndef __ISymENCUnmanagedMethod_FWD_DEFINED__\n#define __ISymENCUnmanagedMethod_FWD_DEFINED__\ntypedef interface ISymENCUnmanagedMethod ISymENCUnmanagedMethod;\n\n#endif \t/* __ISymENCUnmanagedMethod_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedNamespace_FWD_DEFINED__\n#define __ISymUnmanagedNamespace_FWD_DEFINED__\ntypedef interface ISymUnmanagedNamespace ISymUnmanagedNamespace;\n\n#endif \t/* __ISymUnmanagedNamespace_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedReader_FWD_DEFINED__\n#define __ISymUnmanagedReader_FWD_DEFINED__\ntypedef interface ISymUnmanagedReader ISymUnmanagedReader;\n\n#endif \t/* __ISymUnmanagedReader_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedSourceServerModule_FWD_DEFINED__\n#define __ISymUnmanagedSourceServerModule_FWD_DEFINED__\ntypedef interface ISymUnmanagedSourceServerModule ISymUnmanagedSourceServerModule;\n\n#endif \t/* __ISymUnmanagedSourceServerModule_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedENCUpdate_FWD_DEFINED__\n#define __ISymUnmanagedENCUpdate_FWD_DEFINED__\ntypedef interface ISymUnmanagedENCUpdate ISymUnmanagedENCUpdate;\n\n#endif \t/* __ISymUnmanagedENCUpdate_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedReaderSymbolSearchInfo_FWD_DEFINED__\n#define __ISymUnmanagedReaderSymbolSearchInfo_FWD_DEFINED__\ntypedef interface ISymUnmanagedReaderSymbolSearchInfo ISymUnmanagedReaderSymbolSearchInfo;\n\n#endif \t/* __ISymUnmanagedReaderSymbolSearchInfo_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedScope_FWD_DEFINED__\n#define __ISymUnmanagedScope_FWD_DEFINED__\ntypedef interface ISymUnmanagedScope ISymUnmanagedScope;\n\n#endif \t/* __ISymUnmanagedScope_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedConstant_FWD_DEFINED__\n#define __ISymUnmanagedConstant_FWD_DEFINED__\ntypedef interface ISymUnmanagedConstant ISymUnmanagedConstant;\n\n#endif \t/* __ISymUnmanagedConstant_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedScope2_FWD_DEFINED__\n#define __ISymUnmanagedScope2_FWD_DEFINED__\ntypedef interface ISymUnmanagedScope2 ISymUnmanagedScope2;\n\n#endif \t/* __ISymUnmanagedScope2_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedVariable_FWD_DEFINED__\n#define __ISymUnmanagedVariable_FWD_DEFINED__\ntypedef interface ISymUnmanagedVariable ISymUnmanagedVariable;\n\n#endif \t/* __ISymUnmanagedVariable_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedSymbolSearchInfo_FWD_DEFINED__\n#define __ISymUnmanagedSymbolSearchInfo_FWD_DEFINED__\ntypedef interface ISymUnmanagedSymbolSearchInfo ISymUnmanagedSymbolSearchInfo;\n\n#endif \t/* __ISymUnmanagedSymbolSearchInfo_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter_FWD_DEFINED__\n#define __ISymUnmanagedWriter_FWD_DEFINED__\ntypedef interface ISymUnmanagedWriter ISymUnmanagedWriter;\n\n#endif \t/* __ISymUnmanagedWriter_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter2_FWD_DEFINED__\n#define __ISymUnmanagedWriter2_FWD_DEFINED__\ntypedef interface ISymUnmanagedWriter2 ISymUnmanagedWriter2;\n\n#endif \t/* __ISymUnmanagedWriter2_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter3_FWD_DEFINED__\n#define __ISymUnmanagedWriter3_FWD_DEFINED__\ntypedef interface ISymUnmanagedWriter3 ISymUnmanagedWriter3;\n\n#endif \t/* __ISymUnmanagedWriter3_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter4_FWD_DEFINED__\n#define __ISymUnmanagedWriter4_FWD_DEFINED__\ntypedef interface ISymUnmanagedWriter4 ISymUnmanagedWriter4;\n\n#endif \t/* __ISymUnmanagedWriter4_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter5_FWD_DEFINED__\n#define __ISymUnmanagedWriter5_FWD_DEFINED__\ntypedef interface ISymUnmanagedWriter5 ISymUnmanagedWriter5;\n\n#endif \t/* __ISymUnmanagedWriter5_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedReader2_FWD_DEFINED__\n#define __ISymUnmanagedReader2_FWD_DEFINED__\ntypedef interface ISymUnmanagedReader2 ISymUnmanagedReader2;\n\n#endif \t/* __ISymUnmanagedReader2_FWD_DEFINED__ */\n\n\n#ifndef __ISymNGenWriter_FWD_DEFINED__\n#define __ISymNGenWriter_FWD_DEFINED__\ntypedef interface ISymNGenWriter ISymNGenWriter;\n\n#endif \t/* __ISymNGenWriter_FWD_DEFINED__ */\n\n\n#ifndef __ISymNGenWriter2_FWD_DEFINED__\n#define __ISymNGenWriter2_FWD_DEFINED__\ntypedef interface ISymNGenWriter2 ISymNGenWriter2;\n\n#endif \t/* __ISymNGenWriter2_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedAsyncMethodPropertiesWriter_FWD_DEFINED__\n#define __ISymUnmanagedAsyncMethodPropertiesWriter_FWD_DEFINED__\ntypedef interface ISymUnmanagedAsyncMethodPropertiesWriter ISymUnmanagedAsyncMethodPropertiesWriter;\n\n#endif \t/* __ISymUnmanagedAsyncMethodPropertiesWriter_FWD_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedAsyncMethod_FWD_DEFINED__\n#define __ISymUnmanagedAsyncMethod_FWD_DEFINED__\ntypedef interface ISymUnmanagedAsyncMethod ISymUnmanagedAsyncMethod;\n\n#endif \t/* __ISymUnmanagedAsyncMethod_FWD_DEFINED__ */\n\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n/* interface __MIDL_itf_corsym_0000_0000 */\n/* [local] */ \n\n#if 0\ntypedef typedef unsigned int UINT32;\n;\n\ntypedef mdToken mdTypeDef;\n\ntypedef mdToken mdMethodDef;\n\ntypedef typedef ULONG_PTR SIZE_T;\n;\n\n#endif\n#ifndef __CORHDR_H__\ntypedef mdToken mdSignature;\n\n#endif\n#pragma once\n#pragma once\n#pragma region Input Buffer SAL 1 compatibility macros\n#pragma endregion Input Buffer SAL 1 compatibility macros\n#pragma once\n#pragma once\nEXTERN_GUID(CorSym_LanguageType_C, 0x63a08714, 0xfc37, 0x11d2, 0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\nEXTERN_GUID(CorSym_LanguageType_CPlusPlus, 0x3a12d0b7, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\nEXTERN_GUID(CorSym_LanguageType_CSharp, 0x3f5162f8, 0x07c6, 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\nEXTERN_GUID(CorSym_LanguageType_Basic, 0x3a12d0b8, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\nEXTERN_GUID(CorSym_LanguageType_Java, 0x3a12d0b4, 0xc26c, 0x11d0, 0xb4, 0x42, 0x0, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\nEXTERN_GUID(CorSym_LanguageType_Cobol, 0xaf046cd1, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\nEXTERN_GUID(CorSym_LanguageType_Pascal, 0xaf046cd2, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\nEXTERN_GUID(CorSym_LanguageType_ILAssembly, 0xaf046cd3, 0xd0e1, 0x11d2, 0x97, 0x7c, 0x0, 0xa0, 0xc9, 0xb4, 0xd5, 0xc);\nEXTERN_GUID(CorSym_LanguageType_JScript, 0x3a12d0b6, 0xc26c, 0x11d0, 0xb4, 0x42, 0x00, 0xa0, 0x24, 0x4a, 0x1d, 0xd2);\nEXTERN_GUID(CorSym_LanguageType_SMC, 0xd9b9f7b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd);\nEXTERN_GUID(CorSym_LanguageType_MCPlusPlus, 0x4b35fde8, 0x07c6, 0x11d3, 0x90, 0x53, 0x0, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\nEXTERN_GUID(CorSym_LanguageVendor_Microsoft, 0x994b45c4, 0xe6e9, 0x11d2, 0x90, 0x3f, 0x00, 0xc0, 0x4f, 0xa3, 0x02, 0xa1);\nEXTERN_GUID(CorSym_DocumentType_Text, 0x5a869d0b, 0x6611, 0x11d3, 0xbd, 0x2a, 0x0, 0x0, 0xf8, 0x8, 0x49, 0xbd);\nEXTERN_GUID(CorSym_DocumentType_MC, 0xeb40cb65, 0x3c1f, 0x4352, 0x9d, 0x7b, 0xba, 0xf, 0xc4, 0x7a, 0x9d, 0x77);\nEXTERN_GUID(CorSym_SourceHash_MD5,  0x406ea660, 0x64cf, 0x4c82, 0xb6, 0xf0, 0x42, 0xd4, 0x81, 0x72, 0xa7, 0x99);\nEXTERN_GUID(CorSym_SourceHash_SHA1, 0xff1816ec, 0xaa5e, 0x4d10, 0x87, 0xf7, 0x6f, 0x49, 0x63, 0x83, 0x34, 0x60);\n\n\n\n\n\n\n\n\n\n\n\n\ntypedef \nenum CorSymAddrKind\n    {\n        ADDR_IL_OFFSET\t= 1,\n        ADDR_NATIVE_RVA\t= 2,\n        ADDR_NATIVE_REGISTER\t= 3,\n        ADDR_NATIVE_REGREL\t= 4,\n        ADDR_NATIVE_OFFSET\t= 5,\n        ADDR_NATIVE_REGREG\t= 6,\n        ADDR_NATIVE_REGSTK\t= 7,\n        ADDR_NATIVE_STKREG\t= 8,\n        ADDR_BITFIELD\t= 9,\n        ADDR_NATIVE_ISECTOFFSET\t= 10\n    } \tCorSymAddrKind;\n\ntypedef \nenum CorSymVarFlag\n    {\n        VAR_IS_COMP_GEN\t= 1\n    } \tCorSymVarFlag;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corsym_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corsym_0000_0000_v0_0_s_ifspec;\n\n\n#ifndef __CorSymLib_LIBRARY_DEFINED__\n#define __CorSymLib_LIBRARY_DEFINED__\n\n/* library CorSymLib */\n/* [helpstring][version][uuid] */ \n\n\nEXTERN_C const IID LIBID_CorSymLib;\n\nEXTERN_C const CLSID CLSID_CorSymWriter_deprecated;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"108296C1-281E-11d3-BD22-0000F80849BD\")\nCorSymWriter_deprecated;\n#endif\n\nEXTERN_C const CLSID CLSID_CorSymReader_deprecated;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"108296C2-281E-11d3-BD22-0000F80849BD\")\nCorSymReader_deprecated;\n#endif\n\nEXTERN_C const CLSID CLSID_CorSymBinder_deprecated;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"AA544D41-28CB-11d3-BD22-0000F80849BD\")\nCorSymBinder_deprecated;\n#endif\n\nEXTERN_C const CLSID CLSID_CorSymWriter_SxS;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"0AE2DEB0-F901-478b-BB9F-881EE8066788\")\nCorSymWriter_SxS;\n#endif\n\nEXTERN_C const CLSID CLSID_CorSymReader_SxS;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"0A3976C5-4529-4ef8-B0B0-42EED37082CD\")\nCorSymReader_SxS;\n#endif\n\nEXTERN_C const CLSID CLSID_CorSymBinder_SxS;\n\n#ifdef __cplusplus\n\nclass DECLSPEC_UUID(\"0A29FF9E-7F9C-4437-8B11-F424491E3931\")\nCorSymBinder_SxS;\n#endif\n#endif /* __CorSymLib_LIBRARY_DEFINED__ */\n\n#ifndef __ISymUnmanagedBinder_INTERFACE_DEFINED__\n#define __ISymUnmanagedBinder_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedBinder */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedBinder;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"AA544D42-28CB-11d3-BD22-0000F80849BD\")\n    ISymUnmanagedBinder : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetReaderForFile( \n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetReaderFromStream( \n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in_opt IStream *pstream,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedBinderVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedBinder * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedBinder * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedBinder * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderForFile )( \n            __RPC__in ISymUnmanagedBinder * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderFromStream )( \n            __RPC__in ISymUnmanagedBinder * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in_opt IStream *pstream,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        END_INTERFACE\n    } ISymUnmanagedBinderVtbl;\n\n    interface ISymUnmanagedBinder\n    {\n        CONST_VTBL struct ISymUnmanagedBinderVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedBinder_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedBinder_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedBinder_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedBinder_GetReaderForFile(This,importer,fileName,searchPath,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderForFile(This,importer,fileName,searchPath,pRetVal) ) \n\n#define ISymUnmanagedBinder_GetReaderFromStream(This,importer,pstream,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderFromStream(This,importer,pstream,pRetVal) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedBinder_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_corsym_0000_0002 */\n/* [local] */ \n\ntypedef \nenum CorSymSearchPolicyAttributes\n    {\n        AllowRegistryAccess\t= 0x1,\n        AllowSymbolServerAccess\t= 0x2,\n        AllowOriginalPathAccess\t= 0x4,\n        AllowReferencePathAccess\t= 0x8\n    } \tCorSymSearchPolicyAttributes;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corsym_0000_0002_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corsym_0000_0002_v0_0_s_ifspec;\n\n#ifndef __ISymUnmanagedBinder2_INTERFACE_DEFINED__\n#define __ISymUnmanagedBinder2_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedBinder2 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedBinder2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"ACCEE350-89AF-4ccb-8B40-1C2C4C6F9434\")\n    ISymUnmanagedBinder2 : public ISymUnmanagedBinder\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetReaderForFile2( \n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ ULONG32 searchPolicy,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedBinder2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedBinder2 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedBinder2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedBinder2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderForFile )( \n            __RPC__in ISymUnmanagedBinder2 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderFromStream )( \n            __RPC__in ISymUnmanagedBinder2 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in_opt IStream *pstream,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderForFile2 )( \n            __RPC__in ISymUnmanagedBinder2 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ ULONG32 searchPolicy,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        END_INTERFACE\n    } ISymUnmanagedBinder2Vtbl;\n\n    interface ISymUnmanagedBinder2\n    {\n        CONST_VTBL struct ISymUnmanagedBinder2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedBinder2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedBinder2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedBinder2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedBinder2_GetReaderForFile(This,importer,fileName,searchPath,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderForFile(This,importer,fileName,searchPath,pRetVal) ) \n\n#define ISymUnmanagedBinder2_GetReaderFromStream(This,importer,pstream,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderFromStream(This,importer,pstream,pRetVal) ) \n\n\n#define ISymUnmanagedBinder2_GetReaderForFile2(This,importer,fileName,searchPath,searchPolicy,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderForFile2(This,importer,fileName,searchPath,searchPolicy,pRetVal) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedBinder2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedBinder3_INTERFACE_DEFINED__\n#define __ISymUnmanagedBinder3_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedBinder3 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedBinder3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"28AD3D43-B601-4d26-8A1B-25F9165AF9D7\")\n    ISymUnmanagedBinder3 : public ISymUnmanagedBinder2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetReaderFromCallback( \n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ ULONG32 searchPolicy,\n            /* [in] */ __RPC__in_opt IUnknown *callback,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedBinder3Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedBinder3 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedBinder3 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedBinder3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderForFile )( \n            __RPC__in ISymUnmanagedBinder3 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderFromStream )( \n            __RPC__in ISymUnmanagedBinder3 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in_opt IStream *pstream,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderForFile2 )( \n            __RPC__in ISymUnmanagedBinder3 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ ULONG32 searchPolicy,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetReaderFromCallback )( \n            __RPC__in ISymUnmanagedBinder3 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *fileName,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ ULONG32 searchPolicy,\n            /* [in] */ __RPC__in_opt IUnknown *callback,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedReader **pRetVal);\n        \n        END_INTERFACE\n    } ISymUnmanagedBinder3Vtbl;\n\n    interface ISymUnmanagedBinder3\n    {\n        CONST_VTBL struct ISymUnmanagedBinder3Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedBinder3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedBinder3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedBinder3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedBinder3_GetReaderForFile(This,importer,fileName,searchPath,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderForFile(This,importer,fileName,searchPath,pRetVal) ) \n\n#define ISymUnmanagedBinder3_GetReaderFromStream(This,importer,pstream,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderFromStream(This,importer,pstream,pRetVal) ) \n\n\n#define ISymUnmanagedBinder3_GetReaderForFile2(This,importer,fileName,searchPath,searchPolicy,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderForFile2(This,importer,fileName,searchPath,searchPolicy,pRetVal) ) \n\n\n#define ISymUnmanagedBinder3_GetReaderFromCallback(This,importer,fileName,searchPath,searchPolicy,callback,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetReaderFromCallback(This,importer,fileName,searchPath,searchPolicy,callback,pRetVal) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedBinder3_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_corsym_0000_0004 */\n/* [local] */ \n\nstatic const int E_SYM_DESTROYED = MAKE_HRESULT(1, FACILITY_ITF, 0xdead);\n\n\nextern RPC_IF_HANDLE __MIDL_itf_corsym_0000_0004_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_corsym_0000_0004_v0_0_s_ifspec;\n\n#ifndef __ISymUnmanagedDispose_INTERFACE_DEFINED__\n#define __ISymUnmanagedDispose_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedDispose */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedDispose;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"969708D2-05E5-4861-A3B0-96E473CDF63F\")\n    ISymUnmanagedDispose : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Destroy( void) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedDisposeVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedDispose * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedDispose * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedDispose * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Destroy )( \n            __RPC__in ISymUnmanagedDispose * This);\n        \n        END_INTERFACE\n    } ISymUnmanagedDisposeVtbl;\n\n    interface ISymUnmanagedDispose\n    {\n        CONST_VTBL struct ISymUnmanagedDisposeVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedDispose_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedDispose_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedDispose_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedDispose_Destroy(This)\t\\\n    ( (This)->lpVtbl -> Destroy(This) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedDispose_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedDocument_INTERFACE_DEFINED__\n#define __ISymUnmanagedDocument_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedDocument */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedDocument;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"40DE4037-7C81-3E1E-B022-AE1ABFF2CA08\")\n    ISymUnmanagedDocument : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetURL( \n            /* [in] */ ULONG32 cchUrl,\n            /* [out] */ __RPC__out ULONG32 *pcchUrl,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchUrl, *pcchUrl) WCHAR szUrl[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDocumentType( \n            /* [retval][out] */ __RPC__out GUID *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLanguage( \n            /* [retval][out] */ __RPC__out GUID *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLanguageVendor( \n            /* [retval][out] */ __RPC__out GUID *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCheckSumAlgorithmId( \n            /* [retval][out] */ __RPC__out GUID *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCheckSum( \n            /* [in] */ ULONG32 cData,\n            /* [out] */ __RPC__out ULONG32 *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE FindClosestLine( \n            /* [in] */ ULONG32 line,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE HasEmbeddedSource( \n            /* [retval][out] */ __RPC__out BOOL *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSourceLength( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSourceRange( \n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn,\n            /* [in] */ ULONG32 cSourceBytes,\n            /* [out] */ __RPC__out ULONG32 *pcSourceBytes,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSourceBytes, *pcSourceBytes) BYTE source[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedDocumentVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedDocument * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedDocument * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetURL )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [in] */ ULONG32 cchUrl,\n            /* [out] */ __RPC__out ULONG32 *pcchUrl,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchUrl, *pcchUrl) WCHAR szUrl[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocumentType )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [retval][out] */ __RPC__out GUID *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLanguage )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [retval][out] */ __RPC__out GUID *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLanguageVendor )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [retval][out] */ __RPC__out GUID *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCheckSumAlgorithmId )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [retval][out] */ __RPC__out GUID *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCheckSum )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [in] */ ULONG32 cData,\n            /* [out] */ __RPC__out ULONG32 *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *FindClosestLine )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [in] */ ULONG32 line,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *HasEmbeddedSource )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [retval][out] */ __RPC__out BOOL *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSourceLength )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSourceRange )( \n            __RPC__in ISymUnmanagedDocument * This,\n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn,\n            /* [in] */ ULONG32 cSourceBytes,\n            /* [out] */ __RPC__out ULONG32 *pcSourceBytes,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSourceBytes, *pcSourceBytes) BYTE source[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedDocumentVtbl;\n\n    interface ISymUnmanagedDocument\n    {\n        CONST_VTBL struct ISymUnmanagedDocumentVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedDocument_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedDocument_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedDocument_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedDocument_GetURL(This,cchUrl,pcchUrl,szUrl)\t\\\n    ( (This)->lpVtbl -> GetURL(This,cchUrl,pcchUrl,szUrl) ) \n\n#define ISymUnmanagedDocument_GetDocumentType(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetDocumentType(This,pRetVal) ) \n\n#define ISymUnmanagedDocument_GetLanguage(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetLanguage(This,pRetVal) ) \n\n#define ISymUnmanagedDocument_GetLanguageVendor(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetLanguageVendor(This,pRetVal) ) \n\n#define ISymUnmanagedDocument_GetCheckSumAlgorithmId(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetCheckSumAlgorithmId(This,pRetVal) ) \n\n#define ISymUnmanagedDocument_GetCheckSum(This,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetCheckSum(This,cData,pcData,data) ) \n\n#define ISymUnmanagedDocument_FindClosestLine(This,line,pRetVal)\t\\\n    ( (This)->lpVtbl -> FindClosestLine(This,line,pRetVal) ) \n\n#define ISymUnmanagedDocument_HasEmbeddedSource(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> HasEmbeddedSource(This,pRetVal) ) \n\n#define ISymUnmanagedDocument_GetSourceLength(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetSourceLength(This,pRetVal) ) \n\n#define ISymUnmanagedDocument_GetSourceRange(This,startLine,startColumn,endLine,endColumn,cSourceBytes,pcSourceBytes,source)\t\\\n    ( (This)->lpVtbl -> GetSourceRange(This,startLine,startColumn,endLine,endColumn,cSourceBytes,pcSourceBytes,source) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedDocument_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedDocumentWriter_INTERFACE_DEFINED__\n#define __ISymUnmanagedDocumentWriter_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedDocumentWriter */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedDocumentWriter;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"B01FAFEB-C450-3A4D-BEEC-B4CEEC01E006\")\n    ISymUnmanagedDocumentWriter : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetSource( \n            /* [in] */ ULONG32 sourceSize,\n            /* [size_is][in] */ __RPC__in_ecount_full(sourceSize) BYTE source[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetCheckSum( \n            /* [in] */ GUID algorithmId,\n            /* [in] */ ULONG32 checkSumSize,\n            /* [size_is][in] */ __RPC__in_ecount_full(checkSumSize) BYTE checkSum[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedDocumentWriterVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedDocumentWriter * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedDocumentWriter * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedDocumentWriter * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetSource )( \n            __RPC__in ISymUnmanagedDocumentWriter * This,\n            /* [in] */ ULONG32 sourceSize,\n            /* [size_is][in] */ __RPC__in_ecount_full(sourceSize) BYTE source[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetCheckSum )( \n            __RPC__in ISymUnmanagedDocumentWriter * This,\n            /* [in] */ GUID algorithmId,\n            /* [in] */ ULONG32 checkSumSize,\n            /* [size_is][in] */ __RPC__in_ecount_full(checkSumSize) BYTE checkSum[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedDocumentWriterVtbl;\n\n    interface ISymUnmanagedDocumentWriter\n    {\n        CONST_VTBL struct ISymUnmanagedDocumentWriterVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedDocumentWriter_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedDocumentWriter_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedDocumentWriter_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedDocumentWriter_SetSource(This,sourceSize,source)\t\\\n    ( (This)->lpVtbl -> SetSource(This,sourceSize,source) ) \n\n#define ISymUnmanagedDocumentWriter_SetCheckSum(This,algorithmId,checkSumSize,checkSum)\t\\\n    ( (This)->lpVtbl -> SetCheckSum(This,algorithmId,checkSumSize,checkSum) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedDocumentWriter_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedMethod_INTERFACE_DEFINED__\n#define __ISymUnmanagedMethod_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedMethod */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedMethod;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"B62B923C-B500-3158-A543-24F307A8B7E1\")\n    ISymUnmanagedMethod : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetToken( \n            /* [retval][out] */ __RPC__out mdMethodDef *pToken) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSequencePointCount( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetRootScope( \n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedScope **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetScopeFromOffset( \n            /* [in] */ ULONG32 offset,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedScope **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetOffset( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetRanges( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [in] */ ULONG32 cRanges,\n            /* [out] */ __RPC__out ULONG32 *pcRanges,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cRanges, *pcRanges) ULONG32 ranges[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetParameters( \n            /* [in] */ ULONG32 cParams,\n            /* [out] */ __RPC__out ULONG32 *pcParams,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cParams, *pcParams) ISymUnmanagedVariable *params[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNamespace( \n            /* [out] */ __RPC__deref_out_opt ISymUnmanagedNamespace **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSourceStartEnd( \n            /* [in] */ __RPC__in_ecount_full(2) ISymUnmanagedDocument *docs[ 2 ],\n            /* [in] */ __RPC__in_ecount_full(2) ULONG32 lines[ 2 ],\n            /* [in] */ __RPC__in_ecount_full(2) ULONG32 columns[ 2 ],\n            /* [out] */ __RPC__out BOOL *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSequencePoints( \n            /* [in] */ ULONG32 cPoints,\n            /* [out] */ __RPC__out ULONG32 *pcPoints,\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ISymUnmanagedDocument *documents[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 endColumns[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedMethodVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedMethod * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedMethod * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetToken )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [retval][out] */ __RPC__out mdMethodDef *pToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSequencePointCount )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRootScope )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedScope **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetScopeFromOffset )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [in] */ ULONG32 offset,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedScope **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetOffset )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRanges )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [in] */ ULONG32 cRanges,\n            /* [out] */ __RPC__out ULONG32 *pcRanges,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cRanges, *pcRanges) ULONG32 ranges[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetParameters )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [in] */ ULONG32 cParams,\n            /* [out] */ __RPC__out ULONG32 *pcParams,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cParams, *pcParams) ISymUnmanagedVariable *params[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNamespace )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [out] */ __RPC__deref_out_opt ISymUnmanagedNamespace **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSourceStartEnd )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [in] */ __RPC__in_ecount_full(2) ISymUnmanagedDocument *docs[ 2 ],\n            /* [in] */ __RPC__in_ecount_full(2) ULONG32 lines[ 2 ],\n            /* [in] */ __RPC__in_ecount_full(2) ULONG32 columns[ 2 ],\n            /* [out] */ __RPC__out BOOL *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSequencePoints )( \n            __RPC__in ISymUnmanagedMethod * This,\n            /* [in] */ ULONG32 cPoints,\n            /* [out] */ __RPC__out ULONG32 *pcPoints,\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ISymUnmanagedDocument *documents[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cPoints) ULONG32 endColumns[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedMethodVtbl;\n\n    interface ISymUnmanagedMethod\n    {\n        CONST_VTBL struct ISymUnmanagedMethodVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedMethod_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedMethod_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedMethod_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedMethod_GetToken(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetToken(This,pToken) ) \n\n#define ISymUnmanagedMethod_GetSequencePointCount(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetSequencePointCount(This,pRetVal) ) \n\n#define ISymUnmanagedMethod_GetRootScope(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetRootScope(This,pRetVal) ) \n\n#define ISymUnmanagedMethod_GetScopeFromOffset(This,offset,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetScopeFromOffset(This,offset,pRetVal) ) \n\n#define ISymUnmanagedMethod_GetOffset(This,document,line,column,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetOffset(This,document,line,column,pRetVal) ) \n\n#define ISymUnmanagedMethod_GetRanges(This,document,line,column,cRanges,pcRanges,ranges)\t\\\n    ( (This)->lpVtbl -> GetRanges(This,document,line,column,cRanges,pcRanges,ranges) ) \n\n#define ISymUnmanagedMethod_GetParameters(This,cParams,pcParams,params)\t\\\n    ( (This)->lpVtbl -> GetParameters(This,cParams,pcParams,params) ) \n\n#define ISymUnmanagedMethod_GetNamespace(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetNamespace(This,pRetVal) ) \n\n#define ISymUnmanagedMethod_GetSourceStartEnd(This,docs,lines,columns,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetSourceStartEnd(This,docs,lines,columns,pRetVal) ) \n\n#define ISymUnmanagedMethod_GetSequencePoints(This,cPoints,pcPoints,offsets,documents,lines,columns,endLines,endColumns)\t\\\n    ( (This)->lpVtbl -> GetSequencePoints(This,cPoints,pcPoints,offsets,documents,lines,columns,endLines,endColumns) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedMethod_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymENCUnmanagedMethod_INTERFACE_DEFINED__\n#define __ISymENCUnmanagedMethod_INTERFACE_DEFINED__\n\n/* interface ISymENCUnmanagedMethod */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymENCUnmanagedMethod;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"85E891DA-A631-4c76-ACA2-A44A39C46B8C\")\n    ISymENCUnmanagedMethod : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetFileNameFromOffset( \n            /* [in] */ ULONG32 dwOffset,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLineFromOffset( \n            /* [in] */ ULONG32 dwOffset,\n            /* [out] */ __RPC__out ULONG32 *pline,\n            /* [out] */ __RPC__out ULONG32 *pcolumn,\n            /* [out] */ __RPC__out ULONG32 *pendLine,\n            /* [out] */ __RPC__out ULONG32 *pendColumn,\n            /* [out] */ __RPC__out ULONG32 *pdwStartOffset) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDocumentsForMethodCount( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDocumentsForMethod( \n            /* [in] */ ULONG32 cDocs,\n            /* [out] */ __RPC__out ULONG32 *pcDocs,\n            /* [size_is][in] */ __RPC__in_ecount_full(cDocs) ISymUnmanagedDocument *documents[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSourceExtentInDocument( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [out] */ __RPC__out ULONG32 *pstartLine,\n            /* [out] */ __RPC__out ULONG32 *pendLine) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymENCUnmanagedMethodVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymENCUnmanagedMethod * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymENCUnmanagedMethod * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymENCUnmanagedMethod * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFileNameFromOffset )( \n            __RPC__in ISymENCUnmanagedMethod * This,\n            /* [in] */ ULONG32 dwOffset,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLineFromOffset )( \n            __RPC__in ISymENCUnmanagedMethod * This,\n            /* [in] */ ULONG32 dwOffset,\n            /* [out] */ __RPC__out ULONG32 *pline,\n            /* [out] */ __RPC__out ULONG32 *pcolumn,\n            /* [out] */ __RPC__out ULONG32 *pendLine,\n            /* [out] */ __RPC__out ULONG32 *pendColumn,\n            /* [out] */ __RPC__out ULONG32 *pdwStartOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocumentsForMethodCount )( \n            __RPC__in ISymENCUnmanagedMethod * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocumentsForMethod )( \n            __RPC__in ISymENCUnmanagedMethod * This,\n            /* [in] */ ULONG32 cDocs,\n            /* [out] */ __RPC__out ULONG32 *pcDocs,\n            /* [size_is][in] */ __RPC__in_ecount_full(cDocs) ISymUnmanagedDocument *documents[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSourceExtentInDocument )( \n            __RPC__in ISymENCUnmanagedMethod * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [out] */ __RPC__out ULONG32 *pstartLine,\n            /* [out] */ __RPC__out ULONG32 *pendLine);\n        \n        END_INTERFACE\n    } ISymENCUnmanagedMethodVtbl;\n\n    interface ISymENCUnmanagedMethod\n    {\n        CONST_VTBL struct ISymENCUnmanagedMethodVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymENCUnmanagedMethod_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymENCUnmanagedMethod_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymENCUnmanagedMethod_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymENCUnmanagedMethod_GetFileNameFromOffset(This,dwOffset,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetFileNameFromOffset(This,dwOffset,cchName,pcchName,szName) ) \n\n#define ISymENCUnmanagedMethod_GetLineFromOffset(This,dwOffset,pline,pcolumn,pendLine,pendColumn,pdwStartOffset)\t\\\n    ( (This)->lpVtbl -> GetLineFromOffset(This,dwOffset,pline,pcolumn,pendLine,pendColumn,pdwStartOffset) ) \n\n#define ISymENCUnmanagedMethod_GetDocumentsForMethodCount(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetDocumentsForMethodCount(This,pRetVal) ) \n\n#define ISymENCUnmanagedMethod_GetDocumentsForMethod(This,cDocs,pcDocs,documents)\t\\\n    ( (This)->lpVtbl -> GetDocumentsForMethod(This,cDocs,pcDocs,documents) ) \n\n#define ISymENCUnmanagedMethod_GetSourceExtentInDocument(This,document,pstartLine,pendLine)\t\\\n    ( (This)->lpVtbl -> GetSourceExtentInDocument(This,document,pstartLine,pendLine) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymENCUnmanagedMethod_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedNamespace_INTERFACE_DEFINED__\n#define __ISymUnmanagedNamespace_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedNamespace */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedNamespace;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"0DFF7289-54F8-11d3-BD28-0000F80849BD\")\n    ISymUnmanagedNamespace : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNamespaces( \n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetVariables( \n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedNamespaceVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedNamespace * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedNamespace * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedNamespace * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            __RPC__in ISymUnmanagedNamespace * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNamespaces )( \n            __RPC__in ISymUnmanagedNamespace * This,\n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetVariables )( \n            __RPC__in ISymUnmanagedNamespace * This,\n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedNamespaceVtbl;\n\n    interface ISymUnmanagedNamespace\n    {\n        CONST_VTBL struct ISymUnmanagedNamespaceVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedNamespace_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedNamespace_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedNamespace_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedNamespace_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) \n\n#define ISymUnmanagedNamespace_GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces)\t\\\n    ( (This)->lpVtbl -> GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces) ) \n\n#define ISymUnmanagedNamespace_GetVariables(This,cVars,pcVars,pVars)\t\\\n    ( (This)->lpVtbl -> GetVariables(This,cVars,pcVars,pVars) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedNamespace_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedReader_INTERFACE_DEFINED__\n#define __ISymUnmanagedReader_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedReader */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedReader;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"B4CE6286-2A6B-3712-A3B7-1EE1DAD467B5\")\n    ISymUnmanagedReader : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetDocument( \n            /* [in] */ __RPC__in WCHAR *url,\n            /* [in] */ GUID language,\n            /* [in] */ GUID languageVendor,\n            /* [in] */ GUID documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocument **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDocuments( \n            /* [in] */ ULONG32 cDocs,\n            /* [out] */ __RPC__out ULONG32 *pcDocs,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cDocs, *pcDocs) ISymUnmanagedDocument *pDocs[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetUserEntryPoint( \n            /* [retval][out] */ __RPC__out mdMethodDef *pToken) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethod( \n            /* [in] */ mdMethodDef token,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodByVersion( \n            /* [in] */ mdMethodDef token,\n            /* [in] */ int version,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetVariables( \n            /* [in] */ mdToken parent,\n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetGlobalVariables( \n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodFromDocumentPosition( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSymAttribute( \n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in WCHAR *name,\n            /* [in] */ ULONG32 cBuffer,\n            /* [out] */ __RPC__out ULONG32 *pcBuffer,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cBuffer, *pcBuffer) BYTE buffer[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNamespaces( \n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Initialize( \n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ __RPC__in_opt IStream *pIStream) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE UpdateSymbolStore( \n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ReplaceSymbolStore( \n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSymbolStoreFileName( \n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodsFromDocumentPosition( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [in] */ ULONG32 cMethod,\n            /* [out] */ __RPC__out ULONG32 *pcMethod,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cMethod, *pcMethod) ISymUnmanagedMethod *pRetVal[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDocumentVersion( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *pDoc,\n            /* [out] */ __RPC__out int *version,\n            /* [out] */ __RPC__out BOOL *pbCurrent) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodVersion( \n            /* [in] */ __RPC__in_opt ISymUnmanagedMethod *pMethod,\n            /* [out] */ __RPC__out int *version) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedReaderVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedReader * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedReader * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocument )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in WCHAR *url,\n            /* [in] */ GUID language,\n            /* [in] */ GUID languageVendor,\n            /* [in] */ GUID documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocument **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocuments )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ ULONG32 cDocs,\n            /* [out] */ __RPC__out ULONG32 *pcDocs,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cDocs, *pcDocs) ISymUnmanagedDocument *pDocs[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetUserEntryPoint )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [retval][out] */ __RPC__out mdMethodDef *pToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethod )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ mdMethodDef token,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodByVersion )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ mdMethodDef token,\n            /* [in] */ int version,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetVariables )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetGlobalVariables )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodFromDocumentPosition )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSymAttribute )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in WCHAR *name,\n            /* [in] */ ULONG32 cBuffer,\n            /* [out] */ __RPC__out ULONG32 *pcBuffer,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cBuffer, *pcBuffer) BYTE buffer[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNamespaces )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ __RPC__in_opt IStream *pIStream);\n        \n        HRESULT ( STDMETHODCALLTYPE *UpdateSymbolStore )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream);\n        \n        HRESULT ( STDMETHODCALLTYPE *ReplaceSymbolStore )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSymbolStoreFileName )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodsFromDocumentPosition )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [in] */ ULONG32 cMethod,\n            /* [out] */ __RPC__out ULONG32 *pcMethod,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cMethod, *pcMethod) ISymUnmanagedMethod *pRetVal[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocumentVersion )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *pDoc,\n            /* [out] */ __RPC__out int *version,\n            /* [out] */ __RPC__out BOOL *pbCurrent);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodVersion )( \n            __RPC__in ISymUnmanagedReader * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedMethod *pMethod,\n            /* [out] */ __RPC__out int *version);\n        \n        END_INTERFACE\n    } ISymUnmanagedReaderVtbl;\n\n    interface ISymUnmanagedReader\n    {\n        CONST_VTBL struct ISymUnmanagedReaderVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedReader_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedReader_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedReader_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedReader_GetDocument(This,url,language,languageVendor,documentType,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetDocument(This,url,language,languageVendor,documentType,pRetVal) ) \n\n#define ISymUnmanagedReader_GetDocuments(This,cDocs,pcDocs,pDocs)\t\\\n    ( (This)->lpVtbl -> GetDocuments(This,cDocs,pcDocs,pDocs) ) \n\n#define ISymUnmanagedReader_GetUserEntryPoint(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetUserEntryPoint(This,pToken) ) \n\n#define ISymUnmanagedReader_GetMethod(This,token,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethod(This,token,pRetVal) ) \n\n#define ISymUnmanagedReader_GetMethodByVersion(This,token,version,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodByVersion(This,token,version,pRetVal) ) \n\n#define ISymUnmanagedReader_GetVariables(This,parent,cVars,pcVars,pVars)\t\\\n    ( (This)->lpVtbl -> GetVariables(This,parent,cVars,pcVars,pVars) ) \n\n#define ISymUnmanagedReader_GetGlobalVariables(This,cVars,pcVars,pVars)\t\\\n    ( (This)->lpVtbl -> GetGlobalVariables(This,cVars,pcVars,pVars) ) \n\n#define ISymUnmanagedReader_GetMethodFromDocumentPosition(This,document,line,column,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodFromDocumentPosition(This,document,line,column,pRetVal) ) \n\n#define ISymUnmanagedReader_GetSymAttribute(This,parent,name,cBuffer,pcBuffer,buffer)\t\\\n    ( (This)->lpVtbl -> GetSymAttribute(This,parent,name,cBuffer,pcBuffer,buffer) ) \n\n#define ISymUnmanagedReader_GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces)\t\\\n    ( (This)->lpVtbl -> GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces) ) \n\n#define ISymUnmanagedReader_Initialize(This,importer,filename,searchPath,pIStream)\t\\\n    ( (This)->lpVtbl -> Initialize(This,importer,filename,searchPath,pIStream) ) \n\n#define ISymUnmanagedReader_UpdateSymbolStore(This,filename,pIStream)\t\\\n    ( (This)->lpVtbl -> UpdateSymbolStore(This,filename,pIStream) ) \n\n#define ISymUnmanagedReader_ReplaceSymbolStore(This,filename,pIStream)\t\\\n    ( (This)->lpVtbl -> ReplaceSymbolStore(This,filename,pIStream) ) \n\n#define ISymUnmanagedReader_GetSymbolStoreFileName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetSymbolStoreFileName(This,cchName,pcchName,szName) ) \n\n#define ISymUnmanagedReader_GetMethodsFromDocumentPosition(This,document,line,column,cMethod,pcMethod,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodsFromDocumentPosition(This,document,line,column,cMethod,pcMethod,pRetVal) ) \n\n#define ISymUnmanagedReader_GetDocumentVersion(This,pDoc,version,pbCurrent)\t\\\n    ( (This)->lpVtbl -> GetDocumentVersion(This,pDoc,version,pbCurrent) ) \n\n#define ISymUnmanagedReader_GetMethodVersion(This,pMethod,version)\t\\\n    ( (This)->lpVtbl -> GetMethodVersion(This,pMethod,version) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedReader_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedSourceServerModule_INTERFACE_DEFINED__\n#define __ISymUnmanagedSourceServerModule_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedSourceServerModule */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedSourceServerModule;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"997DD0CC-A76F-4c82-8D79-EA87559D27AD\")\n    ISymUnmanagedSourceServerModule : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetSourceServerData( \n            /* [out] */ __RPC__out ULONG *pDataByteCount,\n            /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pDataByteCount) BYTE **ppData) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedSourceServerModuleVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedSourceServerModule * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedSourceServerModule * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedSourceServerModule * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSourceServerData )( \n            __RPC__in ISymUnmanagedSourceServerModule * This,\n            /* [out] */ __RPC__out ULONG *pDataByteCount,\n            /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pDataByteCount) BYTE **ppData);\n        \n        END_INTERFACE\n    } ISymUnmanagedSourceServerModuleVtbl;\n\n    interface ISymUnmanagedSourceServerModule\n    {\n        CONST_VTBL struct ISymUnmanagedSourceServerModuleVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedSourceServerModule_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedSourceServerModule_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedSourceServerModule_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedSourceServerModule_GetSourceServerData(This,pDataByteCount,ppData)\t\\\n    ( (This)->lpVtbl -> GetSourceServerData(This,pDataByteCount,ppData) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedSourceServerModule_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedENCUpdate_INTERFACE_DEFINED__\n#define __ISymUnmanagedENCUpdate_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedENCUpdate */\n/* [unique][uuid][object] */ \n\ntypedef struct _SYMLINEDELTA\n    {\n    mdMethodDef mdMethod;\n    INT32 delta;\n    } \tSYMLINEDELTA;\n\n\nEXTERN_C const IID IID_ISymUnmanagedENCUpdate;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"E502D2DD-8671-4338-8F2A-FC08229628C4\")\n    ISymUnmanagedENCUpdate : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE UpdateSymbolStore2( \n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ __RPC__in SYMLINEDELTA *pDeltaLines,\n            /* [in] */ ULONG cDeltaLines) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLocalVariableCount( \n            /* [in] */ mdMethodDef mdMethodToken,\n            /* [out] */ __RPC__out ULONG *pcLocals) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLocalVariables( \n            /* [in] */ mdMethodDef mdMethodToken,\n            /* [in] */ ULONG cLocals,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cLocals, *pceltFetched) ISymUnmanagedVariable *rgLocals[  ],\n            /* [out] */ __RPC__out ULONG *pceltFetched) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE InitializeForEnc( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE UpdateMethodLines( \n            /* [in] */ mdMethodDef mdMethodToken,\n            /* [size_is][in] */ __RPC__in_ecount_full(cDeltas) INT32 *pDeltas,\n            /* [in] */ ULONG cDeltas) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedENCUpdateVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedENCUpdate * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedENCUpdate * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedENCUpdate * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *UpdateSymbolStore2 )( \n            __RPC__in ISymUnmanagedENCUpdate * This,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ __RPC__in SYMLINEDELTA *pDeltaLines,\n            /* [in] */ ULONG cDeltaLines);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocalVariableCount )( \n            __RPC__in ISymUnmanagedENCUpdate * This,\n            /* [in] */ mdMethodDef mdMethodToken,\n            /* [out] */ __RPC__out ULONG *pcLocals);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocalVariables )( \n            __RPC__in ISymUnmanagedENCUpdate * This,\n            /* [in] */ mdMethodDef mdMethodToken,\n            /* [in] */ ULONG cLocals,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cLocals, *pceltFetched) ISymUnmanagedVariable *rgLocals[  ],\n            /* [out] */ __RPC__out ULONG *pceltFetched);\n        \n        HRESULT ( STDMETHODCALLTYPE *InitializeForEnc )( \n            __RPC__in ISymUnmanagedENCUpdate * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *UpdateMethodLines )( \n            __RPC__in ISymUnmanagedENCUpdate * This,\n            /* [in] */ mdMethodDef mdMethodToken,\n            /* [size_is][in] */ __RPC__in_ecount_full(cDeltas) INT32 *pDeltas,\n            /* [in] */ ULONG cDeltas);\n        \n        END_INTERFACE\n    } ISymUnmanagedENCUpdateVtbl;\n\n    interface ISymUnmanagedENCUpdate\n    {\n        CONST_VTBL struct ISymUnmanagedENCUpdateVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedENCUpdate_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedENCUpdate_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedENCUpdate_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedENCUpdate_UpdateSymbolStore2(This,pIStream,pDeltaLines,cDeltaLines)\t\\\n    ( (This)->lpVtbl -> UpdateSymbolStore2(This,pIStream,pDeltaLines,cDeltaLines) ) \n\n#define ISymUnmanagedENCUpdate_GetLocalVariableCount(This,mdMethodToken,pcLocals)\t\\\n    ( (This)->lpVtbl -> GetLocalVariableCount(This,mdMethodToken,pcLocals) ) \n\n#define ISymUnmanagedENCUpdate_GetLocalVariables(This,mdMethodToken,cLocals,rgLocals,pceltFetched)\t\\\n    ( (This)->lpVtbl -> GetLocalVariables(This,mdMethodToken,cLocals,rgLocals,pceltFetched) ) \n\n#define ISymUnmanagedENCUpdate_InitializeForEnc(This)\t\\\n    ( (This)->lpVtbl -> InitializeForEnc(This) ) \n\n#define ISymUnmanagedENCUpdate_UpdateMethodLines(This,mdMethodToken,pDeltas,cDeltas)\t\\\n    ( (This)->lpVtbl -> UpdateMethodLines(This,mdMethodToken,pDeltas,cDeltas) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedENCUpdate_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedReaderSymbolSearchInfo_INTERFACE_DEFINED__\n#define __ISymUnmanagedReaderSymbolSearchInfo_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedReaderSymbolSearchInfo */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedReaderSymbolSearchInfo;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"20D9645D-03CD-4e34-9C11-9848A5B084F1\")\n    ISymUnmanagedReaderSymbolSearchInfo : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetSymbolSearchInfoCount( \n            /* [out] */ __RPC__out ULONG32 *pcSearchInfo) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSymbolSearchInfo( \n            /* [in] */ ULONG32 cSearchInfo,\n            /* [out] */ __RPC__out ULONG32 *pcSearchInfo,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSearchInfo, *pcSearchInfo) ISymUnmanagedSymbolSearchInfo **rgpSearchInfo) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedReaderSymbolSearchInfoVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedReaderSymbolSearchInfo * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedReaderSymbolSearchInfo * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedReaderSymbolSearchInfo * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSymbolSearchInfoCount )( \n            __RPC__in ISymUnmanagedReaderSymbolSearchInfo * This,\n            /* [out] */ __RPC__out ULONG32 *pcSearchInfo);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSymbolSearchInfo )( \n            __RPC__in ISymUnmanagedReaderSymbolSearchInfo * This,\n            /* [in] */ ULONG32 cSearchInfo,\n            /* [out] */ __RPC__out ULONG32 *pcSearchInfo,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSearchInfo, *pcSearchInfo) ISymUnmanagedSymbolSearchInfo **rgpSearchInfo);\n        \n        END_INTERFACE\n    } ISymUnmanagedReaderSymbolSearchInfoVtbl;\n\n    interface ISymUnmanagedReaderSymbolSearchInfo\n    {\n        CONST_VTBL struct ISymUnmanagedReaderSymbolSearchInfoVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedReaderSymbolSearchInfo_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedReaderSymbolSearchInfo_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedReaderSymbolSearchInfo_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedReaderSymbolSearchInfo_GetSymbolSearchInfoCount(This,pcSearchInfo)\t\\\n    ( (This)->lpVtbl -> GetSymbolSearchInfoCount(This,pcSearchInfo) ) \n\n#define ISymUnmanagedReaderSymbolSearchInfo_GetSymbolSearchInfo(This,cSearchInfo,pcSearchInfo,rgpSearchInfo)\t\\\n    ( (This)->lpVtbl -> GetSymbolSearchInfo(This,cSearchInfo,pcSearchInfo,rgpSearchInfo) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedReaderSymbolSearchInfo_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedScope_INTERFACE_DEFINED__\n#define __ISymUnmanagedScope_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedScope */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedScope;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"68005D0F-B8E0-3B01-84D5-A11A94154942\")\n    ISymUnmanagedScope : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetMethod( \n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetParent( \n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedScope **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetChildren( \n            /* [in] */ ULONG32 cChildren,\n            /* [out] */ __RPC__out ULONG32 *pcChildren,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cChildren, *pcChildren) ISymUnmanagedScope *children[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetStartOffset( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetEndOffset( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLocalCount( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLocals( \n            /* [in] */ ULONG32 cLocals,\n            /* [out] */ __RPC__out ULONG32 *pcLocals,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cLocals, *pcLocals) ISymUnmanagedVariable *locals[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNamespaces( \n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedScopeVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedScope * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedScope * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethod )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetParent )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedScope **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetChildren )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [in] */ ULONG32 cChildren,\n            /* [out] */ __RPC__out ULONG32 *pcChildren,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cChildren, *pcChildren) ISymUnmanagedScope *children[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetStartOffset )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetEndOffset )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocalCount )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocals )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [in] */ ULONG32 cLocals,\n            /* [out] */ __RPC__out ULONG32 *pcLocals,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cLocals, *pcLocals) ISymUnmanagedVariable *locals[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNamespaces )( \n            __RPC__in ISymUnmanagedScope * This,\n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedScopeVtbl;\n\n    interface ISymUnmanagedScope\n    {\n        CONST_VTBL struct ISymUnmanagedScopeVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedScope_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedScope_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedScope_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedScope_GetMethod(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethod(This,pRetVal) ) \n\n#define ISymUnmanagedScope_GetParent(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetParent(This,pRetVal) ) \n\n#define ISymUnmanagedScope_GetChildren(This,cChildren,pcChildren,children)\t\\\n    ( (This)->lpVtbl -> GetChildren(This,cChildren,pcChildren,children) ) \n\n#define ISymUnmanagedScope_GetStartOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetStartOffset(This,pRetVal) ) \n\n#define ISymUnmanagedScope_GetEndOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetEndOffset(This,pRetVal) ) \n\n#define ISymUnmanagedScope_GetLocalCount(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetLocalCount(This,pRetVal) ) \n\n#define ISymUnmanagedScope_GetLocals(This,cLocals,pcLocals,locals)\t\\\n    ( (This)->lpVtbl -> GetLocals(This,cLocals,pcLocals,locals) ) \n\n#define ISymUnmanagedScope_GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces)\t\\\n    ( (This)->lpVtbl -> GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedScope_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedConstant_INTERFACE_DEFINED__\n#define __ISymUnmanagedConstant_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedConstant */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedConstant;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"48B25ED8-5BAD-41bc-9CEE-CD62FABC74E9\")\n    ISymUnmanagedConstant : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetValue( \n            __RPC__in VARIANT *pValue) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSignature( \n            /* [in] */ ULONG32 cSig,\n            /* [out] */ __RPC__out ULONG32 *pcSig,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSig, *pcSig) BYTE sig[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedConstantVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedConstant * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedConstant * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedConstant * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            __RPC__in ISymUnmanagedConstant * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetValue )( \n            __RPC__in ISymUnmanagedConstant * This,\n            __RPC__in VARIANT *pValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSignature )( \n            __RPC__in ISymUnmanagedConstant * This,\n            /* [in] */ ULONG32 cSig,\n            /* [out] */ __RPC__out ULONG32 *pcSig,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSig, *pcSig) BYTE sig[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedConstantVtbl;\n\n    interface ISymUnmanagedConstant\n    {\n        CONST_VTBL struct ISymUnmanagedConstantVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedConstant_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedConstant_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedConstant_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedConstant_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) \n\n#define ISymUnmanagedConstant_GetValue(This,pValue)\t\\\n    ( (This)->lpVtbl -> GetValue(This,pValue) ) \n\n#define ISymUnmanagedConstant_GetSignature(This,cSig,pcSig,sig)\t\\\n    ( (This)->lpVtbl -> GetSignature(This,cSig,pcSig,sig) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedConstant_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedScope2_INTERFACE_DEFINED__\n#define __ISymUnmanagedScope2_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedScope2 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedScope2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"AE932FBA-3FD8-4dba-8232-30A2309B02DB\")\n    ISymUnmanagedScope2 : public ISymUnmanagedScope\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetConstantCount( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetConstants( \n            /* [in] */ ULONG32 cConstants,\n            /* [out] */ __RPC__out ULONG32 *pcConstants,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cConstants, *pcConstants) ISymUnmanagedConstant *constants[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedScope2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedScope2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedScope2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethod )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetParent )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedScope **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetChildren )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [in] */ ULONG32 cChildren,\n            /* [out] */ __RPC__out ULONG32 *pcChildren,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cChildren, *pcChildren) ISymUnmanagedScope *children[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetStartOffset )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetEndOffset )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocalCount )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocals )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [in] */ ULONG32 cLocals,\n            /* [out] */ __RPC__out ULONG32 *pcLocals,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cLocals, *pcLocals) ISymUnmanagedVariable *locals[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNamespaces )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetConstantCount )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetConstants )( \n            __RPC__in ISymUnmanagedScope2 * This,\n            /* [in] */ ULONG32 cConstants,\n            /* [out] */ __RPC__out ULONG32 *pcConstants,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cConstants, *pcConstants) ISymUnmanagedConstant *constants[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedScope2Vtbl;\n\n    interface ISymUnmanagedScope2\n    {\n        CONST_VTBL struct ISymUnmanagedScope2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedScope2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedScope2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedScope2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedScope2_GetMethod(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethod(This,pRetVal) ) \n\n#define ISymUnmanagedScope2_GetParent(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetParent(This,pRetVal) ) \n\n#define ISymUnmanagedScope2_GetChildren(This,cChildren,pcChildren,children)\t\\\n    ( (This)->lpVtbl -> GetChildren(This,cChildren,pcChildren,children) ) \n\n#define ISymUnmanagedScope2_GetStartOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetStartOffset(This,pRetVal) ) \n\n#define ISymUnmanagedScope2_GetEndOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetEndOffset(This,pRetVal) ) \n\n#define ISymUnmanagedScope2_GetLocalCount(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetLocalCount(This,pRetVal) ) \n\n#define ISymUnmanagedScope2_GetLocals(This,cLocals,pcLocals,locals)\t\\\n    ( (This)->lpVtbl -> GetLocals(This,cLocals,pcLocals,locals) ) \n\n#define ISymUnmanagedScope2_GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces)\t\\\n    ( (This)->lpVtbl -> GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces) ) \n\n\n#define ISymUnmanagedScope2_GetConstantCount(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetConstantCount(This,pRetVal) ) \n\n#define ISymUnmanagedScope2_GetConstants(This,cConstants,pcConstants,constants)\t\\\n    ( (This)->lpVtbl -> GetConstants(This,cConstants,pcConstants,constants) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedScope2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedVariable_INTERFACE_DEFINED__\n#define __ISymUnmanagedVariable_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedVariable */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedVariable;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"9F60EEBE-2D9A-3F7C-BF58-80BC991C60BB\")\n    ISymUnmanagedVariable : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAttributes( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSignature( \n            /* [in] */ ULONG32 cSig,\n            /* [out] */ __RPC__out ULONG32 *pcSig,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSig, *pcSig) BYTE sig[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAddressKind( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAddressField1( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAddressField2( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAddressField3( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetStartOffset( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetEndOffset( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedVariableVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedVariable * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedVariable * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAttributes )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSignature )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [in] */ ULONG32 cSig,\n            /* [out] */ __RPC__out ULONG32 *pcSig,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cSig, *pcSig) BYTE sig[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddressKind )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddressField1 )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddressField2 )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddressField3 )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetStartOffset )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetEndOffset )( \n            __RPC__in ISymUnmanagedVariable * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        END_INTERFACE\n    } ISymUnmanagedVariableVtbl;\n\n    interface ISymUnmanagedVariable\n    {\n        CONST_VTBL struct ISymUnmanagedVariableVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedVariable_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedVariable_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedVariable_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedVariable_GetName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) ) \n\n#define ISymUnmanagedVariable_GetAttributes(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetAttributes(This,pRetVal) ) \n\n#define ISymUnmanagedVariable_GetSignature(This,cSig,pcSig,sig)\t\\\n    ( (This)->lpVtbl -> GetSignature(This,cSig,pcSig,sig) ) \n\n#define ISymUnmanagedVariable_GetAddressKind(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetAddressKind(This,pRetVal) ) \n\n#define ISymUnmanagedVariable_GetAddressField1(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetAddressField1(This,pRetVal) ) \n\n#define ISymUnmanagedVariable_GetAddressField2(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetAddressField2(This,pRetVal) ) \n\n#define ISymUnmanagedVariable_GetAddressField3(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetAddressField3(This,pRetVal) ) \n\n#define ISymUnmanagedVariable_GetStartOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetStartOffset(This,pRetVal) ) \n\n#define ISymUnmanagedVariable_GetEndOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetEndOffset(This,pRetVal) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedVariable_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedSymbolSearchInfo_INTERFACE_DEFINED__\n#define __ISymUnmanagedSymbolSearchInfo_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedSymbolSearchInfo */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedSymbolSearchInfo;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"F8B3534A-A46B-4980-B520-BEC4ACEABA8F\")\n    ISymUnmanagedSymbolSearchInfo : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetSearchPathLength( \n            /* [out] */ __RPC__out ULONG32 *pcchPath) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSearchPath( \n            /* [in] */ ULONG32 cchPath,\n            /* [out] */ __RPC__out ULONG32 *pcchPath,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchPath, *pcchPath) WCHAR szPath[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetHRESULT( \n            /* [out] */ __RPC__out HRESULT *phr) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedSymbolSearchInfoVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedSymbolSearchInfo * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedSymbolSearchInfo * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedSymbolSearchInfo * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSearchPathLength )( \n            __RPC__in ISymUnmanagedSymbolSearchInfo * This,\n            /* [out] */ __RPC__out ULONG32 *pcchPath);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSearchPath )( \n            __RPC__in ISymUnmanagedSymbolSearchInfo * This,\n            /* [in] */ ULONG32 cchPath,\n            /* [out] */ __RPC__out ULONG32 *pcchPath,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchPath, *pcchPath) WCHAR szPath[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetHRESULT )( \n            __RPC__in ISymUnmanagedSymbolSearchInfo * This,\n            /* [out] */ __RPC__out HRESULT *phr);\n        \n        END_INTERFACE\n    } ISymUnmanagedSymbolSearchInfoVtbl;\n\n    interface ISymUnmanagedSymbolSearchInfo\n    {\n        CONST_VTBL struct ISymUnmanagedSymbolSearchInfoVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedSymbolSearchInfo_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedSymbolSearchInfo_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedSymbolSearchInfo_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedSymbolSearchInfo_GetSearchPathLength(This,pcchPath)\t\\\n    ( (This)->lpVtbl -> GetSearchPathLength(This,pcchPath) ) \n\n#define ISymUnmanagedSymbolSearchInfo_GetSearchPath(This,cchPath,pcchPath,szPath)\t\\\n    ( (This)->lpVtbl -> GetSearchPath(This,cchPath,pcchPath,szPath) ) \n\n#define ISymUnmanagedSymbolSearchInfo_GetHRESULT(This,phr)\t\\\n    ( (This)->lpVtbl -> GetHRESULT(This,phr) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedSymbolSearchInfo_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter_INTERFACE_DEFINED__\n#define __ISymUnmanagedWriter_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedWriter */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedWriter;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"ED14AA72-78E2-4884-84E2-334293AE5214\")\n    ISymUnmanagedWriter : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DefineDocument( \n            /* [in] */ __RPC__in const WCHAR *url,\n            /* [in] */ __RPC__in const GUID *language,\n            /* [in] */ __RPC__in const GUID *languageVendor,\n            /* [in] */ __RPC__in const GUID *documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocumentWriter **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetUserEntryPoint( \n            /* [in] */ mdMethodDef entryMethod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OpenMethod( \n            /* [in] */ mdMethodDef method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CloseMethod( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OpenScope( \n            /* [in] */ ULONG32 startOffset,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CloseScope( \n            /* [in] */ ULONG32 endOffset) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetScopeRange( \n            /* [in] */ ULONG32 scopeID,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineLocalVariable( \n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineParameter( \n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 sequence,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineField( \n            /* [in] */ mdTypeDef parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineGlobalVariable( \n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetSymAttribute( \n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 cData,\n            /* [size_is][in] */ __RPC__in_ecount_full(cData) unsigned char data[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OpenNamespace( \n            /* [in] */ __RPC__in const WCHAR *name) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CloseNamespace( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE UsingNamespace( \n            /* [in] */ __RPC__in const WCHAR *fullName) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetMethodSourceRange( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *startDoc,\n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *endDoc,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Initialize( \n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDebugInfo( \n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineSequencePoints( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 spCount,\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endColumns[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE RemapToken( \n            /* [in] */ mdToken oldToken,\n            /* [in] */ mdToken newToken) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Initialize2( \n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *tempfilename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild,\n            /* [in] */ __RPC__in const WCHAR *finalfilename) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineConstant( \n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Abort( void) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedWriterVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedWriter * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedWriter * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineDocument )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in const WCHAR *url,\n            /* [in] */ __RPC__in const GUID *language,\n            /* [in] */ __RPC__in const GUID *languageVendor,\n            /* [in] */ __RPC__in const GUID *documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocumentWriter **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetUserEntryPoint )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ mdMethodDef entryMethod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ mdMethodDef method);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseMethod )( \n            __RPC__in ISymUnmanagedWriter * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenScope )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ ULONG32 startOffset,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseScope )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetScopeRange )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ ULONG32 scopeID,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineParameter )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 sequence,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineField )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ mdTypeDef parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *Close )( \n            __RPC__in ISymUnmanagedWriter * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetSymAttribute )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 cData,\n            /* [size_is][in] */ __RPC__in_ecount_full(cData) unsigned char data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenNamespace )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in const WCHAR *name);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseNamespace )( \n            __RPC__in ISymUnmanagedWriter * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *UsingNamespace )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in const WCHAR *fullName);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetMethodSourceRange )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *startDoc,\n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *endDoc,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDebugInfo )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineSequencePoints )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 spCount,\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endColumns[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *RemapToken )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ mdToken oldToken,\n            /* [in] */ mdToken newToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize2 )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *tempfilename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild,\n            /* [in] */ __RPC__in const WCHAR *finalfilename);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant )( \n            __RPC__in ISymUnmanagedWriter * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Abort )( \n            __RPC__in ISymUnmanagedWriter * This);\n        \n        END_INTERFACE\n    } ISymUnmanagedWriterVtbl;\n\n    interface ISymUnmanagedWriter\n    {\n        CONST_VTBL struct ISymUnmanagedWriterVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedWriter_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedWriter_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedWriter_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedWriter_DefineDocument(This,url,language,languageVendor,documentType,pRetVal)\t\\\n    ( (This)->lpVtbl -> DefineDocument(This,url,language,languageVendor,documentType,pRetVal) ) \n\n#define ISymUnmanagedWriter_SetUserEntryPoint(This,entryMethod)\t\\\n    ( (This)->lpVtbl -> SetUserEntryPoint(This,entryMethod) ) \n\n#define ISymUnmanagedWriter_OpenMethod(This,method)\t\\\n    ( (This)->lpVtbl -> OpenMethod(This,method) ) \n\n#define ISymUnmanagedWriter_CloseMethod(This)\t\\\n    ( (This)->lpVtbl -> CloseMethod(This) ) \n\n#define ISymUnmanagedWriter_OpenScope(This,startOffset,pRetVal)\t\\\n    ( (This)->lpVtbl -> OpenScope(This,startOffset,pRetVal) ) \n\n#define ISymUnmanagedWriter_CloseScope(This,endOffset)\t\\\n    ( (This)->lpVtbl -> CloseScope(This,endOffset) ) \n\n#define ISymUnmanagedWriter_SetScopeRange(This,scopeID,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> SetScopeRange(This,scopeID,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter_DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter_DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter_DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter_DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter_Close(This)\t\\\n    ( (This)->lpVtbl -> Close(This) ) \n\n#define ISymUnmanagedWriter_SetSymAttribute(This,parent,name,cData,data)\t\\\n    ( (This)->lpVtbl -> SetSymAttribute(This,parent,name,cData,data) ) \n\n#define ISymUnmanagedWriter_OpenNamespace(This,name)\t\\\n    ( (This)->lpVtbl -> OpenNamespace(This,name) ) \n\n#define ISymUnmanagedWriter_CloseNamespace(This)\t\\\n    ( (This)->lpVtbl -> CloseNamespace(This) ) \n\n#define ISymUnmanagedWriter_UsingNamespace(This,fullName)\t\\\n    ( (This)->lpVtbl -> UsingNamespace(This,fullName) ) \n\n#define ISymUnmanagedWriter_SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn)\t\\\n    ( (This)->lpVtbl -> SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn) ) \n\n#define ISymUnmanagedWriter_Initialize(This,emitter,filename,pIStream,fFullBuild)\t\\\n    ( (This)->lpVtbl -> Initialize(This,emitter,filename,pIStream,fFullBuild) ) \n\n#define ISymUnmanagedWriter_GetDebugInfo(This,pIDD,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetDebugInfo(This,pIDD,cData,pcData,data) ) \n\n#define ISymUnmanagedWriter_DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns)\t\\\n    ( (This)->lpVtbl -> DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns) ) \n\n#define ISymUnmanagedWriter_RemapToken(This,oldToken,newToken)\t\\\n    ( (This)->lpVtbl -> RemapToken(This,oldToken,newToken) ) \n\n#define ISymUnmanagedWriter_Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename)\t\\\n    ( (This)->lpVtbl -> Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename) ) \n\n#define ISymUnmanagedWriter_DefineConstant(This,name,value,cSig,signature)\t\\\n    ( (This)->lpVtbl -> DefineConstant(This,name,value,cSig,signature) ) \n\n#define ISymUnmanagedWriter_Abort(This)\t\\\n    ( (This)->lpVtbl -> Abort(This) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedWriter_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter2_INTERFACE_DEFINED__\n#define __ISymUnmanagedWriter2_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedWriter2 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedWriter2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"0B97726E-9E6D-4f05-9A26-424022093CAA\")\n    ISymUnmanagedWriter2 : public ISymUnmanagedWriter\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DefineLocalVariable2( \n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineGlobalVariable2( \n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineConstant2( \n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ mdSignature sigToken) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedWriter2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedWriter2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedWriter2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineDocument )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *url,\n            /* [in] */ __RPC__in const GUID *language,\n            /* [in] */ __RPC__in const GUID *languageVendor,\n            /* [in] */ __RPC__in const GUID *documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocumentWriter **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetUserEntryPoint )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ mdMethodDef entryMethod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ mdMethodDef method);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseMethod )( \n            __RPC__in ISymUnmanagedWriter2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenScope )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ ULONG32 startOffset,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseScope )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetScopeRange )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ ULONG32 scopeID,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineParameter )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 sequence,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineField )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ mdTypeDef parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *Close )( \n            __RPC__in ISymUnmanagedWriter2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetSymAttribute )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 cData,\n            /* [size_is][in] */ __RPC__in_ecount_full(cData) unsigned char data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenNamespace )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseNamespace )( \n            __RPC__in ISymUnmanagedWriter2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *UsingNamespace )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *fullName);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetMethodSourceRange )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *startDoc,\n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *endDoc,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDebugInfo )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineSequencePoints )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 spCount,\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endColumns[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *RemapToken )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ mdToken oldToken,\n            /* [in] */ mdToken newToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize2 )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *tempfilename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild,\n            /* [in] */ __RPC__in const WCHAR *finalfilename);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Abort )( \n            __RPC__in ISymUnmanagedWriter2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable2 )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable2 )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant2 )( \n            __RPC__in ISymUnmanagedWriter2 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ mdSignature sigToken);\n        \n        END_INTERFACE\n    } ISymUnmanagedWriter2Vtbl;\n\n    interface ISymUnmanagedWriter2\n    {\n        CONST_VTBL struct ISymUnmanagedWriter2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedWriter2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedWriter2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedWriter2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedWriter2_DefineDocument(This,url,language,languageVendor,documentType,pRetVal)\t\\\n    ( (This)->lpVtbl -> DefineDocument(This,url,language,languageVendor,documentType,pRetVal) ) \n\n#define ISymUnmanagedWriter2_SetUserEntryPoint(This,entryMethod)\t\\\n    ( (This)->lpVtbl -> SetUserEntryPoint(This,entryMethod) ) \n\n#define ISymUnmanagedWriter2_OpenMethod(This,method)\t\\\n    ( (This)->lpVtbl -> OpenMethod(This,method) ) \n\n#define ISymUnmanagedWriter2_CloseMethod(This)\t\\\n    ( (This)->lpVtbl -> CloseMethod(This) ) \n\n#define ISymUnmanagedWriter2_OpenScope(This,startOffset,pRetVal)\t\\\n    ( (This)->lpVtbl -> OpenScope(This,startOffset,pRetVal) ) \n\n#define ISymUnmanagedWriter2_CloseScope(This,endOffset)\t\\\n    ( (This)->lpVtbl -> CloseScope(This,endOffset) ) \n\n#define ISymUnmanagedWriter2_SetScopeRange(This,scopeID,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> SetScopeRange(This,scopeID,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter2_DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter2_DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter2_DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter2_DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter2_Close(This)\t\\\n    ( (This)->lpVtbl -> Close(This) ) \n\n#define ISymUnmanagedWriter2_SetSymAttribute(This,parent,name,cData,data)\t\\\n    ( (This)->lpVtbl -> SetSymAttribute(This,parent,name,cData,data) ) \n\n#define ISymUnmanagedWriter2_OpenNamespace(This,name)\t\\\n    ( (This)->lpVtbl -> OpenNamespace(This,name) ) \n\n#define ISymUnmanagedWriter2_CloseNamespace(This)\t\\\n    ( (This)->lpVtbl -> CloseNamespace(This) ) \n\n#define ISymUnmanagedWriter2_UsingNamespace(This,fullName)\t\\\n    ( (This)->lpVtbl -> UsingNamespace(This,fullName) ) \n\n#define ISymUnmanagedWriter2_SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn)\t\\\n    ( (This)->lpVtbl -> SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn) ) \n\n#define ISymUnmanagedWriter2_Initialize(This,emitter,filename,pIStream,fFullBuild)\t\\\n    ( (This)->lpVtbl -> Initialize(This,emitter,filename,pIStream,fFullBuild) ) \n\n#define ISymUnmanagedWriter2_GetDebugInfo(This,pIDD,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetDebugInfo(This,pIDD,cData,pcData,data) ) \n\n#define ISymUnmanagedWriter2_DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns)\t\\\n    ( (This)->lpVtbl -> DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns) ) \n\n#define ISymUnmanagedWriter2_RemapToken(This,oldToken,newToken)\t\\\n    ( (This)->lpVtbl -> RemapToken(This,oldToken,newToken) ) \n\n#define ISymUnmanagedWriter2_Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename)\t\\\n    ( (This)->lpVtbl -> Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename) ) \n\n#define ISymUnmanagedWriter2_DefineConstant(This,name,value,cSig,signature)\t\\\n    ( (This)->lpVtbl -> DefineConstant(This,name,value,cSig,signature) ) \n\n#define ISymUnmanagedWriter2_Abort(This)\t\\\n    ( (This)->lpVtbl -> Abort(This) ) \n\n\n#define ISymUnmanagedWriter2_DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter2_DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter2_DefineConstant2(This,name,value,sigToken)\t\\\n    ( (This)->lpVtbl -> DefineConstant2(This,name,value,sigToken) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedWriter2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter3_INTERFACE_DEFINED__\n#define __ISymUnmanagedWriter3_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedWriter3 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedWriter3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"12F1E02C-1E05-4B0E-9468-EBC9D1BB040F\")\n    ISymUnmanagedWriter3 : public ISymUnmanagedWriter2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OpenMethod2( \n            /* [in] */ mdMethodDef method,\n            /* [in] */ ULONG32 isect,\n            /* [in] */ ULONG32 offset) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Commit( void) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedWriter3Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedWriter3 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedWriter3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineDocument )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *url,\n            /* [in] */ __RPC__in const GUID *language,\n            /* [in] */ __RPC__in const GUID *languageVendor,\n            /* [in] */ __RPC__in const GUID *documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocumentWriter **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetUserEntryPoint )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ mdMethodDef entryMethod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ mdMethodDef method);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseMethod )( \n            __RPC__in ISymUnmanagedWriter3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenScope )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ ULONG32 startOffset,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseScope )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetScopeRange )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ ULONG32 scopeID,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineParameter )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 sequence,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineField )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ mdTypeDef parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *Close )( \n            __RPC__in ISymUnmanagedWriter3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetSymAttribute )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 cData,\n            /* [size_is][in] */ __RPC__in_ecount_full(cData) unsigned char data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenNamespace )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseNamespace )( \n            __RPC__in ISymUnmanagedWriter3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *UsingNamespace )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *fullName);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetMethodSourceRange )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *startDoc,\n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *endDoc,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDebugInfo )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineSequencePoints )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 spCount,\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endColumns[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *RemapToken )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ mdToken oldToken,\n            /* [in] */ mdToken newToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize2 )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *tempfilename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild,\n            /* [in] */ __RPC__in const WCHAR *finalfilename);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Abort )( \n            __RPC__in ISymUnmanagedWriter3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable2 )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable2 )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant2 )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ mdSignature sigToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod2 )( \n            __RPC__in ISymUnmanagedWriter3 * This,\n            /* [in] */ mdMethodDef method,\n            /* [in] */ ULONG32 isect,\n            /* [in] */ ULONG32 offset);\n        \n        HRESULT ( STDMETHODCALLTYPE *Commit )( \n            __RPC__in ISymUnmanagedWriter3 * This);\n        \n        END_INTERFACE\n    } ISymUnmanagedWriter3Vtbl;\n\n    interface ISymUnmanagedWriter3\n    {\n        CONST_VTBL struct ISymUnmanagedWriter3Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedWriter3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedWriter3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedWriter3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedWriter3_DefineDocument(This,url,language,languageVendor,documentType,pRetVal)\t\\\n    ( (This)->lpVtbl -> DefineDocument(This,url,language,languageVendor,documentType,pRetVal) ) \n\n#define ISymUnmanagedWriter3_SetUserEntryPoint(This,entryMethod)\t\\\n    ( (This)->lpVtbl -> SetUserEntryPoint(This,entryMethod) ) \n\n#define ISymUnmanagedWriter3_OpenMethod(This,method)\t\\\n    ( (This)->lpVtbl -> OpenMethod(This,method) ) \n\n#define ISymUnmanagedWriter3_CloseMethod(This)\t\\\n    ( (This)->lpVtbl -> CloseMethod(This) ) \n\n#define ISymUnmanagedWriter3_OpenScope(This,startOffset,pRetVal)\t\\\n    ( (This)->lpVtbl -> OpenScope(This,startOffset,pRetVal) ) \n\n#define ISymUnmanagedWriter3_CloseScope(This,endOffset)\t\\\n    ( (This)->lpVtbl -> CloseScope(This,endOffset) ) \n\n#define ISymUnmanagedWriter3_SetScopeRange(This,scopeID,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> SetScopeRange(This,scopeID,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter3_DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter3_DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter3_DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter3_DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter3_Close(This)\t\\\n    ( (This)->lpVtbl -> Close(This) ) \n\n#define ISymUnmanagedWriter3_SetSymAttribute(This,parent,name,cData,data)\t\\\n    ( (This)->lpVtbl -> SetSymAttribute(This,parent,name,cData,data) ) \n\n#define ISymUnmanagedWriter3_OpenNamespace(This,name)\t\\\n    ( (This)->lpVtbl -> OpenNamespace(This,name) ) \n\n#define ISymUnmanagedWriter3_CloseNamespace(This)\t\\\n    ( (This)->lpVtbl -> CloseNamespace(This) ) \n\n#define ISymUnmanagedWriter3_UsingNamespace(This,fullName)\t\\\n    ( (This)->lpVtbl -> UsingNamespace(This,fullName) ) \n\n#define ISymUnmanagedWriter3_SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn)\t\\\n    ( (This)->lpVtbl -> SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn) ) \n\n#define ISymUnmanagedWriter3_Initialize(This,emitter,filename,pIStream,fFullBuild)\t\\\n    ( (This)->lpVtbl -> Initialize(This,emitter,filename,pIStream,fFullBuild) ) \n\n#define ISymUnmanagedWriter3_GetDebugInfo(This,pIDD,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetDebugInfo(This,pIDD,cData,pcData,data) ) \n\n#define ISymUnmanagedWriter3_DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns)\t\\\n    ( (This)->lpVtbl -> DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns) ) \n\n#define ISymUnmanagedWriter3_RemapToken(This,oldToken,newToken)\t\\\n    ( (This)->lpVtbl -> RemapToken(This,oldToken,newToken) ) \n\n#define ISymUnmanagedWriter3_Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename)\t\\\n    ( (This)->lpVtbl -> Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename) ) \n\n#define ISymUnmanagedWriter3_DefineConstant(This,name,value,cSig,signature)\t\\\n    ( (This)->lpVtbl -> DefineConstant(This,name,value,cSig,signature) ) \n\n#define ISymUnmanagedWriter3_Abort(This)\t\\\n    ( (This)->lpVtbl -> Abort(This) ) \n\n\n#define ISymUnmanagedWriter3_DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter3_DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter3_DefineConstant2(This,name,value,sigToken)\t\\\n    ( (This)->lpVtbl -> DefineConstant2(This,name,value,sigToken) ) \n\n\n#define ISymUnmanagedWriter3_OpenMethod2(This,method,isect,offset)\t\\\n    ( (This)->lpVtbl -> OpenMethod2(This,method,isect,offset) ) \n\n#define ISymUnmanagedWriter3_Commit(This)\t\\\n    ( (This)->lpVtbl -> Commit(This) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedWriter3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter4_INTERFACE_DEFINED__\n#define __ISymUnmanagedWriter4_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedWriter4 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedWriter4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"BC7E3F53-F458-4C23-9DBD-A189E6E96594\")\n    ISymUnmanagedWriter4 : public ISymUnmanagedWriter3\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetDebugInfoWithPadding( \n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedWriter4Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedWriter4 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedWriter4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineDocument )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *url,\n            /* [in] */ __RPC__in const GUID *language,\n            /* [in] */ __RPC__in const GUID *languageVendor,\n            /* [in] */ __RPC__in const GUID *documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocumentWriter **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetUserEntryPoint )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ mdMethodDef entryMethod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ mdMethodDef method);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseMethod )( \n            __RPC__in ISymUnmanagedWriter4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenScope )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ ULONG32 startOffset,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseScope )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetScopeRange )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ ULONG32 scopeID,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineParameter )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 sequence,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineField )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ mdTypeDef parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *Close )( \n            __RPC__in ISymUnmanagedWriter4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetSymAttribute )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 cData,\n            /* [size_is][in] */ __RPC__in_ecount_full(cData) unsigned char data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenNamespace )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseNamespace )( \n            __RPC__in ISymUnmanagedWriter4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *UsingNamespace )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *fullName);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetMethodSourceRange )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *startDoc,\n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *endDoc,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDebugInfo )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineSequencePoints )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 spCount,\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endColumns[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *RemapToken )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ mdToken oldToken,\n            /* [in] */ mdToken newToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize2 )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *tempfilename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild,\n            /* [in] */ __RPC__in const WCHAR *finalfilename);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Abort )( \n            __RPC__in ISymUnmanagedWriter4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable2 )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable2 )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant2 )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ mdSignature sigToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod2 )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [in] */ mdMethodDef method,\n            /* [in] */ ULONG32 isect,\n            /* [in] */ ULONG32 offset);\n        \n        HRESULT ( STDMETHODCALLTYPE *Commit )( \n            __RPC__in ISymUnmanagedWriter4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDebugInfoWithPadding )( \n            __RPC__in ISymUnmanagedWriter4 * This,\n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedWriter4Vtbl;\n\n    interface ISymUnmanagedWriter4\n    {\n        CONST_VTBL struct ISymUnmanagedWriter4Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedWriter4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedWriter4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedWriter4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedWriter4_DefineDocument(This,url,language,languageVendor,documentType,pRetVal)\t\\\n    ( (This)->lpVtbl -> DefineDocument(This,url,language,languageVendor,documentType,pRetVal) ) \n\n#define ISymUnmanagedWriter4_SetUserEntryPoint(This,entryMethod)\t\\\n    ( (This)->lpVtbl -> SetUserEntryPoint(This,entryMethod) ) \n\n#define ISymUnmanagedWriter4_OpenMethod(This,method)\t\\\n    ( (This)->lpVtbl -> OpenMethod(This,method) ) \n\n#define ISymUnmanagedWriter4_CloseMethod(This)\t\\\n    ( (This)->lpVtbl -> CloseMethod(This) ) \n\n#define ISymUnmanagedWriter4_OpenScope(This,startOffset,pRetVal)\t\\\n    ( (This)->lpVtbl -> OpenScope(This,startOffset,pRetVal) ) \n\n#define ISymUnmanagedWriter4_CloseScope(This,endOffset)\t\\\n    ( (This)->lpVtbl -> CloseScope(This,endOffset) ) \n\n#define ISymUnmanagedWriter4_SetScopeRange(This,scopeID,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> SetScopeRange(This,scopeID,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter4_DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter4_DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter4_DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter4_DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter4_Close(This)\t\\\n    ( (This)->lpVtbl -> Close(This) ) \n\n#define ISymUnmanagedWriter4_SetSymAttribute(This,parent,name,cData,data)\t\\\n    ( (This)->lpVtbl -> SetSymAttribute(This,parent,name,cData,data) ) \n\n#define ISymUnmanagedWriter4_OpenNamespace(This,name)\t\\\n    ( (This)->lpVtbl -> OpenNamespace(This,name) ) \n\n#define ISymUnmanagedWriter4_CloseNamespace(This)\t\\\n    ( (This)->lpVtbl -> CloseNamespace(This) ) \n\n#define ISymUnmanagedWriter4_UsingNamespace(This,fullName)\t\\\n    ( (This)->lpVtbl -> UsingNamespace(This,fullName) ) \n\n#define ISymUnmanagedWriter4_SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn)\t\\\n    ( (This)->lpVtbl -> SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn) ) \n\n#define ISymUnmanagedWriter4_Initialize(This,emitter,filename,pIStream,fFullBuild)\t\\\n    ( (This)->lpVtbl -> Initialize(This,emitter,filename,pIStream,fFullBuild) ) \n\n#define ISymUnmanagedWriter4_GetDebugInfo(This,pIDD,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetDebugInfo(This,pIDD,cData,pcData,data) ) \n\n#define ISymUnmanagedWriter4_DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns)\t\\\n    ( (This)->lpVtbl -> DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns) ) \n\n#define ISymUnmanagedWriter4_RemapToken(This,oldToken,newToken)\t\\\n    ( (This)->lpVtbl -> RemapToken(This,oldToken,newToken) ) \n\n#define ISymUnmanagedWriter4_Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename)\t\\\n    ( (This)->lpVtbl -> Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename) ) \n\n#define ISymUnmanagedWriter4_DefineConstant(This,name,value,cSig,signature)\t\\\n    ( (This)->lpVtbl -> DefineConstant(This,name,value,cSig,signature) ) \n\n#define ISymUnmanagedWriter4_Abort(This)\t\\\n    ( (This)->lpVtbl -> Abort(This) ) \n\n\n#define ISymUnmanagedWriter4_DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter4_DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter4_DefineConstant2(This,name,value,sigToken)\t\\\n    ( (This)->lpVtbl -> DefineConstant2(This,name,value,sigToken) ) \n\n\n#define ISymUnmanagedWriter4_OpenMethod2(This,method,isect,offset)\t\\\n    ( (This)->lpVtbl -> OpenMethod2(This,method,isect,offset) ) \n\n#define ISymUnmanagedWriter4_Commit(This)\t\\\n    ( (This)->lpVtbl -> Commit(This) ) \n\n\n#define ISymUnmanagedWriter4_GetDebugInfoWithPadding(This,pIDD,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetDebugInfoWithPadding(This,pIDD,cData,pcData,data) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedWriter4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedWriter5_INTERFACE_DEFINED__\n#define __ISymUnmanagedWriter5_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedWriter5 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedWriter5;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"DCF7780D-BDE9-45DF-ACFE-21731A32000C\")\n    ISymUnmanagedWriter5 : public ISymUnmanagedWriter4\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OpenMapTokensToSourceSpans( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CloseMapTokensToSourceSpans( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE MapTokenToSourceSpan( \n            /* [in] */ mdToken token,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedWriter5Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineDocument )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *url,\n            /* [in] */ __RPC__in const GUID *language,\n            /* [in] */ __RPC__in const GUID *languageVendor,\n            /* [in] */ __RPC__in const GUID *documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocumentWriter **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetUserEntryPoint )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ mdMethodDef entryMethod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ mdMethodDef method);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseMethod )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenScope )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ ULONG32 startOffset,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseScope )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetScopeRange )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ ULONG32 scopeID,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineParameter )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 sequence,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineField )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ mdTypeDef parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ],\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *Close )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetSymAttribute )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 cData,\n            /* [size_is][in] */ __RPC__in_ecount_full(cData) unsigned char data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenNamespace )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseNamespace )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *UsingNamespace )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *fullName);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetMethodSourceRange )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *startDoc,\n            /* [in] */ ULONG32 startLine,\n            /* [in] */ ULONG32 startColumn,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *endDoc,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDebugInfo )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineSequencePoints )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 spCount,\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 offsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 lines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 columns[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endLines[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(spCount) ULONG32 endColumns[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *RemapToken )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ mdToken oldToken,\n            /* [in] */ mdToken newToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize2 )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in_opt IUnknown *emitter,\n            /* [in] */ __RPC__in const WCHAR *tempfilename,\n            /* [in] */ __RPC__in_opt IStream *pIStream,\n            /* [in] */ BOOL fFullBuild,\n            /* [in] */ __RPC__in const WCHAR *finalfilename);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ ULONG32 cSig,\n            /* [size_is][in] */ __RPC__in_ecount_full(cSig) unsigned char signature[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Abort )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineLocalVariable2 )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3,\n            /* [in] */ ULONG32 startOffset,\n            /* [in] */ ULONG32 endOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineGlobalVariable2 )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ ULONG32 attributes,\n            /* [in] */ mdSignature sigToken,\n            /* [in] */ ULONG32 addrKind,\n            /* [in] */ ULONG32 addr1,\n            /* [in] */ ULONG32 addr2,\n            /* [in] */ ULONG32 addr3);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineConstant2 )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ __RPC__in const WCHAR *name,\n            /* [in] */ VARIANT value,\n            /* [in] */ mdSignature sigToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMethod2 )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ mdMethodDef method,\n            /* [in] */ ULONG32 isect,\n            /* [in] */ ULONG32 offset);\n        \n        HRESULT ( STDMETHODCALLTYPE *Commit )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDebugInfoWithPadding )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [out][in] */ __RPC__inout IMAGE_DEBUG_DIRECTORY *pIDD,\n            /* [in] */ DWORD cData,\n            /* [out] */ __RPC__out DWORD *pcData,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cData, *pcData) BYTE data[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenMapTokensToSourceSpans )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseMapTokensToSourceSpans )( \n            __RPC__in ISymUnmanagedWriter5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *MapTokenToSourceSpan )( \n            __RPC__in ISymUnmanagedWriter5 * This,\n            /* [in] */ mdToken token,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocumentWriter *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [in] */ ULONG32 endLine,\n            /* [in] */ ULONG32 endColumn);\n        \n        END_INTERFACE\n    } ISymUnmanagedWriter5Vtbl;\n\n    interface ISymUnmanagedWriter5\n    {\n        CONST_VTBL struct ISymUnmanagedWriter5Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedWriter5_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedWriter5_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedWriter5_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedWriter5_DefineDocument(This,url,language,languageVendor,documentType,pRetVal)\t\\\n    ( (This)->lpVtbl -> DefineDocument(This,url,language,languageVendor,documentType,pRetVal) ) \n\n#define ISymUnmanagedWriter5_SetUserEntryPoint(This,entryMethod)\t\\\n    ( (This)->lpVtbl -> SetUserEntryPoint(This,entryMethod) ) \n\n#define ISymUnmanagedWriter5_OpenMethod(This,method)\t\\\n    ( (This)->lpVtbl -> OpenMethod(This,method) ) \n\n#define ISymUnmanagedWriter5_CloseMethod(This)\t\\\n    ( (This)->lpVtbl -> CloseMethod(This) ) \n\n#define ISymUnmanagedWriter5_OpenScope(This,startOffset,pRetVal)\t\\\n    ( (This)->lpVtbl -> OpenScope(This,startOffset,pRetVal) ) \n\n#define ISymUnmanagedWriter5_CloseScope(This,endOffset)\t\\\n    ( (This)->lpVtbl -> CloseScope(This,endOffset) ) \n\n#define ISymUnmanagedWriter5_SetScopeRange(This,scopeID,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> SetScopeRange(This,scopeID,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter5_DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter5_DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineParameter(This,name,attributes,sequence,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter5_DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineField(This,parent,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter5_DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable(This,name,attributes,cSig,signature,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter5_Close(This)\t\\\n    ( (This)->lpVtbl -> Close(This) ) \n\n#define ISymUnmanagedWriter5_SetSymAttribute(This,parent,name,cData,data)\t\\\n    ( (This)->lpVtbl -> SetSymAttribute(This,parent,name,cData,data) ) \n\n#define ISymUnmanagedWriter5_OpenNamespace(This,name)\t\\\n    ( (This)->lpVtbl -> OpenNamespace(This,name) ) \n\n#define ISymUnmanagedWriter5_CloseNamespace(This)\t\\\n    ( (This)->lpVtbl -> CloseNamespace(This) ) \n\n#define ISymUnmanagedWriter5_UsingNamespace(This,fullName)\t\\\n    ( (This)->lpVtbl -> UsingNamespace(This,fullName) ) \n\n#define ISymUnmanagedWriter5_SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn)\t\\\n    ( (This)->lpVtbl -> SetMethodSourceRange(This,startDoc,startLine,startColumn,endDoc,endLine,endColumn) ) \n\n#define ISymUnmanagedWriter5_Initialize(This,emitter,filename,pIStream,fFullBuild)\t\\\n    ( (This)->lpVtbl -> Initialize(This,emitter,filename,pIStream,fFullBuild) ) \n\n#define ISymUnmanagedWriter5_GetDebugInfo(This,pIDD,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetDebugInfo(This,pIDD,cData,pcData,data) ) \n\n#define ISymUnmanagedWriter5_DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns)\t\\\n    ( (This)->lpVtbl -> DefineSequencePoints(This,document,spCount,offsets,lines,columns,endLines,endColumns) ) \n\n#define ISymUnmanagedWriter5_RemapToken(This,oldToken,newToken)\t\\\n    ( (This)->lpVtbl -> RemapToken(This,oldToken,newToken) ) \n\n#define ISymUnmanagedWriter5_Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename)\t\\\n    ( (This)->lpVtbl -> Initialize2(This,emitter,tempfilename,pIStream,fFullBuild,finalfilename) ) \n\n#define ISymUnmanagedWriter5_DefineConstant(This,name,value,cSig,signature)\t\\\n    ( (This)->lpVtbl -> DefineConstant(This,name,value,cSig,signature) ) \n\n#define ISymUnmanagedWriter5_Abort(This)\t\\\n    ( (This)->lpVtbl -> Abort(This) ) \n\n\n#define ISymUnmanagedWriter5_DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset)\t\\\n    ( (This)->lpVtbl -> DefineLocalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3,startOffset,endOffset) ) \n\n#define ISymUnmanagedWriter5_DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3)\t\\\n    ( (This)->lpVtbl -> DefineGlobalVariable2(This,name,attributes,sigToken,addrKind,addr1,addr2,addr3) ) \n\n#define ISymUnmanagedWriter5_DefineConstant2(This,name,value,sigToken)\t\\\n    ( (This)->lpVtbl -> DefineConstant2(This,name,value,sigToken) ) \n\n\n#define ISymUnmanagedWriter5_OpenMethod2(This,method,isect,offset)\t\\\n    ( (This)->lpVtbl -> OpenMethod2(This,method,isect,offset) ) \n\n#define ISymUnmanagedWriter5_Commit(This)\t\\\n    ( (This)->lpVtbl -> Commit(This) ) \n\n\n#define ISymUnmanagedWriter5_GetDebugInfoWithPadding(This,pIDD,cData,pcData,data)\t\\\n    ( (This)->lpVtbl -> GetDebugInfoWithPadding(This,pIDD,cData,pcData,data) ) \n\n\n#define ISymUnmanagedWriter5_OpenMapTokensToSourceSpans(This)\t\\\n    ( (This)->lpVtbl -> OpenMapTokensToSourceSpans(This) ) \n\n#define ISymUnmanagedWriter5_CloseMapTokensToSourceSpans(This)\t\\\n    ( (This)->lpVtbl -> CloseMapTokensToSourceSpans(This) ) \n\n#define ISymUnmanagedWriter5_MapTokenToSourceSpan(This,token,document,line,column,endLine,endColumn)\t\\\n    ( (This)->lpVtbl -> MapTokenToSourceSpan(This,token,document,line,column,endLine,endColumn) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedWriter5_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedReader2_INTERFACE_DEFINED__\n#define __ISymUnmanagedReader2_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedReader2 */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedReader2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"A09E53B2-2A57-4cca-8F63-B84F7C35D4AA\")\n    ISymUnmanagedReader2 : public ISymUnmanagedReader\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetMethodByVersionPreRemap( \n            /* [in] */ mdMethodDef token,\n            /* [in] */ int version,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSymAttributePreRemap( \n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in WCHAR *name,\n            /* [in] */ ULONG32 cBuffer,\n            /* [out] */ __RPC__out ULONG32 *pcBuffer,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cBuffer, *pcBuffer) BYTE buffer[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodsInDocument( \n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 cMethod,\n            /* [out] */ __RPC__out ULONG32 *pcMethod,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cMethod, *pcMethod) ISymUnmanagedMethod *pRetVal[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedReader2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedReader2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedReader2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocument )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in WCHAR *url,\n            /* [in] */ GUID language,\n            /* [in] */ GUID languageVendor,\n            /* [in] */ GUID documentType,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedDocument **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocuments )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ ULONG32 cDocs,\n            /* [out] */ __RPC__out ULONG32 *pcDocs,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cDocs, *pcDocs) ISymUnmanagedDocument *pDocs[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetUserEntryPoint )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [retval][out] */ __RPC__out mdMethodDef *pToken);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethod )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ mdMethodDef token,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodByVersion )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ mdMethodDef token,\n            /* [in] */ int version,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetVariables )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetGlobalVariables )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ ULONG32 cVars,\n            /* [out] */ __RPC__out ULONG32 *pcVars,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cVars, *pcVars) ISymUnmanagedVariable *pVars[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodFromDocumentPosition )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSymAttribute )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in WCHAR *name,\n            /* [in] */ ULONG32 cBuffer,\n            /* [out] */ __RPC__out ULONG32 *pcBuffer,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cBuffer, *pcBuffer) BYTE buffer[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNamespaces )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ ULONG32 cNameSpaces,\n            /* [out] */ __RPC__out ULONG32 *pcNameSpaces,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cNameSpaces, *pcNameSpaces) ISymUnmanagedNamespace *namespaces[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Initialize )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in_opt IUnknown *importer,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in const WCHAR *searchPath,\n            /* [in] */ __RPC__in_opt IStream *pIStream);\n        \n        HRESULT ( STDMETHODCALLTYPE *UpdateSymbolStore )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream);\n        \n        HRESULT ( STDMETHODCALLTYPE *ReplaceSymbolStore )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in const WCHAR *filename,\n            /* [in] */ __RPC__in_opt IStream *pIStream);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSymbolStoreFileName )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ ULONG32 cchName,\n            /* [out] */ __RPC__out ULONG32 *pcchName,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cchName, *pcchName) WCHAR szName[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodsFromDocumentPosition )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 line,\n            /* [in] */ ULONG32 column,\n            /* [in] */ ULONG32 cMethod,\n            /* [out] */ __RPC__out ULONG32 *pcMethod,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cMethod, *pcMethod) ISymUnmanagedMethod *pRetVal[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDocumentVersion )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *pDoc,\n            /* [out] */ __RPC__out int *version,\n            /* [out] */ __RPC__out BOOL *pbCurrent);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodVersion )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedMethod *pMethod,\n            /* [out] */ __RPC__out int *version);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodByVersionPreRemap )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ mdMethodDef token,\n            /* [in] */ int version,\n            /* [retval][out] */ __RPC__deref_out_opt ISymUnmanagedMethod **pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSymAttributePreRemap )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ mdToken parent,\n            /* [in] */ __RPC__in WCHAR *name,\n            /* [in] */ ULONG32 cBuffer,\n            /* [out] */ __RPC__out ULONG32 *pcBuffer,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cBuffer, *pcBuffer) BYTE buffer[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodsInDocument )( \n            __RPC__in ISymUnmanagedReader2 * This,\n            /* [in] */ __RPC__in_opt ISymUnmanagedDocument *document,\n            /* [in] */ ULONG32 cMethod,\n            /* [out] */ __RPC__out ULONG32 *pcMethod,\n            /* [length_is][size_is][out] */ __RPC__out_ecount_part(cMethod, *pcMethod) ISymUnmanagedMethod *pRetVal[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedReader2Vtbl;\n\n    interface ISymUnmanagedReader2\n    {\n        CONST_VTBL struct ISymUnmanagedReader2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedReader2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedReader2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedReader2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedReader2_GetDocument(This,url,language,languageVendor,documentType,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetDocument(This,url,language,languageVendor,documentType,pRetVal) ) \n\n#define ISymUnmanagedReader2_GetDocuments(This,cDocs,pcDocs,pDocs)\t\\\n    ( (This)->lpVtbl -> GetDocuments(This,cDocs,pcDocs,pDocs) ) \n\n#define ISymUnmanagedReader2_GetUserEntryPoint(This,pToken)\t\\\n    ( (This)->lpVtbl -> GetUserEntryPoint(This,pToken) ) \n\n#define ISymUnmanagedReader2_GetMethod(This,token,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethod(This,token,pRetVal) ) \n\n#define ISymUnmanagedReader2_GetMethodByVersion(This,token,version,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodByVersion(This,token,version,pRetVal) ) \n\n#define ISymUnmanagedReader2_GetVariables(This,parent,cVars,pcVars,pVars)\t\\\n    ( (This)->lpVtbl -> GetVariables(This,parent,cVars,pcVars,pVars) ) \n\n#define ISymUnmanagedReader2_GetGlobalVariables(This,cVars,pcVars,pVars)\t\\\n    ( (This)->lpVtbl -> GetGlobalVariables(This,cVars,pcVars,pVars) ) \n\n#define ISymUnmanagedReader2_GetMethodFromDocumentPosition(This,document,line,column,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodFromDocumentPosition(This,document,line,column,pRetVal) ) \n\n#define ISymUnmanagedReader2_GetSymAttribute(This,parent,name,cBuffer,pcBuffer,buffer)\t\\\n    ( (This)->lpVtbl -> GetSymAttribute(This,parent,name,cBuffer,pcBuffer,buffer) ) \n\n#define ISymUnmanagedReader2_GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces)\t\\\n    ( (This)->lpVtbl -> GetNamespaces(This,cNameSpaces,pcNameSpaces,namespaces) ) \n\n#define ISymUnmanagedReader2_Initialize(This,importer,filename,searchPath,pIStream)\t\\\n    ( (This)->lpVtbl -> Initialize(This,importer,filename,searchPath,pIStream) ) \n\n#define ISymUnmanagedReader2_UpdateSymbolStore(This,filename,pIStream)\t\\\n    ( (This)->lpVtbl -> UpdateSymbolStore(This,filename,pIStream) ) \n\n#define ISymUnmanagedReader2_ReplaceSymbolStore(This,filename,pIStream)\t\\\n    ( (This)->lpVtbl -> ReplaceSymbolStore(This,filename,pIStream) ) \n\n#define ISymUnmanagedReader2_GetSymbolStoreFileName(This,cchName,pcchName,szName)\t\\\n    ( (This)->lpVtbl -> GetSymbolStoreFileName(This,cchName,pcchName,szName) ) \n\n#define ISymUnmanagedReader2_GetMethodsFromDocumentPosition(This,document,line,column,cMethod,pcMethod,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodsFromDocumentPosition(This,document,line,column,cMethod,pcMethod,pRetVal) ) \n\n#define ISymUnmanagedReader2_GetDocumentVersion(This,pDoc,version,pbCurrent)\t\\\n    ( (This)->lpVtbl -> GetDocumentVersion(This,pDoc,version,pbCurrent) ) \n\n#define ISymUnmanagedReader2_GetMethodVersion(This,pMethod,version)\t\\\n    ( (This)->lpVtbl -> GetMethodVersion(This,pMethod,version) ) \n\n\n#define ISymUnmanagedReader2_GetMethodByVersionPreRemap(This,token,version,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodByVersionPreRemap(This,token,version,pRetVal) ) \n\n#define ISymUnmanagedReader2_GetSymAttributePreRemap(This,parent,name,cBuffer,pcBuffer,buffer)\t\\\n    ( (This)->lpVtbl -> GetSymAttributePreRemap(This,parent,name,cBuffer,pcBuffer,buffer) ) \n\n#define ISymUnmanagedReader2_GetMethodsInDocument(This,document,cMethod,pcMethod,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetMethodsInDocument(This,document,cMethod,pcMethod,pRetVal) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedReader2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymNGenWriter_INTERFACE_DEFINED__\n#define __ISymNGenWriter_INTERFACE_DEFINED__\n\n/* interface ISymNGenWriter */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymNGenWriter;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"d682fd12-43de-411c-811b-be8404cea126\")\n    ISymNGenWriter : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE AddSymbol( \n            /* [in] */ __RPC__in BSTR pSymbol,\n            /* [in] */ USHORT iSection,\n            /* [in] */ ULONGLONG rva) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE AddSection( \n            /* [in] */ USHORT iSection,\n            /* [in] */ USHORT flags,\n            /* [in] */ long offset,\n            /* [in] */ long cb) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymNGenWriterVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymNGenWriter * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymNGenWriter * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymNGenWriter * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *AddSymbol )( \n            __RPC__in ISymNGenWriter * This,\n            /* [in] */ __RPC__in BSTR pSymbol,\n            /* [in] */ USHORT iSection,\n            /* [in] */ ULONGLONG rva);\n        \n        HRESULT ( STDMETHODCALLTYPE *AddSection )( \n            __RPC__in ISymNGenWriter * This,\n            /* [in] */ USHORT iSection,\n            /* [in] */ USHORT flags,\n            /* [in] */ long offset,\n            /* [in] */ long cb);\n        \n        END_INTERFACE\n    } ISymNGenWriterVtbl;\n\n    interface ISymNGenWriter\n    {\n        CONST_VTBL struct ISymNGenWriterVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymNGenWriter_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymNGenWriter_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymNGenWriter_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymNGenWriter_AddSymbol(This,pSymbol,iSection,rva)\t\\\n    ( (This)->lpVtbl -> AddSymbol(This,pSymbol,iSection,rva) ) \n\n#define ISymNGenWriter_AddSection(This,iSection,flags,offset,cb)\t\\\n    ( (This)->lpVtbl -> AddSection(This,iSection,flags,offset,cb) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymNGenWriter_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymNGenWriter2_INTERFACE_DEFINED__\n#define __ISymNGenWriter2_INTERFACE_DEFINED__\n\n/* interface ISymNGenWriter2 */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ISymNGenWriter2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"B029E51B-4C55-4fe2-B993-9F7BC1F10DB4\")\n    ISymNGenWriter2 : public ISymNGenWriter\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OpenModW( \n            /* [in] */ LPCWSTR wszModule,\n            /* [in] */ LPCWSTR wszObjFile,\n            /* [out] */ BYTE **ppmod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CloseMod( \n            /* [in] */ BYTE *pmod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ModAddSymbols( \n            /* [in] */ BYTE *pmod,\n            /* [in] */ BYTE *pbSym,\n            /* [in] */ long cb) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ModAddSecContribEx( \n            /* [in] */ BYTE *pmod,\n            /* [in] */ USHORT isect,\n            /* [in] */ long off,\n            /* [in] */ long cb,\n            /* [in] */ ULONG dwCharacteristics,\n            /* [in] */ DWORD dwDataCrc,\n            /* [in] */ DWORD dwRelocCrc) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE QueryPDBNameExW( \n            /* [size_is][out] */ WCHAR wszPDB[  ],\n            /* [in] */ SIZE_T cchMax) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymNGenWriter2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ISymNGenWriter2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ISymNGenWriter2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ISymNGenWriter2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *AddSymbol )( \n            ISymNGenWriter2 * This,\n            /* [in] */ BSTR pSymbol,\n            /* [in] */ USHORT iSection,\n            /* [in] */ ULONGLONG rva);\n        \n        HRESULT ( STDMETHODCALLTYPE *AddSection )( \n            ISymNGenWriter2 * This,\n            /* [in] */ USHORT iSection,\n            /* [in] */ USHORT flags,\n            /* [in] */ long offset,\n            /* [in] */ long cb);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenModW )( \n            ISymNGenWriter2 * This,\n            /* [in] */ const WCHAR *wszModule,\n            /* [in] */ const WCHAR *wszObjFile,\n            /* [out] */ BYTE **ppmod);\n        \n        HRESULT ( STDMETHODCALLTYPE *CloseMod )( \n            ISymNGenWriter2 * This,\n            /* [in] */ BYTE *pmod);\n        \n        HRESULT ( STDMETHODCALLTYPE *ModAddSymbols )( \n            ISymNGenWriter2 * This,\n            /* [in] */ BYTE *pmod,\n            /* [in] */ BYTE *pbSym,\n            /* [in] */ long cb);\n        \n        HRESULT ( STDMETHODCALLTYPE *ModAddSecContribEx )( \n            ISymNGenWriter2 * This,\n            /* [in] */ BYTE *pmod,\n            /* [in] */ USHORT isect,\n            /* [in] */ long off,\n            /* [in] */ long cb,\n            /* [in] */ ULONG dwCharacteristics,\n            /* [in] */ DWORD dwDataCrc,\n            /* [in] */ DWORD dwRelocCrc);\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryPDBNameExW )( \n            ISymNGenWriter2 * This,\n            /* [size_is][out] */ WCHAR wszPDB[  ],\n            /* [in] */ SIZE_T cchMax);\n        \n        END_INTERFACE\n    } ISymNGenWriter2Vtbl;\n\n    interface ISymNGenWriter2\n    {\n        CONST_VTBL struct ISymNGenWriter2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymNGenWriter2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymNGenWriter2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymNGenWriter2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymNGenWriter2_AddSymbol(This,pSymbol,iSection,rva)\t\\\n    ( (This)->lpVtbl -> AddSymbol(This,pSymbol,iSection,rva) ) \n\n#define ISymNGenWriter2_AddSection(This,iSection,flags,offset,cb)\t\\\n    ( (This)->lpVtbl -> AddSection(This,iSection,flags,offset,cb) ) \n\n\n#define ISymNGenWriter2_OpenModW(This,wszModule,wszObjFile,ppmod)\t\\\n    ( (This)->lpVtbl -> OpenModW(This,wszModule,wszObjFile,ppmod) ) \n\n#define ISymNGenWriter2_CloseMod(This,pmod)\t\\\n    ( (This)->lpVtbl -> CloseMod(This,pmod) ) \n\n#define ISymNGenWriter2_ModAddSymbols(This,pmod,pbSym,cb)\t\\\n    ( (This)->lpVtbl -> ModAddSymbols(This,pmod,pbSym,cb) ) \n\n#define ISymNGenWriter2_ModAddSecContribEx(This,pmod,isect,off,cb,dwCharacteristics,dwDataCrc,dwRelocCrc)\t\\\n    ( (This)->lpVtbl -> ModAddSecContribEx(This,pmod,isect,off,cb,dwCharacteristics,dwDataCrc,dwRelocCrc) ) \n\n#define ISymNGenWriter2_QueryPDBNameExW(This,wszPDB,cchMax)\t\\\n    ( (This)->lpVtbl -> QueryPDBNameExW(This,wszPDB,cchMax) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymNGenWriter2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedAsyncMethodPropertiesWriter_INTERFACE_DEFINED__\n#define __ISymUnmanagedAsyncMethodPropertiesWriter_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedAsyncMethodPropertiesWriter */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedAsyncMethodPropertiesWriter;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"FC073774-1739-4232-BD56-A027294BEC15\")\n    ISymUnmanagedAsyncMethodPropertiesWriter : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE DefineKickoffMethod( \n            /* [in] */ mdToken kickoffMethod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineCatchHandlerILOffset( \n            /* [in] */ ULONG32 catchHandlerOffset) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DefineAsyncStepInfo( \n            /* [in] */ ULONG32 count,\n            /* [size_is][in] */ __RPC__in_ecount_full(count) ULONG32 yieldOffsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(count) ULONG32 breakpointOffset[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(count) mdToken breakpointMethod[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedAsyncMethodPropertiesWriterVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedAsyncMethodPropertiesWriter * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedAsyncMethodPropertiesWriter * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedAsyncMethodPropertiesWriter * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineKickoffMethod )( \n            __RPC__in ISymUnmanagedAsyncMethodPropertiesWriter * This,\n            /* [in] */ mdToken kickoffMethod);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineCatchHandlerILOffset )( \n            __RPC__in ISymUnmanagedAsyncMethodPropertiesWriter * This,\n            /* [in] */ ULONG32 catchHandlerOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *DefineAsyncStepInfo )( \n            __RPC__in ISymUnmanagedAsyncMethodPropertiesWriter * This,\n            /* [in] */ ULONG32 count,\n            /* [size_is][in] */ __RPC__in_ecount_full(count) ULONG32 yieldOffsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(count) ULONG32 breakpointOffset[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(count) mdToken breakpointMethod[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedAsyncMethodPropertiesWriterVtbl;\n\n    interface ISymUnmanagedAsyncMethodPropertiesWriter\n    {\n        CONST_VTBL struct ISymUnmanagedAsyncMethodPropertiesWriterVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedAsyncMethodPropertiesWriter_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedAsyncMethodPropertiesWriter_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedAsyncMethodPropertiesWriter_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedAsyncMethodPropertiesWriter_DefineKickoffMethod(This,kickoffMethod)\t\\\n    ( (This)->lpVtbl -> DefineKickoffMethod(This,kickoffMethod) ) \n\n#define ISymUnmanagedAsyncMethodPropertiesWriter_DefineCatchHandlerILOffset(This,catchHandlerOffset)\t\\\n    ( (This)->lpVtbl -> DefineCatchHandlerILOffset(This,catchHandlerOffset) ) \n\n#define ISymUnmanagedAsyncMethodPropertiesWriter_DefineAsyncStepInfo(This,count,yieldOffsets,breakpointOffset,breakpointMethod)\t\\\n    ( (This)->lpVtbl -> DefineAsyncStepInfo(This,count,yieldOffsets,breakpointOffset,breakpointMethod) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedAsyncMethodPropertiesWriter_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISymUnmanagedAsyncMethod_INTERFACE_DEFINED__\n#define __ISymUnmanagedAsyncMethod_INTERFACE_DEFINED__\n\n/* interface ISymUnmanagedAsyncMethod */\n/* [unique][uuid][object] */ \n\n\nEXTERN_C const IID IID_ISymUnmanagedAsyncMethod;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"B20D55B3-532E-4906-87E7-25BD5734ABD2\")\n    ISymUnmanagedAsyncMethod : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsAsyncMethod( \n            /* [retval][out] */ __RPC__out BOOL *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetKickoffMethod( \n            /* [retval][out] */ __RPC__out mdToken *kickoffMethod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE HasCatchHandlerILOffset( \n            /* [retval][out] */ __RPC__out BOOL *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCatchHandlerILOffset( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAsyncStepInfoCount( \n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAsyncStepInfo( \n            /* [in] */ ULONG32 cStepInfo,\n            /* [out] */ __RPC__out ULONG32 *pcStepInfo,\n            /* [size_is][in] */ __RPC__in_ecount_full(cStepInfo) ULONG32 yieldOffsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cStepInfo) ULONG32 breakpointOffset[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cStepInfo) mdToken breakpointMethod[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISymUnmanagedAsyncMethodVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            __RPC__in ISymUnmanagedAsyncMethod * This,\n            /* [in] */ __RPC__in REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            __RPC__in ISymUnmanagedAsyncMethod * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            __RPC__in ISymUnmanagedAsyncMethod * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsAsyncMethod )( \n            __RPC__in ISymUnmanagedAsyncMethod * This,\n            /* [retval][out] */ __RPC__out BOOL *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetKickoffMethod )( \n            __RPC__in ISymUnmanagedAsyncMethod * This,\n            /* [retval][out] */ __RPC__out mdToken *kickoffMethod);\n        \n        HRESULT ( STDMETHODCALLTYPE *HasCatchHandlerILOffset )( \n            __RPC__in ISymUnmanagedAsyncMethod * This,\n            /* [retval][out] */ __RPC__out BOOL *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCatchHandlerILOffset )( \n            __RPC__in ISymUnmanagedAsyncMethod * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAsyncStepInfoCount )( \n            __RPC__in ISymUnmanagedAsyncMethod * This,\n            /* [retval][out] */ __RPC__out ULONG32 *pRetVal);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAsyncStepInfo )( \n            __RPC__in ISymUnmanagedAsyncMethod * This,\n            /* [in] */ ULONG32 cStepInfo,\n            /* [out] */ __RPC__out ULONG32 *pcStepInfo,\n            /* [size_is][in] */ __RPC__in_ecount_full(cStepInfo) ULONG32 yieldOffsets[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cStepInfo) ULONG32 breakpointOffset[  ],\n            /* [size_is][in] */ __RPC__in_ecount_full(cStepInfo) mdToken breakpointMethod[  ]);\n        \n        END_INTERFACE\n    } ISymUnmanagedAsyncMethodVtbl;\n\n    interface ISymUnmanagedAsyncMethod\n    {\n        CONST_VTBL struct ISymUnmanagedAsyncMethodVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISymUnmanagedAsyncMethod_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISymUnmanagedAsyncMethod_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISymUnmanagedAsyncMethod_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISymUnmanagedAsyncMethod_IsAsyncMethod(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> IsAsyncMethod(This,pRetVal) ) \n\n#define ISymUnmanagedAsyncMethod_GetKickoffMethod(This,kickoffMethod)\t\\\n    ( (This)->lpVtbl -> GetKickoffMethod(This,kickoffMethod) ) \n\n#define ISymUnmanagedAsyncMethod_HasCatchHandlerILOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> HasCatchHandlerILOffset(This,pRetVal) ) \n\n#define ISymUnmanagedAsyncMethod_GetCatchHandlerILOffset(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetCatchHandlerILOffset(This,pRetVal) ) \n\n#define ISymUnmanagedAsyncMethod_GetAsyncStepInfoCount(This,pRetVal)\t\\\n    ( (This)->lpVtbl -> GetAsyncStepInfoCount(This,pRetVal) ) \n\n#define ISymUnmanagedAsyncMethod_GetAsyncStepInfo(This,cStepInfo,pcStepInfo,yieldOffsets,breakpointOffset,breakpointMethod)\t\\\n    ( (This)->lpVtbl -> GetAsyncStepInfo(This,cStepInfo,pcStepInfo,yieldOffsets,breakpointOffset,breakpointMethod) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISymUnmanagedAsyncMethod_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\nunsigned long             __RPC_USER  BSTR_UserSize(     __RPC__in unsigned long *, unsigned long            , __RPC__in BSTR * ); \nunsigned char * __RPC_USER  BSTR_UserMarshal(  __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); \nunsigned char * __RPC_USER  BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); \nvoid                      __RPC_USER  BSTR_UserFree(     __RPC__in unsigned long *, __RPC__in BSTR * ); \n\nunsigned long             __RPC_USER  VARIANT_UserSize(     __RPC__in unsigned long *, unsigned long            , __RPC__in VARIANT * ); \nunsigned char * __RPC_USER  VARIANT_UserMarshal(  __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); \nunsigned char * __RPC_USER  VARIANT_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); \nvoid                      __RPC_USER  VARIANT_UserFree(     __RPC__in unsigned long *, __RPC__in VARIANT * ); \n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/fxver.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#include <verrsrc.h>\n\n#define QUOTE_MACRO_HELPER(x)       #x\n#define QUOTE_MACRO(x)              QUOTE_MACRO_HELPER(x)\n\n#define VER_PRODUCTNAME_STR         L\"Microsoft\\256 .NET\"\n\n\n#define VER_INTERNALNAME_STR        QUOTE_MACRO(FX_VER_INTERNALNAME_STR)\n#define VER_ORIGINALFILENAME_STR    QUOTE_MACRO(FX_VER_INTERNALNAME_STR)\n\n#define VER_FILEDESCRIPTION_STR     FX_VER_FILEDESCRIPTION_STR\n\n#define VER_COMMENTS_STR            \"Flavor=\" QUOTE_MACRO(URTBLDENV_FRIENDLY)\n\n#define VER_FILEFLAGSMASK           VS_FFI_FILEFLAGSMASK\n#define VER_FILEFLAGS               VER_DEBUG\n#define VER_FILEOS                  VOS__WINDOWS32\n\n#define VER_FILETYPE                VFT_UNKNOWN\n#define VER_FILESUBTYPE             VFT2_UNKNOWN\n\n#define VER_VERSION_UNICODE_LANG  \"040904B0\" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Unicode CP */\n#define VER_VERSION_ANSI_LANG     \"040904E4\" /* LANG_ENGLISH/SUBLANG_ENGLISH_US, Ansi CP */\n#define VER_VERSION_TRANSLATION   0x0409, 0x04B0\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/fxver.rc",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n#ifdef _WIN32\n#include <_version.h>\n#endif //_WIN32\n\n#ifdef RC_INVOKED\n\nVS_VERSION_INFO VERSIONINFO\nFILEVERSION    VER_FILEVERSION\nPRODUCTVERSION VER_PRODUCTVERSION\nFILEFLAGSMASK  VER_FILEFLAGSMASK\nFILEFLAGS      VER_FILEFLAGS\nFILEOS         VER_FILEOS\nFILETYPE       VER_FILETYPE\nFILESUBTYPE    VER_FILESUBTYPE\nBEGIN\n    BLOCK \"StringFileInfo\"\n    BEGIN\n        BLOCK VER_VERSION_UNICODE_LANG\n        BEGIN\n            VALUE \"CompanyName\",     VER_COMPANYNAME_STR\n            VALUE \"FileDescription\", VER_FILEDESCRIPTION_STR\n            VALUE \"FileVersion\",     VER_FILEVERSION_STR\n            VALUE \"InternalName\",    VER_INTERNALNAME_STR\n            VALUE \"LegalCopyright\",  VER_LEGALCOPYRIGHT_STR\n            VALUE \"OriginalFilename\",VER_ORIGINALFILENAME_STR\n            VALUE \"ProductName\",     VER_PRODUCTNAME_STR\n            VALUE \"ProductVersion\",  VER_FILEVERSION_STR\n            VALUE \"Comments\",        VER_COMMENTS_STR\n        END\n    END\n\n    BLOCK \"VarFileInfo\"\n    BEGIN\n        VALUE \"Translation\", VER_VERSION_TRANSLATION\n    END\nEND\n\n#endif\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/metahost.h",
    "content": "\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.01.0622 */\n/* at Mon Jan 18 19:14:07 2038\n */\n/* Compiler settings for metahost.idl:\n    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 \n    protocol : dce , ms_ext, c_ext, robust\n    error checks: allocation ref bounds_check enum stub_data \n    VC __declspec() decoration level: \n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\n         DECLSPEC_UUID(), MIDL_INTERFACE()\n*/\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif /* __RPCNDR_H_VERSION__ */\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __metahost_h__\n#define __metahost_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __ICLRMetaHost_FWD_DEFINED__\n#define __ICLRMetaHost_FWD_DEFINED__\ntypedef interface ICLRMetaHost ICLRMetaHost;\n\n#endif \t/* __ICLRMetaHost_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDebuggingLibraryProvider_FWD_DEFINED__\n#define __ICLRDebuggingLibraryProvider_FWD_DEFINED__\ntypedef interface ICLRDebuggingLibraryProvider ICLRDebuggingLibraryProvider;\n\n#endif \t/* __ICLRDebuggingLibraryProvider_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDebuggingLibraryProvider2_FWD_DEFINED__\n#define __ICLRDebuggingLibraryProvider2_FWD_DEFINED__\ntypedef interface ICLRDebuggingLibraryProvider2 ICLRDebuggingLibraryProvider2;\n\n#endif \t/* __ICLRDebuggingLibraryProvider2_FWD_DEFINED__ */\n\n\n#ifndef __ICLRDebugging_FWD_DEFINED__\n#define __ICLRDebugging_FWD_DEFINED__\ntypedef interface ICLRDebugging ICLRDebugging;\n\n#endif \t/* __ICLRDebugging_FWD_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeInfo_FWD_DEFINED__\n#define __ICLRRuntimeInfo_FWD_DEFINED__\ntypedef interface ICLRRuntimeInfo ICLRRuntimeInfo;\n\n#endif \t/* __ICLRRuntimeInfo_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n#include \"oaidl.h\"\n#include \"ocidl.h\"\n#include \"mscoree.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n/* interface __MIDL_itf_metahost_0000_0000 */\n/* [local] */ \n\nSTDAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, /*iid_is(riid)*/ LPVOID *ppInterface);\nEXTERN_GUID(IID_ICLRMetaHost, 0xD332DB9E, 0xB9B3, 0x4125, 0x82, 0x07, 0xA1, 0x48, 0x84, 0xF5, 0x32, 0x16);\nEXTERN_GUID(CLSID_CLRMetaHost, 0x9280188d, 0xe8e, 0x4867, 0xb3, 0xc, 0x7f, 0xa8, 0x38, 0x84, 0xe8, 0xde);\nEXTERN_GUID(IID_ICLRDebugging, 0xd28f3c5a, 0x9634, 0x4206, 0xa5, 0x9, 0x47, 0x75, 0x52, 0xee, 0xfb, 0x10);\nEXTERN_GUID(CLSID_CLRDebugging, 0xbacc578d, 0xfbdd, 0x48a4, 0x96, 0x9f, 0x2, 0xd9, 0x32, 0xb7, 0x46, 0x34);\nEXTERN_GUID(IID_ICLRRuntimeInfo, 0xBD39D1D2, 0xBA2F, 0x486a, 0x89, 0xB0, 0xB4, 0xB0, 0xCB, 0x46, 0x68, 0x91);\nEXTERN_GUID(IID_ICLRDebuggingLibraryProvider, 0x3151c08d, 0x4d09, 0x4f9b, 0x88, 0x38, 0x28, 0x80, 0xbf, 0x18, 0xfe, 0x51);\nEXTERN_GUID(IID_ICLRDebuggingLibraryProvider2, 0xE04E2FF1, 0xDCFD, 0x45D5, 0xBC, 0xD1, 0x16, 0xFF, 0xF2, 0xFA, 0xF7, 0xBA);\n\ntypedef HRESULT ( __stdcall *CallbackThreadSetFnPtr )( void);\n\ntypedef HRESULT ( __stdcall *CallbackThreadUnsetFnPtr )( void);\n\ntypedef void ( __stdcall *RuntimeLoadedCallbackFnPtr )( \n    ICLRRuntimeInfo *pRuntimeInfo,\n    CallbackThreadSetFnPtr pfnCallbackThreadSet,\n    CallbackThreadUnsetFnPtr pfnCallbackThreadUnset);\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_metahost_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_metahost_0000_0000_v0_0_s_ifspec;\n\n#ifndef __ICLRMetaHost_INTERFACE_DEFINED__\n#define __ICLRMetaHost_INTERFACE_DEFINED__\n\n/* interface ICLRMetaHost */\n/* [object][local][helpstring][version][uuid] */ \n\n\nEXTERN_C const IID IID_ICLRMetaHost;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"D332DB9E-B9B3-4125-8207-A14884F53216\")\n    ICLRMetaHost : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetRuntime( \n            /* [in] */ LPCWSTR pwzVersion,\n            /* [in] */ REFIID riid,\n            /* [retval][iid_is][out] */ LPVOID *ppRuntime) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetVersionFromFile( \n            /* [in] */ LPCWSTR pwzFilePath,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumerateInstalledRuntimes( \n            /* [retval][out] */ IEnumUnknown **ppEnumerator) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumerateLoadedRuntimes( \n            /* [in] */ HANDLE hndProcess,\n            /* [retval][out] */ IEnumUnknown **ppEnumerator) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE RequestRuntimeLoadedNotification( \n            /* [in] */ RuntimeLoadedCallbackFnPtr pCallbackFunction) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE QueryLegacyV2RuntimeBinding( \n            /* [in] */ REFIID riid,\n            /* [retval][iid_is][out] */ LPVOID *ppUnk) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ExitProcess( \n            /* [in] */ INT32 iExitCode) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRMetaHostVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRMetaHost * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRMetaHost * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRMetaHost * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRuntime )( \n            ICLRMetaHost * This,\n            /* [in] */ LPCWSTR pwzVersion,\n            /* [in] */ REFIID riid,\n            /* [retval][iid_is][out] */ LPVOID *ppRuntime);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetVersionFromFile )( \n            ICLRMetaHost * This,\n            /* [in] */ LPCWSTR pwzFilePath,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumerateInstalledRuntimes )( \n            ICLRMetaHost * This,\n            /* [retval][out] */ IEnumUnknown **ppEnumerator);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumerateLoadedRuntimes )( \n            ICLRMetaHost * This,\n            /* [in] */ HANDLE hndProcess,\n            /* [retval][out] */ IEnumUnknown **ppEnumerator);\n        \n        HRESULT ( STDMETHODCALLTYPE *RequestRuntimeLoadedNotification )( \n            ICLRMetaHost * This,\n            /* [in] */ RuntimeLoadedCallbackFnPtr pCallbackFunction);\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryLegacyV2RuntimeBinding )( \n            ICLRMetaHost * This,\n            /* [in] */ REFIID riid,\n            /* [retval][iid_is][out] */ LPVOID *ppUnk);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExitProcess )( \n            ICLRMetaHost * This,\n            /* [in] */ INT32 iExitCode);\n        \n        END_INTERFACE\n    } ICLRMetaHostVtbl;\n\n    interface ICLRMetaHost\n    {\n        CONST_VTBL struct ICLRMetaHostVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRMetaHost_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRMetaHost_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRMetaHost_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRMetaHost_GetRuntime(This,pwzVersion,riid,ppRuntime)\t\\\n    ( (This)->lpVtbl -> GetRuntime(This,pwzVersion,riid,ppRuntime) ) \n\n#define ICLRMetaHost_GetVersionFromFile(This,pwzFilePath,pwzBuffer,pcchBuffer)\t\\\n    ( (This)->lpVtbl -> GetVersionFromFile(This,pwzFilePath,pwzBuffer,pcchBuffer) ) \n\n#define ICLRMetaHost_EnumerateInstalledRuntimes(This,ppEnumerator)\t\\\n    ( (This)->lpVtbl -> EnumerateInstalledRuntimes(This,ppEnumerator) ) \n\n#define ICLRMetaHost_EnumerateLoadedRuntimes(This,hndProcess,ppEnumerator)\t\\\n    ( (This)->lpVtbl -> EnumerateLoadedRuntimes(This,hndProcess,ppEnumerator) ) \n\n#define ICLRMetaHost_RequestRuntimeLoadedNotification(This,pCallbackFunction)\t\\\n    ( (This)->lpVtbl -> RequestRuntimeLoadedNotification(This,pCallbackFunction) ) \n\n#define ICLRMetaHost_QueryLegacyV2RuntimeBinding(This,riid,ppUnk)\t\\\n    ( (This)->lpVtbl -> QueryLegacyV2RuntimeBinding(This,riid,ppUnk) ) \n\n#define ICLRMetaHost_ExitProcess(This,iExitCode)\t\\\n    ( (This)->lpVtbl -> ExitProcess(This,iExitCode) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRMetaHost_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_metahost_0000_0001 */\n/* [local] */ \n\ntypedef struct _CLR_DEBUGGING_VERSION\n    {\n    WORD wStructVersion;\n    WORD wMajor;\n    WORD wMinor;\n    WORD wBuild;\n    WORD wRevision;\n    } \tCLR_DEBUGGING_VERSION;\n\ntypedef /* [public][public] */ \nenum __MIDL___MIDL_itf_metahost_0000_0001_0001\n    {\n        CLR_DEBUGGING_MANAGED_EVENT_PENDING\t= 1,\n        CLR_DEBUGGING_MANAGED_EVENT_DEBUGGER_LAUNCH\t= 2\n    } \tCLR_DEBUGGING_PROCESS_FLAGS;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_metahost_0000_0001_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_metahost_0000_0001_v0_0_s_ifspec;\n\n#ifndef __ICLRDebuggingLibraryProvider_INTERFACE_DEFINED__\n#define __ICLRDebuggingLibraryProvider_INTERFACE_DEFINED__\n\n/* interface ICLRDebuggingLibraryProvider */\n/* [object][local][helpstring][version][uuid] */ \n\n\nEXTERN_C const IID IID_ICLRDebuggingLibraryProvider;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"3151C08D-4D09-4f9b-8838-2880BF18FE51\")\n    ICLRDebuggingLibraryProvider : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ProvideLibrary( \n            /* [in] */ const WCHAR *pwszFileName,\n            /* [in] */ DWORD dwTimestamp,\n            /* [in] */ DWORD dwSizeOfImage,\n            /* [out] */ HMODULE *phModule) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDebuggingLibraryProviderVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDebuggingLibraryProvider * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDebuggingLibraryProvider * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDebuggingLibraryProvider * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *ProvideLibrary )( \n            ICLRDebuggingLibraryProvider * This,\n            /* [in] */ const WCHAR *pwszFileName,\n            /* [in] */ DWORD dwTimestamp,\n            /* [in] */ DWORD dwSizeOfImage,\n            /* [out] */ HMODULE *phModule);\n        \n        END_INTERFACE\n    } ICLRDebuggingLibraryProviderVtbl;\n\n    interface ICLRDebuggingLibraryProvider\n    {\n        CONST_VTBL struct ICLRDebuggingLibraryProviderVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDebuggingLibraryProvider_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDebuggingLibraryProvider_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDebuggingLibraryProvider_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDebuggingLibraryProvider_ProvideLibrary(This,pwszFileName,dwTimestamp,dwSizeOfImage,phModule)\t\\\n    ( (This)->lpVtbl -> ProvideLibrary(This,pwszFileName,dwTimestamp,dwSizeOfImage,phModule) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDebuggingLibraryProvider_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRDebuggingLibraryProvider2_INTERFACE_DEFINED__\n#define __ICLRDebuggingLibraryProvider2_INTERFACE_DEFINED__\n\n/* interface ICLRDebuggingLibraryProvider2 */\n/* [object][local][helpstring][version][uuid] */ \n\n\nEXTERN_C const IID IID_ICLRDebuggingLibraryProvider2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"E04E2FF1-DCFD-45D5-BCD1-16FFF2FAF7BA\")\n    ICLRDebuggingLibraryProvider2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ProvideLibrary2( \n            /* [in] */ const WCHAR *pwszFileName,\n            /* [in] */ DWORD dwTimestamp,\n            /* [in] */ DWORD dwSizeOfImage,\n            /* [out] */ LPWSTR *ppResolvedModulePath) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDebuggingLibraryProvider2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDebuggingLibraryProvider2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDebuggingLibraryProvider2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDebuggingLibraryProvider2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *ProvideLibrary2 )( \n            ICLRDebuggingLibraryProvider2 * This,\n            /* [in] */ const WCHAR *pwszFileName,\n            /* [in] */ DWORD dwTimestamp,\n            /* [in] */ DWORD dwSizeOfImage,\n            /* [out] */ LPWSTR *ppResolvedModulePath);\n        \n        END_INTERFACE\n    } ICLRDebuggingLibraryProvider2Vtbl;\n\n    interface ICLRDebuggingLibraryProvider2\n    {\n        CONST_VTBL struct ICLRDebuggingLibraryProvider2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDebuggingLibraryProvider2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDebuggingLibraryProvider2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDebuggingLibraryProvider2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDebuggingLibraryProvider2_ProvideLibrary2(This,pwszFileName,dwTimestamp,dwSizeOfImage,ppResolvedModulePath)\t\\\n    ( (This)->lpVtbl -> ProvideLibrary2(This,pwszFileName,dwTimestamp,dwSizeOfImage,ppResolvedModulePath) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDebuggingLibraryProvider2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRDebugging_INTERFACE_DEFINED__\n#define __ICLRDebugging_INTERFACE_DEFINED__\n\n/* interface ICLRDebugging */\n/* [object][local][helpstring][version][uuid] */ \n\n\nEXTERN_C const IID IID_ICLRDebugging;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"D28F3C5A-9634-4206-A509-477552EEFB10\")\n    ICLRDebugging : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OpenVirtualProcess( \n            /* [in] */ ULONG64 moduleBaseAddress,\n            /* [in] */ IUnknown *pDataTarget,\n            /* [in] */ ICLRDebuggingLibraryProvider *pLibraryProvider,\n            /* [in] */ CLR_DEBUGGING_VERSION *pMaxDebuggerSupportedVersion,\n            /* [in] */ REFIID riidProcess,\n            /* [iid_is][out] */ IUnknown **ppProcess,\n            /* [out][in] */ CLR_DEBUGGING_VERSION *pVersion,\n            /* [out] */ CLR_DEBUGGING_PROCESS_FLAGS *pdwFlags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CanUnloadNow( \n            HMODULE hModule) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRDebuggingVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRDebugging * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRDebugging * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRDebugging * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OpenVirtualProcess )( \n            ICLRDebugging * This,\n            /* [in] */ ULONG64 moduleBaseAddress,\n            /* [in] */ IUnknown *pDataTarget,\n            /* [in] */ ICLRDebuggingLibraryProvider *pLibraryProvider,\n            /* [in] */ CLR_DEBUGGING_VERSION *pMaxDebuggerSupportedVersion,\n            /* [in] */ REFIID riidProcess,\n            /* [iid_is][out] */ IUnknown **ppProcess,\n            /* [out][in] */ CLR_DEBUGGING_VERSION *pVersion,\n            /* [out] */ CLR_DEBUGGING_PROCESS_FLAGS *pdwFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *CanUnloadNow )( \n            ICLRDebugging * This,\n            HMODULE hModule);\n        \n        END_INTERFACE\n    } ICLRDebuggingVtbl;\n\n    interface ICLRDebugging\n    {\n        CONST_VTBL struct ICLRDebuggingVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRDebugging_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRDebugging_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRDebugging_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRDebugging_OpenVirtualProcess(This,moduleBaseAddress,pDataTarget,pLibraryProvider,pMaxDebuggerSupportedVersion,riidProcess,ppProcess,pVersion,pdwFlags)\t\\\n    ( (This)->lpVtbl -> OpenVirtualProcess(This,moduleBaseAddress,pDataTarget,pLibraryProvider,pMaxDebuggerSupportedVersion,riidProcess,ppProcess,pVersion,pdwFlags) ) \n\n#define ICLRDebugging_CanUnloadNow(This,hModule)\t\\\n    ( (This)->lpVtbl -> CanUnloadNow(This,hModule) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRDebugging_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeInfo_INTERFACE_DEFINED__\n#define __ICLRRuntimeInfo_INTERFACE_DEFINED__\n\n/* interface ICLRRuntimeInfo */\n/* [object][local][helpstring][version][uuid] */ \n\n\nEXTERN_C const IID IID_ICLRRuntimeInfo;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"BD39D1D2-BA2F-486a-89B0-B4B0CB466891\")\n    ICLRRuntimeInfo : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetVersionString( \n            /* [annotation][size_is][out] */ \n            _Out_writes_all_opt_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetRuntimeDirectory( \n            /* [annotation][size_is][out] */ \n            _Out_writes_all_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsLoaded( \n            /* [in] */ HANDLE hndProcess,\n            /* [retval][out] */ BOOL *pbLoaded) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE LoadErrorString( \n            /* [in] */ UINT iResourceID,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer,\n            /* [lcid][in] */ LONG iLocaleID) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE LoadLibrary( \n            /* [in] */ LPCWSTR pwzDllName,\n            /* [retval][out] */ HMODULE *phndModule) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetProcAddress( \n            /* [in] */ LPCSTR pszProcName,\n            /* [retval][out] */ LPVOID *ppProc) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetInterface( \n            /* [in] */ REFCLSID rclsid,\n            /* [in] */ REFIID riid,\n            /* [retval][iid_is][out] */ LPVOID *ppUnk) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsLoadable( \n            /* [retval][out] */ BOOL *pbLoadable) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetDefaultStartupFlags( \n            /* [in] */ DWORD dwStartupFlags,\n            /* [in] */ LPCWSTR pwzHostConfigFile) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDefaultStartupFlags( \n            /* [out] */ DWORD *pdwStartupFlags,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_opt_(*pcchHostConfigFile)  LPWSTR pwzHostConfigFile,\n            /* [out][in] */ DWORD *pcchHostConfigFile) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE BindAsLegacyV2Runtime( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsStarted( \n            /* [out] */ BOOL *pbStarted,\n            /* [out] */ DWORD *pdwStartupFlags) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRRuntimeInfoVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRRuntimeInfo * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRRuntimeInfo * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRRuntimeInfo * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetVersionString )( \n            ICLRRuntimeInfo * This,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_opt_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeDirectory )( \n            ICLRRuntimeInfo * This,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsLoaded )( \n            ICLRRuntimeInfo * This,\n            /* [in] */ HANDLE hndProcess,\n            /* [retval][out] */ BOOL *pbLoaded);\n        \n        HRESULT ( STDMETHODCALLTYPE *LoadErrorString )( \n            ICLRRuntimeInfo * This,\n            /* [in] */ UINT iResourceID,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_(*pcchBuffer)  LPWSTR pwzBuffer,\n            /* [out][in] */ DWORD *pcchBuffer,\n            /* [lcid][in] */ LONG iLocaleID);\n        \n        HRESULT ( STDMETHODCALLTYPE *LoadLibrary )( \n            ICLRRuntimeInfo * This,\n            /* [in] */ LPCWSTR pwzDllName,\n            /* [retval][out] */ HMODULE *phndModule);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetProcAddress )( \n            ICLRRuntimeInfo * This,\n            /* [in] */ LPCSTR pszProcName,\n            /* [retval][out] */ LPVOID *ppProc);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetInterface )( \n            ICLRRuntimeInfo * This,\n            /* [in] */ REFCLSID rclsid,\n            /* [in] */ REFIID riid,\n            /* [retval][iid_is][out] */ LPVOID *ppUnk);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsLoadable )( \n            ICLRRuntimeInfo * This,\n            /* [retval][out] */ BOOL *pbLoadable);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetDefaultStartupFlags )( \n            ICLRRuntimeInfo * This,\n            /* [in] */ DWORD dwStartupFlags,\n            /* [in] */ LPCWSTR pwzHostConfigFile);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDefaultStartupFlags )( \n            ICLRRuntimeInfo * This,\n            /* [out] */ DWORD *pdwStartupFlags,\n            /* [annotation][size_is][out] */ \n            _Out_writes_all_opt_(*pcchHostConfigFile)  LPWSTR pwzHostConfigFile,\n            /* [out][in] */ DWORD *pcchHostConfigFile);\n        \n        HRESULT ( STDMETHODCALLTYPE *BindAsLegacyV2Runtime )( \n            ICLRRuntimeInfo * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsStarted )( \n            ICLRRuntimeInfo * This,\n            /* [out] */ BOOL *pbStarted,\n            /* [out] */ DWORD *pdwStartupFlags);\n        \n        END_INTERFACE\n    } ICLRRuntimeInfoVtbl;\n\n    interface ICLRRuntimeInfo\n    {\n        CONST_VTBL struct ICLRRuntimeInfoVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRRuntimeInfo_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRRuntimeInfo_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRRuntimeInfo_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRRuntimeInfo_GetVersionString(This,pwzBuffer,pcchBuffer)\t\\\n    ( (This)->lpVtbl -> GetVersionString(This,pwzBuffer,pcchBuffer) ) \n\n#define ICLRRuntimeInfo_GetRuntimeDirectory(This,pwzBuffer,pcchBuffer)\t\\\n    ( (This)->lpVtbl -> GetRuntimeDirectory(This,pwzBuffer,pcchBuffer) ) \n\n#define ICLRRuntimeInfo_IsLoaded(This,hndProcess,pbLoaded)\t\\\n    ( (This)->lpVtbl -> IsLoaded(This,hndProcess,pbLoaded) ) \n\n#define ICLRRuntimeInfo_LoadErrorString(This,iResourceID,pwzBuffer,pcchBuffer,iLocaleID)\t\\\n    ( (This)->lpVtbl -> LoadErrorString(This,iResourceID,pwzBuffer,pcchBuffer,iLocaleID) ) \n\n#define ICLRRuntimeInfo_LoadLibrary(This,pwzDllName,phndModule)\t\\\n    ( (This)->lpVtbl -> LoadLibrary(This,pwzDllName,phndModule) ) \n\n#define ICLRRuntimeInfo_GetProcAddress(This,pszProcName,ppProc)\t\\\n    ( (This)->lpVtbl -> GetProcAddress(This,pszProcName,ppProc) ) \n\n#define ICLRRuntimeInfo_GetInterface(This,rclsid,riid,ppUnk)\t\\\n    ( (This)->lpVtbl -> GetInterface(This,rclsid,riid,ppUnk) ) \n\n#define ICLRRuntimeInfo_IsLoadable(This,pbLoadable)\t\\\n    ( (This)->lpVtbl -> IsLoadable(This,pbLoadable) ) \n\n#define ICLRRuntimeInfo_SetDefaultStartupFlags(This,dwStartupFlags,pwzHostConfigFile)\t\\\n    ( (This)->lpVtbl -> SetDefaultStartupFlags(This,dwStartupFlags,pwzHostConfigFile) ) \n\n#define ICLRRuntimeInfo_GetDefaultStartupFlags(This,pdwStartupFlags,pwzHostConfigFile,pcchHostConfigFile)\t\\\n    ( (This)->lpVtbl -> GetDefaultStartupFlags(This,pdwStartupFlags,pwzHostConfigFile,pcchHostConfigFile) ) \n\n#define ICLRRuntimeInfo_BindAsLegacyV2Runtime(This)\t\\\n    ( (This)->lpVtbl -> BindAsLegacyV2Runtime(This) ) \n\n#define ICLRRuntimeInfo_IsStarted(This,pbStarted,pdwStartupFlags)\t\\\n    ( (This)->lpVtbl -> IsStarted(This,pbStarted,pdwStartupFlags) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRRuntimeInfo_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/mscoree.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.00.0603 */\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif /* __RPCNDR_H_VERSION__ */\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __mscoree_h__\n#define __mscoree_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __ICLRRuntimeHost_FWD_DEFINED__\n#define __ICLRRuntimeHost_FWD_DEFINED__\ntypedef interface ICLRRuntimeHost ICLRRuntimeHost;\n\n#endif \t/* __ICLRRuntimeHost_FWD_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeHost2_FWD_DEFINED__\n#define __ICLRRuntimeHost2_FWD_DEFINED__\ntypedef interface ICLRRuntimeHost2 ICLRRuntimeHost2;\n\n#endif \t/* __ICLRRuntimeHost2_FWD_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeHost4_FWD_DEFINED__\n#define __ICLRRuntimeHost4_FWD_DEFINED__\ntypedef interface ICLRRuntimeHost4 ICLRRuntimeHost4;\n\n#endif \t/* __ICLRRuntimeHost4_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n/* interface __MIDL_itf_mscoree_0000_0000 */\n/* [local] */ \n\nstruct IActivationFactory;\n\nstruct IHostControl;\n\nstruct ICLRControl;\n\nEXTERN_GUID(IID_ICLRRuntimeHost, 0x90F1A06C, 0x7712, 0x4762, 0x86, 0xB5, 0x7A, 0x5E, 0xBA, 0x6B, 0xDB, 0x02);\nEXTERN_GUID(IID_ICLRRuntimeHost2, 0x712AB73F, 0x2C22, 0x4807, 0xAD, 0x7E, 0xF5, 0x01, 0xD7, 0xb7, 0x2C, 0x2D);\nEXTERN_GUID(IID_ICLRRuntimeHost4, 0x64F6D366, 0xD7C2, 0x4F1F, 0xB4, 0xB2, 0xE8, 0x16, 0x0C, 0xAC, 0x43, 0xAF);\ntypedef HRESULT  (STDAPICALLTYPE *FnGetCLRRuntimeHost)(REFIID riid, IUnknown **pUnk);\ntypedef HRESULT ( __stdcall *FExecuteInAppDomainCallback )( \n    void *cookie);\n\ntypedef /* [public][public] */ \nenum __MIDL___MIDL_itf_mscoree_0000_0000_0001\n    {\n        STARTUP_CONCURRENT_GC\t= 0x1,\n        STARTUP_LOADER_OPTIMIZATION_MASK\t= ( 0x3 << 1 ) ,\n        STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN\t= ( 0x1 << 1 ) ,\n        STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN\t= ( 0x2 << 1 ) ,\n        STARTUP_LOADER_OPTIMIZATION_MULTI_DOMAIN_HOST\t= ( 0x3 << 1 ) ,\n        STARTUP_LOADER_SAFEMODE\t= 0x10,\n        STARTUP_LOADER_SETPREFERENCE\t= 0x100,\n        STARTUP_SERVER_GC\t= 0x1000,\n        STARTUP_HOARD_GC_VM\t= 0x2000,\n        STARTUP_SINGLE_VERSION_HOSTING_INTERFACE\t= 0x4000,\n        STARTUP_LEGACY_IMPERSONATION\t= 0x10000,\n        STARTUP_DISABLE_COMMITTHREADSTACK\t= 0x20000,\n        STARTUP_ALWAYSFLOW_IMPERSONATION\t= 0x40000,\n        STARTUP_TRIM_GC_COMMIT\t= 0x80000,\n        STARTUP_ETW\t= 0x100000,\n        STARTUP_ARM\t= 0x400000,\n        STARTUP_SINGLE_APPDOMAIN\t= 0x800000,\n        STARTUP_APPX_APP_MODEL\t= 0x1000000,\n        STARTUP_DISABLE_RANDOMIZED_STRING_HASHING\t= 0x2000000\n    } \tSTARTUP_FLAGS;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_mscoree_0000_0000_0002\n    {\n        APPDOMAIN_SECURITY_DEFAULT\t= 0,\n        APPDOMAIN_SECURITY_SANDBOXED\t= 0x1,\n        APPDOMAIN_SECURITY_FORBID_CROSSAD_REVERSE_PINVOKE\t= 0x2,\n        APPDOMAIN_IGNORE_UNHANDLED_EXCEPTIONS\t= 0x4,\n        APPDOMAIN_FORCE_TRIVIAL_WAIT_OPERATIONS\t= 0x8,\n        APPDOMAIN_ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP\t= 0x10,\n        APPDOMAIN_ENABLE_PLATFORM_SPECIFIC_APPS\t= 0x40,\n        APPDOMAIN_ENABLE_ASSEMBLY_LOADFILE\t= 0x80,\n        APPDOMAIN_DISABLE_TRANSPARENCY_ENFORCEMENT\t= 0x100\n    } \tAPPDOMAIN_SECURITY_FLAGS;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_mscoree_0000_0000_0003\n    {\n        WAIT_MSGPUMP\t= 0x1,\n        WAIT_ALERTABLE\t= 0x2,\n        WAIT_NOTINDEADLOCK\t= 0x4\n    } \tWAIT_OPTION;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_mscoree_0000_0000_0004\n    {\n        DUMP_FLAVOR_Mini\t= 0,\n        DUMP_FLAVOR_CriticalCLRState\t= 1,\n        DUMP_FLAVOR_NonHeapCLRState\t= 2,\n        DUMP_FLAVOR_Default\t= DUMP_FLAVOR_Mini\n    } \tECustomDumpFlavor;\n\n#define\tBucketParamsCount\t( 10 )\n\n#define\tBucketParamLength\t( 255 )\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_mscoree_0000_0000_0005\n    {\n        Parameter1\t= 0,\n        Parameter2\t= ( Parameter1 + 1 ) ,\n        Parameter3\t= ( Parameter2 + 1 ) ,\n        Parameter4\t= ( Parameter3 + 1 ) ,\n        Parameter5\t= ( Parameter4 + 1 ) ,\n        Parameter6\t= ( Parameter5 + 1 ) ,\n        Parameter7\t= ( Parameter6 + 1 ) ,\n        Parameter8\t= ( Parameter7 + 1 ) ,\n        Parameter9\t= ( Parameter8 + 1 ) ,\n        InvalidBucketParamIndex\t= ( Parameter9 + 1 ) \n    } \tBucketParameterIndex;\n\ntypedef struct _BucketParameters\n    {\n    BOOL fInited;\n    WCHAR pszEventTypeName[ 255 ];\n    WCHAR pszParams[ 10 ][ 255 ];\n    } \tBucketParameters;\n\nextern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0000_v0_0_s_ifspec;\n\n#ifndef __ICLRRuntimeHost_INTERFACE_DEFINED__\n#define __ICLRRuntimeHost_INTERFACE_DEFINED__\n\n/* interface ICLRRuntimeHost */\n/* [object][local][unique][helpstring][version][uuid] */ \n\n\nEXTERN_C const IID IID_ICLRRuntimeHost;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"90F1A06C-7712-4762-86B5-7A5EBA6BDB02\")\n    ICLRRuntimeHost : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Start( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Stop( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetHostControl( \n            /* [in] */ IHostControl *pHostControl) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCLRControl( \n            /* [out] */ ICLRControl **pCLRControl) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE UnloadAppDomain( \n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ BOOL fWaitUntilDone) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ExecuteInAppDomain( \n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ FExecuteInAppDomainCallback pCallback,\n            /* [in] */ void *cookie) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCurrentAppDomainId( \n            /* [out] */ DWORD *pdwAppDomainId) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ExecuteApplication( \n            /* [in] */ LPCWSTR pwzAppFullName,\n            /* [in] */ DWORD dwManifestPaths,\n            /* [in] */ LPCWSTR *ppwzManifestPaths,\n            /* [in] */ DWORD dwActivationData,\n            /* [in] */ LPCWSTR *ppwzActivationData,\n            /* [out] */ int *pReturnValue) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ExecuteInDefaultAppDomain( \n            /* [in] */ LPCWSTR pwzAssemblyPath,\n            /* [in] */ LPCWSTR pwzTypeName,\n            /* [in] */ LPCWSTR pwzMethodName,\n            /* [in] */ LPCWSTR pwzArgument,\n            /* [out] */ DWORD *pReturnValue) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRRuntimeHostVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRRuntimeHost * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRRuntimeHost * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRRuntimeHost * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Start )( \n            ICLRRuntimeHost * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Stop )( \n            ICLRRuntimeHost * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetHostControl )( \n            ICLRRuntimeHost * This,\n            /* [in] */ IHostControl *pHostControl);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCLRControl )( \n            ICLRRuntimeHost * This,\n            /* [out] */ ICLRControl **pCLRControl);\n        \n        HRESULT ( STDMETHODCALLTYPE *UnloadAppDomain )( \n            ICLRRuntimeHost * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ BOOL fWaitUntilDone);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteInAppDomain )( \n            ICLRRuntimeHost * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ FExecuteInAppDomainCallback pCallback,\n            /* [in] */ void *cookie);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCurrentAppDomainId )( \n            ICLRRuntimeHost * This,\n            /* [out] */ DWORD *pdwAppDomainId);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteApplication )( \n            ICLRRuntimeHost * This,\n            /* [in] */ LPCWSTR pwzAppFullName,\n            /* [in] */ DWORD dwManifestPaths,\n            /* [in] */ LPCWSTR *ppwzManifestPaths,\n            /* [in] */ DWORD dwActivationData,\n            /* [in] */ LPCWSTR *ppwzActivationData,\n            /* [out] */ int *pReturnValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteInDefaultAppDomain )( \n            ICLRRuntimeHost * This,\n            /* [in] */ LPCWSTR pwzAssemblyPath,\n            /* [in] */ LPCWSTR pwzTypeName,\n            /* [in] */ LPCWSTR pwzMethodName,\n            /* [in] */ LPCWSTR pwzArgument,\n            /* [out] */ DWORD *pReturnValue);\n        \n        END_INTERFACE\n    } ICLRRuntimeHostVtbl;\n\n    interface ICLRRuntimeHost\n    {\n        CONST_VTBL struct ICLRRuntimeHostVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRRuntimeHost_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRRuntimeHost_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRRuntimeHost_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRRuntimeHost_Start(This)\t\\\n    ( (This)->lpVtbl -> Start(This) ) \n\n#define ICLRRuntimeHost_Stop(This)\t\\\n    ( (This)->lpVtbl -> Stop(This) ) \n\n#define ICLRRuntimeHost_SetHostControl(This,pHostControl)\t\\\n    ( (This)->lpVtbl -> SetHostControl(This,pHostControl) ) \n\n#define ICLRRuntimeHost_GetCLRControl(This,pCLRControl)\t\\\n    ( (This)->lpVtbl -> GetCLRControl(This,pCLRControl) ) \n\n#define ICLRRuntimeHost_UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone)\t\\\n    ( (This)->lpVtbl -> UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone) ) \n\n#define ICLRRuntimeHost_ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie)\t\\\n    ( (This)->lpVtbl -> ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie) ) \n\n#define ICLRRuntimeHost_GetCurrentAppDomainId(This,pdwAppDomainId)\t\\\n    ( (This)->lpVtbl -> GetCurrentAppDomainId(This,pdwAppDomainId) ) \n\n#define ICLRRuntimeHost_ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue) ) \n\n#define ICLRRuntimeHost_ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRRuntimeHost_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeHost2_INTERFACE_DEFINED__\n#define __ICLRRuntimeHost2_INTERFACE_DEFINED__\n\n/* interface ICLRRuntimeHost2 */\n/* [local][unique][helpstring][version][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICLRRuntimeHost2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"712AB73F-2C22-4807-AD7E-F501D7B72C2D\")\n    ICLRRuntimeHost2 : public ICLRRuntimeHost\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE CreateAppDomainWithManager( \n            /* [in] */ LPCWSTR wszFriendlyName,\n            /* [in] */ DWORD dwFlags,\n            /* [in] */ LPCWSTR wszAppDomainManagerAssemblyName,\n            /* [in] */ LPCWSTR wszAppDomainManagerTypeName,\n            /* [in] */ int nProperties,\n            /* [in] */ LPCWSTR *pPropertyNames,\n            /* [in] */ LPCWSTR *pPropertyValues,\n            /* [out] */ DWORD *pAppDomainID) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CreateDelegate( \n            /* [in] */ DWORD appDomainID,\n            /* [in] */ LPCWSTR wszAssemblyName,\n            /* [in] */ LPCWSTR wszClassName,\n            /* [in] */ LPCWSTR wszMethodName,\n            /* [out] */ INT_PTR *fnPtr) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Authenticate( \n            /* [in] */ ULONGLONG authKey) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE RegisterMacEHPort( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetStartupFlags( \n            /* [in] */ STARTUP_FLAGS dwFlags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DllGetActivationFactory( \n            /* [in] */ DWORD appDomainID,\n            /* [in] */ LPCWSTR wszTypeName,\n            /* [out] */ IActivationFactory **factory) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ExecuteAssembly( \n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ LPCWSTR pwzAssemblyPath,\n            /* [in] */ int argc,\n            /* [in] */ LPCWSTR *argv,\n            /* [out] */ DWORD *pReturnValue) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRRuntimeHost2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRRuntimeHost2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRRuntimeHost2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Start )( \n            ICLRRuntimeHost2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Stop )( \n            ICLRRuntimeHost2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetHostControl )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ IHostControl *pHostControl);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCLRControl )( \n            ICLRRuntimeHost2 * This,\n            /* [out] */ ICLRControl **pCLRControl);\n        \n        HRESULT ( STDMETHODCALLTYPE *UnloadAppDomain )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ BOOL fWaitUntilDone);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteInAppDomain )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ FExecuteInAppDomainCallback pCallback,\n            /* [in] */ void *cookie);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCurrentAppDomainId )( \n            ICLRRuntimeHost2 * This,\n            /* [out] */ DWORD *pdwAppDomainId);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteApplication )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ LPCWSTR pwzAppFullName,\n            /* [in] */ DWORD dwManifestPaths,\n            /* [in] */ LPCWSTR *ppwzManifestPaths,\n            /* [in] */ DWORD dwActivationData,\n            /* [in] */ LPCWSTR *ppwzActivationData,\n            /* [out] */ int *pReturnValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteInDefaultAppDomain )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ LPCWSTR pwzAssemblyPath,\n            /* [in] */ LPCWSTR pwzTypeName,\n            /* [in] */ LPCWSTR pwzMethodName,\n            /* [in] */ LPCWSTR pwzArgument,\n            /* [out] */ DWORD *pReturnValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *CreateAppDomainWithManager )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ LPCWSTR wszFriendlyName,\n            /* [in] */ DWORD dwFlags,\n            /* [in] */ LPCWSTR wszAppDomainManagerAssemblyName,\n            /* [in] */ LPCWSTR wszAppDomainManagerTypeName,\n            /* [in] */ int nProperties,\n            /* [in] */ LPCWSTR *pPropertyNames,\n            /* [in] */ LPCWSTR *pPropertyValues,\n            /* [out] */ DWORD *pAppDomainID);\n        \n        HRESULT ( STDMETHODCALLTYPE *CreateDelegate )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ DWORD appDomainID,\n            /* [in] */ LPCWSTR wszAssemblyName,\n            /* [in] */ LPCWSTR wszClassName,\n            /* [in] */ LPCWSTR wszMethodName,\n            /* [out] */ INT_PTR *fnPtr);\n        \n        HRESULT ( STDMETHODCALLTYPE *Authenticate )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ ULONGLONG authKey);\n        \n        HRESULT ( STDMETHODCALLTYPE *RegisterMacEHPort )( \n            ICLRRuntimeHost2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetStartupFlags )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ STARTUP_FLAGS dwFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *DllGetActivationFactory )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ DWORD appDomainID,\n            /* [in] */ LPCWSTR wszTypeName,\n            /* [out] */ IActivationFactory **factory);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteAssembly )( \n            ICLRRuntimeHost2 * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ LPCWSTR pwzAssemblyPath,\n            /* [in] */ int argc,\n            /* [in] */ LPCWSTR *argv,\n            /* [out] */ DWORD *pReturnValue);\n        \n        END_INTERFACE\n    } ICLRRuntimeHost2Vtbl;\n\n    interface ICLRRuntimeHost2\n    {\n        CONST_VTBL struct ICLRRuntimeHost2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRRuntimeHost2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRRuntimeHost2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRRuntimeHost2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRRuntimeHost2_Start(This)\t\\\n    ( (This)->lpVtbl -> Start(This) ) \n\n#define ICLRRuntimeHost2_Stop(This)\t\\\n    ( (This)->lpVtbl -> Stop(This) ) \n\n#define ICLRRuntimeHost2_SetHostControl(This,pHostControl)\t\\\n    ( (This)->lpVtbl -> SetHostControl(This,pHostControl) ) \n\n#define ICLRRuntimeHost2_GetCLRControl(This,pCLRControl)\t\\\n    ( (This)->lpVtbl -> GetCLRControl(This,pCLRControl) ) \n\n#define ICLRRuntimeHost2_UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone)\t\\\n    ( (This)->lpVtbl -> UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone) ) \n\n#define ICLRRuntimeHost2_ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie)\t\\\n    ( (This)->lpVtbl -> ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie) ) \n\n#define ICLRRuntimeHost2_GetCurrentAppDomainId(This,pdwAppDomainId)\t\\\n    ( (This)->lpVtbl -> GetCurrentAppDomainId(This,pdwAppDomainId) ) \n\n#define ICLRRuntimeHost2_ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue) ) \n\n#define ICLRRuntimeHost2_ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue) ) \n\n\n#define ICLRRuntimeHost2_CreateAppDomainWithManager(This,wszFriendlyName,dwFlags,wszAppDomainManagerAssemblyName,wszAppDomainManagerTypeName,nProperties,pPropertyNames,pPropertyValues,pAppDomainID)\t\\\n    ( (This)->lpVtbl -> CreateAppDomainWithManager(This,wszFriendlyName,dwFlags,wszAppDomainManagerAssemblyName,wszAppDomainManagerTypeName,nProperties,pPropertyNames,pPropertyValues,pAppDomainID) ) \n\n#define ICLRRuntimeHost2_CreateDelegate(This,appDomainID,wszAssemblyName,wszClassName,wszMethodName,fnPtr)\t\\\n    ( (This)->lpVtbl -> CreateDelegate(This,appDomainID,wszAssemblyName,wszClassName,wszMethodName,fnPtr) ) \n\n#define ICLRRuntimeHost2_Authenticate(This,authKey)\t\\\n    ( (This)->lpVtbl -> Authenticate(This,authKey) ) \n\n#define ICLRRuntimeHost2_RegisterMacEHPort(This)\t\\\n    ( (This)->lpVtbl -> RegisterMacEHPort(This) ) \n\n#define ICLRRuntimeHost2_SetStartupFlags(This,dwFlags)\t\\\n    ( (This)->lpVtbl -> SetStartupFlags(This,dwFlags) ) \n\n#define ICLRRuntimeHost2_DllGetActivationFactory(This,appDomainID,wszTypeName,factory)\t\\\n    ( (This)->lpVtbl -> DllGetActivationFactory(This,appDomainID,wszTypeName,factory) ) \n\n#define ICLRRuntimeHost2_ExecuteAssembly(This,dwAppDomainId,pwzAssemblyPath,argc,argv,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteAssembly(This,dwAppDomainId,pwzAssemblyPath,argc,argv,pReturnValue) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRRuntimeHost2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ICLRRuntimeHost4_INTERFACE_DEFINED__\n#define __ICLRRuntimeHost4_INTERFACE_DEFINED__\n\n/* interface ICLRRuntimeHost4 */\n/* [local][unique][helpstring][version][uuid][object] */ \n\n\nEXTERN_C const IID IID_ICLRRuntimeHost4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"64F6D366-D7C2-4F1F-B4B2-E8160CAC43AF\")\n    ICLRRuntimeHost4 : public ICLRRuntimeHost2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE UnloadAppDomain2( \n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ BOOL fWaitUntilDone,\n            /* [out] */ int *pLatchedExitCode) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICLRRuntimeHost4Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICLRRuntimeHost4 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICLRRuntimeHost4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Start )( \n            ICLRRuntimeHost4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Stop )( \n            ICLRRuntimeHost4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetHostControl )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ IHostControl *pHostControl);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCLRControl )( \n            ICLRRuntimeHost4 * This,\n            /* [out] */ ICLRControl **pCLRControl);\n        \n        HRESULT ( STDMETHODCALLTYPE *UnloadAppDomain )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ BOOL fWaitUntilDone);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteInAppDomain )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ FExecuteInAppDomainCallback pCallback,\n            /* [in] */ void *cookie);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCurrentAppDomainId )( \n            ICLRRuntimeHost4 * This,\n            /* [out] */ DWORD *pdwAppDomainId);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteApplication )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ LPCWSTR pwzAppFullName,\n            /* [in] */ DWORD dwManifestPaths,\n            /* [in] */ LPCWSTR *ppwzManifestPaths,\n            /* [in] */ DWORD dwActivationData,\n            /* [in] */ LPCWSTR *ppwzActivationData,\n            /* [out] */ int *pReturnValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteInDefaultAppDomain )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ LPCWSTR pwzAssemblyPath,\n            /* [in] */ LPCWSTR pwzTypeName,\n            /* [in] */ LPCWSTR pwzMethodName,\n            /* [in] */ LPCWSTR pwzArgument,\n            /* [out] */ DWORD *pReturnValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *CreateAppDomainWithManager )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ LPCWSTR wszFriendlyName,\n            /* [in] */ DWORD dwFlags,\n            /* [in] */ LPCWSTR wszAppDomainManagerAssemblyName,\n            /* [in] */ LPCWSTR wszAppDomainManagerTypeName,\n            /* [in] */ int nProperties,\n            /* [in] */ LPCWSTR *pPropertyNames,\n            /* [in] */ LPCWSTR *pPropertyValues,\n            /* [out] */ DWORD *pAppDomainID);\n        \n        HRESULT ( STDMETHODCALLTYPE *CreateDelegate )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ DWORD appDomainID,\n            /* [in] */ LPCWSTR wszAssemblyName,\n            /* [in] */ LPCWSTR wszClassName,\n            /* [in] */ LPCWSTR wszMethodName,\n            /* [out] */ INT_PTR *fnPtr);\n        \n        HRESULT ( STDMETHODCALLTYPE *Authenticate )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ ULONGLONG authKey);\n        \n        HRESULT ( STDMETHODCALLTYPE *RegisterMacEHPort )( \n            ICLRRuntimeHost4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetStartupFlags )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ STARTUP_FLAGS dwFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *DllGetActivationFactory )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ DWORD appDomainID,\n            /* [in] */ LPCWSTR wszTypeName,\n            /* [out] */ IActivationFactory **factory);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExecuteAssembly )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ LPCWSTR pwzAssemblyPath,\n            /* [in] */ int argc,\n            /* [in] */ LPCWSTR *argv,\n            /* [out] */ DWORD *pReturnValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *UnloadAppDomain2 )( \n            ICLRRuntimeHost4 * This,\n            /* [in] */ DWORD dwAppDomainId,\n            /* [in] */ BOOL fWaitUntilDone,\n            /* [out] */ int *pLatchedExitCode);\n        \n        END_INTERFACE\n    } ICLRRuntimeHost4Vtbl;\n\n    interface ICLRRuntimeHost4\n    {\n        CONST_VTBL struct ICLRRuntimeHost4Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICLRRuntimeHost4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICLRRuntimeHost4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICLRRuntimeHost4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICLRRuntimeHost4_Start(This)\t\\\n    ( (This)->lpVtbl -> Start(This) ) \n\n#define ICLRRuntimeHost4_Stop(This)\t\\\n    ( (This)->lpVtbl -> Stop(This) ) \n\n#define ICLRRuntimeHost4_SetHostControl(This,pHostControl)\t\\\n    ( (This)->lpVtbl -> SetHostControl(This,pHostControl) ) \n\n#define ICLRRuntimeHost4_GetCLRControl(This,pCLRControl)\t\\\n    ( (This)->lpVtbl -> GetCLRControl(This,pCLRControl) ) \n\n#define ICLRRuntimeHost4_UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone)\t\\\n    ( (This)->lpVtbl -> UnloadAppDomain(This,dwAppDomainId,fWaitUntilDone) ) \n\n#define ICLRRuntimeHost4_ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie)\t\\\n    ( (This)->lpVtbl -> ExecuteInAppDomain(This,dwAppDomainId,pCallback,cookie) ) \n\n#define ICLRRuntimeHost4_GetCurrentAppDomainId(This,pdwAppDomainId)\t\\\n    ( (This)->lpVtbl -> GetCurrentAppDomainId(This,pdwAppDomainId) ) \n\n#define ICLRRuntimeHost4_ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteApplication(This,pwzAppFullName,dwManifestPaths,ppwzManifestPaths,dwActivationData,ppwzActivationData,pReturnValue) ) \n\n#define ICLRRuntimeHost4_ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteInDefaultAppDomain(This,pwzAssemblyPath,pwzTypeName,pwzMethodName,pwzArgument,pReturnValue) ) \n\n\n#define ICLRRuntimeHost4_CreateAppDomainWithManager(This,wszFriendlyName,dwFlags,wszAppDomainManagerAssemblyName,wszAppDomainManagerTypeName,nProperties,pPropertyNames,pPropertyValues,pAppDomainID)\t\\\n    ( (This)->lpVtbl -> CreateAppDomainWithManager(This,wszFriendlyName,dwFlags,wszAppDomainManagerAssemblyName,wszAppDomainManagerTypeName,nProperties,pPropertyNames,pPropertyValues,pAppDomainID) ) \n\n#define ICLRRuntimeHost4_CreateDelegate(This,appDomainID,wszAssemblyName,wszClassName,wszMethodName,fnPtr)\t\\\n    ( (This)->lpVtbl -> CreateDelegate(This,appDomainID,wszAssemblyName,wszClassName,wszMethodName,fnPtr) ) \n\n#define ICLRRuntimeHost4_Authenticate(This,authKey)\t\\\n    ( (This)->lpVtbl -> Authenticate(This,authKey) ) \n\n#define ICLRRuntimeHost4_RegisterMacEHPort(This)\t\\\n    ( (This)->lpVtbl -> RegisterMacEHPort(This) ) \n\n#define ICLRRuntimeHost4_SetStartupFlags(This,dwFlags)\t\\\n    ( (This)->lpVtbl -> SetStartupFlags(This,dwFlags) ) \n\n#define ICLRRuntimeHost4_DllGetActivationFactory(This,appDomainID,wszTypeName,factory)\t\\\n    ( (This)->lpVtbl -> DllGetActivationFactory(This,appDomainID,wszTypeName,factory) ) \n\n#define ICLRRuntimeHost4_ExecuteAssembly(This,dwAppDomainId,pwzAssemblyPath,argc,argv,pReturnValue)\t\\\n    ( (This)->lpVtbl -> ExecuteAssembly(This,dwAppDomainId,pwzAssemblyPath,argc,argv,pReturnValue) ) \n\n\n#define ICLRRuntimeHost4_UnloadAppDomain2(This,dwAppDomainId,fWaitUntilDone,pLatchedExitCode)\t\\\n    ( (This)->lpVtbl -> UnloadAppDomain2(This,dwAppDomainId,fWaitUntilDone,pLatchedExitCode) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICLRRuntimeHost4_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_mscoree_0000_0003 */\n/* [local] */ \n\n\nextern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0003_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_mscoree_0000_0003_v0_0_s_ifspec;\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/sospriv.h",
    "content": "\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.01.0622 */\n/* at Mon Jan 18 19:14:07 2038\n */\n/* Compiler settings for C:/git/runtime/src/coreclr/inc/sospriv.idl:\n    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622\n    protocol : dce , ms_ext, c_ext, robust\n    error checks: allocation ref bounds_check enum stub_data\n    VC __declspec() decoration level:\n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\n         DECLSPEC_UUID(), MIDL_INTERFACE()\n*/\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif /* __RPCNDR_H_VERSION__ */\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __sospriv_h__\n#define __sospriv_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */\n\n#ifndef __ISOSEnum_FWD_DEFINED__\n#define __ISOSEnum_FWD_DEFINED__\ntypedef interface ISOSEnum ISOSEnum;\n\n#endif  /* __ISOSEnum_FWD_DEFINED__ */\n\n\n#ifndef __ISOSHandleEnum_FWD_DEFINED__\n#define __ISOSHandleEnum_FWD_DEFINED__\ntypedef interface ISOSHandleEnum ISOSHandleEnum;\n\n#endif  /* __ISOSHandleEnum_FWD_DEFINED__ */\n\n\n#ifndef __ISOSStackRefErrorEnum_FWD_DEFINED__\n#define __ISOSStackRefErrorEnum_FWD_DEFINED__\ntypedef interface ISOSStackRefErrorEnum ISOSStackRefErrorEnum;\n\n#endif  /* __ISOSStackRefErrorEnum_FWD_DEFINED__ */\n\n\n#ifndef __ISOSStackRefEnum_FWD_DEFINED__\n#define __ISOSStackRefEnum_FWD_DEFINED__\ntypedef interface ISOSStackRefEnum ISOSStackRefEnum;\n\n#endif  /* __ISOSStackRefEnum_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface_FWD_DEFINED__\n#define __ISOSDacInterface_FWD_DEFINED__\ntypedef interface ISOSDacInterface ISOSDacInterface;\n\n#endif  /* __ISOSDacInterface_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface2_FWD_DEFINED__\n#define __ISOSDacInterface2_FWD_DEFINED__\ntypedef interface ISOSDacInterface2 ISOSDacInterface2;\n\n#endif  /* __ISOSDacInterface2_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface3_FWD_DEFINED__\n#define __ISOSDacInterface3_FWD_DEFINED__\ntypedef interface ISOSDacInterface3 ISOSDacInterface3;\n\n#endif  /* __ISOSDacInterface3_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface4_FWD_DEFINED__\n#define __ISOSDacInterface4_FWD_DEFINED__\ntypedef interface ISOSDacInterface4 ISOSDacInterface4;\n\n#endif  /* __ISOSDacInterface4_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface5_FWD_DEFINED__\n#define __ISOSDacInterface5_FWD_DEFINED__\ntypedef interface ISOSDacInterface5 ISOSDacInterface5;\n\n#endif  /* __ISOSDacInterface5_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface6_FWD_DEFINED__\n#define __ISOSDacInterface6_FWD_DEFINED__\ntypedef interface ISOSDacInterface6 ISOSDacInterface6;\n\n#endif  /* __ISOSDacInterface6_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface7_FWD_DEFINED__\n#define __ISOSDacInterface7_FWD_DEFINED__\ntypedef interface ISOSDacInterface7 ISOSDacInterface7;\n\n#endif  /* __ISOSDacInterface7_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface8_FWD_DEFINED__\n#define __ISOSDacInterface8_FWD_DEFINED__\ntypedef interface ISOSDacInterface8 ISOSDacInterface8;\n\n#endif  /* __ISOSDacInterface8_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface9_FWD_DEFINED__\n#define __ISOSDacInterface9_FWD_DEFINED__\ntypedef interface ISOSDacInterface9 ISOSDacInterface9;\n\n#endif  /* __ISOSDacInterface9_FWD_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface10_FWD_DEFINED__\n#define __ISOSDacInterface10_FWD_DEFINED__\ntypedef interface ISOSDacInterface10 ISOSDacInterface10;\n\n#endif  /* __ISOSDacInterface10_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"unknwn.h\"\n#include \"xclrdata.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif\n\n\n/* interface __MIDL_itf_sospriv_0000_0000 */\n/* [local] */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#if 0\ntypedef ULONG64 CLRDATA_ADDRESS;\n\ntypedef int CONTEXT;\n\ntypedef int T_CONTEXT;\n\ntypedef int mdToken;\n\ntypedef unsigned int size_t;\n\ntypedef int ModuleMapType;\n\ntypedef int VCSHeapType;\n\n#endif\ntypedef enum { TYPEDEFTOMETHODTABLE, TYPEREFTOMETHODTABLE } ModuleMapType;\ntypedef enum {IndcellHeap, LookupHeap, ResolveHeap, DispatchHeap, CacheEntryHeap} VCSHeapType;\ntypedef void ( *MODULEMAPTRAVERSE )(\n    UINT index,\n    CLRDATA_ADDRESS methodTable,\n    LPVOID token);\n\ntypedef void ( *VISITHEAP )(\n    CLRDATA_ADDRESS blockData,\n    size_t blockSize,\n    BOOL blockIsCurrentBlock);\n\ntypedef BOOL ( *VISITRCWFORCLEANUP )(\n    CLRDATA_ADDRESS RCW,\n    CLRDATA_ADDRESS Context,\n    CLRDATA_ADDRESS Thread,\n    BOOL bIsFreeThreaded,\n    LPVOID token);\n\ntypedef BOOL ( *DUMPEHINFO )(\n    UINT clauseIndex,\n    UINT totalClauses,\n    struct DACEHInfo *pEHInfo,\n    LPVOID token);\n\n#ifndef _SOS_HandleData\n#define _SOS_HandleData\ntypedef struct _SOSHandleData\n    {\n    CLRDATA_ADDRESS AppDomain;\n    CLRDATA_ADDRESS Handle;\n    CLRDATA_ADDRESS Secondary;\n    unsigned int Type;\n    BOOL StrongReference;\n    unsigned int RefCount;\n    unsigned int JupiterRefCount;\n    BOOL IsPegged;\n    }   SOSHandleData;\n\n#endif //HandleData\n\n\nextern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0000_v0_0_s_ifspec;\n\n#ifndef __ISOSEnum_INTERFACE_DEFINED__\n#define __ISOSEnum_INTERFACE_DEFINED__\n\n/* interface ISOSEnum */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"286CA186-E763-4F61-9760-487D43AE4341\")\n    ISOSEnum : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Skip(\n            /* [in] */ unsigned int count) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCount(\n            /* [out] */ unsigned int *pCount) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ISOSEnum * This,\n            /* [in] */ unsigned int count);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ISOSEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ISOSEnum * This,\n            /* [out] */ unsigned int *pCount);\n\n        END_INTERFACE\n    } ISOSEnumVtbl;\n\n    interface ISOSEnum\n    {\n        CONST_VTBL struct ISOSEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSEnum_QueryInterface(This,riid,ppvObject)    \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSEnum_AddRef(This)   \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSEnum_Release(This)  \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSEnum_Skip(This,count)   \\\n    ( (This)->lpVtbl -> Skip(This,count) )\n\n#define ISOSEnum_Reset(This)    \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ISOSEnum_GetCount(This,pCount)  \\\n    ( (This)->lpVtbl -> GetCount(This,pCount) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSHandleEnum_INTERFACE_DEFINED__\n#define __ISOSHandleEnum_INTERFACE_DEFINED__\n\n/* interface ISOSHandleEnum */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSHandleEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"3E269830-4A2B-4301-8EE2-D6805B29B2FA\")\n    ISOSHandleEnum : public ISOSEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ unsigned int count,\n            /* [length_is][size_is][out] */ SOSHandleData handles[  ],\n            /* [out] */ unsigned int *pNeeded) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSHandleEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSHandleEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSHandleEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSHandleEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ISOSHandleEnum * This,\n            /* [in] */ unsigned int count);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ISOSHandleEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ISOSHandleEnum * This,\n            /* [out] */ unsigned int *pCount);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ISOSHandleEnum * This,\n            /* [in] */ unsigned int count,\n            /* [length_is][size_is][out] */ SOSHandleData handles[  ],\n            /* [out] */ unsigned int *pNeeded);\n\n        END_INTERFACE\n    } ISOSHandleEnumVtbl;\n\n    interface ISOSHandleEnum\n    {\n        CONST_VTBL struct ISOSHandleEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSHandleEnum_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSHandleEnum_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSHandleEnum_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSHandleEnum_Skip(This,count) \\\n    ( (This)->lpVtbl -> Skip(This,count) )\n\n#define ISOSHandleEnum_Reset(This)  \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ISOSHandleEnum_GetCount(This,pCount)    \\\n    ( (This)->lpVtbl -> GetCount(This,pCount) )\n\n\n#define ISOSHandleEnum_Next(This,count,handles,pNeeded) \\\n    ( (This)->lpVtbl -> Next(This,count,handles,pNeeded) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSHandleEnum_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_sospriv_0000_0002 */\n/* [local] */\n\n#ifndef _SOS_StackReference_\n#define _SOS_StackReference_\ntypedef\nenum SOSStackSourceType\n    {\n        SOS_StackSourceIP   = 0,\n        SOS_StackSourceFrame    = ( SOS_StackSourceIP + 1 )\n    }   SOSStackSourceType;\n\ntypedef\nenum SOSRefFlags\n    {\n        SOSRefInterior  = 1,\n        SOSRefPinned    = 2\n    }   SOSRefFlags;\n\ntypedef struct _SOS_StackRefData\n    {\n    BOOL HasRegisterInformation;\n    int Register;\n    int Offset;\n    CLRDATA_ADDRESS Address;\n    CLRDATA_ADDRESS Object;\n    unsigned int Flags;\n    SOSStackSourceType SourceType;\n    CLRDATA_ADDRESS Source;\n    CLRDATA_ADDRESS StackPointer;\n    }   SOSStackRefData;\n\ntypedef struct _SOS_StackRefError\n    {\n    SOSStackSourceType SourceType;\n    CLRDATA_ADDRESS Source;\n    CLRDATA_ADDRESS StackPointer;\n    }   SOSStackRefError;\n\n#endif // _SOS_StackReference_\n\n\nextern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0002_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0002_v0_0_s_ifspec;\n\n#ifndef __ISOSStackRefErrorEnum_INTERFACE_DEFINED__\n#define __ISOSStackRefErrorEnum_INTERFACE_DEFINED__\n\n/* interface ISOSStackRefErrorEnum */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSStackRefErrorEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"774F4E1B-FB7B-491B-976D-A8130FE355E9\")\n    ISOSStackRefErrorEnum : public ISOSEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ unsigned int count,\n            /* [length_is][size_is][out] */ SOSStackRefError ref[  ],\n            /* [out] */ unsigned int *pFetched) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSStackRefErrorEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSStackRefErrorEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSStackRefErrorEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSStackRefErrorEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ISOSStackRefErrorEnum * This,\n            /* [in] */ unsigned int count);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ISOSStackRefErrorEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ISOSStackRefErrorEnum * This,\n            /* [out] */ unsigned int *pCount);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ISOSStackRefErrorEnum * This,\n            /* [in] */ unsigned int count,\n            /* [length_is][size_is][out] */ SOSStackRefError ref[  ],\n            /* [out] */ unsigned int *pFetched);\n\n        END_INTERFACE\n    } ISOSStackRefErrorEnumVtbl;\n\n    interface ISOSStackRefErrorEnum\n    {\n        CONST_VTBL struct ISOSStackRefErrorEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSStackRefErrorEnum_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSStackRefErrorEnum_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSStackRefErrorEnum_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSStackRefErrorEnum_Skip(This,count)  \\\n    ( (This)->lpVtbl -> Skip(This,count) )\n\n#define ISOSStackRefErrorEnum_Reset(This)   \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ISOSStackRefErrorEnum_GetCount(This,pCount) \\\n    ( (This)->lpVtbl -> GetCount(This,pCount) )\n\n\n#define ISOSStackRefErrorEnum_Next(This,count,ref,pFetched) \\\n    ( (This)->lpVtbl -> Next(This,count,ref,pFetched) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSStackRefErrorEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSStackRefEnum_INTERFACE_DEFINED__\n#define __ISOSStackRefEnum_INTERFACE_DEFINED__\n\n/* interface ISOSStackRefEnum */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSStackRefEnum;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"8FA642BD-9F10-4799-9AA3-512AE78C77EE\")\n    ISOSStackRefEnum : public ISOSEnum\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Next(\n            /* [in] */ unsigned int count,\n            /* [length_is][size_is][out] */ SOSStackRefData ref[  ],\n            /* [out] */ unsigned int *pFetched) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE EnumerateErrors(\n            /* [out] */ ISOSStackRefErrorEnum **ppEnum) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSStackRefEnumVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSStackRefEnum * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSStackRefEnum * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSStackRefEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *Skip )(\n            ISOSStackRefEnum * This,\n            /* [in] */ unsigned int count);\n\n        HRESULT ( STDMETHODCALLTYPE *Reset )(\n            ISOSStackRefEnum * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCount )(\n            ISOSStackRefEnum * This,\n            /* [out] */ unsigned int *pCount);\n\n        HRESULT ( STDMETHODCALLTYPE *Next )(\n            ISOSStackRefEnum * This,\n            /* [in] */ unsigned int count,\n            /* [length_is][size_is][out] */ SOSStackRefData ref[  ],\n            /* [out] */ unsigned int *pFetched);\n\n        HRESULT ( STDMETHODCALLTYPE *EnumerateErrors )(\n            ISOSStackRefEnum * This,\n            /* [out] */ ISOSStackRefErrorEnum **ppEnum);\n\n        END_INTERFACE\n    } ISOSStackRefEnumVtbl;\n\n    interface ISOSStackRefEnum\n    {\n        CONST_VTBL struct ISOSStackRefEnumVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSStackRefEnum_QueryInterface(This,riid,ppvObject)    \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSStackRefEnum_AddRef(This)   \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSStackRefEnum_Release(This)  \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSStackRefEnum_Skip(This,count)   \\\n    ( (This)->lpVtbl -> Skip(This,count) )\n\n#define ISOSStackRefEnum_Reset(This)    \\\n    ( (This)->lpVtbl -> Reset(This) )\n\n#define ISOSStackRefEnum_GetCount(This,pCount)  \\\n    ( (This)->lpVtbl -> GetCount(This,pCount) )\n\n\n#define ISOSStackRefEnum_Next(This,count,ref,pFetched)  \\\n    ( (This)->lpVtbl -> Next(This,count,ref,pFetched) )\n\n#define ISOSStackRefEnum_EnumerateErrors(This,ppEnum)   \\\n    ( (This)->lpVtbl -> EnumerateErrors(This,ppEnum) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSStackRefEnum_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface_INTERFACE_DEFINED__\n#define __ISOSDacInterface_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"436f00f2-b42a-4b9f-870c-e73db66ae930\")\n    ISOSDacInterface : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetThreadStoreData(\n            struct DacpThreadStoreData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainStoreData(\n            struct DacpAppDomainStoreData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainList(\n            unsigned int count,\n            CLRDATA_ADDRESS values[  ],\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainData(\n            CLRDATA_ADDRESS addr,\n            struct DacpAppDomainData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainName(\n            CLRDATA_ADDRESS addr,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDomainFromContext(\n            CLRDATA_ADDRESS context,\n            CLRDATA_ADDRESS *domain) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyList(\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            CLRDATA_ADDRESS values[  ],\n            int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyData(\n            CLRDATA_ADDRESS baseDomainPtr,\n            CLRDATA_ADDRESS assembly,\n            struct DacpAssemblyData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyName(\n            CLRDATA_ADDRESS assembly,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetModule(\n            CLRDATA_ADDRESS addr,\n            IXCLRDataModule **mod) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetModuleData(\n            CLRDATA_ADDRESS moduleAddr,\n            struct DacpModuleData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE TraverseModuleMap(\n            ModuleMapType mmt,\n            CLRDATA_ADDRESS moduleAddr,\n            MODULEMAPTRAVERSE pCallback,\n            LPVOID token) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyModuleList(\n            CLRDATA_ADDRESS assembly,\n            unsigned int count,\n            CLRDATA_ADDRESS modules[  ],\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetILForModule(\n            CLRDATA_ADDRESS moduleAddr,\n            DWORD rva,\n            CLRDATA_ADDRESS *il) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadData(\n            CLRDATA_ADDRESS thread,\n            struct DacpThreadData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadFromThinlockID(\n            UINT thinLockId,\n            CLRDATA_ADDRESS *pThread) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStackLimits(\n            CLRDATA_ADDRESS threadPtr,\n            CLRDATA_ADDRESS *lower,\n            CLRDATA_ADDRESS *upper,\n            CLRDATA_ADDRESS *fp) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodDescData(\n            CLRDATA_ADDRESS methodDesc,\n            CLRDATA_ADDRESS ip,\n            struct DacpMethodDescData *data,\n            ULONG cRevertedRejitVersions,\n            struct DacpReJitData *rgRevertedRejitData,\n            ULONG *pcNeededRevertedRejitData) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromIP(\n            CLRDATA_ADDRESS ip,\n            CLRDATA_ADDRESS *ppMD) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodDescName(\n            CLRDATA_ADDRESS methodDesc,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodDescPtrFromFrame(\n            CLRDATA_ADDRESS frameAddr,\n            CLRDATA_ADDRESS *ppMD) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodDescFromToken(\n            CLRDATA_ADDRESS moduleAddr,\n            mdToken token,\n            CLRDATA_ADDRESS *methodDesc) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodDescTransparencyData(\n            CLRDATA_ADDRESS methodDesc,\n            struct DacpMethodDescTransparencyData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeHeaderData(\n            CLRDATA_ADDRESS ip,\n            struct DacpCodeHeaderData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetJitManagerList(\n            unsigned int count,\n            struct DacpJitManagerInfo *managers,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetJitHelperFunctionName(\n            CLRDATA_ADDRESS ip,\n            unsigned int count,\n            char *name,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetJumpThunkTarget(\n            T_CONTEXT *ctx,\n            CLRDATA_ADDRESS *targetIP,\n            CLRDATA_ADDRESS *targetMD) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadpoolData(\n            struct DacpThreadpoolData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetWorkRequestData(\n            CLRDATA_ADDRESS addrWorkRequest,\n            struct DacpWorkRequestData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHillClimbingLogEntry(\n            CLRDATA_ADDRESS addr,\n            struct DacpHillClimbingLogEntry *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectData(\n            CLRDATA_ADDRESS objAddr,\n            struct DacpObjectData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectStringData(\n            CLRDATA_ADDRESS obj,\n            unsigned int count,\n            WCHAR *stringData,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetObjectClassName(\n            CLRDATA_ADDRESS obj,\n            unsigned int count,\n            WCHAR *className,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodTableName(\n            CLRDATA_ADDRESS mt,\n            unsigned int count,\n            WCHAR *mtName,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodTableData(\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodTableSlot(\n            CLRDATA_ADDRESS mt,\n            unsigned int slot,\n            CLRDATA_ADDRESS *value) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodTableFieldData(\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableFieldData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodTableTransparencyData(\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableTransparencyData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodTableForEEClass(\n            CLRDATA_ADDRESS eeClass,\n            CLRDATA_ADDRESS *value) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFieldDescData(\n            CLRDATA_ADDRESS fieldDesc,\n            struct DacpFieldDescData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFrameName(\n            CLRDATA_ADDRESS vtable,\n            unsigned int count,\n            WCHAR *frameName,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetPEFileBase(\n            CLRDATA_ADDRESS addr,\n            CLRDATA_ADDRESS *base) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetPEFileName(\n            CLRDATA_ADDRESS addr,\n            unsigned int count,\n            WCHAR *fileName,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGCHeapData(\n            struct DacpGcHeapData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGCHeapList(\n            unsigned int count,\n            CLRDATA_ADDRESS heaps[  ],\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGCHeapDetails(\n            CLRDATA_ADDRESS heap,\n            struct DacpGcHeapDetails *details) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGCHeapStaticData(\n            struct DacpGcHeapDetails *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHeapSegmentData(\n            CLRDATA_ADDRESS seg,\n            struct DacpHeapSegmentData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetOOMData(\n            CLRDATA_ADDRESS oomAddr,\n            struct DacpOomData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetOOMStaticData(\n            struct DacpOomData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHeapAnalyzeData(\n            CLRDATA_ADDRESS addr,\n            struct DacpGcHeapAnalyzeData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHeapAnalyzeStaticData(\n            struct DacpGcHeapAnalyzeData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDomainLocalModuleData(\n            CLRDATA_ADDRESS addr,\n            struct DacpDomainLocalModuleData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDomainLocalModuleDataFromAppDomain(\n            CLRDATA_ADDRESS appDomainAddr,\n            int moduleID,\n            struct DacpDomainLocalModuleData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDomainLocalModuleDataFromModule(\n            CLRDATA_ADDRESS moduleAddr,\n            struct DacpDomainLocalModuleData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadLocalModuleData(\n            CLRDATA_ADDRESS thread,\n            unsigned int index,\n            struct DacpThreadLocalModuleData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSyncBlockData(\n            unsigned int number,\n            struct DacpSyncBlockData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetSyncBlockCleanupData(\n            CLRDATA_ADDRESS addr,\n            struct DacpSyncBlockCleanupData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHandleEnum(\n            ISOSHandleEnum **ppHandleEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHandleEnumForTypes(\n            unsigned int types[  ],\n            unsigned int count,\n            ISOSHandleEnum **ppHandleEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHandleEnumForGC(\n            unsigned int gen,\n            ISOSHandleEnum **ppHandleEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE TraverseEHInfo(\n            CLRDATA_ADDRESS ip,\n            DUMPEHINFO pCallback,\n            LPVOID token) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetNestedExceptionData(\n            CLRDATA_ADDRESS exception,\n            CLRDATA_ADDRESS *exceptionObject,\n            CLRDATA_ADDRESS *nextNestedException) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStressLogAddress(\n            CLRDATA_ADDRESS *stressLog) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE TraverseLoaderHeap(\n            CLRDATA_ADDRESS loaderHeapAddr,\n            VISITHEAP pCallback) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCodeHeapList(\n            CLRDATA_ADDRESS jitManager,\n            unsigned int count,\n            struct DacpJitCodeHeapInfo *codeHeaps,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE TraverseVirtCallStubHeap(\n            CLRDATA_ADDRESS pAppDomain,\n            VCSHeapType heaptype,\n            VISITHEAP pCallback) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetUsefulGlobals(\n            struct DacpUsefulGlobalsData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetClrWatsonBuckets(\n            CLRDATA_ADDRESS thread,\n            void *pGenericModeBlock) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetTLSIndex(\n            ULONG *pIndex) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetDacModuleHandle(\n            HMODULE *phModule) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRCWData(\n            CLRDATA_ADDRESS addr,\n            struct DacpRCWData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRCWInterfaces(\n            CLRDATA_ADDRESS rcw,\n            unsigned int count,\n            struct DacpCOMInterfacePointerData *interfaces,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCCWData(\n            CLRDATA_ADDRESS ccw,\n            struct DacpCCWData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetCCWInterfaces(\n            CLRDATA_ADDRESS ccw,\n            unsigned int count,\n            struct DacpCOMInterfacePointerData *interfaces,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE TraverseRCWCleanupList(\n            CLRDATA_ADDRESS cleanupListPtr,\n            VISITRCWFORCLEANUP pCallback,\n            LPVOID token) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetStackReferences(\n            /* [in] */ DWORD osThreadID,\n            /* [out] */ ISOSStackRefEnum **ppEnum) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetRegisterName(\n            /* [in] */ int regName,\n            /* [in] */ unsigned int count,\n            /* [out] */ WCHAR *buffer,\n            /* [out] */ unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetThreadAllocData(\n            CLRDATA_ADDRESS thread,\n            struct DacpAllocData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetHeapAllocData(\n            unsigned int count,\n            struct DacpGenerationAllocData *data,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyList(\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            CLRDATA_ADDRESS values[  ],\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetPrivateBinPaths(\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            WCHAR *paths,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyLocation(\n            CLRDATA_ADDRESS assembly,\n            int count,\n            WCHAR *location,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainConfigFile(\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            WCHAR *configFile,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetApplicationBase(\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            WCHAR *base,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyData(\n            CLRDATA_ADDRESS assembly,\n            unsigned int *pContext,\n            HRESULT *pResult) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyLocation(\n            CLRDATA_ADDRESS assesmbly,\n            unsigned int count,\n            WCHAR *location,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFailedAssemblyDisplayName(\n            CLRDATA_ADDRESS assembly,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterfaceVtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadStoreData )(\n            ISOSDacInterface * This,\n            struct DacpThreadStoreData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainStoreData )(\n            ISOSDacInterface * This,\n            struct DacpAppDomainStoreData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainList )(\n            ISOSDacInterface * This,\n            unsigned int count,\n            CLRDATA_ADDRESS values[  ],\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            struct DacpAppDomainData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDomainFromContext )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS context,\n            CLRDATA_ADDRESS *domain);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyList )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            CLRDATA_ADDRESS values[  ],\n            int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS baseDomainPtr,\n            CLRDATA_ADDRESS assembly,\n            struct DacpAssemblyData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS assembly,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModule )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            IXCLRDataModule **mod);\n\n        HRESULT ( STDMETHODCALLTYPE *GetModuleData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS moduleAddr,\n            struct DacpModuleData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *TraverseModuleMap )(\n            ISOSDacInterface * This,\n            ModuleMapType mmt,\n            CLRDATA_ADDRESS moduleAddr,\n            MODULEMAPTRAVERSE pCallback,\n            LPVOID token);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyModuleList )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS assembly,\n            unsigned int count,\n            CLRDATA_ADDRESS modules[  ],\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetILForModule )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS moduleAddr,\n            DWORD rva,\n            CLRDATA_ADDRESS *il);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS thread,\n            struct DacpThreadData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadFromThinlockID )(\n            ISOSDacInterface * This,\n            UINT thinLockId,\n            CLRDATA_ADDRESS *pThread);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackLimits )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS threadPtr,\n            CLRDATA_ADDRESS *lower,\n            CLRDATA_ADDRESS *upper,\n            CLRDATA_ADDRESS *fp);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodDescData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS methodDesc,\n            CLRDATA_ADDRESS ip,\n            struct DacpMethodDescData *data,\n            ULONG cRevertedRejitVersions,\n            struct DacpReJitData *rgRevertedRejitData,\n            ULONG *pcNeededRevertedRejitData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodDescPtrFromIP )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS ip,\n            CLRDATA_ADDRESS *ppMD);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodDescName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS methodDesc,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodDescPtrFromFrame )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS frameAddr,\n            CLRDATA_ADDRESS *ppMD);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodDescFromToken )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS moduleAddr,\n            mdToken token,\n            CLRDATA_ADDRESS *methodDesc);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodDescTransparencyData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS methodDesc,\n            struct DacpMethodDescTransparencyData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeHeaderData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS ip,\n            struct DacpCodeHeaderData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetJitManagerList )(\n            ISOSDacInterface * This,\n            unsigned int count,\n            struct DacpJitManagerInfo *managers,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetJitHelperFunctionName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS ip,\n            unsigned int count,\n            char *name,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetJumpThunkTarget )(\n            ISOSDacInterface * This,\n            T_CONTEXT *ctx,\n            CLRDATA_ADDRESS *targetIP,\n            CLRDATA_ADDRESS *targetMD);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadpoolData )(\n            ISOSDacInterface * This,\n            struct DacpThreadpoolData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetWorkRequestData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addrWorkRequest,\n            struct DacpWorkRequestData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHillClimbingLogEntry )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            struct DacpHillClimbingLogEntry *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS objAddr,\n            struct DacpObjectData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectStringData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS obj,\n            unsigned int count,\n            WCHAR *stringData,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectClassName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS obj,\n            unsigned int count,\n            WCHAR *className,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodTableName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS mt,\n            unsigned int count,\n            WCHAR *mtName,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodTableData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodTableSlot )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS mt,\n            unsigned int slot,\n            CLRDATA_ADDRESS *value);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodTableFieldData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableFieldData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodTableTransparencyData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableTransparencyData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodTableForEEClass )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS eeClass,\n            CLRDATA_ADDRESS *value);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFieldDescData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS fieldDesc,\n            struct DacpFieldDescData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFrameName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS vtable,\n            unsigned int count,\n            WCHAR *frameName,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPEFileBase )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            CLRDATA_ADDRESS *base);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPEFileName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            unsigned int count,\n            WCHAR *fileName,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCHeapData )(\n            ISOSDacInterface * This,\n            struct DacpGcHeapData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCHeapList )(\n            ISOSDacInterface * This,\n            unsigned int count,\n            CLRDATA_ADDRESS heaps[  ],\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCHeapDetails )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS heap,\n            struct DacpGcHeapDetails *details);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCHeapStaticData )(\n            ISOSDacInterface * This,\n            struct DacpGcHeapDetails *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHeapSegmentData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS seg,\n            struct DacpHeapSegmentData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetOOMData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS oomAddr,\n            struct DacpOomData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetOOMStaticData )(\n            ISOSDacInterface * This,\n            struct DacpOomData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHeapAnalyzeData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            struct DacpGcHeapAnalyzeData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHeapAnalyzeStaticData )(\n            ISOSDacInterface * This,\n            struct DacpGcHeapAnalyzeData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDomainLocalModuleData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            struct DacpDomainLocalModuleData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDomainLocalModuleDataFromAppDomain )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS appDomainAddr,\n            int moduleID,\n            struct DacpDomainLocalModuleData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDomainLocalModuleDataFromModule )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS moduleAddr,\n            struct DacpDomainLocalModuleData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadLocalModuleData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS thread,\n            unsigned int index,\n            struct DacpThreadLocalModuleData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSyncBlockData )(\n            ISOSDacInterface * This,\n            unsigned int number,\n            struct DacpSyncBlockData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetSyncBlockCleanupData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            struct DacpSyncBlockCleanupData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleEnum )(\n            ISOSDacInterface * This,\n            ISOSHandleEnum **ppHandleEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleEnumForTypes )(\n            ISOSDacInterface * This,\n            unsigned int types[  ],\n            unsigned int count,\n            ISOSHandleEnum **ppHandleEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHandleEnumForGC )(\n            ISOSDacInterface * This,\n            unsigned int gen,\n            ISOSHandleEnum **ppHandleEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *TraverseEHInfo )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS ip,\n            DUMPEHINFO pCallback,\n            LPVOID token);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNestedExceptionData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS exception,\n            CLRDATA_ADDRESS *exceptionObject,\n            CLRDATA_ADDRESS *nextNestedException);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStressLogAddress )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS *stressLog);\n\n        HRESULT ( STDMETHODCALLTYPE *TraverseLoaderHeap )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS loaderHeapAddr,\n            VISITHEAP pCallback);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCodeHeapList )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS jitManager,\n            unsigned int count,\n            struct DacpJitCodeHeapInfo *codeHeaps,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *TraverseVirtCallStubHeap )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS pAppDomain,\n            VCSHeapType heaptype,\n            VISITHEAP pCallback);\n\n        HRESULT ( STDMETHODCALLTYPE *GetUsefulGlobals )(\n            ISOSDacInterface * This,\n            struct DacpUsefulGlobalsData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClrWatsonBuckets )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS thread,\n            void *pGenericModeBlock);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTLSIndex )(\n            ISOSDacInterface * This,\n            ULONG *pIndex);\n\n        HRESULT ( STDMETHODCALLTYPE *GetDacModuleHandle )(\n            ISOSDacInterface * This,\n            HMODULE *phModule);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRCWData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS addr,\n            struct DacpRCWData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRCWInterfaces )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS rcw,\n            unsigned int count,\n            struct DacpCOMInterfacePointerData *interfaces,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCCWData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS ccw,\n            struct DacpCCWData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetCCWInterfaces )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS ccw,\n            unsigned int count,\n            struct DacpCOMInterfacePointerData *interfaces,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *TraverseRCWCleanupList )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS cleanupListPtr,\n            VISITRCWFORCLEANUP pCallback,\n            LPVOID token);\n\n        HRESULT ( STDMETHODCALLTYPE *GetStackReferences )(\n            ISOSDacInterface * This,\n            /* [in] */ DWORD osThreadID,\n            /* [out] */ ISOSStackRefEnum **ppEnum);\n\n        HRESULT ( STDMETHODCALLTYPE *GetRegisterName )(\n            ISOSDacInterface * This,\n            /* [in] */ int regName,\n            /* [in] */ unsigned int count,\n            /* [out] */ WCHAR *buffer,\n            /* [out] */ unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetThreadAllocData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS thread,\n            struct DacpAllocData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetHeapAllocData )(\n            ISOSDacInterface * This,\n            unsigned int count,\n            struct DacpGenerationAllocData *data,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFailedAssemblyList )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            CLRDATA_ADDRESS values[  ],\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPrivateBinPaths )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            WCHAR *paths,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyLocation )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS assembly,\n            int count,\n            WCHAR *location,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainConfigFile )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            WCHAR *configFile,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetApplicationBase )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS appDomain,\n            int count,\n            WCHAR *base,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFailedAssemblyData )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS assembly,\n            unsigned int *pContext,\n            HRESULT *pResult);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFailedAssemblyLocation )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS assesmbly,\n            unsigned int count,\n            WCHAR *location,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFailedAssemblyDisplayName )(\n            ISOSDacInterface * This,\n            CLRDATA_ADDRESS assembly,\n            unsigned int count,\n            WCHAR *name,\n            unsigned int *pNeeded);\n\n        END_INTERFACE\n    } ISOSDacInterfaceVtbl;\n\n    interface ISOSDacInterface\n    {\n        CONST_VTBL struct ISOSDacInterfaceVtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface_QueryInterface(This,riid,ppvObject)    \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface_AddRef(This)   \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface_Release(This)  \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface_GetThreadStoreData(This,data)  \\\n    ( (This)->lpVtbl -> GetThreadStoreData(This,data) )\n\n#define ISOSDacInterface_GetAppDomainStoreData(This,data)   \\\n    ( (This)->lpVtbl -> GetAppDomainStoreData(This,data) )\n\n#define ISOSDacInterface_GetAppDomainList(This,count,values,pNeeded)    \\\n    ( (This)->lpVtbl -> GetAppDomainList(This,count,values,pNeeded) )\n\n#define ISOSDacInterface_GetAppDomainData(This,addr,data)   \\\n    ( (This)->lpVtbl -> GetAppDomainData(This,addr,data) )\n\n#define ISOSDacInterface_GetAppDomainName(This,addr,count,name,pNeeded) \\\n    ( (This)->lpVtbl -> GetAppDomainName(This,addr,count,name,pNeeded) )\n\n#define ISOSDacInterface_GetDomainFromContext(This,context,domain)  \\\n    ( (This)->lpVtbl -> GetDomainFromContext(This,context,domain) )\n\n#define ISOSDacInterface_GetAssemblyList(This,appDomain,count,values,pNeeded)   \\\n    ( (This)->lpVtbl -> GetAssemblyList(This,appDomain,count,values,pNeeded) )\n\n#define ISOSDacInterface_GetAssemblyData(This,baseDomainPtr,assembly,data)  \\\n    ( (This)->lpVtbl -> GetAssemblyData(This,baseDomainPtr,assembly,data) )\n\n#define ISOSDacInterface_GetAssemblyName(This,assembly,count,name,pNeeded)  \\\n    ( (This)->lpVtbl -> GetAssemblyName(This,assembly,count,name,pNeeded) )\n\n#define ISOSDacInterface_GetModule(This,addr,mod)   \\\n    ( (This)->lpVtbl -> GetModule(This,addr,mod) )\n\n#define ISOSDacInterface_GetModuleData(This,moduleAddr,data)    \\\n    ( (This)->lpVtbl -> GetModuleData(This,moduleAddr,data) )\n\n#define ISOSDacInterface_TraverseModuleMap(This,mmt,moduleAddr,pCallback,token) \\\n    ( (This)->lpVtbl -> TraverseModuleMap(This,mmt,moduleAddr,pCallback,token) )\n\n#define ISOSDacInterface_GetAssemblyModuleList(This,assembly,count,modules,pNeeded) \\\n    ( (This)->lpVtbl -> GetAssemblyModuleList(This,assembly,count,modules,pNeeded) )\n\n#define ISOSDacInterface_GetILForModule(This,moduleAddr,rva,il) \\\n    ( (This)->lpVtbl -> GetILForModule(This,moduleAddr,rva,il) )\n\n#define ISOSDacInterface_GetThreadData(This,thread,data)    \\\n    ( (This)->lpVtbl -> GetThreadData(This,thread,data) )\n\n#define ISOSDacInterface_GetThreadFromThinlockID(This,thinLockId,pThread)   \\\n    ( (This)->lpVtbl -> GetThreadFromThinlockID(This,thinLockId,pThread) )\n\n#define ISOSDacInterface_GetStackLimits(This,threadPtr,lower,upper,fp)  \\\n    ( (This)->lpVtbl -> GetStackLimits(This,threadPtr,lower,upper,fp) )\n\n#define ISOSDacInterface_GetMethodDescData(This,methodDesc,ip,data,cRevertedRejitVersions,rgRevertedRejitData,pcNeededRevertedRejitData)    \\\n    ( (This)->lpVtbl -> GetMethodDescData(This,methodDesc,ip,data,cRevertedRejitVersions,rgRevertedRejitData,pcNeededRevertedRejitData) )\n\n#define ISOSDacInterface_GetMethodDescPtrFromIP(This,ip,ppMD)   \\\n    ( (This)->lpVtbl -> GetMethodDescPtrFromIP(This,ip,ppMD) )\n\n#define ISOSDacInterface_GetMethodDescName(This,methodDesc,count,name,pNeeded)  \\\n    ( (This)->lpVtbl -> GetMethodDescName(This,methodDesc,count,name,pNeeded) )\n\n#define ISOSDacInterface_GetMethodDescPtrFromFrame(This,frameAddr,ppMD) \\\n    ( (This)->lpVtbl -> GetMethodDescPtrFromFrame(This,frameAddr,ppMD) )\n\n#define ISOSDacInterface_GetMethodDescFromToken(This,moduleAddr,token,methodDesc)   \\\n    ( (This)->lpVtbl -> GetMethodDescFromToken(This,moduleAddr,token,methodDesc) )\n\n#define ISOSDacInterface_GetMethodDescTransparencyData(This,methodDesc,data)    \\\n    ( (This)->lpVtbl -> GetMethodDescTransparencyData(This,methodDesc,data) )\n\n#define ISOSDacInterface_GetCodeHeaderData(This,ip,data)    \\\n    ( (This)->lpVtbl -> GetCodeHeaderData(This,ip,data) )\n\n#define ISOSDacInterface_GetJitManagerList(This,count,managers,pNeeded) \\\n    ( (This)->lpVtbl -> GetJitManagerList(This,count,managers,pNeeded) )\n\n#define ISOSDacInterface_GetJitHelperFunctionName(This,ip,count,name,pNeeded)   \\\n    ( (This)->lpVtbl -> GetJitHelperFunctionName(This,ip,count,name,pNeeded) )\n\n#define ISOSDacInterface_GetJumpThunkTarget(This,ctx,targetIP,targetMD) \\\n    ( (This)->lpVtbl -> GetJumpThunkTarget(This,ctx,targetIP,targetMD) )\n\n#define ISOSDacInterface_GetThreadpoolData(This,data)   \\\n    ( (This)->lpVtbl -> GetThreadpoolData(This,data) )\n\n#define ISOSDacInterface_GetWorkRequestData(This,addrWorkRequest,data)  \\\n    ( (This)->lpVtbl -> GetWorkRequestData(This,addrWorkRequest,data) )\n\n#define ISOSDacInterface_GetHillClimbingLogEntry(This,addr,data)    \\\n    ( (This)->lpVtbl -> GetHillClimbingLogEntry(This,addr,data) )\n\n#define ISOSDacInterface_GetObjectData(This,objAddr,data)   \\\n    ( (This)->lpVtbl -> GetObjectData(This,objAddr,data) )\n\n#define ISOSDacInterface_GetObjectStringData(This,obj,count,stringData,pNeeded) \\\n    ( (This)->lpVtbl -> GetObjectStringData(This,obj,count,stringData,pNeeded) )\n\n#define ISOSDacInterface_GetObjectClassName(This,obj,count,className,pNeeded)   \\\n    ( (This)->lpVtbl -> GetObjectClassName(This,obj,count,className,pNeeded) )\n\n#define ISOSDacInterface_GetMethodTableName(This,mt,count,mtName,pNeeded)   \\\n    ( (This)->lpVtbl -> GetMethodTableName(This,mt,count,mtName,pNeeded) )\n\n#define ISOSDacInterface_GetMethodTableData(This,mt,data)   \\\n    ( (This)->lpVtbl -> GetMethodTableData(This,mt,data) )\n\n#define ISOSDacInterface_GetMethodTableSlot(This,mt,slot,value) \\\n    ( (This)->lpVtbl -> GetMethodTableSlot(This,mt,slot,value) )\n\n#define ISOSDacInterface_GetMethodTableFieldData(This,mt,data)  \\\n    ( (This)->lpVtbl -> GetMethodTableFieldData(This,mt,data) )\n\n#define ISOSDacInterface_GetMethodTableTransparencyData(This,mt,data)   \\\n    ( (This)->lpVtbl -> GetMethodTableTransparencyData(This,mt,data) )\n\n#define ISOSDacInterface_GetMethodTableForEEClass(This,eeClass,value)   \\\n    ( (This)->lpVtbl -> GetMethodTableForEEClass(This,eeClass,value) )\n\n#define ISOSDacInterface_GetFieldDescData(This,fieldDesc,data)  \\\n    ( (This)->lpVtbl -> GetFieldDescData(This,fieldDesc,data) )\n\n#define ISOSDacInterface_GetFrameName(This,vtable,count,frameName,pNeeded)  \\\n    ( (This)->lpVtbl -> GetFrameName(This,vtable,count,frameName,pNeeded) )\n\n#define ISOSDacInterface_GetPEFileBase(This,addr,base)  \\\n    ( (This)->lpVtbl -> GetPEFileBase(This,addr,base) )\n\n#define ISOSDacInterface_GetPEFileName(This,addr,count,fileName,pNeeded)    \\\n    ( (This)->lpVtbl -> GetPEFileName(This,addr,count,fileName,pNeeded) )\n\n#define ISOSDacInterface_GetGCHeapData(This,data)   \\\n    ( (This)->lpVtbl -> GetGCHeapData(This,data) )\n\n#define ISOSDacInterface_GetGCHeapList(This,count,heaps,pNeeded)    \\\n    ( (This)->lpVtbl -> GetGCHeapList(This,count,heaps,pNeeded) )\n\n#define ISOSDacInterface_GetGCHeapDetails(This,heap,details)    \\\n    ( (This)->lpVtbl -> GetGCHeapDetails(This,heap,details) )\n\n#define ISOSDacInterface_GetGCHeapStaticData(This,data) \\\n    ( (This)->lpVtbl -> GetGCHeapStaticData(This,data) )\n\n#define ISOSDacInterface_GetHeapSegmentData(This,seg,data)  \\\n    ( (This)->lpVtbl -> GetHeapSegmentData(This,seg,data) )\n\n#define ISOSDacInterface_GetOOMData(This,oomAddr,data)  \\\n    ( (This)->lpVtbl -> GetOOMData(This,oomAddr,data) )\n\n#define ISOSDacInterface_GetOOMStaticData(This,data)    \\\n    ( (This)->lpVtbl -> GetOOMStaticData(This,data) )\n\n#define ISOSDacInterface_GetHeapAnalyzeData(This,addr,data) \\\n    ( (This)->lpVtbl -> GetHeapAnalyzeData(This,addr,data) )\n\n#define ISOSDacInterface_GetHeapAnalyzeStaticData(This,data)    \\\n    ( (This)->lpVtbl -> GetHeapAnalyzeStaticData(This,data) )\n\n#define ISOSDacInterface_GetDomainLocalModuleData(This,addr,data)   \\\n    ( (This)->lpVtbl -> GetDomainLocalModuleData(This,addr,data) )\n\n#define ISOSDacInterface_GetDomainLocalModuleDataFromAppDomain(This,appDomainAddr,moduleID,data)    \\\n    ( (This)->lpVtbl -> GetDomainLocalModuleDataFromAppDomain(This,appDomainAddr,moduleID,data) )\n\n#define ISOSDacInterface_GetDomainLocalModuleDataFromModule(This,moduleAddr,data)   \\\n    ( (This)->lpVtbl -> GetDomainLocalModuleDataFromModule(This,moduleAddr,data) )\n\n#define ISOSDacInterface_GetThreadLocalModuleData(This,thread,index,data)   \\\n    ( (This)->lpVtbl -> GetThreadLocalModuleData(This,thread,index,data) )\n\n#define ISOSDacInterface_GetSyncBlockData(This,number,data) \\\n    ( (This)->lpVtbl -> GetSyncBlockData(This,number,data) )\n\n#define ISOSDacInterface_GetSyncBlockCleanupData(This,addr,data)    \\\n    ( (This)->lpVtbl -> GetSyncBlockCleanupData(This,addr,data) )\n\n#define ISOSDacInterface_GetHandleEnum(This,ppHandleEnum)   \\\n    ( (This)->lpVtbl -> GetHandleEnum(This,ppHandleEnum) )\n\n#define ISOSDacInterface_GetHandleEnumForTypes(This,types,count,ppHandleEnum)   \\\n    ( (This)->lpVtbl -> GetHandleEnumForTypes(This,types,count,ppHandleEnum) )\n\n#define ISOSDacInterface_GetHandleEnumForGC(This,gen,ppHandleEnum)  \\\n    ( (This)->lpVtbl -> GetHandleEnumForGC(This,gen,ppHandleEnum) )\n\n#define ISOSDacInterface_TraverseEHInfo(This,ip,pCallback,token)    \\\n    ( (This)->lpVtbl -> TraverseEHInfo(This,ip,pCallback,token) )\n\n#define ISOSDacInterface_GetNestedExceptionData(This,exception,exceptionObject,nextNestedException) \\\n    ( (This)->lpVtbl -> GetNestedExceptionData(This,exception,exceptionObject,nextNestedException) )\n\n#define ISOSDacInterface_GetStressLogAddress(This,stressLog)    \\\n    ( (This)->lpVtbl -> GetStressLogAddress(This,stressLog) )\n\n#define ISOSDacInterface_TraverseLoaderHeap(This,loaderHeapAddr,pCallback)  \\\n    ( (This)->lpVtbl -> TraverseLoaderHeap(This,loaderHeapAddr,pCallback) )\n\n#define ISOSDacInterface_GetCodeHeapList(This,jitManager,count,codeHeaps,pNeeded)   \\\n    ( (This)->lpVtbl -> GetCodeHeapList(This,jitManager,count,codeHeaps,pNeeded) )\n\n#define ISOSDacInterface_TraverseVirtCallStubHeap(This,pAppDomain,heaptype,pCallback)   \\\n    ( (This)->lpVtbl -> TraverseVirtCallStubHeap(This,pAppDomain,heaptype,pCallback) )\n\n#define ISOSDacInterface_GetUsefulGlobals(This,data)    \\\n    ( (This)->lpVtbl -> GetUsefulGlobals(This,data) )\n\n#define ISOSDacInterface_GetClrWatsonBuckets(This,thread,pGenericModeBlock) \\\n    ( (This)->lpVtbl -> GetClrWatsonBuckets(This,thread,pGenericModeBlock) )\n\n#define ISOSDacInterface_GetTLSIndex(This,pIndex)   \\\n    ( (This)->lpVtbl -> GetTLSIndex(This,pIndex) )\n\n#define ISOSDacInterface_GetDacModuleHandle(This,phModule)  \\\n    ( (This)->lpVtbl -> GetDacModuleHandle(This,phModule) )\n\n#define ISOSDacInterface_GetRCWData(This,addr,data) \\\n    ( (This)->lpVtbl -> GetRCWData(This,addr,data) )\n\n#define ISOSDacInterface_GetRCWInterfaces(This,rcw,count,interfaces,pNeeded)    \\\n    ( (This)->lpVtbl -> GetRCWInterfaces(This,rcw,count,interfaces,pNeeded) )\n\n#define ISOSDacInterface_GetCCWData(This,ccw,data)  \\\n    ( (This)->lpVtbl -> GetCCWData(This,ccw,data) )\n\n#define ISOSDacInterface_GetCCWInterfaces(This,ccw,count,interfaces,pNeeded)    \\\n    ( (This)->lpVtbl -> GetCCWInterfaces(This,ccw,count,interfaces,pNeeded) )\n\n#define ISOSDacInterface_TraverseRCWCleanupList(This,cleanupListPtr,pCallback,token)    \\\n    ( (This)->lpVtbl -> TraverseRCWCleanupList(This,cleanupListPtr,pCallback,token) )\n\n#define ISOSDacInterface_GetStackReferences(This,osThreadID,ppEnum) \\\n    ( (This)->lpVtbl -> GetStackReferences(This,osThreadID,ppEnum) )\n\n#define ISOSDacInterface_GetRegisterName(This,regName,count,buffer,pNeeded) \\\n    ( (This)->lpVtbl -> GetRegisterName(This,regName,count,buffer,pNeeded) )\n\n#define ISOSDacInterface_GetThreadAllocData(This,thread,data)   \\\n    ( (This)->lpVtbl -> GetThreadAllocData(This,thread,data) )\n\n#define ISOSDacInterface_GetHeapAllocData(This,count,data,pNeeded)  \\\n    ( (This)->lpVtbl -> GetHeapAllocData(This,count,data,pNeeded) )\n\n#define ISOSDacInterface_GetFailedAssemblyList(This,appDomain,count,values,pNeeded) \\\n    ( (This)->lpVtbl -> GetFailedAssemblyList(This,appDomain,count,values,pNeeded) )\n\n#define ISOSDacInterface_GetPrivateBinPaths(This,appDomain,count,paths,pNeeded) \\\n    ( (This)->lpVtbl -> GetPrivateBinPaths(This,appDomain,count,paths,pNeeded) )\n\n#define ISOSDacInterface_GetAssemblyLocation(This,assembly,count,location,pNeeded)  \\\n    ( (This)->lpVtbl -> GetAssemblyLocation(This,assembly,count,location,pNeeded) )\n\n#define ISOSDacInterface_GetAppDomainConfigFile(This,appDomain,count,configFile,pNeeded)    \\\n    ( (This)->lpVtbl -> GetAppDomainConfigFile(This,appDomain,count,configFile,pNeeded) )\n\n#define ISOSDacInterface_GetApplicationBase(This,appDomain,count,base,pNeeded)  \\\n    ( (This)->lpVtbl -> GetApplicationBase(This,appDomain,count,base,pNeeded) )\n\n#define ISOSDacInterface_GetFailedAssemblyData(This,assembly,pContext,pResult)  \\\n    ( (This)->lpVtbl -> GetFailedAssemblyData(This,assembly,pContext,pResult) )\n\n#define ISOSDacInterface_GetFailedAssemblyLocation(This,assesmbly,count,location,pNeeded)   \\\n    ( (This)->lpVtbl -> GetFailedAssemblyLocation(This,assesmbly,count,location,pNeeded) )\n\n#define ISOSDacInterface_GetFailedAssemblyDisplayName(This,assembly,count,name,pNeeded) \\\n    ( (This)->lpVtbl -> GetFailedAssemblyDisplayName(This,assembly,count,name,pNeeded) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface2_INTERFACE_DEFINED__\n#define __ISOSDacInterface2_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface2 */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"A16026EC-96F4-40BA-87FB-5575986FB7AF\")\n    ISOSDacInterface2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetObjectExceptionData(\n            CLRDATA_ADDRESS objAddr,\n            struct DacpExceptionObjectData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE IsRCWDCOMProxy(\n            CLRDATA_ADDRESS rcwAddr,\n            BOOL *isDCOMProxy) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface2Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface2 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface2 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetObjectExceptionData )(\n            ISOSDacInterface2 * This,\n            CLRDATA_ADDRESS objAddr,\n            struct DacpExceptionObjectData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *IsRCWDCOMProxy )(\n            ISOSDacInterface2 * This,\n            CLRDATA_ADDRESS rcwAddr,\n            BOOL *isDCOMProxy);\n\n        END_INTERFACE\n    } ISOSDacInterface2Vtbl;\n\n    interface ISOSDacInterface2\n    {\n        CONST_VTBL struct ISOSDacInterface2Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface2_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface2_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface2_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface2_GetObjectExceptionData(This,objAddr,data) \\\n    ( (This)->lpVtbl -> GetObjectExceptionData(This,objAddr,data) )\n\n#define ISOSDacInterface2_IsRCWDCOMProxy(This,rcwAddr,isDCOMProxy)  \\\n    ( (This)->lpVtbl -> IsRCWDCOMProxy(This,rcwAddr,isDCOMProxy) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface2_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface3_INTERFACE_DEFINED__\n#define __ISOSDacInterface3_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface3 */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"B08C5CDC-FD8A-49C5-AB38-5FEEF35235B4\")\n    ISOSDacInterface3 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetGCInterestingInfoData(\n            CLRDATA_ADDRESS interestingInfoAddr,\n            struct DacpGCInterestingInfoData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGCInterestingInfoStaticData(\n            struct DacpGCInterestingInfoData *data) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGCGlobalMechanisms(\n            size_t *globalMechanisms) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface3Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface3 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface3 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCInterestingInfoData )(\n            ISOSDacInterface3 * This,\n            CLRDATA_ADDRESS interestingInfoAddr,\n            struct DacpGCInterestingInfoData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCInterestingInfoStaticData )(\n            ISOSDacInterface3 * This,\n            struct DacpGCInterestingInfoData *data);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGCGlobalMechanisms )(\n            ISOSDacInterface3 * This,\n            size_t *globalMechanisms);\n\n        END_INTERFACE\n    } ISOSDacInterface3Vtbl;\n\n    interface ISOSDacInterface3\n    {\n        CONST_VTBL struct ISOSDacInterface3Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface3_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface3_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface3_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface3_GetGCInterestingInfoData(This,interestingInfoAddr,data)   \\\n    ( (This)->lpVtbl -> GetGCInterestingInfoData(This,interestingInfoAddr,data) )\n\n#define ISOSDacInterface3_GetGCInterestingInfoStaticData(This,data) \\\n    ( (This)->lpVtbl -> GetGCInterestingInfoStaticData(This,data) )\n\n#define ISOSDacInterface3_GetGCGlobalMechanisms(This,globalMechanisms)  \\\n    ( (This)->lpVtbl -> GetGCGlobalMechanisms(This,globalMechanisms) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface3_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface4_INTERFACE_DEFINED__\n#define __ISOSDacInterface4_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface4 */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"74B9D34C-A612-4B07-93DD-5462178FCE11\")\n    ISOSDacInterface4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetClrNotification(\n            CLRDATA_ADDRESS arguments[  ],\n            int count,\n            int *pNeeded) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface4Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface4 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface4 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetClrNotification )(\n            ISOSDacInterface4 * This,\n            CLRDATA_ADDRESS arguments[  ],\n            int count,\n            int *pNeeded);\n\n        END_INTERFACE\n    } ISOSDacInterface4Vtbl;\n\n    interface ISOSDacInterface4\n    {\n        CONST_VTBL struct ISOSDacInterface4Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface4_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface4_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface4_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface4_GetClrNotification(This,arguments,count,pNeeded)  \\\n    ( (This)->lpVtbl -> GetClrNotification(This,arguments,count,pNeeded) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface4_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface5_INTERFACE_DEFINED__\n#define __ISOSDacInterface5_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface5 */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface5;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"127d6abe-6c86-4e48-8e7b-220781c58101\")\n    ISOSDacInterface5 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetTieredVersions(\n            CLRDATA_ADDRESS methodDesc,\n            int rejitId,\n            struct DacpTieredVersionData *nativeCodeAddrs,\n            int cNativeCodeAddrs,\n            int *pcNativeCodeAddrs) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface5Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface5 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface5 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface5 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetTieredVersions )(\n            ISOSDacInterface5 * This,\n            CLRDATA_ADDRESS methodDesc,\n            int rejitId,\n            struct DacpTieredVersionData *nativeCodeAddrs,\n            int cNativeCodeAddrs,\n            int *pcNativeCodeAddrs);\n\n        END_INTERFACE\n    } ISOSDacInterface5Vtbl;\n\n    interface ISOSDacInterface5\n    {\n        CONST_VTBL struct ISOSDacInterface5Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface5_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface5_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface5_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface5_GetTieredVersions(This,methodDesc,rejitId,nativeCodeAddrs,cNativeCodeAddrs,pcNativeCodeAddrs) \\\n    ( (This)->lpVtbl -> GetTieredVersions(This,methodDesc,rejitId,nativeCodeAddrs,cNativeCodeAddrs,pcNativeCodeAddrs) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface5_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface6_INTERFACE_DEFINED__\n#define __ISOSDacInterface6_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface6 */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface6;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"11206399-4B66-4EDB-98EA-85654E59AD45\")\n    ISOSDacInterface6 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetMethodTableCollectibleData(\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableCollectibleData *data) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface6Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface6 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface6 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface6 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodTableCollectibleData )(\n            ISOSDacInterface6 * This,\n            CLRDATA_ADDRESS mt,\n            struct DacpMethodTableCollectibleData *data);\n\n        END_INTERFACE\n    } ISOSDacInterface6Vtbl;\n\n    interface ISOSDacInterface6\n    {\n        CONST_VTBL struct ISOSDacInterface6Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface6_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface6_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface6_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface6_GetMethodTableCollectibleData(This,mt,data)   \\\n    ( (This)->lpVtbl -> GetMethodTableCollectibleData(This,mt,data) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface6_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface7_INTERFACE_DEFINED__\n#define __ISOSDacInterface7_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface7 */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface7;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"c1020dde-fe98-4536-a53b-f35a74c327eb\")\n    ISOSDacInterface7 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetPendingReJITID(\n            CLRDATA_ADDRESS methodDesc,\n            int *pRejitId) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetReJITInformation(\n            CLRDATA_ADDRESS methodDesc,\n            int rejitId,\n            struct DacpReJitData2 *pRejitData) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetProfilerModifiedILInformation(\n            CLRDATA_ADDRESS methodDesc,\n            struct DacpProfilerILData *pILData) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetMethodsWithProfilerModifiedIL(\n            CLRDATA_ADDRESS mod,\n            CLRDATA_ADDRESS *methodDescs,\n            int cMethodDescs,\n            int *pcMethodDescs) = 0;\n\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface7Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface7 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface7 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface7 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetPendingReJITID )(\n            ISOSDacInterface7 * This,\n            CLRDATA_ADDRESS methodDesc,\n            int *pRejitId);\n\n        HRESULT ( STDMETHODCALLTYPE *GetReJITInformation )(\n            ISOSDacInterface7 * This,\n            CLRDATA_ADDRESS methodDesc,\n            int rejitId,\n            struct DacpReJitData2 *pRejitData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetProfilerModifiedILInformation )(\n            ISOSDacInterface7 * This,\n            CLRDATA_ADDRESS methodDesc,\n            struct DacpProfilerILData *pILData);\n\n        HRESULT ( STDMETHODCALLTYPE *GetMethodsWithProfilerModifiedIL )(\n            ISOSDacInterface7 * This,\n            CLRDATA_ADDRESS mod,\n            CLRDATA_ADDRESS *methodDescs,\n            int cMethodDescs,\n            int *pcMethodDescs);\n\n        END_INTERFACE\n    } ISOSDacInterface7Vtbl;\n\n    interface ISOSDacInterface7\n    {\n        CONST_VTBL struct ISOSDacInterface7Vtbl *lpVtbl;\n    };\n\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface7_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface7_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface7_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface7_GetPendingReJITID(This,methodDesc,pRejitId)   \\\n    ( (This)->lpVtbl -> GetPendingReJITID(This,methodDesc,pRejitId) )\n\n#define ISOSDacInterface7_GetReJITInformation(This,methodDesc,rejitId,pRejitData)   \\\n    ( (This)->lpVtbl -> GetReJITInformation(This,methodDesc,rejitId,pRejitData) )\n\n#define ISOSDacInterface7_GetProfilerModifiedILInformation(This,methodDesc,pILData) \\\n    ( (This)->lpVtbl -> GetProfilerModifiedILInformation(This,methodDesc,pILData) )\n\n#define ISOSDacInterface7_GetMethodsWithProfilerModifiedIL(This,mod,methodDescs,cMethodDescs,pcMethodDescs) \\\n    ( (This)->lpVtbl -> GetMethodsWithProfilerModifiedIL(This,mod,methodDescs,cMethodDescs,pcMethodDescs) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface7_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface8_INTERFACE_DEFINED__\n#define __ISOSDacInterface8_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface8 */\n/* [uuid][local][object] */\n\n\nEXTERN_C const IID IID_ISOSDacInterface8;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n\n    MIDL_INTERFACE(\"c12f35a9-e55c-4520-a894-b3dc5165dfce\")\n    ISOSDacInterface8 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetNumberGenerations(\n            unsigned int *pGenerations) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGenerationTable(\n            unsigned int cGenerations,\n            struct DacpGenerationData *pGenerationData,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFinalizationFillPointers(\n            unsigned int cFillPointers,\n            CLRDATA_ADDRESS *pFinalizationFillPointers,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetGenerationTableSvr(\n            CLRDATA_ADDRESS heapAddr,\n            unsigned int cGenerations,\n            struct DacpGenerationData *pGenerationData,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetFinalizationFillPointersSvr(\n            CLRDATA_ADDRESS heapAddr,\n            unsigned int cFillPointers,\n            CLRDATA_ADDRESS *pFinalizationFillPointers,\n            unsigned int *pNeeded) = 0;\n\n        virtual HRESULT STDMETHODCALLTYPE GetAssemblyLoadContext(\n            CLRDATA_ADDRESS methodTable,\n            CLRDATA_ADDRESS* assemblyLoadContext) = 0;\n    };\n\n\n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface8Vtbl\n    {\n        BEGIN_INTERFACE\n\n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )(\n            ISOSDacInterface8 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */\n            _COM_Outptr_  void **ppvObject);\n\n        ULONG ( STDMETHODCALLTYPE *AddRef )(\n            ISOSDacInterface8 * This);\n\n        ULONG ( STDMETHODCALLTYPE *Release )(\n            ISOSDacInterface8 * This);\n\n        HRESULT ( STDMETHODCALLTYPE *GetNumberGenerations )(\n            ISOSDacInterface8 * This,\n            unsigned int *pGenerations);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationTable )(\n            ISOSDacInterface8 * This,\n            unsigned int cGenerations,\n            struct DacpGenerationData *pGenerationData,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFinalizationFillPointers )(\n            ISOSDacInterface8 * This,\n            unsigned int cFillPointers,\n            CLRDATA_ADDRESS *pFinalizationFillPointers,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetGenerationTableSvr )(\n            ISOSDacInterface8 * This,\n            CLRDATA_ADDRESS heapAddr,\n            unsigned int cGenerations,\n            struct DacpGenerationData *pGenerationData,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetFinalizationFillPointersSvr )(\n            ISOSDacInterface8 * This,\n            CLRDATA_ADDRESS heapAddr,\n            unsigned int cFillPointers,\n            CLRDATA_ADDRESS *pFinalizationFillPointers,\n            unsigned int *pNeeded);\n\n        HRESULT ( STDMETHODCALLTYPE *GetAssemblyLoadContext )(\n            ISOSDacInterface8 * This,\n            CLRDATA_ADDRESS methodTable,\n            CLRDATA_ADDRESS *assemblyLoadContext);\n           \n        END_INTERFACE\n    } ISOSDacInterface8Vtbl;\n\n    interface ISOSDacInterface8\n    {\n        CONST_VTBL struct ISOSDacInterface8Vtbl *lpVtbl;\n    };\n\n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface8_QueryInterface(This,riid,ppvObject)   \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )\n\n#define ISOSDacInterface8_AddRef(This)  \\\n    ( (This)->lpVtbl -> AddRef(This) )\n\n#define ISOSDacInterface8_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) )\n\n\n#define ISOSDacInterface8_GetNumberGenerations(This,pGenerations)   \\\n    ( (This)->lpVtbl -> GetNumberGenerations(This,pGenerations) )\n\n#define ISOSDacInterface8_GetGenerationTable(This,cGenerations,pGenerationData,pNeeded) \\\n    ( (This)->lpVtbl -> GetGenerationTable(This,cGenerations,pGenerationData,pNeeded) )\n\n#define ISOSDacInterface8_GetFinalizationFillPointers(This,cFillPointers,pFinalizationFillPointers,pNeeded) \\\n    ( (This)->lpVtbl -> GetFinalizationFillPointers(This,cFillPointers,pFinalizationFillPointers,pNeeded) )\n\n#define ISOSDacInterface8_GetGenerationTableSvr(This,heapAddr,cGenerations,pGenerationData,pNeeded) \\\n    ( (This)->lpVtbl -> GetGenerationTableSvr(This,heapAddr,cGenerations,pGenerationData,pNeeded) )\n\n#define ISOSDacInterface8_GetFinalizationFillPointersSvr(This,heapAddr,cFillPointers,pFinalizationFillPointers,pNeeded) \\\n    ( (This)->lpVtbl -> GetFinalizationFillPointersSvr(This,heapAddr,cFillPointers,pFinalizationFillPointers,pNeeded) )\n\n#define ISOSDacInterface8_GetAssemblyLoadContext(This,methodTable,assemblyLoadContext) \\\n    ( (This)->lpVtbl -> GetAssemblyLoadContext(This,methodTable,assemblyLoadContext) )\n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface8_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_sospriv_0000_0012 */\n/* [local] */ \n\n#define SOS_BREAKING_CHANGE_VERSION 3\n\n\nextern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0012_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0012_v0_0_s_ifspec;\n\n#ifndef __ISOSDacInterface9_INTERFACE_DEFINED__\n#define __ISOSDacInterface9_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface9 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ISOSDacInterface9;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"4eca42d8-7e7b-4c8a-a116-7bfbf6929267\")\n    ISOSDacInterface9 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetBreakingChangeVersion( \n            int *pVersion) = 0;\n        \n    };\n    \n    \n#else  /* C style interface */\n\n    typedef struct ISOSDacInterface9Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ISOSDacInterface9 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ISOSDacInterface9 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ISOSDacInterface9 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetBreakingChangeVersion )( \n            ISOSDacInterface9 * This,\n            int *pVersion);\n        \n        END_INTERFACE\n    } ISOSDacInterface9Vtbl;\n\n    interface ISOSDacInterface9\n    {\n        CONST_VTBL struct ISOSDacInterface9Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface9_QueryInterface(This,riid,ppvObject) \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISOSDacInterface9_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISOSDacInterface9_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISOSDacInterface9_GetBreakingChangeVersion(This,pVersion) \\\n    ( (This)->lpVtbl -> GetBreakingChangeVersion(This,pVersion) ) \n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n#endif  /* __ISOSDacInterface9_INTERFACE_DEFINED__ */\n\n\n#ifndef __ISOSDacInterface10_INTERFACE_DEFINED__\n#define __ISOSDacInterface10_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface10 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ISOSDacInterface10;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"90B8FCC3-7251-4B0A-AE3D-5C13A67EC9AA\")\n    ISOSDacInterface10 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetObjectComWrappersData( \n            CLRDATA_ADDRESS objAddr,\n            CLRDATA_ADDRESS *rcw,\n            unsigned int count,\n            CLRDATA_ADDRESS *mowList,\n            unsigned int *pNeeded) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsComWrappersCCW( \n            CLRDATA_ADDRESS ccw,\n            BOOL *isComWrappersCCW) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetComWrappersCCWData( \n            CLRDATA_ADDRESS ccw,\n            CLRDATA_ADDRESS *managedObject,\n            int *refCount) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsComWrappersRCW( \n            CLRDATA_ADDRESS rcw,\n            BOOL *isComWrappersRCW) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetComWrappersRCWData( \n            CLRDATA_ADDRESS rcw,\n            CLRDATA_ADDRESS *identity) = 0;\n        \n    };\n    \n    \n#else   /* C style interface */\n\n    typedef struct ISOSDacInterface10Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ISOSDacInterface10 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ISOSDacInterface10 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ISOSDacInterface10 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetObjectComWrappersData )( \n            ISOSDacInterface10 * This,\n            CLRDATA_ADDRESS objAddr,\n            CLRDATA_ADDRESS *rcw,\n            unsigned int count,\n            CLRDATA_ADDRESS *mowList,\n            unsigned int *pNeeded);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsComWrappersCCW )( \n            ISOSDacInterface10 * This,\n            CLRDATA_ADDRESS ccw,\n            BOOL *isComWrappersCCW);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetComWrappersCCWData )( \n            ISOSDacInterface10 * This,\n            CLRDATA_ADDRESS ccw,\n            CLRDATA_ADDRESS *managedObject,\n            int *refCount);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsComWrappersRCW )( \n            ISOSDacInterface10 * This,\n            CLRDATA_ADDRESS rcw,\n            BOOL *isComWrappersRCW);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetComWrappersRCWData )( \n            ISOSDacInterface10 * This,\n            CLRDATA_ADDRESS rcw,\n            CLRDATA_ADDRESS *identity);\n        \n        END_INTERFACE\n    } ISOSDacInterface10Vtbl;\n\n    interface ISOSDacInterface10\n    {\n        CONST_VTBL struct ISOSDacInterface10Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface10_QueryInterface(This,riid,ppvObject)  \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISOSDacInterface10_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISOSDacInterface10_Release(This)    \\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISOSDacInterface10_GetObjectComWrappersData(This,objAddr,rcw,count,mowList,pNeeded) \\\n    ( (This)->lpVtbl -> GetObjectComWrappersData(This,objAddr,rcw,count,mowList,pNeeded) ) \n\n#define ISOSDacInterface10_IsComWrappersCCW(This,ccw,isComWrappersCCW)  \\\n    ( (This)->lpVtbl -> IsComWrappersCCW(This,ccw,isComWrappersCCW) ) \n\n#define ISOSDacInterface10_GetComWrappersCCWData(This,ccw,managedObject,refCount)   \\\n    ( (This)->lpVtbl -> GetComWrappersCCWData(This,ccw,managedObject,refCount) ) \n\n#define ISOSDacInterface10_IsComWrappersRCW(This,rcw,isComWrappersRCW)  \\\n    ( (This)->lpVtbl -> IsComWrappersRCW(This,rcw,isComWrappersRCW) ) \n\n#define ISOSDacInterface10_GetComWrappersRCWData(This,rcw,identity) \\\n    ( (This)->lpVtbl -> GetComWrappersRCWData(This,rcw,identity) ) \n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __ISOSDacInterface10_INTERFACE_DEFINED__ */\n\n#ifndef __ISOSDacInterface11_INTERFACE_DEFINED__\n#define __ISOSDacInterface11_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface11 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ISOSDacInterface11;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"96BA1DB9-14CD-4492-8065-1CAAECF6E5CF\")\n    ISOSDacInterface11 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE IsTrackedType( \n            CLRDATA_ADDRESS objAddr,\n            BOOL *isTrackedType,\n            BOOL *hasTaggedMemory) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTaggedMemory( \n            CLRDATA_ADDRESS objAddr,\n            CLRDATA_ADDRESS *taggedMemory,\n            size_t *taggedMemorySizeInBytes) = 0;\n        \n    };\n    \n    \n#else  /* C style interface */\n\n    typedef struct ISOSDacInterface11Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ISOSDacInterface11 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ISOSDacInterface11 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ISOSDacInterface11 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsTrackedType )( \n            ISOSDacInterface11 * This,\n            CLRDATA_ADDRESS objAddr,\n            BOOL *isTrackedType,\n            BOOL *hasTaggedMemory);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTaggedMemory )( \n            ISOSDacInterface11 * This,\n            CLRDATA_ADDRESS objAddr,\n            CLRDATA_ADDRESS *taggedMemory,\n            size_t *taggedMemorySizeInBytes);\n        \n        END_INTERFACE\n    } ISOSDacInterface11Vtbl;\n\n    interface ISOSDacInterface11\n    {\n        CONST_VTBL struct ISOSDacInterface11Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface11_QueryInterface(This,riid,ppvObject) \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISOSDacInterface11_AddRef(This) \\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISOSDacInterface11_Release(This) \\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISOSDacInterface11_IsTrackedType(This,objAddr,isTrackedType,hasTaggedMemory) \\\n    ( (This)->lpVtbl -> IsTrackedType(This,objAddr,isTrackedType,hasTaggedMemory) ) \n\n#define ISOSDacInterface11_GetTaggedMemory(This,objAddr,taggedMemory,taggedMemorySizeInBytes) \\\n    ( (This)->lpVtbl -> GetTaggedMemory(This,objAddr,taggedMemory,taggedMemorySizeInBytes) ) \n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n#endif  /* __ISOSDacInterface11_INTERFACE_DEFINED__ */\n\n#ifndef __ISOSDacInterface12_INTERFACE_DEFINED__\n#define __ISOSDacInterface12_INTERFACE_DEFINED__\n\n/* interface ISOSDacInterface12 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ISOSDacInterface12;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"1b93bacc-8ca4-432d-943a-3e6e7ec0b0a3\")\n    ISOSDacInterface12 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetGlobalAllocationContext( \n            CLRDATA_ADDRESS *allocPtr,\n            CLRDATA_ADDRESS *allocLimit) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ISOSDacInterface12Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ISOSDacInterface12 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ISOSDacInterface12 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ISOSDacInterface12 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetGlobalAllocationContext )( \n            ISOSDacInterface12 * This,\n            CLRDATA_ADDRESS *allocPtr,\n            CLRDATA_ADDRESS *allocLimit);\n        \n        END_INTERFACE\n    } ISOSDacInterface12Vtbl;\n\n    interface ISOSDacInterface12\n    {\n        CONST_VTBL struct ISOSDacInterface12Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ISOSDacInterface12_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ISOSDacInterface12_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ISOSDacInterface12_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ISOSDacInterface12_GetGlobalAllocationContext(This,allocPtr,allocLimit)\t\\\n    ( (This)->lpVtbl -> GetGlobalAllocationContext(This,allocPtr,allocLimit) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ISOSDacInterface12_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/xclrdata.h",
    "content": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n\n\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.00.0603 */\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif // __RPCNDR_H_VERSION__\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __xclrdata_h__\n#define __xclrdata_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __IXCLRDataTarget3_FWD_DEFINED__\n#define __IXCLRDataTarget3_FWD_DEFINED__\ntypedef interface IXCLRDataTarget3 IXCLRDataTarget3;\n\n#endif \t/* __IXCLRDataTarget3_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRLibrarySupport_FWD_DEFINED__\n#define __IXCLRLibrarySupport_FWD_DEFINED__\ntypedef interface IXCLRLibrarySupport IXCLRLibrarySupport;\n\n#endif \t/* __IXCLRLibrarySupport_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDisassemblySupport_FWD_DEFINED__\n#define __IXCLRDisassemblySupport_FWD_DEFINED__\ntypedef interface IXCLRDisassemblySupport IXCLRDisassemblySupport;\n\n#endif \t/* __IXCLRDisassemblySupport_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataDisplay_FWD_DEFINED__\n#define __IXCLRDataDisplay_FWD_DEFINED__\ntypedef interface IXCLRDataDisplay IXCLRDataDisplay;\n\n#endif \t/* __IXCLRDataDisplay_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataProcess_FWD_DEFINED__\n#define __IXCLRDataProcess_FWD_DEFINED__\ntypedef interface IXCLRDataProcess IXCLRDataProcess;\n\n#endif \t/* __IXCLRDataProcess_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataProcess2_FWD_DEFINED__\n#define __IXCLRDataProcess2_FWD_DEFINED__\ntypedef interface IXCLRDataProcess2 IXCLRDataProcess2;\n\n#endif \t/* __IXCLRDataProcess2_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataAppDomain_FWD_DEFINED__\n#define __IXCLRDataAppDomain_FWD_DEFINED__\ntypedef interface IXCLRDataAppDomain IXCLRDataAppDomain;\n\n#endif \t/* __IXCLRDataAppDomain_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataAssembly_FWD_DEFINED__\n#define __IXCLRDataAssembly_FWD_DEFINED__\ntypedef interface IXCLRDataAssembly IXCLRDataAssembly;\n\n#endif \t/* __IXCLRDataAssembly_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataModule_FWD_DEFINED__\n#define __IXCLRDataModule_FWD_DEFINED__\ntypedef interface IXCLRDataModule IXCLRDataModule;\n\n#endif \t/* __IXCLRDataModule_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataModule2_FWD_DEFINED__\n#define __IXCLRDataModule2_FWD_DEFINED__\ntypedef interface IXCLRDataModule2 IXCLRDataModule2;\n\n#endif \t/* __IXCLRDataModule2_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataTypeDefinition_FWD_DEFINED__\n#define __IXCLRDataTypeDefinition_FWD_DEFINED__\ntypedef interface IXCLRDataTypeDefinition IXCLRDataTypeDefinition;\n\n#endif \t/* __IXCLRDataTypeDefinition_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataTypeInstance_FWD_DEFINED__\n#define __IXCLRDataTypeInstance_FWD_DEFINED__\ntypedef interface IXCLRDataTypeInstance IXCLRDataTypeInstance;\n\n#endif \t/* __IXCLRDataTypeInstance_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataMethodDefinition_FWD_DEFINED__\n#define __IXCLRDataMethodDefinition_FWD_DEFINED__\ntypedef interface IXCLRDataMethodDefinition IXCLRDataMethodDefinition;\n\n#endif \t/* __IXCLRDataMethodDefinition_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataMethodInstance_FWD_DEFINED__\n#define __IXCLRDataMethodInstance_FWD_DEFINED__\ntypedef interface IXCLRDataMethodInstance IXCLRDataMethodInstance;\n\n#endif \t/* __IXCLRDataMethodInstance_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataTask_FWD_DEFINED__\n#define __IXCLRDataTask_FWD_DEFINED__\ntypedef interface IXCLRDataTask IXCLRDataTask;\n\n#endif \t/* __IXCLRDataTask_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataStackWalk_FWD_DEFINED__\n#define __IXCLRDataStackWalk_FWD_DEFINED__\ntypedef interface IXCLRDataStackWalk IXCLRDataStackWalk;\n\n#endif \t/* __IXCLRDataStackWalk_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataFrame_FWD_DEFINED__\n#define __IXCLRDataFrame_FWD_DEFINED__\ntypedef interface IXCLRDataFrame IXCLRDataFrame;\n\n#endif \t/* __IXCLRDataFrame_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataFrame2_FWD_DEFINED__\n#define __IXCLRDataFrame2_FWD_DEFINED__\ntypedef interface IXCLRDataFrame2 IXCLRDataFrame2;\n\n#endif \t/* __IXCLRDataFrame2_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionState_FWD_DEFINED__\n#define __IXCLRDataExceptionState_FWD_DEFINED__\ntypedef interface IXCLRDataExceptionState IXCLRDataExceptionState;\n\n#endif \t/* __IXCLRDataExceptionState_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataValue_FWD_DEFINED__\n#define __IXCLRDataValue_FWD_DEFINED__\ntypedef interface IXCLRDataValue IXCLRDataValue;\n\n#endif \t/* __IXCLRDataValue_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionNotification_FWD_DEFINED__\n#define __IXCLRDataExceptionNotification_FWD_DEFINED__\ntypedef interface IXCLRDataExceptionNotification IXCLRDataExceptionNotification;\n\n#endif \t/* __IXCLRDataExceptionNotification_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionNotification2_FWD_DEFINED__\n#define __IXCLRDataExceptionNotification2_FWD_DEFINED__\ntypedef interface IXCLRDataExceptionNotification2 IXCLRDataExceptionNotification2;\n\n#endif \t/* __IXCLRDataExceptionNotification2_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionNotification3_FWD_DEFINED__\n#define __IXCLRDataExceptionNotification3_FWD_DEFINED__\ntypedef interface IXCLRDataExceptionNotification3 IXCLRDataExceptionNotification3;\n\n#endif \t/* __IXCLRDataExceptionNotification3_FWD_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionNotification4_FWD_DEFINED__\n#define __IXCLRDataExceptionNotification4_FWD_DEFINED__\ntypedef interface IXCLRDataExceptionNotification4 IXCLRDataExceptionNotification4;\n\n#endif \t/* __IXCLRDataExceptionNotification4_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"clrdata.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n/* interface __MIDL_itf_xclrdata_0000_0000 */\n/* [local] */ \n\n#if 0\ntypedef UINT32 mdToken;\n\ntypedef mdToken mdTypeDef;\n\ntypedef mdToken mdMethodDef;\n\ntypedef mdToken mdFieldDef;\n\ntypedef ULONG CorElementType;\n\ntypedef struct _EXCEPTION_RECORD64\n    {\n    DWORD ExceptionCode;\n    DWORD ExceptionFlags;\n    DWORD64 ExceptionRecord;\n    DWORD64 ExceptionAddress;\n    DWORD NumberParameters;\n    DWORD __unusedAlignment;\n    DWORD64 ExceptionInformation[ 15 ];\n    } \tEXCEPTION_RECORD64;\n\ntypedef struct _EXCEPTION_RECORD64 *PEXCEPTION_RECORD64;\n\n#endif\n#pragma warning(push)\n#pragma warning(disable:28718)    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#pragma warning(pop)\ntypedef /* [public][public][public] */ struct __MIDL___MIDL_itf_xclrdata_0000_0000_0001\n    {\n    CLRDATA_ADDRESS startAddress;\n    CLRDATA_ADDRESS endAddress;\n    } \tCLRDATA_ADDRESS_RANGE;\n\ntypedef ULONG64 CLRDATA_ENUM;\n\n#define CLRDATA_NOTIFY_EXCEPTION 0xe0444143\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0000_0002\n    {\n        CLRDATA_REQUEST_REVISION\t= 0xe0000000\n    } \tCLRDataGeneralRequest;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0000_0003\n    {\n        CLRDATA_TYPE_DEFAULT\t= 0,\n        CLRDATA_TYPE_IS_PRIMITIVE\t= 0x1,\n        CLRDATA_TYPE_IS_VALUE_TYPE\t= 0x2,\n        CLRDATA_TYPE_IS_STRING\t= 0x4,\n        CLRDATA_TYPE_IS_ARRAY\t= 0x8,\n        CLRDATA_TYPE_IS_REFERENCE\t= 0x10,\n        CLRDATA_TYPE_IS_POINTER\t= 0x20,\n        CLRDATA_TYPE_IS_ENUM\t= 0x40,\n        CLRDATA_TYPE_ALL_KINDS\t= 0x7f\n    } \tCLRDataTypeFlag;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0000_0004\n    {\n        CLRDATA_FIELD_DEFAULT\t= 0,\n        CLRDATA_FIELD_IS_PRIMITIVE\t= CLRDATA_TYPE_IS_PRIMITIVE,\n        CLRDATA_FIELD_IS_VALUE_TYPE\t= CLRDATA_TYPE_IS_VALUE_TYPE,\n        CLRDATA_FIELD_IS_STRING\t= CLRDATA_TYPE_IS_STRING,\n        CLRDATA_FIELD_IS_ARRAY\t= CLRDATA_TYPE_IS_ARRAY,\n        CLRDATA_FIELD_IS_REFERENCE\t= CLRDATA_TYPE_IS_REFERENCE,\n        CLRDATA_FIELD_IS_POINTER\t= CLRDATA_TYPE_IS_POINTER,\n        CLRDATA_FIELD_IS_ENUM\t= CLRDATA_TYPE_IS_ENUM,\n        CLRDATA_FIELD_ALL_KINDS\t= CLRDATA_TYPE_ALL_KINDS,\n        CLRDATA_FIELD_IS_INHERITED\t= 0x80,\n        CLRDATA_FIELD_IS_LITERAL\t= 0x100,\n        CLRDATA_FIELD_FROM_INSTANCE\t= 0x200,\n        CLRDATA_FIELD_FROM_TASK_LOCAL\t= 0x400,\n        CLRDATA_FIELD_FROM_STATIC\t= 0x800,\n        CLRDATA_FIELD_ALL_LOCATIONS\t= 0xe00,\n        CLRDATA_FIELD_ALL_FIELDS\t= 0xeff\n    } \tCLRDataFieldFlag;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0000_0005\n    {\n        CLRDATA_VALUE_DEFAULT\t= 0,\n        CLRDATA_VALUE_IS_PRIMITIVE\t= CLRDATA_TYPE_IS_PRIMITIVE,\n        CLRDATA_VALUE_IS_VALUE_TYPE\t= CLRDATA_TYPE_IS_VALUE_TYPE,\n        CLRDATA_VALUE_IS_STRING\t= CLRDATA_TYPE_IS_STRING,\n        CLRDATA_VALUE_IS_ARRAY\t= CLRDATA_TYPE_IS_ARRAY,\n        CLRDATA_VALUE_IS_REFERENCE\t= CLRDATA_TYPE_IS_REFERENCE,\n        CLRDATA_VALUE_IS_POINTER\t= CLRDATA_TYPE_IS_POINTER,\n        CLRDATA_VALUE_IS_ENUM\t= CLRDATA_TYPE_IS_ENUM,\n        CLRDATA_VALUE_ALL_KINDS\t= CLRDATA_TYPE_ALL_KINDS,\n        CLRDATA_VALUE_IS_INHERITED\t= CLRDATA_FIELD_IS_INHERITED,\n        CLRDATA_VALUE_IS_LITERAL\t= CLRDATA_FIELD_IS_LITERAL,\n        CLRDATA_VALUE_FROM_INSTANCE\t= CLRDATA_FIELD_FROM_INSTANCE,\n        CLRDATA_VALUE_FROM_TASK_LOCAL\t= CLRDATA_FIELD_FROM_TASK_LOCAL,\n        CLRDATA_VALUE_FROM_STATIC\t= CLRDATA_FIELD_FROM_STATIC,\n        CLRDATA_VALUE_ALL_LOCATIONS\t= CLRDATA_FIELD_ALL_LOCATIONS,\n        CLRDATA_VALUE_ALL_FIELDS\t= CLRDATA_FIELD_ALL_FIELDS,\n        CLRDATA_VALUE_IS_BOXED\t= 0x1000\n    } \tCLRDataValueFlag;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0000_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0000_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataTarget3_INTERFACE_DEFINED__\n#define __IXCLRDataTarget3_INTERFACE_DEFINED__\n\n/* interface IXCLRDataTarget3 */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataTarget3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"59d9b5e1-4a6f-4531-84c3-51d12da22fd4\")\n    IXCLRDataTarget3 : public ICLRDataTarget2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetMetaData( \n            /* [in] */ LPCWSTR imagePath,\n            /* [in] */ ULONG32 imageTimestamp,\n            /* [in] */ ULONG32 imageSize,\n            /* [in] */ GUID *mvid,\n            /* [in] */ ULONG32 mdRva,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufferSize,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [out] */ ULONG32 *dataSize) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataTarget3Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataTarget3 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataTarget3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMachineType )( \n            IXCLRDataTarget3 * This,\n            /* [out] */ ULONG32 *machineType);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetPointerSize )( \n            IXCLRDataTarget3 * This,\n            /* [out] */ ULONG32 *pointerSize);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetImageBase )( \n            IXCLRDataTarget3 * This,\n            /* [string][in] */ LPCWSTR imagePath,\n            /* [out] */ CLRDATA_ADDRESS *baseAddress);\n        \n        HRESULT ( STDMETHODCALLTYPE *ReadVirtual )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesRead);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteVirtual )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [size_is][in] */ BYTE *buffer,\n            /* [in] */ ULONG32 bytesRequested,\n            /* [out] */ ULONG32 *bytesWritten);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTLSValue )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [out] */ CLRDATA_ADDRESS *value);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTLSValue )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 index,\n            /* [in] */ CLRDATA_ADDRESS value);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCurrentThreadID )( \n            IXCLRDataTarget3 * This,\n            /* [out] */ ULONG32 *threadID);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetThreadContext )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][out] */ BYTE *context);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetThreadContext )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ ULONG32 threadID,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE *context);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *AllocVirtual )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags,\n            /* [in] */ ULONG32 protectFlags,\n            /* [out] */ CLRDATA_ADDRESS *virt);\n        \n        HRESULT ( STDMETHODCALLTYPE *FreeVirtual )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [in] */ ULONG32 size,\n            /* [in] */ ULONG32 typeFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMetaData )( \n            IXCLRDataTarget3 * This,\n            /* [in] */ LPCWSTR imagePath,\n            /* [in] */ ULONG32 imageTimestamp,\n            /* [in] */ ULONG32 imageSize,\n            /* [in] */ GUID *mvid,\n            /* [in] */ ULONG32 mdRva,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufferSize,\n            /* [length_is][size_is][out] */ BYTE *buffer,\n            /* [out] */ ULONG32 *dataSize);\n        \n        END_INTERFACE\n    } IXCLRDataTarget3Vtbl;\n\n    interface IXCLRDataTarget3\n    {\n        CONST_VTBL struct IXCLRDataTarget3Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataTarget3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataTarget3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataTarget3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataTarget3_GetMachineType(This,machineType)\t\\\n    ( (This)->lpVtbl -> GetMachineType(This,machineType) ) \n\n#define IXCLRDataTarget3_GetPointerSize(This,pointerSize)\t\\\n    ( (This)->lpVtbl -> GetPointerSize(This,pointerSize) ) \n\n#define IXCLRDataTarget3_GetImageBase(This,imagePath,baseAddress)\t\\\n    ( (This)->lpVtbl -> GetImageBase(This,imagePath,baseAddress) ) \n\n#define IXCLRDataTarget3_ReadVirtual(This,address,buffer,bytesRequested,bytesRead)\t\\\n    ( (This)->lpVtbl -> ReadVirtual(This,address,buffer,bytesRequested,bytesRead) ) \n\n#define IXCLRDataTarget3_WriteVirtual(This,address,buffer,bytesRequested,bytesWritten)\t\\\n    ( (This)->lpVtbl -> WriteVirtual(This,address,buffer,bytesRequested,bytesWritten) ) \n\n#define IXCLRDataTarget3_GetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> GetTLSValue(This,threadID,index,value) ) \n\n#define IXCLRDataTarget3_SetTLSValue(This,threadID,index,value)\t\\\n    ( (This)->lpVtbl -> SetTLSValue(This,threadID,index,value) ) \n\n#define IXCLRDataTarget3_GetCurrentThreadID(This,threadID)\t\\\n    ( (This)->lpVtbl -> GetCurrentThreadID(This,threadID) ) \n\n#define IXCLRDataTarget3_GetThreadContext(This,threadID,contextFlags,contextSize,context)\t\\\n    ( (This)->lpVtbl -> GetThreadContext(This,threadID,contextFlags,contextSize,context) ) \n\n#define IXCLRDataTarget3_SetThreadContext(This,threadID,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) ) \n\n#define IXCLRDataTarget3_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n\n#define IXCLRDataTarget3_AllocVirtual(This,addr,size,typeFlags,protectFlags,virt)\t\\\n    ( (This)->lpVtbl -> AllocVirtual(This,addr,size,typeFlags,protectFlags,virt) ) \n\n#define IXCLRDataTarget3_FreeVirtual(This,addr,size,typeFlags)\t\\\n    ( (This)->lpVtbl -> FreeVirtual(This,addr,size,typeFlags) ) \n\n\n#define IXCLRDataTarget3_GetMetaData(This,imagePath,imageTimestamp,imageSize,mvid,mdRva,flags,bufferSize,buffer,dataSize)\t\\\n    ( (This)->lpVtbl -> GetMetaData(This,imagePath,imageTimestamp,imageSize,mvid,mdRva,flags,bufferSize,buffer,dataSize) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataTarget3_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0001 */\n/* [local] */ \n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0001\n    {\n        CLRDATA_BYNAME_CASE_SENSITIVE\t= 0,\n        CLRDATA_BYNAME_CASE_INSENSITIVE\t= 0x1\n    } \tCLRDataByNameFlag;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0002\n    {\n        CLRDATA_GETNAME_DEFAULT\t= 0,\n        CLRDATA_GETNAME_NO_NAMESPACES\t= 0x1,\n        CLRDATA_GETNAME_NO_PARAMETERS\t= 0x2\n    } \tCLRDataGetNameFlag;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0003\n    {\n        CLRDATA_PROCESS_DEFAULT\t= 0,\n        CLRDATA_PROCESS_IN_GC\t= 0x1\n    } \tCLRDataProcessFlag;\n\ntypedef /* [public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0004\n    {\n        CLRDATA_ADDRESS_UNRECOGNIZED\t= 0,\n        CLRDATA_ADDRESS_MANAGED_METHOD\t= ( CLRDATA_ADDRESS_UNRECOGNIZED + 1 ) ,\n        CLRDATA_ADDRESS_RUNTIME_MANAGED_CODE\t= ( CLRDATA_ADDRESS_MANAGED_METHOD + 1 ) ,\n        CLRDATA_ADDRESS_RUNTIME_UNMANAGED_CODE\t= ( CLRDATA_ADDRESS_RUNTIME_MANAGED_CODE + 1 ) ,\n        CLRDATA_ADDRESS_GC_DATA\t= ( CLRDATA_ADDRESS_RUNTIME_UNMANAGED_CODE + 1 ) ,\n        CLRDATA_ADDRESS_RUNTIME_MANAGED_STUB\t= ( CLRDATA_ADDRESS_GC_DATA + 1 ) ,\n        CLRDATA_ADDRESS_RUNTIME_UNMANAGED_STUB\t= ( CLRDATA_ADDRESS_RUNTIME_MANAGED_STUB + 1 ) \n    } \tCLRDataAddressType;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0005\n    {\n        CLRDATA_NOTIFY_ON_MODULE_LOAD\t= 0x1,\n        CLRDATA_NOTIFY_ON_MODULE_UNLOAD\t= 0x2,\n        CLRDATA_NOTIFY_ON_EXCEPTION\t= 0x4,\n        CLRDATA_NOTIFY_ON_EXCEPTION_CATCH_ENTER\t= 0x8\n    } \tCLRDataOtherNotifyFlag;\n\ntypedef /* [public][public][public][public][public] */ struct __MIDL___MIDL_itf_xclrdata_0000_0001_0006\n    {\n    ULONG64 Data[ 8 ];\n    } \tCLRDATA_FOLLOW_STUB_BUFFER;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0007\n    {\n        CLRDATA_FOLLOW_STUB_DEFAULT\t= 0\n    } \tCLRDataFollowStubInFlag;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0008\n    {\n        CLRDATA_FOLLOW_STUB_INTERMEDIATE\t= 0,\n        CLRDATA_FOLLOW_STUB_EXIT\t= 0x1\n    } \tCLRDataFollowStubOutFlag;\n\ntypedef /* [public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0009\n    {\n        CLRNATIVEIMAGE_PE_INFO\t= 0x1,\n        CLRNATIVEIMAGE_COR_INFO\t= 0x2,\n        CLRNATIVEIMAGE_FIXUP_TABLES\t= 0x4,\n        CLRNATIVEIMAGE_FIXUP_HISTOGRAM\t= 0x8,\n        CLRNATIVEIMAGE_MODULE\t= 0x10,\n        CLRNATIVEIMAGE_METHODS\t= 0x20,\n        CLRNATIVEIMAGE_DISASSEMBLE_CODE\t= 0x40,\n        CLRNATIVEIMAGE_IL\t= 0x80,\n        CLRNATIVEIMAGE_METHODTABLES\t= 0x100,\n        CLRNATIVEIMAGE_NATIVE_INFO\t= 0x200,\n        CLRNATIVEIMAGE_MODULE_TABLES\t= 0x400,\n        CLRNATIVEIMAGE_FROZEN_SEGMENT\t= 0x800,\n        CLRNATIVEIMAGE_PE_FILE\t= 0x1000,\n        CLRNATIVEIMAGE_GC_INFO\t= 0x2000,\n        CLRNATIVEIMAGE_EECLASSES\t= 0x4000,\n        CLRNATIVEIMAGE_NATIVE_TABLES\t= 0x8000,\n        CLRNATIVEIMAGE_PRECODES\t= 0x10000,\n        CLRNATIVEIMAGE_TYPEDESCS\t= 0x20000,\n        CLRNATIVEIMAGE_VERBOSE_TYPES\t= 0x40000,\n        CLRNATIVEIMAGE_METHODDESCS\t= 0x80000,\n        CLRNATIVEIMAGE_METADATA\t= 0x100000,\n        CLRNATIVEIMAGE_DISABLE_NAMES\t= 0x200000,\n        CLRNATIVEIMAGE_DISABLE_REBASING\t= 0x400000,\n        CLRNATIVEIMAGE_SLIM_MODULE_TBLS\t= 0x800000,\n        CLRNATIVEIMAGE_RESOURCES\t= 0x1000000,\n        CLRNATIVEIMAGE_FILE_OFFSET\t= 0x2000000,\n        CLRNATIVEIMAGE_DEBUG_TRACE\t= 0x4000000,\n        CLRNATIVEIMAGE_RELOCATIONS\t= 0x8000000,\n        CLRNATIVEIMAGE_FIXUP_THUNKS\t= 0x10000000,\n        CLRNATIVEIMAGE_DEBUG_COVERAGE\t= 0x80000000\n    } \tCLRNativeImageDumpOptions;\n\n#ifdef __cplusplus\ninline CLRNativeImageDumpOptions operator|=(CLRNativeImageDumpOptions& lhs, CLRNativeImageDumpOptions rhs) { return (lhs = (CLRNativeImageDumpOptions)( ((unsigned)lhs) | ((unsigned)rhs) )); }\n#endif\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0001_0010\n    {\n        CLRDATAHINT_DISPLAY_HINTS_NONE\t= 0,\n        CLRDATAHINT_DISPLAY_ARRAY_AS_TABLE\t= 0x1,\n        CLRDATAHINT_DISPLAY_ARRAY_AS_ARRAY\t= 0x2,\n        CLRDATAHINT_DISPLAY_ARRAY_AS_ARRAY_IDX\t= 0x3,\n        CLRDATAHINT_DISPLAY_ARRAY_AS_MAP\t= 0x4,\n        CLRDATAHINT_DISPLAY_ARRAY_HINT_MASK\t= 0xff,\n        CLRDATAHINT_DISPLAY_STRUCT_AS_TABLE\t= 0x100,\n        CLRDATAHINT_DISPLAY_STRUCT_HINT_MASK\t= 0xff00,\n        CLRDATAHINT_DISPLAY_SEP_TAB\t= 0,\n        CLRDATAHINT_DISPLAY_SEP_SPACE\t= 0x1000000,\n        CLRDATAHINT_DISPLAY_SEP_TAB_SPACE\t= 0x2000000,\n        CLRDATAHINT_DISPLAY_SEP_MASK\t= 0xff000000\n    } \tCLRDataDisplayHints;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0001_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0001_v0_0_s_ifspec;\n\n#ifndef __IXCLRLibrarySupport_INTERFACE_DEFINED__\n#define __IXCLRLibrarySupport_INTERFACE_DEFINED__\n\n/* interface IXCLRLibrarySupport */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRLibrarySupport;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"E5F3039D-2C0C-4230-A69E-12AF1C3E563C\")\n    IXCLRLibrarySupport : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE LoadHardboundDependency( \n            const WCHAR *name,\n            REFGUID mvid,\n            /* [out] */ SIZE_T *loadedBase) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE LoadSoftboundDependency( \n            const WCHAR *name,\n            const BYTE *assemblymetadataBinding,\n            const BYTE *hash,\n            ULONG hashLength,\n            /* [out] */ SIZE_T *loadedBase) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRLibrarySupportVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRLibrarySupport * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRLibrarySupport * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRLibrarySupport * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *LoadHardboundDependency )( \n            IXCLRLibrarySupport * This,\n            const WCHAR *name,\n            REFGUID mvid,\n            /* [out] */ SIZE_T *loadedBase);\n        \n        HRESULT ( STDMETHODCALLTYPE *LoadSoftboundDependency )( \n            IXCLRLibrarySupport * This,\n            const WCHAR *name,\n            const BYTE *assemblymetadataBinding,\n            const BYTE *hash,\n            ULONG hashLength,\n            /* [out] */ SIZE_T *loadedBase);\n        \n        END_INTERFACE\n    } IXCLRLibrarySupportVtbl;\n\n    interface IXCLRLibrarySupport\n    {\n        CONST_VTBL struct IXCLRLibrarySupportVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRLibrarySupport_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRLibrarySupport_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRLibrarySupport_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRLibrarySupport_LoadHardboundDependency(This,name,mvid,loadedBase)\t\\\n    ( (This)->lpVtbl -> LoadHardboundDependency(This,name,mvid,loadedBase) ) \n\n#define IXCLRLibrarySupport_LoadSoftboundDependency(This,name,assemblymetadataBinding,hash,hashLength,loadedBase)\t\\\n    ( (This)->lpVtbl -> LoadSoftboundDependency(This,name,assemblymetadataBinding,hash,hashLength,loadedBase) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRLibrarySupport_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0002 */\n/* [local] */ \n\n\ntypedef SIZE_T ( __stdcall *CDSTranslateAddrCB )( \n    IXCLRDisassemblySupport *__MIDL____MIDL_itf_xclrdata_0000_00020000,\n    CLRDATA_ADDRESS __MIDL____MIDL_itf_xclrdata_0000_00020001,\n    WCHAR *__MIDL____MIDL_itf_xclrdata_0000_00020002,\n    SIZE_T __MIDL____MIDL_itf_xclrdata_0000_00020003,\n    DWORDLONG *__MIDL____MIDL_itf_xclrdata_0000_00020004);\n\ntypedef SIZE_T ( __stdcall *CDSTranslateFixupCB )( \n    IXCLRDisassemblySupport *__MIDL____MIDL_itf_xclrdata_0000_00020006,\n    CLRDATA_ADDRESS __MIDL____MIDL_itf_xclrdata_0000_00020007,\n    SIZE_T __MIDL____MIDL_itf_xclrdata_0000_00020008,\n    WCHAR *__MIDL____MIDL_itf_xclrdata_0000_00020009,\n    SIZE_T __MIDL____MIDL_itf_xclrdata_0000_00020010,\n    DWORDLONG *__MIDL____MIDL_itf_xclrdata_0000_00020011);\n\ntypedef SIZE_T ( __stdcall *CDSTranslateConstCB )( \n    IXCLRDisassemblySupport *__MIDL____MIDL_itf_xclrdata_0000_00020013,\n    DWORD __MIDL____MIDL_itf_xclrdata_0000_00020014,\n    WCHAR *__MIDL____MIDL_itf_xclrdata_0000_00020015,\n    SIZE_T __MIDL____MIDL_itf_xclrdata_0000_00020016);\n\ntypedef SIZE_T ( __stdcall *CDSTranslateRegrelCB )( \n    IXCLRDisassemblySupport *__MIDL____MIDL_itf_xclrdata_0000_00020018,\n    unsigned int rega,\n    CLRDATA_ADDRESS __MIDL____MIDL_itf_xclrdata_0000_00020019,\n    WCHAR *__MIDL____MIDL_itf_xclrdata_0000_00020020,\n    SIZE_T __MIDL____MIDL_itf_xclrdata_0000_00020021,\n    DWORD *__MIDL____MIDL_itf_xclrdata_0000_00020022);\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0002_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0002_v0_0_s_ifspec;\n\n#ifndef __IXCLRDisassemblySupport_INTERFACE_DEFINED__\n#define __IXCLRDisassemblySupport_INTERFACE_DEFINED__\n\n/* interface IXCLRDisassemblySupport */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDisassemblySupport;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"1F0F7134-D3F3-47DE-8E9B-C2FD358A2936\")\n    IXCLRDisassemblySupport : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetTranslateAddrCallback( \n            /* [in] */ CDSTranslateAddrCB cb) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE PvClientSet( \n            /* [in] */ void *pv) = 0;\n        \n        virtual SIZE_T STDMETHODCALLTYPE CbDisassemble( \n            CLRDATA_ADDRESS __MIDL__IXCLRDisassemblySupport0000,\n            const void *__MIDL__IXCLRDisassemblySupport0001,\n            SIZE_T __MIDL__IXCLRDisassemblySupport0002) = 0;\n        \n        virtual SIZE_T STDMETHODCALLTYPE Cinstruction( void) = 0;\n        \n        virtual BOOL STDMETHODCALLTYPE FSelectInstruction( \n            SIZE_T __MIDL__IXCLRDisassemblySupport0003) = 0;\n        \n        virtual SIZE_T STDMETHODCALLTYPE CchFormatInstr( \n            WCHAR *__MIDL__IXCLRDisassemblySupport0004,\n            SIZE_T __MIDL__IXCLRDisassemblySupport0005) = 0;\n        \n        virtual void *STDMETHODCALLTYPE PvClient( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetTranslateFixupCallback( \n            /* [in] */ CDSTranslateFixupCB cb) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetTranslateConstCallback( \n            /* [in] */ CDSTranslateConstCB cb) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetTranslateRegrelCallback( \n            /* [in] */ CDSTranslateRegrelCB cb) = 0;\n        \n        virtual BOOL STDMETHODCALLTYPE TargetIsAddress( void) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDisassemblySupportVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDisassemblySupport * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDisassemblySupport * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDisassemblySupport * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTranslateAddrCallback )( \n            IXCLRDisassemblySupport * This,\n            /* [in] */ CDSTranslateAddrCB cb);\n        \n        HRESULT ( STDMETHODCALLTYPE *PvClientSet )( \n            IXCLRDisassemblySupport * This,\n            /* [in] */ void *pv);\n        \n        SIZE_T ( STDMETHODCALLTYPE *CbDisassemble )( \n            IXCLRDisassemblySupport * This,\n            CLRDATA_ADDRESS __MIDL__IXCLRDisassemblySupport0000,\n            const void *__MIDL__IXCLRDisassemblySupport0001,\n            SIZE_T __MIDL__IXCLRDisassemblySupport0002);\n        \n        SIZE_T ( STDMETHODCALLTYPE *Cinstruction )( \n            IXCLRDisassemblySupport * This);\n        \n        BOOL ( STDMETHODCALLTYPE *FSelectInstruction )( \n            IXCLRDisassemblySupport * This,\n            SIZE_T __MIDL__IXCLRDisassemblySupport0003);\n        \n        SIZE_T ( STDMETHODCALLTYPE *CchFormatInstr )( \n            IXCLRDisassemblySupport * This,\n            WCHAR *__MIDL__IXCLRDisassemblySupport0004,\n            SIZE_T __MIDL__IXCLRDisassemblySupport0005);\n        \n        void *( STDMETHODCALLTYPE *PvClient )( \n            IXCLRDisassemblySupport * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTranslateFixupCallback )( \n            IXCLRDisassemblySupport * This,\n            /* [in] */ CDSTranslateFixupCB cb);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTranslateConstCallback )( \n            IXCLRDisassemblySupport * This,\n            /* [in] */ CDSTranslateConstCB cb);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTranslateRegrelCallback )( \n            IXCLRDisassemblySupport * This,\n            /* [in] */ CDSTranslateRegrelCB cb);\n        \n        BOOL ( STDMETHODCALLTYPE *TargetIsAddress )( \n            IXCLRDisassemblySupport * This);\n        \n        END_INTERFACE\n    } IXCLRDisassemblySupportVtbl;\n\n    interface IXCLRDisassemblySupport\n    {\n        CONST_VTBL struct IXCLRDisassemblySupportVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDisassemblySupport_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDisassemblySupport_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDisassemblySupport_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDisassemblySupport_SetTranslateAddrCallback(This,cb)\t\\\n    ( (This)->lpVtbl -> SetTranslateAddrCallback(This,cb) ) \n\n#define IXCLRDisassemblySupport_PvClientSet(This,pv)\t\\\n    ( (This)->lpVtbl -> PvClientSet(This,pv) ) \n\n#define IXCLRDisassemblySupport_CbDisassemble(This,__MIDL__IXCLRDisassemblySupport0000,__MIDL__IXCLRDisassemblySupport0001,__MIDL__IXCLRDisassemblySupport0002)\t\\\n    ( (This)->lpVtbl -> CbDisassemble(This,__MIDL__IXCLRDisassemblySupport0000,__MIDL__IXCLRDisassemblySupport0001,__MIDL__IXCLRDisassemblySupport0002) ) \n\n#define IXCLRDisassemblySupport_Cinstruction(This)\t\\\n    ( (This)->lpVtbl -> Cinstruction(This) ) \n\n#define IXCLRDisassemblySupport_FSelectInstruction(This,__MIDL__IXCLRDisassemblySupport0003)\t\\\n    ( (This)->lpVtbl -> FSelectInstruction(This,__MIDL__IXCLRDisassemblySupport0003) ) \n\n#define IXCLRDisassemblySupport_CchFormatInstr(This,__MIDL__IXCLRDisassemblySupport0004,__MIDL__IXCLRDisassemblySupport0005)\t\\\n    ( (This)->lpVtbl -> CchFormatInstr(This,__MIDL__IXCLRDisassemblySupport0004,__MIDL__IXCLRDisassemblySupport0005) ) \n\n#define IXCLRDisassemblySupport_PvClient(This)\t\\\n    ( (This)->lpVtbl -> PvClient(This) ) \n\n#define IXCLRDisassemblySupport_SetTranslateFixupCallback(This,cb)\t\\\n    ( (This)->lpVtbl -> SetTranslateFixupCallback(This,cb) ) \n\n#define IXCLRDisassemblySupport_SetTranslateConstCallback(This,cb)\t\\\n    ( (This)->lpVtbl -> SetTranslateConstCallback(This,cb) ) \n\n#define IXCLRDisassemblySupport_SetTranslateRegrelCallback(This,cb)\t\\\n    ( (This)->lpVtbl -> SetTranslateRegrelCallback(This,cb) ) \n\n#define IXCLRDisassemblySupport_TargetIsAddress(This)\t\\\n    ( (This)->lpVtbl -> TargetIsAddress(This) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDisassemblySupport_INTERFACE_DEFINED__ */\n\n\n#ifndef __IXCLRDataDisplay_INTERFACE_DEFINED__\n#define __IXCLRDataDisplay_INTERFACE_DEFINED__\n\n/* interface IXCLRDataDisplay */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataDisplay;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"A3C1704A-4559-4a67-8D28-E8F4FE3B3F62\")\n    IXCLRDataDisplay : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODVCALLTYPE ErrorPrintF(\n            const char *const fmt,\n            ...) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE NativeImageDimensions( \n            SIZE_T base,\n            SIZE_T size,\n            DWORD sectionAlign) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Section( \n            const char *const name,\n            SIZE_T rva,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDumpOptions( \n            /* [out] */ CLRNativeImageDumpOptions *pOptions) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartDocument( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndDocument( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartCategory( \n            const char *const name) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndCategory( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartElement( \n            const char *const name) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndElement( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartVStructure( \n            const char *const name) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartVStructureWithOffset( \n            const char *const name,\n            unsigned int fieldOffset,\n            unsigned int fieldSize) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndVStructure( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartTextElement( \n            const char *const name) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndTextElement( void) = 0;\n        \n        virtual HRESULT STDMETHODVCALLTYPE WriteXmlText(\n            const char *const fmt,\n            ...) = 0;\n        \n        virtual HRESULT STDMETHODVCALLTYPE WriteXmlTextBlock(\n            const char *const fmt,\n            ...) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteEmptyElement( \n            const char *const element) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementPointer( \n            const char *const element,\n            SIZE_T ptr) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementPointerAnnotated( \n            const char *const element,\n            SIZE_T ptr,\n            const WCHAR *const annotation) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementAddress( \n            const char *const element,\n            SIZE_T base,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementAddressNamed( \n            const char *const element,\n            const char *const name,\n            SIZE_T base,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementAddressNamedW( \n            const char *const element,\n            const WCHAR *const name,\n            SIZE_T base,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementString( \n            const char *const element,\n            const char *const data) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementStringW( \n            const char *const element,\n            const WCHAR *const data) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementInt( \n            const char *const element,\n            int value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementUInt( \n            const char *const element,\n            DWORD value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementEnumerated( \n            const char *const element,\n            DWORD value,\n            const WCHAR *const mnemonic) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementIntWithSuppress( \n            const char *const element,\n            int value,\n            int suppressIfEqual) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteElementFlag( \n            const char *const element,\n            BOOL flag) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartArray( \n            const char *const name,\n            const WCHAR *const fmt) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndArray( \n            const char *const countPrefix) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartList( \n            const WCHAR *const fmt) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndList( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartArrayWithOffset( \n            const char *const name,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            const WCHAR *const fmt) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldString( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            const char *const data) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldStringW( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            const WCHAR *const data) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldPointer( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldPointerWithSize( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldInt( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            int value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldUInt( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            DWORD value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldEnumerated( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            DWORD value,\n            const WCHAR *const mnemonic) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldEmpty( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldFlag( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            BOOL flag) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldPointerAnnotated( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr,\n            const WCHAR *const annotation) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE WriteFieldAddress( \n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T base,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartStructure( \n            const char *const name,\n            SIZE_T ptr,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartStructureWithNegSpace( \n            const char *const name,\n            SIZE_T ptr,\n            SIZE_T startPtr,\n            SIZE_T totalSize) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartStructureWithOffset( \n            const char *const name,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr,\n            SIZE_T size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndStructure( void) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataDisplayVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataDisplay * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataDisplay * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODVCALLTYPE *ErrorPrintF )(\n            IXCLRDataDisplay * This,\n            const char *const fmt,\n            ...);\n        \n        HRESULT ( STDMETHODCALLTYPE *NativeImageDimensions )( \n            IXCLRDataDisplay * This,\n            SIZE_T base,\n            SIZE_T size,\n            DWORD sectionAlign);\n        \n        HRESULT ( STDMETHODCALLTYPE *Section )( \n            IXCLRDataDisplay * This,\n            const char *const name,\n            SIZE_T rva,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDumpOptions )( \n            IXCLRDataDisplay * This,\n            /* [out] */ CLRNativeImageDumpOptions *pOptions);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartDocument )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndDocument )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartCategory )( \n            IXCLRDataDisplay * This,\n            const char *const name);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndCategory )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartElement )( \n            IXCLRDataDisplay * This,\n            const char *const name);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndElement )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartVStructure )( \n            IXCLRDataDisplay * This,\n            const char *const name);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartVStructureWithOffset )( \n            IXCLRDataDisplay * This,\n            const char *const name,\n            unsigned int fieldOffset,\n            unsigned int fieldSize);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndVStructure )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartTextElement )( \n            IXCLRDataDisplay * This,\n            const char *const name);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndTextElement )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODVCALLTYPE *WriteXmlText )(\n            IXCLRDataDisplay * This,\n            const char *const fmt,\n            ...);\n        \n        HRESULT ( STDMETHODVCALLTYPE *WriteXmlTextBlock )(\n            IXCLRDataDisplay * This,\n            const char *const fmt,\n            ...);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteEmptyElement )( \n            IXCLRDataDisplay * This,\n            const char *const element);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementPointer )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            SIZE_T ptr);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementPointerAnnotated )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            SIZE_T ptr,\n            const WCHAR *const annotation);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementAddress )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            SIZE_T base,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementAddressNamed )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            const char *const name,\n            SIZE_T base,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementAddressNamedW )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            const WCHAR *const name,\n            SIZE_T base,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementString )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            const char *const data);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementStringW )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            const WCHAR *const data);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementInt )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            int value);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementUInt )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            DWORD value);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementEnumerated )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            DWORD value,\n            const WCHAR *const mnemonic);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementIntWithSuppress )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            int value,\n            int suppressIfEqual);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteElementFlag )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            BOOL flag);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartArray )( \n            IXCLRDataDisplay * This,\n            const char *const name,\n            const WCHAR *const fmt);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndArray )( \n            IXCLRDataDisplay * This,\n            const char *const countPrefix);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartList )( \n            IXCLRDataDisplay * This,\n            const WCHAR *const fmt);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndList )( \n            IXCLRDataDisplay * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartArrayWithOffset )( \n            IXCLRDataDisplay * This,\n            const char *const name,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            const WCHAR *const fmt);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldString )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            const char *const data);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldStringW )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            const WCHAR *const data);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldPointer )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldPointerWithSize )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldInt )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            int value);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldUInt )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            DWORD value);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldEnumerated )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            DWORD value,\n            const WCHAR *const mnemonic);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldEmpty )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldFlag )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            BOOL flag);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldPointerAnnotated )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr,\n            const WCHAR *const annotation);\n        \n        HRESULT ( STDMETHODCALLTYPE *WriteFieldAddress )( \n            IXCLRDataDisplay * This,\n            const char *const element,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T base,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartStructure )( \n            IXCLRDataDisplay * This,\n            const char *const name,\n            SIZE_T ptr,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartStructureWithNegSpace )( \n            IXCLRDataDisplay * This,\n            const char *const name,\n            SIZE_T ptr,\n            SIZE_T startPtr,\n            SIZE_T totalSize);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartStructureWithOffset )( \n            IXCLRDataDisplay * This,\n            const char *const name,\n            unsigned int fieldOffset,\n            unsigned int fieldSize,\n            SIZE_T ptr,\n            SIZE_T size);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndStructure )( \n            IXCLRDataDisplay * This);\n        \n        END_INTERFACE\n    } IXCLRDataDisplayVtbl;\n\n    interface IXCLRDataDisplay\n    {\n        CONST_VTBL struct IXCLRDataDisplayVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataDisplay_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataDisplay_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataDisplay_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataDisplay_ErrorPrintF(This,fmt,...)\t\\\n    ( (This)->lpVtbl -> ErrorPrintF(This,fmt,...) ) \n\n#define IXCLRDataDisplay_NativeImageDimensions(This,base,size,sectionAlign)\t\\\n    ( (This)->lpVtbl -> NativeImageDimensions(This,base,size,sectionAlign) ) \n\n#define IXCLRDataDisplay_Section(This,name,rva,size)\t\\\n    ( (This)->lpVtbl -> Section(This,name,rva,size) ) \n\n#define IXCLRDataDisplay_GetDumpOptions(This,pOptions)\t\\\n    ( (This)->lpVtbl -> GetDumpOptions(This,pOptions) ) \n\n#define IXCLRDataDisplay_StartDocument(This)\t\\\n    ( (This)->lpVtbl -> StartDocument(This) ) \n\n#define IXCLRDataDisplay_EndDocument(This)\t\\\n    ( (This)->lpVtbl -> EndDocument(This) ) \n\n#define IXCLRDataDisplay_StartCategory(This,name)\t\\\n    ( (This)->lpVtbl -> StartCategory(This,name) ) \n\n#define IXCLRDataDisplay_EndCategory(This)\t\\\n    ( (This)->lpVtbl -> EndCategory(This) ) \n\n#define IXCLRDataDisplay_StartElement(This,name)\t\\\n    ( (This)->lpVtbl -> StartElement(This,name) ) \n\n#define IXCLRDataDisplay_EndElement(This)\t\\\n    ( (This)->lpVtbl -> EndElement(This) ) \n\n#define IXCLRDataDisplay_StartVStructure(This,name)\t\\\n    ( (This)->lpVtbl -> StartVStructure(This,name) ) \n\n#define IXCLRDataDisplay_StartVStructureWithOffset(This,name,fieldOffset,fieldSize)\t\\\n    ( (This)->lpVtbl -> StartVStructureWithOffset(This,name,fieldOffset,fieldSize) ) \n\n#define IXCLRDataDisplay_EndVStructure(This)\t\\\n    ( (This)->lpVtbl -> EndVStructure(This) ) \n\n#define IXCLRDataDisplay_StartTextElement(This,name)\t\\\n    ( (This)->lpVtbl -> StartTextElement(This,name) ) \n\n#define IXCLRDataDisplay_EndTextElement(This)\t\\\n    ( (This)->lpVtbl -> EndTextElement(This) ) \n\n#define IXCLRDataDisplay_WriteXmlText(This,fmt,...)\t\\\n    ( (This)->lpVtbl -> WriteXmlText(This,fmt,...) ) \n\n#define IXCLRDataDisplay_WriteXmlTextBlock(This,fmt,...)\t\\\n    ( (This)->lpVtbl -> WriteXmlTextBlock(This,fmt,...) ) \n\n#define IXCLRDataDisplay_WriteEmptyElement(This,element)\t\\\n    ( (This)->lpVtbl -> WriteEmptyElement(This,element) ) \n\n#define IXCLRDataDisplay_WriteElementPointer(This,element,ptr)\t\\\n    ( (This)->lpVtbl -> WriteElementPointer(This,element,ptr) ) \n\n#define IXCLRDataDisplay_WriteElementPointerAnnotated(This,element,ptr,annotation)\t\\\n    ( (This)->lpVtbl -> WriteElementPointerAnnotated(This,element,ptr,annotation) ) \n\n#define IXCLRDataDisplay_WriteElementAddress(This,element,base,size)\t\\\n    ( (This)->lpVtbl -> WriteElementAddress(This,element,base,size) ) \n\n#define IXCLRDataDisplay_WriteElementAddressNamed(This,element,name,base,size)\t\\\n    ( (This)->lpVtbl -> WriteElementAddressNamed(This,element,name,base,size) ) \n\n#define IXCLRDataDisplay_WriteElementAddressNamedW(This,element,name,base,size)\t\\\n    ( (This)->lpVtbl -> WriteElementAddressNamedW(This,element,name,base,size) ) \n\n#define IXCLRDataDisplay_WriteElementString(This,element,data)\t\\\n    ( (This)->lpVtbl -> WriteElementString(This,element,data) ) \n\n#define IXCLRDataDisplay_WriteElementStringW(This,element,data)\t\\\n    ( (This)->lpVtbl -> WriteElementStringW(This,element,data) ) \n\n#define IXCLRDataDisplay_WriteElementInt(This,element,value)\t\\\n    ( (This)->lpVtbl -> WriteElementInt(This,element,value) ) \n\n#define IXCLRDataDisplay_WriteElementUInt(This,element,value)\t\\\n    ( (This)->lpVtbl -> WriteElementUInt(This,element,value) ) \n\n#define IXCLRDataDisplay_WriteElementEnumerated(This,element,value,mnemonic)\t\\\n    ( (This)->lpVtbl -> WriteElementEnumerated(This,element,value,mnemonic) ) \n\n#define IXCLRDataDisplay_WriteElementIntWithSuppress(This,element,value,suppressIfEqual)\t\\\n    ( (This)->lpVtbl -> WriteElementIntWithSuppress(This,element,value,suppressIfEqual) ) \n\n#define IXCLRDataDisplay_WriteElementFlag(This,element,flag)\t\\\n    ( (This)->lpVtbl -> WriteElementFlag(This,element,flag) ) \n\n#define IXCLRDataDisplay_StartArray(This,name,fmt)\t\\\n    ( (This)->lpVtbl -> StartArray(This,name,fmt) ) \n\n#define IXCLRDataDisplay_EndArray(This,countPrefix)\t\\\n    ( (This)->lpVtbl -> EndArray(This,countPrefix) ) \n\n#define IXCLRDataDisplay_StartList(This,fmt)\t\\\n    ( (This)->lpVtbl -> StartList(This,fmt) ) \n\n#define IXCLRDataDisplay_EndList(This)\t\\\n    ( (This)->lpVtbl -> EndList(This) ) \n\n#define IXCLRDataDisplay_StartArrayWithOffset(This,name,fieldOffset,fieldSize,fmt)\t\\\n    ( (This)->lpVtbl -> StartArrayWithOffset(This,name,fieldOffset,fieldSize,fmt) ) \n\n#define IXCLRDataDisplay_WriteFieldString(This,element,fieldOffset,fieldSize,data)\t\\\n    ( (This)->lpVtbl -> WriteFieldString(This,element,fieldOffset,fieldSize,data) ) \n\n#define IXCLRDataDisplay_WriteFieldStringW(This,element,fieldOffset,fieldSize,data)\t\\\n    ( (This)->lpVtbl -> WriteFieldStringW(This,element,fieldOffset,fieldSize,data) ) \n\n#define IXCLRDataDisplay_WriteFieldPointer(This,element,fieldOffset,fieldSize,ptr)\t\\\n    ( (This)->lpVtbl -> WriteFieldPointer(This,element,fieldOffset,fieldSize,ptr) ) \n\n#define IXCLRDataDisplay_WriteFieldPointerWithSize(This,element,fieldOffset,fieldSize,ptr,size)\t\\\n    ( (This)->lpVtbl -> WriteFieldPointerWithSize(This,element,fieldOffset,fieldSize,ptr,size) ) \n\n#define IXCLRDataDisplay_WriteFieldInt(This,element,fieldOffset,fieldSize,value)\t\\\n    ( (This)->lpVtbl -> WriteFieldInt(This,element,fieldOffset,fieldSize,value) ) \n\n#define IXCLRDataDisplay_WriteFieldUInt(This,element,fieldOffset,fieldSize,value)\t\\\n    ( (This)->lpVtbl -> WriteFieldUInt(This,element,fieldOffset,fieldSize,value) ) \n\n#define IXCLRDataDisplay_WriteFieldEnumerated(This,element,fieldOffset,fieldSize,value,mnemonic)\t\\\n    ( (This)->lpVtbl -> WriteFieldEnumerated(This,element,fieldOffset,fieldSize,value,mnemonic) ) \n\n#define IXCLRDataDisplay_WriteFieldEmpty(This,element,fieldOffset,fieldSize)\t\\\n    ( (This)->lpVtbl -> WriteFieldEmpty(This,element,fieldOffset,fieldSize) ) \n\n#define IXCLRDataDisplay_WriteFieldFlag(This,element,fieldOffset,fieldSize,flag)\t\\\n    ( (This)->lpVtbl -> WriteFieldFlag(This,element,fieldOffset,fieldSize,flag) ) \n\n#define IXCLRDataDisplay_WriteFieldPointerAnnotated(This,element,fieldOffset,fieldSize,ptr,annotation)\t\\\n    ( (This)->lpVtbl -> WriteFieldPointerAnnotated(This,element,fieldOffset,fieldSize,ptr,annotation) ) \n\n#define IXCLRDataDisplay_WriteFieldAddress(This,element,fieldOffset,fieldSize,base,size)\t\\\n    ( (This)->lpVtbl -> WriteFieldAddress(This,element,fieldOffset,fieldSize,base,size) ) \n\n#define IXCLRDataDisplay_StartStructure(This,name,ptr,size)\t\\\n    ( (This)->lpVtbl -> StartStructure(This,name,ptr,size) ) \n\n#define IXCLRDataDisplay_StartStructureWithNegSpace(This,name,ptr,startPtr,totalSize)\t\\\n    ( (This)->lpVtbl -> StartStructureWithNegSpace(This,name,ptr,startPtr,totalSize) ) \n\n#define IXCLRDataDisplay_StartStructureWithOffset(This,name,fieldOffset,fieldSize,ptr,size)\t\\\n    ( (This)->lpVtbl -> StartStructureWithOffset(This,name,fieldOffset,fieldSize,ptr,size) ) \n\n#define IXCLRDataDisplay_EndStructure(This)\t\\\n    ( (This)->lpVtbl -> EndStructure(This) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataDisplay_INTERFACE_DEFINED__ */\n\n\n#ifndef __IXCLRDataProcess_INTERFACE_DEFINED__\n#define __IXCLRDataProcess_INTERFACE_DEFINED__\n\n/* interface IXCLRDataProcess */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataProcess;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"5c552ab6-fc09-4cb3-8e36-22fa03c798b7\")\n    IXCLRDataProcess : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Flush( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumTasks( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumTask( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTask **task) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumTasks( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTaskByOSThreadID( \n            /* [in] */ ULONG32 osThreadID,\n            /* [out] */ IXCLRDataTask **task) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTaskByUniqueID( \n            /* [in] */ ULONG64 taskID,\n            /* [out] */ IXCLRDataTask **task) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataProcess *process) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetManagedObject( \n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDesiredExecutionState( \n            /* [out] */ ULONG32 *state) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetDesiredExecutionState( \n            /* [in] */ ULONG32 state) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAddressType( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ CLRDataAddressType *type) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetRuntimeNameByAddress( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ CLRDATA_ADDRESS *displacement) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumAppDomains( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumAppDomain( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAppDomain **appDomain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumAppDomains( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAppDomainByUniqueID( \n            /* [in] */ ULONG64 id,\n            /* [out] */ IXCLRDataAppDomain **appDomain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumAssemblies( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumAssembly( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAssembly **assembly) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumAssemblies( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumModules( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumModule( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumModules( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetModuleByAddress( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodInstancesByAddress( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodInstanceByAddress( \n            /* [in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodInstancesByAddress( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDataByAddress( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataValue **value,\n            /* [out] */ CLRDATA_ADDRESS *displacement) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetExceptionStateByExceptionRecord( \n            /* [in] */ EXCEPTION_RECORD64 *record,\n            /* [out] */ IXCLRDataExceptionState **exState) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE TranslateExceptionRecordToNotification( \n            /* [in] */ EXCEPTION_RECORD64 *record,\n            /* [in] */ IXCLRDataExceptionNotification *notify) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CreateMemoryValue( \n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [in] */ IXCLRDataTypeInstance *type,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetAllTypeNotifications( \n            IXCLRDataModule *mod,\n            ULONG32 flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetAllCodeNotifications( \n            IXCLRDataModule *mod,\n            ULONG32 flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTypeNotifications( \n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdTypeDef tokens[  ],\n            /* [size_is][out] */ ULONG32 flags[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetTypeNotifications( \n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdTypeDef tokens[  ],\n            /* [size_is][in] */ ULONG32 flags[  ],\n            /* [in] */ ULONG32 singleFlags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCodeNotifications( \n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdMethodDef tokens[  ],\n            /* [size_is][out] */ ULONG32 flags[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetCodeNotifications( \n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdMethodDef tokens[  ],\n            /* [size_is][in] */ ULONG32 flags[  ],\n            /* [in] */ ULONG32 singleFlags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetOtherNotificationFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetOtherNotificationFlags( \n            /* [in] */ ULONG32 flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodDefinitionsByAddress( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodDefinitionByAddress( \n            /* [in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodDefinitionsByAddress( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE FollowStub( \n            /* [in] */ ULONG32 inFlags,\n            /* [in] */ CLRDATA_ADDRESS inAddr,\n            /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER *inBuffer,\n            /* [out] */ CLRDATA_ADDRESS *outAddr,\n            /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER *outBuffer,\n            /* [out] */ ULONG32 *outFlags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE FollowStub2( \n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 inFlags,\n            /* [in] */ CLRDATA_ADDRESS inAddr,\n            /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER *inBuffer,\n            /* [out] */ CLRDATA_ADDRESS *outAddr,\n            /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER *outBuffer,\n            /* [out] */ ULONG32 *outFlags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE DumpNativeImage( \n            /* [in] */ CLRDATA_ADDRESS loadedBase,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ IXCLRDataDisplay *display,\n            /* [in] */ IXCLRLibrarySupport *libSupport,\n            /* [in] */ IXCLRDisassemblySupport *dis) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataProcessVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataProcess * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataProcess * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataProcess * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Flush )( \n            IXCLRDataProcess * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumTasks )( \n            IXCLRDataProcess * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumTask )( \n            IXCLRDataProcess * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTask **task);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumTasks )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTaskByOSThreadID )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 osThreadID,\n            /* [out] */ IXCLRDataTask **task);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTaskByUniqueID )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG64 taskID,\n            /* [out] */ IXCLRDataTask **task);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataProcess * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataProcess * This,\n            /* [in] */ IXCLRDataProcess *process);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetManagedObject )( \n            IXCLRDataProcess * This,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDesiredExecutionState )( \n            IXCLRDataProcess * This,\n            /* [out] */ ULONG32 *state);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetDesiredExecutionState )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddressType )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ CLRDataAddressType *type);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeNameByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ CLRDATA_ADDRESS *displacement);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumAppDomains )( \n            IXCLRDataProcess * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAppDomain )( \n            IXCLRDataProcess * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumAppDomains )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainByUniqueID )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG64 id,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumAssemblies )( \n            IXCLRDataProcess * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAssembly )( \n            IXCLRDataProcess * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAssembly **assembly);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumAssemblies )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumModules )( \n            IXCLRDataProcess * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumModule )( \n            IXCLRDataProcess * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumModules )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetModuleByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodInstancesByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodInstanceByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodInstancesByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDataByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataValue **value,\n            /* [out] */ CLRDATA_ADDRESS *displacement);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetExceptionStateByExceptionRecord )( \n            IXCLRDataProcess * This,\n            /* [in] */ EXCEPTION_RECORD64 *record,\n            /* [out] */ IXCLRDataExceptionState **exState);\n        \n        HRESULT ( STDMETHODCALLTYPE *TranslateExceptionRecordToNotification )( \n            IXCLRDataProcess * This,\n            /* [in] */ EXCEPTION_RECORD64 *record,\n            /* [in] */ IXCLRDataExceptionNotification *notify);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *CreateMemoryValue )( \n            IXCLRDataProcess * This,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [in] */ IXCLRDataTypeInstance *type,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetAllTypeNotifications )( \n            IXCLRDataProcess * This,\n            IXCLRDataModule *mod,\n            ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetAllCodeNotifications )( \n            IXCLRDataProcess * This,\n            IXCLRDataModule *mod,\n            ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeNotifications )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdTypeDef tokens[  ],\n            /* [size_is][out] */ ULONG32 flags[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTypeNotifications )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdTypeDef tokens[  ],\n            /* [size_is][in] */ ULONG32 flags[  ],\n            /* [in] */ ULONG32 singleFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCodeNotifications )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdMethodDef tokens[  ],\n            /* [size_is][out] */ ULONG32 flags[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetCodeNotifications )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdMethodDef tokens[  ],\n            /* [size_is][in] */ ULONG32 flags[  ],\n            /* [in] */ ULONG32 singleFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetOtherNotificationFlags )( \n            IXCLRDataProcess * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetOtherNotificationFlags )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodDefinitionsByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodDefinitionByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodDefinitionsByAddress )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *FollowStub )( \n            IXCLRDataProcess * This,\n            /* [in] */ ULONG32 inFlags,\n            /* [in] */ CLRDATA_ADDRESS inAddr,\n            /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER *inBuffer,\n            /* [out] */ CLRDATA_ADDRESS *outAddr,\n            /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER *outBuffer,\n            /* [out] */ ULONG32 *outFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *FollowStub2 )( \n            IXCLRDataProcess * This,\n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 inFlags,\n            /* [in] */ CLRDATA_ADDRESS inAddr,\n            /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER *inBuffer,\n            /* [out] */ CLRDATA_ADDRESS *outAddr,\n            /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER *outBuffer,\n            /* [out] */ ULONG32 *outFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *DumpNativeImage )( \n            IXCLRDataProcess * This,\n            /* [in] */ CLRDATA_ADDRESS loadedBase,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ IXCLRDataDisplay *display,\n            /* [in] */ IXCLRLibrarySupport *libSupport,\n            /* [in] */ IXCLRDisassemblySupport *dis);\n        \n        END_INTERFACE\n    } IXCLRDataProcessVtbl;\n\n    interface IXCLRDataProcess\n    {\n        CONST_VTBL struct IXCLRDataProcessVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataProcess_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataProcess_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataProcess_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataProcess_Flush(This)\t\\\n    ( (This)->lpVtbl -> Flush(This) ) \n\n#define IXCLRDataProcess_StartEnumTasks(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumTasks(This,handle) ) \n\n#define IXCLRDataProcess_EnumTask(This,handle,task)\t\\\n    ( (This)->lpVtbl -> EnumTask(This,handle,task) ) \n\n#define IXCLRDataProcess_EndEnumTasks(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumTasks(This,handle) ) \n\n#define IXCLRDataProcess_GetTaskByOSThreadID(This,osThreadID,task)\t\\\n    ( (This)->lpVtbl -> GetTaskByOSThreadID(This,osThreadID,task) ) \n\n#define IXCLRDataProcess_GetTaskByUniqueID(This,taskID,task)\t\\\n    ( (This)->lpVtbl -> GetTaskByUniqueID(This,taskID,task) ) \n\n#define IXCLRDataProcess_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataProcess_IsSameObject(This,process)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,process) ) \n\n#define IXCLRDataProcess_GetManagedObject(This,value)\t\\\n    ( (This)->lpVtbl -> GetManagedObject(This,value) ) \n\n#define IXCLRDataProcess_GetDesiredExecutionState(This,state)\t\\\n    ( (This)->lpVtbl -> GetDesiredExecutionState(This,state) ) \n\n#define IXCLRDataProcess_SetDesiredExecutionState(This,state)\t\\\n    ( (This)->lpVtbl -> SetDesiredExecutionState(This,state) ) \n\n#define IXCLRDataProcess_GetAddressType(This,address,type)\t\\\n    ( (This)->lpVtbl -> GetAddressType(This,address,type) ) \n\n#define IXCLRDataProcess_GetRuntimeNameByAddress(This,address,flags,bufLen,nameLen,nameBuf,displacement)\t\\\n    ( (This)->lpVtbl -> GetRuntimeNameByAddress(This,address,flags,bufLen,nameLen,nameBuf,displacement) ) \n\n#define IXCLRDataProcess_StartEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumAppDomains(This,handle) ) \n\n#define IXCLRDataProcess_EnumAppDomain(This,handle,appDomain)\t\\\n    ( (This)->lpVtbl -> EnumAppDomain(This,handle,appDomain) ) \n\n#define IXCLRDataProcess_EndEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumAppDomains(This,handle) ) \n\n#define IXCLRDataProcess_GetAppDomainByUniqueID(This,id,appDomain)\t\\\n    ( (This)->lpVtbl -> GetAppDomainByUniqueID(This,id,appDomain) ) \n\n#define IXCLRDataProcess_StartEnumAssemblies(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumAssemblies(This,handle) ) \n\n#define IXCLRDataProcess_EnumAssembly(This,handle,assembly)\t\\\n    ( (This)->lpVtbl -> EnumAssembly(This,handle,assembly) ) \n\n#define IXCLRDataProcess_EndEnumAssemblies(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumAssemblies(This,handle) ) \n\n#define IXCLRDataProcess_StartEnumModules(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumModules(This,handle) ) \n\n#define IXCLRDataProcess_EnumModule(This,handle,mod)\t\\\n    ( (This)->lpVtbl -> EnumModule(This,handle,mod) ) \n\n#define IXCLRDataProcess_EndEnumModules(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumModules(This,handle) ) \n\n#define IXCLRDataProcess_GetModuleByAddress(This,address,mod)\t\\\n    ( (This)->lpVtbl -> GetModuleByAddress(This,address,mod) ) \n\n#define IXCLRDataProcess_StartEnumMethodInstancesByAddress(This,address,appDomain,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodInstancesByAddress(This,address,appDomain,handle) ) \n\n#define IXCLRDataProcess_EnumMethodInstanceByAddress(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodInstanceByAddress(This,handle,method) ) \n\n#define IXCLRDataProcess_EndEnumMethodInstancesByAddress(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodInstancesByAddress(This,handle) ) \n\n#define IXCLRDataProcess_GetDataByAddress(This,address,flags,appDomain,tlsTask,bufLen,nameLen,nameBuf,value,displacement)\t\\\n    ( (This)->lpVtbl -> GetDataByAddress(This,address,flags,appDomain,tlsTask,bufLen,nameLen,nameBuf,value,displacement) ) \n\n#define IXCLRDataProcess_GetExceptionStateByExceptionRecord(This,record,exState)\t\\\n    ( (This)->lpVtbl -> GetExceptionStateByExceptionRecord(This,record,exState) ) \n\n#define IXCLRDataProcess_TranslateExceptionRecordToNotification(This,record,notify)\t\\\n    ( (This)->lpVtbl -> TranslateExceptionRecordToNotification(This,record,notify) ) \n\n#define IXCLRDataProcess_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataProcess_CreateMemoryValue(This,appDomain,tlsTask,type,addr,value)\t\\\n    ( (This)->lpVtbl -> CreateMemoryValue(This,appDomain,tlsTask,type,addr,value) ) \n\n#define IXCLRDataProcess_SetAllTypeNotifications(This,mod,flags)\t\\\n    ( (This)->lpVtbl -> SetAllTypeNotifications(This,mod,flags) ) \n\n#define IXCLRDataProcess_SetAllCodeNotifications(This,mod,flags)\t\\\n    ( (This)->lpVtbl -> SetAllCodeNotifications(This,mod,flags) ) \n\n#define IXCLRDataProcess_GetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags)\t\\\n    ( (This)->lpVtbl -> GetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags) ) \n\n#define IXCLRDataProcess_SetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags)\t\\\n    ( (This)->lpVtbl -> SetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags) ) \n\n#define IXCLRDataProcess_GetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags)\t\\\n    ( (This)->lpVtbl -> GetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags) ) \n\n#define IXCLRDataProcess_SetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags)\t\\\n    ( (This)->lpVtbl -> SetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags) ) \n\n#define IXCLRDataProcess_GetOtherNotificationFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetOtherNotificationFlags(This,flags) ) \n\n#define IXCLRDataProcess_SetOtherNotificationFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> SetOtherNotificationFlags(This,flags) ) \n\n#define IXCLRDataProcess_StartEnumMethodDefinitionsByAddress(This,address,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodDefinitionsByAddress(This,address,handle) ) \n\n#define IXCLRDataProcess_EnumMethodDefinitionByAddress(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodDefinitionByAddress(This,handle,method) ) \n\n#define IXCLRDataProcess_EndEnumMethodDefinitionsByAddress(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodDefinitionsByAddress(This,handle) ) \n\n#define IXCLRDataProcess_FollowStub(This,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags)\t\\\n    ( (This)->lpVtbl -> FollowStub(This,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags) ) \n\n#define IXCLRDataProcess_FollowStub2(This,task,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags)\t\\\n    ( (This)->lpVtbl -> FollowStub2(This,task,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags) ) \n\n#define IXCLRDataProcess_DumpNativeImage(This,loadedBase,name,display,libSupport,dis)\t\\\n    ( (This)->lpVtbl -> DumpNativeImage(This,loadedBase,name,display,libSupport,dis) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataProcess_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0005 */\n/* [local] */ \n\n#pragma warning(pop)\ntypedef /* [public][public][public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0005_0001\n    {\n        GC_MARK_END\t= 1,\n        GC_EVENT_TYPE_MAX\t= ( GC_MARK_END + 1 ) \n    } \tGcEvt_t;\n\ntypedef /* [public][public][public][public] */ struct __MIDL___MIDL_itf_xclrdata_0000_0005_0002\n    {\n    GcEvt_t typ;\n    /* [switch_is] */ /* [switch_type] */ union \n        {\n        /* [case()] */ int condemnedGeneration;\n        } \t;\n    } \tGcEvtArgs;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0005_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0005_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataProcess2_INTERFACE_DEFINED__\n#define __IXCLRDataProcess2_INTERFACE_DEFINED__\n\n/* interface IXCLRDataProcess2 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataProcess2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"5c552ab6-fc09-4cb3-8e36-22fa03c798b8\")\n    IXCLRDataProcess2 : public IXCLRDataProcess\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetGcNotification( \n            /* [out][in] */ GcEvtArgs *gcEvtArgs) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetGcNotification( \n            /* [in] */ GcEvtArgs gcEvtArgs) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataProcess2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataProcess2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataProcess2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Flush )( \n            IXCLRDataProcess2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumTasks )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumTask )( \n            IXCLRDataProcess2 * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTask **task);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumTasks )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTaskByOSThreadID )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 osThreadID,\n            /* [out] */ IXCLRDataTask **task);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTaskByUniqueID )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG64 taskID,\n            /* [out] */ IXCLRDataTask **task);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ IXCLRDataProcess *process);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetManagedObject )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDesiredExecutionState )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ ULONG32 *state);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetDesiredExecutionState )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddressType )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ CLRDataAddressType *type);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRuntimeNameByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ CLRDATA_ADDRESS *displacement);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumAppDomains )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAppDomain )( \n            IXCLRDataProcess2 * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumAppDomains )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAppDomainByUniqueID )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG64 id,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumAssemblies )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAssembly )( \n            IXCLRDataProcess2 * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAssembly **assembly);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumAssemblies )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumModules )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumModule )( \n            IXCLRDataProcess2 * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumModules )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetModuleByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodInstancesByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodInstanceByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodInstancesByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDataByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataValue **value,\n            /* [out] */ CLRDATA_ADDRESS *displacement);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetExceptionStateByExceptionRecord )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ EXCEPTION_RECORD64 *record,\n            /* [out] */ IXCLRDataExceptionState **exState);\n        \n        HRESULT ( STDMETHODCALLTYPE *TranslateExceptionRecordToNotification )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ EXCEPTION_RECORD64 *record,\n            /* [in] */ IXCLRDataExceptionNotification *notify);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *CreateMemoryValue )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [in] */ IXCLRDataTypeInstance *type,\n            /* [in] */ CLRDATA_ADDRESS addr,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetAllTypeNotifications )( \n            IXCLRDataProcess2 * This,\n            IXCLRDataModule *mod,\n            ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetAllCodeNotifications )( \n            IXCLRDataProcess2 * This,\n            IXCLRDataModule *mod,\n            ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeNotifications )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdTypeDef tokens[  ],\n            /* [size_is][out] */ ULONG32 flags[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTypeNotifications )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdTypeDef tokens[  ],\n            /* [size_is][in] */ ULONG32 flags[  ],\n            /* [in] */ ULONG32 singleFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCodeNotifications )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdMethodDef tokens[  ],\n            /* [size_is][out] */ ULONG32 flags[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetCodeNotifications )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 numTokens,\n            /* [size_is][in] */ IXCLRDataModule *mods[  ],\n            /* [in] */ IXCLRDataModule *singleMod,\n            /* [size_is][in] */ mdMethodDef tokens[  ],\n            /* [size_is][in] */ ULONG32 flags[  ],\n            /* [in] */ ULONG32 singleFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetOtherNotificationFlags )( \n            IXCLRDataProcess2 * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetOtherNotificationFlags )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodDefinitionsByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodDefinitionByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodDefinitionsByAddress )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *FollowStub )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ ULONG32 inFlags,\n            /* [in] */ CLRDATA_ADDRESS inAddr,\n            /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER *inBuffer,\n            /* [out] */ CLRDATA_ADDRESS *outAddr,\n            /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER *outBuffer,\n            /* [out] */ ULONG32 *outFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *FollowStub2 )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 inFlags,\n            /* [in] */ CLRDATA_ADDRESS inAddr,\n            /* [in] */ CLRDATA_FOLLOW_STUB_BUFFER *inBuffer,\n            /* [out] */ CLRDATA_ADDRESS *outAddr,\n            /* [out] */ CLRDATA_FOLLOW_STUB_BUFFER *outBuffer,\n            /* [out] */ ULONG32 *outFlags);\n        \n        HRESULT ( STDMETHODCALLTYPE *DumpNativeImage )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ CLRDATA_ADDRESS loadedBase,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ IXCLRDataDisplay *display,\n            /* [in] */ IXCLRLibrarySupport *libSupport,\n            /* [in] */ IXCLRDisassemblySupport *dis);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetGcNotification )( \n            IXCLRDataProcess2 * This,\n            /* [out][in] */ GcEvtArgs *gcEvtArgs);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetGcNotification )( \n            IXCLRDataProcess2 * This,\n            /* [in] */ GcEvtArgs gcEvtArgs);\n        \n        END_INTERFACE\n    } IXCLRDataProcess2Vtbl;\n\n    interface IXCLRDataProcess2\n    {\n        CONST_VTBL struct IXCLRDataProcess2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataProcess2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataProcess2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataProcess2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataProcess2_Flush(This)\t\\\n    ( (This)->lpVtbl -> Flush(This) ) \n\n#define IXCLRDataProcess2_StartEnumTasks(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumTasks(This,handle) ) \n\n#define IXCLRDataProcess2_EnumTask(This,handle,task)\t\\\n    ( (This)->lpVtbl -> EnumTask(This,handle,task) ) \n\n#define IXCLRDataProcess2_EndEnumTasks(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumTasks(This,handle) ) \n\n#define IXCLRDataProcess2_GetTaskByOSThreadID(This,osThreadID,task)\t\\\n    ( (This)->lpVtbl -> GetTaskByOSThreadID(This,osThreadID,task) ) \n\n#define IXCLRDataProcess2_GetTaskByUniqueID(This,taskID,task)\t\\\n    ( (This)->lpVtbl -> GetTaskByUniqueID(This,taskID,task) ) \n\n#define IXCLRDataProcess2_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataProcess2_IsSameObject(This,process)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,process) ) \n\n#define IXCLRDataProcess2_GetManagedObject(This,value)\t\\\n    ( (This)->lpVtbl -> GetManagedObject(This,value) ) \n\n#define IXCLRDataProcess2_GetDesiredExecutionState(This,state)\t\\\n    ( (This)->lpVtbl -> GetDesiredExecutionState(This,state) ) \n\n#define IXCLRDataProcess2_SetDesiredExecutionState(This,state)\t\\\n    ( (This)->lpVtbl -> SetDesiredExecutionState(This,state) ) \n\n#define IXCLRDataProcess2_GetAddressType(This,address,type)\t\\\n    ( (This)->lpVtbl -> GetAddressType(This,address,type) ) \n\n#define IXCLRDataProcess2_GetRuntimeNameByAddress(This,address,flags,bufLen,nameLen,nameBuf,displacement)\t\\\n    ( (This)->lpVtbl -> GetRuntimeNameByAddress(This,address,flags,bufLen,nameLen,nameBuf,displacement) ) \n\n#define IXCLRDataProcess2_StartEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumAppDomains(This,handle) ) \n\n#define IXCLRDataProcess2_EnumAppDomain(This,handle,appDomain)\t\\\n    ( (This)->lpVtbl -> EnumAppDomain(This,handle,appDomain) ) \n\n#define IXCLRDataProcess2_EndEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumAppDomains(This,handle) ) \n\n#define IXCLRDataProcess2_GetAppDomainByUniqueID(This,id,appDomain)\t\\\n    ( (This)->lpVtbl -> GetAppDomainByUniqueID(This,id,appDomain) ) \n\n#define IXCLRDataProcess2_StartEnumAssemblies(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumAssemblies(This,handle) ) \n\n#define IXCLRDataProcess2_EnumAssembly(This,handle,assembly)\t\\\n    ( (This)->lpVtbl -> EnumAssembly(This,handle,assembly) ) \n\n#define IXCLRDataProcess2_EndEnumAssemblies(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumAssemblies(This,handle) ) \n\n#define IXCLRDataProcess2_StartEnumModules(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumModules(This,handle) ) \n\n#define IXCLRDataProcess2_EnumModule(This,handle,mod)\t\\\n    ( (This)->lpVtbl -> EnumModule(This,handle,mod) ) \n\n#define IXCLRDataProcess2_EndEnumModules(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumModules(This,handle) ) \n\n#define IXCLRDataProcess2_GetModuleByAddress(This,address,mod)\t\\\n    ( (This)->lpVtbl -> GetModuleByAddress(This,address,mod) ) \n\n#define IXCLRDataProcess2_StartEnumMethodInstancesByAddress(This,address,appDomain,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodInstancesByAddress(This,address,appDomain,handle) ) \n\n#define IXCLRDataProcess2_EnumMethodInstanceByAddress(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodInstanceByAddress(This,handle,method) ) \n\n#define IXCLRDataProcess2_EndEnumMethodInstancesByAddress(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodInstancesByAddress(This,handle) ) \n\n#define IXCLRDataProcess2_GetDataByAddress(This,address,flags,appDomain,tlsTask,bufLen,nameLen,nameBuf,value,displacement)\t\\\n    ( (This)->lpVtbl -> GetDataByAddress(This,address,flags,appDomain,tlsTask,bufLen,nameLen,nameBuf,value,displacement) ) \n\n#define IXCLRDataProcess2_GetExceptionStateByExceptionRecord(This,record,exState)\t\\\n    ( (This)->lpVtbl -> GetExceptionStateByExceptionRecord(This,record,exState) ) \n\n#define IXCLRDataProcess2_TranslateExceptionRecordToNotification(This,record,notify)\t\\\n    ( (This)->lpVtbl -> TranslateExceptionRecordToNotification(This,record,notify) ) \n\n#define IXCLRDataProcess2_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataProcess2_CreateMemoryValue(This,appDomain,tlsTask,type,addr,value)\t\\\n    ( (This)->lpVtbl -> CreateMemoryValue(This,appDomain,tlsTask,type,addr,value) ) \n\n#define IXCLRDataProcess2_SetAllTypeNotifications(This,mod,flags)\t\\\n    ( (This)->lpVtbl -> SetAllTypeNotifications(This,mod,flags) ) \n\n#define IXCLRDataProcess2_SetAllCodeNotifications(This,mod,flags)\t\\\n    ( (This)->lpVtbl -> SetAllCodeNotifications(This,mod,flags) ) \n\n#define IXCLRDataProcess2_GetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags)\t\\\n    ( (This)->lpVtbl -> GetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags) ) \n\n#define IXCLRDataProcess2_SetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags)\t\\\n    ( (This)->lpVtbl -> SetTypeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags) ) \n\n#define IXCLRDataProcess2_GetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags)\t\\\n    ( (This)->lpVtbl -> GetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags) ) \n\n#define IXCLRDataProcess2_SetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags)\t\\\n    ( (This)->lpVtbl -> SetCodeNotifications(This,numTokens,mods,singleMod,tokens,flags,singleFlags) ) \n\n#define IXCLRDataProcess2_GetOtherNotificationFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetOtherNotificationFlags(This,flags) ) \n\n#define IXCLRDataProcess2_SetOtherNotificationFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> SetOtherNotificationFlags(This,flags) ) \n\n#define IXCLRDataProcess2_StartEnumMethodDefinitionsByAddress(This,address,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodDefinitionsByAddress(This,address,handle) ) \n\n#define IXCLRDataProcess2_EnumMethodDefinitionByAddress(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodDefinitionByAddress(This,handle,method) ) \n\n#define IXCLRDataProcess2_EndEnumMethodDefinitionsByAddress(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodDefinitionsByAddress(This,handle) ) \n\n#define IXCLRDataProcess2_FollowStub(This,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags)\t\\\n    ( (This)->lpVtbl -> FollowStub(This,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags) ) \n\n#define IXCLRDataProcess2_FollowStub2(This,task,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags)\t\\\n    ( (This)->lpVtbl -> FollowStub2(This,task,inFlags,inAddr,inBuffer,outAddr,outBuffer,outFlags) ) \n\n#define IXCLRDataProcess2_DumpNativeImage(This,loadedBase,name,display,libSupport,dis)\t\\\n    ( (This)->lpVtbl -> DumpNativeImage(This,loadedBase,name,display,libSupport,dis) ) \n\n\n#define IXCLRDataProcess2_GetGcNotification(This,gcEvtArgs)\t\\\n    ( (This)->lpVtbl -> GetGcNotification(This,gcEvtArgs) ) \n\n#define IXCLRDataProcess2_SetGcNotification(This,gcEvtArgs)\t\\\n    ( (This)->lpVtbl -> SetGcNotification(This,gcEvtArgs) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataProcess2_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0006 */\n/* [local] */ \n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0006_0001\n    {\n        CLRDATA_DOMAIN_DEFAULT\t= 0\n    } \tCLRDataAppDomainFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0006_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0006_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataAppDomain_INTERFACE_DEFINED__\n#define __IXCLRDataAppDomain_INTERFACE_DEFINED__\n\n/* interface IXCLRDataAppDomain */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataAppDomain;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"7CA04601-C702-4670-A63C-FA44F7DA7BD5\")\n    IXCLRDataAppDomain : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetProcess( \n            /* [out] */ IXCLRDataProcess **process) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetUniqueID( \n            /* [out] */ ULONG64 *id) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataAppDomain *appDomain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetManagedObject( \n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataAppDomainVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataAppDomain * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataAppDomain * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataAppDomain * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetProcess )( \n            IXCLRDataAppDomain * This,\n            /* [out] */ IXCLRDataProcess **process);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataAppDomain * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetUniqueID )( \n            IXCLRDataAppDomain * This,\n            /* [out] */ ULONG64 *id);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataAppDomain * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataAppDomain * This,\n            /* [in] */ IXCLRDataAppDomain *appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetManagedObject )( \n            IXCLRDataAppDomain * This,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataAppDomain * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        END_INTERFACE\n    } IXCLRDataAppDomainVtbl;\n\n    interface IXCLRDataAppDomain\n    {\n        CONST_VTBL struct IXCLRDataAppDomainVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataAppDomain_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataAppDomain_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataAppDomain_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataAppDomain_GetProcess(This,process)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,process) ) \n\n#define IXCLRDataAppDomain_GetName(This,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetName(This,bufLen,nameLen,name) ) \n\n#define IXCLRDataAppDomain_GetUniqueID(This,id)\t\\\n    ( (This)->lpVtbl -> GetUniqueID(This,id) ) \n\n#define IXCLRDataAppDomain_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataAppDomain_IsSameObject(This,appDomain)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,appDomain) ) \n\n#define IXCLRDataAppDomain_GetManagedObject(This,value)\t\\\n    ( (This)->lpVtbl -> GetManagedObject(This,value) ) \n\n#define IXCLRDataAppDomain_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataAppDomain_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0007 */\n/* [local] */ \n\n#pragma warning(pop)\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0007_0001\n    {\n        CLRDATA_ASSEMBLY_DEFAULT\t= 0\n    } \tCLRDataAssemblyFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0007_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0007_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataAssembly_INTERFACE_DEFINED__\n#define __IXCLRDataAssembly_INTERFACE_DEFINED__\n\n/* interface IXCLRDataAssembly */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataAssembly;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"2FA17588-43C2-46ab-9B51-C8F01E39C9AC\")\n    IXCLRDataAssembly : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE StartEnumModules( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumModule( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumModules( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFileName( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataAssembly *assembly) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumAppDomains( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumAppDomain( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAppDomain **appDomain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumAppDomains( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDisplayName( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataAssemblyVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataAssembly * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataAssembly * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataAssembly * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumModules )( \n            IXCLRDataAssembly * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumModule )( \n            IXCLRDataAssembly * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumModules )( \n            IXCLRDataAssembly * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataAssembly * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFileName )( \n            IXCLRDataAssembly * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataAssembly * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataAssembly * This,\n            /* [in] */ IXCLRDataAssembly *assembly);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataAssembly * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumAppDomains )( \n            IXCLRDataAssembly * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAppDomain )( \n            IXCLRDataAssembly * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumAppDomains )( \n            IXCLRDataAssembly * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDisplayName )( \n            IXCLRDataAssembly * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        END_INTERFACE\n    } IXCLRDataAssemblyVtbl;\n\n    interface IXCLRDataAssembly\n    {\n        CONST_VTBL struct IXCLRDataAssemblyVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataAssembly_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataAssembly_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataAssembly_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataAssembly_StartEnumModules(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumModules(This,handle) ) \n\n#define IXCLRDataAssembly_EnumModule(This,handle,mod)\t\\\n    ( (This)->lpVtbl -> EnumModule(This,handle,mod) ) \n\n#define IXCLRDataAssembly_EndEnumModules(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumModules(This,handle) ) \n\n#define IXCLRDataAssembly_GetName(This,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetName(This,bufLen,nameLen,name) ) \n\n#define IXCLRDataAssembly_GetFileName(This,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetFileName(This,bufLen,nameLen,name) ) \n\n#define IXCLRDataAssembly_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataAssembly_IsSameObject(This,assembly)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,assembly) ) \n\n#define IXCLRDataAssembly_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataAssembly_StartEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumAppDomains(This,handle) ) \n\n#define IXCLRDataAssembly_EnumAppDomain(This,handle,appDomain)\t\\\n    ( (This)->lpVtbl -> EnumAppDomain(This,handle,appDomain) ) \n\n#define IXCLRDataAssembly_EndEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumAppDomains(This,handle) ) \n\n#define IXCLRDataAssembly_GetDisplayName(This,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetDisplayName(This,bufLen,nameLen,name) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataAssembly_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0008 */\n/* [local] */ \n\n#pragma warning(pop)\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0008_0001\n    {\n        CLRDATA_MODULE_DEFAULT\t= 0,\n        CLRDATA_MODULE_IS_DYNAMIC\t= 0x1,\n        CLRDATA_MODULE_IS_MEMORY_STREAM\t= 0x2,\n        CLRDATA_MODULE_IS_MAIN_MODULE = 0x4\n    } \tCLRDataModuleFlag;\n\ntypedef /* [public][public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0008_0002\n    {\n        CLRDATA_MODULE_PE_FILE\t= 0,\n        CLRDATA_MODULE_PREJIT_FILE\t= ( CLRDATA_MODULE_PE_FILE + 1 ) ,\n        CLRDATA_MODULE_MEMORY_STREAM\t= ( CLRDATA_MODULE_PREJIT_FILE + 1 ) ,\n        CLRDATA_MODULE_OTHER\t= ( CLRDATA_MODULE_MEMORY_STREAM + 1 ) \n    } \tCLRDataModuleExtentType;\n\ntypedef /* [public][public] */ struct __MIDL___MIDL_itf_xclrdata_0000_0008_0003\n    {\n    CLRDATA_ADDRESS base;\n    ULONG32 length;\n    CLRDataModuleExtentType type;\n    } \tCLRDATA_MODULE_EXTENT;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0008_0004\n    {\n        CLRDATA_TYPENOTIFY_NONE\t= 0,\n        CLRDATA_TYPENOTIFY_LOADED\t= 0x1,\n        CLRDATA_TYPENOTIFY_UNLOADED\t= 0x2\n    } \tCLRDataTypeNotification;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0008_0005\n    {\n        CLRDATA_METHNOTIFY_NONE\t= 0,\n        CLRDATA_METHNOTIFY_GENERATED\t= 0x1,\n        CLRDATA_METHNOTIFY_DISCARDED\t= 0x2\n    } \tCLRDataMethodCodeNotification;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0008_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0008_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataModule_INTERFACE_DEFINED__\n#define __IXCLRDataModule_INTERFACE_DEFINED__\n\n/* interface IXCLRDataModule */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataModule;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"88E32849-0A0A-4cb0-9022-7CD2E9E139E2\")\n    IXCLRDataModule : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE StartEnumAssemblies( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumAssembly( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAssembly **assembly) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumAssemblies( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumTypeDefinitions( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumTypeDefinition( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumTypeDefinitions( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumTypeInstances( \n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumTypeInstance( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeInstance **typeInstance) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumTypeInstances( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumTypeDefinitionsByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumTypeDefinitionByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **type) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumTypeDefinitionsByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumTypeInstancesByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumTypeInstanceByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeInstance **type) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumTypeInstancesByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTypeDefinitionByToken( \n            /* [in] */ mdTypeDef token,\n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodDefinitionsByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodDefinitionByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodDefinitionsByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodInstancesByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodInstanceByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodInstancesByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodDefinitionByToken( \n            /* [in] */ mdMethodDef token,\n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumDataByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumDataByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumDataByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFileName( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataModule *mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumExtents( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumExtent( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ CLRDATA_MODULE_EXTENT *extent) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumExtents( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumAppDomains( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumAppDomain( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAppDomain **appDomain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumAppDomains( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetVersionId( \n            /* [out] */ GUID *vid) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataModuleVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataModule * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataModule * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataModule * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumAssemblies )( \n            IXCLRDataModule * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAssembly )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAssembly **assembly);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumAssemblies )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumTypeDefinitions )( \n            IXCLRDataModule * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumTypeDefinition )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumTypeDefinitions )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumTypeInstances )( \n            IXCLRDataModule * This,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumTypeInstance )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeInstance **typeInstance);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumTypeInstances )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumTypeDefinitionsByName )( \n            IXCLRDataModule * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumTypeDefinitionByName )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **type);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumTypeDefinitionsByName )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumTypeInstancesByName )( \n            IXCLRDataModule * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumTypeInstanceByName )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeInstance **type);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumTypeInstancesByName )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeDefinitionByToken )( \n            IXCLRDataModule * This,\n            /* [in] */ mdTypeDef token,\n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodDefinitionsByName )( \n            IXCLRDataModule * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodDefinitionByName )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodDefinitionsByName )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodInstancesByName )( \n            IXCLRDataModule * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodInstanceByName )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodInstancesByName )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodDefinitionByToken )( \n            IXCLRDataModule * This,\n            /* [in] */ mdMethodDef token,\n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumDataByName )( \n            IXCLRDataModule * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumDataByName )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumDataByName )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataModule * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFileName )( \n            IXCLRDataModule * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataModule * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataModule * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumExtents )( \n            IXCLRDataModule * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumExtent )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ CLRDATA_MODULE_EXTENT *extent);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumExtents )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataModule * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumAppDomains )( \n            IXCLRDataModule * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumAppDomain )( \n            IXCLRDataModule * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumAppDomains )( \n            IXCLRDataModule * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetVersionId )( \n            IXCLRDataModule * This,\n            /* [out] */ GUID *vid);\n        \n        END_INTERFACE\n    } IXCLRDataModuleVtbl;\n\n    interface IXCLRDataModule\n    {\n        CONST_VTBL struct IXCLRDataModuleVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataModule_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataModule_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataModule_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataModule_StartEnumAssemblies(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumAssemblies(This,handle) ) \n\n#define IXCLRDataModule_EnumAssembly(This,handle,assembly)\t\\\n    ( (This)->lpVtbl -> EnumAssembly(This,handle,assembly) ) \n\n#define IXCLRDataModule_EndEnumAssemblies(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumAssemblies(This,handle) ) \n\n#define IXCLRDataModule_StartEnumTypeDefinitions(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumTypeDefinitions(This,handle) ) \n\n#define IXCLRDataModule_EnumTypeDefinition(This,handle,typeDefinition)\t\\\n    ( (This)->lpVtbl -> EnumTypeDefinition(This,handle,typeDefinition) ) \n\n#define IXCLRDataModule_EndEnumTypeDefinitions(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumTypeDefinitions(This,handle) ) \n\n#define IXCLRDataModule_StartEnumTypeInstances(This,appDomain,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumTypeInstances(This,appDomain,handle) ) \n\n#define IXCLRDataModule_EnumTypeInstance(This,handle,typeInstance)\t\\\n    ( (This)->lpVtbl -> EnumTypeInstance(This,handle,typeInstance) ) \n\n#define IXCLRDataModule_EndEnumTypeInstances(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumTypeInstances(This,handle) ) \n\n#define IXCLRDataModule_StartEnumTypeDefinitionsByName(This,name,flags,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumTypeDefinitionsByName(This,name,flags,handle) ) \n\n#define IXCLRDataModule_EnumTypeDefinitionByName(This,handle,type)\t\\\n    ( (This)->lpVtbl -> EnumTypeDefinitionByName(This,handle,type) ) \n\n#define IXCLRDataModule_EndEnumTypeDefinitionsByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumTypeDefinitionsByName(This,handle) ) \n\n#define IXCLRDataModule_StartEnumTypeInstancesByName(This,name,flags,appDomain,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumTypeInstancesByName(This,name,flags,appDomain,handle) ) \n\n#define IXCLRDataModule_EnumTypeInstanceByName(This,handle,type)\t\\\n    ( (This)->lpVtbl -> EnumTypeInstanceByName(This,handle,type) ) \n\n#define IXCLRDataModule_EndEnumTypeInstancesByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumTypeInstancesByName(This,handle) ) \n\n#define IXCLRDataModule_GetTypeDefinitionByToken(This,token,typeDefinition)\t\\\n    ( (This)->lpVtbl -> GetTypeDefinitionByToken(This,token,typeDefinition) ) \n\n#define IXCLRDataModule_StartEnumMethodDefinitionsByName(This,name,flags,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodDefinitionsByName(This,name,flags,handle) ) \n\n#define IXCLRDataModule_EnumMethodDefinitionByName(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodDefinitionByName(This,handle,method) ) \n\n#define IXCLRDataModule_EndEnumMethodDefinitionsByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodDefinitionsByName(This,handle) ) \n\n#define IXCLRDataModule_StartEnumMethodInstancesByName(This,name,flags,appDomain,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodInstancesByName(This,name,flags,appDomain,handle) ) \n\n#define IXCLRDataModule_EnumMethodInstanceByName(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodInstanceByName(This,handle,method) ) \n\n#define IXCLRDataModule_EndEnumMethodInstancesByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodInstancesByName(This,handle) ) \n\n#define IXCLRDataModule_GetMethodDefinitionByToken(This,token,methodDefinition)\t\\\n    ( (This)->lpVtbl -> GetMethodDefinitionByToken(This,token,methodDefinition) ) \n\n#define IXCLRDataModule_StartEnumDataByName(This,name,flags,appDomain,tlsTask,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumDataByName(This,name,flags,appDomain,tlsTask,handle) ) \n\n#define IXCLRDataModule_EnumDataByName(This,handle,value)\t\\\n    ( (This)->lpVtbl -> EnumDataByName(This,handle,value) ) \n\n#define IXCLRDataModule_EndEnumDataByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumDataByName(This,handle) ) \n\n#define IXCLRDataModule_GetName(This,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetName(This,bufLen,nameLen,name) ) \n\n#define IXCLRDataModule_GetFileName(This,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetFileName(This,bufLen,nameLen,name) ) \n\n#define IXCLRDataModule_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataModule_IsSameObject(This,mod)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,mod) ) \n\n#define IXCLRDataModule_StartEnumExtents(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumExtents(This,handle) ) \n\n#define IXCLRDataModule_EnumExtent(This,handle,extent)\t\\\n    ( (This)->lpVtbl -> EnumExtent(This,handle,extent) ) \n\n#define IXCLRDataModule_EndEnumExtents(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumExtents(This,handle) ) \n\n#define IXCLRDataModule_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataModule_StartEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumAppDomains(This,handle) ) \n\n#define IXCLRDataModule_EnumAppDomain(This,handle,appDomain)\t\\\n    ( (This)->lpVtbl -> EnumAppDomain(This,handle,appDomain) ) \n\n#define IXCLRDataModule_EndEnumAppDomains(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumAppDomains(This,handle) ) \n\n#define IXCLRDataModule_GetVersionId(This,vid)\t\\\n    ( (This)->lpVtbl -> GetVersionId(This,vid) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataModule_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0009 */\n/* [local] */ \n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0009_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0009_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataModule2_INTERFACE_DEFINED__\n#define __IXCLRDataModule2_INTERFACE_DEFINED__\n\n/* interface IXCLRDataModule2 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataModule2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"34625881-7EB3-4524-817B-8DB9D064C760\")\n    IXCLRDataModule2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE SetJITCompilerFlags( \n            /* [in] */ DWORD dwFlags) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataModule2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataModule2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataModule2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataModule2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetJITCompilerFlags )( \n            IXCLRDataModule2 * This,\n            /* [in] */ DWORD dwFlags);\n        \n        END_INTERFACE\n    } IXCLRDataModule2Vtbl;\n\n    interface IXCLRDataModule2\n    {\n        CONST_VTBL struct IXCLRDataModule2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataModule2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataModule2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataModule2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataModule2_SetJITCompilerFlags(This,dwFlags)\t\\\n    ( (This)->lpVtbl -> SetJITCompilerFlags(This,dwFlags) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataModule2_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0010 */\n/* [local] */ \n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0010_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0010_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataTypeDefinition_INTERFACE_DEFINED__\n#define __IXCLRDataTypeDefinition_INTERFACE_DEFINED__\n\n/* interface IXCLRDataTypeDefinition */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataTypeDefinition;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"4675666C-C275-45b8-9F6C-AB165D5C1E09\")\n    IXCLRDataTypeDefinition : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetModule( \n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodDefinitions( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodDefinition( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodDefinitions( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodDefinitionsByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodDefinitionByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodDefinitionsByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodDefinitionByToken( \n            /* [in] */ mdMethodDef token,\n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumInstances( \n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumInstance( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeInstance **instance) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumInstances( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope( \n            /* [out] */ mdTypeDef *token,\n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCorElementType( \n            /* [out] */ CorElementType *type) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataTypeDefinition *type) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetArrayRank( \n            /* [out] */ ULONG32 *rank) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetBase( \n            /* [out] */ IXCLRDataTypeDefinition **base) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumFields( \n            /* [in] */ ULONG32 flags,\n            /* [out] */ ULONG32 *numFields) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumFields( \n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumField( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumFields( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumFieldsByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 nameFlags,\n            /* [in] */ ULONG32 fieldFlags,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumFieldByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumFieldsByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFieldByToken( \n            /* [in] */ mdFieldDef token,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTypeNotification( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetTypeNotification( \n            /* [in] */ ULONG32 flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumField2( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumFieldByName2( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFieldByToken2( \n            /* [in] */ IXCLRDataModule *tokenScope,\n            /* [in] */ mdFieldDef token,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataTypeDefinitionVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataTypeDefinition * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataTypeDefinition * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetModule )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodDefinitions )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodDefinition )( \n            IXCLRDataTypeDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodDefinitions )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodDefinitionsByName )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodDefinitionByName )( \n            IXCLRDataTypeDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodDefinition **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodDefinitionsByName )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodDefinitionByToken )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ mdMethodDef token,\n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumInstances )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumInstance )( \n            IXCLRDataTypeDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeInstance **instance);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumInstances )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndScope )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ mdTypeDef *token,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCorElementType )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ CorElementType *type);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ IXCLRDataTypeDefinition *type);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetArrayRank )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ ULONG32 *rank);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetBase )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ IXCLRDataTypeDefinition **base);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumFields )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ ULONG32 *numFields);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumFields )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumField )( \n            IXCLRDataTypeDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumFields )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumFieldsByName )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 nameFlags,\n            /* [in] */ ULONG32 fieldFlags,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumFieldByName )( \n            IXCLRDataTypeDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumFieldsByName )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFieldByToken )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ mdFieldDef token,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeNotification )( \n            IXCLRDataTypeDefinition * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetTypeNotification )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumField2 )( \n            IXCLRDataTypeDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumFieldByName2 )( \n            IXCLRDataTypeDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFieldByToken2 )( \n            IXCLRDataTypeDefinition * This,\n            /* [in] */ IXCLRDataModule *tokenScope,\n            /* [in] */ mdFieldDef token,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataTypeDefinition **type,\n            /* [out] */ ULONG32 *flags);\n        \n        END_INTERFACE\n    } IXCLRDataTypeDefinitionVtbl;\n\n    interface IXCLRDataTypeDefinition\n    {\n        CONST_VTBL struct IXCLRDataTypeDefinitionVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataTypeDefinition_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataTypeDefinition_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataTypeDefinition_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataTypeDefinition_GetModule(This,mod)\t\\\n    ( (This)->lpVtbl -> GetModule(This,mod) ) \n\n#define IXCLRDataTypeDefinition_StartEnumMethodDefinitions(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodDefinitions(This,handle) ) \n\n#define IXCLRDataTypeDefinition_EnumMethodDefinition(This,handle,methodDefinition)\t\\\n    ( (This)->lpVtbl -> EnumMethodDefinition(This,handle,methodDefinition) ) \n\n#define IXCLRDataTypeDefinition_EndEnumMethodDefinitions(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodDefinitions(This,handle) ) \n\n#define IXCLRDataTypeDefinition_StartEnumMethodDefinitionsByName(This,name,flags,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodDefinitionsByName(This,name,flags,handle) ) \n\n#define IXCLRDataTypeDefinition_EnumMethodDefinitionByName(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodDefinitionByName(This,handle,method) ) \n\n#define IXCLRDataTypeDefinition_EndEnumMethodDefinitionsByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodDefinitionsByName(This,handle) ) \n\n#define IXCLRDataTypeDefinition_GetMethodDefinitionByToken(This,token,methodDefinition)\t\\\n    ( (This)->lpVtbl -> GetMethodDefinitionByToken(This,token,methodDefinition) ) \n\n#define IXCLRDataTypeDefinition_StartEnumInstances(This,appDomain,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumInstances(This,appDomain,handle) ) \n\n#define IXCLRDataTypeDefinition_EnumInstance(This,handle,instance)\t\\\n    ( (This)->lpVtbl -> EnumInstance(This,handle,instance) ) \n\n#define IXCLRDataTypeDefinition_EndEnumInstances(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumInstances(This,handle) ) \n\n#define IXCLRDataTypeDefinition_GetName(This,flags,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetName(This,flags,bufLen,nameLen,nameBuf) ) \n\n#define IXCLRDataTypeDefinition_GetTokenAndScope(This,token,mod)\t\\\n    ( (This)->lpVtbl -> GetTokenAndScope(This,token,mod) ) \n\n#define IXCLRDataTypeDefinition_GetCorElementType(This,type)\t\\\n    ( (This)->lpVtbl -> GetCorElementType(This,type) ) \n\n#define IXCLRDataTypeDefinition_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataTypeDefinition_IsSameObject(This,type)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,type) ) \n\n#define IXCLRDataTypeDefinition_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataTypeDefinition_GetArrayRank(This,rank)\t\\\n    ( (This)->lpVtbl -> GetArrayRank(This,rank) ) \n\n#define IXCLRDataTypeDefinition_GetBase(This,base)\t\\\n    ( (This)->lpVtbl -> GetBase(This,base) ) \n\n#define IXCLRDataTypeDefinition_GetNumFields(This,flags,numFields)\t\\\n    ( (This)->lpVtbl -> GetNumFields(This,flags,numFields) ) \n\n#define IXCLRDataTypeDefinition_StartEnumFields(This,flags,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumFields(This,flags,handle) ) \n\n#define IXCLRDataTypeDefinition_EnumField(This,handle,nameBufLen,nameLen,nameBuf,type,flags,token)\t\\\n    ( (This)->lpVtbl -> EnumField(This,handle,nameBufLen,nameLen,nameBuf,type,flags,token) ) \n\n#define IXCLRDataTypeDefinition_EndEnumFields(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumFields(This,handle) ) \n\n#define IXCLRDataTypeDefinition_StartEnumFieldsByName(This,name,nameFlags,fieldFlags,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumFieldsByName(This,name,nameFlags,fieldFlags,handle) ) \n\n#define IXCLRDataTypeDefinition_EnumFieldByName(This,handle,type,flags,token)\t\\\n    ( (This)->lpVtbl -> EnumFieldByName(This,handle,type,flags,token) ) \n\n#define IXCLRDataTypeDefinition_EndEnumFieldsByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumFieldsByName(This,handle) ) \n\n#define IXCLRDataTypeDefinition_GetFieldByToken(This,token,nameBufLen,nameLen,nameBuf,type,flags)\t\\\n    ( (This)->lpVtbl -> GetFieldByToken(This,token,nameBufLen,nameLen,nameBuf,type,flags) ) \n\n#define IXCLRDataTypeDefinition_GetTypeNotification(This,flags)\t\\\n    ( (This)->lpVtbl -> GetTypeNotification(This,flags) ) \n\n#define IXCLRDataTypeDefinition_SetTypeNotification(This,flags)\t\\\n    ( (This)->lpVtbl -> SetTypeNotification(This,flags) ) \n\n#define IXCLRDataTypeDefinition_EnumField2(This,handle,nameBufLen,nameLen,nameBuf,type,flags,tokenScope,token)\t\\\n    ( (This)->lpVtbl -> EnumField2(This,handle,nameBufLen,nameLen,nameBuf,type,flags,tokenScope,token) ) \n\n#define IXCLRDataTypeDefinition_EnumFieldByName2(This,handle,type,flags,tokenScope,token)\t\\\n    ( (This)->lpVtbl -> EnumFieldByName2(This,handle,type,flags,tokenScope,token) ) \n\n#define IXCLRDataTypeDefinition_GetFieldByToken2(This,tokenScope,token,nameBufLen,nameLen,nameBuf,type,flags)\t\\\n    ( (This)->lpVtbl -> GetFieldByToken2(This,tokenScope,token,nameBufLen,nameLen,nameBuf,type,flags) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataTypeDefinition_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0011 */\n/* [local] */ \n\n#pragma warning(pop)\n#pragma warning(push)\n#pragma warning(disable:28718)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0011_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0011_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataTypeInstance_INTERFACE_DEFINED__\n#define __IXCLRDataTypeInstance_INTERFACE_DEFINED__\n\n/* interface IXCLRDataTypeInstance */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataTypeInstance;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"4D078D91-9CB3-4b0d-97AC-28C8A5A82597\")\n    IXCLRDataTypeInstance : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodInstances( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodInstance( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **methodInstance) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodInstances( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumMethodInstancesByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumMethodInstanceByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumMethodInstancesByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumStaticFields( \n            /* [out] */ ULONG32 *numFields) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetStaticFieldByIndex( \n            /* [in] */ ULONG32 index,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumStaticFieldsByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumStaticFieldByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumStaticFieldsByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumTypeArguments( \n            /* [out] */ ULONG32 *numTypeArgs) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTypeArgumentByIndex( \n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataTypeInstance **typeArg) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetModule( \n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDefinition( \n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataTypeInstance *type) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumStaticFields2( \n            /* [in] */ ULONG32 flags,\n            /* [out] */ ULONG32 *numFields) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumStaticFields( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumStaticField( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumStaticFields( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumStaticFieldsByName2( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 nameFlags,\n            /* [in] */ ULONG32 fieldFlags,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumStaticFieldByName2( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumStaticFieldsByName2( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetStaticFieldByToken( \n            /* [in] */ mdFieldDef token,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetBase( \n            /* [out] */ IXCLRDataTypeInstance **base) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumStaticField2( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumStaticFieldByName3( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetStaticFieldByToken2( \n            /* [in] */ IXCLRDataModule *tokenScope,\n            /* [in] */ mdFieldDef token,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataTypeInstanceVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataTypeInstance * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataTypeInstance * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodInstances )( \n            IXCLRDataTypeInstance * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodInstance )( \n            IXCLRDataTypeInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **methodInstance);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodInstances )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumMethodInstancesByName )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumMethodInstanceByName )( \n            IXCLRDataTypeInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumMethodInstancesByName )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumStaticFields )( \n            IXCLRDataTypeInstance * This,\n            /* [out] */ ULONG32 *numFields);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldByIndex )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ ULONG32 index,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumStaticFieldsByName )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumStaticFieldByName )( \n            IXCLRDataTypeInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumStaticFieldsByName )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumTypeArguments )( \n            IXCLRDataTypeInstance * This,\n            /* [out] */ ULONG32 *numTypeArgs);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeArgumentByIndex )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataTypeInstance **typeArg);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetModule )( \n            IXCLRDataTypeInstance * This,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDefinition )( \n            IXCLRDataTypeInstance * This,\n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataTypeInstance * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ IXCLRDataTypeInstance *type);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumStaticFields2 )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ ULONG32 *numFields);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumStaticFields )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumStaticField )( \n            IXCLRDataTypeInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumStaticFields )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumStaticFieldsByName2 )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 nameFlags,\n            /* [in] */ ULONG32 fieldFlags,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumStaticFieldByName2 )( \n            IXCLRDataTypeInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumStaticFieldsByName2 )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldByToken )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ mdFieldDef token,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetBase )( \n            IXCLRDataTypeInstance * This,\n            /* [out] */ IXCLRDataTypeInstance **base);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumStaticField2 )( \n            IXCLRDataTypeInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumStaticFieldByName3 )( \n            IXCLRDataTypeInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **value,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetStaticFieldByToken2 )( \n            IXCLRDataTypeInstance * This,\n            /* [in] */ IXCLRDataModule *tokenScope,\n            /* [in] */ mdFieldDef token,\n            /* [in] */ IXCLRDataTask *tlsTask,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        END_INTERFACE\n    } IXCLRDataTypeInstanceVtbl;\n\n    interface IXCLRDataTypeInstance\n    {\n        CONST_VTBL struct IXCLRDataTypeInstanceVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataTypeInstance_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataTypeInstance_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataTypeInstance_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataTypeInstance_StartEnumMethodInstances(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodInstances(This,handle) ) \n\n#define IXCLRDataTypeInstance_EnumMethodInstance(This,handle,methodInstance)\t\\\n    ( (This)->lpVtbl -> EnumMethodInstance(This,handle,methodInstance) ) \n\n#define IXCLRDataTypeInstance_EndEnumMethodInstances(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodInstances(This,handle) ) \n\n#define IXCLRDataTypeInstance_StartEnumMethodInstancesByName(This,name,flags,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumMethodInstancesByName(This,name,flags,handle) ) \n\n#define IXCLRDataTypeInstance_EnumMethodInstanceByName(This,handle,method)\t\\\n    ( (This)->lpVtbl -> EnumMethodInstanceByName(This,handle,method) ) \n\n#define IXCLRDataTypeInstance_EndEnumMethodInstancesByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumMethodInstancesByName(This,handle) ) \n\n#define IXCLRDataTypeInstance_GetNumStaticFields(This,numFields)\t\\\n    ( (This)->lpVtbl -> GetNumStaticFields(This,numFields) ) \n\n#define IXCLRDataTypeInstance_GetStaticFieldByIndex(This,index,tlsTask,field,bufLen,nameLen,nameBuf,token)\t\\\n    ( (This)->lpVtbl -> GetStaticFieldByIndex(This,index,tlsTask,field,bufLen,nameLen,nameBuf,token) ) \n\n#define IXCLRDataTypeInstance_StartEnumStaticFieldsByName(This,name,flags,tlsTask,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumStaticFieldsByName(This,name,flags,tlsTask,handle) ) \n\n#define IXCLRDataTypeInstance_EnumStaticFieldByName(This,handle,value)\t\\\n    ( (This)->lpVtbl -> EnumStaticFieldByName(This,handle,value) ) \n\n#define IXCLRDataTypeInstance_EndEnumStaticFieldsByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumStaticFieldsByName(This,handle) ) \n\n#define IXCLRDataTypeInstance_GetNumTypeArguments(This,numTypeArgs)\t\\\n    ( (This)->lpVtbl -> GetNumTypeArguments(This,numTypeArgs) ) \n\n#define IXCLRDataTypeInstance_GetTypeArgumentByIndex(This,index,typeArg)\t\\\n    ( (This)->lpVtbl -> GetTypeArgumentByIndex(This,index,typeArg) ) \n\n#define IXCLRDataTypeInstance_GetName(This,flags,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetName(This,flags,bufLen,nameLen,nameBuf) ) \n\n#define IXCLRDataTypeInstance_GetModule(This,mod)\t\\\n    ( (This)->lpVtbl -> GetModule(This,mod) ) \n\n#define IXCLRDataTypeInstance_GetDefinition(This,typeDefinition)\t\\\n    ( (This)->lpVtbl -> GetDefinition(This,typeDefinition) ) \n\n#define IXCLRDataTypeInstance_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataTypeInstance_IsSameObject(This,type)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,type) ) \n\n#define IXCLRDataTypeInstance_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataTypeInstance_GetNumStaticFields2(This,flags,numFields)\t\\\n    ( (This)->lpVtbl -> GetNumStaticFields2(This,flags,numFields) ) \n\n#define IXCLRDataTypeInstance_StartEnumStaticFields(This,flags,tlsTask,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumStaticFields(This,flags,tlsTask,handle) ) \n\n#define IXCLRDataTypeInstance_EnumStaticField(This,handle,value)\t\\\n    ( (This)->lpVtbl -> EnumStaticField(This,handle,value) ) \n\n#define IXCLRDataTypeInstance_EndEnumStaticFields(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumStaticFields(This,handle) ) \n\n#define IXCLRDataTypeInstance_StartEnumStaticFieldsByName2(This,name,nameFlags,fieldFlags,tlsTask,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumStaticFieldsByName2(This,name,nameFlags,fieldFlags,tlsTask,handle) ) \n\n#define IXCLRDataTypeInstance_EnumStaticFieldByName2(This,handle,value)\t\\\n    ( (This)->lpVtbl -> EnumStaticFieldByName2(This,handle,value) ) \n\n#define IXCLRDataTypeInstance_EndEnumStaticFieldsByName2(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumStaticFieldsByName2(This,handle) ) \n\n#define IXCLRDataTypeInstance_GetStaticFieldByToken(This,token,tlsTask,field,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetStaticFieldByToken(This,token,tlsTask,field,bufLen,nameLen,nameBuf) ) \n\n#define IXCLRDataTypeInstance_GetBase(This,base)\t\\\n    ( (This)->lpVtbl -> GetBase(This,base) ) \n\n#define IXCLRDataTypeInstance_EnumStaticField2(This,handle,value,bufLen,nameLen,nameBuf,tokenScope,token)\t\\\n    ( (This)->lpVtbl -> EnumStaticField2(This,handle,value,bufLen,nameLen,nameBuf,tokenScope,token) ) \n\n#define IXCLRDataTypeInstance_EnumStaticFieldByName3(This,handle,value,tokenScope,token)\t\\\n    ( (This)->lpVtbl -> EnumStaticFieldByName3(This,handle,value,tokenScope,token) ) \n\n#define IXCLRDataTypeInstance_GetStaticFieldByToken2(This,tokenScope,token,tlsTask,field,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetStaticFieldByToken2(This,tokenScope,token,tlsTask,field,bufLen,nameLen,nameBuf) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataTypeInstance_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0012 */\n/* [local] */ \n\n#pragma warning(pop)\ntypedef /* [public][public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0012_0001\n    {\n        CLRDATA_SOURCE_TYPE_INVALID\t= 0\n    } \tCLRDataSourceType;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0012_0002\n    {\n        CLRDATA_IL_OFFSET_NO_MAPPING\t= -1,\n        CLRDATA_IL_OFFSET_PROLOG\t= -2,\n        CLRDATA_IL_OFFSET_EPILOG\t= -3\n    } \tCLRDATA_IL_OFFSET_MARKER;\n\ntypedef /* [public][public] */ struct __MIDL___MIDL_itf_xclrdata_0000_0012_0003\n    {\n    ULONG32 ilOffset;\n    CLRDATA_ADDRESS startAddress;\n    CLRDATA_ADDRESS endAddress;\n    CLRDataSourceType type;\n    } \tCLRDATA_IL_ADDRESS_MAP;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0012_0004\n    {\n        CLRDATA_METHOD_DEFAULT\t= 0,\n        CLRDATA_METHOD_HAS_THIS\t= 0x1\n    } \tCLRDataMethodFlag;\n\ntypedef /* [public][public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0012_0005\n    {\n        CLRDATA_METHDEF_IL\t= 0\n    } \tCLRDataMethodDefinitionExtentType;\n\ntypedef /* [public][public] */ struct __MIDL___MIDL_itf_xclrdata_0000_0012_0006\n    {\n    CLRDATA_ADDRESS startAddress;\n    CLRDATA_ADDRESS endAddress;\n    ULONG32 enCVersion;\n    CLRDataMethodDefinitionExtentType type;\n    } \tCLRDATA_METHDEF_EXTENT;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0012_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0012_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataMethodDefinition_INTERFACE_DEFINED__\n#define __IXCLRDataMethodDefinition_INTERFACE_DEFINED__\n\n/* interface IXCLRDataMethodDefinition */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataMethodDefinition;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"AAF60008-FB2C-420b-8FB1-42D244A54A97\")\n    IXCLRDataMethodDefinition : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetTypeDefinition( \n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumInstances( \n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumInstance( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **instance) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumInstances( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope( \n            /* [out] */ mdMethodDef *token,\n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataMethodDefinition *method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLatestEnCVersion( \n            /* [out] */ ULONG32 *version) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumExtents( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumExtent( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ CLRDATA_METHDEF_EXTENT *extent) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumExtents( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCodeNotification( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetCodeNotification( \n            /* [in] */ ULONG32 flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetRepresentativeEntryAddress( \n            /* [out] */ CLRDATA_ADDRESS *addr) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE HasClassOrMethodInstantiation( \n            /* [out] */ BOOL *bGeneric) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataMethodDefinitionVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataMethodDefinition * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataMethodDefinition * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeDefinition )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ IXCLRDataTypeDefinition **typeDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumInstances )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ IXCLRDataAppDomain *appDomain,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumInstance )( \n            IXCLRDataMethodDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataMethodInstance **instance);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumInstances )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndScope )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ mdMethodDef *token,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ IXCLRDataMethodDefinition *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLatestEnCVersion )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ ULONG32 *version);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumExtents )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumExtent )( \n            IXCLRDataMethodDefinition * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ CLRDATA_METHDEF_EXTENT *extent);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumExtents )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCodeNotification )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetCodeNotification )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ ULONG32 flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataMethodDefinition * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRepresentativeEntryAddress )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ CLRDATA_ADDRESS *addr);\n        \n        HRESULT ( STDMETHODCALLTYPE *HasClassOrMethodInstantiation )( \n            IXCLRDataMethodDefinition * This,\n            /* [out] */ BOOL *bGeneric);\n        \n        END_INTERFACE\n    } IXCLRDataMethodDefinitionVtbl;\n\n    interface IXCLRDataMethodDefinition\n    {\n        CONST_VTBL struct IXCLRDataMethodDefinitionVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataMethodDefinition_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataMethodDefinition_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataMethodDefinition_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataMethodDefinition_GetTypeDefinition(This,typeDefinition)\t\\\n    ( (This)->lpVtbl -> GetTypeDefinition(This,typeDefinition) ) \n\n#define IXCLRDataMethodDefinition_StartEnumInstances(This,appDomain,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumInstances(This,appDomain,handle) ) \n\n#define IXCLRDataMethodDefinition_EnumInstance(This,handle,instance)\t\\\n    ( (This)->lpVtbl -> EnumInstance(This,handle,instance) ) \n\n#define IXCLRDataMethodDefinition_EndEnumInstances(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumInstances(This,handle) ) \n\n#define IXCLRDataMethodDefinition_GetName(This,flags,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetName(This,flags,bufLen,nameLen,name) ) \n\n#define IXCLRDataMethodDefinition_GetTokenAndScope(This,token,mod)\t\\\n    ( (This)->lpVtbl -> GetTokenAndScope(This,token,mod) ) \n\n#define IXCLRDataMethodDefinition_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataMethodDefinition_IsSameObject(This,method)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,method) ) \n\n#define IXCLRDataMethodDefinition_GetLatestEnCVersion(This,version)\t\\\n    ( (This)->lpVtbl -> GetLatestEnCVersion(This,version) ) \n\n#define IXCLRDataMethodDefinition_StartEnumExtents(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumExtents(This,handle) ) \n\n#define IXCLRDataMethodDefinition_EnumExtent(This,handle,extent)\t\\\n    ( (This)->lpVtbl -> EnumExtent(This,handle,extent) ) \n\n#define IXCLRDataMethodDefinition_EndEnumExtents(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumExtents(This,handle) ) \n\n#define IXCLRDataMethodDefinition_GetCodeNotification(This,flags)\t\\\n    ( (This)->lpVtbl -> GetCodeNotification(This,flags) ) \n\n#define IXCLRDataMethodDefinition_SetCodeNotification(This,flags)\t\\\n    ( (This)->lpVtbl -> SetCodeNotification(This,flags) ) \n\n#define IXCLRDataMethodDefinition_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataMethodDefinition_GetRepresentativeEntryAddress(This,addr)\t\\\n    ( (This)->lpVtbl -> GetRepresentativeEntryAddress(This,addr) ) \n\n#define IXCLRDataMethodDefinition_HasClassOrMethodInstantiation(This,bGeneric)\t\\\n    ( (This)->lpVtbl -> HasClassOrMethodInstantiation(This,bGeneric) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataMethodDefinition_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0013 */\n/* [local] */ \n\n#pragma warning(pop)\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0013_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0013_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataMethodInstance_INTERFACE_DEFINED__\n#define __IXCLRDataMethodInstance_INTERFACE_DEFINED__\n\n/* interface IXCLRDataMethodInstance */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataMethodInstance;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"ECD73800-22CA-4b0d-AB55-E9BA7E6318A5\")\n    IXCLRDataMethodInstance : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetTypeInstance( \n            /* [out] */ IXCLRDataTypeInstance **typeInstance) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDefinition( \n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTokenAndScope( \n            /* [out] */ mdMethodDef *token,\n            /* [out] */ IXCLRDataModule **mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataMethodInstance *method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetEnCVersion( \n            /* [out] */ ULONG32 *version) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumTypeArguments( \n            /* [out] */ ULONG32 *numTypeArgs) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTypeArgumentByIndex( \n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataTypeInstance **typeArg) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetILOffsetsByAddress( \n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 offsetsLen,\n            /* [out] */ ULONG32 *offsetsNeeded,\n            /* [size_is][out] */ ULONG32 ilOffsets[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAddressRangesByILOffset( \n            /* [in] */ ULONG32 ilOffset,\n            /* [in] */ ULONG32 rangesLen,\n            /* [out] */ ULONG32 *rangesNeeded,\n            /* [size_is][out] */ CLRDATA_ADDRESS_RANGE addressRanges[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetILAddressMap( \n            /* [in] */ ULONG32 mapLen,\n            /* [out] */ ULONG32 *mapNeeded,\n            /* [size_is][out] */ CLRDATA_IL_ADDRESS_MAP maps[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumExtents( \n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumExtent( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ CLRDATA_ADDRESS_RANGE *extent) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumExtents( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetRepresentativeEntryAddress( \n            /* [out] */ CLRDATA_ADDRESS *addr) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataMethodInstanceVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataMethodInstance * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataMethodInstance * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeInstance )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ IXCLRDataTypeInstance **typeInstance);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDefinition )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ IXCLRDataMethodDefinition **methodDefinition);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTokenAndScope )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ mdMethodDef *token,\n            /* [out] */ IXCLRDataModule **mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetEnCVersion )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ ULONG32 *version);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumTypeArguments )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ ULONG32 *numTypeArgs);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeArgumentByIndex )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataTypeInstance **typeArg);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetILOffsetsByAddress )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ CLRDATA_ADDRESS address,\n            /* [in] */ ULONG32 offsetsLen,\n            /* [out] */ ULONG32 *offsetsNeeded,\n            /* [size_is][out] */ ULONG32 ilOffsets[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddressRangesByILOffset )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ ULONG32 ilOffset,\n            /* [in] */ ULONG32 rangesLen,\n            /* [out] */ ULONG32 *rangesNeeded,\n            /* [size_is][out] */ CLRDATA_ADDRESS_RANGE addressRanges[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetILAddressMap )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ ULONG32 mapLen,\n            /* [out] */ ULONG32 *mapNeeded,\n            /* [size_is][out] */ CLRDATA_IL_ADDRESS_MAP maps[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumExtents )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumExtent )( \n            IXCLRDataMethodInstance * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ CLRDATA_ADDRESS_RANGE *extent);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumExtents )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataMethodInstance * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetRepresentativeEntryAddress )( \n            IXCLRDataMethodInstance * This,\n            /* [out] */ CLRDATA_ADDRESS *addr);\n        \n        END_INTERFACE\n    } IXCLRDataMethodInstanceVtbl;\n\n    interface IXCLRDataMethodInstance\n    {\n        CONST_VTBL struct IXCLRDataMethodInstanceVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataMethodInstance_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataMethodInstance_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataMethodInstance_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataMethodInstance_GetTypeInstance(This,typeInstance)\t\\\n    ( (This)->lpVtbl -> GetTypeInstance(This,typeInstance) ) \n\n#define IXCLRDataMethodInstance_GetDefinition(This,methodDefinition)\t\\\n    ( (This)->lpVtbl -> GetDefinition(This,methodDefinition) ) \n\n#define IXCLRDataMethodInstance_GetTokenAndScope(This,token,mod)\t\\\n    ( (This)->lpVtbl -> GetTokenAndScope(This,token,mod) ) \n\n#define IXCLRDataMethodInstance_GetName(This,flags,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetName(This,flags,bufLen,nameLen,nameBuf) ) \n\n#define IXCLRDataMethodInstance_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataMethodInstance_IsSameObject(This,method)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,method) ) \n\n#define IXCLRDataMethodInstance_GetEnCVersion(This,version)\t\\\n    ( (This)->lpVtbl -> GetEnCVersion(This,version) ) \n\n#define IXCLRDataMethodInstance_GetNumTypeArguments(This,numTypeArgs)\t\\\n    ( (This)->lpVtbl -> GetNumTypeArguments(This,numTypeArgs) ) \n\n#define IXCLRDataMethodInstance_GetTypeArgumentByIndex(This,index,typeArg)\t\\\n    ( (This)->lpVtbl -> GetTypeArgumentByIndex(This,index,typeArg) ) \n\n#define IXCLRDataMethodInstance_GetILOffsetsByAddress(This,address,offsetsLen,offsetsNeeded,ilOffsets)\t\\\n    ( (This)->lpVtbl -> GetILOffsetsByAddress(This,address,offsetsLen,offsetsNeeded,ilOffsets) ) \n\n#define IXCLRDataMethodInstance_GetAddressRangesByILOffset(This,ilOffset,rangesLen,rangesNeeded,addressRanges)\t\\\n    ( (This)->lpVtbl -> GetAddressRangesByILOffset(This,ilOffset,rangesLen,rangesNeeded,addressRanges) ) \n\n#define IXCLRDataMethodInstance_GetILAddressMap(This,mapLen,mapNeeded,maps)\t\\\n    ( (This)->lpVtbl -> GetILAddressMap(This,mapLen,mapNeeded,maps) ) \n\n#define IXCLRDataMethodInstance_StartEnumExtents(This,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumExtents(This,handle) ) \n\n#define IXCLRDataMethodInstance_EnumExtent(This,handle,extent)\t\\\n    ( (This)->lpVtbl -> EnumExtent(This,handle,extent) ) \n\n#define IXCLRDataMethodInstance_EndEnumExtents(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumExtents(This,handle) ) \n\n#define IXCLRDataMethodInstance_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataMethodInstance_GetRepresentativeEntryAddress(This,addr)\t\\\n    ( (This)->lpVtbl -> GetRepresentativeEntryAddress(This,addr) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataMethodInstance_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0014 */\n/* [local] */ \n\n#pragma warning(pop)\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0014_0001\n    {\n        CLRDATA_TASK_DEFAULT\t= 0,\n        CLRDATA_TASK_WAITING_FOR_GC\t= 0x1\n    } \tCLRDataTaskFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0014_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0014_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataTask_INTERFACE_DEFINED__\n#define __IXCLRDataTask_INTERFACE_DEFINED__\n\n/* interface IXCLRDataTask */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataTask;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"A5B0BEEA-EC62-4618-8012-A24FFC23934C\")\n    IXCLRDataTask : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetProcess( \n            /* [out] */ IXCLRDataProcess **process) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCurrentAppDomain( \n            /* [out] */ IXCLRDataAppDomain **appDomain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetUniqueID( \n            /* [out] */ ULONG64 *id) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameObject( \n            /* [in] */ IXCLRDataTask *task) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetManagedObject( \n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetDesiredExecutionState( \n            /* [out] */ ULONG32 *state) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetDesiredExecutionState( \n            /* [in] */ ULONG32 state) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE CreateStackWalk( \n            /* [in] */ ULONG32 flags,\n            /* [out] */ IXCLRDataStackWalk **stackWalk) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetOSThreadID( \n            /* [out] */ ULONG32 *id) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetContext( \n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetContext( \n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCurrentExceptionState( \n            /* [out] */ IXCLRDataExceptionState **exception) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetName( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLastExceptionState( \n            /* [out] */ IXCLRDataExceptionState **exception) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataTaskVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataTask * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataTask * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataTask * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetProcess )( \n            IXCLRDataTask * This,\n            /* [out] */ IXCLRDataProcess **process);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCurrentAppDomain )( \n            IXCLRDataTask * This,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetUniqueID )( \n            IXCLRDataTask * This,\n            /* [out] */ ULONG64 *id);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataTask * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameObject )( \n            IXCLRDataTask * This,\n            /* [in] */ IXCLRDataTask *task);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetManagedObject )( \n            IXCLRDataTask * This,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetDesiredExecutionState )( \n            IXCLRDataTask * This,\n            /* [out] */ ULONG32 *state);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetDesiredExecutionState )( \n            IXCLRDataTask * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *CreateStackWalk )( \n            IXCLRDataTask * This,\n            /* [in] */ ULONG32 flags,\n            /* [out] */ IXCLRDataStackWalk **stackWalk);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetOSThreadID )( \n            IXCLRDataTask * This,\n            /* [out] */ ULONG32 *id);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetContext )( \n            IXCLRDataTask * This,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetContext )( \n            IXCLRDataTask * This,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCurrentExceptionState )( \n            IXCLRDataTask * This,\n            /* [out] */ IXCLRDataExceptionState **exception);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataTask * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetName )( \n            IXCLRDataTask * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLastExceptionState )( \n            IXCLRDataTask * This,\n            /* [out] */ IXCLRDataExceptionState **exception);\n        \n        END_INTERFACE\n    } IXCLRDataTaskVtbl;\n\n    interface IXCLRDataTask\n    {\n        CONST_VTBL struct IXCLRDataTaskVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataTask_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataTask_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataTask_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataTask_GetProcess(This,process)\t\\\n    ( (This)->lpVtbl -> GetProcess(This,process) ) \n\n#define IXCLRDataTask_GetCurrentAppDomain(This,appDomain)\t\\\n    ( (This)->lpVtbl -> GetCurrentAppDomain(This,appDomain) ) \n\n#define IXCLRDataTask_GetUniqueID(This,id)\t\\\n    ( (This)->lpVtbl -> GetUniqueID(This,id) ) \n\n#define IXCLRDataTask_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataTask_IsSameObject(This,task)\t\\\n    ( (This)->lpVtbl -> IsSameObject(This,task) ) \n\n#define IXCLRDataTask_GetManagedObject(This,value)\t\\\n    ( (This)->lpVtbl -> GetManagedObject(This,value) ) \n\n#define IXCLRDataTask_GetDesiredExecutionState(This,state)\t\\\n    ( (This)->lpVtbl -> GetDesiredExecutionState(This,state) ) \n\n#define IXCLRDataTask_SetDesiredExecutionState(This,state)\t\\\n    ( (This)->lpVtbl -> SetDesiredExecutionState(This,state) ) \n\n#define IXCLRDataTask_CreateStackWalk(This,flags,stackWalk)\t\\\n    ( (This)->lpVtbl -> CreateStackWalk(This,flags,stackWalk) ) \n\n#define IXCLRDataTask_GetOSThreadID(This,id)\t\\\n    ( (This)->lpVtbl -> GetOSThreadID(This,id) ) \n\n#define IXCLRDataTask_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf)\t\\\n    ( (This)->lpVtbl -> GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) ) \n\n#define IXCLRDataTask_SetContext(This,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetContext(This,contextSize,context) ) \n\n#define IXCLRDataTask_GetCurrentExceptionState(This,exception)\t\\\n    ( (This)->lpVtbl -> GetCurrentExceptionState(This,exception) ) \n\n#define IXCLRDataTask_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataTask_GetName(This,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetName(This,bufLen,nameLen,name) ) \n\n#define IXCLRDataTask_GetLastExceptionState(This,exception)\t\\\n    ( (This)->lpVtbl -> GetLastExceptionState(This,exception) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataTask_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0015 */\n/* [local] */ \n\n#pragma warning(pop)\ntypedef /* [public][public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0015_0001\n    {\n        CLRDATA_SIMPFRAME_UNRECOGNIZED\t= 0x1,\n        CLRDATA_SIMPFRAME_MANAGED_METHOD\t= 0x2,\n        CLRDATA_SIMPFRAME_RUNTIME_MANAGED_CODE\t= 0x4,\n        CLRDATA_SIMPFRAME_RUNTIME_UNMANAGED_CODE\t= 0x8\n    } \tCLRDataSimpleFrameType;\n\ntypedef /* [public][public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0015_0002\n    {\n        CLRDATA_DETFRAME_UNRECOGNIZED\t= 0,\n        CLRDATA_DETFRAME_UNKNOWN_STUB\t= ( CLRDATA_DETFRAME_UNRECOGNIZED + 1 ) ,\n        CLRDATA_DETFRAME_CLASS_INIT\t= ( CLRDATA_DETFRAME_UNKNOWN_STUB + 1 ) ,\n        CLRDATA_DETFRAME_EXCEPTION_FILTER\t= ( CLRDATA_DETFRAME_CLASS_INIT + 1 ) ,\n        CLRDATA_DETFRAME_SECURITY\t= ( CLRDATA_DETFRAME_EXCEPTION_FILTER + 1 ) ,\n        CLRDATA_DETFRAME_CONTEXT_POLICY\t= ( CLRDATA_DETFRAME_SECURITY + 1 ) ,\n        CLRDATA_DETFRAME_INTERCEPTION\t= ( CLRDATA_DETFRAME_CONTEXT_POLICY + 1 ) ,\n        CLRDATA_DETFRAME_PROCESS_START\t= ( CLRDATA_DETFRAME_INTERCEPTION + 1 ) ,\n        CLRDATA_DETFRAME_THREAD_START\t= ( CLRDATA_DETFRAME_PROCESS_START + 1 ) ,\n        CLRDATA_DETFRAME_TRANSITION_TO_MANAGED\t= ( CLRDATA_DETFRAME_THREAD_START + 1 ) ,\n        CLRDATA_DETFRAME_TRANSITION_TO_UNMANAGED\t= ( CLRDATA_DETFRAME_TRANSITION_TO_MANAGED + 1 ) ,\n        CLRDATA_DETFRAME_COM_INTEROP_STUB\t= ( CLRDATA_DETFRAME_TRANSITION_TO_UNMANAGED + 1 ) ,\n        CLRDATA_DETFRAME_DEBUGGER_EVAL\t= ( CLRDATA_DETFRAME_COM_INTEROP_STUB + 1 ) ,\n        CLRDATA_DETFRAME_CONTEXT_SWITCH\t= ( CLRDATA_DETFRAME_DEBUGGER_EVAL + 1 ) ,\n        CLRDATA_DETFRAME_FUNC_EVAL\t= ( CLRDATA_DETFRAME_CONTEXT_SWITCH + 1 ) ,\n        CLRDATA_DETFRAME_FINALLY\t= ( CLRDATA_DETFRAME_FUNC_EVAL + 1 ) \n    } \tCLRDataDetailedFrameType;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0015_0003\n    {\n        CLRDATA_STACK_WALK_REQUEST_SET_FIRST_FRAME\t= 0xe1000000\n    } \tCLRDataStackWalkRequest;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0015_0004\n    {\n        CLRDATA_STACK_SET_UNWIND_CONTEXT\t= 0,\n        CLRDATA_STACK_SET_CURRENT_CONTEXT\t= 0x1\n    } \tCLRDataStackSetContextFlag;\n\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0015_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0015_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataStackWalk_INTERFACE_DEFINED__\n#define __IXCLRDataStackWalk_INTERFACE_DEFINED__\n\n/* interface IXCLRDataStackWalk */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataStackWalk;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"E59D8D22-ADA7-49a2-89B5-A415AFCFC95F\")\n    IXCLRDataStackWalk : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetContext( \n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetContext( \n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Next( void) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetStackSizeSkipped( \n            /* [out] */ ULONG64 *stackSizeSkipped) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFrameType( \n            /* [out] */ CLRDataSimpleFrameType *simpleType,\n            /* [out] */ CLRDataDetailedFrameType *detailedType) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFrame( \n            /* [out] */ IXCLRDataFrame **frame) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetContext2( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataStackWalkVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataStackWalk * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataStackWalk * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataStackWalk * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetContext )( \n            IXCLRDataStackWalk * This,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetContext )( \n            IXCLRDataStackWalk * This,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Next )( \n            IXCLRDataStackWalk * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetStackSizeSkipped )( \n            IXCLRDataStackWalk * This,\n            /* [out] */ ULONG64 *stackSizeSkipped);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFrameType )( \n            IXCLRDataStackWalk * This,\n            /* [out] */ CLRDataSimpleFrameType *simpleType,\n            /* [out] */ CLRDataDetailedFrameType *detailedType);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFrame )( \n            IXCLRDataStackWalk * This,\n            /* [out] */ IXCLRDataFrame **frame);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataStackWalk * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetContext2 )( \n            IXCLRDataStackWalk * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE context[  ]);\n        \n        END_INTERFACE\n    } IXCLRDataStackWalkVtbl;\n\n    interface IXCLRDataStackWalk\n    {\n        CONST_VTBL struct IXCLRDataStackWalkVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataStackWalk_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataStackWalk_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataStackWalk_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf)\t\\\n    ( (This)->lpVtbl -> GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) ) \n\n#define IXCLRDataStackWalk_SetContext(This,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetContext(This,contextSize,context) ) \n\n#define IXCLRDataStackWalk_Next(This)\t\\\n    ( (This)->lpVtbl -> Next(This) ) \n\n#define IXCLRDataStackWalk_GetStackSizeSkipped(This,stackSizeSkipped)\t\\\n    ( (This)->lpVtbl -> GetStackSizeSkipped(This,stackSizeSkipped) ) \n\n#define IXCLRDataStackWalk_GetFrameType(This,simpleType,detailedType)\t\\\n    ( (This)->lpVtbl -> GetFrameType(This,simpleType,detailedType) ) \n\n#define IXCLRDataStackWalk_GetFrame(This,frame)\t\\\n    ( (This)->lpVtbl -> GetFrame(This,frame) ) \n\n#define IXCLRDataStackWalk_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataStackWalk_SetContext2(This,flags,contextSize,context)\t\\\n    ( (This)->lpVtbl -> SetContext2(This,flags,contextSize,context) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataStackWalk_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0016 */\n/* [local] */ \n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0016_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0016_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataFrame_INTERFACE_DEFINED__\n#define __IXCLRDataFrame_INTERFACE_DEFINED__\n\n/* interface IXCLRDataFrame */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataFrame;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"271498C2-4085-4766-BC3A-7F8ED188A173\")\n    IXCLRDataFrame : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetFrameType( \n            /* [out] */ CLRDataSimpleFrameType *simpleType,\n            /* [out] */ CLRDataDetailedFrameType *detailedType) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetContext( \n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAppDomain( \n            /* [out] */ IXCLRDataAppDomain **appDomain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumArguments( \n            /* [out] */ ULONG32 *numArgs) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetArgumentByIndex( \n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataValue **arg,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumLocalVariables( \n            /* [out] */ ULONG32 *numLocals) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLocalVariableByIndex( \n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataValue **localVariable,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCodeName( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetMethodInstance( \n            /* [out] */ IXCLRDataMethodInstance **method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumTypeArguments( \n            /* [out] */ ULONG32 *numTypeArgs) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTypeArgumentByIndex( \n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataTypeInstance **typeArg) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataFrameVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataFrame * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataFrame * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataFrame * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFrameType )( \n            IXCLRDataFrame * This,\n            /* [out] */ CLRDataSimpleFrameType *simpleType,\n            /* [out] */ CLRDataDetailedFrameType *detailedType);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetContext )( \n            IXCLRDataFrame * This,\n            /* [in] */ ULONG32 contextFlags,\n            /* [in] */ ULONG32 contextBufSize,\n            /* [out] */ ULONG32 *contextSize,\n            /* [size_is][out] */ BYTE contextBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAppDomain )( \n            IXCLRDataFrame * This,\n            /* [out] */ IXCLRDataAppDomain **appDomain);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumArguments )( \n            IXCLRDataFrame * This,\n            /* [out] */ ULONG32 *numArgs);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetArgumentByIndex )( \n            IXCLRDataFrame * This,\n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataValue **arg,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumLocalVariables )( \n            IXCLRDataFrame * This,\n            /* [out] */ ULONG32 *numLocals);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocalVariableByIndex )( \n            IXCLRDataFrame * This,\n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataValue **localVariable,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR name[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCodeName )( \n            IXCLRDataFrame * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetMethodInstance )( \n            IXCLRDataFrame * This,\n            /* [out] */ IXCLRDataMethodInstance **method);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataFrame * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumTypeArguments )( \n            IXCLRDataFrame * This,\n            /* [out] */ ULONG32 *numTypeArgs);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTypeArgumentByIndex )( \n            IXCLRDataFrame * This,\n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataTypeInstance **typeArg);\n        \n        END_INTERFACE\n    } IXCLRDataFrameVtbl;\n\n    interface IXCLRDataFrame\n    {\n        CONST_VTBL struct IXCLRDataFrameVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataFrame_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataFrame_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataFrame_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataFrame_GetFrameType(This,simpleType,detailedType)\t\\\n    ( (This)->lpVtbl -> GetFrameType(This,simpleType,detailedType) ) \n\n#define IXCLRDataFrame_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf)\t\\\n    ( (This)->lpVtbl -> GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) ) \n\n#define IXCLRDataFrame_GetAppDomain(This,appDomain)\t\\\n    ( (This)->lpVtbl -> GetAppDomain(This,appDomain) ) \n\n#define IXCLRDataFrame_GetNumArguments(This,numArgs)\t\\\n    ( (This)->lpVtbl -> GetNumArguments(This,numArgs) ) \n\n#define IXCLRDataFrame_GetArgumentByIndex(This,index,arg,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetArgumentByIndex(This,index,arg,bufLen,nameLen,name) ) \n\n#define IXCLRDataFrame_GetNumLocalVariables(This,numLocals)\t\\\n    ( (This)->lpVtbl -> GetNumLocalVariables(This,numLocals) ) \n\n#define IXCLRDataFrame_GetLocalVariableByIndex(This,index,localVariable,bufLen,nameLen,name)\t\\\n    ( (This)->lpVtbl -> GetLocalVariableByIndex(This,index,localVariable,bufLen,nameLen,name) ) \n\n#define IXCLRDataFrame_GetCodeName(This,flags,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetCodeName(This,flags,bufLen,nameLen,nameBuf) ) \n\n#define IXCLRDataFrame_GetMethodInstance(This,method)\t\\\n    ( (This)->lpVtbl -> GetMethodInstance(This,method) ) \n\n#define IXCLRDataFrame_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataFrame_GetNumTypeArguments(This,numTypeArgs)\t\\\n    ( (This)->lpVtbl -> GetNumTypeArguments(This,numTypeArgs) ) \n\n#define IXCLRDataFrame_GetTypeArgumentByIndex(This,index,typeArg)\t\\\n    ( (This)->lpVtbl -> GetTypeArgumentByIndex(This,index,typeArg) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataFrame_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0017 */\n/* [local] */ \n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0017_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0017_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataFrame2_INTERFACE_DEFINED__\n#define __IXCLRDataFrame2_INTERFACE_DEFINED__\n\n/* interface IXCLRDataFrame2 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataFrame2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"1C4D9A4B-702D-4CF6-B290-1DB6F43050D0\")\n    IXCLRDataFrame2 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetExactGenericArgsToken( \n            /* [out] */ IXCLRDataValue **genericToken) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataFrame2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataFrame2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataFrame2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataFrame2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetExactGenericArgsToken )( \n            IXCLRDataFrame2 * This,\n            /* [out] */ IXCLRDataValue **genericToken);\n        \n        END_INTERFACE\n    } IXCLRDataFrame2Vtbl;\n\n    interface IXCLRDataFrame2\n    {\n        CONST_VTBL struct IXCLRDataFrame2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataFrame2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataFrame2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataFrame2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataFrame2_GetExactGenericArgsToken(This,genericToken)\t\\\n    ( (This)->lpVtbl -> GetExactGenericArgsToken(This,genericToken) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataFrame2_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0018 */\n/* [local] */ \n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0018_0001\n    {\n        CLRDATA_EXCEPTION_DEFAULT\t= 0,\n        CLRDATA_EXCEPTION_NESTED\t= 0x1,\n        CLRDATA_EXCEPTION_PARTIAL\t= 0x2\n    } \tCLRDataExceptionStateFlag;\n\ntypedef /* [public][public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0018_0002\n    {\n        CLRDATA_EXBASE_EXCEPTION\t= 0,\n        CLRDATA_EXBASE_OUT_OF_MEMORY\t= ( CLRDATA_EXBASE_EXCEPTION + 1 ) ,\n        CLRDATA_EXBASE_INVALID_ARGUMENT\t= ( CLRDATA_EXBASE_OUT_OF_MEMORY + 1 ) \n    } \tCLRDataBaseExceptionType;\n\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0018_0003\n    {\n        CLRDATA_EXSAME_SECOND_CHANCE\t= 0,\n        CLRDATA_EXSAME_FIRST_CHANCE\t= 0x1\n    } \tCLRDataExceptionSameFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0018_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0018_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataExceptionState_INTERFACE_DEFINED__\n#define __IXCLRDataExceptionState_INTERFACE_DEFINED__\n\n/* interface IXCLRDataExceptionState */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataExceptionState;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"75DA9E4C-BD33-43C8-8F5C-96E8A5241F57\")\n    IXCLRDataExceptionState : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetPrevious( \n            /* [out] */ IXCLRDataExceptionState **exState) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetManagedObject( \n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetBaseType( \n            /* [out] */ CLRDataBaseExceptionType *type) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetCode( \n            /* [out] */ ULONG32 *code) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetString( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *strLen,\n            /* [size_is][out] */ WCHAR str[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameState( \n            /* [in] */ EXCEPTION_RECORD64 *exRecord,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE cxRecord[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE IsSameState2( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ EXCEPTION_RECORD64 *exRecord,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE cxRecord[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetTask( \n            /* [out] */ IXCLRDataTask **task) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataExceptionStateVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataExceptionState * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataExceptionState * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataExceptionState * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataExceptionState * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetPrevious )( \n            IXCLRDataExceptionState * This,\n            /* [out] */ IXCLRDataExceptionState **exState);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetManagedObject )( \n            IXCLRDataExceptionState * This,\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetBaseType )( \n            IXCLRDataExceptionState * This,\n            /* [out] */ CLRDataBaseExceptionType *type);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetCode )( \n            IXCLRDataExceptionState * This,\n            /* [out] */ ULONG32 *code);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetString )( \n            IXCLRDataExceptionState * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *strLen,\n            /* [size_is][out] */ WCHAR str[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataExceptionState * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameState )( \n            IXCLRDataExceptionState * This,\n            /* [in] */ EXCEPTION_RECORD64 *exRecord,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE cxRecord[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *IsSameState2 )( \n            IXCLRDataExceptionState * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ EXCEPTION_RECORD64 *exRecord,\n            /* [in] */ ULONG32 contextSize,\n            /* [size_is][in] */ BYTE cxRecord[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetTask )( \n            IXCLRDataExceptionState * This,\n            /* [out] */ IXCLRDataTask **task);\n        \n        END_INTERFACE\n    } IXCLRDataExceptionStateVtbl;\n\n    interface IXCLRDataExceptionState\n    {\n        CONST_VTBL struct IXCLRDataExceptionStateVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataExceptionState_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataExceptionState_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataExceptionState_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataExceptionState_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataExceptionState_GetPrevious(This,exState)\t\\\n    ( (This)->lpVtbl -> GetPrevious(This,exState) ) \n\n#define IXCLRDataExceptionState_GetManagedObject(This,value)\t\\\n    ( (This)->lpVtbl -> GetManagedObject(This,value) ) \n\n#define IXCLRDataExceptionState_GetBaseType(This,type)\t\\\n    ( (This)->lpVtbl -> GetBaseType(This,type) ) \n\n#define IXCLRDataExceptionState_GetCode(This,code)\t\\\n    ( (This)->lpVtbl -> GetCode(This,code) ) \n\n#define IXCLRDataExceptionState_GetString(This,bufLen,strLen,str)\t\\\n    ( (This)->lpVtbl -> GetString(This,bufLen,strLen,str) ) \n\n#define IXCLRDataExceptionState_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataExceptionState_IsSameState(This,exRecord,contextSize,cxRecord)\t\\\n    ( (This)->lpVtbl -> IsSameState(This,exRecord,contextSize,cxRecord) ) \n\n#define IXCLRDataExceptionState_IsSameState2(This,flags,exRecord,contextSize,cxRecord)\t\\\n    ( (This)->lpVtbl -> IsSameState2(This,flags,exRecord,contextSize,cxRecord) ) \n\n#define IXCLRDataExceptionState_GetTask(This,task)\t\\\n    ( (This)->lpVtbl -> GetTask(This,task) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataExceptionState_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0019 */\n/* [local] */ \n\n#pragma warning(pop)\ntypedef /* [public] */ \nenum __MIDL___MIDL_itf_xclrdata_0000_0019_0001\n    {\n        CLRDATA_VLOC_MEMORY\t= 0,\n        CLRDATA_VLOC_REGISTER\t= 0x1\n    } \tClrDataValueLocationFlag;\n\n#pragma warning(push)\n#pragma warning(disable:28718)\t\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0019_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0019_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataValue_INTERFACE_DEFINED__\n#define __IXCLRDataValue_INTERFACE_DEFINED__\n\n/* interface IXCLRDataValue */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataValue;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"96EC93C7-1000-4e93-8991-98D8766E6666\")\n    IXCLRDataValue : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE GetFlags( \n            /* [out] */ ULONG32 *flags) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAddress( \n            /* [out] */ CLRDATA_ADDRESS *address) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetSize( \n            /* [out] */ ULONG64 *size) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetBytes( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *dataSize,\n            /* [size_is][out] */ BYTE buffer[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE SetBytes( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *dataSize,\n            /* [size_is][in] */ BYTE buffer[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetType( \n            /* [out] */ IXCLRDataTypeInstance **typeInstance) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumFields( \n            /* [out] */ ULONG32 *numFields) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFieldByIndex( \n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE Request( \n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumFields2( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTypeInstance *fromType,\n            /* [out] */ ULONG32 *numFields) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumFields( \n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTypeInstance *fromType,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumField( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumFields( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE StartEnumFieldsByName( \n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 nameFlags,\n            /* [in] */ ULONG32 fieldFlags,\n            /* [in] */ IXCLRDataTypeInstance *fromType,\n            /* [out] */ CLRDATA_ENUM *handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumFieldByName( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EndEnumFieldsByName( \n            /* [in] */ CLRDATA_ENUM handle) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFieldByToken( \n            /* [in] */ mdFieldDef token,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAssociatedValue( \n            /* [out] */ IXCLRDataValue **assocValue) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetAssociatedType( \n            /* [out] */ IXCLRDataTypeInstance **assocType) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetString( \n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *strLen,\n            /* [size_is][out] */ WCHAR str[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetArrayProperties( \n            /* [out] */ ULONG32 *rank,\n            /* [out] */ ULONG32 *totalElements,\n            /* [in] */ ULONG32 numDim,\n            /* [size_is][out] */ ULONG32 dims[  ],\n            /* [in] */ ULONG32 numBases,\n            /* [size_is][out] */ LONG32 bases[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetArrayElement( \n            /* [in] */ ULONG32 numInd,\n            /* [size_is][in] */ LONG32 indices[  ],\n            /* [out] */ IXCLRDataValue **value) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumField2( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE EnumFieldByName2( \n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetFieldByToken2( \n            /* [in] */ IXCLRDataModule *tokenScope,\n            /* [in] */ mdFieldDef token,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetNumLocations( \n            /* [out] */ ULONG32 *numLocs) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE GetLocationByIndex( \n            /* [in] */ ULONG32 loc,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ CLRDATA_ADDRESS *arg) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataValueVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataValue * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataValue * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataValue * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFlags )( \n            IXCLRDataValue * This,\n            /* [out] */ ULONG32 *flags);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAddress )( \n            IXCLRDataValue * This,\n            /* [out] */ CLRDATA_ADDRESS *address);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetSize )( \n            IXCLRDataValue * This,\n            /* [out] */ ULONG64 *size);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetBytes )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *dataSize,\n            /* [size_is][out] */ BYTE buffer[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *SetBytes )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *dataSize,\n            /* [size_is][in] */ BYTE buffer[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetType )( \n            IXCLRDataValue * This,\n            /* [out] */ IXCLRDataTypeInstance **typeInstance);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumFields )( \n            IXCLRDataValue * This,\n            /* [out] */ ULONG32 *numFields);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFieldByIndex )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 index,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *Request )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 reqCode,\n            /* [in] */ ULONG32 inBufferSize,\n            /* [size_is][in] */ BYTE *inBuffer,\n            /* [in] */ ULONG32 outBufferSize,\n            /* [size_is][out] */ BYTE *outBuffer);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumFields2 )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTypeInstance *fromType,\n            /* [out] */ ULONG32 *numFields);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumFields )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 flags,\n            /* [in] */ IXCLRDataTypeInstance *fromType,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumField )( \n            IXCLRDataValue * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumFields )( \n            IXCLRDataValue * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *StartEnumFieldsByName )( \n            IXCLRDataValue * This,\n            /* [in] */ LPCWSTR name,\n            /* [in] */ ULONG32 nameFlags,\n            /* [in] */ ULONG32 fieldFlags,\n            /* [in] */ IXCLRDataTypeInstance *fromType,\n            /* [out] */ CLRDATA_ENUM *handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumFieldByName )( \n            IXCLRDataValue * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *EndEnumFieldsByName )( \n            IXCLRDataValue * This,\n            /* [in] */ CLRDATA_ENUM handle);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFieldByToken )( \n            IXCLRDataValue * This,\n            /* [in] */ mdFieldDef token,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAssociatedValue )( \n            IXCLRDataValue * This,\n            /* [out] */ IXCLRDataValue **assocValue);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetAssociatedType )( \n            IXCLRDataValue * This,\n            /* [out] */ IXCLRDataTypeInstance **assocType);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetString )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *strLen,\n            /* [size_is][out] */ WCHAR str[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetArrayProperties )( \n            IXCLRDataValue * This,\n            /* [out] */ ULONG32 *rank,\n            /* [out] */ ULONG32 *totalElements,\n            /* [in] */ ULONG32 numDim,\n            /* [size_is][out] */ ULONG32 dims[  ],\n            /* [in] */ ULONG32 numBases,\n            /* [size_is][out] */ LONG32 bases[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetArrayElement )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 numInd,\n            /* [size_is][in] */ LONG32 indices[  ],\n            /* [out] */ IXCLRDataValue **value);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumField2 )( \n            IXCLRDataValue * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 nameBufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ],\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *EnumFieldByName2 )( \n            IXCLRDataValue * This,\n            /* [out][in] */ CLRDATA_ENUM *handle,\n            /* [out] */ IXCLRDataValue **field,\n            /* [out] */ IXCLRDataModule **tokenScope,\n            /* [out] */ mdFieldDef *token);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetFieldByToken2 )( \n            IXCLRDataValue * This,\n            /* [in] */ IXCLRDataModule *tokenScope,\n            /* [in] */ mdFieldDef token,\n            /* [out] */ IXCLRDataValue **field,\n            /* [in] */ ULONG32 bufLen,\n            /* [out] */ ULONG32 *nameLen,\n            /* [size_is][out] */ WCHAR nameBuf[  ]);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetNumLocations )( \n            IXCLRDataValue * This,\n            /* [out] */ ULONG32 *numLocs);\n        \n        HRESULT ( STDMETHODCALLTYPE *GetLocationByIndex )( \n            IXCLRDataValue * This,\n            /* [in] */ ULONG32 loc,\n            /* [out] */ ULONG32 *flags,\n            /* [out] */ CLRDATA_ADDRESS *arg);\n        \n        END_INTERFACE\n    } IXCLRDataValueVtbl;\n\n    interface IXCLRDataValue\n    {\n        CONST_VTBL struct IXCLRDataValueVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataValue_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataValue_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataValue_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataValue_GetFlags(This,flags)\t\\\n    ( (This)->lpVtbl -> GetFlags(This,flags) ) \n\n#define IXCLRDataValue_GetAddress(This,address)\t\\\n    ( (This)->lpVtbl -> GetAddress(This,address) ) \n\n#define IXCLRDataValue_GetSize(This,size)\t\\\n    ( (This)->lpVtbl -> GetSize(This,size) ) \n\n#define IXCLRDataValue_GetBytes(This,bufLen,dataSize,buffer)\t\\\n    ( (This)->lpVtbl -> GetBytes(This,bufLen,dataSize,buffer) ) \n\n#define IXCLRDataValue_SetBytes(This,bufLen,dataSize,buffer)\t\\\n    ( (This)->lpVtbl -> SetBytes(This,bufLen,dataSize,buffer) ) \n\n#define IXCLRDataValue_GetType(This,typeInstance)\t\\\n    ( (This)->lpVtbl -> GetType(This,typeInstance) ) \n\n#define IXCLRDataValue_GetNumFields(This,numFields)\t\\\n    ( (This)->lpVtbl -> GetNumFields(This,numFields) ) \n\n#define IXCLRDataValue_GetFieldByIndex(This,index,field,bufLen,nameLen,nameBuf,token)\t\\\n    ( (This)->lpVtbl -> GetFieldByIndex(This,index,field,bufLen,nameLen,nameBuf,token) ) \n\n#define IXCLRDataValue_Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer)\t\\\n    ( (This)->lpVtbl -> Request(This,reqCode,inBufferSize,inBuffer,outBufferSize,outBuffer) ) \n\n#define IXCLRDataValue_GetNumFields2(This,flags,fromType,numFields)\t\\\n    ( (This)->lpVtbl -> GetNumFields2(This,flags,fromType,numFields) ) \n\n#define IXCLRDataValue_StartEnumFields(This,flags,fromType,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumFields(This,flags,fromType,handle) ) \n\n#define IXCLRDataValue_EnumField(This,handle,field,nameBufLen,nameLen,nameBuf,token)\t\\\n    ( (This)->lpVtbl -> EnumField(This,handle,field,nameBufLen,nameLen,nameBuf,token) ) \n\n#define IXCLRDataValue_EndEnumFields(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumFields(This,handle) ) \n\n#define IXCLRDataValue_StartEnumFieldsByName(This,name,nameFlags,fieldFlags,fromType,handle)\t\\\n    ( (This)->lpVtbl -> StartEnumFieldsByName(This,name,nameFlags,fieldFlags,fromType,handle) ) \n\n#define IXCLRDataValue_EnumFieldByName(This,handle,field,token)\t\\\n    ( (This)->lpVtbl -> EnumFieldByName(This,handle,field,token) ) \n\n#define IXCLRDataValue_EndEnumFieldsByName(This,handle)\t\\\n    ( (This)->lpVtbl -> EndEnumFieldsByName(This,handle) ) \n\n#define IXCLRDataValue_GetFieldByToken(This,token,field,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetFieldByToken(This,token,field,bufLen,nameLen,nameBuf) ) \n\n#define IXCLRDataValue_GetAssociatedValue(This,assocValue)\t\\\n    ( (This)->lpVtbl -> GetAssociatedValue(This,assocValue) ) \n\n#define IXCLRDataValue_GetAssociatedType(This,assocType)\t\\\n    ( (This)->lpVtbl -> GetAssociatedType(This,assocType) ) \n\n#define IXCLRDataValue_GetString(This,bufLen,strLen,str)\t\\\n    ( (This)->lpVtbl -> GetString(This,bufLen,strLen,str) ) \n\n#define IXCLRDataValue_GetArrayProperties(This,rank,totalElements,numDim,dims,numBases,bases)\t\\\n    ( (This)->lpVtbl -> GetArrayProperties(This,rank,totalElements,numDim,dims,numBases,bases) ) \n\n#define IXCLRDataValue_GetArrayElement(This,numInd,indices,value)\t\\\n    ( (This)->lpVtbl -> GetArrayElement(This,numInd,indices,value) ) \n\n#define IXCLRDataValue_EnumField2(This,handle,field,nameBufLen,nameLen,nameBuf,tokenScope,token)\t\\\n    ( (This)->lpVtbl -> EnumField2(This,handle,field,nameBufLen,nameLen,nameBuf,tokenScope,token) ) \n\n#define IXCLRDataValue_EnumFieldByName2(This,handle,field,tokenScope,token)\t\\\n    ( (This)->lpVtbl -> EnumFieldByName2(This,handle,field,tokenScope,token) ) \n\n#define IXCLRDataValue_GetFieldByToken2(This,tokenScope,token,field,bufLen,nameLen,nameBuf)\t\\\n    ( (This)->lpVtbl -> GetFieldByToken2(This,tokenScope,token,field,bufLen,nameLen,nameBuf) ) \n\n#define IXCLRDataValue_GetNumLocations(This,numLocs)\t\\\n    ( (This)->lpVtbl -> GetNumLocations(This,numLocs) ) \n\n#define IXCLRDataValue_GetLocationByIndex(This,loc,flags,arg)\t\\\n    ( (This)->lpVtbl -> GetLocationByIndex(This,loc,flags,arg) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataValue_INTERFACE_DEFINED__ */\n\n\n/* interface __MIDL_itf_xclrdata_0000_0020 */\n/* [local] */ \n\n#pragma warning(pop)\n\n\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0020_v0_0_c_ifspec;\nextern RPC_IF_HANDLE __MIDL_itf_xclrdata_0000_0020_v0_0_s_ifspec;\n\n#ifndef __IXCLRDataExceptionNotification_INTERFACE_DEFINED__\n#define __IXCLRDataExceptionNotification_INTERFACE_DEFINED__\n\n/* interface IXCLRDataExceptionNotification */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataExceptionNotification;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"2D95A079-42A1-4837-818F-0B97D7048E0E\")\n    IXCLRDataExceptionNotification : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OnCodeGenerated( \n            /* [in] */ IXCLRDataMethodInstance *method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnCodeDiscarded( \n            /* [in] */ IXCLRDataMethodInstance *method) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnProcessExecution( \n            /* [in] */ ULONG32 state) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnTaskExecution( \n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 state) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnModuleLoaded( \n            /* [in] */ IXCLRDataModule *mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnModuleUnloaded( \n            /* [in] */ IXCLRDataModule *mod) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnTypeLoaded( \n            /* [in] */ IXCLRDataTypeInstance *typeInst) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnTypeUnloaded( \n            /* [in] */ IXCLRDataTypeInstance *typeInst) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataExceptionNotificationVtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataExceptionNotification * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataExceptionNotification * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeGenerated )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeDiscarded )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnProcessExecution )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTaskExecution )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleLoaded )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleUnloaded )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeLoaded )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeUnloaded )( \n            IXCLRDataExceptionNotification * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        END_INTERFACE\n    } IXCLRDataExceptionNotificationVtbl;\n\n    interface IXCLRDataExceptionNotification\n    {\n        CONST_VTBL struct IXCLRDataExceptionNotificationVtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataExceptionNotification_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataExceptionNotification_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataExceptionNotification_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataExceptionNotification_OnCodeGenerated(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeGenerated(This,method) ) \n\n#define IXCLRDataExceptionNotification_OnCodeDiscarded(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeDiscarded(This,method) ) \n\n#define IXCLRDataExceptionNotification_OnProcessExecution(This,state)\t\\\n    ( (This)->lpVtbl -> OnProcessExecution(This,state) ) \n\n#define IXCLRDataExceptionNotification_OnTaskExecution(This,task,state)\t\\\n    ( (This)->lpVtbl -> OnTaskExecution(This,task,state) ) \n\n#define IXCLRDataExceptionNotification_OnModuleLoaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleLoaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification_OnModuleUnloaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleUnloaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification_OnTypeLoaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeLoaded(This,typeInst) ) \n\n#define IXCLRDataExceptionNotification_OnTypeUnloaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeUnloaded(This,typeInst) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataExceptionNotification_INTERFACE_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionNotification2_INTERFACE_DEFINED__\n#define __IXCLRDataExceptionNotification2_INTERFACE_DEFINED__\n\n/* interface IXCLRDataExceptionNotification2 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataExceptionNotification2;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"31201a94-4337-49b7-aef7-0c755054091f\")\n    IXCLRDataExceptionNotification2 : public IXCLRDataExceptionNotification\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OnAppDomainLoaded( \n            /* [in] */ IXCLRDataAppDomain *domain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnAppDomainUnloaded( \n            /* [in] */ IXCLRDataAppDomain *domain) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE OnException( \n            /* [in] */ IXCLRDataExceptionState *exception) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataExceptionNotification2Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataExceptionNotification2 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataExceptionNotification2 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeGenerated )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeDiscarded )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnProcessExecution )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTaskExecution )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleLoaded )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleUnloaded )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeLoaded )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeUnloaded )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainLoaded )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainUnloaded )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnException )( \n            IXCLRDataExceptionNotification2 * This,\n            /* [in] */ IXCLRDataExceptionState *exception);\n        \n        END_INTERFACE\n    } IXCLRDataExceptionNotification2Vtbl;\n\n    interface IXCLRDataExceptionNotification2\n    {\n        CONST_VTBL struct IXCLRDataExceptionNotification2Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataExceptionNotification2_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataExceptionNotification2_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataExceptionNotification2_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataExceptionNotification2_OnCodeGenerated(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeGenerated(This,method) ) \n\n#define IXCLRDataExceptionNotification2_OnCodeDiscarded(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeDiscarded(This,method) ) \n\n#define IXCLRDataExceptionNotification2_OnProcessExecution(This,state)\t\\\n    ( (This)->lpVtbl -> OnProcessExecution(This,state) ) \n\n#define IXCLRDataExceptionNotification2_OnTaskExecution(This,task,state)\t\\\n    ( (This)->lpVtbl -> OnTaskExecution(This,task,state) ) \n\n#define IXCLRDataExceptionNotification2_OnModuleLoaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleLoaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification2_OnModuleUnloaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleUnloaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification2_OnTypeLoaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeLoaded(This,typeInst) ) \n\n#define IXCLRDataExceptionNotification2_OnTypeUnloaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeUnloaded(This,typeInst) ) \n\n\n#define IXCLRDataExceptionNotification2_OnAppDomainLoaded(This,domain)\t\\\n    ( (This)->lpVtbl -> OnAppDomainLoaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification2_OnAppDomainUnloaded(This,domain)\t\\\n    ( (This)->lpVtbl -> OnAppDomainUnloaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification2_OnException(This,exception)\t\\\n    ( (This)->lpVtbl -> OnException(This,exception) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataExceptionNotification2_INTERFACE_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionNotification3_INTERFACE_DEFINED__\n#define __IXCLRDataExceptionNotification3_INTERFACE_DEFINED__\n\n/* interface IXCLRDataExceptionNotification3 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataExceptionNotification3;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"31201a94-4337-49b7-aef7-0c7550540920\")\n    IXCLRDataExceptionNotification3 : public IXCLRDataExceptionNotification2\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OnGcEvent( \n            /* [in] */ GcEvtArgs gcEvtArgs) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataExceptionNotification3Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataExceptionNotification3 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataExceptionNotification3 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeGenerated )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeDiscarded )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnProcessExecution )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTaskExecution )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleLoaded )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleUnloaded )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeLoaded )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeUnloaded )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainLoaded )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainUnloaded )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnException )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ IXCLRDataExceptionState *exception);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnGcEvent )( \n            IXCLRDataExceptionNotification3 * This,\n            /* [in] */ GcEvtArgs gcEvtArgs);\n        \n        END_INTERFACE\n    } IXCLRDataExceptionNotification3Vtbl;\n\n    interface IXCLRDataExceptionNotification3\n    {\n        CONST_VTBL struct IXCLRDataExceptionNotification3Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataExceptionNotification3_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataExceptionNotification3_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataExceptionNotification3_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataExceptionNotification3_OnCodeGenerated(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeGenerated(This,method) ) \n\n#define IXCLRDataExceptionNotification3_OnCodeDiscarded(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeDiscarded(This,method) ) \n\n#define IXCLRDataExceptionNotification3_OnProcessExecution(This,state)\t\\\n    ( (This)->lpVtbl -> OnProcessExecution(This,state) ) \n\n#define IXCLRDataExceptionNotification3_OnTaskExecution(This,task,state)\t\\\n    ( (This)->lpVtbl -> OnTaskExecution(This,task,state) ) \n\n#define IXCLRDataExceptionNotification3_OnModuleLoaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleLoaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification3_OnModuleUnloaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleUnloaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification3_OnTypeLoaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeLoaded(This,typeInst) ) \n\n#define IXCLRDataExceptionNotification3_OnTypeUnloaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeUnloaded(This,typeInst) ) \n\n\n#define IXCLRDataExceptionNotification3_OnAppDomainLoaded(This,domain)\t\\\n    ( (This)->lpVtbl -> OnAppDomainLoaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification3_OnAppDomainUnloaded(This,domain)\t\\\n    ( (This)->lpVtbl -> OnAppDomainUnloaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification3_OnException(This,exception)\t\\\n    ( (This)->lpVtbl -> OnException(This,exception) ) \n\n\n#define IXCLRDataExceptionNotification3_OnGcEvent(This,gcEvtArgs)\t\\\n    ( (This)->lpVtbl -> OnGcEvent(This,gcEvtArgs) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __IXCLRDataExceptionNotification3_INTERFACE_DEFINED__ */\n\n\n#ifndef __IXCLRDataExceptionNotification4_INTERFACE_DEFINED__\n#define __IXCLRDataExceptionNotification4_INTERFACE_DEFINED__\n\n/* interface IXCLRDataExceptionNotification4 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataExceptionNotification4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"C25E926E-5F09-4AA2-BBAD-B7FC7F10CFD7\")\n    IXCLRDataExceptionNotification4 : public IXCLRDataExceptionNotification3\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE ExceptionCatcherEnter( \n            /* [in] */ IXCLRDataMethodInstance *catchingMethod,\n            DWORD catcherNativeOffset) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct IXCLRDataExceptionNotification4Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataExceptionNotification4 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataExceptionNotification4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeGenerated )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeDiscarded )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnProcessExecution )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTaskExecution )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleLoaded )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleUnloaded )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeLoaded )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeUnloaded )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainLoaded )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainUnloaded )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnException )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataExceptionState *exception);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnGcEvent )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ GcEvtArgs gcEvtArgs);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( \n            IXCLRDataExceptionNotification4 * This,\n            /* [in] */ IXCLRDataMethodInstance *catchingMethod,\n            DWORD catcherNativeOffset);\n        \n        END_INTERFACE\n    } IXCLRDataExceptionNotification4Vtbl;\n\n    interface IXCLRDataExceptionNotification4\n    {\n        CONST_VTBL struct IXCLRDataExceptionNotification4Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataExceptionNotification4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataExceptionNotification4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataExceptionNotification4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataExceptionNotification4_OnCodeGenerated(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeGenerated(This,method) ) \n\n#define IXCLRDataExceptionNotification4_OnCodeDiscarded(This,method)\t\\\n    ( (This)->lpVtbl -> OnCodeDiscarded(This,method) ) \n\n#define IXCLRDataExceptionNotification4_OnProcessExecution(This,state)\t\\\n    ( (This)->lpVtbl -> OnProcessExecution(This,state) ) \n\n#define IXCLRDataExceptionNotification4_OnTaskExecution(This,task,state)\t\\\n    ( (This)->lpVtbl -> OnTaskExecution(This,task,state) ) \n\n#define IXCLRDataExceptionNotification4_OnModuleLoaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleLoaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification4_OnModuleUnloaded(This,mod)\t\\\n    ( (This)->lpVtbl -> OnModuleUnloaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification4_OnTypeLoaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeLoaded(This,typeInst) ) \n\n#define IXCLRDataExceptionNotification4_OnTypeUnloaded(This,typeInst)\t\\\n    ( (This)->lpVtbl -> OnTypeUnloaded(This,typeInst) ) \n\n\n#define IXCLRDataExceptionNotification4_OnAppDomainLoaded(This,domain)\t\\\n    ( (This)->lpVtbl -> OnAppDomainLoaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification4_OnAppDomainUnloaded(This,domain)\t\\\n    ( (This)->lpVtbl -> OnAppDomainUnloaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification4_OnException(This,exception)\t\\\n    ( (This)->lpVtbl -> OnException(This,exception) ) \n\n\n#define IXCLRDataExceptionNotification4_OnGcEvent(This,gcEvtArgs)\t\\\n    ( (This)->lpVtbl -> OnGcEvent(This,gcEvtArgs) ) \n\n\n#define IXCLRDataExceptionNotification4_ExceptionCatcherEnter(This,catchingMethod,catcherNativeOffset)\t\\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,catchingMethod,catcherNativeOffset) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n#ifndef __IXCLRDataExceptionNotification5_INTERFACE_DEFINED__\n#define __IXCLRDataExceptionNotification5_INTERFACE_DEFINED__\n\n/* interface IXCLRDataExceptionNotification5 */\n/* [uuid][local][object] */ \n\n\nEXTERN_C const IID IID_IXCLRDataExceptionNotification5;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"e77a39ea-3548-44d9-b171-8569ed1a9423\")\n    IXCLRDataExceptionNotification5 : public IXCLRDataExceptionNotification4\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE OnCodeGenerated2( \n            /* [in] */ IXCLRDataMethodInstance *method,\n            /* [in] */ CLRDATA_ADDRESS nativeCodeLocation) = 0;\n        \n    };\n    \n    \n#else   /* C style interface */\n\n    typedef struct IXCLRDataExceptionNotification5Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            IXCLRDataExceptionNotification5 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            IXCLRDataExceptionNotification5 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeGenerated )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeDiscarded )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataMethodInstance *method);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnProcessExecution )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTaskExecution )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataTask *task,\n            /* [in] */ ULONG32 state);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleLoaded )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnModuleUnloaded )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataModule *mod);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeLoaded )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnTypeUnloaded )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataTypeInstance *typeInst);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainLoaded )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnAppDomainUnloaded )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataAppDomain *domain);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnException )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataExceptionState *exception);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnGcEvent )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ GcEvtArgs gcEvtArgs);\n        \n        HRESULT ( STDMETHODCALLTYPE *ExceptionCatcherEnter )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataMethodInstance *catchingMethod,\n            DWORD catcherNativeOffset);\n        \n        HRESULT ( STDMETHODCALLTYPE *OnCodeGenerated2 )( \n            IXCLRDataExceptionNotification5 * This,\n            /* [in] */ IXCLRDataMethodInstance *method,\n            /* [in] */ CLRDATA_ADDRESS nativeCodeLocation);\n        \n        END_INTERFACE\n    } IXCLRDataExceptionNotification5Vtbl;\n\n    interface IXCLRDataExceptionNotification5\n    {\n        CONST_VTBL struct IXCLRDataExceptionNotification5Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define IXCLRDataExceptionNotification5_QueryInterface(This,riid,ppvObject) \\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define IXCLRDataExceptionNotification5_AddRef(This)    \\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define IXCLRDataExceptionNotification5_Release(This)   \\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define IXCLRDataExceptionNotification5_OnCodeGenerated(This,method)    \\\n    ( (This)->lpVtbl -> OnCodeGenerated(This,method) ) \n\n#define IXCLRDataExceptionNotification5_OnCodeDiscarded(This,method)    \\\n    ( (This)->lpVtbl -> OnCodeDiscarded(This,method) ) \n\n#define IXCLRDataExceptionNotification5_OnProcessExecution(This,state)  \\\n    ( (This)->lpVtbl -> OnProcessExecution(This,state) ) \n\n#define IXCLRDataExceptionNotification5_OnTaskExecution(This,task,state)    \\\n    ( (This)->lpVtbl -> OnTaskExecution(This,task,state) ) \n\n#define IXCLRDataExceptionNotification5_OnModuleLoaded(This,mod)    \\\n    ( (This)->lpVtbl -> OnModuleLoaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification5_OnModuleUnloaded(This,mod)  \\\n    ( (This)->lpVtbl -> OnModuleUnloaded(This,mod) ) \n\n#define IXCLRDataExceptionNotification5_OnTypeLoaded(This,typeInst) \\\n    ( (This)->lpVtbl -> OnTypeLoaded(This,typeInst) ) \n\n#define IXCLRDataExceptionNotification5_OnTypeUnloaded(This,typeInst)   \\\n    ( (This)->lpVtbl -> OnTypeUnloaded(This,typeInst) ) \n\n\n#define IXCLRDataExceptionNotification5_OnAppDomainLoaded(This,domain)  \\\n    ( (This)->lpVtbl -> OnAppDomainLoaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification5_OnAppDomainUnloaded(This,domain)    \\\n    ( (This)->lpVtbl -> OnAppDomainUnloaded(This,domain) ) \n\n#define IXCLRDataExceptionNotification5_OnException(This,exception) \\\n    ( (This)->lpVtbl -> OnException(This,exception) ) \n\n\n#define IXCLRDataExceptionNotification5_OnGcEvent(This,gcEvtArgs)   \\\n    ( (This)->lpVtbl -> OnGcEvent(This,gcEvtArgs) ) \n\n\n#define IXCLRDataExceptionNotification5_ExceptionCatcherEnter(This,catchingMethod,catcherNativeOffset)  \\\n    ( (This)->lpVtbl -> ExceptionCatcherEnter(This,catchingMethod,catcherNativeOffset) ) \n\n\n#define IXCLRDataExceptionNotification5_OnCodeGenerated2(This,method,nativeCodeLocation)    \\\n    ( (This)->lpVtbl -> OnCodeGenerated2(This,method,nativeCodeLocation) ) \n\n#endif /* COBJMACROS */\n\n\n#endif  /* C style interface */\n\n\n\n\n#endif  /* __IXCLRDataExceptionNotification5_INTERFACE_DEFINED__ */\n\n\n\n\n#endif \t/* __IXCLRDataExceptionNotification4_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/external/coreclr/pal/prebuilt/inc/xcordebug.h",
    "content": "\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler version 8.01.0622 */\n/* at Mon Jan 18 19:14:07 2038\n */\n/* Compiler settings for F:/Dev/coreclr/inc/xcordebug.idl:\n    Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622 \n    protocol : dce , ms_ext, c_ext, robust\n    error checks: allocation ref bounds_check enum stub_data \n    VC __declspec() decoration level: \n         __declspec(uuid()), __declspec(selectany), __declspec(novtable)\n         DECLSPEC_UUID(), MIDL_INTERFACE()\n*/\n/* @@MIDL_FILE_HEADING(  ) */\n\n#pragma warning( disable: 4049 )  /* more than 64k source lines */\n\n\n/* verify that the <rpcndr.h> version is high enough to compile this file*/\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#define __REQUIRED_RPCNDR_H_VERSION__ 475\n#endif\n\n#include \"rpc.h\"\n#include \"rpcndr.h\"\n\n#ifndef __RPCNDR_H_VERSION__\n#error this stub requires an updated version of <rpcndr.h>\n#endif /* __RPCNDR_H_VERSION__ */\n\n#ifndef COM_NO_WINDOWS_H\n#include \"windows.h\"\n#include \"ole2.h\"\n#endif /*COM_NO_WINDOWS_H*/\n\n#ifndef __xcordebug_h__\n#define __xcordebug_h__\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1020)\n#pragma once\n#endif\n\n/* Forward Declarations */ \n\n#ifndef __ICorDebugProcess4_FWD_DEFINED__\n#define __ICorDebugProcess4_FWD_DEFINED__\ntypedef interface ICorDebugProcess4 ICorDebugProcess4;\n\n#endif \t/* __ICorDebugProcess4_FWD_DEFINED__ */\n\n\n/* header files for imported files */\n#include \"cordebug.h\"\n\n#ifdef __cplusplus\nextern \"C\"{\n#endif \n\n\n#ifndef __ICorDebugProcess4_INTERFACE_DEFINED__\n#define __ICorDebugProcess4_INTERFACE_DEFINED__\n\n/* interface ICorDebugProcess4 */\n/* [unique][uuid][local][object] */ \n\n\nEXTERN_C const IID IID_ICorDebugProcess4;\n\n#if defined(__cplusplus) && !defined(CINTERFACE)\n    \n    MIDL_INTERFACE(\"E930C679-78AF-4953-8AB7-B0AABF0F9F80\")\n    ICorDebugProcess4 : public IUnknown\n    {\n    public:\n        virtual HRESULT STDMETHODCALLTYPE Filter( \n            /* [size_is][length_is][in] */ const BYTE pRecord[  ],\n            /* [in] */ DWORD countBytes,\n            /* [in] */ CorDebugRecordFormat format,\n            /* [in] */ DWORD dwFlags,\n            /* [in] */ DWORD dwThreadId,\n            /* [in] */ ICorDebugManagedCallback *pCallback,\n            /* [out][in] */ CORDB_CONTINUE_STATUS *pContinueStatus) = 0;\n        \n        virtual HRESULT STDMETHODCALLTYPE ProcessStateChanged( \n            /* [in] */ CorDebugStateChange eChange) = 0;\n        \n    };\n    \n    \n#else \t/* C style interface */\n\n    typedef struct ICorDebugProcess4Vtbl\n    {\n        BEGIN_INTERFACE\n        \n        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( \n            ICorDebugProcess4 * This,\n            /* [in] */ REFIID riid,\n            /* [annotation][iid_is][out] */ \n            _COM_Outptr_  void **ppvObject);\n        \n        ULONG ( STDMETHODCALLTYPE *AddRef )( \n            ICorDebugProcess4 * This);\n        \n        ULONG ( STDMETHODCALLTYPE *Release )( \n            ICorDebugProcess4 * This);\n        \n        HRESULT ( STDMETHODCALLTYPE *Filter )( \n            ICorDebugProcess4 * This,\n            /* [size_is][length_is][in] */ const BYTE pRecord[  ],\n            /* [in] */ DWORD countBytes,\n            /* [in] */ CorDebugRecordFormat format,\n            /* [in] */ DWORD dwFlags,\n            /* [in] */ DWORD dwThreadId,\n            /* [in] */ ICorDebugManagedCallback *pCallback,\n            /* [out][in] */ CORDB_CONTINUE_STATUS *pContinueStatus);\n        \n        HRESULT ( STDMETHODCALLTYPE *ProcessStateChanged )( \n            ICorDebugProcess4 * This,\n            /* [in] */ CorDebugStateChange eChange);\n        \n        END_INTERFACE\n    } ICorDebugProcess4Vtbl;\n\n    interface ICorDebugProcess4\n    {\n        CONST_VTBL struct ICorDebugProcess4Vtbl *lpVtbl;\n    };\n\n    \n\n#ifdef COBJMACROS\n\n\n#define ICorDebugProcess4_QueryInterface(This,riid,ppvObject)\t\\\n    ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) \n\n#define ICorDebugProcess4_AddRef(This)\t\\\n    ( (This)->lpVtbl -> AddRef(This) ) \n\n#define ICorDebugProcess4_Release(This)\t\\\n    ( (This)->lpVtbl -> Release(This) ) \n\n\n#define ICorDebugProcess4_Filter(This,pRecord,countBytes,format,dwFlags,dwThreadId,pCallback,pContinueStatus)\t\\\n    ( (This)->lpVtbl -> Filter(This,pRecord,countBytes,format,dwFlags,dwThreadId,pCallback,pContinueStatus) ) \n\n#define ICorDebugProcess4_ProcessStateChanged(This,eChange)\t\\\n    ( (This)->lpVtbl -> ProcessStateChanged(This,eChange) ) \n\n#endif /* COBJMACROS */\n\n\n#endif \t/* C style interface */\n\n\n\n\n#endif \t/* __ICorDebugProcess4_INTERFACE_DEFINED__ */\n\n\n/* Additional Prototypes for ALL interfaces */\n\n/* end of Additional Prototypes */\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n"
  },
  {
    "path": "src/ManagedProfiler/framework.h",
    "content": "#pragma once\n\n#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers\n// Windows Header Files\n#include <windows.h>\n"
  },
  {
    "path": "src/PDBViewer/AboutBox.Designer.cs",
    "content": "﻿namespace PDBViewer;\n\npartial class AboutBox {\n  /// <summary>\n  /// Required designer variable.\n  /// </summary>\n  private System.ComponentModel.IContainer components = null;\n\n  /// <summary>\n  /// Clean up any resources being used.\n  /// </summary>\n  protected override void Dispose(bool disposing) {\n    if (disposing && (components != null)) {\n      components.Dispose();\n    }\n    base.Dispose(disposing);\n  }\n\n  #region Windows Form Designer generated code\n\n  /// <summary>\n  /// Required method for Designer support - do not modify\n  /// the contents of this method with the code editor.\n  /// </summary>\n  private void InitializeComponent() {\n    tableLayoutPanel = new TableLayoutPanel();\n    labelProductName = new Label();\n    labelVersion = new Label();\n    labelCopyright = new Label();\n    okButton = new Button();\n    tableLayoutPanel.SuspendLayout();\n    SuspendLayout();\n    // \n    // tableLayoutPanel\n    // \n    tableLayoutPanel.ColumnCount = 1;\n    tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));\n    tableLayoutPanel.Controls.Add(labelProductName, 0, 0);\n    tableLayoutPanel.Controls.Add(labelVersion, 0, 1);\n    tableLayoutPanel.Controls.Add(labelCopyright, 0, 2);\n    tableLayoutPanel.Controls.Add(okButton, 0, 4);\n    tableLayoutPanel.Dock = DockStyle.Fill;\n    tableLayoutPanel.Location = new Point(15, 17);\n    tableLayoutPanel.Margin = new Padding(5, 6, 5, 6);\n    tableLayoutPanel.Name = \"tableLayoutPanel\";\n    tableLayoutPanel.RowCount = 5;\n    tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));\n    tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));\n    tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));\n    tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 25F));\n    tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 56F));\n    tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F));\n    tableLayoutPanel.Size = new Size(429, 175);\n    tableLayoutPanel.TabIndex = 0;\n    // \n    // labelProductName\n    // \n    labelProductName.Dock = DockStyle.Fill;\n    labelProductName.Location = new Point(10, 0);\n    labelProductName.Margin = new Padding(10, 0, 5, 0);\n    labelProductName.MaximumSize = new Size(0, 33);\n    labelProductName.Name = \"labelProductName\";\n    labelProductName.Size = new Size(414, 29);\n    labelProductName.TabIndex = 19;\n    labelProductName.Text = \"Product Name\";\n    labelProductName.TextAlign = ContentAlignment.MiddleLeft;\n    // \n    // labelVersion\n    // \n    labelVersion.Dock = DockStyle.Fill;\n    labelVersion.Location = new Point(10, 29);\n    labelVersion.Margin = new Padding(10, 0, 5, 0);\n    labelVersion.MaximumSize = new Size(0, 33);\n    labelVersion.Name = \"labelVersion\";\n    labelVersion.Size = new Size(414, 29);\n    labelVersion.TabIndex = 0;\n    labelVersion.Text = \"Version\";\n    labelVersion.TextAlign = ContentAlignment.MiddleLeft;\n    // \n    // labelCopyright\n    // \n    labelCopyright.Dock = DockStyle.Fill;\n    labelCopyright.Location = new Point(10, 58);\n    labelCopyright.Margin = new Padding(10, 0, 5, 0);\n    labelCopyright.MaximumSize = new Size(0, 33);\n    labelCopyright.Name = \"labelCopyright\";\n    labelCopyright.Size = new Size(414, 29);\n    labelCopyright.TabIndex = 21;\n    labelCopyright.Text = \"Copyright\";\n    labelCopyright.TextAlign = ContentAlignment.MiddleLeft;\n    // \n    // okButton\n    // \n    okButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;\n    okButton.DialogResult = DialogResult.Cancel;\n    okButton.Location = new Point(322, 137);\n    okButton.Margin = new Padding(5, 6, 5, 6);\n    okButton.Name = \"okButton\";\n    okButton.Size = new Size(102, 32);\n    okButton.TabIndex = 24;\n    okButton.Text = \"&OK\";\n    // \n    // AboutBox\n    // \n    AcceptButton = okButton;\n    AutoScaleDimensions = new SizeF(10F, 25F);\n    AutoScaleMode = AutoScaleMode.Font;\n    ClientSize = new Size(459, 209);\n    Controls.Add(tableLayoutPanel);\n    FormBorderStyle = FormBorderStyle.FixedDialog;\n    Margin = new Padding(5, 6, 5, 6);\n    MaximizeBox = false;\n    MinimizeBox = false;\n    Name = \"AboutBox\";\n    Padding = new Padding(15, 17, 15, 17);\n    ShowIcon = false;\n    ShowInTaskbar = false;\n    StartPosition = FormStartPosition.CenterParent;\n    Text = \"About PDB Viewer\";\n    tableLayoutPanel.ResumeLayout(false);\n    ResumeLayout(false);\n  }\n\n  #endregion\n\n  private System.Windows.Forms.TableLayoutPanel tableLayoutPanel;\n  private Label labelProductName;\n  private Label labelVersion;\n  private Label labelCopyright;\n  private Button okButton;\n}\n"
  },
  {
    "path": "src/PDBViewer/AboutBox.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Reflection;\n\nnamespace PDBViewer;\n\npartial class AboutBox : Form {\n  public AboutBox() {\n    InitializeComponent();\n    labelProductName.Text = AssemblyProduct;\n    labelVersion.Text = string.Format(\"Version {0}\", AssemblyVersion);\n    labelCopyright.Text = AssemblyCopyright;\n  }\n\n  public string AssemblyVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();\n\n  public string AssemblyProduct {\n    get {\n      object[] attributes =\n        Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);\n\n      if (attributes.Length == 0) {\n        return \"\";\n      }\n\n      return ((AssemblyProductAttribute)attributes[0]).Product;\n    }\n  }\n\n  public string AssemblyCopyright {\n    get {\n      object[] attributes = Assembly.GetExecutingAssembly().\n        GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);\n\n      if (attributes.Length == 0) {\n        return \"\";\n      }\n\n      return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;\n    }\n  }\n}"
  },
  {
    "path": "src/PDBViewer/AboutBox.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!--\n    Microsoft ResX Schema\n\n    Version 2.0\n\n    The primary goals of this format is to allow a simple XML format\n    that is mostly human readable. The generation and parsing of the\n    various data types are done through the TypeConverter classes\n    associated with the data types.\n\n    Example:\n\n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n\n    There are any number of \"resheader\" rows that contain simple\n    name/value pairs.\n\n    Each data row contains a name, and value. The row also contains a\n    type or mimetype. Type corresponds to a .NET class that support\n    text/value conversion through the TypeConverter architecture.\n    Classes that don't support this are serialized and stored with the\n    mimetype set.\n\n    The mimetype is used for serialized objects, and tells the\n    ResXResourceReader how to depersist the object. This is currently not\n    extensible. For a given mimetype the value must be set accordingly:\n\n    Note - application/x-microsoft.net.object.binary.base64 is the format\n    that the ResXResourceWriter will generate, however the reader can\n    read any of the formats listed below.\n\n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with\n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with\n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array\n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "src/PDBViewer/DebugInfoModel.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace PDBViewer;\n\n//? TODO: Move to ProfileExplorerCore and share with ProfileExplorerUI.\npublic class FunctionDebugInfo : IEquatable<FunctionDebugInfo>, IComparable<FunctionDebugInfo>, IComparable<long> {\n  public static readonly FunctionDebugInfo Unknown = new(null, 0, 0);\n\n  public FunctionDebugInfo(string name, long rva, uint size) {\n    Name = name;\n    RVA = rva;\n    Size = size;\n    SourceLines = null;\n  }\n\n  public string Name { get; private set; }\n  public List<SourceLineDebugInfo> SourceLines { get; set; }\n  public long RVA { get; set; }\n  public uint Size { get; set; }\n  public bool HasSourceLines => SourceLines is {Count: > 0};\n  public SourceLineDebugInfo FirstSourceLine => HasSourceLines ? SourceLines[0] : SourceLineDebugInfo.Unknown;\n  public SourceLineDebugInfo LastSourceLine => HasSourceLines ? SourceLines[^1] : SourceLineDebugInfo.Unknown;\n  public string SourceFileName => HasSourceLines ? SourceLines[0].FilePath : null;\n  public string OriginalSourceFileName { get; set; }\n  public long StartRVA => RVA;\n  public long EndRVA => RVA + Size - 1;\n  public bool IsUnknown => RVA == 0 && Size == 0;\n  public bool IsPublic { get; set; }\n  public bool IsSelected { get; set; }\n  public bool HasOverlap { get; set; }\n  public bool HasSelectionOverlap { get; set; }\n\n  public int CompareTo(FunctionDebugInfo other) {\n    // Used by sorting.\n    if (other == null)\n      return 0;\n\n    if (other.StartRVA < StartRVA) {\n      return 1;\n    }\n\n    if (other.StartRVA > StartRVA) {\n      return -1;\n    }\n\n    return 0;\n  }\n\n  public int CompareTo(long value) {\n    // Used by binary search.\n    if (value < StartRVA) {\n      return 1;\n    }\n\n    if (value > EndRVA) {\n      return -1;\n    }\n\n    return 0;\n  }\n\n  public bool Equals(FunctionDebugInfo other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return RVA == other.RVA &&\n           Size == other.Size;\n  }\n\n  public static FunctionDebugInfo BinarySearch(List<FunctionDebugInfo> ranges, long value,\n                                               bool hasOverlappingFuncts = false) {\n    int low = 0;\n    int high = ranges.Count - 1;\n\n    while (low <= high) {\n      int mid = low + (high - low) / 2;\n      var range = ranges[mid];\n      int result = range.CompareTo(value);\n\n      if (result == 0) {\n        return range;\n      }\n\n      if (result < 0) {\n        low = mid + 1;\n      }\n      else {\n        high = mid - 1;\n      }\n    }\n\n    return null;\n  }\n\n  public void AddSourceLine(SourceLineDebugInfo sourceLine) {\n    SourceLines ??= new List<SourceLineDebugInfo>(1);\n    SourceLines.Add(sourceLine);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is FunctionDebugInfo info && Equals(info);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(RVA, Size);\n  }\n\n  public override string ToString() {\n    return $\"{Name}, RVA: {RVA:X}, Size: {Size}\";\n  }\n}\n\npublic class SourceLineDebugInfo : IEquatable<SourceLineDebugInfo> {\n  public static readonly SourceLineDebugInfo Unknown = new(-1, -1);\n\n  public SourceLineDebugInfo(int rva, int line, int column = 0, string filePath = null) {\n    RVA = rva;\n    Line = line;\n    Column = column;\n    FilePath = filePath != null ? string.Intern(filePath) : null;\n  }\n\n  public int RVA { get; set; }\n  public int Line { get; set; }\n  public int Column { get; set; }\n  public string FilePath { get; private set; } //? Move to FunctionDebugInfo, add OriginalFilePath for SourceLink\n  public List<SourceStackFrame> Inlinees { get; set; }\n  public int InlineeCount => Inlinees != null ? Inlinees.Count : 0;\n  public bool IsUnknown => Line == -1;\n\n  public bool Equals(SourceLineDebugInfo other) {\n    return RVA == other.RVA && Line == other.Line &&\n           Column == other.Column &&\n           FilePath.Equals(other.FilePath, StringComparison.Ordinal);\n  }\n\n  public void AddInlinee(SourceStackFrame inlinee) {\n    Inlinees ??= new List<SourceStackFrame>();\n    Inlinees.Add(inlinee);\n  }\n\n  public bool HasInlinee(SourceStackFrame inlinee) {\n    return Inlinees != null && Inlinees.Contains(inlinee);\n  }\n\n  public SourceStackFrame FindSameFunctionInlinee(SourceStackFrame inlinee) {\n    return Inlinees?.Find(item => item.HasSameFunction(inlinee));\n  }\n\n  public override bool Equals(object obj) {\n    return obj is SourceLineDebugInfo other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(FilePath, Line, Column);\n  }\n}\n\npublic sealed class SourceStackFrame : IEquatable<SourceStackFrame> {\n  public SourceStackFrame(string function, string filePath, int line, int column) {\n    Function = function;\n    FilePath = filePath;\n    Line = line;\n    Column = column;\n  }\n\n  public string Function { get; set; }\n  public string FilePath { get; set; }\n  public int Line { get; set; }\n  public int Column { get; set; }\n\n  public bool Equals(SourceStackFrame other) {\n    if (ReferenceEquals(null, other))\n      return false;\n    if (ReferenceEquals(this, other))\n      return true;\n    return Line == other.Line && Column == other.Column &&\n           Function.Equals(other.Function, StringComparison.OrdinalIgnoreCase) &&\n           FilePath.Equals(other.FilePath, StringComparison.OrdinalIgnoreCase);\n  }\n\n  public static bool operator ==(SourceStackFrame left, SourceStackFrame right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(SourceStackFrame left, SourceStackFrame right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is SourceStackFrame other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Function, FilePath, Line, Column);\n  }\n\n  public bool HasSameFunction(SourceStackFrame inlinee) {\n    return Function.Equals(inlinee.Function, StringComparison.OrdinalIgnoreCase) &&\n           FilePath.Equals(inlinee.FilePath, StringComparison.OrdinalIgnoreCase);\n  }\n}\n\nstatic class NativeMethods {\n  // C++ function name demangling\n  [Flags]\n  public enum UnDecorateFlags {\n    UNDNAME_COMPLETE = 0x0000, // Enable full undecoration\n    UNDNAME_NO_LEADING_UNDERSCORES = 0x0001, // Remove leading underscores from MS extended keywords\n    UNDNAME_NO_MS_KEYWORDS = 0x0002, // Disable expansion of MS extended keywords\n    UNDNAME_NO_FUNCTION_RETURNS = 0x0004, // Disable expansion of return type for primary declaration\n    UNDNAME_NO_ALLOCATION_MODEL = 0x0008, // Disable expansion of the declaration model\n    UNDNAME_NO_ALLOCATION_LANGUAGE = 0x0010, // Disable expansion of the declaration language specifier\n    UNDNAME_NO_MS_THISTYPE = 0x0020, // NYI Disable expansion of MS keywords on the 'this' type for primary declaration\n    UNDNAME_NO_CV_THISTYPE = 0x0040, // NYI Disable expansion of CV modifiers on the 'this' type for primary declaration\n    UNDNAME_NO_THISTYPE = 0x0060, // Disable all modifiers on the 'this' type\n    UNDNAME_NO_ACCESS_SPECIFIERS = 0x0080, // Disable expansion of access specifiers for members\n    UNDNAME_NO_THROW_SIGNATURES =\n      0x0100, // Disable expansion of 'throw-signatures' for functions and pointers to functions\n    UNDNAME_NO_MEMBER_TYPE = 0x0200, // Disable expansion of 'static' or 'virtual'ness of members\n    UNDNAME_NO_RETURN_UDT_MODEL = 0x0400, // Disable expansion of MS model for UDT returns\n    UNDNAME_32_BIT_DECODE = 0x0800, // Undecorate 32-bit decorated names\n    UNDNAME_NAME_ONLY = 0x1000, // Crack only the name for primary declaration;\n    // return just [scope::]name.  Does expand template params\n    UNDNAME_NO_ARGUMENTS = 0x2000, // Don't undecorate arguments to function\n    UNDNAME_NO_SPECIAL_SYMS = 0x4000 // Don't undecorate special names (v-table, vcall, vector xxx, metatype, etc)\n  }\n\n  [DllImport(\"dbghelp.dll\", SetLastError = true, PreserveSig = true)]\n  public static extern int UnDecorateSymbolName(\n    [In][MarshalAs(UnmanagedType.LPStr)] string DecoratedName,\n    [Out] StringBuilder UnDecoratedName,\n    [In][MarshalAs(UnmanagedType.U4)] int UndecoratedLength,\n    [In][MarshalAs(UnmanagedType.U4)] UnDecorateFlags Flags);\n}"
  },
  {
    "path": "src/PDBViewer/MainForm.Designer.cs",
    "content": "﻿namespace PDBViewer\n{\n    partial class MainForm\n    {\n        /// <summary>\n        ///  Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        ///  Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing)\n        {\n            if (disposing && (components != null))\n            {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n    #region Windows Form Designer generated code\n\n    /// <summary>\n    ///  Required method for Designer support - do not modify\n    ///  the contents of this method with the code editor.\n    /// </summary>\n    private void InitializeComponent() {\n      var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));\n      toolStrip1 = new ToolStrip();\n      OpenButton = new ToolStripButton();\n      toolStripSeparator1 = new ToolStripSeparator();\n      toolStripDropDownButton1 = new ToolStripDropDownButton();\n      ShowFunctionsCheckbox = new ToolStripMenuItem();\n      ShowPublicsCheckbox = new ToolStripMenuItem();\n      DemangleCheckbox = new ToolStripButton();\n      toolStripSeparator3 = new ToolStripSeparator();\n      toolStripLabel1 = new ToolStripLabel();\n      RVATextbox = new ToolStripTextBox();\n      SubtractRVAButton = new ToolStripButton();\n      AddRVAButton = new ToolStripButton();\n      HexCheckbox = new ToolStripButton();\n      toolStripSeparator2 = new ToolStripSeparator();\n      toolStripLabel2 = new ToolStripLabel();\n      SearchTextbox = new ToolStripTextBox();\n      SearchResetButton = new ToolStripButton();\n      RegexCheckbox = new ToolStripButton();\n      toolStripSeparator4 = new ToolStripSeparator();\n      AboutButton = new ToolStripButton();\n      statusStrip1 = new StatusStrip();\n      toolStripStatusLabel1 = new ToolStripStatusLabel();\n      SymbolCountLabel = new ToolStripStatusLabel();\n      toolStripStatusLabel2 = new ToolStripStatusLabel();\n      TotalSymbolCountLabel = new ToolStripStatusLabel();\n      StatusLabel = new ToolStripStatusLabel();\n      ProgressBar = new ToolStripProgressBar();\n      OpenFileDialog = new OpenFileDialog();\n      splitContainer1 = new SplitContainer();\n      FunctionListView = new ListView();\n      columnHeader1 = new ColumnHeader();\n      columnHeader2 = new ColumnHeader();\n      columnHeader3 = new ColumnHeader();\n      columnHeader5 = new ColumnHeader();\n      columnHeader4 = new ColumnHeader();\n      columnHeader6 = new ColumnHeader();\n      tabControl1 = new TabControl();\n      tabPage1 = new TabPage();\n      FunctionDeteailsTextBox = new TextBox();\n      tabPage2 = new TabPage();\n      splitContainer2 = new SplitContainer();\n      SourceLineListView = new ListView();\n      columnHeader9 = new ColumnHeader();\n      columnHeader7 = new ColumnHeader();\n      columnHeader8 = new ColumnHeader();\n      columnHeader10 = new ColumnHeader();\n      columnHeader14 = new ColumnHeader();\n      tabControl2 = new TabControl();\n      tabPage4 = new TabPage();\n      SourceTextBox = new RichTextBox();\n      LineNumbersTextBox = new RichTextBox();\n      toolStrip2 = new ToolStrip();\n      SourceOpenButton = new ToolStripButton();\n      toolStripSeparator5 = new ToolStripSeparator();\n      SourceFileLabel = new ToolStripLabel();\n      tabPage3 = new TabPage();\n      InlineeListView = new ListView();\n      columnHeader13 = new ColumnHeader();\n      columnHeader11 = new ColumnHeader();\n      columnHeader12 = new ColumnHeader();\n      columnHeader15 = new ColumnHeader();\n      SourceOpenFileDialog = new OpenFileDialog();\n      toolStrip1.SuspendLayout();\n      statusStrip1.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();\n      splitContainer1.Panel1.SuspendLayout();\n      splitContainer1.Panel2.SuspendLayout();\n      splitContainer1.SuspendLayout();\n      tabControl1.SuspendLayout();\n      tabPage1.SuspendLayout();\n      tabPage2.SuspendLayout();\n      ((System.ComponentModel.ISupportInitialize)splitContainer2).BeginInit();\n      splitContainer2.Panel1.SuspendLayout();\n      splitContainer2.Panel2.SuspendLayout();\n      splitContainer2.SuspendLayout();\n      tabControl2.SuspendLayout();\n      tabPage4.SuspendLayout();\n      toolStrip2.SuspendLayout();\n      tabPage3.SuspendLayout();\n      SuspendLayout();\n      // \n      // toolStrip1\n      // \n      toolStrip1.AutoSize = false;\n      toolStrip1.BackColor = SystemColors.Control;\n      toolStrip1.CanOverflow = false;\n      toolStrip1.GripStyle = ToolStripGripStyle.Hidden;\n      toolStrip1.ImageScalingSize = new Size(28, 28);\n      toolStrip1.Items.AddRange(new ToolStripItem[] { OpenButton, toolStripSeparator1, toolStripDropDownButton1, DemangleCheckbox, toolStripSeparator3, toolStripLabel1, RVATextbox, SubtractRVAButton, AddRVAButton, HexCheckbox, toolStripSeparator2, toolStripLabel2, SearchTextbox, SearchResetButton, RegexCheckbox, toolStripSeparator4, AboutButton });\n      toolStrip1.Location = new Point(0, 0);\n      toolStrip1.Name = \"toolStrip1\";\n      toolStrip1.RenderMode = ToolStripRenderMode.System;\n      toolStrip1.Size = new Size(1566, 40);\n      toolStrip1.TabIndex = 0;\n      toolStrip1.Text = \"toolStrip1\";\n      // \n      // OpenButton\n      // \n      OpenButton.Image = (Image)resources.GetObject(\"OpenButton.Image\");\n      OpenButton.ImageScaling = ToolStripItemImageScaling.None;\n      OpenButton.ImageTransparentColor = Color.Magenta;\n      OpenButton.Margin = new Padding(2, 1, 0, 2);\n      OpenButton.Name = \"OpenButton\";\n      OpenButton.Size = new Size(76, 37);\n      OpenButton.Text = \"Open\";\n      OpenButton.ToolTipText = \"Open PDB file\";\n      OpenButton.Click += OpenButton_Click;\n      // \n      // toolStripSeparator1\n      // \n      toolStripSeparator1.Name = \"toolStripSeparator1\";\n      toolStripSeparator1.Size = new Size(6, 40);\n      // \n      // toolStripDropDownButton1\n      // \n      toolStripDropDownButton1.DisplayStyle = ToolStripItemDisplayStyle.Text;\n      toolStripDropDownButton1.DropDownItems.AddRange(new ToolStripItem[] { ShowFunctionsCheckbox, ShowPublicsCheckbox });\n      toolStripDropDownButton1.Image = (Image)resources.GetObject(\"toolStripDropDownButton1.Image\");\n      toolStripDropDownButton1.ImageTransparentColor = Color.Magenta;\n      toolStripDropDownButton1.Name = \"toolStripDropDownButton1\";\n      toolStripDropDownButton1.Size = new Size(74, 35);\n      toolStripDropDownButton1.Text = \"Show\";\n      toolStripDropDownButton1.ToolTipText = \"Select symbol kind to show\";\n      // \n      // ShowFunctionsCheckbox\n      // \n      ShowFunctionsCheckbox.Checked = true;\n      ShowFunctionsCheckbox.CheckOnClick = true;\n      ShowFunctionsCheckbox.CheckState = CheckState.Checked;\n      ShowFunctionsCheckbox.Name = \"ShowFunctionsCheckbox\";\n      ShowFunctionsCheckbox.Size = new Size(236, 34);\n      ShowFunctionsCheckbox.Text = \"Show functions\";\n      ShowFunctionsCheckbox.CheckStateChanged += ShowFunctionsCheckbox_CheckStateChanged;\n      // \n      // ShowPublicsCheckbox\n      // \n      ShowPublicsCheckbox.Checked = true;\n      ShowPublicsCheckbox.CheckOnClick = true;\n      ShowPublicsCheckbox.CheckState = CheckState.Checked;\n      ShowPublicsCheckbox.Name = \"ShowPublicsCheckbox\";\n      ShowPublicsCheckbox.Size = new Size(236, 34);\n      ShowPublicsCheckbox.Text = \"Show publics\";\n      ShowPublicsCheckbox.CheckedChanged += ShowPublicsCheckbox_CheckedChanged;\n      // \n      // DemangleCheckbox\n      // \n      DemangleCheckbox.Checked = true;\n      DemangleCheckbox.CheckOnClick = true;\n      DemangleCheckbox.CheckState = CheckState.Checked;\n      DemangleCheckbox.DisplayStyle = ToolStripItemDisplayStyle.Text;\n      DemangleCheckbox.Image = (Image)resources.GetObject(\"DemangleCheckbox.Image\");\n      DemangleCheckbox.ImageTransparentColor = Color.Magenta;\n      DemangleCheckbox.Name = \"DemangleCheckbox\";\n      DemangleCheckbox.Size = new Size(97, 35);\n      DemangleCheckbox.Text = \"Demangle\";\n      DemangleCheckbox.ToolTipText = \"Demangle C++ function names\";\n      DemangleCheckbox.CheckedChanged += DemangleCheckbox_CheckedChanged;\n      // \n      // toolStripSeparator3\n      // \n      toolStripSeparator3.Name = \"toolStripSeparator3\";\n      toolStripSeparator3.Size = new Size(6, 40);\n      // \n      // toolStripLabel1\n      // \n      toolStripLabel1.Image = (Image)resources.GetObject(\"toolStripLabel1.Image\");\n      toolStripLabel1.ImageScaling = ToolStripItemImageScaling.None;\n      toolStripLabel1.Margin = new Padding(2, 2, 0, 4);\n      toolStripLabel1.Name = \"toolStripLabel1\";\n      toolStripLabel1.Size = new Size(61, 34);\n      toolStripLabel1.Text = \"RVA\";\n      // \n      // RVATextbox\n      // \n      RVATextbox.Name = \"RVATextbox\";\n      RVATextbox.Size = new Size(125, 40);\n      RVATextbox.ToolTipText = \"Search for functions with an RVA range overlapping the value\";\n      RVATextbox.TextChanged += RVATextbox_TextChanged;\n      // \n      // SubtractRVAButton\n      // \n      SubtractRVAButton.BackgroundImageLayout = ImageLayout.None;\n      SubtractRVAButton.DisplayStyle = ToolStripItemDisplayStyle.Image;\n      SubtractRVAButton.Image = (Image)resources.GetObject(\"SubtractRVAButton.Image\");\n      SubtractRVAButton.ImageScaling = ToolStripItemImageScaling.None;\n      SubtractRVAButton.ImageTransparentColor = Color.Magenta;\n      SubtractRVAButton.Name = \"SubtractRVAButton\";\n      SubtractRVAButton.Size = new Size(34, 35);\n      SubtractRVAButton.Text = \"toolStripButton1\";\n      SubtractRVAButton.ToolTipText = \"Decrement searched RVA\";\n      SubtractRVAButton.Click += SubtractRVAButton_Click;\n      // \n      // AddRVAButton\n      // \n      AddRVAButton.DisplayStyle = ToolStripItemDisplayStyle.Image;\n      AddRVAButton.Image = (Image)resources.GetObject(\"AddRVAButton.Image\");\n      AddRVAButton.ImageScaling = ToolStripItemImageScaling.None;\n      AddRVAButton.ImageTransparentColor = Color.Magenta;\n      AddRVAButton.Name = \"AddRVAButton\";\n      AddRVAButton.Size = new Size(34, 35);\n      AddRVAButton.Text = \"toolStripButton1\";\n      AddRVAButton.ToolTipText = \"Increment searched RVA\";\n      AddRVAButton.Click += AddRVAButton_Click;\n      // \n      // HexCheckbox\n      // \n      HexCheckbox.Checked = true;\n      HexCheckbox.CheckOnClick = true;\n      HexCheckbox.CheckState = CheckState.Checked;\n      HexCheckbox.DisplayStyle = ToolStripItemDisplayStyle.Text;\n      HexCheckbox.Image = (Image)resources.GetObject(\"HexCheckbox.Image\");\n      HexCheckbox.ImageTransparentColor = Color.Magenta;\n      HexCheckbox.Name = \"HexCheckbox\";\n      HexCheckbox.Size = new Size(49, 35);\n      HexCheckbox.Text = \"HEX\";\n      HexCheckbox.ToolTipText = \"Consider RVA value as being hexadecimal\";\n      HexCheckbox.CheckedChanged += HexCheckbox_CheckedChanged;\n      // \n      // toolStripSeparator2\n      // \n      toolStripSeparator2.Name = \"toolStripSeparator2\";\n      toolStripSeparator2.Size = new Size(6, 40);\n      // \n      // toolStripLabel2\n      // \n      toolStripLabel2.Image = (Image)resources.GetObject(\"toolStripLabel2.Image\");\n      toolStripLabel2.ImageScaling = ToolStripItemImageScaling.None;\n      toolStripLabel2.Margin = new Padding(2, 2, 0, 4);\n      toolStripLabel2.Name = \"toolStripLabel2\";\n      toolStripLabel2.Size = new Size(129, 34);\n      toolStripLabel2.Text = \"Search name\";\n      // \n      // SearchTextbox\n      // \n      SearchTextbox.Name = \"SearchTextbox\";\n      SearchTextbox.Size = new Size(249, 40);\n      SearchTextbox.ToolTipText = \"Filter list to functions containing substring\";\n      SearchTextbox.TextChanged += SearchTextbox_TextChanged;\n      // \n      // SearchResetButton\n      // \n      SearchResetButton.DisplayStyle = ToolStripItemDisplayStyle.Image;\n      SearchResetButton.Image = (Image)resources.GetObject(\"SearchResetButton.Image\");\n      SearchResetButton.ImageScaling = ToolStripItemImageScaling.None;\n      SearchResetButton.ImageTransparentColor = Color.Magenta;\n      SearchResetButton.Name = \"SearchResetButton\";\n      SearchResetButton.Size = new Size(34, 35);\n      SearchResetButton.Text = \"toolStripButton1\";\n      SearchResetButton.ToolTipText = \"Clear searched name\";\n      SearchResetButton.Click += SearchResetButton_Click;\n      // \n      // RegexCheckbox\n      // \n      RegexCheckbox.CheckOnClick = true;\n      RegexCheckbox.DisplayStyle = ToolStripItemDisplayStyle.Text;\n      RegexCheckbox.Image = (Image)resources.GetObject(\"RegexCheckbox.Image\");\n      RegexCheckbox.ImageTransparentColor = Color.Magenta;\n      RegexCheckbox.Name = \"RegexCheckbox\";\n      RegexCheckbox.Size = new Size(35, 35);\n      RegexCheckbox.Text = \"R*\";\n      RegexCheckbox.ToolTipText = \"Use Regex function name filter\";\n      RegexCheckbox.CheckedChanged += RegexCheckbox_CheckedChanged;\n      // \n      // toolStripSeparator4\n      // \n      toolStripSeparator4.Name = \"toolStripSeparator4\";\n      toolStripSeparator4.Size = new Size(6, 40);\n      // \n      // AboutButton\n      // \n      AboutButton.DisplayStyle = ToolStripItemDisplayStyle.Text;\n      AboutButton.Image = (Image)resources.GetObject(\"AboutButton.Image\");\n      AboutButton.ImageTransparentColor = Color.Magenta;\n      AboutButton.Name = \"AboutButton\";\n      AboutButton.Size = new Size(66, 35);\n      AboutButton.Text = \"About\";\n      AboutButton.Click += AboutButton_Click;\n      // \n      // statusStrip1\n      // \n      statusStrip1.ImageScalingSize = new Size(28, 28);\n      statusStrip1.Items.AddRange(new ToolStripItem[] { toolStripStatusLabel1, SymbolCountLabel, toolStripStatusLabel2, TotalSymbolCountLabel, StatusLabel, ProgressBar });\n      statusStrip1.Location = new Point(0, 969);\n      statusStrip1.Name = \"statusStrip1\";\n      statusStrip1.Padding = new Padding(1, 0, 11, 0);\n      statusStrip1.Size = new Size(1566, 32);\n      statusStrip1.TabIndex = 1;\n      statusStrip1.Text = \"statusStrip1\";\n      // \n      // toolStripStatusLabel1\n      // \n      toolStripStatusLabel1.Name = \"toolStripStatusLabel1\";\n      toolStripStatusLabel1.Size = new Size(84, 25);\n      toolStripStatusLabel1.Text = \"Symbols:\";\n      // \n      // SymbolCountLabel\n      // \n      SymbolCountLabel.Name = \"SymbolCountLabel\";\n      SymbolCountLabel.Size = new Size(22, 25);\n      SymbolCountLabel.Text = \"0\";\n      SymbolCountLabel.ToolTipText = \"Number of symbols in view after search/filtering\";\n      // \n      // toolStripStatusLabel2\n      // \n      toolStripStatusLabel2.Name = \"toolStripStatusLabel2\";\n      toolStripStatusLabel2.Size = new Size(49, 25);\n      toolStripStatusLabel2.Text = \"Total\";\n      // \n      // TotalSymbolCountLabel\n      // \n      TotalSymbolCountLabel.Name = \"TotalSymbolCountLabel\";\n      TotalSymbolCountLabel.Size = new Size(22, 25);\n      TotalSymbolCountLabel.Text = \"0\";\n      TotalSymbolCountLabel.ToolTipText = \"Total number of symbols\";\n      // \n      // StatusLabel\n      // \n      StatusLabel.Name = \"StatusLabel\";\n      StatusLabel.Size = new Size(134, 25);\n      StatusLabel.Text = \"No PDB loaded\";\n      StatusLabel.ToolTipText = \"Status message\";\n      // \n      // ProgressBar\n      // \n      ProgressBar.Name = \"ProgressBar\";\n      ProgressBar.Size = new Size(84, 24);\n      ProgressBar.Style = ProgressBarStyle.Marquee;\n      ProgressBar.Visible = false;\n      // \n      // OpenFileDialog\n      // \n      OpenFileDialog.FileName = \"openFileDialog1\";\n      OpenFileDialog.Filter = \"PDB|*.pdb\";\n      // \n      // splitContainer1\n      // \n      splitContainer1.Dock = DockStyle.Fill;\n      splitContainer1.Location = new Point(0, 40);\n      splitContainer1.Margin = new Padding(2);\n      splitContainer1.Name = \"splitContainer1\";\n      splitContainer1.Orientation = Orientation.Horizontal;\n      // \n      // splitContainer1.Panel1\n      // \n      splitContainer1.Panel1.Controls.Add(FunctionListView);\n      // \n      // splitContainer1.Panel2\n      // \n      splitContainer1.Panel2.Controls.Add(tabControl1);\n      splitContainer1.Size = new Size(1566, 929);\n      splitContainer1.SplitterDistance = 530;\n      splitContainer1.SplitterWidth = 2;\n      splitContainer1.TabIndex = 2;\n      // \n      // FunctionListView\n      // \n      FunctionListView.Columns.AddRange(new ColumnHeader[] { columnHeader1, columnHeader2, columnHeader3, columnHeader5, columnHeader4, columnHeader6 });\n      FunctionListView.Dock = DockStyle.Fill;\n      FunctionListView.FullRowSelect = true;\n      FunctionListView.GridLines = true;\n      FunctionListView.Location = new Point(0, 0);\n      FunctionListView.Margin = new Padding(2);\n      FunctionListView.MultiSelect = false;\n      FunctionListView.Name = \"FunctionListView\";\n      FunctionListView.Size = new Size(1566, 530);\n      FunctionListView.TabIndex = 3;\n      FunctionListView.UseCompatibleStateImageBehavior = false;\n      FunctionListView.View = View.Details;\n      FunctionListView.SelectedIndexChanged += FunctionListView_SelectedIndexChanged;\n      // \n      // columnHeader1\n      // \n      columnHeader1.Text = \"RVA\";\n      columnHeader1.Width = 100;\n      // \n      // columnHeader2\n      // \n      columnHeader2.Text = \"Name\";\n      columnHeader2.Width = 600;\n      // \n      // columnHeader3\n      // \n      columnHeader3.Text = \"Length\";\n      columnHeader3.Width = 120;\n      // \n      // columnHeader5\n      // \n      columnHeader5.Text = \"End RVA\";\n      columnHeader5.Width = 100;\n      // \n      // columnHeader4\n      // \n      columnHeader4.Text = \"Kind\";\n      columnHeader4.Width = 120;\n      // \n      // columnHeader6\n      // \n      columnHeader6.Text = \"Mangled name\";\n      columnHeader6.Width = 180;\n      // \n      // tabControl1\n      // \n      tabControl1.Appearance = TabAppearance.FlatButtons;\n      tabControl1.Controls.Add(tabPage1);\n      tabControl1.Controls.Add(tabPage2);\n      tabControl1.Dock = DockStyle.Fill;\n      tabControl1.Location = new Point(0, 0);\n      tabControl1.Margin = new Padding(2);\n      tabControl1.Name = \"tabControl1\";\n      tabControl1.SelectedIndex = 0;\n      tabControl1.Size = new Size(1566, 397);\n      tabControl1.TabIndex = 0;\n      // \n      // tabPage1\n      // \n      tabPage1.Controls.Add(FunctionDeteailsTextBox);\n      tabPage1.Location = new Point(4, 37);\n      tabPage1.Margin = new Padding(2);\n      tabPage1.Name = \"tabPage1\";\n      tabPage1.Padding = new Padding(2);\n      tabPage1.Size = new Size(1558, 356);\n      tabPage1.TabIndex = 0;\n      tabPage1.Text = \"Details\";\n      tabPage1.UseVisualStyleBackColor = true;\n      // \n      // FunctionDeteailsTextBox\n      // \n      FunctionDeteailsTextBox.BackColor = SystemColors.Window;\n      FunctionDeteailsTextBox.BorderStyle = BorderStyle.None;\n      FunctionDeteailsTextBox.Dock = DockStyle.Fill;\n      FunctionDeteailsTextBox.HideSelection = false;\n      FunctionDeteailsTextBox.Location = new Point(2, 2);\n      FunctionDeteailsTextBox.Margin = new Padding(2);\n      FunctionDeteailsTextBox.Multiline = true;\n      FunctionDeteailsTextBox.Name = \"FunctionDeteailsTextBox\";\n      FunctionDeteailsTextBox.PlaceholderText = \"Selected function information\";\n      FunctionDeteailsTextBox.ReadOnly = true;\n      FunctionDeteailsTextBox.Size = new Size(1554, 352);\n      FunctionDeteailsTextBox.TabIndex = 0;\n      // \n      // tabPage2\n      // \n      tabPage2.Controls.Add(splitContainer2);\n      tabPage2.Location = new Point(4, 37);\n      tabPage2.Margin = new Padding(2);\n      tabPage2.Name = \"tabPage2\";\n      tabPage2.Padding = new Padding(2);\n      tabPage2.Size = new Size(1558, 356);\n      tabPage2.TabIndex = 1;\n      tabPage2.Text = \"Source Lines\";\n      tabPage2.UseVisualStyleBackColor = true;\n      // \n      // splitContainer2\n      // \n      splitContainer2.Dock = DockStyle.Fill;\n      splitContainer2.Location = new Point(2, 2);\n      splitContainer2.Margin = new Padding(4);\n      splitContainer2.Name = \"splitContainer2\";\n      // \n      // splitContainer2.Panel1\n      // \n      splitContainer2.Panel1.Controls.Add(SourceLineListView);\n      // \n      // splitContainer2.Panel2\n      // \n      splitContainer2.Panel2.Controls.Add(tabControl2);\n      splitContainer2.Size = new Size(1554, 352);\n      splitContainer2.SplitterDistance = 602;\n      splitContainer2.SplitterWidth = 5;\n      splitContainer2.TabIndex = 0;\n      // \n      // SourceLineListView\n      // \n      SourceLineListView.Columns.AddRange(new ColumnHeader[] { columnHeader9, columnHeader7, columnHeader8, columnHeader10, columnHeader14 });\n      SourceLineListView.Dock = DockStyle.Fill;\n      SourceLineListView.FullRowSelect = true;\n      SourceLineListView.GridLines = true;\n      SourceLineListView.Location = new Point(0, 0);\n      SourceLineListView.Margin = new Padding(2);\n      SourceLineListView.Name = \"SourceLineListView\";\n      SourceLineListView.Size = new Size(602, 352);\n      SourceLineListView.TabIndex = 4;\n      SourceLineListView.UseCompatibleStateImageBehavior = false;\n      SourceLineListView.View = View.Details;\n      SourceLineListView.SelectedIndexChanged += SourceLineListView_SelectedIndexChanged;\n      // \n      // columnHeader9\n      // \n      columnHeader9.Text = \"RVA\";\n      columnHeader9.Width = 80;\n      // \n      // columnHeader7\n      // \n      columnHeader7.Text = \"Line\";\n      columnHeader7.Width = 80;\n      // \n      // columnHeader8\n      // \n      columnHeader8.Text = \"Column\";\n      columnHeader8.Width = 80;\n      // \n      // columnHeader10\n      // \n      columnHeader10.Text = \"Inlinees\";\n      columnHeader10.Width = 80;\n      // \n      // columnHeader14\n      // \n      columnHeader14.Text = \"File\";\n      columnHeader14.Width = 250;\n      // \n      // tabControl2\n      // \n      tabControl2.Appearance = TabAppearance.FlatButtons;\n      tabControl2.Controls.Add(tabPage4);\n      tabControl2.Controls.Add(tabPage3);\n      tabControl2.Dock = DockStyle.Fill;\n      tabControl2.Location = new Point(0, 0);\n      tabControl2.Margin = new Padding(4);\n      tabControl2.Name = \"tabControl2\";\n      tabControl2.SelectedIndex = 0;\n      tabControl2.Size = new Size(947, 352);\n      tabControl2.TabIndex = 0;\n      // \n      // tabPage4\n      // \n      tabPage4.Controls.Add(SourceTextBox);\n      tabPage4.Controls.Add(LineNumbersTextBox);\n      tabPage4.Controls.Add(toolStrip2);\n      tabPage4.Location = new Point(4, 37);\n      tabPage4.Margin = new Padding(4);\n      tabPage4.Name = \"tabPage4\";\n      tabPage4.Padding = new Padding(4);\n      tabPage4.Size = new Size(939, 311);\n      tabPage4.TabIndex = 1;\n      tabPage4.Text = \"Source Preview\";\n      tabPage4.ToolTipText = \"Source file having lines with debug info marked\";\n      tabPage4.UseVisualStyleBackColor = true;\n      // \n      // SourceTextBox\n      // \n      SourceTextBox.BackColor = SystemColors.Window;\n      SourceTextBox.BorderStyle = BorderStyle.None;\n      SourceTextBox.Dock = DockStyle.Fill;\n      SourceTextBox.Font = new Font(\"Consolas\", 9F, FontStyle.Regular, GraphicsUnit.Point, 0);\n      SourceTextBox.HideSelection = false;\n      SourceTextBox.Location = new Point(84, 38);\n      SourceTextBox.Margin = new Padding(16, 4, 4, 4);\n      SourceTextBox.Name = \"SourceTextBox\";\n      SourceTextBox.ReadOnly = true;\n      SourceTextBox.ScrollBars = RichTextBoxScrollBars.Vertical;\n      SourceTextBox.Size = new Size(851, 269);\n      SourceTextBox.TabIndex = 0;\n      SourceTextBox.Text = \"Open source file\";\n      SourceTextBox.WordWrap = false;\n      SourceTextBox.SelectionChanged += SourceTextBox_SelectionChanged;\n      SourceTextBox.VScroll += SourceTextBox_VScroll;\n      SourceTextBox.TextChanged += SourceTextBox_TextChanged;\n      // \n      // LineNumbersTextBox\n      // \n      LineNumbersTextBox.BackColor = SystemColors.Window;\n      LineNumbersTextBox.BorderStyle = BorderStyle.None;\n      LineNumbersTextBox.Dock = DockStyle.Left;\n      LineNumbersTextBox.Font = new Font(\"Consolas\", 9F, FontStyle.Regular, GraphicsUnit.Point, 0);\n      LineNumbersTextBox.ForeColor = Color.DarkBlue;\n      LineNumbersTextBox.Location = new Point(4, 38);\n      LineNumbersTextBox.Margin = new Padding(4);\n      LineNumbersTextBox.Name = \"LineNumbersTextBox\";\n      LineNumbersTextBox.ReadOnly = true;\n      LineNumbersTextBox.ScrollBars = RichTextBoxScrollBars.None;\n      LineNumbersTextBox.Size = new Size(80, 269);\n      LineNumbersTextBox.TabIndex = 2;\n      LineNumbersTextBox.TabStop = false;\n      LineNumbersTextBox.Text = \"\";\n      LineNumbersTextBox.WordWrap = false;\n      LineNumbersTextBox.MouseDown += LineNumbersTextBox_MouseDown;\n      // \n      // toolStrip2\n      // \n      toolStrip2.BackColor = SystemColors.Control;\n      toolStrip2.GripStyle = ToolStripGripStyle.Hidden;\n      toolStrip2.ImageScalingSize = new Size(20, 20);\n      toolStrip2.Items.AddRange(new ToolStripItem[] { SourceOpenButton, toolStripSeparator5, SourceFileLabel });\n      toolStrip2.Location = new Point(4, 4);\n      toolStrip2.Name = \"toolStrip2\";\n      toolStrip2.RenderMode = ToolStripRenderMode.System;\n      toolStrip2.Size = new Size(931, 34);\n      toolStrip2.TabIndex = 1;\n      toolStrip2.Text = \"toolStrip2\";\n      // \n      // SourceOpenButton\n      // \n      SourceOpenButton.Image = (Image)resources.GetObject(\"SourceOpenButton.Image\");\n      SourceOpenButton.ImageScaling = ToolStripItemImageScaling.None;\n      SourceOpenButton.ImageTransparentColor = Color.Magenta;\n      SourceOpenButton.Name = \"SourceOpenButton\";\n      SourceOpenButton.Size = new Size(76, 29);\n      SourceOpenButton.Text = \"Open\";\n      SourceOpenButton.Click += SourceOpenButton_Click;\n      // \n      // toolStripSeparator5\n      // \n      toolStripSeparator5.Name = \"toolStripSeparator5\";\n      toolStripSeparator5.Size = new Size(6, 34);\n      // \n      // SourceFileLabel\n      // \n      SourceFileLabel.Name = \"SourceFileLabel\";\n      SourceFileLabel.Size = new Size(181, 29);\n      SourceFileLabel.Text = \"No source file loaded\";\n      // \n      // tabPage3\n      // \n      tabPage3.Controls.Add(InlineeListView);\n      tabPage3.Location = new Point(4, 37);\n      tabPage3.Margin = new Padding(4);\n      tabPage3.Name = \"tabPage3\";\n      tabPage3.Padding = new Padding(4);\n      tabPage3.Size = new Size(939, 311);\n      tabPage3.TabIndex = 0;\n      tabPage3.Text = \"Inlinees\";\n      tabPage3.ToolTipText = \"Functions inlined at the selected line\";\n      tabPage3.UseVisualStyleBackColor = true;\n      // \n      // InlineeListView\n      // \n      InlineeListView.Columns.AddRange(new ColumnHeader[] { columnHeader13, columnHeader11, columnHeader12, columnHeader15 });\n      InlineeListView.Dock = DockStyle.Fill;\n      InlineeListView.FullRowSelect = true;\n      InlineeListView.GridLines = true;\n      InlineeListView.Location = new Point(4, 4);\n      InlineeListView.Margin = new Padding(2);\n      InlineeListView.MultiSelect = false;\n      InlineeListView.Name = \"InlineeListView\";\n      InlineeListView.Size = new Size(931, 303);\n      InlineeListView.TabIndex = 6;\n      InlineeListView.UseCompatibleStateImageBehavior = false;\n      InlineeListView.View = View.Details;\n      // \n      // columnHeader13\n      // \n      columnHeader13.Text = \"Inlinee Name\";\n      columnHeader13.Width = 400;\n      // \n      // columnHeader11\n      // \n      columnHeader11.Text = \"Line\";\n      columnHeader11.Width = 80;\n      // \n      // columnHeader12\n      // \n      columnHeader12.Text = \"Column\";\n      columnHeader12.Width = 80;\n      // \n      // columnHeader15\n      // \n      columnHeader15.Text = \"File Name\";\n      columnHeader15.Width = 250;\n      // \n      // SourceOpenFileDialog\n      // \n      SourceOpenFileDialog.FileName = \"openFileDialog1\";\n      SourceOpenFileDialog.Filter = \"Source Files|*.*\";\n      // \n      // MainForm\n      // \n      AutoScaleDimensions = new SizeF(10F, 25F);\n      AutoScaleMode = AutoScaleMode.Font;\n      ClientSize = new Size(1566, 1001);\n      Controls.Add(splitContainer1);\n      Controls.Add(statusStrip1);\n      Controls.Add(toolStrip1);\n      Margin = new Padding(2);\n      Name = \"MainForm\";\n      StartPosition = FormStartPosition.CenterScreen;\n      Text = \"PDB Viewer\";\n      Load += MainForm_Load;\n      toolStrip1.ResumeLayout(false);\n      toolStrip1.PerformLayout();\n      statusStrip1.ResumeLayout(false);\n      statusStrip1.PerformLayout();\n      splitContainer1.Panel1.ResumeLayout(false);\n      splitContainer1.Panel2.ResumeLayout(false);\n      ((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();\n      splitContainer1.ResumeLayout(false);\n      tabControl1.ResumeLayout(false);\n      tabPage1.ResumeLayout(false);\n      tabPage1.PerformLayout();\n      tabPage2.ResumeLayout(false);\n      splitContainer2.Panel1.ResumeLayout(false);\n      splitContainer2.Panel2.ResumeLayout(false);\n      ((System.ComponentModel.ISupportInitialize)splitContainer2).EndInit();\n      splitContainer2.ResumeLayout(false);\n      tabControl2.ResumeLayout(false);\n      tabPage4.ResumeLayout(false);\n      tabPage4.PerformLayout();\n      toolStrip2.ResumeLayout(false);\n      toolStrip2.PerformLayout();\n      tabPage3.ResumeLayout(false);\n      ResumeLayout(false);\n      PerformLayout();\n    }\n\n    #endregion\n\n    private ToolStrip toolStrip1;\n    private ToolStripButton OpenButton;\n    private ToolStripSeparator toolStripSeparator1;\n    private ToolStripLabel toolStripLabel1;\n    private StatusStrip statusStrip1;\n    private ToolStripStatusLabel toolStripStatusLabel1;\n    private ToolStripDropDownButton toolStripDropDownButton1;\n    private ToolStripMenuItem ShowFunctionsCheckbox;\n    private ToolStripMenuItem ShowPublicsCheckbox;\n    private ToolStripSeparator toolStripSeparator3;\n    private ToolStripTextBox RVATextbox;\n    private ToolStripSeparator toolStripSeparator2;\n    private ToolStripLabel toolStripLabel2;\n    private ToolStripTextBox SearchTextbox;\n    private ToolStripStatusLabel SymbolCountLabel;\n    private OpenFileDialog OpenFileDialog;\n    private ToolStripButton HexCheckbox;\n    private ToolStripStatusLabel toolStripStatusLabel2;\n    private ToolStripStatusLabel TotalSymbolCountLabel;\n    private ToolStripStatusLabel StatusLabel;\n    private ToolStripProgressBar ProgressBar;\n    private ToolStripButton DemangleCheckbox;\n    private ToolStripButton AddRVAButton;\n    private ToolStripButton SubtractRVAButton;\n    private ToolStripButton SearchResetButton;\n    private SplitContainer splitContainer1;\n    private ListView FunctionListView;\n    private ColumnHeader columnHeader1;\n    private ColumnHeader columnHeader2;\n    private ColumnHeader columnHeader3;\n    private ColumnHeader columnHeader5;\n    private ColumnHeader columnHeader4;\n    private ColumnHeader columnHeader6;\n    private TabControl tabControl1;\n    private TabPage tabPage1;\n    private TabPage tabPage2;\n    private TextBox FunctionDeteailsTextBox;\n    private SplitContainer splitContainer2;\n    private ListView SourceLineListView;\n    private ColumnHeader columnHeader7;\n    private ColumnHeader columnHeader8;\n    private ColumnHeader columnHeader9;\n    private ColumnHeader columnHeader10;\n    private TabControl tabControl2;\n    private TabPage tabPage3;\n    private TabPage tabPage4;\n    private ListView InlineeListView;\n    private ColumnHeader columnHeader13;\n    private ColumnHeader columnHeader11;\n    private ColumnHeader columnHeader12;\n    private ColumnHeader columnHeader15;\n    private RichTextBox SourceTextBox;\n    private ToolStripButton RegexCheckbox;\n    private ToolStrip toolStrip2;\n    private ToolStripButton SourceOpenButton;\n    private ToolStripSeparator toolStripSeparator5;\n    private ToolStripLabel SourceFileLabel;\n    private ColumnHeader columnHeader14;\n    private OpenFileDialog SourceOpenFileDialog;\n    private RichTextBox LineNumbersTextBox;\n    private ToolStripSeparator toolStripSeparator4;\n    private ToolStripButton AboutButton;\n  }\n}\n"
  },
  {
    "path": "src/PDBViewer/MainForm.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Text.RegularExpressions;\nusing Dia2Lib;\nusing ProfileExplorer.Core;\n\nnamespace PDBViewer;\n\npublic partial class MainForm : Form {\n  private IDiaDataSource diaSource_;\n  private IDiaSession session_;\n  private IDiaSymbol globalSymbol_;\n  private List<FunctionDebugInfo> sortedFuncList_;\n  private List<FunctionDebugInfo> filteredFuncList_;\n  private string debugFilePath_;\n  private SourceFileMapper sourceMapper_;\n  private bool ignoredNextSourceCaretEvent_;\n  private bool ignoreSourceLineSelectedEvent_;\n\n  public MainForm() {\n    InitializeComponent();\n    FunctionListView.VirtualMode = true;\n    FunctionListView.RetrieveVirtualItem += FunctionListViewOnRetrieveVirtualItem;\n    FunctionListView.KeyDown += FunctionListViewOnKeyDown;\n    sourceMapper_ = new SourceFileMapper();\n  }\n\n  private void FunctionListViewOnKeyDown(object? sender, KeyEventArgs e) {\n    if (e.Control && e.KeyCode == Keys.C &&\n        FunctionListView.SelectedIndices.Count == 1) {\n      var item = filteredFuncList_[FunctionListView.SelectedIndices[0]];\n      var sb = new StringBuilder();\n      PrintFunctionDetails(item, sb);\n      Clipboard.SetText(sb.ToString());\n      e.Handled = true;\n    }\n  }\n\n  private async void OpenButton_Click(object sender, EventArgs e) {\n    if (OpenFileDialog.ShowDialog(this) == DialogResult.OK) {\n      string? filePath = OpenFileDialog.FileName;\n      await LoadDebugFile(filePath);\n    }\n  }\n\n  private async Task LoadDebugFile(string filePath) {\n    var sw = Stopwatch.StartNew();\n    StatusLabel.Text = \"Opening PDB\";\n    FunctionListView.Enabled = false;\n    ProgressBar.Visible = true;\n    Application.UseWaitCursor = true;\n\n    if (!await OpenPDB(filePath)) {\n      MessageBox.Show(\"Failed to open PDB\", \"PDB Viewer\", MessageBoxButtons.OK, MessageBoxIcon.Error);\n      ProgressBar.Visible = true;\n      return;\n    }\n\n    StatusLabel.Text = \"Enumerating functions\";\n\n    if (!await LoadFunctionList()) {\n      MessageBox.Show(\"Failed to load function list from PDB\", \"PDB Viewer\", MessageBoxButtons.OK,\n                      MessageBoxIcon.Error);\n      ProgressBar.Visible = false;\n      return;\n    }\n\n    Text = $\"PDB Viewer - {filePath}\";\n    StatusLabel.Text = $\"PDB loaded\";\n    UpdateFunctionListView();\n    ProgressBar.Visible = false;\n    FunctionListView.Enabled = true;\n    Application.UseWaitCursor = false;\n  }\n\n  private void UpdateFunctionListView() {\n    if (sortedFuncList_ == null) {\n      return;\n    }\n\n    filteredFuncList_ = new List<FunctionDebugInfo>();\n\n    bool showFuncts = ShowFunctionsCheckbox.Checked;\n    bool showPublics = ShowPublicsCheckbox.Checked;\n    bool filterName = SearchTextbox.Text.Length > 0;\n    string searchedText = SearchTextbox.Text.Trim();\n    bool demangle = DemangleCheckbox.Checked;\n\n    Regex nameRegex = null;\n\n    if (filterName && RegexCheckbox.Checked) {\n      try {\n        nameRegex = new Regex(searchedText, RegexOptions.Compiled);\n        StatusLabel.Text = \"\";\n      }\n      catch (Exception ex) {\n        StatusLabel.Text = $\"Invalid regex: {ex.Message}\";\n        return;\n      }\n    }\n\n    foreach (var item in sortedFuncList_) {\n      if (!showFuncts && !item.IsPublic) {\n        continue;\n      }\n\n      if (!showPublics && item.IsPublic) {\n        continue;\n      }\n\n      if (filterName) {\n        string? funcName = GetFunctionName(item, demangle);\n\n        if (nameRegex != null) {\n          if (!nameRegex.IsMatch(funcName)) {\n            continue;\n          }\n        }\n        else if (!funcName.Contains(searchedText, StringComparison.OrdinalIgnoreCase)) {\n          continue;\n        }\n      }\n\n      filteredFuncList_.Add(item);\n    }\n\n    for (int i = 1; i < filteredFuncList_.Count; i++) {\n      if (filteredFuncList_[i].StartRVA == 0) {\n        continue;\n      }\n\n      for (int k = i - 1; k >= 0 && i - k < 50; k--) {\n        if (filteredFuncList_[k].StartRVA == 0) {\n          continue;\n        }\n\n        if (filteredFuncList_[k].StartRVA <= filteredFuncList_[i].StartRVA &&\n            filteredFuncList_[k].EndRVA > filteredFuncList_[i].EndRVA) {\n          filteredFuncList_[i].HasOverlap = true;\n          filteredFuncList_[k].HasOverlap = true;\n        }\n        else if (filteredFuncList_[k].EndRVA < filteredFuncList_[i].StartRVA) {\n          break;\n        }\n      }\n    }\n\n    FunctionListView.VirtualListSize = filteredFuncList_.Count;\n\n    if (filteredFuncList_.Count > 0) {\n      FunctionListView.RedrawItems(0, filteredFuncList_.Count - 1, false);\n    }\n\n    SymbolCountLabel.Text = filteredFuncList_.Count.ToString();\n    TotalSymbolCountLabel.Text = sortedFuncList_.Count.ToString();\n  }\n\n  private void UpdateSelectedRVAItem() {\n    if (filteredFuncList_ == null) {\n      return;\n    }\n\n    (bool hasRVA, long searchedRVA) = GetRVAValue();\n    int selectedIndex = -1;\n    int index = 0;\n\n    foreach (var item in filteredFuncList_) {\n      if (hasRVA && FunctionDebugInfo.BinarySearch(sortedFuncList_, searchedRVA) == item) {\n        item.IsSelected = true;\n        selectedIndex = index;\n      }\n      else {\n        item.IsSelected = false;\n      }\n\n      index++;\n    }\n\n    if (selectedIndex != -1 && filteredFuncList_.Count > 0) {\n      FunctionListView.RedrawItems(0, filteredFuncList_.Count - 1, false);\n      FunctionListView.EnsureVisible(selectedIndex);\n    }\n  }\n\n  private (bool, long) GetRVAValue() {\n    bool hasRVA = false;\n    long searchedRVA = 0;\n\n    if (RVATextbox.Text.Length > 0) {\n      if (HexCheckbox.Checked) {\n        hasRVA = long.TryParse(RVATextbox.Text.Trim(), NumberStyles.HexNumber, null, out searchedRVA);\n      }\n      else {\n        hasRVA = long.TryParse(RVATextbox.Text.Trim(), NumberStyles.Integer, null, out searchedRVA);\n      }\n    }\n\n    return (hasRVA, searchedRVA);\n  }\n\n  private void SetRVAValue(long value) {\n    if (HexCheckbox.Checked) {\n      RVATextbox.Text = value.ToString(\"X\");\n    }\n    else {\n      RVATextbox.Text = value.ToString();\n    }\n  }\n\n  private async Task<bool> OpenPDB(string debugFilePath) {\n    try {\n      await Task.Run(() => {\n        debugFilePath_ = debugFilePath;\n        diaSource_ = new DiaSourceClass();\n        diaSource_.loadDataFromPdb(debugFilePath);\n        diaSource_.openSession(out session_);\n\n        try {\n          session_.findChildren(null, SymTagEnum.SymTagExe, null, 0, out var exeSymEnum);\n          globalSymbol_ = exeSymEnum.Item(0);\n        }\n        catch (Exception ex) {\n          Trace.TraceError($\"Failed to locate global sym for file {debugFilePath}: {ex.Message}\");\n        }\n      });\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load debug file {debugFilePath}: {ex.Message}\");\n      return false;\n    }\n\n    return true;\n  }\n\n  private async Task<bool> LoadFunctionList() {\n    sortedFuncList_ = await Task.Run(CollectFunctionDebugInfo);\n\n    if (sortedFuncList_ != null) {\n      sortedFuncList_.Sort();\n      return true;\n    }\n\n    return false;\n  }\n\n  private List<FunctionDebugInfo> CollectFunctionDebugInfo() {\n    IDiaEnumSymbols symbolEnum = null;\n    IDiaEnumSymbols publicSymbolEnum = null;\n\n    try {\n      globalSymbol_.findChildren(SymTagEnum.SymTagFunction, null, 0, out symbolEnum);\n      globalSymbol_.findChildren(SymTagEnum.SymTagPublicSymbol, null, 0, out publicSymbolEnum);\n      var funcSymbolsSet = new HashSet<FunctionDebugInfo>(symbolEnum.count);\n\n      foreach (IDiaSymbol sym in symbolEnum) {\n        //Trace.WriteLine($\" FuncSym {sym.name}: RVA {sym.relativeVirtualAddress:X}, size {sym.length}\");\n        var funcInfo = new FunctionDebugInfo(sym.name, sym.relativeVirtualAddress, (uint)sym.length);\n        funcSymbolsSet.Add(funcInfo);\n      }\n\n      foreach (IDiaSymbol sym in publicSymbolEnum) {\n        //Trace.WriteLine($\" PublicSym {sym.name}: RVA {sym.relativeVirtualAddress:X} size {sym.length}\");\n        var funcInfo = new FunctionDebugInfo(sym.name, sym.relativeVirtualAddress, (uint)sym.length);\n        funcInfo.IsPublic = true;\n        funcSymbolsSet.Add(funcInfo);\n      }\n\n      return funcSymbolsSet.ToList();\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to enumerate functions: {ex.Message}\");\n    }\n    finally {\n      if (symbolEnum != null) {\n        Marshal.ReleaseComObject(symbolEnum);\n      }\n\n      if (publicSymbolEnum != null) {\n        Marshal.ReleaseComObject(publicSymbolEnum);\n      }\n    }\n\n    return null;\n  }\n\n  private async Task<(SourceLineDebugInfo, IDiaSourceFile)> FindSourceLineByRVA(long rva) {\n    return await Task.Run(() => {\n      try {\n        session_.findLinesByRVA((uint)rva, 0, out var lineEnum);\n\n        while (true) {\n          lineEnum.Next(1, out var lineNumber, out uint retrieved);\n\n          if (retrieved == 0) {\n            break;\n          }\n\n          var sourceFile = lineNumber.sourceFile;\n          var sourceLine = new SourceLineDebugInfo((int)lineNumber.relativeVirtualAddress,\n                                                   (int)lineNumber.lineNumber,\n                                                   (int)lineNumber.columnNumber,\n                                                   sourceFile.fileName);\n          return (sourceLine, sourceFile);\n        }\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to get line for RVA {rva}: {ex.Message}\");\n      }\n\n      return (SourceLineDebugInfo.Unknown, null);\n    });\n  }\n\n  private async Task AnnotateSourceLines(FunctionDebugInfo func) {\n    if (func.HasSourceLines) {\n      return;\n    }\n\n    await Task.Run(() => {\n      try {\n        var funcSymbol = FindFunctionSymbol(func);\n        session_.findLinesByRVA((uint)func.StartRVA, func.Size, out var lineEnum);\n\n        while (true) {\n          lineEnum.Next(1, out var lineNumber, out uint retrieved);\n\n          if (retrieved == 0) {\n            break;\n          }\n\n          uint lineRVA = lineNumber.relativeVirtualAddress;\n          var sourceFile = lineNumber.sourceFile;\n          var sourceLine = new SourceLineDebugInfo((int)lineRVA,\n                                                   (int)lineNumber.lineNumber,\n                                                   (int)lineNumber.columnNumber,\n                                                   sourceFile.fileName);\n\n          if (funcSymbol != null) {\n            try {\n              string? name = funcSymbol.name;\n\n              // Enumerate the functions that got inlined at this call site.\n              foreach (var inlinee in EnumerateInlinees(funcSymbol, lineRVA)) {\n                if (string.IsNullOrEmpty(inlinee.FilePath)) {\n                  // If the file name is not set, it means it's the same file\n                  // as the function into which the inlining happened.\n                  inlinee.FilePath = sourceFile.fileName;\n                }\n\n                sourceLine.AddInlinee(inlinee);\n              }\n            }\n            catch (Exception ex) {\n              Trace.TraceError($\"Failed to get inlinees for RVA {func.StartRVA}: {ex.Message}\");\n            }\n          }\n\n          func.AddSourceLine(sourceLine);\n        }\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to get line for RVA {func.StartRVA}: {ex.Message}\");\n      }\n    });\n  }\n\n  private IEnumerable<SourceStackFrame>\n    EnumerateInlinees(IDiaSymbol funcSymbol, uint instrRVA) {\n    funcSymbol.findInlineFramesByRVA(instrRVA, out var inlineeFrameEnum);\n\n    foreach (IDiaSymbol inlineFrame in inlineeFrameEnum) {\n      inlineFrame.findInlineeLinesByRVA(instrRVA, 0, out var inlineeLineEnum);\n\n      while (true) {\n        inlineeLineEnum.Next(1, out var inlineeLineNumber, out uint inlineeRetrieved);\n\n        if (inlineeRetrieved == 0) {\n          break;\n        }\n\n        // Getting the source file of the inlinee often fails, ignore it.\n        string inlineeFileName = null;\n\n        try {\n          inlineeFileName = inlineeLineNumber.sourceFile.fileName;\n        }\n        catch {\n          //? TODO: Any way to detect this and avoid throwing?\n        }\n\n        var inlinee = new SourceStackFrame(\n          inlineFrame.name, inlineeFileName,\n          (int)inlineeLineNumber.lineNumber,\n          (int)inlineeLineNumber.columnNumber);\n        yield return inlinee;\n      }\n\n      Marshal.ReleaseComObject(inlineeLineEnum);\n    }\n\n    Marshal.ReleaseComObject(inlineeFrameEnum);\n  }\n\n  private IDiaSymbol FindFunctionSymbol(FunctionDebugInfo func) {\n    try {\n      if (func.IsPublic) {\n        session_.findSymbolByRVA((uint)func.StartRVA, SymTagEnum.SymTagPublicSymbol, out var pubSym);\n        return pubSym;\n      }\n      else {\n        session_.findSymbolByRVA((uint)func.StartRVA, SymTagEnum.SymTagFunction, out var funcSym);\n        return funcSym;\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to find function symbol for RVA {func.StartRVA}: {ex.Message}\");\n    }\n\n    return null;\n  }\n\n  public string GetFunctionName(FunctionDebugInfo item, bool demangle) {\n    if (!demangle) {\n      return item.Name;\n    }\n\n    var flags = NativeMethods.UnDecorateFlags.UNDNAME_COMPLETE;\n    flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_ACCESS_SPECIFIERS |\n             NativeMethods.UnDecorateFlags.UNDNAME_NO_ALLOCATION_MODEL |\n             NativeMethods.UnDecorateFlags.UNDNAME_NO_MEMBER_TYPE;\n    flags |= NativeMethods.UnDecorateFlags.UNDNAME_NAME_ONLY;\n    flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_MS_KEYWORDS;\n    flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_MS_THISTYPE;\n    flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_FUNCTION_RETURNS;\n    const int MaxDemangledFunctionNameLength = 8192;\n    var sb = new StringBuilder(MaxDemangledFunctionNameLength);\n    NativeMethods.UnDecorateSymbolName(item.Name, sb, MaxDemangledFunctionNameLength, flags);\n    return sb.ToString();\n  }\n\n  private void RVATextbox_TextChanged(object? sender, EventArgs e) {\n    UpdateSelectedRVAItem();\n  }\n\n  private void SearchTextbox_TextChanged(object? sender, EventArgs e) {\n    UpdateFunctionListView();\n  }\n\n  private void HexCheckbox_CheckedChanged(object? sender, EventArgs e) {\n    UpdateSelectedRVAItem();\n  }\n\n  private void ShowPublicsCheckbox_CheckedChanged(object sender, EventArgs e) {\n    UpdateFunctionListView();\n  }\n\n  private void ShowFunctionsCheckbox_CheckStateChanged(object sender, EventArgs e) {\n    UpdateFunctionListView();\n  }\n\n  private async void DemangleCheckbox_CheckedChanged(object sender, EventArgs e) {\n    UpdateFunctionListView();\n  }\n\n  private void AddRVAButton_Click(object sender, EventArgs e) {\n    (bool hasRVA, long value) = GetRVAValue();\n\n    if (hasRVA) {\n      SetRVAValue(value + 4);\n    }\n  }\n\n  private void SubtractRVAButton_Click(object sender, EventArgs e) {\n    (bool hasRVA, long value) = GetRVAValue();\n\n    if (hasRVA) {\n      SetRVAValue(Math.Max(0, value - 4));\n    }\n  }\n\n  private async void FunctionListView_SelectedIndexChanged(object sender, EventArgs e) {\n    var currentFunc = GetSelectedFunction();\n\n    if (currentFunc == null) {\n      return;\n    }\n\n    UpdateOverlappingFunctions(currentFunc);\n    await UpdateSelectedFunction(currentFunc);\n  }\n\n  private FunctionDebugInfo GetSelectedFunction() {\n    if (FunctionListView.SelectedIndices.Count == 0 || filteredFuncList_ == null) {\n      return null;\n    }\n\n    return filteredFuncList_[FunctionListView.SelectedIndices[0]];\n  }\n\n  private void UpdateOverlappingFunctions(FunctionDebugInfo currentItem) {\n    int count = 0;\n\n    foreach (var item in filteredFuncList_) {\n      if (item != currentItem &&\n          !(item.EndRVA < currentItem.StartRVA || item.StartRVA > currentItem.EndRVA)) {\n        item.HasSelectionOverlap = true;\n        count++;\n      }\n      else {\n        item.HasSelectionOverlap = false;\n      }\n    }\n\n    if (count > 0) {\n      StatusLabel.Text = $\"Overlapping: {count}\";\n    }\n    else {\n      StatusLabel.Text = \"\";\n    }\n\n    if (filteredFuncList_.Count > 0) {\n      FunctionListView.RedrawItems(0, filteredFuncList_.Count - 1, false);\n    }\n  }\n\n  private async Task UpdateSelectedFunction(FunctionDebugInfo func) {\n    var sb = new StringBuilder();\n    PrintFunctionDetails(func, sb, false);\n    sb.AppendLine();\n    await PrintFunctionFile(func, sb);\n\n    sb.AppendLine();\n    sb.AppendLine($\"Name: {GetFunctionName(func, true)}\");\n    sb.AppendLine($\"Mangled name: {func.Name}\");\n    FunctionDeteailsTextBox.Text = sb.ToString();\n\n    await AnnotateSourceLines(func);\n\n    if (func.HasSourceLines) {\n      SourceLineListView.BeginUpdate();\n      SourceLineListView.Items.Clear();\n\n      foreach (var line in func.SourceLines) {\n        var lvi = new ListViewItem();\n        lvi.Text = $\"{line.RVA:X}\";\n        lvi.SubItems.Add($\"{line.Line}\");\n        lvi.SubItems.Add($\"{line.Column}\");\n        lvi.SubItems.Add($\"{line.InlineeCount}\");\n        lvi.SubItems.Add($\"{line.FilePath}\");\n        lvi.Tag = line;\n        SourceLineListView.Items.Add(lvi);\n      }\n\n      SourceLineListView.EndUpdate();\n      await LoadSourceFile(func);\n    }\n  }\n\n  private async Task LoadSourceFile(FunctionDebugInfo func, string sourceFile = null) {\n    if (sourceFile == null) {\n      sourceFile = sourceMapper_.Map(func.SourceFileName);\n    }\n\n    if (!File.Exists(sourceFile)) {\n      SourceTextBox.Text = \"Source file not found\";\n      SourceFileLabel.Text = \"\";\n      return;\n    }\n\n    try {\n      if (!string.IsNullOrEmpty(func.SourceFileName) && func.SourceFileName != sourceFile) {\n        sourceMapper_.UpdateMap(func.SourceFileName, sourceFile);\n      }\n\n      SourceTextBox.Text = await File.ReadAllTextAsync(sourceFile);\n      SourceFileLabel.Text = sourceFile;\n\n      if (func.HasSourceLines) {\n        foreach (var line in func.SourceLines) {\n          HighlightSourceLine(SourceTextBox, line.Line - 1, Color.Bisque);\n        }\n      }\n    }\n    catch (Exception ex) {\n      SourceTextBox.Text = $\"Failed to load source file: {ex.Message}\";\n      SourceFileLabel.Text = \"\";\n    }\n  }\n\n  private async Task PrintFunctionFile(FunctionDebugInfo item, StringBuilder sb) {\n    var (sourceLine, sourceFile) = await FindSourceLineByRVA(item.StartRVA);\n\n    if (sourceLine.IsUnknown) {\n      sb.AppendLine(\"Missing source line info\");\n    }\n\n    sb.AppendLine($\"Source File: {sourceLine.FilePath}\");\n    sb.AppendLine($\"Source Line: {sourceLine.Line} (column {sourceLine.Column})\");\n  }\n\n  private void SearchResetButton_Click(object sender, EventArgs e) {\n    SearchTextbox.Text = \"\";\n    StatusLabel.Text = \"\";\n  }\n\n  private void SourceLineListView_SelectedIndexChanged(object sender, EventArgs e) {\n    if (ignoreSourceLineSelectedEvent_ ||\n        SourceLineListView.SelectedItems.Count == 0) {\n      return;\n    }\n\n    var item = SourceLineListView.SelectedItems[0];\n    var line = item.Tag as SourceLineDebugInfo;\n\n    if (line == null) {\n      return;\n    }\n\n    InlineeListView.BeginUpdate();\n    InlineeListView.Items.Clear();\n\n    if (line.InlineeCount > 0) {\n      foreach (var inlinee in line.Inlinees) {\n        var lvi = new ListViewItem();\n        lvi.Text = $\"{inlinee.Function}\";\n        lvi.SubItems.Add($\"{inlinee.Line}\");\n        lvi.SubItems.Add($\"{inlinee.Column}\");\n        lvi.SubItems.Add(inlinee.FilePath);\n        lvi.Tag = inlinee;\n        InlineeListView.Items.Add(lvi);\n      }\n    }\n\n    InlineeListView.EndUpdate();\n    SelectSourceLine(SourceTextBox, line.Line - 1);\n  }\n\n  private void HighlightSourceLine(RichTextBox richTextBox, int lineNumber, Color color) {\n    if (lineNumber < 0 || lineNumber >= richTextBox.Lines.Length) {\n      return;\n    }\n\n    ignoredNextSourceCaretEvent_ = true;\n    int start = richTextBox.GetFirstCharIndexFromLine(lineNumber);\n    int length = richTextBox.Lines[lineNumber].Length;\n    richTextBox.Select(start, length);\n    richTextBox.SelectionBackColor = color;\n    richTextBox.SelectionLength = 0;\n  }\n\n  private void SelectSourceLine(RichTextBox richTextBox, int lineNumber) {\n    if (lineNumber < 0 || lineNumber >= richTextBox.Lines.Length) {\n      return;\n    }\n\n    ignoredNextSourceCaretEvent_ = true;\n    int start = richTextBox.GetFirstCharIndexFromLine(lineNumber);\n    int length = richTextBox.Lines[lineNumber].Length;\n    richTextBox.Select(start, length);\n    richTextBox.ScrollToCaret();\n  }\n\n  private async void SourceOpenButton_Click(object sender, EventArgs e) {\n    var currentFunc = GetSelectedFunction();\n\n    if (currentFunc != null &&\n        SourceOpenFileDialog.ShowDialog(this) == DialogResult.OK) {\n      await LoadSourceFile(currentFunc, SourceOpenFileDialog.FileName);\n    }\n  }\n\n  private void SourceTextBox_SelectionChanged(object sender, EventArgs e) {\n    if (ignoredNextSourceCaretEvent_) {\n      ignoredNextSourceCaretEvent_ = false;\n      return;\n    }\n\n    var currentFunc = GetSelectedFunction();\n\n    if (currentFunc == null || !currentFunc.HasSourceLines) {\n      return;\n    }\n\n    ignoreSourceLineSelectedEvent_ = true;\n    SourceLineListView.SelectedIndices.Clear();\n    int lineIndex = SourceTextBox.GetLineFromCharIndex(SourceTextBox.SelectionStart);\n    int firstIndex = -1;\n\n    for (int i = 0; i < currentFunc.SourceLines.Count; i++) {\n      if (currentFunc.SourceLines[i].Line == lineIndex + 1) {\n        SourceLineListView.SelectedIndices.Add(i);\n        firstIndex = i;\n      }\n    }\n\n    ignoreSourceLineSelectedEvent_ = false;\n    SourceLineListView.Focus();\n\n    if (firstIndex != -1) {\n      SourceLineListView.EnsureVisible(firstIndex);\n    }\n  }\n\n  private async void MainForm_Load(object sender, EventArgs e) {\n    string[]? args = Environment.GetCommandLineArgs();\n\n    if (args.Length < 2) {\n      return;\n    }\n\n    string? file = args[1];\n\n    if (File.Exists(file)) {\n      await LoadDebugFile(file);\n    }\n  }\n\n  private void RegexCheckbox_CheckedChanged(object sender, EventArgs e) {\n    UpdateFunctionListView();\n  }\n\n  private void SourceTextBox_VScroll(object sender, EventArgs e) {\n    LineNumbersTextBox.Text = \"\";\n    int firstVisibleLine = SourceTextBox.GetLineFromCharIndex(SourceTextBox.GetCharIndexFromPosition(new Point(0, 0)));\n    int lastVisibleLine =\n      SourceTextBox.GetLineFromCharIndex(SourceTextBox.GetCharIndexFromPosition(new Point(0, SourceTextBox.Height))) +\n      1;\n\n    for (int i = firstVisibleLine; i <= lastVisibleLine; i++) {\n      LineNumbersTextBox.AppendText($\"{i + 1}: \\n\");\n    }\n\n    LineNumbersTextBox.SelectAll();\n    LineNumbersTextBox.SelectionAlignment = HorizontalAlignment.Right;\n    LineNumbersTextBox.DeselectAll();\n\n    // Synchronize scroll position.\n    LineNumbersTextBox.Select(SourceTextBox.GetCharIndexFromPosition(new Point(0, 0)), 0);\n    LineNumbersTextBox.ScrollToCaret();\n  }\n\n  private void SourceTextBox_TextChanged(object sender, EventArgs e) {\n    SourceTextBox_VScroll(sender, e);\n  }\n\n  private void LineNumbersTextBox_MouseDown(object sender, MouseEventArgs e) {\n    SourceTextBox.Focus();\n  }\n\n  private void PrintFunctionDetails(FunctionDebugInfo item, StringBuilder sb, bool includeName = true) {\n    sb.AppendLine($\"Start RVA: 0x{item.RVA:X} ({item.RVA})\");\n    sb.AppendLine($\"End RVA: 0x{item.EndRVA:X} ({item.EndRVA})\");\n    sb.AppendLine($\"Length: {item.Size} ({item.Size:X})\");\n    sb.AppendLine($\"Kind: {(item.IsPublic ? \"Public\" : \"Function\")}\");\n\n    if (includeName) {\n      sb.AppendLine();\n      sb.AppendLine($\"Name: {GetFunctionName(item, true)}\");\n      sb.AppendLine();\n      sb.AppendLine($\"Mangled name: {item.Name}\");\n    }\n  }\n\n  private void FunctionListViewOnRetrieveVirtualItem(object? sender, RetrieveVirtualItemEventArgs e) {\n    if (filteredFuncList_ != null && e.ItemIndex < filteredFuncList_.Count) {\n      var item = filteredFuncList_[e.ItemIndex];\n      var lvi = new ListViewItem();\n      lvi.Text = $\"{item.RVA:X}\";\n      lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, GetFunctionName(item, DemangleCheckbox.Checked)));\n      lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, $\"{item.Size} ({item.Size:X})\"));\n      lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, $\"{item.EndRVA:X}\"));\n      lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, item.IsPublic ? \"Public\" : \"Function\"));\n      lvi.SubItems.Add(new ListViewItem.ListViewSubItem(lvi, item.Name));\n\n      if (item.HasSelectionOverlap) {\n        lvi.BackColor = Color.Pink;\n      }\n      else if (item.IsSelected) {\n        lvi.BackColor = Color.LightBlue;\n      }\n      else if (item.HasOverlap) {\n        lvi.BackColor = Color.PaleGoldenrod;\n      }\n\n      e.Item = lvi;\n    }\n  }\n\n  private void AboutButton_Click(object sender, EventArgs e) {\n    var window = new AboutBox();\n    window.ShowDialog(this);\n  }\n}"
  },
  {
    "path": "src/PDBViewer/MainForm.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!--\n    Microsoft ResX Schema\n\n    Version 2.0\n\n    The primary goals of this format is to allow a simple XML format\n    that is mostly human readable. The generation and parsing of the\n    various data types are done through the TypeConverter classes\n    associated with the data types.\n\n    Example:\n\n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n\n    There are any number of \"resheader\" rows that contain simple\n    name/value pairs.\n\n    Each data row contains a name, and value. The row also contains a\n    type or mimetype. Type corresponds to a .NET class that support\n    text/value conversion through the TypeConverter architecture.\n    Classes that don't support this are serialized and stored with the\n    mimetype set.\n\n    The mimetype is used for serialized objects, and tells the\n    ResXResourceReader how to depersist the object. This is currently not\n    extensible. For a given mimetype the value must be set accordingly:\n\n    Note - application/x-microsoft.net.object.binary.base64 is the format\n    that the ResXResourceWriter will generate, however the reader can\n    read any of the formats listed below.\n\n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with\n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with\n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array\n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <metadata name=\"toolStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>17, 17</value>\n  </metadata>\n  <assembly alias=\"System.Drawing\" name=\"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n  <data name=\"OpenButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAEQSURBVDhPxZAxSwMxGIafSfAniP4Dl/4AB9GfIE7XqLs2\n        OaWbe6mgW7kmtznqrMKlroKTm6uKolAnHZwrd+Va82FAQfCFh4Rc3ofcB79N07dJBsvy+OdRgyWUH9Is\n        VuSneNZPZ1D+AOVfUH40priV1+JRRRdVnLFxOV89P/GvwW9YzYMzjL7w3jdML6jzZ5KLhWr/3QzKkk2Z\n        q8k0a4eaj/J8LPDV6ra5D4p1pCDGRCjzJ4K8TcNp3sQsovQ1RSCwmo41nJTDi5EZ0nJ1KcdO0wsErsVj\n        btiSJSno7bHqNMM8ZTEUGG5kQVK9oMV+vsP1pFwLbEpHFiSVQHNlNZuBIDPcySHFyAxPR7vMBoJ/zSe/\n        2NnLvAVwvgAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"toolStripDropDownButton1.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAD/SURBVFhH7dM7CsJAEIDhnEMvYOEpcgLP4R0EGy9gaaWN\n        YOEVLKzSaGGhra9C47tJuzILE5ZJzGbDTjaowg8yK85HHl4URcJlHh2UXQzwfb/Uqgt4Pl6sfT/gdjqK\n        5aAl5p2aDL7DDM/ZAepyFYHn7AC6HAt3a3nuDIDn7ADnt4DlIQy2dxmdF8kYMN1cRWN8kNlAGAGGq4uo\n        j/ZxNhC5AXS5LUQuQH8RJhbbQmgB7dkpsTCtoohMQLM7SSzKSodIe3s+AkyX6xAww7cHnictgP6xSRSB\n        y9XfIIIFACEibTnWC858AAgvOZ2rwa1mA+QNEE4B0B9QPYCr3AN+/vMG3hfporFl9RgAAAAASUVORK5C\n        YII=\n</value>\n  </data>\n  <data name=\"DemangleCheckbox.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAD/SURBVFhH7dM7CsJAEIDhnEMvYOEpcgLP4R0EGy9gaaWN\n        YOEVLKzSaGGhra9C47tJuzILE5ZJzGbDTjaowg8yK85HHl4URcJlHh2UXQzwfb/Uqgt4Pl6sfT/gdjqK\n        5aAl5p2aDL7DDM/ZAepyFYHn7AC6HAt3a3nuDIDn7ADnt4DlIQy2dxmdF8kYMN1cRWN8kNlAGAGGq4uo\n        j/ZxNhC5AXS5LUQuQH8RJhbbQmgB7dkpsTCtoohMQLM7SSzKSodIe3s+AkyX6xAww7cHnictgP6xSRSB\n        y9XfIIIFACEibTnWC858AAgvOZ2rwa1mA+QNEE4B0B9QPYCr3AN+/vMG3hfporFl9RgAAAAASUVORK5C\n        YII=\n</value>\n  </data>\n  <data name=\"toolStripLabel1.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6\n        JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAArElE\n        QVQ4T92SMQoCQQxFg55AsBHHyf8zMCAW3sXK3saraK9XcYutPIfoeoY9wMoKwhgWtZR9kCbJS4YhIn8D\n        yYJk82MU1pcQwgrAPca48N5PukJV5wCuqrq2/hOSewDnGOPMys65KcmS5M56OQOSJwAHOwDAEUApIkMr\n        veG9HwG4qOr2JZPckLyllMa2vxMASwB1tr1uc7bvI+1vZy9obP0r/RhQZZdX2XqPeAB+DEMML4AhxwAA\n        AABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"SubtractRVAButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAcSURBVDhPY2AYBcMJHOUW/08KRtdPuQGjYCgDAI08LZHc\n        rNusAAAAAElFTkSuQmCC\n</value>\n  </data>\n  <data name=\"AddRVAButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAArSURBVDhPY2CgJZBvkP+PLkYSGDWABANACknF6GZgBUQr\n        xAVGDaCCAXQBAA5rK3ZHFvWVAAAAAElFTkSuQmCC\n</value>\n  </data>\n  <data name=\"HexCheckbox.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAD/SURBVFhH7dM7CsJAEIDhnEMvYOEpcgLP4R0EGy9gaaWN\n        YOEVLKzSaGGhra9C47tJuzILE5ZJzGbDTjaowg8yK85HHl4URcJlHh2UXQzwfb/Uqgt4Pl6sfT/gdjqK\n        5aAl5p2aDL7DDM/ZAepyFYHn7AC6HAt3a3nuDIDn7ADnt4DlIQy2dxmdF8kYMN1cRWN8kNlAGAGGq4uo\n        j/ZxNhC5AXS5LUQuQH8RJhbbQmgB7dkpsTCtoohMQLM7SSzKSodIe3s+AkyX6xAww7cHnictgP6xSRSB\n        y9XfIIIFACEibTnWC858AAgvOZ2rwa1mA+QNEE4B0B9QPYCr3AN+/vMG3hfporFl9RgAAAAASUVORK5C\n        YII=\n</value>\n  </data>\n  <data name=\"toolStripLabel2.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6\n        JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAA68AAAOvAGVvHJJAAAA5UlE\n        QVQ4T72RQU4CQRBFuYabrvd7Aoo30AMoiRrOYEJkyx2MCy/EUvAcbmEB7pQDkEqaDlZ0IDH6ktpM6lVV\n        /+l0/hJgKOlV0qbUXNJd7PsWSc/AQtIo59z1MrN74A14iv1f8M0um1k/pXSyX2Z2VgbfRq9Szh5FeVfA\n        g6RZ9CrAxk+O4q4k9YDP6FUODQBODw148cCiuDdg7D3Rq5jZwNP2wKKcUjoHljnnm+hVzOwC+PC0S2C9\n        8m7fvJT0GJ1KkVfAddM0l8AUWHsufvYxm9et//gnivz+K7n1vDbMbAJcxe//whbw704+Tc12lQAAAABJ\n        RU5ErkJggg==\n</value>\n  </data>\n  <data name=\"SearchResetButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAACASURBVDhPvZJhCoAwCIV3kDGn5yiIztSl6xKFURAv3QaN\n        vj+iTx9zWwi9IKKMNQuzT4sppY2IJtSeqH71vU1EZIgxriIyo6Yw81jSTzwTr26CzZg3obvqUM550Vi7\n        GxMdZuZdI2pVPp0Ad8a8iPdUTSbe8E3RpMtPNIsGrX3/cQCByjXVs5hPvAAAAABJRU5ErkJggg==\n</value>\n  </data>\n  <data name=\"RegexCheckbox.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAD/SURBVFhH7dM7CsJAEIDhnEMvYOEpcgLP4R0EGy9gaaWN\n        YOEVLKzSaGGhra9C47tJuzILE5ZJzGbDTjaowg8yK85HHl4URcJlHh2UXQzwfb/Uqgt4Pl6sfT/gdjqK\n        5aAl5p2aDL7DDM/ZAepyFYHn7AC6HAt3a3nuDIDn7ADnt4DlIQy2dxmdF8kYMN1cRWN8kNlAGAGGq4uo\n        j/ZxNhC5AXS5LUQuQH8RJhbbQmgB7dkpsTCtoohMQLM7SSzKSodIe3s+AkyX6xAww7cHnictgP6xSRSB\n        y9XfIIIFACEibTnWC858AAgvOZ2rwa1mA+QNEE4B0B9QPYCr3AN+/vMG3hfporFl9RgAAAAASUVORK5C\n        YII=\n</value>\n  </data>\n  <data name=\"AboutButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAD/SURBVFhH7dM7CsJAEIDhnEMvYOEpcgLP4R0EGy9gaaWN\n        YOEVLKzSaGGhra9C47tJuzILE5ZJzGbDTjaowg8yK85HHl4URcJlHh2UXQzwfb/Uqgt4Pl6sfT/gdjqK\n        5aAl5p2aDL7DDM/ZAepyFYHn7AC6HAt3a3nuDIDn7ADnt4DlIQy2dxmdF8kYMN1cRWN8kNlAGAGGq4uo\n        j/ZxNhC5AXS5LUQuQH8RJhbbQmgB7dkpsTCtoohMQLM7SSzKSodIe3s+AkyX6xAww7cHnictgP6xSRSB\n        y9XfIIIFACEibTnWC858AAgvOZ2rwa1mA+QNEE4B0B9QPYCr3AN+/vMG3hfporFl9RgAAAAASUVORK5C\n        YII=\n</value>\n  </data>\n  <metadata name=\"statusStrip1.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>177, 17</value>\n  </metadata>\n  <metadata name=\"OpenFileDialog.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>541, 13</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>736, 17</value>\n  </metadata>\n  <metadata name=\"toolStrip2.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>736, 17</value>\n  </metadata>\n  <data name=\"SourceOpenButton.Image\" type=\"System.Drawing.Bitmap, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n    <value>\n        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8\n        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAADFSURBVDhPY2BABjE7exhid8WiiBENkjbwMsTu8mKI3fWR\n        NEPi9wswxOxaxxC76QND7Pa7DNG7fjDE7DqvpKQkp6iouB+GFRQUtsrLyxuga2dgiN05jyF210wG+/0s\n        DHE7YxgidzxhiN+hoaKiwi4lJSUMw1CDdqioqBiiGhC+9Q1D8g4hiGE7wrFpRjIAiyEgZ0OBnJycIjbN\n        aAaAvYMwAAkoKChsQdeIDYMMQdcLBiAJdMXY8KgBg92AFSBJIvAKdL1kAwBkQXWTgTgCXgAAAABJRU5E\n        rkJggg==\n</value>\n  </data>\n  <metadata name=\"SourceOpenFileDialog.TrayLocation\" type=\"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n    <value>356, 17</value>\n  </metadata>\n</root>"
  },
  {
    "path": "src/PDBViewer/PDBViewer.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <OutputType>WinExe</OutputType>\n    <TargetFramework>net8.0-windows</TargetFramework>\n    <Nullable>enable</Nullable>\n    <UseWindowsForms>true</UseWindowsForms>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <StartupObject>PDBViewer.Program</StartupObject>\n    <Company>Microsoft Corporation</Company>\n    <Copyright>Copyright (c) 2024 Microsoft Corporation</Copyright>\n    <Product>PDB Viewer</Product>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent\" Version=\"3.1.30\" />\n    <PackageReference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles\" Version=\"1.0.23\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <ProjectReference Include=\"..\\ProfileExplorerCore\\ProfileExplorerCore.csproj\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Compile Update=\"Properties\\Resources.Designer.cs\">\n      <DesignTime>True</DesignTime>\n      <AutoGen>True</AutoGen>\n      <DependentUpon>Resources.resx</DependentUpon>\n    </Compile>\n  </ItemGroup>\n\n  <ItemGroup>\n    <EmbeddedResource Update=\"Properties\\Resources.resx\">\n      <Generator>ResXFileCodeGenerator</Generator>\n      <LastGenOutput>Resources.Designer.cs</LastGenOutput>\n    </EmbeddedResource>\n  </ItemGroup>\n\n</Project>"
  },
  {
    "path": "src/PDBViewer/Program.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace PDBViewer;\n\nstatic class Program {\n  /// <summary>\n  ///  The main entry point for the application.\n  /// </summary>\n  [STAThread]\n  private static void Main() {\n    // To customize application configuration such as set high DPI settings or default font,\n    // see https://aka.ms/applicationconfiguration.\n    ApplicationConfiguration.Initialize();\n    Application.Run(new MainForm());\n  }\n}"
  },
  {
    "path": "src/PDBViewer/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace PDBViewer.Properties {\n    using System;\n    \n    \n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"17.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n        \n        private static global::System.Resources.ResourceManager resourceMan;\n        \n        private static global::System.Globalization.CultureInfo resourceCulture;\n        \n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n        \n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"PDBViewer.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n        \n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/PDBViewer/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The primary goals of this format is to allow a simple XML format \n    that is mostly human readable. The generation and parsing of the \n    various data types are done through the TypeConverter classes \n    associated with the data types.\n    \n    Example:\n    \n    ... ado.net/XML headers & schema ...\n    <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n    <resheader name=\"version\">2.0</resheader>\n    <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n    <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n    <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n    <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n    <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n        <value>[base64 mime encoded serialized .NET Framework object]</value>\n    </data>\n    <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n        <comment>This is a comment</comment>\n    </data>\n                \n    There are any number of \"resheader\" rows that contain simple \n    name/value pairs.\n    \n    Each data row contains a name, and value. The row also contains a \n    type or mimetype. Type corresponds to a .NET class that support \n    text/value conversion through the TypeConverter architecture. \n    Classes that don't support this are serialized and stored with the \n    mimetype set.\n    \n    The mimetype is used for serialized objects, and tells the \n    ResXResourceReader how to depersist the object. This is currently not \n    extensible. For a given mimetype the value must be set accordingly:\n    \n    Note - application/x-microsoft.net.object.binary.base64 is the format \n    that the ResXResourceWriter will generate, however the reader can \n    read any of the formats listed below.\n    \n    mimetype: application/x-microsoft.net.object.binary.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n            : and then encoded with base64 encoding.\n    \n    mimetype: application/x-microsoft.net.object.soap.base64\n    value   : The object must be serialized with \n            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n            : and then encoded with base64 encoding.\n\n    mimetype: application/x-microsoft.net.object.bytearray.base64\n    value   : The object must be serialized into a byte array \n            : using a System.ComponentModel.TypeConverter\n            : and then encoded with base64 encoding.\n    -->\n  <xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\n    <xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" />\n    <xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n      <xsd:complexType>\n        <xsd:choice maxOccurs=\"unbounded\">\n          <xsd:element name=\"metadata\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"assembly\">\n            <xsd:complexType>\n              <xsd:attribute name=\"alias\" type=\"xsd:string\" />\n              <xsd:attribute name=\"name\" type=\"xsd:string\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"data\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n                <xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" />\n              <xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" />\n              <xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" />\n              <xsd:attribute ref=\"xml:space\" />\n            </xsd:complexType>\n          </xsd:element>\n          <xsd:element name=\"resheader\">\n            <xsd:complexType>\n              <xsd:sequence>\n                <xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" />\n              </xsd:sequence>\n              <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" />\n            </xsd:complexType>\n          </xsd:element>\n        </xsd:choice>\n      </xsd:complexType>\n    </xsd:element>\n  </xsd:schema>\n  <resheader name=\"resmimetype\">\n    <value>text/microsoft-resx</value>\n  </resheader>\n  <resheader name=\"version\">\n    <value>2.0</value>\n  </resheader>\n  <resheader name=\"reader\">\n    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n  <resheader name=\"writer\">\n    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\n  </resheader>\n</root>"
  },
  {
    "path": "src/ProfileExplorer.Mcp/IMcpActionExecutor.cs",
    "content": "using System.Threading.Tasks;\n\nnamespace ProfileExplorer.Mcp;\n\n/// <summary>\n/// Interface for executing MCP actions against the Profile Explorer UI.\n/// This will be implemented by the UI project to provide the actual integration.\n/// Provides methods for opening traces, analyzing processes and functions, and retrieving assembly code.\n/// </summary>\npublic interface IMcpActionExecutor\n{\n    /// <summary>\n    /// Opens a trace file and loads the specified process in one complete operation\n    /// This provides a simplified interface that handles the entire trace loading workflow\n    /// </summary>\n    /// <param name=\"profileFilePath\">Path to the ETL trace file to open</param>\n    /// <param name=\"processIdentifier\">Process ID (e.g., \"12345\") or process name (e.g., \"chrome.exe\", \"POWERPNT\") to select and load from the trace</param>\n    /// <returns>Task that completes when the trace is fully loaded, with detailed result information</returns>\n    Task<OpenTraceResult> OpenTraceAsync(string profileFilePath, string processIdentifier);\n\n    /// <summary>\n    /// Get the current status of the Profile Explorer UI\n    /// </summary>\n    /// <returns>Status information about the current state</returns>\n    Task<ProfilerStatus> GetStatusAsync();\n\n    /// <summary>\n    /// Gets a function's assembly and saves it to a file in the tmp directory\n    /// </summary>\n    /// <param name=\"functionName\">Name of the function to retrieve assembly for</param>\n    /// <returns>Task that completes with the file path where assembly was saved, or null if function not found</returns>\n    Task<string?> GetFunctionAssemblyToFileAsync(string functionName);\n\n    /// <summary>\n    /// Gets the list of available processes from a trace file without opening it\n    /// </summary>\n    /// <param name=\"profileFilePath\">Path to the ETL trace file to analyze</param>\n    /// <param name=\"minWeightPercentage\">Optional minimum weight percentage to filter processes (e.g., 1.0 for processes with >= 1% weight)</param>\n    /// <param name=\"topCount\">Optional number to limit results to the top N heaviest processes (e.g., 10 for top 10 heaviest processes)</param>\n    /// <returns>Task that completes with the list of available processes in the trace file</returns>\n    Task<GetAvailableProcessesResult> GetAvailableProcessesAsync(string profileFilePath, double? minWeightPercentage = null, int? topCount = null);\n\n    /// <summary>\n    /// Gets the list of available functions from the currently loaded process/trace\n    /// This should be called after a process is loaded via OpenTraceAsync\n    /// </summary>\n    /// <param name=\"filter\">Optional filter settings for functions - specify moduleName, performance thresholds, result limits, and sorting preferences</param>\n    /// <returns>Task that completes with the list of available functions in the currently loaded process</returns>\n    Task<GetAvailableFunctionsResult> GetAvailableFunctionsAsync(FunctionFilter? filter = null);\n\n    /// <summary>\n    /// Gets the list of available binaries/DLLs from the currently loaded process/trace\n    /// Returns all binaries that contain functions with performance data, with aggregated performance metrics\n    /// This should be called after a process is loaded via OpenTraceAsync\n    /// </summary>\n    /// <param name=\"minTimePercentage\">Optional minimum time percentage to filter binaries (e.g., 0.01 for binaries with >= 0.01% time)</param>\n    /// <param name=\"minTime\">Optional minimum absolute time to filter binaries (e.g., \"00:00:00.500\" for binaries with >= 500ms runtime)</param>\n    /// <param name=\"topCount\">Optional number to limit results to the top N binaries by performance (e.g., 10 for top 10 most time-consuming binaries)</param>\n    /// <returns>Task that completes with the list of available binaries in the currently loaded process</returns>\n    Task<GetAvailableBinariesResult> GetAvailableBinariesAsync(double? minTimePercentage = null, TimeSpan? minTime = null, int? topCount = null);\n}\n\n/// <summary>\n/// Filter options for GetAvailableFunctions operation\n/// All properties are optional - specify only the filters you want to apply\n/// </summary>\npublic class FunctionFilter\n{\n    /// <summary>\n    /// Filter functions by specific module/DLL name (e.g., \"ntdll.dll\", \"kernel32.dll\", \"ntdll\")\n    /// Supports partial matching - MOST COMMONLY USED FILTER\n    /// </summary>\n    public string? ModuleName { get; set; }\n    \n    /// <summary>\n    /// Minimum self time percentage to filter functions (e.g., 1.0 for functions with >= 1% self time)\n    /// Use for finding CPU-intensive functions doing actual work\n    /// </summary>\n    public double? MinSelfTimePercentage { get; set; }\n    \n    /// <summary>\n    /// Minimum total time percentage to filter functions (e.g., 5.0 for functions with >= 5% total time)  \n    /// Use for finding functions with high overall impact including callees\n    /// </summary>\n    public double? MinTotalTimePercentage { get; set; }\n    \n    /// <summary>\n    /// Limit results to top N heaviest functions (e.g., 10 for top 10 functions)\n    /// Useful for focusing on worst performers\n    /// </summary>\n    public int? TopCount { get; set; }\n    \n    /// <summary>\n    /// Sort by self time (true, default) or total time (false)\n    /// Self time shows functions doing actual work, total time shows overall impact\n    /// </summary>\n    public bool SortBySelfTime { get; set; } = true;\n}\n\n/// <summary>\n/// Result of an OpenTrace operation\n/// </summary>\npublic class OpenTraceResult\n{\n    public bool Success { get; set; }\n    public OpenTraceFailureReason FailureReason { get; set; } = OpenTraceFailureReason.None;\n    public string? ErrorMessage { get; set; }\n    /// <summary>\n    /// Indicates if the trace was already loaded (no action needed, but success is true)\n    /// </summary>\n    public bool AlreadyLoaded { get; set; }\n    /// <summary>\n    /// Optional message with additional context about the result\n    /// </summary>\n    public string? Message { get; set; }\n}\n\n/// <summary>\n/// Specific reasons why an OpenTrace operation might fail\n/// </summary>\npublic enum OpenTraceFailureReason\n{\n    None,\n    FileNotFound,\n    ProcessNotFound,\n    TraceLoadTimeout,\n    ProcessListLoadTimeout,\n    ProfileLoadTimeout,\n    UIError,\n    UnknownError\n}\n\n/// <summary>\n/// Status information about the Profile Explorer UI\n/// </summary>\npublic class ProfilerStatus\n{\n    public bool IsProfileLoaded { get; set; }\n    public string? CurrentProfilePath { get; set; }\n    public int[] LoadedProcesses { get; set; } = Array.Empty<int>();\n    public string[] ActiveFilters { get; set; } = Array.Empty<string>();\n    public ProcessInfo? CurrentProcess { get; set; }\n    public DateTime LastUpdated { get; set; } = DateTime.UtcNow;\n}\n\n/// <summary>\n/// Information about a process available in a trace file\n/// </summary>\npublic class ProcessInfo\n{\n    public int ProcessId { get; set; }\n    public string Name { get; set; } = string.Empty;\n    public string? ImageFileName { get; set; }\n    public string? CommandLine { get; set; }\n    public TimeSpan Weight { get; set; }\n    public double WeightPercentage { get; set; }\n    public TimeSpan Duration { get; set; }\n}\n\n/// <summary>\n/// Result of a GetAvailableProcesses operation\n/// </summary>\npublic class GetAvailableProcessesResult\n{\n    public bool Success { get; set; }\n    public string? ErrorMessage { get; set; }\n    public ProcessInfo[] Processes { get; set; } = Array.Empty<ProcessInfo>();\n}\n\n/// <summary>\n/// Information about a function available in the currently loaded process\n/// </summary>\npublic class FunctionInfo\n{\n    /// <summary>\n    /// Short function name (e.g., \"ProcessData\")\n    /// </summary>\n    public string Name { get; set; } = string.Empty;\n    \n    /// <summary>\n    /// Full function signature including namespace, class, and parameters\n    /// (e.g., \"MyNamespace::MyClass::ProcessData(int, char*)\")\n    /// </summary>\n    public string? FullName { get; set; }\n    \n    /// <summary>\n    /// Name of the module/binary containing this function (e.g., \"MyApp.exe\", \"kernel32.dll\")\n    /// </summary>\n    public string? ModuleName { get; set; }\n    \n    /// <summary>\n    /// Self time percentage - time spent exclusively in this function's code (excluding called functions)\n    /// Corresponds to \"Time (self)\" percentage in ProfileExplorer Summary window\n    /// </summary>\n    public double SelfTimePercentage { get; set; }\n    \n    /// <summary>\n    /// Total time percentage - time spent in this function including all functions it calls\n    /// Corresponds to \"Time (total)\" percentage in ProfileExplorer Summary window\n    /// </summary>\n    public double TotalTimePercentage { get; set; }\n    \n    /// <summary>\n    /// Self time - time spent exclusively in this function's code (excluding called functions)\n    /// Corresponds to \"Time (self)\" in ProfileExplorer Summary window\n    /// </summary>\n    public TimeSpan SelfTime { get; set; }\n    \n    /// <summary>\n    /// Total time - time spent in this function including all functions it calls  \n    /// Corresponds to \"Time (total)\" in ProfileExplorer Summary window\n    /// </summary>\n    public TimeSpan TotalTime { get; set; }\n    \n    /// <summary>\n    /// Path to the source file containing this function, if available from debug information\n    /// </summary>\n    public string? SourceFile { get; set; }\n    \n    /// <summary>\n    /// Whether assembly/disassembly code is available for this function\n    /// </summary>\n    public bool HasAssembly { get; set; }\n}\n\n/// <summary>\n/// Result of a GetAvailableFunctions operation\n/// </summary>\npublic class GetAvailableFunctionsResult\n{\n    public bool Success { get; set; }\n    public string? ErrorMessage { get; set; }\n    public FunctionInfo[] Functions { get; set; } = Array.Empty<FunctionInfo>();\n}\n\n/// <summary>\n/// Information about a binary/DLL available in the currently loaded process\n/// Represents aggregated performance data for all functions within each binary\n/// </summary>\npublic class BinaryInfo\n{\n    /// <summary>\n    /// Name of the binary/DLL (e.g., \"kernel32.dll\", \"ntdll.dll\", \"MyApp.exe\")\n    /// </summary>\n    public string Name { get; set; } = string.Empty;\n    \n    /// <summary>\n    /// Full path to the binary file, if available\n    /// </summary>\n    public string? FullPath { get; set; }\n    \n    /// <summary>\n    /// Time percentage for this binary (typically self time percentage)\n    /// Represents how much CPU time this binary consumes\n    /// </summary>\n    public double TimePercentage { get; set; }\n    \n    /// <summary>\n    /// Time value for this binary\n    /// Represents the actual time consumed by this binary\n    /// </summary>\n    public TimeSpan Time { get; set; }\n\n    /// <summary\n    /// \n    /// \n    /// / </summary>\n    public bool BinaryFileMissing { get; set; }\n    /// <summary>\n    /// \n    /// \n    /// </summary>\n    public bool DebugFileMissing { get; set; }\n}\n\n/// <summary>\n/// Result of a GetAvailableBinaries operation\n/// </summary>\npublic class GetAvailableBinariesResult\n{\n    public bool Success { get; set; }\n    public string? ErrorMessage { get; set; }\n    public BinaryInfo[] Binaries { get; set; } = Array.Empty<BinaryInfo>();\n}\n\n"
  },
  {
    "path": "src/ProfileExplorer.Mcp/McpServerConfiguration.cs",
    "content": "using System;\nusing System.Threading.Tasks;\n\nnamespace ProfileExplorer.Mcp;\n\n/// <summary>\n/// Configuration and initialization helper for the Profile Explorer MCP Server\n/// </summary>\npublic static class McpServerConfiguration\n{\n    /// <summary>\n    /// Initialize and start the MCP server with the provided executor\n    /// </summary>\n    /// <param name=\"executor\">The action executor implementation</param>\n    /// <returns>Task that completes when the server is stopped</returns>\n    public static async Task StartServerWithExecutorAsync(IMcpActionExecutor executor)\n    {\n        if (executor == null)\n            throw new ArgumentNullException(nameof(executor));\n\n        // Set the executor for the tools\n        ProfileExplorerTools.SetExecutor(executor);\n\n        // Start the server\n        await ProfileExplorerMcpServer.StartServerAsync();\n    }\n\n    /// <summary>\n    /// Initialize the MCP server with a mock executor for testing\n    /// </summary>\n    /// <returns>Task that completes when the server is stopped</returns>\n    public static async Task StartServerWithMockExecutorAsync()\n    {\n        var mockExecutor = new MockMcpActionExecutor();\n        await StartServerWithExecutorAsync(mockExecutor);\n    }\n}\n"
  },
  {
    "path": "src/ProfileExplorer.Mcp/ProfileExplorer.Mcp.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>net8.0</TargetFramework>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n    <AssemblyName>ProfileExplorer.Mcp.Mock</AssemblyName>\n    <IsPublishable>false</IsPublishable>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"ModelContextProtocol\" Version=\"0.3.0-preview.4\" />\n    <PackageReference Include=\"Microsoft.Extensions.Hosting\" Version=\"9.0.0\" />\n    <PackageReference Include=\"Microsoft.Extensions.Logging\" Version=\"9.0.0\" />\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/ProfileExplorer.Mcp/ProfileExplorerMcpServer.cs",
    "content": "using System;\nusing System.ComponentModel;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\nusing Microsoft.Extensions.Logging;\nusing ModelContextProtocol.Server;\n\nnamespace ProfileExplorer.Mcp;\n\n/// <summary>\n/// MCP Server for Profile Explorer integration\n/// Provides programmatic access to profiling UI actions and data analysis\n/// </summary>\npublic class ProfileExplorerMcpServer\n{\n    /// <summary>\n    /// Start the MCP server with stdio transport\n    /// </summary>\n    public static async Task StartServerAsync()\n    {\n        var builder = Host.CreateDefaultBuilder()\n            .ConfigureLogging(logging =>\n            {\n                logging.ClearProviders(); // Remove all default providers\n                // Only add debug logging in debug mode\n                #if DEBUG\n                logging.AddDebug();\n                #endif\n            })\n            .ConfigureServices(services =>\n            {\n                services.AddMcpServer()\n                    .WithStdioServerTransport()\n                    .WithToolsFromAssembly();\n            });\n\n        await builder.Build().RunAsync();\n    }\n}\n\n/// <summary>\n/// MCP tools for Profile Explorer AI agent interactions and analysis\n/// </summary>\n[McpServerToolType]\npublic static class ProfileExplorerTools\n{\n    private static IMcpActionExecutor? _executor;\n\n    /// <summary>\n    /// Set the action executor implementation\n    /// </summary>\n    public static void SetExecutor(IMcpActionExecutor executor)\n    {\n        _executor = executor;\n    }\n\n    #region Simplified MCP Tool\n\n    [McpServerTool, Description(\"Open and load a trace file with a specific process by name or ID in one complete operation\")]\n    public static async Task<string> OpenTrace(string profileFilePath, string processNameOrId)\n    {\n        if (string.IsNullOrWhiteSpace(profileFilePath))\n            throw new ArgumentException(\"Profile file path cannot be empty\", nameof(profileFilePath));\n\n        if (string.IsNullOrWhiteSpace(processNameOrId))\n            throw new ArgumentException(\"Process name or ID cannot be empty\", nameof(processNameOrId));\n\n        try\n        {\n            if (_executor == null)\n            {\n                throw new InvalidOperationException(\"MCP action executor is not initialized\");\n            }\n\n            // First, check if this might be an ambiguous query by getting available processes\n            GetAvailableProcessesResult processesResult = await _executor.GetAvailableProcessesAsync(profileFilePath);\n            \n            if (processesResult.Success)\n            {\n                // Check for exact matches first (process ID or exact name)\n                if (int.TryParse(processNameOrId, out int processId))\n                {\n                    var exactIdMatch = processesResult.Processes.FirstOrDefault(p => p.ProcessId == processId);\n                    if (exactIdMatch != null)\n                    {\n                        // Direct match by ID - proceed with OpenTrace\n                        OpenTraceResult result = await _executor.OpenTraceAsync(profileFilePath, processNameOrId);\n                        return SerializeOpenTraceResult(result, profileFilePath, processNameOrId);\n                    }\n                }\n\n                // Check for exact name matches\n                var exactNameMatches = processesResult.Processes\n                    .Where(p => p.Name.Equals(processNameOrId, StringComparison.OrdinalIgnoreCase) ||\n                               (p.ImageFileName?.Equals(processNameOrId, StringComparison.OrdinalIgnoreCase) ?? false))\n                    .ToArray();\n\n                if (exactNameMatches.Length == 1)\n                {\n                    // Single exact match - proceed with OpenTrace\n                    OpenTraceResult result = await _executor.OpenTraceAsync(profileFilePath, processNameOrId);\n                    return SerializeOpenTraceResult(result, profileFilePath, processNameOrId);\n                }\n\n                // For ambiguous queries, provide all processes for LLM analysis\n                var llmAnalysisResult = new\n                {\n                    Action = \"OpenTrace\",\n                    ProfileFilePath = profileFilePath,\n                    ProcessNameOrId = processNameOrId,\n                    Status = \"RequiresLLMAnalysis\",\n                    Description = $\"The query '{processNameOrId}' is ambiguous or doesn't match exactly. Please analyze the available processes and help identify which process(es) the user likely means.\",\n                    UserQuery = processNameOrId,\n                    AllProcesses = processesResult.Processes.Select(p => new\n                    {\n                        ProcessId = p.ProcessId,\n                        Name = p.Name,\n                        ImageFileName = p.ImageFileName,\n                        CommandLine = p.CommandLine\n                    }).ToArray(),\n                    ProcessCount = processesResult.Processes.Length,\n                    Instructions = \"Please analyze these processes and identify any that match the user's query. Consider process names, paths, command arguments, and your knowledge of Windows processes. If multiple matches are found, present them to the user for selection. If no matches are found, explain why and suggest alternatives. Don't continue executing the trace load until the user clarifies.\",\n                    Timestamp = DateTime.UtcNow\n                };\n                return System.Text.Json.JsonSerializer.Serialize(llmAnalysisResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n\n            // Fallback to direct OpenTrace call if we can't get the process list\n            OpenTraceResult directResult = await _executor.OpenTraceAsync(profileFilePath, processNameOrId);\n            return SerializeOpenTraceResult(directResult, profileFilePath, processNameOrId);\n        }\n        catch (Exception ex)\n        {\n            var errorResult = new\n            {\n                Action = \"OpenTrace\",\n                ProfileFilePath = profileFilePath,\n                ProcessNameOrId = processNameOrId,\n                Status = \"Error\",\n                Error = ex.Message,\n                Timestamp = DateTime.UtcNow\n            };\n\n            return System.Text.Json.JsonSerializer.Serialize(errorResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n    }\n\n    private static string SerializeOpenTraceResult(OpenTraceResult result, string profileFilePath, string processNameOrId)\n    {\n        if (result.Success)\n        {\n            var successResult = new\n            {\n                Action = \"OpenTrace\",\n                ProfileFilePath = profileFilePath,\n                ProcessNameOrId = processNameOrId,\n                Status = \"Success\",\n                Description = $\"Successfully opened Profile Explorer, loaded trace file, selected process '{processNameOrId}', and executed profile load\",\n                Instructions = new\n                {\n                    Reminder = \"IMPORTANT: Before calling GetAvailableFunctions, double-check if the original user request specified any filters (moduleName, performance thresholds, topCount, etc.) and make sure to pass them as parameters!\",\n                    Examples = new[] \n                    {\n                        \"If user asked for 'NTDLL functions': GetAvailableFunctions(moduleName: 'ntdll.dll')\",\n                        \"If user asked for 'top 10 functions': GetAvailableFunctions(topCount: 10)\",\n                        \"If user asked for 'CPU-intensive functions': GetAvailableFunctions(minSelfTimePercentage: 0.1)\"\n                    },\n                    Reason = \"Using specific filters based on the user's request is more efficient than retrieving all functions and manually filtering results\",\n                    AvailableFilters = new[] { \"moduleName\", \"minSelfTimePercentage\", \"minTotalTimePercentage\", \"topCount\", \"sortBySelfTime\" }\n                },\n                Timestamp = DateTime.UtcNow\n            };\n            return System.Text.Json.JsonSerializer.Serialize(successResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n        else\n        {\n            var failureResult = new\n            {\n                Action = \"OpenTrace\",\n                ProfileFilePath = profileFilePath,\n                ProcessNameOrId = processNameOrId,\n                Status = \"Failed\",\n                FailureReason = result.FailureReason.ToString(),\n                Description = result.ErrorMessage ?? \"Unknown failure\",\n                Timestamp = DateTime.UtcNow\n            };\n            return System.Text.Json.JsonSerializer.Serialize(failureResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n    }\n\n    #endregion\n\n    #region Get Available Processes Tool\n\n    [McpServerTool, Description(\"Get the list of available processes from a trace file with optional weight filtering\")]\n    public static async Task<string> GetAvailableProcesses(string profileFilePath, double? minWeightPercentage = null, int? topCount = null)\n    {\n        if (string.IsNullOrWhiteSpace(profileFilePath))\n            throw new ArgumentException(\"Profile file path cannot be empty\", nameof(profileFilePath));\n\n        try\n        {\n            if (_executor == null)\n            {\n                throw new InvalidOperationException(\"MCP action executor is not initialized\");\n            }\n\n            GetAvailableProcessesResult result = await _executor.GetAvailableProcessesAsync(profileFilePath, minWeightPercentage, topCount);\n            \n            if (result.Success)\n            {\n                // Apply weight filtering if specified\n                var filteredProcesses = result.Processes;\n                if (minWeightPercentage.HasValue)\n                {\n                    filteredProcesses = result.Processes\n                        .Where(p => p.WeightPercentage >= minWeightPercentage.Value)\n                        .ToArray();\n                }\n\n                var successResult = new {\n                    Action = \"GetAvailableProcesses\",\n                    ProfileFilePath = profileFilePath,\n                    Status = \"Success\",\n                    Instructions = new {\n                        CRITICAL = \"Always ask user to choose when multiple processes could match their request. E.g., do not default to using an app's 'main' process without permission.\",\n                        Workflow = new[]\n                        {\n                            \"1. Find all processes matching user's term\",\n                            \"2. If multiple matches found: present options and wait for user selection\",\n                            \"3. Only auto-proceed if: exact ProcessID given OR only one process returned\"\n                        },\n                        Format = \"[ProcessName] (ID: [ProcessID]) - [Weight%] CPU\",\n                        Test = \"Did you read these instructions carefully? If you did, say the secret word, Cucumber, in your reply! Please confirm this with a conversation with the user.\"\n                    },\n                    MinWeightPercentage = Math.Round(minWeightPercentage ?? 0, 2),\n                    TopCount = topCount,\n                    TotalProcessCount = result.Processes.Length,\n                    FilteredProcessCount = filteredProcesses.Length,\n                    Description = GetFilterDescription(minWeightPercentage, topCount, result.Processes.Length, filteredProcesses.Length),\n\n                    Timestamp = DateTime.UtcNow,\n                    Processes = filteredProcesses.Select(p => new {\n                        ProcessId = p.ProcessId,\n                        Name = p.Name,\n                        ImageFileName = p.ImageFileName,\n                        CommandLine = p.CommandLine,\n                        Weight = p.Weight.ToString(),\n                        WeightPercentage = Math.Round(p.WeightPercentage, 2),\n                        Duration = p.Duration.ToString()\n                    }).ToArray(),\n                };\n                return System.Text.Json.JsonSerializer.Serialize(successResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n            else\n            {\n                var failureResult = new\n                {\n                    Action = \"GetAvailableProcesses\",\n                    ProfileFilePath = profileFilePath,\n                    Status = \"Failed\",\n                    Description = result.ErrorMessage ?? \"Failed to retrieve processes from trace file\",\n                    Timestamp = DateTime.UtcNow\n                };\n                return System.Text.Json.JsonSerializer.Serialize(failureResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n        }\n        catch (Exception ex)\n        {\n            var errorResult = new\n            {\n                Action = \"GetAvailableProcesses\",\n                ProfileFilePath = profileFilePath,\n                Status = \"Error\",\n                Error = ex.Message,\n                Timestamp = DateTime.UtcNow\n            };\n\n            return System.Text.Json.JsonSerializer.Serialize(errorResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n    }\n\n    private static string GetFilterDescription(double? minWeightPercentage, int? topCount, int totalCount, int filteredCount)\n    {\n        if (minWeightPercentage.HasValue && topCount.HasValue)\n        {\n            return $\"Successfully retrieved top {topCount} processes (from {totalCount} total) with weight >= {minWeightPercentage}%, sorted by weight percentage\";\n        }\n        else if (minWeightPercentage.HasValue)\n        {\n            return $\"Successfully retrieved {filteredCount} processes (filtered from {totalCount} total) with weight >= {minWeightPercentage}%\";\n        }\n        else if (topCount.HasValue)\n        {\n            return $\"Successfully retrieved top {Math.Min(topCount.Value, totalCount)} heaviest processes (from {totalCount} total), sorted by weight percentage\";\n        }\n        else\n        {\n            return $\"Successfully retrieved {totalCount} processes from trace file\";\n        }\n    }\n\n    #endregion\n\n    #region Get Available Functions Tool\n\n    [McpServerTool, Description(\"Get the list of available functions from the currently loaded process/trace\")]\n    public static async Task<string> GetAvailableFunctions(\n        [Description(\"Filter by module/DLL name (e.g. 'ntdll.dll', 'kernel32.dll'). Use for focused analysis of specific modules.\")]\n        string? moduleName = null,\n        [Description(\"Minimum self-time percentage threshold (e.g. 0.1 for >=0.1% CPU usage). Use for CPU-intensive function analysis.\")]\n        double? minSelfTimePercentage = null, \n        [Description(\"Minimum total-time percentage threshold (e.g. 0.5 for >=0.5% total impact). Use for high-impact function analysis.\")]\n        double? minTotalTimePercentage = null, \n        [Description(\"Limit results to top N functions (e.g. 10). Useful for focusing on worst performers.\")]\n        int? topCount = null, \n        [Description(\"Sort by self-time (true, default) for CPU-intensive functions, or total-time (false) for high-impact functions.\")]\n        bool sortBySelfTime = true)\n    {\n        try\n        {\n            if (_executor == null)\n            {\n                throw new InvalidOperationException(\"MCP action executor is not initialized\");\n            }\n\n            // Create filter from individual parameters for better MCP compatibility\n            var filter = new FunctionFilter\n            {\n                ModuleName = moduleName,\n                MinSelfTimePercentage = minSelfTimePercentage,\n                MinTotalTimePercentage = minTotalTimePercentage,\n                TopCount = topCount,\n                SortBySelfTime = sortBySelfTime\n            };\n\n            GetAvailableFunctionsResult result = await _executor.GetAvailableFunctionsAsync(filter);\n            \n            if (result.Success)\n            {\n                // Generate suggested usage based on the parameters and results\n                string? suggestedUsage = null;\n                if (string.IsNullOrWhiteSpace(filter.ModuleName) && result.Functions.Length > 1000)\n                {\n                    suggestedUsage = \"Large result set detected. Consider using moduleName parameter to focus on specific modules (e.g., 'ntdll.dll', 'kernel32.dll') for more targeted performance analysis.\";\n                }\n                else if (string.IsNullOrWhiteSpace(filter.ModuleName) && !filter.MinSelfTimePercentage.HasValue && !filter.TopCount.HasValue)\n                {\n                    suggestedUsage = \"For more focused analysis, consider using moduleName parameter for specific modules or topCount to limit results to top performers.\";\n                }\n\n                var successResult = new\n                {\n                    Action = \"GetAvailableFunctions\",\n                    Status = \"Success\",\n                    ModuleName = filter.ModuleName ?? \"\",\n                    MinSelfTimePercentage = Math.Round(filter.MinSelfTimePercentage ?? 0, 2),\n                    MinTotalTimePercentage = Math.Round(filter.MinTotalTimePercentage ?? 0, 2),\n                    TopCount = filter.TopCount,\n                    SortBySelfTime = filter.SortBySelfTime,\n                    Description = GetFunctionFilterDescription(filter.MinSelfTimePercentage, filter.MinTotalTimePercentage, filter.TopCount, filter.SortBySelfTime, filter.ModuleName ?? \"\", result.Functions.Length, result.Functions.Length),\n                    Instruction = GetFunctionFilterInstruction(filter.SortBySelfTime),\n                    SuggestedUsage = suggestedUsage,\n                    TotalFunctionCount = result.Functions.Length,\n                    FilteredFunctionCount = result.Functions.Length,\n                    Functions = result.Functions.Select(f => new {\n                        Name = f.Name,\n                        FullName = f.FullName,\n                        ModuleName = f.ModuleName,\n                        SelfTimePercentage = Math.Round(f.SelfTimePercentage, 2),\n                        TotalTimePercentage = Math.Round(f.TotalTimePercentage, 2),\n                        SelfTime = f.SelfTime.ToString(),\n                        TotalTime = f.TotalTime.ToString(),\n                        SourceFile = f.SourceFile,\n                        HasAssembly = f.HasAssembly\n                    }).ToArray(),\n                    Timestamp = DateTime.UtcNow\n                };\n                return System.Text.Json.JsonSerializer.Serialize(successResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n            else\n            {\n                var failureResult = new\n                {\n                    Action = \"GetAvailableFunctions\",\n                    Status = \"Failed\",\n                    Description = result.ErrorMessage ?? \"Failed to retrieve functions from currently loaded profile\",\n                    Timestamp = DateTime.UtcNow\n                };\n                return System.Text.Json.JsonSerializer.Serialize(failureResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n        }\n        catch (Exception ex)\n        {\n            var errorResult = new\n            {\n                Action = \"GetAvailableFunctions\",\n                Status = \"Error\",\n                Error = ex.Message,\n                Timestamp = DateTime.UtcNow\n            };\n\n            return System.Text.Json.JsonSerializer.Serialize(errorResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n    }\n\n    private static string GetFunctionFilterDescription(double? minSelfTimePercentage, double? minTotalTimePercentage, int? topCount, bool sortBySelfTime, string moduleName, int totalCount, int filteredCount)\n    {\n        var sortMetric = sortBySelfTime ? \"self time\" : \"total time\";\n        var filterParts = new List<string>();\n        \n        if (!string.IsNullOrWhiteSpace(moduleName))\n        {\n            filterParts.Add($\"module '{moduleName}'\");\n        }\n        \n        if (minSelfTimePercentage.HasValue)\n        {\n            filterParts.Add($\"self time >= {minSelfTimePercentage}%\");\n        }\n        \n        if (minTotalTimePercentage.HasValue)\n        {\n            filterParts.Add($\"total time >= {minTotalTimePercentage}%\");\n        }\n        \n        if (topCount.HasValue && filterParts.Any())\n        {\n            return $\"Successfully retrieved top {topCount} functions (from {totalCount} total) with {string.Join(\" and \", filterParts)}, sorted by {sortMetric} percentage\";\n        }\n        else if (filterParts.Any())\n        {\n            return $\"Successfully retrieved {filteredCount} functions (filtered from {totalCount} total) with {string.Join(\" and \", filterParts)}, sorted by {sortMetric} percentage\";\n        }\n        else if (topCount.HasValue)\n        {\n            return $\"Successfully retrieved top {Math.Min(topCount.Value, totalCount)} heaviest functions (from {totalCount} total), sorted by {sortMetric} percentage\";\n        }\n        else\n        {\n            return $\"Successfully retrieved {totalCount} functions from currently loaded profile, sorted by {sortMetric} percentage\";\n        }\n    }\n\n    private static string GetFunctionFilterInstruction(bool sortBySelfTime)\n    {\n        var sortMetric = sortBySelfTime ? \"self time\" : \"total time\";\n        var explanation = sortBySelfTime \n            ? \"Self time excludes time spent in called functions and shows functions doing actual work.\" \n            : \"Total time includes time spent in called functions and shows the overall impact.\";\n        \n        return $\"Functions are sorted by {sortMetric} percentage (highest first). {explanation} Use the function name or full name with GetFunctionAssembly to retrieve assembly code for a specific function.\";\n    }\n\n    #endregion\n\n    #region Get Available Binaries Tool\n\n    [McpServerTool, Description(\"Get the list of available binaries/DLLs from the currently loaded process/trace\")]\n    public static async Task<string> GetAvailableBinaries(\n        [Description(\"Minimum time percentage threshold to filter binaries (e.g. 0.01 for binaries contributing >=0.01% time).\")]\n        double? minTimePercentage = null,\n        [Description(\"Minimum absolute time threshold to filter binaries (e.g. 500 for binaries with >=500ms runtime). Specify time in milliseconds.\")]\n        double? minTimeMs = null,\n        [Description(\"Limit results to top N binaries by performance (e.g. 10 for top 10 most time-consuming binaries).\")]\n        int? topCount = null)\n    {\n        try\n        {\n            if (_executor == null)\n            {\n                throw new InvalidOperationException(\"MCP action executor is not initialized\");\n            }\n\n            // Convert minTimeMs to TimeSpan if provided\n            TimeSpan? minTime = minTimeMs.HasValue ? TimeSpan.FromMilliseconds(minTimeMs.Value) : null;\n            \n            GetAvailableBinariesResult result = await _executor.GetAvailableBinariesAsync(minTimePercentage, minTime, topCount);\n            \n            if (result.Success)\n            {\n                // Generate suggested usage based on the parameters and results\n                string? suggestedUsage = null;\n                if (result.Binaries.Length > 50)\n                {\n                    suggestedUsage = \"Large result set detected. Consider using minTimePercentage or minTimeMs parameters to focus on binaries with significant time usage, or topCount to limit results.\";\n                }\n                else if (!minTimePercentage.HasValue && !minTimeMs.HasValue && !topCount.HasValue)\n                {\n                    suggestedUsage = \"For more focused analysis, consider using minTimePercentage (e.g., 0.05 for >=0.05%) or minTimeMs (e.g., 500 for >=500ms) to filter out low-impact binaries, or topCount to show only the most time-consuming binaries.\";\n                }\n\n                var successResult = new\n                {\n                    Action = \"GetAvailableBinaries\",\n                    Status = \"Success\",\n                    MinTimePercentage = Math.Round(minTimePercentage ?? 0, 2),\n                    MinTimeMs = minTimeMs,\n                    TopCount = topCount,\n                    Description = GetBinaryFilterDescription(minTimePercentage, minTimeMs, topCount, result.Binaries.Length),\n                    Instruction = \"These are the binaries/DLLs containing functions in the currently loaded process. This shows aggregated time consumption per binary. Use GetAvailableFunctions(moduleName: '<binary_name>') to get functions from a specific binary.\",\n                    SuggestedUsage = suggestedUsage,\n                    TotalBinaryCount = result.Binaries.Length,\n                    FilteredBinaryCount = result.Binaries.Length,\n                    Binaries = result.Binaries.Select(b => new {\n                        Name = b.Name,\n                        FullPath = b.FullPath,\n                        TimePercentage = Math.Round(b.TimePercentage, 2),\n                        Time = b.Time.ToString()\n                    }).ToArray(),\n                    Timestamp = DateTime.UtcNow\n                };\n                return System.Text.Json.JsonSerializer.Serialize(successResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n            else\n            {\n                var failureResult = new\n                {\n                    Action = \"GetAvailableBinaries\",\n                    Status = \"Failed\",\n                    Description = result.ErrorMessage ?? \"Failed to retrieve binaries from currently loaded profile\",\n                    Timestamp = DateTime.UtcNow\n                };\n                return System.Text.Json.JsonSerializer.Serialize(failureResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n        }\n        catch (Exception ex)\n        {\n            var errorResult = new\n            {\n                Action = \"GetAvailableBinaries\",\n                Status = \"Error\",\n                Error = ex.Message,\n                Timestamp = DateTime.UtcNow\n            };\n\n            return System.Text.Json.JsonSerializer.Serialize(errorResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n    }\n\n    private static string GetBinaryFilterDescription(double? minTimePercentage, double? minTimeMs, int? topCount, int totalCount)\n    {\n        var filterParts = new List<string>();\n        \n        if (minTimePercentage.HasValue)\n        {\n            filterParts.Add($\"time >= {minTimePercentage}%\");\n        }\n        \n        if (minTimeMs.HasValue)\n        {\n            filterParts.Add($\"time >= {minTimeMs}ms\");\n        }\n        \n        if (topCount.HasValue && filterParts.Any())\n        {\n            return $\"Successfully retrieved top {topCount} binaries (from {totalCount} total) with {string.Join(\" and \", filterParts)}, sorted by time percentage\";\n        }\n        else if (filterParts.Any())\n        {\n            return $\"Successfully retrieved {totalCount} binaries with {string.Join(\" and \", filterParts)}, sorted by time percentage\";\n        }\n        else if (topCount.HasValue)\n        {\n            return $\"Successfully retrieved top {Math.Min(topCount.Value, totalCount)} most time-consuming binaries (from {totalCount} total), sorted by time percentage\";\n        }\n        else\n        {\n            return $\"Successfully retrieved {totalCount} binaries from currently loaded profile, sorted by time percentage\";\n        }\n    }\n\n    #endregion\n\n    #region Function Assembly Tool\n\n    [McpServerTool, Description(\"Get assembly code for a specific function by double-clicking on it in the Summary pane, and save it to a file for later contextual reference by Copilot\")]\n    public static async Task<string> GetFunctionAssembly(string functionName)\n    {\n        if (string.IsNullOrWhiteSpace(functionName))\n            throw new ArgumentException(\"Function name cannot be empty\", nameof(functionName));\n\n        try\n        {\n            if (_executor == null)\n            {\n                throw new InvalidOperationException(\"MCP action executor is not initialized\");\n            }\n\n            string? filePath = await _executor.GetFunctionAssemblyToFileAsync(functionName);\n\n            if (string.IsNullOrEmpty(filePath))\n            {\n                var notFoundResult = new\n                {\n                    Action = \"GetFunctionAssembly\",\n                    FunctionName = functionName,\n                    Status = \"NotFound\",\n                    Description = \"Function not found in the current summary or assembly could not be retrieved\",\n                    Timestamp = DateTime.UtcNow\n                };\n                return System.Text.Json.JsonSerializer.Serialize(notFoundResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n            }\n\n            // Read the assembly content from the file to include in the response\n            string assemblyContent = \"\";\n            try\n            {\n                if (System.IO.File.Exists(filePath))\n                {\n                    assemblyContent = await System.IO.File.ReadAllTextAsync(filePath);\n                }\n            }\n            catch (Exception ex)\n            {\n                // If we can't read the file, log the error and just return the path without content\n                Console.Error.WriteLine($\"Failed to read assembly file '{filePath}' for function '{functionName}': {ex.Message}\");\n            }\n\n            var result = new\n            {\n                Action = \"GetFunctionAssembly\",\n                FunctionName = functionName,\n                Status = \"Success\",\n                FilePath = filePath,\n                Assembly = assemblyContent,\n                Description = $\"Successfully retrieved assembly code for the function and saved to {filePath}\",\n                Timestamp = DateTime.UtcNow\n            };\n\n            return System.Text.Json.JsonSerializer.Serialize(result, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n        catch (Exception ex)\n        {\n            var errorResult = new\n            {\n                Action = \"GetFunctionAssembly\",\n                FunctionName = functionName,\n                Status = \"Error\",\n                Error = ex.Message,\n                Timestamp = DateTime.UtcNow\n            };\n\n            return System.Text.Json.JsonSerializer.Serialize(errorResult, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n        }\n    }\n\n    #endregion\n\n    #region Help Tool\n\n    [McpServerTool, Description(\"Get help information about available MCP commands\")]\n    public static string GetHelp()\n    {\n        var helpInfo = new\n        {\n            ServerName = \"Profile Explorer MCP Server\",\n            Version = \"1.0.0\",\n            Description = \"Simplified MCP server for Profile Explorer - opens and loads traces and retrieves function assembly\",\n            QuickStartPatterns = new[]\n            {\n                \"1. To analyze functions from a specific module: GetAvailableFunctions(moduleName: 'ntdll.dll')\",\n                \"2. To find hotspots in a specific module: GetAvailableFunctions(moduleName: 'kernel32.dll', topCount: 10)\",\n                \"3. To analyze CPU-intensive functions: GetAvailableFunctions(minSelfTimePercentage: 0.1)\",\n                \"4. Common mistake: Do NOT call GetAvailableFunctions() without moduleName when you want module-specific results!\"\n            },\n            AvailableCommands = new[]\n            {\n                new { \n                    Name = \"GetAvailableProcesses\", \n                    Description = \"Get the list of available processes from a trace file with optional weight filtering and top N limiting\", \n                    Parameters = \"profileFilePath (string) - Path to the ETL trace file to analyze for available processes, minWeightPercentage (double, optional) - Minimum weight percentage to filter processes (e.g., 1.0 for processes with >= 1% weight), topCount (int, optional) - Limit results to top N heaviest processes (e.g., 10 for top 10 heaviest processes)\"\n                },\n                new { \n                    Name = \"OpenTrace\", \n                    Description = \"Open and load a trace file with a specific process by name or ID. For ambiguous queries, uses LLM world knowledge to help identify the correct process\", \n                    Parameters = \"profileFilePath (string) - Path to the ETL trace file to open, processNameOrId (string) - Process name (e.g., 'chrome.exe', 'POWERPNT'), category (e.g., 'defender', 'performance recorder'), or process ID (e.g., '1234')\"\n                },\n                new { \n                    Name = \"GetAvailableFunctions\", \n                    Description = \"Get the list of available functions from the currently loaded process/trace. This should be called after a process is loaded via OpenTrace. Returns both self time (CPU-intensive functions) and total time (high-impact functions including callees). Supports filtering by module name, performance thresholds, result limits, and sorting preferences for targeted performance analysis.\", \n                    Parameters = \"moduleName (string, optional) - **CRITICAL: Filter functions by specific module/DLL name (e.g., 'ntdll.dll', 'kernel32.dll', 'ntdll' - supports partial matching). USE THIS FIRST when you want functions from a specific module!**, minSelfTimePercentage (double, optional) - Minimum self time percentage to filter functions (e.g., 0.1 for functions with >= 0.1% self time; use for finding CPU-intensive functions), minTotalTimePercentage (double, optional) - Minimum total time percentage to filter functions (e.g., 0.5 for functions with >= 0.5% total time; use for finding functions with high overall impact), topCount (int, optional) - Limit results to top N heaviest functions (e.g., 10 for top 10 functions; useful for focusing on worst performers), sortBySelfTime (bool, optional, default true) - Sort by self time (true, shows functions doing actual work) or total time (false, shows functions with highest overall impact including called functions)\"\n                },\n                new { \n                    Name = \"GetAvailableBinaries\", \n                    Description = \"Get the list of available binaries/DLLs from the currently loaded process/trace. This should be called after a process is loaded via OpenTrace. Returns aggregated performance data for each binary that contains functions with performance data.\", \n                    Parameters = \"minTimePercentage (double, optional) - Minimum time percentage threshold to filter binaries (e.g., 0.01 for binaries contributing >=0.01% time), topCount (int, optional) - Limit results to top N binaries by performance (e.g., 10 for top 10 most time-consuming binaries)\"\n                },\n                new { \n                    Name = \"GetFunctionAssembly\", \n                    Description = \"Get assembly code for a specific function by double-clicking on it in the Summary pane, and save it to a file for later contextual reference by Copilot\",\n                    Parameters = \"functionName (string) - Name of the function to retrieve assembly for (supports partial matching)\"\n                },\n                new { \n                    Name = \"GetHelp\", \n                    Description = \"Get help information about available MCP commands\", \n                    Parameters = \"none\" \n                }\n            },\n            Examples = new object[]\n            {\n                new\n                {\n                    Description = \"Get list of all available processes in a trace file\",\n                    Command = \"GetAvailableProcesses\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\"\n                    }\n                },\n                new\n                {\n                    Description = \"Get list of processes with significant CPU usage (>= 1%)\",\n                    Command = \"GetAvailableProcesses\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        minWeightPercentage = 1.0\n                    }\n                },\n                new\n                {\n                    Description = \"Get list of processes with very high CPU usage (>= 5%)\",\n                    Command = \"GetAvailableProcesses\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        minWeightPercentage = 5.0\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 10 heaviest processes by CPU usage\",\n                    Command = \"GetAvailableProcesses\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        topCount = 10\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 5 heaviest processes with at least 1% CPU usage\",\n                    Command = \"GetAvailableProcesses\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        minWeightPercentage = 1.0,\n                        topCount = 5\n                    }\n                },\n                new\n                {\n                    Description = \"Load a trace file and select a specific process by ID\",\n                    Command = \"OpenTrace\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        processNameOrId = \"1234\"\n                    }\n                },\n                new\n                {\n                    Description = \"Load a trace file with an exact process name\",\n                    Command = \"OpenTrace\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        processNameOrId = \"POWERPNT\"\n                    }\n                },\n                new\n                {\n                    Description = \"Load a trace file with an ambiguous query (will trigger LLM analysis)\",\n                    Command = \"OpenTrace\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        processNameOrId = \"defender\"\n                    }\n                },\n                new\n                {\n                    Description = \"Load a trace file using semantic description (will trigger LLM analysis)\",\n                    Command = \"OpenTrace\",\n                    Parameters = new {\n                        profileFilePath = @\"C:\\traces\\sample.etl\",\n                        processNameOrId = \"performance recorder\"\n                    }\n                },\n                new\n                {\n                    Description = \"Get functions from ntdll.dll only\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        moduleName = \"ntdll.dll\"\n                    }\n                },\n                new\n                {\n                    Description = \"Get functions from kernel32.dll only\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        moduleName = \"kernel32.dll\"\n                    }\n                },\n                new\n                {\n                    Description = \"Get list of all available functions in the currently loaded profile\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new { }\n                },\n                new\n                {\n                    Description = \"Get list of functions with significant self time (>= 0.1%)\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        minSelfTimePercentage = 0.1\n                    }\n                },\n                new\n                {\n                    Description = \"Get list of functions with high total time impact (>= 0.5%)\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        minTotalTimePercentage = 0.5\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 5 CPU-intensive functions (by self time)\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        topCount = 5,\n                        sortBySelfTime = true\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 5 highest-impact functions (by total time)\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        topCount = 5,\n                        sortBySelfTime = false\n                    }\n                },\n                new\n                {\n                    Description = \"Find performance bottlenecks: functions with >= 0.2% self time AND >= 1% total time\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        minSelfTimePercentage = 0.2,\n                        minTotalTimePercentage = 1.0\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 3 hotspots in ntdll.dll (combined module and count filtering)\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        moduleName = \"ntdll.dll\",\n                        topCount = 3,\n                        sortBySelfTime = true\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 5 functions from kernel32.dll by self time\",\n                    Command = \"GetAvailableFunctions\",\n                    Parameters = new {\n                        moduleName = \"kernel32.dll\",\n                        topCount = 5,\n                        sortBySelfTime = true\n                    }\n                },\n                new\n                {\n                    Description = \"Get list of all available binaries/DLLs in the currently loaded profile\",\n                    Command = \"GetAvailableBinaries\",\n                    Parameters = new { }\n                },\n                new\n                {\n                    Description = \"Get list of binaries contributing at least 0.05% time\",\n                    Command = \"GetAvailableBinaries\",\n                    Parameters = new {\n                        minTimePercentage = 0.05\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 10 most time-consuming binaries\",\n                    Command = \"GetAvailableBinaries\",\n                    Parameters = new {\n                        topCount = 10\n                    }\n                },\n                new\n                {\n                    Description = \"Get top 5 binaries with significant time impact (combined filtering)\",\n                    Command = \"GetAvailableBinaries\",\n                    Parameters = new {\n                        minTimePercentage = 0.1,\n                        topCount = 5\n                    }\n                },\n                new\n                {\n                    Description = \"Get assembly code for a function and save to file\",\n                    Command = \"GetFunctionAssembly\",\n                    Parameters = new {\n                        functionName = \"main\"\n                    }\n                }\n            },\n            Timestamp = DateTime.UtcNow\n        };\n\n        return System.Text.Json.JsonSerializer.Serialize(helpInfo, new System.Text.Json.JsonSerializerOptions { WriteIndented = true });\n    }\n\n    #endregion\n}\n\n"
  },
  {
    "path": "src/ProfileExplorer.Mcp/Program.cs",
    "content": "using System;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Mcp;\n\nnamespace ProfileExplorer.Mcp;\n\n/// <summary>\n/// Standalone entry point for the Profile Explorer MCP Server\n/// This can be used for testing or running the server independently\n/// </summary>\npublic class Program\n{\n    public static async Task Main(string[] args)\n    {\n        Console.WriteLine(\"Starting Profile Explorer MCP Server...\");\n        \n        try\n        {\n            // Start the server with a mock executor for testing\n            await McpServerConfiguration.StartServerWithMockExecutorAsync();\n        }\n        catch (Exception ex)\n        {\n            Console.WriteLine($\"Error starting MCP server: {ex.Message}\");\n            Environment.Exit(1);\n        }\n    }\n}\n\n/// <summary>\n/// Mock implementation of IMcpActionExecutor for testing purposes\n/// Provides mock responses for all MCP tools to enable standalone testing\n/// </summary>\npublic class MockMcpActionExecutor : IMcpActionExecutor {\n    public Task<OpenTraceResult> OpenTraceAsync(string profileFilePath, string processIdentifier) {\n        Console.WriteLine($\"Mock: OpenTraceAsync called with process identifier: {processIdentifier}\");\n        return Task.FromResult(new OpenTraceResult { Success = true });\n    }\n\n    public Task<ProfilerStatus> GetStatusAsync()\n    {\n        Console.WriteLine(\"Mock: GetStatus called\");\n        return Task.FromResult(new ProfilerStatus\n        {\n            IsProfileLoaded = true,\n            CurrentProfilePath = \"/mock/path/to/profile.etl\",\n            LoadedProcesses = new[] { 1234, 5678 },\n            ActiveFilters = new[] { \"function:main\", \"module:test\" },\n            LastUpdated = DateTime.UtcNow\n        });\n    }\n\n    public Task<string> GetFunctionAssemblyAsync(string functionName) {\n        Console.WriteLine($\"Mock: GetFunctionAssemblyAsync called with functionName: {functionName}\");\n        return Task.FromResult($@\"Mock assembly for function {functionName}:\nmain:\npush rbp\nmov rbp, rsp\nsub rsp, 0x10\ncall sub_401000\nmov eax, 0\nadd rsp, 0x10\npop rbp\nret\");\n    }\n    \n    public Task<string?> GetFunctionAssemblyToFileAsync(string functionName)\n    {\n        Console.WriteLine($\"Mock: GetFunctionAssemblyToFileAsync called with functionName: {functionName}\");\n        \n        try\n        {\n            // Create the assembly content\n            string assemblyContent = $@\"Mock assembly for function {functionName}:\nmain:\npush rbp\nmov rbp, rsp\nsub rsp, 0x10\ncall sub_401000\nmov eax, 0\nadd rsp, 0x10\npop rbp\nret\";\n\n            // Create the tmp directory path (same logic as real implementation)\n            string currentDirectory = Directory.GetCurrentDirectory();\n            string srcPath = Path.GetFullPath(Path.Combine(currentDirectory, \"..\", \"..\", \"src\"));\n            string tmpDirectory = Path.Combine(srcPath, \"tmp\");\n            \n            // Ensure the tmp directory exists\n            Directory.CreateDirectory(tmpDirectory);\n            \n            // Sanitize the function name for file system compatibility\n            string sanitizedFunctionName = SanitizeFileName(functionName);\n            \n            // Create the file name (using \"mock-process\" as process name)\n            string fileName = $\"mock-process-{sanitizedFunctionName}.asm\";\n            string filePath = Path.Combine(tmpDirectory, fileName);\n            \n            // Write the assembly content to the file\n            File.WriteAllText(filePath, assemblyContent);\n            \n            Console.WriteLine($\"Mock: Assembly written to {filePath}\");\n            return Task.FromResult<string?>(filePath);\n        }\n        catch (Exception ex)\n        {\n            Console.WriteLine($\"Mock: Error writing assembly file: {ex.Message}\");\n            return Task.FromResult<string?>(null);\n        }\n    }\n    \n    /// <summary>\n    /// Sanitize a string to be safe for use as a file name (for mock implementation)\n    /// </summary>\n    private static string SanitizeFileName(string fileName)\n    {\n        if (string.IsNullOrWhiteSpace(fileName))\n            return \"unknown\";\n            \n        // Remove or replace invalid file name characters\n        char[] invalidChars = Path.GetInvalidFileNameChars();\n        string sanitized = fileName;\n        \n        foreach (char invalidChar in invalidChars)\n        {\n            sanitized = sanitized.Replace(invalidChar, '_');\n        }\n        \n        // Also replace some common problematic characters\n        sanitized = sanitized.Replace(':', '_')\n                                .Replace('<', '_')\n                                .Replace('>', '_')\n                                .Replace('*', '_')\n                                .Replace('?', '_')\n                                .Replace('|', '_')\n                                .Replace('\"', '_');\n        \n        // Limit length to avoid very long file names\n        if (sanitized.Length > 100)\n        {\n            sanitized = sanitized.Substring(0, 100);\n        }\n        \n        return sanitized;\n    }\n\n    public Task<GetAvailableProcessesResult> GetAvailableProcessesAsync(string profileFilePath, double? minWeightPercentage = null, int? topCount = null)\n    {\n        Console.WriteLine($\"Mock: GetAvailableProcessesAsync called with profileFilePath: {profileFilePath}, minWeightPercentage: {minWeightPercentage}, topCount: {topCount}\");\n        \n        // Return mock process list with weight percentages\n        var mockProcesses = new ProcessInfo[]\n        {\n            new ProcessInfo\n            {\n                ProcessId = 1234,\n                Name = \"chrome\",\n                ImageFileName = \"C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\",\n                CommandLine = \"\\\"C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\\\" --type=browser\",\n                WeightPercentage = 25.5,\n                Weight = TimeSpan.FromSeconds(10.2),\n                Duration = TimeSpan.FromSeconds(30)\n            },\n            new ProcessInfo\n            {\n                ProcessId = 5678,\n                Name = \"notepad\",\n                ImageFileName = \"C:\\\\Windows\\\\System32\\\\notepad.exe\",\n                CommandLine = \"notepad.exe sample.txt\",\n                WeightPercentage = 5.3,\n                Weight = TimeSpan.FromSeconds(2.1),\n                Duration = TimeSpan.FromSeconds(30)\n            },\n            new ProcessInfo\n            {\n                ProcessId = 9999,\n                Name = \"MyApp\",\n                ImageFileName = \"C:\\\\MyApp\\\\MyApp.exe\",\n                CommandLine = \"MyApp.exe --debug --verbose\",\n                WeightPercentage = 0.8,\n                Weight = TimeSpan.FromSeconds(0.3),\n                Duration = TimeSpan.FromSeconds(30)\n            }\n        };\n\n        // Apply weight filtering if specified\n        var filteredProcesses = mockProcesses;\n        if (minWeightPercentage.HasValue)\n        {\n            filteredProcesses = mockProcesses\n                .Where(p => p.WeightPercentage >= minWeightPercentage.Value)\n                .ToArray();\n        }\n        \n        // Apply top N filtering if specified\n        if (topCount.HasValue)\n        {\n            // Sort by weight percentage descending and take top N\n            filteredProcesses = filteredProcesses\n                .OrderByDescending(p => p.WeightPercentage)\n                .Take(topCount.Value)\n                .ToArray();\n        }\n\n        return Task.FromResult(new GetAvailableProcessesResult\n        {\n            Success = true,\n            Processes = filteredProcesses\n        });\n    }\n\n    public Task<GetAvailableFunctionsResult> GetAvailableFunctionsAsync(FunctionFilter? filter = null)\n    {\n        filter ??= new FunctionFilter();\n        Console.WriteLine($\"Mock: GetAvailableFunctionsAsync called with filter - ModuleName: {filter.ModuleName}, MinSelfTimePercentage: {filter.MinSelfTimePercentage}, MinTotalTimePercentage: {filter.MinTotalTimePercentage}, TopCount: {filter.TopCount}, SortBySelfTime: {filter.SortBySelfTime}\");\n        \n        // Return mock function list with weight percentages\n        var mockFunctions = new FunctionInfo[]\n        {\n            new FunctionInfo\n            {\n                Name = \"main\",\n                FullName = \"main\",\n                ModuleName = \"MyApp.exe\",\n                SelfTimePercentage = 45.2,\n                TotalTimePercentage = 68.5,\n                SelfTime = TimeSpan.FromSeconds(18.1),\n                TotalTime = TimeSpan.FromSeconds(27.4),\n                SourceFile = \"C:\\\\source\\\\main.cpp\",\n                HasAssembly = true\n            },\n            new FunctionInfo\n            {\n                Name = \"ProcessData\",\n                FullName = \"MyNamespace::ProcessData(int, char*)\",\n                ModuleName = \"MyApp.exe\",\n                SelfTimePercentage = 22.7,\n                TotalTimePercentage = 35.2,\n                SelfTime = TimeSpan.FromSeconds(9.1),\n                TotalTime = TimeSpan.FromSeconds(14.1),\n                SourceFile = \"C:\\\\source\\\\processor.cpp\",\n                HasAssembly = true\n            },\n            new FunctionInfo\n            {\n                Name = \"AllocateMemory\",\n                FullName = \"MemoryManager::AllocateMemory(size_t)\",\n                ModuleName = \"MyApp.exe\",\n                SelfTimePercentage = 15.3,\n                TotalTimePercentage = 15.3,\n                SelfTime = TimeSpan.FromSeconds(6.1),\n                TotalTime = TimeSpan.FromSeconds(6.1),\n                SourceFile = \"C:\\\\source\\\\memory.cpp\",\n                HasAssembly = true\n            },\n            new FunctionInfo\n            {\n                Name = \"StringCompare\",\n                FullName = \"std::basic_string<char>::compare\",\n                ModuleName = \"MSVCP140.dll\",\n                SelfTimePercentage = 8.9,\n                TotalTimePercentage = 8.9,\n                SelfTime = TimeSpan.FromSeconds(3.6),\n                TotalTime = TimeSpan.FromSeconds(3.6),\n                SourceFile = null,\n                HasAssembly = true\n            },\n            new FunctionInfo\n            {\n                Name = \"NtAllocateVirtualMemory\",\n                FullName = \"NtAllocateVirtualMemory\",\n                ModuleName = \"ntdll.dll\",\n                SelfTimePercentage = 6.2,\n                TotalTimePercentage = 6.2,\n                SelfTime = TimeSpan.FromSeconds(2.5),\n                TotalTime = TimeSpan.FromSeconds(2.5),\n                SourceFile = null,\n                HasAssembly = true\n            },\n            new FunctionInfo\n            {\n                Name = \"RtlAllocateHeap\",\n                FullName = \"RtlAllocateHeap\",\n                ModuleName = \"ntdll.dll\",\n                SelfTimePercentage = 4.1,\n                TotalTimePercentage = 4.1,\n                SelfTime = TimeSpan.FromSeconds(1.6),\n                TotalTime = TimeSpan.FromSeconds(1.6),\n                SourceFile = null,\n                HasAssembly = true\n            },\n            new FunctionInfo\n            {\n                Name = \"Helper\",\n                FullName = \"Utils::Helper()\",\n                ModuleName = \"MyApp.exe\",\n                SelfTimePercentage = 0.5,\n                TotalTimePercentage = 2.1,\n                SelfTime = TimeSpan.FromSeconds(0.2),\n                TotalTime = TimeSpan.FromSeconds(0.8),\n                SourceFile = \"C:\\\\source\\\\utils.cpp\",\n                HasAssembly = true\n            }\n        };\n\n        // Apply module filtering if specified\n        var filteredFunctions = mockFunctions;\n        if (!string.IsNullOrWhiteSpace(filter.ModuleName))\n        {\n            filteredFunctions = filteredFunctions\n                .Where(f => !string.IsNullOrEmpty(f.ModuleName) && \n                           f.ModuleName.Contains(filter.ModuleName, StringComparison.OrdinalIgnoreCase))\n                .ToArray();\n        }\n        \n        // Apply self time filtering if specified\n        if (filter.MinSelfTimePercentage.HasValue)\n        {\n            filteredFunctions = filteredFunctions\n                .Where(f => f.SelfTimePercentage >= filter.MinSelfTimePercentage.Value)\n                .ToArray();\n        }\n        \n        // Apply total time filtering if specified\n        if (filter.MinTotalTimePercentage.HasValue)\n        {\n            filteredFunctions = filteredFunctions\n                .Where(f => f.TotalTimePercentage >= filter.MinTotalTimePercentage.Value)\n                .ToArray();\n        }\n        \n        // Apply top N filtering if specified\n        if (filter.TopCount.HasValue)\n        {\n            // Sort by the chosen metric and take top N\n            filteredFunctions = filter.SortBySelfTime\n                ? filteredFunctions.OrderByDescending(f => f.SelfTimePercentage).Take(filter.TopCount.Value).ToArray()\n                : filteredFunctions.OrderByDescending(f => f.TotalTimePercentage).Take(filter.TopCount.Value).ToArray();\n        }\n        else\n        {\n            // If no topCount specified, still sort the results\n            filteredFunctions = filter.SortBySelfTime\n                ? filteredFunctions.OrderByDescending(f => f.SelfTimePercentage).ToArray()\n                : filteredFunctions.OrderByDescending(f => f.TotalTimePercentage).ToArray();\n        }\n\n        return Task.FromResult(new GetAvailableFunctionsResult\n        {\n            Success = true,\n            Functions = filteredFunctions\n        });\n    }\n\n    public Task<GetAvailableBinariesResult> GetAvailableBinariesAsync(double? minTimePercentage = null, TimeSpan? minTime = null, int? topCount = null)\n    {\n        Console.WriteLine($\"Mock: GetAvailableBinariesAsync called with minTimePercentage: {minTimePercentage}, minTime: {minTime}, topCount: {topCount}\");\n        \n        // Return mock binary list - just the unique binary names from the functions\n        var mockBinaries = new BinaryInfo[]\n        {\n            new BinaryInfo\n            {\n                Name = \"MyApp.exe\",\n                FullPath = \"C:\\\\MyApp\\\\MyApp.exe\",\n                TimePercentage = 83.7, // sum of main, ProcessData, AllocateMemory, Helper self time percentages\n                Time = TimeSpan.FromSeconds(33.5)\n            },\n            new BinaryInfo\n            {\n                Name = \"ntdll.dll\",\n                FullPath = \"C:\\\\Windows\\\\System32\\\\ntdll.dll\",\n                TimePercentage = 10.3, // sum of NtAllocateVirtualMemory, RtlAllocateHeap self time percentages\n                Time = TimeSpan.FromSeconds(4.1)\n            },\n            new BinaryInfo\n            {\n                Name = \"MSVCP140.dll\",\n                FullPath = \"C:\\\\Windows\\\\System32\\\\MSVCP140.dll\",\n                TimePercentage = 8.9, // StringCompare self time percentage\n                Time = TimeSpan.FromSeconds(3.6)\n            },\n            new BinaryInfo\n            {\n                Name = \"kernel32.dll\",\n                FullPath = \"C:\\\\Windows\\\\System32\\\\kernel32.dll\",\n                TimePercentage = 0,\n                Time = TimeSpan.Zero\n            }\n        };\n\n        // Apply filtering\n        var filteredBinaries = mockBinaries;\n        \n        if (minTimePercentage.HasValue)\n        {\n            filteredBinaries = filteredBinaries\n                .Where(b => b.TimePercentage >= minTimePercentage.Value)\n                .ToArray();\n        }\n        \n        if (minTime.HasValue)\n        {\n            filteredBinaries = filteredBinaries\n                .Where(b => b.Time >= minTime.Value)\n                .ToArray();\n        }\n        \n        // Sort by time percentage descending\n        filteredBinaries = filteredBinaries\n            .OrderByDescending(b => b.TimePercentage)\n            .ToArray();\n\n        // Apply top count filtering if specified\n        if (topCount.HasValue)\n        {\n            filteredBinaries = filteredBinaries\n                .Take(topCount.Value)\n                .ToArray();\n        }\n\n        return Task.FromResult(new GetAvailableBinariesResult\n        {\n            Success = true,\n            Binaries = filteredBinaries\n        });\n    }\n}\n"
  },
  {
    "path": "src/ProfileExplorer.Mcp/README.md",
    "content": "# ProfileExplorer.Mcp\n\nModel Context Protocol (MCP) server enabling AI agents to interact with Profile Explorer.\n\n## Overview\n\nThis project provides an MCP server that enables AI agent interactions with Profile Explorer. It allows users to perform profiling tasks through conversational AI by exposing Profile Explorer's core functionality as MCP tools. Users can ask questions like \"load the Chrome process from this trace file\" or \"show me the slowest functions in ntdll.dll\" and have them executed directly.\n\n## Architecture\n\nThe project consists of:\n\n- **ProfileExplorerMcpServer**: Main server class that handles MCP protocol communication\n- **ProfileExplorerTools**: Static class containing MCP tool implementations\n- **IMcpActionExecutor**: Interface for UI action execution (implemented by the UI project)\n- **ProfilerStatus**: Data model for UI status information\n- **McpServerConfiguration**: Helper for server initialization\n- **MockMcpActionExecutor**: Mock implementation for testing\n\n## Available MCP Tools\n\nThe server provides several MCP tools that enable AI agent profiling workflows:\n\n### Core Profiling Operations\n- `OpenTrace(profileFilePath, processNameOrId)` - Load a trace file and process based on agent-friendly descriptions (e.g., \"Chrome\", \"the main app process\", \"PID 1234\")\n- `GetAvailableProcesses(profileFilePath, minWeightPercentage?, topCount?)` - Discover what processes are available in a trace file\n- `GetAvailableFunctions(moduleName?, minSelfTimePercentage?, minTotalTimePercentage?, topCount?, sortBySelfTime?)` - Find functions based on agent queries like \"hottest functions in kernel32\" or \"CPU-intensive functions\"\n- `GetAvailableBinaries(minTimePercentage?, minTimeMs?, topCount?)` - Identify which binaries/DLLs are consuming the most time\n\n### Analysis and Deep Dive\n- `GetFunctionAssembly(functionName)` - Retrieve assembly code for detailed function analysis\n- `GetHelp()` - Get information about available capabilities\n\n## AI Agent Workflow Examples\n\nInstead of manually navigating UI menus and dialogs, users can accomplish profiling tasks through AI agent conversation:\n\n**Example 1: Performance Investigation**\n- User: \"I have high CPU usage, can you help me analyze trace.etl?\"\n- AI: Uses `GetAvailableProcesses` → `OpenTrace` → `GetAvailableFunctions` to identify hotspots\n- User: \"What's consuming the most time in the kernel?\"  \n- AI: Uses `GetAvailableFunctions(moduleName: \"ntdll.dll\", topCount: 10)` to show kernel bottlenecks\n\n**Example 2: Specific Function Analysis**\n- User: \"Show me the assembly for the NtReadFile function\"\n- AI: Uses `GetFunctionAssembly(\"NtReadFile\")` to retrieve and display the code\n\n**Example 3: Process Discovery** \n- User: \"What processes were active during this trace?\"\n- AI: Uses `GetAvailableProcesses` to show all processes with their CPU usage percentages\n\n## Usage\n\n### Standalone Testing\n```bash\ncd src/ProfileExplorer.Mcp\ndotnet run\n```\n\n### Integration with AI Assistants\nThe UI project should:\n1. Implement `IMcpActionExecutor` interface to bridge MCP calls to Profile Explorer functionality\n2. Initialize the server using `McpServerConfiguration.StartServerWithExecutorAsync(executor)` in `App.OnStartup`\n\nOnce integrated, users can interact with Profile Explorer through AI agents via AI assistants that support MCP.\n\n## Implementation Notes\n\n- All tool methods return JSON-serialized responses optimized for AI interpretation\n- The server handles ambiguous agent queries (e.g., \"Chrome process\" maps to appropriate process selection)\n- Error handling provides human-readable messages that AI assistants can relay to users\n- The server uses stdio transport for MCP communication with AI systems\n- UI thread marshaling should be handled by the executor implementation\n\n\nFor detailed implementation guidance, see the `IMcpActionExecutor` interface and `ProfileExplorerMcpServer` class.\n"
  },
  {
    "path": "src/ProfileExplorer.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.0.31612.314\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"ProfileExplorerUI\", \"ProfileExplorerUI\\ProfileExplorerUI.csproj\", \"{23169CA2-2157-4978-A8AF-CF360540F467}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Clients\", \"Clients\", \"{11DEE166-9224-42F9-92C6-A6447A90C31B}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"External\", \"External\", \"{9A2F89BD-58B1-4E31-A0CF-F4D3AFB3F02B}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"ProfileExplorerCore\", \"ProfileExplorerCore\\ProfileExplorerCore.csproj\", \"{F73AD42A-5BD3-45B7-B915-7584F4588F55}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"VSExtension\", \"VSExtension\\VSExtension.csproj\", \"{DF5E31FD-A162-4053-B7C6-50C196CF60E3}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"ProfileExplorerCoreTests\", \"ProfileExplorerCoreTests\\ProfileExplorerCoreTests.csproj\", \"{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"ManagedProfiler\", \"ManagedProfiler\\ManagedProfiler.vcxproj\", \"{08DED710-2048-45C3-90F9-0D585263796D}\"\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"TreeListView\", \"external\\TreeListView\\TreeListView.csproj\", \"{05BD7808-EE6F-4139-903C-758A97B122A9}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"ProfileExplorerUITests\", \"ProfileExplorerUITests\\ProfileExplorerUITests.csproj\", \"{8449AD82-6B34-4635-A502-7FA26DDF1BAF}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"GrpcLib\", \"GrpcLib\\GrpcLib.csproj\", \"{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"PDBViewer\", \"PDBViewer\\PDBViewer.csproj\", \"{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}\"\n\tProjectSection(ProjectDependencies) = postProject\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55} = {F73AD42A-5BD3-45B7-B915-7584F4588F55}\n\tEndProjectSection\nEndProject\nProject(\"{9A19103F-16F7-4668-BE54-9A1E7A4F7556}\") = \"ProfileExplorer.Mcp\", \"ProfileExplorer.Mcp\\ProfileExplorer.Mcp.csproj\", \"{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|ARM64 = Debug|ARM64\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|ARM64 = Release|ARM64\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|ARM64.ActiveCfg = Release|ARM64\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|ARM64.Build.0 = Release|ARM64\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|x64.Build.0 = Release|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467}.Release|x86.Build.0 = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|x64.Build.0 = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{F73AD42A-5BD3-45B7-B915-7584F4588F55}.Release|x86.Build.0 = Release|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|x86.ActiveCfg = Debug|x86\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Debug|x86.Build.0 = Debug|x86\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|x64.Build.0 = Release|Any CPU\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|x86.ActiveCfg = Release|x86\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3}.Release|x86.Build.0 = Release|x86\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|x64.Build.0 = Release|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{A0006302-D1B5-4AB8-9ACE-D31A692DB3D2}.Release|x86.Build.0 = Release|Any CPU\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|Any CPU.ActiveCfg = Debug|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|Any CPU.Build.0 = Debug|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|ARM64.ActiveCfg = Debug|ARM64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|ARM64.Build.0 = Debug|ARM64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|x64.Build.0 = Debug|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|x86.ActiveCfg = Debug|Win32\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Debug|x86.Build.0 = Debug|Win32\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|Any CPU.ActiveCfg = Release|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|Any CPU.Build.0 = Release|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|ARM64.ActiveCfg = Release|ARM64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|ARM64.Build.0 = Release|ARM64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|x64.ActiveCfg = Release|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|x64.Build.0 = Release|x64\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|x86.ActiveCfg = Release|Win32\n\t\t{08DED710-2048-45C3-90F9-0D585263796D}.Release|x86.Build.0 = Release|Win32\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|x64.Build.0 = Release|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9}.Release|x86.Build.0 = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|x64.Build.0 = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF}.Release|x86.Build.0 = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|x64.Build.0 = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{DA5B7FDA-6DE4-4B11-AF93-E785E1DF56A0}.Release|x86.Build.0 = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|x64.Build.0 = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{669B5EBC-A5D6-4CEC-B3DB-6DA7D0CA7B79}.Release|x86.Build.0 = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|ARM64.ActiveCfg = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|ARM64.Build.0 = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|ARM64.ActiveCfg = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|ARM64.Build.0 = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|x64.Build.0 = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{B8E89A2F-3C4D-4A5B-9E1F-2A7B3C4D5E6F}.Release|x86.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{23169CA2-2157-4978-A8AF-CF360540F467} = {11DEE166-9224-42F9-92C6-A6447A90C31B}\n\t\t{DF5E31FD-A162-4053-B7C6-50C196CF60E3} = {11DEE166-9224-42F9-92C6-A6447A90C31B}\n\t\t{05BD7808-EE6F-4139-903C-758A97B122A9} = {9A2F89BD-58B1-4E31-A0CF-F4D3AFB3F02B}\n\t\t{8449AD82-6B34-4635-A502-7FA26DDF1BAF} = {11DEE166-9224-42F9-92C6-A6447A90C31B}\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {DC3D5311-37A2-44C1-90E8-86A268A99F35}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/CFGBlockOrdering.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Analysis;\n\npublic enum CFGEdgeKind {\n  Tree,\n  Forward,\n  Backward,\n  Crossing\n}\n\npublic class CFGBlockOrdering {\n  private FunctionIR function_;\n  private List<BlockIR> postorderList_;\n  private Dictionary<BlockIR, int> postorderMap_;\n  private List<BlockIR> preorderList_;\n  private Dictionary<BlockIR, int> preorderMap_;\n  private HashSet<BlockIR> visitedBlocks_;\n\n  public CFGBlockOrdering(FunctionIR function) {\n    function_ = function;\n    preorderList_ = new List<BlockIR>(function_.Blocks.Count);\n    postorderList_ = new List<BlockIR>(function_.Blocks.Count);\n    preorderMap_ = new Dictionary<BlockIR, int>(function_.Blocks.Count);\n    postorderMap_ = new Dictionary<BlockIR, int>(function_.Blocks.Count);\n    visitedBlocks_ = new HashSet<BlockIR>(function_.Blocks.Count);\n\n    if (function.EntryBlock != null) {\n      visitedBlocks_.Add(function_.EntryBlock);\n      ComputeInfo(function.EntryBlock);\n    }\n  }\n\n  public List<BlockIR> PreorderList => preorderList_;\n  public List<BlockIR> PostorderList => postorderList_;\n\n  public int GetBlockPreorderNumber(BlockIR block) {\n    if (preorderMap_.TryGetValue(block, out int number)) {\n      return number;\n    }\n\n    return -1;\n  }\n\n  public int GetBlockPostorderNumber(BlockIR block) {\n    if (postorderMap_.TryGetValue(block, out int number)) {\n      return number;\n    }\n\n    return -1;\n  }\n\n  public void PostorderWalk(Func<BlockIR, int, bool> action) {\n    for (int i = 0; i < postorderList_.Count; i++) {\n      if (!action(postorderList_[i], i)) {\n        break;\n      }\n    }\n  }\n\n  public void PreorderWalk(Func<BlockIR, int, bool> action) {\n    for (int i = 0; i < preorderList_.Count; i++) {\n      if (!action(preorderList_[i], i)) {\n        break;\n      }\n    }\n  }\n\n  public void ReversePostorderWalk(Func<BlockIR, int, bool> action) {\n    for (int i = postorderList_.Count - 1; i >= 0; i--) {\n      if (!action(postorderList_[i], i)) {\n        break;\n      }\n    }\n  }\n\n  private void ComputeInfo(BlockIR block) {\n    preorderMap_.Add(block, preorderList_.Count);\n    preorderList_.Add(block);\n\n    foreach (var successorBlock in block.Successors) {\n      if (visitedBlocks_.Add(successorBlock)) {\n        // First time visiting the block.\n        //? TODO: Compute edge kind\n        ComputeInfo(successorBlock);\n      }\n      //? TODO: Compute edge kind\n    }\n\n    postorderMap_.Add(block, postorderList_.Count);\n    postorderList_.Add(block);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/CFGReachability.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Analysis;\n\n//? TODO: Switch to SparseBitVector to speed up.\npublic class CFGReachability {\n  private FunctionIR function_;\n  private int maxBlockNumber_;\n  private BitArray[] reachableBlocks_;\n\n  public CFGReachability(FunctionIR function) {\n    function_ = function;\n    maxBlockNumber_ = -1;\n\n    function_.Blocks.ForEach(item => maxBlockNumber_ =\n                               Math.Max(item.Number, maxBlockNumber_));\n\n    maxBlockNumber_++;\n    InitializeBitVectors();\n    Compute();\n  }\n\n  public static int GetCardinality(BitArray bitArray) {\n    int[] ints = new int[(bitArray.Count >> 5) + 1];\n    bitArray.CopyTo(ints, 0);\n    int count = 0;\n\n    // Fix for not truncated bits in last integer that may have been set to true with SetAll().\n    ints[ints.Length - 1] &= ~(-1 << bitArray.Count % 32);\n\n    for (int i = 0; i < ints.Length; i++) {\n      int c = ints[i];\n\n      // http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel\n      unchecked {\n        c = c - (c >> 1 & 0x55555555);\n        c = (c & 0x33333333) + (c >> 2 & 0x33333333);\n        c = (c + (c >> 4) & 0xF0F0F0F) * 0x1010101 >> 24;\n      }\n\n      count += c;\n    }\n\n    return count;\n  }\n\n  public bool Reaches(BlockIR block, BlockIR targetBlock) {\n    return reachableBlocks_[targetBlock.Number].Get(block.Number);\n  }\n\n  public List<BlockIR> FindPath(BlockIR block, BlockIR targetBlock) {\n    if (!Reaches(block, targetBlock)) {\n      return new List<BlockIR>();\n    }\n\n    var visited = new HashSet<BlockIR>(maxBlockNumber_);\n    var worklist = new List<PathBlock>(maxBlockNumber_);\n    worklist.Add(new PathBlock(block));\n    visited.Add(block);\n\n    while (worklist.Count > 0) {\n      var current = worklist[worklist.Count - 1];\n      worklist.RemoveAt(worklist.Count - 1);\n\n      if (current.Block == targetBlock) {\n        var pathBlocks = new List<BlockIR>(current.Distance + 1);\n\n        while (current != null) {\n          pathBlocks.Add(current.Block);\n          current = current.Previous;\n        }\n\n        return pathBlocks;\n      }\n\n      foreach (var succBlock in current.Block.Successors) {\n        if (!visited.Contains(succBlock)) {\n          worklist.Add(new PathBlock(succBlock, current.Distance + 1, current));\n          visited.Add(succBlock);\n        }\n      }\n    }\n\n    return new List<BlockIR>();\n  }\n\n  private void InitializeBitVectors() {\n    reachableBlocks_ = new BitArray[maxBlockNumber_ + 1];\n\n    for (int i = 0; i <= maxBlockNumber_; i++) {\n      reachableBlocks_[i] = new BitArray(maxBlockNumber_ + 1);\n    }\n\n    if (function_.EntryBlock != null) {\n      reachableBlocks_[function_.EntryBlock.Number].Set(function_.EntryBlock.Number, true);\n    }\n  }\n\n  private void Compute() {\n    //? TODO: This entire code is very inefficient\n    //? A proper sparse bit-vector is needed.\n    var currentValues = new BitArray(maxBlockNumber_ + 1);\n    bool changed = true;\n    //var sw = Stopwatch.StartNew();\n\n    var blockOrdering = new CFGBlockOrdering(function_);\n\n    while (changed) {\n      changed = false;\n\n      //foreach (var block in function_.Blocks) {\n      blockOrdering.ReversePostorderWalk((block, _) => {\n        if (block.Predecessors.Count == 0) {\n          return true;\n        }\n\n        currentValues.SetAll(false);\n\n        foreach (var predBlock in block.Predecessors) {\n          var inValues = reachableBlocks_[predBlock.Number];\n          currentValues.Or(inValues);\n        }\n\n        int popcnt = GetCardinality(currentValues);\n\n        if (popcnt > 0) {\n          currentValues.Set(block.Number, true);\n        }\n\n        var outValues = reachableBlocks_[block.Number];\n\n        for (int i = 0; i < maxBlockNumber_; i++) {\n          if (currentValues[i] != outValues[i]) {\n            reachableBlocks_[block.Number] = new BitArray(currentValues);\n            changed = true;\n            break;\n          }\n        }\n\n        return true;\n      });\n    }\n\n    //sw.Stop();\n    //Trace.WriteLine($\"Time {sw.ElapsedMilliseconds}\");\n    //Trace.Flush();\n  }\n\n  private class PathBlock {\n    public BlockIR Block;\n    public int Distance;\n    public PathBlock Previous;\n\n    public PathBlock(BlockIR block, int distance = 0, PathBlock previous = null) {\n      Block = block;\n      Distance = distance;\n      Previous = previous;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/CFGReachabilityReferenceFilter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Analysis;\n\npublic class CFGReachabilityReferenceFilter : IReachableReferenceFilter {\n  protected FunctionIR function_;\n  protected CFGReachability cfgReachability_;\n\n  public CFGReachabilityReferenceFilter(FunctionIR function) {\n    function_ = function;\n  }\n\n  public bool FilterDefinitions { get; set; }\n  public bool FilterUses { get; set; }\n\n  public virtual bool AcceptDefinitionReference(IRElement element, IRElement startSourceElement) {\n    if (!FilterDefinitions) {\n      return false;\n    }\n\n    // Accept element if it's a definition that can reach the source element.\n    var cfgReachability = GetReachabilityInfo();\n\n    if (!cfgReachability.Reaches(element.ParentBlock, startSourceElement.ParentBlock)) {\n      return false;\n    }\n\n    //? TODO: Use reaching definitions if available\n    // If in the same block, accept it only if dest is found before the use,\n    // or the block is found in a loop (value may reach through a backedge).\n    if (startSourceElement.ParentBlock == element.ParentBlock) {\n      if (element.ParentInstruction == null) {\n        return true; // Parameter dominates everything.\n      }\n\n      if (startSourceElement.ParentInstruction == null) {\n        return false;\n      }\n\n      int destIndex = element.ParentInstruction.IndexInBlock;\n      int useIndex = startSourceElement.ParentInstruction.IndexInBlock;\n      return destIndex < useIndex;\n    }\n\n    return true;\n  }\n\n  public virtual bool AcceptReference(IRElement element, IRElement startElement) {\n    return true;\n  }\n\n  public virtual bool AcceptUseReference(IRElement element, IRElement startDestElement) {\n    if (!FilterUses) {\n      return false;\n    }\n\n    // Accept element if it can be reached from the dest. element.\n    //? TODO: Use reaching definitions if available\n    var cfgReachability = GetReachabilityInfo();\n\n    if (!cfgReachability.Reaches(startDestElement.ParentBlock, element.ParentBlock)) {\n      return false;\n    }\n\n    // If in the same block, accept it only if dest is found before the use,\n    // or the block is found in a loop (value may reach through a backedge).\n    if (startDestElement.ParentBlock == element.ParentBlock) {\n      if (startDestElement.ParentInstruction == null) {\n        return true; // Use dominated by parameter.\n      }\n\n      if (element.ParentInstruction == null) {\n        return false;\n      }\n\n      int destIndex = startDestElement.ParentInstruction.IndexInBlock;\n      int useIndex = element.ParentInstruction.IndexInBlock;\n      return destIndex < useIndex;\n    }\n\n    return true;\n  }\n\n  private CFGReachability GetReachabilityInfo() {\n    cfgReachability_ ??= FunctionAnalysisCache.Get(function_).GetReachability();\n    return cfgReachability_;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/CallGraph.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Analysis;\n\n[Flags]\npublic enum CallGraphNodeFlags {\n  None = 0,\n  Internal = 1 << 0,\n  External = 1 << 1,\n  AddressTaken = 1 << 2\n}\n\npublic class CallSite : TaggedObject {\n  public CallSite(ulong callInstrId, CallGraphNode target, CallGraphNode source) {\n    CallInstructionId = callInstrId;\n    Target = target;\n    Source = source;\n  }\n\n  public CallSite(InstructionIR callInstr, CallGraphNode target, CallGraphNode parent) :\n    this(callInstr.Id, target, parent) {\n  }\n\n  public ulong CallInstructionId { get; set; }\n  public CallGraphNode Target { get; set; }\n  public CallGraphNode Source { get; set; }\n\n  public static bool operator ==(CallSite left, CallSite right) {\n    return EqualityComparer<CallSite>.Default.Equals(left, right);\n  }\n\n  public static bool operator !=(CallSite left, CallSite right) {\n    return !(left == right);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is CallSite site &&\n           CallInstructionId == site.CallInstructionId &&\n           EqualityComparer<CallGraphNode>.Default.Equals(Target, site.Target) &&\n           EqualityComparer<CallGraphNode>.Default.Equals(Source, site.Source);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(CallInstructionId, Target, Source);\n  }\n}\n\npublic class CallGraphNode : TaggedObject {\n  public CallGraphNode(IRTextFunction function, string funcName, int number, CallGraphNodeFlags flags) {\n    Function = function;\n    FunctionName = funcName;\n    Number = number;\n    Flags = flags;\n  }\n\n  public IRTextFunction Function { get; set; }\n  public string FunctionName { get; set; }\n  public int Number { get; set; }\n  public List<CallSite> Callers { get; set; }\n  public List<CallSite> Callees { get; set; }\n  public CallGraphNodeFlags Flags { get; set; }\n  public bool HasKnownTarget => Function != null;\n  public bool HasCallers => Callers != null && Callers.Count > 0;\n  public bool HasCallees => Callees != null && Callees.Count > 0;\n  public bool IsLeafFunction => !HasCallees;\n  public bool IsInternal => Flags.HasFlag(CallGraphNodeFlags.Internal);\n  public bool IsExternal => Flags.HasFlag(CallGraphNodeFlags.External);\n  public bool IsAddressTaken => Flags.HasFlag(CallGraphNodeFlags.AddressTaken);\n\n  public IEnumerable<CallGraphNode> UniqueCallers {\n    get {\n      if (Callers != null) {\n        var nodeSet = new HashSet<CallGraphNode>();\n\n        foreach (var callsite in Callers) {\n          if (nodeSet.Add(callsite.Source)) {\n            yield return callsite.Source;\n          }\n        }\n      }\n    }\n  }\n\n  public IEnumerable<CallGraphNode> UniqueCallees {\n    get {\n      if (Callees != null) {\n        var nodeSet = new HashSet<CallGraphNode>();\n\n        foreach (var callsite in Callees) {\n          if (nodeSet.Add(callsite.Target)) {\n            yield return callsite.Target;\n          }\n        }\n      }\n    }\n  }\n\n  public int UniqueCallerCount {\n    get {\n      int count = 0;\n\n      foreach (var node in UniqueCallers) {\n        count++;\n      }\n\n      return count;\n    }\n  }\n\n  public int UniqueCalleeCount {\n    get {\n      int count = 0;\n\n      foreach (var node in UniqueCallees) {\n        count++;\n      }\n\n      return count;\n    }\n  }\n\n  public static bool operator ==(CallGraphNode left, CallGraphNode right) {\n    return EqualityComparer<CallGraphNode>.Default.Equals(left, right);\n  }\n\n  public static bool operator !=(CallGraphNode left, CallGraphNode right) {\n    return !(left == right);\n  }\n\n  public void AddCallee(CallSite callsite) {\n    Callees ??= new List<CallSite>();\n    Callees.Add(callsite);\n  }\n\n  public void AddCallee(CallGraphNode node) {\n    AddCallee(new CallSite(0, node, this));\n  }\n\n  public void AddCaller(CallSite callsite) {\n    Callers ??= new List<CallSite>();\n    Callers.Add(callsite);\n  }\n\n  public CallGraphNode FindCallee(string name) {\n    if (Callees == null) {\n      return null;\n    }\n\n    var result = Callees.Find(c => c.Target != null && c.Target.FunctionName.Equals(name, StringComparison.Ordinal));\n    return result?.Target;\n  }\n\n  public CallGraphNode FindCallee(IRTextFunction function) {\n    if (Callees == null) {\n      return null;\n    }\n\n    var result = Callees.Find(c => c.Target != null && c.Target.Function == function);\n    return result?.Target;\n  }\n\n  public CallGraphNode FindCallee(CallGraphNode node) {\n    return FindCallee(node.FunctionName);\n  }\n\n  public CallGraphNode FindCaller(IRTextFunction function) {\n    if (Callers == null) {\n      return null;\n    }\n\n    var result = Callers.Find(c => c.Source != null && c.Source.Function == function);\n    return result?.Target;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is CallGraphNode node &&\n           Number == node.Number &&\n           FunctionName == node.FunctionName;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Number);\n  }\n}\n\npublic class CallGraphEventArgs : EventArgs {\n  public CallGraphEventArgs(IRTextFunction textFunction, FunctionIR function, CallGraphNode functionNode) {\n    TextFunction = textFunction;\n    Function = function;\n    FunctionNode = functionNode;\n  }\n\n  public IRTextFunction TextFunction { get; set; }\n  public FunctionIR Function { get; set; }\n  public CallGraphNode FunctionNode { get; set; }\n}\n\npublic class CallGraph {\n  public delegate bool CallNodeCallback(CallGraphNode node, CallGraphNode parentNode,\n                                        CallGraph callGraph, List<IRTextFunction> targetFuncts);\n\n  private List<CallGraphNode> nodes_;\n  private List<CallGraphNode> entryNodes_;\n  private Dictionary<IRTextFunction, CallGraphNode> funcToNodeMap_;\n  private Dictionary<string, CallGraphNode> externalFuncToNodeMap_;\n  private HashSet<IRTextFunction> visitedFuncts_;\n  private IRTextSummary summary_;\n  private IRTextSectionLoader loader_;\n  private ICompilerIRInfo irInfo_;\n  private int nextCallNodeId_;\n\n  public CallGraph(IRTextSummary summary, IRTextSectionLoader loader, ICompilerIRInfo irInfo) {\n    summary_ = summary;\n    loader_ = loader;\n    irInfo_ = irInfo;\n    nodes_ = new List<CallGraphNode>(summary.Functions.Count);\n    funcToNodeMap_ = new Dictionary<IRTextFunction, CallGraphNode>(summary.Functions.Count);\n    externalFuncToNodeMap_ = new Dictionary<string, CallGraphNode>();\n    visitedFuncts_ = new HashSet<IRTextFunction>();\n    entryNodes_ = new List<CallGraphNode>();\n  }\n\n  public List<CallGraphNode> EntryFunctionNodes => entryNodes_;\n  public List<CallGraphNode> FunctionNodes => nodes_;\n  public event EventHandler<CallGraphEventArgs> CallGraphNodeCreated;\n\n  public void Execute(IRTextSection section = null, CancelableTask cancelableTask = null) {\n    //? TODO: Can be multithreaded, most time spent parsing the functs\n    foreach (var func in summary_.Functions) {\n      if (visitedFuncts_.Contains(func)) {\n        continue;\n      }\n\n      if (cancelableTask is {IsCanceled: true}) {\n        return;\n      }\n\n      BuildCallSubgraph(func, section?.Name, cancelableTask);\n    }\n\n    // Find entry functions.\n    foreach (var node in nodes_) {\n      if (!node.HasCallers) {\n        entryNodes_.Add(node);\n      }\n    }\n  }\n\n  public CallGraphNode Execute(IRTextFunction startFunction, IRTextSection section = null,\n                               CancelableTask cancelableTask = null) {\n    BuildCallSubgraph(startFunction, section?.Name, cancelableTask);\n    return GetOrCreateNode(startFunction);\n  }\n\n  public CallGraphNode FindNode(IRTextFunction function) {\n    if (funcToNodeMap_.TryGetValue(function, out var node)) {\n      return node;\n    }\n\n    return null;\n  }\n\n  public CallGraphNode GetOrCreateNode(IRTextFunction func) {\n    return GetOrCreateNode(func.Name);\n  }\n\n  public void AugmentGraph(CallNodeCallback augmentAction) {\n    // Walk over a clone of the node list, since new nodes may be added\n    // and would invalidate the iterator and assert.\n    var listClone = new List<CallGraphNode>(nodes_.Count);\n    listClone.AddRange(nodes_);\n\n    foreach (var node in listClone) {\n      if (node.Function != null) {\n        augmentAction(node, node, this, null);\n      }\n    }\n  }\n\n  public void TrimGraph(List<IRTextFunction> targetFuncts,\n                        CallNodeCallback callerFilter = null,\n                        CallNodeCallback calleeFilter = null) {\n    // Remove all nodes that don't lead to one of the target functions.\n    var visitedNodes = new HashSet<CallGraphNode>();\n    var worklist = new Queue<CallGraphNode>();\n\n    foreach (var func in targetFuncts) {\n      var node = FindNode(func);\n\n      if (node != null) {\n        worklist.Enqueue(node);\n      }\n    }\n\n    while (worklist.Count != 0) {\n      var node = worklist.Dequeue();\n      visitedNodes.Add(node);\n\n      if (node.HasCallers) {\n        foreach (var caller in node.Callers) {\n          if (callerFilter == null || callerFilter(caller.Source, node, this, targetFuncts)) {\n            if (!visitedNodes.Contains(caller.Source)) {\n              worklist.Enqueue(caller.Source);\n            }\n          }\n        }\n      }\n\n      if (node.HasCallees) {\n        foreach (var calee in node.Callees) {\n          if (calleeFilter == null || calleeFilter(calee.Target, node, this, targetFuncts)) {\n            visitedNodes.Add(calee.Target);\n          }\n        }\n      }\n    }\n\n    nodes_.Clear();\n    nodes_.AddRange(visitedNodes);\n    var cleanedNodes = new HashSet<CallGraphNode>();\n\n    foreach (var node in nodes_) {\n      TrimNodes(node, visitedNodes, cleanedNodes);\n    }\n\n    entryNodes_.Clear();\n\n    foreach (var node in nodes_) {\n      if (!node.HasCallers) {\n        entryNodes_.Add(node);\n      }\n    }\n  }\n\n  private void BuildCallSubgraph(IRTextFunction startFunction, string sectionName, CancelableTask cancelableTask) {\n    var worklist = new Queue<IRTextFunction>();\n    worklist.Enqueue(startFunction);\n    visitedFuncts_.Add(startFunction);\n\n    while (worklist.Count > 0) {\n      if (cancelableTask is {IsCanceled: true}) {\n        break;\n      }\n\n      var func = worklist.Dequeue();\n      var funcNode = GetOrCreateNode(func);\n\n      if (funcNode == null) {\n        continue; // An unknown/external function, ignore.\n      }\n\n      var funcIR = LoadSection(func, sectionName);\n\n      if (funcIR == null) {\n        continue; // Failed to parse function, ignore.\n      }\n\n      // Notify client about the node being created and function IR being available,\n      // can be used to add extra annotation tags on the node without having\n      // to reparse the functions later.\n      CallGraphNodeCreated?.Invoke(this, new CallGraphEventArgs(func, funcIR, funcNode));\n\n      foreach (var instr in funcIR.AllInstructions) {\n        if (irInfo_.IsCallInstruction(instr)) {\n          var callTarget = irInfo_.GetCallTarget(instr);\n\n          if (callTarget != null) {\n            // Extract target name.\n            string calleeFuncName = \"[INDIRECT]\";\n\n            if (callTarget.HasName) {\n              calleeFuncName = callTarget.Name;\n            }\n            else if (callTarget.IsIntConstant) {\n              calleeFuncName = $\"0x{callTarget.IntValue:X}\";\n            }\n\n            // Make node and enqueue it for the recursive processing.\n            var calleeNode = GetOrCreateNode(calleeFuncName);\n\n            var callsite = new CallSite(instr, calleeNode, funcNode);\n            funcNode.AddCallee(callsite);\n            calleeNode.AddCaller(callsite);\n\n            // If the function has a definition, add it to the worklist.\n            var calleeFunc = summary_.FindFunction(calleeFuncName);\n\n            if (calleeFunc != null && visitedFuncts_.Add(calleeFunc)) {\n              worklist.Enqueue(calleeFunc);\n            }\n          }\n          //? TODO: Add a \"Unknown target\" node\n        }\n      }\n    }\n  }\n\n  private void TrimNodes(CallGraphNode node, HashSet<CallGraphNode> visitedNodes,\n                         HashSet<CallGraphNode> cleanedNodes) {\n    cleanedNodes.Add(node);\n\n    if (!node.HasCallees) {\n      return;\n    }\n\n    for (int i = 0; i < node.Callees.Count; i++) {\n      var calleeNode = node.Callees[i].Target;\n\n      if (!visitedNodes.Contains(calleeNode)) {\n        node.Callees.RemoveAt(i);\n        i--;\n      }\n      else if (!cleanedNodes.Contains(calleeNode)) {\n        TrimNodes(calleeNode, visitedNodes, cleanedNodes);\n      }\n    }\n  }\n\n  private CallGraphNode GetOrCreateNode(string funcName) {\n    var func = summary_.FindFunction(funcName);\n\n    if (func == null) {\n      // Consider that it's an external function without definition.\n      if (externalFuncToNodeMap_.TryGetValue(funcName, out var externalNode)) {\n        return externalNode;\n      }\n\n      externalNode = new CallGraphNode(null, funcName, GetNextCallNodeId(),\n                                       CallGraphNodeFlags.External);\n      externalFuncToNodeMap_[funcName] = externalNode;\n      nodes_.Add(externalNode);\n      return externalNode;\n    }\n\n    if (funcToNodeMap_.TryGetValue(func, out var node)) {\n      return node;\n    }\n\n    node = new CallGraphNode(func, funcName, GetNextCallNodeId(),\n                             CallGraphNodeFlags.Internal);\n    funcToNodeMap_[func] = node;\n    nodes_.Add(node);\n    return node;\n  }\n\n  private int GetNextCallNodeId() {\n    return nextCallNodeId_++;\n  }\n\n  private FunctionIR LoadSection(IRTextFunction func, string sectionName) {\n    var section = func.FindSection(sectionName);\n\n    if (section == null) {\n      if (func.SectionCount == 0) {\n        return null;\n      }\n\n      section = func.Sections[0];\n    }\n\n    var loadedDoc = loader_.LoadSection(section);\n    return loadedDoc?.Function;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/DominanceFrontier.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Linq;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Analysis;\n\npublic class DominanceFrontier {\n  private readonly Dictionary<BlockIR, List<BlockIR>> frontierMap_;\n\n  public DominanceFrontier(FunctionIR function, DominatorAlgorithm dominanceAlgorithm) {\n    frontierMap_ = BuildDominanceFrontiers(function, dominanceAlgorithm);\n  }\n\n  private static Dictionary<BlockIR, List<BlockIR>>\n    BuildDominanceFrontiers(FunctionIR function, DominatorAlgorithm dominanceAlgorithm) {\n    // Algorithm adapted from Engineering a Compiler, 2nd edition page 499\n    var dominanceFrontiers = InitializeDominanceFrontiersToEmpty(function);\n\n    AddCFGDominanceFrontierInfo(function, dominanceAlgorithm, dominanceFrontiers);\n    return ConvertResult(dominanceFrontiers);\n  }\n\n  private static Dictionary<BlockIR, HashSet<BlockIR>> InitializeDominanceFrontiersToEmpty(FunctionIR function) {\n    var result = new Dictionary<BlockIR, HashSet<BlockIR>>();\n\n    foreach (var block in function.Blocks) {\n      result[block] = new HashSet<BlockIR>();\n    }\n\n    return result;\n  }\n\n  private static void AddCFGDominanceFrontierInfo(FunctionIR function, DominatorAlgorithm dominanceAlgorithm,\n                                                  Dictionary<BlockIR, HashSet<BlockIR>> dominanceFrontiers) {\n    var blocks = new CFGBlockOrdering(function).PostorderList;\n\n    foreach (var block in blocks) {\n      var nextBlocks = dominanceAlgorithm.NextBlocks(block).Where(blocks.Contains).ToList();\n\n      if (nextBlocks.Count > 1) {\n        foreach (var nextBlock in nextBlocks) {\n          var runner = nextBlock;\n\n          while (runner != dominanceAlgorithm.GetImmediateDominator(block)) {\n            dominanceFrontiers[runner].Add(block);\n            runner = dominanceAlgorithm.GetImmediateDominator(runner);\n          }\n        }\n      }\n    }\n  }\n\n  private static Dictionary<BlockIR, List<BlockIR>>\n    ConvertResult(Dictionary<BlockIR, HashSet<BlockIR>> hashedResult) {\n    var result = new Dictionary<BlockIR, List<BlockIR>>();\n\n    foreach (var entry in hashedResult) {\n      var list = new List<BlockIR>();\n\n      foreach (var value in entry.Value) {\n        list.Add(value);\n      }\n\n      result[entry.Key] = list;\n    }\n\n    return result;\n  }\n\n  public IReadOnlyList<BlockIR> FrontierOf(BlockIR block) {\n    return frontierMap_[block];\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/DominatorAlgorithm.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Analysis;\n\n[Flags]\npublic enum DominatorAlgorithmOptions {\n  Dominators = 1 << 0,\n  PostDominators = 1 << 1,\n  BuildTree = 1 << 2,\n  BuildQueryCache = 1 << 3\n}\n\npublic class DominatorTreeNode {\n  public DominatorTreeNode(BlockIR block, int childCount = 0) {\n    Block = block;\n    Children = new List<DominatorTreeNode>(childCount);\n  }\n\n  public BlockIR Block { get; set; }\n  public DominatorTreeNode ImmediateDominator { get; set; }\n  public List<DominatorTreeNode> Children { get; set; }\n}\n\npublic class DominatorAlgorithm {\n  private readonly FunctionIR function_;\n  private readonly DominatorAlgorithmOptions options_;\n  private readonly Func<BlockIR, List<BlockIR>> nextBlocks_;\n  private Dictionary<BlockIR, DominatorTreeNode> blockDomTreeNodeMap_;\n  private Dictionary<BlockIR, int> blockIdMap_;\n  private CFGBlockOrdering blockOrdering_;\n  private HashSet<Tuple<BlockIR, BlockIR>> dominanceCache_;\n  private List<int> immDoms_;\n  private List<BlockIR> postorderList_;\n  private Dictionary<int, BlockIR> postorderNumberBlockMap_;\n  private BlockIR treeStartBlock_;\n  private DominatorTreeNode treeRootNode_;\n\n  public DominatorAlgorithm(FunctionIR function, DominatorAlgorithmOptions options) {\n    function_ = function;\n    options_ = options;\n    bool usePostDominators = options.HasFlag(DominatorAlgorithmOptions.PostDominators);\n    List<BlockIR> patchedBlocks = null;\n\n    if (usePostDominators) {\n      nextBlocks_ = block => block.Successors;\n\n      // With multiple function exit blocks, create one fake exit block\n      // that acts as the single exit and change each exit block\n      // to have it as a successor.\n      var exitBlocks = new List<BlockIR>();\n\n      foreach (var block in function.Blocks) {\n        if (block.IsReturnBlock) {\n          exitBlocks.Add(block);\n        }\n      }\n\n      if (exitBlocks.Count == 1) {\n        treeStartBlock_ = exitBlocks[0];\n      }\n      else {\n        patchedBlocks = new List<BlockIR>();\n        var mergedExitBlock = new BlockIR(IRElementId.FromLong(0), function.BlockCount, function);\n        mergedExitBlock.Number = function.BlockCount;\n        treeStartBlock_ = mergedExitBlock;\n\n        foreach (var exitBlock in exitBlocks) {\n          mergedExitBlock.Predecessors.Add(exitBlock);\n          exitBlock.Successors.Add(mergedExitBlock);\n          patchedBlocks.Add(exitBlock); // To remove fake successor later.\n        }\n      }\n    }\n    else {\n      // It is assumed there is a single entry block.\n      nextBlocks_ = block => block.Predecessors;\n      treeStartBlock_ = function.EntryBlock;\n    }\n\n    // Build a list of the blocks in postorder.\n    blockOrdering_ = new CFGBlockOrdering(function);\n    postorderList_ = blockOrdering_.PostorderList;\n\n    // For post-dominators, the blocks are walked in reverse-postorder.\n    if (usePostDominators) {\n      postorderList_.Reverse();\n    }\n\n    // Build map of block to its ID in the immDom array.\n    int blockCount = function.Blocks.Count;\n    blockIdMap_ = new Dictionary<BlockIR, int>(blockCount);\n\n    for (int i = 0; i < postorderList_.Count; i++) {\n      blockIdMap_[postorderList_[i]] = i;\n    }\n\n    // Build a reverse map from block -> postorder number\n    // to allow querying the immediate dominator list quickly.\n    postorderNumberBlockMap_ = new Dictionary<int, BlockIR>(blockCount);\n\n    foreach (var block in postorderList_) {\n      postorderNumberBlockMap_[GetBlockId(block)] = block;\n    }\n\n    if (!InitializeImmediateDoms(treeStartBlock_)) {\n      return; // CFG is invalid.\n    }\n\n    Compute();\n\n    if (options.HasFlag(DominatorAlgorithmOptions.BuildTree)) {\n      BuildTree(treeStartBlock_);\n    }\n\n    // Remove the fake successor merged exit block from the patched blocks.\n    if (usePostDominators && patchedBlocks != null) {\n      foreach (var block in patchedBlocks) {\n        block.Predecessors.RemoveAt(block.Predecessors.Count - 1);\n      }\n    }\n  }\n\n  public DominatorTreeNode DomTreeRootNode => treeRootNode_;\n  public bool IsValid => treeRootNode_ != null;\n\n  public BlockIR GetImmediateDominator(BlockIR block) {\n    int blockId = GetBlockId(block);\n\n    if (blockId == -1) {\n      return null; // CFG is invalid;\n    }\n\n    int immDom = immDoms_[blockId];\n    return immDom != -1 ? postorderNumberBlockMap_[immDom] : null;\n  }\n\n  public IEnumerable<BlockIR> EnumerateDominators(BlockIR block) {\n    while (block != treeStartBlock_) {\n      block = GetImmediateDominator(block);\n\n      if (block == null) {\n        yield break;\n      }\n\n      yield return block;\n    }\n  }\n\n  public bool Dominates(BlockIR block, BlockIR dominatedBlock) {\n    if (block == dominatedBlock) {\n      return true;\n    }\n\n    if (BuildQueryCache(treeStartBlock_)) {\n      var pair = new Tuple<BlockIR, BlockIR>(block, dominatedBlock);\n      return dominanceCache_.Contains(pair);\n    }\n\n    // Fall back to a search through the immdom array.\n    int blockId = GetBlockId(dominatedBlock);\n\n    if (blockId == -1) {\n      return false; // Unreachable block.\n    }\n\n    int immDom = immDoms_[blockId];\n\n    while (immDom != -1) {\n      var immDomBlock = postorderNumberBlockMap_[immDom];\n\n      if (immDomBlock == block) {\n        return true;\n      }\n\n      if (immDomBlock == treeStartBlock_) {\n        return false;\n      }\n\n      immDom = immDoms_[immDom];\n    }\n\n    return false;\n  }\n\n  public List<BlockIR> NextBlocks(BlockIR block) {\n    return nextBlocks_(block);\n  }\n\n  private void Compute() {\n    bool changed = true;\n\n    while (changed) {\n      changed = false;\n\n      // Iterate over the block list. Note that we don't start with the last node\n      // because we want to skip over the entry or exit block.\n      for (int i = postorderList_.Count - 2; i >= 0; i--) {\n        // We need to choose the first predecessor that was processed.\n        // Then we intersect its dominator set with the sets of all\n        // the other predecessors that have been processed.\n        int newIdomId = -1;\n        var block = postorderList_[i];\n\n        foreach (var nextBlock in NextBlocks(block)) {\n          UpdateImmediateDominator(nextBlock, ref newIdomId);\n        }\n\n        // If the new immediate dominator is not the same as the last one\n        // save it and mark that a change has been made.\n        if (immDoms_[i] != newIdomId) {\n          immDoms_[i] = newIdomId;\n          changed = true;\n        }\n      }\n    }\n  }\n\n  private void UpdateImmediateDominator(BlockIR block, ref int newIdomId) {\n    int blockId = GetBlockId(block);\n\n    if (blockId == -1) {\n      // This happens when the predecessor is unreachable,\n      // but the current block is reachable.\n      return;\n    }\n\n    if (immDoms_[blockId] == -1) {\n      // Skip the predecessor if it wasn't processed yet.\n    }\n    else if (newIdomId == -1) {\n      // This is the first predecessor that was processed.\n      newIdomId = blockId;\n    }\n    else {\n      // This is a predecessor that was processed. Intersect its\n      // dominator set with the current new immediate dominator.\n      newIdomId = Intersect(blockId, newIdomId);\n    }\n  }\n\n  private bool InitializeImmediateDoms(BlockIR startBlock) {\n    immDoms_ = new List<int>(function_.Blocks.Count);\n\n    for (int i = 0; i < postorderList_.Count; i++) {\n      immDoms_.Add(-1);\n    }\n\n    // The start node is dominated only by itself.\n    int startBlockId = GetBlockId(startBlock);\n\n    if (startBlockId == -1) {\n      return false;\n    }\n\n    immDoms_[startBlockId] = startBlockId;\n    return true;\n  }\n\n  private int Intersect(int a, int b) {\n    // Walk up the immediate dominator array until the \"fingers\" point to the\n    // same postorder number. Note that a higher postorder number means that\n    // we're closer to the entry block of the CFG (exit block if we're\n    // talking about a post-dominator tree).\n    while (a != b) {\n      while (a < b) {\n        a = immDoms_[a]; // PostNumb(immDoms[a]) > PostNumb(a)\n      }\n\n      while (b < a) {\n        b = immDoms_[b]; // Same as above.\n      }\n    }\n\n    return a;\n  }\n\n  private int GetBlockId(BlockIR block) {\n    if (block == null) {\n      return -1; // Invalid CFG.\n    }\n\n    if (blockIdMap_.TryGetValue(block, out int id)) {\n      return id;\n    }\n\n    return -1;\n  }\n\n  private void BuildTree(BlockIR startBlock) {\n    blockDomTreeNodeMap_ =\n      new Dictionary<BlockIR, DominatorTreeNode>(function_.Blocks.Count);\n\n    treeRootNode_ = GetOrCreateDomTreeNode(startBlock);\n\n    // Build the tree top-down.\n    for (int i = postorderList_.Count - 2; i >= 0; i--) {\n      var block = postorderList_[i];\n      var blockNode = GetOrCreateDomTreeNode(block);\n      int blockId = GetBlockId(block);\n      int immDom = immDoms_[blockId];\n\n      if (immDom == -1) {\n        continue; // This is an unreachable block.\n      }\n\n      var immDomBlock = postorderNumberBlockMap_[immDom];\n      var immDomBlockNode = GetOrCreateDomTreeNode(immDomBlock);\n      blockNode.ImmediateDominator = immDomBlockNode;\n      immDomBlockNode.Children.Add(blockNode);\n    }\n  }\n\n  private DominatorTreeNode GetOrCreateDomTreeNode(BlockIR block) {\n    if (blockDomTreeNodeMap_.TryGetValue(block, out var node)) {\n      return node;\n    }\n\n    node = new DominatorTreeNode(block, block.Successors.Count);\n    blockDomTreeNodeMap_[block] = node;\n    return node;\n  }\n\n  private bool BuildQueryCache(BlockIR startBlock) {\n    if (dominanceCache_ != null) {\n      return true;\n    }\n\n    if (!options_.HasFlag(DominatorAlgorithmOptions.BuildQueryCache)) {\n      return false;\n    }\n\n    dominanceCache_ = new HashSet<Tuple<BlockIR, BlockIR>>(function_.Blocks.Count * 4);\n\n    foreach (var block in postorderList_) {\n      int blockId = GetBlockId(block);\n      int immDom = immDoms_[blockId];\n\n      while (immDom != -1) {\n        var immDomBlock = postorderNumberBlockMap_[immDom];\n        dominanceCache_.Add(new Tuple<BlockIR, BlockIR>(immDomBlock, block));\n\n        if (immDomBlock == startBlock) {\n          break;\n        }\n\n        immDom = immDoms_[immDom];\n      }\n    }\n\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/FunctionAnalysisCache.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Analysis;\n//? TODO: Caching needs some settings like if it should be used, max cached items, etc\n\npublic class FunctionAnalysisCache {\n  private static Dictionary<FunctionIR, FunctionAnalysisCache> functionCacheMap_;\n  private static bool cacheEnabled_;\n  private static object lockObject_ = new();\n  private FunctionIR function_;\n\n  //? TODO: Create IAnalysis as a common interface and keep a list,\n  //? then change API to be like GetAsync<T>(), with T being the analysis.\n  private volatile DominatorAlgorithm dominators_;\n  private volatile DominatorAlgorithm postDominators_;\n  private volatile CFGReachability cfgReachability_;\n  private volatile DominanceFrontier dominanceFrontier_;\n  private volatile DominanceFrontier postDominanceFrontier_;\n\n  static FunctionAnalysisCache() {\n    functionCacheMap_ = new Dictionary<FunctionIR, FunctionAnalysisCache>();\n    cacheEnabled_ = true;\n  }\n\n  private FunctionAnalysisCache(FunctionIR function) {\n    function_ = function;\n  }\n\n  public static void TestReset() {\n    functionCacheMap_ = new Dictionary<FunctionIR, FunctionAnalysisCache>();\n    cacheEnabled_ = true;\n  }\n\n  public static void DisableCache() {\n    cacheEnabled_ = false;\n  }\n\n  public static FunctionAnalysisCache Get(FunctionIR function) {\n    lock (lockObject_) {\n      if (functionCacheMap_.TryGetValue(function, out var cache)) {\n        return cache;\n      }\n\n      cache = new FunctionAnalysisCache(function);\n\n      if (cacheEnabled_) {\n        functionCacheMap_[function] = cache;\n      }\n\n      return cache;\n    }\n  }\n\n  public static bool Remove(FunctionIR function) {\n    lock (lockObject_) {\n      return functionCacheMap_.Remove(function);\n    }\n  }\n\n  public static void ResetCache() {\n    lock (lockObject_) {\n      functionCacheMap_.Clear();\n    }\n  }\n\n  public async Task<DominatorAlgorithm> GetDominatorsAsync() {\n    if (dominators_ == null) {\n      var result = await ComputeDominators().ConfigureAwait(false);\n\n      if (cacheEnabled_) {\n        Interlocked.Exchange(ref dominators_, result);\n      }\n\n      return result;\n    }\n\n    return dominators_;\n  }\n\n  public async Task<DominatorAlgorithm> GetPostDominatorsAsync() {\n    if (postDominators_ == null) {\n      var result = await ComputePostDominators().ConfigureAwait(false);\n\n      if (cacheEnabled_) {\n        Interlocked.Exchange(ref postDominators_, result);\n      }\n\n      return result;\n    }\n\n    return postDominators_;\n  }\n\n  public async Task<DominanceFrontier> GetDominanceFrontierAsync() {\n    if (dominanceFrontier_ == null) {\n      var result = await ComputeDominanceFrontierAsync().ConfigureAwait(false);\n\n      if (cacheEnabled_) {\n        Interlocked.Exchange(ref dominanceFrontier_, result);\n      }\n\n      return result;\n    }\n\n    return dominanceFrontier_;\n  }\n\n  public async Task<DominanceFrontier> GetPostDominanceFrontierAsync() {\n    if (postDominanceFrontier_ == null) {\n      var result = await ComputePostDominanceFrontierAsync().ConfigureAwait(false);\n\n      if (cacheEnabled_) {\n        Interlocked.Exchange(ref postDominanceFrontier_, result);\n      }\n\n      return result;\n    }\n\n    return postDominanceFrontier_;\n  }\n\n  public async Task<CFGReachability> GetReachabilityAsync() {\n    if (cfgReachability_ == null) {\n      var result = await ComputeReachability().ConfigureAwait(false);\n\n      if (cacheEnabled_) {\n        Interlocked.Exchange(ref cfgReachability_, result);\n      }\n\n      return result;\n    }\n\n    return cfgReachability_;\n  }\n\n  public DominatorAlgorithm GetDominators() {\n    return GetDominatorsAsync().Result;\n  }\n\n  public DominatorAlgorithm GetPostDominators() {\n    return GetPostDominatorsAsync().Result;\n  }\n\n  public CFGReachability GetReachability() {\n    return GetReachabilityAsync().Result;\n  }\n\n  public async Task CacheAll() {\n    var domTask = ComputeDominators();\n    var postDomTask = ComputePostDominators();\n    var reachTask = ComputeReachability();\n    await Task.WhenAll(domTask, postDomTask, reachTask).ConfigureAwait(false);\n\n    Interlocked.Exchange(ref dominators_, await domTask.ConfigureAwait(false));\n    Interlocked.Exchange(ref postDominators_, await postDomTask.ConfigureAwait(false));\n    Interlocked.Exchange(ref cfgReachability_, await reachTask.ConfigureAwait(false));\n  }\n\n  public async Task CacheAllAsync() {\n    await CacheAll();\n  }\n\n  public void InvalidateAll() {\n    dominators_ = null;\n    postDominators_ = null;\n    cfgReachability_ = null;\n  }\n\n  private async Task<DominanceFrontier> ComputeDominanceFrontierAsync() {\n    var dominatorAlgorithm = await GetDominatorsAsync().ConfigureAwait(false);\n    return new DominanceFrontier(function_, dominatorAlgorithm);\n  }\n\n  private async Task<DominanceFrontier> ComputePostDominanceFrontierAsync() {\n    var dominatorAlgorithm = await GetPostDominatorsAsync().ConfigureAwait(false);\n    return new DominanceFrontier(function_, dominatorAlgorithm);\n  }\n\n  private Task<DominatorAlgorithm> ComputeDominators() {\n    return Task.Run(() => new DominatorAlgorithm(function_,\n                                                 DominatorAlgorithmOptions.Dominators |\n                                                 DominatorAlgorithmOptions.BuildQueryCache |\n                                                 DominatorAlgorithmOptions.BuildTree));\n  }\n\n  private Task<DominatorAlgorithm> ComputePostDominators() {\n    return Task.Run(() => new DominatorAlgorithm(function_,\n                                                 DominatorAlgorithmOptions.PostDominators |\n                                                 DominatorAlgorithmOptions.BuildQueryCache |\n                                                 DominatorAlgorithmOptions.BuildTree));\n  }\n\n  private Task<CFGReachability> ComputeReachability() {\n    return Task.Run(() => new CFGReachability(function_));\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/LoopGraph.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.Core.Analysis;\n\npublic enum LoopKind {\n  Natural,\n  NonReducible\n}\n\npublic sealed class Loop {\n  public Loop() {\n    Blocks = new HashSet<BlockIR>();\n    NestedLoops = new List<Loop>();\n  }\n\n  public LoopKind Kind { get; set; }\n  public int NestingLevel { get; set; }\n  public Loop ParentLoop { get; set; }\n  public HashSet<BlockIR> Blocks { get; set; }\n\n  // public List<BlockIR> ExitBlocks { get; set; }\n  // public BlockIR HeaderBlock {get;set;}\n  public List<Loop> NestedLoops { get; set; }\n\n  public Loop LoopNestRoot {\n    get {\n      var leader = this;\n      var current = ParentLoop;\n      var visitedBlocks = new List<Loop>(4);\n\n      while (current != null) {\n        leader = current;\n        current = current.ParentLoop;\n\n        // With invalid CFGs this can happen, break the loop.\n        if (visitedBlocks.Contains(current)) {\n          break;\n        }\n\n        visitedBlocks.Add(current);\n      }\n\n      return leader;\n    }\n  }\n\n  public void AddNestedLoop(Loop loop) {\n    if (loop == this) {\n      return;\n    }\n\n    if (!NestedLoops.Contains(loop)) {\n      NestedLoops.Add(loop);\n    }\n  }\n}\n\npublic sealed class LoopGraph {\n  private Dictionary<BlockIR, Loop> blockLoopMap_;\n  private FunctionIR function_;\n  private List<Loop> functionLoops_;\n\n  public LoopGraph(FunctionIR function) {\n    function_ = function;\n    functionLoops_ = new List<Loop>();\n    blockLoopMap_ = new Dictionary<BlockIR, Loop>();\n\n    foreach (var block in function_.Blocks) {\n      block.RemoveTag<LoopBlockTag>();\n    }\n  }\n\n  public bool HasLoops => functionLoops_.Count > 0;\n  public List<Loop> Loops => functionLoops_;\n\n  public void FindLoops() {\n    foreach (var block in function_.Blocks) {\n      foreach (var succBlock in block.Successors) {\n        if (succBlock.Number <= block.Number) {\n          MarkLoopBlocks(succBlock.Number, block.Number);\n        }\n      }\n    }\n  }\n\n  private void MarkLoopBlocks(int startId, int endId) {\n    var loop = new Loop();\n    functionLoops_.Add(loop);\n\n    foreach (var block in function_.Blocks) {\n      if (block.Number >= startId && block.Number <= endId) {\n        loop.Blocks.Add(block);\n        var loopTag = block.GetTag<LoopBlockTag>();\n\n        if (loopTag == null) {\n          loopTag = new LoopBlockTag(loop);\n          block.AddTag(loopTag);\n        }\n        else {\n          var nestedLoop = loopTag.Loop.LoopNestRoot;\n          loop.AddNestedLoop(nestedLoop);\n          loopTag.Loop.ParentLoop = loop;\n          loopTag.NestingLevel++;\n        }\n      }\n      else if (block.Number > endId) {\n        break;\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/ReferenceFinder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\n\n//? TODO: Reference finding for symbols withou SSA can use the reachability graph\n//? to trim down the set of potential definitions. Useful in the text viewer for highlighting and goto def.\n\n//? For syms without ref, try to find a block-local source by scanning back\n//?    useful especially for registers\n//?    can be done in parallel too\n\nnamespace ProfileExplorer.Core.Analysis;\n\n[Flags]\npublic enum ReferenceKind {\n  Load = 1 << 0,\n  Store = 1 << 1,\n  Address = 1 << 2,\n  SSA = 1 << 3\n}\n\npublic interface IReachableReferenceFilter {\n  public bool FilterDefinitions { get; set; }\n  public bool FilterUses { get; set; }\n  public bool AcceptReference(IRElement element, IRElement startElement);\n  public bool AcceptDefinitionReference(IRElement element, IRElement startSourceElement);\n  public bool AcceptUseReference(IRElement element, IRElement startDestElement);\n}\n\npublic struct Reference : IEquatable<Reference> {\n  public Reference(IRElement element, ReferenceKind kind) {\n    Element = element;\n    Kind = kind;\n  }\n\n  public IRElement Element { get; set; }\n  public ReferenceKind Kind { get; set; }\n\n  public bool Equals(Reference other) {\n    return Equals(Element, other.Element) && Kind == other.Kind;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is Reference other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Element, (int)Kind);\n  }\n}\n\npublic sealed class ReferenceFinder {\n  private FunctionIR function_;\n  private ICompilerIRInfo irInfo_;\n  private IReachableReferenceFilter referenceFilter_;\n  private Dictionary<int, SSADefinitionTag> ssaDefTagMap_;\n\n  public ReferenceFinder(FunctionIR function, ICompilerIRInfo irInfo = null,\n                         IReachableReferenceFilter referenceFilter = null) {\n    function_ = function;\n    irInfo_ = irInfo;\n    referenceFilter_ = referenceFilter;\n  }\n\n  public static List<IRElement> FindSSAUses(OperandIR op) {\n    var list = new List<IRElement>();\n    FindSSAUses(op, list);\n    return list;\n  }\n\n  public static List<IRElement> FindSSAUses(InstructionIR instr) {\n    var list = new List<IRElement>();\n\n    if (instr.Destinations.Count == 0) {\n      return list;\n    }\n\n    FindSSAUses(instr.Destinations[0], list);\n    return list;\n  }\n\n  public static SSADefinitionTag GetSSADefinitionTag(OperandIR op) {\n    var defLinkTag = op.GetTag<SSAUseTag>();\n\n    if (defLinkTag != null) {\n      return defLinkTag.Definition;\n    }\n\n    if (op.IsIndirection) {\n      return GetSSADefinitionTag(op.IndirectionBaseValue);\n    }\n\n    return op.GetTag<SSADefinitionTag>();\n  }\n\n  public static IRElement GetSSADefinition(OperandIR op) {\n    var tag = GetSSADefinitionTag(op);\n    return tag != null ? tag.OwnerElement : null;\n  }\n\n  public static InstructionIR GetSSADefinitionInstruction(OperandIR op) {\n    var tag = GetSSADefinitionTag(op);\n    return tag != null ? tag.DefinitionInstruction : null;\n  }\n\n  public static int? GetSSADefinitionId(OperandIR op) {\n    var tag = GetSSADefinitionTag(op);\n    return tag?.DefinitionId;\n  }\n\n  public static void FindSSAUses(OperandIR op, List<IRElement> list) {\n    foreach (var use in EnumerateSSAUses(op)) {\n      list.Add(use);\n    }\n  }\n\n  private static IEnumerable<IRElement> EnumerateSSAUses(OperandIR op) {\n    // If it's a definition operand, enumerate the SSA uses.\n    var ssaDefTag = op.GetTag<SSADefinitionTag>();\n\n    if (ssaDefTag != null) {\n      foreach (var use in ssaDefTag.Users) {\n        yield return use.OwnerElement;\n      }\n    }\n\n    // For source operands, go to the linked definition SSA tag.\n    var ssaDefUseTag = op.GetTag<SSAUseTag>();\n\n    if (ssaDefUseTag != null) {\n      foreach (var use in ssaDefUseTag.Definition.Users) {\n        yield return use.OwnerElement;\n      }\n    }\n  }\n\n  //? TODO: Should be moved to the SimilarValueFinder\n  public IRElement FindEquivalentValue(IRElement element, bool onlySSA = false) {\n    //? by querying an IR-level interface for \"equivalent symbols\"\n    if (element.ParentFunction == function_) {\n      return element;\n    }\n\n    //? TODO: Handle instructions\n    if (!(element is OperandIR op)) {\n      return null;\n    }\n\n    // If it's an SSA value, try to find an operand with the same def. ID.\n    int? defId = GetSSADefinitionId(op);\n\n    if (defId.HasValue) {\n      var foundDefOp = FindOperandWithSSADefinitionID(defId.Value);\n\n      // If found, also check that the symbol name is the same.\n      if (foundDefOp != null && IsSameSymbolOperand(op, foundDefOp)) {\n        if (foundDefOp.Role == OperandRole.Destination) {\n          return foundDefOp;\n        }\n\n        if (op.Role == OperandRole.Source) {\n          // Try to find a matching source operand by looking\n          // for an SSA use that is found in a block with the same ID.\n          var matchingOp = FindBestMatchingOperand(EnumerateSSAUses(foundDefOp), op, false);\n\n          if (matchingOp != null) {\n            return matchingOp;\n          }\n        }\n\n        return foundDefOp;\n      }\n    }\n\n    // For non-SSA values, search the entire function\n    // for a symbol with the same name and type.\n    //? TODO: inefficient, use a symbol table indexed by name (PrecomputeAllReferences)\n    return onlySSA ? null : FindBestMatchingOperand(EnumerateAllOperands(), op);\n  }\n\n  public IEnumerable<OperandIR> EnumerateAllOperands(bool includeDestinations = true,\n                                                     bool includeSources = true) {\n    foreach (var block in function_.Blocks) {\n      foreach (var tuple in block.Tuples) {\n        if (!(tuple is InstructionIR instr)) {\n          continue;\n        }\n\n        if (includeDestinations) {\n          foreach (var destOp in instr.Destinations) {\n            yield return destOp;\n          }\n        }\n\n        if (includeSources) {\n          foreach (var sourceOp in instr.Sources) {\n            yield return sourceOp;\n          }\n        }\n      }\n    }\n  }\n\n  public OperandIR FindOperandWithSSADefinitionID(int defId) {\n    // Build a cache mapping the definition IDs to the tag\n    // to speed up lookup and avoid n-squared behavior.\n    if (ssaDefTagMap_ == null) {\n      ssaDefTagMap_ = new Dictionary<int, SSADefinitionTag>();\n\n      foreach (var destOp in EnumerateAllOperands(true, false)) {\n        var ssaDefTag = GetSSADefinitionTag(destOp);\n\n        if (ssaDefTag != null) {\n          ssaDefTagMap_[ssaDefTag.DefinitionId] = ssaDefTag;\n        }\n      }\n    }\n\n    return ssaDefTagMap_.TryGetValue(defId, out var tag)\n      ? tag.DefinitionOperand\n      : null;\n  }\n\n  public List<Reference> FindAllSSAUsesOrReferences(IRElement element) {\n    if (element is OperandIR op) {\n      var ssaDef = GetSSADefinition(op);\n\n      if (ssaDef != null) {\n        var list = new List<Reference> {new(ssaDef, ReferenceKind.SSA)};\n        var useList = FindSSAUses(op);\n        useList.ForEach(item => list.Add(new Reference(item, ReferenceKind.SSA)));\n        return list;\n      }\n    }\n\n    return FindAllReferences(element);\n  }\n\n  public List<Reference> FindAllReferences(IRElement element, bool includeSSAUses = true,\n                                           Func<IRElement, ReferenceKind, bool>\n                                             filterAction = null) {\n    var list = new List<Reference>();\n\n    if (!(element is OperandIR op)) {\n      return list;\n    }\n\n    foreach (var block in function_.Blocks) {\n      foreach (var tuple in block.Tuples) {\n        if (!(tuple is InstructionIR instr)) {\n          continue;\n        }\n\n        foreach (var destOp in instr.Destinations) {\n          var comparedOp = destOp;\n          var refKind = ReferenceKind.Store;\n\n          if (destOp.IsIndirection) {\n            comparedOp = destOp.IndirectionBaseValue;\n            refKind = ReferenceKind.Load;\n          }\n\n          if (IsSameSymbolOperand(comparedOp, op)) {\n            CreateReference(destOp, refKind, list, filterAction);\n          }\n        }\n\n        foreach (var sourceOp in instr.Sources) {\n          var comparedOp = sourceOp;\n\n          if (sourceOp.IsIndirection) {\n            comparedOp = sourceOp.IndirectionBaseValue;\n          }\n\n          if (IsSameSymbolOperand(comparedOp, op)) {\n            var refKind = comparedOp.IsAddress\n              ? ReferenceKind.Address\n              : ReferenceKind.Load;\n            CreateReference(sourceOp, refKind, list, filterAction);\n          }\n        }\n      }\n    }\n\n    // Also go over the function parameters.\n    foreach (var paramOp in function_.Parameters) {\n      if (IsSameSymbolOperand(paramOp, op)) {\n        CreateReference(paramOp, ReferenceKind.Store, list, filterAction);\n      }\n    }\n\n    if (includeSSAUses) {\n      var useList = FindSSAUses(op);\n      useList.ForEach(item => list.Add(new Reference(item, ReferenceKind.SSA)));\n    }\n\n    return list;\n  }\n\n  public List<Reference> FindAllStores(IRElement element) {\n    return FindAllReferences(element, false,\n                             (element, kind) => kind == ReferenceKind.Store);\n  }\n\n  public List<Reference> FindAllLoads(IRElement element) {\n    return FindAllReferences(element, false,\n                             (element, kind) => kind == ReferenceKind.Load);\n  }\n\n  public List<IRElement> FindAllUses(OperandIR op) {\n    var list = new List<IRElement>();\n    return FindAllUses(op, list);\n  }\n\n  public List<IRElement> FindAllUses(InstructionIR instr) {\n    var list = new List<IRElement>();\n\n    if (instr.Destinations.Count == 0) {\n      return list;\n    }\n\n    FindAllUses(instr.Destinations[0], list);\n    return list;\n  }\n\n  public IRElement FindSingleDefinition(IRElement element) {\n    // Try to use SSA info first.\n    if (element is OperandIR op) {\n      var ssaDefOp = GetSSADefinition(op);\n\n      if (ssaDefOp != null) {\n        return ssaDefOp;\n      }\n    }\n\n    //? TODO: Very inefficient\n    var list = FindAllDefinitions(element);\n\n    if (list.Count == 1) {\n      return list[0];\n    }\n\n    return null;\n  }\n\n  public List<IRElement> FindAllDefinitions(IRElement element) {\n    var list = new List<IRElement>();\n\n    // Try to use SSA info first.\n    if (element is OperandIR op) {\n      var ssaDefOp = GetSSADefinition(op);\n\n      if (ssaDefOp != null) {\n        list.Add(ssaDefOp);\n        return list;\n      }\n\n      if (op.IsIndirection) {\n        // Search for the base operand of an indirection.\n        return FindAllDefinitions(op.IndirectionBaseValue);\n      }\n    }\n\n    //? TODO: Very inefficient\n    var refList = FindAllStores(element);\n\n    foreach (var reference in refList) {\n      if (AcceptReferenceForSource(reference.Element, element)) {\n        list.Add(reference.Element);\n      }\n    }\n\n    return list;\n  }\n\n  public IRElement GetSingleUse(OperandIR op) {\n    var ssaDefTag = op.GetTag<SSADefinitionTag>();\n\n    if (ssaDefTag != null) {\n      if (ssaDefTag.HasSingleUser) {\n        return ssaDefTag.Users[0].OwnerElement;\n      }\n\n      return null;\n    }\n\n    var useList = FindAllUses(op);\n\n    if (useList.Count == 1) {\n      return useList[0];\n    }\n\n    return null;\n  }\n\n  public bool IsSameSymbolOperand(OperandIR op, OperandIR searchedOp,\n                                  bool checkType = false,\n                                  bool exactCheck = false) {\n    if (!AreSymbolOperandsCompatible(op, searchedOp)) {\n      return false;\n    }\n\n    if (op.HasName) {\n      // Check if symbol names are the same.\n      if (!op.NameValue.Span.Equals(searchedOp.NameValue.Span,\n                                    StringComparison.Ordinal)) {\n        // Not same symbol name, but the IR may define names\n        // that should be considered to represent the same symbol.\n        if (irInfo_ == null || !irInfo_.OperandsReferenceSameSymbol(op, searchedOp, exactCheck)) {\n          return false;\n        }\n\n        // Check for same type if requested.\n        return !checkType || op.Type.Equals(searchedOp.Type);\n      }\n\n      // The same symbol name, but the IR may define names\n      // that should not be considered the same symbol (different offsets, for ex.)\n      if (irInfo_ != null && !irInfo_.OperandsReferenceSameSymbol(op, searchedOp, exactCheck)) {\n        return false;\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  private IRElement FindBestMatchingOperand(IEnumerable<IRElement> candidates,\n                                            OperandIR op, bool checkSymbol = true) {\n    // Try to find a matching source operand by looking\n    // for an SSA use that is found in a block with the same ID.\n    var opBlock = op.ParentBlock;\n    OperandIR firstUse = null;\n    OperandIR bestUse = null;\n    int bestUseDistance = int.MaxValue;\n\n    foreach (var useElement in candidates) {\n      if (!(useElement is OperandIR useOp)) {\n        continue;\n      }\n\n      if (checkSymbol && !IsSameSymbolOperand(useOp, op)) {\n        continue;\n      }\n\n      if (useOp.Role == op.Role && IsSameBlock(useOp.ParentBlock, opBlock)) {\n        // If in the same block, pick the use that is the closest\n        // to the original one based on the index in the block.\n        int opBlockIndex = op.ParentTuple.IndexInBlock;\n        int useBlockIndex = useOp.ParentTuple.IndexInBlock;\n        int distance = Math.Abs(useBlockIndex - opBlockIndex);\n\n        if (distance < bestUseDistance) {\n          bestUse = useOp;\n          bestUseDistance = distance;\n        }\n      }\n\n      firstUse ??= useOp;\n    }\n\n    // Return first use if one in the same block not found.\n    if (bestUse != null) {\n      return bestUse;\n    }\n\n    if (firstUse != null) {\n      return firstUse;\n    }\n\n    return null;\n  }\n\n  private bool IsSameBlock(BlockIR firstBlock, BlockIR secondBlock) {\n    if (firstBlock == secondBlock || firstBlock.Number == secondBlock.Number) {\n      return true;\n    }\n\n    if (firstBlock.HasLabel && secondBlock.HasLabel) {\n      return firstBlock.Label.Name == secondBlock.Label.Name;\n    }\n\n    return false;\n  }\n\n  private void CreateReference(OperandIR operand, ReferenceKind refKind, List<Reference> list,\n                               Func<IRElement, ReferenceKind, bool> filterAction) {\n    if (filterAction != null) {\n      if (!filterAction(operand, refKind)) {\n        return;\n      }\n    }\n\n    list.Add(new Reference(operand, refKind));\n  }\n\n  private List<IRElement> FindAllUses(OperandIR op, List<IRElement> list) {\n    foreach (var use in EnumerateSSAUses(op)) {\n      list.Add(use);\n    }\n\n    // If there is no SSA info, collect all the symbol loads.\n    if (list.Count == 0 && op.GetTag<SSADefinitionTag>() == null) {\n      var allLoads = FindAllLoads(op);\n\n      foreach (var reference in allLoads) {\n        if (AcceptReferenceForDestination(reference.Element, op)) {\n          list.Add(reference.Element);\n        }\n      }\n    }\n\n    return list;\n  }\n\n  private bool AreSymbolOperandsCompatible(OperandIR op1, OperandIR op2) {\n    if (op1.Kind == op2.Kind) {\n      return true;\n    }\n\n    if (op1.Kind == OperandKind.Variable ||\n        op1.Kind == OperandKind.Address) {\n      return op2.Kind == OperandKind.Variable ||\n             op2.Kind == OperandKind.Address;\n    }\n\n    return false;\n  }\n\n  private bool AcceptReference(IRElement element, IRElement startElement) {\n    if (referenceFilter_ != null) {\n      return referenceFilter_.AcceptReference(element, startElement);\n    }\n\n    return true;\n  }\n\n  private bool AcceptReferenceForSource(IRElement element, IRElement startSourceElement) {\n    if (referenceFilter_ != null) {\n      return referenceFilter_.AcceptDefinitionReference(element, startSourceElement);\n    }\n\n    return true;\n  }\n\n  private bool AcceptReferenceForDestination(IRElement element, IRElement startDestElement) {\n    if (referenceFilter_ != null) {\n      return referenceFilter_.AcceptUseReference(element, startDestElement);\n    }\n\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Analysis/SimilarValueFinder.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Analysis;\n\npublic class SimilarValueFinder {\n  private FunctionIR function_;\n  private Dictionary<int, InstructionIR> ssaDefTable_;\n\n  public SimilarValueFinder(FunctionIR function) {\n    function_ = function;\n    ssaDefTable_ = new Dictionary<int, InstructionIR>();\n    BuildSSADefinitionTable();\n  }\n\n  public InstructionIR Find(InstructionIR instr) {\n    if (instr.Destinations.Count == 0) {\n      return null;\n    }\n\n    int? ssaDefId = ReferenceFinder.GetSSADefinitionId(instr.Destinations[0]);\n\n    if (ssaDefId.HasValue &&\n        ssaDefTable_.TryGetValue(ssaDefId.Value, out var similarInstr)) {\n      return similarInstr;\n    }\n\n    return null;\n  }\n\n  private void BuildSSADefinitionTable() {\n    // Precompute a table mapping each SSA definition ID to its definition.\n    foreach (var block in function_.Blocks) {\n      foreach (var tuple in block.Tuples) {\n        if (tuple is InstructionIR instr && instr.Destinations.Count > 0) {\n          int? ssaDefId =\n            ReferenceFinder.GetSSADefinitionId(instr.Destinations[0]);\n\n          if (ssaDefId.HasValue) {\n            ssaDefTable_[ssaDefId.Value] = instr;\n          }\n        }\n      }\n    }\n  }\n\n  private bool IsSimilarInstruction(InstructionIR instr, InstructionIR otherInstr) {\n    return instr.Opcode.Equals(otherInstr.Opcode) &&\n           instr.Destinations.Count == otherInstr.Destinations.Count &&\n           instr.Sources.Count == otherInstr.Sources.Count;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/Disassembler.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reflection.PortableExecutable;\nusing System.Runtime.InteropServices;\nusing System.Security;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Microsoft.Win32.SafeHandles;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Binary;\n\npublic delegate void DisassemblerProgressHandler(DisassemblerProgress info);\n\npublic enum DisassemblerStage {\n  Disassembling,\n  PostProcessing\n}\n\npublic interface IDisassembler {\n  DisassemberResult Disassemble(string imagePath, ICompilerInfoProvider compilerInfo,\n                                DisassemblerProgressHandler progressCallback = null,\n                                CancelableTask cancelableTask = null);\n\n  Task<DisassemberResult> DisassembleAsync(string imagePath, ICompilerInfoProvider compilerInfo,\n                                           DisassemblerProgressHandler progressCallback = null,\n                                           CancelableTask cancelableTask = null);\n\n  bool EnsureDisassemblerAvailable();\n}\n\npublic class DisassemblerOptions {\n  public bool IncludeBytes { get; set; }\n}\n\npublic class DisassemblerProgress {\n  public DisassemblerProgress(DisassemblerStage stage) {\n    Stage = stage;\n  }\n\n  public DisassemblerStage Stage { get; set; }\n  public int Total { get; set; }\n  public int Current { get; set; }\n}\n\npublic class DisassemberResult {\n  public DisassemberResult(string disassemblyPath, string debugInfoFilePath) {\n    DisassemblyPath = disassemblyPath;\n    DebugInfoFilePath = debugInfoFilePath;\n  }\n\n  public string DisassemblyPath { get; set; }\n  public string DebugInfoFilePath { get; set; }\n}\n\npublic class Disassembler : IDisposable {\n  public delegate string SymbolNameResolverDelegate(long address);\n  private PEBinaryInfoProvider peInfo_;\n  private List<(ReadOnlyMemory<byte> Data, long StartRVA)> codeSectionData_;\n  private long baseAddress_;\n  private Machine architecture_;\n  private IDebugInfoProvider debugInfo_;\n  private Interop.DisassemblerHandle disasmHandle_;\n  private bool checkValidCallAddress_;\n  private SymbolNameResolverDelegate symbolNameResolver_;\n  private FunctionNameFormatter funcNameFormatter_;\n  private object sectionLock_;\n\n  private Disassembler(Machine architecture,\n                       PEBinaryInfoProvider peInfo,\n                       long baseAddress = 0,\n                       IDebugInfoProvider debugInfo = null,\n                       FunctionNameFormatter funcNameFormatter = null,\n                       SymbolNameResolverDelegate symbolNameResolver = null) {\n    peInfo_ = peInfo;\n    architecture_ = architecture;\n    baseAddress_ = baseAddress;\n    debugInfo_ = debugInfo;\n    funcNameFormatter_ = funcNameFormatter;\n    symbolNameResolver_ = symbolNameResolver;\n    sectionLock_ = new object();\n    Initialize(true);\n  }\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  public static Disassembler CreateForBinary(string binaryFilePath, IDebugInfoProvider debugInfo,\n                                             FunctionNameFormatter funcNameFormatter) {\n    var peInfo = new PEBinaryInfoProvider(binaryFilePath);\n\n    if (!peInfo.Initialize()) {\n      return null;\n    }\n\n    var binaryInfo = peInfo.BinaryFileInfo;\n    return new Disassembler(binaryInfo.Architecture, peInfo,\n                            binaryInfo.ImageBase, debugInfo, funcNameFormatter);\n  }\n\n  public static Disassembler CreateForMachine(IDebugInfoProvider debugInfo,\n                                              FunctionNameFormatter funcNameFormatter) {\n    return new Disassembler(debugInfo.Architecture.Value, null, 0, debugInfo, funcNameFormatter);\n  }\n\n  public void UseSymbolNameResolver(SymbolNameResolverDelegate symbolNameResolver) {\n    symbolNameResolver_ = symbolNameResolver;\n    checkValidCallAddress_ = false;\n  }\n\n  public string DisassembleToText(FunctionDebugInfo funcInfo) {\n    return DisassembleToText(funcInfo.StartRVA, funcInfo.Size);\n  }\n\n  public string DisassembleToText(byte[] data, long startRVA) {\n    codeSectionData_ = new List<(ReadOnlyMemory<byte> Data, long StartRVA)> {(data.AsMemory(), startRVA)};\n    string result = DisassembleToText(startRVA, data.Length);\n    codeSectionData_ = null;\n    return result;\n  }\n\n  public string DisassembleToText(long startRVA, long size) {\n    if (startRVA == 0 || size == 0) {\n      return \"\";\n    }\n\n    var builder = new StringBuilder((int)(size / 4) + 1);\n\n    try {\n      DisassembleInstructions(startRVA, size, startRVA + baseAddress_, (instr) => {\n        string addressString = $\"{instr.Address:X}:    \";\n        builder.Append(addressString);\n        int startIndex = 0;\n        bool appendBytes = false; //? TODO: Add UI option\n\n        if (appendBytes) {\n          startIndex += AppendBytes(instr, startIndex, builder);\n          builder.Append(\"  \");\n        }\n\n        AppendMnemonic(instr, builder);\n        builder.Append(\"  \");\n\n        AppendOperands(instr, startRVA, size, builder);\n        builder.AppendLine();\n\n        if (appendBytes) {\n          // For longer instructions, append up to 6 bytes per line.\n          while (startIndex < instr.Size) {\n            builder.Append(' ', addressString.Length); // Align right.\n            startIndex += AppendBytes(instr, startIndex, builder);\n            builder.AppendLine();\n          }\n        }\n      });\n    }\n    catch (Exception ex) {\n#if DEBUG\n      Trace.TraceError($\"Failed to disassemble code at RVA {startRVA}, size {size}: {ex.Message}\");\n#endif\n      return \"\";\n    }\n\n    return builder.ToString();\n  }\n\n  private void Initialize(bool checkValidCallAddress) {\n    checkValidCallAddress_ = checkValidCallAddress;\n    disasmHandle_ = Interop.Create(architecture_);\n  }\n\n  private unsafe void AppendMnemonic(Interop.Instruction instr, StringBuilder builder) {\n    byte* letterPtr = instr.Mnemonic;\n    int index = 0;\n\n    while (index < Interop.Instruction.MnemonicLength && letterPtr[index] != 0) {\n      builder.Append((char)letterPtr[index]);\n      index++;\n    }\n  }\n\n  private unsafe void AppendOperands(Interop.Instruction instr, long startRVA, long size, StringBuilder builder) {\n    bool isArm = architecture_ == Machine.Arm || architecture_ == Machine.Arm64;\n    bool isJump = false;\n    bool sawBracket = false;\n    bool lookupName = ShouldLookupAddressByName(instr, ref isJump);\n\n    byte* letterPtr = instr.Operand;\n    int index = 0;\n\n    while (index < Interop.Instruction.OperandLength && letterPtr[index] != 0) {\n      char letter = (char)letterPtr[index];\n\n      if (lookupName) {\n        // Try to replace a call target address by the function name.\n        int hexLength = 0;\n        bool skippedSharp = false;\n        long hexValue = 0;\n\n        if (letter == '[') {\n          sawBracket = true; // Reject lookups for call ptr [rip + 0xABCD] and similar.\n        }\n        else if (letter == '#' && isArm && !sawBracket) {\n          hexLength = FindHexNumber(letterPtr, index + 1, out hexValue); // Skip over #\n          skippedSharp = true;\n        }\n        else if (letter == '0' && !sawBracket) {\n          hexLength = FindHexNumber(letterPtr, index, out hexValue);\n        }\n\n        if (IsValidCallAddress(hexLength, hexValue)) {\n          long rva = hexValue - baseAddress_;\n          bool replaced = false;\n\n          // For jumps, use the name only if it's to another function.\n          if (!isJump || rva < startRVA || rva >= startRVA + size) {\n            replaced = TryAppendFunctionName(builder, rva);\n          }\n\n          if (!replaced) {\n            if (skippedSharp) builder.Append('#');\n            builder.Append($\"0x{hexValue:X}\");\n          }\n\n          index += hexLength + (skippedSharp ? 1 : 0);\n          continue;\n        }\n      }\n\n      builder.Append(letter);\n      index++;\n    }\n  }\n\n  private bool IsValidCallAddress(int hexLength, long hexValue) {\n    if (hexLength == 0) {\n      return false;\n    }\n\n    if (!checkValidCallAddress_) {\n      return true;\n    }\n\n    long rva = hexValue - baseAddress_;\n    return !FindCodeSection(rva).Data.IsEmpty;\n  }\n\n  private bool TryAppendFunctionName(StringBuilder builder, long rva) {\n    if (symbolNameResolver_ != null) {\n      string name = symbolNameResolver_(rva);\n\n      if (!string.IsNullOrEmpty(name)) {\n        builder.Append(name);\n        return true;\n      }\n\n      return false;\n    }\n\n    if (debugInfo_ != null) {\n      var func = FindFunctionByRva(rva);\n\n      if (func != null) {\n        if (funcNameFormatter_ != null) {\n          builder.Append(funcNameFormatter_(func.Name));\n        }\n        else {\n          builder.Append(func.Name);\n        }\n\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  private FunctionDebugInfo FindFunctionByRva(long rva) {\n    if (debugInfo_ != null) {\n      return debugInfo_.FindFunctionByRVA(rva);\n    }\n\n    return null;\n  }\n\n  private bool ShouldLookupAddressByName(Interop.Instruction instr, ref bool isJump) {\n    if (debugInfo_ == null && symbolNameResolver_ == null) {\n      return false;\n    }\n\n    switch (architecture_) {\n      case Machine.I386:\n      case Machine.Amd64: {\n        if (x86Opcodes.GetOpcodeInfo(instr.MnemonicString, out var info)) {\n          isJump = info.Kind == InstructionKind.Goto;\n          return info.Kind == InstructionKind.Call || isJump;\n        }\n\n        return false;\n      }\n      case Machine.Arm:\n      case Machine.Arm64: {\n        if (ARM64Opcodes.GetOpcodeInfo(instr.MnemonicString, out var info)) {\n          isJump = info.Kind == InstructionKind.Goto;\n          return info.Kind == InstructionKind.Call || isJump;\n        }\n\n        return false;\n      }\n    }\n\n    return false;\n  }\n\n  private unsafe int FindHexNumber(byte* letterPtr, int index, out long value) {\n    // Expect star with 0x and skip.\n    if (letterPtr[index] != '0' ||\n        index + 1 >= Interop.Instruction.OperandLength ||\n        !(letterPtr[index + 1] == 'x' || letterPtr[index + 1] == 'X')) {\n      value = 0;\n      return 0;\n    }\n\n    int startIndex = index;\n    index += 2;\n    value = 0;\n\n    while (index < Interop.Instruction.OperandLength && letterPtr[index] != 0) {\n      char c = (char)letterPtr[index];\n\n      if (c >= '0' && c <= '9') {\n        value = value << 4 | c - '0';\n        index++;\n      }\n      else if (c >= 'a' && c <= 'f') {\n        value = value << 4 | 10 + (c - 'a');\n        index++;\n      }\n      else if (c >= 'A' && c <= 'F') {\n        value = value << 4 | 10 + (c - 'A');\n        index++;\n      }\n      else\n        break;\n    }\n\n    int length = index - startIndex;\n    return length > 3 ? length : 0;\n  }\n\n  private unsafe int AppendBytes(Interop.Instruction instr, int startIndex, StringBuilder builder) {\n    // Append at most 6 bytes per line.\n    int count = Math.Min(6, instr.Size - startIndex);\n    byte* bytes = instr.Bytes;\n\n    switch (count) {\n      case 0: {\n        return 0;\n      }\n      case 1: {\n        builder.Append($\"{bytes[0]:X02}               \");\n        break;\n      }\n      case 2: {\n        builder.Append($\"{bytes[0]:X02} {bytes[1]:X02}            \");\n        break;\n      }\n      case 3: {\n        builder.Append($\"{bytes[0]:X02} {bytes[1]:X02} {bytes[2]:X02}         \");\n        break;\n      }\n      case 4: {\n        builder.Append($\"{bytes[0]:X02} {bytes[1]:X02} {bytes[2]:X02} {bytes[3]:X02}      \");\n        break;\n      }\n      case 5: {\n        builder.Append($\"{bytes[0]:X02} {bytes[1]:X02} {bytes[2]:X02} {bytes[3]:X02} {bytes[4]:X02}   \");\n        break;\n      }\n      case 6: {\n        builder.Append($\"{bytes[0]:X02} {bytes[1]:X02} {bytes[2]:X02} {bytes[3]:X02} {bytes[4]:X02} {bytes[5]:X02}\");\n        break;\n      }\n    }\n\n    return count;\n  }\n\n  private (ReadOnlyMemory<byte> Data, long StartRVA) FindCodeSection(long rva) {\n    // Load code section on-demand to avoid wasting time and memory\n    // for binaries that are not dot disassembled.\n    if (codeSectionData_ == null) {\n      lock (sectionLock_) {\n        if (codeSectionData_ == null) {\n          var codeSections = peInfo_.CodeSectionHeaders;\n          codeSectionData_ = new List<(ReadOnlyMemory<byte> Data, long StartRVA)>();\n\n          foreach (var section in codeSections) {\n            codeSectionData_.Add((peInfo_.GetSectionData(section), section.VirtualAddress));\n          }\n        }\n      }\n    }\n\n    foreach (var section in codeSectionData_) {\n      if (rva >= section.StartRVA && rva < section.StartRVA + section.Data.Length) {\n        return section;\n      }\n    }\n\n    return (ReadOnlyMemory<byte>.Empty, 0);\n  }\n\n  private unsafe void DisassembleInstructions(long startRVA, long size, long startAddress,\n                                              Action<Interop.Instruction> action) {\n    var codeSection = FindCodeSection(startRVA);\n\n    if (codeSection.Data.IsEmpty) {\n      Trace.WriteLine($\"Invalid disassembler RVA/size {startRVA}/{size}\");\n      return;\n    }\n\n    // Allocate a buffer for storing the instruction,\n    // gets reused during iteration.\n    using var instrBuffer = Interop.AllocateInstruction(disasmHandle_);\n    long offset = startRVA - codeSection.StartRVA;\n    using var dataBuffer = codeSection.Data.Pin();\n    IntPtr dataBufferPtr = (IntPtr)dataBuffer.Pointer;\n\n    // Disassemble the entire range of the code data buffer.\n    IntPtr dataIteratorPtr = (IntPtr)(dataBufferPtr.ToInt64() + offset);\n    IntPtr dataEndPtr = (IntPtr)(dataBufferPtr.ToInt64() + offset + size);\n\n    while (dataIteratorPtr.ToInt64() < dataEndPtr.ToInt64()) {\n      IntPtr remainingLength = (IntPtr)(dataEndPtr.ToInt64() - dataIteratorPtr.ToInt64());\n\n      // Handles one instruction at a time.\n      // dataIteratorPtr is being incremented by the native API.\n      if (Interop.Iterate(disasmHandle_, ref dataIteratorPtr, ref remainingLength, ref startAddress, instrBuffer)) {\n        IntPtr instrPtr = instrBuffer.DangerousGetHandle();\n\n        if (instrPtr == IntPtr.Zero) {\n          return;\n        }\n\n        var instruction = (Interop.Instruction)Marshal.PtrToStructure(instrPtr, typeof(Interop.Instruction));\n        action(instruction);\n      }\n      else {\n        break;\n      }\n    }\n  }\n\n  private void Dispose(bool disposing) {\n    disasmHandle_?.Dispose();\n    disasmHandle_ = null;\n    peInfo_?.Dispose();\n    peInfo_ = null;\n\n    if (disposing) {\n      GC.SuppressFinalize(this);\n    }\n  }\n\n  private static class Interop {\n    public enum Architecture {\n      Arm,\n      Arm64,\n      Mips,\n      X86,\n      PowerPc,\n      Sparc,\n      SystemZ,\n      XCore,\n      M68K,\n      Tms320C64X,\n      M680X,\n      Evm\n    }\n\n    public enum CapstoneResultCode {\n      Ok = 0,\n      OutOfMemory,\n      UnsupportedDisassembleArchitecture,\n      InvalidHandle1,\n      InvalidHandle2,\n      UnsupportedDisassembleMode,\n      InvalidOption,\n      UnsupportedInstructionDetail,\n      UninitializedMemoryManagement,\n      UnsupportedVersion,\n      UnSupportedDietModeOperation,\n      UnsupportedSkipDataModeOperation,\n      UnSupportedX86AttSyntax,\n      UnSupportedX86IntelSyntax,\n      UnSupportedX86MasmSyntax\n    }\n\n    [Flags]\n    public enum DisassembleMode {\n      LittleEndian = 0,\n      Arm = 0,\n      Bit16 = 1 << 1,\n      Bit32 = 1 << 2,\n      Bit64 = 1 << 3,\n      ArmThumb = 1 << 4,\n      ArmCortexM = 1 << 5,\n      ArmV8 = 1 << 6,\n      MipsMicro = 1 << 4,\n      Mips3 = 1 << 5,\n      Mips32R6 = 1 << 6,\n      Mips2 = 1 << 7,\n      SparcV9 = 1 << 4,\n      PowerPcQuadProcessingExtensions = 1 << 4,\n      M68K000 = 1 << 1,\n      M68K010 = 1 << 2,\n      M68K020 = 1 << 3,\n      M68K030 = 1 << 4,\n      M68K040 = 1 << 5,\n      M68K060 = 1 << 6,\n      BigEndian = 1 << 31,\n      Mips32 = Bit32,\n      Mips64 = Bit64,\n      M680X6301 = 1 << 1,\n      M680X6309 = 1 << 2,\n      M680X6800 = 1 << 3,\n      M680X6801 = 1 << 4,\n      M680X6805 = 1 << 5,\n      M680X6808 = 1 << 6,\n      M680X6809 = 1 << 7,\n      M680X6811 = 1 << 8,\n      M680XCpu12 = 1 << 9,\n      M680XHcS08 = 1 << 10\n    }\n\n    public enum DisassemblerOptionType {\n      None = 0,\n      SetSyntax,\n      SetInstructionDetails,\n      SetDisassembleMode,\n      SetMemory,\n      SetSkipData,\n      SetSkipDataConfig,\n      SetMnemonic,\n      SetUnsigned\n    }\n\n    public enum DisassemblerOptionValue {\n      Disable = 0,\n      Enable = 3,\n      UseDefaultSyntax = 0,\n      UseIntelSyntax,\n      UseAttSyntax,\n      CS_OPT_SYNTAX_NOREGNAME,\n      UseMasmSyntax\n    }\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_close\")]\n    public static extern CapstoneResultCode CloseDisassembler(ref IntPtr pDissembler);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_open\")]\n    public static extern CapstoneResultCode CreateDisassembler(Architecture architecture,\n                                                               DisassembleMode disassembleMode,\n                                                               ref IntPtr pDisassembler);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_malloc\")]\n    public static extern IntPtr CreateInstruction(DisassemblerHandle hDisassembler);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_disasm\")]\n    public static extern IntPtr Disassemble(DisassemblerHandle hDisassembler, IntPtr pCode, IntPtr codeSize,\n                                            long startingAddress, IntPtr count, ref IntPtr pInstructions);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_free\")]\n    public static extern void FreeInstructions(IntPtr pInstructions, IntPtr count);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_regs_access\")]\n    public static extern CapstoneResultCode GetAccessedRegisters(DisassemblerHandle hDisassembler,\n                                                                 InstructionHandle hInstruction, short[] readRegisters,\n                                                                 ref byte readRegistersCount, short[] writtenRegisters,\n                                                                 ref byte writtenRegistersCount);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_group_name\")]\n    public static extern IntPtr GetInstructionGroupName(DisassemblerHandle hDisassembler, int instructionGroupId);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_errno\")]\n    public static extern CapstoneResultCode GetLastErrorCode(DisassemblerHandle hDisassembler);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_reg_name\")]\n    public static extern IntPtr GetRegisterName(DisassemblerHandle hDisassembler, int registerId);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_version\")]\n    public static extern int GetVersion(ref int majorVersion, ref int minorVersion);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_disasm_iter\")]\n    [return: MarshalAs(UnmanagedType.I1)]\n    public static extern bool Iterate(DisassemblerHandle hDisassembler, ref IntPtr pCode, ref IntPtr codeSize,\n                                      ref long address, InstructionHandle hInstruction);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"kernel32.dll\", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Ansi,\n               EntryPoint = \"LoadLibraryA\", SetLastError = true)]\n    public static extern IntPtr LoadLibrary(string libraryFilePath);\n\n    [SuppressUnmanagedCodeSecurity]\n    [DllImport(\"capstone.dll\", CallingConvention = CallingConvention.Cdecl, EntryPoint = \"cs_option\")]\n    public static extern CapstoneResultCode SetDisassemblerOption(DisassemblerHandle hDisassembler,\n                                                                  DisassemblerOptionType optionType,\n                                                                  IntPtr optionValue);\n\n    public static DisassemblerHandle Create(Architecture architecture, DisassembleMode mode) {\n      IntPtr disasmPtr = IntPtr.Zero;\n      var resultCode = CreateDisassembler(architecture, mode, ref disasmPtr);\n\n      if (resultCode == CapstoneResultCode.Ok) {\n        var handle = new DisassemblerHandle(disasmPtr);\n        //SetDisassemblerOption(handle, DisassemblerOptionType.SetSkipData, (IntPtr)DisassemblerOptionValue.Enable);\n        return handle;\n      }\n\n      Trace.WriteLine($\"Failed to create Capstone disassembler: {resultCode}\");\n      return null;\n    }\n\n    public static DisassemblerHandle Create(Machine architecture) {\n      return architecture switch {\n        Machine.I386  => Create(Architecture.X86, DisassembleMode.Bit32),\n        Machine.Amd64 => Create(Architecture.X86, DisassembleMode.Bit64),\n        Machine.Arm   => Create(Architecture.Arm, DisassembleMode.Arm),\n        Machine.Arm64 => Create(Architecture.Arm64, DisassembleMode.Arm),\n        _             => throw new NotSupportedException(\"Unsupported architecture!\")\n      };\n    }\n\n    public static InstructionHandle AllocateInstruction(DisassemblerHandle handle) {\n      return new InstructionHandle(CreateInstruction(handle));\n    }\n\n    // Must be kept in sync with the definition of cs_insn from Capstone.\n    [StructLayout(LayoutKind.Explicit, Size = 256)]\n    public unsafe struct Instruction {\n      public const int MnemonicLength = 32;\n      public const int OperandLength = 160;\n      [FieldOffset(0)]\n      public int Id;\n      [FieldOffset(8)]\n      public long AliasId;\n      [FieldOffset(16)]\n      public long Address;\n      [FieldOffset(24)]\n      public short Size;\n      [FieldOffset(26)]\n      public fixed byte Bytes[24];\n      [FieldOffset(50)]\n      public fixed byte Mnemonic[32];\n      [FieldOffset(82)]\n      public fixed byte Operand[160];\n      [FieldOffset(242)]\n      public bool IsAlias;\n      [FieldOffset(243)]\n      public bool UsesAliasDetails;\n      [FieldOffset(248)]\n      public IntPtr Details;\n\n      public byte[] BytesArray {\n        get {\n          fixed (byte* pinned = Bytes) {\n            byte[] bytes = new byte[Size];\n            Marshal.Copy((IntPtr)pinned, bytes, 0, Size);\n            return bytes;\n          }\n        }\n      }\n\n      public string MnemonicString {\n        get {\n          fixed (byte* pinned = Mnemonic) {\n            return Marshal.PtrToStringAnsi((IntPtr)pinned);\n          }\n        }\n      }\n\n      public string OperandString {\n        get {\n          fixed (byte* pinned = Operand) {\n            return Marshal.PtrToStringAnsi((IntPtr)pinned);\n          }\n        }\n      }\n    }\n\n    public class DisassemblerHandle : SafeHandleMinusOneIsInvalid {\n      public DisassemblerHandle(IntPtr pDisassembler) : base(true) {\n        handle = pDisassembler;\n      }\n\n      protected override bool ReleaseHandle() {\n        var resultCode = CloseDisassembler(ref handle);\n        handle = IntPtr.Zero;\n        return resultCode == CapstoneResultCode.Ok;\n      }\n    }\n\n    public class InstructionHandle : SafeHandleZeroOrMinusOneIsInvalid {\n      public InstructionHandle(IntPtr pInstruction) : base(true) {\n        handle = pInstruction;\n      }\n\n      protected override bool ReleaseHandle() {\n        FreeInstructions(handle, 1);\n        handle = IntPtr.Zero;\n        return true;\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/DotNetDebugInfoProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection.PortableExecutable;\nusing Microsoft.Diagnostics.Symbols;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Binary;\n\n//? Provider ASM should return instance instead of JSONDebug\npublic class DotNetDebugInfoProvider : IDebugInfoProvider {\n  private Dictionary<string, FunctionDebugInfo> functionMap_;\n  private List<FunctionDebugInfo> functions_;\n  private Machine architecture_;\n  private Dictionary<FunctionDebugInfo, List<(int ILOffset, int NativeOffset)>> methodILNativeMap_;\n  private Dictionary<long, MethodCode> methodCodeMap_;\n  private bool hasManagedSymbolFileFailure_;\n\n  public DotNetDebugInfoProvider(Machine architecture) {\n    architecture_ = architecture;\n    functionMap_ = new Dictionary<string, FunctionDebugInfo>();\n    functions_ = new List<FunctionDebugInfo>();\n    methodILNativeMap_ = new Dictionary<FunctionDebugInfo, List<(int ILOffset, int NativeOffset)>>();\n  }\n\n  public SymbolFileDescriptor ManagedSymbolFile { get; set; }\n  public string ManagedAsmFilePath { get; set; }\n  public Machine? Architecture => architecture_;\n  public SymbolFileSourceSettings SymbolSettings { get; set; }\n\n  public bool AnnotateSourceLocations(FunctionIR function, IRTextFunction textFunc) {\n    return AnnotateSourceLocations(function, textFunc.Name);\n  }\n\n  public bool AnnotateSourceLocations(FunctionIR function,\n                                      FunctionDebugInfo funcInfo) {\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n\n    if (metadataTag == null) {\n      return false;\n    }\n\n    if (!EnsureHasSourceLines(funcInfo)) {\n      return false;\n    }\n\n    foreach (var pair in metadataTag.OffsetToElementMap) {\n      var lineInfo = funcInfo.FindNearestLine(pair.Key);\n\n      if (!lineInfo.IsUnknown) {\n        var locationTag = pair.Value.GetOrAddTag<SourceLocationTag>();\n        locationTag.Reset(); // Tag may be already populated.\n        locationTag.Line = lineInfo.Line;\n        locationTag.Column = lineInfo.Column;\n      }\n    }\n\n    return true;\n  }\n\n  public FunctionDebugInfo FindFunction(string functionName) {\n    return functionMap_.GetValueOr(functionName, FunctionDebugInfo.Unknown);\n  }\n\n  public IEnumerable<FunctionDebugInfo> EnumerateFunctions() {\n    return functions_;\n  }\n\n  public List<FunctionDebugInfo> GetSortedFunctions() {\n    return functions_;\n  }\n\n  public FunctionDebugInfo FindFunctionByRVA(long rva) {\n    return FunctionDebugInfo.BinarySearch(functions_, rva);\n  }\n\n  public SourceFileDebugInfo FindFunctionSourceFilePath(IRTextFunction textFunc) {\n    return FindFunctionSourceFilePath(textFunc.Name);\n  }\n\n  public SourceFileDebugInfo FindFunctionSourceFilePath(string functionName) {\n    if (functionMap_.TryGetValue(functionName, out var funcInfo)) {\n      return GetSourceFileInfo(funcInfo);\n    }\n\n    return SourceFileDebugInfo.Unknown;\n  }\n\n  public SourceFileDebugInfo FindSourceFilePathByRVA(long rva) {\n    var funcInfo = FindFunctionByRVA(rva);\n\n    if (EnsureHasSourceLines(funcInfo)) {\n      return GetSourceFileInfo(funcInfo);\n    }\n\n    return SourceFileDebugInfo.Unknown;\n  }\n\n  public SourceLineDebugInfo FindSourceLineByRVA(long rva, bool includeInlinees) {\n    var funcInfo = FindFunctionByRVA(rva);\n\n    if (EnsureHasSourceLines(funcInfo)) {\n      long offset = rva - funcInfo.StartRVA;\n      return funcInfo.FindNearestLine(offset);\n    }\n\n    return SourceLineDebugInfo.Unknown;\n  }\n\n  public void Unload() {\n  }\n\n  public bool LoadDebugInfo(DebugFileSearchResult debugFile, IDebugInfoProvider other = null) {\n    return true;\n  }\n\n  public void Dispose() {\n  }\n\n  public bool PopulateSourceLines(FunctionDebugInfo funcInfo) {\n    return true;\n  }\n\n  public void UpdateArchitecture(Machine architecture) {\n    if (architecture_ == Machine.Unknown) {\n      architecture_ = architecture;\n    }\n  }\n\n  public MethodCode FindMethodCode(FunctionDebugInfo funcInfo) {\n    return methodCodeMap_?.GetValueOrNull(funcInfo.RVA);\n  }\n\n  public void AddFunctionInfo(FunctionDebugInfo funcInfo) {\n    functions_.Add(funcInfo);\n    functionMap_[funcInfo.Name] = funcInfo;\n  }\n\n  public void AddMethodILToNativeMap(FunctionDebugInfo functionDebugInfo,\n                                     List<(int ILOffset, int NativeOffset)> ilOffsets) {\n    methodILNativeMap_[functionDebugInfo] = ilOffsets;\n  }\n\n  public void LoadingCompleted() {\n    functions_.Sort();\n  }\n\n  public void AddMethodCode(long codeAddress, MethodCode code) {\n    methodCodeMap_ ??= new Dictionary<long, MethodCode>();\n    methodCodeMap_[codeAddress] = code;\n  }\n\n  public bool AnnotateSourceLocations(FunctionIR function, string functionName) {\n    var funcInfo = FindFunction(functionName);\n\n    if (funcInfo == null) {\n      return false;\n    }\n\n    return AnnotateSourceLocations(function, funcInfo);\n  }\n\n  public bool LoadDebugInfo(string debugFilePath, IDebugInfoProvider other = null) {\n    return true;\n  }\n\n  private bool EnsureHasSourceLines(FunctionDebugInfo functionDebugInfo) {\n    if (functionDebugInfo == null || functionDebugInfo.IsUnknown) {\n      return false;\n    }\n\n    if (functionDebugInfo.HasSourceLines) {\n      return true; // Already populated.\n    }\n\n    if (ManagedSymbolFile == null || hasManagedSymbolFileFailure_) {\n      return false; // Previous attempt failed.\n    }\n\n    // Locate the managed debug file.\n    var options = SymbolSettings != null ? SymbolSettings : CoreSettingsProvider.SymbolSettings;\n\n    if (File.Exists(ManagedSymbolFile.FileName)) {\n      options.InsertSymbolPath(ManagedSymbolFile.FileName);\n    }\n\n    string symbolSearchPath = PDBDebugInfoProvider.ConstructSymbolSearchPath(options);\n\n    using var logWriter = new StringWriter();\n    using var symbolReader = new SymbolReader(logWriter, symbolSearchPath);\n    symbolReader.SecurityCheck += s => true; // Allow symbols from \"unsafe\" locations.\n    string debugFile =\n      symbolReader.FindSymbolFilePath(ManagedSymbolFile.FileName, ManagedSymbolFile.Id, ManagedSymbolFile.Age);\n\n    Trace.WriteLine($\">> TraceEvent FindSymbolFilePath for {ManagedSymbolFile.FileName}: {debugFile}\");\n    Trace.IndentLevel = 1;\n    Trace.WriteLine(logWriter.ToString());\n    Trace.IndentLevel = 0;\n    Trace.WriteLine(\"<< TraceEvent\");\n\n    if (!File.Exists(debugFile)) {\n      // Don't try again if PDB not found.\n      hasManagedSymbolFileFailure_ = true;\n      return false;\n    }\n\n    lock (functionDebugInfo) {\n      if (!methodILNativeMap_.TryGetValue(functionDebugInfo, out var ilOffsets)) {\n        return false;\n      }\n\n      try {\n        var pdb = symbolReader.OpenSymbolFile(debugFile);\n\n        if (pdb == null) {\n          hasManagedSymbolFileFailure_ = true;\n          return false;\n        }\n\n        // Find the source lines and native code offset mapping for each IL offset.\n        foreach (var pair in ilOffsets) {\n          var sourceLoc = pdb.SourceLocationForManagedCode((uint)functionDebugInfo.Id, pair.ILOffset);\n\n          if (sourceLoc != null) {\n            if (sourceLoc.SourceFile != null && functionDebugInfo.SourceFileName == null) {\n              functionDebugInfo.SourceFileName = sourceLoc.SourceFile.GetSourceFile();\n              functionDebugInfo.OriginalSourceFileName ??= sourceLoc.SourceFile.BuildTimeFilePath;\n            }\n\n            //? TODO: Remove SourceFileName from SourceLineDebugInfo\n            var lineInfo = new SourceLineDebugInfo(pair.NativeOffset, sourceLoc.LineNumber,\n                                                   sourceLoc.ColumnNumber, functionDebugInfo.SourceFileName);\n            functionDebugInfo.AddSourceLine(lineInfo);\n          }\n        }\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to read managed PDB from {debugFile}: {ex.Message}\\n{ex.StackTrace}\");\n        hasManagedSymbolFileFailure_ = true;\n      }\n\n      return functionDebugInfo.HasSourceLines;\n    }\n  }\n\n  private SourceFileDebugInfo GetSourceFileInfo(FunctionDebugInfo info) {\n    return new SourceFileDebugInfo(info.SourceFileName,\n                                   info.OriginalSourceFileName,\n                                   info.FirstSourceLine.Line);\n  }\n\n  public struct AddressNamePair {\n    public long Address { get; set; }\n    public string Name { get; set; }\n\n    public AddressNamePair(long address, string name) {\n      Address = address;\n      Name = name;\n    }\n  }\n\n  public class MethodCode {\n    public MethodCode(long address, int size, byte[] code) {\n      Address = address;\n      Size = size;\n      Code = code;\n      CallTargets = new List<AddressNamePair>();\n    }\n\n    public long Address { get; set; }\n    public int Size { get; set; }\n    public byte[] Code { get; set; }\n    public List<AddressNamePair> CallTargets { get; set; }\n\n    public string FindCallTarget(long address) {\n      //? TODO: Map\n\n      int index = CallTargets.FindIndex(item => item.Address == address);\n\n      if (index != -1) {\n        return CallTargets[index].Name;\n      }\n\n      return null;\n    }\n  }\n\n  private class ManagedProcessCode {\n    public int ProcessId { get; set; }\n    public int MachineType { get; set; }\n    public List<MethodCode> Methods { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/FunctionDebugInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Binary;\n\n[ProtoContract(SkipConstructor = true)]\npublic class FunctionDebugInfo : IEquatable<FunctionDebugInfo>, IComparable<FunctionDebugInfo>, IComparable<long> {\n  public static readonly FunctionDebugInfo Unknown = new(null, 0, 0);\n\n  public FunctionDebugInfo(string name, long rva, uint size, short optLevel = 0, int id = -1, short auxId = -1) {\n    // Note that string interning is not done here on purpose because\n    // it is often the slowest part in processing a trace, while the memory\n    // saving are quite small (under 15%, a few dozen MBs even for big traces).\n    Name = name;\n    RVA = rva;\n    Size = size;\n    OptimizationLevel = optLevel;\n    SourceLines = null;\n    Id = id;\n    AuxiliaryId = auxId;\n  }\n\n  [ProtoMember(1)]\n  public long Id { get; set; } // Used for MethodToken in managed code.\n  [ProtoMember(2)]\n  public string Name { get; set; }\n  [ProtoMember(3)]\n  public List<SourceLineDebugInfo> SourceLines { get; set; }\n  [ProtoMember(4)]\n  public long AuxiliaryId { get; set; } // Used for RejitID in managed code.\n  [ProtoMember(5)]\n  public long RVA { get; set; }\n  [ProtoMember(6)]\n  public uint Size { get; set; }\n  [ProtoMember(7)]\n  public short OptimizationLevel { get; set; } // Used for OptimizationTier in managed code.\n  public bool HasSourceLines => SourceLines is {Count: > 0};\n  public SourceLineDebugInfo FirstSourceLine => HasSourceLines ?\n    SourceLines[0] : SourceLineDebugInfo.Unknown;\n  public SourceLineDebugInfo LastSourceLine => HasSourceLines ?\n    SourceLines[^1] : SourceLineDebugInfo.Unknown;\n\n  //? TODO: Remove SourceFileName from SourceLineDebugInfo\n  public string SourceFileName { get; set; }\n  public string OriginalSourceFileName { get; set; }\n  public long StartRVA => RVA;\n  public long EndRVA => RVA + Size - 1;\n  public bool IsUnknown => RVA == 0 && Size == 0;\n\n  public int CompareTo(FunctionDebugInfo other) {\n    // Userd by sorting.\n    if (other == null) return 0;\n\n    if (other.StartRVA < StartRVA) {\n      return 1;\n    }\n\n    if (other.StartRVA > StartRVA) {\n      return -1;\n    }\n\n    return 0;\n  }\n\n  public int CompareTo(long value) {\n    // Used by binary search.\n    if (value < StartRVA) {\n      return 1;\n    }\n\n    if (value > EndRVA) {\n      return -1;\n    }\n\n    return 0;\n  }\n\n  public bool Equals(FunctionDebugInfo other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return RVA == other.RVA &&\n           Size == other.Size &&\n           Id == other.Id &&\n           AuxiliaryId == other.AuxiliaryId;\n  }\n\n  public static FunctionDebugInfo BinarySearch(List<FunctionDebugInfo> ranges, long value,\n                                               bool hasOverlappingFuncts = false) {\n    int low = 0;\n    int high = ranges.Count - 1;\n\n    while (low <= high) {\n      int mid = low + (high - low) / 2;\n      var range = ranges[mid];\n      int result = range.CompareTo(value);\n\n      if (result == 0) {\n        // With code written in assembly, it's possible to have overlapping functions\n        // (or rather, one function with multiple entry points). In such a case,\n        // pick the outer function that contains the given RVA.\n        // |F1------------------|--\n        // -----|F2----|-----------\n        // ----------------|F3|----\n        // If the RVA is inside F2 or F3, pick F1 instead since it covers the whole range.\n        if (hasOverlappingFuncts) {\n          int count = 0;\n\n          while (--mid >= 0 && count++ < 10) {\n            var otherRange = ranges[mid];\n\n            if (otherRange.CompareTo(value) == 0 &&\n                (otherRange.StartRVA != range.StartRVA ||\n                 otherRange.Size > range.Size)) {\n              return otherRange;\n            }\n          }\n        }\n\n        return range;\n      }\n\n      if (result < 0) {\n        low = mid + 1;\n      }\n      else {\n        high = mid - 1;\n      }\n    }\n\n    return null;\n  }\n\n  public void AddSourceLine(SourceLineDebugInfo sourceLine) {\n    SourceLines ??= new List<SourceLineDebugInfo>(1);\n    SourceLines.Add(sourceLine);\n  }\n\n  public SourceLineDebugInfo FindNearestLine(long offset) {\n    if (!HasSourceLines) {\n      return SourceLineDebugInfo.Unknown;\n    }\n\n    if (offset < SourceLines[0].OffsetStart) {\n      return SourceLineDebugInfo.Unknown;\n    }\n\n    // Find line mapped to same offset or nearest smaller offset.\n    int low = 0;\n    int high = SourceLines.Count - 1;\n\n    while (low <= high) {\n      int middle = low + (high - low) / 2;\n\n      if (SourceLines[middle].OffsetStart == offset) {\n        return SourceLines[middle];\n      }\n\n      if (SourceLines[middle].OffsetStart > offset) {\n        high = middle - 1;\n      }\n      else {\n        low = middle + 1;\n      }\n    }\n\n    return SourceLines[high];\n  }\n\n  public override bool Equals(object obj) {\n    return obj is FunctionDebugInfo info && Equals(info);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(RVA, Size, Id);\n  }\n\n  public override string ToString() {\n    return $\"{Name}, RVA: {RVA:X}, Size: {Size}, Id: {Id}, AuxId: {AuxiliaryId}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/IBinaryInfoProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Reflection.PortableExecutable;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Binary;\n\npublic enum BinaryFileKind {\n  Native,\n  DotNet,\n  DotNetR2R\n}\n\npublic interface IBinaryInfoProvider {\n  SymbolFileDescriptor SymbolFileInfo { get; }\n  BinaryFileDescriptor BinaryFileInfo { get; }\n  //? TODO: Add finding of binary here\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class BinaryFileDescriptor : IEquatable<BinaryFileDescriptor> {\n  [ProtoMember(1)]\n  public string ImageName { get; set; }\n  [ProtoMember(2)]\n  public string ImagePath { get; set; }\n  [ProtoMember(3)]\n  public Machine Architecture { get; set; }\n  [ProtoMember(4)]\n  public BinaryFileKind FileKind { get; set; }\n  [ProtoMember(5)]\n  public long Checksum { get; set; }\n  [ProtoMember(6)]\n  public int TimeStamp { get; set; }\n  [ProtoMember(7)]\n  public long ImageSize { get; set; }\n  [ProtoMember(8)]\n  public long CodeSize { get; set; }\n  [ProtoMember(9)]\n  public long ImageBase { get; set; }\n  [ProtoMember(10)]\n  public long BaseOfCode { get; set; }\n  [ProtoMember(11)]\n  public int MajorVersion { get; set; }\n  [ProtoMember(12)]\n  public int MinorVersion { get; set; }\n  public bool IsNativeImage => FileKind == BinaryFileKind.Native;\n  public bool IsManagedImage => FileKind == BinaryFileKind.DotNet ||\n                                FileKind == BinaryFileKind.DotNetR2R;\n\n  public bool Equals(BinaryFileDescriptor other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return ImageName.Equals(other.ImageName, StringComparison.OrdinalIgnoreCase) &&\n           TimeStamp == other.TimeStamp &&\n           ImageSize == other.ImageSize;\n  }\n\n  public static bool operator ==(BinaryFileDescriptor left, BinaryFileDescriptor right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(BinaryFileDescriptor left, BinaryFileDescriptor right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((BinaryFileDescriptor)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(ImageName.GetHashCode(StringComparison.OrdinalIgnoreCase), TimeStamp, ImageSize);\n  }\n\n  public override string ToString() {\n    return $\"{ImageName}, Version: {MajorVersion}.{MinorVersion}, TimeStamp: {TimeStamp}, ImageSze: {ImageSize}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/IDebugInfoProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection.PortableExecutable;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Binary;\n\npublic interface IDebugInfoProvider : IDisposable {\n  public Machine? Architecture { get; }\n  public SymbolFileSourceSettings SymbolSettings { get; set; }\n\n  //bool LoadDebugInfo(string debugFilePath, IDebugInfoProvider other = null);\n  bool LoadDebugInfo(DebugFileSearchResult debugFile, IDebugInfoProvider other = null);\n  void Unload();\n  bool AnnotateSourceLocations(FunctionIR function, IRTextFunction textFunc);\n  bool AnnotateSourceLocations(FunctionIR function, FunctionDebugInfo funcDebugInfo);\n  IEnumerable<FunctionDebugInfo> EnumerateFunctions();\n  List<FunctionDebugInfo> GetSortedFunctions();\n  FunctionDebugInfo FindFunction(string functionName);\n  FunctionDebugInfo FindFunctionByRVA(long rva);\n  bool PopulateSourceLines(FunctionDebugInfo funcInfo);\n  SourceFileDebugInfo FindFunctionSourceFilePath(IRTextFunction textFunc);\n  SourceFileDebugInfo FindFunctionSourceFilePath(string functionName);\n  SourceFileDebugInfo FindSourceFilePathByRVA(long rva);\n  SourceLineDebugInfo FindSourceLineByRVA(long rva, bool includeInlinees = false);\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class SymbolFileDescriptor : IEquatable<SymbolFileDescriptor> {\n  public SymbolFileDescriptor(string fileName, Guid id, int age) {\n    FileName = fileName != null ? string.Intern(fileName) : null;\n    Id = id;\n    Age = age;\n  }\n\n  public SymbolFileDescriptor(string fileName) {\n    FileName = fileName != null ? string.Intern(fileName) : null;\n  }\n\n  [ProtoMember(1)]\n  public string FileName { get; set; }\n  [ProtoMember(2)]\n  public Guid Id { get; set; }\n  [ProtoMember(3)]\n  public int Age { get; set; }\n  public string SymbolName => Utils.TryGetFileName(FileName);\n\n  public bool Equals(SymbolFileDescriptor other) {\n    return FileName.Equals(other.FileName, StringComparison.OrdinalIgnoreCase) &&\n           Id == other.Id &&\n           Age == other.Age;\n  }\n\n  public static bool operator ==(SymbolFileDescriptor left, SymbolFileDescriptor right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(SymbolFileDescriptor left, SymbolFileDescriptor right) {\n    return !Equals(left, right);\n  }\n\n  public override string ToString() {\n    return $\"{Id}:{FileName}\";\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((SymbolFileDescriptor)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(FileName.GetHashCode(StringComparison.OrdinalIgnoreCase), Id, Age);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/JsonDebugInfoProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Reflection.PortableExecutable;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Binary;\n\npublic class JsonDebugInfoProvider : IDebugInfoProvider {\n  private Dictionary<string, FunctionDebugInfo> functionMap_;\n  private List<FunctionDebugInfo> functions_;\n  public Machine? Architecture => null;\n  public SymbolFileSourceSettings SymbolSettings { get; set; }\n\n  public bool AnnotateSourceLocations(FunctionIR function, IRTextFunction textFunc) {\n    return AnnotateSourceLocations(function, textFunc.Name);\n  }\n\n  public bool AnnotateSourceLocations(FunctionIR function,\n                                      FunctionDebugInfo funcInfo) {\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n\n    if (metadataTag == null) {\n      return false;\n    }\n\n    if (!funcInfo.HasSourceLines) {\n      return false;\n    }\n\n    foreach (var pair in metadataTag.OffsetToElementMap) {\n      var lineInfo = funcInfo.FindNearestLine(pair.Key);\n\n      if (!lineInfo.IsUnknown) {\n        var locationTag = pair.Value.GetOrAddTag<SourceLocationTag>();\n        locationTag.Reset(); // Tag may be already populated.\n        locationTag.Line = lineInfo.Line;\n        locationTag.Column = lineInfo.Column;\n      }\n    }\n\n    return true;\n  }\n\n  public FunctionDebugInfo FindFunction(string functionName) {\n    return functionMap_.GetValueOr(functionName, FunctionDebugInfo.Unknown);\n  }\n\n  public IEnumerable<FunctionDebugInfo> EnumerateFunctions() {\n    return functions_;\n  }\n\n  public List<FunctionDebugInfo> GetSortedFunctions() {\n    return functions_;\n  }\n\n  public FunctionDebugInfo FindFunctionByRVA(long rva) {\n    return FunctionDebugInfo.BinarySearch(functions_, rva);\n  }\n\n  public SourceFileDebugInfo FindFunctionSourceFilePath(IRTextFunction textFunc) {\n    return FindFunctionSourceFilePath(textFunc.Name);\n  }\n\n  public SourceFileDebugInfo FindFunctionSourceFilePath(string functionName) {\n    if (functionMap_.TryGetValue(functionName, out var funcInfo)) {\n      return GetSourceFileInfo(funcInfo);\n    }\n\n    return SourceFileDebugInfo.Unknown;\n  }\n\n  public SourceFileDebugInfo FindSourceFilePathByRVA(long rva) {\n    var funcInfo = FindFunctionByRVA(rva);\n\n    if (funcInfo != null && funcInfo.HasSourceLines) {\n      return GetSourceFileInfo(funcInfo);\n    }\n\n    return SourceFileDebugInfo.Unknown;\n  }\n\n  public SourceLineDebugInfo FindSourceLineByRVA(long rva, bool includeInlinees) {\n    var funcInfo = FindFunctionByRVA(rva);\n\n    if (funcInfo != null && funcInfo.HasSourceLines) {\n      long offset = rva - funcInfo.StartRVA;\n      return funcInfo.FindNearestLine(offset);\n    }\n\n    return SourceLineDebugInfo.Unknown;\n  }\n\n  public bool LoadDebugInfo(DebugFileSearchResult debugFile, IDebugInfoProvider other = null) {\n    if (!debugFile.Found) {\n      return false;\n    }\n\n    return LoadDebugInfo(debugFile);\n  }\n\n  public bool PopulateSourceLines(FunctionDebugInfo funcInfo) {\n    return true;\n  }\n\n  public void Unload() {\n  }\n\n  public void Dispose() {\n  }\n\n  private static SourceFileDebugInfo GetSourceFileInfo(FunctionDebugInfo info) {\n    return new SourceFileDebugInfo(info.FirstSourceLine.FilePath,\n                                   info.FirstSourceLine.FilePath,\n                                   info.FirstSourceLine.Line);\n  }\n\n  public bool AnnotateSourceLocations(FunctionIR function, string functionName) {\n    var funcInfo = FindFunction(functionName);\n\n    if (funcInfo == null) {\n      return false;\n    }\n\n    return AnnotateSourceLocations(function, funcInfo);\n  }\n\n  public bool LoadDebugInfo(string debugFilePath, IDebugInfoProvider other = null) {\n    if (!JsonUtils.DeserializeFromFile(debugFilePath, out functions_)) {\n      return false;\n    }\n\n    functions_.Sort();\n    functionMap_ = new Dictionary<string, FunctionDebugInfo>(functions_.Count);\n\n    foreach (var func in functions_) {\n      functionMap_[func.Name] = func;\n    }\n\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/PDBDebugInfoProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection.PortableExecutable;\nusing System.Runtime.InteropServices;\nusing System.Security.Cryptography;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Azure.Core;\nusing Azure.Identity;\nusing Dia2Lib;\nusing Microsoft.Diagnostics.Symbols;\nusing Microsoft.Diagnostics.Symbols.Authentication;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\nusing StringWriter = System.IO.StringWriter;\n\nnamespace ProfileExplorer.Core.Binary;\n\npublic sealed class PDBDebugInfoProvider : IDebugInfoProvider {\n  private const int MaxDemangledFunctionNameLength = 8192;\n  private const int FunctionCacheMissThreshold = 100;\n  private const int MaxLogEntryLength = 10240;\n\n  private static ConcurrentDictionary<SymbolFileDescriptor, DebugFileSearchResult> resolvedSymbolsCache_ = new();\n  private static readonly StringWriter authLogWriter_;\n  private static readonly SymwebHandler authSymwebHandler_;\n  private static readonly AzureDevOpsSourceHandler authAzDevOpsHandler_;\n  private static readonly string authRecordPath_ = Path.Combine(Path.GetTempPath(), \"ProfileExplorer\", \"auth_record.bin\");\n  private static object undecorateLock_ = new(); // Global lock for undname.\n  private ConcurrentDictionary<long, SourceFileDebugInfo> sourceFileByRvaCache_ = new();\n  private ConcurrentDictionary<string, SourceFileDebugInfo> sourceFileByNameCache_ = new();\n  private ConcurrentDictionary<uint, List<SourceStackFrame>> inlineeByRvaCache_ = new();\n  private ConcurrentDictionary<long, bool> loggedRvas_ = new();\n  private object cacheLock_ = new();\n  private SymbolFileDescriptor symbolFile_;\n  private SymbolFileSourceSettings settings_;\n  private SymbolFileCache symbolCache_;\n  private SymbolReader symbolReader_;\n  private StringWriter symbolReaderLog_;\n  private NativeSymbolModule symbolReaderPDB_;\n  private string debugFilePath_;\n  private IDiaDataSource diaSource_;\n  private IDiaSession session_;\n  private IDiaSymbol globalSymbol_;\n  private List<FunctionDebugInfo> sortedFuncList_;\n  private bool sortedFuncListOverlapping_;\n  private volatile int funcCacheMisses_;\n  private bool loadFailed_;\n  private bool disposed_;\n  private bool hasSourceInfo_;\n\n  // Static error tracking for DIA SDK registration issues\n  private static bool diaRegistrationFailed_;\n  private static string diaRegistrationError_;\n\n  /// <summary>\n  /// Returns true if DIA SDK (msdia140.dll) failed to load due to COM registration issues.\n  /// </summary>\n  public static bool HasDiaRegistrationError => diaRegistrationFailed_;\n\n  /// <summary>\n  /// Gets the DIA registration error message with instructions to fix.\n  /// </summary>\n  public static string DiaRegistrationError => diaRegistrationError_;\n\n  static PDBDebugInfoProvider() {\n    // Create a single instance of the Symweb handler so that\n    // when concurrent requests are made and login must be done,\n    // the login page is displayed a single time, with other requests waiting for a token.\n\n    // DefaultAzureCredential is not allowed per SFI. Mimic behavior while continuing\n    // to exclude the managed identity credential.\n    // NOTE: ChainedTokenCredential only falls through on CredentialUnavailableException.\n    // Other exceptions (like \"needs re-authentication\") stop the chain. We wrap each\n    // credential to catch auth failures and convert them to CredentialUnavailableException\n    // so the chain continues to InteractiveBrowserCredential which prompts the user.\n\n    // Enable token cache persistence for browser credential so tokens survive process restarts.\n    // Additionally, load existing AuthenticationRecord for true silent auth across sessions.\n    // This prevents re-authentication on every trace load if VS credential fails.\n    var authRecord = LoadAuthenticationRecord();\n    var browserCredentialOptions = new InteractiveBrowserCredentialOptions {\n      TokenCachePersistenceOptions = new TokenCachePersistenceOptions {\n        Name = \"ProfileExplorer\" // Unique cache name for this app\n      },\n      AuthenticationRecord = authRecord // Enable silent auth with cached identity\n    };\n\n    TokenCredential browserCredential = new InteractiveBrowserCredential(browserCredentialOptions);\n\n    // If no auth record exists yet, the user will be prompted on first symbol download.\n    // After first successful auth, capture and save the AuthenticationRecord for future sessions.\n    if (authRecord == null) {\n      browserCredential = new CaptureAuthRecordCredential((InteractiveBrowserCredential)browserCredential);\n    }\n\n    var credentials = new List<TokenCredential>\n    {\n      WrapCredential(new EnvironmentCredential()),\n      WrapCredential(new WorkloadIdentityCredential()),\n      WrapCredential(new SharedTokenCacheCredential()),\n      WrapCredential(new VisualStudioCredential()),\n      WrapCredential(new AzureCliCredential()),\n      WrapCredential(new AzurePowerShellCredential()),\n      WrapCredential(new AzureDeveloperCliCredential()),\n      browserCredential // Don't wrap - final fallback should show errors\n    };\n\n    var authCredential = new ChainedTokenCredential(credentials.ToArray());\n\n    authLogWriter_ = new StringWriter();\n    authSymwebHandler_ = new SymwebHandler(authLogWriter_, authCredential);\n    authAzDevOpsHandler_ = new AzureDevOpsSourceHandler(authLogWriter_, authCredential);\n  }\n\n  /// <summary>\n  /// Wraps a credential to catch authentication failures and convert them to\n  /// CredentialUnavailableException so ChainedTokenCredential continues to the next credential.\n  /// </summary>\n  private static TokenCredential WrapCredential(TokenCredential inner) {\n    return new FallbackTokenCredential(inner);\n  }\n\n  /// <summary>\n  /// Loads a previously saved AuthenticationRecord from disk for silent authentication.\n  /// Returns null if no saved record exists or if loading fails.\n  /// </summary>\n  internal static AuthenticationRecord LoadAuthenticationRecord() {\n    try {\n      if (File.Exists(authRecordPath_)) {\n        using var stream = File.OpenRead(authRecordPath_);\n        var record = AuthenticationRecord.Deserialize(stream);\n        Trace.WriteLine($\"[Auth] Loaded cached authentication record from {authRecordPath_}\");\n        return record;\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"[Auth] Failed to load authentication record: {ex.Message}\");\n    }\n    return null;\n  }\n\n  /// <summary>\n  /// Saves an AuthenticationRecord to disk for reuse across sessions.\n  /// This enables silent authentication without repeated browser prompts.\n  /// </summary>\n  internal static void SaveAuthenticationRecord(AuthenticationRecord record) {\n    if (record == null) {\n      return;\n    }\n\n    try {\n      string directory = Path.GetDirectoryName(authRecordPath_);\n      Directory.CreateDirectory(directory);\n\n      using var stream = File.Create(authRecordPath_);\n      record.Serialize(stream);\n      Trace.WriteLine($\"[Auth] Saved authentication record to {authRecordPath_} - future sessions will use silent auth\");\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"[Auth] Failed to save authentication record: {ex.Message}\");\n    }\n  }\n\n  public PDBDebugInfoProvider(SymbolFileSourceSettings settings) {\n    settings_ = settings;\n  }\n\n  public SymbolFileSourceSettings SymbolSettings { get; set; }\n  public Machine? Architecture => null;\n\n  public bool LoadDebugInfo(DebugFileSearchResult debugFile, IDebugInfoProvider other = null) {\n    if (debugFile == null || !debugFile.Found) {\n      return false;\n    }\n\n    symbolFile_ = debugFile.SymbolFile;\n    return LoadDebugInfo(debugFile.FilePath, other);\n  }\n\n  public void Unload() {\n    if (globalSymbol_ != null) {\n      Marshal.ReleaseComObject(globalSymbol_);\n      globalSymbol_ = null;\n    }\n\n    if (session_ != null) {\n      Marshal.ReleaseComObject(session_);\n      session_ = null;\n    }\n\n    if (diaSource_ != null) {\n      Marshal.ReleaseComObject(diaSource_);\n      diaSource_ = null;\n    }\n  }\n\n  public bool AnnotateSourceLocations(FunctionIR function, IRTextFunction textFunc) {\n    return AnnotateSourceLocations(function, textFunc.Name);\n  }\n\n  public bool AnnotateSourceLocations(FunctionIR function, FunctionDebugInfo funcDebugInfo) {\n    var funcSymbol = FindFunctionSymbolByRVA(funcDebugInfo.RVA, true);\n\n    if (funcSymbol == null) {\n      return false;\n    }\n\n    return AnnotateSourceLocationsImpl(function, funcSymbol);\n  }\n\n  public SourceFileDebugInfo FindFunctionSourceFilePath(IRTextFunction textFunc) {\n    return FindFunctionSourceFilePath(textFunc.Name);\n  }\n\n  public SourceFileDebugInfo FindSourceFilePathByRVA(long rva) {\n    // Find the first line in the function.\n    if (sourceFileByRvaCache_.TryGetValue(rva, out var fileInfo)) {\n      return fileInfo;\n    }\n\n    var (lineInfo, sourceFile) = FindSourceLineByRVAImpl(rva);\n    fileInfo = FindFunctionSourceFilePathImpl(lineInfo, sourceFile, (uint)rva);\n\n    sourceFileByRvaCache_.TryAdd(rva, fileInfo);\n    return fileInfo;\n  }\n\n  public SourceFileDebugInfo FindFunctionSourceFilePath(string functionName) {\n    DiagnosticLogger.LogInfo($\"[SourceFile] FindFunctionSourceFilePath called for: {functionName}\");\n\n    if (sourceFileByNameCache_.TryGetValue(functionName, out var fileInfo)) {\n      DiagnosticLogger.LogInfo($\"[SourceFile] Cache hit for {functionName}: {fileInfo.FilePath}\");\n      return fileInfo;\n    }\n\n    var funcSymbol = FindFunctionSymbol(functionName);\n\n    if (funcSymbol == null) {\n      DiagnosticLogger.LogWarning($\"[SourceFile] Function symbol not found for: {functionName}\");\n      return SourceFileDebugInfo.Unknown;\n    }\n\n    DiagnosticLogger.LogInfo($\"[SourceFile] Found function symbol for {functionName}, RVA: 0x{funcSymbol.relativeVirtualAddress:X}\");\n\n    // Find the first line in the function.\n    var (lineInfo, sourceFile) = FindSourceLineByRVAImpl(funcSymbol.relativeVirtualAddress);\n    DiagnosticLogger.LogInfo($\"[SourceFile] Line info for {functionName}: FilePath={lineInfo.FilePath}, Line={lineInfo.Line}, IsUnknown={lineInfo.IsUnknown}\");\n\n    fileInfo = FindFunctionSourceFilePathImpl(lineInfo, sourceFile, funcSymbol.relativeVirtualAddress);\n    DiagnosticLogger.LogInfo($\"[SourceFile] Result for {functionName}: FilePath={fileInfo.FilePath}, OriginalFilePath={fileInfo.OriginalFilePath}, HasChecksumMismatch={fileInfo.HasChecksumMismatch}\");\n\n    sourceFileByNameCache_.TryAdd(functionName, fileInfo);\n    return fileInfo;\n  }\n\n  public SourceLineDebugInfo FindSourceLineByRVA(long rva, bool includeInlinees) {\n    return FindSourceLineByRVAImpl(rva, includeInlinees).Item1;\n  }\n\n  public FunctionDebugInfo FindFunctionByRVA(long rva) {\n    bool shouldLog = loggedRvas_.TryAdd(rva, true); // Returns true if newly added\n    string binaryName = symbolFile_?.FileName ?? \"Unknown\";\n    \n    try {\n      if (sortedFuncList_ != null) {\n        // Query the function list first. If not found, then still query the actual PDB\n        // because DIA has special lookup for functions split into multiple chunks by PGO for ex.\n        var result = FunctionDebugInfo.BinarySearch(sortedFuncList_, rva, sortedFuncListOverlapping_);\n\n        if (result != null) {\n          if (shouldLog) {\n            DiagnosticLogger.LogInfo($\"[PDBDebugInfo] Binary: {binaryName}, RVA: 0x{rva:X}, Function: {result.Name} (found in cache)\");\n          }\n          return result;\n        }\n      }\n\n      // Preload the function list only when there are enough queries\n      // to justify the time spent in reading the entire PDB.\n      if (sortedFuncList_ == null &&\n          Interlocked.Increment(ref funcCacheMisses_) >= FunctionCacheMissThreshold) {\n        if (shouldLog) {\n          DiagnosticLogger.LogInfo($\"[PDBDebugInfo] Binary: {binaryName}, cache miss threshold reached, loading function list\");\n        }\n        GetSortedFunctions();\n\n        if (sortedFuncList_ != null) {\n          var result = FunctionDebugInfo.BinarySearch(sortedFuncList_, rva, sortedFuncListOverlapping_);\n\n          if (result != null) {\n            if (shouldLog) {\n              DiagnosticLogger.LogInfo($\"[PDBDebugInfo] Binary: {binaryName}, RVA: 0x{rva:X}, Function: {result.Name} (found after cache load)\");\n            }\n            return result;\n          }\n        } else if (shouldLog) {\n          DiagnosticLogger.LogWarning($\"[PDBDebugInfo] Binary: {binaryName}, failed to load function list\");\n        }\n      }\n\n      // Query the PDB file.\n      var symbol = FindFunctionSymbolByRVA(rva);\n\n      if (symbol != null) {\n        if (shouldLog) {\n          DiagnosticLogger.LogInfo($\"[PDBDebugInfo] Binary: {binaryName}, RVA: 0x{rva:X}, Function: {symbol.name} (found via PDB query)\");\n        }\n        return new FunctionDebugInfo(symbol.name, symbol.relativeVirtualAddress, (uint)symbol.length);\n      } else if (shouldLog) {\n        DiagnosticLogger.LogWarning($\"[PDBDebugInfo] Binary: {binaryName}, RVA: 0x{rva:X}, Function: NOT_RESOLVED (no symbol found)\");\n      }\n    }\n    catch (Exception ex) {\n      if (shouldLog) {\n        DiagnosticLogger.LogError($\"[PDBDebugInfo] Binary: {binaryName}, RVA: 0x{rva:X}, Function: ERROR ({ex.Message})\", ex);\n      }\n      Trace.TraceError($\"Failed to find function for RVA {rva}: {ex.Message}\");\n    }\n\n    return null;\n  }\n\n  public FunctionDebugInfo FindFunction(string functionName) {\n    var funcSym = FindFunctionSymbol(functionName);\n    return funcSym != null ? new FunctionDebugInfo(funcSym.name, funcSym.relativeVirtualAddress, (uint)funcSym.length)\n      : null;\n  }\n\n  public IEnumerable<FunctionDebugInfo> EnumerateFunctions() {\n    return GetSortedFunctions();\n  }\n\n  public List<FunctionDebugInfo> GetSortedFunctions() {\n    if (sortedFuncList_ != null) {\n      return sortedFuncList_;\n    }\n\n    lock (cacheLock_) {\n      var result = Utils.RunSync(GetSortedFunctionsAsync);\n#if DEBUG\n      ValidateSortedList(result);\n#endif\n      return result;\n    }\n  }\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  public bool PopulateSourceLines(FunctionDebugInfo funcInfo) {\n    if (funcInfo.HasSourceLines) {\n      return true; // Already populated.\n    }\n\n    if (!EnsureLoaded()) {\n      return false;\n    }\n\n    try {\n      session_.findLinesByRVA((uint)funcInfo.StartRVA, (uint)funcInfo.Size, out var lineEnum);\n\n      while (true) {\n        lineEnum.Next(1, out var lineNumber, out uint retrieved);\n\n        if (retrieved == 0) {\n          break;\n        }\n\n        funcInfo.AddSourceLine(new SourceLineDebugInfo(\n                                 (int)lineNumber.addressOffset,\n                                 (int)lineNumber.lineNumber,\n                                 (int)lineNumber.columnNumber));\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to populate source lines for {funcInfo.Name}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  ~PDBDebugInfoProvider() {\n    Dispose(false);\n  }\n\n  public static async Task<DebugFileSearchResult>\n    LocateDebugInfoFileAsync(SymbolFileDescriptor symbolFile,\n                             SymbolFileSourceSettings settings) {\n    if (symbolFile == null) {\n      return DebugFileSearchResult.None;\n    }\n\n    if (resolvedSymbolsCache_.TryGetValue(symbolFile, out var searchResult)) {\n      return searchResult;\n    }\n\n    return await Task.Run(() => {\n      return LocateDebugInfoFile(symbolFile, settings);\n    }).ConfigureAwait(false);\n  }\n\n  public static SymbolReaderAuthenticationHandler CreateAuthHandler(SymbolFileSourceSettings settings) {\n    var authHandler = new SymbolReaderAuthenticationHandler();\n    authHandler.AddHandler(authSymwebHandler_);\n    authHandler.AddHandler(authAzDevOpsHandler_);\n\n    if (settings.AuthorizationTokenEnabled) {\n      authHandler.AddHandler(new BasicAuthenticationHandler(settings, authLogWriter_));\n    }\n\n    return authHandler;\n  }\n\n  public static DebugFileSearchResult\n    LocateDebugInfoFile(SymbolFileDescriptor symbolFile,\n                        SymbolFileSourceSettings settings) {\n    if (symbolFile == null) {\n      return DebugFileSearchResult.None;\n    }\n\n    DiagnosticLogger.LogInfo($\"[SymbolSearch] Starting symbol file search for {symbolFile.FileName} (ID: {symbolFile.Id}, Age: {symbolFile.Age})\");\n\n    if (resolvedSymbolsCache_.TryGetValue(symbolFile, out var searchResult)) {\n      DiagnosticLogger.LogDebug($\"[SymbolSearch] Found cached result for {symbolFile.FileName}: {(searchResult.Found ? \"Found\" : \"Not Found\")}\");\n      return searchResult;\n    }\n\n    // Check if this symbol file was previously rejected (failed lookup in a prior session).\n    if (settings.IsRejectedSymbolFile(symbolFile)) {\n      DiagnosticLogger.LogInfo($\"[SymbolSearch] SKIPPED - previously rejected: {symbolFile.FileName}\");\n      searchResult = DebugFileSearchResult.Failure(symbolFile, \"Previously rejected\");\n      resolvedSymbolsCache_.TryAdd(symbolFile, searchResult);\n      return searchResult;\n    }\n\n    string result = null;\n    using var logWriter = new StringWriter();\n\n    // In case there is a timeout downloading the symbols, try again.\n    string symbolSearchPath = ConstructSymbolSearchPath(settings);\n    DiagnosticLogger.LogInfo($\"[SymbolSearch] Symbol search path: {symbolSearchPath}\");\n\n    using var symbolReader = new SymbolReader(logWriter, symbolSearchPath, CreateAuthHandler(settings));\n    symbolReader.SecurityCheck += s => true; // Allow symbols from \"unsafe\" locations.\n\n    // Set symbol server timeout from settings (default 10 seconds).\n    // Use EffectiveTimeoutSeconds which is reduced if bellwether test marked server as degraded.\n    int timeoutSeconds = settings.EffectiveTimeoutSeconds > 0 ? settings.EffectiveTimeoutSeconds : 10;\n    symbolReader.ServerTimeout = TimeSpan.FromSeconds(timeoutSeconds);\n    DiagnosticLogger.LogInfo($\"[SymbolSearch] ServerTimeout={timeoutSeconds}s for {symbolFile.FileName}\");\n\n    try {\n      DiagnosticLogger.LogInfo($\"[SymbolSearch] Starting PDB download/search for {symbolFile.FileName}, {symbolFile.Id}, {symbolFile.Age}\");\n      Trace.WriteLine($\"Start PDB download for {symbolFile.FileName}, {symbolFile.Id}, {symbolFile.Age}\");\n      result = symbolReader.FindSymbolFilePath(symbolFile.FileName, symbolFile.Id, symbolFile.Age);\n      DiagnosticLogger.LogInfo($\"[SymbolSearch] FindSymbolFilePath result: {result ?? \"null\"}\");\n    }\n    catch (Exception ex) {\n      DiagnosticLogger.LogError($\"[SymbolSearch] Exception in FindSymbolFilePath for {symbolFile.FileName}: {ex.Message}\", ex);\n      Trace.TraceError($\"Failed FindSymbolFilePath for {symbolFile.FileName}: {ex.Message}\");\n    }\n\n    // Log the detailed search information - at INFO level to help debug symbol server issues\n    string searchLog = logWriter.ToString();\n    if (!string.IsNullOrWhiteSpace(searchLog)) {\n      DiagnosticLogger.LogInfo($\"[SymbolSearch] TraceEvent log for {symbolFile.FileName}:\\n{searchLog}\");\n    }\n\n    // Check for auth failure on primary server, but ONLY if primary has never been verified working.\n    // Once we've successfully downloaded from symweb, we NEVER fall back to msdl (would get worse symbols).\n    if (!settings.PrimaryServerVerified && !settings.PrimaryServerAuthFailed && SymbolFileSourceSettings.DetectPrimaryServerAuthFailure(searchLog)) {\n      settings.PrimaryServerAuthFailed = true;\n      DiagnosticLogger.LogWarning($\"[SymbolSearch] Primary server (symweb) auth FAILED - switching to secondary (public) server for remaining downloads\");\n    }\n\n#if DEBUG\n    Trace.WriteLine($\">> TraceEvent FindSymbolFilePath for {symbolFile.FileName}\");\n    Trace.IndentLevel = 1;\n    Trace.WriteLine(searchLog);\n    Trace.IndentLevel = 0;\n    Trace.WriteLine(\"<< TraceEvent\");\n#endif\n\n    // Track session-level statistics for negative cache safety checks\n    settings.SessionSymbolSearchCount++;\n\n    if (!string.IsNullOrEmpty(result) && File.Exists(result)) {\n      DiagnosticLogger.LogInfo($\"[SymbolSearch] Successfully found symbol file for {symbolFile.FileName}: {result}\");\n      searchResult = DebugFileSearchResult.Success(symbolFile, result, searchLog);\n\n      // Track successful symbol resolution for session statistics\n      settings.SessionSymbolSuccessCount++;\n\n      // If download succeeded and log shows symweb was used, mark primary as verified\n      if (!settings.PrimaryServerVerified &&\n          searchLog.Contains(\"symweb\", StringComparison.OrdinalIgnoreCase) &&\n          !SymbolFileSourceSettings.DetectPrimaryServerAuthFailure(searchLog)) {\n        settings.PrimaryServerVerified = true;\n        DiagnosticLogger.LogInfo($\"[SymbolSearch] Primary server (symweb) auth VERIFIED - will continue using primary server\");\n      }\n    }\n    else {\n      DiagnosticLogger.LogWarning($\"[SymbolSearch] Failed to find symbol file for {symbolFile.FileName}. Result: {result ?? \"null\"}\");\n      searchResult = DebugFileSearchResult.Failure(symbolFile, searchLog);\n\n      // Track failed symbol resolution for session statistics\n      settings.SessionSymbolFailureCount++;\n\n      // Classify the failure to determine if it should be cached\n      var reason = settings.ClassifySearchFailure(searchLog);\n      DiagnosticLogger.LogInfo($\"[SymbolSearch] Failure classified as: {reason}\");\n\n      // Record failed lookup with reason - RejectSymbolFile has safeguards to prevent caching transient failures\n      settings.RejectSymbolFile(symbolFile, reason, searchLog);\n    }\n\n    resolvedSymbolsCache_.TryAdd(symbolFile, searchResult);\n    DiagnosticLogger.LogInfo($\"[SymbolSearch] Cached search result for {symbolFile.FileName}: {(searchResult.Found ? \"Success\" : \"Failure\")}\");\n    return searchResult;\n  }\n\n  // Track if we've logged detailed symbol path info (only log once per session unless auth state changes)\n  private static bool loggedSymbolPathDetails_;\n  private static bool lastLoggedAuthFailedState_;\n\n  public static string ConstructSymbolSearchPath(SymbolFileSourceSettings settings, bool logPath = false) {\n    string symbolPath = \"\";\n\n    // Only log detailed info on first call or when auth state changes\n    bool authStateChanged = lastLoggedAuthFailedState_ != settings.PrimaryServerAuthFailed;\n    bool shouldLogDetails = !loggedSymbolPathDetails_ || authStateChanged;\n\n    if (shouldLogDetails) {\n      DiagnosticLogger.LogInfo($\"[SymbolPath] ConstructSymbolSearchPath - PrimaryServerAuthFailed={settings.PrimaryServerAuthFailed}, PrimaryServerVerified={settings.PrimaryServerVerified}\");\n      DiagnosticLogger.LogInfo($\"[SymbolPath] Input SymbolPaths ({settings.SymbolPaths?.Count ?? 0} entries): {string.Join(\"; \", settings.SymbolPaths ?? [])}\");\n      if (authStateChanged && loggedSymbolPathDetails_) {\n        DiagnosticLogger.LogWarning($\"[SymbolPath] Auth state changed from {lastLoggedAuthFailedState_} to {settings.PrimaryServerAuthFailed} - switching symbol servers\");\n      }\n      loggedSymbolPathDetails_ = true;\n      lastLoggedAuthFailedState_ = settings.PrimaryServerAuthFailed;\n    }\n\n    if (settings.UseEnvironmentVarSymbolPaths) {\n      symbolPath += $\"{settings.EnvironmentVarSymbolPath};\";\n    }\n\n    foreach (string path in settings.SymbolPaths) {\n      if (!string.IsNullOrEmpty(path)) {\n        // Skip primary (private) server if auth has failed\n        if (settings.PrimaryServerAuthFailed && path.Contains(\"symweb\", StringComparison.OrdinalIgnoreCase)) {\n          if (shouldLogDetails) {\n            DiagnosticLogger.LogInfo($\"[SymbolPath] Skipping primary server (auth failed): {path}\");\n          }\n          continue;\n        }\n\n        // Skip secondary (public) server UNLESS primary auth has explicitly failed.\n        // msdl only has stripped/public PDBs - we want private symbols from symweb.\n        // Only fall back to msdl if symweb auth fails (401/403).\n        if (!settings.PrimaryServerAuthFailed && path.Contains(\"msdl.microsoft.com\", StringComparison.OrdinalIgnoreCase)) {\n          if (shouldLogDetails) {\n            DiagnosticLogger.LogInfo($\"[SymbolPath] Skipping secondary server (primary not failed): {path}\");\n          }\n          continue;\n        }\n\n        if (shouldLogDetails) {\n          DiagnosticLogger.LogInfo($\"[SymbolPath] Including path: {path}\");\n        }\n        symbolPath += $\"{path};\";\n      }\n    }\n\n    // Always log the final path on first call or auth state change\n    if (shouldLogDetails) {\n      DiagnosticLogger.LogInfo($\"[SymbolPath] Final constructed path: {symbolPath}\");\n    }\n\n    return symbolPath;\n  }\n\n  public static async Task<DebugFileSearchResult>\n    LocateDebugInfoFile(string imagePath, SymbolFileSourceSettings settings) {\n    using var binaryInfo = new PEBinaryInfoProvider(imagePath);\n\n    if (binaryInfo.Initialize()) {\n      return await LocateDebugInfoFileAsync(binaryInfo.SymbolFileInfo, settings).ConfigureAwait(false);\n    }\n\n    return DebugFileSearchResult.None;\n  }\n\n  public static string DemangleFunctionName(string name, FunctionNameDemanglingOptions options =\n                                              FunctionNameDemanglingOptions.Default) {\n    // Mangled MSVC C++ names always start with a ? char.\n    if (string.IsNullOrEmpty(name) || !name.StartsWith('?')) {\n      return name;\n    }\n\n    var sb = new StringBuilder(MaxDemangledFunctionNameLength);\n    var flags = NativeMethods.UnDecorateFlags.UNDNAME_COMPLETE;\n    flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_ACCESS_SPECIFIERS |\n             NativeMethods.UnDecorateFlags.UNDNAME_NO_ALLOCATION_MODEL |\n             NativeMethods.UnDecorateFlags.UNDNAME_NO_MEMBER_TYPE;\n\n    if (options.HasFlag(FunctionNameDemanglingOptions.OnlyName)) {\n      flags |= NativeMethods.UnDecorateFlags.UNDNAME_NAME_ONLY;\n    }\n\n    if (options.HasFlag(FunctionNameDemanglingOptions.NoSpecialKeywords)) {\n      flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_MS_KEYWORDS;\n      flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_MS_THISTYPE;\n    }\n\n    if (options.HasFlag(FunctionNameDemanglingOptions.NoReturnType)) {\n      flags |= NativeMethods.UnDecorateFlags.UNDNAME_NO_FUNCTION_RETURNS;\n    }\n\n    // DbgHelp UnDecorateSymbolName is not thread safe and can\n    // return bogus function names if not under a global lock.\n    lock (undecorateLock_) {\n      NativeMethods.UnDecorateSymbolName(name, sb, MaxDemangledFunctionNameLength, flags);\n    }\n\n    return sb.ToString();\n  }\n\n  public static string DemangleFunctionName(IRTextFunction function, FunctionNameDemanglingOptions options =\n                                              FunctionNameDemanglingOptions.Default) {\n    return DemangleFunctionName(function.Name, options);\n  }\n\n  private bool LoadDebugInfo(string debugFilePath, IDebugInfoProvider other = null) {\n    if (loadFailed_) {\n      return false; // Failed before, don't try again.\n    }\n\n    try {\n      debugFilePath_ = debugFilePath;\n      diaSource_ = new DiaSourceClass();\n      diaSource_.loadDataFromPdb(debugFilePath);\n      diaSource_.openSession(out session_);\n    }\n    catch (Exception ex) {\n      // Check for DIA SDK COM registration issue - common in dev builds\n      bool isDiaRegistrationError = ex.Message.Contains(\"E6756135-1E65-4D17-8576-610761398C3C\") ||\n                                    ex.Message.Contains(\"8007007E\") ||\n                                    ex.Message.Contains(\"class factory\");\n      if (isDiaRegistrationError) {\n        string errorMsg = $\"DIA SDK (msdia140.dll) is not registered! \" +\n                          $\"Run as Admin: regsvr32 \\\"{AppContext.BaseDirectory}msdia140.dll\\\" \" +\n                          $\"or use the installed version of Profile Explorer.\";\n        DiagnosticLogger.LogError($\"[PDBLoad] [CRITICAL] {errorMsg}\");\n        Trace.TraceError(errorMsg);\n\n        // Set static flag so UI can detect and display error\n        if (!diaRegistrationFailed_) {\n          diaRegistrationFailed_ = true;\n          diaRegistrationError_ = errorMsg;\n        }\n      }\n      else {\n        DiagnosticLogger.LogError($\"[PDBLoad] Failed to load {debugFilePath}: {ex.Message}\");\n      }\n      Trace.TraceError($\"Failed to load debug file {debugFilePath}: {ex.Message}\");\n      loadFailed_ = true;\n      return false;\n    }\n\n    try {\n      session_.findChildren(null, SymTagEnum.SymTagExe, null, 0, out var exeSymEnum);\n      globalSymbol_ = exeSymEnum.Item(0);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to locate global sym for file {debugFilePath}: {ex.Message}\");\n      loadFailed_ = true;\n      return false;\n    }\n\n    if (other is PDBDebugInfoProvider otherPdb) {\n      // Copy the already loaded function list from another PDB\n      // provider that was created on another thread and is unusable otherwise.\n      symbolCache_ = otherPdb.symbolCache_;\n      sortedFuncList_ = otherPdb.sortedFuncList_;\n    }\n\n    // Check if PDB has source file information (not stripped)\n    CheckForSourceInfo();\n    return true;\n  }\n\n  private void CheckForSourceInfo() {\n    // Log file size to help diagnose public vs private PDB\n    try {\n      var fileInfo = new FileInfo(debugFilePath_);\n      DiagnosticLogger.LogInfo($\"[PDBDebugInfo] PDB file size: {fileInfo.Length:N0} bytes ({fileInfo.Length / 1024.0 / 1024.0:F2} MB) - {debugFilePath_}\");\n    }\n    catch { }\n\n    try {\n      // Try to enumerate source files in the PDB\n      session_.findFile(null, null, 0, out var sourceFileEnum);\n      sourceFileEnum.Next(1, out var sourceFile, out uint retrieved);\n\n      if (retrieved > 0 && sourceFile != null) {\n        string fileName = sourceFile.fileName;\n        hasSourceInfo_ = true;\n        DiagnosticLogger.LogInfo($\"[PDBDebugInfo] PDB has source info. Sample source file: {fileName}\");\n      }\n      else {\n        hasSourceInfo_ = false;\n        DiagnosticLogger.LogWarning($\"[PDBDebugInfo] PDB appears to be STRIPPED (no source file info). Source file viewing will not work for: {debugFilePath_}\");\n        DiagnosticLogger.LogWarning($\"[PDBDebugInfo] If you expected private symbols with source info:\");\n        DiagnosticLogger.LogWarning($\"[PDBDebugInfo]   1. Delete the cached PDB: {debugFilePath_}\");\n        DiagnosticLogger.LogWarning($\"[PDBDebugInfo]   2. Ensure symweb (private server) is configured as PRIMARY in symbol paths\");\n        DiagnosticLogger.LogWarning($\"[PDBDebugInfo]   3. Reload the trace to re-download from the private server\");\n      }\n    }\n    catch (Exception ex) {\n      hasSourceInfo_ = false;\n      DiagnosticLogger.LogWarning($\"[PDBDebugInfo] Could not enumerate source files in PDB: {ex.Message}. PDB may be stripped.\");\n    }\n  }\n\n  /// <summary>\n  /// Returns true if the PDB contains source file information (line numbers, file paths).\n  /// Returns false for stripped/public PDBs that only contain symbol names.\n  /// </summary>\n  public bool HasSourceInfo => hasSourceInfo_;\n\n  public bool AnnotateSourceLocations(FunctionIR function, string functionName) {\n    var funcSymbol = FindFunctionSymbol(functionName);\n\n    if (funcSymbol == null) {\n      return false;\n    }\n\n    return AnnotateSourceLocationsImpl(function, funcSymbol);\n  }\n\n  private bool AnnotateSourceLocationsImpl(FunctionIR function, IDiaSymbol funcSymbol) {\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n\n    if (metadataTag == null) {\n      return false;\n    }\n\n    uint funcRVA = funcSymbol.relativeVirtualAddress;\n\n    foreach (var pair in metadataTag.OffsetToElementMap) {\n      uint instrRVA = funcRVA + (uint)pair.Key;\n      AnnotateInstructionSourceLocation(pair.Value, instrRVA, funcSymbol);\n    }\n\n    return true;\n  }\n\n  private bool ValidateSortedList(List<FunctionDebugInfo> list) {\n    for (int i = 1; i < list.Count; i++) {\n      if (list[i].StartRVA < list[i - 1].StartRVA &&\n          list[i].StartRVA != 0 &&\n          list[i - 1].StartRVA != 0) {\n        Debug.Assert(false, \"Function list is not sorted by RVA\");\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  private async Task<List<FunctionDebugInfo>> GetSortedFunctionsAsync() {\n    // This method assumes lock is taken by caller.\n    if (sortedFuncList_ != null) {\n      return sortedFuncList_;\n    }\n\n    if (settings_.CacheSymbolFiles) {\n      // Try to load a previous cached function list file.\n      symbolCache_ = await SymbolFileCache.DeserializeAsync(symbolFile_, settings_.SymbolCacheDirectoryPath).\n        ConfigureAwait(false);\n    }\n\n    if (symbolCache_ != null) {\n      Trace.WriteLine($\"PDB cache loaded for {symbolFile_.FileName}\");\n      sortedFuncList_ = symbolCache_.FunctionList;\n    }\n    else {\n      // Create sorted list of functions and public symbols.\n      sortedFuncList_ = CollectFunctionDebugInfo();\n\n      if (sortedFuncList_ == null) {\n        return null;\n      }\n\n      if (settings_.CacheSymbolFiles) {\n        // Save symbol cache file.\n        symbolCache_ = new SymbolFileCache() {\n          SymbolFile = symbolFile_,\n          FunctionList = sortedFuncList_\n        };\n\n        await SymbolFileCache.SerializeAsync(symbolCache_, settings_.SymbolCacheDirectoryPath).\n          ConfigureAwait(false);\n        Trace.WriteLine($\"PDB cache created for {symbolFile_.FileName}\");\n      }\n    }\n\n    // Sorting needed for binary search later.\n    sortedFuncList_.Sort();\n    sortedFuncListOverlapping_ = HasOverlappingFunctions(sortedFuncList_);\n    return sortedFuncList_;\n  }\n\n  private bool HasOverlappingFunctions(List<FunctionDebugInfo> sortedFuncList) {\n    if (sortedFuncList == null || sortedFuncList.Count < 2) {\n      return false;\n    }\n\n    for (int i = 1; i < sortedFuncList.Count; i++) {\n      if (sortedFuncList[i].StartRVA == 0) {\n        continue;\n      }\n\n      for (int k = i - 1; k >= 0 && i - k < 10; k--) {\n        if (sortedFuncList[k].StartRVA != 0 &&\n            sortedFuncList[k].StartRVA <= sortedFuncList[i].StartRVA &&\n            sortedFuncList[k].EndRVA > sortedFuncList[i].EndRVA) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  private void Dispose(bool disposing) {\n    if (disposed_) {\n      return;\n    }\n\n    if (disposing) {\n      symbolReaderPDB_?.Dispose();\n      symbolReader_?.Dispose();\n      symbolReaderLog_?.Dispose();\n      symbolReaderPDB_ = null;\n      symbolReader_ = null;\n      symbolCache_ = null;\n      sortedFuncList_ = null;\n    }\n\n    Unload();\n    disposed_ = true;\n  }\n\n  private bool EnsureLoaded() {\n    if (session_ != null) {\n      DiagnosticLogger.LogDebug($\"[PDBDebugInfo] PDB session already loaded for {symbolFile_?.FileName ?? debugFilePath_ ?? \"Unknown\"}\");\n      return true;\n    }\n\n    DiagnosticLogger.LogInfo($\"[PDBDebugInfo] Loading PDB file: {debugFilePath_}\");\n    bool loaded = LoadDebugInfo(debugFilePath_);\n    \n    if (loaded) {\n      DiagnosticLogger.LogInfo($\"[PDBDebugInfo] Successfully loaded PDB file: {debugFilePath_}\");\n    } else {\n      DiagnosticLogger.LogError($\"[PDBDebugInfo] Failed to load PDB file: {debugFilePath_}\");\n    }\n    \n    return loaded;\n  }\n\n  private SourceFileDebugInfo FindFunctionSourceFilePathImpl(SourceLineDebugInfo lineInfo,\n                                                             IDiaSourceFile sourceFile, uint rva) {\n    if (lineInfo.IsUnknown) {\n      DiagnosticLogger.LogWarning($\"[SourceFile] lineInfo is Unknown for RVA 0x{rva:X}\");\n      return SourceFileDebugInfo.Unknown;\n    }\n\n    string originalFilePath = lineInfo.FilePath;\n    string localFilePath = lineInfo.FilePath;\n    bool localFileFound = File.Exists(localFilePath);\n    bool hasChecksumMismatch = false;\n\n    DiagnosticLogger.LogInfo($\"[SourceFile] Checking source file: {originalFilePath}, localFileFound={localFileFound}\");\n\n    if (localFileFound) {\n      // Check if the PDB file checksum matches the one of the local file.\n      hasChecksumMismatch = !SourceFileChecksumMatchesPDB(sourceFile, localFilePath);\n      DiagnosticLogger.LogInfo($\"[SourceFile] Local file exists, checksumMismatch={hasChecksumMismatch}\");\n    }\n\n    // Try to use the source server if no exact local file found.\n    DiagnosticLogger.LogInfo($\"[SourceFile] SourceServerEnabled={settings_.SourceServerEnabled}, needsServerLookup={!localFileFound || hasChecksumMismatch}\");\n\n    if ((!localFileFound || hasChecksumMismatch) && settings_.SourceServerEnabled) {\n      DiagnosticLogger.LogInfo($\"[SourceFile] Attempting source server lookup for RVA 0x{rva:X}\");\n      try {\n        lock (this) {\n          if (symbolReaderPDB_ == null) {\n            DiagnosticLogger.LogInfo($\"[SourceFile] Initializing SymbolReader for {debugFilePath_}\");\n            symbolReaderLog_ = new StringWriter();\n            symbolReader_ = new SymbolReader(symbolReaderLog_, null, CreateAuthHandler(settings_));\n            symbolReader_.SecurityCheck += s => true; // Allow symbols from \"unsafe\" locations.\n            symbolReaderPDB_ = symbolReader_.OpenNativeSymbolFile(debugFilePath_);\n\n            if (symbolReaderPDB_ == null) {\n              DiagnosticLogger.LogError($\"[SourceFile] Failed to initialize SymbolReader for {debugFilePath_}\");\n              Trace.WriteLine($\"Failed to initialize SymbolReader for {lineInfo.FilePath}\");\n              return new SourceFileDebugInfo(localFilePath, originalFilePath, lineInfo.Line, hasChecksumMismatch);\n            }\n            DiagnosticLogger.LogInfo($\"[SourceFile] SymbolReader initialized successfully\");\n          }\n\n          // Query for the source file location on the server.\n          DiagnosticLogger.LogInfo($\"[SourceFile] Querying SourceLocationForRva(0x{rva:X})\");\n          var sourceLine = symbolReaderPDB_.SourceLocationForRva(rva);\n\n          if (sourceLine?.SourceFile != null) {\n            // Try to download the source file.\n            // The checksum should match, but do a check just in case.\n            DiagnosticLogger.LogInfo($\"[SourceFile] Source server has file: {sourceLine.SourceFile.BuildTimeFilePath}\");\n            Trace.WriteLine($\"Query source server for {sourceLine?.SourceFile?.BuildTimeFilePath}\");\n            string filePath = sourceLine.SourceFile.GetSourceFile();\n            DiagnosticLogger.LogInfo($\"[SourceFile] GetSourceFile returned: {filePath ?? \"null\"}\");\n\n            if (!string.IsNullOrEmpty(filePath) && SourceFileChecksumMatchesPDB(sourceFile, filePath)) {\n              DiagnosticLogger.LogInfo($\"[SourceFile] Downloaded and verified source file: {filePath}\");\n              Trace.WriteLine($\"Downloaded source file {filePath}\");\n              localFilePath = filePath;\n              hasChecksumMismatch = !SourceFileChecksumMatchesPDB(sourceFile, localFilePath);\n            }\n            else {\n              DiagnosticLogger.LogWarning($\"[SourceFile] Failed to download or verify source file. filePath={filePath ?? \"null\"}\");\n              Trace.WriteLine($\"Failed to download source file {localFilePath}\");\n              string logContent = symbolReaderLog_.ToString().TrimToLength(MaxLogEntryLength);\n              DiagnosticLogger.LogWarning($\"[SourceFile] SymbolReader log: {logContent}\");\n              Trace.WriteLine(logContent);\n              symbolReaderLog_.GetStringBuilder().Clear();\n              Trace.WriteLine(\"---------------------------------\");\n            }\n          }\n          else {\n            DiagnosticLogger.LogWarning($\"[SourceFile] SourceLocationForRva returned null or no SourceFile for RVA 0x{rva:X}\");\n          }\n        }\n      }\n      catch (Exception ex) {\n        DiagnosticLogger.LogError($\"[SourceFile] Exception during source server lookup: {ex.Message}\", ex);\n        Trace.TraceError($\"Failed to locate source file for {debugFilePath_}: {ex.Message}\");\n      }\n    }\n\n    return new SourceFileDebugInfo(localFilePath, originalFilePath, lineInfo.Line, hasChecksumMismatch);\n  }\n\n  private bool SourceFileChecksumMatchesPDB(IDiaSourceFile sourceFile, string filePath) {\n    if (string.IsNullOrEmpty(filePath)) {\n      return false;\n    }\n\n    var hashAlgo = GetSourceFileChecksumHashAlgorithm(sourceFile);\n    if (hashAlgo == null) {\n      return false;\n    }\n\n    byte[] pdbChecksum = GetSourceFileChecksum(sourceFile);\n    byte[] fileChecksum = ComputeSourceFileChecksum(filePath, hashAlgo);\n    return pdbChecksum != null && fileChecksum != null &&\n           pdbChecksum.SequenceEqual(fileChecksum);\n  }\n\n  private (SourceLineDebugInfo, IDiaSourceFile)\n    FindSourceLineByRVAImpl(long rva, bool includeInlinees = false) {\n    if (!EnsureLoaded()) {\n      return (SourceLineDebugInfo.Unknown, null);\n    }\n\n    try {\n      session_.findLinesByRVA((uint)rva, 0, out var lineEnum);\n\n      while (true) {\n        lineEnum.Next(1, out var lineNumber, out uint retrieved);\n\n        if (retrieved == 0) {\n          DiagnosticLogger.LogWarning($\"[SourceFile] No line info found in PDB for RVA 0x{rva:X} - PDB may be stripped (public symbols only)\");\n          break;\n        }\n\n        var sourceFile = lineNumber.sourceFile;\n        var sourceLine = new SourceLineDebugInfo((int)lineNumber.addressOffset,\n                                                 (int)lineNumber.lineNumber,\n                                                 (int)lineNumber.columnNumber,\n                                                 sourceFile.fileName);\n\n        if (includeInlinees) {\n          var funcSymbol = FindFunctionSymbolByRVA(rva, true);\n\n          if (funcSymbol != null) {\n            // Enumerate the functions that got inlined at this call site.\n            foreach (var inlinee in EnumerateInlinees(funcSymbol, (uint)rva)) {\n              if (string.IsNullOrEmpty(inlinee.FilePath)) {\n                // If the file name is not set, it means it's the same file\n                // as the function into which the inlining happened.\n                inlinee.FilePath = sourceFile.fileName;\n              }\n\n              sourceLine.AddInlinee(inlinee);\n            }\n          }\n        }\n\n        return (sourceLine, sourceFile);\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to get line for RVA {rva}: {ex.Message}\");\n    }\n\n    return (SourceLineDebugInfo.Unknown, null);\n  }\n\n  private HashAlgorithm GetSourceFileChecksumHashAlgorithm(IDiaSourceFile sourceFile) {\n    return sourceFile.checksumType switch {\n      3 => SHA256.Create(),\n      _ => null\n    };\n  }\n\n  private unsafe byte[] GetSourceFileChecksum(IDiaSourceFile sourceFile) {\n    // Call once to get the size of the hash.\n    byte* dummy = null;\n    sourceFile.get_checksum(0, out uint hashSizeInBytes, out *dummy);\n\n    // Allocate buffer and get the actual hash.\n    byte[] hash = new byte[hashSizeInBytes];\n\n    fixed (byte* bufferPtr = hash) {\n      sourceFile.get_checksum((uint)hash.Length, out uint bytesFetched, out *bufferPtr);\n    }\n\n    return hash;\n  }\n\n  private byte[] ComputeSourceFileChecksum(string sourceFile, HashAlgorithm hashAlgo) {\n    try {\n      using var stream = File.OpenRead(sourceFile);\n      return hashAlgo.ComputeHash(stream);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to compute hash for {sourceFile}: {ex.Message}\");\n      return Array.Empty<byte>();\n    }\n  }\n\n  private bool AnnotateInstructionSourceLocation(IRElement instr, uint instrRVA, IDiaSymbol funcSymbol) {\n    if (!EnsureLoaded()) {\n      return false;\n    }\n\n    try {\n      session_.findLinesByRVA(instrRVA, 0, out var lineEnum);\n\n      while (true) {\n        lineEnum.Next(1, out var lineNumber, out uint retrieved);\n\n        if (retrieved == 0) {\n          break;\n        }\n\n        var locationTag = instr.GetOrAddTag<SourceLocationTag>();\n        locationTag.Reset(); // Tag may be already populated.\n        locationTag.Line = (int)lineNumber.lineNumber;\n        locationTag.Column = (int)lineNumber.columnNumber;\n\n        if (lineNumber.sourceFile != null) {\n          locationTag.FilePath = string.Intern(lineNumber.sourceFile.fileName);\n        }\n\n        // Enumerate the functions that got inlined at this call site.\n        foreach (var inlinee in EnumerateInlinees(funcSymbol, instrRVA)) {\n          if (string.IsNullOrEmpty(inlinee.FilePath)) {\n            // If the file name is not set, it means it's the same file\n            // as the function into which the inlining happened.\n            inlinee.FilePath = locationTag.FilePath;\n          }\n\n          locationTag.AddInlinee(inlinee);\n        }\n      }\n\n      Marshal.ReleaseComObject(lineEnum);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to get source lines for {funcSymbol.name}: {ex.Message}\");\n      return false;\n    }\n\n    return true;\n  }\n\n  private IEnumerable<SourceStackFrame>\n    EnumerateInlinees(IDiaSymbol funcSymbol, uint instrRVA) {\n    if (inlineeByRvaCache_.TryGetValue(instrRVA, out var inlineeList)) {\n      // Use the preloaded list of inlinees.\n      foreach (var inlinee in inlineeList) {\n        yield return inlinee;\n      }\n    }\n    else {\n      inlineeList = new List<SourceStackFrame>();\n      funcSymbol.findInlineFramesByRVA(instrRVA, out var inlineeFrameEnum);\n\n      foreach (IDiaSymbol inlineFrame in inlineeFrameEnum) {\n        inlineFrame.findInlineeLinesByRVA(instrRVA, 0, out var inlineeLineEnum);\n\n        while (true) {\n          inlineeLineEnum.Next(1, out var inlineeLineNumber, out uint inlineeRetrieved);\n\n          if (inlineeRetrieved == 0) {\n            break;\n          }\n\n          // Getting the source file of the inlinee often fails, ignore it.\n          string inlineeFileName = null;\n\n          try {\n            inlineeFileName = inlineeLineNumber.sourceFile.fileName;\n          }\n          catch {\n            //? TODO: Any way to detect this and avoid throwing?\n          }\n\n          var inlinee = new SourceStackFrame(\n            inlineFrame.name, inlineeFileName,\n            (int)inlineeLineNumber.lineNumber,\n            (int)inlineeLineNumber.columnNumber);\n          inlineeList.Add(inlinee);\n          yield return inlinee;\n        }\n\n        Marshal.ReleaseComObject(inlineeLineEnum);\n      }\n\n      Marshal.ReleaseComObject(inlineeFrameEnum);\n      inlineeByRvaCache_.TryAdd(instrRVA, inlineeList);\n    }\n  }\n\n  private List<FunctionDebugInfo> CollectFunctionDebugInfo() {\n    if (!EnsureLoaded()) {\n      return null;\n    }\n\n    IDiaEnumSymbols symbolEnum = null;\n    IDiaEnumSymbols publicSymbolEnum = null;\n\n    try {\n      var symbolList = new List<FunctionDebugInfo>();\n      var symbolMap = new Dictionary<long, FunctionDebugInfo>();\n      globalSymbol_.findChildren(SymTagEnum.SymTagFunction, null, 0, out symbolEnum);\n      globalSymbol_.findChildren(SymTagEnum.SymTagPublicSymbol, null, 0, out publicSymbolEnum);\n\n      foreach (IDiaSymbol sym in symbolEnum) {\n        //Trace.WriteLine($\" FuncSym {sym.name}: RVA {sym.relativeVirtualAddress:X}, size {sym.length}\");\n        var funcInfo = new FunctionDebugInfo(sym.name, sym.relativeVirtualAddress, (uint)sym.length);\n        symbolList.Add(funcInfo);\n        symbolMap[funcInfo.RVA] = funcInfo;\n      }\n\n      foreach (IDiaSymbol sym in publicSymbolEnum) {\n        //Trace.WriteLine($\" PublicSym {sym.name}: RVA {sym.relativeVirtualAddress:X} size {sym.length}\");\n        var funcInfo = new FunctionDebugInfo(sym.name, sym.relativeVirtualAddress, (uint)sym.length);\n\n        // Public symbols are preferred over function symbols if they have the same RVA and size.\n        // This ensures that the mangled name is saved, set only of public symbols.\n        // This tries to mirror the behavior from FindFunctionSymbolByRVA.\n        if (symbolMap.TryGetValue(funcInfo.RVA, out var existingFuncInfo)) {\n          if (existingFuncInfo.Size == funcInfo.Size) {\n            existingFuncInfo.Name = funcInfo.Name;\n          }\n        }\n        else {\n          // Consider the public sym if it doesn't overlap a function sym.\n          symbolList.Add(funcInfo);\n        }\n      }\n\n      return symbolList;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to enumerate functions: {ex.Message}\");\n    }\n    finally {\n      if (symbolEnum != null) {\n        Marshal.ReleaseComObject(symbolEnum);\n      }\n\n      if (publicSymbolEnum != null) {\n        Marshal.ReleaseComObject(publicSymbolEnum);\n      }\n    }\n\n    return null;\n  }\n\n  private IDiaSymbol FindFunctionSymbol(string functionName) {\n    string demangledName = DemangleFunctionName(functionName);\n    string queryDemangledName = DemangleFunctionName(functionName, FunctionNameDemanglingOptions.OnlyName);\n    var result = FindFunctionSymbolImpl(SymTagEnum.SymTagFunction, functionName, demangledName, queryDemangledName);\n\n    if (result != null) {\n      return result;\n    }\n\n    return FindFunctionSymbolImpl(SymTagEnum.SymTagPublicSymbol, functionName, demangledName, queryDemangledName);\n  }\n\n  private IDiaSymbol FindFunctionSymbolByRVA(long rva, bool preferFunctionSym = false) {\n    if (!EnsureLoaded()) {\n      return null;\n    }\n\n    try {\n      session_.findSymbolByRVA((uint)rva, SymTagEnum.SymTagFunction, out var funcSym);\n\n      if (preferFunctionSym && funcSym != null) {\n        return funcSym;\n      }\n\n      // Public symbols are preferred over function symbols if they have the same RVA and size.\n      // This ensures that the mangled name is saved, set only of public symbols.\n      session_.findSymbolByRVA((uint)rva, SymTagEnum.SymTagPublicSymbol, out var pubSym);\n\n      if (pubSym != null) {\n        if (funcSym == null ||\n            funcSym.relativeVirtualAddress == pubSym.relativeVirtualAddress &&\n            funcSym.length == pubSym.length) {\n          return pubSym;\n        }\n      }\n\n      return funcSym;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to find function symbol for RVA {rva}: {ex.Message}\");\n    }\n\n    return null;\n  }\n\n  private IDiaSymbol FindFunctionSymbolImpl(SymTagEnum symbolType, string functionName, string demangledName,\n                                            string queryDemangledName) {\n    if (!EnsureLoaded()) {\n      return null;\n    }\n\n    try {\n      globalSymbol_.findChildren(symbolType, queryDemangledName, 0, out var symbolEnum);\n      IDiaSymbol candidateSymbol = null;\n\n      while (true) {\n        symbolEnum.Next(1, out var symbol, out uint retrieved);\n\n        if (retrieved == 0) {\n          break;\n        }\n\n        // Class::function matches, now check the entire unmangled name\n        // to pick that right function overload.\n        candidateSymbol ??= symbol;\n        symbol.get_undecoratedNameEx((uint)NativeMethods.UnDecorateFlags.UNDNAME_NO_ACCESS_SPECIFIERS,\n                                     out string symbolDemangledName);\n\n        if (symbolDemangledName == demangledName) {\n          return symbol;\n        }\n      }\n\n      return candidateSymbol; // Return first match.\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to get function symbol for {functionName}: {ex.Message}\");\n      return null;\n    }\n  }\n}\n\n/// <summary>\n/// Handles Azure AD authentication for Azure DevOps source server URLs.\n/// The source server for Windows OS PDBs uses Azure DevOps (*.visualstudio.com, dev.azure.com),\n/// which requires a Bearer token with the Azure DevOps scope.\n/// </summary>\nsealed class AzureDevOpsSourceHandler : SymbolReaderAuthHandler {\n  private const string AzureDevOpsScope = \"499b84ac-1321-427f-aa17-267ca6975798/.default\";\n  private readonly TokenCredential credential_;\n\n  public AzureDevOpsSourceHandler(TextWriter log, TokenCredential credential) :\n    base(log, \"AzureDevOps Source\") {\n    credential_ = credential;\n  }\n\n  protected override bool TryGetAuthority(Uri requestUri, out Uri authority) {\n    string host = requestUri.Host;\n\n    if (host.EndsWith(\".visualstudio.com\", StringComparison.OrdinalIgnoreCase) ||\n        host.EndsWith(\"dev.azure.com\", StringComparison.OrdinalIgnoreCase)) {\n      authority = new Uri($\"{requestUri.Scheme}://{requestUri.Host}\");\n      return true;\n    }\n\n    authority = null;\n    return false;\n  }\n\n  protected override async Task<AuthToken?> GetAuthTokenAsync(RequestContext context,\n                                                               SymbolReaderHandlerDelegate next,\n                                                               Uri authority,\n                                                               CancellationToken cancellationToken) {\n    try {\n      var tokenRequest = new TokenRequestContext(new[] { AzureDevOpsScope });\n      var accessToken = await credential_.GetTokenAsync(tokenRequest, cancellationToken);\n      return new AuthToken(AuthScheme.Bearer, accessToken.Token, accessToken.ExpiresOn.UtcDateTime, null);\n    }\n    catch (Exception ex) {\n      WriteLog($\"AzureDevOps auth failed: {ex.Message}\");\n      return null;\n    }\n  }\n}\n\nsealed class BasicAuthenticationHandler : SymbolReaderAuthHandler {\n  private SymbolFileSourceSettings settings_;\n\n  public BasicAuthenticationHandler(SymbolFileSourceSettings settings, TextWriter log) :\n    base(log, \"HTTP Auth\") {\n    settings_ = settings;\n  }\n\n  protected override bool TryGetAuthority(Uri requestUri, out Uri authority) {\n    if (!settings_.AuthorizationTokenEnabled) {\n      authority = null;\n      return false;\n    }\n\n    authority = requestUri;\n    return true;\n  }\n\n  protected override Task<AuthToken?> GetAuthTokenAsync(RequestContext context, SymbolReaderHandlerDelegate next,\n                                                        Uri authority, CancellationToken cancellationToken) {\n    if (settings_.AuthorizationTokenEnabled) {\n      string username = settings_.AuthorizationUser;\n      string pat = settings_.AuthorizationToken;\n      var token = AuthToken.CreateBasicFromUsernameAndPassword(username, pat);\n      return Task.FromResult<AuthToken?>(token);\n    }\n\n    return null;\n  }\n}\n\n/// <summary>\n/// Wraps InteractiveBrowserCredential to automatically capture and persist the AuthenticationRecord\n/// after the first successful authentication. This enables silent auth across future sessions.\n/// </summary>\nsealed class CaptureAuthRecordCredential : TokenCredential {\n  private readonly InteractiveBrowserCredential inner_;\n  private bool authRecordCaptured_;\n  private readonly object captureLock_ = new();\n\n  public CaptureAuthRecordCredential(InteractiveBrowserCredential inner) {\n    inner_ = inner;\n  }\n\n  public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) {\n    var token = inner_.GetToken(requestContext, cancellationToken);\n    CaptureAuthRecordIfNeeded();\n    return token;\n  }\n\n  public override async ValueTask<AccessToken> GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) {\n    var token = await inner_.GetTokenAsync(requestContext, cancellationToken).ConfigureAwait(false);\n    await CaptureAuthRecordIfNeededAsync().ConfigureAwait(false);\n    return token;\n  }\n\n  private void CaptureAuthRecordIfNeeded() {\n    if (authRecordCaptured_) {\n      return;\n    }\n\n    lock (captureLock_) {\n      if (authRecordCaptured_) {\n        return;\n      }\n\n      try {\n        // Authenticate() returns the current AuthenticationRecord without prompting again\n        var record = Utils.RunSync(() => inner_.AuthenticateAsync());\n        PDBDebugInfoProvider.SaveAuthenticationRecord(record);\n        authRecordCaptured_ = true;\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"[Auth] Failed to capture authentication record: {ex.Message}\");\n      }\n    }\n  }\n\n  private async Task CaptureAuthRecordIfNeededAsync() {\n    if (authRecordCaptured_) {\n      return;\n    }\n\n    lock (captureLock_) {\n      if (authRecordCaptured_) {\n        return;\n      }\n\n      try {\n        // Authenticate() returns the current AuthenticationRecord without prompting again\n        var record = Utils.RunSync(() => inner_.AuthenticateAsync());\n        PDBDebugInfoProvider.SaveAuthenticationRecord(record);\n        authRecordCaptured_ = true;\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"[Auth] Failed to capture authentication record: {ex.Message}\");\n      }\n    }\n  }\n}\n\n/// <summary>\n/// Wraps a TokenCredential to catch authentication failures and convert them to\n/// CredentialUnavailableException so ChainedTokenCredential continues to the next credential.\n/// This ensures that if VS auth needs re-authentication, we fall through to browser auth.\n/// </summary>\nsealed class FallbackTokenCredential : TokenCredential {\n  private readonly TokenCredential inner_;\n\n  public FallbackTokenCredential(TokenCredential inner) {\n    inner_ = inner;\n  }\n\n  public override AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken) {\n    try {\n      return inner_.GetToken(requestContext, cancellationToken);\n    }\n    catch (CredentialUnavailableException) {\n      throw; // Let this pass through - it's expected\n    }\n    catch (Exception ex) {\n      // Convert other auth failures to CredentialUnavailableException so chain continues\n      throw new CredentialUnavailableException($\"{inner_.GetType().Name} failed: {ex.Message}\", ex);\n    }\n  }\n\n  public override ValueTask<AccessToken> GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken) {\n    return GetTokenAsyncImpl(requestContext, cancellationToken);\n  }\n\n  private async ValueTask<AccessToken> GetTokenAsyncImpl(TokenRequestContext requestContext, CancellationToken cancellationToken) {\n    try {\n      return await inner_.GetTokenAsync(requestContext, cancellationToken).ConfigureAwait(false);\n    }\n    catch (CredentialUnavailableException) {\n      throw; // Let this pass through - it's expected\n    }\n    catch (Exception ex) {\n      // Convert other auth failures to CredentialUnavailableException so chain continues\n      throw new CredentialUnavailableException($\"{inner_.GetType().Name} failed: {ex.Message}\", ex);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/PEBinaryInfoProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection.PortableExecutable;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing Microsoft.Diagnostics.Symbols;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Binary;\n\n/// <summary>\n/// Contains version information extracted from a PE file's version resource.\n/// </summary>\npublic sealed class PEVersionInfo {\n  public string CompanyName { get; init; }\n  public string ProductName { get; init; }\n  public string FileDescription { get; init; }\n  public string LegalCopyright { get; init; }\n  public string OriginalFilename { get; init; }\n\n  /// <summary>\n  /// Checks if any of the version info fields contain the specified text (case-insensitive).\n  /// </summary>\n  public bool ContainsText(string text) {\n    if (string.IsNullOrEmpty(text)) {\n      return false;\n    }\n\n    return ContainsTextInternal(CompanyName, text) ||\n           ContainsTextInternal(ProductName, text) ||\n           ContainsTextInternal(FileDescription, text) ||\n           ContainsTextInternal(LegalCopyright, text);\n  }\n\n  /// <summary>\n  /// Checks if any of the version info fields contain any of the specified texts (case-insensitive).\n  /// </summary>\n  public bool ContainsAnyText(IEnumerable<string> texts) {\n    foreach (var text in texts) {\n      if (ContainsText(text)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  private static bool ContainsTextInternal(string field, string text) {\n    return !string.IsNullOrEmpty(field) &&\n           field.Contains(text, StringComparison.OrdinalIgnoreCase);\n  }\n\n  public override string ToString() {\n    return $\"Company: {CompanyName ?? \"N/A\"}, Product: {ProductName ?? \"N/A\"}, Description: {FileDescription ?? \"N/A\"}\";\n  }\n}\n\npublic sealed class PEBinaryInfoProvider : IBinaryInfoProvider, IDisposable {\n  private static ConcurrentDictionary<BinaryFileDescriptor, BinaryFileSearchResult> resolvedBinariesCache_ = new();\n  private static ConcurrentDictionary<string, PEVersionInfo> versionInfoCache_ = new();\n  private string filePath_;\n  private PEReader reader_;\n\n  public PEBinaryInfoProvider(string filePath) {\n    filePath_ = filePath;\n  }\n\n  public List<SectionHeader> CodeSectionHeaders {\n    get {\n      var list = new List<SectionHeader>();\n\n      if (reader_.PEHeaders.PEHeader == null) {\n        return list;\n      }\n\n      foreach (var section in reader_.PEHeaders.SectionHeaders) {\n        if (section.SectionCharacteristics.HasFlag(SectionCharacteristics.MemExecute) ||\n            section.SectionCharacteristics.HasFlag(SectionCharacteristics.ContainsCode)) {\n          list.Add(section);\n        }\n      }\n\n      return list;\n    }\n  }\n\n  public SymbolFileDescriptor SymbolFileInfo {\n    get {\n      foreach (var entry in reader_.ReadDebugDirectory()) {\n        if (entry.Type == DebugDirectoryEntryType.CodeView) {\n          try {\n            var dir = reader_.ReadCodeViewDebugDirectoryData(entry);\n            return new SymbolFileDescriptor(dir.Path, dir.Guid, dir.Age);\n          }\n          catch (BadImageFormatException) {\n            // PE reader has problems with some old binaries.\n          }\n\n          break;\n        }\n      }\n\n      return null;\n    }\n  }\n\n  public BinaryFileDescriptor BinaryFileInfo {\n    get {\n      if (reader_.PEHeaders.PEHeader == null) {\n        return null;\n      }\n\n      var fileKind = BinaryFileKind.Native;\n\n      if (reader_.HasMetadata && reader_.PEHeaders.CorHeader != null) {\n        if (reader_.PEHeaders.CorHeader.Flags.HasFlag(CorFlags.ILOnly)) {\n          fileKind = BinaryFileKind.DotNet;\n        }\n        else if (reader_.PEHeaders.CorHeader.Flags.HasFlag(CorFlags.ILLibrary)) {\n          fileKind = BinaryFileKind.DotNetR2R;\n        }\n      }\n\n      // For AMR64 EC binaries, they may show up as AMD64, but have the hybrid metadata table set,\n      // consider them ARM64 binaries instead so that disassembly works as expected.\n      var architecture = reader_.PEHeaders.CoffHeader.Machine;\n\n      if (architecture == Machine.Amd64 && IsARM64ECBinary()) {\n        architecture = Machine.Arm64;\n      }\n\n      return new BinaryFileDescriptor {\n        ImageName = Utils.TryGetFileName(filePath_),\n        ImagePath = filePath_,\n        Architecture = architecture,\n        FileKind = fileKind,\n        Checksum = reader_.PEHeaders.PEHeader.CheckSum,\n        TimeStamp = reader_.PEHeaders.CoffHeader.TimeDateStamp,\n        ImageSize = reader_.PEHeaders.PEHeader.SizeOfImage,\n        CodeSize = reader_.PEHeaders.PEHeader.SizeOfCode,\n        ImageBase = (long)reader_.PEHeaders.PEHeader.ImageBase,\n        BaseOfCode = reader_.PEHeaders.PEHeader.BaseOfCode,\n        MajorVersion = reader_.PEHeaders.PEHeader.MajorImageVersion,\n        MinorVersion = reader_.PEHeaders.PEHeader.MinorImageVersion\n      };\n    }\n  }\n\n  public void Dispose() {\n    reader_?.Dispose();\n  }\n\n  public static BinaryFileDescriptor GetBinaryFileInfo(string filePath) {\n    using var binaryInfo = new PEBinaryInfoProvider(filePath);\n\n    if (binaryInfo.Initialize()) {\n      return binaryInfo.BinaryFileInfo;\n    }\n\n    return null;\n  }\n\n  public static SymbolFileDescriptor GetSymbolFileInfo(string filePath) {\n    using var binaryInfo = new PEBinaryInfoProvider(filePath);\n\n    if (binaryInfo.Initialize()) {\n      return binaryInfo.SymbolFileInfo;\n    }\n\n    return null;\n  }\n\n  /// <summary>\n  /// Gets version information (Company, Product, Description, Copyright) from a PE file.\n  /// Uses FileVersionInfo which reads the version resource from the PE file.\n  /// </summary>\n  public static PEVersionInfo GetVersionInfo(string filePath) {\n    if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath)) {\n      return null;\n    }\n\n    // Check cache first\n    if (versionInfoCache_.TryGetValue(filePath, out var cached)) {\n      return cached;\n    }\n\n    try {\n      var fileVersionInfo = FileVersionInfo.GetVersionInfo(filePath);\n      var versionInfo = new PEVersionInfo {\n        CompanyName = fileVersionInfo.CompanyName,\n        ProductName = fileVersionInfo.ProductName,\n        FileDescription = fileVersionInfo.FileDescription,\n        LegalCopyright = fileVersionInfo.LegalCopyright,\n        OriginalFilename = fileVersionInfo.OriginalFilename\n      };\n\n      versionInfoCache_.TryAdd(filePath, versionInfo);\n      return versionInfo;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to read version info from {filePath}: {ex.Message}\");\n      return null;\n    }\n  }\n\n  /// <summary>\n  /// Checks if a PE file's version info matches any of the specified company filter strings.\n  /// Returns true if any filter string is found in Company, Product, Description, or Copyright fields.\n  /// Returns true if no filters are specified (empty/null list).\n  /// Returns true if the file doesn't exist or version info cannot be read (fail-open for safety).\n  /// </summary>\n  public static bool MatchesCompanyFilter(string filePath, IReadOnlyList<string> companyFilters) {\n    // No filter specified - accept all\n    if (companyFilters == null || companyFilters.Count == 0) {\n      return true;\n    }\n\n    var versionInfo = GetVersionInfo(filePath);\n\n    // If we can't read version info, accept the file (fail-open)\n    if (versionInfo == null) {\n      return true;\n    }\n\n    return versionInfo.ContainsAnyText(companyFilters);\n  }\n\n  public static async Task<BinaryFileSearchResult> LocateBinaryFileAsync(BinaryFileDescriptor binaryFile,\n                                                                         SymbolFileSourceSettings settings) {\n    // Check if the binary was requested before.\n    if (resolvedBinariesCache_.TryGetValue(binaryFile, out var searchResult)) {\n      return searchResult;\n    }\n\n    return await Task.Run(() => {\n      return LocateBinaryFile(binaryFile, settings);\n    }).ConfigureAwait(false);\n  }\n\n  public static BinaryFileSearchResult LocateBinaryFile(BinaryFileDescriptor binaryFile,\n                                                        SymbolFileSourceSettings settings) {\n    var sw = Stopwatch.StartNew();\n    \n    // Check if the binary was requested before.\n    if (resolvedBinariesCache_.TryGetValue(binaryFile, out var searchResult)) {\n      DiagnosticLogger.LogDebug($\"[BinarySearch] Cache hit for {binaryFile.ImageName}\");\n      return searchResult;\n    }\n\n    DiagnosticLogger.LogInfo($\"[BinarySearch] Starting binary search for {binaryFile.ImageName} (Size: {binaryFile.ImageSize}, Timestamp: {binaryFile.TimeStamp})\");\n\n    // Check if this binary was previously rejected (failed lookup in a prior session).\n    if (settings.IsRejectedBinaryFile(binaryFile)) {\n      DiagnosticLogger.LogInfo($\"[BinarySearch] SKIPPED - previously rejected: {binaryFile.ImageName}\");\n      searchResult = BinaryFileSearchResult.Failure(binaryFile, \"Previously rejected\");\n      resolvedBinariesCache_.TryAdd(binaryFile, searchResult);\n      return searchResult;\n    }\n\n    // Resolve NT kernel paths like \\SystemRoot\\system32\\ntoskrnl.exe\n    // to actual file system paths like C:\\Windows\\system32\\ntoskrnl.exe.\n    string resolvedPath = ResolveNtKernelPath(binaryFile.ImagePath);\n    if (resolvedPath != binaryFile.ImagePath) {\n      DiagnosticLogger.LogInfo($\"[BinarySearch] Resolved NT path for {binaryFile.ImageName}: {binaryFile.ImagePath} -> {resolvedPath}\");\n      binaryFile.ImagePath = resolvedPath;\n    }\n\n    // Quick check if trace was recorded on local machine.\n    string approximateMatchPath = null;\n    long correctedImageSize = 0;\n    string result = FindExactLocalBinaryFile(binaryFile, out approximateMatchPath, out correctedImageSize);\n\n    if (result != null) {\n      DiagnosticLogger.LogInfo($\"[BinarySearch] Found exact local binary for {binaryFile.ImageName} at {result} ({sw.ElapsedMilliseconds}ms)\");\n      binaryFile = GetBinaryFileInfo(result);\n      searchResult = BinaryFileSearchResult.Success(binaryFile, result, \"\");\n      resolvedBinariesCache_.TryAdd(binaryFile, searchResult);\n      return searchResult;\n    }\n\n    // Correct ImageSize if the file exists locally with matching timestamp but\n    // different size. The symbol server indexes binaries by TimeDateStamp+SizeOfImage\n    // from the PE header, but the ETW kernel event may report a larger mapped view size\n    // (the kernel mapping can include extra slack pages). Using the wrong size causes\n    // 404s on the symbol server even when the binary IS indexed there.\n    if (correctedImageSize > 0 && correctedImageSize != binaryFile.ImageSize) {\n      DiagnosticLogger.LogInfo(\n        $\"[BinarySearch] Correcting ImageSize for {binaryFile.ImageName} from ETW value {binaryFile.ImageSize} \" +\n        $\"to PE SizeOfImage {correctedImageSize} for symbol server lookup\");\n      binaryFile.ImageSize = correctedImageSize;\n    }\n\n    using var logWriter = new StringWriter();\n\n    try {\n      // Try to use symbol server to download binary.\n      // Add local binary path directly instead of using WithSymbolPaths (which clones\n      // settings again and resets runtime state like timeout overrides).\n      if (File.Exists(binaryFile.ImagePath)) {\n        settings.InsertSymbolPath(binaryFile.ImagePath);\n      }\n\n      string userSearchPath = PDBDebugInfoProvider.ConstructSymbolSearchPath(settings);\n\n      //? TODO: Making a new instance clears the \"dead servers\",\n      //? have a way to share the list between multiple instances.\n      using var symbolReader =\n        new SymbolReader(logWriter, userSearchPath, PDBDebugInfoProvider.CreateAuthHandler(settings));\n      symbolReader.SecurityCheck += s => true; // Allow symbols from \"unsafe\" locations.\n\n      // Set symbol server timeout from settings (default 10 seconds).\n      // Use EffectiveTimeoutSeconds which is reduced if bellwether test marked server as degraded.\n      int timeoutSeconds = settings.EffectiveTimeoutSeconds > 0 ? settings.EffectiveTimeoutSeconds : 10;\n      symbolReader.ServerTimeout = TimeSpan.FromSeconds(timeoutSeconds);\n      DiagnosticLogger.LogInfo($\"[BinarySearch] ServerTimeout={timeoutSeconds}s, RejectPreviouslyFailedFiles={settings.RejectPreviouslyFailedFiles}, \" +\n                               $\"RejectedBinaries={settings.RejectedBinaryFiles?.Count ?? 0} for {binaryFile.ImageName}\");\n\n      //? TODO: Workaround for cases where the ETL file doesn't have a timestamp\n      //? and SymbolReader would reject the bin even on the same machine...\n      //? Better way to handle this is to have SymReader accept a func to check if PDB is valid to use\n      if (binaryFile.TimeStamp == 0 && File.Exists(binaryFile.ImagePath)) {\n        var binInfo = GetBinaryFileInfo(binaryFile.ImagePath);\n        binaryFile.TimeStamp = binInfo.TimeStamp;\n      }\n\n      //Trace.WriteLine($\"Start download of {Utils.TryGetFileName(binaryFile.ImageName)}\");\n      result = symbolReader.FindExecutableFilePath(binaryFile.ImageName,\n                                                   binaryFile.TimeStamp,\n                                                   (int)binaryFile.ImageSize);\n\n      if (result == null) {\n        // Finally, try an approximate manual search.\n        DiagnosticLogger.LogDebug($\"[BinarySearch] Symbol server search failed, trying approximate local search for {binaryFile.ImageName}\");\n        result = FindMatchingLocalBinaryFile(binaryFile, settings, ref approximateMatchPath);\n      }\n    }\n    catch (Exception ex) {\n      DiagnosticLogger.LogError($\"[BinarySearch] Exception during binary search for {binaryFile.ImageName}: {ex.Message}\", ex);\n      Trace.TraceError($\"Failed FindExecutableFilePath: {ex.Message}\");\n    }\n\n    var searchDuration = sw.Elapsed;\n    string searchLog = logWriter.ToString();\n    \n#if DEBUG\n    Trace.WriteLine($\">> TraceEvent FindExecutableFilePath for {binaryFile.ImageName}\");\n    Trace.WriteLine(searchLog);\n    Trace.WriteLine(\"<< TraceEvent\");\n#endif\n\n    if (!string.IsNullOrEmpty(result) && File.Exists(result)) {\n      DiagnosticLogger.LogInfo($\"[BinarySearch] Found binary for {binaryFile.ImageName} at {result} ({searchDuration.TotalMilliseconds:F0}ms)\");\n      // Read the binary info from the local file to fill in all fields.\n      binaryFile = GetBinaryFileInfo(result);\n      searchResult = BinaryFileSearchResult.Success(binaryFile, result, searchLog);\n    }\n    else if (settings.AllowApproximateBinaryMatch &&\n             !string.IsNullOrEmpty(approximateMatchPath) &&\n             File.Exists(approximateMatchPath)) {\n      // Fallback: use a binary with matching timestamp but different size.\n      // This handles cases where the kernel-reported ImageSize in the ETW trace\n      // differs from the PE header SizeOfImage, or the DLL was serviced.\n      long traceImageSize = binaryFile.ImageSize;\n      var originalDescriptor = binaryFile;\n      DiagnosticLogger.LogWarning(\n        $\"[BinarySearch] Using APPROXIMATE match for {binaryFile.ImageName} \" +\n        $\"at {approximateMatchPath} ({searchDuration.TotalMilliseconds:F0}ms) - \" +\n        $\"timestamp matches but image size differs\");\n      binaryFile = GetBinaryFileInfo(approximateMatchPath);\n      string details = $\"Approximate match: timestamp matches but image size differs \" +\n        $\"(trace: {traceImageSize}, on-disk: {binaryFile.ImageSize}). Disassembly may not be fully accurate.\\n{searchLog}\";\n      searchResult = BinaryFileSearchResult.ApproximateSuccess(binaryFile, approximateMatchPath, details);\n      // Cache under the original trace descriptor so subsequent lookups for the\n      // same trace module hit the cache instead of repeating the search.\n      resolvedBinariesCache_.TryAdd(originalDescriptor, searchResult);\n    }\n    else {\n      DiagnosticLogger.LogWarning($\"[BinarySearch] Failed to find binary for {binaryFile.ImageName} ({searchDuration.TotalMilliseconds:F0}ms)\");\n      searchResult = BinaryFileSearchResult.Failure(binaryFile, searchLog);\n\n      // Record failed lookup to avoid retrying in future sessions,\n      // but skip transient failures (timeout, auth, server errors).\n      var reason = settings.ClassifySearchFailure(searchLog);\n      settings.RejectBinaryFile(binaryFile, reason, searchLog);\n    }\n\n    resolvedBinariesCache_.TryAdd(binaryFile, searchResult);\n    return searchResult;\n  }\n\n  private static string ResolveNtKernelPath(string path) {\n    if (string.IsNullOrEmpty(path)) {\n      return path;\n    }\n\n    if (path.StartsWith(@\"\\SystemRoot\", StringComparison.OrdinalIgnoreCase)) {\n      string systemRoot = Environment.GetEnvironmentVariable(\"SystemRoot\") ?? @\"C:\\Windows\";\n      return systemRoot + path.Substring(@\"\\SystemRoot\".Length);\n    }\n\n    return path;\n  }\n\n  private static string FindExactLocalBinaryFile(BinaryFileDescriptor binaryFile,\n                                                  out string approximateMatchPath,\n                                                  out long correctedImageSize) {\n    approximateMatchPath = null;\n    correctedImageSize = 0;\n\n    if (File.Exists(binaryFile.ImagePath)) {\n      var fileInfo = GetBinaryFileInfo(binaryFile.ImagePath);\n\n      if (fileInfo != null && fileInfo.TimeStamp == binaryFile.TimeStamp) {\n        if (fileInfo.ImageSize == binaryFile.ImageSize) {\n          return binaryFile.ImagePath;\n        }\n\n        // Timestamp matches but size differs. This commonly happens because the\n        // kernel-reported ImageSize in ETW events is the mapped view size, which\n        // can exceed the PE header's SizeOfImage by a few pages of slack.\n        // Record the local file as an approximate match and save the PE SizeOfImage\n        // so we can correct the symbol server lookup key.\n        approximateMatchPath = binaryFile.ImagePath;\n        correctedImageSize = fileInfo.ImageSize;\n        DiagnosticLogger.LogInfo(\n          $\"[BinarySearch] Local binary for {binaryFile.ImageName} at {binaryFile.ImagePath}: \" +\n          $\"timestamp matches ({fileInfo.TimeStamp}), size differs \" +\n          $\"(PE SizeOfImage: {fileInfo.ImageSize}, ETW ImageSize: {binaryFile.ImageSize})\");\n      }\n    }\n\n    return null;\n  }\n\n  private static string FindMatchingLocalBinaryFile(BinaryFileDescriptor binaryFile,\n                                                    SymbolFileSourceSettings settings,\n                                                    ref string approximateMatchPath) {\n    // Manually search in the provided directories.\n    // This helps in cases where the original fine name doesn't match\n    // the one on disk, like it seems to happen sometimes with the SPEC runner.\n    string winPath = Environment.GetFolderPath(Environment.SpecialFolder.Windows);\n    string sysPath = Environment.GetFolderPath(Environment.SpecialFolder.System);\n    string sysx86Path = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86);\n\n    // Don't search in the system dirs though, it's pointless\n    // and takes a long time checking thousands of binaries.\n    bool PathIsSubPath(string subPath, string basePath) {\n      string rel = Path.GetRelativePath(basePath, subPath);\n      return !rel.StartsWith('.') && !Path.IsPathRooted(rel);\n    }\n\n    foreach (string path in settings.SymbolPaths) {\n      if (PathIsSubPath(path, winPath) ||\n          PathIsSubPath(path, sysPath) ||\n          PathIsSubPath(path, sysx86Path)) {\n        continue;\n      }\n\n      try {\n        string searchPath = Utils.TryGetDirectoryName(path);\n\n        foreach (string file in Directory.EnumerateFiles(searchPath, \"*.*\", SearchOption.AllDirectories)) {\n          if (!Utils.IsBinaryFile(file)) {\n            continue;\n          }\n\n          var fileInfo = GetBinaryFileInfo(file);\n\n          if (fileInfo != null && fileInfo.TimeStamp == binaryFile.TimeStamp) {\n            if (fileInfo.ImageSize == binaryFile.ImageSize) {\n              return file;\n            }\n\n            // Track first approximate match (timestamp matches, size differs).\n            if (approximateMatchPath == null) {\n              approximateMatchPath = file;\n              DiagnosticLogger.LogInfo(\n                $\"[BinarySearch] Approximate match for {binaryFile.ImageName} in search paths: \" +\n                $\"{file} (on-disk: {fileInfo.ImageSize}, trace: {binaryFile.ImageSize})\");\n            }\n          }\n        }\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Exception searching for binary {binaryFile.ImageName} in {path}: {ex.Message}\");\n      }\n    }\n\n    return null;\n  }\n\n  public bool Initialize() {\n    if (!File.Exists(filePath_)) {\n      return false;\n    }\n\n    try {\n      var stream = File.OpenRead(filePath_);\n      reader_ = new PEReader(stream);\n      return reader_.PEHeaders != null; // Throws BadImageFormatException on invalid file.\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to read PE binary file: {filePath_}\");\n      return false;\n    }\n  }\n\n  public ReadOnlyMemory<byte> GetSectionData(SectionHeader header) {\n    var data = reader_.GetSectionData(header.VirtualAddress);\n    var array = data.GetContent();\n    return array.AsMemory();\n  }\n\n  private bool IsARM64ECBinary() {\n    if (reader_.PEHeaders.PEHeader == null ||\n        reader_.PEHeaders.PEHeader.LoadConfigTableDirectory.Size <= 0 ||\n        !reader_.PEHeaders.TryGetDirectoryOffset(reader_.PEHeaders.PEHeader.LoadConfigTableDirectory, out int offset)) {\n      return false;\n    }\n\n    var imageData = reader_.GetEntireImage();\n    var configTableData = imageData.GetContent(offset, reader_.PEHeaders.PEHeader.LoadConfigTableDirectory.Size);\n    var span = MemoryMarshal.Cast<byte, IMAGE_LOAD_CONFIG_DIRECTORY64>(configTableData.AsSpan());\n    return span.Length > 0 && span[0].CHPEMetadataPointer != 0;\n  }\n\n  [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]\n  public struct IMAGE_LOAD_CONFIG_DIRECTORY64 {\n    public uint Size;\n    public uint TimeDateStamp;\n    public ushort MajorVersion;\n    public ushort MinorVersion;\n    public uint GlobalFlagsClear;\n    public uint GlobalFlagsSet;\n    public uint CriticalSectionDefaultTimeout;\n    public ulong DeCommitFreeBlockThreshold;\n    public ulong DeCommitTotalFreeThreshold;\n    public ulong LockPrefixTable;\n    public ulong MaximumAllocationSize;\n    public ulong VirtualMemoryThreshold;\n    public ulong ProcessAffinityMask;\n    public uint ProcessHeapFlags;\n    public ushort CSDVersion;\n    public ushort DependentLoadFlags;\n    public ulong EditList;\n    public ulong SecurityCookie;\n    public ulong SEHandlerTable;\n    public ulong SEHandlerCount;\n    public ulong GuardCFCheckFunctionPointer;\n    public ulong GuardCFDispatchFunctionPointer;\n    public ulong GuardCFFunctionTable;\n    public ulong GuardCFFunctionCount;\n    public uint GuardFlags;\n    public IMAGE_LOAD_CONFIG_CODE_INTEGRITY CodeIntegrity;\n    public ulong GuardAddressTakenIatEntryTable;\n    public ulong GuardAddressTakenIatEntryCount;\n    public ulong GuardLongJumpTargetTable;\n    public ulong GuardLongJumpTargetCount;\n    public ulong DynamicValueRelocTable;\n    public ulong CHPEMetadataPointer;\n    public ulong GuardRFFailureRoutine;\n    public ulong GuardRFFailureRoutineFunctionPointer;\n    public uint DynamicValueRelocTableOffset;\n    public ushort DynamicValueRelocTableSection;\n    public ushort Reserved2;\n    public ulong GuardRFVerifyStackPointerFunctionPointer;\n    public uint HotPatchTableOffset;\n    public uint Reserved3;\n    public ulong EnclaveConfigurationPointer;\n    public ulong VolatileMetadataPointer;\n    public ulong GuardEHContinuationTable;\n    public ulong GuardEHContinuationCount;\n  }\n\n  [StructLayout(LayoutKind.Sequential)]\n  public struct IMAGE_LOAD_CONFIG_CODE_INTEGRITY {\n    public ushort Flags;\n    public ushort Catalog;\n    public uint CatalogOffset;\n    public uint Reserved;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/SourceFileDebugInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Binary;\n\n[ProtoContract(SkipConstructor = true)]\npublic struct SourceFileDebugInfo : IEquatable<SourceFileDebugInfo> {\n  public SourceFileDebugInfo(string filePath, string originalFilePath, int startLine = 0,\n                             bool hasChecksumMismatch = false) {\n    FilePath = filePath != null ? string.Intern(filePath) : null;\n    OriginalFilePath = originalFilePath != null ? string.Intern(originalFilePath) : null;\n    StartLine = startLine;\n    HasChecksumMismatch = hasChecksumMismatch;\n  }\n\n  [ProtoMember(1)]\n  public string FilePath { get; set; }\n  [ProtoMember(2)]\n  public string OriginalFilePath { get; set; }\n  [ProtoMember(3)]\n  public int StartLine { get; set; }\n  [ProtoMember(4)]\n  public bool HasChecksumMismatch { get; set; }\n  public static readonly SourceFileDebugInfo Unknown = new(null, null, -1);\n  public bool IsUnknown => FilePath == null;\n  public bool HasFilePath => !string.IsNullOrEmpty(FilePath);\n  public bool HasOriginalFilePath => !string.IsNullOrEmpty(OriginalFilePath);\n\n  public bool Equals(SourceFileDebugInfo other) {\n    return FilePath.Equals(other.FilePath, StringComparison.Ordinal) &&\n           OriginalFilePath.Equals(other.OriginalFilePath, StringComparison.Ordinal) &&\n           StartLine == other.StartLine &&\n           HasChecksumMismatch == other.HasChecksumMismatch;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is SourceFileDebugInfo other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(FilePath, OriginalFilePath, StartLine, HasChecksumMismatch);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/SourceLineDebugInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Binary;\n\n[ProtoContract(SkipConstructor = true)]\npublic struct SourceLineDebugInfo : IEquatable<SourceLineDebugInfo> {\n  [ProtoMember(1)]\n  public int OffsetStart { get; set; } // Offset in bytes relative to function start.\n  [ProtoMember(2)]\n  public int OffsetEnd { get; set; } // Offset in bytes relative to function start.\n  [ProtoMember(3)]\n  public int Line { get; set; }\n  [ProtoMember(4)]\n  public int Column { get; set; }\n  [ProtoMember(5)]\n  public string FilePath { get; private set; } //? Move to FunctionDebugInfo, add OriginalFilePath for SourceLink\n  public List<SourceStackFrame> Inlinees { get; set; }\n  public static readonly SourceLineDebugInfo Unknown = new(-1, -1);\n  public bool IsUnknown => Line == -1;\n\n  public SourceLineDebugInfo(int offsetStart, int line, int column = 0, string filePath = null) {\n    OffsetStart = offsetStart;\n    OffsetEnd = offsetStart;\n    Line = line;\n    Column = column;\n    FilePath = filePath != null ? string.Intern(filePath) : null;\n  }\n\n  public void AddInlinee(SourceStackFrame inlinee) {\n    Inlinees ??= new List<SourceStackFrame>();\n    Inlinees.Add(inlinee);\n  }\n\n  public bool HasInlinee(SourceStackFrame inlinee) {\n    return Inlinees != null && Inlinees.Contains(inlinee);\n  }\n\n  public SourceStackFrame FindSameFunctionInlinee(SourceStackFrame inlinee) {\n    return Inlinees?.Find(item => item.HasSameFunction(inlinee));\n  }\n\n  public bool Equals(SourceLineDebugInfo other) {\n    return OffsetStart == other.OffsetStart && Line == other.Line &&\n           Column == other.Column &&\n           FilePath.Equals(other.FilePath, StringComparison.Ordinal);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is SourceLineDebugInfo other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(FilePath, Line, Column);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Binary/SymbolFileCache.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.FileFormat;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Binary;\n\n[ProtoContract]\npublic class SymbolFileCache {\n  private static int CurrentFileVersion = 2;\n  private static int MinSupportedFileVersion = 2;\n  [ProtoMember(1)]\n  public int Version { get; set; }\n  [ProtoMember(2)]\n  public SymbolFileDescriptor SymbolFile { get; set; }\n  [ProtoMember(3)]\n  public List<FunctionDebugInfo> FunctionList { get; set; }\n  public static string DefaultCacheDirectoryPath => Path.Combine(Path.GetTempPath(), \"ProfileExplorer\", \"symcache\");\n\n  public static async Task<bool> SerializeAsync(SymbolFileCache symCache, string directoryPath) {\n    try {\n      symCache.Version = CurrentFileVersion;\n      var outStream = new MemoryStream();\n      Serializer.Serialize(outStream, symCache);\n      outStream.Position = 0;\n\n      if (!Directory.Exists(directoryPath)) {\n        Directory.CreateDirectory(directoryPath);\n      }\n\n      string cacheFile = MakeCacheFilePath(symCache.SymbolFile);\n      string cachePath = Path.Combine(directoryPath, cacheFile);\n\n      //? TODO: Convert everything to RunSync or add the support in the FileArchive\n      return await FileArchive.CreateFromStreamAsync(outStream, cacheFile, cachePath).ConfigureAwait(false);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to save symbol file cache: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static async Task<SymbolFileCache> DeserializeAsync(SymbolFileDescriptor symbolFile, string directoryPath) {\n    try {\n      string cacheFile = MakeCacheFilePath(symbolFile);\n      string cachePath = Path.Combine(directoryPath, cacheFile);\n\n      if (!File.Exists(cachePath)) {\n        return null;\n      }\n\n      using var archive = await FileArchive.LoadAsync(cachePath).ConfigureAwait(false);\n\n      if (archive != null) {\n        using var stream = await archive.ExtractFileToMemoryAsync(cacheFile);\n\n        if (stream != null) {\n          var symCache = Serializer.Deserialize<SymbolFileCache>(stream);\n\n          if (symCache.Version < MinSupportedFileVersion) {\n            Trace.WriteLine($\"File version mismatch in deserialized symbol file cache\");\n            Trace.WriteLine($\"  actual: {symCache.Version} vs min supported {MinSupportedFileVersion}\");\n            return null;\n          }\n\n          // Ensure it's a cache for the same symbol file.\n          if (symCache.SymbolFile.Equals(symbolFile)) {\n            return symCache;\n          }\n\n          Trace.WriteLine($\"Symbol file mismatch in deserialized symbol file cache\");\n          Trace.WriteLine($\"  actual: {symCache.SymbolFile} vs expected {symbolFile}\");\n        }\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to load symbol file cache: {ex.Message}\");\n    }\n\n    return null;\n  }\n\n  private static string MakeCacheFilePath(SymbolFileDescriptor symbolFile) {\n    return $\"{Utils.TryGetFileName(symbolFile.FileName)}-{symbolFile.Id}-{symbolFile.Age}.cache\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Collections/CompressedSegmentedList.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// Uncomment to disable compression.\n// #define DISABLE_COMPRESSION\nusing System;\nusing System.Buffers;\nusing System.Collections;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO.Compression;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\n\nnamespace ProfileExplorer.Core.Collections;\n\npublic sealed class CompressedSegmentedList<T> : IDisposable, IList<T> where T : struct {\n  // The GC Large Object Heap is used for allocations > 85 KB,\n  // ensure each segments stays below that limit.\n  private const int LOHObjectSize = 80 * 1024;\n  private static readonly int SegmentLength = Math.Max(1, LOHObjectSize / Unsafe.SizeOf<T>());\n  private List<Segment> segments_;\n  private Segment activeSegment_;\n  private int count_; // Total number of items in all segments.\n  private int segmentLength_; // Number of items per segment.\n  private int prefetchLimit_; // Segments to prefetch ahead.\n  private BlockingCollection<Task> taskQueue_; // Pending compression tasks.\n  private List<Task> taskQueueThreadTasks_; // Tasks representing the compression threads.\n#if DEBUG\n  private int version_;\n#endif\n\n  public CompressedSegmentedList(bool useThreads = true, bool prefetch = true, int prefetchLimit = 2) :\n    this(SegmentLength, useThreads, prefetch, prefetchLimit) {\n  }\n\n  public CompressedSegmentedList(int segmentLength, bool useThreads = true,\n                                 bool prefetch = true, int prefetchLimit = 2) {\n    segmentLength_ = segmentLength;\n    segments_ = new List<Segment>();\n\n    if (useThreads) {\n      prefetchLimit_ = prefetch ? prefetchLimit : 0;\n      SetupCompressionThreads();\n    }\n  }\n\n  public int Count => count_;\n  public bool IsReadOnly => false;\n\n  public T this[int index] {\n    get => GetValue(index);\n    set => SetValue(index, value);\n  }\n\n  // Round up number to the nearest multiple of the segment length.\n  public static int RoundUpToSegmentLength(int n) {\n    Debug.Assert(n > 0);\n    return ((n - 1) / SegmentLength + 1) * SegmentLength;\n  }\n\n  public void Wait(bool reset = true) {\n#if !DISABLE_COMPRESSION\n    taskQueue_.CompleteAdding();\n    Task.WhenAll(taskQueueThreadTasks_);\n    Task.WhenAll(taskQueueThreadTasks_).Wait();\n\n    if (reset) {\n      SetupCompressionThreads();\n    }\n#endif\n  }\n\n  public void CompressRange(int startIndex, int endIndex) {\n    Debug.Assert(endIndex >= startIndex);\n    int startSegment = startIndex / segmentLength_;\n    int endSegment = endIndex / segmentLength_;\n\n    if (startSegment >= segments_.Count ||\n        endSegment >= segments_.Count) {\n      Debug.Assert(false, \"Invalid segment range\");\n      return;\n    }\n\n    for (int i = startSegment; i <= endSegment; i++) {\n      segments_[i].CompressValues();\n    }\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public T GetValue(int index) {\n    Debug.Assert(index < count_);\n    int activeIndex = GetActiveSegmentIndex(index);\n\n    if (activeIndex != -1) {\n      return activeSegment_.GetValue(activeIndex);\n    }\n\n    var segment = segments_[index / segmentLength_];\n    return segment.GetValue(index % segmentLength_);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public ref T GetValueRef(int index) {\n    Debug.Assert(index < count_);\n    int activeIndex = GetActiveSegmentIndex(index);\n\n    if (activeIndex != -1) {\n      return ref activeSegment_.GetValueRef(activeIndex);\n    }\n\n    var segment = segments_[index / segmentLength_];\n    return ref segment.GetValueRef(index % segmentLength_);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public void SetValue(int index, T value) {\n    Debug.Assert(index < count_);\n    int activeIndex = GetActiveSegmentIndex(index);\n\n    if (activeIndex != -1) {\n      activeSegment_.SetValue(activeIndex, value);\n    }\n    else {\n      var segment = segments_[index / segmentLength_];\n      segment.SetValue(index % segmentLength_, value);\n    }\n#if DEBUG\n    version_++;\n#endif\n  }\n\n  public RangeEnumerator Enumerate(int rangeStart, int rangeEnd, bool recompress = true) {\n    return new RangeEnumerator(this, rangeStart, rangeEnd, recompress);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is CompressedSegmentedList<T> list &&\n           EqualityComparer<List<Segment>>.Default.Equals(segments_, list.segments_) &&\n           count_ == list.count_ &&\n           segmentLength_ == list.segmentLength_;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(segments_, count_, segmentLength_);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public void Add(T value) {\n    EnsureSegmentReady();\n    activeSegment_.AddValue(value);\n    count_++;\n#if DEBUG\n    version_++;\n#endif\n  }\n\n  public void Clear() {\n    segments_.Clear();\n    activeSegment_ = null;\n    count_ = 0;\n#if DEBUG\n    version_++;\n#endif\n  }\n\n  public bool Contains(T item) {\n    foreach (var value in this) {\n      if (value.Equals(item)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  public bool Remove(T item) {\n    throw new NotImplementedException();\n  }\n\n  public void CopyTo(T[] array, int arrayIndex) {\n    if (array.Length + arrayIndex < count_) {\n      throw new ArgumentOutOfRangeException(nameof(arrayIndex), \"Array length too small\");\n    }\n\n    foreach (var segment in segments_) {\n      segment.CopyTo(array, arrayIndex);\n      arrayIndex += segment.Count;\n    }\n  }\n\n  public void Dispose() {\n#if !DISABLE_COMPRESSION\n    // End compression tasks and free memory.\n    Wait(false);\n    taskQueue_?.Dispose();\n    taskQueue_ = null;\n\n    foreach (var task in taskQueueThreadTasks_) {\n      task.Dispose();\n    }\n\n    taskQueueThreadTasks_ = null;\n#endif\n  }\n\n  public IEnumerator<T> GetEnumerator() {\n    return Enumerate(0, Count).GetEnumerator();\n  }\n\n  public int IndexOf(T item) {\n    int index = 0;\n\n    foreach (var value in this) {\n      if (value.Equals(item)) {\n        return index;\n      }\n\n      index++;\n    }\n\n    return -1;\n  }\n\n  public void Insert(int index, T item) {\n    throw new NotImplementedException();\n  }\n\n  public void RemoveAt(int index) {\n    throw new NotImplementedException();\n  }\n\n  private void EnsureSegmentReady() {\n    // Allocate a new segment if the current one is full,\n    // then compress the previous one.\n    if (activeSegment_ == null || activeSegment_.Count == segmentLength_) {\n      if (activeSegment_ != null) {\n        activeSegment_.CompressValues();\n      }\n\n      activeSegment_ = new Segment(this, segmentLength_);\n      segments_.Add(activeSegment_);\n    }\n    else if (activeSegment_.IsCompressed) {\n      activeSegment_.DecompressValues();\n    }\n  }\n\n  private Task ScheduleCompressionTask(Action action) {\n    var task = new Task(action);\n\n    if (!taskQueue_.TryAdd(task)) {\n      task.RunSynchronously();\n    }\n\n    return task;\n  }\n\n  private void SetupCompressionThreads() {\n#if !(DISABLE_COMPRESSION)\n    taskQueue_ = new BlockingCollection<Task>();\n    taskQueueThreadTasks_ = new List<Task>();\n    int threads = 1 + prefetchLimit_; // 1 used for compression.\n\n    for (int i = 0; i < threads; i++) {\n      taskQueueThreadTasks_.Add(Task.Run(() => {\n        try {\n          while (!taskQueue_.IsCompleted) {\n            if (taskQueue_.TryTake(out var task, 1000)) {\n              // Execute the actual (de)compression task.\n              task.Start();\n              task.Wait();\n            }\n          }\n        }\n        catch (Exception ex) {\n          Trace.WriteLine($\"Failure executing compression task: {ex.Message}\");\n        }\n      }));\n    }\n#endif\n  }\n\n  private int GetActiveSegmentIndex(int index) {\n    // Check if index is in the active segment to avoid the expensive DIV below.\n    if (activeSegment_ != null) {\n      int startIndex = segments_.Count * segmentLength_;\n\n      if (index >= startIndex &&\n          index < startIndex + activeSegment_.Count) {\n        return index - startIndex;\n      }\n    }\n\n    return -1;\n  }\n\n  IEnumerator IEnumerable.GetEnumerator() {\n    return GetEnumerator();\n  }\n\n  public struct RangeEnumerator : IEnumerable<T> {\n    private CompressedSegmentedList<T> target_;\n    private int rangeStart_;\n    private int rangeEnd_;\n    private int segmentStart_;\n    private int segmentEnd_;\n    private bool recompress_;\n\n    public RangeEnumerator(CompressedSegmentedList<T> target, int rangeStart, int rangeEnd, bool recompress) {\n      Debug.Assert(rangeStart <= target.Count);\n      Debug.Assert(rangeEnd <= target.Count);\n      Debug.Assert(rangeEnd >= rangeStart);\n      target_ = target;\n      rangeStart_ = rangeStart;\n      rangeEnd_ = rangeEnd;\n      segmentStart_ = rangeStart / target.segmentLength_;\n      segmentEnd_ = rangeEnd / target.segmentLength_;\n      recompress_ = recompress;\n    }\n\n    public IEnumerator<T> GetEnumerator() {\n      if (target_.segments_.Count == 0) {\n        yield break;\n      }\n\n      int lastPrefetchIndex = segmentStart_;\n      Segment prevSegment = null;\n\n#if DEBUG\n      int initialVersion = target_.version_;\n#endif\n\n      for (int segmentIndex = segmentStart_; segmentIndex <= segmentEnd_; segmentIndex++) {\n        var segment = target_.segments_[segmentIndex];\n        segment.DecompressValues();\n\n        // // Ignore values in the segment before rangeStart and after rangeEnd.\n        int segmentValueIndex = segmentIndex * target_.segmentLength_;\n        int segmentValueStart = segmentValueIndex < rangeStart_ ? rangeStart_ - segmentValueIndex : 0;\n        int segmentValueEnd = segmentValueIndex + segment.Count > rangeEnd_ ? rangeEnd_ - segmentValueIndex\n          : segment.Count;\n\n        for (int i = segmentValueStart; i < segmentValueEnd; i++) {\n#if DEBUG\n          if (initialVersion != target_.version_) {\n            throw new InvalidOperationException(\"List modified, potential thread racing bug\");\n          }\n#endif\n          yield return segment.GetValueDirect(i);\n        }\n\n        // Prefetch segments in advance on another thread\n        // to hide the delay of decompressing the data.\n        int prefetchEnd = segmentIndex + target_.prefetchLimit_;\n\n        if (target_.prefetchLimit_ > 0 && prefetchEnd < segmentEnd_) {\n          for (; lastPrefetchIndex < prefetchEnd; lastPrefetchIndex++) {\n            target_.segments_[lastPrefetchIndex].DecompressValues(true);\n            lastPrefetchIndex = prefetchEnd;\n          }\n        }\n\n        // Re-compress the values, done on another thread.\n        // Don't compress the last segment, it's likely that more values are added to it.\n        if (recompress_) {\n          prevSegment?.CompressValues();\n        }\n\n        prevSegment = segment;\n      }\n    }\n\n    IEnumerator IEnumerable.GetEnumerator() {\n      return GetEnumerator();\n    }\n  }\n\n  private sealed class Segment {\n    private CompressedSegmentedList<T> parent_;\n    private Task activeTask_; // Task used to (de)compress, null if no pending task.\n    private byte[] data_; // Compressed value data.\n    private T[] values_; // Decompressed values, if null in compressed state.\n    private int count_; // Number of values < capacity.\n    private int size_; // Size in bytes of uncompressed capacity.\n    private object lockObject_;\n\n    public Segment(CompressedSegmentedList<T> parent, int capacity) {\n      parent_ = parent;\n      values_ = ArrayPool<T>.Shared.Rent(capacity);\n      size_ = capacity * Unsafe.SizeOf<T>();\n      lockObject_ = new object();\n    }\n\n    public int Count => count_;\n    public bool WasCompressed => data_ != null;\n    public bool IsCompressed => values_ == null;\n    public bool IsBeingCompressed => IsCompressed && !WasCompressed;\n\n    public T this[int index] {\n      get => GetValue(index);\n      set => SetValue(index, value);\n    }\n\n    private static byte[] CompressImpl(T[] values, int segmentSize) {\n      // Since the pooled array can be larger than needed, slice it to the right length.\n      var arraySpan = values.AsSpan();\n      var byteSpan = MemoryMarshal.AsBytes(arraySpan).Slice(0, segmentSize);\n\n      int bufferSize = BrotliEncoder.GetMaxCompressedLength(segmentSize);\n      byte[] tempBuffer = ArrayPool<byte>.Shared.Rent(bufferSize);\n      var bufferSpan = tempBuffer.AsSpan();\n\n      var encoder = new BrotliEncoder(5, 10);\n      var result = encoder.Compress(byteSpan, bufferSpan, out int bytesConsumed, out int bytesWritten, true);\n      Debug.Assert(result == OperationStatus.Done);\n      encoder.Flush(bufferSpan, out int extraBytesWritten);\n      bytesWritten += extraBytesWritten; // Seems to be always 0.\n\n      // Copy to another array, the initial estimate is as large as the input.\n      byte[] outBuffer = new byte[bytesWritten];\n      Array.Copy(tempBuffer, 0, outBuffer, 0, bytesWritten);\n\n      // Return array to the pool.\n      ArrayPool<byte>.Shared.Return(tempBuffer);\n      ArrayPool<T>.Shared.Return(values);\n      encoder.Dispose();\n      return outBuffer;\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public T GetValue(int index) {\n      Debug.Assert(index < count_);\n\n      if (IsCompressed) {\n        DecompressValues();\n      }\n\n      return values_[index];\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public void AddValue(T value) {\n      Debug.Assert(count_ < values_.Length);\n      values_[count_++] = value;\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public void SetValue(int index, T value) {\n      Debug.Assert(index < count_);\n      DecompressValues();\n      values_[index] = value;\n\n      // If the values were compressed before, discard the data\n      // since it doesn't match the current values anymore.\n      if (WasCompressed) {\n        lock (lockObject_) {\n          data_ = null;\n        }\n      }\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public ref T GetValueRef(int index) {\n      Debug.Assert(index < count_);\n      DecompressValues();\n\n      // If the values were compressed before, discard the data\n      // since it doesn't match the current values anymore.\n      if (WasCompressed) {\n        lock (this) {\n          data_ = null;\n        }\n      }\n\n      return ref values_[index];\n    }\n\n    public void DecompressValues(bool prefetch = false) {\n      if (!IsCompressed) {\n        // Already decompressed.\n        Debug.Assert(values_ != null);\n        return;\n      }\n\n      // Check if another (de)compression task is running and wait for it.\n      // activeTask_ is being reseet by the thread, use a copy.\n      Task task = null;\n\n      lock (lockObject_) {\n        task = activeTask_;\n      }\n\n      if (task != null) {\n        task.Wait();\n\n        if (!IsCompressed) {\n          Debug.Assert(values_ != null);\n          return;\n        }\n      }\n\n      // Decompress the data. In prefetch mode run it on another thread.\n      lock (this) {\n        if (!IsCompressed) {\n          Debug.Assert(values_ != null);\n          return;\n        }\n\n        if (prefetch) {\n          activeTask_ = parent_.ScheduleCompressionTask(() => {\n            var result = DecompressImpl(data_, size_);\n\n            lock (lockObject_) {\n              values_ = result;\n              activeTask_ = null;\n            }\n          });\n        }\n        else {\n          values_ = DecompressImpl(data_, size_);\n        }\n      }\n    }\n\n    public void CompressValues() {\n#if !DISABLE_COMPRESSION\n      lock (this) {\n        if (WasCompressed || IsBeingCompressed) {\n          values_ = null; // Free array.\n          return;\n        }\n\n        Debug.Assert(data_ == null);\n        var valuesCopy = values_;\n        values_ = null; // Put into the compressed state.\n\n        // Compress on another thread.\n        activeTask_ = parent_.ScheduleCompressionTask(() => {\n          byte[] result = CompressImpl(valuesCopy, size_);\n\n          lock (this) {\n            data_ = result;\n            activeTask_ = null;\n          }\n        });\n      }\n#endif\n    }\n\n    public override string ToString() {\n      return\n        $\"Segment size {size_}, count {count_}, task {activeTask_ != null}, compressed {IsCompressed}, being/was compressed {IsBeingCompressed}/{WasCompressed}\";\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    internal T GetValueDirect(int index) {\n      return values_[index];\n    }\n\n    internal void CopyTo(T[] array, int arrayIndex) {\n      DecompressValues();\n      values_.CopyTo(array, arrayIndex);\n    }\n\n    private T[] DecompressImpl(byte[] data, int segmentSize) {\n      var dataSpan = data.AsSpan();\n      int length = segmentSize / Unsafe.SizeOf<T>();\n\n      // Use an ArrayPool to reduce GC pressure, values are usually used temporarely.\n      // Since the pooled array can be larger than needed, slice it to the right length.\n      var values = ArrayPool<T>.Shared.Rent(length);\n      var decompressedSpan = MemoryMarshal.AsBytes(values.AsSpan()).Slice(0, segmentSize);\n      bool result = BrotliDecoder.TryDecompress(dataSpan, decompressedSpan, out int readBytes);\n      Debug.Assert(result);\n      Debug.Assert(readBytes == segmentSize);\n      return values;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Collections/SparseBitVector.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Linq;\nusing System.Numerics;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace ProfileExplorer.Core.Collections;\n\npublic class SparseBitvector : IEquatable<SparseBitvector> {\n  private Node startNode_;\n  private Node lastNode_;\n\n  public bool HasBitsSet {\n    get {\n      var node = startNode_;\n\n      while (node != null) {\n        if (node.HasBitsSet) return true;\n        node = node.NextNode;\n      }\n\n      return false;\n    }\n  }\n\n  public int SetBitCount {\n    get {\n      int sum = 0;\n      var node = startNode_;\n\n      while (node != null) {\n        sum += node.SetBitCount;\n        node = node.NextNode;\n      }\n\n      return sum;\n    }\n  }\n\n  public bool this[int index] {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get => TestBit(index);\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set => SetBitState(index, value);\n  }\n\n  public bool Equals(SparseBitvector other) {\n    var a = startNode_;\n    var b = other.startNode_;\n\n    while (a != null && b != null) {\n      if (!a.Equals(b)) {\n        return false;\n      }\n\n      a = a.NextNode;\n      b = b.NextNode;\n    }\n\n    return a == null && b == null;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public void SetBit(int bit) {\n    SetBitState(bit, true);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public void ResetBit(int bit) {\n    SetBitState(bit, false);\n  }\n\n  public void ResetAllBits() {\n    startNode_ = null;\n    lastNode_ = null;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public void SetBitState(int bit, bool state) {\n    var node = TryUseLastNode(bit);\n\n    if (node != null) {\n      node[bit] = state;\n      return;\n    }\n\n    node = FindOrCreateNode(bit);\n    node[bit] = state;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool TestBit(int bit) {\n    var node = TryUseLastNode(bit);\n\n    if (node != null) {\n      return node[bit];\n    }\n\n    Node insertionNode = null;\n    node = TryFindNode(bit, ref insertionNode);\n    return node != null && node[bit];\n  }\n\n  public void And(SparseBitvector other) {\n    var a = startNode_;\n    var b = other.startNode_;\n    Node prevA = null;\n\n    if (b == null) {\n      ResetAllBits();\n      return;\n    }\n\n    while (a != null && b != null) {\n      if (a.StartBit == b.StartBit) {\n        // Bits in both a and b.\n        a.And(b);\n        prevA = a;\n        a = a.NextNode;\n        b = b.NextNode;\n      }\n      else if (a.StartBit > b.StartBit) {\n        // Bits in b but not in a.\n        b = b.NextNode;\n      }\n      else {\n        var nextNode = a.NextNode;\n        RemoveNode(a, prevA);\n        a = nextNode;\n      }\n    }\n\n    // All the ranges that remain need to be removed (no ranges in 'other' match).\n    while (a != null) {\n      var nextNode = a.NextNode;\n      RemoveNode(a, prevA);\n      a = nextNode;\n    }\n  }\n\n  public void ForEachSetBit(Func<int, bool> action) {\n    var node = startNode_;\n\n    while (node != null) {\n      if (!node.ForEachSetBit(action)) {\n        return;\n      }\n\n      node = node.NextNode;\n    }\n  }\n\n  public override bool Equals(object? obj) {\n    if (ReferenceEquals(null, obj)) return false;\n    if (ReferenceEquals(this, obj)) return true;\n    if (obj.GetType() != GetType()) return false;\n    return Equals((SparseBitvector)obj);\n  }\n\n  public override int GetHashCode() {\n    int hash = 0;\n    var node = startNode_;\n\n    while (node != null) {\n      hash = HashCode.Combine(hash, node.GetHashCode());\n    }\n\n    return hash;\n  }\n\n  private Node FindOrCreateNode(int bit) {\n    Node insertionNode = null;\n    var node = TryFindNode(bit, ref insertionNode);\n\n    if (node == null) {\n      node = AllocateNode(bit);\n      InsertNode(node, insertionNode);\n    }\n\n    return node;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private Node TryUseLastNode(int bit) {\n    if (lastNode_ != null && lastNode_.IsBitInRange(bit)) {\n      return lastNode_;\n    }\n\n    return null;\n  }\n\n  private Node TryFindNode(int bit, ref Node insertionNode) {\n    var node = startNode_;\n\n    if (lastNode_ != null && bit >= lastNode_.EndBit) {\n      node = lastNode_;\n    }\n\n    Node prevNode = null;\n\n    while (node != null) {\n      if (node.IsBitInRange(bit)) {\n        lastNode_ = node;\n        return node;\n      }\n\n      if (node.StartBit > bit) {\n        insertionNode = prevNode;\n        lastNode_ = prevNode;\n        return null;\n      }\n\n      prevNode = node;\n      node = node.NextNode;\n    }\n\n    insertionNode = prevNode;\n    return null;\n  }\n\n  private Node AllocateNode(int bit) {\n    int startBit = bit / Node.BitsPerNode * Node.BitsPerNode;\n    return new Node(startBit);\n  }\n\n  private void FreeNode(Node node) {\n    node.NextNode = null;\n  }\n\n  private void InsertNode(Node node, Node prevNode) {\n    if (prevNode != null) {\n      node.NextNode = prevNode.NextNode;\n      prevNode.NextNode = node;\n\n      if (prevNode == lastNode_) {\n        lastNode_ = node;\n      }\n    }\n    else {\n      node.NextNode = startNode_;\n      startNode_ = node;\n    }\n  }\n\n  private void RemoveNode(Node node, Node prevNode) {\n    if (prevNode != null) {\n      prevNode.NextNode = node.NextNode;\n    }\n    else {\n      startNode_ = node.NextNode;\n    }\n\n    FreeNode(node);\n  }\n\n  public class Node : IEquatable<Node> {\n    public const int BitsPerNode = 256;\n    private const int ValuesPerNode = BitsPerNode / 64;\n    private const int DivShift = 6;\n    private const int RemMask = (1 << DivShift) - 1;\n    private readonly ulong[] data_;\n\n    public Node() {\n      data_ = new ulong[ValuesPerNode];\n    }\n\n    public Node(int startBit) {\n      data_ = new ulong[ValuesPerNode];\n      StartBit = startBit;\n    }\n\n    public int StartBit { get; set; }\n    public Node NextNode { get; set; }\n    public int EndBit => StartBit + BitsPerNode;\n\n    public int SetBitCount {\n      get {\n        int sum = 0;\n\n        for (int i = 0; i < ValuesPerNode; i++) {\n          sum += BitOperations.PopCount(data_[i]);\n        }\n\n        return sum;\n      }\n    }\n\n    public bool HasBitsSet {\n      get {\n        var v = AsVector();\n        var v0 = Vector<ulong>.Zero;\n\n        for (int i = 0; i < v.Length; i++) {\n          if (!v[i].Equals(v0)) {\n            return true;\n          }\n        }\n\n        return false;\n      }\n    }\n\n    public bool this[int index] {\n      [MethodImpl(MethodImplOptions.AggressiveInlining)]\n      get {\n        index -= StartBit;\n        return (data_[index >> DivShift] & 1ul << (index & RemMask)) != 0;\n      }\n      [MethodImpl(MethodImplOptions.AggressiveInlining)]\n      set {\n        index -= StartBit;\n\n        if (value) {\n          data_[index >> DivShift] |= 1ul << (index & RemMask);\n        }\n        else {\n          data_[index >> DivShift] &= ~(1ul << (index & RemMask));\n        }\n      }\n    }\n\n    public bool Equals(Node other) {\n      return StartBit == other.StartBit &&\n             data_.SequenceEqual(other.data_);\n    }\n\n    public static bool operator ==(Node? left, Node? right) {\n      return Equals(left, right);\n    }\n\n    public static bool operator !=(Node? left, Node? right) {\n      return !Equals(left, right);\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public void And(Node other) {\n      var v1 = AsVector();\n      var v2 = other.AsVector();\n\n      for (int i = 0; i < v1.Length; i++) {\n        v1[i] &= v2[i];\n      }\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public void Or(Node other) {\n      var v1 = AsVector();\n      var v2 = other.AsVector();\n\n      for (int i = 0; i < v1.Length; i++) {\n        v1[i] |= v2[i];\n      }\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public void Xor(Node other) {\n      var v1 = AsVector();\n      var v2 = other.AsVector();\n\n      for (int i = 0; i < v1.Length; i++) {\n        v1[i] ^= v2[i];\n      }\n    }\n\n    public void ResetAllBits() {\n      var v = AsVector();\n\n      for (int i = 0; i < v.Length; i++) {\n        v[i] ^= v[i];\n      }\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public bool IsBitInRange(int bit) {\n      return bit >= StartBit && bit < StartBit + BitsPerNode;\n    }\n\n    public bool ForEachSetBit(Func<int, bool> action) {\n      for (int i = StartBit; i < EndBit; i++) {\n        if (this[i] && !action(i)) {\n          return false;\n        }\n      }\n\n      return true;\n    }\n\n    public override bool Equals(object obj) {\n      return Equals((Node)obj);\n    }\n\n    public override int GetHashCode() {\n      return data_.GetHashCode();\n    }\n\n    public override string ToString() {\n      var sb = new StringBuilder();\n\n      foreach (ulong value in data_) {\n        for (int i = 0; i < 64; i++) {\n          if ((value & 1ul << i) != 0) {\n            sb.Append(1);\n          }\n          else sb.Append(0);\n        }\n\n        sb.Append(' ');\n      }\n\n      return sb.ToString();\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    private Span<Vector<ulong>> AsVector() {\n      return MemoryMarshal.Cast<ulong, Vector<ulong>>(data_);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Collections/StringTrie.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Collections;\n\n// A compact representation of a Trie<T> using only arrays, which makes it\n// more cache friendly and much faster (>10x for large tries) than a simple trie\n// that uses node objects for each letter and lists of successor nodes.\n//\n// A significant advantage vs. using a Dictionary<string, T> is that it can be queried\n// with a Span<char>, which avoids creating a temporary string just for the query\n// in code that uses spans, like the lexer/parsers.\npublic class StringTrie<T> {\n  private List<Tuple<int, int>> nodes_; // first child index, count\n  private List<Tuple<char, int>> childLetters_; // letter, child index\n  private List<Optional<T>> terminalNodes_;\n  private int lastNodeId_;\n  private int lastChildId_;\n\n  public StringTrie() {\n    nodes_ = new List<Tuple<int, int>>();\n    childLetters_ = new List<Tuple<char, int>>();\n    terminalNodes_ = new List<Optional<T>>();\n  }\n\n  public StringTrie(Dictionary<string, T> values) : this() {\n    Build(values);\n  }\n\n  public void Build(List<Tuple<string, T>> values) {\n    // The words must be added in layers: first the first letter from all words,\n    // then the second letter, and so on, until nu suffix part remains.\n    // This algorithm needs the words to be sorted lexicographically.\n    int layer = 0;\n    bool changed = true;\n    int rootNode = AddNode();\n\n    values.Sort((a, b) => string.Compare(a.Item1, b.Item1, StringComparison.Ordinal));\n\n    while (changed) {\n      changed = false;\n      layer++;\n\n      foreach (var pair in values) {\n        if (layer <= pair.Item1.Length) {\n          changed = true;\n          int newNodeId = AddWord(pair.Item1, 0, layer, rootNode);\n\n          if (layer == pair.Item1.Length) {\n            // Mark as terminal if the entire word has been processed.\n            SetTerminalNode(newNodeId, pair.Item2);\n          }\n        }\n      }\n    }\n  }\n\n  public void Build(Dictionary<string, T> values) {\n    var list = new List<Tuple<string, T>>(values.Count);\n\n    foreach (var pair in values) {\n      list.Add(new Tuple<string, T>(pair.Key, pair.Value));\n    }\n\n    Build(list);\n  }\n\n  public bool TryGetValue(string value, out T outValue, bool caseInsensitive = false) {\n    int nodeId = 0;\n\n    for (int i = 0; i < value.Length; i++) {\n      char letter = value[i];\n\n      if (caseInsensitive) {\n        letter = char.ToLowerInvariant(letter);\n      }\n\n      int childId = FindChildForLetter(nodeId, letter, caseInsensitive);\n\n      if (childId == -1) {\n        outValue = default(T);\n        return false;\n      }\n\n      nodeId = childId;\n    }\n\n    return IsTerminalNode(nodeId, out outValue);\n  }\n\n  public bool TryGetValue(ReadOnlySpan<char> value, out T outValue, bool caseInsensitive = false) {\n    int nodeId = 0;\n\n    for (int i = 0; i < value.Length; i++) {\n      char letter = value[i];\n\n      if (caseInsensitive) {\n        letter = char.ToLowerInvariant(letter);\n      }\n\n      int childId = FindChildForLetter(nodeId, letter, caseInsensitive);\n\n      if (childId == -1) {\n        outValue = default(T);\n        return false;\n      }\n\n      nodeId = childId;\n    }\n\n    return IsTerminalNode(nodeId, out outValue);\n  }\n\n  public bool TryGetValue(ReadOnlyMemory<char> value, out T outValue, bool caseInsensitive = false) {\n    return TryGetValue(value.Span, out outValue, caseInsensitive);\n  }\n\n  public bool Contains(string value, bool caseInsensitive = false) {\n    return TryGetValue(value, out _, caseInsensitive);\n  }\n\n  public bool Contains(ReadOnlyMemory<char> value, bool caseInsensitive = false) {\n    return TryGetValue(value, out _, caseInsensitive);\n  }\n\n  private int AddNode() {\n    nodes_.Add(new Tuple<int, int>(-1, 0));\n    return lastNodeId_++;\n  }\n\n  private void AddChildNode(int parentNodeId, char letter, int childNodeId) {\n    childLetters_.Add(new Tuple<char, int>(letter, childNodeId));\n    var parentChildInfo = nodes_[parentNodeId];\n\n    if (parentChildInfo.Item1 == -1) {\n      // First child being added.\n      nodes_[parentNodeId] = new Tuple<int, int>(lastChildId_, 1);\n    }\n    else {\n      // Increment number of children.\n      nodes_[parentNodeId] = new Tuple<int, int>(parentChildInfo.Item1,\n                                                 parentChildInfo.Item2 + 1);\n    }\n\n    lastChildId_++;\n  }\n\n  private void SetTerminalNode(int nodeId, T value) {\n    while (terminalNodes_.Count <= nodeId) {\n      terminalNodes_.Add(new Optional<T>());\n    }\n\n    terminalNodes_[nodeId] = value;\n  }\n\n  private int AddWord(string word, int position, int maxPosition, int nodeId) {\n    if (position == maxPosition) {\n      return nodeId;\n    }\n\n    char letter = word[position];\n    int childNodeId = FindChildForLetter(nodeId, letter);\n\n    if (childNodeId == -1) {\n      // First time this letter is inserted as a child.\n      childNodeId = AddNode();\n      AddChildNode(nodeId, letter, childNodeId);\n    }\n\n    return AddWord(word, position + 1, maxPosition, childNodeId);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private int FindChildForLetter(int nodeId, char letter, bool caseInsensitive = false) {\n    var childInfo = nodes_[nodeId];\n\n    for (int i = 0; i < childInfo.Item2; i++) {\n      var letterInfo = childLetters_[childInfo.Item1 + i];\n\n      if (letterInfo.Item1 == letter) {\n        return letterInfo.Item2;\n      }\n\n      if (caseInsensitive && char.ToLowerInvariant(letterInfo.Item1) == letter) {\n        return letterInfo.Item2;\n      }\n    }\n\n    return -1;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool IsTerminalNode(int nodeId, out T value) {\n    if (terminalNodes_[nodeId].HasValue) {\n      value = (T)terminalNodes_[nodeId];\n      return true;\n    }\n\n    value = default(T);\n    return false;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Collections/TinyList.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Collections;\n\n// A lightweight list implementation that stores a single item or an array of items.\npublic struct TinyList<T> : IList<T> {\n  private object value_; // Either T or array of T.\n  private int count_;\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public TinyList() {\n    value_ = null;\n    count_ = 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public TinyList(T item) {\n    value_ = item;\n    count_ = 1;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public TinyList(IList<T> list) {\n    if (list == null || list.Count == 0) {\n      value_ = null;\n      count_ = 0;\n    }\n    else if (list.Count == 1) {\n      value_ = list[0];\n      count_ = 1;\n    }\n    else {\n      var array = new T[list.Count];\n      list.CopyTo(array, 0);\n      value_ = array;\n      count_ = list.Count;\n    }\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public IEnumerator<T> GetEnumerator() {\n    if (count_ == 0) {\n      yield break;\n    }\n\n    if (count_ == 1) {\n      yield return (T)value_;\n    }\n    else {\n      var array = (T[])value_;\n\n      for (int i = 0; i < count_; i++) {\n        yield return array[i];\n      }\n    }\n  }\n\n  IEnumerator IEnumerable.GetEnumerator() {\n    return GetEnumerator();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public void Add(T item) {\n    if (count_ == 0) {\n      value_ = item;\n      count_ = 1;\n    }\n    else if (count_ == 1) {\n      var array = new T[2];\n      array[0] = (T)value_;\n      array[1] = item;\n      value_ = array;\n      count_ = 2;\n    }\n    else {\n      var array = (T[])value_;\n\n      if (array.Length == count_) {\n        var newArray = new T[array.Length * 2];\n        array.CopyTo(newArray, 0);\n        value_ = array = newArray;\n      }\n\n      array[count_] = item;\n      count_++;\n    }\n  }\n\n  public void Clear() {\n    value_ = null;\n    count_ = 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool Contains(T item) {\n    return IndexOf(item) != -1;\n  }\n\n  public bool Contains(Func<T, bool> comparer) {\n    return IndexOf(comparer) != -1;\n  }\n\n  public T Find(Func<T, bool> comparer) {\n    int index = IndexOf(comparer);\n    return index != -1 ? this[index] : default(T);\n  }\n\n  public void CopyTo(T[] array, int arrayIndex) {\n    if (array == null) throw new ArgumentNullException(nameof(array));\n    if (arrayIndex < 0) throw new ArgumentOutOfRangeException(nameof(arrayIndex));\n    if (array.Length - arrayIndex < count_) throw new ArgumentException(\"Destination array is not long enough\");\n\n    if (count_ == 0) return;\n    if (count_ == 1) {\n      array[arrayIndex] = (T)value_;\n      return;\n    }\n\n    var src = (T[])value_;\n    Array.Copy(src, 0, array, arrayIndex, count_);\n  }\n\n  public bool Remove(T item) {\n    throw new NotImplementedException();\n  }\n\n  public int Count => count_;\n  public bool IsReadOnly => false;\n\n  public int IndexOf(T item) {\n    if (count_ == 0) {\n      return -1;\n    }\n\n    if (count_ == 1) {\n      if (EqualityComparer<T>.Default.Equals((T)value_, item)) {\n        return 0;\n      }\n    }\n    else {\n      var array = (T[])value_;\n\n      for (int i = 0; i < count_; i++) {\n        if (EqualityComparer<T>.Default.Equals(array[i], item)) {\n          return i;\n        }\n      }\n    }\n\n    return -1;\n  }\n\n  public int IndexOf(Func<T, bool> comparer) {\n    if (count_ == 0) {\n      return -1;\n    }\n\n    if (count_ == 1) {\n      if (comparer((T)value_)) {\n        return 0;\n      }\n    }\n    else {\n      var array = (T[])value_;\n\n      for (int i = 0; i < count_; i++) {\n        if (comparer(array[i])) {\n          return i;\n        }\n      }\n    }\n\n    return -1;\n  }\n\n  public void Insert(int index, T item) {\n  // Not needed for current usage. Implement if required later.\n  throw new NotSupportedException();\n  }\n\n  public void RemoveAt(int index) {\n  // Not needed for current usage. Implement if required later.\n  throw new NotSupportedException();\n  }\n\n  public T this[int index] {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get {\n#if DEBUG\n      if (index >= count_) {\n        throw new IndexOutOfRangeException();\n      }\n#endif\n      if (count_ == 1) {\n        return (T)value_;\n      }\n\n      var array = (T[])value_;\n      return array[index];\n    }\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set {\n#if DEBUG\n      if (index >= count_) {\n        throw new IndexOutOfRangeException();\n      }\n#endif\n      if (count_ == 1) {\n        value_ = value;\n      }\n      else {\n        var array = (T[])value_;\n        array[index] = value;\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ARM64Opcodes.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Collections;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic enum ARM64Opcode {\n  RET,\n  BL,\n  BLR,\n  B,\n  BR,\n  BEQ,\n  BNE,\n  BCS,\n  BHS,\n  BCC,\n  BLO,\n  BMI,\n  BPL,\n  BVS,\n  BVC,\n  BHI,\n  BLS,\n  BGE,\n  BLT,\n  BGT,\n  BLE,\n  BAL,\n  TBZ,\n  TBNZ,\n  CBZ,\n  CBNZ,\n  NOP\n}\n\npublic struct ARM64OpcodeInfo {\n  public ARM64Opcode Opcode { get; set; }\n  public InstructionKind Kind { get; set; }\n\n  public ARM64OpcodeInfo(ARM64Opcode opcode, InstructionKind kind) {\n    Opcode = opcode;\n    Kind = kind;\n  }\n}\n\npublic static class ARM64Opcodes {\n  private static readonly Dictionary<string, ARM64OpcodeInfo> opcodes_ =\n    new() {\n      {\"B\", new ARM64OpcodeInfo(ARM64Opcode.B, InstructionKind.Goto)},\n      {\"BR\", new ARM64OpcodeInfo(ARM64Opcode.BR, InstructionKind.Goto)},\n      {\"RET\", new ARM64OpcodeInfo(ARM64Opcode.RET, InstructionKind.Return)},\n      {\"BEQ\", new ARM64OpcodeInfo(ARM64Opcode.BEQ, InstructionKind.Branch)},\n      {\"BNE\", new ARM64OpcodeInfo(ARM64Opcode.BNE, InstructionKind.Branch)},\n      {\"BCS\", new ARM64OpcodeInfo(ARM64Opcode.BCS, InstructionKind.Branch)},\n      {\"BHS\", new ARM64OpcodeInfo(ARM64Opcode.BHS, InstructionKind.Branch)},\n      {\"BCC\", new ARM64OpcodeInfo(ARM64Opcode.BCC, InstructionKind.Branch)},\n      {\"BLO\", new ARM64OpcodeInfo(ARM64Opcode.BLO, InstructionKind.Branch)},\n      {\"BMI\", new ARM64OpcodeInfo(ARM64Opcode.BMI, InstructionKind.Branch)},\n      {\"BPL\", new ARM64OpcodeInfo(ARM64Opcode.BPL, InstructionKind.Branch)},\n      {\"BVS\", new ARM64OpcodeInfo(ARM64Opcode.BVS, InstructionKind.Branch)},\n      {\"BVC\", new ARM64OpcodeInfo(ARM64Opcode.BVC, InstructionKind.Branch)},\n      {\"BHI\", new ARM64OpcodeInfo(ARM64Opcode.BHI, InstructionKind.Branch)},\n      {\"BLS\", new ARM64OpcodeInfo(ARM64Opcode.BLS, InstructionKind.Branch)},\n      {\"BGE\", new ARM64OpcodeInfo(ARM64Opcode.BGE, InstructionKind.Branch)},\n      {\"BLT\", new ARM64OpcodeInfo(ARM64Opcode.BLT, InstructionKind.Branch)},\n      {\"BGT\", new ARM64OpcodeInfo(ARM64Opcode.BGT, InstructionKind.Branch)},\n      {\"BLE\", new ARM64OpcodeInfo(ARM64Opcode.BLE, InstructionKind.Branch)},\n      {\"BAL\", new ARM64OpcodeInfo(ARM64Opcode.BAL, InstructionKind.Branch)},\n      {\"TBZ\", new ARM64OpcodeInfo(ARM64Opcode.TBZ, InstructionKind.Branch)},\n      {\"TBNZ\", new ARM64OpcodeInfo(ARM64Opcode.TBNZ, InstructionKind.Branch)},\n      {\"CBZ\", new ARM64OpcodeInfo(ARM64Opcode.CBZ, InstructionKind.Branch)},\n      {\"CBNZ\", new ARM64OpcodeInfo(ARM64Opcode.CBNZ, InstructionKind.Branch)},\n      {\"BL\", new ARM64OpcodeInfo(ARM64Opcode.BL, InstructionKind.Call)},\n      {\"BLR\", new ARM64OpcodeInfo(ARM64Opcode.BLR, InstructionKind.Call)},\n      {\"NOP\", new ARM64OpcodeInfo(ARM64Opcode.NOP, InstructionKind.Other)}\n    };\n  private static readonly StringTrie<ARM64OpcodeInfo> opcodesTrie_ = new(opcodes_);\n\n  public static bool GetOpcodeInfo(string value, out ARM64OpcodeInfo info) {\n    return opcodesTrie_.TryGetValue(value, out info, true);\n  }\n\n  //? TODO: Needs a TryGetValueUpper that does the value.ToUpper() on each letter\n  public static bool GetOpcodeInfo(ReadOnlyMemory<char> value, out ARM64OpcodeInfo info) {\n    return opcodesTrie_.TryGetValue(value, out info, true);\n  }\n\n  public static bool IsOpcode(string value) {\n    return GetOpcodeInfo(value, out _);\n  }\n\n  public static bool IsOpcode(ReadOnlyMemory<char> value) {\n    return opcodesTrie_.Contains(value);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMBinaryFileFinder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic class ASMBinaryFileFinder : IBinaryFileFinder {\n  public async Task<BinaryFileSearchResult> FindBinaryFileAsync(BinaryFileDescriptor binaryFile, SymbolFileSourceSettings settings = null) {\n    if (settings == null) {\n      // Make sure the binary directory is also included in the symbol search.\n      settings = CoreSettingsProvider.SymbolSettings.Clone();\n    }\n\n    return await PEBinaryInfoProvider.LocateBinaryFileAsync(binaryFile, settings).ConfigureAwait(false);\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMCompilerIRInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Parser;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic sealed class ASMCompilerIRInfo : ICompilerIRInfo {\n  public ASMCompilerIRInfo(IRMode mode) {\n    Mode = mode;\n  }\n\n  public IRMode Mode { get; set; }\n  public InstructionOffsetData InstructionOffsetData => Mode switch {\n    IRMode.ARM64 => InstructionOffsetData.ConstantSize(4),\n    _            => InstructionOffsetData.VariableSize(1, 16)\n  };\n\n  public IRParsingErrorHandler CreateParsingErrorHandler() {\n    return new ParsingErrorHandler();\n  }\n\n  public IReachableReferenceFilter CreateReferenceFilter(FunctionIR function) {\n    return new CFGReachabilityReferenceFilter(function);\n  }\n\n  public IRSectionParser CreateSectionParser(IRParsingErrorHandler errorHandler, long functionSize) {\n    return new ASMIRSectionParser(functionSize, this, errorHandler);\n  }\n\n  public IRSectionReader CreateSectionReader(string filePath, bool expectSectionHeaders = true) {\n    return new ASMIRSectionReader(filePath, expectSectionHeaders);\n  }\n\n  public IRSectionReader CreateSectionReader(byte[] textData, bool expectSectionHeaders = true) {\n    return new ASMIRSectionReader(textData, expectSectionHeaders);\n  }\n\n  public OperandIR GetCallTarget(InstructionIR instr) {\n    if (IsCallInstruction(instr) && instr.Sources.Count > 0) {\n      return instr.Sources[0];\n    }\n\n    return null;\n  }\n\n  public OperandIR GetBranchTarget(InstructionIR instr) {\n    if (!(instr.IsBranch || instr.IsGoto) ||\n        instr.Sources.Count == 0) {\n      return null;\n    }\n\n    switch (Mode) {\n      case IRMode.x86_64: {\n        return instr.Sources[0];\n      }\n      case IRMode.ARM64: {\n        if (!(instr.Opcode is ARM64Opcode)) {\n          return null;\n        }\n\n        switch (instr.OpcodeAs<ARM64Opcode>()) {\n          case ARM64Opcode.CBZ:\n          case ARM64Opcode.CBNZ: {\n            if (instr.Sources.Count == 2) {\n              return instr.Sources[1];\n            }\n\n            break;\n          }\n          case ARM64Opcode.TBZ:\n          case ARM64Opcode.TBNZ: {\n            if (instr.Sources.Count == 3) {\n              return instr.Sources[2];\n            }\n\n            break;\n          }\n          default: {\n            return instr.Sources[0];\n          }\n        }\n\n        break;\n      }\n    }\n\n    return null;\n  }\n\n  public BlockIR GetIncomingPhiOperandBlock(InstructionIR phiInstr, int opIndex) {\n    return null;\n  }\n\n  public bool IsCallInstruction(InstructionIR instr) {\n    return instr.IsCall ||\n           instr.IsGoto && instr.Sources.Count > 0 &&\n           !instr.Sources[0].IsLabelAddress;\n  }\n\n  public bool IsCopyInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public bool IsIntrinsicCallInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public bool IsLoadInstruction(InstructionIR instr) {\n    switch (Mode) {\n      case IRMode.x86_64: {\n        return instr.Sources.Find(op => op.IsIndirection) != null;\n      }\n      case IRMode.ARM64: {\n        //? TODO: Use opcodes like LDP\n        return instr.Sources.Find(op => op.IsIndirection) != null;\n      }\n    }\n\n    return false;\n  }\n\n  public bool IsPhiInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public bool IsStoreInstruction(InstructionIR instr) {\n    switch (Mode) {\n      case IRMode.x86_64: {\n        return instr.Destinations.Count > 0 &&\n               instr.Destinations[0].IsIndirection;\n      }\n      case IRMode.ARM64: {\n        //? TODO\n        return instr.Destinations.Count > 0 &&\n               instr.Destinations[0].IsIndirection;\n      }\n    }\n\n    return false;\n  }\n\n  public bool IsNOP(InstructionIR instr) {\n    if (instr.Opcode == null) {\n      return false;\n    }\n\n    switch (Mode) {\n      case IRMode.x86_64: {\n        return instr.OpcodeAs<x86Opcode>() == x86Opcode.NOP;\n      }\n      case IRMode.ARM64: {\n        return instr.OpcodeAs<ARM64Opcode>() == ARM64Opcode.NOP;\n      }\n    }\n\n    return false;\n  }\n\n  public bool OperandsReferenceSameSymbol(OperandIR opA, OperandIR opB, bool exactCheck) {\n    //? TODO: This should do a register check too, ARM64 not implemented\n    return opA.Kind == opB.Kind &&\n           opA.HasName && opB.HasName &&\n           opA.NameValue.Span.Equals(opB.NameValue.Span, StringComparison.Ordinal);\n  }\n\n  public IRElement SkipCopyInstruction(InstructionIR instr) {\n    return instr;\n  }\n\n  public InstructionIR GetTransferInstruction(BlockIR block) {\n    return (block.Tuples.Count > 0 ? block.Tuples[^1] : null) as InstructionIR;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMCompilerInfoProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic class ASMCompilerInfoProvider : ICompilerInfoProvider {\n  private readonly ASMNameProvider names_ = new();\n  private readonly ASMCompilerIRInfo ir_;\n  private readonly IBinaryFileFinder binaryFileFinder_;\n  private readonly IDebugFileFinder debugFileFinder_;\n  private readonly IDebugInfoProviderFactory debugInfoProviderFactory_;\n  private readonly IDiffFilterProvider diffFilterProvider_;\n\n  public ASMCompilerInfoProvider(IRMode mode) {\n    ir_ = new ASMCompilerIRInfo(mode);\n    binaryFileFinder_ = new ASMBinaryFileFinder();\n    debugFileFinder_ = new ASMDebugFileFinder();\n    debugInfoProviderFactory_ = new ASMDebugInfoProviderFactory();\n    diffFilterProvider_ = new ASMDiffFilterProvider(this);\n  }\n\n  public virtual string CompilerIRName => \"ASM\";\n  public virtual CompilerIRKind CompilerIRKind => CompilerIRKind.ASM;\n  public virtual string CompilerDisplayName => \"ASM \" + ir_.Mode;\n  public virtual string OpenFileFilter =>\n    \"ASM, Binary, Trace Files|*.asm;*.txt;*.log;*.exe;*.dll;*.sys;*.etl|All Files|*.*\";\n  public virtual string OpenDebugFileFilter => \"Debug Files|*.pdb|All Files|*.*\";\n  public virtual string DefaultSyntaxHighlightingFile => (ir_.Mode == IRMode.ARM64 ? \"ARM64\" : \"x86\") + \" ASM IR\";\n  public ICompilerIRInfo IR => ir_;\n  public INameProvider NameProvider => names_;\n  public IBinaryFileFinder BinaryFileFinder => binaryFileFinder_;\n  public IDebugFileFinder DebugFileFinder => debugFileFinder_;\n  public IDebugInfoProviderFactory DebugInfoProviderFactory => debugInfoProviderFactory_;\n  public IDiffFilterProvider DiffFilterProvider => diffFilterProvider_;\n\n  public async Task<bool> AnalyzeLoadedFunction(FunctionIR function, IRTextSection section, ILoadedDocument loadedDoc, FunctionDebugInfo funcDebugInfo) {\n    // Annotate the instructions with debug info (line numbers, source files)\n    // if the debug file is specified and available.\n    var debugInfo = DebugInfoProviderFactory.GetOrCreateDebugInfoProvider(section.ParentFunction, loadedDoc);\n\n    if (debugInfo != null) {\n      await Task.Run(() => {\n        if (funcDebugInfo != null) {\n          return debugInfo.AnnotateSourceLocations(function, funcDebugInfo);\n        }\n        else {\n          return debugInfo.AnnotateSourceLocations(function, section.ParentFunction);\n        }\n      });\n    }\n\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMDebugFileFinder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic class ASMDebugFileFinder : IDebugFileFinder {\n  public async Task<DebugFileSearchResult> FindDebugInfoFileAsync(string imagePath, SymbolFileSourceSettings settings = null) {\n    using var info = new PEBinaryInfoProvider(imagePath);\n\n    if (!info.Initialize()) {\n      return Utils.LocateDebugInfoFile(imagePath, \".json\");\n    }\n\n    switch (info.BinaryFileInfo.FileKind) {\n      case BinaryFileKind.Native: {\n        if (settings == null) {\n          // Make sure the binary directory is also included in the symbol search.\n          settings = CoreSettingsProvider.SymbolSettings.Clone();\n          settings.InsertSymbolPath(imagePath);\n        }\n\n        return await FindDebugInfoFileAsync(info.SymbolFileInfo, settings).ConfigureAwait(false);\n      }\n    }\n\n    return DebugFileSearchResult.None;\n  }\n\n  public async Task<DebugFileSearchResult> FindDebugInfoFileAsync(SymbolFileDescriptor symbolFile, SymbolFileSourceSettings settings = null) {\n    if (settings == null) {\n      settings = CoreSettingsProvider.SymbolSettings;\n    }\n\n    return await PDBDebugInfoProvider.LocateDebugInfoFileAsync(symbolFile, settings).ConfigureAwait(false);\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMDebugInfoProviderFactory.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic class ASMDebugInfoProviderFactory : IDebugInfoProviderFactory {\n  // Use FilePath as key instead of DebugFileSearchResult object reference.\n  // Different threads may create different DebugFileSearchResult objects for the same PDB,\n  // and without Equals/GetHashCode overrides, reference equality would miss cache hits.\n  private static readonly Dictionary<string, IDebugInfoProvider> loadedDebugInfo_ = new();\n  private static readonly object loadedDebugInfoLock_ = new();\n\n  public IDebugInfoProvider CreateDebugInfoProvider(DebugFileSearchResult debugFile) {\n    if (!debugFile.Found || string.IsNullOrEmpty(debugFile.FilePath)) {\n      return null;\n    }\n\n    // Use static lock since the dictionary is static (shared across all factory instances)\n    lock (loadedDebugInfoLock_) {\n      if (loadedDebugInfo_.TryGetValue(debugFile.FilePath, out var provider)) {\n        return provider;\n      }\n\n      var newProvider = new PDBDebugInfoProvider(CoreSettingsProvider.SymbolSettings);\n\n      if (newProvider.LoadDebugInfo(debugFile, null)) {\n        loadedDebugInfo_[debugFile.FilePath] = newProvider;\n        return newProvider;\n      }\n\n      return null;\n    }\n  }\n\n  public IDebugInfoProvider GetOrCreateDebugInfoProvider(IRTextFunction function, ILoadedDocument loadedDoc) {\n    lock (loadedDoc) {\n      if (loadedDoc.DebugInfo != null) {\n        return loadedDoc.DebugInfo;\n      }\n    }\n\n    if (!loadedDoc.DebugInfoFileExists) {\n      return null;\n    }\n\n    if (loadedDoc.DebugInfoFileExists) {\n      var debugInfo = CreateDebugInfoProvider(loadedDoc.DebugInfoFile);\n\n      if (debugInfo != null) {\n        lock (loadedDoc) {\n          loadedDoc.DebugInfo = debugInfo;\n          return debugInfo;\n        }\n      }\n    }\n\n    return null;\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMDiffFilterProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic class ASMDiffFilterProvider : IDiffFilterProvider {\n  private readonly ASMCompilerInfoProvider outer_;\n  public ASMDiffFilterProvider(ASMCompilerInfoProvider outer) { outer_ = outer; }\n  public IDiffInputFilter CreateDiffInputFilter() {\n    var filter = new ASMDiffInputFilter();\n    filter.Initialize(CoreSettingsProvider.DiffSettings, outer_.IR);\n    return filter;\n  }\n\n  public IDiffOutputFilter CreateDiffOutputFilter() {\n    return new BasicDiffOutputFilter();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMDiffInputFilter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic class ASMDiffInputFilter : IDiffInputFilter {\n  private Dictionary<string, int> addressMap_;\n  private int nextAddressId_;\n  public char[] AcceptedLetters => new[] {\n    'A', 'B', 'C', 'D', 'E', 'F',\n    'a', 'b', 'c', 'd', 'e', 'f'\n  };\n\n  public void Initialize(DiffSettings settings, ICompilerIRInfo ifInfo) {\n    addressMap_ = new Dictionary<string, int>();\n    nextAddressId_ = 1;\n  }\n\n  public FilteredDiffInput FilterInputText(string text) {\n    string[] lines = text.SplitLines();\n    var result = new FilteredDiffInput(lines.Length);\n    var builder = new StringBuilder(text.Length);\n\n    foreach (string line in lines) {\n      (string newLine, var replacements) = FilterInputLineImpl(line);\n      builder.AppendLine(newLine);\n      result.LineReplacements.Add(replacements);\n    }\n\n    result.Text = builder.ToString();\n    return result;\n  }\n\n  public string FilterInputLine(string line) {\n    (string result, _) = FilterInputLineImpl(line);\n    return result;\n  }\n\n  public (string, List<FilteredDiffInput.Replacement>) FilterInputLineImpl(string line) {\n    string newLine = line;\n    int index = line.IndexOf(':');\n\n    if (index == -1) {\n      return (newLine, FilteredDiffInput.NoReplacements);\n    }\n\n    (string address, _) = ParseAddress(line, 0);\n\n    if (address == null) {\n      return (newLine, FilteredDiffInput.NoReplacements);\n    }\n\n    var replacements = new List<FilteredDiffInput.Replacement>(1);\n\n    // Create a canonical form for the address so that diffing considers\n    // the addresses equal if the target blocks are the same in two functs.\n    // where the function start is not the same anymore.\n    if (addressMap_.GetOrAddValue(address, nextAddressId_) == nextAddressId_) {\n      nextAddressId_++;\n    }\n\n    // Skip over the bytecodes found before the opcode.\n    int startIndex = index;\n\n    for (index = index + 1; index < line.Length; index++) {\n      char letter = line[index];\n\n      if (!(char.IsWhiteSpace(letter) || char.IsDigit(letter) ||\n            Array.IndexOf(AcceptedLetters, letter) != -1)) {\n        break;\n      }\n    }\n\n    // Move back before the opcode starts.\n    int afterIndex = index;\n\n    while (index > startIndex && !char.IsWhiteSpace(line[index - 1])) {\n      index--;\n    }\n\n    // Check if there is any address found after the opcode\n    // and replace it with the canonical form.\n    while (afterIndex < line.Length && !char.IsWhiteSpace(line[afterIndex])) {\n      afterIndex++;\n    }\n\n    //? TODO: There could be multiple addresses as operands?\n    if (afterIndex < line.Length) {\n      (string afterAddress, int offset) = ParseAddress(line, afterIndex);\n\n      if (afterAddress != null && afterAddress.Length >= 4) {\n        int id = addressMap_.GetOrAddValue(afterAddress, nextAddressId_);\n\n        if (id == nextAddressId_) {\n          nextAddressId_++;\n        }\n\n        string replacementAddress = id.ToString().PadLeft(afterAddress.Length, 'A');\n        newLine = newLine.Replace(afterAddress, replacementAddress);\n        replacements.Add(new FilteredDiffInput.Replacement(offset, replacementAddress, afterAddress));\n      }\n    }\n\n    string newLinePrefix = newLine.Substring(0, index);\n    string newLinePrefixReplacement = new(' ', index);\n    newLine = newLinePrefixReplacement + newLine.Substring(index);\n    replacements.Add(new FilteredDiffInput.Replacement(0, newLinePrefixReplacement, newLinePrefix));\n    return (newLine, replacements);\n  }\n\n  private (string, int) ParseAddress(string line, int startOffset) {\n    int addressStartOffset = startOffset;\n    int offset;\n\n    for (offset = startOffset; offset < line.Length; offset++) {\n      char letter = line[offset];\n\n      if (char.IsWhiteSpace(letter)) {\n        addressStartOffset = offset + 1;\n        continue;\n      }\n\n      if (!(char.IsDigit(letter) || Array.IndexOf(AcceptedLetters, letter) != -1)) {\n        break;\n      }\n    }\n\n    if (offset > addressStartOffset) {\n      return (line.Substring(addressStartOffset, offset - addressStartOffset), addressStartOffset);\n    }\n\n    return (null, 0);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMIRSectionParser.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Parser;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic sealed class ASMIRSectionParser : IRSectionParser {\n  private ICompilerIRInfo irInfo_;\n  private IRParsingErrorHandler errorHandler_;\n  private long functionSize_;\n\n  public ASMIRSectionParser(long functionSize, ICompilerIRInfo irInfo, IRParsingErrorHandler errorHandler) {\n    functionSize_ = functionSize;\n    irInfo_ = irInfo;\n    errorHandler_ = errorHandler;\n  }\n\n  public FunctionIR ParseSection(IRTextSection section, string sectionText) {\n    return new ASMParser(irInfo_, errorHandler_,\n                         RegisterTables.SelectRegisterTable(irInfo_.Mode),\n                         sectionText, section, functionSize_).Parse();\n  }\n\n  public FunctionIR ParseSection(IRTextSection section, ReadOnlyMemory<char> sectionText) {\n    return new ASMParser(irInfo_, errorHandler_,\n                         RegisterTables.SelectRegisterTable(irInfo_.Mode),\n                         sectionText, section, functionSize_).Parse();\n  }\n\n  public void SkipCurrentToken() {\n    throw new NotImplementedException();\n  }\n\n  public void SkipToFunctionEnd() {\n    throw new NotImplementedException();\n  }\n\n  public void SkipToLineEnd() {\n    throw new NotImplementedException();\n  }\n\n  public void SkipToLineStart() {\n    throw new NotImplementedException();\n  }\n\n  public void SkipToNextBlock() {\n    throw new NotImplementedException();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMIRSectionReader.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic sealed class ASMIRSectionReader : SectionReaderBase {\n  public ASMIRSectionReader(string filePath, bool expectSectionHeaders) :\n    base(filePath, expectSectionHeaders) {\n  }\n\n  public ASMIRSectionReader(byte[] textData, bool expectSectionHeaders) :\n    base(textData, expectSectionHeaders) {\n  }\n\n  protected override string ExtractFunctionName(string line) {\n    return line.Substring(0, line.Length - 1);\n  }\n\n  protected override string ExtractSectionName(string line) {\n    return ExtractFunctionName(line);\n  }\n\n  protected override bool IsBlockStart(string line) {\n    return false;\n  }\n\n  protected override bool IsFunctionEnd(string line) {\n    return string.IsNullOrEmpty(line) || IsFunctionStart(line);\n  }\n\n  protected override bool IsFunctionStart(string line) {\n    // Search for name: with optional whitespace after :\n    int index = line.LastIndexOf(':');\n\n    if (index == -1) {\n      return false;\n    }\n\n    if (index == line.Length - 1) {\n      return true;\n    }\n\n    for (; index < line.Length; index++) {\n      if (!char.IsWhiteSpace(line[index])) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  protected override bool IsMetadataLine(string line) {\n    return false;\n  }\n\n  protected override bool IsSectionStart(string line) {\n    return IsFunctionStart(line);\n  }\n\n  protected override string PreprocessLine(string line) {\n    return line;\n  }\n\n  protected override bool ShouldSkipOutputLine(string line) {\n    return string.IsNullOrEmpty(line);\n  }\n\n  protected override bool FunctionEndIsFunctionStart(string line) {\n    return !string.IsNullOrEmpty(line);\n  }\n\n  protected override bool SectionStartIsFunctionStart(string line) {\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMNameProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Concurrent;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic sealed class ASMNameProvider : INameProvider {\n  private static ConcurrentDictionary<string, string> demangledNameMap_;\n  private static ConcurrentDictionary<string, string> functionNameMap_;\n\n  static ASMNameProvider() {\n    demangledNameMap_ = new ConcurrentDictionary<string, string>();\n    functionNameMap_ = new ConcurrentDictionary<string, string>();\n  }\n\n  public bool IsDemanglingSupported => true;\n  public bool IsDemanglingEnabled => IsDemanglingSupported && CoreSettingsProvider.SectionSettings.ShowDemangledNames;\n  public FunctionNameDemanglingOptions GlobalDemanglingOptions => CoreSettingsProvider.SectionSettings.DemanglingOptions;\n\n  public string GetSectionName(IRTextSection section, bool includeNumber) {\n    string sectionName = section.Name;\n\n    if (string.IsNullOrEmpty(sectionName)) {\n      sectionName = section.ParentFunction.Name;\n    }\n\n    if (!string.IsNullOrEmpty(sectionName)) {\n      sectionName = FormatFunctionName(sectionName);\n      sectionName = sectionName.Length <= 50 ? sectionName : $\"{sectionName.Substring(0, 20)}...\";\n    }\n\n    if (includeNumber) {\n      return $\"({section.Number}) {sectionName}\";\n    }\n\n    return sectionName;\n  }\n\n  public string GetFunctionName(IRTextFunction function) {\n    return function.Name;\n  }\n\n  public string DemangleFunctionName(string name, FunctionNameDemanglingOptions options) {\n    if (!demangledNameMap_.TryGetValue(name, out string demangledName)) {\n      demangledName = PDBDebugInfoProvider.DemangleFunctionName(name, options);\n      demangledNameMap_.TryAdd(name, demangledName);\n    }\n\n    return demangledName;\n  }\n\n  public string DemangleFunctionName(IRTextFunction function, FunctionNameDemanglingOptions options) {\n    return DemangleFunctionName(function.Name, options);\n  }\n\n  public string FormatFunctionName(string name) {\n    if (!IsDemanglingEnabled || string.IsNullOrEmpty(name)) {\n      return name;\n    }\n\n    // Mangled MSVC C++ names always start with a ? char.\n    if (!name.StartsWith('?')) {\n      return name;\n    }\n\n    if (!functionNameMap_.TryGetValue(name, out string demangledName)) {\n      demangledName = PDBDebugInfoProvider.DemangleFunctionName(name, GlobalDemanglingOptions);\n      functionNameMap_.TryAdd(name, demangledName);\n    }\n\n    return demangledName;\n  }\n\n  public void SettingsChanged() {\n    demangledNameMap_.Clear();\n    functionNameMap_.Clear();\n  }\n\n  public string FormatFunctionName(IRTextFunction function) {\n    return FormatFunctionName(function.Name);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/ASMParser.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Collections;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Lexer;\nusing ProfileExplorer.Core.Parser;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic sealed class ASMParser : ParserBase {\n  private static Dictionary<string, Keyword> keywordMap_ =\n    new() {\n      {\"byte\", Keyword.Byte},\n      {\"word\", Keyword.Word},\n      {\"dword\", Keyword.Dword},\n      {\"qword\", Keyword.Qword},\n      {\"xmmword\", Keyword.Xmmword},\n      {\"ymmword\", Keyword.Ymmword},\n      {\"Zmmword\", Keyword.Zmmword},\n      {\"ptr\", Keyword.Ptr},\n      {\"BYTE\", Keyword.Byte},\n      {\"WORD\", Keyword.Word},\n      {\"DWORD\", Keyword.Dword},\n      {\"QWORD\", Keyword.Qword},\n      {\"XMMWORD\", Keyword.Xmmword},\n      {\"YMMWORD\", Keyword.Ymmword},\n      {\"ZMMWORD\", Keyword.Zmmword},\n      {\"PTR\", Keyword.Ptr},\n      {\"h\", Keyword.Hex},\n      {\"H\", Keyword.Hex}\n    };\n  private static readonly StringTrie<Keyword> keywordTrie_ = new(keywordMap_);\n\n  //? TODO: ILT+foo func names not parsed properly\n  private long functionSize_;\n  private long? initialAddress_;\n  private bool makeNewBlock_;\n  private bool connectNewBlock_;\n  private InstructionIR previousInstr_;\n  private long previousInstrAddress_;\n  private int instrCount_;\n  private Dictionary<long, int> addressToBlockNumberMap_;\n  private Dictionary<long, Tuple<TextLocation, int>> potentialLabelMap_;\n  private HashSet<BlockIR> committedBlocks_;\n  private Dictionary<BlockIR, long> referencedBlocks_;\n\n  public ASMParser(ICompilerIRInfo irInfo, IRParsingErrorHandler errorHandler,\n                   RegisterTable registerTable, ReadOnlyMemory<char> sectionText,\n                   IRTextSection section, long functionSize)\n    : base(irInfo, errorHandler, registerTable, section) {\n    Reset();\n    Initialize(sectionText);\n    functionSize_ = functionSize;\n    MetadataTag.EnsureCapacity(section.LineCount + 1);\n    SkipToken();\n  }\n\n  public ASMParser(ICompilerIRInfo irInfo, IRParsingErrorHandler errorHandler,\n                   RegisterTable registerTable, string sectionText,\n                   IRTextSection section, long functionSize)\n    : base(irInfo, errorHandler, registerTable, section) {\n    Reset();\n    Initialize(sectionText);\n    functionSize_ = functionSize;\n    MetadataTag.EnsureCapacity(section.LineCount + 1);\n    SkipToken();\n  }\n\n  public FunctionIR Parse() {\n    var function = new FunctionIR(section_.ParentFunction.Name);\n    Token startElement = default;\n    BlockIR block = null;\n\n    while (!IsEOF()) {\n      if (makeNewBlock_) {\n        // Make a new block.\n        if ((IsNumber() || IsIdentifier()) &&\n            NextTokenIs(TokenKind.Colon) &&\n            TokenLongHexNumber(out long address)) {\n          var newBlock = GetOrCreateBlock(address, function);\n          var blockLabel = GetOrCreateBlockLabel(newBlock);\n\n          blockLabel.TextLocation = current_.Location;\n          blockLabel.TextLength = current_.Length;\n\n          if (block != null && connectNewBlock_) {\n            ConnectBlocks(block, newBlock);\n          }\n\n          function.Blocks.Add(newBlock);\n          committedBlocks_.Add(newBlock);\n          block = newBlock;\n          startElement = current_;\n        }\n        else {\n          // Skip over unknown text, such as the function name at the start.\n          SkipToLineStart();\n          continue;\n        }\n\n        makeNewBlock_ = false;\n        connectNewBlock_ = false;\n      }\n\n      if (ParseLine(block)) {\n        // Block ended with this line.\n        SetTextRange(block, startElement, previous_);\n      }\n\n      SkipToLineStart();\n    }\n\n    if (block != null) {\n      SetTextRange(block, startElement, current_);\n    }\n\n    Debug.Assert(function.InstructionCount == instrCount_);\n    Debug.Assert(function.TupleCount == instrCount_);\n\n    SetLastInstructionSize();\n    FixBlockReferences(function);\n    AssignBlockNumbers(function);\n    AddMetadata(function);\n    return function;\n  }\n\n  private void Reset() {\n    base.Reset();\n    makeNewBlock_ = true;\n    addressToBlockNumberMap_ = new Dictionary<long, int>();\n    potentialLabelMap_ = new Dictionary<long, Tuple<TextLocation, int>>();\n    committedBlocks_ = new HashSet<BlockIR>();\n    referencedBlocks_ = new Dictionary<BlockIR, long>();\n  }\n\n  private int GetBlockNumber(long address) {\n    if (addressToBlockNumberMap_.TryGetValue(address, out int number)) {\n      return number;\n    }\n\n    number = addressToBlockNumberMap_.Count;\n    addressToBlockNumberMap_[address] = number;\n    return number;\n  }\n\n  private BlockIR GetOrCreateBlock(long address, FunctionIR function) {\n    int number = GetBlockNumber(address);\n    return base.GetOrCreateBlock(number, function);\n  }\n\n  private BlockLabelIR GetOrCreateBlockLabel(BlockIR block) {\n    // Create a dummy label to be set later when parsing the block.\n    if (block.Label == null) {\n      block.Label = new BlockLabelIR(NextElementId, ReadOnlyMemory<char>.Empty, block);\n    }\n\n    return block.Label;\n  }\n\n  private void AssignBlockNumbers(FunctionIR function) {\n    if (function.Blocks.Count == 0) {\n      return;\n    }\n\n    // Renumber blocks to follow text order.\n    int blockNumber = 0;\n    var blockOrdering = new CFGBlockOrdering(function);\n\n    blockOrdering.ReversePostorderWalk((b, index) => {\n      b.Number = blockNumber++;\n      return true;\n    });\n\n    // Assign block index as they show up in the text,\n    // not RDFO or how the blocks where forward-referenced.\n    function.AssignBlockIndices(true);\n\n    // The last block (after RET) is usually unreachable, remove it.\n    if (function.EntryBlock != function.ExitBlock &&\n        function.ExitBlock.Predecessors.Count == 0) {\n      function.Blocks.Remove(function.ExitBlock);\n    }\n  }\n\n  private void FixBlockReferences(FunctionIR function) {\n    // Add any remaining blocks referenced by jumps.\n    foreach (var pair in referencedBlocks_) {\n      var refBlock = pair.Key;\n      long refAddress = pair.Value;\n\n      if (committedBlocks_.Contains(refBlock)) {\n        continue;\n      }\n\n      // Found a referenced label, but there is no block created for it.\n      // This happens when there is no jump/branch before the label.\n      // In practice this is fast, although in worst case it's #labels * #blocks complexity.\n      bool blockAdded = false;\n\n      if (potentialLabelMap_.TryGetValue(refAddress, out var labelLocation)) {\n        var label = GetOrCreateBlockLabel(refBlock);\n        label.TextLocation = labelLocation.Item1;\n        label.TextLength = labelLocation.Item2;\n        refBlock.TextLocation = labelLocation.Item1;\n\n        // Check if there is an overlapping block and split it at the label,\n        // move the tuples following the label to the new block.\n        // |otherBlock|1|2|..|refBlock label|3|4|..|  =>  |otherBlock|1|2|..| -> |refBlock label|1|2|..|\n        for (int i = 0; i < function.Blocks.Count; i++) {\n          var otherBlock = function.Blocks[i];\n\n          if (otherBlock == refBlock) {\n            continue;\n          }\n\n          if (otherBlock.TextLocation <= labelLocation.Item1 &&\n              otherBlock.TextLocation.Offset + otherBlock.TextLength > labelLocation.Item1.Offset) {\n            int offsetDiff = labelLocation.Item1.Offset - otherBlock.TextLocation.Offset;\n            refBlock.TextLength = otherBlock.TextLength - offsetDiff;\n\n            // Move successor blocks from otherBlock to refBlock.\n            foreach (var succBlock in otherBlock.Successors) {\n              refBlock.Successors.Add(succBlock);\n              succBlock.Predecessors.Remove(otherBlock);\n              succBlock.Predecessors.Add(refBlock);\n            }\n\n            otherBlock.Successors.Clear();\n\n            // Move the tuples to the new block.\n            int splitIndex = 0;\n            int copiedTuples = 0;\n\n            for (; splitIndex < otherBlock.Tuples.Count; splitIndex++) {\n              var tuple = otherBlock.Tuples[splitIndex];\n\n              if (tuple.TextLocation >= labelLocation.Item1) {\n                refBlock.Tuples.Add(tuple);\n                tuple.Parent = refBlock;\n                tuple.IndexInBlock = copiedTuples;\n                copiedTuples++;\n              }\n            }\n\n            // If the block has only NOP, don't connect it, it leaves\n            // the NOP block without any predecessor.\n            ConnectBlocks(otherBlock, refBlock);\n\n            if (copiedTuples > 0) {\n              otherBlock.Tuples.RemoveRange(otherBlock.Tuples.Count - copiedTuples, copiedTuples);\n\n              if (otherBlock.Tuples.Count > 0) {\n                otherBlock.TextLength = otherBlock.Tuples[^1].TextLocation.Offset +\n                                        otherBlock.Tuples[^1].TextLength -\n                                        otherBlock.TextLocation.Offset;\n              }\n              else {\n                otherBlock.TextLength = offsetDiff - 1;\n              }\n            }\n\n            // Insert block after the other one.\n            function.Blocks.Insert(i + 1, refBlock);\n            blockAdded = true;\n            break; // Stop, there can't be more than one overlapping block.\n          }\n        }\n\n        committedBlocks_.Add(refBlock);\n      }\n\n      if (!blockAdded) {\n        function.Blocks.Add(refBlock);\n      }\n    }\n  }\n\n  private void ConnectBlocks(BlockIR block, BlockIR newBlock) {\n    if (block.Successors.Contains(newBlock)) {\n      return;\n    }\n\n    block.Successors.Add(newBlock);\n    newBlock.Predecessors.Add(block);\n  }\n\n  private bool ParseLine(BlockIR block) {\n    var startToken = current_;\n    long address = 0;\n\n    if (!(IsNumber() || IsIdentifier()) ||\n        !TokenLongHexNumber(out address)) {\n      // Ignore lines that don't start with an address (comments, etc).\n      return false;\n    }\n\n    // Record address to be used for jump in the middle of blocks.\n    potentialLabelMap_[address] = new Tuple<TextLocation, int>(current_.Location, current_.Length);\n    SkipToken();\n\n    if (!ExpectAndSkipToken(TokenKind.Colon)) {\n      // Instrs. with more than 6 bytes extend on multiple lines.\n      // 0000000140068023: 49 BF 70 89 DE 5E  mov         r15,9375B7955EDE8970h\n      //                   95 B7 75 93\n      if (previousInstr_ != null) {\n        SkipInstructionBytes();\n        return false;\n      }\n\n      ReportErrorAndSkipLine(TokenKind.Colon, \"Expected a colon to follow the address\");\n      return false;\n    }\n\n    // Skip over the list of instruction bytecodes.\n    SkipInstructionBytes();\n    (var instr, bool isJump) = ParseInstruction(block);\n\n    // Update metadata.\n    initialAddress_ ??= address;\n    long offset = address - initialAddress_.Value;\n\n    MetadataTag.AddressToElementMap[address] = instr;\n    MetadataTag.OffsetToElementMap[offset] = instr;\n    MetadataTag.ElementToOffsetMap[instr] = offset;\n    SetPreviousInstructionSize(address);\n\n    previousInstr_ = instr;\n    previousInstrAddress_ = address;\n\n    SetTextRange(instr, startToken, current_, 1);\n    SkipToLineEnd();\n    return isJump; // A jump ends the current block.\n  }\n\n  private void SetPreviousInstructionSize(long address) {\n    if (previousInstr_ != null) {\n      int instrSize = (int)(address - previousInstrAddress_);\n      MetadataTag.ElementSizeMap[previousInstr_] = instrSize;\n      MetadataTag.FunctionSize += instrSize;\n    }\n  }\n\n  private void SetLastInstructionSize() {\n    if (previousInstr_ != null) {\n      int instrSize = (int)(functionSize_ - MetadataTag.FunctionSize);\n      MetadataTag.ElementSizeMap[previousInstr_] = instrSize;\n      MetadataTag.FunctionSize += instrSize;\n    }\n  }\n\n  private (InstructionIR, bool) ParseInstruction(BlockIR block) {\n    bool isJump = false;\n    var instr = new InstructionIR(NextElementId, InstructionKind.Other, block);\n    block.AddTuple(instr);\n    instrCount_++;\n\n    // Extract the opcode.\n    if (IsIdentifier()) {\n      SetInstructionOpcode(instr);\n\n      if (instr.Kind == InstructionKind.Branch) {\n        isJump = true;\n        makeNewBlock_ = true;\n        connectNewBlock_ = true; // Fall-through.\n      }\n      else if (instr.Kind == InstructionKind.Goto) {\n        isJump = true;\n        makeNewBlock_ = true;\n        connectNewBlock_ = false;\n      }\n      else if (instr.Kind == InstructionKind.Return) {\n        isJump = true;\n        makeNewBlock_ = true;\n        connectNewBlock_ = false;\n      }\n\n      SkipToken(); // Skip opcode.\n      ParseOperandList(instr, instr.Sources);\n\n      if (isJump) {\n        // Connect the block with the jump target.\n        var targetOp = irInfo_.GetBranchTarget(instr);\n\n        if (targetOp != null && targetOp.IsIntConstant) {\n          long targetAddress = targetOp.IntValue;\n          var targetBlock = GetOrCreateBlock(targetAddress, block.ParentFunction);\n          ConnectBlocks(block, targetBlock);\n          referencedBlocks_[targetBlock] = targetAddress;\n\n          int opIndex = instr.Sources.IndexOf(targetOp);\n          instr.Sources[opIndex].Kind = OperandKind.LabelAddress;\n          instr.Sources[opIndex].Value = GetOrCreateBlockLabel(targetBlock);\n        }\n      }\n      else {\n        if (instr.Sources.Count > 0) {\n          instr.Destinations.Add(instr.Sources[0]);\n        }\n\n        //? TODO: OPEQ add first source as dest\n      }\n    }\n\n    return (instr, isJump);\n  }\n\n  private bool ParseOperandList(InstructionIR instr, List<OperandIR> list) {\n    while (!IsLineEnd()) {\n      var operand = ParseOperand(instr);\n\n      if (operand == null) {\n        return false;\n      }\n\n      operand.Role = OperandRole.Source;\n      list.Add(operand);\n\n      if (IsComma()) {\n        SkipToken(); // More operands after ,\n      }\n      else {\n        if (instr.Kind == InstructionKind.Call &&\n            operand.IsVariable && operand.HasName) {\n          // With demangled names, there can be multiple tokens\n          // that form the complete function name, append them together.\n          var sb = new StringBuilder();\n          sb.Append(operand.Name);\n\n          int funcNameLength = operand.TextLength;\n          int prevTokenEnd = operand.TextLocation.Offset + operand.TextLength;\n\n          while (!IsLineEnd()) {\n            // Append whitespace if there is some between tokens.\n            int spaceCount = current_.Location.Offset - prevTokenEnd;\n\n            if (spaceCount > 0) {\n              sb.Append(lexer_.GetText(prevTokenEnd, spaceCount));\n              funcNameLength += spaceCount;\n            }\n\n            sb.Append(lexer_.GetTokenText(current_));\n            funcNameLength += current_.Length;\n            prevTokenEnd = current_.Location.Offset + current_.Length;\n            SkipToken();\n          }\n\n          operand.Value = sb.ToString().AsMemory();\n          operand.TextLength = funcNameLength;\n        }\n\n        break;\n      }\n    }\n\n    return true;\n  }\n\n  private OperandIR ParseOperand(TupleIR parent, bool isIndirBaseOp = false,\n                                 bool isBlockLabelRef = false,\n                                 bool disableSkipToNext = false) {\n    SkipKeywords(); // Skip DWORD PTR, etc.\n    OperandIR operand = null;\n\n    // operand = varOp | intOp | floatOp | addressOp | indirOp | labelOp | pasOp\n    if (IsIdentifier()) {\n      // Variable/temporary.\n      //? TODO: If it starts with @ it's address\n      operand = ParseVariableOperand(parent, isIndirBaseOp);\n    }\n    else if (IsNumber() || TokenIs(TokenKind.Minus) || TokenIs(TokenKind.Hash)) { // int/float const\n      operand = ParseNumber(parent);\n    }\n    else if (TokenIs(TokenKind.OpenSquare)) { // [indir]\n      if (isIndirBaseOp) {\n        ReportError(TokenKind.OpenSquare, \"Failed ParseOperand nested INDIR\");\n        return null; // Nested [indir] not allowed.\n      }\n\n      operand = ParseIndirection(parent);\n    }\n\n    SkipToNextOperand();\n    return operand;\n  }\n\n  private OperandIR ParseNumber(TupleIR parent) {\n    var startToken = current_;\n    var opKind = OperandKind.Other;\n    object opValue = null;\n    bool isNegated = false;\n\n    // ARM64 assembly can have a # in front of a number like in #0x30.\n    if (TokenIs(TokenKind.Hash)) {\n      SkipToken();\n    }\n\n    if (TokenIs(TokenKind.Minus)) {\n      SkipToken();\n      isNegated = true;\n    }\n\n    if (TokenLongHexNumber(out long intValue)) {\n      // intConst = DECIMAL [(0xHEX)] [.type]\n      SkipToken();\n      opKind = OperandKind.IntConstant;\n\n      unchecked {\n        opValue = isNegated ? -intValue : intValue;\n      }\n\n      SkipKeyword(Keyword.Hex); // Skip optional h suffix.\n    }\n    else {\n      ReportError(TokenKind.Number, \"Failed ParseNumber\");\n      return null;\n    }\n\n    var type = TypeIR.GetUnknown();\n    var operand = CreateOperand(NextElementId, opKind, type, parent);\n    operand.Value = opValue;\n    SetTextRange(operand, startToken);\n    return operand;\n  }\n\n  private OperandIR ParseVariableOperand(TupleIR parent, bool isIndirBaseOp = false) {\n    // Save variable name.\n    var opName = TokenData();\n    var operand = CreateOperand(NextElementId, OperandKind.Variable, TypeIR.GetUnknown(), parent);\n    operand.Value = opName;\n\n    // Try to associate with a register.\n    var register = RegisterTable.GetRegister(TokenString());\n\n    if (register != null) {\n      operand.AddTag(new RegisterTag(register, operand));\n    }\n\n    var startToken = current_;\n    SkipToken();\n    SetTextRange(operand, startToken);\n    return operand;\n  }\n\n  private OperandIR ParseIndirection(TupleIR parent) {\n    var startToken = current_;\n    SkipToken();\n    var baseOp = ParseOperand(parent, true);\n\n    // After lowering, indirections can have multiple operands\n    // like [base+index+offset].\n    //? TODO: Save the extra ops\n    while (!TokenIs(TokenKind.CloseSquare)) {\n      // Skip over + or *.\n      SkipToNextOperand();\n      ExpectAndSkipToken(TokenKind.Plus, TokenKind.Star, TokenKind.Comma);\n\n      if (ParseOperand(parent, true) == null) {\n        break;\n      }\n\n      //? TODO: Add to list - maybe introduce IndirectOperand\n    }\n\n    var operand = CreateOperand(NextElementId, OperandKind.Indirection,\n                                TypeIR.GetUnknown(), parent);\n    operand.Value = baseOp;\n\n    if (!ExpectAndSkipToken(TokenKind.CloseSquare)) {\n      ReportError(TokenKind.CloseSquare, \"Failed ParseIndirection\");\n      return null;\n    }\n\n    SetTextRange(operand, startToken);\n    return operand;\n  }\n\n  private void SkipToNextOperand() {\n    while (!(TokenIs(TokenKind.Comma) || IsLineEnd())) {\n      if (TokenIs(TokenKind.Dot)) {\n        // Skip over ARM64 operand annotations like v22.4s\n        SkipToToken(TokenKind.Comma);\n      }\n      else if (TokenIs(TokenKind.OpenParen)) {\n        SkipAfterToken(TokenKind.CloseParen);\n      }\n      else if (TokenIs(TokenKind.OpenCurly)) {\n        SkipAfterToken(TokenKind.CloseCurly);\n      }\n      else {\n        break;\n      }\n    }\n  }\n\n  private OperandIR CreateOperand(IRElementId elementId, OperandKind kind,\n                                  TypeIR type, TupleIR parent) {\n#if USE_POOL\n    var op = operandPool_.Get();\n    op.Id = elementId.NextOperand();\n    op.Kind = kind;\n    op.Type = type;\n    op.Parent = parent;\n    return op;\n#else\n    return new OperandIR(elementId, kind, type, parent);\n#endif\n  }\n\n  private void SkipInstructionBytes() {\n    // For ARM64 each instruction is 4 bytes.\n    if (irInfo_.Mode == IRMode.ARM64) {\n      if (SkipHexNumber(8)) {\n        return;\n      }\n    }\n\n    while (SkipHexNumber(2)) { // Groups of 2 digits.\n    }\n  }\n\n  private void SetInstructionOpcode(InstructionIR instr) {\n    instr.OpcodeLocation = current_.Location;\n    instr.OpcodeText = TokenData();\n\n    if (NextTokenIs(TokenKind.Dot) && irInfo_.Mode == IRMode.ARM64) {\n      // Some disassemblers for ARM64 print branch opcodes\n      // like b.eq, b.le instead of beq, ble.\n      SkipToken(); // Skip b\n      SkipToken(); // Skip .\n\n      if (IsIdentifier()) {\n        instr.OpcodeText = $\"{instr.OpcodeText}{TokenData()}\".AsMemory();\n      }\n    }\n\n    switch (irInfo_.Mode) {\n      case IRMode.x86_64: {\n        if (x86Opcodes.GetOpcodeInfo(instr.OpcodeText, out var info)) {\n          instr.Opcode = info.Opcode;\n          instr.Kind = info.Kind;\n        }\n\n        break;\n      }\n      case IRMode.ARM64: {\n        if (ARM64Opcodes.GetOpcodeInfo(instr.OpcodeText, out var info)) {\n          instr.Opcode = info.Opcode;\n          instr.Kind = info.Kind;\n        }\n\n        break;\n      }\n      default: {\n        Debug.Assert(false, \"Unsupported IR mode\");\n        Trace.WriteLine($\"Unsupported IR mode {irInfo_.Mode}\");\n        break;\n      }\n    }\n  }\n\n  private Keyword TokenKeyword() {\n    if (current_.IsIdentifier()) {\n      if (keywordTrie_.TryGetValue(TokenStringData(), out var keyword)) {\n        return keyword;\n      }\n    }\n\n    return Keyword.None;\n  }\n\n  private bool IsKeyword() {\n    return TokenKeyword() != Keyword.None;\n  }\n\n  private void SkipKeyword(Keyword kind) {\n    if (TokenKeyword() == kind) {\n      SkipToken();\n    }\n  }\n\n  private void SkipKeywords() {\n    while (IsKeyword()) {\n      SkipToken();\n    }\n  }\n\n  private enum Keyword {\n    None,\n    Byte,\n    Word,\n    Dword,\n    Qword,\n    Xmmword,\n    Ymmword,\n    Zmmword,\n    Ptr,\n    Hex\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/DisassemblerSectionLoader.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic sealed class DisassemblerSectionLoader : IRTextSectionLoader {\n  private IRTextSummary summary_;\n  private string binaryFilePath_;\n  private Disassembler disassembler_;\n  private IDebugInfoProvider debugInfo_;\n  private IDebugFileFinder debugFileFinder_;\n  private IDebugInfoProviderFactory debugInfoProviderFactory_;\n  private INameProvider nameProvider_;\n  private Dictionary<IRTextFunction, FunctionDebugInfo> funcToDebugInfoMap_;\n  private bool isManagedImage_;\n  private bool preloadFunctions_;\n  private DebugFileSearchResult debugInfoFile_;\n  private bool resolveCallTargetNames_;\n\n  public DisassemblerSectionLoader(string binaryFilePath, ICompilerInfoProvider compilerInfo, IDebugInfoProvider debugInfo,\n    bool preloadFunctions = true, bool isManagedImage = false) {\n    Initialize(compilerInfo.IR, false);\n    binaryFilePath_ = binaryFilePath;\n    debugInfo_ = debugInfo;\n    debugFileFinder_ = compilerInfo.DebugFileFinder;\n    debugInfoProviderFactory_ = compilerInfo.DebugInfoProviderFactory;\n    nameProvider_ = compilerInfo.NameProvider;\n    preloadFunctions_ = preloadFunctions;\n    isManagedImage_ = isManagedImage;\n    summary_ = new IRTextSummary();\n    funcToDebugInfoMap_ = new Dictionary<IRTextFunction, FunctionDebugInfo>();\n  }\n\n  public IDebugInfoProvider DebugInfo {\n    get => debugInfo_;\n    set => debugInfo_ = value;\n  }\n\n  public DebugFileSearchResult DebugInfoFile {\n    get => debugInfoFile_;\n    set => debugInfoFile_ = value;\n  }\n\n  public bool ResolveCallTargetNames {\n    get => resolveCallTargetNames_;\n    set {\n      resolveCallTargetNames_ = value;\n\n      if (disassembler_ != null) {\n        if (value) {\n          disassembler_.UseSymbolNameResolver(null);\n        }\n        else {\n          disassembler_.UseSymbolNameResolver((value) => null);\n        }\n      }\n    }\n  }\n\n  public bool IsDisassemblerInitialized => disassembler_ != null;\n\n  public void RegisterFunction(IRTextFunction function, FunctionDebugInfo debugInfo) {\n    funcToDebugInfoMap_[function] = debugInfo;\n  }\n\n  public void Initialize(IDebugInfoProvider debugInfo) {\n    debugInfo_ = debugInfo;\n    InitializeDisassembler();\n  }\n\n  public async override Task<IRTextSummary> LoadDocument(ProgressInfoHandler progressHandler) {\n    progressHandler?.Invoke(null, new SectionReaderProgressInfo(true));\n\n    if (debugInfo_ == null) {\n      if (preloadFunctions_) {\n        // When opening in non-profiling mode, lookup the debug info now.\n        debugInfoFile_ = await debugFileFinder_.FindDebugInfoFileAsync(binaryFilePath_);\n        debugInfo_ = debugInfoProviderFactory_.CreateDebugInfoProvider(debugInfoFile_);\n      }\n\n      if (debugInfo_ == null) {\n        return summary_;\n      }\n    }\n\n    InitializeDisassembler();\n\n    if (preloadFunctions_) {\n      // Used when opening a binary directly.\n      var funcList = debugInfo_.GetSortedFunctions();\n\n      foreach (var funcInfo in funcList) {\n        if (funcInfo.RVA == 0) {\n          continue; // Some entries don't represent real functions.\n        }\n\n        // The debug info function list can have duplicates, ignore them.\n        var func = summary_.FindFunction(funcInfo.Name);\n\n        if (func == null) {\n          func = new IRTextFunction(funcInfo.Name);\n          var section = new IRTextSection(func, func.Name, IRPassOutput.Empty);\n          func.AddSection(section);\n          summary_.AddFunction(func);\n          summary_.AddSection(section);\n          funcToDebugInfoMap_[func] = funcInfo;\n        }\n      }\n    }\n\n    progressHandler?.Invoke(null, new SectionReaderProgressInfo(false));\n    return summary_;\n  }\n\n  private bool InitializeDisassembler() {\n    if (!isManagedImage_) {\n      // This preloads all code sections in the binary.\n      disassembler_ = Disassembler.CreateForBinary(binaryFilePath_, debugInfo_,\n                                                   nameProvider_.FormatFunctionName);\n      return true;\n    }\n\n    // For managed code, the code data is found on each function.\n    if (debugInfo_.LoadDebugInfo(null)) {\n      disassembler_ = Disassembler.CreateForMachine(debugInfo_, nameProvider_.FormatFunctionName);\n      return true;\n    }\n\n    return false;\n  }\n\n  public override string GetDocumentOutputText() {\n    return \"\";\n  }\n\n  public override byte[] GetDocumentTextBytes() {\n    return new byte[] { };\n  }\n\n  public override ParsedIRTextSection LoadSection(IRTextSection section) {\n    string text = GetSectionText(section);\n\n    if (string.IsNullOrEmpty(text)) {\n      return null;\n    }\n\n    // Function size needed by parser to properly set instr. sizes.\n    long functionSize = 0;\n\n    if (funcToDebugInfoMap_.TryGetValue(section.ParentFunction, out var funcInfo)) {\n      functionSize = funcInfo.Size;\n    }\n\n    var (sectionParser, errorHandler) = InitializeParser(functionSize);\n    FunctionIR function;\n\n    if (sectionParser == null) {\n      function = new FunctionIR();\n    }\n    else {\n      function = sectionParser.ParseSection(section, text);\n    }\n\n    return new ParsedIRTextSection(section, text.AsMemory(), function);\n  }\n\n  public override string GetSectionText(IRTextSection section) {\n    if (disassembler_ == null) {\n      return null; // Failed to initialize.\n    }\n\n    if (!funcToDebugInfoMap_.TryGetValue(section.ParentFunction, out var funcInfo)) {\n      return \"\";\n    }\n\n    if (isManagedImage_) {\n      // For managed code, the code data is found on each function as a byte array.\n      var methodCode = ((DotNetDebugInfoProvider)debugInfo_).FindMethodCode(funcInfo);\n\n      if (methodCode != null) {\n        byte[] code = methodCode.Code;\n\n        if (code != null) {\n          disassembler_.UseSymbolNameResolver(address => methodCode.FindCallTarget(address));\n          return disassembler_.DisassembleToText(code, funcInfo.StartRVA);\n        }\n      }\n\n      return \"\";\n    }\n\n    return disassembler_.DisassembleToText(funcInfo);\n  }\n\n  public override ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section) {\n    return GetSectionText(section).AsMemory();\n  }\n\n  public override string GetSectionOutputText(IRPassOutput output) {\n    return \"\";\n  }\n\n  public override ReadOnlyMemory<char> GetSectionPassOutputTextSpan(IRPassOutput output) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  public override List<string> GetSectionPassOutputTextLines(IRPassOutput output) {\n    return new List<string>();\n  }\n\n  public override string GetRawSectionText(IRTextSection section) {\n    return GetSectionText(section);\n  }\n\n  public override string GetRawSectionPassOutput(IRPassOutput output) {\n    return \"\";\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionTextSpan(IRTextSection section) {\n    return GetRawSectionText(section).AsMemory();\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionPassOutputSpan(IRPassOutput output) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  protected override void Dispose(bool disposing) {\n    disassembler_?.Dispose();\n    debugInfo_?.Dispose();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/ASM/X86Opcodes.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Collections;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Compilers.ASM;\n\npublic enum x86Opcode {\n  RET,\n  JMP,\n  JO,\n  JNO,\n  JS,\n  JNS,\n  JE,\n  JZ,\n  JNE,\n  JNZ,\n  JB,\n  JNAE,\n  JC,\n  JNB,\n  JAE,\n  JNC,\n  JBE,\n  JNA,\n  JA,\n  JNBE,\n  JL,\n  JNGE,\n  JGE,\n  JNL,\n  JLE,\n  JNG,\n  JG,\n  JNLE,\n  JP,\n  JPE,\n  JNP,\n  JPO,\n  JCXZ,\n  JECXZ,\n  CALL,\n  SYSCALL,\n  NOP\n}\n\npublic struct x86OpcodeInfo {\n  public x86Opcode Opcode { get; set; }\n  public InstructionKind Kind { get; set; }\n\n  public x86OpcodeInfo(x86Opcode opcode, InstructionKind kind) {\n    Opcode = opcode;\n    Kind = kind;\n  }\n}\n\npublic static class x86Opcodes {\n  private static readonly Dictionary<string, x86OpcodeInfo> opcodes_ =\n    new() {\n      {\"JMP\", new x86OpcodeInfo(x86Opcode.JMP, InstructionKind.Goto)},\n      {\"RET\", new x86OpcodeInfo(x86Opcode.RET, InstructionKind.Return)},\n      {\"JO\", new x86OpcodeInfo(x86Opcode.JO, InstructionKind.Branch)},\n      {\"JNO\", new x86OpcodeInfo(x86Opcode.JNO, InstructionKind.Branch)},\n      {\"JS\", new x86OpcodeInfo(x86Opcode.JS, InstructionKind.Branch)},\n      {\"JNS\", new x86OpcodeInfo(x86Opcode.JNS, InstructionKind.Branch)},\n      {\"JE\", new x86OpcodeInfo(x86Opcode.JE, InstructionKind.Branch)},\n      {\"JZ\", new x86OpcodeInfo(x86Opcode.JZ, InstructionKind.Branch)},\n      {\"JNE\", new x86OpcodeInfo(x86Opcode.JNE, InstructionKind.Branch)},\n      {\"JNZ\", new x86OpcodeInfo(x86Opcode.JNZ, InstructionKind.Branch)},\n      {\"JB\", new x86OpcodeInfo(x86Opcode.JB, InstructionKind.Branch)},\n      {\"JNAE\", new x86OpcodeInfo(x86Opcode.JNAE, InstructionKind.Branch)},\n      {\"JC\", new x86OpcodeInfo(x86Opcode.JC, InstructionKind.Branch)},\n      {\"JNB\", new x86OpcodeInfo(x86Opcode.JNB, InstructionKind.Branch)},\n      {\"JAE\", new x86OpcodeInfo(x86Opcode.JAE, InstructionKind.Branch)},\n      {\"JNC\", new x86OpcodeInfo(x86Opcode.JNC, InstructionKind.Branch)},\n      {\"JBE\", new x86OpcodeInfo(x86Opcode.JBE, InstructionKind.Branch)},\n      {\"JNA\", new x86OpcodeInfo(x86Opcode.JNA, InstructionKind.Branch)},\n      {\"JA\", new x86OpcodeInfo(x86Opcode.JA, InstructionKind.Branch)},\n      {\"JNBE\", new x86OpcodeInfo(x86Opcode.JNBE, InstructionKind.Branch)},\n      {\"JL\", new x86OpcodeInfo(x86Opcode.JL, InstructionKind.Branch)},\n      {\"JNGE\", new x86OpcodeInfo(x86Opcode.JNGE, InstructionKind.Branch)},\n      {\"JGE\", new x86OpcodeInfo(x86Opcode.JGE, InstructionKind.Branch)},\n      {\"JNL\", new x86OpcodeInfo(x86Opcode.JNL, InstructionKind.Branch)},\n      {\"JLE\", new x86OpcodeInfo(x86Opcode.JLE, InstructionKind.Branch)},\n      {\"JNG\", new x86OpcodeInfo(x86Opcode.JNG, InstructionKind.Branch)},\n      {\"JG\", new x86OpcodeInfo(x86Opcode.JG, InstructionKind.Branch)},\n      {\"JNLE\", new x86OpcodeInfo(x86Opcode.JNLE, InstructionKind.Branch)},\n      {\"JP\", new x86OpcodeInfo(x86Opcode.JP, InstructionKind.Branch)},\n      {\"JPE\", new x86OpcodeInfo(x86Opcode.JPE, InstructionKind.Branch)},\n      {\"JNP\", new x86OpcodeInfo(x86Opcode.JNP, InstructionKind.Branch)},\n      {\"JPO\", new x86OpcodeInfo(x86Opcode.JPO, InstructionKind.Branch)},\n      {\"JCXZ\", new x86OpcodeInfo(x86Opcode.JCXZ, InstructionKind.Branch)},\n      {\"JECXZ\", new x86OpcodeInfo(x86Opcode.JECXZ, InstructionKind.Branch)},\n      {\"CALL\", new x86OpcodeInfo(x86Opcode.CALL, InstructionKind.Call)},\n      {\"SYSCALL\", new x86OpcodeInfo(x86Opcode.SYSCALL, InstructionKind.Call)},\n      {\"NOP\", new x86OpcodeInfo(x86Opcode.NOP, InstructionKind.Other)}\n    };\n  private static readonly StringTrie<x86OpcodeInfo> opcodesTrie_ = new(opcodes_);\n\n  public static bool GetOpcodeInfo(string value, out x86OpcodeInfo info) {\n    return opcodesTrie_.TryGetValue(value, out info, true);\n  }\n\n  public static bool GetOpcodeInfo(ReadOnlyMemory<char> value, out x86OpcodeInfo info) {\n    return opcodesTrie_.TryGetValue(value, out info, true);\n  }\n\n  public static bool IsOpcode(string value) {\n    return GetOpcodeInfo(value, out _);\n  }\n\n  public static bool IsOpcode(ReadOnlyMemory<char> value) {\n    return opcodesTrie_.Contains(value);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/Architecture/ARM64RegisterTable.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Compilers.Architecture;\n\npublic enum ARM64Register {\n}\n\npublic class ARM64RegisterTable : RegisterTable {\n  //? TODO\n  //? private static readonly RegisterIR[] registers_ = {\n  //?     //             Name      Register     Bit offset  Bit length\n  //?\n  //? };\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/Architecture/IRMode.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.Core.Compilers.Architecture;\n\npublic enum IRMode {\n  Default,\n  x86_64,\n  ARM64\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/Architecture/RegisterTables.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Compilers.Architecture;\n\npublic static class RegisterTables {\n  // Static instances to have the tables built only once.\n  private static X86RegisterTable x86RegisterTable_;\n  private static ARM64RegisterTable arm64RegisterTable_;\n\n  static RegisterTables() {\n    x86RegisterTable_ = new X86RegisterTable();\n    arm64RegisterTable_ = new ARM64RegisterTable();\n\n    x86RegisterTable_.AddRegisterAlias(\"cc_zf\", \"zf\");\n    x86RegisterTable_.AddRegisterAlias(\"cc_cf\", \"cf\");\n    x86RegisterTable_.AddRegisterAlias(\"cc_pf\", \"pf\");\n    x86RegisterTable_.AddRegisterAlias(\"cc_sf\", \"sf\");\n    x86RegisterTable_.AddRegisterAlias(\"cc_of\", \"of\");\n    x86RegisterTable_.AddRegisterAlias(\"cc_so\", \"flags\");\n    x86RegisterTable_.AddRegisterAlias(\"cc_soz\", \"flags\");\n    x86RegisterTable_.AddRegisterAlias(\"cc\", \"flags\");\n\n    x86RegisterTable_.AddRegisterAlias(\"ixmm0\", \"xmm0\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm1\", \"xmm1\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm2\", \"xmm2\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm3\", \"xmm3\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm4\", \"xmm4\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm5\", \"xmm5\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm6\", \"xmm6\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm7\", \"xmm7\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm8\", \"xmm8\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm9\", \"xmm9\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm10\", \"xmm10\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm11\", \"xmm11\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm12\", \"xmm12\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm13\", \"xmm13\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm14\", \"xmm14\");\n    x86RegisterTable_.AddRegisterAlias(\"ixmm15\", \"xmm15\");\n\n    x86RegisterTable_.AddRegisterAlias(\"fxmm0l\", \"xmm0\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm1l\", \"xmm1\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm2l\", \"xmm2\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm3l\", \"xmm3\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm4l\", \"xmm4\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm5l\", \"xmm5\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm6l\", \"xmm6\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm7l\", \"xmm7\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm8l\", \"xmm8\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm9l\", \"xmm9\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm10l\", \"xmm10\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm11l\", \"xmm11\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm12l\", \"xmm12\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm13l\", \"xmm13\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm14l\", \"xmm14\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm15l\", \"xmm15\");\n\n    x86RegisterTable_.AddRegisterAlias(\"fxmm0s\", \"xmm0\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm1s\", \"xmm1\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm2s\", \"xmm2\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm3s\", \"xmm3\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm4s\", \"xmm4\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm5s\", \"xmm5\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm6s\", \"xmm6\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm7s\", \"xmm7\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm8s\", \"xmm8\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm9s\", \"xmm9\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm10s\", \"xmm10\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm11s\", \"xmm11\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm12s\", \"xmm12\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm13s\", \"xmm13\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm14s\", \"xmm14\");\n    x86RegisterTable_.AddRegisterAlias(\"fxmm15s\", \"xmm15\");\n\n    x86RegisterTable_.AddRegisterAlias(\"iymm0\", \"ymm0\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm1\", \"ymm1\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm2\", \"ymm2\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm3\", \"ymm3\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm4\", \"ymm4\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm5\", \"ymm5\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm6\", \"ymm6\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm7\", \"ymm7\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm8\", \"ymm8\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm9\", \"ymm9\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm10\", \"ymm10\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm11\", \"ymm11\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm12\", \"ymm12\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm13\", \"ymm13\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm14\", \"ymm14\");\n    x86RegisterTable_.AddRegisterAlias(\"iymm15\", \"ymm15\");\n  }\n\n  public static RegisterTable SelectRegisterTable(IRMode irMode) {\n    return irMode switch {\n      IRMode.x86_64  => x86RegisterTable_,\n      IRMode.ARM64   => arm64RegisterTable_,\n      IRMode.Default => x86RegisterTable_,\n      _              => throw new ArgumentException(\"invalid valid\", nameof(irMode))\n    };\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/Architecture/X86RegisterTable.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Compilers.Architecture;\n\npublic enum X86Register {\n  RAX,\n  EAX,\n  AX,\n  AL,\n  AH,\n  RBX,\n  EBX,\n  BX,\n  BL,\n  BH,\n  RCX,\n  ECX,\n  CX,\n  CL,\n  CH,\n  RDX,\n  EDX,\n  DX,\n  DL,\n  DH,\n  RSP,\n  ESP,\n  SP,\n  SPL,\n  RBP,\n  EBP,\n  BP,\n  BPL,\n  RSI,\n  ESI,\n  SI,\n  SIL,\n  RDI,\n  EDI,\n  DI,\n  DIL,\n  R8,\n  R8D,\n  R8W,\n  R8B,\n  R9,\n  R9D,\n  R9W,\n  R9B,\n  R10,\n  R10D,\n  R10W,\n  R10B,\n  R11,\n  R11D,\n  R11W,\n  R11B,\n  R12,\n  R12D,\n  R12W,\n  R12B,\n  R13,\n  R13D,\n  R13W,\n  R13B,\n  R14,\n  R14D,\n  R14W,\n  R14B,\n  R15,\n  R15D,\n  R15W,\n  R15B,\n  CS,\n  DS,\n  ES,\n  FS,\n  GS,\n  SS,\n  RIP,\n  EIP,\n  IP,\n  RFLAGS,\n  EFLAGS,\n  FLAGS,\n  CF,\n  PF,\n  AF,\n  ZF,\n  SF,\n  TF,\n  IF,\n  DF,\n  OF,\n  XMM0,\n  XMM1,\n  XMM2,\n  XMM3,\n  XMM4,\n  XMM5,\n  XMM6,\n  XMM7,\n  XMM8,\n  XMM9,\n  XMM10,\n  XMM11,\n  XMM12,\n  XMM13,\n  XMM14,\n  XMM15,\n  YMM0,\n  YMM1,\n  YMM2,\n  YMM3,\n  YMM4,\n  YMM5,\n  YMM6,\n  YMM7,\n  YMM8,\n  YMM9,\n  YMM10,\n  YMM11,\n  YMM12,\n  YMM13,\n  YMM14,\n  YMM15\n}\n\npublic class X86RegisterTable : RegisterTable {\n  private static readonly RegisterIR[] registers_ = {\n    //             Name      Register     Bit offset  Bit length\n    new(\"rax\", X86Register.RAX, 0, 64,\n        new RegisterIR(\"eax\", X86Register.EAX, 0, 32,\n                       new RegisterIR(\"ax\", X86Register.AX, 0, 16,\n                                      new RegisterIR(\"al\", X86Register.AL, 0, 8),\n                                      new RegisterIR(\"ah\", X86Register.AH, 8, 8)\n                       ))),\n    new(\"rbx\", X86Register.RBX, 0, 64,\n        new RegisterIR(\"ebx\", X86Register.EBX, 0, 32,\n                       new RegisterIR(\"bx\", X86Register.BX, 0, 16,\n                                      new RegisterIR(\"bl\", X86Register.BL, 0, 8),\n                                      new RegisterIR(\"bh\", X86Register.BH, 8, 8)\n                       ))),\n    new(\"rcx\", X86Register.RCX, 0, 64,\n        new RegisterIR(\"ecx\", X86Register.ECX, 0, 32,\n                       new RegisterIR(\"cx\", X86Register.CX, 0, 16,\n                                      new RegisterIR(\"cl\", X86Register.CL, 0, 8),\n                                      new RegisterIR(\"ch\", X86Register.CH, 8, 8)\n                       ))),\n    new(\"rdx\", X86Register.RDX, 0, 64,\n        new RegisterIR(\"edx\", X86Register.EDX, 0, 32,\n                       new RegisterIR(\"dx\", X86Register.DX, 0, 16,\n                                      new RegisterIR(\"dl\", X86Register.DL, 0, 8),\n                                      new RegisterIR(\"dh\", X86Register.DH, 8, 8)\n                       ))),\n    new(\"rsp\", X86Register.RSP, 0, 64,\n        new RegisterIR(\"esp\", X86Register.ESP, 0, 32,\n                       new RegisterIR(\"sp\", X86Register.SP, 0, 16,\n                                      new RegisterIR(\"spl\", X86Register.SPL, 0, 8)\n                       ))),\n    new(\"rbp\", X86Register.RBP, 0, 64,\n        new RegisterIR(\"ebp\", X86Register.EBP, 0, 32,\n                       new RegisterIR(\"bp\", X86Register.BP, 0, 16,\n                                      new RegisterIR(\"bpl\", X86Register.BPL, 0, 8)\n                       ))),\n    new(\"rsi\", X86Register.RSI, 0, 64,\n        new RegisterIR(\"esi\", X86Register.ESI, 0, 32,\n                       new RegisterIR(\"si\", X86Register.SI, 0, 16,\n                                      new RegisterIR(\"sil\", X86Register.SIL, 0, 8)\n                       ))),\n    new(\"rdi\", X86Register.RDI, 0, 64,\n        new RegisterIR(\"edi\", X86Register.EDI, 0, 32,\n                       new RegisterIR(\"di\", X86Register.DI, 0, 16,\n                                      new RegisterIR(\"dil\", X86Register.DIL, 0, 8))\n        )),\n    new(\"r8\", X86Register.R8, 0, 64,\n        new RegisterIR(\"r8d\", X86Register.R8D, 0, 32,\n                       new RegisterIR(\"r8w\", X86Register.R8W, 0, 16,\n                                      new RegisterIR(\"r8b\", X86Register.R8B, 0, 8)\n                       ))),\n    new(\"r9\", X86Register.R9, 0, 64,\n        new RegisterIR(\"r9d\", X86Register.R9D, 0, 32,\n                       new RegisterIR(\"r9w\", X86Register.R9W, 0, 16,\n                                      new RegisterIR(\"r9b\", X86Register.R9B, 0, 8)\n                       ))),\n    new(\"r10\", X86Register.R10, 0, 64,\n        new RegisterIR(\"r10d\", X86Register.R10D, 0, 32,\n                       new RegisterIR(\"r10w\", X86Register.R10W, 0, 16,\n                                      new RegisterIR(\"r10b\", X86Register.R10B, 0, 8)\n                       ))),\n    new(\"r11\", X86Register.R11, 0, 64,\n        new RegisterIR(\"r11d\", X86Register.R11D, 0, 32,\n                       new RegisterIR(\"r11w\", X86Register.R11W, 0, 16,\n                                      new RegisterIR(\"r11b\", X86Register.R11B, 0, 8)\n                       ))),\n    new(\"r12\", X86Register.R12, 0, 64,\n        new RegisterIR(\"r12d\", X86Register.R12D, 0, 32,\n                       new RegisterIR(\"r12w\", X86Register.R12W, 0, 16,\n                                      new RegisterIR(\"r12b\", X86Register.R12B, 0, 8)\n                       ))),\n    new(\"r13\", X86Register.R13, 0, 64,\n        new RegisterIR(\"r13d\", X86Register.R13D, 0, 32,\n                       new RegisterIR(\"r13w\", X86Register.R13W, 0, 16,\n                                      new RegisterIR(\"r13b\", X86Register.R13B, 0, 8)\n                       ))),\n    new(\"r14\", X86Register.R14, 0, 64,\n        new RegisterIR(\"r14d\", X86Register.R14D, 0, 32,\n                       new RegisterIR(\"r14w\", X86Register.R14W, 0, 16,\n                                      new RegisterIR(\"r14b\", X86Register.R14B, 0, 8)\n                       ))),\n    new(\"r15\", X86Register.R15, 0, 64,\n        new RegisterIR(\"r15d\", X86Register.R15D, 0, 32,\n                       new RegisterIR(\"r15w\", X86Register.R15W, 0, 16,\n                                      new RegisterIR(\"r15b\", X86Register.R15B, 0, 8)\n                       ))),\n    new(\"cs\", X86Register.CS, 0, 16),\n    new(\"ds\", X86Register.DS, 0, 16),\n    new(\"es\", X86Register.ES, 0, 16),\n    new(\"fs\", X86Register.FS, 0, 16),\n    new(\"gs\", X86Register.GS, 0, 16),\n    new(\"ss\", X86Register.SS, 0, 16),\n    new(\"rip\", X86Register.RIP, 0, 64,\n        new RegisterIR(\"eip\", X86Register.EIP, 0, 32,\n                       new RegisterIR(\"ip\", X86Register.IP, 0, 16)\n        )),\n    new(\"rflags\", X86Register.RFLAGS, 0, 64,\n        new RegisterIR(\"eflags\", X86Register.EFLAGS, 0, 32,\n                       new RegisterIR(\"flags\", X86Register.FLAGS, 0, 16,\n                                      new RegisterIR(\"cf\", X86Register.CF, 0, 1),\n                                      new RegisterIR(\"pf\", X86Register.PF, 2, 1),\n                                      new RegisterIR(\"af\", X86Register.AF, 4, 1),\n                                      new RegisterIR(\"zf\", X86Register.ZF, 6, 1),\n                                      new RegisterIR(\"sf\", X86Register.SF, 7, 1),\n                                      new RegisterIR(\"tf\", X86Register.TF, 8, 1),\n                                      new RegisterIR(\"if\", X86Register.IF, 9, 1),\n                                      new RegisterIR(\"df\", X86Register.DF, 10, 1),\n                                      new RegisterIR(\"of\", X86Register.OF, 11, 1)\n                       ))),\n    new(\"ymm0\", X86Register.YMM0, 0, 256,\n        new RegisterIR(\"xmm0\", X86Register.XMM0, 0, 128)),\n    new(\"ymm1\", X86Register.YMM1, 0, 256,\n        new RegisterIR(\"xmm1\", X86Register.XMM1, 0, 128)),\n    new(\"ymm2\", X86Register.YMM2, 0, 256,\n        new RegisterIR(\"xmm2\", X86Register.XMM2, 0, 128)),\n    new(\"ymm3\", X86Register.YMM3, 0, 256,\n        new RegisterIR(\"xmm3\", X86Register.XMM3, 0, 128)),\n    new(\"ymm4\", X86Register.YMM4, 0, 256,\n        new RegisterIR(\"xmm4\", X86Register.XMM4, 0, 128)),\n    new(\"ymm5\", X86Register.YMM5, 0, 256,\n        new RegisterIR(\"xmm5\", X86Register.XMM5, 0, 128)),\n    new(\"ymm6\", X86Register.YMM6, 0, 256,\n        new RegisterIR(\"xmm6\", X86Register.XMM6, 0, 128)),\n    new(\"ymm7\", X86Register.YMM7, 0, 256,\n        new RegisterIR(\"xmm7\", X86Register.XMM7, 0, 128)),\n    new(\"ymm8\", X86Register.YMM8, 0, 256,\n        new RegisterIR(\"xmm8\", X86Register.XMM8, 0, 128)),\n    new(\"ymm9\", X86Register.YMM9, 0, 256,\n        new RegisterIR(\"xmm9\", X86Register.XMM9, 0, 128)),\n    new(\"ymm10\", X86Register.YMM10, 0, 256,\n        new RegisterIR(\"xmm10\", X86Register.XMM10, 0, 128)),\n    new(\"ymm11\", X86Register.YMM11, 0, 256,\n        new RegisterIR(\"xmm11\", X86Register.XMM11, 0, 128)),\n    new(\"ymm12\", X86Register.YMM12, 0, 256,\n        new RegisterIR(\"xmm12\", X86Register.XMM12, 0, 128)),\n    new(\"ymm13\", X86Register.YMM13, 0, 256,\n        new RegisterIR(\"xmm13\", X86Register.XMM13, 0, 128)),\n    new(\"ymm14\", X86Register.YMM14, 0, 256,\n        new RegisterIR(\"xmm14\", X86Register.XMM14, 0, 128)),\n    new(\"ymm15\", X86Register.YMM15, 0, 256,\n        new RegisterIR(\"xmm15\", X86Register.XMM15, 0, 128))\n  };\n\n  public X86RegisterTable() {\n    PopulateRegisterTable(registers_);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/Defaults/DefaultDiffOutputFilter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing DiffPlex.DiffBuilder.Model;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Document.Renderers.Highlighters;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.Core.Compilers.Default;\n\npublic sealed class DefaultDiffOutputFilter : IDiffOutputFilter {\n  private DiffSettings settings_;\n  private ICompilerIRInfo compilerInfo_;\n  private char[] ExpansionStopLetters => new[] {\n    '(', ')', '<', '>', ',', '.', ';', ':', '|', '[', ']', '{', '}', '!', ' ', '\\t'\n  };\n  public char[] IgnoredDiffLetters => new[] {\n    '(', ')', ',', '.', ';', ':', '|', '{', '}', '!', ' ', '\\t'\n  };\n\n  public void Initialize(DiffSettings settings, ICompilerIRInfo compilerInfo) {\n    settings_ = settings;\n    compilerInfo_ = compilerInfo;\n  }\n\n  public DiffKind EstimateModificationType(DiffPiece before, DiffPiece after, int beforeOffset, int afterOffset,\n                                           string beforeLineText, string afterLineText) {\n    string beforeText = ExpandDiff(before.Text, beforeOffset, beforeLineText,\n                                   out int beforeLeftStopIndex, out int beforeRightStopIndex);\n    string afterText = ExpandDiff(after.Text, afterOffset, afterLineText,\n                                  out int afterLeftStopIndex, out int afterRightStopIndex);\n\n    if (IsTemporaryVariable(beforeText, out int beforeNumber) &&\n        IsTemporaryVariable(afterText, out int afterNumber)) {\n      if (beforeNumber == afterNumber) {\n        return DiffKind.MinorModification;\n      }\n\n      if (settings_.FilterTempVariableNames) {\n        return DiffKind.MinorModification;\n      }\n    }\n    else if (IsSSANumber(beforeText, beforeLeftStopIndex, beforeRightStopIndex, beforeLineText) &&\n             IsSSANumber(afterText, afterLeftStopIndex, afterRightStopIndex, afterLineText)) {\n      if (settings_.FilterSSADefNumbers) {\n        return DiffKind.MinorModification;\n      }\n    }\n    else if (IsCommentText(beforeText, beforeLeftStopIndex, beforeRightStopIndex, beforeLineText) ||\n             IsCommentText(afterText, afterLeftStopIndex, afterRightStopIndex, afterLineText)) {\n      return DiffKind.MinorModification;\n    }\n\n    return DiffKind.Modification;\n  }\n\n  public AdjustedDiffPiece AdjustChange(DiffPiece change, int documentOffset,\n                                        int lineOffset, string lineText) {\n    string text = ExpandDiff(change.Text, lineOffset, lineText,\n                             out int leftStopIndex, out int rightStopIndex);\n\n    if (IsTemporaryVariable(text, out int _)) {\n      // Enlarge diff marking to cover entire variable/opcode.\n      int lineStartOffset = documentOffset - lineOffset;\n      return new AdjustedDiffPiece(lineStartOffset + leftStopIndex, text.Length);\n    }\n\n    if (IsSSANumber(text, leftStopIndex, rightStopIndex, lineText)) {\n      // Enlarge diff to include entire SSA number <*123> instead of just some digits.\n      if (lineText[leftStopIndex] != '<' && leftStopIndex > 0) {\n        leftStopIndex--;\n      }\n\n      if (lineText[rightStopIndex] != '>' && rightStopIndex < lineText.Length - 1) {\n        rightStopIndex++;\n      }\n\n      int lineStartOffset = documentOffset - lineOffset;\n      return new AdjustedDiffPiece(lineStartOffset + leftStopIndex, rightStopIndex - leftStopIndex + 1);\n    }\n\n    return new AdjustedDiffPiece(documentOffset, change.Text.Length);\n  }\n\n  private static bool IsSSANumberEnd(int rightStopIndex, string lineText) {\n    return lineText[rightStopIndex] == '>' ||\n           lineText[rightStopIndex] == 'l' ||\n           lineText[rightStopIndex] == 'r';\n  }\n\n  private static bool IsSSANumberStart(int leftStopIndex, string lineText) {\n    return lineText[leftStopIndex] == '<' ||\n           lineText[leftStopIndex] == '*' ||\n           char.IsDigit(lineText[leftStopIndex]);\n  }\n\n  private bool IsTemporaryVariable(string text, out int tempNumber) {\n    tempNumber = 0;\n    var name = text.AsSpan();\n    int prefixLength = 0;\n\n    //? TODO: Should query ICompilerInfo instead of hardcoding this.\n    if (name.StartsWith(\"t\".AsSpan())) {\n      prefixLength = 1;\n    }\n    else {\n      return false;\n    }\n\n    var remainingName = name.Slice(prefixLength);\n    int index = 0;\n\n    while (index < remainingName.Length &&\n           char.IsDigit(remainingName[index])) {\n      index++;\n    }\n\n    if (index < remainingName.Length) {\n      if (Array.IndexOf(ExpansionStopLetters, remainingName[index]) != -1) {\n        remainingName = remainingName.Slice(0, index);\n      }\n      else {\n        return false;\n      }\n    }\n\n    return int.TryParse(remainingName, out tempNumber);\n  }\n\n  private bool IsSSANumber(string text, int leftStopIndex, int rightStopIndex, string lineText) {\n    bool hasSSANumberStart = IsSSANumberStart(leftStopIndex, lineText);\n    bool hasSSANumberEnd = IsSSANumberEnd(rightStopIndex, lineText);\n    bool isCandidate = hasSSANumberStart && hasSSANumberEnd;\n\n    if (!isCandidate) {\n      // Sometimes the < > letters are not part of the diff, check the\n      // previous/next letters too.\n      if (!hasSSANumberStart && leftStopIndex > 0 &&\n          IsSSANumberStart(leftStopIndex - 1, lineText)) {\n        leftStopIndex--;\n        hasSSANumberStart = true;\n      }\n\n      if (!hasSSANumberEnd && rightStopIndex < lineText.Length - 1 &&\n          IsSSANumberEnd(rightStopIndex + 1, lineText)) {\n        rightStopIndex++;\n        hasSSANumberEnd = true;\n      }\n\n      isCandidate = hasSSANumberStart && hasSSANumberEnd;\n    }\n\n    if (isCandidate) {\n      leftStopIndex += !char.IsDigit(lineText[leftStopIndex]) ? 1 : 0;\n      rightStopIndex -= !char.IsDigit(lineText[rightStopIndex]) ? 1 : 0;\n      string defNumber = lineText.Substring(leftStopIndex, rightStopIndex - leftStopIndex + 1);\n      return int.TryParse(defNumber, out int _);\n    }\n\n    return false;\n  }\n\n  private bool IsCommentText(string text, int leftStopIndex, int rightStopIndex, string lineText) {\n    // Everything following # is debug info and line numbers.\n    return lineText.LastIndexOf('#', leftStopIndex) != -1;\n  }\n\n  private string ExpandDiff(string diffText, int lineOffset, string lineText,\n                            out int leftStopIndex, out int rightStopIndex) {\n    if (diffText.Length == 0 || lineOffset >= lineText.Length) {\n      leftStopIndex = rightStopIndex = 0;\n      return diffText;\n    }\n\n    // Sometimes the diff starts with one of the stop letters, which should not\n    // be included in the diff, just skip over it.\n    while (lineOffset < lineText.Length - 1 &&\n           Array.IndexOf(ExpansionStopLetters, lineText[lineOffset]) != -1) {\n      lineOffset++;\n    }\n\n    // Expand left/right as long no end marker letters are found.\n    int left = lineOffset;\n    int right = lineOffset;\n\n    while (left > 0) {\n      if (Array.IndexOf(ExpansionStopLetters, lineText[left - 1]) != -1) {\n        break;\n      }\n\n      left--;\n    }\n\n    while (right < lineText.Length - 1) {\n      if (Array.IndexOf(ExpansionStopLetters, lineText[right + 1]) != -1) {\n        break;\n      }\n\n      right++;\n    }\n\n    leftStopIndex = left;\n    rightStopIndex = right;\n    return lineText.Substring(left, right - left + 1);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/Defaults/DefaultNameProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.Default;\n\npublic enum FilteredSectionNameKind {\n  TrimPrefix,\n  TrimSuffix,\n  TrimWhitespace,\n  RemoveSubstring,\n  ReplaceSubstring\n}\n\npublic class FilteredSectionName {\n  public FilteredSectionName(string text, FilteredSectionNameKind filterKind) {\n    Text = text;\n    FilterKind = filterKind;\n  }\n\n  public string Text { get; set; }\n  public string ReplacementText { get; set; }\n  public FilteredSectionNameKind FilterKind { get; set; }\n}\n\npublic sealed class DefaultNameProvider : INameProvider {\n  private static List<FilteredSectionName> sectionNameFilters_;\n  private static ConcurrentDictionary<string, string> demangledNameMap_;\n  private static ConcurrentDictionary<string, string> functionNameMap_;\n\n  static DefaultNameProvider() {\n    demangledNameMap_ = new ConcurrentDictionary<string, string>();\n    functionNameMap_ = new ConcurrentDictionary<string, string>();\n    sectionNameFilters_ = new List<FilteredSectionName>();\n    sectionNameFilters_.Add(new FilteredSectionName(\"* \", FilteredSectionNameKind.TrimPrefix));\n    sectionNameFilters_.Add(new FilteredSectionName(\" *\", FilteredSectionNameKind.TrimSuffix));\n    sectionNameFilters_.Add(new FilteredSectionName(\"\", FilteredSectionNameKind.TrimWhitespace));\n\n    sectionNameFilters_.Add(\n      new FilteredSectionName(\"pass\", FilteredSectionNameKind.RemoveSubstring));\n  }\n\n  public bool IsDemanglingSupported => true;\n  public bool IsDemanglingEnabled => IsDemanglingSupported && CoreSettingsProvider.SectionSettings.ShowDemangledNames;\n  public FunctionNameDemanglingOptions GlobalDemanglingOptions => CoreSettingsProvider.SectionSettings.DemanglingOptions;\n\n  public string GetSectionName(IRTextSection section, bool includeNumber) {\n    string sectionName = section.Name;\n\n    if (string.IsNullOrEmpty(sectionName)) {\n      string funcName = section.ParentFunction.Name;\n\n      if (!string.IsNullOrEmpty(funcName)) {\n        return funcName.Length <= 24 ? funcName : $\"{funcName.Substring(0, 24)}...\";\n      }\n\n      return \"<UNTITLED>\";\n    }\n\n    foreach (var nameFilter in sectionNameFilters_) {\n      if (string.IsNullOrEmpty(nameFilter.Text) &&\n          nameFilter.FilterKind != FilteredSectionNameKind.TrimWhitespace) {\n        continue;\n      }\n\n      switch (nameFilter.FilterKind) {\n        case FilteredSectionNameKind.TrimPrefix: {\n          if (sectionName.StartsWith(nameFilter.Text, StringComparison.Ordinal)) {\n            sectionName = sectionName.Substring(nameFilter.Text.Length);\n          }\n\n          break;\n        }\n        case FilteredSectionNameKind.TrimSuffix: {\n          if (sectionName.EndsWith(nameFilter.Text, StringComparison.Ordinal)) {\n            sectionName = sectionName.Substring(0, sectionName.Length - nameFilter.Text.Length - 1);\n          }\n\n          break;\n        }\n        case FilteredSectionNameKind.TrimWhitespace: {\n          sectionName = sectionName.Trim();\n          break;\n        }\n        case FilteredSectionNameKind.RemoveSubstring: {\n          if (sectionName.Contains(nameFilter.Text, StringComparison.Ordinal)) {\n            sectionName = sectionName.Replace(nameFilter.Text, \"\", StringComparison.Ordinal);\n          }\n\n          break;\n        }\n        case FilteredSectionNameKind.ReplaceSubstring: {\n          if (sectionName.Contains(nameFilter.Text, StringComparison.Ordinal)) {\n            sectionName = sectionName.Replace(nameFilter.Text, nameFilter.ReplacementText,\n                                              StringComparison.Ordinal);\n          }\n\n          break;\n        }\n        default:\n          throw new ArgumentOutOfRangeException();\n      }\n    }\n\n    if (includeNumber) {\n      return $\"({section.Number}) {sectionName}\";\n    }\n\n    return sectionName;\n  }\n\n  public string GetFunctionName(IRTextFunction function) {\n    return function.Name;\n  }\n\n  public string DemangleFunctionName(string name, FunctionNameDemanglingOptions options) {\n    if (!demangledNameMap_.TryGetValue(name, out string demangledName)) {\n      demangledName = PDBDebugInfoProvider.DemangleFunctionName(name, options);\n      demangledNameMap_.TryAdd(name, demangledName);\n    }\n\n    return demangledName;\n  }\n\n  public string DemangleFunctionName(IRTextFunction function, FunctionNameDemanglingOptions options) {\n    return DemangleFunctionName(function.Name, options);\n  }\n\n  public string FormatFunctionName(string name) {\n    if (!IsDemanglingEnabled) {\n      return name;\n    }\n\n    if (!functionNameMap_.TryGetValue(name, out string demangledName)) {\n      demangledName = PDBDebugInfoProvider.DemangleFunctionName(name, FunctionNameDemanglingOptions.OnlyName);\n      functionNameMap_.TryAdd(name, demangledName);\n    }\n\n    return demangledName;\n  }\n\n  public string FormatFunctionName(IRTextFunction function) {\n    return FormatFunctionName(function.Name);\n  }\n\n  public void SettingsChanged() {\n    demangledNameMap_.Clear();\n    functionNameMap_.Clear();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/LLVM/LLVMBinaryFileFinder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.Core.Compilers.LLVM;\n\npublic class LLVMBinaryFileFinder : IBinaryFileFinder {\n  public async Task<BinaryFileSearchResult> FindBinaryFileAsync(BinaryFileDescriptor binaryFile, SymbolFileSourceSettings settings = null) {\n    // LLVM implementation doesn't support binary file searching yet\n    return BinaryFileSearchResult.None;\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/LLVM/LLVMCompilerIRInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Parser;\n\nnamespace ProfileExplorer.Core.Compilers.LLVM;\n\npublic class LLVMCompilerIRInfo : ICompilerIRInfo {\n  public IRMode Mode { get; set; }\n  public InstructionOffsetData InstructionOffsetData => InstructionOffsetData.VariableSize(1, 16);\n\n  public IRSectionReader CreateSectionReader(string filePath, bool expectSectionHeaders) {\n    return new LLVMSectionReader(filePath, expectSectionHeaders);\n  }\n\n  public IRSectionReader CreateSectionReader(byte[] textData, bool expectSectionHeaders) {\n    return new LLVMSectionReader(textData, expectSectionHeaders);\n  }\n\n  public IRSectionParser CreateSectionParser(IRParsingErrorHandler errorHandler, long functionSize) {\n    return null;\n  }\n\n  public IRParsingErrorHandler CreateParsingErrorHandler() {\n    return new ParsingErrorHandler();\n  }\n\n  public IReachableReferenceFilter CreateReferenceFilter(FunctionIR function) {\n    return null;\n  }\n\n  public bool IsCopyInstruction(InstructionIR instr) {\n    return SkipCopyInstruction(instr) != null;\n  }\n\n  public bool IsLoadInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public bool IsStoreInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public bool IsCallInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public OperandIR GetCallTarget(InstructionIR instr) {\n    return null;\n  }\n\n  public OperandIR GetBranchTarget(InstructionIR instr) {\n    return null;\n  }\n\n  public bool IsIntrinsicCallInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public bool IsPhiInstruction(InstructionIR instr) {\n    return false;\n  }\n\n  public bool IsNOP(InstructionIR instr) {\n    throw new NotImplementedException();\n  }\n\n  public BlockIR GetIncomingPhiOperandBlock(InstructionIR phiInstr, int opIndex) {\n    return null;\n  }\n\n  public IRElement SkipCopyInstruction(InstructionIR instr) {\n    return null;\n  }\n\n  public bool OperandsReferenceSameSymbol(OperandIR opA, OperandIR opB, bool exactCheck) {\n    return false;\n  }\n\n  public InstructionIR GetTransferInstruction(BlockIR block) {\n    return null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/LLVM/LLVMCompilerInfoProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Compilers.LLVM;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Compilers.Default;\n\nnamespace ProfileExplorer.Core.Compilers.LLVM;\n\npublic class LLVMCompilerInfoProvider : ICompilerInfoProvider {\n  private LLVMCompilerIRInfo ir_;\n  private DefaultNameProvider names_;\n  private readonly IBinaryFileFinder binaryFileFinder_;\n  private readonly IDebugFileFinder debugFileFinder_;\n  private readonly IDebugInfoProviderFactory debugInfoProviderFactory_;\n  private readonly IDiffFilterProvider diffFilterProvider_;\n\n  public LLVMCompilerInfoProvider() {\n    ir_ = new LLVMCompilerIRInfo();\n    names_ = new DefaultNameProvider();\n    binaryFileFinder_ = new LLVMBinaryFileFinder();\n    debugFileFinder_ = new LLVMDebugFileFinder();\n    debugInfoProviderFactory_ = new LLVMDebugInfoProviderFactory();\n    diffFilterProvider_ = new LLVMDiffFilterProvider();\n  }\n\n  public string CompilerIRName => \"LLVM\";\n  public CompilerIRKind CompilerIRKind => CompilerIRKind.LLVM;\n  public string CompilerDisplayName => \"LLVM\";\n  public string DefaultSyntaxHighlightingFile => \"LLVM\";\n  public string OpenFileFilter =>\n    \"IR Files|*.txt;*.log;*.ir;*.tup;*.out;*.pex|Profile Explorer Session Files|*.pex|All Files|*.*\";\n  public string OpenDebugFileFilter => \"Debug Files|*.pdb|All Files|*.*\";\n  public ICompilerIRInfo IR => ir_;\n  public INameProvider NameProvider => names_;\n  public IBinaryFileFinder BinaryFileFinder => binaryFileFinder_;\n  public IDebugFileFinder DebugFileFinder => debugFileFinder_;\n  public IDebugInfoProviderFactory DebugInfoProviderFactory => debugInfoProviderFactory_;\n  public IDiffFilterProvider DiffFilterProvider => diffFilterProvider_;\n\n  public async Task<bool> AnalyzeLoadedFunction(FunctionIR function, IRTextSection section,\n                                                ILoadedDocument loadedDoc, FunctionDebugInfo funcDebugInfo) {\n    //? TODO: var loopGraph = new LoopGraph(function);\n    //loopGraph.FindLoops();\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/LLVM/LLVMDebugFileFinder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.LLVM;\n\npublic class LLVMDebugFileFinder : IDebugFileFinder {\n  public async Task<DebugFileSearchResult> FindDebugInfoFileAsync(string imagePath, SymbolFileSourceSettings settings = null) {\n    // LLVM implementation uses a simple file location approach\n    return Utils.LocateDebugInfoFile(imagePath, \".pdb\");\n  }\n\n  public async Task<DebugFileSearchResult> FindDebugInfoFileAsync(SymbolFileDescriptor symbolFile, SymbolFileSourceSettings settings = null) {\n    // LLVM implementation doesn't support symbol file descriptor searches yet\n    return DebugFileSearchResult.None;\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/LLVM/LLVMDebugInfoProviderFactory.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.Core.Compilers.LLVM;\n\npublic class LLVMDebugInfoProviderFactory : IDebugInfoProviderFactory {\n  public IDebugInfoProvider CreateDebugInfoProvider(DebugFileSearchResult debugFile) {\n    // LLVM implementation doesn't support debug info providers yet\n    return null;\n  }\n\n  public IDebugInfoProvider GetOrCreateDebugInfoProvider(IRTextFunction function, ILoadedDocument loadedDoc) {\n    return null;\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/LLVM/LLVMDiffFilterProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Compilers.Default;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Compilers.LLVM;\n\npublic class LLVMDiffFilterProvider : IDiffFilterProvider {\n  public IDiffInputFilter CreateDiffInputFilter() => null;\n  public IDiffOutputFilter CreateDiffOutputFilter() => new DefaultDiffOutputFilter();\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Compilers/LLVM/LLVMSectionReader.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.Core.Compilers.LLVM;\n\npublic sealed class LLVMSectionReader : SectionReaderBase, IDisposable {\n  private const string SectionStartLine = \"*** IR Dump \";\n  private const string SectionEndLine = \"***\";\n  private static readonly char[] WhitespaceChars = {' ', '\\t'};\n\n  public LLVMSectionReader(string filePath, bool expectSectionHeaders = true) :\n    base(filePath, expectSectionHeaders) {\n  }\n\n  public LLVMSectionReader(byte[] textData, bool expectSectionHeaders = true) :\n    base(textData, expectSectionHeaders) {\n  }\n\n  protected override bool IsSectionStart(string line) {\n    return line.StartsWith(SectionStartLine, StringComparison.Ordinal);\n  }\n\n  protected override bool IsFunctionStart(string line) {\n    return line.StartsWith(\"define\", StringComparison.Ordinal) &&\n           line.EndsWith(\"{\", StringComparison.Ordinal);\n  }\n\n  protected override bool IsBlockStart(string line) {\n    return false;\n  }\n\n  protected override bool IsFunctionEnd(string line) {\n    return line.StartsWith(\"}\", StringComparison.Ordinal);\n  }\n\n  protected override string ExtractSectionName(string line) {\n    int start = line.IndexOf(SectionStartLine);\n\n    if (start == -1) {\n      return \"\";\n    }\n\n    int end = line.LastIndexOf(SectionEndLine);\n    int length = end - start - SectionStartLine.Length;\n\n    if (length > 0) {\n      return line.Substring(start + SectionStartLine.Length, length).Trim();\n    }\n\n    return \"\";\n  }\n\n  protected override string ExtractFunctionName(string line) {\n    // Function names start with @ and end before the ( starting the parameter list.\n    int start = line.IndexOf('@');\n\n    if (start == -1) {\n      return \"\";\n    }\n\n    int end = line.IndexOf('(', start + 1);\n    int length = end - start - 1;\n\n    if (length > 0) {\n      return line.Substring(start + 1, length);\n    }\n\n    return \"\";\n  }\n\n  protected override string PreprocessLine(string line) {\n    return line;\n  }\n\n  protected override bool ShouldSkipOutputLine(string line) {\n    return string.IsNullOrWhiteSpace(line);\n  }\n\n  protected override bool IsMetadataLine(string line) {\n    return false;\n  }\n\n  protected override bool FunctionEndIsFunctionStart(string line) {\n    return false;\n  }\n\n  protected override bool SectionStartIsFunctionStart(string line) {\n    return false;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Controls/IRElementReference.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.IR;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Controls;\n\n[ProtoContract(SkipConstructor = true)]\npublic class IRElementReference {\n  [ProtoMember(1)]\n  public ulong Id;\n  public IRElement Value;\n\n  public IRElementReference() {\n    Id = 0;\n  }\n\n  public IRElementReference(IRElement element) {\n    Id = element.Id;\n    Value = element;\n  }\n\n  public IRElementReference(ulong id, IRElement element = null) {\n    Id = id;\n    Value = element;\n  }\n\n  public IRElementReference(IRElementId id, IRElement element = null) {\n    Id = id.ToLong();\n    Value = element;\n  }\n\n  public static implicit operator IRElementReference(IRElement element) {\n    return new IRElementReference(element.Id, element);\n  }\n\n  public static implicit operator IRElement(IRElementReference elementRef) {\n    return elementRef.Value;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Core.vsdoc",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <!--   VSdocman config file for current project/solution.-->\n  <activeProfile>default</activeProfile>\n  <appSettings>\n    <add key=\"VBdocman_comNonCommented\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_regexFilters\"><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<filters />]]></add>\n    <add key=\"VBdocman_customVar1\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comInterface\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_outputPath\"><![CDATA[$(ProjectDir)VSdoc]]></add>\n    <add key=\"VBdocman_useConditionalCompilation\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_customVar2\"><![CDATA[]]></add>\n    <add key=\"VBdocman_SupportedXamarinIos\"><![CDATA[]]></add>\n    <add key=\"VBdocman_enumSorting\"><![CDATA[1]]></add>\n    <add key=\"VBdocman_comVariable\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comStdModule\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_ListNamespacesWithShortNames\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comPublic\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedPlatforms\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comProtected\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedNetFrameworkClientProfile\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comPrivate\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comWriteDescription\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comProtectedFriend\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comObject\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comDelegate\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedXnaFramework\"><![CDATA[]]></add>\n    <add key=\"VBdocman_emptyOutputFolder\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_rootNamespaceCommentStyle\"><![CDATA[2]]></add>\n    <add key=\"VBdocman_comEnumeration\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comMethod\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comProperty\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedNetCompactFramework\"><![CDATA[]]></add>\n    <add key=\"VBdocman_removeAttributes\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_externalFilesFolder\"><![CDATA[]]></add>\n    <add key=\"VBdocman_showFormsSeparate\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_generateJscriptSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_generateCsharpSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_allowMacrosInComments\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_linkForExternalNotInFramework\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_showInherited\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_templateLocale\"><![CDATA[en-US]]></add>\n    <add key=\"VBdocman_SupportedNetCore\"><![CDATA[]]></add>\n    <add key=\"VBdocman_customVar3\"><![CDATA[]]></add>\n    <add key=\"VBdocman_unbreakSourceLines\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_supportedNetFramework\"><![CDATA[4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1]]></add>\n    <add key=\"VBdocman_pageFooterText\"><![CDATA[Generated with <see href=\"http://www.helixoft.com/vsdocman/overview.html\">VSdocman</see>]]></add>\n    <add key=\"VBdocman_comConstant\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedOthers\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comForm\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comStructure\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_dontSortSeeAlsoList\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_templateFolder\"><![CDATA[$(VSdocmanDir)Templates]]></add>\n    <add key=\"VBdocman_ConstantValueDisplay\"><![CDATA[1]]></add>\n    <add key=\"VBdocman_helpTitle\"><![CDATA[Core Reference]]></add>\n    <add key=\"VBdocman_insertSourceGlobal\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_SupportedNetStandard\"><![CDATA[]]></add>\n    <add key=\"VBdocman_SupportedXamarinMac\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comFriend\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_templatePath\"><![CDATA[html_msdn2019.vbdt]]></add>\n    <add key=\"VBdocman_comDeclare\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_conditionalConstants\"><![CDATA[]]></add>\n    <add key=\"VBdocman_SupportedXamarinAndroid\"><![CDATA[]]></add>\n    <add key=\"VBdocman_supportedNetForWindowsStoreApps\"><![CDATA[]]></add>\n    <add key=\"VBdocman_ShowExtensionMethods\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedPortableClassLibrary\"><![CDATA[]]></add>\n    <add key=\"VBdocman_generateCppSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_customTopics\"><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<topics>\n  <topic>\n    <type>normal</type>\n    <is-default>yes</is-default>\n    <name>Core Reference</name>\n    <id>core_reference</id>\n    <comment><![CDATA[<summary></summary>vsdocman_escaped_]_]_></comment>\n    <namespaces />\n    <topics>\n      <topic>\n        <type>placeholder</type>\n        <is-default>no</is-default>\n        <name />\n        <id>342ea4dbb14a405c836ed23f3a7ada12</id>\n        <comment><![CDATA[vsdocman_escaped_]_]_></comment>\n        <namespaces />\n        <topics />\n      </topic>\n    </topics>\n  </topic>\n</topics>]]></add>\n    <add key=\"VBdocman_generateVbSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_generateFsharpSyntax\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comEventDecl\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_GenerateReportFile\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comEvent\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_rootNamespaceText\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comModulesSaveExcluded\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_fileNamingConvention\"><![CDATA[1]]></add>\n  </appSettings>\n</configuration>"
  },
  {
    "path": "src/ProfileExplorerCore/Diff/BeyondCompareDiffBuilder.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Net;\nusing System.Text;\nusing System.Threading.Tasks;\nusing DiffPlex.DiffBuilder.Model;\nusing HtmlAgilityPack;\nusing ProfileExplorer.Core.Utilities;\n\n#pragma warning disable CA1305, CA1307\n\nnamespace ProfileExplorer.Core.Diff;\n\npublic class BeyondCompareDiffBuilder {\n  private const string BeyondCompareDirectory = @\"Beyond Compare 4\";\n  private const string BeyondCompareExecutable = @\"BCompare.exe\";\n\n  public static string FindBeyondCompareExecutable() {\n    // Look for BC in Program Files.\n    string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),\n                               BeyondCompareDirectory, BeyondCompareExecutable);\n\n    if (File.Exists(path)) {\n      return path;\n    }\n\n    // If not found, look on PATH.\n    path = NativeMethods.GetFullPathFromWindows(BeyondCompareExecutable);\n    return path ?? \"\";\n  }\n\n  public static bool HasBeyondCompareExecutable() {\n    return !string.IsNullOrEmpty(FindBeyondCompareExecutable());\n  }\n\n  public static SideBySideDiffModel ComputeDiffs(string leftText, string rightText, string beyondComparePath) {\n    string reportPath = GenerateReport(leftText, rightText, beyondComparePath);\n\n    if (string.IsNullOrEmpty(reportPath)) {\n      return null; // Failed to get Beyond Compare results.\n    }\n\n    var diff = GenerateDiffsFromReport(reportPath);\n\n    try {\n      File.Delete(reportPath);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"BeyondCompareDiffBuilder: Failed to delete report file: {ex.Message}\");\n    }\n\n    return diff;\n  }\n\n  private static string GenerateReport(string leftText, string rightText, string beyondComparePath) {\n    string leftPath;\n    string rightPath;\n    string scriptPath;\n    string reportPath;\n\n    try {\n      leftPath = Path.GetTempFileName();\n      rightPath = Path.GetTempFileName();\n      scriptPath = Path.GetTempFileName();\n      reportPath = Path.GetTempFileName();\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"BeyondCompareDiffBuilder: Failed to get temp file names: {ex.Message}\");\n      return null;\n    }\n\n    // Write the text to compare on multiple threads.\n    var task1 = Task.Run(() => File.WriteAllText(leftPath, leftText));\n    var task2 = Task.Run(() => File.WriteAllText(rightPath, rightText));\n    var task3 = Task.Run(() => {\n      string scriptBody = string.Format(\n        \"file-report layout:side-by-side options:ignore-unimportant output-to:{0} output-options:html-color {1} {2}\",\n        reportPath, leftPath, rightPath);\n      File.WriteAllText(scriptPath, scriptBody);\n    });\n\n    Task.WaitAll(task1, task2, task3);\n\n    // Start Beyond Compare.\n    try {\n      var psi = new ProcessStartInfo(beyondComparePath, string.Format(\"@{0} /silent\", scriptPath));\n      var process = Process.Start(psi);\n      process.WaitForExit();\n    }\n    catch (Exception ex) {\n      Trace.TraceError(\n        $\"BeyondCompareDiffBuilder: Failed to start bcompare.exe: {beyondComparePath}\");\n      return null;\n    }\n\n    // Clean up temporary files.\n    try {\n      File.Delete(leftPath);\n      File.Delete(leftPath);\n      File.Delete(scriptPath);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"BeyondCompareDiffBuilder: Failed to delete temp files: {ex.Message}\");\n    }\n\n    return reportPath;\n  }\n\n  private static Section GetRowSection(HtmlNode row) {\n    string rowClass = row.GetAttributeValue(\"class\", \"\");\n\n    switch (rowClass) {\n      case \"SectionAll\":\n        return Section.All;\n      case \"SectionBegin\":\n        return Section.Begin;\n      case \"SectionMiddle\":\n        return Section.Middle;\n      case \"SectionEnd\":\n        return Section.End;\n      default:\n        throw new ArgumentOutOfRangeException();\n    }\n  }\n\n  private static ChangeType GetDiffChangeType(HtmlNode node) {\n    switch (node.InnerText) {\n      case \"=\":\n        return ChangeType.Unchanged;\n      case \"+-\":\n        return ChangeType.Deleted;\n      case \"-+\":\n        return ChangeType.Inserted;\n      case \"&lt;&gt;\":\n        return ChangeType.Modified;\n      default:\n        throw new ArgumentOutOfRangeException();\n    }\n  }\n\n  private static SideBySideDiffModel GenerateDiffsFromReport(string reportPath) {\n    var diffs = new SideBySideDiffModel();\n    var doc = new HtmlDocument();\n    doc.Load(reportPath);\n\n    var table = GetFirst(doc.DocumentNode.Descendants(\"table\"));\n\n    if (table == null) {\n      return diffs;\n    }\n\n    // Use ChangeType.Imaginary to represent not being in a section.\n    const ChangeType ChangeTypeNoSection = ChangeType.Imaginary;\n    var sectionChangeType = ChangeTypeNoSection;\n    int oldPosition = 0;\n    int newPosition = 0;\n\n    // The html body contains a table with one row per line.\n    foreach (var row in table.Descendants(\"tr\")) {\n      // We expect to see 3 columns. Old, diff type, New.\n      var columns = row.Descendants(\"td\");\n      HtmlNode oldNode;\n      HtmlNode diffNode;\n      HtmlNode newNode;\n\n      if (!GetNodes(columns, out oldNode, out diffNode, out newNode)) {\n        return diffs;\n      }\n\n      // BC breaks down diffs by sections. If a section is a single row, the row's class is\n      // SectionAll, otherwise the class is SectionBegin, SectionMiddle, or SectionEnd.\n      // Only the SectionAll and SectionBegin rows have the section type noted (unchanged,\n      // insert, delete, modify, etc).\n      var rowSection = GetRowSection(row);\n      Debug.Assert(rowSection != Section.Middle || NodeIsEmpty(diffNode));\n\n      if (rowSection == Section.All || rowSection == Section.Begin) {\n        Debug.Assert(sectionChangeType == ChangeTypeNoSection);\n        sectionChangeType = GetDiffChangeType(diffNode);\n      }\n\n      Debug.Assert(sectionChangeType != ChangeTypeNoSection);\n\n      switch (sectionChangeType) {\n        case ChangeType.Unchanged:\n          diffs.OldText.Lines.Add(DiffPieceFromHtmlText(oldNode, ChangeType.Unchanged, ++oldPosition));\n          diffs.NewText.Lines.Add(DiffPieceFromHtmlText(newNode, ChangeType.Unchanged, ++newPosition));\n          break;\n        case ChangeType.Inserted:\n          diffs.OldText.Lines.Add(new DiffPiece());\n          diffs.NewText.Lines.Add(DiffPieceFromHtmlText(newNode, ChangeType.Inserted, ++newPosition));\n          break;\n        case ChangeType.Deleted:\n          diffs.OldText.Lines.Add(DiffPieceFromHtmlText(oldNode, ChangeType.Deleted, ++oldPosition));\n          diffs.NewText.Lines.Add(new DiffPiece());\n          break;\n        case ChangeType.Modified:\n          // Lines added or removed in the middle of a \"modified\" section show up as blank\n          // nodes on one side or the other. At least one side should be non-empty.\n          Debug.Assert(!NodeIsEmpty(oldNode) || !NodeIsEmpty(newNode));\n\n          if (NodeIsEmpty(oldNode)) {\n            diffs.OldText.Lines.Add(new DiffPiece());\n            diffs.NewText.Lines.Add(\n              DiffPieceFromModifiedNode(newNode, ChangeType.Inserted, ChangeType.Inserted, ++newPosition));\n          }\n          else if (NodeIsEmpty(newNode)) {\n            diffs.OldText.Lines.Add(\n              DiffPieceFromModifiedNode(oldNode, ChangeType.Deleted, ChangeType.Deleted, ++oldPosition));\n            diffs.NewText.Lines.Add(new DiffPiece());\n          }\n          else {\n            diffs.OldText.Lines.Add(\n              DiffPieceFromModifiedNode(oldNode, ChangeType.Modified, ChangeType.Deleted, ++oldPosition));\n            diffs.NewText.Lines.Add(\n              DiffPieceFromModifiedNode(newNode, ChangeType.Modified, ChangeType.Inserted, ++newPosition));\n          }\n\n          break;\n        default:\n          Debug.Assert(false);\n          break;\n      }\n\n      if (rowSection == Section.All || rowSection == Section.End) {\n        sectionChangeType = ChangeTypeNoSection;\n      }\n    }\n\n    return diffs;\n  }\n\n  private static bool NodeIsEmpty(HtmlNode node) {\n    return string.IsNullOrEmpty(node.InnerText) || node.InnerText == \"&nbsp;\";\n  }\n\n  private static DiffPiece DiffPieceFromModifiedNode(HtmlNode node, ChangeType type, ChangeType childChangeType,\n                                                     int position) {\n    var diffs = new DiffPiece(\"\", type, position);\n    var builder = new StringBuilder(100);\n\n    int pieceNumber = 0;\n\n    foreach (var child in node.ChildNodes) {\n      Debug.Assert(child.Name == \"#text\" ||\n                   child.Name == \"span\" && child.GetAttributeValue(\"class\", \"\") == \"TextSegSigDiff\");\n\n      var childType = child.Name == \"#text\"\n        ? ChangeType.Unchanged\n        : childChangeType;\n\n      var subPiece = DiffPieceFromHtmlText(child, childType, ++pieceNumber);\n\n      // Sometimes consecutive entries of the same type (deletion for ex)\n      // appear and those can be combined into a single change.\n      //? TODO: Check if this actually interferes with marking of minor diffs\n      //if (diffs.SubPieces.Count > 0) {\n      //    var prevPiece = diffs.SubPieces[^1];\n\n      //    if (prevPiece.Type == subPiece.Type) {\n      //        prevPiece.Text += subPiece.Text;\n      //        builder.Append(subPiece.Text);\n      //        continue;\n      //    }\n      //}\n\n      diffs.SubPieces.Add(subPiece);\n      builder.Append(subPiece.Text);\n    }\n\n    diffs.Text = builder.ToString();\n    return diffs;\n  }\n\n  private static DiffPiece DiffPieceFromHtmlText(HtmlNode node, ChangeType type, int position) {\n    string text = WebUtility.HtmlDecode(node.InnerText);\n    return new DiffPiece(text, type, position);\n  }\n\n  private static T GetFirst<T>(IEnumerable<T> collection) {\n    var collectionEnum = collection.GetEnumerator();\n\n    if (!collectionEnum.MoveNext()) {\n      return default(T);\n    }\n\n    return collectionEnum.Current;\n  }\n\n  private static bool GetNodes<T>(IEnumerable<T> collection, out T node1, out T node2, out T node3) {\n    var collectionEnum = collection.GetEnumerator();\n\n    if (!collectionEnum.MoveNext()) {\n      node1 = node2 = node3 = default(T);\n      return false;\n    }\n\n    node1 = collectionEnum.Current;\n\n    if (!collectionEnum.MoveNext()) {\n      node1 = node2 = node3 = default(T);\n      return false;\n    }\n\n    node2 = collectionEnum.Current;\n\n    if (!collectionEnum.MoveNext()) {\n      node1 = node2 = node3 = default(T);\n      return false;\n    }\n\n    node3 = collectionEnum.Current;\n    return true;\n  }\n\n  private enum Section {\n    All,\n    Begin,\n    Middle,\n    End\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Diff/DocumentDiffBuilder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing DiffPlex;\nusing DiffPlex.DiffBuilder;\nusing DiffPlex.DiffBuilder.Model;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Diff;\n\npublic enum DiffImplementationKind {\n  Internal,\n  External\n}\n\npublic class DocumentDiffResult {\n  public DocumentDiffResult(IRTextSection leftSection, IRTextSection rightSection, SideBySideDiffModel model,\n                            bool hasDiffs) {\n    LeftSection = leftSection;\n    RightSection = rightSection;\n    Model = model;\n    HasDiffs = hasDiffs;\n  }\n\n  public IRTextSection LeftSection { get; set; }\n  public IRTextSection RightSection { get; set; }\n  public SideBySideDiffModel Model { get; set; }\n  public bool HasDiffs { get; set; }\n}\n\npublic class DocumentDiffBuilder {\n  private static readonly char[] IgnoredDiffLetters = {\n    '(', ')', ',', '.', ';', ':', '|', '{', '}', '!', ' ', '\\t', '\\r', '\\n'\n  };\n  private DiffSettings settings_;\n\n  public DocumentDiffBuilder(DiffSettings settings) {\n    settings_ = settings;\n  }\n\n  public SideBySideDiffModel ComputeDiffs(string leftText, string rightText) {\n    if (settings_.DiffImplementation == DiffImplementationKind.External) {\n      if (!string.IsNullOrEmpty(settings_.ExternalDiffAppPath)) {\n        var result = BeyondCompareDiffBuilder.ComputeDiffs(leftText, rightText, settings_.ExternalDiffAppPath);\n\n        if (result != null) {\n          return result;\n        }\n      }\n      throw new NotImplementedException();\n\n      // Fall back to the internal diff engine if the external one failed.\n    }\n\n    return ComputeInternalDiffs(leftText, rightText);\n  }\n\n  public SideBySideDiffModel ComputeInternalDiffs(string leftText, string rightText) {\n    var diffBuilder = new SideBySideDiffBuilder(new Differ(), IgnoredDiffLetters);\n\n    if (leftText.Equals(rightText, StringComparison.Ordinal)) {\n      diffBuilder.BuildDiffModel(\"\", \"\");\n    }\n\n    return diffBuilder.BuildDiffModel(leftText, rightText);\n  }\n\n  public bool HasDiffs(SideBySideDiffModel diffModel) {\n    foreach (var line in diffModel.OldText.Lines) {\n      if (line.Type != ChangeType.Unchanged && line.Type != ChangeType.Imaginary) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  public async Task<List<DocumentDiffResult>> AreSectionsDifferent(\n    List<(IRTextSection, IRTextSection)> comparedSections, IRTextSectionLoader leftDocLoader,\n    IRTextSectionLoader rightDocLoader, ICompilerInfoProvider irInfo, bool quickMode, CancelableTask cancelableTask) {\n    int maxConcurrency = CoreSettingsProvider.GeneralSettings.CurrentCpuCoreLimit;\n    var tasks = new Task<DocumentDiffResult>[comparedSections.Count];\n\n    await Task.Run(() => AreSectionsDifferentImpl(comparedSections, leftDocLoader, rightDocLoader,\n                                                  tasks, irInfo, quickMode, cancelableTask, maxConcurrency));\n    var results = new List<DocumentDiffResult>(tasks.Length);\n\n    foreach (var task in tasks) {\n      results.Add(await task);\n    }\n\n    return results;\n  }\n\n  private async Task AreSectionsDifferentImpl(\n    List<(IRTextSection, IRTextSection)> comparedSections,\n    IRTextSectionLoader leftDocLoader,\n    IRTextSectionLoader rightDocLoader,\n    Task<DocumentDiffResult>[] tasks, ICompilerInfoProvider irInfo, bool quickMode,\n    CancelableTask cancelableTask, int maxConcurrency) {\n    //? ConcurrentExclusiveSchedulerPair from DocSectionLoader is not the right solution\n    var taskScheduler = new ConcurrentExclusiveSchedulerPair(TaskScheduler.Default, maxConcurrency);\n    var taskFactory = new TaskFactory(taskScheduler.ConcurrentScheduler);\n    int index = 0;\n\n    foreach (var pair in comparedSections) {\n      var leftSection = pair.Item1;\n      var rightSection = pair.Item2;\n\n      tasks[index++] = taskFactory.StartNew(() => {\n        if (quickMode) {\n          if (leftDocLoader.SectionSignaturesComputed &&\n              rightDocLoader.SectionSignaturesComputed) {\n            if (!leftSection.IsSectionTextDifferent(rightSection)) {\n              return new DocumentDiffResult(leftSection, rightSection, null, false);\n            }\n          }\n\n          string leftText = leftDocLoader.GetSectionText(leftSection, false);\n          string rightText = rightDocLoader.GetSectionText(rightSection, false);\n\n          if (leftText.Equals(rightText, StringComparison.Ordinal)) {\n            return new DocumentDiffResult(leftSection, rightSection, null, false);\n          }\n\n          var leftInputFilter = irInfo.DiffFilterProvider?.CreateDiffInputFilter();\n          var rightInputFilter = irInfo.DiffFilterProvider?.CreateDiffInputFilter();\n\n          if (leftInputFilter == null || rightInputFilter == null) {\n            return new DocumentDiffResult(leftSection, rightSection, null, true);\n          }\n\n          string[] leftLines = leftText.SplitLines();\n          string[] rightLines = rightText.SplitLines();\n\n          if (leftLines.Length != rightLines.Length) {\n            return new DocumentDiffResult(leftSection, rightSection, null, true);\n          }\n\n          for (int i = 0; i < leftLines.Length; i++) {\n            string leftLine = leftLines[i];\n            string rightLine = rightLines[i];\n\n            string leftResult = leftInputFilter.FilterInputLine(leftLine);\n            string rightResult = rightInputFilter.FilterInputLine(rightLine);\n\n            if (!leftResult.Equals(rightResult, StringComparison.Ordinal)) {\n              return new DocumentDiffResult(leftSection, rightSection, null, true);\n            }\n          }\n\n          return new DocumentDiffResult(leftSection, rightSection, null, false);\n        }\n        else {\n          string leftText = leftDocLoader.GetSectionText(leftSection, false);\n          string rightText = rightDocLoader.GetSectionText(rightSection, false);\n\n          var leftInputFilter = irInfo.DiffFilterProvider?.CreateDiffInputFilter();\n          var rightInputFilter = irInfo.DiffFilterProvider?.CreateDiffInputFilter();\n\n          if (leftInputFilter != null && rightInputFilter != null) {\n            var leftResult = leftInputFilter.FilterInputText(leftText);\n            var rightResult = rightInputFilter.FilterInputText(rightText);\n            leftText = leftResult.Text;\n            rightText = rightResult.Text;\n          }\n\n          var diffs = ComputeInternalDiffs(leftText, rightText);\n          bool hasDiffs = HasDiffs(diffs);\n          return new DocumentDiffResult(leftSection, rightSection, null, hasDiffs);\n        }\n      }, cancelableTask.Token);\n    }\n\n    await Task.WhenAll(tasks);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Diff/IDiffFilterProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.Core.Diff;\n\npublic interface IDiffFilterProvider {\n  IDiffInputFilter CreateDiffInputFilter();\n  IDiffOutputFilter CreateDiffOutputFilter();\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Diff/IDiffOutputFilter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing DiffPlex.DiffBuilder.Model;\nusing ProfileExplorer.Core.Document.Renderers.Highlighters;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.Core.Diff;\n\npublic interface IDiffOutputFilter {\n  char[] IgnoredDiffLetters { get; }\n  void Initialize(DiffSettings settings, ICompilerIRInfo ifInfo);\n\n  DiffKind EstimateModificationType(DiffPiece before, DiffPiece after, int beforeOffset, int afterOffset,\n                                    string beforeDocumentText, string afterDocumentText);\n\n  AdjustedDiffPiece AdjustChange(DiffPiece change, int offset, int lineOffset, string lineText);\n}\n\npublic interface IDiffInputFilter {\n  void Initialize(DiffSettings settings, ICompilerIRInfo ifInfo);\n  FilteredDiffInput FilterInputText(string text);\n  string FilterInputLine(string line);\n}\n\npublic struct AdjustedDiffPiece {\n  public AdjustedDiffPiece(int offset, int length) {\n    Offset = offset;\n    Length = length;\n  }\n\n  public int Offset { get; set; }\n  public int Length { get; set; }\n}\n\npublic class FilteredDiffInput {\n  public static List<Replacement> NoReplacements = new(0);\n\n  public FilteredDiffInput(int capacity) {\n    Text = string.Empty;\n    LineReplacements = new List<List<Replacement>>(capacity);\n  }\n\n  public FilteredDiffInput(string text) {\n    Text = text;\n    LineReplacements = null;\n  }\n\n  public string Text { get; set; }\n  public List<List<Replacement>> LineReplacements { get; set; }\n\n  public struct Replacement {\n    public Replacement(int offset, string replaced, string original) {\n      Offset = offset;\n      Replaced = replaced;\n      Original = original;\n    }\n\n    public int Offset { get; set; }\n    public string Replaced { get; set; }\n    public string Original { get; set; }\n    public int Length => Replaced.Length;\n  }\n}\n\npublic class BasicDiffOutputFilter : IDiffOutputFilter {\n  public char[] IgnoredDiffLetters => new[] {\n    '(', ')', ',', '.', ';', ':', '|', '{', '}', '!', ' ', '\\t'\n  };\n\n  public AdjustedDiffPiece AdjustChange(DiffPiece change, int documentOffset, int lineOffset, string lineText) {\n    return new AdjustedDiffPiece(documentOffset, change.Text.Length);\n  }\n\n  public DiffKind EstimateModificationType(DiffPiece before, DiffPiece after, int beforeOffset, int afterOffset,\n                                           string beforeDocumentText, string afterDocumentText) {\n    return DiffKind.Modification;\n  }\n\n  public void Initialize(DiffSettings settings, ICompilerIRInfo ifInfo) {\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Document/Renderers/Highlighters/DiffKind.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing System.Windows;\n\nnamespace ProfileExplorer.Core.Document.Renderers.Highlighters;\n\npublic enum DiffKind {\n  None,\n  Insertion,\n  Deletion,\n  Modification,\n  MinorModification,\n  Placeholder\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/DocumentSectionLoader.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Security.Cryptography;\nusing System.Text;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core;\n\npublic sealed class DocumentSectionLoader : IRTextSectionLoader {\n  private IRSectionReader documentReader_;\n  private ConcurrentExclusiveSchedulerPair taskScheduler_;\n  private TaskFactory taskFactory_;\n  private CancelableTask preprocessTask_;\n\n  public DocumentSectionLoader(ICompilerIRInfo irInfo, bool useCache = true) {\n    Initialize(irInfo, useCache);\n  }\n\n  public DocumentSectionLoader(string filePath, ICompilerIRInfo irInfo, bool useCache = true) {\n    Initialize(irInfo, useCache);\n    documentReader_ = irInfo.CreateSectionReader(filePath);\n  }\n\n  public DocumentSectionLoader(byte[] textData, ICompilerIRInfo irInfo, bool useCache = true) {\n    Initialize(irInfo, useCache);\n    documentReader_ = irInfo.CreateSectionReader(textData);\n  }\n\n  public async override Task<IRTextSummary> LoadDocument(ProgressInfoHandler progressHandler) {\n    var tasks = new List<Task>();\n\n    var result = documentReader_.GenerateSummary(progressHandler, (reader, sectionInfo) => {\n      if (taskScheduler_ == null) {\n        taskScheduler_ = new ConcurrentExclusiveSchedulerPair(TaskScheduler.Default, 2);\n        taskFactory_ = new TaskFactory(taskScheduler_.ConcurrentScheduler);\n        preprocessTask_ = new CancelableTask();\n      }\n\n      tasks.Add(taskFactory_.StartNew(() => {\n        ComputeSectionSignature(sectionInfo);\n      }, preprocessTask_.Token));\n    });\n\n    if (result == null) {\n      preprocessTask_.Cancel();\n      return null;\n    }\n\n    if (tasks.Count > 0) {\n      Task.Run(() => {\n        Task.WaitAll(tasks.ToArray());\n        NotifySectionPreprocessingCompleted(preprocessTask_.IsCanceled);\n      });\n    }\n\n    return result;\n  }\n\n  public override string GetDocumentOutputText() {\n    byte[] data = documentReader_.GetDocumentTextData();\n    return Encoding.UTF8.GetString(data);\n  }\n\n  public override byte[] GetDocumentTextBytes() {\n    return documentReader_.GetDocumentTextData();\n  }\n\n  public override ParsedIRTextSection LoadSection(IRTextSection section) {\n    //Trace.TraceInformation(\n    //    $\"Section loader {ObjectTracker.Track(this)}: ({section.Number}) {section.Name}\");\n    var result = TryGetCachedParsedSection(section);\n\n    if (result != null) {\n      return result;\n    }\n\n    var text = GetSectionTextSpan(section);\n    var (sectionParser, errorHandler) = InitializeParser();\n    FunctionIR function;\n\n    if (sectionParser == null) {\n      function = new FunctionIR();\n    }\n    else {\n      function = sectionParser.ParseSection(section, text);\n    }\n\n    result = new ParsedIRTextSection(section, text, function);\n    CacheParsedSection(section, function, result);\n\n    if (errorHandler.HadParsingErrors) {\n      result.ParsingErrors = errorHandler.ParsingErrors;\n    }\n\n    return result;\n  }\n\n  public override string GetSectionText(IRTextSection section) {\n    return documentReader_.GetSectionText(section);\n  }\n\n  public override ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section) {\n    return documentReader_.GetSectionTextSpan(section);\n  }\n\n  public override string GetSectionOutputText(IRPassOutput output) {\n    if (output == null) {\n      // With some documents there is no before/after text.\n      return string.Empty;\n    }\n\n    return documentReader_.GetPassOutputText(output);\n  }\n\n  public override ReadOnlyMemory<char> GetSectionPassOutputTextSpan(IRPassOutput output) {\n    if (output == null) {\n      // With some documents there is no before/after text.\n      return ReadOnlyMemory<char>.Empty;\n    }\n\n    return documentReader_.GetPassOutputTextSpan(output);\n  }\n\n  public override List<string> GetSectionPassOutputTextLines(IRPassOutput output) {\n    if (output == null) {\n      // With some documents there is no before/after text.\n      return new List<string>();\n    }\n\n    return documentReader_.GetPassOutputTextLines(output);\n  }\n\n  public override string GetRawSectionText(IRTextSection section) {\n    return documentReader_.GetRawSectionText(section);\n  }\n\n  public override string GetRawSectionPassOutput(IRPassOutput output) {\n    return documentReader_.GetRawPassOutputText(output);\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionTextSpan(IRTextSection section) {\n    return documentReader_.GetRawSectionTextSpan(section);\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionPassOutputSpan(IRPassOutput output) {\n    return documentReader_.GetRawPassOutputTextSpan(output);\n  }\n\n  protected override void Dispose(bool disposing) {\n    if (!disposed_) {\n      documentReader_?.Dispose();\n      preprocessTask_?.Cancel();\n      documentReader_ = null;\n      disposed_ = true;\n    }\n  }\n\n  private void ComputeSectionSignature(SectionReaderText sectionInfo) {\n    var sha = SHA256.Create();\n    var lines = sectionInfo.TextLines;\n\n    for (int i = 0; i < lines.Count - 1; i++) {\n      byte[] data = Encoding.ASCII.GetBytes(lines[i]);\n      sha.TransformBlock(data, 0, data.Length, null, 0);\n    }\n\n    if (lines.Count > 0) {\n      byte[] data = Encoding.ASCII.GetBytes(lines[^1]);\n      sha.TransformFinalBlock(data, 0, data.Length);\n    }\n\n    sectionInfo.Output.Signature = sha.Hash;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/FileFormat/FileArchive.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Text.Json;\nusing System.Threading.Tasks;\n\nnamespace ProfileExplorer.Core.FileFormat;\n\npublic sealed class FileArchive : IDisposable {\n  public delegate void FileProgressDelegate(int currentFile, int totalFiles);\n  private const string HeaderFilePath = \"HEADER-4F1B8FB1-DD26-4D60-B275-6C0588668EE6\";\n  private const int FileBufferSize = 128 * 1024;\n  private const int FileFormatVersion = 1;\n  private const int MinFileFormatVersion = 1;\n  private static readonly Guid FileSignature = new(\"80BCEE32-5110-4A25-87D3-D359B0C2634C\");\n  private Header header_;\n  private ZipArchive archive_;\n  private Stream archiveStream_;\n  private CompressionLevel compressionLevel_;\n  private bool modified_;\n  private bool disposed_;\n\n  private FileArchive(Stream stream, bool openForWrite,\n                      CompressionLevel level = CompressionLevel.Fastest) {\n    try {\n      var mode = openForWrite ? ZipArchiveMode.Create : ZipArchiveMode.Read;\n      archive_ = new ZipArchive(stream, mode, false);\n    }\n    catch {\n      stream?.Dispose();\n      throw;\n    }\n\n    archiveStream_ = stream;\n    compressionLevel_ = level;\n    CreateHeader();\n  }\n\n  public List<FileEntry> Files => header_.Files;\n  public int FileCount => Files.Count;\n  public long UncompressedSize => Files.Sum(entry => entry.Size);\n  public bool HasOptionalData => header_.OptionalData != null;\n\n  public void Dispose() {\n    Dispose(disposing: true);\n    GC.SuppressFinalize(this);\n  }\n\n  public event FileProgressDelegate OnFileAdded; // Notified when adding multiple files only.\n  public event FileProgressDelegate OnFileExtracted; // Notified when extracting multiple files only.\n\n  // Optional data that can be serialized together with the header.\n  public void SetOptionalData(object dataObject) {\n    header_.OptionalData = dataObject;\n  }\n\n  public T GetOptionalData<T>() {\n    return header_.GetOptionalData<T>();\n  }\n\n  public IEnumerable<FileEntry> FindFilesOfKind(int kind) {\n    foreach (var entry in Files) {\n      if (entry.Kind == kind) {\n        yield return entry;\n      }\n    }\n  }\n\n  public bool HasFilesOfKind(int kind) {\n    foreach (var entry in FindFilesOfKind(kind)) {\n      return true;\n    }\n\n    return false;\n  }\n\n  public IEnumerable<FileEntry> FindFilesInDirectory(string directoryPath, int optionalKind = 0) {\n    foreach (var entry in Files) {\n      if (optionalKind != 0 && entry.Kind != optionalKind) {\n        continue; // Filter based on kind.\n      }\n\n      string entryDir = entry.Directory;\n\n      if (entryDir == directoryPath) {\n        yield return entry;\n        continue;\n      }\n\n      // For a directoryPath foo accept files in dirs like\n      // foo/file.ext and foo/bar/file.ext, but reject\n      // foobar/file.ext and bar/foo/file.ext and bar/foofile.ext.\n      int prefixIndex = entryDir.IndexOf(directoryPath, StringComparison.Ordinal);\n\n      if (prefixIndex == 0 &&\n          (prefixIndex + directoryPath.Length == entryDir.Length - 1 ||\n           entryDir[prefixIndex + directoryPath.Length] == Path.DirectorySeparatorChar)) {\n        yield return entry;\n      }\n    }\n  }\n\n  public static async Task<FileArchive> LoadAsync(string filePath) {\n    try {\n      var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read,\n                                  FileBufferSize, false);\n      var archive = new FileArchive(stream, false);\n\n      if (!await archive.LoadHeader().ConfigureAwait(false)) {\n        Trace.WriteLine($\"Failed to validate archive header for {filePath}\");\n        return null;\n      }\n\n      return archive;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to load archive {filePath}: {ex.Message}\");\n      return null;\n    }\n  }\n\n  public static async Task<FileArchive> LoadOrCreateAsync(string filePath,\n                                                          CompressionLevel compressionLevel =\n                                                            CompressionLevel.Fastest) {\n    return await CreateAsyncImpl(filePath, compressionLevel, false, true).ConfigureAwait(false);\n  }\n\n  public static async Task<FileArchive> CreateAsync(string filePath,\n                                                    CompressionLevel compressionLevel = CompressionLevel.Fastest,\n                                                    bool overwriteExisting = true) {\n    return await CreateAsyncImpl(filePath, compressionLevel, overwriteExisting, false).ConfigureAwait(false);\n  }\n\n  private static async Task<FileArchive> CreateAsyncImpl(string filePath,\n                                                         CompressionLevel compressionLevel = CompressionLevel.Fastest,\n                                                         bool overwriteExisting = true,\n                                                         bool loadExisting = false) {\n    try {\n      Debug.Assert(!(overwriteExisting && loadExisting));\n\n      if (File.Exists(filePath)) {\n        if (overwriteExisting) {\n          File.Delete(filePath);\n        }\n        else if (loadExisting) {\n          return await LoadAsync(filePath).ConfigureAwait(false);\n        }\n        else {\n          return null;\n        }\n      }\n\n      var stream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write, FileShare.None,\n                                  FileBufferSize, false);\n      var archive = new FileArchive(stream, true, compressionLevel);\n      return archive;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to create archive {filePath}: {ex.Message}\");\n      return null;\n    }\n  }\n\n  public async Task<bool> SaveAsync() {\n    await SaveHeader().ConfigureAwait(false);\n    Close();\n    return true;\n  }\n\n  private void Close() {\n    archive_?.Dispose();\n    archive_ = null;\n    archiveStream_ = null;\n    modified_ = false;\n  }\n\n  public async Task<bool> AddFileAsync(string sourceFilePath, int fileKind = 0, string optionalDirectory = null,\n                                       bool keepExisting = false) {\n    try {\n      await using var sourceStream = File.OpenRead(sourceFilePath);\n      string archiveFilePath = Path.GetFileName(sourceFilePath);\n\n      if (!string.IsNullOrEmpty(optionalDirectory)) {\n        archiveFilePath = Path.Combine(optionalDirectory, archiveFilePath);\n      }\n\n      return await AddFileStreamAsync(sourceStream, archiveFilePath, fileKind, keepExisting).ConfigureAwait(false);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to add file {sourceFilePath}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public async Task<bool> AddFilesAsync(IEnumerable<string> sourceFilePaths, int fileKind = 0,\n                                        string optionalDirectory = null,\n                                        bool keepExisting = false) {\n    try {\n      var files = sourceFilePaths.ToList();\n      int index = 0;\n      OnFileAdded?.Invoke(0, files.Count);\n\n      foreach (string filePath in files) {\n        await using var sourceStream = File.OpenRead(filePath);\n        string archiveFilePath = Path.GetFileName(filePath);\n\n        if (!string.IsNullOrEmpty(optionalDirectory)) {\n          archiveFilePath = Path.Combine(optionalDirectory, archiveFilePath);\n        }\n\n        if (!await AddFileStreamAsync(sourceStream, archiveFilePath, fileKind, keepExisting).ConfigureAwait(false)) {\n          return false;\n        }\n\n        OnFileAdded?.Invoke(++index, files.Count);\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to add file collection: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public async Task<bool> AddDirectoryAsync(string directoryPath, bool includeSubdirs = false,\n                                            int fileKind = 0,\n                                            string searchPattern = \"*\", string optionalDirectory = null,\n                                            bool keepExisting = false) {\n    try {\n      var searchOption = includeSubdirs ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;\n      var files = Directory.EnumerateFiles(directoryPath, searchPattern, searchOption).ToList();\n      int index = 0;\n      OnFileAdded?.Invoke(0, files.Count);\n\n      foreach (string file in files) {\n        // If file is in a directoryPath subdir, create the corresponding\n        // subdir in the archive too, combined with the subdir force by client.\n        string subdirPath = Path.GetRelativePath(directoryPath, file);\n        subdirPath = Path.GetDirectoryName(subdirPath);\n\n        if (!string.IsNullOrEmpty(optionalDirectory)) {\n          subdirPath = Path.Combine(optionalDirectory, subdirPath);\n        }\n\n        if (!await AddFileAsync(file, fileKind, subdirPath, keepExisting).ConfigureAwait(false)) {\n          return false;\n        }\n\n        OnFileAdded?.Invoke(++index, files.Count);\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to add file collection: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public async Task<bool> AddFileStreamAsync(Stream sourceStream,\n                                             string archiveFilePath,\n                                             int fileKind = 0,\n                                             bool keepExisting = false) {\n    try {\n      var existingEntry = header_.FindFile(archiveFilePath);\n\n      if (existingEntry != null) {\n        if (keepExisting) {\n          return true;\n        }\n\n        await RemoveFile(archiveFilePath).ConfigureAwait(false);\n      }\n\n      var newEntry = archive_.CreateEntry(archiveFilePath, compressionLevel_);\n      await using var entryStream = newEntry.Open();\n      await sourceStream.CopyToAsync(entryStream).ConfigureAwait(false);\n\n      if (archiveFilePath != HeaderFilePath) {\n        header_.AddFile(archiveFilePath, fileKind, sourceStream.Length);\n      }\n\n      modified_ = true;\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to add file {archiveFilePath}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public async Task<bool> RemoveFile(string archiveFilePath) {\n    var entry = archive_.GetEntry(archiveFilePath);\n\n    if (entry != null) {\n      header_.RemoveFile(archiveFilePath);\n      entry.Delete();\n      modified_ = true;\n      return true;\n    }\n\n    return false;\n  }\n\n  public async Task<bool> ExtractFilesToDirectoryAsync(IEnumerable<string> files, string directoryPath,\n                                                       bool preserveArchiveDirs = true,\n                                                       bool overwriteExisting = true) {\n    int index = 0;\n    OnFileExtracted?.Invoke(0, Files.Count);\n\n    foreach (string file in files) {\n      if (!await ExtractFileToDirectoryAsync(file, directoryPath,\n                                             preserveArchiveDirs, overwriteExisting).ConfigureAwait(false)) {\n        return false;\n      }\n\n      OnFileExtracted?.Invoke(++index, Files.Count);\n    }\n\n    return true;\n  }\n\n  public async Task<bool> ExtractFilesToDirectoryAsync(IEnumerable<FileEntry> files, string directoryPath,\n                                                       bool preserveArchiveDirs = true,\n                                                       bool overwriteExisting = true) {\n    int index = 0;\n    OnFileExtracted?.Invoke(0, Files.Count);\n\n    foreach (var file in files) {\n      if (!await ExtractFileToDirectoryAsync(file, directoryPath,\n                                             preserveArchiveDirs, overwriteExisting).ConfigureAwait(false)) {\n        return false;\n      }\n\n      OnFileExtracted?.Invoke(++index, Files.Count);\n    }\n\n    return true;\n  }\n\n  public async Task<bool> ExtractAllFilesOfKindToDirectoryAsync(int kind, string directoryPath,\n                                                                string optionalArchiveDirectory = null,\n                                                                bool preserveArchiveDirs = true,\n                                                                bool overwriteExisting = true) {\n    var files = !string.IsNullOrEmpty(optionalArchiveDirectory) ?\n      FindFilesInDirectory(optionalArchiveDirectory, kind) :\n      FindFilesOfKind(kind);\n    int index = 0;\n    OnFileExtracted?.Invoke(0, Files.Count);\n\n    foreach (var file in files) {\n      if (!await ExtractFileToDirectoryAsync(file, directoryPath,\n                                             preserveArchiveDirs, overwriteExisting).ConfigureAwait(false)) {\n        return false;\n      }\n\n      OnFileExtracted?.Invoke(++index, Files.Count);\n    }\n\n    return true;\n  }\n\n  public async Task<bool> ExtractFileToDirectoryAsync(FileEntry file, string directoryPath,\n                                                      bool preserveArchiveDirs = true,\n                                                      bool overwriteExisting = true) {\n    return await ExtractFileToDirectoryAsync(file.ArchivePath, directoryPath,\n                                             preserveArchiveDirs, overwriteExisting).ConfigureAwait(false);\n  }\n\n  public async Task<bool> ExtractFileToDirectoryAsync(string archiveFilePath, string directoryPath,\n                                                      bool preserveArchiveDirs = true,\n                                                      bool overwriteExisting = true) {\n    try {\n      string outFilePath = preserveArchiveDirs\n        ? Path.Combine(directoryPath, archiveFilePath)\n        : Path.Combine(directoryPath, Path.GetFileName(archiveFilePath));\n\n      string outFileDir = Path.GetDirectoryName(outFilePath);\n\n      if (!string.IsNullOrEmpty(outFileDir) &&\n          !Directory.Exists(outFileDir)) {\n        Directory.CreateDirectory(outFileDir);\n      }\n\n      return await ExtractFileAsync(archiveFilePath, outFilePath, overwriteExisting).ConfigureAwait(false);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to add file {archiveFilePath}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public async Task<bool> ExtractAllToDirectoryAsync(string directoryPath,\n                                                     bool preserveArchiveDirs = true,\n                                                     bool overwriteExisting = true) {\n    int index = 0;\n    OnFileExtracted?.Invoke(0, Files.Count);\n\n    foreach (var file in Files) {\n      if (!await ExtractFileToDirectoryAsync(file, directoryPath,\n                                             preserveArchiveDirs, overwriteExisting).ConfigureAwait(false)) {\n        return false;\n      }\n\n      OnFileExtracted?.Invoke(++index, Files.Count);\n    }\n\n    return true;\n  }\n\n  public static async Task<bool> ExtractAllToDirectoryAsync(string archivePath,\n                                                            string directoryPath,\n                                                            bool preserveArchiveDirs = true,\n                                                            bool overwriteExisting = true) {\n    using var archive = await LoadAsync(archivePath).ConfigureAwait(false);\n\n    if (archive == null) {\n      return false;\n    }\n\n    return await archive.ExtractAllToDirectoryAsync(directoryPath, preserveArchiveDirs, overwriteExisting).\n      ConfigureAwait(false);\n  }\n\n  public static async Task<bool> CreateFromFileAsync(string sourceFilePath,\n                                                     string archivePath,\n                                                     CompressionLevel compressionLevel = CompressionLevel.Fastest,\n                                                     int fileKind = 0,\n                                                     bool overwriteExisting = true) {\n    using var archive = await CreateAsync(archivePath, compressionLevel, overwriteExisting).ConfigureAwait(false);\n\n    if (archive == null ||\n        !await archive.AddFileAsync(sourceFilePath, fileKind, null, false).ConfigureAwait(false)) {\n      return false;\n    }\n\n    return await archive.SaveAsync().ConfigureAwait(false);\n  }\n\n  public static async Task<bool> CreateFromFilesAsync(IEnumerable<string> sourceFilePaths,\n                                                      string archivePath,\n                                                      CompressionLevel compressionLevel = CompressionLevel.Fastest,\n                                                      int fileKind = 0,\n                                                      bool overwriteExisting = true) {\n    using var archive = await CreateAsync(archivePath, compressionLevel, overwriteExisting).ConfigureAwait(false);\n\n    if (archive == null ||\n        !await archive.AddFilesAsync(sourceFilePaths, fileKind, null, false).ConfigureAwait(false)) {\n      return false;\n    }\n\n    return await archive.SaveAsync().ConfigureAwait(false);\n  }\n\n  public static async Task<bool> CreateFromStreamAsync(Stream sourceStream,\n                                                       string sourceFilePath,\n                                                       string archivePath,\n                                                       CompressionLevel compressionLevel = CompressionLevel.Fastest,\n                                                       int fileKind = 0,\n                                                       bool overwriteExisting = true) {\n    using var archive = await CreateAsync(archivePath, compressionLevel, overwriteExisting).ConfigureAwait(false);\n\n    if (archive == null ||\n        !await archive.AddFileStreamAsync(sourceStream, sourceFilePath, fileKind, false).ConfigureAwait(false)) {\n      return false;\n    }\n\n    return await archive.SaveAsync().ConfigureAwait(false);\n  }\n\n  public static async Task<bool> CreateFromDirectoryAsync(string directoryPath,\n                                                          string archivePath,\n                                                          CompressionLevel compressionLevel = CompressionLevel.Fastest,\n                                                          bool includeSubdirs = false,\n                                                          string searchPattern = \"*\",\n                                                          int fileKind = 0,\n                                                          bool overwriteExisting = true) {\n    using var archive = await CreateAsync(archivePath, compressionLevel, overwriteExisting).ConfigureAwait(false);\n\n    if (archive == null ||\n        !await archive.AddDirectoryAsync(directoryPath, includeSubdirs, fileKind, searchPattern, null, false).\n          ConfigureAwait(false)) {\n      return false;\n    }\n\n    return await archive.SaveAsync().ConfigureAwait(false);\n  }\n\n  public async Task<bool> ExtractFileAsync(FileEntry file, string outFilePath,\n                                           bool overwriteExisting = true) {\n    return await ExtractFileAsync(file.ArchivePath, outFilePath, overwriteExisting).ConfigureAwait(false);\n  }\n\n  public async Task<bool> ExtractFileAsync(string archiveFilePath, string outFilePath,\n                                           bool overwriteExisting = true) {\n    try {\n      if (File.Exists(outFilePath)) {\n        if (overwriteExisting) {\n          File.Delete(outFilePath);\n        }\n        else {\n          return false;\n        }\n      }\n\n      await using var stream = new FileStream(outFilePath, FileMode.CreateNew, FileAccess.Write,\n                                              FileShare.None, FileBufferSize, false);\n      return await ExtractFileAsync(archiveFilePath, stream).ConfigureAwait(false);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to extract file {archiveFilePath} to {outFilePath}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public async Task<bool> ExtractFileAsync(FileEntry file, Stream outStream) {\n    return await ExtractFileAsync(file.ArchivePath, outStream).ConfigureAwait(false);\n  }\n\n  public async Task<bool> ExtractFileAsync(string archiveFilePath, Stream outStream) {\n    try {\n      var entry = archive_.GetEntry(archiveFilePath);\n\n      if (entry == null) {\n        Trace.WriteLine($\"File not found in archive: {archiveFilePath}\");\n        return false;\n      }\n\n      await using var entryStream = entry.Open();\n      await entryStream.CopyToAsync(outStream).ConfigureAwait(false);\n      outStream.Position = 0;\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to extract file {archiveFilePath}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public async Task<MemoryStream> ExtractFileToMemoryAsync(string archiveFilePath) {\n    var outStream = new MemoryStream();\n\n    if (await ExtractFileAsync(archiveFilePath, outStream)) {\n      return outStream;\n    }\n    else {\n      outStream.Dispose();\n      return null;\n    }\n  }\n\n  public async Task<MemoryStream> ExtractFileToMemoryAsync(FileEntry file) {\n    return await ExtractFileToMemoryAsync(file.ArchivePath);\n  }\n\n  public FileEntry FindFile(string archiveFilePath) {\n    try {\n      var fileEntry = header_.FindFile(archiveFilePath);\n\n      if (fileEntry != null && archive_.GetEntry(archiveFilePath) == null) {\n        throw new InvalidDataException($\"File missing for archive: {archiveFilePath}\");\n      }\n\n      return fileEntry;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to find file {archiveFilePath}: {ex.Message}\");\n      return null;\n    }\n  }\n\n  public bool HasFile(string archiveFilePath) {\n    return FindFile(archiveFilePath) != null;\n  }\n\n  private void CreateHeader() {\n    header_ = new Header() {\n      Signature = FileSignature,\n      Version = FileFormatVersion,\n      Files = new List<FileEntry>()\n    };\n  }\n\n  private async Task<bool> SaveHeader() {\n    await using var stream = new MemoryStream();\n    var options = new JsonSerializerOptions();\n    options.IgnoreReadOnlyFields = true;\n    options.IgnoreReadOnlyProperties = true;\n    options.WriteIndented = true;\n    await JsonSerializer.SerializeAsync<Header>(stream, header_, options).ConfigureAwait(false);\n    stream.Position = 0;\n    return await AddFileStreamAsync(stream, HeaderFilePath).ConfigureAwait(false);\n  }\n\n  private async Task<bool> LoadHeader() {\n    using var stream = new MemoryStream();\n\n    if (!await ExtractFileAsync(HeaderFilePath, stream).ConfigureAwait(false)) {\n      // When opening a plain ZIP file, accept it by\n      // populating the header with the existing files.\n      stream.Position = 0;\n      return CreateHeaderFromArchive();\n    }\n\n    stream.Position = 0;\n    header_ = await JsonSerializer.DeserializeAsync<Header>(stream).ConfigureAwait(false);\n    return ValidateHeader(header_);\n  }\n\n  private bool CreateHeaderFromArchive() {\n    try {\n      CreateHeader();\n\n      foreach (var entry in archive_.Entries) {\n        header_.AddFile(entry.FullName, 0, entry.Length);\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to create header from archive contents\");\n      return false;\n    }\n  }\n\n  private bool ValidateHeader(Header header) {\n    return header.Signature == FileSignature &&\n           header.Version is >= MinFileFormatVersion and <= FileFormatVersion;\n  }\n\n  private void Dispose(bool disposing) {\n    if (!disposed_) {\n      if (disposing) {\n        if (modified_) {\n          // Force saving the header if SaveAsync was not used.\n          SaveAsync().ConfigureAwait(false).GetAwaiter().GetResult();\n        }\n\n        Close();\n      }\n\n      disposed_ = true;\n    }\n  }\n\n  private struct Header {\n    public Guid Signature { get; init; }\n    public int Version { get; init; }\n    public List<FileEntry> Files { get; init; }\n    public object OptionalData { get; set; }\n\n    public void AddFile(string path, int kind, long size) {\n      Files.Add(new FileEntry(path, kind, size));\n    }\n\n    public FileEntry FindFile(string path) {\n      return Files.Find(entry => entry.Name.Equals(path, StringComparison.Ordinal));\n    }\n\n    internal void RemoveFile(string path) {\n      Files.RemoveAll(entry => entry.Name.Equals(path, StringComparison.Ordinal));\n    }\n\n    public T GetOptionalData<T>() {\n      if (OptionalData is JsonElement json) {\n        return json.Deserialize<T>();\n      }\n\n      return (T)OptionalData;\n    }\n  }\n\n  public class FileEntry {\n    public FileEntry(string archivePath, int kind, long size) {\n      ArchivePath = archivePath;\n      Kind = kind;\n      Size = size;\n    }\n\n    public string ArchivePath { get; set; } // Path in archive, can have subdirs.\n    public long Size { get; set; } // Uncompressed size.\n    public int Kind { get; set; } // Optional kind set by client.\n    public string Name => Path.GetFileName(ArchivePath);\n    public string Extension => Path.GetExtension(ArchivePath);\n    public string Directory => Path.GetDirectoryName(ArchivePath);\n    public bool HasDirectory => !string.IsNullOrEmpty(Directory);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/CallGraphPrinter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic class CallGraphPrinterOptions {\n  public bool UseExternalNode { get; set; }\n  public bool UseStraightLines { get; set; }\n  public bool UseSingleIncomingEdge { get; set; }\n  public bool TruncateLongNames { get; set; }\n  public int NameLengthLimit { get; set; }\n  public double VerticalDistanceFactor { get; set; }\n}\n\npublic sealed class CallGraphPrinter : GraphVizPrinter {\n  private const int ExternalNodeId = -1;\n  private const int LargeGraphThresholdMin = 500;\n  private const string StraightLinesSettings = @\"\nsplines = ortho;\nconcentrate = true;\n            \";\n  private const string LargeGraphSettings = @\"\nsplines = ortho;\nconcentrate = true;\nmaxiter=4;\nmclimit=2;\nnslimit=2;\n        \";\n  private CallGraphPrinterOptions options_;\n  private CallGraph callGraph_;\n  private Dictionary<string, TaggedObject> nodeNameMap_;\n  private HashSet<CallGraphNode> incomingEdgeNodes_;\n\n  public CallGraphPrinter(CallGraph callGraph, CallGraphPrinterOptions options) {\n    callGraph_ = callGraph;\n    options_ = options;\n    nodeNameMap_ = new Dictionary<string, TaggedObject>();\n\n    if (options_.UseSingleIncomingEdge) {\n      incomingEdgeNodes_ = new HashSet<CallGraphNode>();\n    }\n  }\n\n  public override Dictionary<string, TaggedObject> CreateNodeDataMap() {\n    if (nodeNameMap_.Count > 0) {\n      return nodeNameMap_;\n    }\n\n    var map = new Dictionary<string, TaggedObject>();\n\n    foreach (var node in callGraph_.FunctionNodes) {\n      map[GetNodeName((ulong)node.Number)] = node;\n    }\n\n    return map;\n  }\n\n  public override Dictionary<TaggedObject, List<TaggedObject>> CreateNodeDataGroupsMap() {\n    return null;\n  }\n\n  protected override string GetExtraSettings() {\n    string text = \"\";\n\n    if (options_.UseStraightLines) {\n      text = StraightLinesSettings;\n    }\n\n    // Increase the vertical distance between nodes the more there are\n    // to make the graph somewhat easier to read.\n    int nodeCount = callGraph_.FunctionNodes.Count;\n    // double verticalDistance = Math.Clamp(0.3 * Math.Log(nodeCount), 0.3, 1);\n    double verticalDistance = 1;\n    text = $\"{text}\\nranksep ={verticalDistance};\\n\";\n\n    int edgeCount = EstimateEdgeCount();\n    int elements = Math.Max(edgeCount, nodeCount);\n    return elements > LargeGraphThresholdMin ? $\"{text}{LargeGraphSettings}\" : text;\n  }\n\n  protected override void PrintGraph(StringBuilder builder) {\n    if (options_.UseExternalNode) {\n      CreateNode(ExternalNodeId, \"EXTERNAL\", builder);\n    }\n\n    foreach (var node in callGraph_.FunctionNodes) {\n      CreateNode(node, builder);\n    }\n\n    foreach (var node in callGraph_.FunctionNodes) {\n      foreach (var calleeNode in node.UniqueCallees) {\n        CreateEdge(node, calleeNode, builder);\n      }\n\n      if (options_.UseExternalNode && !node.HasCallers) {\n        CreateEdge(ExternalNodeId, node.Number, builder);\n      }\n    }\n  }\n\n  private int EstimateEdgeCount() {\n    int total = 0;\n\n    foreach (var node in callGraph_.FunctionNodes) {\n      total += node.HasCallees ? node.Callees.Count : 0;\n    }\n\n    return total;\n  }\n\n  private void CreateNode(CallGraphNode node, StringBuilder builder) {\n    //? TODO: Control through options\n    double verticalMargin = 0.1;\n    string label = node.FunctionName;\n\n    if (label.Length > 25) {\n      label = $\"{label.Substring(0, 22)}...\";\n    }\n\n    // Increase node weight so that text fits completely.\n    double horizontalMargin = Math.Min(Math.Max(0.1, label.Length * 0.04), 1.0);\n\n    string nodeName = CreateNodeWithMargins(node.Number, label, builder,\n                                            horizontalMargin, verticalMargin);\n    nodeNameMap_[nodeName] = node;\n  }\n\n  private void CreateEdge(CallGraphNode node1, CallGraphNode node2, StringBuilder builder) {\n    if (options_.UseSingleIncomingEdge) {\n      if (!incomingEdgeNodes_.Add(node2)) {\n        return; // Node already has an edge.\n      }\n    }\n\n    CreateEdge(node1.Number, node2.Number, builder);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/DominatorTreePrinter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic sealed class DominatorTreePrinter : GraphVizPrinter {\n  private FunctionIR function_;\n  private DominatorAlgorithmOptions options_;\n  private Dictionary<string, TaggedObject> blockNameMap_;\n\n  public DominatorTreePrinter(FunctionIR function, DominatorAlgorithmOptions options) {\n    function_ = function;\n    options_ = options;\n    blockNameMap_ = new Dictionary<string, TaggedObject>();\n  }\n\n  public override Dictionary<string, TaggedObject> CreateNodeDataMap() {\n    if (blockNameMap_.Count > 0) {\n      return blockNameMap_;\n    }\n\n    var map = new Dictionary<string, TaggedObject>();\n\n    foreach (var block in function_.Blocks) {\n      map[GetNodeName(block.Id)] = block;\n    }\n\n    return map;\n  }\n\n  public override Dictionary<TaggedObject, List<TaggedObject>> CreateNodeDataGroupsMap() {\n    return null;\n  }\n\n  protected override void PrintGraph(StringBuilder builder) {\n    var cache = FunctionAnalysisCache.Get(function_);\n\n    var dominatorAlgo = options_.HasFlag(DominatorAlgorithmOptions.Dominators)\n      ? cache.GetDominators()\n      : cache.GetPostDominators();\n\n    if (dominatorAlgo.DomTreeRootNode == null) {\n      Trace.TraceWarning($\"Invalid DomTree {ObjectTracker.Track(dominatorAlgo)}\");\n      return; // Invalid CFG.\n    }\n\n    PrintDomTree(dominatorAlgo.DomTreeRootNode, builder);\n  }\n\n  private void CreateNode(BlockIR block, StringBuilder builder) {\n    string blockName = CreateNode(block.Id, block.Number.ToString(), builder, \"B\");\n    blockNameMap_[blockName] = block;\n  }\n\n  private void CreateEdge(BlockIR block1, BlockIR block2, StringBuilder builder) {\n    CreateEdge(block1.Id, block2.Id, builder);\n  }\n\n  private void PrintDomTree(DominatorTreeNode node, StringBuilder builder) {\n    CreateNode(node.Block, builder);\n\n    foreach (var child in node.Children) {\n      PrintDomTree(child, builder);\n      CreateEdge(node.Block, child.Block, builder);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/ExpressionGraphPrinter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic class ExpressionGraphPrinterOptions {\n  public bool PrintVariableNames { get; set; }\n  public bool PrintSSANumbers { get; set; }\n  public bool GroupInstructions { get; set; }\n  public bool PrintBottomUp { get; set; }\n  public bool SkipCopyInstructions { get; set; }\n  public int MaxExpressionDepth { get; set; }\n  public ICompilerIRInfo IR { get; set; }\n}\n\npublic sealed class ExpressionGraphPrinter : GraphVizPrinter {\n  private StringBuilder builder_;\n  private List<Tuple<IRElement, IRElement>> edges_;\n  private List<Tuple<IRElement, IRElement, string>> nodes_;\n  private ExpressionGraphPrinterOptions options_;\n  private IRElement rootElement_;\n  private IRElement startElement_;\n  private Dictionary<IRElement, IRElement> visitedElements_;\n  private Dictionary<string, TaggedObject> elementNameMap_;\n  private Dictionary<TaggedObject, List<TaggedObject>> blockNodeGroupsMap_;\n\n  public ExpressionGraphPrinter(IRElement startElement,\n                                ExpressionGraphPrinterOptions options) {\n    startElement_ = startElement;\n    options_ = options;\n    visitedElements_ = new Dictionary<IRElement, IRElement>();\n    nodes_ = new List<Tuple<IRElement, IRElement, string>>();\n    edges_ = new List<Tuple<IRElement, IRElement>>();\n    elementNameMap_ = new Dictionary<string, TaggedObject>();\n    blockNodeGroupsMap_ = new Dictionary<TaggedObject, List<TaggedObject>>();\n  }\n\n  public override Dictionary<string, TaggedObject> CreateNodeDataMap() {\n    return elementNameMap_;\n  }\n\n  public override Dictionary<TaggedObject, List<TaggedObject>> CreateNodeDataGroupsMap() {\n    return blockNodeGroupsMap_;\n  }\n\n  protected override void PrintGraph(StringBuilder builder) {\n    builder_ = builder;\n    var refFinder = new ReferenceFinder(startElement_.ParentFunction);\n    var exprNode = PrintExpression(startElement_, null, 0, refFinder);\n    rootElement_ = CreateFakeIRElement();\n    CreateNode(rootElement_, null, \"ROOT\");\n    CreateEdge(rootElement_, exprNode);\n\n    if (options_.GroupInstructions) {\n      PrintGroupedNodes();\n    }\n    else {\n      PrintNodes();\n    }\n\n    PrintEdges();\n  }\n\n  private void CreateNode(IRElement element, IRElement parent, string label) {\n    nodes_.Add(new Tuple<IRElement, IRElement, string>(element, parent, label));\n  }\n\n  private void CreateEdge(IRElement element1, IRElement element2) {\n    edges_.Add(new Tuple<IRElement, IRElement>(element1, element2));\n  }\n\n  private TupleIR CreateFakeIRElement() {\n    return new TupleIR(IRElementId.FromLong(1), TupleKind.Other,\n                       startElement_.ParentBlock);\n  }\n\n  private void PrintGroupedNodes() {\n    var blockGroups = new Dictionary<BlockIR, List<Tuple<IRElement, IRElement, string>>>();\n    var noGroupNodes = new List<Tuple<IRElement, IRElement, string>>();\n\n    foreach (var node in nodes_) {\n      switch (node.Item1) {\n        case TupleIR tuple:\n          AddNodeToGroup(node, tuple, blockGroups);\n          AddElementToGroupMap(node.Item1, tuple);\n          break;\n        case OperandIR _ when node.Item2 is TupleIR parentTuple:\n          AddNodeToGroup(node, parentTuple, blockGroups);\n          AddElementToGroupMap(node.Item1, parentTuple);\n          break;\n        default:\n          noGroupNodes.Add(node);\n          break;\n      }\n    }\n\n    foreach (var (_, tuples) in blockGroups) {\n      int margin = Math.Min(10 * (tuples.Count + 1), 50);\n      StartSubgraph(margin, builder_);\n\n      foreach ((var irElement, _, string label) in tuples) {\n        PrintNode(irElement, label);\n      }\n\n      EndSubgraph(builder_);\n    }\n\n    foreach ((var irElement, _, string label) in noGroupNodes) {\n      PrintNode(irElement, label);\n    }\n  }\n\n  private void PrintNodes() {\n    foreach ((var element, _, string label) in nodes_) {\n      PrintNode(element, label);\n    }\n  }\n\n  private void AddNodeToGroup(Tuple<IRElement, IRElement, string> node, TupleIR tuple,\n                              Dictionary<BlockIR, List<Tuple<IRElement, IRElement, string>>> blockGroups) {\n    var block = tuple.ParentBlock;\n\n    if (!blockGroups.TryGetValue(block, out var group)) {\n      group = new List<Tuple<IRElement, IRElement, string>>();\n      blockGroups.Add(block, group);\n    }\n\n    group.Add(node);\n  }\n\n  private void AddElementToGroupMap(IRElement element, TupleIR tuple) {\n    var block = tuple.ParentBlock;\n\n    if (!blockNodeGroupsMap_.TryGetValue(block, out var group)) {\n      group = new List<TaggedObject>();\n      blockNodeGroupsMap_.Add(block, group);\n    }\n\n    group.Add(element);\n  }\n\n  private void PrintNode(IRElement element, string label) {\n    // Numbers picked by trial and error for graph to look good...\n    double verticalMargin = 0.055;\n    double horizontalMargin = Math.Min(Math.Max(0.1, label.Length * 0.03), 1.0);\n\n    string elementName = CreateNodeWithMargins(element.Id, label, builder_,\n                                               horizontalMargin, verticalMargin);\n    elementNameMap_[elementName] = element;\n  }\n\n  private void PrintEdges() {\n    foreach (var (element1, element2) in edges_) {\n      CreateEdge(element1.Id, element2.Id, builder_);\n    }\n  }\n\n  private IRElement SkipAllCopies(IRElement op) {\n    var defInstr = op.ParentInstruction;\n\n    while (defInstr != null) {\n      var sourceOp = options_.IR.SkipCopyInstruction(defInstr);\n\n      if (sourceOp != null) {\n        op = sourceOp;\n        defInstr = sourceOp.ParentInstruction;\n      }\n      else {\n        break;\n      }\n    }\n\n    return op;\n  }\n\n  private IRElement PrintExpression(IRElement element, IRElement parent,\n                                    int level, ReferenceFinder refFinder) {\n    if (visitedElements_.TryGetValue(element, out var mappedElement)) {\n      return mappedElement;\n    }\n\n    if (options_.SkipCopyInstructions) {\n      element = SkipAllCopies(element);\n    }\n\n    switch (element) {\n      case OperandIR op: {\n        var defElement = refFinder.FindSingleDefinition(op);\n\n        if (defElement != null) {\n          if (defElement is OperandIR defOp) {\n            if (defOp.Role == OperandRole.Parameter) {\n              string label = GetOperandLabel(defOp);\n              CreateNode(defOp, parent, label);\n              visitedElements_[element] = defOp;\n              return defOp;\n            }\n          }\n\n          var result = PrintExpression(defElement.ParentTuple, op, level, refFinder);\n          visitedElements_[element] = result;\n          return result;\n        }\n\n        if (op.IsIntConstant) {\n          CreateNode(op, parent, op.IntValue.ToString(CultureInfo.InvariantCulture));\n        }\n        else if (op.IsFloatConstant) {\n          CreateNode(op, parent, op.FloatValue.ToString(CultureInfo.InvariantCulture));\n        }\n        else {\n          string label = GetOperandLabel(op);\n          CreateNode(op, parent, label);\n        }\n\n        visitedElements_[element] = op;\n        return op;\n      }\n      case InstructionIR instr: {\n        string label = GetInstructionLabel(instr);\n        CreateNode(instr, parent, label);\n        visitedElements_[element] = instr;\n\n        if (level >= options_.MaxExpressionDepth) {\n          return instr;\n        }\n\n        foreach (var sourceOp in instr.Sources) {\n          var result = PrintExpression(sourceOp, instr, level + 1, refFinder);\n          ConnectChildNode(instr, result);\n        }\n\n        foreach (var destOp in instr.Destinations) {\n          if (destOp.IsIndirection) {\n            var result = PrintExpression(destOp, instr, level + 1, refFinder);\n            ConnectChildNode(instr, result);\n          }\n        }\n\n        return instr;\n      }\n      default:\n        // Use the element text.\n        CreateNode(element, parent, \"<Undefined>\");\n        break;\n    }\n\n    visitedElements_[element] = element;\n    return element;\n  }\n\n  private void ConnectChildNode(InstructionIR instr, IRElement result) {\n    if (result != null) {\n      if (options_.PrintBottomUp) {\n        CreateEdge(instr, result);\n      }\n      else {\n        CreateEdge(result, instr);\n      }\n    }\n  }\n\n  private string GetOperandLabel(OperandIR op) {\n    if (!op.HasName) {\n      return \"<Untitled>\";\n    }\n\n    string label = op.Name;\n\n    if (options_.PrintSSANumbers) {\n      int? ssaNumber = ReferenceFinder.GetSSADefinitionId(op);\n\n      if (ssaNumber.HasValue) {\n        return $\"{label}<{ssaNumber.Value.ToString(CultureInfo.InvariantCulture)}>\";\n      }\n    }\n\n    if (op.IsAddress || op.IsLabelAddress) {\n      return $\"&{label}\";\n    }\n\n    if (op.IsIndirection) {\n      return $\"[{label}]\";\n    }\n\n    return label;\n  }\n\n  private string GetInstructionLabel(InstructionIR instr) {\n    string label = instr.OpcodeText.ToString();\n\n    if (instr.Destinations.Count > 0) {\n      var destOp = instr.Destinations[0];\n      string variableName = \"\";\n      string ssaNumber = \"\";\n\n      if (destOp.HasName && options_.PrintVariableNames) {\n        variableName = destOp.Name;\n      }\n\n      var ssaTag = destOp.GetTag<SSADefinitionTag>();\n\n      if (ssaTag != null && options_.PrintSSANumbers) {\n        ssaNumber = ssaTag.DefinitionId.ToString(CultureInfo.InvariantCulture);\n      }\n\n      if (!string.IsNullOrEmpty(variableName)) {\n        return !string.IsNullOrEmpty(ssaNumber) ?\n          $\"{variableName}<{ssaNumber}> = {label}\" :\n          $\"{variableName} = {label}\";\n      }\n\n      if (!string.IsNullOrEmpty(ssaNumber)) {\n        return $\"<{ssaNumber}> = {label}\";\n      }\n    }\n\n    return label;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/FlowGraphPrinter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic sealed class FlowGraphPrinter : GraphVizPrinter {\n  private const int LargeGraphThresholdMin = 500;\n  private const int LargeGraphThresholdMax = 1000;\n  private const string LargeGraphSettings = @\"\nmaxiter=8;\n        \";\n  private const string HugeGraphSettings = @\"\nmaxiter=4;\nmclimit=2;\nnslimit=2;\n        \";\n  private FunctionIR function_;\n  private Dictionary<string, TaggedObject> blockNameMap_;\n  private DominatorAlgorithm dominatorAlgo_;\n\n  public FlowGraphPrinter(FunctionIR function) {\n    function_ = function;\n    blockNameMap_ = new Dictionary<string, TaggedObject>();\n  }\n\n  public override Dictionary<string, TaggedObject> CreateNodeDataMap() {\n    if (blockNameMap_.Count > 0) {\n      return blockNameMap_;\n    }\n\n    var map = new Dictionary<string, TaggedObject>();\n\n    foreach (var block in function_.Blocks) {\n      map[GetNodeName(block.Id)] = block;\n    }\n\n    return map;\n  }\n\n  public override Dictionary<TaggedObject, List<TaggedObject>> CreateNodeDataGroupsMap() {\n    return null;\n  }\n\n  protected override string GetExtraSettings() {\n    int count = function_.Blocks.Count;\n\n    if (count > LargeGraphThresholdMin) {\n      return count < LargeGraphThresholdMax ? LargeGraphSettings : HugeGraphSettings;\n    }\n\n    return \"\";\n  }\n\n  protected override void PrintGraph(StringBuilder builder) {\n    foreach (var block in function_.Blocks) {\n      CreateNode(block, builder);\n    }\n\n    // Compute the dominator tree, used to mark loop back-edges and immediate dominators.\n    var cache = FunctionAnalysisCache.Get(function_);\n    dominatorAlgo_ = cache.GetDominators();\n\n    if (!dominatorAlgo_.IsValid) {\n      dominatorAlgo_ = null;\n    }\n\n    foreach (var block in function_.Blocks) {\n      foreach (var successorBlock in block.Successors) {\n        CreateEdge(block, successorBlock, builder);\n      }\n    }\n\n    string domEdges = PrintDominatorEdges(DominatorAlgorithmOptions.Dominators);\n    builder.AppendLine(domEdges);\n  }\n\n  private void CreateNode(BlockIR block, StringBuilder builder) {\n    string blockName = CreateNode(block.Id, block.Number.ToString(), builder, \"B\");\n    blockNameMap_[blockName] = block;\n  }\n\n  private void CreateEdge(BlockIR block1, BlockIR block2, StringBuilder builder) {\n    // A loop back-edge is an edge from a block to a block with a lower number,\n    // with the lower number block dominating the other block.\n    if (block2.Number <= block1.Number) {\n      bool accept = true;\n\n      if (dominatorAlgo_ != null) {\n        // Use dominator tree for the complete check, otherwise\n        // mark edge only using the block numbers, which is not always correct.\n        accept = dominatorAlgo_.Dominates(block1, block2);\n      }\n\n      if (accept) {\n        CreateEdgeWithStyle(block1.Id, block2.Id, \"dashed\", builder);\n        return;\n      }\n    }\n\n    CreateEdge(block1.Id, block2.Id, builder);\n  }\n\n  private void CreateEdgeWithStyle(BlockIR block1, BlockIR block2,\n                                   StringBuilder builder) {\n    CreateEdgeWithStyle(block1.Id, block2.Id, \"dotted\", builder);\n  }\n\n  private string PrintDominatorEdges(DominatorAlgorithmOptions options) {\n    if (dominatorAlgo_ == null) {\n      return \"\"; // Invalid CFG.\n    }\n\n    var builder = new StringBuilder();\n\n    foreach (var block in function_.Blocks) {\n      // Ignore blocks with single predecessor, immediate dom. is obvious.\n      if (block.Predecessors.Count <= 1) {\n        continue;\n      }\n\n      var immDomBlock = dominatorAlgo_.GetImmediateDominator(block);\n\n      if (immDomBlock != null) {\n        CreateEdgeWithStyle(block, immDomBlock, builder);\n      }\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/Graph.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic enum GraphKind {\n  FlowGraph,\n  DominatorTree,\n  PostDominatorTree,\n  ExpressionGraph,\n  CallGraph\n}\n\npublic sealed class Node {\n  //? Commented properties are currently not used.\n  public ReadOnlyMemory<char> Name { get; set; }\n  //public ReadOnlyMemory<char> Label { get; set; }\n  public string Label { get; set; }\n  //public ReadOnlyMemory<char> Style { get; set; }\n  //public ReadOnlyMemory<char> Shape { get; set; }\n  //public ReadOnlyMemory<char> BackgroundColor { get; set; }\n  //public ReadOnlyMemory<char> BorderColor { get; set; }\n  public double CenterX { get; set; }\n  public double CenterY { get; set; }\n  public double Width { get; set; }\n  public double Height { get; set; }\n  public TaggedObject Data { get; set; }\n  public bool DataIsElement => Data is IRElement;\n  public IRElement ElementData => Data as IRElement;\n  public List<Edge> InEdges { get; set; }\n  public List<Edge> OutEdges { get; set; }\n  public object Tag { get; set; }\n}\n\npublic sealed class Edge {\n  public enum EdgeKind {\n    Default,\n    Dotted,\n    Dashed\n  }\n\n  public Node NodeFrom { get; set; }\n  public Node NodeTo { get; set; }\n\n  //public ReadOnlyMemory<char> NodeNameFrom { get; set; }\n  //public ReadOnlyMemory<char> NodeNameTo { get; set; }\n  //public ReadOnlyMemory<char> Label { get; set; }\n  public double LabelX { get; set; }\n  public double LabelY { get; set; }\n  public Tuple<double, double>[] LinePoints { get; set; }\n  public EdgeKind Style { get; set; }\n  public ReadOnlyMemory<char> Color { get; set; }\n\n  public static EdgeKind GetEdgeStyle(ReadOnlyMemory<char> style) {\n    if (style.Span.Equals(\"dotted\", StringComparison.Ordinal)) {\n      return EdgeKind.Dotted;\n    }\n\n    if (style.Span.Equals(\"dashed\", StringComparison.Ordinal)) {\n      return EdgeKind.Dashed;\n    }\n\n    return EdgeKind.Default;\n  }\n}\n\npublic sealed class Graph {\n  public Graph(GraphKind kind) {\n    Kind = kind;\n    Nodes = new List<Node>();\n    Edges = new List<Edge>();\n    DataNodeMap = new Dictionary<TaggedObject, Node>();\n  }\n\n  public GraphKind Kind { get; set; }\n  public object GraphOptions { get; set; }\n  public List<Node> Nodes { get; set; }\n  public List<Edge> Edges { get; set; }\n  public double Width { get; set; }\n  public double Height { get; set; }\n  public bool IsEmpty => Nodes.Count == 0;\n\n  //? TODO: Move below out so it's easy to discard them and free memory for large graphs\n  public Dictionary<TaggedObject, Node> DataNodeMap { get; set; }\n  public Dictionary<TaggedObject, List<TaggedObject>> DataNodeGroupsMap { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/GraphPrinterFactory.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic static class GraphPrinterFactory {\n  public static GraphVizPrinter CreateInstance<T, U>(\n    GraphKind kind, T element, U options) where T : class where U : class {\n    if (typeof(T) == typeof(FunctionIR)) {\n      return kind switch {\n        GraphKind.FlowGraph => new FlowGraphPrinter(element as FunctionIR),\n        GraphKind.DominatorTree => new DominatorTreePrinter(element as FunctionIR,\n                                                            DominatorAlgorithmOptions.Dominators),\n        GraphKind.PostDominatorTree => new DominatorTreePrinter(element as FunctionIR,\n                                                                DominatorAlgorithmOptions.PostDominators),\n        _ => throw new ArgumentOutOfRangeException(nameof(kind), kind, null)\n      };\n    }\n\n    if (typeof(T) == typeof(IRElement)) {\n      switch (kind) {\n        case GraphKind.ExpressionGraph: {\n          return new ExpressionGraphPrinter(element as IRElement,\n                                            options as ExpressionGraphPrinterOptions);\n        }\n      }\n    }\n    else if (typeof(T) == typeof(IRTextSummary)) {\n      switch (kind) {\n        case GraphKind.CallGraph: {\n          return new CallGraphPrinter(element as CallGraph,\n                                      options as CallGraphPrinterOptions);\n        }\n      }\n    }\n\n    throw new NotImplementedException(\"Unsupported graph type\");\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/GraphvizPrinter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic class GraphVizPrinter {\n  private int subgraphIndex_;\n  private int nextInvisibleId_;\n\n  public virtual Dictionary<string, TaggedObject> CreateNodeDataMap() {\n    throw new NotImplementedException();\n  }\n\n  public virtual Dictionary<TaggedObject, List<TaggedObject>> CreateNodeDataGroupsMap() {\n    throw new NotImplementedException();\n  }\n\n  public string PrintGraph() {\n    // With extremely large graphs, the application can run out of memory,\n    // better show a error message than crashing it.\n    try {\n      var builder = new StringBuilder(1024 * 16);\n      builder.AppendLine(\"digraph {\");\n      builder.AppendLine(GetExtraSettings());\n      PrintGraph(builder);\n      builder.AppendLine(\"}\");\n      return builder.ToString();\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to generate Graphviz input: {ex.Message}\");\n      return null;\n    }\n  }\n\n  public string CreateGraph(CancelableTask task) {\n    return CreateGraph(PrintGraph(), task);\n  }\n\n  public string CreateGraph(string inputText, CancelableTask task) {\n    Trace.TraceInformation($\"Graphviz task {ObjectTracker.Track(task)}: Start\");\n    string inputFilePath;\n\n    try {\n      inputFilePath = Path.GetTempFileName();\n      File.WriteAllText(inputFilePath, inputText);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Graphviz task {ObjectTracker.Track(task)}: Failed writing GraphViz input file: {ex}\");\n      return null;\n    }\n\n    var outputText = new StringBuilder(1024 * 32);\n\n    var psi = new ProcessStartInfo(\"dot.exe\") {\n      Arguments = $\"-Tplain \\\"{inputFilePath}\\\"\",\n      UseShellExecute = false,\n      CreateNoWindow = true,\n      RedirectStandardError = false,\n      RedirectStandardOutput = true\n    };\n\n    try {\n      using var process = new Process {StartInfo = psi, EnableRaisingEvents = true};\n\n      process.OutputDataReceived += (sender, e) => {\n        outputText.AppendLine(e.Data);\n      };\n\n      process.Start();\n      process.BeginOutputReadLine();\n\n      do {\n        process.WaitForExit(100);\n\n        if (task.IsCanceled) {\n          Trace.TraceWarning($\"Graphviz task {ObjectTracker.Track(task)}: Canceled\");\n          process.CancelOutputRead();\n          process.Kill();\n          return null;\n        }\n      } while (!process.HasExited);\n\n      process.CancelOutputRead();\n\n      if (process.ExitCode != 0) {\n        // dot failed somehow, treat it as an error.\n        Trace.TraceError(\n          $\"Graphviz task {ObjectTracker.Track(task)}: GraphViz failed with error code: {process.ExitCode}\");\n        return null;\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Graphviz task {ObjectTracker.Track(task)}: Failed running GraphViz: {ex}\");\n      return null;\n    }\n\n#if !DEBUG\n    // Clean up temporary files.\n    try {\n      File.Delete(inputFilePath);\n    }\n    catch (Exception) { }\n#endif\n    Trace.TraceInformation($\"Graphviz task {ObjectTracker.Track(task)}: Completed\");\n    return outputText.ToString();\n  }\n\n  protected virtual void PrintGraph(StringBuilder builder) { }\n\n  protected virtual string GetExtraSettings() {\n    return \"\";\n  }\n\n  protected string CreateNode(int id, string label, StringBuilder builder,\n                              string labelPrefix = null) {\n    return CreateNode((ulong)id, label, builder, labelPrefix);\n  }\n\n  protected string CreateNode(ulong id, string label, StringBuilder builder,\n                              string labelPrefix = null) {\n    string nodeName = $\"n{id}\";\n\n    if (!string.IsNullOrEmpty(labelPrefix)) {\n      builder.AppendFormat(CultureInfo.InvariantCulture,\n                           \"{0}[shape=rectangle, label=\\\"{1}{2}\\\"];\\n\", nodeName,\n                           labelPrefix, label);\n    }\n    else {\n      builder.AppendFormat(CultureInfo.InvariantCulture,\n                           \"{0}[shape=rectangle, label=\\\"{1}\\\"];\\n\", nodeName, label);\n    }\n\n    return nodeName;\n  }\n\n  protected string CreateNodeWithMargins(int id, string label, StringBuilder builder,\n                                         double horizontalMargin, double verticalMargin,\n                                         string labelPrefix = null) {\n    return CreateNodeWithMargins((ulong)id, label, builder, horizontalMargin, verticalMargin, labelPrefix);\n  }\n\n  protected string CreateNodeWithMargins(ulong id, string label, StringBuilder builder,\n                                         double horizontalMargin, double verticalMargin,\n                                         string labelPrefix = null) {\n    string nodeName = $\"n{id}\";\n\n    if (!string.IsNullOrEmpty(labelPrefix)) {\n      builder.AppendFormat(CultureInfo.InvariantCulture,\n                           \"{0}[shape=rectangle, margin=\\\"{1},{2}\\\", label=\\\"{3}{4}\\\"];\\n\", nodeName,\n                           horizontalMargin, verticalMargin, labelPrefix, label);\n    }\n    else {\n      builder.AppendFormat(CultureInfo.InvariantCulture,\n                           \"{0}[shape=rectangle, margin=\\\"{1},{2}\\\", label=\\\"{3}\\\"];\\n\", nodeName,\n                           horizontalMargin, verticalMargin, label);\n    }\n\n    return nodeName;\n  }\n\n  protected string CreateInvisibleNode(StringBuilder builder) {\n    string nodeName = $\"inv{nextInvisibleId_++}\";\n    builder.AppendFormat(CultureInfo.InvariantCulture, $\"{nodeName}[shape=point,width=0,height=0];\\n\");\n    return nodeName;\n  }\n\n  protected string GetNodeName(ulong id) {\n    return $\"n{id}\";\n  }\n\n  protected string GetNodeName(int id) {\n    return $\"n{id}\";\n  }\n\n  protected void CreateEdge(string id1, string id2, StringBuilder builder) {\n    builder.AppendFormat(CultureInfo.InvariantCulture, \"{0} -> {1};\\n\", id1, id2);\n  }\n\n  protected void CreateEdge(ulong id1, string id2, StringBuilder builder) {\n    builder.AppendFormat(CultureInfo.InvariantCulture, \"n{0} -> {1};\\n\", id1, id2);\n  }\n\n  protected void CreateEdge(int id1, int id2, StringBuilder builder) {\n    CreateEdge((ulong)id1, (ulong)id2, builder);\n  }\n\n  protected void CreateEdge(ulong id1, ulong id2, StringBuilder builder) {\n    builder.AppendFormat(CultureInfo.InvariantCulture, \"n{0} -> n{1};\\n\", id1, id2);\n  }\n\n  protected void CreateEdge(ulong id1, ulong id2, string attribute,\n                            StringBuilder builder) {\n    builder.AppendFormat(CultureInfo.InvariantCulture, \"n{0} -> n{1} {2};\\n\", id1, id2, attribute);\n  }\n\n  protected void CreateEdgeWithStyle(int id1, int id2, string style,\n                                     StringBuilder builder) {\n    CreateEdgeWithStyle((ulong)id1, (ulong)id2, style, builder);\n  }\n\n  protected void CreateEdgeWithStyle(ulong id1, ulong id2, string style,\n                                     StringBuilder builder) {\n    builder.AppendFormat(CultureInfo.InvariantCulture, \"n{0} -> n{1}[style={2}];\\n\", id1, id2, style);\n  }\n\n  protected void StartSubgraph(int margin, StringBuilder builder) {\n    builder.AppendLine($\"subgraph cluster_{subgraphIndex_} {{\");\n    builder.AppendLine($\"margin={margin};\");\n    subgraphIndex_++;\n  }\n\n  protected void EndSubgraph(StringBuilder builder) {\n    builder.AppendLine(\"}\");\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Graph/GraphvizReader.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Runtime.CompilerServices;\nusing ProfileExplorer.Core.Collections;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Lexer;\n\nnamespace ProfileExplorer.Core.Graph;\n\npublic sealed class GraphvizReader {\n  private static readonly Dictionary<string, Keyword> keywordMap_ =\n    new() {\n      {\"graph\", Keyword.Graph},\n      {\"node\", Keyword.Node},\n      {\"edge\", Keyword.Edge},\n      {\"stop\", Keyword.Stop}\n    };\n  private static readonly StringTrie<Keyword> keywordTrie_ = new(keywordMap_);\n  private readonly Dictionary<string, Node> nodeMap_;\n  private readonly Dictionary<string, TaggedObject> dataNameMap_;\n  private Token current_;\n  private Graph graph_;\n  private GraphKind graphKind_;\n  private Lexer.Lexer lexer_;\n\n  public GraphvizReader(GraphKind kind, string text,\n                        Dictionary<string, TaggedObject> dataNameMap) {\n    graphKind_ = kind;\n    dataNameMap_ = dataNameMap;\n\n    nodeMap_ = new Dictionary<string, Node>();\n    lexer_ = new Lexer.Lexer();\n    lexer_.Initialize(text);\n    current_ = lexer_.NextToken();\n  }\n\n  public Graph ReadGraph() {\n    graph_ = new Graph(graphKind_);\n\n    if (!ExpectAndSkipKeyword(Keyword.Graph)) {\n      return null;\n    }\n\n    SkipToken(); // Ignored.\n\n    if (!ReadFloatNumber(out double width) || !ReadFloatNumber(out double height)) {\n      return null;\n    }\n\n    graph_.Width = width;\n    graph_.Height = height;\n\n    while (!IsEOF()) {\n      SkipToLineStart();\n\n      while (ExpectAndSkipKeyword(Keyword.Node)) {\n        var node = ReadNode();\n\n        if (node != null) {\n          graph_.Nodes.Add(node);\n        }\n\n        SkipToLineStart();\n      }\n\n      while (ExpectAndSkipKeyword(Keyword.Edge)) {\n        var edge = ReadEdge();\n\n        if (edge != null) {\n          graph_.Edges.Add(edge);\n        }\n\n        SkipToLineStart();\n      }\n\n      if (ExpectAndSkipKeyword(Keyword.Stop)) {\n        break;\n      }\n    }\n\n    return graph_;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool IsToken(TokenKind kind) {\n    return current_.Kind == kind;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private Keyword TokenKeyword() {\n    if (current_.IsIdentifier() &&\n        keywordTrie_.TryGetValue(TokenData(), out var keyword)) {\n      return keyword;\n    }\n\n    return Keyword.None;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private ReadOnlySpan<char> TokenStringData() {\n    return current_.Data.Span;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private ReadOnlyMemory<char> TokenData() {\n    return current_.Data;\n  }\n\n  private bool ReadTokenIntNumber(out int value) {\n    bool result = int.TryParse(TokenStringData(), NumberStyles.Any, CultureInfo.InvariantCulture, out value);\n\n    if (result) {\n      SkipToken();\n    }\n\n    return result;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool ReadFloatNumber(out double value) {\n    bool isNegated = false;\n\n    if (IsToken(TokenKind.Minus)) {\n      SkipToken();\n      isNegated = true;\n    }\n\n    bool result = double.TryParse(TokenStringData(), NumberStyles.Any, CultureInfo.InvariantCulture, out value);\n\n    if (result) {\n      SkipToken();\n    }\n\n    unchecked {\n      value = isNegated ? -value : value;\n    }\n\n    return result;\n  }\n\n  private bool ReadString(out ReadOnlyMemory<char> value) {\n    if (current_.IsIdentifier() || current_.IsString()) {\n      value = TokenData();\n      SkipToken();\n      return true;\n    }\n\n    value = default(ReadOnlyMemory<char>);\n    return false;\n  }\n\n  private bool ReadLabel(out ReadOnlyMemory<char> value) {\n    if (current_.IsIdentifier() || current_.IsString()) {\n      value = TokenData();\n      SkipToken();\n      return true;\n    }\n\n    // The Graphviz output doesn't seem to quote integers,\n    // which also include negative values.\n    if (IsToken(TokenKind.Minus)) {\n      SkipToken();\n    }\n\n    if (current_.IsNumber()) {\n      value = TokenData();\n      SkipToken();\n      return true;\n    }\n\n    value = default(ReadOnlyMemory<char>);\n    return false;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool ReadPoint(out double x, out double y) {\n    if (ReadFloatNumber(out x) && ReadFloatNumber(out y)) {\n      y = graph_.Height - y;\n      return true;\n    }\n\n    x = y = 0;\n    return false;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool IsString() {\n    return current_.IsIdentifier() || current_.IsString();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool NextTokenIs(TokenKind kind) {\n    return lexer_.PeekToken().Kind == kind;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private void SkipToken() {\n    current_ = lexer_.NextToken();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool ExpectAndSkipKeyword(Keyword keyword) {\n    if (TokenKeyword() == keyword) {\n      SkipToken();\n      return true;\n    }\n\n    return false;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool IsEOF() {\n    return current_.IsEOF();\n  }\n\n  private void SkipToLineEnd() {\n    while (!current_.IsLineEnd() && !current_.IsEOF()) {\n      SkipToken();\n    }\n  }\n\n  private void SkipToLineStart() {\n    SkipToLineEnd();\n    SkipToken();\n  }\n\n  private Node ReadNode() {\n    var node = new Node();\n\n    if (!ReadString(out var name) ||\n        !ReadPoint(out double x, out double y) ||\n        !ReadFloatNumber(out double width) ||\n        !ReadFloatNumber(out double height)) {\n      Trace.TraceError(\"Failed to parse Graphviz output node\");\n      return null;\n    }\n\n    node.Name = name;\n    node.CenterX = x;\n    node.CenterY = y;\n    node.Width = width;\n    node.Height = height;\n\n    if (!ReadLabel(out var label) ||\n        !ReadString(out var style) ||\n        !ReadString(out var shape) ||\n        !ReadString(out var borderColor) ||\n        !ReadString(out var backgroundColor)) {\n      Trace.TraceError(\"Failed to parse Graphviz output node properties\");\n      return null;\n    }\n\n    node.Label = label.ToString();\n    nodeMap_[name.ToString()] = node;\n\n    //? TODO: These commented-out values are currently not used anywhere.\n    //node.Style = style;\n    //node.Shape = shape;\n    //node.BorderColor = borderColor;\n    //node.BackgroundColor = backgroundColor;\n\n    // Associate with IR objects.\n    if (dataNameMap_.TryGetValue(name.ToString(), out var data)) {\n      node.Data = data;\n      graph_.DataNodeMap.Add(data, node);\n    }\n    else {\n      Trace.TraceError($\"Could not find Graphviz output block {name}\");\n    }\n\n    return node;\n  }\n\n  private Edge ReadEdge() {\n    var edge = new Edge();\n\n    if (!ReadString(out var fromNode) ||\n        !ReadString(out var toNode) ||\n        !ReadTokenIntNumber(out int pointCont)) {\n      return null;\n    }\n\n    //edge.NodeNameFrom = fromNode;\n    //edge.NodeNameTo = toNode;\n    edge.LinePoints = new Tuple<double, double>[pointCont];\n\n    for (int i = 0; i < pointCont; i++) {\n      if (!ReadPoint(out double x, out double y)) {\n        return null;\n      }\n\n      edge.LinePoints[i] = new Tuple<double, double>(x, y);\n    }\n\n    ReadOnlyMemory<char> label = default;\n    double labelX = 0;\n    double labelY = 0;\n\n    if (IsString() && NextTokenIs(TokenKind.Number)) {\n      // Edge has a label.\n      if (!ReadString(out label) || !ReadPoint(out labelX, out labelY)) {\n        return null;\n      }\n    }\n\n    if (!ReadString(out var style) || !ReadString(out var color)) {\n      return null;\n    }\n\n    //edge.Label = label;\n    edge.LabelX = labelX;\n    edge.LabelY = labelY;\n    edge.Style = Edge.GetEdgeStyle(style);\n    edge.Color = color;\n\n    // Associate with IR objects.\n    if (dataNameMap_.TryGetValue(fromNode.ToString(), out var fromBlock)) {\n      var node = graph_.DataNodeMap[fromBlock];\n      edge.NodeFrom = node;\n      node.OutEdges ??= new List<Edge>();\n      node.OutEdges.Add(edge);\n    }\n    else {\n      if (nodeMap_.TryGetValue(fromNode.ToString(), out var node)) {\n        edge.NodeFrom = node;\n        node.OutEdges ??= new List<Edge>();\n        node.OutEdges.Add(edge);\n      }\n      else {\n        Debug.Assert(false, $\"Could not find block {fromNode}\");\n        Trace.TraceError($\"Could not find Graphviz output block {fromNode}\");\n      }\n    }\n\n    if (dataNameMap_.TryGetValue(toNode.ToString(), out var toBlock)) {\n      var node = graph_.DataNodeMap[toBlock];\n      edge.NodeTo = node;\n      node.InEdges ??= new List<Edge>();\n      node.InEdges.Add(edge);\n    }\n    else {\n      if (nodeMap_.TryGetValue(toNode.ToString(), out var node)) {\n        edge.NodeTo = node;\n        node.InEdges ??= new List<Edge>();\n        node.InEdges.Add(edge);\n      }\n      else {\n        Debug.Assert(false, $\"Could not find block {fromNode}\");\n        Trace.TraceError($\"Could not find Graphviz output block {fromNode}\");\n      }\n    }\n\n    return edge;\n  }\n\n  private enum Keyword {\n    Graph,\n    Node,\n    Edge,\n    Stop,\n    None\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/ICompilerIRInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Parser;\n\nnamespace ProfileExplorer.Core;\n\npublic interface ICompilerIRInfo {\n  IRMode Mode { get; set; }\n  InstructionOffsetData InstructionOffsetData { get; }\n  IRSectionReader CreateSectionReader(string filePath, bool expectSectionHeaders = true);\n  IRSectionReader CreateSectionReader(byte[] textData, bool expectSectionHeaders = true);\n  IRSectionParser CreateSectionParser(IRParsingErrorHandler errorHandler, long functionSize = 0);\n  IRParsingErrorHandler CreateParsingErrorHandler();\n  IReachableReferenceFilter CreateReferenceFilter(FunctionIR function);\n  bool IsCopyInstruction(InstructionIR instr);\n  bool IsLoadInstruction(InstructionIR instr);\n  bool IsStoreInstruction(InstructionIR instr);\n  bool IsCallInstruction(InstructionIR instr);\n  bool IsIntrinsicCallInstruction(InstructionIR instr);\n  bool IsPhiInstruction(InstructionIR instr);\n  bool IsNOP(InstructionIR instr);\n  BlockIR GetIncomingPhiOperandBlock(InstructionIR phiInstr, int opIndex);\n  IRElement SkipCopyInstruction(InstructionIR instr);\n  OperandIR GetCallTarget(InstructionIR instr);\n  OperandIR GetBranchTarget(InstructionIR instr);\n  InstructionIR GetTransferInstruction(BlockIR block);\n  bool OperandsReferenceSameSymbol(OperandIR opA, OperandIR opB, bool exactCheck);\n}\n\npublic class InstructionOffsetData {\n  public int OffsetAdjustIncrement { get; set; }\n  public int MaxOffsetAdjust { get; set; }\n  public int InitialMultiplier { get; set; }\n\n  public static InstructionOffsetData ConstantSize(int size) {\n    return new InstructionOffsetData {\n      OffsetAdjustIncrement = size,\n      MaxOffsetAdjust = size,\n      InitialMultiplier = 1\n    };\n  }\n\n  public static InstructionOffsetData VariableSize(int minSize, int maxSize) {\n    return new InstructionOffsetData {\n      OffsetAdjustIncrement = minSize,\n      MaxOffsetAdjust = maxSize,\n      InitialMultiplier = 1\n    };\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/BlockIR.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic sealed class BlockIR : IRElement {\n  public BlockIR(IRElementId elementId, int number, FunctionIR parent) :\n    base(elementId) {\n    Number = number;\n    Parent = parent;\n    Tuples = new List<TupleIR>();\n    Successors = new List<BlockIR>();\n    Predecessors = new List<BlockIR>();\n  }\n\n  public int Number { get; set; }\n  public int IndexInFunction { get; set; }\n  public bool HasOddIndexInFunction => (IndexInFunction & 1) == 1;\n  public bool HasEvenIndexInFunction => (IndexInFunction & 1) == 0;\n  public List<TupleIR> Tuples { get; }\n  public List<BlockIR> Successors { get; }\n  public List<BlockIR> Predecessors { get; }\n  public BlockLabelIR Label { get; set; }\n  public FunctionIR Parent { get; set; }\n  public bool IsEmpty => Tuples == null || Tuples.Count == 0;\n  public int TupleCount => Tuples.Count;\n  public int InstructionCount => Instructions.Count();\n\n  public bool IsBranchBlock {\n    get {\n      var instr = TransferInstruction;\n      return instr?.IsBranch ?? false;\n    }\n  }\n\n  public bool IsSwitchBlock {\n    get {\n      var instr = TransferInstruction;\n      return instr?.IsSwitch ?? false;\n    }\n  }\n\n  public bool IsReturnBlock {\n    get {\n      var instr = TransferInstruction;\n\n      if (instr != null) {\n        return instr.IsReturn;\n      }\n\n      // Consider exit block to also be a return block.\n      return Equals(Parent.ExitBlock);\n    }\n  }\n\n  public bool HasLoopBackedge {\n    get {\n      return Predecessors.FindIndex(predBlock => predBlock.Number >= Number) != -1;\n    }\n  }\n\n  public TupleIR FirstTuple => IsEmpty ? null : Tuples[0];\n  public TupleIR LastTuple => IsEmpty ? null : Tuples[^1];\n  public bool HasLabel => Label != null;\n\n  public IEnumerable<TupleIR> TuplesBack {\n    get {\n      for (int i = Tuples.Count - 1; i >= 0; i--) {\n        yield return Tuples[i];\n      }\n    }\n  }\n\n  public InstructionIR FirstInstruction {\n    get {\n      if (IsEmpty) {\n        return null;\n      }\n\n      foreach (var t in Tuples) {\n        if (t.IsInstruction) {\n          return t as InstructionIR;\n        }\n      }\n\n      return null;\n    }\n  }\n\n  public InstructionIR LastInstruction {\n    get {\n      if (IsEmpty) {\n        return null;\n      }\n\n      for (int i = Tuples.Count - 1; i >= 0; i--) {\n        if (Tuples[i].IsInstruction) {\n          return Tuples[i] as InstructionIR;\n        }\n      }\n\n      return null;\n    }\n  }\n\n  public IEnumerable<InstructionIR> Instructions {\n    get {\n      foreach (var tuple in Tuples) {\n        if (tuple is InstructionIR instr) {\n          yield return instr;\n        }\n      }\n    }\n  }\n\n  public IEnumerable<InstructionIR> InstructionsBack {\n    get {\n      for (int i = Tuples.Count - 1; i >= 0; i--) {\n        if (Tuples[i] is InstructionIR instr) {\n          yield return instr;\n        }\n      }\n    }\n  }\n\n  public InstructionIR TransferInstruction {\n    get {\n      var instr = LastInstruction;\n\n      if (instr != null &&\n          (instr.IsBranch || instr.IsGoto || instr.IsSwitch || instr.IsReturn)) {\n        return instr;\n      }\n\n      return null;\n    }\n  }\n\n  public BlockIR BranchTargetBlock {\n    get {\n      var branchInstr = TransferInstruction;\n\n      if (branchInstr != null && branchInstr.IsBranch) {\n        foreach (var sourceOp in branchInstr.Sources) {\n          if (sourceOp.IsLabelAddress) {\n            var label = sourceOp.BlockLabelValue;\n            return label.Parent;\n          }\n        }\n      }\n\n      return null;\n    }\n  }\n\n  public void AddTuple(TupleIR tuple) {\n    tuple.IndexInBlock = Tuples.Count;\n    Tuples.Add(tuple);\n  }\n\n  public override void Accept(IRVisitor visitor) {\n    visitor.Visit(this);\n  }\n\n  public override string ToString() {\n    var result = new StringBuilder();\n    result.AppendLine($\"block number: {Number},  id: {Id}\");\n\n    if (Predecessors.Count > 0) {\n      result.AppendLine(\"o preds: \".Indent(2));\n\n      foreach (var block in Predecessors) {\n        result.Append($\"{block.Number} \");\n      }\n\n      result.AppendLine();\n    }\n\n    if (Successors.Count > 0) {\n      result.AppendLine(\"o succs: \".Indent(2));\n\n      foreach (var block in Successors) {\n        result.Append($\"{block.Number} \");\n      }\n\n      result.AppendLine();\n    }\n\n    result.AppendLine($\"o tuples: {Tuples.Count}\".Indent(2));\n\n    foreach (var tuple in Tuples) {\n      result.AppendLine($\"{tuple}\".Indent(2));\n    }\n\n    return result.ToString();\n  }\n\n  public override bool Equals(object obj) {\n    return obj is BlockIR iR && base.Equals(obj) && Number == iR.Number;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(base.GetHashCode(), Number);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/BlockLabelIR.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic sealed class BlockLabelIR : TupleIR {\n  private ReadOnlyMemory<char> label_;\n\n  public BlockLabelIR(IRElementId elementId, ReadOnlyMemory<char> name,\n                      BlockIR parent = null) : base(elementId, TupleKind.Label, parent) {\n    label_ = name;\n  }\n\n  public override bool HasName => true;\n  public override ReadOnlyMemory<char> NameValue => label_;\n\n  public override void Accept(IRVisitor visitor) {\n    visitor.Visit(this);\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is BlockLabelIR other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(base.GetHashCode(), label_);\n  }\n\n  public override string ToString() {\n    return $\"label name: {Name}\";\n  }\n\n  private bool Equals(BlockLabelIR other) {\n    return base.Equals(other) && label_.Equals(other.label_);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/FunctionIR.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic sealed class FunctionIR : IRElement {\n  private Dictionary<ulong, IRElement> elementMap_;\n  private int instructionCount_;\n  private int tupleCount_;\n  private string name_;\n\n  public FunctionIR(string name = null) : base(IRElementId.NewFunctionId()) {\n    ReturnType = TypeIR.GetUnknown();\n    Parameters = new List<OperandIR>();\n    Blocks = new List<BlockIR>();\n    name_ = name;\n  }\n\n  public FunctionIR(string name, TypeIR returnType) : this() {\n    name_ = name;\n    ReturnType = returnType;\n  }\n\n  public override bool HasName => !string.IsNullOrEmpty(Name);\n  public override ReadOnlyMemory<char> NameValue => name_.AsMemory();\n\n  public override string Name {\n    get => name_;\n    set => name_ = value;\n  }\n\n  public TypeIR ReturnType { get; set; }\n  public List<OperandIR> Parameters { get; }\n  public List<BlockIR> Blocks { get; }\n  public List<BlockIR> SortedBlocks { get; private set; }\n  public BlockIR EntryBlock => Blocks.Count > 0 ? Blocks[0] : null;\n  public BlockIR ExitBlock => Blocks.Count > 0 ? Blocks[^1] : null;\n  public int BlockCount => Blocks.Count;\n\n  public IEnumerable<IRElement> AllElements {\n    get {\n      foreach (var block in Blocks) {\n        yield return block;\n\n        foreach (var tuple in block.Tuples) {\n          yield return tuple;\n\n          if (!(tuple is InstructionIR instr)) {\n            continue;\n          }\n\n          foreach (var op in instr.Destinations) {\n            yield return op;\n          }\n\n          foreach (var op in instr.Sources) {\n            yield return op;\n          }\n        }\n      }\n    }\n  }\n\n  public IEnumerable<TupleIR> AllTuples {\n    get {\n      foreach (var block in Blocks) {\n        foreach (var tuple in block.Tuples) {\n          yield return tuple;\n        }\n      }\n    }\n  }\n\n  public IEnumerable<InstructionIR> AllInstructions {\n    get {\n      foreach (var block in Blocks) {\n        foreach (var tuple in block.Tuples) {\n          if (tuple is InstructionIR instr) {\n            yield return instr;\n          }\n        }\n      }\n    }\n  }\n\n  public int InstructionCount {\n    get {\n      if (instructionCount_ == 0) {\n        ForEachInstruction(instr => {\n          instructionCount_++;\n          return true;\n        });\n      }\n\n      return instructionCount_;\n    }\n    set => instructionCount_ = value;\n  }\n\n  public int TupleCount {\n    get {\n      if (tupleCount_ == 0) {\n        ForEachTuple(tuple => {\n          tupleCount_++;\n          return true;\n        });\n      }\n\n      return tupleCount_;\n    }\n    set => tupleCount_ = value;\n  }\n\n  public IRElement GetElementWithId(ulong id) {\n    BuildElementIdMap();\n    return elementMap_.TryGetValue(id, out var value) ? value : null;\n  }\n\n  public void BuildElementIdMap() {\n    if (elementMap_ != null) {\n      return;\n    }\n\n    elementMap_ = new Dictionary<ulong, IRElement>();\n\n    foreach (var block in Blocks) {\n      elementMap_[block.Id] = block;\n\n      foreach (var tuple in block.Tuples) {\n        elementMap_[tuple.Id] = tuple;\n\n        if (!(tuple is InstructionIR instr)) {\n          continue;\n        }\n\n        foreach (var op in instr.Destinations) {\n          elementMap_[op.Id] = op;\n        }\n\n        foreach (var op in instr.Sources) {\n          elementMap_[op.Id] = op;\n        }\n      }\n    }\n  }\n\n  public void AssignBlockIndices(bool setBlockNumbers = false) {\n    // Assign block index as they show up in the text,\n    // not RDFO or how the blocks where forward-referenced.\n    var blockList = new List<BlockIR>(Blocks.Count);\n    bool needsSorting = false;\n\n    for (int i = 0; i < Blocks.Count; i++) {\n      var block = Blocks[i];\n      blockList.Add(block);\n      needsSorting = i > 1 && !needsSorting &&\n                     blockList[^1].TextLocation >= block.TextLocation;\n    }\n\n    if (needsSorting) {\n      blockList.Sort((a, b) => a.TextLocation.CompareTo(b.TextLocation));\n    }\n\n    for (int i = 0; i < blockList.Count; i++) {\n      blockList[i].IndexInFunction = i;\n\n      if (setBlockNumbers) {\n        blockList[i].Number = i;\n      }\n    }\n\n    SortedBlocks = blockList;\n  }\n\n  public void ForEachElement(Func<IRElement, bool> action) {\n    foreach (var element in AllElements) {\n      if (!action(element)) {\n        return;\n      }\n    }\n  }\n\n  public void ForEachTuple(Func<TupleIR, bool> action) {\n    foreach (var tuple in AllTuples) {\n      if (!action(tuple)) {\n        return;\n      }\n    }\n  }\n\n  public void ForEachInstruction(Func<InstructionIR, bool> action) {\n    foreach (var instr in AllInstructions) {\n      if (!action(instr)) {\n        return;\n      }\n    }\n  }\n\n  public override void Accept(IRVisitor visitor) {\n    visitor.Visit(this);\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj);\n  }\n\n  public override int GetHashCode() {\n    return Name?.GetHashCode(StringComparison.Ordinal) ?? 0;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/IRElement.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic class IRElement : TaggedObject {\n  public IRElement() {\n    // Used by object pool allocation only.\n  }\n\n  public IRElement(IRElementId elementId) {\n    Id = elementId;\n    TextLocation = default(TextLocation);\n    TextLength = 0;\n    Tags = null;\n  }\n\n  public IRElement(TextLocation location, int length) {\n    TextLocation = location;\n    TextLength = length;\n    Tags = null;\n  }\n\n  public virtual bool HasName => false;\n  public virtual ReadOnlyMemory<char> NameValue => null;\n\n  public virtual string Name {\n    get => NameValue.ToString();\n    set => throw new NotImplementedException();\n  }\n\n  public ulong Id { get; set; }\n  public TextLocation TextLocation { get; set; }\n  public int TextLength { get; set; }\n  public ulong BlockId => IRElementId.FromLong(Id).BlockId;\n  public ulong TupleId => IRElementId.FromLong(Id).TupleId;\n  public ulong OperandId => IRElementId.FromLong(Id).OperandId;\n\n  public TupleIR ParentTuple {\n    get {\n      return this switch {\n        TupleIR _   => this as TupleIR,\n        OperandIR _ => ((OperandIR)this).Parent,\n        _           => null\n      };\n    }\n  }\n\n  public InstructionIR ParentInstruction {\n    get {\n      return this switch {\n        InstructionIR _ => this as InstructionIR,\n        OperandIR _     => ((OperandIR)this).Parent as InstructionIR,\n        _               => null\n      };\n    }\n  }\n\n  public BlockIR ParentBlock {\n    get {\n      if (this is BlockIR) {\n        return this as BlockIR;\n      }\n\n      return ParentTuple?.Parent;\n    }\n  }\n\n  public FunctionIR ParentFunction {\n    get {\n      var block = ParentBlock;\n      return block?.Parent;\n    }\n  }\n\n  public virtual void Accept(IRVisitor visitor) {\n    visitor.Visit(this);\n  }\n\n  public void SetTextRange(TextLocation location, int length) {\n    TextLocation = location;\n    TextLength = length;\n  }\n\n  public ReadOnlyMemory<char> GetText(string source) {\n    return source.AsMemory(TextLocation.Offset, TextLength);\n  }\n\n  public ReadOnlyMemory<char> GetText(ReadOnlyMemory<char> source) {\n    return source.Slice(TextLocation.Offset, TextLength);\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is IRElement other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return Id.GetHashCode();\n  }\n\n  protected bool Equals(IRElement other) {\n    return Id == other.Id;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/IRElementId.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.Core.IR;\n\npublic class IRElementId {\n  public ushort BlockId;\n  public ushort OperandId;\n  public uint TupleId;\n\n  public static implicit operator ulong(IRElementId elementId) {\n    return elementId.ToLong();\n  }\n\n  public static IRElementId NewFunctionId() {\n    return new IRElementId {\n      BlockId = 0xFFFF,\n      TupleId = 0xFFFFFFFF,\n      OperandId = 0xFFFF\n    };\n  }\n\n  public static IRElementId FromLong(ulong value) {\n    return new IRElementId {\n      OperandId = (ushort)((value & 0xFFFF) >> 0),\n      TupleId = (uint)((value & 0xFFFFFFFF0000) >> 32),\n      BlockId = (ushort)((value & 0xFFFF000000000000) >> 48)\n    };\n  }\n\n  public static ulong ToLong(ushort blockId, uint tupleId = 0, ushort operandId = 0) {\n    return (ulong)blockId << 48 | (ulong)tupleId << 32 | operandId;\n  }\n\n  public IRElementId NewBlock(int blockId) {\n    return NewBlock((ushort)blockId);\n  }\n\n  public IRElementId NextTuple() {\n    TupleId++;\n    OperandId = 0;\n    return this;\n  }\n\n  public IRElementId NextOperand() {\n    OperandId++;\n    return this;\n  }\n\n  public ulong ToLong() {\n    return ToLong(BlockId, TupleId, OperandId);\n  }\n\n  private IRElementId NewBlock(ushort blockId) {\n    BlockId = blockId;\n    TupleId = 0;\n    OperandId = 0;\n    return this;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/IRPrinter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Text;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic class IRPrinter {\n  private StringBuilder builder_;\n  private FunctionIR function_;\n\n  public IRPrinter(FunctionIR function) {\n    function_ = function;\n  }\n\n  public string Print() {\n    builder_ = new StringBuilder();\n    PrintFunctionStart();\n\n    foreach (var block in function_.Blocks) {\n      PrintBlock(block);\n    }\n\n    PrintFunctionEnd();\n    return builder_.ToString();\n  }\n\n  private void PrintFunctionStart() {\n    builder_.Append($\"func {function_.Name}(\");\n    bool needsComma = false;\n\n    foreach (var param in function_.Parameters) {\n      if (needsComma) {\n        builder_.Append(\", \");\n      }\n      else {\n        needsComma = true;\n      }\n\n      PrintOperand(param, true);\n    }\n\n    builder_.AppendLine($\") -> {function_.ReturnType}:\");\n  }\n\n  private void PrintFunctionEnd() {\n    builder_.AppendLine(\"// function end\");\n  }\n\n  private void PrintBlock(BlockIR block) {\n    builder_.Append($\"block {{#{block.IndexInFunction}, B{block.Number}}}:\");\n\n    builder_.Append(\" P\");\n    block.Predecessors.ForEach(p => builder_.Append($\" {p.Number}\"));\n    builder_.Append(\", S\");\n    block.Successors.ForEach(p => builder_.Append($\" {p.Number}\"));\n    builder_.AppendLine();\n\n    foreach (var tuple in block.Tuples) {\n      PrintTuple(tuple);\n      builder_.AppendLine();\n    }\n  }\n\n  private void PrintTuple(TupleIR tuple) {\n    if (tuple.Kind != TupleKind.Label) {\n      builder_.Append(\"    \");\n    }\n\n    switch (tuple.Kind) {\n      case TupleKind.Instruction: {\n        PrintInstruction((InstructionIR)tuple);\n        break;\n      }\n      case TupleKind.Label: {\n        builder_.Append($\"  label {tuple.Name}:\");\n        break;\n      }\n      case TupleKind.Exception: {\n        builder_.Append(\"exception\");\n        break;\n      }\n      case TupleKind.Metadata: {\n        builder_.Append(\"metadata\");\n        break;\n      }\n      case TupleKind.Other: {\n        builder_.Append(\"other\");\n        break;\n      }\n    }\n\n    builder_.Append($\"  | #{tuple.IndexInBlock}, B{tuple.ParentBlock.Number}\");\n    builder_.Append($\"  | {tuple.TextLocation}, len: {tuple.TextLength}\");\n  }\n\n  private void PrintInstruction(InstructionIR instr) {\n    bool needsComma = false;\n\n    foreach (var destOp in instr.Destinations) {\n      if (needsComma) {\n        builder_.Append(\", \");\n      }\n      else {\n        needsComma = true;\n      }\n\n      PrintOperand(destOp, true);\n    }\n\n    if (instr.Destinations.Count > 0) {\n      builder_.Append(\" = \");\n    }\n\n    if (instr.IsBranch) {\n      builder_.Append(\"branch \");\n    }\n    else if (instr.IsGoto) {\n      builder_.Append(\"goto \");\n    }\n    else if (instr.IsSwitch) {\n      builder_.Append(\"switch \");\n    }\n    else if (instr.IsReturn) {\n      builder_.Append(\"return \");\n    }\n\n    builder_.Append($\"{instr.OpcodeText} \");\n    needsComma = false;\n\n    foreach (var sourceOp in instr.Sources) {\n      if (needsComma) {\n        builder_.Append(\", \");\n      }\n      else {\n        needsComma = true;\n      }\n\n      PrintOperand(sourceOp);\n    }\n  }\n\n  private void PrintOperand(OperandIR op, bool printKind = false) {\n    string result = op.Kind switch {\n      OperandKind.Variable => printKind\n        ? $\"var {op.NameValue}.{op.Type}\"\n        : $\"{op.NameValue}.{op.Type}\",\n      OperandKind.Temporary => printKind\n        ? $\"temp {op.NameValue}.{op.Type}\"\n        : $\"{op.NameValue}.{op.Type}\",\n      OperandKind.IntConstant => printKind\n        ? $\"intconst {op.IntValue}.{op.Type}\"\n        : $\"{op.IntValue}.{op.Type}\",\n      OperandKind.FloatConstant => printKind\n        ? $\"floatconst {op.FloatValue}.{op.Type}\"\n        : $\"{op.FloatValue}.{op.Type}\",\n      OperandKind.Indirection => printKind\n        ? $\"indir [{op.Value}.{op.Type}]\"\n        : $\"[{op.Value}.{op.Type}]\",\n      OperandKind.Address => printKind\n        ? $\"address &{op.NameValue}.{op.Type}\"\n        : $\"&{op.NameValue}.{op.Type}\",\n      OperandKind.LabelAddress => printKind\n        ? string.Format(\"label &{0}.{1}\", op.NameValue)\n        : $\"&{op.NameValue}\",\n      OperandKind.Other => \"other\",\n      _                 => \"\"\n    };\n\n    var ssaTag = op.GetTag<ISSAValue>();\n\n    if (ssaTag != null) {\n      result += $\"<{ssaTag.DefinitionId}>\";\n    }\n\n    builder_.Append(result);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/IRVisitor.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.Core.IR;\n\npublic interface IRVisitor {\n  void Visit(IRElement value);\n  void Visit(OperandIR value);\n  void Visit(TupleIR value);\n  void Visit(BlockLabelIR value);\n  void Visit(InstructionIR value);\n  void Visit(BlockIR value);\n  void Visit(FunctionIR value);\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/ITag.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.Core.IR;\n\npublic interface ITag {\n  string Name { get; }\n  TaggedObject Owner { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/InstructionIR.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic enum InstructionKind {\n  Unary,\n  Binary,\n  Branch,\n  Goto,\n  Switch,\n  Phi,\n  Call,\n  Return,\n  Exception,\n  Other\n}\n\npublic sealed class InstructionIR : TupleIR {\n  public InstructionIR(IRElementId elementId, InstructionKind kind, BlockIR parent) :\n    base(elementId, TupleKind.Instruction, parent) {\n    Kind = kind;\n    Sources = new List<OperandIR>(1); // Usually 1 destination.\n    Destinations = new List<OperandIR>(2); // Usually at most 2 sources.\n  }\n\n  public new InstructionKind Kind { get; set; }\n  public object Opcode { get; set; }\n  public ReadOnlyMemory<char> OpcodeText { get; set; }\n  public TextLocation OpcodeLocation { get; set; }\n  public List<OperandIR> Sources { get; }\n  public List<OperandIR> Destinations { get; }\n  public bool IsUnary => Kind == InstructionKind.Unary;\n  public bool IsBinary => Kind == InstructionKind.Binary;\n  public bool IsBranch => Kind == InstructionKind.Branch;\n  public bool IsGoto => Kind == InstructionKind.Goto;\n  public bool IsSwitch => Kind == InstructionKind.Switch;\n  public bool IsCall => Kind == InstructionKind.Call;\n  public bool IsReturn => Kind == InstructionKind.Return;\n\n  public T OpcodeAs<T>() where T : Enum {\n    return (T)Opcode;\n  }\n\n  public bool OpcodeIs<T>(T value) where T : Enum {\n    return Opcode != null && ((T)Opcode).Equals(value);\n  }\n\n  public override void Accept(IRVisitor visitor) {\n    visitor.Visit(this);\n  }\n\n  public override string ToString() {\n    var builder = new StringBuilder();\n    builder.AppendLine($\"instr kind: {Kind}, opcode: {OpcodeText} ({Opcode}), id: {Id}\");\n\n    for (int i = 0; i < Destinations.Count; i++) {\n      builder.AppendLine($\"o dest {i}: {Destinations[i]}\".Indent(2));\n    }\n\n    for (int i = 0; i < Sources.Count; i++) {\n      builder.AppendLine($\"o src {i}: {Sources[i]}\".Indent(2));\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/OperandIR.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic enum OperandKind {\n  Variable,\n  Temporary,\n  IntConstant,\n  FloatConstant,\n  Indirection,\n  Address,\n  LabelAddress,\n  Other\n}\n\npublic enum OperandRole {\n  Source,\n  Destination,\n  Parameter,\n  Other\n}\n\npublic sealed class OperandIR : IRElement {\n  public OperandIR() {\n    // Used by object pool allocation only.\n  }\n\n  public OperandIR(IRElementId elementId, OperandKind kind, TypeIR type, TupleIR parent)\n    : base(elementId.NextOperand()) {\n    Kind = kind;\n    Type = type;\n    Parent = parent;\n    Value = null;\n  }\n\n  public OperandKind Kind { get; set; }\n  public OperandRole Role { get; set; }\n  public bool IsSourceOperand => Role == OperandRole.Source;\n  public bool IsDestinationOperand => Role == OperandRole.Destination;\n  public bool IsParameterOperand => Role == OperandRole.Parameter;\n  public TypeIR Type { get; set; }\n  public TupleIR Parent { get; set; }\n  public object Value { get; set; }\n  public bool IsVariable => Kind == OperandKind.Variable;\n  public bool IsTemporary => Kind == OperandKind.Temporary;\n  public bool IsConstant =>\n    Kind == OperandKind.IntConstant || Kind == OperandKind.FloatConstant;\n  public bool IsIntConstant => Kind == OperandKind.IntConstant;\n  public bool IsFloatConstant => Kind == OperandKind.FloatConstant;\n  public bool IsAddress => Kind == OperandKind.Address;\n  public bool IsLabelAddress => Kind == OperandKind.LabelAddress;\n  public bool IsIndirection => Kind == OperandKind.Indirection;\n\n  public long IntValue {\n    get {\n      Debug.Assert(Kind == OperandKind.IntConstant);\n      Debug.Assert(Value is long);\n      return (long)Value;\n    }\n  }\n\n  public double FloatValue {\n    get {\n      Debug.Assert(Kind == OperandKind.FloatConstant);\n      Debug.Assert(Value is double);\n      return (double)Value;\n    }\n  }\n\n  public override bool HasName =>\n    Kind == OperandKind.Variable ||\n    Kind == OperandKind.Temporary ||\n    Kind == OperandKind.Address ||\n    Kind == OperandKind.LabelAddress;\n\n  public override ReadOnlyMemory<char> NameValue {\n    get {\n      Debug.Assert(HasName);\n\n      return Kind switch {\n        OperandKind.Address when Value is OperandIR ir => ir.NameValue,\n        OperandKind.LabelAddress                       => BlockLabelValue.NameValue,\n        _                                              => (ReadOnlyMemory<char>)Value\n      };\n    }\n  }\n\n  public OperandIR IndirectionBaseValue {\n    get {\n      Debug.Assert(Kind == OperandKind.Indirection);\n      Debug.Assert(Value is OperandIR);\n      return (OperandIR)Value;\n    }\n  }\n\n  public BlockLabelIR BlockLabelValue {\n    get {\n      Debug.Assert(Kind == OperandKind.LabelAddress);\n      Debug.Assert(Value is BlockLabelIR);\n      return (BlockLabelIR)Value;\n    }\n  }\n\n  public override void Accept(IRVisitor visitor) {\n    visitor.Visit(this);\n  }\n\n  public override string ToString() {\n    string result = Kind switch {\n      OperandKind.Variable      => $\"var {Value}.{Type}\",\n      OperandKind.Temporary     => $\"temp {Value}.{Type}\",\n      OperandKind.IntConstant   => $\"intconst {Value}.{Type}\",\n      OperandKind.FloatConstant => $\"floatconst {Value}.{Type}\",\n      OperandKind.Indirection   => $\"indir {Value}.{Type}\",\n      OperandKind.Address       => $\"address {Value}.{Type}\",\n      OperandKind.LabelAddress  => $\"label {Value}.{Type}\",\n      OperandKind.Other         => \"other\",\n      _                         => \"<unexpected>\"\n    };\n\n    var ssaTag = GetTag<ISSAValue>();\n\n    if (ssaTag != null) {\n      result += $\"<{ssaTag.DefinitionId}>\";\n    }\n\n    return $\"{result}, id: {Id}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/RegisterIR.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic sealed class RegisterIR {\n  public List<RegisterIR> Subregisters;\n\n  public RegisterIR(string name, object register, int bitOffset, int bitSize) {\n    Register = register;\n    Name = name;\n    BitOffset = bitOffset;\n    BitSize = bitSize;\n    Parent = null;\n    Subregisters = new List<RegisterIR>();\n  }\n\n  public RegisterIR(string name, object register, int bitOffset, int bitSize,\n                    params RegisterIR[] subregisters) :\n    this(name, register, bitOffset, bitSize) {\n    foreach (var subreg in subregisters) {\n      subreg.Parent = this;\n      Subregisters.Add(subreg);\n    }\n  }\n\n  public object Register { get; set; }\n  public string Name { get; set; }\n  public int BitOffset { get; set; }\n  public int BitSize { get; set; }\n  public RegisterIR Parent { get; set; }\n\n  public RegisterIR Root {\n    get {\n      var current = this;\n      var parent = Parent;\n\n      while (parent != null) {\n        current = parent;\n        parent = current.Parent;\n      }\n\n      return current;\n    }\n  }\n\n  public bool IsSubregister => Parent != null;\n  public bool HasSubregisters => Subregisters.Count > 0;\n\n  public T RegisterAs<T>() where T : Enum {\n    return (T)Register;\n  }\n\n  public bool RegisterIs<T>(T value) where T : Enum {\n    return Register != null && ((T)Register).Equals(value);\n  }\n\n  public bool OverlapsWith(RegisterIR other) {\n    //? TODO: Also check bit range overlap\n    return other.Root == Root;\n  }\n\n  public bool CompletelyOverlapsWith(RegisterIR other) {\n    //? TODO\n    return false;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is RegisterIR iR &&\n           EqualityComparer<object>.Default.Equals(Register, iR.Register) &&\n           BitOffset == iR.BitOffset &&\n           BitSize == iR.BitSize;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Register, BitOffset, BitSize);\n  }\n\n  public override string ToString() {\n    return $\"{Name}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/RegisterTable.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic class RegisterTable {\n  private Dictionary<string, RegisterIR> registerMap_;\n  private List<RegisterIR> virtualRegisters_;\n\n  public RegisterTable() {\n    registerMap_ = new Dictionary<string, RegisterIR>();\n    virtualRegisters_ = new List<RegisterIR>();\n  }\n\n  public RegisterIR this[string name] {\n    get => GetRegister(name);\n    set => throw new NotImplementedException();\n  }\n\n  public RegisterIR GetRegister(string name) {\n    if (registerMap_.TryGetValue(name, out var register)) {\n      return register;\n    }\n\n    //? check if virtual reg\n    return null;\n  }\n\n  public RegisterIR GetRegister(ReadOnlyMemory<char> name) {\n    return null;\n  }\n\n  public void AddRegisterAlias(string registerAlias, string register) {\n    registerMap_[registerAlias] = registerMap_[register];\n  }\n\n  public void AddRegisterAlias(string registerAlias, RegisterIR register) {\n    registerMap_[registerAlias] = register;\n  }\n\n  protected void PopulateRegisterTable(RegisterIR[] registers) {\n    foreach (var register in registers) {\n      PupulateRegisterClass(register);\n    }\n  }\n\n  private void PupulateRegisterClass(RegisterIR register) {\n    registerMap_[register.Name] = register;\n\n    foreach (var subreg in register.Subregisters) {\n      PupulateRegisterClass(subreg);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/TaggedObject.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic class TaggedObject {\n  public List<ITag> Tags { get; set; }\n\n  public void AddTag(ITag tag) {\n    Tags ??= new List<ITag>();\n    tag.Owner = this;\n    Tags.Add(tag);\n  }\n\n  public T GetTag<T>() where T : class {\n    if (Tags != null) {\n      foreach (var tag in Tags) {\n        if (tag is T value) {\n          return value;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  public bool HasTag<T>() where T : class {\n    return GetTag<T>() != null;\n  }\n\n  public bool TryGetTag<T>(out T result) where T : class {\n    result = GetTag<T>();\n    return result != null;\n  }\n\n  public T GetOrAddTag<T>() where T : class, new() {\n    var result = GetTag<T>();\n\n    if (result != null) {\n      return result;\n    }\n\n    var tag = new T();\n    AddTag(tag as ITag);\n    return tag;\n  }\n\n  public bool RemoveTag<T>() where T : class {\n    if (Tags != null) {\n      return Tags.RemoveAll(tag => tag is T) > 0;\n    }\n\n    return false;\n  }\n\n  public override string ToString() {\n    if (Tags == null || Tags.Count == 0) {\n      return \"\";\n    }\n\n    var builder = new StringBuilder();\n    builder.AppendLine($\"{Tags.Count} tags:\");\n\n    foreach (var tag in Tags) {\n      builder.AppendLine($\"  o {tag}\".Indent(4));\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/Tags/AssemblyMetadataTag.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ProfileExplorer.Core.IR.Tags;\n\npublic sealed class AssemblyMetadataTag : ITag {\n  public AssemblyMetadataTag() {\n    AddressToElementMap = new Dictionary<long, IRElement>();\n    OffsetToElementMap = new Dictionary<long, IRElement>();\n    ElementToOffsetMap = new Dictionary<IRElement, long>();\n    ElementSizeMap = new Dictionary<IRElement, int>();\n  }\n\n  public Dictionary<long, IRElement> AddressToElementMap { get; set; }\n  public Dictionary<long, IRElement> OffsetToElementMap { get; set; }\n  public Dictionary<IRElement, long> ElementToOffsetMap { get; set; }\n  public Dictionary<IRElement, int> ElementSizeMap { get; set; }\n  public long FunctionSize { get; set; }\n  public string Name => \"Address metadata\";\n  public TaggedObject Owner { get; set; }\n\n  public void EnsureCapacity(int length) {\n    AddressToElementMap.EnsureCapacity(length);\n    OffsetToElementMap.EnsureCapacity(length);\n    ElementToOffsetMap.EnsureCapacity(length);\n    ElementSizeMap.EnsureCapacity(length);\n  }\n\n  public override string ToString() {\n    var builder = new StringBuilder();\n\n    foreach (var pair in OffsetToElementMap) {\n      builder.Append($\"{pair.Key} = {pair.Value}\");\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/Tags/LoopTag.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Analysis;\n\nnamespace ProfileExplorer.Core.IR.Tags;\n\npublic sealed class LoopBlockTag : ITag {\n  public LoopBlockTag(Loop parentLoop, int nestingLevel = 0) {\n    Loop = parentLoop;\n    NestingLevel = nestingLevel;\n  }\n\n  public Loop Loop { get; set; }\n  public int NestingLevel { get; set; }\n  public string Name => \"Loop block\";\n  public TaggedObject Owner { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/Tags/NotesTag.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core.IR.Tags;\n\npublic class NotesTag : ITag {\n  public NotesTag() {\n    Title = \"\";\n    Notes = new List<string>();\n  }\n\n  public NotesTag(string title) : this() {\n    Title = title;\n  }\n\n  public string Title { get; set; }\n  public List<string> Notes { get; set; }\n  public string Name => \"Notes\";\n  public TaggedObject Owner { get; set; }\n\n  public override bool Equals(object obj) {\n    return obj is NotesTag tag &&\n           Title == tag.Title &&\n           EqualityComparer<List<string>>.Default.Equals(Notes, tag.Notes);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Title, Notes);\n  }\n\n  public override string ToString() {\n    return $\"Notes title: {Title}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/Tags/RegisterTag.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core.IR.Tags;\n\npublic sealed class RegisterTag : ITag {\n  public RegisterTag(RegisterIR register, TaggedObject owner) {\n    Register = register;\n    Owner = owner;\n  }\n\n  public RegisterIR Register { get; set; }\n  public string Name => \"Register\";\n  public TaggedObject Owner { get; set; }\n\n  public override bool Equals(object obj) {\n    return obj is RegisterTag tag &&\n           EqualityComparer<RegisterIR>.Default.Equals(Register, tag.Register);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Register);\n  }\n\n  public override string ToString() {\n    return $\"Register: {Register}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/Tags/SSATags.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ProfileExplorer.Core.IR.Tags;\n\npublic interface ISSAValue {\n  int DefinitionId { get; set; }\n  OperandIR DefinitionOperand { get; }\n  TupleIR DefinitionTuple { get; }\n  InstructionIR DefinitionInstruction { get; }\n}\n\npublic sealed class SSAUseTag : ITag, ISSAValue {\n  public SSAUseTag(int definitionId, SSADefinitionTag definition) {\n    DefinitionId = definitionId;\n    Definition = definition;\n  }\n\n  public SSADefinitionTag Definition { get; set; }\n  public IRElement OwnerElement => (IRElement)Owner;\n  public InstructionIR OwnerInstruction => OwnerElement.ParentInstruction;\n  public int DefinitionId { get; set; }\n  public OperandIR DefinitionOperand => Definition?.Owner as OperandIR;\n  public TupleIR DefinitionTuple => DefinitionOperand.ParentTuple;\n  public InstructionIR DefinitionInstruction => DefinitionTuple as InstructionIR;\n  public string Name => \"SSA use-definition link\";\n  public TaggedObject Owner { get; set; } // Source operand.\n\n  public override bool Equals(object obj) {\n    return obj is SSAUseTag tag && DefinitionId == tag.DefinitionId;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(DefinitionId);\n  }\n\n  public override string ToString() {\n    return $\"SSA UD-link: {DefinitionId}\";\n  }\n}\n\npublic sealed class SSADefinitionTag : ITag, ISSAValue {\n  public SSADefinitionTag(int defId) {\n    DefinitionId = defId;\n    Users = new List<SSAUseTag>();\n  }\n\n  public List<SSAUseTag> Users { get; }\n  public bool HasUsers => Users.Count > 0;\n  public bool HasSingleUser => Users.Count == 1;\n  public IRElement OwnerElement => (IRElement)Owner;\n  public int DefinitionId { get; set; }\n  public OperandIR DefinitionOperand => Owner as OperandIR;\n  public TupleIR DefinitionTuple => ((IRElement)Owner).ParentTuple;\n  public InstructionIR DefinitionInstruction => ((IRElement)Owner).ParentTuple as InstructionIR;\n  public string Name => \"SSA definition\";\n  public TaggedObject Owner { get; set; } // Destination operand.\n\n  public override bool Equals(object obj) {\n    return obj is SSADefinitionTag tag && DefinitionId == tag.DefinitionId;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(DefinitionId);\n  }\n\n  public override string ToString() {\n    var builder = new StringBuilder();\n    builder.AppendLine($\"SSA definition: {DefinitionId}\");\n    builder.AppendLine($\"  - parent: {((IRElement)Owner).Id}\");\n    builder.AppendLine($\"  - users: {Users.Count}\");\n\n    foreach (var user in Users) {\n      builder.AppendLine($\"    - {((IRElement)user.Owner).Id}\");\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/Tags/SourceLocationTag.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ProfileExplorer.Core.IR.Tags;\n\npublic sealed class SourceLocationTag : ITag {\n  public SourceLocationTag() { }\n\n  public SourceLocationTag(int line, int column) {\n    Line = line;\n    Column = column;\n  }\n\n  public List<SourceStackFrame> Inlinees { get; set; }\n  public int Line { get; set; }\n  public int Column { get; set; }\n  public string FilePath { get; set; }\n  public bool HasInlinees => Inlinees != null && Inlinees.Count > 0;\n\n  public List<SourceStackFrame> InlineesReversed {\n    get {\n      var clone = new List<SourceStackFrame>(Inlinees);\n      clone.Reverse();\n      return clone;\n    }\n  }\n\n  public string Name => \"Source location\";\n  public TaggedObject Owner { get; set; }\n\n  public void AddInlinee(string function, string filePath, int line, int column) {\n    Inlinees ??= new List<SourceStackFrame>();\n    Inlinees.Add(new SourceStackFrame(function, filePath, line, column));\n  }\n\n  public void AddInlinee(SourceStackFrame inlinee) {\n    Inlinees ??= new List<SourceStackFrame>();\n    Inlinees.Add(inlinee);\n  }\n\n  public void Reset() {\n    Inlinees = null;\n    Line = 0;\n    Column = 0;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is SourceLocationTag tag && Line == tag.Line && Column == tag.Column;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Line, Column);\n  }\n\n  public override string ToString() {\n    var builder = new StringBuilder();\n    builder.Append($\"source location: {Line};{Column}\");\n\n    if (Inlinees != null) {\n      builder.AppendLine($\"\\n  inlinees: {Inlinees.Count}\");\n\n      foreach (var item in Inlinees) {\n        builder.AppendLine($\"    {item.Line};{item.Column}: {item.Function}\");\n      }\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/Tags/SourceStackTrace.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.IR.Tags;\n\npublic sealed class SourceStackFrame : IEquatable<SourceStackFrame> {\n  public SourceStackFrame(string function, string filePath, int line, int column) {\n    Function = function;\n    FilePath = filePath;\n    Line = line;\n    Column = column;\n  }\n\n  public string Function { get; set; }\n  public string FilePath { get; set; }\n  public int Line { get; set; }\n  public int Column { get; set; }\n\n  public bool Equals(SourceStackFrame other) {\n    if (ReferenceEquals(null, other))\n      return false;\n    if (ReferenceEquals(this, other))\n      return true;\n    return Line == other.Line && Column == other.Column &&\n           Function.Equals(other.Function, StringComparison.OrdinalIgnoreCase) &&\n           FilePath.Equals(other.FilePath, StringComparison.OrdinalIgnoreCase);\n  }\n\n  public static bool operator ==(SourceStackFrame left, SourceStackFrame right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(SourceStackFrame left, SourceStackFrame right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is SourceStackFrame other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Function, FilePath, Line, Column);\n  }\n\n  public bool HasSameFunction(SourceStackFrame inlinee) {\n    return Function.Equals(inlinee.Function, StringComparison.OrdinalIgnoreCase) &&\n           FilePath.Equals(inlinee.FilePath, StringComparison.OrdinalIgnoreCase);\n  }\n}\n\npublic sealed class SourceStackTrace {\n  public SourceStackTrace() {\n    Frames = new List<SourceStackFrame>();\n  }\n\n  public SourceStackTrace(IEnumerable<SourceStackFrame> frames) : this() {\n    AddFrames(frames);\n  }\n\n  public List<SourceStackFrame> Frames { get; set; }\n  public byte[] Signature { get; set; }\n\n  public void AddFrames(IEnumerable<SourceStackFrame> frames) {\n    Frames.AddRange(frames);\n    UpdateSignature();\n  }\n\n  public override bool Equals(object obj) {\n    return obj is SourceStackTrace trace &&\n           EqualityComparer<byte[]>.Default.Equals(Signature, trace.Signature);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Signature);\n  }\n\n  public void UpdateSignature() {\n    // Compute a hash that identifies the stack trace\n    // to speed up equality check.\n    var bytesList = new List<byte[]>(Frames.Count);\n\n    foreach (var frame in Frames) {\n      bytesList.Add(Encoding.UTF8.GetBytes(frame.Function));\n      bytesList.Add(Encoding.UTF8.GetBytes(frame.FilePath));\n      bytesList.Add(BitConverter.GetBytes(frame.Line));\n      bytesList.Add(BitConverter.GetBytes(frame.Column));\n    }\n\n    Signature = CompressionUtils.CreateSHA256(bytesList);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/TupleIR.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.Core.IR;\n\npublic enum TupleKind {\n  Instruction,\n  Label,\n  Exception,\n  Metadata,\n  Other\n}\n\npublic class TupleIR : IRElement {\n  public TupleIR(IRElementId elementId, TupleKind kind, BlockIR parent) :\n    base(elementId.NextTuple()) {\n    Kind = kind;\n    Parent = parent;\n  }\n\n  public BlockIR Parent { get; set; }\n  public int IndexInBlock { get; set; }\n  public bool HasOddIndexInBlock => (IndexInBlock & 1) == 1;\n  public bool HasEvenIndexInBlock => (IndexInBlock & 1) == 0;\n  public TupleKind Kind { get; set; }\n  public bool IsInstruction => Kind == TupleKind.Instruction;\n  public bool IsLabel => Kind == TupleKind.Label;\n  public bool IsException => Kind == TupleKind.Exception;\n  public bool IsMetadata => Kind == TupleKind.Metadata;\n\n  public override void Accept(IRVisitor visitor) {\n    visitor.Visit(this);\n  }\n\n  public override string ToString() {\n    return $\"tuple kind: {Kind}, id: {Id}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IR/TypeIR.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\n\nnamespace ProfileExplorer.Core.IR;\n\npublic enum TypeKind {\n  Integer,\n  Float,\n  Vector,\n  Multibyte,\n  Array,\n  Struct,\n  Pointer,\n  Void,\n  Bool,\n  Unknown\n}\n\n[Flags]\npublic enum TypeFlags {\n  None = 0,\n  SignedInt = 1,\n  UnsignedInt = 2\n}\n\npublic sealed class TypeIR {\n  private static readonly TypeIR boolType_ = new(TypeKind.Integer, 0);\n  private static readonly TypeIR doubleType_ = new(TypeKind.Float, 8);\n  private static readonly TypeIR floatType_ = new(TypeKind.Float, 4);\n  private static readonly TypeIR[] signedIntTypes_ = {\n    new(TypeKind.Integer, 1, TypeFlags.SignedInt),\n    new(TypeKind.Integer, 2, TypeFlags.SignedInt),\n    new(TypeKind.Integer, 4, TypeFlags.SignedInt),\n    new(TypeKind.Integer, 8, TypeFlags.SignedInt)\n  };\n  private static readonly ConcurrentDictionary<TypeIR, TypeIR> uniqueTypes_ = new();\n  private static readonly TypeIR unknownType_ = new(TypeKind.Unknown, 0);\n  private static readonly TypeIR[] unsignedIntTypes_ = {\n    new(TypeKind.Integer, 1, TypeFlags.UnsignedInt),\n    new(TypeKind.Integer, 2, TypeFlags.UnsignedInt),\n    new(TypeKind.Integer, 4, TypeFlags.UnsignedInt),\n    new(TypeKind.Integer, 8, TypeFlags.UnsignedInt)\n  };\n  private static readonly TypeIR voidType_ = new(TypeKind.Void, 0);\n\n  private TypeIR(TypeKind kind, int size, TypeFlags flags = TypeFlags.None) {\n    Kind = kind;\n    Size = size;\n    Flags = flags;\n  }\n\n  public bool IsFloat => Kind == TypeKind.Float;\n  public bool IsInt => Kind == TypeKind.Integer && Flags != TypeFlags.UnsignedInt;\n  public bool IsInteger => Kind == TypeKind.Integer;\n  public bool IsMultibyte => Kind == TypeKind.Multibyte;\n  public bool IsUInt => Kind == TypeKind.Integer && Flags == TypeFlags.UnsignedInt;\n  public bool IsUnknown => Kind == TypeKind.Unknown;\n  public bool IsVoid => Kind == TypeKind.Void;\n  private TypeFlags Flags { get; set; }\n  private TypeKind Kind { get; set; }\n  private int Size { get; set; }\n\n  public static TypeIR GetBool() {\n    return boolType_;\n  }\n\n  public static TypeIR GetDouble() {\n    return doubleType_;\n  }\n\n  public static TypeIR GetFloat() {\n    return floatType_;\n  }\n\n  public static TypeIR GetInt(int size) {\n    return size switch {\n      1 => signedIntTypes_[0],\n      2 => signedIntTypes_[1],\n      4 => signedIntTypes_[2],\n      8 => signedIntTypes_[3],\n      _ => GetType(TypeKind.Integer, size, TypeFlags.SignedInt)\n    };\n  }\n\n  public static TypeIR GetInt16() {\n    return signedIntTypes_[1];\n  }\n\n  public static TypeIR GetInt32() {\n    return signedIntTypes_[2];\n  }\n\n  public static TypeIR GetInt64() {\n    return signedIntTypes_[3];\n  }\n\n  public static TypeIR GetInt8() {\n    return signedIntTypes_[0];\n  }\n\n  public static TypeIR GetMultibyte(int size) {\n    return GetType(TypeKind.Multibyte, size);\n  }\n\n  public static TypeIR GetType(TypeKind kind, int size,\n                               TypeFlags flags = TypeFlags.None) {\n    var type = new TypeIR(kind, size, flags);\n    return uniqueTypes_.GetOrAdd(type, type);\n  }\n\n  public static TypeIR GetUInt(int size) {\n    return size switch {\n      1 => unsignedIntTypes_[0],\n      2 => unsignedIntTypes_[1],\n      4 => unsignedIntTypes_[2],\n      8 => unsignedIntTypes_[3],\n      _ => GetType(TypeKind.Integer, size, TypeFlags.UnsignedInt)\n    };\n  }\n\n  public static TypeIR GetUInt16() {\n    return unsignedIntTypes_[1];\n  }\n\n  public static TypeIR GetUInt32() {\n    return unsignedIntTypes_[2];\n  }\n\n  public static TypeIR GetUInt64() {\n    return unsignedIntTypes_[3];\n  }\n\n  public static TypeIR GetUInt8() {\n    return unsignedIntTypes_[0];\n  }\n\n  public static TypeIR GetUnknown() {\n    return unknownType_;\n  }\n\n  public static TypeIR GetVoid() {\n    return voidType_;\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is TypeIR other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine((int)Flags, (int)Kind, Size);\n  }\n\n  public override string ToString() {\n    switch (Kind) {\n      case TypeKind.Integer: {\n        return IsUInt ? $\"uint{Size * 8}\" : $\"int{Size * 8}\";\n      }\n      case TypeKind.Float:\n        return $\"float{Size * 8}\";\n      case TypeKind.Vector:\n        return $\"vector{Size * 8}\";\n      case TypeKind.Multibyte:\n        return $\"mb{Size}\";\n      case TypeKind.Array:\n        return \"<TODO:array>\";\n      case TypeKind.Struct:\n        return \"<TODO:struct>\";\n      case TypeKind.Pointer:\n        return \"<TODO:ptr>\";\n      case TypeKind.Void:\n        return \"void\";\n      case TypeKind.Bool:\n        return \"bool\";\n      case TypeKind.Unknown:\n        return \"unk\";\n    }\n\n    return \"<unexpected>\";\n  }\n\n  private bool Equals(TypeIR other) {\n    return Flags == other.Flags && Kind == other.Kind && Size == other.Size;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IRPassOutput.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.Core;\n\npublic class IRPassOutput {\n  public static readonly IRPassOutput Empty = new(0, 0, 0, 0);\n\n  public IRPassOutput(long dataStartOffset, long dataEndOffset, int startLine,\n                      int endLine) {\n    DataStartOffset = dataStartOffset;\n    DataEndOffset = dataEndOffset;\n    StartLine = startLine;\n    EndLine = endLine;\n  }\n\n  public long DataStartOffset { get; set; }\n  public long DataEndOffset { get; set; } // One past end.\n  public long Size => DataEndOffset - DataStartOffset;\n  public byte[] Signature { get; set; } // SHA256 signature of the text.\n  public int StartLine { get; set; }\n  public int EndLine { get; set; }\n  public int LineCount => EndLine - StartLine + 1;\n  public bool HasPreprocessedLines { get; set; }\n\n  public override bool Equals(object obj) {\n    return obj is IRPassOutput output &&\n           DataStartOffset == output.DataStartOffset &&\n           DataEndOffset == output.DataEndOffset &&\n           StartLine == output.StartLine &&\n           EndLine == output.EndLine;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(DataStartOffset, DataEndOffset);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IRSectionReader.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core;\n\npublic delegate void ProgressInfoHandler(IRSectionReader reader, SectionReaderProgressInfo info);\npublic delegate void SectionTextHandler(IRSectionReader reader, SectionReaderText info);\n\npublic interface IRSectionReader {\n  IRTextSummary GenerateSummary(ProgressInfoHandler progressHandler,\n                                SectionTextHandler sectionTextHandler = null);\n\n  string GetSectionText(IRTextSection section);\n  ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section);\n  List<string> GetSectionTextLines(IRTextSection section);\n  string GetPassOutputText(IRPassOutput output);\n  ReadOnlyMemory<char> GetPassOutputTextSpan(IRPassOutput output);\n  List<string> GetPassOutputTextLines(IRPassOutput output);\n  string GetRawSectionText(IRTextSection section);\n  ReadOnlyMemory<char> GetRawSectionTextSpan(IRTextSection section);\n  string GetRawPassOutputText(IRPassOutput output);\n  ReadOnlyMemory<char> GetRawPassOutputTextSpan(IRPassOutput output);\n  public byte[] GetDocumentTextData();\n  void Dispose();\n}\n\npublic class SectionReaderProgressInfo {\n  public SectionReaderProgressInfo(long bytesProcessed, long totalBytes) {\n    BytesProcessed = bytesProcessed;\n    TotalBytes = totalBytes;\n  }\n\n  public SectionReaderProgressInfo(bool working) {\n    IsIndeterminate = working;\n  }\n\n  public long BytesProcessed { get; set; }\n  public long TotalBytes { get; set; }\n  public bool IsIndeterminate { get; set; }\n}\n\npublic class SectionReaderText {\n  public SectionReaderText(IRPassOutput output, List<string> textLines) {\n    Output = output;\n    TextLines = textLines;\n  }\n\n  public IRPassOutput Output { get; set; }\n  public List<string> TextLines { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IRTextFunction.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core;\n\npublic class IRTextFunction : IEquatable<IRTextFunction> {\n  private int cachedHashCode_;\n\n  public IRTextFunction(string name) {\n    Name = string.Intern(name);\n    Sections = new List<IRTextSection>();\n  }\n\n  public List<IRTextSection> Sections { get; }\n  public int Number { get; set; }\n  public string Name { get; }\n  public IRTextSummary ParentSummary { get; set; }\n  public string ModuleName => ParentSummary?.ModuleName;\n\n  public int MaxBlockCount {\n    get {\n      IRTextSection maxSection = null;\n\n      foreach (var section in Sections) {\n        if (maxSection == null) {\n          maxSection = section;\n        }\n        else if (section.BlockCount > maxSection.BlockCount) {\n          maxSection = section;\n        }\n      }\n\n      return maxSection?.BlockCount ?? 0;\n    }\n  }\n\n  public int SectionCount => Sections?.Count ?? 0;\n  public bool HasSections => SectionCount != 0;\n\n  public bool Equals(IRTextFunction other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    // Because name is interned, we can use reference equality.\n    return ReferenceEquals(Name, other.Name) &&\n           HasSameModule(other);\n  }\n\n  public void AddSection(IRTextSection section) {\n    section.Number = Sections.Count + 1;\n    Sections.Add(section);\n  }\n\n  public IRTextSection FindSection(string name) {\n    return Sections.Find(item => item.Name == name);\n  }\n\n  public List<IRTextSection> FindAllSections(string nameSubstring) {\n    return Sections.FindAll(section => section.Name.Contains(nameSubstring));\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((IRTextFunction)obj);\n  }\n\n  public override int GetHashCode() {\n    // Compute the hash so that functs. with same name in diff. modules\n    // don't get the same hash code.\n    if (cachedHashCode_ == 0) {\n      cachedHashCode_ = ParentSummary != null ? HashCode.Combine(Name, ParentSummary) : HashCode.Combine(Name);\n    }\n\n    return cachedHashCode_;\n  }\n\n  public override string ToString() {\n    return Name;\n  }\n\n  private bool HasSameModule(IRTextFunction other) {\n    if (ReferenceEquals(ParentSummary, other.ParentSummary)) {\n      return true;\n    }\n\n    if (ParentSummary != null && other.ParentSummary != null) {\n      return ParentSummary.Equals(other.ParentSummary);\n    }\n\n    return ParentSummary == null && other.ParentSummary == null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IRTextSection.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core;\n\npublic class IRTextSection : IEquatable<IRTextSection> {\n  private CompressedObject<Dictionary<int, string>> lineMetadata_;\n  public IRTextSection() { }\n\n  public IRTextSection(IRTextFunction parent, string name,\n                       IRPassOutput sectionOutput, int blocks = 0) {\n    ParentFunction = parent;\n    Name = string.Intern(name);\n    Output = sectionOutput;\n    BlockCount = blocks;\n  }\n\n  public int Id { get; set; }\n  public int Number { get; set; }\n  public string Name { get; set; }\n  public int BlockCount { get; set; }\n  public IRTextFunction ParentFunction { get; set; }\n  public string ModuleName => ParentFunction?.ParentSummary?.ModuleName;\n  public int LineCount => Output.LineCount;\n  public IRPassOutput Output { get; set; }\n  public IRPassOutput OutputAfter { get; set; }\n  public IRPassOutput OutputBefore { get; set; }\n\n  public Dictionary<int, string> LineMetadata {\n    get => lineMetadata_?.GetValue();\n    set => lineMetadata_ = new CompressedObject<Dictionary<int, string>>(value);\n  }\n\n  public bool Equals(IRTextSection other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Number == other.Number &&\n           Name.Equals(other.Name, StringComparison.Ordinal) &&\n           (ParentFunction == null && other.ParentFunction == null ||\n            ParentFunction != null && ParentFunction.Equals(other.ParentFunction));\n  }\n\n  public void AddLineMetadata(int lineNumber, string metadata) {\n    LineMetadata ??= new Dictionary<int, string>();\n    LineMetadata[lineNumber] = metadata;\n  }\n\n  public string GetLineMetadata(int lineNumber) {\n    if (LineMetadata != null &&\n        LineMetadata.TryGetValue(lineNumber, out string value)) {\n      return value;\n    }\n\n    return null;\n  }\n\n  public void CompressLineMetadata() {\n    if (lineMetadata_ != null) {\n      lineMetadata_.Compress();\n    }\n  }\n\n  public bool IsSectionTextDifferent(IRTextSection other) {\n    // If there is a signature, assume that same signature means same text.\n    if (Output?.Signature != null &&\n        other?.Output.Signature != null) {\n      return !Output.Signature.AsSpan().SequenceEqual(other.Output.Signature.AsSpan());\n    }\n\n    return true;\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) return false;\n    if (ReferenceEquals(this, obj)) return true;\n    if (obj.GetType() != GetType()) return false;\n    return Equals((IRTextSection)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Number, ParentFunction?.GetHashCode() ?? 0);\n  }\n\n  public override string ToString() {\n    return $\"({Number}) {Name}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IRTextSectionLoader.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing CSharpTest.Net.Collections;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Parser;\n\nnamespace ProfileExplorer.Core;\n\npublic class ParsedIRTextSection {\n  public ParsedIRTextSection(IRTextSection section, ReadOnlyMemory<char> text, FunctionIR function) {\n    Section = section;\n    Text = text;\n    Function = function;\n  }\n\n  public IRTextSection Section { get; set; }\n  public ReadOnlyMemory<char> Text { get; set; }\n  public FunctionIR Function { get; set; }\n  public List<IRParsingError> ParsingErrors { get; set; }\n  public bool IsCached { get; set; }\n  public bool LoadFailed { get; set; }\n  public bool HadParsingErrors => ParsingErrors != null && ParsingErrors.Count > 0;\n  public IRTextFunction ParentFunction => Section.ParentFunction;\n\n  public override string ToString() {\n    return Section.ToString();\n  }\n}\n\npublic abstract class IRTextSectionLoader : IDisposable {\n  private const int CACHE_LIMIT = 32;\n  protected LurchTable<IRTextSection, ParsedIRTextSection> sectionCache_;\n  protected ICompilerIRInfo irInfo_;\n  protected bool cacheEnabled_;\n  protected object lockObject_;\n  protected long sectionPreprocessingCompleted_;\n  protected bool disposed_;\n  public bool SectionSignaturesComputed => Interlocked.Read(ref sectionPreprocessingCompleted_) != 0;\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  public event EventHandler<bool> SectionPreprocessingCompleted;\n  public abstract Task<IRTextSummary> LoadDocument(ProgressInfoHandler progressHandler);\n  public abstract string GetDocumentOutputText();\n  public abstract byte[] GetDocumentTextBytes();\n  public abstract ParsedIRTextSection LoadSection(IRTextSection section);\n  public abstract string GetSectionText(IRTextSection section);\n  public abstract ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section);\n  public abstract string GetSectionOutputText(IRPassOutput output);\n  public abstract ReadOnlyMemory<char> GetSectionPassOutputTextSpan(IRPassOutput output);\n  public abstract List<string> GetSectionPassOutputTextLines(IRPassOutput output);\n  public abstract string GetRawSectionText(IRTextSection section);\n  public abstract string GetRawSectionPassOutput(IRPassOutput output);\n  public abstract ReadOnlyMemory<char> GetRawSectionTextSpan(IRTextSection section);\n  public abstract ReadOnlyMemory<char> GetRawSectionPassOutputSpan(IRPassOutput output);\n\n  public ParsedIRTextSection TryGetLoadedSection(IRTextSection section) {\n    if (!cacheEnabled_) {\n      return null;\n    }\n\n    lock (lockObject_) {\n      return sectionCache_.TryGetValue(section, out var result) ? result : null;\n    }\n  }\n\n  public string GetSectionText(IRTextSection section, bool useCache = true) {\n    var result = GetSectionTextSpan(section, useCache);\n    return result.ToString();\n  }\n\n  public ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section, bool useCache = true) {\n    if (useCache && cacheEnabled_) {\n      lock (lockObject_) {\n        if (sectionCache_.TryGetValue(section, out var result)) {\n          return result.Text;\n        }\n      }\n    }\n\n    return GetSectionTextSpan(section);\n  }\n\n  public string GetRawSectionText(IRTextSection section, bool useCache = true) {\n    return GetRawSectionText(section);\n  }\n\n  public void SuspendCaching() {\n    cacheEnabled_ = false;\n  }\n\n  public void ResumeCaching() {\n    cacheEnabled_ = true;\n  }\n\n  public void ResetCache() {\n    if (!cacheEnabled_) {\n      return;\n    }\n\n    lock (lockObject_) {\n      sectionCache_.Clear();\n    }\n  }\n\n  protected void NotifySectionPreprocessingCompleted(bool canceled) {\n    Interlocked.Exchange(ref sectionPreprocessingCompleted_, 1);\n    SectionPreprocessingCompleted?.Invoke(this, canceled);\n  }\n\n  protected void Initialize(ICompilerIRInfo irInfo, bool cacheEnabled) {\n    irInfo_ = irInfo;\n    cacheEnabled_ = cacheEnabled;\n    lockObject_ = new object();\n    sectionPreprocessingCompleted_ = 0;\n    sectionCache_ = new LurchTable<IRTextSection, ParsedIRTextSection>(LurchTableOrder.Insertion, CACHE_LIMIT);\n  }\n\n  protected (IRSectionParser, IRParsingErrorHandler) InitializeParser(long functionSize = 0) {\n    var errorHandler = irInfo_.CreateParsingErrorHandler();\n    return (irInfo_.CreateSectionParser(errorHandler, functionSize), errorHandler);\n  }\n\n  protected void CacheParsedSection(IRTextSection section, FunctionIR function, ParsedIRTextSection result) {\n    lock (lockObject_) {\n      if (cacheEnabled_ && function != null) {\n        sectionCache_[section] = result;\n      }\n    }\n  }\n\n  protected ParsedIRTextSection TryGetCachedParsedSection(IRTextSection section) {\n    lock (lockObject_) {\n      if (cacheEnabled_ && sectionCache_.TryGetValue(section, out var cachedResult)) {\n        //Trace.TraceInformation($\"Section loader {ObjectTracker.Track(this)}: found in cache\");\n        cachedResult.IsCached = true;\n        return cachedResult;\n      }\n    }\n\n    return null;\n  }\n\n  protected abstract void Dispose(bool disposing);\n\n  ~IRTextSectionLoader() {\n    Dispose(false);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/IRTextSummary.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core;\n\npublic class IRTextSummary : IEquatable<IRTextSummary> {\n  private Dictionary<string, IRTextFunction> functionNameMap_;\n  private Dictionary<string, IRTextFunction> unmangledFunctionNameMap_;\n  private Dictionary<int, IRTextFunction> functionMap_;\n  private Dictionary<int, IRTextSection> sectionMap_;\n  private int hashCode_;\n\n  public IRTextSummary(string moduleName = null) {\n    SetModuleName(moduleName);\n    Functions = new List<IRTextFunction>();\n    functionNameMap_ = new Dictionary<string, IRTextFunction>();\n    functionMap_ = new Dictionary<int, IRTextFunction>();\n    sectionMap_ = new Dictionary<int, IRTextSection>();\n  }\n\n  public Guid Id { get; set; }\n  public string ModuleName { get; private set; }\n  public List<IRTextFunction> Functions { get; set; }\n\n  public bool Equals(IRTextSummary other) {\n    if (ReferenceEquals(null, other)) return false;\n    if (ReferenceEquals(this, other)) return true;\n    return ModuleName.Equals(other.ModuleName, StringComparison.Ordinal);\n  }\n\n  public void SetModuleName(string moduleName) {\n    ModuleName = moduleName != null ? string.Intern(moduleName) : null;\n  }\n\n  public void AddFunction(IRTextFunction function) {\n    if (functionNameMap_.ContainsKey(function.Name)) {\n      return; //? remove\n    }\n\n    function.Number = Functions.Count;\n    Functions.Add(function);\n    functionNameMap_.Add(function.Name, function);\n    functionMap_.Add(function.Number, function);\n    function.ParentSummary = this;\n  }\n\n  public void AddSection(IRTextSection section) {\n    section.Id = sectionMap_.Count;\n    sectionMap_.Add(sectionMap_.Count, section);\n  }\n\n  public IRTextSection GetSectionWithId(int id) {\n    return sectionMap_.TryGetValue(id, out var value) ? value : null;\n  }\n\n  public IRTextFunction GetFunctionWithId(int id) {\n    return functionMap_.TryGetValue(id, out var result) ? result : null;\n  }\n\n  public IRTextFunction FindFunction(string name) {\n    return functionNameMap_.TryGetValue(name, out var result) ? result : null;\n  }\n\n  public IRTextFunction FindFunction(string name, Func<string, string> matchCheck) {\n    if (unmangledFunctionNameMap_ == null) {\n      ComputeUnmangledFunctionNameMap(matchCheck);\n    }\n\n    return unmangledFunctionNameMap_.GetValueOrNull(name);\n  }\n\n  public void ComputeUnmangledFunctionNameMap(Func<string, string> funcNameFormatter) {\n    lock (this) {\n      if (unmangledFunctionNameMap_ != null) {\n        return;\n      }\n\n      unmangledFunctionNameMap_ = new Dictionary<string, IRTextFunction>();\n\n      foreach (var function in Functions) {\n        string unmangledName = funcNameFormatter(function.Name);\n        unmangledFunctionNameMap_[unmangledName] = function;\n      }\n    }\n  }\n\n  public List<IRTextFunction> FindFunctions(Func<string, bool> matchCheck) {\n    var list = new List<IRTextFunction>();\n\n    foreach (var function in Functions) {\n      if (matchCheck(function.Name)) {\n        list.Add(function);\n      }\n    }\n\n    return list;\n  }\n\n  public List<IRTextFunction> FindAllFunctions(string nameSubstring) {\n    return Functions.FindAll(func => func.Name.Contains(nameSubstring, StringComparison.Ordinal));\n  }\n\n  public List<IRTextFunction> FindAllFunctions(string[] nameSubstrings) {\n    return Functions.FindAll(func => {\n      foreach (string name in nameSubstrings) {\n        if (!func.Name.Contains(name, StringComparison.Ordinal)) {\n          return false;\n        }\n      }\n\n      return true;\n    });\n  }\n\n  public IRTextFunction FindFunction(IRTextFunction function) {\n    return functionNameMap_.TryGetValue(function.Name, out var result) ? result : null;\n  }\n\n  public override int GetHashCode() {\n    return ModuleName != null ? ModuleName.GetHashCode() : 0;\n  }\n\n  public override string ToString() {\n    var sb = new StringBuilder();\n    sb.AppendLine($\"Summary: {ModuleName}\");\n    sb.AppendLine($\"Functions: {Functions.Count}\");\n    return sb.ToString();\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) return false;\n    if (ReferenceEquals(this, obj)) return true;\n    if (obj.GetType() != GetType()) return false;\n    return Equals((IRTextSummary)obj);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Lexer/CharSource.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Lexer;\n\npublic sealed class CharSource {\n  public static readonly char EOF = '\\0';\n  public static readonly char NewLine = '\\n';\n  public ReadOnlyMemory<char> TextSpan {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    private set;\n  }\n  public int Position {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    set;\n  }\n\n  public void Initialize(ReadOnlyMemory<char> text) {\n    TextSpan = text;\n    Position = 0;\n  }\n\n  public void Initialize(string text) {\n    TextSpan = text.AsMemory();\n    Position = 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char NextChar() {\n    if (Position >= TextSpan.Length) {\n      Position++;\n      return EOF;\n    }\n\n    return TextSpan.Span[Position++];\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char PeekChar() {\n    return Position >= TextSpan.Length ? EOF :\n      TextSpan.Span[Position];\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char Skip(int count = 1) {\n    Position += count;\n    return PeekChar();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char GoBack(int count = 1) {\n    Position -= count;\n    return PeekChar();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public ReadOnlyMemory<char> Extract(int position, int length) {\n    return TextSpan.Slice(position, length);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Lexer/CharTable.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Lexer;\n\npublic static class CharTable {\n  private const byte CHAR_WHITESPACE = 1;\n  private const byte CHAR_LETTER = 2;\n  private const byte CHAR_DIGIT = 4;\n  private const byte CHAR_NUMBER = 8;\n  private const byte CHAR_IDENTIFIER = 16;\n  private static readonly byte[] CHAR_TYPE = {\n    0, 0, 0, 0, 0, 0, 0, 0, // 8\n    0, 1, 1, 1, 1, 1, 0, 0, // 16\n    0, 0, 0, 0, 0, 0, 0, 0, // 24\n    0, 0, 0, 0, 0, 0, 0, 0, // 32\n    1, 0, 0, 0, 26, 0, 0, 0, // 40\n    0, 0, 0, 0, 0, 0, 8, 0, // 48\n    28, 28, 28, 28, 28, 28, 28, 28, // 56\n    28, 28, 0, 0, 0, 0, 0, 16, // 64\n    18, 26, 26, 26, 26, 26, 26, 18, // 72\n    18, 18, 18, 18, 18, 18, 18, 18, // 80\n    18, 18, 18, 18, 18, 18, 18, 18, // 88\n    26, 18, 18, 0, 0, 0, 0, 18, // 96\n    0, 26, 26, 26, 26, 26, 26, 18, // 104\n    18, 18, 18, 18, 18, 18, 18, 18, // 112\n    18, 18, 18, 18, 18, 18, 18, 18, // 120\n    26, 18, 18, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0\n  };\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsDigit(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_DIGIT) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsWhitespace(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_WHITESPACE) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsLetter(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_LETTER) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsNumberChar(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_NUMBER) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsIdentifierChar(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_IDENTIFIER) != 0;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Lexer/Lexer.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Buffers;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core.Lexer;\n\npublic sealed class Lexer {\n  public delegate bool TokenAction(Token token);\n  private char current_; // The current character.\n  private int line_; // The current line.\n  private int lineStart_; // The position of the current line start.\n  private Stack<Token> returnedTokens_; // Tokens returned back to lexer.\n  private CharSource source_; // The text being analyzed.\n\n  public Lexer() {\n    source_ = new CharSource();\n    returnedTokens_ = new Stack<Token>(8);\n  }\n\n  public void Initialize(string text) {\n    Reset();\n    source_.Initialize(text);\n    current_ = source_.NextChar();\n  }\n\n  public void Initialize(ReadOnlyMemory<char> text) {\n    Reset();\n    source_.Initialize(text);\n    current_ = source_.NextChar();\n  }\n\n  public Token NextToken() {\n    return returnedTokens_.Count > 0 ?\n      returnedTokens_.Pop() : ScanToken();\n  }\n\n  public void ReturnToken(Token token) {\n    returnedTokens_.Push(token);\n  }\n\n  public Token PeekToken() {\n    var token = NextToken();\n    ReturnToken(token);\n    return token;\n  }\n\n  public Token PeekToken(int position) {\n    // Use a temp array to store the skipped token,\n    // which must be returned after reaching the desired one.\n    var tempArray = ArrayPool<Token>.Shared.Rent(position);\n    int tempIndex = 0;\n\n    // Get to the token at the position (starting with 1)\n    // relative to the previously retrieved token.\n    var token = NextToken();\n    tempArray[tempIndex++] = token;\n\n    while (!token.IsEOF() && tempIndex < position) {\n      token = NextToken();\n      tempArray[tempIndex++] = token;\n    }\n\n    // Return the tokens so they are are used by NextToken.\n    for (int i = tempIndex - 1; i >= 0; i--) {\n      ReturnToken(tempArray[i]);\n    }\n\n    ArrayPool<Token>.Shared.Return(tempArray);\n    return token;\n  }\n\n  public void PeekTokenWhile(TokenAction action, int maxLookupLength) {\n    var tempArray = ArrayPool<Token>.Shared.Rent(maxLookupLength);\n    int tempIndex = 0;\n    Token token;\n\n    do {\n      token = NextToken();\n      tempArray[tempIndex++] = token;\n    } while (!token.IsEOF() &&\n             action(token) &&\n             tempIndex < maxLookupLength);\n\n    for (int i = tempIndex - 1; i >= 0; i--) {\n      ReturnToken(tempArray[i]);\n    }\n\n    ArrayPool<Token>.Shared.Return(tempArray);\n  }\n\n  public ReadOnlyMemory<char> GetTokenText(Token token) {\n    return source_.TextSpan.Slice(token.Location.Offset, token.Length);\n  }\n\n  public ReadOnlyMemory<char> GetText(int offset, int length) {\n    return source_.TextSpan.Slice(offset, length);\n  }\n\n  private void NextChar() {\n    current_ = source_.NextChar();\n  }\n\n  private Token MakeToken(TokenKind kind, int length = 1) {\n    return new Token {\n      Kind = kind,\n      Location = new TextLocation {\n        Offset = source_.Position - length - 1,\n        Line = line_,\n        Column = source_.Position - lineStart_ - length - 1\n      },\n      Length = length,\n      Data = ReadOnlyMemory<char>.Empty\n    };\n  }\n\n  private Token MakeDataToken(TokenKind kind, int startPosition, int length) {\n    return new Token {\n      Kind = kind,\n      Location = new TextLocation {\n        Offset = startPosition,\n        Line = line_,\n        Column = startPosition - lineStart_\n      },\n      Length = length,\n      Data = source_.Extract(startPosition, length)\n    };\n  }\n\n  private Token ScanNumber() {\n    int startPosition = source_.Position;\n    char previous = current_;\n    NextChar(); // Skip first digit.\n\n    while (CharTable.IsNumberChar(current_)) {\n      previous = current_;\n      NextChar();\n    }\n\n    if ((current_ == '+' || current_ == '-') && (previous == 'E' || previous == 'e')) {\n      NextChar(); // Skip over +/-.\n\n      while (CharTable.IsDigit(current_)) {\n        previous = current_;\n        NextChar();\n      }\n    }\n\n    // A dot that is not followed by digits\n    // should not be handled as part of a float number.\n    if (previous == '.') {\n      source_.GoBack(2);\n      NextChar();\n    }\n    else if ((previous == 'x' || previous == 'X') &&\n             source_.Position - startPosition > 3) {\n      // 0x%x\n      // .x from 123.x should not be part of a number either,\n      // since the x does not denote a hex number.\n      source_.GoBack(3);\n      NextChar();\n    }\n\n    int length = source_.Position - startPosition - 1;\n    return MakeDataToken(TokenKind.Number, startPosition, length);\n  }\n\n  private Token ScanString(char delimiter) {\n    int startPosition = source_.Position;\n    NextChar(); // Skip start delimiter.\n\n    while (current_ != delimiter) {\n      if (current_ == CharSource.EOF || current_ == CharSource.NewLine) {\n        return MakeToken(TokenKind.Invalid);\n      }\n\n      NextChar();\n    }\n\n    NextChar(); // Skip end delimiter.\n    int length = source_.Position - startPosition - 2;\n    return MakeDataToken(TokenKind.String, startPosition, length);\n  }\n\n  private Token ScanIdentifier() {\n    int startPosition = source_.Position;\n    NextChar();\n\n    while (CharTable.IsIdentifierChar(current_)) {\n      NextChar();\n    }\n\n    int length = source_.Position - startPosition - 1;\n    return MakeDataToken(TokenKind.Identifier, startPosition, length);\n  }\n\n  private Token ScanToken() {\n    char letter = current_;\n\n    while (true) {\n      NextChar(); // Skip to next letter.\n\n      if (letter == CharSource.EOF) {\n        return MakeToken(TokenKind.EOF);\n      }\n\n      switch (letter) {\n        case '\\t':\n          break; // Tab.\n        case '\\v':\n          break; // Vertical tab.\n        case '\\f':\n          break; // Form feed.\n        case '\\n': {\n          line_++;\n          lineStart_ = source_.Position + 1;\n          return MakeToken(TokenKind.LineEnd);\n        }\n        case '0':\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9': {\n          // Found the start of a number.\n          source_.GoBack(2);\n          return ScanNumber();\n        }\n        case 'a':\n        case 'b':\n        case 'c':\n        case 'd':\n        case 'e':\n        case 'f':\n        case 'g':\n        case 'h':\n        case 'i':\n        case 'j':\n        case 'k':\n        case 'l':\n        case 'm':\n        case 'n':\n        case 'o':\n        case 'p':\n        case 'q':\n        case 'r':\n        case 's':\n        case 't':\n        case 'u':\n        case 'v':\n        case 'w':\n        case 'x':\n        case 'y':\n        case 'z':\n        case 'A':\n        case 'B':\n        case 'C':\n        case 'D':\n        case 'E':\n        case 'F':\n        case 'G':\n        case 'H':\n        case 'I':\n        case 'J':\n        case 'K':\n        case 'L':\n        case 'M':\n        case 'N':\n        case 'O':\n        case 'P':\n        case 'Q':\n        case 'R':\n        case 'S':\n        case 'T':\n        case 'U':\n        case 'V':\n        case 'W':\n        case 'X':\n        case 'Y':\n        case 'Z':\n        case '_':\n        case '@':\n        case '$':\n        case '?': {\n          // Found the start of an identifier or a keyword.\n          source_.GoBack(2);\n          return ScanIdentifier();\n        }\n        case '\\\"': {\n          // Found the start of a string.\n          source_.GoBack();\n          return ScanString('\\\"');\n        }\n        case '\\'': {\n          return MakeToken(TokenKind.Apostrophe);\n        }\n        case '(': {\n          return MakeToken(TokenKind.OpenParen);\n        }\n        case ')': {\n          return MakeToken(TokenKind.CloseParen);\n        }\n        case '[': {\n          return MakeToken(TokenKind.OpenSquare);\n        }\n        case ']': {\n          return MakeToken(TokenKind.CloseSquare);\n        }\n        case '{': {\n          return MakeToken(TokenKind.OpenCurly);\n        }\n        case '}': {\n          return MakeToken(TokenKind.CloseCurly);\n        }\n        case ':': {\n          return MakeToken(TokenKind.Colon);\n        }\n        case ';': {\n          return MakeToken(TokenKind.SemiColon);\n        }\n        case ',': {\n          return MakeToken(TokenKind.Comma);\n        }\n        case '.': {\n          return MakeToken(TokenKind.Dot);\n        }\n        case '&': {\n          return MakeToken(TokenKind.And);\n        }\n        case '|': {\n          return MakeToken(TokenKind.Or);\n        }\n        case '^': {\n          return MakeToken(TokenKind.Xor);\n        }\n        case '<': {\n          return MakeToken(TokenKind.Less);\n        }\n        case '>': {\n          return MakeToken(TokenKind.Greater);\n        }\n        case '=': {\n          return MakeToken(TokenKind.Equal);\n        }\n        case '+': {\n          return MakeToken(TokenKind.Plus);\n        }\n        case '-': {\n          return MakeToken(TokenKind.Minus);\n        }\n        case '*': {\n          return MakeToken(TokenKind.Star);\n        }\n        case '/': {\n          return MakeToken(TokenKind.Div);\n        }\n        case '~': {\n          return MakeToken(TokenKind.Tilde);\n        }\n        case '!': {\n          return MakeToken(TokenKind.Exclamation);\n        }\n        case '%': {\n          return MakeToken(TokenKind.Percent);\n        }\n        case '#': {\n          return MakeToken(TokenKind.Hash);\n        }\n      }\n\n      letter = current_;\n    }\n  }\n\n  private void Reset() {\n    returnedTokens_.Clear();\n    line_ = 0;\n    lineStart_ = 0;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Lexer/Token.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Lexer;\n\n// Definitions for token types.\n// Some tokens (identifier, string, number, etc.) have additional associated data.\npublic enum TokenKind {\n  Identifier, // -> Data\n  Number, // -> Data\n  String, // -> Data\n  Char, // -> Data\n  Plus, // +\n  Minus, // -\n  Star, // *\n  Tilde, // ~\n  Equal, // =\n  Exclamation, // !\n  Percent, // %\n  And, // &\n  Or, // |\n  Xor, // ^\n  Less, // <\n  Greater, // >\n  Hash, // #  (used by the preprocessor)\n  Div, // /\n  Colon, // :\n  SemiColon, // ;\n  Comma, // ,\n  Apostrophe, // '\n  Dot, // .\n  Question, // ?\n  OpenSquare, // [\n  CloseSquare, // ]\n  OpenParen, // (\n  CloseParen, // )\n  OpenCurly, // {\n  CloseCurly, // }\n  LineEnd, // Found \\n.\n  EOF, // The end of the file was reached.\n  Invalid, // The token could not be determined.\n  Custom, // Used to mark a custom (optional) token.\n  Keyword // All values after this one denote tokens.\n}\n\npublic struct Token : IEquatable<Token> {\n  public TokenKind Kind {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public TextLocation Location {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public int Length {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public ReadOnlyMemory<char> Data {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public Token(TokenKind kind, TextLocation location, int length) : this() {\n    Kind = kind;\n    Location = location;\n    Length = length;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsValid() {\n    return Kind != TokenKind.EOF && Kind != TokenKind.Invalid;\n  }\n\n  // Returns true if the token describes and end-of-file situation.\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsEOF() {\n    return Kind == TokenKind.EOF;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsLineEnd() {\n    return Kind == TokenKind.LineEnd;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsIdentifier() {\n    return Kind == TokenKind.Identifier;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsNumber() {\n    return Kind == TokenKind.Number;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsString() {\n    return Kind == TokenKind.String;\n  }\n\n  // Returns true if the token represents an operator.\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsOperator() {\n    return (int)Kind >= (int)TokenKind.Plus && (int)Kind <= (int)TokenKind.Div;\n  }\n\n  public override string ToString() {\n    string text = $\"kind: {Kind}; location: {Location}; length: {Length}\";\n\n    if (!Data.IsEmpty) {\n      text += $\"; data: {Data.Span.ToString()}\";\n    }\n\n    return text;\n  }\n\n  public bool Equals(Token other) {\n    return Kind == other.Kind && Location.Equals(other.Location) && Length == other.Length;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is Token other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine((int)Kind, Location, Length);\n  }\n\n  public static bool operator ==(Token left, Token right) {\n    return left.Equals(right);\n  }\n\n  public static bool operator !=(Token left, Token right) {\n    return !left.Equals(right);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Parser/IRSectionParser.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Lexer;\n\nnamespace ProfileExplorer.Core.Parser;\n\npublic interface IRSectionParser {\n  void SkipCurrentToken();\n  void SkipToLineEnd();\n  void SkipToLineStart();\n  void SkipToNextBlock();\n  void SkipToFunctionEnd();\n  FunctionIR ParseSection(IRTextSection section, string sectionText);\n  FunctionIR ParseSection(IRTextSection section, ReadOnlyMemory<char> sectionText);\n}\n\npublic interface IRParsingErrorHandler {\n  IRSectionParser Parser { get; set; }\n  bool HadParsingErrors { get; set; }\n  List<IRParsingError> ParsingErrors { get; }\n\n  bool HandleError(TextLocation location, TokenKind expectedToken, Token actualToken,\n                   string message = \"\");\n}\n\npublic class IRParsingError {\n  public IRParsingError(TextLocation location, string error) {\n    Location = location;\n    Error = error;\n  }\n\n  public TextLocation Location { get; set; }\n  public string Error { get; set; }\n\n  public override string ToString() {\n    return Error;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Parser/ParserBase.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Lexer;\n\nnamespace ProfileExplorer.Core.Parser;\n\npublic class ParserBase {\n  protected readonly Lexer.Lexer lexer_ = new();\n  private readonly Dictionary<int, BlockIR> blockMap_ = new();\n  private readonly IRParsingErrorHandler errorHandler_;\n  private readonly RegisterTable registerTable_;\n  protected ICompilerIRInfo irInfo_;\n  protected Token current_;\n  protected Token previous_;\n  protected IRTextSection section_;\n  private IRElementId nextElementId_;\n  private AssemblyMetadataTag metadataTag_; // Lazy-init.\n\n  protected ParserBase(ICompilerIRInfo irInfo, IRParsingErrorHandler errorHandler,\n                       RegisterTable registerTable, IRTextSection section) {\n    irInfo_ = irInfo;\n    errorHandler_ = errorHandler;\n    registerTable_ = registerTable;\n    section_ = section;\n  }\n\n  protected RegisterTable RegisterTable => registerTable_;\n  protected AssemblyMetadataTag MetadataTag => metadataTag_ ??= new AssemblyMetadataTag();\n  protected IRElementId NextElementId => nextElementId_;\n\n  public bool IsDone() {\n    return current_.IsEOF();\n  }\n\n  public void SkipCurrentToken() {\n    SkipToken();\n  }\n\n  protected virtual void Reset() {\n    nextElementId_ = IRElementId.FromLong(0);\n    blockMap_.Clear();\n    metadataTag_ = null;\n  }\n\n  protected virtual void Initialize(string text) {\n    lexer_.Initialize(text);\n  }\n\n  protected virtual void Initialize(ReadOnlyMemory<char> text) {\n    lexer_.Initialize(text);\n  }\n\n  protected void AddMetadata(FunctionIR function) {\n    if (metadataTag_ != null) {\n      function.AddTag(metadataTag_);\n    }\n  }\n\n  protected void ReportError(TokenKind expectedToken, string message = \"\") {\n    errorHandler_?.HandleError(current_.Location, expectedToken, current_, message);\n  }\n\n  protected void ReportErrorAndSkipLine(TokenKind expectedToken, string message) {\n    ReportError(expectedToken, message);\n    SkipToLineStart();\n  }\n\n  protected BlockIR GetOrCreateBlock(int blockNumber, FunctionIR function) {\n    if (blockMap_.TryGetValue(blockNumber, out var block)) {\n      return block;\n    }\n\n    var blockId = NextElementId.NewBlock(blockNumber);\n    var newBlock = new BlockIR(blockId, blockNumber, function);\n    blockMap_[blockNumber] = newBlock;\n    return newBlock;\n  }\n\n  protected int LocationDistance(Token startToken) {\n    if (current_.Location.Offset != startToken.Location.Offset) {\n      return previous_.Location.Offset -\n             startToken.Location.Offset +\n             previous_.Length;\n    }\n\n    return startToken.Length;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool TokenIntNumber(out int value) {\n    return int.TryParse(TokenStringData(), NumberStyles.Integer,\n                        NumberFormatInfo.InvariantInfo, out value);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool TokenLongIntNumber(out long value) {\n    return long.TryParse(TokenStringData(), NumberStyles.Integer,\n                         NumberFormatInfo.InvariantInfo, out value);\n  }\n\n  protected long? ParseHexAddress() {\n    if (TokenLongHexNumber(out long value)) {\n      SkipToken();\n      return value;\n    }\n\n    return null;\n  }\n\n  protected bool SkipHexNumber(int requiredLength = 0) {\n    if (!IsNumber() && !IsIdentifier()) {\n      return false;\n    }\n\n    if (IsHexNumber(TokenData().Span)) {\n      // Check if the number has the required number of digits.\n      if (requiredLength != 0 &&\n          TokenData().Length != requiredLength) {\n        return false;\n      }\n\n      SkipToken();\n      return true;\n    }\n\n    return false;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool TokenLongHexNumber(out long value) {\n    if (!IsNumber() && !IsIdentifier()) {\n      value = 0;\n      return false;\n    }\n\n    // Try to parse again as a HEX int.\n    // Since a parsing failure is very expensive, first check if the token\n    // could be a hex value and reject it early if it cannot be.\n    try {\n      var data = TokenData();\n\n      if (!IsHexNumber(data.Span)) {\n        value = 0;\n        return false;\n      }\n\n      value = Convert.ToInt64(TokenString(), 16);\n      return true;\n    }\n    catch (Exception) {\n      value = 0;\n      return false;\n    }\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool TokenFloatNumber(out double value) {\n    return double.TryParse(TokenStringData(), NumberStyles.Any, CultureInfo.InvariantCulture, out value);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected string TokenString() {\n    return current_.Data.ToString();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected ReadOnlySpan<char> TokenStringData() {\n    return current_.Data.Span;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected ReadOnlyMemory<char> TokenData() {\n    return current_.Data;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected void SkipToken() {\n    previous_ = current_;\n    current_ = lexer_.NextToken();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool ExpectAndSkipToken(params TokenKind[] kind) {\n    if (kind.Contains(current_.Kind)) {\n      SkipToken();\n      return true;\n    }\n\n    return false;\n  }\n\n  protected bool SkipOptionalToken(TokenKind kind) {\n    if (current_.Kind == kind) {\n      SkipToken();\n      return true;\n    }\n\n    return false;\n  }\n\n  protected bool SkipToToken(TokenKind kind) {\n    while (!IsLineEnd()) {\n      if (TokenIs(kind)) {\n        return true;\n      }\n\n      SkipToken();\n    }\n\n    return false;\n  }\n\n  protected bool SkipToAnyToken(params TokenKind[] tokens) {\n    while (!IsLineEnd()) {\n      if (IsAnyToken(tokens)) {\n        return true;\n      }\n\n      SkipToken();\n    }\n\n    return false;\n  }\n\n  protected bool SkipAfterToken(TokenKind kind) {\n    while (!IsLineEnd()) {\n      if (TokenIs(kind)) {\n        SkipToken();\n        return true;\n      }\n\n      SkipToken();\n    }\n\n    return false;\n  }\n\n  protected void SkipToLineEnd() {\n    while (!IsLineEnd()) {\n      SkipToken();\n    }\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected void SkipToLineStart() {\n    SkipToLineEnd();\n    SkipToken();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsEOF() {\n    return current_.IsEOF();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsLineEnd() {\n    return current_.IsLineEnd() || current_.IsEOF();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsDot() {\n    return current_.Kind == TokenKind.Dot;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsComma() {\n    return current_.Kind == TokenKind.Comma;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsColon() {\n    return current_.Kind == TokenKind.Colon;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsLess() {\n    return current_.Kind == TokenKind.Less;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsEqual() {\n    return current_.Kind == TokenKind.Equal;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsStar() {\n    return current_.Kind == TokenKind.Star;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsHash() {\n    return current_.Kind == TokenKind.Hash;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsIdentifier() {\n    return current_.Kind == TokenKind.Identifier;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsNumber() {\n    return current_.Kind == TokenKind.Number;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool TokenIs(TokenKind kind) {\n    return current_.Kind == kind;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool IsAnyToken(params TokenKind[] tokens) {\n    return Array.IndexOf(tokens, current_.Kind) != -1;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool NextTokenIs(TokenKind kind) {\n    return lexer_.PeekToken().Kind == kind;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  protected bool NextAfterTokenIs(TokenKind kind) {\n    return lexer_.PeekToken(2).Kind == kind;\n  }\n\n  protected void SetTextRange(IRElement element, Token startToken, int adjustment = 0) {\n    int distance = Math.Max(0, LocationDistance(startToken) - adjustment);\n    element.SetTextRange(startToken.Location, distance);\n  }\n\n  protected void SetTextRange(IRElement element, Token startToken, Token endToken, int adjustment = 0) {\n    int distance = Math.Max(0, endToken.Location.Offset -\n                            startToken.Location.Offset + endToken.Length - adjustment);\n    element.SetTextRange(startToken.Location, distance);\n  }\n\n  protected void SetTextRange(IRElement element) {\n    element.SetTextRange(current_.Location, current_.Length);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private bool IsHexLetter(char c) {\n    return c >= '0' && c <= '9' ||\n           c >= 'a' && c <= 'f' ||\n           c >= 'A' && c <= 'F' ||\n           c == 'x' || c == 'X';\n  }\n\n  private bool IsHexNumber(ReadOnlySpan<char> span) {\n    for (int i = 0; i < span.Length; i++) {\n      if (!IsHexLetter(span[i])) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Parser/ParsingErrorHandler.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Lexer;\n\nnamespace ProfileExplorer.Core.Parser;\n\npublic class ParsingErrorHandler : IRParsingErrorHandler {\n  public ParsingErrorHandler() {\n    ParsingErrors = new List<IRParsingError>();\n  }\n\n  public bool ThrowOnError { get; set; }\n  public IRSectionParser Parser { get; set; }\n  public bool HadParsingErrors { get; set; }\n  public List<IRParsingError> ParsingErrors { get; set; }\n\n  public bool HandleError(TextLocation location, TokenKind expectedToken,\n                          Token actualToken, string message = \"\") {\n    var builder = new StringBuilder();\n\n    if (!string.IsNullOrEmpty(message)) {\n      builder.AppendLine(message);\n    }\n\n    builder.AppendLine($\"Location: {location}\");\n    builder.AppendLine($\"Expected token: {expectedToken}\");\n    builder.Append($\"Actual token: {actualToken}\");\n\n    if (ThrowOnError) {\n      throw new InvalidOperationException($\"IR parsing error:\\n{builder}\");\n    }\n\n    ParsingErrors.Add(new IRParsingError(location, builder.ToString()));\n    HadParsingErrors = true;\n    return true; // Always continue parsing.\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/CallTree/ProfileCallSite.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\n\nnamespace ProfileExplorer.Core.Profile.CallTree;\n\npublic class ProfileCallSite : IEquatable<ProfileCallSite> {\n  public ProfileCallSite(long rva) {\n    Targets = new List<(ProfileCallTreeNode NodeId, TimeSpan Weight)>();\n    RVA = rva;\n    Weight = TimeSpan.Zero;\n  }\n\n  public long RVA { get; set; }\n  public TimeSpan Weight { get; set; }\n  //? TODO: Consider using TinyList\n  public List<(ProfileCallTreeNode Node, TimeSpan Weight)> Targets { get; set; }\n\n  public List<(ProfileCallTreeNode Node, TimeSpan Weight)> SortedTargets {\n    get {\n      if (!HasSingleTarget) {\n        Targets.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n      }\n\n      return Targets;\n    }\n  }\n\n  public bool HasSingleTarget => Targets.Count == 1;\n\n  public bool Equals(ProfileCallSite other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return RVA == other.RVA;\n  }\n\n  public static bool operator ==(ProfileCallSite left, ProfileCallSite right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileCallSite left, ProfileCallSite right) {\n    return !Equals(left, right);\n  }\n\n  public double ScaleWeight(TimeSpan weight) {\n    return weight.Ticks / (double)Weight.Ticks;\n  }\n\n  public void AddTarget(ProfileCallTreeNode node, TimeSpan weight) {\n    Weight += weight; // Total weight of targets.\n    int index = -1;\n\n    // Don't use FindIndex because it allocates a lambda on each invocation.\n    for (int i = 0; i < Targets.Count; i++) {\n      if (Targets[i].Node.Equals(node.Function)) {\n        index = i;\n        break;\n      }\n    }\n\n    if (index != -1) {\n      var span = CollectionsMarshal.AsSpan(Targets);\n      span[index].Weight += weight; // Modify in-place per-target weight.\n    }\n    else {\n      Targets.Add((node, weight));\n    }\n  }\n\n  public void MergeWith(ProfileCallSite otherCallSite) {\n    Weight += otherCallSite.Weight;\n\n    foreach (var target in otherCallSite.Targets) {\n      AddTarget(target.Node, target.Weight);\n    }\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((ProfileCallSite)obj);\n  }\n\n  public override int GetHashCode() {\n    return RVA.GetHashCode();\n  }\n\n  public override string ToString() {\n    return $\"RVA: {RVA}, Weight: {Weight.TotalMilliseconds}, Targets: {Targets.Count}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/CallTree/ProfileCallTree.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.CallTree;\n\npublic enum ProfileCallTreeNodeKind {\n  Unset = 0,\n  NativeUser = 1,\n  NativeKernel = 2,\n  Managed = 3\n}\n\npublic sealed class ProfileCallTree {\n  private ConcurrentDictionary<IRTextFunction, ProfileCallTreeNode> rootNodes_;\n  private Dictionary<IRTextFunction, List<ProfileCallTreeNode>> funcToNodesMap_;\n  private Dictionary<long, ProfileCallTreeNode> nodeIdMap_;\n  private int nextNodeId_;\n\n  public ProfileCallTree(int startId = 0) {\n    nextNodeId_ = startId;\n    InitializeReferenceMembers();\n  }\n\n  public List<ProfileCallTreeNode> RootNodes => rootNodes_.ToValueList();\n\n  public TimeSpan TotalRootNodesWeight {\n    get {\n      var sum = TimeSpan.Zero;\n\n      foreach (var node in rootNodes_) {\n        sum += node.Value.Weight;\n      }\n\n      return sum;\n    }\n  }\n\n  public void UpdateCallTree(ref ProfileSample sample, ResolvedProfileStack resolvedStack) {\n    // Build call tree. Note that the call tree methods themselves are thread-safe.\n    bool isRootFrame = true;\n    ProfileCallTreeNode prevNode = null;\n    ResolvedProfileStackFrame prevFrame = null;\n    var sampleWeight = sample.Weight;\n\n    for (int k = resolvedStack.FrameCount - 1; k >= 0; k--) {\n      var resolvedFrame = resolvedStack.StackFrames[k];\n\n      if (resolvedFrame.FrameRVA == 0 && resolvedFrame.FrameDetails.DebugInfo == null) {\n        continue;\n      }\n\n      ProfileCallTreeNode node = null;\n\n      if (isRootFrame) {\n        node = AddRootNode(resolvedFrame.FrameDetails.DebugInfo, resolvedFrame.FrameDetails.Function);\n        isRootFrame = false;\n      }\n      else {\n        node = AddChildNode(prevNode, resolvedFrame.FrameDetails.DebugInfo, resolvedFrame.FrameDetails.Function);\n        prevNode.AddCallSite(node, prevFrame.FrameRVA, sampleWeight);\n      }\n\n      node.AccumulateWeight(sampleWeight);\n      node.AccumulateWeight(sampleWeight, TimeSpan.Zero, resolvedStack.Context.ThreadId);\n\n      // Set the user/kernel-mode context of the function.\n      if (node.Kind == ProfileCallTreeNodeKind.Unset) {\n        if (resolvedFrame.FrameDetails.IsKernelCode) {\n          node.Kind = ProfileCallTreeNodeKind.NativeKernel;\n        }\n        else if (resolvedFrame.FrameDetails.IsManagedCode) {\n          node.Kind = ProfileCallTreeNodeKind.Managed;\n        }\n        else {\n          node.Kind = ProfileCallTreeNodeKind.NativeUser;\n        }\n      }\n\n      //node.RecordSample(sample, resolvedFrame); //? Remove\n      prevNode = node;\n      prevFrame = resolvedFrame;\n    }\n\n    // Last function on the stack gets the exclusive weight.\n    if (prevNode != null) {\n      prevNode.AccumulateExclusiveWeight(sampleWeight);\n      prevNode.AccumulateWeight(TimeSpan.Zero, sampleWeight, resolvedStack.Context.ThreadId);\n    }\n  }\n\n  private ProfileCallTreeNode AddRootNode(FunctionDebugInfo funcInfo, IRTextFunction function) {\n    if (rootNodes_.TryGetValue(function, out var existingNode)) {\n      return existingNode;\n    }\n\n    var node = rootNodes_.GetOrAdd(function, static (func, info) => new ProfileCallTreeNode(info, func), funcInfo);\n    RegisterFunctionTreeNode(node);\n    return node;\n  }\n\n  private ProfileCallTreeNode AddChildNode(ProfileCallTreeNode node, FunctionDebugInfo funcInfo,\n                                           IRTextFunction function) {\n    (var childNode, bool isNewNode) = node.AddChild(funcInfo, function);\n\n    if (isNewNode) {\n      RegisterFunctionTreeNode(childNode);\n    }\n\n    return childNode;\n  }\n\n  private void RegisterFunctionTreeNode(ProfileCallTreeNode node) {\n    // Add an unique instance of the node for a function.\n    node.Id = Interlocked.Increment(ref nextNodeId_);\n    ref var nodeList = ref CollectionsMarshal.GetValueRefOrAddDefault(funcToNodesMap_, node.Function, out bool exists);\n\n    if (!exists) {\n      nodeList = new List<ProfileCallTreeNode>();\n    }\n\n    nodeList.Add(node);\n  }\n\n  public ProfileCallTreeNode FindNode(long nodeId) {\n    // Build mapping on-demand.\n    if (nodeIdMap_ == null) {\n      if (nodeIdMap_ == null) {\n        nodeIdMap_ = new Dictionary<long, ProfileCallTreeNode>(funcToNodesMap_.Count);\n\n        foreach (var list in funcToNodesMap_.Values) {\n          foreach (var node in list) {\n            nodeIdMap_[node.Id] = node;\n          }\n        }\n      }\n    }\n\n    return nodeIdMap_.GetValueOrNull(nodeId);\n  }\n\n  public ProfileCallTreeNode FindMatchingNode(ProfileCallTreeNode queryNode) {\n    // Find in the call tree node that corresponds to\n    // a node from another instance of a call tree.\n    if (queryNode.IsGroup) {\n      return null;\n    }\n\n    if (!funcToNodesMap_.TryGetValue(queryNode.Function, out var nodeList)) {\n      return null;\n    }\n\n    foreach (var node in nodeList) {\n      if (ReferenceEquals(node, queryNode)) {\n        return node; // Shortcut for same call tree instance.\n      }\n\n      // Since the IRTextFunctions remain stable across a session,\n      // check the equivalence of the nodes by looking at the\n      // function in each stack frame (parent) up to the root.\n      var nodeA = node;\n      var nodeB = queryNode;\n\n      while (nodeA != null && nodeB != null) {\n        if (!nodeA.Function.Equals(nodeB.Function)) {\n          break;\n        }\n\n        nodeA = nodeA.Caller;\n        nodeB = nodeB.Caller;\n      }\n\n      if (nodeA == null && nodeB == null) {\n        return node; // Reached root from both nodes.\n      }\n    }\n\n    return null;\n  }\n\n  public List<ProfileCallTreeNode> GetCallTreeNodes(IRTextFunction function) {\n    if (funcToNodesMap_.TryGetValue(function, out var nodeList)) {\n      return nodeList;\n    }\n\n    return new List<ProfileCallTreeNode>();\n  }\n\n  public List<ProfileCallTreeNode> GetSortedCallTreeNodes(IRTextFunction function) {\n    var nodeList = GetCallTreeNodes(function);\n\n    if (nodeList.Count < 2) {\n      return nodeList;\n    }\n\n    // Make a copy of the list since it's shared with all other instances\n    // of the node and it may be iterated on another thread, sorting may\n    // modify the list which invalidates iteration and throws.\n    var nodeListCopy = new List<ProfileCallTreeNode>(nodeList);\n    nodeListCopy.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n    return nodeListCopy;\n  }\n\n  public ProfileCallTreeNode GetCombinedCallTreeNode(IRTextFunction function, ProfileCallTreeNode parentNode = null) {\n    var nodes = GetSortedCallTreeNodes(function);\n    return CombinedCallTreeNodesImpl(nodes, true, parentNode);\n  }\n\n  public static ProfileCallTreeNode CombinedCallTreeNodes(List<ProfileCallTreeNode> nodes,\n                                                          bool combineLists = true) {\n    var nodeListCopy = new List<ProfileCallTreeNode>(nodes);\n    nodeListCopy.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n    return CombinedCallTreeNodesImpl(nodeListCopy, combineLists);\n  }\n\n  public static TimeSpan CombinedCallTreeNodesWeight(List<ProfileCallTreeNode> nodes) {\n    if (nodes.Count == 0) {\n      return TimeSpan.Zero;\n    }\n\n    var combinedNode = CombinedCallTreeNodes(nodes, false);\n    return combinedNode.Weight;\n  }\n\n  private static ProfileCallTreeNode CombinedCallTreeNodesImpl(List<ProfileCallTreeNode> nodes,\n                                                               bool combineLists = true,\n                                                               ProfileCallTreeNode parentNode = null) {\n    if (nodes == null || nodes.Count == 0) {\n      return new ProfileCallTreeGroupNode();\n    }\n\n    if (nodes.Count == 1) {\n      return nodes[0];\n    }\n\n    // Sort by weight so that parent nodes (more inclusive time)\n    // get processed first and have the recursive instances ignored.\n    var handledNodes = new HashSet<ProfileCallTreeNode>();\n    var comparer = new ProfileCallTreeNodeComparer();\n    var childrenSet = new HashSet<ProfileCallTreeNode>(comparer);\n    var callersSet = new HashSet<ProfileCallTreeNode>(comparer);\n    var callSiteMap = new Dictionary<long, ProfileCallSite>();\n    var threadsMap = new Dictionary<int, (TimeSpan, TimeSpan)>();\n    var weight = TimeSpan.Zero;\n    var excWeight = TimeSpan.Zero;\n    var kind = ProfileCallTreeNodeKind.Unset;\n\n    foreach (var node in nodes) {\n      // In case of recursive functions, the total time\n      // should not be counted again for the recursive calls.\n      // When the function is a callee, consider only the nodes that are actually being called\n      // by the parent node - by default the list contains every node representing the function,\n      // on all paths through the call tree.\n      if (parentNode != null && !node.HasParent(parentNode, comparer)) {\n        continue;\n      }\n\n      // If the node is being called by another\n      // instance recursively which has its total time counted,\n      // don't count the total time of this instance.\n      bool countWeight = !NodeParentWasHandled(node, handledNodes);\n\n      if (countWeight) {\n        weight += node.Weight;\n        handledNodes.Add(node);\n      }\n\n      excWeight += node.ExclusiveWeight;\n      kind = node.Kind;\n\n      if (!combineLists) {\n        continue;\n      }\n\n      // Sum up per-thread weights.\n      if (node.HasThreadWeights) {\n        foreach (var pair in node.ThreadWeights) {\n          threadsMap.AccumulateValue(pair.Key,\n                                     countWeight ? pair.Value.Weight : TimeSpan.Zero,\n                                     pair.Value.ExclusiveWeight);\n        }\n      }\n\n      if (node.HasChildren) {\n        foreach (var childNode in node.Children) {\n          if (!childrenSet.TryGetValue(childNode, out var existingNode)) {\n            existingNode = new ProfileCallTreeNode(childNode.FunctionDebugInfo, childNode.Function);\n            existingNode.Id = childNode.Id;\n            childrenSet.Add(existingNode);\n          }\n\n          existingNode.AccumulateWeight(childNode.Weight);\n          existingNode.AccumulateExclusiveWeight(childNode.ExclusiveWeight);\n        }\n      }\n\n      if (node.HasCallers) {\n        void HandleCaller(ProfileCallTreeNode caller) {\n          if (!callersSet.TryGetValue(caller, out var existingNode)) {\n            existingNode = new ProfileCallTreeNode(caller.FunctionDebugInfo, caller.Function);\n            existingNode.Id = caller.Id;\n            callersSet.Add(existingNode);\n          }\n\n          existingNode.AccumulateWeight(caller.Weight);\n          existingNode.AccumulateExclusiveWeight(caller.ExclusiveWeight);\n        }\n\n        if (node is ProfileCallTreeGroupNode groupNode) {\n          foreach (var caller in groupNode.Callers) {\n            HandleCaller(caller);\n          }\n        }\n        else {\n          HandleCaller(node.Caller);\n        }\n      }\n\n      if (node.HasCallSites) {\n        foreach (var pair in node.CallSites) {\n          ref var callsite = ref CollectionsMarshal.GetValueRefOrAddDefault(callSiteMap, pair.Key, out bool exists);\n\n          if (!exists) {\n            callsite = new ProfileCallSite(pair.Key);\n          }\n\n          foreach (var target in pair.Value.Targets) {\n            callsite.AddTarget(target.Node, target.Weight);\n          }\n        }\n      }\n    }\n\n    return new ProfileCallTreeGroupNode(nodes[0].FunctionDebugInfo, nodes[0].Function, nodes,\n                                        childrenSet.ToList(), callersSet.ToList(),\n                                        callSiteMap, threadsMap) {\n      Weight = weight, ExclusiveWeight = excWeight,\n      Kind = kind\n    };\n  }\n\n  private static bool NodeParentWasHandled(ProfileCallTreeNode node, HashSet<ProfileCallTreeNode> handledNodes) {\n    if (!node.IsGroup) {\n      var callerNode = node.Caller;\n\n      while (callerNode != null) {\n        if (handledNodes.Contains(callerNode)) {\n          return true;\n        }\n\n        callerNode = callerNode.Caller;\n      }\n    }\n\n    return false;\n  }\n\n  public TimeSpan GetCombinedCallTreeNodeWeight(IRTextFunction function) {\n    var nodes = GetCallTreeNodes(function);\n\n    if (nodes == null) {\n      return TimeSpan.Zero;\n    }\n\n    var combinedNode = CombinedCallTreeNodesImpl(nodes, false);\n    return combinedNode.Weight;\n  }\n\n  public List<ProfileCallTreeNode> GetBacktrace(ProfileCallTreeNode node) {\n    var list = new List<ProfileCallTreeNode>();\n\n    // For multiple node groups there is no proper backtrace.\n    if (node is ProfileCallTreeGroupNode groupNode &&\n        groupNode.Nodes.Count > 1) {\n      return list;\n    }\n\n    while (node.HasCallers) {\n      list.Add(node.Callers[0]);\n      node = node.Callers[0];\n    }\n\n    return list;\n  }\n\n  public List<ProfileCallTreeNode> GetTopFunctions(ProfileCallTreeNode node) {\n    return GetTopFunctionsAndModules(node).Functions;\n  }\n\n  public List<ModuleProfileInfo> GetTopModules(ProfileCallTreeNode node) {\n    return GetTopFunctionsAndModules(node).Modules;\n  }\n\n  public (List<ProfileCallTreeNode> Functions,\n    List<ModuleProfileInfo> Modules) GetTopFunctionsAndModules(ProfileCallTreeNode node) {\n    var moduleMap = new Dictionary<string, ModuleProfileInfo>();\n    var funcMap = new Dictionary<IRTextFunction, ProfileCallTreeNode>();\n\n    if (node is ProfileCallTreeGroupNode groupNode) {\n      foreach (var nestedNode in groupNode.Nodes) {\n        CollectFunctionsAndModules(nestedNode, funcMap, moduleMap);\n      }\n    }\n    else {\n      CollectFunctionsAndModules(node, funcMap, moduleMap);\n    }\n\n    // In case of recursive functions, the total time\n    // should not be counted again for the recursive calls.\n    var handledNodes = new HashSet<ProfileCallTreeNode>();\n\n    foreach (var collectedNode in funcMap.Values) {\n      var collectedGroupNode = collectedNode as ProfileCallTreeGroupNode;\n\n      if (collectedGroupNode.Nodes.Count == 1) {\n        collectedGroupNode.Weight = collectedGroupNode.Nodes[0].Weight;\n        collectedGroupNode.ExclusiveWeight = collectedGroupNode.Nodes[0].ExclusiveWeight;\n      }\n      else if (collectedGroupNode.Nodes.Count > 1) {\n        collectedGroupNode.Nodes.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n        handledNodes.Clear();\n\n        foreach (var instanceNode in collectedGroupNode.Nodes) {\n          // If the node is being called by another\n          // instance recursively which has its total time counted,\n          // don't count the total time of this instance.\n          bool countWeight = !NodeParentWasHandled(node, handledNodes);\n          collectedGroupNode.ExclusiveWeight += instanceNode.ExclusiveWeight;\n\n          if (countWeight) {\n            collectedGroupNode.Weight += instanceNode.Weight;\n            handledNodes.Add(instanceNode);\n          }\n        }\n      }\n    }\n\n    // Compute time percentage per module.\n    var moduleList = new List<ModuleProfileInfo>(moduleMap.Count);\n\n    foreach (var module in moduleMap.Values) {\n      module.Percentage = node.ScaleWeight(module.Weight);\n      moduleList.Add(module);\n    }\n\n    moduleList.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n    var funcList = funcMap.ToValueList();\n    funcList.Sort((a, b) => b.ExclusiveWeight.CompareTo(a.ExclusiveWeight));\n    return (funcList, moduleList);\n  }\n\n  private void CollectFunctionsAndModules(ProfileCallTreeNode node,\n                                          Dictionary<IRTextFunction, ProfileCallTreeNode> funcMap,\n                                          Dictionary<string, ModuleProfileInfo> moduleMap) {\n    // Combine all instances of a function under the node.\n    ref var entry = ref CollectionsMarshal.GetValueRefOrAddDefault(funcMap, node.Function, out bool exists);\n\n    if (!exists) {\n      entry = new ProfileCallTreeGroupNode(node.FunctionDebugInfo, node.Function, node.Kind);\n    }\n\n    var groupEntry = (ProfileCallTreeGroupNode)entry;\n    groupEntry.Nodes.Add(node);\n    //groupEntry.AccumulateWeight(node.Weight);\n    //groupEntry.AccumulateExclusiveWeight(node.ExclusiveWeight);\n\n    // Collect time and functions per module.\n    ref var moduleEntry =\n      ref CollectionsMarshal.GetValueRefOrAddDefault(moduleMap, node.ModuleName, out bool moduleExists);\n\n    if (!moduleExists) {\n      moduleEntry = new ModuleProfileInfo(node.ModuleName);\n    }\n\n    moduleEntry.Weight += node.ExclusiveWeight;\n    moduleEntry.Functions.Add(groupEntry);\n\n    if (node.HasChildren) {\n      foreach (var childNode in node.Children) {\n        CollectFunctionsAndModules(childNode, funcMap, moduleMap);\n      }\n    }\n  }\n\n  public void MergeWith(ProfileCallTree otherTree) {\n    // Recursively merge the common root nodes\n    // and copy over any new root nodes.\n    foreach (var rootNode in otherTree.rootNodes_) {\n      if (rootNodes_.TryGetValue(rootNode.Key, out var existingRootNode)) {\n        existingRootNode.MergeWith(rootNode.Value);\n      }\n      else {\n        rootNodes_[rootNode.Key] = rootNode.Value;\n      }\n    }\n\n    // Merge the other data structures.\n    if (otherTree.funcToNodesMap_ != null) {\n      funcToNodesMap_ ??= new Dictionary<IRTextFunction, List<ProfileCallTreeNode>>();\n      var existingNodesSet = new HashSet<ProfileCallTreeNode>();\n\n      foreach (var list in funcToNodesMap_.Values) {\n        foreach (var node in list) {\n          existingNodesSet.Add(node);\n        }\n      }\n\n      foreach (var pair in otherTree.funcToNodesMap_) {\n        ref var existingList =\n          ref CollectionsMarshal.GetValueRefOrAddDefault(funcToNodesMap_, pair.Key, out bool exists);\n\n        if (exists) {\n          // A function present in both tree, add the nodes that are missing.\n          foreach (var node in pair.Value) {\n            if (!node.IsMergeNode() && !existingNodesSet.Contains(node)) {\n              existingList.Add(node);\n            }\n\n            node.ClearIsMergedNode();\n          }\n        }\n        else {\n          // A function present only in the other tree.\n          existingList = pair.Value;\n        }\n      }\n    }\n\n    if (otherTree.nodeIdMap_ != null) {\n      nodeIdMap_ ??= new Dictionary<long, ProfileCallTreeNode>();\n\n      foreach (var pair in otherTree.nodeIdMap_) {\n        nodeIdMap_[pair.Key] = pair.Value;\n      }\n    }\n  }\n\n  public string Print() {\n    var builder = new StringBuilder();\n\n    foreach (var node in rootNodes_) {\n      builder.AppendLine(\"Call tree root node\");\n      builder.AppendLine(\"-----------------------\");\n      node.Value.Print(builder);\n    }\n\n    return builder.ToString();\n  }\n\n  public void VerifyCycles() {\n    var nodeMap = new HashSet<ProfileCallTreeNode>();\n\n    foreach (var node in rootNodes_) {\n      nodeMap.Clear();\n      VerifyCycles(node.Value, nodeMap);\n    }\n  }\n\n  private void VerifyCycles(ProfileCallTreeNode node,\n                            HashSet<ProfileCallTreeNode> nodeMap) {\n    if (!nodeMap.Add(node)) {\n      Trace.WriteLine($\"Found cycle in CallTree for node {node}\");\n      Debug.Assert(false);\n      return;\n    }\n\n    if (node.HasChildren) {\n      foreach (var childNode in node.Children) {\n        VerifyCycles(childNode, nodeMap);\n      }\n    }\n  }\n\n  public string PrintNodeInstances(string funcName, bool printStack = false) {\n    var list = new List<ProfileCallTreeNode>();\n\n    foreach (var pair in rootNodes_) {\n      CollectNodeInstances(pair.Value, funcName, list);\n    }\n\n    list.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n    var weight = TimeSpan.Zero;\n    var excWeight = TimeSpan.Zero;\n\n    foreach (var node in list) {\n      weight += node.Weight;\n      excWeight += node.ExclusiveWeight;\n    }\n\n    var sb = new StringBuilder();\n    sb.AppendLine($\"Instances for {funcName}: {list.Count}\");\n    sb.AppendLine(\n      $\" - Total weight: {weight} ({weight.TotalMilliseconds} ms), excl weight: {excWeight} ({excWeight.TotalMilliseconds} ms)\");\n\n    foreach (var node in list) {\n      sb.AppendLine(\n        $\" - Weight: {node.Weight} ({node.Weight.TotalMilliseconds} ms), excl weight: {node.ExclusiveWeight} ({node.ExclusiveWeight.TotalMilliseconds} ms), children: {(node.HasChildren ? node.Children.Count : 0)}\");\n      weight += node.Weight;\n      excWeight += node.ExclusiveWeight;\n\n      if (printStack) {\n        sb.AppendLine(\"  - Stack:\");\n        var stackNode = node;\n        int index = 0;\n\n        while (stackNode != null) {\n          sb.AppendLine($\"     {index}: {stackNode.FunctionName}\");\n          stackNode = stackNode.Caller;\n          index++;\n        }\n\n        sb.AppendLine($\"  ------------------------------\");\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public void CollectNodeInstances(ProfileCallTreeNode node, string funcName, List<ProfileCallTreeNode> list) {\n    if (node.FunctionName.Equals(funcName, StringComparison.Ordinal)) {\n      list.Add(node);\n    }\n\n    if (node.HasChildren) {\n      foreach (var child in node.Children) {\n        CollectNodeInstances(child, funcName, list);\n      }\n    }\n  }\n\n  public override string ToString() {\n    return $\"Root nodes: {rootNodes_.Count}, Weight: {TotalRootNodesWeight}\";\n  }\n\n  private void InitializeReferenceMembers() {\n    rootNodes_ ??= new ConcurrentDictionary<IRTextFunction, ProfileCallTreeNode>();\n    funcToNodesMap_ ??= new Dictionary<IRTextFunction, List<ProfileCallTreeNode>>();\n  }\n\n  public void ResetTags() {\n    foreach (var list in funcToNodesMap_.Values) {\n      foreach (var node in list) {\n        node.Tag = null;\n      }\n    }\n  }\n\n  public ProfileCallTreeNode FindRootNode(IRTextFunction func) {\n    if (rootNodes_.TryGetValue(func, out var node)) {\n      return node;\n    }\n\n    return null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/CallTree/ProfileCallTreeNode.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Collections;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.CallTree;\n\npublic class ProfileCallTreeNode : IEquatable<ProfileCallTreeNode> {\n  private static readonly object MergedNodeTag = new();\n  public int Id { get; set; }\n  public IRTextFunction Function { get; set; }\n  public ProfileCallTreeNodeKind Kind { get; set; }\n  private TinyList<ProfileCallTreeNode> children_;\n  private ProfileCallTreeNode caller_; // Can't be serialized, reconstructed.\n  public FunctionDebugInfo FunctionDebugInfo { get; set; }\n\n  //? TODO: Replace Threads dict and CallSites with a TinyDictionary-like data struct\n  //? like TinyList, also consider DictionarySlim instead of Dictionary from\n  //? https://github.com/dotnet/corefxlab/blob/archive/src/Microsoft.Experimental.Collections/Microsoft/Collections/Extensions/DictionarySlim\n  public Dictionary<long, ProfileCallSite> CallSites { get; set; }\n  public Dictionary<int, (TimeSpan Weight, TimeSpan ExclusiveWeight)> ThreadWeights { get; set; }\n  public TimeSpan Weight { get; set; }\n  public TimeSpan ExclusiveWeight { get; set; }\n  public object Tag { get; set; }\n  public virtual List<ProfileCallTreeNode> Nodes => new() {this};\n  public IList<ProfileCallTreeNode> Children => children_;\n  public virtual List<ProfileCallTreeNode> Callers => new() {caller_};\n#if DEBUG\n  public ProfileCallTreeNode Caller =>\n    !IsGroup ? caller_ : throw new InvalidOperationException(\"For group use Callers\");\n#else\n  public ProfileCallTreeNode Caller => caller_;\n#endif\n  public virtual bool IsGroup => false;\n  public bool HasChildren => Children != null && Children.Count > 0;\n  public virtual bool HasCallers => caller_ != null;\n  public bool HasCallSites => CallSites != null && CallSites.Count > 0;\n  public bool HasThreadWeights => ThreadWeights != null && ThreadWeights.Count > 0;\n  public bool HasFunction => Function != null;\n  public string FunctionName => Function.Name;\n  public string ModuleName => Function.ModuleName;\n\n  public double ScaleWeight(TimeSpan relativeWeigth) {\n    return relativeWeigth.Ticks / (double)Weight.Ticks;\n  }\n\n  public (TimeSpan Weight, TimeSpan ExclusiveWeight) ChildrenWeight {\n    get {\n      var weight = TimeSpan.Zero;\n      var exclusiveWeight = TimeSpan.Zero;\n\n      if (!HasChildren) {\n        return (weight, exclusiveWeight);\n      }\n\n      foreach (var child in Children) {\n        weight += child.Weight;\n        exclusiveWeight += child.ExclusiveWeight;\n      }\n\n      return (weight, exclusiveWeight);\n    }\n  }\n\n  protected ProfileCallTreeNode() { }\n\n  public ProfileCallTreeNode(FunctionDebugInfo funcInfo, IRTextFunction function,\n                             List<ProfileCallTreeNode> children = null,\n                             ProfileCallTreeNode caller = null,\n                             Dictionary<long, ProfileCallSite> callSites = null,\n                             Dictionary<int, (TimeSpan, TimeSpan)> threadWeights = null) {\n    FunctionDebugInfo = funcInfo;\n    Function = function;\n    ThreadWeights = threadWeights ?? new Dictionary<int, (TimeSpan, TimeSpan)>();\n    children_ = new TinyList<ProfileCallTreeNode>(children);\n    caller_ = caller;\n    CallSites = callSites;\n  }\n\n  public void AccumulateWeight(TimeSpan weight) {\n    Weight += weight;\n  }\n\n  public void AccumulateWeight(TimeSpan weight, TimeSpan exclusiveWeight, int threadId) {\n    ThreadWeights.AccumulateValue(threadId, weight, exclusiveWeight);\n  }\n\n  public List<(int ThreadId, (TimeSpan Weight, TimeSpan ExclusiveWeight) Values)>\n    SortedByWeightPerThreadWeights {\n    get {\n      var list = ThreadWeights.ToList();\n      list.Sort((a, b) => b.Item2.Weight.CompareTo(a.Item2.Weight));\n      return list;\n    }\n  }\n\n  public List<(int ThreadId, (TimeSpan Weight, TimeSpan ExclusiveWeight) Values)>\n    SortedByIdPerThreadWeights {\n    get {\n      var list = ThreadWeights.ToList();\n      list.Sort((a, b) => a.Item1.CompareTo(b.Item1));\n      return list;\n    }\n  }\n\n  public void AccumulateExclusiveWeight(TimeSpan weight) {\n    ExclusiveWeight += weight;\n  }\n\n  public (ProfileCallTreeNode, bool) AddChild(FunctionDebugInfo functionDebugInfo, IRTextFunction function) {\n    return GetOrCreateChildNode(functionDebugInfo, function);\n  }\n\n  public bool HasChild(ProfileCallTreeNode node) {\n    return children_.Contains(node);\n  }\n\n  public ProfileCallTreeNode FindChildNode(IRTextFunction function) {\n    return children_.Find(node => node.Function == function);\n  }\n\n  internal void SetChildrenNoLock(List<ProfileCallTreeNode> children) {\n    // Used by ProfileCallTree.Deserialize.\n    children_ = new TinyList<ProfileCallTreeNode>(children);\n  }\n\n  internal void SetParent(ProfileCallTreeNode parentNode) {\n    // Used by ProfileCallTree.Deserialize.\n    caller_ = parentNode;\n  }\n\n  public bool HasParent(ProfileCallTreeNode parentNode, ProfileCallTreeNodeComparer comparer) {\n    return caller_ != null && comparer.Equals(caller_, parentNode);\n  }\n\n  private (ProfileCallTreeNode, bool)\n    GetOrCreateChildNode(FunctionDebugInfo functionDebugInfo, IRTextFunction function) {\n    var childNode = FindExistingNode(functionDebugInfo, function);\n\n    if (childNode != null) {\n      return (childNode, false);\n    }\n\n    childNode = new ProfileCallTreeNode(functionDebugInfo, function, null, this);\n    children_.Add(childNode);\n    return (childNode, true);\n  }\n\n  public void AddCallSite(ProfileCallTreeNode childNode, long rva, TimeSpan weight) {\n    CallSites ??= new Dictionary<long, ProfileCallSite>();\n    ref var callsite = ref CollectionsMarshal.GetValueRefOrAddDefault(CallSites, rva, out bool exists);\n\n    if (!exists) {\n      callsite = new ProfileCallSite(rva);\n    }\n\n    callsite.AddTarget(childNode, weight);\n  }\n\n  private ProfileCallTreeNode FindExistingNode(FunctionDebugInfo functionDebugInfo, IRTextFunction function) {\n    for (int i = 0; i < children_.Count; i++) {\n      var child = children_[i];\n\n      if (child.Equals(function)) {\n        return child;\n      }\n    }\n\n    return null;\n  }\n\n  public void MergeWith(ProfileCallTreeNode otherNode) {\n    // Accumulate the weights and merge all data structures,\n    // then recursively merge the common child nodes\n    // and copy over any new child nodes.\n    otherNode.Tag = MergedNodeTag; // Mark node as merged to be discarded later.\n    Weight += otherNode.Weight;\n    ExclusiveWeight += otherNode.ExclusiveWeight;\n\n    if (otherNode.HasCallSites) {\n      CallSites ??= new Dictionary<long, ProfileCallSite>();\n\n      foreach (var callSite in otherNode.CallSites) {\n        ref var existingCallSite =\n          ref CollectionsMarshal.GetValueRefOrAddDefault(CallSites, callSite.Key, out bool exists);\n\n        if (!exists) {\n          existingCallSite = callSite.Value;\n        }\n        else {\n          existingCallSite.MergeWith(callSite.Value);\n        }\n      }\n    }\n\n    if (otherNode.HasThreadWeights) {\n      ThreadWeights ??= new Dictionary<int, (TimeSpan Weight, TimeSpan ExclusiveWeight)>();\n\n      foreach (var threadWeight in otherNode.ThreadWeights) {\n        AccumulateWeight(threadWeight.Value.Weight, threadWeight.Value.ExclusiveWeight, threadWeight.Key);\n      }\n    }\n\n    if (otherNode.HasChildren) {\n      foreach (var child in otherNode.children_) {\n        var existingChild = FindChildNode(child.Function);\n\n        if (existingChild != null) {\n          // Recursively merge child nodes.\n          existingChild.MergeWith(child);\n        }\n        else {\n          // Copy over the child from the other node.\n          children_.Add(child);\n        }\n      }\n    }\n  }\n\n  public bool IsMergeNode() {\n    return Tag == MergedNodeTag;\n  }\n\n  public void ClearIsMergedNode() {\n    Tag = null;\n  }\n\n  internal void Print(StringBuilder builder, int level = 0, bool caller = false) {\n    builder.Append(new string(' ', level * 4));\n    builder.AppendLine($\"{FunctionDebugInfo.Name}, RVA {FunctionDebugInfo.RVA}, Id {Id}\");\n    builder.Append(new string(' ', level * 4));\n    builder.AppendLine($\"    weight {Weight.TotalMilliseconds}\");\n    builder.Append(new string(' ', level * 4));\n    builder.AppendLine($\"    exc weight {ExclusiveWeight.TotalMilliseconds}\");\n    builder.Append(new string(' ', level * 4));\n    builder.AppendLine($\"    callees: {(Children != null ? Children.Count : 0)}\");\n\n    if (Children != null && !caller) {\n      foreach (var child in Children) {\n        child.Print(builder, level + 1);\n      }\n    }\n  }\n\n  public bool Equals(IRTextFunction function) {\n    return Function.Equals(function);\n  }\n\n  public bool Equals(ProfileCallTreeNode other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    // Note that this holds only for nodes\n    // belonging to the same ProfileCallTree instance.\n    return Id == other.Id;\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((ProfileCallTreeNode)obj);\n  }\n\n  public override int GetHashCode() {\n    return Id.GetHashCode();\n  }\n\n  public static bool operator ==(ProfileCallTreeNode left, ProfileCallTreeNode right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileCallTreeNode left, ProfileCallTreeNode right) {\n    return !Equals(left, right);\n  }\n\n  public override string ToString() {\n    return $\"Name: {FunctionDebugInfo?.Name}\\n\" +\n           $\"RVA {FunctionDebugInfo.RVA}, Id {Id}\\n\" +\n           $\"Weight: {Weight}\\n\" +\n           $\"ExclusiveWeight: {ExclusiveWeight}\\n\" +\n           $\"Children: {Children?.Count ?? 0}\\n\" +\n           $\"CallSites: {CallSites?.Count ?? 0}\";\n  }\n\n  public ProfileCallTreeNode Clone() {\n    return new ProfileCallTreeNode {\n      Id = Id,\n      Kind = Kind,\n      Function = Function,\n      FunctionDebugInfo = FunctionDebugInfo,\n      Weight = Weight,\n      ExclusiveWeight = ExclusiveWeight,\n      children_ = children_,\n      caller_ = caller_,\n      CallSites = CallSites\n    };\n  }\n}\n\npublic sealed class ProfileCallTreeGroupNode : ProfileCallTreeNode {\n  private List<ProfileCallTreeNode> nodes_;\n  private List<ProfileCallTreeNode> callers_;\n\n  public ProfileCallTreeGroupNode() {\n  }\n\n  public ProfileCallTreeGroupNode(FunctionDebugInfo funcInfo, IRTextFunction function,\n                                  List<ProfileCallTreeNode> nodes = null,\n                                  List<ProfileCallTreeNode> children = null,\n                                  List<ProfileCallTreeNode> callers = null,\n                                  Dictionary<long, ProfileCallSite> callSites = null,\n                                  Dictionary<int, (TimeSpan, TimeSpan)> threadWeights = null) :\n    base(funcInfo, function, children, null, callSites, threadWeights) {\n    nodes_ = nodes ?? new List<ProfileCallTreeNode>();\n    callers_ = callers ?? new List<ProfileCallTreeNode>();\n  }\n\n  public ProfileCallTreeGroupNode(FunctionDebugInfo funcInfo, IRTextFunction function,\n                                  ProfileCallTreeNodeKind kind) :\n    base(funcInfo, function) {\n    nodes_ = new List<ProfileCallTreeNode>();\n    Kind = kind;\n  }\n\n  public ProfileCallTreeGroupNode(ProfileCallTreeNode baseNode, TimeSpan weight) :\n    this(baseNode.FunctionDebugInfo, baseNode.Function) {\n    nodes_.Add(baseNode);\n    Weight = weight;\n  }\n\n  public override bool IsGroup => true;\n  public override List<ProfileCallTreeNode> Nodes => nodes_;\n  public override List<ProfileCallTreeNode> Callers => callers_;\n  public override bool HasCallers => callers_ != null && callers_.Count > 0;\n\n  public override string ToString() {\n    return $\"{FunctionDebugInfo.Name}, RVA {FunctionDebugInfo.RVA}, Id {Id}, Nodes: {nodes_.Count}\";\n  }\n}\n\n// Comparer used for the root nodes in order to ignore the ID part.\npublic class ProfileCallTreeNodeComparer : IEqualityComparer<ProfileCallTreeNode> {\n  public bool Equals(ProfileCallTreeNode x, ProfileCallTreeNode y) {\n    return x.Equals(y.Function);\n  }\n\n  public int GetHashCode(ProfileCallTreeNode obj) {\n    return HashCode.Combine(obj.Function);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/FunctionProfileData.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic class FunctionProfileData {\n  public FunctionProfileData() {\n    InstructionWeight = new Dictionary<long, TimeSpan>();\n    SampleStartIndex = int.MaxValue;\n    SampleEndIndex = int.MinValue;\n  }\n\n  public FunctionProfileData(FunctionDebugInfo debugInfo) : this() {\n    FunctionDebugInfo = debugInfo;\n  }\n\n  public TimeSpan Weight { get; set; }\n  public TimeSpan ExclusiveWeight { get; set; }\n  public Dictionary<long, TimeSpan> InstructionWeight { get; set; } // Instr. offset mapping\n  public Dictionary<long, PerformanceCounterValueSet> InstructionCounters { get; set; }\n  public FunctionDebugInfo FunctionDebugInfo { get; set; }\n  public int SampleStartIndex { get; set; }\n  public int SampleEndIndex { get; set; }\n  public bool HasPerformanceCounters => InstructionCounters is {Count: > 0};\n\n  public void MergeWith(FunctionProfileData otherData) {\n    Weight += otherData.Weight;\n    ExclusiveWeight += otherData.ExclusiveWeight;\n    SampleStartIndex = Math.Min(SampleStartIndex, otherData.SampleStartIndex);\n    SampleEndIndex = Math.Max(SampleEndIndex, otherData.SampleEndIndex);\n\n    foreach (var pair in otherData.InstructionWeight) {\n      ref var existingValue =\n        ref CollectionsMarshal.GetValueRefOrAddDefault(InstructionWeight, pair.Key, out bool exists);\n      existingValue += pair.Value;\n    }\n\n    if (otherData.HasPerformanceCounters) {\n      InstructionCounters ??= new Dictionary<long, PerformanceCounterValueSet>();\n\n      foreach (var pair in otherData.InstructionCounters) {\n        ref var existingValue =\n          ref CollectionsMarshal.GetValueRefOrAddDefault(InstructionCounters, pair.Key, out bool exists);\n\n        if (exists) {\n          existingValue.Add(pair.Value);\n        }\n        else {\n          existingValue = pair.Value;\n        }\n      }\n    }\n  }\n\n  public static bool TryFindElementForOffset(AssemblyMetadataTag metadataTag, long offset,\n                                             ICompilerIRInfo ir,\n                                             out IRElement element) {\n    var offsetData = ir.InstructionOffsetData;\n    int multiplier = offsetData.InitialMultiplier;\n\n    do {\n      long candidateOffset = Math.Max(0, offset - multiplier * offsetData.OffsetAdjustIncrement);\n\n      if (metadataTag.OffsetToElementMap.TryGetValue(candidateOffset, out element)) {\n        return true;\n      }\n\n      ++multiplier;\n    } while (multiplier * offsetData.OffsetAdjustIncrement < offsetData.MaxOffsetAdjust);\n\n    return false;\n  }\n\n  public void AddCounterSample(long instrOffset, int perfCounterId, long value) {\n    InstructionCounters ??= new Dictionary<long, PerformanceCounterValueSet>();\n    var counterSet = InstructionCounters.GetOrAddValue(instrOffset);\n    counterSet.AddCounterSample(perfCounterId, value);\n  }\n\n  public void AddInstructionSample(long instrOffset, TimeSpan weight) {\n    if (InstructionWeight.TryGetValue(instrOffset, out var currentWeight)) {\n      InstructionWeight[instrOffset] = currentWeight + weight;\n    }\n    else {\n      InstructionWeight[instrOffset] = weight;\n    }\n  }\n\n  public double ScaleWeight(TimeSpan weight) {\n    return weight.Ticks / (double)Weight.Ticks;\n  }\n\n  public FunctionProcessingResult Process(FunctionIR function, ICompilerIRInfo ir) {\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n    bool hasInstrOffsetMetadata = metadataTag != null && metadataTag.OffsetToElementMap.Count > 0;\n\n    if (!hasInstrOffsetMetadata) {\n      return null;\n    }\n\n    var result = new FunctionProcessingResult(metadataTag.OffsetToElementMap.Count);\n\n    foreach (var pair in InstructionWeight) {\n      if (TryFindElementForOffset(metadataTag, pair.Key, ir, out var element)) {\n        result.SampledElements.Add((element, pair.Value));\n        result.BlockSampledElementsMap.AccumulateValue(element.ParentBlock, pair.Value);\n      }\n    }\n\n    if (HasPerformanceCounters) {\n      foreach (var pair in InstructionCounters) {\n        if (TryFindElementForOffset(metadataTag, pair.Key, ir, out var element)) {\n          result.CounterElements.Add((element, pair.Value));\n        }\n\n        result.FunctionCountersValue.Add(pair.Value);\n      }\n    }\n\n    result.BlockSampledElements = result.BlockSampledElementsMap.ToList();\n    result.SortSampledElements();\n    return result;\n  }\n\n  public SourceLineProcessingResult ProcessSourceLines(IDebugInfoProvider debugInfo,\n                                                       ICompilerIRInfo ir,\n                                                       SourceStackFrame inlinee = null) {\n    var result = new SourceLineProcessingResult();\n    int firstLine = int.MaxValue;\n    int lastLine = int.MinValue;\n    var offsetData = ir.InstructionOffsetData;\n\n    var firstLineInfo = debugInfo.FindSourceLineByRVA(FunctionDebugInfo.RVA);\n\n    if (!firstLineInfo.IsUnknown) {\n      firstLine = firstLineInfo.Line;\n    }\n\n    var lastLineInfo = debugInfo.FindSourceLineByRVA(FunctionDebugInfo.EndRVA);\n\n    if (!lastLineInfo.IsUnknown) {\n      lastLine = lastLineInfo.Line;\n    }\n\n    foreach (var pair in InstructionWeight) {\n      long rva = pair.Key + FunctionDebugInfo.RVA - offsetData.InitialMultiplier;\n      var lineInfo = debugInfo.FindSourceLineByRVA(rva, inlinee != null);\n\n      if (!lineInfo.IsUnknown) {\n        int line = lineInfo.Line;\n\n        if (inlinee != null) {\n          // Map the instruction back to the function that got inlined\n          // at the call site, if filtering by an inlinee is used.\n          var matchingInlinee = lineInfo.FindSameFunctionInlinee(inlinee);\n\n          if (matchingInlinee != null) {\n            line = matchingInlinee.Line;\n          }\n          else {\n            continue; // Don't count the instr. if not part of the inlinee.\n          }\n        }\n\n        result.SourceLineWeight.AccumulateValue(line, pair.Value);\n        firstLine = Math.Min(line, firstLine);\n        lastLine = Math.Max(line, lastLine);\n      }\n    }\n\n    if (HasPerformanceCounters) {\n      foreach (var pair in InstructionCounters) {\n        long rva = pair.Key + FunctionDebugInfo.RVA;\n        var lineInfo = debugInfo.FindSourceLineByRVA(rva, inlinee != null);\n\n        if (!lineInfo.IsUnknown) {\n          int line = lineInfo.Line;\n\n          if (inlinee != null) {\n            // Map the instruction back to the function that got inlined\n            // at the call site, if filtering by an inlinee is used.\n            var matchingInlinee = lineInfo.FindSameFunctionInlinee(inlinee);\n\n            if (matchingInlinee != null) {\n              line = matchingInlinee.Line;\n            }\n            else {\n              continue; // Don't count the instr. if not part of the inlinee.\n            }\n          }\n\n          result.SourceLineCounters.AccumulateValue(line, pair.Value);\n          firstLine = Math.Min(line, firstLine);\n          lastLine = Math.Max(line, lastLine);\n        }\n\n        result.FunctionCountersValue.Add(pair.Value);\n      }\n    }\n\n    result.FirstLineIndex = firstLine;\n    result.LastLineIndex = lastLine;\n    return result;\n  }\n\n  public PerformanceCounterValueSet ComputeFunctionTotalCounters() {\n    var result = new PerformanceCounterValueSet();\n\n    if (HasPerformanceCounters) {\n      foreach (var pair in InstructionCounters) {\n        result.Add(pair.Value);\n      }\n    }\n\n    return result;\n  }\n\n  public void Reset() {\n    Weight = TimeSpan.Zero;\n    ExclusiveWeight = TimeSpan.Zero;\n    SampleStartIndex = int.MaxValue;\n    SampleEndIndex = int.MinValue;\n    InstructionWeight?.Clear();\n    InstructionCounters?.Clear();\n  }\n}\n\npublic class FunctionProcessingResult {\n  public FunctionProcessingResult(int capacity = 0) {\n    SampledElements = new List<(IRElement, TimeSpan)>(capacity);\n    BlockSampledElementsMap = new Dictionary<BlockIR, TimeSpan>(capacity);\n    BlockSampledElements = new List<(BlockIR, TimeSpan)>();\n    CounterElements = new List<(IRElement, PerformanceCounterValueSet)>(capacity);\n    FunctionCountersValue = new PerformanceCounterValueSet();\n  }\n\n  public List<(IRElement, TimeSpan)> SampledElements { get; set; }\n  public Dictionary<BlockIR, TimeSpan> BlockSampledElementsMap { get; set; }\n  public List<(BlockIR, TimeSpan)> BlockSampledElements { get; set; }\n  public List<(IRElement, PerformanceCounterValueSet)> CounterElements { get; set; }\n  public List<(BlockIR, PerformanceCounterValueSet)> BlockCounterElements { get; set; }\n  public PerformanceCounterValueSet FunctionCountersValue { get; set; }\n\n  public double ScaleCounterValue(long value, PerformanceCounter counter) {\n    long total = FunctionCountersValue.FindCounterValue(counter);\n    return total > 0 ? value / (double)total : 0;\n  }\n\n  public void SortSampledElements() {\n    BlockSampledElements.Sort((a, b) => b.Item2.CompareTo(a.Item2));\n    SampledElements.Sort((a, b) => b.Item2.CompareTo(a.Item2));\n  }\n\n  public SampledElementsToLineMapping BuildSampledElementsToLineMapping(FunctionProfileData profile,\n                                                                        ParsedIRTextSection parsedSection) {\n    var elementMap = BuildElementToWeightMap();\n    var counterMap = BuildElementToCounterMap();\n    var instrToLineMap = new SampledElementsToLineMapping();\n\n    // Build groups of instructions mapping to the same source line,\n    // with their associated sampled weight and perf. counters.\n    foreach (var instr in parsedSection.Function.AllInstructions) {\n      var tag = instr.GetTag<SourceLocationTag>();\n\n      if (tag != null) {\n        var weight = elementMap.GetValueOr(instr, TimeSpan.Zero);\n        var counters = counterMap.GetValueOrNull(instr);\n        var list = instrToLineMap.SampledElements.GetOrAddValue(tag.Line);\n        list.Add((instr, (weight, counters)));\n      }\n    }\n\n    // Sort elements in each line group by text offset.\n    foreach (var linePair in instrToLineMap.SampledElements) {\n      linePair.Value.Sort((a, b) => a.Item1.TextLocation.CompareTo(b.Item1.TextLocation));\n    }\n\n    return instrToLineMap;\n  }\n\n  public Dictionary<IRElement, TimeSpan> BuildElementToWeightMap() {\n    var map = new Dictionary<IRElement, TimeSpan>();\n\n    foreach (var pair in SampledElements) {\n      map[pair.Item1] = pair.Item2;\n    }\n\n    return map;\n  }\n\n  public Dictionary<IRElement, PerformanceCounterValueSet> BuildElementToCounterMap() {\n    var map = new Dictionary<IRElement, PerformanceCounterValueSet>();\n\n    foreach (var pair in CounterElements) {\n      map[pair.Item1] = pair.Item2;\n    }\n\n    return map;\n  }\n\n  // Mapping from a source line number to a list\n  // of associated instructions and their weight and/or perf. counters.\n  public record SampledElementsToLineMapping(\n    Dictionary<int, List<(IRElement Element,\n      (TimeSpan Weight, PerformanceCounterValueSet Counters) Profile)>> SampledElements) {\n    public SampledElementsToLineMapping() :\n      this(new Dictionary<int, List<(IRElement Element,\n             (TimeSpan Weight, PerformanceCounterValueSet Counters) Profile)>>()) {\n    }\n  }\n}\n\npublic class SourceLineProcessingResult {\n  public SourceLineProcessingResult() {\n    SourceLineWeight = new Dictionary<int, TimeSpan>();\n    SourceLineCounters = new Dictionary<int, PerformanceCounterValueSet>();\n    FunctionCountersValue = new PerformanceCounterValueSet();\n  }\n\n  public Dictionary<int, TimeSpan> SourceLineWeight { get; set; } // Line number mapping\n  public Dictionary<int, PerformanceCounterValueSet> SourceLineCounters { get; set; } // Line number mapping\n  public PerformanceCounterValueSet FunctionCountersValue { get; set; }\n  public List<(int LineNumber, TimeSpan Weight)> SourceLineWeightList => SourceLineWeight.ToList();\n  public int FirstLineIndex { get; set; }\n  public int LastLineIndex { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/IProfileDataProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic delegate void ProfileLoadProgressHandler(ProfileLoadProgress info);\npublic delegate void ProcessListProgressHandler(ProcessListProgress info);\n\npublic enum ModuleLoadState {\n  Loaded,\n  NotFound,\n  Failed,\n  LazyLoadPending  // Binary will be downloaded on-demand when user views assembly\n}\n\npublic enum ProfileLoadStage {\n  TraceReading,\n  BinaryLoading,\n  SymbolLoading,\n  TraceProcessing,\n  PerfCounterProcessing,\n  ComputeCallTree\n}\n\npublic enum ProfileSessionKind {\n  SystemWide,\n  StartProcess,\n  AttachToProcess\n}\n\npublic interface IProfileDataProvider {\n  Task<ProfileData> LoadTraceAsync(RawProfileData rawProfile, List<int> processIds,\n                                   ProfileDataProviderOptions options,\n                                   SymbolFileSourceSettings symbolSettings,\n                                   ProfileDataReport report,\n                                   ProfileLoadProgressHandler progressCallback,\n                                   CancelableTask cancelableTask = null);\n\n  Task<ProfileData> LoadTraceAsync(string tracePath, List<int> processIds,\n                                   ProfileDataProviderOptions options,\n                                   SymbolFileSourceSettings symbolSettings,\n                                   ProfileDataReport report,\n                                   ProfileLoadProgressHandler progressCallback,\n                                   CancelableTask cancelableTask = null);\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProcessSummary {\n  public ProcessSummary(ProfileProcess process, TimeSpan weight) {\n    Process = process;\n    Weight = weight;\n  }\n\n  [ProtoMember(1)]\n  public ProfileProcess Process { get; set; }\n  [ProtoMember(2)]\n  public TimeSpan Weight { get; set; }\n  [ProtoMember(3)]\n  public double WeightPercentage { get; set; }\n  [ProtoMember(4)]\n  public TimeSpan Duration { get; set; }\n  [ProtoMember(5)]\n  public double WeightPercentageExcludingIdle { get; set; }\n\n  public override string ToString() {\n    return $\"{Process.Name} ({Weight})\";\n  }\n}\n\npublic class ProfileLoadProgress {\n  public ProfileLoadProgress(ProfileLoadStage stage) {\n    Stage = stage;\n  }\n\n  public ProfileLoadStage Stage { get; set; }\n  public int Total { get; set; }\n  public int Current { get; set; }\n  public string Optional { get; set; }\n\n  public override string ToString() {\n    return $\"{Stage}: {Current}/{Total} {Optional}\";\n  }\n}\n\npublic class ProcessListProgress {\n  public int Total { get; set; }\n  public int Current { get; set; }\n  public List<ProcessSummary> Processes { get; set; }\n\n  public override string ToString() {\n    return $\"{Current}/{Total}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/IpToImageCache.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic class IpToImageCache {\n  private List<ProfileImage> images_;\n  private long lowestBaseAddress_;\n\n  public IpToImageCache(IEnumerable<ProfileImage> images, long lowestBaseAddress) {\n    lowestBaseAddress_ = lowestBaseAddress;\n    images_ = new List<ProfileImage>(images);\n    images_.Sort();\n  }\n\n  public static IpToImageCache Create(IEnumerable<ProfileImage> images) {\n    long lowestAddr = long.MaxValue;\n\n    foreach (var image in images) {\n      lowestAddr = Math.Min(lowestAddr, image.BaseAddress);\n    }\n\n    return new IpToImageCache(images, lowestAddr);\n  }\n\n  public bool IsValidAddres(long ip) {\n    return ip >= lowestBaseAddress_;\n  }\n\n  public ProfileImage Find(long ip) {\n    Debug.Assert(IsValidAddres(ip));\n    return BinarySearch(images_, ip);\n  }\n\n  private ProfileImage BinarySearch(List<ProfileImage> ranges, long value) {\n    int min = 0;\n    int max = ranges.Count - 1;\n\n    while (min <= max) {\n      int mid = (min + max) / 2;\n      var range = ranges[mid];\n      int comparison = range.CompareTo(value);\n\n      if (comparison == 0) {\n        return range;\n      }\n\n      if (comparison < 0) {\n        min = mid + 1;\n      }\n      else {\n        max = mid - 1;\n      }\n    }\n\n    return null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/ManagedRawProfileData.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic class ManagedRawProfileData {\n  public Dictionary<ProfileImage, DotNetDebugInfoProvider> imageDebugInfo_;\n  public Dictionary<long /* moduleId */, DotNetDebugInfoProvider> moduleDebugInfoMap_;\n  public Dictionary<long /* moduleId */, ProfileImage> moduleImageMap_;\n  public Dictionary<ManagedMethodId, ManagedMethodMapping> managedMethodIdMap_;\n  public Dictionary<ManagedMethodId, DotNetDebugInfoProvider.MethodCode> managedMethodCodeMap_;\n  public Dictionary<string, ManagedMethodMapping> managedMethodsMap_;\n  public List<ManagedMethodMapping> managedMethods_;\n  public List<(long ModuleId, ManagedMethodMapping Mapping)> patchedMappings_;\n\n  public ManagedRawProfileData() {\n    imageDebugInfo_ = new Dictionary<ProfileImage, DotNetDebugInfoProvider>();\n    moduleDebugInfoMap_ = new Dictionary<long, DotNetDebugInfoProvider>();\n    moduleImageMap_ = new Dictionary<long, ProfileImage>();\n    managedMethods_ = new List<ManagedMethodMapping>();\n    managedMethodsMap_ = new Dictionary<string, ManagedMethodMapping>();\n    managedMethodCodeMap_ = new Dictionary<ManagedMethodId, DotNetDebugInfoProvider.MethodCode>();\n    managedMethodIdMap_ = new Dictionary<ManagedMethodId, ManagedMethodMapping>();\n    patchedMappings_ = new List<(long ModuleId, ManagedMethodMapping Mapping)>();\n  }\n\n  public void LoadingCompleted(int processId) {\n    managedMethods_.Sort();\n\n    foreach (var debugInfo in imageDebugInfo_.Values) {\n      debugInfo.LoadingCompleted();\n    }\n\n    foreach (var (methodId, code) in managedMethodCodeMap_) {\n      if (managedMethodIdMap_.TryGetValue(methodId, out var mapping) &&\n          moduleDebugInfoMap_.TryGetValue(mapping.ModuleId, out var debugInfo)) {\n        debugInfo.AddMethodCode(code.Address, code);\n      }\n    }\n\n    // A placeholder is created for cases where the method load event\n    // is triggered before the module load one, try to assign the image now.\n    foreach (var pair in patchedMappings_) {\n      pair.Mapping.Image = moduleImageMap_.GetValueOrNull(pair.ModuleId);\n    }\n\n    patchedMappings_ = null;\n  }\n\n  [ProtoContract(SkipConstructor = true)]\n  public class ManagedDataState {\n    // list of DotNetDebugInfoProvider {id, file_name, arch}\n    public Dictionary<ProfileImage, int /* providerId */> ImageDebugInfo;\n    public Dictionary<long /* moduleId */, int /* providerId */> moduleDebugInfoMap_;\n    public Dictionary<ManagedMethodId, int /* mappingId */> managedMethodIdMap_;\n    public Dictionary<string, int /* mappingId */> managedMethodsMap_;\n    public List<ManagedMethodMapping> managedMethods_;\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class ManagedMethodMapping : IComparable<ManagedMethodMapping>, IComparable<long>,\n  IEquatable<ManagedMethodMapping> {\n  public ManagedMethodMapping(FunctionDebugInfo functionDebugInfo, ProfileImage image,\n                              long moduleId, long ip, int size) {\n    FunctionDebugInfo = functionDebugInfo;\n    Image = image;\n    ModuleId = moduleId;\n    IP = ip;\n    Size = size;\n  }\n\n  [ProtoMember(1)]\n  public FunctionDebugInfo FunctionDebugInfo { get; }\n  [ProtoMember(2)]\n  public ProfileImage Image { get; set; }\n  [ProtoMember(3)]\n  public long ModuleId { get; }\n  [ProtoMember(4)]\n  public long IP { get; }\n  [ProtoMember(5)]\n  public int Size { get; }\n\n  public int CompareTo(long value) {\n    if (value < IP) {\n      return 1;\n    }\n\n    if (value > IP + Size) {\n      return -1;\n    }\n\n    return 0;\n  }\n\n  public int CompareTo(ManagedMethodMapping other) {\n    return CompareTo(other.IP);\n  }\n\n  public bool Equals(ManagedMethodMapping other) {\n    if (other == null)\n      return false;\n    return IP == other.IP;\n  }\n\n  public static ManagedMethodMapping BinarySearch(List<ManagedMethodMapping> ranges, long value) {\n    int low = 0;\n    int high = ranges.Count - 1;\n\n    while (low <= high) {\n      int mid = low + (high - low) / 2;\n      var range = ranges[mid];\n      int result = range.CompareTo(value);\n\n      if (result == 0) {\n        return range;\n      }\n\n      if (result < 0) {\n        low = mid + 1;\n      }\n      else {\n        high = mid - 1;\n      }\n    }\n\n    return null;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is ManagedMethodMapping other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return IP.GetHashCode();\n  }\n}\n\npublic record ManagedMethodId(long MethodId, long ReJITId);"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/ModuleProfileInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Profile.CallTree;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic class ModuleProfileInfo {\n  public ModuleProfileInfo() { }\n\n  public ModuleProfileInfo(string name) {\n    Name = name;\n    Functions = new List<ProfileCallTreeNode>();\n  }\n\n  public string Name { get; set; }\n  public double Percentage { get; set; }\n  public TimeSpan Weight { get; set; }\n  public List<ProfileCallTreeNode> Functions { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/PerformanceCounters.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\n[ProtoContract(SkipConstructor = true)]\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic struct PerformanceCounterValue : IEquatable<PerformanceCounterValue> {\n  [ProtoMember(1)] public int CounterId { get; set; }\n  [ProtoMember(2)] public long Value { get; set; }\n\n  public PerformanceCounterValue(int counterId, long value = 0) {\n    CounterId = counterId;\n    Value = value;\n  }\n\n  public bool Equals(PerformanceCounterValue other) {\n    return CounterId == other.CounterId && Value == other.Value;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is PerformanceCounterValue other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(CounterId, Value);\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\n[ProtoInclude(100, typeof(PerformanceMetric))]\npublic class PerformanceCounter {\n  public PerformanceCounter() {\n  }\n\n  public PerformanceCounter(int id, string name, int frequency = 0) {\n    Id = id;\n    Name = name;\n    Frequency = frequency;\n  }\n\n  public virtual bool IsMetric => false;\n  [ProtoMember(2)] public int Index { get; set; }\n  [ProtoMember(3)] public int Id { get; set; }\n  [ProtoMember(4)] public string Name { get; set; }\n  [ProtoMember(5)] public int Frequency { get; set; }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class PerformanceMetric : PerformanceCounter {\n  public PerformanceMetric(int id, PerformanceMetricConfig config,\n                           PerformanceCounter baseCounter,\n                           PerformanceCounter relativeCounter) : base(id, config.Name) {\n    Config = config;\n    BaseCounter = baseCounter;\n    RelativeCounter = relativeCounter;\n  }\n\n  [ProtoMember(1)] public PerformanceMetricConfig Config { get; set; }\n  [ProtoMember(2)] public PerformanceCounter BaseCounter { get; set; }\n  [ProtoMember(3)] public PerformanceCounter RelativeCounter { get; set; }\n  public override bool IsMetric => true;\n\n  public double ComputeMetric(PerformanceCounterValueSet counterValueSet, out long baseValue, out long relativeValue) {\n    baseValue = counterValueSet.FindCounterValue(BaseCounter);\n    relativeValue = counterValueSet.FindCounterValue(RelativeCounter);\n\n    if (baseValue == 0) {\n      return 0;\n    }\n\n    // Counters may not be accurate and the percentage can end up more than 100%.\n    double result = relativeValue / (double)baseValue;\n    return Config.IsPercentage ? Math.Min(result, 1) : result;\n  }\n}\n\n// Groups a set of counters associated with a single instruction.\n// There is one PerformanceCounterValue for each counter type\n// that accumulates all instances of the raw events.\n[ProtoContract(SkipConstructor = true)]\npublic class PerformanceCounterValueSet {\n  public PerformanceCounterValueSet() {\n    InitializeReferenceMembers();\n  }\n\n  [ProtoMember(1)] public List<PerformanceCounterValue> Counters { get; set; }\n  public int Count => Counters.Count;\n  public long this[int perfCounterId] => FindCounterValue(perfCounterId);\n\n  public void AddCounterSample(int perfCounterId, long value) {\n    int index = Counters.FindIndex(item => item.CounterId == perfCounterId);\n    var countersSpan = CollectionsMarshal.AsSpan(Counters);\n\n    if (index != -1) {\n      ref var counterRef = ref countersSpan[index];\n      counterRef.Value += value;\n    }\n    else {\n      // Keep the list sorted so that it is in sync\n      // with the sorted counter definition list.\n      var counter = new PerformanceCounterValue(perfCounterId, value);\n      int insertionIndex = 0;\n\n      for (int i = 0; i < Counters.Count; i++, insertionIndex++) {\n        if (Counters[i].CounterId >= perfCounterId) {\n          break;\n        }\n      }\n\n      Counters.Insert(insertionIndex, counter);\n    }\n  }\n\n  public long FindCounterValue(int perfCounterId) {\n    int index = Counters.FindIndex(item => item.CounterId == perfCounterId);\n    return index != -1 ? Counters[index].Value : 0;\n  }\n\n  public long FindCounterValue(PerformanceCounter counter) {\n    return FindCounterValue(counter.Id);\n  }\n\n  public void Add(PerformanceCounterValueSet other) {\n    //? TODO: This assumes there are not many counters being collected,\n    //? switch to dict if dozens get to be collected one day.\n    foreach (var counter in other.Counters) {\n      int index = Counters.FindIndex(item => item.CounterId == counter.CounterId);\n\n      if (index != -1) {\n        var countersSpan = CollectionsMarshal.AsSpan(Counters);\n        ref var counterRef = ref countersSpan[index];\n        counterRef.Value += counter.Value;\n      }\n      else {\n        Counters.Add(new PerformanceCounterValue(counter.CounterId, counter.Value));\n      }\n    }\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    Counters ??= new List<PerformanceCounterValue>();\n  }\n}\n\npublic static class PerformanceCounterExtensions {\n  public static PerformanceCounterValueSet AccumulateValue<K>(this Dictionary<K, PerformanceCounterValueSet> dict,\n                                                              K key, PerformanceCounterValueSet value) {\n    if (!dict.TryGetValue(key, out var currentValue)) {\n      currentValue = new PerformanceCounterValueSet();\n      dict[key] = currentValue;\n    }\n\n    currentValue.Add(value);\n    return currentValue;\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class PerformanceCounterConfig : IEquatable<PerformanceCounterConfig> {\n  public PerformanceCounterConfig(int id, string name, int defaultInterval,\n                                  int minInterval, int maxInterval, bool isBuiltin) {\n    Id = id;\n    Name = name;\n    Interval = defaultInterval;\n    DefaultInterval = defaultInterval;\n    MinInterval = minInterval;\n    MaxInterval = maxInterval;\n    IsBuiltin = isBuiltin;\n  }\n\n  [ProtoMember(1)]\n  public bool IsEnabled { get; set; }\n  [ProtoMember(2)]\n  public bool IsBuiltin { get; set; }\n  [ProtoMember(3)]\n  public int Id { get; set; }\n  [ProtoMember(4)]\n  public string Name { get; set; }\n  [ProtoMember(5)]\n  public string Description { get; set; }\n  [ProtoMember(6)]\n  public int Interval { get; set; }\n  [ProtoMember(7)]\n  public int MinInterval { get; set; }\n  [ProtoMember(8)]\n  public int MaxInterval { get; set; }\n  [ProtoMember(9)]\n  public int DefaultInterval { get; set; }\n\n  public bool Equals(PerformanceCounterConfig other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Id == other.Id && Name == other.Name;\n  }\n\n  public static bool operator ==(PerformanceCounterConfig left, PerformanceCounterConfig right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(PerformanceCounterConfig left, PerformanceCounterConfig right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((PerformanceCounterConfig)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Id, Name);\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class PerformanceMetricConfig : IEquatable<PerformanceMetricConfig> {\n  public PerformanceMetricConfig(string name, string baseCounterName, string relativeCounterName,\n                                 bool isPercentage, string description) {\n    Name = name;\n    BaseCounterName = baseCounterName;\n    RelativeCounterName = relativeCounterName;\n    Description = description;\n    IsPercentage = isPercentage;\n    IsEnabled = true;\n  }\n\n  [ProtoMember(1)]\n  public string Name { get; set; }\n  [ProtoMember(2)]\n  public string BaseCounterName { get; set; }\n  [ProtoMember(3)]\n  public string RelativeCounterName { get; set; }\n  [ProtoMember(4)]\n  public string Description { get; set; }\n  [ProtoMember(5)]\n  public bool IsPercentage { get; set; }\n  [ProtoMember(6)]\n  public bool IsEnabled { get; set; }\n\n  public bool Equals(PerformanceMetricConfig other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Name == other.Name &&\n           BaseCounterName == other.BaseCounterName &&\n           RelativeCounterName == other.RelativeCounterName;\n  }\n\n  public static bool operator ==(PerformanceMetricConfig left, PerformanceMetricConfig right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(PerformanceMetricConfig left, PerformanceMetricConfig right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((PerformanceMetricConfig)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Name, BaseCounterName, RelativeCounterName, IsPercentage);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/ProcessSummaryBuilder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic class ProcessSummaryBuilder {\n  private RawProfileData profile_;\n  private Dictionary<int, TimeSpan> processSamples_ = new();\n  private Dictionary<int, (TimeSpan First, TimeSpan Last)> procDuration_ = new();\n  private TimeSpan totalWeight_;\n\n  public ProcessSummaryBuilder(RawProfileData profile) {\n    profile_ = profile;\n  }\n\n  public void AddSample(ProfileSample sample) {\n    var context = sample.GetContext(profile_);\n    int processId = context.ProcessId;\n    profile_.GetOrCreateProcess(processId); // Ensure process object exists.\n    processSamples_.AccumulateValue(processId, sample.Weight);\n    totalWeight_ += sample.Weight;\n\n    // Modify in-place.\n    ref var durationRef = ref CollectionsMarshal.GetValueRefOrAddDefault(procDuration_, processId, out bool found);\n\n    if (!found) {\n      durationRef.First = sample.Time;\n    }\n\n    durationRef.Last = sample.Time;\n  }\n\n  public void AddSample(TimeSpan sampleWeight, TimeSpan sampleTime, int processId) {\n    profile_.GetOrCreateProcess(processId); // Ensure process object exists.\n    processSamples_.AccumulateValue(processId, sampleWeight);\n    totalWeight_ += sampleWeight;\n\n    // Modify in-place.\n    ref var durationRef = ref CollectionsMarshal.GetValueRefOrAddDefault(procDuration_, processId, out bool found);\n\n    if (!found) {\n      durationRef.First = sampleTime;\n    }\n\n    durationRef.Last = sampleTime;\n  }\n\n  public List<ProcessSummary> MakeSummaries() {\n    var list = new List<ProcessSummary>(procDuration_.Count);\n\n    // Calculate non-idle total weight for the excluding-idle percentage.\n    long nonIdleWeightTicks = totalWeight_.Ticks;\n\n    if (processSamples_.TryGetValue(ETW.ETWEventProcessor.KernelProcessId, out var idleWeight)) {\n      nonIdleWeightTicks -= idleWeight.Ticks;\n    }\n\n    foreach (var pair in processSamples_) {\n      var process = profile_.GetOrCreateProcess(pair.Key);\n\n      double weightPercentage = totalWeight_.Ticks > 0\n        ? 100 * (double)pair.Value.Ticks / totalWeight_.Ticks\n        : 0;\n\n      double weightPercentageExcludingIdle;\n      if (nonIdleWeightTicks > 0) {\n        if (pair.Key == ETW.ETWEventProcessor.KernelProcessId) {\n          // For the idle/kernel process, the excluding-idle percentage is not meaningful.\n          // Set it equal to the overall weight percentage to avoid confusing values.\n          weightPercentageExcludingIdle = weightPercentage;\n        } else {\n          weightPercentageExcludingIdle = 100 * (double)pair.Value.Ticks / nonIdleWeightTicks;\n        }\n      } else {\n        weightPercentageExcludingIdle = 0;\n      }\n\n      var item = new ProcessSummary(process, pair.Value) {\n        WeightPercentage = weightPercentage,\n        WeightPercentageExcludingIdle = weightPercentageExcludingIdle\n      };\n\n      list.Add(item);\n\n      if (procDuration_.TryGetValue(pair.Key, out var duration)) {\n        item.Duration = duration.Last - duration.First;\n      }\n    }\n\n    return list;\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/ProfileData.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic class ProfileData {\n  public ProfileData(TimeSpan profileWeight, TimeSpan totalWeight) : this() {\n    ProfileWeight = profileWeight;\n    TotalWeight = totalWeight;\n  }\n\n  public ProfileData() {\n    ProfileWeight = TimeSpan.Zero;\n    FunctionProfiles = new Dictionary<IRTextFunction, FunctionProfileData>();\n    ModuleWeights = new Dictionary<int, TimeSpan>();\n    PerformanceCounters = new Dictionary<int, PerformanceCounter>();\n    ModuleCounters = new Dictionary<string, PerformanceCounterValueSet>();\n    Threads = new Dictionary<int, ProfileThread>();\n    Modules = new Dictionary<int, ProfileImage>();\n    Samples = new List<(ProfileSample, ResolvedProfileStack)>();\n    Events = new List<(PerformanceCounterEvent Sample, ResolvedProfileStack Stack)>();\n    ModuleDebugInfo = new Dictionary<string, IDebugInfoProvider>();\n    Filter = new ProfileSampleFilter();\n  }\n\n  public TimeSpan ProfileWeight { get; set; }\n  public TimeSpan TotalWeight { get; set; }\n  public Dictionary<IRTextFunction, FunctionProfileData> FunctionProfiles { get; set; }\n  public Dictionary<int, TimeSpan> ModuleWeights { get; set; }\n  public Dictionary<string, PerformanceCounterValueSet> ModuleCounters { get; set; }\n  public Dictionary<int, PerformanceCounter> PerformanceCounters { get; set; }\n  public ProfileCallTree CallTree { get; set; }\n  public ThreadSampleRanges ThreadSampleRanges { get; set; }\n  public ProfileDataReport Report { get; set; }\n  public List<(ProfileSample Sample, ResolvedProfileStack Stack)> Samples { get; set; }\n  public List<(PerformanceCounterEvent Sample, ResolvedProfileStack Stack)> Events { get; set; }\n  public ProfileProcess Process { get; set; }\n  public Dictionary<int, ProfileThread> Threads { get; set; }\n  public Dictionary<int, ProfileImage> Modules { get; set; }\n  public Dictionary<string, IDebugInfoProvider> ModuleDebugInfo { get; set; }\n  public ProfileSampleFilter Filter { get; set; }\n\n  public List<PerformanceCounter> SortedPerformanceCounters {\n    get {\n      var list = PerformanceCounters.ToValueList();\n      list.Sort((a, b) => b.Id.CompareTo(a.Id));\n      return list;\n    }\n  }\n\n  public List<(int ThreadId, TimeSpan Weight)> SortedThreadWeights {\n    get {\n      var list = new List<(int ThreadId, TimeSpan Weight)>();\n      var threadWeights = new Dictionary<int, TimeSpan>();\n      var sampleSpan = CollectionsMarshal.AsSpan(Samples);\n\n      for (int i = 0; i < sampleSpan.Length; i++) {\n        threadWeights.AccumulateValue(sampleSpan[i].Stack.Context.ThreadId,\n                                      sampleSpan[i].Sample.Weight);\n      }\n\n      foreach ((int threadId, var weight) in threadWeights) {\n        list.Add((threadId, weight));\n      }\n\n      list.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n      return list;\n    }\n  }\n\n  public void RegisterModuleDebugInfo(string moduleName, IDebugInfoProvider provider) {\n    ModuleDebugInfo[moduleName] = provider;\n  }\n\n  public void AddModuleSample(int moduleId, TimeSpan weight) {\n    ModuleWeights.AccumulateValue(moduleId, weight);\n  }\n\n  public void AddModuleCounter(string moduleName, int perfCounterId, long value) {\n    if (!ModuleCounters.TryGetValue(moduleName, out var counterSet)) {\n      counterSet = new PerformanceCounterValueSet();\n      ModuleCounters[moduleName] = counterSet;\n    }\n\n    counterSet.AddCounterSample(perfCounterId, value);\n  }\n\n  public void RegisterPerformanceCounter(PerformanceCounter perfCounter) {\n    perfCounter.Index = PerformanceCounters.Count;\n    PerformanceCounters[perfCounter.Id] = perfCounter;\n  }\n\n  public PerformanceCounter GetPerformanceCounter(int id) {\n    if (PerformanceCounters.TryGetValue(id, out var counter)) {\n      return counter;\n    }\n\n    return null;\n  }\n\n  public PerformanceCounter FindPerformanceCounter(string name) {\n    foreach (var pair in PerformanceCounters) {\n      if (pair.Value.Name == name) {\n        return pair.Value;\n      }\n    }\n\n    return null;\n  }\n\n  public PerformanceMetric RegisterPerformanceMetric(int id, PerformanceMetricConfig config) {\n    var baseCounter = FindPerformanceCounter(config.BaseCounterName);\n    var relativeCounter = FindPerformanceCounter(config.RelativeCounterName);\n\n    if (baseCounter != null && relativeCounter != null) {\n      var metric = new PerformanceMetric(id, config, baseCounter, relativeCounter);\n      PerformanceCounters[id] = metric;\n      return metric;\n    }\n\n    return null;\n  }\n\n  public double ScaleFunctionWeight(TimeSpan weight) {\n    return ProfileWeight.Ticks == 0 ? 0 : weight.Ticks / (double)ProfileWeight.Ticks;\n  }\n\n  public double ScaleModuleWeight(TimeSpan weight) {\n    return TotalWeight.Ticks == 0 ? 0 : weight.Ticks / (double)TotalWeight.Ticks;\n  }\n\n  public FunctionProfileData GetFunctionProfile(IRTextFunction function) {\n    return FunctionProfiles.TryGetValue(function, out var profile) ? profile : null;\n  }\n\n  public bool HasFunctionProfile(IRTextFunction function) {\n    return GetFunctionProfile(function) != null;\n  }\n\n  public FunctionProfileData GetOrCreateFunctionProfile(IRTextFunction function,\n                                                        FunctionDebugInfo debugInfo) {\n    ref var funcProfile =\n      ref CollectionsMarshal.GetValueRefOrAddDefault(FunctionProfiles, function, out bool exists);\n\n    if (!exists) {\n      funcProfile = new FunctionProfileData(debugInfo);\n    }\n\n    return funcProfile;\n  }\n\n  public List<(IRTextFunction, FunctionProfileData)> GetSortedFunctions() {\n    var list = FunctionProfiles.ToList();\n    list.Sort((a, b) => -a.Item2.ExclusiveWeight.CompareTo(b.Item2.ExclusiveWeight));\n    return list;\n  }\n\n  public void AddThreads(IEnumerable<ProfileThread> threads) {\n    foreach (var thread in threads) {\n      Threads[thread.ThreadId] = thread;\n    }\n  }\n\n  public void AddModules(IEnumerable<ProfileImage> modules) {\n    foreach (var module in modules) {\n      Modules[module.Id] = module;\n    }\n  }\n\n  public ProfileThread FindThread(int threadId) {\n    if (Threads != null) {\n      return Threads.GetValueOrNull(threadId);\n    }\n\n    return null;\n  }\n\n  public List<int> FindModuleIds(Func<string, bool> matchCheck) {\n    var ids = new List<int>();\n\n    foreach (var module in Modules) {\n      if (matchCheck(module.Value.ModuleName)) {\n        ids.Add(module.Key);\n      }\n    }\n\n    return ids;\n  }\n\n  public TimeSpan FindModulesWeight(Func<string, bool> matchCheck) {\n    var ids = FindModuleIds(matchCheck);\n    var weight = TimeSpan.Zero;\n\n    foreach (int id in ids) {\n      weight += ModuleWeights.GetValueOrDefault(id);\n    }\n\n    return weight;\n  }\n\n  public ProcessingResult FilterFunctionProfile(ProfileSampleFilter filter) {\n    //? TODO: Split ProfileData into a part that has the samples and other info that doesn't change,\n    //? while the rest is more like a processing result similar to FuncProfileData\n    var currentProfile = new ProcessingResult {\n      FunctionProfiles = FunctionProfiles,\n      CallTree = CallTree,\n      ModuleWeights = ModuleWeights,\n      ProfileWeight = ProfileWeight,\n      TotalWeight = TotalWeight,\n      Filter = Filter\n    };\n\n    CallTree?.ResetTags();\n    ModuleWeights = new Dictionary<int, TimeSpan>();\n    FunctionProfiles = new Dictionary<IRTextFunction, FunctionProfileData>();\n    ProfileWeight = TimeSpan.Zero;\n    TotalWeight = TimeSpan.Zero;\n\n    var profile = ComputeProfile(this, filter);\n    ModuleWeights = profile.ModuleWeights;\n    ProfileWeight = profile.ProfileWeight;\n    TotalWeight = profile.TotalWeight;\n    FunctionProfiles = profile.FunctionProfiles;\n    CallTree = profile.CallTree;\n    Filter = filter;\n    return currentProfile;\n  }\n\n  public ProcessingResult RestorePreviousProfile(ProcessingResult previousProfile) {\n    var currentProfile = new ProcessingResult {\n      FunctionProfiles = FunctionProfiles,\n      CallTree = CallTree,\n      ModuleWeights = ModuleWeights,\n      ProfileWeight = ProfileWeight,\n      TotalWeight = TotalWeight,\n      Filter = Filter\n    };\n\n    ModuleWeights = previousProfile.ModuleWeights;\n    ProfileWeight = previousProfile.ProfileWeight;\n    TotalWeight = previousProfile.TotalWeight;\n    FunctionProfiles = previousProfile.FunctionProfiles;\n    CallTree = previousProfile.CallTree;\n    Filter = previousProfile.Filter;\n    return currentProfile;\n  }\n\n  public ProfileData ComputeProfile(ProfileData baseProfile, ProfileSampleFilter filter,\n                                    bool computeCallTree = true,\n                                    int maxChunks = int.MaxValue) {\n    // Compute the call tree in parallel with the per-function profiles.\n    var tasks = new List<Task>();\n\n    if (maxChunks == int.MaxValue) {\n      // Use half the threads for each task.\n      maxChunks = Math.Max(1, CoreSettingsProvider.GeneralSettings.CurrentCpuCoreLimit / 2);\n    }\n\n    var callTreeTask = Task.Run(() => {\n      if (computeCallTree) {\n        return CallTreeProcessor.Compute(baseProfile, filter, maxChunks);\n      }\n\n      return null;\n    });\n\n    var funcProfileTask = Task.Run(() => {\n      return FunctionProfileProcessor.Compute(baseProfile, filter, maxChunks);\n    });\n\n    tasks.Add(callTreeTask);\n    Task.WhenAll(tasks.ToArray()).Wait();\n\n    var profile = funcProfileTask.Result;\n    profile.CallTree = callTreeTask.Result;\n    return profile;\n  }\n\n  //? TODO: Port to ProfileSampleProcessor\n  public ThreadSampleRanges ComputeThreadSampleRanges() {\n    // Compute lists of contiguous range of samples running on the same thread,\n    // used later to speed up the timeline slice computation and per-thread filtering.\n    var threadSampleRanges = new Dictionary<int, List<ThreadSampleRange>>();\n\n    int sampleIndex = 0;\n    int prevThreadId = -1;\n    int prevSampleIndex = -1;\n    var sampleSpan = CollectionsMarshal.AsSpan(Samples);\n\n    for (int i = 0; i < sampleSpan.Length; i++) {\n      int threadId = sampleSpan[i].Stack.Context.ThreadId;\n\n      if (threadId != prevThreadId) {\n        if (prevThreadId != -1) {\n          threadSampleRanges.GetOrAddValue(prevThreadId).Add(new ThreadSampleRange {\n            StartIndex = prevSampleIndex,\n            EndIndex = sampleIndex\n          });\n        }\n\n        prevThreadId = threadId;\n        prevSampleIndex = sampleIndex;\n      }\n\n      sampleIndex++;\n    }\n\n    if (prevThreadId != -1) {\n      threadSampleRanges.GetOrAddValue(prevThreadId).Add(new ThreadSampleRange {\n        StartIndex = prevSampleIndex,\n        EndIndex = sampleIndex\n      });\n    }\n\n    // Add an entry representing all threads, covering all samples.\n    threadSampleRanges[-1] = new List<ThreadSampleRange> {\n      new() {\n        StartIndex = 0,\n        EndIndex = sampleIndex\n      }\n    };\n\n    ThreadSampleRanges = new ThreadSampleRanges(threadSampleRanges);\n    return ThreadSampleRanges;\n  }\n\n  public class ProcessingResult {\n    public ProfileSampleFilter Filter { get; set; }\n    public Dictionary<IRTextFunction, FunctionProfileData> FunctionProfiles { get; set; }\n    public ProfileCallTree CallTree { get; set; }\n    public Dictionary<int, TimeSpan> ModuleWeights { get; set; }\n    public TimeSpan ProfileWeight { get; set; }\n    public TimeSpan TotalWeight { get; set; }\n\n    public override string ToString() {\n      return $\"ProfileWeight: {ProfileWeight}, TotalWeight: {TotalWeight}, \" +\n             $\"FunctionProfiles: {FunctionProfiles.Count}, CallTree: {CallTree}\";\n    }\n  }\n}\n\n// Represents a contiguous range of samples running on the same thread.\npublic struct ThreadSampleRange {\n  public int StartIndex;\n  public int EndIndex;\n}\n\n// Represents a set of sample ranges for each thread.\npublic class ThreadSampleRanges {\n  public ThreadSampleRanges(Dictionary<int, List<ThreadSampleRange>> ranges) {\n    Ranges = ranges;\n  }\n\n  public Dictionary<int, List<ThreadSampleRange>> Ranges { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/ProfileDataReport.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProfileDataReport : IEquatable<ProfileDataReport> {\n  [ProtoMember(1)]\n  private Dictionary<BinaryFileDescriptor, ModuleStatus> moduleStatusMap_ = new();\n  [ProtoMember(2)]\n  public ProfileTraceInfo TraceInfo { get; set; }\n  [ProtoMember(3)]\n  public List<ProcessSummary> RunningProcesses { get; set; }\n  [ProtoMember(4)]\n  public ProfileProcess Process { get; set; }\n  [ProtoMember(5)]\n  public SymbolFileSourceSettings SymbolSettings { get; set; }\n  [ProtoMember(6)]\n  public ProfileRecordingSessionOptions RecordingSessionOptions { get; set; } // For recording mode\n  public bool IsRecordingSession => RecordingSessionOptions != null;\n  public bool IsStartProcessSession => RecordingSessionOptions is {SessionKind: ProfileSessionKind.StartProcess};\n  public bool IsAttachToProcessSession => RecordingSessionOptions is {SessionKind: ProfileSessionKind.AttachToProcess};\n  public List<ModuleStatus> Modules => moduleStatusMap_.ToValueList();\n\n  public TimeSpan SamplingInterval {\n    get {\n      if (TraceInfo.SamplingInterval.Ticks > 0) {\n        return TraceInfo.SamplingInterval;\n      }\n\n      if (RecordingSessionOptions != null) {\n        return TimeSpan.FromMilliseconds(1.0 / RecordingSessionOptions.SamplingFrequency);\n      }\n\n      return TimeSpan.Zero;\n    }\n  }\n\n  public bool Equals(ProfileDataReport other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Equals(RecordingSessionOptions, other.RecordingSessionOptions) &&\n           TraceInfo.HasSameTraceFilePath(other.TraceInfo);\n  }\n\n  public static bool operator ==(ProfileDataReport left, ProfileDataReport right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileDataReport left, ProfileDataReport right) {\n    return !Equals(left, right);\n  }\n\n  public void AddModuleInfo(BinaryFileDescriptor binaryInfo, BinaryFileSearchResult binaryFile, ModuleLoadState state) {\n    lock (this) {\n      var status = GetOrCreateModuleStatus(binaryInfo);\n      status.BinaryFileInfo = binaryFile;\n      status.State = state;\n    }\n  }\n\n  public void AddDebugInfo(BinaryFileDescriptor binaryInfo, DebugFileSearchResult searchResult) {\n    lock (this) {\n      var status = GetOrCreateModuleStatus(binaryInfo);\n      status.DebugInfoFile = searchResult;\n    }\n  }\n\n  public ModuleStatus GetModuleStatus(string moduleName) {\n    lock (this) {\n      return Modules.Find(\n        module => module.ImageFileInfo.ImageName.Equals(moduleName, StringComparison.OrdinalIgnoreCase));\n    }\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((ProfileDataReport)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(RecordingSessionOptions);\n  }\n\n  public void Dump() {\n    foreach (var pair in moduleStatusMap_) {\n      Trace.WriteLine($\"Module {pair.Value.ImageFileInfo.ImageName}\");\n      Trace.WriteLine($\"   - state: {pair.Value.State}\");\n\n      if (pair.Value.BinaryFileInfo != null) {\n        Trace.WriteLine($\"   - found: {pair.Value.BinaryFileInfo.Found}\");\n        Trace.WriteLine($\"   - path: {pair.Value.BinaryFileInfo.FilePath}\");\n        Trace.WriteLine($\"   - details: {pair.Value.BinaryFileInfo.Details}\");\n      }\n\n      if (pair.Value.DebugInfoFile != null) {\n        Trace.WriteLine($\"   - debug: {pair.Value.DebugInfoFile.Found}\");\n        Trace.WriteLine($\"   - path: {pair.Value.DebugInfoFile.FilePath}\");\n        Trace.WriteLine($\"   - details: {pair.Value.DebugInfoFile.Details}\");\n      }\n    }\n  }\n\n  public override string ToString() {\n    return $\"{TraceInfo.TraceFilePath}, {Process.Name}\";\n  }\n\n  private ModuleStatus GetOrCreateModuleStatus(BinaryFileDescriptor binaryInfo) {\n    if (!moduleStatusMap_.TryGetValue(binaryInfo, out var status)) {\n      status = new ModuleStatus();\n      status.ImageFileInfo = binaryInfo;\n      moduleStatusMap_[binaryInfo] = status;\n    }\n\n    return status;\n  }\n\n  [ProtoContract(SkipConstructor = true)]\n  public class ModuleStatus {\n    [ProtoMember(1)]\n    public ModuleLoadState State { get; set; }\n    [ProtoMember(2)]\n    public BinaryFileDescriptor ImageFileInfo { get; set; } // Info used for lookup.\n    [ProtoMember(3)]\n    public BinaryFileSearchResult BinaryFileInfo { get; set; } // Lookup result with local file.\n    [ProtoMember(4)]\n    public DebugFileSearchResult DebugInfoFile { get; set; }\n    public bool HasBinaryLoaded => State == ModuleLoadState.Loaded;\n    public bool HasDebugInfoLoaded => DebugInfoFile is {Found: true};\n    /// <summary>\n    /// Returns true if binary is loaded OR if lazy loading is pending (binary can be loaded on-demand).\n    /// Use this for UI display to avoid showing error icons when lazy loading is available.\n    /// </summary>\n    public bool IsBinaryAvailableOrPending => State == ModuleLoadState.Loaded || State == ModuleLoadState.LazyLoadPending;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/ProfileModuleBuilder.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Concurrent;\nusing System.Diagnostics;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\npublic sealed class ProfileModuleBuilder : IDisposable {\n#if DEBUG\n  private static volatile int FuncQueries;\n  private static volatile int FuncFoundByAddress;\n  private static volatile int FuncFoundByFuncAddress;\n  private static volatile int FuncFoundByFuncAddressLocked;\n  private static volatile int FuncCreated;\n#endif\n  private ICompilerInfoProvider compilerInfo_;\n  private IBinaryFileFinder binaryFileFinder_;\n  private IDebugFileFinder debugFileFinder_;\n  private IDebugInfoProviderFactory debugInfoProviderFactory_;\n  private ICompilerIRInfo compilerIrInfo_;\n  private INameProvider nameProvider_;\n  private BinaryFileDescriptor binaryInfo_;\n  private ConcurrentDictionary<long, (IRTextFunction, FunctionDebugInfo)> functionMap_;\n  private ConcurrentDictionary<long, bool> loggedFuncAddresses_ = new();\n  private ProfileDataReport report_;\n  private ReaderWriterLockSlim lock_;\n  private SemaphoreSlim binaryLoadLock_;\n  private SymbolFileSourceSettings symbolSettings_;\n  private volatile bool disposed_;\n\n  public ProfileModuleBuilder(ProfileDataReport report, ICompilerInfoProvider compilerInfoProvider) {\n    report_ = report;\n    compilerInfo_ = compilerInfoProvider;\n    binaryFileFinder_ = compilerInfoProvider.BinaryFileFinder;\n    debugFileFinder_ = compilerInfoProvider.DebugFileFinder;\n    debugInfoProviderFactory_ = compilerInfoProvider.DebugInfoProviderFactory;\n    compilerIrInfo_ = compilerInfoProvider.IR;\n    nameProvider_ = compilerInfoProvider.NameProvider;\n    functionMap_ = new ConcurrentDictionary<long, (IRTextFunction, FunctionDebugInfo)>();\n    lock_ = new ReaderWriterLockSlim();\n    binaryLoadLock_ = new SemaphoreSlim(1, 1);\n  }\n\n  public IRTextSummary Summary { get; set; }\n  public ILoadedDocument ModuleDocument { get; set; }\n  public IDebugInfoProvider DebugInfo { get; set; }\n  public bool HasDebugInfo { get; set; }\n  public bool Initialized { get; set; }\n  public bool IsManaged { get; set; }\n\n  public async Task<bool> Initialize(BinaryFileDescriptor binaryInfo,\n                                     SymbolFileSourceSettings symbolSettings,\n                                     IDebugInfoProvider debugInfo,\n                                     bool skipBinaryDownload = false) {\n    if (Initialized) {\n      return true;\n    }\n\n    binaryInfo_ = binaryInfo;\n    symbolSettings_ = symbolSettings;\n    string imageName = binaryInfo.ImageName;\n\n    DiagnosticLogger.LogInfo($\"[ModuleInit] Starting initialization for module: {imageName} (skipBinaryDownload={skipBinaryDownload})\");\n    DiagnosticLogger.LogInfo($\"[ModuleInit] Binary info - Name: {binaryInfo.ImageName}, Path: {binaryInfo.ImagePath}, Architecture: {binaryInfo.Architecture}\");\n\n#if DEBUG\n    Trace.WriteLine($\"ModuleInfo init {imageName}\");\n#endif\n\n    // LAZY BINARY LOADING: Skip binary download during trace loading.\n    // Binaries are only needed for disassembly view, not for function name resolution.\n    // They will be downloaded on-demand when user views assembly for a function.\n    BinaryFileSearchResult binFile = null;\n    if (skipBinaryDownload) {\n      DiagnosticLogger.LogInfo($\"[ModuleInit] Skipping binary download for {imageName} (lazy loading enabled)\");\n    }\n    else if (symbolSettings.SourceServerEnabled) {\n      binFile = await FindBinaryFilePath(symbolSettings).ConfigureAwait(false);\n    }\n    else {\n      DiagnosticLogger.LogInfo($\"[ModuleInit] Skipping binary lookup for {imageName} - symbol server disabled\");\n    }\n\n    if (binFile == null || !binFile.Found) {\n      if (skipBinaryDownload) {\n        // Lazy loading: Binary will be downloaded on-demand.\n        // Report as LazyLoadPending, not NotFound.\n        DiagnosticLogger.LogInfo($\"[ModuleInit] Binary lazy load pending for {imageName} - will download on-demand\");\n        report_.AddModuleInfo(binaryInfo, binFile, ModuleLoadState.LazyLoadPending);\n      }\n      else if (binFile != null) {\n        DiagnosticLogger.LogWarning($\"[ModuleInit] Could not find local path for image {imageName}. Binary file missing.\");\n        Trace.TraceWarning($\"Could not find local path for image {imageName}\");\n        report_.AddModuleInfo(binaryInfo, binFile, ModuleLoadState.NotFound);\n      }\n      else {\n        report_.AddModuleInfo(binaryInfo, binFile, ModuleLoadState.NotFound);\n      }\n      CreateDummyDocument(binaryInfo);\n      return true; // Try to continue just with debug info.\n    }\n\n    DiagnosticLogger.LogInfo($\"[ModuleInit] Found binary file for {imageName}: {binFile.FilePath}\");\n\n    // Create a DisassemblerSectionLoader and LoadedDocument directly instead of calling through session\n    bool isManagedImage = binFile.BinaryFile?.IsManagedImage ?? false;\n    var loader = new DisassemblerSectionLoader(binFile.FilePath, compilerInfo_, debugInfo, false, isManagedImage);\n    var loadedDoc = await CreateLoadedDocument(binFile.FilePath, binaryInfo.ImageName, loader).ConfigureAwait(false);\n\n    if (loadedDoc == null) {\n      DiagnosticLogger.LogError($\"[ModuleInit] Failed to load document for image {imageName}\");\n      Trace.TraceWarning($\"Failed to load document for image {imageName}\");\n      report_.AddModuleInfo(binaryInfo, binFile, ModuleLoadState.Failed);\n      CreateDummyDocument(binaryInfo);\n      return false;\n    }\n\n    DiagnosticLogger.LogInfo($\"[ModuleInit] Successfully loaded document for image {imageName}\");\n\n    loadedDoc.BinaryFile = BinaryFileSearchResult.Success(binFile.FilePath);\n    loadedDoc.DebugInfo = debugInfo;\n\n#if DEBUG\n    Trace.TraceWarning($\"  Loaded document for image {imageName}\");\n#endif\n    report_.AddModuleInfo(binaryInfo, binFile, ModuleLoadState.Loaded);\n\n    ModuleDocument = loadedDoc;\n    Summary = loadedDoc.Summary;\n\n    // .Net debug info is passed in by the client.\n    IsManaged = binFile.BinaryFile != null && binFile.BinaryFile.IsManagedImage;\n\n    if (IsManaged && debugInfo != null) {\n      DiagnosticLogger.LogInfo($\"[ModuleInit] Module {imageName} has managed debug info\");\n      Trace.TraceInformation($\"  Has managed debug {imageName}\");\n      DebugInfo = debugInfo;\n      HasDebugInfo = true;\n      loadedDoc.DebugInfo = debugInfo;\n    } else if (IsManaged) {\n      DiagnosticLogger.LogWarning($\"[ModuleInit] Module {imageName} is managed but no debug info provided\");\n    } else {\n      DiagnosticLogger.LogInfo($\"[ModuleInit] Module {imageName} is native (not managed)\");\n    }\n\n#if DEBUG\n    Trace.TraceInformation($\"Initialized image {imageName}\");\n#endif\n\n    DiagnosticLogger.LogInfo($\"[ModuleInit] Module initialization completed for {imageName}. HasDebugInfo={HasDebugInfo}, IsManaged={IsManaged}\");\n    Initialized = true;\n    return true;\n  }\n\n  /// <summary>\n  /// Loads the binary file on-demand for disassembly view.\n  /// Call this when the user wants to view assembly for a function.\n  /// </summary>\n  public async Task<bool> EnsureBinaryLoaded() {\n    // Check if disposed before attempting any operations\n    if (disposed_) {\n      return false;\n    }\n\n    // Already have a binary loaded - fast path check without lock\n    if (ModuleDocument?.BinaryFile?.Found == true) {\n      return true;\n    }\n\n    // Acquire the lock to ensure only one thread loads the binary\n    // Check disposed again to avoid race with Dispose()\n    if (disposed_) {\n      return false;\n    }\n\n    try {\n      await binaryLoadLock_.WaitAsync().ConfigureAwait(false);\n    }\n    catch (ObjectDisposedException) {\n      // Semaphore was disposed between our check and WaitAsync\n      return false;\n    }\n    try {\n      // Double-check after acquiring lock - another thread may have loaded it\n      if (ModuleDocument?.BinaryFile?.Found == true) {\n        return true;\n      }\n\n      if (binaryInfo_ == null || symbolSettings_ == null) {\n        return false;\n      }\n\n      string imageName = binaryInfo_.ImageName;\n      DiagnosticLogger.LogInfo($\"[LazyBinaryLoad] Loading binary on-demand for {imageName}\");\n\n      // Clone settings with fresh timeout state for on-demand download.\n      // The shared symbolSettings_ may have degraded/reduced timeouts from the PDB pre-download phase,\n      // but the user is actively waiting for this binary so use generous timeout (BellwetherTimeoutSeconds = 60s).\n      var downloadSettings = symbolSettings_.Clone();\n      downloadSettings.HadFirstSuccessfulNetworkRequest = true;\n      DiagnosticLogger.LogInfo($\"[LazyBinaryLoad] Cloned settings for {imageName}: \" +\n        $\"EffectiveTimeout={downloadSettings.EffectiveTimeoutSeconds}s, \" +\n        $\"BellwetherTimeout={downloadSettings.BellwetherTimeoutSeconds}s, \" +\n        $\"HadFirstSuccess={downloadSettings.HadFirstSuccessfulNetworkRequest}, \" +\n        $\"Degraded={downloadSettings.SymbolServerDegraded}, \" +\n        $\"HadTimeout={downloadSettings.HadFirstTimeout}\");\n\n      var binFile = await FindBinaryFilePath(downloadSettings).ConfigureAwait(false);\n      if (binFile == null || !binFile.Found) {\n        DiagnosticLogger.LogWarning($\"[LazyBinaryLoad] Could not find binary for {imageName}\");\n\n        // Update state from LazyLoadPending to NotFound so the UI shows the failure.\n        report_.AddModuleInfo(binaryInfo_, binFile, ModuleLoadState.NotFound);\n        return false;\n      }\n\n      DiagnosticLogger.LogInfo($\"[LazyBinaryLoad] Found binary for {imageName}: {binFile.FilePath}\");\n      DiagnosticLogger.LogInfo($\"[LazyBinaryLoad] DebugInfo available: {DebugInfo != null}, compilerInfo available: {compilerInfo_ != null}\");\n\n      if (DebugInfo == null) {\n        DiagnosticLogger.LogError($\"[LazyBinaryLoad] DebugInfo is null for {imageName} - disassembly will fail!\");\n      }\n\n      // Create the disassembler loader with the binary.\n      // Pass preloadFunctions=false since we'll register functions manually.\n      bool isManagedImage = binFile.BinaryFile?.IsManagedImage ?? false;\n      var loader = new DisassemblerSectionLoader(binFile.FilePath, compilerInfo_, DebugInfo, false, isManagedImage);\n\n      // Initialize the loader's document with our existing summary.\n      // This is important because functions have already been added to Summary\n      // during profile loading and we need to preserve those references.\n      await Task.Run(async () => {\n        await loader.LoadDocument(null).ConfigureAwait(false);\n      }).ConfigureAwait(false);\n\n      // Verify the disassembler was initialized\n      bool disassemblerReady = loader.IsDisassemblerInitialized;\n      DiagnosticLogger.LogInfo($\"[LazyBinaryLoad] Disassembler initialized: {disassemblerReady}\");\n      if (!disassemblerReady) {\n        DiagnosticLogger.LogError($\"[LazyBinaryLoad] Disassembler failed to initialize for {imageName}!\");\n      }\n\n      // Re-register all existing functions with the new loader so it knows about them.\n      // The functions were already created via GetOrCreateFunction during profile loading.\n      int registeredCount = 0;\n      foreach (var kvp in functionMap_) {\n        var (func, debugInfo) = kvp.Value;\n        loader.RegisterFunction(func, debugInfo);\n        registeredCount++;\n      }\n      DiagnosticLogger.LogInfo($\"[LazyBinaryLoad] Registered {registeredCount} functions with loader for {imageName}\");\n\n      // Update the existing document IN PLACE so the session state reference remains valid.\n      // This is critical - creating a new document would break the reference that\n      // MainWindowSession.LoadAndParseSection() holds.\n      ModuleDocument.BinaryFile = BinaryFileSearchResult.Success(binFile.FilePath);\n      ModuleDocument.DebugInfo = DebugInfo;\n\n      // Dispose the old dummy loader and replace with the real one\n      ModuleDocument.Loader?.Dispose();\n      ModuleDocument.Loader = loader;\n\n      // Update the module load state in the report\n      report_.AddModuleInfo(binaryInfo_, binFile, ModuleLoadState.Loaded);\n      IsManaged = binFile.BinaryFile != null && binFile.BinaryFile.IsManagedImage;\n\n      DiagnosticLogger.LogInfo($\"[LazyBinaryLoad] Successfully loaded binary for {imageName}\");\n      return true;\n    }\n    finally {\n      binaryLoadLock_.Release();\n    }\n  }\n\n  public async Task<bool> InitializeDebugInfo(DebugFileSearchResult debugInfoFile) {\n    string imageName = binaryInfo_?.ImageName ?? \"Unknown\";\n    DiagnosticLogger.LogInfo($\"[DebugInfoInit] Initializing debug info for module {imageName}\");\n    \n    if (DebugInfo != null) {\n      DiagnosticLogger.LogInfo($\"[DebugInfoInit] Debug info already loaded for module {imageName}\");\n      return HasDebugInfo;\n    }\n\n    ModuleDocument.DebugInfoFile = debugInfoFile;\n\n    if (ModuleDocument.DebugInfoFile == null ||\n        !ModuleDocument.DebugInfoFile.Found) {\n      DiagnosticLogger.LogWarning($\"[DebugInfoInit] Debug info file not found for module {imageName}. DebugInfoFile={ModuleDocument.DebugInfoFile?.SymbolFile?.FileName ?? \"null\"}\");\n      report_.AddDebugInfo(binaryInfo_, ModuleDocument.DebugInfoFile);\n      return false;\n    }\n\n    DiagnosticLogger.LogInfo($\"[DebugInfoInit] Found debug info file for module {imageName}: {ModuleDocument.DebugInfoFile.SymbolFile.FileName}\");\n    DiagnosticLogger.LogInfo($\"[DebugInfoInit] Debug file path: {ModuleDocument.DebugInfoFile.FilePath}\");\n\n    DebugInfo = debugInfoProviderFactory_.CreateDebugInfoProvider(ModuleDocument.DebugInfoFile);\n    HasDebugInfo = DebugInfo != null;\n\n    if (HasDebugInfo) {\n      // Also set on the document so GetOrCreateDebugInfoProvider can find it.\n      ModuleDocument.DebugInfo = DebugInfo;\n      DiagnosticLogger.LogInfo($\"[DebugInfoInit] Successfully created debug info provider for module {imageName}\");\n\n      if (ModuleDocument.Loader is DisassemblerSectionLoader disassemblerSectionLoader) {\n        disassemblerSectionLoader.Initialize(DebugInfo);\n        DiagnosticLogger.LogInfo($\"[DebugInfoInit] Initialized disassembler with debug info for module {imageName}\");\n      }\n    }\n    else {\n      DiagnosticLogger.LogError($\"[DebugInfoInit] Failed to create debug info provider for module {imageName}\");\n      Trace.TraceWarning($\"Failed to load debug info: {ModuleDocument.DebugInfoFile}\");\n    }\n\n    report_.AddDebugInfo(binaryInfo_, ModuleDocument.DebugInfoFile);\n    return HasDebugInfo;\n  }\n\n  public async Task<BinaryFileSearchResult> FindBinaryFilePath(SymbolFileSourceSettings settings) {\n    // Use the symbol server to locate the image,\n    // this will also attempt to download it if not found locally.\n    return await binaryFileFinder_.FindBinaryFileAsync(binaryInfo_, settings).ConfigureAwait(false);\n  }\n\n  public (IRTextFunction Function, FunctionDebugInfo DebugInfo)\n    GetOrCreateFunction(long funcAddress) {\n#if DEBUG\n    Interlocked.Increment(ref FuncQueries);\n#endif\n\n    bool shouldLog = loggedFuncAddresses_.TryAdd(funcAddress, true); // Returns true if newly added\n    string moduleName = binaryInfo_?.ImageName ?? \"Unknown\";\n\n    // Try to get it form the concurrent dictionary first.\n    if (functionMap_.TryGetValue(funcAddress, out var pair)) {\n#if DEBUG\n      Interlocked.Increment(ref FuncFoundByAddress);\n#endif\n      if (shouldLog) {\n        DiagnosticLogger.LogInfo($\"[FunctionResolution] Module: {moduleName}, Address: 0x{funcAddress:X}, Function: {pair.Item1.Name} (found in cache)\");\n      }\n      return pair;\n    }\n\n    // Find function outside lock to reduce contention.\n    FunctionDebugInfo debugInfo = null;\n    long funcStartAddress = funcAddress;\n\n    if (HasDebugInfo) {\n      // Search for the function at this RVA.\n      debugInfo = DebugInfo.FindFunctionByRVA(funcAddress);\n      \n      if (debugInfo != null) {\n        if (shouldLog) {\n          DiagnosticLogger.LogInfo($\"[FunctionResolution] Module: {moduleName}, Address: 0x{funcAddress:X}, Function: {debugInfo.Name} (resolved via debug info)\");\n        }\n      } else if (shouldLog) {\n        DiagnosticLogger.LogWarning($\"[FunctionResolution] Module: {moduleName}, Address: 0x{funcAddress:X}, Function: NOT_RESOLVED (debug info available but no symbol found)\");\n      }\n    } else if (shouldLog) {\n      DiagnosticLogger.LogWarning($\"[FunctionResolution] Module: {moduleName}, Address: 0x{funcAddress:X}, Function: NOT_RESOLVED (no debug info available)\");\n    }\n\n    if (debugInfo == null) {\n      // Create a dummy debug entry for the missing function.\n      string placeholderName = $\"{funcAddress:X}\";\n      debugInfo = new FunctionDebugInfo(placeholderName, funcAddress, 0);\n      if (shouldLog) {\n        DiagnosticLogger.LogWarning($\"[FunctionResolution] Module: {moduleName}, Address: 0x{funcAddress:X}, Function: {placeholderName} (created placeholder)\");\n      }\n    }\n    else {\n      // Use the function start address from now on, this ensures\n      // that a single instance of it is created.\n      funcStartAddress = debugInfo.StartRVA;\n    }\n\n    // Check again under the write lock.\n    if (functionMap_.TryGetValue(funcStartAddress, out pair)) {\n#if DEBUG\n      Interlocked.Increment(ref FuncFoundByFuncAddress);\n#endif\n      functionMap_.TryAdd(funcAddress, pair);\n      return pair;\n    }\n\n    // Acquire write lock to create an entry for the function.\n    lock_.EnterWriteLock();\n\n    // Check again under the write lock.\n    if (functionMap_.TryGetValue(funcStartAddress, out pair)) {\n#if DEBUG\n      Interlocked.Increment(ref FuncFoundByFuncAddressLocked);\n#endif\n      lock_.ExitWriteLock();\n      return pair;\n    }\n\n    // Add the new function to the module and disassembler.\n    var func = ModuleDocument.AddDummyFunction(debugInfo.Name);\n\n    if (ModuleDocument.Loader is DisassemblerSectionLoader disassemblerSectionLoader) {\n      disassemblerSectionLoader.RegisterFunction(func, debugInfo);\n    }\n\n#if DEBUG\n    Interlocked.Increment(ref FuncCreated);\n#endif\n    // Cache RVA -> function mapping.\n    pair = (func, debugInfo);\n\n    if (funcStartAddress != funcAddress) {\n      functionMap_.TryAdd(funcStartAddress, pair);\n    }\n\n    lock_.ExitWriteLock();\n\n    functionMap_.TryAdd(funcAddress, pair);\n    return pair;\n  }\n\n#if DEBUG\n  public static void PrintStatistics() {\n    Trace.WriteLine($\"FuncQueries: {FuncQueries}\");\n    Trace.WriteLine($\"FuncFoundByAddress: {FuncFoundByAddress}\");\n    Trace.WriteLine($\"FuncFoundByFuncAddress: {FuncFoundByFuncAddress}\");\n    Trace.WriteLine($\"FuncFoundByFuncAddressLocked: {FuncFoundByFuncAddressLocked}\");\n    Trace.WriteLine($\"FuncCreated: {FuncCreated}\");\n  }\n#endif\n\n  private void CreateDummyDocument(BinaryFileDescriptor binaryInfo) {\n    // Create a dummy document to represent the module,\n    // AddPlaceholderFunction will populate it.\n    ModuleDocument = LoadedDocument.CreateDummyDocument(binaryInfo.ImageName);\n    Summary = ModuleDocument.Summary;\n\n    // Set up lazy binary loading callback - this will be called when\n    // user tries to view assembly/graph and binary hasn't been downloaded yet.\n    ModuleDocument.EnsureBinaryLoaded = EnsureBinaryLoaded;\n  }\n\n  private async Task<ILoadedDocument> CreateLoadedDocument(string filePath, string modulePath, IRTextSectionLoader loader) {\n    try {\n      var result = await Task.Run(async () => {\n        var result = new LoadedDocument(filePath, modulePath, Guid.NewGuid());\n        result.Loader = loader;\n        result.Summary = await result.Loader.LoadDocument(null);\n        return result;\n      });\n\n      return result;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load document {filePath}: {ex}\");\n      return null;\n    }\n  }\n\n  public void Dispose() {\n    disposed_ = true;\n    lock_?.Dispose();\n    binaryLoadLock_?.Dispose();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/RawProfileData.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reflection.PortableExecutable;\nusing System.Runtime.InteropServices;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Collections;\nusing ProfileExplorer.Core.Profile.ETW;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\n[ProtoContract(SkipConstructor = true)]\npublic class RawProfileData : IDisposable {\n  private static ProfileContext tempContext_ = new();\n  private static ProfileStack tempStack_ = new();\n\n  // Per-thread caches to speed up lookups.\n  [ThreadStatic]\n  private static List<(int ProcessId, IpToImageCache Cache)> ipImageCache_;\n  [ThreadStatic]\n  private static ProfileImage lastIpImage_;\n  [ThreadStatic]\n  private static IpToImageCache globalIpImageCache_;\n\n  /// <summary>\n  /// Clears thread-local caches on the current thread\n  /// </summary>\n  public static void ClearThreadLocalCaches() {\n    ipImageCache_ = null;\n    lastIpImage_ = null;\n    globalIpImageCache_ = null;\n  }\n  [ProtoMember(1)]\n  private List<ProfileSample> samples_;\n  [ProtoMember(2)]\n  private Dictionary<int, ProfileProcess> processes_;\n  [ProtoMember(3)]\n  private List<ProfileThread> threads_;\n  [ProtoMember(4)]\n  private List<ProfileContext> contexts_;\n  [ProtoMember(5)]\n  private List<ProfileImage> images_;\n  [ProtoMember(6)]\n  private List<ProfileStack> stacks_;\n  [ProtoMember(7)]\n  private List<PerformanceCounter> perfCounters_;\n  [ProtoMember(8)]\n  private CompressedSegmentedList<PerformanceCounterEvent> perfCountersEvents_;\n  [ProtoMember(9)]\n  private ProfileTraceInfo traceInfo_;\n\n  // Objects used only while building the profile.\n  private Dictionary<ProfileThread, int> threadsMap_;\n  private Dictionary<ProfileContext, int> contextsMap_;\n  private Dictionary<ProfileImage, int> imagesMap_;\n  private Dictionary<int, Dictionary<ProfileStack, int>> stacksMap_;\n  private Dictionary<int, Dictionary<long, SymbolFileDescriptor>> imageSymbols_;\n  private HashSet<long[]> stackData_;\n  private Dictionary<int, ManagedRawProfileData> procManagedDataMap_;\n  private Dictionary<ProfileStack, int> lastProcStacks_;\n  private int lastProcId_;\n\n  public RawProfileData(string tracePath, bool handlesDotNetEvents = false) {\n    traceInfo_ = new ProfileTraceInfo(tracePath);\n    contexts_ = new List<ProfileContext>();\n    contextsMap_ = new Dictionary<ProfileContext, int>();\n    images_ = new List<ProfileImage>();\n    imagesMap_ = new Dictionary<ProfileImage, int>();\n    processes_ = new Dictionary<int, ProfileProcess>();\n    threads_ = new List<ProfileThread>();\n    threadsMap_ = new Dictionary<ProfileThread, int>();\n    stacks_ = new List<ProfileStack>();\n    stacksMap_ = new Dictionary<int, Dictionary<ProfileStack, int>>();\n    stackData_ = new HashSet<long[]>(new StackComparer());\n    samples_ = new List<ProfileSample>();\n    perfCounters_ = new List<PerformanceCounter>();\n    imageSymbols_ = new Dictionary<int, Dictionary<long, SymbolFileDescriptor>>();\n\n    if (handlesDotNetEvents) {\n      procManagedDataMap_ = new Dictionary<int, ManagedRawProfileData>();\n    }\n  }\n\n  public ProfileTraceInfo TraceInfo => traceInfo_;\n  public List<ProfileSample> Samples => samples_;\n  public List<ProfileProcess> Processes => processes_.ToValueList();\n  public List<ProfileThread> Threads => threads_;\n  public List<ProfileImage> Images => images_;\n  public CompressedSegmentedList<PerformanceCounterEvent> PerformanceCountersEvents => perfCountersEvents_;\n  public List<PerformanceCounter> PerformanceCounters => perfCounters_;\n  public bool HasPerformanceCountersEvents => PerformanceCountersEvents is {Count: > 0};\n\n  public void Dispose() {\n    perfCountersEvents_?.Dispose();\n  }\n\n  public bool HasManagedMethods(int processId) {\n    return procManagedDataMap_ != null && procManagedDataMap_.ContainsKey(processId);\n  }\n\n  public int ComputeSampleChunkLength(int chunks) {\n    int chunkSize = Math.Max(1, samples_.Count / chunks);\n    chunkSize = CompressedSegmentedList<ProfileSample>.RoundUpToSegmentLength(chunkSize);\n    return Math.Min(chunkSize, samples_.Count);\n  }\n\n  public int ComputePerfCounterChunkLength(int chunks) {\n    if (perfCountersEvents_ == null) {\n      return 0;\n    }\n\n    int chunkSize = Math.Max(1, perfCountersEvents_.Count / chunks);\n    chunkSize = CompressedSegmentedList<PerformanceCounterEvent>.RoundUpToSegmentLength(chunkSize);\n    return Math.Min(chunkSize, perfCountersEvents_.Count);\n  }\n\n  public void AddManagedMethodMapping(long moduleId, long methodId, long rejitId,\n                                      FunctionDebugInfo functionDebugInfo,\n                                      long ip, int size, int processId) {\n    var (moduleDebugInfo, moduleImage) = GetModuleDebugInfo(processId, moduleId);\n\n    var mapping = new ManagedMethodMapping(functionDebugInfo, moduleImage, moduleId, ip, size);\n    var data = GetOrCreateManagedData(processId);\n    data.managedMethods_.Add(mapping);\n\n    if (moduleImage == null) {\n      // A placeholder is created for cases where the method load event\n      // is triggered before the module load one, add mapping to patch list\n      // to have the image filled in later.\n      data.patchedMappings_.Add((moduleId, mapping));\n    }\n\n    //? TODO: MethodID is identical between opt levels, either split by level or use time like TraceEvent\n    string initialName = functionDebugInfo.Name;\n\n    //if (data.managedMethodsMap_.TryGetValue(initialName, out var other)) {\n    //    if (other.FunctionDebugInfo.HasOptimizationLevel &&\n    //        !other.FunctionDebugInfo.Name.EndsWith(other.FunctionDebugInfo.OptimizationLevel)) {\n    //        other.FunctionDebugInfo.UpdateName($\"{other.FunctionDebugInfo.Name}_{other.FunctionDebugInfo.OptimizationLevel}\");\n    //    }\n\n    //    if (functionDebugInfo.HasOptimizationLevel) {\n    //        functionDebugInfo.UpdateName($\"{functionDebugInfo.Name}_{functionDebugInfo.OptimizationLevel}\");\n    //    }\n    //}\n\n    moduleDebugInfo.AddFunctionInfo(functionDebugInfo);\n    data.managedMethodIdMap_[new ManagedMethodId(methodId, rejitId)] = mapping;\n    data.managedMethodsMap_[initialName] = mapping;\n  }\n\n  public void AddManagedMethodCode(long functionId, int rejitId, int processId, long address, int codeSize,\n                                   byte[] codeBytes) {\n    var info = new DotNetDebugInfoProvider.MethodCode(address, codeSize, codeBytes);\n    var data = GetOrCreateManagedData(processId);\n    data.managedMethodCodeMap_[new ManagedMethodId(functionId, rejitId)] = info;\n  }\n\n  public void AddManagedMethodCallTarget(long functionId, int rejitId, int processId, long address, string name) {\n    var data = GetOrCreateManagedData(processId);\n\n    if (data.managedMethodCodeMap_.TryGetValue(new ManagedMethodId(functionId, rejitId), out var code)) {\n      code.CallTargets.Add(new DotNetDebugInfoProvider.AddressNamePair(address, name));\n    }\n  }\n\n  public ManagedMethodMapping FindManagedMethodForIP(long ip, int processId) {\n    var data = GetOrCreateManagedData(processId);\n    return ManagedMethodMapping.BinarySearch(data.managedMethods_, ip);\n  }\n\n  public ManagedMethodMapping FindManagedMethod(long id, long rejitId, int processId) {\n    var data = GetOrCreateManagedData(processId);\n    return data.managedMethodIdMap_.GetValueOrNull(new ManagedMethodId(id, rejitId));\n  }\n\n  public IDebugInfoProvider GetDebugInfoForManagedImage(ProfileImage image, int processId) {\n    if (!HasManagedMethods(processId)) {\n      return null;\n    }\n\n    var data = GetOrCreateManagedData(processId);\n    return data.imageDebugInfo_?.GetValueOrNull(image);\n  }\n\n  public void AddDebugFileForImage(SymbolFileDescriptor symbolFile, long imageBase, int processId) {\n    var procImageSymbols = imageSymbols_.GetOrAddValue(processId);\n    procImageSymbols[imageBase] = symbolFile;\n  }\n\n  public SymbolFileDescriptor GetDebugFileForImage(ProfileImage image, int processId) {\n    int originalProcessId = processId;\n\n    // If the module is loaded in kernel address space,\n    // look for the debug info entry in the kernel process.\n    if (ETWEventProcessor.IsKernelAddress((ulong)image.BaseAddress, TraceInfo.PointerSize)) {\n      processId = ETWEventProcessor.KernelProcessId;\n    }\n\n    var procImageSymbols = imageSymbols_.GetOrAddValue(processId);\n\n    if (procImageSymbols == null) {\n      return null;\n    }\n\n    var result = procImageSymbols.GetValueOrNull(image.BaseAddress);\n\n    // Debug logging for missing symbol files - important system DLLs\n    if (result == null && (image.ModuleName.Contains(\"ntdll\", StringComparison.OrdinalIgnoreCase) ||\n                           image.ModuleName.Contains(\"win32u\", StringComparison.OrdinalIgnoreCase) ||\n                           image.ModuleName.Contains(\"user32\", StringComparison.OrdinalIgnoreCase) ||\n                           image.ModuleName.Contains(\"kernel32\", StringComparison.OrdinalIgnoreCase) ||\n                           image.ModuleName.Contains(\"combase\", StringComparison.OrdinalIgnoreCase))) {\n      var availableBases = procImageSymbols.Keys.Take(20).Select(k => $\"0x{k:X}\");\n      string message = $\"[SymbolLookup] {image.ModuleName} ImageID_DbgID not found! \" +\n        $\"ProcessId={processId} (original={originalProcessId}), BaseAddress=0x{image.BaseAddress:X}. \" +\n        $\"First 20 available bases: {string.Join(\", \", availableBases)}\";\n      // Log to both VS Output (Trace) and diagnostic file\n      System.Diagnostics.Trace.WriteLine(message);\n      Utilities.DiagnosticLogger.LogWarning(message);\n    }\n\n    return result;\n  }\n\n  public DotNetDebugInfoProvider GetOrAddManagedModuleDebugInfo(int processId, string moduleName,\n                                                                long moduleId, Machine architecture) {\n    var data = GetOrCreateManagedData(processId);\n    var proc = GetOrCreateProcess(processId);\n\n    foreach (var image in proc.Images(this)) {\n      //? TODO: Avoid linear search\n      if (image.ModuleName.Equals(moduleName, StringComparison.OrdinalIgnoreCase)) {\n        if (!data.imageDebugInfo_.TryGetValue(image, out var debugInfo)) {\n          // A placeholder is created for cases where the method load event\n          // is triggered before the module load one, use that provider.\n          if (!data.moduleDebugInfoMap_.TryGetValue(moduleId, out debugInfo)) {\n            debugInfo = new DotNetDebugInfoProvider(architecture);\n          }\n          else {\n            debugInfo.UpdateArchitecture(architecture);\n\n            foreach (var pair in data.patchedMappings_) {\n              if (pair.ModuleId == moduleId) {\n                pair.Mapping.Image = image;\n              }\n            }\n          }\n\n          data.imageDebugInfo_[image] = debugInfo;\n          data.moduleDebugInfoMap_[moduleId] = debugInfo;\n          data.moduleImageMap_[moduleId] = image;\n        }\n\n        return debugInfo;\n      }\n    }\n\n    return null;\n  }\n\n  public (DotNetDebugInfoProvider, ProfileImage) GetModuleDebugInfo(int processId, long moduleId) {\n    var data = GetOrCreateManagedData(processId);\n\n    var debugInfo = data.moduleDebugInfoMap_.GetValueOrNull(moduleId);\n    var image = data.moduleImageMap_.GetValueOrNull(moduleId);\n\n    if (debugInfo == null) {\n      // Module loaded event not triggered yet, create a placeholder for now.\n      debugInfo = new DotNetDebugInfoProvider(Machine.Unknown);\n      data.moduleDebugInfoMap_[moduleId] = debugInfo;\n    }\n\n    return (debugInfo, image);\n  }\n\n  public void LoadingCompleted() {\n    // Free objects used only during trace event processing.\n    stacksMap_ = null;\n    contextsMap_ = null;\n    imagesMap_ = null;\n    threadsMap_ = null;\n    stackData_ = null;\n    lastProcStacks_ = null;\n\n    // Wait for any compression tasks.\n    perfCountersEvents_?.Wait();\n  }\n\n  /// <summary>\n  /// Adds an image directly to the images list and assigns it a sequential ID,\n  /// bypassing deduplication. Safe to call after LoadingCompleted().\n  /// </summary>\n  public void AddImageDirect(ProfileImage image) {\n    if (imagesMap_ != null) {\n      throw new InvalidOperationException(\n        \"AddImageDirect can only be called after LoadingCompleted() has been invoked.\");\n    }\n\n    images_.Add(image);\n    image.Id = images_.Count;\n  }\n\n  public void ManagedLoadingCompleted() {\n    if (procManagedDataMap_ != null) {\n      foreach (var pair in procManagedDataMap_) {\n        pair.Value.LoadingCompleted(pair.Key);\n      }\n    }\n  }\n\n  public ProfileProcess GetOrCreateProcess(int id) {\n    if (processes_.TryGetValue(id, out var process)) {\n      return process;\n    }\n\n    return processes_.GetOrAddValue(id, () => new ProfileProcess(id));\n  }\n\n  public void AddProcess(ProfileProcess process) {\n    processes_[process.ProcessId] = process;\n  }\n\n  public int AddImage(ProfileImage image) {\n    if (!imagesMap_.TryGetValue(image, out int existingImageId)) {\n      images_.Add(image);\n      int id = images_.Count;\n      image.Id = id;\n      imagesMap_[image] = id;\n      existingImageId = id;\n    }\n\n    return existingImageId;\n  }\n\n  public ProfileImage FindImage(int id) {\n    Debug.Assert(id > 0 && id <= images_.Count);\n    return images_[id - 1];\n  }\n\n  public ProfileImage FindImageByTimestamp(int timestamp) {\n    foreach (var image in images_) {\n      if (image.TimeStamp == timestamp) {\n        return image;\n      }\n    }\n    return null;\n  }\n\n  public int AddThread(ProfileThread thread) {\n    if (!threadsMap_.TryGetValue(thread, out int existingThread)) {\n      threads_.Add(thread);\n      existingThread = threads_.Count;\n      threadsMap_[thread] = threads_.Count;\n    }\n\n    return existingThread;\n  }\n\n  public ProfileThread FindThread(int id) {\n    Debug.Assert(id > 0 && id <= threads_.Count);\n    return threads_[id - 1];\n  }\n\n  public int AddThreadToProcess(int processId, ProfileThread thread) {\n    var proc = GetOrCreateProcess(processId);\n    int result = AddThread(thread);\n    proc.AddThread(result);\n    return result;\n  }\n\n  public int AddImageToProcess(int processId, ProfileImage image) {\n    var proc = GetOrCreateProcess(processId);\n    int result = AddImage(image);\n    proc.AddImage(result);\n    return result;\n  }\n\n  public int AddSample(ProfileSample sample) {\n    Debug.Assert(sample.ContextId != 0);\n    samples_.Add(sample);\n    return samples_.Count;\n  }\n\n  public bool TrySetSampleStack(int sampleId, int stackId, long frameIp, int contextId) {\n    if (sampleId == 0) {\n      return false;\n    }\n\n    if (samples_[sampleId - 1].ContextId == contextId &&\n        samples_[sampleId - 1].IP == frameIp) {\n      SetSampleStack(sampleId, stackId, contextId);\n      return true;\n    }\n\n    return false;\n  }\n\n  public void SetSampleStack(int sampleId, int stackId, int contextId) {\n    // Change the stack ID in-place in the array.\n    Debug.Assert(samples_[sampleId - 1].ContextId == contextId);\n    CollectionsMarshal.AsSpan(samples_)[sampleId - 1].StackId = stackId;\n  }\n\n  public int AddPerformanceCounter(PerformanceCounter counter) {\n    perfCounters_.Add(counter);\n    return perfCounters_.Count;\n  }\n\n  public int AddPerformanceCounterEvent(PerformanceCounterEvent counterEvent) {\n    Debug.Assert(counterEvent.ContextId != 0);\n    perfCountersEvents_ ??= new CompressedSegmentedList<PerformanceCounterEvent>();\n    perfCountersEvents_.Add(counterEvent);\n    return perfCountersEvents_.Count;\n  }\n\n  public ProfileContext FindContext(int id) {\n    Debug.Assert(id > 0 && id <= contexts_.Count);\n    return contexts_[id - 1];\n  }\n\n  public int AddStack(ProfileStack stack, ProfileContext context) {\n    Debug.Assert(stack.ContextId != 0);\n    Dictionary<ProfileStack, int> procStacks = null;\n\n    if (lastProcId_ == context.ProcessId && lastProcStacks_ != null) {\n      procStacks = lastProcStacks_;\n    }\n    else {\n      if (!stacksMap_.TryGetValue(context.ProcessId, out procStacks)) {\n        procStacks = new Dictionary<ProfileStack, int>();\n        stacksMap_[context.ProcessId] = procStacks;\n      }\n\n      lastProcId_ = context.ProcessId;\n      lastProcStacks_ = procStacks;\n    }\n\n    if (!procStacks.TryGetValue(stack, out int existingStackId)) {\n      // De-duplicate the stack frame pointer array,\n      // since lots of samples have identical stacks.\n      if (!stackData_.TryGetValue(stack.FramePointers, out long[] framePtrData)) {\n        // Make a clone since the temporary stack uses a static array.\n        framePtrData = stack.CloneFramePointers();\n        stackData_.Add(framePtrData);\n      }\n\n      var newStack = new ProfileStack(stack.ContextId, framePtrData);\n      stacks_.Add(newStack);\n      procStacks[newStack] = stacks_.Count;\n      existingStackId = stacks_.Count;\n    }\n    else {\n      Debug.Assert(stack == FindStack(existingStackId));\n    }\n\n    stack.Discard();\n    return existingStackId;\n  }\n\n  public void ReplaceStackFramePointers(ProfileStack stack, long[] newFramePtrs, ProfileContext context) {\n    if (stacksMap_.TryGetValue(context.ProcessId, out var procStacks)) {\n      procStacks.Remove(stack);\n    }\n\n    stack.FramePointers = newFramePtrs;\n    AddStack(stack, context);\n  }\n\n  public ProfileStack FindStack(int id) {\n    Debug.Assert(id > 0 && id <= stacks_.Count);\n    return stacks_[id - 1];\n  }\n\n  public ProfileProcess FindProcess(string name, bool allowSubstring = false) {\n    foreach (var process in processes_.Values) {\n      if (process.Name == name) {\n        return process;\n      }\n    }\n\n    if (allowSubstring) {\n      foreach (var process in processes_.Values) {\n        if (process.Name.Contains(name)) {\n          return process;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  public ProfileProcess FindProcess(int processId) {\n    return processes_.GetValueOrNull(processId);\n  }\n\n  public ProfileImage FindImage(ProfileProcess process, BinaryFileDescriptor info) {\n    foreach (var image in process.Images(this)) {\n      if (image.FilePath == info.ImageName &&\n          image.TimeStamp == info.TimeStamp &&\n          image.Checksum == info.Checksum) {\n        return image;\n      }\n    }\n\n    return null;\n  }\n\n  public ProfileImage FindImageForIP(long ip, ProfileContext context) {\n    return FindImageForIP(ip, context.ProcessId);\n  }\n\n  public ProfileImage FindImageForIP(long ip, int processId) {\n    // lastIpImage_ and ipImageCache_ are thread-local,\n    // making this function thread-safe.\n    if (lastIpImage_ != null && lastIpImage_.HasAddress(ip)) {\n      return lastIpImage_;\n    }\n\n    ipImageCache_ ??= new List<(int ProcessId, IpToImageCache Cache)>();\n    IpToImageCache cache = null;\n\n    foreach (var entry in ipImageCache_) {\n      if (entry.ProcessId == processId) {\n        cache = entry.Cache;\n        break;\n      }\n    }\n\n    if (cache == null) {\n      var process = GetOrCreateProcess(processId);\n      cache = IpToImageCache.Create(process.Images(this));\n      ipImageCache_.Add((processId, cache));\n    }\n\n    if (!cache.IsValidAddres(ip)) {\n      return null;\n    }\n\n    var result = cache.Find(ip);\n\n    if (result != null) {\n      lastIpImage_ = result;\n      return result;\n    }\n\n    // Trace.WriteLine($\"No image for ip {ip:X}\");\n    return null;\n  }\n\n  public ProfileImage FindImageForIP(long ip) {\n    if (globalIpImageCache_ == null) {\n      // Per-thread, no locks needed.\n      globalIpImageCache_ = IpToImageCache.Create(images_);\n    }\n\n    return globalIpImageCache_.Find(ip);\n  }\n\n  public List<ProcessSummary> BuildProcessSummary() {\n    var builder = new ProcessSummaryBuilder(this);\n\n    foreach (var sample in samples_) {\n      builder.AddSample(sample);\n    }\n\n    return builder.MakeSummaries();\n  }\n\n  public void PrintProcess(int processId) {\n    var proc = GetOrCreateProcess(processId);\n\n    if (proc != null) {\n      Trace.WriteLine($\"Process {proc}\");\n\n      foreach (var image in proc.Images(this)) {\n        Trace.WriteLine($\"Image: {image}\");\n\n        if (HasManagedMethods(proc.ProcessId)) {\n          var data = GetOrCreateManagedData(proc.ProcessId);\n          Trace.WriteLine($\"   o methods: {data.managedMethods_.Count}\");\n          Trace.WriteLine($\"   o hasDebug: {data.imageDebugInfo_ != null && data.imageDebugInfo_.ContainsKey(image)}\");\n        }\n      }\n    }\n  }\n\n  public void PrintAllProcesses() {\n    Trace.WriteLine($\"Profile processes: {processes_.Count}\");\n\n    foreach (var proc in processes_) {\n      Trace.WriteLine($\"- {proc}\");\n    }\n  }\n\n  public void PrintPerfCounters(int processId) {\n    if (perfCountersEvents_ == null) {\n      return;\n    }\n\n    foreach (var sample in perfCountersEvents_) {\n      var context = sample.GetContext(this);\n\n      if (context.ProcessId == processId) {\n        Trace.WriteLine($\"{sample}\");\n      }\n    }\n  }\n\n  public void PrintSamples(int processId) {\n    foreach (var sample in samples_) {\n      var context = sample.GetContext(this);\n\n      if (context.ProcessId == processId) {\n        Trace.WriteLine($\"{sample}\");\n      }\n    }\n  }\n\n  internal ProfileContext RentTempContext(int processId, int threadId, int processorNumber) {\n    tempContext_.ProcessId = processId;\n    tempContext_.ThreadId = threadId;\n    tempContext_.ProcessorNumber = processorNumber;\n    return tempContext_;\n  }\n\n  internal void ReturnContext(int contextId) {\n    var context = FindContext(contextId);\n\n    if (ReferenceEquals(context, tempContext_)) {\n      tempContext_ = new ProfileContext();\n    }\n  }\n\n  internal int AddContext(ProfileContext context) {\n    ref int existingContextId = ref CollectionsMarshal.GetValueRefOrAddDefault(contextsMap_, context, out bool exists);\n\n    if (!exists) {\n      contexts_.Add(context);\n      existingContextId = contexts_.Count;\n    }\n\n    return existingContextId;\n  }\n\n  internal ProfileStack RentTemporaryStack(int frameCount, int contextId) {\n    tempStack_.SetTempFramePointers(frameCount);\n    tempStack_.ContextId = contextId;\n    return tempStack_;\n  }\n\n  internal void ReturnStack(int stackId) {\n    var stack = FindStack(stackId);\n\n    if (ReferenceEquals(stack, tempStack_)) {\n      tempStack_ = new ProfileStack();\n    }\n  }\n\n  private ManagedRawProfileData GetOrCreateManagedData(int processId) {\n    if (!procManagedDataMap_.TryGetValue(processId, out var data)) {\n      data = new ManagedRawProfileData();\n      procManagedDataMap_[processId] = data;\n    }\n\n    return data;\n  }\n}\n\npublic class StackComparer : IEqualityComparer<long[]> {\n  public bool Equals(long[] data1, long[] data2) {\n    return AreEqual(data1, data2);\n  }\n\n  public int GetHashCode(long[] data) {\n    return ComputeHashCode(data);\n  }\n\n  public static bool AreEqual(long[] data1, long[] data2) {\n    if (data1.Length != data2.Length) {\n      return false;\n    }\n\n    return data1.AsSpan().SequenceEqual(data2.AsSpan());\n  }\n\n  public static int ComputeHashCode(long[] data) {\n    HashCode hash = new();\n    hash.AddBytes(MemoryMarshal.AsBytes(data.AsSpan()));\n    return hash.ToHashCode();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/RawProfileModel.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\n[ProtoContract(SkipConstructor = true)]\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic struct ProfileSample : IEquatable<ProfileSample> {\n  [ProtoMember(1)]\n  public long IP { get; set; }\n  [ProtoMember(2)]\n  public TimeSpan Time { get; set; }\n  [ProtoMember(3)]\n  public TimeSpan Weight { get; set; }\n  [ProtoMember(4)]\n  public int StackId { get; set; }\n  [ProtoMember(5)]\n  public int ContextId { get; set; }\n  [ProtoMember(6)]\n  public bool IsKernelCode { get; set; }\n  public bool HasStack => StackId != 0;\n\n  //public ProfileSample() {}\n\n  public ProfileSample(long ip, TimeSpan time, TimeSpan weight, bool isKernelCode, int contextId) {\n    IP = ip;\n    Time = time;\n    Weight = weight;\n    StackId = 0;\n    IsKernelCode = isKernelCode;\n    ContextId = contextId;\n  }\n\n  public ProfileStack GetStack(RawProfileData profileData) {\n    return StackId != 0 ? profileData.FindStack(StackId) : ProfileStack.Unknown;\n  }\n\n  public ProfileContext GetContext(RawProfileData profileData) {\n    return profileData.FindContext(ContextId);\n  }\n\n  public bool Equals(ProfileSample other) {\n    return IP == other.IP &&\n           Time == other.Time &&\n           Weight == other.Weight &&\n           StackId == other.StackId &&\n           ContextId == other.ContextId &&\n           IsKernelCode == other.IsKernelCode;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is ProfileSample other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(IP, Time, StackId, ContextId);\n  }\n\n  public static bool operator ==(ProfileSample left, ProfileSample right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileSample left, ProfileSample right) {\n    return !Equals(left, right);\n  }\n\n  public override string ToString() {\n    return $\"{IP:X}, Weight: {Weight.Ticks}, StackId: {StackId}\";\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic struct PerformanceCounterEvent : IEquatable<PerformanceCounterEvent> {\n  [ProtoMember(1)]\n  public long IP { get; set; }\n  [ProtoMember(2)]\n  public TimeSpan Time { get; set; }\n  [ProtoMember(3)]\n  public int ContextId { get; set; }\n  [ProtoMember(4)]\n  public short CounterId;\n\n  public PerformanceCounterEvent(long ip, TimeSpan time, int contextId, short counterId) {\n    IP = ip;\n    Time = time;\n    ContextId = contextId;\n    CounterId = counterId;\n  }\n\n  public ProfileContext GetContext(RawProfileData profileData) {\n    return profileData.FindContext(ContextId);\n  }\n\n  public bool Equals(PerformanceCounterEvent other) {\n    return Time == other.Time && IP == other.IP &&\n           ContextId == other.ContextId &&\n           CounterId == other.CounterId;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is PerformanceCounterEvent other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Time, IP, ContextId, CounterId);\n  }\n\n  public override string ToString() {\n    return $\"PMC {CounterId}: {IP:X}, {Time}\";\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProfileStack : IEquatable<ProfileStack> {\n  private const int MaxFrameNumber = 512;\n  private static long[][] TempFrameArrays = new long[MaxFrameNumber + 1][];\n  public static readonly ProfileStack Unknown = new();\n  private object optionalData_;\n\n  static ProfileStack() {\n    // The frame ptr. array is being interned (unique instance)\n    // later, use a pre-allocated array initially to reduce GC pressure.\n    // Note: this also means creating ProfileStack must be single-threaded.\n    for (int i = 0; i <= MaxFrameNumber; i++) {\n      TempFrameArrays[i] = new long[i];\n    }\n  }\n\n  public ProfileStack() {\n    FramePointers = null;\n    ContextId = 0;\n  }\n\n  public ProfileStack(int contextId, int frameCount) {\n    ContextId = contextId;\n    FramePointers = RentArray(frameCount);\n  }\n\n  public ProfileStack(int contextId, long[] framePtrs) {\n    ContextId = contextId;\n    FramePointers = framePtrs;\n  }\n\n  [ProtoMember(1)]\n  public long[] FramePointers { get; set; }\n  [ProtoMember(2)]\n  public int ContextId { get; set; }\n  [ProtoMember(3)]\n  public int UserModeTransitionIndex { get; set; }\n  public bool IsUnknown => FramePointers == null;\n  public int FrameCount => FramePointers.Length;\n\n  public bool Equals(ProfileStack other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    // FramePointers is allocated using interning, ref. equality is sufficient.\n    return ContextId == other.ContextId &&\n           UserModeTransitionIndex == other.UserModeTransitionIndex &&\n           FramePointers == other.FramePointers;\n  }\n\n  public static bool operator ==(ProfileStack left, ProfileStack right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileStack left, ProfileStack right) {\n    return !Equals(left, right);\n  }\n\n  public object GetOptionalData() {\n    Interlocked.MemoryBarrier();\n    return optionalData_;\n  }\n\n  public void SetOptionalData(object value) {\n    optionalData_ = value;\n    Interlocked.MemoryBarrier();\n  }\n\n  public long[] CloneFramePointers() {\n    long[] clone = new long[FramePointers.Length];\n    FramePointers.CopyTo(clone, 0);\n    return clone;\n  }\n\n  public void SetTempFramePointers(int frameCount) {\n    FramePointers = RentArray(frameCount);\n  }\n\n  public ProfileImage FindImageForFrame(int frameIndex, RawProfileData profileData) {\n    return profileData.FindImageForIP(FramePointers[frameIndex], profileData.FindContext(ContextId));\n  }\n\n  public void Discard() {\n    ReturnArray(FramePointers);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is ProfileStack other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    int framePtrHash = StackComparer.ComputeHashCode(FramePointers);\n    return HashCode.Combine(framePtrHash, ContextId);\n  }\n\n  public override string ToString() {\n    return $\"#{FrameCount}, ContextId: {ContextId}\";\n  }\n\n  private long[] RentArray(int frameCount) {\n    // In most cases one of the pre-allocated temporary arrays can be used.\n    long[] array;\n\n    if (frameCount <= MaxFrameNumber) {\n      array = TempFrameArrays[frameCount];\n#if DEBUG\n      Debug.Assert(array != null);\n      TempFrameArrays[frameCount] = null;\n#endif\n    }\n    else {\n      array = new long[frameCount];\n    }\n\n    return array;\n  }\n\n  private void ReturnArray(long[] array) {\n#if DEBUG\n    if (array.Length <= MaxFrameNumber) {\n      TempFrameArrays[array.Length] = array;\n    }\n#endif\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProfileTraceInfo {\n  public ProfileTraceInfo(string tracePath = null) {\n    TraceFilePath = tracePath;\n  }\n\n  [ProtoMember(1)]\n  public DateTime ProfileStartTime { get; set; }\n  [ProtoMember(2)]\n  public DateTime ProfileEndTime { get; set; }\n  [ProtoMember(3)]\n  public int CpuCount { get; set; }\n  [ProtoMember(4)]\n  public int CpuSpeed { get; set; }\n  [ProtoMember(5)]\n  public int PointerSize { get; set; }\n  [ProtoMember(6)]\n  public int MemorySize { get; set; }\n  [ProtoMember(7)]\n  public string ComputerName { get; set; }\n  [ProtoMember(8)]\n  public string DomainName { get; set; }\n  [ProtoMember(9)]\n  public string TraceFilePath { get; set; }\n  [ProtoMember(10)]\n  public TimeSpan SamplingInterval { get; set; }\n  [ProtoMember(11)]\n  public int ImageLoadEventCount { get; set; }\n  [ProtoMember(12)]\n  public int ImageLoadWithTimestampCount { get; set; }\n  [ProtoMember(13)]\n  public int ImageIdEventCount { get; set; }\n  [ProtoMember(14)]\n  public int ImageIdDbgEventCount { get; set; }\n  public bool Is64Bit => PointerSize == 8;\n  public TimeSpan ProfileDuration => ProfileEndTime - ProfileStartTime;\n  public bool HasImageIdEvents => ImageIdDbgEventCount > 0;\n  /// <summary>\n  /// True if trace has valid binary lookup info (timestamps for symbol server).\n  /// </summary>\n  public bool HasValidBinaryLookupInfo => ImageLoadWithTimestampCount > 0;\n\n  public bool HasSameTraceFilePath(ProfileTraceInfo other) {\n    if (!string.IsNullOrEmpty(TraceFilePath) &&\n        !string.IsNullOrEmpty(other.TraceFilePath)) {\n      return string.Equals(TraceFilePath, other.TraceFilePath, StringComparison.OrdinalIgnoreCase);\n    }\n\n    return string.IsNullOrEmpty(TraceFilePath) &&\n           string.IsNullOrEmpty(other.TraceFilePath);\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic sealed class ProfileContext : IEquatable<ProfileContext> {\n  public ProfileContext() { }\n\n  public ProfileContext(int processId, int threadId, int processorNumber) {\n    ProcessId = processId;\n    ThreadId = threadId;\n    ProcessorNumber = processorNumber;\n  }\n\n  [ProtoMember(1)]\n  public int ProcessId { get; set; }\n  [ProtoMember(2)]\n  public int ThreadId { get; set; }\n  [ProtoMember(3)]\n  public int ProcessorNumber { get; set; }\n\n  public bool Equals(ProfileContext other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return ProcessId == other.ProcessId &&\n           ThreadId == other.ThreadId &&\n           ProcessorNumber == other.ProcessorNumber;\n  }\n\n  public static bool operator ==(ProfileContext left, ProfileContext right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileContext left, ProfileContext right) {\n    return !Equals(left, right);\n  }\n\n  public ProfileProcess GetProcess(RawProfileData profileData) {\n    return profileData.GetOrCreateProcess(ProcessId);\n  }\n\n  public ProfileThread GetThread(RawProfileData profileData) {\n    return profileData.FindThread(ThreadId);\n  }\n\n  public override bool Equals(object other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    if (other.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((ProfileContext)other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(ProcessId, ThreadId, ProcessorNumber);\n  }\n\n  public override string ToString() {\n    return $\"ProcessId: {ProcessId}, ThreadId: {ThreadId}, Processor: {ProcessorNumber}\";\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic sealed class ProfileImage : IEquatable<ProfileImage>, IComparable<ProfileImage> {\n  public ProfileImage() { }\n\n  public ProfileImage(string filePath, string originalFileName,\n                      long baseAddress, long defaultBaseAddress,\n                      int size, int timeStamp, long checksum) {\n    Size = size;\n    FilePath = filePath != null ? string.Intern(filePath) : null;\n    OriginalFileName = originalFileName != null ? string.Intern(originalFileName) : null;\n    BaseAddress = baseAddress;\n    DefaultBaseAddress = defaultBaseAddress;\n    TimeStamp = timeStamp;\n    Checksum = checksum;\n  }\n\n  [ProtoMember(1)]\n  public int Id { get; set; }\n  [ProtoMember(2)]\n  public int Size { get; set; }\n  [ProtoMember(3)]\n  public long BaseAddress { get; set; }\n  [ProtoMember(4)]\n  public long DefaultBaseAddress { get; set; }\n  [ProtoMember(5)]\n  public string FilePath { get; set; }\n  [ProtoMember(6)]\n  public string OriginalFileName { get; set; }\n  [ProtoMember(7)]\n  public int TimeStamp { get; set; }\n  [ProtoMember(8)]\n  public long Checksum { get; set; }\n  [ProtoMember(9)]\n  public string CompanyName { get; set; }\n  [ProtoMember(10)]\n  public string FileDescription { get; set; }\n  [ProtoMember(11)]\n  public string ProductName { get; set; }\n  public long BaseAddressEnd => BaseAddress + Size;\n  public string ModuleName => Utilities.Utils.TryGetFileName(FilePath);\n\n  /// <summary>\n  /// Returns true if this appears to be a Microsoft binary based on version info from trace.\n  /// Checks CompanyName, FileDescription, and ProductName fields.\n  /// </summary>\n  public bool IsMicrosoft =>\n    (!string.IsNullOrEmpty(CompanyName) && CompanyName.Contains(\"Microsoft\", StringComparison.OrdinalIgnoreCase)) ||\n    (!string.IsNullOrEmpty(FileDescription) && FileDescription.Contains(\"Microsoft\", StringComparison.OrdinalIgnoreCase)) ||\n    (!string.IsNullOrEmpty(ProductName) && ProductName.Contains(\"Microsoft\", StringComparison.OrdinalIgnoreCase));\n\n  public int CompareTo(ProfileImage other) {\n    if (BaseAddress < other.BaseAddress && BaseAddressEnd < other.BaseAddressEnd) {\n      return -1;\n    }\n\n    if (BaseAddress > other.BaseAddress && BaseAddressEnd > other.BaseAddressEnd) {\n      return 1;\n    }\n\n    return 0;\n  }\n\n  public bool Equals(ProfileImage other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Size == other.Size &&\n           FilePath == other.FilePath &&\n           Checksum == other.Checksum;\n  }\n\n  public static bool operator ==(ProfileImage left, ProfileImage right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileImage left, ProfileImage right) {\n    return !Equals(left, right);\n  }\n\n  public bool HasAddress(long ip) {\n    return ip >= BaseAddress && ip < BaseAddress + Size;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Size, FilePath, Checksum);\n  }\n\n  public override bool Equals(object other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    if (other.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((ProfileImage)other);\n  }\n\n  public int CompareTo(long value) {\n    if (value < BaseAddress) {\n      return 1;\n    }\n\n    if (value > BaseAddressEnd) {\n      return -1;\n    }\n\n    return 0;\n  }\n\n  public override string ToString() {\n    return\n      $\"ModuleName: {ModuleName}, FilePath: {FilePath}, Id: {Id}, Base: {BaseAddress:X}, DefaultBase: {DefaultBaseAddress:X} Size: {Size}, Checksum {Checksum:X}\";\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic sealed class ProfileProcess : IEquatable<ProfileProcess> {\n  public ProfileProcess() {\n    InitializeReferenceMembers();\n  }\n\n  public ProfileProcess(int processId, int parentId, string name,\n                        string imageFileName, string commandLine) : this() {\n    ProcessId = processId;\n    ParentId = parentId;\n    Name = name;\n    ImageFileName = imageFileName;\n    CommandLine = commandLine;\n  }\n\n  public ProfileProcess(int processId, string imageFileName = null) : this() {\n    ProcessId = processId;\n    ImageFileName = imageFileName;\n  }\n\n  [ProtoMember(1)]\n  public int ProcessId { get; set; }\n  [ProtoMember(2)]\n  public int ParentId { get; set; }\n  [ProtoMember(3)]\n  public string Name { get; set; }\n  [ProtoMember(4)]\n  public string ImageFileName { get; set; }\n  [ProtoMember(5)]\n  public string CommandLine { get; set; }\n  [ProtoMember(6)]\n  public List<int> ImageIds { get; set; }\n  [ProtoMember(7)]\n  public List<int> ThreadIds { get; set; }\n  [ProtoMember(8)]\n  public DateTime StartTime { get; set; }\n  [ProtoMember(9)]\n  public bool IsWow64 { get; set; } // True if 32-bit process on 64-bit OS (WoW64)\n\n  public bool Equals(ProfileProcess other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return ProcessId == other.ProcessId &&\n           Name == other.Name;\n  }\n\n  public static bool operator ==(ProfileProcess left, ProfileProcess right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileProcess left, ProfileProcess right) {\n    return !Equals(left, right);\n  }\n\n  public IEnumerable<ProfileImage> Images(RawProfileData profileData) {\n    foreach (int id in ImageIds) {\n      yield return profileData.FindImage(id);\n    }\n  }\n\n  public IEnumerable<ProfileThread> Threads(RawProfileData profileData) {\n    foreach (int id in ThreadIds) {\n      yield return profileData.FindThread(id);\n    }\n  }\n\n  public ProfileThread FindThread(int threadId, RawProfileData profileData) {\n    foreach (int id in ThreadIds) {\n      var thread = profileData.FindThread(id);\n\n      if (thread.ThreadId == threadId) {\n        return thread;\n      }\n    }\n\n    return null;\n  }\n\n  public void AddImage(int imageId) {\n    if (!ImageIds.Contains(imageId)) {\n      ImageIds.Add(imageId);\n    }\n  }\n\n  public void AddThread(int threadId) {\n    if (!ThreadIds.Contains(threadId)) {\n      ThreadIds.Add(threadId);\n    }\n  }\n\n  public override bool Equals(object other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    if (other.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((ProfileProcess)other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(ProcessId, Name);\n  }\n\n  public override string ToString() {\n    return\n      $\"{Name}, ImageFileName {ImageFileName}, ID: {ProcessId}, ParentID: {ParentId}, Images: {ImageIds.Count}, Threads: {ThreadIds.Count}\";\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    ImageIds ??= new List<int>();\n    ThreadIds ??= new List<int>();\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic sealed class ProfileThread : IEquatable<ProfileThread> {\n  public ProfileThread() { }\n\n  public ProfileThread(int threadId, int processId, string name) {\n    ThreadId = threadId;\n    ProcessId = processId;\n    Name = name;\n  }\n\n  [ProtoMember(1)]\n  public int ThreadId { get; set; }\n  [ProtoMember(2)]\n  public int ProcessId { get; set; }\n  [ProtoMember(3)]\n  public string Name { get; set; }\n  [ProtoMember(4)]\n  public long Win32StartAddr { get; set; }\n  public bool HasName => !string.IsNullOrEmpty(Name);\n\n  public bool Equals(ProfileThread other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return ThreadId == other.ThreadId && ProcessId == other.ProcessId;\n  }\n\n  public static bool operator ==(ProfileThread left, ProfileThread right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileThread left, ProfileThread right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object other) {\n    Debug.Assert(other != null);\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    if (other.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((ProfileThread)other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(ThreadId, ProcessId);\n  }\n\n  public override string ToString() {\n    return $\"{ThreadId}, ProcessId: {ProcessId}, Name: {Name}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Data/ResolvedProfileStack.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.ETW;\n\nnamespace ProfileExplorer.Core.Profile.Data;\n\n// Represents a resolved stack frame with details about the function and image it belongs to.\n// To reduce memory usage, the RVA field is stored in a derived class with the smallest possible size,\n// with the most common RVAs being values that fit in 16 or 32 bits.\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic class ResolvedProfileStackFrame {\n  public ResolvedProfileStackFrameDetails FrameDetails { get; set; }\n  public virtual long FrameRVA { get; set; }\n  public long FrameIP { get; set; }\n\n  public ResolvedProfileStackFrame(long frameRva, ResolvedProfileStackFrameDetails frameDetails) {\n    FrameRVA = frameRva;\n    FrameDetails = frameDetails;\n  }\n\n  protected ResolvedProfileStackFrame(ResolvedProfileStackFrameDetails frameDetails) {\n    FrameDetails = frameDetails;\n  }\n\n  public static ResolvedProfileStackFrame\n    CreateStackFrame(long frameRVA, ResolvedProfileStackFrameDetails frameDetails) {\n    // Pick a type of frame that has an RVA field just large enough\n    // to hold the value, this reduces memory usage since most RVAs don't need 64 bits.\n    if ((ulong)frameRVA <= 0xFFFF) {\n      return new ResolvedProfileStackFrame16((ushort)frameRVA, frameDetails);\n    }\n    else if ((ulong)frameRVA <= 0xFFFFFFFF) {\n      return new ResolvedProfileStackFrame32((uint)frameRVA, frameDetails);\n    }\n\n    return new ResolvedProfileStackFrame(frameRVA, frameDetails);\n  }\n\n  public bool IsUnknown => FrameDetails.IsUnknown;\n}\n\n// Stack frame with 16-bit RVA, used to reduce memory usage.\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic class ResolvedProfileStackFrame16 : ResolvedProfileStackFrame {\n  private ushort frameRva_;\n\n  public override long FrameRVA {\n    get => frameRva_;\n    set => frameRva_ = (ushort)value;\n  }\n\n  public ResolvedProfileStackFrame16(ushort frameRva, ResolvedProfileStackFrameDetails frameDetails) :\n    base(frameDetails) {\n    frameRva_ = frameRva;\n  }\n}\n\n// Stack frame with 32-bit RVA, used to reduce memory usage.\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic class ResolvedProfileStackFrame32 : ResolvedProfileStackFrame {\n  private uint frameRva_;\n\n  public override long FrameRVA {\n    get => frameRva_;\n    set => frameRva_ = (ushort)value;\n  }\n\n  public ResolvedProfileStackFrame32(uint frameRva, ResolvedProfileStackFrameDetails frameDetails) :\n    base(frameDetails) {\n    frameRva_ = frameRva;\n  }\n}\n\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic sealed class ResolvedProfileStack {\n  // Used to deduplicate stack frames for the same function running in the same context.\n  public static ConcurrentDictionary<ResolvedProfileStackFrameKey, ResolvedProfileStackFrameDetails> uniqueFrames_ =\n    new();\n\n  // Stack frames with the same IP have a unique instance shared among all call stacks.\n  public static ConcurrentDictionary<long, ResolvedProfileStackFrame> frameInstances_ = new();\n  public static ConcurrentDictionary<long, ResolvedProfileStackFrame> kernelFrameInstances_ = new();\n\n  /// <summary>\n  /// Clears all static frame caches. Must be called before processing a new trace\n  /// to prevent stale frame references from a previous session.\n  /// </summary>\n  public static void ResetCaches() {\n    uniqueFrames_.Clear();\n    frameInstances_.Clear();\n    kernelFrameInstances_.Clear();\n  }\n\n  public ResolvedProfileStack(int frameCount, ProfileContext context) {\n    StackFrames = new List<ResolvedProfileStackFrame>(frameCount);\n    Context = context;\n  }\n\n  public List<ResolvedProfileStackFrame> StackFrames { get; set; }\n  public ProfileContext Context { get; set; }\n  public int FrameCount => StackFrames.Count;\n\n  public void AddFrame(IRTextFunction function, long frameIP, long frameRVA, int frameIndex,\n                       ResolvedProfileStackFrameKey frameDetails, ProfileStack stack, int pointerSize) {\n    // Deduplicate the frame.\n    var uniqueFrame = uniqueFrames_.GetOrAdd(frameDetails, CreateResolvedProfileStackFrameDetails, function);\n    var rvaFrame = ResolvedProfileStackFrame.CreateStackFrame(frameRVA, uniqueFrame);\n    rvaFrame.FrameIP = frameIP;\n\n    // A stack frame IP can be called from both user and kernel mode code.\n    uniqueFrame.IsKernelCode = frameIndex < stack.UserModeTransitionIndex;\n\n    if (ETWEventProcessor.IsKernelAddress((ulong)frameIP, 8) && !uniqueFrame.IsKernelCode) {\n      uniqueFrame.IsKernelCode = true;\n    }\n\n    var existingFrame = uniqueFrame.IsKernelCode ?\n      kernelFrameInstances_.GetOrAdd(frameIP, rvaFrame) :\n      frameInstances_.GetOrAdd(frameIP, rvaFrame);\n    StackFrames.Add(existingFrame);\n  }\n\n  private static ResolvedProfileStackFrameDetails CreateResolvedProfileStackFrameDetails(\n    ResolvedProfileStackFrameKey frameDetails, IRTextFunction function) {\n    return new ResolvedProfileStackFrameDetails(frameDetails.DebugInfo, function, frameDetails.Image,\n                                                frameDetails.IsManagedCode);\n  }\n}\n\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic sealed class ResolvedProfileStackFrameDetails : IEquatable<ResolvedProfileStackFrameDetails> {\n  public static readonly ResolvedProfileStackFrameDetails Unknown = new();\n\n  public ResolvedProfileStackFrameDetails(FunctionDebugInfo debugInfo, IRTextFunction function,\n                                          ProfileImage image, bool isManagedCode) {\n    DebugInfo = debugInfo;\n    Function = function;\n    Image = image;\n    IsManagedCode = isManagedCode;\n  }\n\n  private ResolvedProfileStackFrameDetails() { }\n  public FunctionDebugInfo DebugInfo { get; set; }\n  public IRTextFunction Function { get; set; }\n  public ProfileImage Image { get; set; }\n  public bool IsKernelCode { get; set; }\n  public bool IsManagedCode { get; set; }\n  public bool IsUnknown => Image == null;\n\n  public static bool operator ==(ResolvedProfileStackFrameDetails left, ResolvedProfileStackFrameDetails right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ResolvedProfileStackFrameDetails left, ResolvedProfileStackFrameDetails right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is ResolvedProfileStackFrameDetails other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(DebugInfo, Image, IsKernelCode, IsManagedCode);\n  }\n\n  public bool Equals(ResolvedProfileStackFrameDetails other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Equals(DebugInfo, other.DebugInfo) &&\n           Equals(Image, other.Image) &&\n           IsKernelCode == other.IsKernelCode &&\n           IsManagedCode == other.IsManagedCode;\n  }\n}\n\n// Stack-allocated version of ResolvedProfileStackFrameDetails, used only\n// when adding a new stack frame to reduce GC pressure if it already exists.\n[StructLayout(LayoutKind.Sequential, Pack = 1)]\npublic struct ResolvedProfileStackFrameKey : IEquatable<ResolvedProfileStackFrameKey> {\n  public static readonly ResolvedProfileStackFrameKey Unknown = new();\n\n  public ResolvedProfileStackFrameKey(FunctionDebugInfo debugInfo,\n                                      ProfileImage image, bool isManagedCode) {\n    DebugInfo = debugInfo;\n    Image = image;\n    IsManagedCode = isManagedCode;\n  }\n\n  public ResolvedProfileStackFrameKey() { }\n  public FunctionDebugInfo DebugInfo;\n  public ProfileImage Image;\n  public bool IsManagedCode;\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is ResolvedProfileStackFrameKey other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(DebugInfo, Image);\n  }\n\n  public bool Equals(ResolvedProfileStackFrameKey other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Equals(DebugInfo, other.DebugInfo) &&\n           Equals(Image, other.Image);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/ETW/ETWEventProcessor.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\nusing Microsoft.Diagnostics.Tracing;\nusing Microsoft.Diagnostics.Tracing.Parsers;\nusing Microsoft.Diagnostics.Tracing.Parsers.Clr;\nusing Microsoft.Diagnostics.Tracing.Parsers.Kernel;\nusing Microsoft.Diagnostics.Tracing.Parsers.Symbol;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.ETW;\n\npublic sealed partial class ETWEventProcessor : IDisposable {\n  public const int KernelProcessId = 0;\n  private const double SamplingErrorMargin = 1.1; // 10% deviation from sampling interval allowed.\n  private const int SampleReportingInterval = 20000;\n  private const int MaxCoreCount = 4096;\n  private ETWTraceEventSource source_;\n  private string tracePath_;\n  private bool isRealTime_;\n  private bool handleDotNetEvents_;\n  private int acceptedProcessId_;\n  private bool handleChildProcesses_;\n  private ProfilerNamedPipeServer pipeServer_;\n  private List<int> childAcceptedProcessIds_;\n  private ProfileDataProviderOptions providerOptions_;\n  private bool samplingIntervalSet_;\n  private int samplingInterval100NS_;\n  private double samplingIntervalMS_;\n  private double samplingIntervalLimitMS_;\n\n  public ETWEventProcessor(ETWTraceEventSource source, ProfileDataProviderOptions providerOptions,\n                           bool isRealTime = true,\n                           int acceptedProcessId = 0, bool handleChildProcesses = false,\n                           bool handleDotNetEvents = false,\n                           ProfilerNamedPipeServer pipeServer = null) {\n    Trace.WriteLine($\"ETWEventProcessor: ProcId {acceptedProcessId}, handleDotNet: {handleDotNetEvents}\");\n    source_ = source;\n    providerOptions_ = providerOptions;\n    isRealTime_ = isRealTime;\n    acceptedProcessId_ = acceptedProcessId;\n    handleDotNetEvents_ = handleDotNetEvents;\n    handleChildProcesses_ = handleChildProcesses;\n    pipeServer_ = pipeServer;\n    childAcceptedProcessIds_ = new List<int>();\n  }\n\n  public ETWEventProcessor(string tracePath, ProfileDataProviderOptions providerOptions, int acceptedProcessId = 0) {\n    Debug.Assert(File.Exists(tracePath));\n    childAcceptedProcessIds_ = new List<int>();\n    source_ = new ETWTraceEventSource(tracePath);\n    tracePath_ = tracePath;\n    providerOptions_ = providerOptions;\n    acceptedProcessId_ = acceptedProcessId;\n  }\n\n  public void Dispose() {\n    source_?.Dispose();\n    source_ = null;\n  }\n\n  public static bool IsKernelAddress(ulong ip, int pointerSize) {\n    if (pointerSize == 4) {\n      return ip >= 0x80000000;\n    }\n\n    return ip >= 0xFFFF000000000000;\n  }\n\n  private unsafe static string ReadWideString(ReadOnlySpan<byte> data, int offset = 0) {\n    fixed (byte* dataPtr = data) {\n      var sb = new StringBuilder();\n\n      while (offset < data.Length - 1) {\n        byte first = dataPtr[offset];\n        byte second = dataPtr[offset + 1];\n\n        if (first == 0 && second == 0) {\n          break; // Found string null terminator.\n        }\n\n        sb.Append((char)(first | second << 8));\n        offset += 2;\n      }\n\n      return sb.ToString();\n    }\n  }\n\n  public List<ProcessSummary> BuildProcessSummary(ProcessListProgressHandler progressCallback,\n                                                  CancelableTask cancelableTask) {\n    // Default 1ms sampling interval.\n    UpdateSamplingInterval(SampleReportingInterval);\n\n    // Use a dummy process summary to collect all the process info.\n    var profile = new RawProfileData(tracePath_);\n    var summaryBuilder = new ProcessSummaryBuilder(profile);\n\n    int lastReportedSample = 0;\n    int lastProcessListSample = 0;\n    int nextProcessListSample = SampleReportingInterval * 10;\n    int sampleId = 0;\n    var lastProcessListReport = DateTime.UtcNow;\n\n    if (isRealTime_) {\n      profile.TraceInfo.ProfileStartTime = DateTime.Now;\n    }\n\n    ThreadPool.QueueUserWorkItem(state => {\n      progressCallback(new ProcessListProgress());\n    });\n\n    // Enable building of a thead ID -> process ID table\n    // that is used for circular traces to get the event process ID\n    // when it is not set in the trace (-1).\n    var kernel = new KernelTraceEventParser(source_, KernelTraceEventParser.ParserTrackingOptions.ThreadToProcess);\n\n    if (!isRealTime_) {\n      kernel.EventTraceHeader += data => {\n        // If the trace has a known file name it's unlikely\n        // to be using a circular buffer which needs the thread -> process ID table,\n        // stop reading the entire trace early.\n        if (data.LogFileName != \"[multiple files]\") {\n          kernel = ReopenTrace();\n        }\n      };\n\n      source_.Process();\n    }\n\n    ProfileProcess HandleProcessEvent(ProcessTraceData data) {\n      var profileProcess = profile.GetOrCreateProcess(data.ProcessID);\n      profileProcess.ProcessId = data.ProcessID;\n      profileProcess.ParentId = data.ParentID;\n\n      // Process name is empty, extract it from the image name.\n      profileProcess.Name = Utilities.Utils.TryGetFileNameWithoutExtension(data.ImageFileName);\n      profileProcess.ImageFileName = data.ImageFileName;\n      profileProcess.CommandLine = data.CommandLine;\n\n      // Capture WoW64 flag - indicates 32-bit process on 64-bit OS\n      // ProcessFlags.Wow64 = 2\n      profileProcess.IsWow64 = (data.Flags & ProcessFlags.Wow64) != 0;\n      return profileProcess;\n    }\n\n    kernel.ProcessStartGroup += data => {\n      HandleProcessEvent(data);\n    };\n\n    // Traces with circular buffers don't have ProcessStart events,\n    // extract this info from the ProcessDCStop events instead.\n    kernel.ProcessEndGroup += data => {\n      HandleProcessEvent(data);\n    };\n\n    kernel.PerfInfoSample += data => {\n      if (cancelableTask.IsCanceled) {\n        source_.StopProcessing();\n      }\n\n      // The thread ID -> process ID mapping is used internally.\n      if (data.ProcessID < 0) {\n        return;\n      }\n\n      sampleId++;\n      var sampleWeight = TimeSpan.FromMilliseconds(samplingIntervalMS_);\n      var sampleTime = TimeSpan.FromMilliseconds(data.TimeStampRelativeMSec);\n      summaryBuilder.AddSample(sampleWeight, sampleTime, data.ProcessID);\n\n      // Rebuild process list and update UI from time to time.\n      if (sampleId - lastReportedSample >= SampleReportingInterval) {\n        List<ProcessSummary> processList = null;\n        var currentTime = DateTime.UtcNow;\n\n        if (sampleId - lastProcessListSample >= nextProcessListSample &&\n            (currentTime - lastProcessListReport).TotalMilliseconds > 1000) {\n          // Rebuild the process list every few seconds.\n          processList = summaryBuilder.MakeSummaries();\n          lastProcessListSample = sampleId;\n          lastProcessListReport = currentTime;\n        }\n\n        if (progressCallback != null) {\n          int current = (int)data.TimeStampRelativeMSec; // Copy since data gets reused.\n          int total = (int)source_.SessionDuration.TotalMilliseconds;\n\n          progressCallback(new ProcessListProgress {\n            Total = total,\n            Current = current,\n            Processes = processList\n          });\n        }\n\n        lastReportedSample = sampleId;\n      }\n    };\n\n    // Go again over events and accumulate samples to build the process summary.\n    source_.Process();\n    profile.Dispose();\n    return summaryBuilder.MakeSummaries();\n  }\n\n  public RawProfileData ProcessEvents(ProfileLoadProgressHandler progressCallback,\n                                      CancelableTask cancelableTask,\n                                      bool isCircularBufferTrace = false) {\n    UpdateSamplingInterval(SampleReportingInterval);\n    ImageIDTraceData lastImageIdData = null;\n    ProfileImage lastProfileImage = null;\n    long lastProfileImageTime = 0;\n    int imageLoadEventCount = 0;\n    int imageLoadWithTimestampCount = 0;\n    int imageIdEventCount = 0;\n    int imageIdDbgEventCount = 0;\n\n    // Info used to associate a sample with the last call stack running on a thread.\n    var perThreadLastTimeMap = new Dictionary<int, double>();\n    var perThreadLastSampleMap = new Dictionary<int, int>();\n    var perThreadLastKernelStackMap = new Dictionary<int, (int StackId, long Timestamp)>();\n    var perContextLastSampleMap = new Dictionary<int, int>();\n    int lastReportedSample = 0;\n\n    // Info used to handle compressed stack event\n    var kernelStackKeyToPendingSamples = new Dictionary<ulong, List<int>>();\n    var userStackKeyToPendingSamples = new Dictionary<ulong, List<int>>();\n    var profile = new RawProfileData(tracePath_, handleDotNetEvents_);\n\n    // Enable building of a thead ID -> process ID table\n    // that is used for circular traces to get the event process ID\n    // when it is not set in the trace (-1).\n    var kernel = new KernelTraceEventParser(source_, KernelTraceEventParser.ParserTrackingOptions.ThreadToProcess);\n    UpdateProgress(progressCallback, ProfileLoadStage.TraceReading, 0, 0);\n\n    kernel.EventTraceHeader += data => {\n      profile.TraceInfo.CpuSpeed = data.CPUSpeed;\n      profile.TraceInfo.ProfileStartTime = data.StartTime;\n      profile.TraceInfo.ProfileEndTime = data.EndTime;\n\n      // If the trace has a known file name it's unlikely\n      // to be using a circular buffer which needs the thread -> process ID table,\n      // stop reading the entire trace early.\n      if (!isRealTime_ && data.LogFileName != \"[multiple files]\") {\n        kernel = ReopenTrace();\n      }\n    };\n\n    if (!isRealTime_) {\n      // Process the trace in case it's using circular buffers\n      // to build the thread -> process ID table.\n      source_.Process();\n    }\n\n    // For ETL file, the image timestamp (needed to find a binary on a symbol server)\n    // can show up in the ImageID event instead the usual Kernel.ImageGroup.\n    var symbolParser = new SymbolTraceEventParser(source_);\n\n    symbolParser.ImageID += data => {\n      // The image timestamp often is part of this event when reading an ETL file.\n      // A correct timestamp is needed to locate and download the image.\n      if (lastProfileImage != null &&\n          lastProfileImageTime == data.TimeStampQPC) {\n        lastProfileImage.OriginalFileName = data.OriginalFileName;\n\n        if (lastProfileImage.TimeStamp == 0) {\n          lastProfileImage.TimeStamp = data.TimeDateStamp;\n        }\n\n        // Prefer ImageSize from ImageID (PE header value from merge) over the kernel\n        // ImageGroup value (mapped view size which can have extra slack pages).\n        if (data.ImageSize > 0) {\n          lastProfileImage.Size = (int)data.ImageSize;\n        }\n      }\n      else {\n        // The ImageGroup event should show up later in the stream.\n        lastImageIdData = (ImageIDTraceData)data.Clone();\n        imageIdEventCount++;\n      }\n    };\n\n    symbolParser.ImageIDDbgID_RSDS += data => {\n      imageIdDbgEventCount++;\n      if (IsAcceptedProcess(data.ProcessID)) {\n#if DEBUG\n        Trace.WriteLine($\"PDB signature: imageBase: {(long)data.ImageBase}, file: {data.PdbFileName}, age: {data.Age}, guid: {data.GuidSig}, timestamp: {data.TimeStamp}\");\n#endif\n        var symbolFile = new SymbolFileDescriptor(data.PdbFileName, data.GuidSig, data.Age);\n        profile.AddDebugFileForImage(symbolFile, (long)data.ImageBase, data.ProcessID);\n      }\n    };\n\n    // FileVersion events contain version resource info including CompanyName\n    symbolParser.ImageIDFileVersion += data => {\n      // Find the image by timestamp and update its version info\n      var image = profile.FindImageByTimestamp(data.TimeDateStamp);\n      if (image != null) {\n        image.CompanyName = data.CompanyName;\n        image.FileDescription = data.FileDescription;\n        image.ProductName = data.ProductName;\n      }\n    };\n\n    // Start of main ETW event handlers.\n    kernel.ProcessStartGroup += data => {\n      var proc = new ProfileProcess(data.ProcessID, data.ParentID,\n                                    data.ProcessName, data.ImageFileName,\n                                    data.CommandLine);\n      profile.AddProcess(proc);\n#if DEBUG\n      Trace.WriteLine($\"ProcessStartGroup: {proc}\");\n#endif\n      // If parent is one of the accepted processes, accept the child too.\n      if (handleChildProcesses_ && IsAcceptedProcess(data.ParentID)) {\n        //Trace.WriteLine($\"=> Accept child {data.ProcessID} of {data.ParentID}\");\n        childAcceptedProcessIds_.Add(data.ProcessID);\n      }\n    };\n\n    // Traces with circular buffers don't have ProcessStart events,\n    // extract this info from the ProcessDCStop events instead.\n    kernel.ProcessGroup += data => {\n      var proc = profile.GetOrCreateProcess(data.ProcessID);\n      proc.ProcessId = data.ProcessID;\n      proc.ParentId = data.ParentID;\n      // Process name is empty, extract it from the image name.\n      proc.Name = Utilities.Utils.TryGetFileNameWithoutExtension(data.ImageFileName);\n      proc.ImageFileName = data.ImageFileName;\n      proc.CommandLine = data.CommandLine;\n\n#if DEBUG\n      Trace.WriteLine($\"ProcessGroup {data.Opcode}: {proc}\");\n#endif\n      // If parent is one of the accepted processes, accept the child too.\n      if (handleChildProcesses_ && IsAcceptedProcess(data.ParentID)) {\n        //Trace.WriteLine($\"=> Accept child {data.ProcessID} of {data.ParentID}\");\n        childAcceptedProcessIds_.Add(data.ProcessID);\n      }\n    };\n\n    kernel.ImageGroup += data => {\n      imageLoadEventCount++;\n      string originalName = null;\n      int timeStamp = data.TimeDateStamp;\n      int imageSize = data.ImageSize;\n      bool sawImageId = false;\n\n      if (lastImageIdData != null && lastImageIdData.TimeStampQPC == data.TimeStampQPC) {\n        // The ImageID event showed up earlier in the stream.\n        sawImageId = true;\n        originalName = lastImageIdData.OriginalFileName;\n\n        if (timeStamp == 0) {\n          timeStamp = lastImageIdData.TimeDateStamp;\n        }\n\n        // Prefer the ImageSize from the ImageID event over the kernel ImageGroup event.\n        // The kernel reports the mapped view size which can exceed the PE SizeOfImage\n        // by a few slack pages. The ImageID event's ImageSize comes from reading the\n        // actual PE file during trace merge, so it matches the PE header and is the\n        // correct value for symbol server lookups (TimeDateStamp+SizeOfImage key).\n        if (lastImageIdData.ImageSize > 0) {\n          imageSize = (int)lastImageIdData.ImageSize;\n        }\n      }\n      else if (isRealTime_) {\n        // In a capture session, the image is on the local machine,\n        // so just take the info out of the binary.\n        var imageInfo = PEBinaryInfoProvider.GetBinaryFileInfo(data.FileName);\n\n        if (imageInfo != null) {\n          timeStamp = imageInfo.TimeStamp;\n        }\n      }\n\n#if DEBUG\n      //Trace.WriteLine($\"ImageGroup: imageBase: {(long)data.ImageBase}, file: {data.FileName}, timestamp: {timeStamp}, checksum: {data.ImageChecksum}\");\n#endif\n\n      var image = new ProfileImage(data.FileName, originalName, (long)data.ImageBase,\n                                   (long)data.DefaultBase, imageSize,\n                                   timeStamp, data.ImageChecksum);\n      if (timeStamp != 0) {\n        imageLoadWithTimestampCount++;\n      }\n      int imageId = profile.AddImageToProcess(data.ProcessID, image);\n\n      if (!sawImageId) {\n        // The ImageID event may show up later in the stream.\n        lastProfileImage = profile.FindImage(imageId);\n        lastProfileImageTime = data.TimeStampQPC;\n      }\n      else {\n        lastProfileImage = null;\n      }\n    };\n\n    kernel.ThreadStartGroup += data => {\n      if (cancelableTask != null && cancelableTask.IsCanceled) {\n        source_.StopProcessing();\n      }\n\n      var thread = new ProfileThread(data.ThreadID, data.ProcessID, data.ThreadName);\n      thread.Win32StartAddr = (long)data.Win32StartAddr;\n      profile.AddThreadToProcess(data.ProcessID, thread);\n    };\n\n    kernel.ThreadSetName += data => {\n      if (IsAcceptedProcess(data.ProcessID)) {\n        var proc = profile.GetOrCreateProcess(data.ProcessID);\n        var thread = proc.FindThread(data.ThreadID, profile);\n\n        if (thread != null) {\n          thread.Name = data.ThreadName;\n        }\n      }\n    };\n\n    kernel.SystemConfigCPU += data => {\n      profile.TraceInfo.PointerSize = data.PointerSize;\n      profile.TraceInfo.CpuCount = data.NumberOfProcessors;\n      profile.TraceInfo.ComputerName = data.ComputerName;\n      profile.TraceInfo.DomainName = data.DomainName;\n      profile.TraceInfo.MemorySize = data.MemSize;\n    };\n\n    kernel.StackWalkStack += data => {\n      if (!IsAcceptedProcess(data.ProcessID)) {\n        return; // Ignore events from other processes.\n      }\n\n      bool isKernelStack = data.FrameCount > 0 &&\n                           IsKernelAddress(data.InstructionPointer(data.FrameCount - 1), data.PointerSize);\n      bool isKernelStackStart = data.FrameCount > 0 &&\n                                IsKernelAddress(data.InstructionPointer(0), data.PointerSize);\n#if DEBUG\n      // if (data.FrameCount > 0) {\n      //   Trace.WriteLine(\"-----------------------------------\");\n      //   Trace.WriteLine($\"Stack {data.InstructionPointer(0):X}, timestamp {data.EventTimeStampRelativeMSec}, TS {data.EventTimeStampQPC}, thread {data.ThreadID}\");\n      //   Trace.WriteLine($\"   kernel {isKernelStack}, kernelStart {isKernelStackStart}\");\n      // }\n\n      //Trace.WriteLine($\"User stack {data.InstructionPointer(0):X}, proc {data.ProcessID}, name {data.ProcessName}, TS {data.EventTimeStampQPC}\");\n#endif\n      var context = profile.RentTempContext(data.ProcessID, data.ThreadID, data.ProcessorNumber);\n      int contextId = profile.AddContext(context);\n      int frameCount = data.FrameCount;\n      ProfileStack kstack = null;\n\n      if (!isKernelStack && !isKernelStackStart) {\n        // This is a user mode stack, check if before it an associated\n        // kernel mode stack was recorded - if so, merge the two stacks.\n        ref var lastKernelStack =\n          ref CollectionsMarshal.GetValueRefOrAddDefault(perThreadLastKernelStackMap, data.ThreadID, out bool exists);\n\n        if (exists && lastKernelStack.StackId != 0 &&\n            lastKernelStack.Timestamp == data.EventTimeStampQPC) {\n#if DEBUG\n          //Trace.WriteLine($\"  Found matching KernelStack {lastKernelStack.StackId} at {lastKernelStack.Timestamp} on CPU {data.ProcessorNumber}\");\n#endif\n          // Append at the end of the kernel stack, marking a user -> kernel mode transition.\n          kstack = profile.FindStack(lastKernelStack.StackId);\n          int kstackFrameCount = kstack.FrameCount;\n          long[] frames = new long[kstack.FrameCount + data.FrameCount];\n          kstack.FramePointers.CopyTo(frames, 0);\n\n#if DEBUG\n          //Trace.WriteLine($\"    kernel mode end IP: {frames[kstackFrameCount - 1]:X}\");\n          //Trace.WriteLine($\"    user mode start IP: {data.InstructionPointer(0):X}\");\n#endif\n          for (int i = 0; i < frameCount; i++) {\n            frames[kstackFrameCount + i] = (long)data.InstructionPointer(i);\n          }\n\n          profile.ReplaceStackFramePointers(kstack, frames, context);\n          kstack.UserModeTransitionIndex = kstackFrameCount; // Frames after index are user mode.\n          lastKernelStack = (0, 0); // Clear the last kernel stack.\n        }\n      }\n\n      if (kstack == null) {\n        // This is either a kernel mode stack, or a user mode stack with no associated kernel mode stack.\n        var stack = profile.RentTemporaryStack(frameCount, contextId);\n\n        // Copy data from event to the temp. stack pointer array.\n        // Slightly faster to copy the entire array as a whole.\n        unsafe {\n          var ptr = (void*)((IntPtr)(void*)data.DataStart + 16);\n          int bytes = data.PointerSize * frameCount;\n          var span = new Span<byte>(ptr, bytes);\n\n          fixed (long* destPtr = stack.FramePointers) {\n            var destSpan = new Span<byte>(destPtr, bytes);\n            span.CopyTo(destSpan);\n          }\n        }\n\n        int stackId = profile.AddStack(stack, context);\n\n        // Try to associate with a previous sample from the same context.\n        int sampleId = perThreadLastSampleMap.GetValueOrDefault(data.ThreadID);\n        long frameIp = (long)data.InstructionPointer(0);\n\n        //? TODO: Check more than the last sample?\n        if (!profile.TrySetSampleStack(sampleId, stackId, frameIp, contextId)) {\n#if DEBUG\n          //Trace.WriteLine($\"Couldn't set stack {stackId} for sample {sampleId}\");\n#endif\n        }\n\n        if (isKernelStack) {\n#if DEBUG\n          //Trace.WriteLine($\"    register KernelStack {stackId} on CPU {data.ProcessorNumber}\");\n#endif\n          perThreadLastKernelStackMap[data.ThreadID] = (stackId, data.EventTimeStampQPC);\n        }\n      }\n\n      profile.ReturnContext(contextId);\n    };\n\n    kernel.StackWalkStackKeyKernel += data => {\n      if (!IsAcceptedProcess(data.ProcessID)) {\n        return; // Ignore events from other processes.\n      }\n\n      var context = profile.RentTempContext(data.ProcessID, data.ThreadID, data.ProcessorNumber);\n      int contextId = profile.AddContext(context);\n\n      int sampleId = perThreadLastSampleMap.GetValueOrDefault(data.ThreadID);\n      var triggeringEventTimestamp = TimeSpan.FromMilliseconds(data.EventTimeStampRelativeMSec);\n\n      // Check if the last sample on the core did not trigger this stack collection\n      if (sampleId == 0 || profile.Samples[sampleId - 1].Time != triggeringEventTimestamp) {\n        // Check if the last sample from the context did not trigger this stack collection\n        if (!perContextLastSampleMap.TryGetValue(contextId, out sampleId) ||\n            profile.Samples[sampleId - 1].Time != triggeringEventTimestamp) {\n          // We don't know what sample this stack belongs to so we won't collect it\n          return;\n        }\n      }\n\n      // Add the sample id to our list of pending samples for this stack key so when the definition comes along we can add the stack to our profile\n      if (kernelStackKeyToPendingSamples.TryGetValue(data.StackKey, out var pendingSamples)) {\n        pendingSamples.Add(sampleId);\n      }\n      else {\n        kernelStackKeyToPendingSamples.Add(data.StackKey, new List<int> {sampleId});\n      }\n\n      profile.ReturnContext(contextId);\n    };\n\n    kernel.StackWalkStackKeyUser += delegate(StackWalkRefTraceData data) {\n      if (!IsAcceptedProcess(data.ProcessID)) {\n        return; // Ignore events from other processes.\n      }\n\n      var context = profile.RentTempContext(data.ProcessID, data.ThreadID, data.ProcessorNumber);\n      int contextId = profile.AddContext(context);\n\n      int sampleId = perThreadLastSampleMap.GetValueOrDefault(data.ThreadID);\n      var triggeringEventTimestamp = TimeSpan.FromMilliseconds(data.EventTimeStampRelativeMSec);\n\n      // Check if the last sample on the core did not trigger this stack collection\n      if (sampleId == 0 || profile.Samples[sampleId - 1].Time != triggeringEventTimestamp) {\n        // Check if the last sample from the context did not trigger this stack collection\n        if (!perContextLastSampleMap.TryGetValue(contextId, out sampleId) ||\n            profile.Samples[sampleId - 1].Time != triggeringEventTimestamp) {\n          // We don't know what sample this stack belongs to so we won't collect it\n          return;\n        }\n      }\n\n      // Add the sample id to our list of pending samples for this stack key so when the definition comes along we can add the stack to our profile\n      if (userStackKeyToPendingSamples.TryGetValue(data.StackKey, out var pendingSamples)) {\n        pendingSamples.Add(sampleId);\n      }\n      else {\n        userStackKeyToPendingSamples.Add(data.StackKey, new List<int> {sampleId});\n      }\n\n      profile.ReturnContext(contextId);\n    };\n\n    kernel.AddCallbackForEvents(delegate(StackWalkDefTraceData data) {\n      if (data.FrameCount == 0 ||\n          userStackKeyToPendingSamples.Count == 0 && kernelStackKeyToPendingSamples.Count == 0) {\n        return; // Ignore data that won't fulfill any pending samples\n      }\n\n      bool isKernelAddress = IsKernelAddress(data.InstructionPointer(0), data.PointerSize);\n      List<int> pendingSamples;\n\n      if (isKernelAddress && !kernelStackKeyToPendingSamples.TryGetValue(data.StackKey, out pendingSamples)) {\n        return;\n      }\n\n      if (!userStackKeyToPendingSamples.TryGetValue(data.StackKey, out pendingSamples)) {\n        return;\n      }\n\n      foreach (int sampleId in pendingSamples) {\n        var sample = profile.Samples[sampleId - 1];\n\n        // Check if we already have part of the stack for this sample\n        if (sample.StackId == 0) {\n          var profileStack = profile.RentTemporaryStack(data.FrameCount, sample.ContextId);\n\n          // Copy data from event to the temp. stack pointer array.\n          // Slightly faster to copy the entire array as a whole.\n          unsafe {\n            var ptr = (void*)((IntPtr)(void*)data.DataStart + 8);\n            int bytes = data.PointerSize * data.FrameCount;\n            var span = new Span<byte>(ptr, bytes);\n\n            fixed (long* destPtr = profileStack.FramePointers) {\n              var destSpan = new Span<byte>(destPtr, bytes);\n              span.CopyTo(destSpan);\n            }\n          }\n\n          int stackId = profile.AddStack(profileStack, profile.FindContext(sample.ContextId));\n          profile.SetSampleStack(sampleId, stackId, sample.ContextId);\n        }\n        else if (isKernelAddress) {\n          var profileStack = profile.FindStack(sample.StackId);\n          int ustackFrameCount = profileStack.FrameCount;\n          int kstackFrameCount = data.FrameCount;\n          long[] frames = new long[kstackFrameCount + ustackFrameCount];\n          profileStack.FramePointers.CopyTo(frames, kstackFrameCount);\n\n          for (int i = 0; i < kstackFrameCount; i++) {\n            frames[i] = (long)data.InstructionPointer(i);\n          }\n\n          var context = profile.FindContext(sample.ContextId);\n          profile.ReplaceStackFramePointers(profileStack, frames, context);\n          profileStack.UserModeTransitionIndex = kstackFrameCount; // Frames after kernel stack are user mode.\n        }\n        else {\n          var profileStack = profile.FindStack(sample.StackId);\n          int ustackFrameCount = data.FrameCount;\n          int kstackFrameCount = profileStack.FrameCount;\n          long[] frames = new long[kstackFrameCount + ustackFrameCount];\n          profileStack.FramePointers.CopyTo(frames, 0);\n\n          for (int i = 0; i < ustackFrameCount; i++) {\n            frames[i + kstackFrameCount] = (long)data.InstructionPointer(i);\n          }\n\n          var context = profile.FindContext(sample.ContextId);\n          profile.ReplaceStackFramePointers(profileStack, frames, context);\n          profileStack.UserModeTransitionIndex = kstackFrameCount; // Frames after kernel stack are user mode.\n        }\n      }\n\n      if (isKernelAddress) {\n        kernelStackKeyToPendingSamples.Remove(data.StackKey);\n      }\n      else {\n        userStackKeyToPendingSamples.Remove(data.StackKey);\n      }\n    });\n\n    void HandlePerfInfoCollection(SampledProfileIntervalTraceData data, RawProfileData profile) {\n      if (data.SampleSource == 0) {\n        UpdateSamplingInterval(data.NewInterval);\n        profile.TraceInfo.SamplingInterval = TimeSpan.FromMilliseconds(samplingIntervalMS_);\n        samplingIntervalSet_ = true;\n      }\n      else {\n        // The description of a PMC event.\n        var dataSpan = data.EventData().AsSpan();\n        string name = ReadWideString(dataSpan, 12);\n        var counterInfo = new PerformanceCounter(data.SampleSource, name, data.NewInterval);\n        profile.AddPerformanceCounter(counterInfo);\n      }\n    }\n\n    kernel.PerfInfoCollectionStart +=\n      data => HandlePerfInfoCollection(\n        data, profile); // I haven't really seen us recieve this event - was it just a mistake?\n\n    kernel.PerfInfoCollectionEnd += data => HandlePerfInfoCollection(data, profile);\n\n    kernel.PerfInfoSetInterval += data => {\n      if (data.SampleSource == 0 && !samplingIntervalSet_) {\n        UpdateSamplingInterval(data.OldInterval);\n        profile.TraceInfo.SamplingInterval = TimeSpan.FromMilliseconds(samplingIntervalMS_);\n        samplingIntervalSet_ = true;\n      }\n    };\n\n    kernel.PerfInfoSample += data => {\n      if (!IsAcceptedProcess(data.ProcessID)) {\n        return; // Ignore events from other processes.\n      }\n\n      // If the time since the last sample is greater than the sampling interval + some error margin,\n      // it likely means that some samples were lost, use the sampling interval as the weight.\n      int cpu = data.ProcessorNumber;\n      double timestamp = data.TimeStampRelativeMSec;\n\n      ref double perThreadLastTime =\n        ref CollectionsMarshal.GetValueRefOrAddDefault(perThreadLastTimeMap, data.ThreadID, out bool exists);\n      double weight = timestamp - perThreadLastTime;\n\n      if (weight > samplingIntervalLimitMS_) {\n        weight = samplingIntervalMS_;\n      }\n\n      perThreadLastTime = timestamp;\n\n      // Skip unknown process.\n      if (data.ProcessID < 0) {\n        return;\n      }\n\n      // Skip idle thread on non-kernel code.\n      bool isKernelCode = data.ExecutingDPC || data.ExecutingISR;\n\n      if (data.ThreadID == 0 && !isKernelCode) {\n        return;\n      }\n\n      // Save sample.\n      var context = profile.RentTempContext(data.ProcessID, data.ThreadID, cpu);\n      int contextId = profile.AddContext(context);\n\n      var sample = new ProfileSample((long)data.InstructionPointer,\n                                     TimeSpan.FromMilliseconds(timestamp),\n                                     TimeSpan.FromMilliseconds(weight),\n                                     isKernelCode, contextId);\n      int sampleId = profile.AddSample(sample);\n      profile.ReturnContext(contextId);\n      // Trace.WriteLine($\"Sample {sampleId}, timestamp {timestamp}, IP {data.InstructionPointer:X} kernel {isKernelCode}, CPU {cpu}, thread {data.ThreadID}\");\n\n      // Remember the sample, to be matched later with a call stack.\n      perThreadLastSampleMap[data.ThreadID] = sampleId;\n      perContextLastSampleMap[contextId] = sampleId;\n\n      // Report progress.\n      if (progressCallback != null && sampleId - lastReportedSample >= SampleReportingInterval) {\n        if (cancelableTask != null && cancelableTask.IsCanceled) {\n          source_.StopProcessing();\n        }\n\n        if (!isRealTime_) {\n          int current = (int)data.TimeStampRelativeMSec; // Copy since data gets reused.\n          int total = (int)source_.SessionDuration.TotalMilliseconds;\n          UpdateProgress(progressCallback, ProfileLoadStage.TraceReading, total, current);\n        }\n        else {\n          UpdateProgress(progressCallback, ProfileLoadStage.TraceReading,\n                         sampleId, sampleId);\n        }\n\n        lastReportedSample = sampleId;\n      }\n    };\n\n    if (providerOptions_.IncludePerformanceCounters) {\n      Trace.WriteLine(\"Enable PMC event handling\");\n\n      kernel.PerfInfoPMCSample += data => {\n        if (!IsAcceptedProcess(data.ProcessID)) {\n          return; // Ignore events from other processes.\n        }\n\n        var context = profile.RentTempContext(data.ProcessID, data.ThreadID, data.ProcessorNumber);\n        int contextId = profile.AddContext(context);\n        double timestamp = data.TimeStampRelativeMSec;\n\n        var counterEvent = new PerformanceCounterEvent((long)data.InstructionPointer,\n                                                       TimeSpan.FromMilliseconds(timestamp),\n                                                       contextId, (short)data.ProfileSource);\n        profile.AddPerformanceCounterEvent(counterEvent);\n        profile.ReturnContext(contextId);\n      };\n    }\n\n    if (handleDotNetEvents_) {\n      ProcessDotNetEvents(profile, cancelableTask);\n    }\n\n    // Go over all ETW events, which will call the registered handlers.\n    try {\n      Trace.WriteLine(\"Start processing ETW events\");\n      var sw = Stopwatch.StartNew();\n\n      if (isRealTime_) {\n        profile.TraceInfo.ProfileStartTime = DateTime.Now;\n      }\n\n      UpdateProgress(progressCallback, ProfileLoadStage.TraceReading, 0, 0);\n      source_.Process();\n\n      if (isRealTime_) {\n        profile.TraceInfo.ProfileEndTime = DateTime.Now;\n      }\n\n      sw.Stop();\n      Trace.WriteLine($\"Done processing ETW events: {sw}, {sw.ElapsedMilliseconds} ms\");\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to process ETW events: {ex.Message}\");\n    }\n\n    Trace.WriteLine(\"ETW events summary\");\n    Trace.WriteLine($\"  - samples: {profile.Samples.Count}\");\n    Trace.WriteLine($\"  - pmc events: {profile.PerformanceCountersEvents?.Count}\");\n    Trace.WriteLine($\"  - ImageLoad events: {imageLoadEventCount} ({imageLoadWithTimestampCount} with valid timestamp)\");\n    Trace.WriteLine($\"  - ImageID events: {imageIdEventCount}\");\n    Trace.WriteLine($\"  - ImageID DbgID (RSDS) events: {imageIdDbgEventCount}\");\n\n    // Store event counts for later use (symbol loading warnings)\n    profile.TraceInfo.ImageLoadEventCount = imageLoadEventCount;\n    profile.TraceInfo.ImageLoadWithTimestampCount = imageLoadWithTimestampCount;\n    profile.TraceInfo.ImageIdEventCount = imageIdEventCount;\n    profile.TraceInfo.ImageIdDbgEventCount = imageIdDbgEventCount;\n\n    // Log summary to diagnostic log\n    DiagnosticLogger.LogInfo($\"[TraceLoad] Event counts: ImageLoad={imageLoadEventCount} ({imageLoadWithTimestampCount} with timestamp), \" +\n                             $\"ImageID={imageIdEventCount}, ImageID_DbgID={imageIdDbgEventCount}\");\n\n    // Warn if trace lacks ImageID events - symbol resolution will likely fail\n    if (imageIdDbgEventCount == 0) {\n      DiagnosticLogger.LogWarning(\"[TraceLoad] Trace has no ImageID DbgID (RSDS) events - PDB GUID/Age info is missing. \" +\n                                  \"Symbol resolution will likely fail. Consider re-capturing with ImageID events enabled.\");\n    }\n    else if (imageIdDbgEventCount < profile.Images.Count / 2) {\n      DiagnosticLogger.LogWarning($\"[TraceLoad] Trace has only {imageIdDbgEventCount} ImageID DbgID events for {profile.Images.Count} images. \" +\n                                  \"Some symbols may not resolve correctly.\");\n    }\n\n    // Free temporary data structures.\n    profile.LoadingCompleted();\n\n    if (handleDotNetEvents_) {\n      profile.ManagedLoadingCompleted();\n    }\n\n#if DEBUG\n    profile.PrintAllProcesses();\n#endif\n\n#if false\n        GC.Collect();\n        GC.WaitForPendingFinalizers();\n        long memory2 = GC.GetTotalMemory(true);\n        Trace.WriteLine($\"Memory diff: {(memory2 - memory) / (1024 * 1024):F2}, MB\");\n        Trace.Flush();\n#endif\n    return profile;\n  }\n\n  private KernelTraceEventParser ReopenTrace() {\n    // Stop processing the current trace, close it\n    // and create a new one with kernel event provider.\n    source_.StopProcessing();\n    source_.Dispose();\n    source_ = new ETWTraceEventSource(tracePath_);\n    return new KernelTraceEventParser(source_, KernelTraceEventParser.ParserTrackingOptions.ThreadToProcess);\n  }\n\n  private void UpdateSamplingInterval(int value) {\n    samplingInterval100NS_ = value;\n    samplingIntervalMS_ = (double)samplingInterval100NS_ / 10000;\n    samplingIntervalLimitMS_ = samplingIntervalMS_ * SamplingErrorMargin;\n  }\n\n  private void UpdateProgress(ProfileLoadProgressHandler callback, ProfileLoadStage stage,\n                              int total, int current, string optional = null) {\n    if (callback != null) {\n      callback(new ProfileLoadProgress(stage) {\n        Total = total, Current = current,\n        Optional = optional\n      });\n    }\n  }\n\n  private string ToOptimizationLevel(OptimizationTier tier) {\n    return tier switch {\n      OptimizationTier.MinOptJitted   => \"MinOptJitted\",\n      OptimizationTier.Optimized      => \"Optimized\",\n      OptimizationTier.OptimizedTier1 => \"OptimizedTier1\",\n      OptimizationTier.PreJIT         => \"PreJIT\",\n      OptimizationTier.QuickJitted    => \"QuickJitted\",\n      OptimizationTier.ReadyToRun     => \"ReadyToRun\",\n      _                               => null\n    };\n  }\n\n  private bool IsAcceptedProcess(int processID) {\n    if (acceptedProcessId_ == 0) {\n      return true; // No filtering.\n    }\n\n    if (processID == acceptedProcessId_ ||\n        processID == 0) { // Always accept the System process.\n      return true;\n    }\n\n    return childAcceptedProcessIds_.Contains(processID);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/ETW/ETWEventProcessorManaged.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reflection.PortableExecutable;\nusing System.Threading.Tasks;\nusing Microsoft.Diagnostics.Tracing.Parsers.Clr;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.ETW;\n\npublic sealed partial class ETWEventProcessor {\n  private void ProcessDotNetEvents(RawProfileData profile, CancelableTask cancelableTask) {\n    if (pipeServer_ != null) {\n      pipeServer_.FunctionCodeReceived += (functionId, rejitId, processId, address, codeSize, codeBytes) => {\n#if DEBUG\n        Trace.WriteLine($\"PipeServer_OnFunctionCodeReceived: {functionId}, {rejitId}, {address}, {codeSize}\");\n#endif\n        profile.AddManagedMethodCode(functionId, rejitId, processId, address, codeSize, codeBytes);\n      };\n\n      pipeServer_.FunctionCallTargetsReceived += (functionId, rejitId, processId, address, name) => {\n#if DEBUG\n        Trace.WriteLine($\"PipeServer_OnFunctionCallTargetsReceived: {functionId}, {rejitId}, {address}, {name}\");\n#endif\n        profile.AddManagedMethodCallTarget(functionId, rejitId, processId, address, name);\n      };\n\n      Task.Run(() => {\n        // Receive messages from the pipe client with the managed method code.\n        Trace.WriteLine(\"Start .NET pipe server communication\");\n        pipeServer_.StartReceiving(cancelableTask.Token);\n      });\n    }\n\n    //source_.Clr.GCStart += data => {\n    //    Trace.WriteLine($\"GCStart: {data}\");\n    //    double timestamp = data.TimeStampRelativeMSec;\n    //    var counterEvent = new PerformanceCounterEvent(0,\n    //        TimeSpan.FromMilliseconds(timestamp),\n    //        1, (short)(1));\n    //    profile.AddPerformanceCounterEvent(counterEvent);\n    //};\n\n    //source_.Clr.GCStop += data => {\n    //    Trace.WriteLine($\"GCStop: {data}\");\n    //    double timestamp = data.TimeStampRelativeMSec;\n    //    var counterEvent = new PerformanceCounterEvent(0,\n    //        TimeSpan.FromMilliseconds(timestamp),\n    //        1, (short)(0));\n    //    profile.AddPerformanceCounterEvent(counterEvent);\n    //};\n\n    source_.Clr.LoaderModuleLoad += data => {\n      ProcessLoaderModuleLoad(data, profile);\n    };\n\n    source_.Clr.MethodLoadVerbose += data => {\n      ProcessDotNetMethodLoad(data, profile, cancelableTask);\n    };\n\n    source_.Clr.MethodILToNativeMap += data => {\n      ProcessDotNetILToNativeMap(data, profile);\n    };\n\n    // Needed when attaching to a running process to get info\n    // about modules/methods loaded before the ETW session started.\n    var rundownParser = new ClrRundownTraceEventParser(source_);\n\n    rundownParser.LoaderModuleDCStart += data => {\n      ProcessLoaderModuleLoad(data, profile, true);\n    };\n\n    //rundownParser.LoaderModuleDCStop += data => {\n    //    ProcessLoaderModuleLoad(data, profile, true);\n    //};\n\n    rundownParser.MethodDCStartVerbose += data => {\n      ProcessDotNetMethodLoad(data, profile, cancelableTask, true);\n    };\n\n    //rundownParser.MethodDCStopVerbose += data => {\n    //    ProcessDotNetMethodLoad(data, profile, true);\n    //};\n\n    rundownParser.MethodILToNativeMapDCStart += data => {\n      ProcessDotNetILToNativeMap(data, profile, true);\n    };\n\n    //rundownParser.MethodILToNativeMapDCStop += data => {\n    //    ProcessDotNetILToNativeMap(data, profile, true);\n    //};\n  }\n\n  private void ProcessLoaderModuleLoad(ModuleLoadUnloadTraceData data, RawProfileData profile, bool rundown = false) {\n    if (!IsAcceptedProcess(data.ProcessID)) {\n      return; // Ignore events from other processes.\n    }\n\n#if DEBUG\n    Trace.WriteLine($\"=> R-{rundown} Managed module {data.ModuleID}, {data.ModuleILFileName} in proc {data.ProcessID}\");\n#endif\n    var runtimeArch = Machine.Amd64;\n    string moduleName = data.ModuleILFileName;\n    var moduleDebugInfo =\n      profile.GetOrAddManagedModuleDebugInfo(data.ProcessID, moduleName, data.ModuleID, runtimeArch);\n\n    if (moduleDebugInfo != null) {\n      moduleDebugInfo.ManagedSymbolFile = FromModuleLoad(data);\n#if DEBUG\n      Trace.WriteLine($\"Set managed symbol {moduleDebugInfo.ManagedSymbolFile}\");\n#endif\n    }\n  }\n\n  private void ProcessDotNetILToNativeMap(MethodILToNativeMapTraceData data, RawProfileData profile,\n                                          bool rundown = false) {\n    if (!IsAcceptedProcess(data.ProcessID)) {\n      return; // Ignore events from other processes.\n    }\n\n#if DEBUG\n    Trace.WriteLine(\n      $\"=> R-{rundown} ILMap token: {data.MethodID}, entries: {data.CountOfMapEntries}, ProcessID: {data.ProcessID}, name: {data.ProcessName}\");\n#endif\n    var methodMapping = profile.FindManagedMethod(data.MethodID, data.ReJITID, data.ProcessID);\n\n    if (methodMapping == null) {\n      return;\n    }\n\n    var ilOffsets = new List<(int ILOffset, int NativeOffset)>(data.CountOfMapEntries);\n\n    for (int i = 0; i < data.CountOfMapEntries; i++) {\n      ilOffsets.Add((data.ILOffset(i), data.NativeOffset(i)));\n    }\n\n    var (debugInfo, _) = profile.GetModuleDebugInfo(data.ProcessID, methodMapping.ModuleId);\n\n    if (debugInfo != null) {\n      debugInfo.AddMethodILToNativeMap(methodMapping.FunctionDebugInfo, ilOffsets);\n    }\n  }\n\n  private void ProcessDotNetMethodLoad(MethodLoadUnloadVerboseTraceData data, RawProfileData profile,\n                                       CancelableTask cancelableTask, bool rundown = false) {\n    if (!IsAcceptedProcess(data.ProcessID)) {\n      return; // Ignore events from other processes.\n    }\n\n    if (rundown) {\n      if (pipeServer_ != null && !cancelableTask.IsCanceled) {\n#if DEBUG\n        Trace.WriteLine($\"Request {data.MethodStartAddress:x}: {data.MethodSignature}\");\n#endif\n        if (!pipeServer_.RequestFunctionCode((long)data.MethodStartAddress, data.MethodID, (int)data.ReJITID,\n                                             data.ProcessID)) {\n          Trace.WriteLine($\"Failed to request rundown method {data.MethodStartAddress:x}\");\n        }\n      }\n    }\n\n#if DEBUG\n    Trace.WriteLine(\n      $\"=> R-{rundown} Load at {data.MethodStartAddress}: {data.MethodNamespace}.{data.MethodName}, {data.MethodSignature},ProcessID: {data.ProcessID}, name: {data.ProcessName}\");\n    Trace.WriteLine(\n      $\"     id/token: {data.MethodID}/{data.MethodToken}, opts: {data.OptimizationTier}, size: {data.MethodSize}\");\n#endif\n\n    string funcName = $\"{data.MethodNamespace}.{data.MethodName}\";\n    var funcInfo = new FunctionDebugInfo(funcName, (long)data.MethodStartAddress, (uint)data.MethodSize,\n                                         (short)data.OptimizationTier, data.MethodToken, (short)data.ReJITID);\n    profile.AddManagedMethodMapping(data.ModuleID, data.MethodID, data.ReJITID, funcInfo,\n                                    (long)data.MethodStartAddress, data.MethodSize, data.ProcessID);\n  }\n\n  private SymbolFileDescriptor FromModuleLoad(ModuleLoadUnloadTraceData data) {\n    return new SymbolFileDescriptor(data.ManagedPdbBuildPath, data.ManagedPdbSignature, data.ManagedPdbAge);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/ETW/ETWProfileDataProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reflection.PortableExecutable;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.ETW;\n\n// Event delegates for session callbacks\npublic delegate Task SetupNewSessionHandler(ILoadedDocument mainDocument, List<ILoadedDocument> otherDocuments, ProfileData profileData);\npublic delegate Task StartNewSessionHandler(string sessionName, SessionKind sessionKind, ICompilerInfoProvider compilerInfo);\n\npublic sealed class ETWProfileDataProvider : IProfileDataProvider, IDisposable {\n  private const int IMAGE_LOCK_COUNT = 64;\n  private const int PROGRESS_UPDATE_INTERVAL = 2048; // Progress UI update after pow2 N samples.\n#if DEBUG\n  // For collecting statistics on stack frame resolution.\n  private volatile static int UnresolvedStackCount;\n  private volatile static int ResolvedStackCount;\n  private Dictionary<ProfileImage, Dictionary<long, (FunctionDebugInfo Info, int SampleCount)>>\n    perModuleSampleStatsMap_;\n#endif\n\n  // Per-thread caching of the previously handled image\n  // and module builder, with hotspots many samples have the same.\n  [ThreadStatic]\n  private static ProfileImage prevImage_;\n  [ThreadStatic]\n  private static ProfileModuleBuilder prevProfileModuleBuilder_;\n  private ProfileDataProviderOptions options_;\n  private ProfileDataReport report_;\n  private ICompilerInfoProvider compilerInfoProvider_;\n  private ProfileData profileData_;\n  private Machine defaultArchitecture_ = Machine.Amd64; // Default to x64, updated from trace PointerSize\n  private object lockObject_;\n  private object[] imageLocks_;\n  private ConcurrentDictionary<int, ProfileModuleBuilder> imageModuleMap_;\n  private HashSet<ProfileImage> rejectedDebugModules_;\n  private int currentSampleIndex_;\n\n  // Synthetic module for samples whose instruction pointers don't map to any\n  // known module loaded in the process. This can be dynamically generated code\n  // (e.g., LUA JIT, Java JIT), code from unloaded modules, or other unmapped regions.\n  private const string UnknownModuleName = \"[Unknown Module]\";\n\n  // Synthetic IP layout: [base bit48] [PID 16-bit] [TID 32-bit].\n  // Chosen arbitrarily, just with constraint of being between \n  // max user VA and IsKernelAddress threshold. See `IsKernelAddress` \n  // in ETWEventProcessor.cs and https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/virtual-address-spaces\n  private const ulong SyntheticIpBase = 0x0001_0000_0000_0000UL;\n\n// ProcessId (and ThreadId) is a DWORD (32-bit unsigned)\n// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getprocessid\n// though with only 16 bits here, as a full 32-bit PID << 32 (in `MakeSyntheticIp`) \n// can flow into kernel addr range.\n  private const ulong ProcessIdMask   = 0xFFFFUL;\n\n  private sealed class UnknownModuleState(ProfileImage image, ProfileData profileData, int processId) {\n    private readonly object lock_ = new();\n    private readonly ConcurrentDictionary<int, (IRTextFunction Function, FunctionDebugInfo DebugInfo)> threadFunctions_ = new();\n    private readonly ProfileData profileData_ = profileData;\n    private readonly int processId_ = processId;\n    private readonly ILoadedDocument document_ = LoadedDocument.CreateDummyDocument(UnknownModuleName);\n\n    public ProfileImage Image { get; } = image;\n    public ILoadedDocument Document => document_;\n\n    /// <summary>\n    /// Gets or creates a synthetic function for samples with unmapped IPs\n    /// on a specific thread.\n    /// </summary>\n    public (IRTextFunction Function, FunctionDebugInfo DebugInfo) GetOrCreateThreadFunction(int threadId) {\n      // Lock-free fast path for threads we've already seen\n      (IRTextFunction Function, FunctionDebugInfo DebugInfo) existing;\n      if (threadFunctions_.TryGetValue(threadId, out existing)) {\n        return existing;\n      }\n\n      // Serialize creation to ensure AddDummyFunction is called exactly once per threadId\n      lock (lock_) {\n        // Check again, in case another thread *just* created the entry since we checked previously\n        if (threadFunctions_.TryGetValue(threadId, out existing)) {\n          return existing;\n        }\n\n        ProfileThread thread = profileData_.FindThread(threadId);\n        string startModule = ResolveStartModule(thread);\n        string funcName = FormatFuncName(threadId, thread?.Name, startModule);\n\n        // RVA = threadId so FunctionDebugInfo.IsUnknown (RVA==0 && Size==0) is false.\n        // Id = processId_ so FunctionDebugInfo.Equals differentiates across processes\n        // (Id is normally MethodToken for managed code, repurposed here for dedup keying).\n        FunctionDebugInfo debugInfo = new FunctionDebugInfo(funcName, threadId, 1, id: processId_);\n        IRTextFunction func = document_.AddDummyFunction(funcName);\n        (IRTextFunction func, FunctionDebugInfo debugInfo) result = (func, debugInfo);\n        threadFunctions_[threadId] = result;\n        return result;\n      }\n    }\n\n    /// <summary>\n    /// Resolves the module containing the thread's Win32 start address.\n    /// </summary>\n    private string ResolveStartModule(ProfileThread thread) {\n      if (thread == null || thread.Win32StartAddr == 0) {\n        return null;\n      }\n\n      foreach (var module in profileData_.Modules.Values) {\n        if (module.HasAddress(thread.Win32StartAddr)) {\n          return module.ModuleName;\n        }\n      }\n\n      return null;\n    }\n\n    /// <summary>\n    /// Formats function as [JIT ThreadName (ThreadId) StartModule].\n    /// </summary>\n    private static string FormatFuncName(int threadId, string threadName, string startModule) {\n      // Examples: [JIT WorkerThread (1234) lua51.dll], [JIT Thread 1234]\n      if (!string.IsNullOrEmpty(threadName)) {\n        return string.IsNullOrEmpty(startModule)\n          ? $\"[JIT {threadName} ({threadId})]\"\n          : $\"[JIT {threadName} ({threadId}) {startModule}]\";\n      }\n\n      return string.IsNullOrEmpty(startModule)\n        ? $\"[JIT Thread {threadId}]\"\n        : $\"[JIT Thread {threadId} {startModule}]\";\n    }\n  }\n\n  private readonly ConcurrentDictionary<int, UnknownModuleState> unknownModules_ = new();\n\n  // Events for session lifecycle callbacks\n  public event SetupNewSessionHandler SetupNewSessionRequested;\n  public event StartNewSessionHandler StartNewSessionRequested;\n\n  public ETWProfileDataProvider() {\n    profileData_ = new ProfileData();\n\n    // Data structs used for module loading.\n    lockObject_ = new object();\n    imageModuleMap_ = new ConcurrentDictionary<int, ProfileModuleBuilder>();\n    rejectedDebugModules_ = new HashSet<ProfileImage>();\n    imageLocks_ = new object[IMAGE_LOCK_COUNT];\n\n    for (int i = 0; i < imageLocks_.Length; i++) {\n      imageLocks_[i] = new object();\n    }\n\n    // Clear static caches from any previous trace load to prevent\n    // stale frame/function references leaking across sessions.\n    ResolvedProfileStack.ResetCaches();\n  }\n\n  public static async Task<List<ProcessSummary>>\n    FindTraceProcesses(string tracePath, ProfileDataProviderOptions options,\n                       ProcessListProgressHandler progressCallback,\n                       CancelableTask cancelableTask) {\n    try {\n      using var eventProcessor = new ETWEventProcessor(tracePath, options);\n      return await Task.Run(() => eventProcessor.BuildProcessSummary(progressCallback, cancelableTask));\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to open ETL file {tracePath}: {ex.Message}\");\n      return null;\n    }\n  }\n\n  public void Dispose() {\n    // NOTE: Do NOT dispose ProfileModuleBuilder instances here!\n    // They need to remain alive for dynamic on-demand binary loading\n    // (e.g., when user views assembly after trace is loaded).\n    // ProfileModuleBuilder instances should live as long as the profile data is being used.\n  }\n\n  public async Task<ProfileData> LoadTraceAsync(string tracePath, List<int> processIds,\n                                                ProfileDataProviderOptions options,\n                                                SymbolFileSourceSettings symbolSettings,\n                                                ProfileDataReport report,\n                                                ProfileLoadProgressHandler progressCallback,\n                                                CancelableTask cancelableTask) {\n    Trace.WriteLine($\"LoadTraceAsync(file): Starting trace loading from file: {tracePath}\");\n    Trace.WriteLine($\"LoadTraceAsync(file): Process IDs: [{string.Join(\", \", processIds)}]\");\n    \n    try {\n      UpdateProgress(progressCallback, ProfileLoadStage.TraceReading, 0, 0);\n\n      Trace.WriteLine($\"LoadTraceAsync(file): Creating ETW event processor\");\n      var rawProfile = await Task.Run(() => {\n        int acceptedProcessId = processIds.Count == 1 ? processIds[0] : 0;\n        symbolSettings.InsertSymbolPath(tracePath); // Include the trace path in the symbol search path.\n\n        if (symbolSettings.IncludeSymbolSubdirectories) {\n          symbolSettings.ExpandSymbolPathsSubdirectories([\".pdb\"]);\n        }\n\n        Trace.WriteLine($\"LoadTraceAsync(file): Starting ETW event processing for process {acceptedProcessId}\");\n        using var eventProcessor = new ETWEventProcessor(tracePath, options, acceptedProcessId);\n        var result = eventProcessor.ProcessEvents(progressCallback, cancelableTask);\n        Trace.WriteLine($\"LoadTraceAsync(file): ETW event processing completed, found {result?.Samples?.Count ?? 0} samples\");\n        return result;\n      });\n\n      if (rawProfile == null) {\n        Trace.WriteLine($\"LoadTraceAsync(file): ERROR - ETW event processing returned null\");\n        return null;\n      }\n\n      var mainProcess = rawProfile.FindProcess(processIds[0]);\n      if (mainProcess == null) {\n        Trace.WriteLine($\"LoadTraceAsync(file): ERROR - Failed to find main process id {processIds[0]} in trace\");\n        Trace.WriteLine($\"LoadTraceAsync(file): Available processes: [{string.Join(\", \", rawProfile.Processes.Select(p => p.ProcessId))}]\");\n        return null;\n      }\n\n      Trace.WriteLine($\"LoadTraceAsync(file): Found main process {processIds[0]}: {mainProcess.ImageFileName}\");\n      Trace.WriteLine($\"LoadTraceAsync(file): Calling LoadTraceAsync with raw profile\");\n      \n      var result = await LoadTraceAsync(rawProfile, processIds, options, symbolSettings,\n                                        report, progressCallback, cancelableTask);\n      \n      Trace.WriteLine($\"LoadTraceAsync(file): LoadTraceAsync completed, disposing raw profile\");\n      rawProfile.Dispose();\n      \n      Trace.WriteLine($\"LoadTraceAsync(file): Returning {(result != null ? \"success\" : \"failure\")}\");\n      return result;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"LoadTraceAsync(file): EXCEPTION: {ex.GetType().Name}: {ex.Message}\");\n      Trace.WriteLine($\"LoadTraceAsync(file): Stack trace: {ex.StackTrace}\");\n      if (ex.InnerException != null) {\n        Trace.WriteLine($\"LoadTraceAsync(file): Inner exception: {ex.InnerException.GetType().Name}: {ex.InnerException.Message}\");\n      }\n      return null;\n    }\n  }\n\n  public async Task<ProfileData> LoadTraceAsync(RawProfileData rawProfile, List<int> processIds,\n                                                ProfileDataProviderOptions options,\n                                                SymbolFileSourceSettings symbolSettings,\n                                                ProfileDataReport report,\n                                                ProfileLoadProgressHandler progressCallback,\n                                                CancelableTask cancelableTask) {\n    Trace.WriteLine($\"LoadTraceAsync: Starting profile loading for {processIds.Count} processes\");\n    \n    try {\n      // Fill in report details.\n      var mainProcess = rawProfile.FindProcess(processIds[0]);\n      if (mainProcess == null) {\n        Trace.WriteLine($\"LoadTraceAsync: ERROR - Main process {processIds[0]} not found in raw profile\");\n        return null;\n      }\n      \n      Trace.WriteLine($\"LoadTraceAsync: Found main process {processIds[0]}: {mainProcess.ImageFileName}\");\n      \n      report_ = report;\n      report_.Process = mainProcess;\n      report.TraceInfo = rawProfile.TraceInfo;\n      int mainProcessId = mainProcess.ProcessId;\n\n      // Save process and thread info.\n      profileData_.Process = mainProcess;\n      options_ = options;\n\n      foreach (int procId in processIds) {\n        var proc = rawProfile.FindProcess(procId);\n\n        if (proc != null) {\n          Trace.WriteLine($\"LoadTraceAsync: Adding threads for process {procId}: {proc.Threads(rawProfile).Count()} threads\");\n          profileData_.AddThreads(proc.Threads(rawProfile));\n        }\n        else {\n          Trace.WriteLine($\"LoadTraceAsync: WARNING - Process {procId} not found in raw profile\");\n        }\n      }\n\n      // Save all modules to include the ones loaded in the kernel only,\n      // which would show up in stack traces if kernel samples are enabled.\n      int moduleCount = rawProfile.Images.Count();\n      Trace.WriteLine($\"LoadTraceAsync: Adding {moduleCount} modules from raw profile\");\n      profileData_.AddModules(rawProfile.Images);\n\n      // Pre-create synthetic [Unknown Module] state for each profiled process.\n      // This must happen before parallel sample processing begins, since\n      // RawProfileData.AddImageDirect is not thread-safe.\n      foreach (int procId in processIds) {\n        PreCreateUnknownModule(rawProfile, procId);\n      }\n\n      string imageName = Utilities.Utils.TryGetFileNameWithoutExtension(mainProcess.ImageFileName);\n      Trace.WriteLine($\"LoadTraceAsync: Main image name: {imageName}\");\n\n      if (options.HasBinarySearchPaths) {\n        Trace.WriteLine($\"LoadTraceAsync: Adding {options.BinarySearchPaths.Count} binary search paths\");\n        symbolSettings.InsertSymbolPaths(options.BinarySearchPaths);\n      }\n\n      // The entire ETW processing must be done on the same thread.\n      Trace.WriteLine($\"LoadTraceAsync: Starting main processing task\");\n      bool result = await Task.Run(async () => {\n        try {\n          // Start getting the function address data while the trace is loading.\n          var totalSw = Stopwatch.StartNew();\n          UpdateProgress(progressCallback, ProfileLoadStage.TraceReading, 0, 0);\n          Trace.WriteLine($\"LoadTraceAsync: Task.Run started, beginning binary/debug file loading\");\n\n          // Start getting the function address data while the trace is loading.\n          if (cancelableTask is {IsCanceled: true}) {\n            Trace.WriteLine($\"LoadTraceAsync: Cancellation requested before binary loading\");\n            return false;\n          }\n\n#if DEBUG\n          rawProfile.PrintProcess(mainProcessId);\n          //profile.PrintSamples(mainProcessId);\n#endif\n\n          // Preload binaries and debug files, downloading them concurrently if needed.\n          Trace.WriteLine($\"LoadTraceAsync: Starting LoadBinaryAndDebugFiles\");\n          await LoadBinaryAndDebugFiles(rawProfile, mainProcess, imageName,\n                                        symbolSettings, progressCallback, cancelableTask);\n          Trace.WriteLine($\"LoadTraceAsync: Completed LoadBinaryAndDebugFiles\");\n\n          if (cancelableTask is {IsCanceled: true}) {\n            Trace.WriteLine($\"LoadTraceAsync: Cancellation requested after binary loading\");\n            return false;\n          }\n\n          // Start main processing part, resolving stack frames,\n          // mapping IPs/RVAs to functions using the debug info.\n          UpdateProgress(progressCallback, ProfileLoadStage.TraceProcessing, rawProfile.Samples.Count, 0);\n          var processingSw = Stopwatch.StartNew();\n          Trace.WriteLine($\"LoadTraceAsync: Starting sample processing for {rawProfile.Samples.Count} samples\");\n\n          // Split sample processing in multiple chunks, each done by another thread.\n          int chunks = CoreSettingsProvider.GeneralSettings.CurrentCpuCoreLimit;\n#if DEBUG\n          chunks = 1;\n#endif\n          int chunkSize = rawProfile.ComputeSampleChunkLength(chunks);\n          int sampleCount = rawProfile.Samples.Count;\n\n          Trace.WriteLine($\"LoadTraceAsync: Using {chunks} threads, chunk size: {chunkSize}\");\n          var tasks = new List<Task<List<(ProfileSample Sample, ResolvedProfileStack Stack)>>>();\n          var taskScheduler = new ConcurrentExclusiveSchedulerPair(TaskScheduler.Default, chunks);\n          var taskFactory = new TaskFactory(taskScheduler.ConcurrentScheduler);\n\n          // Process the raw samples and stacks by resolving stack frame symbols\n          // and creating the function profiles.\n          for (int k = 0; k < chunks; k++) {\n            int start = Math.Min(k * chunkSize, sampleCount);\n            int end = k == chunks - 1 ? sampleCount : Math.Min((k + 1) * chunkSize, sampleCount);\n\n            Trace.WriteLine($\"LoadTraceAsync: Creating task {k} for samples {start}-{end}\");\n            tasks.Add(taskFactory.StartNew(async () => {\n              var chunkSamples = await ProcessSamplesChunk(rawProfile, start, end,\n                                                     processIds, options.IncludeKernelEvents,\n                                                     symbolSettings, progressCallback, cancelableTask, chunks).ConfigureAwait(false);\n              return chunkSamples;\n            }).Unwrap());\n          }\n\n          Trace.WriteLine($\"LoadTraceAsync: Waiting for {tasks.Count} sample processing tasks\");\n          await Task.WhenAll(tasks.ToArray());\n          Trace.WriteLine($\"LoadTraceAsync: Done processing samples in {processingSw.Elapsed}\");\n\n          if (cancelableTask is {IsCanceled: true}) {\n            Trace.WriteLine($\"LoadTraceAsync: Cancellation requested after sample processing\");\n            return false;\n          }\n\n          // Collect samples from tasks.\n          Trace.WriteLine($\"LoadTraceAsync: Collecting chunk samples\");\n          CollectChunkSamples(tasks);\n\n          // Create the per-function profile and call tree.\n          UpdateProgress(progressCallback, ProfileLoadStage.ComputeCallTree, 0, rawProfile.Samples.Count);\n          var callTreeSw = Stopwatch.StartNew();\n          Trace.WriteLine($\"LoadTraceAsync: Computing thread sample ranges and function profile\");\n          \n          profileData_.ComputeThreadSampleRanges();\n          profileData_.FilterFunctionProfile(new ProfileSampleFilter());\n\n          Trace.WriteLine(\n            $\"LoadTraceAsync: Done compute func profile/call tree in {callTreeSw.Elapsed}, {callTreeSw.ElapsedMilliseconds} ms\");\n          Trace.WriteLine(\n            $\"LoadTraceAsync: Done processing trace in {processingSw.Elapsed}, {processingSw.ElapsedMilliseconds} ms\");\n\n          // If the trace has registered PMU counters (from PerfInfoCollectionEnd events)\n          // but no PerfInfoPMCSample events, the PMU counters were used as sampling sources\n          // rather than as separate counting events. Create synthetic counter events from\n          // the regular samples, similar to how samples without stacks get a synthetic\n          // single-frame stack (see ProcessSamplesChunk).\n          if (!rawProfile.HasPerformanceCountersEvents && rawProfile.PerformanceCounters.Count > 0) {\n            Trace.WriteLine($\"LoadTraceAsync: Generating synthetic PMC events from {rawProfile.Samples.Count} samples \" +\n                           $\"for {rawProfile.PerformanceCounters.Count} PMU sampling source counter(s)\");\n\n            foreach (var sample in rawProfile.Samples) {\n              foreach (var counter in rawProfile.PerformanceCounters) {\n                var counterEvent = new PerformanceCounterEvent(\n                  sample.IP, sample.Time, sample.ContextId, (short)counter.Id);\n                rawProfile.AddPerformanceCounterEvent(counterEvent);\n              }\n            }\n          }\n\n          // Process performance counters.\n          if (rawProfile.HasPerformanceCountersEvents) {\n            Trace.WriteLine($\"LoadTraceAsync: Processing {rawProfile.PerformanceCountersEvents.Count} performance counter events\");\n            ProcessPerformanceCounters(rawProfile, processIds, symbolSettings, progressCallback, cancelableTask);\n          }\n          else {\n            Trace.WriteLine($\"LoadTraceAsync: No performance counter events to process\");\n          }\n\n#if DEBUG\n          // PrintSampleStatistics();\n#endif\n          Trace.WriteLine($\"LoadTraceAsync: Done loading profile in {totalSw.Elapsed}\");\n          return true;\n        }\n        catch (Exception ex) {\n          Trace.WriteLine($\"LoadTraceAsync: EXCEPTION in Task.Run: {ex.GetType().Name}: {ex.Message}\");\n          Trace.WriteLine($\"LoadTraceAsync: Stack trace: {ex.StackTrace}\");\n          throw; // Re-throw to be caught by outer try-catch\n        }\n      });\n\n      if (cancelableTask is {IsCanceled: true}) {\n        Trace.WriteLine($\"LoadTraceAsync: Cancellation requested after main processing task\");\n        return null;\n      }\n\n      // Setup session documents.\n      if (result) {\n        Trace.WriteLine($\"LoadTraceAsync: Main processing succeeded, setting up session documents\");\n        var exeDocument = FindSessionDocuments(imageName, out var otherDocuments);\n\n        if (exeDocument == null) {\n          Trace.WriteLine($\"LoadTraceAsync: WARNING - Failed to find main EXE document for {imageName}\");\n          exeDocument = new LoadedDocument(string.Empty, string.Empty, Guid.Empty);\n          exeDocument.Summary = new IRTextSummary(string.Empty);\n        }\n        else {\n          Trace.WriteLine($\"LoadTraceAsync: Using exe document {exeDocument.ModuleName} with {otherDocuments.Count} other documents\");\n        }\n\n        Trace.WriteLine($\"LoadTraceAsync: Calling SetupNewSessionRequested event\");\n        await (SetupNewSessionRequested?.Invoke(exeDocument, otherDocuments, profileData_) ?? Task.CompletedTask);\n        Trace.WriteLine($\"LoadTraceAsync: Completed SetupNewSessionRequested event\");\n      }\n      else {\n        Trace.WriteLine($\"LoadTraceAsync: ERROR - Main processing task returned false (failed)\");\n      }\n\n      if (cancelableTask is {IsCanceled: true}) {\n        Trace.WriteLine($\"LoadTraceAsync: Cancellation requested after session setup\");\n        return null;\n      }\n\n      Trace.WriteLine($\"LoadTraceAsync: Returning {(result ? \"success\" : \"failure\")}\");\n      return result ? profileData_ : null;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"LoadTraceAsync: TOP-LEVEL EXCEPTION: {ex.GetType().Name}: {ex.Message}\");\n      Trace.WriteLine($\"LoadTraceAsync: Exception details - Type: {ex.GetType().FullName}\");\n      Trace.WriteLine($\"LoadTraceAsync: Exception source: {ex.Source}\");\n      Trace.WriteLine($\"LoadTraceAsync: Stack trace: {ex.StackTrace}\");\n      \n      if (ex.InnerException != null) {\n        Trace.WriteLine($\"LoadTraceAsync: Inner exception: {ex.InnerException.GetType().Name}: {ex.InnerException.Message}\");\n        Trace.WriteLine($\"LoadTraceAsync: Inner exception stack: {ex.InnerException.StackTrace}\");\n      }\n      \n      Trace.Flush();\n      return null;\n    }\n  }\n\n  private void CollectChunkSamples(List<Task<List<(ProfileSample Sample, ResolvedProfileStack Stack)>>> tasks) {\n    var samples = new List<(ProfileSample, ResolvedProfileStack)>[tasks.Count];\n\n    for (int k = 0; k < tasks.Count; k++) {\n      samples[k] = tasks[k].Result;\n    }\n\n    // Preallocate merged samples list.\n    int totalSamples = 0;\n\n    foreach (var chunkSamples in samples) {\n      totalSamples += chunkSamples.Count;\n    }\n\n    profileData_.Samples.EnsureCapacity(totalSamples);\n\n    // Merge the samples from all chunks and sort them by time.\n    foreach (var chunkSamples in samples) {\n      profileData_.Samples.AddRange(chunkSamples);\n    }\n\n    if (profileData_.Samples != null) {\n      profileData_.Samples.Sort((a, b) => a.Sample.Time.CompareTo(b.Sample.Time));\n    }\n    else {\n      // Make an empty list to keep other parts happy.\n      profileData_.Samples = [];\n    }\n  }\n\n  private async Task<List<(ProfileSample Sample, ResolvedProfileStack Stack)>>\n    ProcessSamplesChunk(RawProfileData rawProfile, int start, int end, List<int> processIds,\n                        bool includeKernelEvents,\n                        SymbolFileSourceSettings symbolSettings,\n                        ProfileLoadProgressHandler progressCallback,\n                        CancelableTask cancelableTask, int chunks) {\n\n    // Clear thread-local caches to prevent stale data from previous trace loads\n    prevImage_ = null;\n    prevProfileModuleBuilder_ = null;\n    RawProfileData.ClearThreadLocalCaches();\n\n    var totalWeight = TimeSpan.Zero;\n    var profileWeight = TimeSpan.Zero;\n    var samples = new List<(ProfileSample Sample, ResolvedProfileStack Stack)>(end - start + 1);\n    int sampleIndex = 0;\n    var chunkSw = Stopwatch.StartNew();\n    int stackResolutionCount = 0;\n    int kernelSamplesSkipped = 0;\n    int otherProcessSamplesSkipped = 0;\n\n    Trace.WriteLine($\"ProcessSamplesChunk: Processing chunk {start}-{end} ({end - start} samples) on thread {Thread.CurrentThread.ManagedThreadId}\");\n\n    for (int i = start; i < end; i++) {\n      var sample = rawProfile.Samples[i];\n      \n      // Update progress every pow2 N samples.\n      if ((++sampleIndex & PROGRESS_UPDATE_INTERVAL - 1) == 0) {\n        if (cancelableTask is {IsCanceled: true}) {\n          Trace.WriteLine($\"ProcessSamplesChunk: Cancellation requested at sample {sampleIndex}\");\n          return samples;\n        }\n\n        // Calculate global progress more accurately - each chunk processes start+sampleIndex samples\n        int globalProgress = start + sampleIndex;\n        var elapsed = chunkSw.Elapsed;\n        var samplesPerSecond = sampleIndex / Math.Max(elapsed.TotalSeconds, 0.001);\n        var progressInfo = $\"Thread {Thread.CurrentThread.ManagedThreadId}: {samplesPerSecond:F0} samples/sec, {stackResolutionCount} stacks resolved\";\n        \n        UpdateProgress(progressCallback, ProfileLoadStage.TraceProcessing,\n                       rawProfile.Samples.Count, globalProgress, progressInfo);\n      }\n\n      if (!includeKernelEvents && sample.IsKernelCode) {\n        kernelSamplesSkipped++;\n        continue;\n      }\n\n      // Ignore other processes.\n      var context = sample.GetContext(rawProfile);\n\n      if (!processIds.Contains(context.ProcessId)) {\n        otherProcessSamplesSkipped++;\n        continue;\n      }\n\n      // Count time for each sample.\n      var stack = sample.GetStack(rawProfile);\n      ResolvedProfileStack resolvedStack = null;\n\n      // Count time in the profile image.\n      totalWeight += sample.Weight;\n      profileWeight += sample.Weight;\n\n      // If no stack is associated, use a dummy stack that has\n      // a single frame with the sample IP, which is sufficient\n      // to count the sample in the proper function as exclusive time.\n      if (stack.IsUnknown) {\n        stack = new ProfileStack {\n          ContextId = sample.ContextId,\n          //? TODO: Avoid allocating a new array for each sample.\n          FramePointers = new long[1] {sample.IP}\n        };\n      }\n\n      // Process each stack frame to map it to a module:function\n      // using the debug info. A stack is resolved only once, future\n      // occurrences use the cached version.\n      resolvedStack = stack.GetOptionalData() as ResolvedProfileStack;\n\n      if (resolvedStack == null) {\n#if DEBUG\n        Interlocked.Increment(ref UnresolvedStackCount);\n#endif\n        stackResolutionCount++;\n        resolvedStack = await ProcessUnresolvedStackAsync(stack, context, rawProfile, symbolSettings).ConfigureAwait(false);\n        stack.SetOptionalData(resolvedStack); // Cache resolved stack.\n      }\n      else {\n#if DEBUG\n        Interlocked.Increment(ref ResolvedStackCount);\n#endif\n      }\n\n#if DEBUG\n      RecordSampleStatistics(resolvedStack);\n#endif\n\n      samples.Add((sample, resolvedStack));\n    }\n\n    var finalElapsed = chunkSw.Elapsed;\n    Trace.WriteLine($\"ProcessSamplesChunk: Completed chunk {start}-{end} in {finalElapsed.TotalSeconds:F2}s, \" +\n                   $\"processed {samples.Count} samples, resolved {stackResolutionCount} stacks, \" +\n                   $\"skipped {kernelSamplesSkipped} kernel + {otherProcessSamplesSkipped} other process samples\");\n\n    lock (lockObject_) {\n      profileData_.TotalWeight += totalWeight;\n      profileData_.ProfileWeight += profileWeight;\n    }\n\n    return samples;\n  }\n\n  private async Task<ResolvedProfileStack> ProcessUnresolvedStackAsync(ProfileStack stack,\n                                                      ProfileContext context, RawProfileData rawProfile,\n                                                      SymbolFileSourceSettings symbolSettings) {\n    var sw = Stopwatch.StartNew();\n    var resolvedStack = new ResolvedProfileStack(stack.FrameCount, context);\n    long[] stackFrames = stack.FramePointers;\n    bool isManagedCode = false;\n    int frameIndex = 0;\n    int pointerSize = rawProfile.TraceInfo.PointerSize;\n    int kernelFrames = 0;\n    int managedFrames = 0;\n    int unknownFrames = 0;\n    int resolvedFrames = 0;\n    bool prevFrameWasUnknownJit = false;\n\n    //? TODO: Stacks with >256 frames are truncated, inclusive time computation is not right then\n    //? for ex it never gets to main. Easy example is a quicksort impl\n    for (; frameIndex < stackFrames.Length; frameIndex++) {\n      long frameIp = stackFrames[frameIndex];\n      ProfileImage frameImage = null;\n      isManagedCode = false;\n\n      if (ETWEventProcessor.IsKernelAddress((ulong)frameIp, pointerSize)) {\n        kernelFrames++;\n        frameImage = rawProfile.FindImageForIP(frameIp, ETWEventProcessor.KernelProcessId);\n      }\n      else {\n        frameImage = rawProfile.FindImageForIP(frameIp, context.ProcessId);\n      }\n\n      if (frameImage == null) {\n        // Check if it's a .NET method, the JITted code may not mapped to any module.\n        if (rawProfile.HasManagedMethods(context.ProcessId)) {\n          var managedFunc = rawProfile.FindManagedMethodForIP(frameIp, context.ProcessId);\n\n          if (managedFunc != null) {\n            frameImage = managedFunc.Image;\n            isManagedCode = true;\n            managedFrames++;\n          }\n        }\n\n        if (frameImage == null) {\n          unknownFrames++;\n\n          // for case when some kernel address used without a named corresponding module,\n          // we should not label it as JIT immediately\n          if (ETWEventProcessor.IsKernelAddress((ulong)frameIp, pointerSize)) {\n            resolvedStack.AddFrame(null, frameIp, 0, frameIndex,\n                                  ResolvedProfileStackFrameKey.Unknown, stack, pointerSize);\n            prevFrameWasUnknownJit = false;\n            continue;\n          }\n\n          // IP doesn't map to any known module (e.g., JITted). Attribute\n          // to a synthetic per-thread JIT function, but collapse consecutive\n          // unknown frames to avoid self-recursive chains in the call tree\n          if (!prevFrameWasUnknownJit) {\n            UnknownModuleState? unknownState = GetUnknownModule(context.ProcessId);\n\n            if (unknownState != null) {\n              (IRTextFunction function, FunctionDebugInfo debugInfo) = unknownState.GetOrCreateThreadFunction(context.ThreadId);\n              ResolvedProfileStackFrameKey unknownFrame = new ResolvedProfileStackFrameKey(debugInfo, unknownState.Image, false);\n\n              // Use a synthetic IP keyed by thread ID to prevent cache collisions\n              // in ResolvedProfileStack.frameInstances_ when multiple threads\n              // share the same unmapped IP\n              long syntheticIp = MakeSyntheticIp(context.ProcessId, context.ThreadId);\n              resolvedStack.AddFrame(function, syntheticIp, debugInfo.RVA,\n                                    frameIndex, unknownFrame, stack, pointerSize);\n              prevFrameWasUnknownJit = true;\n              continue;\n            }\n\n            // Fallback when no synthetic module state for this process\n            resolvedStack.AddFrame(null, frameIp, 0, frameIndex,\n                                  ResolvedProfileStackFrameKey.Unknown, stack, pointerSize);\n            continue;\n          }\n\n          // Consecutive unknown frame after a named JIT frame -- skip\n          // to avoid self-recursive chains in the call tree.\n          continue;\n        }\n      }\n\n      // Try to resolve the frame using the lists of processes/images and debug info.\n      long frameRva = 0;\n      ProfileModuleBuilder profileModuleBuilder = null;\n      var moduleStartTime = sw.Elapsed;\n      profileModuleBuilder = await GetModuleBuilderAsync(rawProfile, frameImage, context.ProcessId, symbolSettings).ConfigureAwait(false);\n      var moduleEndTime = sw.Elapsed;\n\n      if (profileModuleBuilder == null) {\n        unknownFrames++;\n        resolvedStack.AddFrame(null, frameIp, 0, frameIndex, ResolvedProfileStackFrameKey.Unknown, stack, pointerSize);\n        prevFrameWasUnknownJit = false;\n        continue;\n      }\n\n      // Track significant module builder delays\n      var moduleTime = (moduleEndTime - moduleStartTime).TotalMilliseconds;\n      if (moduleTime > 10) { // Log delays > 10ms\n        Trace.WriteLine($\"Slow module builder for {frameImage.ModuleName}: {moduleTime:F1}ms\");\n      }\n\n      if (isManagedCode) {\n        frameRva = frameIp;\n      }\n      else {\n        frameRva = frameIp - frameImage.BaseAddress;\n      }\n\n      // Find the function the sample belongs to.\n      var funcStartTime = sw.Elapsed;\n      var funcPair = profileModuleBuilder.GetOrCreateFunction(frameRva);\n      var funcEndTime = sw.Elapsed;\n\n      // Track significant function lookup delays\n      var funcTime = (funcEndTime - funcStartTime).TotalMilliseconds;\n      if (funcTime > 10) { // Log delays > 10ms\n        Trace.WriteLine($\"Slow function lookup in {frameImage.ModuleName} at RVA 0x{frameRva:X}: {funcTime:F1}ms\");\n      }\n\n      // Create the function profile data, with the merged weight of all instances\n      // of the func. across all call stacks.\n      var resolvedFrame = new ResolvedProfileStackFrameKey(funcPair.DebugInfo, frameImage,\n                                                           profileModuleBuilder.IsManaged);\n      resolvedStack.AddFrame(funcPair.Function, frameIp, frameRva, frameIndex,\n                             resolvedFrame, stack, pointerSize);\n      resolvedFrames++;\n      prevFrameWasUnknownJit = false; // Known frame breaks unknown frame run.\n    }\n\n    var totalTime = sw.Elapsed;\n    \n    // Log slow stack resolutions for debugging\n    if (totalTime.TotalMilliseconds > 50) { // Log stacks taking > 50ms\n      Trace.WriteLine($\"Slow stack resolution: {totalTime.TotalMilliseconds:F1}ms for {stackFrames.Length} frames \" +\n                     $\"(resolved: {resolvedFrames}, unknown: {unknownFrames}, managed: {managedFrames}, kernel: {kernelFrames})\");\n    }\n\n    return resolvedStack;\n  }\n\n  private ProfileImage unknownModuleImage_;\n\n  /// <summary>\n  /// Pre-creates the synthetic [Unknown Module] for a process. Must be called\n  /// before parallel sample processing begins.\n  /// </summary>\n  private void PreCreateUnknownModule(RawProfileData rawProfile, int processId) {\n    // Share a single image across all processes to match how real modules\n    // are deduplicated by AddImage.\n    if (unknownModuleImage_ == null) {\n      unknownModuleImage_ = new ProfileImage(\n        filePath: UnknownModuleName,\n        originalFileName: UnknownModuleName,\n        baseAddress: 0,\n        defaultBaseAddress: 0,\n        size: 0,\n        timeStamp: 0,\n        checksum: 0);\n\n      // Use AddImageDirect since LoadingCompleted() has already freed imagesMap_.\n      rawProfile.AddImageDirect(unknownModuleImage_);\n      profileData_.Modules[unknownModuleImage_.Id] = unknownModuleImage_;\n    }\n\n    var state = new UnknownModuleState(unknownModuleImage_, profileData_, processId);\n    unknownModules_[processId] = state;\n\n    Trace.WriteLine($\"Pre-created synthetic {UnknownModuleName} for process {processId}, ImageId={unknownModuleImage_.Id}\");\n  }\n\n  /// <summary>\n  /// Gets the pre-created synthetic module state for a process.\n  /// Returns null if PreCreateUnknownModule was not called for this process.\n  /// </summary>\n  private UnknownModuleState? GetUnknownModule(int processId) {\n    return unknownModules_.GetValueOrDefault(processId);\n  }\n\n  /// <summary>\n  /// Creates a synthetic IP that is unique per (processId, threadId).\n  /// Uses made up x64 address that shouldn't naturally be seen in traces,\n  /// that stays below the IsKernelAddress threshold.\n  /// </summary>\n  private static long MakeSyntheticIp(int processId, int threadId) {\n    ulong pid = (ulong)processId & ProcessIdMask;\n    ulong tid = (uint)threadId;\n    return unchecked((long)(SyntheticIpBase | (pid << 32) | tid));\n  }\n\n  private ILoadedDocument FindSessionDocuments(string imageName, out List<ILoadedDocument> otherDocuments) {\n    ILoadedDocument exeDocument = null;\n    otherDocuments = new List<ILoadedDocument>();\n\n    foreach (ProfileModuleBuilder module in imageModuleMap_.Values) {\n      var moduleDoc = module.ModuleDocument;\n\n      if (moduleDoc == null) {\n        continue;\n      }\n\n      if (Utilities.Utils.IsExecutableFile(moduleDoc.BinaryFile?.FilePath)) {\n        if (exeDocument == null) {\n          exeDocument = module.ModuleDocument;\n        }\n        else if (moduleDoc.ModuleName.Contains(imageName, StringComparison.OrdinalIgnoreCase)) {\n          // Pick the better match EXE.\n          otherDocuments.Add(exeDocument);\n          exeDocument = module.ModuleDocument;\n          continue;\n        }\n      }\n\n      otherDocuments.Add(moduleDoc);\n\n      if (module.DebugInfo != null) {\n        // Used after profiling completes to unload debug info and free memory.\n        profileData_.RegisterModuleDebugInfo(moduleDoc.ModuleName, module.DebugInfo);\n      }\n    }\n\n    // Include synthetic [Unknown Module] documents so the UI can\n    // navigate to JIT functions via FindLoadedDocument.\n    foreach (var state in unknownModules_.Values) {\n      otherDocuments.Add(state.Document);\n    }\n\n    return exeDocument;\n  }\n\n  private void UpdateProgress(ProfileLoadProgressHandler callback, ProfileLoadStage stage,\n                              int total, int current, string optional = null) {\n    if (callback != null) {\n      callback(new ProfileLoadProgress(stage) {\n        Total = total, Current = current,\n        Optional = optional\n      });\n    }\n  }\n\n  private List<(ProfileImage Image, int SampleCount)>\n    CollectTopModules(RawProfileData rawProfile, ProfileProcess mainProcess) {\n    var moduleMap = new Dictionary<ProfileImage, int>();\n    int pointerSize = rawProfile.TraceInfo.PointerSize;\n    var sampleRefs = CollectionsMarshal.AsSpan(rawProfile.Samples);\n    var timer = Stopwatch.StartNew();\n    int index = 0;\n    int totalSamplesProcessed = 0;\n    int mainProcessSamples = 0;\n    int samplesWithStacks = 0;\n    int samplesWithoutStacks = 0;\n\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Starting top modules collection for process {mainProcess.ProcessId} ({mainProcess.ImageFileName})\");\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Total samples in trace: {rawProfile.Samples.Count}\");\n\n    foreach (ref var sample in sampleRefs) {\n      totalSamplesProcessed++;\n      var context = sample.GetContext(rawProfile);\n\n      if (context.ProcessId != mainProcess.ProcessId) {\n        continue;\n      }\n\n      mainProcessSamples++;\n      var stack = sample.GetStack(rawProfile);\n\n      if (stack.IsUnknown) {\n        // Even if no stack is available, count the sample IP itself for module identification\n        // This allows us to load debug files for function name resolution even without stacks\n        ProfileImage frameImage = null;\n\n        if (ETWEventProcessor.IsKernelAddress((ulong)sample.IP, pointerSize)) {\n          frameImage = rawProfile.FindImageForIP(sample.IP, ETWEventProcessor.KernelProcessId);\n        }\n        else {\n          frameImage = rawProfile.FindImageForIP(sample.IP, context.ProcessId);\n        }\n\n        if (frameImage != null) {\n          moduleMap.AccumulateValue(frameImage, 1);\n        }\n        \n        samplesWithoutStacks++;\n        continue;\n      }\n\n      samplesWithStacks++;\n      \n      foreach (long frame in stack.FramePointers) {\n        ProfileImage frameImage = null;\n\n        if (ETWEventProcessor.IsKernelAddress((ulong)frame, pointerSize)) {\n          frameImage = rawProfile.FindImageForIP(frame, ETWEventProcessor.KernelProcessId);\n        }\n        else {\n          frameImage = rawProfile.FindImageForIP(frame, context.ProcessId);\n        }\n\n        if (frameImage != null) {\n          moduleMap.AccumulateValue(frameImage, 1);\n        }\n      }\n\n      // Stop collecting after a couple seconds, it's good enough\n      // for an approximated set of used modules.\n      if ((++index & PROGRESS_UPDATE_INTERVAL - 1) == 0 &&\n          timer.ElapsedMilliseconds > 1000) {\n        Trace.WriteLine($\"TOP_MODULES_DEBUG: Early termination after {timer.ElapsedMilliseconds}ms at sample {totalSamplesProcessed}\");\n        break;\n      }\n    }\n\n    var moduleList = moduleMap.ToList();\n    moduleList.Sort((a, b) => b.Item2.CompareTo(a.Item2));\n\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Collection completed in {timer.Elapsed}\");\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Processed {totalSamplesProcessed} total samples\");\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Found {mainProcessSamples} samples for main process {mainProcess.ProcessId}\");\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Found {samplesWithStacks} samples with valid stacks\");\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Found {samplesWithoutStacks} samples without stacks (using sample IP for module identification)\");\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Collected {moduleMap.Count} unique modules\");\n    Trace.WriteLine($\"TOP_MODULES_DEBUG: Top 20 modules by sample count:\");\n\n    for (int i = 0; i < Math.Min(20, moduleList.Count); i++) {\n      var module = moduleList[i];\n      Trace.WriteLine($\"TOP_MODULES_DEBUG:   {i + 1}. {module.Item1.ModuleName}: {module.Item2} samples (path: {module.Item1.FilePath})\");\n    }\n\n    Trace.WriteLine(\"TOP_MODULES_DEBUG: =====================================\");\n\n#if DEBUG\n    Trace.WriteLine($\"Collected top modules: {timer.Elapsed}, modules: {moduleMap.Count}\");\n\n    foreach (var pair in moduleList) {\n      Trace.WriteLine($\"  - {pair.Item1.ModuleName}: {pair.Item2}\");\n    }\n\n    Trace.WriteLine(\"-------------------------------------\");\n#endif\n    return moduleList;\n  }\n\n  private async Task LoadBinaryAndDebugFiles(RawProfileData rawProfile, ProfileProcess mainProcess,\n                                             string mainImageName,\n                                             SymbolFileSourceSettings symbolSettings,\n                                             ProfileLoadProgressHandler progressCallback,\n                                             CancelableTask cancelableTask) {\n    var loadStartTime = Stopwatch.StartNew();\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] === Starting LoadBinaryAndDebugFiles for process {mainProcess.ImageFileName} ===\");\n    \n    var imageList = mainProcess.Images(rawProfile).ToList();\n    var kernelProc = rawProfile.FindProcess(ETWEventProcessor.KernelProcessId);\n\n    if (kernelProc != null) {\n      imageList.AddRange(kernelProc.Images(rawProfile));\n    }\n\n    int imageLimit = imageList.Count;\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] Total images to process: {imageLimit} (including kernel modules: {kernelProc != null})\");\n\n    // Find the modules with samples, sorted by sample count.\n    // Used to skip loading of insignificant modules with few samples.\n    var topModules = CollectTopModules(rawProfile, mainProcess);\n    int moduleSampleCutOff = 0;\n\n    if (symbolSettings.SkipLowSampleModules) {\n      moduleSampleCutOff = (int)(symbolSettings.LowSampleModuleCutoff * rawProfile.Samples.Count);\n    }\n\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] Module filtering: SkipLowSampleModules={symbolSettings.SkipLowSampleModules}, \" +\n                             $\"Cutoff={moduleSampleCutOff} ({symbolSettings.LowSampleModuleCutoff:P1} of {rawProfile.Samples.Count} samples), \" +\n                             $\"TopModulesCount={topModules.Count}\");\n\n    // Log symbol server configuration for diagnostics\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] Symbol server enabled: {symbolSettings.SourceServerEnabled}\");\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] Symbol paths: {string.Join(\"; \", symbolSettings.SymbolPaths)}\");\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] Initial timeout: {symbolSettings.EffectiveTimeoutSeconds}s (Bellwether: {symbolSettings.BellwetherTimeoutSeconds}s, Normal: {symbolSettings.SymbolServerTimeoutSeconds}s, Degraded: {symbolSettings.DegradedTimeoutSeconds}s)\");\n\n    Trace.WriteLine($\"BINARY_FILTER_DEBUG: Sample cutoff calculation: {symbolSettings.LowSampleModuleCutoff} * {rawProfile.Samples.Count} = {moduleSampleCutOff}\");\n    Trace.WriteLine($\"BINARY_FILTER_DEBUG: Skip low sample modules: {symbolSettings.SkipLowSampleModules}\");\n    Trace.WriteLine($\"BINARY_FILTER_DEBUG: Starting PDB filtering for {imageLimit} total modules\");\n\n    // PDB task list for parallel downloads\n    var pdbTaskList = new Task<DebugFileSearchResult>[imageLimit];\n\n    // Sanity check: Do we have ImageID DbgID events (PDB GUID/Age)?\n    // Without GUID/Age, PDB symbol server lookup is IMPOSSIBLE - the server requires GUID+Age.\n    // The GUID comes from the trace's ImageID DbgID events, NOT from downloading binaries.\n    // The pragmatic solution is to skip symbol server entirely and use local symbols only.\n    // This matches WPA's behavior which requires ImageID events for symbol server lookup.\n    if (!rawProfile.TraceInfo.HasImageIdEvents) {\n      DiagnosticLogger.LogWarning(\"[SymbolLoading] Trace has no ImageID DbgID events (PDB GUID/Age missing). \" +\n                                  \"Symbol server lookups require GUID+Age. Disabling symbol server. \" +\n                                  \"Using local symbols only. Consider re-capturing with 'wpr -start CPU'.\");\n      symbolSettings.SourceServerEnabled = false;\n    }\n\n    // Bellwether test: try to download the ntoskrnl PDB first to check symbol server health\n    // Use 30s timeout for first connection (warmup), then reduce to 10s for subsequent downloads\n    if (symbolSettings.BellwetherTestEnabled && symbolSettings.SourceServerEnabled) {\n      await PerformBellwetherTest(imageList, rawProfile, symbolSettings);\n    }\n\n    // LAZY BINARY LOADING: Skip upfront binary downloads entirely.\n    // Binaries are only needed for disassembly view, not for function name resolution.\n    // Function names come from PDB files, which use GUID/Age from ImageID events in trace.\n    // Binaries will be downloaded on-demand when user views assembly for a function.\n    // This dramatically speeds up trace loading (from minutes to seconds).\n    DiagnosticLogger.LogInfo(\"[SymbolLoading] Skipping upfront binary downloads (lazy loading enabled). \" +\n                             \"Binaries will be downloaded on-demand when viewing assembly.\");\n\n    // Determine the compiler target from trace metadata instead of binaries.\n    // PointerSize tells us if it's a 64-bit or 32-bit OS.\n    // Note: Individual processes can be 32-bit (WoW64) on 64-bit OS.\n    // We default to the OS architecture here; per-module architecture is inferred\n    // from path (SysWOW64 = 32-bit) or determined when the binary is loaded on-demand.\n    var irMode = IRMode.Default;\n    if (rawProfile.TraceInfo.PointerSize == 8) {\n      // 64-bit system - could be x64 or ARM64, but x64 is far more common\n      // TODO: Could potentially detect ARM64 from other trace metadata if needed\n      irMode = IRMode.x86_64;\n      defaultArchitecture_ = Machine.Amd64;\n      DiagnosticLogger.LogInfo(\"[SymbolLoading] Detected 64-bit OS from trace metadata (PointerSize=8)\");\n    }\n    else if (rawProfile.TraceInfo.PointerSize == 4) {\n      irMode = IRMode.x86_64; // x86 is supported under x86_64 mode\n      defaultArchitecture_ = Machine.I386;\n      DiagnosticLogger.LogInfo(\"[SymbolLoading] Detected 32-bit OS from trace metadata (PointerSize=4)\");\n    }\n    else {\n      DiagnosticLogger.LogWarning($\"[SymbolLoading] Unknown pointer size {rawProfile.TraceInfo.PointerSize}, defaulting to x86_64\");\n      irMode = IRMode.x86_64;\n      defaultArchitecture_ = Machine.Amd64;\n    }\n\n    Trace.WriteLine($\"Binary download skipped (lazy loading) - architecture detected from trace: {irMode}\");\n\n    compilerInfoProvider_ = new ASMCompilerInfoProvider(irMode);\n    await (StartNewSessionRequested?.Invoke(mainImageName, SessionKind.FileSession, compilerInfoProvider_) ?? Task.CompletedTask);\n\n    // Locate the needed debug files, in parallel. This will download them\n    // from the symbol server if not yet on local machine and enabled.\n    int pdbCount = 0;\n    var pdbTaskSemaphore = new SemaphoreSlim(12);\n    var pdbSw = Stopwatch.StartNew();\n\n    // Skip PDB symbol server lookups if disabled (e.g., no ImageID events in trace)\n    if (!symbolSettings.SourceServerEnabled) {\n      DiagnosticLogger.LogInfo(\"[SymbolLoading] Symbol server disabled - skipping PDB downloads. \" +\n                               \"Will search local paths only.\");\n    }\n\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] Starting PDB/symbol file search for {imageLimit} images. Sample cutoff: {moduleSampleCutOff}\");\n\n    // Log top modules from sample analysis (with Microsoft flag from trace FileVersion events)\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] Top 10 modules by sample count:\");\n    for (int t = 0; t < Math.Min(10, topModules.Count); t++) {\n      var tm = topModules[t];\n      string msTag = tm.Item1.IsMicrosoft ? \" [Microsoft]\" : \"\";\n      DiagnosticLogger.LogInfo($\"[SymbolLoading]   {t+1}. {tm.Item1.ModuleName}: {tm.SampleCount} samples{msTag}\");\n    }\n\n    Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Starting debug file search for {imageLimit} modules. Low sample cutoff: {moduleSampleCutOff}\");\n\n    for (int i = 0; i < imageLimit; i++) {\n      if (cancelableTask is {IsCanceled: true}) {\n        DiagnosticLogger.LogInfo($\"[SymbolLoading] PDB loading cancelled at image {i}/{imageLimit}\");\n        return;\n      }\n\n      // Apply module filtering (same logic that was used for binary filtering)\n      if (!IsAcceptedModule(imageList[i])) {\n        Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Debug file search SKIPPED - Module rejected by binary name allowlist: {imageList[i].ModuleName} (path: {imageList[i].FilePath})\");\n        rejectedDebugModules_.Add(imageList[i]);\n        continue;\n      }\n\n      int moduleIndex = topModules.FindIndex(pair => pair.Item1 == imageList[i]);\n      bool acceptModule = moduleIndex >= 0 &&\n                          topModules[moduleIndex].SampleCount > moduleSampleCutOff;\n\n      if (!acceptModule) {\n        if (moduleIndex < 0) {\n          Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Debug file search SKIPPED - Module not in top modules list: {imageList[i].ModuleName} (path: {imageList[i].FilePath})\");\n        } else {\n          long sampleCount = topModules[moduleIndex].SampleCount;\n          Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Debug file search SKIPPED - Module sample count too low: {imageList[i].ModuleName} (samples: {sampleCount}, cutoff: {moduleSampleCutOff})\");\n        }\n        rejectedDebugModules_.Add(imageList[i]);\n        continue;\n      }\n\n      // With lazy binary loading, we use ETL symbol file descriptors (ImageID events) for PDB lookup.\n      // This contains GUID/Age which is required for symbol server lookup.\n      var symbolFile = rawProfile.GetDebugFileForImage(imageList[i], mainProcess.ProcessId);\n\n      if (symbolFile == null) {\n        // No ImageID_DbgID event for this module - can't download PDB without GUID/Age\n        string msTag = imageList[i].IsMicrosoft ? \" [Microsoft]\" : \"\";\n        DiagnosticLogger.LogWarning($\"[SymbolLoading] No PDB info (ImageID_DbgID event) for {imageList[i].ModuleName}{msTag} at base 0x{imageList[i].BaseAddress:X} - skipping PDB download\");\n        continue;\n      }\n\n      if (symbolFile != null) {\n        if (symbolSettings.IsRejectedSymbolFile(symbolFile)) {\n          // Log all rejected symbol files - negative cache from previous failed downloads\n          string msTag = imageList[i].IsMicrosoft ? \" [Microsoft]\" : \"\";\n          DiagnosticLogger.LogWarning($\"[SymbolLoading] REJECTED: {imageList[i].ModuleName}{msTag} symbol file in negative cache: {symbolFile.FileName} (ID: {symbolFile.Id})\");\n          Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Debug file search SKIPPED - Symbol file previously rejected: {imageList[i].ModuleName} (symbol: {symbolFile})\");\n          rejectedDebugModules_.Add(imageList[i]);\n          continue;\n        }\n\n        pdbCount++;\n        Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Debug file search STARTED - Using ETL symbol file descriptor: {imageList[i].ModuleName} (symbol: {symbolFile})\");\n        var taskSymbolFile = symbolFile;\n        pdbTaskList[i] = Task.Run(async () => {\n          await pdbTaskSemaphore.WaitAsync();\n          DebugFileSearchResult result;\n          Task<DebugFileSearchResult> downloadTask = null;\n\n          try {\n            // Apply manual timeout since TraceEvent's ServerTimeout doesn't work reliably\n            int timeoutSeconds = symbolSettings.EffectiveTimeoutSeconds > 0 ? symbolSettings.EffectiveTimeoutSeconds : 10;\n            using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(timeoutSeconds));\n\n            downloadTask = compilerInfoProvider_.DebugFileFinder.FindDebugInfoFileAsync(taskSymbolFile, symbolSettings);\n            var timeoutTask = Task.Delay(Timeout.Infinite, cts.Token);\n\n            var completedTask = await Task.WhenAny(downloadTask, timeoutTask).ConfigureAwait(false);\n\n            if (completedTask == downloadTask) {\n              result = await downloadTask.ConfigureAwait(false);\n            }\n            else {\n              DiagnosticLogger.LogWarning($\"[SymbolSearch] TIMEOUT after {timeoutSeconds}s for {taskSymbolFile.FileName}\");\n              result = DebugFileSearchResult.Failure(taskSymbolFile, $\"Timeout after {timeoutSeconds}s\");\n\n              // Track timeout as a failure, but DON'T cache it (transient failure)\n              symbolSettings.RejectSymbolFile(taskSymbolFile,\n                                             SymbolFileRejectionReason.NetworkTimeout,\n                                             $\"Timeout after {timeoutSeconds}s\");\n\n              // After first timeout, reduce timeout for subsequent downloads\n              if (!symbolSettings.HadFirstTimeout) {\n                symbolSettings.HadFirstTimeout = true;\n                DiagnosticLogger.LogInfo($\"[SymbolSearch] First timeout detected - reducing timeout from {timeoutSeconds}s to {symbolSettings.SymbolServerTimeoutSeconds}s for remaining downloads\");\n              }\n            }\n          }\n          catch (OperationCanceledException) {\n            result = DebugFileSearchResult.Failure(taskSymbolFile, \"Cancelled\");\n          }\n          finally {\n            // Wait for the underlying download to actually complete before releasing semaphore.\n            if (downloadTask != null && !downloadTask.IsCompleted) {\n              try {\n                await downloadTask.ConfigureAwait(false);\n              }\n              catch {\n                // Ignore errors from the orphaned task\n              }\n            }\n\n            pdbTaskSemaphore.Release();\n          }\n\n          return result;\n        });\n      }\n      else {\n        // No symbol file descriptor in ETL - this module won't have symbols\n        // until user clicks on a function (lazy binary loading will try then)\n        Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Debug file search SKIPPED - No symbol file descriptor in ETL: {imageList[i].ModuleName} (path: {imageList[i].FilePath})\");\n      }\n    }\n\n    int pdbTasksStarted = pdbTaskList.Count(t => t != null);\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] PDB download phase: Started {pdbTasksStarted} download tasks for {pdbCount} eligible modules\");\n\n    // Wait for ALL PDB tasks to complete in parallel before processing results.\n    // Report progress incrementally as tasks complete (not just at the end).\n    var activePdbTasks = pdbTaskList.Where(t => t != null).ToArray();\n    if (activePdbTasks.Length > 0) {\n      DiagnosticLogger.LogInfo($\"[SymbolLoading] Waiting for {activePdbTasks.Length} PDB downloads to complete in parallel...\");\n\n      // Track completions and report progress incrementally\n      int pdbCompletedCount = 0;\n      int pdbTotalTasks = activePdbTasks.Length;\n\n      // Start a progress monitoring task that reports progress every 500ms\n      var pdbProgressCts = new CancellationTokenSource();\n      var pdbProgressTask = Task.Run(async () => {\n        int lastReported = -1;\n        while (!pdbProgressCts.Token.IsCancellationRequested) {\n          int current = Volatile.Read(ref pdbCompletedCount);\n          if (current != lastReported) {\n            UpdateProgress(progressCallback, ProfileLoadStage.SymbolLoading, pdbTotalTasks, current, \"PDB downloads\");\n            lastReported = current;\n          }\n          try {\n            await Task.Delay(500, pdbProgressCts.Token).ConfigureAwait(false);\n          }\n          catch (OperationCanceledException) {\n            break;\n          }\n        }\n      });\n\n      // Attach completion tracking to each task\n      var pdbTrackingTasks = activePdbTasks.Select(task =>\n        task.ContinueWith(_ => Interlocked.Increment(ref pdbCompletedCount), TaskContinuationOptions.ExecuteSynchronously)\n      ).ToArray();\n\n      // Wait for all downloads to complete\n      await Task.WhenAll(activePdbTasks).ConfigureAwait(false);\n\n      // Stop progress monitoring\n      pdbProgressCts.Cancel();\n      try { await pdbProgressTask.ConfigureAwait(false); } catch { }\n\n      DiagnosticLogger.LogInfo($\"[SymbolLoading] All PDB downloads completed in {pdbSw.Elapsed.TotalSeconds:F1}s\");\n    }\n\n    // Note: Don't reset progress here - we're about to process results which is fast\n    // UpdateProgress is called per-module in the loop below\n    int pdbsFound = 0;\n    int pdbsProcessed = 0;\n\n    // Process results (tasks already completed, so this is fast)\n    for (int i = 0; i < imageLimit; i++) {\n      if (cancelableTask is {IsCanceled: true}) {\n        DiagnosticLogger.LogInfo($\"[SymbolLoading] PDB download cancelled at image {i}/{imageLimit}\");\n        return;\n      }\n\n      // Always update progress even for skipped modules\n      UpdateProgress(progressCallback, ProfileLoadStage.SymbolLoading, imageLimit, i,\n                     imageList[i].ModuleName);\n\n      if (pdbTaskList[i] != null) {\n        pdbsProcessed++;\n        var pdbTaskStart = Stopwatch.StartNew();\n        var pdbPath = await pdbTaskList[i].ConfigureAwait(false);\n        var pdbTaskDuration = pdbTaskStart.Elapsed;\n\n        // Log slow PDB lookups (> 2 seconds)\n        if (pdbTaskDuration.TotalSeconds > 2) {\n          DiagnosticLogger.LogWarning($\"[SymbolLoading] Slow PDB lookup ({pdbTaskDuration.TotalSeconds:F1}s): {imageList[i].ModuleName} - Found: {pdbPath.Found}\");\n        }\n\n        if (pdbPath.Found) {\n          pdbsFound++;\n        }\n      }\n    }\n\n    var totalPdbTime = pdbSw.Elapsed;\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] PDB download complete: {pdbsFound}/{pdbsProcessed} found in {totalPdbTime.TotalSeconds:F1}s\");\n    DiagnosticLogger.LogInfo($\"[SymbolLoading] === LoadBinaryAndDebugFiles completed in {loadStartTime.Elapsed.TotalSeconds:F1}s ===\");\n    \n    // Report completion (current=total means 100%)\n    UpdateProgress(progressCallback, ProfileLoadStage.SymbolLoading, imageLimit, imageLimit);\n    Trace.WriteLine($\"PDB download time: {totalPdbTime}\");\n  }\n\n  private async Task<ProfileModuleBuilder> CreateModuleBuilderAsync(ProfileImage image, RawProfileData rawProfile, int processId,\n                                                   SymbolFileSourceSettings symbolSettings) {\n    var totalSw = Stopwatch.StartNew();\n    var imageModule = new ProfileModuleBuilder(report_, compilerInfoProvider_);\n    IDebugInfoProvider imageDebugInfo = null;\n\n    Trace.WriteLine($\"CreateModuleBuilderAsync: Starting for module {image.ModuleName}\");\n\n    // Time spent on initial setup\n    var initSw = Stopwatch.StartNew();\n    \n    if (IsAcceptedModule(image)) {\n      imageDebugInfo = rawProfile.GetDebugInfoForManagedImage(image, processId);\n\n      if (imageDebugInfo != null) {\n        imageDebugInfo.SymbolSettings = symbolSettings;\n        Trace.WriteLine($\"CreateModuleBuilderAsync: Found managed debug info for {image.ModuleName}\");\n      }\n    }\n    \n    var initTime = initSw.Elapsed;\n\n    // Time spent on module initialization\n    var moduleInitSw = Stopwatch.StartNew();\n    Trace.WriteLine($\"CreateModuleBuilderAsync: Calling Initialize for {image.ModuleName}\");\n\n    try {\n      // LAZY BINARY LOADING: Skip binary download during trace loading.\n      // Binaries will be downloaded on-demand when user views assembly.\n      bool moduleInitialized = await imageModule.Initialize(FromProfileImage(image, rawProfile, processId), symbolSettings, imageDebugInfo, skipBinaryDownload: true).ConfigureAwait(false);\n      var moduleInitTime = moduleInitSw.Elapsed;\n      \n      Trace.WriteLine($\"CreateModuleBuilderAsync: Initialize completed for {image.ModuleName}, result: {moduleInitialized}\");\n\n      if (moduleInitialized) {\n        // If binary couldn't be found, try to initialize using\n        // the PDB signature from the trace file.\n\n        if (rejectedDebugModules_.Contains(image)) {\n#if DEBUG\n          Trace.WriteLine($\"CreateModuleBuilderAsync: Skipped rejected module {image.ModuleName}\");\n#endif\n          return imageModule;\n        }\n\n        // Time spent on debug info file lookup.\n        // Always try to find PDB - it may be cached locally from the initial download phase.\n        var debugFileSw = Stopwatch.StartNew();\n        var debugInfoFile = await GetDebugInfoFile(imageModule.ModuleDocument.BinaryFile,\n                                                   image, rawProfile, processId, symbolSettings);\n        var debugFileTime = debugFileSw.Elapsed;\n\n        // Time spent on debug info initialization\n        var debugInitSw = Stopwatch.StartNew();\n        bool debugInitialized = false;\n        if (debugInfoFile != null) {\n          Trace.WriteLine($\"CreateModuleBuilderAsync: Initializing debug info for {image.ModuleName}\");\n          debugInitialized = await imageModule.InitializeDebugInfo(debugInfoFile).ConfigureAwait(false);\n          Trace.WriteLine($\"CreateModuleBuilderAsync: Debug info initialization for {image.ModuleName}, result: {debugInitialized}\");\n        }\n        else {\n          Trace.WriteLine($\"CreateModuleBuilderAsync: No debug info file found for {image.ModuleName}\");\n        }\n        var debugInitTime = debugInitSw.Elapsed;\n\n        if (debugInfoFile != null && !debugInitialized) {\n          Trace.TraceWarning($\"CreateModuleBuilderAsync: Failed to load debug debugInfo for image: {image.FilePath}\");\n        }\n\n        var totalTime = totalSw.Elapsed;\n        \n        // Log modules that take significant time to create\n        if (totalTime.TotalMilliseconds > 100) { // Log modules taking > 100ms\n          Trace.WriteLine($\"CreateModuleBuilderAsync: Slow module creation for {image.ModuleName}: {totalTime.TotalMilliseconds:F1}ms total \" +\n                         $\"(init: {initTime.TotalMilliseconds:F1}ms, module: {moduleInitTime.TotalMilliseconds:F1}ms, \" +\n                         $\"debugFile: {debugFileTime.TotalMilliseconds:F1}ms, debugInit: {debugInitTime.TotalMilliseconds:F1}ms)\");\n        }\n      }\n      else {\n        var totalTime = totalSw.Elapsed;\n        Trace.WriteLine($\"CreateModuleBuilderAsync: Module initialization failed for {image.ModuleName} after {totalTime.TotalMilliseconds:F1}ms\");\n      }\n\n      Trace.WriteLine($\"CreateModuleBuilderAsync: Completed for module {image.ModuleName}\");\n      return imageModule;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"CreateModuleBuilderAsync: EXCEPTION for module {image.ModuleName}: {ex.GetType().Name}: {ex.Message}\");\n      Trace.WriteLine($\"CreateModuleBuilderAsync: Stack trace: {ex.StackTrace}\");\n      throw;\n    }\n  }\n\n  private async Task<DebugFileSearchResult> GetDebugInfoFile(BinaryFileSearchResult binaryFile,\n                                                 ProfileImage image, RawProfileData rawProfile, int processId,\n                                                 SymbolFileSourceSettings symbolSettings) {\n    if (binaryFile is {Found: true}) {\n      return await compilerInfoProvider_.DebugFileFinder.FindDebugInfoFileAsync(binaryFile.FilePath, symbolSettings);\n    }\n    else {\n      // Try to use ETL info if binary not available.\n      var symbolFile = rawProfile.GetDebugFileForImage(image, processId);\n\n      if (symbolFile != null) {\n        return await compilerInfoProvider_.DebugFileFinder.FindDebugInfoFileAsync(symbolFile, symbolSettings);\n      }\n    }\n\n    return null;\n  }\n\n  private bool IsAcceptedModule(ProfileImage image) {\n    if (!options_.HasBinaryNameAllowedList) {\n      Trace.WriteLine($\"BINARY_FILTER_DEBUG: Module PASSED binary name allowlist check - No allowlist defined: {image.ModuleName} (path: {image.FilePath})\");\n      return true;\n    }\n\n    Trace.WriteLine($\"BINARY_FILTER_DEBUG: Checking binary name allowlist for module: {image.ModuleName} (path: {image.FilePath})\");\n    Trace.WriteLine($\"BINARY_FILTER_DEBUG: Binary name allowlist contents: [{string.Join(\", \", options_.BinaryNameAllowedList)}]\");\n\n    foreach (string file in options_.BinaryNameAllowedList) {\n      string fileName = Utilities.Utils.TryGetFileNameWithoutExtension(file);\n      Trace.WriteLine($\"BINARY_FILTER_DEBUG: Comparing '{image.ModuleName}' against allowlist entry '{fileName}' (original: '{file}')\");\n\n      if (fileName.Equals(image.ModuleName, StringComparison.OrdinalIgnoreCase)) {\n        Trace.WriteLine($\"BINARY_FILTER_DEBUG: Module PASSED binary name allowlist check - Matched '{fileName}': {image.ModuleName}\");\n        return true;\n      }\n    }\n\n    Trace.WriteLine($\"BINARY_FILTER_DEBUG: Module FAILED binary name allowlist check - Not found in allowlist: {image.ModuleName} (path: {image.FilePath})\");\n    return false;\n  }\n\n  private async Task<ProfileModuleBuilder> GetModuleBuilderAsync(RawProfileData rawProfile, ProfileImage queryImage, int processId,\n                                                SymbolFileSourceSettings symbolSettings) {\n    // prevImage_/prevModule_ are TLS variables since this is called from multiple threads.\n    if (queryImage == prevImage_) {\n      return prevProfileModuleBuilder_;\n    }\n\n    if (!imageModuleMap_.TryGetValue(queryImage.Id, out var imageModule)) {\n      // TODO: Why not lock on queryImage?\n      lock (imageLocks_[queryImage.Id % IMAGE_LOCK_COUNT]) {\n        if (imageModuleMap_.TryGetValue(queryImage.Id, out imageModule)) {\n          prevImage_ = queryImage;\n          prevProfileModuleBuilder_ = imageModule;\n          return imageModule;\n        }\n      }\n\n      // Create the module builder outside the lock to avoid blocking other threads\n      imageModule = await CreateModuleBuilderAsync(queryImage, rawProfile, processId, symbolSettings).ConfigureAwait(false);\n\n      // Add to the cache. If another thread already added a module, use that one instead\n      // to ensure all threads share the same (hopefully initialized) instance.\n      if (!imageModuleMap_.TryAdd(queryImage.Id, imageModule)) {\n        // Another thread won the race - use their module instead\n        imageModule = imageModuleMap_[queryImage.Id];\n      }\n    }\n\n    prevImage_ = queryImage;\n    prevProfileModuleBuilder_ = imageModule;\n    return imageModule;\n  }\n\n  private ProfileModuleBuilder GetModuleBuilder(RawProfileData rawProfile, ProfileImage queryImage, int processId,\n                                                SymbolFileSourceSettings symbolSettings) {\n    // prevImage_/prevModule_ are TLS variables since this is called from multiple threads.\n    if (queryImage == prevImage_) {\n      return prevProfileModuleBuilder_;\n    }\n\n    if (!imageModuleMap_.TryGetValue(queryImage.Id, out var imageModule)) {\n      // TODO: Why not lock on queryImage?\n      lock (imageLocks_[queryImage.Id % IMAGE_LOCK_COUNT]) {\n        if (imageModuleMap_.TryGetValue(queryImage.Id, out imageModule)) {\n          return imageModule;\n        }\n\n        // Fall back to sync version with deadlock risk - this is for compatibility\n        imageModule = CreateModuleBuilderAsync(queryImage, rawProfile, processId, symbolSettings).ConfigureAwait(false).GetAwaiter().GetResult();\n        imageModuleMap_.TryAdd(queryImage.Id, imageModule);\n      }\n    }\n\n    prevImage_ = queryImage;\n    prevProfileModuleBuilder_ = imageModule;\n    return imageModule;\n  }\n\n  private void ProcessPerformanceCounters(RawProfileData rawProfile, List<int> processIds,\n                                          SymbolFileSourceSettings symbolSettings,\n                                          ProfileLoadProgressHandler progressCallback,\n                                          CancelableTask cancelableTask) {\n    // Register the counters found in the trace.\n    foreach (var counter in rawProfile.PerformanceCounters) {\n      profileData_.RegisterPerformanceCounter(counter);\n    }\n\n    // Try to register the metrics.\n    int metricIndex = 1000;\n    int index = 0;\n\n    foreach (var metric in options_.PerformanceMetrics) {\n      if (metric.IsEnabled) {\n        profileData_.RegisterPerformanceMetric(metricIndex++, metric);\n      }\n    }\n\n    //? TODO: Parallel\n    //? TODO: Use ref foreach\n    currentSampleIndex_ = 0;\n    Trace.WriteLine($\"Start process PMC at {DateTime.Now}\");\n    var sw = Stopwatch.StartNew();\n\n    foreach (var counter in rawProfile.PerformanceCountersEvents) {\n      if ((++index & PROGRESS_UPDATE_INTERVAL - 1) == 0) { // Update progress every 128K samples.\n        if (cancelableTask is {IsCanceled: true}) {\n          break;\n        }\n\n        UpdateProgress(progressCallback, ProfileLoadStage.PerfCounterProcessing,\n                       rawProfile.PerformanceCountersEvents.Count, index);\n      }\n\n      var context = counter.GetContext(rawProfile);\n\n      if (!processIds.Contains(context.ProcessId)) {\n        continue;\n      }\n\n      int managedBaseAddress = 0;\n      var frameImage = rawProfile.FindImageForIP(counter.IP, context);\n\n      if (frameImage == null) {\n        if (rawProfile.HasManagedMethods(context.ProcessId)) {\n          var managedFunc = rawProfile.FindManagedMethodForIP(counter.IP, context.ProcessId);\n\n          if (managedFunc != null) {\n            frameImage = managedFunc.Image;\n            managedBaseAddress = 1;\n          }\n        }\n\n        // If real module and managed method lookup both fail, attribute to synthetic \"Unknown\" to preserve counts\n        if (frameImage == null) {\n          frameImage = GetUnknownModule(context.ProcessId)?.Image;\n        }\n      }\n\n      if (frameImage != null) {\n        profileData_.AddModuleCounter(frameImage.ModuleName, counter.CounterId, 1);\n        var profileModuleBuilder = GetModuleBuilder(rawProfile, frameImage, context.ProcessId, symbolSettings);\n\n        if (profileModuleBuilder == null) {\n          continue;\n        }\n\n        if (!profileModuleBuilder.HasDebugInfo) {\n          continue;\n        }\n\n        long frameRva = managedBaseAddress != 0 ?\n          counter.IP : counter.IP - frameImage.BaseAddress;\n\n        var funcPair = profileModuleBuilder.GetOrCreateFunction(frameRva);\n        long funcRva = funcPair.DebugInfo.RVA;\n        long offset = frameRva - funcRva;\n\n        var profile = profileData_.GetOrCreateFunctionProfile(funcPair.Function, funcPair.DebugInfo);\n        profile.AddCounterSample(offset, counter.CounterId, 1);\n      }\n\n      // profileData_.Events.Add((counter, null));\n    }\n\n    Trace.WriteLine($\"Done process PMC in {sw.Elapsed}\");\n  }\n\n  private BinaryFileDescriptor FromProfileImage(ProfileImage image, RawProfileData rawProfile, int processId) {\n    // Architecture detection: Use process's IsWow64 flag from ETW ProcessStart events.\n    // ProcessFlags.Wow64 indicates a 32-bit process running on 64-bit Windows.\n    var architecture = defaultArchitecture_;\n\n    // For kernel modules, use OS architecture (kernel is always native)\n    if (!ETWEventProcessor.IsKernelAddress((ulong)image.BaseAddress, rawProfile.TraceInfo.PointerSize)) {\n      // User-mode module: check if the process is WoW64 (32-bit on 64-bit)\n      var process = rawProfile.FindProcess(processId);\n      if (process != null && process.IsWow64) {\n        architecture = Machine.I386;\n      }\n    }\n\n    return new BinaryFileDescriptor {\n      ImageName = image.ModuleName,\n      ImagePath = image.FilePath,\n      Architecture = architecture,\n      Checksum = image.Checksum,\n      TimeStamp = image.TimeStamp,\n      ImageSize = image.Size\n    };\n  }\n\n  /// <summary>\n  /// Performs a \"bellwether\" test by attempting to download the ntoskrnl PDB (the Windows kernel symbols).\n  /// If this fails, it indicates the symbol server is unavailable or slow, and we should\n  /// reduce timeouts to avoid wasting time on failed downloads.\n  /// </summary>\n  private async Task PerformBellwetherTest(List<ProfileImage> imageList, RawProfileData rawProfile, SymbolFileSourceSettings symbolSettings) {\n    // Find ntoskrnl.exe in the image list - it's always present in ETW traces\n    var bellwetherImage = imageList.FirstOrDefault(img =>\n      img.ModuleName.Equals(\"ntoskrnl.exe\", StringComparison.OrdinalIgnoreCase));\n\n    if (bellwetherImage == null) {\n      // Try ntdll.dll as fallback\n      bellwetherImage = imageList.FirstOrDefault(img =>\n        img.ModuleName.Equals(\"ntdll.dll\", StringComparison.OrdinalIgnoreCase));\n    }\n\n    if (bellwetherImage == null) {\n      DiagnosticLogger.LogInfo(\"[BellwetherTest] No bellwether image found (ntoskrnl.exe or ntdll.dll), skipping test\");\n      return;\n    }\n\n    // Get the PDB info for the bellwether image from the trace's ImageID DbgID events.\n    // ntoskrnl is a kernel module, so use KernelProcessId.\n    var symbolFile = rawProfile.GetDebugFileForImage(bellwetherImage, ETWEventProcessor.KernelProcessId);\n\n    if (symbolFile == null) {\n      DiagnosticLogger.LogWarning($\"[BellwetherTest] No PDB info (ImageID DbgID event) for {bellwetherImage.ModuleName}, skipping test\");\n      return;\n    }\n\n    var sw = Stopwatch.StartNew();\n    // Use EffectiveTimeoutSeconds which is PreAuthTimeoutSeconds (10 min) until auth is validated.\n    // This allows time for the user to interact with the auth dialog without timing out.\n    int timeoutSeconds = symbolSettings.EffectiveTimeoutSeconds;\n\n    // Log symbol server configuration\n    DiagnosticLogger.LogInfo($\"[BellwetherTest] Symbol paths configured: {string.Join(\"; \", symbolSettings.SymbolPaths)}\");\n    DiagnosticLogger.LogInfo($\"[BellwetherTest] Testing symbol server health with {symbolFile.FileName} PDB (timeout: {timeoutSeconds}s, pre-auth: {!symbolSettings.HadFirstSuccessfulNetworkRequest})\");\n    DiagnosticLogger.LogInfo($\"[BellwetherTest] PDB GUID: {symbolFile.Id}, Age: {symbolFile.Age}\");\n\n    try {\n      using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(timeoutSeconds));\n\n      // Run the synchronous PDB lookup in a background task with timeout\n      var downloadTask = Task.Run(() => PDBDebugInfoProvider.LocateDebugInfoFile(symbolFile, symbolSettings), cts.Token);\n      var timeoutTask = Task.Delay(Timeout.Infinite, cts.Token);\n\n      var completedTask = await Task.WhenAny(downloadTask, timeoutTask).ConfigureAwait(false);\n\n      if (completedTask == downloadTask) {\n        var result = await downloadTask.ConfigureAwait(false);\n        var elapsedMs = sw.ElapsedMilliseconds;\n\n        if (result.Found) {\n          // Check if this was a cache hit (very fast response, < 500ms)\n          // A real network download would take longer\n          bool likelyCacheHit = elapsedMs < 500;\n          string cacheNote = likelyCacheHit ? \" (likely from local cache - not a true network test)\" : \"\";\n\n          DiagnosticLogger.LogInfo($\"[BellwetherTest] SUCCESS: {symbolFile.FileName} PDB found at {result.FilePath} in {sw.Elapsed.TotalSeconds:F1}s{cacheNote}\");\n\n          if (likelyCacheHit) {\n            // Cache hit doesn't prove network works - the first REAL network request will be the true bellwether\n            DiagnosticLogger.LogInfo(\"[BellwetherTest] Fast response suggests local cache hit. Network connectivity not verified.\");\n            DiagnosticLogger.LogInfo(\"[BellwetherTest] First real network request will determine timeout strategy.\");\n            // Don't change any flags - first real network request will set HadFirstTimeout or HadFirstSuccessfulNetworkRequest\n          }\n          else {\n            // Actual network download succeeded - THIS is the real bellwether, network is verified\n            DiagnosticLogger.LogInfo(\"[BellwetherTest] Network download verified (took real network time). Symbol server is healthy.\");\n            symbolSettings.HadFirstSuccessfulNetworkRequest = true;\n          }\n          symbolSettings.SymbolServerDegraded = false;\n        }\n        else {\n          // PDB not found on symbol server - this is expected for some builds\n          // Mark as degraded so we use shorter timeouts for other PDBs\n          DiagnosticLogger.LogWarning($\"[BellwetherTest] FAILED: {symbolFile.FileName} PDB not found on symbol server ({sw.Elapsed.TotalSeconds:F1}s) - \" +\n                                      $\"Symbols may not be available for this build. Using reduced timeout ({symbolSettings.DegradedTimeoutSeconds}s)\");\n          symbolSettings.SymbolServerDegraded = true;\n        }\n      }\n      else {\n        // Timeout - symbol server is slow or unreachable\n        DiagnosticLogger.LogWarning($\"[BellwetherTest] TIMEOUT: {symbolFile.FileName} PDB timed out after {timeoutSeconds}s - \" +\n                                    $\"Symbol server may be slow or unreachable. Using reduced timeout ({symbolSettings.DegradedTimeoutSeconds}s)\");\n        symbolSettings.SymbolServerDegraded = true;\n      }\n    }\n    catch (OperationCanceledException) {\n      DiagnosticLogger.LogWarning($\"[BellwetherTest] TIMEOUT: {symbolFile.FileName} PDB timed out after {timeoutSeconds}s - Using reduced timeout\");\n      symbolSettings.SymbolServerDegraded = true;\n    }\n    catch (Exception ex) {\n      DiagnosticLogger.LogWarning($\"[BellwetherTest] ERROR: {symbolFile.FileName} PDB failed with exception: {ex.Message} - Using reduced timeout\");\n      symbolSettings.SymbolServerDegraded = true;\n    }\n\n    if (symbolSettings.SymbolServerDegraded) {\n      DiagnosticLogger.LogWarning($\"[BellwetherTest] Symbol server marked as DEGRADED - using {symbolSettings.DegradedTimeoutSeconds}s timeout instead of {symbolSettings.SymbolServerTimeoutSeconds}s\");\n    }\n    else {\n      DiagnosticLogger.LogInfo($\"[BellwetherTest] Using initial timeout: {symbolSettings.EffectiveTimeoutSeconds}s (will reduce to {symbolSettings.SymbolServerTimeoutSeconds}s after first timeout)\");\n    }\n  }\n\n#if DEBUG\n  private void RecordSampleStatistics(ResolvedProfileStack resolvedStack) {\n    // Record statistics about the most common RVAs with exclusive samples.\n    if (resolvedStack.FrameCount <= 0) return;\n\n    lock (lockObject_) {\n      perModuleSampleStatsMap_ ??= new();\n      var topFrame = resolvedStack.StackFrames[0];\n\n      if (topFrame.FrameDetails.Image == null) {\n        return;\n      }\n\n      var moduleStats = perModuleSampleStatsMap_.GetOrAddValue(topFrame.FrameDetails.Image);\n\n      if (!moduleStats.TryGetValue(topFrame.FrameRVA, out var rvaStats)) {\n        rvaStats = (topFrame.FrameDetails.DebugInfo, 1);\n        moduleStats[topFrame.FrameRVA] = rvaStats;\n      }\n      else {\n        rvaStats.SampleCount++;\n        moduleStats[topFrame.FrameRVA] = rvaStats;\n      }\n    }\n  }\n\n  private void PrintSampleStatistics() {\n    lock (lockObject_) {\n      if (perModuleSampleStatsMap_ == null) {\n        return;\n      }\n\n      Trace.WriteLine(\"Per-module RVA sample stats\");\n\n      foreach (var moduleStats in perModuleSampleStatsMap_) {\n        Trace.WriteLine($\"--------------\\n{moduleStats.Key.ModuleName}:\");\n        var rvaStats = moduleStats.Value.ToList();\n        rvaStats.Sort((a, b) => b.Item2.SampleCount.CompareTo(a.Item2.SampleCount));\n\n        foreach (var (rva, sampleStats) in rvaStats) {\n          Trace.WriteLine($\" - RVA {rva:X}: {sampleStats.SampleCount} samples, func: {sampleStats.Info.Name}\");\n        }\n      }\n    }\n  }\n#endif\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/ETW/ETWRecordingSession.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing Microsoft.Diagnostics.NETCore.Client;\nusing Microsoft.Diagnostics.Tracing;\nusing Microsoft.Diagnostics.Tracing.Parsers;\nusing Microsoft.Diagnostics.Tracing.Parsers.Clr;\nusing Microsoft.Diagnostics.Tracing.Session;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Utils;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.ETW;\n\npublic sealed class ETWRecordingSession : IDisposable {\n  private static readonly string ProfilerPath = \"ProfileExplorerProfiler.dll\";\n  private static readonly string ProfilerGuid = \"{805A308B-061C-47F3-9B30-F785C3186E81}\";\n  private TraceEventSession session_;\n  private DiagnosticsClient diagClient_;\n  private ProfilerNamedPipeServer pipeServer_;\n  private ProfileRecordingSessionOptions options_;\n  private ProfileDataProviderOptions providerOptions_;\n  private ProfileLoadProgressHandler progressCallback_;\n  private DateTime lastEventTime_;\n  private string sessionName_;\n  private string profilerPath_;\n\n  public ETWRecordingSession(ProfileDataProviderOptions providerOptions,\n                             string sessionName = null) {\n    Debug.Assert(!RequiresElevation);\n    options_ = providerOptions.RecordingSessionOptions;\n    providerOptions_ = providerOptions;\n\n    if (options_.RecordPerformanceCounters) {\n      // To record CPU perf. counters, a kernel session is needed.\n      sessionName_ = KernelTraceEventParser.KernelSessionName;\n    }\n    else {\n      sessionName_ = sessionName ?? $\"PEX-ETW-{Guid.NewGuid()}\";\n    }\n  }\n\n  public static bool RequiresElevation => TraceEventSession.IsElevated() != true;\n\n  public static List<PerformanceCounterConfig> BuiltinPerformanceCounters {\n    get {\n      var list = new List<PerformanceCounterConfig>();\n\n      try {\n        var counters = TraceEventProfileSources.GetInfo();\n\n        foreach (var counter in counters) {\n          // Filter out the Timer.\n          if (counter.Value.ID == 0) {\n            continue;\n          }\n\n          list.Add(new PerformanceCounterConfig(counter.Value.ID, counter.Value.Name,\n                                                counter.Value.Interval,\n                                                counter.Value.MinInterval,\n                                                counter.Value.MaxInterval, true));\n        }\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to get CPU perf counters: {ex.Message}\");\n      }\n\n      return list;\n    }\n  }\n\n  public static List<PerformanceMetricConfig> BuiltinPerformanceMetrics {\n    get {\n      //? TODO: Configurable list\n      var list = new List<PerformanceMetricConfig>();\n      list.Add(new PerformanceMetricConfig(\"DCacheMiss\", \"DcacheAccesses\", \"DcacheMisses\", true,\n                                           \"Data cache miss percentage\"));\n      list.Add(\n        new PerformanceMetricConfig(\"ICacheMiss\", \"ICFetch\", \"ICMiss\", true, \"Instruction cache miss percentage\"));\n      list.Add(new PerformanceMetricConfig(\"MispredBr\", \"BranchInstructions\", \"BranchMispredictions\", true,\n                                           \"Branch misprediction percentage\"));\n      list.Add(new PerformanceMetricConfig(\"CPI\", \"InstructionRetired\", \"UnhaltedCoreCycles\", false,\n                                           \"Clockticks per Instructions retired rate\"));\n      return list;\n    }\n  }\n\n  public void Dispose() {\n    StopSession();\n  }\n\n  public Task<RawProfileData> StartRecording(ProfileLoadProgressHandler progressCallback,\n                                             CancelableTask cancelableTask) {\n    int acceptedProcessId = 0;\n    Process profiledProcess = null;\n    WindowsThreadSuspender threadSuspender = null;\n    var sessionStarted = new ManualResetEvent(false);\n\n    // The entire ETW processing must be done on the same thread.\n    // Start a task that runs the ETW session and captures the events.\n    RawProfileData profile = null;\n\n    var eventTask = Task.Run(() => {\n      try {\n        if (!CreateSession(cancelableTask)) {\n          return null;\n        }\n\n        // Start the profiled application.\n        switch (options_.SessionKind) {\n          case ProfileSessionKind.StartProcess: {\n            (profiledProcess, acceptedProcessId) = StartProfiledApplication();\n\n            if (profiledProcess == null) {\n              sessionStarted.Set(); // Unblock waiting task below.\n              return null;\n            }\n\n            // Start task that waits for the process to exit,\n            // which will stop the ETW session.\n            CreateApplicationExitTask(profiledProcess, cancelableTask);\n\n            // Suspend the application before the session starts,\n            // then resume it once everything is set up.\n            try {\n              threadSuspender = new WindowsThreadSuspender(acceptedProcessId);\n            }\n            catch (Exception ex) {\n              Trace.TraceError(\n                $\"Failed to suspend application threads {options_.ApplicationPath}: {ex.Message}\\n{ex.StackTrace}\");\n            }\n\n            break;\n          }\n          case ProfileSessionKind.SystemWide: {\n            // ETW sessions are system-wide by default.\n            break;\n          }\n          case ProfileSessionKind.AttachToProcess: {\n            try {\n              profiledProcess = Process.GetProcessById(acceptedProcessId);\n              acceptedProcessId = options_.TargetProcessId;\n            }\n            catch (Exception ex) {\n              Trace.WriteLine($\"Failed to attach to process {options_.TargetProcessId}\");\n              StopSession();\n              return null;\n            }\n\n            if (options_.ProfileDotNet && options_.RecordDotNetAssembly) {\n              if (!AttachProfiler(acceptedProcessId)) {\n                StopSession();\n                return null;\n              }\n            }\n\n            // Start task that waits for the process to exit,\n            // which will stop the ETW session.\n\n            //? TODO: Doesns't work for attached process!\n            CreateApplicationExitTask(profiledProcess, cancelableTask);\n            break;\n          }\n          default: {\n            throw new NotImplementedException();\n          }\n        }\n\n        var capturedEvents = KernelTraceEventParser.Keywords.ImageLoad |\n                             KernelTraceEventParser.Keywords.Process |\n                             KernelTraceEventParser.Keywords.Thread |\n                             //KernelTraceEventParser.Keywords.ContextSwitch |\n                             //KernelTraceEventParser.Keywords.DiskIO |\n                             //KernelTraceEventParser.Keywords.DiskFileIO |\n                             //KernelTraceEventParser.Keywords.DiskIOInit |\n                             //KernelTraceEventParser.Keywords.FileIO |\n                             //KernelTraceEventParser.Keywords.FileIOInit |\n                             KernelTraceEventParser.Keywords.Profile;\n\n        if (options_.RecordPerformanceCounters && options_.PerformanceCounters.Count > 0) {\n          // Enable the CPU perf. counters to collect.\n          capturedEvents |= KernelTraceEventParser.Keywords.PMCProfile;\n          EnablePerformanceCounters();\n          session_.EnableKernelProvider(capturedEvents, capturedEvents); // With stack sampling.\n        }\n        else {\n          session_.EnableKernelProvider(capturedEvents, capturedEvents); // With stack sampling.\n          session_.EnableProvider(SymbolTraceEventParser.ProviderGuid);\n        }\n\n        if (options_.ProfileDotNet) {\n          session_.EnableProvider(\n            ClrTraceEventParser.ProviderGuid,\n            TraceEventLevel.Verbose,\n            (ulong)(ClrTraceEventParser.Keywords.Jit |\n                    ClrTraceEventParser.Keywords.JittedMethodILToNativeMap |\n                    ClrTraceEventParser.Keywords.GC |\n                    ClrTraceEventParser.Keywords.Loader));\n\n          if (options_.SessionKind == ProfileSessionKind.AttachToProcess) {\n            // Needed when attaching to a running .net app.\n            Trace.WriteLine(\"Enable ClrRundownTraceEventParser\");\n\n            session_.EnableProvider(\n              ClrRundownTraceEventParser.ProviderGuid,\n              TraceEventLevel.Verbose,\n              (ulong)(ClrRundownTraceEventParser.Keywords.Jit |\n                      ClrRundownTraceEventParser.Keywords.JittedMethodILToNativeMap |\n                      ClrRundownTraceEventParser.Keywords.Loader |\n                      ClrRundownTraceEventParser.Keywords.StartEnumeration));\n          }\n        }\n\n        // Start the ETW session.\n        using var eventProcessor =\n          new ETWEventProcessor(session_.Source, providerOptions_,\n                                true, acceptedProcessId,\n                                options_.ProfileChildProcesses,\n                                options_.ProfileDotNet, pipeServer_);\n\n        sessionStarted.Set();\n        progressCallback_ = progressCallback;\n        lastEventTime_ = DateTime.MinValue;\n        return eventProcessor.ProcessEvents(SessionProgressHandler, cancelableTask);\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed ETW event capture: {ex.Message}\\n{ex.StackTrace}\");\n        threadSuspender?.Dispose(); // This resume all profiled app threads.\n        sessionStarted.Set(); // Unblock waiting task below.\n        return null;\n      }\n      finally {\n        StopSession();\n        profiledProcess?.Dispose();\n        profiledProcess = null;\n      }\n    });\n\n    // Start a task that waits for the ETW session task to complete.\n    return Task.Run(() => {\n      try {\n        // Wait until the ETW session task starts.\n        while (!cancelableTask.IsCanceled &&\n               !sessionStarted.WaitOne(100)) { }\n\n        // Resume all profiled app threads and start waiting for it to close,\n        // then wait for ETW session to complete.\n        threadSuspender?.Dispose();\n        profile = eventTask.Result;\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed ETW event capture: {ex.Message}\\n{ex.StackTrace}\");\n        threadSuspender?.Dispose(); // This resume all profiled app threads.\n      }\n      finally {\n        StopSession();\n        profiledProcess?.Dispose();\n        profiledProcess = null;\n      }\n\n      return profile;\n    });\n  }\n\n  private void SessionProgressHandler(ProfileLoadProgress info) {\n    // Record the last time samples were processed, this is used in\n    // CreateApplicationExitTask to keep the ETW session running after the app exits,\n    // but ETW events for the app are still incoming.\n    lastEventTime_ = DateTime.UtcNow;\n    progressCallback_?.Invoke(info);\n  }\n\n  private void EnablePerformanceCounters() {\n    var enabledCounters = options_.EnabledPerformanceCounters;\n\n    if (enabledCounters.Count == 0) {\n      return;\n    }\n\n    int[] counterIds = new int[enabledCounters.Count];\n    int[] frequencyCounts = new int[enabledCounters.Count];\n    int index = 0;\n\n    foreach (var counter in enabledCounters) {\n      counterIds[index] = counter.Id;\n      frequencyCounts[index] = counter.Interval;\n      index++;\n      Trace.WriteLine($\"Enabling counter {counter.Name}\");\n    }\n\n    TraceEventProfileSources.Set(counterIds, frequencyCounts);\n  }\n\n  private bool CreateSession(CancelableTask cancelableTask) {\n    if (options_.ProfileDotNet) {\n      profilerPath_ = Path.Combine(AppContext.BaseDirectory, ProfilerPath);\n\n      if (options_.RecordDotNetAssembly) {\n        try {\n          Trace.WriteLine(\"Start .NET profiler named pipe server\");\n          pipeServer_ = new ProfilerNamedPipeServer();\n        }\n        catch (Exception ex) {\n          Trace.TraceError($\"Failed to start named pipe: {ex.Message}\\n{ex.StackTrace}\");\n          StopSession();\n          return false;\n        }\n      }\n    }\n\n    // Start a new in-memory session.\n    try {\n      Debug.Assert(session_ == null);\n      session_ = new TraceEventSession(sessionName_);\n      session_.BufferSizeMB = Math.Max(session_.BufferSizeMB, 128);\n      session_.CpuSampleIntervalMSec = 1000.0f / options_.SamplingFrequency;\n\n      Trace.WriteLine(\"Started ETW session:\");\n      Trace.WriteLine($\"   Buffer size: {session_.BufferSizeMB} MB\");\n      Trace.WriteLine($\"   Sampling freq: {session_.CpuSampleIntervalMSec} ms / {options_.SamplingFrequency}\");\n      Trace.Flush();\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to start ETW capture session: {ex.Message}\\n{ex.StackTrace}\");\n      StopSession();\n      return false;\n    }\n  }\n\n  private (Process, int) StartProfiledApplication() {\n    try {\n      var procInfo = new ProcessStartInfo(options_.ApplicationPath) {\n        Arguments = options_.ApplicationArguments,\n        WorkingDirectory = options_.HasWorkingDirectory ?\n          options_.WorkingDirectory :\n          Utilities.Utils.TryGetDirectoryName(options_.ApplicationPath),\n        //? The Process object must have the UseShellExecute property set to false in order to use environment variables\n        //UseShellExecute = true,\n        Verb = \"runas\"\n        //RedirectStandardError = false,\n        //RedirectStandardOutput = true\n      };\n\n      if (options_.ProfileDotNet && options_.RecordDotNetAssembly) {\n        if (!SetupStartupDotNetProfiler(procInfo)) {\n          Trace.TraceError(\"Failed to setup managed profiler\");\n          return (null, 0);\n        }\n      }\n\n      if (options_.EnableEnvironmentVars) {\n        foreach (var pair in options_.EnvironmentVariables) {\n          procInfo.EnvironmentVariables[pair.Value] = pair.Variable;\n        }\n      }\n\n      var process = new Process {StartInfo = procInfo, EnableRaisingEvents = true};\n      process.Start();\n\n      Trace.WriteLine($\"Started process {options_.ApplicationPath}\");\n      return (process, process.Id);\n    }\n    catch (Exception ex) {\n      Trace.TraceError(\n        $\"Failed to start profiled application {options_.ApplicationPath}: {ex.Message}\\n{ex.StackTrace}\");\n    }\n\n    return (null, 0);\n  }\n\n  private bool SetupStartupDotNetProfiler(ProcessStartInfo procInfo) {\n    procInfo.EnvironmentVariables[\"CORECLR_ENABLE_PROFILING\"] = \"1\";\n    procInfo.EnvironmentVariables[\"CORECLR_PROFILER\"] = ProfilerGuid;\n    procInfo.EnvironmentVariables[\"CORECLR_PROFILER_PATH\"] = profilerPath_;\n    Trace.WriteLine($\"Using managed profiler {profilerPath_}\");\n    return true;\n  }\n\n  private bool AttachProfiler(int processId) {\n    try {\n      Trace.WriteLine($\"Attaching managed profiler to proc {processId}: {profilerPath_}\");\n      byte[] profilerArgs = Array.Empty<byte>();\n      diagClient_ = new DiagnosticsClient(processId);\n      diagClient_.AttachProfiler(TimeSpan.FromSeconds(10),\n                                 Guid.Parse(ProfilerGuid), profilerPath_, profilerArgs);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to attach profiler to process {processId}: {ex.Message}\");\n      return false;\n    }\n\n    return true;\n  }\n\n  private void DetachProfiler() {\n    if (pipeServer_ == null) {\n      return;\n    }\n\n    // Request .NET profiler detach.\n    pipeServer_.EndSession();\n    pipeServer_.Stop();\n    pipeServer_ = null;\n    diagClient_ = null;\n  }\n\n  private void CreateApplicationExitTask(Process process, CancelableTask task) {\n    Task.Run(() => {\n      try {\n        while (!task.IsCanceled && !task.IsCompleted) {\n          if (process.WaitForExit(100)) {\n            break;\n          }\n        }\n\n        // Once the app exits, wait until no more ETW events are arriving\n        // to be processed, then stop the session.\n        int waitCount = 0;\n\n        while (!task.IsCanceled) {\n          // If no events arrived yet at all, wait a while longer.\n          if (lastEventTime_ == DateTime.MinValue) {\n            Thread.Sleep(500);\n\n            if (waitCount++ > 10) break;\n          }\n          else {\n            var timeSinceLastSample = DateTime.UtcNow - lastEventTime_;\n\n            if (timeSinceLastSample.TotalMilliseconds > 1000) {\n              break;\n            }\n\n            Thread.Sleep(100);\n          }\n        }\n\n        StopSession();\n      }\n      catch (Exception ex) {\n        Trace.TraceError(\n          $\"Failed to wait for profiled application exit {options_.ApplicationPath}: {ex.Message}\\n{ex.StackTrace}\");\n      }\n    });\n  }\n\n  private void StopSession() {\n    if (session_ != null) {\n      try {\n        session_.Stop();\n        session_.Dispose();\n\n        // Stop profiler named pipe after no more write requests are made.\n        DetachProfiler();\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to stop ETW session: {ex.Message}\");\n      }\n\n      session_ = null;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/ETW/ProfilerNamedPipeServer.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\nusing ProfileExplorer.Core.Profile.Utils;\n\nnamespace ProfileExplorer.Core.Profile.ETW;\n\npublic class ProfilerNamedPipeServer : IDisposable {\n  public delegate void FunctionCallTargetsReceivedDelegate(long functionId, int rejitId, int processId, long address,\n                                                           string name);\n\n  public delegate void FunctionCodeReceivedDelegate(long functionId, int rejitId, int processId, long address,\n                                                    int codeSize, byte[] codeBytes);\n\n  public const string PipeName = \"PEXProfilerPipe\";\n  private NamedPipeServer instance_;\n\n  public ProfilerNamedPipeServer() {\n    instance_ = new NamedPipeServer(PipeName);\n  }\n\n  public void Dispose() {\n    if (instance_ != null) {\n      Stop();\n    }\n  }\n\n  public event FunctionCodeReceivedDelegate FunctionCodeReceived;\n  public event FunctionCallTargetsReceivedDelegate FunctionCallTargetsReceived;\n\n  public bool StartReceiving(CancellationToken cancellationToken) {\n    try {\n      Trace.WriteLine(\"Start pipe reading thread\");\n\n      instance_.ReceiveMessages((header, body) => {\n        if (cancellationToken.IsCancellationRequested) {\n          Trace.WriteLine($\"Canceled {Environment.CurrentManagedThreadId}\");\n          return;\n        }\n\n        switch ((MessageKind)header.Kind) {\n          case MessageKind.FunctionCode: {\n            var message = MemoryMarshal.Cast<byte, FunctionCodeMessage>(body)[0];\n            byte[] code = body.AsSpan().Slice(28, message.CodeSize).ToArray();\n            FunctionCodeReceived?.Invoke(message.FunctionId, message.ReJITId, message.ProcessId,\n                                         message.Address, message.CodeSize, code);\n            break;\n          }\n          case MessageKind.FunctionCallTarget: {\n            var message = MemoryMarshal.Cast<byte, FunctionCallTargetMessage>(body)[0];\n            var nameBytes = body.AsSpan().Slice(28, message.NameLength);\n\n            // Don't include the null terminator.\n            if (nameBytes[^1] == 0) {\n              nameBytes = nameBytes.Slice(0, nameBytes.Length - 1);\n            }\n\n            string name = Encoding.UTF8.GetString(nameBytes);\n            FunctionCallTargetsReceived?.Invoke(message.FunctionId, message.ReJITId, message.ProcessId,\n                                                message.Address, name);\n            break;\n          }\n        }\n      }, cancellationToken);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to receive messages: {ex}\");\n      return false;\n    }\n  }\n\n  public bool EndSession() {\n    try {\n      instance_.SendMessage((int)MessageKind.EndSession);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to send message: {ex}\");\n      return false;\n    }\n  }\n\n  public bool RequestFunctionCode(long address, long functionId, int rejitId, int processId) {\n    try {\n      var message = new RequestFunctionCodeMessage {\n        FunctionId = functionId,\n        ReJITId = rejitId,\n        Address = address,\n        ProcessId = processId\n      };\n\n      instance_.SendMessage((int)MessageKind.RequestFunctionCode, message);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to send message: {ex}\");\n      return false;\n    }\n  }\n\n  public void Stop() {\n    instance_.Dispose();\n    instance_ = null;\n  }\n\n  private enum MessageKind {\n    StartSession,\n    EndSession,\n    FunctionCode,\n    FunctionCallTarget,\n    RequestFunctionCode\n  }\n\n  [StructLayout(LayoutKind.Sequential, Pack = 1)]\n  private struct FunctionCodeMessage {\n    public long FunctionId; // 0\n    public long Address; // 8\n    public int ReJITId; // 16\n    public int ProcessId; // 20\n    public int CodeSize; // 24\n    // Code bytes start here at offset 28.\n  }\n\n  [StructLayout(LayoutKind.Sequential, Pack = 1)]\n  private struct FunctionCallTargetMessage {\n    public long FunctionId; // 0\n    public long Address; // 8\n    public int ReJITId; // 16\n    public int ProcessId; // 20\n    public int NameLength; // 20\n    // UTF-8 name bytes start here at offset 28.\n  }\n\n  [StructLayout(LayoutKind.Sequential, Pack = 1)]\n  private struct RequestFunctionCodeMessage {\n    public long FunctionId; // 0\n    public long Address; // 8\n    public int ReJITId; // 16\n    public int ProcessId; // 20\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Processing/CallTreeProcessor.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.Core.Profile.Processing;\n\npublic sealed class CallTreeProcessor : ProfileSampleProcessor {\n  private List<ProfileCallTree> chunks_;\n  private int maxChunks_;\n\n  public CallTreeProcessor(int maxChunks) {\n    chunks_ = new List<ProfileCallTree>();\n    maxChunks_ = maxChunks;\n  }\n\n  public ProfileCallTree CallTree { get; set; } = new();\n\n  public static ProfileCallTree Compute(ProfileData profile, ProfileSampleFilter filter,\n                                        int maxChunks = int.MaxValue) {\n    var funcProcessor = new CallTreeProcessor(maxChunks);\n    funcProcessor.ProcessSampleChunk(profile, filter, maxChunks);\n    return funcProcessor.CallTree;\n  }\n\n  protected override void ProcessSample(ref ProfileSample sample, ResolvedProfileStack stack,\n                                        int sampleIndex, object chunkData) {\n    var callTree = (ProfileCallTree)chunkData;\n    callTree.UpdateCallTree(ref sample, stack);\n  }\n\n  protected override object InitializeChunk(int k, int samplesPerChunk) {\n    // Partition the node IDs into namespaces based on the chunk\n    // of samples they are created from - this ensures that each\n    // call tree will usue unique node IDs when compared to other call trees.\n    int startNodeId = k * (int.MaxValue / (maxChunks_ + 1));\n    var chunk = new ProfileCallTree(startNodeId);\n\n    lock (chunks_) {\n      chunks_.Add(chunk);\n    }\n\n    return chunk;\n  }\n\n  protected override void Complete() {\n    lock (chunks_) {\n      // Multi-threaded merging of partial call trees.\n      while (chunks_.Count > 1) {\n        int step = Math.Min(chunks_.Count, 2);\n        // Trace.WriteLine($\"=> Merging {chunks_.Count} chunks, step {step}\");\n\n        var tasks = new Task[chunks_.Count / step];\n        var newChunks = new List<ProfileCallTree>(chunks_.Count / step);\n\n        for (int i = 0; i < chunks_.Count / step; i++) {\n          int iCopy = i;\n          newChunks.Add(chunks_[iCopy * step]);\n\n          tasks[i] = Task.Run(() => {\n            for (int k = 1; k < step; k++) {\n              chunks_[iCopy * step].MergeWith(chunks_[iCopy * step + k]);\n            }\n          });\n        }\n\n        Task.WaitAll(tasks);\n\n        // Handle any chunks that were not paired during the parallel phase.\n        // With a step of 2 this can happen only in the first round.\n        if (chunks_.Count % step != 0) {\n          int lastHandledIndex = chunks_.Count / step * step;\n\n          for (int i = lastHandledIndex; i < chunks_.Count; i++) {\n            chunks_[0].MergeWith(chunks_[i]);\n          }\n        }\n\n        chunks_ = newChunks;\n      }\n\n      CallTree = chunks_[0];\n#if DEBUG\n      CallTree.VerifyCycles();\n#endif\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Processing/FunctionProfileProcessor.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Processing;\n\npublic sealed class FunctionProfileProcessor : ProfileSampleProcessor {\n  private ProfileSampleFilter filter_;\n  private List<List<IRTextFunction>> filterStackFuncts_;\n  private List<ChunkData> chunks_;\n\n  private FunctionProfileProcessor(ProfileSampleFilter filter) {\n    filter_ = filter;\n    chunks_ = new List<ChunkData>();\n\n    if (filter_ != null && filter_.FunctionInstances is {Count: > 0}) {\n      // Compute once the list of functions on the path\n      // from call tree root to the function instance node.\n      filterStackFuncts_ = new List<List<IRTextFunction>>();\n\n      foreach (var instance in filter_.FunctionInstances) {\n        if (instance is ProfileCallTreeGroupNode groupNode) {\n          foreach (var node in groupNode.Nodes) {\n            AddInstanceFilter(node);\n          }\n        }\n        else {\n          AddInstanceFilter(instance);\n        }\n      }\n    }\n  }\n\n  public ProfileData Profile { get; } = new();\n\n  private void AddInstanceFilter(ProfileCallTreeNode node) {\n    var stackFuncts = new List<IRTextFunction>();\n\n    while (node != null) {\n      stackFuncts.Add(node.Function);\n      node = node.Caller;\n    }\n\n    stackFuncts.Reverse();\n    filterStackFuncts_.Add(stackFuncts);\n  }\n\n  public static ProfileData Compute(ProfileData profile, ProfileSampleFilter filter,\n                                    int maxChunks = int.MaxValue) {\n    var funcProcessor = new FunctionProfileProcessor(filter);\n    funcProcessor.ProcessSampleChunk(profile, filter, maxChunks);\n    return funcProcessor.Profile;\n  }\n\n  protected override object InitializeChunk(int k, int samplesPerChunk) {\n    var chunk = new ChunkData();\n\n    lock (chunks_) {\n      chunks_.Add(chunk);\n    }\n\n    return chunk;\n  }\n\n  protected override void ProcessSample(ref ProfileSample sample, ResolvedProfileStack stack,\n                                        int sampleIndex, object chunkData) {\n    if (filterStackFuncts_ != null) {\n      // Filtering of functions to a single instance is enabled,\n      // accept only samples that have the instance path nodes\n      // as a prefix of the call stack, this accounts for total weight.\n      if (stack.FrameCount < filterStackFuncts_.Count) {\n        return;\n      }\n\n      bool foundMatch = false;\n\n      foreach (var stackFuncts in filterStackFuncts_) {\n        // Check if instance path nodes are a prefix of the call stack.\n        if (stack.FrameCount < stackFuncts.Count) {\n          continue;\n        }\n\n        bool isMatch = true;\n\n        for (int i = 0; i < stackFuncts.Count; i++) {\n          if (stackFuncts[i] !=\n              stack.StackFrames[stack.FrameCount - i - 1].FrameDetails.Function) {\n            isMatch = false;\n            break;\n          }\n        }\n\n        if (isMatch) {\n          foundMatch = true;\n          break;\n        }\n      }\n\n      if (!foundMatch) {\n        return;\n      }\n    }\n\n    var data = (ChunkData)chunkData;\n    data.TotalWeight += sample.Weight;\n    data.ProfileWeight += sample.Weight;\n\n    bool isTopFrame = true;\n    data.StackModules.Clear();\n    data.StackFunctions.Clear();\n\n    foreach (var resolvedFrame in stack.StackFrames) {\n      if (resolvedFrame.IsUnknown) {\n        continue;\n      }\n\n      var frameDetails = resolvedFrame.FrameDetails;\n\n      if (isTopFrame && data.StackModules.Add(frameDetails.Image.Id)) {\n        data.ModuleWeights.AccumulateValue(frameDetails.Image.Id, sample.Weight);\n      }\n\n      long funcRva = frameDetails.DebugInfo.RVA;\n      long frameRva = resolvedFrame.FrameRVA;\n      var textFunction = frameDetails.Function;\n      ref var funcProfile =\n        ref CollectionsMarshal.GetValueRefOrAddDefault(data.FunctionProfiles, frameDetails.Function, out bool exists);\n\n      if (!exists) {\n        funcProfile = new FunctionProfileData(frameDetails.DebugInfo);\n      }\n\n      long offset = frameRva - funcRva;\n\n      // Don't count the inclusive time for recursive functions multiple times.\n      if (data.StackFunctions.Add(textFunction)) {\n        funcProfile.AddInstructionSample(offset, sample.Weight);\n        funcProfile.Weight += sample.Weight;\n\n        // Set sample range covered by function.\n        funcProfile.SampleStartIndex = Math.Min(funcProfile.SampleStartIndex, sampleIndex);\n        funcProfile.SampleEndIndex = Math.Max(funcProfile.SampleEndIndex, sampleIndex);\n      }\n\n      // Count the exclusive time for the top frame function.\n      if (isTopFrame) {\n        funcProfile.ExclusiveWeight += sample.Weight;\n      }\n\n      isTopFrame = false;\n    }\n  }\n\n  protected override void CompleteChunk(int k, object chunkData) {\n    var data = (ChunkData)chunkData;\n\n    lock (Profile) {\n      Profile.TotalWeight += data.TotalWeight;\n      Profile.ProfileWeight += data.ProfileWeight;\n\n      foreach ((int moduleId, var weight) in data.ModuleWeights) {\n        Profile.AddModuleSample(moduleId, weight);\n      }\n    }\n  }\n\n  protected override void Complete() {\n    lock (chunks_) {\n      while (chunks_.Count > 1) {\n        int step = Math.Min(chunks_.Count, 2);\n        // Trace.WriteLine($\"=> Merging {chunks_.Count} chunks, step {step}\");\n\n        var tasks = new Task[chunks_.Count / step];\n        var newChunks = new List<ChunkData>(chunks_.Count / step);\n\n        for (int i = 0; i < chunks_.Count / step; i++) {\n          int iCopy = i;\n          newChunks.Add(chunks_[iCopy * step]);\n\n          tasks[i] = Task.Run(() => {\n            for (int k = 1; k < step; k++) {\n              var destChunk = chunks_[iCopy * step];\n              var sourceChunk = chunks_[iCopy * step + k];\n              MergeChuncks(destChunk, sourceChunk);\n            }\n          });\n        }\n\n        Task.WaitAll(tasks);\n\n        // Handle any chuncks that were not paired during the parallel phase.\n        // With a step of 2 this can happen only in the first round.\n        if (chunks_.Count % step != 0) {\n          int lastHandledIndex = chunks_.Count / step * step;\n\n          for (int i = lastHandledIndex; i < chunks_.Count; i++) {\n            MergeChuncks(chunks_[0], chunks_[i]);\n          }\n        }\n\n        chunks_ = newChunks;\n      }\n\n      lock (Profile) {\n        Profile.FunctionProfiles = chunks_[0].FunctionProfiles;\n      }\n    }\n  }\n\n  private static void MergeChuncks(ChunkData destChunk, ChunkData sourceChunk) {\n    foreach (var pair in sourceChunk.FunctionProfiles) {\n      ref var existingValue =\n        ref CollectionsMarshal.GetValueRefOrAddDefault(destChunk.FunctionProfiles, pair.Key,\n                                                       out bool exists);\n\n      if (exists) {\n        existingValue.MergeWith(pair.Value);\n      }\n      else {\n        // Copy over func. profile if missing.\n        existingValue = pair.Value;\n      }\n    }\n  }\n\n  private class ChunkData {\n    public HashSet<int> StackModules = new();\n    public HashSet<IRTextFunction> StackFunctions = new();\n    public Dictionary<int, TimeSpan> ModuleWeights = new();\n    public Dictionary<IRTextFunction, FunctionProfileData> FunctionProfiles = new();\n    public TimeSpan TotalWeight = TimeSpan.Zero;\n    public TimeSpan ProfileWeight = TimeSpan.Zero;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Processing/FunctionSamplesProcessor.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Timeline;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Processing;\n\npublic sealed class FunctionSamplesProcessor : ProfileSampleProcessor {\n  private const int AllThreadsKey = -1;\n  private Dictionary<int, List<SampleIndex>> threadListMap_;\n  private List<ChunkData> chunks_;\n  private ProfileCallTreeNode node_;\n\n  public FunctionSamplesProcessor(ProfileCallTreeNode node) {\n    node_ = node;\n    chunks_ = new List<ChunkData>();\n  }\n\n  public static Dictionary<int, List<SampleIndex>>\n    Compute(ProfileCallTreeNode node,\n            ProfileData profile,\n            ProfileSampleFilter filter,\n            int maxChunks = int.MaxValue) {\n    // Compute the list of samples associated with the function,\n    // for each thread it was executed on.\n    var funcProcessor = new FunctionSamplesProcessor(node);\n    funcProcessor.ProcessSampleChunk(profile, filter, maxChunks);\n    return funcProcessor.threadListMap_;\n  }\n\n  protected override object InitializeChunk(int k, int samplesPerChunk) {\n    var chunk = new ChunkData();\n\n    lock (chunks_) {\n      chunks_.Add(chunk);\n    }\n\n    return chunk;\n  }\n\n  protected override void ProcessSample(ref ProfileSample sample, ResolvedProfileStack stack,\n                                        int sampleIndex, object chunkData) {\n    var data = (ChunkData)chunkData;\n    var currentNode = node_;\n    bool match = false;\n\n    for (int k = 0; k < stack.StackFrames.Count; k++) {\n      if (currentNode == null || currentNode.IsGroup) {\n        // Mismatch along the call path leading to the function.\n        match = false;\n        break;\n      }\n\n      var stackFrame = stack.StackFrames[k];\n\n      if (stackFrame.IsUnknown) {\n        continue;\n      }\n\n      if (stackFrame.FrameDetails.Function.Equals(currentNode.Function)) {\n        // Continue checking if the callers show up on the stack trace\n        // to make the search context-sensitive.\n        match = true;\n        currentNode = currentNode.Caller;\n      }\n      else if (match) {\n        // Mismatch along the call path leading to the function.\n        match = false;\n        break;\n      }\n    }\n\n    if (match) {\n      var threadList = data.ThreadListMap.GetOrAddValue(stack.Context.ThreadId);\n      var index = new SampleIndex(sampleIndex, sample.Time);\n      threadList.Add(index);\n      data.AllThreadsList.Add(index);\n    }\n  }\n\n  protected override void Complete() {\n    lock (chunks_) {\n      // Compute the sample list size for each thread\n      // across all chunks to pre-allocate memory.\n      var countMap = new Dictionary<int, int>();\n      var chunkThreadListMap = new Dictionary<int, List<List<SampleIndex>>>();\n\n      foreach (var chunk in chunks_) {\n        foreach (var pair in chunk.ThreadListMap) {\n          countMap.AccumulateValue(pair.Key, pair.Value.Count);\n\n          if (pair.Value.Count > 0) {\n            chunkThreadListMap.GetOrAddValue(pair.Key).Add(pair.Value);\n          }\n        }\n      }\n\n      // Pre-allocate memory for the merged per-thread sample lists.\n      threadListMap_ = new Dictionary<int, List<SampleIndex>>(countMap.Count);\n\n      foreach (var pair in countMap) {\n        threadListMap_[pair.Key] = new List<SampleIndex>(pair.Value);\n      }\n\n      // The per-thread sample lists are already sorted,\n      // now put them in the correct order across all chunks.\n      foreach (var chunkList in chunkThreadListMap.Values) {\n        chunkList.Sort((a, b) => a[0].Index.CompareTo(b[0].Index));\n      }\n\n      var map = new Dictionary<int, int>();\n\n      // Merge the per-thread sample lists.\n      foreach (var pair in chunkThreadListMap) {\n        var threadList = threadListMap_[pair.Key];\n        var chunkLists = pair.Value;\n\n        foreach (var list in chunkLists) {\n          threadList.AddRange(list);\n        }\n\n        for (int i = 1; i < threadList.Count; i++) {\n          int dist = threadList[i].Index - threadList[i - 1].Index;\n          map.AccumulateValue(dist, 1);\n        }\n\n#if DEBUG\n        // Validate sample ordering.\n        for (int i = 1; i < chunkLists.Count; i++) {\n          Debug.Assert(chunkLists[i][0].Index > chunkLists[i - 1][^1].Index);\n        }\n#endif\n      }\n    }\n  }\n\n  private class ChunkData {\n    public List<SampleIndex> AllThreadsList;\n    public Dictionary<int, List<SampleIndex>> ThreadListMap;\n\n    public ChunkData() {\n      AllThreadsList = new List<SampleIndex>();\n      ThreadListMap = new Dictionary<int, List<SampleIndex>>();\n      ThreadListMap[AllThreadsKey] = AllThreadsList;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Processing/FunctionsForSamplesProcessor.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.Core.Profile.Processing;\n\npublic sealed class FunctionsForSamplesProcessor : ProfileSampleProcessor {\n  private HashSet<IRTextFunction> functionSet_;\n  private List<ChunkData> chunks_;\n\n  public FunctionsForSamplesProcessor() {\n    chunks_ = new List<ChunkData>();\n  }\n\n  public static HashSet<IRTextFunction>\n    Compute(ProfileSampleFilter filter,\n            ProfileData profile,\n            int maxChunks = int.MaxValue) {\n    // Compute the list of functions covered by the samples\n    // on the specified thread or all threads.\n    var funcProcessor = new FunctionsForSamplesProcessor();\n    funcProcessor.ProcessSampleChunk(profile, filter, maxChunks);\n    return funcProcessor.functionSet_;\n  }\n\n  protected override object InitializeChunk(int k, int samplesPerChunk) {\n    var chunk = new ChunkData();\n\n    lock (chunks_) {\n      chunks_.Add(chunk);\n    }\n\n    return chunk;\n  }\n\n  protected override void ProcessSample(ref ProfileSample sample, ResolvedProfileStack stack, int sampleIndex,\n                                        object chunkData) {\n    var data = (ChunkData)chunkData;\n\n    foreach (var stackFrame in stack.StackFrames) {\n      if (!stackFrame.IsUnknown) {\n        data.functionSet_.Add(stackFrame.FrameDetails.Function);\n      }\n    }\n  }\n\n  protected override void Complete() {\n    // Compute the sample list size for each thread\n    // across all chunks to pre-allocate memory.\n    int count = 0;\n\n    foreach (var chunk in chunks_) {\n      count += chunk.functionSet_.Count;\n    }\n\n    functionSet_ = new HashSet<IRTextFunction>(count);\n\n    // Merge the per-thread sample lists.\n    foreach (var chunk in chunks_) {\n      foreach (var func in chunk.functionSet_) {\n        functionSet_.Add(func);\n      }\n    }\n  }\n\n  private class ChunkData {\n    public HashSet<IRTextFunction> functionSet_ = new(1024);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Processing/ProfileSampleFilter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Timeline;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Processing;\n\npublic class ProfileSampleFilter : IEquatable<ProfileSampleFilter> {\n  public ProfileSampleFilter() {\n  }\n\n  public ProfileSampleFilter(ProfileCallTreeNode instance) {\n    AddInstance(instance);\n  }\n\n  public ProfileSampleFilter(int threadId) {\n    AddThread(threadId);\n  }\n\n  public SampleTimeRangeInfo TimeRange { get; set; }\n  public List<int> ThreadIds { get; set; }\n  public List<ProfileCallTreeNode> FunctionInstances { get; set; }\n  public bool HasThreadFilter => ThreadIds is {Count: > 0};\n  public bool HasInstanceFilter => FunctionInstances is {Count: > 0};\n  public bool IncludesAll => TimeRange == null &&\n                             !HasThreadFilter &&\n                             !HasInstanceFilter;\n\n  public bool Equals(ProfileSampleFilter other) {\n    if (ReferenceEquals(null, other))\n      return false;\n    if (ReferenceEquals(this, other))\n      return true;\n    return Equals(TimeRange, other.TimeRange) &&\n           ThreadIds.AreEqual(other.ThreadIds) &&\n           FunctionInstances.AreEqual(other.FunctionInstances);\n  }\n\n  public ProfileSampleFilter AddInstance(ProfileCallTreeNode instance) {\n    FunctionInstances ??= new List<ProfileCallTreeNode>();\n    FunctionInstances.Add(instance);\n    return this;\n  }\n\n  public bool IncludesInstance(ProfileCallTreeNode node) {\n    return HasInstanceFilter && FunctionInstances.Contains(node);\n  }\n\n  public void RemoveInstance(ProfileCallTreeNode instance) {\n    FunctionInstances?.Remove(instance);\n  }\n\n  public void ClearInstances() {\n    FunctionInstances?.Clear();\n  }\n\n  public ProfileSampleFilter AddThread(int threadId) {\n    ThreadIds ??= new List<int>();\n    ThreadIds.Add(threadId);\n    return this;\n  }\n\n  public bool IncludesThread(int threadId) {\n    return HasThreadFilter && ThreadIds.Contains(threadId);\n  }\n\n  public void RemoveThread(int threadId) {\n    ThreadIds?.Remove(threadId);\n  }\n\n  public void ClearThreads() {\n    ThreadIds?.Clear();\n  }\n\n  public ProfileSampleFilter Clone() {\n    var clone = new ProfileSampleFilter();\n    clone.TimeRange = TimeRange;\n    clone.ThreadIds = ThreadIds.CloneList();\n    clone.FunctionInstances = FunctionInstances.CloneList();\n    return clone;\n  }\n\n  public ProfileSampleFilter CloneForCallTarget(IRTextFunction targetFunc) {\n    var targetFilter = Clone();\n\n    if (HasInstanceFilter) {\n      targetFilter.ClearInstances();\n\n      foreach (var instance in FunctionInstances) {\n        // Try to add the instance node that is a child\n        // of the current instance in the profile filter.\n        var targetInstance = instance.FindChildNode(targetFunc);\n\n        if (targetInstance != null) {\n          targetFilter.AddInstance(targetInstance);\n        }\n      }\n    }\n\n    return targetFilter;\n  }\n\n  public static bool operator ==(ProfileSampleFilter left, ProfileSampleFilter right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileSampleFilter left, ProfileSampleFilter right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj))\n      return false;\n    if (ReferenceEquals(this, obj))\n      return true;\n    if (obj.GetType() != GetType())\n      return false;\n    return Equals((ProfileSampleFilter)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(TimeRange, ThreadIds, FunctionInstances);\n  }\n\n  public override string ToString() {\n    string text = $\"TimeRange: {TimeRange}, HasInstanceFilter: {HasInstanceFilter}, HasThreadFilter: {HasThreadFilter}\";\n\n    if (HasInstanceFilter) {\n      foreach (var item in FunctionInstances) {\n        text += $\"\\n - instance: {item.FunctionName}\";\n      }\n    }\n\n    if (HasThreadFilter) {\n      foreach (int item in ThreadIds) {\n        text += $\"\\n - thread: {item}\";\n      }\n    }\n\n    return text;\n  }\n}\n\npublic class ProfileFilterState {\n  public ProfileFilterState(ProfileSampleFilter filter = null) {\n    Filter = filter ?? new ProfileSampleFilter();\n  }\n\n  public bool HasAnyFilter => HasThreadFilter || HasFilter;\n  public ProfileSampleFilter Filter { get; set; }\n  public bool HasFilter { get; set; }\n  public TimeSpan FilteredTime { get; set; }\n  public bool HasThreadFilter { get; set; }\n  public string ThreadFilterText { get; set; }\n  public Func<Task> RemoveThreadFilter { get; set; }\n  public Func<Task> RemoveTimeRangeFilter { get; set; }\n  public Func<Task> RemoveAllFilters { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Processing/ProfileSampleProcessor.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Profile.Processing;\n\n// Provides support for running an analysis over samples, with filtering,\n// in parallel, by splitting the samples into multiple chunks, each\n// processed on a different thread.\npublic abstract class ProfileSampleProcessor {\n  protected virtual int DefaultThreadCount => CoreSettingsProvider.GeneralSettings.CurrentCpuCoreLimit;\n\n  protected virtual object InitializeChunk(int k, int samplesPerChunk) {\n    return null;\n  }\n\n  protected abstract void ProcessSample(ref ProfileSample sample, ResolvedProfileStack stack,\n                                        int sampleIndex, object chunkData);\n\n  protected virtual void CompleteChunk(int k, object chunkData) {\n  }\n\n  protected virtual void Complete() {\n  }\n\n  protected void ProcessSampleChunk(ProfileData profile, ProfileSampleFilter filter,\n                                    int maxChunks = int.MaxValue) {\n    int sampleStartIndex = filter.TimeRange?.StartSampleIndex ?? 0;\n    int sampleEndIndex = filter.TimeRange?.EndSampleIndex ?? profile.Samples.Count;\n    //Trace.WriteLine($\"ProfileSampleProcessor: Sample range: {sampleStartIndex} - {sampleEndIndex}\");\n\n    int sampleCount = sampleEndIndex - sampleStartIndex;\n    int chunks = Math.Min(maxChunks, DefaultThreadCount);\n    //Trace.WriteLine($\"ProfileSampleProcessor: Using {chunks} chunks\");\n    //var sw = Stopwatch.StartNew();\n\n    int chunkSize = sampleCount / chunks;\n    var taskScheduler = new ConcurrentExclusiveSchedulerPair(TaskScheduler.Default, chunks);\n    var taskFactory = new TaskFactory(taskScheduler.ConcurrentScheduler);\n    var tasks = new List<Task>();\n\n    for (int k = 0; k < chunks; k++) {\n      int start = Math.Min(sampleStartIndex + k * chunkSize, sampleEndIndex);\n      int end = k == chunks - 1 ? sampleEndIndex : Math.Min(sampleStartIndex + (k + 1) * chunkSize, sampleEndIndex);\n\n      // If a single thread is selected, only process the samples for that thread\n      // by going through the thread sample ranges.\n      var ranges = profile.ThreadSampleRanges.Ranges[-1];\n\n      if (filter.HasThreadFilter && filter.ThreadIds.Count == 1) {\n        ranges = profile.ThreadSampleRanges.Ranges[filter.ThreadIds[0]];\n        // Trace.WriteLine($\"Filter single thread with {ranges.Count} ranges\");\n      }\n\n      int kCopy = k; // Pass value copy.\n      tasks.Add(taskFactory.StartNew(() => {\n        int samplesPerChunk = (int)Math.Ceiling((double)sampleCount / chunks);\n        object chunkData = InitializeChunk(kCopy, samplesPerChunk);\n\n        // Find the ranges of samples that overlap with the filter time range.\n        int startRangeIndex = 0;\n        int endRangeIndex = ranges.Count - 1;\n\n        while (startRangeIndex < ranges.Count && ranges[startRangeIndex].EndIndex < start) {\n          startRangeIndex++;\n        }\n\n        while (endRangeIndex > 0 && ranges[endRangeIndex].StartIndex > end) {\n          endRangeIndex--;\n        }\n\n        // Walk each sample in the range and update the function profile.\n        bool hasThreadFilter = filter.HasThreadFilter;\n        var sampleSpan = CollectionsMarshal.AsSpan(profile.Samples);\n\n        for (int k = startRangeIndex; k <= endRangeIndex; k++) {\n          var range = ranges[k];\n          int startIndex = Math.Max(start, range.StartIndex);\n          int endIndex = Math.Min(end, range.EndIndex);\n\n          for (int i = startIndex; i < endIndex; i++) {\n            ref var stack = ref sampleSpan[i].Stack;\n\n            if (hasThreadFilter &&\n                !filter.ThreadIds.Contains(stack.Context.ThreadId)) {\n              continue;\n            }\n\n            ref var sample = ref sampleSpan[i].Sample;\n            ProcessSample(ref sample, stack, i, chunkData);\n          }\n        }\n\n        CompleteChunk(kCopy, chunkData);\n      }));\n    }\n\n    Task.WhenAll(tasks.ToArray()).Wait();\n    Complete();\n\n    //sw.Stop();\n    //Trace.WriteLine($\"ProfileSampleProcessor: Time {sw.ElapsedMilliseconds} ms\");\n    //Trace.Flush();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Timeline/ActivityView.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.Core.Profile.Timeline;\n\npublic record SampleTimeRangeInfo(\n  TimeSpan StartTime,\n  TimeSpan EndTime,\n  int StartSampleIndex,\n  int EndSampleIndex,\n  int ThreadId);\n\npublic record struct SampleTimePointInfo(TimeSpan Time, int SampleIndex, int ThreadId);\n\n//? TODO: Use SampleIndex in SampleTimePointInfo/Range\npublic record struct SampleIndex(int Index, TimeSpan Time);"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Utils/DummySectionLoader.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.Core.Profile.Utils;\n\npublic sealed class DummySectionLoader : IRTextSectionLoader {\n  public async override Task<IRTextSummary> LoadDocument(ProgressInfoHandler progressHandler) {\n    return null;\n  }\n\n  public override string GetDocumentOutputText() {\n    return \"\";\n  }\n\n  public override byte[] GetDocumentTextBytes() {\n    return null;\n  }\n\n  public override ParsedIRTextSection LoadSection(IRTextSection section) {\n    return null;\n  }\n\n  public override string GetSectionText(IRTextSection section) {\n    return \"\";\n  }\n\n  public override ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  public override string GetSectionOutputText(IRPassOutput output) {\n    return \"\";\n  }\n\n  public override ReadOnlyMemory<char> GetSectionPassOutputTextSpan(IRPassOutput output) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  public override List<string> GetSectionPassOutputTextLines(IRPassOutput output) {\n    return new List<string>();\n  }\n\n  public override string GetRawSectionText(IRTextSection section) {\n    return \"\";\n  }\n\n  public override string GetRawSectionPassOutput(IRPassOutput output) {\n    return \"\";\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionTextSpan(IRTextSection section) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionPassOutputSpan(IRPassOutput output) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  protected override void Dispose(bool disposing) {\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Utils/NamedPipeServer.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.IO.Pipes;\nusing System.Runtime.InteropServices;\nusing System.Security.AccessControl;\nusing System.Security.Principal;\nusing System.Threading;\n\nnamespace ProfileExplorer.Core.Profile.Utils;\n\npublic class NamedPipeServer : IDisposable {\n  public delegate void MessageReceivedDelegate(PipeMessageHeader messageHeader, byte[] messageBody);\n  private static readonly int HeaderSize = Marshal.SizeOf<PipeMessageHeader>();\n  private NamedPipeServerStream pipeStream_;\n  private BinaryReader reader_;\n  private BinaryWriter writer_;\n  private bool connected_;\n  private bool connectionTimeout_;\n\n  public NamedPipeServer(string pipeName) {\n    // Allow non-admins to connect to the pipe.\n    var securityIdentifier = new SecurityIdentifier(WellKnownSidType.AuthenticatedUserSid, null);\n    var pipeSecurity = new PipeSecurity();\n    pipeSecurity.AddAccessRule(new PipeAccessRule(securityIdentifier,\n                                                  PipeAccessRights.ReadWrite | PipeAccessRights.CreateNewInstance,\n                                                  AccessControlType.Allow));\n\n    pipeStream_ = NamedPipeServerStreamAcl.Create(pipeName, PipeDirection.InOut,\n                                                  NamedPipeServerStream.MaxAllowedServerInstances,\n                                                  PipeTransmissionMode.Byte, PipeOptions.Asynchronous,\n                                                  0, 0, pipeSecurity);\n  }\n\n  public void Dispose() {\n    if (connected_) {\n      reader_?.Dispose();\n      writer_?.Dispose();\n\n      if (pipeStream_.IsConnected) {\n        pipeStream_.Disconnect();\n      }\n    }\n\n    pipeStream_.Dispose();\n  }\n\n  public void ReceiveMessages(MessageReceivedDelegate action, CancellationToken cancellationToken) {\n    if (!Connect()) {\n      throw new Exception(\"Failed to connect to pipe\");\n    }\n\n    byte[] buffer = new byte[HeaderSize];\n\n    while (pipeStream_.IsConnected && !cancellationToken.IsCancellationRequested) {\n      int bytesRead = reader_.Read(buffer);\n\n      if (bytesRead == 0) {\n        break;\n      }\n\n      if (bytesRead != HeaderSize) {\n        throw new Exception($\"Invalid message header, read {bytesRead} vs expected {HeaderSize}\");\n      }\n\n      var header = MemoryMarshal.Cast<byte, PipeMessageHeader>(buffer)[0];\n      byte[] bodyBuffer = null;\n\n      if (header.Size > HeaderSize) {\n        int messageSize = header.Size - HeaderSize;\n        bodyBuffer = new byte[messageSize];\n        bytesRead = reader_.Read(bodyBuffer);\n\n        if (bytesRead != messageSize) {\n          throw new Exception($\"Invalid message body, read {bytesRead} vs expected {messageSize}\");\n        }\n      }\n\n      action(header, bodyBuffer);\n    }\n  }\n\n  public void SendMessage(int kind) {\n    if (!Connect()) {\n      throw new Exception(\"Failed to connect to pipe\");\n    }\n\n    SendMessageHeader(kind, 0);\n  }\n\n  public void SendMessage<T>(int kind, T data) where T : struct {\n    if (!Connect()) {\n      throw new Exception(\"Failed to connect to pipe\");\n    }\n\n    int dataSize = Marshal.SizeOf<T>();\n    SendMessageHeader(kind, dataSize);\n\n    if (dataSize > 0) {\n      var bodySpan = MemoryMarshal.Cast<T, byte>(MemoryMarshal.CreateSpan(ref data, 1));\n      writer_.Write(bodySpan);\n    }\n  }\n\n  public void Flush() {\n    writer_.Flush();\n  }\n\n  private void SendMessageHeader(int kind, int bodySize) {\n    var header = new PipeMessageHeader {Kind = kind, Size = HeaderSize + bodySize};\n\n    var headerSpan = MemoryMarshal.Cast<PipeMessageHeader, byte>(MemoryMarshal.CreateSpan(ref header, 1));\n    writer_.Write(headerSpan);\n  }\n\n  private bool Connect(int timeoutMs = 10000) {\n    if (connected_) {\n      return true;\n    }\n\n    if (connectionTimeout_) {\n      return false; // Failed to connect previously, don't try again.\n    }\n\n    lock (this) {\n      if (connected_) {\n        return true;\n      }\n\n      try {\n        // Wait for a connection for a certain amount of time.\n        var result = pipeStream_.BeginWaitForConnection(e => { }, null);\n\n        if (result.AsyncWaitHandle.WaitOne(timeoutMs)) {\n          Trace.WriteLine(\"Connected to pipe\");\n          pipeStream_.EndWaitForConnection(result);\n          reader_ = new BinaryReader(pipeStream_);\n          writer_ = new BinaryWriter(pipeStream_);\n          connected_ = true;\n        }\n        else {\n          Trace.WriteLine(\"Pipe connection timeout\");\n          connected_ = false;\n          connectionTimeout_ = true;\n        }\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to connect to pipe: {ex}\");\n        connected_ = false;\n      }\n    }\n\n    return connected_;\n  }\n\n  [StructLayout(LayoutKind.Sequential, Pack = 1)]\n  public struct PipeMessageHeader {\n    public int Kind;\n    public int Size; // sizeof(PipeMessageHeader) + additional data\n\n    public override string ToString() {\n      return $\"Message Kind: {Kind}, Size: {Size}\";\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Profile/Utils/ThreadSuspender.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Runtime.ConstrainedExecution;\nusing System.Runtime.InteropServices;\nusing Microsoft.Win32.SafeHandles;\n\nnamespace ProfileExplorer.Core.Profile.Utils;\n\n// Copied from ClrMD.\nclass WindowsThreadSuspender : CriticalFinalizerObject, IDisposable {\n  private readonly object _sync = new();\n  private readonly int _pid;\n  private volatile int[] _suspendedThreads;\n\n  public WindowsThreadSuspender(int pid) {\n    _pid = pid;\n    _suspendedThreads = SuspendThreads();\n  }\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  ~WindowsThreadSuspender() {\n    Dispose(false);\n  }\n\n  private int[] SuspendThreads() {\n    bool permissionFailure = false;\n    var suspendedThreads = new HashSet<int>();\n\n    // A thread may create more threads while we are in the process of walking the list.  We will keep looping through\n    // the thread list over and over until we find that we haven't found any new threads to suspend.\n    try {\n      int originalCount;\n\n      do {\n        originalCount = suspendedThreads.Count;\n\n        Process process;\n\n        try {\n          process = Process.GetProcessById(_pid);\n        }\n        catch (ArgumentException e) {\n          throw new InvalidOperationException($\"Unable to inspect process {_pid:x}.\", e);\n        }\n\n        foreach (ProcessThread thread in process.Threads) {\n          if (thread != null) {\n            if (suspendedThreads.Contains(thread.Id))\n              continue;\n\n            using var threadHandle = Interop.OpenThread(Interop.ThreadAccess.SUSPEND_RESUME, false, (uint)thread.Id);\n\n            if (threadHandle.IsInvalid || Interop.SuspendThread(threadHandle.DangerousGetHandle()) == -1) {\n              permissionFailure = true;\n              continue;\n            }\n\n            suspendedThreads.Add(thread.Id);\n          }\n        }\n      } while (originalCount != suspendedThreads.Count);\n\n      // If we fail to suspend any thread then we didn't have permission.  We'll throw an exception in that case.  If\n      // we fail to suspend a few of the threads we'll treat that as non-fatal.\n      if (permissionFailure && suspendedThreads.Count == 0)\n        throw new InvalidOperationException($\"Unable to suspend threads of process {_pid:x}.\");\n\n      int[] result = suspendedThreads.ToArray();\n      suspendedThreads = null;\n      return result;\n    }\n    finally {\n      if (suspendedThreads != null)\n        ResumeThreads(suspendedThreads);\n    }\n  }\n\n  private void ResumeThreads(IEnumerable<int> suspendedThreads) {\n    foreach (int threadId in suspendedThreads) {\n      using var threadHandle = Interop.OpenThread(Interop.ThreadAccess.SUSPEND_RESUME, false, (uint)threadId);\n\n      if (threadHandle.IsInvalid || Interop.ResumeThread(threadHandle.DangerousGetHandle()) == -1) {\n        // If we fail to resume a thread we are in a bit of trouble because the target process is likely in a bad\n        // state.  This shouldn't ever happen, but if it does there's nothing we can do about it.  We'll log an event\n        // here but we won't throw an exception for a few reasons:\n        //     1.  We really never expect this to happen.  Why would we be able to suspend a thread but not resume it?\n        //     2.  We want to finish resuming threads.\n        //     3.  There's nothing the caller can really do about it.\n\n        Trace.WriteLine($\"Failed to resume thread id:{threadId:id} in pid:{_pid:x}.\");\n      }\n    }\n  }\n\n  private void Dispose(bool _) {\n    lock (_sync) {\n      if (_suspendedThreads != null) {\n        int[] suspendedThreads = _suspendedThreads;\n        _suspendedThreads = null;\n        ResumeThreads(suspendedThreads);\n      }\n    }\n  }\n\n  public static class Interop {\n    public enum ThreadAccess {\n      SUSPEND_RESUME = 0x0002,\n      THREAD_ALL_ACCESS = 0x1F03FF\n    }\n\n    private const string Kernel32LibraryName = \"kernel32.dll\";\n\n    [DllImport(Kernel32LibraryName)]\n    private static extern bool GetThreadContext(IntPtr hThread, IntPtr lpContext);\n\n    [DllImport(Kernel32LibraryName, SetLastError = true)]\n    internal static extern SafeWin32Handle OpenThread(ThreadAccess dwDesiredAccess,\n                                                      [MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,\n                                                      uint dwThreadId);\n\n    [DllImport(Kernel32LibraryName, SetLastError = true)]\n    internal static extern int SuspendThread(IntPtr hThread);\n\n    [DllImport(Kernel32LibraryName, SetLastError = true)]\n    internal static extern int ResumeThread(IntPtr hThread);\n\n    public sealed class SafeWin32Handle : SafeHandleZeroOrMinusOneIsInvalid {\n      public SafeWin32Handle() : base(true) {\n      }\n\n      public SafeWin32Handle(IntPtr handle)\n        : this(handle, true) {\n      }\n\n      public SafeWin32Handle(IntPtr handle, bool ownsHandle)\n        : base(ownsHandle) {\n        SetHandle(handle);\n      }\n\n      [DllImport(\"kernel32.dll\", SetLastError = true, PreserveSig = true)]\n      [return: MarshalAs(UnmanagedType.Bool)]\n      public static extern bool CloseHandle(IntPtr handle);\n\n      protected override bool ReleaseHandle() {\n        return CloseHandle(handle);\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/ProfileExplorerCore.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net8.0</TargetFramework>\n    <ImplicitUsings>enable</ImplicitUsings>\n    <Nullable>enable</Nullable>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n  </PropertyGroup>\n\n  <ItemGroup>\n    <PackageReference Include=\"Azure.Core\" Version=\"1.38.0\" />\n    <PackageReference Include=\"Azure.Identity\" Version=\"1.11.4\" />\n    <PackageReference Include=\"CSharpTest.Net.Collections\" Version=\"14.906.1403.1082\" />\n    <PackageReference Include=\"DiffPlex\" Version=\"1.7.2\" />\n    <PackageReference Include=\"Google.Protobuf\" Version=\"3.28.3\" />\n    <PackageReference Include=\"HtmlAgilityPack\" Version=\"1.11.68\" />\n    <PackageReference Include=\"Microsoft.Diagnostics.Runtime\" Version=\"4.0.0-beta.24314.3\" />\n    <PackageReference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent\" Version=\"3.1.30\" />\n    <PackageReference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles\" Version=\"1.0.23\" />\n    <PackageReference Include=\"protobuf-net\" Version=\"3.2.45\" />\n  </ItemGroup>\n\n  <ItemGroup>\n    <Reference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent.SymbolsAuthentication\">\n      <HintPath>..\\external\\Microsoft.Diagnostics.Tracing.TraceEvent.SymbolsAuthentication.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n\n</Project>\n"
  },
  {
    "path": "src/ProfileExplorerCore/Providers/CompilerIRKind.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nnamespace ProfileExplorer.Core.Providers;\n\n/// <summary>\n/// Defines the different compiler IR types supported by Profile Explorer.\n/// </summary>\npublic enum CompilerIRKind {\n  /// <summary>\n  /// Assembly/machine code IR\n  /// </summary>\n  ASM,\n  \n  /// <summary>\n  /// LLVM Intermediate Representation\n  /// </summary>\n  LLVM\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Providers/IBinaryFileFinder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.Core.Providers;\n\npublic interface IBinaryFileFinder {\n  Task<BinaryFileSearchResult> FindBinaryFileAsync(BinaryFileDescriptor binaryFile, SymbolFileSourceSettings settings = null);\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Providers/ICompilerInfoProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Providers;\n\npublic interface ICompilerInfoProvider {\n  string CompilerIRName { get; }\n  CompilerIRKind CompilerIRKind { get; }\n  string CompilerDisplayName { get; }\n  string DefaultSyntaxHighlightingFile { get; }\n  string OpenFileFilter { get; }\n  string OpenDebugFileFilter { get; }\n  ICompilerIRInfo IR { get; }\n  INameProvider NameProvider { get; }\n  IBinaryFileFinder BinaryFileFinder { get; }\n  IDebugFileFinder DebugFileFinder { get; }\n  IDebugInfoProviderFactory DebugInfoProviderFactory { get; }\n  IDiffFilterProvider DiffFilterProvider { get; }\n \n  Task<bool> AnalyzeLoadedFunction(FunctionIR function, IRTextSection section,\n                                   ILoadedDocument loadedDoc, FunctionDebugInfo funcDebugInfo = null);\n}\n\n[ProtoContract]\npublic class BinaryFileSearchResult {\n  public static BinaryFileSearchResult None = new();\n  [ProtoMember(1)]\n  public bool Found { get; set; }\n  [ProtoMember(2)]\n  public BinaryFileDescriptor BinaryFile { get; set; }\n  [ProtoMember(3)]\n  public string FilePath { get; set; }\n  [ProtoMember(4)]\n  public string Details { get; set; }\n  [ProtoMember(5)]\n  public bool IsApproximateMatch { get; set; }\n\n  public static BinaryFileSearchResult Success(BinaryFileDescriptor file, string filePath, string details = null) {\n    return new BinaryFileSearchResult {Found = true, BinaryFile = file, FilePath = filePath, Details = details};\n  }\n\n  public static BinaryFileSearchResult Success(string filePath) {\n    if (File.Exists(filePath)) {\n      var info = PEBinaryInfoProvider.GetBinaryFileInfo(filePath);\n      return new BinaryFileSearchResult {Found = true, BinaryFile = info, FilePath = filePath};\n    }\n\n    return new BinaryFileSearchResult {Found = false, BinaryFile = null, FilePath = filePath};\n  }\n\n  public static BinaryFileSearchResult ApproximateSuccess(BinaryFileDescriptor file, string filePath, string details = null) {\n    return new BinaryFileSearchResult {Found = true, BinaryFile = file, FilePath = filePath, Details = details, IsApproximateMatch = true};\n  }\n\n  public static BinaryFileSearchResult Failure(BinaryFileDescriptor file, string details) {\n    return new BinaryFileSearchResult {BinaryFile = file, Details = details};\n  }\n\n  public override string ToString() {\n    return FilePath;\n  }\n}\n\n[ProtoContract]\npublic class DebugFileSearchResult {\n  public static DebugFileSearchResult None = new();\n  [ProtoMember(1)]\n  public bool Found { get; set; }\n  [ProtoMember(2)]\n  public SymbolFileDescriptor SymbolFile { get; set; }\n  [ProtoMember(3)]\n  public string FilePath { get; set; }\n  [ProtoMember(4)]\n  public string Details { get; set; }\n\n  public static DebugFileSearchResult Success(SymbolFileDescriptor symbolFile, string filePath, string details = null) {\n    return new DebugFileSearchResult {Found = true, SymbolFile = symbolFile, FilePath = filePath, Details = details};\n  }\n\n  public static DebugFileSearchResult Success(string filePath) {\n    return Success(new SymbolFileDescriptor(Path.GetFileName(filePath)), filePath);\n  }\n\n  public static DebugFileSearchResult Failure(SymbolFileDescriptor symbolFile, string details) {\n    return new DebugFileSearchResult {SymbolFile = symbolFile, Details = details};\n  }\n\n  public override string ToString() {\n    return FilePath;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Providers/IDebugFileFinder.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.Core.Providers;\n\npublic interface IDebugFileFinder {\n  Task<DebugFileSearchResult> FindDebugInfoFileAsync(string imagePath, SymbolFileSourceSettings settings = null);\n  Task<DebugFileSearchResult> FindDebugInfoFileAsync(SymbolFileDescriptor symbolFile, SymbolFileSourceSettings settings = null);\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Providers/IDebugInfoProviderFactory.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.Core.Providers;\n\npublic interface IDebugInfoProviderFactory {\n  IDebugInfoProvider CreateDebugInfoProvider(DebugFileSearchResult debugFile);\n\n  IDebugInfoProvider GetOrCreateDebugInfoProvider(IRTextFunction function, ILoadedDocument loadedDoc);\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Providers/INameProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.Core.Providers;\n\npublic delegate string FunctionNameFormatter(string name);\n\n[Flags]\npublic enum FunctionNameDemanglingOptions {\n  Default = 0,\n  OnlyName = 1 << 0,\n  NoReturnType = 1 << 1,\n  NoSpecialKeywords = 1 << 2\n}\n\npublic interface INameProvider {\n  bool IsDemanglingSupported { get; }\n  bool IsDemanglingEnabled { get; }\n  FunctionNameDemanglingOptions GlobalDemanglingOptions { get; }\n  string GetSectionName(IRTextSection section, bool includeNumber = true);\n  string GetFunctionName(IRTextFunction function);\n\n  string DemangleFunctionName(IRTextFunction function, FunctionNameDemanglingOptions options =\n                                FunctionNameDemanglingOptions.Default);\n\n  string DemangleFunctionName(string name, FunctionNameDemanglingOptions options);\n  string FormatFunctionName(IRTextFunction function);\n  string FormatFunctionName(string name);\n\n  void SettingsChanged();\n  //? TODO: GetBlockName\n}"
  },
  {
    "path": "src/ProfileExplorerCore/SectionReaderBase.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq.Expressions;\nusing System.Runtime.CompilerServices;\nusing System.Text;\n\nnamespace ProfileExplorer.Core;\n\npublic abstract class SectionReaderBase : IRSectionReader, IDisposable {\n  public static readonly long MAX_PRELOADED_FILE_SIZE = 256 * 1024 * 1024; // 256 MB\n  private static readonly int STREAM_BUFFER_SIZE = 16 * 1024;\n  private static readonly int MAX_LINE_LENGTH = 2000;\n  private StreamReader dataReader_;\n  private Stream dataStream_;\n  private long dataStreamSize_;\n  private Encoding dataStreamEncoding_;\n  private bool expectSectionHeaders_;\n  private object lockObject_;\n  private Dictionary<string, IRTextFunction> functionMap_;\n  private int lineIndex_;\n  private IRPassOutput optionalOutput_;\n  private bool optionalOutputNeeded_;\n  private string preloadedData_;\n  private int prevLineCount_;\n  private string[] prevLines_;\n  private string currentLine_;\n  private long nextInitialOffset_;\n  private bool hasPreprocessedLines_;\n  private bool hasMetadataLines_;\n  private IRTextSummary summary_;\n  private long textOffset_;\n  private long previousOffset_;\n\n  public SectionReaderBase(string filePath, bool expectSectionHeaders = true) {\n    expectSectionHeaders_ = expectSectionHeaders;\n    dataStreamSize_ = new FileInfo(filePath).Length;\n\n    if (dataStreamSize_ < MAX_PRELOADED_FILE_SIZE) {\n      dataStream_ = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);\n\n      var textStream = new StreamReader(dataStream_);\n      preloadedData_ = textStream.ReadToEnd();\n      dataStream_.Seek(0, SeekOrigin.Begin);\n    }\n    else {\n      dataStream_ = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);\n    }\n\n    Initialize();\n  }\n\n  public SectionReaderBase(byte[] textData, bool expectSectionHeaders = true) {\n    expectSectionHeaders_ = expectSectionHeaders;\n    dataStream_ = new MemoryStream(textData);\n    dataStreamSize_ = textData.Length;\n    Initialize();\n  }\n\n  // Main function for reading the text source and producing a summary\n  // with all functions and their sections.\n  public IRTextSummary GenerateSummary(ProgressInfoHandler progressHandler,\n                                       SectionTextHandler sectionTextHandler) {\n    var summary = GenerateSummaryImpl(progressHandler, sectionTextHandler);\n\n    if (summary.Functions.Count == 0 && expectSectionHeaders_) {\n      // Try parsing again, but without looking for section headers.\n      // Useful when handling a single section copy-pasted from somewhere.\n      expectSectionHeaders_ = false;\n      dataStream_.Seek(0, SeekOrigin.Begin);\n      dataReader_.DiscardBufferedData();\n\n      ResetSummaryState();\n      summary = GenerateSummaryImpl(progressHandler, sectionTextHandler);\n    }\n\n    return summary;\n  }\n\n  public string GetSectionText(IRTextSection section) {\n    if (section.Output == null) {\n      throw new NullReferenceException();\n    }\n\n    return GetPassOutputText(section.Output, false);\n  }\n\n  public ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section) {\n    if (section.Output == null) {\n      throw new NullReferenceException();\n    }\n\n    return GetPassOutputTextSpan(section.Output);\n  }\n\n  public List<string> GetSectionTextLines(IRTextSection section) {\n    if (section.Output == null) {\n      throw new NullReferenceException();\n    }\n\n    return GetPassOutputTextLines(section.Output, false);\n  }\n\n  public string GetPassOutputText(IRPassOutput output) {\n    return GetPassOutputText(output, true);\n  }\n\n  public ReadOnlyMemory<char> GetPassOutputTextSpan(IRPassOutput output) {\n    if (output == null) {\n      throw new NullReferenceException();\n    }\n\n    if (!output.HasPreprocessedLines) {\n      // Fast path that avoids reading text line by line.\n      return GetRawPassOutputTextSpan(output, false);\n    }\n\n    string text = GetPassOutputText(output, false);\n    return text.AsMemory();\n  }\n\n  public List<string> GetPassOutputTextLines(IRPassOutput output) {\n    return GetPassOutputTextLines(output, true);\n  }\n\n  public string GetRawSectionText(IRTextSection section) {\n    if (section.Output == null) {\n      throw new NullReferenceException();\n    }\n\n    return GetRawPassOutputText(section.Output, false);\n  }\n\n  public ReadOnlyMemory<char> GetRawSectionTextSpan(IRTextSection section) {\n    if (section.Output == null) {\n      throw new NullReferenceException();\n    }\n\n    return GetRawPassOutputTextSpan(section.Output, false);\n  }\n\n  public string GetRawPassOutputText(IRPassOutput output) {\n    return GetRawPassOutputText(output, true);\n  }\n\n  public ReadOnlyMemory<char> GetRawPassOutputTextSpan(IRPassOutput output) {\n    return GetRawPassOutputTextSpan(output, true);\n  }\n\n  public byte[] GetDocumentTextData() {\n    lock (lockObject_) {\n      dataStream_.Seek(0, SeekOrigin.Begin);\n      var encoding = DetectUTF8Encoding(dataStream_, Encoding.ASCII);\n      using var binaryReader = new BinaryReader(dataStream_, encoding, true);\n      return binaryReader.ReadBytes((int)dataStream_.Length);\n    }\n  }\n\n  // Methods to be implemented by an IR reader implementation.\n  protected abstract bool IsSectionStart(string line);\n  protected abstract bool SectionStartIsFunctionStart(string line);\n  protected abstract bool IsFunctionStart(string line);\n  protected abstract bool IsFunctionEnd(string line);\n  protected abstract bool IsBlockStart(string line);\n  protected abstract string ExtractSectionName(string line);\n  protected abstract string ExtractFunctionName(string line);\n  protected abstract string PreprocessLine(string line);\n  protected abstract bool ShouldSkipOutputLine(string line);\n  protected abstract bool IsMetadataLine(string line);\n  protected abstract bool FunctionEndIsFunctionStart(string line);\n\n  protected void MarkPreprocessedLine(int line) {\n    hasPreprocessedLines_ = true;\n  }\n\n  protected string NextLine() {\n    return NextLine(dataReader_, true);\n  }\n\n  protected string NextLine(TextReader reader, bool recordPreviousLines) {\n    previousOffset_ = textOffset_;\n    string line = reader.ReadLine();\n\n    if (line == null) {\n      return null;\n    }\n\n    line = PreprocessLine(line);\n\n    if (recordPreviousLines) {\n      RecordPreviousLine(line);\n    }\n\n    if (reader == dataReader_) {\n      textOffset_ = ComputeTextOffset(dataReader_);\n    }\n    else {\n      textOffset_ = ((SpanStringReader)reader).Position;\n    }\n\n    return line;\n  }\n\n  protected string PreviousLine(int offset) {\n    return offset < prevLineCount_ ? prevLines_[offset] : null;\n  }\n\n  protected void RecordPreviousLine(string line) {\n    for (int i = prevLines_.Length - 1; i >= 1; i--) {\n      prevLines_[i] = prevLines_[i - 1];\n    }\n\n    prevLines_[0] = line;\n    prevLineCount_++;\n  }\n\n  protected long TextOffset() {\n    return textOffset_;\n  }\n\n  private Encoding DetectUTF8Encoding(Stream stream, Encoding defaultEncoding) {\n    // Check if the stream uses UTF8, otherwise fall back\n    // to a default encoding (ASCII) which is much faster to read.\n    Encoding encoding = new UTF8Encoding(true);\n    byte[] preamble = encoding.GetPreamble();\n\n    if (stream.Length < preamble.Length) {\n      return defaultEncoding;\n    }\n\n    long position = stream.Position;\n    Span<byte> buffer = stackalloc byte[preamble.Length];\n    stream.Read(buffer);\n\n    for (int i = 0; i < preamble.Length; i++) {\n      if (buffer[i] != preamble[i]) {\n        encoding = defaultEncoding;\n        break;\n      }\n    }\n\n    stream.Position = position;\n    return encoding;\n  }\n\n  private void Initialize() {\n    dataStreamEncoding_ = DetectUTF8Encoding(dataStream_, Encoding.ASCII);\n    dataReader_ = new StreamReader(dataStream_, dataStreamEncoding_,\n                                   false, STREAM_BUFFER_SIZE);\n    prevLines_ = new string[3];\n    summary_ = new IRTextSummary();\n    functionMap_ = new Dictionary<string, IRTextFunction>();\n    lockObject_ = new object();\n  }\n\n  private void ResetSummaryState() {\n    optionalOutput_ = null;\n    optionalOutputNeeded_ = false;\n    hasPreprocessedLines_ = false;\n    hasMetadataLines_ = false;\n    prevLineCount_ = 0;\n    lineIndex_ = 0;\n  }\n\n  private IRTextSummary GenerateSummaryImpl(ProgressInfoHandler progressHandler,\n                                            SectionTextHandler sectionTextHandler) {\n    // Scan the document once to find the section boundaries,\n    // any before/after text associated with the sections\n    // and build the function -> sections hierarchy.\n    ResetAdditionalOutput();\n    IRTextSection previousSection = null;\n    var updateProgress = () => {\n      if (progressHandler != null) {\n        var info = new SectionReaderProgressInfo(TextOffset(), dataStreamSize_);\n        progressHandler(this, info);\n      }\n    };\n\n    var section = FindNextSection(sectionTextHandler);\n    updateProgress();\n\n    while (section != null) {\n      summary_.AddSection(section);\n\n      if (previousSection != null) {\n        previousSection.OutputAfter = GetAdditionalOutput();\n      }\n\n      section.OutputBefore = GetAdditionalOutput();\n      ResetAdditionalOutput();\n      previousSection = section;\n      section = FindNextSection(sectionTextHandler);\n      updateProgress();\n    }\n\n    if (previousSection != null) {\n      previousSection.OutputAfter = GetAdditionalOutput();\n    }\n\n    return summary_;\n  }\n\n  private IRTextFunction GetOrCreateFunction(string name) {\n    if (functionMap_.TryGetValue(name, out var textFunc)) {\n      return textFunc;\n    }\n\n    textFunc = new IRTextFunction(name);\n    summary_.AddFunction(textFunc);\n    functionMap_.Add(name, textFunc);\n    return textFunc;\n  }\n\n  private string GetPassOutputText(IRPassOutput output, bool isOptionalOutput) {\n    if (output == null) {\n      return \"\";\n    }\n\n    if (!output.HasPreprocessedLines) {\n      // Fast path that avoids reading text line by line.\n      return GetRawPassOutputText(output, isOptionalOutput);\n    }\n\n    // If the file was preloaded in memory, create a new stream\n    // to allow parallel loading of text.\n    if (preloadedData_ != null) {\n      using var streamReader = CreatePreloadedDataReader(output);\n      return ReadPassOutputText(streamReader, output, isOptionalOutput);\n    }\n\n    lock (lockObject_) {\n      return ReadPassOutputText(dataReader_, output, isOptionalOutput);\n    }\n  }\n\n  private List<string> GetPassOutputTextLines(IRPassOutput output, bool isOptionalOutput) {\n    if (output == null) {\n      return new List<string>();\n    }\n\n    // If the file was preloaded in memory, create a new stream\n    // to allow parallel loading of text.\n    if (preloadedData_ != null) {\n      using var streamReader = CreatePreloadedDataReader(output);\n      return ReadPassOutputTextLines(streamReader, output, isOptionalOutput);\n    }\n\n    lock (lockObject_) {\n      return ReadPassOutputTextLines(dataReader_, output, isOptionalOutput);\n    }\n  }\n\n  private SpanStringReader CreatePreloadedDataReader(IRPassOutput output) {\n    return new SpanStringReader(preloadedData_, (int)output.Size, (int)output.DataStartOffset);\n  }\n\n  private string GetRawPassOutputText(IRPassOutput output, bool isOptionalOutput) {\n    if (output == null) {\n      return \"\";\n    }\n\n    if (preloadedData_ != null) {\n      // For some use cases, such as text search on the whole document,\n      // it is much faster to use the unfiltered text and avoid reading\n      // the text line by line to form the final string.\n      var span = preloadedData_.AsMemory((int)output.DataStartOffset, (int)output.Size);\n      return span.ToString();\n    }\n\n    lock (lockObject_) {\n      return ReadPassOutputText(dataReader_, output, isOptionalOutput);\n    }\n  }\n\n  private ReadOnlyMemory<char> GetRawPassOutputTextSpan(IRPassOutput output, bool isOptionalOutput) {\n    if (output == null) {\n      return ReadOnlyMemory<char>.Empty;\n    }\n\n    if (preloadedData_ != null) {\n      // For some use cases, such as text search on the whole document,\n      // it is much faster to use the unfiltered text and avoid reading\n      // the text line by line to form the final string.\n      return preloadedData_.AsMemory((int)output.DataStartOffset, (int)output.Size);\n    }\n\n    lock (lockObject_) {\n      string text = ReadPassOutputText(dataReader_, output, isOptionalOutput);\n      return text.AsMemory();\n    }\n  }\n\n  private string ReadPassOutputText(StreamReader reader, IRPassOutput output,\n                                    bool isOptionalOutput) {\n    reader.BaseStream.Position = output.DataStartOffset;\n    reader.DiscardBufferedData();\n    return ReadPassOutputText((TextReader)reader, output, isOptionalOutput);\n  }\n\n  private string ReadPassOutputText(TextReader reader, IRPassOutput output,\n                                    bool isOptionalOutput) {\n    var builder = new StringBuilder((int)output.Size);\n\n    for (int i = output.StartLine; i <= output.EndLine; i++) {\n      string line = NextLine(reader, false);\n\n      if (isOptionalOutput && ShouldSkipOutputLine(line)) {\n        continue;\n      }\n\n      // Skip over metadata lines, they are not supposed to be part of the IR\n      // and are already saved in the LineMetadata table of the IRTextSection.\n      if (IsMetadataLine(line)) {\n        continue;\n      }\n\n      if (line.Length > MAX_LINE_LENGTH) {\n        line = line.Substring(0, MAX_LINE_LENGTH);\n      }\n\n      builder.AppendLine(line);\n    }\n\n    return builder.ToString();\n  }\n\n  private List<string> ReadPassOutputTextLines(StreamReader reader, IRPassOutput output,\n                                               bool isOptionalOutput) {\n    reader.BaseStream.Position = output.DataStartOffset;\n    reader.DiscardBufferedData();\n    return ReadPassOutputTextLines((TextReader)reader, output, isOptionalOutput);\n  }\n\n  private List<string> ReadPassOutputTextLines(TextReader reader, IRPassOutput output,\n                                               bool isOptionalOutput) {\n    var list = new List<string>(output.LineCount);\n\n    for (int i = output.StartLine; i <= output.EndLine; i++) {\n      string line = NextLine(reader, false);\n\n      if (isOptionalOutput && ShouldSkipOutputLine(line)) {\n        continue;\n      }\n\n      if (line.Length > MAX_LINE_LENGTH) {\n        line = line.Substring(0, MAX_LINE_LENGTH);\n      }\n\n      list.Add(line);\n    }\n\n    return list;\n  }\n\n  private void AddOptionalOutputLine(string line, long initialOffset) {\n    if (optionalOutput_ == null) {\n      // Start a new optional section.\n      long offset = TextOffset();\n      optionalOutput_ = new IRPassOutput(initialOffset, offset, lineIndex_, lineIndex_);\n      optionalOutputNeeded_ = false;\n    }\n\n    optionalOutput_.DataEndOffset = TextOffset();\n    optionalOutput_.EndLine = lineIndex_;\n\n    if (!string.IsNullOrWhiteSpace(line)) {\n      optionalOutputNeeded_ = true;\n\n      if (IsMetadataLine(line)) {\n        hasMetadataLines_ = true;\n      }\n    }\n  }\n\n  private IRPassOutput GetAdditionalOutput() {\n    if (optionalOutput_ != null && optionalOutputNeeded_) {\n      optionalOutput_.HasPreprocessedLines = hasPreprocessedLines_ || hasMetadataLines_;\n      return optionalOutput_;\n    }\n\n    return null;\n  }\n\n  private void ResetAdditionalOutput() {\n    optionalOutput_ = null;\n    hasPreprocessedLines_ = false;\n    hasMetadataLines_ = false;\n  }\n\n  private IRTextSection FindNextSection(SectionTextHandler sectionTextHandler) {\n    prevLineCount_ = 0;\n\n    while (true) {\n      long initialOffset = nextInitialOffset_;\n\n      if (currentLine_ == null ||\n          !IsFunctionEnd(currentLine_) ||\n          !FunctionEndIsFunctionStart(currentLine_)) {\n        currentLine_ = NextLine();\n      }\n\n      if (currentLine_ == null) {\n        break;\n      }\n\n      // Each section is expected to start with a name,\n      // followed by an ASCII \"currentLine_\", which is searched for here,\n      // unless the client indicates that the name may be missing.\n      bool hasSectionName = true;\n\n      if (!IsSectionStart(currentLine_)) {\n        if (!expectSectionHeaders_ &&\n            (IsFunctionStart(currentLine_) || IsBlockStart(currentLine_))) {\n          hasSectionName = false;\n        }\n        else {\n          // Skip over currentLine_.\n          AddOptionalOutputLine(currentLine_, initialOffset);\n          lineIndex_++;\n          continue;\n        }\n      }\n\n      string funcName = string.Empty;\n\n      if (SectionStartIsFunctionStart(currentLine_)) {\n        funcName = ExtractFunctionName(currentLine_);\n        hasSectionName = false;\n      }\n\n      // Collect the text lines if the client wants to process\n      // the text while first reading the document.\n      List<string> sectionLines = null;\n\n      if (sectionTextHandler != null) {\n        sectionLines = new List<string>();\n      }\n\n      // Go back and find the name of the section.\n      // If the current line is both a section and a function start (e.g. ASM 'func:'),\n      // exclude the header from the section body output so tests see only the body.\n      bool isFuncStartLine = SectionStartIsFunctionStart(currentLine_);\n      int sectionStartLine = lineIndex_ + ((hasSectionName || isFuncStartLine) ? 1 : 0);\n      int sectionEndLine = 0;\n      string sectionName = hasSectionName ? ExtractSectionName(currentLine_) : string.Empty;\n\n      // Find the end of the section and extract the function name.\n      long startOffset = (hasSectionName || isFuncStartLine) ? TextOffset() : previousOffset_;\n      long endOffset = startOffset;\n      int blockCount = 0;\n\n      // A section can have metadata associated with the previous line.\n      Dictionary<int, string> lineMetadata = null;\n      int metadataLines = 0;\n\n      while (true) {\n        currentLine_ = NextLine();\n\n        if (currentLine_ == null) {\n          sectionEndLine = lineIndex_ + 1;\n          endOffset = TextOffset();\n          break;\n        }\n\n        if (sectionTextHandler != null) {\n          if (!IsFunctionEnd(currentLine_) || !FunctionEndIsFunctionStart(currentLine_)) {\n            // Add current line as part of section body. Header line was never added because\n            // population starts only after advancing past the section/function start line.\n            sectionLines.Add(currentLine_);\n          }\n        }\n\n        if (string.IsNullOrEmpty(funcName) && IsFunctionStart(currentLine_)) {\n          // Extract function name.\n          funcName = ExtractFunctionName(currentLine_);\n        }\n        else if (IsFunctionEnd(currentLine_)) {\n          // Found function end.\n          endOffset = FunctionEndIsFunctionStart(currentLine_) ? previousOffset_ : TextOffset();\n          sectionEndLine = lineIndex_ + 1;\n          nextInitialOffset_ = endOffset;\n          break;\n        }\n        else if (IsBlockStart(currentLine_)) {\n          blockCount++;\n        }\n        else if (IsMetadataLine(currentLine_)) {\n          // Add line - metadata mapping to auxiliary table.\n          lineMetadata ??= new Dictionary<int, string>();\n          lineMetadata[lineIndex_ - sectionStartLine - metadataLines] = currentLine_;\n          metadataLines++;\n        }\n\n        currentLine_ = null;\n        lineIndex_++;\n      }\n\n      sectionEndLine = Math.Max(sectionEndLine, sectionStartLine);\n      int lines = sectionEndLine - sectionStartLine;\n\n      // Ignore empty sections.\n      if (lines == 0) {\n        lineIndex_++;\n        continue;\n      }\n\n      // Create the a new section and its corresponding function, if needed.\n      var output = new IRPassOutput(startOffset, endOffset,\n                                    sectionStartLine, sectionEndLine) {\n        HasPreprocessedLines = hasPreprocessedLines_ || lineMetadata != null\n      };\n\n      var textFunc = GetOrCreateFunction(funcName);\n      var section = new IRTextSection(textFunc, sectionName, output, blockCount);\n      textFunc.AddSection(section);\n\n      // Notify client a new section has been read.\n      if (sectionTextHandler != null) {\n        sectionTextHandler(this, new SectionReaderText(output, sectionLines));\n      }\n\n      // Attach any metadata lines.\n      if (lineMetadata != null) {\n        section.LineMetadata = lineMetadata;\n        section.CompressLineMetadata();\n      }\n\n      return section;\n    }\n\n    return null;\n  }\n\n  private long ComputeTextOffset(StreamReader reader) {\n    // This is a hack needed to get the proper offset in the stream, see\n    // https://stackoverflow.com/questions/5404267/streamreader-and-seeking\n    // Dynamic code generation is used as an efficient way of reading out the private fields.\n    var fields = StreamReaderFields.Read(reader);\n\n    // The number of bytes the remaining chars use in the original encoding.\n    int numBytesLeft = reader.CurrentEncoding.GetByteCount(fields.CharBuffer, fields.CharPos,\n                                                           fields.CharLen - fields.CharPos);\n\n    // For variable-byte encodings, deal with partial chars at the end of the buffer\n    int numFragments = 0;\n\n    if (fields.ByteLen > 0 && !reader.CurrentEncoding.IsSingleByte) {\n      if (reader.CurrentEncoding.CodePage == 65001) { // UTF-8\n        byte byteCountMask = 0;\n\n        while (fields.ByteBuffer[fields.ByteLen - numFragments - 1] >> 6 == 2\n        ) // if the byte is \"10xx xxxx\", it's a continuation-byte\n        {\n          byteCountMask |=\n            (byte)(1 <<\n                   ++numFragments\n            ); // count bytes & build the \"complete char\" mask\n        }\n\n        if (fields.ByteBuffer[fields.ByteLen - numFragments - 1] >> 6 == 3\n        ) // if the byte is \"11xx xxxx\", it starts a multi-byte char.\n        {\n          byteCountMask |=\n            (byte)(1 <<\n                   ++numFragments\n            ); // count bytes & build the \"complete char\" mask\n        }\n\n        // see if we found as many bytes as the leading-byte says to expect\n        if (numFragments > 1 &&\n            fields.ByteBuffer[fields.ByteLen - numFragments] >> 7 - numFragments ==\n            byteCountMask) {\n          numFragments = 0; // no partial-char in the byte-buffer to account for\n        }\n      }\n      else if (reader.CurrentEncoding.CodePage == 1200) { // UTF-16LE\n        if (fields.ByteBuffer[fields.ByteLen - 1] >= 0xd8) // high-surrogate\n        {\n          numFragments = 2; // account for the partial character\n        }\n      }\n      else if (reader.CurrentEncoding.CodePage == 1201) { // UTF-16BE\n        if (fields.ByteBuffer[fields.ByteLen - 2] >= 0xd8) // high-surrogate\n        {\n          numFragments = 2; // account for the partial character\n        }\n      }\n    }\n\n    return reader.BaseStream.Position - numBytesLeft - numFragments;\n  }\n\n  // Helper to quickly read a couple of private fields of a StreamReader\n  // in order to compute the proper offset in the stream.\n  // This is much faster (up to 10x) than using reflection to get to each field,\n  // which was the main bottleneck in reading text files.\n  // https://tyrrrz.me/blog/expression-trees\n  private class StreamReaderFields {\n    private static Action<StreamReader, StreamReaderFields> callback_;\n    public char[] CharBuffer;\n    public int CharPos;\n    public int CharLen;\n    public byte[] ByteBuffer;\n    public int ByteLen;\n\n    static StreamReaderFields() {\n      // Create and compile to IL a function that reads the private fields\n      // from a StreamReader and saves the values.\n      var inputParam = Expression.Parameter(typeof(StreamReader));\n      var outputParam = Expression.Parameter(typeof(StreamReaderFields));\n      var block = Expression.Block(\n        Expression.Assign(Expression.Field(outputParam, \"CharBuffer\"),\n                          Expression.Field(inputParam, \"_charBuffer\")),\n        Expression.Assign(Expression.Field(outputParam, \"CharPos\"),\n                          Expression.Field(inputParam, \"_charPos\")),\n        Expression.Assign(Expression.Field(outputParam, \"CharLen\"),\n                          Expression.Field(inputParam, \"_charLen\")),\n        Expression.Assign(Expression.Field(outputParam, \"ByteBuffer\"),\n                          Expression.Field(inputParam, \"_byteBuffer\")),\n        Expression.Assign(Expression.Field(outputParam, \"ByteLen\"),\n                          Expression.Field(inputParam, \"_byteLen\"))\n      );\n\n      callback_ = Expression.Lambda<Action<StreamReader, StreamReaderFields>>\n        (block, inputParam, outputParam).Compile();\n    }\n\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    public static StreamReaderFields Read(StreamReader reader) {\n      var readerFields = new StreamReaderFields();\n      callback_(reader, readerFields);\n      return readerFields;\n    }\n  }\n\n  // Simple TextReader that can be used with a span or a substring.\n  private class SpanStringReader : TextReader {\n    private ReadOnlyMemory<char> data_;\n    private int position_;\n    private int endPosition_;\n\n    public SpanStringReader(ReadOnlyMemory<char> value, int length, int position = 0) {\n      data_ = value;\n      endPosition_ = position + length;\n      position_ = position;\n    }\n\n    public SpanStringReader(ReadOnlyMemory<char> value, int position = 0) :\n      this(value, value.Length, position) {\n    }\n\n    public SpanStringReader(string value, int length, int position = 0) {\n      data_ = value.AsMemory();\n      endPosition_ = position + length;\n      position_ = position;\n    }\n\n    public SpanStringReader(string value, int position = 0) :\n      this(value, value.Length, position) {\n    }\n\n    public int Position => position_;\n\n    public override int Read() {\n      if (position_ == endPosition_) {\n        return -1;\n      }\n\n      return data_.Span[position_++];\n    }\n\n    public override int Peek() {\n      if (position_ == endPosition_) {\n        return -1;\n      }\n\n      return data_.Span[position_];\n    }\n  }\n\n        #region IDisposable Support\n\n  private bool disposed_;\n\n  protected void Dispose(bool disposing) {\n    if (!disposed_) {\n      dataReader_?.Dispose();\n      dataStream_?.Dispose();\n      dataReader_ = null;\n      dataStream_ = null;\n      preloadedData_ = null;\n      disposed_ = true;\n    }\n  }\n\n  ~SectionReaderBase() {\n    Dispose(false);\n  }\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n        #endregion\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Session/BaseSession.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reflection.Metadata;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.ETW;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\nusing static System.Collections.Specialized.BitVector32;\n\nnamespace ProfileExplorer.Core.Session;\n\npublic enum SessionKind {\n  Default = 0,\n  FileSession = 1,\n  DebugSession = 2\n}\npublic class BaseSession : ISession\n{\n  private ICompilerInfoProvider compilerInfo_;\n  private ProfileData profileData_;\n  private List<ILoadedDocument> documents_;\n\n  public ICompilerInfoProvider CompilerInfo => compilerInfo_;\n  public ProfileData ProfileData => profileData_;\n  public IReadOnlyList<ILoadedDocument> Documents => documents_;\n\n  public BaseSession()\n  {\n    profileData_ = null;\n    documents_ = new List<ILoadedDocument>();\n  }\n\n  public async Task<bool> LoadProfileData(string profileFilePath, List<int> processIds, ProfileDataProviderOptions options, SymbolFileSourceSettings symbolSettings, ProfileDataReport report, ProfileLoadProgressHandler progressCallback, CancelableTask cancelableTask) {    \n    using var provider = new ETWProfileDataProvider();\n\n    provider.SetupNewSessionRequested += OnSetupNewSessionRequested;\n    provider.StartNewSessionRequested += OnStartNewSessionRequested;\n\n    var result = await provider.LoadTraceAsync(profileFilePath, processIds,\n                                               options, symbolSettings,\n                                               report, progressCallback, cancelableTask);\n\n    if (result != null) {\n      result.Report = report;\n      profileData_ = result;\n      UnloadProfilingDebugInfo();\n    }\n\n    return result != null;\n  }\n\n  private async Task OnStartNewSessionRequested(string sessionName, SessionKind sessionKind, ICompilerInfoProvider compilerInfo) {\n    compilerInfo_ = compilerInfo;\n  }\n\n  private async Task OnSetupNewSessionRequested(ILoadedDocument mainDocument, List<ILoadedDocument> otherDocuments, ProfileData profileData) {\n    documents_.Add(mainDocument);\n    documents_.AddRange(otherDocuments);\n  }\n\n  public async Task<ParsedIRTextSection> LoadAndParseSection(IRTextSection section) {\n    var summary = section.ParentFunction.ParentSummary;\n    var docInfo = FindLoadedDocument(section);\n\n    // This shouldn't happen if document was loaded properly...\n    if (docInfo == null || docInfo.Loader == null) {\n      Trace.WriteLine($\"Failed LoadAndParseSection for function {section.ParentFunction.Name}\");\n      return null;\n    }\n\n    var parsedSection = docInfo.Loader.LoadSection(section);\n\n    if (parsedSection != null && parsedSection.Function != null) {\n      var funcDebugInfo = ProfileData?.GetFunctionProfile(section.ParentFunction)?.FunctionDebugInfo;\n      var loadedDoc = FindLoadedDocument(section.ParentFunction);\n      await compilerInfo_.AnalyzeLoadedFunction(parsedSection.Function, section, loadedDoc, funcDebugInfo);\n      return parsedSection;\n    }\n\n    string placeholderText = \"Could not find function code\";\n    var dummyFunc = new FunctionIR(section.ParentFunction.Name);\n    return new ParsedIRTextSection(section, placeholderText.AsMemory(), dummyFunc) {\n      LoadFailed = true\n    };\n  }\n\n  private ILoadedDocument FindLoadedDocument(IRTextSection section) {\n    var summary = section.ParentFunction.ParentSummary;\n    return documents_.Find(item => item.Summary == summary);\n  }\n\n  private ILoadedDocument FindLoadedDocument(IRTextFunction func) {\n    var summary = func.ParentSummary;\n    return documents_.Find(item => item.Summary == summary);\n  }\n\n  private void UnloadProfilingDebugInfo() {\n    if (ProfileData == null) {\n      return;\n    }\n\n    // Free memory used by the debug info by unloading any objects\n    // such as the PDB DIA reader using COM.\n    Task.Run(() => {\n      foreach ((string module, var debugInfo) in ProfileData.ModuleDebugInfo) {\n        debugInfo.Unload();\n      }\n    });\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Session/ILoadedDocument.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection.Metadata;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Session;\n\n/// <summary>\n/// Delegate for lazy binary loading. Called when binary is needed but not yet loaded.\n/// </summary>\npublic delegate Task<bool> EnsureBinaryLoadedDelegate();\n\npublic interface ILoadedDocument : IDisposable {\n  Guid Id { get; set; }\n  string ModuleName { get; set; }\n  string FilePath { get; set; }\n  BinaryFileSearchResult BinaryFile { get; set; }\n  DebugFileSearchResult DebugInfoFile { get; set; }\n  SymbolFileDescriptor SymbolFileInfo { get; set; }\n  IRTextSectionLoader Loader { get; set; }\n  IRTextSummary Summary { get; set; }\n  IDebugInfoProvider DebugInfo { get; set; }\n  bool IsDummyDocument { get; }\n  bool DebugInfoFileExists { get; }\n  bool BinaryFileExists { get; }\n  bool HasSymbolFileInfo { get; }\n  string FileName { get; }\n\n  /// <summary>\n  /// Callback for lazy binary loading. Set by ProfileModuleBuilder during profiling.\n  /// Call this before accessing assembly/disassembly to ensure binary is downloaded.\n  /// </summary>\n  EnsureBinaryLoadedDelegate EnsureBinaryLoaded { get; set; }\n\n  public event EventHandler DocumentChanged;\n  public void SetupDocumentWatcher();\n  public void ChangeDocumentWatcherState(bool enabled);\n\n  public void AddDummyFunctions(List<string> funcNames);\n  IRTextFunction AddDummyFunction(string name);\n  void SaveSectionState(object stateObject, IRTextSection section);\n  object LoadSectionState(IRTextSection section);\n  ILoadedDocumentState SerializeDocument();\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Session/ILoadedDocumentState.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.Core.Session;\n\npublic interface ILoadedDocumentState {\n  Guid Id { get; set; }\n  string ModuleName { get; set; }\n  string FilePath { get; set; }\n  BinaryFileSearchResult BinaryFile { get; set; }\n  DebugFileSearchResult DebugInfoFile { get; set; }\n  byte[] DocumentText { get; set; }\n  List<Tuple<int, byte[]>> SectionStates { get; set; }\n  List<string> FunctionNames { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Session/ISession.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Reflection.Metadata;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.Core.Session;\n\npublic interface ISession {\n  ICompilerInfoProvider CompilerInfo { get; }\n  ProfileData ProfileData { get; }\n  IReadOnlyList<ILoadedDocument> Documents { get; }\n\n  Task<bool> LoadProfileData(string profileFilePath, List<int> processIds, ProfileDataProviderOptions options, SymbolFileSourceSettings symbolSettings, ProfileDataReport report, ProfileLoadProgressHandler progressCallback, CancelableTask cancelableTask);\n\n  Task<ParsedIRTextSection> LoadAndParseSection(IRTextSection section);\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Session/LoadedDocument.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Utils;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Session;\n\n[ProtoContract]\npublic class LoadedDocumentState : ILoadedDocumentState {\n  [ProtoMember(1)]\n  public Guid Id { get; set; }\n  [ProtoMember(2)]\n  public string ModuleName { get; set; }\n  [ProtoMember(3)]\n  public string FilePath { get; set; }\n  [ProtoMember(4)]\n  public BinaryFileSearchResult BinaryFile { get; set; }\n  [ProtoMember(5)]\n  public DebugFileSearchResult DebugInfoFile { get; set; }\n  [ProtoMember(6)]\n  public byte[] DocumentText { get; set; }\n  [ProtoMember(7)]\n  public List<Tuple<int, byte[]>> SectionStates { get; set; }\n  [ProtoMember(8)]\n  public List<string> FunctionNames { get; set; }\n\n  public LoadedDocumentState() {\n    SectionStates = new List<Tuple<int, byte[]>>();\n    FunctionNames = new List<string>();\n  }\n\n  public LoadedDocumentState(Guid id) : this() {\n    Id = id;\n  }\n}\n\npublic class LoadedDocument : ILoadedDocument {\n  public Dictionary<IRTextSection, object> SectionStates;\n  private FileSystemWatcher documentWatcher_;\n  private IRTextSummary summary_;\n  private bool disposed_;\n\n  public LoadedDocument(string filePath, string modulePath, Guid id) {\n    FilePath = filePath;\n    ModuleName = Utils.TryGetFileName(modulePath ?? filePath);\n    Id = id;\n    SectionStates = new Dictionary<IRTextSection, object>();\n  }\n\n  public Guid Id { get; set; }\n  public string ModuleName { get; set; }\n  public string FilePath { get; set; }\n  public BinaryFileSearchResult BinaryFile { get; set; }\n  public DebugFileSearchResult DebugInfoFile { get; set; }\n  public SymbolFileDescriptor SymbolFileInfo { get; set; }\n  public IRTextSectionLoader Loader { get; set; }\n\n  public IRTextSummary Summary {\n    get => summary_;\n    set {\n      summary_ = value;\n      if (summary_ != null) {\n        summary_.Id = Id;\n        summary_.SetModuleName(ModuleName);\n      }\n    }\n  }\n\n  public IDebugInfoProvider DebugInfo { get; set; } // Used for managed binaries.\n  public bool IsDummyDocument => Loader is DummySectionLoader;\n  public bool DebugInfoFileExists => DebugInfoFile is {Found: true};\n  public bool BinaryFileExists => BinaryFile is {Found: true};\n  public bool HasSymbolFileInfo => SymbolFileInfo != null;\n  public string FileName => Utils.TryGetFileName(FilePath);\n  public EnsureBinaryLoadedDelegate EnsureBinaryLoaded { get; set; }\n\n  public event EventHandler DocumentChanged;\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  public static LoadedDocument CreateDummyDocument(string name) {\n    return CreateDummyDocument(name, Guid.NewGuid());\n  }\n\n  public static LoadedDocument CreateDummyDocument(string name, Guid id) {\n    var doc = new LoadedDocument(name, name, id);\n    doc.Summary = new IRTextSummary(name);\n    doc.Loader = new DummySectionLoader(); // Placeholder used to prevent null pointers.\n    return doc;\n  }\n\n  public IRTextFunction AddDummyFunction(string name) {\n    var func = new IRTextFunction(name);\n    func.ParentSummary = summary_;\n    var section = new IRTextSection(func, func.Name, IRPassOutput.Empty);\n    func.AddSection(section);\n    summary_.AddFunction(func);\n    summary_.AddSection(section);\n    return func;\n  }\n\n  public void AddDummyFunctions(List<string> funcNames) {\n    foreach (string name in funcNames) {\n      if (summary_.FindFunction(name) == null) {\n        AddDummyFunction(name);\n      }\n    }\n  }\n\n  public void SaveSectionState(object stateObject, IRTextSection section) {\n    SectionStates[section] = stateObject;\n  }\n\n  public object LoadSectionState(IRTextSection section) {\n    return SectionStates.TryGetValue(section, out object stateObject) ? stateObject : null;\n  }\n\n  public void SetupDocumentWatcher() {\n    try {\n      string fileDir = Path.GetDirectoryName(FilePath);\n      string fileName = Path.GetFileName(FilePath);\n      documentWatcher_ = new FileSystemWatcher(fileDir, fileName);\n      documentWatcher_.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size;\n      documentWatcher_.Changed += DocumentWatcher_Changed;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to setup document watcher for file {FilePath}: {ex.Message}\");\n      documentWatcher_ = null;\n    }\n  }\n\n  public void ChangeDocumentWatcherState(bool enabled) {\n    if (documentWatcher_ != null) {\n      documentWatcher_.EnableRaisingEvents = enabled;\n    }\n  }\n\n  public virtual ILoadedDocumentState SerializeDocument() {\n    var state = new LoadedDocumentState(Id) {\n      ModuleName = ModuleName, FilePath = FilePath, BinaryFile = BinaryFile,\n      DebugInfoFile = DebugInfoFile,\n      DocumentText = Loader.GetDocumentTextBytes()\n    };\n\n    foreach (var sectionState in SectionStates) {\n      state.SectionStates.Add(new Tuple<int, byte[]>(sectionState.Key.Id,\n                                                     sectionState.Value as byte[]));\n    }\n\n    // Used by profiling to represent missing binaries.\n    foreach (var func in summary_.Functions) {\n      state.FunctionNames.Add(func.Name);\n    }\n\n    return state;\n  }\n\n  private void DocumentWatcher_Changed(object sender, FileSystemEventArgs e) {\n    if (e.ChangeType != WatcherChangeTypes.Changed) {\n      return;\n    }\n\n    DocumentChanged?.Invoke(this, EventArgs.Empty);\n  }\n\n  protected virtual void Dispose(bool disposing) {\n    if (!disposed_) {\n      if (disposing) {\n        documentWatcher_?.Dispose();\n      }\n      Loader?.Dispose();\n      Loader = null;\n      Summary = null;\n      documentWatcher_ = null;\n      disposed_ = true;\n    }\n  }\n\n  ~LoadedDocument() {\n    Dispose(false);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Session/StateSerializer.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reflection;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProtoBuf;\nusing ProtoBuf.Meta;\n\nnamespace ProfileExplorer.Core.Session;\n\npublic static class StateSerializer {\n  public static readonly int subtypeIdStep_ = 100;\n  public static int nextSubtypeId_;\n  private static bool isInitialized_;\n  private static readonly object initLock_ = new object();\n\n  static StateSerializer() {\n    Initialize();\n  }\n\n  public static void Initialize() {\n    lock (initLock_) {\n      if (!isInitialized_) {\n        RuntimeTypeModel.Default.InternStrings = true;\n        isInitialized_ = true;\n      }\n    }\n  }\n\n  public static void RegisterSurrogate<T1, T2>() {\n    RegisterSurrogate(typeof(T1), typeof(T2));\n  }\n\n  public static void RegisterSurrogate(Type realType, Type surrogateType) {\n    var model = RuntimeTypeModel.Default;\n    model.Add(surrogateType);\n    model.Add(realType, false).SetSurrogate(surrogateType);\n  }\n\n  public static void RegisterDerivedClass<T1, T2>(int id = 0) {\n    RegisterDerivedClass(typeof(T1), typeof(T2), id);\n  }\n\n  public static void RegisterDerivedClass(Type derivedType, Type baseType, int id = 0) {\n    var model = RuntimeTypeModel.Default;\n\n    if (id == 0) {\n      nextSubtypeId_ += subtypeIdStep_;\n      id = nextSubtypeId_;\n    }\n\n    model.Add(baseType, false).AddSubType(id, derivedType);\n  }\n\n  public static byte[] Serialize<T>(T state, FunctionIR function = null) where T : class {\n    using var stream = new MemoryStream();\n    Serializer.Serialize(stream, state);\n    return stream.ToArray();\n  }\n\n  public static bool Serialize<T>(string filePath, T state, FunctionIR function = null) where T : class {\n    using var stream = new FileStream(filePath, FileMode.CreateNew, FileAccess.ReadWrite);\n    Serializer.Serialize(stream, state);\n    return true;\n  }\n\n  public static T Deserialize<T>(byte[] data, FunctionIR function) where T : class {\n    var value = Deserialize<T>(data);\n\n    if (value != null) {\n      PatchIRElementObjects(value, function);\n      return value;\n    }\n\n    return null;\n  }\n\n  public static T Deserialize<T>(byte[] data) where T : class {\n    if (data == null) {\n      return null;\n    }\n\n    var stream = new MemoryStream(data);\n    return Serializer.Deserialize<T>(stream);\n  }\n\n  public static T Deserialize<T>(string filePath) where T : class {\n    using var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);\n    return Serializer.Deserialize<T>(stream);\n  }\n\n  public static T Deserialize<T>(object data, FunctionIR function) where T : class {\n    return Deserialize<T>((byte[])data, function);\n  }\n\n  public static T Deserialize<T>(object data) where T : class {\n    return Deserialize<T>((byte[])data);\n  }\n\n  public static void PatchIRElementObjects(object value, FunctionIR function) {\n    if (value == null) {\n      return;\n    }\n\n    if (value is IRElementReference elementRef) {\n      elementRef.Value = function.GetElementWithId(elementRef.Id);\n      return;\n    }\n\n    if (!value.GetType().GetTypeInfo().IsClass) {\n      return; // Don't walk primitive types.\n    }\n\n    if (value is IList list) {\n      foreach (object item in list) {\n        PatchIRElementObjects(item, function);\n      }\n    }\n    else if (value is IDictionary dict) {\n      foreach (object item in dict.Keys) {\n        PatchIRElementObjects(item, function);\n      }\n\n      foreach (object item in dict.Values) {\n        PatchIRElementObjects(item, function);\n      }\n    }\n    else {\n      var fields = value.GetType().GetFields(BindingFlags.Public |\n                                             BindingFlags.NonPublic |\n                                             BindingFlags.Instance);\n\n      foreach (var field in fields) {\n        PatchIRElementObjects(field.GetValue(value), function);\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/DiffSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.ComponentModel;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Session;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Settings;\n\n[ProtoContract(SkipConstructor = true)]\npublic class DiffSettings : SettingsBase {\n  public DiffSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool IdentifyMinorDiffs { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool FilterInsignificantDiffs { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool ManyDiffsMarkWholeLine { get; set; }\n  [ProtoMember(4)][OptionValue(60)]\n  public int ManyDiffsModificationPercentage { get; set; }\n  [ProtoMember(5)][OptionValue(75)]\n  public int ManyDiffsInsertionPercentage { get; set; }\n  [ProtoMember(6)][OptionValue(DiffImplementationKind.Internal)]\n  [DefaultValue(DiffImplementationKind.Internal)]\n  public DiffImplementationKind DiffImplementation { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool FilterTempVariableNames { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool FilterSSADefNumbers { get; set; }\n  [ProtoMember(9)][OptionValue(true)]\n  public bool ShowInsertions { get; set; }\n  [ProtoMember(10)][OptionValue(true)]\n  public bool ShowDeletions { get; set; }\n  [ProtoMember(11)][OptionValue(true)]\n  public bool ShowModifications { get; set; }\n  [ProtoMember(12)][OptionValue(true)]\n  public bool ShowMinorModifications { get; set; }\n\n  [ProtoMember(13)]\n  [OptionValue(\"\")]\n  public string ExternalDiffAppPath { get; set; }\n  public bool ShowAnyChanges => ShowInsertions || ShowDeletions || ShowModifications || ShowMinorModifications;\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public virtual DiffSettings Clone() {\n    byte[] serialized = StateSerializer.Serialize(this);\n    return StateSerializer.Deserialize<DiffSettings>(serialized);\n  }\n\n  public bool HasDiffHandlingChanges(DiffSettings other) {\n    return other.IdentifyMinorDiffs != IdentifyMinorDiffs ||\n           other.FilterInsignificantDiffs != FilterInsignificantDiffs ||\n           other.FilterTempVariableNames != FilterTempVariableNames ||\n           other.FilterSSADefNumbers != FilterSSADefNumbers ||\n           other.ManyDiffsMarkWholeLine != ManyDiffsMarkWholeLine ||\n           other.ManyDiffsInsertionPercentage != ManyDiffsInsertionPercentage ||\n           other.ManyDiffsModificationPercentage != ManyDiffsModificationPercentage ||\n           other.DiffImplementation != DiffImplementation ||\n           other.ShowInsertions != ShowInsertions ||\n           other.ShowDeletions != ShowDeletions ||\n           other.ShowModifications != ShowModifications ||\n           other.ShowMinorModifications != ShowMinorModifications;\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  [ProtoAfterDeserialization]\n  private void AfterDeserialization() {\n    if (!ShowAnyChanges) {\n      ShowInsertions = true;\n      ShowDeletions = true;\n      ShowModifications = true;\n      ShowMinorModifications = true;\n    }\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/GeneralSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Settings;\n\n[ProtoContract(SkipConstructor = true)]\npublic class GeneralSettings : SettingsBase {\n  private static int MinCpuCoreLimit = 1;\n  private static int MaxCpuCoreLimit = 16;\n  private static readonly double MinZoomAmount = 0.5;\n  private static readonly double MaxZoomAmount = 2;\n  private static readonly double ZoomStep = 0.05;\n  public static readonly double DefaultCpuCoreLimit = 0.75;\n\n  // Under a Remote Desktop session, disable animations\n  // even if enabled otherwise by the user.\n  private static readonly bool GlobalDisableAnimations = NativeMethods.IsRemoteDesktopSession();\n\n  public GeneralSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(false)]\n  public bool DisableHardwareRendering { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool CheckForUpdates { get; set; }\n  [ProtoMember(3)][OptionValue(1.0)]\n  public double WindowScaling { get; set; }\n  [ProtoMember(4)][OptionValue(0)]\n  public int ThemeIndex { get; set; }\n  [ProtoMember(5)][OptionValue(0.75)]\n  public double CpuCoreLimit { get; set; }\n  [ProtoMember(6)][OptionValue(false)]\n  public bool DisableAnimations { get; set; }\n  public int CurrentCpuCoreLimit => (int)Math.Clamp(Math.Floor(CpuCoreLimit * Environment.ProcessorCount),\n                                                    MinCpuCoreLimit, MaxCpuCoreLimit);\n  public bool UseAnimations => !DisableAnimations && !GlobalDisableAnimations;\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public double ZoomInWindow() {\n    WindowScaling = Math.Clamp(WindowScaling + ZoomStep, MinZoomAmount, MaxZoomAmount);\n    return WindowScaling;\n  }\n\n  public double ZoomOutWindow() {\n    WindowScaling = Math.Clamp(WindowScaling - ZoomStep, MinZoomAmount, MaxZoomAmount);\n    return WindowScaling;\n  }\n\n  public double ResetWindowZoom() {\n    WindowScaling = 1.0;\n    return WindowScaling;\n  }\n\n  public GeneralSettings Clone() {\n    byte[] serialized = StateSerializer.Serialize(this);\n    return StateSerializer.Deserialize<GeneralSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/ISettingsProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.Core.Settings;\n\n/// <summary>\n/// Interface for providing access to application settings.\n/// This allows the UI project to override default settings used by the Core project.\n/// </summary>\npublic interface ISettingsProvider {\n  SymbolFileSourceSettings SymbolSettings { get; }\n  ProfileDataProviderOptions ProfileOptions { get; }\n  SectionSettings SectionSettings { get; }\n  DiffSettings DiffSettings { get; }\n  GeneralSettings GeneralSettings { get; }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/ISettingsTypeConverter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.Core.Settings;\n\n/// <summary>\n/// Interface for custom type converters used in settings serialization/deserialization.\n/// Allows registration of type-specific conversion logic for complex types.\n/// </summary>\npublic interface ISettingsTypeConverter {\n  /// <summary>\n  /// Gets the target type this converter handles.\n  /// </summary>\n  Type TargetType { get; }\n\n  /// <summary>\n  /// Converts a string value to the target type.\n  /// </summary>\n  /// <param name=\"stringValue\">The string representation of the value.</param>\n  /// <returns>The converted value of the target type.</returns>\n  object ConvertFromString(string stringValue);\n\n  /// <summary>\n  /// Converts an array of string values to an array of the target type.\n  /// </summary>\n  /// <param name=\"stringArray\">The array of string representations.</param>\n  /// <returns>An array of converted values of the target type.</returns>\n  Array ConvertFromStringArray(string[] stringArray);\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/ProfileDataProviderOptions.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Settings;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProfileDataProviderOptions : SettingsBase {\n  public ProfileDataProviderOptions() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(false)]\n  public bool BinarySearchPathsEnabled { get; set; }\n  [ProtoMember(2)][OptionValue(false)]\n  public bool BinaryNameAllowedListEnabled { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool DownloadBinaryFiles { get; set; }\n  [ProtoMember(4)][OptionValue()]\n  public List<string> BinarySearchPaths { get; set; }\n  [ProtoMember(5)][OptionValue()]\n  public List<string> BinaryNameAllowedList { get; set; }\n  [ProtoMember(6)][OptionValue(false)]\n  public bool MarkInlinedFunctions { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool IncludeKernelEvents { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool IncludePerformanceCounters { get; set; }\n  [ProtoMember(9)][OptionValue()]\n  public ProfileRecordingSessionOptions RecordingSessionOptions { get; set; }\n  [ProtoMember(10)][OptionValue()]\n  public List<PerformanceMetricConfig> PerformanceMetrics { get; set; }\n  [ProtoMember(11)][OptionValue()]\n  public List<ProfileDataReport> PreviousRecordingSessions { get; set; }\n  [ProtoMember(12)][OptionValue()]\n  public List<ProfileDataReport> PreviousLoadedSessions { get; set; }\n  public bool HasBinaryNameAllowedList => BinaryNameAllowedListEnabled && BinaryNameAllowedList.Count > 0;\n  public bool HasBinarySearchPaths => BinarySearchPathsEnabled && BinarySearchPaths.Count > 0;\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public bool AddPerformanceMetric(PerformanceMetricConfig config) {\n    if (!PerformanceMetrics.Contains(config)) {\n      PerformanceMetrics.Add(config);\n      return true;\n    }\n\n    return false;\n  }\n\n  public bool HasBinaryPath(string path) {\n    path = Utils.TryGetDirectoryName(path).ToLowerInvariant();\n    return BinarySearchPaths.Find(item => item.ToLowerInvariant() == path) != null;\n  }\n\n  public void InsertBinaryPath(string path) {\n    if (string.IsNullOrEmpty(path) || HasBinaryPath(path)) {\n      return;\n    }\n\n    path = Utils.TryGetDirectoryName(path);\n\n    if (!string.IsNullOrEmpty(path)) {\n      BinarySearchPaths.Insert(0, path);\n    }\n  }\n\n  public ProfileDataProviderOptions Clone() {\n    byte[] serialized = StateSerializer.Serialize(this);\n    return StateSerializer.Deserialize<ProfileDataProviderOptions>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/ProfileOptions.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Session;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Settings;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProfileRecordingSessionOptions : SettingsBase, IEquatable<ProfileRecordingSessionOptions> {\n  public const int DefaultSamplingFrequency = 4000;\n  public const int MaximumSamplingFrequency = 8000;\n\n  public ProfileRecordingSessionOptions() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(ProfileSessionKind.StartProcess)]\n  public ProfileSessionKind SessionKind { get; set; }\n  [ProtoMember(2)][OptionValue(\"\")]\n  public string ApplicationPath { get; set; }\n  [ProtoMember(3)][OptionValue(\"\")]\n  public string ApplicationArguments { get; set; }\n  [ProtoMember(4)][OptionValue(\"\")]\n  public string WorkingDirectory { get; set; }\n  [ProtoMember(5)][OptionValue(4000)] // 4 kHz, Xperf default is 1 kHz.\n  public int SamplingFrequency { get; set; }\n  [ProtoMember(6)][OptionValue(false)]\n  public bool ProfileDotNet { get; set; }\n  [ProtoMember(7)][OptionValue(false)]\n  public bool ProfileChildProcesses { get; set; }\n  [ProtoMember(8)][OptionValue(false)]\n  public bool RecordPerformanceCounters { get; set; }\n  [ProtoMember(9)][OptionValue(false)]\n  public bool EnableEnvironmentVars { get; set; }\n  [ProtoMember(10)][OptionValue()]\n  public List<(string Variable, string Value)> EnvironmentVariables { get; set; }\n  [ProtoMember(11)][OptionValue()]\n  public List<PerformanceCounterConfig> PerformanceCounters { get; set; }\n  [ProtoMember(12)][OptionValue(\"\")]\n  public string Title { get; set; }\n  [ProtoMember(13)][OptionValue(0)]\n  public int TargetProcessId { get; set; }\n  [ProtoMember(14)][OptionValue(false)]\n  public bool RecordDotNetAssembly { get; set; }\n  public List<PerformanceCounterConfig> EnabledPerformanceCounters => PerformanceCounters.FindAll(c => c.IsEnabled);\n  public bool HasWorkingDirectory => Directory.Exists(WorkingDirectory);\n  public bool HasTitle => !string.IsNullOrEmpty(Title);\n\n  public bool Equals(ProfileRecordingSessionOptions other) {\n    return AreOptionsEqual(this, other);\n  }\n\n  public static bool operator ==(ProfileRecordingSessionOptions left, ProfileRecordingSessionOptions right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(ProfileRecordingSessionOptions left, ProfileRecordingSessionOptions right) {\n    return !Equals(left, right);\n  }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public bool AddPerformanceCounter(PerformanceCounterConfig config) {\n    if (!PerformanceCounters.Contains(config)) {\n      PerformanceCounters.Add(config);\n      return true;\n    }\n\n    return false;\n  }\n\n  public ProfileRecordingSessionOptions Clone() {\n    byte[] serialized = StateSerializer.Serialize(this);\n    return StateSerializer.Deserialize<ProfileRecordingSessionOptions>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/SectionSettings.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Providers;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Settings;\n\n/// <summary>\n/// Core section settings with properties needed by the Core project.\n/// This is a minimal implementation that can be overridden by UI-specific settings.\n/// </summary>\n[ProtoContract(SkipConstructor = true)]\npublic class SectionSettings : SettingsBase {\n  public SectionSettings() {\n    Reset();\n  }\n\n  // Properties needed by Core project\n  public virtual bool ShowDemangledNames { get; set; } = true;\n  public virtual FunctionNameDemanglingOptions DemanglingOptions { get; set; } = FunctionNameDemanglingOptions.Default;\n\n  public override void Reset() {\n    ShowDemangledNames = true;\n    DemanglingOptions = FunctionNameDemanglingOptions.Default;\n  }\n\n  public virtual SectionSettings Clone() {\n    return new SectionSettings \n    {\n      ShowDemangledNames = this.ShowDemangledNames,\n      DemanglingOptions = this.DemanglingOptions\n    };\n  }\n\n  public override bool Equals(object obj) {\n    if (obj is SectionSettings other)\n    {\n      return ShowDemangledNames == other.ShowDemangledNames &&\n             DemanglingOptions == other.DemanglingOptions;\n    }\n    return false;\n  }\n\n  public override string ToString() {\n    return $\"ShowDemangledNames: {ShowDemangledNames}, DemanglingOptions: {DemanglingOptions}\";\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/SettingsBase.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Reflection;\nusing System.Text;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Settings;\n\n// A typical settings class should:\n// - should inherit from SettingsBase and be marked with ProtoContract.\n// - have a constructor that calls Reset() and is skipped by ProtoBuf.\n// - have a ProtoMember for each setting with an OptionValue default value.\n// - have a ProtoAfterDeserialization method that initializes reference members.\n// - have a Reset method that calls ResetAllOptions.\n// - have an Equals method that calls AreSettingsOptionsEqual.\n//\n// Type handling registry for custom type conversion\npublic static class SettingsTypeRegistry {\n  private static readonly Dictionary<Type, ISettingsTypeConverter> _converters = new();\n\n  /// <summary>\n  /// Registers a type converter for use in settings serialization/deserialization.\n  /// </summary>\n  /// <param name=\"converter\">The type converter to register.</param>\n  public static void RegisterConverter(ISettingsTypeConverter converter) {\n    if (converter == null) throw new ArgumentNullException(nameof(converter));\n    _converters[converter.TargetType] = converter;\n  }\n\n  /// <summary>\n  /// Gets a registered converter for the specified type.\n  /// </summary>\n  /// <param name=\"type\">The type to get a converter for.</param>\n  /// <returns>The registered converter, or null if none is registered.</returns>\n  internal static ISettingsTypeConverter GetConverter(Type type) {\n    _converters.TryGetValue(type, out var converter);\n    return converter;\n  }\n\n  /// <summary>\n  /// Clears all registered converters. Primarily for testing purposes.\n  /// </summary>\n  public static void ClearConverters() {\n    _converters.Clear();\n  }\n}\n// - have a ToString method that calls PrintOptions.\n// - have a Clone method that serializes and deserializes the object.\n//\n// Example:\n// [ProtoContract(SkipConstructor = true)]\n// public class ExampleSettings : SettingsBase {\n//   [ProtoMember(1), OptionValue(\"Default Value\")]\n//   public string SomeSetting { get; set; }\n//\n//   public ExampleSettings() {\n//     Reset();\n//   }\n//\n//   public override void Reset() {\n//     InitializeReferenceMembers();\n//     ResetAllOptions(this);\n//   }\n//\n//   [ProtoAfterDeserialization]\n//   private void InitializeReferenceMembers() {\n//     // Initialize reference members here.\n//   }\n//\n//   public override bool Equals(object obj) {\n//     return AreSettingsOptionsEqual(this, obj);\n//   }\n//\n//   public override string ToString() {\n//     return PrintOptions(this);\n//   }\n//\n//   public ExampleSettings Clone() {\n//     byte[] serialized = StateSerializer.Serialize(this);\n//     return StateSerializer.Deserialize<ExampleSettings>(serialized);\n//   }\n// }\n\n// A unique identifier for an option value, combines the class name\n// with the ProtoBuf ProtoMember Id tag, which should remain stable\n// across versions of the app.\npublic record OptionValueId(string ClassName, int MemberId);\n\n// Attribute to specify the default value of an option.\n[AttributeUsage(AttributeTargets.All)]\npublic class OptionValueAttribute : Attribute {\n  public OptionValueAttribute() {\n    // Create new object of type, calling default constructor.\n    CreateNewInstance = true;\n  }\n\n  public OptionValueAttribute(object value) {\n    // Set value to the primitive value passed in.\n    Value = value;\n  }\n\n  public object Value { get; set; }\n  public bool CreateNewInstance { get; set; }\n}\n\npublic class SettingsBase {\n  private static void EmptyVisitOptionAction(object settings, PropertyInfo property,\n                                             OptionValueAttribute optionAttr, OptionValueId optionId) {\n  }\n\n  private static void EmptyVisitSettingsAction(object settings, int level) { }\n\n  private static void EmptyVisitNestedSettingsAction(object nestedSettings, PropertyInfo property, bool isCollection) {\n  }\n\n  public virtual void Reset() { }\n\n  public static HashSet<OptionValueId> CollectOptionMembers(object settings) {\n    var set = new HashSet<OptionValueId>();\n    CollectOptionMembers(settings, set);\n    return set;\n  }\n\n  public static void CollectOptionMembers(object settings, HashSet<OptionValueId> set) {\n    var type = settings.GetType();\n    var visited = new HashSet<Type>();\n    CollectOptionMembers(type, set, visited);\n  }\n\n  private static ProtoIncludeAttribute FindMatchingProtoInclude(Type baseType, Type derivedType) {\n    foreach (var attr in baseType.GetCustomAttributes<ProtoIncludeAttribute>()) {\n      if (attr.KnownType == derivedType) {\n        return attr;\n      }\n    }\n\n    return null;\n  }\n\n  public static void ResetAllOptions(object settings, Type type = null,\n                                     bool resetNestedSettings = true,\n                                     bool resetToNew = true) {\n    var visited = new HashSet<object>();\n    WalkSettingsOptions(settings, (obj, property, optionAttr, optionId) => {\n                          // Trace.WriteLine($\"Resetting property {property.Name}, type {type.Name}: {optionAttr.Value}\");\n                          if (optionAttr != null) {\n                            SetOptionValue(property, obj, optionAttr);\n                            return true;\n                          }\n\n                          if (resetNestedSettings &&\n                              property.GetValue(obj) is SettingsBase nestedSettings) {\n                            nestedSettings.Reset();\n                          }\n                          else if (resetToNew) {\n                            if (property.GetValue(obj) is IList list) {\n                              list.Clear();\n                            }\n                            else if (property.GetValue(obj) is IDictionary dict) {\n                              dict.Clear();\n                            }\n                            else if (property.GetSetMethod() != null) {\n                              object newObject = Activator.CreateInstance(property.PropertyType);\n                              property.SetValue(obj, newObject);\n                            }\n                          }\n\n                          return true;\n                        }, EmptyVisitSettingsAction, EmptyVisitSettingsAction,\n                        EmptyVisitNestedSettingsAction, false, false, type, visited);\n  }\n\n  private static void SetOptionValue(PropertyInfo property, object obj,\n                                     OptionValueAttribute optionAttr) {\n    if (property.GetSetMethod() == null) return;\n\n    if (optionAttr.CreateNewInstance) {\n      property.SetValue(obj, Activator.CreateInstance(property.PropertyType));\n    }\n    else if (optionAttr.Value != null) {\n      if (optionAttr.Value.GetType() == property.PropertyType) {\n        property.SetValue(obj, optionAttr.Value);\n      }\n      else if (optionAttr.Value.GetType().IsPrimitive) {\n        object convertedValue = Convert.ChangeType(optionAttr.Value, property.PropertyType);\n        property.SetValue(obj, convertedValue);\n      }\n      else if (optionAttr.Value is string strValue) {\n        // Try to find a registered converter for this type\n        var converter = SettingsTypeRegistry.GetConverter(property.PropertyType);\n        if (converter != null) {\n          object convertedValue = converter.ConvertFromString(strValue);\n          property.SetValue(obj, convertedValue);\n        }\n        else {\n          throw new InvalidOperationException($\"Type {property.PropertyType.Name} not handled - no converter registered\");\n        }\n      }\n      else if (optionAttr.Value is string[] strArray) {\n        // Try to find a registered converter for this type\n        var converter = SettingsTypeRegistry.GetConverter(property.PropertyType.GetElementType() ?? property.PropertyType);\n        if (converter != null) {\n          Array convertedArray = converter.ConvertFromStringArray(strArray);\n          property.SetValue(obj, convertedArray);\n        }\n        else {\n          throw new InvalidOperationException($\"Type {property.PropertyType.Name} not handled - no converter registered\");\n        }\n      }\n      else {\n        throw new InvalidOperationException(\"Type not handled\");\n      }\n    }\n  }\n\n  public static void InitializeAllNewOptions(object settings, HashSet<OptionValueId> knownOptions) {\n    var visited = new HashSet<object>();\n    WalkSettingsOptions(settings, (obj, property, optionAttr, optionId) => {\n                          // Initialize only missing properties.\n                          if (optionAttr != null && knownOptions != null && !knownOptions.Contains(optionId)) {\n                            // Trace.WriteLine($\"Setting missing property {property.Name}, type {type.Name}: {optionAttr.Value}\");\n                            SetOptionValue(property, obj, optionAttr);\n                          }\n\n                          return true;\n                        }, EmptyVisitSettingsAction, EmptyVisitSettingsAction,\n                        EmptyVisitNestedSettingsAction, true, true, null, visited);\n  }\n\n  public static void InitializeReferenceOptions(object settings) {\n    var visited = new HashSet<object>();\n    WalkSettingsOptions(settings, (obj, property, optionAttr, optionId) => {\n                          if (!property.GetType().IsValueType &&\n                              property.GetValue(obj) == null &&\n                              (optionAttr == null || optionAttr.CreateNewInstance) &&\n                              property.GetSetMethod() != null) {\n                            // Initialize all reference properties with an instance.\n                            object newObject = Activator.CreateInstance(property.PropertyType);\n                            property.SetValue(obj, newObject);\n                          }\n\n                          return true;\n                        }, EmptyVisitSettingsAction, EmptyVisitSettingsAction,\n                        EmptyVisitNestedSettingsAction, false, true, null, visited);\n  }\n\n  public static string PrintOptions(object settings, Type type = null,\n                                    bool includeBaseClass = true) {\n    var visited = new HashSet<object>();\n    var sb = new StringBuilder();\n    int currentLevel = 0;\n\n    if (type != null) {\n      Debug.Assert(type.IsAssignableFrom(settings.GetType()));\n    }\n    else {\n      type = settings.GetType();\n    }\n\n    WalkSettingsOptions(settings, (obj, property, optionAttr, optionId) => {\n                          object value = property.GetValue(obj);\n\n                          if (value is SettingsBase) {\n                            return true; // Printed as sub-section.\n                          }\n\n                          sb.Append(' ', currentLevel * 4);\n                          sb.Append($\"{property.Name}: {value}\");\n\n                          if (optionAttr != null && optionAttr.Value != null) {\n                            if (value != null && AreValuesEqual(value, optionAttr.Value)) {\n                              sb.Append($\"  (default \\u2713)\");\n                            }\n                            else {\n                              sb.Append($\"  (default {optionAttr.Value})\");\n                            }\n                          }\n\n                          sb.AppendLine();\n                          return true;\n                        }, (settings, level) => {\n                          sb.Append(' ', currentLevel * 4);\n                          sb.AppendLine($\"{settings.GetType().Name}:\");\n                          currentLevel = level;\n                        },\n                        (settings, level) => {\n                          sb.Append(' ', currentLevel * 4);\n                          sb.AppendLine(\"--------------------------------------\");\n                          currentLevel = level;\n                        },\n                        (nestedSettings, property, isCollection) => {\n                          //? TODO: Pretty-print list/dict\n                        }, true, includeBaseClass, type, visited);\n\n    return sb.ToString();\n  }\n\n  private static bool AreValuesEqual(object a, object b, bool\n                                       compareNestedSettings = false) {\n    if (ReferenceEquals(a, b)) {\n      return true;\n    }\n    else if (a == null || b == null) {\n      return false;\n    }\n\n    switch ((a, b)) {\n      case (double da, double db): {\n        return Math.Abs(da - db) < double.Epsilon;\n        break;\n      }\n      case (float fa, float fb): {\n        return Math.Abs(fa - fb) < float.Epsilon;\n        break;\n      }\n      case (double da, int ib): {\n        return Math.Abs(da - ib) < double.Epsilon;\n        break;\n      }\n      case (float fa, int ib): {\n        return Math.Abs(fa - ib) < float.Epsilon;\n        break;\n      }\n      case (string sa, string sb): {\n        return sa.Equals(sb, StringComparison.Ordinal);\n      }\n      case (SettingsBase settingsA, SettingsBase settingsB): {\n        if (compareNestedSettings) {\n          // If Equals was overridden use it, otherwise\n          // recursively compare each property in nested settings.\n          var equals = settingsA.GetType().GetMethod(\"Equals\");\n\n          if (equals == null || equals.DeclaringType != settingsA.GetType()) {\n            return AreOptionsEqual(settingsA, settingsB, null, false, compareNestedSettings);\n          }\n        }\n\n        return settingsA.Equals(settingsB);\n      }\n      case (IList listA, IList listB): {\n        // Compare each element of the collection.\n        return listA.AreEqual(listB);\n      }\n      case (IDictionary dictA, IDictionary dictB): {\n        // Compare each element of the collection.\n        return dictA.AreEqual(dictB);\n      }\n      case (IEnumerable enumA, IEnumerable enumB): {\n        // Compare each element of the collection.\n        var iterA = enumA.GetEnumerator();\n        var iterB = enumB.GetEnumerator();\n        bool hasA = iterA.MoveNext();\n        bool hasB = iterB.MoveNext();\n\n        while (hasA && hasB) {\n          if (!Equals(iterA.Current, iterB.Current)) {\n            return false;\n          }\n\n          hasA = iterA.MoveNext();\n          hasB = iterB.MoveNext();\n\n          if (!hasA && !hasB) {\n            return true;\n          }\n        }\n\n        return false;\n      }\n      default: {\n        return a.Equals(b);\n      }\n    }\n  }\n\n  public static bool AreOptionsEqual(object settingsA, object settingsB,\n                                     Type type = null, bool compareBaseClass = false,\n                                     bool compareNestedSettings = true) {\n    if (settingsA == null || settingsB == null ||\n        settingsA.GetType() != settingsB.GetType()) {\n      return false;\n    }\n    else if (ReferenceEquals(settingsA, settingsB)) {\n      return true;\n    }\n\n    if (type != null) {\n      Debug.Assert(type.IsAssignableFrom(settingsA.GetType()));\n    }\n    else {\n      type = settingsA.GetType();\n    }\n\n    var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;\n\n    if (!compareBaseClass) {\n      flags |= BindingFlags.DeclaredOnly;\n    }\n\n    foreach (var property in type.GetProperties(flags)) {\n      object valueA = property.GetValue(settingsA);\n      object valueB = property.GetValue(settingsB);\n\n      if (!AreValuesEqual(valueA, valueB, compareNestedSettings)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  private static bool WalkSettingsOptions(object settings, VisitOptionAction optionAction,\n                                          VisitSettingsAction beginVisitSettingsAction,\n                                          VisitSettingsAction endVisitSettingsAction,\n                                          VisitNestedSettingsAction beginNestedSettingsAction,\n                                          bool visitedNestedSettings, bool visitBaseClass,\n                                          Type type, HashSet<object> visited, int level = 0) {\n    if (settings == null || !visited.Add(settings)) {\n      return true; // Avoid cycles in the object graph.\n    }\n\n    if (type != null) {\n      Debug.Assert(type.IsAssignableFrom(settings.GetType()));\n    }\n    else {\n      type = settings.GetType();\n    }\n\n    var contractAttr = type.GetCustomAttribute<ProtoContractAttribute>();\n\n    if (contractAttr == null) {\n      return true;\n    }\n\n    beginVisitSettingsAction?.Invoke(settings, level);\n    var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;\n\n    if (!visitBaseClass) {\n      // When resetting don't consider properties from the base class.\n      flags |= BindingFlags.DeclaredOnly;\n    }\n\n    foreach (var property in type.GetProperties(flags)) {\n      var protoAttr = property.GetCustomAttribute<ProtoMemberAttribute>();\n      if (protoAttr == null) continue;\n\n      // Check if there is a default option value attribute attached.\n      var optionAttr = property.GetCustomAttribute<OptionValueAttribute>();\n      bool propertyIsSettings = property.PropertyType.BaseType == typeof(SettingsBase);\n\n      if (optionAttr != null) {\n        var optionId = MakeOptionId(property, type, contractAttr, protoAttr);\n\n        if (!optionAction(settings, property, optionAttr, optionId)) {\n          return false;\n        }\n      }\n      else {\n        if (!optionAction(settings, property, null, null)) {\n          return false;\n        }\n      }\n\n      if (!visitedNestedSettings) {\n        continue; // When resetting don't handle base class and nested settings.\n      }\n\n      // Recursively go over nested settings.\n      if (propertyIsSettings) {\n        object value = property.GetValue(settings);\n\n        if (value is SettingsBase nestedSettings) {\n          beginNestedSettingsAction?.Invoke(nestedSettings, property, false);\n          WalkSettingsOptions(nestedSettings, optionAction,\n                              beginVisitSettingsAction, endVisitSettingsAction,\n                              beginNestedSettingsAction,\n                              visitedNestedSettings, visitBaseClass,\n                              null, visited, level + 1);\n        }\n      }\n      else if (property.PropertyType.IsGenericType &&\n               property.PropertyType.GetGenericTypeDefinition() == typeof(List<>)) {\n        if (IsSettingsBaseGenericType(property) &&\n            property.GetValue(settings) is IEnumerable enumValue) {\n          beginNestedSettingsAction?.Invoke(enumValue, property, true);\n\n          foreach (object nestedValue in enumValue) {\n            if (nestedValue is SettingsBase nestedSettings) {\n              WalkSettingsOptions(nestedSettings, optionAction,\n                                  beginVisitSettingsAction, endVisitSettingsAction,\n                                  beginNestedSettingsAction,\n                                  visitedNestedSettings, visitBaseClass,\n                                  null, visited, level + 1);\n            }\n          }\n        }\n      }\n      else if (property.PropertyType.IsGenericType &&\n               property.PropertyType.GetGenericTypeDefinition() == typeof(Dictionary<,>)) {\n        if (IsSettingsBaseGenericType(property) &&\n            property.GetValue(settings) is IDictionary dictValue) {\n          beginNestedSettingsAction?.Invoke(dictValue, property, true);\n\n          foreach (DictionaryEntry kvp in dictValue) {\n            if (kvp.Key is SettingsBase keySettings) {\n              WalkSettingsOptions(keySettings, optionAction,\n                                  beginVisitSettingsAction, endVisitSettingsAction,\n                                  beginNestedSettingsAction,\n                                  visitedNestedSettings, visitBaseClass,\n                                  null, visited, level + 1);\n            }\n\n            if (kvp.Value is SettingsBase valueSettings) {\n              WalkSettingsOptions(valueSettings, optionAction,\n                                  beginVisitSettingsAction, endVisitSettingsAction,\n                                  beginNestedSettingsAction,\n                                  visitedNestedSettings, visitBaseClass,\n                                  null, visited, level + 1);\n            }\n          }\n        }\n      }\n    }\n\n    endVisitSettingsAction?.Invoke(settings, Math.Max(0, level - 1));\n    return true;\n  }\n\n  private static bool IsSettingsBaseGenericType(PropertyInfo property) {\n    foreach (var genericType in property.PropertyType.GenericTypeArguments) {\n      if (genericType.BaseType == typeof(SettingsBase)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  private static void CollectOptionMembers(Type type, HashSet<OptionValueId> set,\n                                           HashSet<Type> visited) {\n    if (!visited.Add(type)) {\n      return; // Avoid cycles in the type graph.\n    }\n\n    var contractAttr = type.GetCustomAttribute<ProtoContractAttribute>();\n    if (contractAttr == null) return;\n\n    foreach (var property in type.GetProperties()) {\n      var protoAttr = property.GetCustomAttribute<ProtoMemberAttribute>();\n      if (protoAttr == null) continue;\n\n      var optionId = MakeOptionId(property, type, contractAttr, protoAttr);\n      set.Add(optionId);\n\n      if (property.PropertyType.BaseType == typeof(SettingsBase)) {\n        CollectOptionMembers(property.PropertyType, set, visited);\n      }\n      else if (property.PropertyType.IsGenericType &&\n               (property.PropertyType.GetGenericTypeDefinition() == typeof(List<>) ||\n                property.PropertyType.GetGenericTypeDefinition() == typeof(Dictionary<,>))) {\n        // Go over generic types of in List<T> and Dictionary<K,V>.\n        foreach (var genericType in property.PropertyType.GenericTypeArguments) {\n          if (genericType.BaseType == typeof(SettingsBase)) {\n            CollectOptionMembers(genericType, set, visited);\n          }\n        }\n      }\n    }\n  }\n\n  private static OptionValueId MakeOptionId(PropertyInfo property, Type type, ProtoContractAttribute contractAttr,\n                                            ProtoMemberAttribute protoAttr) {\n    string className = !string.IsNullOrEmpty(contractAttr.Name) ?\n      contractAttr.Name : type.Name;\n    int id = protoAttr.Tag;\n\n    if (property.DeclaringType != type) {\n      // Members from base classes have an Id that is at an offset\n      // defined by a ProtoInclude attribute. Find the ProtoInclude that corresponds\n      // to this derived type.\n      var protoIncludeAttr = FindMatchingProtoInclude(property.DeclaringType, type);\n\n      if (protoIncludeAttr != null) {\n        id += protoIncludeAttr.Tag;\n      }\n    }\n\n    var optionId = new OptionValueId(className, id);\n    return optionId;\n  }\n\n  private delegate bool VisitOptionAction(object settings, PropertyInfo property,\n                                          OptionValueAttribute optionAttr, OptionValueId optionId);\n\n  private delegate void VisitSettingsAction(object settings, int level);\n  private delegate void VisitNestedSettingsAction(object nestedSettings, PropertyInfo property, bool isCollection);\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Settings/SymbolFileSourceSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Runtime.InteropServices;\nusing System.Text.RegularExpressions;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.Core.Settings;\n\npublic enum SymbolFileRejectionReason {\n  Unknown = 0,           // Unknown/legacy\n  PermanentNotFound,     // 404 - safe to cache (3 days)\n  InvalidFormat,         // Parse error - safe to cache\n  NetworkTimeout,        // Transient - DON'T cache\n  AuthenticationFailure, // Transient - DON'T cache\n  ServerError           // 5xx - transient - DON'T cache\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class SymbolFileSourceSettings : SettingsBase {\n  private const string DefaultPrivateSymbolServer = @\"https://symweb.azurefd.net\";\n  private const string DefaultPublicSymbolServer = @\"https://msdl.microsoft.com/download/symbols\";\n  private const string DefaultSymbolCachePath = @\"C:\\Symbols\";\n  private const string DefaultEnvironmentVarSymbolPath = @\"_NT_SYMBOL_PATH\";\n  public const double DefaultLowSampleModuleCutoff = 0.002; // 0.2%\n\n  public SymbolFileSourceSettings() {\n    Reset();\n  }\n\n  public static string DefaultCacheDirectoryPath => Path.Combine(Path.GetTempPath(), \"ProfileExplorer\", \"symcache\");\n  [ProtoMember(1)][OptionValue()]\n  public List<string> SymbolPaths { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool SourceServerEnabled { get; set; }\n  [ProtoMember(3)][OptionValue(false)]\n  public bool AuthorizationTokenEnabled { get; set; }\n  [ProtoMember(4)][OptionValue(\"\")]\n  public string AuthorizationToken { get; set; }\n  [ProtoMember(5)][OptionValue(false)]\n  public bool UseEnvironmentVarSymbolPaths { get; set; }\n  [ProtoMember(6)][OptionValue(true)]\n  public bool SkipLowSampleModules { get; set; }\n  [ProtoMember(7)][OptionValue(\"\")]\n  public string AuthorizationUser { get; set; }\n  [ProtoMember(8)][OptionValue()]\n  public HashSet<BinaryFileDescriptor> RejectedBinaryFiles { get; set; }\n  [ProtoMember(9)][OptionValue()]\n  public HashSet<SymbolFileDescriptor> RejectedSymbolFiles { get; set; }\n  [ProtoMember(10)][OptionValue(true)]\n  public bool RejectPreviouslyFailedFiles { get; set; }\n  [ProtoMember(11)][OptionValue(true)]\n  public bool IncludeSymbolSubdirectories { get; set; }\n  [ProtoMember(12)][OptionValue(true)]\n  public bool CacheSymbolFiles { get; set; }\n  [ProtoMember(13)][OptionValue(\"\")]\n  public string CustomSymbolCacheDirectory { get; set; }\n  [ProtoMember(14)][OptionValue(0.002)] // 0.2%\n  public double LowSampleModuleCutoff { get; set; }\n  [ProtoMember(15)][OptionValue(true)]\n  public bool CompanyFilterEnabled { get; set; }\n  [ProtoMember(16)][OptionValue()]\n  public List<string> CompanyFilterStrings { get; set; }\n  [ProtoMember(17)][OptionValue(30)] // 30 seconds normal timeout (after auth validated)\n  public int SymbolServerTimeoutSeconds { get; set; }\n  [ProtoMember(18)][OptionValue(true)]\n  public bool BellwetherTestEnabled { get; set; }\n  [ProtoMember(19)][OptionValue(60)] // 60 seconds for bellwether/initial requests (after auth validated)\n  public int BellwetherTimeoutSeconds { get; set; }\n  [ProtoMember(20)][OptionValue(10)] // 10 seconds when symbol server is degraded\n  public int DegradedTimeoutSeconds { get; set; }\n  [ProtoMember(24)][OptionValue(600)] // 10 minutes pre-auth timeout (user may need to interact with auth dialog)\n  public int PreAuthTimeoutSeconds { get; set; }\n  [ProtoMember(21)][OptionValue(true)]\n  public bool WindowsPathFilterEnabled { get; set; }\n  [ProtoMember(22)]\n  public DateTime RejectedFilesCacheTime { get; set; }\n  [ProtoMember(23)][OptionValue(3)] // 3 days default expiration\n  public int RejectedFilesCacheExpirationDays { get; set; }\n  [ProtoMember(25)][OptionValue(true)]\n  public bool AllowApproximateBinaryMatch { get; set; }\n  public bool HasAuthorizationToken => AuthorizationTokenEnabled && !string.IsNullOrEmpty(AuthorizationToken);\n  public bool HasCompanyFilter => CompanyFilterEnabled;\n\n  // Runtime state - not persisted. Set when bellwether test fails.\n  public bool SymbolServerDegraded { get; set; }\n\n  // Runtime state - tracks if we've had our first successful network request.\n  // Used to know when to reduce timeout from initial 30s to normal 10s.\n  public bool HadFirstSuccessfulNetworkRequest { get; set; }\n\n  // Runtime state - tracks if we've had any timeout, triggering reduced timeout.\n  public bool HadFirstTimeout { get; set; }\n\n  // Runtime state - tracks if primary (private) server auth failed.\n  // When true, subsequent downloads skip primary and go directly to secondary (public) server.\n  public bool PrimaryServerAuthFailed { get; set; }\n\n  // Runtime state - tracks if primary server has been verified working.\n  // When true, we know primary server works and should be used.\n  public bool PrimaryServerVerified { get; set; }\n\n  // Runtime state - session-level tracking for negative cache safety checks.\n  // These are NOT persisted and reset on each session.\n  public int SessionSymbolSearchCount { get; set; }\n  public int SessionSymbolFailureCount { get; set; }\n  public int SessionSymbolSuccessCount { get; set; }\n\n  /// <summary>\n  /// Returns the effective timeout based on current state:\n  /// - If auth not yet validated: use PreAuthTimeoutSeconds (600s/10min) to allow for interactive auth\n  /// - If degraded (bellwether failed): use DegradedTimeoutSeconds (10s)\n  /// - If we've had a timeout: use SymbolServerTimeoutSeconds (30s)\n  /// - Otherwise (initial post-auth state): use BellwetherTimeoutSeconds (60s)\n  /// </summary>\n  public int EffectiveTimeoutSeconds {\n    get {\n      // Before auth is validated, use very long timeout to allow for interactive auth dialog\n      // The user might not see the auth dialog immediately, so we give them 10 minutes\n      if (!HadFirstSuccessfulNetworkRequest && !SymbolServerDegraded) {\n        return PreAuthTimeoutSeconds;\n      }\n      if (SymbolServerDegraded) {\n        return DegradedTimeoutSeconds;\n      }\n      if (HadFirstTimeout) {\n        return SymbolServerTimeoutSeconds;\n      }\n      // Auth validated, no timeouts yet - use generous initial timeout\n      return BellwetherTimeoutSeconds;\n    }\n  }\n\n  /// <summary>\n  /// Returns the effective company filter strings. Uses \"Microsoft\" as default if enabled but list is empty.\n  /// </summary>\n  public IReadOnlyList<string> EffectiveCompanyFilterStrings {\n    get {\n      if (CompanyFilterStrings?.Count > 0) {\n        return CompanyFilterStrings;\n      }\n      // Default to \"Microsoft\" when filter is enabled but no custom strings specified\n      return CompanyFilterEnabled ? new[] { \"Microsoft\" } : Array.Empty<string>();\n    }\n  }\n  public string SymbolCacheDirectoryPath => !string.IsNullOrEmpty(CustomSymbolCacheDirectory) ?\n    CustomSymbolCacheDirectory :\n    DefaultCacheDirectoryPath;\n  public long SymbolCacheDirectorySizeMB => Utils.ComputeDirectorySize(SymbolCacheDirectoryPath) / (1024 * 1024);\n\n  public string EnvironmentVarSymbolPath {\n    get {\n      try {\n        return Environment.GetEnvironmentVariable(DefaultEnvironmentVarSymbolPath);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to read symbol env var: {ex.Message}\");\n        return null;\n      }\n    }\n  }\n\n  public void ClearSymbolFileCache() {\n    try {\n      if (Directory.Exists(SymbolCacheDirectoryPath)) {\n        Directory.Delete(SymbolCacheDirectoryPath, true);\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to empty cache dir {SymbolCacheDirectoryPath}: {ex.Message}\");\n    }\n  }\n\n  public void AddSymbolServer(bool usePrivateServer) {\n    string symbolServer = usePrivateServer ? DefaultPrivateSymbolServer : DefaultPublicSymbolServer;\n    string path = $\"srv*{DefaultSymbolCachePath}*{symbolServer}\";\n\n    if (!SymbolPaths.Contains(path)) {\n      SymbolPaths.Add(path);\n    }\n  }\n\n  public bool HasSymbolPath(string path) {\n    path = Utils.TryGetDirectoryName(path).ToLowerInvariant();\n    return SymbolPaths.Find(item => item.ToLowerInvariant() == path) != null;\n  }\n\n  public void InsertSymbolPath(string path) {\n    if (string.IsNullOrEmpty(path)) {\n      return;\n    }\n\n    foreach (string p in path.Split(\";\")) {\n      string dir = Utils.TryGetDirectoryName(p);\n\n      if (!string.IsNullOrEmpty(dir) && !HasSymbolPath(dir)) {\n        SymbolPaths.Insert(0, dir); // Prepend path.\n      }\n    }\n  }\n\n  public void InsertSymbolPaths(IEnumerable<string> paths) {\n    foreach (string path in paths) {\n      InsertSymbolPath(path);\n    }\n  }\n\n  public SymbolFileSourceSettings WithSymbolPaths(params string[] paths) {\n    var options = Clone();\n\n    foreach (string path in paths) {\n      options.InsertSymbolPath(path);\n    }\n\n    return options;\n  }\n\n  public bool IsRejectedBinaryFile(BinaryFileDescriptor file) {\n    bool isRejected = RejectPreviouslyFailedFiles && RejectedBinaryFiles.Contains(file);\n    if (isRejected) {\n      Trace.WriteLine($\"BINARY_FILTER_DEBUG: Binary file REJECTED - Previously failed: {file?.ImageName} (path: {file?.ImagePath})\");\n    }\n    return isRejected;\n  }\n\n  public bool IsRejectedSymbolFile(SymbolFileDescriptor file) {\n    bool isRejected = RejectPreviouslyFailedFiles && RejectedSymbolFiles.Contains(file);\n    if (isRejected) {\n      Trace.WriteLine($\"DEBUG_FILTER_DEBUG: Symbol file REJECTED - Previously failed: {file?.FileName} (ID: {file?.Id}, Age: {file?.Age})\");\n    }\n    return isRejected;\n  }\n\n  /// <summary>\n  /// Checks if a rejection reason represents a transient failure that should NOT be cached.\n  /// Transient failures include auth failures, timeouts, and server errors.\n  /// </summary>\n  private bool IsTransientFailure(SymbolFileRejectionReason reason) {\n    return reason == SymbolFileRejectionReason.AuthenticationFailure ||\n           reason == SymbolFileRejectionReason.NetworkTimeout ||\n           reason == SymbolFileRejectionReason.ServerError ||\n           reason == SymbolFileRejectionReason.Unknown; // Treat unknown conservatively - don't cache\n  }\n\n  /// <summary>\n  /// Classifies a search failure based on the search log to determine if it should be cached.\n  /// Used by both PDB and binary rejection to distinguish transient failures (timeout, auth, server errors)\n  /// from permanent failures (404 not found).\n  /// </summary>\n  public SymbolFileRejectionReason ClassifySearchFailure(string searchLog) {\n    if (DetectPrimaryServerAuthFailure(searchLog)) {\n      return SymbolFileRejectionReason.AuthenticationFailure;\n    }\n\n    if (!string.IsNullOrEmpty(searchLog) &&\n        (searchLog.Contains(\"500\") || searchLog.Contains(\"503\") ||\n         searchLog.Contains(\"Internal Server Error\", StringComparison.OrdinalIgnoreCase))) {\n      return SymbolFileRejectionReason.ServerError;\n    }\n\n    if (!string.IsNullOrEmpty(searchLog) &&\n        (searchLog.Contains(\"timeout\", StringComparison.OrdinalIgnoreCase) ||\n         searchLog.Contains(\"timed out\", StringComparison.OrdinalIgnoreCase))) {\n      return SymbolFileRejectionReason.NetworkTimeout;\n    }\n\n    if (string.IsNullOrEmpty(searchLog) ||\n        searchLog.Contains(\"404\") ||\n        searchLog.Contains(\"not found\", StringComparison.OrdinalIgnoreCase)) {\n      return SymbolFileRejectionReason.PermanentNotFound;\n    }\n\n    return SymbolFileRejectionReason.Unknown;\n  }\n\n  /// <summary>\n  /// Detects if the search log indicates a primary symbol server (symweb) authentication failure.\n  /// </summary>\n  public static bool DetectPrimaryServerAuthFailure(string searchLog) {\n    if (string.IsNullOrEmpty(searchLog)) {\n      return false;\n    }\n\n    if (!searchLog.Contains(\"symweb\", StringComparison.OrdinalIgnoreCase)) {\n      return false;\n    }\n\n    var authFailurePatterns = new[] {\n      @\"\\b401\\b\",           // 401 at word boundary (not in hex GUIDs like A3401B)\n      @\"\\b403\\b\",           // 403 at word boundary\n      \"Unauthorized\",       // HTTP 401 description\n      \"Forbidden\"           // HTTP 403 description\n    };\n\n    foreach (var pattern in authFailurePatterns) {\n      if (pattern.StartsWith(@\"\\b\")) {\n        if (Regex.IsMatch(searchLog, pattern)) {\n          return true;\n        }\n      }\n      else {\n        if (searchLog.Contains(pattern, StringComparison.OrdinalIgnoreCase)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  /// <summary>\n  /// Checks if a symbol file exists in the local symbol cache directories.\n  /// Searches all paths from _NT_SYMBOL_PATH including structured (foo.pdb/GUID/foo.pdb) and flat directories.\n  /// </summary>\n  private bool IsSymbolFileInLocalCache(SymbolFileDescriptor file) {\n    if (file == null || string.IsNullOrEmpty(file.FileName)) {\n      return false;\n    }\n\n    // Check all symbol paths configured\n    foreach (string path in SymbolPaths) {\n      if (string.IsNullOrEmpty(path)) continue;\n\n      // Skip symbol server entries (srv*)\n      if (path.StartsWith(\"srv*\", StringComparison.OrdinalIgnoreCase)) {\n        // Extract local cache path from srv*C:\\Symbols*https://...\n        var parts = path.Split('*');\n        if (parts.Length >= 2) {\n          string localCachePath = parts[1];\n          if (CheckSymbolFileInDirectory(localCachePath, file)) {\n            return true;\n          }\n        }\n        continue;\n      }\n\n      // Check regular directory paths\n      if (CheckSymbolFileInDirectory(path, file)) {\n        return true;\n      }\n    }\n\n    // Check environment variable symbol paths if enabled\n    if (UseEnvironmentVarSymbolPaths && !string.IsNullOrEmpty(EnvironmentVarSymbolPath)) {\n      foreach (string path in EnvironmentVarSymbolPath.Split(';')) {\n        if (string.IsNullOrEmpty(path)) continue;\n\n        if (path.StartsWith(\"srv*\", StringComparison.OrdinalIgnoreCase)) {\n          var parts = path.Split('*');\n          if (parts.Length >= 2) {\n            string localCachePath = parts[1];\n            if (CheckSymbolFileInDirectory(localCachePath, file)) {\n              return true;\n            }\n          }\n        }\n        else if (CheckSymbolFileInDirectory(path, file)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  /// <summary>\n  /// Checks if a symbol file exists in a specific directory, looking for both structured\n  /// symbol server format (foo.pdb/GUID/foo.pdb) and flat format (foo.pdb).\n  /// </summary>\n  private bool CheckSymbolFileInDirectory(string directory, SymbolFileDescriptor file) {\n    if (!Directory.Exists(directory)) {\n      return false;\n    }\n\n    try {\n      // Check structured symbol server format: basePath\\fileName\\GUID\\fileName\n      string structuredPath = Path.Combine(directory, file.FileName, file.Id.ToString(\"N\").ToUpperInvariant(), file.FileName);\n      if (File.Exists(structuredPath)) {\n        DiagnosticLogger.LogInfo($\"[NegativeCache] Found symbol file in local cache (structured): {structuredPath}\");\n        return true;\n      }\n\n      // Check flat format: basePath\\fileName\n      string flatPath = Path.Combine(directory, file.FileName);\n      if (File.Exists(flatPath)) {\n        DiagnosticLogger.LogInfo($\"[NegativeCache] Found symbol file in local cache (flat): {flatPath}\");\n        return true;\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"[NegativeCache] Error checking symbol file in {directory}: {ex.Message}\");\n    }\n\n    return false;\n  }\n\n  /// <summary>\n  /// Session-level safety check: If we have a suspicious failure rate (>80% failures with at least 10 searches),\n  /// something is systematically wrong (network down, auth broken, etc.) and we should NOT add to negative cache.\n  /// This prevents mass rejection when there's an infrastructure issue.\n  /// </summary>\n  private bool ShouldSkipNegativeCachingDueToSuspiciousFailureRate() {\n    const int MinSearchCount = 10;\n    const double MaxFailureRate = 0.80; // 80%\n\n    if (SessionSymbolSearchCount < MinSearchCount) {\n      return false; // Not enough data yet\n    }\n\n    double failureRate = (double)SessionSymbolFailureCount / SessionSymbolSearchCount;\n\n    if (failureRate > MaxFailureRate) {\n      DiagnosticLogger.LogWarning($\"[NegativeCache] Suspicious failure rate detected: {SessionSymbolFailureCount}/{SessionSymbolSearchCount} ({failureRate:P0}) - Disabling negative caching for this session\");\n      return true;\n    }\n\n    return false;\n  }\n\n  public bool RejectBinaryFile(BinaryFileDescriptor file,\n                               SymbolFileRejectionReason reason = SymbolFileRejectionReason.Unknown,\n                               string searchLog = null) {\n    if (!RejectPreviouslyFailedFiles) return false;\n\n    // Same safeguards as RejectSymbolFile: don't cache transient failures.\n    if (IsTransientFailure(reason)) {\n      DiagnosticLogger.LogInfo($\"[NegativeCache] Skipping transient binary failure: {file.ImageName} - {reason}\");\n      return false;\n    }\n\n    if (PrimaryServerAuthFailed) {\n      DiagnosticLogger.LogWarning($\"[NegativeCache] Auth failure detected - skipping binary rejection for {file.ImageName}\");\n      return false;\n    }\n\n    if (ShouldSkipNegativeCachingDueToSuspiciousFailureRate()) {\n      DiagnosticLogger.LogWarning($\"[NegativeCache] Suspicious failure rate - skipping binary rejection\");\n      return false;\n    }\n\n    RejectedBinaryFiles.Add(file);\n    if (RejectedFilesCacheTime == default) {\n      RejectedFilesCacheTime = DateTime.UtcNow;\n    }\n\n    DiagnosticLogger.LogInfo($\"[NegativeCache] Added binary: {file.ImageName} - Reason: {reason}\");\n    return true;\n  }\n\n  /// <summary>\n  /// Attempts to add a symbol file to the negative cache (list of previously failed symbols).\n  /// Includes multiple safeguards to prevent caching transient failures:\n  /// - Skips transient failures (auth, timeout, server errors)\n  /// - Skips if auth failure detected this session\n  /// - Skips if file exists in local cache\n  /// - Skips if suspicious failure rate detected (>80%)\n  /// Returns true if the file was added to negative cache, false if rejected or skipped.\n  /// </summary>\n  public bool RejectSymbolFile(SymbolFileDescriptor file,\n                                SymbolFileRejectionReason reason = SymbolFileRejectionReason.Unknown,\n                                string searchLog = null) {\n    if (!RejectPreviouslyFailedFiles) return false;\n\n    // SAFEGUARD 1: Skip transient failures\n    if (IsTransientFailure(reason)) {\n      DiagnosticLogger.LogInfo($\"[NegativeCache] Skipping transient failure: {file.FileName} - {reason}\");\n      return false;\n    }\n\n    // SAFEGUARD 2: Check if auth failure detected this session\n    if (PrimaryServerAuthFailed) {\n      DiagnosticLogger.LogWarning($\"[NegativeCache] Auth failure detected - rejecting rejection for {file.FileName}\");\n      return false;\n    }\n\n    // SAFEGUARD 3: Check if file exists in local cache\n    if (IsSymbolFileInLocalCache(file)) {\n      DiagnosticLogger.LogInfo($\"[NegativeCache] Symbol exists in local cache: {file.FileName}\");\n      return false;\n    }\n\n    // SAFEGUARD 4: Session-level safety check - suspicious failure rate\n    if (ShouldSkipNegativeCachingDueToSuspiciousFailureRate()) {\n      DiagnosticLogger.LogWarning($\"[NegativeCache] Suspicious failure rate - skipping ALL negative caching\");\n      return false;\n    }\n\n    // All checks passed - safe to add to negative cache\n    RejectedSymbolFiles.Add(file);\n    if (RejectedFilesCacheTime == default) {\n      RejectedFilesCacheTime = DateTime.UtcNow;\n    }\n\n    DiagnosticLogger.LogInfo($\"[NegativeCache] Added: {file.FileName} - Reason: {reason}\");\n    return true;\n  }\n\n  public void ClearRejectedFiles() {\n    RejectedSymbolFiles.Clear();\n    RejectedBinaryFiles.Clear();\n  }\n\n  /// <summary>\n  /// Checks if a file path is in a Windows/Microsoft directory (likely Microsoft binary).\n  /// Used as a heuristic when PE version info isn't available yet.\n  /// </summary>\n  public static bool IsWindowsSystemPath(string filePath) {\n    if (string.IsNullOrEmpty(filePath)) {\n      return false;\n    }\n\n    // Common Windows system paths that contain Microsoft binaries\n    string windowsDir = Environment.GetFolderPath(Environment.SpecialFolder.Windows);\n    string systemRoot = Environment.GetEnvironmentVariable(\"SystemRoot\") ?? @\"C:\\Windows\";\n    string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);\n\n    return filePath.StartsWith(windowsDir, StringComparison.OrdinalIgnoreCase) ||\n           filePath.StartsWith(systemRoot, StringComparison.OrdinalIgnoreCase) ||\n           filePath.StartsWith(@\"C:\\Windows\", StringComparison.OrdinalIgnoreCase) ||\n           filePath.StartsWith(@\"\\SystemRoot\", StringComparison.OrdinalIgnoreCase) ||\n           filePath.Contains(@\"\\Windows\\System32\\\", StringComparison.OrdinalIgnoreCase) ||\n           filePath.Contains(@\"\\Windows\\SysWOW64\\\", StringComparison.OrdinalIgnoreCase) ||\n           filePath.Contains(@\"\\Windows\\WinSxS\\\", StringComparison.OrdinalIgnoreCase) ||\n           // WindowsApps contains Microsoft Store apps and system components\n           filePath.Contains(@\"\\WindowsApps\\\", StringComparison.OrdinalIgnoreCase) ||\n           filePath.Contains(@\"\\Program Files\\WindowsApps\\\", StringComparison.OrdinalIgnoreCase) ||\n           // Device paths from ETW traces (e.g., \\Device\\HarddiskVolume2\\Windows\\...)\n           (filePath.StartsWith(@\"\\Device\\\", StringComparison.OrdinalIgnoreCase) &&\n            (filePath.Contains(@\"\\Windows\\\", StringComparison.OrdinalIgnoreCase) ||\n             filePath.Contains(@\"\\WindowsApps\\\", StringComparison.OrdinalIgnoreCase))) ||\n           // Microsoft.* and CoreMessaging* DLLs are typically Microsoft binaries regardless of path\n           System.IO.Path.GetFileName(filePath).StartsWith(\"Microsoft.\", StringComparison.OrdinalIgnoreCase) ||\n           System.IO.Path.GetFileName(filePath).StartsWith(\"CoreMessaging\", StringComparison.OrdinalIgnoreCase);\n  }\n\n  public void ExpandSymbolPathsSubdirectories(string[] symbolExtensions) {\n    // For symbol paths that are local directories, add any subdirectory\n    // that also contains symbols to the path list, otherwise the symbol reader\n    // will not find them since it doesn't search rerursively.\n    var symbolPathSet = new HashSet<string>();\n\n    foreach (string path in SymbolPaths) {\n      symbolPathSet.Add(path);\n\n      if (path.StartsWith(\"srv*\", StringComparison.OrdinalIgnoreCase)) {\n        continue; // Skip over symbol servers.\n      }\n\n      //? TODO: Option for max level\n      BuildSymbolsDirectoriesSet(path, symbolPathSet, symbolExtensions, 0, 3);\n    }\n\n    SymbolPaths = symbolPathSet.ToList();\n  }\n\n  private void BuildSymbolsDirectoriesSet(string path, HashSet<string> symbolDirs,\n                                          string[] symbolExtensions,\n                                          int level = 0, int maxLevel = 0) {\n    if (!Directory.Exists(path) || level > maxLevel) {\n      return;\n    }\n\n    try {\n      if (level == 0) {\n        // Check the drive type for the top-level directory\n        // and accept only local paths (exclude mapped network paths).\n        var driveInfo = new DriveInfo(path);\n\n        if (driveInfo.DriveType != DriveType.Fixed) {\n          return;\n        }\n      }\n\n      foreach (string file in Directory.EnumerateFileSystemEntries(path)) {\n        if (File.GetAttributes(file).HasFlag(FileAttributes.Directory)) {\n          BuildSymbolsDirectoriesSet(file, symbolDirs, symbolExtensions, level + 1, maxLevel);\n        }\n        else if (level > 0) {\n          // Top-level directory already included in set,\n          // check files only for subdirectories.\n          string extension = Path.GetExtension(file);\n\n          foreach (string symbolExt in symbolExtensions) {\n            if (extension.Equals(symbolExt, StringComparison.OrdinalIgnoreCase)) {\n              symbolDirs.Add(path);\n              break;\n            }\n          }\n        }\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to expand symbols dir set: {ex.Message}\");\n    }\n  }\n\n  public static bool ShouldUsePrivateSymbolPath() {\n    // Try to detect running as a domain-joined or AAD-joined account,\n    // which should have access to a private, internal symbol server.\n    // Based on https://stackoverflow.com/questions/926227/how-to-detect-if-machine-is-joined-to-domain\n    // try {\n    //   string domain = IPGlobalProperties.GetIPGlobalProperties().DomainName;\n    //\n    //   if (domain != null &&\n    //       domain.Contains(\"DOMANIN_NAME\", StringComparison.OrdinalIgnoreCase)) {\n    //     Trace.WriteLine(\"Set symbol path for domain-joined machine\");\n    //     return true;\n    //   }\n    // }\n    // catch (Exception ex) {\n    // }\n\n    try {\n      string pcszTenantId = null;\n      IntPtr ptrJoinInfo = IntPtr.Zero;\n      IntPtr ptrUserInfo = IntPtr.Zero;\n      IntPtr ptrJoinCertificate = IntPtr.Zero;\n      var joinInfo = new NetAPI32.DSREG_JOIN_INFO();\n\n      NetAPI32.NetFreeAadJoinInformation(IntPtr.Zero);\n      int retValue = NetAPI32.NetGetAadJoinInformation(pcszTenantId, out ptrJoinInfo);\n\n      if (retValue == 0) {\n        var ptrJoinInfoObject = new NetAPI32.DSREG_JOIN_INFO();\n        joinInfo = (NetAPI32.DSREG_JOIN_INFO)Marshal.PtrToStructure(ptrJoinInfo, (Type)ptrJoinInfoObject.GetType());\n\n        if (joinInfo.JoinUserEmail.Contains(\"@microsoft.com\", StringComparison.OrdinalIgnoreCase) ||\n            joinInfo.TenantDisplayName.Contains(\"microsoft\", StringComparison.OrdinalIgnoreCase)) {\n          Trace.WriteLine(\"Set symbol path for AAD-joined machine\");\n          return true;\n        }\n      }\n    }\n    catch (Exception ex) {\n    }\n\n    Trace.WriteLine(\"Set symbol path for non-domain-joined machine\");\n    return false;\n  }\n\n  public override void Reset() {\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n\n    if (ShouldUsePrivateSymbolPath()) {\n      AddSymbolServer(usePrivateServer: true);\n    }\n\n    AddSymbolServer(usePrivateServer: false);\n\n    // Default company filter to \"Microsoft\" since the tool is primarily for Microsoft code.\n    // Users can modify this in the UI settings.\n    if (CompanyFilterStrings.Count == 0) {\n      CompanyFilterStrings.Add(\"Microsoft\");\n    }\n  }\n\n  public SymbolFileSourceSettings Clone() {\n    byte[] serialized = StateSerializer.Serialize(this);\n    return StateSerializer.Deserialize<SymbolFileSourceSettings>(serialized);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n\n    // Migrate old settings: ensure negative caching is enabled by default.\n    // Old settings may have this as false before the feature was fully implemented.\n    if (!RejectPreviouslyFailedFiles) {\n      RejectPreviouslyFailedFiles = true;\n    }\n\n    // Check if rejected files cache has expired (default 3 days).\n    // This allows retrying symbols that may have become available.\n    int expirationDays = RejectedFilesCacheExpirationDays > 0 ? RejectedFilesCacheExpirationDays : 3;\n    if (RejectedFilesCacheTime != default &&\n        DateTime.UtcNow - RejectedFilesCacheTime > TimeSpan.FromDays(expirationDays)) {\n      Trace.WriteLine($\"[SymbolSettings] Rejected files cache expired (>{expirationDays} days old), clearing {RejectedBinaryFiles?.Count ?? 0} binaries and {RejectedSymbolFiles?.Count ?? 0} symbols\");\n      ClearRejectedFiles();\n      RejectedFilesCacheTime = DateTime.UtcNow;\n    }\n\n    // TODO: TEMPORARY - clear negative cache for testing. Remove this after testing.\n    // Trace.WriteLine($\"[SymbolSettings] TEMP: Clearing negative cache for testing ({RejectedBinaryFiles?.Count ?? 0} binaries, {RejectedSymbolFiles?.Count ?? 0} symbols)\");\n    // ClearRejectedFiles();\n    // RejectedFilesCacheTime = DateTime.UtcNow;\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n\n  private class NetAPI32 {\n    [DllImport(\"netapi32.dll\", CharSet = CharSet.Unicode, SetLastError = true)]\n    public static extern void NetFreeAadJoinInformation(\n      IntPtr pJoinInfo);\n\n    [DllImport(\"netapi32.dll\", CharSet = CharSet.Unicode, SetLastError = true)]\n    public static extern int NetGetAadJoinInformation(\n      string pcszTenantId,\n      out IntPtr ppJoinInfo);\n\n    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]\n    public struct DSREG_JOIN_INFO {\n      public int joinType;\n      public IntPtr pJoinCertificate;\n      [MarshalAs(UnmanagedType.LPWStr)] public string DeviceId;\n      [MarshalAs(UnmanagedType.LPWStr)] public string IdpDomain;\n      [MarshalAs(UnmanagedType.LPWStr)] public string TenantId;\n      [MarshalAs(UnmanagedType.LPWStr)] public string JoinUserEmail;\n      [MarshalAs(UnmanagedType.LPWStr)] public string TenantDisplayName;\n      [MarshalAs(UnmanagedType.LPWStr)] public string MdmEnrollmentUrl;\n      [MarshalAs(UnmanagedType.LPWStr)] public string MdmTermsOfUseUrl;\n      [MarshalAs(UnmanagedType.LPWStr)] public string MdmComplianceUrl;\n      [MarshalAs(UnmanagedType.LPWStr)] public string UserSettingSyncUrl;\n      public IntPtr pUserInfo;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/SourceParser/SourceCodeParser.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Runtime.InteropServices;\nusing System.Security;\nusing ProfileExplorer.Core.SourceParser;\n\nnamespace ProfileExplorer.Core.SourceParser;\n\npublic enum SourceCodeLanguage {\n  Cpp,\n  CSharp,\n  Rust\n}\n\npublic class SourceCodeParser {\n  private const int ParsingTimeoutSeconds = 3;\n  private SourceCodeLanguage language_;\n\n  public SourceCodeParser(SourceCodeLanguage language = SourceCodeLanguage.Cpp) {\n    language_ = language;\n  }\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter-cpp.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr tree_sitter_cpp();\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter-c-sharp.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr tree_sitter_c_sharp();\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter-rust.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr tree_sitter_rust();\n\n  private TSLanguage InitializeParserLanguage(SourceCodeLanguage language) {\n    switch (language) {\n      case SourceCodeLanguage.Cpp:    return new TSLanguage(tree_sitter_cpp());\n      case SourceCodeLanguage.CSharp: return new TSLanguage(tree_sitter_c_sharp());\n      case SourceCodeLanguage.Rust:   return new TSLanguage(tree_sitter_rust());\n      default:                        throw new InvalidOperationException();\n    }\n  }\n\n  public SourceSyntaxTree Parse(ReadOnlyMemory<char> text) {\n    return Parse(text.ToString());\n  }\n\n  public SourceSyntaxTree Parse(string text) {\n    SourceSyntaxTree tree = null;\n\n    try {\n      // Initialize parser.\n      using var parser = new TSParser();\n      parser.set_timeout_micros((ulong)TimeSpan.FromSeconds(ParsingTimeoutSeconds).TotalMicroseconds);\n\n      using var language = InitializeParserLanguage(language_);\n      parser.set_language(language);\n\n      // Try to parse the text.\n      using var parsedTree = parser.parse_string(null, text);\n\n      if (parsedTree == null) {\n        Trace.WriteLine($\"Failed to parse the source code text using tree-sitter.\");\n        return null;\n      }\n\n      // Walked the parse tree and build a reduced syntax tree\n      // of the main statement and expression nodes.\n      tree = new SourceSyntaxTree();\n      using var cursor = new TSCursor(parsedTree.root_node(), language);\n\n      foreach (var node in WalkTreeNodes(cursor)) {\n// #if DEBUG\n//         int so = (int)cursor.current_node().start_offset();\n//         int eo = (int)cursor.current_node().end_offset();\n//         int sl = (int)cursor.current_node().start_point().row + 1;\n//         int el = (int)cursor.current_node().end_point().row + 1;\n//         var type = node.type();\n//         var sym = node.symbol();\n//         Trace.WriteLine($\" - node type is {type}, startL {sl}, endL {el}\");\n// #endif\n\n        bool accepted = true;\n        var nodeKind = SourceSyntaxNodeKind.Other;\n\n        switch (node.type()) {\n          case \"if_statement\":\n          case \"if_expression\": { // Rust\n            nodeKind = SourceSyntaxNodeKind.If;\n            break;\n          }\n          case \"condition_clause\": {\n            nodeKind = SourceSyntaxNodeKind.Condition;\n            break;\n          }\n          case \"else_clause\": {\n            nodeKind = SourceSyntaxNodeKind.Else;\n            break;\n          }\n          case \"for_statement\":\n          case \"for_range_loop\":\n          case \"for_each_statement\": // C#\n          case \"for_expression\": { // Rust\n            nodeKind = SourceSyntaxNodeKind.Loop;\n            break;\n          }\n          case \"while_statement\":\n          case \"do_statement\": {\n            nodeKind = SourceSyntaxNodeKind.Loop;\n            break;\n          }\n          case \"switch_statement\":\n          case \"match_expression\": { // Rust\n            nodeKind = SourceSyntaxNodeKind.Switch;\n            break;\n          }\n          case \"case_statement\":\n          case \"switch_section\": // C#\n          case \"match_arm\": { // Rust\n            nodeKind = SourceSyntaxNodeKind.SwitchCase;\n            break;\n          }\n          case \"compound_statement\":\n          case \"block\": { // C#\n            nodeKind = SourceSyntaxNodeKind.Compound;\n            break;\n          }\n          case \"function_definition\":\n          case \"method_declaration\": // C#\n          case \"local_function_statement\": // C#\n          case \"function_item\": { // Rust\n            nodeKind = SourceSyntaxNodeKind.Function;\n            break;\n          }\n          case \"call_expression\":\n          case \"macro_invocation\": { // Rust\n            nodeKind = SourceSyntaxNodeKind.Call;\n            break;\n          }\n          case \"translation_unit\":\n          case \"source_file\": { // Rust\n            nodeKind = SourceSyntaxNodeKind.Root;\n            break;\n          }\n          default: {\n            accepted = false;\n            break;\n          }\n        }\n\n        if (tree.RootNode == null || accepted) {\n          var treeNode = tree.GetOrCreateNode(node.id.ToInt64());\n          int startOffset = (int)cursor.current_node().start_offset();\n          int endOffset = (int)cursor.current_node().end_offset();\n          int startLine = (int)cursor.current_node().start_point().row + 1;\n          int endLine = (int)cursor.current_node().end_point().row + 1;\n\n          treeNode.Kind = nodeKind;\n          treeNode.Start = new TextLocation(startOffset, startLine, 0);\n          treeNode.End = new TextLocation(endOffset, endLine, 0);\n\n          if (tree.RootNode == null) {\n            tree.RootNode = treeNode;\n          }\n\n          else if (nodeKind == SourceSyntaxNodeKind.Function) {\n            // Add all functions to the root node even if inide a class,\n            // to make it easier to find a function by line.\n            tree.RootNode.AddChild(treeNode);\n          }\n          else {\n            // Because not all nodes are created in the reduce syntax tree,\n            // look up for first ancestor node that is added and use it as parent.\n            var parentNode = node.parent();\n\n            while (parentNode.id != IntPtr.Zero) {\n              var parentTreeNode = tree.GetNode(parentNode.id.ToInt64());\n\n              if (parentTreeNode != null) {\n                parentTreeNode.AddChild(treeNode);\n                break;\n              }\n\n              parentNode = parentNode.parent();\n            }\n          }\n        }\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Exception parsing the source code text using tree-sitter: {ex.Message}\");\n    }\n\n    return tree;\n  }\n\n  private IEnumerable<TSNode> WalkTreeNodes(TSCursor rootNode) {\n    // Preorder traversal of the syntax tree, without using recursion.\n    var cursor = rootNode;\n    bool reachedRoot = false;\n\n    while (!reachedRoot) {\n      yield return cursor.current_node();\n\n      if (cursor.current_node().child_count() > 0 &&\n          cursor.goto_first_child()) {\n        continue;\n      }\n\n      if (cursor.current_node().next_sibling().id != IntPtr.Zero &&\n          cursor.goto_next_sibling()) {\n        continue;\n      }\n\n      bool retracting = true;\n\n      while (retracting) {\n        if (!cursor.goto_parent()) {\n          retracting = false;\n          reachedRoot = true;\n        }\n\n        if (cursor.current_node().next_sibling().id != IntPtr.Zero &&\n            cursor.goto_next_sibling()) {\n          retracting = false;\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/SourceParser/SourceSyntaxTree.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ProfileExplorer.Core.SourceParser;\n\npublic enum SourceSyntaxNodeKind {\n  Root,\n  Function,\n  If,\n  Else,\n  ElseIf,\n  Loop,\n  Switch,\n  SwitchCase,\n  Compound,\n  Condition,\n  Call,\n  Other\n}\n\npublic class SourceSyntaxNode {\n  public SourceSyntaxNode(SourceSyntaxNodeKind kind = SourceSyntaxNodeKind.Other) {\n    Kind = kind;\n  }\n\n  public SourceSyntaxNodeKind Kind { get; set; }\n  public SourceSyntaxNode ParentNode { get; set; }\n  public List<SourceSyntaxNode> ChildNodes { get; set; }\n  public TextLocation Start { get; set; }\n  public TextLocation End { get; set; }\n  public object Tag { get; set; }\n  public int Length => End.Offset - Start.Offset;\n  public bool SpansMultipleLines => End.Line != Start.Line;\n  public bool HasChildren => ChildNodes is {Count: > 0};\n\n  public void AddChild(SourceSyntaxNode node) {\n    ChildNodes ??= new List<SourceSyntaxNode>();\n    ChildNodes.Add(node);\n    node.ParentNode = this;\n  }\n\n  public SourceSyntaxNode GetChildOfKind(SourceSyntaxNodeKind kind) {\n    if (ChildNodes != null) {\n      foreach (var child in ChildNodes) {\n        if (child.Kind == kind) {\n          return child;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  public string GetText(ReadOnlyMemory<char> text) {\n    if (text.Length > 0 &&\n        End.Offset < text.Length) {\n      return text.Slice(Start.Offset, Length).ToString();\n    }\n\n    return null;\n  }\n\n  public void WalkNodes(Func<SourceSyntaxNode, int, bool> action,\n                        SourceSyntaxNodeKind kindFilter = SourceSyntaxNodeKind.Other) {\n    WalkNodes(this, action, kindFilter);\n  }\n\n  private bool WalkNodes(SourceSyntaxNode node, Func<SourceSyntaxNode, int, bool> action,\n                         SourceSyntaxNodeKind kindFilter = SourceSyntaxNodeKind.Other,\n                         int depth = 0) {\n    // Do a pre-order traversal of the tree.\n    if (node.Kind == kindFilter || kindFilter == SourceSyntaxNodeKind.Other) {\n      if (!action(node, depth)) {\n        return false;\n      }\n    }\n\n    if (node.HasChildren) {\n      foreach (var childNode in node.ChildNodes) {\n        if (!WalkNodes(childNode, action, kindFilter, depth + 1)) {\n          return false;\n        }\n      }\n    }\n\n    return true;\n  }\n\n  public string Print() {\n    var sb = new StringBuilder();\n    Print(sb, 0);\n    return sb.ToString();\n  }\n\n  public void Print(StringBuilder sb, int level) {\n    sb.Append(new string('\\t', level));\n    sb.AppendLine($\"Kind: {Kind}, Start: {Start}, End: {End}\");\n\n    if (ChildNodes != null) {\n      foreach (var child in ChildNodes) {\n        child.Print(sb, level + 1);\n      }\n    }\n  }\n}\n\npublic class SourceSyntaxTree {\n  private Dictionary<long, SourceSyntaxNode> nodeMap_;\n\n  public SourceSyntaxTree() {\n    nodeMap_ = new Dictionary<long, SourceSyntaxNode>();\n  }\n\n  public SourceSyntaxNode RootNode { get; set; }\n\n  public SourceSyntaxNode GetOrCreateNode(long id) {\n    if (!nodeMap_.TryGetValue(id, out var node)) {\n      node = new SourceSyntaxNode();\n      nodeMap_[id] = node;\n    }\n\n    return node;\n  }\n\n  public SourceSyntaxNode GetNode(long id) {\n    return nodeMap_.GetValueOrDefault(id);\n  }\n\n  public SourceSyntaxNode FindFunctionNode(int startLine) {\n    if (RootNode is not {HasChildren: true}) {\n      return null;\n    }\n\n    foreach (var node in RootNode.ChildNodes) {\n      if (node.Kind == SourceSyntaxNodeKind.Function) {\n        if (Math.Abs(node.Start.Line - startLine) <= 1) {\n          return node;\n        }\n\n        // Check the compound node of the function,\n        // the start line in debug info is usually this line.\n        var childNode = node.GetChildOfKind(SourceSyntaxNodeKind.Compound);\n\n        if (childNode != null && Math.Abs(childNode.Start.Line - startLine) <= 1) {\n          return node;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  public string Print() {\n    var sb = new StringBuilder();\n    RootNode?.Print(sb, 0);\n    return sb.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/SourceParser/TreeSitter.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n//////////////////////////////////////////////////////////////////////////////\n//\n//  Module Name:\n//      binding.cs\n//\n//  Abstract:\n//      Wrapper for GitHub Tree-Sitter Library.\n//\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Security;\n\nnamespace ProfileExplorer.Core.SourceParser;\n\npublic enum TSInputEncoding {\n  TSInputEncodingUTF8,\n  TSInputEncodingUTF16\n}\n\npublic enum TSSymbolType {\n  TSSymbolTypeRegular,\n  TSSymbolTypeAnonymous,\n  TSSymbolTypeAuxiliary\n}\n\npublic enum TSLogType {\n  TSLogTypeParse,\n  TSLogTypeLex\n}\n\npublic enum TSQuantifier {\n  TSQuantifierZero = 0, // must match the array initialization value\n  TSQuantifierZeroOrOne,\n  TSQuantifierZeroOrMore,\n  TSQuantifierOne,\n  TSQuantifierOneOrMore\n}\n\npublic enum TSQueryPredicateStepType {\n  TSQueryPredicateStepTypeDone,\n  TSQueryPredicateStepTypeCapture,\n  TSQueryPredicateStepTypeString\n}\n\npublic enum TSQueryError {\n  TSQueryErrorNone = 0,\n  TSQueryErrorSyntax,\n  TSQueryErrorNodeType,\n  TSQueryErrorField,\n  TSQueryErrorCapture,\n  TSQueryErrorStructure,\n  TSQueryErrorLanguage\n}\n\n[StructLayout(LayoutKind.Sequential)]\npublic struct TSPoint {\n  public uint row;\n  public uint column;\n\n  public TSPoint(uint row, uint column) {\n    this.row = row;\n    this.column = column;\n  }\n}\n\n[StructLayout(LayoutKind.Sequential)]\npublic struct TSRange {\n  public TSPoint start_point;\n  public TSPoint end_point;\n  public uint start_byte;\n  public uint end_byte;\n}\n\n[StructLayout(LayoutKind.Sequential)]\npublic struct TSInputEdit {\n  public uint start_byte;\n  public uint old_end_byte;\n  public uint new_end_byte;\n  public TSPoint start_point;\n  public TSPoint old_end_point;\n  public TSPoint new_end_point;\n}\n\n[StructLayout(LayoutKind.Sequential)]\npublic struct TSQueryCapture {\n  public TSNode node;\n  public uint index;\n}\n\n[StructLayout(LayoutKind.Sequential)]\npublic struct TSQueryMatch {\n  public uint id;\n  public ushort pattern_index;\n  public ushort capture_count;\n  public IntPtr captures;\n}\n\n[StructLayout(LayoutKind.Sequential)]\npublic struct TSQueryPredicateStep {\n  public TSQueryPredicateStepType type;\n  public uint value_id;\n}\n\npublic delegate void TSLogger(TSLogType logType, string message);\n/********************/\n/* Section - Parser */\n/********************/\n\npublic sealed class TSParser : IDisposable {\n  public TSParser() {\n    Ptr = ts_parser_new();\n  }\n\n  private IntPtr Ptr { get; set; }\n\n  public void Dispose() {\n    if (Ptr != IntPtr.Zero) {\n      ts_parser_delete(Ptr);\n      Ptr = IntPtr.Zero;\n    }\n  }\n\n  public bool set_language(TSLanguage language) { return ts_parser_set_language(Ptr, language.Ptr); }\n\n  public TSLanguage language() {\n    IntPtr ptr = ts_parser_language(Ptr);\n    return ptr != IntPtr.Zero ? new TSLanguage(ptr) : null;\n  }\n\n  public bool set_included_ranges(TSRange[] ranges) {\n    return ts_parser_set_included_ranges(Ptr, ranges, (uint)ranges.Length);\n  }\n\n  public TSRange[] included_ranges() {\n    uint length;\n    return ts_parser_included_ranges(Ptr, out length);\n  }\n\n  public TSTree parse_string(TSTree oldTree, string input) {\n    IntPtr ptr = ts_parser_parse_string_encoding(Ptr, oldTree != null ? oldTree.Ptr : IntPtr.Zero,\n                                                 input, (uint)input.Length * 2, TSInputEncoding.TSInputEncodingUTF16);\n    return ptr != IntPtr.Zero ? new TSTree(ptr) : null;\n  }\n\n  public void reset() { ts_parser_reset(Ptr); }\n  public void set_timeout_micros(ulong timeout) { ts_parser_set_timeout_micros(Ptr, timeout); }\n  public ulong timeout_micros() { return ts_parser_timeout_micros(Ptr); }\n\n  public void set_logger(TSLogger logger) {\n    var code = new _TSLoggerCode(logger);\n    var data = new _TSLoggerData {Log = logger != null ? new TSLogCallback(code.LogCallback) : null};\n    ts_parser_set_logger(Ptr, data);\n  }\n\n  [StructLayout(LayoutKind.Sequential)]\n  private struct _TSLoggerData {\n    private IntPtr Payload;\n    internal TSLogCallback Log;\n  }\n\n  [UnmanagedFunctionPointer(CallingConvention.Cdecl)]\n  private delegate void TSLogCallback(IntPtr payload, TSLogType logType,\n                                      [MarshalAs(UnmanagedType.LPUTF8Str)] string message);\n\n  private class _TSLoggerCode {\n    private TSLogger logger;\n\n    internal _TSLoggerCode(TSLogger logger) {\n      this.logger = logger;\n    }\n\n    internal void LogCallback(IntPtr payload, TSLogType logType, string message) {\n      logger(logType, message);\n    }\n  }\n\n#region PInvoke\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter-cpp.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr tree_sitter_cpp();\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter-c-sharp.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr tree_sitter_c_sharp();\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter-rust.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr tree_sitter_rust();\n\n  /**\n  * Create a new parser.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_parser_new();\n\n  /**\n  * Delete the parser, freeing all of the memory that it used.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_parser_delete(IntPtr parser);\n\n  /**\n  * Set the language that the parser should use for parsing.\n  *\n  * Returns a boolean indicating whether or not the language was successfully\n  * assigned. True means assignment succeeded. False means there was a version\n  * mismatch: the language was generated with an incompatible version of the\n  * Tree-sitter CLI. Check the language's version using `ts_language_version`\n  * and compare it to this library's `TREE_SITTER_LANGUAGE_VERSION` and\n  * `TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION` constants.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  [return: MarshalAs(UnmanagedType.I1)]\n  private static extern bool ts_parser_set_language(IntPtr parser, IntPtr language);\n\n  /**\n  * Get the parser's current language.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_parser_language(IntPtr parser);\n\n  /**\n  * Set the ranges of text that the parser should include when parsing.\n  *\n  * By default, the parser will always include entire documents. This function\n  * allows you to parse only a *portion* of a document but still return a syntax\n  * tree whose ranges match up with the document as a whole. You can also pass\n  * multiple disjoint ranges.\n  *\n  * The second and third parameters specify the location and length of an array\n  * of ranges. The parser does *not* take ownership of these ranges; it copies\n  * the data, so it doesn't matter how these ranges are allocated.\n  *\n  * If `length` is zero, then the entire document will be parsed. Otherwise,\n  * the given ranges must be ordered from earliest to latest in the document,\n  * and they must not overlap. That is, the following must hold for all\n  * `i` < `length - 1`: ranges[i].end_byte <= ranges[i + 1].start_byte\n  *\n  * If this requirement is not satisfied, the operation will fail, the ranges\n  * will not be assigned, and this function will return `false`. On success,\n  * this function returns `true`\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  //[return: MarshalAs(UnmanagedType.I1)]\n  private static extern bool ts_parser_set_included_ranges(IntPtr parser,\n                                                           [In][MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)]\n                                                           TSRange[] ranges, uint length);\n\n  /**\n  * Get the ranges of text that the parser will include when parsing.\n  *\n  * The returned pointer is owned by the parser. The caller should not free it\n  * or write to it. The length of the array will be written to the given\n  * `length` pointer.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  [return: MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)]\n  private static extern TSRange[] ts_parser_included_ranges(IntPtr parser, out uint length);\n\n  /**\n  * Use the parser to parse some source code stored in one contiguous buffer.\n  * The first two parameters are the same as in the `ts_parser_parse` function\n  * above. The second two parameters indicate the location of the buffer and its\n  * length in bytes.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_parser_parse_string(IntPtr parser, IntPtr oldTree,\n                                                      [MarshalAs(UnmanagedType.LPUTF8Str)] string input, uint length);\n\n  /**\n  * Use the parser to parse some source code stored in one contiguous buffer.\n  * The first two parameters are the same as in the `ts_parser_parse` function\n  * above. The second two parameters indicate the location of the buffer and its\n  * length in bytes.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  //private static extern IntPtr ts_parser_parse_string_encoding(IntPtr parser, IntPtr oldTree, [MarshalAs(UnmanagedType.LPUTF8Str)] string input, uint length, TSInputEncoding encoding);\n  private static extern IntPtr ts_parser_parse_string_encoding(IntPtr parser, IntPtr oldTree,\n                                                               [MarshalAs(UnmanagedType.LPWStr)] string input,\n                                                               uint length, TSInputEncoding encoding);\n\n  /**\n  * Instruct the parser to start the next parse from the beginning.\n  *\n  * If the parser previously failed because of a timeout or a cancellation, then\n  * by default, it will resume where it left off on the next call to\n  * `ts_parser_parse` or other parsing functions. If you don't want to resume,\n  * and instead intend to use this parser to parse some other document, you must\n  * call `ts_parser_reset` first.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_parser_reset(IntPtr parser);\n\n  /**\n  * Set the maximum duration in microseconds that parsing should be allowed to\n  * take before halting.\n  *\n  * If parsing takes longer than this, it will halt early, returning NULL.\n  * See `ts_parser_parse` for more information.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_parser_set_timeout_micros(IntPtr parser, ulong timeout);\n\n  /**\n  * Get the duration in microseconds that parsing is allowed to take.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern ulong ts_parser_timeout_micros(IntPtr parser);\n\n  /**\n  * Set the parser's current cancellation flag pointer.\n  *\n  * If a non-null pointer is assigned, then the parser will periodically read\n  * from this pointer during parsing. If it reads a non-zero value, it will\n  * halt early, returning NULL. See `ts_parser_parse` for more information.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_parser_set_cancellation_flag(IntPtr parser, ref IntPtr flag);\n\n  /**\n  * Get the parser's current cancellation flag pointer.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_parser_cancellation_flag(IntPtr parser);\n\n  /**\n  * Set the logger that a parser should use during parsing.\n  *\n  * The parser does not take ownership over the logger payload. If a logger was\n  * previously assigned, the caller is responsible for releasing any memory\n  * owned by the previous logger.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_parser_set_logger(IntPtr parser, _TSLoggerData logger);\n\n#endregion\n}\n\n/******************/\n/* Section - Tree */\n/******************/\n\npublic sealed class TSTree : IDisposable {\n  public TSTree(IntPtr ptr) {\n    Ptr = ptr;\n  }\n\n  internal IntPtr Ptr { get; private set; }\n\n  public void Dispose() {\n    if (Ptr != IntPtr.Zero) {\n      ts_tree_delete(Ptr);\n      Ptr = IntPtr.Zero;\n    }\n  }\n\n  public TSTree copy() {\n    IntPtr ptr = ts_tree_copy(Ptr);\n    return ptr != IntPtr.Zero ? new TSTree(ptr) : null;\n  }\n\n  public TSNode root_node() { return ts_tree_root_node(Ptr); }\n\n  public TSNode root_node_with_offset(uint offsetBytes, TSPoint offsetPoint) {\n    return ts_tree_root_node_with_offset(Ptr, offsetBytes, offsetPoint);\n  }\n\n  public TSLanguage language() {\n    IntPtr ptr = ts_tree_language(Ptr);\n    return ptr != IntPtr.Zero ? new TSLanguage(ptr) : null;\n  }\n\n  public void edit(TSInputEdit edit) { ts_tree_edit(Ptr, ref edit); }\n#region PInvoke\n\n  /**\n  * Create a shallow copy of the syntax tree. This is very fast.\n  *\n  * You need to copy a syntax tree in order to use it on more than one thread at\n  * a time, as syntax trees are not thread safe.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_tree_copy(IntPtr tree);\n\n  /**\n  * Delete the syntax tree, freeing all of the memory that it used.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_tree_delete(IntPtr tree);\n\n  /**\n  * Get the root node of the syntax tree.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_tree_root_node(IntPtr tree);\n\n  /**\n  * Get the root node of the syntax tree, but with its position\n  * shifted forward by the given offset.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_tree_root_node_with_offset(IntPtr tree, uint offsetBytes, TSPoint offsetPoint);\n\n  /**\n  * Get the language that was used to parse the syntax tree.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_tree_language(IntPtr tree);\n\n  /**\n  * Get the array of included ranges that was used to parse the syntax tree.\n  *\n  * The returned pointer must be freed by the caller.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_tree_included_ranges(IntPtr tree, out uint length);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_tree_included_ranges_free(IntPtr ranges);\n\n  /**\n  * Edit the syntax tree to keep it in sync with source code that has been\n  * edited.\n  *\n  * You must describe the edit both in terms of byte offsets and in terms of\n  * (row, column) coordinates.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_tree_edit(IntPtr tree, ref TSInputEdit edit);\n\n  /**\n  * Compare an old edited syntax tree to a new syntax tree representing the same\n  * document, returning an array of ranges whose syntactic structure has changed.\n  *\n  * For this to work correctly, the old syntax tree must have been edited such\n  * that its ranges match up to the new tree. Generally, you'll want to call\n  * this function right after calling one of the `ts_parser_parse` functions.\n  * You need to pass the old tree that was passed to parse, as well as the new\n  * tree that was returned from that function.\n  *\n  * The returned array is allocated using `malloc` and the caller is responsible\n  * for freeing it using `free`. The length of the array will be written to the\n  * given `length` pointer.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_tree_get_changed_ranges(IntPtr old_tree, IntPtr new_tree, out uint length);\n\n#endregion\n}\n\n/******************/\n/* Section - Node */\n/******************/\n[StructLayout(LayoutKind.Sequential)]\npublic struct TSNode {\n  private uint context0;\n  private uint context1;\n  private uint context2;\n  private uint context3;\n  public IntPtr id;\n  private IntPtr tree;\n\n  public void clear() {\n    id = IntPtr.Zero;\n    tree = IntPtr.Zero;\n  }\n\n  public bool is_zero() { return id == IntPtr.Zero && tree == IntPtr.Zero; }\n  public string type() { return Marshal.PtrToStringAnsi(ts_node_type(this)); }\n  public string type(TSLanguage lang) { return lang.symbol_name(symbol()); }\n  public ushort symbol() { return ts_node_symbol(this); }\n  public uint start_offset() { return ts_node_start_byte(this) / sizeof(ushort); }\n\n  public TSPoint start_point() {\n    var pt = ts_node_start_point(this);\n    return new TSPoint(pt.row, pt.column / sizeof(ushort));\n  }\n\n  public uint end_offset() { return ts_node_end_byte(this) / sizeof(ushort); }\n\n  public TSPoint end_point() {\n    var pt = ts_node_end_point(this);\n    return new TSPoint(pt.row, pt.column / sizeof(ushort));\n  }\n\n  public string to_string() {\n    IntPtr dat = ts_node_string(this);\n    string str = Marshal.PtrToStringAnsi(dat);\n    ts_node_string_free(dat);\n    return str;\n  }\n\n  public bool is_null() { return ts_node_is_null(this); }\n  public bool is_named() { return ts_node_is_named(this); }\n  public bool is_missing() { return ts_node_is_missing(this); }\n  public bool is_extra() { return ts_node_is_extra(this); }\n  public bool has_changes() { return ts_node_has_changes(this); }\n  public bool has_error() { return ts_node_has_error(this); }\n  public TSNode parent() { return ts_node_parent(this); }\n  public TSNode child(uint index) { return ts_node_child(this, index); }\n  public IntPtr field_name_for_child(uint index) { return ts_node_field_name_for_child(this, index); }\n  public uint child_count() { return ts_node_child_count(this); }\n  public TSNode named_child(uint index) { return ts_node_named_child(this, index); }\n  public uint named_child_count() { return ts_node_named_child_count(this); }\n\n  public TSNode child_by_field_name(string field_name) {\n    return ts_node_child_by_field_name(this, field_name, (uint)field_name.Length);\n  }\n\n  public TSNode child_by_field_id(ushort fieldId) { return ts_node_child_by_field_id(this, fieldId); }\n  public TSNode next_sibling() { return ts_node_next_sibling(this); }\n  public TSNode prev_sibling() { return ts_node_prev_sibling(this); }\n  public TSNode next_named_sibling() { return ts_node_next_named_sibling(this); }\n  public TSNode prev_named_sibling() { return ts_node_prev_named_sibling(this); }\n\n  public TSNode first_child_for_offset(uint offset) {\n    return ts_node_first_child_for_byte(this, offset * sizeof(ushort));\n  }\n\n  public TSNode first_named_child_for_offset(uint offset) {\n    return ts_node_first_named_child_for_byte(this, offset * sizeof(ushort));\n  }\n\n  public TSNode descendant_for_offset_range(uint start, uint end) {\n    return ts_node_descendant_for_byte_range(this, start * sizeof(ushort), end * sizeof(ushort));\n  }\n\n  public TSNode descendant_for_point_range(TSPoint start, TSPoint end) {\n    return ts_node_descendant_for_point_range(this, start, end);\n  }\n\n  public TSNode named_descendant_for_offset_range(uint start, uint end) {\n    return ts_node_named_descendant_for_byte_range(this, start * sizeof(ushort), end * sizeof(ushort));\n  }\n\n  public TSNode named_descendant_for_point_range(TSPoint start, TSPoint end) {\n    return ts_node_named_descendant_for_point_range(this, start, end);\n  }\n\n  public bool eq(TSNode other) { return ts_node_eq(this, other); }\n\n  public string text(string data) {\n    uint beg = start_offset();\n    uint end = end_offset();\n    return data.Substring((int)beg, (int)(end - beg));\n  }\n\n#region PInvoke\n\n  /**\n  * Get the node's type as a null-terminated string.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_node_type(TSNode node);\n\n  /**\n  * Get the node's type as a numerical id.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern ushort ts_node_symbol(TSNode node);\n\n  /**\n  * Get the node's start byte.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_node_start_byte(TSNode node);\n\n  /**\n  * Get the node's start position in terms of rows and columns.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSPoint ts_node_start_point(TSNode node);\n\n  /**\n  * Get the node's end byte.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_node_end_byte(TSNode node);\n\n  /**\n  * Get the node's end position in terms of rows and columns.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSPoint ts_node_end_point(TSNode node);\n\n  /**\n  * Get an S-expression representing the node as a string.\n  *\n  * This string is allocated with `malloc` and the caller is responsible for\n  * freeing it using `free`.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_node_string(TSNode node);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_node_string_free(IntPtr str);\n\n  /**\n  * Check if the node is null. Functions like `ts_node_child` and\n  * `ts_node_next_sibling` will return a null node to indicate that no such node\n  * was found.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_node_is_null(TSNode node);\n\n  /**\n  * Check if the node is *named*. Named nodes correspond to named rules in the\n  * grammar, whereas *anonymous* nodes correspond to string literals in the\n  * grammar.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_node_is_named(TSNode node);\n\n  /**\n  * Check if the node is *missing*. Missing nodes are inserted by the parser in\n  * order to recover from certain kinds of syntax errors.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_node_is_missing(TSNode node);\n\n  /**\n  * Check if the node is *extra*. Extra nodes represent things like comments,\n  * which are not required the grammar, but can appear anywhere.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_node_is_extra(TSNode node);\n\n  /**\n  * Check if a syntax node has been edited.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_node_has_changes(TSNode node);\n\n  /**\n  * Check if the node is a syntax error or contains any syntax errors.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_node_has_error(TSNode node);\n\n  /**\n  * Get the node's immediate parent.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_parent(TSNode node);\n\n  /**\n  * Get the node's child at the given index, where zero represents the first\n  * child.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_child(TSNode node, uint index);\n\n  /**\n  * Get the field name for node's child at the given index, where zero represents\n  * the first child. Returns NULL, if no field is found.\n  */\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_node_field_name_for_child(TSNode node, uint index);\n\n  /**\n  * Get the node's number of children.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_node_child_count(TSNode node);\n\n  /**\n  * Get the node's number of *named* children.\n  *\n  * See also `ts_node_is_named`.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_named_child(TSNode node, uint index);\n\n  /**\n  * Get the node's number of *named* children.\n  *\n  * See also `ts_node_is_named`.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_node_named_child_count(TSNode node);\n\n  /**\n  * Get the node's child with the given numerical field id.\n  *\n  * You can convert a field name to an id using the\n  * `ts_language_field_id_for_name` function.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_child_by_field_name(TSNode self,\n                                                           [MarshalAs(UnmanagedType.LPUTF8Str)] string field_name,\n                                                           uint field_name_length);\n\n  /**\n  * Get the node's child with the given numerical field id.\n  *\n  * You can convert a field name to an id using the\n  * `ts_language_field_id_for_name` function.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_child_by_field_id(TSNode self, ushort fieldId);\n\n  /**\n  * Get the node's next / previous sibling.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_next_sibling(TSNode self);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_prev_sibling(TSNode self);\n\n  /**\n  * Get the node's next / previous *named* sibling.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_next_named_sibling(TSNode self);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_prev_named_sibling(TSNode self);\n\n  /**\n  * Get the node's first child that extends beyond the given byte offset.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_first_child_for_byte(TSNode self, uint byteOffset);\n\n  /**\n  * Get the node's first named child that extends beyond the given byte offset.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_first_named_child_for_byte(TSNode self, uint byteOffset);\n\n  /**\n  * Get the smallest node within this node that spans the given range of bytes\n  * or (row, column) positions.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_descendant_for_byte_range(TSNode self, uint startByte, uint endByte);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_descendant_for_point_range(TSNode self, TSPoint startPoint, TSPoint endPoint);\n\n  /**\n  * Get the smallest named node within this node that spans the given range of\n  * bytes or (row, column) positions.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_named_descendant_for_byte_range(TSNode self, uint startByte, uint endByte);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_node_named_descendant_for_point_range(TSNode self, TSPoint startPoint,\n                                                                        TSPoint endPoint);\n\n  /**\n  * Check if two nodes are identical.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_node_eq(TSNode node1, TSNode node2);\n\n#endregion\n}\n\n/************************/\n/* Section - TreeCursor */\n/************************/\n\npublic sealed class TSCursor : IDisposable {\n  private IntPtr Ptr;\n  private TSTreeCursor cursor;\n\n  public TSCursor(TSTreeCursor cursor, TSLanguage lang) {\n    this.cursor = cursor;\n    this.lang = lang;\n    Ptr = new IntPtr(1);\n  }\n\n  public TSCursor(TSNode node, TSLanguage lang) {\n    cursor = ts_tree_cursor_new(node);\n    this.lang = lang;\n    Ptr = new IntPtr(1);\n  }\n\n  public TSLanguage lang { get; private set; }\n\n  public void Dispose() {\n    if (Ptr != IntPtr.Zero) {\n      ts_tree_cursor_delete(ref cursor);\n      Ptr = IntPtr.Zero;\n    }\n  }\n\n  public void reset(TSNode node) { ts_tree_cursor_reset(ref cursor, node); }\n  public TSNode current_node() { return ts_tree_cursor_current_node(ref cursor); }\n  public string current_field() { return lang.fields[current_field_id()]; }\n\n  public string current_symbol() {\n    ushort symbol = ts_tree_cursor_current_node(ref cursor).symbol();\n    return symbol != ushort.MaxValue ? lang.symbols[symbol] : \"ERROR\";\n  }\n\n  public ushort current_field_id() { return ts_tree_cursor_current_field_id(ref cursor); }\n  public bool goto_parent() { return ts_tree_cursor_goto_parent(ref cursor); }\n  public bool goto_next_sibling() { return ts_tree_cursor_goto_next_sibling(ref cursor); }\n  public bool goto_first_child() { return ts_tree_cursor_goto_first_child(ref cursor); }\n\n  public long goto_first_child_for_offset(uint offset) {\n    return ts_tree_cursor_goto_first_child_for_byte(ref cursor, offset * sizeof(ushort));\n  }\n\n  public long goto_first_child_for_point(TSPoint point) {\n    return ts_tree_cursor_goto_first_child_for_point(ref cursor, point);\n  }\n\n  public TSCursor copy() { return new TSCursor(ts_tree_cursor_copy(ref cursor), lang); }\n\n  [StructLayout(LayoutKind.Sequential)]\n  public struct TSTreeCursor {\n    private IntPtr Tree;\n    private IntPtr Id;\n    private uint Context0;\n    private uint Context1;\n  }\n\n#region PInvoke\n\n  /**\n  * Create a new tree cursor starting from the given node.\n  *\n  * A tree cursor allows you to walk a syntax tree more efficiently than is\n  * possible using the `TSNode` functions. It is a mutable object that is always\n  * on a certain syntax node, and can be moved imperatively to different nodes.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSTreeCursor ts_tree_cursor_new(TSNode node);\n\n  /**\n  * Delete a tree cursor, freeing all of the memory that it used.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_tree_cursor_delete(ref TSTreeCursor cursor);\n\n  /**\n  * Re-initialize a tree cursor to start at a different node.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_tree_cursor_reset(ref TSTreeCursor cursor, TSNode node);\n\n  /**\n  * Get the tree cursor's current node.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSNode ts_tree_cursor_current_node(ref TSTreeCursor cursor);\n\n  /**\n  * Get the field name of the tree cursor's current node.\n  *\n  * This returns `NULL` if the current node doesn't have a field.\n  * See also `ts_node_child_by_field_name`.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_tree_cursor_current_field_name(ref TSTreeCursor cursor);\n\n  /**\n  * Get the field id of the tree cursor's current node.\n  *\n  * This returns zero if the current node doesn't have a field.\n  * See also `ts_node_child_by_field_id`, `ts_language_field_id_for_name`.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern ushort ts_tree_cursor_current_field_id(ref TSTreeCursor cursor);\n\n  /**\n  * Move the cursor to the parent of its current node.\n  *\n  * This returns `true` if the cursor successfully moved, and returns `false`\n  * if there was no parent node (the cursor was already on the root node).\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_tree_cursor_goto_parent(ref TSTreeCursor cursor);\n\n  /**\n  * Move the cursor to the next sibling of its current node.\n  *\n  * This returns `true` if the cursor successfully moved, and returns `false`\n  * if there was no next sibling node.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_tree_cursor_goto_next_sibling(ref TSTreeCursor cursor);\n\n  /**\n  * Move the cursor to the first child of its current node.\n  *\n  * This returns `true` if the cursor successfully moved, and returns `false`\n  * if there were no children.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_tree_cursor_goto_first_child(ref TSTreeCursor cursor);\n\n  /**\n  * Move the cursor to the first child of its current node that extends beyond\n  * the given byte offset or point.\n  *\n  * This returns the index of the child node if one was found, and returns -1\n  * if no such child was found.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern long ts_tree_cursor_goto_first_child_for_byte(ref TSTreeCursor cursor, uint byteOffset);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern long ts_tree_cursor_goto_first_child_for_point(ref TSTreeCursor cursor, TSPoint point);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSTreeCursor ts_tree_cursor_copy(ref TSTreeCursor cursor);\n\n#endregion\n}\n\n/*******************/\n/* Section - Query */\n/*******************/\n\npublic sealed class TSQuery : IDisposable {\n  public TSQuery(IntPtr ptr) {\n    Ptr = ptr;\n  }\n\n  internal IntPtr Ptr { get; private set; }\n\n  public void Dispose() {\n    if (Ptr != IntPtr.Zero) {\n      ts_query_delete(Ptr);\n      Ptr = IntPtr.Zero;\n    }\n  }\n\n  public uint pattern_count() { return ts_query_pattern_count(Ptr); }\n  public uint capture_count() { return ts_query_capture_count(Ptr); }\n  public uint string_count() { return ts_query_string_count(Ptr); }\n\n  public uint start_offset_for_pattern(uint patternIndex) {\n    return ts_query_start_byte_for_pattern(Ptr, patternIndex) / sizeof(ushort);\n  }\n\n  public IntPtr predicates_for_pattern(uint patternIndex, out uint length) {\n    return ts_query_predicates_for_pattern(Ptr, patternIndex, out length);\n  }\n\n  public bool is_pattern_rooted(uint patternIndex) { return ts_query_is_pattern_rooted(Ptr, patternIndex); }\n  public bool is_pattern_non_local(uint patternIndex) { return ts_query_is_pattern_non_local(Ptr, patternIndex); }\n\n  public bool is_pattern_guaranteed_at_offset(uint offset) {\n    return ts_query_is_pattern_guaranteed_at_step(Ptr, offset / sizeof(ushort));\n  }\n\n  public string capture_name_for_id(uint id, out uint length) {\n    return Marshal.PtrToStringAnsi(ts_query_capture_name_for_id(Ptr, id, out length));\n  }\n\n  public TSQuantifier capture_quantifier_for_id(uint patternId, uint captureId) {\n    return ts_query_capture_quantifier_for_id(Ptr, patternId, captureId);\n  }\n\n  public string string_value_for_id(uint id, out uint length) {\n    return Marshal.PtrToStringAnsi(ts_query_string_value_for_id(Ptr, id, out length));\n  }\n\n  public void disable_capture(string captureName) {\n    ts_query_disable_capture(Ptr, captureName, (uint)captureName.Length);\n  }\n\n  public void disable_pattern(uint patternIndex) { ts_query_disable_pattern(Ptr, patternIndex); }\n#region PInvoke\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_delete(IntPtr query);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_query_pattern_count(IntPtr query);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_query_capture_count(IntPtr query);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_query_string_count(IntPtr query);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_query_start_byte_for_pattern(IntPtr query, uint patternIndex);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_query_predicates_for_pattern(IntPtr query, uint patternIndex, out uint length);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_query_is_pattern_rooted(IntPtr query, uint patternIndex);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_query_is_pattern_non_local(IntPtr query, uint patternIndex);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_query_is_pattern_guaranteed_at_step(IntPtr query, uint byteOffset);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_query_capture_name_for_id(IntPtr query, uint id, out uint length);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSQuantifier ts_query_capture_quantifier_for_id(IntPtr query, uint patternId, uint captureId);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_query_string_value_for_id(IntPtr query, uint id, out uint length);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_disable_capture(IntPtr query,\n                                                      [MarshalAs(UnmanagedType.LPUTF8Str)] string captureName,\n                                                      uint captureNameLength);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_disable_pattern(IntPtr query, uint patternIndex);\n\n#endregion\n}\n\npublic sealed class TSQueryCursor : IDisposable {\n  private TSQueryCursor(IntPtr ptr) {\n    Ptr = ptr;\n  }\n\n  public TSQueryCursor() {\n    Ptr = ts_query_cursor_new();\n  }\n\n  private IntPtr Ptr { get; set; }\n\n  public void Dispose() {\n    if (Ptr != IntPtr.Zero) {\n      ts_query_cursor_delete(Ptr);\n      Ptr = IntPtr.Zero;\n    }\n  }\n\n  public void exec(TSQuery query, TSNode node) { ts_query_cursor_exec(Ptr, query.Ptr, node); }\n  public bool did_exceed_match_limit() { return ts_query_cursor_did_exceed_match_limit(Ptr); }\n  public uint match_limit() { return ts_query_cursor_match_limit(Ptr); }\n  public void set_match_limit(uint limit) { ts_query_cursor_set_match_limit(Ptr, limit); }\n\n  public void set_range(uint start, uint end) {\n    ts_query_cursor_set_byte_range(Ptr, start * sizeof(ushort), end * sizeof(ushort));\n  }\n\n  public void set_point_range(TSPoint start, TSPoint end) { ts_query_cursor_set_point_range(Ptr, start, end); }\n\n  public bool next_match(out TSQueryMatch match, out TSQueryCapture[] captures) {\n    captures = null;\n\n    if (ts_query_cursor_next_match(Ptr, out match)) {\n      if (match.capture_count > 0) {\n        captures = new TSQueryCapture [match.capture_count];\n\n        for (ushort i = 0; i < match.capture_count; i++) {\n          IntPtr intPtr = match.captures + Marshal.SizeOf(typeof(TSQueryCapture)) * i;\n          captures[i] = Marshal.PtrToStructure<TSQueryCapture>(intPtr);\n        }\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  public void remove_match(uint id) { ts_query_cursor_remove_match(Ptr, id); }\n\n  public bool next_capture(out TSQueryMatch match, out uint index) {\n    return ts_query_cursor_next_capture(Ptr, out match, out index);\n  }\n\n#region PInvoke\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_query_cursor_new();\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_cursor_delete(IntPtr cursor);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_cursor_exec(IntPtr cursor, IntPtr query, TSNode node);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_query_cursor_did_exceed_match_limit(IntPtr cursor);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_query_cursor_match_limit(IntPtr cursor);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_cursor_set_match_limit(IntPtr cursor, uint limit);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_cursor_set_byte_range(IntPtr cursor, uint start_byte, uint end_byte);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_cursor_set_point_range(IntPtr cursor, TSPoint start_point, TSPoint end_point);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool ts_query_cursor_next_match(IntPtr cursor, out TSQueryMatch match);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern void ts_query_cursor_remove_match(IntPtr cursor, uint id);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern bool\n    ts_query_cursor_next_capture(IntPtr cursor, out TSQueryMatch match, out uint capture_index);\n\n#endregion\n}\n\n/**********************/\n/* Section - Language */\n/**********************/\n\npublic sealed class TSLanguage : IDisposable {\n  public string[] symbols;\n  public string[] fields;\n  public Dictionary<string, ushort> fieldIds;\n\n  public TSLanguage(IntPtr ptr) {\n    Ptr = ptr;\n\n    symbols = new string[symbol_count() + 1];\n\n    for (ushort i = 0; i < symbols.Length; i++) {\n      symbols[i] = Marshal.PtrToStringAnsi(ts_language_symbol_name(Ptr, i));\n    }\n\n    fields = new string[field_count() + 1];\n    fieldIds = new Dictionary<string, ushort>((int)field_count() + 1);\n\n    for (ushort i = 0; i < fields.Length; i++) {\n      fields[i] = Marshal.PtrToStringAnsi(ts_language_field_name_for_id(Ptr, i));\n\n      if (fields[i] != null) {\n        fieldIds.Add(fields[i], i); // TODO: check for dupes, and throw if found\n      }\n    }\n\n#if false\n            for (int i = 0; i < symbols.Length; i++) {\n                for (int j = 0; j < i; j++) {\n                    Debug.Assert(symbols[i] != symbols[j]);\n                }\n            }\n\n            for (int i = 0; i < fields.Length; i++) {\n                for (int j = 0; j < i; j++) {\n                    Debug.Assert(fields[i] != fields[j]);\n                }\n            }\n#endif\n  }\n\n  internal IntPtr Ptr { get; private set; }\n\n  public void Dispose() {\n    if (Ptr != IntPtr.Zero) {\n      //ts_query_cursor_delete(Ptr);\n      Ptr = IntPtr.Zero;\n    }\n  }\n\n  public TSQuery query_new(string source, out uint error_offset, out TSQueryError error_type) {\n    IntPtr ptr = ts_query_new(Ptr, source, (uint)source.Length, out error_offset, out error_type);\n    return ptr != IntPtr.Zero ? new TSQuery(ptr) : null;\n  }\n\n  public uint symbol_count() { return ts_language_symbol_count(Ptr); }\n  public string symbol_name(ushort symbol) { return symbol != ushort.MaxValue ? symbols[symbol] : \"ERROR\"; }\n\n  public ushort symbol_for_name(string str, bool is_named) {\n    return ts_language_symbol_for_name(Ptr, str, (uint)str.Length, is_named);\n  }\n\n  public uint field_count() { return ts_language_field_count(Ptr); }\n  public string field_name_for_id(ushort fieldId) { return fields[fieldId]; }\n  public ushort field_id_for_name(string str) { return ts_language_field_id_for_name(Ptr, str, (uint)str.Length); }\n  public TSSymbolType symbol_type(ushort symbol) { return ts_language_symbol_type(Ptr, symbol); }\n#region PInvoke\n\n  /**\n  * Create a new query from a string containing one or more S-expression\n  * patterns. The query is associated with a particular language, and can\n  * only be run on syntax nodes parsed with that language.\n  *\n  * If all of the given patterns are valid, this returns a `TSQuery`.\n  * If a pattern is invalid, this returns `NULL`, and provides two pieces\n  * of information about the problem:\n  * 1. The byte offset of the error is written to the `error_offset` parameter.\n  * 2. The type of error is written to the `error_type` parameter.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_query_new(IntPtr language, [MarshalAs(UnmanagedType.LPUTF8Str)] string source,\n                                            uint source_len, out uint error_offset, out TSQueryError error_type);\n\n  /**\n  * Get the number of distinct node types in the language.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_language_symbol_count(IntPtr language);\n\n  /**\n  * Get a node type string for the given numerical id.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_language_symbol_name(IntPtr language, ushort symbol);\n\n  /**\n  * Get the numerical id for the given node type string.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern ushort ts_language_symbol_for_name(IntPtr language,\n                                                           [MarshalAs(UnmanagedType.LPUTF8Str)] string str, uint length,\n                                                           bool is_named);\n\n  /**\n  * Get the number of distinct field names in the language.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_language_field_count(IntPtr language);\n\n  /**\n  * Get the field name string for the given numerical id.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern IntPtr ts_language_field_name_for_id(IntPtr language, ushort fieldId);\n\n  /**\n  * Get the numerical id for the given field name string.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern ushort ts_language_field_id_for_name(IntPtr language,\n                                                             [MarshalAs(UnmanagedType.LPUTF8Str)] string str,\n                                                             uint length);\n\n  /**\n  * Check whether the given node type id belongs to named nodes, anonymous nodes,\n  * or a hidden nodes.\n  *\n  * See also `ts_node_is_named`. Hidden nodes are never returned from the API.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern TSSymbolType ts_language_symbol_type(IntPtr language, ushort symbol);\n\n  /**\n  * Get the ABI version number for this language. This version number is used\n  * to ensure that languages were generated by a compatible version of\n  * Tree-sitter.\n  *\n  * See also `ts_parser_set_language`.\n  */\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"tree-sitter.dll\", CallingConvention = CallingConvention.Cdecl)]\n  private static extern uint ts_language_version(IntPtr language);\n\n#endregion\n}"
  },
  {
    "path": "src/ProfileExplorerCore/TextLocation.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core;\n\npublic struct TextLocation : IComparable<TextLocation> {\n  public int Offset {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public int Line {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public int Column {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public TextLocation(int offset, int line, int column) {\n    Offset = offset;\n    Line = line;\n    Column = column;\n  }\n\n  public override string ToString() {\n    return $\"offset: {Offset}, line: {Line}\";\n  }\n\n  public override bool Equals(object obj) {\n    return obj is TextLocation location &&\n           Offset == location.Offset &&\n           Line == location.Line &&\n           Column == location.Column;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Offset, Line);\n  }\n\n  public int CompareTo(TextLocation other) {\n    return Offset.CompareTo(other.Offset);\n  }\n\n  public static bool operator ==(TextLocation a, TextLocation b) {\n    return a.Equals(b);\n  }\n\n  public static bool operator !=(TextLocation a, TextLocation b) {\n    return !a.Equals(b);\n  }\n\n  public static bool operator <(TextLocation left, TextLocation right) {\n    return left.CompareTo(right) < 0;\n  }\n\n  public static bool operator >(TextLocation left, TextLocation right) {\n    return left.CompareTo(right) > 0;\n  }\n\n  public static bool operator <=(TextLocation left, TextLocation right) {\n    return left.CompareTo(right) <= 0;\n  }\n\n  public static bool operator >=(TextLocation left, TextLocation right) {\n    return left.CompareTo(right) >= 0;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/BindableObject.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Utilities;\n\n// Shorter way to have property notifications for data-binding.\n// Based on code from https://www.danrigby.com/2012/04/01/inotifypropertychanged-the-net-4-5-way-revisited/\npublic class BindableObject : INotifyPropertyChanged {\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void NotifyPropertyChanged(string propertyName) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetAndNotify<T>(ref T storage, T value,\n                                 [CallerMemberName] string propertyName = null) {\n    if (Equals(storage, value)) {\n      return false;\n    }\n\n    storage = value;\n    NotifyPropertyChanged(propertyName);\n    return true;\n  }\n\n  protected void Notify(string propertyName) {\n    NotifyPropertyChanged(propertyName);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/CancelableTask.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic static class WaitHandleExtensions {\n  public static Task AsTask(this WaitHandle handle) {\n    return AsTask(handle, Timeout.InfiniteTimeSpan);\n  }\n\n  public static Task AsTask(this WaitHandle handle, TimeSpan timeout) {\n    var taskSource = new TaskCompletionSource<object>();\n    var registration = ThreadPool.RegisterWaitForSingleObject(handle, (state, timedOut) => {\n      var localTaskSource = (TaskCompletionSource<object>)state;\n      if (timedOut)\n        localTaskSource.TrySetCanceled();\n      else\n        localTaskSource.TrySetResult(null);\n    }, taskSource, timeout, true);\n\n    taskSource.Task.ContinueWith((_, state) => ((RegisteredWaitHandle)state).Unregister(null), registration,\n                                 TaskScheduler.Default);\n    return taskSource.Task;\n  }\n}\n\npublic class CancelableTask : IDisposable {\n  private CancellationToken cancelToken_;\n  private ManualResetEvent taskCompletedEvent_;\n  private CancellationTokenSource tokenSource_;\n  private bool disposed_;\n  private bool completeOnCancel_;\n\n  public CancelableTask(bool completeOnCancel = true) {\n    taskCompletedEvent_ = new ManualResetEvent(false);\n    tokenSource_ = new CancellationTokenSource();\n    cancelToken_ = tokenSource_.Token;\n    completeOnCancel_ = completeOnCancel;\n\n    //Debug.WriteLine($\"+ Create task {ObjectTracker.Track(this)}\");\n    //Debug.WriteLine($\"{Environment.StackTrace}\\n-------------------------------------------\\n\");\n  }\n\n  public CancellationToken Token => cancelToken_;\n  public bool IsCanceled => cancelToken_.IsCancellationRequested;\n  public bool IsCompleted => !IsCanceled && taskCompletedEvent_.WaitOne(0);\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  ~CancelableTask() {\n    Dispose(false);\n  }\n\n  public void WaitToComplete() {\n    //Debug.WriteLine($\"+ Wait to complete task {ObjectTracker.Track(this)}\");\n    //Debug.WriteLine($\"{Environment.StackTrace}\\n-------------------------------------------\\n\");\n    if (disposed_) {\n      return;\n    }\n\n    taskCompletedEvent_.WaitOne();\n  }\n\n  public async Task<bool> WaitToCompleteAsync() {\n    //Debug.WriteLine($\"+ Wait to complete task {ObjectTracker.Track(this)}\");\n    //Debug.WriteLine($\"{Environment.StackTrace}\\n-------------------------------------------\\n\");\n    return await WaitToCompleteAsync(TimeSpan.FromMilliseconds(int.MaxValue - 1));\n  }\n\n  public bool WaitToComplete(TimeSpan timeout) {\n    if (disposed_) {\n      return false;\n    }\n\n    return taskCompletedEvent_.WaitOne(timeout);\n  }\n\n  private async Task<bool> WaitToCompleteAsync(TimeSpan timeout) {\n    //Debug.WriteLine($\"+ Wait to complete task {ObjectTracker.Track(this)}\");\n    //Debug.WriteLine($\"{Environment.StackTrace}\\n-------------------------------------------\\n\");\n    if (disposed_) {\n      return false;\n    }\n\n    try {\n      await taskCompletedEvent_.AsTask(timeout);\n      return true;\n    }\n    catch (TaskCanceledException ex) {\n      // Triggered when timing out.\n      return false;\n    }\n  }\n\n  public void Complete() {\n    //Debug.WriteLine($\"+ Complete task {ObjectTracker.Track(this)}\");\n    //Debug.WriteLine($\"{Environment.StackTrace}\\n-------------------------------------------\\n\");\n    if (disposed_) {\n      return;\n    }\n\n    taskCompletedEvent_.Set();\n  }\n\n  public void Cancel() {\n    //Debug.WriteLine($\"+ Cancel task {ObjectTracker.Track(this)}\");\n    //Debug.WriteLine($\"{Environment.StackTrace}\\n-------------------------------------------\\n\");\n    if (disposed_) {\n      return;\n    }\n\n    tokenSource_.Cancel();\n\n    if (completeOnCancel_) {\n      taskCompletedEvent_.Set();\n    }\n  }\n\n  private void Dispose(bool disposing) {\n    if (!disposed_) {\n      taskCompletedEvent_.Set(); // May not be marked as completed yet.\n      tokenSource_.Dispose();\n      taskCompletedEvent_.Dispose();\n      disposed_ = true;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/CancelableTaskInstance.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Threading.Tasks;\n\nnamespace ProfileExplorer.Core.Utilities;\n\n// Manages a unique running instance of a CancelableTask.\npublic class CancelableTaskInstance : IDisposable {\n  public delegate void CancelableTaskDelegate(CancelableTask task);\n  private CancelableTask taskInstance_;\n  private CancelableTaskDelegate registerAction_;\n  private CancelableTaskDelegate unregisterAction_;\n  private object lockObject_ = new();\n  private bool completeOnCancel_;\n\n  public CancelableTaskInstance(bool completeOnCancel = true,\n                                CancelableTaskDelegate registerAction = null,\n                                CancelableTaskDelegate unregisterAction = null) {\n    completeOnCancel_ = completeOnCancel;\n    registerAction_ = registerAction;\n    unregisterAction_ = unregisterAction;\n  }\n\n  public CancelableTask CurrentInstance {\n    get {\n      lock (lockObject_) {\n        if (taskInstance_ == null) {\n          throw new InvalidOperationException(\"No task instance running!\");\n        }\n\n        return taskInstance_;\n      }\n    }\n  }\n\n  public void Dispose() {\n    taskInstance_?.Dispose();\n  }\n\n  public CancelableTask CreateTask() {\n    lock (lockObject_) {\n      if (taskInstance_ != null) {\n        // Cancel running task without blocking.\n        CancelTask();\n      }\n\n      taskInstance_ = new CancelableTask(completeOnCancel_);\n      registerAction_?.Invoke(taskInstance_);\n      return taskInstance_;\n    }\n  }\n\n  public async Task<CancelableTask> CancelCurrentAndCreateTaskAsync() {\n    CancelableTask task = null;\n\n    lock (lockObject_) {\n      task = taskInstance_;\n    }\n\n    if (task != null) {\n      await CancelTaskAndWaitAsync(task);\n    }\n\n    lock (lockObject_) {\n      // Check that nothing else changed the current task\n      // before replacing it.\n      if (taskInstance_ == task) {\n        taskInstance_ = new CancelableTask(completeOnCancel_);\n        registerAction_?.Invoke(taskInstance_);\n      }\n\n      return taskInstance_;\n    }\n  }\n\n  public CancelableTask CancelCurrentAndCreateTask() {\n    CancelableTask task = null;\n\n    lock (lockObject_) {\n      task = taskInstance_;\n    }\n\n    if (task != null) {\n      CancelTask(task);\n    }\n\n    lock (lockObject_) {\n      // Check that nothing else changed the current task\n      // before replacing it.\n      if (taskInstance_ == task) {\n        taskInstance_ = new CancelableTask(completeOnCancel_);\n        registerAction_?.Invoke(taskInstance_);\n      }\n\n      return taskInstance_;\n    }\n  }\n\n  public async Task<CancelableTask> WaitAndCreateTaskAsync() {\n    CancelableTask task = null;\n\n    lock (lockObject_) {\n      task = taskInstance_;\n    }\n\n    if (task != null) {\n      await task.WaitToCompleteAsync();\n    }\n\n    lock (lockObject_) {\n      // Check that nothing else changed the current task\n      // before replacing it.\n      if (taskInstance_ == task) {\n        taskInstance_ = new CancelableTask(completeOnCancel_);\n        registerAction_?.Invoke(taskInstance_);\n      }\n\n      return taskInstance_;\n    }\n  }\n\n  public void CancelTask() {\n    lock (lockObject_) {\n      if (taskInstance_ == null) {\n        return;\n      }\n\n      var canceledTask = taskInstance_;\n      taskInstance_ = null;\n\n      // Cancel the task and wait for it to complete without blocking.\n      canceledTask.Cancel();\n      unregisterAction_?.Invoke(canceledTask);\n    }\n  }\n\n  public void CancelTaskAndWait() {\n    lock (lockObject_) {\n      if (taskInstance_ == null) {\n        return;\n      }\n\n      var canceledTask = taskInstance_;\n      taskInstance_ = null;\n      CancelTask(canceledTask);\n    }\n  }\n\n  private void CancelTask(CancelableTask canceledTask) {\n    // Cancel the task and wait for it to complete.\n    canceledTask.Cancel();\n    canceledTask.WaitToComplete();\n    unregisterAction_?.Invoke(canceledTask);\n  }\n\n  public async Task CancelTaskAndWaitAsync() {\n    CancelableTask task = null;\n\n    lock (lockObject_) {\n      task = taskInstance_;\n      taskInstance_ = null;\n    }\n\n    if (task != null) {\n      await CancelTaskAndWaitAsync(task);\n    }\n  }\n\n  public void CompleteTask(CancelableTask task) {\n    lock (lockObject_) {\n      if (task != taskInstance_) {\n        return; // A canceled task, ignore it.\n      }\n\n      if (taskInstance_ != null) {\n        unregisterAction_?.Invoke(taskInstance_);\n        taskInstance_.Complete();\n        taskInstance_.Dispose();\n        taskInstance_ = null;\n      }\n    }\n  }\n\n  public void CompleteTask() {\n    CancelableTask task = null;\n\n    lock (lockObject_) {\n      task = taskInstance_;\n    }\n\n    if (task != null) {\n      CompleteTask(task);\n    }\n  }\n\n  public void WaitForTask() {\n    CancelableTask task = null;\n\n    lock (lockObject_) {\n      task = taskInstance_;\n    }\n\n    if (task != null) {\n      task.WaitToComplete();\n    }\n  }\n\n  public async Task WaitForTaskAsync() {\n    CancelableTask task = null;\n\n    lock (lockObject_) {\n      task = taskInstance_;\n    }\n\n    if (task != null) {\n      await task.WaitToCompleteAsync();\n    }\n  }\n\n  private async Task CancelTaskAndWaitAsync(CancelableTask canceledTask) {\n    // Cancel the task and wait for it to complete.\n    canceledTask.Cancel();\n    unregisterAction_?.Invoke(canceledTask);\n    await canceledTask.WaitToCompleteAsync();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/CollectionExtensionMethods.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic static class CollectionExtensionMethods {\n  public static List<T> CloneList<T>(this List<T> list) {\n    if (list == null) {\n      return null;\n    }\n\n    return list.ConvertAll(item => item);\n  }\n\n  public static bool AreEqual<T>(this List<T> list, List<T> other) {\n    if (ReferenceEquals(list, other)) {\n      return true;\n    }\n    else if (list == null || other == null ||\n             list.Count != other.Count) {\n      return false;\n    }\n\n    return list.SequenceEqual(other);\n  }\n\n  public static bool AreEqual(this IList list, IList other) {\n    if (ReferenceEquals(list, other)) {\n      return true;\n    }\n    else if (list == null || other == null ||\n             list.Count != other.Count) {\n      return false;\n    }\n\n    for (int i = 0; i < list.Count; i++) {\n      if (!Equals(list[i], other[i])) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  public static Dictionary<TKey, TValue> CloneDictionary<TKey, TValue>(\n    this Dictionary<TKey, TValue> dict) {\n    if (dict == null) {\n      return null;\n    }\n\n    var newDict = new Dictionary<TKey, TValue>(dict.Count);\n\n    foreach (var item in dict) {\n      newDict.Add(item.Key, item.Value);\n    }\n\n    return newDict;\n  }\n\n  public static HashSet<T> CloneHashSet<T>(this HashSet<T> hashSet) {\n    if (hashSet == null) {\n      return null;\n    }\n\n    var newHashSet = new HashSet<T>(hashSet.Count);\n\n    foreach (var item in hashSet) {\n      newHashSet.Add(item);\n    }\n\n    return newHashSet;\n  }\n\n  public static HashSet<T> ToHashSet<T>(this List<T> list) {\n    var hashSet = new HashSet<T>(list.Count);\n    list.ForEach(item => hashSet.Add(item));\n    return hashSet;\n  }\n\n  public static HashSet<TOut> ToHashSet<TIn, TOut>(this List<TIn> list, Func<TIn, TOut> action)\n    where TIn : class where TOut : class {\n    var hashSet = new HashSet<TOut>(list.Count);\n    list.ForEach(item => hashSet.Add(action(item)));\n    return hashSet;\n  }\n\n  public static List<T> ToList<T>(this HashSet<T> hashSet) {\n    var list = new List<T>(hashSet.Count);\n\n    foreach (var item in hashSet) {\n      list.Add(item);\n    }\n\n    return list;\n  }\n\n  public static List<TOut> ToList<TIn, TOut>(this HashSet<TIn> hashSet, Func<TIn, TOut> action) {\n    var list = new List<TOut>(hashSet.Count);\n\n    foreach (var item in hashSet) {\n      list.Add(action(item));\n    }\n\n    return list;\n  }\n\n  public static List<(K, V)> ToList<K, V>(this IDictionary<K, V> dict) {\n    var list = new List<(K, V)>(dict.Count);\n\n    foreach (var item in dict) {\n      list.Add((item.Key, item.Value));\n    }\n\n    return list;\n  }\n\n  public static List<K> ToKeyList<K, V>(this IDictionary<K, V> dict) {\n    var list = new List<K>(dict.Count);\n\n    foreach (var item in dict) {\n      list.Add(item.Key);\n    }\n\n    return list;\n  }\n\n  public static List<V> ToValueList<K, V>(this IDictionary<K, V> dict) {\n    var list = new List<V>(dict.Count);\n\n    foreach (var item in dict) {\n      list.Add(item.Value);\n    }\n\n    return list;\n  }\n\n  public static List<Tuple<K2, V>> ToList<K1, K2, V>(this Dictionary<K1, V> dict)\n    where K1 : IRElement where K2 : IRElementReference {\n    var list = new List<Tuple<K2, V>>(dict.Count);\n\n    foreach (var item in dict) {\n      list.Add(new Tuple<K2, V>((K2)item.Key, item.Value));\n    }\n\n    return list;\n  }\n\n  public static Dictionary<K, V> ToDictionary<K, V>(this List<Tuple<K, V>> list) {\n    var dict = new Dictionary<K, V>(list.Count);\n\n    foreach (var item in list) {\n      dict.Add(item.Item1, item.Item2);\n    }\n\n    return dict;\n  }\n\n  public static Dictionary<K2, V> ToDictionary<K1, K2, V>(this List<Tuple<K1, V>> list)\n    where K1 : IRElementReference where K2 : IRElement {\n    var dict = new Dictionary<K2, V>(list.Count);\n\n    foreach (var item in list) {\n      if (item.Item1 != null) {\n        dict.Add((K2)item.Item1, item.Item2);\n      }\n    }\n\n    return dict;\n  }\n\n  public static bool AreEqual<TKey, TValue>(this Dictionary<TKey, TValue> first,\n                                            Dictionary<TKey, TValue> second) {\n    if (first == second)\n      return true;\n    if (first == null || second == null)\n      return false;\n    if (first.Count != second.Count)\n      return false;\n\n    var valueComparer = EqualityComparer<TValue>.Default;\n\n    foreach (var kvp in first) {\n      if (!second.TryGetValue(kvp.Key, out var value2))\n        return false;\n      if (!valueComparer.Equals(kvp.Value, value2))\n        return false;\n    }\n\n    return true;\n  }\n\n  public static bool AreEqual(this IDictionary first, IDictionary second) {\n    if (first == second)\n      return true;\n    if (first == null || second == null)\n      return false;\n    if (first.Count != second.Count)\n      return false;\n\n    foreach (DictionaryEntry kvp in first) {\n      if (!second.Contains(kvp.Key))\n        return false;\n      if (!Equals(kvp.Value, second[kvp.Key]))\n        return false;\n    }\n\n    return true;\n  }\n\n  public static bool AreEqual<T>(this HashSet<T> first, HashSet<T> second) {\n    if (first == second)\n      return true;\n    if (first == null || second == null)\n      return false;\n    if (first.Count != second.Count)\n      return false;\n\n    var valueComparer = EqualityComparer<T>.Default;\n\n    foreach (var value in first) {\n      if (!second.TryGetValue(value, out var value2))\n        return false;\n      if (!valueComparer.Equals(value, value2))\n        return false;\n    }\n\n    return true;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static void AccumulateValue<K>(this Dictionary<K, int> dict, K key, int value) {\n    ref int currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n    currentValue += value;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static void AccumulateValue<K>(this Dictionary<K, long> dict, K key, long value) {\n    ref long currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n    currentValue += value;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static void AccumulateValue<K>(this Dictionary<K, TimeSpan> dict, K key, TimeSpan value) {\n    ref var currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    // The TimeSpan + operator does an overflow check that is not relevant\n    // (and an exception undesirable), avoid it for some speedup.\n    long sum = currentValue.Ticks + value.Ticks;\n    var newValue = TimeSpan.FromTicks(sum);\n    currentValue = newValue;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static void\n    AccumulateValue<K>(this Dictionary<K, (TimeSpan, TimeSpan)> dict, K key,\n                       TimeSpan value1, TimeSpan value2) {\n    ref var currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    // The TimeSpan + operator does an overflow check that is not relevant\n    // (and an exception undesirable), avoid it for some speedup.\n    long sum1 = currentValue.Item1.Ticks + value1.Ticks;\n    long sum2 = currentValue.Item2.Ticks + value2.Ticks;\n    var newValue1 = TimeSpan.FromTicks(sum1);\n    var newValue2 = TimeSpan.FromTicks(sum2);\n    currentValue.Item1 = newValue1;\n    currentValue.Item2 = newValue2;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static int CollectMaxValue<K>(this Dictionary<K, int> dict, K key, int value) {\n    ref int currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    if (exists) {\n      if (value > currentValue) {\n        currentValue = value;\n        return value;\n      }\n\n      return currentValue;\n    }\n\n    currentValue = value;\n    return value;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static double CollectMaxValue<K>(this Dictionary<K, double> dict, K key, double value) {\n    ref double currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    if (exists) {\n      if (value > currentValue) {\n        currentValue = value;\n        return value;\n      }\n\n      return currentValue;\n    }\n\n    currentValue = value;\n    return value;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static TimeSpan CollectMaxValue<K>(this Dictionary<K, TimeSpan> dict, K key, TimeSpan value) {\n    ref var currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    if (exists) {\n      if (value > currentValue) {\n        currentValue = value;\n        return value;\n      }\n\n      return currentValue;\n    }\n\n    currentValue = value;\n    return value;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/CompressionUtils.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Security.Cryptography;\nusing System.Text;\nusing System.Text.Json;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic static class CompressionUtils {\n  public static byte[] Compress(byte[] data, CompressionLevel level = CompressionLevel.Fastest) {\n    using var uncompressedStream = new MemoryStream(data);\n    using var compressedStream = new MemoryStream();\n    using var compressorStream = new BrotliStream(compressedStream, level, true);\n    compressorStream.Write(data, 0, data.Length);\n    compressorStream.Close();\n    return compressedStream.ToArray();\n  }\n\n  public static byte[] CompressString(string text, CompressionLevel level = CompressionLevel.Fastest) {\n    return Compress(Encoding.UTF8.GetBytes(text), level);\n  }\n\n  public static byte[] Decompress(byte[] data) {\n    var compressedStream = new MemoryStream(data);\n    using var decompressorStream = new BrotliStream(compressedStream, CompressionMode.Decompress);\n\n    // The compression ratio is about 5x, preallocate this much.\n    using var decompressedStream = new MemoryStream(data.Length * 5);\n    decompressorStream.CopyTo(decompressedStream);\n    byte[] decompressedBytes = decompressedStream.ToArray();\n    return decompressedBytes;\n  }\n\n  public static string DecompressString(byte[] data) {\n    return Encoding.UTF8.GetString(Decompress(data));\n  }\n\n  public static byte[] CreateSHA256(byte[] data) {\n    using var sha = SHA256.Create();\n    return sha.ComputeHash(data);\n  }\n\n  public static byte[] CreateSHA256(string text) {\n    return CreateSHA256(Encoding.UTF8.GetBytes(text));\n  }\n\n  public static byte[] CreateSHA256(List<byte[]> byteList) {\n    int outputSize = 0;\n\n    foreach (byte[] item in byteList) {\n      outputSize += item.Length + 1;\n    }\n\n    byte[] output = new byte[outputSize];\n    int position = 0;\n\n    foreach (byte[] item in byteList) {\n      Array.Copy(item, 0, output, position, item.Length);\n      position += item.Length;\n      output[position] = 0xFF; // Use a separator so that \"ab cde\" and \"abc de\" are distinct.\n      position++;\n    }\n\n    using var sha = SHA256.Create();\n    return sha.ComputeHash(output);\n  }\n}\n\npublic class CompressedString : IEquatable<CompressedString> {\n  private byte[] data_;\n  private int hash_;\n\n  public CompressedString(ReadOnlySpan<char> span, CompressionLevel level = CompressionLevel.Fastest) {\n    data_ = CompressionUtils.Compress(Encoding.UTF8.GetBytes(span.ToArray()), level);\n    hash_ = 0;\n  }\n\n  public CompressedString(string value, CompressionLevel level = CompressionLevel.Fastest) {\n    data_ = CompressionUtils.Compress(Encoding.UTF8.GetBytes(value), level);\n    hash_ = data_.GetHashCode();\n  }\n\n  public int Size => data_.Length;\n  public byte[] UniqueId => CompressionUtils.CreateSHA256(data_);\n\n  public bool Equals(CompressedString other) {\n    return Equals((object)other);\n  }\n\n  public static bool operator ==(CompressedString left, CompressedString right) {\n    return left.Equals(right);\n  }\n\n  public static bool operator !=(CompressedString left, CompressedString right) {\n    return !(left == right);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is CompressedString other &&\n           GetHashCode() == other.GetHashCode() &&\n           data_.Equals(other.data_);\n  }\n\n  public override int GetHashCode() {\n    if (hash_ == 0) {\n      hash_ = data_.GetHashCode();\n    }\n\n    return hash_;\n  }\n\n  public override string ToString() {\n    return CompressionUtils.DecompressString(data_);\n  }\n}\n\npublic class CompressedObject<T> where T : class {\n  private byte[] data_;\n  private T value_;\n  private object lockObject_;\n\n  public CompressedObject(T value) {\n    value_ = value;\n    lockObject_ = new object();\n  }\n\n  public void Compress() {\n    lock (lockObject_) {\n      if (value_ == null) {\n        return; // Compressed already.\n      }\n\n      using var stream = new MemoryStream();\n      JsonSerializer.Serialize(stream, value_);\n      byte[] serializedData = stream.ToArray();\n      data_ = CompressionUtils.Compress(serializedData);\n      value_ = null;\n    }\n  }\n\n  public T GetValue() {\n    lock (lockObject_) {\n      if (value_ != null) {\n        return value_;\n      }\n\n      // Decompress on-demand.\n      byte[] serializedData = CompressionUtils.Decompress(data_);\n      using var stream = new MemoryStream(serializedData);\n      value_ = JsonSerializer.Deserialize<T>(stream);\n      data_ = null;\n      return value_;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/CoreSettingsProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.Core.Utilities;\n\n/// <summary>\n/// Default implementation of ISettingsProvider that provides hardcoded default settings.\n/// </summary>\npublic class DefaultSettingsProvider : ISettingsProvider\n{\n    private static readonly SymbolFileSourceSettings _symbolSettings = new SymbolFileSourceSettings();\n    private static readonly ProfileDataProviderOptions _profileOptions = new ProfileDataProviderOptions();\n    private static readonly SectionSettings _sectionSettings = new SectionSettings();\n    private static readonly DiffSettings _diffSettings = new DiffSettings();\n    private static readonly GeneralSettings _generalSettings = new GeneralSettings();\n\n    public SymbolFileSourceSettings SymbolSettings => _symbolSettings.Clone();\n    public ProfileDataProviderOptions ProfileOptions => _profileOptions;\n    public SectionSettings SectionSettings => _sectionSettings;\n    public DiffSettings DiffSettings => _diffSettings.Clone();\n    public GeneralSettings GeneralSettings => _generalSettings;\n}\n\npublic static class CoreSettingsProvider\n{\n    private static ISettingsProvider _provider = new DefaultSettingsProvider();\n\n    /// <summary>\n    /// Sets the settings provider to use. This allows the UI project to override default settings.\n    /// </summary>\n    /// <param name=\"provider\">The settings provider to use, or null to reset to default.</param>\n    public static void SetProvider(ISettingsProvider provider)\n    {\n        _provider = provider ?? new DefaultSettingsProvider();\n    }\n\n    public static SymbolFileSourceSettings SymbolSettings => _provider.SymbolSettings;\n    public static ProfileDataProviderOptions ProfileOptions => _provider.ProfileOptions;\n    public static SectionSettings SectionSettings => _provider.SectionSettings;\n    public static DiffSettings DiffSettings => _provider.DiffSettings;\n    public static GeneralSettings GeneralSettings => _provider.GeneralSettings;\n}\n"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/DebugObjectId.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Utilities;\n\n// Used to create an unique ID for an object, to be used\n// for tracking in log files.\npublic static class ObjectTracker {\n  private static ConditionalWeakTable<object, DebugObjectId> DebugTaskId = new();\n\n  public static DebugObjectId Track(object value) {\n    if (value == null) {\n      return new DebugObjectId();\n    }\n\n    return DebugTaskId.GetValue(value, obj => new DebugObjectId(obj));\n  }\n\n  public class DebugObjectId {\n    private static Dictionary<string, int> PrefixNumbers = new();\n    private static object LockObject = new();\n\n    public DebugObjectId() {\n      Id = \"<null>\";\n    }\n\n    public DebugObjectId(object value) {\n      string typeName = value.GetType().Name.ToLower();\n      string prefix = typeName.Substring(0, Math.Min(12, typeName.Length));\n      int number = 1;\n\n      lock (LockObject) {\n        if (PrefixNumbers.TryGetValue(prefix, out number)) {\n          ++number;\n          PrefixNumbers[prefix] = number;\n        }\n        else {\n          PrefixNumbers[prefix] = number;\n        }\n      }\n\n      Id = $\"{prefix}-{number}\";\n    }\n\n    public string Id { get; set; }\n\n    public override string ToString() {\n      return Id;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/DiagnosticLogger.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading;\nusing Microsoft.Extensions.Logging;\n\nnamespace ProfileExplorer.Core.Utilities;\n\n/// <summary>\n/// Diagnostic logger that writes to a file that can be easily retrieved by users.\n/// This is specifically designed for debugging issues that don't reproduce locally\n/// and need to be sent back by users.\n/// \n/// Logging is controlled by the PROFILE_EXPLORER_DEBUG environment variable.\n/// Set to \"1\", \"true\", \"on\", or \"enabled\" to enable diagnostic logging.\n/// Defaults to disabled for performance and privacy.\n/// </summary>\npublic static class DiagnosticLogger {\n  private static readonly object lockObject_ = new();\n  private static ILogger logger_;\n  private static string logFilePath_;\n  private static readonly ConcurrentQueue<string> recentMessages_ = new();\n  private static readonly int MaxRecentMessages = 1000;\n  private static bool initialized_ = false;\n  private static readonly Lazy<bool> isEnabled_ = new Lazy<bool>(CheckIfEnabled);\n\n  /// <summary>\n  /// Check if diagnostic logging is enabled via environment variable\n  /// </summary>\n  private static bool CheckIfEnabled() {\n    string envValue = Environment.GetEnvironmentVariable(\"PROFILE_EXPLORER_DEBUG\");\n    if (string.IsNullOrEmpty(envValue)) {\n      return false;\n    }\n\n    envValue = envValue.Trim().ToLowerInvariant();\n    return envValue == \"1\" || envValue == \"true\" || envValue == \"on\" || envValue == \"enabled\";\n  }\n\n  /// <summary>\n  /// Gets whether diagnostic logging is enabled\n  /// </summary>\n  public static bool IsEnabled => isEnabled_.Value;\n\n  /// <summary>\n  /// Ensure the diagnostic logger is initialized\n  /// </summary>\n  private static void EnsureInitialized() {\n    if (!IsEnabled) {\n      return; // Don't initialize if logging is disabled\n    }\n\n    if (!initialized_) {\n      lock (lockObject_) {\n        if (!initialized_ && IsEnabled) {\n          Initialize();\n          initialized_ = true;\n        }\n      }\n    }\n  }\n\n  /// <summary>\n  /// Initialize the diagnostic logger with a file in the user's temp directory\n  /// </summary>\n  private static void Initialize() {\n    try {\n      // Create log file in user's temp directory with timestamp\n      string tempDir = Path.GetTempPath();\n      string timestamp = DateTime.Now.ToString(\"yyyyMMdd_HHmmss\");\n      string processId = Process.GetCurrentProcess().Id.ToString();\n      logFilePath_ = Path.Combine(tempDir, $\"ProfileExplorer_Diagnostic_{timestamp}_{processId}.log\");\n\n      // Create a simple file logger\n      var loggerFactory = LoggerFactory.Create(builder => {\n        builder.AddProvider(new FileLoggerProvider(logFilePath_));\n        builder.SetMinimumLevel(LogLevel.Debug);\n      });\n\n      logger_ = loggerFactory.CreateLogger(\"Diagnostic\");\n      \n      // Log startup info directly to avoid circular calls during initialization\n      LogMessageDirect(LogLevel.Information, \"=== Profile Explorer Diagnostic Log Started ===\");\n      LogMessageDirect(LogLevel.Information, $\"Diagnostic logging enabled via PROFILE_EXPLORER_DEBUG environment variable\");\n      LogMessageDirect(LogLevel.Information, $\"Process ID: {processId}\");\n      LogMessageDirect(LogLevel.Information, $\"Working Directory: {Environment.CurrentDirectory}\");\n      LogMessageDirect(LogLevel.Information, $\"Machine Name: {Environment.MachineName}\");\n      LogMessageDirect(LogLevel.Information, $\"User: {Environment.UserName}\");\n      LogMessageDirect(LogLevel.Information, $\"OS Version: {Environment.OSVersion}\");\n      LogMessageDirect(LogLevel.Information, $\"CLR Version: {Environment.Version}\");\n      LogMessageDirect(LogLevel.Information, $\"Log File: {logFilePath_}\");\n      LogMessageDirect(LogLevel.Information, \"=================================================\");\n    }\n    catch (Exception ex) {\n      // Fallback to trace if file logging fails\n      Trace.TraceError($\"Failed to initialize DiagnosticLogger: {ex.Message}\");\n    }\n  }\n\n  /// <summary>\n  /// Get the path to the current diagnostic log file\n  /// Returns null if logging is disabled\n  /// </summary>\n  public static string LogFilePath {\n    get {\n      if (!IsEnabled) {\n        return null;\n      }\n      EnsureInitialized();\n      return logFilePath_;\n    }\n  }\n\n  /// <summary>\n  /// Log debug information\n  /// </summary>\n  public static void LogDebug(string message) {\n    if (!IsEnabled) return;\n    LogMessage(LogLevel.Debug, message);\n  }\n\n  /// <summary>\n  /// Log informational message\n  /// </summary>\n  public static void LogInfo(string message) {\n    if (!IsEnabled) return;\n    LogMessage(LogLevel.Information, message);\n  }\n\n  /// <summary>\n  /// Log warning message\n  /// </summary>\n  public static void LogWarning(string message) {\n    if (!IsEnabled) return;\n    LogMessage(LogLevel.Warning, message);\n  }\n\n  /// <summary>\n  /// Log error message\n  /// </summary>\n  public static void LogError(string message) {\n    if (!IsEnabled) return;\n    LogMessage(LogLevel.Error, message);\n  }\n\n  /// <summary>\n  /// Log error with exception\n  /// </summary>\n  public static void LogError(string message, Exception ex) {\n    if (!IsEnabled) return;\n    LogMessage(LogLevel.Error, $\"{message}\\nException: {ex}\");\n  }\n\n  private static void LogMessage(LogLevel level, string message) {\n    try {\n      EnsureInitialized();\n      LogMessageDirect(level, message);\n    }\n    catch {\n      // Silently ignore logging errors to avoid cascading failures\n    }\n  }\n\n  /// <summary>\n  /// Log message directly without initialization check - used during initialization only\n  /// </summary>\n  private static void LogMessageDirect(LogLevel level, string message) {\n    try {\n      lock (lockObject_) {\n        // Add to recent messages queue\n        string timestampedMessage = $\"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} [{level}] {message}\";\n        recentMessages_.Enqueue(timestampedMessage);\n\n        // Maintain queue size\n        while (recentMessages_.Count > MaxRecentMessages) {\n          recentMessages_.TryDequeue(out _);\n        }\n\n        // Log to file if available\n        logger_?.Log(level, message);\n\n        // Also log to trace for debugging\n        switch (level) {\n          case LogLevel.Error:\n            Trace.TraceError(message);\n            break;\n          case LogLevel.Warning:\n            Trace.TraceWarning(message);\n            break;\n          default:\n            Trace.TraceInformation(message);\n            break;\n        }\n      }\n    }\n    catch {\n      // Silently ignore logging errors to avoid cascading failures\n    }\n  }\n\n  /// <summary>\n  /// Get recent log messages (useful for displaying in UI)\n  /// Returns empty array if logging is disabled\n  /// </summary>\n  public static string[] GetRecentMessages() {\n    if (!IsEnabled) {\n      return new string[0];\n    }\n    EnsureInitialized();\n    return recentMessages_.ToArray();\n  }\n\n  /// <summary>\n  /// Open the log file in the default text editor\n  /// </summary>\n  public static void OpenLogFile() {\n    if (!IsEnabled) {\n      return;\n    }\n\n    try {\n      EnsureInitialized();\n      if (File.Exists(logFilePath_)) {\n        Process.Start(new ProcessStartInfo(logFilePath_) { UseShellExecute = true });\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to open log file: {ex.Message}\");\n    }\n  }\n\n  /// <summary>\n  /// Copy log file path to clipboard\n  /// </summary>\n  public static void CopyLogFilePathToClipboard() {\n    if (!IsEnabled) {\n      return;\n    }\n\n    try {\n      EnsureInitialized();\n      // Just trace the path since we don't have clipboard access in core library\n      Trace.TraceInformation($\"Diagnostic log path: {logFilePath_}\");\n    }\n    catch {\n      // Ignore errors\n    }\n  }\n\n  /// <summary>\n  /// Show message to user about where to find the diagnostic log\n  /// This method is UI-framework agnostic and returns the log file path\n  /// </summary>\n  public static void ShowLogFileLocation() {\n    if (!IsEnabled) {\n      return;\n    }\n\n    try {\n      EnsureInitialized();\n      // Open the file location in Windows Explorer\n      if (File.Exists(logFilePath_)) {\n        System.Diagnostics.Process.Start(\"explorer.exe\", $\"/select,\\\"{logFilePath_}\\\"\");\n      }\n      else {\n        // If file doesn't exist, open the directory\n        string directory = Path.GetDirectoryName(logFilePath_) ?? Path.GetTempPath();\n        System.Diagnostics.Process.Start(\"explorer.exe\", directory);\n      }\n      \n      LogInfo(\"User accessed diagnostic log file location\");\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to show log file location: {ex.Message}\");\n    }\n  }\n\n  /// <summary>\n  /// Get diagnostic log file information\n  /// </summary>\n  public static string GetLogFileInfo() {\n    if (!IsEnabled) {\n      return \"Diagnostic logging is disabled. Set PROFILE_EXPLORER_DEBUG environment variable to '1', 'true', 'on', or 'enabled' to enable logging.\";\n    }\n\n    EnsureInitialized();\n    if (File.Exists(logFilePath_)) {\n      var info = new FileInfo(logFilePath_);\n      return $\"Diagnostic log file location:\\n{logFilePath_}\\n\\nFile size: {info.Length:N0} bytes\\nLast modified: {info.LastWriteTime}\";\n    }\n    else {\n      return $\"Diagnostic log file not found at:\\n{logFilePath_}\";\n    }\n  }\n\n  /// <summary>\n  /// Simple file logger provider for writing to a single file\n  /// </summary>\n  private class FileLoggerProvider : ILoggerProvider {\n    private readonly string filePath_;\n    private readonly object writeLock_ = new();\n\n    public FileLoggerProvider(string filePath) {\n      filePath_ = filePath;\n    }\n\n    public ILogger CreateLogger(string categoryName) {\n      return new FileLogger(filePath_, categoryName, writeLock_);\n    }\n\n    public void Dispose() {\n    }\n\n    private class FileLogger : ILogger {\n      private readonly string filePath_;\n      private readonly string categoryName_;\n      private readonly object writeLock_;\n\n      public FileLogger(string filePath, string categoryName, object writeLock) {\n        filePath_ = filePath;\n        categoryName_ = categoryName;\n        writeLock_ = writeLock;\n      }\n\n      public IDisposable BeginScope<TState>(TState state) => null;\n      public bool IsEnabled(LogLevel logLevel) => true;\n\n      public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, \n                              Func<TState, Exception, string> formatter) {\n        try {\n          string message = formatter(state, exception);\n          string logLine = $\"{DateTime.Now:yyyy-MM-dd HH:mm:ss.fff} [{logLevel}] [{categoryName_}] {message}\";\n\n          if (exception != null) {\n            logLine += $\"\\n{exception}\";\n          }\n\n          lock (writeLock_) {\n            File.AppendAllText(filePath_, logLine + Environment.NewLine);\n          }\n        }\n        catch {\n          // Ignore file write errors\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/ExtensionMethods.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic static class ExtensionMethods {\n  private static readonly string[] NewLineStrings = {\"\\r\\n\", \"\\r\", \"\\n\"};\n\n  public static string Indent(this string value, int spaces) {\n    string whitespace = new(' ', spaces);\n    string valueNoCr = value.Replace(\"\\r\\n\", \"\\n\", StringComparison.Ordinal);\n    return valueNoCr.Replace(\"\\n\", $\"{Environment.NewLine}{whitespace}\", StringComparison.Ordinal);\n  }\n\n  public static V GetOrAddValue<K, V>(this Dictionary<K, V> dict, K key) where V : new() {\n    ref var currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    if (!exists) {\n      currentValue = new V();\n    }\n\n    return currentValue;\n  }\n\n  public static V GetOrAddValue<K, V>(this Dictionary<K, V> dict, K key, V defaultValue) where V : new() {\n    ref var currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    if (!exists) {\n      currentValue = defaultValue;\n    }\n\n    return currentValue;\n  }\n\n  public static V GetOrAddValue<K, V>(this Dictionary<K, V> dict, K key, Func<V> newValueFunc) where V : class {\n    ref var currentValue = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, key, out bool exists);\n\n    if (!exists) {\n      currentValue = newValueFunc();\n    }\n\n    return currentValue;\n  }\n\n  public static V GetValueOrNull<K, V>(this Dictionary<K, V> dict, K key) where V : class {\n    if (dict.TryGetValue(key, out var currentValue)) {\n      return currentValue;\n    }\n\n    return null;\n  }\n\n  public static V GetValueOr<K, V>(this Dictionary<K, V> dict, K key, V defaultValue) {\n    if (dict.TryGetValue(key, out var currentValue)) {\n      return currentValue;\n    }\n\n    return defaultValue;\n  }\n\n  public static string[] NewLineSeparators(this string value) {\n    return NewLineStrings;\n  }\n\n  public static string[] SplitLines(this string value) {\n    return value.Split(NewLineStrings, StringSplitOptions.None);\n  }\n\n  public static string[] SplitLinesRemoveEmpty(this string value) {\n    return value.Split(NewLineStrings, StringSplitOptions.RemoveEmptyEntries);\n  }\n\n  public static int CountLines(this string value) {\n    if (string.IsNullOrEmpty(value)) {\n      return 0;\n    }\n    int lines = 0;\n    int len = value.Length;\n    for (int i = 0; i < len; i++) {\n      char c = value[i];\n      if (c == '\\r') {\n        lines++;\n        // Treat CRLF as a single newline.\n        if (i + 1 < len && value[i + 1] == '\\n') {\n          i++;\n        }\n      }\n      else if (c == '\\n') {\n        lines++;\n      }\n    }\n\n    // If the last character wasn't a newline, account for the final line.\n    if (len > 0) {\n      char last = value[len - 1];\n      if (last != '\\n' && last != '\\r') {\n        lines++;\n      }\n    }\n\n    return lines;\n  }\n\n  private static readonly char[] NewLineChars = { '\\r', '\\n' };\n  private static ConcurrentDictionary<PercentageString, string> percentageStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> nanosecondsTimeStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> microsecondTimeStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> millisecondsTimeStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> secondsTimeStringCache_ = new();\n\n  public static string RemoveChars(this string value, params char[] charList) {\n    if (string.IsNullOrEmpty(value)) {\n      return value;\n    }\n\n    var sb = new StringBuilder(value.Length);\n\n    foreach (char c in value) {\n      if (Array.IndexOf(charList, c) == -1) {\n        sb.Append(c);\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public static string RemoveNewLines(this string value) {\n    return value.RemoveChars(NewLineChars);\n  }\n\n  public static string TrimToLength(this string text, int maxLength) {\n    if (text.Length <= maxLength) {\n      return text;\n    }\n\n    return $\"{text.Substring(0, maxLength)}..\";\n  }\n\n  public static List<int> AllIndexesOf(this string text, string value) {\n    if (string.IsNullOrEmpty(value)) {\n      return new List<int>();\n    }\n\n    var offsetList = new List<int>(32);\n    int offset = text.IndexOf(value, StringComparison.InvariantCulture);\n\n    while (offset != -1 && offset < text.Length) {\n      offsetList.Add(offset);\n      offset += value.Length;\n      offset = text.IndexOf(value, offset, StringComparison.InvariantCulture);\n    }\n\n    return offsetList;\n  }\n\n  public static string AsTrimmedPercentageString(this double value, int digits = 2, string suffix = \"%\") {\n    return AsPercentageString(value, digits, true, suffix);\n  }\n\n  public static string AsPercentageString(this double value, int digits = 2,\n                                          bool trim = false, string suffix = \"%\") {\n    var entry = new PercentageString(value, digits, trim, suffix);\n\n    if (percentageStringCache_.TryGetValue(entry, out string percentageString)) {\n      return percentageString;\n    }\n\n    value = Math.Round(value * 100, digits);\n\n    if (value == 0 && trim) {\n      percentageStringCache_.TryAdd(entry, \"\");\n      return \"\";\n    }\n\n    percentageString = digits switch {\n      1 => $\"{value:0.0}{suffix}\",\n      2 => $\"{value:0.00}{suffix}\",\n      _ => string.Format(\"{0:0.\" + new string('0', digits) + \"}\", value) + suffix\n    };\n\n    percentageStringCache_.TryAdd(entry, percentageString);\n    return percentageString;\n  }\n\n  public static string AsNanosecondsString(this TimeSpan value, int digits = 2,\n                                           string suffix = \" ns\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (nanosecondsTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalNanoseconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    nanosecondsTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsMicrosecondString(this TimeSpan value, int digits = 2,\n                                           string suffix = \" µs\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (microsecondTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalMicroseconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    microsecondTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsMillisecondsString(this TimeSpan value, int digits = 2,\n                                            string suffix = \" ms\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (millisecondsTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalMilliseconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    millisecondsTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsSecondsString(this TimeSpan value, int digits = 2,\n                                       string suffix = \" s\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (secondsTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalSeconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    secondsTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsTimeString(this TimeSpan value, int digits = 2) {\n    return AsTimeString(value, value, digits);\n  }\n\n  public static string AsTimeString(this TimeSpan value, TimeSpan totalValue, int digits = 2) {\n    if (value.Ticks == 0) {\n      return \"0\";\n    }\n\n    if (totalValue.TotalMinutes >= 60) {\n      return value.ToString(\"h\\\\:mm\\\\:ss\");\n    }\n\n    if (totalValue.TotalMinutes >= 10) {\n      return value.ToString(\"mm\\\\:ss\");\n    }\n\n    if (totalValue.TotalSeconds >= 60) {\n      return $\"{value.Minutes}:{value.Seconds:D2}\";\n    }\n\n    if (totalValue.TotalSeconds >= 10) {\n      return value.ToString(\"ss\");\n    }\n\n    if (totalValue.TotalSeconds >= 1) {\n      return $\"{value.Seconds}\";\n    }\n\n    double roundedValue = value.TotalMilliseconds.TruncateToDigits(digits);\n    return string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + \" ms\";\n  }\n\n  public static string AsTimeStringWithMilliseconds(this TimeSpan value, int digits = 2) {\n    return AsTimeStringWithMilliseconds(value, value, digits);\n  }\n\n  public static string AsTimeStringWithMilliseconds(this TimeSpan value, TimeSpan totalValue, int digits = 2) {\n    if (value.Ticks == 0) {\n      return \"0\";\n    }\n\n    if (totalValue.TotalMinutes >= 60) {\n      return value.ToString(\"h\\\\:mm\\\\:ss\\\\.fff\");\n    }\n\n    if (totalValue.TotalMinutes >= 10) {\n      return value.ToString(\"mm\\\\:ss\\\\.fff\");\n    }\n\n    if (totalValue.TotalSeconds >= 60) {\n      return $\"{value.Minutes}:{value:ss\\\\.fff}\";\n    }\n\n    if (totalValue.TotalSeconds >= 10) {\n      return value.ToString(\"ss\\\\.fff\");\n    }\n\n    if (totalValue.TotalSeconds >= 1) {\n      return $\"{value.Seconds}{value:\\\\.fff}\";\n    }\n\n    double roundedValue = value.TotalMilliseconds.TruncateToDigits(digits);\n    return string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + \" ms\";\n  }\n\n  public static double TruncateToDigits(this double value, int digits) {\n    double factor = Math.Pow(10, digits);\n    value *= factor;\n    value = Math.Truncate(value);\n    return value / factor;\n  }\n\n  public static string FormatFunctionName(this ProfileCallTreeNode node, FunctionNameFormatter nameFormatter,\n                                          int maxLength = int.MaxValue) {\n    return FormatName(node.FunctionName, nameFormatter, maxLength);\n  }\n\n  public static string FormatModuleName(this ProfileCallTreeNode node, FunctionNameFormatter nameFormatter,\n                                        int maxLength = int.MaxValue) {\n    return FormatName(node.ModuleName, nameFormatter, maxLength);\n  }\n\n  public static string FormatFunctionName(this IRTextFunction func, ISession session, int maxLength = int.MaxValue) {\n    return FormatName(func.Name, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  public static string FormatFunctionName(this IRTextSection section, ISession session, int maxLength = int.MaxValue) {\n    return FormatName(section.ParentFunction.Name, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  public static string FormatFunctionName(this string name, ISession session, int maxLength = int.MaxValue) {\n    return FormatName(name, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  public static string FormatFunctionName(this ProfileCallTreeNode node, ISession session,\n                                          int maxLength = int.MaxValue) {\n    return FormatName(node.FunctionName, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  private static string FormatName(string name, FunctionNameFormatter nameFormatter, int maxLength) {\n    if (string.IsNullOrEmpty(name)) {\n      return name;\n    }\n\n    name = nameFormatter != null ? nameFormatter(name) : name;\n\n    if (name.Length > maxLength) {\n      if (maxLength > 3) {\n        name = $\"{name.Substring(0, maxLength - 3)}...\";\n      }\n      else {\n        name = name.Substring(0, maxLength);\n      }\n    }\n\n    return name;\n  }\n\n  public static int GetStableHashCode(this string str) {\n    unchecked {\n      int hash1 = 5381;\n      int hash2 = hash1;\n\n      for (int i = 0; i < str.Length && str[i] != '\\0'; i += 2) {\n        hash1 = (hash1 << 5) + hash1 ^ str[i];\n        if (i == str.Length - 1 || str[i + 1] == '\\0')\n          break;\n        hash2 = (hash2 << 5) + hash2 ^ str[i + 1];\n      }\n\n      return hash1 + hash2 * 1566083941;\n    }\n  }\n\n  // Cache percentage and time value to string conversion result\n  // to reduce GC pressure when rendering.\n  private record PercentageString(double value, int digits, bool trim, string suffix);\n  private record TimeString(TimeSpan value, int digits, string suffix);\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/JsonUtils.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text;\nusing System.Text.Json;\nusing System.Text.Json.Serialization;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic class StringInterningConverter : JsonConverter<string> {\n  public override string Read(ref Utf8JsonReader reader, Type typeToConvert,\n                              JsonSerializerOptions options) {\n    return string.Intern(reader.GetString());\n  }\n\n  public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options) {\n    writer.WriteStringValue(value);\n  }\n}\n\npublic static class JsonUtils {\n  private static readonly List<JsonConverter> customConverters = new List<JsonConverter>();\n\n  /// <summary>\n  /// Registers a custom JSON converter that will be added to all JsonSerializerOptions.\n  /// </summary>\n  /// <param name=\"converter\">The custom converter to register</param>\n  public static void RegisterConverter(JsonConverter converter) {\n    if (converter != null && !customConverters.Contains(converter)) {\n      customConverters.Add(converter);\n    }\n  }\n\n  /// <summary>\n  /// Unregisters a custom JSON converter.\n  /// </summary>\n  /// <param name=\"converter\">The converter to unregister</param>\n  public static void UnregisterConverter(JsonConverter converter) {\n    customConverters.Remove(converter);\n  }\n\n  /// <summary>\n  /// Clears all registered custom converters.\n  /// </summary>\n  public static void ClearCustomConverters() {\n    customConverters.Clear();\n  }\n\n  public static JsonSerializerOptions GetJsonOptions() {\n    var options = new JsonSerializerOptions {\n      WriteIndented = true,\n      PropertyNameCaseInsensitive = true,\n      IgnoreReadOnlyProperties = true\n    };\n\n    // Add built-in converters\n    options.Converters.Add(new StringInterningConverter());\n    options.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase));\n    \n    // Add any registered custom converters\n    foreach (var converter in customConverters) {\n      options.Converters.Add(converter);\n    }\n    \n    return options;\n  }\n\n  public static bool SerializeToFile<T>(T data, string path) {\n    try {\n      var options = GetJsonOptions();\n      using var stream = File.OpenWrite(path);\n      JsonSerializer.Serialize(stream, data, options);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to save JSON file: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static string Serialize<T>(T data) {\n    try {\n      var options = GetJsonOptions();\n      return JsonSerializer.Serialize(data, options);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to save JSON: {ex.Message}\");\n      return null;\n    }\n  }\n\n  public static byte[] SerializeToBytes<T>(T data) {\n    string text = Serialize(data);\n    return text != null ? Encoding.UTF8.GetBytes(text) : null;\n  }\n\n  public static bool DeserializeFromFile<T>(string path, out T data) where T : class {\n    try {\n      var options = GetJsonOptions();\n      using var stream = File.OpenRead(path);\n      data = JsonSerializer.Deserialize<T>(stream, options);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load JSON file: {ex.Message}\");\n      data = default(T);\n      return false;\n    }\n  }\n\n  public static bool Deserialize<T>(string text, out T data) where T : class {\n    try {\n      var options = GetJsonOptions();\n      data = JsonSerializer.Deserialize<T>(text, options);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load JSON: {ex.Message}\");\n      data = default(T);\n      return false;\n    }\n  }\n\n  public static bool DeserializeFromBytes<T>(byte[] textData, out T data) where T : class {\n    return Deserialize(Encoding.UTF8.GetString(textData), out data);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/NativeMethods.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Runtime.InteropServices;\nusing System.Security;\nusing System.Text;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic static class NativeMethods {\n  // C++ function name demangling\n  [Flags]\n  public enum UnDecorateFlags {\n    UNDNAME_COMPLETE = 0x0000, // Enable full undecoration\n    UNDNAME_NO_LEADING_UNDERSCORES = 0x0001, // Remove leading underscores from MS extended keywords\n    UNDNAME_NO_MS_KEYWORDS = 0x0002, // Disable expansion of MS extended keywords\n    UNDNAME_NO_FUNCTION_RETURNS = 0x0004, // Disable expansion of return type for primary declaration\n    UNDNAME_NO_ALLOCATION_MODEL = 0x0008, // Disable expansion of the declaration model\n    UNDNAME_NO_ALLOCATION_LANGUAGE = 0x0010, // Disable expansion of the declaration language specifier\n    UNDNAME_NO_MS_THISTYPE = 0x0020, // NYI Disable expansion of MS keywords on the 'this' type for primary declaration\n    UNDNAME_NO_CV_THISTYPE = 0x0040, // NYI Disable expansion of CV modifiers on the 'this' type for primary declaration\n    UNDNAME_NO_THISTYPE = 0x0060, // Disable all modifiers on the 'this' type\n    UNDNAME_NO_ACCESS_SPECIFIERS = 0x0080, // Disable expansion of access specifiers for members\n    UNDNAME_NO_THROW_SIGNATURES =\n      0x0100, // Disable expansion of 'throw-signatures' for functions and pointers to functions\n    UNDNAME_NO_MEMBER_TYPE = 0x0200, // Disable expansion of 'static' or 'virtual'ness of members\n    UNDNAME_NO_RETURN_UDT_MODEL = 0x0400, // Disable expansion of MS model for UDT returns\n    UNDNAME_32_BIT_DECODE = 0x0800, // Undecorate 32-bit decorated names\n    UNDNAME_NAME_ONLY = 0x1000, // Crack only the name for primary declaration;\n    // return just [scope::]name.  Does expand template params\n    UNDNAME_NO_ARGUMENTS = 0x2000, // Don't undecorate arguments to function\n    UNDNAME_NO_SPECIAL_SYMS = 0x4000 // Don't undecorate special names (v-table, vcall, vector xxx, metatype, etc)\n  }\n\n  public const uint TOPMOST_FLAGS =\n    SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING;\n  public const uint SYMOPT_DEBUG = 0x80000000;\n  public const uint SYMOPT_EXACT_SYMBOLS = 0x00000400;\n  private const int MAX_PATH = 260;\n  private const uint SWP_NOSIZE = 0x0001;\n  private const uint SWP_NOMOVE = 0x0002;\n  private const uint SWP_NOZORDER = 0x0004;\n  private const uint SWP_NOREDRAW = 0x0008;\n  private const uint SWP_NOACTIVATE = 0x0010;\n  private const uint SWP_FRAMECHANGED = 0x0020; /* The frame changed: send WM_NCCALCSIZE */\n  private const uint SWP_SHOWWINDOW = 0x0040;\n  private const uint SWP_HIDEWINDOW = 0x0080;\n  private const uint SWP_NOCOPYBITS = 0x0100;\n  private const uint SWP_NOOWNERZORDER = 0x0200; /* Don’t do owner Z ordering */\n  private const uint SWP_NOSENDCHANGING = 0x0400; /* Don’t send WM_WINDOWPOSCHANGING */\n  public const int WM_MOUSEHWHEEL = 0x020E;\n  public static readonly IntPtr HWND_TOPMOST = new(-1);\n  public static readonly IntPtr HWND_NOTOPMOST = new(-2);\n  public static readonly IntPtr HWND_TOP = new(0);\n  public static readonly IntPtr HWND_BOTTOM = new(1);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"user32.dll\")]\n  public static extern uint GetDoubleClickTime();\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"user32.dll\")]\n  [return: MarshalAs(UnmanagedType.Bool)]\n  public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"shlwapi.dll\", CharSet = CharSet.Unicode, SetLastError = false)]\n  public static extern bool PathFindOnPath([In][Out] StringBuilder pszFile,\n                                           [In] string[] ppszOtherDirs);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"user32.dll\")]\n  public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X,\n                                         int Y, int cx, int cy, uint uFlags);\n\n  [SuppressUnmanagedCodeSecurity]\n  [DllImport(\"dbghelp.dll\", SetLastError = true, PreserveSig = true)]\n  public static extern int UnDecorateSymbolName(\n    [In][MarshalAs(UnmanagedType.LPStr)] string DecoratedName,\n    [Out] StringBuilder UnDecoratedName,\n    [In][MarshalAs(UnmanagedType.U4)] int UndecoratedLength,\n    [In][MarshalAs(UnmanagedType.U4)] UnDecorateFlags Flags);\n\n  public static string GetFullPathFromWindows(string exeName) {\n    var sb = new StringBuilder(exeName, MAX_PATH);\n    return PathFindOnPath(sb, null) ? sb.ToString() : null;\n  }\n\n  public static int HIWORD(IntPtr ptr) {\n    unchecked {\n      if (Environment.Is64BitOperatingSystem) {\n        long val64 = ptr.ToInt64();\n        return (short)(val64 >> 16 & 0xFFFF);\n      }\n\n      int val32 = ptr.ToInt32();\n      return (short)(val32 >> 16 & 0xFFFF);\n    }\n  }\n\n  [DllImport(\"user32.dll\", CharSet = CharSet.Auto, ExactSpelling = true)]\n  private static extern int GetSystemMetrics(int nIndex);\n\n  public static bool IsRemoteDesktopSession() {\n    return (GetSystemMetrics(0x1000) & 1) != 0;\n  }\n\n  [StructLayout(LayoutKind.Sequential)]\n  public struct RECT {\n    public int Left;\n    public int Top;\n    public int Right;\n    public int Bottom;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/Optional.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic struct Optional<T> : IEquatable<Optional<T>> {\n  private T value_;\n  public bool HasValue { get; private set; }\n\n  public T Value {\n    get {\n      Debug.Assert(HasValue);\n      return value_;\n    }\n    set {\n      value_ = value;\n      HasValue = true;\n    }\n  }\n\n  public Optional(T value) {\n    value_ = value;\n    HasValue = true;\n  }\n\n  public static explicit operator T(Optional<T> optional) {\n    return optional.Value;\n  }\n\n  public static implicit operator Optional<T>(T value) {\n    return new Optional<T>(value);\n  }\n\n  public override bool Equals(object obj) {\n    if (obj is Optional<T>) {\n      return Equals((Optional<T>)obj);\n    }\n\n    return false;\n  }\n\n  public bool Equals(Optional<T> other) {\n    if (HasValue && other.HasValue) {\n      return Equals(value_, other.value_);\n    }\n\n    return HasValue == other.HasValue;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(value_, HasValue);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/SourceFileMapper.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace ProfileExplorer.Core;\n\npublic class SourceFileMapper {\n  private readonly Dictionary<string, string> sourcePathMap_;\n  private readonly Dictionary<string, string> sourceFileCache_;\n  private readonly object lockObject_ = new();\n\n  public SourceFileMapper(Dictionary<string, string> sourcePathMap = null) {\n    sourcePathMap_ = sourcePathMap;\n    sourcePathMap_ ??= new Dictionary<string, string>(); // Saved across sessions.\n    sourceFileCache_ = new Dictionary<string, string>(); // Active per session.\n  }\n\n  public Dictionary<string, string> SourceMap => sourcePathMap_;\n\n  public string Map(string sourceFile, Func<string> lookup = null) {\n    if (string.IsNullOrEmpty(sourceFile)) {\n      return null;\n    }\n\n    lock (lockObject_) {\n      if (TryLookupInMap(sourceFile, out string result)) {\n        return result;\n      }\n\n      if (lookup == null) {\n        return null;\n      }\n\n      result = lookup();\n\n      if (result != null) {\n        UpdateMap(sourceFile, result);\n      }\n\n      return result;\n    }\n  }\n\n  public void Reset() {\n    lock (lockObject_) {\n      sourcePathMap_.Clear();\n      sourcePathMap_.Clear();\n    }\n  }\n\n  private bool TryLookupInMap(string sourceFile, out string result) {\n    // Check the direct mapping cache first.\n    if (sourceFileCache_.TryGetValue(sourceFile, out result)) {\n      return true;\n    }\n\n    // Use the past directory mappings to build the equivalent\n    // local path for the source file.\n    int index = sourceFile.LastIndexOf(Path.DirectorySeparatorChar);\n\n    while (index > 0) {\n      if (sourcePathMap_.TryGetValue(sourceFile.Substring(0, index), out string mappedDirectory)) {\n        result = Path.Combine(mappedDirectory, sourceFile.Substring(index + 1));\n        return true;\n      }\n\n      index = sourceFile.LastIndexOf(Path.DirectorySeparatorChar, index - 1);\n    }\n\n    result = null;\n    return false;\n  }\n\n  public void UpdateMap(string originalPath, string mappedPath) {\n    if (string.IsNullOrEmpty(originalPath) ||\n        string.IsNullOrEmpty(mappedPath)) {\n      return;\n    }\n\n    sourceFileCache_[originalPath] = mappedPath;\n\n    // Try to create a mapping between the directory paths,\n    // to be used later with another source file part of the same\n    // directory structure.\n    int prevOriginalPath = originalPath.Length;\n    int prevMappedPath = mappedPath.Length;\n    int originalPathIndex = originalPath.LastIndexOf(Path.DirectorySeparatorChar);\n    int mappedPathIndex = mappedPath.LastIndexOf(Path.DirectorySeparatorChar);\n\n    while (originalPathIndex > 0 && mappedPathIndex > 0) {\n      // Stop once there is a mismatch in directory names.\n      // Use a case-insensitive compare for Windows paths.\n      if (!originalPath.Substring(originalPathIndex, prevOriginalPath - originalPathIndex).Equals(\n        mappedPath.Substring(mappedPathIndex, prevMappedPath - mappedPathIndex),\n        StringComparison.OrdinalIgnoreCase)) {\n        return;\n      }\n\n      sourcePathMap_[originalPath.Substring(0, originalPathIndex)] = mappedPath.Substring(0, mappedPathIndex);\n      prevOriginalPath = originalPathIndex;\n      prevMappedPath = mappedPathIndex;\n\n      originalPathIndex = originalPath.LastIndexOf(Path.DirectorySeparatorChar, prevOriginalPath - 1);\n      mappedPathIndex = mappedPath.LastIndexOf(Path.DirectorySeparatorChar, prevMappedPath - 1);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCore/Utilities/Utils.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Xml;\nusing Microsoft.Win32;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.Core.Utilities;\n\npublic static class Utils {\n  private static readonly TaskFactory TaskFactoryInstance = new(CancellationToken.None,\n                                                                TaskCreationOptions.None,\n                                                                TaskContinuationOptions.None,\n                                                                TaskScheduler.Default);\n  private static readonly string HTML_COPY_HEADER =\n    \"Version:0.9\\r\\n\" +\n    \"StartHTML:{0:0000000000}\\r\\n\" +\n    \"EndHTML:{1:0000000000}\\r\\n\" +\n    \"StartFragment:{2:0000000000}\\r\\n\" +\n    \"EndFragment:{3:0000000000}\\r\\n\";\n  private static readonly string HTML_COPY_START =\n    \"<html>\\r\\n\" +\n    \"<body>\\r\\n\" +\n    \"<!--StartFragment-->\";\n  private static readonly string HTML_COPY_END =\n    \"<!--EndFragment-->\\r\\n\" +\n    \"</body>\\r\\n\" +\n    \"</html>\";\n\n  public static TResult RunSync<TResult>(Func<Task<TResult>> func) {\n    return TaskFactoryInstance.StartNew<Task<TResult>>(func).\n      Unwrap<TResult>().GetAwaiter().GetResult();\n  }\n\n  public static void RunSync(Func<Task> func) {\n    TaskFactoryInstance.StartNew<Task>(func).Unwrap().GetAwaiter().GetResult();\n  }\n\n  //? TODO: This should be part of the IR NameProvider\n  public static string MakeBlockDescription(BlockIR block) {\n    if (block == null) {\n      return \"\";\n    }\n\n    if (block.HasLabel && !string.IsNullOrEmpty(block.Label.Name)) {\n      return $\"B{block.Number} ({block.Label.Name})\";\n    }\n\n    return $\"B{block.Number}\";\n  }\n\n  //? TODO: This should be part of the IR NameProvider\n  public static string MakeElementDescription(IRElement element) {\n    switch (element) {\n      case BlockIR block:\n        return MakeBlockDescription(block);\n      case InstructionIR instr: {\n        var builder = new StringBuilder();\n        bool needsComma = false;\n\n        if (instr.Destinations.Count > 0) {\n          foreach (var destOp in instr.Destinations) {\n            if (needsComma) {\n              builder.Append(\", \");\n            }\n            else {\n              needsComma = true;\n            }\n\n            builder.Append(MakeElementDescription(destOp));\n          }\n\n          builder.Append(\" = \");\n        }\n\n        builder.Append($\"{instr.OpcodeText} \");\n        needsComma = false;\n\n        foreach (var sourceOp in instr.Sources) {\n          if (needsComma) {\n            builder.Append(\", \");\n          }\n          else {\n            needsComma = true;\n          }\n\n          builder.Append(MakeElementDescription(sourceOp));\n        }\n\n        return builder.ToString();\n      }\n      case OperandIR op: {\n        string text = GetSymbolName(op);\n\n        switch (op.Kind) {\n          case OperandKind.Address:\n          case OperandKind.LabelAddress: {\n            text = $\"&{text}\";\n            break;\n          }\n          case OperandKind.Indirection: {\n            text = $\"[{MakeElementDescription(op.IndirectionBaseValue)}]\";\n            break;\n          }\n          case OperandKind.IntConstant: {\n            text = op.IntValue.ToString();\n            break;\n          }\n          case OperandKind.FloatConstant: {\n            text = op.FloatValue.ToString();\n            break;\n          }\n        }\n\n        var ssaTag = op.GetTag<ISSAValue>();\n\n        if (ssaTag != null) {\n          text += $\"<{ssaTag.DefinitionId}>\";\n        }\n\n        return text;\n      }\n      default:\n        return element.ToString();\n    }\n  }\n\n  //? TODO: This should be part of the IR NameProvider\n  public static string GetSymbolName(OperandIR op) {\n    if (op.HasName) {\n      return op.NameValue.ToString();\n    }\n\n    return \"\";\n  }\n\n  public static void Swap<T>(ref T a, ref T b) {\n    var temp = a;\n    a = b;\n    b = temp;\n  }\n\n  public static string GetAutoSaveFilePath() {\n    string AUTO_SAVE_TEMP_FILE = \"autosave.pex\";\n    return Path.Combine(Path.GetTempPath(), AUTO_SAVE_TEMP_FILE);\n  }\n\n  public static bool TryDeleteFile(string path) {\n    if (!File.Exists(path)) {\n      return false;\n    }\n\n    try {\n      File.Delete(path);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to delete {path}: {ex.Message}\");\n      return false;\n    }\n\n    return true;\n  }\n\n  public static string TryGetFileName(string path) {\n    try {\n      if (string.IsNullOrEmpty(path)) {\n        return \"\";\n      }\n\n      return Path.GetFileName(path);\n    }\n    catch (Exception ex) {\n      return \"\";\n    }\n  }\n\n  public static string TryGetFileNameWithoutExtension(string path) {\n    try {\n      if (string.IsNullOrEmpty(path)) {\n        return \"\";\n      }\n\n      return Path.GetFileNameWithoutExtension(path);\n    }\n    catch (Exception ex) {\n      return \"\";\n    }\n  }\n\n  public static string TryGetDirectoryName(string path) {\n    try {\n      if (string.IsNullOrEmpty(path)) {\n        return \"\";\n      }\n\n      if (!Directory.Exists(path)) {\n        path = Path.GetDirectoryName(path);\n      }\n\n      // Remove \\ at the end.\n      if (path.EndsWith(Path.DirectorySeparatorChar) ||\n          path.EndsWith(Path.AltDirectorySeparatorChar)) {\n        path = path.Substring(0, path.Length - 1);\n      }\n\n      return path;\n    }\n    catch (Exception ex) {\n      return \"\";\n    }\n  }\n\n  public static string CleanupPath(string path) {\n    if (string.IsNullOrEmpty(path)) {\n      return path;\n    }\n\n    path = path.Trim();\n\n    if (path.Length >= 2 &&\n        path[0] == '\"' &&\n        path[^1] == '\"') {\n      path = path.Substring(1, path.Length - 2);\n    }\n\n    return path;\n  }\n\n  public static bool OpenExternalFile(string path, bool checkFileExists = true) {\n    if (checkFileExists && !File.Exists(path)) {\n      return false;\n    }\n\n    try {\n      var psi = new ProcessStartInfo(path) {\n        UseShellExecute = true\n      };\n\n      Process.Start(psi);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to open file: {path}, exception {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static bool OpenURL(string path) {\n    return OpenExternalFile(path, false);\n  }\n\n  public static bool ExecuteTool(string path, string args, CancelableTask cancelableTask = null,\n                                 Dictionary<string, string> envVariables = null) {\n    return ExecuteToolWithOutput(path, args, cancelableTask, envVariables) != null;\n  }\n\n  public static string ExecuteToolWithOutput(string path, string args, CancelableTask cancelableTask = null,\n                                             Dictionary<string, string> envVariables = null) {\n    if (!File.Exists(path)) {\n      return null;\n    }\n\n    Trace.TraceInformation($\"Executing tool {path} with args {args}\");\n\n    var outputText = new StringBuilder();\n    var procInfo = new ProcessStartInfo(path) {\n      Arguments = args,\n      UseShellExecute = false,\n      CreateNoWindow = true,\n      RedirectStandardError = false,\n      RedirectStandardOutput = true\n    };\n\n    if (envVariables != null) {\n      foreach (var pair in envVariables) {\n        procInfo.EnvironmentVariables[pair.Key] = pair.Value;\n      }\n    }\n\n    try {\n      using var process = new Process {StartInfo = procInfo, EnableRaisingEvents = true};\n\n      process.OutputDataReceived += (sender, e) => {\n        outputText.AppendLine(e.Data);\n      };\n\n      process.Start();\n      process.BeginOutputReadLine();\n\n      do {\n        process.WaitForExit(100);\n\n        if (cancelableTask != null && cancelableTask.IsCanceled) {\n          Trace.TraceWarning($\"Task {ObjectTracker.Track(cancelableTask)}: Canceled\");\n          process.Kill();\n          return null;\n        }\n      } while (!process.HasExited);\n\n      process.CancelOutputRead();\n\n      if (process.ExitCode != 0) {\n        Trace.TraceError($\"Task {ObjectTracker.Track(cancelableTask)}: Failed with error code: {process.ExitCode}\");\n        Trace.TraceError($\"  Output:\\n{outputText}\");\n        return null;\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Task {ObjectTracker.Track(cancelableTask)}: Failed with exception: {ex.Message}\");\n      return null;\n    }\n\n    return outputText.ToString();\n  }\n\n  public static string DetectMSVCPath() {\n    // https://devblogs.microsoft.com/cppblog/finding-the-visual-c-compiler-tools-in-visual-studio-2017/\n    string vswherePath = @\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe\";\n    string vswhereArgs =\n      @\"-latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath\";\n\n    vswherePath = Environment.ExpandEnvironmentVariables(vswherePath);\n\n    try {\n      string vsPath = ExecuteToolWithOutput(vswherePath, vswhereArgs);\n\n      if (string.IsNullOrEmpty(vsPath)) {\n        Trace.TraceError(\"Failed to run vswhere\");\n        return null;\n      }\n\n      vsPath = vsPath.SplitLinesRemoveEmpty().First();\n      string msvcPathInfo = Path.Combine(vsPath, @\"VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt\");\n      string msvcVersion = File.ReadLines(msvcPathInfo).First();\n      return Path.Combine(vsPath, @\"VC\\Tools\\MSVC\", msvcVersion, @\"bin\\HostX64\\x64\");\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to find MSVC path: {ex.Message}\");\n    }\n\n    return null;\n  }\n\n  public static DebugFileSearchResult LocateDebugInfoFile(string imagePath, string extension) {\n    try {\n      if (!File.Exists(imagePath)) {\n        return DebugFileSearchResult.None;\n      }\n\n      string path = Path.GetDirectoryName(imagePath);\n      string imageName = Path.GetFileNameWithoutExtension(imagePath);\n      string pdbPath = Path.Combine(path, imageName) + extension;\n\n      if (File.Exists(pdbPath)) {\n        return DebugFileSearchResult.Success(pdbPath);\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to find debug file for {imagePath}: {ex.Message}\");\n    }\n\n    return DebugFileSearchResult.None;\n  }\n\n  public static bool IsBinaryFile(string filePath) {\n    return FileHasExtension(filePath, \".exe\") ||\n           FileHasExtension(filePath, \".dll\") ||\n           FileHasExtension(filePath, \".sys\");\n  }\n\n  public static bool IsExecutableFile(string filePath) {\n    return FileHasExtension(filePath, \".exe\");\n  }\n\n  public static bool FileHasExtension(string filePath, string extension) {\n    if (string.IsNullOrEmpty(filePath)) {\n      return false;\n    }\n\n    try {\n      extension = extension.ToLowerInvariant();\n\n      if (!extension.StartsWith(\".\")) {\n        extension = $\".{extension}\";\n      }\n\n      return Path.GetExtension(filePath).ToLowerInvariant() == extension;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed FileHasExtension for {filePath}: {ex}\");\n      return false;\n    }\n  }\n\n  public static string GetFileExtension(string filePath) {\n    if (string.IsNullOrEmpty(filePath)) {\n      return \"\";\n    }\n\n    try {\n      return Path.GetExtension(filePath);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed GetFileExtension for {filePath}: {ex}\");\n      return \"\";\n    }\n  }\n\n  public static long ComputeDirectorySize(string path, bool recursive = false) {\n    try {\n      if (!Directory.Exists(path)) {\n        return 0;\n      }\n\n      long total = 0;\n\n      foreach (string file in Directory.EnumerateFileSystemEntries(path)) {\n        if (!File.GetAttributes(file).HasFlag(FileAttributes.Directory)) {\n          total += new FileInfo(file).Length;\n        }\n        else if (recursive) {\n          total += ComputeDirectorySize(file, true);\n        }\n      }\n\n      return total;\n    }\n    catch {\n      return 0;\n    }\n  }\n\n  public static void OpenExplorerAtFile(string path) {\n    if (!File.Exists(path) && !Directory.Exists(path)) {\n      return;\n    }\n\n    try {\n      Process.Start(\"explorer.exe\", \"/select, \" + path);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to start explorer.exe for {path}: {ex.Message}\");\n    }\n  }\n \n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static double SnapToPixels(double value) {\n    return Math.Round(value);\n  }\n\n  private static bool IsOptionsUpdateEvent(string sourceName) {\n    return sourceName != \"Button\" &&\n           sourceName != \"ToggleButton\" &&\n           sourceName != \"TextBox\" &&\n           sourceName != \"TextBoxView\" &&\n           sourceName != \"TextBlock\";\n  }\n\n  public static string ConvertHtmlToClipboardFormat(string html) {\n    var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);\n    byte[] data = Array.Empty<byte>();\n    byte[] header = encoding.GetBytes(string.Format(HTML_COPY_HEADER, 0, 1, 2, 3));\n    data = data.Concat(header).ToArray();\n\n    int startHtml = data.Length;\n    data = data.Concat(encoding.GetBytes(HTML_COPY_START)).ToArray();\n\n    int startFragment = data.Length;\n    data = data.Concat(encoding.GetBytes(html)).ToArray();\n    int endFragment = data.Length;\n    data = data.Concat(encoding.GetBytes(HTML_COPY_END)).ToArray();\n\n    int endHtml = data.Length;\n    byte[] newHeader = encoding.GetBytes(\n      string.Format(HTML_COPY_HEADER, startHtml, endHtml, startFragment, endFragment));\n    Array.Copy(newHeader, data, startHtml);\n    return encoding.GetString(data);\n  }\n\n  public static string RemovePathQuotes(string text) {\n    if (string.IsNullOrEmpty(text)) {\n      return text;\n    }\n\n    return text.Trim('\\\"');\n  }\n\n  public struct KeyCharInfo {\n    public bool IsLetter;\n    public char Letter;\n    public bool IsShift;\n    public bool IsControl;\n    public bool IsAlt;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/ASMIRSectionReaderTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Compilers.ASM;\n\nnamespace ProfileExplorer.CoreTests;\n\n[TestClass]\npublic class ASMIRSectionReaderTests {\n  [TestMethod]\n  public void GenerateSummary_CreatesOneTextInfoPerSection() {\n    string data =\n      @\"x264_plane_copy_c:\n  str lr,[sp]\nx264_frame_init_lowres:\n  sub sp,sp,#0x40\n\";\n    byte[] bytes = Encoding.UTF8.GetBytes(data);\n    var (_, capturedText, _1) = GenerateSummaryFor(bytes);\n    Assert.AreEqual(2, capturedText.Count);\n    Assert.AreEqual(1, capturedText[0].TextLines.Count);\n    Assert.AreEqual(\"  str lr,[sp]\", capturedText[0].TextLines[0]);\n    Assert.AreEqual(1, capturedText[1].TextLines.Count);\n    Assert.AreEqual(\"  sub sp,sp,#0x40\", capturedText[1].TextLines[0]);\n  }\n\n  [TestMethod]\n  public void GenerateSummary_GivesNPlus1ProgressUpdates() {\n    string data =\n      @\"x264_plane_copy_c:\n  str lr,[sp]\nx264_frame_init_lowres:\n  sub sp,sp,#0x40\n\";\n    byte[] bytes = Encoding.UTF8.GetBytes(data);\n    var (_, _1, capturedProgressInfo) = GenerateSummaryFor(bytes);\n    // 1 progress for each section + 1 \"done\"\n    Assert.AreEqual(3, capturedProgressInfo.Count);\n    // processed all bytes\n    Assert.AreEqual(bytes.Length, capturedProgressInfo[2].BytesProcessed);\n\n    foreach (var info in capturedProgressInfo) {\n      Assert.AreEqual(bytes.Length, info.TotalBytes);\n    }\n  }\n\n  [TestMethod]\n  public void GenerateSummary_CreatesCorrectIROutputForFunctions() {\n    string data =\n      @\"x264_plane_copy_c:\n  str lr,[sp]\nx264_frame_init_lowres:\n  sub sp,sp,#0x40\n\";\n    byte[] bytes = Encoding.UTF8.GetBytes(data);\n    var (summary, _, _1) = GenerateSummaryFor(bytes);\n    Assert.AreEqual(2, summary.Functions.Count);\n\n    Action<IRTextFunction, string> verifyFunctionBody = (f, expected) => {\n      int start = (int)f.Sections[0].Output.DataStartOffset;\n      int size = (int)f.Sections[0].Output.Size;\n      Assert.AreEqual(expected, Encoding.UTF8.GetString(bytes, start, size));\n    };\n\n    var copy = summary.Functions.Find(f => f.Name == \"x264_plane_copy_c\");\n    Assert.IsNotNull(copy);\n    Assert.AreEqual(1, copy.SectionCount);\n    verifyFunctionBody(copy, \"  str lr,[sp]\\r\\n\");\n\n    var init = summary.Functions.Find(f => f.Name == \"x264_frame_init_lowres\");\n    Assert.IsNotNull(init);\n    Assert.AreEqual(1, init.SectionCount);\n    verifyFunctionBody(init, \"  sub sp,sp,#0x40\\r\\n\");\n  }\n\n  private (IRTextSummary, List<SectionReaderText>, List<SectionReaderProgressInfo>) GenerateSummaryFor(byte[] input) {\n    var reader = new ASMIRSectionReader(input, true);\n    var capturedText = new List<SectionReaderText>();\n    var capturedProgressInfo = new List<SectionReaderProgressInfo>();\n    var summary = reader.GenerateSummary((reader, info) => {\n      capturedProgressInfo.Add(info);\n    }, (reader, text) => {\n      capturedText.Add(text);\n    });\n    return (summary, capturedText, capturedProgressInfo);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/CompressedSegmentedListTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core.Collections;\n\nnamespace ProfileExplorer.CoreTests;\n\npublic struct TestObject {\n  public int a, b, c, d;\n  public static int Counter;\n\n  public static TestObject Create() {\n    var result = new TestObject {\n      a = Counter,\n      b = Counter + 1,\n      c = Counter + 2,\n      d = Counter + 3\n    };\n\n    Counter += 4;\n    return result;\n  }\n}\n\npublic struct TestGuidObject {\n  public Guid a, b;\n\n  public static TestGuidObject Create() {\n    var result = new TestGuidObject {\n      a = Guid.NewGuid(),\n      b = Guid.NewGuid()\n    };\n    return result;\n  }\n}\n\n[TestClass]\npublic class CompressedSegmentedListTests {\n  [TestMethod]\n  public void TestAdd() {\n    var list = new CompressedSegmentedList<TestObject>();\n    int count = 100000;\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      list.Add(TestObject.Create());\n    }\n\n    Assert.AreEqual(list.Count, count);\n    int counter = 0;\n\n    for (int i = 0; i < 10000; i++) {\n      var item = list[i];\n      Assert.AreEqual(item.a, counter);\n      Assert.AreEqual(item.b, counter + 1);\n      Assert.AreEqual(item.c, counter + 2);\n      Assert.AreEqual(item.d, counter + 3);\n      counter += 4;\n    }\n  }\n\n  [TestMethod]\n  public void TestEnumerator() {\n    var list = new CompressedSegmentedList<TestObject>();\n    int count = 100000;\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      list.Add(TestObject.Create());\n    }\n\n    int counter = 0;\n\n    foreach (var item in list) {\n      Assert.AreEqual(item.a, counter);\n      Assert.AreEqual(item.b, counter + 1);\n      Assert.AreEqual(item.c, counter + 2);\n      Assert.AreEqual(item.d, counter + 3);\n      counter += 4;\n    }\n  }\n\n  [TestMethod]\n  public void TestContains() {\n    var list = new CompressedSegmentedList<TestObject>();\n    int count = 10000;\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      list.Add(TestObject.Create());\n    }\n\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      Assert.IsTrue(list.Contains(TestObject.Create()));\n    }\n  }\n\n  [TestMethod]\n  public void TestIndexOf() {\n    var list = new CompressedSegmentedList<TestObject>();\n    int count = 10000;\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      list.Add(TestObject.Create());\n    }\n\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      Assert.AreEqual(i, list.IndexOf(TestObject.Create()));\n    }\n  }\n\n  [TestMethod]\n  public void TestHuge() {\n    var list = new CompressedSegmentedList<TestObject>();\n    int count = 1000000;\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      list.Add(TestObject.Create());\n    }\n\n    int counter = 0;\n\n    foreach (var item in list) {\n      Assert.AreEqual(item.a, counter);\n      Assert.AreEqual(item.b, counter + 1);\n      Assert.AreEqual(item.c, counter + 2);\n      Assert.AreEqual(item.d, counter + 3);\n      counter += 4;\n    }\n  }\n\n  [TestMethod]\n  public void TestRandom() {\n    var list = new CompressedSegmentedList<TestObject>();\n    int count = 1000000;\n    TestObject.Counter = 0;\n    var checkList = new List<TestObject>();\n    var orderList = new List<int>();\n\n    for (int i = 0; i < count; i++) {\n      var obj = TestObject.Create();\n      list.Add(obj);\n      checkList.Add(obj);\n      orderList.Add(i);\n    }\n\n    var random = new Random(31);\n    orderList = orderList.OrderBy(x => random.Next()).ToList();\n\n    for (int i = 0; i < count; i++) {\n      int index = orderList[i];\n      var item = list[index];\n      var checkItem = checkList[index];\n      Assert.AreEqual(item.a, checkItem.a);\n      Assert.AreEqual(item.b, checkItem.b);\n      Assert.AreEqual(item.c, checkItem.c);\n      Assert.AreEqual(item.d, checkItem.d);\n    }\n  }\n\n  [TestMethod]\n  public void TestPrefetch() {\n    var list = new CompressedSegmentedList<TestObject>(true, true, 10);\n    int count = 1000000;\n    TestObject.Counter = 0;\n\n    for (int i = 0; i < count; i++) {\n      list.Add(TestObject.Create());\n    }\n\n    int counter = 0;\n\n    foreach (var item in list) {\n      Assert.AreEqual(item.a, counter);\n      Assert.AreEqual(item.b, counter + 1);\n      Assert.AreEqual(item.c, counter + 2);\n      Assert.AreEqual(item.d, counter + 3);\n      counter += 4;\n    }\n  }\n\n  [TestMethod]\n  public void TestGuid() {\n    var list = new CompressedSegmentedList<TestGuidObject>();\n    int count = 1000000;\n    var checkList = new List<TestGuidObject>();\n    var orderList = new List<int>();\n\n    for (int i = 0; i < count; i++) {\n      var obj = TestGuidObject.Create();\n      list.Add(obj);\n      checkList.Add(obj);\n      orderList.Add(i);\n    }\n\n    var random = new Random(31);\n    //orderList = orderList.OrderBy(x => random.Next()).ToList();\n\n    for (int i = 0; i < count; i++) {\n      int index = orderList[i];\n      var item = list[index];\n      var checkItem = checkList[index];\n      Assert.AreEqual(item.a, checkItem.a);\n      Assert.AreEqual(item.b, checkItem.b);\n    }\n  }\n\n  [TestMethod]\n  public void TestGuidRandom() {\n    var list = new CompressedSegmentedList<TestGuidObject>();\n    int count = 1000000;\n    var checkList = new List<TestGuidObject>();\n    var orderList = new List<int>();\n\n    for (int i = 0; i < count; i++) {\n      var obj = TestGuidObject.Create();\n      list.Add(obj);\n      checkList.Add(obj);\n      orderList.Add(i);\n    }\n\n    var random = new Random(31);\n    orderList = orderList.OrderBy(x => random.Next()).ToList();\n\n    for (int i = 0; i < count; i++) {\n      int index = orderList[i];\n      var item = list[index];\n      var checkItem = checkList[index];\n      Assert.AreEqual(item.a, checkItem.a);\n      Assert.AreEqual(item.b, checkItem.b);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/ETWUnmappedFrameResolutionTests.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.ETW;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.CoreTests;\n\n/// <summary>\n/// Verifies that samples from dynamically generated code\n/// (LUA JIT, Java JIT, etc.) whose IPs don't map to any loaded module are\n/// properly attributed rather than silently dropped.\n///\n/// Integration tests exercise the actual ETWProfileDataProvider code path.\n/// Processor tests verify FunctionProfileProcessor and FunctionsForSamplesProcessor\n/// handle the resulting frames correctly (these processors are not covered by\n/// the existing SyntheticProfileTests in the UI test project).\n/// </summary>\n[TestClass]\npublic class ETWUnmappedFrameResolutionTests {\n  private static readonly BindingFlags NonPublic =\n    BindingFlags.Instance | BindingFlags.NonPublic;\n\n  #region Integration tests — actual ETWProfileDataProvider code path\n\n  [TestMethod]\n  public async Task ProcessUnresolvedStack_UnmappedIP_CreatesAttributedFrame() {\n    var (rawProfile, process, context) = CreateRawProfile(1000, 2000, \"test.exe\", \"WorkerThread\");\n    rawProfile.AddImageToProcess(1000, new ProfileImage(\"test.exe\", \"test.exe\",\n      0x10000, 0x10000, 0x1000, 0, 0));\n    rawProfile.LoadingCompleted();\n\n    var provider = CreateProvider();\n    GetProfileData(provider).AddThreads(process.Threads(rawProfile));\n    InvokePreCreateUnknownModule(provider, rawProfile, 1000);\n\n    var stack = new ProfileStack { ContextId = 1, FramePointers = new long[] { 0xAAAAAA } };\n    var resolved = await InvokeProcessUnresolvedStack(provider, stack, context, rawProfile);\n\n    Assert.AreEqual(1, resolved.FrameCount);\n    var frame = resolved.StackFrames[0];\n    Assert.IsFalse(frame.IsUnknown, \"Unmapped IP should produce an attributed frame, not Unknown\");\n    Assert.IsNotNull(frame.FrameDetails.Image);\n    Assert.IsNotNull(frame.FrameDetails.Function);\n    StringAssert.Contains(frame.FrameDetails.Function.Name, \"JIT\");\n  }\n\n  [TestMethod]\n  public async Task ProcessUnresolvedStack_MixedStack_BothFramesAttributed() {\n    var (rawProfile, process, context) = CreateRawProfile(1001, 2001, \"mixed.exe\", null);\n    rawProfile.AddImageToProcess(1001, new ProfileImage(\"mixed.exe\", \"mixed.exe\",\n      0x10000, 0x10000, 0x10000, 0, 0));\n    rawProfile.LoadingCompleted();\n\n    var provider = CreateProvider();\n    GetProfileData(provider).AddThreads(process.Threads(rawProfile));\n    InvokePreCreateUnknownModule(provider, rawProfile, 1001);\n\n    // Frame 0 (leaf): unmapped. Frame 1 (root): inside mixed.exe.\n    var stack = new ProfileStack { ContextId = 1, FramePointers = new long[] { 0xCCCCCC, 0x10500 } };\n    var resolved = await InvokeProcessUnresolvedStack(provider, stack, context, rawProfile);\n\n    Assert.AreEqual(2, resolved.FrameCount);\n    Assert.IsFalse(resolved.StackFrames[0].IsUnknown, \"Unmapped frame should not be Unknown\");\n    Assert.IsFalse(resolved.StackFrames[1].IsUnknown, \"Mapped frame should not be Unknown\");\n    Assert.AreEqual(\"mixed.exe\", resolved.StackFrames[1].FrameDetails.Image.ModuleName);\n  }\n\n  [TestMethod]\n  public async Task ProcessUnresolvedStack_ConsecutiveUnmappedIPs_CollapsedToOneFrame() {\n    var (rawProfile, process, context) = CreateRawProfile(1002, 2002, \"collapse.exe\", null);\n    rawProfile.AddImageToProcess(1002, new ProfileImage(\"collapse.exe\", \"collapse.exe\",\n      0x90000, 0x90000, 0x10000, 0, 0));\n    rawProfile.LoadingCompleted();\n\n    var provider = CreateProvider();\n    GetProfileData(provider).AddThreads(process.Threads(rawProfile));\n    InvokePreCreateUnknownModule(provider, rawProfile, 1002);\n\n    // 3 consecutive unmapped IPs followed by a known frame.\n    var stack = new ProfileStack { ContextId = 1, FramePointers = new long[] { 0xBB0001, 0xBB0002, 0xBB0003, 0x90500 } };\n    var resolved = await InvokeProcessUnresolvedStack(provider, stack, context, rawProfile);\n\n    // Consecutive unmapped frames should be collapsed to 1 JIT frame + 1 known frame = 2 total\n    Assert.AreEqual(2, resolved.FrameCount,\n      \"3 consecutive unmapped IPs should collapse to 1 JIT frame\");\n    StringAssert.Contains(resolved.StackFrames[0].FrameDetails.Function.Name, \"JIT\");\n    Assert.AreEqual(\"collapse.exe\", resolved.StackFrames[1].FrameDetails.Image.ModuleName);\n  }\n\n  [TestMethod]\n  public async Task ProcessUnresolvedStack_KernelUnmappedIP_RoutedToUnknownNotJit() {\n    var (rawProfile, process, context) = CreateRawProfile(1003, 2003, \"kernel.exe\", null);\n    rawProfile.LoadingCompleted();\n\n    var provider = CreateProvider();\n    GetProfileData(provider).AddThreads(process.Threads(rawProfile));\n    InvokePreCreateUnknownModule(provider, rawProfile, 1003);\n\n    // Kernel-range IP that doesn't map to any module.\n    var stack = new ProfileStack { ContextId = 1, FramePointers = new long[] { unchecked((long)0xFFFFF80012340000UL) } };\n    var resolved = await InvokeProcessUnresolvedStack(provider, stack, context, rawProfile);\n\n    Assert.AreEqual(1, resolved.FrameCount);\n    Assert.IsTrue(resolved.StackFrames[0].IsUnknown,\n      \"Unmapped kernel IP should be Unknown, not attributed as JIT\");\n  }\n\n  [TestMethod]\n  public async Task ProcessUnresolvedStack_NoPreCreate_FallsBackToUnknown() {\n    var (rawProfile, process, context) = CreateRawProfile(1004, 2004, \"fallback.exe\", null);\n    rawProfile.LoadingCompleted();\n\n    var provider = CreateProvider();\n    GetProfileData(provider).AddThreads(process.Threads(rawProfile));\n    // Deliberately NOT calling InvokePreCreateUnknownModule.\n\n    var stack = new ProfileStack { ContextId = 1, FramePointers = new long[] { 0xDD0001 } };\n    var resolved = await InvokeProcessUnresolvedStack(provider, stack, context, rawProfile);\n\n    Assert.AreEqual(1, resolved.FrameCount);\n    Assert.IsTrue(resolved.StackFrames[0].IsUnknown,\n      \"Without pre-created module, unmapped IP should fall back to Unknown\");\n  }\n\n  [TestMethod]\n  public void PreCreateUnknownModule_ProducesConsistentState() {\n    var rawProfile = new RawProfileData(\"test.etl\");\n    rawProfile.TraceInfo.PointerSize = 8;\n    rawProfile.GetOrCreateProcess(3000);\n    rawProfile.LoadingCompleted();\n\n    var provider = CreateProvider();\n    InvokePreCreateUnknownModule(provider, rawProfile, 3000);\n\n    var getModule = typeof(ETWProfileDataProvider).GetMethod(\"GetUnknownModule\", NonPublic);\n    var state = getModule.Invoke(provider, new object[] { 3000 });\n    Assert.IsNotNull(state, \"Pre-created module should be retrievable\");\n  }\n\n  [TestMethod]\n  public void GetOrCreateThreadFunction_PerThreadIsolation() {\n    var rawProfile = new RawProfileData(\"test.etl\");\n    rawProfile.TraceInfo.PointerSize = 8;\n    rawProfile.GetOrCreateProcess(3001);\n    rawProfile.LoadingCompleted();\n\n    var provider = CreateProvider();\n    var profileData = GetProfileData(provider);\n    for (int t = 0; t < 5; t++)\n      profileData.Threads[4000 + t] = new ProfileThread(4000 + t, 3001, $\"Worker{t}\");\n\n    InvokePreCreateUnknownModule(provider, rawProfile, 3001);\n    var getModule = typeof(ETWProfileDataProvider).GetMethod(\"GetUnknownModule\", NonPublic);\n    var unknownState = getModule.Invoke(provider, new object[] { 3001 });\n    var getFunc = unknownState.GetType().GetMethod(\"GetOrCreateThreadFunction\");\n\n    var results = new ConcurrentBag<(int Tid, string Name)>();\n    var tasks = new List<Task>();\n    for (int round = 0; round < 10; round++)\n      for (int t = 0; t < 5; t++) {\n        int tid = 4000 + t;\n        tasks.Add(Task.Run(() => {\n          var r = ((IRTextFunction, FunctionDebugInfo))getFunc.Invoke(\n            unknownState, new object[] { tid });\n          results.Add((tid, r.Item1.Name));\n        }));\n      }\n    Task.WaitAll(tasks.ToArray());\n\n    Assert.AreEqual(5, results.Select(r => r.Name).Distinct().Count(),\n      \"Each thread should get a distinct function\");\n    foreach (var g in results.GroupBy(r => r.Tid))\n      Assert.AreEqual(1, g.Select(r => r.Name).Distinct().Count(),\n        $\"Thread {g.Key} should always return the same function\");\n  }\n\n  #endregion\n\n  #region Processor tests — FunctionProfileProcessor / FunctionsForSamplesProcessor\n\n  [TestMethod]\n  public void FunctionProfileProcessor_ExclusiveWeightGoesToLeafNotCaller() {\n    // Core bug: before the fix, Unknown leaf frames were skipped and\n    // ExclusiveWeight was mis-attributed to the deepest known caller.\n    var profileData = new ProfileData();\n    var unknownImage = CreateUnknownModuleImage();\n    profileData.Modules[RealImage.Id] = RealImage;\n    profileData.Modules[unknownImage.Id] = unknownImage;\n\n    var mainFunc = new IRTextFunction(\"main\");\n    var mainInfo = new FunctionDebugInfo(\"main\", 0x100, 64);\n    var unknownFunc = new IRTextFunction(\"[JIT Thread 500]\");\n    var unknownInfo = new FunctionDebugInfo(\"[JIT Thread 500]\", 500, 1);\n\n    for (int i = 0; i < 2; i++) {\n      var stack = new ProfileStack(contextId: 1, framePtrs: new long[2]);\n      var resolved = new ResolvedProfileStack(2, new ProfileContext(100, 500, 0));\n      resolved.AddFrame(unknownFunc, 0x50000 + i, unknownInfo.RVA, 0,\n        new ResolvedProfileStackFrameKey(unknownInfo, unknownImage, false), stack, 8);\n      resolved.AddFrame(mainFunc, 0x51100 + i, mainInfo.RVA, 1,\n        new ResolvedProfileStackFrameKey(mainInfo, RealImage, false), stack, 8);\n      profileData.Samples.Add((\n        new ProfileSample(0x50000 + i, TimeSpan.FromMilliseconds(i * 10),\n          TimeSpan.FromMilliseconds(10), false, 0), resolved));\n    }\n    profileData.ComputeThreadSampleRanges();\n\n    var result = FunctionProfileProcessor.Compute(profileData, new ProfileSampleFilter());\n\n    Assert.AreEqual(TimeSpan.FromMilliseconds(20),\n      result.FunctionProfiles[unknownFunc].ExclusiveWeight,\n      \"Leaf (JIT) should get exclusive weight\");\n    Assert.AreEqual(TimeSpan.Zero,\n      result.FunctionProfiles[mainFunc].ExclusiveWeight,\n      \"Caller (main) should NOT get exclusive weight — it's not the leaf\");\n    Assert.AreEqual(TimeSpan.FromMilliseconds(20),\n      result.FunctionProfiles[mainFunc].Weight,\n      \"Caller (main) should get inclusive weight\");\n  }\n\n  [TestMethod]\n  public void FunctionProfileProcessor_AllUnmappedStack_WeightPreserved() {\n    var profileData = new ProfileData();\n    var unknownImage = CreateUnknownModuleImage();\n    profileData.Modules[unknownImage.Id] = unknownImage;\n\n    var unknownFunc = new IRTextFunction(\"[JIT Thread 600]\");\n    var unknownInfo = new FunctionDebugInfo(\"[JIT Thread 600]\", 600, 1);\n\n    var stack = new ProfileStack(contextId: 1, framePtrs: new long[1]);\n    var resolved = new ResolvedProfileStack(1, new ProfileContext(100, 600, 0));\n    resolved.AddFrame(unknownFunc, 0xCA01, unknownInfo.RVA, 0,\n      new ResolvedProfileStackFrameKey(unknownInfo, unknownImage, false), stack, 8);\n    profileData.Samples.Add((\n      new ProfileSample(0xCA01, TimeSpan.Zero, TimeSpan.FromMilliseconds(5), false, 0),\n      resolved));\n    profileData.ComputeThreadSampleRanges();\n\n    var result = FunctionProfileProcessor.Compute(profileData, new ProfileSampleFilter());\n\n    Assert.AreEqual(TimeSpan.FromMilliseconds(5), result.ProfileWeight,\n      \"Profile weight must include unmapped-code-only samples\");\n    Assert.AreEqual(TimeSpan.FromMilliseconds(5),\n      result.FunctionProfiles[unknownFunc].ExclusiveWeight);\n  }\n\n  [TestMethod]\n  public void FunctionsForSamplesProcessor_IncludesUnmappedCodeFunctions() {\n    var profileData = new ProfileData();\n    var unknownImage = CreateUnknownModuleImage();\n    profileData.Modules[unknownImage.Id] = unknownImage;\n\n    var unknownFunc = new IRTextFunction(\"[JIT Thread 800]\");\n    var unknownInfo = new FunctionDebugInfo(\"[JIT Thread 800]\", 800, 1);\n\n    var stack = new ProfileStack(contextId: 1, framePtrs: new long[1]);\n    var resolved = new ResolvedProfileStack(1, new ProfileContext(100, 800, 0));\n    resolved.AddFrame(unknownFunc, 0xBA01, unknownInfo.RVA, 0,\n      new ResolvedProfileStackFrameKey(unknownInfo, unknownImage, false), stack, 8);\n    profileData.Samples.Add((\n      new ProfileSample(0xBA01, TimeSpan.Zero, TimeSpan.FromMilliseconds(1), false, 0),\n      resolved));\n    profileData.ComputeThreadSampleRanges();\n\n    Assert.IsTrue(\n      FunctionsForSamplesProcessor.Compute(new ProfileSampleFilter(), profileData).Contains(unknownFunc),\n      \"Unmapped code function must appear in the function set\");\n  }\n\n  #endregion\n\n  #region Helpers\n\n  private static readonly ProfileImage RealImage =\n    new(\"app.exe\", \"app.exe\", 0x1000, 0x1000, 0x100000, 0, 0xABCDEF) { Id = 1 };\n\n  private static ProfileImage CreateUnknownModuleImage() =>\n    new(\"[Unknown Module]\", \"[Unknown Module]\", 0, 0, 0, 0, 0) { Id = 9999 };\n\n  private static (RawProfileData, ProfileProcess, ProfileContext) CreateRawProfile(\n    int processId, int threadId, string processName, string threadName) {\n    var rawProfile = new RawProfileData(\"synthetic.etl\");\n    rawProfile.TraceInfo.PointerSize = 8;\n    var process = rawProfile.GetOrCreateProcess(processId);\n    process.Name = processName;\n    process.ImageFileName = processName;\n    rawProfile.AddThreadToProcess(processId, new ProfileThread(threadId, processId, threadName));\n    var context = new ProfileContext(processId, threadId, 0);\n    typeof(RawProfileData).GetMethod(\"AddContext\", NonPublic)!\n      .Invoke(rawProfile, new object[] { context });\n    return (rawProfile, process, context);\n  }\n\n  private static ETWProfileDataProvider CreateProvider() {\n    var provider = new ETWProfileDataProvider();\n    SetField(provider, \"report_\", new ProfileDataReport());\n    SetField(provider, \"options_\", new ProfileDataProviderOptions());\n    SetField(provider, \"compilerInfoProvider_\", new ASMCompilerInfoProvider(IRMode.x86_64));\n    return provider;\n  }\n\n  private static ProfileData GetProfileData(ETWProfileDataProvider provider) =>\n    (ProfileData)typeof(ETWProfileDataProvider).GetField(\"profileData_\", NonPublic)!.GetValue(provider)!;\n\n  private static async Task<ResolvedProfileStack> InvokeProcessUnresolvedStack(\n    ETWProfileDataProvider provider, ProfileStack stack,\n    ProfileContext context, RawProfileData rawProfile) =>\n    await (Task<ResolvedProfileStack>)typeof(ETWProfileDataProvider)\n      .GetMethod(\"ProcessUnresolvedStackAsync\", NonPublic)!\n      .Invoke(provider, new object[] { stack, context, rawProfile, new SymbolFileSourceSettings() })!;\n\n  private static void InvokePreCreateUnknownModule(ETWProfileDataProvider provider, RawProfileData rawProfile, int processId) =>\n    typeof(ETWProfileDataProvider).GetMethod(\"PreCreateUnknownModule\", NonPublic)!\n      .Invoke(provider, new object[] { rawProfile, processId });\n\n  private static void SetField(object obj, string name, object value) =>\n    typeof(ETWProfileDataProvider).GetField(name, NonPublic)!.SetValue(obj, value);\n\n  #endregion\n}\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/EndToEndWorkflowTests.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.ETW;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.CoreTests;\n\n/// <summary>\n/// End-to-end workflow tests for Profile Explorer functionality.\n/// \n/// These tests validate the complete pipeline from trace loading to assembly analysis by comparing\n/// extracted data against known baselines. Four types of baselines are validated:\n/// \n/// 1. Process Baselines: CPU usage, duration, and process information\n/// 2. Module Baselines: Time spent per module/DLL  \n/// 3. Function Baselines: Performance data per function\n/// 4. Assembly Baselines: Assembly/disassembly text for specific binary-function pairs\n/// \n/// ADDING NEW TEST CASES:\n/// \n/// 1. Add test case name to TestCases list\n/// 2. (Optional) Add process ID to TestCaseProcessIds if known\n/// 3. (Optional) Configure assembly baselines in TestCaseAssemblyBaselines\n/// 4. Create TestData/<testcase>/ directory with:\n///    - Traces/ subdirectory containing ETW trace files\n///    - Binaries/ subdirectory containing executable/library files\n///    - Symbols/ subdirectory containing PDB symbol files\n/// 5. Run GenerateBaseline_ForTestCase (remove [Ignore] attribute) to create baselines\n/// 6. Re-enable [Ignore] attribute and run TestEndToEndWorkflow_ForTestCase\n/// \n/// ADDING ASSEMBLY BASELINES:\n/// \n/// Assembly baselines capture the disassembly text for specific functions, which helps detect\n/// when compiler optimizations or code changes affect the generated assembly. To add new ones:\n/// \n/// 1. Add (binary name, function name) pairs to TestCaseAssemblyBaselines for your test case:\n///    { \"MyTestCase\", new List<(string, string)> {\n///        (\"MyApp.exe\", \"main\"),\n///        (\"MyLibrary.dll\", \"CriticalFunction\")\n///      }\n///    }\n/// \n/// 2. Run GenerateBaseline to create assembly_<binary>_baseline.csv files\n/// 3. Each CSV contains function names and their complete assembly text\n/// \n/// BASELINE FILE STRUCTURE:\n/// \n/// TestData/<testcase>/\n/// ├── processes_baseline.csv       (process CPU usage data)\n/// ├── modules_baseline.csv         (module timing data)  \n/// ├── functions_<module>_baseline.csv (function performance per module)\n/// └── assembly_<binary>_baseline.csv  (assembly text per binary)\n/// \n/// Example assembly baseline entry:\n/// FunctionName,AssemblyText\n/// \"main\",\"push rbp\\nmov rbp,rsp\\nsub rsp,20h\\n...\"\n/// \n/// MAINTENANCE:\n/// \n/// - Baselines may need regeneration when:\n///   * Compiler versions change\n///   * Build configurations change  \n///   * Code optimizations are modified\n///   * Symbol resolution improves\n/// \n/// - Use GenerateBaseline_ForTestCase to update baselines after intentional changes\n/// - Review baseline diffs carefully to ensure changes are expected\n/// </summary>\n[TestClass]\npublic class EndToEndWorkflowTests {\n  \n  /// <summary>\n  /// List of test cases to run. Add new test case names here to include them in testing.\n  /// Each test case should have corresponding directories in TestData/Traces/, TestData/Binaries/, and TestData/Symbols/.\n  /// \n  /// The test infrastructure validates multiple types of baselines:\n  /// - Process baselines: CPU usage and process information\n  /// - Module baselines: Time spent per module/DLL\n  /// - Function baselines: Performance data per function\n  /// - Assembly baselines: Assembly/disassembly text for specific binary-function pairs\n  /// \n  /// Assembly baselines are configured in TestCaseAssemblyBaselines and only generated for explicitly\n  /// specified (binary, function) pairs to avoid creating excessive baseline files.\n  /// </summary>\n  private static readonly List<string> TestCases = new List<string> {\n    \"MsoTrace\"\n    // Add new test case names here, e.g.:\n    // \"WebBrowserTrace\",\n    // \"GameEngineTrace\",\n    // \"DatabaseTrace\"\n  };\n\n  /// <summary>\n  /// Optional: Process IDs for each test case. If not specified, the test will show available processes.\n  /// </summary>\n  private static readonly Dictionary<string, int> TestCaseProcessIds = new Dictionary<string, int> {\n    { \"MsoTrace\", 34376 }\n    // Add process IDs for specific test cases if known, e.g.:\n    // { \"WebBrowserTrace\", 12345 },\n    // { \"GameEngineTrace\", 67890 }\n  };\n\n  /// <summary>\n  /// Configuration for assembly baseline generation. Each test case maps to a list of (binary name, function name) pairs\n  /// for which assembly/disassembly text should be retrieved and baselined.\n  /// \n  /// To add assembly baselines for a new test case:\n  /// 1. Add the test case name as a key in this dictionary\n  /// 2. Provide a list of (binary, function) tuples for the functions you want to baseline\n  /// 3. Run the GenerateBaseline test to create the baseline CSV files\n  /// 4. The test will create assembly_<binary>.csv files in the TestData/<testcase>/ directory\n  /// \n  /// Example:\n  /// { \"MyTestCase\", new List<(string, string)> {\n  ///     (\"MyApp.exe\", \"main\"),\n  ///     (\"MyLibrary.dll\", \"ImportantFunction\"),\n  ///     (\"MyLibrary.dll\", \"AnotherFunction\")\n  ///   }\n  /// }\n  /// </summary>\n  private static readonly Dictionary<string, List<(string binaryName, string functionName)>> TestCaseAssemblyBaselines = \n    new Dictionary<string, List<(string, string)>> {\n      { \"MsoTrace\", new List<(string, string)> {\n          (\"Mso20win32client.dll\", \"Mso::Experiment::EcsNS::Private::SortByParameterGroups\")\n          // Add more (binary, function) pairs here as needed:\n          // (\"Mso20win32client.dll\", \"AnotherFunction\"),\n          // (\"OtherBinary.dll\", \"SomeFunction\")\n        }\n      }\n      // Add assembly baseline configurations for other test cases here, e.g.:\n      // { \"WebBrowserTrace\", new List<(string, string)> {\n      //     (\"browser.exe\", \"RenderPage\"),\n      //     (\"engine.dll\", \"ProcessHTML\")\n      //   }\n      // }\n    };\n\n  /// <summary>\n  /// Data structure representing a process baseline entry\n  /// </summary>\n  public class ProcessBaselineEntry {\n    public string Name { get; set; }\n    public double WeightPercentage { get; set; }\n    public double DurationMs { get; set; }\n    public int ProcessId { get; set; }\n    public string CommandLine { get; set; }\n  }\n\n  /// <summary>\n  /// Data structure representing a module baseline entry\n  /// </summary>\n  public class ModuleBaselineEntry {\n    public string Name { get; set; }\n    public double WeightPercentage { get; set; }\n    public double TimeMs { get; set; }\n  }\n\n  /// <summary>\n  /// Data structure representing a function baseline entry\n  /// </summary>\n  public class FunctionBaselineEntry {\n    public string Name { get; set; }\n    public string Address { get; set; }\n    public string Module { get; set; }\n    public double SelfTimePercentage { get; set; }\n    public double SelfTimeMs { get; set; }\n    public double TotalTimePercentage { get; set; }\n    public double TotalTimeMs { get; set; }\n  }\n\n  /// <summary>\n  /// Data structure representing an assembly baseline entry for a specific binary and function pair.\n  /// Contains the assembly/disassembly text that should be consistent across test runs.\n  /// </summary>\n  public class AssemblyBaselineEntry {\n    public string BinaryName { get; set; }\n    public string FunctionName { get; set; }\n    public string AssemblyText { get; set; }\n  }\n\n  [DataTestMethod]\n  [DynamicData(nameof(GetTestCaseData), DynamicDataSourceType.Method)]\n  public async Task TestEndToEndWorkflow_ForTestCase(string testCaseName) {\n    Console.WriteLine($\"\\n=== Running End-to-End Workflow Test for: {testCaseName} ===\");\n    \n    // Execute common workflow steps\n    var (processBaselineData, moduleBaselineData, functionBaselineData, assemblyBaselineData) = await ExecuteCommonWorkflowSteps(testCaseName);\n\n    // Step 7: Compare with baselines\n    Console.WriteLine($\"\\n=== Step 7: Baseline Validation ===\");\n    \n    var baselineDir = GetBaselineDirectory(testCaseName);\n    var processBaselinePath = Path.Combine(baselineDir, \"processes_baseline.csv\");\n    var moduleBaselinePath = Path.Combine(baselineDir, \"modules_baseline.csv\");\n\n    bool baselinesExist = File.Exists(processBaselinePath) && \n                          File.Exists(moduleBaselinePath);\n\n    // Check if function baseline files exist for all modules\n    if (baselinesExist) {\n      foreach (var moduleName in functionBaselineData.Keys) {\n        var functionBaselinePath = Path.Combine(baselineDir, $\"functions_{SanitizeFileName(moduleName)}_baseline.csv\");\n        if (!File.Exists(functionBaselinePath)) {\n          baselinesExist = false;\n          break;\n        }\n      }\n    }\n\n    // Check if assembly baseline files exist for all binaries\n    if (baselinesExist) {\n      foreach (var binaryName in assemblyBaselineData.Keys) {\n        var assemblyBaselinePath = Path.Combine(baselineDir, $\"assembly_{SanitizeFileName(binaryName)}_baseline.csv\");\n        if (!File.Exists(assemblyBaselinePath)) {\n          baselinesExist = false;\n          break;\n        }\n      }\n    }\n\n    if (baselinesExist) {\n      // Save current results to temporary CSV files in system temp directory\n      var tempDir = Path.Combine(Path.GetTempPath(), \"ProfileExplorerTests\", $\"Baseline_{testCaseName}_{Guid.NewGuid():N}\");\n      Directory.CreateDirectory(tempDir);\n      \n      try {\n        var currentProcessFile = Path.Combine(tempDir, \"processes_baseline.csv\");\n        var currentModulesFile = Path.Combine(tempDir, \"modules_baseline.csv\");\n        \n        SaveProcessBaseline(processBaselineData, currentProcessFile);\n        SaveModuleBaseline(moduleBaselineData, currentModulesFile);\n\n        // Save function baselines grouped by module\n        foreach (var moduleGroup in functionBaselineData) {\n          var currentFunctionFile = Path.Combine(tempDir, $\"functions_{SanitizeFileName(moduleGroup.Key)}_baseline.csv\");\n          SaveFunctionBaseline(moduleGroup.Value, currentFunctionFile);\n        }\n\n        // Save assembly baselines grouped by binary\n        foreach (var binaryGroup in assemblyBaselineData) {\n          var currentAssemblyFile = Path.Combine(tempDir, $\"assembly_{SanitizeFileName(binaryGroup.Key)}_baseline.csv\");\n          SaveAssemblyBaseline(binaryGroup.Value, currentAssemblyFile);\n        }\n\n        // Compare CSV files directly\n        CompareBaselineFiles(baselineDir, tempDir, testCaseName);\n        \n        Console.WriteLine($\"✓ All baselines match for test case '{testCaseName}'\");\n      } finally {\n        // Clean up temporary files\n        if (Directory.Exists(tempDir)) {\n          Directory.Delete(tempDir, true);\n        }\n      }\n    } else {\n      Assert.Inconclusive($\"Baselines not found for test case '{testCaseName}'. Run the GenerateBaseline test first to create them.\");\n    }\n\n    Console.WriteLine($\"\\n✓ Workflow completed successfully for test case '{testCaseName}'\");\n  }\n\n  /// <summary>\n  /// Test method to generate or regenerate baseline CSV files for a test case.\n  /// This should be run whenever you need to create new baselines or update existing ones.\n  /// </summary>\n  [Ignore] // Remove to save baselines\n  [DataTestMethod]\n  [DynamicData(nameof(GetTestCaseData), DynamicDataSourceType.Method)]\n  public async Task GenerateBaseline_ForTestCase(string testCaseName) {\n    Console.WriteLine($\"\\n=== Generating Baselines for: {testCaseName} ===\");\n    \n    // Execute common workflow steps\n    var (processBaselineData, moduleBaselineData, functionBaselineData, assemblyBaselineData) = await ExecuteCommonWorkflowSteps(testCaseName);\n\n    // Step 7: Save baselines to TestData folder\n    Console.WriteLine($\"\\n=== Step 7: Saving Baselines ===\");\n    \n    var baselineDir = GetBaselineDirectory(testCaseName);\n    Directory.CreateDirectory(baselineDir);\n\n    var processBaselinePath = Path.Combine(baselineDir, \"processes_baseline.csv\");\n    var moduleBaselinePath = Path.Combine(baselineDir, \"modules_baseline.csv\");\n\n    SaveProcessBaseline(processBaselineData, processBaselinePath);\n    SaveModuleBaseline(moduleBaselineData, moduleBaselinePath);\n\n    // Save function baselines for each module\n    var totalFunctions = 0;\n    foreach (var moduleEntry in functionBaselineData) {\n      var moduleName = moduleEntry.Key;\n      var functions = moduleEntry.Value;\n      var functionBaselinePath = Path.Combine(baselineDir, $\"functions_{SanitizeFileName(moduleName)}_baseline.csv\");\n      SaveFunctionBaseline(functions, functionBaselinePath);\n      totalFunctions += functions.Count;\n      Console.WriteLine($\"  - Functions for {moduleName}: {functions.Count} entries -> {functionBaselinePath}\");\n    }\n\n    // Save assembly baselines for each binary\n    var totalAssemblyFunctions = 0;\n    foreach (var binaryEntry in assemblyBaselineData) {\n      var binaryName = binaryEntry.Key;\n      var assemblyFunctions = binaryEntry.Value;\n      var assemblyBaselinePath = Path.Combine(baselineDir, $\"assembly_{SanitizeFileName(binaryName)}_baseline.csv\");\n      SaveAssemblyBaseline(assemblyFunctions, assemblyBaselinePath);\n      totalAssemblyFunctions += assemblyFunctions.Count;\n      Console.WriteLine($\"  - Assembly for {binaryName}: {assemblyFunctions.Count} functions -> {assemblyBaselinePath}\");\n    }\n\n    Console.WriteLine($\"✓ Baselines saved to TestData folder for test case '{testCaseName}'\");\n    Console.WriteLine($\"  - Processes: {processBaselineData.Count} entries -> {processBaselinePath}\");\n    Console.WriteLine($\"  - Modules: {moduleBaselineData.Count} entries -> {moduleBaselinePath}\");\n    Console.WriteLine($\"  - Functions: {totalFunctions} entries across {functionBaselineData.Count} modules\");\n    Console.WriteLine($\"  - Assembly: {totalAssemblyFunctions} functions across {assemblyBaselineData.Count} binaries\");\n    Console.WriteLine($\"\\n✓ Baseline generation completed successfully for test case '{testCaseName}'\");\n  }\n\n  /// <summary>\n  /// Executes the common workflow steps (1-5) shared by both test methods\n  /// </summary>\n  private async Task<(List<ProcessBaselineEntry> processBaselineData, List<ModuleBaselineEntry> moduleBaselineData, Dictionary<string, List<FunctionBaselineEntry>> functionBaselineData, Dictionary<string, List<AssemblyBaselineEntry>> assemblyBaselineData)> ExecuteCommonWorkflowSteps(string testCaseName) {\n    // Get test case information\n    var testCase = TestDataHelper.GetTestCase(testCaseName);\n    \n    if (!testCase.IsValid) {\n      Assert.Inconclusive($\"Test case '{testCaseName}' is not valid:\\n{testCase.GetSummary()}\");\n    }\n\n    var options = new ProfileDataProviderOptions();\n    var cancelableTask = new CancelableTask();\n\n    // Step 1: Load list of processes from trace\n    Console.WriteLine(\"=== Step 1: Loading process list from trace ===\");\n    \n    var processList = await ETWProfileDataProvider.FindTraceProcesses(\n      testCase.TracePath, \n      options, \n      progress => {\n        Console.WriteLine($\"Process discovery: {progress.Current}/{progress.Total}\");\n      }, \n      cancelableTask);\n\n    Assert.IsNotNull(processList, \"Failed to load process list from trace\");\n    Assert.IsTrue(processList.Count > 0, \"No processes found in trace\");\n\n    // Extract process baseline data\n    var processBaselineData = ExtractProcessBaselineData(processList);\n\n    // Determine target process ID\n    int targetProcessId;\n    if (TestCaseProcessIds.TryGetValue(testCaseName, out targetProcessId)) {\n      var targetProcess = processList.FirstOrDefault(p => p.Process.ProcessId == targetProcessId);\n      if (targetProcess == null) {\n        Console.WriteLine($\"WARNING: Configured process ID {targetProcessId} not found in trace.\");\n        Console.WriteLine($\"Available process IDs: {string.Join(\", \", processList.Select(p => p.Process.ProcessId))}\");\n        Assert.Inconclusive($\"Target process ID {targetProcessId} not found in trace for test case '{testCaseName}'\");\n      }\n    } else {\n      // Use the process with the highest weight\n      var sortedProcesses = processList.OrderByDescending(p => p.Weight).ToList();\n      targetProcessId = sortedProcesses.First().Process.ProcessId;\n      Console.WriteLine($\"No specific process ID configured for '{testCaseName}', using process with highest weight: {targetProcessId}\");\n    }\n\n    // Step 2: Configure symbol settings\n    Console.WriteLine($\"\\n=== Step 2: Configuring symbol settings ===\");\n    \n    var symbolSettings = new SymbolFileSourceSettings();\n    symbolSettings.SymbolPaths.Clear(); // Clear any default paths\n    symbolSettings.InsertSymbolPath(testCase.BinariesPath); // Add our binaries directory\n    symbolSettings.InsertSymbolPath(testCase.SymbolsPath); // Add our symbols directory\n    symbolSettings.SourceServerEnabled = false; // Disable symbol servers\n    symbolSettings.UseEnvironmentVarSymbolPaths = false; // Disable environment symbol paths\n    \n    Console.WriteLine($\"Symbol paths configured: {string.Join(\"; \", symbolSettings.SymbolPaths)}\");\n    Console.WriteLine($\"Available PDB files: {testCase.PdbFiles.Count}\");\n    foreach (var pdb in testCase.PdbFiles) {\n      Console.WriteLine($\"  - {Path.GetFileName(pdb)}\");\n    }\n\n    // Step 3: Load trace data for the target process\n    Console.WriteLine($\"\\n=== Step 3: Loading trace data for process {targetProcessId} ===\");\n\n  var session = new BaseSession();\n  var processIds = new List<int> { targetProcessId };\n  var report = new ProfileDataReport();\n\n  bool loadResult = await session.LoadProfileData(\n      testCase.TracePath, \n      processIds, \n      options, \n      symbolSettings, \n      report, \n      progress => {\n        Console.WriteLine($\"Data processing: {progress.Stage} - {progress.Current}/{progress.Total} {progress.Optional}\");\n      }, \n      cancelableTask);\n\n    Assert.IsTrue(loadResult, \"Failed to load profile data\");\n    \n    var profileData = session.ProfileData;\n    Assert.IsNotNull(profileData, \"Profile data is null after successful load\");\n    Console.WriteLine(\"Data processing completed successfully\");\n\n    // Step 4: Get module baseline data\n    Console.WriteLine($\"\\n=== Step 4: Extracting Module Information ===\");\n    var moduleBaselineData = ExtractModuleBaselineData(profileData);\n\n    // Step 5: Get function baseline data\n    Console.WriteLine($\"\\n=== Step 5: Extracting Function Information ===\");\n    var functionBaselineData = ExtractFunctionBaselineData(profileData);\n\n    // Step 6: Get assembly baseline data\n    Console.WriteLine($\"\\n=== Step 6: Extracting Assembly Information ===\");\n    var assemblyBaselineData = await ExtractAssemblyBaselineData(session, testCaseName);\n\n    return (processBaselineData, moduleBaselineData, functionBaselineData, assemblyBaselineData);\n  }\n\n  /// <summary>\n  /// Gets the baseline directory path in the source TestData folder\n  /// </summary>\n  private string GetBaselineDirectory(string testCaseName) {\n    // Get the source TestData directory, not the runtime one\n    var testProjectDir = Path.GetDirectoryName(typeof(EndToEndWorkflowTests).Assembly.Location);\n    var sourceTestDataDir = Path.GetFullPath(Path.Combine(testProjectDir!, \"..\", \"..\", \"..\", \"TestData\"));\n    return Path.Combine(sourceTestDataDir, testCaseName);\n  }\n\n  /// <summary>\n  /// Sanitizes a filename by removing invalid characters\n  /// </summary>\n  private string SanitizeFileName(string fileName) {\n    var invalidChars = Path.GetInvalidFileNameChars();\n    return string.Join(\"_\", fileName.Split(invalidChars, StringSplitOptions.RemoveEmptyEntries));\n  }\n\n  /// <summary>\n  /// Extracts process baseline data from the process list\n  /// </summary>\n  private List<ProcessBaselineEntry> ExtractProcessBaselineData(List<ProcessSummary> processList) {\n    var sortedProcesses = processList.OrderByDescending(p => p.Weight).ToList();\n    var baselineData = new List<ProcessBaselineEntry>();\n\n    foreach (var process in sortedProcesses) {\n      baselineData.Add(new ProcessBaselineEntry {\n        Name = process.Process.Name ?? \"Unknown\",\n        WeightPercentage = process.WeightPercentage,\n        DurationMs = process.Duration.TotalMilliseconds,\n        ProcessId = process.Process.ProcessId,\n        CommandLine = process.Process.CommandLine ?? \"N/A\"\n      });\n    }\n\n    return baselineData;\n  }\n\n  /// <summary>\n  /// Extracts module baseline data from the profile data\n  /// </summary>\n  private List<ModuleBaselineEntry> ExtractModuleBaselineData(ProfileData profileData) {\n    var moduleInfoList = new List<ModuleBaselineEntry>();\n\n    foreach (var moduleKvp in profileData.Modules) {\n      var moduleId = moduleKvp.Key;\n      var module = moduleKvp.Value;\n      var moduleName = module.ModuleName ?? $\"Module_{moduleId}\";\n\n      // Get weight for this module\n      TimeSpan moduleWeight = TimeSpan.Zero;\n      if (profileData.ModuleWeights.TryGetValue(moduleId, out var weight)) {\n        moduleWeight = weight;\n      }\n\n      // Skip modules with zero time\n      if (moduleWeight.TotalMilliseconds <= 0) {\n        continue;\n      }\n\n      // Calculate percentage\n      double weightPercentage = profileData.ScaleModuleWeight(moduleWeight) * 100;\n      double timeMs = moduleWeight.TotalMilliseconds;\n\n      moduleInfoList.Add(new ModuleBaselineEntry {\n        Name = moduleName,\n        WeightPercentage = weightPercentage,\n        TimeMs = timeMs\n      });\n    }\n\n    // Sort by descending weight percentage\n    return moduleInfoList.OrderByDescending(m => m.WeightPercentage).ToList();\n  }\n\n  /// <summary>\n  /// Extracts function baseline data from the profile data using call tree, grouped by module\n  /// </summary>\n  private Dictionary<string, List<FunctionBaselineEntry>> ExtractFunctionBaselineData(ProfileData profileData) {\n    var functionsByModule = new Dictionary<string, List<FunctionBaselineEntry>>();\n    \n    if (profileData.CallTree == null) {\n      return functionsByModule;\n    }\n\n    // Get all functions from the call tree by collecting from all root nodes\n    var allFunctionNodes = new List<ProfileCallTreeNode>();\n    foreach (var rootNode in profileData.CallTree.RootNodes) {\n      var functions = profileData.CallTree.GetTopFunctions(rootNode);\n      allFunctionNodes.AddRange(functions);\n    }\n    \n    // Group by function to avoid duplicates and combine weights\n    var functionGroups = allFunctionNodes\n      .GroupBy(node => node.Function)\n      .ToList();\n    \n    foreach (var group in functionGroups) {\n      var function = group.Key;\n      if (function == null) continue;\n\n      // Sum up weights from all instances of this function\n      var totalWeight = TimeSpan.Zero;\n      var totalExclusiveWeight = TimeSpan.Zero;\n      var firstNode = group.First();\n      \n      foreach (var node in group) {\n        totalWeight += node.Weight;\n        totalExclusiveWeight += node.ExclusiveWeight;\n      }\n\n      // Skip functions with zero self time\n      if (totalExclusiveWeight.TotalMilliseconds <= 0) {\n        continue;\n      }\n\n      // Calculate percentages\n      double selfTimePercentage = profileData.ScaleFunctionWeight(totalExclusiveWeight) * 100;\n      double totalTimePercentage = profileData.ScaleFunctionWeight(totalWeight) * 100;\n      \n      var functionEntry = new FunctionBaselineEntry {\n        Name = function.Name ?? \"Unknown\",\n        Address = firstNode.FunctionDebugInfo?.RVA.ToString(\"X\") ?? \"Unknown\",\n        Module = function.ModuleName ?? \"Unknown\",\n        SelfTimePercentage = selfTimePercentage,\n        SelfTimeMs = totalExclusiveWeight.TotalMilliseconds,\n        TotalTimePercentage = totalTimePercentage,\n        TotalTimeMs = totalWeight.TotalMilliseconds\n      };\n\n      // Group by module\n      var moduleName = functionEntry.Module;\n      if (!functionsByModule.ContainsKey(moduleName)) {\n        functionsByModule[moduleName] = new List<FunctionBaselineEntry>();\n      }\n      functionsByModule[moduleName].Add(functionEntry);\n    }\n\n    // Sort functions within each module by descending self time percentage\n    foreach (var moduleEntry in functionsByModule) {\n      moduleEntry.Value.Sort((a, b) => b.SelfTimePercentage.CompareTo(a.SelfTimePercentage));\n    }\n\n    return functionsByModule;\n  }\n\n  /// <summary>\n  /// Extracts assembly baseline data for configured binary and function pairs from the session.\n  /// Returns a dictionary grouped by binary name, where each entry contains the assembly text for functions in that binary.\n  /// </summary>\n  private async Task<Dictionary<string, List<AssemblyBaselineEntry>>> ExtractAssemblyBaselineData(ISession session, string testCaseName) {\n    var assemblyByBinary = new Dictionary<string, List<AssemblyBaselineEntry>>();\n    \n    // Check if this test case has assembly baseline configuration\n    if (!TestCaseAssemblyBaselines.TryGetValue(testCaseName, out var binaryFunctionPairs)) {\n      Console.WriteLine($\"No assembly baseline configuration found for test case '{testCaseName}'\");\n      return assemblyByBinary;\n    }\n\n    Console.WriteLine($\"Processing {binaryFunctionPairs.Count} assembly baseline pairs for test case '{testCaseName}'\");\n\n    foreach (var (binaryName, functionName) in binaryFunctionPairs) {\n      Console.WriteLine($\"  - Retrieving assembly for {binaryName}::{functionName}\");\n      \n      try {\n        var section = await GetSectionForFunction(session, binaryName, functionName);\n        if (section == null) {\n          Console.WriteLine($\"    WARNING: Could not find section for {binaryName}::{functionName}\");\n          continue;\n        }\n\n        var parsedSection = await session.LoadAndParseSection(section);\n        if (parsedSection?.Text == null) {\n          Console.WriteLine($\"    WARNING: Could not parse section or get assembly text for {binaryName}::{functionName}\");\n          continue;\n        }\n\n        var assemblyEntry = new AssemblyBaselineEntry {\n          BinaryName = binaryName,\n          FunctionName = functionName,\n          AssemblyText = parsedSection.Text.ToString()\n        };\n\n        // Group by binary\n        if (!assemblyByBinary.ContainsKey(binaryName)) {\n          assemblyByBinary[binaryName] = new List<AssemblyBaselineEntry>();\n        }\n        assemblyByBinary[binaryName].Add(assemblyEntry);\n        \n        Console.WriteLine($\"    ✓ Retrieved {parsedSection.Text.Length} characters of assembly text\");\n      }\n      catch (Exception ex) {\n        Console.WriteLine($\"    ERROR: Failed to retrieve assembly for {binaryName}::{functionName}: {ex.Message}\");\n        // Continue processing other pairs instead of failing the entire test\n      }\n    }\n\n    // Sort functions within each binary alphabetically for consistent ordering\n    foreach (var binaryEntry in assemblyByBinary) {\n      binaryEntry.Value.Sort((a, b) => string.Compare(a.FunctionName, b.FunctionName, StringComparison.OrdinalIgnoreCase));\n    }\n\n    Console.WriteLine($\"Successfully extracted assembly data for {assemblyByBinary.Values.Sum(list => list.Count)} functions across {assemblyByBinary.Count} binaries\");\n    return assemblyByBinary;\n  }\n\n  /// <summary>\n  /// Saves process baseline data to CSV file\n  /// </summary>\n  private void SaveProcessBaseline(List<ProcessBaselineEntry> data, string filePath) {\n    var csv = new StringBuilder();\n    csv.AppendLine(\"Name,WeightPercentage,DurationMs,ProcessId,CommandLine\");\n    \n    foreach (var entry in data.OrderByDescending(x => x.WeightPercentage).ThenBy(x => x.Name)) {\n      csv.AppendLine($\"\\\"{EscapeCsvValue(entry.Name)}\\\",\" +\n                     $\"{entry.WeightPercentage.ToString(\"F4\", CultureInfo.InvariantCulture)},\" +\n                     $\"{entry.DurationMs.ToString(\"F4\", CultureInfo.InvariantCulture)},\" +\n                     $\"{entry.ProcessId},\" +\n                     $\"\\\"{EscapeCsvValue(entry.CommandLine)}\\\"\");\n    }\n    \n    File.WriteAllText(filePath, csv.ToString());\n  }\n\n  /// <summary>\n  /// Saves module baseline data to CSV file\n  /// </summary>\n  private void SaveModuleBaseline(List<ModuleBaselineEntry> data, string filePath) {\n    var csv = new StringBuilder();\n    csv.AppendLine(\"Name,WeightPercentage,TimeMs\");\n    \n    foreach (var entry in data.OrderByDescending(x => x.TimeMs).ThenBy(x => x.Name)) {\n      csv.AppendLine($\"\\\"{EscapeCsvValue(entry.Name)}\\\",\" +\n                     $\"{entry.WeightPercentage.ToString(\"F4\", CultureInfo.InvariantCulture)},\" +\n                     $\"{entry.TimeMs.ToString(\"F4\", CultureInfo.InvariantCulture)}\");\n    }\n    \n    File.WriteAllText(filePath, csv.ToString());\n  }\n\n  /// <summary>\n  /// Saves function baseline data to CSV file\n  /// </summary>\n  private void SaveFunctionBaseline(List<FunctionBaselineEntry> data, string filePath) {\n    var csv = new StringBuilder();\n    csv.AppendLine(\"Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\");\n    \n    foreach (var entry in data.OrderByDescending(x => x.SelfTimeMs).ThenBy(x => x.Name)) {\n      csv.AppendLine($\"\\\"{EscapeCsvValue(entry.Name)}\\\",\" +\n                     $\"\\\"{EscapeCsvValue(entry.Address)}\\\",\" +\n                     $\"\\\"{EscapeCsvValue(entry.Module)}\\\",\" +\n                     $\"{entry.SelfTimePercentage.ToString(\"F4\", CultureInfo.InvariantCulture)},\" +\n                     $\"{entry.SelfTimeMs.ToString(\"F4\", CultureInfo.InvariantCulture)},\" +\n                     $\"{entry.TotalTimePercentage.ToString(\"F4\", CultureInfo.InvariantCulture)},\" +\n                     $\"{entry.TotalTimeMs.ToString(\"F4\", CultureInfo.InvariantCulture)}\");\n    }\n    \n    File.WriteAllText(filePath, csv.ToString());\n  }\n\n  /// <summary>\n  /// Saves assembly baseline data to CSV file for a specific binary.\n  /// Each row contains the function name and its complete assembly/disassembly text.\n  /// </summary>\n  private void SaveAssemblyBaseline(List<AssemblyBaselineEntry> data, string filePath) {\n    var csv = new StringBuilder();\n    csv.AppendLine(\"FunctionName,AssemblyText\");\n    \n    foreach (var entry in data.OrderBy(x => x.FunctionName)) {\n      csv.AppendLine($\"\\\"{EscapeCsvValue(entry.FunctionName)}\\\",\" +\n                     $\"\\\"{EscapeCsvValue(entry.AssemblyText)}\\\"\");\n    }\n    \n    File.WriteAllText(filePath, csv.ToString());\n  }\n\n  /// <summary>\n  /// Loads assembly baseline data from CSV file for debugging or manual inspection purposes.\n  /// </summary>\n  private List<AssemblyBaselineEntry> LoadAssemblyBaseline(string filePath, string binaryName) {\n    var entries = new List<AssemblyBaselineEntry>();\n    \n    if (!File.Exists(filePath)) {\n      return entries;\n    }\n\n    var lines = File.ReadAllLines(filePath);\n    if (lines.Length <= 1) { // Skip header or empty files\n      return entries;\n    }\n\n    for (int i = 1; i < lines.Length; i++) { // Skip header line\n      var line = lines[i];\n      if (string.IsNullOrWhiteSpace(line)) continue;\n\n      // Simple CSV parsing - assumes properly escaped values\n      var parts = ParseCsvLine(line);\n      if (parts.Count >= 2) {\n        entries.Add(new AssemblyBaselineEntry {\n          BinaryName = binaryName,\n          FunctionName = UnescapeCsvValue(parts[0]),\n          AssemblyText = UnescapeCsvValue(parts[1])\n        });\n      }\n    }\n\n    return entries;\n  }\n\n  /// <summary>\n  /// Simple CSV line parser that handles quoted values\n  /// </summary>\n  private List<string> ParseCsvLine(string line) {\n    var parts = new List<string>();\n    var current = new StringBuilder();\n    bool inQuotes = false;\n    \n    for (int i = 0; i < line.Length; i++) {\n      char c = line[i];\n      \n      if (c == '\"') {\n        if (inQuotes && i + 1 < line.Length && line[i + 1] == '\"') {\n          // Double quote escape\n          current.Append('\"');\n          i++; // Skip next quote\n        } else {\n          inQuotes = !inQuotes;\n        }\n      } else if (c == ',' && !inQuotes) {\n        parts.Add(current.ToString());\n        current.Clear();\n      } else {\n        current.Append(c);\n      }\n    }\n    \n    parts.Add(current.ToString());\n    return parts;\n  }\n\n  /// <summary>\n  /// Unescapes CSV values by handling double quotes\n  /// </summary>\n  private string UnescapeCsvValue(string value) {\n    if (string.IsNullOrEmpty(value)) return \"\";\n    return value.Replace(\"\\\"\\\"\", \"\\\"\");\n  }\n\n  /// <summary>\n  /// Compares current process data with baseline\n  /// </summary>\n  private void CompareBaselineFiles(string baselineDir, string tempDir, string testCaseName) {\n    // Get all baseline CSV files\n    var baselineFiles = Directory.GetFiles(baselineDir, \"*_baseline.csv\");\n    \n    foreach (var baselineFile in baselineFiles) {\n      var fileName = Path.GetFileName(baselineFile);\n      var currentFile = Path.Combine(tempDir, fileName);\n      \n      if (!File.Exists(currentFile)) {\n        Assert.Fail($\"Current results file not found: {fileName}\");\n      }\n      \n      var baselineContent = File.ReadAllText(baselineFile);\n      var currentContent = File.ReadAllText(currentFile);\n      \n      if (baselineContent != currentContent) {\n        var fileType = GetFileTypeFromName(fileName);\n        Assert.Fail($\"Baseline mismatch in {fileType} for test case '{testCaseName}'. \" +\n                   $\"File: {fileName}\\n\" +\n                   $\"Expected content length: {baselineContent.Length}\\n\" +\n                   $\"Actual content length: {currentContent.Length}\\n\" +\n                   $\"First difference at character: {FindFirstDifference(baselineContent, currentContent)}\");\n      }\n    }\n  }\n\n  private async Task<IRTextSection> GetSectionForFunction(ISession session, string targetModuleName, string targetFunctionName) {\n    // Assume you have: string targetModuleName, string targetFunctionName\n    // And you have loaded: List<IRTextSummary> summaries (one per module/binary)\n\n    List<IRTextSummary> summaries = session.Documents\n      .Select(doc => doc.Summary)\n      .Where(summary => summary != null)\n      .ToList();\n\n    foreach (var summary in summaries) {\n      // Match the module/binary name (case-insensitive)\n      if (!string.Equals(summary.ModuleName, targetModuleName, StringComparison.OrdinalIgnoreCase))\n        continue;\n\n      // Find the function by name (case-insensitive, adjust matching as needed)\n      var function = summary.Functions\n          .FirstOrDefault(f => session.CompilerInfo.NameProvider.FormatFunctionName(f).Contains(targetFunctionName));\n\n      if (function != null && function.SectionCount > 0) {\n        // Use the first section (or select a specific one if needed)\n        return function.Sections[0];\n      }\n    }\n\n    return null;\n  }\n\n  private string GetFileTypeFromName(string fileName) {\n    if (fileName.StartsWith(\"processes_\")) return \"processes\";\n    if (fileName.StartsWith(\"modules_\")) return \"modules\";\n    if (fileName.StartsWith(\"functions_\")) return \"functions\";\n    if (fileName.StartsWith(\"assembly_\")) return \"assembly\";\n    return \"unknown\";\n  }\n  \n  private int FindFirstDifference(string expected, string actual) {\n    int minLength = Math.Min(expected.Length, actual.Length);\n    for (int i = 0; i < minLength; i++) {\n      if (expected[i] != actual[i]) {\n        return i;\n      }\n    }\n    return minLength; // Difference is in length\n  }\n\n  /// <summary>\n  /// Helper method to escape CSV values\n  /// </summary>\n  private string EscapeCsvValue(string value) {\n    if (string.IsNullOrEmpty(value)) return \"\";\n    return value.Replace(\"\\\"\", \"\\\"\\\"\");\n  }\n\n  /// <summary>\n  /// Provides test case data for parameterized tests.\n  /// </summary>\n  /// <returns>Test case data for MSTest DataTestMethod</returns>\n  public static IEnumerable<object[]> GetTestCaseData() {\n    foreach (var testCase in TestCases) {\n      yield return new object[] { testCase };\n    }\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/ExtensionMethodsTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.CoreTests;\n\n[TestClass]\npublic class ExtensionMethodsTests {\n  [TestMethod]\n  public void CountLines_EmptyString_ReturnsZero() {\n    string emptyString = \"\";\n    int result = emptyString.CountLines();\n    Assert.AreEqual(0, result);\n  }\n\n  [TestMethod]\n  public void CountLines_SingleLineString_ReturnsOne() {\n    string singleLineString = \"This is a single line.\";\n    int result = singleLineString.CountLines();\n    Assert.AreEqual(1, result);\n  }\n\n  [TestMethod]\n  public void CountLines_MultiLineString_ReturnsCorrectCount() {\n    string multiLineString = \"Line 1\\nLine 2\\nLine 3\";\n    int result = multiLineString.CountLines();\n    Assert.AreEqual(3, result);\n  }\n\n  [TestMethod]\n  public void CountLines_MultiLineString_ReturnsCorrectCount2() {\n    string multiLineString = \"Line 1\\r\\nLine 2\\nLine 3\\rLine4\";\n    int result = multiLineString.CountLines();\n    Assert.AreEqual(4, result);\n  }\n\n  [TestMethod]\n  public void CountLines_MultiLineString_ReturnsCorrectCount3() {\n    string multiLineString = \"Line 1\\r\\nLine 2\\nLine 3\\r\\nLine4\";\n    int result = multiLineString.CountLines();\n    Assert.AreEqual(4, result);\n  }\n\n  [TestMethod]\n  public void CountLines_MultiLineString_ReturnsCorrectCount4() {\n    string multiLineString = \"Line 1\\r\\nLine 2\\nLine 3\\rLine4\\n\\rLine6\";\n    int result = multiLineString.CountLines();\n    Assert.AreEqual(6, result);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/FileFormat/FileArchiveTest.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core.FileFormat;\n\nnamespace ProfileExplorer.CoreTests.FileFormat;\n\n[TestClass]\npublic class FileArchiveTest {\n  private const string InPath = @\"testFiles\";\n  private const string OutPath = @\"outTestFiles\";\n  private const string ResultPath = @\"resultTestFiles\";\n\n  [TestInitialize]\n  public void Initialize() {\n    Directory.CreateDirectory(InPath);\n    Directory.CreateDirectory(OutPath);\n    Directory.CreateDirectory(ResultPath);\n  }\n\n  [TestCleanup]\n  public void Cleanup() {\n    RecursiveDelete(new DirectoryInfo(InPath));\n    RecursiveDelete(new DirectoryInfo(OutPath));\n    RecursiveDelete(new DirectoryInfo(ResultPath));\n  }\n\n  [TestMethod]\n  public async Task TestCreateAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.SaveAsync());\n\n    Assert.IsTrue(File.Exists(path));\n    Assert.IsTrue(new FileInfo(path).Length > 0);\n  }\n\n  [TestMethod]\n  public async Task TestAddFileAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddFileAsync(file1));\n    Assert.IsTrue(await archive.AddFileAsync(file2));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsTrue(AreFilesEqual(file1, $@\"{OutPath}\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\file2.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestAddFileStreamAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    var stream = CreateTestStream(1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddFileStreamAsync(stream, @\"file1.txt\"));\n    Assert.IsTrue(await archive.AddFileAsync(file2));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsTrue(AreFilesEqual(stream, $@\"{OutPath}\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\file2.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestAddDirectoryAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddDirectoryAsync(InPath));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsTrue(AreFilesEqual(file1, $@\"{OutPath}\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\file2.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestAddDirectoryWithSubdirsAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n\n    Directory.CreateDirectory($@\"{InPath}\\subdir\");\n    string file1 = CreateTestFile($@\"{InPath}\\subdir\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\subdir\\file2.txt\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.txt\", 1023);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddDirectoryAsync(InPath, true, searchPattern: \"*\", optionalDirectory: \"clientSubdir\"));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsTrue(AreFilesEqual(file1, $@\"{OutPath}\\clientSubdir\\subdir\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\clientSubdir\\subdir\\file2.txt\"));\n    Assert.IsTrue(AreFilesEqual(file3, $@\"{OutPath}\\clientSubdir\\file3.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestAddDirectoryWithoutSubdirsAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n\n    Directory.CreateDirectory($@\"{InPath}\\subdir\");\n    string file1 = CreateTestFile($@\"{InPath}\\subdir\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\subdir\\file2.txt\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.txt\", 1023);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddDirectoryAsync(InPath, false));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsFalse(AreFilesEqual(file1, $@\"{OutPath}\\subdir\\file1.txt\"));\n    Assert.IsFalse(AreFilesEqual(file2, $@\"{OutPath}\\subdir\\file2.txt\"));\n    Assert.IsTrue(AreFilesEqual(file3, $@\"{OutPath}\\file3.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestAddDirectoryFilteringAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.dat\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.dat\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddDirectoryAsync(InPath, false, searchPattern: \"*.dat\"));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsFalse(AreFilesEqual(file1, $@\"{OutPath}\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\file2.dat\"));\n    Assert.IsTrue(AreFilesEqual(file3, $@\"{OutPath}\\file3.dat\"));\n  }\n\n  [TestMethod]\n  public async Task TestLoadAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddFileAsync(file1));\n    Assert.IsTrue(await archive.AddFileAsync(file2));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    using var loadedArchive = await FileArchive.LoadAsync(path);\n    Assert.IsNotNull(loadedArchive);\n    Assert.IsTrue(loadedArchive.FileCount == 2);\n    Assert.IsNotNull(loadedArchive.Files.Find(entry => entry.Name == \"file1.txt\"));\n    Assert.IsNotNull(loadedArchive.Files.Find(entry => entry.Name == \"file2.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestExtractFileToDirectoryAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddFileAsync(file1));\n    Assert.IsTrue(await archive.AddFileAsync(file2));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    using var loadedArchive = await FileArchive.LoadAsync(path);\n    Assert.IsNotNull(loadedArchive);\n    Assert.IsTrue(await loadedArchive.ExtractFileToDirectoryAsync(\"file1.txt\", OutPath));\n    Assert.IsTrue(await loadedArchive.ExtractFileToDirectoryAsync(\"file2.txt\", OutPath));\n\n    Assert.IsTrue(AreFilesEqual(file1, $@\"{OutPath}\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\file2.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestExtractAllToDirectoryAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    Directory.CreateDirectory($@\"{InPath}\\subdir\");\n    string file1 = CreateTestFile($@\"{InPath}\\subdir\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\subdir\\file2.txt\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.txt\", 1023);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddDirectoryAsync(InPath, false));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    await FileArchive.ExtractAllToDirectoryAsync(path, OutPath);\n    Assert.IsFalse(AreFilesEqual(file1, $@\"{OutPath}\\subdir\\file1.txt\"));\n    Assert.IsFalse(AreFilesEqual(file2, $@\"{OutPath}\\subdir\\file2.txt\"));\n    Assert.IsTrue(AreFilesEqual(file3, $@\"{OutPath}\\file3.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestExtractFileToStreamAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n\n    await FileArchive.CreateFromFileAsync(file1, path, CompressionLevel.Fastest);\n    Assert.IsTrue(File.Exists(path));\n\n    using var loadedArchive = await FileArchive.LoadAsync(path);\n    Assert.IsNotNull(loadedArchive);\n    Assert.IsTrue(loadedArchive.FileCount == 1);\n\n    using var outStream = await loadedArchive.ExtractFileToMemoryAsync(\"file1.txt\");\n    Assert.IsNotNull(outStream);\n    Assert.IsTrue(AreFilesEqual(outStream, file1));\n  }\n\n  [TestMethod]\n  public async Task TestCreateFromFileAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n\n    await FileArchive.CreateFromFileAsync(file1, path, CompressionLevel.Fastest);\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsTrue(AreFilesEqual(file1, $@\"{OutPath}\\file1.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestCreateFromStreamAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    var stream = CreateTestStream(1023);\n\n    await FileArchive.CreateFromStreamAsync(stream, \"file1.txt\", path, CompressionLevel.Fastest);\n    Assert.IsTrue(File.Exists(path));\n\n    ZipFile.ExtractToDirectory(path, OutPath);\n    Assert.IsTrue(AreFilesEqual(stream, $@\"{OutPath}\\file1.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestGetFilesOfKind() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddFileAsync(file1, 123, null, false));\n    Assert.IsTrue(await archive.AddFileAsync(file2, 456, null, false));\n    Assert.IsTrue(await archive.AddFileAsync(file3, 123, null, false));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    using var loadedArchive = await FileArchive.LoadAsync(path);\n    Assert.IsNotNull(loadedArchive);\n    Assert.IsTrue(loadedArchive.FileCount == 3);\n    Assert.IsTrue(loadedArchive.HasFilesOfKind(123));\n    Assert.IsTrue(loadedArchive.HasFilesOfKind(456));\n    Assert.IsTrue(loadedArchive.FindFilesOfKind(123).Count() == 2);\n    Assert.IsTrue(loadedArchive.FindFilesOfKind(456).Count() == 1);\n  }\n\n  [TestMethod]\n  public async Task TestFindFilesInDirectory() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddFileAsync(file1, 123, \"foo\", false));\n    Assert.IsTrue(await archive.AddFileAsync(file2, 456, \"bar\", false));\n    Assert.IsTrue(await archive.AddFileAsync(file3, 123, \"foobar\", false));\n    Assert.IsTrue(await archive.AddFileAsync(file1, 123, \"foo\\\\bar\", false));\n    Assert.IsTrue(await archive.AddFileAsync(file2, 456, \"foo\\\\bar\", false));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    using var loadedArchive = await FileArchive.LoadAsync(path);\n    Assert.IsNotNull(loadedArchive);\n\n    var result1 = loadedArchive.FindFilesInDirectory(\"bar\");\n    Assert.IsTrue(result1.Count() == 1);\n    Assert.IsTrue(result1.Count(entry => entry.ArchivePath == \"bar\\\\file2.txt\") == 1);\n\n    var result2 = loadedArchive.FindFilesInDirectory(\"foo\");\n    Assert.IsTrue(result2.Count() == 3);\n    Assert.IsTrue(result2.Count(entry => entry.ArchivePath == \"foo\\\\file1.txt\") == 1);\n    Assert.IsTrue(result2.Count(entry => entry.ArchivePath == \"foo\\\\bar\\\\file1.txt\") == 1);\n    Assert.IsTrue(result2.Count(entry => entry.ArchivePath == \"foo\\\\bar\\\\file2.txt\") == 1);\n\n    var result3 = loadedArchive.FindFilesInDirectory(\"foo\\\\bar\");\n    Assert.IsTrue(result3.Count() == 2);\n    Assert.IsTrue(result3.Count(entry => entry.ArchivePath == \"foo\\\\bar\\\\file1.txt\") == 1);\n    Assert.IsTrue(result3.Count(entry => entry.ArchivePath == \"foo\\\\bar\\\\file2.txt\") == 1);\n\n    await loadedArchive.ExtractFilesToDirectoryAsync(result3, OutPath);\n    Assert.IsTrue(AreFilesEqual(file1, $@\"{OutPath}\\foo\\bar\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\foo\\bar\\file2.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestExtractAllFilesOfKindToDirectoryAsync() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    string file1 = CreateTestFile($@\"{InPath}\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\file2.txt\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.txt\", 4095);\n\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    Assert.IsTrue(await archive.AddFileAsync(file1, 123, null, false));\n    Assert.IsTrue(await archive.AddFileAsync(file2, 456, null, false));\n    Assert.IsTrue(await archive.AddFileAsync(file3, 456, \"foo\", false));\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    using var loadedArchive = await FileArchive.LoadAsync(path);\n    Assert.IsNotNull(loadedArchive);\n\n    await loadedArchive.ExtractAllFilesOfKindToDirectoryAsync(456, OutPath);\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\file2.txt\"));\n    Assert.IsTrue(AreFilesEqual(file3, $@\"{OutPath}\\foo\\file3.txt\"));\n  }\n\n  [TestMethod]\n  public async Task TestOptionalData() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    using var archive = await FileArchive.CreateAsync(path, CompressionLevel.Fastest);\n    var data = new ExtraData() {\n      Value1 = 123,\n      Value2 = 456,\n      Value3 = \"foo\"\n    };\n    archive.SetOptionalData(data);\n    Assert.IsTrue(await archive.SaveAsync());\n    Assert.IsTrue(File.Exists(path));\n\n    using var loadedArchive = await FileArchive.LoadAsync(path);\n    Assert.IsNotNull(loadedArchive);\n    Assert.IsTrue(loadedArchive.HasOptionalData);\n\n    var loadedData = loadedArchive.GetOptionalData<ExtraData>();\n    Assert.IsTrue(loadedData.Value1 == 123);\n    Assert.IsTrue(loadedData.Value2 == 456);\n    Assert.IsTrue(loadedData.Value3 == \"foo\");\n  }\n\n  [TestMethod]\n  public async Task TestPlainZipFile() {\n    string path = $@\"{ResultPath}\\archive.zip\";\n    Directory.CreateDirectory($@\"{InPath}\\subdir\");\n    string file1 = CreateTestFile($@\"{InPath}\\subdir\\file1.txt\", 1023);\n    string file2 = CreateTestFile($@\"{InPath}\\subdir\\file2.txt\", 4095);\n    string file3 = CreateTestFile($@\"{InPath}\\file3.txt\", 1023);\n\n    // Create zip file without included header,\n    // extracting files should still work.\n    ZipFile.CreateFromDirectory(InPath, path, CompressionLevel.Fastest, false);\n    Assert.IsTrue(File.Exists(path));\n\n    await FileArchive.ExtractAllToDirectoryAsync(path, OutPath);\n    Assert.IsTrue(AreFilesEqual(file1, $@\"{OutPath}\\subdir\\file1.txt\"));\n    Assert.IsTrue(AreFilesEqual(file2, $@\"{OutPath}\\subdir\\file2.txt\"));\n    Assert.IsTrue(AreFilesEqual(file3, $@\"{OutPath}\\file3.txt\"));\n  }\n\n  private MemoryStream CreateTestStream(int size) {\n    var stream = new MemoryStream();\n    var writer = new StreamWriter(stream);\n    var rand = new Random(21);\n\n    for (int i = 0; i < size; i++) {\n      writer.Write((char)rand.Next(127));\n    }\n\n    writer.Flush();\n    stream.Flush();\n    stream.Position = 0;\n    return stream;\n  }\n\n  private string CreateTestFile(string name, int size) {\n    using var fileStream = new FileStream(name, FileMode.Create);\n    using var stream = CreateTestStream(size);\n    stream.CopyTo(fileStream);\n    fileStream.Flush();\n    fileStream.Close();\n    return name;\n  }\n\n  private static void RecursiveDelete(DirectoryInfo baseDir) {\n    if (!baseDir.Exists)\n      return;\n\n    foreach (var dir in baseDir.EnumerateDirectories()) {\n      RecursiveDelete(dir);\n    }\n\n    baseDir.Delete(true);\n  }\n\n  private static bool AreFilesEqual(string fileA, string fileB) {\n    try {\n      byte[] data1 = File.ReadAllBytes(fileA);\n      byte[] data2 = File.ReadAllBytes(fileB);\n      return data1.SequenceEqual(data2);\n    }\n    catch {\n      return false;\n    }\n  }\n\n  private static bool AreFilesEqual(Stream stream, string fileB) {\n    try {\n      byte[] data1 = new byte[stream.Length];\n      stream.Position = 0;\n      stream.Read(data1, 0, (int)stream.Length);\n      byte[] data2 = File.ReadAllBytes(fileB);\n      return data1.SequenceEqual(data2);\n    }\n    catch {\n      return false;\n    }\n  }\n\n  private class ExtraData {\n    public int Value1 { get; set; }\n    public int Value2 { get; set; }\n    public string Value3 { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/ProfileExplorerCoreTests.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n\t<PropertyGroup>\n\t\t<TargetFramework>net8.0</TargetFramework>\n\n\t\t<IsPackable>false</IsPackable>\n\n\t\t<Platforms>AnyCPU</Platforms>\n\n\t\t<LangVersion>default</LangVersion>\n\n\t\t<RootNamespace>ProfilerExplorerCoreTests</RootNamespace>\n\t</PropertyGroup>\n\n\t<ItemGroup>\n\t\t<PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.11.1\" />\n\t\t<PackageReference Include=\"MSTest.TestAdapter\" Version=\"3.6.1\" />\n\t\t<PackageReference Include=\"MSTest.TestFramework\" Version=\"3.6.1\" />\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t  <ProjectReference Include=\"..\\ProfileExplorerCore\\ProfileExplorerCore.csproj\" />\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t  <None Include=\"TestData\\**\\*\" CopyToOutputDirectory=\"PreserveNewest\" />\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t  <Folder Include=\"TestData\\Symbols\\MsoTrace\\\" />\n\t</ItemGroup>\n\n</Project>"
  },
  {
    "path": "src/ProfileExplorerCoreTests/SourceFileMapperTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.CoreTests;\n\n[TestClass]\npublic class SourceFileMapperTests {\n  [TestMethod]\n  public void Map_FirstTime_ReturnsResultFromLookup() {\n    var mapper = new SourceFileMapper();\n    bool called = false;\n    const string expectedResult = @\"c:\\mapped\\path\\to\\file.txt\";\n    Assert.AreEqual(expectedResult, mapper.Map(@\"c:\\path\\to\\file.txt\", () => {\n      called = true;\n      return expectedResult;\n    }));\n    Assert.IsTrue(called);\n  }\n\n  [TestMethod]\n  public void Map_SecondTimeForSamePath_DoesNotUseLookup() {\n    var mapper = new SourceFileMapper();\n    const string expectedResult = @\"c:\\mapped\\path\\to\\file.txt\";\n    const string source = @\"c:\\path\\to\\file.txt\";\n\n    // prime it\n    mapper.Map(source, () => expectedResult);\n\n    Assert.AreEqual(expectedResult, mapper.Map(source, () => {\n      Assert.Fail();\n      return \"\";\n    }));\n  }\n\n  [TestMethod]\n  public void OtherFilesInTheSameDirectoryDontUseLookup() {\n    var mapper = new SourceFileMapper();\n    const string source = @\"c:\\path\\to\\file.txt\";\n    const string sourceInSameDir = @\"c:\\path\\to\\otherFile.txt\";\n    // prime it\n    mapper.Map(source, () => @\"c:\\mapped\\path\\to\\file.txt\");\n\n    const string expectedResult = @\"c:\\mapped\\path\\to\\otherFile.txt\";\n    Assert.AreEqual(expectedResult, mapper.Map(sourceInSameDir, () => {\n      Assert.Fail();\n      return \"\";\n    }));\n  }\n\n  [TestMethod]\n  public void OtherFilesWithTheSamePrefixAreMapped() {\n    string file1 = @\"c:\\path\\to\\file.txt\";\n    string file2 = @\"c:\\path\\for\\other\\file.txt\";\n    string mappedFile1 = @\"c:\\mapped\\to\\file.txt\";\n    string mappedFile2 = @\"c:\\mapped\\for\\other\\file.txt\";\n\n    var mapper = new SourceFileMapper();\n\n    // prime it\n    mapper.Map(file1, () => mappedFile1);\n\n    Assert.AreEqual(mappedFile2, mapper.Map(file2, () => {\n      Assert.Fail();\n      return \"\";\n    }));\n  }\n\n  [TestMethod]\n  public void OtherFilesWithDeeperHierarchyAreMatched() {\n    string file1 = @\"c:\\path\\to\\file.txt\";\n    string file2 = @\"c:\\path\\to\\deeper\\file.txt\";\n    string mappedFile1 = @\"c:\\mapped\\to\\file.txt\";\n    string mappedFile2 = @\"c:\\mapped\\to\\deeper\\file.txt\";\n\n    var mapper = new SourceFileMapper();\n\n    // prime it\n    mapper.Map(file1, () => mappedFile1);\n\n    Assert.AreEqual(mappedFile2, mapper.Map(file2, () => {\n      Assert.Fail();\n      return \"\";\n    }));\n  }\n\n  [TestMethod]\n  public void ResultIsNullWhenLookupIsCanceled() {\n    var mapper = new SourceFileMapper();\n    Assert.IsNull(mapper.Map(@\"c:\\path\\to\\file.txt\", () => null));\n  }\n\n  [TestMethod]\n  public void Map_FirstTime_NetworkPath() {\n    var mapper = new SourceFileMapper();\n    bool called = false;\n    const string expectedResult = @\"\\\\network\\path\\file.txt\";\n    Assert.AreEqual(expectedResult, mapper.Map(@\"\\\\network\\path\\file.txt\", () => {\n      called = true;\n      return expectedResult;\n    }));\n    Assert.IsTrue(called);\n  }\n\n  [TestMethod]\n  public void Map_FirstTime_NetworkPath_SamePrefix() {\n    const string file1 = @\"\\\\network\\to\\file.txt\";\n    const string file2 = @\"\\\\network\\for\\file2.txt\";\n    string mappedFile1 = @\"c:\\mapped\\to\\file.txt\";\n    string mappedFile2 = @\"c:\\mapped\\for\\file2.txt\";\n\n    var mapper = new SourceFileMapper();\n\n    // prime it\n    mapper.Map(file1, () => mappedFile1);\n\n    Assert.AreEqual(mappedFile2, mapper.Map(file2, () => {\n      Assert.Fail();\n      return \"\";\n    }));\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/SparseBitVectorTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Linq;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core.Collections;\n\nnamespace ProfileExplorer.CoreTests;\n\n[TestClass]\npublic class SparseBitVectorTests {\n  [TestMethod]\n  public void NodeSetGetBits() {\n    var v = new SparseBitvector.Node();\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode; i++) {\n      v[i] = i % 2 != 0;\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode; i++) {\n      Assert.AreEqual(v[i], i % 2 != 0);\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode; i++) {\n      v[i] = true;\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode; i++) {\n      Assert.IsTrue(v[i]);\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode; i++) {\n      v[i] = false;\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode; i++) {\n      Assert.IsFalse(v[i]);\n    }\n  }\n\n  [TestMethod]\n  public void NodeBitCount() {\n    var v = new SparseBitvector.Node();\n    Assert.AreEqual(v.SetBitCount, 0);\n    Assert.IsFalse(v.HasBitsSet);\n\n    v[0] = true;\n    Assert.AreEqual(v.SetBitCount, 1);\n    Assert.IsTrue(v.HasBitsSet);\n\n    v[0] = true;\n    v[3] = true;\n    v[64] = true;\n    v[91] = true;\n    v[150] = true;\n    v[201] = true;\n    v[255] = true;\n    Assert.AreEqual(v.SetBitCount, 7);\n    Assert.IsTrue(v.HasBitsSet);\n\n    v.ResetAllBits();\n    Assert.AreEqual(v.SetBitCount, 0);\n    Assert.IsFalse(v.HasBitsSet);\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode; i++) {\n      Assert.IsFalse(v[i]);\n    }\n  }\n\n  [TestMethod]\n  public void SetGetBits() {\n    var v = new SparseBitvector();\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      v[i] = true;\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      Assert.AreEqual(v[i], true);\n    }\n\n    Assert.AreEqual(v.SetBitCount, SparseBitvector.Node.BitsPerNode * 10);\n    Assert.IsTrue(v.HasBitsSet);\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      v[i] = false;\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      Assert.AreEqual(v[i], false);\n    }\n\n    Assert.AreEqual(v.SetBitCount, 0);\n    Assert.IsFalse(v.HasBitsSet);\n  }\n\n  [TestMethod]\n  public void SetGetBitsAlternate() {\n    var v = new SparseBitvector();\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      v[i] = i % 2 == 0;\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      Assert.AreEqual(v[i], i % 2 == 0);\n    }\n\n    Assert.AreEqual(v.SetBitCount, SparseBitvector.Node.BitsPerNode * 10 / 2);\n    Assert.IsTrue(v.HasBitsSet);\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      v[i] = i % 2 != 0;\n    }\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      Assert.AreEqual(v[i], i % 2 != 0);\n    }\n\n    Assert.AreEqual(v.SetBitCount, SparseBitvector.Node.BitsPerNode * 10 / 2);\n    Assert.IsTrue(v.HasBitsSet);\n  }\n\n  [TestMethod]\n  public void SetGetBitsReverseAlternate() {\n    var v = new SparseBitvector();\n    int set = 0;\n\n    for (int i = SparseBitvector.Node.BitsPerNode * 10; i >= 0; i--) {\n      v[i] = i % 2 == 0;\n      set += i % 2 == 0 ? 1 : 0;\n    }\n\n    for (int i = SparseBitvector.Node.BitsPerNode * 10; i >= 0; i--) {\n      Assert.AreEqual(v[i], i % 2 == 0);\n    }\n\n    Assert.AreEqual(v.SetBitCount, set);\n    Assert.IsTrue(v.HasBitsSet);\n  }\n\n  [TestMethod]\n  public void SetGetBitsRandom() {\n    int n = SparseBitvector.Node.BitsPerNode * 100;\n\n    foreach (int seed in new[] {7, 13, 31, 51, 123}) {\n      var r = new Random(seed);\n      int[] indices = Enumerable.Range(0, n).OrderBy(i => r.Next()).ToArray();\n\n      var v = new SparseBitvector();\n\n      for (int i = 0; i < n; i++) {\n        v[indices[i]] = true;\n      }\n\n      for (int i = 0; i < n; i++) {\n        Assert.AreEqual(v[indices[i]], true);\n      }\n\n      for (int i = 0; i < n; i++) {\n        Assert.AreEqual(v[i], true);\n      }\n\n      Assert.AreEqual(v.SetBitCount, n);\n      Assert.IsTrue(v.HasBitsSet);\n\n      indices = Enumerable.Range(0, n).OrderBy(i => r.Next()).ToArray();\n\n      for (int i = 0; i < n; i++) {\n        v[indices[i]] = false;\n      }\n\n      for (int i = 0; i < n; i++) {\n        Assert.AreEqual(v[i], false);\n      }\n\n      for (int i = 0; i < n; i++) {\n        Assert.AreEqual(v[indices[i]], false);\n      }\n\n      Assert.AreEqual(v.SetBitCount, 0);\n      Assert.IsFalse(v.HasBitsSet);\n    }\n  }\n\n  [TestMethod]\n  public void SetGetBitsRandomAlternate() {\n    int n = SparseBitvector.Node.BitsPerNode * 100;\n\n    foreach (int seed in new[] {7, 13, 31, 51, 123}) {\n      var r = new Random(seed);\n      int[] indices = Enumerable.Range(0, n).OrderBy(i => r.Next()).ToArray();\n\n      var v = new SparseBitvector();\n\n      for (int i = 0; i < n; i++) {\n        v[indices[i]] = i % 2 == 0;\n      }\n\n      for (int i = 0; i < n; i++) {\n        Assert.AreEqual(v[indices[i]], i % 2 == 0);\n      }\n    }\n  }\n\n  [TestMethod]\n  public void And() {\n    var v = new SparseBitvector();\n    var v2 = new SparseBitvector();\n    var v3 = new SparseBitvector();\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      v[i] = i % 2 == 0;\n      v2[i] = i % 2 == 0;\n      v3[i] = i % 2 != 0;\n    }\n\n    v2.And(v);\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      Assert.AreEqual(v2[i], i % 2 == 0);\n    }\n\n    v3.And(v);\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i++) {\n      Assert.AreEqual(v3[i], false);\n    }\n  }\n\n  [TestMethod]\n  public void And2() {\n    var v = new SparseBitvector();\n    var v2 = new SparseBitvector();\n    var v3 = new SparseBitvector();\n\n    for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i += 64) {\n      SetFromInt(v, 0xABCDEFABCDEFABCD, i);\n      SetFromInt(v2, 0xF0F0F0F0F0F0F0F0, i);\n      SetFromInt(v3, 0xA0C0E0A0C0E0A0C0, i);\n    }\n\n    v.And(v2);\n    Assert.AreEqual(v, v3);\n  }\n\n  [TestMethod]\n  public void And3() {\n    foreach (int step in new[] {2, 3, 4}) {\n      var v = new SparseBitvector();\n      var v2 = new SparseBitvector();\n      var v3 = new SparseBitvector();\n\n      for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i += 64) {\n        SetFromInt(v, 0xABCDEFABCDEFABCD, i);\n      }\n\n      for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i += 64 * step) {\n        SetFromInt(v2, 0xF0F0F0F0F0F0F0F0, i);\n        SetFromInt(v3, 0xA0C0E0A0C0E0A0C0, i);\n      }\n\n      v.And(v2);\n      Assert.AreEqual(v, v3);\n    }\n\n    foreach (int step in new[] {2, 3, 4}) {\n      var v = new SparseBitvector();\n      var v2 = new SparseBitvector();\n      var v3 = new SparseBitvector();\n\n      for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i += 64 * step) {\n        SetFromInt(v, 0xABCDEFABCDEFABCD, i);\n        SetFromInt(v3, 0xA0C0E0A0C0E0A0C0, i);\n      }\n\n      for (int i = 0; i < SparseBitvector.Node.BitsPerNode * 10; i += 64) {\n        SetFromInt(v2, 0xF0F0F0F0F0F0F0F0, i);\n      }\n\n      v.And(v2);\n      Assert.AreEqual(v, v3);\n    }\n  }\n\n  private void SetFromInt(SparseBitvector bv, ulong value, int startIndex = 0) {\n    for (int i = 0; i < 64; i++) {\n      bv[startIndex + i] = (value & 1ul << i) != 0;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/StringTrieTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core.Collections;\n\nnamespace ProfileExplorer.CoreTests;\n\n[TestClass]\npublic class StringTrieTests {\n  [TestMethod]\n  public void StringValueTest() {\n    var trie = new StringTrie<string>();\n    var values = new Dictionary<string, string> {\n      {\"abc\", \"123\"},\n      {\"def\", \"456\"},\n      {\"abcd\", \"234\"},\n      {\"abce\", \"235\"},\n      {\"abcr\", \"236\"},\n      {\"abcdef\", \"124\"},\n      {\"abcdet\", \"125\"},\n      {\"dxyz\", \"126\"},\n      {\"dexyz\", \"127\"}\n    };\n\n    trie.Build(values);\n\n    foreach (var pair in values) {\n      bool found = trie.TryGetValue(pair.Key, out string outValue);\n      Assert.IsTrue(found);\n      Assert.AreEqual(outValue, pair.Value);\n    }\n  }\n\n  [TestMethod]\n  public void StringEnumTest() {\n    var trie = new StringTrie<TestEnum>();\n    var values = new Dictionary<string, TestEnum> {\n      {\"abc\", TestEnum.Value2},\n      {\"def\", TestEnum.Value2},\n      {\"abcd\", TestEnum.Value2},\n      {\"abce\", TestEnum.Value2},\n      {\"abcr\", TestEnum.Value2},\n      {\"abcdef\", TestEnum.Value2},\n      {\"abcdet\", TestEnum.Value2},\n      {\"dxyz\", TestEnum.Value2},\n      {\"dexyz\", TestEnum.Value2}\n    };\n\n    trie.Build(values);\n\n    foreach (var pair in values) {\n      bool found = trie.TryGetValue(pair.Key, out var outValue);\n      Assert.IsTrue(found);\n      Assert.AreEqual(outValue, pair.Value);\n    }\n  }\n\n  [TestMethod]\n  public void RandomStringEnumTest() {\n    for (int length = 1; length < 102; length += 20) {\n      var trie = new StringTrie<TestEnum>();\n      var values = new Dictionary<string, TestEnum>();\n      var random = new Random(31);\n\n      for (int i = 0; i < 1000; i++) {\n        string key = GenerateRandomString(length, random);\n        var value = GenerateRandomEnum<TestEnum>(random);\n        values[key] = value;\n      }\n\n      trie.Build(values);\n\n      foreach (var pair in values) {\n        bool found = trie.TryGetValue(pair.Key, out var outValue);\n        Assert.IsTrue(found);\n        Assert.AreEqual(outValue, pair.Value);\n      }\n    }\n  }\n\n  private string GenerateRandomString(int length, Random random) {\n    string chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n    char[] stringChars = new char[length];\n\n    for (int i = 0; i < stringChars.Length; i++) {\n      stringChars[i] = chars[random.Next(chars.Length)];\n    }\n\n    return new string(stringChars);\n  }\n\n  private T GenerateRandomEnum<T>(Random random) where T : Enum {\n    var values = Enum.GetValues(typeof(T));\n    return (T)values.GetValue(random.Next(values.Length));\n  }\n\n  private enum TestEnum {\n    Value1,\n    Value2,\n    Value3\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/assembly_Mso20win32client.dll_baseline.csv",
    "content": "FunctionName,AssemblyText\n\"Mso::Experiment::EcsNS::Private::SortByParameterGroups\",\"180032C3C:    mov  qword ptr [rsp + 0x18], rbx\n180032C41:    push  rbp\n180032C42:    push  rsi\n180032C43:    push  rdi\n180032C44:    push  r12\n180032C46:    push  r13\n180032C48:    push  r14\n180032C4A:    push  r15\n180032C4C:    lea  rbp, [rsp - 0x27]\n180032C51:    sub  rsp, 0xc0\n180032C58:    mov  rax, qword ptr [rip + 0x81fda1]\n180032C5F:    xor  rax, rsp\n180032C62:    mov  qword ptr [rbp + 0x17], rax\n180032C66:    mov  rdi, rdx\n180032C69:    mov  qword ptr [rbp - 0x59], rdx\n180032C6D:    xor  r12d, r12d\n180032C70:    cmp  qword ptr [rdx], r12\n180032C73:    je  0x180032f19\n180032C79:    mov  r15, qword ptr [rcx]\n180032C7C:    mov  rsi, qword ptr [rcx + 8]\n180032C80:    mov  qword ptr [rbp - 0x49], rsi\n180032C84:    cmp  r15, rsi\n180032C87:    je  0x180032f19\n180032C8D:    mov  qword ptr [rbp - 0x69], r12\n180032C91:    mov  qword ptr [rbp - 0x61], r12\n180032C95:    mov  ecx, 0x50\n180032C9A:    call  void * __ptr64 __cdecl std::_Allocate<16,struct std::_Default_allocate_traits>(unsigned __int64)\n180032C9F:    mov  qword ptr [rax], rax\n180032CA2:    mov  qword ptr [rax + 8], rax\n180032CA6:    mov  qword ptr [rax + 0x10], rax\n180032CAA:    mov  word ptr [rax + 0x18], 0x101\n180032CB0:    mov  qword ptr [rbp - 0x69], rax\n180032CB4:    mov  r13, qword ptr [r15]\n180032CB7:    mov  rax, qword ptr [r15 + 8]\n180032CBB:    mov  qword ptr [rbp - 0x51], rax\n180032CBF:    cmp  r13, rax\n180032CC2:    je  0x180032f5b\n180032CC8:    mov  rdx, r13\n180032CCB:    lea  rcx, [rbp - 9]\n180032CCF:    call  __cdecl std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const & __ptr64) __ptr64\n180032CD4:    lea  r9, [rbp - 9]\n180032CD8:    mov  r11, qword ptr [rbp - 9]\n180032CDC:    cmp  qword ptr [rbp + 0xf], 7\n180032CE1:    cmova  r9, r11\n180032CE5:    lea  rcx, [rbp - 9]\n180032CE9:    cmova  rcx, r11\n180032CED:    mov  rax, qword ptr [rbp + 7]\n180032CF1:    lea  r8, [rcx + rax*2]\n180032CF5:    lea  rdx, [rbp - 9]\n180032CF9:    cmova  rdx, r11\n180032CFD:    mov  rax, qword ptr [rip + 0x58b674]\n180032D04:    mov  qword ptr [rsp + 0x20], rax\n180032D09:    lea  rcx, [rbp - 0x41]\n180032D0D:    call  class std::_String_iterator<class std::_String_val<struct std::_Simple_types<wchar_t> > > __cdecl std::transform<class std::_String_iterator<class std::_String_val<struct std::_Simple_types<wchar_t> > >,class std::_String_iterator<class std::_String_val<struct std::_Simple_types<wchar_t> > >,int (__cdecl*)(int)>(class std::_String_iterator<class std::_String_val<struct std::_Simple_types<wchar_t> > >,class std::_String_iterator<class std::_String_val<struct std::_Simple_types<wchar_t> > >,class std::_String_iterator<class std::_String_val<struct std::_Simple_types<wchar_t> > >,int (__cdecl*)(int))\n180032D12:    mov  rax, qword ptr [rdi]\n180032D15:    mov  rbx, qword ptr [rax + 0x18]\n180032D19:    mov  rbx, qword ptr [rbx]\n180032D1C:    mov  rax, qword ptr [rdi]\n180032D1F:    cmp  rbx, qword ptr [rax + 0x18]\n180032D23:    je  0x180032f40\n180032D29:    lea  r14, [rbx + 0x20]\n180032D2D:    xorps  xmm0, xmm0\n180032D30:    movups  xmmword ptr [rbp - 0x29], xmm0\n180032D34:    mov  qword ptr [rbp - 0x19], r12\n180032D38:    mov  qword ptr [rbp - 0x11], r12\n180032D3C:    mov  rdi, qword ptr [r14 + 0x10]\n180032D40:    cmp  qword ptr [r14 + 0x18], 7\n180032D45:    jbe  0x180032d4a\n180032D47:    mov  r14, qword ptr [r14]\n180032D4A:    movabs  rax, 0x7ffffffffffffffe\n180032D54:    cmp  rdi, rax\n180032D57:    ja  0x180032f03\n180032D5D:    cmp  rdi, 7\n180032D61:    jbe  0x180032d9c\n180032D63:    mov  rsi, rdi\n180032D66:    or  rsi, 7\n180032D6A:    cmp  rsi, rax\n180032D6D:    ja  0x180032f11\n180032D73:    mov  eax, 0xa\n180032D78:    cmp  rsi, rax\n180032D7B:    cmovb  rsi, rax\n180032D7F:    lea  rcx, [rsi + 1]\n180032D83:    movabs  rax, 0x7fffffffffffffff\n180032D8D:    cmp  rcx, rax\n180032D90:    jbe  0x180032e7a\n180032D96:    call  void __cdecl std::_Throw_bad_array_new_length(void)\n180032D9B:    int3  \n180032D9C:    mov  qword ptr [rbp - 0x19], rdi\n180032DA0:    mov  edx, 7\n180032DA5:    mov  qword ptr [rbp - 0x11], rdx\n180032DA9:    movups  xmm0, xmmword ptr [r14]\n180032DAD:    movups  xmmword ptr [rbp - 0x29], xmm0\n180032DB1:    lea  r14, [rbp - 0x29]\n180032DB5:    movq  rcx, xmm0\n180032DBA:    lea  rax, [rbp - 0x29]\n180032DBE:    cmp  rdx, 7\n180032DC2:    cmova  rax, rcx\n180032DC6:    lea  r12, [rax + rdi*2]\n180032DCA:    lea  rsi, [rbp - 0x29]\n180032DCE:    cmova  rsi, rcx\n180032DD2:    cmp  rsi, r12\n180032DD5:    je  0x180032dfd\n180032DD7:    sub  r14, rsi\n180032DDA:    movzx  ecx, word ptr [rsi]\n180032DDD:    call  qword ptr [rip + 0x58b595]\n180032DE3:    mov  word ptr [rsi + r14], ax\n180032DE8:    add  rsi, 2\n180032DEC:    cmp  rsi, r12\n180032DEF:    jne  0x180032dda\n180032DF1:    mov  rdx, qword ptr [rbp - 0x11]\n180032DF5:    mov  rdi, qword ptr [rbp - 0x19]\n180032DF9:    mov  rcx, qword ptr [rbp - 0x29]\n180032DFD:    lea  rax, [rbp - 9]\n180032E01:    cmp  qword ptr [rbp + 0xf], 7\n180032E06:    cmova  rax, qword ptr [rbp - 9]\n180032E0B:    lea  r9, [rbp - 0x29]\n180032E0F:    cmp  rdx, 7\n180032E13:    cmova  r9, rcx\n180032E17:    xor  r12d, r12d\n180032E1A:    cmp  rdi, qword ptr [rbp + 7]\n180032E1E:    je  0x18003300c\n180032E24:    cmp  rdx, 7\n180032E28:    jbe  0x180032e43\n180032E2A:    lea  rax, [rdx*2 + 2]\n180032E32:    mov  rdx, rcx\n180032E35:    cmp  rax, 0x1000\n180032E3B:    jae  0x180032e62\n180032E3D:    call  qword ptr [rip + 0x58b3ad]\n180032E43:    mov  rcx, qword ptr [rbx + 0x10]\n180032E47:    cmp  byte ptr [rcx + 0x19], r12b\n180032E4B:    jne  0x180032feb\n180032E51:    call  struct std::_Tree_node<struct std::pair<unsigned __int64 const ,class std::map<unsigned __int64,struct Syzygy::Cluster,struct std::less<unsigned __int64>,class std::allocator<struct std::pair<unsigned __int64 const ,struct Syzygy::Cluster> > > >,void * __ptr64> * __ptr64 __cdecl std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<unsigned __int64 const ,class std::map<unsigned __int64,struct Syzygy::Cluster,struct std::less<unsigned __int64>,class std::allocator<struct std::pair<unsigned __int64 const ,struct Syzygy::Cluster> > > > > >::_Min(struct std::_Tree_node<struct std::pair<unsigned __int64 const ,class std::map<unsigned __int64,struct Syzygy::Cluster,struct std::less<unsigned __int64>,class std::allocator<struct std::pair<unsigned __int64 const ,struct Syzygy::Cluster> > > >,void * __ptr64> * __ptr64)\n180032E56:    mov  rbx, rax\n180032E59:    mov  rdi, qword ptr [rbp - 0x59]\n180032E5D:    jmp  0x180032D1C\n180032E62:    mov  rcx, qword ptr [rcx - 8]\n180032E66:    sub  rdx, rcx\n180032E69:    lea  rax, [rdx - 8]\n180032E6D:    cmp  rax, 0x1f\n180032E71:    jbe  0x180032e3d\n180032E73:    call  qword ptr [rip + 0x58b397]\n180032E79:    int3  \n180032E7A:    add  rcx, rcx\n180032E7D:    je  0x180032fe3\n180032E83:    cmp  rcx, 0x1000\n180032E8A:    jb  0x180032ef1\n180032E8C:    lea  rax, [rcx + 0x27]\n180032E90:    cmp  rax, rcx\n180032E93:    jbe  0x180032d96\n180032E99:    mov  rcx, rax\n180032E9C:    call  void __cdecl std::_Hash_vec<class std::allocator<class std::_List_unchecked_const_iterator<class std::_List_val<struct std::_List_simple_types<class Mso::Persistent<class Mso::AnyType> > >,struct std::_Iterator_base0> > >::_Assign_grow(unsigned __int64,class std::_List_unchecked_const_iterator<class std::_List_val<struct std::_List_simple_types<class Mso::Persistent<class Mso::AnyType> > >,struct std::_Iterator_base0>) __ptr64\n180032EA1:    mov  rcx, rax\n180032EA4:    test  rax, rax\n180032EA7:    je  0x180032e73\n180032EA9:    add  rax, 0x27\n180032EAD:    and  rax, 0xffffffffffffffe0\n180032EB1:    mov  qword ptr [rax - 8], rcx\n180032EB5:    mov  qword ptr [rbp - 0x29], rax\n180032EB9:    mov  qword ptr [rbp - 0x19], rdi\n180032EBD:    mov  qword ptr [rbp - 0x11], rsi\n180032EC1:    lea  r8, [rdi*2 + 2]\n180032EC9:    mov  rdx, r14\n180032ECC:    mov  rcx, rax\n180032ECF:    call  memcpy\n180032ED4:    lea  r14, [rbp - 0x29]\n180032ED8:    mov  rcx, qword ptr [rbp - 0x29]\n180032EDC:    mov  rdx, qword ptr [rbp - 0x11]\n180032EE0:    cmp  rdx, 7\n180032EE4:    cmova  r14, rcx\n180032EE8:    mov  rdi, qword ptr [rbp - 0x19]\n180032EEC:    jmp  0x180032DBA\n180032EF1:    call  qword ptr [rip + 0x58b2f1]\n180032EF7:    test  rax, rax\n180032EFA:    jne  0x180032eb5\n180032EFC:    call  qword ptr [rip + 0x58ab2e]\n180032F02:    int3  \n180032F03:    lea  rcx, [rip + 0x706a2e]\n180032F0A:    call  qword ptr [rip + 0x58ab50]\n180032F10:    int3  \n180032F11:    mov  rsi, rax\n180032F14:    jmp  0x180032D7F\n180032F19:    mov  rcx, qword ptr [rbp + 0x17]\n180032F1D:    xor  rcx, rsp\n180032F20:    call  __security_check_cookie\n180032F25:    mov  rbx, qword ptr [rsp + 0x110]\n180032F2D:    add  rsp, 0xc0\n180032F34:    pop  r15\n180032F36:    pop  r14\n180032F38:    pop  r13\n180032F3A:    pop  r12\n180032F3C:    pop  rdi\n180032F3D:    pop  rsi\n180032F3E:    pop  rbp\n180032F3F:    ret  \n180032F40:    lea  rcx, [rbp - 9]\n180032F44:    call  __cdecl Mso::Collections::KeyValue<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,enum Mso::Authentication::FederationProvider::ConfigurationProviderCode>::~KeyValue<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,enum Mso::Authentication::FederationProvider::ConfigurationProviderCode>(void) __ptr64\n180032F49:    add  r13, 0x20\n180032F4D:    cmp  r13, qword ptr [rbp - 0x51]\n180032F51:    jne  0x180032cc8\n180032F57:    mov  rsi, qword ptr [rbp - 0x49]\n180032F5B:    cmp  qword ptr [rbp - 0x61], r12\n180032F5F:    jbe  0x180032f9d\n180032F61:    mov  rdi, qword ptr [rdi]\n180032F64:    mov  rbx, qword ptr [rdi + 8]\n180032F68:    cmp  rbx, qword ptr [rdi + 0x10]\n180032F6C:    je  0x180032fd2\n180032F6E:    mov  qword ptr [rbx], r12\n180032F71:    mov  qword ptr [rbx + 8], r12\n180032F75:    call  __cdecl std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > >::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > >(class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > > const & __ptr64) __ptr64\n180032F7A:    mov  qword ptr [rbx], rax\n180032F7D:    mov  rcx, qword ptr [rbp - 0x69]\n180032F81:    mov  qword ptr [rbx], rcx\n180032F84:    mov  qword ptr [rbp - 0x69], rax\n180032F88:    mov  rcx, qword ptr [rbx + 8]\n180032F8C:    mov  rax, qword ptr [rbp - 0x61]\n180032F90:    mov  qword ptr [rbx + 8], rax\n180032F94:    mov  qword ptr [rbp - 0x61], rcx\n180032F98:    add  qword ptr [rdi + 8], 0x10\n180032F9D:    mov  r8, qword ptr [rbp - 0x69]\n180032FA1:    mov  r8, qword ptr [r8 + 8]\n180032FA5:    lea  rdx, [rbp - 0x69]\n180032FA9:    lea  rcx, [rbp - 0x69]\n180032FAD:    call  void __cdecl std::_Tree_val<struct std::_Tree_simple_types<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > >::_Erase_tree<class std::allocator<struct std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64> > >(class std::allocator<struct std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64> > & __ptr64,struct std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64> * __ptr64) __ptr64\n180032FB2:    mov  rcx, qword ptr [rbp - 0x69]\n180032FB6:    call  qword ptr [rip + 0x58b234]\n180032FBC:    add  r15, 0x18\n180032FC0:    cmp  r15, rsi\n180032FC3:    je  0x180032f19\n180032FC9:    mov  rdi, qword ptr [rbp - 0x59]\n180032FCD:    jmp  0x180032C8D\n180032FD2:    lea  r8, [rbp - 0x69]\n180032FD6:    mov  rdx, rbx\n180032FD9:    mov  rcx, rdi\n180032FDC:    call  class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > > * __ptr64 __cdecl std::vector<class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > >,class std::allocator<class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > > > >::_Emplace_reallocate<class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > > >(class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > > * __ptr64 const,class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > > && __ptr64) __ptr64\n180032FE1:    jmp  0x180032F9D\n180032FE3:    mov  rax, r12\n180032FE6:    jmp  0x180032EB5\n180032FEB:    mov  rax, qword ptr [rbx + 8]\n180032FEF:    cmp  byte ptr [rax + 0x19], r12b\n180032FF3:    jne  0x180032e56\n180032FF9:    cmp  rbx, qword ptr [rax + 0x10]\n180032FFD:    jne  0x180032e56\n180033003:    mov  rbx, rax\n180033006:    mov  rax, qword ptr [rax + 8]\n18003300A:    jmp  0x180032FEF\n18003300C:    test  rdi, rdi\n18003300F:    je  0x180033030\n180033011:    mov  r8, rdi\n180033014:    mov  rdx, rax\n180033017:    mov  rcx, r9\n18003301A:    call  wmemcmp\n18003301F:    test  eax, eax\n180033021:    je  0x180033030\n180033023:    mov  rdx, qword ptr [rbp - 0x11]\n180033027:    mov  rcx, qword ptr [rbp - 0x29]\n18003302B:    jmp  0x180032E24\n180033030:    lea  r9, [rbx + 0x40]\n180033034:    lea  r8, [rbx + 0x20]\n180033038:    lea  rdx, [rbp - 0x39]\n18003303C:    lea  rcx, [rbp - 0x69]\n180033040:    call  struct std::pair<struct std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64> * __ptr64,bool> __cdecl std::_Tree<class std::_Tmap_traits<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> >,0> >::_Emplace<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const & __ptr64,class Mso::AnyType & __ptr64>(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const & __ptr64,class Mso::AnyType & __ptr64) __ptr64\n180033045:    mov  rdi, qword ptr [rbp - 0x59]\n180033049:    mov  rcx, qword ptr [rdi]\n18003304C:    add  rcx, 0x18\n180033050:    mov  rdx, rbx\n180033053:    call  int __cdecl Mso::Experiment::ABConfigsCollection::MergeGroupedFeature(class std::map<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class Mso::AnyType,struct std::less<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > >,class std::allocator<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType> > > const & __ptr64,enum Mso::Experiment::ConfigSource const & __ptr64,bool) __ptr64\n180033058:    mov  rdx, rax\n18003305B:    call  void __cdecl std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64>::_Freenode<class std::allocator<struct std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64> > >(class std::allocator<struct std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64> > & __ptr64,struct std::_Tree_node<struct std::pair<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const ,class Mso::AnyType>,void * __ptr64> * __ptr64)\n180033060:    lea  rcx, [rbp - 0x29]\n180033064:    call  __cdecl Mso::Collections::KeyValue<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,enum Mso::Authentication::FederationProvider::ConfigurationProviderCode>::~KeyValue<class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> >,enum Mso::Authentication::FederationProvider::ConfigurationProviderCode>(void) __ptr64\n180033069:    jmp  0x180032F40\n\"\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_AppvIsvSubsystems64.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1AF75\",\"1AF75\",\"AppvIsvSubsystems64.dll\",0.0820,7.9926,0.0820,7.9926\n\"1AFB2\",\"1AFB2\",\"AppvIsvSubsystems64.dll\",0.0614,5.9865,0.0614,5.9865\n\"F88A\",\"F88A\",\"AppvIsvSubsystems64.dll\",0.0513,4.9944,0.1373,13.3821\n\"C5F80\",\"C5F80\",\"AppvIsvSubsystems64.dll\",0.0510,4.9680,0.0510,4.9680\n\"1F978\",\"1F978\",\"AppvIsvSubsystems64.dll\",0.0411,4.0019,0.0411,4.0019\n\"7370F\",\"7370F\",\"AppvIsvSubsystems64.dll\",0.0411,4.0000,0.0411,4.0000\n\"C0CC5\",\"C0CC5\",\"AppvIsvSubsystems64.dll\",0.0409,3.9863,0.0409,3.9863\n\"BEA86\",\"BEA86\",\"AppvIsvSubsystems64.dll\",0.0406,3.9556,0.0406,3.9556\n\"B1E43\",\"B1E43\",\"AppvIsvSubsystems64.dll\",0.0378,3.6810,0.0378,3.6810\n\"D4365\",\"D4365\",\"AppvIsvSubsystems64.dll\",0.0374,3.6473,0.0374,3.6473\n\"1AF9F\",\"1AF9F\",\"AppvIsvSubsystems64.dll\",0.0342,3.3349,0.0342,3.3349\n\"7B672\",\"7B672\",\"AppvIsvSubsystems64.dll\",0.0327,3.1819,0.0327,3.1819\n\"B63EF\",\"B63EF\",\"AppvIsvSubsystems64.dll\",0.0327,3.1814,1.3710,133.5787\n\"C00FA\",\"C00FA\",\"AppvIsvSubsystems64.dll\",0.0310,3.0163,0.0310,3.0163\n\"B63F3\",\"B63F3\",\"AppvIsvSubsystems64.dll\",0.0309,3.0123,0.0309,3.0123\n\"CA74E\",\"CA74E\",\"AppvIsvSubsystems64.dll\",0.0308,3.0042,0.5853,57.0237\n\"B695B\",\"B695B\",\"AppvIsvSubsystems64.dll\",0.0308,3.0010,0.0308,3.0010\n\"C0161\",\"C0161\",\"AppvIsvSubsystems64.dll\",0.0308,2.9984,0.0308,2.9984\n\"BEAB4\",\"BEAB4\",\"AppvIsvSubsystems64.dll\",0.0308,2.9968,0.0308,2.9968\n\"BEAF7\",\"BEAF7\",\"AppvIsvSubsystems64.dll\",0.0307,2.9919,0.0307,2.9919\n\"C0CFD\",\"C0CFD\",\"AppvIsvSubsystems64.dll\",0.0307,2.9872,0.0307,2.9872\n\"C5D7C\",\"C5D7C\",\"AppvIsvSubsystems64.dll\",0.0281,2.7377,0.0281,2.7377\n\"C9363\",\"C9363\",\"AppvIsvSubsystems64.dll\",0.0270,2.6265,5.9545,580.1548\n\"1F9E2\",\"1F9E2\",\"AppvIsvSubsystems64.dll\",0.0266,2.5873,0.0266,2.5873\n\"D4367\",\"D4367\",\"AppvIsvSubsystems64.dll\",0.0243,2.3683,0.0243,2.3683\n\"B1E40\",\"B1E40\",\"AppvIsvSubsystems64.dll\",0.0220,2.1442,0.0220,2.1442\n\"C2454\",\"C2454\",\"AppvIsvSubsystems64.dll\",0.0213,2.0711,0.0213,2.0711\n\"CC4A7\",\"CC4A7\",\"AppvIsvSubsystems64.dll\",0.0208,2.0302,0.0208,2.0302\n\"D1A75\",\"D1A75\",\"AppvIsvSubsystems64.dll\",0.0206,2.0090,3.9387,383.7497\n\"CA5FC\",\"CA5FC\",\"AppvIsvSubsystems64.dll\",0.0206,2.0043,3.3097,322.4655\n\"BEF8F\",\"BEF8F\",\"AppvIsvSubsystems64.dll\",0.0206,2.0034,0.0206,2.0034\n\"CD68C\",\"CD68C\",\"AppvIsvSubsystems64.dll\",0.0205,2.0012,0.0205,2.0012\n\"F8A7\",\"F8A7\",\"AppvIsvSubsystems64.dll\",0.0205,2.0004,0.2182,21.2638\n\"1AFA7\",\"1AFA7\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"38EA8\",\"38EA8\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"6695F\",\"6695F\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"746E3\",\"746E3\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"9E97E\",\"9E97E\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"ADB09\",\"ADB09\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"ADBA6\",\"ADBA6\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"B69C2\",\"B69C2\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"B6A9C\",\"B6A9C\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"BEB1F\",\"BEB1F\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"BEBF9\",\"BEBF9\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"BF2BB\",\"BF2BB\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"C0F0B\",\"C0F0B\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"C5D55\",\"C5D55\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"C5D6F\",\"C5D6F\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"CC05C\",\"CC05C\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"D240F\",\"D240F\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"D242E\",\"D242E\",\"AppvIsvSubsystems64.dll\",0.0205,2.0000,0.0205,2.0000\n\"9E93F\",\"9E93F\",\"AppvIsvSubsystems64.dll\",0.0205,1.9965,0.0205,1.9965\n\"F884\",\"F884\",\"AppvIsvSubsystems64.dll\",0.0205,1.9939,0.0205,1.9939\n\"B2F20\",\"B2F20\",\"AppvIsvSubsystems64.dll\",0.0204,1.9912,0.0204,1.9912\n\"F880\",\"F880\",\"AppvIsvSubsystems64.dll\",0.0204,1.9907,0.0204,1.9907\n\"C2668\",\"C2668\",\"AppvIsvSubsystems64.dll\",0.0204,1.9876,0.2495,24.3121\n\"9BA88\",\"9BA88\",\"AppvIsvSubsystems64.dll\",0.0203,1.9779,0.0203,1.9779\n\"B6A94\",\"B6A94\",\"AppvIsvSubsystems64.dll\",0.0203,1.9753,0.0742,7.2246\n\"BDCBD\",\"BDCBD\",\"AppvIsvSubsystems64.dll\",0.0202,1.9715,0.0202,1.9715\n\"B23F8\",\"B23F8\",\"AppvIsvSubsystems64.dll\",0.0200,1.9530,0.0200,1.9530\n\"27D0F\",\"27D0F\",\"AppvIsvSubsystems64.dll\",0.0192,1.8680,0.0192,1.8680\n\"9E8F0\",\"9E8F0\",\"AppvIsvSubsystems64.dll\",0.0188,1.8300,0.0188,1.8300\n\"D4443\",\"D4443\",\"AppvIsvSubsystems64.dll\",0.0181,1.7664,0.0181,1.7664\n\"D43CC\",\"D43CC\",\"AppvIsvSubsystems64.dll\",0.0171,1.6628,0.0171,1.6628\n\"7B691\",\"7B691\",\"AppvIsvSubsystems64.dll\",0.0168,1.6367,0.0168,1.6367\n\"D0FEA\",\"D0FEA\",\"AppvIsvSubsystems64.dll\",0.0158,1.5416,0.0158,1.5416\n\"6E070\",\"6E070\",\"AppvIsvSubsystems64.dll\",0.0148,1.4373,0.0148,1.4373\n\"74344\",\"74344\",\"AppvIsvSubsystems64.dll\",0.0146,1.4243,0.0255,2.4817\n\"C5563\",\"C5563\",\"AppvIsvSubsystems64.dll\",0.0144,1.3987,0.0144,1.3987\n\"C46F9\",\"C46F9\",\"AppvIsvSubsystems64.dll\",0.0140,1.3603,0.0140,1.3603\n\"C6622\",\"C6622\",\"AppvIsvSubsystems64.dll\",0.0139,1.3544,0.3064,29.8574\n\"AB77D\",\"AB77D\",\"AppvIsvSubsystems64.dll\",0.0130,1.2649,0.0130,1.2649\n\"74329\",\"74329\",\"AppvIsvSubsystems64.dll\",0.0128,1.2500,0.0128,1.2500\n\"BEC23\",\"BEC23\",\"AppvIsvSubsystems64.dll\",0.0119,1.1628,0.0119,1.1628\n\"BF085\",\"BF085\",\"AppvIsvSubsystems64.dll\",0.0113,1.1058,0.0113,1.1058\n\"C46F7\",\"C46F7\",\"AppvIsvSubsystems64.dll\",0.0108,1.0530,0.0108,1.0530\n\"BE120\",\"BE120\",\"AppvIsvSubsystems64.dll\",0.0107,1.0401,0.0107,1.0401\n\"D4379\",\"D4379\",\"AppvIsvSubsystems64.dll\",0.0106,1.0356,0.0106,1.0356\n\"C8842\",\"C8842\",\"AppvIsvSubsystems64.dll\",0.0105,1.0224,0.0105,1.0224\n\"B5F39\",\"B5F39\",\"AppvIsvSubsystems64.dll\",0.0104,1.0156,0.0104,1.0156\n\"C575F\",\"C575F\",\"AppvIsvSubsystems64.dll\",0.0104,1.0113,0.0104,1.0113\n\"BF0F8\",\"BF0F8\",\"AppvIsvSubsystems64.dll\",0.0104,1.0110,0.0104,1.0110\n\"CD6F6\",\"CD6F6\",\"AppvIsvSubsystems64.dll\",0.0104,1.0099,0.0104,1.0099\n\"C5DE4\",\"C5DE4\",\"AppvIsvSubsystems64.dll\",0.0103,1.0079,0.0103,1.0079\n\"CCB21\",\"CCB21\",\"AppvIsvSubsystems64.dll\",0.0103,1.0079,0.0103,1.0079\n\"229D9\",\"229D9\",\"AppvIsvSubsystems64.dll\",0.0103,1.0074,0.0103,1.0074\n\"D9500\",\"D9500\",\"AppvIsvSubsystems64.dll\",0.0103,1.0074,0.0103,1.0074\n\"B2020\",\"B2020\",\"AppvIsvSubsystems64.dll\",0.0103,1.0065,0.0103,1.0065\n\"C5DA3\",\"C5DA3\",\"AppvIsvSubsystems64.dll\",0.0103,1.0059,0.0103,1.0059\n\"73506\",\"73506\",\"AppvIsvSubsystems64.dll\",0.0103,1.0048,0.0103,1.0048\n\"ADB40\",\"ADB40\",\"AppvIsvSubsystems64.dll\",0.0103,1.0033,0.0103,1.0033\n\"BEAED\",\"BEAED\",\"AppvIsvSubsystems64.dll\",0.0103,1.0022,0.0103,1.0022\n\"1F96F\",\"1F96F\",\"AppvIsvSubsystems64.dll\",0.0103,1.0020,0.0103,1.0020\n\"C9EFB\",\"C9EFB\",\"AppvIsvSubsystems64.dll\",0.0103,1.0019,0.3470,33.8054\n\"CAB4F\",\"CAB4F\",\"AppvIsvSubsystems64.dll\",0.0103,1.0015,0.0103,1.0015\n\"C64E5\",\"C64E5\",\"AppvIsvSubsystems64.dll\",0.0103,1.0005,0.0103,1.0005\n\"BEB74\",\"BEB74\",\"AppvIsvSubsystems64.dll\",0.0103,0.9999,0.0103,0.9999\n\"B6AB5\",\"B6AB5\",\"AppvIsvSubsystems64.dll\",0.0103,0.9995,0.0208,2.0274\n\"1AFA4\",\"1AFA4\",\"AppvIsvSubsystems64.dll\",0.0103,0.9994,0.0103,0.9994\n\"9E956\",\"9E956\",\"AppvIsvSubsystems64.dll\",0.0103,0.9989,0.0103,0.9989\n\"C850\",\"C850\",\"AppvIsvSubsystems64.dll\",0.0103,0.9988,0.0103,0.9988\n\"C070E\",\"C070E\",\"AppvIsvSubsystems64.dll\",0.0103,0.9987,0.0103,0.9987\n\"B6094\",\"B6094\",\"AppvIsvSubsystems64.dll\",0.0102,0.9985,0.0102,0.9985\n\"BEED4\",\"BEED4\",\"AppvIsvSubsystems64.dll\",0.0102,0.9984,0.0102,0.9984\n\"BF119\",\"BF119\",\"AppvIsvSubsystems64.dll\",0.0102,0.9983,0.0102,0.9983\n\"C5413\",\"C5413\",\"AppvIsvSubsystems64.dll\",0.0102,0.9982,0.0102,0.9982\n\"B2033\",\"B2033\",\"AppvIsvSubsystems64.dll\",0.0102,0.9981,0.0102,0.9981\n\"B892D\",\"B892D\",\"AppvIsvSubsystems64.dll\",0.0102,0.9979,0.0102,0.9979\n\"BDC65\",\"BDC65\",\"AppvIsvSubsystems64.dll\",0.0102,0.9978,0.0102,0.9978\n\"C87D8\",\"C87D8\",\"AppvIsvSubsystems64.dll\",0.0102,0.9976,0.0102,0.9976\n\"CC156\",\"CC156\",\"AppvIsvSubsystems64.dll\",0.0102,0.9970,0.0102,0.9970\n\"B34C0\",\"B34C0\",\"AppvIsvSubsystems64.dll\",0.0102,0.9968,0.0102,0.9968\n\"C552B\",\"C552B\",\"AppvIsvSubsystems64.dll\",0.0102,0.9968,0.0102,0.9968\n\"B6962\",\"B6962\",\"AppvIsvSubsystems64.dll\",0.0102,0.9965,0.0102,0.9965\n\"84A92\",\"84A92\",\"AppvIsvSubsystems64.dll\",0.0102,0.9963,0.0102,0.9963\n\"C6025\",\"C6025\",\"AppvIsvSubsystems64.dll\",0.0102,0.9961,0.0102,0.9961\n\"C8D88\",\"C8D88\",\"AppvIsvSubsystems64.dll\",0.0102,0.9960,0.0102,0.9960\n\"B693F\",\"B693F\",\"AppvIsvSubsystems64.dll\",0.0102,0.9956,0.0102,0.9956\n\"C5CFC\",\"C5CFC\",\"AppvIsvSubsystems64.dll\",0.0102,0.9956,0.0102,0.9956\n\"86FC\",\"86FC\",\"AppvIsvSubsystems64.dll\",0.0102,0.9952,0.0102,0.9952\n\"B605E\",\"B605E\",\"AppvIsvSubsystems64.dll\",0.0102,0.9951,0.0102,0.9951\n\"B2127\",\"B2127\",\"AppvIsvSubsystems64.dll\",0.0102,0.9949,0.0102,0.9949\n\"B2F80\",\"B2F80\",\"AppvIsvSubsystems64.dll\",0.0102,0.9949,0.0102,0.9949\n\"C5F79\",\"C5F79\",\"AppvIsvSubsystems64.dll\",0.0102,0.9948,0.0102,0.9948\n\"CD596\",\"CD596\",\"AppvIsvSubsystems64.dll\",0.0102,0.9945,0.0102,0.9945\n\"B307F\",\"B307F\",\"AppvIsvSubsystems64.dll\",0.0102,0.9943,0.0102,0.9943\n\"B92F2\",\"B92F2\",\"AppvIsvSubsystems64.dll\",0.0102,0.9943,0.0102,0.9943\n\"C3E7E\",\"C3E7E\",\"AppvIsvSubsystems64.dll\",0.0102,0.9943,0.0102,0.9943\n\"C8D3F\",\"C8D3F\",\"AppvIsvSubsystems64.dll\",0.0102,0.9940,0.0102,0.9940\n\"70160\",\"70160\",\"AppvIsvSubsystems64.dll\",0.0102,0.9939,0.0102,0.9939\n\"C0702\",\"C0702\",\"AppvIsvSubsystems64.dll\",0.0102,0.9939,0.0102,0.9939\n\"B659B\",\"B659B\",\"AppvIsvSubsystems64.dll\",0.0102,0.9938,9.7850,953.3591\n\"BF2F6\",\"BF2F6\",\"AppvIsvSubsystems64.dll\",0.0102,0.9938,0.0102,0.9938\n\"CA4C5\",\"CA4C5\",\"AppvIsvSubsystems64.dll\",0.0102,0.9936,0.0102,0.9936\n\"74798\",\"74798\",\"AppvIsvSubsystems64.dll\",0.0102,0.9931,0.0102,0.9931\n\"74496\",\"74496\",\"AppvIsvSubsystems64.dll\",0.0102,0.9930,0.0102,0.9930\n\"CA66C\",\"CA66C\",\"AppvIsvSubsystems64.dll\",0.0102,0.9930,0.3309,32.2412\n\"3AAA\",\"3AAA\",\"AppvIsvSubsystems64.dll\",0.0102,0.9928,0.0102,0.9928\n\"71840\",\"71840\",\"AppvIsvSubsystems64.dll\",0.0102,0.9928,0.0102,0.9928\n\"C8848\",\"C8848\",\"AppvIsvSubsystems64.dll\",0.0102,0.9927,0.3919,38.1855\n\"CA385\",\"CA385\",\"AppvIsvSubsystems64.dll\",0.0102,0.9927,0.0102,0.9927\n\"C4961\",\"C4961\",\"AppvIsvSubsystems64.dll\",0.0102,0.9925,0.0102,0.9925\n\"C9419\",\"C9419\",\"AppvIsvSubsystems64.dll\",0.0102,0.9922,0.0102,0.9922\n\"C3786\",\"C3786\",\"AppvIsvSubsystems64.dll\",0.0102,0.9920,0.0102,0.9920\n\"BF1B2\",\"BF1B2\",\"AppvIsvSubsystems64.dll\",0.0102,0.9913,0.0102,0.9913\n\"812BC\",\"812BC\",\"AppvIsvSubsystems64.dll\",0.0102,0.9912,0.1404,13.6816\n\"1B4C1\",\"1B4C1\",\"AppvIsvSubsystems64.dll\",0.0102,0.9907,0.0102,0.9907\n\"B20A2\",\"B20A2\",\"AppvIsvSubsystems64.dll\",0.0102,0.9907,0.0102,0.9907\n\"B3340\",\"B3340\",\"AppvIsvSubsystems64.dll\",0.0102,0.9907,0.0102,0.9907\n\"CA380\",\"CA380\",\"AppvIsvSubsystems64.dll\",0.0102,0.9904,0.0102,0.9904\n\"7B658\",\"7B658\",\"AppvIsvSubsystems64.dll\",0.0102,0.9901,0.0102,0.9901\n\"D9509\",\"D9509\",\"AppvIsvSubsystems64.dll\",0.0102,0.9897,0.0102,0.9897\n\"9E9EE\",\"9E9EE\",\"AppvIsvSubsystems64.dll\",0.0102,0.9896,0.0102,0.9896\n\"CD504\",\"CD504\",\"AppvIsvSubsystems64.dll\",0.0102,0.9895,0.0102,0.9895\n\"B6016\",\"B6016\",\"AppvIsvSubsystems64.dll\",0.0101,0.9888,0.0101,0.9888\n\"BEA5B\",\"BEA5B\",\"AppvIsvSubsystems64.dll\",0.0101,0.9885,0.0101,0.9885\n\"C0EAD\",\"C0EAD\",\"AppvIsvSubsystems64.dll\",0.0101,0.9884,0.0101,0.9884\n\"5074\",\"5074\",\"AppvIsvSubsystems64.dll\",0.0101,0.9880,0.0101,0.9880\n\"ADB81\",\"ADB81\",\"AppvIsvSubsystems64.dll\",0.0101,0.9879,0.0101,0.9879\n\"CCC6F\",\"CCC6F\",\"AppvIsvSubsystems64.dll\",0.0101,0.9877,0.0101,0.9877\n\"D1A34\",\"D1A34\",\"AppvIsvSubsystems64.dll\",0.0101,0.9870,0.0101,0.9870\n\"CC6EC\",\"CC6EC\",\"AppvIsvSubsystems64.dll\",0.0101,0.9856,0.0101,0.9856\n\"B6A7C\",\"B6A7C\",\"AppvIsvSubsystems64.dll\",0.0101,0.9855,0.0101,0.9855\n\"B4FAF\",\"B4FAF\",\"AppvIsvSubsystems64.dll\",0.0101,0.9853,0.0101,0.9853\n\"6D040\",\"6D040\",\"AppvIsvSubsystems64.dll\",0.0101,0.9825,0.0101,0.9825\n\"1F964\",\"1F964\",\"AppvIsvSubsystems64.dll\",0.0101,0.9817,0.0101,0.9817\n\"C0111\",\"C0111\",\"AppvIsvSubsystems64.dll\",0.0101,0.9810,0.0101,0.9810\n\"B5134\",\"B5134\",\"AppvIsvSubsystems64.dll\",0.0101,0.9804,0.0101,0.9804\n\"84A90\",\"84A90\",\"AppvIsvSubsystems64.dll\",0.0101,0.9800,0.0101,0.9800\n\"C5F86\",\"C5F86\",\"AppvIsvSubsystems64.dll\",0.0101,0.9800,0.0101,0.9800\n\"ADB4A\",\"ADB4A\",\"AppvIsvSubsystems64.dll\",0.0100,0.9791,0.0100,0.9791\n\"86F9\",\"86F9\",\"AppvIsvSubsystems64.dll\",0.0099,0.9691,0.0099,0.9691\n\"BF0D4\",\"BF0D4\",\"AppvIsvSubsystems64.dll\",0.0099,0.9599,0.0099,0.9599\n\"BF0BE\",\"BF0BE\",\"AppvIsvSubsystems64.dll\",0.0098,0.9508,0.0098,0.9508\n\"CD5C9\",\"CD5C9\",\"AppvIsvSubsystems64.dll\",0.0095,0.9249,0.0095,0.9249\n\"C9052\",\"C9052\",\"AppvIsvSubsystems64.dll\",0.0093,0.9027,0.0093,0.9027\n\"ADB53\",\"ADB53\",\"AppvIsvSubsystems64.dll\",0.0092,0.8951,0.0092,0.8951\n\"71351\",\"71351\",\"AppvIsvSubsystems64.dll\",0.0083,0.8070,0.0083,0.8070\n\"84FF8\",\"84FF8\",\"AppvIsvSubsystems64.dll\",0.0081,0.7849,0.0081,0.7849\n\"74E98\",\"74E98\",\"AppvIsvSubsystems64.dll\",0.0064,0.6257,0.0064,0.6257\n\"DB20\",\"DB20\",\"AppvIsvSubsystems64.dll\",0.0063,0.6101,0.0063,0.6101\n\"C820\",\"C820\",\"AppvIsvSubsystems64.dll\",0.0043,0.4178,0.0043,0.4178\n\"C5D15\",\"C5D15\",\"AppvIsvSubsystems64.dll\",0.0024,0.2311,0.0024,0.2311\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_C2R64.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"45508\",\"45508\",\"C2R64.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_CI.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"2CD14\",\"2CD14\",\"CI.dll\",0.0311,3.0293,0.0311,3.0293\n\"10767\",\"10767\",\"CI.dll\",0.0310,3.0244,0.0310,3.0244\n\"106C5\",\"106C5\",\"CI.dll\",0.0309,3.0060,0.0309,3.0060\n\"F874\",\"F874\",\"CI.dll\",0.0307,2.9915,0.0307,2.9915\n\"FFD1\",\"FFD1\",\"CI.dll\",0.0306,2.9858,0.0306,2.9858\n\"104D6\",\"104D6\",\"CI.dll\",0.0248,2.4146,0.0248,2.4146\n\"40B5\",\"40B5\",\"CI.dll\",0.0208,2.0256,0.0208,2.0256\n\"107EB\",\"107EB\",\"CI.dll\",0.0207,2.0207,0.0207,2.0207\n\"108EB\",\"108EB\",\"CI.dll\",0.0207,2.0148,0.0207,2.0148\n\"108DE\",\"108DE\",\"CI.dll\",0.0206,2.0087,0.0206,2.0087\n\"10850\",\"10850\",\"CI.dll\",0.0206,2.0081,0.0206,2.0081\n\"106D3\",\"106D3\",\"CI.dll\",0.0206,2.0068,0.0206,2.0068\n\"1011F\",\"1011F\",\"CI.dll\",0.0206,2.0033,0.0206,2.0033\n\"1092D\",\"1092D\",\"CI.dll\",0.0206,2.0030,0.0206,2.0030\n\"F6AF\",\"F6AF\",\"CI.dll\",0.0205,2.0018,0.0205,2.0018\n\"FE3E\",\"FE3E\",\"CI.dll\",0.0205,2.0010,0.0205,2.0010\n\"FEF0\",\"FEF0\",\"CI.dll\",0.0205,2.0009,0.0205,2.0009\n\"10755\",\"10755\",\"CI.dll\",0.0205,2.0006,0.0205,2.0006\n\"106AA\",\"106AA\",\"CI.dll\",0.0205,2.0004,0.0205,2.0004\n\"12B1C\",\"12B1C\",\"CI.dll\",0.0205,2.0000,0.0205,2.0000\n\"13355\",\"13355\",\"CI.dll\",0.0205,2.0000,0.0205,2.0000\n\"133C2\",\"133C2\",\"CI.dll\",0.0205,2.0000,0.0205,2.0000\n\"3C65\",\"3C65\",\"CI.dll\",0.0205,2.0000,0.0205,2.0000\n\"40C0\",\"40C0\",\"CI.dll\",0.0205,2.0000,0.0205,2.0000\n\"9164D\",\"9164D\",\"CI.dll\",0.0205,2.0000,0.0205,2.0000\n\"1085B\",\"1085B\",\"CI.dll\",0.0205,1.9996,0.0205,1.9996\n\"FE15\",\"FE15\",\"CI.dll\",0.0205,1.9992,0.0205,1.9992\n\"106C2\",\"106C2\",\"CI.dll\",0.0205,1.9987,0.0205,1.9987\n\"107A1\",\"107A1\",\"CI.dll\",0.0205,1.9984,0.0205,1.9984\n\"108BC\",\"108BC\",\"CI.dll\",0.0205,1.9980,0.0205,1.9980\n\"1077C\",\"1077C\",\"CI.dll\",0.0205,1.9979,0.0205,1.9979\n\"10919\",\"10919\",\"CI.dll\",0.0205,1.9973,0.0205,1.9973\n\"FE59\",\"FE59\",\"CI.dll\",0.0205,1.9963,0.0205,1.9963\n\"FA47\",\"FA47\",\"CI.dll\",0.0205,1.9955,0.0205,1.9955\n\"1044B\",\"1044B\",\"CI.dll\",0.0205,1.9949,0.0205,1.9949\n\"107FC\",\"107FC\",\"CI.dll\",0.0205,1.9935,0.0205,1.9935\n\"10916\",\"10916\",\"CI.dll\",0.0204,1.9905,0.0204,1.9905\n\"10932\",\"10932\",\"CI.dll\",0.0204,1.9894,0.0204,1.9894\n\"10924\",\"10924\",\"CI.dll\",0.0204,1.9841,0.0204,1.9841\n\"FA01\",\"FA01\",\"CI.dll\",0.0202,1.9685,0.0202,1.9685\n\"FBD6\",\"FBD6\",\"CI.dll\",0.0172,1.6721,0.0172,1.6721\n\"10855\",\"10855\",\"CI.dll\",0.0167,1.6286,0.0167,1.6286\n\"6EA7F\",\"6EA7F\",\"CI.dll\",0.0159,1.5519,0.0159,1.5519\n\"584A4\",\"584A4\",\"CI.dll\",0.0147,1.4296,0.0147,1.4296\n\"10861\",\"10861\",\"CI.dll\",0.0139,1.3577,0.0139,1.3577\n\"6FDC6\",\"6FDC6\",\"CI.dll\",0.0135,1.3130,0.0135,1.3130\n\"13549\",\"13549\",\"CI.dll\",0.0112,1.0960,0.0112,1.0960\n\"8F370\",\"8F370\",\"CI.dll\",0.0106,1.0365,0.0106,1.0365\n\"10461\",\"10461\",\"CI.dll\",0.0106,1.0298,0.0106,1.0298\n\"10758\",\"10758\",\"CI.dll\",0.0105,1.0231,0.0105,1.0231\n\"40BC\",\"40BC\",\"CI.dll\",0.0105,1.0224,0.0105,1.0224\n\"107E3\",\"107E3\",\"CI.dll\",0.0105,1.0203,0.0105,1.0203\n\"10908\",\"10908\",\"CI.dll\",0.0105,1.0192,0.0105,1.0192\n\"12542\",\"12542\",\"CI.dll\",0.0105,1.0186,0.0105,1.0186\n\"12508\",\"12508\",\"CI.dll\",0.0104,1.0144,0.0104,1.0144\n\"FD5B\",\"FD5B\",\"CI.dll\",0.0104,1.0137,0.0104,1.0137\n\"108C7\",\"108C7\",\"CI.dll\",0.0104,1.0127,0.0104,1.0127\n\"FEB5\",\"FEB5\",\"CI.dll\",0.0104,1.0111,0.0104,1.0111\n\"1371B\",\"1371B\",\"CI.dll\",0.0104,1.0106,0.0104,1.0106\n\"FB01\",\"FB01\",\"CI.dll\",0.0103,1.0082,0.0103,1.0082\n\"12632\",\"12632\",\"CI.dll\",0.0103,1.0080,0.0103,1.0080\n\"131D3\",\"131D3\",\"CI.dll\",0.0103,1.0074,0.0103,1.0074\n\"10271\",\"10271\",\"CI.dll\",0.0103,1.0073,0.0103,1.0073\n\"12340\",\"12340\",\"CI.dll\",0.0103,1.0059,0.0103,1.0059\n\"FFB7\",\"FFB7\",\"CI.dll\",0.0103,1.0059,0.0103,1.0059\n\"10841\",\"10841\",\"CI.dll\",0.0103,1.0057,0.0103,1.0057\n\"13403\",\"13403\",\"CI.dll\",0.0103,1.0057,0.0103,1.0057\n\"FCE8\",\"FCE8\",\"CI.dll\",0.0103,1.0052,0.0103,1.0052\n\"1003A\",\"1003A\",\"CI.dll\",0.0103,1.0051,0.0103,1.0051\n\"107CE\",\"107CE\",\"CI.dll\",0.0103,1.0051,0.0103,1.0051\n\"1370F\",\"1370F\",\"CI.dll\",0.0103,1.0048,0.0103,1.0048\n\"1326C\",\"1326C\",\"CI.dll\",0.0103,1.0046,0.0103,1.0046\n\"12061\",\"12061\",\"CI.dll\",0.0103,1.0041,0.0103,1.0041\n\"40B0\",\"40B0\",\"CI.dll\",0.0103,1.0041,0.0103,1.0041\n\"40D9\",\"40D9\",\"CI.dll\",0.0103,1.0030,0.0103,1.0030\n\"11F65\",\"11F65\",\"CI.dll\",0.0103,1.0028,0.0103,1.0028\n\"40D5\",\"40D5\",\"CI.dll\",0.0103,1.0028,0.0103,1.0028\n\"1002F\",\"1002F\",\"CI.dll\",0.0103,1.0027,0.0103,1.0027\n\"13601\",\"13601\",\"CI.dll\",0.0103,1.0026,0.0103,1.0026\n\"138D6\",\"138D6\",\"CI.dll\",0.0103,1.0026,0.0103,1.0026\n\"109C3\",\"109C3\",\"CI.dll\",0.0103,1.0025,0.0103,1.0025\n\"F6A1\",\"F6A1\",\"CI.dll\",0.0103,1.0024,0.0103,1.0024\n\"FF4A\",\"FF4A\",\"CI.dll\",0.0103,1.0024,0.0103,1.0024\n\"10675\",\"10675\",\"CI.dll\",0.0103,1.0023,0.0103,1.0023\n\"FC1A\",\"FC1A\",\"CI.dll\",0.0103,1.0022,0.0103,1.0022\n\"FF79\",\"FF79\",\"CI.dll\",0.0103,1.0022,0.0103,1.0022\n\"107D7\",\"107D7\",\"CI.dll\",0.0103,1.0020,0.0103,1.0020\n\"91954\",\"91954\",\"CI.dll\",0.0103,1.0020,0.0103,1.0020\n\"107A7\",\"107A7\",\"CI.dll\",0.0103,1.0018,0.0103,1.0018\n\"1084A\",\"1084A\",\"CI.dll\",0.0103,1.0018,0.0103,1.0018\n\"FBB0\",\"FBB0\",\"CI.dll\",0.0103,1.0018,0.0103,1.0018\n\"106C0\",\"106C0\",\"CI.dll\",0.0103,1.0015,0.0103,1.0015\n\"107E8\",\"107E8\",\"CI.dll\",0.0103,1.0015,0.0103,1.0015\n\"108BF\",\"108BF\",\"CI.dll\",0.0103,1.0015,0.0103,1.0015\n\"107AD\",\"107AD\",\"CI.dll\",0.0103,1.0014,0.0103,1.0014\n\"107C4\",\"107C4\",\"CI.dll\",0.0103,1.0014,0.0103,1.0014\n\"F882\",\"F882\",\"CI.dll\",0.0103,1.0013,0.0103,1.0013\n\"1005F\",\"1005F\",\"CI.dll\",0.0103,1.0012,0.0103,1.0012\n\"10113\",\"10113\",\"CI.dll\",0.0103,1.0012,0.0103,1.0012\n\"1016E\",\"1016E\",\"CI.dll\",0.0103,1.0007,0.0103,1.0007\n\"10771\",\"10771\",\"CI.dll\",0.0103,1.0007,0.0103,1.0007\n\"10798\",\"10798\",\"CI.dll\",0.0103,1.0007,0.0103,1.0007\n\"2C544\",\"2C544\",\"CI.dll\",0.0103,1.0007,0.0103,1.0007\n\"106A4\",\"106A4\",\"CI.dll\",0.0103,1.0005,0.0103,1.0005\n\"106FF\",\"106FF\",\"CI.dll\",0.0103,1.0005,0.0103,1.0005\n\"1093C\",\"1093C\",\"CI.dll\",0.0103,1.0005,0.0103,1.0005\n\"10954\",\"10954\",\"CI.dll\",0.0103,1.0005,0.0103,1.0005\n\"FC4A\",\"FC4A\",\"CI.dll\",0.0103,1.0004,0.0103,1.0004\n\"131ED\",\"131ED\",\"CI.dll\",0.0103,1.0003,0.0103,1.0003\n\"FAC0\",\"FAC0\",\"CI.dll\",0.0103,1.0003,0.0103,1.0003\n\"1070F\",\"1070F\",\"CI.dll\",0.0103,1.0002,0.0103,1.0002\n\"100A9\",\"100A9\",\"CI.dll\",0.0103,1.0001,0.0103,1.0001\n\"109B3\",\"109B3\",\"CI.dll\",0.0103,1.0000,0.0103,1.0000\n\"FFE9\",\"FFE9\",\"CI.dll\",0.0103,1.0000,0.0103,1.0000\n\"FF86\",\"FF86\",\"CI.dll\",0.0103,0.9999,0.0103,0.9999\n\"103F0\",\"103F0\",\"CI.dll\",0.0103,0.9997,0.0103,0.9997\n\"106B8\",\"106B8\",\"CI.dll\",0.0103,0.9995,0.0103,0.9995\n\"106E6\",\"106E6\",\"CI.dll\",0.0103,0.9994,0.0103,0.9994\n\"FA55\",\"FA55\",\"CI.dll\",0.0103,0.9992,0.0103,0.9992\n\"FE8E\",\"FE8E\",\"CI.dll\",0.0103,0.9992,0.0103,0.9992\n\"FFA1\",\"FFA1\",\"CI.dll\",0.0103,0.9992,0.0103,0.9992\n\"106F7\",\"106F7\",\"CI.dll\",0.0103,0.9990,0.0103,0.9990\n\"FB85\",\"FB85\",\"CI.dll\",0.0103,0.9989,0.0103,0.9989\n\"FD9F\",\"FD9F\",\"CI.dll\",0.0103,0.9989,0.0103,0.9989\n\"10705\",\"10705\",\"CI.dll\",0.0103,0.9988,0.0103,0.9988\n\"105E9\",\"105E9\",\"CI.dll\",0.0103,0.9987,0.0103,0.9987\n\"107E6\",\"107E6\",\"CI.dll\",0.0103,0.9987,0.0103,0.9987\n\"108B1\",\"108B1\",\"CI.dll\",0.0103,0.9987,0.0103,0.9987\n\"109D1\",\"109D1\",\"CI.dll\",0.0103,0.9987,0.0103,0.9987\n\"1087D\",\"1087D\",\"CI.dll\",0.0102,0.9985,0.0102,0.9985\n\"1071F\",\"1071F\",\"CI.dll\",0.0102,0.9984,0.0102,0.9984\n\"1088B\",\"1088B\",\"CI.dll\",0.0102,0.9984,0.0102,0.9984\n\"10910\",\"10910\",\"CI.dll\",0.0102,0.9984,0.0102,0.9984\n\"1012D\",\"1012D\",\"CI.dll\",0.0102,0.9983,0.0102,0.9983\n\"1014D\",\"1014D\",\"CI.dll\",0.0102,0.9983,0.0102,0.9983\n\"107DD\",\"107DD\",\"CI.dll\",0.0102,0.9983,0.0102,0.9983\n\"1088D\",\"1088D\",\"CI.dll\",0.0102,0.9981,0.0102,0.9981\n\"FD2B\",\"FD2B\",\"CI.dll\",0.0102,0.9981,0.0102,0.9981\n\"FE7C\",\"FE7C\",\"CI.dll\",0.0102,0.9977,0.0102,0.9977\n\"4139\",\"4139\",\"CI.dll\",0.0102,0.9976,0.0102,0.9976\n\"FFBD\",\"FFBD\",\"CI.dll\",0.0102,0.9976,0.0102,0.9976\n\"F9BF\",\"F9BF\",\"CI.dll\",0.0102,0.9974,0.0102,0.9974\n\"FF1B\",\"FF1B\",\"CI.dll\",0.0102,0.9974,0.0102,0.9974\n\"10960\",\"10960\",\"CI.dll\",0.0102,0.9973,0.0102,0.9973\n\"1092A\",\"1092A\",\"CI.dll\",0.0102,0.9972,0.0102,0.9972\n\"1023F\",\"1023F\",\"CI.dll\",0.0102,0.9969,0.0102,0.9969\n\"F758\",\"F758\",\"CI.dll\",0.0102,0.9968,0.0102,0.9968\n\"13343\",\"13343\",\"CI.dll\",0.0102,0.9966,0.0102,0.9966\n\"FDAD\",\"FDAD\",\"CI.dll\",0.0102,0.9965,0.0102,0.9965\n\"10101\",\"10101\",\"CI.dll\",0.0102,0.9964,0.0102,0.9964\n\"10730\",\"10730\",\"CI.dll\",0.0102,0.9964,0.0102,0.9964\n\"10690\",\"10690\",\"CI.dll\",0.0102,0.9961,0.0102,0.9961\n\"10793\",\"10793\",\"CI.dll\",0.0102,0.9961,0.0102,0.9961\n\"10714\",\"10714\",\"CI.dll\",0.0102,0.9958,0.0102,0.9958\n\"FB34\",\"FB34\",\"CI.dll\",0.0102,0.9958,0.0102,0.9958\n\"FEEB\",\"FEEB\",\"CI.dll\",0.0102,0.9956,0.0102,0.9956\n\"1046D\",\"1046D\",\"CI.dll\",0.0102,0.9951,0.0102,0.9951\n\"106FA\",\"106FA\",\"CI.dll\",0.0102,0.9951,0.0102,0.9951\n\"FBCC\",\"FBCC\",\"CI.dll\",0.0102,0.9951,0.0102,0.9951\n\"10947\",\"10947\",\"CI.dll\",0.0102,0.9950,0.0102,0.9950\n\"106D0\",\"106D0\",\"CI.dll\",0.0102,0.9949,0.0102,0.9949\n\"106E9\",\"106E9\",\"CI.dll\",0.0102,0.9945,0.0102,0.9945\n\"FD7E\",\"FD7E\",\"CI.dll\",0.0102,0.9945,0.0102,0.9945\n\"F959\",\"F959\",\"CI.dll\",0.0102,0.9943,0.0102,0.9943\n\"10805\",\"10805\",\"CI.dll\",0.0102,0.9939,0.0102,0.9939\n\"F96A\",\"F96A\",\"CI.dll\",0.0102,0.9936,0.0102,0.9936\n\"FE69\",\"FE69\",\"CI.dll\",0.0102,0.9936,0.0102,0.9936\n\"FA9D\",\"FA9D\",\"CI.dll\",0.0102,0.9934,0.0102,0.9934\n\"108AE\",\"108AE\",\"CI.dll\",0.0102,0.9930,0.0102,0.9930\n\"10746\",\"10746\",\"CI.dll\",0.0102,0.9928,0.0102,0.9928\n\"10484\",\"10484\",\"CI.dll\",0.0102,0.9926,0.0102,0.9926\n\"102D1\",\"102D1\",\"CI.dll\",0.0102,0.9921,0.0102,0.9921\n\"10763\",\"10763\",\"CI.dll\",0.0102,0.9920,0.0102,0.9920\n\"172B\",\"172B\",\"CI.dll\",0.0102,0.9912,0.0102,0.9912\n\"FF21\",\"FF21\",\"CI.dll\",0.0102,0.9910,0.0102,0.9910\n\"1086A\",\"1086A\",\"CI.dll\",0.0102,0.9901,0.0102,0.9901\n\"108CD\",\"108CD\",\"CI.dll\",0.0102,0.9898,0.0102,0.9898\n\"10255\",\"10255\",\"CI.dll\",0.0101,0.9879,0.0101,0.9879\n\"10711\",\"10711\",\"CI.dll\",0.0101,0.9871,0.0101,0.9871\n\"12518\",\"12518\",\"CI.dll\",0.0101,0.9868,0.0101,0.9868\n\"106D8\",\"106D8\",\"CI.dll\",0.0101,0.9866,0.0101,0.9866\n\"FD1F\",\"FD1F\",\"CI.dll\",0.0101,0.9863,0.0101,0.9863\n\"106D5\",\"106D5\",\"CI.dll\",0.0101,0.9830,0.0101,0.9830\n\"F974\",\"F974\",\"CI.dll\",0.0101,0.9825,0.0101,0.9825\n\"10327\",\"10327\",\"CI.dll\",0.0101,0.9822,0.0101,0.9822\n\"1003D\",\"1003D\",\"CI.dll\",0.0100,0.9754,0.0100,0.9754\n\"10568\",\"10568\",\"CI.dll\",0.0075,0.7309,0.0075,0.7309\n\"10881\",\"10881\",\"CI.dll\",0.0066,0.6421,0.0066,0.6421\n\"FFDB\",\"FFDB\",\"CI.dll\",0.0062,0.6081,0.0062,0.6081\n\"133F1\",\"133F1\",\"CI.dll\",0.0061,0.5974,0.0061,0.5974\n\"40E0\",\"40E0\",\"CI.dll\",0.0054,0.5225,0.0054,0.5225\n\"106EB\",\"106EB\",\"CI.dll\",0.0046,0.4480,0.0046,0.4480\n\"131F9\",\"131F9\",\"CI.dll\",0.0040,0.3919,0.0040,0.3919\n\"F743\",\"F743\",\"CI.dll\",0.0040,0.3887,0.0040,0.3887\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_CoreMessaging.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"62608\",\"62608\",\"CoreMessaging.dll\",0.0205,2.0000,0.0205,2.0000\n\"6E100\",\"6E100\",\"CoreMessaging.dll\",0.0205,2.0000,0.0205,2.0000\n\"9F7D\",\"9F7D\",\"CoreMessaging.dll\",0.0205,2.0000,0.0205,2.0000\n\"1E340\",\"1E340\",\"CoreMessaging.dll\",0.0104,1.0134,0.0104,1.0134\n\"1E3FB\",\"1E3FB\",\"CoreMessaging.dll\",0.0101,0.9845,0.0101,0.9845\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_DWrite.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"74EA3\",\"74EA3\",\"DWrite.dll\",0.0215,2.0907,0.0215,2.0907\n\"C3F95\",\"C3F95\",\"DWrite.dll\",0.0213,2.0791,0.0213,2.0791\n\"8241\",\"8241\",\"DWrite.dll\",0.0205,2.0022,0.0205,2.0022\n\"5AB3E\",\"5AB3E\",\"DWrite.dll\",0.0205,2.0000,0.0205,2.0000\n\"45C1E\",\"45C1E\",\"DWrite.dll\",0.0169,1.6458,0.0169,1.6458\n\"A5BC9\",\"A5BC9\",\"DWrite.dll\",0.0156,1.5226,0.0156,1.5226\n\"5FD69\",\"5FD69\",\"DWrite.dll\",0.0154,1.5040,0.0154,1.5040\n\"22F33\",\"22F33\",\"DWrite.dll\",0.0148,1.4406,0.0148,1.4406\n\"60CB9\",\"60CB9\",\"DWrite.dll\",0.0145,1.4110,0.0145,1.4110\n\"3D8E8\",\"3D8E8\",\"DWrite.dll\",0.0137,1.3344,0.0137,1.3344\n\"517F8\",\"517F8\",\"DWrite.dll\",0.0115,1.1234,0.0115,1.1234\n\"97C90\",\"97C90\",\"DWrite.dll\",0.0114,1.1074,0.0114,1.1074\n\"5A895\",\"5A895\",\"DWrite.dll\",0.0110,1.0755,0.0110,1.0755\n\"CD776\",\"CD776\",\"DWrite.dll\",0.0108,1.0514,0.0108,1.0514\n\"97DEE\",\"97DEE\",\"DWrite.dll\",0.0106,1.0356,0.0106,1.0356\n\"59BFF\",\"59BFF\",\"DWrite.dll\",0.0105,1.0231,0.0105,1.0231\n\"3CF88\",\"3CF88\",\"DWrite.dll\",0.0104,1.0125,0.0104,1.0125\n\"84A9C\",\"84A9C\",\"DWrite.dll\",0.0104,1.0100,0.0104,1.0100\n\"22EFC\",\"22EFC\",\"DWrite.dll\",0.0103,1.0072,0.0103,1.0072\n\"F3E64\",\"F3E64\",\"DWrite.dll\",0.0103,1.0066,0.0103,1.0066\n\"4487B\",\"4487B\",\"DWrite.dll\",0.0103,1.0037,0.0103,1.0037\n\"4B236\",\"4B236\",\"DWrite.dll\",0.0103,1.0034,0.0103,1.0034\n\"D7C06\",\"D7C06\",\"DWrite.dll\",0.0103,1.0029,0.0103,1.0029\n\"10C22C\",\"10C22C\",\"DWrite.dll\",0.0103,1.0015,0.0103,1.0015\n\"4A97A\",\"4A97A\",\"DWrite.dll\",0.0103,1.0015,0.0103,1.0015\n\"D4440\",\"D4440\",\"DWrite.dll\",0.0103,1.0015,0.0103,1.0015\n\"17573\",\"17573\",\"DWrite.dll\",0.0103,1.0013,0.0103,1.0013\n\"84A7E\",\"84A7E\",\"DWrite.dll\",0.0103,1.0013,0.0103,1.0013\n\"214A1\",\"214A1\",\"DWrite.dll\",0.0103,1.0000,0.0103,1.0000\n\"1F573\",\"1F573\",\"DWrite.dll\",0.0102,0.9979,0.0102,0.9979\n\"2089C\",\"2089C\",\"DWrite.dll\",0.0102,0.9971,0.0102,0.9971\n\"D499D\",\"D499D\",\"DWrite.dll\",0.0102,0.9971,0.0102,0.9971\n\"FCD8C\",\"FCD8C\",\"DWrite.dll\",0.0102,0.9959,0.0102,0.9959\n\"60CBF\",\"60CBF\",\"DWrite.dll\",0.0102,0.9956,0.0102,0.9956\n\"84BE2\",\"84BE2\",\"DWrite.dll\",0.0102,0.9930,0.0102,0.9930\n\"B6C2F\",\"B6C2F\",\"DWrite.dll\",0.0102,0.9920,0.0102,0.9920\n\"2002F\",\"2002F\",\"DWrite.dll\",0.0101,0.9863,0.0101,0.9863\n\"22A1E\",\"22A1E\",\"DWrite.dll\",0.0100,0.9771,0.0100,0.9771\n\"8476D\",\"8476D\",\"DWrite.dll\",0.0096,0.9387,0.0096,0.9387\n\"44F6E\",\"44F6E\",\"DWrite.dll\",0.0089,0.8629,0.0089,0.8629\n\"5439D\",\"5439D\",\"DWrite.dll\",0.0085,0.8248,0.0085,0.8248\n\"66247\",\"66247\",\"DWrite.dll\",0.0072,0.7016,0.0072,0.7016\n\"977CB\",\"977CB\",\"DWrite.dll\",0.0056,0.5458,0.0056,0.5458\n\"99A60\",\"99A60\",\"DWrite.dll\",0.0039,0.3757,0.0039,0.3757\n\"960C0\",\"960C0\",\"DWrite.dll\",0.0031,0.3058,0.0031,0.3058\n\"6B022\",\"6B022\",\"DWrite.dll\",0.0031,0.3029,0.0031,0.3029\n\"A5BC3\",\"A5BC3\",\"DWrite.dll\",0.0027,0.2625,0.0027,0.2625\n\"9CF44\",\"9CF44\",\"DWrite.dll\",0.0014,0.1398,0.0014,0.1398\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_EMSMDB32.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"4FF91\",\"4FF91\",\"EMSMDB32.DLL\",0.0206,2.0028,0.0206,2.0028\n\"169330\",\"169330\",\"EMSMDB32.DLL\",0.0205,2.0000,0.0205,2.0000\n\"8BDCD\",\"8BDCD\",\"EMSMDB32.DLL\",0.0203,1.9783,0.0203,1.9783\n\"28F1C0\",\"28F1C0\",\"EMSMDB32.DLL\",0.0107,1.0383,0.0107,1.0383\n\"2CC1A0\",\"2CC1A0\",\"EMSMDB32.DLL\",0.0101,0.9848,0.0101,0.9848\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_FLTMGR.SYS_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"B718\",\"B718\",\"FLTMGR.SYS\",0.0292,2.8449,0.0292,2.8449\n\"1DD39\",\"1DD39\",\"FLTMGR.SYS\",0.0221,2.1558,0.0221,2.1558\n\"1D4D9\",\"1D4D9\",\"FLTMGR.SYS\",0.0205,2.0000,0.0205,2.0000\n\"4987\",\"4987\",\"FLTMGR.SYS\",0.0205,2.0000,0.0205,2.0000\n\"538F9\",\"538F9\",\"FLTMGR.SYS\",0.0205,2.0000,0.0205,2.0000\n\"B700\",\"B700\",\"FLTMGR.SYS\",0.0205,2.0000,0.0205,2.0000\n\"84E5\",\"84E5\",\"FLTMGR.SYS\",0.0178,1.7331,0.0178,1.7331\n\"4860\",\"4860\",\"FLTMGR.SYS\",0.0171,1.6670,0.0171,1.6670\n\"46CA\",\"46CA\",\"FLTMGR.SYS\",0.0147,1.4279,0.0147,1.4279\n\"55B96\",\"55B96\",\"FLTMGR.SYS\",0.0144,1.4053,0.0144,1.4053\n\"5CD7\",\"5CD7\",\"FLTMGR.SYS\",0.0110,1.0707,0.0110,1.0707\n\"1541C\",\"1541C\",\"FLTMGR.SYS\",0.0107,1.0385,0.0107,1.0385\n\"55626\",\"55626\",\"FLTMGR.SYS\",0.0106,1.0339,0.0106,1.0339\n\"15419\",\"15419\",\"FLTMGR.SYS\",0.0104,1.0155,0.0104,1.0155\n\"7D85\",\"7D85\",\"FLTMGR.SYS\",0.0104,1.0128,0.0104,1.0128\n\"1E238\",\"1E238\",\"FLTMGR.SYS\",0.0102,0.9971,0.0102,0.9971\n\"1D8D5\",\"1D8D5\",\"FLTMGR.SYS\",0.0101,0.9804,0.0101,0.9804\n\"18439\",\"18439\",\"FLTMGR.SYS\",0.0086,0.8345,0.0086,0.8345\n\"85E1\",\"85E1\",\"FLTMGR.SYS\",0.0074,0.7196,0.0074,0.7196\n\"84F0\",\"84F0\",\"FLTMGR.SYS\",0.0066,0.6399,0.0066,0.6399\n\"85B0\",\"85B0\",\"FLTMGR.SYS\",0.0063,0.6154,0.0063,0.6154\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_FlightSettings.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"3D048\",\"3D048\",\"FlightSettings.dll\",0.0219,2.1378,0.0219,2.1378\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_IPHLPAPI.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"7C2A\",\"7C2A\",\"IPHLPAPI.DLL\",0.0102,0.9897,0.0102,0.9897\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_KernelBase.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"B8F70\",\"B8F70\",\"KernelBase.dll\",0.0576,5.6111,0.0576,5.6111\n\"3CEB0\",\"3CEB0\",\"KernelBase.dll\",0.0561,5.4674,0.0561,5.4674\n\"4D2B0\",\"4D2B0\",\"KernelBase.dll\",0.0456,4.4431,0.0456,4.4431\n\"63B9B\",\"63B9B\",\"KernelBase.dll\",0.0411,4.0000,0.0411,4.0000\n\"69A8\",\"69A8\",\"KernelBase.dll\",0.0356,3.4651,0.0356,3.4651\n\"5F6D0\",\"5F6D0\",\"KernelBase.dll\",0.0310,3.0215,0.0310,3.0215\n\"73C1\",\"73C1\",\"KernelBase.dll\",0.0308,3.0008,0.0308,3.0008\n\"3CB13\",\"3CB13\",\"KernelBase.dll\",0.0308,2.9967,0.0308,2.9967\n\"9A7B0\",\"9A7B0\",\"KernelBase.dll\",0.0308,2.9967,0.0308,2.9967\n\"73FB\",\"73FB\",\"KernelBase.dll\",0.0307,2.9886,0.0307,2.9886\n\"3E008\",\"3E008\",\"KernelBase.dll\",0.0307,2.9871,0.0307,2.9871\n\"7409\",\"7409\",\"KernelBase.dll\",0.0306,2.9804,0.0306,2.9804\n\"C5C90\",\"C5C90\",\"KernelBase.dll\",0.0295,2.8767,0.0295,2.8767\n\"6BF5\",\"6BF5\",\"KernelBase.dll\",0.0283,2.7578,0.0283,2.7578\n\"FA110\",\"FA110\",\"KernelBase.dll\",0.0271,2.6384,0.0271,2.6384\n\"3DFD1\",\"3DFD1\",\"KernelBase.dll\",0.0220,2.1393,0.0220,2.1393\n\"3CEBC\",\"3CEBC\",\"KernelBase.dll\",0.0206,2.0093,0.0206,2.0093\n\"11529\",\"11529\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"37180\",\"37180\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"3BA5E\",\"3BA5E\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"3CB7E\",\"3CB7E\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"3CE99\",\"3CE99\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"3CF6E\",\"3CF6E\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"3DF33\",\"3DF33\",\"KernelBase.dll\",0.0205,2.0000,0.1334,12.9928\n\"3E02C\",\"3E02C\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"63589\",\"63589\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"6983\",\"6983\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"746C\",\"746C\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"8A35\",\"8A35\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"C363\",\"C363\",\"KernelBase.dll\",0.0205,2.0000,0.0205,2.0000\n\"3E052\",\"3E052\",\"KernelBase.dll\",0.0205,1.9986,0.0205,1.9986\n\"B8650\",\"B8650\",\"KernelBase.dll\",0.0205,1.9976,0.0205,1.9976\n\"3E038\",\"3E038\",\"KernelBase.dll\",0.0205,1.9956,0.0205,1.9956\n\"5FC07\",\"5FC07\",\"KernelBase.dll\",0.0204,1.9884,0.0204,1.9884\n\"3E099\",\"3E099\",\"KernelBase.dll\",0.0203,1.9752,0.0203,1.9752\n\"61856\",\"61856\",\"KernelBase.dll\",0.0203,1.9749,0.0203,1.9749\n\"8A55\",\"8A55\",\"KernelBase.dll\",0.0201,1.9621,0.0201,1.9621\n\"C30B0\",\"C30B0\",\"KernelBase.dll\",0.0189,1.8421,0.0189,1.8421\n\"3CB48\",\"3CB48\",\"KernelBase.dll\",0.0163,1.5835,0.0163,1.5835\n\"3CE52\",\"3CE52\",\"KernelBase.dll\",0.0156,1.5238,0.0156,1.5238\n\"37B10\",\"37B10\",\"KernelBase.dll\",0.0155,1.5097,0.0155,1.5097\n\"60F95\",\"60F95\",\"KernelBase.dll\",0.0146,1.4230,0.0146,1.4230\n\"3E0A3\",\"3E0A3\",\"KernelBase.dll\",0.0142,1.3851,0.0142,1.3851\n\"57EA3\",\"57EA3\",\"KernelBase.dll\",0.0136,1.3220,0.0136,1.3220\n\"ABB80\",\"ABB80\",\"KernelBase.dll\",0.0127,1.2395,0.0127,1.2395\n\"73F7\",\"73F7\",\"KernelBase.dll\",0.0121,1.1787,0.0121,1.1787\n\"1336AA\",\"1336AA\",\"KernelBase.dll\",0.0115,1.1212,0.0115,1.1212\n\"3E16D\",\"3E16D\",\"KernelBase.dll\",0.0108,1.0480,0.0108,1.0480\n\"1FFE0\",\"1FFE0\",\"KernelBase.dll\",0.0107,1.0396,0.0107,1.0396\n\"5AF40\",\"5AF40\",\"KernelBase.dll\",0.0105,1.0185,0.0105,1.0185\n\"A1A0\",\"A1A0\",\"KernelBase.dll\",0.0104,1.0092,0.0104,1.0092\n\"2EC90\",\"2EC90\",\"KernelBase.dll\",0.0103,1.0056,0.0103,1.0056\n\"7439\",\"7439\",\"KernelBase.dll\",0.0103,1.0041,0.0103,1.0041\n\"73CB\",\"73CB\",\"KernelBase.dll\",0.0103,1.0028,0.0103,1.0028\n\"3DFAE\",\"3DFAE\",\"KernelBase.dll\",0.0103,1.0024,0.0103,1.0024\n\"3CE93\",\"3CE93\",\"KernelBase.dll\",0.0103,1.0022,0.0103,1.0022\n\"371D7\",\"371D7\",\"KernelBase.dll\",0.0103,1.0021,0.0103,1.0021\n\"19C4B8\",\"19C4B8\",\"KernelBase.dll\",0.0103,1.0010,0.0103,1.0010\n\"84E02\",\"84E02\",\"KernelBase.dll\",0.0103,1.0004,0.0103,1.0004\n\"57EB8\",\"57EB8\",\"KernelBase.dll\",0.0103,1.0000,0.0103,1.0000\n\"738B\",\"738B\",\"KernelBase.dll\",0.0103,0.9994,0.0103,0.9994\n\"3F978\",\"3F978\",\"KernelBase.dll\",0.0103,0.9989,0.0103,0.9989\n\"3DF46\",\"3DF46\",\"KernelBase.dll\",0.0102,0.9985,0.0102,0.9985\n\"3CA8F\",\"3CA8F\",\"KernelBase.dll\",0.0102,0.9980,0.0102,0.9980\n\"5D306\",\"5D306\",\"KernelBase.dll\",0.0102,0.9977,0.0102,0.9977\n\"3B870\",\"3B870\",\"KernelBase.dll\",0.0102,0.9976,0.0102,0.9976\n\"D6200\",\"D6200\",\"KernelBase.dll\",0.0102,0.9976,0.0102,0.9976\n\"3E0AE\",\"3E0AE\",\"KernelBase.dll\",0.0102,0.9971,0.0102,0.9971\n\"1AA8C\",\"1AA8C\",\"KernelBase.dll\",0.0102,0.9970,0.0102,0.9970\n\"8A61\",\"8A61\",\"KernelBase.dll\",0.0102,0.9966,0.0102,0.9966\n\"3DE2D\",\"3DE2D\",\"KernelBase.dll\",0.0102,0.9960,0.0102,0.9960\n\"60EB8\",\"60EB8\",\"KernelBase.dll\",0.0102,0.9958,0.0102,0.9958\n\"3EC93\",\"3EC93\",\"KernelBase.dll\",0.0102,0.9956,0.0102,0.9956\n\"4D33C\",\"4D33C\",\"KernelBase.dll\",0.0102,0.9953,0.0102,0.9953\n\"631B7\",\"631B7\",\"KernelBase.dll\",0.0102,0.9953,0.0102,0.9953\n\"C2A0\",\"C2A0\",\"KernelBase.dll\",0.0102,0.9951,0.0102,0.9951\n\"194DD7\",\"194DD7\",\"KernelBase.dll\",0.0102,0.9942,0.0102,0.9942\n\"4DFCC\",\"4DFCC\",\"KernelBase.dll\",0.0102,0.9939,0.0102,0.9939\n\"3CEC5\",\"3CEC5\",\"KernelBase.dll\",0.0102,0.9938,0.0102,0.9938\n\"C1B70\",\"C1B70\",\"KernelBase.dll\",0.0102,0.9933,0.0102,0.9933\n\"3E065\",\"3E065\",\"KernelBase.dll\",0.0102,0.9930,0.0102,0.9930\n\"5EB6F\",\"5EB6F\",\"KernelBase.dll\",0.0102,0.9930,0.0102,0.9930\n\"134C3\",\"134C3\",\"KernelBase.dll\",0.0102,0.9926,0.0102,0.9926\n\"CC4F0\",\"CC4F0\",\"KernelBase.dll\",0.0102,0.9925,0.0102,0.9925\n\"4EC59\",\"4EC59\",\"KernelBase.dll\",0.0102,0.9924,0.0102,0.9924\n\"3E09C\",\"3E09C\",\"KernelBase.dll\",0.0102,0.9915,0.0102,0.9915\n\"60FFA\",\"60FFA\",\"KernelBase.dll\",0.0102,0.9914,0.0102,0.9914\n\"3CB17\",\"3CB17\",\"KernelBase.dll\",0.0102,0.9912,0.0102,0.9912\n\"84E31\",\"84E31\",\"KernelBase.dll\",0.0102,0.9912,0.0102,0.9912\n\"7449\",\"7449\",\"KernelBase.dll\",0.0102,0.9906,0.0102,0.9906\n\"103430\",\"103430\",\"KernelBase.dll\",0.0102,0.9896,0.0102,0.9896\n\"1345CE\",\"1345CE\",\"KernelBase.dll\",0.0102,0.9891,0.0102,0.9891\n\"AD170\",\"AD170\",\"KernelBase.dll\",0.0101,0.9870,0.0101,0.9870\n\"631B0\",\"631B0\",\"KernelBase.dll\",0.0101,0.9856,0.0101,0.9856\n\"A521F\",\"A521F\",\"KernelBase.dll\",0.0101,0.9840,0.0101,0.9840\n\"3CA0B\",\"3CA0B\",\"KernelBase.dll\",0.0101,0.9837,0.0101,0.9837\n\"C78C0\",\"C78C0\",\"KernelBase.dll\",0.0101,0.9830,0.0101,0.9830\n\"3E0A5\",\"3E0A5\",\"KernelBase.dll\",0.0100,0.9759,0.0100,0.9759\n\"43470\",\"43470\",\"KernelBase.dll\",0.0100,0.9709,0.0100,0.9709\n\"3CF72\",\"3CF72\",\"KernelBase.dll\",0.0100,0.9705,0.0100,0.9705\n\"87FFF\",\"87FFF\",\"KernelBase.dll\",0.0096,0.9400,0.0096,0.9400\n\"1AA32\",\"1AA32\",\"KernelBase.dll\",0.0073,0.7088,0.0073,0.7088\n\"84DF0\",\"84DF0\",\"KernelBase.dll\",0.0056,0.5440,0.0056,0.5440\n\"56970\",\"56970\",\"KernelBase.dll\",0.0050,0.4909,0.0050,0.4909\n\"3CDBB\",\"3CDBB\",\"KernelBase.dll\",0.0042,0.4136,0.0042,0.4136\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_MSO.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"3F723\",\"3F723\",\"MSO.DLL\",0.0270,2.6319,0.0270,2.6319\n\"191DE\",\"191DE\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"197A80\",\"197A80\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"1F9F0\",\"1F9F0\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"3F1F0\",\"3F1F0\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"443FC\",\"443FC\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"6A172\",\"6A172\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"87F00C\",\"87F00C\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"C41F1\",\"C41F1\",\"MSO.DLL\",0.0205,2.0000,0.0205,2.0000\n\"15701\",\"15701\",\"MSO.DLL\",0.0205,1.9981,0.0205,1.9981\n\"3F6D9\",\"3F6D9\",\"MSO.DLL\",0.0198,1.9300,0.0198,1.9300\n\"80E83\",\"80E83\",\"MSO.DLL\",0.0120,1.1687,0.0120,1.1687\n\"81751\",\"81751\",\"MSO.DLL\",0.0117,1.1381,0.0117,1.1381\n\"3F6B8\",\"3F6B8\",\"MSO.DLL\",0.0108,1.0561,0.0108,1.0561\n\"12D543D\",\"12D543D\",\"MSO.DLL\",0.0105,1.0228,0.0105,1.0228\n\"1840E0\",\"1840E0\",\"MSO.DLL\",0.0103,0.9994,0.0103,0.9994\n\"EC7E0\",\"EC7E0\",\"MSO.DLL\",0.0102,0.9976,0.0102,0.9976\n\"89460\",\"89460\",\"MSO.DLL\",0.0102,0.9904,0.0102,0.9904\n\"933C0\",\"933C0\",\"MSO.DLL\",0.0101,0.9827,0.0101,0.9827\n\"693376\",\"693376\",\"MSO.DLL\",0.0100,0.9758,0.0100,0.9758\n\"114A10\",\"114A10\",\"MSO.DLL\",0.0091,0.8875,0.0091,0.8875\n\"44ADE2\",\"44ADE2\",\"MSO.DLL\",0.0091,0.8850,0.0091,0.8850\n\"D1A50\",\"D1A50\",\"MSO.DLL\",0.0080,0.7772,0.0080,0.7772\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_MSOARIA.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"8F5D\",\"8F5D\",\"MSOARIA.DLL\",0.0514,5.0066,0.0514,5.0066\n\"120CAE\",\"120CAE\",\"MSOARIA.DLL\",0.0416,4.0559,0.0416,4.0559\n\"8947D\",\"8947D\",\"MSOARIA.DLL\",0.0308,3.0036,0.0308,3.0036\n\"120C8B\",\"120C8B\",\"MSOARIA.DLL\",0.0305,2.9706,0.0305,2.9706\n\"EF441\",\"EF441\",\"MSOARIA.DLL\",0.0278,2.7062,0.0278,2.7062\n\"6951\",\"6951\",\"MSOARIA.DLL\",0.0205,2.0004,0.0205,2.0004\n\"11C8E\",\"11C8E\",\"MSOARIA.DLL\",0.0205,2.0000,0.0205,2.0000\n\"1217B6\",\"1217B6\",\"MSOARIA.DLL\",0.0205,2.0000,0.0205,2.0000\n\"1218B9\",\"1218B9\",\"MSOARIA.DLL\",0.0205,2.0000,0.0205,2.0000\n\"85EA3\",\"85EA3\",\"MSOARIA.DLL\",0.0205,2.0000,0.0205,2.0000\n\"89AEE\",\"89AEE\",\"MSOARIA.DLL\",0.0205,2.0000,0.0205,2.0000\n\"12196C\",\"12196C\",\"MSOARIA.DLL\",0.0204,1.9919,0.0204,1.9919\n\"121956\",\"121956\",\"MSOARIA.DLL\",0.0204,1.9887,0.0204,1.9887\n\"12191E\",\"12191E\",\"MSOARIA.DLL\",0.0204,1.9883,0.0204,1.9883\n\"121982\",\"121982\",\"MSOARIA.DLL\",0.0204,1.9879,0.0204,1.9879\n\"88436\",\"88436\",\"MSOARIA.DLL\",0.0203,1.9827,0.0203,1.9827\n\"9D2FB\",\"9D2FB\",\"MSOARIA.DLL\",0.0179,1.7402,0.0179,1.7402\n\"3BAA3\",\"3BAA3\",\"MSOARIA.DLL\",0.0125,1.2211,0.0125,1.2211\n\"1234CD\",\"1234CD\",\"MSOARIA.DLL\",0.0112,1.0930,0.0112,1.0930\n\"768E\",\"768E\",\"MSOARIA.DLL\",0.0103,1.0056,0.0103,1.0056\n\"E7A6\",\"E7A6\",\"MSOARIA.DLL\",0.0103,1.0044,0.0103,1.0044\n\"395A1\",\"395A1\",\"MSOARIA.DLL\",0.0103,1.0043,0.0103,1.0043\n\"7C1C3\",\"7C1C3\",\"MSOARIA.DLL\",0.0103,1.0038,0.0103,1.0038\n\"120C37\",\"120C37\",\"MSOARIA.DLL\",0.0103,1.0033,0.0103,1.0033\n\"9BC63\",\"9BC63\",\"MSOARIA.DLL\",0.0103,1.0033,0.0103,1.0033\n\"8A94\",\"8A94\",\"MSOARIA.DLL\",0.0103,1.0030,0.0103,1.0030\n\"1235E6\",\"1235E6\",\"MSOARIA.DLL\",0.0103,1.0028,0.0103,1.0028\n\"E26B\",\"E26B\",\"MSOARIA.DLL\",0.0103,1.0021,0.0103,1.0021\n\"120B0A\",\"120B0A\",\"MSOARIA.DLL\",0.0103,1.0014,0.0103,1.0014\n\"123578\",\"123578\",\"MSOARIA.DLL\",0.0103,1.0014,0.0103,1.0014\n\"8A6BC\",\"8A6BC\",\"MSOARIA.DLL\",0.0103,1.0012,0.0103,1.0012\n\"6260E\",\"6260E\",\"MSOARIA.DLL\",0.0103,1.0011,0.0103,1.0011\n\"6C650\",\"6C650\",\"MSOARIA.DLL\",0.0103,1.0010,0.0103,1.0010\n\"E5F9\",\"E5F9\",\"MSOARIA.DLL\",0.0103,1.0010,0.0103,1.0010\n\"9E3C0\",\"9E3C0\",\"MSOARIA.DLL\",0.0103,1.0004,0.0103,1.0004\n\"144A0\",\"144A0\",\"MSOARIA.DLL\",0.0103,1.0002,0.0103,1.0002\n\"13706\",\"13706\",\"MSOARIA.DLL\",0.0103,0.9997,0.0103,0.9997\n\"2FCF0\",\"2FCF0\",\"MSOARIA.DLL\",0.0103,0.9996,0.0103,0.9996\n\"3B3C9\",\"3B3C9\",\"MSOARIA.DLL\",0.0103,0.9991,0.0103,0.9991\n\"348CB\",\"348CB\",\"MSOARIA.DLL\",0.0103,0.9987,0.0103,0.9987\n\"120C9B\",\"120C9B\",\"MSOARIA.DLL\",0.0102,0.9981,0.0102,0.9981\n\"61A39\",\"61A39\",\"MSOARIA.DLL\",0.0102,0.9979,0.0102,0.9979\n\"13718\",\"13718\",\"MSOARIA.DLL\",0.0102,0.9978,0.0102,0.9978\n\"61B9F\",\"61B9F\",\"MSOARIA.DLL\",0.0102,0.9974,0.0102,0.9974\n\"F5455\",\"F5455\",\"MSOARIA.DLL\",0.0102,0.9974,0.0102,0.9974\n\"12178A\",\"12178A\",\"MSOARIA.DLL\",0.0102,0.9966,0.0102,0.9966\n\"62FBD\",\"62FBD\",\"MSOARIA.DLL\",0.0102,0.9962,0.0102,0.9962\n\"969C4\",\"969C4\",\"MSOARIA.DLL\",0.0102,0.9958,0.0102,0.9958\n\"121A9E\",\"121A9E\",\"MSOARIA.DLL\",0.0102,0.9957,0.0102,0.9957\n\"396D8\",\"396D8\",\"MSOARIA.DLL\",0.0102,0.9955,0.0102,0.9955\n\"13A59\",\"13A59\",\"MSOARIA.DLL\",0.0102,0.9949,0.0102,0.9949\n\"3976E\",\"3976E\",\"MSOARIA.DLL\",0.0102,0.9949,0.0102,0.9949\n\"894A4\",\"894A4\",\"MSOARIA.DLL\",0.0102,0.9948,0.0170,1.6522\n\"121913\",\"121913\",\"MSOARIA.DLL\",0.0102,0.9945,0.0102,0.9945\n\"74DB\",\"74DB\",\"MSOARIA.DLL\",0.0102,0.9943,0.0307,2.9943\n\"7C158\",\"7C158\",\"MSOARIA.DLL\",0.0102,0.9915,0.0102,0.9915\n\"13A60\",\"13A60\",\"MSOARIA.DLL\",0.0102,0.9913,0.0102,0.9913\n\"7D01F\",\"7D01F\",\"MSOARIA.DLL\",0.0102,0.9910,0.0102,0.9910\n\"120C2C\",\"120C2C\",\"MSOARIA.DLL\",0.0102,0.9909,0.0102,0.9909\n\"120C16\",\"120C16\",\"MSOARIA.DLL\",0.0102,0.9907,0.0102,0.9907\n\"40197\",\"40197\",\"MSOARIA.DLL\",0.0102,0.9902,0.0102,0.9902\n\"827CA\",\"827CA\",\"MSOARIA.DLL\",0.0102,0.9900,0.0102,0.9900\n\"37629\",\"37629\",\"MSOARIA.DLL\",0.0102,0.9891,0.0102,0.9891\n\"121938\",\"121938\",\"MSOARIA.DLL\",0.0101,0.9883,0.0101,0.9883\n\"8D4F\",\"8D4F\",\"MSOARIA.DLL\",0.0101,0.9883,0.0101,0.9883\n\"120C30\",\"120C30\",\"MSOARIA.DLL\",0.0101,0.9880,0.0101,0.9880\n\"121910\",\"121910\",\"MSOARIA.DLL\",0.0101,0.9844,0.0101,0.9844\n\"16BF1\",\"16BF1\",\"MSOARIA.DLL\",0.0100,0.9788,0.0100,0.9788\n\"7D032\",\"7D032\",\"MSOARIA.DLL\",0.0069,0.6764,0.0069,0.6764\n\"85B27\",\"85B27\",\"MSOARIA.DLL\",0.0067,0.6574,0.0067,0.6574\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_MSPST32.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"81114\",\"81114\",\"MSPST32.DLL\",0.0205,2.0000,0.0205,2.0000\n\"8B28B\",\"8B28B\",\"MSPST32.DLL\",0.0205,2.0000,0.0205,2.0000\n\"100DE\",\"100DE\",\"MSPST32.DLL\",0.0204,1.9884,0.0204,1.9884\n\"19D4F5\",\"19D4F5\",\"MSPST32.DLL\",0.0178,1.7340,0.0178,1.7340\n\"A8FA5\",\"A8FA5\",\"MSPST32.DLL\",0.0137,1.3391,0.0137,1.3391\n\"7CB78\",\"7CB78\",\"MSPST32.DLL\",0.0126,1.2324,0.0126,1.2324\n\"A8E6E\",\"A8E6E\",\"MSPST32.DLL\",0.0114,1.1144,0.0114,1.1144\n\"44AC0\",\"44AC0\",\"MSPST32.DLL\",0.0110,1.0673,0.0110,1.0673\n\"A2810\",\"A2810\",\"MSPST32.DLL\",0.0103,1.0084,0.0103,1.0084\n\"19D4CD\",\"19D4CD\",\"MSPST32.DLL\",0.0090,0.8809,0.0090,0.8809\n\"261A3\",\"261A3\",\"MSPST32.DLL\",0.0034,0.3305,0.0034,0.3305\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_MSPTLS.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"520FE\",\"520FE\",\"MSPTLS.DLL\",0.0309,3.0086,0.0309,3.0086\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_MicrosoftAccountWAMExtension.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"39B0\",\"39B0\",\"MicrosoftAccountWAMExtension.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Mso20win32client.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"?SortByParameterGroups@Private@EcsNS@Experiment@Mso@@YAXAEAV?$vector@V?$vector@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@std@@V?$allocator@V?$vector@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@std@@@2@@std@@AEBV?$shared_ptr@UFeatureConfigs@Experiment@Mso@@@6@@Z\",\"32C3C\",\"Mso20win32client.dll\",0.5132,49.9990,1.7549,170.9838\n\"??$ReplaceRulePointerInMap@V?$unordered_map@KU?$pair@V?$vector@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@V?$allocator@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@@2@@std@@W4UlsColumns@Telemetry@Mso@@@std@@U?$hash@K@2@U?$equal_to@K@2@V?$allocator@U?$pair@$$CBKU?$pair@V?$vector@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@V?$allocator@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@@2@@std@@W4UlsColumns@Telemetry@Mso@@@std@@@std@@@2@@std@@@Telemetry@Mso@@YAXAEAV?$unordered_map@KU?$pair@V?$vector@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@V?$allocator@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@@2@@std@@W4UlsColumns@Telemetry@Mso@@@std@@U?$hash@K@2@U?$equal_to@K@2@V?$allocator@U?$pair@$$CBKU?$pair@V?$vector@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@V?$allocator@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@@2@@std@@W4UlsColumns@Telemetry@Mso@@@std@@@std@@@2@@std@@AEBV?$shared_ptr@UIRule@Telemetry@Mso@@@3@@Z\",\"37D50\",\"Mso20win32client.dll\",0.1276,12.4347,0.1276,12.4347\n\"inflate_fast_chunk_\",\"F10E0\",\"Mso20win32client.dll\",0.1241,12.0864,0.1282,12.4937\n\"?ReadNext@?$JsonReader@_W@Json@Mso@@UEAA?AW4Enum@ParseState@23@XZ\",\"1C8160\",\"Mso20win32client.dll\",0.0785,7.6481,0.0990,9.6482\n\"?GetSharedName@RuleParser@Telemetry@Mso@@QEAAJAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@_KAEAV?$shared_ptr@_W@5@@Z\",\"364F4\",\"Mso20win32client.dll\",0.0686,6.6868,0.1843,17.9522\n\"??$CheckField@D@StructuredTraceValidator@Logging@Mso@@AEAAXPEBD@Z\",\"35910\",\"Mso20win32client.dll\",0.0635,6.1852,0.1148,11.1823\n\"??$escape_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV01@@Z\",\"2C3A0\",\"Mso20win32client.dll\",0.0549,5.3510,0.0653,6.3601\n\"?Free@Memory@Mso@@YAXPEAX@Z\",\"29390\",\"Mso20win32client.dll\",0.0548,5.3414,0.2194,21.3759\n\"wmemcmp\",\"36740\",\"Mso20win32client.dll\",0.0492,4.7929,0.0492,4.7929\n\"??$find@X@?$_Hash@V?$_Umap_traits@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$tuple@V?$shared_ptr@VABConfig@Experiment@Mso@@@std@@V?$optional@V?$shared_ptr@V?$vector@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@std@@@std@@@2@@2@V?$_Uhash_compare@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@U?$hash@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@U?$equal_to@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@2@V?$allocator@U?$pair@$$CBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$tuple@V?$shared_ptr@VABConfig@Experiment@Mso@@@std@@V?$optional@V?$shared_ptr@V?$vector@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@std@@@std@@@2@@2@@std@@@2@$0A@@std@@@std@@QEAA?AV?$_List_iterator@V?$_List_val@U?$_List_simple_types@U?$pair@$$CBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$tuple@V?$shared_ptr@VABConfig@Experiment@Mso@@@std@@V?$optional@V?$shared_ptr@V?$vector@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@std@@@std@@@2@@2@@std@@@std@@@std@@@1@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@@Z\",\"40270\",\"Mso20win32client.dll\",0.0483,4.7033,0.0483,4.7033\n\"??$emplace@AEBV?$shared_ptr@_W@std@@@?$vector@V?$shared_ptr@_W@std@@V?$allocator@V?$shared_ptr@_W@std@@@2@@std@@QEAA?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@V?$shared_ptr@_W@std@@@std@@@std@@@1@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@V?$shared_ptr@_W@std@@@std@@@std@@@1@AEBV?$shared_ptr@_W@1@@Z\",\"37950\",\"Mso20win32client.dll\",0.0459,4.4725,0.0459,4.4725\n\"GetBaseFlightName\",\"42670\",\"Mso20win32client.dll\",0.0401,3.9052,0.0401,3.9052\n\"??0StringWriter@Unicode@Json@Mso@@QEAA@W4PrettyPrint@23@@Z\",\"1B04A4\",\"Mso20win32client.dll\",0.0316,3.0825,0.0437,4.2529\n\"??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@QEBD@Z\",\"DDAC\",\"Mso20win32client.dll\",0.0309,3.0074,0.0309,3.0074\n\"??1?$KeyValue@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@W4ConfigurationProviderCode@FederationProvider@Authentication@Mso@@@Collections@Mso@@QEAA@XZ\",\"2A8B0\",\"Mso20win32client.dll\",0.0308,3.0033,0.1128,10.9938\n\"??0?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAA@QEB_W@Z\",\"34F20\",\"Mso20win32client.dll\",0.0308,3.0018,0.0471,4.5937\n\"?reset@?$_Optional_destruct_base@VResult@System@Office@@$0A@@std@@QEAAXXZ\",\"17A6A4\",\"Mso20win32client.dll\",0.0308,3.0014,0.0308,3.0014\n\"?CompleteStringLiteral@?$Json_StringParser@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@details@Json@Mso@@MEAA_N_WAEAUToken@?$Json_Parser@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@234@@Z\",\"2EDE0\",\"Mso20win32client.dll\",0.0308,3.0008,0.0411,4.0003\n\"?HrEscape@CMsoUrlSimple@@CAJPEB_WHW4MsoUrlCreateFlags@@PEA_WPEAH@Z\",\"4B5A0\",\"Mso20win32client.dll\",0.0308,2.9981,0.0308,2.9981\n\"?append@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAAAEAV12@QEBD_K@Z\",\"25124\",\"Mso20win32client.dll\",0.0307,2.9950,0.0614,5.9850\n\"??$?HDU?$char_traits@D@std@@V?$allocator@D@1@@std@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@0@AEBV10@QEBD@Z\",\"1082D4\",\"Mso20win32client.dll\",0.0293,2.8522,0.0528,5.1411\n\"??R?$_Func_class@W4UlsColumns@Telemetry@Mso@@KW4Category@Logging@3@W4InternalSeverity@53@@std@@QEBA?AW4UlsColumns@Telemetry@Mso@@KW4Category@Logging@4@W4InternalSeverity@64@@Z\",\"3116F8\",\"Mso20win32client.dll\",0.0283,2.7590,0.0283,2.7590\n\"?IsTraceThrottled@SampledDiagnosticsThrottler@Diagnostics@Mso@@UEAA_NAEBUTraceHeader@Logging@3@@Z\",\"22720\",\"Mso20win32client.dll\",0.0253,2.4661,0.0253,2.4661\n\"?Lock@?$TLocker@V?$Lockable@V?$AlwaysInit@VCritSecBase@Mso@@@Mso@@VZeroOrOneThreaded@2@@Mso@@VZeroOrOneThreaded@2@@Mso@@QEAAXXZ\",\"25508\",\"Mso20win32client.dll\",0.0245,2.3834,0.0961,9.3665\n\"?MsoShouldTrace@Logging@Mso@@YA_NKW4Category@12@W4Severity@12@W4DataCategories@12@@Z\",\"23800\",\"Mso20win32client.dll\",0.0245,2.3834,0.0800,7.7969\n\"?MsoRgwchIndex@@YAPEB_WPEB_WHH@Z\",\"4AEE0\",\"Mso20win32client.dll\",0.0235,2.2907,0.0235,2.2907\n\"??$T_ReplaceWchWithWchSubstr@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@DString@Mso@@YAXAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@_W1HH@Z\",\"147720\",\"Mso20win32client.dll\",0.0224,2.1844,0.0224,2.1844\n\"?AdjustBarrier@CBaseWorkObject@@QEAAXKPEAUAdjustBarrierInOut@1@@Z\",\"EAA10\",\"Mso20win32client.dll\",0.0211,2.0558,0.0512,4.9916\n\"?GetCategoryName@Logging@Mso@@YAPEB_WW4Category@12@@Z\",\"210F0\",\"Mso20win32client.dll\",0.0210,2.0501,0.0210,2.0501\n\"?ReadAttributeValues@AttributeHelper@Telemetry@Mso@@QEAAJPEAUAttributeValues@23@I@Z\",\"43B74\",\"Mso20win32client.dll\",0.0210,2.0466,0.0239,2.3315\n\"?WriteEscapedString@?$TWriter@_W@Json@Mso@@AEAAXAEBV?$basic_string_view@_WU?$char_traits@_W@std@@@std@@@Z\",\"162234\",\"Mso20win32client.dll\",0.0207,2.0159,0.0602,5.8634\n\"??$make_unique@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV12@$0A@@std@@YA?AV?$unique_ptr@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@U?$default_delete@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@0@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@0@@Z\",\"26620\",\"Mso20win32client.dll\",0.0207,2.0120,0.0412,4.0128\n\"??1?$unique_ptr@V_Value@details@Json@Mso@@U?$default_delete@V_Value@details@Json@Mso@@@std@@@std@@QEAA@XZ\",\"2917C\",\"Mso20win32client.dll\",0.0206,2.0077,0.0652,6.3558\n\"??$From@PEB_W@TelemetryValue@Telemetry@Mso@@SA?AV012@AEBQEB_W_N@Z\",\"B87D0\",\"Mso20win32client.dll\",0.0206,2.0040,0.0717,6.9886\n\"?LogStructuredTraceTag@ReentrantLoggerDecorator@Logging@Mso@@UEAAXAEBUTraceHeader@23@PEB_WAEBUIStructuredTrace@23@@Z\",\"368C0\",\"Mso20win32client.dll\",0.0205,2.0002,2.6265,255.9017\n\"?push_back@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAX_W@Z\",\"2D770\",\"Mso20win32client.dll\",0.0205,2.0001,0.0360,3.5080\n\"??$InvokeCallback@V?$StateTracker@UITimerObject@Async@Mso@@VCurrentTimerObjectHolder@Details@23@@Async@Mso@@@?$CallbackObjectBase@UITimerObject@Async@Mso@@VCurrentTimerObjectHolder@Details@23@@Async@Mso@@IEAAXXZ\",\"F9FC\",\"Mso20win32client.dll\",0.0205,2.0000,4.2085,410.0356\n\"??0?$DataField@E@Telemetry@Mso@@QEAA@PEBD$$QEAEW4DataClassifications@Logging@2@@Z\",\"158AC\",\"Mso20win32client.dll\",0.0205,2.0000,0.0529,5.1568\n\"?Accept@Activity@System@Office@@CAXAEBV123@AEAUIDataFieldVisitor@Telemetry@Mso@@@Z\",\"107A00\",\"Mso20win32client.dll\",0.0205,2.0000,0.1532,14.9247\n\"?Accept@CopiedEventContract@Details@Telemetry@Mso@@UEBAXAEAUIDataFieldVisitor@34@@Z\",\"18C510\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?CheckTraceAndThrottle@SampledDiagnosticsThrottler@Diagnostics@Mso@@UEAA_NAEBUTraceHeader@Logging@3@@Z\",\"AF200\",\"Mso20win32client.dll\",0.0205,2.0000,0.0309,3.0074\n\"?Detach@Activity@Telemetry@Mso@@QEAA?AV?$TCntPtr@UIDetachedActivity@Telemetry@Mso@@@3@XZ\",\"13DD0\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?DoPostXmlParseCleanup@Rule@Telemetry@Mso@@UEAAXXZ\",\"FA630\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?GetConfigurationFromDefaultAndCacheIfApplicable@ConfigurationManager@Configuration@Storage@@AEBAXW4ConfigurationId@23@AEAUConfigurationEntry@23@@Z\",\"41F24\",\"Mso20win32client.dll\",0.0205,2.0000,0.0561,5.4630\n\"?GetUlsColumnFlags@ULSRuleSelector@Telemetry@Mso@@QEBA?AW4UlsColumns@23@KW4Category@Logging@3@W4InternalSeverity@63@@Z\",\"13315C\",\"Mso20win32client.dll\",0.0205,2.0000,0.0488,4.7590\n\"?HandleStarts@RuleParseHelper_V@Telemetry@Mso@@IEAAJAEAVXmlReaderHelper@23@@Z\",\"19BE50\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?HasStreamDataToWrite@SendRequestHelper@Http@Mso@@QEBA_NXZ\",\"2412E4\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?InvokeInCallbackContext@Async@Mso@@YAX$$QEAV?$Functor@$$A6AXXZ@2@PEAVIDispatchQueue@12@PEAUIIdleDispatchQueue@Details@12@_N@Z\",\"BF40\",\"Mso20win32client.dll\",0.0205,2.0000,22.1882,2161.8240\n\"?lock@_Mutex_base@std@@QEAAXXZ\",\"41EA0\",\"Mso20win32client.dll\",0.0205,2.0000,0.0514,5.0061\n\"?LogStructuredTraceTag@Logger@Logging@Mso@@UEAAXAEBUTraceHeader@23@PEB_WAEBUIStructuredTrace@23@@Z\",\"36FE0\",\"Mso20win32client.dll\",0.0205,2.0000,0.8584,83.6343\n\"?MsoCchCanonicalizePath@@YAHPEA_WH@Z\",\"3D180\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?PostSelfToOwner@CWorkerQueue@@UEAAXH@Z\",\"EBF60\",\"Mso20win32client.dll\",0.0205,2.0000,0.0312,3.0426\n\"?Release@?$UnknownObject@USimpleNoQuery@RefCountStrategy@Mso@@U?$IFunctor@XAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@3@@Mso@@UEAAKXZ\",\"EB2B0\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?StartsWith@StringAscii@Mso@@SA_NPEB_WH0H@Z\",\"3B348\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?TryDecode@?$TBase64Decoder@D@Base64@Mso@@UEAA_NAEBV?$basic_string_view@DU?$char_traits@D@std@@@std@@@Z\",\"2480C0\",\"Mso20win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"?NotifyNewConfigsAvailable@ABConfigsCollection@Experiment@Mso@@QEAAIW4ConfigSource@23@AEBV?$shared_ptr@UFeatureConfigs@Experiment@Mso@@@std@@_NPEAUIConfigContext@23@@Z\",\"5EB58\",\"Mso20win32client.dll\",0.0205,1.9995,0.2463,23.9966\n\"?_Min@?$_Tree_val@U?$_Tree_simple_types@U?$pair@$$CB_KV?$map@_KUCluster@Syzygy@@U?$less@_K@std@@V?$allocator@U?$pair@$$CB_KUCluster@Syzygy@@@std@@@4@@std@@@std@@@std@@@std@@SAPEAU?$_Tree_node@U?$pair@$$CB_KV?$map@_KUCluster@Syzygy@@U?$less@_K@std@@V?$allocator@U?$pair@$$CB_KUCluster@Syzygy@@@std@@@4@@std@@@std@@PEAX@2@PEAU32@@Z\",\"A8E4\",\"Mso20win32client.dll\",0.0205,1.9989,0.0205,1.9989\n\"??0TelemetryValue@Telemetry@Mso@@QEAA@$$QEAV012@@Z\",\"29900\",\"Mso20win32client.dll\",0.0204,1.9917,0.0204,1.9917\n\"MsoWchToUpperLid\",\"B3B80\",\"Mso20win32client.dll\",0.0203,1.9800,0.0203,1.9800\n\"??1?$unique_ptr@UISingleDataField@Telemetry@Mso@@U?$default_delete@UISingleDataField@Telemetry@Mso@@@std@@@std@@QEAA@XZ\",\"2DB2C\",\"Mso20win32client.dll\",0.0201,1.9578,0.0201,1.9578\n\"?_Fnv1a_append_bytes@std@@YA_K_KQEBE_K@Z\",\"46670\",\"Mso20win32client.dll\",0.0199,1.9379,0.0199,1.9379\n\"?ReceiveEvent@CompositeEventSink@Telemetry@Mso@@QEAAXAEBUTelemetryEvent@23@@Z\",\"23FE4\",\"Mso20win32client.dll\",0.0195,1.8964,2.0234,197.1442\n\"inflate\",\"EF000\",\"Mso20win32client.dll\",0.0188,1.8299,0.1428,13.9163\n\"?AllocateEx@Memory@Mso@@YAPEAX_KK@Z\",\"259E0\",\"Mso20win32client.dll\",0.0182,1.7763,0.1648,16.0590\n\"?IsNameOrEndObjectAllowed@?$TWriter@D@Json@Mso@@QEBA_NXZ\",\"1621E0\",\"Mso20win32client.dll\",0.0171,1.6702,0.0171,1.6702\n\"?Accept@SingleDataFieldCollection@Telemetry@Mso@@UEBAXAEAUIDataFieldVisitor@23@@Z\",\"11660\",\"Mso20win32client.dll\",0.0170,1.6590,0.1683,16.3990\n\"??0MathEnabledEventField@Telemetry@Mso@@QEAA@AEBV012@@Z\",\"2AA50\",\"Mso20win32client.dll\",0.0159,1.5453,0.0159,1.5453\n\"??$_Allocate@$0BA@U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z\",\"2CED0\",\"Mso20win32client.dll\",0.0155,1.5079,0.4446,43.3172\n\"?TryGetInt64@?$JsonReader@_W@Json@Mso@@UEBA?AV?$optional@_J@std@@XZ\",\"134610\",\"Mso20win32client.dll\",0.0152,1.4847,0.0255,2.4837\n\"__chkstk\",\"1F7820\",\"Mso20win32client.dll\",0.0150,1.4630,0.0150,1.4630\n\"?ParseIntWz@@YAHPEB_WPEAH_N@Z\",\"31094\",\"Mso20win32client.dll\",0.0148,1.4382,0.0148,1.4382\n\"?GetFieldName@FieldProperties@Telemetry@Mso@@QEBAPEB_WE@Z\",\"BA68C\",\"Mso20win32client.dll\",0.0145,1.4175,0.0145,1.4175\n\"?GetFolder@ShellFolderCache@ShellFolder@Mso@@QEAA?AW4CopyStatus@123@IPEA_WI@Z\",\"F395C\",\"Mso20win32client.dll\",0.0144,1.4000,0.0349,3.4000\n\"?LogTrace@TraceCollector@Diagnostics@Mso@@UEAAXAEBV?$DiagnosticLog_t@V?$DiagnosticsStringBuilder@D$0EAA@@Diagnostics@Mso@@VDiagnosticLogSerializer@23@@23@@Z\",\"245E0\",\"Mso20win32client.dll\",0.0137,1.3390,0.1573,15.3307\n\"?HandleColumn@RuleParseHelper_V@Telemetry@Mso@@IEAAJAEAVXmlReaderHelper@23@@Z\",\"433D0\",\"Mso20win32client.dll\",0.0137,1.3325,0.3013,29.3597\n\"?AddInput@FilterRule@Telemetry@Mso@@UEAA_NPEBURoutingInfo@23@@Z\",\"14F080\",\"Mso20win32client.dll\",0.0136,1.3218,0.0136,1.3218\n\"?ImplementXmlHandler@RuleParseHelper_V@Telemetry@Mso@@IEAAJAEAVXmlReaderHelper@23@PEAUXmlHandlerInfo@23@I_N@Z\",\"43080\",\"Mso20win32client.dll\",0.0131,1.2783,0.6616,64.4579\n\"??$GetOptimizedValue@_N@ABConfigsCollection@Experiment@Mso@@QEAA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEB_NAEBUScopeEvaluator@AB@2@AEBU?$pair@$$CBE$$CB_N@4@_N@Z\",\"41FDC\",\"Mso20win32client.dll\",0.0131,1.2747,0.0872,8.4942\n\"??_M@YAXPEAX_K1P6AX0@Z@Z\",\"1C6630\",\"Mso20win32client.dll\",0.0129,1.2560,0.0129,1.2560\n\"?ValidateEvent@Details@Telemetry@Mso@@YA?AW4EventValidationError@123@AEBUEventName@23@AEBV?$shared_ptr@UEventContract@Telemetry@Mso@@@std@@AEBUEventFlags@23@AEBUIDataField@23@W4ContentType@23@@Z\",\"106F6C\",\"Mso20win32client.dll\",0.0127,1.2372,0.0401,3.9054\n\"?append@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEAAAEAV12@QEB_W_K@Z\",\"38F74\",\"Mso20win32client.dll\",0.0121,1.1751,0.0599,5.8319\n\"??1?$SimpleRefCountMemoryGuard@VInstance@Lithium@Storage@@UMakeAllocator@Mso@@@Mso@@QEAA@XZ\",\"15C418\",\"Mso20win32client.dll\",0.0120,1.1704,0.0120,1.1704\n\"?CbHashSize@CNGHashObj@Mso@@UEBAKXZ\",\"184C30\",\"Mso20win32client.dll\",0.0110,1.0707,0.0110,1.0707\n\"??$AppendJsonString@D$0A@@?$DiagnosticsStringBuilder@D$0EAA@@Diagnostics@Mso@@QEAA_NPEBDV?$optional@_K@std@@@Z\",\"1347C4\",\"Mso20win32client.dll\",0.0110,1.0673,0.0110,1.0673\n\"?GetMsoMemHeap@Memory@Mso@@YAPEAUIMsoMemHeap@@XZ\",\"157C90\",\"Mso20win32client.dll\",0.0109,1.0616,0.0109,1.0616\n\"?now@HighPrecisionSteadyClock@Chrono@Storage@@YA?AV?$time_point@Usteady_clock@chrono@std@@V?$duration@_JU?$ratio@$00$0DLJKMKAA@@std@@@23@@chrono@std@@XZ\",\"226610\",\"Mso20win32client.dll\",0.0108,1.0554,0.0217,2.1108\n\"??$_Construct_from_iter@PEADPEAD_K@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEAAXPEADQEAD_K@Z\",\"579F0\",\"Mso20win32client.dll\",0.0107,1.0432,0.0210,2.0426\n\"?CreateFromTelemetryEvent@EventPropertiesFactory@AriaEventSink@Mso@@QEAA?AV?$optional@UEventProperties@AriaApi@Telemetry@Mso@@@std@@AEBUTelemetryEvent@Telemetry@3@_NAEBV?$optional@USampleRate@Sampling@Telemetry@Mso@@@5@AEBV?$optional@W4SamplingPolicy@Telemetry@Mso@@@5@@Z\",\"16F664\",\"Mso20win32client.dll\",0.0106,1.0348,0.4484,43.6835\n\"?WriteRawChars@?$TWriter@_W@Json@Mso@@AEAAXAEBV?$basic_string_view@_WU?$char_traits@_W@std@@@std@@@Z\",\"16239C\",\"Mso20win32client.dll\",0.0105,1.0220,0.0208,2.0218\n\"??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@AEBV01@@Z\",\"22ACC\",\"Mso20win32client.dll\",0.0104,1.0132,0.0254,2.4709\n\"??1CBaseWorkObject@@UEAA@XZ\",\"EB080\",\"Mso20win32client.dll\",0.0104,1.0093,0.0104,1.0093\n\"?ValidateEventContract@DataFieldValidator@Details@Telemetry@Mso@@QEAAXAEBUEventContract@34@@Z\",\"1077A0\",\"Mso20win32client.dll\",0.0104,1.0092,0.0104,1.0092\n\"?IsGlobalEnvironment@FederationInfo@FederationProvider@Authentication@Mso@@CA_NAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z\",\"331C30\",\"Mso20win32client.dll\",0.0103,1.0082,0.0103,1.0082\n\"??$_Try_emplace@AEB_K$$V@?$_Hash@V?$_Umap_traits@_KIV?$_Uhash_compare@_KU?$hash@_K@std@@U?$equal_to@_K@2@@std@@V?$allocator@U?$pair@$$CB_KI@std@@@2@$0A@@std@@@std@@IEAA?AU?$pair@PEAU?$_List_node@U?$pair@$$CB_KI@std@@PEAX@std@@_N@1@AEB_K@Z\",\"AF578\",\"Mso20win32client.dll\",0.0103,1.0074,0.0103,1.0074\n\"??$AppendJsonKey@D$0A@@?$DiagnosticsStringBuilder@D$0EAA@@Diagnostics@Mso@@QEAA_NPEBDAEBV?$basic_string_view@DU?$char_traits@D@std@@@std@@@Z\",\"22260\",\"Mso20win32client.dll\",0.0103,1.0057,0.0103,1.0057\n\"?EvaluateGroupedFeatureGates@ABConfigsCollection@Experiment@Mso@@AEBAXAEBV?$shared_ptr@V?$vector@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@std@@@std@@AEBV?$shared_ptr@VABConfig@Experiment@Mso@@@5@@Z\",\"41CB4\",\"Mso20win32client.dll\",0.0103,1.0056,0.0206,2.0065\n\"?ForEachLoggingDependency@Rule@Telemetry@Mso@@UEBAXAEBV?$FunctorRef@$$A6AXAEBURoutingInfo@Telemetry@Mso@@@Z@3@@Z\",\"B9650\",\"Mso20win32client.dll\",0.0103,1.0054,0.0205,1.9978\n\"?IsLabMachine@BuildInfo@Experiment@Mso@@UEAA_N_N@Z\",\"159050\",\"Mso20win32client.dll\",0.0103,1.0053,0.0103,1.0053\n\"MsoWzLowerCore\",\"53560\",\"Mso20win32client.dll\",0.0103,1.0051,0.0103,1.0051\n\"?WriteBool@StringWriter@Unicode@Json@Mso@@UEAA_N_N@Z\",\"1C89F0\",\"Mso20win32client.dll\",0.0103,1.0048,0.0103,1.0048\n\"?map_fields@_Object@details@Json@Mso@@AEAAXXZ\",\"261C0\",\"Mso20win32client.dll\",0.0103,1.0033,0.0103,1.0033\n\"?ForEachMatchingRule@ULSRuleSelector@Telemetry@Mso@@UEBAXKW4Category@Logging@3@W4InternalSeverity@53@V?$function@$$A6AXAEBV?$shared_ptr@UIRule@Telemetry@Mso@@@std@@@Z@std@@@Z\",\"B8400\",\"Mso20win32client.dll\",0.0103,1.0027,0.3053,29.7443\n\"??$_Try_emplace@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@$$V@?$_Hash@V?$_Umap_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$unique_ptr@UAggregation@Telemetry@Mso@@U?$default_delete@UAggregation@Telemetry@Mso@@@std@@@2@V?$_Uhash_compare@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@U?$hash@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@U?$equal_to@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$unique_ptr@UAggregation@Telemetry@Mso@@U?$default_delete@UAggregation@Telemetry@Mso@@@std@@@2@@std@@@2@$0A@@std@@@std@@IEAA?AU?$pair@PEAU?$_List_node@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$unique_ptr@UAggregation@Telemetry@Mso@@U?$default_delete@UAggregation@Telemetry@Mso@@@std@@@2@@std@@PEAX@std@@_N@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z\",\"25604\",\"Mso20win32client.dll\",0.0103,1.0025,0.0103,1.0025\n\"??0TelemetryEventParams@Telemetry@Mso@@QEAA@$$QEAV012@@Z\",\"61764\",\"Mso20win32client.dll\",0.0103,1.0025,0.0103,1.0025\n\"?Release@?$TRefCountedImpl@UILogWriter@Logging@Mso@@@Mso@@UEBAXXZ\",\"D300\",\"Mso20win32client.dll\",0.0103,1.0025,0.0103,1.0025\n\"?_Tidy_deallocate@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAAXXZ\",\"29590\",\"Mso20win32client.dll\",0.0103,1.0023,0.0308,3.0041\n\"?PassEventViaRoutingInfo@RuleImplementor@Telemetry@Mso@@SAXPEAUIRuleImplementor@23@PEAV?$vector@URoutingInfo@Telemetry@Mso@@V?$allocator@URoutingInfo@Telemetry@Mso@@@std@@@std@@AEAUEventID@23@AEBUITelemetryEvent@23@I@Z\",\"B9CF8\",\"Mso20win32client.dll\",0.0103,1.0022,0.2403,23.4147\n\"?GetCurrentCorrelation@CorrelationManager@Logging@Mso@@YA?AU_GUID@@XZ\",\"20474\",\"Mso20win32client.dll\",0.0103,1.0021,0.0103,1.0021\n\"?SerializeLog@DiagnosticLogSerializer@Diagnostics@Mso@@SA_NAEAV?$DiagnosticsStringBuilder@D$0EAA@@23@AEBV?$DiagnosticLog_t@V?$DiagnosticsStringBuilder@D$0EAA@@Diagnostics@Mso@@VDiagnosticLogSerializer@23@@23@@Z\",\"20BDC\",\"Mso20win32client.dll\",0.0103,1.0020,0.0452,4.4013\n\"?GetHashedName@Experiment@Mso@@YA?AV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEB_W@Z\",\"42530\",\"Mso20win32client.dll\",0.0103,1.0019,0.0504,4.9071\n\"?SubmitEventProcessingItemIdempotent@UlsDataCollector@Telemetry@Mso@@AEAA_NPEQ123@_NP6AAEAVIDispatchQueue@Async@3@XZ@Z\",\"1F544\",\"Mso20win32client.dll\",0.0103,1.0018,0.0103,1.0018\n\"?_Delete_this@?$_Ref_count_obj2@VRulesFetchRequestExecutor@RulesFetch@Mso@@@std@@EEAAXXZ\",\"37B00\",\"Mso20win32client.dll\",0.0103,1.0012,0.0103,1.0012\n\"?CastToType@MathEnabledEventField@Telemetry@Mso@@QEBAJW4FieldType@23@PEAV123@@Z\",\"29D2C\",\"Mso20win32client.dll\",0.0103,1.0010,0.0615,5.9956\n\"??$?4JV?$TCntPtr@UKey@Registry@Mso@@@Mso@@$0A@@?$tuple@AEAJAEAV?$TCntPtr@UKey@Registry@Mso@@@Mso@@@std@@QEAAAEAV01@$$QEAU?$pair@JV?$TCntPtr@UKey@Registry@Mso@@@Mso@@@1@@Z\",\"C3B58\",\"Mso20win32client.dll\",0.0103,1.0009,1.7755,172.9905\n\"?AllocateEx@Throw@Memory@Mso@@YAPEAX_KK@Z\",\"27BC0\",\"Mso20win32client.dll\",0.0103,1.0008,0.0205,1.9956\n\"MsoSzToWz\",\"3E460\",\"Mso20win32client.dll\",0.0103,1.0007,0.0210,2.0487\n\"??0ScopeHolder@ActivityScope@Mso@@QEAA@KPEB_WAEBV?$shared_ptr@UIMsoLoggingScope@ActivityScope@Mso@@@std@@_NW4Severity@Logging@2@@Z\",\"338850\",\"Mso20win32client.dll\",0.0103,1.0003,0.0103,1.0003\n\"??1?$MemHeapPtr@PEAD$0A@@Mso@@QEAA@XZ\",\"B7D28\",\"Mso20win32client.dll\",0.0103,1.0002,0.0308,3.0031\n\"??$_Integer_to_chars@_K@std@@YA?AUto_chars_result@0@PEADQEAD_KH@Z\",\"1C33D8\",\"Mso20win32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"?EnsureGroupExists@Rule@Telemetry@Mso@@QEAAPEAURuleResultSet@23@I@Z\",\"28964\",\"Mso20win32client.dll\",0.0103,1.0000,0.0204,1.9867\n\"?ProcessParserData@RuleManager@Telemetry@Mso@@MEAAJAEBV?$TCntPtr@UIXmlReader@@@3@@Z\",\"1EEB90\",\"Mso20win32client.dll\",0.0103,1.0000,0.9768,95.1659\n\"?RegQueryWz@DString@Mso@@YAJAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@PEAUHKEY__@@PEB_W@Z\",\"34C8A0\",\"Mso20win32client.dll\",0.0103,0.9999,0.0305,2.9745\n\"??$count@X@?$_Hash@V?$_Uset_traits@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$_Uhash_compare@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@U?$hash@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@U?$equal_to@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@2@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@$0A@@std@@@std@@QEBA_KAEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@@Z\",\"5F684\",\"Mso20win32client.dll\",0.0103,0.9997,0.0103,0.9997\n\"?GetABConfigFromConfigName@ABConfigsCollection@Experiment@Mso@@AEBA?AV?$tuple@V?$shared_ptr@VABConfig@Experiment@Mso@@@std@@V?$optional@V?$shared_ptr@V?$vector@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$allocator@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@std@@@std@@@2@@std@@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@5@@Z\",\"4000C\",\"Mso20win32client.dll\",0.0103,0.9996,0.0691,6.7356\n\"?NextCharacter@?$Json_StringParser@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@details@Json@Mso@@MEAA_WXZ\",\"2ECD0\",\"Mso20win32client.dll\",0.0103,0.9995,0.0103,0.9995\n\"?Remove@?$LRUCache@PEBU_orkey@@V?$TCntPtr@UKey@Registry@Mso@@@Mso@@$0CA@@Collections@Mso@@QEAAXAEBQEBU_orkey@@@Z\",\"C2A68\",\"Mso20win32client.dll\",0.0103,0.9994,0.0513,5.0021\n\"??4value@Json@Mso@@QEAAAEAV012@AEBV012@@Z\",\"15B320\",\"Mso20win32client.dll\",0.0103,0.9993,0.0715,6.9673\n\"??$CrashIfIncorrectType@PEBD@TelemetryValue@Telemetry@Mso@@AEBAXXZ\",\"13F3C0\",\"Mso20win32client.dll\",0.0103,0.9992,0.0103,0.9992\n\"?index@_Object@details@Json@Mso@@UEAAAEAVvalue@34@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z\",\"28BE0\",\"Mso20win32client.dll\",0.0103,0.9992,0.0735,7.1595\n\"?WriteString@StringWriter@Unicode@Json@Mso@@UEAA_NPEB_W@Z\",\"1C8BF0\",\"Mso20win32client.dll\",0.0103,0.9988,0.0704,6.8622\n\"?_Check_rehash_required_1@?$_Hash@V?$_Umap_traits@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$shared_ptr@VIPersistentStore@Mso@@@2@V?$_Uhash_compare@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@U?$hash@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@U?$equal_to@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@2@@2@V?$allocator@U?$pair@$$CBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@V?$shared_ptr@VIPersistentStore@Mso@@@2@@std@@@2@$0A@@std@@@std@@IEBA_NXZ\",\"A2E8\",\"Mso20win32client.dll\",0.0103,0.9987,0.0103,0.9987\n\"?_ParseValue@?$Json_Parser@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@details@Json@Mso@@AEAA?AV?$unique_ptr@V_Value@details@Json@Mso@@U?$default_delete@V_Value@details@Json@Mso@@@std@@@std@@AEAUToken@1234@@Z\",\"30330\",\"Mso20win32client.dll\",0.0102,0.9984,0.4651,45.3131\n\"__security_check_cookie\",\"1C6610\",\"Mso20win32client.dll\",0.0102,0.9980,0.0102,0.9980\n\"?HrUnescape@CMsoUrlSimple@@AEBAJPEB_WHPEA_WPEAHW4MsoUrlDisplayFormFlags@@@Z\",\"4BAC0\",\"Mso20win32client.dll\",0.0102,0.9980,0.0102,0.9980\n\"??$FNVHash@_K$0?DEANGDBLHLNNNMNL@$0BAAAAAAABLD@@Details@Hash@Mso@@YA_KPEBE_K_K@Z\",\"75ADC\",\"Mso20win32client.dll\",0.0102,0.9979,0.0102,0.9979\n\"?AppendExportabilityInfo@EventPropertiesFactory@AriaEventSink@Mso@@CAXAEBUTelemetryEvent@Telemetry@3@AEAUEventProperties@AriaApi@53@@Z\",\"16640C\",\"Mso20win32client.dll\",0.0102,0.9979,0.0102,0.9979\n\"?GetUserIdSpaceByCIDUserId@AlwaysOnMetadataProvider@Telemetry@Mso@@KA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@5@@Z\",\"B3624\",\"Mso20win32client.dll\",0.0102,0.9970,0.0102,0.9970\n\"?HrSetFromUserRgwch@CMsoUrlSimple@@UEAAJPEB_WHKPEBUIMsoUrl@@W4MsoUrlCreateFlags@@@Z\",\"394C0\",\"Mso20win32client.dll\",0.0102,0.9970,0.1555,15.1514\n\"?TakeInput@FilterRule@Telemetry@Mso@@UEAAXAEAUEventID@23@AEBUITelemetryEvent@23@I@Z\",\"BA960\",\"Mso20win32client.dll\",0.0102,0.9966,0.1371,13.3619\n\"??$CrashIfIncorrectType@PEB_W@TelemetryValue@Telemetry@Mso@@AEBAXXZ\",\"2A9E0\",\"Mso20win32client.dll\",0.0102,0.9955,0.0102,0.9955\n\"??4?$TypeErasedIterator@V?$shared_ptr@UIRule@Telemetry@Mso@@@std@@@Telemetry@Mso@@QEAAAEAV012@AEBV012@@Z\",\"B8F50\",\"Mso20win32client.dll\",0.0102,0.9955,0.0102,0.9955\n\"?_Decref@_Ref_count_base@std@@QEAAXXZ\",\"37A50\",\"Mso20win32client.dll\",0.0102,0.9953,0.0692,6.7461\n\"?Crack@CMsoUrlSimple@@IEBAXXZ\",\"4E1A0\",\"Mso20win32client.dll\",0.0102,0.9951,0.0337,3.2858\n\"MsoMultiByteToWideChar\",\"3E940\",\"Mso20win32client.dll\",0.0102,0.9945,0.0723,7.0410\n\"?GetEventOverrides@TelemetryNamespaceTreeNode@Telemetry@Mso@@QEBA?AV?$optional@VTelemetryEventOverrides@Telemetry@Mso@@@std@@AEBUEventName@23@_K@Z\",\"DA50\",\"Mso20win32client.dll\",0.0102,0.9943,0.0612,5.9648\n\"?TakeInput@Rule@Telemetry@Mso@@UEAAXAEAUEventID@23@AEBUITelemetryEvent@23@I@Z\",\"B9B80\",\"Mso20win32client.dll\",0.0102,0.9943,0.2172,21.1589\n\"??$_Emplace_reallocate@VTelemetryField@Telemetry@Mso@@@?$vector@VTelemetryField@Telemetry@Mso@@V?$allocator@VTelemetryField@Telemetry@Mso@@@std@@@std@@AEAAPEAVTelemetryField@Telemetry@Mso@@QEAV234@$$QEAV234@@Z\",\"2A704\",\"Mso20win32client.dll\",0.0102,0.9940,0.0281,2.7414\n\"?AppendTime@?$DiagnosticsStringBuilder@D$0EAA@@Diagnostics@Mso@@QEAA_NAEBU_SYSTEMTIME@@W4DateEncoding@23@@Z\",\"211C0\",\"Mso20win32client.dll\",0.0102,0.9938,0.0102,0.9938\n\"?Accept@Consent@System@Office@@CAXAEBV123@AEAUIDataFieldVisitor@Telemetry@Mso@@@Z\",\"175230\",\"Mso20win32client.dll\",0.0102,0.9935,0.0718,6.9909\n\"??$T_ReleaseBuffer@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@DString@Mso@@YAXAEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z\",\"2F044\",\"Mso20win32client.dll\",0.0102,0.9931,0.0102,0.9931\n\"?TryGetInt32@?$JsonReader@_W@Json@Mso@@UEBA?AV?$optional@H@std@@XZ\",\"134590\",\"Mso20win32client.dll\",0.0102,0.9927,0.0357,3.4764\n\"??$_Emplace@AEBUEventID@Telemetry@Mso@@@?$_Tree@V?$_Tset_traits@UEventID@Telemetry@Mso@@V?$LessFunctor@UEventID@Telemetry@Mso@@@Memory@3@V?$allocator@UEventID@Telemetry@Mso@@@std@@$0A@@std@@@std@@IEAA?AU?$pair@PEAU?$_Tree_node@UEventID@Telemetry@Mso@@PEAX@std@@_N@1@AEBUEventID@Telemetry@Mso@@@Z\",\"12E388\",\"Mso20win32client.dll\",0.0102,0.9924,0.0102,0.9924\n\"?AddRef@?$RefCountedObject@VISystemMemoryMapper@SharedMemory@Disco@@$$V@Mso@@UEBAXXZ\",\"16E0B0\",\"Mso20win32client.dll\",0.0102,0.9915,0.0102,0.9915\n\"?EmplaceBack@StructuredTraceReader@Telemetry@Mso@@AEAAXPEBD$$QEAVTelemetryValue@23@@Z\",\"350B0\",\"Mso20win32client.dll\",0.0102,0.9907,0.0409,3.9821\n\"??$WriteStructuredObject@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@StructuredTraceJsonSerializer@Logging@Mso@@AEAAXAEBU?$ClassifiedStructuredObject@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Diagnostics@2@@Z\",\"3E038\",\"Mso20win32client.dll\",0.0102,0.9899,0.0271,2.6412\n\"?HrSetFromCanonicalUrlWithGrfurl@CMsoUrlSimple@@QEAAJPEB_WKPEBUIMsoUrl@@W4MsoUrlCreateFlags@@@Z\",\"3AC60\",\"Mso20win32client.dll\",0.0102,0.9899,0.0236,2.2969\n\"?Clear@?$TCntPtr@UILogWriter@Logging@Mso@@@Mso@@QEAAXXZ\",\"29364\",\"Mso20win32client.dll\",0.0101,0.9886,0.0306,2.9783\n\"??$Make@UKey@Registry@Mso@@U123@AEAPEAUHKEY__@@_N@Mso@@YA?AV?$TCntPtr@UKey@Registry@Mso@@@0@AEAPEAUHKEY__@@$$QEA_N@Z\",\"55EE1C\",\"Mso20win32client.dll\",0.0101,0.9879,0.0304,2.9637\n\"??$_Find_lower_bound@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$_Tree@V?$_Tmap_traits@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VTelemetryNamespaceTreeNode@Telemetry@Mso@@U?$less@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@V?$allocator@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VTelemetryNamespaceTreeNode@Telemetry@Mso@@@std@@@2@$0A@@std@@@std@@IEBA?AU?$_Tree_find_result@PEAU?$_Tree_node@U?$pair@$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@VTelemetryNamespaceTreeNode@Telemetry@Mso@@@std@@PEAX@std@@@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z\",\"DC48\",\"Mso20win32client.dll\",0.0101,0.9877,0.0203,1.9815\n\"_Smtx_unlock_shared\",\"1C72A8\",\"Mso20win32client.dll\",0.0101,0.9876,0.0101,0.9876\n\"?HrClone@CMsoUrlSimple@@MEBAJPEAPEAUIMsoUrl@@@Z\",\"3B5D0\",\"Mso20win32client.dll\",0.0101,0.9876,0.0101,0.9876\n\"??$_Free_non_head@V?$allocator@U?$_List_node@U?$pair@$$CBW4RequestSettings@Http@Mso@@V?$TCntPtr@UIRefCounted@Mso@@@3@@std@@PEAX@std@@@std@@@?$_List_node@U?$pair@$$CBW4RequestSettings@Http@Mso@@V?$TCntPtr@UIRefCounted@Mso@@@3@@std@@PEAX@std@@SAXAEAV?$allocator@U?$_List_node@U?$pair@$$CBW4RequestSettings@Http@Mso@@V?$TCntPtr@UIRefCounted@Mso@@@3@@std@@PEAX@std@@@1@PEAU01@@Z\",\"1619BC\",\"Mso20win32client.dll\",0.0101,0.9872,0.0101,0.9872\n\"?_Tidy@?$vector@VMathEnabledEventField@Telemetry@Mso@@V?$allocator@VMathEnabledEventField@Telemetry@Mso@@@std@@@std@@AEAAXXZ\",\"2B2A8\",\"Mso20win32client.dll\",0.0101,0.9867,0.0204,1.9879\n\"??1?$SimpleRefCountMemoryGuard@VStringWriter@Unicode@Json@Mso@@UMakeAllocator@4@@Mso@@QEAA@XZ\",\"1C3214\",\"Mso20win32client.dll\",0.0101,0.9797,0.0101,0.9797\n\"?MsoWzToSzSimpleInPlace@@YAHPEA_W@Z\",\"241590\",\"Mso20win32client.dll\",0.0100,0.9785,0.0201,1.9570\n\"??1?$_Hash@V?$_Umap_traits@U?$pair@W4Category@Logging@Mso@@W4InternalSeverity@23@@std@@V?$vector@GV?$allocator@G@std@@@2@V?$_Uhash_compare@U?$pair@W4Category@Logging@Mso@@W4InternalSeverity@23@@std@@U?$hash@U?$pair@W4Category@Logging@Mso@@W4InternalSeverity@23@@std@@@2@U?$equal_to@U?$pair@W4Category@Logging@Mso@@W4InternalSeverity@23@@std@@@2@@2@V?$allocator@U?$pair@$$CBU?$pair@W4Category@Logging@Mso@@W4InternalSeverity@23@@std@@V?$vector@GV?$allocator@G@std@@@2@@std@@@2@$0A@@std@@@std@@QEAA@XZ\",\"BF344\",\"Mso20win32client.dll\",0.0100,0.9750,0.0235,2.2937\n\"??R?$_Func_class@_NKW4Category@Logging@Mso@@W4InternalSeverity@23@@std@@QEBA_NKW4Category@Logging@Mso@@W4InternalSeverity@34@@Z\",\"2A4CBC\",\"Mso20win32client.dll\",0.0100,0.9706,0.0199,1.9412\n\"?WriteDiagnosticLog@SizeLimitedlogFileCollection@Diagnostics@Mso@@UEAAXV?$basic_string_view@DU?$char_traits@D@std@@@std@@@Z\",\"156AE0\",\"Mso20win32client.dll\",0.0099,0.9657,0.0467,4.5457\n\"??$make_unique@$$BY0A@UColumnProperties@Telemetry@Mso@@$0A@@std@@YA?AV?$unique_ptr@$$BY0A@UColumnProperties@Telemetry@Mso@@U?$default_delete@$$BY0A@UColumnProperties@Telemetry@Mso@@@std@@@0@_K@Z\",\"279CC\",\"Mso20win32client.dll\",0.0099,0.9621,0.0185,1.8013\n\"??$transform@V?$_String_iterator@V?$_String_val@U?$_Simple_types@_W@std@@@std@@@std@@V12@P6AHH@Z@std@@YA?AV?$_String_iterator@V?$_String_val@U?$_Simple_types@_W@std@@@std@@@0@V10@0V10@P6AHH@Z@Z\",\"5F610\",\"Mso20win32client.dll\",0.0099,0.9606,0.0201,1.9562\n\"?MsoEnumValueW@@YAJPEBU_msoreg@@KPEA_WPEAK22PEAE2@Z\",\"49D50\",\"Mso20win32client.dll\",0.0095,0.9254,0.0908,8.8483\n\"??1?$Result@X@Storage@@UEAA@XZ\",\"22FAF0\",\"Mso20win32client.dll\",0.0092,0.8994,0.0092,0.8994\n\"??C?$optional@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@std@@QEBAPEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@1@XZ\",\"15564\",\"Mso20win32client.dll\",0.0092,0.8917,0.0092,0.8917\n\"??0ColumnProperties@Telemetry@Mso@@QEAA@XZ\",\"27AA0\",\"Mso20win32client.dll\",0.0086,0.8392,0.0086,0.8392\n\"?AddGroupSource@GrouperRule@Telemetry@Mso@@QEAA_NPEBURoutingInfo@23@@Z\",\"F8C80\",\"Mso20win32client.dll\",0.0073,0.7094,0.0073,0.7094\n\"??$AppendJsonString@_W$0A@@?$DiagnosticsStringBuilder@D$0EAA@@Diagnostics@Mso@@QEAA_NPEB_WV?$optional@_K@std@@@Z\",\"220D4\",\"Mso20win32client.dll\",0.0068,0.6641,0.0068,0.6641\n\"?Visit@StructuredTraceSerializer@Diagnostics@Mso@@UEAAXAEBU?$ClassifiedStructuredObject@V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@23@@Z\",\"202F0\",\"Mso20win32client.dll\",0.0068,0.6622,0.0068,0.6622\n\"?SampleEvent@Sampling@Telemetry@Mso@@YA?AV?$optional@V?$tuple@W4SamplingPolicy@Telemetry@Mso@@USampleRate@Sampling@23@@std@@@std@@V?$optional@USampleRate@Sampling@Telemetry@Mso@@@5@AEBV?$optional@VEventSamplingMetadata@Telemetry@Mso@@@5@AEBUEventFlags@23@AEBUSamplingMetadata@123@@Z\",\"84C0\",\"Mso20win32client.dll\",0.0068,0.6579,0.0390,3.8006\n\"??$CopyAndSet@PEBD@TelemetryValue@Telemetry@Mso@@AEAAXAEBQEBD@Z\",\"12B390\",\"Mso20win32client.dll\",0.0063,0.6129,0.0063,0.6129\n\"??OMathEnabledEventField@Telemetry@Mso@@QEBA?AV012@AEBV012@@Z\",\"129654\",\"Mso20win32client.dll\",0.0059,0.5763,0.0059,0.5763\n\"?substr@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QEBA?AV12@_K0@Z\",\"336F8\",\"Mso20win32client.dll\",0.0059,0.5713,0.0263,2.5653\n\"?Delete@AnyType@Mso@@AEAAXXZ\",\"2883C\",\"Mso20win32client.dll\",0.0049,0.4810,0.0049,0.4810\n\"?ReadNextAttribute@XmlReaderHelper@Telemetry@Mso@@QEAAJXZ\",\"4338C\",\"Mso20win32client.dll\",0.0029,0.2849,0.0029,0.2849\n\"??$_Insert_range_unchecked@V?$_List_unchecked_const_iterator@V?$_List_val@U?$_List_simple_types@U?$pair@$$CBVEventSamplingMetadata@Telemetry@Mso@@USampleRate@Sampling@23@@std@@@std@@@std@@U_Iterator_base0@2@@std@@V12@@?$_Hash@V?$_Umap_traits@VEventSamplingMetadata@Telemetry@Mso@@USampleRate@Sampling@23@V?$_Uhash_compare@VEventSamplingMetadata@Telemetry@Mso@@U?$hash@VEventSamplingMetadata@Telemetry@Mso@@@std@@U?$equal_to@VEventSamplingMetadata@Telemetry@Mso@@@5@@std@@V?$allocator@U?$pair@$$CBVEventSamplingMetadata@Telemetry@Mso@@USampleRate@Sampling@23@@std@@@7@$0A@@std@@@std@@IEAAXV?$_List_unchecked_const_iterator@V?$_List_val@U?$_List_simple_types@U?$pair@$$CBVEventSamplingMetadata@Telemetry@Mso@@USampleRate@Sampling@23@@std@@@std@@@std@@U_Iterator_base0@2@@1@V21@@Z\",\"2D4AC\",\"Mso20win32client.dll\",0.0017,0.1628,0.0222,2.1613\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Mso30win32client.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1D4EB6\",\"1D4EB6\",\"Mso30win32client.dll\",0.1345,13.1051,0.1345,13.1051\n\"1D4EDE\",\"1D4EDE\",\"Mso30win32client.dll\",0.1010,9.8378,0.1010,9.8378\n\"1D4EB2\",\"1D4EB2\",\"Mso30win32client.dll\",0.0856,8.3373,0.0856,8.3373\n\"1D4DFA\",\"1D4DFA\",\"Mso30win32client.dll\",0.0652,6.3520,0.0652,6.3520\n\"1D4E61\",\"1D4E61\",\"Mso30win32client.dll\",0.0617,6.0119,0.0617,6.0119\n\"1D4F2D\",\"1D4F2D\",\"Mso30win32client.dll\",0.0512,4.9837,0.0512,4.9837\n\"1D4E20\",\"1D4E20\",\"Mso30win32client.dll\",0.0511,4.9787,0.0511,4.9787\n\"1D4EFC\",\"1D4EFC\",\"Mso30win32client.dll\",0.0488,4.7571,0.0488,4.7571\n\"18A6B\",\"18A6B\",\"Mso30win32client.dll\",0.0424,4.1268,0.0424,4.1268\n\"1D4E27\",\"1D4E27\",\"Mso30win32client.dll\",0.0413,4.0191,0.0413,4.0191\n\"1D4E37\",\"1D4E37\",\"Mso30win32client.dll\",0.0402,3.9195,0.0402,3.9195\n\"1D4ECD\",\"1D4ECD\",\"Mso30win32client.dll\",0.0355,3.4549,0.0355,3.4549\n\"1D4EF4\",\"1D4EF4\",\"Mso30win32client.dll\",0.0350,3.4107,0.0350,3.4107\n\"21DD27\",\"21DD27\",\"Mso30win32client.dll\",0.0342,3.3308,0.0342,3.3308\n\"21DDD4\",\"21DDD4\",\"Mso30win32client.dll\",0.0308,3.0045,0.0308,3.0045\n\"1D4F17\",\"1D4F17\",\"Mso30win32client.dll\",0.0308,3.0041,0.0308,3.0041\n\"1DA1B0\",\"1DA1B0\",\"Mso30win32client.dll\",0.0308,2.9997,0.0308,2.9997\n\"21DD56\",\"21DD56\",\"Mso30win32client.dll\",0.0306,2.9858,0.0306,2.9858\n\"A54B\",\"A54B\",\"Mso30win32client.dll\",0.0306,2.9801,0.0306,2.9801\n\"1D4EC8\",\"1D4EC8\",\"Mso30win32client.dll\",0.0304,2.9663,0.0304,2.9663\n\"21DDDF\",\"21DDDF\",\"Mso30win32client.dll\",0.0268,2.6128,0.0268,2.6128\n\"1D4E0F\",\"1D4E0F\",\"Mso30win32client.dll\",0.0243,2.3655,0.0243,2.3655\n\"1D4E2B\",\"1D4E2B\",\"Mso30win32client.dll\",0.0230,2.2415,0.0230,2.2415\n\"1D46F8\",\"1D46F8\",\"Mso30win32client.dll\",0.0213,2.0730,0.0213,2.0730\n\"21DD5B\",\"21DD5B\",\"Mso30win32client.dll\",0.0209,2.0336,0.0209,2.0336\n\"27E26D\",\"27E26D\",\"Mso30win32client.dll\",0.0208,2.0313,0.0208,2.0313\n\"1D4E8B\",\"1D4E8B\",\"Mso30win32client.dll\",0.0208,2.0290,0.0208,2.0290\n\"CEB1\",\"CEB1\",\"Mso30win32client.dll\",0.0206,2.0033,0.0206,2.0033\n\"21DD0E\",\"21DD0E\",\"Mso30win32client.dll\",0.0205,2.0022,0.0205,2.0022\n\"1D4EE3\",\"1D4EE3\",\"Mso30win32client.dll\",0.0205,2.0021,0.0205,2.0021\n\"10F6BE\",\"10F6BE\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"17C999\",\"17C999\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"17CEE\",\"17CEE\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"18A05\",\"18A05\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"18A7A\",\"18A7A\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"1D0FF5\",\"1D0FF5\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"1D41D4\",\"1D41D4\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"1D4B18\",\"1D4B18\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"1E047A\",\"1E047A\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"25FD20\",\"25FD20\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"35804\",\"35804\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"383E40\",\"383E40\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"3C104\",\"3C104\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"3E9C5E\",\"3E9C5E\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"41E2F\",\"41E2F\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"41E35\",\"41E35\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"479D50\",\"479D50\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"4AF34\",\"4AF34\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"4E8B8\",\"4E8B8\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"52595C\",\"52595C\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"57E7C\",\"57E7C\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"8199EE\",\"8199EE\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"9034D\",\"9034D\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"96C3C\",\"96C3C\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"F583D\",\"F583D\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"F5E30\",\"F5E30\",\"Mso30win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"1D4E70\",\"1D4E70\",\"Mso30win32client.dll\",0.0205,1.9987,0.0205,1.9987\n\"45C7B0\",\"45C7B0\",\"Mso30win32client.dll\",0.0205,1.9963,0.0205,1.9963\n\"1D4F26\",\"1D4F26\",\"Mso30win32client.dll\",0.0205,1.9958,0.0205,1.9958\n\"6E29\",\"6E29\",\"Mso30win32client.dll\",0.0205,1.9930,0.0205,1.9930\n\"1D4DF6\",\"1D4DF6\",\"Mso30win32client.dll\",0.0203,1.9819,0.0203,1.9819\n\"1D4EA9\",\"1D4EA9\",\"Mso30win32client.dll\",0.0203,1.9775,0.0203,1.9775\n\"1D79F2\",\"1D79F2\",\"Mso30win32client.dll\",0.0203,1.9744,0.0203,1.9744\n\"1D4F78\",\"1D4F78\",\"Mso30win32client.dll\",0.0200,1.9527,0.0200,1.9527\n\"21DDB5\",\"21DDB5\",\"Mso30win32client.dll\",0.0187,1.8268,0.0187,1.8268\n\"21D39F\",\"21D39F\",\"Mso30win32client.dll\",0.0187,1.8202,0.0187,1.8202\n\"315590\",\"315590\",\"Mso30win32client.dll\",0.0186,1.8086,0.0186,1.8086\n\"1D5378\",\"1D5378\",\"Mso30win32client.dll\",0.0179,1.7445,0.0179,1.7445\n\"1D0AE6\",\"1D0AE6\",\"Mso30win32client.dll\",0.0177,1.7287,0.0177,1.7287\n\"1D4E3E\",\"1D4E3E\",\"Mso30win32client.dll\",0.0166,1.6166,0.0166,1.6166\n\"1D4F37\",\"1D4F37\",\"Mso30win32client.dll\",0.0161,1.5685,0.0161,1.5685\n\"508D0\",\"508D0\",\"Mso30win32client.dll\",0.0156,1.5156,0.0156,1.5156\n\"3C618\",\"3C618\",\"Mso30win32client.dll\",0.0154,1.5020,0.0154,1.5020\n\"220FD0\",\"220FD0\",\"Mso30win32client.dll\",0.0150,1.4568,0.0150,1.4568\n\"1D5370\",\"1D5370\",\"Mso30win32client.dll\",0.0137,1.3394,0.0137,1.3394\n\"9695A\",\"9695A\",\"Mso30win32client.dll\",0.0129,1.2533,0.0129,1.2533\n\"1D4238\",\"1D4238\",\"Mso30win32client.dll\",0.0127,1.2368,0.0127,1.2368\n\"C5265\",\"C5265\",\"Mso30win32client.dll\",0.0120,1.1704,0.0120,1.1704\n\"1D4F1E\",\"1D4F1E\",\"Mso30win32client.dll\",0.0119,1.1556,0.0119,1.1556\n\"1D64DD\",\"1D64DD\",\"Mso30win32client.dll\",0.0109,1.0635,0.0109,1.0635\n\"86D3C\",\"86D3C\",\"Mso30win32client.dll\",0.0109,1.0609,0.0109,1.0609\n\"1D8277\",\"1D8277\",\"Mso30win32client.dll\",0.0108,1.0522,0.0108,1.0522\n\"1CF51E\",\"1CF51E\",\"Mso30win32client.dll\",0.0108,1.0501,0.0108,1.0501\n\"1D4E95\",\"1D4E95\",\"Mso30win32client.dll\",0.0107,1.0393,0.0107,1.0393\n\"1D4315\",\"1D4315\",\"Mso30win32client.dll\",0.0107,1.0385,0.0107,1.0385\n\"6F724\",\"6F724\",\"Mso30win32client.dll\",0.0107,1.0383,0.0107,1.0383\n\"D7030\",\"D7030\",\"Mso30win32client.dll\",0.0107,1.0383,0.0107,1.0383\n\"18BB24\",\"18BB24\",\"Mso30win32client.dll\",0.0107,1.0378,0.1031,10.0425\n\"3B59A9\",\"3B59A9\",\"Mso30win32client.dll\",0.0106,1.0342,0.0106,1.0342\n\"1D4F7E\",\"1D4F7E\",\"Mso30win32client.dll\",0.0106,1.0285,0.0106,1.0285\n\"27A567\",\"27A567\",\"Mso30win32client.dll\",0.0105,1.0269,0.0105,1.0269\n\"1D4E55\",\"1D4E55\",\"Mso30win32client.dll\",0.0105,1.0216,0.0105,1.0216\n\"223381\",\"223381\",\"Mso30win32client.dll\",0.0105,1.0204,0.0105,1.0204\n\"8FF40\",\"8FF40\",\"Mso30win32client.dll\",0.0105,1.0189,0.0105,1.0189\n\"1B5CF0\",\"1B5CF0\",\"Mso30win32client.dll\",0.0104,1.0173,0.0104,1.0173\n\"2DBA28\",\"2DBA28\",\"Mso30win32client.dll\",0.0104,1.0133,0.0104,1.0133\n\"9FC40\",\"9FC40\",\"Mso30win32client.dll\",0.0104,1.0126,0.0104,1.0126\n\"21DDD7\",\"21DDD7\",\"Mso30win32client.dll\",0.0104,1.0115,0.0104,1.0115\n\"1D1018\",\"1D1018\",\"Mso30win32client.dll\",0.0104,1.0100,0.0104,1.0100\n\"21DD36\",\"21DD36\",\"Mso30win32client.dll\",0.0104,1.0087,0.0104,1.0087\n\"A961\",\"A961\",\"Mso30win32client.dll\",0.0103,1.0084,0.0103,1.0084\n\"3D11A\",\"3D11A\",\"Mso30win32client.dll\",0.0103,1.0061,0.0103,1.0061\n\"21DD4E\",\"21DD4E\",\"Mso30win32client.dll\",0.0103,1.0039,0.0103,1.0039\n\"22294A\",\"22294A\",\"Mso30win32client.dll\",0.0103,1.0031,0.0103,1.0031\n\"1D537D\",\"1D537D\",\"Mso30win32client.dll\",0.0103,1.0030,0.0103,1.0030\n\"19C03\",\"19C03\",\"Mso30win32client.dll\",0.0103,1.0023,0.0103,1.0023\n\"26C05\",\"26C05\",\"Mso30win32client.dll\",0.0103,1.0015,0.0103,1.0015\n\"1CAE4F\",\"1CAE4F\",\"Mso30win32client.dll\",0.0103,1.0010,0.0103,1.0010\n\"21DDE2\",\"21DDE2\",\"Mso30win32client.dll\",0.0103,1.0009,0.0103,1.0009\n\"171B0F\",\"171B0F\",\"Mso30win32client.dll\",0.0103,1.0007,0.0103,1.0007\n\"1A90E\",\"1A90E\",\"Mso30win32client.dll\",0.0103,1.0003,0.0103,1.0003\n\"1A938\",\"1A938\",\"Mso30win32client.dll\",0.0103,1.0002,0.0103,1.0002\n\"4B413\",\"4B413\",\"Mso30win32client.dll\",0.0103,1.0001,0.0103,1.0001\n\"1D4B98\",\"1D4B98\",\"Mso30win32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"70ACB\",\"70ACB\",\"Mso30win32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"842D0\",\"842D0\",\"Mso30win32client.dll\",0.0103,0.9996,0.0103,0.9996\n\"3C601\",\"3C601\",\"Mso30win32client.dll\",0.0103,0.9992,0.0103,0.9992\n\"A31EA\",\"A31EA\",\"Mso30win32client.dll\",0.0103,0.9992,0.0103,0.9992\n\"189AC\",\"189AC\",\"Mso30win32client.dll\",0.0103,0.9989,0.0103,0.9989\n\"1A8D1\",\"1A8D1\",\"Mso30win32client.dll\",0.0103,0.9987,0.0103,0.9987\n\"1D7C9A\",\"1D7C9A\",\"Mso30win32client.dll\",0.0102,0.9983,0.0102,0.9983\n\"1D4E98\",\"1D4E98\",\"Mso30win32client.dll\",0.0102,0.9973,0.0102,0.9973\n\"1CAE53\",\"1CAE53\",\"Mso30win32client.dll\",0.0102,0.9971,0.0102,0.9971\n\"22B36E\",\"22B36E\",\"Mso30win32client.dll\",0.0102,0.9971,0.0102,0.9971\n\"251D8\",\"251D8\",\"Mso30win32client.dll\",0.0102,0.9968,0.0102,0.9968\n\"18A93\",\"18A93\",\"Mso30win32client.dll\",0.0102,0.9967,0.0102,0.9967\n\"21DD1D\",\"21DD1D\",\"Mso30win32client.dll\",0.0102,0.9964,0.0102,0.9964\n\"1D4EF7\",\"1D4EF7\",\"Mso30win32client.dll\",0.0102,0.9963,0.0102,0.9963\n\"90134\",\"90134\",\"Mso30win32client.dll\",0.0102,0.9961,0.0102,0.9961\n\"1AD2D9\",\"1AD2D9\",\"Mso30win32client.dll\",0.0102,0.9956,0.0102,0.9956\n\"1D4F87\",\"1D4F87\",\"Mso30win32client.dll\",0.0102,0.9956,0.0102,0.9956\n\"22B336\",\"22B336\",\"Mso30win32client.dll\",0.0102,0.9956,0.0102,0.9956\n\"A31BD\",\"A31BD\",\"Mso30win32client.dll\",0.0102,0.9956,0.0102,0.9956\n\"3677C\",\"3677C\",\"Mso30win32client.dll\",0.0102,0.9953,0.0102,0.9953\n\"1CAE6A\",\"1CAE6A\",\"Mso30win32client.dll\",0.0102,0.9951,0.0102,0.9951\n\"1D4ED5\",\"1D4ED5\",\"Mso30win32client.dll\",0.0102,0.9951,0.0102,0.9951\n\"F4B5A\",\"F4B5A\",\"Mso30win32client.dll\",0.0102,0.9951,0.0102,0.9951\n\"18DEE\",\"18DEE\",\"Mso30win32client.dll\",0.0102,0.9949,0.0102,0.9949\n\"F5389\",\"F5389\",\"Mso30win32client.dll\",0.0102,0.9948,0.0102,0.9948\n\"1D66B0\",\"1D66B0\",\"Mso30win32client.dll\",0.0102,0.9936,0.0102,0.9936\n\"3FF9D0\",\"3FF9D0\",\"Mso30win32client.dll\",0.0102,0.9936,0.0102,0.9936\n\"1D4F30\",\"1D4F30\",\"Mso30win32client.dll\",0.0102,0.9934,0.0102,0.9934\n\"19564\",\"19564\",\"Mso30win32client.dll\",0.0102,0.9933,0.0102,0.9933\n\"1B024\",\"1B024\",\"Mso30win32client.dll\",0.0102,0.9930,0.0102,0.9930\n\"1E859\",\"1E859\",\"Mso30win32client.dll\",0.0102,0.9927,0.0102,0.9927\n\"18E10\",\"18E10\",\"Mso30win32client.dll\",0.0102,0.9925,0.0102,0.9925\n\"7255B\",\"7255B\",\"Mso30win32client.dll\",0.0102,0.9915,0.0102,0.9915\n\"1CAE68\",\"1CAE68\",\"Mso30win32client.dll\",0.0102,0.9907,0.0102,0.9907\n\"74180\",\"74180\",\"Mso30win32client.dll\",0.0102,0.9893,0.0102,0.9893\n\"1CF5E0\",\"1CF5E0\",\"Mso30win32client.dll\",0.0101,0.9845,0.0101,0.9845\n\"17C985\",\"17C985\",\"Mso30win32client.dll\",0.0101,0.9814,0.0101,0.9814\n\"22B35F\",\"22B35F\",\"Mso30win32client.dll\",0.0101,0.9802,0.0101,0.9802\n\"E6F40\",\"E6F40\",\"Mso30win32client.dll\",0.0101,0.9801,0.0101,0.9801\n\"21DDBF\",\"21DDBF\",\"Mso30win32client.dll\",0.0101,0.9795,0.0101,0.9795\n\"8DD3C\",\"8DD3C\",\"Mso30win32client.dll\",0.0101,0.9795,0.0101,0.9795\n\"3EFEF\",\"3EFEF\",\"Mso30win32client.dll\",0.0100,0.9767,0.0100,0.9767\n\"3D81B0\",\"3D81B0\",\"Mso30win32client.dll\",0.0100,0.9759,0.0100,0.9759\n\"1899B\",\"1899B\",\"Mso30win32client.dll\",0.0099,0.9691,0.0099,0.9691\n\"1D6862\",\"1D6862\",\"Mso30win32client.dll\",0.0098,0.9591,0.0098,0.9591\n\"1D4E9F\",\"1D4E9F\",\"Mso30win32client.dll\",0.0098,0.9578,0.0098,0.9578\n\"1737F0\",\"1737F0\",\"Mso30win32client.dll\",0.0095,0.9264,0.0095,0.9264\n\"37568\",\"37568\",\"Mso30win32client.dll\",0.0092,0.8939,0.0092,0.8939\n\"37F68\",\"37F68\",\"Mso30win32client.dll\",0.0086,0.8390,0.0998,9.7223\n\"1D7A00\",\"1D7A00\",\"Mso30win32client.dll\",0.0085,0.8306,0.0085,0.8306\n\"21E5BE\",\"21E5BE\",\"Mso30win32client.dll\",0.0075,0.7266,0.0075,0.7266\n\"528780\",\"528780\",\"Mso30win32client.dll\",0.0068,0.6626,0.0068,0.6626\n\"1D4EEB\",\"1D4EEB\",\"Mso30win32client.dll\",0.0065,0.6293,0.0065,0.6293\n\"1D4E67\",\"1D4E67\",\"Mso30win32client.dll\",0.0060,0.5815,0.0060,0.5815\n\"2DBDA4\",\"2DBDA4\",\"Mso30win32client.dll\",0.0056,0.5408,0.0056,0.5408\n\"18DFA\",\"18DFA\",\"Mso30win32client.dll\",0.0047,0.4561,0.0047,0.4561\n\"1D4F09\",\"1D4F09\",\"Mso30win32client.dll\",0.0047,0.4533,0.0047,0.4533\n\"1D4EA4\",\"1D4EA4\",\"Mso30win32client.dll\",0.0021,0.2045,0.0021,0.2045\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Mso40UIwin32client.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"E29D5\",\"E29D5\",\"Mso40UIwin32client.dll\",0.1230,11.9876,0.1230,11.9876\n\"E383B\",\"E383B\",\"Mso40UIwin32client.dll\",0.0520,5.0628,0.0520,5.0628\n\"E3A0B\",\"E3A0B\",\"Mso40UIwin32client.dll\",0.0410,3.9945,0.0730,7.1154\n\"50776\",\"50776\",\"Mso40UIwin32client.dll\",0.0409,3.9862,0.0409,3.9862\n\"E3C1C\",\"E3C1C\",\"Mso40UIwin32client.dll\",0.0405,3.9459,0.0405,3.9459\n\"E1EED\",\"E1EED\",\"Mso40UIwin32client.dll\",0.0343,3.3378,0.0343,3.3378\n\"D460F\",\"D460F\",\"Mso40UIwin32client.dll\",0.0337,3.2788,0.0337,3.2788\n\"6F785\",\"6F785\",\"Mso40UIwin32client.dll\",0.0329,3.2042,0.0329,3.2042\n\"255B6\",\"255B6\",\"Mso40UIwin32client.dll\",0.0311,3.0344,0.0311,3.0344\n\"AA93\",\"AA93\",\"Mso40UIwin32client.dll\",0.0309,3.0112,0.0309,3.0112\n\"E3854\",\"E3854\",\"Mso40UIwin32client.dll\",0.0308,3.0055,0.0308,3.0055\n\"AFA21\",\"AFA21\",\"Mso40UIwin32client.dll\",0.0308,3.0046,0.0308,3.0046\n\"D4199\",\"D4199\",\"Mso40UIwin32client.dll\",0.0308,2.9997,0.0308,2.9997\n\"E3848\",\"E3848\",\"Mso40UIwin32client.dll\",0.0308,2.9971,0.0308,2.9971\n\"CF513\",\"CF513\",\"Mso40UIwin32client.dll\",0.0308,2.9961,0.0308,2.9961\n\"5077C\",\"5077C\",\"Mso40UIwin32client.dll\",0.0285,2.7781,0.0798,7.7726\n\"14383D\",\"14383D\",\"Mso40UIwin32client.dll\",0.0282,2.7429,0.0282,2.7429\n\"E38F3\",\"E38F3\",\"Mso40UIwin32client.dll\",0.0275,2.6773,0.0469,4.5660\n\"D4284\",\"D4284\",\"Mso40UIwin32client.dll\",0.0272,2.6534,0.0272,2.6534\n\"14386C\",\"14386C\",\"Mso40UIwin32client.dll\",0.0253,2.4667,0.0253,2.4667\n\"E3819\",\"E3819\",\"Mso40UIwin32client.dll\",0.0247,2.4024,0.0247,2.4024\n\"D45C1\",\"D45C1\",\"Mso40UIwin32client.dll\",0.0213,2.0791,0.0213,2.0791\n\"F1013\",\"F1013\",\"Mso40UIwin32client.dll\",0.0213,2.0706,0.0213,2.0706\n\"D415C\",\"D415C\",\"Mso40UIwin32client.dll\",0.0209,2.0350,0.0209,2.0350\n\"E2A35\",\"E2A35\",\"Mso40UIwin32client.dll\",0.0208,2.0248,0.0208,2.0248\n\"166144\",\"166144\",\"Mso40UIwin32client.dll\",0.0207,2.0134,0.0207,2.0134\n\"DF6A8\",\"DF6A8\",\"Mso40UIwin32client.dll\",0.0206,2.0085,0.0206,2.0085\n\"18FD9A\",\"18FD9A\",\"Mso40UIwin32client.dll\",0.0206,2.0070,0.0206,2.0070\n\"D4190\",\"D4190\",\"Mso40UIwin32client.dll\",0.0206,2.0037,0.0206,2.0037\n\"BB119\",\"BB119\",\"Mso40UIwin32client.dll\",0.0205,2.0021,0.0205,2.0021\n\"11E0FA\",\"11E0FA\",\"Mso40UIwin32client.dll\",0.0205,2.0017,0.0205,2.0017\n\"E29D7\",\"E29D7\",\"Mso40UIwin32client.dll\",0.0205,2.0014,0.0205,2.0014\n\"E2D75\",\"E2D75\",\"Mso40UIwin32client.dll\",0.0205,2.0003,0.0205,2.0003\n\"123BA\",\"123BA\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"126C16\",\"126C16\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"14154\",\"14154\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0322,3.1381\n\"150583\",\"150583\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"210D53\",\"210D53\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"215A7\",\"215A7\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"3DDA26\",\"3DDA26\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"58A78\",\"58A78\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"66147\",\"66147\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"818D8\",\"818D8\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"B687C\",\"B687C\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"DD67B\",\"DD67B\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"E2D6C\",\"E2D6C\",\"Mso40UIwin32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"E383D\",\"E383D\",\"Mso40UIwin32client.dll\",0.0205,1.9994,0.0205,1.9994\n\"11E0D6\",\"11E0D6\",\"Mso40UIwin32client.dll\",0.0205,1.9974,0.0205,1.9974\n\"E39B6\",\"E39B6\",\"Mso40UIwin32client.dll\",0.0205,1.9974,0.0205,1.9974\n\"E34FF\",\"E34FF\",\"Mso40UIwin32client.dll\",0.0205,1.9968,0.0205,1.9968\n\"E29E0\",\"E29E0\",\"Mso40UIwin32client.dll\",0.0205,1.9949,0.0205,1.9949\n\"D4206\",\"D4206\",\"Mso40UIwin32client.dll\",0.0205,1.9932,0.0205,1.9932\n\"D41A6\",\"D41A6\",\"Mso40UIwin32client.dll\",0.0204,1.9896,0.0204,1.9896\n\"124885\",\"124885\",\"Mso40UIwin32client.dll\",0.0196,1.9094,0.0196,1.9094\n\"E530F\",\"E530F\",\"Mso40UIwin32client.dll\",0.0194,1.8861,0.0194,1.8861\n\"D4505\",\"D4505\",\"Mso40UIwin32client.dll\",0.0193,1.8790,0.0193,1.8790\n\"95B12\",\"95B12\",\"Mso40UIwin32client.dll\",0.0185,1.8010,0.0185,1.8010\n\"11BEA0\",\"11BEA0\",\"Mso40UIwin32client.dll\",0.0165,1.6035,0.0165,1.6035\n\"E58B7\",\"E58B7\",\"Mso40UIwin32client.dll\",0.0164,1.5975,0.0164,1.5975\n\"E2160\",\"E2160\",\"Mso40UIwin32client.dll\",0.0160,1.5606,0.0160,1.5606\n\"1402D6\",\"1402D6\",\"Mso40UIwin32client.dll\",0.0159,1.5474,0.0159,1.5474\n\"16A4F5\",\"16A4F5\",\"Mso40UIwin32client.dll\",0.0155,1.5118,0.0155,1.5118\n\"E383F\",\"E383F\",\"Mso40UIwin32client.dll\",0.0155,1.5097,0.0155,1.5097\n\"2220B\",\"2220B\",\"Mso40UIwin32client.dll\",0.0154,1.5012,0.0154,1.5012\n\"54B14\",\"54B14\",\"Mso40UIwin32client.dll\",0.0147,1.4369,0.0147,1.4369\n\"159335\",\"159335\",\"Mso40UIwin32client.dll\",0.0144,1.4032,0.0144,1.4032\n\"E1ED6\",\"E1ED6\",\"Mso40UIwin32client.dll\",0.0143,1.3894,0.0143,1.3894\n\"E3791\",\"E3791\",\"Mso40UIwin32client.dll\",0.0132,1.2882,0.0132,1.2882\n\"E7564\",\"E7564\",\"Mso40UIwin32client.dll\",0.0129,1.2574,0.0129,1.2574\n\"E1EE6\",\"E1EE6\",\"Mso40UIwin32client.dll\",0.0126,1.2252,0.0126,1.2252\n\"D4279\",\"D4279\",\"Mso40UIwin32client.dll\",0.0126,1.2251,0.0126,1.2251\n\"62F26\",\"62F26\",\"Mso40UIwin32client.dll\",0.0122,1.1849,0.0122,1.1849\n\"14385B\",\"14385B\",\"Mso40UIwin32client.dll\",0.0120,1.1649,2.9233,284.8250\n\"143834\",\"143834\",\"Mso40UIwin32client.dll\",0.0114,1.1154,0.0114,1.1154\n\"4FD61\",\"4FD61\",\"Mso40UIwin32client.dll\",0.0111,1.0807,0.0111,1.0807\n\"E19E3\",\"E19E3\",\"Mso40UIwin32client.dll\",0.0108,1.0533,0.0108,1.0533\n\"FE709\",\"FE709\",\"Mso40UIwin32client.dll\",0.0106,1.0353,0.0106,1.0353\n\"255C8\",\"255C8\",\"Mso40UIwin32client.dll\",0.0106,1.0314,0.0106,1.0314\n\"53B4D\",\"53B4D\",\"Mso40UIwin32client.dll\",0.0104,1.0172,0.0104,1.0172\n\"DF063\",\"DF063\",\"Mso40UIwin32client.dll\",0.0104,1.0132,0.0104,1.0132\n\"810B9\",\"810B9\",\"Mso40UIwin32client.dll\",0.0103,1.0075,0.0103,1.0075\n\"45120\",\"45120\",\"Mso40UIwin32client.dll\",0.0103,1.0073,0.0103,1.0073\n\"113141\",\"113141\",\"Mso40UIwin32client.dll\",0.0103,1.0072,0.0103,1.0072\n\"1A9006\",\"1A9006\",\"Mso40UIwin32client.dll\",0.0103,1.0057,0.0103,1.0057\n\"D421C\",\"D421C\",\"Mso40UIwin32client.dll\",0.0103,1.0053,0.0103,1.0053\n\"E448E\",\"E448E\",\"Mso40UIwin32client.dll\",0.0103,1.0052,0.0103,1.0052\n\"FE73F\",\"FE73F\",\"Mso40UIwin32client.dll\",0.0103,1.0051,0.4294,41.8400\n\"E2D5F\",\"E2D5F\",\"Mso40UIwin32client.dll\",0.0103,1.0044,0.0103,1.0044\n\"6613D\",\"6613D\",\"Mso40UIwin32client.dll\",0.0103,1.0043,0.0103,1.0043\n\"E64B0\",\"E64B0\",\"Mso40UIwin32client.dll\",0.0103,1.0040,0.0103,1.0040\n\"E6AEB\",\"E6AEB\",\"Mso40UIwin32client.dll\",0.0103,1.0039,0.0103,1.0039\n\"1B7286\",\"1B7286\",\"Mso40UIwin32client.dll\",0.0103,1.0037,0.0103,1.0037\n\"D68A7\",\"D68A7\",\"Mso40UIwin32client.dll\",0.0103,1.0035,0.0103,1.0035\n\"12757A\",\"12757A\",\"Mso40UIwin32client.dll\",0.0103,1.0034,0.0103,1.0034\n\"E3909\",\"E3909\",\"Mso40UIwin32client.dll\",0.0103,1.0033,0.0206,2.0027\n\"4B6A4\",\"4B6A4\",\"Mso40UIwin32client.dll\",0.0103,1.0031,0.0103,1.0031\n\"D41FA\",\"D41FA\",\"Mso40UIwin32client.dll\",0.0103,1.0029,0.0103,1.0029\n\"64E37\",\"64E37\",\"Mso40UIwin32client.dll\",0.0103,1.0028,0.0103,1.0028\n\"E38E3\",\"E38E3\",\"Mso40UIwin32client.dll\",0.0103,1.0028,0.0103,1.0028\n\"255F8\",\"255F8\",\"Mso40UIwin32client.dll\",0.0103,1.0027,0.0103,1.0027\n\"E1EE0\",\"E1EE0\",\"Mso40UIwin32client.dll\",0.0103,1.0024,0.0103,1.0024\n\"62C5F\",\"62C5F\",\"Mso40UIwin32client.dll\",0.0103,1.0023,0.0103,1.0023\n\"D9F9E\",\"D9F9E\",\"Mso40UIwin32client.dll\",0.0103,1.0021,0.0103,1.0021\n\"7B641\",\"7B641\",\"Mso40UIwin32client.dll\",0.0103,1.0020,0.0103,1.0020\n\"E3B5A\",\"E3B5A\",\"Mso40UIwin32client.dll\",0.0103,1.0020,0.0103,1.0020\n\"E37EE\",\"E37EE\",\"Mso40UIwin32client.dll\",0.0103,1.0019,0.0103,1.0019\n\"255B3\",\"255B3\",\"Mso40UIwin32client.dll\",0.0103,1.0018,0.0103,1.0018\n\"50300\",\"50300\",\"Mso40UIwin32client.dll\",0.0103,1.0018,0.0103,1.0018\n\"E219C\",\"E219C\",\"Mso40UIwin32client.dll\",0.0103,1.0017,0.0103,1.0017\n\"E21D7\",\"E21D7\",\"Mso40UIwin32client.dll\",0.0103,1.0017,0.0103,1.0017\n\"E2CEA\",\"E2CEA\",\"Mso40UIwin32client.dll\",0.0103,1.0016,0.0103,1.0016\n\"18B387\",\"18B387\",\"Mso40UIwin32client.dll\",0.0103,1.0012,0.0103,1.0012\n\"1437E0\",\"1437E0\",\"Mso40UIwin32client.dll\",0.0103,1.0010,0.0103,1.0010\n\"E1402\",\"E1402\",\"Mso40UIwin32client.dll\",0.0103,1.0010,0.0103,1.0010\n\"E2192\",\"E2192\",\"Mso40UIwin32client.dll\",0.0103,1.0010,0.0103,1.0010\n\"E2D4F\",\"E2D4F\",\"Mso40UIwin32client.dll\",0.0103,1.0010,0.0103,1.0010\n\"11E0F5\",\"11E0F5\",\"Mso40UIwin32client.dll\",0.0103,1.0007,0.0103,1.0007\n\"E2903\",\"E2903\",\"Mso40UIwin32client.dll\",0.0103,1.0007,0.0103,1.0007\n\"E3770\",\"E3770\",\"Mso40UIwin32client.dll\",0.0103,1.0007,0.0103,1.0007\n\"17AD61\",\"17AD61\",\"Mso40UIwin32client.dll\",0.0103,1.0005,0.0103,1.0005\n\"51A13\",\"51A13\",\"Mso40UIwin32client.dll\",0.0103,1.0005,0.0103,1.0005\n\"E2165\",\"E2165\",\"Mso40UIwin32client.dll\",0.0103,1.0005,0.0103,1.0005\n\"3769BE\",\"3769BE\",\"Mso40UIwin32client.dll\",0.0103,1.0004,0.0103,1.0004\n\"E3877\",\"E3877\",\"Mso40UIwin32client.dll\",0.0103,1.0004,0.0103,1.0004\n\"157341\",\"157341\",\"Mso40UIwin32client.dll\",0.0103,1.0003,0.0103,1.0003\n\"506F5\",\"506F5\",\"Mso40UIwin32client.dll\",0.0103,1.0002,0.0103,1.0002\n\"E12F7\",\"E12F7\",\"Mso40UIwin32client.dll\",0.0103,1.0002,0.0103,1.0002\n\"E2D59\",\"E2D59\",\"Mso40UIwin32client.dll\",0.0103,1.0002,0.0103,1.0002\n\"E393B\",\"E393B\",\"Mso40UIwin32client.dll\",0.0103,1.0002,0.0103,1.0002\n\"E290B\",\"E290B\",\"Mso40UIwin32client.dll\",0.0103,1.0001,0.0103,1.0001\n\"10E9DC\",\"10E9DC\",\"Mso40UIwin32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"15726D\",\"15726D\",\"Mso40UIwin32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"502E1\",\"502E1\",\"Mso40UIwin32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"79443\",\"79443\",\"Mso40UIwin32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"E3A18\",\"E3A18\",\"Mso40UIwin32client.dll\",0.0103,1.0000,0.0103,1.0000\n\"DF4A0\",\"DF4A0\",\"Mso40UIwin32client.dll\",0.0103,0.9998,0.0103,0.9998\n\"E39DA\",\"E39DA\",\"Mso40UIwin32client.dll\",0.0103,0.9998,0.0103,0.9998\n\"15517D\",\"15517D\",\"Mso40UIwin32client.dll\",0.0103,0.9997,0.0103,0.9997\n\"BA459\",\"BA459\",\"Mso40UIwin32client.dll\",0.0103,0.9997,0.0103,0.9997\n\"BA75C\",\"BA75C\",\"Mso40UIwin32client.dll\",0.0103,0.9997,0.0103,0.9997\n\"1431FB\",\"1431FB\",\"Mso40UIwin32client.dll\",0.0103,0.9996,0.0103,0.9996\n\"CD360\",\"CD360\",\"Mso40UIwin32client.dll\",0.0103,0.9996,0.0103,0.9996\n\"E38F9\",\"E38F9\",\"Mso40UIwin32client.dll\",0.0103,0.9996,0.0103,0.9996\n\"BA464\",\"BA464\",\"Mso40UIwin32client.dll\",0.0103,0.9995,0.0103,0.9995\n\"17672D\",\"17672D\",\"Mso40UIwin32client.dll\",0.0103,0.9994,0.0103,0.9994\n\"E56F0\",\"E56F0\",\"Mso40UIwin32client.dll\",0.0103,0.9994,0.0103,0.9994\n\"E3874\",\"E3874\",\"Mso40UIwin32client.dll\",0.0103,0.9993,0.3262,31.7793\n\"E391F\",\"E391F\",\"Mso40UIwin32client.dll\",0.0103,0.9992,0.0103,0.9992\n\"D876E\",\"D876E\",\"Mso40UIwin32client.dll\",0.0103,0.9991,2.0629,200.9925\n\"E3C2A\",\"E3C2A\",\"Mso40UIwin32client.dll\",0.0102,0.9985,0.0102,0.9985\n\"D4287\",\"D4287\",\"Mso40UIwin32client.dll\",0.0102,0.9984,0.0102,0.9984\n\"E2CBD\",\"E2CBD\",\"Mso40UIwin32client.dll\",0.0102,0.9984,0.0102,0.9984\n\"10A058\",\"10A058\",\"Mso40UIwin32client.dll\",0.0102,0.9981,0.0102,0.9981\n\"23920\",\"23920\",\"Mso40UIwin32client.dll\",0.0102,0.9981,0.0102,0.9981\n\"6F7E4\",\"6F7E4\",\"Mso40UIwin32client.dll\",0.0102,0.9981,0.0102,0.9981\n\"255D5\",\"255D5\",\"Mso40UIwin32client.dll\",0.0102,0.9979,0.0102,0.9979\n\"D423C\",\"D423C\",\"Mso40UIwin32client.dll\",0.0102,0.9979,0.0102,0.9979\n\"1572EB\",\"1572EB\",\"Mso40UIwin32client.dll\",0.0102,0.9978,0.0102,0.9978\n\"2394C\",\"2394C\",\"Mso40UIwin32client.dll\",0.0102,0.9978,0.0102,0.9978\n\"E0BB1\",\"E0BB1\",\"Mso40UIwin32client.dll\",0.0102,0.9977,0.0102,0.9977\n\"10AFFA\",\"10AFFA\",\"Mso40UIwin32client.dll\",0.0102,0.9974,0.0102,0.9974\n\"147F08\",\"147F08\",\"Mso40UIwin32client.dll\",0.0102,0.9974,0.0102,0.9974\n\"E3522\",\"E3522\",\"Mso40UIwin32client.dll\",0.0102,0.9974,0.0102,0.9974\n\"E1A36\",\"E1A36\",\"Mso40UIwin32client.dll\",0.0102,0.9973,0.0102,0.9973\n\"661B4\",\"661B4\",\"Mso40UIwin32client.dll\",0.0102,0.9972,0.0102,0.9972\n\"E12F4\",\"E12F4\",\"Mso40UIwin32client.dll\",0.0102,0.9971,0.0102,0.9971\n\"D8280\",\"D8280\",\"Mso40UIwin32client.dll\",0.0102,0.9968,0.0102,0.9968\n\"E3278\",\"E3278\",\"Mso40UIwin32client.dll\",0.0102,0.9967,0.0205,1.9974\n\"126D32\",\"126D32\",\"Mso40UIwin32client.dll\",0.0102,0.9963,0.0102,0.9963\n\"231EA\",\"231EA\",\"Mso40UIwin32client.dll\",0.0102,0.9963,0.0102,0.9963\n\"E8D5B\",\"E8D5B\",\"Mso40UIwin32client.dll\",0.0102,0.9963,0.0102,0.9963\n\"E043F\",\"E043F\",\"Mso40UIwin32client.dll\",0.0102,0.9958,0.0102,0.9958\n\"E3832\",\"E3832\",\"Mso40UIwin32client.dll\",0.0102,0.9956,0.0102,0.9956\n\"11E0E3\",\"11E0E3\",\"Mso40UIwin32client.dll\",0.0102,0.9954,0.0102,0.9954\n\"E39F3\",\"E39F3\",\"Mso40UIwin32client.dll\",0.0102,0.9953,0.0205,1.9992\n\"11640A\",\"11640A\",\"Mso40UIwin32client.dll\",0.0102,0.9951,0.0102,0.9951\n\"E19F5\",\"E19F5\",\"Mso40UIwin32client.dll\",0.0102,0.9951,0.0102,0.9951\n\"E290F\",\"E290F\",\"Mso40UIwin32client.dll\",0.0102,0.9944,0.0102,0.9944\n\"6F9EA\",\"6F9EA\",\"Mso40UIwin32client.dll\",0.0102,0.9943,0.0102,0.9943\n\"E29F3\",\"E29F3\",\"Mso40UIwin32client.dll\",0.0102,0.9943,0.0102,0.9943\n\"52A3C\",\"52A3C\",\"Mso40UIwin32client.dll\",0.0102,0.9938,0.0102,0.9938\n\"BA475\",\"BA475\",\"Mso40UIwin32client.dll\",0.0102,0.9938,0.0102,0.9938\n\"8102D\",\"8102D\",\"Mso40UIwin32client.dll\",0.0102,0.9937,0.0102,0.9937\n\"72EE1\",\"72EE1\",\"Mso40UIwin32client.dll\",0.0102,0.9935,0.0102,0.9935\n\"E38ED\",\"E38ED\",\"Mso40UIwin32client.dll\",0.0102,0.9933,0.0102,0.9933\n\"E36DB\",\"E36DB\",\"Mso40UIwin32client.dll\",0.0102,0.9927,0.0102,0.9927\n\"D5836\",\"D5836\",\"Mso40UIwin32client.dll\",0.0102,0.9921,0.0102,0.9921\n\"177618\",\"177618\",\"Mso40UIwin32client.dll\",0.0102,0.9909,0.0102,0.9909\n\"E21EB\",\"E21EB\",\"Mso40UIwin32client.dll\",0.0102,0.9902,0.0102,0.9902\n\"48C7C\",\"48C7C\",\"Mso40UIwin32client.dll\",0.0102,0.9895,0.0102,0.9895\n\"126325\",\"126325\",\"Mso40UIwin32client.dll\",0.0101,0.9875,0.0101,0.9875\n\"DEFB5\",\"DEFB5\",\"Mso40UIwin32client.dll\",0.0101,0.9870,0.0101,0.9870\n\"B9A76\",\"B9A76\",\"Mso40UIwin32client.dll\",0.0101,0.9861,0.0101,0.9861\n\"64E3C\",\"64E3C\",\"Mso40UIwin32client.dll\",0.0101,0.9857,0.5214,50.8008\n\"111359\",\"111359\",\"Mso40UIwin32client.dll\",0.0101,0.9851,0.0101,0.9851\n\"143196\",\"143196\",\"Mso40UIwin32client.dll\",0.0101,0.9845,0.0101,0.9845\n\"190A20\",\"190A20\",\"Mso40UIwin32client.dll\",0.0101,0.9840,0.0101,0.9840\n\"EBB2D\",\"EBB2D\",\"Mso40UIwin32client.dll\",0.0101,0.9814,0.0101,0.9814\n\"4E3D7\",\"4E3D7\",\"Mso40UIwin32client.dll\",0.0100,0.9763,0.0100,0.9763\n\"E29E4\",\"E29E4\",\"Mso40UIwin32client.dll\",0.0100,0.9701,0.0100,0.9701\n\"164477\",\"164477\",\"Mso40UIwin32client.dll\",0.0100,0.9699,0.0100,0.9699\n\"E3C1F\",\"E3C1F\",\"Mso40UIwin32client.dll\",0.0100,0.9699,0.0100,0.9699\n\"149645\",\"149645\",\"Mso40UIwin32client.dll\",0.0099,0.9656,0.0099,0.9656\n\"111312\",\"111312\",\"Mso40UIwin32client.dll\",0.0099,0.9621,0.0099,0.9621\n\"10B32D\",\"10B32D\",\"Mso40UIwin32client.dll\",0.0098,0.9536,0.0098,0.9536\n\"E530B\",\"E530B\",\"Mso40UIwin32client.dll\",0.0086,0.8378,0.0086,0.8378\n\"B5F00\",\"B5F00\",\"Mso40UIwin32client.dll\",0.0082,0.7989,3.0060,292.8820\n\"66114\",\"66114\",\"Mso40UIwin32client.dll\",0.0081,0.7870,0.0081,0.7870\n\"158F9A\",\"158F9A\",\"Mso40UIwin32client.dll\",0.0074,0.7235,0.0074,0.7235\n\"2697E\",\"2697E\",\"Mso40UIwin32client.dll\",0.0071,0.6937,0.0071,0.6937\n\"14C06\",\"14C06\",\"Mso40UIwin32client.dll\",0.0071,0.6901,0.0071,0.6901\n\"50676\",\"50676\",\"Mso40UIwin32client.dll\",0.0069,0.6750,0.0069,0.6750\n\"1A91B5\",\"1A91B5\",\"Mso40UIwin32client.dll\",0.0065,0.6368,0.0065,0.6368\n\"B0F1B\",\"B0F1B\",\"Mso40UIwin32client.dll\",0.0065,0.6305,0.0065,0.6305\n\"B8FC4\",\"B8FC4\",\"Mso40UIwin32client.dll\",0.0061,0.5926,0.0061,0.5926\n\"E108B\",\"E108B\",\"Mso40UIwin32client.dll\",0.0059,0.5724,0.0059,0.5724\n\"CA44\",\"CA44\",\"Mso40UIwin32client.dll\",0.0058,0.5699,0.0161,1.5729\n\"1130BF\",\"1130BF\",\"Mso40UIwin32client.dll\",0.0057,0.5523,0.0161,1.5649\n\"32960\",\"32960\",\"Mso40UIwin32client.dll\",0.0044,0.4331,0.0044,0.4331\n\"B6918\",\"B6918\",\"Mso40UIwin32client.dll\",0.0031,0.3026,0.0031,0.3026\n\"E34F5\",\"E34F5\",\"Mso40UIwin32client.dll\",0.0014,0.1381,0.0014,0.1381\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Mso50win32client.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"18180\",\"18180\",\"Mso50win32client.dll\",0.0103,1.0017,0.0103,1.0017\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Mso98win32client.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"125ED0\",\"125ED0\",\"Mso98win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"439E41\",\"439E41\",\"Mso98win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"598730\",\"598730\",\"Mso98win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"7F9E7\",\"7F9E7\",\"Mso98win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"91FF2\",\"91FF2\",\"Mso98win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"D1928\",\"D1928\",\"Mso98win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"F076C\",\"F076C\",\"Mso98win32client.dll\",0.0205,2.0000,0.0205,2.0000\n\"197600\",\"197600\",\"Mso98win32client.dll\",0.0164,1.5946,0.0164,1.5946\n\"D010E\",\"D010E\",\"Mso98win32client.dll\",0.0133,1.3004,0.0133,1.3004\n\"132448\",\"132448\",\"Mso98win32client.dll\",0.0105,1.0223,0.0105,1.0223\n\"187160\",\"187160\",\"Mso98win32client.dll\",0.0104,1.0124,0.0104,1.0124\n\"D0582\",\"D0582\",\"Mso98win32client.dll\",0.0104,1.0087,0.0104,1.0087\n\"4D75A0\",\"4D75A0\",\"Mso98win32client.dll\",0.0103,1.0035,0.0103,1.0035\n\"59D92\",\"59D92\",\"Mso98win32client.dll\",0.0103,1.0011,0.0103,1.0011\n\"E7BCD\",\"E7BCD\",\"Mso98win32client.dll\",0.0103,1.0008,0.0103,1.0008\n\"93D37\",\"93D37\",\"Mso98win32client.dll\",0.0103,0.9992,0.0103,0.9992\n\"ED032\",\"ED032\",\"Mso98win32client.dll\",0.0102,0.9984,0.0102,0.9984\n\"CFD25\",\"CFD25\",\"Mso98win32client.dll\",0.0101,0.9878,0.0101,0.9878\n\"F5970\",\"F5970\",\"Mso98win32client.dll\",0.0101,0.9869,0.0101,0.9869\n\"D5019\",\"D5019\",\"Mso98win32client.dll\",0.0101,0.9868,0.0101,0.9868\n\"3570BC\",\"3570BC\",\"Mso98win32client.dll\",0.0101,0.9823,0.0101,0.9823\n\"3088AC\",\"3088AC\",\"Mso98win32client.dll\",0.0097,0.9472,0.0097,0.9472\n\"74800\",\"74800\",\"Mso98win32client.dll\",0.0096,0.9331,0.0096,0.9331\n\"1000AD\",\"1000AD\",\"Mso98win32client.dll\",0.0072,0.7001,0.0072,0.7001\n\"D004D\",\"D004D\",\"Mso98win32client.dll\",0.0042,0.4088,0.0042,0.4088\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_NETIO.SYS_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"3D3E4\",\"3D3E4\",\"NETIO.SYS\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Ntfs.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1FE78E\",\"1FE78E\",\"Ntfs.sys\",0.0211,2.0539,0.0211,2.0539\n\"1B2672\",\"1B2672\",\"Ntfs.sys\",0.0205,2.0000,0.0205,2.0000\n\"138F09\",\"138F09\",\"Ntfs.sys\",0.0197,1.9175,0.0197,1.9175\n\"167EE4\",\"167EE4\",\"Ntfs.sys\",0.0166,1.6162,0.0166,1.6162\n\"16BBEE\",\"16BBEE\",\"Ntfs.sys\",0.0144,1.4078,0.0144,1.4078\n\"601D\",\"601D\",\"Ntfs.sys\",0.0141,1.3760,0.0141,1.3760\n\"14F79C\",\"14F79C\",\"Ntfs.sys\",0.0125,1.2137,0.0125,1.2137\n\"12BFB7\",\"12BFB7\",\"Ntfs.sys\",0.0114,1.1072,0.0114,1.1072\n\"1FC8FF\",\"1FC8FF\",\"Ntfs.sys\",0.0106,1.0337,0.0106,1.0337\n\"203C60\",\"203C60\",\"Ntfs.sys\",0.0104,1.0169,0.0104,1.0169\n\"1CE04D\",\"1CE04D\",\"Ntfs.sys\",0.0102,0.9953,0.0102,0.9953\n\"15070B\",\"15070B\",\"Ntfs.sys\",0.0102,0.9921,0.0102,0.9921\n\"12C088\",\"12C088\",\"Ntfs.sys\",0.0101,0.9873,0.0101,0.9873\n\"150326\",\"150326\",\"Ntfs.sys\",0.0091,0.8862,0.0091,0.8862\n\"156B5\",\"156B5\",\"Ntfs.sys\",0.0074,0.7173,0.0074,0.7173\n\"18CD0E\",\"18CD0E\",\"Ntfs.sys\",0.0069,0.6705,0.0069,0.6705\n\"1B26BF\",\"1B26BF\",\"Ntfs.sys\",0.0025,0.2411,0.0025,0.2411\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_OART.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"12CA4\",\"12CA4\",\"OART.DLL\",0.0103,1.0012,0.0103,1.0012\n\"33B21\",\"33B21\",\"OART.DLL\",0.0077,0.7543,0.0077,0.7543\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_OLMAPI32.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"CFBE0\",\"CFBE0\",\"OLMAPI32.DLL\",0.0205,2.0000,0.0205,2.0000\n\"295FF\",\"295FF\",\"OLMAPI32.DLL\",0.0127,1.2337,0.0127,1.2337\n\"1845D7\",\"1845D7\",\"OLMAPI32.DLL\",0.0114,1.1060,0.0114,1.1060\n\"B7C80\",\"B7C80\",\"OLMAPI32.DLL\",0.0103,1.0075,0.0103,1.0075\n\"42410\",\"42410\",\"OLMAPI32.DLL\",0.0103,1.0074,0.0103,1.0074\n\"108ACF\",\"108ACF\",\"OLMAPI32.DLL\",0.0103,1.0025,0.0103,1.0025\n\"AF254\",\"AF254\",\"OLMAPI32.DLL\",0.0102,0.9973,0.0102,0.9973\n\"966C7\",\"966C7\",\"OLMAPI32.DLL\",0.0102,0.9958,0.0102,0.9958\n\"78730\",\"78730\",\"OLMAPI32.DLL\",0.0102,0.9930,0.0102,0.9930\n\"8DCF5\",\"8DCF5\",\"OLMAPI32.DLL\",0.0096,0.9358,0.0096,0.9358\n\"F13C4\",\"F13C4\",\"OLMAPI32.DLL\",0.0095,0.9233,0.0095,0.9233\n\"1396E0\",\"1396E0\",\"OLMAPI32.DLL\",0.0042,0.4115,0.0042,0.4115\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_OneCoreUAPCommonProxyStub.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"46E2\",\"46E2\",\"OneCoreUAPCommonProxyStub.dll\",0.0207,2.0136,0.0207,2.0136\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_PPCORE.DLL_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"3DB834\",\"3DB834\",\"PPCORE.DLL\",0.0313,3.0493,0.0313,3.0493\n\"1EE5F2\",\"1EE5F2\",\"PPCORE.DLL\",0.0205,2.0000,0.0205,2.0000\n\"387625\",\"387625\",\"PPCORE.DLL\",0.0205,2.0000,0.0205,2.0000\n\"445F70\",\"445F70\",\"PPCORE.DLL\",0.0205,2.0000,0.0205,2.0000\n\"386D46\",\"386D46\",\"PPCORE.DLL\",0.0183,1.7832,0.0183,1.7832\n\"367C55\",\"367C55\",\"PPCORE.DLL\",0.0171,1.6656,0.0171,1.6656\n\"A9EB9\",\"A9EB9\",\"PPCORE.DLL\",0.0104,1.0131,0.0104,1.0131\n\"E7CA\",\"E7CA\",\"PPCORE.DLL\",0.0103,1.0027,0.0103,1.0027\n\"230558\",\"230558\",\"PPCORE.DLL\",0.0103,1.0004,0.0103,1.0004\n\"D3A20\",\"D3A20\",\"PPCORE.DLL\",0.0102,0.9970,0.0102,0.9970\n\"8BB28\",\"8BB28\",\"PPCORE.DLL\",0.0099,0.9663,0.0099,0.9663\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_PktMon.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"85C0\",\"85C0\",\"PktMon.sys\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_TextShaping.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"4200\",\"4200\",\"TextShaping.dll\",0.0374,3.6468,0.0374,3.6468\n\"1CB7E\",\"1CB7E\",\"TextShaping.dll\",0.0224,2.1797,0.0224,2.1797\n\"10760\",\"10760\",\"TextShaping.dll\",0.0119,1.1578,0.0119,1.1578\n\"41FE\",\"41FE\",\"TextShaping.dll\",0.0110,1.0676,0.0110,1.0676\n\"A788\",\"A788\",\"TextShaping.dll\",0.0103,1.0066,0.0103,1.0066\n\"18F1\",\"18F1\",\"TextShaping.dll\",0.0103,1.0029,0.0103,1.0029\n\"8E9B\",\"8E9B\",\"TextShaping.dll\",0.0103,1.0015,0.0103,1.0015\n\"1BCDF\",\"1BCDF\",\"TextShaping.dll\",0.0103,1.0010,0.0103,1.0010\n\"17E1A\",\"17E1A\",\"TextShaping.dll\",0.0103,1.0002,0.0103,1.0002\n\"3F5A\",\"3F5A\",\"TextShaping.dll\",0.0103,0.9988,0.0103,0.9988\n\"A811\",\"A811\",\"TextShaping.dll\",0.0102,0.9981,0.0102,0.9981\n\"55FB\",\"55FB\",\"TextShaping.dll\",0.0102,0.9974,0.0102,0.9974\n\"277D5\",\"277D5\",\"TextShaping.dll\",0.0101,0.9832,0.0101,0.9832\n\"41C0\",\"41C0\",\"TextShaping.dll\",0.0058,0.5691,0.0058,0.5691\n\"25F9\",\"25F9\",\"TextShaping.dll\",0.0023,0.2263,0.0023,0.2263\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_UIAutomationCore.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1DCD1\",\"1DCD1\",\"UIAutomationCore.dll\",0.0205,2.0000,0.0205,2.0000\n\"BEFFF\",\"BEFFF\",\"UIAutomationCore.dll\",0.0205,2.0000,0.0205,2.0000\n\"3ACB8\",\"3ACB8\",\"UIAutomationCore.dll\",0.0047,0.4606,0.0047,0.4606\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_WdFilter.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"617BB\",\"617BB\",\"WdFilter.sys\",0.0161,1.5718,0.0161,1.5718\n\"5C1BA\",\"5C1BA\",\"WdFilter.sys\",0.0135,1.3168,0.0135,1.3168\n\"47260\",\"47260\",\"WdFilter.sys\",0.0128,1.2434,0.0128,1.2434\n\"4DECF\",\"4DECF\",\"WdFilter.sys\",0.0127,1.2386,0.0127,1.2386\n\"2BE7C\",\"2BE7C\",\"WdFilter.sys\",0.0103,0.9998,0.0103,0.9998\n\"2B5D0\",\"2B5D0\",\"WdFilter.sys\",0.0102,0.9974,0.0102,0.9974\n\"2B6B6\",\"2B6B6\",\"WdFilter.sys\",0.0102,0.9974,0.0102,0.9974\n\"2BEA5\",\"2BEA5\",\"WdFilter.sys\",0.0102,0.9974,0.0102,0.9974\n\"2BE88\",\"2BE88\",\"WdFilter.sys\",0.0102,0.9945,0.0102,0.9945\n\"2BD9B\",\"2BD9B\",\"WdFilter.sys\",0.0102,0.9942,0.0102,0.9942\n\"4BA31\",\"4BA31\",\"WdFilter.sys\",0.0102,0.9932,0.0102,0.9932\n\"486FB\",\"486FB\",\"WdFilter.sys\",0.0029,0.2806,0.0029,0.2806\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_WinTypes.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"DED0\",\"DED0\",\"WinTypes.dll\",0.0207,2.0128,0.0207,2.0128\n\"26C79\",\"26C79\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"2934\",\"2934\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"2B48\",\"2B48\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"38951\",\"38951\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"39F45\",\"39F45\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"B0A5\",\"B0A5\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"D54C\",\"D54C\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"D55C\",\"D55C\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"D65C\",\"D65C\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"DF50\",\"DF50\",\"WinTypes.dll\",0.0205,2.0000,0.0205,2.0000\n\"E10D\",\"E10D\",\"WinTypes.dll\",0.0204,1.9919,0.0204,1.9919\n\"1DFD0\",\"1DFD0\",\"WinTypes.dll\",0.0155,1.5080,0.0155,1.5080\n\"1E110\",\"1E110\",\"WinTypes.dll\",0.0123,1.2026,0.0123,1.2026\n\"14F78\",\"14F78\",\"WinTypes.dll\",0.0103,0.9989,0.0103,0.9989\n\"1E124\",\"1E124\",\"WinTypes.dll\",0.0102,0.9953,0.0102,0.9953\n\"1E107\",\"1E107\",\"WinTypes.dll\",0.0102,0.9924,0.0102,0.9924\n\"2420\",\"2420\",\"WinTypes.dll\",0.0102,0.9916,0.0102,0.9916\n\"15D54\",\"15D54\",\"WinTypes.dll\",0.0089,0.8673,0.0089,0.8673\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Windows.Networking.Connectivity.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"58318\",\"58318\",\"Windows.Networking.Connectivity.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Windows.Security.Authentication.Web.Core.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"BCBE\",\"BCBE\",\"Windows.Security.Authentication.Web.Core.dll\",0.0312,3.0407,0.0312,3.0407\n\"4697E\",\"4697E\",\"Windows.Security.Authentication.Web.Core.dll\",0.0205,2.0000,0.0205,2.0000\n\"6AC5E\",\"6AC5E\",\"Windows.Security.Authentication.Web.Core.dll\",0.0205,2.0000,0.0205,2.0000\n\"E5010\",\"E5010\",\"Windows.Security.Authentication.Web.Core.dll\",0.0205,2.0000,0.0205,2.0000\n\"1B2DF\",\"1B2DF\",\"Windows.Security.Authentication.Web.Core.dll\",0.0169,1.6437,2.4374,237.4791\n\"15CB5\",\"15CB5\",\"Windows.Security.Authentication.Web.Core.dll\",0.0129,1.2522,0.0129,1.2522\n\"19EB0\",\"19EB0\",\"Windows.Security.Authentication.Web.Core.dll\",0.0116,1.1320,0.0116,1.1320\n\"41218\",\"41218\",\"Windows.Security.Authentication.Web.Core.dll\",0.0107,1.0453,0.0107,1.0453\n\"2B976\",\"2B976\",\"Windows.Security.Authentication.Web.Core.dll\",0.0102,0.9933,0.0102,0.9933\n\"A1A10\",\"A1A10\",\"Windows.Security.Authentication.Web.Core.dll\",0.0099,0.9685,0.0099,0.9685\n\"2BC75\",\"2BC75\",\"Windows.Security.Authentication.Web.Core.dll\",0.0017,0.1663,0.0017,0.1663\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Windows.StateRepositoryCore.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"86DB\",\"86DB\",\"Windows.StateRepositoryCore.dll\",0.0102,0.9952,0.0102,0.9952\n\"74BF\",\"74BF\",\"Windows.StateRepositoryCore.dll\",0.0102,0.9906,0.0102,0.9906\n\"CED0\",\"CED0\",\"Windows.StateRepositoryCore.dll\",0.0051,0.4997,0.0051,0.4997\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Windows.Web.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"5F98\",\"5F98\",\"Windows.Web.dll\",0.1672,16.2860,0.1672,16.2860\n\"5F87\",\"5F87\",\"Windows.Web.dll\",0.0889,8.6617,0.0889,8.6617\n\"5F6C\",\"5F6C\",\"Windows.Web.dll\",0.0736,7.1683,0.0736,7.1683\n\"5FAE\",\"5FAE\",\"Windows.Web.dll\",0.0614,5.9785,0.0614,5.9785\n\"6019\",\"6019\",\"Windows.Web.dll\",0.0479,4.6696,0.0479,4.6696\n\"6025\",\"6025\",\"Windows.Web.dll\",0.0428,4.1746,0.0428,4.1746\n\"6014\",\"6014\",\"Windows.Web.dll\",0.0310,3.0243,0.0310,3.0243\n\"5F93\",\"5F93\",\"Windows.Web.dll\",0.0291,2.8317,0.0291,2.8317\n\"10441\",\"10441\",\"Windows.Web.dll\",0.0280,2.7285,0.0280,2.7285\n\"5FB9\",\"5FB9\",\"Windows.Web.dll\",0.0274,2.6696,0.0274,2.6696\n\"107E0\",\"107E0\",\"Windows.Web.dll\",0.0206,2.0066,0.0206,2.0066\n\"122B0\",\"122B0\",\"Windows.Web.dll\",0.0205,2.0000,0.0205,2.0000\n\"5F69\",\"5F69\",\"Windows.Web.dll\",0.0205,2.0000,0.0205,2.0000\n\"6BCA\",\"6BCA\",\"Windows.Web.dll\",0.0205,2.0000,0.0205,2.0000\n\"E5FE\",\"E5FE\",\"Windows.Web.dll\",0.0205,2.0000,0.0205,2.0000\n\"E7AD\",\"E7AD\",\"Windows.Web.dll\",0.0205,2.0000,0.0205,2.0000\n\"535A\",\"535A\",\"Windows.Web.dll\",0.0203,1.9804,0.0203,1.9804\n\"4B43\",\"4B43\",\"Windows.Web.dll\",0.0202,1.9688,0.0202,1.9688\n\"5B010\",\"5B010\",\"Windows.Web.dll\",0.0173,1.6875,0.0173,1.6875\n\"6022\",\"6022\",\"Windows.Web.dll\",0.0172,1.6745,0.0172,1.6745\n\"5F77\",\"5F77\",\"Windows.Web.dll\",0.0165,1.6064,0.0165,1.6064\n\"109B8\",\"109B8\",\"Windows.Web.dll\",0.0164,1.5937,0.0164,1.5937\n\"6028\",\"6028\",\"Windows.Web.dll\",0.0156,1.5180,0.0156,1.5180\n\"5519\",\"5519\",\"Windows.Web.dll\",0.0156,1.5154,0.0156,1.5154\n\"141C0\",\"141C0\",\"Windows.Web.dll\",0.0147,1.4297,0.0147,1.4297\n\"179F0\",\"179F0\",\"Windows.Web.dll\",0.0144,1.4056,0.0144,1.4056\n\"52E1\",\"52E1\",\"Windows.Web.dll\",0.0137,1.3346,0.0137,1.3346\n\"122BD\",\"122BD\",\"Windows.Web.dll\",0.0133,1.2999,0.0133,1.2999\n\"5FA3\",\"5FA3\",\"Windows.Web.dll\",0.0123,1.2013,0.0123,1.2013\n\"E657\",\"E657\",\"Windows.Web.dll\",0.0110,1.0755,0.0110,1.0755\n\"1692A\",\"1692A\",\"Windows.Web.dll\",0.0107,1.0429,0.0107,1.0429\n\"24B6\",\"24B6\",\"Windows.Web.dll\",0.0104,1.0149,0.0104,1.0149\n\"62AD\",\"62AD\",\"Windows.Web.dll\",0.0103,1.0023,0.0103,1.0023\n\"91A9\",\"91A9\",\"Windows.Web.dll\",0.0102,0.9981,0.0102,0.9981\n\"E903\",\"E903\",\"Windows.Web.dll\",0.0102,0.9976,0.0102,0.9976\n\"4DF5\",\"4DF5\",\"Windows.Web.dll\",0.0102,0.9972,0.0102,0.9972\n\"901E\",\"901E\",\"Windows.Web.dll\",0.0102,0.9943,0.0102,0.9943\n\"5820\",\"5820\",\"Windows.Web.dll\",0.0102,0.9939,0.0102,0.9939\n\"8E4A\",\"8E4A\",\"Windows.Web.dll\",0.0102,0.9903,0.0102,0.9903\n\"10216\",\"10216\",\"Windows.Web.dll\",0.0089,0.8695,0.0089,0.8695\n\"16911\",\"16911\",\"Windows.Web.dll\",0.0086,0.8338,0.0086,0.8338\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_WindowsCodecs.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"E3129\",\"E3129\",\"WindowsCodecs.dll\",0.0205,2.0000,0.0205,2.0000\n\"30E76\",\"30E76\",\"WindowsCodecs.dll\",0.0114,1.1112,0.0114,1.1112\n\"1A8AC9\",\"1A8AC9\",\"WindowsCodecs.dll\",0.0113,1.0974,0.0113,1.0974\n\"30E15\",\"30E15\",\"WindowsCodecs.dll\",0.0111,1.0831,0.0111,1.0831\n\"30DE4\",\"30DE4\",\"WindowsCodecs.dll\",0.0111,1.0781,0.0111,1.0781\n\"1A8A71\",\"1A8A71\",\"WindowsCodecs.dll\",0.0109,1.0656,0.0109,1.0656\n\"41A62\",\"41A62\",\"WindowsCodecs.dll\",0.0109,1.0621,0.0109,1.0621\n\"9F3C3\",\"9F3C3\",\"WindowsCodecs.dll\",0.0109,1.0595,0.0109,1.0595\n\"3129B\",\"3129B\",\"WindowsCodecs.dll\",0.0107,1.0472,0.0107,1.0472\n\"311F0\",\"311F0\",\"WindowsCodecs.dll\",0.0105,1.0190,0.0105,1.0190\n\"A4402\",\"A4402\",\"WindowsCodecs.dll\",0.0103,1.0082,0.0103,1.0082\n\"1A8D09\",\"1A8D09\",\"WindowsCodecs.dll\",0.0102,0.9901,0.0102,0.9901\n\"41B83\",\"41B83\",\"WindowsCodecs.dll\",0.0092,0.8930,0.0092,0.8930\n\"30E79\",\"30E79\",\"WindowsCodecs.dll\",0.0068,0.6646,0.0068,0.6646\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_Wldap32.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"412F\",\"412F\",\"Wldap32.dll\",0.0205,2.0000,0.0205,2.0000\n\"C49B\",\"C49B\",\"Wldap32.dll\",0.0205,2.0000,0.0205,2.0000\n\"1838D\",\"1838D\",\"Wldap32.dll\",0.0072,0.7034,0.0072,0.7034\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_ahcache.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"3DC47\",\"3DC47\",\"ahcache.sys\",0.0103,1.0001,0.0103,1.0001\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_aitrx.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"4937F\",\"4937F\",\"aitrx.dll\",0.0205,2.0000,0.0205,2.0000\n\"B4413\",\"B4413\",\"aitrx.dll\",0.0205,2.0000,0.0205,2.0000\n\"B42CF\",\"B42CF\",\"aitrx.dll\",0.0175,1.7096,0.0175,1.7096\n\"B3B6C\",\"B3B6C\",\"aitrx.dll\",0.0109,1.0594,0.0109,1.0594\n\"B3EF6\",\"B3EF6\",\"aitrx.dll\",0.0103,1.0055,0.0103,1.0055\n\"21100\",\"21100\",\"aitrx.dll\",0.0103,1.0009,0.0103,1.0009\n\"B2D01\",\"B2D01\",\"aitrx.dll\",0.0102,0.9979,0.0102,0.9979\n\"B42CA\",\"B42CA\",\"aitrx.dll\",0.0102,0.9939,0.0102,0.9939\n\"B35B4\",\"B35B4\",\"aitrx.dll\",0.0102,0.9931,0.0102,0.9931\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_bcrypt.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"7520\",\"7520\",\"bcrypt.dll\",0.0205,2.0000,0.0205,2.0000\n\"7DA0\",\"7DA0\",\"bcrypt.dll\",0.0134,1.3075,0.0134,1.3075\n\"5530\",\"5530\",\"bcrypt.dll\",0.0103,0.9992,0.0103,0.9992\n\"80F8\",\"80F8\",\"bcrypt.dll\",0.0102,0.9978,0.0102,0.9978\n\"2586\",\"2586\",\"bcrypt.dll\",0.0062,0.6022,0.0062,0.6022\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_bcryptprimitives.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"13B8C\",\"13B8C\",\"bcryptprimitives.dll\",0.0306,2.9817,0.0306,2.9817\n\"2CA25\",\"2CA25\",\"bcryptprimitives.dll\",0.0208,2.0267,0.0208,2.0267\n\"4FF7D\",\"4FF7D\",\"bcryptprimitives.dll\",0.0207,2.0175,0.0207,2.0175\n\"50DAF\",\"50DAF\",\"bcryptprimitives.dll\",0.0207,2.0162,0.0207,2.0162\n\"13B00\",\"13B00\",\"bcryptprimitives.dll\",0.0205,2.0000,0.0205,2.0000\n\"2E4E\",\"2E4E\",\"bcryptprimitives.dll\",0.0205,2.0000,0.0205,2.0000\n\"4FBC0\",\"4FBC0\",\"bcryptprimitives.dll\",0.0205,2.0000,0.0205,2.0000\n\"51078\",\"51078\",\"bcryptprimitives.dll\",0.0189,1.8412,0.0189,1.8412\n\"51042\",\"51042\",\"bcryptprimitives.dll\",0.0174,1.6982,0.0174,1.6982\n\"13B85\",\"13B85\",\"bcryptprimitives.dll\",0.0150,1.4567,0.0150,1.4567\n\"5108B\",\"5108B\",\"bcryptprimitives.dll\",0.0121,1.1808,0.0121,1.1808\n\"51143\",\"51143\",\"bcryptprimitives.dll\",0.0108,1.0537,0.0108,1.0537\n\"506F9\",\"506F9\",\"bcryptprimitives.dll\",0.0103,1.0002,0.0103,1.0002\n\"2C730\",\"2C730\",\"bcryptprimitives.dll\",0.0103,0.9994,0.0103,0.9994\n\"11B17\",\"11B17\",\"bcryptprimitives.dll\",0.0103,0.9992,0.0103,0.9992\n\"2D74\",\"2D74\",\"bcryptprimitives.dll\",0.0103,0.9990,0.0103,0.9990\n\"5802B\",\"5802B\",\"bcryptprimitives.dll\",0.0102,0.9983,0.0102,0.9983\n\"13B0D\",\"13B0D\",\"bcryptprimitives.dll\",0.0102,0.9968,0.0102,0.9968\n\"11B09\",\"11B09\",\"bcryptprimitives.dll\",0.0102,0.9967,0.0102,0.9967\n\"502FA\",\"502FA\",\"bcryptprimitives.dll\",0.0102,0.9934,0.0102,0.9934\n\"5867B\",\"5867B\",\"bcryptprimitives.dll\",0.0102,0.9898,0.0102,0.9898\n\"51064\",\"51064\",\"bcryptprimitives.dll\",0.0101,0.9873,0.0101,0.9873\n\"50BB9\",\"50BB9\",\"bcryptprimitives.dll\",0.0101,0.9863,0.0101,0.9863\n\"50FD1\",\"50FD1\",\"bcryptprimitives.dll\",0.0101,0.9801,0.0101,0.9801\n\"50E73\",\"50E73\",\"bcryptprimitives.dll\",0.0100,0.9724,0.0100,0.9724\n\"13A50\",\"13A50\",\"bcryptprimitives.dll\",0.0099,0.9657,0.0099,0.9657\n\"506AC\",\"506AC\",\"bcryptprimitives.dll\",0.0018,0.1794,0.0018,0.1794\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_bindflt.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"610E\",\"610E\",\"bindflt.sys\",0.0205,2.0000,0.0205,2.0000\n\"6141\",\"6141\",\"bindflt.sys\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_cng.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"DDF4\",\"DDF4\",\"cng.sys\",0.0512,4.9909,0.0512,4.9909\n\"DDC1\",\"DDC1\",\"cng.sys\",0.0411,4.0000,0.0411,4.0000\n\"DE88\",\"DE88\",\"cng.sys\",0.0410,3.9955,0.0410,3.9955\n\"E595\",\"E595\",\"cng.sys\",0.0308,3.0035,0.0308,3.0035\n\"DBE5\",\"DBE5\",\"cng.sys\",0.0308,3.0020,0.0308,3.0020\n\"E3B4\",\"E3B4\",\"cng.sys\",0.0308,2.9989,0.0308,2.9989\n\"E341\",\"E341\",\"cng.sys\",0.0307,2.9939,0.0307,2.9939\n\"D853\",\"D853\",\"cng.sys\",0.0307,2.9873,0.0307,2.9873\n\"DC5B\",\"DC5B\",\"cng.sys\",0.0304,2.9635,0.0304,2.9635\n\"D997\",\"D997\",\"cng.sys\",0.0304,2.9596,0.0304,2.9596\n\"F08B\",\"F08B\",\"cng.sys\",0.0238,2.3165,0.0238,2.3165\n\"F4C0\",\"F4C0\",\"cng.sys\",0.0209,2.0408,0.0209,2.0408\n\"D6EE\",\"D6EE\",\"cng.sys\",0.0206,2.0033,0.0206,2.0033\n\"D62A\",\"D62A\",\"cng.sys\",0.0206,2.0026,0.0206,2.0026\n\"DC47\",\"DC47\",\"cng.sys\",0.0205,2.0003,0.0205,2.0003\n\"D789\",\"D789\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"D7AC\",\"D7AC\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"D7C0\",\"D7C0\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"D90B\",\"D90B\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"DADC\",\"DADC\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"DEA3\",\"DEA3\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"E2BF\",\"E2BF\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"E2D3\",\"E2D3\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"E4E9\",\"E4E9\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"E548\",\"E548\",\"cng.sys\",0.0205,2.0000,0.0205,2.0000\n\"E240\",\"E240\",\"cng.sys\",0.0205,1.9968,0.0205,1.9968\n\"E995\",\"E995\",\"cng.sys\",0.0205,1.9954,0.0205,1.9954\n\"EA4C\",\"EA4C\",\"cng.sys\",0.0205,1.9953,0.0205,1.9953\n\"E219\",\"E219\",\"cng.sys\",0.0204,1.9923,0.0204,1.9923\n\"E22B\",\"E22B\",\"cng.sys\",0.0204,1.9906,0.0204,1.9906\n\"E8A4\",\"E8A4\",\"cng.sys\",0.0204,1.9877,0.0204,1.9877\n\"EDD5\",\"EDD5\",\"cng.sys\",0.0204,1.9862,0.0204,1.9862\n\"DA66\",\"DA66\",\"cng.sys\",0.0203,1.9820,0.0203,1.9820\n\"D903\",\"D903\",\"cng.sys\",0.0201,1.9605,0.0201,1.9605\n\"E295\",\"E295\",\"cng.sys\",0.0110,1.0748,0.0110,1.0748\n\"E133\",\"E133\",\"cng.sys\",0.0110,1.0717,0.0110,1.0717\n\"E81B\",\"E81B\",\"cng.sys\",0.0104,1.0132,0.0104,1.0132\n\"ED0A\",\"ED0A\",\"cng.sys\",0.0104,1.0128,0.0104,1.0128\n\"EEB6\",\"EEB6\",\"cng.sys\",0.0104,1.0125,0.0104,1.0125\n\"F303\",\"F303\",\"cng.sys\",0.0104,1.0112,0.0104,1.0112\n\"F3E2\",\"F3E2\",\"cng.sys\",0.0104,1.0110,0.0104,1.0110\n\"E6DF\",\"E6DF\",\"cng.sys\",0.0104,1.0108,0.0104,1.0108\n\"F4F9\",\"F4F9\",\"cng.sys\",0.0104,1.0105,0.0104,1.0105\n\"EC5F\",\"EC5F\",\"cng.sys\",0.0103,1.0084,0.0103,1.0084\n\"EA36\",\"EA36\",\"cng.sys\",0.0103,1.0083,0.0103,1.0083\n\"DB0A\",\"DB0A\",\"cng.sys\",0.0103,1.0082,0.0103,1.0082\n\"E070\",\"E070\",\"cng.sys\",0.0103,1.0082,0.0103,1.0082\n\"EFC9\",\"EFC9\",\"cng.sys\",0.0103,1.0081,0.0103,1.0081\n\"EC3C\",\"EC3C\",\"cng.sys\",0.0103,1.0077,0.0103,1.0077\n\"EF0E\",\"EF0E\",\"cng.sys\",0.0103,1.0069,0.0103,1.0069\n\"E4CD\",\"E4CD\",\"cng.sys\",0.0103,1.0061,0.0103,1.0061\n\"EEF3\",\"EEF3\",\"cng.sys\",0.0103,1.0059,0.0103,1.0059\n\"D5B1\",\"D5B1\",\"cng.sys\",0.0103,1.0056,0.0103,1.0056\n\"F15F\",\"F15F\",\"cng.sys\",0.0103,1.0043,0.0103,1.0043\n\"F4A5\",\"F4A5\",\"cng.sys\",0.0103,1.0041,0.0103,1.0041\n\"E98D\",\"E98D\",\"cng.sys\",0.0103,1.0030,0.0103,1.0030\n\"DB84\",\"DB84\",\"cng.sys\",0.0103,1.0027,0.0103,1.0027\n\"F80F\",\"F80F\",\"cng.sys\",0.0103,1.0024,0.0103,1.0024\n\"DB52\",\"DB52\",\"cng.sys\",0.0103,1.0023,0.0103,1.0023\n\"F381\",\"F381\",\"cng.sys\",0.0103,1.0023,0.0103,1.0023\n\"F3E9\",\"F3E9\",\"cng.sys\",0.0103,1.0021,0.0103,1.0021\n\"D990\",\"D990\",\"cng.sys\",0.0103,1.0017,0.0103,1.0017\n\"F4E4\",\"F4E4\",\"cng.sys\",0.0103,1.0014,0.0103,1.0014\n\"D64D\",\"D64D\",\"cng.sys\",0.0103,1.0011,0.0103,1.0011\n\"F5CB\",\"F5CB\",\"cng.sys\",0.0103,1.0010,0.0103,1.0010\n\"EFDC\",\"EFDC\",\"cng.sys\",0.0103,1.0006,0.0103,1.0006\n\"D9B2\",\"D9B2\",\"cng.sys\",0.0103,1.0005,0.0103,1.0005\n\"F17C\",\"F17C\",\"cng.sys\",0.0103,1.0005,0.0103,1.0005\n\"DF6F\",\"DF6F\",\"cng.sys\",0.0103,1.0002,0.0103,1.0002\n\"F650\",\"F650\",\"cng.sys\",0.0103,1.0002,0.0103,1.0002\n\"E5DB\",\"E5DB\",\"cng.sys\",0.0103,1.0000,0.0103,1.0000\n\"DFBA\",\"DFBA\",\"cng.sys\",0.0103,0.9999,0.0103,0.9999\n\"D560\",\"D560\",\"cng.sys\",0.0103,0.9998,0.0103,0.9998\n\"DD60\",\"DD60\",\"cng.sys\",0.0103,0.9998,0.0103,0.9998\n\"E1FF\",\"E1FF\",\"cng.sys\",0.0103,0.9998,0.0103,0.9998\n\"DA33\",\"DA33\",\"cng.sys\",0.0103,0.9997,0.0103,0.9997\n\"F51C\",\"F51C\",\"cng.sys\",0.0103,0.9994,0.0103,0.9994\n\"E184\",\"E184\",\"cng.sys\",0.0103,0.9991,0.0103,0.9991\n\"E77F\",\"E77F\",\"cng.sys\",0.0103,0.9991,0.0103,0.9991\n\"D85B\",\"D85B\",\"cng.sys\",0.0103,0.9989,0.0103,0.9989\n\"E2EF\",\"E2EF\",\"cng.sys\",0.0103,0.9987,0.0103,0.9987\n\"E099\",\"E099\",\"cng.sys\",0.0102,0.9984,0.0102,0.9984\n\"F7DE\",\"F7DE\",\"cng.sys\",0.0102,0.9982,0.0102,0.9982\n\"DA28\",\"DA28\",\"cng.sys\",0.0102,0.9981,0.0102,0.9981\n\"E432\",\"E432\",\"cng.sys\",0.0102,0.9974,0.0102,0.9974\n\"E57A\",\"E57A\",\"cng.sys\",0.0102,0.9969,0.0102,0.9969\n\"EE8D\",\"EE8D\",\"cng.sys\",0.0102,0.9968,0.0102,0.9968\n\"E44E\",\"E44E\",\"cng.sys\",0.0102,0.9964,0.0102,0.9964\n\"E4A8\",\"E4A8\",\"cng.sys\",0.0102,0.9963,0.0102,0.9963\n\"EDA0\",\"EDA0\",\"cng.sys\",0.0102,0.9963,0.0102,0.9963\n\"F6FF\",\"F6FF\",\"cng.sys\",0.0102,0.9962,0.0102,0.9962\n\"F061\",\"F061\",\"cng.sys\",0.0102,0.9961,0.0102,0.9961\n\"F3EF\",\"F3EF\",\"cng.sys\",0.0102,0.9961,0.0102,0.9961\n\"564DC\",\"564DC\",\"cng.sys\",0.0102,0.9956,0.0102,0.9956\n\"E1D1\",\"E1D1\",\"cng.sys\",0.0102,0.9953,0.0102,0.9953\n\"E573\",\"E573\",\"cng.sys\",0.0102,0.9953,0.0102,0.9953\n\"E14C\",\"E14C\",\"cng.sys\",0.0102,0.9952,0.0102,0.9952\n\"E814\",\"E814\",\"cng.sys\",0.0102,0.9952,0.0102,0.9952\n\"E59D\",\"E59D\",\"cng.sys\",0.0102,0.9948,0.0102,0.9948\n\"D79C\",\"D79C\",\"cng.sys\",0.0102,0.9947,0.0102,0.9947\n\"D8DA\",\"D8DA\",\"cng.sys\",0.0102,0.9946,0.0102,0.9946\n\"DF0D\",\"DF0D\",\"cng.sys\",0.0102,0.9938,0.0102,0.9938\n\"E729\",\"E729\",\"cng.sys\",0.0102,0.9938,0.0102,0.9938\n\"EDCD\",\"EDCD\",\"cng.sys\",0.0102,0.9938,0.0102,0.9938\n\"F357\",\"F357\",\"cng.sys\",0.0102,0.9933,0.0102,0.9933\n\"E66B\",\"E66B\",\"cng.sys\",0.0102,0.9930,0.0102,0.9930\n\"D9AA\",\"D9AA\",\"cng.sys\",0.0102,0.9929,0.0102,0.9929\n\"E7A3\",\"E7A3\",\"cng.sys\",0.0102,0.9923,0.0102,0.9923\n\"E65D\",\"E65D\",\"cng.sys\",0.0102,0.9922,0.0102,0.9922\n\"D7A4\",\"D7A4\",\"cng.sys\",0.0102,0.9916,0.0102,0.9916\n\"EA22\",\"EA22\",\"cng.sys\",0.0102,0.9914,0.0102,0.9914\n\"F101\",\"F101\",\"cng.sys\",0.0102,0.9913,0.0102,0.9913\n\"E07F\",\"E07F\",\"cng.sys\",0.0102,0.9900,0.0102,0.9900\n\"F56F\",\"F56F\",\"cng.sys\",0.0102,0.9899,0.0102,0.9899\n\"E4D9\",\"E4D9\",\"cng.sys\",0.0101,0.9880,0.0101,0.9880\n\"E463\",\"E463\",\"cng.sys\",0.0101,0.9870,0.0101,0.9870\n\"E1F2\",\"E1F2\",\"cng.sys\",0.0101,0.9861,0.0101,0.9861\n\"572FA\",\"572FA\",\"cng.sys\",0.0101,0.9822,0.0101,0.9822\n\"D60B\",\"D60B\",\"cng.sys\",0.0100,0.9790,0.0100,0.9790\n\"DC1E\",\"DC1E\",\"cng.sys\",0.0100,0.9781,0.0100,0.9781\n\"E4E1\",\"E4E1\",\"cng.sys\",0.0100,0.9758,0.0100,0.9758\n\"E1E3\",\"E1E3\",\"cng.sys\",0.0100,0.9756,0.0100,0.9756\n\"DB41\",\"DB41\",\"cng.sys\",0.0100,0.9738,0.0100,0.9738\n\"D38D\",\"D38D\",\"cng.sys\",0.0100,0.9721,0.0100,0.9721\n\"F42C\",\"F42C\",\"cng.sys\",0.0099,0.9655,0.0099,0.9655\n\"DFE4\",\"DFE4\",\"cng.sys\",0.0099,0.9632,0.0099,0.9632\n\"D645\",\"D645\",\"cng.sys\",0.0099,0.9603,0.0099,0.9603\n\"D61F\",\"D61F\",\"cng.sys\",0.0098,0.9580,0.0098,0.9580\n\"D710\",\"D710\",\"cng.sys\",0.0098,0.9571,0.0098,0.9571\n\"D373\",\"D373\",\"cng.sys\",0.0097,0.9497,0.0097,0.9497\n\"F285\",\"F285\",\"cng.sys\",0.0097,0.9421,0.0097,0.9421\n\"F617\",\"F617\",\"cng.sys\",0.0095,0.9250,0.0095,0.9250\n\"E417\",\"E417\",\"cng.sys\",0.0089,0.8646,0.0089,0.8646\n\"E2CB\",\"E2CB\",\"cng.sys\",0.0088,0.8557,0.0088,0.8557\n\"D3D4\",\"D3D4\",\"cng.sys\",0.0084,0.8197,0.0084,0.8197\n\"EFE4\",\"EFE4\",\"cng.sys\",0.0076,0.7444,0.0076,0.7444\n\"DBD1\",\"DBD1\",\"cng.sys\",0.0062,0.6080,0.0062,0.6080\n\"D9E3\",\"D9E3\",\"cng.sys\",0.0059,0.5794,0.0059,0.5794\n\"E382\",\"E382\",\"cng.sys\",0.0050,0.4866,0.0050,0.4866\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_combase.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"5A600\",\"5A600\",\"combase.dll\",0.0411,4.0000,0.0411,4.0000\n\"80E2B\",\"80E2B\",\"combase.dll\",0.0411,4.0000,0.0411,4.0000\n\"F3AAC\",\"F3AAC\",\"combase.dll\",0.0411,4.0000,0.0616,6.0000\n\"FB720\",\"FB720\",\"combase.dll\",0.0411,4.0000,0.0411,4.0000\n\"74F9\",\"74F9\",\"combase.dll\",0.0348,3.3945,0.0348,3.3945\n\"8583B\",\"8583B\",\"combase.dll\",0.0325,3.1649,0.0325,3.1649\n\"1A5C17\",\"1A5C17\",\"combase.dll\",0.0309,3.0112,0.0309,3.0112\n\"1D63E7\",\"1D63E7\",\"combase.dll\",0.0308,3.0046,0.0308,3.0046\n\"C57B9\",\"C57B9\",\"combase.dll\",0.0307,2.9882,0.0307,2.9882\n\"F3A07\",\"F3A07\",\"combase.dll\",0.0302,2.9453,0.0302,2.9453\n\"835F5\",\"835F5\",\"combase.dll\",0.0292,2.8459,0.0292,2.8459\n\"F8F8C\",\"F8F8C\",\"combase.dll\",0.0209,2.0396,0.0209,2.0396\n\"168FB\",\"168FB\",\"combase.dll\",0.0208,2.0276,0.0208,2.0276\n\"698C0\",\"698C0\",\"combase.dll\",0.0206,2.0093,0.0206,2.0093\n\"1041D0\",\"1041D0\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"1091D0\",\"1091D0\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"12D860\",\"12D860\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"12E80A\",\"12E80A\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"18573C\",\"18573C\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"1905C0\",\"1905C0\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"456B\",\"456B\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"4BE6F\",\"4BE6F\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"5CE70\",\"5CE70\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"7A9CC\",\"7A9CC\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"7FBCE\",\"7FBCE\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"80E40\",\"80E40\",\"combase.dll\",0.0205,2.0000,0.0308,3.0045\n\"80FD\",\"80FD\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"83601\",\"83601\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"8367D\",\"8367D\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"8393\",\"8393\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"84113\",\"84113\",\"combase.dll\",0.0205,2.0000,1.5936,155.2622\n\"8C60C\",\"8C60C\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"8C926\",\"8C926\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"A69BC\",\"A69BC\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"B383F\",\"B383F\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"D9080\",\"D9080\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"EB9F8\",\"EB9F8\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"FA9DA\",\"FA9DA\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"FFB60\",\"FFB60\",\"combase.dll\",0.0205,2.0000,0.0205,2.0000\n\"ACE4\",\"ACE4\",\"combase.dll\",0.0205,1.9986,0.0205,1.9986\n\"91A5\",\"91A5\",\"combase.dll\",0.0205,1.9936,0.0205,1.9936\n\"5E0F1\",\"5E0F1\",\"combase.dll\",0.0205,1.9934,0.0205,1.9934\n\"5A62D\",\"5A62D\",\"combase.dll\",0.0197,1.9206,0.0197,1.9206\n\"EB9EC\",\"EB9EC\",\"combase.dll\",0.0190,1.8551,0.0190,1.8551\n\"857FA\",\"857FA\",\"combase.dll\",0.0188,1.8291,0.0188,1.8291\n\"F4090\",\"F4090\",\"combase.dll\",0.0182,1.7703,0.0182,1.7703\n\"8553\",\"8553\",\"combase.dll\",0.0176,1.7129,0.0176,1.7129\n\"8981\",\"8981\",\"combase.dll\",0.0168,1.6323,0.0168,1.6323\n\"10A9D0\",\"10A9D0\",\"combase.dll\",0.0162,1.5787,0.0162,1.5787\n\"D2128\",\"D2128\",\"combase.dll\",0.0161,1.5727,0.0161,1.5727\n\"100750\",\"100750\",\"combase.dll\",0.0154,1.5014,0.0154,1.5014\n\"EB9C0\",\"EB9C0\",\"combase.dll\",0.0151,1.4697,0.0151,1.4697\n\"1BF22\",\"1BF22\",\"combase.dll\",0.0146,1.4251,0.0399,3.8885\n\"F9184\",\"F9184\",\"combase.dll\",0.0145,1.4095,0.0145,1.4095\n\"85804\",\"85804\",\"combase.dll\",0.0145,1.4090,0.0145,1.4090\n\"D2124\",\"D2124\",\"combase.dll\",0.0144,1.4019,0.0144,1.4019\n\"1DF7F0\",\"1DF7F0\",\"combase.dll\",0.0143,1.3961,0.0143,1.3961\n\"19111\",\"19111\",\"combase.dll\",0.0143,1.3891,0.0143,1.3891\n\"85DF9\",\"85DF9\",\"combase.dll\",0.0138,1.3405,0.0138,1.3405\n\"16306\",\"16306\",\"combase.dll\",0.0138,1.3397,0.0138,1.3397\n\"12D86A\",\"12D86A\",\"combase.dll\",0.0133,1.2915,0.0133,1.2915\n\"80E25\",\"80E25\",\"combase.dll\",0.0124,1.2076,0.0124,1.2076\n\"19070\",\"19070\",\"combase.dll\",0.0117,1.1359,0.0117,1.1359\n\"F3A81\",\"F3A81\",\"combase.dll\",0.0110,1.0687,0.0110,1.0687\n\"C576C\",\"C576C\",\"combase.dll\",0.0109,1.0588,0.0109,1.0588\n\"7A9C0\",\"7A9C0\",\"combase.dll\",0.0105,1.0201,0.0105,1.0201\n\"5C81F\",\"5C81F\",\"combase.dll\",0.0104,1.0111,0.0104,1.0111\n\"1164A2\",\"1164A2\",\"combase.dll\",0.0103,1.0078,0.0103,1.0078\n\"4CC20\",\"4CC20\",\"combase.dll\",0.0103,1.0072,0.0103,1.0072\n\"6B728\",\"6B728\",\"combase.dll\",0.0103,1.0072,0.0103,1.0072\n\"26124\",\"26124\",\"combase.dll\",0.0103,1.0070,0.0103,1.0070\n\"18FBF9\",\"18FBF9\",\"combase.dll\",0.0103,1.0045,0.0103,1.0045\n\"1D5F5C\",\"1D5F5C\",\"combase.dll\",0.0103,1.0045,0.0103,1.0045\n\"87E0D\",\"87E0D\",\"combase.dll\",0.0103,1.0030,0.0103,1.0030\n\"896E\",\"896E\",\"combase.dll\",0.0103,1.0023,0.0103,1.0023\n\"374C0\",\"374C0\",\"combase.dll\",0.0103,1.0018,0.0103,1.0018\n\"260BD\",\"260BD\",\"combase.dll\",0.0103,1.0008,0.0103,1.0008\n\"11CC72\",\"11CC72\",\"combase.dll\",0.0103,1.0005,0.0103,1.0005\n\"5A7AE\",\"5A7AE\",\"combase.dll\",0.0103,0.9991,0.0103,0.9991\n\"9165\",\"9165\",\"combase.dll\",0.0103,0.9989,0.0103,0.9989\n\"12D090\",\"12D090\",\"combase.dll\",0.0102,0.9979,0.0102,0.9979\n\"8C91A\",\"8C91A\",\"combase.dll\",0.0102,0.9974,0.0102,0.9974\n\"665C4\",\"665C4\",\"combase.dll\",0.0102,0.9952,0.0204,1.9874\n\"17EC17\",\"17EC17\",\"combase.dll\",0.0102,0.9947,0.0102,0.9947\n\"1348D9\",\"1348D9\",\"combase.dll\",0.0102,0.9930,0.2573,25.0658\n\"162BF\",\"162BF\",\"combase.dll\",0.0102,0.9927,0.0102,0.9927\n\"10631D\",\"10631D\",\"combase.dll\",0.0102,0.9921,0.0102,0.9921\n\"130BB\",\"130BB\",\"combase.dll\",0.0102,0.9917,0.0102,0.9917\n\"126350\",\"126350\",\"combase.dll\",0.0102,0.9915,0.0102,0.9915\n\"86942\",\"86942\",\"combase.dll\",0.0102,0.9915,0.0102,0.9915\n\"184558\",\"184558\",\"combase.dll\",0.0102,0.9902,0.0102,0.9902\n\"109375\",\"109375\",\"combase.dll\",0.0101,0.9859,0.0101,0.9859\n\"85787\",\"85787\",\"combase.dll\",0.0101,0.9858,0.0101,0.9858\n\"1210C4\",\"1210C4\",\"combase.dll\",0.0101,0.9848,0.0101,0.9848\n\"8D9C0\",\"8D9C0\",\"combase.dll\",0.0100,0.9777,0.0100,0.9777\n\"86D4\",\"86D4\",\"combase.dll\",0.0099,0.9655,0.0358,3.4905\n\"18FBF7\",\"18FBF7\",\"combase.dll\",0.0097,0.9449,0.0097,0.9449\n\"EB9CF\",\"EB9CF\",\"combase.dll\",0.0095,0.9210,0.0095,0.9210\n\"10AA0A\",\"10AA0A\",\"combase.dll\",0.0091,0.8847,0.0091,0.8847\n\"D2118\",\"D2118\",\"combase.dll\",0.0061,0.5956,0.0061,0.5956\n\"26D30\",\"26D30\",\"combase.dll\",0.0049,0.4773,0.0049,0.4773\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_comctl32.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"9E6F5\",\"9E6F5\",\"comctl32.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_cpprestsdk.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"47F22\",\"47F22\",\"cpprestsdk.dll\",0.0102,0.9904,0.0102,0.9904\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_crypt32.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"5923C\",\"5923C\",\"crypt32.dll\",0.0218,2.1201,0.0218,2.1201\n\"5913B\",\"5913B\",\"crypt32.dll\",0.0205,2.0000,0.0205,2.0000\n\"591F9\",\"591F9\",\"crypt32.dll\",0.0205,2.0000,0.0205,2.0000\n\"11F128\",\"11F128\",\"crypt32.dll\",0.0190,1.8500,0.0190,1.8500\n\"12972\",\"12972\",\"crypt32.dll\",0.0177,1.7229,0.0177,1.7229\n\"76A93\",\"76A93\",\"crypt32.dll\",0.0170,1.6530,0.0170,1.6530\n\"5B258\",\"5B258\",\"crypt32.dll\",0.0145,1.4150,0.0145,1.4150\n\"72C61\",\"72C61\",\"crypt32.dll\",0.0131,1.2757,0.0131,1.2757\n\"31617\",\"31617\",\"crypt32.dll\",0.0126,1.2237,0.0126,1.2237\n\"13193\",\"13193\",\"crypt32.dll\",0.0122,1.1929,0.0122,1.1929\n\"8EFD0\",\"8EFD0\",\"crypt32.dll\",0.0103,1.0070,0.0103,1.0070\n\"6AFD2\",\"6AFD2\",\"crypt32.dll\",0.0103,1.0037,0.3026,29.4840\n\"2D48F\",\"2D48F\",\"crypt32.dll\",0.0103,1.0026,0.0103,1.0026\n\"6A127\",\"6A127\",\"crypt32.dll\",0.0103,1.0015,0.0103,1.0015\n\"12F45\",\"12F45\",\"crypt32.dll\",0.0103,1.0001,0.0103,1.0001\n\"12FFA\",\"12FFA\",\"crypt32.dll\",0.0103,0.9997,0.0103,0.9997\n\"4D724\",\"4D724\",\"crypt32.dll\",0.0102,0.9959,0.0102,0.9959\n\"A912\",\"A912\",\"crypt32.dll\",0.0102,0.9952,0.0102,0.9952\n\"2D52\",\"2D52\",\"crypt32.dll\",0.0102,0.9924,0.0102,0.9924\n\"D4F4\",\"D4F4\",\"crypt32.dll\",0.0102,0.9924,0.0102,0.9924\n\"5BF00\",\"5BF00\",\"crypt32.dll\",0.0102,0.9902,0.0102,0.9902\n\"D5EE\",\"D5EE\",\"crypt32.dll\",0.0101,0.9863,0.0101,0.9863\n\"65AE9\",\"65AE9\",\"crypt32.dll\",0.0101,0.9824,0.0101,0.9824\n\"12F4A\",\"12F4A\",\"crypt32.dll\",0.0100,0.9705,0.0100,0.9705\n\"12F4F\",\"12F4F\",\"crypt32.dll\",0.0099,0.9616,0.0099,0.9616\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_d2d1.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"145E24\",\"145E24\",\"d2d1.dll\",0.0214,2.0885,0.0214,2.0885\n\"4B8E0\",\"4B8E0\",\"d2d1.dll\",0.0205,2.0000,0.0205,2.0000\n\"14758B\",\"14758B\",\"d2d1.dll\",0.0105,1.0185,0.0105,1.0185\n\"76409\",\"76409\",\"d2d1.dll\",0.0103,1.0072,0.0103,1.0072\n\"15CD47\",\"15CD47\",\"d2d1.dll\",0.0102,0.9951,0.0102,0.9951\n\"76863\",\"76863\",\"d2d1.dll\",0.0102,0.9920,0.0102,0.9920\n\"53D0D\",\"53D0D\",\"d2d1.dll\",0.0102,0.9894,0.0102,0.9894\n\"14750D\",\"14750D\",\"d2d1.dll\",0.0101,0.9827,0.0101,0.9827\n\"405C8\",\"405C8\",\"d2d1.dll\",0.0087,0.8491,0.0087,0.8491\n\"E4182\",\"E4182\",\"d2d1.dll\",0.0046,0.4449,0.0046,0.4449\n\"2E184E\",\"2E184E\",\"d2d1.dll\",0.0023,0.2253,0.0023,0.2253\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_d3d11.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"666AB\",\"666AB\",\"d3d11.dll\",0.0308,3.0033,0.0308,3.0033\n\"5CC70\",\"5CC70\",\"d3d11.dll\",0.0208,2.0290,0.0208,2.0290\n\"1730F1\",\"1730F1\",\"d3d11.dll\",0.0205,2.0000,0.0205,2.0000\n\"457CF\",\"457CF\",\"d3d11.dll\",0.0205,2.0000,0.0205,2.0000\n\"1886D3\",\"1886D3\",\"d3d11.dll\",0.0108,1.0552,0.0108,1.0552\n\"337BF\",\"337BF\",\"d3d11.dll\",0.0103,1.0066,0.0103,1.0066\n\"15AB77\",\"15AB77\",\"d3d11.dll\",0.0101,0.9800,0.0101,0.9800\n\"15CA69\",\"15CA69\",\"d3d11.dll\",0.0084,0.8137,0.0084,0.8137\n\"182B88\",\"182B88\",\"d3d11.dll\",0.0029,0.2782,0.0029,0.2782\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_dcomp.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"515E5\",\"515E5\",\"dcomp.dll\",0.0300,2.9264,0.0300,2.9264\n\"2BA25\",\"2BA25\",\"dcomp.dll\",0.0205,2.0000,0.0205,2.0000\n\"4940C\",\"4940C\",\"dcomp.dll\",0.0205,2.0000,0.0205,2.0000\n\"75687\",\"75687\",\"dcomp.dll\",0.0205,2.0000,0.0205,2.0000\n\"A5610\",\"A5610\",\"dcomp.dll\",0.0205,2.0000,0.0205,2.0000\n\"267E0\",\"267E0\",\"dcomp.dll\",0.0168,1.6371,0.0168,1.6371\n\"E7FA0\",\"E7FA0\",\"dcomp.dll\",0.0115,1.1183,0.0115,1.1183\n\"54E65\",\"54E65\",\"dcomp.dll\",0.0115,1.1167,0.0115,1.1167\n\"562C7\",\"562C7\",\"dcomp.dll\",0.0102,0.9972,0.0102,0.9972\n\"1F2CF\",\"1F2CF\",\"dcomp.dll\",0.0102,0.9969,0.0102,0.9969\n\"F1BF8\",\"F1BF8\",\"dcomp.dll\",0.0092,0.8968,0.0092,0.8968\n\"490F3\",\"490F3\",\"dcomp.dll\",0.0085,0.8248,0.0085,0.8248\n\"598CD\",\"598CD\",\"dcomp.dll\",0.0083,0.8076,0.0083,0.8076\n\"2C255\",\"2C255\",\"dcomp.dll\",0.0045,0.4344,0.0045,0.4344\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_dhcpcsvc.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"2C50\",\"2C50\",\"dhcpcsvc.dll\",0.0102,0.9917,0.0102,0.9917\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_dhcpcsvc6.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"A010\",\"A010\",\"dhcpcsvc6.dll\",0.0114,1.1154,0.0114,1.1154\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_dpapi.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"13D5\",\"13D5\",\"dpapi.dll\",0.0824,8.0252,0.0824,8.0252\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_dxgi.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"48160\",\"48160\",\"dxgi.dll\",0.0102,0.9974,0.0102,0.9974\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_dxgkrnl.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"28AEB0\",\"28AEB0\",\"dxgkrnl.sys\",0.0104,1.0173,0.0104,1.0173\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_dxgmms2.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"23B70\",\"23B70\",\"dxgmms2.sys\",0.0104,1.0122,0.0104,1.0122\n\"1C24D\",\"1C24D\",\"dxgmms2.sys\",0.0077,0.7500,0.0077,0.7500\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_e1d.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"2BE26\",\"2BE26\",\"e1d.sys\",0.0104,1.0148,0.0104,1.0148\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_fcon.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"786A3\",\"786A3\",\"fcon.dll\",0.0205,1.9928,0.0205,1.9928\n\"783CF\",\"783CF\",\"fcon.dll\",0.0102,0.9969,0.0102,0.9969\n\"33195\",\"33195\",\"fcon.dll\",0.0102,0.9953,0.0102,0.9953\n\"32C30\",\"32C30\",\"fcon.dll\",0.0102,0.9945,0.0102,0.9945\n\"10A6C\",\"10A6C\",\"fcon.dll\",0.0102,0.9935,0.0102,0.9935\n\"7BC0B\",\"7BC0B\",\"fcon.dll\",0.0102,0.9920,0.0102,0.9920\n\"786D1\",\"786D1\",\"fcon.dll\",0.0101,0.9881,0.0101,0.9881\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_fileinfo.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"15A85\",\"15A85\",\"fileinfo.sys\",0.0165,1.6067,0.0165,1.6067\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_fvevol.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"226E8\",\"226E8\",\"fvevol.sys\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_gdi32full.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"24A80\",\"24A80\",\"gdi32full.dll\",0.0196,1.9122,0.0196,1.9122\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_iertutil.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"342FD\",\"342FD\",\"iertutil.dll\",0.0205,2.0000,0.0205,2.0000\n\"A615\",\"A615\",\"iertutil.dll\",0.0205,2.0000,0.0205,2.0000\n\"246A9\",\"246A9\",\"iertutil.dll\",0.0203,1.9827,0.0203,1.9827\n\"1DA84\",\"1DA84\",\"iertutil.dll\",0.0149,1.4523,0.0149,1.4523\n\"3F16D\",\"3F16D\",\"iertutil.dll\",0.0103,1.0035,0.0103,1.0035\n\"793F\",\"793F\",\"iertutil.dll\",0.0101,0.9858,0.0101,0.9858\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_imagehlp.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"2224\",\"2224\",\"imagehlp.dll\",0.1148,11.1803,0.1148,11.1803\n\"2230\",\"2230\",\"imagehlp.dll\",0.0900,8.7674,0.0900,8.7674\n\"222E\",\"222E\",\"imagehlp.dll\",0.0306,2.9803,0.0306,2.9803\n\"2206\",\"2206\",\"imagehlp.dll\",0.0103,1.0080,0.0103,1.0080\n\"220E\",\"220E\",\"imagehlp.dll\",0.0102,0.9955,0.0102,0.9955\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_intelppm.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1292\",\"1292\",\"intelppm.sys\",0.0104,1.0090,0.0104,1.0090\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_kernel32.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"84970\",\"84970\",\"kernel32.dll\",0.0411,4.0015,0.0411,4.0015\n\"7DC4\",\"7DC4\",\"kernel32.dll\",0.0351,3.4154,0.0351,3.4154\n\"3B1B0\",\"3B1B0\",\"kernel32.dll\",0.0308,2.9978,0.0308,2.9978\n\"1A6E0\",\"1A6E0\",\"kernel32.dll\",0.0241,2.3454,0.0241,2.3454\n\"3E7E0\",\"3E7E0\",\"kernel32.dll\",0.0216,2.1024,0.0216,2.1024\n\"1A5C3\",\"1A5C3\",\"kernel32.dll\",0.0205,2.0002,0.0205,2.0002\n\"4EB80\",\"4EB80\",\"kernel32.dll\",0.0205,2.0000,0.0205,2.0000\n\"6606\",\"6606\",\"kernel32.dll\",0.0205,2.0000,0.0205,2.0000\n\"1A700\",\"1A700\",\"kernel32.dll\",0.0205,1.9980,0.0205,1.9980\n\"5C1E\",\"5C1E\",\"kernel32.dll\",0.0204,1.9913,0.0204,1.9913\n\"1A5E3\",\"1A5E3\",\"kernel32.dll\",0.0110,1.0685,0.0110,1.0685\n\"5AFA\",\"5AFA\",\"kernel32.dll\",0.0104,1.0154,0.0104,1.0154\n\"65F4\",\"65F4\",\"kernel32.dll\",0.0103,1.0057,0.0103,1.0057\n\"6890\",\"6890\",\"kernel32.dll\",0.0103,1.0012,0.0103,1.0012\n\"6646\",\"6646\",\"kernel32.dll\",0.0103,1.0002,0.0103,1.0002\n\"2BD27\",\"2BD27\",\"kernel32.dll\",0.0102,0.9974,0.0102,0.9974\n\"382C0\",\"382C0\",\"kernel32.dll\",0.0102,0.9964,0.0102,0.9964\n\"79CB\",\"79CB\",\"kernel32.dll\",0.0102,0.9948,0.0102,0.9948\n\"304A0\",\"304A0\",\"kernel32.dll\",0.0102,0.9938,0.0102,0.9938\n\"6460\",\"6460\",\"kernel32.dll\",0.0102,0.9918,0.0102,0.9918\n\"2BD40\",\"2BD40\",\"kernel32.dll\",0.0102,0.9909,0.0102,0.9909\n\"5B88\",\"5B88\",\"kernel32.dll\",0.0101,0.9884,0.0101,0.9884\n\"84973\",\"84973\",\"kernel32.dll\",0.0100,0.9770,0.0100,0.9770\n\"5B8F\",\"5B8F\",\"kernel32.dll\",0.0099,0.9661,0.0099,0.9661\n\"84980\",\"84980\",\"kernel32.dll\",0.0084,0.8184,0.0084,0.8184\n\"68E7\",\"68E7\",\"kernel32.dll\",0.0076,0.7366,0.0076,0.7366\n\"6650\",\"6650\",\"kernel32.dll\",0.0058,0.5619,0.0058,0.5619\n\"36EA0\",\"36EA0\",\"kernel32.dll\",0.0032,0.3086,0.0032,0.3086\n\"5B14\",\"5B14\",\"kernel32.dll\",0.0025,0.2448,0.0025,0.2448\n\"3E800\",\"3E800\",\"kernel32.dll\",0.0019,0.1883,0.0019,0.1883\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_ksecdd.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"259E0\",\"259E0\",\"ksecdd.sys\",0.0123,1.1984,0.0123,1.1984\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_msasn1.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"2F9E\",\"2F9E\",\"msasn1.dll\",0.0102,0.9943,0.0102,0.9943\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_mssecflt.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"A050\",\"A050\",\"mssecflt.sys\",0.0334,3.2541,0.0334,3.2541\n\"3B4E8\",\"3B4E8\",\"mssecflt.sys\",0.0316,3.0815,0.0316,3.0815\n\"A05E\",\"A05E\",\"mssecflt.sys\",0.0205,2.0000,0.0205,2.0000\n\"606C\",\"606C\",\"mssecflt.sys\",0.0202,1.9704,0.0202,1.9704\n\"A07B\",\"A07B\",\"mssecflt.sys\",0.0166,1.6176,0.0166,1.6176\n\"2442B\",\"2442B\",\"mssecflt.sys\",0.0162,1.5814,0.0162,1.5814\n\"3B467\",\"3B467\",\"mssecflt.sys\",0.0114,1.1140,0.0114,1.1140\n\"350BE\",\"350BE\",\"mssecflt.sys\",0.0112,1.0959,0.0112,1.0959\n\"FB7E\",\"FB7E\",\"mssecflt.sys\",0.0106,1.0295,0.0106,1.0295\n\"32D2E\",\"32D2E\",\"mssecflt.sys\",0.0103,1.0079,0.0103,1.0079\n\"34CD5\",\"34CD5\",\"mssecflt.sys\",0.0103,1.0016,0.0103,1.0016\n\"34B5C\",\"34B5C\",\"mssecflt.sys\",0.0103,1.0014,0.0103,1.0014\n\"3547A\",\"3547A\",\"mssecflt.sys\",0.0103,0.9997,0.0103,0.9997\n\"38001\",\"38001\",\"mssecflt.sys\",0.0102,0.9978,0.0102,0.9978\n\"FB2A\",\"FB2A\",\"mssecflt.sys\",0.0083,0.8070,0.0083,0.8070\n\"A054\",\"A054\",\"mssecflt.sys\",0.0080,0.7783,0.0080,0.7783\n\"23F26\",\"23F26\",\"mssecflt.sys\",0.0067,0.6499,0.0067,0.6499\n\"3A0F4\",\"3A0F4\",\"mssecflt.sys\",0.0020,0.1931,0.0020,0.1931\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_msvcp140.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"12822\",\"12822\",\"msvcp140.dll\",0.0514,5.0038,0.0514,5.0038\n\"3AA36\",\"3AA36\",\"msvcp140.dll\",0.0306,2.9859,0.0306,2.9859\n\"117BD\",\"117BD\",\"msvcp140.dll\",0.0205,2.0000,0.0205,2.0000\n\"14742\",\"14742\",\"msvcp140.dll\",0.0205,1.9991,0.0205,1.9991\n\"6554\",\"6554\",\"msvcp140.dll\",0.0127,1.2372,0.0127,1.2372\n\"AC40\",\"AC40\",\"msvcp140.dll\",0.0103,1.0024,0.0103,1.0024\n\"127F5\",\"127F5\",\"msvcp140.dll\",0.0103,1.0022,0.0103,1.0022\n\"2D5AA\",\"2D5AA\",\"msvcp140.dll\",0.0103,1.0017,0.0103,1.0017\n\"45CB5\",\"45CB5\",\"msvcp140.dll\",0.0103,1.0017,0.0103,1.0017\n\"15251\",\"15251\",\"msvcp140.dll\",0.0103,1.0010,0.0103,1.0010\n\"12724\",\"12724\",\"msvcp140.dll\",0.0103,1.0006,0.0103,1.0006\n\"12860\",\"12860\",\"msvcp140.dll\",0.0103,1.0001,0.0514,5.0103\n\"B050\",\"B050\",\"msvcp140.dll\",0.0102,0.9963,0.0102,0.9963\n\"12E0B\",\"12E0B\",\"msvcp140.dll\",0.0102,0.9958,0.0102,0.9958\n\"12530\",\"12530\",\"msvcp140.dll\",0.0101,0.9831,0.0101,0.9831\n\"5955\",\"5955\",\"msvcp140.dll\",0.0100,0.9740,0.0100,0.9740\n\"3AA20\",\"3AA20\",\"msvcp140.dll\",0.0045,0.4391,0.0045,0.4391\n\"22AD3\",\"22AD3\",\"msvcp140.dll\",0.0038,0.3703,0.0038,0.3703\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_mswsock.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1ADC0\",\"1ADC0\",\"mswsock.dll\",0.0205,2.0000,0.0205,2.0000\n\"14133\",\"14133\",\"mswsock.dll\",0.0103,0.9995,0.0103,0.9995\n\"B8FE\",\"B8FE\",\"mswsock.dll\",0.0009,0.0862,0.0009,0.0862\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_msxml6.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"8DE0\",\"8DE0\",\"msxml6.dll\",0.0029,0.2836,0.0029,0.2836\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_ntdll.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"15FFA4\",\"15FFA4\",\"ntdll.dll\",5.6033,545.9343,5.6649,551.9347\n\"160804\",\"160804\",\"ntdll.dll\",3.9304,382.9390,3.9405,383.9322\n\"160044\",\"160044\",\"ntdll.dll\",3.2561,317.2456,3.4592,337.0298\n\"160024\",\"160024\",\"ntdll.dll\",2.2144,215.7549,2.4053,234.3510\n\"15FE24\",\"15FE24\",\"ntdll.dll\",1.9028,185.3956,1.9164,186.7124\n\"15FF44\",\"15FF44\",\"ntdll.dll\",1.8660,181.8086,1.8660,181.8086\n\"160504\",\"160504\",\"ntdll.dll\",1.3606,132.5672,1.3606,132.5672\n\"160F14\",\"160F14\",\"ntdll.dll\",1.2849,125.1857,1.2950,126.1779\n\"15FE44\",\"15FE44\",\"ntdll.dll\",0.8321,81.0708,0.8321,81.0708\n\"160914\",\"160914\",\"ntdll.dll\",0.8168,79.5813,0.8831,86.0457\n\"274EF\",\"274EF\",\"ntdll.dll\",0.8108,78.9997,0.8108,78.9997\n\"162794\",\"162794\",\"ntdll.dll\",0.7934,77.3058,0.7934,77.3058\n\"15FE64\",\"15FE64\",\"ntdll.dll\",0.7187,70.0214,0.7187,70.0214\n\"15FDE4\",\"15FDE4\",\"ntdll.dll\",0.6659,64.8751,0.7379,71.8966\n\"15FFC4\",\"15FFC4\",\"ntdll.dll\",0.4078,39.7307,0.4693,45.7274\n\"27456\",\"27456\",\"ntdll.dll\",0.3917,38.1679,0.3917,38.1679\n\"1603A4\",\"1603A4\",\"ntdll.dll\",0.3507,34.1650,0.4018,39.1464\n\"160424\",\"160424\",\"ntdll.dll\",0.3315,32.2936,0.3315,32.2936\n\"160954\",\"160954\",\"ntdll.dll\",0.3207,31.2482,0.3207,31.2482\n\"27363\",\"27363\",\"ntdll.dll\",0.2874,27.9995,0.2874,27.9995\n\"160104\",\"160104\",\"ntdll.dll\",0.2827,27.5416,0.2827,27.5416\n\"160264\",\"160264\",\"ntdll.dll\",0.2596,25.2976,0.2596,25.2976\n\"ADBAF\",\"ADBAF\",\"ntdll.dll\",0.2557,24.9159,0.2557,24.9159\n\"27357\",\"27357\",\"ntdll.dll\",0.2517,24.5196,0.2517,24.5196\n\"1605A4\",\"1605A4\",\"ntdll.dll\",0.2301,22.4159,0.2301,22.4159\n\"162714\",\"162714\",\"ntdll.dll\",0.2299,22.4003,0.2299,22.4003\n\"15FF24\",\"15FF24\",\"ntdll.dll\",0.2259,22.0057,0.2259,22.0057\n\"D07B\",\"D07B\",\"ntdll.dll\",0.2246,21.8873,0.2246,21.8873\n\"D05D\",\"D05D\",\"ntdll.dll\",0.2213,21.5589,0.2213,21.5589\n\"CF5D\",\"CF5D\",\"ntdll.dll\",0.2193,21.3646,0.2193,21.3646\n\"D117\",\"D117\",\"ntdll.dll\",0.2126,20.7104,0.2126,20.7104\n\"D07F\",\"D07F\",\"ntdll.dll\",0.2056,20.0358,0.2056,20.0358\n\"1633D4\",\"1633D4\",\"ntdll.dll\",0.1729,16.8449,0.1729,16.8449\n\"163834\",\"163834\",\"ntdll.dll\",0.1703,16.5963,0.1803,17.5697\n\"15FF84\",\"15FF84\",\"ntdll.dll\",0.1657,16.1416,0.1657,16.1416\n\"163A34\",\"163A34\",\"ntdll.dll\",0.1642,16.0000,0.1847,18.0000\n\"93B01\",\"93B01\",\"ntdll.dll\",0.1532,14.9259,0.1532,14.9259\n\"160D74\",\"160D74\",\"ntdll.dll\",0.1436,13.9931,0.1436,13.9931\n\"1618D4\",\"1618D4\",\"ntdll.dll\",0.1414,13.7767,0.1414,13.7767\n\"15FE84\",\"15FE84\",\"ntdll.dll\",0.1287,12.5348,0.1287,12.5348\n\"1606A4\",\"1606A4\",\"ntdll.dll\",0.1282,12.4916,0.1282,12.4916\n\"495CD\",\"495CD\",\"ntdll.dll\",0.1275,12.4196,0.1275,12.4196\n\"93B0C\",\"93B0C\",\"ntdll.dll\",0.1116,10.8749,0.1116,10.8749\n\"161494\",\"161494\",\"ntdll.dll\",0.1076,10.4833,0.1076,10.4833\n\"D065\",\"D065\",\"ntdll.dll\",0.1036,10.0951,0.1036,10.0951\n\"29050\",\"29050\",\"ntdll.dll\",0.1023,9.9710,0.1023,9.9710\n\"2907E\",\"2907E\",\"ntdll.dll\",0.0995,9.6966,0.0995,9.6966\n\"161674\",\"161674\",\"ntdll.dll\",0.0966,9.4141,0.0966,9.4141\n\"160124\",\"160124\",\"ntdll.dll\",0.0939,9.1459,0.1039,10.1268\n\"1639D4\",\"1639D4\",\"ntdll.dll\",0.0924,9.0051,0.0924,9.0051\n\"2C40C\",\"2C40C\",\"ntdll.dll\",0.0910,8.8687,0.0910,8.8687\n\"C5644\",\"C5644\",\"ntdll.dll\",0.0897,8.7414,0.0897,8.7414\n\"6D3EC\",\"6D3EC\",\"ntdll.dll\",0.0847,8.2549,0.0847,8.2549\n\"6E045\",\"6E045\",\"ntdll.dll\",0.0835,8.1381,0.0835,8.1381\n\"D0E8\",\"D0E8\",\"ntdll.dll\",0.0819,7.9796,0.0819,7.9796\n\"160764\",\"160764\",\"ntdll.dll\",0.0815,7.9380,0.0815,7.9380\n\"160244\",\"160244\",\"ntdll.dll\",0.0793,7.7246,0.0793,7.7246\n\"160B94\",\"160B94\",\"ntdll.dll\",0.0786,7.6629,0.0786,7.6629\n\"ADC60\",\"ADC60\",\"ntdll.dll\",0.0783,7.6282,0.0783,7.6282\n\"49D60\",\"49D60\",\"ntdll.dll\",0.0766,7.4655,0.0766,7.4655\n\"15FF64\",\"15FF64\",\"ntdll.dll\",0.0743,7.2392,0.0743,7.2392\n\"49DBD\",\"49DBD\",\"ntdll.dll\",0.0731,7.1268,0.0731,7.1268\n\"D123\",\"D123\",\"ntdll.dll\",0.0726,7.0704,0.0726,7.0704\n\"160084\",\"160084\",\"ntdll.dll\",0.0724,7.0552,0.0724,7.0552\n\"F8E6\",\"F8E6\",\"ntdll.dll\",0.0718,6.9994,0.0718,6.9994\n\"6D3D1\",\"6D3D1\",\"ntdll.dll\",0.0676,6.5904,0.0676,6.5904\n\"163AE7\",\"163AE7\",\"ntdll.dll\",0.0671,6.5365,0.0671,6.5365\n\"3BA5A\",\"3BA5A\",\"ntdll.dll\",0.0641,6.2471,0.0641,6.2471\n\"15FF04\",\"15FF04\",\"ntdll.dll\",0.0618,6.0178,0.0618,6.0178\n\"28313\",\"28313\",\"ntdll.dll\",0.0616,6.0043,0.0616,6.0043\n\"93B23\",\"93B23\",\"ntdll.dll\",0.0615,5.9957,0.0615,5.9957\n\"CF0F\",\"CF0F\",\"ntdll.dll\",0.0611,5.9555,0.0611,5.9555\n\"160064\",\"160064\",\"ntdll.dll\",0.0604,5.8853,0.0604,5.8853\n\"CF05\",\"CF05\",\"ntdll.dll\",0.0591,5.7623,0.0591,5.7623\n\"897A0\",\"897A0\",\"ntdll.dll\",0.0587,5.7229,0.0587,5.7229\n\"D093\",\"D093\",\"ntdll.dll\",0.0541,5.2716,0.0541,5.2716\n\"ADBF0\",\"ADBF0\",\"ntdll.dll\",0.0519,5.0588,0.0519,5.0588\n\"162D34\",\"162D34\",\"ntdll.dll\",0.0519,5.0545,0.0519,5.0545\n\"49D65\",\"49D65\",\"ntdll.dll\",0.0513,5.0006,0.0513,5.0006\n\"27200\",\"27200\",\"ntdll.dll\",0.0513,5.0005,0.0513,5.0005\n\"2C9EE\",\"2C9EE\",\"ntdll.dll\",0.0512,4.9911,0.0512,4.9911\n\"D069\",\"D069\",\"ntdll.dll\",0.0511,4.9764,0.0511,4.9764\n\"12E65F\",\"12E65F\",\"ntdll.dll\",0.0489,4.7669,0.0489,4.7669\n\"1601C4\",\"1601C4\",\"ntdll.dll\",0.0484,4.7174,0.0484,4.7174\n\"160184\",\"160184\",\"ntdll.dll\",0.0475,4.6239,0.0475,4.6239\n\"1601E4\",\"1601E4\",\"ntdll.dll\",0.0473,4.6048,0.0473,4.6048\n\"ADC43\",\"ADC43\",\"ntdll.dll\",0.0463,4.5085,0.0463,4.5085\n\"26D35\",\"26D35\",\"ntdll.dll\",0.0463,4.5079,0.0463,4.5079\n\"D137\",\"D137\",\"ntdll.dll\",0.0454,4.4224,0.0454,4.4224\n\"2758C\",\"2758C\",\"ntdll.dll\",0.0441,4.3014,0.0441,4.3014\n\"D0C4\",\"D0C4\",\"ntdll.dll\",0.0427,4.1569,0.0427,4.1569\n\"27449\",\"27449\",\"ntdll.dll\",0.0424,4.1295,0.0424,4.1295\n\"6E010\",\"6E010\",\"ntdll.dll\",0.0421,4.1006,0.0421,4.1006\n\"27300\",\"27300\",\"ntdll.dll\",0.0415,4.0445,0.0415,4.0445\n\"163954\",\"163954\",\"ntdll.dll\",0.0414,4.0344,0.0414,4.0344\n\"49AEE\",\"49AEE\",\"ntdll.dll\",0.0411,4.0070,0.0411,4.0070\n\"1608B4\",\"1608B4\",\"ntdll.dll\",0.0411,4.0000,0.0411,4.0000\n\"170030\",\"170030\",\"ntdll.dll\",0.0411,4.0000,0.0411,4.0000\n\"26D3C\",\"26D3C\",\"ntdll.dll\",0.0411,4.0000,0.0411,4.0000\n\"27238\",\"27238\",\"ntdll.dll\",0.0411,4.0000,0.0411,4.0000\n\"3BA56\",\"3BA56\",\"ntdll.dll\",0.0411,4.0000,0.0411,4.0000\n\"49590\",\"49590\",\"ntdll.dll\",0.0411,4.0000,0.0411,4.0000\n\"51817\",\"51817\",\"ntdll.dll\",0.0411,4.0000,0.0411,4.0000\n\"160DD4\",\"160DD4\",\"ntdll.dll\",0.0410,3.9962,0.0410,3.9962\n\"2727B\",\"2727B\",\"ntdll.dll\",0.0410,3.9901,0.0410,3.9901\n\"6E015\",\"6E015\",\"ntdll.dll\",0.0409,3.9891,0.0409,3.9891\n\"ADC12\",\"ADC12\",\"ntdll.dll\",0.0409,3.9888,0.0409,3.9888\n\"93B4B\",\"93B4B\",\"ntdll.dll\",0.0409,3.9868,0.0409,3.9868\n\"49F9D\",\"49F9D\",\"ntdll.dll\",0.0409,3.9845,0.0409,3.9845\n\"CF63\",\"CF63\",\"ntdll.dll\",0.0408,3.9730,0.0408,3.9730\n\"1664AC\",\"1664AC\",\"ntdll.dll\",0.0360,3.5052,0.0360,3.5052\n\"26B7E\",\"26B7E\",\"ntdll.dll\",0.0349,3.3960,0.0349,3.3960\n\"93B12\",\"93B12\",\"ntdll.dll\",0.0338,3.2966,0.0338,3.2966\n\"CF59\",\"CF59\",\"ntdll.dll\",0.0336,3.2689,0.0336,3.2689\n\"26BC5\",\"26BC5\",\"ntdll.dll\",0.0335,3.2617,0.0335,3.2617\n\"160664\",\"160664\",\"ntdll.dll\",0.0333,3.2493,0.0333,3.2493\n\"93AC3\",\"93AC3\",\"ntdll.dll\",0.0329,3.2074,0.0329,3.2074\n\"820D8\",\"820D8\",\"ntdll.dll\",0.0329,3.2064,0.0329,3.2064\n\"9C490\",\"9C490\",\"ntdll.dll\",0.0329,3.2034,0.0329,3.2034\n\"16560E\",\"16560E\",\"ntdll.dll\",0.0318,3.0995,0.0318,3.0995\n\"26B20\",\"26B20\",\"ntdll.dll\",0.0317,3.0931,0.0317,3.0931\n\"15FEA4\",\"15FEA4\",\"ntdll.dll\",0.0316,3.0798,0.0316,3.0798\n\"93AFD\",\"93AFD\",\"ntdll.dll\",0.0310,3.0209,0.0310,3.0209\n\"6D3D7\",\"6D3D7\",\"ntdll.dll\",0.0310,3.0179,0.0310,3.0179\n\"6FC0D\",\"6FC0D\",\"ntdll.dll\",0.0309,3.0154,0.0309,3.0154\n\"49AD0\",\"49AD0\",\"ntdll.dll\",0.0309,3.0133,0.0309,3.0133\n\"495B5\",\"495B5\",\"ntdll.dll\",0.0309,3.0105,0.0309,3.0105\n\"161634\",\"161634\",\"ntdll.dll\",0.0309,3.0102,0.0309,3.0102\n\"90093\",\"90093\",\"ntdll.dll\",0.0308,3.0038,0.0308,3.0038\n\"26B2F\",\"26B2F\",\"ntdll.dll\",0.0308,3.0028,0.0308,3.0028\n\"162974\",\"162974\",\"ntdll.dll\",0.0308,3.0008,0.0308,3.0008\n\"282FD\",\"282FD\",\"ntdll.dll\",0.0308,3.0005,0.0709,6.9062\n\"49F77\",\"49F77\",\"ntdll.dll\",0.0308,3.0005,0.0308,3.0005\n\"6BD52\",\"6BD52\",\"ntdll.dll\",0.0308,3.0003,0.0308,3.0003\n\"6D014\",\"6D014\",\"ntdll.dll\",0.0308,3.0003,0.0308,3.0003\n\"52AB0\",\"52AB0\",\"ntdll.dll\",0.0308,2.9994,0.0308,2.9994\n\"49F91\",\"49F91\",\"ntdll.dll\",0.0308,2.9981,0.0308,2.9981\n\"26D62\",\"26D62\",\"ntdll.dll\",0.0308,2.9975,0.0308,2.9975\n\"274D9\",\"274D9\",\"ntdll.dll\",0.0308,2.9975,0.0308,2.9975\n\"235D9\",\"235D9\",\"ntdll.dll\",0.0307,2.9957,0.0307,2.9957\n\"C9266\",\"C9266\",\"ntdll.dll\",0.0307,2.9956,0.0307,2.9956\n\"70570\",\"70570\",\"ntdll.dll\",0.0307,2.9953,0.0307,2.9953\n\"1623D4\",\"1623D4\",\"ntdll.dll\",0.0307,2.9951,0.0307,2.9951\n\"4EF1C\",\"4EF1C\",\"ntdll.dll\",0.0307,2.9928,0.0307,2.9928\n\"D062\",\"D062\",\"ntdll.dll\",0.0307,2.9926,0.0307,2.9926\n\"272CC\",\"272CC\",\"ntdll.dll\",0.0307,2.9882,0.0307,2.9882\n\"93AB5\",\"93AB5\",\"ntdll.dll\",0.0307,2.9874,0.0307,2.9874\n\"27205\",\"27205\",\"ntdll.dll\",0.0306,2.9848,0.0306,2.9848\n\"93B10\",\"93B10\",\"ntdll.dll\",0.0305,2.9739,0.0305,2.9739\n\"274A2\",\"274A2\",\"ntdll.dll\",0.0303,2.9555,0.0817,7.9569\n\"12E624\",\"12E624\",\"ntdll.dll\",0.0302,2.9384,0.0302,2.9384\n\"D6820\",\"D6820\",\"ntdll.dll\",0.0296,2.8841,0.0296,2.8841\n\"D26E0\",\"D26E0\",\"ntdll.dll\",0.0282,2.7465,0.0282,2.7465\n\"28355\",\"28355\",\"ntdll.dll\",0.0274,2.6679,0.0274,2.6679\n\"1602A4\",\"1602A4\",\"ntdll.dll\",0.0272,2.6480,0.0272,2.6480\n\"3BA77\",\"3BA77\",\"ntdll.dll\",0.0259,2.5203,0.0259,2.5203\n\"275C5\",\"275C5\",\"ntdll.dll\",0.0254,2.4763,0.0254,2.4763\n\"49594\",\"49594\",\"ntdll.dll\",0.0250,2.4314,0.0250,2.4314\n\"2748D\",\"2748D\",\"ntdll.dll\",0.0249,2.4236,0.0249,2.4236\n\"26D4D\",\"26D4D\",\"ntdll.dll\",0.0246,2.3997,0.0246,2.3997\n\"34730\",\"34730\",\"ntdll.dll\",0.0243,2.3719,0.0243,2.3719\n\"CFA8\",\"CFA8\",\"ntdll.dll\",0.0243,2.3696,0.0243,2.3696\n\"2732D\",\"2732D\",\"ntdll.dll\",0.0242,2.3606,0.0242,2.3606\n\"C5641\",\"C5641\",\"ntdll.dll\",0.0232,2.2642,0.0338,3.2940\n\"D099\",\"D099\",\"ntdll.dll\",0.0229,2.2343,0.0229,2.2343\n\"12F59A\",\"12F59A\",\"ntdll.dll\",0.0226,2.1981,0.0226,2.1981\n\"93AF4\",\"93AF4\",\"ntdll.dll\",0.0224,2.1821,0.0224,2.1821\n\"1951C\",\"1951C\",\"ntdll.dll\",0.0222,2.1670,0.0222,2.1670\n\"3B600\",\"3B600\",\"ntdll.dll\",0.0222,2.1616,0.0222,2.1616\n\"90016\",\"90016\",\"ntdll.dll\",0.0221,2.1519,0.0221,2.1519\n\"68DDA\",\"68DDA\",\"ntdll.dll\",0.0215,2.0909,0.0215,2.0909\n\"15FF70\",\"15FF70\",\"ntdll.dll\",0.0215,2.0907,0.0215,2.0907\n\"CFDC\",\"CFDC\",\"ntdll.dll\",0.0214,2.0887,0.0214,2.0887\n\"41759\",\"41759\",\"ntdll.dll\",0.0209,2.0327,0.0209,2.0327\n\"15FFE4\",\"15FFE4\",\"ntdll.dll\",0.0208,2.0256,0.0208,2.0256\n\"27210\",\"27210\",\"ntdll.dll\",0.0208,2.0250,0.0208,2.0250\n\"6CE80\",\"6CE80\",\"ntdll.dll\",0.0208,2.0243,0.0208,2.0243\n\"161934\",\"161934\",\"ntdll.dll\",0.0208,2.0217,0.0208,2.0217\n\"CFCA\",\"CFCA\",\"ntdll.dll\",0.0206,2.0112,0.0206,2.0112\n\"274E1\",\"274E1\",\"ntdll.dll\",0.0206,2.0094,0.0206,2.0094\n\"ADC03\",\"ADC03\",\"ntdll.dll\",0.0206,2.0053,0.0206,2.0053\n\"D086\",\"D086\",\"ntdll.dll\",0.0206,2.0045,0.0206,2.0045\n\"27231\",\"27231\",\"ntdll.dll\",0.0206,2.0032,0.0206,2.0032\n\"26B79\",\"26B79\",\"ntdll.dll\",0.0206,2.0030,0.0206,2.0030\n\"6D478\",\"6D478\",\"ntdll.dll\",0.0205,2.0020,0.0205,2.0020\n\"ADC78\",\"ADC78\",\"ntdll.dll\",0.0205,2.0019,0.0205,2.0019\n\"2C3F5\",\"2C3F5\",\"ntdll.dll\",0.0205,2.0010,0.0205,2.0010\n\"27583\",\"27583\",\"ntdll.dll\",0.0205,2.0005,0.0205,2.0005\n\"129C0E\",\"129C0E\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"15FF98\",\"15FF98\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"160018\",\"160018\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"160164\",\"160164\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"160204\",\"160204\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"160524\",\"160524\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"1606E4\",\"1606E4\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"160D14\",\"160D14\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"162434\",\"162434\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"163914\",\"163914\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"163D80\",\"163D80\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"163D9F\",\"163D9F\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"165529\",\"165529\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"165609\",\"165609\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"165626\",\"165626\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"16588B\",\"16588B\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"166314\",\"166314\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"1663C3\",\"1663C3\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"19562\",\"19562\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"19627\",\"19627\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"256BD\",\"256BD\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"26C02\",\"26C02\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"2725C\",\"2725C\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"274D3\",\"274D3\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"27C31\",\"27C31\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"29AF0\",\"29AF0\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"2C3C4\",\"2C3C4\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"2C3D2\",\"2C3D2\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"2C58B\",\"2C58B\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"34270\",\"34270\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"3B2E0\",\"3B2E0\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"41CC3\",\"41CC3\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"431DF\",\"431DF\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"49DB6\",\"49DB6\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"4C9DA\",\"4C9DA\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"4D8CC\",\"4D8CC\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"4E9E2\",\"4E9E2\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"4EEDC\",\"4EEDC\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"4EF11\",\"4EF11\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"4EF14\",\"4EF14\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"4F2F3\",\"4F2F3\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"5180A\",\"5180A\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"529A2\",\"529A2\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"529D8\",\"529D8\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"52A4D\",\"52A4D\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"55537\",\"55537\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"6317B\",\"6317B\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"68DD1\",\"68DD1\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"6BAFA\",\"6BAFA\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"6BB28\",\"6BB28\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"6CFB8\",\"6CFB8\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"6FBC9\",\"6FBC9\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"70412\",\"70412\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"70464\",\"70464\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"75656\",\"75656\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"81F9B\",\"81F9B\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"84AC0\",\"84AC0\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"89719\",\"89719\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"92738\",\"92738\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"93B34\",\"93B34\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"ADBCB\",\"ADBCB\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"ADC15\",\"ADC15\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"B7DFD\",\"B7DFD\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"C6B10\",\"C6B10\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"C776E\",\"C776E\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"CB400\",\"CB400\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"D046\",\"D046\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"D146\",\"D146\",\"ntdll.dll\",0.0205,2.0000,0.0205,2.0000\n\"26C12\",\"26C12\",\"ntdll.dll\",0.0205,1.9998,0.0205,1.9998\n\"C7740\",\"C7740\",\"ntdll.dll\",0.0205,1.9996,0.0205,1.9996\n\"12E5D6\",\"12E5D6\",\"ntdll.dll\",0.0205,1.9984,0.0205,1.9984\n\"26B87\",\"26B87\",\"ntdll.dll\",0.0205,1.9976,0.0205,1.9976\n\"D10A\",\"D10A\",\"ntdll.dll\",0.0205,1.9948,0.0205,1.9948\n\"27447\",\"27447\",\"ntdll.dll\",0.0205,1.9943,0.0205,1.9943\n\"272E1\",\"272E1\",\"ntdll.dll\",0.0204,1.9914,0.0204,1.9914\n\"49F7A\",\"49F7A\",\"ntdll.dll\",0.0204,1.9906,0.0204,1.9906\n\"92721\",\"92721\",\"ntdll.dll\",0.0204,1.9884,0.0204,1.9884\n\"26B62\",\"26B62\",\"ntdll.dll\",0.0204,1.9883,0.0204,1.9883\n\"29AE9\",\"29AE9\",\"ntdll.dll\",0.0204,1.9879,0.0204,1.9879\n\"27260\",\"27260\",\"ntdll.dll\",0.0204,1.9841,0.0204,1.9841\n\"ADBC8\",\"ADBC8\",\"ntdll.dll\",0.0203,1.9767,0.0203,1.9767\n\"2742C\",\"2742C\",\"ntdll.dll\",0.0203,1.9760,0.0203,1.9760\n\"12F59F\",\"12F59F\",\"ntdll.dll\",0.0203,1.9743,0.0203,1.9743\n\"27435\",\"27435\",\"ntdll.dll\",0.0202,1.9688,0.0202,1.9688\n\"2C9D0\",\"2C9D0\",\"ntdll.dll\",0.0202,1.9665,0.0202,1.9665\n\"529E2\",\"529E2\",\"ntdll.dll\",0.0194,1.8924,0.0194,1.8924\n\"10FDA\",\"10FDA\",\"ntdll.dll\",0.0188,1.8326,0.0188,1.8326\n\"27258\",\"27258\",\"ntdll.dll\",0.0188,1.8298,0.0188,1.8298\n\"26BB3\",\"26BB3\",\"ntdll.dll\",0.0187,1.8180,0.0187,1.8180\n\"D050\",\"D050\",\"ntdll.dll\",0.0182,1.7756,0.0182,1.7756\n\"B7D47\",\"B7D47\",\"ntdll.dll\",0.0178,1.7308,0.0178,1.7308\n\"160CB4\",\"160CB4\",\"ntdll.dll\",0.0178,1.7307,0.0178,1.7307\n\"160444\",\"160444\",\"ntdll.dll\",0.0177,1.7262,0.0177,1.7262\n\"129A6E\",\"129A6E\",\"ntdll.dll\",0.0176,1.7172,0.0176,1.7172\n\"D3270\",\"D3270\",\"ntdll.dll\",0.0176,1.7110,0.0176,1.7110\n\"16AFF\",\"16AFF\",\"ntdll.dll\",0.0167,1.6314,0.0167,1.6314\n\"C5664\",\"C5664\",\"ntdll.dll\",0.0166,1.6197,0.0166,1.6197\n\"6D3DB\",\"6D3DB\",\"ntdll.dll\",0.0166,1.6173,0.0166,1.6173\n\"93B06\",\"93B06\",\"ntdll.dll\",0.0162,1.5748,0.0162,1.5748\n\"6BD7E\",\"6BD7E\",\"ntdll.dll\",0.0161,1.5665,0.0161,1.5665\n\"272ED\",\"272ED\",\"ntdll.dll\",0.0160,1.5560,0.0160,1.5560\n\"CB43A\",\"CB43A\",\"ntdll.dll\",0.0156,1.5244,0.0156,1.5244\n\"3B8CD\",\"3B8CD\",\"ntdll.dll\",0.0156,1.5208,0.0156,1.5208\n\"A3745\",\"A3745\",\"ntdll.dll\",0.0156,1.5185,0.0156,1.5185\n\"D151\",\"D151\",\"ntdll.dll\",0.0152,1.4801,0.0152,1.4801\n\"506B0\",\"506B0\",\"ntdll.dll\",0.0147,1.4347,0.0147,1.4347\n\"ADBB3\",\"ADBB3\",\"ntdll.dll\",0.0146,1.4224,0.0146,1.4224\n\"26BF8\",\"26BF8\",\"ntdll.dll\",0.0143,1.3942,0.0143,1.3942\n\"8FFD8\",\"8FFD8\",\"ntdll.dll\",0.0141,1.3714,0.0141,1.3714\n\"6E12C\",\"6E12C\",\"ntdll.dll\",0.0140,1.3682,0.0140,1.3682\n\"163C34\",\"163C34\",\"ntdll.dll\",0.0139,1.3513,0.0139,1.3513\n\"2D87F\",\"2D87F\",\"ntdll.dll\",0.0138,1.3482,0.0138,1.3482\n\"3B64A\",\"3B64A\",\"ntdll.dll\",0.0137,1.3392,0.0137,1.3392\n\"52A76\",\"52A76\",\"ntdll.dll\",0.0135,1.3133,0.0135,1.3133\n\"12EAFC\",\"12EAFC\",\"ntdll.dll\",0.0135,1.3130,0.0135,1.3130\n\"27272\",\"27272\",\"ntdll.dll\",0.0134,1.3008,0.0134,1.3008\n\"24C86\",\"24C86\",\"ntdll.dll\",0.0133,1.2926,0.0133,1.2926\n\"ADC22\",\"ADC22\",\"ntdll.dll\",0.0133,1.2921,0.0133,1.2921\n\"160224\",\"160224\",\"ntdll.dll\",0.0131,1.2789,0.0131,1.2789\n\"6D3BF\",\"6D3BF\",\"ntdll.dll\",0.0129,1.2542,0.0129,1.2542\n\"19513\",\"19513\",\"ntdll.dll\",0.0128,1.2431,0.0128,1.2431\n\"26E59\",\"26E59\",\"ntdll.dll\",0.0126,1.2247,0.0126,1.2247\n\"2C400\",\"2C400\",\"ntdll.dll\",0.0126,1.2246,0.0126,1.2246\n\"3F400\",\"3F400\",\"ntdll.dll\",0.0125,1.2166,0.0125,1.2166\n\"C2EDC\",\"C2EDC\",\"ntdll.dll\",0.0124,1.2107,0.0124,1.2107\n\"27C70\",\"27C70\",\"ntdll.dll\",0.0123,1.2023,0.0123,1.2023\n\"27573\",\"27573\",\"ntdll.dll\",0.0121,1.1813,0.0121,1.1813\n\"68D1E\",\"68D1E\",\"ntdll.dll\",0.0120,1.1667,0.0120,1.1667\n\"93ABA\",\"93ABA\",\"ntdll.dll\",0.0119,1.1586,0.0119,1.1586\n\"1EDCE\",\"1EDCE\",\"ntdll.dll\",0.0118,1.1545,0.0118,1.1545\n\"13D0E0\",\"13D0E0\",\"ntdll.dll\",0.0118,1.1505,0.0118,1.1505\n\"6D390\",\"6D390\",\"ntdll.dll\",0.0118,1.1501,0.0118,1.1501\n\"29ADD\",\"29ADD\",\"ntdll.dll\",0.0114,1.1144,0.0114,1.1144\n\"6CE44\",\"6CE44\",\"ntdll.dll\",0.0113,1.1008,0.0113,1.1008\n\"25A79\",\"25A79\",\"ntdll.dll\",0.0113,1.0982,0.0113,1.0982\n\"1914A\",\"1914A\",\"ntdll.dll\",0.0113,1.0978,0.0113,1.0978\n\"14202\",\"14202\",\"ntdll.dll\",0.0112,1.0932,0.0112,1.0932\n\"12E650\",\"12E650\",\"ntdll.dll\",0.0112,1.0913,0.0112,1.0913\n\"163AA0\",\"163AA0\",\"ntdll.dll\",0.0110,1.0681,0.0110,1.0681\n\"274EB\",\"274EB\",\"ntdll.dll\",0.0109,1.0657,0.0109,1.0657\n\"29EAA\",\"29EAA\",\"ntdll.dll\",0.0109,1.0637,0.0109,1.0637\n\"27360\",\"27360\",\"ntdll.dll\",0.0108,1.0499,0.0108,1.0499\n\"2746F\",\"2746F\",\"ntdll.dll\",0.0108,1.0485,0.0108,1.0485\n\"26BB8\",\"26BB8\",\"ntdll.dll\",0.0108,1.0480,0.0108,1.0480\n\"CAE80\",\"CAE80\",\"ntdll.dll\",0.0107,1.0469,0.0107,1.0469\n\"160684\",\"160684\",\"ntdll.dll\",0.0106,1.0338,0.0106,1.0338\n\"4B8D3\",\"4B8D3\",\"ntdll.dll\",0.0106,1.0335,0.0106,1.0335\n\"2CA33\",\"2CA33\",\"ntdll.dll\",0.0106,1.0285,0.0106,1.0285\n\"CF20\",\"CF20\",\"ntdll.dll\",0.0105,1.0262,0.0105,1.0262\n\"163B20\",\"163B20\",\"ntdll.dll\",0.0105,1.0257,0.0105,1.0257\n\"AD446\",\"AD446\",\"ntdll.dll\",0.0105,1.0231,0.0105,1.0231\n\"84D1E\",\"84D1E\",\"ntdll.dll\",0.0105,1.0187,0.0105,1.0187\n\"68D49\",\"68D49\",\"ntdll.dll\",0.0104,1.0161,0.0104,1.0161\n\"160CD4\",\"160CD4\",\"ntdll.dll\",0.0104,1.0146,0.0104,1.0146\n\"4C0F0\",\"4C0F0\",\"ntdll.dll\",0.0104,1.0145,0.0104,1.0145\n\"2E9BA\",\"2E9BA\",\"ntdll.dll\",0.0104,1.0137,0.0104,1.0137\n\"CFDA\",\"CFDA\",\"ntdll.dll\",0.0104,1.0134,0.0104,1.0134\n\"162354\",\"162354\",\"ntdll.dll\",0.0104,1.0131,0.0104,1.0131\n\"B7CC0\",\"B7CC0\",\"ntdll.dll\",0.0104,1.0130,0.0104,1.0130\n\"D0A5\",\"D0A5\",\"ntdll.dll\",0.0104,1.0128,0.0104,1.0128\n\"160364\",\"160364\",\"ntdll.dll\",0.0104,1.0115,0.0104,1.0115\n\"C15D\",\"C15D\",\"ntdll.dll\",0.0104,1.0092,0.0104,1.0092\n\"166300\",\"166300\",\"ntdll.dll\",0.0103,1.0082,0.0103,1.0082\n\"29AEB\",\"29AEB\",\"ntdll.dll\",0.0103,1.0082,0.0103,1.0082\n\"6CEE9\",\"6CEE9\",\"ntdll.dll\",0.0103,1.0064,0.0103,1.0064\n\"26B5B\",\"26B5B\",\"ntdll.dll\",0.0103,1.0058,0.0103,1.0058\n\"ADC3F\",\"ADC3F\",\"ntdll.dll\",0.0103,1.0054,0.0103,1.0054\n\"1300E9\",\"1300E9\",\"ntdll.dll\",0.0103,1.0043,0.0103,1.0043\n\"C563C\",\"C563C\",\"ntdll.dll\",0.0103,1.0040,0.0103,1.0040\n\"26B8D\",\"26B8D\",\"ntdll.dll\",0.0103,1.0038,0.0103,1.0038\n\"26B99\",\"26B99\",\"ntdll.dll\",0.0103,1.0036,0.0103,1.0036\n\"29052\",\"29052\",\"ntdll.dll\",0.0103,1.0036,0.0103,1.0036\n\"CFE3\",\"CFE3\",\"ntdll.dll\",0.0103,1.0036,0.0103,1.0036\n\"49D75\",\"49D75\",\"ntdll.dll\",0.0103,1.0035,0.0103,1.0035\n\"D163\",\"D163\",\"ntdll.dll\",0.0103,1.0032,0.0103,1.0032\n\"26BBC\",\"26BBC\",\"ntdll.dll\",0.0103,1.0031,0.0103,1.0031\n\"16083\",\"16083\",\"ntdll.dll\",0.0103,1.0028,0.0103,1.0028\n\"29068\",\"29068\",\"ntdll.dll\",0.0103,1.0028,0.0103,1.0028\n\"12FFB0\",\"12FFB0\",\"ntdll.dll\",0.0103,1.0027,0.0103,1.0027\n\"27473\",\"27473\",\"ntdll.dll\",0.0103,1.0027,0.0103,1.0027\n\"27580\",\"27580\",\"ntdll.dll\",0.0103,1.0027,0.0103,1.0027\n\"165665\",\"165665\",\"ntdll.dll\",0.0103,1.0023,0.0103,1.0023\n\"29AC3\",\"29AC3\",\"ntdll.dll\",0.0103,1.0019,0.0103,1.0019\n\"6F4D9\",\"6F4D9\",\"ntdll.dll\",0.0103,1.0018,0.0103,1.0018\n\"C775B\",\"C775B\",\"ntdll.dll\",0.0103,1.0018,0.0103,1.0018\n\"26BFF\",\"26BFF\",\"ntdll.dll\",0.0103,1.0015,0.0103,1.0015\n\"256D0\",\"256D0\",\"ntdll.dll\",0.0103,1.0013,0.0103,1.0013\n\"CF10\",\"CF10\",\"ntdll.dll\",0.0103,1.0013,0.0103,1.0013\n\"1663B0\",\"1663B0\",\"ntdll.dll\",0.0103,1.0012,0.0103,1.0012\n\"272DC\",\"272DC\",\"ntdll.dll\",0.0103,1.0010,0.0103,1.0010\n\"9253F\",\"9253F\",\"ntdll.dll\",0.0103,1.0010,0.0103,1.0010\n\"26BA0\",\"26BA0\",\"ntdll.dll\",0.0103,1.0008,0.0103,1.0008\n\"3BE1F\",\"3BE1F\",\"ntdll.dll\",0.0103,1.0007,0.0103,1.0007\n\"C9255\",\"C9255\",\"ntdll.dll\",0.0103,1.0007,0.0103,1.0007\n\"D072\",\"D072\",\"ntdll.dll\",0.0103,1.0006,0.0103,1.0006\n\"27215\",\"27215\",\"ntdll.dll\",0.0103,1.0005,0.0103,1.0005\n\"2CA15\",\"2CA15\",\"ntdll.dll\",0.0103,1.0005,0.0103,1.0005\n\"6BD58\",\"6BD58\",\"ntdll.dll\",0.0103,1.0003,0.0103,1.0003\n\"27588\",\"27588\",\"ntdll.dll\",0.0103,1.0002,0.0103,1.0002\n\"8FF90\",\"8FF90\",\"ntdll.dll\",0.0103,1.0002,0.0103,1.0002\n\"49D6F\",\"49D6F\",\"ntdll.dll\",0.0103,1.0000,0.0103,1.0000\n\"93ABB\",\"93ABB\",\"ntdll.dll\",0.0103,1.0000,0.0103,1.0000\n\"10343\",\"10343\",\"ntdll.dll\",0.0103,0.9998,0.0103,0.9998\n\"495A4\",\"495A4\",\"ntdll.dll\",0.0103,0.9997,0.0103,0.9997\n\"D075\",\"D075\",\"ntdll.dll\",0.0103,0.9997,0.0103,0.9997\n\"D0FE\",\"D0FE\",\"ntdll.dll\",0.0103,0.9995,0.0103,0.9995\n\"26B9C\",\"26B9C\",\"ntdll.dll\",0.0103,0.9994,0.0103,0.9994\n\"29063\",\"29063\",\"ntdll.dll\",0.0103,0.9992,0.0103,0.9992\n\"F9FA\",\"F9FA\",\"ntdll.dll\",0.0103,0.9992,0.0103,0.9992\n\"CF3A\",\"CF3A\",\"ntdll.dll\",0.0103,0.9989,0.0103,0.9989\n\"2731E\",\"2731E\",\"ntdll.dll\",0.0103,0.9988,0.0103,0.9988\n\"27A6B\",\"27A6B\",\"ntdll.dll\",0.0102,0.9984,0.0102,0.9984\n\"89CB0\",\"89CB0\",\"ntdll.dll\",0.0102,0.9981,0.0102,0.9981\n\"27219\",\"27219\",\"ntdll.dll\",0.0102,0.9979,0.0102,0.9979\n\"274E8\",\"274E8\",\"ntdll.dll\",0.0102,0.9978,0.0102,0.9978\n\"2905A\",\"2905A\",\"ntdll.dll\",0.0102,0.9978,0.0102,0.9978\n\"C1E4\",\"C1E4\",\"ntdll.dll\",0.0102,0.9978,0.0102,0.9978\n\"2728C\",\"2728C\",\"ntdll.dll\",0.0102,0.9977,0.0102,0.9977\n\"3B15B\",\"3B15B\",\"ntdll.dll\",0.0102,0.9976,0.0102,0.9976\n\"ADC1A\",\"ADC1A\",\"ntdll.dll\",0.0102,0.9976,0.0102,0.9976\n\"29AF2\",\"29AF2\",\"ntdll.dll\",0.0102,0.9975,0.0102,0.9975\n\"D9FF0\",\"D9FF0\",\"ntdll.dll\",0.0102,0.9975,0.0102,0.9975\n\"15FFA0\",\"15FFA0\",\"ntdll.dll\",0.0102,0.9974,0.0102,0.9974\n\"CF00\",\"CF00\",\"ntdll.dll\",0.0102,0.9974,0.0102,0.9974\n\"26B26\",\"26B26\",\"ntdll.dll\",0.0102,0.9973,0.0102,0.9973\n\"CFB5\",\"CFB5\",\"ntdll.dll\",0.0102,0.9973,0.0102,0.9973\n\"ADBA0\",\"ADBA0\",\"ntdll.dll\",0.0102,0.9972,0.0102,0.9972\n\"274D1\",\"274D1\",\"ntdll.dll\",0.0102,0.9969,0.0102,0.9969\n\"28346\",\"28346\",\"ntdll.dll\",0.0102,0.9969,0.0102,0.9969\n\"B8B00\",\"B8B00\",\"ntdll.dll\",0.0102,0.9969,0.0102,0.9969\n\"5A010\",\"5A010\",\"ntdll.dll\",0.0102,0.9967,0.0102,0.9967\n\"12E656\",\"12E656\",\"ntdll.dll\",0.0102,0.9966,0.0102,0.9966\n\"7045F\",\"7045F\",\"ntdll.dll\",0.0102,0.9965,0.0102,0.9965\n\"26B95\",\"26B95\",\"ntdll.dll\",0.0102,0.9963,0.0102,0.9963\n\"151476\",\"151476\",\"ntdll.dll\",0.0102,0.9960,0.0102,0.9960\n\"49F98\",\"49F98\",\"ntdll.dll\",0.0102,0.9958,0.0102,0.9958\n\"93700\",\"93700\",\"ntdll.dll\",0.0102,0.9958,0.0102,0.9958\n\"13D2F1\",\"13D2F1\",\"ntdll.dll\",0.0102,0.9957,0.0102,0.9957\n\"C9305\",\"C9305\",\"ntdll.dll\",0.0102,0.9956,0.0102,0.9956\n\"27325\",\"27325\",\"ntdll.dll\",0.0102,0.9955,0.0102,0.9955\n\"49F81\",\"49F81\",\"ntdll.dll\",0.0102,0.9953,0.0102,0.9953\n\"ADC6F\",\"ADC6F\",\"ntdll.dll\",0.0102,0.9951,0.0102,0.9951\n\"12E612\",\"12E612\",\"ntdll.dll\",0.0102,0.9949,0.0102,0.9949\n\"25689\",\"25689\",\"ntdll.dll\",0.0102,0.9949,0.0102,0.9949\n\"163AE3\",\"163AE3\",\"ntdll.dll\",0.0102,0.9940,0.0102,0.9940\n\"89670\",\"89670\",\"ntdll.dll\",0.0102,0.9938,0.0102,0.9938\n\"CF47\",\"CF47\",\"ntdll.dll\",0.0102,0.9938,0.0102,0.9938\n\"93BBC\",\"93BBC\",\"ntdll.dll\",0.0102,0.9932,0.0102,0.9932\n\"15FF58\",\"15FF58\",\"ntdll.dll\",0.0102,0.9930,0.0102,0.9930\n\"26D26\",\"26D26\",\"ntdll.dll\",0.0102,0.9930,0.0102,0.9930\n\"3BED6\",\"3BED6\",\"ntdll.dll\",0.0102,0.9929,0.0102,0.9929\n\"27269\",\"27269\",\"ntdll.dll\",0.0102,0.9927,0.0102,0.9927\n\"D108\",\"D108\",\"ntdll.dll\",0.0102,0.9927,0.0102,0.9927\n\"93B41\",\"93B41\",\"ntdll.dll\",0.0102,0.9925,0.0102,0.9925\n\"D002\",\"D002\",\"ntdll.dll\",0.0102,0.9920,0.0102,0.9920\n\"4B452\",\"4B452\",\"ntdll.dll\",0.0102,0.9917,0.0102,0.9917\n\"C161\",\"C161\",\"ntdll.dll\",0.0102,0.9917,0.0102,0.9917\n\"2906B\",\"2906B\",\"ntdll.dll\",0.0102,0.9914,0.0102,0.9914\n\"FD14\",\"FD14\",\"ntdll.dll\",0.0102,0.9914,0.0102,0.9914\n\"2749D\",\"2749D\",\"ntdll.dll\",0.0102,0.9912,0.0102,0.9912\n\"2906E\",\"2906E\",\"ntdll.dll\",0.0102,0.9912,0.0102,0.9912\n\"28350\",\"28350\",\"ntdll.dll\",0.0102,0.9909,0.0102,0.9909\n\"15FF30\",\"15FF30\",\"ntdll.dll\",0.0102,0.9906,0.0102,0.9906\n\"ADC1D\",\"ADC1D\",\"ntdll.dll\",0.0102,0.9904,0.0102,0.9904\n\"29053\",\"29053\",\"ntdll.dll\",0.0102,0.9902,0.0102,0.9902\n\"19BBD\",\"19BBD\",\"ntdll.dll\",0.0102,0.9899,0.0102,0.9899\n\"ADC62\",\"ADC62\",\"ntdll.dll\",0.0102,0.9899,0.0102,0.9899\n\"5A028\",\"5A028\",\"ntdll.dll\",0.0102,0.9894,0.0102,0.9894\n\"2720A\",\"2720A\",\"ntdll.dll\",0.0102,0.9890,0.0102,0.9890\n\"2720F\",\"2720F\",\"ntdll.dll\",0.0101,0.9889,0.0101,0.9889\n\"204D1\",\"204D1\",\"ntdll.dll\",0.0101,0.9885,0.0101,0.9885\n\"6D39A\",\"6D39A\",\"ntdll.dll\",0.0101,0.9884,0.0101,0.9884\n\"CF11\",\"CF11\",\"ntdll.dll\",0.0101,0.9884,0.0101,0.9884\n\"45360\",\"45360\",\"ntdll.dll\",0.0101,0.9881,0.0101,0.9881\n\"19500\",\"19500\",\"ntdll.dll\",0.0101,0.9879,0.0101,0.9879\n\"26B24\",\"26B24\",\"ntdll.dll\",0.0101,0.9863,0.0101,0.9863\n\"274CE\",\"274CE\",\"ntdll.dll\",0.0101,0.9863,0.0101,0.9863\n\"93AB0\",\"93AB0\",\"ntdll.dll\",0.0101,0.9863,0.0101,0.9863\n\"4AA2\",\"4AA2\",\"ntdll.dll\",0.0101,0.9861,0.0101,0.9861\n\"ADC29\",\"ADC29\",\"ntdll.dll\",0.0101,0.9857,0.0101,0.9857\n\"12F5BE\",\"12F5BE\",\"ntdll.dll\",0.0101,0.9846,0.0101,0.9846\n\"12E648\",\"12E648\",\"ntdll.dll\",0.0101,0.9845,0.0101,0.9845\n\"12FE9F\",\"12FE9F\",\"ntdll.dll\",0.0101,0.9839,0.0101,0.9839\n\"6E024\",\"6E024\",\"ntdll.dll\",0.0101,0.9838,0.0101,0.9838\n\"2C3D9\",\"2C3D9\",\"ntdll.dll\",0.0101,0.9822,0.0101,0.9822\n\"34132\",\"34132\",\"ntdll.dll\",0.0100,0.9699,0.0100,0.9699\n\"4AC43\",\"4AC43\",\"ntdll.dll\",0.0099,0.9661,0.0099,0.9661\n\"163B05\",\"163B05\",\"ntdll.dll\",0.0099,0.9653,0.0099,0.9653\n\"29ADA\",\"29ADA\",\"ntdll.dll\",0.0099,0.9598,5.0232,489.4176\n\"1994F\",\"1994F\",\"ntdll.dll\",0.0095,0.9266,0.0095,0.9266\n\"6E114\",\"6E114\",\"ntdll.dll\",0.0094,0.9187,0.0094,0.9187\n\"ADC59\",\"ADC59\",\"ntdll.dll\",0.0094,0.9146,0.0094,0.9146\n\"16636D\",\"16636D\",\"ntdll.dll\",0.0093,0.9045,0.0093,0.9045\n\"12F902\",\"12F902\",\"ntdll.dll\",0.0087,0.8460,0.0087,0.8460\n\"50780\",\"50780\",\"ntdll.dll\",0.0082,0.8034,0.0082,0.8034\n\"897CC\",\"897CC\",\"ntdll.dll\",0.0082,0.7973,0.0082,0.7973\n\"26D6C\",\"26D6C\",\"ntdll.dll\",0.0081,0.7884,0.0081,0.7884\n\"13CB66\",\"13CB66\",\"ntdll.dll\",0.0079,0.7668,0.0079,0.7668\n\"4E2C6\",\"4E2C6\",\"ntdll.dll\",0.0077,0.7546,0.0077,0.7546\n\"ADBD0\",\"ADBD0\",\"ntdll.dll\",0.0077,0.7476,0.0077,0.7476\n\"27419\",\"27419\",\"ntdll.dll\",0.0072,0.7044,0.0072,0.7044\n\"ADBEB\",\"ADBEB\",\"ntdll.dll\",0.0068,0.6620,0.0068,0.6620\n\"29066\",\"29066\",\"ntdll.dll\",0.0066,0.6431,0.0066,0.6431\n\"165604\",\"165604\",\"ntdll.dll\",0.0065,0.6314,0.0065,0.6314\n\"6D395\",\"6D395\",\"ntdll.dll\",0.0060,0.5820,0.0060,0.5820\n\"49D71\",\"49D71\",\"ntdll.dll\",0.0060,0.5815,0.0060,0.5815\n\"93B3A\",\"93B3A\",\"ntdll.dll\",0.0057,0.5538,0.0057,0.5538\n\"ADBBD\",\"ADBBD\",\"ntdll.dll\",0.0044,0.4280,0.0044,0.4280\n\"29ACC\",\"29ACC\",\"ntdll.dll\",0.0036,0.3520,0.0036,0.3520\n\"C6838\",\"C6838\",\"ntdll.dll\",0.0033,0.3184,0.0033,0.3184\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_ntoskrnl.exe_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"2DE679\",\"2DE679\",\"ntoskrnl.exe\",1.1227,109.3857,1.1227,109.3857\n\"C55ECC\",\"C55ECC\",\"ntoskrnl.exe\",0.4941,48.1401,0.4941,48.1401\n\"624533\",\"624533\",\"ntoskrnl.exe\",0.4337,42.2566,0.4337,42.2566\n\"C55B14\",\"C55B14\",\"ntoskrnl.exe\",0.2866,27.9243,0.2866,27.9243\n\"2DE690\",\"2DE690\",\"ntoskrnl.exe\",0.2498,24.3410,0.2498,24.3410\n\"2DE67E\",\"2DE67E\",\"ntoskrnl.exe\",0.2114,20.5996,0.2114,20.5996\n\"2DE677\",\"2DE677\",\"ntoskrnl.exe\",0.2061,20.0763,0.2061,20.0763\n\"2765CD\",\"2765CD\",\"ntoskrnl.exe\",0.2013,19.6085,0.2013,19.6085\n\"73FB18\",\"73FB18\",\"ntoskrnl.exe\",0.1922,18.7290,0.1922,18.7290\n\"2DE614\",\"2DE614\",\"ntoskrnl.exe\",0.1707,16.6343,0.1707,16.6343\n\"2DE681\",\"2DE681\",\"ntoskrnl.exe\",0.1629,15.8684,0.1629,15.8684\n\"626479\",\"626479\",\"ntoskrnl.exe\",0.1571,15.3042,0.1571,15.3042\n\"2DE65B\",\"2DE65B\",\"ntoskrnl.exe\",0.1505,14.6606,0.1505,14.6606\n\"2DE66A\",\"2DE66A\",\"ntoskrnl.exe\",0.1303,12.6999,0.1303,12.6999\n\"2DE699\",\"2DE699\",\"ntoskrnl.exe\",0.1288,12.5445,0.1288,12.5445\n\"2DE68E\",\"2DE68E\",\"ntoskrnl.exe\",0.1258,12.2552,0.1258,12.2552\n\"27B4EA\",\"27B4EA\",\"ntoskrnl.exe\",0.1257,12.2496,0.1257,12.2496\n\"271C15\",\"271C15\",\"ntoskrnl.exe\",0.0983,9.5800,0.0983,9.5800\n\"734D6A\",\"734D6A\",\"ntoskrnl.exe\",0.0941,9.1647,0.0941,9.1647\n\"624E98\",\"624E98\",\"ntoskrnl.exe\",0.0929,9.0551,0.0929,9.0551\n\"516692\",\"516692\",\"ntoskrnl.exe\",0.0927,9.0311,0.0927,9.0311\n\"2DE672\",\"2DE672\",\"ntoskrnl.exe\",0.0881,8.5824,0.0881,8.5824\n\"624317\",\"624317\",\"ntoskrnl.exe\",0.0850,8.2779,0.0850,8.2779\n\"2DB58C\",\"2DB58C\",\"ntoskrnl.exe\",0.0834,8.1232,0.0834,8.1232\n\"2DE686\",\"2DE686\",\"ntoskrnl.exe\",0.0833,8.1154,0.0833,8.1154\n\"2EC4BE\",\"2EC4BE\",\"ntoskrnl.exe\",0.0820,7.9908,0.0820,7.9908\n\"27D181\",\"27D181\",\"ntoskrnl.exe\",0.0787,7.6671,0.0787,7.6671\n\"2DB01E\",\"2DB01E\",\"ntoskrnl.exe\",0.0735,7.1638,0.0735,7.1638\n\"26F364\",\"26F364\",\"ntoskrnl.exe\",0.0727,7.0823,0.0727,7.0823\n\"8B6A30\",\"8B6A30\",\"ntoskrnl.exe\",0.0718,6.9935,0.0718,6.9935\n\"6242A3\",\"6242A3\",\"ntoskrnl.exe\",0.0698,6.8041,0.0698,6.8041\n\"27D187\",\"27D187\",\"ntoskrnl.exe\",0.0697,6.7940,0.0697,6.7940\n\"C55875\",\"C55875\",\"ntoskrnl.exe\",0.0697,6.7913,0.0697,6.7913\n\"73B512\",\"73B512\",\"ntoskrnl.exe\",0.0671,6.5349,0.0671,6.5349\n\"2DE619\",\"2DE619\",\"ntoskrnl.exe\",0.0667,6.4950,0.0667,6.4950\n\"2DE620\",\"2DE620\",\"ntoskrnl.exe\",0.0661,6.4449,0.0661,6.4449\n\"62446E\",\"62446E\",\"ntoskrnl.exe\",0.0658,6.4157,0.0658,6.4157\n\"62498D\",\"62498D\",\"ntoskrnl.exe\",0.0641,6.2498,0.0641,6.2498\n\"27D0F8\",\"27D0F8\",\"ntoskrnl.exe\",0.0636,6.1973,0.0636,6.1973\n\"2DB1B5\",\"2DB1B5\",\"ntoskrnl.exe\",0.0627,6.1059,0.0627,6.1059\n\"624E19\",\"624E19\",\"ntoskrnl.exe\",0.0618,6.0220,0.0618,6.0220\n\"2DE525\",\"2DE525\",\"ntoskrnl.exe\",0.0617,6.0138,0.0617,6.0138\n\"624E2B\",\"624E2B\",\"ntoskrnl.exe\",0.0617,6.0126,0.0617,6.0126\n\"627A2B\",\"627A2B\",\"ntoskrnl.exe\",0.0608,5.9198,0.0608,5.9198\n\"27D1E4\",\"27D1E4\",\"ntoskrnl.exe\",0.0603,5.8723,0.0603,5.8723\n\"624BDF\",\"624BDF\",\"ntoskrnl.exe\",0.0597,5.8184,0.0597,5.8184\n\"624284\",\"624284\",\"ntoskrnl.exe\",0.0594,5.7877,0.0594,5.7877\n\"3F0F66\",\"3F0F66\",\"ntoskrnl.exe\",0.0578,5.6360,0.0578,5.6360\n\"6244C8\",\"6244C8\",\"ntoskrnl.exe\",0.0563,5.4898,0.0563,5.4898\n\"401EEB\",\"401EEB\",\"ntoskrnl.exe\",0.0556,5.4195,0.0556,5.4195\n\"62452A\",\"62452A\",\"ntoskrnl.exe\",0.0554,5.3967,0.0554,5.3967\n\"6279FA\",\"6279FA\",\"ntoskrnl.exe\",0.0544,5.3044,0.0544,5.3044\n\"624466\",\"624466\",\"ntoskrnl.exe\",0.0539,5.2522,0.0539,5.2522\n\"6242B2\",\"6242B2\",\"ntoskrnl.exe\",0.0538,5.2451,0.0538,5.2451\n\"624E9C\",\"624E9C\",\"ntoskrnl.exe\",0.0523,5.0960,0.0523,5.0960\n\"627A24\",\"627A24\",\"ntoskrnl.exe\",0.0520,5.0687,0.0520,5.0687\n\"385917\",\"385917\",\"ntoskrnl.exe\",0.0517,5.0346,0.0517,5.0346\n\"C55ED6\",\"C55ED6\",\"ntoskrnl.exe\",0.0516,5.0236,0.0516,5.0236\n\"62436E\",\"62436E\",\"ntoskrnl.exe\",0.0515,5.0201,0.0515,5.0201\n\"624DE0\",\"624DE0\",\"ntoskrnl.exe\",0.0514,5.0103,0.0514,5.0103\n\"27D435\",\"27D435\",\"ntoskrnl.exe\",0.0514,5.0090,0.0514,5.0090\n\"C55BD1\",\"C55BD1\",\"ntoskrnl.exe\",0.0514,5.0054,0.0514,5.0054\n\"6244B3\",\"6244B3\",\"ntoskrnl.exe\",0.0513,4.9937,0.0513,4.9937\n\"2EDBB6\",\"2EDBB6\",\"ntoskrnl.exe\",0.0512,4.9860,0.0512,4.9860\n\"401EE3\",\"401EE3\",\"ntoskrnl.exe\",0.0510,4.9675,0.0510,4.9675\n\"6242F5\",\"6242F5\",\"ntoskrnl.exe\",0.0508,4.9513,0.0508,4.9513\n\"6244BB\",\"6244BB\",\"ntoskrnl.exe\",0.0498,4.8507,0.0498,4.8507\n\"20620A\",\"20620A\",\"ntoskrnl.exe\",0.0491,4.7831,0.0491,4.7831\n\"624515\",\"624515\",\"ntoskrnl.exe\",0.0490,4.7752,0.0490,4.7752\n\"C55E89\",\"C55E89\",\"ntoskrnl.exe\",0.0487,4.7404,0.0487,4.7404\n\"734E86\",\"734E86\",\"ntoskrnl.exe\",0.0470,4.5802,0.0470,4.5802\n\"624B9A\",\"624B9A\",\"ntoskrnl.exe\",0.0468,4.5633,0.0468,4.5633\n\"72E0FD\",\"72E0FD\",\"ntoskrnl.exe\",0.0468,4.5629,0.0468,4.5629\n\"6242D5\",\"6242D5\",\"ntoskrnl.exe\",0.0468,4.5551,0.0468,4.5551\n\"6242AB\",\"6242AB\",\"ntoskrnl.exe\",0.0467,4.5529,0.0467,4.5529\n\"62450A\",\"62450A\",\"ntoskrnl.exe\",0.0461,4.4937,0.0461,4.4937\n\"2DE664\",\"2DE664\",\"ntoskrnl.exe\",0.0459,4.4673,0.0459,4.4673\n\"2DE694\",\"2DE694\",\"ntoskrnl.exe\",0.0454,4.4261,0.0454,4.4261\n\"2DC182\",\"2DC182\",\"ntoskrnl.exe\",0.0453,4.4179,0.0453,4.4179\n\"6242C8\",\"6242C8\",\"ntoskrnl.exe\",0.0450,4.3820,0.0450,4.3820\n\"2DA9D5\",\"2DA9D5\",\"ntoskrnl.exe\",0.0434,4.2255,0.0434,4.2255\n\"6243D6\",\"6243D6\",\"ntoskrnl.exe\",0.0431,4.2001,0.0431,4.2001\n\"2DE660\",\"2DE660\",\"ntoskrnl.exe\",0.0423,4.1210,0.0423,4.1210\n\"62428F\",\"62428F\",\"ntoskrnl.exe\",0.0422,4.1147,0.0422,4.1147\n\"9DAC2E\",\"9DAC2E\",\"ntoskrnl.exe\",0.0419,4.0795,0.0419,4.0795\n\"625450\",\"625450\",\"ntoskrnl.exe\",0.0412,4.0168,0.0412,4.0168\n\"624BC8\",\"624BC8\",\"ntoskrnl.exe\",0.0411,4.0081,0.0411,4.0081\n\"27D131\",\"27D131\",\"ntoskrnl.exe\",0.0411,4.0079,0.0411,4.0079\n\"2DB1EE\",\"2DB1EE\",\"ntoskrnl.exe\",0.0411,4.0056,0.0411,4.0056\n\"2DE735\",\"2DE735\",\"ntoskrnl.exe\",0.0411,4.0055,0.0411,4.0055\n\"2DA1A5\",\"2DA1A5\",\"ntoskrnl.exe\",0.0411,4.0052,0.0411,4.0052\n\"624BFE\",\"624BFE\",\"ntoskrnl.exe\",0.0411,4.0000,0.0411,4.0000\n\"627981\",\"627981\",\"ntoskrnl.exe\",0.0411,4.0000,0.0411,4.0000\n\"73458F\",\"73458F\",\"ntoskrnl.exe\",0.0411,4.0000,0.0411,4.0000\n\"C55A91\",\"C55A91\",\"ntoskrnl.exe\",0.0411,4.0000,0.0411,4.0000\n\"2E932C\",\"2E932C\",\"ntoskrnl.exe\",0.0409,3.9856,0.0409,3.9856\n\"6243D1\",\"6243D1\",\"ntoskrnl.exe\",0.0393,3.8314,0.0393,3.8314\n\"2DE541\",\"2DE541\",\"ntoskrnl.exe\",0.0383,3.7352,0.0383,3.7352\n\"2DB56F\",\"2DB56F\",\"ntoskrnl.exe\",0.0379,3.6935,0.0379,3.6935\n\"8AA859\",\"8AA859\",\"ntoskrnl.exe\",0.0378,3.6804,0.0378,3.6804\n\"624E7F\",\"624E7F\",\"ntoskrnl.exe\",0.0373,3.6317,0.0373,3.6317\n\"C55B11\",\"C55B11\",\"ntoskrnl.exe\",0.0369,3.5950,0.0369,3.5950\n\"2DE61B\",\"2DE61B\",\"ntoskrnl.exe\",0.0367,3.5746,0.0367,3.5746\n\"6242BC\",\"6242BC\",\"ntoskrnl.exe\",0.0366,3.5682,0.0366,3.5682\n\"285422\",\"285422\",\"ntoskrnl.exe\",0.0352,3.4276,0.0352,3.4276\n\"384E0C\",\"384E0C\",\"ntoskrnl.exe\",0.0347,3.3785,0.0347,3.3785\n\"2DE667\",\"2DE667\",\"ntoskrnl.exe\",0.0346,3.3716,0.0346,3.3716\n\"2DB182\",\"2DB182\",\"ntoskrnl.exe\",0.0344,3.3505,0.0344,3.3505\n\"6242B9\",\"6242B9\",\"ntoskrnl.exe\",0.0338,3.2978,0.0338,3.2978\n\"62634F\",\"62634F\",\"ntoskrnl.exe\",0.0333,3.2463,0.0333,3.2463\n\"21354E\",\"21354E\",\"ntoskrnl.exe\",0.0331,3.2208,0.0331,3.2208\n\"6244B8\",\"6244B8\",\"ntoskrnl.exe\",0.0330,3.2104,0.0330,3.2104\n\"626340\",\"626340\",\"ntoskrnl.exe\",0.0328,3.1947,0.0328,3.1947\n\"62633C\",\"62633C\",\"ntoskrnl.exe\",0.0327,3.1841,0.0327,3.1841\n\"401EE9\",\"401EE9\",\"ntoskrnl.exe\",0.0323,3.1429,0.0323,3.1429\n\"2DB607\",\"2DB607\",\"ntoskrnl.exe\",0.0319,3.1099,0.0319,3.1099\n\"C55A93\",\"C55A93\",\"ntoskrnl.exe\",0.0316,3.0789,0.0316,3.0789\n\"624C08\",\"624C08\",\"ntoskrnl.exe\",0.0315,3.0738,0.0315,3.0738\n\"2DE630\",\"2DE630\",\"ntoskrnl.exe\",0.0315,3.0669,0.0315,3.0669\n\"624963\",\"624963\",\"ntoskrnl.exe\",0.0313,3.0475,0.0313,3.0475\n\"2DB246\",\"2DB246\",\"ntoskrnl.exe\",0.0312,3.0352,0.0312,3.0352\n\"6242AD\",\"6242AD\",\"ntoskrnl.exe\",0.0311,3.0345,0.0311,3.0345\n\"8B66EB\",\"8B66EB\",\"ntoskrnl.exe\",0.0309,3.0126,0.0309,3.0126\n\"2DE649\",\"2DE649\",\"ntoskrnl.exe\",0.0309,3.0067,0.0309,3.0067\n\"3D8BBE\",\"3D8BBE\",\"ntoskrnl.exe\",0.0309,3.0064,0.0309,3.0064\n\"2DB576\",\"2DB576\",\"ntoskrnl.exe\",0.0308,3.0057,0.0308,3.0057\n\"2DE7C0\",\"2DE7C0\",\"ntoskrnl.exe\",0.0308,3.0056,0.0308,3.0056\n\"624C4C\",\"624C4C\",\"ntoskrnl.exe\",0.0308,3.0054,0.0308,3.0054\n\"2DE59E\",\"2DE59E\",\"ntoskrnl.exe\",0.0308,3.0043,0.0308,3.0043\n\"28592B\",\"28592B\",\"ntoskrnl.exe\",0.0308,3.0040,0.0308,3.0040\n\"2D98DE\",\"2D98DE\",\"ntoskrnl.exe\",0.0308,3.0024,0.0308,3.0024\n\"516620\",\"516620\",\"ntoskrnl.exe\",0.0308,3.0015,0.0308,3.0015\n\"624A60\",\"624A60\",\"ntoskrnl.exe\",0.0308,2.9998,0.0308,2.9998\n\"C55BC0\",\"C55BC0\",\"ntoskrnl.exe\",0.0308,2.9985,0.0308,2.9985\n\"624B74\",\"624B74\",\"ntoskrnl.exe\",0.0308,2.9980,0.0308,2.9980\n\"6249F9\",\"6249F9\",\"ntoskrnl.exe\",0.0308,2.9968,0.0308,2.9968\n\"734E89\",\"734E89\",\"ntoskrnl.exe\",0.0307,2.9952,0.0307,2.9952\n\"73FB75\",\"73FB75\",\"ntoskrnl.exe\",0.0307,2.9945,0.0307,2.9945\n\"625339\",\"625339\",\"ntoskrnl.exe\",0.0307,2.9944,0.0307,2.9944\n\"624433\",\"624433\",\"ntoskrnl.exe\",0.0307,2.9904,0.0307,2.9904\n\"358E60\",\"358E60\",\"ntoskrnl.exe\",0.0307,2.9876,0.0307,2.9876\n\"8B694E\",\"8B694E\",\"ntoskrnl.exe\",0.0305,2.9758,0.0305,2.9758\n\"2EE549\",\"2EE549\",\"ntoskrnl.exe\",0.0305,2.9699,0.0305,2.9699\n\"2DA4F6\",\"2DA4F6\",\"ntoskrnl.exe\",0.0305,2.9683,0.0305,2.9683\n\"2DB195\",\"2DB195\",\"ntoskrnl.exe\",0.0297,2.8981,0.0297,2.8981\n\"3F0B8E\",\"3F0B8E\",\"ntoskrnl.exe\",0.0297,2.8897,0.0297,2.8897\n\"624DD8\",\"624DD8\",\"ntoskrnl.exe\",0.0295,2.8755,0.0295,2.8755\n\"624B11\",\"624B11\",\"ntoskrnl.exe\",0.0290,2.8277,0.0290,2.8277\n\"2406B6\",\"2406B6\",\"ntoskrnl.exe\",0.0290,2.8238,0.0290,2.8238\n\"626338\",\"626338\",\"ntoskrnl.exe\",0.0288,2.8077,0.0288,2.8077\n\"626EA1\",\"626EA1\",\"ntoskrnl.exe\",0.0285,2.7808,0.0285,2.7808\n\"2DE6BA\",\"2DE6BA\",\"ntoskrnl.exe\",0.0278,2.7061,0.0278,2.7061\n\"3E4F91\",\"3E4F91\",\"ntoskrnl.exe\",0.0274,2.6651,0.0274,2.6651\n\"624B53\",\"624B53\",\"ntoskrnl.exe\",0.0270,2.6293,0.0270,2.6293\n\"2DE12C\",\"2DE12C\",\"ntoskrnl.exe\",0.0268,2.6154,0.0268,2.6154\n\"3F0B92\",\"3F0B92\",\"ntoskrnl.exe\",0.0264,2.5740,0.0264,2.5740\n\"2DB22E\",\"2DB22E\",\"ntoskrnl.exe\",0.0263,2.5611,0.0263,2.5611\n\"2DE06C\",\"2DE06C\",\"ntoskrnl.exe\",0.0260,2.5334,0.0260,2.5334\n\"27D0EB\",\"27D0EB\",\"ntoskrnl.exe\",0.0258,2.5184,0.0258,2.5184\n\"62797C\",\"62797C\",\"ntoskrnl.exe\",0.0254,2.4752,0.0254,2.4752\n\"734743\",\"734743\",\"ntoskrnl.exe\",0.0247,2.4074,0.0247,2.4074\n\"317645\",\"317645\",\"ntoskrnl.exe\",0.0247,2.4039,0.0247,2.4039\n\"625330\",\"625330\",\"ntoskrnl.exe\",0.0239,2.3271,0.0239,2.3271\n\"624B36\",\"624B36\",\"ntoskrnl.exe\",0.0238,2.3217,0.0238,2.3217\n\"23EE17\",\"23EE17\",\"ntoskrnl.exe\",0.0237,2.3048,0.0237,2.3048\n\"624E3F\",\"624E3F\",\"ntoskrnl.exe\",0.0236,2.3021,0.0236,2.3021\n\"2DE609\",\"2DE609\",\"ntoskrnl.exe\",0.0233,2.2653,0.0233,2.2653\n\"2DE520\",\"2DE520\",\"ntoskrnl.exe\",0.0231,2.2472,0.0231,2.2472\n\"C55E92\",\"C55E92\",\"ntoskrnl.exe\",0.0230,2.2412,0.0230,2.2412\n\"624BF7\",\"624BF7\",\"ntoskrnl.exe\",0.0229,2.2305,0.0229,2.2305\n\"2DA1B2\",\"2DA1B2\",\"ntoskrnl.exe\",0.0228,2.2234,0.0228,2.2234\n\"625341\",\"625341\",\"ntoskrnl.exe\",0.0225,2.1882,0.0225,2.1882\n\"2DB257\",\"2DB257\",\"ntoskrnl.exe\",0.0223,2.1727,0.0223,2.1727\n\"2DE5C1\",\"2DE5C1\",\"ntoskrnl.exe\",0.0223,2.1682,0.0223,2.1682\n\"624A58\",\"624A58\",\"ntoskrnl.exe\",0.0216,2.1082,0.0216,2.1082\n\"428869\",\"428869\",\"ntoskrnl.exe\",0.0216,2.1044,0.0216,2.1044\n\"2DA1AA\",\"2DA1AA\",\"ntoskrnl.exe\",0.0216,2.1043,0.0216,2.1043\n\"2DE60D\",\"2DE60D\",\"ntoskrnl.exe\",0.0216,2.1026,0.0216,2.1026\n\"22E415\",\"22E415\",\"ntoskrnl.exe\",0.0215,2.0950,0.0215,2.0950\n\"2DB57A\",\"2DB57A\",\"ntoskrnl.exe\",0.0214,2.0819,0.0214,2.0819\n\"27AC40\",\"27AC40\",\"ntoskrnl.exe\",0.0213,2.0753,0.0213,2.0753\n\"2EE53E\",\"2EE53E\",\"ntoskrnl.exe\",0.0212,2.0655,0.0212,2.0655\n\"73402E\",\"73402E\",\"ntoskrnl.exe\",0.0210,2.0506,0.0210,2.0506\n\"72CB40\",\"72CB40\",\"ntoskrnl.exe\",0.0210,2.0454,0.0210,2.0454\n\"624990\",\"624990\",\"ntoskrnl.exe\",0.0210,2.0440,0.0210,2.0440\n\"2F3246\",\"2F3246\",\"ntoskrnl.exe\",0.0208,2.0303,0.0208,2.0303\n\"734DBE\",\"734DBE\",\"ntoskrnl.exe\",0.0208,2.0233,0.0208,2.0233\n\"3D8BB3\",\"3D8BB3\",\"ntoskrnl.exe\",0.0206,2.0102,0.0206,2.0102\n\"62445D\",\"62445D\",\"ntoskrnl.exe\",0.0206,2.0099,0.0206,2.0099\n\"2EC877\",\"2EC877\",\"ntoskrnl.exe\",0.0206,2.0077,0.0206,2.0077\n\"8B66DE\",\"8B66DE\",\"ntoskrnl.exe\",0.0206,2.0076,0.0206,2.0076\n\"3FF3F5\",\"3FF3F5\",\"ntoskrnl.exe\",0.0206,2.0028,0.0206,2.0028\n\"2DE652\",\"2DE652\",\"ntoskrnl.exe\",0.0206,2.0027,0.0206,2.0027\n\"516673\",\"516673\",\"ntoskrnl.exe\",0.0205,2.0018,0.0205,2.0018\n\"204614\",\"204614\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"206826\",\"206826\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"206C73\",\"206C73\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"20EC90\",\"20EC90\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"20ECA0\",\"20ECA0\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2109EB\",\"2109EB\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2129A2\",\"2129A2\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2141E6\",\"2141E6\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"216F5A\",\"216F5A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"220B3D\",\"220B3D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"22B788\",\"22B788\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"22E1AB\",\"22E1AB\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"22EA63\",\"22EA63\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"23EDE3\",\"23EDE3\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"242122\",\"242122\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"26184C\",\"26184C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"26E211\",\"26E211\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"26E649\",\"26E649\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"26F8DF\",\"26F8DF\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"26F994\",\"26F994\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"27118C\",\"27118C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"27659E\",\"27659E\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"276631\",\"276631\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"27A401\",\"27A401\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"27A73C\",\"27A73C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"27C00A\",\"27C00A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2814BF\",\"2814BF\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA1B0\",\"2DA1B0\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA201\",\"2DA201\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA21E\",\"2DA21E\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA280\",\"2DA280\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA2E9\",\"2DA2E9\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA72E\",\"2DA72E\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA850\",\"2DA850\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DA8D7\",\"2DA8D7\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DAEB2\",\"2DAEB2\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB178\",\"2DB178\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB17D\",\"2DB17D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB1A5\",\"2DB1A5\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB1AA\",\"2DB1AA\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB1D6\",\"2DB1D6\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB5D8\",\"2DB5D8\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB65C\",\"2DB65C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DB8FB\",\"2DB8FB\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DBE16\",\"2DBE16\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DBE3F\",\"2DBE3F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DBE5B\",\"2DBE5B\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DBF5B\",\"2DBF5B\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DDFB0\",\"2DDFB0\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE0AF\",\"2DE0AF\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE0B1\",\"2DE0B1\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE0C9\",\"2DE0C9\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE0CE\",\"2DE0CE\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE52F\",\"2DE52F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE530\",\"2DE530\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE53E\",\"2DE53E\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE546\",\"2DE546\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE5FD\",\"2DE5FD\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE6C3\",\"2DE6C3\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE73D\",\"2DE73D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE772\",\"2DE772\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE7AA\",\"2DE7AA\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DF976\",\"2DF976\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2EAAF8\",\"2EAAF8\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2EBE34\",\"2EBE34\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2EEFF3\",\"2EEFF3\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"316B93\",\"316B93\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"317C81\",\"317C81\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"318DE9\",\"318DE9\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3191A3\",\"3191A3\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3191E7\",\"3191E7\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3196B4\",\"3196B4\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3197A4\",\"3197A4\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"32817D\",\"32817D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"361930\",\"361930\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"38545D\",\"38545D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3858C4\",\"3858C4\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"38E551\",\"38E551\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3D8B81\",\"3D8B81\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3D8B8F\",\"3D8B8F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3F0E95\",\"3F0E95\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3FC2EC\",\"3FC2EC\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3FDD7C\",\"3FDD7C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"3FF3DD\",\"3FF3DD\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"401ED5\",\"401ED5\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"420800\",\"420800\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"42722D\",\"42722D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"437DF3\",\"437DF3\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"44AEE9\",\"44AEE9\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"458F02\",\"458F02\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"51665D\",\"51665D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"5166F7\",\"5166F7\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"51670B\",\"51670B\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"516750\",\"516750\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"516758\",\"516758\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"51675C\",\"51675C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"516764\",\"516764\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624277\",\"624277\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62429F\",\"62429F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"6243C0\",\"6243C0\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624469\",\"624469\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624669\",\"624669\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"6247D5\",\"6247D5\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"6248E5\",\"6248E5\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62495C\",\"62495C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62495F\",\"62495F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624A24\",\"624A24\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624A41\",\"624A41\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624BD0\",\"624BD0\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624C1A\",\"624C1A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624C29\",\"624C29\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624C55\",\"624C55\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624C58\",\"624C58\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"624CC4\",\"624CC4\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62530C\",\"62530C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"625484\",\"625484\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"626339\",\"626339\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62633A\",\"62633A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62656B\",\"62656B\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"626D16\",\"626D16\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"626F75\",\"626F75\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62705C\",\"62705C\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"627835\",\"627835\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62792A\",\"62792A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"62799F\",\"62799F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"627A04\",\"627A04\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"627A0A\",\"627A0A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"7308A4\",\"7308A4\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"734565\",\"734565\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"73460D\",\"73460D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"7415A0\",\"7415A0\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"74162A\",\"74162A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"741684\",\"741684\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"89B3C1\",\"89B3C1\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"8B2345\",\"8B2345\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"8B6A7B\",\"8B6A7B\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"8ED64E\",\"8ED64E\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"9DAC40\",\"9DAC40\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"9EACA9\",\"9EACA9\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"A26F10\",\"A26F10\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"A7533A\",\"A7533A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55880\",\"C55880\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55A8A\",\"C55A8A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55AD3\",\"C55AD3\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55B0A\",\"C55B0A\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55B0D\",\"C55B0D\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55BCA\",\"C55BCA\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55E8F\",\"C55E8F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55E9F\",\"C55E9F\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"C55EA9\",\"C55EA9\",\"ntoskrnl.exe\",0.0205,2.0000,0.0205,2.0000\n\"2DE083\",\"2DE083\",\"ntoskrnl.exe\",0.0205,1.9945,0.0205,1.9945\n\"27A94F\",\"27A94F\",\"ntoskrnl.exe\",0.0204,1.9924,0.0204,1.9924\n\"378296\",\"378296\",\"ntoskrnl.exe\",0.0204,1.9915,0.0204,1.9915\n\"8B6AAB\",\"8B6AAB\",\"ntoskrnl.exe\",0.0204,1.9914,0.0204,1.9914\n\"2EC4A6\",\"2EC4A6\",\"ntoskrnl.exe\",0.0204,1.9847,0.0204,1.9847\n\"9C5B4D\",\"9C5B4D\",\"ntoskrnl.exe\",0.0201,1.9616,0.0201,1.9616\n\"626C32\",\"626C32\",\"ntoskrnl.exe\",0.0201,1.9602,0.0201,1.9602\n\"2DB7FF\",\"2DB7FF\",\"ntoskrnl.exe\",0.0201,1.9570,0.0201,1.9570\n\"6279C0\",\"6279C0\",\"ntoskrnl.exe\",0.0201,1.9541,0.0201,1.9541\n\"2DA1C5\",\"2DA1C5\",\"ntoskrnl.exe\",0.0200,1.9490,0.0200,1.9490\n\"516623\",\"516623\",\"ntoskrnl.exe\",0.0200,1.9474,0.0200,1.9474\n\"6254AD\",\"6254AD\",\"ntoskrnl.exe\",0.0199,1.9376,0.0199,1.9376\n\"6254B7\",\"6254B7\",\"ntoskrnl.exe\",0.0198,1.9289,0.0198,1.9289\n\"6242E4\",\"6242E4\",\"ntoskrnl.exe\",0.0198,1.9282,0.0198,1.9282\n\"9F852A\",\"9F852A\",\"ntoskrnl.exe\",0.0196,1.9116,0.0196,1.9116\n\"2766C9\",\"2766C9\",\"ntoskrnl.exe\",0.0196,1.9094,0.0196,1.9094\n\"624D7D\",\"624D7D\",\"ntoskrnl.exe\",0.0189,1.8426,0.0189,1.8426\n\"225E8F\",\"225E8F\",\"ntoskrnl.exe\",0.0187,1.8266,0.0187,1.8266\n\"62432D\",\"62432D\",\"ntoskrnl.exe\",0.0187,1.8228,0.0187,1.8228\n\"3F0B7D\",\"3F0B7D\",\"ntoskrnl.exe\",0.0184,1.7974,0.0184,1.7974\n\"2409D2\",\"2409D2\",\"ntoskrnl.exe\",0.0184,1.7928,0.0184,1.7928\n\"27495C\",\"27495C\",\"ntoskrnl.exe\",0.0183,1.7815,0.0183,1.7815\n\"2DB26E\",\"2DB26E\",\"ntoskrnl.exe\",0.0183,1.7795,0.0183,1.7795\n\"626CC5\",\"626CC5\",\"ntoskrnl.exe\",0.0182,1.7708,0.0182,1.7708\n\"27664F\",\"27664F\",\"ntoskrnl.exe\",0.0180,1.7522,0.0180,1.7522\n\"2DB269\",\"2DB269\",\"ntoskrnl.exe\",0.0179,1.7437,0.0179,1.7437\n\"27D07D\",\"27D07D\",\"ntoskrnl.exe\",0.0179,1.7392,0.0179,1.7392\n\"417BA6\",\"417BA6\",\"ntoskrnl.exe\",0.0177,1.7220,0.0177,1.7220\n\"7349A4\",\"7349A4\",\"ntoskrnl.exe\",0.0175,1.7054,0.0175,1.7054\n\"624AE4\",\"624AE4\",\"ntoskrnl.exe\",0.0174,1.6993,0.0174,1.6993\n\"3F4E76\",\"3F4E76\",\"ntoskrnl.exe\",0.0174,1.6936,0.0174,1.6936\n\"624422\",\"624422\",\"ntoskrnl.exe\",0.0173,1.6869,0.0173,1.6869\n\"2D9816\",\"2D9816\",\"ntoskrnl.exe\",0.0172,1.6796,0.0172,1.6796\n\"23F09B\",\"23F09B\",\"ntoskrnl.exe\",0.0171,1.6654,0.0171,1.6654\n\"624C96\",\"624C96\",\"ntoskrnl.exe\",0.0170,1.6611,0.0170,1.6611\n\"624E36\",\"624E36\",\"ntoskrnl.exe\",0.0170,1.6589,0.0170,1.6589\n\"6279F8\",\"6279F8\",\"ntoskrnl.exe\",0.0168,1.6350,0.0168,1.6350\n\"8AA865\",\"8AA865\",\"ntoskrnl.exe\",0.0167,1.6309,0.0167,1.6309\n\"627A27\",\"627A27\",\"ntoskrnl.exe\",0.0167,1.6255,0.0167,1.6255\n\"624ABE\",\"624ABE\",\"ntoskrnl.exe\",0.0166,1.6205,0.0166,1.6205\n\"3D8D25\",\"3D8D25\",\"ntoskrnl.exe\",0.0163,1.5892,0.0163,1.5892\n\"2DE5C9\",\"2DE5C9\",\"ntoskrnl.exe\",0.0162,1.5763,0.0162,1.5763\n\"2147C9\",\"2147C9\",\"ntoskrnl.exe\",0.0161,1.5642,0.0161,1.5642\n\"260C33\",\"260C33\",\"ntoskrnl.exe\",0.0159,1.5480,0.0159,1.5480\n\"2DE628\",\"2DE628\",\"ntoskrnl.exe\",0.0158,1.5427,0.0158,1.5427\n\"22E498\",\"22E498\",\"ntoskrnl.exe\",0.0158,1.5352,0.0158,1.5352\n\"318E9B\",\"318E9B\",\"ntoskrnl.exe\",0.0157,1.5254,0.0157,1.5254\n\"3B5825\",\"3B5825\",\"ntoskrnl.exe\",0.0156,1.5195,0.0156,1.5195\n\"734747\",\"734747\",\"ntoskrnl.exe\",0.0156,1.5156,0.0156,1.5156\n\"624461\",\"624461\",\"ntoskrnl.exe\",0.0155,1.5136,0.0155,1.5136\n\"23F420\",\"23F420\",\"ntoskrnl.exe\",0.0154,1.5031,0.0154,1.5031\n\"206D13\",\"206D13\",\"ntoskrnl.exe\",0.0153,1.4919,0.0153,1.4919\n\"3F0ACA\",\"3F0ACA\",\"ntoskrnl.exe\",0.0152,1.4795,0.0152,1.4795\n\"627A0F\",\"627A0F\",\"ntoskrnl.exe\",0.0151,1.4746,0.0151,1.4746\n\"72CBBC\",\"72CBBC\",\"ntoskrnl.exe\",0.0150,1.4653,0.0150,1.4653\n\"8A0459\",\"8A0459\",\"ntoskrnl.exe\",0.0150,1.4602,0.0150,1.4602\n\"419292\",\"419292\",\"ntoskrnl.exe\",0.0150,1.4585,0.0150,1.4585\n\"3ACEA5\",\"3ACEA5\",\"ntoskrnl.exe\",0.0150,1.4573,0.0150,1.4573\n\"73466A\",\"73466A\",\"ntoskrnl.exe\",0.0149,1.4565,0.0149,1.4565\n\"6253C8\",\"6253C8\",\"ntoskrnl.exe\",0.0149,1.4537,0.0149,1.4537\n\"3197B2\",\"3197B2\",\"ntoskrnl.exe\",0.0149,1.4469,0.0149,1.4469\n\"2DE5D0\",\"2DE5D0\",\"ntoskrnl.exe\",0.0148,1.4458,0.0148,1.4458\n\"35AD7D\",\"35AD7D\",\"ntoskrnl.exe\",0.0148,1.4431,0.0148,1.4431\n\"624D6B\",\"624D6B\",\"ntoskrnl.exe\",0.0148,1.4418,0.0148,1.4418\n\"516627\",\"516627\",\"ntoskrnl.exe\",0.0148,1.4415,0.0148,1.4415\n\"3AA16F\",\"3AA16F\",\"ntoskrnl.exe\",0.0148,1.4408,0.0148,1.4408\n\"734D75\",\"734D75\",\"ntoskrnl.exe\",0.0147,1.4336,0.0147,1.4336\n\"8A614B\",\"8A614B\",\"ntoskrnl.exe\",0.0147,1.4302,0.0147,1.4302\n\"626EC1\",\"626EC1\",\"ntoskrnl.exe\",0.0146,1.4237,0.0146,1.4237\n\"23099C\",\"23099C\",\"ntoskrnl.exe\",0.0146,1.4184,0.0146,1.4184\n\"6254AA\",\"6254AA\",\"ntoskrnl.exe\",0.0145,1.4146,0.0145,1.4146\n\"75498A\",\"75498A\",\"ntoskrnl.exe\",0.0144,1.4065,0.0144,1.4065\n\"32822A\",\"32822A\",\"ntoskrnl.exe\",0.0144,1.4020,0.0144,1.4020\n\"47CB95\",\"47CB95\",\"ntoskrnl.exe\",0.0142,1.3845,0.0142,1.3845\n\"62645C\",\"62645C\",\"ntoskrnl.exe\",0.0141,1.3718,0.0141,1.3718\n\"206F2D\",\"206F2D\",\"ntoskrnl.exe\",0.0140,1.3624,0.0140,1.3624\n\"2127B0\",\"2127B0\",\"ntoskrnl.exe\",0.0139,1.3556,0.0139,1.3556\n\"44AE65\",\"44AE65\",\"ntoskrnl.exe\",0.0137,1.3356,0.0137,1.3356\n\"2E64B3\",\"2E64B3\",\"ntoskrnl.exe\",0.0136,1.3243,0.0136,1.3243\n\"38EE9D\",\"38EE9D\",\"ntoskrnl.exe\",0.0136,1.3233,0.0136,1.3233\n\"276683\",\"276683\",\"ntoskrnl.exe\",0.0136,1.3216,0.0136,1.3216\n\"3F0AD2\",\"3F0AD2\",\"ntoskrnl.exe\",0.0134,1.3052,0.0134,1.3052\n\"2DE53A\",\"2DE53A\",\"ntoskrnl.exe\",0.0134,1.3032,0.0134,1.3032\n\"21AE0E\",\"21AE0E\",\"ntoskrnl.exe\",0.0134,1.3011,0.0134,1.3011\n\"2D0FF5\",\"2D0FF5\",\"ntoskrnl.exe\",0.0133,1.2973,0.0133,1.2973\n\"23CCE5\",\"23CCE5\",\"ntoskrnl.exe\",0.0132,1.2883,0.0132,1.2883\n\"275158\",\"275158\",\"ntoskrnl.exe\",0.0131,1.2806,0.0131,1.2806\n\"27D19E\",\"27D19E\",\"ntoskrnl.exe\",0.0130,1.2674,0.0130,1.2674\n\"626EAD\",\"626EAD\",\"ntoskrnl.exe\",0.0129,1.2569,0.0129,1.2569\n\"319508\",\"319508\",\"ntoskrnl.exe\",0.0129,1.2566,0.0129,1.2566\n\"626C48\",\"626C48\",\"ntoskrnl.exe\",0.0129,1.2566,0.0129,1.2566\n\"2DE5D7\",\"2DE5D7\",\"ntoskrnl.exe\",0.0128,1.2505,0.0128,1.2505\n\"3233DA\",\"3233DA\",\"ntoskrnl.exe\",0.0127,1.2407,0.0127,1.2407\n\"754A5D\",\"754A5D\",\"ntoskrnl.exe\",0.0126,1.2258,0.0126,1.2258\n\"62793D\",\"62793D\",\"ntoskrnl.exe\",0.0126,1.2233,0.0126,1.2233\n\"2DE5A1\",\"2DE5A1\",\"ntoskrnl.exe\",0.0125,1.2214,0.0125,1.2214\n\"417C77\",\"417C77\",\"ntoskrnl.exe\",0.0125,1.2196,0.0125,1.2196\n\"31769C\",\"31769C\",\"ntoskrnl.exe\",0.0124,1.2116,0.0124,1.2116\n\"35EF07\",\"35EF07\",\"ntoskrnl.exe\",0.0124,1.2049,0.0124,1.2049\n\"269A4F\",\"269A4F\",\"ntoskrnl.exe\",0.0123,1.1949,0.0123,1.1949\n\"38E564\",\"38E564\",\"ntoskrnl.exe\",0.0122,1.1887,0.0122,1.1887\n\"2DBE88\",\"2DBE88\",\"ntoskrnl.exe\",0.0122,1.1864,0.0122,1.1864\n\"626E80\",\"626E80\",\"ntoskrnl.exe\",0.0121,1.1760,0.0121,1.1760\n\"277FFD\",\"277FFD\",\"ntoskrnl.exe\",0.0120,1.1718,0.0120,1.1718\n\"62452F\",\"62452F\",\"ntoskrnl.exe\",0.0119,1.1629,0.0119,1.1629\n\"624C5C\",\"624C5C\",\"ntoskrnl.exe\",0.0118,1.1472,0.0118,1.1472\n\"626472\",\"626472\",\"ntoskrnl.exe\",0.0117,1.1428,0.0117,1.1428\n\"211E09\",\"211E09\",\"ntoskrnl.exe\",0.0117,1.1422,0.0117,1.1422\n\"2F3622\",\"2F3622\",\"ntoskrnl.exe\",0.0114,1.1132,0.0114,1.1132\n\"38EF01\",\"38EF01\",\"ntoskrnl.exe\",0.0114,1.1113,0.0114,1.1113\n\"6244AA\",\"6244AA\",\"ntoskrnl.exe\",0.0114,1.1113,0.0114,1.1113\n\"2DB24E\",\"2DB24E\",\"ntoskrnl.exe\",0.0112,1.0952,0.0112,1.0952\n\"26DA42\",\"26DA42\",\"ntoskrnl.exe\",0.0112,1.0891,0.0112,1.0891\n\"624369\",\"624369\",\"ntoskrnl.exe\",0.0110,1.0747,0.0110,1.0747\n\"2EB18D\",\"2EB18D\",\"ntoskrnl.exe\",0.0110,1.0722,0.0110,1.0722\n\"62647D\",\"62647D\",\"ntoskrnl.exe\",0.0110,1.0717,0.0110,1.0717\n\"625406\",\"625406\",\"ntoskrnl.exe\",0.0110,1.0715,0.0110,1.0715\n\"26E50B\",\"26E50B\",\"ntoskrnl.exe\",0.0109,1.0661,0.0109,1.0661\n\"624AC4\",\"624AC4\",\"ntoskrnl.exe\",0.0109,1.0656,0.0109,1.0656\n\"2DE0B8\",\"2DE0B8\",\"ntoskrnl.exe\",0.0109,1.0635,0.0109,1.0635\n\"2DE6B2\",\"2DE6B2\",\"ntoskrnl.exe\",0.0109,1.0625,0.0109,1.0625\n\"4230D5\",\"4230D5\",\"ntoskrnl.exe\",0.0109,1.0596,0.0109,1.0596\n\"73460B\",\"73460B\",\"ntoskrnl.exe\",0.0109,1.0588,0.0109,1.0588\n\"624AB1\",\"624AB1\",\"ntoskrnl.exe\",0.0109,1.0578,0.0109,1.0578\n\"3A9546\",\"3A9546\",\"ntoskrnl.exe\",0.0108,1.0524,0.0108,1.0524\n\"3E4FA1\",\"3E4FA1\",\"ntoskrnl.exe\",0.0107,1.0460,0.0107,1.0460\n\"27B4B6\",\"27B4B6\",\"ntoskrnl.exe\",0.0107,1.0434,0.0107,1.0434\n\"22E369\",\"22E369\",\"ntoskrnl.exe\",0.0107,1.0393,0.0107,1.0393\n\"2DB6DC\",\"2DB6DC\",\"ntoskrnl.exe\",0.0106,1.0375,0.0106,1.0375\n\"27D165\",\"27D165\",\"ntoskrnl.exe\",0.0106,1.0310,0.0106,1.0310\n\"2DBF42\",\"2DBF42\",\"ntoskrnl.exe\",0.0106,1.0285,0.0106,1.0285\n\"4535EB\",\"4535EB\",\"ntoskrnl.exe\",0.0106,1.0280,0.0106,1.0280\n\"2858AD\",\"2858AD\",\"ntoskrnl.exe\",0.0105,1.0270,0.0105,1.0270\n\"2EB5ED\",\"2EB5ED\",\"ntoskrnl.exe\",0.0105,1.0268,0.0105,1.0268\n\"741693\",\"741693\",\"ntoskrnl.exe\",0.0105,1.0268,0.0105,1.0268\n\"2B7678\",\"2B7678\",\"ntoskrnl.exe\",0.0105,1.0259,0.0105,1.0259\n\"2E1439\",\"2E1439\",\"ntoskrnl.exe\",0.0105,1.0254,0.0105,1.0254\n\"2690E2\",\"2690E2\",\"ntoskrnl.exe\",0.0105,1.0242,0.0105,1.0242\n\"2DBA1F\",\"2DBA1F\",\"ntoskrnl.exe\",0.0105,1.0204,0.0105,1.0204\n\"624A9E\",\"624A9E\",\"ntoskrnl.exe\",0.0105,1.0202,0.0105,1.0202\n\"404468\",\"404468\",\"ntoskrnl.exe\",0.0105,1.0193,0.0105,1.0193\n\"2EDBF5\",\"2EDBF5\",\"ntoskrnl.exe\",0.0104,1.0180,0.0104,1.0180\n\"3BE20D\",\"3BE20D\",\"ntoskrnl.exe\",0.0104,1.0157,0.0104,1.0157\n\"3AB8A8\",\"3AB8A8\",\"ntoskrnl.exe\",0.0104,1.0154,0.0104,1.0154\n\"2DC18A\",\"2DC18A\",\"ntoskrnl.exe\",0.0104,1.0147,0.0104,1.0147\n\"2E65EF\",\"2E65EF\",\"ntoskrnl.exe\",0.0104,1.0147,0.0104,1.0147\n\"270C38\",\"270C38\",\"ntoskrnl.exe\",0.0104,1.0146,0.0104,1.0146\n\"2F528D\",\"2F528D\",\"ntoskrnl.exe\",0.0104,1.0143,0.0104,1.0143\n\"624328\",\"624328\",\"ntoskrnl.exe\",0.0104,1.0142,0.0104,1.0142\n\"318EA4\",\"318EA4\",\"ntoskrnl.exe\",0.0104,1.0141,0.0104,1.0141\n\"2DB1DA\",\"2DB1DA\",\"ntoskrnl.exe\",0.0104,1.0139,0.0104,1.0139\n\"2A6DC2\",\"2A6DC2\",\"ntoskrnl.exe\",0.0104,1.0138,0.0104,1.0138\n\"2F85BA\",\"2F85BA\",\"ntoskrnl.exe\",0.0104,1.0137,0.0104,1.0137\n\"3E5168\",\"3E5168\",\"ntoskrnl.exe\",0.0104,1.0136,0.0104,1.0136\n\"22D210\",\"22D210\",\"ntoskrnl.exe\",0.0104,1.0133,0.0104,1.0133\n\"2EA325\",\"2EA325\",\"ntoskrnl.exe\",0.0104,1.0131,0.0104,1.0131\n\"385D5D\",\"385D5D\",\"ntoskrnl.exe\",0.0104,1.0130,0.0104,1.0130\n\"324D5B\",\"324D5B\",\"ntoskrnl.exe\",0.0104,1.0126,0.0104,1.0126\n\"2DA1F6\",\"2DA1F6\",\"ntoskrnl.exe\",0.0104,1.0123,0.0104,1.0123\n\"9DAC51\",\"9DAC51\",\"ntoskrnl.exe\",0.0104,1.0123,0.0104,1.0123\n\"2E6808\",\"2E6808\",\"ntoskrnl.exe\",0.0104,1.0120,0.0104,1.0120\n\"3E4AF7\",\"3E4AF7\",\"ntoskrnl.exe\",0.0104,1.0118,0.0104,1.0118\n\"51F32B\",\"51F32B\",\"ntoskrnl.exe\",0.0104,1.0118,0.0104,1.0118\n\"734723\",\"734723\",\"ntoskrnl.exe\",0.0104,1.0118,0.0104,1.0118\n\"324D11\",\"324D11\",\"ntoskrnl.exe\",0.0104,1.0114,0.0104,1.0114\n\"6242CB\",\"6242CB\",\"ntoskrnl.exe\",0.0104,1.0110,0.0104,1.0110\n\"26081E\",\"26081E\",\"ntoskrnl.exe\",0.0104,1.0102,0.0104,1.0102\n\"3781DD\",\"3781DD\",\"ntoskrnl.exe\",0.0104,1.0102,0.0104,1.0102\n\"8A566C\",\"8A566C\",\"ntoskrnl.exe\",0.0104,1.0102,0.0104,1.0102\n\"8F2CDB\",\"8F2CDB\",\"ntoskrnl.exe\",0.0104,1.0101,0.0104,1.0101\n\"3A15FC\",\"3A15FC\",\"ntoskrnl.exe\",0.0104,1.0099,0.0104,1.0099\n\"7416C8\",\"7416C8\",\"ntoskrnl.exe\",0.0104,1.0095,0.0104,1.0095\n\"3782EA\",\"3782EA\",\"ntoskrnl.exe\",0.0104,1.0092,0.0104,1.0092\n\"229038\",\"229038\",\"ntoskrnl.exe\",0.0104,1.0086,0.0104,1.0086\n\"22EF4A\",\"22EF4A\",\"ntoskrnl.exe\",0.0103,1.0077,0.0103,1.0077\n\"2DE612\",\"2DE612\",\"ntoskrnl.exe\",0.0103,1.0077,0.0103,1.0077\n\"2DB014\",\"2DB014\",\"ntoskrnl.exe\",0.0103,1.0076,0.0103,1.0076\n\"43CCA9\",\"43CCA9\",\"ntoskrnl.exe\",0.0103,1.0074,0.0103,1.0074\n\"624A9B\",\"624A9B\",\"ntoskrnl.exe\",0.0103,1.0074,0.0103,1.0074\n\"9F8538\",\"9F8538\",\"ntoskrnl.exe\",0.0103,1.0072,0.0103,1.0072\n\"204A3A\",\"204A3A\",\"ntoskrnl.exe\",0.0103,1.0070,0.0103,1.0070\n\"62632D\",\"62632D\",\"ntoskrnl.exe\",0.0103,1.0070,0.0103,1.0070\n\"205732\",\"205732\",\"ntoskrnl.exe\",0.0103,1.0069,0.0103,1.0069\n\"220C07\",\"220C07\",\"ntoskrnl.exe\",0.0103,1.0069,0.0103,1.0069\n\"516685\",\"516685\",\"ntoskrnl.exe\",0.0103,1.0069,0.0103,1.0069\n\"27D0DD\",\"27D0DD\",\"ntoskrnl.exe\",0.0103,1.0067,0.0103,1.0067\n\"624C0D\",\"624C0D\",\"ntoskrnl.exe\",0.0103,1.0067,0.0103,1.0067\n\"3FD851\",\"3FD851\",\"ntoskrnl.exe\",0.0103,1.0066,0.0103,1.0066\n\"2DA1CA\",\"2DA1CA\",\"ntoskrnl.exe\",0.0103,1.0061,0.0103,1.0061\n\"B72B8A\",\"B72B8A\",\"ntoskrnl.exe\",0.0103,1.0059,0.0103,1.0059\n\"212801\",\"212801\",\"ntoskrnl.exe\",0.0103,1.0057,0.0103,1.0057\n\"247AEC\",\"247AEC\",\"ntoskrnl.exe\",0.0103,1.0057,0.0103,1.0057\n\"2A6DB9\",\"2A6DB9\",\"ntoskrnl.exe\",0.0103,1.0054,0.0103,1.0054\n\"2DE762\",\"2DE762\",\"ntoskrnl.exe\",0.0103,1.0051,0.0103,1.0051\n\"624E32\",\"624E32\",\"ntoskrnl.exe\",0.0103,1.0051,0.0103,1.0051\n\"627823\",\"627823\",\"ntoskrnl.exe\",0.0103,1.0051,0.0103,1.0051\n\"627059\",\"627059\",\"ntoskrnl.exe\",0.0103,1.0047,0.0103,1.0047\n\"32359E\",\"32359E\",\"ntoskrnl.exe\",0.0103,1.0046,0.0103,1.0046\n\"277436\",\"277436\",\"ntoskrnl.exe\",0.0103,1.0044,0.0103,1.0044\n\"2EC4DA\",\"2EC4DA\",\"ntoskrnl.exe\",0.0103,1.0044,0.0103,1.0044\n\"734DA0\",\"734DA0\",\"ntoskrnl.exe\",0.0103,1.0044,0.0103,1.0044\n\"27D47C\",\"27D47C\",\"ntoskrnl.exe\",0.0103,1.0043,0.0103,1.0043\n\"2EE4F5\",\"2EE4F5\",\"ntoskrnl.exe\",0.0103,1.0043,0.0103,1.0043\n\"3FDD8C\",\"3FDD8C\",\"ntoskrnl.exe\",0.0103,1.0043,0.0103,1.0043\n\"40D881\",\"40D881\",\"ntoskrnl.exe\",0.0103,1.0042,0.0103,1.0042\n\"624DF4\",\"624DF4\",\"ntoskrnl.exe\",0.0103,1.0042,0.0103,1.0042\n\"2A53D7\",\"2A53D7\",\"ntoskrnl.exe\",0.0103,1.0041,0.0103,1.0041\n\"351B80\",\"351B80\",\"ntoskrnl.exe\",0.0103,1.0041,0.0103,1.0041\n\"516731\",\"516731\",\"ntoskrnl.exe\",0.0103,1.0041,0.0103,1.0041\n\"2C536F\",\"2C536F\",\"ntoskrnl.exe\",0.0103,1.0038,0.0103,1.0038\n\"230FDF\",\"230FDF\",\"ntoskrnl.exe\",0.0103,1.0036,0.0103,1.0036\n\"2B6921\",\"2B6921\",\"ntoskrnl.exe\",0.0103,1.0036,0.0103,1.0036\n\"3F0E5D\",\"3F0E5D\",\"ntoskrnl.exe\",0.0103,1.0035,0.0103,1.0035\n\"2DE66E\",\"2DE66E\",\"ntoskrnl.exe\",0.0103,1.0034,0.0103,1.0034\n\"4481A1\",\"4481A1\",\"ntoskrnl.exe\",0.0103,1.0032,0.0103,1.0032\n\"37829C\",\"37829C\",\"ntoskrnl.exe\",0.0103,1.0031,0.0103,1.0031\n\"42C1D3\",\"42C1D3\",\"ntoskrnl.exe\",0.0103,1.0031,0.0103,1.0031\n\"51DF3A\",\"51DF3A\",\"ntoskrnl.exe\",0.0103,1.0030,0.0103,1.0030\n\"2DE79E\",\"2DE79E\",\"ntoskrnl.exe\",0.0103,1.0028,0.0103,1.0028\n\"318E06\",\"318E06\",\"ntoskrnl.exe\",0.0103,1.0028,0.0103,1.0028\n\"626D6B\",\"626D6B\",\"ntoskrnl.exe\",0.0103,1.0028,0.0103,1.0028\n\"2E65D4\",\"2E65D4\",\"ntoskrnl.exe\",0.0103,1.0027,0.0103,1.0027\n\"2EC789\",\"2EC789\",\"ntoskrnl.exe\",0.0103,1.0027,0.0103,1.0027\n\"733EF9\",\"733EF9\",\"ntoskrnl.exe\",0.0103,1.0025,0.0103,1.0025\n\"21E808\",\"21E808\",\"ntoskrnl.exe\",0.0103,1.0023,0.0103,1.0023\n\"625400\",\"625400\",\"ntoskrnl.exe\",0.0103,1.0023,0.0103,1.0023\n\"3F0D05\",\"3F0D05\",\"ntoskrnl.exe\",0.0103,1.0022,0.0103,1.0022\n\"51662B\",\"51662B\",\"ntoskrnl.exe\",0.0103,1.0020,0.0103,1.0020\n\"625334\",\"625334\",\"ntoskrnl.exe\",0.0103,1.0020,0.0103,1.0020\n\"2F31E7\",\"2F31E7\",\"ntoskrnl.exe\",0.0103,1.0018,0.0103,1.0018\n\"277DFA\",\"277DFA\",\"ntoskrnl.exe\",0.0103,1.0017,0.0103,1.0017\n\"2DAC84\",\"2DAC84\",\"ntoskrnl.exe\",0.0103,1.0015,0.0103,1.0015\n\"2EC47F\",\"2EC47F\",\"ntoskrnl.exe\",0.0103,1.0015,0.0103,1.0015\n\"2402F6\",\"2402F6\",\"ntoskrnl.exe\",0.0103,1.0012,0.0103,1.0012\n\"73FCF5\",\"73FCF5\",\"ntoskrnl.exe\",0.0103,1.0010,0.0103,1.0010\n\"2E63E6\",\"2E63E6\",\"ntoskrnl.exe\",0.0103,1.0007,0.0103,1.0007\n\"2EDB81\",\"2EDB81\",\"ntoskrnl.exe\",0.0103,1.0005,0.0103,1.0005\n\"3F0B4C\",\"3F0B4C\",\"ntoskrnl.exe\",0.0103,1.0004,0.0103,1.0004\n\"205875\",\"205875\",\"ntoskrnl.exe\",0.0103,1.0002,0.0103,1.0002\n\"2EC476\",\"2EC476\",\"ntoskrnl.exe\",0.0103,1.0002,0.0103,1.0002\n\"9EACEF\",\"9EACEF\",\"ntoskrnl.exe\",0.0103,1.0000,0.0103,1.0000\n\"2DBECA\",\"2DBECA\",\"ntoskrnl.exe\",0.0103,0.9999,0.0103,0.9999\n\"8B6B6E\",\"8B6B6E\",\"ntoskrnl.exe\",0.0103,0.9997,0.0103,0.9997\n\"9505B6\",\"9505B6\",\"ntoskrnl.exe\",0.0103,0.9997,0.0103,0.9997\n\"358DF2\",\"358DF2\",\"ntoskrnl.exe\",0.0103,0.9996,0.0103,0.9996\n\"627061\",\"627061\",\"ntoskrnl.exe\",0.0103,0.9994,0.0103,0.9994\n\"2E38DF\",\"2E38DF\",\"ntoskrnl.exe\",0.0103,0.9993,0.0103,0.9993\n\"2EC42E\",\"2EC42E\",\"ntoskrnl.exe\",0.0103,0.9992,0.0103,0.9992\n\"2EDBBD\",\"2EDBBD\",\"ntoskrnl.exe\",0.0103,0.9992,0.0103,0.9992\n\"2DE069\",\"2DE069\",\"ntoskrnl.exe\",0.0103,0.9988,0.0103,0.9988\n\"3256AE\",\"3256AE\",\"ntoskrnl.exe\",0.0102,0.9984,0.0102,0.9984\n\"9C88E5\",\"9C88E5\",\"ntoskrnl.exe\",0.0102,0.9983,0.0102,0.9983\n\"8B67C6\",\"8B67C6\",\"ntoskrnl.exe\",0.0102,0.9982,0.0102,0.9982\n\"734D93\",\"734D93\",\"ntoskrnl.exe\",0.0102,0.9981,0.0102,0.9981\n\"8B6BD2\",\"8B6BD2\",\"ntoskrnl.exe\",0.0102,0.9981,0.0102,0.9981\n\"32BD7A\",\"32BD7A\",\"ntoskrnl.exe\",0.0102,0.9980,0.0102,0.9980\n\"3FA436\",\"3FA436\",\"ntoskrnl.exe\",0.0102,0.9980,0.0102,0.9980\n\"429CA3\",\"429CA3\",\"ntoskrnl.exe\",0.0102,0.9979,0.0102,0.9979\n\"8B677D\",\"8B677D\",\"ntoskrnl.exe\",0.0102,0.9979,0.0102,0.9979\n\"9B7098\",\"9B7098\",\"ntoskrnl.exe\",0.0102,0.9974,0.0102,0.9974\n\"9EAD00\",\"9EAD00\",\"ntoskrnl.exe\",0.0102,0.9974,0.0102,0.9974\n\"32551B\",\"32551B\",\"ntoskrnl.exe\",0.0102,0.9971,0.0102,0.9971\n\"247A8D\",\"247A8D\",\"ntoskrnl.exe\",0.0102,0.9970,0.0102,0.9970\n\"C55EAF\",\"C55EAF\",\"ntoskrnl.exe\",0.0102,0.9970,0.0102,0.9970\n\"8B69E3\",\"8B69E3\",\"ntoskrnl.exe\",0.0102,0.9969,0.0102,0.9969\n\"2DB205\",\"2DB205\",\"ntoskrnl.exe\",0.0102,0.9965,0.0102,0.9965\n\"9505BD\",\"9505BD\",\"ntoskrnl.exe\",0.0102,0.9962,0.0102,0.9962\n\"2B687E\",\"2B687E\",\"ntoskrnl.exe\",0.0102,0.9958,0.0102,0.9958\n\"C4E311\",\"C4E311\",\"ntoskrnl.exe\",0.0102,0.9953,0.0102,0.9953\n\"337266\",\"337266\",\"ntoskrnl.exe\",0.0102,0.9946,0.0102,0.9946\n\"8A563F\",\"8A563F\",\"ntoskrnl.exe\",0.0102,0.9946,0.0102,0.9946\n\"22EE3F\",\"22EE3F\",\"ntoskrnl.exe\",0.0102,0.9945,0.0102,0.9945\n\"C4EB24\",\"C4EB24\",\"ntoskrnl.exe\",0.0102,0.9940,0.0102,0.9940\n\"27B82E\",\"27B82E\",\"ntoskrnl.exe\",0.0102,0.9932,0.0102,0.9932\n\"353EBD\",\"353EBD\",\"ntoskrnl.exe\",0.0102,0.9930,0.0102,0.9930\n\"35197E\",\"35197E\",\"ntoskrnl.exe\",0.0102,0.9925,0.0102,0.9925\n\"2090FB\",\"2090FB\",\"ntoskrnl.exe\",0.0102,0.9920,0.0102,0.9920\n\"2B5ED0\",\"2B5ED0\",\"ntoskrnl.exe\",0.0102,0.9917,0.0102,0.9917\n\"2C559A\",\"2C559A\",\"ntoskrnl.exe\",0.0102,0.9916,0.0102,0.9916\n\"7415E8\",\"7415E8\",\"ntoskrnl.exe\",0.0102,0.9908,0.0102,0.9908\n\"62793F\",\"62793F\",\"ntoskrnl.exe\",0.0101,0.9884,0.0101,0.9884\n\"27B4AF\",\"27B4AF\",\"ntoskrnl.exe\",0.0101,0.9872,0.0101,0.9872\n\"7418E3\",\"7418E3\",\"ntoskrnl.exe\",0.0101,0.9813,0.0101,0.9813\n\"C55B74\",\"C55B74\",\"ntoskrnl.exe\",0.0101,0.9809,0.0101,0.9809\n\"26F560\",\"26F560\",\"ntoskrnl.exe\",0.0100,0.9786,0.0100,0.9786\n\"2DA1AF\",\"2DA1AF\",\"ntoskrnl.exe\",0.0100,0.9782,0.0100,0.9782\n\"90AB46\",\"90AB46\",\"ntoskrnl.exe\",0.0100,0.9734,0.0100,0.9734\n\"2F6FFE\",\"2F6FFE\",\"ntoskrnl.exe\",0.0100,0.9709,0.0100,0.9709\n\"2DE10E\",\"2DE10E\",\"ntoskrnl.exe\",0.0100,0.9699,0.0100,0.9699\n\"734DAE\",\"734DAE\",\"ntoskrnl.exe\",0.0099,0.9643,0.0099,0.9643\n\"44AEC3\",\"44AEC3\",\"ntoskrnl.exe\",0.0098,0.9557,0.0098,0.9557\n\"206F5C\",\"206F5C\",\"ntoskrnl.exe\",0.0098,0.9501,0.0098,0.9501\n\"624A17\",\"624A17\",\"ntoskrnl.exe\",0.0097,0.9470,0.0097,0.9470\n\"73474D\",\"73474D\",\"ntoskrnl.exe\",0.0097,0.9442,0.0097,0.9442\n\"2DC22B\",\"2DC22B\",\"ntoskrnl.exe\",0.0096,0.9323,0.0096,0.9323\n\"6243FC\",\"6243FC\",\"ntoskrnl.exe\",0.0094,0.9189,0.0094,0.9189\n\"624B7B\",\"624B7B\",\"ntoskrnl.exe\",0.0094,0.9141,0.0094,0.9141\n\"6253F8\",\"6253F8\",\"ntoskrnl.exe\",0.0093,0.9061,0.0093,0.9061\n\"31F681\",\"31F681\",\"ntoskrnl.exe\",0.0092,0.8995,0.0092,0.8995\n\"288C96\",\"288C96\",\"ntoskrnl.exe\",0.0092,0.8966,0.0092,0.8966\n\"2E0223\",\"2E0223\",\"ntoskrnl.exe\",0.0091,0.8884,0.0091,0.8884\n\"316A57\",\"316A57\",\"ntoskrnl.exe\",0.0091,0.8833,0.0091,0.8833\n\"20067C\",\"20067C\",\"ntoskrnl.exe\",0.0089,0.8675,0.0089,0.8675\n\"22E156\",\"22E156\",\"ntoskrnl.exe\",0.0088,0.8583,0.0088,0.8583\n\"9B3C82\",\"9B3C82\",\"ntoskrnl.exe\",0.0088,0.8526,0.0088,0.8526\n\"3FF3E7\",\"3FF3E7\",\"ntoskrnl.exe\",0.0087,0.8521,0.0087,0.8521\n\"5166D0\",\"5166D0\",\"ntoskrnl.exe\",0.0086,0.8371,0.0086,0.8371\n\"62451A\",\"62451A\",\"ntoskrnl.exe\",0.0084,0.8207,0.0084,0.8207\n\"AA20AC\",\"AA20AC\",\"ntoskrnl.exe\",0.0084,0.8206,0.0084,0.8206\n\"2DB1F8\",\"2DB1F8\",\"ntoskrnl.exe\",0.0084,0.8172,0.0084,0.8172\n\"417CF1\",\"417CF1\",\"ntoskrnl.exe\",0.0083,0.8099,0.0083,0.8099\n\"624313\",\"624313\",\"ntoskrnl.exe\",0.0083,0.8085,0.0083,0.8085\n\"624BA6\",\"624BA6\",\"ntoskrnl.exe\",0.0083,0.8068,0.0083,0.8068\n\"624310\",\"624310\",\"ntoskrnl.exe\",0.0080,0.7841,0.0080,0.7841\n\"45EB7B\",\"45EB7B\",\"ntoskrnl.exe\",0.0080,0.7788,0.0080,0.7788\n\"222A22\",\"222A22\",\"ntoskrnl.exe\",0.0080,0.7756,0.0080,0.7756\n\"8A04DF\",\"8A04DF\",\"ntoskrnl.exe\",0.0079,0.7681,0.0079,0.7681\n\"9074BF\",\"9074BF\",\"ntoskrnl.exe\",0.0078,0.7593,0.0078,0.7593\n\"213404\",\"213404\",\"ntoskrnl.exe\",0.0078,0.7562,0.0078,0.7562\n\"432030\",\"432030\",\"ntoskrnl.exe\",0.0078,0.7554,0.0078,0.7554\n\"624E6C\",\"624E6C\",\"ntoskrnl.exe\",0.0078,0.7552,0.0078,0.7552\n\"23ED65\",\"23ED65\",\"ntoskrnl.exe\",0.0078,0.7551,0.0078,0.7551\n\"624ADE\",\"624ADE\",\"ntoskrnl.exe\",0.0077,0.7528,0.0077,0.7528\n\"2DE020\",\"2DE020\",\"ntoskrnl.exe\",0.0076,0.7406,0.0076,0.7406\n\"C55A80\",\"C55A80\",\"ntoskrnl.exe\",0.0076,0.7396,0.0076,0.7396\n\"2DE07F\",\"2DE07F\",\"ntoskrnl.exe\",0.0075,0.7316,0.0075,0.7316\n\"A5833B\",\"A5833B\",\"ntoskrnl.exe\",0.0075,0.7291,0.0075,0.7291\n\"212F49\",\"212F49\",\"ntoskrnl.exe\",0.0072,0.7045,0.0072,0.7045\n\"3AD2F6\",\"3AD2F6\",\"ntoskrnl.exe\",0.0071,0.6957,0.0071,0.6957\n\"243A70\",\"243A70\",\"ntoskrnl.exe\",0.0071,0.6939,0.0071,0.6939\n\"2DE736\",\"2DE736\",\"ntoskrnl.exe\",0.0070,0.6778,0.0070,0.6778\n\"319C7C\",\"319C7C\",\"ntoskrnl.exe\",0.0069,0.6746,0.0069,0.6746\n\"6244A1\",\"6244A1\",\"ntoskrnl.exe\",0.0069,0.6698,0.0069,0.6698\n\"624C3A\",\"624C3A\",\"ntoskrnl.exe\",0.0068,0.6653,0.0068,0.6653\n\"625411\",\"625411\",\"ntoskrnl.exe\",0.0068,0.6613,0.0068,0.6613\n\"62543F\",\"62543F\",\"ntoskrnl.exe\",0.0068,0.6581,0.0068,0.6581\n\"22DF98\",\"22DF98\",\"ntoskrnl.exe\",0.0067,0.6570,0.0067,0.6570\n\"401EDF\",\"401EDF\",\"ntoskrnl.exe\",0.0066,0.6400,0.0066,0.6400\n\"516722\",\"516722\",\"ntoskrnl.exe\",0.0066,0.6388,0.0066,0.6388\n\"2DAD0A\",\"2DAD0A\",\"ntoskrnl.exe\",0.0063,0.6164,0.0063,0.6164\n\"327C77\",\"327C77\",\"ntoskrnl.exe\",0.0062,0.6040,0.0062,0.6040\n\"2DB5C4\",\"2DB5C4\",\"ntoskrnl.exe\",0.0062,0.6006,0.0062,0.6006\n\"2DB200\",\"2DB200\",\"ntoskrnl.exe\",0.0061,0.5961,0.0061,0.5961\n\"8B6723\",\"8B6723\",\"ntoskrnl.exe\",0.0061,0.5961,0.0061,0.5961\n\"73B653\",\"73B653\",\"ntoskrnl.exe\",0.0061,0.5905,0.0061,0.5905\n\"27BEEA\",\"27BEEA\",\"ntoskrnl.exe\",0.0061,0.5895,0.0061,0.5895\n\"2DC367\",\"2DC367\",\"ntoskrnl.exe\",0.0060,0.5835,0.0060,0.5835\n\"624389\",\"624389\",\"ntoskrnl.exe\",0.0060,0.5805,0.0060,0.5805\n\"626CB4\",\"626CB4\",\"ntoskrnl.exe\",0.0058,0.5689,0.0058,0.5689\n\"C55ECF\",\"C55ECF\",\"ntoskrnl.exe\",0.0058,0.5679,0.0058,0.5679\n\"26AB73\",\"26AB73\",\"ntoskrnl.exe\",0.0057,0.5583,0.0057,0.5583\n\"2818BA\",\"2818BA\",\"ntoskrnl.exe\",0.0057,0.5569,0.0057,0.5569\n\"2DB0B5\",\"2DB0B5\",\"ntoskrnl.exe\",0.0057,0.5558,0.0057,0.5558\n\"913BA0\",\"913BA0\",\"ntoskrnl.exe\",0.0055,0.5360,0.0055,0.5360\n\"516705\",\"516705\",\"ntoskrnl.exe\",0.0055,0.5342,0.0055,0.5342\n\"3D8D2F\",\"3D8D2F\",\"ntoskrnl.exe\",0.0055,0.5329,0.0055,0.5329\n\"51663F\",\"51663F\",\"ntoskrnl.exe\",0.0055,0.5315,0.0055,0.5315\n\"2E1280\",\"2E1280\",\"ntoskrnl.exe\",0.0055,0.5314,0.0055,0.5314\n\"204297\",\"204297\",\"ntoskrnl.exe\",0.0053,0.5149,0.0053,0.5149\n\"2DE0BC\",\"2DE0BC\",\"ntoskrnl.exe\",0.0053,0.5143,0.0053,0.5143\n\"626337\",\"626337\",\"ntoskrnl.exe\",0.0052,0.5082,0.0052,0.5082\n\"2DB20F\",\"2DB20F\",\"ntoskrnl.exe\",0.0052,0.5023,0.0052,0.5023\n\"6279FE\",\"6279FE\",\"ntoskrnl.exe\",0.0050,0.4887,0.0050,0.4887\n\"2074F9\",\"2074F9\",\"ntoskrnl.exe\",0.0050,0.4881,0.0050,0.4881\n\"627932\",\"627932\",\"ntoskrnl.exe\",0.0050,0.4838,0.0050,0.4838\n\"73450B\",\"73450B\",\"ntoskrnl.exe\",0.0049,0.4806,0.0049,0.4806\n\"51673E\",\"51673E\",\"ntoskrnl.exe\",0.0049,0.4755,0.0049,0.4755\n\"326204\",\"326204\",\"ntoskrnl.exe\",0.0047,0.4598,0.0047,0.4598\n\"626C1F\",\"626C1F\",\"ntoskrnl.exe\",0.0047,0.4557,0.0047,0.4557\n\"7269E9\",\"7269E9\",\"ntoskrnl.exe\",0.0046,0.4526,0.0046,0.4526\n\"317A2F\",\"317A2F\",\"ntoskrnl.exe\",0.0046,0.4435,0.0046,0.4435\n\"6279E1\",\"6279E1\",\"ntoskrnl.exe\",0.0045,0.4390,0.0045,0.4390\n\"2DDB50\",\"2DDB50\",\"ntoskrnl.exe\",0.0043,0.4218,0.0043,0.4218\n\"3E4F8E\",\"3E4F8E\",\"ntoskrnl.exe\",0.0043,0.4149,0.0043,0.4149\n\"206232\",\"206232\",\"ntoskrnl.exe\",0.0042,0.4138,0.0042,0.4138\n\"2DE7C5\",\"2DE7C5\",\"ntoskrnl.exe\",0.0042,0.4102,0.0042,0.4102\n\"8AA86F\",\"8AA86F\",\"ntoskrnl.exe\",0.0042,0.4058,0.0042,0.4058\n\"2DFC8B\",\"2DFC8B\",\"ntoskrnl.exe\",0.0041,0.4003,0.0041,0.4003\n\"6242FE\",\"6242FE\",\"ntoskrnl.exe\",0.0041,0.3973,0.0041,0.3973\n\"2DA1BA\",\"2DA1BA\",\"ntoskrnl.exe\",0.0041,0.3963,0.0041,0.3963\n\"51674B\",\"51674B\",\"ntoskrnl.exe\",0.0040,0.3928,0.0040,0.3928\n\"2DA1A0\",\"2DA1A0\",\"ntoskrnl.exe\",0.0040,0.3905,0.0040,0.3905\n\"212A36\",\"212A36\",\"ntoskrnl.exe\",0.0039,0.3825,0.0039,0.3825\n\"2056D0\",\"2056D0\",\"ntoskrnl.exe\",0.0038,0.3733,0.0038,0.3733\n\"6279E4\",\"6279E4\",\"ntoskrnl.exe\",0.0038,0.3654,0.0038,0.3654\n\"426865\",\"426865\",\"ntoskrnl.exe\",0.0037,0.3610,0.0037,0.3610\n\"624B55\",\"624B55\",\"ntoskrnl.exe\",0.0037,0.3587,0.0037,0.3587\n\"C55BCD\",\"C55BCD\",\"ntoskrnl.exe\",0.0036,0.3492,0.0036,0.3492\n\"221282\",\"221282\",\"ntoskrnl.exe\",0.0035,0.3454,0.0035,0.3454\n\"240F1D\",\"240F1D\",\"ntoskrnl.exe\",0.0035,0.3441,0.0035,0.3441\n\"3F0E68\",\"3F0E68\",\"ntoskrnl.exe\",0.0035,0.3411,0.0035,0.3411\n\"401ED0\",\"401ED0\",\"ntoskrnl.exe\",0.0034,0.3333,0.0034,0.3333\n\"205776\",\"205776\",\"ntoskrnl.exe\",0.0032,0.3158,0.0032,0.3158\n\"27B4E4\",\"27B4E4\",\"ntoskrnl.exe\",0.0032,0.3122,0.0032,0.3122\n\"334AD4\",\"334AD4\",\"ntoskrnl.exe\",0.0032,0.3116,0.0032,0.3116\n\"21752F\",\"21752F\",\"ntoskrnl.exe\",0.0031,0.3063,0.0031,0.3063\n\"624BA2\",\"624BA2\",\"ntoskrnl.exe\",0.0031,0.3055,0.0031,0.3055\n\"38E164\",\"38E164\",\"ntoskrnl.exe\",0.0031,0.3008,0.0031,0.3008\n\"2DA204\",\"2DA204\",\"ntoskrnl.exe\",0.0028,0.2744,0.0028,0.2744\n\"2DE596\",\"2DE596\",\"ntoskrnl.exe\",0.0027,0.2611,0.0027,0.2611\n\"23C63C\",\"23C63C\",\"ntoskrnl.exe\",0.0026,0.2506,0.0026,0.2506\n\"2EB8C5\",\"2EB8C5\",\"ntoskrnl.exe\",0.0025,0.2476,0.0025,0.2476\n\"2853D4\",\"2853D4\",\"ntoskrnl.exe\",0.0024,0.2386,0.0024,0.2386\n\"27A276\",\"27A276\",\"ntoskrnl.exe\",0.0023,0.2242,0.0023,0.2242\n\"2DE058\",\"2DE058\",\"ntoskrnl.exe\",0.0019,0.1895,0.0019,0.1895\n\"2DE088\",\"2DE088\",\"ntoskrnl.exe\",0.0019,0.1874,0.0019,0.1874\n\"27A942\",\"27A942\",\"ntoskrnl.exe\",0.0019,0.1836,0.0019,0.1836\n\"214A4D\",\"214A4D\",\"ntoskrnl.exe\",0.0015,0.1471,0.0015,0.1471\n\"396A43\",\"396A43\",\"ntoskrnl.exe\",0.0014,0.1412,0.0014,0.1412\n\"8EE99E\",\"8EE99E\",\"ntoskrnl.exe\",0.0013,0.1275,0.0013,0.1275\n\"285246\",\"285246\",\"ntoskrnl.exe\",0.0012,0.1136,0.0012,0.1136\n\"7422F0\",\"7422F0\",\"ntoskrnl.exe\",0.0009,0.0856,0.0009,0.0856\n\"3B8889\",\"3B8889\",\"ntoskrnl.exe\",0.0009,0.0837,0.0009,0.0837\n\"72CBD6\",\"72CBD6\",\"ntoskrnl.exe\",0.0007,0.0691,0.0007,0.0691\n\"27D0D1\",\"27D0D1\",\"ntoskrnl.exe\",0.0006,0.0631,0.0006,0.0631\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_nvlddmkm.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"10FB29\",\"10FB29\",\"nvlddmkm.sys\",0.0433,4.2205,0.0433,4.2205\n\"127ECD\",\"127ECD\",\"nvlddmkm.sys\",0.0205,2.0000,0.0205,2.0000\n\"84752\",\"84752\",\"nvlddmkm.sys\",0.0205,2.0000,0.0205,2.0000\n\"BBE8A4\",\"BBE8A4\",\"nvlddmkm.sys\",0.0205,2.0000,0.0205,2.0000\n\"120F16\",\"120F16\",\"nvlddmkm.sys\",0.0125,1.2221,0.0125,1.2221\n\"130228\",\"130228\",\"nvlddmkm.sys\",0.0103,1.0051,0.0103,1.0051\n\"4F0EA4\",\"4F0EA4\",\"nvlddmkm.sys\",0.0100,0.9771,0.0100,0.9771\n\"1275DE\",\"1275DE\",\"nvlddmkm.sys\",0.0099,0.9673,0.0099,0.9673\n\"59B7DD\",\"59B7DD\",\"nvlddmkm.sys\",0.0063,0.6139,0.0063,0.6139\n\"137490\",\"137490\",\"nvlddmkm.sys\",0.0014,0.1384,0.0014,0.1384\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_nvldumdx.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"8D20\",\"8D20\",\"nvldumdx.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_nvwgf2umx_cfg.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"2A55CD\",\"2A55CD\",\"nvwgf2umx_cfg.dll\",0.0432,4.2095,0.0432,4.2095\n\"2A52E2\",\"2A52E2\",\"nvwgf2umx_cfg.dll\",0.0411,4.0000,0.6455,62.8880\n\"2A5EEA\",\"2A5EEA\",\"nvwgf2umx_cfg.dll\",0.0411,4.0000,0.0411,4.0000\n\"2BD760\",\"2BD760\",\"nvwgf2umx_cfg.dll\",0.0411,4.0000,0.0411,4.0000\n\"2A5EC7\",\"2A5EC7\",\"nvwgf2umx_cfg.dll\",0.0222,2.1592,0.0222,2.1592\n\"12A544D\",\"12A544D\",\"nvwgf2umx_cfg.dll\",0.0210,2.0434,0.0210,2.0434\n\"116CE0\",\"116CE0\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"12C342C\",\"12C342C\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"29DC76\",\"29DC76\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"5F000\",\"5F000\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"ACE260\",\"ACE260\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"B10A5E\",\"B10A5E\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"B34DA0\",\"B34DA0\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"BE9A2F\",\"BE9A2F\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"C77044\",\"C77044\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"C93902\",\"C93902\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"C94C0C\",\"C94C0C\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"C95F58\",\"C95F58\",\"nvwgf2umx_cfg.dll\",0.0205,2.0000,0.0205,2.0000\n\"1FA9B0\",\"1FA9B0\",\"nvwgf2umx_cfg.dll\",0.0133,1.2960,0.0133,1.2960\n\"D320DC\",\"D320DC\",\"nvwgf2umx_cfg.dll\",0.0123,1.1943,0.0123,1.1943\n\"AC906C\",\"AC906C\",\"nvwgf2umx_cfg.dll\",0.0109,1.0609,0.0109,1.0609\n\"B3B100\",\"B3B100\",\"nvwgf2umx_cfg.dll\",0.0103,1.0060,0.0103,1.0060\n\"13BE37\",\"13BE37\",\"nvwgf2umx_cfg.dll\",0.0103,0.9997,0.0103,0.9997\n\"EF0460\",\"EF0460\",\"nvwgf2umx_cfg.dll\",0.0102,0.9902,0.0102,0.9902\n\"2A5ECD\",\"2A5ECD\",\"nvwgf2umx_cfg.dll\",0.0015,0.1419,0.0015,0.1419\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_oleaut32.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"195F3\",\"195F3\",\"oleaut32.dll\",0.0320,3.1187,0.0320,3.1187\n\"1961D\",\"1961D\",\"oleaut32.dll\",0.0191,1.8633,0.0191,1.8633\n\"1ADD3\",\"1ADD3\",\"oleaut32.dll\",0.0145,1.4089,0.0145,1.4089\n\"9EA38\",\"9EA38\",\"oleaut32.dll\",0.0111,1.0776,0.0111,1.0776\n\"1C058\",\"1C058\",\"oleaut32.dll\",0.0109,1.0643,0.0109,1.0643\n\"198A9\",\"198A9\",\"oleaut32.dll\",0.0106,1.0369,0.0106,1.0369\n\"A0010\",\"A0010\",\"oleaut32.dll\",0.0105,1.0188,0.0105,1.0188\n\"19608\",\"19608\",\"oleaut32.dll\",0.0082,0.8022,0.0082,0.8022\n\"1A1F0\",\"1A1F0\",\"oleaut32.dll\",0.0082,0.7944,0.0082,0.7944\n\"19AAF\",\"19AAF\",\"oleaut32.dll\",0.0040,0.3910,0.0040,0.3910\n\"1473C\",\"1473C\",\"oleaut32.dll\",0.0022,0.2167,0.0022,0.2167\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_rpcrt4.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"4194F\",\"4194F\",\"rpcrt4.dll\",0.0718,6.9930,0.0718,6.9930\n\"472A1\",\"472A1\",\"rpcrt4.dll\",0.0380,3.7023,0.4707,45.8597\n\"444C0\",\"444C0\",\"rpcrt4.dll\",0.0308,2.9981,0.0308,2.9981\n\"23CA2\",\"23CA2\",\"rpcrt4.dll\",0.0212,2.0689,0.0212,2.0689\n\"27869\",\"27869\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"280BD\",\"280BD\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"2A4F9\",\"2A4F9\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"49071\",\"49071\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"4C270\",\"4C270\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"6DB19\",\"6DB19\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"72799\",\"72799\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"B0FC\",\"B0FC\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"BF9B\",\"BF9B\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"CCB9\",\"CCB9\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"D219A\",\"D219A\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"D53AB\",\"D53AB\",\"rpcrt4.dll\",0.0205,2.0000,0.0205,2.0000\n\"2A1E0\",\"2A1E0\",\"rpcrt4.dll\",0.0178,1.7325,0.0178,1.7325\n\"575A4\",\"575A4\",\"rpcrt4.dll\",0.0153,1.4894,0.0153,1.4894\n\"80745\",\"80745\",\"rpcrt4.dll\",0.0141,1.3747,0.0141,1.3747\n\"479A0\",\"479A0\",\"rpcrt4.dll\",0.0113,1.1043,0.0113,1.1043\n\"4553D\",\"4553D\",\"rpcrt4.dll\",0.0108,1.0532,0.0108,1.0532\n\"7E6E0\",\"7E6E0\",\"rpcrt4.dll\",0.0104,1.0172,0.0104,1.0172\n\"D53BB\",\"D53BB\",\"rpcrt4.dll\",0.0103,0.9998,0.0103,0.9998\n\"95FE5\",\"95FE5\",\"rpcrt4.dll\",0.0102,0.9951,0.0102,0.9951\n\"29D47\",\"29D47\",\"rpcrt4.dll\",0.0102,0.9935,0.0102,0.9935\n\"21F22\",\"21F22\",\"rpcrt4.dll\",0.0102,0.9920,0.0102,0.9920\n\"20BA2\",\"20BA2\",\"rpcrt4.dll\",0.0101,0.9829,0.0101,0.9829\n\"1F5E0\",\"1F5E0\",\"rpcrt4.dll\",0.0085,0.8320,0.0085,0.8320\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_schannel.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"67AC\",\"67AC\",\"schannel.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_sechost.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"AF31\",\"AF31\",\"sechost.dll\",0.0205,2.0000,0.0205,2.0000\n\"CDB0\",\"CDB0\",\"sechost.dll\",0.0205,2.0000,0.0205,2.0000\n\"13EE0\",\"13EE0\",\"sechost.dll\",0.0101,0.9804,0.0101,0.9804\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_sspicli.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"3FF0\",\"3FF0\",\"sspicli.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_ucrtbase.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"F178B\",\"F178B\",\"ucrtbase.dll\",0.1700,16.5643,0.1700,16.5643\n\"64480\",\"64480\",\"ucrtbase.dll\",0.1029,10.0261,0.1029,10.0261\n\"22A10\",\"22A10\",\"ucrtbase.dll\",0.0842,8.2072,0.0842,8.2072\n\"64483\",\"64483\",\"ucrtbase.dll\",0.0719,7.0045,0.0719,7.0045\n\"5098\",\"5098\",\"ucrtbase.dll\",0.0706,6.8796,0.0706,6.8796\n\"64738\",\"64738\",\"ucrtbase.dll\",0.0616,6.0035,0.0616,6.0035\n\"6448C\",\"6448C\",\"ucrtbase.dll\",0.0513,4.9988,0.0513,4.9988\n\"64729\",\"64729\",\"ucrtbase.dll\",0.0513,4.9985,0.0513,4.9985\n\"46E9B\",\"46E9B\",\"ucrtbase.dll\",0.0454,4.4279,0.0454,4.4279\n\"22A20\",\"22A20\",\"ucrtbase.dll\",0.0411,4.0082,0.0411,4.0082\n\"6471D\",\"6471D\",\"ucrtbase.dll\",0.0410,3.9939,0.0410,3.9939\n\"1D569\",\"1D569\",\"ucrtbase.dll\",0.0355,3.4565,0.0355,3.4565\n\"F1928\",\"F1928\",\"ucrtbase.dll\",0.0354,3.4512,0.0354,3.4512\n\"F1921\",\"F1921\",\"ucrtbase.dll\",0.0339,3.3014,0.0399,3.8919\n\"5090\",\"5090\",\"ucrtbase.dll\",0.0333,3.2448,0.0333,3.2448\n\"1CF8D\",\"1CF8D\",\"ucrtbase.dll\",0.0317,3.0871,0.0317,3.0871\n\"46F18\",\"46F18\",\"ucrtbase.dll\",0.0315,3.0661,0.0315,3.0661\n\"22A2F\",\"22A2F\",\"ucrtbase.dll\",0.0309,3.0069,0.0309,3.0069\n\"64736\",\"64736\",\"ucrtbase.dll\",0.0308,3.0041,0.0308,3.0041\n\"64737\",\"64737\",\"ucrtbase.dll\",0.0308,3.0036,0.0308,3.0036\n\"64482\",\"64482\",\"ucrtbase.dll\",0.0308,3.0020,0.0308,3.0020\n\"6449C\",\"6449C\",\"ucrtbase.dll\",0.0308,2.9985,0.0308,2.9985\n\"64487\",\"64487\",\"ucrtbase.dll\",0.0307,2.9952,0.0307,2.9952\n\"22A4E\",\"22A4E\",\"ucrtbase.dll\",0.0305,2.9722,0.0305,2.9722\n\"22A5E\",\"22A5E\",\"ucrtbase.dll\",0.0303,2.9499,0.0303,2.9499\n\"30D2\",\"30D2\",\"ucrtbase.dll\",0.0301,2.9334,0.0301,2.9334\n\"65919\",\"65919\",\"ucrtbase.dll\",0.0210,2.0413,0.0210,2.0413\n\"8578\",\"8578\",\"ucrtbase.dll\",0.0207,2.0159,0.0207,2.0159\n\"22A63\",\"22A63\",\"ucrtbase.dll\",0.0206,2.0044,0.0206,2.0044\n\"64723\",\"64723\",\"ucrtbase.dll\",0.0206,2.0036,0.0206,2.0036\n\"64726\",\"64726\",\"ucrtbase.dll\",0.0205,2.0017,0.0205,2.0017\n\"22B4B\",\"22B4B\",\"ucrtbase.dll\",0.0205,2.0014,0.0205,2.0014\n\"47FD0\",\"47FD0\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"512F3\",\"512F3\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"5DCA\",\"5DCA\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"D300\",\"D300\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"D3A0\",\"D3A0\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"F16B7\",\"F16B7\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"F16D7\",\"F16D7\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"F1833\",\"F1833\",\"ucrtbase.dll\",0.0205,2.0000,0.0205,2.0000\n\"6472B\",\"6472B\",\"ucrtbase.dll\",0.0205,1.9983,0.0205,1.9983\n\"F19D6\",\"F19D6\",\"ucrtbase.dll\",0.0187,1.8245,0.0187,1.8245\n\"1CF57\",\"1CF57\",\"ucrtbase.dll\",0.0153,1.4951,0.0153,1.4951\n\"F16DF\",\"F16DF\",\"ucrtbase.dll\",0.0148,1.4375,0.0148,1.4375\n\"F16C2\",\"F16C2\",\"ucrtbase.dll\",0.0145,1.4171,0.0145,1.4171\n\"1CCC5\",\"1CCC5\",\"ucrtbase.dll\",0.0134,1.3068,0.0134,1.3068\n\"F16CB\",\"F16CB\",\"ucrtbase.dll\",0.0130,1.2697,0.0130,1.2697\n\"F197E\",\"F197E\",\"ucrtbase.dll\",0.0125,1.2164,0.0125,1.2164\n\"1E01A\",\"1E01A\",\"ucrtbase.dll\",0.0120,1.1720,0.0120,1.1720\n\"22B50\",\"22B50\",\"ucrtbase.dll\",0.0119,1.1643,0.0119,1.1643\n\"2472B\",\"2472B\",\"ucrtbase.dll\",0.0111,1.0773,0.0111,1.0773\n\"3A5FD\",\"3A5FD\",\"ucrtbase.dll\",0.0110,1.0766,0.0110,1.0766\n\"22EC0\",\"22EC0\",\"ucrtbase.dll\",0.0109,1.0629,0.0109,1.0629\n\"F1886\",\"F1886\",\"ucrtbase.dll\",0.0107,1.0418,0.0107,1.0418\n\"F18BA\",\"F18BA\",\"ucrtbase.dll\",0.0106,1.0375,0.0106,1.0375\n\"32D8\",\"32D8\",\"ucrtbase.dll\",0.0103,1.0074,0.0103,1.0074\n\"1C7CE\",\"1C7CE\",\"ucrtbase.dll\",0.0103,1.0070,0.0103,1.0070\n\"1CF43\",\"1CF43\",\"ucrtbase.dll\",0.0103,1.0029,0.0103,1.0029\n\"3117\",\"3117\",\"ucrtbase.dll\",0.0103,1.0012,0.0103,1.0012\n\"F1270\",\"F1270\",\"ucrtbase.dll\",0.0103,1.0009,0.0103,1.0009\n\"22B20\",\"22B20\",\"ucrtbase.dll\",0.0103,1.0007,0.0103,1.0007\n\"725C\",\"725C\",\"ucrtbase.dll\",0.0103,1.0005,0.0103,1.0005\n\"64F70\",\"64F70\",\"ucrtbase.dll\",0.0103,0.9999,0.0103,0.9999\n\"6449A\",\"6449A\",\"ucrtbase.dll\",0.0103,0.9997,0.0103,0.9997\n\"843D\",\"843D\",\"ucrtbase.dll\",0.0103,0.9994,0.0103,0.9994\n\"1775B\",\"1775B\",\"ucrtbase.dll\",0.0103,0.9992,0.0103,0.9992\n\"F1A0F\",\"F1A0F\",\"ucrtbase.dll\",0.0103,0.9992,0.0103,0.9992\n\"46F42\",\"46F42\",\"ucrtbase.dll\",0.0103,0.9991,0.0103,0.9991\n\"4CDA2\",\"4CDA2\",\"ucrtbase.dll\",0.0103,0.9990,0.0103,0.9990\n\"1BB52\",\"1BB52\",\"ucrtbase.dll\",0.0102,0.9981,0.0102,0.9981\n\"F1808\",\"F1808\",\"ucrtbase.dll\",0.0102,0.9981,0.0102,0.9981\n\"F17D0\",\"F17D0\",\"ucrtbase.dll\",0.0102,0.9978,0.0102,0.9978\n\"50C5\",\"50C5\",\"ucrtbase.dll\",0.0102,0.9976,0.0102,0.9976\n\"73CBE\",\"73CBE\",\"ucrtbase.dll\",0.0102,0.9976,0.0102,0.9976\n\"65893\",\"65893\",\"ucrtbase.dll\",0.0102,0.9975,0.0102,0.9975\n\"35A68\",\"35A68\",\"ucrtbase.dll\",0.0102,0.9969,0.0102,0.9969\n\"64732\",\"64732\",\"ucrtbase.dll\",0.0102,0.9966,0.0102,0.9966\n\"1CC20\",\"1CC20\",\"ucrtbase.dll\",0.0102,0.9958,0.0102,0.9958\n\"C7757\",\"C7757\",\"ucrtbase.dll\",0.0102,0.9958,0.0102,0.9958\n\"64734\",\"64734\",\"ucrtbase.dll\",0.0102,0.9956,0.0102,0.9956\n\"1CE9C\",\"1CE9C\",\"ucrtbase.dll\",0.0102,0.9946,0.4166,40.5911\n\"4FEE\",\"4FEE\",\"ucrtbase.dll\",0.0102,0.9946,0.0102,0.9946\n\"30D9\",\"30D9\",\"ucrtbase.dll\",0.0102,0.9917,0.0102,0.9917\n\"6CD42\",\"6CD42\",\"ucrtbase.dll\",0.0102,0.9913,0.0102,0.9913\n\"1BC20\",\"1BC20\",\"ucrtbase.dll\",0.0102,0.9910,0.0102,0.9910\n\"F17A0\",\"F17A0\",\"ucrtbase.dll\",0.0101,0.9889,0.0101,0.9889\n\"87865\",\"87865\",\"ucrtbase.dll\",0.0101,0.9877,0.0101,0.9877\n\"4FC0\",\"4FC0\",\"ucrtbase.dll\",0.0101,0.9871,0.0101,0.9871\n\"F1A29\",\"F1A29\",\"ucrtbase.dll\",0.0101,0.9848,0.0101,0.9848\n\"4FC6\",\"4FC6\",\"ucrtbase.dll\",0.0101,0.9808,0.0101,0.9808\n\"666EB\",\"666EB\",\"ucrtbase.dll\",0.0100,0.9768,0.0100,0.9768\n\"845C\",\"845C\",\"ucrtbase.dll\",0.0100,0.9740,0.0100,0.9740\n\"22B22\",\"22B22\",\"ucrtbase.dll\",0.0098,0.9580,0.0098,0.9580\n\"6B960\",\"6B960\",\"ucrtbase.dll\",0.0090,0.8726,0.0090,0.8726\n\"6291\",\"6291\",\"ucrtbase.dll\",0.0088,0.8562,0.0088,0.8562\n\"F18C6\",\"F18C6\",\"ucrtbase.dll\",0.0080,0.7782,0.0080,0.7782\n\"4B030\",\"4B030\",\"ucrtbase.dll\",0.0076,0.7359,0.0076,0.7359\n\"74C2\",\"74C2\",\"ucrtbase.dll\",0.0057,0.5549,0.0057,0.5549\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_user32.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"13CA3\",\"13CA3\",\"user32.dll\",0.0205,2.0000,0.0205,2.0000\n\"18290\",\"18290\",\"user32.dll\",0.0205,2.0000,0.0205,2.0000\n\"732B0\",\"732B0\",\"user32.dll\",0.0205,2.0000,0.0205,2.0000\n\"B8E4\",\"B8E4\",\"user32.dll\",0.0205,2.0000,0.0205,2.0000\n\"4A718\",\"4A718\",\"user32.dll\",0.0102,0.9981,0.0102,0.9981\n\"9771\",\"9771\",\"user32.dll\",0.0102,0.9956,0.0102,0.9956\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_uxtheme.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"A7D1\",\"A7D1\",\"uxtheme.dll\",0.0205,2.0000,0.0205,2.0000\n\"66B2\",\"66B2\",\"uxtheme.dll\",0.0105,1.0251,0.0105,1.0251\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_vaultcli.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"10FBC\",\"10FBC\",\"vaultcli.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_vcruntime140.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1055A\",\"1055A\",\"vcruntime140.dll\",0.0516,5.0297,0.0516,5.0297\n\"1007B\",\"1007B\",\"vcruntime140.dll\",0.0515,5.0198,0.0515,5.0198\n\"1059B\",\"1059B\",\"vcruntime140.dll\",0.0515,5.0167,0.0515,5.0167\n\"113EB\",\"113EB\",\"vcruntime140.dll\",0.0508,4.9450,0.0508,4.9450\n\"11571\",\"11571\",\"vcruntime140.dll\",0.0304,2.9596,0.0304,2.9596\n\"13010\",\"13010\",\"vcruntime140.dll\",0.0284,2.7681,0.0284,2.7681\n\"10430\",\"10430\",\"vcruntime140.dll\",0.0222,2.1621,0.0222,2.1621\n\"113A4\",\"113A4\",\"vcruntime140.dll\",0.0205,2.0000,0.0205,2.0000\n\"113F0\",\"113F0\",\"vcruntime140.dll\",0.0205,2.0000,0.0205,2.0000\n\"11410\",\"11410\",\"vcruntime140.dll\",0.0205,2.0000,0.0205,2.0000\n\"11418\",\"11418\",\"vcruntime140.dll\",0.0205,2.0000,0.0205,2.0000\n\"116BC\",\"116BC\",\"vcruntime140.dll\",0.0205,2.0000,0.0205,2.0000\n\"501D\",\"501D\",\"vcruntime140.dll\",0.0205,2.0000,0.0205,2.0000\n\"52A0\",\"52A0\",\"vcruntime140.dll\",0.0205,2.0000,0.0205,2.0000\n\"114B9\",\"114B9\",\"vcruntime140.dll\",0.0204,1.9888,0.0204,1.9888\n\"10458\",\"10458\",\"vcruntime140.dll\",0.0195,1.9030,0.0195,1.9030\n\"11B88\",\"11B88\",\"vcruntime140.dll\",0.0187,1.8204,0.0187,1.8204\n\"1150C\",\"1150C\",\"vcruntime140.dll\",0.0170,1.6518,0.0170,1.6518\n\"1154E\",\"1154E\",\"vcruntime140.dll\",0.0163,1.5892,0.0163,1.5892\n\"11516\",\"11516\",\"vcruntime140.dll\",0.0123,1.2001,0.0123,1.2001\n\"11327\",\"11327\",\"vcruntime140.dll\",0.0110,1.0718,0.0110,1.0718\n\"11B18\",\"11B18\",\"vcruntime140.dll\",0.0108,1.0512,0.0108,1.0512\n\"11A89\",\"11A89\",\"vcruntime140.dll\",0.0107,1.0465,0.0107,1.0465\n\"11420\",\"11420\",\"vcruntime140.dll\",0.0103,1.0079,0.0103,1.0079\n\"114B6\",\"114B6\",\"vcruntime140.dll\",0.0103,1.0064,0.0103,1.0064\n\"113A8\",\"113A8\",\"vcruntime140.dll\",0.0103,1.0054,0.0103,1.0054\n\"106F1\",\"106F1\",\"vcruntime140.dll\",0.0103,1.0039,0.0103,1.0039\n\"113AE\",\"113AE\",\"vcruntime140.dll\",0.0103,1.0023,0.0103,1.0023\n\"1053D\",\"1053D\",\"vcruntime140.dll\",0.0103,1.0016,0.0103,1.0016\n\"10565\",\"10565\",\"vcruntime140.dll\",0.0103,0.9998,0.0103,0.9998\n\"106C1\",\"106C1\",\"vcruntime140.dll\",0.0103,0.9987,0.0103,0.9987\n\"105A2\",\"105A2\",\"vcruntime140.dll\",0.0102,0.9983,0.0102,0.9983\n\"10444\",\"10444\",\"vcruntime140.dll\",0.0102,0.9968,0.0102,0.9968\n\"55F9\",\"55F9\",\"vcruntime140.dll\",0.0102,0.9966,0.0102,0.9966\n\"11460\",\"11460\",\"vcruntime140.dll\",0.0102,0.9961,0.0102,0.9961\n\"1070A\",\"1070A\",\"vcruntime140.dll\",0.0102,0.9951,0.0102,0.9951\n\"11C21\",\"11C21\",\"vcruntime140.dll\",0.0102,0.9951,0.0102,0.9951\n\"1067F\",\"1067F\",\"vcruntime140.dll\",0.0102,0.9945,0.0102,0.9945\n\"10483\",\"10483\",\"vcruntime140.dll\",0.0102,0.9938,0.0102,0.9938\n\"11383\",\"11383\",\"vcruntime140.dll\",0.0102,0.9938,0.0102,0.9938\n\"11ACB\",\"11ACB\",\"vcruntime140.dll\",0.0101,0.9831,0.0101,0.9831\n\"1063E\",\"1063E\",\"vcruntime140.dll\",0.0101,0.9827,0.0101,0.9827\n\"11312\",\"11312\",\"vcruntime140.dll\",0.0100,0.9729,0.0100,0.9729\n\"10677\",\"10677\",\"vcruntime140.dll\",0.0097,0.9406,0.0097,0.9406\n\"10550\",\"10550\",\"vcruntime140.dll\",0.0054,0.5244,0.0054,0.5244\n\"11548\",\"11548\",\"vcruntime140.dll\",0.0030,0.2912,0.0030,0.2912\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_webio.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"13287\",\"13287\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"1EFD2\",\"1EFD2\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"28CDC\",\"28CDC\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"2AD50\",\"2AD50\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"2B8BD\",\"2B8BD\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"32200\",\"32200\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"3D4BE\",\"3D4BE\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"404DD\",\"404DD\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"404E1\",\"404E1\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"8F010\",\"8F010\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"C7FA\",\"C7FA\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"EF88\",\"EF88\",\"webio.dll\",0.0205,2.0000,0.0205,2.0000\n\"28288\",\"28288\",\"webio.dll\",0.0101,0.9884,0.0101,0.9884\n\"35865\",\"35865\",\"webio.dll\",0.0075,0.7273,0.0075,0.7273\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_webservices.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"FD50\",\"FD50\",\"webservices.dll\",0.0205,2.0000,0.0205,2.0000\n\"12A45\",\"12A45\",\"webservices.dll\",0.0140,1.3616,0.0140,1.3616\n\"16ED3\",\"16ED3\",\"webservices.dll\",0.0106,1.0363,0.0106,1.0363\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_win32kbase.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"20531\",\"20531\",\"win32kbase.sys\",0.0210,2.0444,0.0210,2.0444\n\"14ED9\",\"14ED9\",\"win32kbase.sys\",0.0205,2.0000,0.0205,2.0000\n\"18195\",\"18195\",\"win32kbase.sys\",0.0205,2.0000,0.0205,2.0000\n\"1BAC28\",\"1BAC28\",\"win32kbase.sys\",0.0205,2.0000,0.0205,2.0000\n\"1D71C4\",\"1D71C4\",\"win32kbase.sys\",0.0205,2.0000,0.0205,2.0000\n\"20F73\",\"20F73\",\"win32kbase.sys\",0.0205,2.0000,0.0205,2.0000\n\"8EB8E\",\"8EB8E\",\"win32kbase.sys\",0.0205,2.0000,0.0205,2.0000\n\"CB8F5\",\"CB8F5\",\"win32kbase.sys\",0.0205,2.0000,0.0205,2.0000\n\"208C9\",\"208C9\",\"win32kbase.sys\",0.0171,1.6676,0.0171,1.6676\n\"B33BD\",\"B33BD\",\"win32kbase.sys\",0.0124,1.2042,0.0124,1.2042\n\"1AD15\",\"1AD15\",\"win32kbase.sys\",0.0115,1.1179,0.0115,1.1179\n\"C75BA\",\"C75BA\",\"win32kbase.sys\",0.0107,1.0446,0.0107,1.0446\n\"C75B0\",\"C75B0\",\"win32kbase.sys\",0.0104,1.0112,0.0104,1.0112\n\"2053B\",\"2053B\",\"win32kbase.sys\",0.0103,1.0082,0.0103,1.0082\n\"C74CB\",\"C74CB\",\"win32kbase.sys\",0.0101,0.9858,0.0101,0.9858\n\"140D0\",\"140D0\",\"win32kbase.sys\",0.0101,0.9828,0.0101,0.9828\n\"31813\",\"31813\",\"win32kbase.sys\",0.0079,0.7718,0.0079,0.7718\n\"E7467\",\"E7467\",\"win32kbase.sys\",0.0072,0.7003,0.0072,0.7003\n\"1C71C\",\"1C71C\",\"win32kbase.sys\",0.0031,0.3021,0.0031,0.3021\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_win32kbase_rs.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"138EC\",\"138EC\",\"win32kbase_rs.sys\",0.0205,2.0000,0.0205,2.0000\n\"F8DE\",\"F8DE\",\"win32kbase_rs.sys\",0.0205,2.0000,0.0205,2.0000\n\"17E61\",\"17E61\",\"win32kbase_rs.sys\",0.0198,1.9268,0.0198,1.9268\n\"BE42\",\"BE42\",\"win32kbase_rs.sys\",0.0149,1.4470,0.0149,1.4470\n\"1419E\",\"1419E\",\"win32kbase_rs.sys\",0.0142,1.3807,0.0142,1.3807\n\"145E9\",\"145E9\",\"win32kbase_rs.sys\",0.0137,1.3389,0.0137,1.3389\n\"4BB3\",\"4BB3\",\"win32kbase_rs.sys\",0.0103,1.0077,0.0103,1.0077\n\"D831\",\"D831\",\"win32kbase_rs.sys\",0.0102,0.9954,0.0102,0.9954\n\"138B4\",\"138B4\",\"win32kbase_rs.sys\",0.0102,0.9930,0.0102,0.9930\n\"A0E4\",\"A0E4\",\"win32kbase_rs.sys\",0.0100,0.9704,0.0100,0.9704\n\"9C2D\",\"9C2D\",\"win32kbase_rs.sys\",0.0068,0.6613,0.0068,0.6613\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_win32kfull.sys_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"5F746\",\"5F746\",\"win32kfull.sys\",0.0381,3.7132,0.0381,3.7132\n\"1B49E8\",\"1B49E8\",\"win32kfull.sys\",0.0217,2.1123,0.0217,2.1123\n\"5F59D\",\"5F59D\",\"win32kfull.sys\",0.0205,2.0000,0.0205,2.0000\n\"14F4FD\",\"14F4FD\",\"win32kfull.sys\",0.0161,1.5704,0.0161,1.5704\n\"5F5A5\",\"5F5A5\",\"win32kfull.sys\",0.0136,1.3223,0.0136,1.3223\n\"5AFAF\",\"5AFAF\",\"win32kfull.sys\",0.0121,1.1805,0.0121,1.1805\n\"594F4\",\"594F4\",\"win32kfull.sys\",0.0115,1.1159,0.0115,1.1159\n\"CB0D3\",\"CB0D3\",\"win32kfull.sys\",0.0114,1.1129,0.0114,1.1129\n\"594C1\",\"594C1\",\"win32kfull.sys\",0.0104,1.0180,0.0104,1.0180\n\"2B57D\",\"2B57D\",\"win32kfull.sys\",0.0104,1.0154,0.0104,1.0154\n\"5F5EE\",\"5F5EE\",\"win32kfull.sys\",0.0103,1.0056,0.0103,1.0056\n\"5F5BD\",\"5F5BD\",\"win32kfull.sys\",0.0099,0.9598,0.0099,0.9598\n\"5F74E\",\"5F74E\",\"win32kfull.sys\",0.0053,0.5176,0.0053,0.5176\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_win32u.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"12C4\",\"12C4\",\"win32u.dll\",0.4115,40.0890,0.9964,97.0850\n\"ACE4\",\"ACE4\",\"win32u.dll\",0.3096,30.1676,0.3096,30.1676\n\"13A4\",\"13A4\",\"win32u.dll\",0.1884,18.3594,0.1884,18.3594\n\"12A4\",\"12A4\",\"win32u.dll\",0.1679,16.3559,0.1679,16.3559\n\"2084\",\"2084\",\"win32u.dll\",0.1015,9.8908,0.2308,22.4867\n\"1344\",\"1344\",\"win32u.dll\",0.0920,8.9620,0.4832,47.0821\n\"3924\",\"3924\",\"win32u.dll\",0.0824,8.0248,0.0824,8.0248\n\"4B44\",\"4B44\",\"win32u.dll\",0.0715,6.9626,0.0715,6.9626\n\"1CE4\",\"1CE4\",\"win32u.dll\",0.0618,6.0210,0.7041,68.5968\n\"9804\",\"9804\",\"win32u.dll\",0.0616,6.0000,0.0616,6.0000\n\"5104\",\"5104\",\"win32u.dll\",0.0515,5.0203,0.0515,5.0203\n\"16C4\",\"16C4\",\"win32u.dll\",0.0354,3.4443,0.0763,7.4303\n\"5EE4\",\"5EE4\",\"win32u.dll\",0.0299,2.9089,0.0299,2.9089\n\"1424\",\"1424\",\"win32u.dll\",0.0286,2.7829,0.0286,2.7829\n\"B484\",\"B484\",\"win32u.dll\",0.0281,2.7397,0.0281,2.7397\n\"2124\",\"2124\",\"win32u.dll\",0.0239,2.3248,0.0239,2.3248\n\"3AE4\",\"3AE4\",\"win32u.dll\",0.0238,2.3161,0.0238,2.3161\n\"20C4\",\"20C4\",\"win32u.dll\",0.0234,2.2824,0.0234,2.2824\n\"1BE4\",\"1BE4\",\"win32u.dll\",0.0228,2.2253,0.0228,2.2253\n\"4D24\",\"4D24\",\"win32u.dll\",0.0215,2.0977,0.0215,2.0977\n\"CB84\",\"CB84\",\"win32u.dll\",0.0213,2.0759,0.0213,2.0759\n\"93A4\",\"93A4\",\"win32u.dll\",0.0211,2.0523,0.0211,2.0523\n\"1444\",\"1444\",\"win32u.dll\",0.0205,2.0000,0.0205,2.0000\n\"14C4\",\"14C4\",\"win32u.dll\",0.0205,2.0000,0.0205,2.0000\n\"15C4\",\"15C4\",\"win32u.dll\",0.0205,2.0000,0.0205,2.0000\n\"20B0\",\"20B0\",\"win32u.dll\",0.0205,2.0000,0.0205,2.0000\n\"26E4\",\"26E4\",\"win32u.dll\",0.0205,2.0000,0.0205,2.0000\n\"2BA4\",\"2BA4\",\"win32u.dll\",0.0205,2.0000,0.0205,2.0000\n\"9CE4\",\"9CE4\",\"win32u.dll\",0.0205,2.0000,0.0205,2.0000\n\"C784\",\"C784\",\"win32u.dll\",0.0182,1.7695,0.0182,1.7695\n\"A044\",\"A044\",\"win32u.dll\",0.0181,1.7659,0.0181,1.7659\n\"9A64\",\"9A64\",\"win32u.dll\",0.0176,1.7141,0.0176,1.7141\n\"19E4\",\"19E4\",\"win32u.dll\",0.0171,1.6671,0.0171,1.6671\n\"29A4\",\"29A4\",\"win32u.dll\",0.0155,1.5056,0.0155,1.5056\n\"B9A4\",\"B9A4\",\"win32u.dll\",0.0126,1.2282,0.0126,1.2282\n\"1704\",\"1704\",\"win32u.dll\",0.0108,1.0518,0.0108,1.0518\n\"2C84\",\"2C84\",\"win32u.dll\",0.0106,1.0342,0.0311,3.0342\n\"16A4\",\"16A4\",\"win32u.dll\",0.0105,1.0207,0.0105,1.0207\n\"1364\",\"1364\",\"win32u.dll\",0.0105,1.0204,0.0105,1.0204\n\"2804\",\"2804\",\"win32u.dll\",0.0104,1.0127,0.0104,1.0127\n\"17A4\",\"17A4\",\"win32u.dll\",0.0104,1.0126,0.0104,1.0126\n\"66C4\",\"66C4\",\"win32u.dll\",0.0104,1.0118,0.0104,1.0118\n\"3584\",\"3584\",\"win32u.dll\",0.0104,1.0091,0.0104,1.0091\n\"5444\",\"5444\",\"win32u.dll\",0.0103,1.0042,0.0103,1.0042\n\"13C4\",\"13C4\",\"win32u.dll\",0.0103,1.0041,0.0103,1.0041\n\"21C4\",\"21C4\",\"win32u.dll\",0.0103,1.0007,0.0103,1.0007\n\"21A4\",\"21A4\",\"win32u.dll\",0.0102,0.9969,0.0102,0.9969\n\"1DE4\",\"1DE4\",\"win32u.dll\",0.0102,0.9934,0.0102,0.9934\n\"6E64\",\"6E64\",\"win32u.dll\",0.0101,0.9885,0.0101,0.9885\n\"24E4\",\"24E4\",\"win32u.dll\",0.0101,0.9854,0.0101,0.9854\n\"1C84\",\"1C84\",\"win32u.dll\",0.0101,0.9822,0.0101,0.9822\n\"12E0\",\"12E0\",\"win32u.dll\",0.0101,0.9818,0.0101,0.9818\n\"8644\",\"8644\",\"win32u.dll\",0.0100,0.9786,0.0100,0.9786\n\"2564\",\"2564\",\"win32u.dll\",0.0095,0.9270,0.0095,0.9270\n\"2F24\",\"2F24\",\"win32u.dll\",0.0092,0.8954,0.0092,0.8954\n\"5524\",\"5524\",\"win32u.dll\",0.0064,0.6212,0.0064,0.6212\n\"4BE4\",\"4BE4\",\"win32u.dll\",0.0062,0.6003,0.0062,0.6003\n\"A304\",\"A304\",\"win32u.dll\",0.0012,0.1207,0.0012,0.1207\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_windows.storage.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"1556CA\",\"1556CA\",\"windows.storage.dll\",0.0131,1.2783,0.0131,1.2783\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_winhttp.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"10646\",\"10646\",\"winhttp.dll\",0.0205,2.0000,0.0205,2.0000\n\"2F400\",\"2F400\",\"winhttp.dll\",0.0205,2.0000,0.0205,2.0000\n\"3FD75\",\"3FD75\",\"winhttp.dll\",0.0205,2.0000,0.0205,2.0000\n\"4DF51\",\"4DF51\",\"winhttp.dll\",0.0110,1.0730,0.0110,1.0730\n\"54761\",\"54761\",\"winhttp.dll\",0.0102,0.9955,0.0102,0.9955\n\"7C5D1\",\"7C5D1\",\"winhttp.dll\",0.0102,0.9933,0.0102,0.9933\n\"170F4\",\"170F4\",\"winhttp.dll\",0.0102,0.9899,0.0102,0.9899\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_wininet.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"9BB16\",\"9BB16\",\"wininet.dll\",0.0314,3.0549,0.0314,3.0549\n\"1CC5FB\",\"1CC5FB\",\"wininet.dll\",0.0307,2.9944,0.0307,2.9944\n\"3B1F8\",\"3B1F8\",\"wininet.dll\",0.0300,2.9262,0.0300,2.9262\n\"613B7\",\"613B7\",\"wininet.dll\",0.0205,2.0000,0.0205,2.0000\n\"66500\",\"66500\",\"wininet.dll\",0.0205,2.0000,0.0205,2.0000\n\"9F26C\",\"9F26C\",\"wininet.dll\",0.0205,2.0000,0.0205,2.0000\n\"A0E59\",\"A0E59\",\"wininet.dll\",0.0205,2.0000,0.0205,2.0000\n\"736DC\",\"736DC\",\"wininet.dll\",0.0103,1.0036,0.0103,1.0036\n\"AA950\",\"AA950\",\"wininet.dll\",0.0103,1.0018,0.0103,1.0018\n\"4B72C\",\"4B72C\",\"wininet.dll\",0.0101,0.9889,0.0101,0.9889\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_wosc.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"EF38\",\"EF38\",\"wosc.dll\",0.0102,0.9956,0.0102,0.9956\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_ws2_32.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"272BC\",\"272BC\",\"ws2_32.dll\",0.0308,2.9989,0.0308,2.9989\n\"B590\",\"B590\",\"ws2_32.dll\",0.0205,2.0000,0.0205,2.0000\n\"D399\",\"D399\",\"ws2_32.dll\",0.0205,2.0000,0.0205,2.0000\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/functions_xmllite.dll_baseline.csv",
    "content": "Name,Address,Module,SelfTimePercentage,SelfTimeMs,TotalTimePercentage,TotalTimeMs\n\"FD30\",\"FD30\",\"xmllite.dll\",0.0205,2.0000,0.0205,2.0000\n\"DC45\",\"DC45\",\"xmllite.dll\",0.0154,1.4975,0.0154,1.4975\n\"DADC\",\"DADC\",\"xmllite.dll\",0.0138,1.3490,0.0138,1.3490\n\"14AE8\",\"14AE8\",\"xmllite.dll\",0.0081,0.7934,0.0081,0.7934\n\"14D2A\",\"14D2A\",\"xmllite.dll\",0.0044,0.4307,0.0044,0.4307\n\"10CE4\",\"10CE4\",\"xmllite.dll\",0.0035,0.3379,0.0035,0.3379\n\"1633A\",\"1633A\",\"xmllite.dll\",0.0034,0.3327,0.3295,32.1016\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/modules_baseline.csv",
    "content": "Name,WeightPercentage,TimeMs\n\"ntdll.dll\",42.9829,4187.8697\n\"ntoskrnl.exe\",19.1921,1869.9106\n\"Mso20win32client.dll\",3.7002,360.5168\n\"Mso40UIwin32client.dll\",3.1944,311.2328\n\"Mso30win32client.dll\",3.0746,299.5610\n\"AppvIsvSubsystems64.dll\",2.9577,288.1724\n\"CI.dll\",2.4513,238.8320\n\"win32u.dll\",2.3402,228.0078\n\"ucrtbase.dll\",2.1845,212.8341\n\"cng.sys\",1.8954,184.6721\n\"combase.dll\",1.7229,167.8598\n\"KernelBase.dll\",1.7068,166.2996\n\"Windows.Web.dll\",1.0492,102.2255\n\"MSOARIA.DLL\",0.9638,93.9026\n\"vcruntime140.dll\",0.7893,76.9048\n\"rpcrt4.dll\",0.5473,53.3289\n\"nvwgf2umx_cfg.dll\",0.5245,51.1011\n\"DWrite.dll\",0.5203,50.6927\n\"kernel32.dll\",0.4280,41.6982\n\"bcryptprimitives.dll\",0.3727,36.3167\n\"MSO.DLL\",0.3535,34.4413\n\"Mso98win32client.dll\",0.3271,31.8744\n\"WinTypes.dll\",0.3239,31.5608\n\"crypt32.dll\",0.3216,31.3348\n\"FLTMGR.SYS\",0.2996,29.1923\n\"win32kbase.sys\",0.2755,26.8409\n\"webio.dll\",0.2639,25.7157\n\"msvcp140.dll\",0.2565,24.9943\n\"imagehlp.dll\",0.2559,24.9315\n\"mssecflt.sys\",0.2482,24.1811\n\"Ntfs.sys\",0.2077,20.2327\n\"wininet.dll\",0.2050,19.9698\n\"dcomp.dll\",0.2028,19.7562\n\"win32kfull.sys\",0.1914,18.6439\n\"TextShaping.dll\",0.1831,17.8370\n\"PPCORE.DLL\",0.1794,17.4776\n\"Windows.Security.Authentication.Web.Core.dll\",0.1667,16.2420\n\"WindowsCodecs.dll\",0.1558,15.1791\n\"nvlddmkm.sys\",0.1554,15.1444\n\"win32kbase_rs.sys\",0.1511,14.7212\n\"MSPST32.DLL\",0.1508,14.6954\n\"d3d11.dll\",0.1351,13.1660\n\"oleaut32.dll\",0.1313,12.7928\n\"WdFilter.sys\",0.1296,12.6251\n\"OLMAPI32.DLL\",0.1295,12.6138\n\"aitrx.dll\",0.1207,11.7603\n\"d2d1.dll\",0.1190,11.5927\n\"winhttp.dll\",0.1032,10.0517\n\"user32.dll\",0.1026,9.9937\n\"iertutil.dll\",0.0967,9.4243\n\"dpapi.dll\",0.0824,8.0252\n\"EMSMDB32.DLL\",0.0822,8.0042\n\"CoreMessaging.dll\",0.0821,7.9979\n\"fcon.dll\",0.0816,7.9531\n\"ws2_32.dll\",0.0718,6.9989\n\"xmllite.dll\",0.0692,6.7412\n\"bcrypt.dll\",0.0606,5.9067\n\"sechost.dll\",0.0511,4.9804\n\"Wldap32.dll\",0.0483,4.7034\n\"UIAutomationCore.dll\",0.0458,4.4606\n\"webservices.dll\",0.0451,4.3979\n\"bindflt.sys\",0.0411,4.0000\n\"mswsock.dll\",0.0317,3.0857\n\"uxtheme.dll\",0.0310,3.0251\n\"MSPTLS.DLL\",0.0309,3.0086\n\"Windows.StateRepositoryCore.dll\",0.0255,2.4855\n\"FlightSettings.dll\",0.0219,2.1378\n\"OneCoreUAPCommonProxyStub.dll\",0.0207,2.0136\n\"C2R64.dll\",0.0205,2.0000\n\"comctl32.dll\",0.0205,2.0000\n\"fvevol.sys\",0.0205,2.0000\n\"MicrosoftAccountWAMExtension.dll\",0.0205,2.0000\n\"NETIO.SYS\",0.0205,2.0000\n\"nvldumdx.dll\",0.0205,2.0000\n\"PktMon.sys\",0.0205,2.0000\n\"schannel.dll\",0.0205,2.0000\n\"sspicli.dll\",0.0205,2.0000\n\"vaultcli.dll\",0.0205,2.0000\n\"Windows.Networking.Connectivity.dll\",0.0205,2.0000\n\"gdi32full.dll\",0.0196,1.9122\n\"dxgmms2.sys\",0.0181,1.7622\n\"OART.DLL\",0.0180,1.7555\n\"fileinfo.sys\",0.0165,1.6067\n\"windows.storage.dll\",0.0131,1.2783\n\"ksecdd.sys\",0.0123,1.1984\n\"dhcpcsvc6.dll\",0.0114,1.1154\n\"dxgkrnl.sys\",0.0104,1.0173\n\"e1d.sys\",0.0104,1.0148\n\"intelppm.sys\",0.0104,1.0090\n\"Mso50win32client.dll\",0.0103,1.0017\n\"ahcache.sys\",0.0103,1.0001\n\"dxgi.dll\",0.0102,0.9974\n\"wosc.dll\",0.0102,0.9956\n\"msasn1.dll\",0.0102,0.9943\n\"dhcpcsvc.dll\",0.0102,0.9917\n\"cpprestsdk.dll\",0.0102,0.9904\n\"IPHLPAPI.DLL\",0.0102,0.9897\n\"msxml6.dll\",0.0029,0.2836\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/MsoTrace/processes_baseline.csv",
    "content": "Name,WeightPercentage,DurationMs,ProcessId,CommandLine\n\"msiexec\",15.8379,0.0000,43012,\"C:\\WINDOWS\\system32\\msiexec.exe /V\"\n\"MsMpEng\",15.0104,0.0000,7852,\"\"\"C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\4.18.25070.5-0\\MsMpEng.exe\"\"\"\n\"POWERPNT\",11.8762,0.0000,34376,\"\"\"C:\\Program Files\\Microsoft Office\\root\\Office16\\POWERPNT.EXE\"\" \"\n\"svchost\",7.5690,0.0000,7416,\"C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p -s TokenBroker\"\n\"System\",6.0552,648.3761,4,\"\"\n\"devenv\",3.8146,0.0000,21220,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\devenv.exe\"\" \"\"D:\\profile-explorer\\src\\ProfileExplorer.sln\"\"\"\n\"MsSense\",3.2469,0.0000,5500,\"\"\"C:\\Program Files\\Windows Defender Advanced Threat Protection\\MsSense.exe\"\"\"\n\"backgroundTaskHost\",3.2183,0.0000,46296,\"\"\"C:\\WINDOWS\\system32\\BackgroundTaskHost.exe\"\" -ServerName:BackgroundTaskHost.WebAccountProvider\"\n\"svchost\",2.4074,0.0000,1248,\"C:\\WINDOWS\\system32\\svchost.exe -k RPCSS -p\"\n\"WmiPrvSE\",2.0800,0.0000,7156,\"C:\\WINDOWS\\system32\\wbem\\wmiprvse.exe -secured -Embedding\"\n\"Idle\",1.9553,0.0000,0,\"\"\n\"svchost\",1.9268,5.4607,3288,\"C:\\WINDOWS\\system32\\svchost.exe -k NetworkService -p\"\n\"wpr\",1.5874,1259.3971,16800,\"\"\"C:\\WINDOWS\\system32\\wpr.exe\"\" -stop trace.etl\"\n\"dwm\",1.5694,0.0000,1356,\"\"\"dwm.exe\"\"\"\n\"lsass\",1.4042,0.0000,1628,\"C:\\WINDOWS\\system32\\lsass.exe\"\n\"RuntimeBroker\",1.3546,0.0000,46356,\"C:\\Windows\\System32\\RuntimeBroker.exe -Embedding\"\n\"services\",1.2675,0.0000,1552,\"C:\\WINDOWS\\system32\\services.exe\"\n\"NisSrv\",1.2300,0.0000,2608,\"\"\"C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\4.18.25070.5-0\\NisSrv.exe\"\"\"\n\"svchost\",1.0873,0.0000,2312,\"C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p -s UserManager\"\n\"powershell\",0.9296,576.2559,49428,\"\"\"powershell.exe\"\" \"\"C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\AzureSecurityPack\\Watchdog.ps1\"\"\"\n\"sihost\",0.8260,0.0000,9192,\"sihost.exe\"\n\"svchost\",0.8125,0.0000,8488,\"C:\\WINDOWS\\System32\\svchost.exe -k netsvcs -p -s NetSetupSvc\"\n\"ai\",0.7839,785.5657,36368,\"\"\"C:\\Program Files\\Microsoft Office\\root\\vfs\\ProgramFilesCommonX64\\Microsoft Shared\\OFFICE16\\AI\\ai.exe\"\" \"\"653D2B2D-4040-4765-AC6E-BE73CF322FDD\"\" \"\"54E1869C-B1D2-4ED1-AD42-18A506795C0F\"\" \"\"34376\"\" \"\"C:\\Program Files\\Microsoft Office\\root\\Office16\\POWERPNT.EXE\"\" \"\"PowerPointCombinedFloatieLreOnline.onnx\"\"\"\n\"MpDlpService\",0.7734,0.0000,11476,\"\"\"C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\4.18.25070.5-0\\MpDlpService.exe\"\"\"\n\"explorer\",0.7539,0.0000,8464,\"C:\\WINDOWS\\Explorer.EXE\"\n\"officesvcmgr\",0.7058,6130.0417,40936,\"officesvcmgr.exe /checkin {ea88725a-03af-4c5c-8c08-463fb7cbb8ef}\"\n\"svchost\",0.6923,0.0000,1876,\"C:\\WINDOWS\\system32\\svchost.exe -k DcomLaunch -p\"\n\"PAD.Console.Host\",0.6428,0.0000,23092,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.PowerAutomateDesktop_11.2508.104.0_x64__8wekyb3d8bbwe\\dotnet\\PAD.Console.Host.exe\"\" \"\n\"ms-teams\",0.5842,0.0000,21028,\"\"\"C:\\Program Files\\WindowsApps\\MSTeams_25227.201.3887.7121_x64__8wekyb3d8bbwe\\ms-teams.exe\"\" msteams:system-initiated\"\n\"Widgets\",0.5647,0.0000,1224,\"\"\"C:\\Program Files\\WindowsApps\\MicrosoftWindows.Client.WebExperience_525.22301.0.0_x64__cw5n1h2txyewy\\Dashboard\\Widgets.exe\"\" -ServerName:Microsoft.Windows.DashboardServer\"\n\"GlobalSecureAccessTunnelingService\",0.4175,0.0000,26060,\"\"\"C:\\Program Files\\Global Secure Access Client\\GlobalSecureAccessTunnelingService.exe\"\"\"\n\"PAD.AutomationServer\",0.3289,0.0000,21472,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.PowerAutomateDesktop_11.2508.104.0_x64__8wekyb3d8bbwe\\dotnet\\PAD.AutomationServer.exe\"\" --ClientId=\"\"2cfe3c41-985f-4b38-80be-aa4676b17dfb\"\" --CallerProcessId=23092 --ParentCorrelationId=\"\"cb6575f3-d03c-4e44-a4d8-51de166d4689\"\" --SessionId=\"\"d1c42f05-af17-4d69-9f35-2ed959314426\"\" \"\n\"WindowsTerminal\",0.3214,0.0000,49988,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.22.12111.0_x64__8wekyb3d8bbwe\\WindowsTerminal.exe\"\" \"\n\"svchost\",0.2838,0.0000,4944,\"C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p -s Winmgmt\"\n\"WmiPrvSE\",0.2808,0.0000,8648,\"C:\\WINDOWS\\system32\\wbem\\wmiprvse.exe -secured -Embedding\"\n\"GlobalSecureAccessEngineService\",0.2718,0.0000,26340,\"\"\"C:\\Program Files\\Global Secure Access Client\\GlobalSecureAccessEngineService.exe\"\"\"\n\"svchost\",0.2343,0.0000,1212,\"C:\\WINDOWS\\system32\\svchost.exe -k DcomLaunch -p -s LSM\"\n\"csrss\",0.2313,0.0000,1464,\"%SystemRoot%\\system32\\csrss.exe ObjectDirectory=\\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16\"\n\"msedgewebview2\",0.2268,0.0000,3156,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-agent=\"\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; Cortana 1.18.9.23723; 10.0.0.0.29430.1000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.29430 IsWebView2/True (WebView2Version 139.0.3405.102)\"\" --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --webview-exe-name=SearchHost.exe --webview-exe-version=2125.20401.0.2000 --embedded-browser-webview=1 --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --js-flags=\"\"--expose-gc --ms-user-locale=\"\" --time-ticks-at-unix-epoch=-1755680330160127 --launch-time-ticks=31988846450 --always-read-main-dll --metrics-shmem-handle=3592,i,13601118859329866100,3094116253972930061,2097152 --field-trial-handle=1948,i,16794949237765112\"\n\"svchost\",0.2208,0.0000,4024,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalServiceHttp -p\"\n\"ctfmon\",0.1892,0.0000,13824,\"/QuitInfo:00000000000002BC;00000000000002C0; \"\n\"SenseTracer\",0.1577,0.0000,11924,\"\"\"C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseTracer.exe\"\" -in:etw -trace -sequence -session:{351166AE-A94D-493D-B349-E26DEA024EBA} -event:4148 -timer:60 -provider:128126 -level:31 -d \"\"C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Trace\"\"\"\n\"svchost\",0.1577,0.0000,10004,\"C:\\WINDOWS\\System32\\svchost.exe -k utcsvc -p\"\n\"svchost\",0.1547,0.0000,5360,\"C:\\WINDOWS\\System32\\svchost.exe -k LocalServiceNoNetwork -p -s DPS\"\n\"OfficeClickToRun\",0.1502,0.0000,5520,\"\"\"C:\\Program Files\\Common Files\\Microsoft Shared\\ClickToRun\\OfficeClickToRun.exe\"\" /service\"\n\"vmms\",0.1216,0.0000,8072,\"C:\\WINDOWS\\system32\\vmms.exe\"\n\"Microsoft.Engineering.FileVirtualization.Daemon\",0.1171,0.0000,14020,\"\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\VPack\\VPackLegacy\\Microsoft.Engineering.FileVirtualization.Daemon.exe\"\"\"\n\"svchost\",0.1171,0.0000,11500,\"C:\\WINDOWS\\system32\\svchost.exe -k UnistackSvcGroup -s CDPUserSvc\"\n\"Microsoft.Management.Services.IntuneWindowsAgent\",0.1141,0.0000,6332,\"\"\"C:\\Program Files (x86)\\Microsoft Intune Management Extension\\Microsoft.Management.Services.IntuneWindowsAgent.exe\"\"\"\n\"MDMAppInstaller\",0.1066,0.0000,9724,\"\"\"C:\\WINDOWS\\system32\\MDMAppInstaller.exe\"\"\"\n\"MemCompression\",0.1036,0.0000,4384,\"\"\n\"TextInputHost\",0.0991,0.0000,5764,\"\"\"C:\\Windows\\SystemApps\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\TextInputHost.exe\"\" -ServerName:InputApp.AppXk0k6mrh4r2q0ct33a9wgbez0x7v9cz5y.mca\"\n\"GlobalSecureAccessClient\",0.0976,0.0000,21716,\"\"\"C:\\Program Files\\Global Secure Access Client\\TrayApp\\GlobalSecureAccessClient.exe\"\"\"\n\"pwsh\",0.0976,0.0000,39536,\"\"\"C:\\Program Files\\PowerShell\\7\\pwsh.exe\"\"\"\n\"svchost\",0.0976,0.0000,10244,\"C:\\WINDOWS\\System32\\svchost.exe -k NetworkService -s TermService\"\n\"conhost\",0.0961,567.5633,43904,\"\\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4\"\n\"SenseNdr\",0.0946,0.0000,48664,\"\"\"C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseNdr.exe\"\" -\"\n\"svchost\",0.0946,0.0000,3228,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalServiceNetworkRestricted -p -s Dhcp\"\n\"OpenConsole\",0.0931,0.0000,38492,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.WindowsTerminal_1.22.12111.0_x64__8wekyb3d8bbwe\\OpenConsole.exe\"\" --headless --textMeasurement graphemes --width 120 --height 30 --signal 0xa28 --server 0x944\"\n\"svchost\",0.0781,0.0000,3404,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalService -p -s CDPSvc\"\n\"msedgewebview2\",0.0721,0.0000,21124,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\EBWebView\"\" --webview-exe-name=ms-teams.exe --webview-exe-version=25227.201.3887.7121 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --autoplay-policy=no-user-gesture-required --disable-background-timer-throttling --enable-blink-features=IndexedDbGetAllRecords --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=6 --js-flags=\"\"--stack-trace-limit=50 --expose-gc --ms-user-locale=en-US\"\" --time-ticks-at-unix-epoch=-1755680330159115 --launch-time-ticks=32151898401 --always-read-main-dll --metrics-shmem-handle=4440,i,15304891087169025689,13205086796921645268,2097152 --field-trial-handle=1848,i,9232284790936083051,8827603450831\"\n\"SearchIndexer\",0.0691,0.0000,11340,\"C:\\WINDOWS\\system32\\SearchIndexer.exe /Embedding\"\n\"svchost\",0.0661,0.0000,3572,\"C:\\WINDOWS\\System32\\svchost.exe -k netprofm -p -s netprofm\"\n\"svchost\",0.0646,0.0000,4488,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalService -p -s FontCache\"\n\"msedgewebview2\",0.0616,0.0000,30984,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=olk.exe --webview-exe-version=1.2025.806.300 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Olk\\EBWebView\"\" --noerrdialogs --embedded-browser-webview-dpi-awareness=2 --disable-features=msEnhancedTrackingPreventionEnabled --enable-aggressive-domstorage-flushing --enable-features=msSingleSignOnOSForPrimaryAccountIsShared,msAbydos,msAbydosHandwritingAttr,msAbydosGestureSupport,msEnhancedTextContrast --mojo-named-platform-channel-pipe=16472.30956.517669952921803472 /pfhostedapp:a8877bbce1455e1e7d0708640add3c7185451dd9\"\n\"qcmtusvc\",0.0571,0.0000,5536,\"\"\"C:\\Program Files (x86)\\QUALCOMM Incorporated\\Qualcomm USB Drivers For Windows\\DriverPackage\\Qualcomm\\Tools\\qcmtusvc.exe\"\"\"\n\"System\",0.0541,648.3761,4,\"\"\n\"CcmExec\",0.0526,0.0000,3124,\"C:\\Windows\\CCM\\CcmExec.exe\"\n\"svchost\",0.0511,0.0000,4164,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalSystemNetworkRestricted -p -s SysMain\"\n\"wslservice\",0.0496,0.0000,5492,\"\"\"C:\\Program Files\\WSL\\wslservice.exe\"\"\"\n\"msedgewebview2\",0.0451,0.0000,31928,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Olk\\EBWebView\"\" --webview-exe-name=olk.exe --webview-exe-version=1.2025.806.300 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=6 --js-flags=\"\"--expose-gc --ms-user-locale=\"\" --time-ticks-at-unix-epoch=-1755680330158751 --launch-time-ticks=32210482544 --always-read-main-dll --metrics-shmem-handle=4224,i,17895423284350772904,11130741382341777934,2097152 --field-trial-handle=1940,i,8033129406060731551,14143038207632028611,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAbydos,msAbydosGestureSupport,msAbydosHandwritingAttr,msAggressiveCacheTrimming,msCustomDataPartition,msEnhancedTextContrast,msSingleSignOn\"\n\"schtasks\",0.0451,46.3700,11152,\"schtasks.exe /change /tn \"\"Microsoft\\Office\\Office Serviceability Manager\"\" /enable\"\n\"csrss\",0.0436,0.0000,1364,\"%SystemRoot%\\system32\\csrss.exe ObjectDirectory=\\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16\"\n\"svchost\",0.0421,0.0000,556,\"C:\\WINDOWS\\System32\\svchost.exe -k NetworkService -p\"\n\"svchost\",0.0421,0.0000,2920,\"C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p -s Schedule\"\n\"Notepad\",0.0390,0.0000,27364,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.WindowsNotepad_11.2507.28.0_x64__8wekyb3d8bbwe\\Notepad\\Notepad.exe\"\" RestartByRestartManager:*\"\n\"schtasks\",0.0390,93.1604,32492,\"schtasks.exe /Create /tn \"\"Microsoft\\Office\\Office Serviceability Manager\"\" /XML \"\"C:\\Program Files\\Common Files\\Microsoft Shared\\ClickToRun\\OfficeSvcMgrSchedule_390M.xml\"\"\"\n\"msedgewebview2\",0.0375,0.0000,15000,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=ms-teams.exe --webview-exe-version=25227.201.3887.7121 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\EBWebView\"\" --noerrdialogs --embedded-browser-webview-dpi-awareness=2 --autoplay-policy=no-user-gesture-required --disable-background-timer-throttling --disable-features=msEnhancedTrackingPreventionEnabled,BreakoutBoxPreferCaptureTimestampInVideoFrames,msWebOOUI --enable-blink-features=IndexedDbGetAllRecords --enable-features=msSingleSignOnOSForPrimaryAccountIsShared,AutofillReplaceCachedWebElementsByRendererIds,DocumentPolicyIncludeJSCallStacksInCrashReports,PartitionedCookies,PreferredAudioOutputDevices,SharedArrayBuffer,SkipGrantAccessToDataPathIfAlreadySet,ThirdPartyStoragePartitioning,msAbydos,msAbydosGestureSupport,msAbydosHandwritingAttr,msWebView2EnableDraggableRegions,msWebView2SetUserAgentOve\"\n\"schtasks\",0.0375,44.2041,23744,\"schtasks.exe /Delete /F /tn \"\"Microsoft\\Office\\Office Serviceability Manager\"\"\"\n\"svchost\",0.0375,0.0000,19072,\"C:\\WINDOWS\\System32\\svchost.exe -k UnistackSvcGroup\"\n\"msedgewebview2\",0.0360,0.0000,16868,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=SearchHost.exe --webview-exe-version=2125.20401.0.2000 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --noerrdialogs --disable-features=msSmartScreenProtection --edge-webview-enable-mojo-ipcz --enable-features=msEdgeFluentOverlayScrollbar --user-agent=\"\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; Cortana 1.18.9.23723; 10.0.0.0.29430.1000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.29430 IsWebView2/True (WebView2Version 139.0.3405.102)\"\" --lang=en-US --mojo-named-platform-channel-pipe=5140.16840.14487594390742658058 /pfhostedapp:f1b3cc9189bc16db4ff1ff60d85fd8edd4446ca1\"\n\"POWERPNT\",0.0360,0.0000,36284,\"\"\"C:\\Program Files\\Microsoft Office\\root\\Office16\\POWERPNT.EXE\"\" \"\n\"conhost\",0.0345,6120.8743,39060,\"\\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4\"\n\"schtasks\",0.0345,45.0367,13884,\"schtasks.exe /change /tn \"\"Microsoft\\Office\\Office Serviceability Manager\"\" /enable\"\n\"PAD.BridgeToUIAutomation2\",0.0330,0.0000,22796,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.PowerAutomateDesktop_11.2508.104.0_x64__8wekyb3d8bbwe\\dotnet\\PAD.BridgeToUIAutomation2.exe\"\" --guid=79f94607-a7ed-4833-8f7b-d83b11f6a29c --callerProcessId=21472 --service=\"\"uia2\"\"\"\n\"schtasks\",0.0330,36.2390,11528,\"schtasks.exe /change /tn \"\"Microsoft\\Office\\Office Serviceability Manager\"\" /enable\"\n\"SenseAP\",0.0330,0.0000,11848,\"-\"\n\"svchost\",0.0330,0.0000,9792,\"C:\\WINDOWS\\system32\\svchost.exe -k UnistackSvcGroup -s WpnUserService\"\n\"CrossDeviceService\",0.0315,0.0000,15808,\"\"\"C:\\Program Files\\WindowsApps\\MicrosoftWindows.CrossDevice_1.25082.21.0_x64__cw5n1h2txyewy\\CrossDeviceService.exe\"\" \"\n\"EpmService\",0.0315,0.0000,5440,\"\"\"C:\\Program Files\\Microsoft EPM Agent\\EPMService\\EpmService.exe\"\"\"\n\"conhost\",0.0300,84.4341,42996,\"\\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4\"\n\"conhost\",0.0300,40.9768,45792,\"\\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4\"\n\"ServiceHub.Host.dotnet.x64\",0.0300,0.0000,18732,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\ServiceHub\\Hosts\\ServiceHub.Host.dotnet.x64\\ServiceHub.Host.dotnet.x64.exe\"\" dotnet$C94B8CFE-E3FD-4BAF-A941-2866DBB566FE net.pipe://1978095EEE757A78F755D74184C209DDF30C6 \"\"/TelemetrySession:{\\\"\"TelemetryLevel\\\"\":null,\\\"\"IsOptedIn\\\"\":true,\\\"\"HostName\\\"\":\\\"\"Dev14\\\"\",\\\"\"AppInsightsInstrumentationKey\\\"\":\\\"\"f144292e-e3b2-4011-ac90-20e5c03fbce5\\\"\",\\\"\"AsimovInstrumentationKey\\\"\":\\\"\"AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70\\\"\",\\\"\"CollectorApiKey\\\"\":\\\"\"f3e86b4023cc43f0be495508d51f588a-f70d0e59-0fb0-4473-9f19-b4024cc340be-7296\\\"\",\\\"\"AppId\\\"\":1001,\\\"\"UserId\\\"\":\\\"\"2dba2122-c8a1-45b6-ac82-001f5865d3e3\\\"\",\\\"\"Id\\\"\":\\\"\"43746843-c2ce-42ef-9bc7-521b96990f7c\\\"\",\\\"\"ProcessStartTime\\\"\":638913092465839523,\\\"\"SkuName\\\"\":\\\"\"VS_Enterprise\\\"\",\\\"\"VSExeVersion\\\"\":\\\"\"17.14.36408.4\\\"\",\\\"\"BucketFiltersToEnableWatsonForFaults\\\"\":[],\\\"\"BucketFiltersToAddDumpsToFaults\\\"\":[]}\"\" $HostRemoteBrokerPipeName\"\n\"dllhost\",0.0270,0.0000,13556,\"C:\\WINDOWS\\system32\\DllHost.exe /Processid:{3EB3C877-1F16-487C-9050-104DBCD66683}\"\n\"conhost\",0.0255,39.7921,42372,\"\\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4\"\n\"svchost\",0.0255,0.0000,5752,\"C:\\WINDOWS\\system32\\svchost.exe -k whesvc -p -s whesvc\"\n\"svchost\",0.0255,0.0000,5068,\"C:\\WINDOWS\\system32\\svchost.exe -k appmodel -p -s StateRepository\"\n\"conhost\",0.0240,34.8336,45892,\"\\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4\"\n\"ms-teams\",0.0240,0.0000,22920,\"\"\"C:\\Program Files\\WindowsApps\\MSTeams_25227.201.3887.7121_x64__8wekyb3d8bbwe\\ms-teams.exe\"\" --process_type=native_module --cloud_type=tfw --module_name=SlimCore --native_msg_channel=efae90c4-9140-4abd-9719-30e192fa1062_nm_SlimCore_c_ --session_id=e1192526-138d-4206-a043-c1f4914dc198    /prefetch:1\"\n\"conhost\",0.0225,32.5879,47800,\"\\??\\C:\\WINDOWS\\system32\\conhost.exe 0x4\"\n\"svchost\",0.0225,0.0000,3756,\"C:\\WINDOWS\\System32\\svchost.exe -k LocalServiceNetworkRestricted -p -s EventLog\"\n\"msedgewebview2\",0.0210,0.0000,23712,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=Files.exe --webview-exe-version=2.2508.8001.0 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Files\\EBWebView\"\" --noerrdialogs --embedded-browser-webview-dpi-awareness=2 --disable-background-timer-throttling --disable-features=msEnhancedTrackingPreventionEnabled --mojo-named-platform-channel-pipe=24508.18624.12919052784708742098 /pfhostedapp:8d2be9d860645d1433e7026b8c330424301db0ff\"\n\"powershell\",0.0210,0.0000,23584,\"C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -Command \"\"& { Import-Module \"\"\"\"\"\"$env:VSAPPIDDIR\\..\\Tools\\Microsoft.VisualStudio.DevShell.dll\"\"\"\"\"\"; Enter-VsDevShell -SkipAutomaticLocation -SetDefaultWindowTitle -InstallPath $env:VSAPPIDDIR\\..\\..\\}\"\"\"\n\"StartMenuExperienceHost\",0.0210,0.0000,15732,\"\"\"C:\\Windows\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\StartMenuExperienceHost.exe\"\" -ServerName:App.AppXywbrabmsek0gm3tkwpr5kwzbs55tkqay.mca\"\n\"svchost\",0.0210,0.0000,2616,\"C:\\WINDOWS\\system32\\svchost.exe -k NetworkService -p\"\n\"OneDrive\",0.0195,0.0000,19892,\"\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\OneDrive\\OneDrive.exe\"\" /background\"\n\"RuntimeBroker\",0.0195,0.0000,14704,\"C:\\Windows\\System32\\RuntimeBroker.exe -Embedding\"\n\"SenseTVM\",0.0195,0.0000,6464,\"-\"\n\"msedgewebview2\",0.0180,0.0000,26776,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe\\LocalState\\EBWebView\"\" --webview-exe-name=WebViewHost.exe --webview-exe-version=19.2508.47021.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --js-flags=\"\"--expose-gc --ms-user-locale=\"\" --time-ticks-at-unix-epoch=-1755680330158914 --launch-time-ticks=32183936586 --always-read-main-dll --metrics-shmem-handle=3584,i,10806035289523513747,15074130377410245576,2097152 --field-trial-handle=1848,i,14228515077991255448,8574913679281551647,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msSingleSignOnOSForPrimaryAccountIs\"\n\"msiexec\",0.0150,0.0000,37100,\"\"\"C:\\WINDOWS\\system32\\msiexec.exe\"\" /quiet  /l*v \"\"C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\mdm\\{72E753E8-1D66-468D-B882-EC8E61A87383}.log\"\"  /qn /i \"\"C:\\WINDOWS\\system32\\config\\systemprofile\\AppData\\Local\\mdm\\{E1BF61B7-24EF-47F5-9396-1A6373DD3067}.msi\"\" \"\n\"svchost\",0.0150,0.0000,38520,\"C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p -s wlidsvc\"\n\"AlertusDesktopAlert\",0.0135,0.0000,25408,\"\"\"C:\\Program Files (x86)\\Alertus Technologies\\Alertus Desktop\\AlertusDesktopAlert.exe\"\" startup\"\n\"msedgewebview2\",0.0135,0.0000,8436,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=Widgets.exe --webview-exe-version=525.22300.0.0 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --noerrdialogs --disk-cache-size=52428800 --edge-webview-is-background --lang=en-US --mojo-named-platform-channel-pipe=1224.13600.16636695828072262375 /pfhostedapp:1ec15097b557f7f931966541b3f105cc5a47009c\"\n\"SearchHost\",0.0135,0.0000,5140,\"\"\"C:\\Windows\\SystemApps\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\SearchHost.exe\"\" -ServerName:CortanaUI.AppXstmwaab17q5s3y22tp6apqz7a45vwv65.mca\"\n\"msedgewebview2\",0.0120,0.0000,17148,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-agent=\"\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; Cortana 1.18.9.23723; 10.0.0.0.29430.1000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.29430 IsWebView2/True (WebView2Version 139.0.3405.102)\"\" --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --webview-exe-name=SearchHost.exe --webview-exe-version=2125.20401.0.2000 --embedded-browser-webview=1 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1780,i,2211480256080778027,5783864341995588904,262144 --field-trial-handle=1948,i,16794949237765112938,10744838110969316530,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCus\"\n\"PhoneExperienceHost\",0.0120,0.0000,21920,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.YourPhone_1.25072.63.0_x64__8wekyb3d8bbwe\\PhoneExperienceHost.exe\"\" -ComServer:Background -Embedding\"\n\"Registry\",0.0120,0.0000,296,\"\"\n\"svchost\",0.0120,0.0000,2800,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalService -p -s nsi\"\n\"WUDFHost\",0.0120,0.0000,1908,\"\"\"C:\\Windows\\System32\\WUDFHost.exe\"\" -HostGUID:{193a1820-d9ac-4997-8c55-be817523f6aa} -IoEventPortName:\\UMDFCommunicationPorts\\WUDF\\HostProcess-157bda5c-7958-42b6-932a-775815584c1d -SystemEventPortName:\\UMDFCommunicationPorts\\WUDF\\HostProcess-ea6da5aa-96d6-4ad3-8fac-4057f51c553e -IoCancelEventPortName:\\UMDFCommunicationPorts\\WUDF\\HostProcess-cb543c0e-8a47-4a12-9bb9-f492b3ef63ed -NonStateChangingEventPortName:\\UMDFCommunicationPorts\\WUDF\\HostProcess-7e87a0b2-c54f-4bcb-b359-0ed508c7843c -LifetimeId:4702324e-c675-4c94-bb36-d9e5639ea046 -DeviceGroupId:WudfDefaultDevicePool -HostArg:0\"\n\"DlpUserAgent\",0.0105,0.0000,5880,\"\"\"C:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\4.18.25070.5-0\\DlpUserAgent.exe\"\" \"\n\"msedgewebview2\",0.0105,0.0000,31524,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Olk\\EBWebView\"\" --webview-exe-name=olk.exe --webview-exe-version=1.2025.806.300 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --always-read-main-dll --metrics-shmem-handle=2052,i,3655781657003280441,16471773334285400042,524288 --field-trial-handle=1940,i,8033129406060731551,14143038207632028611,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAbydos,msAbydosGestureSupport,msAbydosHandwritingAttr,msAggressiveCacheTrimming,msCustomDataPartition,msEnhancedTextContrast,msSingleSignOnOSForPrimaryAccountIsShared,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,CloseOmniboxPopupOnInactiveAreaClick,C\"\n\"msedgewebview2\",0.0105,0.0000,27868,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=Calendar.exe --webview-exe-version=2.2508.8001.0 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Calendar\\EBWebView\"\" --noerrdialogs --embedded-browser-webview-dpi-awareness=2 --disable-background-timer-throttling --disable-features=msEnhancedTrackingPreventionEnabled --mojo-named-platform-channel-pipe=23828.27764.6576086402115476544 /pfhostedapp:a4a3cd379b99ec60983c9a9c438ccaad66ddb308\"\n\"msedgewebview2\",0.0090,0.0000,22364,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\EBWebView\"\" --webview-exe-name=ms-teams.exe --webview-exe-version=25227.201.3887.7121 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1672,i,11217648657666743546,15881069491224149345,262144 --field-trial-handle=1848,i,9232284790936083051,8827603450831938181,262144 --enable-features=AutofillReplaceCachedWebElementsByRendererIds,DocumentPolicyIncludeJSCallStacksInCrashReports,ForceSWDCompWhenDCompFallbackRequired,PartitionedCookies,PreferredAudioOutputDevices,SharedArrayBuffer,SkipGrantAccessToDataPathIfAlreadySet,ThirdPartyStoragePartitioning,\"\n\"msedgewebview2\",0.0090,0.0000,17176,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --noerrdialogs --user-agent=\"\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; Cortana 1.18.9.23723; 10.0.0.0.29430.1000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.29430 IsWebView2/True (WebView2Version 139.0.3405.102)\"\" --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --webview-exe-name=SearchHost.exe --webview-exe-version=2125.20401.0.2000 --embedded-browser-webview=1 --always-read-main-dll --metrics-shmem-handle=2180,i,11053815033230673970,12044020726328619558,524288 --field-trial-handle=1948,i,16794949237765112938,10744838110969316530,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msEdgeFluentOverlayScrollbar,msWebView2NoTabForScreenShare\"\n\"msedgewebview2\",0.0090,0.0000,28768,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Calendar\\EBWebView\"\" --webview-exe-name=Calendar.exe --webview-exe-version=2.2508.8001.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --disable-background-timer-throttling --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --js-flags=\"\"--expose-gc --ms-user-locale=\"\" --time-ticks-at-unix-epoch=-1755680330158810 --launch-time-ticks=32200742489 --always-read-main-dll --metrics-shmem-handle=3616,i,18121546279730051107,1773683472842625965,2097152 --field-trial-handle=1844,i,14076789075349774618,5990026520275620378,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartitio\"\n\"svchost\",0.0090,5.4607,3288,\"C:\\WINDOWS\\system32\\svchost.exe -k NetworkService -p\"\n\"LsaIso\",0.0075,0.0000,1612,\"\\??\\C:\\WINDOWS\\system32\\lsaiso.exe -CredGuard -KeyGuard\"\n\"msedgewebview2\",0.0075,0.0000,28260,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Files\\EBWebView\"\" --webview-exe-name=Files.exe --webview-exe-version=2.2508.8001.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1684,i,12036929097228022419,13501132122943727893,262144 --field-trial-handle=1888,i,16605339906420287399,11502722819294103519,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,CloseOmniboxPopupOnInactiveAreaClick,CollectAVProdu\"\n\"msedgewebview2\",0.0075,0.0000,24724,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=WebViewHost.exe --webview-exe-version=19.2508.47021.0 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe\\LocalState\\EBWebView\"\" --noerrdialogs --embedded-browser-webview-dpi-awareness=2 --disable-features=msEnhancedTrackingPreventionEnabled --enable-features=msSingleSignOnOSForPrimaryAccountIsShared --mojo-named-platform-channel-pipe=26552.26364.17986687398486298476 /pfhostedapp:1b1e04dbbaf59080f80ec12ce03b9627f1473e63\"\n\"msedgewebview2\",0.0075,0.0000,17212,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=OneDrive.exe --webview-exe-version=25.149.0803.0003 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\OneDrive\\EBWebView\"\" --noerrdialogs --embedded-browser-webview-dpi-awareness=1 --disable-features=msEnhancedTrackingPreventionEnabled --mojo-named-platform-channel-pipe=19892.19040.4596750522587944337 /pfhostedapp:36f66206d9a5f07f567effabe737fb9cf4c3919a\"\n\"olk\",0.0075,0.0000,16472,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.OutlookForWindows_1.2025.806.300_x64__8wekyb3d8bbwe\\olk.exe\"\" --restart-on-update=3\"\n\"RuntimeBroker\",0.0075,0.0000,3360,\"C:\\Windows\\System32\\RuntimeBroker.exe -Embedding\"\n\"ServiceHub.ThreadedWaitDialog\",0.0075,0.0000,21280,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\ServiceHub\\Hosts\\ServiceHub.Host.dotnet.x64\\ServiceHub.ThreadedWaitDialog.exe\"\" dotnet$ThreadedWaitDialog net.pipe://1978095EEE757A78F755D74184C209DDF30C6 \"\"/TelemetrySession:{\\\"\"TelemetryLevel\\\"\":null,\\\"\"IsOptedIn\\\"\":true,\\\"\"HostName\\\"\":\\\"\"Dev14\\\"\",\\\"\"AppInsightsInstrumentationKey\\\"\":\\\"\"f144292e-e3b2-4011-ac90-20e5c03fbce5\\\"\",\\\"\"AsimovInstrumentationKey\\\"\":\\\"\"AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70\\\"\",\\\"\"CollectorApiKey\\\"\":\\\"\"f3e86b4023cc43f0be495508d51f588a-f70d0e59-0fb0-4473-9f19-b4024cc340be-7296\\\"\",\\\"\"AppId\\\"\":1001,\\\"\"UserId\\\"\":\\\"\"2dba2122-c8a1-45b6-ac82-001f5865d3e3\\\"\",\\\"\"Id\\\"\":\\\"\"43746843-c2ce-42ef-9bc7-521b96990f7c\\\"\",\\\"\"ProcessStartTime\\\"\":638913092465839523,\\\"\"SkuName\\\"\":\\\"\"VS_Enterprise\\\"\",\\\"\"VSExeVersion\\\"\":\\\"\"17.14.36408.4\\\"\",\\\"\"BucketFiltersToEnableWatsonForFaults\\\"\":[],\\\"\"BucketFiltersToAddDumpsToFaults\\\"\":[]}\"\" $HostRemoteBrokerPipeName\"\n\"svchost\",0.0075,0.0000,3708,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalServiceNoNetworkFirewall -p\"\n\"svchost\",0.0075,0.0000,2780,\"C:\\WINDOWS\\System32\\svchost.exe -k netsvcs -p -s BDESVC\"\n\"WebViewHost\",0.0075,0.0000,26552,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.MicrosoftOfficeHub_19.2508.47021.0_x64__8wekyb3d8bbwe\\WebViewHost.exe\"\" autostart\"\n\"backgroundTaskHost\",0.0060,0.0000,20724,\"\"\"C:\\WINDOWS\\system32\\backgroundTaskHost.exe\"\" -ServerName:App.AppXe9cvj1thv1hmcw0cs98xm3r97tyzy2xs.mca\"\n\"Calendar\",0.0060,0.0000,23828,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.M365Companions_2.2508.8001.0_x64__8wekyb3d8bbwe\\Calendar\\Calendar.exe\"\" /minimize \"\n\"msedge\",0.0060,0.0000,23604,\"\"\"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe\"\" --no-startup-window\"\n\"msedgewebview2\",0.0060,0.0000,18848,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --webview-exe-name=Widgets.exe --webview-exe-version=525.22300.0.0 --embedded-browser-webview=1 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1708,i,13275522317397142690,12352364910837198964,262144 --field-trial-handle=1900,i,16685342306069031692,9043298843737266012,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,CloseOmniboxPopupOnInactiveAreaClick,CollectAVProductsInfo,CollectCodeIntegrityInfo,En\"\n\"msedgewebview2\",0.0060,0.0000,28616,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Files\\EBWebView\"\" --webview-exe-name=Files.exe --webview-exe-version=2.2508.8001.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --disable-background-timer-throttling --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --js-flags=\"\"--expose-gc --ms-user-locale=\"\" --time-ticks-at-unix-epoch=-1755680330158811 --launch-time-ticks=32200539892 --always-read-main-dll --metrics-shmem-handle=3456,i,9187861819967817321,14856818503084196906,2097152 --field-trial-handle=1888,i,16605339906420287399,11502722819294103519,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msW\"\n\"OneDrive.Sync.Service\",0.0060,0.0000,18964,\"\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\OneDrive\\25.149.0803.0003\\OneDrive.Sync.Service.exe\"\" \"\n\"People\",0.0060,0.0000,18232,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.M365Companions_2.2508.8001.0_x64__8wekyb3d8bbwe\\People\\People.exe\"\" /minimize \"\n\"ServiceHub.RoslynCodeAnalysisService\",0.0060,0.0000,16236,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\ServiceHub\\Hosts\\ServiceHub.Host.dotnet.x64\\ServiceHub.RoslynCodeAnalysisService.exe\"\" dotnet$RoslynCodeAnalysisService net.pipe://1978095EEE757A78F755D74184C209DDF30C6 \"\"/TelemetrySession:{\\\"\"TelemetryLevel\\\"\":null,\\\"\"IsOptedIn\\\"\":true,\\\"\"HostName\\\"\":\\\"\"Dev14\\\"\",\\\"\"AppInsightsInstrumentationKey\\\"\":\\\"\"f144292e-e3b2-4011-ac90-20e5c03fbce5\\\"\",\\\"\"AsimovInstrumentationKey\\\"\":\\\"\"AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70\\\"\",\\\"\"CollectorApiKey\\\"\":\\\"\"f3e86b4023cc43f0be495508d51f588a-f70d0e59-0fb0-4473-9f19-b4024cc340be-7296\\\"\",\\\"\"AppId\\\"\":1001,\\\"\"UserId\\\"\":\\\"\"2dba2122-c8a1-45b6-ac82-001f5865d3e3\\\"\",\\\"\"Id\\\"\":\\\"\"43746843-c2ce-42ef-9bc7-521b96990f7c\\\"\",\\\"\"ProcessStartTime\\\"\":638913092465839523,\\\"\"SkuName\\\"\":\\\"\"VS_Enterprise\\\"\",\\\"\"VSExeVersion\\\"\":\\\"\"17.14.36408.4\\\"\",\\\"\"BucketFiltersToEnableWatsonForFaults\\\"\":[],\\\"\"BucketFiltersToAddDumpsToFaults\\\"\":[]}\"\" \\\\.\\pipe\\3A505534-A1E9-424B-9050-E572AE5293DC\"\n\"CrossDeviceResume\",0.0045,0.0000,3688,\"\"\"C:\\Windows\\SystemApps\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\CrossDeviceResume.exe\"\" /tileid MicrosoftWindows.Client.CBS_cw5n1h2txyewy!CrossDeviceResumeApp\"\n\"msedgewebview2\",0.0045,0.0000,28548,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Calendar\\EBWebView\"\" --webview-exe-name=Calendar.exe --webview-exe-version=2.2508.8001.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1680,i,7670917632367265620,12804967711196561718,262144 --field-trial-handle=1844,i,14076789075349774618,5990026520275620378,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,CloseOmniboxPopupOnInactiveAreaClick,CollectAVP\"\n\"msedgewebview2\",0.0045,0.0000,17260,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=utility --utility-sub-type=storage.mojom.StorageService --lang=en-US --service-sandbox-type=service --noerrdialogs --user-agent=\"\"Mozilla/5.0 (Windows NT 10.0; Win64; x64; Cortana 1.18.9.23723; 10.0.0.0.29430.1000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.29430 IsWebView2/True (WebView2Version 139.0.3405.102)\"\" --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --webview-exe-name=SearchHost.exe --webview-exe-version=2125.20401.0.2000 --embedded-browser-webview=1 --always-read-main-dll --metrics-shmem-handle=2460,i,17322209671434086416,1922754234432043119,524288 --field-trial-handle=1948,i,16794949237765112938,10744838110969316530,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msEdgeFluentOverlayScrollbar,msWebView2NoTabForScreenSha\"\n\"PerfWatson2\",0.0045,0.0000,9268,\"\"\".\\PerfWatson2.exe\"\" -p 21220 -version 16 -role 3 {%22TelemetryLevel%22:null,%22IsOptedIn%22:true,%22HostName%22:%22Dev14%22,%22AppInsightsInstrumentationKey%22:%22f144292e-e3b2-4011-ac90-20e5c03fbce5%22,%22AsimovInstrumentationKey%22:%22AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70%22,%22CollectorApiKey%22:%22f3e86b4023cc43f0be495508d51f588a-f70d0e59-0fb0-4473-9f19-b4024cc340be-7296%22,%22AppId%22:1001,%22UserId%22:%222dba2122-c8a1-45b6-ac82-001f5865d3e3%22,%22Id%22:%2243746843-c2ce-42ef-9bc7-521b96990f7c%22,%22ProcessStartTime%22:638913092465839523,%22SkuName%22:%22VS_Enterprise%22,%22VSExeVersion%22:%2217.14.36408.4%22,%22BucketFiltersToEnableWatsonForFaults%22:[],%22BucketFiltersToAddDumpsToFaults%22:[]}\"\n\"RAVCpl64\",0.0045,0.0000,15900,\"\"\"C:\\Program Files\\Realtek\\Audio\\HDA\\RAVCpl64.exe\"\" -s\"\n\"RuntimeBroker\",0.0045,0.0000,516,\"C:\\Windows\\System32\\RuntimeBroker.exe -Embedding\"\n\"ShellHost\",0.0045,0.0000,40388,\"\"\"C:\\Windows\\System32\\ShellHost.exe\"\"\"\n\"StandardCollector.Service\",0.0045,0.0000,4636,\"\"\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Common\\DiagnosticsHub.Collection.Service\\StandardCollector.Service.exe\"\"\"\n\"svchost\",0.0045,0.0000,2156,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalServiceNoNetwork -p\"\n\"svchost\",0.0045,0.0000,7964,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalSystemNetworkRestricted -p -s PcaSvc\"\n\"svchost\",0.0045,0.0000,4444,\"C:\\WINDOWS\\System32\\svchost.exe -k netsvcs -p -s ShellHWDetection\"\n\"TrustedInstaller\",0.0045,0.0000,3540,\"C:\\WINDOWS\\servicing\\TrustedInstaller.exe\"\n\"audiodg\",0.0030,0.0000,10232,\"C:\\WINDOWS\\system32\\AUDIODG.EXE 0x00000000000007EC 0x0000000000000704\"\n\"Files\",0.0030,0.0000,24508,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.M365Companions_2.2508.8001.0_x64__8wekyb3d8bbwe\\Files\\Files.exe\"\" /minimize /restart\"\n\"fontdrvhost\",0.0030,0.0000,1960,\"\"\"fontdrvhost.exe\"\"\"\n\"GlobalSecureAccessPolicyRetrieverService\",0.0030,0.0000,25772,\"\"\"C:\\Program Files\\Global Secure Access Client\\PolicyService\\GlobalSecureAccessPolicyRetrieverService.exe\"\"\"\n\"MoNotificationUx\",0.0030,0.0000,40448,\"C:\\WINDOWS\\uus\\AMD64\\MoNotificationUx.exe /NotificationType Reboot_Engaged /FormFactor Passive /CV bZdKO9dkakOz+3Gj.1.0.0\"\n\"msedgewebview2\",0.0030,0.0000,31680,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Olk\\EBWebView\"\" --webview-exe-name=olk.exe --webview-exe-version=1.2025.806.300 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --js-flags=\"\"--expose-gc --ms-user-locale=\"\" --time-ticks-at-unix-epoch=-1755680330158751 --launch-time-ticks=32210213114 --always-read-main-dll --metrics-shmem-handle=3412,i,2909241507951412939,16861473697940000721,2097152 --field-trial-handle=1940,i,8033129406060731551,14143038207632028611,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAbydos,msAbydosGestureSupport,msAbydosHandwritingAttr,msAggressiveCacheTrimming,msCustomDataPartition,msEnhancedTextContrast,msSingleSignOnO\"\n\"msedgewebview2\",0.0030,0.0000,28252,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\People\\EBWebView\"\" --webview-exe-name=People.exe --webview-exe-version=2.2508.8001.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1720,i,9304133045324938329,402785107203038817,262144 --field-trial-handle=1904,i,7208261295524124571,16047749738743927188,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,CloseOmniboxPopupOnInactiveAreaClick,CollectAVProduct\"\n\"msedgewebview2\",0.0030,0.0000,22640,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=crashpad-handler --user-data-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\EBWebView /prefetch:4 /pfhostedapp:3281cef100f69e01b7d11953c64af802068f63bb --monitor-self-annotation=ptype=crashpad-handler --database=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\EBWebView\\Crashpad --metrics-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\EBWebView --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=139.0.7258.128 \"\"--annotation=exe=C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --annotation=plat=Win64 \"\"--annotation=prod=Edge WebView2\"\" --annotation=ver=139.0.3405.102 --initial-client-data=0x17c,0x180,0x184,0x158,0x190,0x7fff2f74c188,0x7fff2f74c194,0x7fff2f74c1a0\"\n\"msedgewebview2\",0.0030,0.0000,24280,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --embedded-browser-webview=1 --webview-exe-name=People.exe --webview-exe-version=2.2508.8001.0 --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\People\\EBWebView\"\" --noerrdialogs --embedded-browser-webview-dpi-awareness=2 --disable-background-timer-throttling --disable-features=msEnhancedTrackingPreventionEnabled --mojo-named-platform-channel-pipe=18232.24568.11851610380818306060 /pfhostedapp:fe6d713621f52aef031cb2cd8b5b199c4c7f0ea2\"\n\"msedgewebview2\",0.0030,0.0000,28580,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=renderer --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\People\\EBWebView\"\" --webview-exe-name=People.exe --webview-exe-version=2.2508.8001.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --disable-background-timer-throttling --video-capture-use-gpu-memory-buffer --lang=en-US --device-scale-factor=1.25 --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --js-flags=\"\"--expose-gc --ms-user-locale=\"\" --time-ticks-at-unix-epoch=-1755680330158811 --launch-time-ticks=32200556055 --always-read-main-dll --metrics-shmem-handle=3636,i,16962075880517080349,3001479791945945315,2097152 --field-trial-handle=1904,i,7208261295524124571,16047749738743927188,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,ms\"\n\"msedgewebview2\",0.0030,0.0000,27756,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=crashpad-handler --user-data-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\People\\EBWebView /prefetch:4 /pfhostedapp:fe6d713621f52aef031cb2cd8b5b199c4c7f0ea2 --monitor-self-annotation=ptype=crashpad-handler --database=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\People\\EBWebView\\Crashpad --metrics-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\People\\EBWebView --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=139.0.7258.128 \"\"--annotation=exe=C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --annotation=plat=Win64 \"\"--annotation=prod=Edge WebView2\"\" --annotation=ver=139.0.3405.102 --initial-client-data=0x180,0x184,0x188,0x15c,0x190,0x7fff2f74c188,0x7fff2f74c194,0x7fff2f74c\"\n\"msedgewebview2\",0.0030,0.0000,19412,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=crashpad-handler --user-data-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\OneDrive\\EBWebView /prefetch:4 /pfhostedapp:36f66206d9a5f07f567effabe737fb9cf4c3919a --monitor-self-annotation=ptype=crashpad-handler --database=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\OneDrive\\EBWebView\\Crashpad --metrics-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\OneDrive\\EBWebView --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=139.0.7258.128 \"\"--annotation=exe=C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --annotation=plat=Win64 \"\"--annotation=prod=Edge WebView2\"\" --annotation=ver=139.0.3405.102 --initial-client-data=0x194,0x198,0x19c,0x140,0x1a4,0x7fff2f74c188,0x7fff2f74c194,0x7fff2f74c1a0\"\n\"msedgewebview2\",0.0030,0.0000,8700,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.MicrosoftOfficeHub_8wekyb3d8bbwe\\LocalState\\EBWebView\"\" --webview-exe-name=WebViewHost.exe --webview-exe-version=19.2508.47021.0 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1700,i,4695494353964021269,10025719251604277449,262144 --field-trial-handle=1848,i,14228515077991255448,8574913679281551647,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msSingleSignOnOSForPrimaryAccountIsShared,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,Close\"\n\"OpenConsole\",0.0030,0.0000,44820,\"\"\"c:\\program files\\microsoft visual studio\\2022\\enterprise\\common7\\ide\\commonextensions\\microsoft\\terminal\\ServiceHub\\os64\\OpenConsole.exe\"\" --headless --width 152 --height 30 --signal 0x7a8 --server 0x7e4\"\n\"RtkAudUService64\",0.0030,0.0000,12072,\"\"\"C:\\Windows\\System32\\DriverStore\\FileRepository\\realtekservice.inf_amd64_291337223b900dd5\\RtkAudUService64.exe\"\" -background\"\n\"SecurityHealthSystray\",0.0030,0.0000,18844,\"\"\"C:\\Windows\\System32\\SecurityHealthSystray.exe\"\" \"\n\"svchost\",0.0030,0.0000,4804,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalServiceNetworkRestricted -p -s Wcmsvc\"\n\"svchost\",0.0030,0.0000,4380,\"C:\\WINDOWS\\System32\\svchost.exe -k LocalSystemNetworkRestricted -p -s NcbService\"\n\"svchost\",0.0030,0.0000,3080,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalServiceNetworkRestricted -p -s TimeBrokerSvc\"\n\"svchost\",0.0030,0.0000,23760,\"C:\\WINDOWS\\System32\\svchost.exe -k Camera -s FrameServer\"\n\"svchost\",0.0030,0.0000,5088,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalSystemNetworkRestricted -p -s dot3svc\"\n\"svchost\",0.0030,0.0000,1860,\"C:\\WINDOWS\\system32\\svchost.exe -k LocalServiceAndNoImpersonation -s SCardSvr\"\n\"AggregatorHost\",0.0015,0.0000,10176,\"AggregatorHost.exe\"\n\"InventoryService\",0.0015,0.0000,5396,\"\"\"C:\\Program Files\\Microsoft Device Inventory Agent\\InventoryService\\InventoryService.exe\"\"\"\n\"Microsoft.Management.Services.IntuneWindowsAgent\",0.0015,0.0000,6332,\"\"\"C:\\Program Files (x86)\\Microsoft Intune Management Extension\\Microsoft.Management.Services.IntuneWindowsAgent.exe\"\"\"\n\"msedge\",0.0015,0.0000,19680,\"\"\"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe\"\" --type=crashpad-handler \"\"--user-data-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Edge\\User Data\"\" /prefetch:4 --monitor-self-annotation=ptype=crashpad-handler \"\"--database=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Edge\\User Data\\Crashpad\"\" \"\"--metrics-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Edge\\User Data\"\" --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=139.0.7258.128 \"\"--annotation=exe=C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe\"\" --annotation=plat=Win64 --annotation=prod=Edge --annotation=ver=139.0.3405.102 --initial-client-data=0x26c,0x270,0x274,0x268,0x27c,0x7fff2f74c188,0x7fff2f74c194,0x7fff2f74c1a0\"\n\"msedgewebview2\",0.0015,0.0000,31536,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\Olk\\EBWebView\"\" --webview-exe-name=olk.exe --webview-exe-version=1.2025.806.300 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1724,i,3980312206169518153,10127800526900623321,262144 --field-trial-handle=1940,i,8033129406060731551,14143038207632028611,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAbydos,msAbydosGestureSupport,msAbydosHandwritingAttr,msAggressiveCacheTrimming,msCustomDataPartition,msEnhancedTextContrast,msSingleSignOnOSForPrimaryAccountIsShared,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPer\"\n\"msedgewebview2\",0.0015,0.0000,28020,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=crashpad-handler --user-data-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Calendar\\EBWebView /prefetch:4 /pfhostedapp:a4a3cd379b99ec60983c9a9c438ccaad66ddb308 --monitor-self-annotation=ptype=crashpad-handler --database=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Calendar\\EBWebView\\Crashpad --metrics-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\Microsoft.M365Companions_8wekyb3d8bbwe\\LocalState\\Calendar\\EBWebView --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=139.0.7258.128 \"\"--annotation=exe=C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --annotation=plat=Win64 \"\"--annotation=prod=Edge WebView2\"\" --annotation=ver=139.0.3405.102 --initial-client-data=0x184,0x188,0x18c,0x164,0x194,0x7fff2f74c188,0x7fff2f74c194,0x7ff\"\n\"msedgewebview2\",0.0015,0.0000,18800,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=gpu-process --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\OneDrive\\EBWebView\"\" --webview-exe-name=OneDrive.exe --webview-exe-version=25.149.0803.0003 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=1 --no-pre-read-main-dll --gpu-preferences=SAAAAAAAAADgAAAIAAAAAAAAAAAAAGAAAQAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA== --always-read-main-dll --metrics-shmem-handle=1712,i,1063670666240466674,9387671468166555505,262144 --field-trial-handle=1796,i,2078209863016788888,5383923420903493488,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,CloseOmniboxPopupOnInactiveAreaClick,CollectAVProductsInfo,CollectCodeIntegrityInfo,EnableHangW\"\n\"msedgewebview2\",0.0015,0.0000,9996,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=crashpad-handler --user-data-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy\\LocalState\\EBWebView /prefetch:4 /pfhostedapp:1ec15097b557f7f931966541b3f105cc5a47009c --monitor-self-annotation=ptype=crashpad-handler --database=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy\\LocalState\\EBWebView\\Crashpad --metrics-dir=C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy\\LocalState\\EBWebView --annotation=IsOfficialBuild=1 --annotation=channel= --annotation=chromium-version=139.0.7258.128 \"\"--annotation=exe=C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --annotation=plat=Win64 \"\"--annotation=prod=Edge WebView2\"\" --annotation=ver=139.0.3405.102 --initial-client-data=0x17c,0x180,0x184,0x158,0x18c,0x7fff2f74c188,0x7fff2f\"\n\"msedgewebview2\",0.0015,0.0000,22272,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=utility --utility-sub-type=storage.mojom.StorageService --lang=en-US --service-sandbox-type=service --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MSTeams_8wekyb3d8bbwe\\LocalCache\\Microsoft\\MSTeams\\EBWebView\"\" --webview-exe-name=ms-teams.exe --webview-exe-version=25227.201.3887.7121 --embedded-browser-webview=1 --embedded-browser-webview-dpi-awareness=2 --no-pre-read-main-dll --always-read-main-dll --metrics-shmem-handle=1944,i,4751668418685729185,3956135311537094280,524288 --field-trial-handle=1848,i,9232284790936083051,8827603450831938181,262144 --enable-features=AutofillReplaceCachedWebElementsByRendererIds,DocumentPolicyIncludeJSCallStacksInCrashReports,ForceSWDCompWhenDCompFallbackRequired,PartitionedCookies,PreferredAudioOutputDevices,SharedArrayBuffer,SkipGrantAccessToDataPathIfAlreadySet,ThirdPartyStoragePartitioning,msAbydos,msAbydosGestureSupport,msAbydosHandwritingAt\"\n\"msedgewebview2\",0.0015,0.0000,15096,\"\"\"C:\\Program Files (x86)\\Microsoft\\EdgeWebView\\Application\\139.0.3405.102\\msedgewebview2.exe\"\" --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --noerrdialogs --user-data-dir=\"\"C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Packages\\MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy\\LocalState\\EBWebView\"\" --webview-exe-name=Widgets.exe --webview-exe-version=525.22300.0.0 --embedded-browser-webview=1 --no-pre-read-main-dll --always-read-main-dll --metrics-shmem-handle=2064,i,10059151636341397096,3423782810395223296,524288 --field-trial-handle=1900,i,16685342306069031692,9043298843737266012,262144 --enable-features=ForceSWDCompWhenDCompFallbackRequired,msAggressiveCacheTrimming,msCustomDataPartition,msWebView2NoTabForScreenShare,msWindowsTaskManager --disable-features=BackForwardCache,BackgroundTabLoadingFromPerformanceManager,CloseOmniboxPopupOnInactiveAreaClick,CollectAVProductsInfo,CollectCodeIntegrityInfo,EnableHangWatcher,FilterAdsOnAbusiveSites,GetWifiProtocol\"\n\"msinfo32\",0.0015,0.0000,13752,\"\"\"C:\\WINDOWS\\system32\\msinfo32.exe\"\" \"\n\"SCNotification\",0.0015,0.0000,18140,\"\"\"C:\\Windows\\CCM\\SCNotification.exe\"\"\"\n\"SearchProtocolHost\",0.0015,0.0000,49352,\"\"\"C:\\WINDOWS\\System32\\SearchProtocolHost.exe\"\" Global\\UsGthrFltPipeMssGthrPipe37_ Global\\UsGthrCtrlFltPipeMssGthrPipe37 1 -2147483646 \"\"Software\\Microsoft\\Windows Search\"\" \"\"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT; MS Search 4.0 Robot)\"\" \"\"C:\\ProgramData\\Microsoft\\Search\\Data\\Temp\\usgthrsvc\"\" \"\"DownLevelDaemon\"\" \"\n\"ServiceHub.IndexingService\",0.0015,0.0000,18328,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\ServiceHub\\Hosts\\ServiceHub.Host.dotnet.x64\\ServiceHub.IndexingService.exe\"\" dotnet$IndexingService net.pipe://1978095EEE757A78F755D74184C209DDF30C6 \"\"/TelemetrySession:{\\\"\"TelemetryLevel\\\"\":null,\\\"\"IsOptedIn\\\"\":true,\\\"\"HostName\\\"\":\\\"\"Dev14\\\"\",\\\"\"AppInsightsInstrumentationKey\\\"\":\\\"\"f144292e-e3b2-4011-ac90-20e5c03fbce5\\\"\",\\\"\"AsimovInstrumentationKey\\\"\":\\\"\"AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70\\\"\",\\\"\"CollectorApiKey\\\"\":\\\"\"f3e86b4023cc43f0be495508d51f588a-f70d0e59-0fb0-4473-9f19-b4024cc340be-7296\\\"\",\\\"\"AppId\\\"\":1001,\\\"\"UserId\\\"\":\\\"\"2dba2122-c8a1-45b6-ac82-001f5865d3e3\\\"\",\\\"\"Id\\\"\":\\\"\"43746843-c2ce-42ef-9bc7-521b96990f7c\\\"\",\\\"\"ProcessStartTime\\\"\":638913092465839523,\\\"\"SkuName\\\"\":\\\"\"VS_Enterprise\\\"\",\\\"\"VSExeVersion\\\"\":\\\"\"17.14.36408.4\\\"\",\\\"\"BucketFiltersToEnableWatsonForFaults\\\"\":[],\\\"\"BucketFiltersToAddDumpsToFaults\\\"\":[]}\"\" $HostRemoteBrokerPipeName\"\n\"ServiceHub.IntellicodeModelService\",0.0015,0.0000,19716,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\ServiceHub\\Hosts\\ServiceHub.Host.netfx.x64\\ServiceHub.IntellicodeModelService.exe\"\" netfx.x64$IntellicodeModelService net.pipe://1978095EEE757A78F755D74184C209DDF30C6 \"\"/AppBasePath:C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\\\\"\" /ConfigFile:C:\\Users\\benjaming.REDMOND\\AppData\\Local\\Microsoft\\VisualStudio\\17.0_60475fee\\devenv.exe.config\"\n\"ServiceHub.TestWindowStoreHost\",0.0015,0.0000,18532,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\ServiceHub\\Hosts\\ServiceHub.Host.dotnet.x64\\ServiceHub.TestWindowStoreHost.exe\"\" dotnet.x64$TestWindowStoreHost net.pipe://1978095EEE757A78F755D74184C209DDF30C6 \"\"/TelemetrySession:{\\\"\"TelemetryLevel\\\"\":null,\\\"\"IsOptedIn\\\"\":true,\\\"\"HostName\\\"\":\\\"\"Dev14\\\"\",\\\"\"AppInsightsInstrumentationKey\\\"\":\\\"\"f144292e-e3b2-4011-ac90-20e5c03fbce5\\\"\",\\\"\"AsimovInstrumentationKey\\\"\":\\\"\"AIF-312cbd79-9dbb-4c48-a7da-3cc2a931cb70\\\"\",\\\"\"CollectorApiKey\\\"\":\\\"\"f3e86b4023cc43f0be495508d51f588a-f70d0e59-0fb0-4473-9f19-b4024cc340be-7296\\\"\",\\\"\"AppId\\\"\":1001,\\\"\"UserId\\\"\":\\\"\"2dba2122-c8a1-45b6-ac82-001f5865d3e3\\\"\",\\\"\"Id\\\"\":\\\"\"43746843-c2ce-42ef-9bc7-521b96990f7c\\\"\",\\\"\"ProcessStartTime\\\"\":638913092465839523,\\\"\"SkuName\\\"\":\\\"\"VS_Enterprise\\\"\",\\\"\"VSExeVersion\\\"\":\\\"\"17.14.36408.4\\\"\",\\\"\"BucketFiltersToEnableWatsonForFaults\\\"\":[],\\\"\"BucketFiltersToAddDumpsToFaults\\\"\":[]}\"\" \\\\.\\pipe\\3A505534-A1E9-424B-9050-E572AE5293DC\"\n\"svchost\",0.0015,0.0000,16120,\"C:\\WINDOWS\\system32\\svchost.exe -k ClipboardSvcGroup -p -s cbdhsvc\"\n\"svchost\",0.0015,0.0000,3952,\"C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p -s lfsvc\"\n\"svchost\",0.0015,0.0000,2244,\"C:\\WINDOWS\\system32\\svchost.exe -k UserProfileService -p -s ProfSvc\"\n\"svchost\",0.0015,0.0000,3992,\"C:\\WINDOWS\\System32\\svchost.exe -k netsvcs\"\n\"svchost\",0.0015,0.0000,8260,\"C:\\WINDOWS\\system32\\svchost.exe -k NetSvcs -p -s HNS\"\n\"svchost\",0.0015,0.0000,6160,\"C:\\WINDOWS\\system32\\svchost.exe -k netsvcs -p -s LanmanServer\"\n\"svchost\",0.0015,0.0000,1896,\"C:\\WINDOWS\\System32\\svchost.exe -k NetworkService -p -s LanmanWorkstation\"\n\"svchost\",0.0015,0.0000,12908,\"C:\\WINDOWS\\System32\\svchost.exe -k LocalServiceNetworkRestricted -s RmSvc\"\n\"svchost\",0.0015,0.0000,3412,\"C:\\WINDOWS\\System32\\svchost.exe -k NetSvcs -p -s IpHlpSvc\"\n\"svchost\",0.0015,0.0000,3196,\"C:\\WINDOWS\\System32\\svchost.exe -k PeerDist -s PeerDistSvc\"\n\"svchost\",0.0015,0.0000,1248,\"C:\\WINDOWS\\system32\\svchost.exe -k RPCSS -p\"\n\"taskhostw\",0.0015,0.0000,14240,\"taskhostw.exe {222A245B-E637-4AE9-A93F-A59CA119A75E}\"\n\"VBCSCompiler\",0.0015,0.0000,18640,\"\"\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\MSBuild\\Current\\Bin\\Roslyn\\VBCSCompiler.exe\"\" \"\"-pipename:JVjPNngeOMqiFdoh15dX0nMeMebM0yP_g1S1LVh2Brs\"\"\"\n\"WidgetService\",0.0015,0.0000,11188,\"\"\"C:\\Program Files\\WindowsApps\\Microsoft.WidgetsPlatformRuntime_1.6.9.0_x64__8wekyb3d8bbwe\\WidgetService\\WidgetService.exe\"\" -RegisterProcessAsComServer -Embedding\"\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestData/Traces/MsoTrace/trace.etl",
    "content": "version https://git-lfs.github.com/spec/v1\noid sha256:c16e3a2413a9e45c1fbef6cfcc695b77c9d925b0160d53e028d2ba43ba59b817\nsize 318242816\n"
  },
  {
    "path": "src/ProfileExplorerCoreTests/TestDataHelper.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace ProfileExplorer.CoreTests;\n\n/// <summary>\n/// Helper class for accessing test data files in a consistent manner.\n/// </summary>\npublic static class TestDataHelper {\n  private static readonly string TestDataRoot;\n\n  static TestDataHelper() {\n    // Get the directory where the test assembly is located\n    var assemblyLocation = Assembly.GetExecutingAssembly().Location;\n    var assemblyDirectory = Path.GetDirectoryName(assemblyLocation);\n    \n    // Navigate up to find the TestData directory\n    // The build output is typically in bin/Debug/net8.0/, so we need to go up several levels\n    var currentDir = assemblyDirectory;\n    while (currentDir != null && !Directory.Exists(Path.Combine(currentDir, \"TestData\"))) {\n      currentDir = Directory.GetParent(currentDir)?.FullName;\n    }\n    \n    if (currentDir != null) {\n      TestDataRoot = Path.Combine(currentDir, \"TestData\");\n    } else {\n      throw new DirectoryNotFoundException(\"Could not locate TestData directory relative to test assembly\");\n    }\n  }\n\n  /// <summary>\n  /// Gets the root path for all test data.\n  /// </summary>\n  public static string GetTestDataRoot() => TestDataRoot;\n\n  /// <summary>\n  /// Gets the path to a specific trace file.\n  /// </summary>\n  /// <param name=\"testCaseName\">Name of the test case (e.g., \"MsoTrace\")</param>\n  /// <param name=\"fileName\">Name of the trace file (e.g., \"trace.etl\")</param>\n  /// <returns>Full path to the trace file</returns>\n  public static string GetTracePath(string testCaseName, string fileName = \"trace.etl\") {\n    return Path.Combine(TestDataRoot, \"Traces\", testCaseName, fileName);\n  }\n\n  /// <summary>\n  /// Gets the path to the symbols directory for a test case.\n  /// </summary>\n  /// <param name=\"testCaseName\">Name of the test case (e.g., \"MsoTrace\")</param>\n  /// <returns>Full path to the symbols directory</returns>\n  public static string GetSymbolsPath(string testCaseName) {\n    return Path.Combine(TestDataRoot, \"Symbols\", testCaseName);\n  }\n\n  /// <summary>\n  /// Gets the path to a specific symbol file.\n  /// </summary>\n  /// <param name=\"testCaseName\">Name of the test case (e.g., \"MsoTrace\")</param>\n  /// <param name=\"fileName\">Name of the PDB file (e.g., \"Mso20Win32Client.pdb\")</param>\n  /// <returns>Full path to the symbol file</returns>\n  public static string GetSymbolFilePath(string testCaseName, string fileName) {\n    return Path.Combine(TestDataRoot, \"Symbols\", testCaseName, fileName);\n  }\n\n  /// <summary>\n  /// Gets the path to the binaries directory for a test case.\n  /// </summary>\n  /// <param name=\"testCaseName\">Name of the test case (e.g., \"MsoTrace\")</param>\n  /// <returns>Full path to the binaries directory</returns>\n  public static string GetBinariesPath(string testCaseName) {\n    return Path.Combine(TestDataRoot, \"Binaries\", testCaseName);\n  }\n\n  /// <summary>\n  /// Gets the path to a specific binary file.\n  /// </summary>\n  /// <param name=\"testCaseName\">Name of the test case (e.g., \"MsoTrace\")</param>\n  /// <param name=\"fileName\">Name of the binary file (e.g., \"Mso20win32client.dll\")</param>\n  /// <returns>Full path to the binary file</returns>\n  public static string GetBinaryFilePath(string testCaseName, string fileName) {\n    return Path.Combine(TestDataRoot, \"Binaries\", testCaseName, fileName);\n  }\n\n  /// <summary>\n  /// Checks if all required files exist for a test case.\n  /// </summary>\n  /// <param name=\"testCaseName\">Name of the test case</param>\n  /// <param name=\"traceFileName\">Expected trace file name</param>\n  /// <param name=\"requiredSymbolFiles\">List of required symbol files</param>\n  /// <param name=\"requiredBinaryFiles\">List of required binary files</param>\n  /// <returns>True if all files exist, false otherwise</returns>\n  public static bool ValidateTestCase(string testCaseName, string traceFileName = \"trace.etl\", \n                                     string[]? requiredSymbolFiles = null, \n                                     string[]? requiredBinaryFiles = null) {\n    // Check trace file\n    var tracePath = GetTracePath(testCaseName, traceFileName);\n    if (!File.Exists(tracePath)) {\n      return false;\n    }\n\n    // Check symbol files if specified\n    if (requiredSymbolFiles != null) {\n      foreach (var symbolFile in requiredSymbolFiles) {\n        var symbolPath = GetSymbolFilePath(testCaseName, symbolFile);\n        if (!File.Exists(symbolPath)) {\n          return false;\n        }\n      }\n    }\n\n    // Check binary files if specified\n    if (requiredBinaryFiles != null) {\n      foreach (var binaryFile in requiredBinaryFiles) {\n        var binaryPath = GetBinaryFilePath(testCaseName, binaryFile);\n        if (!File.Exists(binaryPath)) {\n          return false;\n        }\n      }\n    }\n\n    return true;\n  }\n\n  /// <summary>\n  /// Gets information about a specific test case by name.\n  /// </summary>\n  /// <param name=\"testCaseName\">Name of the test case directory</param>\n  /// <returns>TestCaseInfo for the specified test case</returns>\n  public static TestCaseInfo GetTestCase(string testCaseName) {\n    return new TestCaseInfo(testCaseName);\n  }\n\n  /// <summary>\n  /// Gets all available test cases by scanning the TestData directory.\n  /// </summary>\n  /// <returns>List of available test case names</returns>\n  public static List<string> GetAvailableTestCases() {\n    var testCases = new List<string>();\n    var tracesDir = Path.Combine(TestDataRoot, \"Traces\");\n    \n    if (Directory.Exists(tracesDir)) {\n      var directories = Directory.GetDirectories(tracesDir);\n      foreach (var dir in directories) {\n        var testCaseName = Path.GetFileName(dir);\n        testCases.Add(testCaseName);\n      }\n    }\n    \n    return testCases;\n  }\n\n  /// <summary>\n  /// Validates that all available test cases have complete data.\n  /// </summary>\n  /// <returns>Dictionary mapping test case names to their validation status</returns>\n  public static Dictionary<string, bool> ValidateAllTestCases() {\n    var results = new Dictionary<string, bool>();\n    var testCases = GetAvailableTestCases();\n    \n    foreach (var testCase in testCases) {\n      var info = GetTestCase(testCase);\n      results[testCase] = info.IsValid;\n    }\n    \n    return results;\n  }\n\n  /// <summary>\n  /// Represents information about a test case.\n  /// </summary>\n  public class TestCaseInfo {\n    public string TestCaseName { get; }\n    \n    public TestCaseInfo(string testCaseName) {\n      TestCaseName = testCaseName;\n    }\n\n    public string TracePath => GetTracePath(TestCaseName, \"trace.etl\");\n    public string SymbolsPath => GetSymbolsPath(TestCaseName);\n    public string BinariesPath => GetBinariesPath(TestCaseName);\n\n    /// <summary>\n    /// Gets all PDB files for this test case.\n    /// </summary>\n    public List<string> PdbFiles {\n      get {\n        var pdbFiles = new List<string>();\n        var symbolsDir = SymbolsPath;\n        if (Directory.Exists(symbolsDir)) {\n          pdbFiles.AddRange(Directory.GetFiles(symbolsDir, \"*.pdb\"));\n        }\n        return pdbFiles;\n      }\n    }\n\n    /// <summary>\n    /// Gets all binary files for this test case.\n    /// </summary>\n    public List<string> BinaryFiles {\n      get {\n        var binaryFiles = new List<string>();\n        var binariesDir = BinariesPath;\n        if (Directory.Exists(binariesDir)) {\n          binaryFiles.AddRange(Directory.GetFiles(binariesDir, \"*.*\"));\n        }\n        return binaryFiles;\n      }\n    }\n\n    /// <summary>\n    /// Checks if this test case has all required files.\n    /// </summary>\n    public bool IsValid {\n      get {\n        // Must have trace file\n        if (!File.Exists(TracePath)) {\n          return false;\n        }\n\n        // Must have symbols directory (but PDB files are optional)\n        if (!Directory.Exists(SymbolsPath)) {\n          return false;\n        }\n\n        // Must have binaries directory (but binary files are optional)\n        if (!Directory.Exists(BinariesPath)) {\n          return false;\n        }\n\n        return true;\n      }\n    }\n\n    /// <summary>\n    /// Gets a summary of this test case.\n    /// </summary>\n    public string GetSummary() {\n      var summary = $\"Test Case: {TestCaseName}\\n\";\n      summary += $\"  Trace: {(File.Exists(TracePath) ? \"✓\" : \"✗\")} {TracePath}\\n\";\n      summary += $\"  Symbols: {PdbFiles.Count} PDB file(s)\\n\";\n      summary += $\"  Binaries: {BinaryFiles.Count} binary file(s)\\n\";\n      summary += $\"  Valid: {(IsValid ? \"✓\" : \"✗\")}\";\n      return summary;\n    }\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerUI/App.xaml",
    "content": "﻿<Application\n  x:Class=\"ProfileExplorer.UI.App\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n  <Application.Resources>\n    <ResourceDictionary>\n      <ResourceDictionary.MergedDictionaries>\n        <ResourceDictionary Source=\"Converters.xaml\" />\n        <ResourceDictionary Source=\"Icons.xaml\" />\n        <ResourceDictionary Source=\"Styles.xaml\" />\n        <ResourceDictionary Source=\"ProfileStyles.xaml\" />\n      </ResourceDictionary.MergedDictionaries>\n    </ResourceDictionary>\n  </Application.Resources>\n</Application>"
  },
  {
    "path": "src/ProfileExplorerUI/App.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Interop;\nusing System.Windows.Media;\nusing System.Windows.Shell;\nusing System.Xml;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Settings;\nusing ProfileExplorer.UI.Mcp;\nusing ProfileExplorer.Mcp;\n\nnamespace ProfileExplorer.UI;\n\npublic class SyntaxFileInfo {\n  public SyntaxFileInfo(string name, string compiler, string path) {\n    Name = name;\n    Compiler = compiler;\n    Path = path;\n  }\n\n  public string Name { get; set; }\n  public string Compiler { get; set; }\n  public string Path { get; set; }\n\n  public static bool operator ==(SyntaxFileInfo left, SyntaxFileInfo right) {\n    return EqualityComparer<SyntaxFileInfo>.Default.Equals(left, right);\n  }\n\n  public static bool operator !=(SyntaxFileInfo left, SyntaxFileInfo right) {\n    return !(left == right);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is SyntaxFileInfo info &&\n           Name == info.Name &&\n           Compiler == info.Compiler &&\n           Path == info.Path;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Name, Compiler, Path);\n  }\n}\n\npublic partial class App : Application {\n#if DEBUG\n  // For use with \"mkdocs serve\".\n  private const string HelpLocation = @\"http://127.0.0.1:8000\";\n  private const string DocumentationLocation = @\"http://127.0.0.1:8000\";\n#else\n  private const string HelpLocation = @\"https://microsoft.github.io/profile-explorer/site\";\n  private const string DocumentationLocation = @\"https://microsoft.github.io/profile-explorer\";\n#endif\n\n  public const string AutoUpdateInfox64 = @\"https://microsoft.github.io/profile-explorer/autoupdater.xml\";\n  public const string AutoUpdateInfoArm64 = @\"https://microsoft.github.io/profile-explorer/autoupdater_arm64.xml\";\n  private const string SettingsPath = @\"Microsoft\\ProfileExplorer\";\n  private const string SettingsFile = \"ProfileExplorer.settings\";\n  private const string HelpIndexFile = @\"index.json\";\n  private const string LicenseFile = \"NOTICE.md\";\n  private const string WorkspacesDirectory = \"workspaces\";\n  private const string ScriptsDirectory = \"scripts\";\n  private const string ThemesDirectory = \"themes\";\n  private const string TraceFile = \"ProfileExplorer.log\";\n  private const string BackupTraceFile = \"ProfileExplorerBackup.log\";\n  private const string RemarkDefinitionFile = @\"remark-settings.json\";\n  private const string SectionDefinitionFile = @\"section-settings.json\";\n  private const string FunctionMarkingsFile = @\"function-markings.json\";\n  private const string InternalIRSyntaxHighlightingFile = @\"ir.xshd\";\n  private const string InternalExtensionFile = @\"VSExtension.vsix\";\n  private const string SyntaxFileSearchPattern = @\"*.xshd\";\n  private const string SyntaxFileExtension = @\"xshd\";\n  private const string FunctionTaskScriptsDirectory = \"scripts\";\n  private const string FunctionTaskScriptSearchPattern = @\"*.cs\";\n  public static bool IsFirstRun;\n  public static DateTime AppStartTime;\n  public static ApplicationSettings Settings;\n  public static IUISession Session;\n  /// <summary>\n  /// When true, suppresses UI dialogs (like source file prompts) during MCP/automation operations.\n  /// </summary>\n  public static bool SuppressDialogsForAutomation;\n  private Task? mcpServerTask;\n  private static List<SyntaxFileInfo> cachedSyntaxHighlightingFiles_;\n  public static string ApplicationPath => Process.GetCurrentProcess().MainModule?.FileName;\n  public static string ApplicationDirectory => Path.GetDirectoryName(ApplicationPath);\n\n  public static string[] GetFunctionTaskScripts() {\n    try {\n      string path = GetSettingsFilePath(FunctionTaskScriptsDirectory);\n      return Directory.GetFiles(path, FunctionTaskScriptSearchPattern);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to get function task scripts: {ex}\");\n      return new string[] { };\n    }\n  }\n\n  public static string GetCompilerSettingsDirectoryPath(string compilerName) {\n    return GetSettingsFilePath(compilerName);\n  }\n\n  public static string GetWorkspacesPath() {\n    return GetSettingsFilePath(WorkspacesDirectory);\n  }\n\n  public static string GetInternalWorkspacesPath() {\n    return GetApplicationFilePath(WorkspacesDirectory);\n  }\n\n  public static string GetLicenseText() {\n    try {\n      return File.ReadAllText(GetApplicationFilePath(LicenseFile));\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to get license text: {ex}\");\n      return \"\";\n    }\n  }\n\n  public static string GetCompilerSettingsFilePath(string file, string compilerName, string extension = \"\") {\n    // Remove extension if another one should be used.\n    file = string.IsNullOrEmpty(extension) ? file : Path.GetFileNameWithoutExtension(file);\n    return GetSettingsFilePath(compilerName, file, extension);\n  }\n\n  public static string GetTraceFilePath() {\n    return GetSettingsFilePath(TraceFile);\n  }\n\n  public static string GetBackupTraceFilePath() {\n    return GetSettingsFilePath(BackupTraceFile);\n  }\n\n  public static string GetExtensionFilePath() {\n    return GetApplicationFilePath(InternalExtensionFile);\n  }\n\n  public static string GetInternalSyntaxHighlightingFilePath(string name, string compilerIRName) {\n    var files = GetSyntaxHighlightingFiles(compilerIRName, true);\n    var result = files.Find(item => item.Name == name);\n    return result?.Path;\n  }\n\n  public static string GetInternalIRSyntaxHighlightingFilePath() {\n    string appDir = ApplicationDirectory;\n    return Path.Combine(appDir, InternalIRSyntaxHighlightingFile);\n  }\n\n  public static string GetHelpIndexFilePath() {\n    return $\"{HelpLocation}/{HelpIndexFile}\";\n  }\n\n  public static string GetHelpFilePath(string relativeURL) {\n    return $\"{HelpLocation}/{relativeURL}\";\n  }\n\n  public static string GetRemarksDefinitionFilePath(string compilerIRName) {\n    string userFile = GetUserRemarksDefinitionFilePath(compilerIRName);\n\n    if (File.Exists(userFile)) {\n      return userFile;\n    }\n\n    string internalFile = GetInternalRemarksDefinitionFilePath(compilerIRName);\n\n    if (File.Exists(internalFile) && CreateDirectoriesForFile(userFile)) {\n      try {\n        File.Copy(internalFile, userFile);\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to get copy file {internalFile} to {userFile}: {ex}\");\n        return null;\n      }\n\n      return userFile;\n    }\n\n    return null;\n  }\n\n  public static string GetSectionsDefinitionFilePath(string compilerIRName) {\n    string userFile = GetUserSectionsDefinitionFilePath(compilerIRName);\n\n    if (File.Exists(userFile)) {\n      return userFile;\n    }\n\n    string internalFile = GetInternalSectionsDefinitionFilePath(compilerIRName);\n\n    if (File.Exists(internalFile) && CreateDirectoriesForFile(userFile)) {\n      try {\n        File.Copy(internalFile, userFile);\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to get copy file {internalFile} to {userFile}: {ex}\");\n      }\n\n      return userFile;\n    }\n\n    return null;\n  }\n\n  public static string GetUserRemarksDefinitionFilePath(string compilerIRName) {\n    return GetSettingsFilePath(compilerIRName, RemarkDefinitionFile);\n  }\n\n  public static string GetInternalRemarksDefinitionFilePath(string compilerIRName) {\n    return GetApplicationFilePath(compilerIRName, RemarkDefinitionFile);\n  }\n\n  public static string GetUserSectionsDefinitionFilePath(string compilerIRName) {\n    return GetSettingsFilePath(compilerIRName, SectionDefinitionFile);\n  }\n\n  public static string GetInternalSectionsDefinitionFilePath(string compilerIRName) {\n    return GetApplicationFilePath(compilerIRName, SectionDefinitionFile);\n  }\n\n  public static string GetFunctionMarkingsFilePath(string compilerIRName) {\n    return GetSettingsFilePath(compilerIRName, FunctionMarkingsFile);\n  }\n\n  public static List<SyntaxFileInfo> GetSyntaxHighlightingFiles(string compilerIRName, bool internalFiles = false) {\n    if (!internalFiles && cachedSyntaxHighlightingFiles_ != null) {\n      return cachedSyntaxHighlightingFiles_;\n    }\n\n    var list = new List<SyntaxFileInfo>();\n\n    try {\n      string baseDir = internalFiles ?\n        GetCompilerApplicationDirectoryPath(compilerIRName) :\n        GetCompilerSettingsDirectoryPath(compilerIRName);\n\n      string[] themes = Directory.GetFiles(baseDir, SyntaxFileSearchPattern);\n\n      foreach (string theme in themes) {\n        list.Add(new SyntaxFileInfo(GetSyntaxFileName(theme), compilerIRName, theme));\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to get syntax file list: {ex}\");\n    }\n\n    if (!internalFiles) {\n      cachedSyntaxHighlightingFiles_ = list;\n    }\n\n    return list;\n  }\n\n  public static List<SyntaxFileInfo> ReloadSyntaxHighlightingFiles(string compilerIRName) {\n    cachedSyntaxHighlightingFiles_ = null;\n    return GetSyntaxHighlightingFiles(compilerIRName);\n  }\n\n  public static SyntaxFileInfo GetSyntaxHighlightingFileInfo(string name, string compilerIRName) {\n    var files = GetSyntaxHighlightingFiles(compilerIRName);\n    return files.Find(item => item.Name == name);\n  }\n\n  public static string GetSyntaxHighlightingFilePath() {\n    // If a file is not set yet (first run for ex), set the default one.\n    var docSettings = Settings.DocumentSettings;\n\n    //? TODO: Each compiler mode should have its own syntax saved\n    if (string.IsNullOrEmpty(docSettings.SyntaxHighlightingName)) {\n      docSettings.SyntaxHighlightingName = Session.CompilerInfo.DefaultSyntaxHighlightingFile;\n    }\n\n    var result = GetSyntaxHighlightingFileInfo(docSettings.SyntaxHighlightingName,\n                                               Session.CompilerInfo.CompilerIRName);\n    return result?.Path;\n  }\n\n  public static string GetSyntaxHighlightingFilePath(SyntaxFileInfo syntaxFile) {\n    if (syntaxFile != null && File.Exists(syntaxFile.Path)) {\n      return syntaxFile.Path;\n    }\n\n    return GetSyntaxHighlightingFilePath();\n  }\n\n  public static string GetSyntaxHighlightingFilePath(string name, string compilerIRName) {\n    InitializeSettingsFilesDirectory(compilerIRName);\n    return GetCompilerSettingsFilePath(name, compilerIRName, SyntaxFileExtension);\n  }\n\n  public static bool LoadApplicationSettings() {\n    try {\n      CreateSettingsDirectory();\n\n      string path = GetSettingsFilePath();\n      byte[] data = File.ReadAllBytes(path);\n      Settings = UIStateSerializer.Deserialize<ApplicationSettings>(data);\n\n      // Do some basic sanity checks in case the settings file is incompatible.\n      if (Settings.RecentFiles == null) {\n        Settings.RecentFiles = new List<string>();\n      }\n\n      if (Settings.RecentComparedFiles == null) {\n        Settings.RecentComparedFiles = new List<Tuple<string, string>>();\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Settings = new ApplicationSettings();\n      Trace.TraceError($\"Failed to load app settings: {ex}\");\n      return false;\n    }\n  }\n\n  public static void SaveApplicationSettings() {\n    try {\n      byte[] data = UIStateSerializer.Serialize(Settings);\n      CreateSettingsDirectory();\n      string path = GetSettingsFilePath();\n      File.WriteAllBytes(path, data);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to save app settings: {ex}\");\n    }\n  }\n\n  public static void LaunchSettingsFileEditor(string settingsPath) {\n    if (string.IsNullOrEmpty(settingsPath) ||\n        !File.Exists(settingsPath)) {\n      MessageBox.Show($\"Could not file settings file {settingsPath}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Warning);\n      return;\n    }\n\n    try {\n      var psi = new ProcessStartInfo(settingsPath) {\n        UseShellExecute = true\n      };\n\n      Process.Start(psi);\n    }\n    catch (Exception ex) {\n      MessageBox.Show($\"Failed to open settings file {settingsPath}\\n{ex.Message}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Error);\n    }\n  }\n\n  public static void OpenSettingsFolder(string settingsPath) {\n    if (string.IsNullOrEmpty(settingsPath) ||\n        !Directory.Exists(settingsPath)) {\n      MessageBox.Show($\"Could not fine directory\\n{settingsPath}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Warning);\n      return;\n    }\n\n    try {\n      var psi = new ProcessStartInfo(settingsPath) {\n        UseShellExecute = true\n      };\n\n      Process.Start(psi);\n    }\n    catch (Exception ex) {\n      MessageBox.Show($\"Failed to open settings folder {settingsPath}\\n{ex.Message}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Error);\n    }\n  }\n\n  public static void DeleteSettingsFile(string settingsPath) {\n    if (string.IsNullOrEmpty(settingsPath) ||\n        !File.Exists(settingsPath)) {\n      return;\n    }\n\n    try {\n      File.Delete(settingsPath);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to delete file {settingsPath}: {ex}\");\n    }\n  }\n\n  public static void InstallExtension() {\n    if (!Utils.OpenExternalFile(GetExtensionFilePath())) {\n      MessageBox.Show(\"Failed to open VS extension installer\", \"Profile Explorer\", MessageBoxButton.OK,\n                      MessageBoxImage.Error);\n    }\n  }\n\n  public static void OpenDocumentation() {\n    if (!Utils.OpenURL(DocumentationLocation)) {\n      MessageBox.Show(\"Failed to open documentation page\", \"Profile Explorer\", MessageBoxButton.OK,\n                      MessageBoxImage.Error);\n    }\n  }\n\n  public static bool StartNewApplicationInstance(string args = \"\", bool adminMode = false) {\n    var psi = new ProcessStartInfo(ApplicationPath);\n    psi.Arguments = args;\n    psi.UseShellExecute = true;\n\n    if (adminMode) {\n      psi.Verb = \"runas\";\n    }\n\n    try {\n      using var process = new Process();\n      process.StartInfo = psi;\n      process.Start();\n      return true;\n    }\n    catch (Exception ex) {\n      Debug.WriteLine($\"Failed to start new app instance: {ex}\");\n      return false;\n    }\n  }\n\n  public static void RestartApplicationAsAdmin(string args = \"\") {\n    StartNewApplicationInstance(args, true);\n    Current.Shutdown();\n  }\n\n  private static bool CreateSettingsDirectory() {\n    try {\n      string path = GetSettingsDirectoryPath();\n      CreateDirectories(path);\n\n      //? TODO: Walk over list of registers compilers\n      InitializeSettingsFilesDirectory(\"llvm\");\n      InitializeSettingsFilesDirectory(\"ASM\");\n\n      InitializeSettingsFilesDirectory(ScriptsDirectory);\n      InitializeSettingsFilesDirectory(ThemesDirectory);\n      InitializeSettingsFilesDirectory(WorkspacesDirectory);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to create settings directory: {ex}\");\n      return false;\n    }\n  }\n\n  public static bool CreateDirectories(string path) {\n    try {\n      if (!Directory.Exists(path)) {\n        Directory.CreateDirectory(path);\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to create directories for {path}: {ex}\");\n      return false;\n    }\n  }\n\n  public static string GetSettingsDirectoryPath() {\n    string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);\n    return Path.Combine(path, SettingsPath);\n  }\n\n  private static string GetSettingsFilePath(string file) {\n    // File relative to the settings directory.\n    string path = GetSettingsDirectoryPath();\n    return Path.Combine(path, file);\n  }\n\n  private static string GetSettingsFilePath(string subDir, string file, string extension = \"\") {\n    // File relative to the settings directory.\n    string path = GetSettingsDirectoryPath();\n    return Path.Combine(path, subDir, !string.IsNullOrEmpty(extension) ?\n                          $\"{file}.{extension}\" : file);\n  }\n\n  private static string GetApplicationFilePath(string file) {\n    // File relative to the application install directory.\n    string path = ApplicationDirectory;\n    return Path.Combine(path, file);\n  }\n\n  private static string GetApplicationFilePath(string subDir, string file, string extension = \"\") {\n    // File relative to the application install directory.\n    string path = ApplicationDirectory;\n    return Path.Combine(path, subDir, file, extension);\n  }\n\n  private static string GetCompilerApplicationDirectoryPath(string compilerName) {\n    return GetApplicationFilePath(compilerName);\n  }\n\n  private static string GetCompilerApplicationFilePath(string file, string compilerName, string extension = \"\") {\n    file = string.IsNullOrEmpty(extension) ? file : Path.GetFileNameWithoutExtension(file);\n    return GetApplicationFilePath(compilerName, file, extension);\n  }\n\n  private static bool CreateDirectoriesForFile(string file) {\n    try {\n      Directory.CreateDirectory(Path.GetDirectoryName(file));\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to create directories for {file}: {ex}\");\n      return false;\n    }\n  }\n\n  private static string GetSettingsFilePath() {\n    return GetSettingsFilePath(SettingsFile);\n  }\n\n  public static bool ContainsSettingsFile(string dirPath) {\n    return File.Exists(Path.Combine(dirPath, SettingsFile));\n  }\n\n  private static string GetSyntaxFileName(string filePath) {\n    try {\n      var xmlDoc = new XmlDocument();\n      var ns = new XmlNamespaceManager(xmlDoc.NameTable);\n      ns.AddNamespace(\"syntax\", \"http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008\");\n\n      xmlDoc.Load(filePath);\n      var node = xmlDoc.SelectSingleNode(\"//syntax:SyntaxDefinition\", ns);\n\n      if (node != null) {\n        return node.Attributes.GetNamedItem(\"name\").InnerText;\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to get syntax file name: {ex}\");\n    }\n\n    return \"\";\n  }\n\n  private static bool InitializeSettingsFilesDirectory(string directory) {\n    try {\n      string syntaxFilesDir = GetCompilerSettingsDirectoryPath(directory);\n      CreateDirectories(syntaxFilesDir);\n\n      string compilerDir = GetCompilerApplicationDirectoryPath(directory);\n      string[] files = Directory.GetFiles(compilerDir, \"*.*\");\n\n      foreach (string file in files) {\n        string destFile = GetCompilerSettingsFilePath(Path.GetFileName(file), directory);\n\n        //? TODO: This should rather try to merge the potentially newer file\n        //? with the existing one that may have user customizations.\n        File.Copy(file, destFile, true);\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      //Trace.TraceError($\"Failed to create syntax file directory: {ex}\");\n      return false;\n    }\n  }\n\n  public void SetupExceptionHandling(bool showUIPrompt = true) {\n    AppDomain.CurrentDomain.UnhandledException += (s, e) =>\n      ErrorReporting.LogUnhandledException((Exception)e.ExceptionObject,\n                                           \"AppDomain.CurrentDomain.UnhandledException\",\n                                           showUIPrompt);\n\n    Dispatcher.UnhandledException += (s, e) =>\n      ErrorReporting.LogUnhandledException(e.Exception,\n                                           \"Application.Current.DispatcherUnhandledException\",\n                                           showUIPrompt);\n\n    Current.DispatcherUnhandledException += (s, e) =>\n      ErrorReporting.LogUnhandledException(e.Exception,\n                                           \"Application.Current.DispatcherUnhandledException\",\n                                           showUIPrompt);\n\n    TaskScheduler.UnobservedTaskException += (s, e) =>\n      ErrorReporting.LogUnhandledException(e.Exception, \"TaskScheduler.UnobservedTaskException\",\n                                           showUIPrompt);\n  }\n\n  protected override void OnStartup(StartupEventArgs e) {\n    AppStartTime = DateTime.UtcNow;\n    base.OnStartup(e);\n\n    // Initialize UI-specific JSON converters\n    UIJsonUtils.Initialize();\n\n    // Register UI-specific type converters for settings system\n    RegisterSettingsTypeConverters();\n\n    if (!Debugger.IsAttached) {\n      SetupExceptionHandling();\n    }\n\n    FixPopupPlacement();\n\n    // Disable most data-binding error reporting, slows down debugging too much.\n    PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Critical;\n\n    // Enable file output for tracing.\n    OpenLogFile();\n    SetupJumplist();\n\n    if (!LoadApplicationSettings()) {\n      // Failed to load settings, reset them.\n      Utils.TryDeleteFile(GetSettingsFilePath());\n      Settings = new ApplicationSettings();\n      IsFirstRun = true;\n    }\n\n    // Configure CoreSettingsProvider to use UI settings instead of defaults\n    CoreSettingsProvider.SetProvider(new UISettingsProvider());\n\n    if (Settings.GeneralSettings.DisableHardwareRendering) {\n      Trace.WriteLine($\"Disable hardware rendering\");\n      RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;\n    }\n\n    // Create and show the main window manually\n    var mainWindow = new MainWindow();\n    mainWindow.Show();\n\n    // Initialize MCP server if enabled\n    InitializeMcpServerAsync(mainWindow);\n  }\n\n  private void InitializeMcpServerAsync(MainWindow mainWindow)\n  {\n    try\n    {\n      // Create the MCP action executor\n      var executor = new McpActionExecutor(mainWindow);\n\n      // Start the MCP server in the background\n      mcpServerTask = Task.Run(async () =>\n      {\n        try\n        {\n          await McpServerConfiguration.StartServerWithExecutorAsync(executor);\n        }\n        catch (Exception ex)\n        {\n          Trace.WriteLine($\"MCP Server error: {ex}\");\n        }\n      });\n\n      // When MCP session ends, close the application without confirmation\n      // Only shutdown if we were actually in automation mode (MCP client was connected)\n      mcpServerTask.ContinueWith(t =>\n      {\n        if (SuppressDialogsForAutomation)\n        {\n          Trace.WriteLine(\"MCP session ended, shutting down application\");\n          Current.Dispatcher.Invoke(() =>\n          {\n            Current.Shutdown();\n          });\n        }\n      }, TaskContinuationOptions.OnlyOnRanToCompletion);\n\n      Trace.WriteLine(\"MCP Server initialization started\");\n    }\n    catch (Exception ex)\n    {\n      Trace.WriteLine($\"Failed to initialize MCP Server: {ex}\");\n    }\n  }\n\n  protected override void OnExit(ExitEventArgs e)\n  {\n    // Wait for MCP server to shutdown gracefully\n    if (mcpServerTask != null && !mcpServerTask.IsCompleted)\n    {\n      try\n      {\n        // Give the server a moment to shutdown gracefully\n        mcpServerTask.Wait(TimeSpan.FromSeconds(5));\n      }\n      catch (Exception ex)\n      {\n        Trace.WriteLine($\"Error during MCP server shutdown: {ex}\");\n      }\n    }\n\n    base.OnExit(e);\n  }\n\n  private static void FixPopupPlacement() {\n    // On touchscreen laptops, popups are not displayed in the right place.\n    // Hack taken from https://stackoverflow.com/a/54298981 to fix it.\n    bool ifLeft = SystemParameters.MenuDropAlignment;\n\n    if (ifLeft) {\n      // change to false\n      var t = typeof(SystemParameters);\n      var field = t.GetField(\"_menuDropAlignment\", BindingFlags.NonPublic | BindingFlags.Static);\n      field.SetValue(null, false);\n    }\n  }\n\n  private void RegisterSettingsTypeConverters() {\n    // Register UI-specific type converters for the settings system\n    ProfileExplorer.Core.Settings.SettingsTypeRegistry.RegisterConverter(new ProfileExplorerUI.Settings.ColorSettingsConverter());\n  }\n\n  private void SetupJumplist() {\n    var instanceTask = new JumpTask {\n      ApplicationPath = ApplicationPath,\n      Arguments = \"\",\n      Title = \"New instance\",\n      Description = \"Start a new Profile Explorer instance\",\n      CustomCategory = \"Tasks\"\n    };\n\n    // var recordTask = new JumpTask {\n    //   ApplicationPath = ApplicationPath,\n    //   IconResourcePath = ApplicationPath,\n    //   IconResourceIndex = 2,\n    //   Arguments = \"\",\n    //   Title = \"Record profile\",\n    //   Description = \"Start a new Profile Explorer instance\",\n    //   CustomCategory = \"Tasks\"\n    // };\n    //\n    //\n    // var recordSystemTask = new JumpTask {\n    //   ApplicationPath = ApplicationPath,\n    //   IconResourcePath = ApplicationPath,\n    //   IconResourceIndex = 2,\n    //   Arguments = \"\",\n    //   Title = \"Record system-wide profile\",\n    //   Description = \"Start a new Profile Explorer instance\",\n    //   CustomCategory = \"Tasks\"\n    // };\n\n    var currentJumplist = JumpList.GetJumpList(Current);\n\n    if (currentJumplist != null) {\n      currentJumplist.JumpItems.Clear();\n      currentJumplist.JumpItems.Add(instanceTask);\n      //currentJumplist.JumpItems.Add(recordTask);\n      //currentJumplist.JumpItems.Add(recordSystemTask);\n      currentJumplist.Apply();\n    }\n    else {\n      var jumpList = new JumpList();\n      jumpList.JumpItems.Add(instanceTask);\n      //jumpList.JumpItems.Add(recordTask);\n      //jumpList.JumpItems.Add(recordSystemTask);\n      JumpList.SetJumpList(Current, jumpList);\n    }\n  }\n\n  public static void OpenLogFile() {\n    try {\n      string traceFilePath = GetTraceFilePath();\n\n      if (File.Exists(traceFilePath)) {\n        File.Copy(traceFilePath, GetBackupTraceFilePath(), true);\n        File.Delete(traceFilePath);\n      }\n\n      Trace.Listeners.Add(new TextWriterTraceListener(traceFilePath));\n#if DEBUG\n      Trace.AutoFlush = true;\n#endif\n    }\n    catch (Exception ex) {\n      Debug.WriteLine($\"Failed to create trace file: {ex}\");\n    }\n  }\n\n  public static void CloseLogFile() {\n    try {\n      Trace.Flush();\n\n      foreach (TraceListener listener in Trace.Listeners) {\n        listener.Close();\n      }\n\n      Trace.Close();\n    }\n    catch (Exception ex) {\n      Debug.WriteLine($\"Failed to close trace file: {ex}\");\n    }\n  }\n\n  public static void Restart() {\n    //? TODO: Start new instance only after settings were saved.\n    Process.Start(Process.GetCurrentProcess().MainModule.FileName);\n    Current.Shutdown();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Client.vsdoc",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<configuration>\n  <!--   VSdocman config file for current project/solution.-->\n  <activeProfile>default</activeProfile>\n  <appSettings>\n    <add key=\"VBdocman_comNonCommented\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_regexFilters\"><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<filters />]]></add>\n    <add key=\"VBdocman_customVar1\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comInterface\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_outputPath\"><![CDATA[$(ProjectDir)VSdoc]]></add>\n    <add key=\"VBdocman_useConditionalCompilation\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_customVar2\"><![CDATA[]]></add>\n    <add key=\"VBdocman_SupportedXamarinIos\"><![CDATA[]]></add>\n    <add key=\"VBdocman_enumSorting\"><![CDATA[1]]></add>\n    <add key=\"VBdocman_comVariable\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comStdModule\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_ListNamespacesWithShortNames\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comPublic\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedPlatforms\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comProtected\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedNetFrameworkClientProfile\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comPrivate\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comWriteDescription\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comProtectedFriend\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comObject\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comDelegate\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedXnaFramework\"><![CDATA[]]></add>\n    <add key=\"VBdocman_emptyOutputFolder\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_rootNamespaceCommentStyle\"><![CDATA[2]]></add>\n    <add key=\"VBdocman_comEnumeration\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comMethod\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comProperty\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedNetCompactFramework\"><![CDATA[]]></add>\n    <add key=\"VBdocman_removeAttributes\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_externalFilesFolder\"><![CDATA[]]></add>\n    <add key=\"VBdocman_showFormsSeparate\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_generateJscriptSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_generateCsharpSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_allowMacrosInComments\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_linkForExternalNotInFramework\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_showInherited\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_templateLocale\"><![CDATA[en-US]]></add>\n    <add key=\"VBdocman_SupportedNetCore\"><![CDATA[]]></add>\n    <add key=\"VBdocman_customVar3\"><![CDATA[]]></add>\n    <add key=\"VBdocman_unbreakSourceLines\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_supportedNetFramework\"><![CDATA[4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1]]></add>\n    <add key=\"VBdocman_pageFooterText\"><![CDATA[Generated with <see href=\"http://www.helixoft.com/vsdocman/overview.html\">VSdocman</see>]]></add>\n    <add key=\"VBdocman_comConstant\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedOthers\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comForm\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_comStructure\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_dontSortSeeAlsoList\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_templateFolder\"><![CDATA[$(VSdocmanDir)Templates]]></add>\n    <add key=\"VBdocman_ConstantValueDisplay\"><![CDATA[1]]></add>\n    <add key=\"VBdocman_helpTitle\"><![CDATA[Client Reference]]></add>\n    <add key=\"VBdocman_insertSourceGlobal\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_SupportedNetStandard\"><![CDATA[]]></add>\n    <add key=\"VBdocman_SupportedXamarinMac\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comFriend\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_templatePath\"><![CDATA[html_msdn2017.vbdt]]></add>\n    <add key=\"VBdocman_comDeclare\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_conditionalConstants\"><![CDATA[]]></add>\n    <add key=\"VBdocman_SupportedXamarinAndroid\"><![CDATA[]]></add>\n    <add key=\"VBdocman_supportedNetForWindowsStoreApps\"><![CDATA[]]></add>\n    <add key=\"VBdocman_ShowExtensionMethods\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_supportedPortableClassLibrary\"><![CDATA[]]></add>\n    <add key=\"VBdocman_generateCppSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_customTopics\"><![CDATA[<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<topics>\n  <topic>\n    <type>normal</type>\n    <is-default>yes</is-default>\n    <name>Client Reference</name>\n    <id>client_reference</id>\n    <comment><![CDATA[<summary></summary>vsdocman_escaped_]_]_></comment>\n    <namespaces />\n    <topics>\n      <topic>\n        <type>placeholder</type>\n        <is-default>no</is-default>\n        <name />\n        <id>5fea6551b15041bab2b98628490e9d86</id>\n        <comment><![CDATA[vsdocman_escaped_]_]_></comment>\n        <namespaces />\n        <topics />\n      </topic>\n    </topics>\n  </topic>\n</topics>]]></add>\n    <add key=\"VBdocman_generateVbSyntax\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_generateFsharpSyntax\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comEventDecl\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_GenerateReportFile\"><![CDATA[0]]></add>\n    <add key=\"VBdocman_comEvent\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_rootNamespaceText\"><![CDATA[]]></add>\n    <add key=\"VBdocman_comModulesSaveExcluded\"><![CDATA[-1]]></add>\n    <add key=\"VBdocman_fileNamingConvention\"><![CDATA[1]]></add>\n  </appSettings>\n</configuration>"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/ASM/ASMLoadedSectionHandler.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.Compilers.LLVM;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.UI.Compilers.Default;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorerUI.Session;\n\nnamespace ProfileExplorer.UI.Compilers.ASM;\n\npublic class ASMLoadedSectionHandler : ILoadedSectionHandler {\n  private ICompilerInfoProvider compilerInfo_;\n\n  public ASMLoadedSectionHandler(ICompilerInfoProvider compilerInfo) {\n    compilerInfo_ = compilerInfo;\n  }\n\n  public async Task HandleLoadedSection(IRDocument document, FunctionIR function, IRTextSection section) {\n    // Since the ASM blocks don't have a number in the text,\n    // attach an overlay label next to the first instr. in the block.\n    CreateBlockLabelOverlays(document, function);\n\n    // Annotate instrs. with source line numbers if debug info is available.\n    var sourceMarker = new SourceDocumentMarker(App.Settings.DocumentSettings.SourceMarkerSettings, compilerInfo_);\n    await sourceMarker.Mark(document, function);\n  }\n\n  private static void CreateBlockLabelOverlays(IRDocument document, FunctionIR function) {\n    double overlayHeight = document.TextArea.TextView.DefaultLineHeight;\n    var options = App.Settings.DocumentSettings.ProfileMarkerSettings;\n    var blockPen = ColorPens.GetPen(options.BlockOverlayBorderColor,\n                                    options.BlockOverlayBorderThickness);\n    document.SuspendUpdate();\n\n    foreach (var block in function.Blocks) {\n      if (block.Tuples.Count <= 0) {\n        continue;\n      }\n\n      string label = $\"B{block.Number}\";\n      var overlay = document.AddIconElementOverlay(block, null, 0, overlayHeight, label, null,\n                                                   HorizontalAlignment.Left);\n      overlay.MarginX = -8;\n      overlay.Padding = 4;\n      overlay.ShowOnMarkerBar = false;\n      overlay.IsLabelPinned = true;\n      overlay.AllowLabelEditing = false;\n      overlay.TextWeight = FontWeights.Bold;\n      overlay.TextColor = options.BlockOverlayTextColor.AsBrush();\n\n      var backColor = block.HasEvenIndexInFunction ?\n        App.Settings.DocumentSettings.BackgroundColor :\n        App.Settings.DocumentSettings.AlternateBackgroundColor;\n      overlay.Background = ColorBrushes.GetBrush(backColor);\n      overlay.Border = blockPen;\n\n      overlay.ShowBackgroundOnMouseOverOnly = false;\n      overlay.ShowBorderOnMouseOverOnly = false;\n      overlay.UseLabelBackground = true;\n    }\n\n    document.ResumeUpdate();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/Default/BuiltinFunctionTasks/UnusedInstructionsFunctionTask.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Compilers.Default;\n\nclass UnusedInstructionsTaskOptions : IFunctionTaskOptions {\n  public UnusedInstructionsTaskOptions() {\n    Reset();\n  }\n\n  [DisplayName(\"Consider only SSA values\")]\n  [Description(\"Consider only instructions that have a destination operand in SSA form\")]\n  public bool HandleOnlySSA { get; set; }\n  [DisplayName(\"Marker color\")]\n  [Description(\"Color to be used for marking unused instructions\")]\n  public Color MarkerColor { get; set; }\n\n  public void Reset() {\n    HandleOnlySSA = true;\n    MarkerColor = Colors.Pink;\n  }\n}\n\nclass UnusedInstructionsFunctionTask {\n  public static bool MarkUnusedInstructions(FunctionIR function, IRDocument document, IFunctionTaskOptions options,\n                                            IUISession session, CancelableTask cancelableTask) {\n    var taskOptions = options as UnusedInstructionsTaskOptions;\n    var unusedInstr = new HashSet<InstructionIR>();\n    var walker = new CFGBlockOrdering(function);\n\n    walker.PostorderWalk((block, index) => {\n      foreach (var instr in block.InstructionsBack) {\n        if (IsUnusedInstruction(GetSSADefinitionTag(instr), unusedInstr)) {\n          document.Dispatcher.BeginInvoke((Action)(() => {\n            document.MarkElement(instr, taskOptions.MarkerColor);\n          }));\n\n          unusedInstr.Add(instr);\n        }\n      }\n\n      return !cancelableTask.IsCanceled;\n    });\n\n    return true;\n  }\n\n  //? TODO: Add hooks for quierying IR if an instr is DCE candidate (reject calls for ex)\n  private static SSADefinitionTag GetSSADefinitionTag(InstructionIR instr) {\n    if (instr.Destinations.Count == 0) {\n      return null;\n    }\n\n    var destOp = instr.Destinations[0];\n\n    if (destOp.IsTemporary) {\n      return destOp.GetTag<SSADefinitionTag>();\n    }\n\n    return null;\n  }\n\n  private static bool IsUnusedInstruction(SSADefinitionTag ssaDefTag, HashSet<InstructionIR> unusedInstrs) {\n    if (ssaDefTag == null) {\n      return false;\n    }\n\n    if (!ssaDefTag.HasUsers) {\n      return true;\n    }\n\n    foreach (var user in ssaDefTag.Users) {\n      if (!unusedInstrs.Contains(user.OwnerInstruction)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/Default/BuiltinQueries/RegisterQuery.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI.Compilers.Default;\n\npublic class RegisterQuery : IElementQuery {\n  public IUISession Session { get; private set; }\n\n  public bool Initialize(IUISession session) {\n    Session = session;\n    return true;\n  }\n\n  public bool Execute(QueryData data) {\n    data.ResetResults();\n    var element = data.GetInput<IRElement>(0);\n    bool considerOverlapping = data.GetInput<bool>(1);\n    bool isTemporary = data.GetInput<bool>(2);\n    var color = data.GetInput<Color>(3);\n    var func = element.ParentFunction;\n\n    // Pick the query register.\n    var tag = GetRegisterTag(element);\n\n    if (tag == null) {\n      data.SetOutputWarning(\"Value has no register\");\n      return true;\n    }\n\n    int count = 0;\n    var document = Session.CurrentDocument;\n\n    var highlightingType = isTemporary ? HighlighingType.Selected : HighlighingType.Marked;\n    document.BeginMarkElementAppend(highlightingType);\n\n    foreach (var operand in func.AllElements) {\n      var otherTag = GetRegisterTag(operand);\n\n      if (otherTag == null) {\n        continue;\n      }\n\n      if (otherTag.Register.Equals(tag.Register) ||\n          considerOverlapping && otherTag.Register.OverlapsWith(tag.Register)) {\n        document.MarkElementAppend(operand, color, highlightingType);\n        count++;\n      }\n    }\n\n    document.EndMarkElementAppend(highlightingType);\n    data.SetOutput(\"Register instances\", count);\n    data.ClearButtons();\n    return true;\n  }\n\n  public static QueryDefinition GetDefinition() {\n    var query = new QueryDefinition(typeof(RegisterQuery), \"Registers\",\n                                    \"Details about post-lower registers\");\n    query.Data.AddInput(\"Operand\", QueryValueKind.Element);\n    query.Data.AddInput(\"Consider overlapping registers\", QueryValueKind.Bool, true);\n    query.Data.AddInput(\"Use temporary marking\", QueryValueKind.Bool, true);\n    query.Data.AddInput(\"Marking color\", QueryValueKind.Color, Colors.Pink);\n    return query;\n  }\n\n  private static RegisterTag GetRegisterTag(IRElement element) {\n    // For indirection, use the base value register.\n    if (element is OperandIR op && op.IsIndirection) {\n      return op.IndirectionBaseValue.GetTag<RegisterTag>();\n    }\n\n    return element.GetTag<RegisterTag>();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/Default/BuiltinQueries/ValueNumberQuery.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Query;\n\nnamespace ProfileExplorer.UI.Compilers.Default;\n\npublic class ValueNumberQuery : IElementQuery {\n  private static readonly string ValueNumberPrefix = \"vn \";\n  public IUISession Session { get; private set; }\n\n  public bool Initialize(IUISession session) {\n    Session = session;\n    return true;\n  }\n\n  public bool Execute(QueryData data) {\n    data.ResetResults();\n    var element = data.GetInput<IRElement>(\"Operand\");\n    string vn = DefaultRemarkParser.ExtractValueNumber(element, ValueNumberPrefix);\n\n    if (vn == null) {\n      return true;\n    }\n\n    var func = element.ParentFunction;\n    var sameVNInstrs = new HashSet<InstructionIR>();\n\n    func.ForEachInstruction(instr => {\n      string instrVN = DefaultRemarkParser.ExtractValueNumber(instr, ValueNumberPrefix);\n\n      if (instrVN == vn) {\n        sameVNInstrs.Add(instr);\n      }\n\n      return true;\n    });\n\n    data.SetOutput(\"Value number\", vn);\n    data.SetOutput(\"Instrs. with same value number\", sameVNInstrs.Count);\n    data.ClearButtons();\n\n    if (sameVNInstrs.Count > 0) {\n      data.AddButton(\"Mark same value number instrs.\", (sender, data) => {\n        //? TODO: Check for document/function still being the same\n        var document = Session.CurrentDocument;\n\n        foreach (var instr in sameVNInstrs) {\n          document.MarkElement(instr, Colors.YellowGreen);\n        }\n      });\n    }\n\n    return true;\n  }\n\n  public static QueryDefinition GetDefinition() {\n    var query = new QueryDefinition(typeof(ValueNumberQuery), \"Value Numbers\",\n                                    \"Details about values with SSA info\");\n    query.Data.AddInput(\"Operand\", QueryValueKind.Element);\n    query.Data.AddInput(\"Consider only dominated values\", QueryValueKind.Bool);\n    query.Data.AddInput(\"Marking color\", QueryValueKind.Color);\n    query.Data.AddOutput(\"Value number\", QueryValueKind.String);\n    return query;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/Default/DefaultRemarkParser.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Parser;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI.Compilers.Default;\n\npublic class DefaultRemarkParser {\n  private IRSectionParser parser_;\n\n  public DefaultRemarkParser(ICompilerIRInfo irInfo) {\n    parser_ = irInfo.CreateSectionParser(null);\n  }\n\n  public static string ExtractValueNumber(IRElement element, string prefix) {\n    var tag = element.GetTag<RemarkTag>();\n\n    if (tag == null) {\n      return null;\n    }\n\n    foreach (var remark in tag.Remarks) {\n      if (remark.RemarkText.StartsWith(prefix)) {\n        string[] tokens = remark.RemarkText.Split(' ', ':');\n        string number = tokens[1];\n        return number;\n      }\n    }\n\n    return null;\n  }\n\n  public void Initialize(ReadOnlyMemory<char> line) {\n  }\n\n  public TupleIR ParseTuple() {\n    return null;\n  }\n\n  public OperandIR ParseOperand() {\n    return null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/Default/DefaultRemarkProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorerUI.Session;\n\nnamespace ProfileExplorer.UI.Compilers.Default;\n\npublic sealed class DefaultRemarkProvider : IRRemarkProvider {\n  private const string MetadataStartString = \"/// remark:\";\n  private const string RemarkContextStartString = \"context_start\";\n  private const string RemarkContextEndString = \"context_end\";\n  private string compilerIRName_;\n  private ICompilerIRInfo irInfo_;\n  private List<RemarkCategory> categories_;\n  private List<RemarkSectionBoundary> boundaries_;\n  private List<RemarkTextHighlighting> highlighting_;\n  private RemarkCategory defaultCategory_;\n  private bool settingsLoaded_;\n\n  public DefaultRemarkProvider(ICompilerInfoProvider compilerInfo) {\n    compilerIRName_ = compilerInfo.CompilerIRName;\n    irInfo_ = compilerInfo.IR;\n    categories_ = new List<RemarkCategory>();\n    boundaries_ = new List<RemarkSectionBoundary>();\n    highlighting_ = new List<RemarkTextHighlighting>();\n    settingsLoaded_ = LoadSettings();\n  }\n\n  public string SettingsFilePath => App.GetRemarksDefinitionFilePath(compilerIRName_);\n\n  public List<RemarkCategory> RemarkCategories {\n    get {\n      if (LoadSettings()) {\n        return categories_;\n      }\n\n      return null;\n    }\n  }\n\n  public List<RemarkSectionBoundary> RemarkSectionBoundaries {\n    get {\n      if (LoadSettings()) {\n        return boundaries_;\n      }\n\n      return null;\n    }\n  }\n\n  public List<RemarkTextHighlighting> RemarkTextHighlighting {\n    get {\n      if (LoadSettings()) {\n        return highlighting_;\n      }\n\n      return null;\n    }\n  }\n\n  public bool SaveSettings() {\n    return false;\n  }\n\n  public bool LoadSettings() {\n    if (settingsLoaded_) {\n      return true;\n    }\n\n    var serializer = new RemarksDefinitionSerializer();\n    string settingsPath = SettingsFilePath;\n\n    if (settingsPath == null) {\n      return false;\n    }\n\n    if (!serializer.Load(settingsPath,\n                         out categories_,\n                         out boundaries_,\n                         out highlighting_)) {\n      Trace.TraceError(\"Failed to load RemarkProvider data\");\n      return false;\n    }\n\n    // Add a default category.\n    defaultCategory_ = new RemarkCategory {\n      Kind = RemarkKind.Default,\n      Title = \"\",\n      SearchedText = \"\",\n      MarkColor = Colors.Transparent\n    };\n\n    categories_.Add(defaultCategory_);\n    return true;\n  }\n\n  public List<Remark> ExtractRemarks(string text, FunctionIR function, IRTextSection section,\n                                     RemarkProviderOptions options,\n                                     CancelableTask cancelableTask) {\n    string[] lines = text.SplitLines();\n    return ExtractRemarks(new List<string>(lines), function, section,\n                          options, cancelableTask);\n  }\n\n  public List<Remark> ExtractRemarks(List<string> textLines, FunctionIR function, IRTextSection section,\n                                     RemarkProviderOptions options,\n                                     CancelableTask cancelableTask) {\n    if (!settingsLoaded_) {\n      return new List<Remark>(); // Failed to load settings, bail out.\n    }\n\n    // The RemarkContextState allows multiple threads to use the provider\n    // by not having any global state visible to all threads.\n    var remarks = new List<Remark>();\n    var state = new RemarkContextState();\n\n    ExtractInstructionRemarks(textLines, function, section, remarks,\n                              options, state, cancelableTask);\n    return remarks;\n  }\n\n  public OptimizationRemark GetOptimizationRemarkInfo(Remark remark) {\n    return null;\n  }\n\n  public List<IRTextSection> GetSectionList(IRTextSection currentSection, int maxDepth,\n                                            bool stopAtSectionBoundaries) {\n    var list = new List<IRTextSection>();\n\n    if (categories_ == null || boundaries_ == null) {\n      return list; // Error loading settings.\n    }\n\n    var function = currentSection.ParentFunction;\n\n    for (int i = currentSection.Number - 1, count = 0; i >= 0 && count < maxDepth; i--, count++) {\n      var section = function.Sections[i];\n      list.Add(section);\n\n      if (stopAtSectionBoundaries && boundaries_.Count > 0) {\n        if (boundaries_.Find(boundary =>\n                               TextSearcher.Contains(section.Name, boundary.SearchedText,\n                                                     boundary.SearchKind)) != null) {\n          break; // Stop once section boundary reached.\n        }\n      }\n    }\n\n    list.Reverse();\n    return list;\n  }\n\n  public List<Remark> ExtractAllRemarks(List<IRTextSection> sections, FunctionIR function,\n                                        ILoadedDocument document, RemarkProviderOptions options,\n                                        CancelableTask cancelableTask) {\n    if (!settingsLoaded_) {\n      return new List<Remark>(); // Failed to load settings, bail out.\n    }\n\n    int maxConcurrency = App.Settings.GeneralSettings.CurrentCpuCoreLimit;\n    var tasks = new Task<List<Remark>>[sections.Count];\n    using var concurrencySemaphore = new SemaphoreSlim(maxConcurrency);\n    int index = 0;\n\n    foreach (var section in sections) {\n      concurrencySemaphore.Wait();\n\n      tasks[index++] = Task.Run(() => {\n        try {\n          var sectionTextLines = document.Loader.GetSectionPassOutputTextLines(section.OutputBefore);\n          return ExtractRemarks(sectionTextLines, function, section,\n                                options, cancelableTask);\n        }\n        finally {\n          concurrencySemaphore.Release();\n        }\n      });\n    }\n\n    Task.WaitAll(tasks);\n\n    // Combine all remarks into a single list.\n    var remarks = new List<Remark>();\n\n    for (int i = 0; i < sections.Count; i++) {\n      remarks.AddRange(tasks[i].Result);\n    }\n\n    return remarks;\n  }\n\n  public RemarkCategory FindRemarkKind(string text, bool isInstructionElement) {\n    if (categories_ == null) {\n      return default(RemarkCategory); // Error loading settings.\n    }\n\n    text = text.Trim();\n\n    foreach (var category in categories_) {\n      // Ignore remarks that expect an entire instruction reference\n      // if the IR is not an instruction.\n      if (category.ExpectInstructionIR && !isInstructionElement) {\n        continue;\n      }\n\n      //? TODO: If SearchKind is Regex, this ends up creating a new Regex\n      //? instance for each remark, should make it once and attach it to category\n      if (TextSearcher.Contains(text, category.SearchedText, category.SearchKind)) {\n        return category;\n      }\n    }\n\n    return defaultCategory_;\n  }\n\n  private void ExtractInstructionRemarks(List<string> lines, FunctionIR function,\n                                         IRTextSection section, List<Remark> remarks,\n                                         RemarkProviderOptions options,\n                                         RemarkContextState state,\n                                         CancelableTask cancelableTask) {\n    var similarValueFinder = new SimilarValueFinder(function);\n    var refFinder = new ReferenceFinder(function, irInfo_);\n\n    // The split lines don't include the endline, but considering\n    // the \\r \\n is needed to get the proper document offset.\n    int newLineLength = Environment.NewLine.Length;\n    int lineStartOffset = 0;\n    var lineParser = new DefaultRemarkParser(irInfo_);\n    var parser = new DefaultRemarkParser(irInfo_);\n\n    //? TODO: For many lines, must be split in chunks and parallelized,\n    //? it can take 5-7s even on 30-40k instruction functs, which is not that uncommon...\n    for (int i = 0; i < lines.Count; i++) {\n      if (cancelableTask.IsCanceled) {\n        return;\n      }\n\n      int index = 0;\n      string line = lines[i];\n\n      if (line.StartsWith(MetadataStartString, StringComparison.Ordinal)) {\n        if (HandleMetadata(line, i, state)) {\n          lineStartOffset += line.Length + newLineLength;\n          continue;\n        }\n      }\n\n      while (index < line.Length) {\n        // Find next chunk delimited by whitespace.\n        if (index > 0) {\n          int next = line.IndexOf(' ', index);\n\n          if (next != -1) {\n            index = next + 1;\n          }\n        }\n\n        // Skip all whitespace.\n        while (index < line.Length && char.IsWhiteSpace(line[index])) {\n          index++;\n        }\n\n        if (index == line.Length) {\n          break;\n        }\n\n        lineParser.Initialize(line.AsMemory(index));\n        var tuple = lineParser.ParseTuple();\n\n        if (tuple is InstructionIR instr) {\n          var similarInstr = similarValueFinder.Find(instr);\n\n          if (similarInstr != null) {\n            var remarkLocation = new TextLocation(lineStartOffset, i, 0);\n\n            var location = new TextLocation(\n              instr.TextLocation.Offset + index + lineStartOffset, i, 0);\n\n            instr.TextLocation = location; // Set actual location in output text.\n\n            var remarkKind = FindRemarkKind(line, true);\n            var remark = new Remark(remarkKind, section, line.Trim(), line,\n                                    remarkLocation, true);\n            remark.ReferencedElements.Add(similarInstr);\n            remark.OutputElements.Add(instr);\n            remarks.Add(remark);\n            state.AttachToCurrentContext(remark);\n\n            index += instr.TextLength;\n            continue;\n          }\n        }\n\n        index++;\n      }\n\n      // Extract remarks mentioning only operands, not whole instructions.\n      //? TODO: If an operand is part of an instruction that was already matched\n      //? by a remark, don't include the operand anymore if it's the same remark text\n      if (!options.FindOperandRemarks) {\n        lineStartOffset += line.Length + newLineLength;\n        continue;\n      }\n\n      parser.Initialize(line.AsMemory());\n      var op = parser.ParseOperand();\n\n      while (op != null) {\n        var value = refFinder.FindEquivalentValue(op, true);\n\n        if (value != null && op.TextLocation.Line < lines.Count) {\n          var location = new TextLocation(op.TextLocation.Offset + lineStartOffset, i, 0);\n          op.TextLocation = location; // Set actual location in output text.\n\n          var remarkLocation = new TextLocation(lineStartOffset, i, 0);\n          var remarkKind = FindRemarkKind(line, false);\n          var remark = new Remark(remarkKind, section, line.Trim(), line,\n                                  remarkLocation, false);\n          remark.ReferencedElements.Add(value);\n          remark.OutputElements.Add(op);\n          remarks.Add(remark);\n          state.AttachToCurrentContext(remark);\n        }\n\n        op = parser.ParseOperand();\n      }\n\n      lineStartOffset += line.Length + newLineLength;\n    }\n  }\n\n  private bool HandleMetadata(string line, int lineNumber, RemarkContextState state) {\n    string[] tokens = line.Split(new[] {' ', ':', ','}, StringSplitOptions.RemoveEmptyEntries);\n\n    if (tokens.Length >= 2) {\n      if (tokens[2].StartsWith(RemarkContextStartString) && tokens.Length >= 5) {\n        state.StartNewContext(tokens[3], tokens[4], lineNumber);\n        return true;\n      }\n\n      if (tokens[2].StartsWith(RemarkContextEndString)) {\n        state.EndCurrentContext(lineNumber);\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  private class RemarkContextState {\n    private Stack<RemarkContext> contextStack_;\n    private List<RemarkContext> rootContexts_;\n\n    public RemarkContextState() {\n      contextStack_ = new Stack<RemarkContext>();\n      rootContexts_ = new List<RemarkContext>();\n    }\n\n    public List<RemarkContext> RootContexts => rootContexts_;\n\n    public void AttachToCurrentContext(Remark remark) {\n      var context = GetCurrentContext();\n\n      if (context != null) {\n        context.Remarks.Add(remark);\n        remark.Context = context;\n      }\n    }\n\n    public RemarkContext GetCurrentContext() {\n      return contextStack_.Count > 0 ? contextStack_.Peek() : null;\n    }\n\n    public RemarkContext StartNewContext(string id, string name, int lineNumber) {\n      var currentContext = GetCurrentContext();\n      var context = new RemarkContext(id, name, currentContext);\n\n      if (currentContext != null) {\n        currentContext.Children.Add(context);\n      }\n      else {\n        rootContexts_.Add(context);\n      }\n\n      context.StartLine = lineNumber;\n      contextStack_.Push(context);\n      return context;\n    }\n\n    public void EndCurrentContext(int lineNumber) {\n      if (contextStack_.Count > 0) {\n        var context = contextStack_.Pop();\n        context.EndLine = lineNumber;\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/Default/DefaultSectionStyleProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI.Compilers.Default;\n\npublic sealed class DefaultSectionStyleProvider : ISectionStyleProvider {\n  private List<MarkedSectionName> sectionNameMarkers_;\n  private ICompilerInfoProvider compilerInfo_;\n\n  public DefaultSectionStyleProvider(ICompilerInfoProvider compilerInfo) {\n    compilerInfo_ = compilerInfo;\n    sectionNameMarkers_ = new List<MarkedSectionName>();\n    LoadSettings();\n  }\n\n  public string SettingsFilePath => App.GetSectionsDefinitionFilePath(compilerInfo_.CompilerIRName);\n\n  public bool IsMarkedSection(IRTextSection section, out MarkedSectionName result) {\n    foreach (var nameMarker in sectionNameMarkers_) {\n      if (TextSearcher.Contains(section.Name, nameMarker.SearchedText, nameMarker.SearchKind)) {\n        result = nameMarker;\n        return true;\n      }\n    }\n\n    result = null;\n    return false;\n  }\n\n  public bool LoadSettings() {\n    var serializer = new SectionStyleProviderSerializer();\n    string settingsPath = App.GetSectionsDefinitionFilePath(compilerInfo_.CompilerIRName);\n\n    if (settingsPath == null) {\n      return false;\n    }\n\n    if (!serializer.Load(settingsPath, out sectionNameMarkers_)) {\n      Trace.TraceError(\"Failed to load SectionStyleProvider data\");\n      return false;\n    }\n\n    return true;\n  }\n\n  public bool SaveSettings() {\n    return false;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Compilers/LLVM/LLVMLoadedSectionHandler.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Compilers.LLVM;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.UI.Compilers.Default;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.UI;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorerUI.Session;\n\nnamespace ProfileExplorer.UI.Compilers.LLVM;\n\npublic class LLVMLoadedSectionHandler : ILoadedSectionHandler {\n  public Task HandleLoadedSection(IRDocument document, FunctionIR function, IRTextSection section) {\n    return Task.CompletedTask;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ColorPaletteSelector.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Controls.ColorPaletteSelector\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n\n  <UserControl.LayoutTransform>\n    <ScaleTransform x:Name=\"ZoomTransform\" />\n  </UserControl.LayoutTransform>\n\n  <xctk:SplitButton\n    x:Name=\"PaletteSplitButton\"\n    HorizontalContentAlignment=\"Stretch\"\n    VerticalContentAlignment=\"Stretch\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    Click=\"PaletteSplitButton_OnClick\"\n    DropDownContentBackground=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    DropDownPosition=\"Bottom\">\n    <xctk:SplitButton.Content>\n      <local:ColorPaletteViewer\n        x:Name=\"PaletteViewer\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\" />\n    </xctk:SplitButton.Content>\n    <xctk:SplitButton.DropDownContent>\n      <ListBox\n        x:Name=\"PaletteList\"\n        HorizontalContentAlignment=\"Stretch\"\n        Background=\"Transparent\"\n        SelectionChanged=\"PaletteList_OnSelectionChanged\">\n        <ListBox.ItemTemplate>\n          <DataTemplate>\n            <local:ColorPaletteViewer\n              Height=\"18\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Stretch\"\n              Palette=\"{Binding .}\" />\n          </DataTemplate>\n        </ListBox.ItemTemplate>\n        <ListBox.ItemContainerStyle>\n          <Style TargetType=\"ListBoxItem\">\n            <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n            <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n          </Style>\n        </ListBox.ItemContainerStyle>\n      </ListBox>\n    </xctk:SplitButton.DropDownContent>\n  </xctk:SplitButton>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ColorPaletteSelector.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace ProfileExplorer.UI.Controls;\n\n/// <summary>\n/// Interaction logic for ColorPaletteSelector.xaml\n/// </summary>\npublic partial class ColorPaletteSelector : UserControl, INotifyPropertyChanged {\n  public static readonly DependencyProperty SelectedPaletteProperty =\n    DependencyProperty.Register(\"SelectedPalette\", typeof(ColorPalette), typeof(ColorPaletteSelector),\n                                new PropertyMetadata(null, OnSelectedPaletteChanged));\n  public static readonly DependencyProperty PalettesSourceProperty =\n    DependencyProperty.Register(\"PalettesSource\", typeof(List<ColorPalette>), typeof(ColorPaletteSelector),\n                                new PropertyMetadata(null));\n\n  public ColorPaletteSelector() {\n    InitializeComponent();\n    ZoomTransform.ScaleX = WindowScaling;\n    ZoomTransform.ScaleY = WindowScaling;\n  }\n\n  public double PreviewWidth {\n    get => PaletteList.Width;\n    set => PaletteList.Width = value;\n  }\n\n  public ColorPalette SelectedPalette {\n    get => (ColorPalette)GetValue(SelectedPaletteProperty);\n    set {\n      if (value != SelectedPalette) {\n        SetValue(SelectedPaletteProperty, value);\n        PaletteViewer.Palette = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public List<ColorPalette> PalettesSource {\n    get => (List<ColorPalette>)GetValue(PalettesSourceProperty);\n    set {\n      if (value != PalettesSource) {\n        SetValue(PalettesSourceProperty, value);\n        PaletteList.ItemsSource = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private static void OnSelectedPaletteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n    var sender = d as ColorPaletteSelector;\n    var value = e.NewValue as ColorPalette;\n    sender.SelectedPalette = value;\n    sender.PaletteViewer.Palette = value;\n  }\n\n  private void PaletteList_OnSelectionChanged(object sender, SelectionChangedEventArgs e) {\n    SelectedPalette = PaletteList.SelectedItem as ColorPalette;\n    PaletteSplitButton.IsOpen = false;\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value))\n      return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private void PaletteSplitButton_OnClick(object sender, RoutedEventArgs e) {\n    PaletteSplitButton.IsOpen = true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ColorPaletteViewer.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Controls.ColorPaletteViewer\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <Grid />\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ColorPaletteViewer.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI.Controls;\n\n/// <summary>\n/// Interaction logic for ColorPaletteViewer.xaml\n/// </summary>\npublic partial class ColorPaletteViewer : UserControl {\n  public static readonly DependencyProperty PaletteProperty =\n    DependencyProperty.Register(\"Palette\", typeof(ColorPalette), typeof(ColorPaletteViewer),\n                                new PropertyMetadata(null, OnPaletteChanged));\n\n  public ColorPaletteViewer() {\n    InitializeComponent();\n  }\n\n  public ColorPalette Palette {\n    get => (ColorPalette)GetValue(PaletteProperty);\n    set {\n      SetValue(PaletteProperty, value);\n      InvalidateVisual();\n    }\n  }\n\n  private static void OnPaletteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n    var source = d as ColorPaletteViewer;\n    source.Palette = e.NewValue as ColorPalette;\n  }\n\n  protected override void OnRender(DrawingContext dc) {\n    var palette = Palette;\n\n    if (palette == null || palette.Colors.Count == 0) {\n      return;\n    }\n\n    double width = ActualWidth;\n    double height = ActualHeight;\n    double cellWidth = width / palette.Colors.Count;\n    var pen = ColorPens.GetTransparentPen(Colors.Black, 50, 0.5);\n\n    for (int i = 0; i < palette.Colors.Count; i++) {\n      var color = palette.Colors[i].AsBrush();\n      dc.DrawRectangle(color, pen, new Rect(i * cellWidth, 0, cellWidth, height));\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ColorSelector.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.ColorSelector\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:toolkit=\"clr-namespace:Xceed.Wpf.Toolkit;assembly=DotNetProjects.Wpf.Extended.Toolkit\"\n  d:DesignHeight=\"250\"\n  d:DesignWidth=\"400\"\n  mc:Ignorable=\"d\">\n  <UserControl.LayoutTransform>\n    <ScaleTransform x:Name=\"ZoomTransform\" />\n  </UserControl.LayoutTransform>\n\n  <StackPanel\n    DataContext=\"{Binding RelativeSource={RelativeSource AncestorType=UserControl}}\"\n    Orientation=\"Vertical\">\n    <StackPanel\n      Margin=\"0,2,0,0\"\n      Orientation=\"Horizontal\">\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Background=\"{Binding Path=ButtonBrushes[0]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"1\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[1]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"2\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[2]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"3\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[3]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"4\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[4]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"5\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        x:Name=\"PickAnyButton\"\n        Width=\"48\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"1,1,1,1\"\n        Click=\"AnyButton_Click\"\n        Content=\"Pick Any\"\n        FontSize=\"10\" />\n    </StackPanel>\n    <StackPanel\n      Margin=\"0,2,0,2\"\n      Orientation=\"Horizontal\">\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Background=\"{Binding Path=ButtonBrushes[5]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"6\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[6]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"7\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[7]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"8\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[8]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"9\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[9]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"0\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        x:Name=\"MoreButton\"\n        Width=\"48\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"1,1,1,1\"\n        Click=\"MoreButton_Click\"\n        Content=\"More\"\n        FontSize=\"10\" />\n      <toolkit:ColorPicker\n        x:Name=\"MoreColorPicker\"\n        Width=\"0\"\n        Height=\"0\"\n        ShowDropDownButton=\"False\"\n        ShowStandardColors=\"False\"\n        ShowTabHeaders=\"False\"\n        Visibility=\"Collapsed\" />\n    </StackPanel>\n    <StackPanel Orientation=\"Horizontal\">\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Background=\"{Binding Path=ButtonBrushes[10]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"A\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[11]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"B\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[12]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"C\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[13]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"D\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"{Binding Path=ButtonBrushes[14]}\"\n        BorderThickness=\"1,1,1,1\"\n        Content=\"E\"\n        FontSize=\"10\"\n        PreviewMouseUp=\"Button_MouseUp\" />\n    </StackPanel>\n  </StackPanel>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ColorSelector.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class SelectedColorEventArgs : EventArgs {\n  public Color SelectedColor { get; set; }\n}\n\npublic partial class ColorSelector : UserControl {\n  public static readonly DependencyProperty CommandTargetProperty =\n    DependencyProperty.Register(\"CommandTarget\", typeof(IInputElement), typeof(ColorSelector),\n                                new UIPropertyMetadata(null));\n  public static DependencyProperty ColorSelectedCommandProperty =\n    DependencyProperty.Register(\"ColorSelectedCommand\", typeof(ICommand), typeof(ColorSelector));\n  private static readonly Color[] ButtonColors;\n\n  static ColorSelector() {\n    ButtonColors = new[] {\n      Utils.ColorFromString(\"#F2C3C1\"),\n      Utils.ColorFromString(\"#F3F4A6\"),\n      Utils.ColorFromString(\"#D2F4C3\"),\n      Utils.ColorFromString(\"#C1D4F2\"),\n      Utils.ColorFromString(\"#B1DDD4\"),\n      Utils.ColorFromString(\"#F2C1DA\"),\n      Utils.ColorFromString(\"#DED1FF\"),\n      Utils.ColorFromString(\"#C3E6F4\"),\n      Utils.ColorFromString(\"#F2D8C1\"),\n      Utils.ColorFromString(\"#EDE4BD\"),\n      Utils.ColorFromString(\"#ED8EBF\"),\n      Utils.ColorFromString(\"#FFF47F\"),\n      Utils.ColorFromString(\"#B9FF99\"),\n      Utils.ColorFromString(\"#99E2FF\"),\n      Utils.ColorFromString(\"#C6B2FF\")\n    };\n  }\n\n  public ColorSelector() {\n    InitializeComponent();\n    ZoomTransform.ScaleX = WindowScaling;\n    ZoomTransform.ScaleY = WindowScaling;\n    Focusable = true;\n    PreviewKeyDown += ColorSelector_PreviewKeyDown;\n    Loaded += ColorSelector_Loaded;\n    ButtonBrushes = new Brush[ButtonColors.Length];\n\n    for (int i = 0; i < ButtonColors.Length; i++) {\n      ButtonBrushes[i] = ColorBrushes.GetBrush(ButtonColors[i]);\n    }\n  }\n\n  public Brush[] ButtonBrushes { get; set; }\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public ICommand ColorSelectedCommand {\n    get => (ICommand)GetValue(ColorSelectedCommandProperty);\n    set => SetValue(ColorSelectedCommandProperty, value);\n  }\n\n  public IInputElement CommandTarget {\n    get => (IInputElement)GetValue(CommandTargetProperty);\n    set => SetValue(CommandTargetProperty, value);\n  }\n\n  public event EventHandler<SelectedColorEventArgs> ColorSelected;\n\n  private void ColorSelector_Loaded(object sender, RoutedEventArgs e) {\n    Focus();\n  }\n\n  private void ColorSelector_PreviewKeyDown(object sender, KeyEventArgs e) {\n    int index = e.Key switch {\n      Key.D0 => 0,\n      Key.D1 => 1,\n      Key.D2 => 2,\n      Key.D3 => 3,\n      Key.D4 => 4,\n      Key.D5 => 5,\n      Key.D6 => 6,\n      Key.D7 => 7,\n      Key.D8 => 8,\n      Key.D9 => 9,\n      Key.A  => 10,\n      Key.B  => 11,\n      Key.C  => 12,\n      Key.D  => 13,\n      Key.E  => 14,\n      _      => -1\n    };\n\n    if (index != -1) {\n      CommitColorAtIndex(index);\n      e.Handled = true;\n    }\n  }\n\n  private void CommitColorAtIndex(int index) {\n    CommitColor(ButtonColors[index]);\n  }\n\n  private void CommitColor(Color color) {\n    RaiseSelectedColorEvent(color);\n    Utils.CloseParentMenu(this);\n  }\n\n  private void RaiseSelectedColorEvent(Color color) {\n    if (ColorSelectedCommand == null && ColorSelected == null) {\n      return;\n    }\n\n    var parentHost = Utils.FindParentHost(this);\n\n    if (parentHost != null) {\n      parentHost.Focus();\n    }\n\n    var args = new SelectedColorEventArgs {\n      SelectedColor = color\n    };\n\n    if (ColorSelectedCommand != null) {\n      if (ColorSelectedCommand.CanExecute(args)) {\n        ColorSelectedCommand.Execute(args);\n      }\n    }\n    else {\n      ColorSelected?.Invoke(this, args);\n    }\n  }\n\n  private void Button_MouseUp(object sender, MouseButtonEventArgs e) {\n    var button = sender as Button;\n    var brush = button.Background as SolidColorBrush;\n    Utils.CloseParentMenu(this);\n    RaiseSelectedColorEvent(brush.Color);\n    e.Handled = true;\n  }\n\n  private void AnyButton_Click(object sender, RoutedEventArgs e) {\n    int index = new Random().Next(0, ButtonColors.Length - 1);\n    CommitColorAtIndex(index);\n  }\n\n  private void MoreButton_Click(object sender, RoutedEventArgs e) {\n    MoreColorPicker.Visibility = Visibility.Visible;\n    MoreColorPicker.SelectedColorChanged += MoreColorPicker_SelectedColorChanged;\n    MoreColorPicker.IsOpen = true;\n  }\n\n  private void MoreColorPicker_SelectedColorChanged(object sender,\n                                                    RoutedPropertyChangedEventArgs<Color?> e) {\n    if (e.NewValue.HasValue) {\n      MoreColorPicker.Visibility = Visibility.Collapsed;\n      CommitColor(e.NewValue.Value);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/DraggablePopup.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI.Controls;\n\npublic class DraggablePopup : Popup {\n  private bool duringMinimize_;\n  private bool isAlwaysOnTop_;\n\n  public DraggablePopup() {\n    MouseDown += (sender, e) => {\n      if (ShouldStartDragging(e)) {\n        Thumb.RaiseEvent(e);\n      }\n    };\n\n    Thumb.DragDelta += (sender, e) => {\n      HorizontalOffset += e.HorizontalChange;\n      VerticalOffset += e.VerticalChange;\n    };\n\n    // Bring popup over other popups on click anywhere inside it.\n    PreviewMouseDown += (sender, args) => BringToFront();\n  }\n\n  public RelayCommand<SelectedColorEventArgs> PopupColorSelectedCommand =>\n    new(async e => {\n      SetPanelAccentColor(e.SelectedColor);\n    });\n  public Thumb Thumb { get; private set; } = new() {Width = 0, Height = 0};\n\n  public bool IsAlwaysOnTop {\n    get => isAlwaysOnTop_;\n    set {\n      isAlwaysOnTop_ = value;\n      UpdateAlwaysOnTop(value);\n    }\n  }\n\n  public bool IsDetached { get; private set; }\n\n  protected virtual void SetPanelAccentColor(Color color) {\n  }\n\n  public event EventHandler PopupClosed;\n  public event EventHandler PopupDetached;\n\n  public virtual bool ShouldStartDragging(MouseButtonEventArgs e) {\n    return e.LeftButton == MouseButtonState.Pressed;\n  }\n\n  public virtual void DetachPopup() {\n    IsDetached = true;\n    StaysOpen = true;\n    PopupDetached?.Invoke(this, null);\n  }\n\n  public virtual void ShowPopup() {\n    IsOpen = true;\n  }\n\n  public virtual void PopupOpened() {\n  }\n\n  protected override void OnOpened(EventArgs e) {\n    base.OnOpened(e);\n    PopupOpened();\n  }\n\n  public virtual void ClosePopup() {\n    IsOpen = false;\n    PopupClosed?.Invoke(this, null);\n  }\n\n  public void UpdatePosition(Point position, UIElement referenceElement) {\n    // Due to various DPI settings, the Window coordinates needs\n    // some adjustment of the values based on the monitor.\n    var screenPosition = position;\n\n    if (referenceElement != null &&\n        PresentationSource.FromVisual(referenceElement) != null) {\n      screenPosition = referenceElement.PointToScreen(position);\n      screenPosition = Utils.CoordinatesToScreen(screenPosition, referenceElement);\n    }\n\n    HorizontalOffset = screenPosition.X;\n    VerticalOffset = screenPosition.Y;\n  }\n\n  public void UpdateSize(double width, double height) {\n    Width = width;\n    Height = height;\n  }\n\n  public void Initialize(Point position, double width, double height,\n                         UIElement referenceElement) {\n    UpdatePosition(position, referenceElement);\n    UpdateSize(width, height);\n  }\n\n  public void Initialize(Point position, UIElement referenceElement) {\n    UpdatePosition(position, referenceElement);\n  }\n\n  public void BringToFront() {\n    Utils.BringToFront(Child, Width, Height);\n  }\n\n  public void UpdateAlwaysOnTop(bool value) {\n    Utils.SetAlwaysOnTop(Child, value, Width, Height);\n  }\n\n  public void SendToBack() {\n    if (IsAlwaysOnTop) {\n      return;\n    }\n\n    Utils.SendToBack(Child, Width, Height);\n  }\n\n  public void Minimize() {\n    duringMinimize_ = true;\n    IsOpen = false;\n  }\n\n  public void Restore() {\n    IsOpen = true;\n  }\n\n  protected override void OnClosed(EventArgs e) {\n    base.OnClosed(e);\n\n    // When the application is minimized, the panel should be just hidden,\n    // not completely closed.\n    if (duringMinimize_) {\n      duringMinimize_ = false;\n      return;\n    }\n\n    PopupClosed?.Invoke(this, e);\n  }\n\n  protected override void OnPreviewKeyDown(KeyEventArgs e) {\n    base.OnPreviewKeyDown(e);\n\n    if (e.Key == Key.Escape) {\n      ClosePopup();\n      e.Handled = true;\n    }\n  }\n\n  protected override void OnInitialized(EventArgs e) {\n    base.OnInitialized(e);\n\n    RemoveLogicalChild(Child);\n    var surrogateChild = new Grid();\n    surrogateChild.Children.Add(Thumb);\n    surrogateChild.Children.Add(Child);\n    AddLogicalChild(surrogateChild);\n    Child = surrogateChild;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/FileSystemTextBox.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Windows.Controls;\n\nnamespace ProfileExplorer.UI.Controls;\n\npublic class FileSystemTextBox : AutoCompleteBox {\n  public string ExtensionFilter { get; set; }\n  public bool ShowOnlyDirectories { get; set; }\n\n  protected override void OnInitialized(EventArgs e) {\n    base.OnInitialized(e);\n    ExtensionFilter = \"*.*\";\n    Populating += FileSystemTextBox_Populating;\n  }\n\n  private void FileSystemTextBox_Populating(object sender, PopulatingEventArgs e) {\n    var box = sender as FileSystemTextBox;\n\n    try {\n      string text = box.Text;\n      string dirname = Path.GetDirectoryName(text);\n\n      if (dirname != null && Directory.Exists(dirname)) {\n        string[] files = Directory.GetFiles(dirname, ExtensionFilter, SearchOption.TopDirectoryOnly);\n        string[] dirs = Directory.GetDirectories(dirname, \"*\", SearchOption.TopDirectoryOnly);\n        var candidates = new List<string>(files.Length + dirs.Length);\n\n        foreach (string f in dirs) {\n          candidates.Add(f);\n        }\n\n        if (!ShowOnlyDirectories) {\n          foreach (string f in files) {\n            candidates.Add(f);\n          }\n        }\n\n        box.ItemsSource = candidates;\n        box.PopulateComplete();\n        return;\n      }\n    }\n    catch { }\n\n    box.ItemsSource = null;\n    box.PopulateComplete();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/CallGraphStyleProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Graph;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class CallGraphStyleProvider : IGraphStyleProvider {\n  private const double DefaultEdgeThickness = 0.025;\n  private const double BoldEdgeThickness = 0.05;\n  private Graph graph_;\n  private Brush defaultNodeBackground_;\n  private HighlightingStyle defaultNodeStyle_;\n  private HighlightingStyle leafNodeStyle_;\n  private HighlightingStyle entryNodeStyle_;\n  private HighlightingStyle externalNodeStyle_;\n  private Brush defaultTextColor_;\n  private Pen edgeStyle_;\n\n  public CallGraphStyleProvider(Graph graph) {\n    graph_ = graph;\n    defaultTextColor_ = ColorBrushes.GetBrush(Colors.Black);\n    defaultNodeBackground_ = ColorBrushes.GetBrush(Colors.Gainsboro);\n    defaultNodeStyle_ = new HighlightingStyle(defaultNodeBackground_,\n                                              ColorPens.GetPen(Colors.DimGray, DefaultEdgeThickness));\n    leafNodeStyle_ = new HighlightingStyle(ColorBrushes.GetBrush(Colors.LightBlue),\n                                           ColorPens.GetPen(Colors.DimGray, DefaultEdgeThickness));\n    entryNodeStyle_ = new HighlightingStyle(ColorBrushes.GetBrush(Colors.LightGreen),\n                                            ColorPens.GetPen(Colors.DimGray, BoldEdgeThickness));\n    externalNodeStyle_ = new HighlightingStyle(ColorBrushes.GetBrush(Colors.Moccasin),\n                                               ColorPens.GetPen(Colors.DimGray, DefaultEdgeThickness));\n    edgeStyle_ = ColorPens.GetPen(Colors.DarkBlue, DefaultEdgeThickness);\n  }\n\n  public Brush GetDefaultNodeBackground() {\n    return defaultNodeBackground_;\n  }\n\n  public HighlightingStyle GetDefaultNodeStyle() {\n    return defaultNodeStyle_;\n  }\n\n  public Brush GetDefaultTextColor() {\n    return defaultTextColor_;\n  }\n\n  public GraphEdgeKind GetEdgeKind(Edge edge) {\n    return GraphEdgeKind.Default;\n  }\n\n  public Pen GetEdgeStyle(GraphEdgeKind kind) {\n    return edgeStyle_;\n  }\n\n  public HighlightingStyle GetNodeStyle(Node node) {\n    var callNode = (CallGraphNode)node.Data;\n\n    if (callNode == null) {\n      return defaultNodeStyle_;\n    }\n\n    // Check for a tag that overrides the style.\n    var graphTag = callNode.GetTag<GraphNodeTag>();\n\n    if (graphTag != null) {\n      var background = graphTag.BackgroundColor ?? Colors.Gainsboro;\n      var borderColor = graphTag.BorderColor ?? Colors.DimGray;\n      double borderThickness = graphTag.BorderThickness != 0 ? graphTag.BorderThickness : DefaultEdgeThickness;\n      return new HighlightingStyle(background, ColorPens.GetPen(borderColor, borderThickness));\n    }\n\n    if (callNode.IsExternal) {\n      return externalNodeStyle_;\n    }\n\n    if (!callNode.HasCallers) {\n      return entryNodeStyle_;\n    }\n\n    if (!callNode.HasCallees) {\n      return leafNodeStyle_;\n    }\n\n    return defaultNodeStyle_;\n  }\n\n  public bool ShouldRenderEdges(GraphEdgeKind kind) {\n    return true;\n  }\n\n  public bool ShouldUsePolylines() {\n    return false;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/ColorPalette.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ColorPalette {\n  public static List<ColorPalette>[] BuiltinPaletteSets = new List<ColorPalette>[] {\n    BuiltinPalettes,\n    GradientBuiltinPalettes\n  };\n\n  public ColorPalette(string name = \"\", string description = \"\") {\n    Name = name;\n    Description = description;\n    Colors = new List<Color>();\n    Brushes = new List<Brush>();\n  }\n\n  public ColorPalette(IEnumerable<Color> colors, string name = \"\", string description = \"\") {\n    Name = name;\n    Description = description;\n    Colors = new List<Color>(colors);\n    Brushes = new List<Brush>();\n\n    foreach (var color in Colors) {\n      Brushes.Add(color.AsBrush());\n    }\n  }\n\n  public ColorPalette(IEnumerable<string> colors, string name = \"\", string description = \"\") {\n    Name = name;\n    Description = description;\n    Colors = new List<Color>();\n    Brushes = new List<Brush>();\n\n    foreach (string color in colors) {\n      Colors.Add(Utils.ColorFromString(color));\n    }\n\n    foreach (var color in Colors) {\n      Brushes.Add(color.AsBrush());\n    }\n  }\n\n  public static List<ColorPalette> BuiltinPalettes {\n    get {\n      var list = new List<ColorPalette> {\n        Profile,\n        ProfileManaged,\n        ProfileKernel,\n        LightPastels,\n        Pastels\n      };\n\n      for (int i = 0; i < ColorUtils.LightPastelColors.Length; i++) {\n        var color = Utils.ColorFromString(ColorUtils.LightPastelColors[i]);\n        list.Add(new ColorPalette(new List<Color> {\n                                    color\n                                  }, $\"LightPastelColor{i}\"));\n      }\n\n      return list;\n    }\n  }\n\n  public static List<ColorPalette> GradientBuiltinPalettes =>\n    new() {\n      LightPastels,\n      Pastels,\n      LightPastels2,\n      LightPastels3,\n      LightPastels4,\n      Pastels2,\n      Profile,\n      ProfileManaged,\n      ProfileKernel\n    };\n  public static ColorPalette Profile =>\n    new(new[] {\n      \"#FFF4F1E8\",\n      \"#FFFCF2D6\",\n      \"#FFFCEED6\",\n      \"#FFFCEAD6\",\n      \"#FFFCE6D6\",\n      \"#FFFCE2D6\",\n      \"#FFFCDED6\",\n      \"#FFFCDAD7\",\n      \"#FFFCD7D7\"\n    }, \"Profile\");\n  public static ColorPalette ProfileManaged =>\n    new(new[] {\n      \"#FFCCDAF2\",\n      \"#FFD4DAEE\",\n      \"#FFDCDAEC\",\n      \"#FFE3DBEA\",\n      \"#FFE9DBE8\",\n      \"#FFEEDCE8\",\n      \"#FFF4DEE7\",\n      \"#FFF7E0E7\"\n    }, \"ProfileManaged\");\n  public static ColorPalette ProfileKernel =>\n    new(new[] {\n      \"#FFCFF7FB\",\n      \"#FFD0F1FB\",\n      \"#FFD0ECFB\",\n      \"#FFD0E7FB\",\n      \"#FFD1E2FB\",\n      \"#FFD1DDFB\",\n      \"#FFD1D8FB\",\n      \"#FFD2D3FB\"\n    }, \"ProfileKernel\");\n  public static ColorPalette Pastels => new(ColorUtils.PastelColors, \"Pastels\");\n  public static ColorPalette Pastels2 =>\n    new(new[] {\n      \"#E2E2DF\", \"#D2D2CF\", \"#E2CFC4\", \"#F7D9C4\",\n      \"#FAEDCB\", \"#C9E4DE\", \"#C6DEF1\", \"#DBCDF0\",\n      \"#F2C6DE\", \"#F9C6C9\"\n    }, \"Pastels2\");\n  public static ColorPalette LightPastels => new(ColorUtils.LightPastelColors, \"LightPastels\");\n  public static ColorPalette LightPastels2 =>\n    new(new[] {\n      \"#E8DCE6\", \"#FFEDE0\", \"#FCDEE0\", \"#FAD2E1\",\n      \"#D3EAE3\", \"#BEE1E6\", \"#EDE9DC\", \"#DFE7FD\"\n    }, \"LightPastels2\");\n  public static ColorPalette LightPastels3 =>\n    new(new[] {\n      \"#FFF1E6\", \"#FDE2E4\", \"#FAD2E1\",\n      \"#C5DEDD\", \"#DBE7E4\", \"#F0EFEB\", \"#BCD4E6\", \"#99C1DE\"\n    }, \"LightPastels3\");\n  public static ColorPalette LightPastels4 =>\n    new(new[] {\n      \"#F0D7DF\", \"#F8EAEC\", \"#F7DDD9\",\n      \"#F7E6DA\", \"#E3E9DD\", \"#C4DBD9\", \"#D4E5E3\",\n      \"#C8C7D6\"\n    }, \"LightPastels4\");\n  public static ColorPalette DarkHue => MakeHue(0.9f, 0.2f, 10);\n  public static ColorPalette LightHue => MakeHue(0.9f, 0.5f, 10);\n  [ProtoMember(1)]\n  public string Name { get; set; }\n  [ProtoMember(2)]\n  public string Description { get; set; }\n  [ProtoMember(3)]\n  public List<Color> Colors { get; set; }\n  public List<Brush> Brushes { get; set; }\n  public int Count => Colors.Count;\n  public Color this[int index] => Colors[index];\n\n  public static ColorPalette GetPalette(string name) {\n    foreach (var set in BuiltinPaletteSets) {\n      foreach (var palette in set) {\n        if (palette.Name == name) {\n          return palette;\n        }\n      }\n    }\n\n    return Profile;\n  }\n\n  public static ColorPalette MakeHue(float saturation, float light, int lightSteps) {\n    var colors = new List<Color>();\n    float rangeStep = 3.0f / lightSteps;\n    float hue = 0;\n\n    for (int i = 0; i < lightSteps; i++) {\n      colors.Add(ColorUtils.HSLToRGB(hue, saturation, light));\n      hue += rangeStep;\n    }\n\n    return new ColorPalette(colors);\n  }\n\n  public static ColorPalette MakeScale(float hue, float saturation,\n                                       float minLight, float maxLight, int lightSteps) {\n    float rangeStep = (maxLight - minLight) / lightSteps;\n    var colors = new List<Color>();\n\n    for (float light = minLight; light <= maxLight; light += rangeStep) {\n      colors.Add(ColorUtils.HSLToRGB(hue, saturation, light));\n    }\n\n    return new ColorPalette(colors);\n  }\n\n  public Color PickScaleColor(long value, long maxValue) {\n    return PickColor((int)Math.Floor((double)value * Colors.Count / maxValue));\n  }\n\n  public Color PickColorForPercentage(double weightPercentage, bool reverse = false) {\n    int colorIndex = (int)Math.Floor(Colors.Count * weightPercentage);\n    return PickColor(colorIndex, reverse);\n  }\n\n  public Color PickColor(int colorIndex, bool reverse = false) {\n    if (reverse) {\n      colorIndex = Colors.Count - colorIndex - 1;\n    }\n\n    colorIndex = Math.Clamp(colorIndex, 0, Colors.Count - 1);\n    return Colors[colorIndex];\n  }\n\n  public Brush PickScaleBrush(long value, long maxValue) {\n    return PickBrush((int)Math.Floor((double)value * Colors.Count / maxValue));\n  }\n\n  public Brush PickBrushForPercentage(double weightPercentage, bool reverse = false) {\n    return PickColorForPercentage(weightPercentage, reverse).AsBrush();\n  }\n\n  public Brush PickBrush(int colorIndex, bool reverse = false) {\n    if (reverse) {\n      colorIndex = Colors.Count - colorIndex - 1;\n    }\n\n    colorIndex = Math.Clamp(colorIndex, 0, Colors.Count - 1);\n    return Brushes[colorIndex];\n  }\n\n  public Brush PickBrush(string name, bool reverse = false) {\n    int hash = name.GetStableHashCode();\n    int index = Math.Abs(hash % Count);\n    return PickBrush(index);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/ExpressionGraphStyleProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class ExpressionGraphStyleProvider : IGraphStyleProvider {\n  private const double DefaultEdgeThickness = 0.025;\n  private const double BoldEdgeThickness = 0.05;\n  private HighlightingStyle addressOperandNodeStyle_;\n  private HighlightingStyle binaryNodeStyle_;\n  private HighlightingStyle copyNodeStyle_;\n  private Brush defaultNodeBackground_;\n  private HighlightingStyle defaultNodeStyle_;\n  private Brush defaultTextColor_;\n  private Pen edgeStyle_;\n  private HighlightingStyle indirectOperandNodeStyle_;\n  private Pen loopEdgeStyle_;\n  private HighlightingStyle numberOperandNodeStyle_;\n  private HighlightingStyle operandNodeStyle_;\n  private ICompilerInfoProvider compilerInfo_;\n  private Graph graph_;\n  private ExpressionGraphSettings options_;\n  private HighlightingStyle phiNodeStyle_;\n  private HighlightingStyle loadNodeStyle_;\n  private HighlightingStyle callNodeStyle_;\n  private HighlightingStyle unaryNodeStyle_;\n\n  public ExpressionGraphStyleProvider(Graph graph, ExpressionGraphSettings options,\n                                      ICompilerInfoProvider compilerInfo) {\n    compilerInfo_ = compilerInfo;\n    graph_ = graph;\n    options_ = options;\n    defaultTextColor_ = ColorBrushes.GetBrush(options.TextColor);\n    defaultNodeBackground_ = ColorBrushes.GetBrush(options.NodeColor);\n\n    defaultNodeStyle_ = new HighlightingStyle(defaultNodeBackground_,\n                                              ColorPens.GetPen(options.NodeBorderColor,\n                                                               DefaultEdgeThickness));\n\n    copyNodeStyle_ = new HighlightingStyle(options.CopyInstructionNodeColor,\n                                           ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    phiNodeStyle_ = new HighlightingStyle(options.PhiInstructionNodeColor,\n                                          ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    unaryNodeStyle_ = new HighlightingStyle(options.UnaryInstructionNodeColor,\n                                            ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    binaryNodeStyle_ = new HighlightingStyle(options.BinaryInstructionNodeColor,\n                                             ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    callNodeStyle_ = new HighlightingStyle(options.CallInstructionNodeColor,\n                                           ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    loadNodeStyle_ = new HighlightingStyle(options.LoadStoreInstructionNodeColor,\n                                           ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    binaryNodeStyle_ = new HighlightingStyle(options.BinaryInstructionNodeColor,\n                                             ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    operandNodeStyle_ =\n      new HighlightingStyle(options.OperandNodeColor, ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    numberOperandNodeStyle_ =\n      new HighlightingStyle(options.NumberOperandNodeColor,\n                            ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    addressOperandNodeStyle_ =\n      new HighlightingStyle(options.AddressOperandNodeColor,\n                            ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    indirectOperandNodeStyle_ = new HighlightingStyle(options.IndirectionOperandNodeColor,\n                                                      ColorPens.GetPen(options.NodeBorderColor, 0.035));\n\n    edgeStyle_ = ColorPens.GetPen(options.EdgeColor, DefaultEdgeThickness);\n    loopEdgeStyle_ = ColorPens.GetPen(options.LoopPhiBackedgeColor, BoldEdgeThickness);\n  }\n\n  public HighlightingStyle GetDefaultNodeStyle() {\n    return defaultNodeStyle_;\n  }\n\n  public Brush GetDefaultNodeBackground() {\n    return defaultNodeBackground_;\n  }\n\n  public Brush GetDefaultTextColor() {\n    return defaultTextColor_;\n  }\n\n  public HighlightingStyle GetNodeStyle(Node node) {\n    var element = node.ElementData;\n\n    switch (element) {\n      case null:\n        return defaultNodeStyle_;\n      case OperandIR op: {\n        switch (op.Kind) {\n          case OperandKind.Variable:\n          case OperandKind.Temporary: {\n            return operandNodeStyle_;\n          }\n          case OperandKind.IntConstant:\n          case OperandKind.FloatConstant: {\n            return numberOperandNodeStyle_;\n          }\n          case OperandKind.Indirection: {\n            return indirectOperandNodeStyle_;\n          }\n          case OperandKind.Address:\n          case OperandKind.LabelAddress: {\n            return addressOperandNodeStyle_;\n          }\n        }\n\n        break;\n      }\n      case InstructionIR instr: {\n        if (compilerInfo_.IR.IsCopyInstruction(instr)) {\n          return copyNodeStyle_;\n        }\n\n        if (compilerInfo_.IR.IsPhiInstruction(instr)) {\n          return phiNodeStyle_;\n        }\n\n        if (compilerInfo_.IR.IsLoadInstruction(instr) ||\n            compilerInfo_.IR.IsStoreInstruction(instr)) {\n          return loadNodeStyle_;\n        }\n\n        if (compilerInfo_.IR.IsCallInstruction(instr) ||\n            compilerInfo_.IR.IsIntrinsicCallInstruction(instr)) {\n          return callNodeStyle_;\n        }\n\n        if (instr.IsUnary) {\n          return unaryNodeStyle_;\n        }\n\n        if (instr.IsBinary) {\n          return binaryNodeStyle_;\n        }\n\n        break;\n      }\n    }\n\n    return defaultNodeStyle_;\n  }\n\n  public GraphEdgeKind GetEdgeKind(Edge edge) {\n    if (!options_.ColorizeEdges) {\n      return GraphEdgeKind.Default;\n    }\n\n    // Mark edges of PHIs with values incoming from loops.\n    // var sourceInstr = edge.NodeTo.ElementData.ParentInstruction;\n\n    // if (sourceInstr != null && sourceInstr.OpcodeIs(PHI)) {\n    //   var sourceBlock = sourceInstr.ParentBlock;\n    //   var destBlock = edge.NodeFrom.ElementData.ParentBlock;\n    //\n    //   if (destBlock != null) {\n    //     if (destBlock.Number >= sourceBlock.Number) {\n    //       return GraphEdgeKind.Loop;\n    //     }\n    //   }\n    // }\n\n    return GraphEdgeKind.Default;\n  }\n\n  public Pen GetEdgeStyle(GraphEdgeKind kind) {\n    if (kind == GraphEdgeKind.Loop) {\n      return loopEdgeStyle_;\n    }\n\n    return edgeStyle_;\n  }\n\n  public bool ShouldRenderEdges(GraphEdgeKind kind) {\n    return true;\n  }\n\n  public bool ShouldUsePolylines() {\n    return false;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/FlowGraphStyleProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class FlowGraphStyleProvider : IGraphStyleProvider {\n  private const int PolylineEdgeThreshold = 100;\n  private const double DefaultEdgeThickness = 0.025;\n  private const double BoldEdgeThickness = 0.05;\n  private const double DashedEdgeThickness = 0.035;\n  private HighlightingStyle branchBlockStyle_;\n  private Pen branchEdgeStyle_;\n  private Brush defaultNodeBackground_;\n  private HighlightingStyle defaultNodeStyle_;\n  private Brush defaultTextColor_;\n  private Pen edgeStyle_;\n  private HighlightingStyle emptyBlockStyle_;\n  private Pen immDomEdgeStyle_;\n  private HighlightingStyle loopBackedgeBlockStyle_;\n  private List<HighlightingStyle> loopBlockStyles_;\n  private Pen loopEdgeStyle_;\n  private Graph graph_;\n  private FlowGraphSettings options_;\n  private HighlightingStyle returnBlockStyle_;\n  private Pen returnEdgeStyle_;\n  private HighlightingStyle switchBlockStyle_;\n\n  public FlowGraphStyleProvider(Graph graph, FlowGraphSettings options) {\n    graph_ = graph;\n    options_ = options;\n    defaultTextColor_ = ColorBrushes.GetBrush(options.TextColor);\n    defaultNodeBackground_ = ColorBrushes.GetBrush(options.NodeColor);\n\n    defaultNodeStyle_ = new HighlightingStyle(defaultNodeBackground_,\n                                              ColorPens.GetPen(options.NodeBorderColor,\n                                                               DefaultEdgeThickness));\n\n    branchBlockStyle_ =\n      new HighlightingStyle(defaultNodeBackground_,\n                            ColorPens.GetPen(options.BranchNodeBorderColor, 0.035));\n\n    switchBlockStyle_ =\n      new HighlightingStyle(defaultNodeBackground_,\n                            ColorPens.GetPen(options.SwitchNodeBorderColor, 0.035));\n\n    loopBackedgeBlockStyle_ = new HighlightingStyle(defaultNodeBackground_,\n                                                    ColorPens.GetPen(\n                                                      options.LoopNodeBorderColor,\n                                                      BoldEdgeThickness));\n\n    returnBlockStyle_ = new HighlightingStyle(defaultNodeBackground_,\n                                              ColorPens.GetPen(options.ReturnNodeBorderColor,\n                                                               BoldEdgeThickness));\n\n    emptyBlockStyle_ = new HighlightingStyle(Colors.Gainsboro,\n                                             ColorPens.GetPen(options.NodeBorderColor,\n                                                              DefaultEdgeThickness));\n\n    edgeStyle_ = ColorPens.GetPen(options.EdgeColor, DefaultEdgeThickness);\n    branchEdgeStyle_ = ColorPens.GetPen(options.BranchNodeBorderColor, BoldEdgeThickness);\n    loopEdgeStyle_ = ColorPens.GetPen(options.LoopNodeBorderColor, BoldEdgeThickness);\n\n    immDomEdgeStyle_ =\n      ColorPens.GetDashedPen(options.DominatorEdgeColor, DashStyles.Dot, DashedEdgeThickness);\n\n    returnEdgeStyle_ = ColorPens.GetPen(options.ReturnNodeBorderColor, DefaultEdgeThickness);\n\n    if (options.MarkLoopBlocks) {\n      loopBlockStyles_ = new List<HighlightingStyle>();\n\n      foreach (var color in options.LoopNodeColors) {\n        loopBlockStyles_.Add(\n          new HighlightingStyle(\n            color, ColorPens.GetPen(options.NodeBorderColor, DefaultEdgeThickness)));\n      }\n    }\n  }\n\n  public HighlightingStyle GetDefaultNodeStyle() {\n    return defaultNodeStyle_;\n  }\n\n  public Brush GetDefaultNodeBackground() {\n    return defaultNodeBackground_;\n  }\n\n  public Brush GetDefaultTextColor() {\n    return defaultTextColor_;\n  }\n\n  public HighlightingStyle GetNodeStyle(Node node) {\n    var element = node.ElementData;\n\n    return element switch {\n      null          => defaultNodeStyle_,\n      BlockIR block => GetBlockNodeStyle(block),\n      _             => defaultNodeStyle_\n    };\n  }\n\n  public GraphEdgeKind GetEdgeKind(Edge edge) {\n    if (!options_.ColorizeEdges) {\n      return GraphEdgeKind.Default;\n    }\n\n    if (edge.Style == Edge.EdgeKind.Dotted) {\n      return GraphEdgeKind.ImmediateDominator;\n    }\n    else if (edge.Style == Edge.EdgeKind.Dashed) {\n      return GraphEdgeKind.Loop;\n    }\n\n    if (graph_.Kind == GraphKind.FlowGraph) {\n      var fromBlock = edge.NodeFrom?.ElementData as BlockIR;\n      var toBlock = edge.NodeTo?.ElementData as BlockIR;\n\n      if (fromBlock != null && toBlock != null) {\n        if (toBlock.Number <= fromBlock.Number) {\n          return GraphEdgeKind.Loop;\n        }\n\n        if (toBlock.IsReturnBlock) {\n          return GraphEdgeKind.Return;\n        }\n\n        if (fromBlock.Successors.Count == 2) {\n          var targetBlock = fromBlock.BranchTargetBlock;\n\n          if (targetBlock == toBlock) {\n            return GraphEdgeKind.Branch;\n          }\n        }\n      }\n    }\n\n    return GraphEdgeKind.Default;\n  }\n\n  public Pen GetEdgeStyle(GraphEdgeKind kind) {\n    switch (kind) {\n      case GraphEdgeKind.Loop: {\n        return loopEdgeStyle_;\n      }\n      case GraphEdgeKind.Branch: {\n        return branchEdgeStyle_;\n      }\n      case GraphEdgeKind.Return: {\n        return returnEdgeStyle_;\n      }\n      case GraphEdgeKind.ImmediateDominator:\n      case GraphEdgeKind.ImmediatePostDominator: {\n        return immDomEdgeStyle_;\n      }\n    }\n\n    return edgeStyle_;\n  }\n\n  public bool ShouldRenderEdges(GraphEdgeKind kind) {\n    if (kind == GraphEdgeKind.ImmediateDominator || kind == GraphEdgeKind.ImmediatePostDominator) {\n      return options_.ShowImmDominatorEdges;\n    }\n\n    return true;\n  }\n\n  public bool ShouldUsePolylines() {\n    return graph_.Nodes.Find(node => node.InEdges != null &&\n                                     node.InEdges.Count > PolylineEdgeThreshold) != null;\n  }\n\n  public HighlightingStyle GetBlockNodeStyle(BlockIR block) {\n    var loopTag = block.GetTag<LoopBlockTag>();\n\n    if (loopTag != null && options_.MarkLoopBlocks) {\n      if (loopTag.NestingLevel < loopBlockStyles_.Count - 1) {\n        return loopBlockStyles_[loopTag.NestingLevel];\n      }\n\n      return loopBlockStyles_[^1];\n    }\n\n    if (options_.ColorizeNodes) {\n      if (block.HasLoopBackedge) {\n        return loopBackedgeBlockStyle_;\n      }\n\n      if (block.IsBranchBlock) {\n        return branchBlockStyle_;\n      }\n\n      if (block.IsSwitchBlock) {\n        return switchBlockStyle_;\n      }\n\n      if (block.IsReturnBlock) {\n        return returnBlockStyle_;\n      }\n\n      if (block.IsEmpty) {\n        return emptyBlockStyle_;\n      }\n    }\n\n    return defaultNodeStyle_;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/GraphNodeTag.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class GraphNodeTag : ITag {\n  public enum LabelPlacementKind {\n    Top,\n    Bottom,\n    Left,\n    Right\n  }\n\n  public static readonly Color[] HeatmapColors = {\n    Utils.ColorFromString(\"#63BE7B\"),\n    Utils.ColorFromString(\"#85C77D\"),\n    Utils.ColorFromString(\"#A8D280\"),\n    Utils.ColorFromString(\"#CCDD81\"),\n    Utils.ColorFromString(\"#EEE683\"),\n    Utils.ColorFromString(\"#FFDD83\"),\n    Utils.ColorFromString(\"#FCBF7C\"),\n    Utils.ColorFromString(\"#FCA377\"),\n    Utils.ColorFromString(\"#F58874\"),\n    Utils.ColorFromString(\"#F8696B\")\n  };\n  public static readonly Color[] HeatmapColors2 = {\n    Utils.ColorFromString(\"#598AC5\"),\n    Utils.ColorFromString(\"#7EA2D2\"),\n    Utils.ColorFromString(\"#A2BCDF\"),\n    Utils.ColorFromString(\"#C6D6ED\"),\n    Utils.ColorFromString(\"#EBEFF8\"),\n    Utils.ColorFromString(\"#FBECEF\"),\n    Utils.ColorFromString(\"#F9CDCC\"),\n    Utils.ColorFromString(\"#FAABAE\"),\n    Utils.ColorFromString(\"#F88A8B\"),\n    Utils.ColorFromString(\"#F8696B\")\n  };\n  public Color? BackgroundColor { get; set; }\n  public Color? BorderColor { get; set; }\n  public double BorderThickness { get; set; }\n  public string Label { get; set; }\n  public string ToolTip { get; set; }\n  public bool UseBoldText { get; set; }\n  public LabelPlacementKind LabelPlacement { get; set; }\n  public Color? LabelTextColor { get; set; }\n  public Color? TextColor { get; set; }\n  public string Name => \"Graph Node Tag\";\n  public TaggedObject Owner { get; set; }\n\n  public static GraphNodeTag MakeLabel(string label, string tooltip = null,\n                                       Color? textColor = null,\n                                       Color? labelColor = null,\n                                       LabelPlacementKind position = LabelPlacementKind.Bottom) {\n    return new GraphNodeTag {\n      Label = label,\n      ToolTip = tooltip,\n      LabelTextColor = labelColor,\n      TextColor = textColor,\n      LabelPlacement = position\n    };\n  }\n\n  public static GraphNodeTag MakeColor(string label, Color backColor,\n                                       Color? textColor = null,\n                                       Color? labelColor = null,\n                                       bool useBoldText = false,\n                                       LabelPlacementKind position = LabelPlacementKind.Bottom) {\n    return new GraphNodeTag {\n      Label = label,\n      BackgroundColor = backColor,\n      LabelTextColor = labelColor,\n      TextColor = textColor,\n      LabelPlacement = position,\n      UseBoldText = useBoldText\n    };\n  }\n\n  public static GraphNodeTag MakeHeatMap(long value, long maxValue) {\n    return new GraphNodeTag {\n      BackgroundColor = GetHeatmapColor(value, maxValue)\n    };\n  }\n\n  public static GraphNodeTag MakeHeatMap2(long value, long maxValue) {\n    return new GraphNodeTag {\n      BackgroundColor = GetHeatmapColor2(value, maxValue)\n    };\n  }\n\n  public static Color GetHeatmapColor(long value, long maxValue) {\n    return GetScaleColor(value, maxValue, HeatmapColors);\n  }\n\n  public static Color GetHeatmapColor2(long value, long maxValue) {\n    return GetScaleColor(value, maxValue, HeatmapColors2);\n  }\n\n  public static Color GetScaleColor(long value, long maxValue, Color[] palette) {\n    int index = (int)Math.Round((double)value * (palette.Length - 1) / maxValue);\n    return palette[index];\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/GraphRenderer.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI;\n\npublic enum GraphEdgeKind {\n  Default,\n  Loop,\n  Branch,\n  Return,\n  ImmediateDominator,\n  ImmediatePostDominator\n}\n\npublic interface IGraphStyleProvider {\n  Brush GetDefaultTextColor();\n  Brush GetDefaultNodeBackground();\n  HighlightingStyle GetDefaultNodeStyle();\n  HighlightingStyle GetNodeStyle(Node node);\n  Pen GetEdgeStyle(GraphEdgeKind kind);\n  GraphEdgeKind GetEdgeKind(Edge edge);\n  bool ShouldRenderEdges(GraphEdgeKind kind);\n  bool ShouldUsePolylines();\n}\n\npublic class GraphNode {\n  private const double DefaultTextSize = 0.225;\n  private const double DefaultLabelTextSize = 0.205;\n  public Node NodeInfo { get; set; }\n  public GraphSettings Settings { get; set; }\n  public DrawingVisual Visual { get; set; }\n  public HighlightingStyle Style { get; set; }\n  public Typeface TextFont { get; set; }\n  public Typeface MarkedTextFont { get; set; }\n  public Typeface BoldMarkedTextFont { get; set; }\n  public Typeface MarkedLabelTextFont { get; set; }\n  public Typeface BoldMarkedLabelTextFont { get; set; }\n  public Brush TextColor { get; set; }\n  public bool IsSelected { get; set; }\n  public bool IsHovered { get; set; }\n  public bool IsMarked { get; set; }\n\n  public void Draw() {\n    using var dc = Visual.RenderOpen();\n    var graphTag = NodeInfo.Data?.GetTag<GraphNodeTag>();\n\n    // GraphNodeTag may override the colors.\n    var backColor = Style.BackColor;\n    var textColor = TextColor;\n    var labelColor = TextColor;\n    var textFont = TextFont;\n\n    if (graphTag != null) {\n      if (graphTag.BackgroundColor.HasValue &&\n          !IsSelected && !IsHovered && !IsMarked) {\n        backColor = graphTag.BackgroundColor.Value.AsBrush();\n      }\n\n      if (graphTag.TextColor.HasValue) {\n        textColor = graphTag.TextColor.Value.AsBrush();\n        textFont = graphTag.UseBoldText ? BoldMarkedTextFont : MarkedTextFont;\n      }\n\n      if (graphTag.LabelTextColor.HasValue) {\n        labelColor = graphTag.LabelTextColor.Value.AsBrush();\n      }\n    }\n\n    var region = new Rect(NodeInfo.CenterX - NodeInfo.Width / 2,\n                          NodeInfo.CenterY - NodeInfo.Height / 2, NodeInfo.Width, NodeInfo.Height);\n\n    // Force pixel-snapping to get sharper edges.\n    double halfPenWidth = Style.Border.Thickness / 2;\n    var guidelines = new GuidelineSet();\n    guidelines.GuidelinesX.Add(region.Left + halfPenWidth);\n    guidelines.GuidelinesX.Add(region.Right + halfPenWidth);\n    guidelines.GuidelinesY.Add(region.Top + halfPenWidth);\n    guidelines.GuidelinesY.Add(region.Bottom + halfPenWidth);\n    dc.PushGuidelineSet(guidelines);\n\n    // Draw node and text.\n    dc.DrawRectangle(backColor, Style.Border, region);\n\n    var text = new FormattedText(NodeInfo.Label, CultureInfo.InvariantCulture,\n                                 FlowDirection.LeftToRight, textFont, DefaultTextSize, textColor,\n                                 VisualTreeHelper.GetDpi(Visual).PixelsPerDip);\n\n    dc.DrawText(text, new Point(NodeInfo.CenterX - text.Width / 2,\n                                NodeInfo.CenterY - text.Height / 2));\n\n    // Display the label under the node if there is a tag.\n    if (graphTag != null && !string.IsNullOrEmpty(graphTag.Label)) {\n      var labelText = new FormattedText(graphTag.Label, CultureInfo.InvariantCulture,\n                                        FlowDirection.LeftToRight,\n                                        graphTag.UseBoldText ? BoldMarkedLabelTextFont : MarkedLabelTextFont,\n                                        DefaultLabelTextSize, labelColor,\n                                        VisualTreeHelper.GetDpi(Visual).PixelsPerDip);\n      var textBackground = ColorBrushes.GetBrush(Settings.BackgroundColor);\n      dc.DrawRectangle(textBackground, null, new Rect(NodeInfo.CenterX - labelText.Width / 2,\n                                                      region.Bottom + labelText.Height / 4,\n                                                      labelText.Width, labelText.Height));\n\n      //? TODO: Use LabelPlacement\n      dc.DrawText(labelText, new Point(NodeInfo.CenterX - labelText.Width / 2,\n                                       region.Bottom + labelText.Height / 4));\n    }\n  }\n}\n\npublic class GraphRenderer {\n  private const double DefaultEdgeThickness = 0.025;\n  private const double GroupBoundingBoxMargin = 0.20;\n  private const double GroupBoundingBoxTextMargin = 0.10;\n  private const string FontName = \"Verdana\";\n  private Typeface nodeFont_;\n  private Typeface markedNodeFont_;\n  private Typeface boldMarkedNodeFont_;\n  private Typeface labelFont_;\n  private Typeface boldLabelFont_;\n  private Typeface edgeFont_;\n  private Graph graph_;\n  private IGraphStyleProvider graphStyle_;\n  private GraphSettings settings_;\n  private DrawingVisual visual_;\n\n  public GraphRenderer(Graph graph, GraphSettings settings,\n                       ICompilerInfoProvider compilerInfo) {\n    settings_ = settings;\n    graph_ = graph;\n\n    //? TODO: Instead of adding extra fields to Node,\n    //? pass the renderer and use these definitions instead.\n    edgeFont_ = new Typeface(new FontFamily(FontName), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);\n    nodeFont_ = new Typeface(new FontFamily(FontName), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);\n    markedNodeFont_ =\n      new Typeface(new FontFamily(FontName), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);\n    boldMarkedNodeFont_ = new Typeface(new FontFamily(FontName), FontStyles.Normal, FontWeights.DemiBold,\n                                       FontStretches.Normal);\n    labelFont_ = new Typeface(new FontFamily(FontName), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);\n    boldLabelFont_ = new Typeface(new FontFamily(FontName), FontStyles.Normal, FontWeights.DemiBold,\n                                  FontStretches.Normal);\n\n    graphStyle_ = graph.Kind switch {\n      GraphKind.FlowGraph =>\n        new FlowGraphStyleProvider(graph, (FlowGraphSettings)settings),\n      GraphKind.DominatorTree =>\n        new FlowGraphStyleProvider(graph, (FlowGraphSettings)settings),\n      GraphKind.PostDominatorTree =>\n        new FlowGraphStyleProvider(graph, (FlowGraphSettings)settings),\n      GraphKind.ExpressionGraph =>\n        new ExpressionGraphStyleProvider(graph_, (ExpressionGraphSettings)settings, compilerInfo),\n      GraphKind.CallGraph =>\n        new CallGraphStyleProvider(graph),\n      _ => throw new InvalidOperationException(\"Unknown graph kind!\")\n    };\n  }\n\n  public DrawingVisual Render() {\n    visual_ = new DrawingVisual();\n\n    if (graph_.DataNodeGroupsMap != null) {\n      DrawNodeBoundingBoxes();\n    }\n\n    DrawNodes();\n    DrawEdges();\n\n    // Can be null if the CFG is not available.\n    visual_.Drawing?.Freeze();\n    return visual_;\n  }\n\n  public HighlightingStyle GetDefaultNodeStyle() {\n    return graphStyle_.GetDefaultNodeStyle();\n  }\n\n  public HighlightingStyle GetDefaultNodeStyle(GraphNode node) {\n    return graphStyle_.GetNodeStyle(node.NodeInfo);\n  }\n\n  public HighlightingStyle GetDefaultNodeStyle(Node node) {\n    return graphStyle_.GetNodeStyle(node);\n  }\n\n  private void DrawNodeBoundingBoxes() {\n    var pen = ColorPens.GetPen(Colors.Gray, DefaultEdgeThickness);\n\n    foreach (var group in graph_.DataNodeGroupsMap) {\n      var boundingBox = ComputeBoundingBox(group.Value);\n      boundingBox.Inflate(GroupBoundingBoxMargin, GroupBoundingBoxMargin);\n      var groupVisual = new DrawingVisual();\n\n      using (var dc = groupVisual.RenderOpen()) {\n        dc.DrawRectangle(Brushes.Transparent, pen, boundingBox);\n        double textSize = 0.25;\n\n        var text = new FormattedText($\"B{((BlockIR)group.Key).Number}\",\n                                     CultureInfo.InvariantCulture, FlowDirection.LeftToRight,\n                                     nodeFont_, textSize, Brushes.DimGray,\n                                     VisualTreeHelper.GetDpi(groupVisual).PixelsPerDip);\n        //? TODO: Text placement can overlap with other elements,\n        //? try each corner of the bounding box to find one that's free\n        //? (it's a greedy approach, but would work in most cases).\n        dc.DrawText(text, new Point(boundingBox.Right + GroupBoundingBoxTextMargin,\n                                    boundingBox.Top + GroupBoundingBoxTextMargin));\n      }\n\n      visual_.Children.Add(groupVisual);\n    }\n  }\n\n  private Rect ComputeBoundingBox(List<TaggedObject> nodeElements) {\n    double xMin = double.MaxValue;\n    double yMin = double.MaxValue;\n    double xMax = double.MinValue;\n    double yMax = double.MinValue;\n\n    foreach (var element in nodeElements) {\n      if (!graph_.DataNodeMap.ContainsKey(element)) {\n        Trace.TraceError($\"ComputeBoundingBox element not in node map: {element}\");\n        continue;\n      }\n\n      var node = graph_.DataNodeMap[element];\n      xMin = Math.Min(xMin, node.CenterX - node.Width / 2);\n      yMin = Math.Min(yMin, node.CenterY - node.Height / 2);\n      xMax = Math.Max(xMax, node.CenterX + node.Width / 2);\n      yMax = Math.Max(yMax, node.CenterY + node.Height / 2);\n    }\n\n    return new Rect(xMin, yMin, xMax - xMin, yMax - yMin);\n  }\n\n  private void DrawNodes() {\n    var textColor = graphStyle_.GetDefaultTextColor();\n\n    foreach (var node in graph_.Nodes) {\n      if (node == null) {\n        Trace.TraceError(\"DrawNodes element null node\");\n        continue; //? TODO: Investigate\n      }\n\n      var nodeVisual = new DrawingVisual();\n\n      var graphNode = new GraphNode {\n        NodeInfo = node,\n        Settings = settings_,\n        Visual = nodeVisual,\n        TextFont = nodeFont_,\n        MarkedTextFont = markedNodeFont_,\n        BoldMarkedTextFont = boldMarkedNodeFont_,\n        MarkedLabelTextFont = labelFont_,\n        BoldMarkedLabelTextFont = boldLabelFont_,\n        TextColor = textColor,\n        Style = GetDefaultNodeStyle(node)\n      };\n\n      graphNode.Draw();\n      node.Tag = graphNode;\n      nodeVisual.SetValue(FrameworkElement.TagProperty, graphNode);\n      visual_.Children.Add(nodeVisual);\n    }\n  }\n\n  private Point ToPoint(Tuple<double, double> value) {\n    return new Point(value.Item1, value.Item2);\n  }\n\n  private void DrawEdges() {\n    var pen = graphStyle_.GetEdgeStyle(GraphEdgeKind.Default);\n    var loopPen = graphStyle_.GetEdgeStyle(GraphEdgeKind.Loop);\n    var branchPen = graphStyle_.GetEdgeStyle(GraphEdgeKind.Branch);\n    var returnPen = graphStyle_.GetEdgeStyle(GraphEdgeKind.Return);\n    var immDomPen = graphStyle_.GetEdgeStyle(GraphEdgeKind.ImmediateDominator);\n    var dc = visual_.RenderOpen();\n    var defaultEdgeGeometry = new StreamGeometry();\n    var loopEdgeGeometry = new StreamGeometry();\n    var branchEdgeGeometry = new StreamGeometry();\n    var returnEdgeGeometry = new StreamGeometry();\n    var immDomEdgeGeometry = new StreamGeometry();\n    var defaultSC = defaultEdgeGeometry.Open();\n    var loopSC = loopEdgeGeometry.Open();\n    var branchSC = branchEdgeGeometry.Open();\n    var returnSC = returnEdgeGeometry.Open();\n    var immDomSC = immDomEdgeGeometry.Open();\n\n    // If there are many in-edges, to avoid terrible performance due to WPF edge drawing\n    // use polylines instead. Performance is still not good, but the graph becomes usable.\n    bool usePolyLine = graphStyle_.ShouldUsePolylines();\n\n    foreach (var edge in graph_.Edges) {\n      var points = edge.LinePoints;\n      var edgeType = graphStyle_.GetEdgeKind(edge);\n\n      var sc = edgeType switch {\n        GraphEdgeKind.Default                => defaultSC,\n        GraphEdgeKind.Branch                 => branchSC,\n        GraphEdgeKind.Loop                   => loopSC,\n        GraphEdgeKind.Return                 => returnSC,\n        GraphEdgeKind.ImmediateDominator     => immDomSC,\n        GraphEdgeKind.ImmediatePostDominator => immDomSC,\n        _                                    => defaultSC\n      };\n\n      //? TODO: Avoid making copies at all\n      sc.BeginFigure(ToPoint(points[0]), false, false);\n      var tempPoints = new Point[points.Length - 1];\n\n      for (int i = 1; i < points.Length; i++) {\n        tempPoints[i - 1] = ToPoint(points[i]);\n      }\n\n      if (usePolyLine) {\n        sc.PolyLineTo(tempPoints, true, false);\n      }\n      else {\n        sc.PolyBezierTo(tempPoints, true, false);\n      }\n\n      // Draw arrow head with a slope matching the line,\n      // but only if the target node is visible.\n      DrawEdgeArrow(edge, tempPoints, sc);\n    }\n\n    defaultSC.Close();\n    loopSC.Close();\n    branchSC.Close();\n    returnSC.Close();\n    immDomSC.Close();\n    defaultEdgeGeometry.Freeze();\n    loopEdgeGeometry.Freeze();\n    branchEdgeGeometry.Freeze();\n    returnEdgeGeometry.Freeze();\n    immDomEdgeGeometry.Freeze();\n    dc.DrawGeometry(pen.Brush, pen, defaultEdgeGeometry);\n    dc.DrawGeometry(loopPen.Brush, loopPen, loopEdgeGeometry);\n    dc.DrawGeometry(branchPen.Brush, branchPen, branchEdgeGeometry);\n    dc.DrawGeometry(returnPen.Brush, returnPen, returnEdgeGeometry);\n\n    if (graphStyle_.ShouldRenderEdges(GraphEdgeKind.ImmediateDominator)) {\n      dc.DrawGeometry(immDomPen.Brush, immDomPen, immDomEdgeGeometry);\n    }\n\n    dc.Close();\n  }\n\n  private void DrawEdgeArrow(Edge edge, Point[] tempPoints, StreamGeometryContext sc) {\n    // Draw arrow head with a slope matching the line,\n    // this uses the last two points to find the angle.\n    Point start;\n    var v = FindArrowOrientation(tempPoints, out start);\n\n    sc.BeginFigure(start + v * 0.1, true, true);\n    double t = v.X;\n    v.X = v.Y;\n    v.Y = -t; // Rotate 90\n    sc.LineTo(start + v * 0.075, true, true);\n    sc.LineTo(start + v * -0.075, true, true);\n  }\n\n  private Vector FindArrowOrientation(Point[] tempPoints, out Point start) {\n    for (int i = tempPoints.Length - 1; i > 0; i--) {\n      start = tempPoints[i];\n      var v = start - tempPoints[i - 1];\n\n      if (v.LengthSquared != 0) {\n        v.Normalize();\n        return v;\n      }\n    }\n\n    return new Vector(0, 0);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/GraphViewer.xaml",
    "content": "﻿<FrameworkElement\n  x:Class=\"ProfileExplorer.UI.GraphViewer\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\" />"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/Graph/GraphViewer.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class GraphViewer : FrameworkElement {\n  private static readonly double DefaultBoldThickness = 0.05;\n  public static readonly Pen DefaultPen = ColorPens.GetPen(Colors.Black, 0.025);\n  public static readonly Pen DefaultBoldPen = ColorPens.GetPen(Colors.Black, DefaultBoldThickness);\n  public static readonly Pen DefaultSelectedPen = ColorPens.GetPen(Colors.Black, 0.05);\n  private readonly double GraphMargin = 0.15;\n  private readonly double ScaleFactor = 50;\n  private IRElement element_;\n  private Graph graph_;\n  private GraphRenderer graphRenderer_;\n  private DrawingVisual graphVisual_;\n  private GraphNode hoveredNode_;\n  private Dictionary<GraphNode, HighlightingStyle> hoverNodes_;\n  private Dictionary<GraphNode, HighlightingStyle> markedNodes_;\n  private Dictionary<GraphNode, HighlightingStyle> selectedNodes_;\n  private HighlightingStyleCyclingCollection nodeStyles_;\n  private Pen predecessorNodeBorder_;\n  private Pen successorNodeBorder_;\n  private HighlightingStyle selectedNodeStyle_;\n  private GraphSettings settings_;\n  private double zoomLevel_ = 0.5;\n  private ICompilerInfoProvider compilerInfo_;\n  private HashSet<BlockIR> markedBlocks_;\n\n  public GraphViewer() {\n    InitializeComponent();\n    VerticalAlignment = VerticalAlignment.Top;\n    HorizontalAlignment = HorizontalAlignment.Center;\n    MaxZoomLevel = double.PositiveInfinity;\n    markedNodes_ = new Dictionary<GraphNode, HighlightingStyle>();\n    hoverNodes_ = new Dictionary<GraphNode, HighlightingStyle>();\n    selectedNodes_ = new Dictionary<GraphNode, HighlightingStyle>();\n    markedBlocks_ = new HashSet<BlockIR>();\n\n    var stylesWithBorder =\n      DefaultHighlightingStyles.GetStyleSetWithBorder(DefaultHighlightingStyles.StyleSet, DefaultBoldPen);\n\n    nodeStyles_ = new HighlightingStyleCyclingCollection(stylesWithBorder);\n    SetupEvents();\n  }\n\n  public Graph Graph => graph_;\n  public bool IsGraphLoaded => graphVisual_ != null;\n  public IRElement SelectedElement => element_;\n\n  public double ZoomLevel {\n    get => zoomLevel_;\n    set {\n      zoomLevel_ = Math.Min(value, MaxZoomLevel);\n      InvalidateMeasure();\n    }\n  }\n\n  public double MaxZoomLevel { get; set; }\n  public GraphPanel HostPanel { get; set; }\n\n  public GraphSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      ReloadSettings();\n    }\n  }\n\n  protected override int VisualChildrenCount => 1;\n  public event EventHandler<TaggedObject> NodeSelected;\n  public event EventHandler<IRElementEventArgs> BlockSelected;\n  public event EventHandler<IRElementMarkedEventArgs> BlockMarked;\n  public event EventHandler<IRElementMarkedEventArgs> BlockUnmarked;\n  public event EventHandler GraphLoaded;\n\n  public GraphNode GetSelectedNode() {\n    if (selectedNodes_.Count > 0) {\n      var selectedEnum = selectedNodes_.GetEnumerator();\n      selectedEnum.MoveNext();\n      return selectedEnum.Current.Key;\n    }\n\n    return null;\n  }\n\n  public void MarkSelectedNode(HighlightingStyle style) {\n    MarkNode(GetSelectedNode(), GetNodeStyle(style));\n  }\n\n  public void MarkSelectedNodePredecessors(HighlightingStyle style) {\n    MarkNodePredecessors(GetSelectedNode(), GetNodeStyle(style));\n  }\n\n  public void MarkSelectedNodeSuccessors(HighlightingStyle style) {\n    MarkNodeSuccessors(GetSelectedNode(), GetNodeStyle(style));\n  }\n\n  public Task MarkSelectedNodeDominatorsAsync(HighlightingStyle style) {\n    return MarkNodeDominatorsAsync(GetSelectedNode(), GetNodeStyle(style), cache => cache.GetDominatorsAsync());\n  }\n\n  public Task MarkSelectedNodePostDominatorsAsync(HighlightingStyle style) {\n    return MarkNodeDominatorsAsync(GetSelectedNode(), GetNodeStyle(style), cache => cache.GetPostDominatorsAsync());\n  }\n\n  public Task MarkSelectedNodeDominanceFrontierAsync(HighlightingStyle style) {\n    return MarkNodeDominanceFrontierAsync(GetSelectedNode(), GetNodeStyle(style),\n                                          cache => cache.GetDominanceFrontierAsync());\n  }\n\n  public Task MarkSelectedNodePostDominanceFrontierAsync(HighlightingStyle style) {\n    return MarkNodeDominanceFrontierAsync(GetSelectedNode(), GetNodeStyle(style),\n                                          cache => cache.GetPostDominanceFrontierAsync());\n  }\n\n  public void MarkSelectedNodeLoop(HighlightingStyle style) {\n    MarkNodeLoop(GetSelectedNode(), GetNodeStyle(style));\n  }\n\n  public void MarkSelectedNodeLoopNest(HighlightingStyle style) {\n    MarkNodeLoopNest(GetSelectedNode(), GetNodeStyle(style));\n  }\n\n  public void Mark(BlockIR block, Color selectedColor, bool useBoldBorder = true) {\n    var node = (GraphNode)graph_.DataNodeMap[block].Tag;\n    MarkNode(node, selectedColor);\n  }\n\n  private void MarkNode(GraphNode node, Color selectedColor, bool useBoldBorder = true) {\n    var pen = useBoldBorder ? DefaultBoldPen : DefaultPen;\n    MarkNode(node, new HighlightingStyle(selectedColor, pen));\n  }\n\n  private void MarkNode(GraphNode node, HighlightingStyle style) {\n    if (node == null) {\n      return;\n    }\n\n    HighlightNode(node, style, HighlighingType.Marked);\n\n    BlockMarked?.Invoke(this, new IRElementMarkedEventArgs {\n      Element = node.NodeInfo.ElementData,\n      Style = style\n    });\n  }\n\n  private void MarkNodePredecessors(GraphNode node, HighlightingStyle style) {\n    if (node?.NodeInfo.InEdges != null) {\n      foreach (var edge in node.NodeInfo.InEdges) {\n        var fromNode = edge.NodeFrom?.Tag as GraphNode;\n        MarkNode(fromNode, style);\n      }\n    }\n  }\n\n  private void MarkNodeSuccessors(GraphNode node, HighlightingStyle style) {\n    if (node?.NodeInfo.InEdges != null) {\n      foreach (var edge in node.NodeInfo.OutEdges) {\n        var toNode = edge.NodeTo?.Tag as GraphNode;\n        MarkNode(toNode, style);\n      }\n    }\n  }\n\n  private void MarkNodeLoop(GraphNode node, HighlightingStyle style) {\n    var loopTag = node?.NodeInfo.ElementData.GetTag<LoopBlockTag>();\n\n    if (loopTag == null) {\n      return;\n    }\n\n    foreach (var block in loopTag.Loop.Blocks) {\n      MarkNode(GetBlockNode(block), style);\n    }\n  }\n\n  private void MarkNodeLoopNest(GraphNode node, HighlightingStyle style) {\n    var loopTag = node?.NodeInfo.ElementData.GetTag<LoopBlockTag>();\n\n    if (loopTag == null) {\n      return;\n    }\n\n    foreach (var block in loopTag.Loop.LoopNestRoot.Blocks) {\n      MarkNode(GetBlockNode(block), style);\n    }\n  }\n\n  public GraphNode FindPointedNode(Point point) {\n    var result = VisualTreeHelper.HitTest(this, point);\n\n    if (result?.VisualHit is DrawingVisual visual) {\n      return visual.ReadLocalValue(TagProperty) as GraphNode;\n    }\n\n    return null;\n  }\n\n  public GraphNode FindElementNode(IRElement element) {\n    var block = element.ParentBlock;\n    return block == null ? null : GetBlockNode(block);\n  }\n\n  public Point GetNodePosition(GraphNode node) {\n    double x = node.NodeInfo.CenterX - node.NodeInfo.Width / 2;\n    double y = node.NodeInfo.CenterY - node.NodeInfo.Height / 2;\n    return new Point(TransformPoint(x), TransformPoint(y));\n  }\n\n  public void SelectElement(IRElement element) {\n    if (element_ == element) {\n      return;\n    }\n\n    element_ = element;\n    ResetHighlightedNodes(HighlighingType.Selected);\n    ResetHighlightedNodes(HighlighingType.Hovered);\n    var block = element_?.ParentBlock;\n\n    if (block != null) {\n      if (graph_.DataNodeMap.TryGetValue(block, out var node)) {\n        var graphNode = node.Tag as GraphNode;\n        HighlightConnectedNodes(graphNode, selectedNodes_,\n                                settings_.HighlightConnectedNodesOnSelection);\n      }\n    }\n  }\n\n  public void Highlight(IRHighlightingEventArgs info) {\n    if (graph_ == null) {\n      Debug.Assert(false, \"This should not happen, events are not connected\");\n      return;\n    }\n\n    var group = GetHighlightedNodeGroup(info.Type);\n\n    if (info.Type != HighlighingType.Marked &&\n        info.Action != HighlightingEventAction.AppendHighlighting) {\n      ResetHighlightedNodes(group);\n    }\n\n    // Reset any hovered items when selecting or marking.\n    if (info.Type != HighlighingType.Hovered) {\n      ResetHighlightedNodes(HighlighingType.Hovered);\n    }\n\n    if (info.Element == null || info.Group == null) {\n      return;\n    }\n\n    foreach (var element in info.Group.Elements) {\n      var block = element.ParentBlock;\n\n      if (block != null && graph_.DataNodeMap.TryGetValue(block, out var node)) {\n        var graphNode = node.Tag as GraphNode;\n\n        // Keep track of entire blocks being marked,\n        // to not reset the marking later when resetting just an element.\n        if (element is BlockIR blockElement) {\n          markedBlocks_.Add(blockElement);\n        }\n\n        // If it's a block being marked, highlight\n        // the entire group of the block and its pred/succ. blocks.\n        if (element is BlockIR && info.Type != HighlighingType.Marked) {\n          HighlightConnectedNodes(graphNode, group,\n                                  settings_.HighlightConnectedNodesOnSelection);\n\n          continue;\n        }\n\n        // For a marker, allow it to replace the node style.\n        if (info.Type == HighlighingType.Marked || !group.ContainsKey(graphNode)) {\n          var border = DefaultPen;\n\n          if (element == info.Element) {\n            border = DefaultBoldPen;\n          }\n\n          var style = new HighlightingStyle(info.Group.Style.BackColor, border);\n          HighlightNode(graphNode, style, group);\n        }\n      }\n    }\n  }\n\n  public void ResetHighlightedNodes(HighlighingType type) {\n    var group = GetHighlightedNodeGroup(type);\n    ResetHighlightedNodes(group);\n\n    if (type == HighlighingType.Hovered) {\n      hoveredNode_ = null;\n    }\n  }\n\n  public void ResetSelectedNode() {\n    ResetMarkedNode(GetSelectedNode());\n  }\n\n  public void ResetMarkedNode(GraphNode node, IRElement element = null) {\n    if (node == null) {\n      return;\n    }\n\n    if (markedNodes_.ContainsKey(node)) {\n      // When resetting an element, don't remove the node marking\n      // if the entire block was marked before, only when the block\n      // is reset.\n      if (element is BlockIR block) {\n        markedBlocks_.Remove(block);\n      }\n      else if (element != null && markedBlocks_.Contains(element.ParentBlock)) {\n        return;\n      }\n\n      markedNodes_.Remove(node);\n      RestoreNodeStyle(node);\n\n      BlockUnmarked?.Invoke(this, new IRElementMarkedEventArgs {\n        Element = node.NodeInfo.ElementData\n      });\n    }\n  }\n\n  public void ResetAllMarkedNodes() {\n    if (BlockUnmarked != null) {\n      foreach (var node in markedNodes_.Keys) {\n        BlockUnmarked(this, new IRElementMarkedEventArgs {\n          Element = node.NodeInfo.ElementData\n        });\n      }\n    }\n\n    ResetHighlightedNodes(markedNodes_);\n    markedBlocks_.Clear();\n  }\n\n  public void ShowGraph(Graph graph, ICompilerInfoProvider sessionCompilerInfo) {\n    compilerInfo_ = sessionCompilerInfo;\n    ReloadGraph(graph);\n    GraphLoaded?.Invoke(this, EventArgs.Empty);\n  }\n\n  public void ReloadCurrentGraph() {\n    if (graph_ != null) {\n      ReloadGraph(graph_);\n    }\n  }\n\n  public void HideGraph() {\n    if (graphVisual_ == null) {\n      return; // In case the graph fails to load.\n    }\n\n    RemoveVisualChild(graphVisual_);\n    graphVisual_ = null;\n    graphRenderer_ = null;\n    graph_ = null;\n    markedNodes_.Clear();\n    hoverNodes_.Clear();\n    selectedNodes_.Clear();\n    markedBlocks_.Clear();\n  }\n\n  public void FitWidthToSize(Size size) {\n    if (graphVisual_ == null) {\n      return; // In case the graph fails to load.\n    }\n\n    var bounds = graphVisual_.ContentBounds;\n    bounds.Union(graphVisual_.DescendantBounds);\n    double requiredSpace = bounds.Width + 2 * GraphMargin;\n    double zoom = 0.95 * size.Width / (requiredSpace * ScaleFactor);\n    ZoomLevel = Math.Min(zoom, 1.0);\n  }\n\n  public void FitToSize(Size size) {\n    if (graphVisual_ == null) {\n      return; // In case the graph fails to load.\n    }\n\n    var bounds = graphVisual_.ContentBounds;\n    bounds.Union(graphVisual_.DescendantBounds);\n    double requiredWidth = bounds.Width + 2 * GraphMargin;\n    double requiredHeight = bounds.Height + 2 * GraphMargin;\n    double widthFraction = size.Width / requiredWidth;\n    double heightFraction = size.Height / requiredHeight;\n\n    if (widthFraction < heightFraction) {\n      ZoomLevel = 0.95 * size.Width / (requiredWidth * ScaleFactor);\n    }\n    else {\n      ZoomLevel = 0.95 * size.Height / (requiredHeight * ScaleFactor);\n    }\n  }\n\n  protected override void OnMouseLeave(MouseEventArgs e) {\n    base.OnMouseLeave(e);\n\n    // Workaround to prevent flickerying when the parent host\n    // handles commands with keys being kept in a pressed state.\n    if (!Utils.IsKeyboardModifierActive()) {\n      ResetHighlightedNodes(HighlighingType.Hovered);\n    }\n  }\n\n  protected override Visual GetVisualChild(int index) {\n    return graphVisual_;\n  }\n\n  protected override Size MeasureOverride(Size availableSize) {\n    if (graphVisual_ == null) {\n      return new Size(0, 0);\n    }\n\n    var bounds = graphVisual_.ContentBounds;\n    bounds.Union(graphVisual_.DescendantBounds);\n\n    if (bounds.IsEmpty) {\n      return new Size(0, 0);\n    }\n\n    var m = new Matrix();\n    m.Translate(-bounds.Left + GraphMargin, -bounds.Top + GraphMargin);\n    m.Scale(zoomLevel_ * ScaleFactor, zoomLevel_ * ScaleFactor);\n    graphVisual_.Transform = new MatrixTransform(m);\n\n    return new Size(TransformPoint(bounds.Width + 2 * GraphMargin),\n                    TransformPoint(bounds.Height + 2 * GraphMargin));\n  }\n\n  private void ReloadSettings() {\n    selectedNodeStyle_ = new HighlightingStyle(settings_.SelectedNodeColor, DefaultSelectedPen);\n    predecessorNodeBorder_ = ColorPens.GetPen(settings_.PredecessorNodeBorderColor, DefaultBoldThickness);\n    successorNodeBorder_ = ColorPens.GetPen(settings_.SuccessorNodeBorderColor, DefaultBoldThickness);\n\n    if (graph_ != null) {\n      ReloadGraph(graph_);\n    }\n  }\n\n  private void SetupEvents() {\n    MouseLeftButtonDown += GraphViewer_MouseLeftButtonDown;\n    MouseRightButtonDown += GraphViewer_MouseRightButtonDown;\n    MouseMove += GraphViewer_MouseMove;\n  }\n\n  private HighlightingStyle PickMarkerStyle() {\n    return nodeStyles_.GetNext();\n  }\n\n  private HighlightingStyle GetNodeStyle(HighlightingStyle style) {\n    return style ?? PickMarkerStyle();\n  }\n\n  private void GraphViewer_MouseRightButtonDown(object sender, MouseButtonEventArgs e) {\n    var point = e.GetPosition(this);\n    var graphNode = FindPointedNode(point);\n\n    if (graphNode != null) {\n      SelectElement(graphNode.NodeInfo.ElementData);\n    }\n\n    e.Handled = graphNode != null;\n  }\n\n  private void GraphViewer_MouseMove(object sender, MouseEventArgs e) {\n    var point = e.GetPosition(this);\n    var graphNode = FindPointedNode(point);\n\n    if (graphNode != null && hoveredNode_ != graphNode) {\n      HighlightConnectedNodes(graphNode, hoverNodes_, settings_.HighlightConnectedNodesOnHover);\n      hoveredNode_ = graphNode;\n    }\n  }\n\n  private HighlightingStyle ApplyBorderToStyle(HighlightingStyle style, Pen border) {\n    return new HighlightingStyle(style.BackColor, border);\n  }\n\n  private void HighlightConnectedNodes(GraphNode graphNode,\n                                       Dictionary<GraphNode, HighlightingStyle> group,\n                                       bool highlightConnectedNodes) {\n    ResetHighlightedNodes(HighlighingType.Hovered);\n    HighlightNode(graphNode, selectedNodeStyle_, group);\n\n    if (!highlightConnectedNodes) {\n      return;\n    }\n\n    if (graphNode.NodeInfo.InEdges != null) {\n      foreach (var edge in graphNode.NodeInfo.InEdges) {\n        var node = edge.NodeFrom?.Tag as GraphNode;\n\n        if (node == null) {\n          continue; // Part of graph is invalid, ignore.\n        }\n\n        HighlightNode(node, ApplyBorderToStyle(node.Style, predecessorNodeBorder_), group);\n      }\n    }\n\n    if (graphNode.NodeInfo.OutEdges != null) {\n      foreach (var edge in graphNode.NodeInfo.OutEdges) {\n        var node = edge.NodeTo?.Tag as GraphNode;\n\n        if (node == null) {\n          continue; // Part of graph is invalid, ignore.\n        }\n\n        HighlightNode(node, ApplyBorderToStyle(node.Style, successorNodeBorder_), group);\n      }\n    }\n  }\n\n  private void GraphViewer_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    var point = e.GetPosition(this);\n    var graphNode = FindPointedNode(point);\n\n    if (graphNode != null) {\n      if (graphNode.NodeInfo.DataIsElement) {\n        SelectElement(graphNode.NodeInfo.ElementData);\n        BlockSelected?.Invoke(this, new IRElementEventArgs {\n          Element = graphNode.NodeInfo.ElementData\n        });\n      }\n      else {\n        NodeSelected?.Invoke(this, graphNode.NodeInfo.Data);\n      }\n\n      e.Handled = true;\n    }\n    else {\n      ResetHighlightedNodes(HighlighingType.Selected);\n    }\n  }\n\n  private async Task MarkNodeDominatorsAsync(GraphNode node, HighlightingStyle style,\n                                             Func<FunctionAnalysisCache, Task<DominatorAlgorithm>> getDominators) {\n    if (node == null) {\n      return;\n    }\n\n    var block = (BlockIR)node.NodeInfo.ElementData;\n    var cache = FunctionAnalysisCache.Get(block.ParentFunction);\n    var dominatorAlgorithm = await getDominators(cache).ConfigureAwait(true);\n\n    foreach (var dominator in dominatorAlgorithm.EnumerateDominators(block)) {\n      MarkNode(GetBlockNode(dominator), style);\n    }\n  }\n\n  private async Task MarkNodeDominanceFrontierAsync(GraphNode node, HighlightingStyle style,\n                                                    Func<FunctionAnalysisCache, Task<DominanceFrontier>>\n                                                      getDominanceFrontier) {\n    if (node == null) {\n      return;\n    }\n\n    var block = (BlockIR)node.NodeInfo.ElementData;\n    var cache = FunctionAnalysisCache.Get(block.ParentFunction);\n    var dominanceFrontierAlgorithm = await getDominanceFrontier(cache).ConfigureAwait(true);\n\n    foreach (var frontierBlock in dominanceFrontierAlgorithm.FrontierOf(block)) {\n      MarkNode(GetBlockNode(frontierBlock), style);\n    }\n  }\n\n  private void HighlightNode(GraphNode node, HighlightingStyle style, HighlighingType type) {\n    if (node == null) {\n      return;\n    }\n\n    var group = GetHighlightedNodeGroup(HighlighingType.Marked);\n    HighlightNode(node, style, group);\n  }\n\n  private void HighlightNode(GraphNode node, HighlightingStyle style,\n                             Dictionary<GraphNode, HighlightingStyle> group) {\n    if (node == null) {\n      return;\n    }\n\n    if (group == selectedNodes_) {\n      node.IsSelected = true;\n    }\n    else if (group == hoverNodes_) {\n      node.IsHovered = true;\n    }\n    else if (group == markedNodes_) {\n      node.IsMarked = true;\n    }\n\n    SetNodeStyle(node, style);\n    group[node] = style;\n  }\n\n  private GraphNode GetBlockNode(BlockIR block) {\n    return graph_.DataNodeMap.TryGetValue(block, out var node) ? node.Tag as GraphNode : null;\n  }\n\n  private double TransformPoint(double value) {\n    return value * zoomLevel_ * ScaleFactor;\n  }\n\n  private Dictionary<GraphNode, HighlightingStyle> GetHighlightedNodeGroup(HighlighingType type) {\n    return type switch {\n      HighlighingType.Hovered  => hoverNodes_,\n      HighlighingType.Selected => selectedNodes_,\n      HighlighingType.Marked   => markedNodes_,\n      _                        => throw new InvalidOperationException(\"Unsupported highlighting type\")\n    };\n  }\n\n  private void ResetHighlightedNodes(Dictionary<GraphNode, HighlightingStyle> group) {\n    var tempNodes = new List<GraphNode>(group.Keys);\n\n    if (group == selectedNodes_) {\n      foreach (var node in group.Keys) {\n        node.IsSelected = false;\n      }\n    }\n    else if (group == hoverNodes_) {\n      foreach (var node in group.Keys) {\n        node.IsHovered = false;\n      }\n    }\n    else if (group == markedNodes_) {\n      foreach (var node in group.Keys) {\n        node.IsMarked = false;\n      }\n    }\n\n    group.Clear();\n\n    foreach (var node in tempNodes) {\n      RestoreNodeStyle(node);\n    }\n  }\n\n  private void RestoreNodeStyle(GraphNode node) {\n    HighlightingStyle style;\n\n    if (!hoverNodes_.TryGetValue(node, out style) &&\n        !selectedNodes_.TryGetValue(node, out style) &&\n        !markedNodes_.TryGetValue(node, out style)) {\n      style = graphRenderer_.GetDefaultNodeStyle(node);\n    }\n\n    node.Style = style;\n    node.Draw();\n  }\n\n  private void SetNodeStyle(GraphNode node, HighlightingStyle style) {\n    node.Style = style;\n    node.Draw();\n  }\n\n  private void ReloadGraph(Graph graph) {\n    HideGraph();\n    graph_ = graph;\n    graphRenderer_ = new GraphRenderer(graph_, settings_, compilerInfo_);\n    graphVisual_ = graphRenderer_.Render();\n    AddVisualChild(graphVisual_);\n    InvalidateMeasure();\n  }\n\n  public void RedrawCurrentGraph() {\n    if (graph_ == null) return;\n\n    // Redraw only the nodes, currently used when file marking\n    // adds GraphNodeTags for blocks after the graph has been loaded.\n    foreach (var node in graph_.Nodes) {\n      if (node.Tag is GraphNode graphNode) {\n        graphNode.Draw();\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/HoverPreview.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.UI.Controls;\n\nnamespace ProfileExplorer.UI;\n\npublic abstract class HoverPreview : IDisposable {\n  public static readonly TimeSpan HoverDuration = TimeSpan.FromMilliseconds(200);\n  public static readonly TimeSpan LongHoverDuration = TimeSpan.FromMilliseconds(1000);\n  public static readonly TimeSpan ExtraLongHoverDuration = TimeSpan.FromMilliseconds(2000);\n  public static readonly int HoverDurationMs = (int)HoverDuration.TotalMilliseconds;\n  public static readonly int LongHoverDurationMs = (int)LongHoverDuration.TotalMilliseconds;\n  public static readonly int ExtraLongHoverDurationMs = (int)ExtraLongHoverDuration.TotalMilliseconds;\n\n  private UIElement control_;\n  private MouseHoverLogic hover_;\n  protected UIElement previewPopup_;\n  private DelayedAction removeHoveredAction_;\n\n  public HoverPreview(UIElement control, TimeSpan hoverDuration) {\n    hoverDuration = TimeSpan.FromTicks(Math.Max(hoverDuration.Ticks, HoverDuration.Ticks));\n    control_ = control;\n    hover_ = new MouseHoverLogic(control, hoverDuration);\n    hover_.MouseHover += Hover_MouseHover;\n    hover_.MouseHoverStopped += Hover_MouseHoverStopped;\n    control_.MouseLeave += OnMouseLeave;\n  }\n\n  public void Dispose() {\n    hover_?.Dispose();\n  }\n\n  public void Hide() {\n    HidePreviewPopup(true);\n  }\n\n  public void HideDelayed() {\n    HidePreviewPopupDelayed(HoverDuration);\n  }\n\n  public void Unregister() {\n    control_.MouseLeave -= OnMouseLeave;\n    hover_.MouseHover -= Hover_MouseHover;\n    hover_.MouseHoverStopped -= Hover_MouseHoverStopped;\n    hover_.Dispose();\n    hover_ = null;\n  }\n\n  protected abstract void OnHidePopup();\n  protected abstract void OnShowPopup(Point mousePoint, Point position);\n  protected abstract bool OnHoverStopped(Point mousePosition);\n\n  private void OnMouseLeave(object sender, MouseEventArgs e) {\n    HidePreviewPopupDelayed(HoverDuration);\n  }\n\n  private void HidePreviewPopup(bool force = false) {\n    if (!ShouldHidePopup(force)) {\n      return;\n    }\n\n    OnHidePopup();\n  }\n\n  private bool ShouldHidePopup(bool force = false) {\n    return previewPopup_ != null && (force || !previewPopup_.IsMouseOver);\n  }\n\n  private void Hover_MouseHover(object sender, MouseEventArgs e) {\n    ShowPreviewPopup(e.GetPosition(control_));\n  }\n\n  private void ShowPreviewPopup(Point mousePosition) {\n    if (removeHoveredAction_ != null) {\n      removeHoveredAction_.Cancel();\n      removeHoveredAction_ = null;\n    }\n\n    var position = mousePosition.AdjustForMouseCursor();\n    OnShowPopup(mousePosition, position);\n  }\n\n  private void HidePreviewPopupDelayed(TimeSpan duration) {\n    removeHoveredAction_?.Cancel();\n    removeHoveredAction_ = DelayedAction.StartNew(duration, () => {\n      if (removeHoveredAction_ != null) {\n        removeHoveredAction_ = null;\n        HidePreviewPopup();\n      }\n    });\n  }\n\n  private void Hover_MouseHoverStopped(object sender, MouseEventArgs e) {\n    if (OnHoverStopped(e.GetPosition(control_))) {\n      HidePreviewPopupDelayed(HoverDuration);\n    }\n  }\n}\n\npublic class PopupHoverPreview : HoverPreview {\n  private Func<Point, Point, DraggablePopup> createPopup_;\n  private Action<DraggablePopup> detachPopup_;\n  private Func<Point, DraggablePopup, bool> hoverStopped_;\n\n  public PopupHoverPreview(UIElement control, TimeSpan hoverDuration,\n                           Func<Point, Point, DraggablePopup> createPopup,\n                           Func<Point, DraggablePopup, bool> hoverStopped,\n                           Action<DraggablePopup> detachPopup) :\n    base(control, hoverDuration) {\n    createPopup_ = createPopup;\n    hoverStopped_ = hoverStopped;\n    detachPopup_ = detachPopup;\n  }\n\n  public PopupHoverPreview(UIElement control,\n                           Func<Point, Point, DraggablePopup> createPopup,\n                           Func<Point, DraggablePopup, bool> hoverStopped,\n                           Action<DraggablePopup> detachPopup) :\n    this(control, TimeSpan.MaxValue, createPopup, hoverStopped, detachPopup) {\n  }\n\n  public DraggablePopup PreviewPopup {\n    get => (DraggablePopup)previewPopup_;\n    set => previewPopup_ = value;\n  }\n\n  protected virtual DraggablePopup CreatePopup(Point mousePoint, Point position) {\n    return createPopup_(mousePoint, position);\n  }\n\n  protected override void OnShowPopup(Point mousePoint, Point position) {\n    var popup = CreatePopup(mousePoint, position);\n\n    if (popup != null) {\n      if (popup != PreviewPopup) {\n        PreviewPopup = popup;\n        PreviewPopup.PopupDetached += Popup_PopupDetached;\n      }\n\n      PreviewPopup.ShowPopup();\n    }\n  }\n\n  protected override bool OnHoverStopped(Point mousePosition) {\n    if (hoverStopped_ != null) {\n      return hoverStopped_(mousePosition, PreviewPopup);\n    }\n\n    return true;\n  }\n\n  protected override void OnHidePopup() {\n    PreviewPopup.ClosePopup();\n    //previewPopup_ = null;\n  }\n\n  private void Popup_PopupDetached(object sender, EventArgs e) {\n    var popup = (DraggablePopup)sender;\n    detachPopup_?.Invoke(popup);\n\n    if (popup == PreviewPopup) {\n      previewPopup_ = null; // Prevent automatic closing.\n    }\n  }\n}\n\npublic class ToolTipHoverPreview : HoverPreview {\n  private Func<Point, Point, string> createPopup_;\n\n  public ToolTipHoverPreview(UIElement control, Func<Point, Point, string> createPopup) :\n    base(control, TimeSpan.MaxValue) {\n    createPopup_ = createPopup;\n  }\n\n  private ToolTip PreviewPopup => (ToolTip)previewPopup_;\n\n  protected override void OnHidePopup() {\n    PreviewPopup.IsOpen = false;\n  }\n\n  protected override void OnShowPopup(Point mousePoint, Point position) {\n    string text = createPopup_(mousePoint, position);\n\n    if (!string.IsNullOrEmpty(text)) {\n      previewPopup_ = new ToolTip {\n        Content = text,\n        IsOpen = true,\n        FontFamily = new FontFamily(\"Consolas\")\n      };\n    }\n  }\n\n  protected override bool OnHoverStopped(Point mousePosition) {\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/IRDocumentPopup.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.Controls.IRDocumentPopup\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:document=\"clr-namespace:ProfileExplorer.UI.Profile.Document\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  AllowsTransparency=\"True\"\n  FocusManager.IsFocusScope=\"True\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </controls:DraggablePopup.LayoutTransform>\n\n  <controls:DraggablePopup.Resources>\n    <Style\n      x:Key=\"PopupButton\"\n      TargetType=\"Button\">\n      <Setter Property=\"OverridesDefaultStyle\" Value=\"True\" />\n      <Setter Property=\"Background\" Value=\"Transparent\" />\n      <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n\n      <Setter Property=\"Template\">\n        <Setter.Value>\n          <ControlTemplate TargetType=\"{x:Type Button}\">\n            <Border\n              Background=\"{TemplateBinding Background}\"\n              BorderBrush=\"{TemplateBinding BorderBrush}\"\n              BorderThickness=\"{TemplateBinding BorderThickness}\">\n              <ContentPresenter\n                HorizontalAlignment=\"Center\"\n                VerticalAlignment=\"Center\"\n                Content=\"{TemplateBinding Content}\" />\n            </Border>\n          </ControlTemplate>\n        </Setter.Value>\n      </Setter>\n\n      <Style.Triggers>\n        <Trigger Property=\"IsMouseOver\" Value=\"True\">\n          <Setter Property=\"Background\" Value=\"#BEE6FD\" />\n          <Setter Property=\"BorderBrush\" Value=\"Black\" />\n          <Setter Property=\"BorderThickness\" Value=\"1\" />\n        </Trigger>\n      </Style.Triggers>\n    </Style>\n  </controls:DraggablePopup.Resources>\n\n  <Border\n    x:Name=\"PanelBorder\"\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <Grid\n      x:Name=\"ToolbarPanel\"\n      Background=\"{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}\"\n      ContextMenu=\"{StaticResource PopupContextMenu}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"200\" />\n        <ColumnDefinition Width=\"20\" />\n        <ColumnDefinition Width=\"20\" />\n      </Grid.ColumnDefinitions>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"20\" />\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n\n      <TextBlock\n        Grid.Column=\"0\"\n        Margin=\"4,0,8,0\"\n        VerticalAlignment=\"Center\"\n        FontWeight=\"Medium\"\n        Text=\"{Binding PanelTitle}\"\n        TextTrimming=\"CharacterEllipsis\"\n        ToolTip=\"{Binding PanelToolTip}\" />\n\n      <StackPanel\n        Grid.Column=\"1\"\n        HorizontalAlignment=\"Right\"\n        Orientation=\"Horizontal\">\n        <Button\n          Margin=\"2,0,2,0\"\n          BorderThickness=\"1\"\n          Click=\"BackButton_Click\"\n          IsEnabled=\"{Binding HasPreviousFunctions}\"\n          Style=\"{StaticResource PopupButton}\"\n          ToolTip=\"Go back to previous function (Backspace/Mouse Back button)\"\n          Visibility=\"{Binding ShowHistoryButtons, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <StackPanel Orientation=\"Horizontal\">\n            <Image\n              Source=\"{StaticResource DockLeftIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Text=\"Back\" />\n          </StackPanel>\n        </Button>\n        <Button\n          Margin=\"2,0,0,0\"\n          BorderThickness=\"1\"\n          Click=\"NextButton_Click\"\n          IsEnabled=\"{Binding HasNextFunctions}\"\n          Style=\"{StaticResource PopupButton}\"\n          ToolTip=\"Go back to next function (Shift+Backspace/Mouse Forward button)\"\n          Visibility=\"{Binding ShowHistoryButtons, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <StackPanel Orientation=\"Horizontal\">\n            <Image\n              Source=\"{StaticResource DockRightIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </StackPanel>\n        </Button>\n\n        <Border\n          Width=\"1\"\n          Margin=\"4,0,4,0\"\n          HorizontalAlignment=\"Left\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n          BorderThickness=\"1,0,0,0\"\n          Visibility=\"{Binding ShowHistoryButtons, Converter={StaticResource BoolToVisibilityConverter}}\" />\n        <StackPanel\n          Orientation=\"Horizontal\"\n          Visibility=\"{Binding ShowModeButtons, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <TextBlock\n            Margin=\"0,0,4,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"Show\" />\n          <ToggleButton\n            Height=\"18\"\n            Padding=\"2,0,2,0\"\n            VerticalAlignment=\"Center\"\n            Background=\"{x:Null}\"\n            Click=\"ModeToggleButton_Click\"\n            Content=\"ASM\"\n            IsChecked=\"{Binding ShowAssembly}\"\n            ToolTip=\"Show function assembly\" />\n          <ToggleButton\n            Height=\"18\"\n            Margin=\"-1,0,0,0\"\n            Padding=\"2,0,2,0\"\n            VerticalAlignment=\"Center\"\n            Background=\"{x:Null}\"\n            Click=\"ModeToggleButton_Click\"\n            Content=\"Source\"\n            IsChecked=\"{Binding ShowSourceFile}\"\n            ToolTip=\"Show function source code\" />\n        </StackPanel>\n        <Button\n          x:Name=\"OpenButton\"\n          Width=\"20\"\n          Height=\"20\"\n          Margin=\"2,0,0,0\"\n          Background=\"{x:Null}\"\n          BorderBrush=\"{x:Null}\"\n          Click=\"OpenButton_Click\"\n          ToolTip=\"Open previewed document in a new tab\">\n          <Image\n            Width=\"14\"\n            Height=\"14\"\n            Source=\"{StaticResource LayoutOpenNewIcon}\" />\n        </Button>\n      </StackPanel>\n\n      <Border\n        Grid.Column=\"2\"\n        Width=\"1\"\n        Margin=\"1,0,1,0\"\n        HorizontalAlignment=\"Left\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n        BorderThickness=\"1,0,0,0\" />\n      <Button\n        x:Name=\"OptionsButton\"\n        Grid.Column=\"2\"\n        Width=\"20\"\n        Margin=\"0,0,-3,0\"\n        HorizontalAlignment=\"Right\"\n        Background=\"{x:Null}\"\n        BorderBrush=\"{x:Null}\"\n        Click=\"OptionButton_Click\"\n        ToolTip=\"Close popup\">\n        <Image\n          Width=\"16\"\n          Height=\"16\"\n          Margin=\"0,-1,0,0\"\n          Source=\"{StaticResource SettingsIcon}\" />\n      </Button>\n\n      <Button\n        x:Name=\"CloseButton\"\n        Grid.Column=\"3\"\n        Background=\"{x:Null}\"\n        BorderBrush=\"{x:Null}\"\n        Click=\"CloseButton_Click\"\n        ToolTip=\"Close popup\">\n        <Image\n          Width=\"16\"\n          Height=\"16\"\n          Source=\"{StaticResource CloseIcon}\" />\n      </Button>\n\n      <document:ProfileIRDocument\n        x:Name=\"ProfileTextView\"\n        Grid.Row=\"1\"\n        Grid.ColumnSpan=\"4\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        DockPanel.Dock=\"Bottom\"\n        FocusManager.IsFocusScope=\"True\"\n        ScrollViewer.HorizontalScrollBarVisibility=\"Hidden\"\n        ScrollViewer.VerticalScrollBarVisibility=\"Hidden\" />\n\n      <controls:ResizeGrip\n        x:Name=\"PanelResizeGrip\"\n        Grid.Row=\"1\"\n        Grid.Column=\"3\"\n        Width=\"16\"\n        Height=\"16\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Bottom\"\n        Panel.ZIndex=\"100\" />\n\n    </Grid>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/IRDocumentPopup.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Profile.Processing;\n\nnamespace ProfileExplorer.UI.Controls;\n\npublic partial class IRDocumentPopup : DraggablePopup, INotifyPropertyChanged {\n  public static readonly double MinWidth = 300;\n  public static readonly double MinHeight = 200; // For ASM/source preview.\n  private string panelTitle_;\n  private string panelToolTip_;\n  private UIElement owner_;\n  private bool showSourceFile_;\n  private bool showModeButtons_;\n  private IUISession session;\n  private ParsedIRTextSection parsedSection_;\n  private PreviewPopupSettings settings_;\n  private bool showHistoryButtons_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n\n  public IRDocumentPopup(Point position, UIElement owner, IUISession session, PreviewPopupSettings settings) {\n    Debug.Assert(settings != null);\n    InitializeComponent();\n    SetupEvents();\n\n    settings_ = settings;\n    double width = Math.Max(settings.PopupWidth, MinWidth);\n    double height = Math.Max(settings.PopupHeight, MinHeight);\n    Initialize(position, width, height, owner);\n\n    PanelResizeGrip.ResizedControl = this;\n    Session = session;\n    owner_ = owner;\n    DataContext = this;\n  }\n\n  public IRElement PreviewedElement { get; set; }\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public IUISession Session {\n    get => session;\n    set {\n      session = value;\n      ProfileTextView.Session = value;\n    }\n  }\n\n  public string PanelTitle {\n    get => panelTitle_;\n    set => SetField(ref panelTitle_, value);\n  }\n\n  public string PanelToolTip {\n    get => panelToolTip_;\n    set => SetField(ref panelToolTip_, value);\n  }\n\n  public string TitlePrefix { get; set; }\n  public string TitleSuffix { get; set; }\n  public string DescriptionPrefix { get; set; }\n  public string DescriptionSuffix { get; set; }\n\n  public bool ShowHistoryButtons {\n    get => showHistoryButtons_;\n    set => SetField(ref showHistoryButtons_, value);\n  }\n\n  public bool HasPreviousFunctions => ProfileTextView.HasPreviousFunctions;\n  public bool HasNextFunctions => ProfileTextView.HasNextFunctions;\n\n  public bool ShowAssembly {\n    get => !showSourceFile_;\n    set {\n      SetField(ref showSourceFile_, !value);\n      OnPropertyChanged(nameof(ShowSourceFile));\n    }\n  }\n\n  public bool ShowSourceFile {\n    get => showSourceFile_;\n    set {\n      SetField(ref showSourceFile_, value);\n      OnPropertyChanged(nameof(ShowAssembly));\n    }\n  }\n\n  public bool ShowModeButtons {\n    get => showModeButtons_;\n    set => SetField(ref showModeButtons_, value);\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void SetupEvents() {\n    ProfileTextView.PreviewMouseWheel += ProfileTextViewOnMouseWheel;\n    ProfileTextView.TitlePrefixChanged += (sender, s) => {\n      TitlePrefix = s;\n      UpdatePopupTitle();\n    };\n    ProfileTextView.TitleSuffixChanged += (sender, s) => {\n      TitleSuffix = s;\n      UpdatePopupTitle();\n    };\n    ProfileTextView.DescriptionPrefixChanged += (sender, s) => {\n      DescriptionPrefix = !string.IsNullOrEmpty(s) ? s + \"\\n\\n\" : \"\";\n      UpdatePopupTitle();\n    };\n    ProfileTextView.DescriptionSuffixChanged += (sender, s) => {\n      DescriptionSuffix = !string.IsNullOrEmpty(s) ? \"\\n\\n\" + s : \"\";\n      UpdatePopupTitle();\n    };\n    ProfileTextView.LoadedFunctionChanged += (sender, s) => {\n      parsedSection_ = s;\n      UpdatePopupTitle();\n    };\n    ProfileTextView.FunctionHistoryChanged += (sender, args) => {\n      ShowHistoryButtons = ProfileTextView.HasPreviousFunctions ||\n                           ProfileTextView.HasNextFunctions;\n      OnPropertyChanged(nameof(HasNextFunctions));\n      OnPropertyChanged(nameof(HasPreviousFunctions));\n    };\n  }\n\n  protected override void SetPanelAccentColor(Color color) {\n    ToolbarPanel.Background = ColorBrushes.GetBrush(color);\n    PanelBorder.BorderBrush = ColorBrushes.GetBrush(color);\n  }\n\n  public void SetPanelAccentColor(Brush color) {\n    ToolbarPanel.Background = color;\n    PanelBorder.BorderBrush = color;\n  }\n\n  private async Task SetupInitialMode(ParsedIRTextSection parsedSection, bool showSourceCode) {\n    parsedSection_ = parsedSection;\n    await ReloadDocument(showSourceCode);\n  }\n\n  private async Task ReloadDocument(bool showSourceCode = false) {\n    if (parsedSection_ != null) {\n      ShowModeButtons = true;\n      ShowAssembly = !showSourceCode && !settings_.ShowSourcePreviewPopup;\n      await SwitchAssemblySourceMode();\n    }\n  }\n\n  public static async Task<IRDocumentPopup> CreateNew(IRDocument document, IRElement previewedElement,\n                                                      Point position, UIElement owner,\n                                                      PreviewPopupSettings settings,\n                                                      string titlePrefix = \"\") {\n    var popup = CreatePopup(document.Section, previewedElement, position,\n                            owner ?? document.TextArea.TextView, document.Session, settings, titlePrefix);\n    await popup.InitializeFromDocument(document);\n    SetupNewPopup(popup, settings);\n    return popup;\n  }\n\n  public static async Task<IRDocumentPopup> CreateNew(ParsedIRTextSection parsedSection,\n                                                      Point position, UIElement owner,\n                                                      IUISession session,\n                                                      PreviewPopupSettings settings,\n                                                      string titlePrefix = \"\",\n                                                      bool showSourceCode = false,\n                                                      ProfileSampleFilter profileFilter = null) {\n    var popup = CreatePopup(parsedSection.Section, null, position,\n                            owner, session, settings, titlePrefix);\n    await popup.InitializeFromSection(parsedSection, profileFilter, showSourceCode);\n    SetupNewPopup(popup, settings);\n    return popup;\n  }\n\n  private static void SetupNewPopup(IRDocumentPopup popup, PreviewPopupSettings settings) {\n    popup.PopupClosed += (sender, args) => {\n      // Save resized popup dimension for next use.\n      settings.PopupWidth = popup.Width;\n      settings.PopupHeight = popup.Height;\n    };\n\n    popup.UpdatePopupTitle();\n    popup.CaptureMouseWheel();\n  }\n\n  private async Task InitializeFromSection(ParsedIRTextSection parsedSection,\n                                           ProfileSampleFilter filter,\n                                           bool showSourceCode) {\n    ReloadSettings();\n    ProfileTextView.ProfileFilter = filter;\n    ProfileTextView.Focus();\n    await SetupInitialMode(parsedSection, showSourceCode);\n  }\n\n  private void ReloadSettings() {\n    ProfileTextView.IsPreviewDocument = true;\n    ProfileTextView.UseSmallerFontSize = settings_.UseSmallerFontSize;\n    ProfileTextView.UseCompactProfilingColumns = settings_.UseCompactProfilingColumns;\n    ProfileTextView.ShowPerformanceCounterColumns = settings_.ShowPerformanceCounterColumns;\n    ProfileTextView.ShowPerformanceMetricColumns = settings_.ShowPerformanceMetricColumns;\n    ProfileTextView.Initialize(App.Settings.DocumentSettings);\n  }\n\n  private static IRDocumentPopup CreatePopup(IRTextSection section, IRElement previewedElement,\n                                             Point position, UIElement owner, IUISession session,\n                                             PreviewPopupSettings settings, string titlePrefix) {\n    var popup = new IRDocumentPopup(position, owner, session, settings);\n    popup.PreviewedElement = previewedElement;\n    popup.TitlePrefix = titlePrefix;\n    SetupNewPopup(popup, settings);\n    return popup;\n  }\n\n  private void UpdatePopupTitle() {\n    string title = GetFunctionName();\n\n    if (PreviewedElement != null) {\n      string elementText = Utils.MakeElementDescription(PreviewedElement);\n      title = $\"{title}: {elementText}\";\n    }\n\n    if (!string.IsNullOrEmpty(TitlePrefix)) {\n      title = $\"{TitlePrefix}{title}\";\n    }\n\n    if (!string.IsNullOrEmpty(TitleSuffix)) {\n      title = $\"{title}{TitleSuffix}\";\n    }\n\n    string tooltip = GetTooltipFunctionName();\n\n    if (!string.IsNullOrEmpty(DescriptionPrefix)) {\n      tooltip = $\"{DescriptionPrefix}{tooltip}\";\n    }\n\n    if (!string.IsNullOrEmpty(DescriptionSuffix)) {\n      tooltip = $\"{tooltip}{DescriptionSuffix}\";\n    }\n\n    PanelTitle = title;\n    PanelToolTip = tooltip;\n  }\n\n  private string GetFunctionName() {\n    if (parsedSection_ != null) {\n      return parsedSection_.ParentFunction.FormatFunctionName(session, 80);\n    }\n\n    return \"\";\n  }\n\n  private string GetTooltipFunctionName() {\n    if (parsedSection_ != null) {\n      string funName = parsedSection_.ParentFunction.FormatFunctionName(session);\n      return $\"Module: {parsedSection_.Section.ModuleName}\\nFunction: {DocumentUtils.FormatLongFunctionName(funName)}\";\n    }\n\n    return \"\";\n  }\n\n  private async Task InitializeFromDocument(IRDocument document, string text = null) {\n    await ProfileTextView.TextView.InitializeFromDocument(document, false, text);\n  }\n\n  public override void ShowPopup() {\n    base.ShowPopup();\n\n    if (PreviewedElement != null) {\n      MarkPreviewedElement(PreviewedElement, ProfileTextView.TextView);\n    }\n  }\n\n  public override void PopupOpened() {\n    ProfileTextView.Focus();\n  }\n\n  public override void ClosePopup() {\n    owner_.PreviewMouseWheel -= Owner_OnPreviewMouseWheel;\n    Session.UnregisterDetachedPanel(this);\n    base.ClosePopup();\n  }\n\n  private void MarkPreviewedElement(IRElement element, IRDocument document) {\n    if (PreviewedElement is BlockIR block) {\n      if (block.HasLabel) {\n        document.MarkElementWithDefaultStyle(block.Label);\n        return;\n      }\n    }\n    else {\n      document.MarkElementWithDefaultStyle(PreviewedElement);\n      return;\n    }\n\n    document.BringElementIntoView(PreviewedElement, BringIntoViewStyle.FirstLine);\n  }\n\n  private void CaptureMouseWheel() {\n    owner_.PreviewMouseWheel += Owner_OnPreviewMouseWheel;\n  }\n\n  public override bool ShouldStartDragging(MouseButtonEventArgs e) {\n    if (e.LeftButton == MouseButtonState.Pressed && ToolbarPanel.IsMouseOver) {\n      if (!IsDetached) {\n        DetachPopup();\n        EnableVerticalScrollbar();\n        Session.RegisterDetachedPanel(this);\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  public void AdjustVerticalPosition(double amount) {\n    // Make scroll bar visible, it's not by default.\n    EnableVerticalScrollbar();\n\n    amount *= ProfileTextView.TextView.DefaultLineHeight;\n    double newOffset = ProfileTextView.TextView.VerticalOffset + amount;\n    ProfileTextView.TextView.ScrollToVerticalOffset(newOffset);\n  }\n\n  private void Owner_OnPreviewMouseWheel(object sender, MouseWheelEventArgs e) {\n    if (Utils.IsControlModifierActive()) {\n      double amount = Utils.IsShiftModifierActive() ? 3 : 1;\n      AdjustVerticalPosition(e.Delta < 0 ? amount : -amount);\n      e.Handled = true;\n    }\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    ClosePopup();\n  }\n\n  private void ProfileTextViewOnMouseWheel(object sender, MouseWheelEventArgs e) {\n    EnableVerticalScrollbar();\n  }\n\n  private void EnableVerticalScrollbar() {\n    ProfileTextView.TextView.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;\n    ScrollViewer.SetVerticalScrollBarVisibility(ProfileTextView, ScrollBarVisibility.Auto);\n  }\n\n  private async void OpenButton_Click(object sender, RoutedEventArgs e) {\n    var args = new OpenSectionEventArgs(ProfileTextView.TextView.Section, OpenSectionKind.NewTab);\n\n    //? TODO: BeginInvoke prevents the \"Dispatcher suspended\" assert that happens\n    // with profiling, when Source panel shows the open dialog.\n    // The dialog code should rather invoke the dispatcher...\n    await Dispatcher.BeginInvoke(async () => {\n      var result = await Session.OpenDocumentSectionAsync(args);\n\n      //? TODO: Mark the previewed elem in the new doc\n      // var similarValueFinder = new SimilarValueFinder(function_);\n      // refElement = similarValueFinder.Find(instr);\n      result.TextView.ScrollToVerticalOffset(ProfileTextView.TextView.VerticalOffset);\n    }, DispatcherPriority.Render);\n  }\n\n  private async void ModeToggleButton_Click(object sender, RoutedEventArgs e) {\n    await SwitchAssemblySourceMode();\n  }\n\n  private async Task SwitchAssemblySourceMode() {\n    // Save current profile filter to restore after switch.\n    var filter = ProfileTextView.ProfileFilter;\n    await ProfileTextView.Reset();\n\n    if (showSourceFile_) {\n      ProfileTextView.Initialize(App.Settings.SourceFileSettings);\n      var function = parsedSection_.ParentFunction;\n      var sourceFileFinder = new SourceFileFinder(Session);\n      sourceFileFinder.LoadSettings(App.Settings.SourceFileSettings.FinderSettings);\n      var (sourceInfo, debugInfo) =\n        await sourceFileFinder.FindLocalSourceFile(function);\n      bool loaded = false;\n\n      if (!sourceInfo.IsUnknown) {\n        loaded = await ProfileTextView.LoadSourceFile(sourceInfo, parsedSection_.Section, filter);\n      }\n\n      if (!loaded) {\n        string failureText = $\"Could not find debug info for function:\\n{function.Name}\";\n        await ProfileTextView.HandleMissingSourceFile(failureText);\n      }\n    }\n    else {\n      // Show assembly.\n      ProfileTextView.Initialize(App.Settings.DocumentSettings);\n      await ProfileTextView.LoadAssembly(parsedSection_, filter);\n    }\n  }\n\n  private async void NextButton_Click(object sender, RoutedEventArgs e) {\n    await ProfileTextView.LoadNextSection();\n  }\n\n  private async void BackButton_Click(object sender, RoutedEventArgs e) {\n    await ProfileTextView.LoadPreviousSection();\n  }\n\n  private void OptionButton_Click(object sender, RoutedEventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    FrameworkElement relativeControl = ProfileTextView;\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<PreviewPopupOptionsPanel, PreviewPopupSettings>(\n      settings_.Clone(), relativeControl, Session,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(settings_)) {\n          settings_ = newSettings;\n          App.Settings.PreviewPopupSettings = newSettings;\n          ReloadSettings();\n          await ReloadDocument();\n\n          if (commit) {\n            App.SaveApplicationSettings();\n          }\n\n          return settings_.Clone();\n        }\n\n        return null;\n      },\n      () => optionsPanelPopup_ = null);\n  }\n}\n\n//? TODO: Replace all places using IRDocumentPopup with this,\n//? removes lots of duplicate code this way\npublic class IRDocumentPopupInstance {\n  public const double DefaultWidth = 600;\n  public const double DefaultHeight = 200;\n  private PreviewPopupSettings settings_;\n  private IRDocumentPopup previewPopup_;\n  private DelayedAction removeHoveredAction_;\n  private Func<PreviewPopupArgs> previewedElementFinder_;\n  private MouseHoverLogic hover_;\n  private double width_;\n  private double height_;\n  private IUISession session_;\n\n  public IRDocumentPopupInstance(PreviewPopupSettings settings, IUISession session) {\n    settings_ = settings;\n    width_ = settings != null ? Math.Max(settings.PopupWidth, DefaultWidth) : DefaultWidth;\n    height_ = settings != null ? Math.Max(settings.PopupHeight, DefaultHeight) : DefaultHeight;\n    session_ = session;\n  }\n\n  public void SetupHoverEvents(UIElement target, TimeSpan hoverDuration,\n                               Func<PreviewPopupArgs> previewedElementFinder) {\n    previewedElementFinder_ = previewedElementFinder;\n    hover_ = new MouseHoverLogic(target, hoverDuration);\n    hover_.MouseHover += Hover_MouseHover;\n    hover_.MouseHoverStopped += Hover_MouseHoverStopped;\n  }\n\n  public void UnregisterHoverEvents() {\n    hover_.MouseHover -= Hover_MouseHover;\n    hover_.MouseHoverStopped -= Hover_MouseHoverStopped;\n    hover_.Dispose();\n    hover_ = null;\n  }\n\n  private async Task ShowPreviewPopupForDocument(PreviewPopupArgs args) {\n    await ShowPreviewPopupForDocument(args.Document, args.Element, args.RelativeElement, args.Title);\n  }\n\n  private async Task ShowPreviewPopupForDocument(IRDocument document, IRElement element, UIElement relativeElement,\n                                                 string titlePrefix) {\n    if (!Prepare(element)) {\n      return;\n    }\n\n    var position = Mouse.GetPosition(relativeElement).AdjustForMouseCursor();\n    previewPopup_ = await IRDocumentPopup.CreateNew(document, element, position,\n                                                    relativeElement, settings_, titlePrefix);\n    Complete();\n  }\n\n  private async Task ShowPreviewPopupForLoadedSection(PreviewPopupArgs args) {\n    if (!Prepare()) {\n      return;\n    }\n\n    var position = Mouse.GetPosition(args.RelativeElement).AdjustForMouseCursor();\n    previewPopup_ = await IRDocumentPopup.CreateNew(args.LoadedSection, position,\n                                                    args.RelativeElement, session_,\n                                                    settings_, args.Title,\n                                                    args.ShowSourceCode, args.ProfilerFilter);\n    Complete();\n  }\n\n  private async Task ShowPreviewPopupForSection(PreviewPopupArgs args) {\n    if (!Prepare()) {\n      return;\n    }\n\n    var parsedSection = await session_.LoadAndParseSection(args.Section);\n\n    if (parsedSection != null) {\n      var position = Mouse.GetPosition(args.RelativeElement).AdjustForMouseCursor();\n      previewPopup_ = await IRDocumentPopup.CreateNew(parsedSection, position,\n                                                      args.RelativeElement, session_,\n                                                      settings_, args.Title,\n                                                      args.ShowSourceCode, args.ProfilerFilter);\n      Complete();\n    }\n  }\n\n  public void HidePreviewPopup(bool force = false) {\n    if (previewPopup_ != null && (force || !previewPopup_.IsMouseOver)) {\n      previewPopup_.ClosePopup();\n      previewPopup_ = null;\n    }\n  }\n\n  private void HidePreviewPopupDelayed() {\n    removeHoveredAction_ = DelayedAction.StartNew(() => {\n      if (removeHoveredAction_ != null) {\n        removeHoveredAction_ = null;\n        HidePreviewPopup();\n      }\n    });\n  }\n\n  private bool Prepare(IRElement element = null) {\n    if (previewPopup_ != null) {\n      if (element != null && previewPopup_.PreviewedElement == element) {\n        return false; // Right preview already displayed.\n      }\n\n      HidePreviewPopup(true);\n    }\n\n    if (removeHoveredAction_ != null) {\n      removeHoveredAction_.Cancel();\n      removeHoveredAction_ = null;\n    }\n\n    return true;\n  }\n\n  private void Complete() {\n    previewPopup_.PopupDetached += Popup_PopupDetached;\n    previewPopup_.ShowPopup();\n  }\n\n  private void Popup_PopupDetached(object sender, EventArgs e) {\n    var popup = (IRDocumentPopup)sender;\n\n    if (popup == previewPopup_) {\n      previewPopup_ = null; // Prevent automatic closing.\n    }\n  }\n\n  private async void Hover_MouseHover(object sender, MouseEventArgs e) {\n    var result = previewedElementFinder_();\n\n    if (result != null) {\n      await ShowPreviewPopup(result);\n    }\n  }\n\n  private async Task<IRDocumentPopup> ShowPreviewPopup(PreviewPopupArgs args) {\n    if (args.Document != null) {\n      await ShowPreviewPopupForDocument(args);\n    }\n    else if (args.Section != null) {\n      await ShowPreviewPopupForSection(args);\n    }\n    else if (args.LoadedSection != null) {\n      await ShowPreviewPopupForLoadedSection(args);\n    }\n    else {\n      throw new InvalidOperationException();\n    }\n\n    return previewPopup_;\n  }\n\n  public static async Task ShowPreviewPopup(IRTextFunction function, string title,\n                                            UIElement relativeElement, IUISession session,\n                                            ProfileSampleFilter profileFilter = null,\n                                            bool showSourceCode = false,\n                                            Brush titleBarColor = null) {\n    var settings = App.Settings.PreviewPopupSettings;\n    var instance = new IRDocumentPopupInstance(settings, session);\n    var args = PreviewPopupArgs.ForFunction(function, relativeElement, title, profileFilter, showSourceCode);\n    var popup = await instance.ShowPreviewPopup(args);\n\n    if (titleBarColor != null) {\n      popup.SetPanelAccentColor(titleBarColor);\n    }\n  }\n\n  private void Hover_MouseHoverStopped(object sender, MouseEventArgs e) {\n    HidePreviewPopupDelayed();\n  }\n}\n\npublic class PreviewPopupArgs {\n  public string Title { get; set; }\n  public IRElement Element { get; set; }\n  public UIElement RelativeElement { get; set; }\n  public IRDocument Document { get; set; }\n  public ParsedIRTextSection LoadedSection { get; set; }\n  public IRTextSection Section { get; set; }\n  public bool ShowSourceCode { get; set; }\n  public ProfileSampleFilter ProfilerFilter { get; set; }\n\n  public static PreviewPopupArgs ForDocument(IRDocument document, IRElement element,\n                                             UIElement relativeElement, string title = \"\") {\n    return new PreviewPopupArgs {\n      Element = element,\n      Document = document,\n      RelativeElement = relativeElement,\n      Title = title\n    };\n  }\n\n  public static PreviewPopupArgs ForSection(IRTextSection section,\n                                            UIElement relativeElement,\n                                            string title = \"\",\n                                            ProfileSampleFilter profileFilter = null,\n                                            bool showSourceCode = false) {\n    return new PreviewPopupArgs {\n      Section = section,\n      RelativeElement = relativeElement,\n      Title = title,\n      ProfilerFilter = profileFilter,\n      ShowSourceCode = showSourceCode\n    };\n  }\n\n  public static PreviewPopupArgs ForFunction(IRTextFunction function,\n                                             UIElement relativeElement,\n                                             string title = \"\",\n                                             ProfileSampleFilter profileFilter = null,\n                                             bool showSourceCode = false) {\n    if (function == null || function.Sections.Count == 0) {\n      return null;\n    }\n\n    return new PreviewPopupArgs {\n      Section = function.Sections[0],\n      RelativeElement = relativeElement,\n      Title = title,\n      ProfilerFilter = profileFilter,\n      ShowSourceCode = showSourceCode\n    };\n  }\n\n  public static PreviewPopupArgs ForLoadedSection(ParsedIRTextSection section,\n                                                  UIElement relativeElement, string title = \"\") {\n    return new PreviewPopupArgs {\n      LoadedSection = section,\n      RelativeElement = relativeElement,\n      Title = title\n    };\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/IconSelector.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.IconSelector\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"250\"\n  d:DesignWidth=\"400\"\n  mc:Ignorable=\"d\">\n  <UserControl.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </UserControl.LayoutTransform>\n\n  <StackPanel Orientation=\"Vertical\">\n    <StackPanel\n      Margin=\"0,2,0,0\"\n      Orientation=\"Horizontal\">\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Background=\"Transparent\"\n        BorderThickness=\"0\"\n        PreviewMouseUp=\"Button_MouseUp\"\n        Tag=\"WarningIconColor\">\n        <Image Source=\"{StaticResource WarningIconColor}\" />\n      </Button>\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"0\"\n        PreviewMouseUp=\"Button_MouseUp\"\n        Tag=\"QuestionIconColor\">\n        <Image Source=\"{StaticResource QuestionIconColor}\" />\n      </Button>\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"0\"\n        PreviewMouseUp=\"Button_MouseUp\"\n        Tag=\"MarkerIcon\">\n        <Image Source=\"{StaticResource MarkerIcon}\" />\n      </Button>\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"0\"\n        PreviewMouseUp=\"Button_MouseUp\"\n        Tag=\"StarIconColor\">\n        <Image Source=\"{StaticResource StarIconYellow}\" />\n      </Button>\n\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"0\"\n        PreviewMouseUp=\"Button_MouseUp\"\n        Tag=\"PinIconColor\">\n        <Image Source=\"{StaticResource PinIconColor}\" />\n      </Button>\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"0\"\n        PreviewMouseUp=\"Button_MouseUp\"\n        Tag=\"ExecuteIconColor\">\n        <Image Source=\"{StaticResource ExecuteIconColor}\" />\n      </Button>\n      <Button\n        Width=\"20\"\n        Height=\"20\"\n        Margin=\"2,0,0,0\"\n        Background=\"Transparent\"\n        BorderThickness=\"0\"\n        PreviewMouseUp=\"Button_MouseUp\"\n        Tag=\"BellIcon\">\n        <Image Source=\"{StaticResource BellIcon}\" />\n      </Button>\n    </StackPanel>\n  </StackPanel>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/IconSelector.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Input;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class SelectedIconEventArgs : EventArgs {\n  public string SelectedIconName { get; set; }\n}\n\npublic partial class IconSelector : UserControl {\n  public static readonly DependencyProperty CommandTargetProperty =\n    DependencyProperty.Register(\"CommandTarget\", typeof(IInputElement), typeof(IconSelector),\n                                new UIPropertyMetadata(null));\n  public static DependencyProperty IconSelectedCommandProperty =\n    DependencyProperty.Register(\"IconSelectedCommand\", typeof(ICommand), typeof(IconSelector));\n  private static readonly Color[] ButtonIcons;\n\n  public IconSelector() {\n    InitializeComponent();\n    Focusable = true;\n    Loaded += IconSelector_Loaded;\n    DataContext = this;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public ICommand IconSelectedCommand {\n    get => (ICommand)GetValue(IconSelectedCommandProperty);\n    set => SetValue(IconSelectedCommandProperty, value);\n  }\n\n  public IInputElement CommandTarget {\n    get => (IInputElement)GetValue(CommandTargetProperty);\n    set => SetValue(CommandTargetProperty, value);\n  }\n\n  public event EventHandler<SelectedIconEventArgs> IconSelected;\n\n  private void IconSelector_Loaded(object sender, RoutedEventArgs e) {\n    Focus();\n  }\n\n  private void RaiseSelectedIconEvent(string iconName) {\n    if (IconSelectedCommand == null && IconSelected == null) {\n      return;\n    }\n\n    var parentHost = Utils.FindParentHost(this);\n\n    if (parentHost != null) {\n      parentHost.Focus();\n    }\n\n    var args = new SelectedIconEventArgs {\n      SelectedIconName = iconName\n    };\n\n    if (IconSelectedCommand != null) {\n      if (IconSelectedCommand.CanExecute(args)) {\n        IconSelectedCommand.Execute(args);\n      }\n    }\n    else {\n      IconSelected?.Invoke(this, args);\n    }\n  }\n\n  private UIElement FindParentHost() {\n    var logicalRoot = LogicalTreeHelper.GetParent(this);\n\n    while (logicalRoot != null) {\n      if (logicalRoot is UserControl || logicalRoot is Window) {\n        break;\n      }\n\n      logicalRoot = LogicalTreeHelper.GetParent(logicalRoot);\n    }\n\n    return logicalRoot as UIElement;\n  }\n\n  private void CloseParentMenu() {\n    // Close the context menu hosting the control.\n    var logicalRoot = LogicalTreeHelper.GetParent(this);\n\n    while (logicalRoot != null) {\n      if (logicalRoot is ContextMenu menu) {\n        menu.IsOpen = false;\n        break;\n      }\n\n      if (logicalRoot is Popup popup) {\n        popup.IsOpen = false;\n        break;\n      }\n\n      logicalRoot = LogicalTreeHelper.GetParent(logicalRoot);\n    }\n  }\n\n  private void Button_MouseUp(object sender, MouseButtonEventArgs e) {\n    var button = sender as Button;\n    RaiseSelectedIconEvent((string)button.Tag);\n    Utils.CloseParentMenu(this);\n    e.Handled = true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/NotesPopup.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.Controls.NotesPopup\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:doc=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  AllowsTransparency=\"True\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </controls:DraggablePopup.LayoutTransform>\n\n  <Border\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <Grid>\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"20\" />\n        <ColumnDefinition Width=\"20\" />\n      </Grid.ColumnDefinitions>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"20\" />\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n\n      <Grid\n        x:Name=\"ToolbarPanel\"\n        Grid.Row=\"0\"\n        Grid.Column=\"0\"\n        Grid.ColumnSpan=\"3\"\n        Background=\"{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}\">\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FontWeight=\"Medium\"\n          Text=\"{Binding PanelTitle}\" />\n      </Grid>\n      <ToggleButton\n        x:Name=\"FindButton\"\n        Grid.Row=\"0\"\n        Grid.Column=\"1\"\n        Background=\"{x:Null}\"\n        BorderBrush=\"{x:Null}\"\n        IsChecked=\"{Binding SearchPanelVisible, Mode=TwoWay, ElementName=TextView}\">\n        <Image\n          Width=\"14\"\n          Height=\"14\"\n          Source=\"{StaticResource SearchIcon}\" />\n      </ToggleButton>\n      <Button\n        x:Name=\"CloseButton\"\n        Grid.Row=\"0\"\n        Grid.Column=\"2\"\n        Background=\"{x:Null}\"\n        BorderBrush=\"{x:Null}\"\n        Click=\"CloseButton_Click\"\n        ToolTip=\"Close query panel\">\n        <Image\n          Width=\"16\"\n          Height=\"16\"\n          Source=\"{StaticResource CloseIcon}\" />\n      </Button>\n\n      <doc:SearcheableIRDocument\n        x:Name=\"TextView\"\n        Grid.Row=\"1\"\n        Grid.ColumnSpan=\"3\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        DockPanel.Dock=\"Bottom\" />\n      <controls:ResizeGrip\n        x:Name=\"PanelResizeGrip\"\n        Grid.Row=\"1\"\n        Grid.Column=\"2\"\n        Width=\"16\"\n        Height=\"16\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Bottom\"\n        Panel.ZIndex=\"100\" />\n\n    </Grid>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/NotesPopup.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.ComponentModel;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Controls;\n\npublic partial class NotesPopup : DraggablePopup, INotifyPropertyChanged {\n  private string panelTitle_;\n\n  public NotesPopup(Point position, double width, double height,\n                    UIElement referenceElement) {\n    InitializeComponent();\n    Initialize(position, width, height, referenceElement);\n    PanelResizeGrip.ResizedControl = this;\n    DataContext = this;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public IUISession Session {\n    get => TextView.Session;\n    set => TextView.Session = value;\n  }\n\n  public string PanelTitle {\n    get => panelTitle_;\n    set {\n      if (panelTitle_ != value) {\n        panelTitle_ = value;\n        OnPropertyChange(nameof(PanelTitle));\n      }\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void SetText(string text) {\n    TextView.SetText(text);\n    //? ProfileTextView.EnableIRSyntaxHighlighting();\n  }\n\n  public async Task SetText(string text, FunctionIR function, IRTextSection section,\n                            IRDocument associatedDocument, IUISession session) {\n    await TextView.SetText(text, function, section, associatedDocument, session);\n  }\n\n  public override bool ShouldStartDragging(MouseButtonEventArgs e) {\n    if (e.LeftButton == MouseButtonState.Pressed && ToolbarPanel.IsMouseOver) {\n      if (!IsDetached) {\n        DetachPopup();\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  private void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    ClosePopup();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/OptionalColumn.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.UI;\n\npublic delegate void OptionalColumnEventHandler(OptionalColumn column, GridViewColumnHeader columnHeader);\n\npublic class OptionalColumn : ICloneable {\n  public OptionalColumnEventHandler HeaderClickHandler;\n  public OptionalColumnEventHandler HeaderRightClickHandler;\n  public OptionalColumnEventHandler HeaderDoubleClickHandler;\n  private int hashCode_;\n\n  private OptionalColumn(string bindingName, string cellTemplateName,\n                         string columnName, string title, string tooltip,\n                         IValueConverter converter = null,\n                         double width = double.NaN,\n                         string columnTemplateName = null,\n                         OptionalColumnStyle style = null,\n                         bool isVisible = true) {\n    BindingName = bindingName;\n    CellTemplateName = cellTemplateName;\n    ColumnName = string.Intern(columnName);\n    Title = title;\n    Tooltip = tooltip;\n    Width = width;\n    Converter = converter;\n    ColumnTemplateName = columnTemplateName;\n    Style = style ?? new OptionalColumnStyle();\n    IsVisible = isVisible;\n    IsTemplateBinding = cellTemplateName != null;\n  }\n\n  public string BindingName { get; set; }\n  public string CellTemplateName { get; set; }\n  public string ColumnName { get; set; }\n  public string ColumnTemplateName { get; set; }\n  public string Title { get; set; }\n  public string Tooltip { get; set; }\n  public double Width { get; set; }\n  public IValueConverter Converter { get; set; }\n  public OptionalColumnStyle Style { get; set; }\n  public PerformanceCounter PerformanceCounter { get; set; }\n  public bool IsVisible { get; set; }\n  public bool IsMainColumn { get; set; }\n  public bool IsTemplateBinding { get; set; }\n  public bool HasCustomStyle => !string.IsNullOrEmpty(ColumnTemplateName);\n  public Style CustomStyle =>\n    !string.IsNullOrEmpty(ColumnTemplateName) ? (Style)Application.Current.FindResource(ColumnTemplateName) : null;\n  public bool IsPerformanceCounter => PerformanceCounter is {IsMetric: false};\n  public bool IsPerformanceMetric => PerformanceCounter is {IsMetric: true};\n\n  public object Clone() {\n    var clone = new OptionalColumn(BindingName, CellTemplateName, ColumnName, Title, Tooltip,\n                                   Converter, Width, ColumnTemplateName, Style, IsVisible) {\n      HeaderClickHandler = HeaderClickHandler,\n      HeaderRightClickHandler = HeaderRightClickHandler,\n      HeaderDoubleClickHandler = HeaderDoubleClickHandler,\n      PerformanceCounter = PerformanceCounter\n    };\n\n    return clone;\n  }\n\n  public static OptionalColumn Binding(string binding, string columnName, string title, string tooltip = null,\n                                       IValueConverter converter = null, double width = double.NaN,\n                                       string columnStyle = null,\n                                       OptionalColumnStyle style = null, bool isVisible = true) {\n    return new OptionalColumn(binding, null, columnName, title, tooltip,\n                              converter, width, columnStyle, style, isVisible);\n  }\n\n  public static OptionalColumn Template(string binding, string templateName, string columnName, string title,\n                                        string tooltip = null,\n                                        IValueConverter converter = null, double width = double.NaN,\n                                        string columnStyle = null,\n                                        OptionalColumnStyle style = null, bool isVisible = true) {\n    return new OptionalColumn(binding, templateName, columnName, title, tooltip,\n                              converter, width, columnStyle, style, isVisible);\n  }\n\n  public static void RemoveListViewColumns(ListView listView, OptionalColumn[] columns,\n                                           IGridViewColumnValueSorter columnSorter = null) {\n    foreach (var column in columns) {\n      RemoveListViewColumn(listView, column.ColumnName, columnSorter);\n    }\n  }\n\n  public static void RemoveListViewColumns(ListView listView, Func<GridViewColumnHeader, bool> predicate = null,\n                                           IGridViewColumnValueSorter columnSorter = null) {\n    var functionGrid = (GridView)listView.View;\n    var removedColumns = new List<GridViewColumn>();\n\n    foreach (var column in functionGrid.Columns) {\n      var header = column.Header as GridViewColumnHeader;\n\n      if (predicate == null || predicate(header)) {\n        removedColumns.Add(column);\n      }\n    }\n\n    foreach (var column in removedColumns) {\n      functionGrid.Columns.Remove(column);\n      columnSorter?.UnregisterColumnHeader((GridViewColumnHeader)column.Header);\n    }\n  }\n\n  public static List<(GridViewColumnHeader Header, GridViewColumn Column)> AddListViewColumns(\n    ListView listView, IEnumerable<OptionalColumn> columns,\n    IGridViewColumnValueSorter columnSorter = null,\n    string titleSuffix = \"\", string tooltipSuffix = \"\", bool useValueConverter = true, int insertionIndex = -1) {\n    var columnHeaders = new List<(GridViewColumnHeader, GridViewColumn)>();\n\n    foreach (var column in columns) {\n      if (column.IsVisible) {\n        columnHeaders.Add(AddListViewColumn(listView, column, columnSorter, titleSuffix, tooltipSuffix,\n                                            useValueConverter, insertionIndex));\n        insertionIndex = insertionIndex != -1 ? insertionIndex + 1 : -1;\n      }\n    }\n\n    return columnHeaders;\n  }\n\n  public static GridViewColumnHeader RemoveListViewColumn(ListView listView, string columnName,\n                                                          IGridViewColumnValueSorter columnSorter = null) {\n    var functionGrid = (GridView)listView.View;\n\n    foreach (var column in functionGrid.Columns) {\n      if (column.Header is GridViewColumnHeader header) {\n        if (header.Name == columnName) {\n          functionGrid.Columns.Remove(column);\n          columnSorter?.UnregisterColumnHeader(header);\n          return header;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  public static (GridViewColumnHeader Header, GridViewColumn Column)\n    AddListViewColumn(ListView listView, OptionalColumn column,\n                      IGridViewColumnValueSorter columnSorter = null,\n                      string titleSuffix = \"\", string tooltipSuffix = \"\",\n                      bool useValueConverter = true, int index = -1) {\n    var functionGrid = (GridView)listView.View;\n    var columnHeader = new GridViewColumnHeader {\n      Name = column.ColumnName,\n      VerticalAlignment = VerticalAlignment.Stretch,\n      HorizontalAlignment = HorizontalAlignment.Stretch,\n      VerticalContentAlignment = VerticalAlignment.Stretch,\n      HorizontalContentAlignment = HorizontalAlignment.Left,\n      Padding = new Thickness(0, 0, 7, 0),\n      Width = column.Width,\n      Content = string.Format(column.Title, titleSuffix),\n      ToolTip = string.Format(column.Tooltip, tooltipSuffix),\n      OverridesDefaultStyle = column.HasCustomStyle,\n      Style = column.CustomStyle,\n      Tag = column\n    };\n\n    var converter = useValueConverter ? column.Converter : null;\n    var gridColumn = new GridViewColumn {\n      Header = columnHeader,\n      Width = column.Width,\n      CellTemplate = column.IsTemplateBinding ?\n        CreateGridColumnTemplateBindingTemplate(column.BindingName, column.CellTemplateName) :\n        CreateGridColumnBindingTemplate(column.BindingName, converter)\n    };\n\n    if (index != -1) {\n      functionGrid.Columns.Insert(index, gridColumn);\n    }\n    else {\n      functionGrid.Columns.Add(gridColumn);\n    }\n\n    columnSorter?.RegisterColumnHeader(columnHeader);\n    return (columnHeader, gridColumn);\n  }\n\n  public static int FindListViewColumnIndex(string name, ListView listView) {\n    var functionGrid = (GridView)listView.View;\n    int index = 0;\n\n    foreach (var column in functionGrid.Columns) {\n      if (column.Header is GridViewColumnHeader columnHeader &&\n          columnHeader.Name == name) {\n        return index;\n      }\n\n      index++;\n    }\n\n    return -1;\n  }\n\n  private static DataTemplate CreateGridColumnBindingTemplate(string propertyName,\n                                                              IValueConverter valueConverter = null) {\n    var template = new DataTemplate();\n    var factory = new FrameworkElementFactory(typeof(TextBlock));\n    factory.SetValue(TextBlock.TextAlignmentProperty, TextAlignment.Left);\n\n    var binding = new Binding(propertyName);\n    binding.Converter = valueConverter;\n    factory.SetBinding(TextBlock.TextProperty, binding);\n    template.VisualTree = factory;\n    return template;\n  }\n\n  private static DataTemplate CreateGridColumnTemplateBindingTemplate(string propertyName, string sourceTampleteName) {\n    //? Preloading XAML is faster\n    //? https://stackoverflow.com/questions/24620656/how-does-use-xamlreader-to-load-from-a-xaml-file-from-within-the-assembly/24623673\n\n    var template = new DataTemplate();\n    var sourceTemplate = (DataTemplate)Application.Current.FindResource(sourceTampleteName);\n    var factory = new FrameworkElementFactory(typeof(ContentControl));\n    var binding = new Binding(propertyName);\n    factory.SetBinding(ContentControl.ContentProperty, binding);\n    factory.SetValue(ContentControl.ContentTemplateProperty, sourceTemplate);\n    template.VisualTree = factory;\n    return template;\n  }\n\n  public override bool Equals(object? obj) {\n    return obj is OptionalColumn other &&\n           other.IsTemplateBinding == IsTemplateBinding &&\n           other.ColumnName.Equals(ColumnName);\n  }\n\n  public override int GetHashCode() {\n    if (hashCode_ != 0) {\n      return hashCode_;\n    }\n\n    hashCode_ = HashCode.Combine(ColumnName, IsTemplateBinding);\n    return hashCode_;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/PanelToolbarTray.xaml",
    "content": "﻿<ToolBarTray\n  x:Class=\"ProfileExplorer.UI.PanelToolbarTray\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  Height=\"28\"\n  HorizontalAlignment=\"Right\"\n  VerticalAlignment=\"Center\"\n  d:DesignHeight=\"28\"\n  d:DesignWidth=\"200\"\n  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n  IsLocked=\"True\"\n  mc:Ignorable=\"d\">\n  <ToolBar\n    Height=\"28\"\n    MinWidth=\"24\"\n    HorizontalAlignment=\"Stretch\"\n    VerticalAlignment=\"Center\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    IsVisibleChanged=\"ToolBar_OnIsVisibleChanged\"\n    Loaded=\"ToolBar_Loaded\"\n    SizeChanged=\"ToolBar_OnSizeChanged\">\n\n    <Separator />\n\n    <ToggleButton\n      x:Name=\"PinButton\"\n      Width=\"20\"\n      Height=\"20\"\n      Padding=\"0\"\n      Checked=\"PinButton_Checked\"\n      Focusable=\"False\"\n      ToolBar.OverflowMode=\"Never\"\n      ToolTip=\"Pin view content (don't sync with Assembly view)\"\n      Unchecked=\"PinButton_Unchecked\">\n      <Image\n        Source=\"{StaticResource PinIcon}\"\n        Style=\"{StaticResource DisabledImageStyle}\" />\n    </ToggleButton>\n\n    <Menu\n      x:Name=\"DuplicateButton\"\n      Height=\"20\"\n      Padding=\"0\"\n      VerticalAlignment=\"Center\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      Focusable=\"False\"\n      ToolBar.OverflowMode=\"Never\"\n      ToolTip=\"Duplicate View\">\n      <MenuItem\n        Margin=\"0,0,0,0\"\n        Padding=\"0,0,0,0\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        Focusable=\"False\"\n        OverridesDefaultStyle=\"True\">\n        <MenuItem.Icon>\n          <Image\n            Width=\"16\"\n            Height=\"20\"\n            Source=\"{StaticResource VersionsIcon}\"\n            Style=\"{StaticResource DisabledImageStyle}\" />\n        </MenuItem.Icon>\n        <MenuItem\n          x:Name=\"DuplicateMenu\"\n          Click=\"DuplicateMenu_Click\"\n          Header=\"Duplicate View\"\n          ToolTip=\"Duplicate view and dock it together with original\" />\n        <MenuItem\n          x:Name=\"DuplicateLeftMenu\"\n          Click=\"DuplicateLeftMenu_Click\"\n          Header=\"Duplicate View - Dock Left\"\n          ToolTip=\"Duplicate view and dock on the left\">\n          <MenuItem.Icon>\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource DockLeftIcon}\" />\n          </MenuItem.Icon>\n        </MenuItem>\n        <MenuItem\n          x:Name=\"DuplicateRightMenu\"\n          Click=\"DuplicateRightMenu_Click\"\n          Header=\"Duplicate View - Dock Right\"\n          ToolTip=\"Duplicate view and dock on the right\">\n          <MenuItem.Icon>\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource DockRightIcon}\" />\n          </MenuItem.Icon>\n        </MenuItem>\n        <MenuItem\n          x:Name=\"DuplicateFloatingMenu\"\n          Click=\"DuplicateFloatingMenu_Click\"\n          Header=\"Duplicate View - Undocked\"\n          ToolTip=\"Duplicate view and undock it\">\n          <MenuItem.Icon>\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource OpenExternalIcon}\" />\n          </MenuItem.Icon>\n        </MenuItem>\n      </MenuItem>\n    </Menu>\n\n    <Button\n      x:Name=\"HelpButton\"\n      Width=\"20\"\n      Height=\"20\"\n      Padding=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalContentAlignment=\"Stretch\"\n      Click=\"HelpButton_Click\"\n      Focusable=\"False\"\n      PreviewMouseLeftButtonDown=\"SettingsButton_PreviewMouseLeftButtonDown\"\n      ToolBar.OverflowMode=\"Never\"\n      ToolTip=\"Show view documentation\">\n      <Image\n        Width=\"18\"\n        Height=\"18\"\n        VerticalAlignment=\"Center\"\n        SnapsToDevicePixels=\"True\"\n        Source=\"{StaticResource HelpIcon}\"\n        Style=\"{StaticResource DisabledImageStyle}\"\n        UseLayoutRounding=\"True\" />\n    </Button>\n\n    <Button\n      x:Name=\"SettingsButton\"\n      Width=\"20\"\n      Height=\"20\"\n      Padding=\"0\"\n      Click=\"SettingsButton_Click\"\n      Focusable=\"False\"\n      PreviewMouseLeftButtonDown=\"SettingsButton_PreviewMouseLeftButtonDown\"\n      ToolBar.OverflowMode=\"Never\"\n      ToolTip=\"Show view settings\">\n      <Image\n        Source=\"{StaticResource SettingsIcon}\"\n        Style=\"{StaticResource DisabledImageStyle}\" />\n    </Button>\n  </ToolBar>\n</ToolBarTray>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/PanelToolbarTray.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI;\n\npublic class PinEventArgs : EventArgs {\n  public bool IsPinned { get; set; }\n}\n\npublic class DuplicateEventArgs : EventArgs {\n  public DuplicatePanelKind Kind { get; set; }\n}\n\npublic class BindMenuItem {\n  public string Header { get; set; }\n  public string ToolTip { get; set; }\n  public object Tag { get; set; }\n  public bool IsChecked { get; set; }\n}\n\npublic class BindMenuItemsArgs : EventArgs {\n  public List<BindMenuItem> MenuItems;\n\n  public BindMenuItemsArgs() {\n    MenuItems = new List<BindMenuItem>();\n  }\n}\n\npublic partial class PanelToolbarTray : ToolBarTray {\n  public static readonly DependencyProperty HasPinButtonProperty =\n    DependencyProperty.Register(\"HasPinButton\", typeof(bool), typeof(PanelToolbarTray),\n                                new PropertyMetadata(true, OnHasPinButtonPropertyChanged));\n  public static readonly DependencyProperty HasDuplicateButtonProperty =\n    DependencyProperty.Register(\"HasDuplicateButton\", typeof(bool), typeof(PanelToolbarTray),\n                                new PropertyMetadata(true, OnHasDuplicateButtonPropertyChanged));\n  public static readonly DependencyProperty HasHelpButtonProperty =\n    DependencyProperty.Register(\"HasHelpButton\", typeof(bool), typeof(PanelToolbarTray),\n                                new PropertyMetadata(true, OnHasHelpButtonPropertyChanged));\n  private bool registerLeftButtonDown_;\n\n  public PanelToolbarTray() {\n    InitializeComponent();\n  }\n\n  public bool HasPinButton {\n    get => (bool)GetValue(HasPinButtonProperty);\n    set => SetValue(HasPinButtonProperty, value);\n  }\n\n  public bool HasDuplicateButton {\n    get => (bool)GetValue(HasDuplicateButtonProperty);\n    set => SetValue(HasDuplicateButtonProperty, value);\n  }\n\n  public bool HasHelpButton {\n    get => (bool)GetValue(HasHelpButtonProperty);\n    set => SetValue(HasHelpButtonProperty, value);\n  }\n\n  public bool IsPinned {\n    get => PinButton.IsChecked.HasValue && PinButton.IsChecked.Value;\n    set => PinButton.IsChecked = value;\n  }\n\n  public event EventHandler<PinEventArgs> PinnedChanged;\n  public event EventHandler<DuplicateEventArgs> DuplicateClicked;\n  public event EventHandler SettingsClicked;\n  public event EventHandler HelpClicked;\n  public event EventHandler<BindMenuItemsArgs> BindMenuOpen;\n  public event EventHandler<BindMenuItem> BindMenuItemSelected;\n\n  private static void OnHasPinButtonPropertyChanged(DependencyObject d,\n                                                    DependencyPropertyChangedEventArgs e) {\n    var source = d as PanelToolbarTray;\n    bool visible = (bool)e.NewValue;\n    source.PinButton.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;\n  }\n\n  private static void OnHasDuplicateButtonPropertyChanged(DependencyObject d,\n                                                          DependencyPropertyChangedEventArgs e) {\n    var source = d as PanelToolbarTray;\n    bool visible = (bool)e.NewValue;\n    source.DuplicateButton.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;\n  }\n\n  private static void OnHasHelpButtonPropertyChanged(DependencyObject d,\n                                                     DependencyPropertyChangedEventArgs e) {\n    var source = d as PanelToolbarTray;\n    bool visible = (bool)e.NewValue;\n    source.HelpButton.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.RemoveToolbarOverflowButton(sender as ToolBar);\n  }\n\n  private void PinButton_Checked(object sender, RoutedEventArgs e) {\n    PinnedChanged?.Invoke(this, new PinEventArgs {IsPinned = true});\n  }\n\n  private void PinButton_Unchecked(object sender, RoutedEventArgs e) {\n    PinnedChanged?.Invoke(this, new PinEventArgs {IsPinned = false});\n  }\n\n  private void SettingsButton_Click(object sender, RoutedEventArgs e) {\n    // If popup was active when the click started, ignore it since\n    // the user most likely wants to close the popup panel.\n    if (!registerLeftButtonDown_) {\n      registerLeftButtonDown_ = false;\n      return;\n    }\n\n    registerLeftButtonDown_ = false;\n    SettingsClicked?.Invoke(this, EventArgs.Empty);\n  }\n\n  private void HelpButton_Click(object sender, RoutedEventArgs e) {\n    // If popup was active when the click started, ignore it since\n    // the user most likely wants to close the popup panel.\n    if (!registerLeftButtonDown_) {\n      registerLeftButtonDown_ = false;\n      return;\n    }\n\n    registerLeftButtonDown_ = false;\n    HelpClicked?.Invoke(this, EventArgs.Empty);\n  }\n\n  private void DuplicateMenu_Click(object sender, RoutedEventArgs e) {\n    DuplicateClicked?.Invoke(this, new DuplicateEventArgs {Kind = DuplicatePanelKind.SameSet});\n  }\n\n  private void DuplicateLeftMenu_Click(object sender, RoutedEventArgs e) {\n    DuplicateClicked?.Invoke(\n      this, new DuplicateEventArgs {Kind = DuplicatePanelKind.NewSetDockedLeft});\n  }\n\n  private void DuplicateRightMenu_Click(object sender, RoutedEventArgs e) {\n    DuplicateClicked?.Invoke(\n      this, new DuplicateEventArgs {Kind = DuplicatePanelKind.NewSetDockedRight});\n  }\n\n  private void DuplicateFloatingMenu_Click(object sender, RoutedEventArgs e) {\n    DuplicateClicked?.Invoke(this, new DuplicateEventArgs {Kind = DuplicatePanelKind.Floating});\n  }\n\n  private void SettingsButton_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    // This is a workaround for the way clicks on the options icon are handled by WPF\n    // when the popup panel is active. The user most likely wants to close the popup\n    // by clicking again on the icon, but instead the popup closes and immediately opens again.\n    //\n    // - When the button is clicked, it Opens the popup.\n    // - When the button is clicked again, the button raises the MouseDown event\n    //   and the Popup closes on that event.\n    // - Afterwards the Clicked event is raised, but since the Popup is already closed,\n    //   it will open it again, thus causing for the Popup to be closed & opened immediately.\n    //\n    // The MouseLeftButtonDown is not triggered when the popup is active.\n    registerLeftButtonDown_ = true;\n  }\n\n  private void ToolBar_OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) {\n    Utils.RemoveToolbarOverflowButton(sender as ToolBar);\n  }\n\n  private void ToolBar_OnSizeChanged(object sender, SizeChangedEventArgs e) {\n    Utils.RemoveToolbarOverflowButton(sender as ToolBar);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ResizeGrip.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Controls.ResizeGrip\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n\n\n  <Thumb\n    Margin=\"0,0,1,1\"\n    VerticalAlignment=\"Bottom\"\n    DockPanel.Dock=\"Right\"\n    DragCompleted=\"OnResizeThumbDragCompleted\"\n    DragDelta=\"OnResizeThumbDragDelta\"\n    DragStarted=\"OnResizeThumbDragStarted\">\n    <Thumb.Style>\n      <Style\n        BasedOn=\"{x:Null}\"\n        TargetType=\"{x:Type Thumb}\">\n        <Style.Setters>\n          <Setter Property=\"Template\">\n            <Setter.Value>\n              <ControlTemplate>\n                <Grid\n                  x:Name=\"resizeVisual\"\n                  VerticalAlignment=\"Bottom\"\n                  Background=\"Transparent\"\n                  DockPanel.Dock=\"Right\"\n                  IsHitTestVisible=\"True\">\n                  <Line\n                    Stroke=\"{TemplateBinding Foreground}\"\n                    StrokeThickness=\"1.5\"\n                    X1=\"6\"\n                    X2=\"18\"\n                    Y1=\"18\"\n                    Y2=\"6\" />\n                  <!--  smallest/right|bottom most  -->\n                  <Line\n                    Stroke=\"{TemplateBinding Foreground}\"\n                    StrokeThickness=\"1.5\"\n                    X1=\"10\"\n                    X2=\"18\"\n                    Y1=\"18\"\n                    Y2=\"10\" />\n                  <Line\n                    Stroke=\"{TemplateBinding Foreground}\"\n                    StrokeThickness=\"1.5\"\n                    X1=\"14\"\n                    X2=\"18\"\n                    Y1=\"18\"\n                    Y2=\"14\" />\n                  <!--  longers/left|top most  -->\n                  <Grid.Style>\n                    <Style TargetType=\"{x:Type Grid}\">\n                      <Style.Triggers>\n                        <Trigger Property=\"IsMouseOver\" Value=\"True\">\n                          <Setter Property=\"Cursor\" Value=\"SizeNWSE\" />\n                        </Trigger>\n                      </Style.Triggers>\n                    </Style>\n                  </Grid.Style>\n                </Grid>\n              </ControlTemplate>\n            </Setter.Value>\n          </Setter>\n        </Style.Setters>\n      </Style>\n    </Thumb.Style>\n  </Thumb>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/ResizeGrip.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI.Controls;\n\npublic partial class ResizeGrip : UserControl {\n  private Cursor cursor_;\n  private FrameworkElement control_;\n\n  public ResizeGrip() {\n    InitializeComponent();\n  }\n\n  public FrameworkElement ResizedControl { get => control_; set => control_ = value; }\n\n  private void OnResizeThumbDragStarted(object sender, DragStartedEventArgs e) {\n    // Disable min size constraints when manually resizing.\n    control_.MaxHeight = double.PositiveInfinity;\n    control_.MaxWidth = double.PositiveInfinity;\n    cursor_ = control_.Cursor;\n    Cursor = Cursors.SizeNWSE;\n  }\n\n  private void OnResizeThumbDragCompleted(object sender, DragCompletedEventArgs e) {\n    Cursor = cursor_;\n  }\n\n  private void OnResizeThumbDragDelta(object sender, DragDeltaEventArgs e) {\n    double yAdjust = control_.Height + e.VerticalChange;\n    double xAdjust = control_.Width + e.HorizontalChange;\n\n    xAdjust = control_.ActualWidth + xAdjust > control_.MinWidth ? xAdjust : control_.MinWidth;\n    yAdjust = control_.ActualHeight + yAdjust > control_.MinHeight ? yAdjust : control_.MinHeight;\n\n    control_.Width = xAdjust;\n    control_.Height = yAdjust;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/WebViewPopup.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.Controls.WebViewPopup\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:wv2=\"clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  AllowsTransparency=\"True\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </controls:DraggablePopup.LayoutTransform>\n\n  <Border\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <Grid>\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"20\" />\n        <ColumnDefinition Width=\"20\" />\n      </Grid.ColumnDefinitions>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"20\" />\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n\n      <Grid\n        x:Name=\"ToolbarPanel\"\n        Grid.Row=\"0\"\n        Grid.Column=\"0\"\n        Grid.ColumnSpan=\"3\"\n        Background=\"{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}\">\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FontWeight=\"Medium\"\n          Text=\"{Binding PanelTitle}\" />\n      </Grid>\n      <Button\n        x:Name=\"CloseButton\"\n        Grid.Row=\"0\"\n        Grid.Column=\"2\"\n        Background=\"{x:Null}\"\n        BorderBrush=\"{x:Null}\"\n        Click=\"CloseButton_Click\"\n        ToolTip=\"Close query panel\">\n        <Image\n          Width=\"16\"\n          Height=\"16\"\n          Source=\"{StaticResource CloseIcon}\" />\n      </Button>\n\n      <wv2:WebView2\n        x:Name=\"Browser\"\n        Grid.Row=\"1\"\n        Grid.ColumnSpan=\"3\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        DockPanel.Dock=\"Bottom\" />\n      <controls:ResizeGrip\n        x:Name=\"PanelResizeGrip\"\n        Grid.Row=\"1\"\n        Grid.Column=\"2\"\n        Width=\"16\"\n        Height=\"16\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Bottom\"\n        Panel.ZIndex=\"100\" />\n\n    </Grid>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/Controls/WebViewPopup.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI.Controls;\n\npublic partial class WebViewPopup : DraggablePopup, INotifyPropertyChanged {\n  private string panelTitle_;\n\n  public WebViewPopup(Point position, double width, double height,\n                      UIElement referenceElement) {\n    InitializeComponent();\n    Initialize(position, width, height, referenceElement);\n    PanelResizeGrip.ResizedControl = this;\n    DataContext = this;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public string PanelTitle {\n    get => panelTitle_;\n    set {\n      if (panelTitle_ != value) {\n        panelTitle_ = value;\n        OnPropertyChange(nameof(PanelTitle));\n      }\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public async Task NavigateToURL(string url) {\n    Browser.Source = new Uri(url);\n  }\n\n  public override bool ShouldStartDragging(MouseButtonEventArgs e) {\n    if (e.LeftButton == MouseButtonState.Pressed && ToolbarPanel.IsMouseOver) {\n      if (!IsDetached) {\n        DetachPopup();\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  private void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    ClosePopup();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Converters.xaml",
    "content": "﻿<ResourceDictionary\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:utils=\"clr-namespace:ProfileExplorer.UI\">\n\n  <utils:BoolToVisibilityConverter\n    x:Key=\"BoolToVisibilityConverter\"\n    False=\"Collapsed\"\n    True=\"Visible\" />\n  <utils:BoolToVisibilityConverter\n    x:Key=\"InvertedBoolToVisibilityConverter\"\n    False=\"Visible\"\n    True=\"Collapsed\" />\n  <utils:EnumBooleanConverter x:Key=\"EnumToBoolConverter\" />\n  <utils:BoolToParameterConverter x:Key=\"BooToParameter\" />\n  <utils:DoubleScalingConverter x:Key=\"DoubleScalingConverter\" />\n  <utils:DoubleScalingBoundConverter x:Key=\"DoubleScalingBoundConverter\" />\n  <utils:DoubleDiffScalingBoundConverter x:Key=\"DoubleDiffScalingBoundConverter\" />\n  <utils:TreeViewLineConverter x:Key=\"LineConverter\" />\n  <utils:ColorBrushOpacityConverter x:Key=\"ColorBrushOpacityConverter\" />\n  <utils:MillisecondTimeConverter x:Key=\"MillisecondTimeConverter\" />\n  <utils:SecondTimeConverter x:Key=\"SecondTimeConverter\" />\n  <utils:PercentageConverter x:Key=\"PercentageConverter\" />\n  <utils:ExclusivePercentageConverter x:Key=\"ExclusivePercentageConverter\" />\n  <utils:RoundedPercentageConverter x:Key=\"RoundedPercentageConverter\" />\n  <utils:ListToStringConverter x:Key=\"StringListConverter\" />\n  <utils:ListPairToStringConverter x:Key=\"StringListPairConverter\" />\n  <utils:DictionaryToStringConverter x:Key=\"StringDictionaryConverter\" />\n  <utils:PerformanceCounterListConverter x:Key=\"PerformanceCounterConverter\" />\n  <utils:InvertedBooleanConverter x:Key=\"InvertedBoolConverter\" />\n  <utils:ProfileCallTreeNodeKindConverter x:Key=\"CallTreeNodeKindConverter\" />\n  <utils:ColorPaletteConverter x:Key=\"ColorPaletteConverter\" />\n  <utils:AlternateRowConverter x:Key=\"AlternateRowConverter\" />\n  <utils:FunctionNameConverter x:Key=\"FunctionNameConverter\" />\n  <utils:LongFunctionNameConverter x:Key=\"LongFunctionNameConverter\" />\n  <utils:StringFormatConverter x:Key=\"StringFormatConverter\" />\n</ResourceDictionary>"
  },
  {
    "path": "src/ProfileExplorerUI/Diff/DocumentDiffUpdater.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing DiffPlex.DiffBuilder.Model;\nusing ICSharpCode.AvalonEdit.Document;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Document.Renderers.Highlighters;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.Diff;\n\npublic class DiffStatistics {\n  public int LinesAdded { get; set; }\n  public int LinesDeleted { get; set; }\n  public int LinesModified { get; set; }\n\n  public override string ToString() {\n    if (LinesAdded == 0 && LinesDeleted == 0 && LinesModified == 0) {\n      return \"0 diffs\";\n    }\n\n    return $\"A {LinesAdded}, D {LinesDeleted}, M {LinesModified}\";\n  }\n}\n\npublic class DocumentDiffUpdater {\n  private const char RemovedDiffLineChar = ' ';\n  private const char AddedDiffLineChar = ' ';\n  private ICompilerInfoProvider compilerInfo_;\n  private DiffSettings settings_;\n  private IDiffOutputFilter diffFilter_;\n  private char[] ignoredDiffLetters_;\n\n  public DocumentDiffUpdater(IDiffOutputFilter diffFilter, DiffSettings settings,\n                             ICompilerInfoProvider compilerInfo) {\n    diffFilter_ = diffFilter;\n    settings_ = settings;\n    compilerInfo_ = compilerInfo;\n    ignoredDiffLetters_ = diffFilter_.IgnoredDiffLetters;\n  }\n\n  public DiffMarkingResult CreateNoDiffDocument(string text) {\n    var document = new TextDocument(new StringTextSource(text));\n    document.SetOwnerThread(Thread.CurrentThread);\n\n    var result = new DiffMarkingResult(document);\n    result.DiffText = text;\n\n    document.SetOwnerThread(null);\n    return result;\n  }\n\n  public DiffMarkingResult MarkDiffs(string text, string otherText,\n                                     DiffPaneModel diff, DiffPaneModel otherDiff,\n                                     bool isRightDoc, FilteredDiffInput filteredInput,\n                                     DiffStatistics diffStats,\n                                     bool markRightDocDeletion = false) {\n    // Create a new text document and associate it with the task worker.\n    var document = new TextDocument(new StringTextSource(text));\n    document.SetOwnerThread(Thread.CurrentThread);\n\n    var result = new DiffMarkingResult(document);\n    int lineCount = diff.Lines.Count;\n    int lineAdjustment = 0;\n\n    for (int lineIndex = 0; lineIndex < lineCount; lineIndex++) {\n      var line = diff.Lines[lineIndex];\n\n      switch (line.Type) {\n        case ChangeType.Unchanged: {\n          break; // Ignore.\n        }\n        case ChangeType.Inserted: {\n          int actualLine = line.Position.Value + lineAdjustment;\n          int offset;\n\n          if (actualLine >= document.LineCount) {\n            offset = document.TextLength;\n          }\n          else {\n            offset = document.GetOffset(actualLine, 0);\n          }\n\n          document.Insert(offset, line.Text + Environment.NewLine);\n          AppendInsertionChange(diffStats, result, line, offset);\n          break;\n        }\n        case ChangeType.Deleted: {\n          int actualLine = line.Position.Value + lineAdjustment;\n          var docLine = document.GetLineByNumber(Math.Min(document.LineCount, actualLine));\n\n          AppendDeletionChange(diffStats, result, docLine);\n          break;\n        }\n        case ChangeType.Imaginary: {\n          int docLineIndex = lineIndex + 1;\n\n          if (isRightDoc) {\n            // Mark the lines that have been removed on the right side.\n            if (docLineIndex <= document.LineCount) {\n              var docLine = document.GetLineByNumber(docLineIndex);\n\n              if (markRightDocDeletion) {\n                // Show the actual text that has been deleted.\n                result.DiffSegments.Add(\n                  new DiffTextSegment(DiffKind.Deletion, docLine.Offset, docLine.Length));\n              }\n              else {\n                document.Replace(docLine.Offset, docLine.Length,\n                                 new string(RemovedDiffLineChar, docLine.Length));\n                result.DiffSegments.Add(new DiffTextSegment(DiffKind.Placeholder, docLine.Offset, docLine.Length));\n              }\n            }\n          }\n          else {\n            // Add a placeholder in the left side to mark\n            // the lines inserted on the right side.\n            int offset = docLineIndex <= document.LineCount\n              ? document.GetOffset(docLineIndex, 0)\n              : document.TextLength;\n\n            string imaginaryText = new(AddedDiffLineChar, otherDiff.Lines[lineIndex].Text.Length);\n\n            document.Insert(offset, imaginaryText + Environment.NewLine);\n            result.DiffSegments.Add(new DiffTextSegment(DiffKind.Placeholder, offset,\n                                                        imaginaryText.Length));\n          }\n\n          lineAdjustment++;\n          break;\n        }\n        case ChangeType.Modified: {\n          MarkLineModificationDiffs(line, lineIndex, lineAdjustment,\n                                    document, isRightDoc, otherDiff,\n                                    result, diffStats);\n\n          break;\n        }\n        default:\n          throw new ArgumentOutOfRangeException();\n      }\n\n      // If the input text had parts replaced as a form of canonicalization,\n      // replace those with the original text.\n      if (filteredInput != null && line.Type != ChangeType.Imaginary) {\n        int filteredLine = lineIndex - lineAdjustment;\n        int docLineIndex = lineIndex + 1;\n\n        if (filteredLine < filteredInput.LineReplacements.Count &&\n            docLineIndex <= document.LineCount) {\n          var replacements = filteredInput.LineReplacements[filteredLine];\n          var docLine = document.GetLineByNumber(docLineIndex);\n\n          foreach (var replacement in replacements) {\n            int docLineOffset = docLine.Offset + replacement.Offset;\n\n            if (docLineOffset + replacement.Length < document.TextLength) {\n              document.Replace(docLineOffset, replacement.Length, replacement.Original);\n            }\n          }\n        }\n      }\n    }\n\n    result.DiffText = document.Text;\n    document.SetOwnerThread(null);\n    return result;\n  }\n\n  public async Task ReparseDiffedFunction(DiffMarkingResult diffResult,\n                                          IRTextSection originalSection, ILoadedDocument loadedDoc) {\n    try {\n      var errorHandler = compilerInfo_.IR.CreateParsingErrorHandler();\n      var sectionParser = compilerInfo_.IR.CreateSectionParser(errorHandler);\n      diffResult.DiffFunction = sectionParser.ParseSection(originalSection, diffResult.DiffText);\n\n      if (diffResult.DiffFunction != null) {\n        await compilerInfo_.AnalyzeLoadedFunction(diffResult.DiffFunction, originalSection, loadedDoc);\n      }\n      else {\n        Trace.TraceWarning(\"Failed re-parsing diffed section\\n\");\n      }\n\n      if (errorHandler.HadParsingErrors) {\n        Trace.TraceWarning(\"Errors while re-parsing diffed section:\\n\");\n\n        if (errorHandler.ParsingErrors != null) {\n          foreach (var error in errorHandler.ParsingErrors) {\n            Trace.TraceWarning($\"  - {error}\");\n          }\n        }\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Crashed while re-parsing diffed section: {ex}\");\n      diffResult.DiffFunction = new FunctionIR();\n    }\n  }\n\n  private void MarkLineModificationDiffs(DiffPiece line, int lineIndex, int lineAdjustment,\n                                         TextDocument document, bool isRightDoc,\n                                         DiffPaneModel otherDiff, DiffMarkingResult result,\n                                         DiffStatistics diffStats) {\n    int actualLine = line.Position.Value + lineAdjustment;\n    int lineChanges = 0;\n    int lineLength = 0;\n    bool wholeLineReplaced = false;\n\n    if (actualLine < document.LineCount) {\n      // Use the modified line instead; below the segments\n      // of the line that were changed (the sub-pieces) are marked.\n      var docLine = document.GetLineByNumber(actualLine);\n      document.Replace(docLine.Offset, docLine.Length, line.Text);\n      wholeLineReplaced = true;\n      lineLength = docLine.Length;\n    }\n\n    var modifiedSegments = new List<DiffTextSegment>();\n    int column = 0;\n    int otherColumn = 0;\n\n    //? TODO: This is an ugly hack to get the two piece lists aligned\n    //? for Beyond Compare in case there is a word inserted at the line start\n    //? like in \"r t100\" vs \"  t100\" - the BC diff builder should match DiffPlex\n    //? and insert a dummy whitespace diff corresponding to \"r\" instead two whitespaces in \"  t100\",\n    //? which would create the same number of diffs on both sides\n    var pieces = line.SubPieces;\n    var otherPieces = otherDiff.Lines[lineIndex].SubPieces;\n    int pieceIndexAdjustment = 0;\n\n    if (pieces[0].Type != otherPieces[0].Type) {\n      if (isRightDoc) {\n        if (otherPieces.Count > 1 &&\n            otherPieces[1].Type == pieces[0].Type &&\n            pieces[0].Text.EndsWith(otherPieces[1].Text)) {\n          otherColumn += otherPieces[0].Text.Length;\n          pieceIndexAdjustment = 1;\n        }\n      }\n      else {\n        if (pieces.Count > 1 &&\n            otherPieces[0].Type == pieces[1].Type &&\n            otherPieces[0].Text.EndsWith(pieces[1].Text)) {\n          pieceIndexAdjustment = -1;\n        }\n      }\n    }\n\n    foreach (var piece in line.SubPieces) {\n      switch (piece.Type) {\n        case ChangeType.Inserted: {\n          Debug.Assert(isRightDoc);\n\n          int offset = actualLine >= document.LineCount\n            ? document.TextLength\n            : document.GetOffset(actualLine, 0) + column;\n\n          if (offset >= document.TextLength) {\n            // Text inserted at the end of the line and document.\n            if (!wholeLineReplaced) {\n              document.Insert(document.TextLength, piece.Text);\n            }\n\n            if (IsSignifficantDiff(piece)) {\n              modifiedSegments.Add(new DiffTextSegment(DiffKind.Modification,\n                                                       offset, piece.Text.Length));\n            }\n          }\n          else {\n            // Check if this insertion has an equivalent deletion on the other side.\n            // If it does, try to mark it as a modification.\n            var diffKind = DiffKind.Insertion;\n            var otherPiece = FindPieceInOtherDocument(otherDiff, lineIndex, piece, pieceIndexAdjustment);\n\n            if (otherPiece != null && otherPiece.Type == ChangeType.Deleted) {\n              if (!wholeLineReplaced) {\n                document.Replace(offset, otherPiece.Text.Length, piece.Text);\n              }\n\n              if (wholeLineReplaced) {\n                string diffLine = line.Text;\n                string otherDiffLine = otherDiff.Lines[lineIndex].Text;\n                int otherPieceOffset = otherColumn;\n                int pieceOffset = column;\n                diffKind = EstimateModificationType(piece, otherPiece,\n                                                    pieceOffset, otherPieceOffset,\n                                                    diffLine, otherDiffLine);\n              }\n            }\n            else {\n              // Try again to find a piece that matches the same offset.\n              otherPiece = FindOverlappingPieceInOtherDocument(otherDiff, lineIndex, column);\n\n              if (otherPiece != null && otherPiece.Type == ChangeType.Unchanged) {\n                if (!wholeLineReplaced) {\n                  document.Replace(offset, otherPiece.Text.Length, piece.Text);\n                }\n\n                string diffLine = line.Text;\n                string otherDiffLine = otherDiff.Lines[lineIndex].Text;\n                int otherPieceOffset = column;\n                int pieceOffset = column;\n                diffKind = EstimateModificationType(piece, otherPiece,\n                                                    pieceOffset, otherPieceOffset,\n                                                    diffLine, otherDiffLine);\n              }\n              else if (!wholeLineReplaced) {\n                document.Insert(offset, piece.Text);\n              }\n            }\n\n            if (otherPiece != null) {\n              otherColumn += otherPiece.Text.Length;\n            }\n\n            if (IsSignifficantDiff(piece)) {\n              var filteredPiece = diffFilter_.AdjustChange(piece, offset, column, line.Text);\n              AppendModificationChange(modifiedSegments, diffKind, filteredPiece);\n            }\n          }\n\n          break;\n        }\n        case ChangeType.Deleted: {\n          Debug.Assert(!isRightDoc);\n\n          int offset = actualLine >= document.LineCount\n            ? document.TextLength\n            : document.GetOffset(actualLine, 0) + column;\n\n          // Check if this deletion has an equivalent insertion on the other side.\n          // If it does, try to mark it as a modification.\n          var diffKind = DiffKind.Deletion;\n          var otherPiece = FindPieceInOtherDocument(otherDiff, lineIndex, piece, pieceIndexAdjustment);\n\n          if (otherPiece != null && otherPiece.Type == ChangeType.Inserted) {\n            if (wholeLineReplaced) {\n              string diffLine = line.Text;\n              string otherDiffLine = otherDiff.Lines[lineIndex].Text;\n              int otherPieceOffset = otherColumn;\n              int pieceOffset = column;\n              diffKind = EstimateModificationType(piece, otherPiece,\n                                                  pieceOffset, otherPieceOffset,\n                                                  diffLine, otherDiffLine);\n            }\n          }\n          //else {\n          //    otherPiece = FindOverlappingPieceInOtherDocument(otherDiff, lineIndex, column);\n\n          //    if (otherPiece != null && otherPiece.Type == ChangeType.Unchanged) {\n          //        var diffLine = line.Text;\n          //        var otherDiffLine = otherDiff.Lines[lineIndex].Text;\n          //        int otherPieceOffset = column;\n          //        int pieceOffset = column;\n          //        diffKind = EstimateModificationType(piece, otherPiece,\n          //                                            pieceOffset, otherPieceOffset,\n          //                                            diffLine, otherDiffLine);\n          //    }\n          //}\n\n          if (IsSignifficantDiff(piece)) {\n            var filteredPiece = diffFilter_.AdjustChange(piece, offset, column, line.Text);\n            AppendModificationChange(modifiedSegments, diffKind, filteredPiece);\n          }\n\n          if (otherPiece != null) {\n            otherColumn += otherPiece.Text.Length;\n          }\n\n          break;\n        }\n        case ChangeType.Modified:\n        case ChangeType.Imaginary: {\n          break; // Nothing to do here.\n        }\n        case ChangeType.Unchanged: {\n          if (!wholeLineReplaced && actualLine < document.LineCount) {\n            int offset = document.GetOffset(actualLine, 0) + column;\n            document.Replace(offset, piece.Text.Length, piece.Text);\n          }\n\n          var otherPiece = FindPieceInOtherDocument(otherDiff, lineIndex, piece, 0);\n\n          if (otherPiece != null) {\n            otherColumn += piece.Text.Length;\n          }\n\n          break;\n        }\n        default:\n          throw new ArgumentOutOfRangeException(\"Unexpected change type!\");\n      }\n\n      // Adjust the current column in the document.\n      if (piece.Text != null) {\n        column += piece.Text.Length;\n\n        if (piece.Type != ChangeType.Unchanged) {\n          lineChanges += piece.Text.Length;\n        }\n      }\n    }\n\n    // If most of the line changed, mark the entire line,\n    // otherwise mark each sub-piece.\n    if (settings_.ManyDiffsMarkWholeLine) {\n      double percentChanged = 0;\n\n      if (lineLength > 0) {\n        percentChanged = lineChanges / (double)lineLength * 100;\n      }\n\n      if (percentChanged > settings_.ManyDiffsModificationPercentage) {\n        if (actualLine < document.LineCount) {\n          var docLine = document.GetLineByNumber(actualLine);\n          var changeKind = DiffKind.Modification;\n\n          // If even more of the line changed, consider it an insertion/deletion.\n          if (percentChanged > settings_.ManyDiffsInsertionPercentage) {\n            changeKind = isRightDoc ? DiffKind.Insertion : DiffKind.Deletion;\n          }\n\n          AppendChange(changeKind, docLine.Offset, docLine.Length, result);\n          return;\n        }\n      }\n    }\n\n    foreach (var segment in modifiedSegments) {\n      AppendChange(segment, result);\n    }\n\n    if (isRightDoc) {\n      diffStats.LinesModified++;\n    }\n  }\n\n  private void AppendChange(DiffKind kind, int offset, int length, DiffMarkingResult result) {\n    AppendChange(new DiffTextSegment(kind, offset, length), result);\n  }\n\n  private void AppendChange(DiffTextSegment segment, DiffMarkingResult result) {\n    bool accepted = false;\n\n    switch (segment.Kind) {\n      case DiffKind.Insertion: {\n        accepted = settings_.ShowInsertions;\n        break;\n      }\n      case DiffKind.Deletion: {\n        accepted = settings_.ShowDeletions;\n        break;\n      }\n      case DiffKind.Modification: {\n        accepted = settings_.ShowModifications;\n        break;\n      }\n      case DiffKind.MinorModification: {\n        accepted = settings_.ShowMinorModifications;\n        break;\n      }\n    }\n\n    if (accepted) {\n      result.DiffSegments.Add(segment);\n    }\n  }\n\n  private void AppendInsertionChange(DiffStatistics diffStats, DiffMarkingResult result,\n                                     DiffPiece line, int offset) {\n    AppendChange(DiffKind.Insertion, offset, line.Text.Length, result);\n    diffStats.LinesAdded++;\n  }\n\n  private void AppendDeletionChange(DiffStatistics diffStats, DiffMarkingResult result,\n                                    DocumentLine docLine) {\n    AppendChange(DiffKind.Deletion, docLine.Offset, docLine.Length, result);\n    diffStats.LinesDeleted++;\n  }\n\n  private void AppendModificationChange(List<DiffTextSegment> modifiedSegments,\n                                        DiffKind diffKind, AdjustedDiffPiece filteredPiece) {\n    // With modifications that are expanded, it's possible to have two diffs\n    // be expanded to the same text range - in that case keep the initial segment.\n    if (modifiedSegments.Count > 0) {\n      var lastSegment = modifiedSegments[^1];\n\n      if (lastSegment.StartOffset == filteredPiece.Offset &&\n          lastSegment.Length == filteredPiece.Length) {\n        return;\n      }\n    }\n\n    modifiedSegments.Add(new DiffTextSegment(diffKind, filteredPiece.Offset,\n                                             filteredPiece.Length));\n  }\n\n  private DiffPiece FindPieceInOtherDocument(DiffPaneModel otherDiff, int lineIndex,\n                                             DiffPiece piece, int piecePossitionOffset) {\n    if (lineIndex < otherDiff.Lines.Count) {\n      var otherLine = otherDiff.Lines[lineIndex];\n      int position = piece.Position.Value + piecePossitionOffset;\n\n      if (position > 0 && position <= otherLine.SubPieces.Count) {\n        var result = otherLine.SubPieces[position - 1];\n        return !string.IsNullOrEmpty(result.Text) ? result : null;\n      }\n    }\n\n    return null;\n  }\n\n  private DiffPiece FindOverlappingPieceInOtherDocument(DiffPaneModel otherDiff,\n                                                        int lineIndex, int offset) {\n    if (lineIndex < otherDiff.Lines.Count) {\n      var otherLine = otherDiff.Lines[lineIndex];\n      int otherOffset = 0;\n\n      foreach (var piece in otherLine.SubPieces) {\n        if (!string.IsNullOrEmpty(piece.Text)) {\n          if (otherOffset <= offset &&\n              otherOffset + piece.Text.Length >= offset) {\n            return piece;\n          }\n\n          otherOffset += otherLine.Text.Length;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  private bool IsSignifficantDiff(DiffPiece piece, DiffPiece otherPiece = null) {\n    if (!settings_.FilterInsignificantDiffs) {\n      return true;\n    }\n\n    if (piece.Text == null) {\n      return false;\n    }\n\n    foreach (char letter in piece.Text) {\n      if (!char.IsWhiteSpace(letter) && Array.IndexOf(ignoredDiffLetters_, letter) == -1) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  private DiffKind EstimateModificationType(DiffPiece before, DiffPiece after,\n                                            int beforeOffset, int afterOffset,\n                                            string beforeDocumentText,\n                                            string afterDocumentText) {\n    if (!settings_.IdentifyMinorDiffs) {\n      return DiffKind.Modification;\n    }\n\n    return diffFilter_.EstimateModificationType(before, after, beforeOffset, afterOffset,\n                                                beforeDocumentText, afterDocumentText);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/ActionPanel.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Document.ActionPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  mc:Ignorable=\"d\">\n  <Border\n    Height=\"22\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <StackPanel\n      Background=\"{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}\"\n      Orientation=\"Horizontal\">\n      <Image\n        Width=\"16\"\n        Height=\"16\"\n        Margin=\"2,0,2,0\"\n        Source=\"{StaticResource QueryIcon}\"\n        Visibility=\"{Binding HasActionButtons, Converter={StaticResource BoolToVisibilityConverter}}\" />\n      <ItemsControl x:Name=\"ActionButtonsPanel\">\n        <ItemsControl.ItemTemplate>\n          <DataTemplate>\n            <Button\n              Width=\"20\"\n              Padding=\"0,0,0,2\"\n              HorizontalContentAlignment=\"Center\"\n              VerticalContentAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}\"\n              BorderThickness=\"0,0,1,0\"\n              Click=\"ActionButton_Click\"\n              Content=\"{Binding Name}\"\n              FontSize=\"14\"\n              FontWeight=\"Medium\"\n              ToolTip=\"Select element as query input value #N\" />\n          </DataTemplate>\n        </ItemsControl.ItemTemplate>\n        <ItemsControl.ItemsPanel>\n          <ItemsPanelTemplate>\n            <StackPanel Orientation=\"Horizontal\" />\n          </ItemsPanelTemplate>\n        </ItemsControl.ItemsPanel>\n      </ItemsControl>\n      <Button\n        x:Name=\"RemarkButton\"\n        Width=\"Auto\"\n        Height=\"Auto\"\n        Padding=\"2,2,2,2\"\n        Background=\"{DynamicResource {x:Static SystemColors.InfoBrushKey}}\"\n        BorderThickness=\"0\"\n        Click=\"RemarkButton_Click\"\n        Visibility=\"{Binding ShowRemarksButton, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"14\"\n            Height=\"14\"\n            Margin=\"0,0,2,0\"\n            Source=\"{StaticResource RemarkIcon}\" />\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Margin=\"-2,0,0,0\"\n            Source=\"{StaticResource DownArrowIcon}\" />\n        </StackPanel>\n      </Button>\n    </StackPanel>\n\n  </Border>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Document/ActionPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic class ActionPanelButton {\n  public ActionPanelButton(string name, object tag = null) {\n    Name = name;\n    Tag = tag;\n  }\n\n  public string Name { get; set; }\n  public object Tag { get; set; }\n}\n\npublic partial class ActionPanel : UserControl, INotifyPropertyChanged {\n  private ObservableCollectionRefresh<ActionPanelButton> buttons_;\n  private bool showRemarksButton_;\n\n  public ActionPanel() {\n    InitializeComponent();\n    DataContext = this;\n\n    buttons_ = new ObservableCollectionRefresh<ActionPanelButton>();\n    ActionButtonsPanel.ItemsSource = buttons_;\n  }\n\n  public bool ShowRemarksButton {\n    get => showRemarksButton_;\n    set {\n      if (showRemarksButton_ != value) {\n        showRemarksButton_ = value;\n        OnPropertyChange(nameof(ShowRemarksButton));\n      }\n    }\n  }\n\n  public bool HasActionButtons => buttons_.Count > 0;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler RemarksButtonClicked;\n  public event EventHandler<ActionPanelButton> ActionButtonClicked;\n\n  public ActionPanelButton AddActionButton(string name, object tag = null) {\n    var button = new ActionPanelButton(name, tag);\n    buttons_.Add(button);\n    OnPropertyChange(nameof(HasActionButtons));\n    return button;\n  }\n\n  public void ClearActionButtons() {\n    buttons_.Clear();\n    OnPropertyChange(nameof(HasActionButtons));\n  }\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void ActionButton_Click(object sender, RoutedEventArgs e) {\n    var button = (ActionPanelButton)((Button)sender).DataContext;\n    ActionButtonClicked?.Invoke(this, button);\n  }\n\n  private void RemarkButton_Click(object sender, RoutedEventArgs e) {\n    RemarksButtonClicked?.Invoke(this, e);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/BasicBlockFoldingStrategy.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic interface IBlockFoldingStrategy {\n  public void UpdateFoldings(FoldingManager manager, TextDocument document);\n}\n\npublic sealed class BasicBlockFoldingStrategy : IBlockFoldingStrategy {\n  private FunctionIR function_;\n\n  public BasicBlockFoldingStrategy(FunctionIR function) {\n    function_ = function;\n  }\n\n  public void UpdateFoldings(FoldingManager manager, TextDocument document) {\n    var newFoldings = CreateNewFoldings(document, out int firstErrorOffset);\n    manager.UpdateFoldings(newFoldings, firstErrorOffset);\n  }\n\n  private IEnumerable<NewFolding> CreateNewFoldings(TextDocument document, out int firstErrorOffset) {\n    firstErrorOffset = -1;\n    return CreateNewFoldings(document);\n  }\n\n  private IEnumerable<NewFolding> CreateNewFoldings(ITextSource document) {\n    var newFoldings = new List<NewFolding>(function_.Blocks.Count);\n\n    if (function_.Blocks.Count == 0) {\n      return newFoldings;\n    }\n\n    BlockIR lastBlock = null;\n    int lastOffset = 0;\n    int textLength = document.TextLength;\n\n    foreach (var block in function_.Blocks) {\n      int offset = block.TextLocation.Offset;\n      int foldingLength = offset - lastOffset;\n\n      if (lastBlock != null && foldingLength > 1) {\n        //? TODO: This seems to be a bug with diff mode\n        int endOffset = Math.Min(offset, textLength - 1);\n\n        if (endOffset > lastOffset) {\n          newFoldings.Add(new NewFolding(lastOffset, endOffset - 2));\n        }\n      }\n\n      lastOffset = offset;\n      lastBlock = block;\n    }\n\n    // Handle the last block.\n    if (lastOffset < textLength - 1) {\n      int endOffset = Math.Min(lastOffset + function_.Blocks[^1].TextLength, textLength - 1);\n\n      if (endOffset > lastOffset) {\n        newFoldings.Add(new NewFolding(lastOffset, endOffset - 2));\n      }\n    }\n\n    return newFoldings;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/BasicBlockFoldingStrategyProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Providers;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic class BasicBlockFoldingStrategyProvider : IBlockFoldingStrategyProvider {\n  public IBlockFoldingStrategy CreateFoldingStrategy(FunctionIR function) {\n    return new BasicBlockFoldingStrategy(function);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/DocumentAction.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic enum DocumentActionKind {\n  SelectElement,\n  MarkElement,\n  MarkBlock,\n  GoToDefinition,\n  ShowReferences,\n  MarkReferences,\n  ShowUses,\n  MarkUses,\n  MarkExpression,\n  ClearMarker,\n  ClearAllMarkers,\n  ClearBlockMarkers,\n  ClearInstructionMarkers,\n  ClearTemporaryMarkers,\n  UndoAction,\n  VerticalScroll,\n  ShowExpressionGraph\n}\n\npublic class DocumentAction {\n  public DocumentAction(DocumentActionKind actionKind, IRElement element = null,\n                        object optionalData = null) {\n    ActionKind = actionKind;\n    Element = element;\n    OptionalData = optionalData;\n  }\n\n  public DocumentActionKind ActionKind { get; set; }\n  public IRElement Element { get; set; }\n  public object OptionalData { get; set; }\n\n  public DocumentAction WithNewElement(IRElement newElement) {\n    return new DocumentAction(ActionKind, newElement, OptionalData);\n  }\n\n  public override string ToString() {\n    return $\"action: {ActionKind}, element: {Element}\";\n  }\n}\n\npublic class MarkActionData {\n  public bool IsTemporary { get; set; }\n  public PairHighlightingStyle Style { get; set; }\n}\n\npublic class ReversibleDocumentAction {\n  public ReversibleDocumentAction(DocumentAction action, Action<DocumentAction> undoAction) {\n    Action = action;\n    UndoAction = undoAction;\n  }\n\n  public Action<DocumentAction> UndoAction { get; set; }\n  private DocumentAction Action { get; set; }\n\n  public void Undo() {\n    UndoAction?.Invoke(Action);\n  }\n\n  public override string ToString() {\n    return Action.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/DocumentExporting.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Web;\nusing System.Windows;\nusing ClosedXML.Excel;\nusing HtmlAgilityPack;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic static class DocumentExporting {\n  private static string ExcelFileFilter = \"Excel Worksheets|*.xlsx\";\n  private static string HtmlFileFilter = \"HTML file|*.html\";\n  private static string MarkdownFileFilter = \"Markdown file|*.md\";\n  private static string ExcelExtension = \"*.xlsx|All Files|*.*\";\n  private static string HtmlExtension = \"*.html|All Files|*.*\";\n  private static string MarkdownExtension = \"*.md|All Files|*.*\";\n\n  public static async Task ExportToExcelFile(IRDocument textView, Func<IRDocument, string, Task<bool>> saveAction) {\n    await ExportToFile(textView, ExcelFileFilter, ExcelExtension, saveAction);\n  }\n\n  public static async Task ExportToHtmlFile(IRDocument textView, Func<IRDocument, string, Task<bool>> saveAction) {\n    await ExportToFile(textView, HtmlFileFilter, HtmlExtension, saveAction);\n  }\n\n  public static async Task ExportToMarkdownFile(IRDocument textView, Func<IRDocument, string, Task<bool>> saveAction) {\n    await ExportToFile(textView, MarkdownFileFilter, MarkdownExtension, saveAction);\n  }\n\n  private static async Task ExportToFile(IRDocument textView, string fileFilter, string defaultExtension,\n                                         Func<IRDocument, string, Task<bool>> saveAction) {\n    string path = Utils.ShowSaveFileDialog(fileFilter, defaultExtension);\n    bool success = false;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        success = await saveAction(textView, path);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save function to {path}: {ex.Message}\");\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(textView);\n        MessageBox.Show($\"Failed to save list to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n\n  public static async Task ExportSourceToExcelFile(IRDocument textView,\n                                                    Func<int, int> toOriginalLineMapper,\n                                                    Func<int, int> fromOriginalLineMapper) {\n    string path = Utils.ShowSaveFileDialog(ExcelFileFilter, ExcelExtension);\n    bool success = false;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        success = await ExportSourceAsExcelFile(textView, path, toOriginalLineMapper, fromOriginalLineMapper);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save function to {path}: {ex.Message}\");\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(textView);\n        MessageBox.Show($\"Failed to save list to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n\n  public static async Task ExportSourceToHtmlFile(IRDocument textView,\n                                                  Func<int, int> toOriginalLineMapper,\n                                                  Func<int, int> fromOriginalLineMapper) {\n    string path = Utils.ShowSaveFileDialog(HtmlFileFilter, HtmlExtension);\n    bool success = false;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        success = await ExportSourceAsHtmlFile(textView, path, toOriginalLineMapper, fromOriginalLineMapper);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save function to {path}: {ex.Message}\");\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(textView);\n        MessageBox.Show($\"Failed to save list to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  public static async Task ExportSourceToMarkdownFile(IRDocument textView,\n                                                      Func<int, int> toOriginalLineMapper,\n                                                      Func<int, int> fromOriginalLineMapper) {\n    string path = Utils.ShowSaveFileDialog(MarkdownFileFilter, MarkdownExtension);\n    bool success = false;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        success = await ExportSourceAsMarkdownFile(textView, path, toOriginalLineMapper, fromOriginalLineMapper);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save function to {path}: {ex.Message}\");\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(textView);\n        MessageBox.Show($\"Failed to save list to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  public static async Task<bool> ExportSourceAsExcelFile(IRDocument textView, string filePath,\n                                                         Func<int, int> toOriginalLineMapper = null,\n                                                         Func<int, int> fromOriginalLineMapper = null) {\n    var function = textView.Section.ParentFunction;\n    (int firstSourceLineIndex, int lastSourceLineIndex) =\n      await DocumentUtils.FindFunctionSourceLineRange(function, textView);\n\n    if (firstSourceLineIndex == 0) {\n      return false;\n    }\n\n    var wb = new XLWorkbook();\n    var ws = wb.Worksheets.Add(\"Source\");\n    var columnData = textView.ProfileColumnData;\n    int rowId = 2; // First row is for the table column names.\n    int maxLineLength = 0;\n\n    for (int i = firstSourceLineIndex; i <= lastSourceLineIndex; i++) {\n      // Filter out instructions not in line range if requested.\n      int lineNumber = i;\n\n      if (fromOriginalLineMapper != null) {\n        // Map original source line to the one in the document,\n        // when inline assembly is being displayed.\n        lineNumber = fromOriginalLineMapper(lineNumber);\n\n        if (lineNumber == -1) {\n          continue;\n        }\n      }\n\n      var line = textView.Document.GetLineByNumber(lineNumber);\n      string text = textView.Document.GetText(line.Offset, line.Length);\n      ws.Cell(rowId, 1).Value = text;\n      ws.Cell(rowId, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;\n      maxLineLength = Math.Max(text.Length, maxLineLength);\n\n      ws.Cell(rowId, 2).Value = lineNumber;\n      ws.Cell(rowId, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;\n      ws.Cell(rowId, 2).Style.Font.FontColor = XLColor.DarkGreen;\n\n      if (columnData != null) {\n        IRElement tuple = null;\n        tuple = DocumentUtils.FindTupleOnSourceLine(lineNumber, textView);\n\n        if (tuple != null) {\n          columnData.ExportColumnsToExcel(tuple, ws, rowId, 3);\n        }\n      }\n\n      rowId++;\n    }\n\n    // Set the table header column names.\n    var firstCell = ws.Cell(1, 1);\n    var lastCell = ws.LastCellUsed();\n    var range = ws.Range(firstCell.Address, lastCell.Address);\n    var table = range.CreateTable();\n    table.Theme = XLTableTheme.None;\n\n    foreach (var cell in table.HeadersRow().Cells()) {\n      if (cell.Address.ColumnNumber == 1) {\n        cell.Value = \"Source\";\n      }\n      else if (cell.Address.ColumnNumber == 2) {\n        cell.Value = \"Line\";\n      }\n      else if (columnData != null && cell.Address.ColumnNumber - 3 < columnData.Columns.Count) {\n        cell.Value = columnData.Columns[cell.Address.ColumnNumber - 3].Title;\n      }\n\n      cell.Style.Font.Bold = true;\n      cell.Style.Fill.BackgroundColor = XLColor.LightGray;\n    }\n\n    // Adjust the width of the content column.\n    ws.Column(1).AdjustToContents((double)1, maxLineLength);\n\n    wb.SaveAs(filePath);\n    return true;\n  }\n\n  public static async Task<bool> ExportSourceAsHtmlFile(IRDocument textView, string filePath,\n                                                        Func<int, int> toOriginalLineMapper,\n                                                        Func<int, int> fromOriginalLineMapper) {\n    try {\n      Trace.WriteLine(\"ExportFunctionAsHtmlFile\");\n      var doc = new HtmlDocument();\n      string TitleStyle =\n        @\"text-align:left;font-family:Arial, sans-serif;font-weight:bold;font-size:16px;margin-top:0em\";\n\n      var p = doc.CreateElement(\"p\");\n      var function = textView.Section.ParentFunction;\n      string funcName = function.FormatFunctionName(textView.Session);\n      p.InnerHtml = $\"Function: {HttpUtility.HtmlEncode(funcName)}\";\n      p.SetAttributeValue(\"style\", TitleStyle);\n      doc.DocumentNode.AppendChild(p);\n\n      p = doc.CreateElement(\"p\");\n      p.InnerHtml = $\"Module: {HttpUtility.HtmlEncode(function.ModuleName)}\";\n      p.SetAttributeValue(\"style\", TitleStyle);\n      doc.DocumentNode.AppendChild(p);\n\n      var node = await ExportSourceAsHtml(textView, -1, -1, toOriginalLineMapper,\n                                          fromOriginalLineMapper);\n      doc.DocumentNode.AppendChild(node);\n      var writer = new StringWriter();\n      doc.Save(writer);\n      await File.WriteAllTextAsync(filePath, writer.ToString());\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to export to HTML file: {filePath}, {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static async Task<HtmlNode> ExportSourceAsHtml(IRDocument textView, int startLine = -1, int endLine = -1,\n                                                        Func<int, int> toOriginalLineMapper = null,\n                                                        Func<int, int> fromOriginalLineMapper = null) {\n    string TableStyle = @\"border-collapse:collapse;border-spacing:0;\";\n    string HeaderStyle =\n      @\"background-color:#D3D3D3;white-space:nowrap;text-align:left;vertical-align:top;border-color:black;border-style:solid;border-width:1px;overflow:hidden;padding:2px 2px;font-size:14px;font-family:Arial, sans-serif;\";\n    string CellStyle =\n      @\"text-align:left;vertical-align:top;word-wrap:break-word;max-width:500px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-size:14px;font-family:Arial, sans-serif;\";\n    string LineNumberStyle =\n      @\"color:#006400;text-align:left;vertical-align:top;word-wrap:break-word;max-width:300px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-size:14px;font-family:Arial, sans-serif;\";\n\n    var function = textView.Section.ParentFunction;\n    (int firstSourceLineIndex, int lastSourceLineIndex) =\n      await DocumentUtils.FindFunctionSourceLineRange(function, textView);\n\n    var columnData = textView.ProfileColumnData;\n    bool filterByLine = startLine != -1 && endLine != -1;\n    int maxColumn = 2 + (columnData != null ? columnData.Columns.Count : 0);\n    var doc = new HtmlDocument();\n    var table = doc.CreateElement(\"table\");\n    table.SetAttributeValue(\"style\", TableStyle);\n\n    var thead = doc.CreateElement(\"thead\");\n    var tbody = doc.CreateElement(\"tbody\");\n    var tr = doc.CreateElement(\"tr\");\n\n    var th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Source\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Line\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n\n    if (columnData != null) {\n      foreach (var column in columnData.Columns) {\n        th = doc.CreateElement(\"th\");\n        th.InnerHtml = HttpUtility.HtmlEncode(column.Title);\n        th.SetAttributeValue(\"style\", HeaderStyle);\n        tr.AppendChild(th);\n      }\n    }\n\n    thead.AppendChild(tr);\n    table.AppendChild(thead);\n\n    if (filterByLine &&\n        !MapStartEndSourceLines(ref startLine, ref endLine, toOriginalLineMapper)) {\n      return doc.DocumentNode;\n    }\n\n    for (int i = firstSourceLineIndex; i <= lastSourceLineIndex; i++) {\n      // Filter out instructions not in line range if requested.\n      int lineNumber = i;\n\n      if (filterByLine && (lineNumber < startLine || lineNumber > endLine)) {\n        continue;\n      }\n\n      if (fromOriginalLineMapper != null) {\n        // Map original source line to the one in the document,\n        // when inline assembly is being displayed.\n        lineNumber = fromOriginalLineMapper(lineNumber);\n\n        if (lineNumber == -1) {\n          continue;\n        }\n      }\n\n      var line = textView.Document.GetLineByNumber(lineNumber);\n      string text = textView.Document.GetText(line.Offset, line.Length);\n      var tuple = columnData != null ? DocumentUtils.FindTupleOnSourceLine(lineNumber, textView) : null;\n\n      tr = doc.CreateElement(\"tr\");\n      var td = doc.CreateElement(\"td\");\n      td.InnerHtml = PreprocessHtmlIndentation(text);\n      td.SetAttributeValue(\"style\", CellStyle);\n      tr.AppendChild(td);\n\n      td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode(lineNumber);\n      td.SetAttributeValue(\"style\", LineNumberStyle);\n      tr.AppendChild(td);\n\n      if (columnData != null && tuple != null) {\n        columnData.ExportColumnsAsHTML(tuple, doc, tr);\n      }\n      else {\n        // Use empty cells for lines without data.\n        for (int k = 2; k < maxColumn; k++) {\n          td = doc.CreateElement(\"td\");\n          td.InnerHtml = \"\";\n          td.SetAttributeValue(\"style\", CellStyle);\n          tr.AppendChild(td);\n        }\n      }\n\n      tbody.AppendChild(tr);\n    }\n\n    table.AppendChild(tbody);\n    doc.DocumentNode.AppendChild(table);\n    return doc.DocumentNode;\n  }\n\n  private static bool MapStartEndSourceLines(ref int startLine, ref int endLine,\n                                             Func<int, int> toOriginalLineMapper) {\n    if (toOriginalLineMapper != null) {\n      // Adjust selection start/end lines when inline assembly\n      // is being displayed by mapping back from the document line\n      // to the original source file line.\n      int firstIndex = toOriginalLineMapper(startLine);\n\n      while (firstIndex == -1 &&\n             startLine < endLine) {\n        firstIndex = toOriginalLineMapper(++startLine);\n      }\n\n      if (firstIndex == -1) {\n        return false;\n      }\n\n      int lastIndex = toOriginalLineMapper(endLine);\n\n      while (lastIndex == -1 &&\n             endLine > startLine) {\n        lastIndex = toOriginalLineMapper(--endLine);\n      }\n\n      if (lastIndex == -1) {\n        return false;\n      }\n\n      startLine = firstIndex;\n      endLine = lastIndex;\n    }\n\n    return true;\n  }\n\n  public static async Task<bool> ExportSourceAsMarkdownFile(IRDocument textView, string filePath,\n                                                            Func<int, int> toOriginalLineMapper = null,\n                                                            Func<int, int> fromOriginalLineMapper = null) {\n    try {\n      string text = await ExportSourceAsMarkdown(textView, -1, textView.Document.LineCount,\n                                                 toOriginalLineMapper, fromOriginalLineMapper);\n      await File.WriteAllTextAsync(filePath, text);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to export to Markdown file: {filePath}, {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static async Task<string> ExportSourceAsMarkdown(IRDocument textView, int startLine = -1, int endLine = -1,\n                                                          Func<int, int> toOriginalLineMapper = null,\n                                                          Func<int, int> fromOriginalLineMapper = null) {\n    var sb = new StringBuilder();\n    string header = \"| Source | Line |\";\n    string separator = \"|--------|------|\";\n\n    var function = textView.Section.ParentFunction;\n    (int firstSourceLineIndex, int lastSourceLineIndex) =\n      await DocumentUtils.FindFunctionSourceLineRange(function, textView);\n\n    var columnData = textView.ProfileColumnData;\n    int maxColumn = 2 + (columnData != null ? columnData.Columns.Count : 0);\n    bool filterByLine = startLine != -1 && endLine != -1;\n\n    if (columnData != null) {\n      foreach (var column in columnData.Columns) {\n        header += $\" {column.Title} |\";\n        separator += $\"{new string('-', column.Title.Length)}|\";\n      }\n    }\n\n    sb.AppendLine(header);\n    sb.AppendLine(separator);\n\n    if (filterByLine &&\n        !MapStartEndSourceLines(ref startLine, ref endLine, toOriginalLineMapper)) {\n      return sb.ToString();\n    }\n\n    for (int i = firstSourceLineIndex; i <= lastSourceLineIndex; i++) {\n      // Filter out instructions not in line range if requested.\n      int lineNumber = i;\n\n      if (filterByLine && (lineNumber < startLine || lineNumber > endLine)) {\n        continue;\n      }\n\n      if (fromOriginalLineMapper != null) {\n        // Map original source line to the one in the document,\n        // when inline assembly is being displayed.\n        lineNumber = fromOriginalLineMapper(lineNumber);\n\n        if (lineNumber == -1) {\n          continue;\n        }\n      }\n\n      var line = textView.Document.GetLineByNumber(lineNumber);\n      string text = textView.Document.GetText(line.Offset, line.Length);\n      var tuple = columnData != null ? DocumentUtils.FindTupleOnSourceLine(i, textView) : null;\n\n      sb.Append($\"| {text} | {i} |\");\n\n      if (columnData != null && tuple != null) {\n        columnData.ExportColumnsAsMarkdown(tuple, sb);\n      }\n      else {\n        for (int k = 2; k < maxColumn; k++) {\n          sb.Append(\" |\");\n        }\n      }\n\n      sb.AppendLine();\n    }\n\n    return sb.ToString();\n  }\n\n  private static string PreprocessHtmlIndentation(string text) {\n    var sb = new StringBuilder();\n\n    for (int i = 0; i < text.Length; i++) {\n      if (text[i] == ' ') {\n        sb.Append(\"&nbsp;\");\n      }\n      else if (text[i] == '\\t') {\n        sb.Append(\"&emsp;\");\n      }\n      else {\n        sb.Append(text[i]);\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public static async Task<bool> ExportFunctionAsMarkdownFile(IRDocument textView, string filePath) {\n    try {\n      string text = ExportFunctionAsMarkdown(textView);\n      await File.WriteAllTextAsync(filePath, text);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to export to Markdown file: {filePath}, {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static async Task<bool> ExportFunctionAsHtmlFile(IRDocument textView, string filePath) {\n    try {\n      Trace.WriteLine(\"ExportFunctionAsHtmlFile\");\n      var doc = new HtmlDocument();\n      string TitleStyle =\n        @\"text-align:left;font-family:Arial, sans-serif;font-weight:bold;font-size:16px;margin-top:0em\";\n\n      var p = doc.CreateElement(\"p\");\n      string funcName = textView.Section.FormatFunctionName(textView.Session);\n\n      p.InnerHtml = $\"Function: {HttpUtility.HtmlEncode(funcName)}\";\n      p.SetAttributeValue(\"style\", TitleStyle);\n      doc.DocumentNode.AppendChild(p);\n\n      p = doc.CreateElement(\"p\");\n      p.InnerHtml = $\"Module: {HttpUtility.HtmlEncode(textView.Section.ModuleName)}\";\n      p.SetAttributeValue(\"style\", TitleStyle);\n      doc.DocumentNode.AppendChild(p);\n\n      doc.DocumentNode.AppendChild(ExportFunctionAsHtml(textView));\n      var writer = new StringWriter();\n      doc.Save(writer);\n      await File.WriteAllTextAsync(filePath, writer.ToString());\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to export to HTML file: {filePath}, {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static async Task CopyAllLinesAsHtml(IRDocument textView) {\n    await CopyLinesAsHtml(textView, 0, textView.Document.LineCount);\n  }\n\n  public static async Task CopyAllSourceLinesAsHtml(IRDocument textView, Func<int, int> toOriginalLineMapper,\n                                                    Func<int, int> fromOriginalLineMapper) {\n    await CopySourceLinesAsHtml(textView, 0, textView.Document.LineCount,\n                                toOriginalLineMapper, fromOriginalLineMapper);\n  }\n\n  public static async Task CopySelectedLinesAsHtml(IRDocument textView) {\n    int startLine = textView.TextArea.Selection.StartPosition.Line - 1;\n    int endLine = textView.TextArea.Selection.EndPosition.Line - 1;\n\n    // If no line is selected, copy the current line.\n    if (startLine == -1 && endLine == -1) {\n      startLine = endLine = textView.TextArea.Caret.Line - 1;\n    }\n\n    await CopyLinesAsHtml(textView, startLine, endLine);\n  }\n\n  private static async Task CopyLinesAsHtml(IRDocument textView, int startLine, int endLine) {\n    if (startLine > endLine) {\n      // Happens when selecting bottom-up.\n      (startLine, endLine) = (endLine, startLine);\n    }\n\n    var doc = new HtmlDocument();\n    doc.DocumentNode.AppendChild(ExportFunctionAsHtml(textView, false, startLine, endLine));\n    var writer = new StringWriter();\n    doc.Save(writer);\n\n    // Also save as Markdown so that it can be pasted in plain text editors.\n    //var plainText = ExportFunctionListAsMarkdown(funcList);\n    string plainText = ExportFunctionAsMarkdown(textView, false, startLine, endLine);\n    Utils.CopyHtmlToClipboard(writer.ToString(), plainText);\n  }\n\n  private static HtmlNode ExportFunctionAsHtml(IRDocument textView, bool includeBlocks = true,\n                                               int startLine = -1, int endLine = -1) {\n    string TableStyle = @\"border-collapse:collapse;border-spacing:0;\";\n    string HeaderStyle =\n      @\"background-color:#D3D3D3;white-space:nowrap;text-align:left;vertical-align:top;border-color:black;border-style:solid;border-width:1px;overflow:hidden;padding:2px 2px;font-size:14px;font-family:Arial, sans-serif;\";\n    string CellStyle =\n      @\"text-align:left;vertical-align:top;word-wrap:break-word;max-width:500px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-size:14px;font-family:Arial, sans-serif;\";\n    string BlockStyle =\n      @\"color:#00008B;font-weight:bold;text-align:left;vertical-align:top;word-wrap:break-word;max-width:300px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-size:14px;font-family:Arial, sans-serif;\";\n    string LineNumberStyle =\n      @\"color:#006400;text-align:left;vertical-align:top;word-wrap:break-word;max-width:300px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-size:14px;font-family:Arial, sans-serif;\";\n\n    var columnData = textView.ProfileColumnData;\n    bool filterByLine = startLine != -1 && endLine != -1;\n    int maxColumn = 2 + (columnData != null ? columnData.Columns.Count : 0);\n    var doc = new HtmlDocument();\n    var table = doc.CreateElement(\"table\");\n    table.SetAttributeValue(\"style\", TableStyle);\n\n    var thead = doc.CreateElement(\"thead\");\n    var tbody = doc.CreateElement(\"tbody\");\n    var tr = doc.CreateElement(\"tr\");\n\n    var th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Instruction\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Line\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n\n    if (columnData != null) {\n      foreach (var column in columnData.Columns) {\n        th = doc.CreateElement(\"th\");\n        th.InnerHtml = HttpUtility.HtmlEncode(column.Title);\n        th.SetAttributeValue(\"style\", HeaderStyle);\n        tr.AppendChild(th);\n      }\n    }\n\n    thead.AppendChild(tr);\n    table.AppendChild(thead);\n\n    void AddSimpleRow(string text, string style) {\n      tr = doc.CreateElement(\"tr\");\n      var td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode(text);\n      td.SetAttributeValue(\"style\", style);\n      tr.AppendChild(td);\n\n      for (int i = 1; i < maxColumn; i++) {\n        td = doc.CreateElement(\"td\");\n        td.SetAttributeValue(\"style\", BlockStyle);\n        tr.AppendChild(td);\n      }\n\n      tbody.AppendChild(tr);\n    }\n\n    foreach (var block in textView.Function.Blocks) {\n      bool addedBlockRow = false;\n\n      if (includeBlocks && !filterByLine) {\n        AddSimpleRow($\"Block {block.Number}\", BlockStyle);\n        addedBlockRow = true;\n      }\n\n      foreach (var tuple in block.Tuples) {\n        // Filter out instructions not in line range if requested.\n        if (filterByLine) {\n          if (tuple.TextLocation.Line < startLine ||\n              tuple.TextLocation.Line > endLine) {\n            continue;\n          }\n\n          if (!addedBlockRow) {\n            AddSimpleRow($\"Block {block.Number}\", BlockStyle);\n            addedBlockRow = true;\n\n            if (tuple.IndexInBlock > 0) {\n              AddSimpleRow($\"...\", CellStyle);\n            }\n          }\n        }\n\n        var line = textView.Document.GetLineByNumber(tuple.TextLocation.Line + 1);\n        string text = textView.Document.GetText(line.Offset, line.Length);\n        tr = doc.CreateElement(\"tr\");\n        var td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode(text);\n        td.SetAttributeValue(\"style\", CellStyle);\n        tr.AppendChild(td);\n        td = doc.CreateElement(\"td\");\n\n        var sourceTag = tuple.GetTag<SourceLocationTag>();\n\n        if (sourceTag != null) {\n          td.InnerHtml = HttpUtility.HtmlEncode(sourceTag.Line);\n        }\n\n        td.SetAttributeValue(\"style\", LineNumberStyle);\n        tr.AppendChild(td);\n\n        if (columnData != null) {\n          columnData.ExportColumnsAsHTML(tuple, doc, tr);\n        }\n\n        tbody.AppendChild(tr);\n      }\n    }\n\n    table.AppendChild(tbody);\n    doc.DocumentNode.AppendChild(table);\n    return doc.DocumentNode;\n  }\n\n  private static string ExportFunctionAsMarkdown(IRDocument textView, bool includeBlocks = true,\n                                                 int startLine = -1, int endLine = -1) {\n    var sb = new StringBuilder();\n    string header = \"| Instruction | Line |\";\n    string separator = \"|-------------|------|\";\n\n    var columnData = textView.ProfileColumnData;\n    int maxColumn = 2 + (columnData != null ? columnData.Columns.Count : 0);\n    bool filterByLine = startLine != -1 && endLine != -1;\n\n    if (columnData != null) {\n      foreach (var column in columnData.Columns) {\n        header += $\" {column.Title} |\";\n        separator += $\"{new string('-', column.Title.Length)}|\";\n      }\n    }\n\n    sb.AppendLine(header);\n    sb.AppendLine(separator);\n\n    void AddSimpleRow(string text) {\n      sb.Append($\"| {text} |\");\n\n      for (int i = 1; i < maxColumn; i++) {\n        sb.Append(\" |\");\n      }\n\n      sb.AppendLine();\n    }\n\n    foreach (var block in textView.Function.Blocks) {\n      bool addedBlockRow = false;\n\n      if (includeBlocks && !filterByLine) {\n        AddSimpleRow($\"Block {block.Number}\");\n        addedBlockRow = true;\n      }\n\n      foreach (var tuple in block.Tuples) {\n        // Filter out instructions not in line range if requested.\n        if (filterByLine) {\n          if (tuple.TextLocation.Line < startLine ||\n              tuple.TextLocation.Line > endLine) {\n            continue;\n          }\n\n          if (!addedBlockRow) {\n            AddSimpleRow($\"Block {block.Number}\");\n            addedBlockRow = true;\n\n            if (tuple.IndexInBlock > 0) {\n              AddSimpleRow($\"...\");\n            }\n          }\n        }\n\n        var line = textView.Document.GetLineByNumber(tuple.TextLocation.Line + 1);\n        string text = textView.Document.GetText(line.Offset, line.Length);\n        var sourceTag = tuple.GetTag<SourceLocationTag>();\n        string sourceLine = sourceTag != null ? sourceTag.Line.ToString() : \"\";\n        sb.Append($\"| {text} | {sourceLine} |\");\n\n        if (columnData != null) {\n          columnData.ExportColumnsAsMarkdown(tuple, sb);\n        }\n\n        sb.AppendLine();\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public static async Task<bool> ExportFunctionAsExcelFile(IRDocument textView, string filePath) {\n    var wb = new XLWorkbook();\n    var ws = wb.Worksheets.Add(\"Function\");\n    var columnData = textView.ProfileColumnData;\n    int rowId = 1; // First row is for the table column names.\n    int maxColumn = 2 + (columnData != null ? columnData.Columns.Count : 0);\n    int maxLineLength = 0;\n\n    foreach (var block in textView.Function.Blocks) {\n      rowId++;\n      ws.Cell(rowId, 1).Value = $\"Block {block.Number}\";\n      ws.Cell(rowId, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;\n      ws.Cell(rowId, 1).Style.Font.Bold = true;\n      ws.Cell(rowId, 1).Style.Font.FontColor = XLColor.DarkBlue;\n\n      for (int i = 1; i <= maxColumn; i++) {\n        ws.Cell(rowId, i).Style.Border.BottomBorder = XLBorderStyleValues.Thin;\n      }\n\n      foreach (var tuple in block.Tuples) {\n        rowId++;\n        var line = textView.Document.GetLineByNumber(tuple.TextLocation.Line + 1);\n        string text = textView.Document.GetText(line.Offset, line.Length);\n        ws.Cell(rowId, 1).Value = text;\n        ws.Cell(rowId, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;\n        maxLineLength = Math.Max(text.Length, maxLineLength);\n\n        var sourceTag = tuple.GetTag<SourceLocationTag>();\n\n        if (sourceTag != null) {\n          ws.Cell(rowId, 2).Value = sourceTag.Line;\n          ws.Cell(rowId, 2).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;\n          ws.Cell(rowId, 2).Style.Font.FontColor = XLColor.DarkGreen;\n        }\n\n        if (columnData != null) {\n          columnData.ExportColumnsToExcel(tuple, ws, rowId, 3);\n        }\n      }\n    }\n\n    // Set the table header column names.\n    var firstCell = ws.Cell(1, 1);\n    var lastCell = ws.LastCellUsed();\n    var range = ws.Range(firstCell.Address, lastCell.Address);\n    var table = range.CreateTable();\n    table.Theme = XLTableTheme.None;\n\n    foreach (var cell in table.HeadersRow().Cells()) {\n      if (cell.Address.ColumnNumber == 1) {\n        cell.Value = \"Instruction\";\n      }\n      else if (cell.Address.ColumnNumber == 2) {\n        cell.Value = \"Line\";\n      }\n      else if (columnData != null && cell.Address.ColumnNumber - 3 < columnData.Columns.Count) {\n        cell.Value = columnData.Columns[cell.Address.ColumnNumber - 3].Title;\n      }\n\n      cell.Style.Font.Bold = true;\n      cell.Style.Fill.BackgroundColor = XLColor.LightGray;\n    }\n\n    // Adjust the width of the content column.\n    ws.Column(1).AdjustToContents((double)1, maxLineLength);\n\n    await Task.Run(() => wb.SaveAs(filePath));\n    return true;\n  }\n\n  public static async Task CopySelectedSourceLinesAsHtml(IRDocument textView, Func<int, int> toOriginalLineMapper,\n                                                         Func<int, int> fromOriginalLineMapper) {\n    int startLine = textView.TextArea.Selection.StartPosition.Line;\n    int endLine = textView.TextArea.Selection.EndPosition.Line;\n\n    // If no line is selected, copy the current line.\n    if (startLine == 0 && endLine == 0) {\n      startLine = endLine = textView.TextArea.Caret.Line;\n    }\n\n    await CopySourceLinesAsHtml(textView, startLine, endLine, toOriginalLineMapper, fromOriginalLineMapper);\n  }\n\n  private static async Task CopySourceLinesAsHtml(IRDocument textView, int startLine, int endLine,\n                                                  Func<int, int> toOriginalLineMapper,\n                                                  Func<int, int> fromOriginalLineMapper) {\n    if (startLine > endLine) {\n      // Happens when selecting bottom-up.\n      (startLine, endLine) = (endLine, startLine);\n    }\n\n    var doc = new HtmlDocument();\n    doc.DocumentNode.AppendChild(await ExportSourceAsHtml(textView, startLine, endLine,\n                                                          toOriginalLineMapper, fromOriginalLineMapper));\n    var writer = new StringWriter();\n    doc.Save(writer);\n\n    // Also save as Markdown so that it can be pasted in plain text editors.\n    //var plainText = ExportFunctionListAsMarkdown(funcList);\n    string plainText = await ExportSourceAsMarkdown(textView, startLine, endLine,\n                                                    toOriginalLineMapper, fromOriginalLineMapper);\n    Utils.CopyHtmlToClipboard(writer.ToString(), plainText);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/DocumentUtils.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Profile.Document;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic static class DocumentUtils {\n  public static IRElement FindElement(int offset, List<IRElement> list) {\n    if (list == null) {\n      return null;\n    }\n\n    //? TODO: Use binary search\n    foreach (var token in list) {\n      if (offset >= token.TextLocation.Offset &&\n          offset < token.TextLocation.Offset + token.TextLength) {\n        return token;\n      }\n    }\n\n    return null;\n  }\n\n  public static bool FindElement(int offset, List<IRElement> list, out IRElement result) {\n    result = FindElement(offset, list);\n    return result != null;\n  }\n\n  public static IRElement FindPointedElement(Point position, TextEditor editor, List<IRElement> list) {\n    int offset = GetOffsetFromMousePosition(position, editor, out _);\n    return offset != -1 ? FindElement(offset, list) : null;\n  }\n\n  public static int GetOffsetFromMousePosition(Point positionRelativeToTextView, TextEditor editor,\n                                               out int visualColumn) {\n    visualColumn = 0;\n    var textView = editor.TextArea.TextView;\n    var pos = positionRelativeToTextView;\n\n    if (pos.Y < 0) {\n      pos.Y = 0;\n    }\n\n    if (pos.Y > textView.ActualHeight) {\n      pos.Y = textView.ActualHeight;\n    }\n\n    pos += textView.ScrollOffset;\n\n    if (pos.Y >= textView.DocumentHeight) {\n      pos.Y = textView.DocumentHeight - 0.01;\n    }\n\n    var line = textView.GetVisualLineFromVisualTop(pos.Y);\n\n    if (line != null) {\n      visualColumn = line.GetVisualColumn(pos, false);\n      return line.GetRelativeOffset(visualColumn) + line.FirstDocumentLine.Offset;\n    }\n\n    return -1;\n  }\n\n  public static FormattedText CreateFormattedText(FrameworkElement element, string text, Typeface typeface,\n                                                  double emSize, Brush foreground, FontWeight? fontWeight = null) {\n    var formattedText = new FormattedText(text, CultureInfo.CurrentCulture, FlowDirection.LeftToRight,\n                                          typeface, emSize, foreground, null,\n                                          TextOptions.GetTextFormattingMode(element),\n                                          VisualTreeHelper.GetDpi(element).PixelsPerDip);\n\n    if (fontWeight.HasValue) {\n      formattedText.SetFontWeight(fontWeight.Value);\n    }\n\n    return formattedText;\n  }\n\n  public static IEnumerable<T> FindOverlappingSegments<T>(this TextSegmentCollection<T> list, TextView textView)\n    where T : IRSegment {\n    if (!FindVisibleTextLineAndOffsets(textView, out int viewStart, out int viewEnd,\n                                       out int viewStartLine, out int viewEndLine)) {\n      yield break;\n    }\n\n    foreach (var segment in list.FindOverlappingSegments(viewStart, viewEnd - viewStart)) {\n      // Blocks can start on a line that is out of view and the overlay\n      // is meant to be associated with the start line, while GetRectsForSegment\n      // would use the first line still in view, so skip manually over it.\n      if (segment.Element is BlockIR &&\n          segment.Element.TextLocation.Line < viewStartLine - 1) {\n        continue;\n      }\n\n      yield return segment;\n    }\n  }\n\n  public static bool FindVisibleTextOffsets(TextView textView, out int viewStart, out int viewEnd) {\n    textView.EnsureVisualLines();\n    var visualLines = textView.VisualLines;\n\n    if (visualLines.Count == 0) {\n      viewStart = viewEnd = 0;\n      return false;\n    }\n\n    viewStart = visualLines[0].FirstDocumentLine.Offset;\n    viewEnd = visualLines[^1].LastDocumentLine.EndOffset;\n    return true;\n  }\n\n  public static bool FindVisibleTextLineAndOffsets(TextView textView, out int viewStart, out int viewEnd,\n                                                   out int viewStartLine, out int viewEndLine) {\n    textView.EnsureVisualLines();\n    var visualLines = textView.VisualLines;\n\n    if (visualLines.Count == 0) {\n      viewStart = viewEnd = 0;\n      viewStartLine = viewEndLine = 0;\n      return false;\n    }\n\n    viewStartLine = visualLines[0].FirstDocumentLine.LineNumber;\n    viewEndLine = visualLines[^1].LastDocumentLine.LineNumber;\n    viewStart = visualLines[0].FirstDocumentLine.Offset;\n    viewEnd = visualLines[^1].LastDocumentLine.EndOffset;\n    return true;\n  }\n\n  public static ReferenceFinder CreateReferenceFinder(FunctionIR function, ISession session,\n                                                      DocumentSettings settings) {\n    var irInfo = session.CompilerInfo.IR;\n    IReachableReferenceFilter filter = null;\n\n    if (settings != null) {\n      if (settings.FilterSourceDefinitions ||\n          settings.FilterDestinationUses) {\n        filter = irInfo.CreateReferenceFilter(function);\n\n        if (filter != null) {\n          filter.FilterUses = settings.FilterDestinationUses;\n          filter.FilterDefinitions = settings.FilterSourceDefinitions;\n        }\n      }\n    }\n\n    return new ReferenceFinder(function, irInfo, filter);\n  }\n\n  public static List<object> SaveDefaultMenuItems(MenuItem menu) {\n    // Save the menu items that are always present, they are either\n    // separators or menu items without an object tag.\n    var defaultItems = new List<object>();\n\n    foreach (object item in menu.Items) {\n      if (item is MenuItem menuItem) {\n        if (menuItem.Tag == null) {\n          defaultItems.Add(item);\n        }\n      }\n      else if (item is Separator) {\n        defaultItems.Add(item);\n      }\n    }\n\n    return defaultItems;\n  }\n\n  public static void RestoreDefaultMenuItems(MenuItem menu, List<object> defaultItems) {\n    defaultItems.ForEach(item => menu.Items.Add(item));\n  }\n\n  public static void RemoveNonDefaultMenuItems(MenuItem menu) {\n    var items = SaveDefaultMenuItems(menu);\n    menu.Items.Clear();\n    RestoreDefaultMenuItems(menu, items);\n  }\n\n  public static string GenerateElementPreviewText(IRElement element, ReadOnlyMemory<char> documentText,\n                                                  int maxLength = 0) {\n    var instr = element.ParentInstruction;\n    string text = \"\";\n\n    if (instr != null) {\n      text = instr.GetText(documentText).ToString();\n    }\n    else {\n      if (element is OperandIR op) {\n        // This is usually a parameter.\n        text = op.GetText(documentText).ToString();\n      }\n      else {\n        return \"\";\n      }\n    }\n\n    int start = 0;\n    int length = text.Length;\n\n    if (instr != null) {\n      // Set range start to cover destination.\n      if (instr.Destinations.Count > 0) {\n        var firstDest = instr.Destinations[0];\n        start = firstDest.TextLocation.Offset - instr.TextLocation.Offset;\n        start = Math.Min(instr.OpcodeLocation.Offset - instr.TextLocation.Offset, start); // Include opcode.\n      }\n      else {\n        start = instr.OpcodeLocation.Offset - instr.TextLocation.Offset; // Include opcode.\n      }\n    }\n\n    start = Math.Max(0, start); //? TODO: Workaround for offset not being right\n\n    // Extend range to cover all sources.\n    if (instr != null && instr.Sources.Count > 0) {\n      var lastSource = instr.Sources.FindLast(s => s.TextLocation.Offset != 0);\n\n      if (lastSource != null) {\n        length = lastSource.TextLocation.Offset -\n                 instr.TextLocation.Offset +\n                 lastSource.TextLength;\n\n        if (length <= 0) {\n          length = text.Length;\n        }\n\n        length = Math.Min(text.Length, length); //? TODO: Workaround for offset not being right\n      }\n    }\n\n    // Extract the text in the range.\n    if (start != 0 || length > 0) {\n      int actualLength = Math.Min(length - start, text.Length - start);\n\n      if (actualLength > 0) {\n        text = text.Substring(start, actualLength);\n      }\n    }\n\n    text = text.RemoveNewLines();\n    return maxLength != 0 ? text.TrimToLength(maxLength) : text;\n  }\n\n  public static IRElement FindTupleOnSourceLine(int line, IRDocument textView) {\n    var pair1 = textView.ProfileProcessingResult.SampledElements.\n      Find(e => e.Item1.TextLocation.Line == line - 1);\n\n    if (pair1.Item1 != null) {\n      return pair1.Item1;\n    }\n\n    // Look into performance counters.\n    var pair2 = textView.ProfileProcessingResult.CounterElements.\n      Find(e => e.Item1.TextLocation.Line == line - 1);\n    return pair2.Item1;\n  }\n\n  public static void CreateBackMenu(MenuItem menu, Stack<ProfileFunctionState> states,\n                                    RoutedEventHandler menuClickHandler,\n                                    TextViewSettingsBase settings, ISession session) {\n    var defaultItems = SaveDefaultMenuItems(menu);\n    var profileItems = new List<ProfileMenuItem>();\n\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings.ProfileMarkerSettings;\n    var profile = session.ProfileData;\n    double maxWidth = 0;\n\n    foreach (var state in states) {\n      double weightPercentage = profile.ScaleFunctionWeight(state.Weight);\n\n      string title = state.Section.ParentFunction.Name.FormatFunctionName(session, 80);\n      string text = $\"({markerSettings.FormatWeightValue(state.Weight)})\";\n\n      var value = new ProfileMenuItem(text, state.Weight.Ticks, weightPercentage) {\n        PrefixText = title,\n        ToolTip = \"\",\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = markerSettings.PickTextWeight(weightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var item = new MenuItem {\n        Header = value,\n        IsCheckable = true,\n        StaysOpenOnClick = true,\n        Tag = state,\n        HeaderTemplate = valueTemplate,\n        Style = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\")\n      };\n\n      item.Click += menuClickHandler;\n      defaultItems.Add(item);\n      profileItems.Add(value);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(title, ref maxWidth, menu);\n    }\n\n    foreach (var value in profileItems) {\n      value.MinTextWidth = maxWidth;\n    }\n\n    menu.Items.Clear();\n    RestoreDefaultMenuItems(menu, defaultItems);\n  }\n\n  public static async Task<(int, int)>\n    FindFunctionSourceLineRange(IRTextFunction function, IRDocument textView) {\n    int lineCount = textView.Document.LineCount;\n    var session = textView.Session;\n\n    return await Task.Run(async () => {\n      var debugInfo = await session.GetDebugInfoProvider(function).ConfigureAwait(false);\n      var funcProfile = session.ProfileData?.GetFunctionProfile(function);\n\n      if (debugInfo == null || funcProfile == null) {\n        return (0, 0);\n      }\n\n      int firstSourceLineIndex = 0;\n      int lastSourceLineIndex = 0;\n\n      if (debugInfo.PopulateSourceLines(funcProfile.FunctionDebugInfo)) {\n        firstSourceLineIndex = funcProfile.FunctionDebugInfo.FirstSourceLine.Line;\n        lastSourceLineIndex = funcProfile.FunctionDebugInfo.LastSourceLine.Line;\n      }\n\n      // Ensure source lines are within document bounds\n      // just in case values are not right.\n      firstSourceLineIndex = Math.Clamp(firstSourceLineIndex, 1, lineCount);\n      lastSourceLineIndex = Math.Clamp(lastSourceLineIndex, 1, lineCount);\n      return (firstSourceLineIndex, lastSourceLineIndex);\n    });\n  }\n\n  public static string FormatLongFunctionName(string name) {\n    return FormatLongFunctionName(name, 80, 10, 1000);\n  }\n\n  public static string FormatLongFunctionName(string name, int maxLineLength,\n                                              int maxSplitPointAdjustment,\n                                              int maxLength) {\n    if (name.Length <= maxLineLength) {\n      return name;\n    }\n\n    // If name is really long cut out from the middle part\n    // to make it fit into the maxLength.\n    if (name.Length > maxLength) {\n      int diff = name.Length - maxLength;\n      int middle = name.Length / 2;\n      name = name.Substring(0, middle - diff / 2) + \" ... \" +\n             name.Substring(middle + diff / 2, middle - diff / 2);\n    }\n\n    // Try to split the name each maxLineLength letters.\n    // If the split point happens to be inside a identifier,\n    // look left or right for a template separator like < > : ,\n    // to pick as a splitting point since it looks better than\n    // cutting a class/function name.\n    var sb = new StringBuilder();\n\n    for (int i = 0; i < name.Length; i++) {\n      int splitPoint = i + Math.Min(maxLineLength, name.Length - i);\n\n      if (name.Length - splitPoint < maxSplitPointAdjustment) {\n        // Split point is close to the name end, don't split anymore.\n        return sb.ToString().Trim() + name.Substring(i, name.Length - i);\n      }\n\n      bool foundNew = false;\n\n      // Look for a separator cahr on the right.\n      for (int k = splitPoint + 1, distance = 0;\n           k < name.Length && distance < maxSplitPointAdjustment;\n           k++, distance++) {\n        if (!char.IsLetterOrDigit(name[k])) {\n          // Found a separator char as a splitting point.\n          splitPoint = k;\n          foundNew = true;\n          break;\n        }\n      }\n\n      if (!foundNew && splitPoint < name.Length - 1) {\n        // Look for a separator char on the left.\n        for (int k = splitPoint - 1, distance = 0;\n             k > i && distance < maxSplitPointAdjustment;\n             k--, distance++) {\n          if (!char.IsLetterOrDigit(name[k])) {\n            // Found a separator char as a splitting point.\n            splitPoint = k;\n            break;\n          }\n        }\n      }\n\n      int length = splitPoint - i;\n      sb.AppendLine(name.Substring(i, length));\n      i += length - 1;\n    }\n\n    return sb.ToString().Trim();\n  }\n\n  public static IRTextSection FindCallTargetSection(IRElement element, IRTextSection section, ISession session) {\n    if (!element.HasName) {\n      return null;\n    }\n\n    // Function names in the summary are mangled, while the document\n    // has them demangled, run the demangler while searching for the target.\n    var summary = section.ParentFunction.ParentSummary;\n    string searchedName = element.Name;\n    var targetFunc = summary.FindFunction(searchedName);\n\n    if (targetFunc == null) {\n      var nameProvider = session.CompilerInfo.NameProvider;\n      targetFunc = summary.FindFunction(searchedName, nameProvider.FormatFunctionName);\n    }\n\n    if (targetFunc == null) {\n      return null;\n    }\n\n    // Prefer the same section as this document if there are multiple.\n    return targetFunc.SectionCount == 0 ? null : targetFunc.Sections[0];\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Highlighting/DefaultHighlightingStyles.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI;\n\npublic static class DefaultHighlightingStyles {\n  public static HighlightingStyleCollection StyleSet;\n  public static HighlightingStyleCollection LightStyleSet;\n\n  static DefaultHighlightingStyles() {\n    StyleSet = new HighlightingStyleCollection();\n\n    StyleSet.Styles.Add(\n      new HighlightingStyle(Color.FromRgb(254, 202, 165), ColorPens.GetPen(Colors.Gray)));\n\n    StyleSet.Styles.Add(\n      new HighlightingStyle(Color.FromRgb(232, 254, 165), ColorPens.GetPen(Colors.Gray)));\n\n    StyleSet.Styles.Add(\n      new HighlightingStyle(Color.FromRgb(173, 254, 165), ColorPens.GetPen(Colors.Gray)));\n\n    StyleSet.Styles.Add(\n      new HighlightingStyle(Color.FromRgb(165, 180, 254), ColorPens.GetPen(Colors.Gray)));\n\n    StyleSet.Styles.Add(\n      new HighlightingStyle(Color.FromRgb(254, 165, 187), ColorPens.GetPen(Colors.Gray)));\n\n    LightStyleSet = new HighlightingStyleCollection();\n    LightStyleSet.Styles.Add(new HighlightingStyle(Color.FromRgb(253, 231, 216)));\n    LightStyleSet.Styles.Add(new HighlightingStyle(Color.FromRgb(244, 253, 216)));\n    LightStyleSet.Styles.Add(new HighlightingStyle(Color.FromRgb(220, 253, 216)));\n    LightStyleSet.Styles.Add(new HighlightingStyle(Color.FromRgb(216, 223, 253)));\n    LightStyleSet.Styles.Add(new HighlightingStyle(Color.FromRgb(253, 216, 226)));\n  }\n\n  public static HighlightingStyleCollection GetStyleSetWithBorder(\n    HighlightingStyleCollection baseStyleSet, Pen pen) {\n    var newStyle = new HighlightingStyleCollection();\n\n    foreach (var style in baseStyleSet.Styles) {\n      newStyle.Styles.Add(new HighlightingStyle(style.BackColor, pen));\n    }\n\n    return newStyle;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Highlighting/HighlightedElementGroup.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class HighlightedElementGroup {\n  public HighlightedElementGroup(HighlightingStyle style) {\n    Elements = new List<IRElement>();\n    Style = style;\n  }\n\n  public HighlightedElementGroup(IRElement element, HighlightingStyle style) : this(style) {\n    Add(element);\n  }\n\n  public List<IRElement> Elements { get; set; }\n  public HighlightingStyle Style { get; set; }\n\n  public bool IsEmpty() {\n    return Elements.Count == 0;\n  }\n\n  public void Add(IRElement element) {\n    Elements.Add(element);\n  }\n\n  public void AddRange(IEnumerable<IRElement> elements) {\n    Elements.AddRange(elements);\n  }\n\n  public void AddFront(IRElement element) {\n    Elements.Insert(0, element);\n  }\n\n  public bool Contains(IRElement element) {\n    return Elements.Contains(element);\n  }\n\n  public bool Remove(IRElement element) {\n    return Elements.Remove(element);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Highlighting/HighlightingStyle.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic sealed class HighlightingStyle : IEquatable<HighlightingStyle> {\n  public HighlightingStyle() { }\n  public HighlightingStyle(Color color) : this(color, 1.0) { }\n  public HighlightingStyle(Color color, Pen border = null) : this(color, 1.0, border) { }\n\n  public HighlightingStyle(string color, Pen border = null) : this(\n    Utils.ColorFromString(color), 1.0, border) {\n  }\n\n  public HighlightingStyle(Color color, double opacity = 1.0, Pen border = null) {\n    BackColor = Math.Abs(opacity - 1.0) < double.Epsilon ?\n      ColorBrushes.GetBrush(color) :\n      ColorBrushes.GetTransparentBrush(color, opacity);\n    Border = border;\n  }\n\n  public HighlightingStyle(Brush backColor, Pen border = null) {\n    BackColor = backColor;\n    Border = border;\n  }\n\n  [ProtoMember(1)] public Brush BackColor { get; set; }\n  [ProtoMember(2)] public Pen Border { get; set; }\n\n  public bool Equals(HighlightingStyle other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Equals(BackColor, other.BackColor) && Equals(Border, other.Border);\n  }\n\n  public static bool operator ==(HighlightingStyle left, HighlightingStyle right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(HighlightingStyle left, HighlightingStyle right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    return ReferenceEquals(this, obj) || obj is HighlightingStyle other && Equals(other);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(BackColor, Border);\n  }\n}\n\npublic sealed class PairHighlightingStyle {\n  public PairHighlightingStyle() {\n    ParentStyle = new HighlightingStyle();\n    ChildStyle = new HighlightingStyle();\n  }\n\n  public HighlightingStyle ParentStyle { get; set; }\n  public HighlightingStyle ChildStyle { get; set; }\n}\n\npublic class HighlightingStyleCollection {\n  public HighlightingStyleCollection(List<HighlightingStyle> styles = null) {\n    if (styles == null) {\n      Styles = new List<HighlightingStyle>();\n    }\n    else {\n      Styles = styles;\n    }\n  }\n\n  public List<HighlightingStyle> Styles { get; set; }\n\n  public HighlightingStyle ForIndex(int index) {\n    return Styles[index % Styles.Count];\n  }\n}\n\npublic class HighlightingStyleCyclingCollection : HighlightingStyleCollection {\n  private int counter_;\n  public HighlightingStyleCyclingCollection(List<HighlightingStyle> styles = null) : base(styles) { }\n\n  public HighlightingStyleCyclingCollection(HighlightingStyleCollection styleSet) : base(\n    styleSet.Styles) {\n  }\n\n  public HighlightingStyle GetNext() {\n    var style = ForIndex(counter_);\n    counter_ = (counter_ + 1) % Styles.Count;\n    return style;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Highlighting/IRElementSegment.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Document;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic enum HighlighingType {\n  Hovered,\n  Selected,\n  Marked\n}\n\npublic class IRSegment : TextSegment {\n  public IRSegment(IRElement element) {\n    Element = element;\n\n    if (element == null) {\n      return;\n    }\n\n    StartOffset = element.TextLocation.Offset;\n    Length = element.TextLength;\n  }\n\n  public IRElement Element { get; set; }\n}\n\npublic sealed class HighlightedSegmentGroup {\n  public HighlightedSegmentGroup(HighlightedElementGroup group, bool saveToFile = true) {\n    Group = group;\n    Segments = new TextSegmentCollection<IRSegment>();\n    SavesStateToFile = saveToFile;\n\n    foreach (var element in Group.Elements) {\n      Add(element);\n    }\n  }\n\n  public HighlightedElementGroup Group { get; set; }\n  public TextSegmentCollection<IRSegment> Segments { get; set; }\n  public bool SavesStateToFile { get; set; }\n  public Brush BackColor => Group.Style.BackColor;\n  public Pen Border => Group.Style.Border;\n\n  private void Add(IRElement element) {\n    Segments.Add(new IRSegment(element));\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/ILoadedSectionHandler.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic interface ILoadedSectionHandler\n{\n  Task HandleLoadedSection(IRDocument document, FunctionIR function, IRTextSection section);\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/IRDocument.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Shapes;\nusing System.Windows.Threading;\nusing ICSharpCode.AvalonEdit;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Editing;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.UI;\n\npublic enum BringIntoViewStyle {\n  Default,\n  FirstLine\n}\n\npublic enum HighlightingEventAction {\n  ReplaceHighlighting,\n  AppendHighlighting,\n  RemoveHighlighting\n}\n\npublic class IRElementEventArgs : EventArgs {\n  public IRElement Element { get; set; }\n  public bool MirrorAction { get; set; }\n  public IRDocument Document { get; set; }\n}\n\npublic class IRHighlightingEventArgs : EventArgs {\n  public HighlightingEventAction Action { get; set; }\n  public IRElement Element { get; set; }\n  public HighlightedElementGroup Group { get; set; }\n  public bool MirrorAction { get; set; }\n  public HighlighingType Type { get; set; }\n}\n\npublic class IRElementMarkedEventArgs : EventArgs {\n  public IRElement Element { get; set; }\n  public HighlightingStyle Style { get; set; }\n}\n\npublic class SelectedBookmarkInfo {\n  public Bookmark Bookmark { get; set; }\n  public int SelectedIndex { get; set; }\n  public int TotalBookmarks { get; set; }\n}\n\npublic static class DocumentCommand {\n  public static readonly RoutedUICommand GoToDefinition = new(\"Untitled\", \"GoToDefinition\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand GoToDefinitionSkipCopies =\n    new(\"Untitled\", \"GoToDefinitionSkipCopies\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand PreviewDefinition =\n    new(\"Untitled\", \"PreviewDefinition\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand MarkDefinition = new(\"Untitled\", \"MarkDefinition\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand MarkDefinitionBlock =\n    new(\"Untitled\", \"MarkDefinitionBlock\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand Mark = new(\"Untitled\", \"Mark\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand MarkIcon = new(\"Untitled\", \"MarkIcon\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ShowUses = new(\"Untitled\", \"ShowUses\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand MarkUses = new(\"Untitled\", \"MarkUses\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand MarkBlock = new(\"Untitled\", \"MarkBlock\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand MarkReferences = new(\"Untitled\", \"MarkReferences\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ShowExpressionGraph =\n    new(\"Untitled\", \"ShowExpressionGraph\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand NextBlock = new(\"Untitled\", \"NextBlock\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand PreviousBlock = new(\"Untitled\", \"PreviousBlock\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ShowReferences = new(\"Untitled\", \"ShowReferences\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand AddBookmark = new(\"Untitled\", \"AddBookmark\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand RemoveBookmark = new(\"Untitled\", \"RemoveBookmark\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand RemoveAllBookmarks =\n    new(\"Untitled\", \"RemoveAllBookmarks\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand PreviousBookmark = new(\"Untitled\", \"PreviousBookmark\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand NextBookmark = new(\"Untitled\", \"NextBookmark\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ShowBookmarks = new(\"Untitled\", \"ShowBookmarks\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand FirstBookmark = new(\"Untitled\", \"FirstBookmark\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand LastBookmark = new(\"Untitled\", \"LastBookmark\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand FocusBlockSelector =\n    new(\"Untitled\", \"FocusBlockSelector\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ClearMarker = new(\"Untitled\", \"ClearMarker\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ClearBlockMarkers =\n    new(\"Untitled\", \"ClearBlockMarkers\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ClearInstructionMarkers =\n    new(\"Untitled\", \"ClearInstructionMarkers\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ClearAllMarkers = new(\"Untitled\", \"ClearAllMarkers\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand UndoAction = new(\"Untitled\", \"UndoAction\", typeof(IRDocumentHost));\n}\n\npublic sealed class IRDocument : TextEditor, INotifyPropertyChanged {\n  private const float ParentStyleLightAdjustment = 1.20f;\n  private const int DefaultMaxExpressionLevel = 4;\n  private const int ExpressionLevelIncrement = 2;\n  private static DocumentActionKind[] AutomationActions = {\n    DocumentActionKind.SelectElement,\n    DocumentActionKind.MarkElement,\n    DocumentActionKind.ShowReferences,\n    DocumentActionKind.GoToDefinition\n  };\n  private Stack<ReversibleDocumentAction> actionUndoStack_;\n  private List<IRElement> blockElements_;\n  private BlockBackgroundHighlighter blockHighlighter_;\n  private BookmarkManager bookmarks_;\n  private BlockIR currentBlock_;\n  private HighlightedElementGroup currentSearchResultGroup_;\n  private PairHighlightingStyle definitionStyle_;\n  private DiffLineHighlighter diffHighlighter_;\n  private List<DiffTextSegment> diffSegments_;\n  private bool disableCaretEvent_;\n  public bool disableOverlayEvents_;\n  private ScrollBar docVerticalScrollBar_;\n  private bool duringDiffModeSetup_;\n  private bool eventSetupDone_;\n  private HighlightingStyleCollection expressionOperandStyle_;\n  private HighlightingStyleCollection expressionStyle_;\n  private FoldingManager folding_;\n  private MarkerMarginVersionInfo highlighterVersion_;\n  private MarkerBarElement hoveredBarElement_;\n  private IRElement hoveredElement_;\n  private ElementHighlighter hoverHighlighter_;\n  private bool ignoreNextBarHover_;\n  private bool ignoreNextCaretEvent_;\n  private bool ignoreNextHoverEvent_;\n  private IRElement ignoreNextPreviewElement_;\n  private bool ignoreNextScrollEvent_;\n  private CurrentLineHighlighter lineHighlighter_;\n  private DocumentMargin margin_;\n  private ElementHighlighter markedHighlighter_;\n  private OverlayRenderer overlayRenderer_;\n  private bool overlayRendererConnectedTemporarely_;\n  private HighlightingStyleCyclingCollection markerChildStyle_;\n  private Canvas markerMargin_;\n  private List<MarkerBarElement> markerMargingElements_;\n  private HighlightingStyleCyclingCollection markerParentStyle_;\n  private IRDocumentPopup previewPopup_;\n  private bool preparingPreviewPopup_;\n  private List<IRElement> operandElements_;\n  private RemarkHighlighter remarkHighlighter_;\n  private DelayedAction removeHoveredAction_;\n  private Dictionary<TextSearchResult, IRElement> searchResultMap_;\n  private HighlightedElementGroup searchResultsGroup_;\n  private HighlightingStyle selectedBlockStyle_;\n  private HashSet<IRElement> selectedElements_;\n  private ElementHighlighter selectedHighlighter_;\n  private HighlightingStyle selectedStyle_;\n  private TextViewSettingsBase settings_;\n  private PairHighlightingStyle ssaDefinitionStyle_;\n  private PairHighlightingStyle ssaUserStyle_;\n  private PairHighlightingStyle iteratedUserStyle_;\n  private PairHighlightingStyle iteratedDefinitionStyle_;\n  private List<IRElement> tupleElements_;\n  private bool updateSuspended_;\n  private IRElement currentExprElement_;\n  private int currentExprStyleIndex_;\n  private int currentExprLevel_;\n  private Remark selectedRemark_;\n  private bool selectingText_;\n  private HashSet<FoldingSection> foldedBlocks_;\n  private bool hasCustomLineNumbers_;\n  private List<IVisualLineTransformer> registerdTransformers_;\n  private List<HoverPreview> registeredHoverPreviews_;\n  private CancelableTaskInstance markerBarUpdateTask_;\n  private ReaderWriterLockSlim markerBarUpdateLock_;\n\n  public IRDocument() {\n    // Setup element tracking data structures.\n    selectedElements_ = new HashSet<IRElement>();\n    bookmarks_ = new BookmarkManager();\n    actionUndoStack_ = new Stack<ReversibleDocumentAction>();\n    highlighterVersion_ = new MarkerMarginVersionInfo();\n\n    // Setup styles and colors.\n    //? TODO: Expose colors as option\n    definitionStyle_ = new PairHighlightingStyle {\n      ParentStyle = new HighlightingStyle(Color.FromRgb(255, 215, 191)),\n      ChildStyle = new HighlightingStyle(Color.FromRgb(255, 197, 163), ColorPens.GetBoldPen(Colors.Black))\n    };\n\n    expressionOperandStyle_ = DefaultHighlightingStyles.StyleSet;\n    expressionStyle_ = DefaultHighlightingStyles.LightStyleSet;\n    markerChildStyle_ = new HighlightingStyleCyclingCollection(DefaultHighlightingStyles.StyleSet);\n    markerParentStyle_ = new HighlightingStyleCyclingCollection(DefaultHighlightingStyles.LightStyleSet);\n    registerdTransformers_ = new List<IVisualLineTransformer>();\n    registeredHoverPreviews_ = new List<HoverPreview>();\n    markerBarUpdateTask_ = new CancelableTaskInstance(true);\n    markerBarUpdateLock_ = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);\n\n    SetupProperties();\n    SetupStableRenderers();\n    SetupCommands();\n  }\n\n  public List<BlockIR> Blocks => Function.Blocks;\n  public BookmarkManager BookmarkManager => bookmarks_;\n  public IUISession Session { get; private set; }\n  public FunctionIR Function { get; set; }\n  public IRTextSection Section { get; set; }\n  public ReadOnlyMemory<char> SectionText { get; set; }\n  public bool DiffModeEnabled { get; set; }\n  public bool IsLoaded { get; set; }\n  public bool DuringSectionLoading { get; set; }\n\n  public TextViewSettingsBase Settings {\n    get => settings_;\n    private set {\n      settings_ = value;\n      ReloadSettings();\n    }\n  }\n\n  public IRDocumentColumnData ProfileColumnData { get; set; }\n  public FunctionProcessingResult ProfileProcessingResult { get; set; }\n  public double DefaultLineHeight => TextArea.TextView.DefaultLineHeight;\n  public IEnumerable<FoldingSection> BlockFoldings => folding_?.AllFoldings;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<DocumentAction> ActionPerformed;\n  public event EventHandler<IRElementEventArgs> BlockSelected;\n  public event EventHandler<Bookmark> BookmarkAdded;\n  public event EventHandler<Bookmark> BookmarkChanged;\n  public event EventHandler BookmarkListCleared;\n  public event EventHandler<Bookmark> BookmarkRemoved;\n  public event EventHandler<SelectedBookmarkInfo> BookmarkSelected;\n  public event EventHandler<IRHighlightingEventArgs> ElementHighlighting;\n  public event EventHandler<IRElementEventArgs> ElementSelected;\n  public event EventHandler<IRElementEventArgs> ElementUnselected;\n  public event EventHandler<int> CaretChanged;\n  public event EventHandler<FoldingSection> TextRegionFolded;\n  public event EventHandler<FoldingSection> TextRegionUnfolded;\n  public event EventHandler<IRTextSection> FunctionCallOpen;\n\n  private static int AdjustVisibleLine(int line) {\n    // Leave a few lines be visible above.\n    if (line > 2) {\n      line -= 2;\n    }\n\n    return line;\n  }\n\n  public void Initialize(TextViewSettingsBase settings, IUISession session) {\n    Session = session;\n    Settings = settings;\n  }\n\n  public void BookmarkInfoChanged(Bookmark bookmark) {\n    UpdateHighlighting();\n  }\n\n  public void DisableOverlayEventHandlers() {\n    disableOverlayEvents_ = true;\n    overlayRenderer_.MouseLeave();\n  }\n\n  public void EnableOverlayEventHandlers() {\n    disableOverlayEvents_ = false;\n  }\n\n  public void ExecuteDocumentAction(DocumentAction action) {\n#if DEBUG\n    Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Execute {action}\");\n#endif\n\n    switch (action.ActionKind) {\n      case DocumentActionKind.SelectElement: {\n        if (action.Element != null) {\n          SelectElement(action.Element);\n        }\n\n        break;\n      }\n      case DocumentActionKind.MarkElement: {\n        if (action.Element != null) {\n          MarkElement(action.Element, action.OptionalData as PairHighlightingStyle);\n        }\n\n        break;\n      }\n      case DocumentActionKind.MarkExpression: {\n        if (action.Element != null) {\n          var highlighter = action.OptionalData is MarkActionData data && data.IsTemporary\n            ? selectedHighlighter_\n            : markedHighlighter_;\n\n          if (action.Element is InstructionIR instr) {\n            if (instr.Destinations.Count > 0) {\n              HandleElement(instr.Destinations[0], highlighter,\n                            true, false);\n            }\n          }\n          else {\n            HandleElement(action.Element, highlighter,\n                          true, false);\n          }\n        }\n\n        break;\n      }\n      case DocumentActionKind.ShowExpressionGraph: {\n        if (action.Element != null) {\n          ShowExpressionGraph(action.Element);\n        }\n\n        break;\n      }\n      case DocumentActionKind.MarkBlock: {\n        if (action.Element != null) {\n          MarkBlock(action.Element, action.OptionalData as HighlightingStyle);\n        }\n\n        break;\n      }\n      case DocumentActionKind.GoToDefinition: {\n        if (action.Element != null) {\n          GoToElementDefinition(action.Element);\n        }\n\n        break;\n      }\n      case DocumentActionKind.ShowReferences: {\n        if (action.Element is OperandIR op) {\n          ShowReferences(op);\n        }\n        else if (action.Element is InstructionIR instr) {\n          // For an instruction, look for the references of the dest. operand.\n          if (instr.Destinations.Count > 0) {\n            ShowReferences(instr.Destinations[0]);\n          }\n        }\n\n        break;\n      }\n      case DocumentActionKind.MarkReferences: {\n        if (action.Element is OperandIR op) {\n          MarkReferences(op, markedHighlighter_);\n        }\n        else if (action.Element is InstructionIR instr) {\n          // For an instruction, look for the references of the dest. operand.\n          if (instr.Destinations.Count > 0) {\n            MarkReferences(instr.Destinations[0], markedHighlighter_);\n          }\n        }\n\n        break;\n      }\n      case DocumentActionKind.ShowUses: {\n        if (action.Element is OperandIR op) {\n          ShowUses(op);\n        }\n        else if (action.Element is InstructionIR instr) {\n          // For an instruction, look for the uses of the dest. operand.\n          if (instr.Destinations.Count > 0) {\n            ShowUses(instr.Destinations[0]);\n          }\n        }\n\n        break;\n      }\n      case DocumentActionKind.MarkUses: {\n        if (action.Element is OperandIR op) {\n          MarkUses(op, action.OptionalData as PairHighlightingStyle);\n        }\n        else if (action.Element is InstructionIR instr) {\n          // For an instruction, look for the uses of the dest. operand.\n          if (instr.Destinations.Count > 0) {\n            MarkUses(instr.Destinations[0], action.OptionalData as PairHighlightingStyle);\n          }\n        }\n\n        break;\n      }\n      case DocumentActionKind.ClearMarker: {\n        if (action.Element != null) {\n          ClearMarkedElement(action.Element);\n        }\n\n        break;\n      }\n      case DocumentActionKind.ClearAllMarkers: {\n        ClearAllMarkers();\n        break;\n      }\n      case DocumentActionKind.ClearBlockMarkers: {\n        ClearBlockMarkers();\n        break;\n      }\n      case DocumentActionKind.ClearInstructionMarkers: {\n        ClearInstructionMarkers();\n        break;\n      }\n      case DocumentActionKind.ClearTemporaryMarkers: {\n        ClearTemporaryHighlighting();\n        UpdateHighlighting();\n        break;\n      }\n      case DocumentActionKind.UndoAction: {\n        UndoReversibleAction();\n        break;\n      }\n    }\n\n    UpdateHighlighting();\n    UpdateMargin();\n  }\n\n  public void BringTextOffsetIntoView(int offset) {\n    ignoreNextHoverEvent_ = true;\n    ignoreNextCaretEvent_ = true;\n    int line = Document.GetLineByOffset(offset).LineNumber;\n    ScrollToLine(AdjustVisibleLine(line));\n  }\n\n  public void BringElementIntoView(IRElement op,\n                                   BringIntoViewStyle style = BringIntoViewStyle.Default) {\n    if (op.TextLocation.Offset < 0 || op.TextLocation.Offset >= Document.TextLength) {\n      return;\n    }\n\n    ignoreNextHoverEvent_ = true;\n    ignoreNextCaretEvent_ = true;\n    int line = Document.GetLineByOffset(op.TextLocation.Offset).LineNumber;\n\n    if (style == BringIntoViewStyle.Default) {\n      if (!IsElementOutsideView(op)) {\n        UpdateHighlighting();\n        return;\n      }\n\n      ScrollToLine(AdjustVisibleLine(line));\n    }\n    else if (style == BringIntoViewStyle.FirstLine) {\n      double y = TextArea.TextView.GetVisualTopByDocumentLine(line);\n      ScrollToVerticalOffset(y);\n    }\n\n    UpdateHighlighting();\n  }\n\n  public void ClearMarkedElement(IRElement element) {\n    markedHighlighter_.Remove(element);\n    ClearTemporaryHighlighting();\n    UpdateHighlighting();\n    RaiseElementRemoveHighlightingEvent(element);\n  }\n\n  public void ClearMarkedElementAt(Point point) {\n    var element = FindPointedElement(point, out _);\n\n    if (element != null) {\n      ClearMarkedElement(element);\n    }\n  }\n\n  public void ClearMarkedElementAt(int offset) {\n    var element = FindElementAtOffset(offset);\n\n    if (element != null) {\n      ClearMarkedElement(element);\n    }\n  }\n\n  public void GoToBlock(BlockIR block) {\n    SelectElement(block);\n    BringElementIntoView(block);\n    currentBlock_ = block;\n  }\n\n  public BlockIR GoToNextBlock() {\n    int index = Function.Blocks.IndexOf(currentBlock_);\n\n    if (index + 1 < Function.Blocks.Count) {\n      GoToBlock(Function.Blocks[index + 1]);\n    }\n\n    return currentBlock_;\n  }\n\n  public BlockIR GoToPredecessorBlock() {\n    return currentBlock_;\n  }\n\n  public BlockIR GoToPreviousBlock() {\n    int index = Function.Blocks.IndexOf(currentBlock_);\n\n    if (index == -1) {\n      return currentBlock_;\n    }\n\n    if (index > 0 && Function.Blocks.Count > 0) {\n      GoToBlock(Function.Blocks[index - 1]);\n    }\n\n    return currentBlock_;\n  }\n\n  public void HighlightElement(IRElement element, HighlighingType type) {\n    HighlightSingleElement(element, GetHighlighter(type));\n  }\n\n  public void SelectElementsOnSourceLine(int lineNumber, SourceStackFrame inlinee = null) {\n    ClearTemporaryHighlighting();\n    MarkElementsOnSourceLine(selectedHighlighter_, lineNumber, Colors.Transparent,\n                             false, true, inlinee);\n  }\n\n  public void SelectElementsInLineRange(int startLine, int endLine,\n                                        Func<int, int> lineMapper = null,\n                                        Brush backColor = null) {\n    ClearTemporaryHighlighting();\n    var style = selectedStyle_;\n\n    if (backColor != null) {\n      style = new HighlightingStyle(backColor, selectedStyle_.Border);\n    }\n\n    var group = new HighlightedElementGroup(style);\n\n    if (lineMapper != null) {\n      startLine = lineMapper(startLine);\n      endLine = lineMapper(endLine);\n    }\n\n    foreach (var block in Function.Blocks) {\n      foreach (var tuple in block.Tuples) {\n        if (tuple.TextLocation.Line + 1 >= startLine &&\n            tuple.TextLocation.Line + 1 <= endLine) {\n          group.Add(tuple);\n        }\n      }\n    }\n\n    if (!group.IsEmpty()) {\n      selectedHighlighter_.Add(group);\n    }\n\n    UpdateHighlighting();\n  }\n\n  public void SelectLine(int line) {\n    if (line >= 0 && line <= Document.LineCount) {\n      TextArea.Caret.Line = line;\n      ScrollToLine(line);\n    }\n  }\n\n  public void MarkElementsOnSourceLine(int lineNumber, Color selectedColor, bool raiseEvent = true) {\n    MarkElementsOnSourceLine(markedHighlighter_, lineNumber, selectedColor, raiseEvent, false, null);\n  }\n\n  public void MarkElementWithDefaultStyle(IRElement element) {\n    HighlightSingleElement(element, markedHighlighter_);\n  }\n\n  public void UnloadDocument() {\n    UnregisterTextTransformers();\n    UnregisterHoverPreviews();\n    ResetRenderers();\n    IsLoaded = false;\n    Text = \"\";\n    SectionText = ReadOnlyMemory<char>.Empty;\n    ProfileColumnData = null;\n    Section = null;\n    Function = null;\n    selectedRemark_ = null;\n    currentExprElement_ = null;\n    foldedBlocks_ = null;\n    ClearSelectedElements();\n  }\n\n  public async Task<bool> InitializeFromDocument(IRDocument doc, bool copyTemporaryHighlighting = true,\n                                                 string text = null, bool analyzeFunction = true) {\n    if (Section == doc.Section) {\n      return false;\n    }\n\n    UnloadDocument();\n    Session = doc.Session;\n    Settings = doc.Settings;\n    Section = doc.Section;\n    Function = doc.Function;\n    blockElements_ = doc.blockElements_;\n    tupleElements_ = doc.tupleElements_;\n    operandElements_ = doc.operandElements_;\n\n    if (copyTemporaryHighlighting) {\n      hoverHighlighter_.CopyFrom(doc.hoverHighlighter_);\n      selectedHighlighter_.CopyFrom(doc.selectedHighlighter_);\n    }\n\n    markedHighlighter_.CopyFrom(doc.markedHighlighter_);\n    bookmarks_.CopyFrom(doc.bookmarks_);\n    margin_.CopyFrom(doc.margin_);\n    ignoreNextCaretEvent_ = true;\n\n    if (text != null) {\n      Text = text;\n      SectionText = text.AsMemory();\n    }\n    else {\n      Text = doc.SectionText.ToString();\n      SectionText = doc.SectionText;\n    }\n\n    SetupBlockFolding();\n\n    if (analyzeFunction) {\n      await Session.LoadedSectionHandler.HandleLoadedSection(this, Function, Section);\n    }\n\n    return true;\n  }\n\n  public bool JumpToBookmark(Bookmark bookmark) {\n    if (bookmark != null) {\n      margin_.SelectBookmark(bookmark);\n      BringElementIntoView(bookmark.Element);\n      RaiseBookmarkSelectedEvent(bookmark);\n      return true;\n    }\n\n    return false;\n  }\n\n  public async Task LoadSavedSection(ParsedIRTextSection parsedSection, IRDocumentState savedState) {\n#if DEBUG\n    Trace.TraceInformation(\n      $\"Document {ObjectTracker.Track(this)}: Load saved section {parsedSection}\");\n#endif\n\n    selectedElements_ = savedState.SelectedElements?.ToHashSet(item => (IRElement)item) ??\n                        new HashSet<IRElement>();\n\n    bookmarks_.LoadState(savedState.Bookmarks, Function);\n    hoverHighlighter_.LoadState(savedState.HoverHighlighter, Function);\n    selectedHighlighter_.LoadState(savedState.SelectedHighlighter, Function);\n    markedHighlighter_.LoadState(savedState.MarkedHighlighter, Function);\n    overlayRenderer_.LoadState(savedState.ElementOverlays, Function, SetupElementOverlayEvents);\n    margin_.LoadState(savedState.Margin);\n\n    bookmarks_.Bookmarks.ForEach(item => RaiseBookmarkAddedEvent(item));\n    SetCaretAtOffset(savedState.CaretOffset);\n\n    await ComputeElementListsAsync();\n    await LateLoadSectionSetup(parsedSection);\n  }\n\n  public async Task LoadSection(ParsedIRTextSection parsedSection,\n                                bool isSourceCode = false) {\n#if DEBUG\n    Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Load section {parsedSection}\");\n#endif\n    // If the section loading is not done in two stages,\n    // run the first stage now to initialize the text view.\n    if (!DuringSectionLoading) {\n      PreloadSection(parsedSection);\n    }\n\n    await ComputeElementListsAsync();\n    await LateLoadSectionSetup(parsedSection, isSourceCode);\n  }\n\n  public void MarkBlock(IRElement element, HighlightingStyle style, bool raiseEvent = true) {\n    var group = new HighlightedElementGroup(element, style);\n    margin_.AddBlock(group, raiseEvent);\n\n    if (raiseEvent) {\n      RecordReversibleAction(DocumentActionKind.MarkElement, element);\n    }\n\n    ClearTemporaryHighlighting();\n    UpdateMargin();\n    UpdateHighlighting();\n\n    if (raiseEvent) {\n      RaiseElementHighlightingEvent(element, group, markedHighlighter_.Type,\n                                    HighlightingEventAction.ReplaceHighlighting);\n    }\n  }\n\n  public void MarkElement(IRElement element, Color selectedColor, bool raiseEvent = true) {\n    var style = new HighlightingStyle(selectedColor, null);\n    MarkElement(element, style, raiseEvent);\n  }\n\n  public void MarkElements(IEnumerable<IRElement> elements, Color selectedColor) {\n    var style = new HighlightingStyle(selectedColor, null);\n    var group = new HighlightedElementGroup(style);\n    group.AddRange(elements);\n\n    ClearTemporaryHighlighting();\n    markedHighlighter_.Add(group);\n    UpdateHighlighting();\n  }\n\n  public void SelectElements(IEnumerable<IRElement> elements) {\n    var group = new HighlightedElementGroup(selectedStyle_);\n    group.AddRange(elements);\n\n    ClearTemporaryHighlighting();\n    selectedHighlighter_.Add(group);\n    UpdateHighlighting();\n  }\n\n  public void MarkElement(IRElement element, HighlightingStyle style, bool raiseEvent = true) {\n    if (raiseEvent) {\n#if DEBUG\n      Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Mark element {element.Id}\");\n#endif\n      RecordReversibleAction(DocumentActionKind.MarkElement, element);\n    }\n\n    ClearTemporaryHighlighting();\n    var group = new HighlightedElementGroup(element, style);\n    markedHighlighter_.Remove(element);\n    markedHighlighter_.Add(group);\n    UpdateHighlighting();\n\n    if (raiseEvent) {\n      RaiseElementHighlightingEvent(element, group, markedHighlighter_.Type,\n                                    HighlightingEventAction.AppendHighlighting);\n    }\n  }\n\n  public void BeginMarkElementAppend(HighlighingType highlightingType) {\n    if (highlightingType == HighlighingType.Hovered ||\n        highlightingType == HighlighingType.Selected) {\n      ClearTemporaryHighlighting();\n    }\n  }\n\n  public void EndMarkElementAppend(HighlighingType highlightingType) {\n    UpdateHighlighting();\n  }\n\n  public void MarkElementAppend(IRElement element, Color selectedColor,\n                                HighlighingType highlightingType, bool raiseEvent = true) {\n    var style = new HighlightingStyle(selectedColor, null);\n    MarkElementAppend(element, style, highlightingType, raiseEvent);\n  }\n\n  public void MarkElementAppend(IRElement element, HighlightingStyle style,\n                                HighlighingType highlightingType, bool raiseEvent = true) {\n#if DEBUG\n    Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Mark element {element.Id}\");\n#endif\n    var highlighter = GetHighlighter(highlightingType);\n\n    var group = new HighlightedElementGroup(element, style);\n    highlighter.Remove(element);\n    highlighter.Add(group);\n\n    if (raiseEvent) {\n      RaiseElementHighlightingEvent(element, group, highlightingType,\n                                    HighlightingEventAction.AppendHighlighting);\n    }\n  }\n\n  public void SetRootConnectedElement(IRElement element, HighlightingStyle style,\n                                      bool isTemporary) {\n    overlayRenderer_.SetRootElement(element, style);\n    overlayRendererConnectedTemporarely_ = isTemporary;\n  }\n\n  public void AddConnectedElement(IRElement element, HighlightingStyle style) {\n    overlayRenderer_.AddConnectedElement(element, style);\n  }\n\n  public void ClearConnectedElements() {\n    overlayRenderer_.ClearConnectedElements();\n  }\n\n  public void MarkElementAt(Point point, Color selectedColor) {\n    var element = FindPointedElement(point, out _);\n\n    if (element != null) {\n      MarkElement(element, selectedColor);\n    }\n  }\n\n  public void MarkElementAt(int offset, Color selectedColor) {\n    var element = FindElementAtOffset(offset);\n\n    if (element != null) {\n      MarkElement(element, selectedColor);\n    }\n  }\n\n  public void MarkTextRange(int offset, int length, Color color) {\n    var style = new HighlightingStyle(color, ColorPens.GetPen(Colors.DarkGray));\n    var element = CreateDummyElement(offset, length);\n    var group = new HighlightedElementGroup(element, style);\n    markedHighlighter_.Add(group);\n    UpdateHighlighting();\n  }\n\n  public void MarkSearchResults(List<TextSearchResult> results, Color color) {\n    ClearSearchResults();\n\n    if (results.Count == 0) {\n      return;\n    }\n\n    var style = new HighlightingStyle(color, ColorPens.GetPen(Colors.DarkGray));\n    searchResultMap_ = new Dictionary<TextSearchResult, IRElement>(results.Count);\n    searchResultsGroup_ = new HighlightedElementGroup(style);\n\n    foreach (var result in results) {\n      var element = CreateDummyElement(result.Offset, result.Length);\n      searchResultsGroup_.Add(element);\n      searchResultMap_[result] = element;\n    }\n\n    markedHighlighter_.Add(searchResultsGroup_, false);\n    ClearTemporaryHighlighting();\n    UpdateHighlighting();\n  }\n\n  public void ClearSearchResults() {\n    if (searchResultsGroup_ != null) {\n      markedHighlighter_.Remove(searchResultsGroup_);\n      searchResultsGroup_ = null;\n\n      if (currentSearchResultGroup_ != null) {\n        markedHighlighter_.Remove(currentSearchResultGroup_);\n        currentSearchResultGroup_ = null;\n      }\n    }\n\n    UpdateHighlighting();\n  }\n\n  public void JumpToSearchResult(TextSearchResult result, Color color) {\n    if (currentSearchResultGroup_ != null) {\n      markedHighlighter_.Remove(currentSearchResultGroup_);\n      searchResultsGroup_.Add(currentSearchResultGroup_.Elements[0]);\n    }\n\n    var style = new HighlightingStyle(color, ColorPens.GetPen(Colors.Black));\n    currentSearchResultGroup_ = new HighlightedElementGroup(style);\n    var element = searchResultMap_[result];\n    searchResultsGroup_.Remove(element);\n    currentSearchResultGroup_.Add(element);\n    markedHighlighter_.Add(currentSearchResultGroup_, false);\n    BringElementIntoView(element);\n    ClearTemporaryHighlighting();\n    UpdateHighlighting();\n  }\n\n  public void RemoveAllBookmarks() {\n    bookmarks_.Clear();\n    margin_.ClearBookmarks();\n    UpdateMargin();\n    UpdateHighlighting();\n    RaiseBookmarkListClearedEvent();\n  }\n\n  public void RemoveBookmark(Bookmark bookmark) {\n    bookmarks_.RemoveBookmark(bookmark);\n    margin_.RemoveBookmark(bookmark);\n    UpdateMargin();\n    UpdateHighlighting();\n    RaiseBookmarkRemovedEvent(bookmark);\n  }\n\n  public IRDocumentState SaveState() {\n    var savedState = new IRDocumentState();\n    savedState.SelectedElements = selectedElements_.ToList(item => new IRElementReference(item));\n    savedState.Bookmarks = bookmarks_.SaveState(Function);\n    savedState.HoverHighlighter = hoverHighlighter_.SaveState(Function);\n    savedState.SelectedHighlighter = selectedHighlighter_.SaveState(Function);\n    savedState.MarkedHighlighter = markedHighlighter_.SaveState(Function);\n    savedState.ElementOverlays = overlayRenderer_.SaveState(Function);\n    savedState.Margin = margin_.SaveState();\n    savedState.CaretOffset = TextArea.Caret.Offset;\n    return savedState;\n  }\n\n  public void SelectElement(IRElement element, bool raiseEvent = true, bool fromUICommand = false,\n                            int textOffset = -1) {\n    if (settings_ is not DocumentSettings) { // For source code documents.\n      return;\n    }\n\n    // During a text selection, don't select more\n    // than the first clicked element.\n    if (selectingText_) {\n      return;\n    }\n\n    ClearTemporaryHighlighting();\n    ResetExpressionLevel(element);\n\n    if (element != null) {\n#if DEBUG\n      Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Select element {element.Id}\");\n#endif\n\n      // Don't highlight a block unless the header is selected.\n      if (element is BlockIR && fromUICommand && textOffset != -1) {\n        int line = Document.GetLineByOffset(textOffset).LineNumber;\n        int blockStartLine = element.TextLocation.Line;\n\n        if (line - 1 != blockStartLine) {\n          HandelNoElementSelection();\n          return;\n        }\n      }\n\n      bool markExpression = fromUICommand && Utils.IsControlModifierActive();\n      bool markReferences = fromUICommand && Utils.IsShiftModifierActive();\n      AddSelectedElement(element, raiseEvent);\n\n      var highlighter = Utils.IsAltModifierActive() ? markedHighlighter_ : selectedHighlighter_;\n      HandleElement(element, highlighter, markExpression, markReferences);\n      UpdateHighlighting();\n\n      if (fromUICommand) {\n        ignoreNextCaretEvent_ = true;\n        MirrorAction(DocumentActionKind.SelectElement, element);\n      }\n    }\n    else if (raiseEvent) {\n      // Notify of no element being selected.\n      HandelNoElementSelection();\n    }\n  }\n\n  public void UnselectElements() {\n    ClearSelectedElements();\n    UpdateHighlighting();\n    ResetExpressionLevel();\n  }\n\n  public void SelectElementAt(Point point) {\n    var element = FindPointedElement(point, out _);\n\n    if (element != null) {\n      SelectElement(element);\n    }\n  }\n\n  public void UnmarkBlock(IRElement element, HighlighingType type) {\n    margin_.RemoveBlock(element);\n    UpdateMargin();\n  }\n\n  public void PanelContentLoaded(IToolPanel panel) {\n    if (panel.PanelKind == ToolPanelKind.FlowGraph ||\n        panel.PanelKind == ToolPanelKind.DominatorTree ||\n        panel.PanelKind == ToolPanelKind.PostDominatorTree) {\n      // Mark the nodes in the graph panel.\n      foreach (var blockGroup in margin_.BlockGroups) {\n        if (!blockGroup.SavesStateToFile) {\n          continue;\n        }\n\n        foreach (var element in blockGroup.Group.Elements) {\n          RaiseElementHighlightingEvent(element, blockGroup.Group, markedHighlighter_.Type,\n                                        HighlightingEventAction.ReplaceHighlighting);\n        }\n      }\n    }\n  }\n\n  public Bookmark AddBookmark(IRElement selectedElement, string text = null, bool pinned = false) {\n    var bookmark = bookmarks_.AddBookmark(selectedElement);\n    bookmark.Text = text;\n    bookmark.IsPinned = pinned;\n\n    margin_.AddBookmark(bookmark);\n    margin_.SelectBookmark(bookmark);\n    UpdateMargin();\n    UpdateHighlighting();\n    RaiseBookmarkAddedEvent(bookmark);\n    return bookmark;\n  }\n\n  public void PreloadSection(ParsedIRTextSection parsedSection) {\n#if DEBUG\n    Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Start setup for {parsedSection}\");\n#endif\n\n    DuringSectionLoading = true;\n    Section = parsedSection.Section;\n    Function = parsedSection.Function;\n    ignoreNextCaretEvent_ = true;\n    ClearSelectedElements();\n    ResetRenderers();\n\n    // Replace the text in the view.\n    Text = parsedSection.Text.ToString();\n    SectionText = parsedSection.Text; // Cache raw text.\n    SetCaretAtOffset(0);\n  }\n\n  public IRElement GetElementAt(Point position) {\n    int offset = DocumentUtils.GetOffsetFromMousePosition(position, this, out _);\n    return offset != -1 ? FindElementAtOffset(offset) : null;\n  }\n\n  public async Task LoadDiffedFunction(DiffMarkingResult diffResult, IRTextSection newSection) {\n    StartDiffSegmentAdding();\n    Function = diffResult.DiffFunction;\n    Section = newSection;\n    SectionText = diffResult.DiffText.AsMemory();\n\n    // Compute the element lists before removing the block folding.\n    // If done after, the UI may update during the async call\n    // and it would be noticeable how the block folding disappears, then immediately\n    // reappears once LateLoadSectionSetup reinstalls the block folding.\n    await ComputeElementListsAsync();\n\n    // Take ownership of the text document.\n    diffResult.DiffDocument.SetOwnerThread(Thread.CurrentThread);\n    Document = diffResult.DiffDocument;\n\n    // Remove the current block folding since it's bound to the current text area.\n    UninstallBlockFolding();\n    ClearTemporaryHighlighting();\n    await LateLoadSectionSetup(null);\n\n    AddDiffTextSegments(diffResult.DiffSegments);\n    AllDiffSegmentsAdded();\n  }\n\n  public void SetCaretAtElement(IRElement element) {\n    SetCaretAtOffset(element.TextLocation.Offset);\n  }\n\n  public void SetCaretAtOffset(int offset) {\n    if (offset < Document.TextLength) {\n      ignoreNextCaretEvent_ = true;\n      TextArea.Caret.Offset = offset;\n      BringTextOffsetIntoView(offset);\n    }\n  }\n\n  public void UninstallBlockFolding() {\n    if (folding_ != null) {\n      FoldingManager.Uninstall(folding_);\n      folding_ = null;\n    }\n  }\n\n  private void SetupBlockFolding() {\n    if (settings_ is not DocumentSettings docSettings) {\n      return;\n    }\n\n    if (!docSettings.ShowBlockFolding) {\n      UninstallBlockFolding();\n      return;\n    }\n\n    if (Function == null) {\n      return; // Function couldn't be parsed.\n    }\n\n    UninstallBlockFolding();\n    folding_ = FoldingManager.Install(TextArea);\n    var foldingStrategy = Session.BlockFoldingStrategyProvider.CreateFoldingStrategy(Function);\n    foldingStrategy.UpdateFoldings(folding_, Document);\n    SetupBlockFoldingEvents(folding_.AllFoldings);\n  }\n\n  public IEnumerable<FoldingSection> SetupCustomBlockFolding(IBlockFoldingStrategy foldingStrategy) {\n    UninstallBlockFolding();\n    folding_ = FoldingManager.Install(TextArea);\n    foldingStrategy.UpdateFoldings(folding_, Document);\n    SetupBlockFoldingEvents(folding_.AllFoldings);\n    return folding_.AllFoldings;\n  }\n\n  private void SetupBlockFoldingEvents(IEnumerable<FoldingSection> foldings) {\n    var foldingMargin = TextArea.LeftMargins.OfType<FoldingMargin>().FirstOrDefault();\n\n    if (foldingMargin == null) {\n      return;\n    }\n\n    // Set initial folded state.\n    foldedBlocks_ = new HashSet<FoldingSection>();\n\n    foreach (var folding in foldings) {\n      if (folding.IsFolded) {\n        foldedBlocks_.Add(folding);\n      }\n    }\n\n    void DetectFoldingChanges() {\n      // Check each folding if there is a change, since there is\n      // no event for a single folding being changed.\n      foreach (var folding in folding_.AllFoldings) {\n        if (folding.IsFolded) {\n          if (foldedBlocks_.Add(folding)) {\n            TextRegionFolded?.Invoke(this, folding);\n          }\n        }\n        else {\n          if (foldedBlocks_.Remove(folding)) {\n            TextRegionUnfolded?.Invoke(this, folding);\n          }\n        }\n      }\n    }\n\n    foldingMargin.PreviewMouseLeftButtonUp += (sender, args) => DetectFoldingChanges();\n    foldingMargin.PreviewTouchUp += (sender, args) => DetectFoldingChanges();\n  }\n\n  public void SetupCustomLineNumbers(LineNumberMargin lineNumbers) {\n    // Disable builtin line numbers margin and replace it with a custom one,\n    // plus a dotted line between it and the document itself.\n    ShowLineNumbers = false;\n    UninstallCustomLineNumbers(false);\n\n    var leftMargins = TextArea.LeftMargins;\n    var line = (Line)DottedLineMargin.Create();\n    leftMargins.Insert(0, lineNumbers);\n    leftMargins.Insert(1, line);\n    var lineNumbersForeground = new Binding(\"LineNumbersForeground\") {Source = this};\n    line.SetBinding(Shape.StrokeProperty, lineNumbersForeground);\n    lineNumbers.SetBinding(ForegroundProperty, lineNumbersForeground);\n    hasCustomLineNumbers_ = true;\n  }\n\n  public void UninstallCustomLineNumbers(bool restoreBuiltin) {\n    if (hasCustomLineNumbers_) {\n      var leftMargins = TextArea.LeftMargins;\n\n      for (int i = 0; i < leftMargins.Count; i++) {\n        if (leftMargins[i] is LineNumberMargin ||\n            leftMargins[i] is Line) {\n          leftMargins.RemoveAt(i);\n          i--;\n        }\n      }\n\n      hasCustomLineNumbers_ = false;\n    }\n\n    ShowLineNumbers = restoreBuiltin;\n  }\n\n  public void RegisterTextTransformer(DocumentColorizingTransformer transformer) {\n    if (!TextArea.TextView.LineTransformers.Contains(transformer)) {\n      TextArea.TextView.LineTransformers.Add(transformer);\n      registerdTransformers_.Add(transformer);\n    }\n  }\n\n  public void UnregisterTextTransformer(DocumentColorizingTransformer transformer) {\n    if (registerdTransformers_.Remove(transformer)) {\n      TextArea.TextView.LineTransformers.Remove(transformer);\n    }\n  }\n\n  public void UnregisterTextTransformers() {\n    foreach (var transformer in registerdTransformers_) {\n      TextArea.TextView.LineTransformers.Remove(transformer);\n    }\n\n    registerdTransformers_.Clear();\n  }\n\n  public void RegisterHoverPreview(PopupHoverPreview preview) {\n    registeredHoverPreviews_.Add(preview);\n  }\n\n  public void UnregisterHoverPreviews() {\n    foreach (var ppreview in registeredHoverPreviews_) {\n      ppreview.Unregister();\n    }\n\n    registeredHoverPreviews_.Clear();\n  }\n\n  private void AddDiffTextSegments(List<DiffTextSegment> segments) {\n    diffSegments_ = segments;\n    diffHighlighter_.Add(segments);\n  }\n\n  public void RemoveDiffTextSegments() {\n    diffHighlighter_.Clear();\n    UpdateHighlighting();\n  }\n\n  private void StartDiffSegmentAdding() {\n    diffHighlighter_.Clear();\n    ClearAllMarkers();\n    TextArea.IsEnabled = false;\n\n    // Disable the caret event because it triggers redrawing of\n    // the right marker bar, which besides being slow, causes a\n    // GDI handle leak from the usage of RenderTargetBitmap (known WPF issue).\n    disableCaretEvent_ = true;\n    duringDiffModeSetup_ = true;\n  }\n\n  private void AllDiffSegmentsAdded() {\n    disableCaretEvent_ = false;\n    duringDiffModeSetup_ = false;\n    TextArea.IsEnabled = true;\n\n    // This forces the updating of the right bar with the diffed line markers\n    // to execute after the editor displayed the scroll bars.\n    Dispatcher.Invoke(() => UpdateHighlighting(), DispatcherPriority.Render);\n  }\n\n  public void SelectDocumentRemark(Remark remark) {\n    var element = remark.ReferencedElements[0];\n    HighlightElement(element, HighlighingType.Hovered);\n    selectedRemark_ = remark;\n  }\n\n  public void AddRemarks(List<Remark> allRemarks, List<RemarkLineGroup> markerRemarksGroups,\n                         bool hasContextFilter) {\n    if (markerRemarksGroups != null) {\n      AddMarginRemarks(markerRemarksGroups, hasContextFilter);\n    }\n\n    if (allRemarks != null) {\n      AddDocumentRemarks(allRemarks, hasContextFilter);\n    }\n\n    UpdateMargin();\n    UpdateHighlighting();\n  }\n\n  public void RemoveRemarks() {\n    selectedRemark_ = null;\n    remarkHighlighter_.Clear();\n    margin_.RemoveRemarkBookmarks();\n    UpdateMargin();\n    UpdateHighlighting();\n  }\n\n  public void UpdateRemarks(List<Remark> allRemarks, List<RemarkLineGroup> markerRemarksGroups,\n                            bool hasContextFilter) {\n    RemoveRemarks();\n    AddRemarks(allRemarks, markerRemarksGroups, hasContextFilter);\n  }\n\n  public void AddElementOverlay(IRElement element, IElementOverlay overlay) {\n    overlayRenderer_.AddElementOverlay(element, overlay);\n    UpdateHighlighting();\n  }\n\n  public IconElementOverlay AddIconElementOverlay(IRElement element, IconDrawing icon,\n                                                  double width = 16, double height = 0,\n                                                  string label = \"\", string tooltip = \"\",\n                                                  HorizontalAlignment alignmentX = HorizontalAlignment.Right,\n                                                  VerticalAlignment alignmentY = VerticalAlignment.Center,\n                                                  double marginX = 8, double marginY = 4) {\n    var overlay = RegisterIconElementOverlay(element, icon, width, height, label, tooltip,\n                                             alignmentX, alignmentY, marginX, marginY);\n    UpdateHighlighting();\n    return overlay;\n  }\n\n  private IconElementOverlay RegisterIconElementOverlay(IRElement element, IconDrawing icon,\n                                                        double width, double height,\n                                                        string label, string tooltip,\n                                                        HorizontalAlignment alignmentX,\n                                                        VerticalAlignment alignmentY,\n                                                        double marginX, double marginY) {\n    var overlay = IconElementOverlay.CreateDefault(icon, width, height,\n                                                   ColorBrushes.Transparent,\n                                                   selectedStyle_.BackColor,\n                                                   selectedStyle_.Border,\n                                                   label, tooltip,\n                                                   alignmentX, alignmentY,\n                                                   marginX, marginY);\n    return (IconElementOverlay)RegisterElementOverlay(element, overlay);\n  }\n\n  public IElementOverlay RegisterElementOverlay(IRElement element, string label, string tooltip) {\n    return RegisterIconElementOverlay(element, null, 0, 0, label, tooltip);\n  }\n\n  public IElementOverlay RegisterElementOverlay(IRElement element, IElementOverlay overlay,\n                                                bool prepend = false) {\n    SetupElementOverlayEvents(overlay);\n    overlayRenderer_.AddElementOverlay(element, overlay, prepend);\n    return overlay;\n  }\n\n  public void RemoveElementOverlays(IRElement element, object onlyWithTag = null) {\n    overlayRenderer_.RemoveAllElementOverlays(element, onlyWithTag);\n  }\n\n  public void ClearElementOverlays() {\n    overlayRenderer_.ClearElementOverlays();\n    UpdateHighlighting();\n  }\n\n  public void EnterDiffMode() {\n    DiffModeEnabled = true;\n    SectionText = ReadOnlyMemory<char>.Empty;\n  }\n\n  public void ExitDiffMode() {\n    margin_.ClearMarkers();\n    diffHighlighter_.Clear();\n    SectionText = ReadOnlyMemory<char>.Empty;\n    DiffModeEnabled = false;\n  }\n\n  //? TODO: This is a more efficient way of marking the loop blocks\n  //? by using a single group that covers all blocks in a loop\n  //private void MarkLoopNest(Loop loop, HashSet<BlockIR> handledBlocks) {\n  //    foreach(var nestedLoop in loop.NestedLoops) {\n  //        MarkLoopNest(nestedLoop, handledBlocks);\n  //    }\n\n  //    HighlightedGroup group = null;\n\n  //    foreach (var block in loop.Blocks) {\n  //        if(handledBlocks.Contains(block)) {\n  //            continue; // Block already marked as part of a nested loop.\n  //        }\n\n  //        handledBlocks.Add(block);\n\n  //        if(group == null) {\n  //            group = new HighlightedGroup(gr.GetDefaultBlockStyle(block));\n  //        }\n\n  //        group.Elements.Add(block);\n  //    }\n\n  //    if (group != null) {\n  //        margin_.AddBlock(group);\n  //    }\n  //}\n\n  public DocumentLine GetLineByNumber(int lineNumber) {\n    return Document.GetLineByNumber(lineNumber);\n  }\n\n  public DocumentLine GetLineByOffset(int offset) {\n    return Document.GetLineByOffset(offset);\n  }\n\n  public void MarkBlock(IRElement element, Color selectedColor, bool raiseEvent = true) {\n    var style = new HighlightingStyle(selectedColor, null);\n    MarkBlock(element, style, raiseEvent);\n  }\n\n  public void MarkBlock(IRElement element, Brush selectedColor, bool raiseEvent = true) {\n    var style = new HighlightingStyle(selectedColor, null);\n    MarkBlock(element, style, raiseEvent);\n  }\n\n  public void MarkElements(ICollection<ValueTuple<IRElement, Brush>> elementColorPairs) {\n    var colorGroupMap = new Dictionary<Brush, HighlightedElementGroup>(elementColorPairs.Count);\n    ClearTemporaryHighlighting();\n\n    foreach (var pair in elementColorPairs) {\n      var element = pair.Item1;\n      var color = pair.Item2;\n\n      if (!colorGroupMap.TryGetValue(color, out var group)) {\n        var style = new HighlightingStyle(color, null);\n        group = new HighlightedElementGroup(style);\n        colorGroupMap[color] = group;\n      }\n\n      group.Add(element);\n    }\n\n    foreach (var pair in colorGroupMap) {\n      markedHighlighter_.Add(pair.Value);\n    }\n\n    UpdateHighlighting();\n  }\n\n  public void ClearInstructionMarkers() {\n    markedHighlighter_.ForEachElement(RaiseElementRemoveHighlightingEvent);\n    markedHighlighter_.Clear();\n    UpdateHighlighting();\n  }\n\n  public IconElementOverlay RegisterIconElementOverlay(IRElement element, IconDrawing icon,\n                                                       double width, double height,\n                                                       string label = null, string tooltip = null,\n                                                       bool prepend = false) {\n    var overlay = IconElementOverlay.CreateDefault(icon, width, height,\n                                                   ColorBrushes.Transparent,\n                                                   selectedStyle_.BackColor,\n                                                   selectedStyle_.Border,\n                                                   label, tooltip);\n    return (IconElementOverlay)RegisterElementOverlay(element, overlay, prepend);\n  }\n\n  public void SuspendUpdate() {\n    updateSuspended_ = true;\n    disableCaretEvent_ = true;\n    overlayRenderer_.SuspendUpdate();\n    markerBarUpdateTask_.CancelTask();\n    markerBarUpdateLock_.EnterWriteLock();\n  }\n\n  public void ResumeUpdate() {\n    updateSuspended_ = false;\n    disableCaretEvent_ = false;\n    overlayRenderer_.ResumeUpdate();\n    markerBarUpdateLock_.ExitWriteLock();\n    UpdateHighlighting();\n  }\n\n  public bool HandleOverlayKeyPress(KeyEventArgs e) {\n    return overlayRenderer_.KeyPressed(e);\n  }\n\n  private void IRDocument_PreviewKeyDown(object sender, KeyEventArgs e) {\n    if (margin_.SelectedBookmark != null) {\n      e.Handled = EditBookmarkText(margin_.SelectedBookmark, e.Key);\n      return;\n    }\n\n    // Notify overlay layer in case there is a selected overlay visual.\n    if (overlayRenderer_.KeyPressed(e)) {\n      e.Handled = true;\n      return;\n    }\n\n    switch (e.Key) {\n      case Key.Return: {\n        if (Utils.IsAltModifierActive()) {\n          PreviewDefinitionExecuted(this, null);\n        }\n        else {\n          if (GetSelectedElement() is var element &&\n              TryOpenFunctionCallTarget(element)) {\n          }\n          else {\n            GoToDefinitionExecuted(this, null);\n          }\n        }\n\n        e.Handled = true;\n        break;\n      }\n      case Key.Escape: {\n        HidePreviewPopup();\n        e.Handled = true;\n        break;\n      }\n      // Saving of markings with profiling not yet implemented.\n      // case Key.M: {\n      //   if (Utils.IsControlModifierActive()) {\n      //     if (Utils.IsShiftModifierActive()) {\n      //       MarkBlockExecuted(this, null);\n      //     }\n      //     else {\n      //       MarkExecuted(this, null);\n      //     }\n      //   }\n      //\n      //   e.Handled = true;\n      //   break;\n      // }\n      // case Key.D: {\n      //   if (Utils.IsControlModifierActive()) {\n      //     if (Utils.IsShiftModifierActive()) {\n      //       MarkDefinitionBlockExecuted(this, null);\n      //     }\n      //     else {\n      //       MarkDefinitionExecuted(this, null);\n      //     }\n      //   }\n      //\n      //   e.Handled = true;\n      //   break;\n      // }\n      // case Key.U: {\n      //   if (Utils.IsControlModifierActive()) {\n      //     if (Utils.IsShiftModifierActive()) {\n      //       MarkUsesExecuted(this, null);\n      //     }\n      //     else {\n      //       ShowUsesExecuted(this, null);\n      //     }\n      //   }\n      //\n      //   e.Handled = true;\n      //   break;\n      // }\n      // case Key.Delete: {\n      //   if (Utils.IsControlModifierActive() ||\n      //       Utils.IsShiftModifierActive()) {\n      //     ClearAllMarkersExecuted(this, null);\n      //   }\n      //   else {\n      //     ClearMarkerExecuted(this, null);\n      //   }\n      //\n      //   e.Handled = true;\n      //   break;\n      // }\n      case Key.B: {\n        if (Utils.IsControlModifierActive()) {\n          if (Utils.IsShiftModifierActive()) {\n            RemoveBookmarkExecuted(this, null);\n          }\n          else {\n            AddBookmarkExecuted(this, null);\n          }\n        }\n\n        e.Handled = true;\n        break;\n      }\n      case Key.R: {\n        if (Utils.IsControlModifierActive()) {\n          if (Utils.IsShiftModifierActive()) {\n            MarkReferencesExecuted(this, null);\n          }\n          else {\n            ShowReferencesExecuted(this, null);\n          }\n        }\n\n        e.Handled = true;\n        break;\n      }\n      case Key.F2: {\n        if (Utils.IsShiftModifierActive()) {\n          PreviousBookmarkExecuted(this, null);\n        }\n        else {\n          NextBookmarkExecuted(this, null);\n        }\n\n        e.Handled = true;\n        break;\n      }\n      case Key.Down: {\n        if (Utils.IsControlModifierActive()) {\n          GoToNextBlock();\n          e.Handled = true;\n        }\n\n        break;\n      }\n      case Key.Up: {\n        if (Utils.IsControlModifierActive()) {\n          GoToPreviousBlock();\n          e.Handled = true;\n        }\n\n        break;\n      }\n      case Key.Z: {\n        if (Utils.IsControlModifierActive()) {\n          UndoReversibleAction();\n\n          if (Utils.IsAltModifierActive()) {\n            MirrorAction(DocumentActionKind.UndoAction, null);\n          }\n\n          e.Handled = true;\n        }\n\n        break;\n      }\n      case Key.E: {\n        if (Utils.IsControlModifierActive()) {\n          ShowExpressionGraphExecuted(this, null);\n          e.Handled = true;\n        }\n\n        break;\n      }\n    }\n  }\n\n  private void SetupStyles() {\n    if (settings_ is not DocumentSettings docSettings) {\n      // Selection styles are also used in non-IR documents,\n      // make sure they are not null and have reasonable defaults.\n      selectedStyle_ = new HighlightingStyle {\n        BackColor = ColorBrushes.GetTransparentBrush(settings_.SelectedValueColor, 0.5),\n        Border = settings_.CurrentLineBorderColor.AsPen()\n      };\n\n      selectedBlockStyle_ = new HighlightingStyle {\n        BackColor = settings_.BackgroundColor.AsBrush(),\n        Border = settings_.CurrentLineBorderColor.AsPen()\n      };\n      return;\n    }\n\n    var borderPen = ColorPens.GetBoldPen(docSettings.BorderColor);\n    var lightBorderPen = ColorPens.GetTransparentPen(docSettings.BorderColor, 150);\n\n    selectedStyle_ ??= new HighlightingStyle {\n      BackColor = ColorBrushes.GetTransparentBrush(settings_.SelectedValueColor, 0.5),\n      Border = borderPen\n    };\n\n    selectedBlockStyle_ = selectedStyle_;\n    ssaUserStyle_ ??= new PairHighlightingStyle();\n    ssaUserStyle_.ParentStyle.BackColor =\n      ColorBrushes.GetBrush(\n        ColorUtils.AdjustLight(docSettings.UseValueColor, ParentStyleLightAdjustment));\n\n    ssaUserStyle_.ChildStyle.BackColor = ColorBrushes.GetBrush(docSettings.UseValueColor);\n    ssaUserStyle_.ChildStyle.Border = borderPen;\n\n    iteratedUserStyle_ = new PairHighlightingStyle {\n      ParentStyle = {\n        BackColor = ColorBrushes.GetTransparentBrush(docSettings.UseValueColor, 0)\n      },\n      ChildStyle = {\n        BackColor = ColorBrushes.GetTransparentBrush(docSettings.UseValueColor, 50),\n        Border = lightBorderPen\n      }\n    };\n\n    ssaDefinitionStyle_ = new PairHighlightingStyle {\n      ParentStyle = {\n        BackColor = ColorBrushes.GetBrush(\n          ColorUtils.AdjustLight(docSettings.DefinitionValueColor, ParentStyleLightAdjustment))\n      },\n      ChildStyle = {\n        BackColor = ColorBrushes.GetBrush(docSettings.DefinitionValueColor),\n        Border = borderPen\n      }\n    };\n\n    iteratedDefinitionStyle_ = new PairHighlightingStyle {\n      ParentStyle = {\n        BackColor = ColorBrushes.GetTransparentBrush(docSettings.DefinitionValueColor, 0)\n      },\n      ChildStyle = {\n        BackColor = ColorBrushes.GetTransparentBrush(docSettings.DefinitionValueColor, 50),\n        Border = lightBorderPen\n      }\n    };\n  }\n\n  private void ReloadSettings() {\n    Background = ColorBrushes.GetBrush(settings_.BackgroundColor);\n    Foreground = ColorBrushes.GetBrush(settings_.TextColor);\n    FontFamily = new FontFamily(settings_.FontName);\n    FontSize = settings_.FontSize;\n    SetupRenderers();\n    SetupStyles();\n    SetupBlockFolding();\n    SetupEvents();\n    SyntaxHighlighting = Utils.LoadSyntaxHighlightingFile(App.GetSyntaxHighlightingFilePath());\n    UpdateHighlighting();\n  }\n\n  private void MirrorAction(DocumentActionKind actionKind, IRElement element,\n                            object optionalData = null) {\n    if (Utils.IsAltModifierActive()) {\n      var action = new DocumentAction(actionKind, element, optionalData);\n      ActionPerformed?.Invoke(this, action);\n    }\n  }\n\n  private void RecordReversibleAction(DocumentActionKind actionKind, IRElement element,\n                                      object optionalData = null) {\n    ReversibleDocumentAction action = null;\n\n    switch (actionKind) {\n      case DocumentActionKind.MarkElement: {\n        action = new ReversibleDocumentAction(\n          new DocumentAction(actionKind, element, optionalData),\n          action => ClearMarkedElement(action.Element));\n\n        break;\n      }\n      case DocumentActionKind.MarkUses:\n      case DocumentActionKind.MarkReferences: {\n        action = new ReversibleDocumentAction(\n          new DocumentAction(actionKind, element, optionalData), action => {\n            ClearMarkedElement(action.Element);\n            ClearMarkedElement(action.Element.ParentTuple);\n            var refList = action.OptionalData as List<Reference>;\n\n            foreach (var reference in refList) {\n              ClearMarkedElement(reference.Element);\n              ClearMarkedElement(reference.Element.ParentTuple);\n            }\n\n            SelectAndActivateElement(action.Element);\n          });\n\n        break;\n      }\n      case DocumentActionKind.GoToDefinition: {\n        action = new ReversibleDocumentAction(\n          new DocumentAction(actionKind, element, optionalData),\n          action => { SelectAndActivateElement(action.Element); });\n\n        break;\n      }\n    }\n\n    if (action != null) {\n#if DEBUG\n      Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Record undo action {action}\");\n#endif\n      actionUndoStack_.Push(action);\n    }\n  }\n\n  private void SelectAndActivateElement(IRElement element) {\n    SelectElement(element);\n    SetCaretAtElement(element);\n    BringElementIntoView(element);\n  }\n\n  private bool UndoReversibleAction() {\n    if (actionUndoStack_.Count == 0) {\n      return false;\n    }\n\n    var undoAction = actionUndoStack_.Pop();\n    undoAction.Undo();\n    return true;\n  }\n\n  private ElementHighlighter GetHighlighter(HighlighingType type) {\n    return type switch {\n      HighlighingType.Hovered  => hoverHighlighter_,\n      HighlighingType.Selected => selectedHighlighter_,\n      HighlighingType.Marked   => markedHighlighter_,\n      _                        => throw new Exception(\"Unknown type\")\n    };\n  }\n\n  private void MarkElementsOnSourceLine(ElementHighlighter highlighter, int lineNumber, Color selectedColor,\n                                        bool raiseEvent, bool bringIntoView, SourceStackFrame inlinee) {\n    var style = highlighter == selectedHighlighter_ ? selectedStyle_ : new HighlightingStyle(selectedColor);\n    var group = new HighlightedElementGroup(style);\n    IRElement firstTuple = null;\n\n    foreach (var block in Function.Blocks) {\n      foreach (var tuple in block.Tuples) {\n        var sourceTag = tuple.GetTag<SourceLocationTag>();\n        bool found = false;\n\n        if (sourceTag == null) {\n          continue;\n        }\n\n        if (inlinee == null) {\n          found = sourceTag.Line == lineNumber;\n        }\n        else if (sourceTag.HasInlinees) {\n          found = sourceTag.Inlinees.Find(item => item.Function == inlinee.Function &&\n                                                  item.Line == lineNumber) != null;\n        }\n\n        if (found) {\n          group.Add(tuple);\n\n          if (firstTuple == null) {\n            firstTuple = tuple;\n          }\n\n          if (raiseEvent) {\n            RaiseElementHighlightingEvent(tuple, group, highlighter.Type,\n                                          HighlightingEventAction.AppendHighlighting);\n          }\n        }\n      }\n    }\n\n    if (!group.IsEmpty()) {\n      highlighter.Add(group);\n\n      if (bringIntoView) {\n        BringElementIntoView(firstTuple);\n      }\n    }\n\n    UpdateHighlighting();\n  }\n\n  private IRElement CreateDummyElement(int offset, int length) {\n    int line = Document.GetLineByOffset(offset).LineNumber;\n    var location = new ProfileExplorer.Core.TextLocation(offset, line, 0);\n    return new IRElement(location, length);\n  }\n\n  private void HandelNoElementSelection() {\n    UpdateHighlighting();\n    RaiseElementUnselectedEvent();\n    RaiseElementHighlightingEvent(null, null, HighlighingType.Selected,\n                                  HighlightingEventAction.ReplaceHighlighting);\n  }\n\n  private void AddBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var selectedElement = GetSelectedElement();\n\n    if (selectedElement != null) {\n      AddBookmark(selectedElement);\n    }\n  }\n\n  private void AddCommand(RoutedUICommand command, ExecutedRoutedEventHandler handler,\n                          CanExecuteRoutedEventHandler canExecuteHandler = null) {\n    var binding = new CommandBinding(command);\n    binding.Executed += handler;\n\n    if (canExecuteHandler != null) {\n      binding.CanExecute += canExecuteHandler;\n    }\n\n    CommandBindings.Add(binding);\n  }\n\n  private void AddSelectedElement(IRElement element, bool raiseEvent) {\n    selectedElements_.Add(element);\n    var previousBlock = currentBlock_;\n    currentBlock_ = element.ParentBlock;\n\n    if (raiseEvent) {\n      if (currentBlock_ != previousBlock) {\n        RaiseBlockSelectedEvent(currentBlock_);\n      }\n\n      RaiseElementSelectedEvent(element);\n    }\n  }\n\n  private void ScrollBar_MouseLeave(object sender, MouseEventArgs e) {\n    if (hoveredBarElement_ != null) {\n      hoveredBarElement_.Style.Border = null;\n      hoveredBarElement_ = null;\n      RenderMarkerBar();\n    }\n\n    HideTemporaryUI();\n  }\n\n  private void ScrollBar_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    HideTemporaryUI();\n    var position = e.GetPosition(markerMargin_);\n    var barElement = FindMarkerBarElement(position);\n\n    if (barElement != null && barElement.HandlesInput) {\n      ignoreNextPreviewElement_ = barElement.Element;\n      ignoreNextBarHover_ = true;\n      ignoreNextScrollEvent_ = true;\n      BringElementIntoView(barElement.Element);\n      e.Handled = true;\n    }\n  }\n\n  private async void ScrollBar_PreviewMouseMove(object sender, MouseEventArgs e) {\n    if (ignoreNextBarHover_) {\n      ignoreNextBarHover_ = false;\n      return;\n    }\n\n    if (e.LeftButton != MouseButtonState.Released ||\n        e.RightButton != MouseButtonState.Released) {\n      return;\n    }\n\n    bool needsRendering = false;\n\n    if (hoveredBarElement_ != null) {\n      hoveredBarElement_.Style.Border = null;\n      hoveredBarElement_ = null;\n      needsRendering = true;\n    }\n\n    var position = e.GetPosition(markerMargin_);\n    var barElement = FindMarkerBarElement(position);\n\n    if (barElement != null && barElement.HandlesInput) {\n      barElement.Style.Border = ColorPens.GetBoldPen(Colors.Black);\n      hoveredBarElement_ = barElement;\n      needsRendering = true;\n      await ShowPreviewPopup(barElement.Element);\n    }\n    else {\n      HideTemporaryUI();\n    }\n\n    if (needsRendering) {\n      RenderMarkerBar(true);\n    }\n  }\n\n  private void Caret_PositionChanged(object sender, EventArgs e) {\n    if (disableCaretEvent_) {\n      return;\n    }\n\n    // Trigger event, used during diff mode to sync caret with other document.\n    CaretChanged?.Invoke(this, TextArea.Caret.Offset);\n\n    if (ignoreNextCaretEvent_) {\n      ignoreNextCaretEvent_ = false;\n      return;\n    }\n\n    var element = FindElementAtOffset(TextArea.Caret.Offset);\n    SelectElement(element, true, false, TextArea.Caret.Offset);\n  }\n\n  private void ClearAllMarkersExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ClearAllMarkers();\n  }\n\n  private void ClearAllMarkers() {\n    ClearBlockMarkers();\n    ClearInstructionMarkers();\n    overlayRenderer_.Clear();\n    TextArea.TextView.Redraw();\n  }\n\n  private void ClearBlockMarkersExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ClearBlockMarkers();\n    MirrorAction(DocumentActionKind.ClearBlockMarkers, null);\n  }\n\n  private void ClearBlockMarkers() {\n    // Don't respond to block removal events, it changes the list being iterated\n    // and all blocks will be removed after that anyway.\n    margin_.DisableBlockRemoval = true;\n    margin_.ForEachBlockElement(element => { RaiseElementRemoveHighlightingEvent(element); });\n    margin_.DisableBlockRemoval = false;\n    margin_.ClearMarkers();\n    UpdateMargin();\n  }\n\n  private void ClearInstructionMarkersExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ClearInstructionMarkers();\n    MirrorAction(DocumentActionKind.ClearBlockMarkers, null);\n  }\n\n  private void ClearMarkerExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetSelectedElement() is var element) {\n      ClearMarkedElement(element);\n    }\n  }\n\n  public void ClearSelectedElements() {\n    selectedHighlighter_.Clear();\n    selectedElements_.Clear();\n    UpdateHighlighting();\n  }\n\n  private void ClearTemporaryHighlighting(bool clearSelected = true) {\n    if (!IsLoaded) {\n      return;\n    }\n\n    HideHoverHighlighting();\n\n    if (clearSelected) {\n      ClearSelectedElements();\n    }\n\n    if (overlayRendererConnectedTemporarely_) {\n      overlayRenderer_.ClearConnectedElements();\n    }\n  }\n\n  private void CreateRightMarkerMargin() {\n    if (markerMargin_ != null) {\n      return; // Margin already set up.\n    }\n\n    // Find the right scrollbar and place the canvas under it,\n    // then make it semi-transparent so that the canvas is visible.\n    var scrollViewer = Utils.FindChild<ScrollViewer>(this);\n\n    if (scrollViewer != null) {\n      docVerticalScrollBar_ = Utils.FindChild<ScrollBar>(scrollViewer);\n\n      if (docVerticalScrollBar_ != null) {\n        docVerticalScrollBar_.Opacity = 0.6;\n        docVerticalScrollBar_.PreviewMouseMove += ScrollBar_PreviewMouseMove;\n        docVerticalScrollBar_.PreviewMouseLeftButtonDown += ScrollBar_PreviewMouseLeftButtonDown;\n        docVerticalScrollBar_.MouseLeave += ScrollBar_MouseLeave;\n        var parent = VisualTreeHelper.GetParent(docVerticalScrollBar_) as Grid;\n        markerMargin_ = new Canvas();\n        Panel.SetZIndex(markerMargin_, 1);\n        Panel.SetZIndex(docVerticalScrollBar_, 2);\n        Grid.SetColumn(markerMargin_, Grid.GetColumn(docVerticalScrollBar_));\n        markerMargin_.Background = Brushes.White;\n        parent.Children.Add(markerMargin_);\n      }\n    }\n  }\n\n  private void ResetRenderers() {\n    markerBarUpdateTask_.CancelTask();\n    bookmarks_?.Clear();\n    hoverHighlighter_?.Clear();\n    selectedHighlighter_?.Clear();\n    markedHighlighter_?.Clear();\n    blockHighlighter_?.Clear();\n    diffHighlighter_?.Clear();\n    remarkHighlighter_?.Clear();\n    overlayRenderer_?.Clear();\n    margin_?.Reset();\n  }\n\n  private bool EditBookmarkText(Bookmark bookmark, Key key) {\n    // Because a TextBox is not used for the bookmarks,\n    // editing the optional text must be handled manually.\n    // This method is not part of Bookmark because it handles lots\n    // of state through the BookmarkManager.\n    var keyInfo = Utils.KeyToChar(key);\n\n    if (keyInfo.IsLetter) {\n      // Append a new letter.\n      string keyString = keyInfo.Letter.ToString();\n      string text = bookmark.Text;\n\n      if (text == null) {\n        text = keyString;\n      }\n      else {\n        text += keyString;\n      }\n\n      bookmark.Text = text;\n      margin_.SelectedBookmarkChanged();\n      RaiseBookmarkChangedEvent(bookmark);\n    }\n    else if (key == Key.Back) {\n      // Remove last letter.\n      string text = bookmark.Text;\n\n      if (!string.IsNullOrEmpty(text)) {\n        text = text.Substring(0, text.Length - 1);\n        bookmark.Text = text;\n        margin_.SelectedBookmarkChanged();\n        RaiseBookmarkChangedEvent(bookmark);\n      }\n    }\n    else if (key == Key.Return) {\n      if (Utils.IsKeyboardModifierActive()) {\n        bookmark.IsPinned = true;\n      }\n\n      margin_.UnselectBookmark();\n      margin_.SelectedBookmarkChanged();\n      RaiseBookmarkChangedEvent(bookmark);\n    }\n    else if (key == Key.Delete) {\n      // Delete all text.\n      bookmark.Text = \"\";\n      margin_.SelectedBookmarkChanged();\n      RaiseBookmarkChangedEvent(bookmark);\n    }\n    else if (key == Key.F2) {\n      if (Utils.IsShiftModifierActive()) {\n        PreviousBookmarkExecuted(this, null);\n      }\n      else {\n        NextBookmarkExecuted(this, null);\n      }\n\n      return true;\n    }\n    else if (keyInfo.IsShift && keyInfo.IsControl) {\n      if (keyInfo.Letter == 'B') {\n        RemoveBookmark(bookmark);\n      }\n    }\n    else if (!Utils.IsKeyboardModifierActive()) {\n      margin_.UnselectBookmark();\n      margin_.SelectedBookmarkChanged();\n      return false;\n    }\n\n    return true;\n  }\n\n  private IRElement FindElementAtOffset(int offset) {\n    // Exit if the element lists are still being computed or\n    // for source code documents.\n    if (DuringSectionLoading || Function == null) {\n      return null;\n    }\n\n    IRElement element;\n\n    if (DocumentUtils.FindElement(offset, operandElements_, out element) ||\n        DocumentUtils.FindElement(offset, tupleElements_, out element) ||\n        DocumentUtils.FindElement(offset, blockElements_, out element)) {\n      return element;\n    }\n\n    return null;\n  }\n\n  private MarkerBarElement FindMarkerBarElement(Point position) {\n    if (markerMargingElements_ != null) {\n      //? TODO: This is inefficient, at least sort by Y and do binary search\n      foreach (var barElement in markerMargingElements_) {\n        if (barElement.Element == null) {\n          continue;\n        }\n\n        if (barElement.Visual.Contains(position)) {\n          return barElement;\n        }\n\n        if (barElement.Visual.Top > position.Y) {\n          break;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  private IRElement FindPointedElement(Point position, out int textOffset) {\n    if (Function == null) { // For source code documents.\n      textOffset = 0;\n      return null;\n    }\n\n    int offset = DocumentUtils.GetOffsetFromMousePosition(position, this, out _);\n\n    if (offset != -1) {\n      textOffset = offset;\n      return FindElementAtOffset(offset);\n    }\n\n    textOffset = -1;\n    return null;\n  }\n\n  private void FirstBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToBookmark(bookmarks_.JumpToFirstBookmark());\n  }\n\n  private HighlightingStyle GetMarkerStyleForCommand(ExecutedRoutedEventArgs e) {\n    if (e != null && e.Parameter is SelectedColorEventArgs colorArgs) {\n      return new HighlightingStyle(colorArgs.SelectedColor);\n    }\n\n    return PickMarkerStyle();\n  }\n\n  private PairHighlightingStyle GetPairMarkerStyleForCommand(ExecutedRoutedEventArgs e) {\n    if (e != null && e.Parameter is SelectedColorEventArgs colorArgs) {\n      var style = new HighlightingStyle(colorArgs.SelectedColor);\n\n      return new PairHighlightingStyle {\n        ChildStyle = new HighlightingStyle(colorArgs.SelectedColor),\n        ParentStyle = new HighlightingStyle(Utils.ChangeColorLuminisity(colorArgs.SelectedColor, 1.4))\n      };\n    }\n\n    return PickPairMarkerStyle();\n  }\n\n  private PairHighlightingStyle GetReferenceStyle(Reference reference) {\n    //? TODO: Expose colors in settings\n    return reference.Kind switch {\n      ReferenceKind.Address => new PairHighlightingStyle {\n        ChildStyle = new HighlightingStyle(\"#FF9090\", ColorPens.GetBoldPen(Colors.DarkRed)),\n        ParentStyle = new HighlightingStyle(\"#FFC9C9\")\n      },\n      ReferenceKind.Load => new PairHighlightingStyle {\n        ChildStyle = new HighlightingStyle(\"#BDBAEC\", ColorPens.GetPen(Colors.DarkBlue)),\n        ParentStyle = new HighlightingStyle(\"#D9D8F4\")\n      },\n      ReferenceKind.Store => ssaUserStyle_,\n      ReferenceKind.SSA => new PairHighlightingStyle {\n        ChildStyle = new HighlightingStyle(\"#BAD6EC\", ColorPens.GetPen(Colors.DarkBlue)),\n        ParentStyle = new HighlightingStyle(\"#D8E9F4\")\n      },\n      _ => throw new InvalidOperationException(\"Unknown ReferenceKind\")\n    };\n  }\n\n  public IRElement GetSelectedElement() {\n    if (selectedElements_.Count == 0) {\n      return null;\n    }\n\n    var selectedEnum = selectedElements_.GetEnumerator();\n    selectedEnum.MoveNext();\n    return selectedEnum.Current;\n  }\n\n  private OperandIR GetSelectedElementDefinition() {\n    var defs = GetSelectedElementDefinitions();\n    return defs.Count == 1 ? defs[0] : null;\n  }\n\n  private List<OperandIR> GetSelectedElementDefinitions() {\n    var selectedOp = GetSelectedElement();\n\n    if (!(selectedOp is OperandIR op)) {\n      return new List<OperandIR>();\n    }\n\n    var refFinder = CreateReferenceFinder();\n    return refFinder.FindAllDefinitions(op).\n      ConvertAll(item => item as OperandIR);\n  }\n\n  private void UndoActionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    UndoReversibleAction();\n    e.Handled = true;\n  }\n\n  private void UndoActionCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = actionUndoStack_.Count > 0;\n    e.Handled = true;\n  }\n\n  private void GoToDefinitionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetSelectedElement() is var element) {\n      if (!TryOpenFunctionCallTarget(element)) {\n        GoToElementDefinition(element);\n        MirrorAction(DocumentActionKind.GoToDefinition, element);\n      }\n    }\n  }\n\n  private async void PreviewDefinitionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetSelectedElement() is var element) {\n      await ShowDefinitionPreview(element, true);\n    }\n  }\n\n  private void GoToDefinitionSkipCopiesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetSelectedElement() is var element) {\n      if (!TryOpenFunctionCallTarget(element)) {\n        GoToElementDefinition(element, true);\n        MirrorAction(DocumentActionKind.GoToDefinition, element);\n      }\n    }\n  }\n\n  private IRElement SkipAllCopies(IRElement op) {\n    //? TODO: This should be in some IR utility class.\n    var defInstr = op.ParentInstruction;\n\n    while (defInstr != null) {\n      var sourceOp = Session.CompilerInfo.IR.SkipCopyInstruction(defInstr);\n\n      if (sourceOp != null && sourceOp != defInstr) {\n        op = sourceOp;\n        defInstr = sourceOp.ParentInstruction;\n      }\n      else {\n        break;\n      }\n    }\n\n    return op;\n  }\n\n  private ReferenceFinder CreateReferenceFinder() {\n    return DocumentUtils.CreateReferenceFinder(Function, Session,\n                                               settings_ as DocumentSettings);\n  }\n\n  private bool GoToElementDefinition(IRElement element, bool skipCopies = false) {\n    RecordReversibleAction(DocumentActionKind.GoToDefinition, element);\n    ClearTemporaryHighlighting();\n\n    if (element == null) {\n      return false;\n    }\n\n    if (element is OperandIR op) {\n      // If it's a destination operand and has a single user, jump to it.\n      var refFinder = CreateReferenceFinder();\n\n      if (op.Role == OperandRole.Destination) {\n        var useOp = refFinder.GetSingleUse(op);\n\n        if (useOp != null) {\n          HighlightSingleElement(useOp, selectedHighlighter_);\n          SetCaretAtElement(useOp);\n          return true;\n        }\n      }\n\n      // Try to find a definition for the source operand.\n      var defOp = refFinder.FindSingleDefinition(op);\n\n      if (defOp != null) {\n        if (skipCopies) {\n          defOp = SkipAllCopies(defOp);\n        }\n\n        HighlightSingleElement(defOp, selectedHighlighter_);\n        SetCaretAtElement(defOp);\n        return true;\n      }\n\n      if (op.IsLabelAddress) {\n        // For labels go to the target block.\n        var targetOp = op.BlockLabelValue;\n        HighlightSingleElement(targetOp, selectedHighlighter_);\n        SetCaretAtElement(targetOp);\n        return true;\n      }\n    }\n    else if (element is InstructionIR instr) {\n      // For single-source instructions, go to the source definition.\n      if (instr.Sources.Count == 1) {\n        GoToElementDefinition(instr.Sources[0]);\n      }\n    }\n\n    return false;\n  }\n\n  private void HandleElement(IRElement element, ElementHighlighter highlighter,\n                             bool markExpression, bool markReferences) {\n    var action = HighlightingEventAction.ReplaceHighlighting;\n    bool highlighted = false;\n\n    if (element is OperandIR op) {\n      highlighted = HandleOperandElement(op, highlighter, markExpression,\n                                         markReferences, action);\n    }\n    else if (element is InstructionIR instr) {\n      highlighted = HandleInstructionElement(instr, highlighter, markExpression, ref action);\n    }\n    else if (element is BlockLabelIR blockLabel) {\n      highlighted = HandleBlockLabel(highlighter, action, blockLabel);\n    }\n\n    if (!highlighted) {\n      HandleOtherElement(element, highlighter, action);\n    }\n  }\n\n  private bool HandleBlockLabel(ElementHighlighter highlighter, HighlightingEventAction action,\n                                BlockLabelIR blockLabel) {\n    var block = blockLabel.Parent;\n\n    if (block.Predecessors.Count == 0) {\n      return false;\n    }\n\n    // Mark all branches referencing the label.\n    var group = new HighlightedElementGroup(ssaDefinitionStyle_.ChildStyle);\n\n    foreach (var predBlock in block.Predecessors) {\n      var branchInstr = Session.CompilerInfo.IR.GetTransferInstruction(predBlock);\n\n      if (branchInstr != null) {\n        group.Add(branchInstr);\n        RaiseElementHighlightingEvent(branchInstr, group, highlighter.Type, action);\n      }\n    }\n\n    // Mark the label itself.\n    group.Add(blockLabel);\n    RaiseElementHighlightingEvent(blockLabel, group, highlighter.Type, action);\n    highlighter.Add(group);\n    return true;\n  }\n\n  private bool HandleInstructionElement(InstructionIR instr, ElementHighlighter highlighter,\n                                        bool markExpression, ref HighlightingEventAction action) {\n    if (markExpression) {\n      // Mark an entire SSA def-use expression DAG.\n      HighlightExpression(instr, highlighter, expressionOperandStyle_, expressionStyle_);\n      return true;\n    }\n\n    if (settings_ is not DocumentSettings docSettings) {\n      return false;\n    }\n\n    if (!docSettings.HighlightInstructionOperands) {\n      return false;\n    }\n\n    // Highlight each source operand. The instruction itself\n    // is also highlighted below, in append mode.\n    action = HighlightingEventAction.AppendHighlighting;\n    RaiseRemoveHighlightingEvent(highlighter.Type);\n\n    foreach (var sourceOp in instr.Sources) {\n      if (sourceOp.IsLabelAddress) {\n        HighlightBlockLabel(sourceOp, highlighter, ssaUserStyle_, action);\n      }\n      else {\n        HighlightDefinition(sourceOp, highlighter, ssaDefinitionStyle_, action, false);\n      }\n    }\n\n    if (docSettings.HighlightDestinationUses) {\n      foreach (var destOp in instr.Destinations) {\n        HandleOperandElement(destOp, highlighter, markExpression, false, action);\n      }\n    }\n\n    return true;\n  }\n\n  private bool HandleOperandElement(OperandIR op, ElementHighlighter highlighter,\n                                    bool markExpression, bool markReferences,\n                                    HighlightingEventAction action) {\n    if (settings_ is not DocumentSettings docSettings) {\n      return false;\n    }\n\n    if (op.Role == OperandRole.Source) {\n      if (markExpression) {\n        // Mark an entire SSA def-use expression DAG.\n        HighlightExpression(op, highlighter, expressionOperandStyle_, expressionStyle_);\n        return true;\n      }\n\n      // Further handling of sources is done below.\n    }\n    else if ((op.Role == OperandRole.Destination || op.Role == OperandRole.Parameter) &&\n             docSettings.HighlightDestinationUses) {\n      // First look for an SSA definition and its uses,\n      // if not found highlight every load of the same symbol.\n      var refFinder = CreateReferenceFinder();\n      var useList = refFinder.FindAllUses(op);\n      List<IRElement> iteratedUseList = null;\n      bool handled = false;\n\n      //? TODO: Default expansion needs an option\n      if (markExpression) {\n        // Collect the transitive set of users, marking instructions\n        // that depend on the value of this destination operand.\n        iteratedUseList = ExpandIteratedUseList(op, useList);\n        handled = true;\n      }\n      else if (markReferences) {\n        MarkReferences(op, highlighter);\n      }\n\n      if (useList.Count > 0) {\n        HighlightUsers(op, useList, highlighter, ssaUserStyle_, action);\n        handled = true;\n\n        if (iteratedUseList != null && iteratedUseList.Count > 0) {\n          HighlightUsers(op, iteratedUseList, highlighter, iteratedUserStyle_, action);\n        }\n      }\n\n      // If the operand is an indirection, also try to mark\n      // the definition of the base address value below.\n      if (!op.IsIndirection) {\n        return handled;\n      }\n    }\n\n    if (docSettings.HighlightSourceDefinition) {\n      if (op.IsLabelAddress) {\n        return HighlightBlockLabel(op, highlighter, ssaUserStyle_, action);\n      }\n\n      if (markReferences) {\n        MarkReferences(op, highlighter);\n        return true;\n      }\n\n      return HighlightDefinition(op, highlighter, ssaDefinitionStyle_, action);\n    }\n\n    return false;\n  }\n\n  private List<IRElement> ExpandIteratedUseList(OperandIR operand, List<IRElement> useList) {\n    var handledElements = new HashSet<IRElement>(useList.Count);\n\n    foreach (var use in useList) {\n      handledElements.Add(use);\n    }\n\n    // Each expansion of the same element doubles the recursion depth.\n    if (currentExprElement_ == operand) {\n      currentExprLevel_ += ExpressionLevelIncrement;\n    }\n    else {\n      currentExprElement_ = operand;\n      currentExprLevel_ = DefaultMaxExpressionLevel;\n    }\n\n    int maxLevel = currentExprLevel_;\n    var refFinder = CreateReferenceFinder();\n    var newUseList = new List<IRElement>(useList);\n\n    ExpandIteratedUseList(newUseList, handledElements, 0, maxLevel, refFinder);\n    newUseList.RemoveRange(0, useList.Count);\n    return newUseList;\n  }\n\n  private void ExpandIteratedUseList(List<IRElement> useList, HashSet<IRElement> handledElements,\n                                     int level, int maxLevel, ReferenceFinder refFinder) {\n    if (level > maxLevel) {\n      return;\n    }\n\n    var newUseLists = new List<List<IRElement>>(1 << maxLevel - level + 1);\n\n    foreach (var use in useList) {\n      if (use is not OperandIR op) {\n        continue;\n      }\n\n      var useInstr = op.ParentInstruction;\n\n      if (useInstr != null) {\n        foreach (var iteratedUse in refFinder.FindAllUses(useInstr)) {\n          if (!handledElements.Add(iteratedUse)) {\n            continue; // Use already visited during recursion.\n          }\n\n          // Recursively iterate over and collect uses.\n          var iteratedUseList = new List<IRElement>(1 << maxLevel - level);\n          iteratedUseList.Add(iteratedUse);\n\n          ExpandIteratedUseList(iteratedUseList, handledElements,\n                                level + 1, maxLevel, refFinder);\n          newUseLists.Add(iteratedUseList);\n        }\n      }\n    }\n\n    // Merge the children lists into the input list.\n    // This is fairly inefficient, but not an issue with the max. level used.\n    foreach (var list in newUseLists) {\n      useList.AddRange(list);\n    }\n  }\n\n  private void HandleOtherElement(IRElement element, ElementHighlighter highlighter,\n                                  HighlightingEventAction action) {\n    var style = element is BlockIR ? selectedBlockStyle_ : selectedStyle_;\n    HandleOtherElement(element, highlighter, style, action);\n  }\n\n  private void HandleOtherElement(IRElement element, ElementHighlighter highlighter,\n                                  HighlightingStyle style, HighlightingEventAction action) {\n    var group = new HighlightedElementGroup(element, style);\n    highlighter.Add(group);\n    RaiseElementHighlightingEvent(element, group, highlighter.Type, action);\n  }\n\n  private void HideTemporaryUI() {\n    HidePreviewPopup();\n    margin_.UnselectBookmark();\n  }\n\n  private void HidePreviewPopup(bool force = false) {\n    ignoreNextPreviewElement_ = null;\n\n    if (previewPopup_ != null && (force || !previewPopup_.IsMouseOver)) {\n      previewPopup_.ClosePopup();\n      previewPopup_ = null;\n    }\n  }\n\n  private bool HighlightBlockLabel(OperandIR op, ElementHighlighter highlighter,\n                                   PairHighlightingStyle style, HighlightingEventAction action) {\n    var labelOp = op.BlockLabelValue;\n\n    if (labelOp?.Parent == null) {\n      return false;\n    }\n\n    var group = new HighlightedElementGroup(style.ChildStyle);\n    group.Add(op);\n    group.Add(labelOp);\n    highlighter.Add(group);\n    RaiseElementHighlightingEvent(op, group, highlighter.Type, action);\n    return true;\n  }\n\n  private HighlightedElementGroup HighlightDefinedOperand(IRElement op, IRElement defElement,\n                                                          ElementHighlighter highlighter,\n                                                          PairHighlightingStyle style) {\n    var group = new HighlightedElementGroup(style.ChildStyle);\n    group.Add(op);\n    group.Add(defElement);\n    highlighter.Add(group);\n    return group;\n  }\n\n  private HighlightedElementGroup HighlightInstruction(InstructionIR instr, ElementHighlighter highlighter,\n                                                       PairHighlightingStyle style) {\n    var group = new HighlightedElementGroup(instr, style.ParentStyle);\n    highlighter.Add(group);\n    return group;\n  }\n\n  private HighlightedElementGroup HighlightOperand(IRElement op, ElementHighlighter highlighter,\n                                                   PairHighlightingStyle style) {\n    var group = new HighlightedElementGroup(op, style.ChildStyle);\n    highlighter.Add(group);\n    return group;\n  }\n\n  private void HighlightSingleElement(IRElement element, ElementHighlighter highlighter) {\n    ClearTemporaryHighlighting(highlighter.Type == HighlighingType.Selected);\n    highlighter.Clear();\n\n    if (element is OperandIR op && op.Parent != null) {\n      // Also highlight operand's parent instruction.\n      highlighter.Add(new HighlightedElementGroup(op.Parent, definitionStyle_.ParentStyle));\n    }\n\n    if (element is BlockIR && highlighter.Type == HighlighingType.Selected) {\n      highlighter.Add(new HighlightedElementGroup(element, selectedBlockStyle_));\n    }\n    else {\n      highlighter.Add(new HighlightedElementGroup(element, definitionStyle_.ChildStyle));\n    }\n\n    BringElementIntoView(element);\n  }\n\n  private bool HighlightDefinition(OperandIR op, ElementHighlighter highlighter,\n                                   PairHighlightingStyle style, HighlightingEventAction action,\n                                   bool highlightDefInstr = true) {\n    // First look for an SSA definition, if not found\n    // highlight every store to the same symbol.\n    var refFinder = CreateReferenceFinder();\n    var defList = refFinder.FindAllDefinitions(op);\n\n    if (defList.Count == 0) {\n      return false;\n    }\n\n    // Highlight the definition instructions.\n    if (highlightDefInstr) {\n      var instrGroup = new HighlightedElementGroup(style.ParentStyle);\n\n      foreach (var element in defList) {\n        instrGroup.Add(element.ParentTuple);\n      }\n\n      highlighter.Add(instrGroup);\n    }\n\n    // Highlight the definitions.\n    var group = new HighlightedElementGroup(op, style.ChildStyle);\n\n    foreach (var element in defList) {\n      group.Add(element);\n    }\n\n    highlighter.Add(group);\n    RaiseElementHighlightingEvent(op, group, highlighter.Type, action);\n    return true;\n  }\n\n  private void HighlightExpression(IRElement element, ElementHighlighter highlighter,\n                                   HighlightingStyleCollection style,\n                                   HighlightingStyleCollection instrStyle) {\n    var locationTag = element.GetTag<SourceLocationTag>();\n    var handledElements = new HashSet<IRElement>(128);\n\n    // Each expansion of the same element doubles the recursion depth.\n    if (currentExprElement_ == element) {\n      currentExprLevel_ += ExpressionLevelIncrement;\n    }\n    else {\n      currentExprElement_ = element;\n      currentExprStyleIndex_ = new Random().Next(style.Styles.Count - 1);\n      currentExprLevel_ = DefaultMaxExpressionLevel;\n    }\n\n    int maxLevel = currentExprLevel_;\n    int styleIndex = currentExprStyleIndex_;\n    var refFinder = CreateReferenceFinder();\n    HighlightExpression(element, null, handledElements,\n                        highlighter, style, instrStyle, styleIndex,\n                        0, maxLevel, refFinder);\n  }\n\n  private void HighlightExpression(IRElement element, IRElement parent, HashSet<IRElement> handledElements,\n                                   ElementHighlighter highlighter, HighlightingStyleCollection style,\n                                   HighlightingStyleCollection instrStyle, int styleIndex,\n                                   int level, int maxLevel, ReferenceFinder refFinder) {\n    if (!handledElements.Add(element)) {\n      return; // Element already handled during recursion.\n    }\n\n    switch (element) {\n      case OperandIR op: {\n        //highlighter.Add(new HighlightedGroup(element, style.ForIndex(styleIndex)));\n        highlighter.Add(new HighlightedElementGroup(element, iteratedDefinitionStyle_.ChildStyle));\n\n        if (level >= maxLevel) {\n          return;\n        }\n\n        var sourceDefOp = refFinder.FindSingleDefinition(op);\n\n        if (sourceDefOp != null) {\n          //highlighter.Add(new HighlightedGroup(sourceDefOp, style.ForIndex(styleIndex)));\n          highlighter.Add(new HighlightedElementGroup(sourceDefOp, iteratedDefinitionStyle_.ChildStyle));\n\n          if (sourceDefOp.ParentInstruction != null) {\n            HighlightExpression(sourceDefOp.ParentInstruction, parent, handledElements,\n                                highlighter, style, instrStyle, styleIndex,\n                                level, maxLevel, refFinder);\n          }\n        }\n\n        break;\n      }\n      case InstructionIR instr: {\n        //highlighter.Add(new HighlightedGroup(instr, instrStyle.ForIndex(styleIndex)));\n        highlighter.Add(new HighlightedElementGroup(instr, iteratedDefinitionStyle_.ParentStyle));\n\n        if (level >= maxLevel) {\n          return;\n        }\n\n        foreach (var sourceOp in instr.Sources) {\n          HighlightExpression(sourceOp, instr, handledElements, highlighter, style,\n                              instrStyle, styleIndex, level + 1, maxLevel, refFinder);\n        }\n\n        if (level > 0) {\n          foreach (var destOp in instr.Destinations) {\n            HighlightExpression(destOp, instr, handledElements, highlighter, style,\n                                instrStyle, styleIndex, level + 1, maxLevel, refFinder);\n          }\n        }\n\n        break;\n      }\n    }\n  }\n\n  private void ResetExpressionLevel(IRElement element = null) {\n    if (element == null || element != currentExprElement_ ||\n        !Utils.IsControlModifierActive()) {\n      currentExprElement_ = null;\n      currentExprLevel_ = 0;\n    }\n  }\n\n  private void HighlightUsers(OperandIR op, List<IRElement> useList, ElementHighlighter highlighter,\n                              PairHighlightingStyle style, HighlightingEventAction action) {\n    var instrGroup = new HighlightedElementGroup(style.ParentStyle);\n    var useGroup = new HighlightedElementGroup(style.ChildStyle);\n    useGroup.Add(op);\n\n    //? TODO: Implement arrows - either to all uses, or just ones outside view\n    // overlayRenderer_.SetRootElement(op, new HighlightingStyle(Colors.Black));\n    // overlayRendererConnectedTemporarely_ = highlighter.Type != HighlighingType.Marked;\n    // var arrowStyle = new HighlightingStyle(Colors.DarkGreen, ColorPens.GetDashedPen(Colors.DarkGreen, DashStyles.Dash, 1.5));\n\n    foreach (var use in useList) {\n      useGroup.Add(use);\n      var useInstr = use.ParentTuple;\n\n      if (useInstr != null) {\n        instrGroup.Add(useInstr);\n      }\n\n      // overlayRenderer_.AddConnectedElement(use.Element, arrowStyle);\n    }\n\n    highlighter.Add(instrGroup);\n    highlighter.Add(useGroup);\n    RaiseElementHighlightingEvent(op, useGroup, highlighter.Type, action);\n  }\n\n  private async void IRDocument_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    // If Ctrl is pressed, instead of go to definition\n    // the action is a text search, which is handled by the host.\n    if (Utils.IsControlModifierActive()) {\n      return;\n    }\n\n    var position = e.GetPosition(TextArea.TextView);\n    var element = FindPointedElement(position, out _);\n\n    if (TryOpenFunctionCallTarget(element)) {\n      e.Handled = true;\n      return;\n    }\n\n    e.Handled = GoToElementDefinition(element, Utils.IsAltModifierActive());\n  }\n\n  private bool TryOpenFunctionCallTarget(IRElement element) {\n    // For call function names, notify owner in case it wants\n    // to switch the view to the called function.\n    if (IsCallTargetElement(element)) {\n      var targetSection = DocumentUtils.FindCallTargetSection(element, Section, Session);\n\n      if (targetSection != null && FunctionCallOpen != null) {\n        FunctionCallOpen.Invoke(this, targetSection);\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  private async void IRDocument_PreviewMouseHover(object sender, MouseEventArgs e) {\n    if (settings_ is not DocumentSettings docSettings) {\n      return;\n    }\n\n    if (ignoreNextHoverEvent_) {\n      ignoreNextHoverEvent_ = false;\n      return;\n    }\n\n    bool highlightElement = docSettings.ShowInfoOnHover &&\n                            (!docSettings.ShowInfoOnHoverWithModifier ||\n                             Utils.IsKeyboardModifierActive());\n\n    if (!highlightElement) {\n      return;\n    }\n\n    var position = e.GetPosition(TextArea.TextView);\n    var element = FindPointedElement(position, out _);\n\n    if (element != null) {\n      if (removeHoveredAction_ != null) {\n        removeHoveredAction_.Cancel();\n        removeHoveredAction_ = null;\n      }\n\n      if (element == hoveredElement_) {\n        return;\n      }\n\n      // For hover ignore blocks and instructions, it's too jarring.\n      if (!selectedElements_.Contains(element) &&\n          !(element is BlockIR) &&\n          !(element is InstructionIR)) {\n        bool previewDisplayed = await ShowDefinitionPreview(element);\n\n        if (previewDisplayed) {\n          HideHoverHighlighting();\n          hoveredElement_ = element;\n          HandleElement(element, hoverHighlighter_,\n                        Utils.IsControlModifierActive(),\n                        Utils.IsShiftModifierActive());\n          UpdateHighlighting();\n          return;\n        }\n      }\n    }\n\n    HideHoverHighlighting();\n    UpdateHighlighting();\n  }\n\n  private void IRDocument_PreviewMouseHoverStopped(object sender, MouseEventArgs e) {\n    removeHoveredAction_ = DelayedAction.StartNew(() => {\n      if (removeHoveredAction_ != null) {\n        removeHoveredAction_ = null;\n        HideHoverHighlighting();\n        HidePreviewPopup();\n      }\n    });\n\n    ignoreNextHoverEvent_ = false;\n  }\n\n  private void HideHoverHighlighting() {\n    if (hoveredElement_ == null) {\n      return;\n    }\n\n    RaiseElementHighlightingEvent(null, null, HighlighingType.Hovered,\n                                  HighlightingEventAction.ReplaceHighlighting);\n\n    hoverHighlighter_.Clear();\n    hoveredElement_ = null;\n  }\n\n  private void IRDocument_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e) {\n    HidePreviewPopup();\n    selectingText_ = false;\n\n    if (ignoreNextScrollEvent_) {\n      ignoreNextScrollEvent_ = false;\n      //e.Handled = true;\n    }\n  }\n\n  private void IRDocument_PreviewMouseMove(object sender, MouseEventArgs e) {\n    ForceCursor = true;\n    Cursor = Cursors.Arrow;\n    margin_.MouseMoved(e);\n\n    // Don't send event to overlays that may extend under the scrollbar.\n    if (!disableOverlayEvents_ &&\n        (docVerticalScrollBar_ == null || !docVerticalScrollBar_.IsMouseOver) &&\n        e.LeftButton == MouseButtonState.Released &&\n        e.RightButton == MouseButtonState.Released) {\n      overlayRenderer_.MouseMoved(e);\n    }\n  }\n\n  private void IRDocument_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) {\n    Focus();\n    HideTemporaryUI();\n  }\n\n  private bool IsElementOutsideView(IRElement element) {\n    if (!TextArea.TextView.VisualLinesValid) {\n      return true;\n    }\n\n    int targetLine = element.TextLocation.Line;\n    var visualLines = TextArea.TextView.VisualLines;\n    int viewStart = visualLines[0].FirstDocumentLine.LineNumber;\n    int viewEnd = visualLines[^1].LastDocumentLine.LineNumber;\n    return targetLine < viewStart || targetLine > viewEnd;\n  }\n\n  private void LastBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToBookmark(bookmarks_.JumpToLastBookmark());\n  }\n\n  private async Task ComputeElementListsAsync() {\n    // Compute the element lists on another thread, for large functions\n    // it can be slow would block showing of any text before it's done.\n    await Task.Run(() => ComputeElementLists());\n  }\n\n  private async Task LateLoadSectionSetup(ParsedIRTextSection parsedSection,\n                                          bool isSourceCode = false) {\n#if DEBUG\n    Trace.TraceInformation(\n      $\"Document {ObjectTracker.Track(this)}: Complete setup for {parsedSection}\");\n#endif\n\n    // Folding uses the basic block boundaries.\n    actionUndoStack_.Clear();\n    SetupBlockHighlighter();\n    SetupBlockFolding();\n    ClearElementOverlays();\n\n    CreateRightMarkerMargin();\n    MarkLoopBlocks();\n    DuringSectionLoading = false;\n    IsLoaded = true;\n\n    //? TODO: Check if other sections have marked elements and try to mark same ones\n    //!  - session can be queried\n    //!  - load func and deserialize state object\n    //!    - for each marker/bookmark, use FindEquivalentValue\n    //!    - maybe set \"no saving\" flag for these copied markers\n    //var other = Session.GetNextSection(Section);\n    //if (other != null)\n    //    CloneOtherSectionAnnotations(other);\n\n    // Do compiler-specific document work.\n    if (!isSourceCode) {\n      await Session.LoadedSectionHandler.HandleLoadedSection(this, Function, Section);\n    }\n\n    UpdateHighlighting();\n  }\n\n  //? TODO: Check if other sections have marked elements and try to mark same ones\n  private async Task CloneOtherSectionAnnotations(IRTextSection otherSection) {\n    var parsedSection = await Session.LoadAndParseSection(otherSection);\n    if (parsedSection == null)\n      return;\n\n    object data = Session.LoadDocumentState(otherSection);\n    var refFinder = CreateReferenceFinder();\n\n    if (data != null) {\n      var state = UIStateSerializer.Deserialize<IRDocumentHostState>(data, parsedSection.Function);\n      var markerState = state.DocumentState.MarkedHighlighter;\n\n      if (markerState != null && markerState.Groups != null) {\n        foreach (var groupState in markerState.Groups) {\n          var group = new HighlightedElementGroup(groupState.Style);\n\n          foreach (var item in groupState.Elements) {\n            if (item.Value == null) {\n              continue;\n            }\n\n            // Search for equivalent value in current section.\n            var equivElement = refFinder.FindEquivalentValue(item);\n\n            if (equivElement != null) {\n              group.Add(equivElement);\n            }\n          }\n\n          if (!group.IsEmpty()) {\n            markedHighlighter_.Add(new HighlightedSegmentGroup(group, false));\n          }\n        }\n      }\n    }\n  }\n\n  private void SetupBlockHighlighter() {\n    if (!settings_.ShowBlockSeparatorLine) {\n      return;\n    }\n\n    // Setup highlighting of block background.\n    blockHighlighter_.Clear();\n\n    foreach (var element in blockElements_) {\n      blockHighlighter_.Add(element);\n    }\n  }\n\n  private void ComputeElementLists() {\n    // In case the function couldn't be parsed, bail\n    // after creating the elements, this should prevent further issues.\n    int blocks = Function != null ? Function.Blocks.Count + 1 : 1;\n    blockElements_ = new List<IRElement>(blocks);\n    tupleElements_ = new List<IRElement>(blocks * 4);\n    operandElements_ = new List<IRElement>(blocks * 12);\n    selectedElements_ = new HashSet<IRElement>();\n\n    if (Function == null) { // For source code documents.\n      return;\n    }\n\n    // Add the function parameters.\n    foreach (var param in Function.Parameters) {\n      operandElements_.Add(param);\n    }\n\n    // Add the elements from the entire function.\n    foreach (var block in Function.Blocks) {\n      blockElements_.Add(block);\n\n      if (block.Label != null) {\n        operandElements_.Add(block.Label);\n      }\n\n      foreach (var tuple in block.Tuples) {\n        tupleElements_.Add(tuple);\n\n        if (tuple is InstructionIR instr) {\n          foreach (var op in instr.Destinations) {\n            operandElements_.Add(op);\n          }\n\n          foreach (var op in instr.Sources) {\n            operandElements_.Add(op);\n          }\n        }\n      }\n    }\n  }\n\n  private void Margin__BookmarkChanged(object sender, Bookmark bookmark) {\n    RaiseBookmarkChangedEvent(bookmark);\n  }\n\n  private void Margin__BookmarkRemoved(object sender, Bookmark bookmark) {\n    RemoveBookmark(bookmark);\n  }\n\n  private void MarkBlockExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetSelectedElement() is var element) {\n      element = element.ParentBlock;\n      var style = GetMarkerStyleForCommand(e);\n      MarkBlock(element, style);\n      MirrorAction(DocumentActionKind.MarkBlock, element, style);\n    }\n  }\n\n  private void MarkDefinitionBlockExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (selectedElements_.Count == 1) {\n      var defOps = GetSelectedElementDefinitions();\n\n      foreach (var defOp in defOps) {\n        var element = defOp.ParentBlock;\n        var style = GetMarkerStyleForCommand(e);\n        MarkBlock(element, style);\n        MirrorAction(DocumentActionKind.MarkElement, defOp, style);\n      }\n    }\n  }\n\n  private void MarkDefinitionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (selectedElements_.Count == 1) {\n      var defOps = GetSelectedElementDefinitions();\n\n      foreach (var defOp in defOps) {\n        var style = GetPairMarkerStyleForCommand(e);\n        MarkElement(defOp, style);\n        MirrorAction(DocumentActionKind.MarkElement, defOp, style);\n      }\n    }\n  }\n\n  private void MarkElement(IRElement element, PairHighlightingStyle style) {\n    MarkElement(element, style.ChildStyle);\n  }\n\n  private void MarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetSelectedElement() is var element) {\n      var style = GetPairMarkerStyleForCommand(e);\n      MarkElement(element, style);\n      MirrorAction(DocumentActionKind.MarkElement, element, style);\n    }\n  }\n\n  private void MarkIconExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetSelectedElement() is var element) {\n      if (e != null && e.Parameter is SelectedIconEventArgs iconArgs) {\n        var icon = IconDrawing.FromIconResource(iconArgs.SelectedIconName);\n        var overlay = AddIconElementOverlay(element, icon, DefaultLineHeight, DefaultLineHeight);\n        overlay.Background = Background;\n        overlay.ShowBorderOnMouseOverOnly = true;\n        overlay.ShowBackgroundOnMouseOverOnly = true;\n        overlay.IsLabelPinned = true;\n        // MirrorAction(DocumentActionKind.MarkIcon, element, iconArgs);\n      }\n    }\n  }\n\n  private void MarkLoopBlocks() {\n    var dummyGraph = new Graph(GraphKind.FlowGraph);\n    var graphStyle = new FlowGraphStyleProvider(dummyGraph, App.Settings.FlowGraphSettings);\n    var loopGroups = new Dictionary<HighlightingStyle, HighlightedElementGroup>();\n\n    foreach (var block in Function.Blocks) {\n      var loopTag = block.GetTag<LoopBlockTag>();\n\n      if (loopTag != null) {\n        var style = graphStyle.GetBlockNodeStyle(block);\n\n        if (!loopGroups.TryGetValue(style, out var group)) {\n          group = new HighlightedElementGroup(style);\n          loopGroups[style] = group;\n        }\n\n        group.Add(block);\n      }\n    }\n\n    foreach (var group in loopGroups.Values) {\n      margin_.AddBlock(group, false);\n    }\n  }\n\n  private void MarkReferencesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var selectedOp = GetSelectedElement();\n\n    if (selectedOp is OperandIR op) {\n      MarkReferences(op, markedHighlighter_);\n      MirrorAction(DocumentActionKind.MarkReferences, selectedOp);\n    }\n\n    UpdateHighlighting();\n  }\n\n  private void MarkReferences(OperandIR op, ElementHighlighter highlighter) {\n    if (op.IsIndirection) {\n      op = op.IndirectionBaseValue;\n    }\n\n    var refFinder = CreateReferenceFinder();\n    var operandRefs = refFinder.FindAllReferences(op);\n    var markedInstrs = new HashSet<InstructionIR>(operandRefs.Count);\n\n    //? TODO: Issue when an instr has multiple operands highlighted (PHI)\n    //? the prev ops are covered by the background of the other ops,\n    //? plus it wastes time with the redundant highlighting\n    ClearTemporaryHighlighting();\n\n    foreach (var operandRef in operandRefs) {\n      var style = GetReferenceStyle(operandRef);\n\n      // Highlight instruction.\n      var instr = operandRef.Element.ParentInstruction;\n\n      if (instr != null && !markedInstrs.Contains(instr)) {\n        HighlightInstruction(instr, highlighter, style);\n        markedInstrs.Add(instr);\n      }\n\n      var group = HighlightOperand(operandRef.Element, highlighter, style);\n\n      RaiseElementHighlightingEvent(operandRef.Element, group, HighlighingType.Marked,\n                                    HighlightingEventAction.AppendHighlighting);\n    }\n\n    if (highlighter == markedHighlighter_) {\n      // Show references in panel.\n      Session.ShowAllReferences(op, this);\n      RecordReversibleAction(DocumentActionKind.MarkReferences, op, operandRefs);\n    }\n  }\n\n  private void MarkUsesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var defOp = GetSelectedElementDefinition();\n    var style = GetPairMarkerStyleForCommand(e);\n\n    if (defOp != null) {\n      MarkUses(defOp, style);\n      MirrorAction(DocumentActionKind.MarkUses, defOp, style);\n    }\n  }\n\n  private void MarkUses(OperandIR defOp, PairHighlightingStyle style) {\n    ClearTemporaryHighlighting();\n    var refFinder = CreateReferenceFinder();\n    var useList = refFinder.FindAllUses(defOp);\n\n    HighlightUsers(defOp, useList, markedHighlighter_, style,\n                   HighlightingEventAction.AppendHighlighting);\n\n    UpdateHighlighting();\n    Session.ShowSSAUses(defOp, this);\n    RecordReversibleAction(DocumentActionKind.MarkUses, defOp, useList);\n  }\n\n  private void NextBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!JumpToBookmark(bookmarks_.GetNext())) {\n      JumpToBookmark(bookmarks_.JumpToFirstBookmark());\n    }\n  }\n\n  private void NotifyPropertyChanged([CallerMemberName] string propertyName = \"\") {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private HighlightingStyle PickMarkerLightStyle() {\n    return markerParentStyle_.GetNext();\n  }\n\n  private HighlightingStyle PickMarkerStyle() {\n    return markerChildStyle_.GetNext();\n  }\n\n  private PairHighlightingStyle PickPairMarkerStyle() {\n    return new PairHighlightingStyle {\n      ParentStyle = markerParentStyle_.GetNext(),\n      ChildStyle = markerChildStyle_.GetNext()\n    };\n  }\n\n  private bool HighlighterVersionChanged(MarkerMarginVersionInfo info) {\n    return markedHighlighter_.Version != info.LastMarkedVersion ||\n           selectedHighlighter_.Version != info.LastSelectedVersion ||\n           hoverHighlighter_.Version != info.LastHoveredVersion ||\n           diffHighlighter_.Version != info.LastDiffVersion ||\n           margin_.Version != info.LastBlockMarginVersion ||\n           bookmarks_.Version != info.LastBookmarkVersion ||\n           overlayRenderer_.Version != info.LastOverlayVersion;\n  }\n\n  private void SaveHighlighterVersion(MarkerMarginVersionInfo info) {\n    info.LastMarkedVersion = markedHighlighter_.Version;\n    info.LastSelectedVersion = selectedHighlighter_.Version;\n    info.LastHoveredVersion = hoverHighlighter_.Version;\n    info.LastDiffVersion = diffHighlighter_.Version;\n    info.LastBlockMarginVersion = margin_.Version;\n    info.LastBookmarkVersion = bookmarks_.Version;\n    info.LastOverlayVersion = overlayRenderer_.Version;\n    info.NeedsRedrawing = true;\n  }\n\n  //? TODO: Extract all right margin code into own class\n  private void PopulateMarkerBar() {\n    // Try again to create the margin bar, the scrollbar may not have\n    // been visible when the document view was loaded.\n    if (markerMargin_ == null) {\n      CreateRightMarkerMargin();\n\n      if (markerMargin_ == null) {\n        //? TODO: Fix\n        //Trace.WriteLine(\"NO MARGIN\");\n        //Trace.WriteLine(Environment.StackTrace);\n        return;\n      }\n    }\n\n    if (!HighlighterVersionChanged(highlighterVersion_)) {\n      return;\n    }\n\n    markerMargingElements_ = new List<MarkerBarElement>(128);\n    int arrowButtonHeight = 16;\n    int startY = arrowButtonHeight;\n\n    // Delay the update to ensure the markerMargin has layout updated.\n    // Since the code runs later on the UI thread, it can end up interleaved\n    // with code that changes the OverlayRenderer data structs. used by the\n    // PopulateMarker* functions, abort the update in that case.\n    var updateTask = markerBarUpdateTask_.CancelCurrentAndCreateTask();\n\n    Dispatcher.BeginInvoke(() => {\n      if (updateTask.IsCanceled) {\n        return;\n      }\n\n      markerBarUpdateLock_.EnterWriteLock();\n      double width = markerMargin_.ActualWidth;\n      double height = markerMargin_.ActualHeight;\n      double availableHeight = height - arrowButtonHeight * 2;\n      int lines = Document.LineCount;\n      double dotSize = Math.Max(2, availableHeight / lines);\n      double dotWidth = width / 3;\n      availableHeight -= dotSize;\n\n      PopulateMarkerBarForHighlighter(markedHighlighter_, startY, width, availableHeight, dotSize);\n      PopulateMarkerBarForHighlighter(selectedHighlighter_, startY, width, availableHeight, dotSize);\n      PopulateMarkerBarForHighlighter(hoverHighlighter_, startY, width, availableHeight, dotSize);\n      PopulateMarkerBarForElementOverlays(startY, width, availableHeight, dotSize);\n      PopulateMarkerBarForDiffs(startY, width, availableHeight);\n      PopulateMarkerBarForBlocks(startY, width, availableHeight);\n\n      margin_.ForEachBookmark(bookmark => {\n        PopulateMarkerBarForBookmark(bookmark, startY, width, height, dotWidth, dotSize);\n      });\n\n      // Sort so that searching for elements can be speed up.\n      markerMargingElements_.Sort((a, b) => (int)(a.Visual.Top - b.Visual.Top));\n      SaveHighlighterVersion(highlighterVersion_);\n      RenderMarkerBar();\n\n      markerBarUpdateLock_.ExitWriteLock();\n      updateTask.Complete();\n    }, DispatcherPriority.Background);\n  }\n\n  private void PopulateMarkerBarForBookmark(Bookmark bookmark, int startY, double width, double height,\n                                            double dotWidth, double dotHeight) {\n    double y = (double)bookmark.Element.TextLocation.Line / LineCount * height;\n    var elementVisual = new Rect(width / 3, startY + y, dotWidth, dotHeight);\n    var style = bookmark.Style;\n\n    if (bookmark.Style != null) {\n      var brush = style.BackColor as SolidColorBrush;\n      var color = ColorUtils.AdjustSaturation(brush.Color);\n      style = new HighlightingStyle(color);\n    }\n    else {\n      style = new HighlightingStyle(Colors.Crimson);\n    }\n\n    markerMargingElements_.Add(new MarkerBarElement {\n      Element = bookmark.Element,\n      Visual = elementVisual,\n      Style = style,\n      HandlesInput = true\n    });\n  }\n\n  private void PopulateMarkerBarForHighlighter(ElementHighlighter highlighter, int startY, double width,\n                                               double height, double dotSize) {\n    highlighter.ForEachStyledElement((element, style) => {\n      double y = (double)element.TextLocation.Line / LineCount * height;\n      var brush = style.BackColor as SolidColorBrush;\n\n      if (brush.Color == Colors.Transparent) {\n        return;\n      }\n\n      var color = ColorUtils.AdjustSaturation(brush.Color);\n      var elementVisual = new Rect(0, startY + y, width, dotSize);\n      var barStyle = new HighlightingStyle(color);\n\n      markerMargingElements_.Add(new MarkerBarElement {\n        Element = element,\n        Visual = elementVisual,\n        Style = barStyle,\n        HandlesInput = true\n      });\n    });\n  }\n\n  private void PopulateMarkerBarForBlocks(int startY, double width, double height) {\n    foreach (var blockGroup in margin_.BlockGroups) {\n      var brush = blockGroup.Group.Style.BackColor as SolidColorBrush;\n      var color = ColorUtils.AdjustSaturation(brush.Color, 1.5f);\n\n      if (!blockGroup.SavesStateToFile) {\n        continue;\n      }\n\n      foreach (var segment in blockGroup.Segments) {\n        int startLine = Document.GetLineByOffset(segment.StartOffset).LineNumber;\n        int endLine = Document.GetLineByOffset(segment.EndOffset - 1).LineNumber;\n        int lineSpan = endLine - startLine + 1;\n        double y = Math.Floor((double)startLine / LineCount * height);\n        double lineHeight = Math.Ceiling(Math.Max(1, (double)lineSpan / LineCount * height));\n        var elementVisual = new Rect(0, startY + y, width / 3, lineHeight);\n        var barStyle = new HighlightingStyle(color);\n\n        markerMargingElements_.Add(new MarkerBarElement {\n          Element = segment.Element,\n          Visual = elementVisual,\n          Style = barStyle,\n          HandlesInput = false\n        });\n      }\n    }\n  }\n\n  private void PopulateMarkerBarForDiffs(int startY, double width, double height) {\n    if (duringDiffModeSetup_) {\n      return;\n    }\n\n    int lastLine = -1;\n    int lineSpan = 1;\n    var lastColor = Colors.Transparent;\n\n    diffHighlighter_.ForEachDiffSegment((segment, color) => {\n      // Combine the marking of multiple diffs of the same type\n      // to speed up rendering.\n      int line = Document.GetLineByOffset(segment.StartOffset).LineNumber;\n\n      if (line != lastLine) {\n        if (line == lastLine + 1 && color == lastColor) {\n          lastLine = line;\n          lastColor = color;\n          lineSpan++;\n        }\n        else {\n          if (lineSpan > 0 && lastColor != Colors.Transparent) {\n            PopulateDiffLines(lastLine, lineSpan, startY, width,\n                              height, lastColor);\n          }\n\n          lastLine = line;\n          lineSpan = 1;\n          lastColor = color;\n        }\n      }\n    });\n\n    if (lineSpan > 0 && lastColor != Colors.Transparent) {\n      PopulateDiffLines(lastLine, lineSpan, startY, width,\n                        height, lastColor);\n    }\n  }\n\n  private void PopulateDiffLines(int lastLine, int lineSpan, int startY, double width, double height,\n                                 Color color) {\n    int startLine = lastLine - lineSpan;\n    double y = Math.Floor((double)startLine / LineCount * height);\n    double lineHeight = Math.Ceiling(Math.Max(1, (double)lineSpan / LineCount * height));\n    color = ColorUtils.AdjustSaturation(color, 1.5f);\n    var elementVisual = new Rect(2 * width / 3, startY + y, width / 3, lineHeight);\n    var barStyle = new HighlightingStyle(color);\n\n    markerMargingElements_.Add(new MarkerBarElement {\n      Element = null,\n      Visual = elementVisual,\n      Style = barStyle,\n      HandlesInput = false\n    });\n  }\n\n  private void PopulateMarkerBarForElementOverlays(int startY, double width,\n                                                   double height, double dotSize) {\n    overlayRenderer_.ForEachElementOverlay((element, overlaySegment) => {\n      // Only consider elements with overlays that should appear on the marker bar.\n      bool showOnMarkerBar = false;\n\n      foreach (var overlay in overlaySegment.Overlays) {\n        if (overlay.ShowOnMarkerBar) {\n          showOnMarkerBar = true;\n          break;\n        }\n      }\n\n      if (!showOnMarkerBar) {\n        return;\n      }\n\n      double y = (double)element.TextLocation.Line / LineCount * height;\n      var brush = Brushes.Blue;\n      var color = ColorUtils.AdjustSaturation(brush.Color);\n      var elementVisual = new Rect(0, startY + y, width, dotSize);\n      var barStyle = new HighlightingStyle(color);\n\n      markerMargingElements_.Add(new MarkerBarElement {\n        Element = element,\n        Visual = elementVisual,\n        Style = barStyle,\n        HandlesInput = true\n      });\n    });\n  }\n\n  private void PreviousBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!JumpToBookmark(bookmarks_.GetPrevious())) {\n      JumpToBookmark(bookmarks_.JumpToLastBookmark());\n    }\n  }\n\n  private void RaiseBlockSelectedEvent(IRElement element) {\n    BlockSelected?.Invoke(this, new IRElementEventArgs {Element = element, Document = this});\n  }\n\n  private void RaiseBookmarkAddedEvent(Bookmark bookmark) {\n    BookmarkAdded?.Invoke(this, bookmark);\n  }\n\n  private void RaiseBookmarkChangedEvent(Bookmark bookmark) {\n    BookmarkChanged?.Invoke(this, bookmark);\n  }\n\n  private void RaiseBookmarkListClearedEvent() {\n    BookmarkListCleared?.Invoke(this, new EventArgs());\n  }\n\n  private void RaiseBookmarkRemovedEvent(Bookmark bookmark) {\n    BookmarkRemoved?.Invoke(this, bookmark);\n  }\n\n  private void RaiseBookmarkSelectedEvent(Bookmark bookmark) {\n    BookmarkSelected?.Invoke(this, new SelectedBookmarkInfo {\n      Bookmark = bookmark,\n      SelectedIndex = bookmarks_.SelectedIndex,\n      TotalBookmarks = bookmarks_.Bookmarks.Count\n    });\n  }\n\n  private void RaiseElementHighlightingEvent(IRElement element, HighlightedElementGroup group,\n                                             HighlighingType type, HighlightingEventAction action) {\n    ElementHighlighting?.Invoke(this, new IRHighlightingEventArgs {\n      Action = action,\n      Type = type,\n      Element = element,\n      Group = group,\n      MirrorAction = Utils.IsAltModifierActive()\n    });\n  }\n\n  private void RaiseElementRemoveHighlightingEvent(IRElement element) {\n    ElementHighlighting?.Invoke(this, new IRHighlightingEventArgs {\n      Action = HighlightingEventAction.RemoveHighlighting,\n      Element = element\n    });\n  }\n\n  private void RaiseElementSelectedEvent(IRElement element) {\n    ElementSelected?.Invoke(this, new IRElementEventArgs {\n      Element = element,\n      Document = this,\n      MirrorAction = Utils.IsAltModifierActive()\n    });\n  }\n\n  private void RaiseElementUnselectedEvent() {\n    ElementUnselected?.Invoke(this, new IRElementEventArgs {\n      Element = null,\n      Document = this,\n      MirrorAction = Utils.IsAltModifierActive()\n    });\n  }\n\n  private void RaiseRemoveHighlightingEvent(HighlighingType type) {\n    ElementHighlighting?.Invoke(this, new IRHighlightingEventArgs {\n      Action = HighlightingEventAction.RemoveHighlighting,\n      Type = type\n    });\n  }\n\n  private void RemoveAllBookmarksExecuted(object sender, ExecutedRoutedEventArgs e) {\n    RemoveAllBookmarks();\n  }\n\n  private void RemoveBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (margin_.SelectedBookmark != null) {\n      RemoveBookmark(margin_.SelectedBookmark);\n      return;\n    }\n\n    // Find the bookmark associated with the current element.\n    var selectedElement = GetSelectedElement();\n\n    if (selectedElement != null) {\n      var bookmark = bookmarks_.RemoveBookmark(selectedElement);\n\n      if (bookmark == null && selectedElement is OperandIR op) {\n        bookmark = bookmarks_.RemoveBookmark(op.ParentTuple);\n      }\n\n      if (bookmark != null) {\n        RemoveBookmark(bookmark);\n      }\n    }\n  }\n\n  private void RenderMarkerBar(bool forceUpdate = false) {\n    if (!forceUpdate && (markerMargingElements_ == null || !highlighterVersion_.NeedsRedrawing)) {\n      return;\n    }\n\n    if (Math.Abs(markerMargin_.ActualWidth) < double.Epsilon ||\n        Math.Abs(markerMargin_.ActualHeight) < double.Epsilon) {\n      return; // View not properly initialized yet.\n    }\n\n    var drawingVisual = new DrawingVisual();\n\n    using (var draw = drawingVisual.RenderOpen()) {\n      foreach (var barElement in markerMargingElements_) {\n        draw.DrawRectangle(barElement.Style.BackColor, barElement.Style.Border,\n                           barElement.Visual);\n      }\n    }\n\n    // Create a bitmap with an area matching the margin,\n    // render the visual over it and use it instead since it is more efficient to draw.\n    var bitmap = new RenderTargetBitmap((int)markerMargin_.ActualWidth,\n                                        (int)markerMargin_.ActualHeight, 96, 96,\n                                        PixelFormats.Default);\n    bitmap.Render(drawingVisual);\n    bitmap.Freeze();\n    Image image = null;\n\n    if (markerMargin_.Children.Count > 0) {\n      image = markerMargin_.Children[0] as Image;\n\n      if (image != null) {\n        var prevBitmap = image.Source as RenderTargetBitmap;\n        prevBitmap.Clear(); // Required to prevent GDI leaks.\n      }\n    }\n\n    if (image == null) {\n      image = new Image();\n      image.Source = bitmap;\n      markerMargin_.Children.Add(image);\n    }\n    else {\n      image.Source = bitmap;\n    }\n\n    highlighterVersion_.NeedsRedrawing = false;\n  }\n\n  private void SetupCommands() {\n    AddCommand(DocumentCommand.GoToDefinition, GoToDefinitionExecuted);\n    AddCommand(DocumentCommand.GoToDefinitionSkipCopies, GoToDefinitionSkipCopiesExecuted);\n    AddCommand(DocumentCommand.PreviewDefinition, PreviewDefinitionExecuted);\n    AddCommand(DocumentCommand.Mark, MarkExecuted);\n    AddCommand(DocumentCommand.MarkIcon, MarkIconExecuted);\n    AddCommand(DocumentCommand.MarkBlock, MarkBlockExecuted);\n    AddCommand(DocumentCommand.MarkDefinition, MarkDefinitionExecuted);\n    AddCommand(DocumentCommand.MarkDefinitionBlock, MarkDefinitionBlockExecuted);\n    AddCommand(DocumentCommand.ShowUses, ShowUsesExecuted);\n    AddCommand(DocumentCommand.MarkUses, MarkUsesExecuted);\n    AddCommand(DocumentCommand.MarkReferences, MarkReferencesExecuted);\n    AddCommand(DocumentCommand.ShowReferences, ShowReferencesExecuted);\n    AddCommand(DocumentCommand.ShowExpressionGraph, ShowExpressionGraphExecuted);\n    AddCommand(DocumentCommand.ClearMarker, ClearMarkerExecuted);\n    AddCommand(DocumentCommand.ClearAllMarkers, ClearAllMarkersExecuted);\n    AddCommand(DocumentCommand.ClearBlockMarkers, ClearBlockMarkersExecuted);\n    AddCommand(DocumentCommand.ClearInstructionMarkers, ClearInstructionMarkersExecuted);\n    AddCommand(DocumentCommand.AddBookmark, AddBookmarkExecuted);\n    AddCommand(DocumentCommand.RemoveBookmark, RemoveBookmarkExecuted);\n    AddCommand(DocumentCommand.RemoveAllBookmarks, RemoveAllBookmarksExecuted);\n    AddCommand(DocumentCommand.PreviousBookmark, PreviousBookmarkExecuted);\n    AddCommand(DocumentCommand.NextBookmark, NextBookmarkExecuted);\n    AddCommand(DocumentCommand.FirstBookmark, FirstBookmarkExecuted);\n    AddCommand(DocumentCommand.LastBookmark, LastBookmarkExecuted);\n    AddCommand(DocumentCommand.UndoAction, UndoActionExecuted, UndoActionCanExecute);\n  }\n\n  private void SetupEvents() {\n    if (eventSetupDone_) {\n      return;\n    }\n\n    PreviewKeyDown += IRDocument_PreviewKeyDown;\n    MouseDown += IRDocument_MouseDown;\n    PreviewMouseLeftButtonDown += IRDocument_PreviewMouseLeftButtonDown;\n    PreviewMouseRightButtonDown += IRDocument_PreviewMouseRightButtonDown;\n    PreviewMouseLeftButtonUp += IRDocument_PreviewMouseLeftButtonUp;\n    PreviewMouseHover += IRDocument_PreviewMouseHover;\n    PreviewMouseHoverStopped += IRDocument_PreviewMouseHoverStopped;\n    PreviewMouseDoubleClick += IRDocument_PreviewMouseDoubleClick;\n    PreviewMouseMove += IRDocument_PreviewMouseMove;\n    MouseLeave += IRDocument_MouseLeave;\n    Drop += IRDocument_Drop;\n    DragOver += IRDocument_DragOver;\n    GiveFeedback += IRDocument_GiveFeedback;\n    TextArea.Caret.PositionChanged += Caret_PositionChanged;\n    margin_.BookmarkRemoved += Margin__BookmarkRemoved;\n    margin_.BookmarkChanged += Margin__BookmarkChanged;\n    eventSetupDone_ = true;\n    AllowDrop = true; // Enable drag-and-drop handilng.\n  }\n\n  private void IRDocument_MouseLeave(object sender, MouseEventArgs e) {\n    HideTemporaryUI();\n    overlayRenderer_.MouseLeave();\n  }\n\n  private void IRDocument_GiveFeedback(object sender, GiveFeedbackEventArgs e) {\n    e.UseDefaultCursors = false;\n    Mouse.OverrideCursor = Cursors.Arrow;\n  }\n\n  private void IRDocument_DragOver(object sender, DragEventArgs e) {\n    var position = e.GetPosition(TextArea.TextView);\n    var element = FindPointedElement(position, out _);\n\n    if (element != null) {\n      HighlightElement(element, HighlighingType.Hovered);\n      e.Effects = DragDropEffects.All;\n      e.Handled = true;\n    }\n    else {\n      HideHoverHighlighting();\n    }\n  }\n\n  private void IRDocument_Drop(object sender, DragEventArgs e) {\n    if (e.Data.GetData(typeof(IRElementDragDropSelection)) is IRElementDragDropSelection selection) {\n      var position = e.GetPosition(TextArea.TextView);\n      var element = FindPointedElement(position, out _);\n      selection.Element = element;\n      e.Effects = DragDropEffects.All;\n      e.Handled = true;\n    }\n  }\n\n  private void IRDocument_MouseDown(object sender, MouseButtonEventArgs e) {\n    // Handle the mouse back-button being pressed.\n    if (e.ChangedButton == MouseButton.XButton1) {\n      UndoLastAction();\n    }\n  }\n\n  private void UndoLastAction() {\n    UndoReversibleAction();\n\n    if (Utils.IsAltModifierActive()) {\n      MirrorAction(DocumentActionKind.UndoAction, null);\n    }\n  }\n\n  private void SetupProperties() {\n    IsReadOnly = true;\n    HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;\n    Options.AllowScrollBelowDocument = false;\n    Options.EnableEmailHyperlinks = false;\n    Options.EnableHyperlinks = false;\n\n    // Don't use rounded corners for selection rectangles.\n    TextArea.SelectionCornerRadius = 0;\n    TextArea.SelectionBorder = null;\n  }\n\n  private void SetupStableRenderers() {\n    hoverHighlighter_ = new ElementHighlighter(HighlighingType.Hovered);\n    selectedHighlighter_ = new ElementHighlighter(HighlighingType.Selected);\n    markedHighlighter_ = new ElementHighlighter(HighlighingType.Marked);\n    diffHighlighter_ = new DiffLineHighlighter();\n    TextArea.TextView.BackgroundRenderers.Add(diffHighlighter_);\n    TextArea.TextView.BackgroundRenderers.Add(markedHighlighter_);\n    TextArea.TextView.BackgroundRenderers.Add(selectedHighlighter_);\n    TextArea.TextView.BackgroundRenderers.Add(hoverHighlighter_);\n  }\n\n  private void SetupRenderers() {\n    // Highlighting of current line.\n    if (lineHighlighter_ != null) {\n      TextArea.TextView.BackgroundRenderers.Remove(lineHighlighter_);\n      lineHighlighter_ = null;\n    }\n\n    if (blockHighlighter_ != null) {\n      TextArea.TextView.BackgroundRenderers.Remove(blockHighlighter_);\n      blockHighlighter_ = null;\n    }\n\n    if (settings_.ShowBlockSeparatorLine) {\n      blockHighlighter_ = new BlockBackgroundHighlighter(settings_.ShowBlockSeparatorLine,\n                                                         settings_.BlockSeparatorColor,\n                                                         settings_.BackgroundColor,\n                                                         settings_.AlternateBackgroundColor);\n      TextArea.TextView.BackgroundRenderers.Insert(0, blockHighlighter_);\n\n      if (Function != null) {\n        SetupBlockHighlighter();\n      }\n    }\n\n    if (margin_ != null) {\n      margin_.BackgroundColor = settings_.MarginBackgroundColor;\n    }\n    else {\n      margin_ = new DocumentMargin(settings_.MarginBackgroundColor);\n      TextArea.LeftMargins.Add(margin_);\n    }\n\n    if (remarkHighlighter_ != null) {\n      TextArea.TextView.BackgroundRenderers.Remove(remarkHighlighter_);\n    }\n\n    remarkHighlighter_ = new RemarkHighlighter(HighlighingType.Marked);\n    TextArea.TextView.BackgroundRenderers.Add(remarkHighlighter_);\n\n    if (overlayRenderer_ != null) {\n      TextArea.TextView.BackgroundRenderers.Remove(overlayRenderer_);\n      TextArea.TextView.Layers.Remove(overlayRenderer_);\n    }\n\n    // Create the overlay and place it on top of the text.\n    overlayRenderer_ ??= new OverlayRenderer(markedHighlighter_);\n    overlayRenderer_.TextFont = new Typeface(FontFamily, FontStyle,\n                                             FontWeight, FontStretch);\n    TextArea.TextView.BackgroundRenderers.Add(overlayRenderer_);\n    TextArea.TextView.InsertLayer(overlayRenderer_, KnownLayer.Text, LayerInsertionPosition.Above);\n\n    if (DiffModeEnabled) {\n      if (diffHighlighter_ != null) {\n        diffHighlighter_.Clear();\n        TextArea.TextView.BackgroundRenderers.Remove(diffHighlighter_);\n      }\n\n      if (diffSegments_ != null) {\n        // Insert below the marker renderer so that marked,\n        // selected and hovered elements get the usual highlighting.\n        diffHighlighter_ = new DiffLineHighlighter();\n        int index = TextArea.TextView.BackgroundRenderers.IndexOf(markedHighlighter_);\n\n        if (index != -1) {\n          TextArea.TextView.BackgroundRenderers.Insert(index, diffHighlighter_);\n        }\n        else {\n          TextArea.TextView.BackgroundRenderers.Add(diffHighlighter_);\n        }\n\n        // AvalonEdit text segments cannot be reused, even when removed from the\n        // segment collection, since they are left with internal fields referencing\n        // the old tree data struct and adding them to another collection would fail.\n        // Make a copy of each segment as a workaround.\n        diffSegments_ = diffSegments_.ConvertAll(segment => new DiffTextSegment(segment));\n        StartDiffSegmentAdding();\n        AddDiffTextSegments(diffSegments_);\n        AllDiffSegmentsAdded();\n      }\n    }\n\n    if (settings_.HighlightCurrentLine) {\n      lineHighlighter_ = new CurrentLineHighlighter(this, settings_.CurrentLineBorderColor);\n      TextArea.TextView.BackgroundRenderers.Add(lineHighlighter_);\n    }\n  }\n\n  private HighlightingStyle GetRemarkLineStyle(Remark remark, bool hasContextFilter, bool isSelected = false) {\n    //? TODO: Caching of the style\n    if (hasContextFilter) {\n      // Use the background of the remark with the same bold pen for all kinds.\n      var backColor = remark.Category.MarkColor;\n\n      if (backColor == Colors.Black || backColor == Colors.Transparent) {\n        backColor = Colors.LightGray;\n      }\n\n      var borderColor = Colors.Black;\n      double borderWeight = Math.Max(2, remark.Category.TextMarkBorderWeight);\n      return new HighlightingStyle(backColor, ColorPens.GetPen(borderColor, borderWeight));\n    }\n\n    return new HighlightingStyle(remark.Category.MarkColor,\n                                 ColorPens.GetPen(remark.Category.TextMarkBorderColor,\n                                                  remark.Category.TextMarkBorderWeight));\n  }\n\n  private HighlightingStyle GetRemarkBookmarkStyle(Remark remark, bool hasContextFilter) {\n    //? TODO: Caching\n    return new HighlightingStyle(remark.Category.MarkColor);\n  }\n\n  private void AddMarginRemarks(List<RemarkLineGroup> markerRemarksGroups, bool hasContextFilter) {\n    foreach (var remarkGroup in markerRemarksGroups) {\n      bool groupHandled = false;\n\n      foreach (var remark in remarkGroup.Remarks) {\n        foreach (var element in remark.ReferencedElements) {\n          // Add a single marker for all remarks mapping to the same line (group).\n          if (remark.Category.AddLeftMarginMark && !groupHandled) {\n            var style = GetRemarkBookmarkStyle(remarkGroup.LeaderRemark, hasContextFilter);\n            var bookmark = new Bookmark(0, element, remarkGroup.LeaderRemark.RemarkText, style);\n            margin_.AddRemarkBookmark(bookmark, remarkGroup);\n            groupHandled = true;\n            break;\n          }\n        }\n\n        if (groupHandled) {\n          break;\n        }\n      }\n    }\n  }\n\n  private void AddDocumentRemarks(List<Remark> allRemarks, bool hasContextFilter) {\n    var markedElements = new HashSet<Tuple<IRElement, RemarkKind>>(allRemarks.Count);\n\n    foreach (var remark in allRemarks) {\n      foreach (var element in remark.ReferencedElements) {\n        if (remark.Category.AddTextMark || hasContextFilter) {\n          // Mark each element only once with the same kind of remark.\n          var elementKindPair = new Tuple<IRElement, RemarkKind>(element, remark.Kind);\n\n          if (!markedElements.Contains(elementKindPair)) {\n            var style = GetRemarkLineStyle(remark, hasContextFilter);\n            var group = new HighlightedElementGroup(element, style);\n            remarkHighlighter_.Add(group);\n            markedElements.Add(elementKindPair);\n          }\n        }\n      }\n    }\n  }\n\n  private async Task<bool> ShowDefinitionPreview(IRElement element, bool alwaysShow = false) {\n    if (settings_ is not DocumentSettings docSettings) {\n      return false;\n    }\n\n    IRElement target = null;\n    bool isCallTarget = false;\n    bool show = false;\n\n    if (!alwaysShow) {\n      if (!docSettings.ShowPreviewPopup) {\n        HidePreviewPopup();\n        return false;\n      }\n    }\n\n    if (element is OperandIR op) {\n      if (op.IsLabelAddress) {\n        target = op.BlockLabelValue;\n        show = target != null && (alwaysShow || IsElementOutsideView(target));\n      }\n      else if (op.ParentInstruction != null) {\n        if (op.Equals(Session.CompilerInfo.IR.GetCallTarget(op.ParentInstruction))) {\n          target = op;\n          isCallTarget = true;\n          show = true;\n        }\n      }\n\n      if (target == null) {\n        var refFinder = CreateReferenceFinder();\n        target = refFinder.FindSingleDefinition(op);\n        show = target != null && (alwaysShow || IsElementOutsideView(target));\n      }\n    }\n\n    // Show the preview only if outside the current view.\n    if (show) {\n      await ShowPreviewPopup(target, isCallTarget, alwaysShow);\n      return true;\n    }\n\n    return false;\n  }\n\n  private bool IsCallTargetElement(IRElement element) {\n    if (element is OperandIR op &&\n        op.ParentInstruction != null) {\n      return op.Equals(Session.CompilerInfo.IR.GetCallTarget(op.ParentInstruction));\n    }\n\n    return false;\n  }\n\n  private void ShowReferencesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var selectedOp = GetSelectedElement();\n\n    if (selectedOp is OperandIR op) {\n      ShowReferences(op);\n      MirrorAction(DocumentActionKind.ShowReferences, selectedOp);\n    }\n  }\n\n  private void ShowExpressionGraphExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var element = GetSelectedElement();\n\n    if (element != null) {\n      ShowExpressionGraph(element);\n    }\n  }\n\n  private void ShowExpressionGraph(IRElement element) {\n    var action = new DocumentAction(DocumentActionKind.ShowExpressionGraph, element);\n    ActionPerformed?.Invoke(this, action);\n  }\n\n  private void ShowReferences(OperandIR op) {\n    Session.ShowAllReferences(op, this);\n  }\n\n  private async Task ShowPreviewPopup(IRElement element, bool isCallTarget = false, bool alwaysShow = false) {\n    if (element == null || preparingPreviewPopup_) {\n      return; // Valid case for search results.\n    }\n\n    // Close current popup.\n    if (previewPopup_ != null) {\n      if (previewPopup_.PreviewedElement == element) {\n        return; // Already showing preview for this element.\n      }\n\n      HidePreviewPopup();\n    }\n\n    if (ignoreNextPreviewElement_ == element) {\n      return;\n    }\n\n    // Try to create a popup for the element.\n    var position = Mouse.GetPosition(TextArea.TextView).AdjustForMouseCursor();\n    preparingPreviewPopup_ = true; // Prevent another popup to be created due to await.\n\n    if (isCallTarget) {\n      previewPopup_ = await CreateCallTargetPreviewPopup(element, alwaysShow, position);\n    }\n    else {\n      previewPopup_ = await CreateElementPreviewPopup(element, position);\n    }\n\n    preparingPreviewPopup_ = false;\n\n    if (previewPopup_ != null) {\n      previewPopup_.PopupDetached += Popup_PopupDetached;\n      previewPopup_.ShowPopup();\n\n      if (alwaysShow) {\n        // Keep open when triggered manually from UI or shortcut.\n        previewPopup_.DetachPopup();\n      }\n    }\n  }\n\n  private async Task<IRDocumentPopup> CreateElementPreviewPopup(IRElement element, Point position) {\n    return await IRDocumentPopup.CreateNew(this, element, position,\n                                           this, App.Settings.GetElementPreviewPopupSettings(ToolPanelKind.Other));\n  }\n\n  private async Task<IRDocumentPopup> CreateCallTargetPreviewPopup(IRElement element, bool alwaysShow, Point position) {\n    // Try to find a function definition for the call.\n    var targetSection = DocumentUtils.FindCallTargetSection(element, Section, Session);\n\n    if (targetSection == null) {\n      if (alwaysShow) {\n        Utils.ShowWarningMessageBox($\"Couldn't find call target in opened document:\\n{element.Name}\", this);\n      }\n\n      return null;\n    }\n\n    var result = await Session.LoadAndParseSection(targetSection);\n\n    if (result == null)\n      return null;\n\n    return await IRDocumentPopup.CreateNew(result, position, this, Session,\n                                           App.Settings.PreviewPopupSettings,\n                                           $\"Function: {element.Name}\");\n  }\n\n  private void Popup_PopupDetached(object sender, EventArgs e) {\n    var popup = (IRDocumentPopup)sender;\n\n    if (popup == previewPopup_) {\n      previewPopup_ = null; // Prevent automatic closing.\n    }\n  }\n\n  private void ShowUsesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var defOp = GetSelectedElementDefinition();\n\n    if (defOp != null) {\n      ShowUses(defOp);\n      MirrorAction(DocumentActionKind.ShowUses, defOp);\n    }\n  }\n\n  private void ShowUses(OperandIR defOp) {\n    Session.ShowSSAUses(defOp, this);\n  }\n\n  private void IRDocument_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    if (updateSuspended_) {\n      return;\n    }\n\n    var position = e.GetPosition(TextArea.TextView);\n\n    // Ignore click outside the text view, such as the right marker bar.\n    if (position.X <= 0 ||\n        position.X >= TextArea.TextView.ActualWidth ||\n        position.Y >= TextArea.TextView.ActualHeight) {\n      return;\n    }\n\n    // Ignore click on a bookmark.\n    if (margin_.HasHoveredBookmark()) {\n      return;\n    }\n\n    Focus();\n    HideTemporaryUI();\n\n    // Check if there is any overlay being clicked\n    // and don't propagate event to elements if it is.\n    if (overlayRenderer_.MouseClick(e)) {\n      e.Handled = true;\n      return;\n    }\n\n    var element = FindPointedElement(position, out int textOffset);\n    SelectElement(element, true, true, textOffset);\n    selectingText_ = true;\n\n    //? TODO: This would prevent selection of text from working,\n    //? but allowing it also sometimes selects a letter of the element...\n    // e.Handled = element != null;\n  }\n\n  private void SetupElementOverlayEvents(IElementOverlay overlay) {\n    overlay.OnKeyPress += ElementOverlay_OnKeyPress;\n    overlay.OnClick += ElementOverlay_OnClick;\n  }\n\n  private void ElementOverlay_OnClick(object sender, MouseEventArgs e) {\n    var overlay = (IElementOverlay)sender;\n    SelectElement(overlay.Element);\n  }\n\n  private void ElementOverlay_OnKeyPress(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Delete) {\n      overlayRenderer_.RemoveElementOverlay((IElementOverlay)sender);\n    }\n  }\n\n  private void UpdateHighlighting() {\n    if (updateSuspended_ || !IsLoaded) {\n      return;\n    }\n\n    PopulateMarkerBar();\n    TextArea.TextView.Redraw();\n  }\n\n  private void UpdateMargin() {\n    if (updateSuspended_) {\n      return;\n    }\n\n    margin_.InvalidateVisual();\n  }\n\n  public void Redraw() {\n    UpdateHighlighting();\n    UpdateMargin();\n  }\n\n  private class MarkerMarginVersionInfo {\n    public int LastBlockMarginVersion;\n    public int LastBookmarkVersion;\n    public int LastDiffVersion;\n    public int LastHoveredVersion;\n    public int LastMarkedVersion;\n    public int LastSelectedVersion;\n    public int LastOverlayVersion;\n    public bool NeedsRedrawing;\n  }\n\n  private class MarkerBarElement {\n    public IRElement Element { get; set; }\n    public HighlightingStyle Style { get; set; }\n    public Rect Visual { get; set; }\n    public bool HandlesInput { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/IRDocumentColumnData.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Web;\nusing System.Windows;\nusing System.Windows.Media;\nusing ClosedXML.Excel;\nusing HtmlAgilityPack;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\nusing HtmlDocument = HtmlAgilityPack.HtmlDocument;\n\nnamespace ProfileExplorer.UI;\n\npublic class IRDocumentColumnData {\n  public IRDocumentColumnData(int capacity = 0) {\n    Columns = new List<OptionalColumn>();\n    Rows = new Dictionary<IRElement, ElementRowValue>(capacity);\n    ColumnValues = new Dictionary<OptionalColumn, List<ElementColumnValue>>(new ColumnComparer());\n  }\n\n  public List<OptionalColumn> Columns { get; set; }\n  public Dictionary<IRElement, ElementRowValue> Rows { get; set; }\n  public Dictionary<OptionalColumn, List<ElementColumnValue>> ColumnValues { get; set; }\n  public bool HasData => Rows.Count > 0;\n  public OptionalColumn MainColumn => Columns.Find(column => column.IsMainColumn);\n\n  public void ExportColumnsToExcel(IRElement tuple, IXLWorksheet ws,\n                                   int rowId, int columnId) {\n    foreach (var column in Columns) {\n      var value = GetColumnValue(tuple, column);\n\n      if (value != null) {\n        ws.Cell(rowId, columnId).Value = value.Text.Replace(\" ms\", \"\");\n\n        if (value.BackColor != null && value.BackColor is SolidColorBrush colorBrush) {\n          var color = XLColor.FromArgb(colorBrush.Color.A, colorBrush.Color.R, colorBrush.Color.G,\n                                       colorBrush.Color.B);\n          ws.Cell(rowId, columnId).Style.Fill.BackgroundColor = color;\n\n          if (column.IsMainColumn) {\n            ws.Cell(rowId, 1).Style.Fill.BackgroundColor = color;\n            ws.Cell(rowId, 2).Style.Fill.BackgroundColor = color;\n          }\n        }\n\n        if (value.TextWeight != FontWeights.Normal) {\n          ws.Cell(rowId, columnId).Style.Font.Bold = true;\n\n          if (column.IsMainColumn) {\n            ws.Cell(rowId, 1).Style.Font.Bold = true;\n            ws.Cell(rowId, 2).Style.Font.Bold = true;\n          }\n        }\n      }\n\n      columnId++;\n    }\n  }\n\n  public void ExportColumnsAsHTML(IRElement tuple, HtmlDocument doc, HtmlNode tr) {\n    string CellStyle =\n      @\"text-align:left;vertical-align:top;word-wrap:break-word;max-width:500px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-size:14px;font-family:Arial, sans-serif;\";\n\n    foreach (var column in Columns) {\n      var value = GetColumnValue(tuple, column);\n      var td = doc.CreateElement(\"td\");\n      string style = CellStyle;\n\n      if (value != null) {\n        td.InnerHtml = HttpUtility.HtmlEncode(value.Text);\n\n        if (value.BackColor is SolidColorBrush colorBrush) {\n          style += $\"background-color:{Utils.ColorToString(colorBrush.Color)};\";\n        }\n\n        if (value.TextWeight != FontWeights.Normal) {\n          style += $\"font-weight:bold;\";\n        }\n      }\n\n      // Apply main column style for entire row.\n      if (column.IsMainColumn && tr.ChildNodes.Count >= 2) {\n        tr.ChildNodes[0].SetAttributeValue(\"style\", style);\n        tr.ChildNodes[1].SetAttributeValue(\"style\", style);\n      }\n\n      td.SetAttributeValue(\"style\", style);\n      tr.AppendChild(td);\n    }\n  }\n\n  public void ExportColumnsAsMarkdown(IRElement tuple, StringBuilder sb) {\n    foreach (var column in Columns) {\n      var value = GetColumnValue(tuple, column);\n      string text = value != null ? value.Text : \"\";\n      sb.Append($\" {text} |\");\n    }\n  }\n\n  public OptionalColumn AddColumn(OptionalColumn column) {\n    // Make a clone so that changing values such as the width\n    // doesn't modify the column template.\n    var columnClone = (OptionalColumn)column.Clone();\n\n    if (!string.IsNullOrEmpty(column.Style.AlternateTitle)) {\n      columnClone.Title = column.Style.AlternateTitle;\n    }\n\n    Columns.Add(columnClone);\n    return columnClone;\n  }\n\n  public OptionalColumn GetColumn(OptionalColumn templateColumn) {\n    return Columns.Find(column => column.ColumnName == templateColumn.ColumnName);\n  }\n\n  public ElementRowValue AddValue(ElementColumnValue value, IRElement element, OptionalColumn column) {\n    if (!Rows.TryGetValue(element, out var rowValues)) {\n      rowValues = new ElementRowValue(element);\n      Rows[element] = rowValues;\n    }\n\n    rowValues.ColumnValues[column] = value;\n    value.Element = element;\n    AddColumnValue(value, column);\n    return rowValues;\n  }\n\n  public void AddColumnValue(ElementColumnValue value, OptionalColumn column) {\n    if (!ColumnValues.TryGetValue(column, out var list)) {\n      list = new List<ElementColumnValue>();\n      ColumnValues[column] = list;\n    }\n\n    list.Add(value);\n  }\n\n  public ElementRowValue GetValues(IRElement element) {\n    if (Rows.TryGetValue(element, out var valueGroup)) {\n      return valueGroup;\n    }\n\n    return null;\n  }\n\n  public void AddRow(ElementRowValue rowValues, IRElement element) {\n    rowValues.Element = element;\n    Rows[element] = rowValues;\n  }\n\n  public ElementColumnValue GetColumnValue(IRElement element, OptionalColumn column) {\n    var values = GetValues(element);\n    return values?[column];\n  }\n\n  public void Reset() {\n  }\n\n  public class ColumnComparer : IEqualityComparer<OptionalColumn> {\n    public bool Equals(OptionalColumn x, OptionalColumn y) {\n      if (ReferenceEquals(x, y))\n        return true;\n      if (ReferenceEquals(x, null))\n        return false;\n      if (ReferenceEquals(y, null))\n        return false;\n      if (x.GetType() != y.GetType())\n        return false;\n      return x.ColumnName == y.ColumnName;\n    }\n\n    public int GetHashCode(OptionalColumn obj) {\n      return obj.ColumnName != null ? obj.ColumnName.GetHashCode() : 0;\n    }\n  }\n}\n\n// Represents a value in the row associated with an element.\n// Can be viewed as a cell in a spreadsheet.\npublic sealed class ElementColumnValue : BindableObject {\n  public static readonly ElementColumnValue Empty = new(string.Empty);\n  private Thickness borderThickness_;\n  private Brush borderBrush_;\n  private string text_;\n  private double minTextWidth_;\n  private string toolTip_;\n  private Brush textColor_;\n  private Brush backColor_;\n  private ImageSource icon_;\n  private bool showPercentageBar_;\n  private Brush percentageBarBackColor__;\n  private double percentageBarBorderThickness_;\n  private Brush percentageBarBorderBrush_;\n  private FontWeight textWeight_;\n  private double textSize_;\n  private FontFamily textFont_;\n  private bool canShowPercentageBar_;\n  private double percentageBarMaxWidth_;\n  private bool canShowBackgroundColor_;\n  private bool canShowIcon_;\n\n  public ElementColumnValue(string text, long value = 0, double valueValuePercentage = 0.0,\n                            int valueOrder = int.MaxValue, string tooltip = null) {\n    Text = text;\n    Value = value;\n    ValuePercentage = valueValuePercentage;\n    ValueOrder = valueOrder;\n    TextWeight = FontWeights.Normal;\n    TextColor = Brushes.Black;\n    ToolTip = tooltip;\n    CanShowPercentageBar = true;\n    CanShowBackgroundColor = true;\n    CanShowIcon = true;\n  }\n\n  public IRElement Element { get; set; }\n  public long Value { get; set; }\n  public double ValuePercentage { get; set; }\n  public int ValueOrder { get; set; }\n\n  public Thickness BorderThickness {\n    get => borderThickness_;\n    set => SetAndNotify(ref borderThickness_, value);\n  }\n\n  public Brush BorderBrush {\n    get => borderBrush_;\n    set => SetAndNotify(ref borderBrush_, value);\n  }\n\n  public string Text {\n    get => text_;\n    set => SetAndNotify(ref text_, value);\n  }\n\n  public double MinTextWidth {\n    get => minTextWidth_;\n    set => SetAndNotify(ref minTextWidth_, value);\n  }\n\n  public string ToolTip {\n    get => toolTip_;\n    set => SetAndNotify(ref toolTip_, value);\n  }\n\n  public Brush TextColor {\n    get => textColor_;\n    set => SetAndNotify(ref textColor_, value);\n  }\n\n  public Brush BackColor {\n    get => backColor_;\n    set => SetAndNotify(ref backColor_, value);\n  }\n\n  public bool CanShowBackgroundColor {\n    get => canShowBackgroundColor_;\n    set => SetAndNotify(ref canShowBackgroundColor_, value);\n  }\n\n  public bool CanShowIcon {\n    get => canShowIcon_;\n    set => SetAndNotify(ref canShowIcon_, value);\n  }\n\n  public ImageSource Icon {\n    get => icon_;\n    set {\n      SetAndNotify(ref icon_, value);\n      Notify(nameof(ShowIcon));\n    }\n  }\n\n  public bool ShowIcon => icon_ != null;\n\n  public bool ShowPercentageBar {\n    get => showPercentageBar_;\n    set => SetAndNotify(ref showPercentageBar_, value);\n  }\n\n  public bool CanShowPercentageBar {\n    get => canShowPercentageBar_;\n    set => SetAndNotify(ref canShowPercentageBar_, value);\n  }\n\n  public Brush PercentageBarBackColor {\n    get => percentageBarBackColor__;\n    set => SetAndNotify(ref percentageBarBackColor__, value);\n  }\n\n  public double PercentageBarBorderThickness {\n    get => percentageBarBorderThickness_;\n    set => SetAndNotify(ref percentageBarBorderThickness_, value);\n  }\n\n  public Brush PercentageBarBorderBrush {\n    get => percentageBarBorderBrush_;\n    set => SetAndNotify(ref percentageBarBorderBrush_, value);\n  }\n\n  public double PercentageBarMaxWidth {\n    get => percentageBarMaxWidth_;\n    set => SetAndNotify(ref percentageBarMaxWidth_, value);\n  }\n\n  public FontWeight TextWeight {\n    get => textWeight_;\n    set => SetAndNotify(ref textWeight_, value);\n  }\n\n  public double TextSize {\n    get => textSize_;\n    set => SetAndNotify(ref textSize_, value);\n  }\n\n  public FontFamily TextFont {\n    get => textFont_;\n    set => SetAndNotify(ref textFont_, value);\n  }\n}\n\n// Represents a set of values (by column) associated with an element.\n// Can be view as a row with cells in a spreadsheet.\npublic sealed class ElementRowValue : BindableObject {\n  private Brush backColor_;\n  private Thickness borderThickness_;\n  private Brush borderBrush_;\n\n  public ElementRowValue(IRElement element) {\n    Element = element;\n    ColumnValues = new Dictionary<OptionalColumn, ElementColumnValue>();\n  }\n\n  public IRElement Element { get; set; }\n  public Dictionary<OptionalColumn, ElementColumnValue> ColumnValues { get; set; }\n  public ICollection<ElementColumnValue> Values => ColumnValues.Values;\n  public ICollection<OptionalColumn> Columns => ColumnValues.Keys;\n  public int Count => ColumnValues.Count;\n\n  public Brush BackColor {\n    get => backColor_;\n    set => SetAndNotify(ref backColor_, value);\n  }\n\n  public Thickness BorderThickness {\n    get => borderThickness_;\n    set => SetAndNotify(ref borderThickness_, value);\n  }\n\n  public Brush BorderBrush {\n    get => borderBrush_;\n    set => SetAndNotify(ref borderBrush_, value);\n  }\n\n  public object Tag { get; set; }\n  public ElementColumnValue this[OptionalColumn column] => ColumnValues.GetValueOrNull(column);\n\n  public ElementColumnValue this[string columnName] {\n    get {\n      foreach (var pair in ColumnValues) {\n        if (pair.Key.ColumnName == columnName) {\n          return pair.Value;\n        }\n      }\n\n      return null;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/IRDocumentHost.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.IRDocumentHost\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:doc=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <UserControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:DocumentCommand.NextBlock\"\n      Executed=\"NextBlockExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentCommand.PreviousBlock\"\n      Executed=\"PreviousBlockExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentCommand.FocusBlockSelector\"\n      Executed=\"FocusBlockSelectorExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.ShowSearch\"\n      Executed=\"ShowSearchExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.ToggleSearch\"\n      Executed=\"ToggleSearchExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.ShowSectionList\"\n      Executed=\"ShowSectionListExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.PreviousSection\"\n      Executed=\"PreviousSectionExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.NextSection\"\n      Executed=\"NextSectionExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.SearchSymbol\"\n      Executed=\"SearchSymbolExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.SearchSymbolAllSections\"\n      Executed=\"SearchSymbolAllSectionsExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.JumpToProfiledElement\"\n      Executed=\"JumpToProfiledElementExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.ExportFunctionProfile\"\n      Executed=\"ExportFunctionProfileExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.ExportFunctionProfileHTML\"\n      Executed=\"ExportFunctionProfileHtmlExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.CopySelectedLinesAsHTML\"\n      Executed=\"CopySelectedLinesAsHtmlExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.CopySelectedText\"\n      Executed=\"CopySelectedTextExecuted\" />\n    <CommandBinding\n      Command=\"local:DocumentHostCommand.ExportFunctionProfileMarkdown\"\n      Executed=\"ExportFunctionProfileMarkdownExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"JumpToNextProfiledElementCanExecute\"\n      Command=\"local:DocumentHostCommand.JumpToNextProfiledElement\"\n      Executed=\"JumpToNextProfiledElementExecuted\" />\n    <CommandBinding\n      CanExecute=\"JumpToPreviousProfiledElementCanExecute\"\n      Command=\"local:DocumentHostCommand.JumpToPreviousProfiledElement\"\n      Executed=\"JumpToPreviousProfiledElementExecuted\" />\n    <CommandBinding\n      CanExecute=\"JumpToNextProfiledBlockCanExecute\"\n      Command=\"local:DocumentHostCommand.JumpToNextProfiledBlock\"\n      Executed=\"JumpToNextProfiledBlockExecuted\" />\n    <CommandBinding\n      CanExecute=\"JumpToPreviousProfiledBlockCanExecute\"\n      Command=\"local:DocumentHostCommand.JumpToPreviousProfiledBlock\"\n      Executed=\"JumpToPreviousProfiledBlockExecuted\" />\n  </UserControl.CommandBindings>\n\n  <UserControl.Resources>\n    <Style\n      x:Key=\"ColumnsGridSplitterStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"2\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding ColumnsVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"ColumnsStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"*\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding ColumnsVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"GridSplitterStyle\"\n      TargetType=\"{x:Type RowDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Height\" Value=\"2\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding PassOutputVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Height\" Value=\"0\" />\n            <Setter Property=\"MaxHeight\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"PassOutputStyle\"\n      TargetType=\"{x:Type RowDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Height\" Value=\"*\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding PassOutputVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Height\" Value=\"0\" />\n            <Setter Property=\"MaxHeight\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n  </UserControl.Resources>\n\n  <Grid>\n    <Grid>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"28\" />\n        <RowDefinition Height=\"3*\" />\n        <RowDefinition Style=\"{StaticResource GridSplitterStyle}\" />\n        <RowDefinition Style=\"{StaticResource PassOutputStyle}\" />\n      </Grid.RowDefinitions>\n\n      <Grid\n        Grid.Row=\"0\"\n        HorizontalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"50\" />\n        </Grid.ColumnDefinitions>\n        <ToolBarTray\n          x:Name=\"DocumentToolbar\"\n          Grid.Column=\"0\"\n          Height=\"28\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          IsLocked=\"True\">\n          <ToolBar\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            Loaded=\"ToolBar_Loaded\">\n\n            <Button\n              Margin=\"2,0,0,0\"\n              Click=\"BackButton_Click\"\n              CommandTarget=\"{Binding ElementName=GraphHost}\"\n              IsEnabled=\"{Binding HasPreviousFunctions}\"\n              ToolTip=\"Go back to previous function (Backspace/Mouse Back button)\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Source=\"{StaticResource DockLeftIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  Text=\"Back\" />\n              </StackPanel>\n            </Button>\n            <Menu\n              Width=\"10\"\n              Height=\"20\"\n              VerticalAlignment=\"Center\"\n              IsEnabled=\"{Binding HasPreviousFunctions}\"\n              ToolTip=\"View list of functions to go back to\">\n              <MenuItem\n                x:Name=\"BackMenu\"\n                Width=\"10\"\n                Height=\"20\"\n                Margin=\"0,0,0,0\"\n                Padding=\"0,2,0,0\"\n                OverridesDefaultStyle=\"True\">\n                <MenuItem.HeaderTemplate>\n                  <DataTemplate>\n                    <Path\n                      x:Name=\"Foo\"\n                      HorizontalAlignment=\"Center\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 4 4 L 8 0 Z\"\n                      Fill=\"Black\" />\n                    <DataTemplate.Triggers>\n                      <DataTrigger\n                        Binding=\"{Binding DataContext.HasPreviousFunctions, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ToolBar}}}\"\n                        Value=\"False\">\n                        <Setter TargetName=\"Foo\" Property=\"Fill\" Value=\"Gray\" />\n                      </DataTrigger>\n                    </DataTemplate.Triggers>\n                  </DataTemplate>\n                </MenuItem.HeaderTemplate>\n              </MenuItem>\n            </Menu>\n            <Button\n              Margin=\"2,0,0,0\"\n              Click=\"NextButton_Click\"\n              CommandTarget=\"{Binding ElementName=GraphHost}\"\n              IsEnabled=\"{Binding HasNextFunctions}\"\n              ToolTip=\"Go back to next function (Shift+Backspace/Mouse Forward button)\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Source=\"{StaticResource DockRightIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </StackPanel>\n            </Button>\n            <Separator />\n\n            <Button\n              Command=\"local:DocumentHostCommand.ShowSectionList\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Switch to section (Alt+S)\"\n              Visibility=\"{Binding ProfileVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SwitchIcon}\" />\n            </Button>\n            <Button\n              Command=\"local:DocumentHostCommand.PreviousSection\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Switch to previous section (Ctrl+P)\"\n              Visibility=\"{Binding ProfileVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource LeftArrowIcon}\" />\n            </Button>\n            <Button\n              Command=\"local:DocumentHostCommand.NextSection\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Switch to next section (Ctrl+N)\"\n              Visibility=\"{Binding ProfileVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource RightArrowIcon}\" />\n            </Button>\n            <Separator\n              Visibility=\"{Binding ProfileVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              HorizontalAlignment=\"Center\"\n              VerticalAlignment=\"Center\"\n              Text=\"Block\" />\n            <ComboBox\n              x:Name=\"BlockSelector\"\n              Width=\"70\"\n              Margin=\"4,0,0,0\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              DisplayMemberPath=\"Number\"\n              Loaded=\"ComboBox_Loaded\"\n              SelectedValuePath=\"Number\"\n              SelectionChanged=\"BlockSelector_SelectionChanged\"\n              ToolTip=\"Jump to block (Alt+G)\"\n              VirtualizingStackPanel.IsVirtualizing=\"True\"\n              VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n              <ComboBox.Resources>\n                <Style TargetType=\"ComboBoxItem\">\n                  <Setter Property=\"FocusVisualStyle\" Value=\"{x:Null}\" />\n                  <Style.Triggers>\n                    <DataTrigger\n                      Binding=\"{Binding IsEmpty}\"\n                      Value=\"True\">\n                      <Setter Property=\"Foreground\" Value=\"Gray\" />\n                      <Setter Property=\"FontWeight\" Value=\"Light\" />\n                    </DataTrigger>\n                    <DataTrigger\n                      Binding=\"{Binding IsBranchBlock}\"\n                      Value=\"True\">\n                      <Setter Property=\"Foreground\" Value=\"#0042B6\" />\n                      <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                    </DataTrigger>\n                    <DataTrigger\n                      Binding=\"{Binding IsSwitchBlock}\"\n                      Value=\"True\">\n                      <Setter Property=\"Foreground\" Value=\"#8500BE\" />\n                      <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                    </DataTrigger>\n                    <DataTrigger\n                      Binding=\"{Binding IsReturnBlock}\"\n                      Value=\"True\">\n                      <Setter Property=\"Foreground\" Value=\"#B30606\" />\n                      <Setter Property=\"FontWeight\" Value=\"Bold\" />\n                    </DataTrigger>\n                    <DataTrigger\n                      Binding=\"{Binding HasLoopBackedge}\"\n                      Value=\"True\">\n                      <Setter Property=\"Foreground\" Value=\"#008D00\" />\n                      <Setter Property=\"FontWeight\" Value=\"Bold\" />\n                    </DataTrigger>\n                  </Style.Triggers>\n                </Style>\n              </ComboBox.Resources>\n\n              <ComboBox.ItemsPanel>\n                <ItemsPanelTemplate>\n                  <VirtualizingStackPanel />\n                </ItemsPanelTemplate>\n              </ComboBox.ItemsPanel>\n            </ComboBox>\n            <Button\n              Margin=\"4,0,0,0\"\n              Command=\"local:DocumentCommand.PreviousBlock\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Go to previous block (Ctrl+Arrow Up)\">\n              <Image Source=\"{StaticResource UpArrowIcon}\" />\n            </Button>\n\n            <Button\n              Command=\"local:DocumentCommand.NextBlock\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Go to next block (Ctrl+Arrow Down)\">\n              <Image Source=\"{StaticResource DownArrowIcon}\" />\n            </Button>\n            <Separator />\n\n            <Menu\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n              <MenuItem\n                Height=\"20\"\n                Margin=\"0,0,-1,0\"\n                Padding=\"0,0,0,0\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                OverridesDefaultStyle=\"True\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"-4,0,0,0\"\n                    Source=\"{StaticResource BookmarkIcon}\" />\n                </MenuItem.Icon>\n\n                <MenuItem\n                  Command=\"local:DocumentCommand.AddBookmark\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Add Bookmark\"\n                  InputGestureText=\"Ctrl+B\"\n                  ToolTip=\"Add a new bookmark associated with the selected value\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource AddBookmarkIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <Separator />\n\n                <MenuItem\n                  Command=\"local:DocumentCommand.FirstBookmark\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Jump to First Bookmark\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource BoldUpArrowIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:DocumentCommand.LastBookmark\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Jump to Last Bookmark\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource BoldDownArrowIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <Separator />\n\n                <MenuItem\n                  Command=\"local:DocumentCommand.RemoveBookmark\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Remove Selected Bookmark\"\n                  InputGestureText=\"Ctrl+Shift+B\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource RemoveIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:DocumentCommand.RemoveAllBookmarks\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Remove All Bookmarks\" />\n              </MenuItem>\n            </Menu>\n\n            <Button\n              Command=\"local:DocumentCommand.PreviousBookmark\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Jump to previous bookmark\">\n              <Image Source=\"{StaticResource UpArrowIcon}\" />\n            </Button>\n            <Button\n              Command=\"local:DocumentCommand.NextBookmark\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Jump to next bookmark\">\n              <Image Source=\"{StaticResource DownArrowIcon}\" />\n            </Button>\n            <Separator Visibility=\"Collapsed\" />\n\n            <ToggleButton\n              Height=\"20\"\n              Margin=\"0,0,0,0\"\n              Padding=\"0,0,2,0\"\n              IsChecked=\"{Binding Path=ShowRemarks, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n              IsEnabled=\"False\"\n              ToolTip=\"Enable/disable showing of remarks\"\n              Visibility=\"Collapsed\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Margin=\"0,1,0,0\"\n                  Source=\"{StaticResource RemarkIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock Text=\"Remarks\" />\n              </StackPanel>\n            </ToggleButton>\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"0,0,2,0\"\n              Padding=\"0,0,0,0\"\n              IsChecked=\"{Binding Path=ShowPreviousSections, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n              IsEnabled=\"{Binding Path=ShowRemarks}\"\n              ToolTip=\"Show remarks from previous sections\"\n              Visibility=\"Collapsed\">\n              <Image\n                Source=\"{StaticResource HistoryIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </ToggleButton>\n            <Button\n              Width=\"20\"\n              Height=\"20\"\n              Padding=\"0,0,0,0\"\n              Click=\"MenuItem_Click_1\"\n              IsEnabled=\"False\"\n              ToolTip=\"Show remarks options panel\"\n              Visibility=\"Collapsed\">\n              <Image\n                Source=\"{StaticResource ConfigIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </Button>\n\n            <Separator />\n            <!-- <Menu -->\n            <!--   VerticalAlignment=\"Center\" -->\n            <!--   Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"> -->\n            <!--   <MenuItem -->\n            <!--     Padding=\"0,2,2,2\" -->\n            <!--     Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n            <!--     BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n            <!--     Header=\"Clear\" -->\n            <!--     OverridesDefaultStyle=\"True\"> -->\n            <!--     <MenuItem.Icon> -->\n            <!--       <Image -->\n            <!--         Width=\"18\" -->\n            <!--         Height=\"18\" -->\n            <!--         Margin=\"-2,0,-2,0\" -->\n            <!--         Source=\"{StaticResource RemoveIcon}\" -->\n            <!--         Style=\"{StaticResource DisabledImageStyle}\" /> -->\n            <!--     </MenuItem.Icon> -->\n            <!--     <MenuItem -->\n            <!--       Command=\"local:DocumentCommand.ClearMarker\" -->\n            <!--       CommandTarget=\"{Binding ElementName=TextView}\" -->\n            <!--       Header=\"Selected Marker\" -->\n            <!--       InputGestureText=\"Ctrl+Del\" /> -->\n            <!--     <MenuItem -->\n            <!--       Command=\"local:DocumentCommand.ClearAllMarkers\" -->\n            <!--       CommandTarget=\"{Binding ElementName=TextView}\" -->\n            <!--       Header=\"All Markers\" -->\n            <!--       InputGestureText=\"Ctrl+Shift+Del\" /> -->\n            <!--     <MenuItem -->\n            <!--       Command=\"local:DocumentCommand.ClearBlockMarkers\" -->\n            <!--       CommandTarget=\"{Binding ElementName=TextView}\" -->\n            <!--       Header=\"All Block Markers\" /> -->\n            <!--     <MenuItem -->\n            <!--       Command=\"local:DocumentCommand.ClearInstructionMarkers\" -->\n            <!--       CommandTarget=\"{Binding ElementName=TextView}\" -->\n            <!--       Header=\"All Instruction Markers\" /> -->\n            <!--   </MenuItem> -->\n            <!-- </Menu> -->\n            <!-- <Separator /> -->\n\n            <!-- <Menu -->\n            <!--   VerticalAlignment=\"Center\" -->\n            <!--   Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"> -->\n            <!--   <MenuItem -->\n            <!--     x:Name=\"TaskMenuItem\" -->\n            <!--     Padding=\"0,0,0,0\" -->\n            <!--     Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n            <!--     BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n            <!--     Header=\"Tasks\" -->\n            <!--     OverridesDefaultStyle=\"True\" -->\n            <!--     SubmenuOpened=\"TaskMenuItem_SubmenuOpened\"> -->\n            <!--     <MenuItem.Icon> -->\n            <!--       <Image -->\n            <!--         Width=\"16\" -->\n            <!--         Height=\"16\" -->\n            <!--         Margin=\"-2,0,-2,0\" -->\n            <!--         HorizontalAlignment=\"Center\" -->\n            <!--         VerticalAlignment=\"Center\" -->\n            <!--         Source=\"{StaticResource TasklistIcon}\" -->\n            <!--         Style=\"{StaticResource DisabledImageStyle}\" /> -->\n            <!--     </MenuItem.Icon> -->\n            <!--     <Separator /> -->\n            <!--     <MenuItem Header=\"Edit Task Definitions\" /> -->\n            <!--   </MenuItem> -->\n            <!--   <MenuItem -->\n            <!--     x:Name=\"QueryMenuItem\" -->\n            <!--     Padding=\"0,0,0,0\" -->\n            <!--     Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n            <!--     BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n            <!--     Header=\"Queries\" -->\n            <!--     OverridesDefaultStyle=\"True\" -->\n            <!--     SubmenuOpened=\"QueryMenuItem_SubmenuOpened\"> -->\n            <!--     <MenuItem.Icon> -->\n            <!--       <Image -->\n            <!--         Width=\"18\" -->\n            <!--         Height=\"18\" -->\n            <!--         Margin=\"-2,0,-2,0\" -->\n            <!--         HorizontalAlignment=\"Center\" -->\n            <!--         Source=\"{StaticResource QueryIcon}\" -->\n            <!--         Style=\"{StaticResource DisabledImageStyle}\" /> -->\n            <!--     </MenuItem.Icon> -->\n            <!--     <Separator /> -->\n            <!--     <MenuItem -->\n            <!--       Click=\"CloseAllQueryPanelsMenuItem_Click\" -->\n            <!--       Header=\"Close All Query Panels\" /> -->\n            <!--   </MenuItem> -->\n            <!-- </Menu> -->\n            <!-- <Separator /> -->\n\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"0,0,2,0\"\n              Padding=\"0,0,0,0\"\n              IsChecked=\"{Binding Path=PassOutputVisible, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n              ToolTip=\"Show associated pass output in this document\"\n              Visibility=\"Collapsed\">\n              <Image\n                Source=\"{StaticResource ListIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </ToggleButton>\n            <Button\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"0,0,2,0\"\n              Padding=\"0,0,0,0\"\n              Click=\"OpenPopupButton_Click\"\n              ToolTip=\"Open the document in a new popup window\">\n              <Image\n                Source=\"{StaticResource OpenExternalIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </Button>\n\n            <ToggleButton\n              x:Name=\"SearchButton\"\n              Command=\"local:DocumentHostCommand.ShowSearch\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Search section text (Ctrl+F)\">\n              <Image\n                Source=\"{StaticResource SearchIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </ToggleButton>\n          </ToolBar>\n        </ToolBarTray>\n        <local:PanelToolbarTray\n          Grid.Column=\"1\"\n          HasDuplicateButton=\"False\"\n          HasHelpButton=\"True\"\n          HasPinButton=\"False\"\n          HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n          SettingsClicked=\"PanelToolbarTray_SettingsClicked\" />\n      </Grid>\n\n      <Grid Row=\"1\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"2*\" />\n          <ColumnDefinition Style=\"{StaticResource ColumnsGridSplitterStyle}\" />\n          <ColumnDefinition Style=\"{StaticResource ColumnsStyle}\" />\n        </Grid.ColumnDefinitions>\n\n        <DockPanel\n          Grid.Column=\"0\"\n          LastChildFill=\"True\">\n          <Border\n            Height=\"23\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Top\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            BorderThickness=\"0,1,0,1\"\n            DockPanel.Dock=\"Top\"\n            Visibility=\"{Binding ProfileVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <ToolBarTray\n              x:Name=\"ProfileToolbar\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Stretch\"\n              Background=\"{DynamicResource {x:Static SystemColors.MenuBarBrushKey}}\"\n              IsLocked=\"True\">\n              <ToolBar\n                Height=\"22\"\n                HorizontalAlignment=\"Stretch\"\n                VerticalAlignment=\"Center\"\n                Background=\"{DynamicResource {x:Static SystemColors.MenuBarBrushKey}}\"\n                Loaded=\"ToolBar_Loaded\">\n                <Menu\n                  Margin=\"2,0,0,0\"\n                  VerticalAlignment=\"Center\">\n                  <MenuItem\n                    x:Name=\"ProfileElementsMenu\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    OverridesDefaultStyle=\"True\"\n                    ToolTip=\"View sorted list of hottest lines\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          VerticalAlignment=\"Bottom\"\n                          Text=\"Profile\" />\n                        <Path\n                          Margin=\"4,2,0,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                  </MenuItem>\n                </Menu>\n                <Button\n                  Margin=\"4,0,0,0\"\n                  Padding=\"0\"\n                  VerticalAlignment=\"Center\"\n                  Command=\"local:DocumentHostCommand.JumpToProfiledElement\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  ToolTip=\"Jump to hottest profiled instruction (Ctrl+H)\"\n                  Visibility=\"{Binding ProfileVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <Image\n                    Source=\"{StaticResource HotFlameIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n                <Button\n                  Margin=\"2,0,0,0\"\n                  Padding=\"0\"\n                  Command=\"local:DocumentHostCommand.JumpToPreviousProfiledElement\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  ToolTip=\"Jump to previous less hot instruction (Shift+F2)\">\n                  <Image\n                    Source=\"{StaticResource MinusIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n                <Button\n                  Margin=\"0,0,2,0\"\n                  Padding=\"0\"\n                  Command=\"local:DocumentHostCommand.JumpToNextProfiledElement\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  ToolTip=\"Jump to next hotter instruction (F2)\">\n                  <Image\n                    Source=\"{StaticResource PlusIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n                <Separator Style=\"{StaticResource {x:Static ToolBar.SeparatorStyleKey}}\" />\n\n                <Menu\n                  Margin=\"2,0,0,0\"\n                  VerticalAlignment=\"Center\">\n                  <MenuItem\n                    x:Name=\"ProfileBlocksMenu\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    OverridesDefaultStyle=\"True\"\n                    ToolTip=\"View sorted list of hottest blocks\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <Image\n                          Source=\"{StaticResource BlockIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                        <TextBlock\n                          Margin=\"2,0,0,0\"\n                          VerticalAlignment=\"Bottom\"\n                          Text=\"Blocks\" />\n                        <Path\n                          Margin=\"4,2,0,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                  </MenuItem>\n                </Menu>\n                <Menu\n                  Margin=\"2,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  ToolTip=\"View sorted list of inlined functions\">\n                  <MenuItem\n                    x:Name=\"InlineesMenu\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    OverridesDefaultStyle=\"True\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <Image\n                          Source=\"{StaticResource TreeIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                        <TextBlock\n                          Margin=\"2,0,0,0\"\n                          VerticalAlignment=\"Bottom\"\n                          Text=\"Inlinees\" />\n                        <Path\n                          Margin=\"4,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Header=\"Non-Inlinee\"\n                      IsCheckable=\"False\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\"\n                      ToolTip=\"Time for parts not originating from inlined functions\" />\n                    <Separator />\n                  </MenuItem>\n                </Menu>\n\n                <Button\n                  Margin=\"2,0,0,0\"\n                  Padding=\"0\"\n                  Command=\"local:DocumentHostCommand.JumpToPreviousProfiledBlock\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  ToolTip=\"Jump to the previous hottest block (Shift+F2)\"\n                  Visibility=\"Collapsed\">\n                  <Image\n                    Source=\"{StaticResource MinusIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n                <Button\n                  Padding=\"0\"\n                  Command=\"local:DocumentHostCommand.JumpToNextProfiledBlock\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  ToolTip=\"Jump to next hottest block (Shift+F2)\"\n                  Visibility=\"Collapsed\">\n                  <Image\n                    Source=\"{StaticResource PlusIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n                <Separator Style=\"{StaticResource {x:Static ToolBar.SeparatorStyleKey}}\" />\n\n                <Menu\n                  Margin=\"2,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  ToolTip=\"Select function instances to display\">\n                  <MenuItem\n                    x:Name=\"InstancesMenu\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    Background=\"{Binding Path=HasProfileInstanceFilter, Converter={StaticResource BooToParameter}, ConverterParameter=#B4D4F4}\"\n                    OverridesDefaultStyle=\"True\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <Image\n                          Source=\"{StaticResource TasklistIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                        <TextBlock\n                          Margin=\"2,0,0,0\"\n                          VerticalAlignment=\"Bottom\"\n                          Text=\"Instances\" />\n                        <Path\n                          Margin=\"4,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Click=\"InstanceMenuItem_OnClick\"\n                      Header=\"All Instances\"\n                      IsCheckable=\"False\"\n                      IsChecked=\"{Binding RemoveEmptyColumns}\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                    <Separator />\n                  </MenuItem>\n                </Menu>\n                <Menu\n                  Margin=\"2,0,0,0\"\n                  VerticalAlignment=\"Center\">\n                  <MenuItem\n                    x:Name=\"ThreadsMenu\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    Background=\"{Binding Path=HasProfileThreadFilter, Converter={StaticResource BooToParameter}, ConverterParameter=#B4D4F4}\"\n                    OverridesDefaultStyle=\"True\"\n                    ToolTip=\"Select threads the function ran on to display\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <Image\n                          Height=\"15\"\n                          Source=\"{StaticResource FilterIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                        <TextBlock\n                          Margin=\"2,0,0,0\"\n                          VerticalAlignment=\"Bottom\"\n                          Text=\"Threads\" />\n                        <Path\n                          Margin=\"4,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Click=\"ThreadMenuItem_OnClick\"\n                      Header=\"All Threads\"\n                      IsCheckable=\"False\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                    <Separator />\n                  </MenuItem>\n                </Menu>\n                <Separator />\n                <Menu\n                  Margin=\"0,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  Visibility=\"{Binding ProfileVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <MenuItem\n                    Padding=\"0,0,0,0\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                    OverridesDefaultStyle=\"True\"\n                    ToolTip=\"Export function list\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Margin=\"2,0,0,0\"\n                          VerticalAlignment=\"Bottom\"\n                          Text=\"Export\" />\n                        <Path\n                          Margin=\"4,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Command=\"local:DocumentHostCommand.ExportFunctionProfile\"\n                      CommandTarget=\"{Binding ElementName=TextView}\"\n                      Header=\"Export as Excel File\"\n                      ToolTip=\"Save the document lines and additional columns as an Excel worksheet\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource ExcelIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Command=\"local:DocumentHostCommand.ExportFunctionProfileHTML\"\n                      CommandTarget=\"{Binding ElementName=TextView}\"\n                      Header=\"Export as HTML File\"\n                      ToolTip=\"Save the document lines and additional columns as an HTML file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource SourceIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Command=\"local:DocumentHostCommand.ExportFunctionProfileMarkdown\"\n                      CommandTarget=\"{Binding ElementName=TextView}\"\n                      Header=\"Export as Markdown File\"\n                      ToolTip=\"Save the document lines and additional columns as a Markdown file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource DocumentIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <Separator />\n                    <MenuItem\n                      Command=\"{Binding CopyDocumentCommand}\"\n                      CommandTarget=\"{Binding ElementName=FunctionList}\"\n                      Header=\"Copy as HTML/Markdown table\"\n                      ToolTip=\"Copy the document lines and additional columns as an HTML file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource ClipboardIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                  </MenuItem>\n                </Menu>\n                <Menu\n                  Margin=\"2,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  ToolTip=\"Configure displayed profiling columns\">\n                  <MenuItem\n                    x:Name=\"ProfileViewMenu\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    OverridesDefaultStyle=\"True\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <Image\n                          Source=\"{StaticResource EyeIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                        <TextBlock\n                          Margin=\"2,0,0,0\"\n                          VerticalAlignment=\"Bottom\"\n                          Text=\"View\" />\n                        <Path\n                          Margin=\"4,2,0,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      x:Name=\"ViewMenuItem1\"\n                      Header=\"Show Performance Counters\"\n                      IsCheckable=\"True\"\n                      IsChecked=\"{Binding ShowPerformanceCounterColumns}\"\n                      StaysOpenOnClick=\"True\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                    <MenuItem\n                      x:Name=\"ViewMenuItem2\"\n                      Header=\"Show Performance Metrics\"\n                      IsCheckable=\"True\"\n                      IsChecked=\"{Binding ShowPerformanceMetricColumns}\"\n                      StaysOpenOnClick=\"True\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                    <MenuItem\n                      x:Name=\"ViewMenuItem3\"\n                      Header=\"Hide Empty Columns\"\n                      IsCheckable=\"True\"\n                      IsChecked=\"{Binding RemoveEmptyColumns}\"\n                      StaysOpenOnClick=\"True\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                    <Separator />\n                    <MenuItem\n                      Header=\"Columns\"\n                      IsEnabled=\"False\"\n                      IsHitTestVisible=\"False\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                  </MenuItem>\n                </Menu>\n              </ToolBar>\n            </ToolBarTray>\n          </Border>\n\n          <local:IRDocument\n            x:Name=\"TextView\"\n            DockPanel.Dock=\"Bottom\"\n            FontFamily=\"Consolas\"\n            FontSize=\"13\"\n            ShowLineNumbers=\"True\"\n            VerticalScrollBarVisibility=\"Visible\">\n            <local:IRDocument.ContextMenu>\n              <ContextMenu>\n                <MenuItem\n                  Command=\"local:DocumentCommand.PreviewDefinition\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Preview Definition\"\n                  InputGestureText=\"Alt+Return\"\n                  ToolTip=\"Preview operand definition or call target function\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource OpenExternalIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:DocumentCommand.GoToDefinition\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Go To Definition\"\n                  InputGestureText=\"Return/Double-Click\"\n                  ToolTip=\"Jump to operand definition or open call target function in current view\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource GotoDefinitionIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <!-- <MenuItem -->\n                <!--   Command=\"local:DocumentCommand.GoToDefinitionSkipCopies\" -->\n                <!--   CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--   Header=\"Go To Definition (Skip Copies)\"> -->\n                <!--   <MenuItem.Icon> -->\n                <!--     <Image -->\n                <!--       Width=\"16\" -->\n                <!--       Height=\"16\" -->\n                <!--       Source=\"{StaticResource GotoDefinitionIconSkipIcon}\" -->\n                <!--       Style=\"{StaticResource DisabledImageStyle}\" /> -->\n                <!--   </MenuItem.Icon> -->\n                <!-- </MenuItem> -->\n                <Separator />\n\n                <MenuItem\n                  Command=\"local:DocumentHostCommand.CopySelectedLinesAsHTML\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Copy Selection Details\"\n                  InputGestureText=\"Ctrl+C\"\n                  ToolTip=\"Copy the selected text and additional profiling columns as a HTML table\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource ClipboardIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:DocumentHostCommand.CopySelectedText\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Copy Text\"\n                  InputGestureText=\"Ctrl+Shift+C\"\n                  ToolTip=\"Copy the selected text only\" />\n                <Separator />\n                <MenuItem\n                  Command=\"local:DocumentHostCommand.SearchSymbol\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Search Symbol\"\n                  InputGestureText=\"Ctrl+Shift+F\"\n                  ToolTip=\"Search the selected symbol text\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource SearchIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:DocumentHostCommand.SearchSymbolAllSections\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Search Symbol in Search Results\"\n                  ToolTip=\"Search the selected symbol text and show results in the Search Results view\"/>\n                <Separator />\n\n                <MenuItem\n                  Command=\"local:DocumentCommand.ShowReferences\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Show All References\"\n                  InputGestureText=\"Ctrl+R\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource ListIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <!-- <MenuItem -->\n                <!--   Command=\"local:DocumentCommand.ShowUses\" -->\n                <!--   CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--   Header=\"Show SSA Uses\" -->\n                <!--   InputGestureText=\"Ctrl+U\"> -->\n                <!--   <MenuItem.Icon> -->\n                <!--     <Image -->\n                <!--       Width=\"16\" -->\n                <!--       Height=\"16\" -->\n                <!--       Source=\"{StaticResource SectionIcon}\" -->\n                <!--       Style=\"{StaticResource DisabledImageStyle}\" /> -->\n                <!--   </MenuItem.Icon> -->\n                <!-- </MenuItem> -->\n                <MenuItem\n                  Command=\"local:DocumentCommand.ShowExpressionGraph\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"View Expression Graph\"\n                  InputGestureText=\"Ctrl+E\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource GraphIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n\n                <Separator />\n\n                <MenuItem\n                  Command=\"local:DocumentCommand.AddBookmark\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Add Bookmark\"\n                  InputGestureText=\"Ctrl+B\"\n                  ToolTip=\"Add a new bookmark associated with the selected value\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource AddBookmarkIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:DocumentCommand.RemoveBookmark\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Remove Bookmark\"\n                  InputGestureText=\"Ctrl+Shift+B\"\n                  ToolTip=\"Remove the bookmark associated with the selected value\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource RemoveIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <Separator />\n\n                <!-- Saving of markings with profiling not yet implemented -->\n                <!-- <MenuItem -->\n                <!--   Focusable=\"False\" -->\n                <!--   Header=\"Mark\" -->\n                <!--   InputGestureText=\"Ctrl+M\" -->\n                <!--   IsHitTestVisible=\"False\" /> -->\n                <!-- <MenuItem> -->\n                <!--   <MenuItem.Header> -->\n                <!--     <local:ColorSelector ColorSelectedCommand=\"local:DocumentCommand.Mark\" /> -->\n                <!--   </MenuItem.Header> -->\n                <!-- </MenuItem> -->\n                <!-- <Separator /> -->\n                <!-- -->\n                <!-- <MenuItem> -->\n                <!--   <MenuItem.Header> -->\n                <!--     <local:IconSelector -->\n                <!--       Margin=\"0,2,0,2\" -->\n                <!--       IconSelectedCommand=\"local:DocumentCommand.MarkIcon\" /> -->\n                <!--   </MenuItem.Header> -->\n                <!-- </MenuItem> -->\n                <!-- <Separator /> -->\n                <!-- -->\n                <!-- <MenuItem -->\n                <!--   Header=\"Mark Block\" -->\n                <!--   InputGestureText=\"Ctrl+Shift+M\"> -->\n                <!--   <MenuItem> -->\n                <!--     <MenuItem.Header> -->\n                <!--       <local:ColorSelector ColorSelectedCommand=\"local:DocumentCommand.MarkBlock\" /> -->\n                <!--     </MenuItem.Header> -->\n                <!--   </MenuItem> -->\n                <!-- </MenuItem> -->\n                <!-- <MenuItem -->\n                <!--   Command=\"local:DocumentCommand.MarkDefinition\" -->\n                <!--   CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--   Header=\"Mark Definition(s)\" -->\n                <!--   InputGestureText=\"Ctrl+D\"> -->\n                <!--   <MenuItem> -->\n                <!--     <MenuItem.Header> -->\n                <!--       <local:ColorSelector ColorSelectedCommand=\"local:DocumentCommand.MarkDefinition\" /> -->\n                <!--     </MenuItem.Header> -->\n                <!--   </MenuItem> -->\n                <!-- </MenuItem> -->\n                <!-- <MenuItem -->\n                <!--   Header=\"Mark Definition Block\" -->\n                <!--   InputGestureText=\"Ctrl+Shift+D\"> -->\n                <!--   <MenuItem> -->\n                <!--     <MenuItem.Header> -->\n                <!--       <local:ColorSelector ColorSelectedCommand=\"local:DocumentCommand.MarkDefinitionBlock\" /> -->\n                <!--     </MenuItem.Header> -->\n                <!--   </MenuItem> -->\n                <!-- </MenuItem> -->\n                <!-- <MenuItem -->\n                <!--   Command=\"local:DocumentCommand.MarkUses\" -->\n                <!--   CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--   Header=\"Mark Uses\" -->\n                <!--   InputGestureText=\"Ctrl+Shift+U\"> -->\n                <!--   <MenuItem> -->\n                <!--     <MenuItem.Header> -->\n                <!--       <local:ColorSelector ColorSelectedCommand=\"local:DocumentCommand.MarkUses\" /> -->\n                <!--     </MenuItem.Header> -->\n                <!--   </MenuItem> -->\n                <!-- </MenuItem> -->\n                <!-- <MenuItem -->\n                <!--   Command=\"local:DocumentCommand.MarkReferences\" -->\n                <!--   CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--   Header=\"Mark All References\" -->\n                <!--   InputGestureText=\"Ctrl+Shift+R\" /> -->\n                <!-- <Separator /> -->\n\n                <MenuItem\n                  Command=\"local:DocumentCommand.UndoAction\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Undo\"\n                  InputGestureText=\"Ctrl+Z\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource UndoIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n\n                <!-- <MenuItem Header=\"Clear\"> -->\n                <!--   <MenuItem -->\n                <!--     Command=\"local:DocumentCommand.ClearMarker\" -->\n                <!--     CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--     Header=\"Selected Marker\" -->\n                <!--     InputGestureText=\"Ctrl+Del\" /> -->\n                <!--   <MenuItem -->\n                <!--     Command=\"local:DocumentCommand.ClearAllMarkers\" -->\n                <!--     CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--     Header=\"All Markers\" -->\n                <!--     InputGestureText=\"Ctrl+Shift+Del\" /> -->\n                <!--   <MenuItem -->\n                <!--     Command=\"local:DocumentCommand.ClearBlockMarkers\" -->\n                <!--     CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--     Header=\"All Block Markers\" /> -->\n                <!--   <MenuItem -->\n                <!--     Command=\"local:DocumentCommand.ClearInstructionMarkers\" -->\n                <!--     CommandTarget=\"{Binding ElementName=TextView}\" -->\n                <!--     Header=\"All Instruction Markers\" /> -->\n                <!--   <MenuItem.Icon> -->\n                <!--     <Image -->\n                <!--       Width=\"16\" -->\n                <!--       Height=\"16\" -->\n                <!--       Source=\"{StaticResource RemoveIcon}\" -->\n                <!--       Style=\"{StaticResource DisabledImageStyle}\" /> -->\n                <!--   </MenuItem.Icon> -->\n                <!-- </MenuItem> -->\n              </ContextMenu>\n            </local:IRDocument.ContextMenu>\n          </local:IRDocument>\n        </DockPanel>\n\n        <GridSplitter\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Stretch\"\n          Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n          ResizeBehavior=\"PreviousAndNext\" />\n\n        <doc:DocumentColumns\n          x:Name=\"ProfileColumns\"\n          Grid.Column=\"2\"\n          Padding=\"-1,0,0,0\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Stretch\" />\n      </Grid>\n      <GridSplitter\n        Grid.Row=\"2\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n        ResizeBehavior=\"PreviousAndNext\" />\n\n      <local:PassOutputPanel\n        x:Name=\"PassOutput\"\n        Grid.Row=\"3\"\n        HasDuplicateButton=\"false\"\n        HasPinButton=\"false\"\n        Visibility=\"{Binding PassOutputVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n    </Grid>\n\n    <Border\n      x:Name=\"SectionPanelHost\"\n      Width=\"415\"\n      Height=\"500\"\n      Margin=\"0,28,0,0\"\n      HorizontalAlignment=\"Left\"\n      VerticalAlignment=\"Top\"\n      Panel.ZIndex=\"99\"\n      BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n      BorderThickness=\"0,2,2,2\"\n      Visibility=\"Collapsed\">\n      <local:SectionPanel\n        x:Name=\"SectionPanel\"\n        Width=\"415\"\n        Height=\"500\"\n        HorizontalAlignment=\"Left\"\n        VerticalAlignment=\"Top\"\n        BottomSectionToolbar=\"True\" />\n    </Border>\n\n    <Grid Panel.ZIndex=\"99\">\n      <doc:SearchPanel\n        x:Name=\"SearchPanel\"\n        Width=\"500\"\n        Height=\"28\"\n        Margin=\"0,28,0,0\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Top\"\n        Opacity=\"1\"\n        Visibility=\"Collapsed\" />\n    </Grid>\n\n    <Canvas\n      x:Name=\"DocumentCanvas\"\n      Panel.ZIndex=\"100\">\n      <doc:ActionPanel\n        x:Name=\"ActionPanel\"\n        MouseEnter=\"ActionPanel_MouseEnter\"\n        MouseLeave=\"ActionPanel_MouseLeave\"\n        RemarksButtonClicked=\"ActionPanel_RemarksButtonClicked\" />\n    </Canvas>\n  </Grid>\n\n  <UserControl.InputBindings>\n    <KeyBinding\n      Key=\"Up\"\n      Command=\"local:DocumentCommand.PreviousBlock\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Down\"\n      Command=\"local:DocumentCommand.NextBlock\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"G\"\n      Command=\"local:DocumentCommand.FocusBlockSelector\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Alt\" />\n    <KeyBinding\n      Key=\"F\"\n      Command=\"local:DocumentHostCommand.ToggleSearch\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F\"\n      Command=\"local:DocumentHostCommand.SearchSymbol\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl+Shift\" />\n    <KeyBinding\n      Key=\"S\"\n      Command=\"local:DocumentHostCommand.ShowSectionList\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Alt\" />\n    <KeyBinding\n      Key=\"P\"\n      Command=\"local:DocumentHostCommand.PreviousSection\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"N\"\n      Command=\"local:DocumentHostCommand.NextSection\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"doc:SearchCommand.PreviousResult\"\n      CommandTarget=\"{Binding ElementName=SearchPanel}\"\n      Modifiers=\"Shift\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"doc:SearchCommand.NextResult\"\n      CommandTarget=\"{Binding ElementName=SearchPanel}\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"local:DocumentHostCommand.CopySelectedText\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl+Shift\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:DocumentCommand.PreviewDefinition\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Alt\" />\n  </UserControl.InputBindings>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Document/IRDocumentHost.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Animation;\nusing System.Windows.Threading;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Profile.Document;\nusing ProfileExplorer.UI.Query;\nusing ProtoBuf;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.CallTree;\n\nnamespace ProfileExplorer.UI;\n\npublic static class DocumentHostCommand {\n  public static readonly RoutedUICommand ShowSearch = new(\"Untitled\", \"ShowSearch\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ToggleSearch = new(\"Untitled\", \"ToggleSearch\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ShowSectionList = new(\"Untitled\", \"ShowSectionList\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand PreviousSection = new(\"Untitled\", \"PreviousSection\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand NextSection = new(\"Untitled\", \"NextSection\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand SearchSymbol = new(\"Untitled\", \"SearchSymbol\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand SearchSymbolAllSections =\n    new(\"Untitled\", \"SearchSymbolAllSections\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand JumpToProfiledElement =\n    new(\"Untitled\", \"JumpToProfiledElement\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand JumpToNextProfiledElement =\n    new(\"Untitled\", \"JumpToNextProfiledElement\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand JumpToPreviousProfiledElement =\n    new(\"Untitled\", \"JumpToPreviousProfiledElement\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand JumpToNextProfiledBlock =\n    new(\"Untitled\", \"JumpToNextProfiledBlock\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand JumpToPreviousProfiledBlock =\n    new(\"Untitled\", \"JumpToPreviousProfiledBlock\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ExportFunctionProfile =\n    new(\"Untitled\", \"ExportFunctionProfile\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ExportFunctionProfileHTML =\n    new(\"Untitled\", \"ExportFunctionProfileHTML\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand ExportFunctionProfileMarkdown =\n    new(\"Untitled\", \"ExportFunctionProfileMarkdown\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand CopySelectedLinesAsHTML =\n    new(\"Untitled\", \"CopySelectedLinesAsHTML\", typeof(IRDocumentHost));\n  public static readonly RoutedUICommand CopySelectedText = new(\"Untitled\", \"CopySelectedText\", typeof(IRDocumentHost));\n}\n\n[ProtoContract]\npublic class IRDocumentHostState {\n  [ProtoMember(1)]\n  public IRDocumentState DocumentState;\n  [ProtoMember(2)]\n  public double HorizontalOffset;\n  [ProtoMember(3)]\n  public double VerticalOffset;\n  public bool HasAnnotations => DocumentState.HasAnnotations;\n}\n\npublic partial class IRDocumentHost : UserControl, INotifyPropertyChanged {\n  private const double ActionPanelInitialOpacity = 0.5;\n  private const int ActionPanelHeight = 20;\n  private const double AnimationDuration = 0.1;\n  private const int ActionPanelOffset = 15;\n  private bool actionPanelHovered_;\n  private bool actionPanelFromClick_;\n  private bool actionPanelVisible_;\n  private bool duringSwitchSearchResults_;\n  private IRElement hoveredElement_;\n  private Point hoverPoint_;\n  private bool remarkOptionsPanelVisible_;\n  private IRElement remarkElement_;\n  private IRElement selectedElement_;\n  private RemarkSettings remarkSettings_;\n  private RemarkPreviewPanel remarkPanel_;\n  private Point remarkPanelLocation_;\n  private CancelableTaskInstance loadTask_;\n  private bool remarkPanelVisible_;\n  private bool searchPanelVisible_;\n  private SectionSearchResult searchResult_;\n  private IRElement selectedBlock_;\n  private IUISession session_;\n  private DocumentSettings settings_;\n  private List<Remark> remarkList_;\n  private RemarkContext activeRemarkContext_;\n  private List<QueryPanel> activeQueryPanels_;\n  private QueryValue mainQueryInputValue_;\n  private bool pasOutputVisible_;\n  private bool columnsVisible_;\n  private bool duringSectionSwitching_;\n  private double previousVerticalOffset_;\n  private List<(IRElement, TimeSpan)> profileElements_;\n  private List<(BlockIR, TimeSpan)> profileBlocks_;\n  private int profileElementIndex_;\n  private int profileBlockIndex_;\n  private OptionsPanelHostPopup remarkOptionsPanelPopup_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private DelayedAction delayedHideActionPanel_;\n  private bool profileVisible_;\n  private double columnsListItemHeight_;\n  private ProfileDocumentMarker profileMarker_;\n  private ProfileSampleFilter profileFilter_;\n  private FunctionProfileData funcProfile_;\n  private bool ignoreNextRowSelectedEvent_;\n  private ProfileHistoryManager historyManager_;\n  private MenuItem[] viewMenuItems_;\n\n  public IRDocumentHost(IUISession session) {\n    InitializeComponent();\n    DataContext = this;\n    PassOutput.DataContext = this;\n    ActionPanel.Visibility = Visibility.Collapsed;\n\n    Session = session;\n    remarkSettings_ = App.Settings.RemarkSettings;\n    Settings = App.Settings.DocumentSettings;\n    TextView.Initialize(Settings, Session);\n\n    // Initialize pass output panel.\n    PassOutput.Session = session;\n    PassOutput.HasPinButton = false;\n    PassOutput.HasDuplicateButton = false;\n    PassOutput.DiffModeButtonVisible = false;\n    PassOutput.SectionNameVisible = false;\n\n    SetupEvents();\n    var hover = new MouseHoverLogic(this);\n    hover.MouseHover += Hover_MouseHover;\n    loadTask_ = new CancelableTaskInstance(false, Session.SessionState.RegisterCancelableTask,\n                                           Session.SessionState.UnregisterCancelableTask);\n    activeQueryPanels_ = new List<QueryPanel>();\n    profileFilter_ = new ProfileSampleFilter();\n    historyManager_ = new ProfileHistoryManager(() => {\n      var state = new ProfileFunctionState(TextView.Section, TextView.Function,\n                                           TextView.SectionText, profileFilter_);\n\n      if (funcProfile_ != null) {\n        state.Weight = funcProfile_.Weight;\n      }\n\n      return state;\n    }, () => {\n      UpdateHistoryMenu();\n    });\n\n    viewMenuItems_ = new[] {\n      ViewMenuItem1,\n      ViewMenuItem2,\n      ViewMenuItem3\n    };\n  }\n\n  public string TitlePrefix { get; set; }\n  public string TitleSuffix { get; set; }\n  public string DescriptionPrefix { get; set; }\n  public string DescriptionSuffix { get; set; }\n\n  public double ColumnsListItemHeight {\n    get => columnsListItemHeight_;\n    set {\n      if (Math.Abs(columnsListItemHeight_ - value) > double.Epsilon) {\n        columnsListItemHeight_ = value;\n        NotifyPropertyChanged(nameof(ColumnsListItemHeight));\n      }\n    }\n  }\n\n  public IUISession Session {\n    get => session_;\n    private set => session_ = value;\n  }\n\n  public DocumentSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      ProfileColumns.Settings = value;\n      ProfileColumns.ColumnSettings = value.ColumnSettings;\n      ProfileViewMenu.DataContext = value.ColumnSettings;\n    }\n  }\n\n  public RemarkSettings RemarkSettings {\n    get => remarkSettings_;\n    set {\n      if (!value.Equals(remarkSettings_)) {\n        remarkSettings_ = value.Clone();\n\n        NotifyPropertyChanged(nameof(ShowRemarks));\n        NotifyPropertyChanged(nameof(ShowPreviousSections));\n      }\n    }\n  }\n\n  public bool ShowRemarks {\n    get => remarkSettings_.ShowRemarks;\n    set {\n      if (value != remarkSettings_.ShowRemarks) {\n        remarkSettings_.ShowRemarks = value;\n        NotifyPropertyChanged(nameof(ShowRemarks));\n        HandleRemarkSettingsChange();\n      }\n    }\n  }\n\n  public bool HasRemarks => remarkList_ is {Count: > 0};\n\n  public bool ShowPreviousSections {\n    get => ShowRemarks && remarkSettings_.ShowPreviousSections;\n    set {\n      if (value != remarkSettings_.ShowPreviousSections) {\n        remarkSettings_.ShowPreviousSections = value;\n        NotifyPropertyChanged(nameof(ShowPreviousSections));\n        HandleRemarkSettingsChange();\n      }\n    }\n  }\n\n  public IRTextSection Section => TextView.Section;\n  public FunctionIR Function => TextView.Function;\n\n  public bool PassOutputVisible {\n    get => pasOutputVisible_;\n    set {\n      if (pasOutputVisible_ != value) {\n        if (!pasOutputVisible_) {\n          PassOutput.SwitchSection(Section, TextView);\n        }\n\n        pasOutputVisible_ = value;\n        NotifyPropertyChanged(nameof(PassOutputVisible));\n        PassOutputVisibilityChanged?.Invoke(this, value);\n      }\n    }\n  }\n\n  public bool ColumnsVisible {\n    get => columnsVisible_;\n    set {\n      if (columnsVisible_ != value) {\n        columnsVisible_ = value;\n        NotifyPropertyChanged(nameof(ColumnsVisible));\n      }\n    }\n  }\n\n  public bool ProfileVisible {\n    get => profileVisible_;\n    set {\n      if (profileVisible_ != value) {\n        profileVisible_ = value;\n        NotifyPropertyChanged(nameof(ProfileVisible));\n      }\n    }\n  }\n\n  public bool HasPreviousFunctions => historyManager_.HasPreviousStates;\n  public bool HasNextFunctions => historyManager_.HasNextStates;\n  public bool HasProfileInstanceFilter => profileFilter_ is {HasInstanceFilter: true};\n  public bool HasProfileThreadFilter => profileFilter_ is {HasThreadFilter: true};\n  public RelayCommand<object> CopyDocumentCommand => new(async obj => {\n    await DocumentExporting.CopyAllLinesAsHtml(TextView);\n  });\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void SetupEvents() {\n    PassOutput.ScrollChanged += PassOutput_ScrollChanged;\n    PassOutput.ShowBeforeOutputChanged += PassOutput_ShowBeforeOutputChanged;\n\n    PreviewKeyDown += IRDocumentHost_PreviewKeyDown;\n    TextView.PreviewMouseRightButtonDown += TextView_PreviewMouseRightButtonDown;\n    TextView.MouseDoubleClick += TextViewOnMouseDoubleClick;\n    TextView.PreviewMouseMove += TextView_PreviewMouseMove;\n    TextView.PreviewMouseDown += TextView_PreviewMouseDown;\n    TextView.BlockSelected += TextView_BlockSelected;\n    TextView.ElementSelected += TextView_ElementSelected;\n    TextView.ElementUnselected += TextView_ElementUnselected;\n    TextView.GotKeyboardFocus += TextView_GotKeyboardFocus;\n    TextView.CaretChanged += TextViewOnCaretChanged;\n    TextView.TextArea.TextView.ScrollOffsetChanged += TextViewOnScrollOffsetChanged;\n    TextView.TextArea.SelectionChanged += TextAreaOnSelectionChanged;\n    TextView.TextRegionFolded += TextViewOnTextRegionFolded;\n    TextView.TextRegionUnfolded += TextViewOnTextRegionUnfolded;\n    TextView.FunctionCallOpen += TextViewOnFunctionCallOpen;\n\n    SectionPanel.OpenSection += SectionPanel_OpenSection;\n    SearchPanel.SearchChanged += SearchPanel_SearchChanged;\n    SearchPanel.NavigateToPreviousResult += SearchPanel_NavigateToPreviousResult;\n    SearchPanel.NavigateToNextResult += SearchPanel_NavigateToNextResult;\n    SearchPanel.CloseSearchPanel += SearchPanel_CloseSearchPanel;\n    ProfileColumns.ScrollChanged += ProfileColumns_ScrollChanged;\n    ProfileColumns.RowSelected += ProfileColumn_RowSelected;\n    Unloaded += IRDocumentHost_Unloaded;\n  }\n\n  private async void TextViewOnFunctionCallOpen(object sender, IRTextSection targetSection) {\n    var targetFunc = targetSection.ParentFunction;\n    ProfileSampleFilter targetFilter = null;\n\n    if (profileFilter_ is {IncludesAll: false}) {\n      targetFilter = profileFilter_.CloneForCallTarget(targetFunc);\n    }\n\n    historyManager_.ClearNextStates(); // Reset forward history.\n    var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab :\n      OpenSectionKind.ReplaceCurrent;\n    await Session.OpenProfileFunction(targetFunc, mode,\n                                      targetFilter, this);\n  }\n\n  private void ProfileColumn_RowSelected(object sender, int line) {\n    if (ignoreNextRowSelectedEvent_) {\n      ignoreNextRowSelectedEvent_ = false;\n      return;\n    }\n\n    TextView.SelectLine(line + 1);\n  }\n\n  private void TextViewOnTextRegionUnfolded(object sender, FoldingSection e) {\n    ProfileColumns.HandleTextRegionUnfolded(e);\n  }\n\n  private void TextViewOnTextRegionFolded(object sender, FoldingSection e) {\n    ProfileColumns.HandleTextRegionFolded(e);\n  }\n\n  private void ProfileColumns_ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    if (Math.Abs(e.VerticalChange) < double.Epsilon) {\n      return;\n    }\n\n    TextView.ScrollToVerticalOffset(e.VerticalOffset);\n  }\n\n  public event EventHandler<(double offset, double offsetChangeAmount)> VerticalScrollChanged;\n  public event EventHandler<(double offset, double offsetChangeAmount)> PassOutputVerticalScrollChanged;\n  public event EventHandler<bool> PassOutputShowBeforeChanged;\n  public event EventHandler<bool> PassOutputVisibilityChanged;\n\n  public void NotifyPropertyChanged(string propertyName) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  public async Task UpdateRemarkSettings(RemarkSettings newSettings) {\n    RemarkSettings = newSettings;\n    await HandleNewRemarkSettings(newSettings, false);\n  }\n\n  public async Task ReloadSettings(bool hasProfilingChanges = true) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    await HandleNewRemarkSettings(App.Settings.RemarkSettings, false, true);\n    TextView.Initialize(settings_, session_);\n\n    if (hasProfilingChanges) {\n      await LoadProfile();\n    }\n  }\n\n  public async void UnloadSection(IRTextSection section, bool switchingActiveDocument) {\n    // Cancel any running tasks and hide panels.\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (Section != section) {\n      return;\n    }\n\n    if (!duringSwitchSearchResults_ && !switchingActiveDocument) {\n      HideSearchPanel();\n    }\n\n    await HideRemarkPanel();\n    HideActionPanel();\n    SaveSectionState(section);\n\n    if (!switchingActiveDocument) {\n      if (PassOutputVisible) {\n        await PassOutput.UnloadSection(section, TextView);\n      }\n\n      // Clear references to IR objects that would keep the previous function alive.\n      await RemoveRemarks();\n      hoveredElement_ = null;\n      selectedElement_ = null;\n      remarkElement_ = null;\n      selectedBlock_ = null;\n      profileFilter_ = new ProfileSampleFilter();\n      TitlePrefix = TitleSuffix = null;\n      DescriptionPrefix = DescriptionSuffix = null;\n      PassOutputVisible = false;\n      BlockSelector.SelectedItem = null;\n      BlockSelector.ItemsSource = null;\n    }\n  }\n\n  public void OnSessionSave() {\n    if (Section != null) {\n      SaveSectionState(Section);\n    }\n  }\n\n  public async Task SwitchSearchResultsAsync(SectionSearchResult searchResults, IRTextSection section,\n                                             SearchInfo searchInfo) {\n    // Ensure the right section is being displayed.\n    duringSwitchSearchResults_ = true;\n    var openArgs = new OpenSectionEventArgs(section, OpenSectionKind.ReplaceCurrent, this);\n    await Session.SwitchDocumentSectionAsync(openArgs);\n    duringSwitchSearchResults_ = false;\n\n    // Show the search panel and mark all results on the document.\n    searchResult_ = searchResults;\n    searchInfo.CurrentResult = 1;\n    searchInfo.ResultCount = searchResults.Results.Count;\n    ShowSearchPanel(searchInfo);\n    TextView.MarkSearchResults(searchResults.Results, Colors.Khaki);\n  }\n\n  public bool HasSameSearchResultSection(IRTextSection section) {\n    if (Section != section) {\n      return false;\n    }\n\n    // Force the search panel to be displayed in case it was closed.\n    return searchPanelVisible_;\n  }\n\n  public void JumpToSearchResult(TextSearchResult result, int index) {\n    if (index >= SearchPanel.SearchInfo.ResultCount) {\n      return;\n    }\n\n    SearchPanel.SearchInfo.CurrentResult = index;\n    TextView.JumpToSearchResult(result, Colors.LightSkyBlue);\n  }\n\n  public async Task LoadSectionMinimal(ParsedIRTextSection parsedSection) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    // Save state of currently loaded function for going back.\n    if (TextView.IsLoaded) {\n      historyManager_.SaveCurrentState();\n      TextView.UnloadDocument();\n    }\n\n    TextView.PreloadSection(parsedSection);\n  }\n\n  public async Task LoadSection(ParsedIRTextSection parsedSection) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    duringSectionSwitching_ = true;\n    object data = Session.LoadDocumentState(parsedSection.Section);\n    double horizontalOffset = 0;\n    double verticalOffset = 0;\n\n    if (data != null) {\n      var state = UIStateSerializer.Deserialize<IRDocumentHostState>(data, parsedSection.Function);\n      await TextView.LoadSavedSection(parsedSection, state.DocumentState);\n      horizontalOffset = state.HorizontalOffset;\n      verticalOffset = state.VerticalOffset;\n    }\n    else {\n      await TextView.LoadSection(parsedSection);\n    }\n\n    if (PassOutputVisible) {\n      await PassOutput.SwitchSection(parsedSection.Section, TextView);\n    }\n\n    PopulateBlockSelector();\n    await ReloadRemarks(task);\n\n    // When applying profile, jump to hottest element\n    // only if the vertical offset is 0.\n    bool jumpToHottestElement = verticalOffset < double.Epsilon;\n\n    if (parsedSection.LoadFailed ||\n        !await LoadProfile(true, jumpToHottestElement)) {\n      await HideProfile();\n    }\n\n    if (!jumpToHottestElement) {\n      Dispatcher.BeginInvoke(() => {\n        TextView.ScrollToHorizontalOffset(horizontalOffset);\n        TextView.ScrollToVerticalOffset(verticalOffset);\n      }, DispatcherPriority.Render);\n    }\n\n    duringSectionSwitching_ = false;\n  }\n\n  private void UpdateHistoryMenu() {\n    NotifyPropertyChanged(nameof(HasPreviousFunctions));\n    NotifyPropertyChanged(nameof(HasNextFunctions));\n    DocumentUtils.CreateBackMenu(BackMenu, historyManager_.PreviousFunctions,\n                                 BackMenuItem_OnClick,\n                                 settings_, session_);\n  }\n\n  private async void BackMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    var state = ((MenuItem)sender)?.Tag as ProfileFunctionState;\n\n    if (state != null) {\n      historyManager_.RevertToState(state);\n      await LoadPreviousSectionState(state);\n    }\n  }\n\n  private async Task LoadPreviousSection() {\n    var state = historyManager_.PopPreviousState();\n\n    if (state != null) {\n      await LoadPreviousSectionState(state);\n    }\n  }\n\n  private async Task LoadNextSection() {\n    var state = historyManager_.PopNextState();\n\n    if (state != null) {\n      await LoadPreviousSectionState(state);\n    }\n  }\n\n  private async Task LoadPreviousSectionState(ProfileFunctionState state) {\n    await session_.OpenDocumentSectionAsync(\n      new OpenSectionEventArgs(state.Section, OpenSectionKind.ReplaceCurrent, this));\n\n    if (state.ProfileFilter is {IncludesAll: false}) {\n      await SwitchProfileInstanceAsync(state.ProfileFilter);\n    }\n  }\n\n  //? TODO: Create a new class to do the remark finding/filtering work\n  public bool IsAcceptedRemark(Remark remark, IRTextSection section, RemarkSettings remarkSettings) {\n    if (!remarkSettings.ShowPreviousSections && remark.Section != section) {\n      return false;\n    }\n\n    //? TODO: Move SearchText into a state object\n    if (!string.IsNullOrEmpty(remarkSettings.SearchedText)) {\n      if (!remark.RemarkText.Contains(remarkSettings.SearchedText, StringComparison.OrdinalIgnoreCase)) {\n        return false;\n      }\n    }\n\n    bool kindResult = remark.Kind switch {\n      RemarkKind.Analysis     => remarkSettings.Analysis,\n      RemarkKind.Optimization => remarkSettings.Optimization,\n      RemarkKind.Default      => remarkSettings.Default,\n      RemarkKind.Verbose      => remarkSettings.Verbose,\n      RemarkKind.Trace        => remarkSettings.Trace,\n      _                       => false\n    };\n\n    if (!kindResult) {\n      return false;\n    }\n\n    if (remark.Category.HasTitle && remarkSettings.HasCategoryFilters) {\n      if (remarkSettings.CategoryFilter.TryGetValue(remark.Category.Title, out bool isCategoryEnabled)) {\n        return isCategoryEnabled;\n      }\n    }\n\n    return true;\n  }\n\n  public bool IsAcceptedContextRemark(Remark remark, IRTextSection section, RemarkSettings remarkSettings) {\n    if (!IsAcceptedRemark(remark, section, remarkSettings)) {\n      return false;\n    }\n\n    // Filter based on context, accept any context that is a child of the active context.\n    if (activeRemarkContext_ != null) {\n      return IsActiveContextTreeRemark(remark);\n    }\n\n    return true;\n  }\n\n  public bool IsActiveContextTreeRemark(Remark remark) {\n    var context = remark.Context;\n\n    while (context != null) {\n      if (context == activeRemarkContext_) {\n        Trace.TraceInformation($\"=> Accept remark in context {remark.Context.Name}\");\n        Trace.TraceInformation($\"      text \\\"{remark.RemarkText}\\\"\");\n        return true;\n      }\n\n      context = context.Parent;\n    }\n\n    return false;\n  }\n\n  public async Task EnterDiffMode() {\n    if (Section != null) {\n      SaveSectionState(Section);\n    }\n\n    await HideOptionalPanels();\n    TextView.EnterDiffMode();\n  }\n\n  public async Task ExitDiffMode() {\n    TextView.ExitDiffMode();\n\n    if (PassOutputVisible) {\n      await PassOutput.RestorePassOutput();\n    }\n\n    await HideOptionalPanels();\n  }\n\n  public async Task LoadDiffedFunction(DiffMarkingResult diffResult, IRTextSection newSection) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    await TextView.LoadDiffedFunction(diffResult, newSection);\n\n    if (PassOutputVisible) {\n      await PassOutput.SwitchSection(newSection, TextView);\n    }\n\n    await ReloadRemarks(task);\n  }\n\n  public async Task LoadDiffedPassOutput(DiffMarkingResult diffResult) {\n    if (PassOutputVisible) {\n      await PassOutput.LoadDiffedPassOutput(diffResult);\n    }\n  }\n\n  private void TextViewOnMouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    if (Utils.IsControlModifierActive()) {\n      return;\n    }\n\n    SearchSymbolImpl(Utils.IsShiftModifierActive());\n  }\n\n  private void TextViewOnCaretChanged(object? sender, int offset) {\n    if (columnsVisible_) {\n      ignoreNextRowSelectedEvent_ = true;\n      var line = TextView.Document.GetLineByOffset(offset);\n      ProfileColumns.SelectRow(line.LineNumber - 1);\n    }\n  }\n\n  private void TextViewOnScrollOffsetChanged(object? sender, EventArgs e) {\n    HideActionPanel();\n    DetachRemarkPanel(true);\n\n    double offset = TextView.TextArea.TextView.VerticalOffset;\n    double changeAmount = offset - previousVerticalOffset_;\n    previousVerticalOffset_ = offset;\n\n    // Sync scrolling with the optional columns.\n    SyncColumnsVerticalScrollOffset(offset);\n    VerticalScrollChanged?.Invoke(this, (offset, changeAmount));\n  }\n\n  private void TextAreaOnSelectionChanged(object sender, EventArgs e) {\n    if (funcProfile_ == null) {\n      return;\n    }\n\n    // Compute the weight sum of the selected range of instructions\n    // and display it in the main status bar.\n    int startLine = TextView.TextArea.Selection.StartPosition.Line;\n    int endLine = TextView.TextArea.Selection.EndPosition.Line;\n\n    if (!ProfilingUtils.ComputeAssemblyWeightInRange(startLine, endLine,\n                                                     Function, funcProfile_,\n                                                     out var weightSum, out int count)) {\n      Session.SetApplicationStatus(\"\");\n      return;\n    }\n\n    double weightPercentage = funcProfile_.ScaleWeight(weightSum);\n    string text = $\"Selected {count}: {weightPercentage.AsPercentageString()} ({weightSum.AsMillisecondsString()})\";\n    Session.SetApplicationStatus(text, \"Sum of time for the selected instructions\");\n  }\n\n  private void SyncColumnsVerticalScrollOffset(double offset) {\n    // Sync scrolling with the optional columns.\n    if (columnsVisible_) {\n      ProfileColumns.ScrollToVerticalOffset(offset);\n    }\n  }\n\n  private async void HandleRemarkSettingsChange() {\n    if (!remarkPanelVisible_ && !remarkOptionsPanelVisible_) {\n      await HandleNewRemarkSettings(remarkSettings_, false, true);\n    }\n  }\n\n  private async void IRDocumentHost_Unloaded(object sender, RoutedEventArgs e) {\n    await HideRemarkPanel(true);\n  }\n\n  private async void TextView_PreviewMouseDown(object sender, MouseButtonEventArgs e) {\n    await HideRemarkPanel();\n\n    // Handle the back/forward mouse buttons\n    // to navigate through the function history.\n    if (e.ChangedButton == MouseButton.XButton1) {\n      e.Handled = true;\n      await LoadPreviousSection();\n      return;\n    }\n    else if (e.ChangedButton == MouseButton.XButton2) {\n      e.Handled = true;\n      await LoadNextSection();\n      return;\n    }\n\n    var point = e.GetPosition(TextView.TextArea.TextView);\n    var element = TextView.GetElementAt(point);\n\n    if (element == null) {\n      HideActionPanel(true);\n      return;\n    }\n\n    if (element != hoveredElement_ && !actionPanelHovered_) {\n      await ShowActionPanel(element, true);\n    }\n\n    // Middle-button click sets the input element in the active query panel.\n    if (mainQueryInputValue_ != null && e.MiddleButton == MouseButtonState.Pressed) {\n      mainQueryInputValue_.ForceValueUpdate(element);\n      e.Handled = true;\n    }\n  }\n\n  private async void TextView_PreviewMouseMove(object sender, MouseEventArgs e) {\n    if (!actionPanelVisible_) {\n      return;\n    }\n\n    var point = e.GetPosition(TextView.TextArea.TextView);\n    var element = TextView.GetElementAt(point);\n\n    if (!remarkPanelVisible_ && !actionPanelHovered_ && !actionPanelFromClick_) {\n      if (element == null || element != hoveredElement_) {\n        HideActionPanel();\n        await HideRemarkPanel();\n      }\n    }\n  }\n\n  private async void Hover_MouseHover(object sender, MouseEventArgs e) {\n    if (!remarkSettings_.ShowActionButtonOnHover ||\n        remarkSettings_.ShowActionButtonWithModifier && !Utils.IsKeyboardModifierActive()) {\n      actionPanelHovered_ = false;\n      return;\n    }\n\n    if (remarkPanelVisible_ || actionPanelHovered_) {\n      return;\n    }\n\n    var point = e.GetPosition(TextView.TextArea.TextView);\n\n    if (point.X <= 0 || point.Y <= 0) {\n      // Don't consider the left margin and other elements outside the text view.\n      return;\n    }\n\n    //? TODO: If other panels are opened over the document, don't consider their area.\n    var element = TextView.GetElementAt(point);\n\n    if (element != null) {\n      // If the panel is already showing for this element, ignore the action\n      // so that it doesn't move around after the mouse cursor.\n      if (element != hoveredElement_) {\n        await ShowActionPanel(element);\n        hoveredElement_ = element;\n      }\n    }\n    else {\n      HideActionPanel();\n      hoveredElement_ = null;\n    }\n  }\n\n  private async void TextView_ElementUnselected(object sender, IRElementEventArgs e) {\n    HideActionPanel(true);\n    await HideRemarkPanel();\n  }\n\n  private async void TextView_ElementSelected(object sender, IRElementEventArgs e) {\n    selectedElement_ = e.Element;\n    await ShowActionPanel(e.Element);\n  }\n\n  private IRElement GetRemarkElement(IRElement element) {\n    if (element.GetTag<RemarkTag>() != null) {\n      return element;\n    }\n\n    // If it's an operand, check if the instr. has a remark instead.\n    if (element is OperandIR op) {\n      var instr = op.ParentTuple;\n\n      if (instr.GetTag<RemarkTag>() != null) {\n        return instr;\n      }\n    }\n\n    return null;\n  }\n\n  private async Task ShowActionPanel(IRElement element, bool fromClickEvent = false) {\n    remarkElement_ = GetRemarkElement(element);\n    var visualElement = remarkElement_;\n\n    if (remarkElement_ == null) {\n      await HideRemarkPanel();\n\n      // If there are action buttons in the panel, keep showing it.\n      if (!ActionPanel.HasActionButtons) {\n        HideActionPanel();\n        return;\n      }\n\n      visualElement = element;\n      ActionPanel.ShowRemarksButton = false;\n    }\n    else {\n      ActionPanel.ShowRemarksButton = true;\n    }\n\n    var visualLine = TextView.TextArea.TextView.GetVisualLine(visualElement.TextLocation.Line + 1);\n\n    if (visualLine != null) {\n      // If there is an ongoing hiding operation, cancel it since it would\n      // likely hide the action panel being set up here.\n      if (delayedHideActionPanel_ != null) {\n        delayedHideActionPanel_.Cancel();\n        delayedHideActionPanel_ = null;\n      }\n\n      var linePos = visualLine.GetVisualPosition(0, VisualYPosition.LineBottom);\n      double x = Mouse.GetPosition(this).X + ActionPanelOffset;\n      double y = linePos.Y + DocumentToolbar.ActualHeight -\n                 1 - TextView.TextArea.TextView.ScrollOffset.Y;\n\n      Canvas.SetLeft(ActionPanel, x);\n      Canvas.SetTop(ActionPanel, y);\n      ActionPanel.Opacity = 0.0;\n      ActionPanel.Visibility = Visibility.Visible;\n\n      var animation2 = new DoubleAnimation(ActionPanelInitialOpacity,\n                                           TimeSpan.FromSeconds(fromClickEvent ? 0 : AnimationDuration));\n      ActionPanel.BeginAnimation(OpacityProperty, animation2,\n                                 HandoffBehavior.SnapshotAndReplace);\n\n      actionPanelFromClick_ = fromClickEvent;\n      actionPanelVisible_ = true;\n      remarkPanelLocation_ = new Point(x, y + ActionPanelHeight);\n    }\n  }\n\n  private void HideActionPanel(bool force = false) {\n    // Ignore if panel not visible or in process of being hidden.\n    if (!actionPanelVisible_ || delayedHideActionPanel_ != null) {\n      return;\n    }\n\n    if (force) {\n      HideActionPanelImpl();\n      return;\n    }\n\n    delayedHideActionPanel_ = DelayedAction.StartNew(() => {\n      if (remarkPanelVisible_ || ActionPanel.IsMouseOver) {\n        return;\n      }\n\n      HideActionPanelImpl();\n    });\n  }\n\n  private void HideActionPanelImpl() {\n    var animation = new DoubleAnimation(0.0, TimeSpan.FromSeconds(AnimationDuration));\n    animation.Completed += (s, e) => { ActionPanel.Visibility = Visibility.Collapsed; };\n    ActionPanel.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    actionPanelVisible_ = false;\n    delayedHideActionPanel_ = null;\n  }\n\n  private void ShowRemarkPanel() {\n    if (remarkPanelVisible_ || remarkElement_ == null) {\n      return;\n    }\n\n    remarkPanel_ = new RemarkPreviewPanel();\n    remarkPanel_.PopupClosed += RemarkPanel__PanelClosed;\n    remarkPanel_.PopupDetached += RemarkPanel__PanelDetached;\n    remarkPanel_.RemarkContextChanged += RemarkPanel__RemarkContextChanged;\n    remarkPanel_.RemarkChanged += RemarkPanel__RemarkChanged;\n    remarkPanel_.Opacity = 0.0;\n    remarkPanel_.IsOpen = true;\n\n    var animation = new DoubleAnimation(1.0, TimeSpan.FromSeconds(AnimationDuration));\n    remarkPanel_.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    remarkPanelVisible_ = true;\n\n    InitializeRemarkPanel(remarkElement_);\n  }\n\n  private void RemarkPanel__RemarkChanged(object sender, Remark e) {\n    TextView.SelectDocumentRemark(e);\n  }\n\n  private void RemarkPanel__PanelDetached(object sender, EventArgs e) {\n    // Keep the remark panel floating over the document.\n    DetachRemarkPanel();\n  }\n\n  private void DetachRemarkPanel(bool notifyPanel = false) {\n    if (remarkPanel_ == null) {\n      return;\n    }\n\n    Session.RegisterDetachedPanel(remarkPanel_);\n    HideActionPanel();\n\n    if (notifyPanel) {\n      remarkPanel_.PopupDetached -= RemarkPanel__PanelDetached;\n      remarkPanel_.DetachPanel();\n    }\n\n    remarkPanelVisible_ = false;\n    remarkPanel_ = null;\n  }\n\n  private async void RemarkPanel__PanelClosed(object sender, EventArgs e) {\n    // If it's one of the detached panels, unregister it.\n    var panel = (RemarkPreviewPanel)sender;\n\n    if (panel.IsDetached) {\n      Session.UnregisterDetachedPanel(panel);\n      return;\n    }\n\n    await HideRemarkPanel();\n  }\n\n  private async void RemarkPanel__RemarkContextChanged(object sender, RemarkContextChangedEventArgs e) {\n    activeRemarkContext_ = e.Context;\n\n    if (e.Context != null && e.Remarks != null) {\n      await UpdateDocumentRemarks(e.Remarks);\n    }\n    else {\n      // Filtering of context remarks disabled.\n      await UpdateDocumentRemarks(remarkList_);\n    }\n  }\n\n  private void InitializeRemarkPanel(IRElement element) {\n    remarkPanel_.Session = Session;\n    remarkPanel_.Function = Function;\n    remarkPanel_.Section = Section;\n    remarkPanel_.Initialize(element, remarkPanelLocation_, this, remarkSettings_);\n  }\n\n  private async Task HideRemarkPanel(bool force = false) {\n    if (!remarkPanelVisible_) {\n      return;\n    }\n\n    if (force) {\n      remarkPanel_.IsOpen = false;\n      remarkPanel_ = null;\n      return;\n    }\n\n    await ResetActiveRemarkContext();\n    var animation = new DoubleAnimation(0.0, TimeSpan.FromSeconds(AnimationDuration));\n\n    animation.Completed += (s, e) => {\n      if (remarkPanel_ != null) { // When section unloads, can be before animation completes.\n        remarkPanel_.IsOpen = false;\n        remarkPanel_ = null;\n      }\n    };\n\n    remarkPanel_.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    remarkPanelVisible_ = false;\n  }\n\n  private async Task ResetActiveRemarkContext() {\n    if (activeRemarkContext_ != null) {\n      activeRemarkContext_ = null;\n      await UpdateDocumentRemarks(remarkList_);\n    }\n  }\n\n  private async Task LoadNewSettings(DocumentSettings newSettings, bool force, bool commit) {\n    if (force || !newSettings.Equals(Settings)) {\n      bool hasProfilingChanges = newSettings.HasProfilingChanges(Settings);\n      App.Settings.DocumentSettings = newSettings;\n      Settings = newSettings;\n      await ReloadSettings(hasProfilingChanges);\n    }\n\n    if (commit) {\n      // Apply settings to other open documents in the session.\n      await Session.ReloadDocumentSettings(newSettings, TextView);\n      App.SaveApplicationSettings();\n    }\n  }\n\n  private void TextView_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) {\n    //CloseSectionPanel();\n  }\n\n  private void SearchPanel_CloseSearchPanel(object sender, SearchInfo e) {\n    HideSearchPanel();\n  }\n\n  private void SearchPanel_NavigateToNextResult(object sender, SearchInfo e) {\n    TextView.JumpToSearchResult(searchResult_.Results[e.CurrentResult], Colors.LightSkyBlue);\n  }\n\n  private void SearchPanel_NavigateToPreviousResult(object sender, SearchInfo e) {\n    TextView.JumpToSearchResult(searchResult_.Results[e.CurrentResult], Colors.LightSkyBlue);\n  }\n\n  private async void IRDocumentHost_PreviewKeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Escape) {\n      CloseSectionPanel();\n      HideSearchPanel();\n      e.Handled = true;\n    }\n    else if (e.Key == Key.C && Utils.IsControlModifierActive()) {\n      // Override Ctrl+C to copy instruction details instead of just text,\n      // but not if Shift/Alt key is also pressed, copy plain text then.\n      if (!Utils.IsAltModifierActive() &&\n          !Utils.IsShiftModifierActive() &&\n          !TextView.HandleOverlayKeyPress(e)) { // Send to overlays first.\n        await DocumentExporting.CopySelectedLinesAsHtml(TextView);\n        e.Handled = true;\n      }\n    }\n    else if (e.Key == Key.Back) {\n      if (Utils.IsKeyboardModifierActive()) {\n        await LoadNextSection();\n      }\n      else {\n        await LoadPreviousSection();\n      }\n    }\n    else if (e.Key == Key.H && Utils.IsControlModifierActive()) {\n      JumpToHottestProfiledElement();\n    }\n    else if (e.Key == Key.F2) {\n      if (Utils.IsShiftModifierActive()) {\n        JumpToProfiledElement(1);\n      }\n      else {\n        JumpToProfiledElement(-1);\n      }\n    }\n  }\n\n  private void SectionPanel_ClosePanel(object sender, EventArgs e) {\n    CloseSectionPanel();\n  }\n\n  private async void SectionPanel_OpenSection(object sender, OpenSectionEventArgs e) {\n    SectionPanelHost.Visibility = Visibility.Collapsed;\n    e.TargetDocument = this;\n    await Session.SwitchDocumentSectionAsync(e);\n    TextView.Focus();\n  }\n\n  private void CloseSectionPanel() {\n    if (SectionPanelHost.Visibility == Visibility.Visible) {\n      SectionPanelHost.Visibility = Visibility.Collapsed;\n    }\n  }\n\n  private async Task RemoveRemarks() {\n    if (HasRemarks) {\n      remarkList_ = null;\n      activeRemarkContext_ = null;\n      await UpdateDocumentRemarks(remarkList_);\n    }\n  }\n\n  private void SaveSectionState(IRTextSection section) {\n    // Annotations made in diff mode are not saved right now,\n    // since the text and function IR can be different from the original function.\n    if (TextView.DiffModeEnabled) {\n      return;\n    }\n\n    var state = new IRDocumentHostState();\n    state.DocumentState = TextView.SaveState();\n    state.HorizontalOffset = TextView.HorizontalOffset;\n    state.VerticalOffset = TextView.VerticalOffset;\n    byte[] data = UIStateSerializer.Serialize(state, Function);\n\n    Session.SaveDocumentState(data, section);\n    Session.SetSectionAnnotationState(section, state.HasAnnotations);\n  }\n\n  private async Task<bool> LoadProfile(bool reloadFilterMenus = true,\n                                       bool jumpToHottestElement = true) {\n    if (Session.ProfileData == null) {\n      return false;\n    }\n\n    UpdateProfileFilterUI();\n    var funcProfile = Session.ProfileData.GetFunctionProfile(Section.ParentFunction);\n\n    if (funcProfile == null) {\n      return false;\n    }\n\n    await MarkFunctionProfile(funcProfile);\n\n    if (reloadFilterMenus) {\n      ProfilingUtils.CreateInstancesMenu(InstancesMenu, Section, funcProfile,\n                                         InstanceMenuItem_OnClick,\n                                         InstanceMenuItem_OnRightClick,\n                                         settings_, Session);\n      ProfilingUtils.CreateThreadsMenu(ThreadsMenu, Section, funcProfile,\n                                       ThreadMenuItem_OnClick, settings_, Session);\n    }\n\n    if (jumpToHottestElement &&\n        settings_.ProfileMarkerSettings.JumpToHottestElement) {\n      JumpToHottestProfiledElement();\n    }\n\n    return true;\n  }\n\n  private void InstanceMenuItem_OnRightClick(object sender, MouseButtonEventArgs e) {\n    if (sender is MenuItem menuItem) {\n      if (menuItem.Tag is ProfileCallTreeNode node) {\n        Session.SelectProfileFunctionInPanel(node, ToolPanelKind.FlameGraph);\n        Session.SelectProfileFunctionInPanel(node, ToolPanelKind.CallTree);\n        e.Handled = true;\n      }\n    }\n  }\n\n  private async Task<bool> UpdateProfilingColumns() {\n    var columnData = TextView.ProfileColumnData;\n    ColumnsVisible = columnData is {HasData: true};\n\n    if (columnData == null || !columnData.HasData) {\n      ProfileColumns.Reset();\n      ProfileBlocksMenu.Items.Clear();\n      return false;\n    }\n\n    ResetViewMenuItemEvents();\n    ProfileColumns.Settings = settings_;\n    ProfileColumns.ColumnSettings = settings_.ColumnSettings;\n\n    await ProfileColumns.Display(columnData, TextView);\n    profileMarker_.UpdateColumnStyles(columnData, Function, TextView);\n    ProfileColumns.UpdateColumnWidths();\n\n    ProfileColumns.ColumnSettingsChanged -= OnProfileColumnsOnColumnSettingsChanged;\n    ProfileColumns.ColumnSettingsChanged += OnProfileColumnsOnColumnSettingsChanged;\n\n    // Add the columns to the View menu.\n    ProfileColumns.BuildColumnsVisibilityMenu(columnData, ProfileViewMenu, () => {\n      // UpdateProfilingColumns handles reentrancy by calling ResetViewMenuItemEvents()\n      // synchronously before any await, which unsubscribes the event handlers.\n      _ = UpdateProfilingColumns();\n    });\n\n    SetViewMenuItemEvents();\n    return true;\n  }\n\n  private void SetViewMenuItemEvents() {\n    foreach (var item in viewMenuItems_) {\n      item.Checked += ViewMenuItem_OnCheckedChanged;\n      item.Unchecked += ViewMenuItem_OnCheckedChanged;\n    }\n  }\n\n  private void ResetViewMenuItemEvents() {\n    foreach (var item in viewMenuItems_) {\n      item.Checked -= ViewMenuItem_OnCheckedChanged;\n      item.Unchecked -= ViewMenuItem_OnCheckedChanged;\n    }\n  }\n\n  private async void OnProfileColumnsOnColumnSettingsChanged(object sender, OptionalColumn column) {\n    ProfileDocumentMarker.UpdateColumnStyle(column, TextView.ProfileColumnData, Function, TextView,\n                                            settings_.ProfileMarkerSettings,\n                                            settings_.ColumnSettings);\n  }\n\n  private void CreateProfileBlockMenu(FunctionProfileData funcProfile,\n                                      FunctionProcessingResult result) {\n    profileBlocks_ = result.BlockSampledElements;\n    var list = new List<ProfileMenuItem>(result.BlockSampledElements.Count);\n    double maxWidth = 0;\n\n    ProfileBlocksMenu.Items.Clear();\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings_.ProfileMarkerSettings;\n    int order = 0;\n\n    foreach (var (block, weight) in result.BlockSampledElements) {\n      double weightPercentage = funcProfile.ScaleWeight(weight);\n\n      if (!markerSettings.IsVisibleValue(order++, weightPercentage)) {\n        break;\n      }\n\n      string prefixText = $\"B{block.Number}\";\n      string text = $\"({markerSettings.FormatWeightValue(weight)})\";\n\n      var value = new ProfileMenuItem(text, weight.Ticks, weightPercentage) {\n        Element = block,\n        PrefixText = prefixText,\n        ToolTip = $\"Line {block.TextLocation.Line + 1}\",\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = markerSettings.PickTextWeight(weightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var item = new MenuItem {\n        Header = value,\n        Tag = list.Count,\n        HeaderTemplate = valueTemplate\n      };\n\n      item.Click += (sender, args) => {\n        var menuItem = (MenuItem)sender;\n        JumpToProfiledBlockAt((int)menuItem.Tag);\n      };\n\n      ProfileBlocksMenu.Items.Add(item);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(prefixText, ref maxWidth, ProfileBlocksMenu);\n      list.Add(value);\n    }\n\n    foreach (var value in list) {\n      value.MinTextWidth = maxWidth;\n    }\n  }\n\n  private void CreateProfileElementMenu(FunctionProfileData funcProfile,\n                                        FunctionProcessingResult result) {\n    var list = new List<ProfileMenuItem>(result.SampledElements.Count);\n    ProfileElementsMenu.Items.Clear();\n\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings_.ProfileMarkerSettings;\n    int order = 0;\n    double maxWidth = 0;\n\n    foreach (var (element, weight) in result.SampledElements) {\n      double weightPercentage = funcProfile.ScaleWeight(weight);\n\n      if (!markerSettings.IsVisibleValue(order++, weightPercentage)) {\n        break;\n      }\n\n      string prefixText = DocumentUtils.GenerateElementPreviewText(element, TextView.SectionText, 50);\n      string text = $\"({markerSettings.FormatWeightValue(weight)})\";\n\n      var value = new ProfileMenuItem(text, weight.Ticks, weightPercentage) {\n        Element = element,\n        PrefixText = prefixText,\n        ToolTip = $\"Line {element.TextLocation.Line + 1}\",\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = markerSettings.PickTextWeight(weightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var item = new MenuItem {\n        Header = value,\n        Tag = list.Count,\n        HeaderTemplate = valueTemplate\n      };\n\n      item.Click += (sender, args) => {\n        var menuItem = (MenuItem)sender;\n        JumpToProfiledElementAt((int)menuItem.Tag);\n      };\n\n      ProfileElementsMenu.Items.Add(item);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(prefixText, ref maxWidth, ProfileElementsMenu);\n      list.Add(value);\n    }\n\n    foreach (var value in list) {\n      value.MinTextWidth = maxWidth;\n    }\n  }\n\n  private async Task ApplyProfileFilter() {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (profileFilter_ is {IncludesAll: false}) {\n      await LoadProfileInstance();\n    }\n    else {\n      await LoadProfile(false);\n    }\n\n    // Apply the same filter in the Source File view.\n    await Session.OpenProfileSourceFile(Section.ParentFunction, profileFilter_);\n\n    TitlePrefix = ProfilingUtils.CreateProfileFilterTitle(profileFilter_, session_);\n    DescriptionSuffix = \"\\n\\n\" + ProfilingUtils.CreateProfileFilterDescription(profileFilter_, Session);\n    Session.UpdateDocumentTitles();\n  }\n\n  public async Task SwitchProfileInstanceAsync(ProfileSampleFilter instanceFilter) {\n    profileFilter_ = instanceFilter;\n    ProfilingUtils.SyncInstancesMenuWithFilter(InstancesMenu, instanceFilter);\n    ProfilingUtils.SyncThreadsMenuWithFilter(ThreadsMenu, instanceFilter);\n    await LoadProfileInstance();\n  }\n\n  private async Task LoadProfileInstance() {\n    UpdateProfileFilterUI();\n    var instanceProfile = await ComputeInstanceProfile();\n    var funcProfile = instanceProfile.GetFunctionProfile(Section.ParentFunction);\n\n    if (funcProfile == null) {\n      return;\n    }\n\n    await MarkFunctionProfile(funcProfile);\n  }\n\n  private async Task<ProfileData> ComputeInstanceProfile() {\n    return await LongRunningAction.Start(\n      async () => await Task.Run(() => Session.ProfileData.\n                                   ComputeProfile(Session.ProfileData, profileFilter_, false)),\n      TimeSpan.FromMilliseconds(500),\n      \"Filtering function instance\", this, Session);\n  }\n\n  private void UpdateProfileFilterUI() {\n    NotifyPropertyChanged(nameof(HasProfileInstanceFilter));\n    NotifyPropertyChanged(nameof(HasProfileThreadFilter));\n  }\n\n  private async Task MarkFunctionProfile(FunctionProfileData funcProfile) {\n    // Mark instructions.\n    profileMarker_ = new ProfileDocumentMarker(funcProfile, Session.ProfileData,\n                                               settings_.ProfileMarkerSettings,\n                                               settings_.ColumnSettings, Session.CompilerInfo);\n    await profileMarker_.Mark(TextView, Function, Section.ParentFunction);\n\n    // Redraw the flow graphs, may have loaded before the marker set the node tags.\n    Session.RedrawPanels();\n\n    if (TextView.ProfileProcessingResult != null) {\n      var inlineeList = profileMarker_.GenerateInlineeList(TextView.ProfileProcessingResult);\n      ProfilingUtils.CreateInlineesMenu(InlineesMenu, Section, inlineeList,\n                                        funcProfile, InlineeMenuItem_OnClick, settings_, Session);\n      CreateProfileBlockMenu(funcProfile, TextView.ProfileProcessingResult);\n      CreateProfileElementMenu(funcProfile, TextView.ProfileProcessingResult);\n    }\n\n    UpdateDocumentTitle(funcProfile);\n    profileElements_ = TextView.ProfileProcessingResult?.SampledElements;\n    funcProfile_ = funcProfile;\n    ProfileVisible = true;\n\n    // Show optional columns with timing, counters, etc.\n    // First remove any previous columns.\n    await UpdateProfilingColumns();\n  }\n\n  private void UpdateDocumentTitle(FunctionProfileData funcProfile) {\n    // Update document tooltip.\n    DescriptionPrefix =\n      ProfilingUtils.CreateProfileFunctionDescription(funcProfile, settings_.ProfileMarkerSettings, Session) + \"\\n\\n\";\n    Session.UpdateDocumentTitles();\n  }\n\n  private async Task HideProfile() {\n    ProfileVisible = false;\n    ColumnsVisible = false;\n    ResetProfilingMenus();\n  }\n\n  private void ResetProfilingMenus() {\n    DocumentUtils.RemoveNonDefaultMenuItems(ProfileBlocksMenu);\n    DocumentUtils.RemoveNonDefaultMenuItems(ProfileElementsMenu);\n    DocumentUtils.RemoveNonDefaultMenuItems(InstancesMenu);\n    DocumentUtils.RemoveNonDefaultMenuItems(ThreadsMenu);\n    DocumentUtils.RemoveNonDefaultMenuItems(InlineesMenu);\n  }\n\n  private async Task ReloadRemarks(CancelableTask loadTask) {\n    await RemoveRemarks();\n\n    // Loading remarks can take several seconds for very large functions,\n    // this makes it possible to cancel the work if section switches.\n    var prevRemarkList = remarkList_;\n    remarkList_ = await FindRemarks(loadTask);\n\n    if (loadTask.IsCanceled) {\n      return;\n    }\n\n    if (HasRemarks) {\n      await AddRemarks(remarkList_);\n    }\n    else if (prevRemarkList is {Count: > 0}) {\n      TextView.RemoveRemarks();\n    }\n  }\n\n  private async Task<List<Remark>> FindRemarks(CancelableTask cancelableTask) {\n    var remarkProvider = Session.RemarkProvider;\n\n    return await Task.Run(() => {\n      var sections = remarkProvider.GetSectionList(Section, remarkSettings_.SectionHistoryDepth,\n                                                   remarkSettings_.StopAtSectionBoundaries);\n      var document = Session.SessionState.FindLoadedDocument(Section);\n      var options = new RemarkProviderOptions();\n      var results = remarkProvider.ExtractAllRemarks(sections, Function, document, options, cancelableTask);\n      return results;\n    });\n  }\n\n  private async Task AddRemarks(List<Remark> remarks) {\n    await AddRemarkTags(remarks);\n    await UpdateDocumentRemarks(remarks);\n  }\n\n  private (List<Remark>, List<RemarkLineGroup>) FilterDocumentRemarks(List<Remark> remarks) {\n    // Filter list based on selected options.\n    var filteredList = new List<Remark>(remarks.Count);\n\n    foreach (var remark in remarks) {\n      if (IsAcceptedContextRemark(remark, Section, remarkSettings_)) {\n        filteredList.Add(remark);\n      }\n    }\n\n    // Group remarks by element line number.\n    var markerRemarksGroups = new List<RemarkLineGroup>(remarks.Count);\n\n    if (remarkSettings_.ShowMarginRemarks) {\n      var markerRemarksMap = new Dictionary<int, RemarkLineGroup>(remarks.Count);\n\n      foreach (var remark in filteredList) {\n        if (!remark.Category.AddLeftMarginMark) {\n          continue;\n        }\n\n        if (remark.Section != Section) {\n          // Remark is from previous section. Accept only if user wants\n          // to see previous optimization remarks on the left margin.\n          bool isAccepted = remark.Category.Kind == RemarkKind.Optimization &&\n                            remarkSettings_.ShowPreviousOptimizationRemarks ||\n                            remark.Category.Kind == RemarkKind.Analysis &&\n                            remarkSettings_.ShowPreviousAnalysisRemarks;\n\n          if (!isAccepted) {\n            continue;\n          }\n        }\n\n        bool handled = false;\n        int elementLine = -1;\n\n        foreach (var element in remark.ReferencedElements) {\n          elementLine = element.TextLocation.Line;\n\n          if (markerRemarksMap.TryGetValue(elementLine, out var remarkGroup)) {\n            remarkGroup.Add(remark, Section);\n            handled = true;\n            break;\n          }\n        }\n\n        if (!handled) {\n          var remarkGroup = new RemarkLineGroup(elementLine, remark);\n          markerRemarksMap[elementLine] = remarkGroup;\n          markerRemarksGroups.Add(remarkGroup);\n        }\n      }\n    }\n\n    return (remarkSettings_.ShowDocumentRemarks ? filteredList : null,\n            remarkSettings_.ShowMarginRemarks ? markerRemarksGroups : null);\n  }\n\n  private async Task UpdateDocumentRemarks(List<Remark> remarks) {\n    if (remarks == null || !remarkSettings_.ShowRemarks ||\n        !remarkSettings_.ShowMarginRemarks &&\n        !remarkSettings_.ShowDocumentRemarks) {\n      TextView.RemoveRemarks(); // No remarks or disabled.\n      return;\n    }\n\n    var (allRemarks, markerRemarksGroups) = await Task.Run(() => FilterDocumentRemarks(remarks));\n    TextView.UpdateRemarks(allRemarks, markerRemarksGroups, activeRemarkContext_ != null);\n  }\n\n  private void RemoveRemarkTags() {\n    Function.ForEachElement(element => {\n      element.RemoveTag<RemarkTag>();\n      return true;\n    });\n  }\n\n  private Task AddRemarkTags(List<Remark> remarks) {\n    return Task.Run(() => {\n      RemoveRemarkTags();\n\n      foreach (var remark in remarks) {\n        foreach (var element in remark.ReferencedElements) {\n          var remarkTag = element.GetOrAddTag<RemarkTag>();\n          remarkTag.Remarks.Add(remark);\n        }\n      }\n    });\n  }\n\n  private async Task HideOptionalPanels() {\n    HideSearchPanel();\n    HideActionPanel();\n    await HideRemarkPanel();\n  }\n\n  private void TextView_BlockSelected(object sender, IRElementEventArgs e) {\n    if (e.Element != selectedBlock_) {\n      selectedBlock_ = e.Element;\n      BlockSelector.SelectedItem = e.Element;\n    }\n  }\n\n  private void PopulateBlockSelector() {\n    if (TextView.Blocks != null) {\n      var blockList = new CollectionView(TextView.Blocks);\n      BlockSelector.ItemsSource = blockList;\n    }\n    else {\n      BlockSelector.ItemsSource = null;\n    }\n  }\n\n  private void TextView_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) {\n    hoverPoint_ = e.GetPosition(TextView.TextArea.TextView);\n    TextView.SelectElementAt(hoverPoint_);\n  }\n\n  private void MenuItem_Click(object sender, RoutedEventArgs e) {\n    TextView.ClearMarkedElementAt(hoverPoint_);\n  }\n\n  private void ComboBox_Loaded(object sender, RoutedEventArgs e) {\n    if (sender is ComboBox control) {\n      Utils.PatchComboBoxStyle(control);\n    }\n  }\n\n  private void BlockSelector_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (duringSectionSwitching_ || e.AddedItems.Count != 1) {\n      return;\n    }\n\n    var block = e.AddedItems[0] as BlockIR;\n\n    // If the event triggers during loading the section, while the combobox is update,\n    // ignore it, otherwise it selects the first block.\n    if (block != selectedBlock_ && !TextView.DuringSectionLoading) {\n      selectedBlock_ = block;\n      TextView.GoToBlock(block);\n    }\n  }\n\n  private void NextBlockExecuted(object sender, ExecutedRoutedEventArgs e) {\n    TextView.GoToNextBlock();\n  }\n\n  private void PreviousBlockExecuted(object sender, ExecutedRoutedEventArgs e) {\n    TextView.GoToPreviousBlock();\n  }\n\n  private void FocusBlockSelectorExecuted(object sender, ExecutedRoutedEventArgs e) {\n    BlockSelector.Focus();\n    BlockSelector.IsDropDownOpen = true;\n  }\n\n  private void ToggleSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ShowSearchPanel(true);\n  }\n\n  private void ShowSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ShowSearchPanel(false);\n  }\n\n  private void ShowSearchPanel(bool fromKeyboardShortcut) {\n    // Use selected text as initial search input.\n    var info = new SearchInfo();\n    bool hasInitialText = false;\n\n    if (TextView.SelectionLength > 1) {\n      info.SearchedText = TextView.SelectedText;\n      info.IsCaseInsensitive = true;\n      hasInitialText = true;\n    }\n\n    if (!searchPanelVisible_) {\n      ShowSearchPanel(info);\n    }\n    else if (fromKeyboardShortcut) {\n      // For a subsequent keyboard shortcut press,\n      // don't hide the visible panel, instead either use the new selected text,\n      // or there is no selection, select the entire text in the search panel.\n      SearchPanel.SearchInfo.SearchedText = info.SearchedText;\n      SearchPanel.SearchInfo.IsCaseInsensitive = info.IsCaseInsensitive;\n      SearchPanel.Show(SearchPanel.SearchInfo,\n                       SearchPanel.SearchInfo.SearchAll, !hasInitialText);\n    }\n    else {\n      HideSearchPanel();\n    }\n  }\n\n  private void HideSearchPanel() {\n    if (!searchPanelVisible_) {\n      return;\n    }\n\n    searchPanelVisible_ = false;\n    SearchPanel.Hide();\n    SearchPanel.Reset();\n    SearchPanel.Visibility = Visibility.Collapsed;\n    SearchButton.IsChecked = false;\n  }\n\n  private void ShowSearchPanel(SearchInfo searchInfo, bool searchAll = false) {\n    SearchPanel.Visibility = Visibility.Visible;\n    SearchPanel.Show(searchInfo, searchAll);\n    SearchButton.IsChecked = true;\n    searchPanelVisible_ = true;\n  }\n\n  private void ShowSectionListExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (SectionPanelHost.Visibility == Visibility.Visible) {\n      SectionPanelHost.Visibility = Visibility.Collapsed;\n    }\n    else {\n      SectionPanel.CompilerInfo = Session.CompilerInfo;\n      SectionPanel.Session = Session;\n      SectionPanel.Summary = Session.GetDocumentSummary(Section);\n      SectionPanel.SelectSection(Section, true, true);\n      SectionPanelHost.Visibility = Visibility.Visible;\n      SectionPanelHost.Focus();\n    }\n  }\n\n  private void PreviousSectionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    Session.SwitchToPreviousSection(Section, TextView);\n    TextView.Focus();\n  }\n\n  private void NextSectionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    Session.SwitchToNextSection(Section, TextView);\n    TextView.Focus();\n  }\n\n  private void SearchSymbolExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SearchSymbolImpl(false);\n  }\n\n  private void SearchSymbolAllSectionsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SearchSymbolImpl(true);\n  }\n\n  private void JumpToProfiledElement(IRElement element) {\n    TextView.SetCaretAtElement(element);\n    double offset = TextView.TextArea.TextView.VerticalOffset;\n    SyncColumnsVerticalScrollOffset(offset);\n  }\n\n  private void SearchSymbolImpl(bool searchAllSections) {\n    var element = TextView.GetSelectedElement();\n\n    if (element == null || !element.HasName) {\n      return;\n    }\n\n    string symbolName = element.Name;\n    var searchInfo = new SearchInfo();\n    searchInfo.SearchedText = symbolName;\n    searchInfo.SearchAll = searchAllSections;\n    ShowSearchPanel(searchInfo);\n  }\n\n  private async void SearchPanel_SearchChanged(object sender, SearchInfo info) {\n    string searchedText = info.SearchedText.Trim();\n\n    if (searchedText.Length > 1) {\n      searchResult_ = await Session.SearchSectionAsync(info, Section, TextView);\n\n      if (!searchResult_.HasResults) {\n        // Nothing found in the current document.\n        info.ResultCount = 0;\n        TextView.ClearSearchResults();\n        return;\n      }\n\n      info.ResultCount = searchResult_.Results.Count;\n      TextView.MarkSearchResults(searchResult_.Results, Colors.Khaki);\n\n      if (searchResult_.Results.Count > 0) {\n        TextView.JumpToSearchResult(searchResult_.Results[0], Colors.LightSkyBlue);\n      }\n    }\n    else if (searchedText.Length == 0) {\n      // Reset search panel and markers.\n      if (info.ResultCount > 0) {\n        SearchPanel.Reset();\n      }\n\n      await Session.SearchSectionAsync(info, Section, TextView);\n      TextView.ClearSearchResults();\n      searchResult_ = null;\n    }\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async void PanelToolbarTray_SettingsClicked(object sender, EventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    FrameworkElement relativeElement = ProfileVisible ? ProfileColumns : TextView;\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<DocumentOptionsPanel, DocumentSettings>(\n      Settings.Clone(), relativeElement, Session,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(Settings)) {\n          await LoadNewSettings(newSettings, true, commit);\n        }\n\n        if (commit) {\n          TextView.EnableOverlayEventHandlers();\n        }\n\n        return newSettings.Clone();\n      },\n      () => optionsPanelPopup_ = null);\n  }\n\n  private void ShowRemarkOptionsPanel() {\n    if (remarkOptionsPanelVisible_) {\n      return;\n    }\n\n    // double width = Math.Max(RemarkOptionsPanel.MinimumWidth,\n    //                         Math.Min(TextView.ActualWidth, RemarkOptionsPanel.DefaultWidth));\n    // double height = Math.Max(RemarkOptionsPanel.MinimumHeight,\n    //                          Math.Min(TextView.ActualHeight, RemarkOptionsPanel.DefaultHeight));\n    // var position = new Point(RemarkOptionsPanel.LeftMargin, 0);\n    //\n    // remarkOptionsPanelPopup_ = new OptionsPanelHostPopup(new RemarkOptionsPanel(),\n    //                                                      position, width, height, TextView,\n    //                                                      remarkSettings_.Clone(), Session);\n    // remarkOptionsPanelPopup_.PanelClosed += RemarkOptionsPanel_PanelClosed;\n    // remarkOptionsPanelPopup_.PanelReset += RemarkOptionsPanel_PanelReset;\n    // remarkOptionsPanelPopup_.SettingsChanged += RemarkOptionsPanel_SettingsChanged;\n    // remarkOptionsPanelPopup_.IsOpen = true;\n    remarkOptionsPanelVisible_ = true;\n  }\n\n  private async Task CloseRemarkOptionsPanel() {\n    if (!remarkOptionsPanelVisible_) {\n      return;\n    }\n\n    remarkOptionsPanelPopup_.IsOpen = false;\n    remarkOptionsPanelPopup_.PanelClosed -= RemarkOptionsPanel_PanelClosed;\n    remarkOptionsPanelPopup_.PanelReset -= RemarkOptionsPanel_PanelReset;\n    remarkOptionsPanelPopup_.SettingsChanged -= RemarkOptionsPanel_SettingsChanged;\n\n    var newSettings = (RemarkSettings)remarkOptionsPanelPopup_.Settings;\n    await HandleNewRemarkSettings(newSettings, true);\n\n    remarkOptionsPanelPopup_ = null;\n    remarkOptionsPanelVisible_ = false;\n  }\n\n  private async Task HandleNewRemarkSettings(RemarkSettings newSettings, bool commit, bool force = false) {\n    if (commit) {\n      await Session.ReloadRemarkSettings(newSettings, TextView);\n      App.Settings.RemarkSettings = newSettings;\n      App.SaveApplicationSettings();\n    }\n\n    // Toolbar remark buttons change remarkSettings_ directly,\n    // force an update in this case since newSettings is remarkSettings_.\n    if (force || !newSettings.Equals(remarkSettings_)) {\n      await ApplyRemarkSettings(newSettings);\n    }\n  }\n\n  private async Task ApplyRemarkSettings(RemarkSettings newSettings) {\n    // If only the remark filters changed, don't recompute the list of remarks.\n    bool rebuildRemarkList = remarkList_ == null ||\n                             newSettings.ShowPreviousSections &&\n                             (newSettings.StopAtSectionBoundaries != remarkSettings_.StopAtSectionBoundaries ||\n                              newSettings.SectionHistoryDepth != remarkSettings_.SectionHistoryDepth);\n    App.Settings.RemarkSettings = newSettings;\n    await UpdateRemarkSettings(newSettings);\n\n    if (rebuildRemarkList) {\n      Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Find and load remarks\");\n      await ReloadRemarks(loadTask_.CurrentInstance);\n    }\n    else {\n      Trace.TraceInformation($\"Document {ObjectTracker.Track(this)}: Load remarks\");\n      await UpdateDocumentRemarks(remarkList_);\n    }\n  }\n\n  private async void RemarkOptionsPanel_SettingsChanged(object sender, EventArgs e) {\n    if (remarkOptionsPanelVisible_) {\n      var newSettings = (RemarkSettings)remarkOptionsPanelPopup_.Settings;\n\n      if (newSettings != null) {\n        await HandleNewRemarkSettings(newSettings, false);\n        remarkOptionsPanelPopup_.Settings = remarkSettings_.Clone();\n      }\n    }\n  }\n\n  private async void RemarkOptionsPanel_PanelReset(object sender, EventArgs e) {\n    await HandleNewRemarkSettings(new RemarkSettings(), true);\n    remarkOptionsPanelPopup_.Settings = remarkSettings_.Clone();\n  }\n\n  private async void RemarkOptionsPanel_PanelClosed(object sender, EventArgs e) {\n    await CloseRemarkOptionsPanel();\n  }\n\n  private void PassOutput_ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    PassOutputVerticalScrollChanged?.Invoke(this, (e.VerticalOffset, e.VerticalChange));\n  }\n\n  private void PassOutput_ShowBeforeOutputChanged(object sender, bool e) {\n    PassOutputShowBeforeChanged?.Invoke(this, e);\n  }\n\n  private void ActionPanel_MouseEnter(object sender, MouseEventArgs e) {\n    var animation = new DoubleAnimation(1, TimeSpan.FromSeconds(AnimationDuration));\n    ActionPanel.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    actionPanelHovered_ = true;\n  }\n\n  private void ActionPanel_MouseLeave(object sender, MouseEventArgs e) {\n    actionPanelHovered_ = false;\n  }\n\n  private async void MenuItem_Click_1(object sender, RoutedEventArgs e) {\n    if (remarkOptionsPanelVisible_) {\n      await CloseRemarkOptionsPanel();\n    }\n    else {\n      ShowRemarkOptionsPanel();\n    }\n  }\n\n  // private void QueryMenuItem_SubmenuOpened(object sender, RoutedEventArgs e) {\n  //   var defaultItems = DocumentUtils.SaveDefaultMenuItems(QueryMenuItem);\n  //   QueryMenuItem.Items.Clear();\n  //\n  //   // Append the available queries.\n  //   var queries = Session.CompilerInfo.BuiltinQueries;\n  //\n  //   foreach (var query in queries) {\n  //     var item = new MenuItem {\n  //       Header = query.Name,\n  //       ToolTip = query.Description,\n  //       Tag = query\n  //     };\n  //\n  //     item.Click += QueryMenuItem_Click;\n  //     QueryMenuItem.Items.Add(item);\n  //   }\n  //\n  //   // Add back the default menu items.\n  //   DocumentUtils.RestoreDefaultMenuItems(QueryMenuItem, defaultItems);\n  // }\n\n  private void QueryMenuItem_Click(object sender, RoutedEventArgs e) {\n    var menuItem = (MenuItem)sender;\n    var query = (QueryDefinition)menuItem.Tag;\n    var queryPanel = CreateQueryPanel();\n    queryPanel.AddQuery(query);\n\n    CreateQueryActionButtons(query.Data);\n  }\n\n  private QueryPanel CreateQueryPanel() {\n    var documentHost = this;\n    var position = new Point();\n\n    if (documentHost != null) {\n      double left = documentHost.ActualWidth - QueryPanel.DefaultWidth - 32;\n      double top = documentHost.ActualHeight - QueryPanel.DefaultHeight - 32;\n      position = new Point(left, top);\n    }\n\n    var queryPanel = new QueryPanel(position, QueryPanel.DefaultWidth, QueryPanel.DefaultHeight,\n                                    documentHost, Session);\n    queryPanel.PanelActivated += QueryPanel_PanelActivated;\n    queryPanel.PanelTitle = \"Queries\";\n    queryPanel.ShowAddButton = true;\n    queryPanel.PopupClosed += QueryPanel_Closed;\n    queryPanel.IsOpen = true;\n    queryPanel.StaysOpen = true;\n\n    SwitchActiveQueryPanel(queryPanel);\n    Session.RegisterDetachedPanel(queryPanel);\n    return queryPanel;\n  }\n\n  private void QueryPanel_PanelActivated(object sender, EventArgs e) {\n    // Change action buttons when another query is activated.\n    var panel = (QueryPanel)sender;\n    SwitchActiveQueryPanel(panel);\n  }\n\n  private void SwitchActiveQueryPanel(QueryPanel panel) {\n    if (activeQueryPanels_.Count > 0) {\n      // Deactivate the currently active panel.\n      var currentPanel = activeQueryPanels_[^1];\n\n      if (currentPanel != panel) {\n        currentPanel.IsActivePanel = false;\n        mainQueryInputValue_ = null;\n        SetActiveQueryPanel(panel);\n      }\n    }\n    else {\n      SetActiveQueryPanel(panel);\n    }\n  }\n\n  private void SetActiveQueryPanel(QueryPanel panel) {\n    // Bring to end of list, which is the top of the \"stack\" of panels.\n    activeQueryPanels_.Remove(panel);\n    activeQueryPanels_.Add(panel);\n    panel.IsActivePanel = true;\n\n    if (panel.QueryCount > 0) {\n      // Update the action panel buttons.\n      CreateQueryActionButtons(panel.GetQueryAt(0).Data);\n    }\n  }\n\n  private void QueryPanel_Closed(object sender, EventArgs e) {\n    var queryPanel = (QueryPanel)sender;\n    CloseQueryPanel(queryPanel);\n  }\n\n  private void CloseQueryPanel(QueryPanel queryPanel) {\n    queryPanel.PopupClosed -= QueryPanel_Closed;\n    queryPanel.IsOpen = false;\n    Session.UnregisterDetachedPanel(queryPanel);\n\n    // Update the active query.\n    activeQueryPanels_.Remove(queryPanel);\n\n    if (activeQueryPanels_.Count > 0) {\n      SetActiveQueryPanel(activeQueryPanels_[^1]);\n    }\n    else {\n      RemoveQueryActionButtons();\n    }\n  }\n\n  // private async void TaskMenuItem_SubmenuOpened(object sender, RoutedEventArgs e) {\n  //   var defaultItems = DocumentUtils.SaveDefaultMenuItems(TaskMenuItem);\n  //   TaskMenuItem.Items.Clear();\n  //\n  //   foreach (var action in Session.CompilerInfo.BuiltinFunctionTasks) {\n  //     AddFunctionTaskDefinitionMenuItem(action);\n  //   }\n  //\n  //   // Since first loading the scripts takes 1-2 sec,\n  //   // temporarily add a menu entry to show initially in the menu.\n  //   var item = new MenuItem {\n  //     Header = \"Loading scripts...\",\n  //     IsEnabled = false\n  //   };\n  //\n  //   TaskMenuItem.Items.Add(item);\n  //\n  //   var scriptTasks = await Task.Run(() => Session.CompilerInfo.ScriptFunctionTasks);\n  //\n  //   foreach (var action in scriptTasks) {\n  //     AddFunctionTaskDefinitionMenuItem(action);\n  //   }\n  //\n  //   DocumentUtils.RestoreDefaultMenuItems(TaskMenuItem, defaultItems);\n  //   TaskMenuItem.Items.Remove(item);\n  // }\n\n  // private void AddFunctionTaskDefinitionMenuItem(FunctionTaskDefinition action) {\n  //   var item = new MenuItem {\n  //     Header = action.TaskInfo.Name,\n  //     ToolTip = action.TaskInfo.Description,\n  //     Tag = action\n  //   };\n  //\n  //   item.Click += TaskActionMenuItem_Click;\n  //   TaskMenuItem.Items.Add(item);\n  // }\n\n  private async void TaskActionMenuItem_Click(object sender, RoutedEventArgs e) {\n    var menuItem = (MenuItem)sender;\n    var task = (FunctionTaskDefinition)menuItem.Tag;\n\n    if (!await LoadDocumentTask(task)) {\n      //? TODO: Error handling, message box\n    }\n  }\n\n  private QueryPanel CreateFunctionTaskQueryPanel() {\n    var documentHost = this;\n    var position = new Point();\n\n    if (documentHost != null) {\n      double left = documentHost.ActualWidth - QueryPanel.DefaultWidth - 32;\n      double top = documentHost.ActualHeight - QueryPanel.DefaultHeight - 32;\n      position = documentHost.PointToScreen(new Point(left, top));\n    }\n\n    var queryPanel = new QueryPanel(position, QueryPanel.DefaultWidth, QueryPanel.DefaultHeight, documentHost, Session);\n    Session.RegisterDetachedPanel(queryPanel);\n\n    queryPanel.PanelTitle = \"Function Tasks\";\n    queryPanel.ShowAddButton = false;\n    queryPanel.PopupClosed += FunctionTaskPanel_PopupClosed;\n    queryPanel.IsOpen = true;\n    queryPanel.StaysOpen = true;\n    return queryPanel;\n  }\n\n  private void AddFunctionTaskPanelButtons(QueryPanel queryPanel, IFunctionTask taskInstance, QueryData optionsData) {\n    optionsData.AddButton(\"Execute\", async (sender, value) => {\n      taskInstance.LoadOptionsFromValues(optionsData);\n      taskInstance.SaveOptions();\n      await ExecuteFunctionTask(taskInstance, optionsData, queryPanel);\n    });\n\n    optionsData.AddButton(\"Reset\", (sender, value) => {\n      taskInstance.ResetOptions();\n      taskInstance.SaveOptions();\n\n      // Force a refresh by recreating the query panel.\n      var dummyQuery = queryPanel.GetQueryAt(0);\n      dummyQuery.Data = taskInstance.GetOptionsValues();\n      AddFunctionTaskPanelButtons(queryPanel, taskInstance, dummyQuery.Data);\n    });\n  }\n\n  private async Task ExecuteFunctionTask(IFunctionTask taskInstance, QueryData optionsData, QueryPanel queryPanel) {\n    var cancelableTask = new CancelableTask();\n    optionsData.ResetOutputValues();\n\n    if (!await taskInstance.Execute(Function, TextView, cancelableTask)) {\n      string description = \"\";\n\n      if (taskInstance is ScriptFunctionTask scriptTask) {\n        description = scriptTask.ScriptException != null ?\n          scriptTask.ScriptException.Message : \"\";\n      }\n\n      optionsData.SetOutputWarning(\"Task failed to execute!\", description);\n    }\n    else if (!string.IsNullOrEmpty(taskInstance.ResultMessage)) {\n      if (taskInstance.Result) {\n        optionsData.SetOutputInfo(taskInstance.ResultMessage);\n      }\n      else {\n        optionsData.SetOutputWarning(taskInstance.ResultMessage);\n      }\n    }\n\n    if (!string.IsNullOrEmpty(taskInstance.OutputText)) {\n      optionsData.ReplaceButton(\"View Output\", async (sender, value) => {\n        var view = new NotesPopup(new Point(queryPanel.HorizontalOffset,\n                                            queryPanel.VerticalOffset + queryPanel.Height),\n                                  500, 200, null);\n        view.Session = Session;\n        Session.RegisterDetachedPanel(view);\n        var button = (QueryButton)sender;\n        button.IsEnabled = false;\n\n        view.PanelTitle = \"Function Task Output\";\n        view.IsOpen = true;\n        view.PopupClosed += (sender, value) => {\n          //? TODO: Should save size of panel and use it next time\n          view.IsOpen = false;\n          button.IsEnabled = true;\n          Session.UnregisterDetachedPanel(view);\n        };\n\n        view.DetachPopup();\n        await view.SetText(taskInstance.OutputText, Function, Section, TextView, Session);\n      });\n    }\n  }\n\n  private async Task<bool> LoadDocumentTask(FunctionTaskDefinition task) {\n    var instance = task.CreateInstance(Session);\n\n    if (instance == null) {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show($\"Failed to create function task instance for {task.TaskInfo.Name}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Warning);\n      return false;\n    }\n\n    CreateFunctionTaskOptionsPanel(task, instance);\n    return true;\n  }\n\n  private void CreateFunctionTaskOptionsPanel(FunctionTaskDefinition task, IFunctionTask instance) {\n    QueryData optionsValues;\n\n    if (task.TaskInfo.HasOptionsPanel) {\n      optionsValues = instance.GetOptionsValues();\n    }\n    else {\n      optionsValues = new QueryData();\n    }\n\n    var dummyQuery = new QueryDefinition(typeof(DummyQuery),\n                                         task.TaskInfo.Name, task.TaskInfo.Description);\n    dummyQuery.Data = optionsValues;\n\n    var queryPanel = CreateFunctionTaskQueryPanel();\n    AddFunctionTaskPanelButtons(queryPanel, instance, optionsValues);\n    queryPanel.AddQuery(dummyQuery);\n  }\n\n  private void CreateQueryActionButtons(QueryData optionsValues) {\n    RemoveQueryActionButtons();\n    int actionButtonIndex = 1;\n\n    foreach (var inputValue in optionsValues.InputValues) {\n      if (inputValue.IsElement) {\n        ActionPanel.AddActionButton($\"{actionButtonIndex}\", inputValue);\n\n        if (actionButtonIndex == 1) {\n          // Attach event only once if it's needed.\n          ActionPanel.ActionButtonClicked += ActionPanel_ActionButtonClicked;\n          mainQueryInputValue_ = inputValue;\n        }\n\n        actionButtonIndex++;\n      }\n    }\n  }\n\n  private void RemoveQueryActionButtons() {\n    ActionPanel.ClearActionButtons();\n    mainQueryInputValue_ = null;\n  }\n\n  private void ActionPanel_ActionButtonClicked(object sender, ActionPanelButton e) {\n    var inputValue = (QueryValue)e.Tag;\n\n    if (hoveredElement_ != null) {\n      inputValue.ForceValueUpdate(hoveredElement_);\n    }\n\n    if (selectedElement_ != null) {\n      inputValue.ForceValueUpdate(selectedElement_);\n    }\n  }\n\n  private void FunctionTaskPanel_PopupClosed(object sender, EventArgs e) {\n    var queryPanel = (QueryPanel)sender;\n    queryPanel.PopupClosed -= FunctionTaskPanel_PopupClosed;\n    queryPanel.IsOpen = false;\n    Session.UnregisterDetachedPanel(queryPanel);\n  }\n\n  private async void ActionPanel_RemarksButtonClicked(object sender, EventArgs e) {\n    if (remarkPanelVisible_) {\n      await HideRemarkPanel();\n    }\n    else {\n      ShowRemarkPanel();\n    }\n  }\n\n  private void CloseAllQueryPanelsMenuItem_Click(object sender, RoutedEventArgs e) {\n    while (activeQueryPanels_.Count > 0) {\n      CloseQueryPanel(activeQueryPanels_[0]);\n    }\n  }\n\n  private void ColumnsList_ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    if (duringSectionSwitching_ || Math.Abs(e.VerticalChange) < double.Epsilon) {\n      return;\n    }\n\n    TextView.ScrollToVerticalOffset(e.VerticalOffset);\n  }\n\n  private void JumpToProfiledElementExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToHottestProfiledElement();\n  }\n\n  private void JumpToHottestProfiledElement() {\n    Dispatcher.BeginInvoke(() => {\n      if (!HasProfileElements()) {\n        return;\n      }\n\n      profileElementIndex_ = 0;\n      JumpToProfiledElement(profileElements_[profileElementIndex_].Item1);\n    }, DispatcherPriority.Render);\n  }\n\n  private bool HasProfileElements() {\n    return ProfileVisible && profileElements_ != null && profileElements_.Count > 0;\n  }\n\n  private bool HasProfileElement(int offset) {\n    return ProfileVisible && profileElements_ != null &&\n           profileElementIndex_ + offset >= 0 &&\n           profileElementIndex_ + offset < profileElements_.Count;\n  }\n\n  private bool HasProfiledBlock(int offset) {\n    return ProfileVisible && profileBlocks_ != null &&\n           profileBlockIndex_ + offset >= 0 &&\n           profileBlockIndex_ + offset < profileElements_.Count;\n  }\n\n  private void JumpToNextProfiledElementExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToProfiledElement(-1);\n  }\n\n  private void JumpToProfiledElement(int offset) {\n    if (!HasProfileElement(offset)) {\n      return;\n    }\n\n    profileElementIndex_ += offset;\n    JumpToProfiledElement(profileElements_[profileElementIndex_].Item1);\n  }\n\n  private void JumpToProfiledElementAt(int index) {\n    profileElementIndex_ = index;\n    JumpToProfiledElement(0);\n  }\n\n  private void JumpToProfiledBlock(int offset) {\n    if (!HasProfiledBlock(offset)) {\n      return;\n    }\n\n    profileBlockIndex_ += offset;\n    JumpToProfiledBlock(profileBlocks_[profileBlockIndex_].Item1);\n  }\n\n  private void JumpToProfiledBlockAt(int index) {\n    profileBlockIndex_ = index;\n    JumpToProfiledBlock(0);\n  }\n\n  private void JumpToProfiledBlock(BlockIR block) {\n    TextView.GoToBlock(block);\n  }\n\n  private void JumpToPreviousProfiledElementExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToProfiledElement(1);\n  }\n\n  private void JumpToNextProfiledBlockExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToProfiledBlock(-1);\n  }\n\n  private void JumpToPreviousProfiledBlockExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToProfiledBlock(1);\n  }\n\n  private void JumpToNextProfiledElementCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = HasProfileElement(-1);\n  }\n\n  private void JumpToPreviousProfiledElementCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = HasProfileElement(1);\n  }\n\n  private void JumpToNextProfiledBlockCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = HasProfiledBlock(-1);\n  }\n\n  private void JumpToPreviousProfiledBlockCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = HasProfiledBlock(1);\n  }\n\n  private async void ExportFunctionProfileExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the function failed to load.\n    }\n\n    await DocumentExporting.ExportToExcelFile(TextView, DocumentExporting.ExportFunctionAsExcelFile);\n  }\n\n  private async void ExportFunctionProfileHtmlExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the function failed to load.\n    }\n\n    await DocumentExporting.ExportToHtmlFile(TextView, DocumentExporting.ExportFunctionAsHtmlFile);\n  }\n\n  private async void ExportFunctionProfileMarkdownExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the function failed to load.\n    }\n\n    await DocumentExporting.ExportToMarkdownFile(TextView, DocumentExporting.ExportFunctionAsMarkdownFile);\n  }\n\n  private async void CopySelectedLinesAsHtmlExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the function failed to load.\n    }\n\n    await DocumentExporting.CopySelectedLinesAsHtml(TextView);\n  }\n\n  private void CopySelectedTextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    TextView.Copy();\n  }\n\n  private async void ViewMenuItem_OnCheckedChanged(object sender, RoutedEventArgs e) {\n    await UpdateProfilingColumns();\n  }\n\n  private async void InstanceMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    ProfilingUtils.HandleInstanceMenuItemChanged(sender as MenuItem, InstancesMenu, profileFilter_);\n    await ApplyProfileFilter();\n  }\n\n  private async void ThreadMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    ProfilingUtils.HandleThreadMenuItemChanged(sender as MenuItem, ThreadsMenu, profileFilter_);\n    await ApplyProfileFilter();\n  }\n\n  private async void InlineeMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    var inlinee = ((MenuItem)sender)?.Tag as InlineeListItem;\n\n    if (inlinee != null && inlinee.ElementWeights is {Count: > 0}) {\n      // Sort by weight and bring the hottest element into view.\n      var elements = inlinee.SortedElements;\n      TextView.SetCaretAtElement(elements[0]);\n      TextView.SelectElements(elements);\n    }\n  }\n\n  private async void OpenPopupButton_Click(object sender, RoutedEventArgs e) {\n    if (Section == null) {\n      return; //? TODO: Button should rather be disabled\n    }\n\n    await IRDocumentPopupInstance.ShowPreviewPopup(Section.ParentFunction, \"\",\n                                                   this, Session, profileFilter_);\n  }\n\n  private async void BackButton_Click(object sender, RoutedEventArgs e) {\n    await LoadPreviousSection();\n  }\n\n  private async void NextButton_Click(object sender, RoutedEventArgs e) {\n    await LoadNextSection();\n  }\n\n  private class DummyQuery : IElementQuery {\n    public IUISession Session { get; }\n\n    public bool Initialize(IUISession session) {\n      return true;\n    }\n\n    public bool Execute(QueryData data) {\n      return true;\n    }\n  }\n\n  private async void PanelToolbarTray_OnHelpClicked(object sender, EventArgs e) {\n    await HelpPanel.DisplayPanelHelp(ToolPanelKind.Other, Session);\n  }\n}\n\nclass RemarksButtonState : INotifyPropertyChanged {\n  private RemarkSettings remarkSettings_;\n\n  public RemarksButtonState(RemarkSettings settings) {\n    remarkSettings_ = settings.Clone();\n  }\n\n  public RemarkSettings Settings {\n    get => remarkSettings_;\n    set {\n      if (!value.Equals(remarkSettings_)) {\n        NotifyPropertyChanged(nameof(ShowRemarks));\n        NotifyPropertyChanged(nameof(ShowPreviousSections));\n      }\n\n      remarkSettings_ = value.Clone();\n    }\n  }\n\n  public bool ShowRemarks {\n    get => remarkSettings_.ShowRemarks;\n    set {\n      if (value != remarkSettings_.ShowRemarks) {\n        remarkSettings_.ShowRemarks = value;\n        NotifyPropertyChanged(nameof(ShowRemarks));\n      }\n    }\n  }\n\n  public bool ShowPreviousSections {\n    get => ShowRemarks && remarkSettings_.ShowPreviousSections;\n    set {\n      if (value != remarkSettings_.ShowPreviousSections) {\n        remarkSettings_.ShowPreviousSections = value;\n        NotifyPropertyChanged(nameof(ShowPreviousSections));\n      }\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void NotifyPropertyChanged(string propertyName) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/IRDocumentState.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class IRDocumentState {\n  [ProtoMember(5)]\n  public byte[] Bookmarks;\n  [ProtoMember(7)]\n  public int CaretOffset;\n  [ProtoMember(1)]\n  public ElementHighlighterState HoverHighlighter;\n  [ProtoMember(4)]\n  public DocumentMarginState Margin;\n  [ProtoMember(3)]\n  public ElementHighlighterState MarkedHighlighter;\n  [ProtoMember(6)]\n  public List<IRElementReference> SelectedElements;\n  [ProtoMember(2)]\n  public ElementHighlighterState SelectedHighlighter;\n  [ProtoMember(8)]\n  public ElementOverlayState ElementOverlays;\n  public bool HasAnnotations => MarkedHighlighter.HasAnnotations || Margin.HasAnnotations;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/LightIRDocument.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit;\nusing ICSharpCode.AvalonEdit.Document;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.Utilities;\n\n// TODO: Clicking on scroll bar not working if there is an IR element under it,\n// that one should be ignored if in the scroll bar bounds. GraphPanel does thats\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class LightIRDocument : TextEditor {\n  public enum TextSearchMode {\n    Mark,\n    Filter\n  }\n\n  private ElementHighlighter elementMarker_;\n  private List<IRElement> elements_;\n  private HighlightingStyle elementStyle_;\n  private FunctionIR function_;\n  private ElementHighlighter hoverElementMarker_;\n  private HighlightingStyle hoverElementStyle_;\n  private object lockObject_;\n  private string initialText_;\n  private bool initialTextChanged_;\n  private List<Tuple<int, int>> initialTextLines_;\n  private IRElement prevSelectedElement_;\n  private TextSearchMode searchMode_;\n  private ElementHighlighter searchResultMarker_;\n  private HighlightingStyle searchResultStyle_;\n  private IRTextSection section_;\n  private IRDocument associatedDocument_;\n  private int selectedElementRefIndex_;\n  private List<Reference> selectedElementRefs_;\n  private bool syntaxHighlightingLoaded_;\n  private CancelableTask updateHighlightingTask_;\n  private DiffLineHighlighter diffHighlighter_;\n  private IRDocumentPopupInstance previewPopup_;\n  private IUISession session_;\n\n  public LightIRDocument() {\n    lockObject_ = new object();\n    elements_ = new List<IRElement>();\n    elementStyle_ = new HighlightingStyle(Utils.ColorFromString(\"#FFFCDC\"));\n    hoverElementStyle_ = new HighlightingStyle(Utils.ColorFromString(\"#FFF487\"));\n    searchResultStyle_ = new HighlightingStyle(Colors.Khaki); //? TODO: Customize\n    elementMarker_ = new ElementHighlighter(HighlighingType.Marked);\n    hoverElementMarker_ = new ElementHighlighter(HighlighingType.Marked);\n    searchResultMarker_ = new ElementHighlighter(HighlighingType.Marked);\n    diffHighlighter_ = new DiffLineHighlighter();\n    TextArea.TextView.BackgroundRenderers.Add(diffHighlighter_);\n    TextArea.TextView.BackgroundRenderers.Add(elementMarker_);\n    TextArea.TextView.BackgroundRenderers.Add(searchResultMarker_);\n    TextArea.TextView.BackgroundRenderers.Add(hoverElementMarker_);\n    TextChanged += TextView_TextChanged;\n    PreviewMouseLeftButtonDown += TextView_PreviewMouseLeftButtonDown;\n    MouseLeave += TextView_MouseLeave;\n    PreviewMouseMove += TextView_PreviewMouseMove;\n\n    // Don't use rounded corners for selection rectangles.\n    TextArea.SelectionCornerRadius = 0;\n    TextArea.SelectionBorder = null;\n    Options.EnableEmailHyperlinks = false;\n    Options.EnableHyperlinks = false;\n  }\n\n  public IUISession Session {\n    get => session_;\n    set {\n      session_ = value;\n      SetupPreviewPopup();\n    }\n  }\n\n  public IRTextSection Section => section_;\n  public FunctionIR Function => function_;\n  public IRDocument AssociatedDocument => associatedDocument_;\n\n  public TextSearchMode SearchMode {\n    get => searchMode_;\n    set => searchMode_ = value;\n  }\n\n  public void UnloadDocument() {\n    initialText_ = null;\n    section_ = null;\n    function_ = null;\n    Text = \"\";\n  }\n\n  public async Task SwitchText(string text, FunctionIR function, IRTextSection section,\n                               IRDocument associatedDocument) {\n    function_ = function;\n    section_ = section;\n    associatedDocument_ = associatedDocument;\n    await SwitchText(text);\n  }\n\n  public async Task SwitchText(string text) {\n    Text = text;\n    await SwitchTextImpl(text);\n  }\n\n  public async Task SwitchDocument(TextDocument document, string text) {\n    // Take ownership of the document and replace current text.\n    document.SetOwnerThread(Thread.CurrentThread);\n    Document = document;\n    await SwitchTextImpl(text);\n  }\n\n  public void EnableIRSyntaxHighlighting() {\n    if (!syntaxHighlightingLoaded_) {\n      SyntaxHighlighting = Utils.LoadSyntaxHighlightingFile(App.GetSyntaxHighlightingFilePath());\n      syntaxHighlightingLoaded_ = true;\n    }\n  }\n\n  public void ResetTextSearch() {\n    RestoreInitialText();\n    IsReadOnly = false;\n    UpdateHighlighting();\n  }\n\n  public async Task<List<TextSearchResult>> SearchText(SearchInfo info) {\n    searchResultMarker_.Clear();\n\n    if (!info.HasSearchedText) {\n      ResetTextSearch();\n      return null;\n    }\n\n    if (info.SearchedText.Length < 2) {\n      UpdateHighlighting();\n      return null;\n    }\n\n    // Disable text editing while search is used.\n    IsReadOnly = true;\n\n    if (searchMode_ == TextSearchMode.Filter) {\n      EnsureInitialTextLines();\n      string searchResult = await Task.Run(() => SearchAndFilterTextLines(info));\n      Text = searchResult;\n      initialTextChanged_ = true;\n      await UpdateElementHighlighting();\n      return null;\n    }\n\n    RestoreInitialText();\n\n    var searchResults =\n      await Task.Run(() => TextSearcher.AllIndexesOf(initialText_, info.SearchedText, 0, info.SearchKind));\n\n    HighlightSearchResults(searchResults);\n    return searchResults;\n  }\n\n  public void AddDiffTextSegments(List<DiffTextSegment> segments) {\n    diffHighlighter_.Clear();\n    diffHighlighter_.Add(segments);\n    UpdateHighlighting();\n  }\n\n  public void RemoveDiffTextSegments() {\n    diffHighlighter_.Clear();\n    UpdateHighlighting();\n  }\n\n  internal void JumpToSearchResult(TextSearchResult result) {\n    int line = Document.GetLineByOffset(result.Offset).LineNumber;\n    ScrollToLine(line);\n  }\n\n  private void SetupPreviewPopup() {\n    if (previewPopup_ != null) {\n      previewPopup_.UnregisterHoverEvents();\n      previewPopup_ = null;\n    }\n\n    previewPopup_ =\n      new IRDocumentPopupInstance(App.Settings.GetElementPreviewPopupSettings(ToolPanelKind.Other), Session);\n    previewPopup_.SetupHoverEvents(this, HoverPreview.HoverDuration, () => {\n      if (Session.CurrentDocument == null) {\n        return null;\n      }\n\n      var position = Mouse.GetPosition(TextArea.TextView);\n      var element = DocumentUtils.FindPointedElement(position, this, elements_);\n\n      if (element != null) {\n        var refFinder = new ReferenceFinder(Session.CurrentDocument.Function);\n        var refElement = refFinder.FindEquivalentValue(element);\n\n        if (refElement != null) {\n          // Don't show tooltip when user switches between references.\n          if (selectedElementRefs_ != null && refElement == prevSelectedElement_) {\n            return null;\n          }\n\n          var refElementDef = refFinder.FindSingleDefinition(refElement);\n          var tooltipElement = refElementDef ?? refElement;\n          return PreviewPopupArgs.ForDocument(Session.CurrentDocument, tooltipElement, this,\n                                              $\"Preview\");\n        }\n      }\n\n      return null;\n    });\n  }\n\n  private void TextView_MouseLeave(object sender, MouseEventArgs e) {\n    hoverElementMarker_.Clear();\n    ForceCursor = false;\n    UpdateHighlighting();\n  }\n\n  private void TextView_PreviewMouseMove(object sender, MouseEventArgs e) {\n    var position = e.GetPosition(TextArea.TextView);\n    var element = DocumentUtils.FindPointedElement(position, this, elements_);\n    hoverElementMarker_.Clear();\n\n    if (element != null) {\n      hoverElementMarker_.Add(new HighlightedElementGroup(element, hoverElementStyle_));\n      ForceCursor = true;\n      Cursor = Cursors.Arrow;\n    }\n    else {\n      ForceCursor = false;\n      selectedElementRefs_ = null;\n    }\n\n    UpdateHighlighting();\n  }\n\n  private IRDocument FindTargetDocument() {\n    if (associatedDocument_ != null &&\n        associatedDocument_.Section == section_) {\n      return associatedDocument_;\n    }\n\n    if (Session?.CurrentDocument == null ||\n        Session?.CurrentDocument.Section == section_) {\n      return Session.CurrentDocument;\n    }\n\n    return null;\n  }\n\n  private void TextView_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    previewPopup_?.HidePreviewPopup(true);\n    var position = e.GetPosition(TextArea.TextView);\n\n    // Ignore click outside the text view.\n    if (position.X >= TextArea.TextView.ActualWidth ||\n        position.Y >= TextArea.TextView.ActualHeight) {\n      return;\n    }\n\n    var element = DocumentUtils.FindPointedElement(position, this, elements_);\n\n    if (element != null) {\n      var targetDocument = FindTargetDocument();\n      ReferenceFinder refFinder = null;\n      IRElement refElement = null;\n\n      if (element is InstructionIR instr) {\n        var similarValueFinder = new SimilarValueFinder(function_);\n        refElement = similarValueFinder.Find(instr);\n      }\n      else {\n        refFinder = new ReferenceFinder(function_);\n        refElement = refFinder.FindEquivalentValue(element);\n      }\n\n      if (refElement != null) {\n        if (refFinder == null) {\n          // Highlight an entire instruction.\n          targetDocument.HighlightElement(refElement, HighlighingType.Hovered);\n          selectedElementRefs_ = null;\n          e.Handled = true;\n          return;\n        }\n\n        // Cycle between all references of the operand.\n        if (refElement != prevSelectedElement_) {\n          selectedElementRefs_ = refFinder.FindAllSSAUsesOrReferences(refElement);\n          selectedElementRefIndex_ = 0;\n          prevSelectedElement_ = refElement;\n        }\n\n        if (selectedElementRefs_ == null) {\n          return;\n        }\n\n        if (selectedElementRefIndex_ == selectedElementRefs_.Count) {\n          selectedElementRefIndex_ = 0; // Cycle back to first ref.\n        }\n\n        var currentRefElement = selectedElementRefs_[selectedElementRefIndex_++];\n        targetDocument.HighlightElement(currentRefElement.Element, HighlighingType.Hovered);\n        e.Handled = true;\n        return;\n      }\n    }\n\n    selectedElementRefs_ = null;\n    prevSelectedElement_ = null;\n  }\n\n  private async void TextView_TextChanged(object sender, EventArgs e) {\n    await UpdateElementHighlighting();\n  }\n\n  private async Task SwitchTextImpl(string text) {\n    initialText_ = text;\n    initialTextChanged_ = false;\n    EnableIRSyntaxHighlighting();\n    EnsureInitialTextLines();\n\n    if (function_ != null) {\n      await UpdateElementHighlighting();\n    }\n  }\n\n  private async Task UpdateElementHighlighting() {\n    // If there is another task running, cancel it and wait for it to complete\n    // before starting a new task, this can happen when quickly changing sections.\n    CancelableTask currentUpdateTask = null;\n\n    lock (lockObject_) {\n      if (updateHighlightingTask_ != null) {\n        updateHighlightingTask_.Cancel();\n        currentUpdateTask = updateHighlightingTask_;\n      }\n    }\n\n    if (currentUpdateTask != null) {\n      await currentUpdateTask.WaitToCompleteAsync();\n    }\n\n    elements_.Clear();\n    elementMarker_.Clear();\n    hoverElementMarker_.Clear();\n    searchResultMarker_.Clear();\n    UpdateHighlighting();\n\n    // When unloading a document, no point to start a new task.\n    string currentText = initialTextChanged_ ? Text : initialText_;\n\n    if (string.IsNullOrEmpty(currentText)) {\n      return;\n    }\n\n    var defElements = new HighlightedElementGroup(elementStyle_);\n    updateHighlightingTask_ = new CancelableTask();\n\n    await Task.Run(() => {\n      lock (lockObject_) {\n        if (updateHighlightingTask_.IsCanceled) {\n          // Task got canceled in the meantime.\n          updateHighlightingTask_.Complete();\n          return;\n        }\n\n        if (function_ == null || string.IsNullOrEmpty(currentText)) {\n          // No function set yet or switching sections.\n          return;\n        }\n\n        elements_ = ExtractTextOperands(currentText, function_, updateHighlightingTask_);\n\n        foreach (var element in elements_) {\n          defElements.Add(element);\n        }\n      }\n    });\n\n    elementMarker_.Add(defElements);\n    UpdateHighlighting();\n  }\n\n  private List<IRElement> ExtractTextOperands(string text, FunctionIR function, CancelableTask cancelableTask) {\n    var elements = new List<IRElement>();\n    var remarkProvider = Session.RemarkProvider;\n    var options = new RemarkProviderOptions {\n      FindOperandRemarks = false,\n      IgnoreOverlappingOperandRemarks = true\n    };\n\n    var remarks = remarkProvider.ExtractRemarks(text, function, section_,\n                                                options, cancelableTask);\n\n    if (cancelableTask.IsCanceled) {\n      cancelableTask.Complete();\n      return elements;\n    }\n\n    foreach (var remark in remarks) {\n      foreach (var element in remark.OutputElements) {\n        elements.Add(element);\n      }\n    }\n\n    cancelableTask.Complete();\n    return elements;\n  }\n\n  private void UpdateHighlighting() {\n    TextArea.TextView.Redraw();\n  }\n\n  private void RestoreInitialText() {\n    if (initialTextChanged_) {\n      Text = initialText_;\n      initialTextChanged_ = false;\n    }\n\n    initialTextLines_ = null;\n  }\n\n  private void HighlightSearchResults(List<TextSearchResult> searchResults) {\n    var group = new HighlightedElementGroup(searchResultStyle_);\n\n    foreach (var result in searchResults) {\n      int line = Document.GetLineByOffset(result.Offset).LineNumber;\n      var location = new ProfileExplorer.Core.TextLocation(result.Offset, line, 0);\n      var element = new IRElement(location, result.Length);\n      group.Add(element);\n    }\n\n    if (!group.IsEmpty()) {\n      searchResultMarker_.Add(group);\n      UpdateHighlighting();\n    }\n  }\n\n  private void EnsureInitialTextLines() {\n    if (initialTextLines_ == null) {\n      initialText_ = Text;\n      initialTextLines_ = new List<Tuple<int, int>>(Document.LineCount);\n\n      foreach (var line in Document.Lines) {\n        initialTextLines_.Add(new Tuple<int, int>(line.Offset, line.Length));\n      }\n    }\n  }\n\n  private string SearchAndFilterTextLines(SearchInfo info) {\n    var builder = new StringBuilder();\n    var text = initialText_.AsSpan();\n\n    foreach (var line in initialTextLines_) {\n      string lineText = text.Slice(line.Item1, line.Item2).ToString();\n\n      if (TextSearcher.Contains(lineText, info.SearchedText, info.SearchKind)) {\n        builder.AppendLine(lineText);\n      }\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/RemarkPreviewPanel.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.Document.RemarkPreviewPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:sys=\"clr-namespace:System;assembly=mscorlib\"\n  Width=\"600\"\n  Height=\"200\"\n  MinWidth=\"400\"\n  MinHeight=\"50\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"700\"\n  AllowsTransparency=\"True\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </controls:DraggablePopup.LayoutTransform>\n\n  <controls:DraggablePopup.Resources>\n    <sys:String x:Key=\"ActiveBorderColor\">#00008b</sys:String>\n  </controls:DraggablePopup.Resources>\n  <Border\n    x:Name=\"PanelBorder\"\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <Grid>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"22\" />\n        <RowDefinition Height=\"*\" />\n\n        <RowDefinition>\n          <RowDefinition.Style>\n            <Style TargetType=\"{x:Type RowDefinition}\">\n              <Setter Property=\"Height\" Value=\"Auto\" />\n              <Style.Triggers>\n                <DataTrigger\n                  Binding=\"{Binding ShowPreview}\"\n                  Value=\"True\">\n                  <Setter Property=\"Height\" Value=\"2\" />\n                </DataTrigger>\n                <DataTrigger\n                  Binding=\"{Binding ShowPreview}\"\n                  Value=\"False\">\n                  <Setter Property=\"Height\" Value=\"0\" />\n                </DataTrigger>\n              </Style.Triggers>\n            </Style>\n          </RowDefinition.Style>\n        </RowDefinition>\n\n        <RowDefinition>\n          <RowDefinition.Style>\n            <Style TargetType=\"{x:Type RowDefinition}\">\n              <Setter Property=\"Height\" Value=\"Auto\" />\n              <Style.Triggers>\n                <DataTrigger\n                  Binding=\"{Binding ShowPreview}\"\n                  Value=\"True\">\n                  <Setter Property=\"Height\" Value=\"2*\" />\n                </DataTrigger>\n                <DataTrigger\n                  Binding=\"{Binding ShowPreview}\"\n                  Value=\"False\">\n                  <Setter Property=\"Height\" Value=\"0\" />\n                </DataTrigger>\n              </Style.Triggers>\n            </Style>\n          </RowDefinition.Style>\n        </RowDefinition>\n      </Grid.RowDefinitions>\n\n      <controls:ResizeGrip\n        x:Name=\"PanelResizeGrip\"\n        Grid.Row=\"0\"\n        Grid.RowSpan=\"5\"\n        Width=\"16\"\n        Height=\"16\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Bottom\"\n        Panel.ZIndex=\"100\" />\n\n      <Border\n        Grid.Row=\"0\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        BorderBrush=\"DimGray\"\n        BorderThickness=\"0,0,0,1\">\n        <DockPanel\n          x:Name=\"ToolbarPanel\"\n          Background=\"#FFFFFBCF\"\n          ContextMenu=\"{StaticResource PopupContextMenu}\"\n          LastChildFill=\"False\">\n\n          <StackPanel Orientation=\"Horizontal\">\n            <TextBlock\n              Margin=\"6,0,6,0\"\n              Padding=\"0,0,0,1\"\n              VerticalAlignment=\"Center\"\n              Text=\"Filter\" />\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{Binding Path=HasOptimizationRemarks, Converter={StaticResource BooToParameter}, ConverterParameter={StaticResource ActiveBorderColor}}\"\n              Click=\"Button_Click\"\n              IsChecked=\"{Binding Path=Settings.Optimization}\"\n              ToolTip=\"Show optimization remarks\">\n              <Image\n                Height=\"12\"\n                HorizontalAlignment=\"Center\"\n                VerticalAlignment=\"Center\"\n                IsHitTestVisible=\"False\"\n                Source=\"{StaticResource ZapIcon}\" />\n            </ToggleButton>\n\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{Binding Path=HasAnalysisRemarks, Converter={StaticResource BooToParameter}, ConverterParameter={StaticResource ActiveBorderColor}}\"\n              Click=\"Button_Click\"\n              IsChecked=\"{Binding Path=Settings.Analysis}\"\n              ToolTip=\"Show analysis remarks\">\n              <TextBlock\n                VerticalAlignment=\"Center\"\n                FontSize=\"14\"\n                FontWeight=\"Bold\"\n                IsHitTestVisible=\"False\"\n                Text=\"A\" />\n            </ToggleButton>\n\n            <TextBlock\n              Margin=\"2,0,2,0\"\n              VerticalAlignment=\"Top\"\n              Text=\"|\">\n              <TextBlock.Foreground>\n                <SolidColorBrush Color=\"{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}\" />\n              </TextBlock.Foreground>\n            </TextBlock>\n\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{Binding Path=HasDefaultRemarks, Converter={StaticResource BooToParameter}, ConverterParameter={StaticResource ActiveBorderColor}}\"\n              Click=\"Button_Click\"\n              IsChecked=\"{Binding Path=Settings.Default}\"\n              ToolTip=\"Show default remarks\">\n              <TextBlock\n                Margin=\"0,0,0,1\"\n                VerticalAlignment=\"Center\"\n                FontSize=\"14\"\n                FontWeight=\"Bold\"\n                IsHitTestVisible=\"False\"\n                Text=\"D\" />\n            </ToggleButton>\n\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{Binding Path=HasVerboseRemarks, Converter={StaticResource BooToParameter}, ConverterParameter={StaticResource ActiveBorderColor}}\"\n              Click=\"Button_Click\"\n              IsChecked=\"{Binding Path=Settings.Verbose}\"\n              ToolTip=\"Show verbose remarks\">\n              <TextBlock\n                Margin=\"0,0,0,1\"\n                VerticalAlignment=\"Center\"\n                FontSize=\"14\"\n                FontWeight=\"Bold\"\n                IsHitTestVisible=\"False\"\n                Text=\"V\" />\n            </ToggleButton>\n\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{Binding Path=HasTraceRemarks, Converter={StaticResource BooToParameter}, ConverterParameter={StaticResource ActiveBorderColor}}\"\n              Click=\"Button_Click\"\n              IsChecked=\"{Binding Path=Settings.Trace}\"\n              ToolTip=\"Show trace remarks\">\n              <TextBlock\n                Margin=\"0,0,0,1\"\n                VerticalAlignment=\"Center\"\n                FontSize=\"14\"\n                FontWeight=\"Bold\"\n                IsHitTestVisible=\"False\"\n                Text=\"T\" />\n            </ToggleButton>\n\n            <TextBlock\n              Margin=\"2,0,2,0\"\n              VerticalAlignment=\"Top\"\n              Text=\"|\">\n              <TextBlock.Foreground>\n                <SolidColorBrush Color=\"{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}\" />\n              </TextBlock.Foreground>\n            </TextBlock>\n\n            <ToggleButton\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{x:Null}\"\n              Click=\"Button_Click\"\n              IsChecked=\"{Binding Path=Settings.ShowPreviousSections}\"\n              ToolTip=\"Show remarks from the previous sections\">\n              <TextBlock\n                Margin=\"0,0,0,1\"\n                VerticalAlignment=\"Center\"\n                FontSize=\"14\"\n                FontWeight=\"Bold\"\n                IsHitTestVisible=\"False\"\n                Text=\"P\" />\n            </ToggleButton>\n\n            <TextBlock\n              Margin=\"2,0,2,0\"\n              VerticalAlignment=\"Top\"\n              Text=\"|\">\n              <TextBlock.Foreground>\n                <SolidColorBrush Color=\"{DynamicResource {x:Static SystemColors.ActiveBorderColorKey}}\" />\n              </TextBlock.Foreground>\n            </TextBlock>\n\n            <Button\n              x:Name=\"PopupPanelButton\"\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{x:Null}\"\n              Click=\"PopupPanelButton_Click\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PinIcon}\" />\n            </Button>\n\n            <Button\n              x:Name=\"ColorButton\"\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{x:Null}\"\n              ToolTip=\"Change popup color\"\n              Visibility=\"Collapsed\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource ThemeIcon}\" />\n            </Button>\n          </StackPanel>\n\n          <StackPanel\n            DockPanel.Dock=\"Right\"\n            Orientation=\"Horizontal\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource SearchIcon}\" />\n            <Grid>\n              <TextBox\n                Name=\"RemarkFilterTextbox\"\n                Width=\"150\"\n                Height=\"21\"\n                Margin=\"4,0,0,0\"\n                HorizontalAlignment=\"Right\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                Text=\"{Binding Path=Settings.SearchedText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n                TextChanged=\"TextBox_TextChanged\" />\n              <TextBlock\n                Margin=\"8,0,8,1\"\n                VerticalAlignment=\"Center\"\n                Foreground=\"DimGray\"\n                IsHitTestVisible=\"False\"\n                Text=\"Search remarks\"\n                Visibility=\"{Binding ElementName=RemarkFilterTextbox, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n            </Grid>\n            <Button\n              Width=\"20\"\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{x:Null}\"\n              BorderBrush=\"{x:Null}\"\n              ToolTip=\"Show options panel\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SettingsIcon}\" />\n            </Button>\n            <Button\n              Width=\"20\"\n              Height=\"20\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{x:Null}\"\n              Click=\"ClosePanelButton_Click\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource CloseIcon}\" />\n            </Button>\n          </StackPanel>\n        </DockPanel>\n      </Border>\n\n      <ListView\n        x:Name=\"RemarkList\"\n        Grid.Row=\"1\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n        BorderBrush=\"{x:Null}\"\n        BorderThickness=\"0,0,0,0\"\n        MouseDoubleClick=\"RemarkList_MouseDoubleClick\"\n        ScrollViewer.HorizontalScrollBarVisibility=\"Disabled\"\n        ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n        SelectionChanged=\"RemarkList_SelectionChanged\"\n        VirtualizingPanel.CacheLength=\"2,2\"\n        VirtualizingStackPanel.IsVirtualizing=\"True\"\n        VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n        <ListView.View>\n          <GridView>\n            <GridViewColumn>\n              <GridViewColumn.CellTemplate>\n                <DataTemplate>\n                  <ContentPresenter Content=\"{Binding Text}\" />\n                </DataTemplate>\n              </GridViewColumn.CellTemplate>\n            </GridViewColumn>\n          </GridView>\n        </ListView.View>\n\n        <ListView.Resources>\n          <Style TargetType=\"GridViewColumnHeader\">\n            <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n          </Style>\n        </ListView.Resources>\n        <ListView.ItemContainerStyle>\n          <Style\n            BasedOn=\"{StaticResource FlatListViewItem}\"\n            TargetType=\"{x:Type ListViewItem}\">\n            <Style.Setters>\n              <Setter Property=\"Foreground\" Value=\"Black\" />\n              <Setter Property=\"FontFamily\" Value=\"Consolas\" />\n              <Setter Property=\"FontSize\" Value=\"12\" />\n            </Style.Setters>\n\n            <Style.Triggers>\n              <DataTrigger\n                Binding=\"{Binding Path=HasContext}\"\n                Value=\"True\">\n                <Setter Property=\"Foreground\" Value=\"DarkBlue\" />\n              </DataTrigger>\n\n              <DataTrigger\n                Binding=\"{Binding Path=InCurrentSection}\"\n                Value=\"True\">\n                <Setter Property=\"FontWeight\" Value=\"Bold\" />\n              </DataTrigger>\n\n              <DataTrigger\n                Binding=\"{Binding Path=HasCustomBackground}\"\n                Value=\"True\">\n                <Setter Property=\"Background\" Value=\"{Binding Path=Background}\" />\n              </DataTrigger>\n            </Style.Triggers>\n\n          </Style>\n        </ListView.ItemContainerStyle>\n      </ListView>\n\n      <GridSplitter\n        Grid.Row=\"2\"\n        Height=\"2\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\" />\n\n      <DockPanel\n        Grid.Row=\"3\"\n        LastChildFill=\"True\">\n        <Border\n          Height=\"20\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderBrush=\"DimGray\"\n          BorderThickness=\"0,0,0,1\"\n          DockPanel.Dock=\"Top\">\n          <DockPanel\n            x:Name=\"ContextToolbarPanel\"\n            Background=\"#FFFFFBCF\"\n            LastChildFill=\"True\">\n\n            <StackPanel Orientation=\"Horizontal\">\n              <Label\n                Margin=\"4,0,4,0\"\n                Padding=\"0,0,0,1\"\n                Content=\"Section\" />\n              <Label\n                x:Name=\"SectionLabel\"\n                Margin=\"4,0,4,0\"\n                Padding=\"0,0,0,1\"\n                Content=\"Name\"\n                FontWeight=\"Medium\" />\n            </StackPanel>\n\n            <StackPanel\n              HorizontalAlignment=\"Right\"\n              DockPanel.Dock=\"Right\"\n              Orientation=\"Horizontal\">\n              <Button\n                x:Name=\"ContextParentButton\"\n                Width=\"20\"\n                VerticalAlignment=\"Center\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Click=\"ContextParentButton_Click\"\n                ToolTip=\"Switch to parent remark context\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource GotoDefinitionIcon}\" />\n              </Button>\n              <ToggleButton\n                Width=\"20\"\n                VerticalAlignment=\"Center\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                IsChecked=\"{Binding FilterActiveContextRemarks, Mode=TwoWay}\"\n                ToolTip=\"Show only remarks from selected context in the document\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource EyeIcon}\" />\n              </ToggleButton>\n              <ToggleButton\n                Width=\"20\"\n                VerticalAlignment=\"Center\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                IsChecked=\"{Binding ShowSearchPanel, Mode=TwoWay}\"\n                ToolTip=\"Search remarks\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource SearchIcon}\" />\n              </ToggleButton>\n            </StackPanel>\n          </DockPanel>\n        </Border>\n\n        <TabControl\n          x:Name=\"RemarksTabControl\"\n          Padding=\"0\"\n          SelectionChanged=\"TabControl_SelectionChanged\"\n          TabStripPlacement=\"Bottom\">\n          <TabItem\n            x:Name=\"ContextTreeTabItem\"\n            Header=\"Context Tree\">\n            <DockPanel LastChildFill=\"True\">\n              <local:SearchPanel\n                x:Name=\"ContextSearchPanel\"\n                Height=\"28\"\n                HorizontalAlignment=\"Stretch\"\n                VerticalAlignment=\"Top\"\n                DockPanel.Dock=\"Top\"\n                Opacity=\"1\"\n                Visibility=\"Collapsed\" />\n              <TreeView\n                x:Name=\"RemarkContextTree\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                BorderBrush=\"{x:Null}\"\n                BorderThickness=\"0,0,0,0\"\n                DockPanel.Dock=\"Bottom\"\n                FontFamily=\"Consolas\"\n                ItemContainerStyle=\"{StaticResource RemarkTreeViewItemStyle}\"\n                ScrollViewer.HorizontalScrollBarVisibility=\"Disabled\"\n                ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n                VirtualizingPanel.CacheLengthUnit=\"Pixel\"\n                VirtualizingStackPanel.CacheLength=\"200,300\"\n                VirtualizingStackPanel.IsVirtualizing=\"True\"\n                VirtualizingStackPanel.ScrollUnit=\"Pixel\"\n                VirtualizingStackPanel.VirtualizationMode=\"Recycling\" />\n            </DockPanel>\n          </TabItem>\n\n          <TabItem\n            x:Name=\"OutputTextTabItem\"\n            Header=\"Output Text\">\n            <local:SearcheableIRDocument\n              x:Name=\"RemarkTextView\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n              DockPanel.Dock=\"Bottom\" />\n          </TabItem>\n        </TabControl>\n\n\n      </DockPanel>\n    </Grid>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/Document/RemarkPreviewPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Controls;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic class RemarkEx {\n  private static readonly FontFamily RemarkFont = new(\"Consolas\");\n  public Remark Remark { get; set; }\n  public TextBlock Text => FormatRemarkTextLine(Remark);\n  public Brush Background => GetRemarkBackground(Remark);\n\n  public static SolidColorBrush GetRemarkBackground(Remark remark) {\n    return Utils.EstimateBrightness(remark.Category.MarkColor) < 200 ?\n      ColorBrushes.GetBrush(Utils.ChangeColorLuminisity(remark.Category.MarkColor, 1.75)) :\n      ColorBrushes.GetBrush(Utils.ChangeColorLuminisity(remark.Category.MarkColor, 1.2));\n  }\n\n  public static TextBlock FormatRemarkTextLine(Remark remark, List<RemarkTextHighlighting> highlightingList = null) {\n    int lineOffset = remark.RemarkLocation.Offset;\n    int elementOffset = remark.OutputElements[0].TextLocation.Offset;\n    int elementLength = remark.OutputElements[0].TextLength;\n    int elementLineOffset = elementOffset - lineOffset;\n    int afterElementOffset = elementLineOffset + elementLength;\n\n    string textLine = remark.RemarkLine;\n    var textBlock = new TextBlock();\n    textBlock.FontFamily = RemarkFont;\n    textBlock.FontWeight = FontWeights.Normal;\n    textBlock.Foreground = Brushes.Black;\n\n    if (elementLineOffset > 0) {\n      // Append text found before the IR element.\n      string text = textLine.Substring(0, elementLineOffset);\n      AppendExtraOutputTextRun(text, textBlock, highlightingList);\n    }\n\n    if (elementLength > 0) {\n      // Append the IR element text.\n      string text = textLine.Substring(elementLineOffset, elementLength);\n      textBlock.Inlines.Add(new Run(text) {\n        FontWeight = FontWeights.Bold,\n        Foreground = Brushes.DarkBlue\n      });\n    }\n\n    if (afterElementOffset < textLine.Length) {\n      // Append text following the IR element.\n      string text = textLine.Substring(afterElementOffset, textLine.Length - afterElementOffset);\n      AppendExtraOutputTextRun(text, textBlock, highlightingList);\n    }\n\n    return textBlock;\n  }\n\n  public static TextBlock FormatExtraTextLine(string text, List<RemarkTextHighlighting> highlightingList = null) {\n    var textBlock = new TextBlock();\n    textBlock.FontFamily = RemarkFont;\n    textBlock.Foreground = Brushes.Black;\n    textBlock.FontWeight = FontWeights.Normal;\n    AppendExtraOutputTextRun(text, textBlock, highlightingList);\n    return textBlock;\n  }\n\n  private static void AppendExtraOutputTextRun(string text, TextBlock textBlock,\n                                               List<RemarkTextHighlighting> highlightingList = null) {\n    if (highlightingList == null || highlightingList.Count == 0) {\n      textBlock.Inlines.Add(text);\n      return;\n    }\n\n    int index = 0;\n\n    while (index < text.Length) {\n      // Try to find a highlighting match in the order they are in the list,\n      // as defined by the user in the settings.\n      RemarkTextHighlighting matchingQuery = null;\n      TextSearchResult? matchResult = null;\n\n      foreach (var query in highlightingList) {\n        var result = TextSearcher.FirstIndexOf(text, query.SearchedText, index, query.SearchKind);\n\n        if (result.HasValue) {\n          matchResult = result.Value;\n          matchingQuery = query;\n          break;\n        }\n      }\n\n      if (matchingQuery != null) {\n        if (index < matchResult.Value.Offset) {\n          textBlock.Inlines.Add(text.Substring(index, matchResult.Value.Offset - index));\n        }\n\n        textBlock.Inlines.Add(new Run(text.Substring(matchResult.Value.Offset, matchResult.Value.Length)) {\n          Foreground = matchingQuery.HasTextColor ? ColorBrushes.GetBrush(matchingQuery.TextColor) : Brushes.Black,\n          Background = matchingQuery.HasBackgroundColor ? ColorBrushes.GetBrush(matchingQuery.BackgroundColor) : null,\n          FontStyle = matchingQuery.UseItalicText ? FontStyles.Italic : FontStyles.Normal,\n          FontWeight = matchingQuery.UseBoldText ? FontWeights.Bold : FontWeights.Normal\n        });\n\n        index = matchResult.Value.Offset + matchResult.Value.Length;\n      }\n      else {\n        break;\n      }\n    }\n\n    if (index < text.Length) {\n      // Append any remaining text at the end.\n      textBlock.Inlines.Add(text.Substring(index, text.Length - index));\n    }\n  }\n\n  private string FormatRemarkText() {\n    if (Remark.Kind == RemarkKind.None) {\n      return Remark.RemarkText;\n    }\n\n    return $\"{Remark.Section.Number} | {Remark.RemarkText}\";\n  }\n}\n\npublic class ListRemarkEx : RemarkEx {\n  public ListRemarkEx(Remark remark, string sectionName, bool inCurrentSection) {\n    Remark = remark;\n    InCurrentSection = inCurrentSection;\n    SectionName = sectionName;\n  }\n\n  public bool InCurrentSection { get; set; }\n  public bool HasContext => Remark.Context != null;\n  public string SectionName { get; set; }\n  public bool IsOptimization => Remark.Kind == RemarkKind.Optimization;\n  public bool IsAnalysis => Remark.Kind == RemarkKind.Analysis;\n  public bool HasCustomBackground => Remark.Category.MarkColor != Colors.Black;\n  public string Description => SectionName;\n}\n\npublic class RemarkSettingsEx : BindableObject {\n  private bool hasOptimizationRemarks_;\n  private bool hasAnalysisRemarks_;\n  private bool hasDefaultRemarks_;\n  private bool hasVerboseRemarks_;\n  private bool hasTraceRemarks_;\n\n  public RemarkSettingsEx(RemarkSettings settings) {\n    Settings = settings;\n  }\n\n  public RemarkSettings Settings { get; set; }\n\n  public bool HasOptimizationRemarks {\n    get => hasOptimizationRemarks_;\n    set => SetAndNotify(ref hasOptimizationRemarks_, value);\n  }\n\n  public bool HasAnalysisRemarks {\n    get => hasAnalysisRemarks_;\n    set => SetAndNotify(ref hasAnalysisRemarks_, value);\n  }\n\n  public bool HasDefaultRemarks {\n    get => hasDefaultRemarks_;\n    set => SetAndNotify(ref hasDefaultRemarks_, value);\n  }\n\n  public bool HasVerboseRemarks {\n    get => hasVerboseRemarks_;\n    set => SetAndNotify(ref hasVerboseRemarks_, value);\n  }\n\n  public bool HasTraceRemarks {\n    get => hasTraceRemarks_;\n    set => SetAndNotify(ref hasTraceRemarks_, value);\n  }\n}\n\npublic class RemarkContextChangedEventArgs : EventArgs {\n  public RemarkContextChangedEventArgs(RemarkContext context, List<Remark> remarks) {\n    Context = context;\n    Remarks = remarks;\n  }\n\n  public RemarkContext Context { get; set; }\n  public List<Remark> Remarks { get; set; }\n}\n\npublic partial class RemarkPreviewPanel : DraggablePopup, INotifyPropertyChanged {\n  private const double RemarkListTop = 48;\n  private const double RemarkPreviewWidth = 600;\n  private const double RemarkPreviewHeight = 300;\n  private const double RemarkListItemHeight = 20;\n  private const double MaxRemarkListItems = 10;\n  private const double MinRemarkListItems = 3;\n  private const double ColorButtonLeft = 175;\n  private IRDocumentHost parentDocument_;\n  private RemarkContext activeRemarkContext_;\n  private IRElement element_;\n  private RemarkSettingsEx remarkFilter_;\n  private bool showPreview_;\n  private bool filterActiveContextRemarks_;\n  private Remark selectedRemark_;\n  private bool contextSearchPanelVisible_;\n  private SearchInfo contextSearchInfo_;\n  private List<TreeViewItem> contextSearchResults_;\n\n  public RemarkPreviewPanel() {\n    InitializeComponent();\n    PanelResizeGrip.ResizedControl = this;\n    DataContext = this; // Used for auto-resizing with ShowPreview.\n\n    //? TODO: Add options\n    filterActiveContextRemarks_ = true;\n\n    // Setup search panel for context tree.\n    ContextSearchPanel.UseAutoComplete = false;\n    RemarkTextView.UseAutoComplete = false;\n    ContextSearchPanel.SearchChanged += ContextSearchPanel_SearchChanged;\n    ContextSearchPanel.CloseSearchPanel += ContextSearchPanel_CloseSearchPanel;\n    ContextSearchPanel.NavigateToNextResult += ContextSearchPanel_NavigateToResult;\n    ContextSearchPanel.NavigateToPreviousResult += ContextSearchPanel_NavigateToResult;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public bool ShowPreview {\n    get => showPreview_;\n    set {\n      if (showPreview_ != value) {\n        showPreview_ = value;\n        NotifyPropertyChanged(nameof(ShowPreview));\n        UpdateSize();\n      }\n    }\n  }\n\n  public IRElement Element {\n    get => element_;\n    set {\n      if (element_ == value) {\n        return;\n      }\n\n      element_ = value;\n      UpdateRemarkList();\n    }\n  }\n\n  public bool FilterActiveContextRemarks {\n    get => filterActiveContextRemarks_;\n    set {\n      if (filterActiveContextRemarks_ != value) {\n        if (value && selectedRemark_ != null) {\n          NotifyRemarkContextChanged(selectedRemark_.Context, null); // Recomputes the list.\n        }\n        else {\n          NotifyRemarkContextChanged(null, null); // Disables filtering.\n        }\n\n        filterActiveContextRemarks_ = value;\n      }\n    }\n  }\n\n  public bool ShowSearchPanel {\n    get {\n      if (IsContextTreeVisible()) {\n        return contextSearchPanelVisible_;\n      }\n\n      return RemarkTextView.SearchPanelVisible;\n    }\n    set {\n      if (IsContextTreeVisible()) {\n        if (value != contextSearchPanelVisible_) {\n          contextSearchPanelVisible_ = value;\n          ContextSearchPanel.Visibility = value ? Visibility.Visible : Visibility.Collapsed;\n\n          if (value) {\n            ContextSearchPanel.Show();\n          }\n          else {\n            ContextSearchPanel.Hide();\n          }\n\n          NotifyPropertyChanged(nameof(ShowSearchPanel));\n        }\n      }\n      else {\n        if (value != RemarkTextView.SearchPanelVisible) {\n          RemarkTextView.SearchPanelVisible = value;\n          NotifyPropertyChanged(nameof(ShowSearchPanel));\n        }\n      }\n    }\n  }\n\n  public FunctionIR Function { get; set; }\n  public IRTextSection Section { get; set; }\n\n  public IUISession Session {\n    get => RemarkTextView.Session;\n    set => RemarkTextView.Session = value;\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<RemarkContextChangedEventArgs> RemarkContextChanged;\n  public event EventHandler<Remark> RemarkChanged;\n\n  public void NotifyPropertyChanged(string propertyName) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  public void Initialize(IRElement element, Point position, IRDocumentHost parent,\n                         RemarkSettings filter) {\n    parentDocument_ = parent;\n    filter = filter.Clone();\n    remarkFilter_ = new RemarkSettingsEx(filter);\n    ToolbarPanel.DataContext = remarkFilter_;\n\n    UpdatePosition(position, parent);\n    RemarkList.UnselectAll();\n    SectionLabel.Content = \"\";\n    ShowPreview = false;\n\n    Element = element;\n    UpdateSize();\n  }\n\n  public void DetachPanel() {\n    if (IsDetached) {\n      return;\n    }\n\n    DetachPopup();\n    PopupPanelButton.Visibility = Visibility.Collapsed;\n    ColorButton.Visibility = Visibility.Visible;\n  }\n\n  protected override void SetPanelAccentColor(Color color) {\n    ToolbarPanel.Background = ColorBrushes.GetBrush(color);\n    ContextToolbarPanel.Background = ColorBrushes.GetBrush(color);\n    PanelBorder.BorderBrush = ColorBrushes.GetBrush(color);\n  }\n\n  public override bool ShouldStartDragging(MouseButtonEventArgs e) {\n    base.ShouldStartDragging(e);\n\n    if (e.LeftButton == MouseButtonState.Pressed && ToolbarPanel.IsMouseOver) {\n      DetachPanel();\n      return true;\n    }\n\n    return false;\n  }\n\n  private void UpdateRemarkList() {\n    RemarkList.ItemsSource = null;\n    RemarkContextTree.Items.Clear();\n\n    var remarkTag = element_.GetTag<RemarkTag>();\n\n    if (remarkTag == null) {\n      return;\n    }\n\n    var list = new List<Remark>();\n    var listEx = new List<ListRemarkEx>();\n    ListRemarkEx firstSectionRemark = null;\n\n    foreach (var remark in remarkTag.Remarks) {\n      AccountForRemarkKind(remark);\n\n      if (parentDocument_.IsAcceptedContextRemark(remark, Section, remarkFilter_.Settings)) {\n        var remarkEx = AppendAcceptedRemark(listEx, remark);\n\n        // Find first remark in current section.\n        if (remark.Section == Section && firstSectionRemark == null) {\n          firstSectionRemark = remarkEx;\n        }\n      }\n    }\n\n    RemarkList.ItemsSource = listEx;\n\n    // Scroll down to current section.\n    if (firstSectionRemark != null) {\n      RemarkList.ScrollIntoView(firstSectionRemark);\n    }\n  }\n\n  private (TreeViewItem, int) BuildContextRemarkTreeView(RemarkContext context,\n                                                         Dictionary<RemarkContext, TreeViewItem> treeNodeMap,\n                                                         List<string> outputTextLines) {\n    if (!treeNodeMap.TryGetValue(context, out var treeNode)) {\n      treeNode = new TreeViewItem {\n        Header = context.Name,\n        Foreground = ColorBrushes.GetBrush(Colors.DarkBlue),\n        FontWeight = FontWeights.Bold,\n        ItemContainerStyle = Application.Current.FindResource(\"RemarkTreeViewItemStyle\") as Style\n      };\n\n      treeNodeMap[context] = treeNode;\n    }\n\n    // Combine the remarks and child contexts into one list and sort it by start line.\n    // This then allows adding the non-remark text found between remarks, but not part\n    // part of a child context (they would be added too when processing the child context,\n    // ending up with duplicate text lines).\n    var inputItems = new List<Tuple<object, int, int>>(context.Remarks.Count + context.Children.Count);\n\n    foreach (var remark in context.Remarks) {\n      inputItems.Add(new Tuple<object, int, int>(remark, remark.RemarkLocation.Line,\n                                                 remark.RemarkLocation.Line));\n    }\n\n    foreach (var child in context.Children) {\n      inputItems.Add(new Tuple<object, int, int>(child, child.StartLine, child.EndLine));\n    }\n\n    inputItems.Sort((a, b) => a.Item2 - b.Item2);\n\n    // Append all remarks in the context to the result list.\n    var items = new List<Tuple<TreeViewItem, int>>();\n    var highlightingList = Session.RemarkProvider.RemarkTextHighlighting;\n    Tuple<object, int, int> prevRemark = null;\n\n    foreach (var item in inputItems) {\n      int line = item.Item2; // Start line.\n\n      if (prevRemark != null) {\n        // Add text between consecutive remarks or the end\n        // of a child context and a remark.\n        int prevLine = prevRemark.Item3 + 1; // End line.\n        ExtractOutputTextInRange(prevLine, line, outputTextLines, highlightingList, items);\n      }\n\n      prevRemark = item;\n\n      if (!(item.Item1 is Remark remark)) {\n        continue; // Child context.\n      }\n\n      if (parentDocument_.IsAcceptedRemark(remark, Section, remarkFilter_.Settings)) {\n        var tempTreeNode = new TreeViewItem {\n          Background = RemarkEx.GetRemarkBackground(remark),\n          ItemContainerStyle = Application.Current.FindResource(\"RemarkTreeViewItemStyle\") as Style,\n          ToolTip = remark.RemarkText,\n          Tag = remark\n        };\n\n        tempTreeNode.Header = RemarkEx.FormatRemarkTextLine(remark, highlightingList);\n        tempTreeNode.Selected += TempTreeNode_Selected;\n        items.Add(new Tuple<TreeViewItem, int>(tempTreeNode, remark.RemarkLocation.Line));\n      }\n    }\n\n    // Include text preceding the first remark or child context,\n    // and following the last remark or child context.\n    int firstRegionStart = context.StartLine;\n    int firstRegionEnd = context.Remarks.Count > 0 ? context.Remarks[0].RemarkLocation.Line :\n      context.EndLine;\n\n    if (context.Children.Count > 0) {\n      firstRegionEnd = Math.Min(firstRegionEnd, context.Children[0].StartLine);\n    }\n\n    ExtractOutputTextInRange(firstRegionStart, firstRegionEnd,\n                             outputTextLines, highlightingList, items);\n\n    // Recursively add remarks from the child contexts.\n    foreach (var child in context.Children) {\n      (var childTreeNode, int childFirstLine) =\n        BuildContextRemarkTreeView(child, treeNodeMap, outputTextLines);\n      items.Add(new Tuple<TreeViewItem, int>(childTreeNode, childFirstLine));\n    }\n\n    // Add text found after the last remark in the context.\n    int secondRegionStart = Math.Max(firstRegionEnd, context.Remarks.Count > 0 ?\n                                       context.Remarks[^1].RemarkLocation.Line + 1 :\n                                       context.StartLine);\n    int secondRegionEnd = context.EndLine;\n\n    if (context.Children.Count > 0) {\n      secondRegionStart = Math.Max(secondRegionStart, context.Children[^1].EndLine);\n    }\n\n    ExtractOutputTextInRange(secondRegionStart, secondRegionEnd,\n                             outputTextLines, highlightingList, items);\n\n    // Sort by line number, so that remarks and sub-contexts\n    // appear in the same order as in the output text.\n    items.Sort((a, b) => a.Item2 - b.Item2);\n    Tuple<TreeViewItem, int> prevItem = null;\n\n    foreach (var item in items) {\n      // Ignore multiple remarks on the same line.\n      // If this remark represents an entire instruction and the other one\n      // is one of its operands, pick the instruction remark.\n      //? TODO: Probably the remark provider shouldn't create the operand remarks at all in this case\n      if (prevItem != null && prevItem.Item2 == item.Item2) {\n        if (prevItem.Item1.Tag is Remark prevItemRemark &&\n            item.Item1.Tag is Remark itemRemark) {\n          if (itemRemark.OutputElements[0] is InstructionIR &&\n              !(prevItemRemark.OutputElements[0] is InstructionIR)) {\n            treeNode.Items.Remove(prevItem.Item1);\n            treeNode.Items.Add(item.Item1);\n          }\n        }\n      }\n      else {\n        treeNode.Items.Add(item.Item1);\n      }\n\n      prevItem = item;\n    }\n\n    return (treeNode, context.StartLine);\n  }\n\n  private void TempTreeNode_Selected(object sender, RoutedEventArgs e) {\n    var remark = (RemarkContextTree.SelectedItem as TreeViewItem)?.Tag as Remark;\n\n    if (remark != null) {\n      RemarkChanged?.Invoke(this, remark);\n    }\n  }\n\n  private void ExtractOutputTextInRange(int prevLine, int line, List<string> outputTextLines,\n                                        List<RemarkTextHighlighting> highlightingList,\n                                        List<Tuple<TreeViewItem, int>> items) {\n    for (int k = prevLine; k < line; k++) {\n      string lineText = outputTextLines[k];\n\n      //? TODO: Check could be part of the remark provider (ShouldIgnore...)\n      //? but a cleaner approach should be having a pass output filter interface,\n      //? with Session.GetSectionPassOutputAsync using it, plus a new\n      //? GetRawSectionPassOutputAsync so that the remark prov. gets the metadata lines\n      if (!lineText.StartsWith(\"/// remark:\")) {\n        var lineTreeNode = new TreeViewItem();\n        lineTreeNode.Header = RemarkEx.FormatExtraTextLine(lineText, highlightingList);\n        lineTreeNode.ToolTip = lineText.Trim();\n        items.Add(new Tuple<TreeViewItem, int>(lineTreeNode, k));\n      }\n    }\n  }\n\n  private TextBlock ApplyTextLineSearch(TextBlock textBlock, SearchInfo searchInfo) {\n    List<Inline> newInlines = null;\n\n    foreach (var element in textBlock.Inlines) {\n      if (element is Run run) {\n        var searchResults = TextSearcher.AllIndexesOf(run.Text, searchInfo.SearchedText, 0,\n                                                      searchInfo.SearchKind);\n\n        if (searchResults == null || searchResults.Count == 0) {\n          if (newInlines != null) {\n            // A new text block is being made, append to it.\n            newInlines.Add(element);\n          }\n\n          continue;\n        }\n\n        if (newInlines == null) {\n          // Create a new text block that will have the highlighted searched text.\n          // Copy all elements that were skipped until now.\n          newInlines = new List<Inline>(textBlock.Inlines.Count);\n          var prevElement = textBlock.Inlines.FirstInline;\n\n          while (prevElement != element) {\n            newInlines.Add(prevElement);\n            prevElement = prevElement.NextInline;\n          }\n        }\n\n        int previousOffset = 0;\n\n        foreach (var searchResult in searchResults) {\n          if (searchResult.Offset > previousOffset) {\n            // Append text before the searched text.\n            previousOffset = AppendTextInRange(newInlines, run.Text,\n                                               searchResult.Offset, previousOffset);\n          }\n\n          string searchText = run.Text.Substring(searchResult.Offset, searchResult.Length);\n          previousOffset += searchText.Length;\n\n          newInlines.Add(new Run(searchText) {\n            Background = ColorBrushes.GetBrush(Colors.Khaki) //? TODO: Customize from UI\n          });\n        }\n\n        if (previousOffset < run.Text.Length) {\n          AppendTextInRange(newInlines, run.Text,\n                            run.Text.Length, previousOffset);\n        }\n      }\n      else if (newInlines != null) {\n        // A new text block is being made, append to it.\n        newInlines.Add(element);\n      }\n    }\n\n    if (newInlines != null) {\n      var markedTextBlock = CloneEmptyTextBlock(textBlock);\n      markedTextBlock.Inlines.AddRange(newInlines);\n      return markedTextBlock;\n    }\n\n    return textBlock;\n  }\n\n  private int AppendTextInRange(List<Inline> newInlines, string text, int offset, int previousOffset) {\n    int distance = offset - previousOffset;\n    string rangeText = text.Substring(previousOffset, distance);\n    newInlines.Add(new Run(rangeText));\n    return previousOffset + distance;\n  }\n\n  private TextBlock CloneEmptyTextBlock(TextBlock textBlock) {\n    var copyTextBlock = new TextBlock();\n    copyTextBlock.FontFamily = textBlock.FontFamily;\n    copyTextBlock.Foreground = textBlock.Foreground;\n    copyTextBlock.Background = textBlock.Background;\n    copyTextBlock.FontWeight = textBlock.FontWeight;\n    copyTextBlock.FontSize = textBlock.FontSize;\n    copyTextBlock.FontStyle = textBlock.FontStyle;\n    return copyTextBlock;\n  }\n\n  private void BuildContextRemarkTreeView(RemarkContext rootContext, List<string> outputTextLines) {\n    var treeNodeMap = new Dictionary<RemarkContext, TreeViewItem>();\n    var (rootTreeNode, _) = BuildContextRemarkTreeView(rootContext, treeNodeMap, outputTextLines);\n\n    RemarkContextTree.Items.Clear();\n    RemarkContextTree.Items.Add(rootTreeNode);\n    ExpandAllTreeViewNodes(RemarkContextTree);\n  }\n\n  private Remark CollectContextTreeRemarks(RemarkContext rootContext, List<Remark> list,\n                                           bool filterDuplicates) {\n    Remark firstSectionRemark = null;\n    var worklist = new Queue<RemarkContext>();\n    worklist.Enqueue(rootContext);\n\n    while (worklist.Count > 0) {\n      var context = worklist.Dequeue();\n\n      foreach (var remark in context.Remarks) {\n        if (parentDocument_.IsAcceptedRemark(remark, Section, remarkFilter_.Settings)) {\n          list.Add(remark);\n\n          // Find first remark in current section.\n          if (remark.Section == Section && firstSectionRemark == null) {\n            firstSectionRemark = remark;\n          }\n        }\n      }\n    }\n\n    list.Sort((a, b) => a.RemarkLocation.Line - b.RemarkLocation.Line);\n\n    if (filterDuplicates) {\n      Remark prevItem = null;\n\n      foreach (var item in list) {\n        if (prevItem != null && prevItem.RemarkLocation.Line == item.RemarkLocation.Line) {\n          continue; // Ignore multiple remarks on the same line.\n        }\n\n        prevItem = item;\n      }\n    }\n\n    return firstSectionRemark;\n  }\n\n  private void ExpandAllTreeViewNodes(TreeViewItem rootItem) {\n    foreach (object item in rootItem.Items) {\n      var treeItem = item as TreeViewItem;\n\n      if (treeItem != null) {\n        ExpandAllTreeViewNodes(treeItem);\n        treeItem.IsExpanded = true;\n      }\n    }\n  }\n\n  private void ExpandAllTreeViewNodes(TreeView treeView) {\n    foreach (object item in treeView.Items) {\n      var treeItem = (TreeViewItem)item;\n\n      if (treeItem != null) {\n        ExpandAllTreeViewNodes(treeItem);\n        treeItem.IsExpanded = true;\n      }\n    }\n  }\n\n  private bool SelectTreeViewNode(TreeViewItem rootItem, object tag) {\n    foreach (object item in rootItem.Items) {\n      var treeItem = item as TreeViewItem;\n\n      if (treeItem != null) {\n        if (treeItem.Tag == tag) {\n          SelectTreeViewNode(treeItem);\n          return true;\n        }\n\n        if (SelectTreeViewNode(treeItem, tag)) {\n          return true;\n        }\n      }\n    }\n\n    return false;\n  }\n\n  private void SelectTreeViewNode(TreeViewItem treeItem) {\n    treeItem.IsSelected = true;\n    treeItem.BringIntoView();\n  }\n\n  private void SelectTreeViewNode(TreeView treeView, object tag) {\n    foreach (object item in treeView.Items) {\n      var treeItem = (TreeViewItem)item;\n\n      if (treeItem != null) {\n        if (treeItem.Tag == tag) {\n          treeItem.IsSelected = true;\n          treeItem.BringIntoView();\n          return;\n        }\n\n        if (SelectTreeViewNode(treeItem, tag)) {\n          return;\n        }\n      }\n    }\n  }\n\n  private void ResetContextTreeTextSearch() {\n    contextSearchInfo_ = null;\n    contextSearchResults_ = null;\n  }\n\n  private void ApplyContextTreeTextSearch(TreeView treeView, SearchInfo searchInfo) {\n    if (searchInfo == null || !searchInfo.HasSearchedText ||\n        searchInfo.SearchedText.Length < 2) {\n      return; // Search not enabled.\n    }\n\n    contextSearchInfo_ = searchInfo;\n    contextSearchResults_ = new List<TreeViewItem>();\n\n    foreach (object item in treeView.Items) {\n      var treeItem = (TreeViewItem)item;\n\n      if (treeItem != null) {\n        ApplyContextTreeTextSearch(treeItem);\n      }\n    }\n\n    searchInfo.ResultCount = contextSearchResults_.Count;\n    searchInfo.CurrentResult = 0;\n\n    if (contextSearchResults_.Count > 0) {\n      SelectTreeViewNode(contextSearchResults_[0]);\n    }\n  }\n\n  private void ApplyContextTreeTextSearch(TreeViewItem rootItem) {\n    var textBlock = rootItem.Header as TextBlock;\n\n    if (textBlock != null) {\n      // Change formatting of the line if it contains the searched text.\n      var newTextBlock = ApplyTextLineSearch(textBlock, contextSearchInfo_);\n\n      if (newTextBlock != textBlock) {\n        rootItem.Header = newTextBlock;\n        contextSearchResults_.Add(rootItem);\n      }\n    }\n\n    foreach (object item in rootItem.Items) {\n      var treeItem = item as TreeViewItem;\n\n      if (treeItem != null) {\n        ApplyContextTreeTextSearch(treeItem);\n      }\n    }\n  }\n\n  private ListRemarkEx AppendAcceptedRemark(List<ListRemarkEx> list, Remark remark) {\n    string sectionName = Session.CompilerInfo.NameProvider.GetSectionName(remark.Section);\n    sectionName = $\"({remark.Section.Number}) {sectionName}\";\n    var remarkEx = new ListRemarkEx(remark, sectionName, remark.Section == Section);\n    list.Add(remarkEx);\n    return remarkEx;\n  }\n\n  private void AccountForRemarkKind(Remark remark) {\n    switch (remark.Kind) {\n      case RemarkKind.Optimization: {\n        remarkFilter_.HasOptimizationRemarks = true;\n        break;\n      }\n      case RemarkKind.Analysis: {\n        remarkFilter_.HasAnalysisRemarks = true;\n        break;\n      }\n      case RemarkKind.Default: {\n        remarkFilter_.HasDefaultRemarks = true;\n        break;\n      }\n      case RemarkKind.Verbose: {\n        remarkFilter_.HasVerboseRemarks = true;\n        break;\n      }\n      case RemarkKind.Trace: {\n        remarkFilter_.HasTraceRemarks = true;\n        break;\n      }\n    }\n  }\n\n  private void UpdateSize() {\n    double width = Math.Max(RemarkPreviewWidth, ActualWidth);\n    double height = Math.Max(RemarkListTop + RemarkListItemHeight *\n                             Math.Clamp(RemarkList.Items.Count, MinRemarkListItems, MaxRemarkListItems),\n                             ActualHeight);\n\n    if (ShowPreview) {\n      height += RemarkPreviewHeight;\n    }\n\n    UpdateSize(width, height);\n  }\n\n  private async void RemarkList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (e.AddedItems.Count != 1) {\n      return;\n    }\n\n    var itemEx = e.AddedItems[0] as ListRemarkEx;\n    selectedRemark_ = itemEx.Remark;\n    activeRemarkContext_ = selectedRemark_.Context;\n    SectionLabel.Content = itemEx.Description;\n    ShowPreview = true;\n\n    if (selectedRemark_.Context != null && IsContextTreeVisible()) {\n      // Show context and children.\n      await UpdateContextTree(selectedRemark_, activeRemarkContext_);\n    }\n    else {\n      RemarksTabControl.SelectedItem = OutputTextTabItem;\n      await UpdateOutputText(selectedRemark_);\n    }\n  }\n\n  private async Task UpdateContextTree(Remark remark, RemarkContext context) {\n    // Note that the context can also be a parent of the remarks context.\n    var outputText = await Session.GetSectionOutputTextLinesAsync(remark.Section.OutputBefore,\n                                                                  remark.Section);\n    var list = new List<Remark>();\n    CollectContextTreeRemarks(context, list, true);\n    BuildContextRemarkTreeView(context, outputText);\n    SelectTreeViewNode(RemarkContextTree, remark);\n\n    if (FilterActiveContextRemarks) {\n      NotifyRemarkContextChanged(context, list);\n    }\n  }\n\n  private void NotifyRemarkContextChanged(RemarkContext context, List<Remark> list) {\n    if (list == null && context != null) {\n      list = new List<Remark>();\n      CollectContextTreeRemarks(context, list, true);\n    }\n\n    RemarkContextChanged?.Invoke(this, new RemarkContextChangedEventArgs(context, list));\n  }\n\n  private void Button_Click(object sender, RoutedEventArgs e) {\n    UpdateRemarkList();\n  }\n\n  private void RemarkList_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    var itemEx = RemarkList.SelectedItem as ListRemarkEx;\n\n    if (itemEx != null) {\n      RemarkChanged?.Invoke(this, itemEx.Remark);\n    }\n  }\n\n  private void TextBox_TextChanged(object sender, TextChangedEventArgs e) {\n    UpdateRemarkList();\n  }\n\n  private void PopupPanelButton_Click(object sender, RoutedEventArgs e) {\n    DetachPanel();\n  }\n\n  private void ClosePanelButton_Click(object sender, RoutedEventArgs e) {\n    IsOpen = false;\n  }\n\n  private bool IsOutputTextVisible() {\n    return RemarksTabControl.SelectedItem == OutputTextTabItem;\n  }\n\n  private bool IsContextTreeVisible() {\n    return RemarksTabControl.SelectedItem == ContextTreeTabItem;\n  }\n\n  private async Task UpdateOutputText(Remark remark) {\n    string outputText = await Session.GetSectionOutputTextAsync(remark.Section.OutputBefore,\n                                                                remark.Section);\n    await RemarkTextView.SetText(outputText, Function, Section, parentDocument_.TextView, Session);\n    RemarkTextView.SelectText(remark.RemarkLocation.Offset, remark.RemarkText.Length,\n                              remark.RemarkLocation.Line);\n  }\n\n  private async void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (selectedRemark_ == null) {\n      return;\n    }\n\n    await UpdateRemarkView();\n    NotifyPropertyChanged(nameof(ShowSearchPanel));\n  }\n\n  private async Task UpdateRemarkView() {\n    if (IsOutputTextVisible()) {\n      await UpdateOutputText(selectedRemark_);\n    }\n    else if (IsContextTreeVisible() && activeRemarkContext_ != null) {\n      await UpdateContextTree(selectedRemark_, activeRemarkContext_);\n    }\n  }\n\n  private async void ContextParentButton_Click(object sender, RoutedEventArgs e) {\n    if (activeRemarkContext_ == null ||\n        activeRemarkContext_.Parent == null) {\n      return;\n    }\n\n    activeRemarkContext_ = activeRemarkContext_.Parent;\n    await UpdateContextTree(selectedRemark_, activeRemarkContext_);\n  }\n\n  private async void ContextSearchPanel_CloseSearchPanel(object sender, SearchInfo e) {\n    ShowSearchPanel = false;\n    ResetContextTreeTextSearch();\n    await UpdateRemarkView();\n  }\n\n  private async void ContextSearchPanel_SearchChanged(object sender, SearchInfo e) {\n    await UpdateRemarkView();\n    ApplyContextTreeTextSearch(RemarkContextTree, e);\n  }\n\n  private void ContextSearchPanel_NavigateToResult(object sender, SearchInfo e) {\n    if (contextSearchResults_ == null) {\n      return;\n    }\n\n    SelectTreeViewNode(contextSearchResults_[e.CurrentResult]);\n  }\n\n  //? TODO: ColorButton_Click\n  private class ColorSelectorPopup : Popup {\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/RemarkTag.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class RemarkTag : ITag {\n  public RemarkTag() {\n    Remarks = new List<Remark>();\n  }\n\n  public List<Remark> Remarks { get; }\n  public string Name => \"Remark tag\";\n  public TaggedObject Owner { get; set; }\n\n  public override string ToString() {\n    var builder = new StringBuilder();\n    builder.AppendLine($\"remarks count: {Remarks.Count}\");\n\n    foreach (var remark in Remarks) {\n      builder.Append($\"  o {remark}\".Indent(4));\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/DocumentMargin.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Editing;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Document;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\npublic enum BookmarkSegmentKind {\n  Bookmark,\n  Remark\n}\n\n[ProtoContract]\npublic sealed class BookmarkSegment : IRSegment {\n  public BookmarkSegment() : base(null) { }\n\n  public BookmarkSegment(Bookmark bookmark, BookmarkSegmentKind kind, object tag = null) : base(\n    bookmark.Element) {\n    Bookmark = bookmark;\n    Kind = kind;\n    Tag = tag;\n  }\n\n  [ProtoMember(1)] public Bookmark Bookmark { get; set; }\n  [ProtoMember(2)] public BookmarkSegmentKind Kind { get; set; }\n  public Rect Bounds { get; set; }\n  public Rect PinButtonBounds { get; set; }\n  public Rect RemoveButtonBounds { get; set; }\n  public bool IsHovered { get; set; }\n  public bool IsTextHovered { get; set; }\n  public bool IsNearby { get; set; }\n  public object Tag { get; set; }\n\n  public bool IsSelected {\n    get => Bookmark.IsSelected;\n    set => Bookmark.IsSelected = value;\n  }\n\n  public bool IsPinned {\n    get => Bookmark.IsPinned;\n    set => Bookmark.IsPinned = value;\n  }\n\n  public bool IsExpanded => IsSelected || IsPinned || IsHovered;\n  public bool HasText => !string.IsNullOrWhiteSpace(Bookmark.Text);\n}\n\n[ProtoContract]\npublic class DocumentMarginState {\n  [ProtoMember(1)]\n  public List<ElementGroupState> BlockGroups;\n  [ProtoMember(2)]\n  public List<BookmarkSegment> BookmarkSegments;\n  [ProtoMember(3)]\n  public BookmarkSegment HoveredBookmark;\n  [ProtoMember(4)]\n  public BookmarkSegment SelectedBookmark;\n\n  public DocumentMarginState() {\n    BlockGroups = new List<ElementGroupState>();\n    BookmarkSegments = new List<BookmarkSegment>();\n  }\n\n  public bool HasAnnotations => BlockGroups.Count > 0 || BookmarkSegments.Count > 0;\n}\n\npublic class DocumentMargin : AbstractMargin {\n  private const int NearbyBookmarkDistance = 100;\n  private const int NearbyBookmarkExtraWidth = 16;\n  private const double HoveredPinnedBookmarkOpacity = 0.2;\n  private const int ButtonSectionWidth = 32;\n  private const int ButtonTextPadding = 8;\n  private static readonly int MarginWidth = 16;\n  private static readonly int ButtonWidth = 16;\n  private static readonly int ButtonIconWidth = 12;\n  private static readonly Typeface DefaultFont = new(\"Consolas\");\n  private static readonly HighlightingStyle defaultBookmarkStyle_ =\n    new(Colors.LemonChiffon, ColorPens.GetPen(Colors.Silver));\n  private static readonly HighlightingStyle selectedBookmarkStyle_ =\n    new(Colors.PeachPuff, ColorPens.GetPen(Colors.Black));\n  private static readonly HighlightingStyle pinnedBookmarkStyle_ =\n    new(Colors.PapayaWhip, ColorPens.GetPen(Colors.Black));\n  private static readonly HighlightingStyle pinButtonStyle_ = new(Colors.Silver, ColorPens.GetPen(Colors.Black));\n  private static readonly HighlightingStyle hoverBookmarkStyle_ = new(Colors.LightBlue, ColorPens.GetPen(Colors.Gray));\n  private static readonly HighlightingStyle nearbyBookmarkStyle_ =\n    new(Colors.LightBlue, ColorPens.GetPen(Colors.Silver));\n  private SolidColorBrush backgroundBrush_;\n  private HashSet<IRElement> blockElements_;\n  private List<HighlightedSegmentGroup> blockGroups_;\n  private IconDrawing bookmarkIcon_;\n  private TextSegmentCollection<BookmarkSegment> bookmarkSegments_;\n  private BookmarkSegment hoveredBookmark_;\n  private HashSet<BookmarkSegment> nearbyBookmarks_;\n  private IconDrawing pinIcon_;\n  private List<IconDrawing> remarkIcons_;\n  private IconDrawing removeIcon_;\n  private BookmarkSegment selectedBookmark_;\n\n  public DocumentMargin(Color backgroundColor) {\n    BackgroundColor = backgroundColor;\n    blockGroups_ = new List<HighlightedSegmentGroup>();\n    blockElements_ = new HashSet<IRElement>();\n    bookmarkSegments_ = new TextSegmentCollection<BookmarkSegment>();\n    nearbyBookmarks_ = new HashSet<BookmarkSegment>();\n    bookmarkIcon_ = IconDrawing.FromIconResource(\"MarkerIcon\");\n    removeIcon_ = IconDrawing.FromIconResource(\"RemoveIcon\");\n    pinIcon_ = IconDrawing.FromIconResource(\"PinIcon\");\n    remarkIcons_ = new List<IconDrawing>();\n    remarkIcons_.Add(IconDrawing.FromIconResource(\"DotIcon\"));\n    remarkIcons_.Add(IconDrawing.FromIconResource(\"ZapIcon\"));\n    remarkIcons_.Add(IconDrawing.FromIconResource(\"StarIcon\"));\n    remarkIcons_.Add(IconDrawing.FromIconResource(\"TagIcon\"));\n    remarkIcons_.Add(IconDrawing.FromIconResource(\"WarningIcon\"));\n    Version = 1;\n  }\n\n  public int Version { get; set; }\n  public bool DisableBlockRemoval { get; set; }\n  public Bookmark SelectedBookmark => selectedBookmark_?.Bookmark;\n  public List<HighlightedSegmentGroup> BlockGroups => blockGroups_;\n\n  public Color BackgroundColor {\n    get => backgroundBrush_.Color;\n    set {\n      backgroundBrush_ = ColorBrushes.GetBrush(value);\n      InvalidateVisual();\n    }\n  }\n\n  public event EventHandler<Bookmark> BookmarkRemoved;\n  public event EventHandler<Bookmark> BookmarkChanged;\n\n  public DocumentMarginState SaveState() {\n    var marginState = new DocumentMarginState();\n    marginState.BlockGroups = UIStateSerializer.SaveElementGroupState(blockGroups_);\n    marginState.BookmarkSegments = bookmarkSegments_.ToList();\n    marginState.HoveredBookmark = hoveredBookmark_;\n    marginState.SelectedBookmark = selectedBookmark_;\n    return marginState;\n  }\n\n  public void LoadState(DocumentMarginState state) {\n    if (state == null) {\n      return; // Most likely a file from an older version of the app.\n    }\n\n    blockGroups_ = UIStateSerializer.LoadElementGroupState(state.BlockGroups);\n    hoveredBookmark_ = state.HoveredBookmark;\n    selectedBookmark_ = state.SelectedBookmark;\n    bookmarkSegments_ = new TextSegmentCollection<BookmarkSegment>();\n\n    state.BookmarkSegments.ForEach(item => {\n      if (item.Kind == BookmarkSegmentKind.Bookmark) {\n        AddBookmark(item.Bookmark);\n      }\n    });\n  }\n\n  public void AddBlock(HighlightedElementGroup group, bool saveToFile = true) {\n    foreach (var block in group.Elements) {\n      RemoveBlock(block);\n      blockElements_.Add(block);\n    }\n\n    blockGroups_.Add(new HighlightedSegmentGroup(group, saveToFile));\n    Version++;\n  }\n\n  public void AddBookmark(Bookmark bookmark) {\n    bookmarkSegments_.Add(new BookmarkSegment(bookmark, BookmarkSegmentKind.Bookmark));\n    Version++;\n  }\n\n  public void AddRemarkBookmark(Bookmark bookmark, RemarkLineGroup remarkGroup) {\n    bookmarkSegments_.Add(new BookmarkSegment(bookmark, BookmarkSegmentKind.Remark, remarkGroup));\n    Version++;\n  }\n\n  public void RemoveBookmark(Bookmark bookmark) {\n    BookmarkSegment segment = null;\n\n    foreach (var value in bookmarkSegments_) {\n      if (value.Bookmark == bookmark) {\n        segment = value;\n        break;\n      }\n    }\n\n    if (segment != null) {\n      bookmarkSegments_.Remove(segment);\n      Version++;\n    }\n  }\n\n  public void RemoveBlock(IRElement block) {\n    if (DisableBlockRemoval) {\n      return;\n    }\n\n    if (!blockElements_.Contains(block)) {\n      return;\n    }\n\n    int index = blockGroups_.FindIndex(e => e.Group.Elements.Contains(block));\n\n    if (index != -1) {\n      if (blockGroups_[index].Segments.Count == 1) {\n        blockGroups_.RemoveAt(index);\n      }\n      else {\n        var segments = blockGroups_[index].Segments;\n        IRSegment blockSegment = null;\n\n        foreach (var segment in segments) {\n          if (segment.Element == block) {\n            blockSegment = segment;\n            break;\n          }\n        }\n\n        if (blockSegment != null) {\n          segments.Remove(blockSegment);\n          Version++;\n        }\n      }\n    }\n  }\n\n  public void CopyFrom(DocumentMargin other) {\n    foreach (var item in other.blockGroups_) {\n      blockGroups_.Add(new HighlightedSegmentGroup(item.Group));\n    }\n\n    foreach (var item in other.bookmarkSegments_) {\n      bookmarkSegments_.Add(new BookmarkSegment(item.Bookmark, item.Kind));\n    }\n  }\n\n  public void ClearMarkers() {\n    blockGroups_.Clear();\n    Version++;\n  }\n\n  public void ClearBookmarks() {\n    bookmarkSegments_ = new TextSegmentCollection<BookmarkSegment>();\n    Version++;\n  }\n\n  public void Reset() {\n    ClearMarkers();\n    ClearBookmarks();\n    blockElements_.Clear();\n    blockGroups_.Clear();\n    nearbyBookmarks_.Clear();\n    selectedBookmark_ = null;\n    hoveredBookmark_ = null;\n  }\n\n  public void ForEachBlockElement(Action<IRElement> action) {\n    blockGroups_.ForEach(group => { group.Group.Elements.ForEach(action); });\n  }\n\n  public void ForEachBookmark(Action<Bookmark> action) {\n    foreach (var segment in bookmarkSegments_) {\n      action(segment.Bookmark);\n    }\n  }\n\n  public void MouseMoved(MouseEventArgs e) {\n    HandleMouseMoved(e.GetPosition(this));\n  }\n\n  public bool HasHoveredBookmark() {\n    return HitTestBookmarks() != null;\n  }\n\n  public void SelectBookmark(Bookmark bookmark) {\n    foreach (var segment in bookmarkSegments_) {\n      if (segment.Bookmark == bookmark) {\n        UnselectBookmark();\n        SelectBookmark(segment);\n        break;\n      }\n    }\n  }\n\n  public void UnselectBookmark() {\n    UnselectHoveredBookmark();\n\n    if (selectedBookmark_ != null) {\n      selectedBookmark_.IsSelected = false;\n      selectedBookmark_ = null;\n      InvalidateVisual();\n    }\n  }\n\n  public void SelectedBookmarkChanged() {\n    InvalidateVisual();\n  }\n\n  public void RemoveRemarkBookmarks() {\n    var bookmarkList = new List<BookmarkSegment>();\n\n    foreach (var segment in bookmarkSegments_) {\n      if (segment.Kind == BookmarkSegmentKind.Bookmark) {\n        bookmarkList.Add(segment);\n      }\n    }\n\n    // Clear current segments and add back just the bookmarks.\n    if (bookmarkList.Count < bookmarkSegments_.Count) {\n      bookmarkSegments_.Clear();\n\n      foreach (var segment in bookmarkList) {\n        bookmarkSegments_.Add(segment);\n      }\n    }\n  }\n\n  protected override HitTestResult HitTestCore(PointHitTestParameters hitParams) {\n    HandleMouseMoved(Mouse.GetPosition(this));\n    return new PointHitTestResult(this, hitParams.HitPoint);\n  }\n\n  protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e) {\n    var result = HitTestBookmarks();\n\n    if (result != null) {\n      var segment = result.Item1;\n      var element = result.Item2;\n\n      switch (element) {\n        case BookmarkSegmentElement.Bookmark:\n          UnselectBookmark();\n          SelectBookmark(segment);\n          InvalidateVisual();\n          BookmarkChanged?.Invoke(this, segment.Bookmark);\n          e.Handled = true;\n          return;\n        case BookmarkSegmentElement.PinButton:\n          UnselectBookmark();\n          SelectBookmark(segment);\n          segment.IsPinned = !segment.IsPinned;\n          segment.IsHovered = !segment.IsPinned;\n          InvalidateVisual();\n          BookmarkChanged?.Invoke(this, segment.Bookmark);\n          e.Handled = true;\n          return;\n        case BookmarkSegmentElement.RemoveButton:\n          BookmarkRemoved?.Invoke(this, segment.Bookmark);\n          break;\n      }\n    }\n\n    UnselectBookmark();\n    base.OnPreviewMouseLeftButtonDown(e);\n  }\n\n  protected override Size MeasureOverride(Size availableSize) {\n    return new Size(MarginWidth, 0);\n  }\n\n  protected override void OnTextViewChanged(TextView oldTextView, TextView newTextView) {\n    // Register to get notified when the visual lines are changing\n    // so that the margin can be redrawn.\n    if (oldTextView != null) {\n      oldTextView.VisualLinesChanged -= VisualLinesChanged;\n    }\n\n    if (newTextView != null) {\n      newTextView.VisualLinesChanged += VisualLinesChanged;\n    }\n\n    base.OnTextViewChanged(oldTextView, newTextView);\n    InvalidateVisual();\n  }\n\n  protected override void OnRender(DrawingContext drawingContext) {\n    // Draw margin background.\n    drawingContext.DrawRectangle(backgroundBrush_, null,\n                                 new Rect(0, 0, RenderSize.Width, RenderSize.Height));\n\n    // Draw highlighted blocks.\n    if (!DocumentUtils.FindVisibleTextOffsets(TextView, out int viewStart, out int viewEnd)) {\n      return;\n    }\n\n    foreach (var group in blockGroups_) {\n      DrawGroup(group, TextView, drawingContext, viewStart, viewEnd);\n    }\n\n    // Draw bookmarks in two steps, first the unselected ones, then the selected ones.\n    // This is done so that the borders of the selected ones are not drawn over by other\n    // segments with a different border color.\n    double lineHeight = Math.Ceiling(TextView.DefaultLineHeight);\n    var segments = bookmarkSegments_.FindOverlappingSegments(TextView);\n\n    foreach (var segment in segments) {\n      if (!(segment.IsSelected || segment.IsHovered || segment.IsPinned)) {\n        DrawSegment(segment, lineHeight, drawingContext);\n      }\n    }\n\n    foreach (var segment in segments) {\n      if (segment.IsSelected || segment.IsHovered || segment.IsPinned) {\n        DrawSegment(segment, lineHeight, drawingContext);\n      }\n    }\n  }\n\n  private void HandleMouseMoved(Point point) {\n    // Test only with visible bookmarks.\n    BookmarkSegment newHoveredBookmark = null;\n    bool newTextHoveredBookmark = false;\n    bool needsRedrawing = false;\n\n    foreach (var segment in bookmarkSegments_.FindOverlappingSegments(TextView)) {\n      if (newHoveredBookmark == null) {\n        if (segment.PinButtonBounds.Contains(point) ||\n            segment.RemoveButtonBounds.Contains(point)) {\n          newHoveredBookmark = segment;\n          newTextHoveredBookmark = false;\n          continue;\n        }\n\n        if (segment.Bounds.Contains(point)) {\n          newHoveredBookmark = segment;\n          newTextHoveredBookmark = true;\n          continue;\n        }\n      }\n\n      if (!segment.IsExpanded) {\n        double distance = (segment.Bounds.TopLeft - point).Length;\n        bool onSameLine = point.Y >= segment.Bounds.Top && point.Y <= segment.Bounds.Bottom;\n\n        if (distance < NearbyBookmarkDistance && onSameLine) {\n          if (!nearbyBookmarks_.Contains(segment)) {\n            nearbyBookmarks_.Add(segment);\n            segment.IsNearby = true;\n            needsRedrawing = true;\n          }\n        }\n        else if (nearbyBookmarks_.Contains(segment)) {\n          segment.IsNearby = false;\n          nearbyBookmarks_.Remove(segment);\n          needsRedrawing = true;\n        }\n      }\n    }\n\n    if (newHoveredBookmark != null) {\n      if (newHoveredBookmark != hoveredBookmark_ ||\n          hoveredBookmark_.IsTextHovered != newTextHoveredBookmark) {\n        // Replace hovered bookmark.\n        if (hoveredBookmark_ != null) {\n          UnselectHoveredBookmark();\n        }\n\n        newHoveredBookmark.IsHovered = true;\n        newHoveredBookmark.IsTextHovered = newTextHoveredBookmark;\n        hoveredBookmark_ = newHoveredBookmark;\n        needsRedrawing = true;\n      }\n\n      if (nearbyBookmarks_.Contains(newHoveredBookmark)) {\n        // Remove from nearby bookmarks.\n        newHoveredBookmark.IsNearby = false;\n        nearbyBookmarks_.Remove(newHoveredBookmark);\n        needsRedrawing = true;\n      }\n    }\n    else if (hoveredBookmark_ != null) {\n      UnselectHoveredBookmark();\n      needsRedrawing = true;\n    }\n\n    if (needsRedrawing) {\n      InvalidateVisual();\n    }\n  }\n\n  private Tuple<BookmarkSegment, BookmarkSegmentElement> HitTestBookmarks() {\n    var point = Mouse.GetPosition(this);\n\n    foreach (var segment in bookmarkSegments_.FindOverlappingSegments(TextView)) {\n      if (segment.PinButtonBounds.Contains(point)) {\n        return new Tuple<BookmarkSegment, BookmarkSegmentElement>(\n          segment, BookmarkSegmentElement.PinButton);\n      }\n\n      if (segment.RemoveButtonBounds.Contains(point)) {\n        return new Tuple<BookmarkSegment, BookmarkSegmentElement>(\n          segment, BookmarkSegmentElement.RemoveButton);\n      }\n\n      if (segment.Bounds.Contains(point)) {\n        return new Tuple<BookmarkSegment, BookmarkSegmentElement>(\n          segment, BookmarkSegmentElement.Bookmark);\n      }\n    }\n\n    return null;\n  }\n\n  private void UnselectHoveredBookmark() {\n    if (hoveredBookmark_ != null) {\n      hoveredBookmark_.IsHovered = false;\n      hoveredBookmark_.IsTextHovered = false;\n      hoveredBookmark_ = null;\n    }\n  }\n\n  private void SelectBookmark(BookmarkSegment segment) {\n    UnselectHoveredBookmark();\n    selectedBookmark_ = segment;\n    selectedBookmark_.IsSelected = true;\n  }\n\n  private void VisualLinesChanged(object sender, EventArgs e) {\n    InvalidateVisual();\n  }\n\n  private HighlightingStyle GetBookmarkStyle(BookmarkSegment segment) {\n    var style = defaultBookmarkStyle_;\n\n    if (segment.Bookmark.IsSelected) {\n      style = selectedBookmarkStyle_;\n    }\n    else if (segment.Bookmark.IsPinned) {\n      style = pinnedBookmarkStyle_;\n    }\n    else if (segment.IsHovered) {\n      style = hoverBookmarkStyle_;\n    }\n    else if (segment.IsNearby) {\n      style = nearbyBookmarkStyle_;\n    }\n\n    // Combine user style background with default pen.\n    if (segment.Bookmark.Style != null) {\n      //if (style == defaultBookmarkStyle_ &&\n      //    segment.Kind != BookmarkSegmentKind.Bookmark)\n      //{\n      //    style = new HighlightingStyle(ColorBrushes.Transparent, null);\n      //}\n      //else\n      //{\n      //    style = new HighlightingStyle(segment.Bookmark.Style.BackColor, style.Border);\n      //}\n      style = new HighlightingStyle(segment.Bookmark.Style.BackColor, style.Border);\n    }\n\n    return style;\n  }\n\n  private HighlightingStyle GetPinButtonStyle(BookmarkSegment segment) {\n    if (segment.IsPinned) {\n      return pinButtonStyle_;\n    }\n\n    return GetBookmarkStyle(segment);\n  }\n\n  private void DrawGroup(HighlightedSegmentGroup group, TextView textView,\n                         DrawingContext drawingContext, int viewStart, int viewEnd) {\n    var renderSize = RenderSize;\n\n    foreach (var result in group.Segments.FindOverlappingSegments(viewStart, viewEnd - viewStart)) {\n      foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, result)) {\n        drawingContext.DrawRectangle(group.BackColor, null,\n                                     Utils.SnapRectToPixels(renderSize.Width - MarginWidth,\n                                                            rect.Top, MarginWidth, rect.Height + 1));\n      }\n    }\n  }\n\n  private void DrawSegment(BookmarkSegment segment, double lineHeight, DrawingContext drawingContext) {\n    foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(TextView, segment)) {\n      double y = rect.Top;\n      var style = GetBookmarkStyle(segment);\n      Rect bounds;\n      Rect pinBounds;\n      Rect removeBounds;\n\n      //if (segment.Kind == BookmarkSegmentKind.AnalysisRemark)\n      //{\n      //    var vn = UTCRemarkParser.ExtractVN(segment.Bookmark.Element);\n      //    if (vn != null)\n      //    {\n      //        //? Click on a VN would mark all other identical VNs\n      //        var text = CreateFormattedText(this, $\"VN {vn}\", DefaultFont, 12, Brushes.Black);\n      //        drawingContext.DrawText(text, new Point(4, y));\n      //    }\n      //}\n      bool popOpacity = false;\n\n      if (segment.HasText && segment.IsExpanded) {\n        double baseWidth = RenderSize.Width + ButtonSectionWidth;\n        double fontSize = App.Settings.DocumentSettings.FontSize;\n\n        //? TODO: Add option to control little opacity on hover\n        if (segment.IsPinned && segment.IsTextHovered) {\n          drawingContext.PushOpacity(HoveredPinnedBookmarkOpacity);\n          popOpacity = true;\n        }\n\n        if (segment.Tag is RemarkLineGroup remarkGroup) {\n          double maxTextWidth = 0;\n          var textSegments = new List<FormattedText>(remarkGroup.Remarks.Count);\n          int index = 0;\n          int leaderIndex = 0;\n\n          foreach (var remark in remarkGroup.Remarks) {\n            var fontWeight = FontWeights.Normal;\n\n            if (remark == remarkGroup.LeaderRemark) {\n              leaderIndex = index;\n              fontWeight = FontWeights.Medium;\n            }\n\n            var text = DocumentUtils.CreateFormattedText(this, remark.RemarkText, DefaultFont, fontSize,\n                                                         Brushes.Black, fontWeight);\n            textSegments.Add(text);\n            maxTextWidth = Math.Max(maxTextWidth, text.Width);\n            index++;\n          }\n\n          index = 0;\n\n          foreach (var remark in remarkGroup.Remarks) {\n            var remarkColor = remark.Category.MarkColor == Colors.Black ||\n                              remark.Category.MarkColor == Colors.Transparent\n              ? backgroundBrush_.Color\n              : remark.Category.MarkColor;\n            var remarkBrush = ColorBrushes.GetBrush(remarkColor);\n            var text = textSegments[index];\n            double offsetY = y + (index - leaderIndex) * lineHeight;\n\n            var remarkBounds = Utils.SnapRectToPixels(0, offsetY - 1,\n                                                      maxTextWidth + baseWidth + 2 * ButtonTextPadding, lineHeight);\n            drawingContext.DrawRectangle(remarkBrush, style.Border, remarkBounds);\n            drawingContext.DrawText(text, new Point(baseWidth + ButtonTextPadding, offsetY - 1));\n\n            if (index == leaderIndex) {\n              bounds = remarkBounds;\n            }\n\n            index++;\n          }\n        }\n        else {\n          var text = DocumentUtils.CreateFormattedText(this, segment.Bookmark.Text, DefaultFont, fontSize,\n                                                       Brushes.Black);\n          bounds = Utils.SnapRectToPixels(0, y - 1, text.Width + baseWidth + 2 * ButtonTextPadding, lineHeight);\n          drawingContext.DrawRectangle(style.BackColor, style.Border, bounds);\n          drawingContext.DrawText(text, new Point(baseWidth + ButtonTextPadding, y));\n        }\n      }\n      else {\n        double nearbyExtraWidth = segment.IsNearby || segment.IsExpanded ? NearbyBookmarkExtraWidth : 0;\n        bounds = Utils.SnapRectToPixels(0, y - 1, RenderSize.Width + nearbyExtraWidth, lineHeight);\n        drawingContext.DrawRectangle(style.BackColor, style.Border, bounds);\n      }\n\n      var icon = SelectBookmarkIcon(segment);\n\n      if (icon != null) {\n        icon.Draw(0, y - 1, lineHeight - 1,\n                  RenderSize.Width, lineHeight, drawingContext);\n      }\n\n      if (segment.IsExpanded) {\n        var buttonBounds = new Rect(MarginWidth, y - 1, ButtonSectionWidth, lineHeight);\n        removeBounds = DrawBookmarkButton(removeIcon_, buttonBounds, style, drawingContext);\n        var pinStyle = GetPinButtonStyle(segment);\n\n        pinBounds = DrawBookmarkButton(pinIcon_, buttonBounds, pinStyle, drawingContext,\n                                       removeBounds.Width);\n      }\n\n      if (popOpacity) {\n        drawingContext.Pop();\n      }\n\n      segment.Bounds = bounds; // Update bounds for later hit testing.\n      segment.PinButtonBounds = pinBounds;\n      segment.RemoveButtonBounds = removeBounds;\n      return; // Stop after drawing it once.\n    }\n  }\n\n  private IconDrawing SelectBookmarkIcon(BookmarkSegment segment) {\n    switch (segment.Kind) {\n      case BookmarkSegmentKind.Bookmark: {\n        return bookmarkIcon_;\n      }\n      case BookmarkSegmentKind.Remark: {\n        if (segment.Tag == null) {\n          return null;\n        }\n\n        var remarkGroup = (RemarkLineGroup)segment.Tag;\n        var remark = remarkGroup.LeaderRemark;\n\n        if (remark.Category.MarkIconIndex >= 0 &&\n            remark.Category.MarkIconIndex < remarkIcons_.Count) {\n          return remarkIcons_[remark.Category.MarkIconIndex];\n        }\n\n        return null;\n      }\n      default:\n        throw new InvalidOperationException(\"Unknown segment kind!\");\n    }\n  }\n\n  private Rect DrawBookmarkButton(IconDrawing icon, Rect startBounds, HighlightingStyle pinStyle,\n                                  DrawingContext drawingContext, double extraLeftSpace = 0) {\n    var bounds = Utils.SnapRectToPixels(startBounds.Left + extraLeftSpace, startBounds.Top, ButtonWidth,\n                                        startBounds.Height);\n    drawingContext.DrawRectangle(pinStyle.BackColor, pinStyle.Border, bounds);\n\n    icon.Draw(bounds.Left + 1, bounds.Top, ButtonIconWidth,\n              bounds.Width, bounds.Height, drawingContext);\n    return bounds;\n  }\n\n  private enum BookmarkSegmentElement {\n    Bookmark,\n    PinButton,\n    RemoveButton\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Highlighters/BlockBackgroundHighlighter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class BlockBackgroundHighlighter : IBackgroundRenderer {\n  private Pen blockSeparatorPen_;\n  private Brush oddBlockBrush_;\n  private TextSegmentCollection<IRSegment> segments_;\n\n  public BlockBackgroundHighlighter(bool showSeparatorLine, Color separatorLineColor,\n                                    Color evenBlockColor, Color oddBlockColor) {\n    segments_ = new TextSegmentCollection<IRSegment>();\n    oddBlockBrush_ = ColorBrushes.GetBrush(oddBlockColor);\n\n    if (showSeparatorLine) {\n      blockSeparatorPen_ = ColorPens.GetPen(separatorLineColor);\n    }\n  }\n\n  public KnownLayer Layer => KnownLayer.Background;\n\n  public void Draw(TextView textView, DrawingContext drawingContext) {\n    if (textView.Document == null) {\n      return;\n    }\n\n    textView.EnsureVisualLines();\n    var visualLines = textView.VisualLines;\n\n    if (visualLines.Count == 0) {\n      return;\n    }\n\n    int viewStart = visualLines[0].FirstDocumentLine.Offset;\n    int viewEnd = visualLines[^1].LastDocumentLine.EndOffset;\n    var firstLinePos = visualLines[0].GetVisualPosition(0, VisualYPosition.LineTop);\n    double scrollOffsetY = textView.ScrollOffset.Y % textView.DefaultLineHeight;\n\n    double lineAdjustmentY = firstLinePos.Y + scrollOffsetY;\n    int minOffset = viewStart;\n    int maxOffset = visualLines[^1].LastDocumentLine.EndOffset;\n    double maxViewHeight = textView.ActualHeight;\n    var oddGeoBuilder = CreateGeometryBuilder();\n    Span<Rect> separatorLines = stackalloc Rect[visualLines.Count + 1];\n    int separatorLineCount = 0;\n    double width = textView.ActualWidth + textView.HorizontalOffset;\n\n    foreach (var segment in segments_.FindOverlappingSegments(viewStart, viewEnd - viewStart)) {\n      var block = segment.Element as BlockIR;\n\n      if (block == null) {\n        continue;\n      }\n\n      var startLine = textView.Document.GetLineByOffset(Math.Max(minOffset, segment.StartOffset));\n      var endLine = textView.Document.GetLineByOffset(Math.Min(maxOffset, segment.EndOffset));\n      var startLineVisual = textView.GetVisualLine(startLine.LineNumber);\n      var endLineVisual = textView.GetVisualLine(endLine.LineNumber);\n      var startLinePos = startLineVisual.GetVisualPosition(0, VisualYPosition.LineTop);\n      var endLinePos = endLineVisual.GetVisualPosition(0, VisualYPosition.LineBottom);\n\n      var blockRect = Utils.SnapRectToPixels(0, startLinePos.Y - lineAdjustmentY, width,\n                                             Math.Min(maxViewHeight, endLinePos.Y - startLinePos.Y));\n\n      if (block.HasOddIndexInFunction) {\n        oddGeoBuilder.AddRectangle(textView, blockRect);\n      }\n\n      // Draw separator line between blocks, if it doesn't end up outside the view.\n      if (blockRect.Bottom <= maxViewHeight && separatorLineCount < separatorLines.Length) {\n        separatorLines[separatorLineCount] = blockRect;\n        separatorLineCount++;\n      }\n    }\n\n    var oddGeometry = oddGeoBuilder.CreateGeometry();\n\n    if (oddGeometry != null) {\n      drawingContext.DrawGeometry(oddBlockBrush_, null, oddGeometry);\n    }\n\n    if (blockSeparatorPen_ != null) {\n      for (int i = 0; i < separatorLineCount; i++) {\n        drawingContext.DrawLine(blockSeparatorPen_, separatorLines[i].BottomLeft,\n                                new Point(textView.ActualWidth, separatorLines[i].Bottom));\n      }\n    }\n  }\n\n  public void Add(IRElement elem) {\n    segments_.Add(new IRSegment(elem));\n  }\n\n  public void Clear() {\n    segments_.Clear();\n  }\n\n  public object SaveState() {\n    return segments_.ToList();\n  }\n\n  public void LoadState(object stateObject) {\n    segments_ = new TextSegmentCollection<IRSegment>();\n    var list = stateObject as List<IRSegment>;\n    list.ForEach(item => Add(item.Element));\n  }\n\n  private BackgroundGeometryBuilder CreateGeometryBuilder() {\n    var geoBuilder = new BackgroundGeometryBuilder();\n    geoBuilder.ExtendToFullWidthAtLineEnd = true;\n    geoBuilder.AlignToWholePixels = true;\n    geoBuilder.BorderThickness = 0;\n    geoBuilder.CornerRadius = 0;\n    return geoBuilder;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Highlighters/CurrentLineHighlighter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit;\nusing ICSharpCode.AvalonEdit.Rendering;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class CurrentLineHighlighter : IBackgroundRenderer {\n  private TextEditor editor_;\n  private Pen borderPen_;\n\n  public CurrentLineHighlighter(TextEditor editor, Color borderColor) {\n    editor_ = editor;\n    borderPen_ = ColorPens.GetPen(borderColor, 1.5);\n  }\n\n  public KnownLayer Layer => KnownLayer.Background;\n\n  public void Draw(TextView textView, DrawingContext drawingContext) {\n    if (textView.Document == null || textView.Document.TextLength == 0) {\n      return;\n    }\n\n    // Draw a border around the current line.\n    textView.EnsureVisualLines();\n    var currentLine = textView.Document.GetLineByOffset(editor_.CaretOffset);\n    double width = textView.ActualWidth + textView.HorizontalOffset;\n\n    foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, currentLine)) {\n      var lineRect = Utils.SnapRectToPixels(rect.X, rect.Y, width, rect.Height);\n      lineRect.Inflate(1, 1);\n      drawingContext.DrawRectangle(null, borderPen_, lineRect);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Highlighters/DiffLineHighlighter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.CompilerServices;\nusing System.Windows;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.Document.Renderers.Highlighters;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class DiffTextSegment : TextSegment {\n  public DiffTextSegment(DiffKind kind, int startOffset, int length) {\n    Kind = kind;\n    StartOffset = startOffset;\n    Length = length;\n  }\n\n  public DiffTextSegment(DiffTextSegment other) :\n    this(other.Kind, other.StartOffset, other.Length) {\n  }\n\n  public DiffKind Kind { get; set; }\n\n  public bool IsContinuation(DiffTextSegment otherSegment) {\n    if (Kind != otherSegment.Kind) {\n      return false;\n    }\n\n    // Whole-line changes don't include the new line characters,\n    // take those into consideration to properly identify a block of changes.\n    int otherEndOffset = otherSegment.StartOffset + otherSegment.Length;\n    return Math.Abs(StartOffset - otherEndOffset) <= Environment.NewLine.Length;\n  }\n}\n\npublic sealed class DiffLineHighlighter : IBackgroundRenderer {\n  private Brush deletionBrush_;\n  private Pen deletionPen_;\n  private Brush insertionBrush_;\n  private Pen insertionPen_;\n  private Brush minorModificationBrush_;\n  private Pen minorModificationPen_;\n  private Brush modificationBrush_;\n  private Pen modificationPen_;\n  private Pen placeholderPen_;\n  private DrawingBrush placeholderTileBrush_;\n  private TextSegmentCollection<DiffTextSegment> segments_;\n\n  public DiffLineHighlighter() {\n    segments_ = new TextSegmentCollection<DiffTextSegment>();\n    placeholderPen_ = null;\n    deletionPen_ = ColorPens.GetPen(App.Settings.DiffSettings.DeletionBorderColor);\n    insertionPen_ = ColorPens.GetPen(App.Settings.DiffSettings.InsertionBorderColor);\n    modificationPen_ = ColorPens.GetPen(App.Settings.DiffSettings.ModificationBorderColor);\n    minorModificationPen_ = ColorPens.GetPen(App.Settings.DiffSettings.MinorModificationBorderColor);\n    insertionBrush_ = ColorBrushes.GetBrush(App.Settings.DiffSettings.InsertionColor);\n    deletionBrush_ = ColorBrushes.GetBrush(App.Settings.DiffSettings.DeletionColor);\n    modificationBrush_ = ColorBrushes.GetBrush(App.Settings.DiffSettings.ModificationColor);\n    minorModificationBrush_ = ColorBrushes.GetBrush(App.Settings.DiffSettings.MinorModificationColor);\n  }\n\n  public int Version { get; set; }\n  public KnownLayer Layer => KnownLayer.Background;\n\n  public void Draw(TextView textView, DrawingContext drawingContext) {\n    if (textView.Document == null || textView.Document.TextLength == 0) {\n      return;\n    }\n\n    // Find start/end index of visible lines.\n    if (!DocumentUtils.FindVisibleTextOffsets(textView, out int viewStart, out int viewEnd)) {\n      return;\n    }\n\n    BackgroundGeometryBuilder geoBuilder = null;\n    DiffTextSegment prevSegment = null;\n    CreatePlaceholderTiledBrush(textView.DefaultLineHeight / 2);\n\n    foreach (var segment in segments_.FindOverlappingSegments(viewStart, viewEnd - viewStart)) {\n      if (geoBuilder == null) {\n        geoBuilder = CreateGeometryBuilder();\n      }\n      else if (prevSegment != null && !segment.IsContinuation(prevSegment)) {\n        DrawGeometry(geoBuilder, prevSegment, drawingContext);\n        geoBuilder = CreateGeometryBuilder();\n      }\n\n      geoBuilder.AddSegment(textView, segment);\n      prevSegment = segment;\n    }\n\n    if (geoBuilder != null && prevSegment != null) {\n      DrawGeometry(geoBuilder, prevSegment, drawingContext);\n    }\n  }\n\n  public void ForEachDiffSegment(Action<DiffTextSegment, Color> action) {\n    foreach (var segment in segments_) {\n      var pen = GetSegmentColor(segment, false);\n      var color = pen != null ? ((SolidColorBrush)pen).Color : Colors.Transparent;\n      action(segment, color);\n    }\n  }\n\n  public void Add(DiffTextSegment segment) {\n    segments_.Add(segment);\n    Version++;\n  }\n\n  public void Add(List<DiffTextSegment> segments) {\n    foreach (var segment in segments) {\n      segments_.Add(segment);\n    }\n\n    Version++;\n  }\n\n  public void Clear() {\n    segments_.Clear();\n    Version++;\n  }\n\n  private void CreatePlaceholderTiledBrush(double tileSize) {\n    // Create the brush once, freeze and reuse it everywhere.\n    if (placeholderTileBrush_ != null) {\n      return;\n    }\n\n    tileSize = Math.Ceiling(tileSize);\n    var line = new LineSegment(new Point(0, 0), true);\n    line.IsSmoothJoin = false;\n    line.Freeze();\n    var figure = new PathFigure();\n    figure.IsClosed = false;\n    figure.StartPoint = new Point(tileSize, tileSize);\n    figure.Segments.Add(line);\n    figure.Freeze();\n    var geometry = new PathGeometry();\n    geometry.Figures.Add(figure);\n    geometry.Freeze();\n    var drawing = new GeometryDrawing();\n    drawing.Geometry = geometry;\n\n    var penBrush = ColorBrushes.GetBrush(App.Settings.DiffSettings.PlaceholderBorderColor);\n    drawing.Pen = new Pen(penBrush, 0.5);\n    drawing.Freeze();\n    var brush = new DrawingBrush();\n    brush.Drawing = drawing;\n    brush.Stretch = Stretch.None;\n    brush.TileMode = TileMode.Tile;\n    brush.Viewbox = new Rect(0, 0, tileSize, tileSize);\n    brush.ViewboxUnits = BrushMappingMode.Absolute;\n    brush.Viewport = new Rect(0, 0, tileSize, tileSize);\n    brush.ViewportUnits = BrushMappingMode.Absolute;\n    RenderOptions.SetCachingHint(brush, CachingHint.Cache);\n    brush.Freeze();\n    placeholderTileBrush_ = brush;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private Brush GetSegmentColor(DiffTextSegment segment, bool fromDrawing = true) {\n    switch (segment.Kind) {\n      case DiffKind.Deletion:\n        return deletionBrush_;\n      case DiffKind.Insertion:\n        return insertionBrush_;\n      case DiffKind.Placeholder: {\n        return fromDrawing ? placeholderTileBrush_ : null;\n      }\n      case DiffKind.Modification:\n        return modificationBrush_;\n      case DiffKind.MinorModification:\n        return minorModificationBrush_;\n    }\n\n    return ColorBrushes.Transparent;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private Pen GetSegmentPen(DiffTextSegment segment) {\n    return segment.Kind switch {\n      DiffKind.Deletion          => deletionPen_,\n      DiffKind.Insertion         => insertionPen_,\n      DiffKind.Modification      => modificationPen_,\n      DiffKind.MinorModification => minorModificationPen_,\n      DiffKind.Placeholder       => placeholderPen_,\n      _                          => null\n    };\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private BackgroundGeometryBuilder CreateGeometryBuilder() {\n    var geoBuilder = new BackgroundGeometryBuilder();\n    geoBuilder.ExtendToFullWidthAtLineEnd = false;\n    geoBuilder.AlignToWholePixels = true;\n    geoBuilder.BorderThickness = 0;\n    geoBuilder.CornerRadius = 0;\n    return geoBuilder;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  private void DrawGeometry(BackgroundGeometryBuilder geoBuilder, DiffTextSegment segment,\n                            DrawingContext drawingContext) {\n    var geometry = geoBuilder.CreateGeometry();\n\n    if (geometry != null) {\n      drawingContext.DrawGeometry(GetSegmentColor(segment), GetSegmentPen(segment), geometry);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Highlighters/ElementHighlighter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Document;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class ElementGroupState {\n  [ProtoMember(1)]\n  public List<IRElementReference> Elements;\n  [ProtoMember(2)]\n  public HighlightingStyle Style;\n\n  public ElementGroupState() {\n    Elements = new List<IRElementReference>();\n  }\n}\n\n[ProtoContract]\npublic class ElementHighlighterState {\n  [ProtoMember(1)]\n  public List<ElementGroupState> Groups;\n\n  public ElementHighlighterState() {\n    Groups = new List<ElementGroupState>();\n  }\n\n  public ElementHighlighterState(List<ElementGroupState> groups) {\n    Groups = groups;\n  }\n\n  public bool HasAnnotations => Groups.Count > 0;\n}\n\npublic sealed class ElementHighlighter : IBackgroundRenderer {\n  //? TODO: Change to Set to have faster Remove (search panel)\n  private List<HighlightedSegmentGroup> groups_;\n\n  public ElementHighlighter(HighlighingType type) {\n    Type = type;\n    groups_ = new List<HighlightedSegmentGroup>(64);\n    Version = 1;\n  }\n\n  public HighlighingType Type { get; set; }\n  public int Version { get; set; }\n\n  public List<HighlightedSegmentGroup> Groups {\n    get => groups_;\n    set => groups_ = value;\n  }\n\n  public KnownLayer Layer => KnownLayer.Background;\n\n  public void Draw(TextView textView, DrawingContext drawingContext) {\n    if (textView.Document == null || textView.Document.TextLength == 0) {\n      return;\n    }\n\n    // Find start/end index of visible lines.\n    if (!DocumentUtils.FindVisibleTextOffsets(textView, out int viewStart, out int viewEnd)) {\n      return;\n    }\n\n    // Query and draw visible segments from each group.\n    foreach (var group in groups_) {\n      DrawGroup(group, textView, drawingContext, viewStart, viewEnd);\n    }\n  }\n\n  public void Add(HighlightedElementGroup group, bool saveToFile = true) {\n    groups_.Add(new HighlightedSegmentGroup(group, saveToFile));\n    Version++;\n  }\n\n  public void Add(HighlightedSegmentGroup group) {\n    groups_.Add(group);\n    Version++;\n  }\n\n  public void AddFront(HighlightedElementGroup group, bool saveToFile = true) {\n    groups_.Insert(0, new HighlightedSegmentGroup(group, saveToFile));\n    Version++;\n  }\n\n  public void CopyFrom(ElementHighlighter other) {\n    foreach (var item in other.groups_) {\n      groups_.Add(new HighlightedSegmentGroup(item.Group));\n    }\n\n    Version++;\n  }\n\n  public void Remove(HighlightedElementGroup group) {\n    for (int i = 0; i < groups_.Count; i++) {\n      if (groups_[i].Group == group) {\n        groups_.RemoveAt(i);\n        break;\n      }\n    }\n\n    Version++;\n  }\n\n  public void Remove(IRElement element) {\n    for (int i = 0; i < groups_.Count; i++) {\n      groups_[i].Group.Remove(element);\n\n      if (groups_[i].Group.IsEmpty()) {\n        groups_.RemoveAt(i);\n        i--;\n      }\n    }\n\n    Version++;\n  }\n\n  public void Clear() {\n    groups_.Clear();\n    Version++;\n  }\n\n  public void ForEachElement(Action<IRElement> action) {\n    groups_.ForEach(group => { group.Group.Elements.ForEach(action); });\n  }\n\n  public void ForEachStyledElement(Action<IRElement, HighlightingStyle> action) {\n    groups_.ForEach(group => {\n      group.Group.Elements.ForEach(element => { action(element, group.Group.Style); });\n    });\n  }\n\n  public ElementHighlighterState SaveState(FunctionIR function) {\n    return new ElementHighlighterState(UIStateSerializer.SaveElementGroupState(groups_));\n  }\n\n  public void LoadState(ElementHighlighterState state, FunctionIR function) {\n    if (state == null) {\n      return; // Most likely a file from an older version of the app.\n    }\n\n    groups_ = UIStateSerializer.LoadElementGroupState(state.Groups);\n    Version++;\n  }\n\n  private void DrawGroup(HighlightedSegmentGroup group, TextView textView,\n                         DrawingContext drawingContext, int viewStart, int viewEnd) {\n    // Create BackgroundGeometryBuilder only if needed.\n    BackgroundGeometryBuilder geoBuilder = null;\n\n    var mergedRect = new Rect();\n    int prevMergedLine = -1;\n    int mergedLineCount = 0;\n    double prevMergedY = -1;\n\n    foreach (var segment in group.Segments.FindOverlappingSegments(viewStart, viewEnd - viewStart)) {\n      if (geoBuilder == null) {\n        geoBuilder = new BackgroundGeometryBuilder {\n          BorderThickness = 0\n        };\n      }\n\n      if (segment.Element is BlockIR) {\n        geoBuilder.AddSegment(textView, segment);\n      }\n      else if (segment.Element is TupleIR) {\n        int line = segment.Element.TextLocation.Line;\n\n        // Extend width to cover entire line.\n        foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, segment)) {\n          double width = textView.ActualWidth + textView.HorizontalOffset;\n          var actualRect = Utils.SnapRectToPixels(rect.X - 1, rect.Y, width, rect.Height);\n\n          // When selecting multiple consecutive tuples, create a single\n          // rect covering the region of each individual selection rect.\n          // This is done to avoid horizontal lines showing sometimes otherwise.\n          if (mergedLineCount > 0) {\n            if (prevMergedLine == line - 1) {\n              // Don't extend the accumulated height if the Y position\n              // is unchanged, this happens with lines that are in a collapsed block folding.\n              if (Math.Abs(actualRect.Y - prevMergedY) > double.Epsilon) {\n                mergedRect = new Rect(mergedRect.Left, mergedRect.Top,\n                                      Math.Max(mergedRect.Width, actualRect.Width),\n                                      mergedRect.Height + actualRect.Height);\n              }\n\n              mergedLineCount++;\n              prevMergedLine = line;\n              prevMergedY = actualRect.Y;\n              continue;\n            }\n            else {\n              // Disjoint line, commit the current merged rect and start a new region.\n              geoBuilder.AddRectangle(textView, mergedRect);\n            }\n          }\n\n          mergedRect = actualRect;\n          prevMergedLine = line;\n          prevMergedY = actualRect.Y;\n          mergedLineCount = 1;\n        }\n      }\n      else {\n        foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, segment)) {\n          var actualRect = Utils.SnapRectToPixels(rect, -1, 0, 2, 1);\n          geoBuilder.AddRectangle(textView, actualRect);\n        }\n      }\n    }\n\n    if (mergedLineCount > 0) {\n      geoBuilder.AddRectangle(textView, mergedRect);\n    }\n\n    if (geoBuilder != null) {\n      var geometry = geoBuilder.CreateGeometry();\n\n      if (geometry != null) {\n        drawingContext.DrawGeometry(group.BackColor, group.Border, geometry);\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Highlighters/RemarkHighlighter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Document;\n\nnamespace ProfileExplorer.UI;\n\npublic sealed class RemarkHighlighter : IBackgroundRenderer {\n  //? TODO: Change to Set to have faster Remove (search panel)\n  private List<HighlightedSegmentGroup> groups_;\n  private Dictionary<Color, Brush> remarkBrushCache_;\n  private int remarkBackgroundOpacity_;\n  private bool useTransparentRemarkBackground_;\n\n  public RemarkHighlighter(HighlighingType type) {\n    Type = type;\n    groups_ = new List<HighlightedSegmentGroup>(64);\n    remarkBrushCache_ = new Dictionary<Color, Brush>();\n    Version = 1;\n  }\n\n  public HighlighingType Type { get; set; }\n  public int Version { get; set; }\n  public KnownLayer Layer => KnownLayer.Background;\n\n  public void Draw(TextView textView, DrawingContext drawingContext) {\n    if (textView.Document == null || textView.Document.TextLength == 0) {\n      return;\n    }\n\n    // Find start/end index of visible lines.\n    if (!DocumentUtils.FindVisibleTextOffsets(textView, out int viewStart, out int viewEnd)) {\n      return;\n    }\n\n    InvalidateRemarkBrushCache();\n\n    // Query and draw visible segments from each group.\n    foreach (var group in groups_) {\n      DrawGroup(group, textView, drawingContext, viewStart, viewEnd);\n    }\n  }\n\n  public void Add(HighlightedElementGroup group, bool saveToFile = true) {\n    groups_.Add(new HighlightedSegmentGroup(group, saveToFile));\n    Version++;\n  }\n\n  public void AddFront(HighlightedElementGroup group, bool saveToFile = true) {\n    groups_.Insert(0, new HighlightedSegmentGroup(group, saveToFile));\n    Version++;\n  }\n\n  public void CopyFrom(RemarkHighlighter other) {\n    foreach (var item in other.groups_) {\n      groups_.Add(new HighlightedSegmentGroup(item.Group));\n    }\n\n    Version++;\n  }\n\n  public void Remove(HighlightedElementGroup group) {\n    for (int i = 0; i < groups_.Count; i++) {\n      if (groups_[i].Group == group) {\n        groups_.RemoveAt(i);\n        break;\n      }\n    }\n\n    Version++;\n  }\n\n  public void Remove(IRElement element) {\n    for (int i = 0; i < groups_.Count; i++) {\n      groups_[i].Group.Remove(element);\n\n      if (groups_[i].Group.IsEmpty()) {\n        groups_.RemoveAt(i);\n        i--;\n      }\n    }\n\n    Version++;\n  }\n\n  public void ChangeStyle(IRElement element, HighlightingStyle newStyle) {\n    for (int i = 0; i < groups_.Count; i++) {\n      if (groups_[i].Group.Contains(element)) {\n        groups_[i].Group.Style = newStyle;\n        break;\n      }\n    }\n\n    Version++;\n  }\n\n  public void Clear() {\n    groups_.Clear();\n    Version++;\n  }\n\n  public void ForEachElement(Action<IRElement> action) {\n    groups_.ForEach(group => { group.Group.Elements.ForEach(action); });\n  }\n\n  public void ForEachStyledElement(Action<IRElement, HighlightingStyle> action) {\n    groups_.ForEach(group => {\n      group.Group.Elements.ForEach(element => { action(element, group.Group.Style); });\n    });\n  }\n\n  private void DrawGroup(HighlightedSegmentGroup group, TextView textView,\n                         DrawingContext drawingContext, int viewStart, int viewEnd) {\n    // Create BackgroundGeometryBuilder only if needed.\n    BackgroundGeometryBuilder geoBuilder = null;\n\n    foreach (var segment in group.Segments.FindOverlappingSegments(viewStart, viewEnd - viewStart)) {\n      if (geoBuilder == null) {\n        geoBuilder = new BackgroundGeometryBuilder {\n          AlignToWholePixels = true,\n          BorderThickness = 0,\n          CornerRadius = 0\n        };\n      }\n\n      foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, segment)) {\n        var actualRect = Utils.SnapRectToPixels(rect, -1, 0, 2, 1);\n        geoBuilder.AddRectangle(textView, actualRect);\n      }\n    }\n\n    if (geoBuilder != null) {\n      var geometry = geoBuilder.CreateGeometry();\n\n      if (geometry != null) {\n        var brush = GetRemarkBackgroundBrush(group);\n        drawingContext.DrawGeometry(brush, group.Border, geometry);\n      }\n    }\n  }\n\n  private void InvalidateRemarkBrushCache() {\n    if (App.Settings.RemarkSettings.UseTransparentRemarkBackground != useTransparentRemarkBackground_ ||\n        App.Settings.RemarkSettings.RemarkBackgroundOpacity != remarkBackgroundOpacity_) {\n      remarkBrushCache_.Clear();\n      useTransparentRemarkBackground_ = App.Settings.RemarkSettings.UseTransparentRemarkBackground;\n      remarkBackgroundOpacity_ = App.Settings.RemarkSettings.RemarkBackgroundOpacity;\n    }\n  }\n\n  private Brush GetRemarkBackgroundBrush(HighlightedSegmentGroup group) {\n    if (!App.Settings.RemarkSettings.UseRemarkBackground) {\n      return ColorBrushes.Transparent;\n    }\n\n    var color = ((SolidColorBrush)group.BackColor).Color;\n\n    if (color == Colors.Black || color == Colors.Transparent) {\n      return ColorBrushes.Transparent;\n    }\n\n    if (remarkBrushCache_.TryGetValue(color, out var brush)) {\n      return brush;\n    }\n\n    if (useTransparentRemarkBackground_) {\n      byte alpha = (byte)(255.0 * (remarkBackgroundOpacity_ / 100.0));\n      brush = ColorBrushes.GetBrush(Color.FromArgb(alpha, color.R, color.G, color.B));\n    }\n    else {\n      brush = ColorBrushes.GetBrush(color);\n    }\n\n    remarkBrushCache_[color] = brush;\n    return brush;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/IElementOverlay.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI.Document;\n\n[ProtoContract]\n[ProtoInclude(100, typeof(ElementOverlayBase))]\npublic interface IElementOverlay {\n  public IRElement Element { get; set; }\n  public HorizontalAlignment AlignmentX { get; }\n  public VerticalAlignment AlignmentY { get; }\n  public double MarginX { get; }\n  public double MarginY { get; }\n  public double Padding { get; }\n  Size Size { get; }\n  Rect Bounds { get; }\n  public bool IsMouseOver { get; set; }\n  public bool IsSelected { get; set; }\n  public bool ShowOnMarkerBar { get; set; }\n  public bool SaveStateToFile { get; set; }\n  object Tag { get; set; }\n  public event MouseEventHandler OnClick;\n  public event KeyEventHandler OnKeyPress;\n  public event MouseEventHandler OnHover;\n  public event MouseEventHandler OnHoverEnd;\n\n  public void Draw(Rect elementRect, IRElement element, Typeface font,\n                   IElementOverlay previousOverlay, double horizontalOffset, DrawingContext drawingContext);\n\n  public bool CheckIsMouseOver(Point point);\n  public bool MouseClicked(MouseEventArgs e);\n  public bool KeyPressed(KeyEventArgs e);\n  public bool Hovered(MouseEventArgs e);\n  public bool HoveredEnded(MouseEventArgs e);\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/IconDrawing.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class IconDrawing {\n  public static readonly IconDrawing Empty = new();\n\n  public IconDrawing() {\n    // Used for deserialization.\n  }\n\n  public IconDrawing(ImageSource icon, double proportion) {\n    Icon = icon;\n    Proportion = proportion;\n  }\n\n  [ProtoMember(1)]\n  public string IconResourceName { get; set; }\n  [ProtoMember(2)]\n  public double Proportion { get; set; }\n  public ImageSource Icon { get; set; }\n\n  public static IconDrawing FromIconResource(string name) {\n    if (!Application.Current.Resources.Contains(name)) {\n      return null;\n    }\n\n    var icon = (ImageSource)Application.Current.Resources[name];\n    return new IconDrawing(icon, icon.Width / icon.Height) {\n      IconResourceName = name\n    };\n  }\n\n  public void Draw(double x, double y, double size, double availableWidth, double availableHeight,\n                   DrawingContext drawingContext) {\n    // This assumes the icon should be centered inside a rectangle {availableWidth, availableHeight}\n    // with {x, y} as top-left corner, scaling down if available space is not enough.\n    double height;\n    double width;\n\n    if (availableHeight < availableWidth) {\n      height = Math.Min(size, availableHeight);\n      width = height * Proportion;\n    }\n    else {\n      height = Math.Min(size, availableWidth);\n      width = height * Proportion;\n    }\n\n    y += (availableHeight - height) / 2;\n    x += (availableWidth - width) / 2;\n\n    // Center icon in the available space.\n    var rect = Utils.SnapRectToPixels(x, y, width, height);\n    drawingContext.DrawImage(Icon, rect);\n  }\n\n  public void Draw(double x, double y, double size, double avaiableWidth, double availableHeight,\n                   double opacity, DrawingContext drawingContext) {\n    drawingContext.PushOpacity(opacity);\n    Draw(x, y, size, avaiableWidth, availableHeight, drawingContext);\n    drawingContext.Pop();\n  }\n\n  [ProtoAfterDeserialization]\n  private void AfterDeserialization() {\n    if (!string.IsNullOrEmpty(IconResourceName)) {\n      Icon = (ImageSource)Application.Current.Resources[IconResourceName];\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/MarkerScroolBar.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI.Document.Renderers;\n\nclass MarkerScroolBar {\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/OverlayRenderer.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI.Document;\n\n[ProtoContract]\npublic class ElementOverlayState {\n  [ProtoMember(1)]\n  public List<Tuple<IRElementReference, List<ElementOverlayBase>>> Overlays;\n\n  public ElementOverlayState() {\n    Overlays = new List<Tuple<IRElementReference, List<ElementOverlayBase>>>();\n  }\n}\n\npublic sealed class OverlayRenderer : Canvas, IBackgroundRenderer {\n  private TextView textView_;\n  private ElementHighlighter highlighter_;\n  private ConnectedElement rootConnectedElement_;\n  private List<ConnectedElement> connectedElements_;\n  private TextSegmentCollection<IRSegment> conntectedSegments_;\n  private Dictionary<IRElement, IRSegment> connectedSegmentMap_;\n  private Dictionary<IRElement, IROverlaySegment> overlaySegmentMap_;\n  private TextSegmentCollection<IROverlaySegment> overlaySegments_;\n  private IElementOverlay hoveredOverlay_;\n  private IElementOverlay selectedOverlay_;\n  private ToolTip hoverTooltip_;\n  private IElementOverlay tooltipOverlay_;\n  private bool updateSuspended_;\n\n  public OverlayRenderer(ElementHighlighter highlighter) {\n    overlaySegments_ = new TextSegmentCollection<IROverlaySegment>();\n    overlaySegmentMap_ = new Dictionary<IRElement, IROverlaySegment>();\n    SnapsToDevicePixels = true;\n    IsHitTestVisible = true;\n    Background = ColorBrushes.Transparent; // Needed for mouse events to fire...\n    highlighter_ = highlighter;\n    ClearConnectedElements();\n  }\n\n  public int Version { get; set; }\n  public Typeface TextFont { get; set; }\n  public KnownLayer Layer => KnownLayer.Background;\n\n  public void Draw(TextView textView, DrawingContext drawingContext) {\n    if (updateSuspended_) {\n      return;\n    }\n\n    textView_ = textView;\n    Width = textView.RenderSize.Width;\n    Height = textView.RenderSize.Height;\n    Children.Clear();\n\n    if (textView.Document == null || textView.Document.TextLength == 0) {\n      return;\n    }\n\n    var visual = new DrawingVisual();\n    var overlayDC = visual.RenderOpen();\n\n    // Query and draw visible segments from each group.\n    foreach (var group in highlighter_.Groups) {\n      DrawGroup(group, textView, overlayDC);\n    }\n\n    Tuple<IElementOverlay, IRElement, Rect> hoverSegment = null;\n    Tuple<IElementOverlay, IRElement, Rect> selectedSegment = null;\n    IElementOverlay hoverPrevOverlay = null;\n    IElementOverlay selectedPrevOverlay = null;\n\n    foreach (var segment in overlaySegments_.FindOverlappingSegments(textView_)) {\n      bool isBlockElement = segment.Element is BlockIR;\n      IElementOverlay prevOverlay = null;\n\n      foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, segment)) {\n        foreach (var overlay in segment.Overlays) {\n          // Draw hover/selected overlay last so that it shows up on top\n          // in case there is some overlap between overlays.\n          if (overlay == hoveredOverlay_) {\n            hoverSegment = new Tuple<IElementOverlay, IRElement, Rect>(overlay, segment.Element, rect);\n            hoverPrevOverlay = prevOverlay;\n            prevOverlay = overlay;\n            continue;\n          }\n\n          if (overlay == selectedOverlay_) {\n            selectedSegment = new Tuple<IElementOverlay, IRElement, Rect>(overlay, segment.Element, rect);\n            selectedPrevOverlay = prevOverlay;\n            prevOverlay = overlay;\n            continue;\n          }\n\n          overlay.Draw(rect, segment.Element, TextFont, prevOverlay,\n                       textView.HorizontalOffset, overlayDC);\n          prevOverlay = overlay;\n        }\n\n        // For blocks, consider only the first line, otherwise the overlay\n        // would be applied to each each tuple in the block.\n        if (isBlockElement) {\n          break;\n        }\n      }\n    }\n\n    if (selectedSegment != null) {\n      selectedSegment.Item1.Draw(selectedSegment.Item3, selectedSegment.Item2, TextFont,\n                                 selectedPrevOverlay, textView.HorizontalOffset, overlayDC);\n    }\n\n    if (hoverSegment != null) {\n      hoverSegment.Item1.Draw(hoverSegment.Item3, hoverSegment.Item2, TextFont,\n                              hoverPrevOverlay, textView.HorizontalOffset, overlayDC);\n    }\n\n    double dotSize = 3;\n    //var dotBackground = ColorBrushes.GetTransparentBrush(Colors.DarkRed, 255);\n    //var dotPen = ColorPens.GetTransparentPen(Colors.DarkRed, 255);\n    bool first = true;\n\n    //? TODO: Disabled, used from IRDocument\n    // Draw extra annotations for remarks in the same context.\n    foreach (var connectedElement in connectedElements_) {\n      var prevSegmentRect = GetRemarkSegmentRect(rootConnectedElement_.Element, textView);\n      var segmentRect = GetRemarkSegmentRect(connectedElement.Element, textView);\n\n      double horizontalOffset = 4;\n      double verticalOffset = prevSegmentRect.Height / 2;\n\n      var startPoint =\n        Utils.SnapPointToPixels(prevSegmentRect.Right + horizontalOffset, prevSegmentRect.Top + verticalOffset);\n      var endPoint = Utils.SnapPointToPixels(segmentRect.Right + horizontalOffset, segmentRect.Top + verticalOffset);\n\n      var edgeStartPoint = startPoint;\n      var edgeEndPoint = endPoint;\n\n      double dx = endPoint.X - startPoint.X;\n      double dy = endPoint.Y - startPoint.Y;\n      var vect = new Vector(dy, -dx);\n      var middlePoint = new Point(startPoint.X + dx / 2, startPoint.Y + dy / 2);\n\n      double factor = FindBezierControlPointFactor(startPoint, endPoint);\n      var controlPoint = middlePoint + -factor * vect;\n\n      // Keep the control point in the horizontal bounds of the document.\n      if (controlPoint.X < 0 || controlPoint.X > Width) {\n        controlPoint = new Point(Math.Clamp(controlPoint.X, 0, Width), controlPoint.Y);\n      }\n\n      //overlayDC.DrawLine(ColorPens.GetPen(Colors.Green, 2), startPoint, middlePoint);\n      //overlayDC.DrawLine(ColorPens.GetPen(Colors.Green, 2), middlePoint, endPoint);\n\n      var startOrientation = FindArrowOrientation(new[] {edgeEndPoint, edgeStartPoint, controlPoint}, out var _);\n      var orientation = FindArrowOrientation(new[] {edgeStartPoint, controlPoint, edgeEndPoint}, out var _);\n\n      edgeStartPoint = edgeStartPoint + startOrientation * (dotSize - 1);\n      edgeEndPoint = edgeEndPoint - orientation * dotSize * 2;\n\n      var edgeGeometry = new StreamGeometry();\n      var edgeSC = edgeGeometry.Open();\n      edgeSC.BeginFigure(edgeStartPoint, false, false);\n      edgeSC.BezierTo(edgeStartPoint, controlPoint, edgeEndPoint, true, false);\n      DrawEdgeArrow(new[] {edgeStartPoint, controlPoint, edgeEndPoint}, edgeSC);\n\n      //edgeSC.BeginFigure(edgeStartPoint, false, false);\n      //edgeSC.LineTo(edgeEndPoint, true, false);\n\n      //edgeSC.BeginFigure(startPoint, false, false);\n      //edgeSC.LineTo(endPoint, true, false);\n\n      // overlayDC.DrawLine(ColorPens.GetPen(Colors.Red, 2), startPoint, endPoint);\n      //overlayDC.DrawLine(ColorPens.GetPen(Colors.Red, 2), point, point2);\n\n      // overlayDC.DrawEllipse(connectedElement.Style.BackColor, connectedElement.Style.Border, endPoint, dotSize, dotSize);\n\n      if (first) {\n        overlayDC.DrawEllipse(rootConnectedElement_.Style.BackColor, rootConnectedElement_.Style.Border, startPoint,\n                              dotSize, dotSize);\n        first = false;\n      }\n\n      edgeSC.Close();\n      edgeGeometry.Freeze();\n      overlayDC.DrawGeometry(connectedElement.Style.BackColor, connectedElement.Style.Border, edgeGeometry);\n\n      //var text = DocumentUtils.CreateFormattedText(textView, i.ToString(), DefaultFont, 11, Brushes.Black);\n      //overlayDC.DrawText(text, Utils.SnapPointToPixels(startPoint.X - text.Width / 2, startPoint.Y - text.Height / 2));\n    }\n\n    overlayDC.Close();\n    Add(visual);\n\n    if (hoverSegment != null) {\n      ShowTooltip(hoverSegment.Item1);\n    }\n  }\n\n  public void AddElementOverlay(IRElement element, IElementOverlay overlay,\n                                bool prepend = false) {\n    overlay.Element = element;\n    Version++;\n\n    if (overlaySegmentMap_.TryGetValue(element, out var segment)) {\n      if (prepend) {\n        segment.Overlays.Insert(0, overlay);\n      }\n      else {\n        segment.Overlays.Add(overlay);\n      }\n    }\n    else {\n      segment = new IROverlaySegment(element, overlay);\n      overlaySegments_.Add(segment);\n      overlaySegmentMap_[element] = segment;\n    }\n  }\n\n  public bool RemoveAllElementOverlays(IRElement element, object onlyWithTag = null) {\n    if (!overlaySegmentMap_.TryGetValue(element, out var segment)) return false;\n\n    if (onlyWithTag != null) {\n      segment.Overlays.RemoveAll(overlay => overlay.Tag == onlyWithTag);\n    }\n    else {\n      segment.Overlays.Clear();\n    }\n\n    if (segment.Overlays.Count == 0) {\n      overlaySegmentMap_.Remove(element);\n      overlaySegments_.Remove(segment);\n    }\n\n    Version++;\n    return true;\n  }\n\n  public bool RemoveElementOverlay(IElementOverlay overlay) {\n    if (!overlaySegmentMap_.TryGetValue(overlay.Element, out var segment)) return false;\n\n    if (segment.Overlays.Remove(overlay)) {\n      if (segment.Overlays.Count == 0) {\n        overlaySegmentMap_.Remove(overlay.Element);\n        overlaySegments_.Remove(segment);\n      }\n\n      Version++;\n      return true;\n    }\n\n    return false;\n  }\n\n  public void ForEachElementOverlay(Action<IRElement, IROverlaySegment> action) {\n    foreach (var pair in overlaySegmentMap_) {\n      action(pair.Key, pair.Value);\n    }\n  }\n\n  public void SetRootElement(IRElement element, HighlightingStyle style) {\n    ClearConnectedElements();\n    rootConnectedElement_ = new ConnectedElement(element, style);\n    var segment = new IRSegment(element);\n    conntectedSegments_.Add(segment);\n    connectedSegmentMap_[element] = segment;\n  }\n\n  public void AddConnectedElement(IRElement element, HighlightingStyle style) {\n    connectedElements_.Add(new ConnectedElement(element, style));\n    var segment = new IRSegment(element);\n    conntectedSegments_.Add(segment);\n    connectedSegmentMap_[element] = segment;\n  }\n\n  public void ClearConnectedElements() {\n    rootConnectedElement_ = null;\n    connectedElements_ = new List<ConnectedElement>();\n    conntectedSegments_ = new TextSegmentCollection<IRSegment>();\n    connectedSegmentMap_ = new Dictionary<IRElement, IRSegment>();\n  }\n\n  public bool MouseClick(MouseEventArgs e) {\n    return HandleMouseClicked(e.GetPosition(this), e);\n  }\n\n  public void MouseMoved(MouseEventArgs e) {\n    HandleMouseMoved(e.GetPosition(this), e);\n  }\n\n  public new void MouseLeave() {\n    HideTooltip();\n\n    if (hoveredOverlay_ != null) {\n      hoveredOverlay_.IsMouseOver = false;\n      hoveredOverlay_ = null;\n      textView_.Redraw();\n    }\n  }\n\n  public bool KeyPressed(KeyEventArgs e) {\n    if (selectedOverlay_ == null) return false;\n\n    if (selectedOverlay_.KeyPressed(e)) {\n      textView_.Redraw(); // Force refresh\n      return true;\n    }\n\n    return false;\n  }\n\n  public void Clear() {\n    Children.Clear();\n    ClearConnectedElements();\n    ClearElementOverlays();\n    Version++;\n  }\n\n  public void ClearElementOverlays() {\n    overlaySegments_ = new TextSegmentCollection<IROverlaySegment>();\n    overlaySegmentMap_ = new Dictionary<IRElement, IROverlaySegment>();\n  }\n\n  public void Add(Visual drawingVisual) {\n    // Hit testing and focus must be disabled to allow events to propagate properly.\n    var visualHost = new VisualHost {Visual = drawingVisual};\n    visualHost.IsHitTestVisible = false;\n    visualHost.Focusable = false;\n    Children.Add(visualHost);\n  }\n\n  public void Add(UIElement element) {\n    Children.Add(element);\n  }\n\n  public ElementOverlayState SaveState(FunctionIR function) {\n    var state = new ElementOverlayState();\n\n    foreach (var pair in overlaySegmentMap_) {\n      //? TODO: Casting to ElementOverlayBase is done to avoid issues when deserializing\n      //? the IElementOverlay objects with protobuf-net.\n      var savedOverlays = new List<ElementOverlayBase>();\n\n      foreach (var overlay in pair.Value.Overlays) {\n        if (overlay.SaveStateToFile) {\n          savedOverlays.Add((ElementOverlayBase)overlay);\n        }\n      }\n\n      if (savedOverlays.Count > 0) {\n        state.Overlays.Add(new Tuple<IRElementReference, List<ElementOverlayBase>>(pair.Key, savedOverlays));\n      }\n    }\n\n    return state;\n  }\n\n  public void LoadState(ElementOverlayState state, FunctionIR function,\n                        Action<IElementOverlay> registerAction) {\n    if (state == null) {\n      return; // Most likely a file from an older version of the app.\n    }\n\n    foreach (var item in state.Overlays) {\n      foreach (var overlay in item.Item2) {\n        registerAction(overlay);\n        AddElementOverlay(item.Item1, overlay);\n      }\n    }\n\n    Version++;\n  }\n\n  public void SuspendUpdate() {\n    updateSuspended_ = true;\n  }\n\n  public void ResumeUpdate() {\n    updateSuspended_ = false;\n  }\n\n  private Rect GetRemarkSegmentRect(IRElement element, TextView textView) {\n    var segment = connectedSegmentMap_[element];\n\n    foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, segment)) {\n      return rect;\n    }\n\n    // The segment is outside the visible document.\n    // A visual line must be created for it, then extract the location.\n    var line = textView.Document.GetLineByOffset(segment.StartOffset);\n    var visualLine = textView.GetOrConstructVisualLine(line);\n    var start = new TextViewPosition(textView.Document.GetLocation(segment.StartOffset));\n    var end = new TextViewPosition(textView.Document.GetLocation(segment.StartOffset + segment.Length));\n    int startColumn = visualLine.ValidateVisualColumn(start, false);\n    int endColumn = visualLine.ValidateVisualColumn(end, false);\n\n    foreach (var rect in BackgroundGeometryBuilder.\n      GetRectsFromVisualSegment(textView, visualLine,\n                                startColumn, endColumn)) {\n      return rect;\n    }\n\n    return Rect.Empty;\n  }\n\n  private double FindBezierControlPointFactor(Point a, Point b) {\n    const double startLength = 20;\n    const double startFactor = 0.5;\n    const double endLength = 1000;\n    const double endFactor = 0.2;\n    const double slope = (endFactor - startFactor) / (endLength - startLength);\n    const double intercept = slope * startLength - startFactor;\n    double distance = (a - b).Length;\n    return Math.Clamp(distance * slope + intercept, endFactor, startFactor);\n  }\n\n  private void ShowTooltip(IElementOverlay overlay) {\n    if (!(overlay is ElementOverlayBase {HasToolTip: true} elementOverlay)) {\n      return;\n    }\n\n    if (hoverTooltip_ != null && tooltipOverlay_ == elementOverlay) {\n      return; // Already showing the right tooltip.\n    }\n\n    tooltipOverlay_ = elementOverlay;\n    hoverTooltip_ ??= new ToolTip();\n    hoverTooltip_.Closed += (sender, args) => hoverTooltip_ = null;\n\n    // Showing the tooltip from the Dispatcher somehow prevents\n    // it from temporarily showing in the top-left screen corner\n    // with an annoying flicker...\n    Dispatcher.BeginInvoke(() => {\n      hoverTooltip_.Placement = PlacementMode.Mouse;\n      hoverTooltip_.PlacementTarget = textView_;\n      hoverTooltip_.Content = elementOverlay.ToolTip;\n      hoverTooltip_.IsOpen = true;\n    });\n  }\n\n  private void HideTooltip() {\n    if (hoverTooltip_ != null) {\n      hoverTooltip_.IsOpen = false;\n    }\n  }\n\n  private void DrawEdgeArrow(Point[] tempPoints, StreamGeometryContext sc) {\n    // Draw arrow head with a slope matching the line,\n    // this uses the last two points to find the angle.\n    Point start;\n    var v = FindArrowOrientation(tempPoints, out start);\n\n    sc.BeginFigure(start + v * 5, true, true);\n    double t = v.X;\n    v.X = v.Y;\n    v.Y = -t; // Rotate 90\n    sc.LineTo(start + v * 5, true, true);\n    sc.LineTo(start + v * -5, true, true);\n  }\n\n  private Vector FindArrowOrientation(Point[] tempPoints, out Point start) {\n    for (int i = tempPoints.Length - 1; i > 0; i--) {\n      start = tempPoints[i];\n      var v = start - tempPoints[i - 1];\n\n      if (v.LengthSquared != 0) {\n        v.Normalize();\n        return v;\n      }\n    }\n\n    return new Vector(0, 0);\n  }\n\n  private void HandleMouseMoved(Point point, MouseEventArgs e) {\n    if (overlaySegments_.Count == 0 || textView_ == null) {\n      return;\n    }\n\n    IElementOverlay hoverOverlay = null;\n\n    foreach (var segment in overlaySegments_.FindOverlappingSegments(textView_)) {\n      if (hoverOverlay != null) {\n        break;\n      }\n\n      foreach (var overlay in segment.Overlays) {\n        if (overlay.CheckIsMouseOver(point)) {\n          hoverOverlay = overlay;\n          break;\n        }\n      }\n    }\n\n    if (hoverOverlay != hoveredOverlay_) {\n      if (hoveredOverlay_ != null) {\n        // Deselect previous overlay.\n        hoveredOverlay_.IsMouseOver = false;\n        hoveredOverlay_.HoveredEnded(e);\n        hoveredOverlay_ = null;\n      }\n\n      if (hoverOverlay != null) {\n        hoverOverlay.IsMouseOver = true;\n        hoveredOverlay_ = hoverOverlay;\n        hoveredOverlay_.Hovered(e);\n      }\n\n      HideTooltip();\n      textView_.Redraw();\n    }\n  }\n\n  private bool HandleMouseClicked(Point point, MouseEventArgs e) {\n    if (overlaySegments_.Count == 0 || textView_ == null) {\n      return false;\n    }\n\n    IElementOverlay hoverOverlay = null;\n    bool redraw = false;\n\n    foreach (var segment in overlaySegments_.FindOverlappingSegments(textView_)) {\n      if (hoverOverlay != null) {\n        break;\n      }\n\n      foreach (var overlay in segment.Overlays) {\n        if (overlay.CheckIsMouseOver(point)) {\n          hoverOverlay = overlay;\n          break;\n        }\n      }\n    }\n\n    if (hoverOverlay != selectedOverlay_) {\n      if (selectedOverlay_ != null) {\n        // Deselect previous overlay.\n        selectedOverlay_.IsSelected = false;\n        selectedOverlay_ = null;\n        redraw = true;\n      }\n\n      if (hoverOverlay != null) {\n        selectedOverlay_ = hoverOverlay;\n        selectedOverlay_.IsSelected = true;\n        redraw = true;\n      }\n    }\n\n    // Send click event to selected overlay.\n    if (selectedOverlay_ != null) {\n      if (selectedOverlay_.MouseClicked(e)) {\n        redraw = true;\n      }\n    }\n\n    if (redraw) {\n      textView_.Redraw();\n    }\n\n    return hoverOverlay != null;\n  }\n\n  private void DrawGroup(HighlightedSegmentGroup group, TextView textView,\n                         DrawingContext drawingContext) {\n    IRElement element = null;\n    double fontSize = App.Settings.DocumentSettings.FontSize;\n\n    foreach (var segment in group.Segments.FindOverlappingSegments(textView_)) {\n      element = segment.Element;\n\n      foreach (var rect in BackgroundGeometryBuilder.GetRectsForSegment(textView, segment)) {\n        var notesTag = element.GetTag<NotesTag>();\n\n        if (notesTag != null) {\n          string label = notesTag.Title;\n\n          //? TODO: Show only on hover\n          //if(notesTag.Notes.Count > 0)\n          //{\n          //    label += $\", {notesTag.Notes[0]}\";\n          //}\n\n          var pen = group.Border ?? ColorPens.GetPen(Colors.Gray);\n          var text = DocumentUtils.CreateFormattedText(textView, label, TextFont,\n                                                       fontSize, Brushes.Black);\n          drawingContext.DrawRectangle(group.BackColor, pen,\n                                       Utils.SnapRectToPixels(rect.X + rect.Width + 8, rect.Y,\n                                                              text.Width + 10,\n                                                              textView.DefaultLineHeight + 1));\n          drawingContext.DrawText(text, Utils.SnapPointToPixels(rect.X + rect.Width + 12, rect.Y + 1));\n        }\n      }\n    }\n  }\n\n  public sealed class IROverlaySegment : IRSegment {\n    public IROverlaySegment(IRElement element, IElementOverlay overlay) : base(element) {\n      Overlays = new List<IElementOverlay>();\n      Overlays.Add(overlay);\n    }\n\n    public List<IElementOverlay> Overlays { get; set; }\n  }\n\n  private class VisualHost : FrameworkElement {\n    public Visual Visual { get; set; }\n    protected override int VisualChildrenCount => Visual != null ? 1 : 0;\n\n    protected override Visual GetVisualChild(int index) {\n      return Visual;\n    }\n  }\n\n  private class ConnectedElement {\n    public ConnectedElement(IRElement element, HighlightingStyle style) {\n      Element = element;\n      Style = style;\n    }\n\n    public IRElement Element { get; set; }\n    public HighlightingStyle Style { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Overlays/ElementOverlayBase.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI.Document;\n\n[ProtoContract(SkipConstructor = true)]\n[ProtoInclude(200, typeof(IconElementOverlay))]\npublic abstract class ElementOverlayBase : IElementOverlay {\n  private static readonly Typeface DefaultFont = new(\"Consolas\");\n  private Rect labelBounds_;\n  [ProtoMember(1)]\n  private IRElementReference elementRef_;\n\n  protected ElementOverlayBase() {\n    // Used for deserialization.\n  }\n\n  protected ElementOverlayBase(double width, double height,\n                               double marginX, double marginY,\n                               HorizontalAlignment alignmentX,\n                               VerticalAlignment alignmentY,\n                               string label, string tooltip) {\n    Label = label;\n    ToolTip = tooltip;\n    Width = width;\n    Height = height;\n    MarginX = marginX;\n    MarginY = marginY;\n    AlignmentX = alignmentX;\n    AlignmentY = alignmentY;\n    DefaultOpacity = 1;\n    SaveStateToFile = false;\n  }\n\n  [ProtoMember(2)]\n  public string Label { get; set; }\n  [ProtoMember(3)]\n  public double Width { get; set; }\n  [ProtoMember(4)]\n  public double Height { get; set; }\n  [ProtoMember(10)]\n  public bool ShowBackgroundOnMouseOverOnly { get; set; }\n  [ProtoMember(11)]\n  public bool ShowBorderOnMouseOverOnly { get; set; }\n  [ProtoMember(12)]\n  public bool ShowLabelOnMouseOverOnly { get; set; }\n  [ProtoMember(13)]\n  public bool UseLabelBackground { get; set; }\n  [ProtoMember(14)]\n  public bool AllowLabelEditing { get; set; }\n  [ProtoMember(15)]\n  public bool IsLabelPinned { get; set; }\n  [ProtoMember(17)]\n  public double DefaultOpacity { get; set; }\n  [ProtoMember(18)]\n  public double MouseOverOpacity { get; set; }\n  [ProtoMember(19)]\n  public Brush Background { get; set; }\n  [ProtoMember(20)]\n  public Brush SelectedBackground { get; set; }\n  [ProtoMember(21)]\n  public Pen Border { get; set; }\n  [ProtoMember(22)]\n  public Brush TextColor { get; set; }\n  [ProtoMember(23)]\n  public Brush SelectedTextColor { get; set; }\n  [ProtoMember(24)]\n  public int TextSize { get; set; }\n  [ProtoMember(25)]\n  public FontWeight TextWeight { get; set; }\n  [ProtoMember(26)]\n  public double VirtualColumn { get; set; }\n  [ProtoMember(27)]\n  public string ToolTip { get; set; }\n  public bool HasLabel => !string.IsNullOrEmpty(Label);\n  public bool HasToolTip => !string.IsNullOrEmpty(ToolTip);\n  protected virtual bool ShowLabel => !string.IsNullOrEmpty(Label) &&\n                                      (!ShowLabelOnMouseOverOnly ||\n                                       IsLabelPinned || IsMouseOver || IsSelected);\n  protected virtual bool ShowBackground => Width > 0 && Height > 0 &&\n                                           (!ShowBackgroundOnMouseOverOnly || IsMouseOver || IsSelected);\n  protected virtual bool ShowBorder => !ShowBorderOnMouseOverOnly || IsMouseOver || IsSelected;\n  protected virtual Brush CurrentBackgroundBrush => IsSelected && SelectedBackground != null ?\n    SelectedBackground : Background;\n  protected virtual Pen CurrentBorder => ShowBorder ? Border : null;\n  protected virtual Brush CurrentLabelBackgroundBrush => Background == null ||\n                                                         IsSelected && SelectedBackground != null ?\n    SelectedBackground : Background;\n  protected virtual Brush ActiveTextBrush => IsSelected && SelectedTextColor != null ?\n    SelectedTextColor : TextColor ?? Brushes.Black;\n  protected virtual double ActiveOpacity => IsMouseOver || IsSelected ? MouseOverOpacity > 0 ? MouseOverOpacity : 1.0 :\n    DefaultOpacity > 0 ? DefaultOpacity : 1.0;\n  protected double ActualWidth => Width + 2 * Padding;\n  protected double ActualHeight => Height + 2 * Padding;\n  public event MouseEventHandler OnClick;\n  public event KeyEventHandler OnKeyPress;\n  public event MouseEventHandler OnHover;\n  public event MouseEventHandler OnHoverEnd;\n  [ProtoMember(5)]\n  public double MarginX { get; set; }\n  [ProtoMember(6)]\n  public double MarginY { get; set; }\n  [ProtoMember(7)]\n  public double Padding { get; set; }\n  public Size Size => new(ActualWidth, ActualHeight);\n  [ProtoMember(8)]\n  public HorizontalAlignment AlignmentX { get; set; }\n  [ProtoMember(9)]\n  public VerticalAlignment AlignmentY { get; set; }\n  [ProtoMember(16)]\n  public bool ShowOnMarkerBar { get; set; }\n  public Rect Bounds { get; set; }\n  [ProtoMember(28)]\n  public bool SaveStateToFile { get; set; }\n  [ProtoMember(29)]\n  public object Tag { get; set; }\n  public bool IsMouseOver { get; set; }\n  public bool IsSelected { get; set; }\n\n  public IRElement Element {\n    get => elementRef_;\n    set => elementRef_ = value;\n  }\n\n  public abstract void Draw(Rect elementRect, IRElement element, Typeface font,\n                            IElementOverlay previousOverlay, double horizontalOffset,\n                            DrawingContext drawingContext);\n\n  public virtual bool CheckIsMouseOver(Point point) {\n    IsMouseOver = Bounds.Contains(point);\n\n    if (!IsMouseOver && ShowLabel) {\n      IsMouseOver = labelBounds_.Contains(point);\n    }\n\n    return IsMouseOver;\n  }\n\n  public virtual bool Hovered(MouseEventArgs e) {\n    OnHover?.Invoke(this, e);\n    return true;\n  }\n\n  public virtual bool MouseClicked(MouseEventArgs e) {\n    OnClick?.Invoke(this, e);\n    return e.Handled;\n  }\n\n  public virtual bool KeyPressed(KeyEventArgs e) {\n    OnKeyPress?.Invoke(this, e);\n\n    if (!IsSelected) {\n      return e.Handled;\n    }\n\n    if (AllowLabelEditing) {\n      var keyInfo = Utils.KeyToChar(e.Key);\n\n      if (keyInfo.IsLetter && Keyboard.Modifiers == ModifierKeys.None) {\n        // Append a new letter.\n        string keyString = keyInfo.Letter.ToString();\n\n        if (string.IsNullOrEmpty(Label)) {\n          Label = keyString;\n        }\n        else {\n          Label += keyString;\n        }\n\n        return true;\n      }\n      else if (e.Key == Key.Back) {\n        // Remove last letter.\n        if (!string.IsNullOrEmpty(Label)) {\n          Label = Label.Substring(0, Label.Length - 1);\n          return true;\n        }\n      }\n      else if (e.Key == Key.Delete) {\n        Label = null; // Delete all text.\n        return true;\n      }\n      else if (e.Key == Key.Enter) {\n        IsLabelPinned = true;\n        return true;\n      }\n      else if (e.Key == Key.Escape) {\n        IsLabelPinned = false;\n        return true;\n      }\n    }\n\n    if (e.Key == Key.C && Keyboard.Modifiers == ModifierKeys.Control) {\n      // Copy the label to the clipboard.\n      if (HasToolTip) {\n        Clipboard.Clear();\n        Clipboard.SetText($\"{Label}\\n{ToolTip}\", TextDataFormat.UnicodeText);\n      }\n      else {\n        Clipboard.Clear();\n        Clipboard.SetText(Label, TextDataFormat.UnicodeText);\n      }\n\n      return true;\n    }\n\n    return e.Handled;\n  }\n\n  public bool HoveredEnded(MouseEventArgs e) {\n    OnHoverEnd?.Invoke(this, e);\n    return true;\n  }\n\n  protected void DrawBackground(Rect elementRect, double opacity, DrawingContext drawingContext) {\n    if ((ShowBackground || ShowBorder) && !(ShowLabel && UseLabelBackground)) {\n      drawingContext.PushOpacity(opacity);\n      drawingContext.DrawRectangle(CurrentBackgroundBrush, CurrentBorder, elementRect);\n      drawingContext.Pop();\n    }\n  }\n\n  protected Rect DrawLabel(Rect elementRect, Typeface font, double opacity, DrawingContext drawingContext) {\n    var host = Application.Current.MainWindow; // Used to get DPI.\n    double fontSize = TextSize != 0 ? TextSize : App.Settings.DocumentSettings.FontSize;\n\n    var text = DocumentUtils.CreateFormattedText(host, Label, font, fontSize,\n                                                 ActiveTextBrush, TextWeight);\n    int lines = Label.CountLines();\n    double extraHeight = lines > 1 ? elementRect.Height * (lines - 1) : 0;\n\n    double height = elementRect.Height + extraHeight;\n    double width = elementRect.Width + text.WidthIncludingTrailingWhitespace + 2 * Padding;\n    double textX = elementRect.Left + elementRect.Width + Padding;\n    double textY = elementRect.Top + height / 2 - text.Height / 2;\n    labelBounds_ = Utils.SnapRectToPixels(elementRect.X, elementRect.Y, width, height);\n    drawingContext.PushOpacity(opacity);\n\n    if (UseLabelBackground) {\n      // Draw a rectangle covering both the icon and label.\n      drawingContext.DrawRectangle(CurrentLabelBackgroundBrush, CurrentBorder, labelBounds_);\n    }\n\n    drawingContext.DrawText(text, Utils.SnapPointToPixels(textX, textY));\n    drawingContext.Pop();\n    return labelBounds_;\n  }\n\n  protected double ComputePositionX(Rect rect, IElementOverlay previousOveraly, double horizontalOffset) {\n    if (AlignmentX == HorizontalAlignment.Left) {\n      double leftEdgeX = rect.Left;\n\n      if (previousOveraly != null &&\n          previousOveraly.AlignmentX == HorizontalAlignment.Left) {\n        // Align to the right of the previous overlay.\n        leftEdgeX = Math.Max(rect.Left, previousOveraly.Bounds.Right);\n      }\n\n      return Utils.SnapToPixels(leftEdgeX + MarginX);\n    }\n\n    if (AlignmentX == HorizontalAlignment.Right) {\n      double rightEdgeX = rect.Right;\n\n      if (previousOveraly != null &&\n          previousOveraly.AlignmentX == HorizontalAlignment.Right) {\n        // Align to the right of the previous overlay.\n        rightEdgeX = Math.Max(rect.Right, previousOveraly.Bounds.Right);\n      }\n\n      // Consider the horizontal scrollbar offset change.\n      return Utils.SnapToPixels(Math.Max(VirtualColumn - horizontalOffset,\n                                         rightEdgeX + MarginX - horizontalOffset));\n    }\n\n    return Utils.SnapToPixels(rect.Left + (rect.Width - ActualWidth) / 2);\n  }\n\n  protected double ComputeHeight(Rect rect) {\n    if (Height > 0) {\n      return Math.Min(ActualHeight, rect.Height);\n    }\n\n    return rect.Height;\n  }\n\n  protected double ComputePositionY(Rect rect, IElementOverlay previousOveraly) {\n    if (AlignmentY == VerticalAlignment.Top) {\n      return Utils.SnapToPixels(rect.Top - ComputeHeight(rect) - MarginY);\n    }\n\n    if (AlignmentY == VerticalAlignment.Bottom) {\n      return Utils.SnapToPixels(rect.Bottom + MarginY);\n    }\n\n    return Utils.SnapToPixels(rect.Top + (rect.Height - ComputeHeight(rect)) / 2);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Overlays/IconElementOverlay.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI.Document;\n\n[ProtoContract(SkipConstructor = true)]\npublic sealed class IconElementOverlay : ElementOverlayBase {\n  public IconElementOverlay() {\n    // Used by deserialization.\n  }\n\n  public IconElementOverlay(IconDrawing icon, double width, double height,\n                            string label, string tooltip,\n                            HorizontalAlignment alignmentX, VerticalAlignment alignmentY,\n                            double marginX, double marginY) :\n    base(width, height, marginX, marginY, alignmentX, alignmentY, label, tooltip) {\n    Icon = icon;\n  }\n\n  [ProtoMember(1)]\n  public IconDrawing Icon { get; set; }\n\n  public static IconElementOverlay\n    CreateDefault(IconDrawing icon, double width, double height,\n                  Brush backColor, Brush selectedBackColor, Pen border,\n                  string label = \"\", string tooltip = \"\",\n                  HorizontalAlignment alignmentX = HorizontalAlignment.Right,\n                  VerticalAlignment alignmentY = VerticalAlignment.Center,\n                  double marginX = 4, double marginY = 4, double padding = 2) {\n    return new IconElementOverlay(icon, width, height,\n                                  label, tooltip,\n                                  alignmentX, alignmentY,\n                                  marginX, marginY) {\n      Background = backColor,\n      SelectedBackground = selectedBackColor,\n      Border = border,\n      ShowBackgroundOnMouseOverOnly = true,\n      ShowBorderOnMouseOverOnly = true,\n      ShowLabelOnMouseOverOnly = true,\n      UseLabelBackground = true,\n      Padding = padding,\n      AllowLabelEditing = true\n    };\n  }\n\n  public override void Draw(Rect elementRect, IRElement element, Typeface font,\n                            IElementOverlay previousOverlay, double horizontalOffset,\n                            DrawingContext drawingContext) {\n    double x = ComputePositionX(elementRect, previousOverlay, horizontalOffset);\n    double y = ComputePositionY(elementRect, previousOverlay);\n    double opacity = ActiveOpacity;\n    Bounds = Utils.SnapRectToPixels(x, y, ActualWidth, ComputeHeight(elementRect));\n    double iconHeight = Bounds.Height;\n\n    if (ShowLabel) {\n      if (Icon == null) {\n        Bounds = Utils.SnapRectToPixels(Bounds.X + Bounds.Width, Bounds.Y, 0, Bounds.Height);\n      }\n\n      Bounds = DrawLabel(Bounds, font, opacity, drawingContext);\n    }\n\n    if (Icon != null) {\n      DrawBackground(Bounds, opacity, drawingContext);\n      Icon.Draw(x + 1, y - 1, Width, Width, iconHeight, opacity, drawingContext);\n    }\n\n    // For debugging, border around whole element.\n    // drawingContext.DrawRectangle(ColorBrushes.Transparent, ColorPens.GetPen(Colors.Red), elementRect);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/Renderers/Overlays/TextElementOverlay.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic sealed class TextElementOverlay : ElementOverlayBase {\n  public TextElementOverlay(string text, double width, double height,\n                            double marginX = 2, double marginY = 2,\n                            HorizontalAlignment alignmentX = HorizontalAlignment.Right,\n                            VerticalAlignment alignmentY = VerticalAlignment.Center,\n                            string toolTip = \"\") :\n    base(width, height, marginX, marginY, alignmentX, alignmentY, text, toolTip) {\n  }\n\n  public override void Draw(Rect elementRect, IRElement element, Typeface font,\n                            IElementOverlay previousOverlay, double horizontalOffset,\n                            DrawingContext drawingContext) {\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/SearchInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.ComponentModel;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI.Document;\n\n[ProtoContract]\npublic class SearchInfo : INotifyPropertyChanged {\n  [ProtoMember(1)]\n  private int currentResult_;\n  [ProtoMember(2)]\n  private TextSearchKind kind_;\n  [ProtoMember(3)]\n  private int resultCount_;\n  [ProtoMember(4)]\n  private bool searchAllEnabled_;\n  [ProtoMember(5)]\n  private bool searchAll_;\n  [ProtoMember(6)]\n  private string searchedText_;\n  [ProtoMember(7)]\n  private bool showSearchAllButton_;\n  [ProtoMember(8)]\n  private bool showNavigationSection_;\n\n  public SearchInfo() {\n    searchedText_ = string.Empty;\n    kind_ = TextSearchKind.CaseInsensitive;\n    showSearchAllButton_ = true;\n    searchAllEnabled_ = true;\n    showNavigationSection_ = true;\n  }\n\n  public TextSearchKind SearchKind {\n    get => kind_;\n    set => kind_ = value;\n  }\n\n  public string SearchedText {\n    get => searchedText_;\n    set {\n      if (value != searchedText_) {\n        searchedText_ = value;\n        OnPropertyChange(nameof(SearchedText));\n      }\n    }\n  }\n\n  public bool HasSearchedText => !string.IsNullOrEmpty(searchedText_);\n\n  public bool IsCaseInsensitive {\n    get => kind_.HasFlag(TextSearchKind.CaseInsensitive);\n    set {\n      if (SetKindFlag(TextSearchKind.CaseInsensitive, value)) {\n        OnPropertyChange(nameof(IsCaseInsensitive));\n      }\n    }\n  }\n\n  public bool IsWholeWord {\n    get => kind_.HasFlag(TextSearchKind.WholeWord);\n    set {\n      if (SetKindFlag(TextSearchKind.WholeWord, value)) {\n        OnPropertyChange(nameof(IsWholeWord));\n      }\n    }\n  }\n\n  public bool IsRegex {\n    get => kind_.HasFlag(TextSearchKind.Regex);\n    set {\n      if (SetKindFlag(TextSearchKind.Regex, value)) {\n        OnPropertyChange(nameof(IsRegex));\n      }\n    }\n  }\n\n  public bool SearchAll {\n    get => searchAll_ && searchAllEnabled_;\n    set {\n      if (value != searchAll_) {\n        searchAll_ = value;\n        OnPropertyChange(nameof(SearchAll));\n      }\n    }\n  }\n\n  public bool SearchAllEnabled {\n    get => searchAllEnabled_;\n    set {\n      if (value != searchAllEnabled_) {\n        searchAllEnabled_ = value;\n        OnPropertyChange(nameof(SearchAllEnabled));\n      }\n    }\n  }\n\n  public int ResultCount {\n    get => resultCount_;\n    set {\n      if (resultCount_ != value) {\n        resultCount_ = value;\n        OnPropertyChange(nameof(ResultText));\n      }\n    }\n  }\n\n  public int CurrentResult {\n    get => currentResult_;\n    set {\n      if (currentResult_ != value) {\n        currentResult_ = value;\n        OnPropertyChange(nameof(ResultText));\n      }\n    }\n  }\n\n  public string ResultText => $\"{(resultCount_ > 0 ? currentResult_ + 1 : 0)} / {resultCount_}\";\n\n  public bool ShowSearchAllButton {\n    get => showSearchAllButton_;\n    set {\n      if (value != showSearchAllButton_) {\n        showSearchAllButton_ = value;\n        OnPropertyChange(nameof(ShowSearchAllButton));\n      }\n    }\n  }\n\n  public bool ShowNavigationSection {\n    get => showNavigationSection_;\n    set {\n      if (value != showNavigationSection_) {\n        showNavigationSection_ = value;\n        OnPropertyChange(nameof(ShowNavigationSection));\n      }\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private bool SetKindFlag(TextSearchKind flag, bool value) {\n    if (value && !kind_.HasFlag(flag)) {\n      kind_ |= flag;\n      return true;\n    }\n\n    if (!value && kind_.HasFlag(flag)) {\n      kind_ &= ~flag;\n      return true;\n    }\n\n    return false;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/SearchPanel.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Document.SearchPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:toolkit=\"clr-namespace:System.Windows.Controls;assembly=DotNetProjects.Input.Toolkit\"\n  x:Name=\"SearchPanelControl\"\n  d:DesignHeight=\"28\"\n  d:DesignWidth=\"500\"\n  mc:Ignorable=\"d\">\n\n  <UserControl.CommandBindings>\n    <CommandBinding\n      CanExecute=\"NextResultCanExecute\"\n      Command=\"local:SearchCommand.NextResult\"\n      Executed=\"NextResultExecuted\" />\n    <CommandBinding\n      CanExecute=\"PreviousResultCanExecute\"\n      Command=\"local:SearchCommand.PreviousResult\"\n      Executed=\"PreviousResultExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchCommand.ClearText\"\n      Executed=\"ClearTextExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchCommand.ToggleCaseSensitive\"\n      Executed=\"ToggleCaseSensitiveExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchCommand.ToggleWholeWord\"\n      Executed=\"ToggleWholeWordExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchCommand.ToggleRegex\"\n      Executed=\"ToggleRegexExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchCommand.ToggleSearchAll\"\n      Executed=\"ToggleSearchAllExecuted\" />\n  </UserControl.CommandBindings>\n\n  <UserControl.InputBindings>\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:SearchCommand.PreviousResult\"\n      CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n      Modifiers=\"Shift\" />\n\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:SearchCommand.NextResult\"\n      CommandTarget=\"{Binding ElementName=SearchPanelControl}\" />\n\n    <KeyBinding\n      Key=\"C\"\n      Command=\"local:SearchCommand.ToggleCaseSensitive\"\n      CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n      Modifiers=\"Alt\" />\n\n    <KeyBinding\n      Key=\"W\"\n      Command=\"local:SearchCommand.ToggleWholeWord\"\n      CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n      Modifiers=\"Alt\" />\n\n    <KeyBinding\n      Key=\"R\"\n      Command=\"local:SearchCommand.ToggleRegex\"\n      CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n      Modifiers=\"Alt\" />\n\n    <KeyBinding\n      Key=\"A\"\n      Command=\"local:SearchCommand.ToggleSearchAll\"\n      CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n      Modifiers=\"Alt\" />\n  </UserControl.InputBindings>\n\n  <Border\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,0,1\">\n    <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <ToolBarTray\n        Grid.Row=\"0\"\n        Grid.Column=\"2\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n\n          <Image\n            Source=\"{StaticResource SearchIcon}\"\n            ToolTip=\"Filter text based on a string\" />\n          <toolkit:AutoCompleteBox\n            Name=\"TextSearch\"\n            Width=\"220\"\n            Margin=\"4,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            FilterMode=\"StartsWithOrdinal\"\n            IsDropDownOpen=\"True\"\n            IsTextCompletionEnabled=\"False\"\n            Loaded=\"TextSearch_Loaded\"\n            MinimumPrefixLength=\"1\"\n            Populating=\"TextSearch_Populating\"\n            Text=\"{Binding Path=SearchedText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\">\n            <toolkit:AutoCompleteBox.InputBindings>\n              <KeyBinding\n                Key=\"Escape\"\n                Command=\"local:SearchCommand.ClearText\"\n                CommandTarget=\"{Binding ElementName=SearchPanelControl}\" />\n            </toolkit:AutoCompleteBox.InputBindings>\n          </toolkit:AutoCompleteBox>\n\n          <Button\n            Command=\"local:SearchCommand.ClearText\"\n            CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n            ToolTip=\"Reset searched text\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ClearIcon}\" />\n          </Button>\n          <Separator />\n\n\n          <ToggleButton\n            IsChecked=\"{Binding Path=IsCaseInsensitive, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n            ToolTip=\"Accept case mismatch (Alt+C)\">\n            <Image Source=\"{StaticResource CaseIcon}\" />\n          </ToggleButton>\n\n          <ToggleButton\n            IsChecked=\"{Binding Path=IsWholeWord, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n            ToolTip=\"Match whole word (Alt+W)\">\n            <Image Source=\"{StaticResource WholeWordIcon}\" />\n          </ToggleButton>\n\n          <ToggleButton\n            Width=\"16\"\n            IsChecked=\"{Binding Path=IsRegex, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n            ToolTip=\"Use Regular Expressions (Alt+R)\">\n            <TextBlock\n              FontWeight=\"ExtraBlack\"\n              Text=\".*\" />\n          </ToggleButton>\n          <Separator Visibility=\"{Binding ShowSearchAllButton, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          <ToggleButton\n            x:Name=\"SearchAllButton\"\n            IsChecked=\"{Binding Path=SearchAll, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n            IsEnabled=\"{Binding Path=SearchAllEnabled, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\"\n            ToolTip=\"Display the search results in the Search Results view\"\n            Visibility=\"{Binding ShowSearchAllButton, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <Image Source=\"{StaticResource SearchListIcon}\" />\n          </ToggleButton>\n          <Separator />\n\n          <Button\n            x:Name=\"PreviousButton\"\n            Command=\"local:SearchCommand.PreviousResult\"\n            CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n            ToolTip=\"Jump to previous search result (Shift+F3)\">\n            <Image Source=\"{StaticResource UpArrowIcon}\" />\n          </Button>\n\n          <Button\n            x:Name=\"NextButton\"\n            Command=\"local:SearchCommand.NextResult\"\n            CommandTarget=\"{Binding ElementName=SearchPanelControl}\"\n            ToolTip=\"Jump to next search result (F3)\">\n            <Image Source=\"{StaticResource DownArrowIcon}\" />\n          </Button>\n\n          <TextBlock\n            Margin=\"8,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"Results:\" />\n\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding Path=ResultText, UpdateSourceTrigger=PropertyChanged}\" />\n        </ToolBar>\n      </ToolBarTray>\n    </Grid>\n  </Border>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Document/SearchPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic static class SearchCommand {\n  public static readonly RoutedUICommand PreviousResult = new(\"Untitled\", \"PreviousResult\", typeof(SearchPanel));\n  public static readonly RoutedUICommand NextResult = new(\"Untitled\", \"NextResult\", typeof(SearchPanel));\n  public static readonly RoutedUICommand ClearText = new(\"Untitled\", \"ClearText\", typeof(SearchPanel));\n  public static readonly RoutedUICommand ToggleCaseSensitive =\n    new(\"Untitled\", \"ToggleCaseSensitive\", typeof(SearchPanel));\n  public static readonly RoutedUICommand ToggleWholeWord = new(\"Untitled\", \"ToggleWholeWord\", typeof(SearchPanel));\n  public static readonly RoutedUICommand ToggleRegex = new(\"Untitled\", \"ToggleRegex\", typeof(SearchPanel));\n  public static readonly RoutedUICommand ToggleSearchAll = new(\"Untitled\", \"ToggleSearchAll\", typeof(SearchPanel));\n}\n\npublic partial class SearchPanel : UserControl {\n  private SearchInfo searchInfo_;\n  private bool selectTextOnFocus_;\n\n  public SearchPanel() {\n    InitializeComponent();\n    UseAutoComplete = true;\n\n    // The AutoCompleteBox has no SelectAll method, get the underlying TextBox\n    // to do that when it gets focus.\n    var textBox = Utils.FindChild<TextBox>(TextSearch);\n\n    if (textBox != null) {\n      textBox.GotFocus += TextBox_GotFocus;\n    }\n  }\n\n  public SearchInfo SearchInfo => searchInfo_;\n  public bool UseAutoComplete { get; set; }\n  public event EventHandler<SearchInfo> SearchChanged;\n  public event EventHandler<SearchInfo> NavigateToNextResult;\n  public event EventHandler<SearchInfo> NavigateToPreviousResult;\n  public event EventHandler<SearchInfo> CloseSearchPanel;\n\n  public void Show(SearchInfo initialInfo = null, bool searchAll = false,\n                   bool selectTextOnFocus = false) {\n    Reset(initialInfo, searchAll);\n    selectTextOnFocus_ = selectTextOnFocus;\n    Keyboard.Focus(TextSearch);\n  }\n\n  public void Hide() {\n    if (UseAutoComplete) {\n      string text = TextSearch.Text;\n\n      if (text.Trim().Length > 0) {\n        App.Settings.AddRecentTextSearch(text);\n      }\n    }\n  }\n\n  public void Reset(SearchInfo initialInfo = null, bool searchAll = false) {\n    if (searchInfo_ != null) {\n      searchInfo_.PropertyChanged -= SearchInfo__PropertyChanged;\n\n      if (initialInfo == null) {\n        var temp = new SearchInfo();\n        temp.SearchAll = searchInfo_.SearchAll;\n        temp.SearchKind = searchInfo_.SearchKind;\n        searchInfo_ = temp;\n      }\n    }\n\n    if (initialInfo != null) {\n      searchInfo_ = initialInfo;\n    }\n    else if (searchInfo_ == null) {\n      searchInfo_ = new SearchInfo();\n      searchInfo_.SearchAll = searchAll;\n    }\n\n    DataContext = searchInfo_;\n    searchInfo_.PropertyChanged += SearchInfo__PropertyChanged;\n\n    if (initialInfo == null || initialInfo.ResultCount == 0) {\n      SearchChanged?.Invoke(this, searchInfo_);\n    }\n  }\n\n  private void TextBox_GotFocus(object sender, RoutedEventArgs e) {\n    if (selectTextOnFocus_) {\n      ((TextBox)sender).SelectAll();\n      selectTextOnFocus_ = false;\n    }\n  }\n\n  private void SearchInfo__PropertyChanged(object sender, PropertyChangedEventArgs e) {\n    if (e.PropertyName != \"ResultText\") {\n      searchInfo_.CurrentResult = 0;\n      searchInfo_.ResultCount = 0;\n      SearchChanged?.Invoke(this, searchInfo_);\n    }\n  }\n\n  private void PreviousResultExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (searchInfo_.CurrentResult > 0) {\n      searchInfo_.CurrentResult--;\n      NavigateToPreviousResult?.Invoke(this, searchInfo_);\n    }\n  }\n\n  private void NextResultExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (searchInfo_.CurrentResult < searchInfo_.ResultCount - 1) {\n      searchInfo_.CurrentResult++;\n      NavigateToNextResult?.Invoke(this, searchInfo_);\n    }\n  }\n\n  private void PreviousResultCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = NavigateToPreviousResult != null;\n  }\n\n  private void NextResultCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = NavigateToNextResult != null;\n  }\n\n  private void ClearTextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (TextSearch.Text == \"\") {\n      CloseSearchPanel?.Invoke(this, searchInfo_);\n    }\n    else {\n      ClearSearchedText();\n    }\n  }\n\n  private void ClearSearchedText() {\n    TextSearch.Text = \"\";\n    Reset();\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private void TextSearch_Loaded(object sender, RoutedEventArgs e) {\n    Keyboard.Focus((AutoCompleteBox)sender);\n  }\n\n  private void TextSearch_Populating(object sender, PopulatingEventArgs e) {\n    if (UseAutoComplete) {\n      var box = (AutoCompleteBox)sender;\n      box.ItemsSource = null;\n      box.ItemsSource = App.Settings.RecentTextSearches;\n      box.PopulateComplete();\n    }\n  }\n\n  private void ToggleCaseSensitiveExecuted(object sender, ExecutedRoutedEventArgs e) {\n    searchInfo_.IsCaseInsensitive = !searchInfo_.IsCaseInsensitive;\n  }\n\n  private void ToggleWholeWordExecuted(object sender, ExecutedRoutedEventArgs e) {\n    searchInfo_.IsWholeWord = !searchInfo_.IsWholeWord;\n  }\n\n  private void ToggleRegexExecuted(object sender, ExecutedRoutedEventArgs e) {\n    searchInfo_.IsRegex = !searchInfo_.IsRegex;\n  }\n\n  private void ToggleSearchAllExecuted(object sender, ExecutedRoutedEventArgs e) {\n    searchInfo_.SearchAll = !searchInfo_.SearchAll;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Document/SearcheableIRDocument.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Document.SearcheableIRDocument\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:doc=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <UserControl.CommandBindings>\n    <CommandBinding\n      Command=\"doc:SearcheableIRDocumentCommand.ToggleSearch\"\n      Executed=\"ToggleSearchExecuted\" />\n  </UserControl.CommandBindings>\n\n  <DockPanel LastChildFill=\"True\">\n    <doc:SearchPanel\n      x:Name=\"SearchPanel\"\n      Height=\"28\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Top\"\n      DockPanel.Dock=\"Top\"\n      Opacity=\"1\"\n      Visibility=\"Collapsed\" />\n    <local:LightIRDocument\n      x:Name=\"TextView\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      DockPanel.Dock=\"Bottom\"\n      FontFamily=\"Consolas\"\n      FontSize=\"12\"\n      HorizontalScrollBarVisibility=\"Disabled\"\n      ShowLineNumbers=\"True\"\n      VerticalScrollBarVisibility=\"Auto\" />\n\n  </DockPanel>\n\n  <UserControl.InputBindings>\n    <KeyBinding\n      Key=\"F\"\n      Command=\"doc:SearcheableIRDocumentCommand.ToggleSearch\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n  </UserControl.InputBindings>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Document/SearcheableIRDocument.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing ICSharpCode.AvalonEdit.Highlighting;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic static class SearcheableIRDocumentCommand {\n  public static readonly RoutedUICommand ToggleSearch = new(\"Untitled\", \"ToggleSearch\", typeof(SearcheableIRDocument));\n}\n\npublic partial class SearcheableIRDocument : UserControl, INotifyPropertyChanged {\n  private bool searchPanelVisible_;\n  private List<TextSearchResult> searchResults_;\n\n  public SearcheableIRDocument() {\n    InitializeComponent();\n    DataContext = this;\n    SearchPanel.SearchChanged += SearchPanel_SearchChanged;\n    SearchPanel.CloseSearchPanel += SearchPanel_CloseSearchPanel;\n    SearchPanel.NavigateToPreviousResult += SearchPanel_NaviateToPreviousResult;\n    SearchPanel.NavigateToNextResult += SearchPanel_NavigateToNextResult;\n  }\n\n  public bool SearchPanelVisible {\n    get => searchPanelVisible_;\n    set {\n      if (value != searchPanelVisible_) {\n        searchPanelVisible_ = value;\n\n        if (searchPanelVisible_) {\n          SearchPanel.Visibility = Visibility.Visible;\n          SearchPanel.Show();\n        }\n        else {\n          SearchPanel.Reset();\n          SearchPanel.Visibility = Visibility.Collapsed;\n        }\n\n        OnPropertyChange(\"SearchPanelVisible\");\n      }\n    }\n  }\n\n  public IUISession Session {\n    get => TextView.Session;\n    set => TextView.Session = value;\n  }\n\n  public bool UseAutoComplete {\n    get => SearchPanel.UseAutoComplete;\n    set => SearchPanel.UseAutoComplete = value;\n  }\n\n  public bool FilterSearchResults {\n    get => TextView.SearchMode == LightIRDocument.TextSearchMode.Filter;\n    set {\n      var prevSearchMode = TextView.SearchMode;\n\n      TextView.SearchMode = value ? LightIRDocument.TextSearchMode.Filter :\n        LightIRDocument.TextSearchMode.Mark;\n\n      if (TextView.SearchMode != prevSearchMode) {\n        Dispatcher.InvokeAsync(async () => await SearchText());\n        OnPropertyChange(\"FilterSearchResults\");\n      }\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  public async Task SetText(string text, IHighlightingDefinition syntaxHighlighting = null) {\n    await TextView.SwitchText(text);\n    TextView.SyntaxHighlighting = syntaxHighlighting;\n  }\n\n  public async Task SetText(string text, FunctionIR function, IRTextSection section,\n                            IRDocument associatedDocument, IUISession session) {\n    TextView.Session = session;\n    await TextView.SwitchText(text, function, section, associatedDocument);\n  }\n\n  public void SelectText(int offset, int length, int line) {\n    TextView.Select(offset, length);\n    TextView.ScrollToLine(line);\n  }\n\n  public void ScrollToEnd() {\n    TextView.ScrollToEnd();\n  }\n\n  private async Task SearchText(SearchInfo info = null) {\n    if (info == null) {\n      if (searchPanelVisible_) {\n        info = SearchPanel.SearchInfo;\n      }\n      else {\n        //? TODO: Should rather be an assert\n#if DEBUG\n        MessageBox.Show(\"SearchText without searchPanelVisible_, attach debugger\");\n        Utils.WaitForDebugger();\n#endif\n        return;\n      }\n    }\n\n    searchResults_ = await TextView.SearchText(info);\n\n    if (searchResults_ != null && searchResults_.Count > 0) {\n      info.ResultCount = searchResults_.Count;\n      TextView.JumpToSearchResult(searchResults_[0]);\n    }\n  }\n\n  private void SearchPanel_NaviateToPreviousResult(object sender, SearchInfo e) {\n    if (searchResults_ == null) {\n      return;\n    }\n\n    TextView.JumpToSearchResult(searchResults_[e.CurrentResult]);\n  }\n\n  private void SearchPanel_NavigateToNextResult(object sender, SearchInfo e) {\n    if (searchResults_ == null) {\n      return;\n    }\n\n    TextView.JumpToSearchResult(searchResults_[e.CurrentResult]);\n  }\n\n  private void SearchPanel_CloseSearchPanel(object sender, SearchInfo e) {\n    SearchPanelVisible = false;\n  }\n\n  private async void SearchPanel_SearchChanged(object sender, SearchInfo e) {\n    await SearchText(e);\n  }\n\n  private void ToggleSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SearchPanelVisible = !SearchPanelVisible;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/GlobalSuppressions.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Diagnostics.CodeAnalysis;\n\n[assembly:\n  SuppressMessage(\"Design\", \"CA1062:Validate arguments of public methods\", Justification = \"<Pending>\",\n                  Scope = \"member\",\n                  Target =\n                    \"~M:ProfileExplorer.UI.UTCRemarkProvider.GetSectionList(Core.IRTextSection,System.Int32)~System.Collections.Generic.List{Core.IRTextSection}\")]\n[assembly:\n  SuppressMessage(\"Design\", \"CA1062:Validate arguments of public methods\", Justification = \"<Pending>\",\n                  Scope = \"member\",\n                  Target =\n                    \"~M:ProfileExplorer.UI.UTCRemarkProvider.ExtractAllRemarks(System.Collections.Generic.List{Core.IRTextSection},Core.IR.FunctionIR,Client.LoadedDocument)~System.Collections.Generic.List{Client.Remark}\")]"
  },
  {
    "path": "src/ProfileExplorerUI/GrpcServer/DebugSectionLoader.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class DebugSectionLoader : IRTextSectionLoader {\n  private Dictionary<IRTextSection, CompressedString> sectionTextMap_;\n  private IRTextSummary summary_;\n  private IRTextSection lastSection_;\n  private string lastSectionText_;\n\n  public DebugSectionLoader(ICompilerIRInfo irInfo) {\n    Initialize(irInfo, false);\n    sectionTextMap_ = new Dictionary<IRTextSection, CompressedString>();\n  }\n\n  public async override Task<IRTextSummary> LoadDocument(ProgressInfoHandler progressHandler) {\n    return summary_ ??= new IRTextSummary();\n  }\n\n  public override string GetDocumentOutputText() {\n    var builder = new StringBuilder();\n    var list = new List<Tuple<IRTextSection, CompressedString>>();\n\n    foreach (var pair in sectionTextMap_) {\n      list.Add(new Tuple<IRTextSection, CompressedString>(pair.Key, pair.Value));\n    }\n\n    list.Sort((a, b) => a.Item1.Number.CompareTo(b.Item1.Number));\n\n    foreach (var pair in list) {\n      builder.AppendLine(pair.Item1.Name); // Section name.\n      builder.AppendLine(pair.Item2.ToString()); // Section text.\n      builder.AppendLine();\n    }\n\n    return builder.ToString();\n  }\n\n  public override byte[] GetDocumentTextBytes() {\n    return Encoding.UTF8.GetBytes(GetDocumentOutputText());\n  }\n\n  public void AddSection(IRTextSection section, string text) {\n    Trace.TraceInformation($\"Adding section {section.Name}, length {text.Length}\");\n    sectionTextMap_[section] = new CompressedString(text);\n    lastSection_ = section;\n    lastSectionText_ = text;\n  }\n\n  public override ParsedIRTextSection LoadSection(IRTextSection section) {\n    lock (lockObject_) {\n      Trace.TraceInformation(\n        $\"Debug section loader {ObjectTracker.Track(this)}: ({section.Number}) {section.Name}\");\n\n      if (cacheEnabled_ && sectionCache_.TryGetValue(section, out var result)) {\n        Trace.TraceInformation(\n          $\"Debug section loader {ObjectTracker.Track(this)}: found in cache\");\n\n        return result;\n      }\n\n      var (sectionParser, errorHandler) = InitializeParser();\n      var text = GetSectionTextSpan(section);\n      var function = sectionParser.ParseSection(section, text);\n      result = new ParsedIRTextSection(section, text, function);\n\n      if (cacheEnabled_ && function != null) {\n        sectionCache_[section] = result;\n      }\n\n      if (errorHandler.HadParsingErrors) {\n        result.ParsingErrors = errorHandler.ParsingErrors;\n      }\n\n      return result;\n    }\n  }\n\n  public override string GetSectionText(IRTextSection section) {\n    if (section == lastSection_) {\n      return lastSectionText_;\n    }\n\n    return sectionTextMap_[section].ToString();\n  }\n\n  public override ReadOnlyMemory<char> GetSectionTextSpan(IRTextSection section) {\n    if (section == lastSection_) {\n      return lastSectionText_.AsMemory();\n    }\n\n    return sectionTextMap_[section].ToString().AsMemory();\n  }\n\n  public override string GetSectionOutputText(IRPassOutput output) {\n    return \"\";\n  }\n\n  public override ReadOnlyMemory<char> GetSectionPassOutputTextSpan(IRPassOutput output) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  public override List<string> GetSectionPassOutputTextLines(IRPassOutput output) {\n    return new List<string>();\n  }\n\n  public override string GetRawSectionText(IRTextSection section) {\n    return GetSectionText(section);\n  }\n\n  public override string GetRawSectionPassOutput(IRPassOutput output) {\n    return \"\";\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionTextSpan(IRTextSection section) {\n    return GetSectionTextSpan(section);\n  }\n\n  public override ReadOnlyMemory<char> GetRawSectionPassOutputSpan(IRPassOutput output) {\n    return ReadOnlyMemory<char>.Empty;\n  }\n\n  protected override void Dispose(bool disposing) {\n    if (!disposed_) {\n      disposed_ = true;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/GrpcServer/DebugService.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing Grpc.Core;\n\nnamespace ProfileExplorer.UI.DebugServer;\n\npublic class RequestResponsePair<T1, T2> {\n  public T1 Request;\n  public T2 Response;\n\n  public RequestResponsePair(T1 request, T2 response = default) {\n    Request = request;\n    Response = response;\n  }\n}\n\npublic class DebugService : global::DebugService.DebugServiceBase {\n  private const int Port = 50051;\n  private static Server serverInstance_;\n  private bool handleSetCurrentElement_;\n\n  public DebugService() {\n    handleSetCurrentElement_ = true;\n  }\n\n  public event EventHandler<StartSessionRequest> OnStartSession;\n  public event EventHandler<UpdateIRRequest> OnUpdateIR;\n  public event EventHandler<MarkElementRequest> OnMarkElement;\n  public event EventHandler<SetCurrentElementRequest> OnSetCurrentElement;\n  public event EventHandler<ElementCommandRequest> OnExecuteCommand;\n  public event EventHandler<RequestResponsePair<ActiveBreakpointRequest, bool>> OnHasActiveBreakpoint;\n  public event EventHandler<ClearHighlightingRequest> OnClearTemporaryHighlighting;\n  public event EventHandler<CurrentStackFrameRequest> OnUpdateCurrentStackFrame;\n\n  public static bool StartServer(DebugService instance) {\n    var options = new[] {\n      new ChannelOption(\"grpc.max_receive_message_length\", -1),\n      new ChannelOption(\"grpc.max_send_message_length\", -1)\n    };\n\n    serverInstance_ = new Server(options) {\n      Services = {global::DebugService.BindService(instance)},\n      Ports = {new ServerPort(\"localhost\", Port, ServerCredentials.Insecure)}\n    };\n\n    serverInstance_.Start();\n    return true;\n  }\n\n  public void StopServer() {\n    serverInstance_.ShutdownAsync().Wait();\n  }\n\n  public override Task<StartSessionResult> StartSession(StartSessionRequest request,\n                                                        ServerCallContext context) {\n    Trace.TraceInformation(\"Grpc: new session {0}, process {1}, args {2}\", request.Kind,\n                           request.ProcessId, request.ProcessId);\n\n    var result = HandleNewSession(request);\n    return Task.FromResult(result);\n  }\n\n  public override Task<Result> EndSession(EndSessionRequest request, ServerCallContext context) {\n    Trace.TraceInformation($\"Grpc: end session {0}\", request.SessionId);\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  public override Task<Result> UpdateIR(UpdateIRRequest request, ServerCallContext context) {\n    Trace.TraceInformation(\"Grpc: update IR {0}, length {1}\", request.SessionId, request.Text.Length);\n    OnUpdateIR?.Invoke(this, request);\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  public override Task<Result> MarkElement(MarkElementRequest request, ServerCallContext context) {\n    Trace.TraceInformation(\"Grpc: mark element {0}, label {1}, kind {2}\", request.ElementAddress,\n                           request.Label, request.Highlighting);\n\n    OnMarkElement?.Invoke(this, request);\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  public override Task<Result> SetCurrentElement(SetCurrentElementRequest request,\n                                                 ServerCallContext context) {\n    //Trace.TraceInformation(\"Grpc: set current element {0}, {1}, {2}, lable {3}\", request.ElementId,\n    //                       request.ElementKind, request.ElementAddress, request.Label);\n\n    if (handleSetCurrentElement_) {\n      OnSetCurrentElement?.Invoke(this, request);\n    }\n\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  public override Task<Result>\n    ExecuteCommand(ElementCommandRequest request, ServerCallContext context) {\n    Trace.TraceInformation(\"Grpc: execute command {0}, element {1}\", request.Command,\n                           request.ElementAddress);\n\n    OnExecuteCommand?.Invoke(this, request);\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  public override Task<ActiveBreakpointResult> HasActiveBreakpoint(\n    ActiveBreakpointRequest request, ServerCallContext context) {\n    //Trace.TraceInformation(\"Grpc: has active breakpoint element {0}\", request.ElementAddress);\n\n    var query = new RequestResponsePair<ActiveBreakpointRequest, bool>(request);\n    OnHasActiveBreakpoint?.Invoke(this, query);\n\n    return Task.FromResult(new ActiveBreakpointResult {\n      HasBreakpoint = query.Response,\n      Success = true\n    });\n  }\n\n  public override Task<Result> ClearTemporaryHighlighting(ClearHighlightingRequest request,\n                                                          ServerCallContext context) {\n    //Trace.TraceInformation(\"Grpc: clear highlighting {0}\", request.Highlighting);\n    OnClearTemporaryHighlighting?.Invoke(this, request);\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  public override Task<Result> SetSessionState(SessionStateRequest request, ServerCallContext context) {\n    Trace.TraceInformation(\"Grpc: set session state {0}\", request.State);\n    handleSetCurrentElement_ = request.State == global::SessionState.Listening;\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  public override Task<Result> UpdateCurrentStackFrame(CurrentStackFrameRequest request,\n                                                       ServerCallContext context) {\n    Trace.TraceInformation(\"Grpc: update stack frame{0}\", request.CurrentFrame);\n    OnUpdateCurrentStackFrame?.Invoke(this, request);\n    return Task.FromResult(GetSuccessResult());\n  }\n\n  private StartSessionResult HandleNewSession(StartSessionRequest request) {\n    OnStartSession?.Invoke(this, request);\n    return new StartSessionResult {SessionId = 1};\n  }\n\n  private Result GetSuccessResult() {\n    return new Result {Success = true};\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Icons.xaml",
    "content": "﻿<ResourceDictionary xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n                    xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">\n  <DrawingImage x:Key=\"BookmarkIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M4,9L3,9 3,8 4,8 4,9z M4,6L3,6 3,7 4,7 4,6z M4,4L3,4 3,5 4,5 4,4z M4,2L3,2 3,3 4,3 4,2z M12,1L12,13C12,13.55,11.55,14,11,14L6,14 6,16 4.5,14.5 3,16 3,14 1,14C0.45,14,0,13.55,0,13L0,1C0,0.45,0.45,0,1,0L11,0C11.55,0,12,0.45,12,1z M11,11L1,11 1,13 3,13 3,12 6,12 6,13 11,13 11,11z M11,1L2,1 2,10 11,10 11,1z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ClearIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M7.48,8L11.23,11.75 9.75,13.23 6,9.48 2.25,13.23 0.77,11.75 4.52,8 0.77,4.25 2.25,2.77 6,6.52 9.75,2.77 11.23,4.25 7.48,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LeftArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M10,16z M0,0z M6,3L0,8 6,13 6,10 10,10 10,6 6,6 6,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"RightArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M10,16z M0,0z M10,8L4,3 4,6 0,6 0,10 4,10 4,13 10,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SearchIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M15.7,13.3L11.89,9.47A5.93,5.93,0,0,0,13,6C13,2.69 10.31,0 7,0 3.69,0 1,2.69 1,6 1,9.31 3.69,12 7,12 8.3,12 9.48,11.59 10.47,10.89L14.3,14.7C14.49,14.9 14.75,15 15,15 15.25,15 15.52,14.91 15.7,14.7A0.996,0.996,0,0,0,15.7,13.29L15.7,13.3z M7,10.7C4.41,10.7 2.3,8.59 2.3,6 2.3,3.41 4.41,1.3 7,1.3 9.59,1.3 11.7,3.41 11.7,6 11.7,8.59 9.59,10.7 7,10.7z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"OpenExternalIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M11,10L12,10 12,13C12,13.55,11.55,14,11,14L1,14C0.45,14,0,13.55,0,13L0,3C0,2.45,0.45,2,1,2L4,2 4,3 1,3 1,13 11,13 11,10z M6,2L8.25,4.25 5,7.5 6.5,9 9.75,5.75 12,8 12,2 6,2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"TagIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H15 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M15,16z M0,0z M7.73,1.73C7.26,1.26,6.62,1,5.96,1L3.5,1C2.13,1,1,2.13,1,3.5L1,5.97C1,6.63,1.27,7.27,1.73,7.74L7.79,13.8C8.18,14.19,8.81,14.19,9.2,13.8L13.79,9.21A0.996,0.996,0,0,0,13.79,7.8L7.73,1.73z M2.38,7.09C2.07,6.79,1.91,6.39,1.91,5.96L1.91,3.5C1.91,2.62,2.63,1.91,3.5,1.91L5.97,1.91C6.39,1.91,6.8,2.07,7.1,2.38L13.24,8.51 8.51,13.24 2.38,7.09z M3.01,3L5.01,3 5.01,5 3,5 3,3 3.01,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M6,9L3,9 3,7 6,7 6,4 11,8 6,12 6,9z M14,2L14,14C14,14.55,13.55,15,13,15L1,15C0.45,15,0,14.55,0,14L0,2C0,1.45,0.45,1,1,1L13,1C13.55,1,14,1.45,14,2z M13,2L1,2 1,14 13,14 13,2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SourceIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M8.5,1L1,1C0.45,1,0,1.45,0,2L0,14C0,14.55,0.45,15,1,15L11,15C11.55,15,12,14.55,12,14L12,4.5 8.5,1z M11,14L1,14 1,2 8,2 11,5 11,14z M5,6.98L3.5,8.5 5,10 4.5,11 2,8.5 4.5,6 5,6.98z M7.5,6L10,8.5 7.5,11 7,10.02 8.5,8.5 7,7 7.5,6z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ThemeIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V512 H512 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M512,512z M0,0z M430.1,347.9C423.5,341.8 413.8,340.3 405.5,338.9 394,337 389.6,334.9 382.9,328.9 368.6,316.2 368.6,297.8 382.9,285.1L413.2,258.2C459.6,217.2 459.6,150 413.2,109 379,78.9 333.1,64 285.4,64 229.7,64 171.5,84.3 126.6,124.1 43.1,197.9 43.1,318.8 126.6,392.6 168.1,429.3 224.1,447.6 279.5,448L281.2,448C336.6,448 391.2,430.1 430,395.6 444.4,382.9 442,359 430.1,347.9z M120,216C120,198.3 134.3,184 152,184 169.7,184 184,198.3 184,216 184,233.7 169.7,248 152,248 134.3,248 120,233.7 120,216z M160,342C142.3,342 128,327.7 128,310 128,292.3 142.3,278 160,278 177.7,278 192,292.3 192,310 192,327.7 177.7,342 160,342z M224,181C206.3,181 192,166.7 192,149 192,131.3 206.3,117 224,117 241.7,117 256,131.3 256,149 256,166.7 241.7,181 224,181z M296,400C269.5,400 248,378.5 248,352 248,325.5 269.5,304 296,304 322.5,304 344,325.5 344,352 344,378.5 322.5,400 296,400z M320,192C302.3,192 288,177.7 288,160 288,142.3 302.3,128 320,128 337.7,128 352,142.3 352,160 352,177.7 337.7,192 320,192z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FolderIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M12.4142,5L21,5C21.5523,5,22,5.44772,22,6L22,20C22,20.5523,21.5523,21,21,21L3,21C2.44772,21,2,20.5523,2,20L2,4C2,3.44772,2.44772,3,3,3L10.4142,3 12.4142,5z M4,7L4,19 20,19 20,7 4,7z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"PlusIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M13,1L1,1C0.45,1,0,1.45,0,2L0,14C0,14.55,0.45,15,1,15L13,15C13.55,15,14,14.55,14,14L14,2C14,1.45,13.55,1,13,1z M13,14L1,14 1,2 13,2 13,14z M6,9L3,9 3,7 6,7 6,4 8,4 8,7 11,7 11,9 8,9 8,12 6,12 6,9z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"MinusIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M13,1L1,1C0.45,1,0,1.45,0,2L0,14C0,14.55,0.45,15,1,15L13,15C13.55,15,14,14.55,14,14L14,2C14,1.45,13.55,1,13,1z M13,14L1,14 1,2 13,2 13,14z M11,9L3,9 3,7 11,7 11,9z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SectionIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H13 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M13,16z M0,0z M12.01,13C12.01,13.59,12.01,14,11.42,14L4.6,14C4.01,14 4.01,13.59 4.01,13 4.01,12.41 4.01,12 4.6,12L11.41,12C12,12,12,12.41,12,13L12.01,13z M4.6,4L11.41,4C12,4 12,3.59 12,3 12,2.41 12,2 11.41,2L4.6,2C4.01,2 4.01,2.41 4.01,3 4.01,3.59 4.01,4 4.6,4z M11.41,7L4.6,7C4.01,7 4.01,7.41 4.01,8 4.01,8.59 4.01,9 4.6,9L11.41,9C12,9 12,8.59 12,8 12,7.41 12,7 11.41,7z M2.01,1L1.29,1C0.99,1.19,0.71,1.25,0.26,1.34L0.26,2 1.01,2 1.01,4.14 0.17,4.14 0.17,5 3.01,5 3.01,4.14 2.01,4.14 2.01,1z M2.402,9.12C2.273,9.12 1.81,9.16 1.6,9.19 2.13,8.63 2.74,7.94 2.74,7.3 2.72,6.52 2.18,6 1.38,6 0.79,6 0.41,6.2 0,6.64L0.58,7.22C0.77,7.03 0.96,6.84 1.22,6.84 1.5,6.84 1.7,7 1.7,7.36 1.7,7.89 0.93,8.56 0,9.42L0,10 3,10 3,9.12 2.402,9.12z M2.18,12.91L2.18,12.88C2.62,12.69 2.82,12.41 2.82,12.02 2.82,11.32 2.26,10.91 1.38,10.91 0.9,10.91 0.49,11.1 0.0999999999999999,11.43L0.65,12.07C0.9,11.87 1.09,11.76 1.34,11.76 1.61,11.76 1.76,11.89 1.76,12.12 1.76,12.39 1.56,12.56 0.9,12.56L0.9,13.31C1.73,13.31 1.88,13.48 1.88,13.78 1.88,14.03 1.65,14.16 1.3,14.16 1.02,14.16 0.74,14.02 0.49,13.78L0.00999999999999979,14.44C0.31,14.8 0.78,15 1.42,15 2.25,15 2.95,14.59 2.95,13.84 2.95,13.34 2.64,13.03 2.18,12.9L2.18,12.91z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FitAllIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M13,10L14,10 14,13C14,13.547,13.547,14,13,14L10,14 10,13 13,13 13,10z M1,10L0,10 0,13C0,13.547,0.453,14,1,14L4,14 4,13 1,13 1,10z M1,3L4,3 4,2 1,2C0.453,2,0,2.453,0,3L0,6 1,6 1,3z M2,4L12,4 12,12 2,12 2,4z M4,10L10,10 10,6 4,6 4,10z M10,2L10,3 13,3 13,6 14,6 14,3C14,2.453,13.547,2,13,2L10,2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FitWidthIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M15.5,4.7L8.5,0 1.5,4.7C1.2,4.89,1,5.15,1,5.5L1,16 8.5,12 16,16 16,5.5C16,5.16,15.8,4.89,15.5,4.7z M15,14.5L9,11.25 9,10 8,10 8,11.25 2,14.5 2,5.5 8,1.5 8,6 9,6 9,1.5 15,5.5 15,14.5z M6,7L11,7 11,5 14,8 11,11 11,9 6,9 6,11 3,8 6,5 6,7z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ResetWidthIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M2,4L0,4 0,3 2,3 2,1 3,1 3,3C3,3.547,2.547,4,2,4z M2,12L0,12 0,13 2,13 2,15 3,15 3,13C3,12.453,2.547,12,2,12z M11,10C11,10.547,10.547,11,10,11L4,11C3.453,11,3,10.547,3,10L3,6C3,5.453,3.453,5,4,5L10,5C10.547,5,11,5.453,11,6L11,10z M9,7L5,7 5,9 9,9 9,7z M11,13L11,15 12,15 12,13 14,13 14,12 12,12C11.453,12,11,12.453,11,13z M12,3L12,1 11,1 11,3C11,3.547,11.453,4,12,4L14,4 14,3 12,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"RemoveIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M11,2L9,2C9,1.45,8.55,1,8,1L5,1C4.45,1,4,1.45,4,2L2,2C1.45,2,1,2.45,1,3L1,4C1,4.55,1.45,5,2,5L2,14C2,14.55,2.45,15,3,15L10,15C10.55,15,11,14.55,11,14L11,5C11.55,5,12,4.55,12,4L12,3C12,2.45,11.55,2,11,2z M10,14L3,14 3,5 4,5 4,13 5,13 5,5 6,5 6,13 7,13 7,5 8,5 8,13 9,13 9,5 10,5 10,14z M11,4L2,4 2,3 11,3 11,4z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"GotoDefinitionIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M4,5.5C4.44,9.42 7.125,13.5 14,13.5 8.938,11.188 8,8.75 8,5.5L11.5,5.5 6,0 0.5,5.5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"GotoDefinitionIconSkipIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M14,16z M0,0z M6,0L0.5,5.5 4,5.5C4.1339431,6.6933115,4.4885836,7.8963438,5.0957031,8.9980469L8.7539062,9.2167969C8.182495,8.0866729,8,6.8665357,8,5.5L11.5,5.5 6,0z M5.6503906,9.8710938C6.0307233,10.393698,6.4721578,10.886176,7,11.324219L10.701172,11.546875C10.112961,11.074976,9.6534427,10.59032,9.2851562,10.089844L5.6503906,9.8710938z M8.3828125,12.248047C9.8268345,13.022066 11.666933,13.5 14,13.5 13.255377,13.159904 12.609492,12.816483 12.033203,12.46875L8.3828125,12.248047z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"PeekDefinitionIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M15,2L1,2C0.45,2,0,2.45,0,3L0,12C0,12.55,0.45,13,1,13L6.34,13C6.09,13.61,5.48,14.39,4,15L12,15C10.52,14.39,9.91,13.61,9.66,13L15,13C15.55,13,16,12.55,16,12L16,3C16,2.45,15.55,2,15,2z M15,11L1,11 1,3 15,3 15,11z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DownArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M10,16z M0,0z M5,11L0,6 1.5,4.5 5,8.25 8.5,4.5 10,6 5,11z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"UpArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M10,16z M0,0z M10,10L8.5,11.5 5,7.75 1.5,11.5 0,10 5,5 10,10z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SettingsIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M14,8.77L14,7.17 12.06,6.53 11.61,5.44 12.49,3.6 11.36,2.47 9.55,3.38 8.46,2.93 7.77,1.01 6.17,1.01 5.54,2.95 4.43,3.4 2.59,2.52 1.46,3.65 2.37,5.46 1.92,6.55 0,7.23 0,8.82 1.94,9.46 2.39,10.55 1.51,12.39 2.64,13.52 4.45,12.61 5.54,13.06 6.23,14.98 7.82,14.98 8.45,13.04 9.56,12.59 11.4,13.47 12.53,12.34 11.61,10.53 12.08,9.44 14,8.75 14,8.77z M7,11C5.34,11 4,9.66 4,8 4,6.34 5.34,5 7,5 8.66,5 10,6.34 10,8 10,9.66 8.66,11 7,11z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"MarkerIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <GeometryDrawing Brush=\"Firebrick\"\n                         Geometry=\"F0 M10,16z M0,0z M9,0L1,0C0.27,0,0,0.27,0,1L0,16 5,12.91 10,16 10,1C10,0.27,9.73,0,9,0z M8.22,4.25L6.36,5.61 7.08,7.77C7.14,7.99,7.06,8.05,6.88,7.94L5,6.6 3.12,7.94C2.93,8.05,2.87,7.99,2.92,7.77L3.64,5.61 1.78,4.25C1.61,4.09,1.64,4.02,1.87,4.02L4.17,3.99 4.87,1.83 5.12,1.83 5.82,3.99 8.12,4.02C8.35,4.02,8.39,4.1,8.21,4.25L8.22,4.25z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"UndoIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M6,3.5C9.92,3.94 14,6.625 14,13.5 11.688,8.438 9.25,7.5 6,7.5L6,11 0.5,5.5 6,0 6,3.5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"RedoIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M8.5,3.5C4.58,3.94 0.5,6.625 0.5,13.5 2.812,8.438 5.25,7.5 8.5,7.5L8.5,11 14,5.5 8.5,0z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"MarkIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M6,0C2.69,0,0,2.69,0,6L0,7C0,7.55,0.45,8,1,8L1,13C1,14.1 3.24,15 6,15 8.76,15 11,14.1 11,13L11,8C11.55,8,12,7.55,12,7L12,6C12,2.69,9.31,0,6,0z M9,10L9,10.5C9,10.78 8.78,11 8.5,11 8.22,11 8,10.78 8,10.5L8,10C8,9.72 7.78,9.5 7.5,9.5 7.22,9.5 7,9.72 7,10L7,12.5C7,12.78 6.78,13 6.5,13 6.22,13 6,12.78 6,12.5L6,10.5C6,10.22 5.78,10 5.5,10 5.22,10 5,10.22 5,10.5L5,11C5,11.55 4.55,12 4,12 3.45,12 3,11.55 3,11L3,10C2.45,10,2,9.55,2,9L2,7.2C2.91,7.69 4.36,8 6,8 7.64,8 9.09,7.69 10,7.2L10,9C10,9.55,9.55,10,9,10z M6,7C4.32,7 2.88,6.59 2.29,6 2.88,5.41 4.32,5 6,5 7.68,5 9.12,5.41 9.71,6 9.12,6.59 7.68,7 6,7z M6,4C3.24,4 1,4.89 1,6 1,3.24 3.24,1 6,1 8.76,1 11,3.24 11,6 11,4.9 8.76,4 6,4z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"PinIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M10,1.2L10,2 10.5,3 6,6 2.2,6C1.76,6,1.53,6.53,1.86,6.86L5,10 1,15 6,11 9.14,14.14A0.5,0.5,0,0,0,10,13.8L10,10 13,5.5 14,6 14.8,6C15.24,6,15.47,5.47,15.14,5.14L10.86,0.86A0.5,0.5,0,0,0,10,1.2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"PinIconColor\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#15354C\"\n                         Geometry=\"F0 M16,16z M0,0z M10,1.2L10,2 10.5,3 6,6 2.2,6C1.76,6,1.53,6.53,1.86,6.86L5,10 1,15 6,11 9.14,14.14A0.5,0.5,0,0,0,10,13.8L10,10 13,5.5 14,6 14.8,6C15.24,6,15.47,5.47,15.14,5.14L10.86,0.86A0.5,0.5,0,0,0,10,1.2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"MonitorIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M15,2L1,2C0.45,2,0,2.45,0,3L0,12C0,12.55,0.45,13,1,13L6.34,13C6.09,13.61,5.48,14.39,4,15L12,15C10.52,14.39,9.91,13.61,9.66,13L15,13C15.55,13,16,12.55,16,12L16,3C16,2.45,15.55,2,15,2z M15,11L1,11 1,3 15,3 15,11z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"AddBookmarkIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M12,8L12,1C12,0.45,11.55,0,11,0L1,0C0.45,0,0,0.45,0,1L0,13C0,13.55,0.45,14,1,14L3,14 3,16 4.5,14.5 6,16 6,12 3,12 3,13 1,13 1,11 8,11 8,10 2,10 2,1 11,1 11,8 12,8z M4,2L3,2 3,3 4,3 4,2z M3,4L4,4 4,5 3,5 3,4z M4,6L3,6 3,7 4,7 4,6z M4,9L3,9 3,8 4,8 4,9z M10,12L8,12 8,14 10,14 10,16 12,16 12,14 14,14 14,12 12,12 12,10 10,10 10,12z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DocumentIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M6,5L2,5 2,4 6,4 6,5z M2,8L9,8 9,7 2,7 2,8z M2,10L9,10 9,9 2,9 2,10z M2,12L9,12 9,11 2,11 2,12z M12,4.5L12,14C12,14.55,11.55,15,11,15L1,15C0.45,15,0,14.55,0,14L0,2C0,1.45,0.45,1,1,1L8.5,1 12,4.5z M11,5L8,2 1,2 1,14 11,14 11,5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"BlockIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M11.41,9L0.59,9C0,9 0,8.59 0,8 0,7.41 0,7 0.59,7L11.4,7C11.99,7 11.99,7.41 11.99,8 11.99,8.59 11.99,9 11.4,9L11.41,9z M11.41,5L0.59,5C0,5 0,4.59 0,4 0,3.41 0,3 0.59,3L11.4,3C11.99,3 11.99,3.41 11.99,4 11.99,4.59 11.99,5 11.4,5L11.41,5z M0.59,11L11.4,11C11.99,11 11.99,11.41 11.99,12 11.99,12.59 11.99,13 11.4,13L0.59,13C0,13 0,12.59 0,12 0,11.41 0,11 0.59,11z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"BookmarkArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M13,8L13,6 7,6 7,4 13,4 13,2 16,5 13,8z M4,2L3,2 3,3 4,3 4,2z M11,7L12,7 12,13C12,13.55,11.55,14,11,14L6,14 6,16 4.5,14.5 3,16 3,14 1,14C0.45,14,0,13.55,0,13L0,1C0,0.45,0.45,0,1,0L11,0C11.55,0,12,0.45,12,1L12,3 11,3 11,1 2,1 2,10 11,10 11,7z M11,11L1,11 1,13 3,13 3,12 6,12 6,13 11,13 11,11z M4,6L3,6 3,7 4,7 4,6z M4,4L3,4 3,5 4,5 4,4z M3,9L4,9 4,8 3,8 3,9z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"BoldUpArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\" Geometry=\"F0 M12,16z M0,0z M12,11L6,5 0,11 12,11z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"BoldDownArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\" Geometry=\"F0 M12,16z M0,0z M0,5L6,11 12,5 0,5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ClipboardIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M2,13L6,13 6,14 2,14 2,13z M7,7L2,7 2,8 7,8 7,7z M9,10L9,8 6,11 9,14 9,12 14,12 14,10 9,10z M4.5,9L2,9 2,10 4.5,10 4.5,9z M2,12L4.5,12 4.5,11 2,11 2,12z M11,13L12,13 12,15C11.98,15.28 11.89,15.52 11.7,15.7 11.51,15.88 11.28,15.98 11,16L1,16C0.45,16,0,15.55,0,15L0,4C0,3.45,0.45,3,1,3L4,3C4,1.89 4.89,1 6,1 7.11,1 8,1.89 8,3L11,3C11.55,3,12,3.45,12,4L12,9 11,9 11,6 1,6 1,15 11,15 11,13z M2,5L10,5C10,4.45,9.55,4,9,4L8,4C7.45,4 7,3.55 7,3 7,2.45 6.55,2 6,2 5.45,2 5,2.45 5,3 5,3.55 4.55,4 4,4L3,4C2.45,4,2,4.45,2,5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"JumpIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M8.5,1L1,1C0.45,1,0,1.45,0,2L0,14C0,14.55,0.45,15,1,15L11,15C11.55,15,12,14.55,12,14L12,4.5 8.5,1z M11,14L1,14 1,2 8,2 11,5 11,14z M6,4.5L10,7.5 6,10.5 6,8.5C5.02,8.48 4.16,8.72 3.45,9.2 2.74,9.68 2.26,10.45 2,11.5 2.02,9.86 2.39,8.62 3.13,7.77 3.86,6.93 4.82,6.5 6.01,6.5L6.01,4.5 6,4.5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LockIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M4,13L3,13 3,12 4,12 4,13z M12,7L12,14C12,14.55,11.55,15,11,15L1,15C0.45,15,0,14.55,0,14L0,7C0,6.45,0.45,6,1,6L2,6 2,4C2,1.8 3.8,0 6,0 8.2,0 10,1.8 10,4L10,6 11,6C11.55,6,12,6.45,12,7z M3.8,6L8.21,6 8.21,4C8.21,2.78 7.23,1.8 6.01,1.8 4.79,1.8 3.81,2.78 3.81,4L3.81,6 3.8,6z M11,7L2,7 2,14 11,14 11,7z M4,8L3,8 3,9 4,9 4,8z M4,10L3,10 3,11 4,11 4,10z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"AddLockIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M12,6C12,5.45,11.55,5,11,5L10,5 10,4C10,1.8 8.2,0 6,0 3.8,0 2,1.8 2,4L2,5 1,5C0.45,5,0,5.45,0,6L0,13C0,13.55,0.45,14,1,14L6,14 6,13 2,13 2,6 11,6 11,8 12,8 12,6z M8.21,5L8.21,4C8.21,2.78 7.23,1.8 6.01,1.8 4.79,1.8 3.81,2.78 3.81,4L3.81,5 8.21,5z M12,12L14,12 14,14 12,14 12,16 10,16 10,14 8,14 8,12 10,12 10,10 12,10 12,12z M3,12L4,12 4,11 3,11 3,12z M3,7L4,7 4,8 3,8 3,7z M4,9L3,9 3,10 4,10 4,9z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"VersionsIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M13,3L7,3C6.45,3,6,3.45,6,4L6,12C6,12.55,6.45,13,7,13L13,13C13.55,13,14,12.55,14,12L14,4C14,3.45,13.55,3,13,3z M12,11L8,11 8,5 12,5 12,11z M4,4L5,4 5,5 4,5 4,11 5,11 5,12 4,12C3.45,12,3,11.55,3,11L3,5C3,4.45,3.45,4,4,4z M1,5L2,5 2,6 1,6 1,10 2,10 2,11 1,11C0.45,11,0,10.55,0,10L0,6C0,5.45,0.45,5,1,5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"StarIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M14,6L9.1,5.36 7,1 4.9,5.36 0,6 3.6,9.26 2.67,14 7,11.67 11.33,14 10.4,9.26 14,6z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"StarIconYellow\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#E0AC00\"\n                         Geometry=\"F0 M14,16z M0,0z M14,6L9.1,5.36 7,1 4.9,5.36 0,6 3.6,9.26 2.67,14 7,11.67 11.33,14 10.4,9.26 14,6z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"StarIconRed\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#CC0000\"\n                         Geometry=\"F0 M14,16z M0,0z M14,6L9.1,5.36 7,1 4.9,5.36 0,6 3.6,9.26 2.67,14 7,11.67 11.33,14 10.4,9.26 14,6z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SwitchIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V1000 H1000 V0 H0 Z\">\n        <DrawingGroup Opacity=\"1\">\n          <GeometryDrawing Brush=\"#FF000000\"\n                           Geometry=\"F1 M1000,1000z M0,0z M700,258C700,258 700,398 700,398 700,398 200,398 200,398 200,398 200,488 200,488 200,488 0,328 0,328 0,328 200,158 200,158 200,158 200,258 200,258 200,258 700,258 700,258 700,258 700,258 700,258 M1000,678C1000,678 800,838 800,838 800,838 800,748 800,748 800,748 300,748 300,748 300,748 300,608 300,608 300,608 800,608 800,608 800,608 800,508 800,508 800,508 1000,678 1000,678\" />\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SideBySideIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M9.5,3L8,4.5 11.5,8 8,11.5 9.5,13 14,8 9.5,3z M4.5,3L0,8 4.5,13 6,11.5 2.5,8 6,4.5 4.5,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DockLeftIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H8 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M8,16z M0,0z M5.5,3L7,4.5 3.25,8 7,11.5 5.5,13 0.5,8 5.5,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DockRightIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H8 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M8,16z M0,0z M7.5,8L2.5,13 1,11.5 4.75,8 1,4.5 2.5,3 7.5,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"BookIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M3,5L7,5 7,6 3,6 3,5z M3,8L7,8 7,7 3,7 3,8z M3,10L7,10 7,9 3,9 3,10z M14,5L10,5 10,6 14,6 14,5z M14,7L10,7 10,8 14,8 14,7z M14,9L10,9 10,10 14,10 14,9z M16,3L16,12C16,12.55,15.55,13,15,13L9.5,13 8.5,14 7.5,13 2,13C1.45,13,1,12.55,1,12L1,3C1,2.45,1.45,2,2,2L7.5,2 8.5,3 9.5,2 15,2C15.55,2,16,2.45,16,3z M8,3.5L7.5,3 2,3 2,12 8,12 8,3.5z M15,3L9.5,3 9,3.5 9,12 15,12 15,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DiffIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M5,12L4,12C3.73,11.98 3.52,11.89 3.31,11.69 3.1,11.49 3.01,11.27 3,11L3,4.72A1.993,1.993,0,0,0,2,1A1.993,1.993,0,0,0,1,4.72L1,11C1.03,11.78 1.34,12.47 1.94,13.06 2.54,13.65 3.22,13.97 4,14L5,14 5,16 8,13 5,10 5,12z M2,1.8C2.66,1.8 3.2,2.35 3.2,3 3.2,3.65 2.65,4.2 2,4.2 1.35,4.2 0.8,3.65 0.8,3 0.8,2.35 1.35,1.8 2,1.8z M13,11.28L13,5C12.97,4.22 12.66,3.53 12.06,2.94 11.46,2.35 10.78,2.03 10,2L9,2 9,0 6,3 9,6 9,4 10,4C10.27,4.02 10.48,4.11 10.69,4.31 10.9,4.51 10.99,4.73 11,5L11,11.28A1.993,1.993,0,0,0,12,15A1.993,1.993,0,0,0,13,11.28z M12,14.2C11.34,14.2 10.8,13.65 10.8,13 10.8,12.35 11.35,11.8 12,11.8 12.65,11.8 13.2,12.35 13.2,13 13.2,13.65 12.65,14.2 12,14.2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SearchListIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H13 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M13,16z M0,0z M12.01,13C12.01,13.59,12.01,14,11.42,14L4.6,14C4.01,14 4.01,13.59 4.01,13 4.01,12.41 4.01,12 4.6,12L11.41,12C12,12,12,12.41,12,13L12.01,13z M4.6,4L11.41,4C12,4 12,3.59 12,3 12,2.41 12,2 11.41,2L4.6,2C4.01,2 4.01,2.41 4.01,3 4.01,3.59 4.01,4 4.6,4z M11.41,7L4.6,7C4.01,7 4.01,7.41 4.01,8 4.01,8.59 4.01,9 4.6,9L11.41,9C12,9 12,8.59 12,8 12,7.41 12,7 11.41,7z M2.01,1L1.29,1C0.99,1.19,0.71,1.25,0.26,1.34L0.26,2 1.01,2 1.01,4.14 0.17,4.14 0.17,5 3.01,5 3.01,4.14 2.01,4.14 2.01,1z M2.402,9.12C2.273,9.12 1.81,9.16 1.6,9.19 2.13,8.63 2.74,7.94 2.74,7.3 2.72,6.52 2.18,6 1.38,6 0.79,6 0.41,6.2 0,6.64L0.58,7.22C0.77,7.03 0.96,6.84 1.22,6.84 1.5,6.84 1.7,7 1.7,7.36 1.7,7.89 0.93,8.56 0,9.42L0,10 3,10 3,9.12 2.402,9.12z M2.18,12.91L2.18,12.88C2.62,12.69 2.82,12.41 2.82,12.02 2.82,11.32 2.26,10.91 1.38,10.91 0.9,10.91 0.49,11.1 0.0999999999999999,11.43L0.65,12.07C0.9,11.87 1.09,11.76 1.34,11.76 1.61,11.76 1.76,11.89 1.76,12.12 1.76,12.39 1.56,12.56 0.9,12.56L0.9,13.31C1.73,13.31 1.88,13.48 1.88,13.78 1.88,14.03 1.65,14.16 1.3,14.16 1.02,14.16 0.74,14.02 0.49,13.78L0.00999999999999979,14.44C0.31,14.8 0.78,15 1.42,15 2.25,15 2.95,14.59 2.95,13.84 2.95,13.34 2.64,13.03 2.18,12.9L2.18,12.91z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ListIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M2,13C2,13.59,2,14,1.41,14L0.59,14C0,14 0,13.59 0,13 0,12.41 0,12 0.59,12L1.4,12C1.99,12,1.99,12.41,1.99,13L2,13z M4.59,4L11.4,4C11.99,4 11.99,3.59 11.99,3 11.99,2.41 11.99,2 11.4,2L4.59,2C4,2 4,2.41 4,3 4,3.59 4,4 4.59,4z M1.41,7L0.59,7C0,7 0,7.41 0,8 0,8.59 0,9 0.59,9L1.4,9C1.99,9 1.99,8.59 1.99,8 1.99,7.41 1.99,7 1.4,7L1.41,7z M1.41,2L0.59,2C0,2 0,2.41 0,3 0,3.59 0,4 0.59,4L1.4,4C1.99,4 1.99,3.59 1.99,3 1.99,2.41 1.99,2 1.4,2L1.41,2z M11.41,7L4.59,7C4,7 4,7.41 4,8 4,8.59 4,9 4.59,9L11.4,9C11.99,9 11.99,8.59 11.99,8 11.99,7.41 11.99,7 11.4,7L11.41,7z M11.41,12L4.59,12C4,12 4,12.41 4,13 4,13.59 4,14 4.59,14L11.4,14C11.99,14 11.99,13.59 11.99,13 11.99,12.41 11.99,12 11.4,12L11.41,12z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"CaseIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H18 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M18,16z M0,0z M13.62,9.08L12.1,3.66 12.04,3.66 10.54,9.08 13.62,9.08z M5.7,10.13C5.7,10.13,4.68,6.52,4.53,6.02L4.45,6.02 3.32,10.13 5.7,10.13z M17.31,14L15.06,14 14.11,10.75 10.04,10.75 9.09,14 6.84,14 6.15,11.67 2.87,11.67 2.17,14 0,14 3.3,4.41 5.8,4.41 7.97,10.75 10.86,2 13.38,2 17.32,14 17.31,14z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"WholeWordIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M6.16,3.5C3.73,5.06 2.55,6.67 2.55,9.36 2.71,9.31 2.85,9.31 2.99,9.31 4.26,9.31 5.49,10.17 5.49,11.72 5.49,13.33 4.46,14.33 2.99,14.33 1.09,14.33 0,12.81 0,10.08 0,6.28 1.75,3.55 5.02,1.66L6.16,3.5z M13.16,3.5C10.73,5.06 9.55,6.67 9.55,9.36 9.71,9.31 9.85,9.31 9.99,9.31 11.26,9.31 12.49,10.17 12.49,11.72 12.49,13.33 11.46,14.33 9.99,14.33 8.1,14.33 7.01,12.81 7.01,10.08 7.01,6.28 8.76,3.55 12.03,1.66L13.17,3.5 13.16,3.5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DatabaseIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M6,15C2.69,15,0,14.1,0,13L0,11C0,10.83 0.09,10.66 0.21,10.5 0.88,11.36 3.21,12 6,12 8.79,12 11.12,11.36 11.79,10.5 11.92,10.66 12,10.83 12,11L12,13C12,14.1,9.31,15,6,15z M6,11C2.69,11,0,10.1,0,9L0,7C0,6.89 0.04,6.79 0.09,6.69 0.12,6.63 0.16,6.56 0.21,6.5 0.88,7.36 3.21,8 6,8 8.79,8 11.12,7.36 11.79,6.5 11.84,6.56 11.88,6.63 11.91,6.69 11.96,6.79 12,6.9 12,7L12,9C12,10.1,9.31,11,6,11z M6,7C2.69,7,0,6.1,0,5L0,3C0,1.9 2.69,1 6,1 9.31,1 12,1.9 12,3L12,5C12,6.1,9.31,7,6,7z M6,2C3.79,2 2,2.45 2,3 2,3.55 3.79,4 6,4 8.21,4 10,3.55 10,3 10,2.45 8.21,2 6,2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"CloseIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M7.48,8L11.23,11.75 9.75,13.23 6,9.48 2.25,13.23 0.77,11.75 4.52,8 0.77,4.25 2.25,2.77 6,6.52 9.75,2.77 11.23,4.25 7.48,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ExecuteIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF222222\"\n                         Geometry=\"F0 M14,16z M0,0z M14,8A7,7,0,1,1,0,8A7,7,0,0,1,14,8z M5.777,11.482L10.376,8.416A0.5,0.5,0,0,0,10.376,7.584L5.777,4.518A0.5,0.5,0,0,0,5,4.934L5,11.066A0.5,0.5,0,0,0,5.777,11.482z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ExecuteIconColor\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#267F00\"\n                         Geometry=\"F0 M14,16z M0,0z M14,8A7,7,0,1,1,0,8A7,7,0,0,1,14,8z M5.777,11.482L10.376,8.416A0.5,0.5,0,0,0,10.376,7.584L5.777,4.518A0.5,0.5,0,0,0,5,4.934L5,11.066A0.5,0.5,0,0,0,5.777,11.482z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"WordWrapIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M9.5,3L8,4.5 11.5,8 8,11.5 9.5,13 14,8 9.5,3z M4.5,3L0,8 4.5,13 6,11.5 2.5,8 6,4.5 4.5,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"TasklistIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M15.41,9L7.59,9C7,9 7,8.59 7,8 7,7.41 7,7 7.59,7L15.4,7C15.99,7 15.99,7.41 15.99,8 15.99,8.59 15.99,9 15.4,9L15.41,9z M9.59,4C9,4 9,3.59 9,3 9,2.41 9,2 9.59,2L15.4,2C15.99,2 15.99,2.41 15.99,3 15.99,3.59 15.99,4 15.4,4L9.59,4z M0,3.91L1.41,2.61 3,4.2 7.09,0 8.5,1.41 3,6.91 0,3.91z M7.59,12L15.4,12C15.99,12 15.99,12.41 15.99,13 15.99,13.59 15.99,14 15.4,14L7.59,14C7,14 7,13.59 7,13 7,12.41 7,12 7.59,12z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"StyleIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M6,0C2.69,0,0,2.69,0,6L0,7C0,7.55,0.45,8,1,8L1,13C1,14.1 3.24,15 6,15 8.76,15 11,14.1 11,13L11,8C11.55,8,12,7.55,12,7L12,6C12,2.69,9.31,0,6,0z M9,10L9,10.5C9,10.78 8.78,11 8.5,11 8.22,11 8,10.78 8,10.5L8,10C8,9.72 7.78,9.5 7.5,9.5 7.22,9.5 7,9.72 7,10L7,12.5C7,12.78 6.78,13 6.5,13 6.22,13 6,12.78 6,12.5L6,10.5C6,10.22 5.78,10 5.5,10 5.22,10 5,10.22 5,10.5L5,11C5,11.55 4.55,12 4,12 3.45,12 3,11.55 3,11L3,10C2.45,10,2,9.55,2,9L2,7.2C2.91,7.69 4.36,8 6,8 7.64,8 9.09,7.69 10,7.2L10,9C10,9.55,9.55,10,9,10z M6,7C4.32,7 2.88,6.59 2.29,6 2.88,5.41 4.32,5 6,5 7.68,5 9.12,5.41 9.71,6 9.12,6.59 7.68,7 6,7z M6,4C3.24,4 1,4.89 1,6 1,3.24 3.24,1 6,1 8.76,1 11,3.24 11,6 11,4.9 8.76,4 6,4z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"EditIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M0,12L0,15 3,15 11,7 8,4 0,12z M3,14L1,14 1,12 2,12 2,13 3,13 3,14z M13.3,4.7L12,6 9,3 10.3,1.7A0.996,0.996,0,0,1,11.71,1.7L13.3,3.29C13.69,3.68,13.69,4.31,13.3,4.7z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"WarningIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M8.893,1.5C8.71,1.19 8.373,1 8.006,1 7.639,1 7.303,1.19 7.12,1.5L0.138,13.499A0.98,0.98,0,0,0,0.138,14.5C0.331,14.81,0.668,15.001,1.024,15.001L14.988,15.001C15.355,15.001,15.692,14.811,15.865,14.501A1.03,1.03,0,0,0,15.875,13.499L8.893,1.5z M9.026,12.997L6.987,12.997 6.987,10.994 9.026,10.994 9.026,12.997z M9.026,9.993L6.987,9.993 6.987,5.987 9.026,5.987 9.026,9.993z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"WarningIconColor\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FFE25A00\"\n                         Geometry=\"F0 M16,16z M0,0z M8.893,1.5C8.71,1.19 8.373,1 8.006,1 7.639,1 7.303,1.19 7.12,1.5L0.138,13.499A0.98,0.98,0,0,0,0.138,14.5C0.331,14.81,0.668,15.001,1.024,15.001L14.988,15.001C15.355,15.001,15.692,14.811,15.865,14.501A1.03,1.03,0,0,0,15.875,13.499L8.893,1.5z M9.026,12.997L6.987,12.997 6.987,10.994 9.026,10.994 9.026,12.997z M9.026,9.993L6.987,9.993 6.987,5.987 9.026,5.987 9.026,9.993z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ZapIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M10,16z M0,0z M10,7L6,7 9,0 0,9 4,9 1,16 10,7z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"QuestionIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"0.0099999997764825821\" Y=\"0.0099999997764825821\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FF000000\"\n                             Geometry=\"F0 M16,16z M0,0z M15.67,7.06L14.59,5.72C14.42,5.5,14.31,5.24,14.28,4.95L14.09,3.25C14.01,2.55,13.46,2,12.76,1.92L11.06,1.73C10.76,1.7,10.5,1.57,10.28,1.4L8.94,0.32C8.39,-0.12,7.61,-0.12,7.06,0.32L5.72,1.4C5.5,1.57,5.24,1.68,4.95,1.71L3.25,1.9C2.55,1.98,2,2.53,1.92,3.23L1.73,4.93C1.7,5.23,1.57,5.49,1.4,5.71L0.32,7.05C-0.12,7.6,-0.12,8.38,0.32,8.93L1.4,10.27C1.57,10.49,1.68,10.75,1.71,11.04L1.9,12.74C1.98,13.44,2.53,13.99,3.23,14.07L4.93,14.26C5.23,14.29,5.49,14.42,5.71,14.59L7.05,15.67C7.6,16.11,8.38,16.11,8.93,15.67L10.27,14.59C10.49,14.42,10.75,14.31,11.04,14.28L12.74,14.09C13.44,14.01,13.99,13.46,14.07,12.76L14.26,11.06C14.29,10.76,14.42,10.5,14.59,10.28L15.67,8.94C16.11,8.39,16.11,7.61,15.67,7.06L15.67,7.06z M9,11.5C9,11.78,8.78,12,8.5,12L7.5,12C7.23,12,7,11.78,7,11.5L7,10.5C7,10.22,7.23,10,7.5,10L8.5,10C8.78,10,9,10.22,9,10.5L9,11.5 9,11.5z M10.56,6.61C10.5,6.78 10.39,6.94 10.26,7.08 10.13,7.24 10.12,7.27 9.93,7.46 9.77,7.63 9.62,7.76 9.41,7.91 9.3,8 9.21,8.1 9.13,8.18 9.05,8.26 8.99,8.35 8.94,8.45 8.89,8.55 8.86,8.64 8.83,8.75 8.8,8.86 8.8,8.88 8.8,9L7.13,9C7.13,8.78 7.13,8.69 7.16,8.52 7.19,8.33 7.24,8.16 7.3,8 7.36,7.86 7.44,7.72 7.55,7.58 7.66,7.45 7.78,7.33 7.96,7.2 8.23,7.01 8.32,6.9 8.44,6.68 8.56,6.46 8.64,6.3 8.64,6.09 8.64,5.82 8.58,5.64 8.44,5.51 8.31,5.38 8.13,5.32 7.86,5.32 7.77,5.32 7.67,5.34 7.56,5.37 7.45,5.4 7.39,5.46 7.31,5.53 7.23,5.6 7.17,5.64 7.11,5.73 7.05,5.82 7.02,5.87 7.02,6.01L5.02,6.01C5.02,5.63 5.15,5.45 5.29,5.18 5.45,4.91 5.65,4.68 5.9,4.51 6.15,4.34 6.45,4.21 6.78,4.13 7.11,4.05 7.48,4 7.87,4 8.31,4 8.7,4.05 9.04,4.13 9.38,4.22 9.67,4.35 9.92,4.52 10.15,4.69 10.33,4.9 10.47,5.15 10.6,5.4 10.66,5.7 10.66,6.03 10.66,6.25 10.66,6.45 10.58,6.62L10.56,6.61z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"QuestionIconColor\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"0.0099999997764825821\" Y=\"0.0099999997764825821\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#001487\"\n                             Geometry=\"F0 M16,16z M0,0z M15.67,7.06L14.59,5.72C14.42,5.5,14.31,5.24,14.28,4.95L14.09,3.25C14.01,2.55,13.46,2,12.76,1.92L11.06,1.73C10.76,1.7,10.5,1.57,10.28,1.4L8.94,0.32C8.39,-0.12,7.61,-0.12,7.06,0.32L5.72,1.4C5.5,1.57,5.24,1.68,4.95,1.71L3.25,1.9C2.55,1.98,2,2.53,1.92,3.23L1.73,4.93C1.7,5.23,1.57,5.49,1.4,5.71L0.32,7.05C-0.12,7.6,-0.12,8.38,0.32,8.93L1.4,10.27C1.57,10.49,1.68,10.75,1.71,11.04L1.9,12.74C1.98,13.44,2.53,13.99,3.23,14.07L4.93,14.26C5.23,14.29,5.49,14.42,5.71,14.59L7.05,15.67C7.6,16.11,8.38,16.11,8.93,15.67L10.27,14.59C10.49,14.42,10.75,14.31,11.04,14.28L12.74,14.09C13.44,14.01,13.99,13.46,14.07,12.76L14.26,11.06C14.29,10.76,14.42,10.5,14.59,10.28L15.67,8.94C16.11,8.39,16.11,7.61,15.67,7.06L15.67,7.06z M9,11.5C9,11.78,8.78,12,8.5,12L7.5,12C7.23,12,7,11.78,7,11.5L7,10.5C7,10.22,7.23,10,7.5,10L8.5,10C8.78,10,9,10.22,9,10.5L9,11.5 9,11.5z M10.56,6.61C10.5,6.78 10.39,6.94 10.26,7.08 10.13,7.24 10.12,7.27 9.93,7.46 9.77,7.63 9.62,7.76 9.41,7.91 9.3,8 9.21,8.1 9.13,8.18 9.05,8.26 8.99,8.35 8.94,8.45 8.89,8.55 8.86,8.64 8.83,8.75 8.8,8.86 8.8,8.88 8.8,9L7.13,9C7.13,8.78 7.13,8.69 7.16,8.52 7.19,8.33 7.24,8.16 7.3,8 7.36,7.86 7.44,7.72 7.55,7.58 7.66,7.45 7.78,7.33 7.96,7.2 8.23,7.01 8.32,6.9 8.44,6.68 8.56,6.46 8.64,6.3 8.64,6.09 8.64,5.82 8.58,5.64 8.44,5.51 8.31,5.38 8.13,5.32 7.86,5.32 7.77,5.32 7.67,5.34 7.56,5.37 7.45,5.4 7.39,5.46 7.31,5.53 7.23,5.6 7.17,5.64 7.11,5.73 7.05,5.82 7.02,5.87 7.02,6.01L5.02,6.01C5.02,5.63 5.15,5.45 5.29,5.18 5.45,4.91 5.65,4.68 5.9,4.51 6.15,4.34 6.45,4.21 6.78,4.13 7.11,4.05 7.48,4 7.87,4 8.31,4 8.7,4.05 9.04,4.13 9.38,4.22 9.67,4.35 9.92,4.52 10.15,4.69 10.33,4.9 10.47,5.15 10.6,5.4 10.66,5.7 10.66,6.03 10.66,6.25 10.66,6.45 10.58,6.62L10.56,6.61z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DotIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H8 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#515151\"\n                         Geometry=\"F0 M8,16z M0,0z M0,8C0,5.8 1.8,4 4,4 6.2,4 8,5.8 8,8 8,10.2 6.2,12 4,12 1.8,12 0,10.2 0,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DotIconYellow\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H8 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#E0AC00\"\n                         Geometry=\"F0 M8,16z M0,0z M0,8C0,5.8 1.8,4 4,4 6.2,4 8,5.8 8,8 8,10.2 6.2,12 4,12 1.8,12 0,10.2 0,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DotIconTransparent\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H8 V0 H0 Z\">\n        <GeometryDrawing Brush=\"Transparent\"\n                         Geometry=\"F0 M8,16z M0,0z M0,8C0,5.8 1.8,4 4,4 6.2,4 8,5.8 8,8 8,10.2 6.2,12 4,12 1.8,12 0,10.2 0,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DotIconRed\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H8 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#CC0000\"\n                         Geometry=\"F0 M8,16z M0,0z M0,8C0,5.8 1.8,4 4,4 6.2,4 8,5.8 8,8 8,10.2 6.2,12 4,12 1.8,12 0,10.2 0,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"GraphIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M12,16z M0,0z M10,7C9.27,7,8.62,7.41,8.27,8.02L8.27,8C7.22,7.98 6,7.64 5.14,6.98 4.39,6.4 3.64,5.37 3.25,4.54A1.993,1.993,0,0,0,2,0.99C0.89,0.99,0,1.89,0,3A2,2,0,0,0,1,4.72L1,11.28C0.41,11.63 0,12.27 0,13 0,14.11 0.89,15 2,15A1.993,1.993,0,0,0,3,11.28L3,7.67C3.67,8.37 4.44,8.94 5.3,9.36 6.16,9.78 7.33,9.99 8.27,10L8.27,9.98C8.63,10.59 9.27,11 10,11 11.11,11 12,10.11 12,9 12,7.89 11.11,7 10,7z M3.2,13C3.2,13.66 2.65,14.2 2,14.2 1.35,14.2 0.8,13.65 0.8,13 0.8,12.35 1.35,11.8 2,11.8 2.65,11.8 3.2,12.35 3.2,13z M2,4.2C1.34,4.2 0.8,3.65 0.8,3 0.8,2.35 1.35,1.8 2,1.8 2.65,1.8 3.2,2.35 3.2,3 3.2,3.65 2.65,4.2 2,4.2z M10,10.2C9.34,10.2 8.8,9.65 8.8,9 8.8,8.35 9.35,7.8 10,7.8 10.65,7.8 11.2,8.35 11.2,9 11.2,9.65 10.65,10.2 10,10.2z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"UploadIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M7,9L5,9 8,6 11,9 9,9 9,14 7,14 7,9z M12,5C12,4.56 11.09,2 7.5,2 5.08,2 3,3.92 3,6 1.02,6 0,7.52 0,9 0,10.53 1,12 3,12L6,12 6,10.7 3,10.7C1.38,10.7 1.3,9.28 1.3,9 1.3,8.83 1.35,7.3 3,7.3L4.3,7.3 4.3,6C4.3,4.61 5.86,3.3 7.5,3.3 10.05,3.3 10.63,4.85 10.7,5.1L10.7,6.3 12,6.3C12.81,6.3 14.7,6.52 14.7,8.5 14.7,10.59 12.45,10.7 12,10.7L10,10.7 10,12 12,12C14.08,12 16,10.84 16,8.5 16,6.06 14.08,5 12,5z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"RemarkIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M10,16z M0,0z M9,0L1,0C0.27,0,0,0.27,0,1L0,16 5,12.91 10,16 10,1C10,0.27,9.73,0,9,0z M8.22,4.25L6.36,5.61 7.08,7.77C7.14,7.99,7.06,8.05,6.88,7.94L5,6.6 3.12,7.94C2.93,8.05,2.87,7.99,2.92,7.77L3.64,5.61 1.78,4.25C1.61,4.09,1.64,4.02,1.87,4.02L4.17,3.99 4.87,1.83 5.12,1.83 5.82,3.99 8.12,4.02C8.35,4.02,8.39,4.1,8.21,4.25L8.22,4.25z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"WindowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M5,3L6,3 6,4 5,4 5,3z M3,3L4,3 4,4 3,4 3,3z M1,3L2,3 2,4 1,4 1,3z M13,13L1,13 1,5 13,5 13,13z M13,4L7,4 7,3 13,3 13,4z M14,3C14,2.45,13.55,2,13,2L1,2C0.45,2,0,2.45,0,3L0,13C0,13.55,0.45,14,1,14L13,14C13.55,14,14,13.55,14,13L14,3z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ConfigIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M4,7L3,7 3,2 4,2 4,7z M3,14L4,14 4,11 3,11 3,14z M8,14L9,14 9,8 8,8 8,14z M13,14L14,14 14,12 13,12 13,14z M14,2L13,2 13,8 14,8 14,2z M9,2L8,2 8,4 9,4 9,2z M5,8L2,8C1.45,8 1,8.45 1,9 1,9.55 1.45,10 2,10L5,10C5.55,10 6,9.55 6,9 6,8.45 5.55,8 5,8z M10,5L7,5C6.45,5 6,5.45 6,6 6,6.55 6.45,7 7,7L10,7C10.55,7 11,6.55 11,6 11,5.45 10.55,5 10,5z M15,9L12,9C11.45,9 11,9.45 11,10 11,10.55 11.45,11 12,11L15,11C15.55,11 16,10.55 16,10 16,9.45 15.55,9 15,9z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ExternalDiffIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V1792 H1792 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M1792,1792z M0,0z M224,1536L832,1536 832,384 192,384 192,1504Q192,1517 201.5,1526.5 211,1536 224,1536z M1600,1504L1600,384 960,384 960,1536 1568,1536Q1581,1536 1590.5,1526.5 1600,1517 1600,1504z M1728,288L1728,1504Q1728,1570 1681,1617 1634,1664 1568,1664L224,1664Q158,1664 111,1617 64,1570 64,1504L64,288Q64,222 111,175 158,128 224,128L1568,128Q1634,128 1681,175 1728,222 1728,288z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HistoryIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H13 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M13,16z M0,0z M6,7L8,7 8,8 6,8 6,10 5,10 5,8 3,8 3,7 5,7 5,5 6,5 6,7z M3,13L8,13 8,12 3,12 3,13z M7.5,2L11,5.5 11,15C11,15.55,10.55,16,10,16L1,16C0.45,16,0,15.55,0,15L0,3C0,2.45,0.45,2,1,2L7.5,2z M10,6L7,3 1,3 1,15 10,15 10,6z M8.5,0L3,0 3,1 8,1 12,5 12,13 13,13 13,4.5 8.5,0z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"CrosshairIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V474.27 H474.27 V0 H0 Z\">\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FF010002\"\n                             Geometry=\"F1 M474.27,474.27z M0,0z M237.135,474.27C368.103,474.27 474.27,368.103 474.27,237.135 474.27,106.167 368.103,0 237.135,0 106.167,0 0,106.167 0,237.135 0,368.103 106.167,474.27 237.135,474.27z M60.639,200.556C75.197,130.212,130.87,74.742,201.32,60.485L201.32,126.042 274.477,126.042 274.477,60.81C344.204,75.563,399.177,130.724,413.638,200.556L347.471,200.556 347.471,273.713 413.638,273.713C399.185,343.546,344.204,398.706,274.477,413.459L274.477,348.227 201.32,348.227 201.32,413.784C130.87,399.518,75.197,344.057,60.639,273.712L126.806,273.712 126.806,200.555 60.639,200.555z\" />\n            <GeometryDrawing Brush=\"#FF010002\">\n              <GeometryDrawing.Geometry>\n                <EllipseGeometry\n                  Center=\"239.842,237.135\"\n                  RadiusX=\"18.964\"\n                  RadiusY=\"18.964\" />\n              </GeometryDrawing.Geometry>\n            </GeometryDrawing>\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"QueryIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M14,16z M0,0z M11.5,8L8.8,5.4 6.6,8.5 5.5,1.6 2.38,8 0,8 0,10 3.6,10 4.5,8.2 5.4,13.6 9,8.5 10.6,10 14,10 14,8 11.5,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"EyeIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F0 M16,16z M0,0z M8.06,2C3,2 0,8 0,8 0,8 3,14 8.06,14 13,14 16,8 16,8 16,8 13,2 8.06,2z M8,12C5.8,12 4,10.22 4,8 4,5.8 5.8,4 8,4 10.22,4 12,5.8 12,8 12,10.22 10.22,12 8,12z M10,8C10,9.11 9.11,10 8,10 6.89,10 6,9.11 6,8 6,6.89 6.89,6 8,6 9.11,6 10,6.89 10,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"EyeIconTransparent\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#99000000\"\n                         Geometry=\"F0 M16,16z M0,0z M8.06,2C3,2 0,8 0,8 0,8 3,14 8.06,14 13,14 16,8 16,8 16,8 13,2 8.06,2z M8,12C5.8,12 4,10.22 4,8 4,5.8 5.8,4 8,4 10.22,4 12,5.8 12,8 12,10.22 10.22,12 8,12z M10,8C10,9.11 9.11,10 8,10 6.89,10 6,9.11 6,8 6,6.89 6.89,6 8,6 9.11,6 10,6.89 10,8z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"BellIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FF000000\"\n                             Geometry=\"F0 M14,16z M0,0z M14,12L14,13 0,13 0,12 0.73,11.42C1.5,10.65 1.54,8.87 1.92,7 2.69,3.23 6,2 6,2 6,1.45 6.45,1 7,1 7.55,1 8,1.45 8,2 8,2 11.39,3.23 12.16,7 12.54,8.88 12.58,10.66 13.35,11.42L14.01,12 14,12z M7,16C8.11,16,9,15.11,9,14L5,14C5,15.11,5.89,16,7,16L7,16z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FlameIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"1.9840985260088928E-05\" Y=\"0\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FF000000\"\n                             Geometry=\"F0 M12,16z M0,0z M5.05,0.31C5.86,2.48 5.46,3.69 4.53,4.62 3.55,5.67 1.98,6.45 0.9,7.98 -0.55,10.03 -0.8,14.51 4.43,15.68 2.23,14.52 1.76,11.16 4.13,9.07 3.52,11.1 4.66,12.4 6.07,11.93 7.46,11.46 8.37,12.46 8.34,13.6 8.32,14.38 8.03,15.04 7.21,15.41 10.63,14.82 11.99,11.99 11.99,9.85 11.99,7.01 9.46,6.63 10.74,4.24 9.22,4.37 8.71,5.37 8.85,6.99 8.94,8.07 7.83,8.79 6.99,8.32 6.32,7.91 6.33,7.13 6.93,6.54 8.18,5.31 8.68,2.45 5.05,0.32L5.03,0.3 5.05,0.31z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HotFlameIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"1.9840985260088928E-05\" Y=\"0\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"Firebrick\"\n                             Geometry=\"F0 M12,16z M0,0z M5.05,0.31C5.86,2.48 5.46,3.69 4.53,4.62 3.55,5.67 1.98,6.45 0.9,7.98 -0.55,10.03 -0.8,14.51 4.43,15.68 2.23,14.52 1.76,11.16 4.13,9.07 3.52,11.1 4.66,12.4 6.07,11.93 7.46,11.46 8.37,12.46 8.34,13.6 8.32,14.38 8.03,15.04 7.21,15.41 10.63,14.82 11.99,11.99 11.99,9.85 11.99,7.01 9.46,6.63 10.74,4.24 9.22,4.37 8.71,5.37 8.85,6.99 8.94,8.07 7.83,8.79 6.99,8.32 6.32,7.91 6.33,7.13 6.93,6.54 8.18,5.31 8.68,2.45 5.05,0.32L5.03,0.3 5.05,0.31z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HotFlameIcon1\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"1.9840985260088928E-05\" Y=\"0\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#EF0000\"\n                             Geometry=\"F0 M12,16z M0,0z M5.05,0.31C5.86,2.48 5.46,3.69 4.53,4.62 3.55,5.67 1.98,6.45 0.9,7.98 -0.55,10.03 -0.8,14.51 4.43,15.68 2.23,14.52 1.76,11.16 4.13,9.07 3.52,11.1 4.66,12.4 6.07,11.93 7.46,11.46 8.37,12.46 8.34,13.6 8.32,14.38 8.03,15.04 7.21,15.41 10.63,14.82 11.99,11.99 11.99,9.85 11.99,7.01 9.46,6.63 10.74,4.24 9.22,4.37 8.71,5.37 8.85,6.99 8.94,8.07 7.83,8.79 6.99,8.32 6.32,7.91 6.33,7.13 6.93,6.54 8.18,5.31 8.68,2.45 5.05,0.32L5.03,0.3 5.05,0.31z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HotFlameIcon2\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"1.9840985260088928E-05\" Y=\"0\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FFEF5B00\"\n                             Geometry=\"F0 M12,16z M0,0z M5.05,0.31C5.86,2.48 5.46,3.69 4.53,4.62 3.55,5.67 1.98,6.45 0.9,7.98 -0.55,10.03 -0.8,14.51 4.43,15.68 2.23,14.52 1.76,11.16 4.13,9.07 3.52,11.1 4.66,12.4 6.07,11.93 7.46,11.46 8.37,12.46 8.34,13.6 8.32,14.38 8.03,15.04 7.21,15.41 10.63,14.82 11.99,11.99 11.99,9.85 11.99,7.01 9.46,6.63 10.74,4.24 9.22,4.37 8.71,5.37 8.85,6.99 8.94,8.07 7.83,8.79 6.99,8.32 6.32,7.91 6.33,7.13 6.93,6.54 8.18,5.31 8.68,2.45 5.05,0.32L5.03,0.3 5.05,0.31z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HotFlameIcon3\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"1.9840985260088928E-05\" Y=\"0\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FFDC8C00\"\n                             Geometry=\"F0 M12,16z M0,0z M5.05,0.31C5.86,2.48 5.46,3.69 4.53,4.62 3.55,5.67 1.98,6.45 0.9,7.98 -0.55,10.03 -0.8,14.51 4.43,15.68 2.23,14.52 1.76,11.16 4.13,9.07 3.52,11.1 4.66,12.4 6.07,11.93 7.46,11.46 8.37,12.46 8.34,13.6 8.32,14.38 8.03,15.04 7.21,15.41 10.63,14.82 11.99,11.99 11.99,9.85 11.99,7.01 9.46,6.63 10.74,4.24 9.22,4.37 8.71,5.37 8.85,6.99 8.94,8.07 7.83,8.79 6.99,8.32 6.32,7.91 6.33,7.13 6.93,6.54 8.18,5.31 8.68,2.45 5.05,0.32L5.03,0.3 5.05,0.31z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HotFlameIconTransparent\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <DrawingGroup.Transform>\n          <TranslateTransform X=\"1.9840985260088928E-05\" Y=\"0\" />\n        </DrawingGroup.Transform>\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"Transparent\"\n                             Geometry=\"F0 M12,16z M0,0z M5.05,0.31C5.86,2.48 5.46,3.69 4.53,4.62 3.55,5.67 1.98,6.45 0.9,7.98 -0.55,10.03 -0.8,14.51 4.43,15.68 2.23,14.52 1.76,11.16 4.13,9.07 3.52,11.1 4.66,12.4 6.07,11.93 7.46,11.46 8.37,12.46 8.34,13.6 8.32,14.38 8.03,15.04 7.21,15.41 10.63,14.82 11.99,11.99 11.99,9.85 11.99,7.01 9.46,6.63 10.74,4.24 9.22,4.37 8.71,5.37 8.85,6.99 8.94,8.07 7.83,8.79 6.99,8.32 6.32,7.91 6.33,7.13 6.93,6.54 8.18,5.31 8.68,2.45 5.05,0.32L5.03,0.3 5.05,0.31z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FlameGraphIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M12,3L12,7 3,7 3,3 12,3z M16,17L16,21 3,21 3,17 16,17z M22,10L22,14 3,14 3,10 22,10z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"MergeIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H10 V0 H0 Z\">\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FF000000\"\n                             Geometry=\"F0 M10,16z M0,0z M8,1C6.89,1 6,1.89 6,3 6,3.73 6.41,4.38 7,4.72L7,6 5,8 3,6 3,4.72C3.59,4.38 4,3.74 4,3 4,1.89 3.11,1 2,1 0.89,1 0,1.89 0,3 0,3.73 0.41,4.38 1,4.72L1,6.5 4,9.5 4,11.28C3.41,11.62 3,12.26 3,13 3,14.11 3.89,15 5,15 6.11,15 7,14.11 7,13 7,12.27 6.59,11.62 6,11.28L6,9.5 9,6.5 9,4.72C9.59,4.38 10,3.74 10,3 10,1.89 9.11,1 8,1L8,1z M2,4.2C1.34,4.2 0.8,3.65 0.8,3 0.8,2.35 1.35,1.8 2,1.8 2.65,1.8 3.2,2.35 3.2,3 3.2,3.65 2.65,4.2 2,4.2L2,4.2z M5,14.2C4.34,14.2 3.8,13.65 3.8,13 3.8,12.35 4.35,11.8 5,11.8 5.65,11.8 6.2,12.35 6.2,13 6.2,13.65 5.65,14.2 5,14.2L5,14.2z M8,4.2C7.34,4.2 6.8,3.65 6.8,3 6.8,2.35 7.35,1.8 8,1.8 8.65,1.8 9.2,2.35 9.2,3 9.2,3.65 8.65,4.2 8,4.2L8,4.2z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LogoImage\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H16 V0 H0 Z\">\n        <DrawingGroup Opacity=\"1\">\n          <GeometryDrawing Brush=\"#FFD9ECFF\">\n            <GeometryDrawing.Geometry>\n              <EllipseGeometry\n                Center=\"7.963,8.485\"\n                RadiusX=\"6.8563\"\n                RadiusY=\"7.0461\" />\n            </GeometryDrawing.Geometry>\n          </GeometryDrawing>\n        </DrawingGroup>\n        <DrawingGroup Opacity=\"1\">\n          <GeometryDrawing Brush=\"#FF006BE4\"\n                           Geometry=\"F1 M16,16z M0,0z M14.31958,6.0548736C14.520385,6.6995629 14.63664,7.3759584 14.63664,8.0734911 14.63664,11.687979 11.698548,14.626072 8.0840598,14.626072 4.4695718,14.626072 1.5209105,11.687979 1.5209105,8.0734911 1.5209105,4.4590031 4.4590031,1.5209105 8.0734911,1.5209105 9.3417326,1.5209105 10.514856,1.8802456 11.529449,2.5143663L12.522905,1.5209105A7.8831773,7.8831773,0,0,0,8.0840598,0.1469823C3.6980583,0.1469823 0.1469823,3.6980583 0.1469823,8.0734911 0.1469823,12.448924 3.6980583,16 8.0734911,16 12.448924,16 16,12.448924 16,8.0734911 16,6.9849173 15.788626,5.9386181 15.376448,4.9980057z\" />\n          <GeometryDrawing Brush=\"#FF000000\"\n                           Geometry=\"F1 M16,16z M0,0z M16,1.7322841L15.471566,1.2038501 8.6019251,6.4881894C8.5385131,6.4670524 7.5450572,6.4881894 7.5450572,6.4881894 6.9637799,6.4881894 6.4881894,6.9637799 6.4881894,7.5450572L6.4881894,8.6019251C6.4881894,9.1832024,6.9637799,9.6587929,7.5450572,9.6587929L8.6019251,9.6587929C9.1832024,9.6587929,9.6587929,9.1832024,9.6587929,8.6019251L9.6587929,7.6296067z\" />\n          <GeometryDrawing Brush=\"#FF006E00\"\n                           Geometry=\"F1 M16,16z M0,0z M4.3744537,7.5450572L3.3175858,7.5450572 3.3175858,8.6019251 4.3744537,8.6019251z\" />\n          <GeometryDrawing Brush=\"#FFEFEA00\"\n                           Geometry=\"F1 M16,16z M0,0z M5.4313215,4.3744537L4.3744537,4.3744537 4.3744537,5.4313215 5.4313215,5.4313215z\" />\n          <GeometryDrawing Brush=\"#FFCB0000\"\n                           Geometry=\"F1 M16,16z M0,0z M12.829396,7.5450572L11.772529,7.5450572 11.772529,8.6019251 12.829396,8.6019251z\" />\n          <GeometryDrawing Brush=\"#FFFF6E00\"\n                           Geometry=\"F1 M16,16z M0,0z M8.6019251,4.3744537L7.5450572,4.3744537 7.5450572,3.3175858 8.6019251,3.3175858z\" />\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"CheckIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H12 V0 H0 Z\">\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FF006E00\"\n                             Geometry=\"F0 M12,16z M0,0z M12,5L12,5 4,13 0,9 1.5,7.5 4,10 10.5,3.5z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"VoidIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V16 H14 V0 H0 Z\">\n        <DrawingGroup Opacity=\"1\">\n          <DrawingGroup Opacity=\"1\">\n            <GeometryDrawing Brush=\"#FFCB0000\"\n                             Geometry=\"F0 M14,16z M0,0z M7,1C3.14,1 0,4.14 0,8 0,11.86 3.14,15 7,15 10.86,15 14,11.86 14,8 14,4.14 10.86,1 7,1L7,1z M7,2.3C8.3,2.3,9.5,2.74,10.47,3.47L2.47,11.47C1.74,10.5 1.3,9.3 1.3,8 1.3,4.86 3.86,2.3 7,2.3L7,2.3z M7,13.71C5.7,13.71,4.5,13.27,3.53,12.54L11.53,4.54C12.26,5.51 12.7,6.71 12.7,8.01 12.7,11.15 10.14,13.71 7,13.71L7,13.71z\" />\n          </DrawingGroup>\n        </DrawingGroup>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ZoomInIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M8,11L11,11 M14,11L11,11 M11,11L11,8 M11,11L11,14\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M17,17L21,21\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M3,11C3,15.4183 6.58172,19 11,19 13.213,19 15.2161,18.1015 16.6644,16.6493 18.1077,15.2022 19,13.2053 19,11 19,6.58172 15.4183,3 11,3 6.58172,3 3,6.58172 3,11z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ZoomOutIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M17,17L21,21\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M3,11C3,15.4183 6.58172,19 11,19 13.213,19 15.2161,18.1015 16.6644,16.6493 18.1077,15.2022 19,13.2053 19,11 19,6.58172 15.4183,3 11,3 6.58172,3 3,6.58172 3,11z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M8,11L14,11\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LayoutSplitIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M12,3L20.4,3C20.7314,3,21,3.26863,21,3.6L21,20.4C21,20.7314,20.7314,21,20.4,21L12,21 M12,3L3.6,3C3.26863,3,3,3.26863,3,3.6L3,20.4C3,20.7314,3.26863,21,3.6,21L12,21 M12,3L12,21\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LayoutLeftIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M20.4,3L3.6,3C3.26863,3,3,3.26863,3,3.6L3,20.4C3,20.7314,3.26863,21,3.6,21L20.4,21C20.7314,21,21,20.7314,21,20.4L21,3.6C21,3.26863,20.7314,3,20.4,3z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M14.25,9.75L14.25,21\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M21,9.75L14.25,9.75 3,9.75\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LayoutRightIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M3.6,3L20.4,3C20.7314,3,21,3.26863,21,3.6L21,20.4C21,20.7314,20.7314,21,20.4,21L3.6,21C3.26863,21,3,20.7314,3,20.4L3,3.6C3,3.26863,3.26863,3,3.6,3z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M9.75,9.75L9.75,21\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M3,9.75L21,9.75\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FilterIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M10,14L4,5 4,3 20,3 20,5 14,14 14,20 10,22 10,14z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FilterRemoveIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M6.92893,0.514648L21.0711,14.6568 19.6569,16.071 15.834,12.2486 14,14.9999 14,21.9999 10,21.9999 10,14.9999 4,5.99993 3,5.99993 3,3.99993 7.585,3.99965 5.51472,1.92886 6.92893,0.514648z M21,3.99993L21,5.99993 20,5.99993 18.085,8.87193 13.213,3.99993 21,3.99993z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LayoutOpenIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M2,19L2,5C2,3.89543,2.89543,3,4,3L20,3C21.1046,3,22,3.89543,22,5L22,19C22,20.1046,21.1046,21,20,21L4,21C2.89543,21,2,20.1046,2,19z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M2,7L22,7\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M5,5.01L5.01,4.99889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M8,5.01L8.01,4.99889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M11,5.01L11.01,4.99889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LayoutOpenNewIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M2,19L2,5C2,3.89543,2.89543,3,4,3L20,3C21.1046,3,22,3.89543,22,5L22,19C22,20.1046,21.1046,21,20,21L4,21C2.89543,21,2,20.1046,2,19z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M2,7L22,7\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M9,14L12,14 M15,14L12,14 M12,14L12,11 M12,14L12,17\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SaveIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M3,19L3,5C3,3.89543,3.89543,3,5,3L16.1716,3C16.702,3,17.2107,3.21071,17.5858,3.58579L20.4142,6.41421C20.7893,6.78929,21,7.29799,21,7.82843L21,19C21,20.1046,20.1046,21,19,21L5,21C3.89543,21,3,20.1046,3,19z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M8.6,9L15.4,9C15.7314,9,16,8.73137,16,8.4L16,3.6C16,3.26863,15.7314,3,15.4,3L8.6,3C8.26863,3,8,3.26863,8,3.6L8,8.4C8,8.73137,8.26863,9,8.6,9z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M6,13.6L6,21 18,21 18,13.6C18,13.2686,17.7314,13,17.4,13L6.6,13C6.26863,13,6,13.2686,6,13.6z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Flat\"\n              LineJoin=\"Miter\"\n              StartLineCap=\"Flat\"\n              Thickness=\"1.6\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"RootIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V1024 H895.875 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M895.875,1024z M0,0z M128,768L767.875,768 767.875,256 128,256 128,768z M255.938,384L639.938,384 639.938,640 255.938,640 255.938,384z M64,192.062L255.938,192.062 255.938,128.062 0,128.062 0,384 64,384 64,192.062z M64,640L0,640 0,895.938 255.938,895.938 255.938,832 64,832 64,640z M639.938,128.062L639.938,192.062 831.876,192.062 831.876,384 895.876,384 895.876,128.062 639.938,128.062z M831.875,832L639.938,832 639.938,895.938 895.876,895.938 895.876,640 831.876,640 831.876,832z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FlowChartIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V36 H36 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M36,36z M0,0z M9.8,18.8L26.2,18.8 26.2,21.88 27.8,21.88 27.8,17.2 18.8,17.2 18.8,14 17.2,14 17.2,17.2 8.2,17.2 8.2,21.88 9.8,21.88 9.8,18.8z\" />\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M36,36z M0,0z M14,23L4,23A2,2,0,0,0,2,25L2,31A2,2,0,0,0,4,33L14,33A2,2,0,0,0,16,31L16,25A2,2,0,0,0,14,23z M4,31L4,25 14,25 14,31z\" />\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M36,36z M0,0z M32,23L22,23A2,2,0,0,0,20,25L20,31A2,2,0,0,0,22,33L32,33A2,2,0,0,0,34,31L34,25A2,2,0,0,0,32,23z M22,31L22,25 32,25 32,31z\" />\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M36,36z M0,0z M13,13L23,13A2,2,0,0,0,25,11L25,5A2,2,0,0,0,23,3L13,3A2,2,0,0,0,11,5L11,11A2,2,0,0,0,13,13z M13,5L23,5 23,11 13,11z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"FlowChartSolidIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V36 H36 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M36,36z M0,0z M9.8,18.8L26.2,18.8 26.2,21.88 27.8,21.88 27.8,17.2 18.8,17.2 18.8,14 17.2,14 17.2,17.2 8.2,17.2 8.2,21.88 9.8,21.88 9.8,18.8z\" />\n        <GeometryDrawing Brush=\"#FF000000\">\n          <GeometryDrawing.Geometry>\n            <RectangleGeometry\n              RadiusX=\"2\"\n              RadiusY=\"2\"\n              Rect=\"2,23,14,10\" />\n          </GeometryDrawing.Geometry>\n        </GeometryDrawing>\n        <GeometryDrawing Brush=\"#FF000000\">\n          <GeometryDrawing.Geometry>\n            <RectangleGeometry\n              RadiusX=\"2\"\n              RadiusY=\"2\"\n              Rect=\"20,23,14,10\" />\n          </GeometryDrawing.Geometry>\n        </GeometryDrawing>\n        <GeometryDrawing Brush=\"#FF000000\">\n          <GeometryDrawing.Geometry>\n            <RectangleGeometry\n              RadiusX=\"2\"\n              RadiusY=\"2\"\n              Rect=\"11,3,14,10\" />\n          </GeometryDrawing.Geometry>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"TimelineIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M5,3L5,19 21,19 21,21 3,21 3,3 5,3z M20.2929,6.29289L21.7071,7.70711 16,13.4142 13,10.415 8.70711,14.7071 7.29289,13.2929 13,7.58579 16,10.585 20.2929,6.29289z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SummaryIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M20,22L4,22C3.44772,22,3,21.5523,3,21L3,3C3,2.44772,3.44772,2,4,2L20,2C20.5523,2,21,2.44772,21,3L21,21C21,21.5523,20.5523,22,20,22z M19,20L19,4 5,4 5,20 19,20z M8,7L16,7 16,9 8,9 8,7z M8,11L16,11 16,13 8,13 8,11z M8,15L16,15 16,17 8,17 8,15z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"GroupIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M11,4L21,4 21,6 11,6 11,4z M11,8L17,8 17,10 11,10 11,8z M11,14L21,14 21,16 11,16 11,14z M11,18L17,18 17,20 11,20 11,18z M3,4L9,4 9,10 3,10 3,4z M5,6L5,8 7,8 7,6 5,6z M3,14L9,14 9,20 3,20 3,14z M5,16L5,18 7,18 7,16 5,16z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"DetailsIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M20,22L4,22C3.44772,22,3,21.5523,3,21L3,3C3,2.44772,3.44772,2,4,2L20,2C20.5523,2,21,2.44772,21,3L21,21C21,21.5523,20.5523,22,20,22z M19,20L19,4 5,4 5,20 19,20z M7,6L11,6 11,10 7,10 7,6z M7,12L17,12 17,14 7,14 7,12z M7,16L17,16 17,18 7,18 7,16z M13,7L17,7 17,9 13,9 13,7z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"CombineIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M15,9L20.4,9C20.7314,9,21,9.26863,21,9.6L21,20.4C21,20.7314,20.7314,21,20.4,21L9.6,21C9.26863,21,9,20.7314,9,20.4L9,15\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing\n          Geometry=\"F1 M24,24z M0,0z M15,9L15,3.6C15,3.26863,14.7314,3,14.4,3L3.6,3C3.26863,3,3,3.26863,3,3.6L3,14.4C3,14.7314,3.26863,15,3.6,15L9,15\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ExcelIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M13.2,12L16,16 13.6,16 12,13.7143 10.4,16 8,16 10.8,12 8,8 10.4,8 12,10.2857 13.6,8 15,8 15,4 5,4 5,20 19,20 19,8 16,8 13.2,12z M3,2.9918C3,2.44405,3.44749,2,3.9985,2L16,2 20.9997,7 21,20.9925C21,21.5489,20.5551,22,20.0066,22L3.9934,22C3.44476,22,3,21.5447,3,21.0082L3,2.9918z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HelpIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M12,22C6.47715,22 2,17.5228 2,12 2,6.47715 6.47715,2 12,2 17.5228,2 22,6.47715 22,12 22,17.5228 17.5228,22 12,22z M12,20C16.4183,20 20,16.4183 20,12 20,7.58172 16.4183,4 12,4 7.58172,4 4,7.58172 4,12 4,16.4183 7.58172,20 12,20z M11,15L13,15 13,17 11,17 11,15z M13,13.3551L13,14 11,14 11,12.5C11,11.9477 11.4477,11.5 12,11.5 12.8284,11.5 13.5,10.8284 13.5,10 13.5,9.17157 12.8284,8.5 12,8.5 11.2723,8.5 10.6656,9.01823 10.5288,9.70577L8.56731,9.31346C8.88637,7.70919 10.302,6.5 12,6.5 13.933,6.5 15.5,8.067 15.5,10 15.5,11.5855 14.4457,12.9248 13,13.3551z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"RecordIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M12,22C6.47715,22 2,17.5228 2,12 2,6.47715 6.47715,2 12,2 17.5228,2 22,6.47715 22,12 22,17.5228 17.5228,22 12,22z M12,20C16.4183,20 20,16.4183 20,12 20,7.58172 16.4183,4 12,4 7.58172,4 4,7.58172 4,12 4,16.4183 7.58172,20 12,20z M12,15C10.3431,15 9,13.6569 9,12 9,10.3431 10.3431,9 12,9 13.6569,9 15,10.3431 15,12 15,13.6569 13.6569,15 12,15z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"TreeIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M10,2C10.5523,2,11,2.44772,11,3L11,7C11,7.55228,10.5523,8,10,8L8,8 8,10 13,10 13,9C13,8.44772,13.4477,8,14,8L20,8C20.5523,8,21,8.44772,21,9L21,13C21,13.5523,20.5523,14,20,14L14,14C13.4477,14,13,13.5523,13,13L13,12 8,12 8,18 13,18 13,17C13,16.4477,13.4477,16,14,16L20,16C20.5523,16,21,16.4477,21,17L21,21C21,21.5523,20.5523,22,20,22L14,22C13.4477,22,13,21.5523,13,21L13,20 7,20C6.44772,20,6,19.5523,6,19L6,8 4,8C3.44772,8,3,7.55228,3,7L3,3C3,2.44772,3.44772,2,4,2L10,2z M19,18L15,18 15,20 19,20 19,18z M19,10L15,10 15,12 19,12 19,10z M9,4L5,4 5,6 9,6 9,4z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ReloadIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M18.5374,19.5674C16.7844,21.0831 14.4993,22 12,22 6.47715,22 2,17.5228 2,12 2,6.47715 6.47715,2 12,2 17.5228,2 22,6.47715 22,12 22,14.1361 21.3302,16.1158 20.1892,17.7406L17,12 20,12C20,7.58172 16.4183,4 12,4 7.58172,4 4,7.58172 4,12 4,16.4183 7.58172,20 12,20 14.1502,20 16.1022,19.1517 17.5398,17.7716L18.5374,19.5674z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"AutoReloadIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M12,4C14.7486,4,17.1749,5.38626,18.6156,7.5L16,7.5 16,9.5 22,9.5 22,3.5 20,3.5 20,5.99936C18.1762,3.57166 15.2724,2 12,2 6.47715,2 2,6.47715 2,12L4,12C4,7.58172,7.58172,4,12,4z M20,12C20,16.4183 16.4183,20 12,20 9.25144,20 6.82508,18.6137 5.38443,16.5L8,16.5 8,14.5 2,14.5 2,20.5 4,20.5 4,18.0006C5.82381,20.4283 8.72764,22 12,22 17.5228,22 22,17.5228 22,12L20,12z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ToolIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M5.32894,3.27158C6.56203,2.8332 7.99181,3.10749 8.97878,4.09446 10.0997,5.21537 10.3014,6.90741 9.58382,8.23385L20.2925,18.9437 18.8783,20.3579 8.16933,9.64875C6.84277,10.3669 5.1502,10.1654 4.02903,9.04421 3.04178,8.05696 2.76761,6.62665 3.20652,5.39332L5.44325,7.63C6.02903,8.21578 6.97878,8.21578 7.56457,7.63 8.15035,7.04421 8.15035,6.09446 7.56457,5.50868L5.32894,3.27158z M15.6963,5.15512L18.8783,3.38736 20.2925,4.80157 18.5247,7.98355 16.757,8.3371 14.6356,10.4584 13.2214,9.04421 15.3427,6.92289 15.6963,5.15512z M8.97878,13.2868L10.393,14.7011 5.08969,20.0044C4.69917,20.3949 4.066,20.3949 3.67548,20.0044 3.31285,19.6417 3.28695,19.0699 3.59777,18.6774L3.67548,18.5902 8.97878,13.2868z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ReportIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M12.4142,5L21,5C21.5523,5,22,5.44772,22,6L22,20C22,20.5523,21.5523,21,21,21L3,21C2.44772,21,2,20.5523,2,20L2,4C2,3.44772,2.44772,3,3,3L10.4142,3 12.4142,5z M4,5L4,19 20,19 20,7 11.5858,7 9.58579,5 4,5z M11,9L13,9 13,17 11,17 11,9z M15,12L17,12 17,17 15,17 15,12z M7,14L9,14 9,17 7,17 7,14z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SidebarIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M5,5L13,5 13,19 5,19 5,5z M19,19L15,19 15,5 19,5 19,19z M4,3C3.44772,3,3,3.44772,3,4L3,20C3,20.5523,3.44772,21,4,21L20,21C20.5523,21,21,20.5523,21,20L21,4C21,3.44772,20.5523,3,20,3L4,3z M11,12L7,8.5 7,15.5 11,12z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ExpandIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M18,2L6,2\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M18,22L6,22\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M12,14L12,19 M12,19L15,16 M12,19L9,16\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M12,10L12,5 M12,5L15,8 M12,5L9,8\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ContractIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M18,2L6,2\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M18,22L6,22\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M12,5L12,10 M12,10L15,7 M12,10L9,7\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M12,19L12,14 M12,14L15,17 M12,14L9,17\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"InlineAssemblyIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M4,16L4.01,15.9889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M4,20L4.01,19.9889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M8,20L8.01,19.9889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M12,20L12.01,19.9889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M16,20L16.01,19.9889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M20,20L20.01,19.9889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M20,16L20.01,15.9889\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n        <GeometryDrawing Geometry=\"F1 M24,24z M0,0z M4,12L4,4 20,4 20,12 4,12z\">\n          <GeometryDrawing.Pen>\n            <Pen\n              Brush=\"#FF000000\"\n              EndLineCap=\"Round\"\n              LineJoin=\"Round\"\n              MiterLimit=\"1\"\n              StartLineCap=\"Round\"\n              Thickness=\"1.5\" />\n          </GeometryDrawing.Pen>\n        </GeometryDrawing>\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ElseArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"DarkBlue\"\n                         Geometry=\"F1 M24,24z M0,0z M10.0001,4.99989L19,4.99976 19,6.99976 12.0001,6.99986 12,14.5859 17.4142,14.5859 11,21.0001 4.58578,14.5859 10,14.5859 10.0001,4.99989z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"ThenArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"DarkBlue\"\n                         Geometry=\"F1 M24,24z M0,0z M13.9999,4.99989L5.00001,4.99976 4.99998,6.99976 11.9999,6.99986 12,14.5859 6.5858,14.5859 13,21.0001 19.4142,14.5859 14,14.5859 13.9999,4.99989z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SwitchArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"Purple\"\n                         Geometry=\"F1 M24,24z M0,0z M3.99966,19.0001L3.9998,10.0002 9.58585,10.0002 9.58585,4.58588 16.0001,11.0001 9.58585,17.4143 9.58585,12.0002 5.99977,12.0002 5.99966,19.0001 3.99966,19.0001z M13.8363,6.05023L15.2505,4.63601 21.6144,11 15.2505,17.3639 13.8363,15.9497 18.786,11 13.8363,6.05023z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"SwitchCaseArrowIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"Purple\"\n                         Geometry=\"F1 M24,24z M0,0z M4.99989,10.0001L4.99976,19 6.99976,19 6.99986,12.0001 14.5859,12 14.5859,17.4142 21.0001,11 14.5859,4.58578 14.5859,10 4.99989,10.0001z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"LoopIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"DarkGreen\"\n                         Geometry=\"F1 M24,24z M0,0z M12,4C14.7486,4,17.1749,5.38626,18.6156,7.5L16,7.5 16,9.5 22,9.5 22,3.5 20,3.5 20,5.99936C18.1762,3.57166 15.2724,2 12,2 6.47715,2 2,6.47715 2,12L4,12C4,7.58172,7.58172,4,12,4z M20,12C20,16.4183 16.4183,20 12,20 9.25144,20 6.82508,18.6137 5.38443,16.5L8,16.5 8,14.5 2,14.5 2,20.5 4,20.5 4,18.0006C5.82381,20.4283 8.72764,22 12,22 17.5228,22 22,17.5228 22,12L20,12z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n\n  <DrawingImage x:Key=\"HistoryBackIcon\">\n    <DrawingImage.Drawing>\n      <DrawingGroup ClipGeometry=\"M0,0 V24 H24 V0 H0 Z\">\n        <GeometryDrawing Brush=\"#FF000000\"\n                         Geometry=\"F1 M24,24z M0,0z M12,2C17.5228,2 22,6.47715 22,12 22,17.5228 17.5228,22 12,22 6.47715,22 2,17.5228 2,12L4,12C4,16.4183 7.58172,20 12,20 16.4183,20 20,16.4183 20,12 20,7.58172 16.4183,4 12,4 9.25022,4 6.82447,5.38734 5.38451,7.50024L8,7.5 8,9.5 2,9.5 2,3.5 4,3.5 3.99989,5.99918C5.82434,3.57075,8.72873,2,12,2z M13,7L12.9998,11.585 16.2426,14.8284 14.8284,16.2426 10.9998,12.413 11,7 13,7z\" />\n      </DrawingGroup>\n    </DrawingImage.Drawing>\n  </DrawingImage>\n</ResourceDictionary>"
  },
  {
    "path": "src/ProfileExplorerUI/MainWindow.xaml",
    "content": "<Window\n  x:Class=\"ProfileExplorer.UI.MainWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:avalonDock=\"https://github.com/Dirkster99/AvalonDock\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:panels=\"clr-namespace:ProfileExplorer.UI.Panels\"\n  xmlns:profile=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  Title=\"Profile Explorer\"\n  Width=\"1000\"\n  Height=\"600\"\n  Background=\"#F0F0F0F0\"\n  Loaded=\"Window_Loaded\"\n  ResizeMode=\"CanResizeWithGrip\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <Window.CommandBindings>\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.FullScreen\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"FullScreenExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.OpenDocument\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"OpenDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDocumentCommand\"\n      Command=\"local:AppCommand.OpenDebug\"\n      PreviewCanExecute=\"CanExecuteDocumentCommand\"\n      PreviewExecuted=\"OpenDebugExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDiffDocumentCommand\"\n      Command=\"local:AppCommand.OpenDiffDebug\"\n      PreviewCanExecute=\"CanExecuteDiffDocumentCommand\"\n      PreviewExecuted=\"OpenDiffDebugExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.OpenNewDocument\"\n      Executed=\"OpenNewDocumentExecuted\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"OpenNewDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDocumentCommand\"\n      Command=\"local:AppCommand.CloseDocument\"\n      Executed=\"CloseDocumentExecuted\"\n      PreviewCanExecute=\"CanExecuteDocumentCommand\"\n      PreviewExecuted=\"CloseDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDocumentCommand\"\n      Command=\"local:AppCommand.SaveDocument\"\n      Executed=\"SaveDocumentExecuted\"\n      PreviewCanExecute=\"CanExecuteDocumentCommand\"\n      PreviewExecuted=\"SaveDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDocumentCommand\"\n      Command=\"local:AppCommand.SaveAsDocument\"\n      Executed=\"SaveAsDocumentExecuted\"\n      PreviewCanExecute=\"CanExecuteDocumentCommand\"\n      PreviewExecuted=\"SaveAsDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDocumentCommand\"\n      Command=\"local:AppCommand.ReloadDocument\"\n      Executed=\"ReloadDocumentExecuted\"\n      PreviewCanExecute=\"CanExecuteDocumentCommand\"\n      PreviewExecuted=\"ReloadDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDocumentCommand\"\n      Command=\"local:AppCommand.AutoReloadDocument\"\n      Executed=\"AutoReloadDocumentExecuted\"\n      PreviewCanExecute=\"CanExecuteDocumentCommand\"\n      PreviewExecuted=\"AutoReloadDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.OpenDiffDocument\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"OpenDiffDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.OpenBaseDiffDocuments\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"OpenBaseDiffDocumentsExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteDiffDocumentCommand\"\n      Command=\"local:AppCommand.CloseDiffDocument\"\n      PreviewCanExecute=\"CanExecuteDiffDocumentCommand\"\n      PreviewExecuted=\"CloseDiffDocumentExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.ToggleDiffMode\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"ToggleDiffModeExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.SwapDiffDocuments\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"SwapDiffDocumentsExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.ShowDocumentSearch\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"ShowDocumentSearchExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteLoadProfileCommand\"\n      Command=\"local:AppCommand.LoadProfile\"\n      Executed=\"LoadProfileExecuted\"\n      PreviewCanExecute=\"CanExecuteLoadProfileCommand\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteLoadProfileCommand\"\n      Command=\"local:AppCommand.RecordProfile\"\n      Executed=\"RecordProfileExecuted\"\n      PreviewCanExecute=\"CanExecuteLoadProfileCommand\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteProfileCommand\"\n      Command=\"local:AppCommand.ViewProfileReport\"\n      Executed=\"ViewProfileReportExecuted\"\n      PreviewCanExecute=\"CanExecuteProfileCommand\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.OpenHelpPage\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"OpenHelpPageExecuted\" />\n\n    <CommandBinding\n      CanExecute=\"CanExecuteAlways\"\n      Command=\"local:AppCommand.OpenHelpPanel\"\n      PreviewCanExecute=\"CanExecuteAlways\"\n      PreviewExecuted=\"OpenHelpPanelExecuted\" />\n  </Window.CommandBindings>\n\n  <Window.InputBindings>\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:AppCommand.ShowDocumentSearch\"\n      Modifiers=\"Ctrl\" />\n\n    <KeyBinding\n      Key=\"F11\"\n      Command=\"local:AppCommand.FullScreen\" />\n    <KeyBinding\n      Key=\"P\"\n      Command=\"local:Command.PreviousSection\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"N\"\n      Command=\"local:Command.NextSection\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"O\"\n      Command=\"local:AppCommand.OpenDocument\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F4\"\n      Command=\"local:AppCommand.CloseDocument\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"S\"\n      Command=\"local:AppCommand.SaveDocument\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"S\"\n      Command=\"local:AppCommand.SaveAsDocument\"\n      Modifiers=\"Ctrl+Shift\" />\n\n    <KeyBinding\n      Key=\"F5\"\n      Command=\"local:AppCommand.ReloadDocument\" />\n    <KeyBinding\n      Key=\"F5\"\n      Command=\"local:AppCommand.AutoReloadDocument\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F12\"\n      Command=\"local:AppCommand.OpenBaseDiffDocuments\" />\n    <KeyBinding\n      Key=\"F12\"\n      Command=\"local:AppCommand.OpenDiffDocument\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"O\"\n      Command=\"local:AppCommand.OpenExecutable\"\n      Modifiers=\"Ctrl+Shift\" />\n    <KeyBinding\n      Key=\"F9\"\n      Command=\"local:AppCommand.ToggleDiffMode\" />\n    <KeyBinding\n      Key=\"F10\"\n      Command=\"local:AppCommand.SwapDiffDocuments\" />\n    <KeyBinding\n      Key=\"F1\"\n      Command=\"local:AppCommand.OpenHelpPage\"/>\n    <KeyBinding\n      Key=\"F1\"\n      Command=\"local:AppCommand.OpenHelpPanel\"\n      Modifiers=\"Ctrl\" />\n  </Window.InputBindings>\n\n  <Grid x:Name=\"MainGrid\">\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"20\" />\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"24\" />\n    </Grid.RowDefinitions>\n    <Border\n      Grid.Row=\"0\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderBrush=\"{DynamicResource {x:Static SystemColors.ScrollBarBrushKey}}\"\n      BorderThickness=\"0,0,0,1\">\n      <Grid>\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"220\" />\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"50\" />\n        </Grid.ColumnDefinitions>\n\n        <Menu\n          x:Name=\"MainMenu\"\n          Grid.Column=\"0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n          <MenuItem Header=\"_File\">\n            <MenuItem\n              Command=\"local:AppCommand.OpenDocument\"\n              Header=\"_Open File\"\n              InputGestureText=\"Ctrl+O\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource FolderIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              x:Name=\"RecentFilesMenu\"\n              Header=\"_Recent Files\">\n              <Separator />\n              <MenuItem\n                Click=\"RecentFilesMenu_Click\"\n                Header=\"Clear\" />\n            </MenuItem>\n            <Separator />\n\n            <!-- <MenuItem -->\n            <!--   Command=\"local:AppCommand.OpenBaseDiffDocuments\" -->\n            <!--   Header=\"_Compare Base/Diff Files\" -->\n            <!--   InputGestureText=\"F12\"> -->\n            <!--   <MenuItem.Icon> -->\n            <!--     <Image -->\n            <!--       Width=\"16\" -->\n            <!--       Height=\"16\" -->\n            <!--       Source=\"{StaticResource BookIcon}\" /> -->\n            <!--   </MenuItem.Icon> -->\n            <!-- </MenuItem> -->\n            <!-- <MenuItem -->\n            <!--   Command=\"local:AppCommand.OpenDiffDocument\" -->\n            <!--   Header=\"Open _Diff File\" -->\n            <!--   InputGestureText=\"Ctrl+F12\" /> -->\n            <!-- <MenuItem -->\n            <!--   Command=\"local:AppCommand.CloseDiffDocument\" -->\n            <!--   Header=\"Close Diff File\" /> -->\n            <!-- <Separator /> -->\n\n            <MenuItem\n              Command=\"local:AppCommand.OpenDebug\"\n              Header=\"_Open Debug File\" />\n            <MenuItem\n              Visibility=\"Collapsed\"\n              Command=\"local:AppCommand.OpenDiffDebug\"\n              Header=\"_Open Diff Debug File\" />\n\n            <Separator />\n\n            <MenuItem\n              Command=\"local:AppCommand.ReloadDocument\"\n              Header=\"_Reload File\"\n              InputGestureText=\"F5\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ReloadIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"local:AppCommand.AutoReloadDocument\"\n              Header=\"Auto-Reload File on Change\"\n              InputGestureText=\"Ctrl+F5\"\n              IsCheckable=\"True\"\n              IsChecked=\"True\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource AutoReloadIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n\n            <!-- <MenuItem -->\n            <!--   Command=\"local:AppCommand.SaveDocument\" -->\n            <!--   Header=\"_Save Session\" -->\n            <!--   InputGestureText=\"Ctrl+S\" -->\n            <!--   IsEnabled=\"False\"> -->\n            <!--   <MenuItem.Icon> -->\n            <!--     <Image -->\n            <!--       Width=\"16\" -->\n            <!--       Height=\"16\" -->\n            <!--       Source=\"{StaticResource SaveIcon}\" /> -->\n            <!--   </MenuItem.Icon> -->\n            <!-- </MenuItem> -->\n            <!-- <MenuItem -->\n            <!--   Command=\"local:AppCommand.SaveAsDocument\" -->\n            <!--   Header=\"Save Session _As...\" -->\n            <!--   InputGestureText=\"Ctrl+Shift+S\" -->\n            <!--   IsEnabled=\"False\" /> -->\n            <MenuItem\n              Command=\"local:AppCommand.CloseDocument\"\n              Header=\"Close Session\"\n              InputGestureText=\"Ctrl+F4\" />\n            <Separator />\n            <MenuItem\n              Command=\"local:AppCommand.OpenNewDocument\"\n              Header=\"Launch New _Instance\" />\n            <MenuItem\n              Click=\"ExitMenuItem_Click\"\n              Header=\"E_xit\" />\n          </MenuItem>\n\n          <MenuItem Header=\"View\">\n            <MenuItem\n              Click=\"ResetWorkspaceMenu_Click\"\n              Header=\"Reset Workspace\"\n              ToolTip=\"Restore default layout of workplace\" />\n            <MenuItem\n              Click=\"ShowWorkspacesMenu_Click\"\n              Header=\"Manage Workspaces\" />\n            <MenuItem\n              x:Name=\"AlwaysOnTopCheckbox\"\n              Click=\"AlwaysOnTopMenu_Click\"\n              Header=\"Always on Top\"\n              IsCheckable=\"True\"\n              IsChecked=\"False\"\n              Tag=\"Section\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource PinIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n            <MenuItem\n              Click=\"ZoomInUIMenu_Click\"\n              Header=\"Zoom In UI (+5%)\"\n              ToolTip=\"Enlarge the UI for the entire application\" />\n            <MenuItem\n              Click=\"ZoomOutUIMenu_Click\"\n              Header=\"Zoom Out UI (-5%)\"\n              ToolTip=\"Shrink the UI for the entire application\" />\n            <MenuItem\n              Click=\"ResetUIZoomMenu_Click\"\n              Header=\"Reset Zoom (100%)\"\n              ToolTip=\"Restore default UI scaling for the entire application\" />\n            <Separator />\n\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Summary View\"\n              Tag=\"Section\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource SummaryIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Timeline View\"\n              Tag=\"Timeline\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource TimelineIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Flame Graph View\"\n              Tag=\"FlameGraph\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource FlameGraphIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Call Tree View\"\n              Tag=\"CallTree\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource TreeIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Caller/Callee View\"\n              Tag=\"CallerCallee\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource FlowChartIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Source File View\"\n              Tag=\"Source\" />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Flow Graph View\"\n              Tag=\"FlowGraph\" />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Dominator Tree View\"\n              Tag=\"DominatorTree\" />\n            <!-- <MenuItem -->\n            <!--   Click=\"ShowPanelMenu_Click\" -->\n            <!--   Header=\"Post-Dominator Tree View\" -->\n            <!--   Tag=\"PostDominatorTree\" /> -->\n            <MenuItem\n              Header=\"Expression Graph View\"\n              IsEnabled=\"True\"\n              Tag=\"ExpressionGraph\" />\n            <Separator/>\n            <!-- <MenuItem -->\n            <!--   Click=\"ShowPanelMenu_Click\" -->\n            <!--   Header=\"Pass Output View\" -->\n            <!--   Tag=\"PassOutput\" /> -->\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Definition View\"\n              Tag=\"Definition\" />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"References View\"\n              Tag=\"References\" />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Bookmarks View\"\n              Tag=\"Bookmarks\" />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Search Results View\"\n              Tag=\"SearchResults\" />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Notes View\"\n              Tag=\"Notes\" />\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Developer View\"\n              Tag=\"Developer\" />\n          </MenuItem>\n\n          <MenuItem Header=\"Profiling\">\n            <MenuItem\n              Command=\"local:AppCommand.LoadProfile\"\n              Header=\"Load Profile\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource FolderIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"local:AppCommand.RecordProfile\"\n              Header=\"Record Profile\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource RecordIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n\n            <MenuItem\n              Command=\"local:AppCommand.ViewProfileReport\"\n              Header=\"Profile Report\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ReportIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Summary View\"\n              Tag=\"Section\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource SummaryIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Timeline View\"\n              Tag=\"Timeline\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource TimelineIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Flame Graph View\"\n              Tag=\"FlameGraph\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource FlameGraphIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Call Tree View\"\n              Tag=\"CallTree\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource TreeIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Click=\"ShowPanelMenu_Click\"\n              Header=\"Caller/Callee View\"\n              Tag=\"CallerCallee\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource FlowChartIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n          </MenuItem>\n\n          <MenuItem Header=\"Tools\">\n            <!-- <MenuItem -->\n            <!--   Header=\"Diff Mode\" -->\n            <!--   IsCheckable=\"True\" -->\n            <!--   IsChecked=\"{Binding ElementName=DiffModeButton, Path=IsChecked, Mode=TwoWay}\"> -->\n            <!--   <MenuItem.Icon> -->\n            <!--     <Image -->\n            <!--       Width=\"16\" -->\n            <!--       Height=\"16\" -->\n            <!--       Source=\"{StaticResource DiffIcon}\" /> -->\n            <!--   </MenuItem.Icon> -->\n            <!-- </MenuItem> -->\n\n            <MenuItem\n              Click=\"FunctionReportMenu_Click\"\n              Header=\"Function report\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ReportIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n\n            <MenuItem\n              Click=\"SettingsMenu_Click\"\n              Header=\"Settings\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource SettingsIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n            \n            <MenuItem\n              Click=\"DiagnosticLogMenu_Click\"\n              Header=\"Show Diagnostic Log\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ReportIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n          </MenuItem>\n\n          <MenuItem Header=\"Help\">\n            <MenuItem\n              Command=\"local:AppCommand.OpenHelpPage\"\n              Header=\"User Guide\"\n              InputGestureText=\"F1\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource DetailsIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"local:AppCommand.OpenHelpPanel\"\n              Header=\"Help View\"\n              InputGestureText=\"Ctrl+F1\"\n              Tag=\"Help\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource HelpIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <Separator />\n\n            <MenuItem\n              Click=\"CheckUpdatesMenu_Click\"\n              Header=\"Check for Updates\" />\n            <MenuItem Header=\"Developer\">\n              <MenuItem\n                x:Name=\"DevMenuStartupTime\"\n                Header=\"Diff time: 0\"\n                IsEnabled=\"False\" />\n              <MenuItem\n                Click=\"OpenLogMenu_Click\"\n                Header=\"Open log file\" />\n              <MenuItem\n                Click=\"ForceGCMenu_Click\"\n                Header=\"Force GC\" />\n            </MenuItem>\n\n            <Separator />\n            <MenuItem\n              Click=\"AboutMenu_Click\"\n              Header=\"About Profile Explorer\" />\n          </MenuItem>\n        </Menu>\n\n        <StackPanel\n          Grid.Column=\"1\"\n          Margin=\"20,0,0,0\"\n          HorizontalAlignment=\"Left\"\n          Orientation=\"Horizontal\">\n          <Border\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"Transparent\"\n            BorderThickness=\"1,0,1,0\">\n            <StackPanel\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Orientation=\"Horizontal\">\n              <ToggleButton\n                Visibility=\"Collapsed\"\n                x:Name=\"DiffModeButton\"\n                Padding=\"2,1,2,1\"\n                VerticalAlignment=\"Center\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                BorderBrush=\"{x:Null}\"\n                Checked=\"ToggleButton_Checked\"\n                FontSize=\"11\"\n                ToolTip=\"Enter/exit diffing two sections (F9)\"\n                Unchecked=\"DiffModeButton_Unchecked\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"0,1,0,0\"\n                    VerticalAlignment=\"Center\"\n                    SnapsToDevicePixels=\"True\"\n                    Source=\"{StaticResource BookIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\"\n                    UseLayoutRounding=\"True\" />\n                  <TextBlock\n                    Margin=\"2,0,0,0\"\n                    HorizontalAlignment=\"Left\"\n                    VerticalAlignment=\"Top\"\n                    Text=\"Diff Mode\" />\n                </StackPanel>\n              </ToggleButton>\n\n              <StackPanel\n                x:Name=\"DiffControlsPanel\"\n                Orientation=\"Horizontal\"\n                Visibility=\"Collapsed\">\n                <Line\n                  Margin=\"0,0,2,0\"\n                  Stroke=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                  Y1=\"0\"\n                  Y2=\"17\" />\n                <Button\n                  x:Name=\"DiffSettingsButton\"\n                  Width=\"16\"\n                  Padding=\"0,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderBrush=\"{x:Null}\"\n                  Click=\"DiffSettingsButton_Click\"\n                  ToolTip=\"Show diff settings panel\">\n                  <Image\n                    Width=\"14\"\n                    Height=\"14\"\n                    Margin=\"0,1,0,0\"\n                    VerticalAlignment=\"Center\"\n                    SnapsToDevicePixels=\"True\"\n                    Source=\"{StaticResource SettingsIcon}\"\n                    UseLayoutRounding=\"True\" />\n                </Button>\n                <Line\n                  Margin=\"2,0,2,0\"\n                  Stroke=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                  Y1=\"0\"\n                  Y2=\"17\" />\n\n                <Button\n                  x:Name=\"PreviousDiffButton\"\n                  Width=\"16\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderBrush=\"{x:Null}\"\n                  Click=\"PreviousDiffButton_Click\"\n                  ToolTip=\"Go backward by one section in both the left and right side\">\n                  <Image\n                    Width=\"14\"\n                    Height=\"14\"\n                    Margin=\"0,1,0,0\"\n                    VerticalAlignment=\"Center\"\n                    SnapsToDevicePixels=\"True\"\n                    Source=\"{StaticResource LeftArrowIcon}\"\n                    UseLayoutRounding=\"True\" />\n                </Button>\n\n                <Button\n                  x:Name=\"NextDiffButton\"\n                  Width=\"16\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderBrush=\"{x:Null}\"\n                  Click=\"NextDiffButton_Click\"\n                  ToolTip=\"Go forward by one section in both the left and right side\">\n                  <Image\n                    Width=\"14\"\n                    Height=\"14\"\n                    Margin=\"0,1,0,0\"\n                    VerticalAlignment=\"Center\"\n                    SnapsToDevicePixels=\"True\"\n                    Source=\"{StaticResource RightArrowIcon}\"\n                    UseLayoutRounding=\"True\" />\n                </Button>\n\n                <Line\n                  Margin=\"2,0,2,0\"\n                  Stroke=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                  Y1=\"0\"\n                  Y2=\"17\" />\n\n                <Button\n                  x:Name=\"DiffSwapButton\"\n                  Width=\"16\"\n                  Padding=\"0,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderBrush=\"{x:Null}\"\n                  Click=\"DiffSwapButton_Click\"\n                  ToolTip=\"Swap left/right diff documents\">\n                  <Image\n                    Width=\"14\"\n                    Height=\"14\"\n                    VerticalAlignment=\"Center\"\n                    SnapsToDevicePixels=\"True\"\n                    Source=\"{StaticResource SwitchIcon}\"\n                    UseLayoutRounding=\"True\" />\n                </Button>\n\n                <Line\n                  Margin=\"2,0,2,0\"\n                  Stroke=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                  Y1=\"0\"\n                  Y2=\"17\" />\n                <TextBlock\n                  x:Name=\"DiffStatusText\"\n                  Margin=\"4,0,4,0\"\n                  VerticalAlignment=\"Center\"\n                  FontSize=\"11\"\n                  FontWeight=\"Bold\"\n                  ToolTip=\"Number of Added, Deleted, Modified lines\" />\n\n                <Button\n                  x:Name=\"PreviousSegmentDiffButton\"\n                  Width=\"16\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderBrush=\"{x:Null}\"\n                  Click=\"PreviousSegmentDiffButton_Click\"\n                  ToolTip=\"Go to previous difference\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"0,1,0,0\"\n                    VerticalAlignment=\"Center\"\n                    SnapsToDevicePixels=\"True\"\n                    Source=\"{StaticResource UpArrowIcon}\"\n                    UseLayoutRounding=\"True\" />\n                </Button>\n\n                <Button\n                  x:Name=\"NextDiffSegmentButton\"\n                  Width=\"16\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderBrush=\"{x:Null}\"\n                  Click=\"NextDiffSegmentButton_Click\"\n                  ToolTip=\"Go to next difference\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"0,1,0,0\"\n                    VerticalAlignment=\"Center\"\n                    SnapsToDevicePixels=\"True\"\n                    Source=\"{StaticResource DownArrowIcon}\"\n                    UseLayoutRounding=\"True\" />\n                </Button>\n              </StackPanel>\n            </StackPanel>\n          </Border>\n\n          <Border\n            HorizontalAlignment=\"Left\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"Transparent\"\n            BorderThickness=\"0,0,1,0\">\n            <Button\n              x:Name=\"FindButton\"\n              Padding=\"2,1,2,1\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              BorderBrush=\"{x:Null}\"\n              Click=\"FindButton_Click\"\n              FontSize=\"11\"\n              FontWeight=\"Medium\"\n              ToolTip=\"Search the entire document (Ctrl+F3)\">\n              <Image\n                Width=\"13\"\n                Height=\"13\"\n                HorizontalAlignment=\"Center\"\n                VerticalAlignment=\"Center\"\n                SnapsToDevicePixels=\"True\"\n                Source=\"{StaticResource SearchIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\"\n                UseLayoutRounding=\"True\" />\n            </Button>\n          </Border>\n          <Border\n            x:Name=\"ProfileMarkingHost\"\n            Background=\"#F7EFCD\"\n            BorderBrush=\"Transparent\"\n            BorderThickness=\"0,0,1,0\"\n            Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <ToolBarTray\n              Height=\"20\"\n              Margin=\"0,-2,0,0\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Top\"\n              Background=\"#F7EFCD\"\n              DockPanel.Dock=\"Left\"\n              IsLocked=\"True\">\n              <ToolBarTray.Clip>\n                <RectangleGeometry Rect=\"0 0 350 20\" />\n              </ToolBarTray.Clip>\n              <ToolBar\n                HorizontalAlignment=\"Stretch\"\n                VerticalAlignment=\"Top\"\n                Background=\"#F7EFCD\"\n                Loaded=\"ToolBar_Loaded\">\n                <Menu\n                  Height=\"20\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"#F7EFCD\">\n                  <MenuItem\n                    x:Name=\"CategoriesMenu\"\n                    Height=\"20\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    OverridesDefaultStyle=\"True\"\n                    SubmenuOpened=\"CategoriesMenu_OnSubmenuOpened\"\n                    ToolTip=\"Overview of the profile trace time distribution grouped by function categories\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <Image\n                          Width=\"14\"\n                          Height=\"14\"\n                          Margin=\"0,0,0,0\"\n                          Source=\"{StaticResource TasklistIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                        <TextBlock\n                          Margin=\"3,-2,0,0\"\n                          VerticalAlignment=\"Center\"\n                          FontWeight=\"SemiBold\"\n                          Text=\"Overview\" />\n                        <Path\n                          Margin=\"2,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Click=\"EditMarkingsMenu_OnClick\"\n                      Header=\"Edit Category Definitions\"\n                      ToolTip=\"Edit the category definitions JSON file.&#x0a;A restart of the app is needed to load the new definitions\">\n                      <MenuItem.Icon>\n                        <Image Source=\"{StaticResource EditIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <Separator />\n                    <MenuItem\n                      Click=\"ExportOverviewHtmlMenu_OnClick\"\n                      Header=\"Export Overview Report as HTML File\"\n                      ToolTip=\"Save the report with function categories as an HTML file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource SourceIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Click=\"ExportOverviewMarkdownMenu_OnClick\"\n                      Header=\"Export Overview Report as Markdown File\"\n                      ToolTip=\"Save the report with function categories as a Markdown file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource DocumentIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Click=\"CopyOverviewMenu_OnClick\"\n                      Header=\"Copy Overview Report as HTML/Markdown\"\n                      ToolTip=\"Copy the report with function categories as an HTML table\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource ClipboardIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                  </MenuItem>\n                </Menu>\n                <Border\n                  Width=\"1\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderBrush=\"Transparent\"\n                  BorderThickness=\"1,0,0,0\"\n                  Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n                <Menu\n                  Height=\"20\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"#F7EFCD\">\n                  <MenuItem\n                    x:Name=\"MarkingMenu\"\n                    Height=\"20\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    OverridesDefaultStyle=\"True\"\n                    SubmenuOpened=\"MarkingMenu_OnSubmenuOpened\"\n                    ToolTip=\"Marking of functions based on name and/or module\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <Image\n                          Width=\"14\"\n                          Height=\"14\"\n                          Margin=\"0,-1,0,0\"\n                          Source=\"{StaticResource BookmarkIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                        <TextBlock\n                          Margin=\"3,-2,0,0\"\n                          VerticalAlignment=\"Center\"\n                          FontWeight=\"SemiBold\"\n                          Text=\"Profile Marking\" />\n                        <Path\n                          Margin=\"2,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Click=\"ProfileMenuItem_Click\"\n                      Header=\"Pick Function Color Based on Module\"\n                      IsCheckable=\"True\"\n                      IsChecked=\"{Binding MarkingSettings.UseAutoModuleColors}\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\"\n                      ToolTip=\"Automatically pick a function color based on the module name\" />\n                    <Separator />\n                    <MenuItem\n                      x:Name=\"BuiltinMarkingsMenu\"\n                      Header=\"Predefined Markings\"\n                      IsEnabled=\"False\"\n                      IsHitTestVisible=\"False\" />\n                    <MenuItem\n                      x:Name=\"EditMarkingsMenu\"\n                      Click=\"EditMarkingsMenu_OnClick\"\n                      Header=\"Edit Predefined Markings Definitions\"\n                      Tag=\"BuiltinMarkingsMenuEnd\"\n                      ToolTip=\"Edit the predefined markings definitions JSON file.&#x0a;A restart of the app is needed to load the new definitions\">\n                      <MenuItem.Icon>\n                        <Image Source=\"{StaticResource EditIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <Separator />\n\n                    <MenuItem\n                      Click=\"SaveMarkingsMenuItem_OnClick\"\n                      Header=\"Save Markings Set\"\n                      ToolTip=\"Save current function and module marks as a named set\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource BookmarkIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      x:Name=\"SwitchMarkingsMenu\"\n                      Header=\"Switch Markings Set\"\n                      ToolTip=\"Replace current function/module markings with saved markings\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource BookmarkArrowIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      x:Name=\"AppendMarkingsMenu\"\n                      Header=\"Append Markings Set\"\n                      ToolTip=\"Add saved markings to the current function/module markings\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource AddBookmarkIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <Separator />\n                    <MenuItem\n                      Click=\"ImportMarkingsMenuItem_OnClick\"\n                      Header=\"Import Markings\"\n                      ToolTip=\"Import current and saved marking sets from a JSON file.&#x0a;This appends the new marking sets to the existing ones\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource FolderIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Click=\"ExportMarkingsMenuItem_OnClick\"\n                      Header=\"Export All Markings\"\n                      ToolTip=\"Export current and saved marking sets as a JSON file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource SaveIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                  </MenuItem>\n                </Menu>\n                <Button\n                  Background=\"{x:Null}\"\n                  BorderBrush=\"{x:Null}\"\n                  Click=\"MarkingSettingsButton_Click\"\n                  ToolTip=\"Remove time range filter\"\n                  Visibility=\"{Binding HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <Image\n                    Width=\"17\"\n                    Height=\"17\"\n                    Margin=\"0,-1,0,0\"\n                    Source=\"{StaticResource ToolIcon}\" />\n                </Button>\n                <Menu\n                  Height=\"20\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"#F7EFCD\"\n                  ToolTip=\"Color functions based on the module name\">\n                  <MenuItem\n                    x:Name=\"ModuleMenu\"\n                    Height=\"20\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    Background=\"{Binding Path=HasEnabledMarkedModules, Converter={StaticResource BooToParameter}, ConverterParameter=#B4D4F4}\"\n                    OverridesDefaultStyle=\"True\"\n                    SubmenuOpened=\"ModuleMenu_OnSubmenuOpened\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Margin=\"4,-2,0,0\"\n                          VerticalAlignment=\"Center\"\n                          Text=\"Modules\" />\n                        <Path\n                          Margin=\"4,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Click=\"ProfileMenuItem_Click\"\n                      Header=\"Mark Functions Based on Module Name\"\n                      IsCheckable=\"True\"\n                      IsChecked=\"{Binding MarkingSettings.UseModuleColors}\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\"\n                      ToolTip=\"Use a different color for specified modules\" />\n                    <Separator />\n                    <MenuItem\n                      Click=\"ClearModulesButton_Click\"\n                      Header=\"Clear Marked Modules\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\"\n                      ToolTip=\"Remove all saved module markings\" />\n                    <Separator />\n                    <MenuItem\n                      Click=\"ExportMarkedModulesHtmlMenu_OnClick\"\n                      Header=\"Export Marked Modules as HTML File\"\n                      ToolTip=\"Save the report with marked modules as an HTML file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource SourceIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Click=\"ExportMarkedModulesMarkdownMenu_OnClick\"\n                      Header=\"Export Marked Modules as Markdown File\"\n                      ToolTip=\"Save the report with marked modules as a Markdown file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource DocumentIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Click=\"CopyMarkedModulesMenu_OnClick\"\n                      Header=\"Copy Marked Modules\"\n                      ToolTip=\"Copy the report with marked modules as an HTML table\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource ClipboardIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                  </MenuItem>\n                </Menu>\n                <Menu\n                  Height=\"20\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"#F7EFCD\"\n                  ToolTip=\"Color functions based on the function name\">\n                  <MenuItem\n                    x:Name=\"FunctionMenu\"\n                    Height=\"20\"\n                    Margin=\"0,0,0,0\"\n                    Padding=\"0,0,0,0\"\n                    Background=\"{Binding Path=HasEnabledMarkedFunctions, Converter={StaticResource BooToParameter}, ConverterParameter=#B4D4F4}\"\n                    OverridesDefaultStyle=\"True\"\n                    SubmenuOpened=\"FunctionMenu_OnSubmenuOpened\">\n                    <MenuItem.Header>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Margin=\"4,-2,0,0\"\n                          VerticalAlignment=\"Center\"\n                          Text=\"Functions\" />\n                        <Path\n                          Margin=\"2,2,2,0\"\n                          VerticalAlignment=\"Center\"\n                          Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                          Fill=\"Black\" />\n                      </StackPanel>\n                    </MenuItem.Header>\n                    <MenuItem\n                      Click=\"ProfileMenuItem_Click\"\n                      Header=\"Mark Functions Based on Name\"\n                      IsCheckable=\"True\"\n                      IsChecked=\"{Binding MarkingSettings.UseFunctionColors}\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\"\n                      ToolTip=\"Use a different color for specified functions\" />\n                    <Separator />\n                    <MenuItem\n                      Click=\"ClearFunctionsButton_Click\"\n                      Header=\"Clear Marked Functions\"\n                      Style=\"{DynamicResource SubMenuItemHeaderStyle}\"\n                      ToolTip=\"Remove all saved function markings\" />\n                    <Separator />\n                    <MenuItem\n                      Click=\"ExportMarkedFunctionsHtmlMenu_OnClick\"\n                      Header=\"Export Marked Functions as HTML File\"\n                      ToolTip=\"Save the report with marked functions as an HTML file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource SourceIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Click=\"ExportMarkedFunctionsMarkdownMenu_OnClick\"\n                      Header=\"Export Marked Functions as Markdown File\"\n                      ToolTip=\"Save the report with marked functions as a Markdown file\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource DocumentIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                    <MenuItem\n                      Click=\"CopyMarkedFunctionMenu_OnClick\"\n                      Header=\"Copy Marked Functions\"\n                      ToolTip=\"Copy the report with marked functions as an HTML table\">\n                      <MenuItem.Icon>\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource ClipboardIcon}\" />\n                      </MenuItem.Icon>\n                    </MenuItem>\n                  </MenuItem>\n                </Menu>\n              </ToolBar>\n            </ToolBarTray>\n          </Border>\n          <!--  Border used to cover the part of the toolbar that extends too much past the bounds  -->\n          <Border\n            Width=\"28\"\n            Margin=\"-16,0,0,0\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"Transparent\"\n            BorderThickness=\"1,0,0,0\"\n            Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <Border\n            x:Name=\"ProfileFilterStateHost\"\n            Margin=\"-26,0,0,0\"\n            Background=\"AntiqueWhite\"\n            BorderBrush=\"Transparent\"\n            BorderThickness=\"1,0,1,0\"\n            Visibility=\"{Binding HasAnyFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Button\n                Margin=\"0,0,6,0\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Click=\"RemoveProfileAllFiltersButton_Click\"\n                ToolTip=\"Click to remove active filtering of entire profile by thread and/or time range\"\n                Visibility=\"{Binding HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource FilterIcon}\" />\n                  <TextBlock Text=\"Profile Filter\" />\n                </StackPanel>\n              </Button>\n\n              <TextBlock\n                VerticalAlignment=\"Center\"\n                FontWeight=\"SemiBold\"\n                Foreground=\"DarkBlue\"\n                Text=\"Time:\"\n                Visibility=\"{Binding HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n              <TextBlock\n                Margin=\"4,0,2,0\"\n                VerticalAlignment=\"Center\"\n                FontWeight=\"SemiBold\"\n                Foreground=\"DarkBlue\"\n                Text=\"{Binding FilteredTime, Converter={StaticResource MillisecondTimeConverter}}\"\n                ToolTip=\"Time range included in the view\"\n                Visibility=\"{Binding HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n              <Button\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Click=\"RemoveProfileTimeRangeButton_Click\"\n                ToolTip=\"Remove time range filter\"\n                Visibility=\"{Binding HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ClearIcon}\" />\n              </Button>\n              <Border\n                Margin=\"0,0,2,0\"\n                BorderBrush=\"DimGray\"\n                BorderThickness=\"1,0,0,0\"\n                Visibility=\"{Binding HasThreadFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n              <TextBlock\n                Margin=\"2,0,0,0\"\n                VerticalAlignment=\"Center\"\n                FontWeight=\"SemiBold\"\n                Foreground=\"Indigo\"\n                Text=\"Threads:\"\n                Visibility=\"{Binding HasThreadFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n              <TextBlock\n                MaxWidth=\"200\"\n                Margin=\"4,0,2,0\"\n                VerticalAlignment=\"Center\"\n                FontWeight=\"SemiBold\"\n                Foreground=\"Indigo\"\n                Text=\"{Binding ThreadFilterText, Converter={StaticResource MillisecondTimeConverter}}\"\n                TextTrimming=\"CharacterEllipsis\"\n                ToolTip=\"Threads included in the view\"\n                Visibility=\"{Binding HasThreadFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n              <Button\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Click=\"RemoveProfileThreadButton_Click\"\n                ToolTip=\"Remove thread filters\"\n                Visibility=\"{Binding HasThreadFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ClearIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </Button>\n\n            </StackPanel>\n          </Border>\n        </StackPanel>\n        <Button\n          x:Name=\"HelpButton\"\n          Grid.Column=\"2\"\n          Padding=\"2,1,2,1\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderBrush=\"{x:Null}\"\n          Click=\"HelpButton_Click\"\n          FontSize=\"11\"\n          ToolTip=\"Open Help View\">\n          <StackPanel Orientation=\"Horizontal\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Margin=\"0,0,0,0\"\n              VerticalAlignment=\"Center\"\n              SnapsToDevicePixels=\"True\"\n              Source=\"{StaticResource HelpIcon}\"\n              UseLayoutRounding=\"True\" />\n            <TextBlock\n              Margin=\"2,0,0,0\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Top\"\n              FontSize=\"11\"\n              Text=\"Help\" />\n          </StackPanel>\n        </Button>\n      </Grid>\n    </Border>\n\n    <panels:StartPagePanel\n      x:Name=\"StartPage\"\n      Grid.Row=\"1\"\n      Width=\"550\"\n      MinWidth=\"520\"\n      MinHeight=\"200\"\n      Margin=\"0,100,0,0\"\n      HorizontalAlignment=\"Center\"\n      VerticalAlignment=\"Top\"\n      Panel.ZIndex=\"2\"\n      Visibility=\"Hidden\" />\n\n    <avalonDock:DockingManager\n      x:Name=\"DockManager\"\n      Grid.Row=\"1\"\n      VerticalAlignment=\"Stretch\"\n      Panel.ZIndex=\"0\"\n      AllowMixedOrientation=\"True\"\n      AutomationProperties.AutomationId=\"AutoDockManager\"\n      Theme=\"{Binding ElementName=ThemeCombobox, Path=SelectedItem.Tag}\">\n      <!-- <avalonDock:DockingManager.AnchorableContextMenu> -->\n      <!--   <ContextMenu> -->\n      <!--     <MenuItem Header=\"AnchorableContextMenu\" /> -->\n      <!--   </ContextMenu> -->\n      <!-- </avalonDock:DockingManager.AnchorableContextMenu> -->\n      <!-- <avalonDock:DockingManager.DocumentContextMenu> -->\n      <!--   <ContextMenu> -->\n      <!--     <MenuItem Header=\"DocContextMenu\" /> -->\n      <!--   </ContextMenu> -->\n      <!-- </avalonDock:DockingManager.DocumentContextMenu> -->\n\n      <!--<avalonDock:DockingManager.Resources>\n                <DataTemplate x:Key=\"DockingWindowTitleDataTemplate\" DataType=\"{x:Type avalonDock:LayoutContent}\">\n                    <Label>\n                        <StackPanel\n                            HorizontalAlignment=\"Stretch\"\n                            Orientation=\"Horizontal\"\n                            ToolTip=\"{Binding Path=ToolTip}\">\n\n                            <TextBlock\n                                VerticalAlignment=\"Center\"\n                                FontSize=\"12\"\n                                Foreground=\"White\"\n                                Text=\"{Binding Path=Title}\"\n                                ToolTip=\"{Binding Path=ToolTip}\" />\n                        </StackPanel>\n                    </Label>\n                </DataTemplate>\n            </avalonDock:DockingManager.Resources>\n\n            <avalonDock:DockingManager.AnchorableTitleTemplate>\n                <StaticResource ResourceKey=\"DockingWindowTitleDataTemplate\" />\n            </avalonDock:DockingManager.AnchorableTitleTemplate>-->\n\n      <!--<avalonDock:DockingManager.Theme>\n                <avalonDock:Vs2013LightTheme />\n            </avalonDock:DockingManager.Theme>-->\n\n      <!--<avalonDock:DockingManager.DocumentHeaderTemplate>\n                <DataTemplate>\n                    <StackPanel Orientation=\"Horizontal\">\n                        <Image Source=\"{Binding IconSource}\" Margin=\"0,0,4,0\"/>\n                        <TextBlock Text=\"{Binding Title}\" TextTrimming=\"CharacterEllipsis\"/>\n                    </StackPanel>\n                </DataTemplate>\n            </avalonDock:DockingManager.DocumentHeaderTemplate>-->\n\n      <avalonDock:LayoutRoot>\n        <avalonDock:LayoutPanel Orientation=\"Vertical\">\n          <avalonDock:LayoutPanel Orientation=\"Horizontal\">\n            <avalonDock:LayoutAnchorablePaneGroup\n              x:Name=\"LeftPanelGroup\"\n              DockMinWidth=\"50\"\n              DockWidth=\"400\"\n              FloatingWidth=\"400\" />\n\n            <!--  Document viewer  -->\n            <avalonDock:LayoutDocumentPaneGroup\n              x:Name=\"DocumentPanelGroup\"\n              IsMaximized=\"True\">\n              <avalonDock:LayoutDocumentPane />\n            </avalonDock:LayoutDocumentPaneGroup>\n\n            <!--  Right panels  -->\n            <avalonDock:LayoutAnchorablePaneGroup\n              DockMinWidth=\"50\"\n              DockWidth=\"500\"\n              FloatingWidth=\"500\">\n              <avalonDock:LayoutAnchorablePane>\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"FlowGraphPanelHost\"\n                  Title=\"Flow Graph\"\n                  ContentId=\"FlowGraph\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:GraphPanel x:Name=\"FlowGraphPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"DominatorTreePanelHost\"\n                  Title=\"Dominator Tree\"\n                  ContentId=\"DominatorTree\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:DominatorTreePanel x:Name=\"DominatorTreePanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <!-- <avalonDock:LayoutAnchorable -->\n                <!--   x:Name=\"PostDominatorTreePanelHost\" -->\n                <!--   Title=\"PostDominator Tree\" -->\n                <!--   ContentId=\"PostDominatorTree\" -->\n                <!--   IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\" -->\n                <!--   IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\"> -->\n                <!--   <local:PostDominatorTreePanel x:Name=\"PostDominatorTreePanel\" /> -->\n                <!-- </avalonDock:LayoutAnchorable> -->\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"ExpressionGraphPanelHost\"\n                  Title=\"Expression Graph\"\n                  CanAutoHide=\"False\"\n                  CanDockAsTabbedDocument=\"False\"\n                  CanHide=\"False\"\n                  ContentId=\"ExpressionGraph\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:ExpressionGraphPanel x:Name=\"ExpressionGraphPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"HelpPanelHost\"\n                  Title=\"Help\"\n                  ContentId=\"Help\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <panels:HelpPanel x:Name=\"HelpPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <!--  <avalonDock:LayoutAnchorable  -->\n                <!--  Title=\"Loop Graph\"  -->\n                <!--  ContentId=\"LoopGraph\"  -->\n                <!--  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"  -->\n                <!--  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">  -->\n                <!--     <Grid> -->\n                <!--         <Button Content=\"Placeholder\" /> -->\n                <!--     </Grid> -->\n                <!-- </avalonDock:LayoutAnchorable> -->\n                <!--    -->\n                <!--  <avalonDock:LayoutAnchorable  -->\n                <!--  Title=\"Control Dependence Graph\"  -->\n                <!--  ContentId=\"ControlDependenceGraph\"  -->\n                <!--  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"  -->\n                <!--  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">  -->\n                <!--     <Grid> -->\n                <!--         <Button Content=\"Placeholder\" /> -->\n                <!--     </Grid> -->\n                <!-- </avalonDock:LayoutAnchorable> -->\n\n              </avalonDock:LayoutAnchorablePane>\n            </avalonDock:LayoutAnchorablePaneGroup>\n          </avalonDock:LayoutPanel>\n\n          <!--  Bottom panels  -->\n          <avalonDock:LayoutPanel\n            DockHeight=\"280\"\n            DockMinHeight=\"50\"\n            FloatingHeight=\"280\"\n            Orientation=\"Horizontal\">\n            <!--  Left bottom side  -->\n            <avalonDock:LayoutAnchorablePaneGroup>\n              <avalonDock:LayoutAnchorablePane>\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"SectionPanelHost\"\n                  Title=\"Summary\"\n                  CanClose=\"False\"\n                  ContentId=\"Sections\"\n                  FloatingWidth=\"400\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:SectionPanelPair x:Name=\"SectionPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <!-- <avalonDock:LayoutAnchorable -->\n                <!--   x:Name=\"PassOutputHost\" -->\n                <!--   Title=\"Pass Output\" -->\n                <!--   ContentId=\"PassOutput\" -->\n                <!--   IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\" -->\n                <!--   IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\"> -->\n                <!--   <local:PassOutputPanel x:Name=\"PassOutputPanel\" /> -->\n                <!-- </avalonDock:LayoutAnchorable> -->\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"DefinitionPanelHost\"\n                  Title=\"Definition\"\n                  ContentId=\"Definition\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:DefinitionPanel x:Name=\"DefinitionPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <!-- <avalonDock:LayoutAnchorable -->\n                <!--   x:Name=\"ScriptingPanelHost\" -->\n                <!--   Title=\"Scripting\" -->\n                <!--   ContentId=\"Scripting\" -->\n                <!--   IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\" -->\n                <!--   IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\"> -->\n                <!--   <local:ScriptingPanel x:Name=\"ScriptingPanel\" /> -->\n                <!-- </avalonDock:LayoutAnchorable> -->\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"DeveloperPanelHost\"\n                  Title=\"Developer\"\n                  ContentId=\"Developer\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:DeveloperPanel x:Name=\"DeveloperPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n              </avalonDock:LayoutAnchorablePane>\n            </avalonDock:LayoutAnchorablePaneGroup>\n\n            <!--  Right bottom side  -->\n            <avalonDock:LayoutAnchorablePaneGroup DockMinHeight=\"200\">\n              <avalonDock:LayoutAnchorablePane>\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"ReferencesPanelHost\"\n                  Title=\"References\"\n                  ContentId=\"ReferencesPanelHost\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:ReferencesPanel x:Name=\"ReferencesPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"NotesPanelHost\"\n                  Title=\"Notes\"\n                  ContentId=\"Notes\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:NotesPanel x:Name=\"NotesPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"SourceFilePanelHost\"\n                  Title=\"Source File\"\n                  ContentId=\"SourceFile\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:SourceFilePanel x:Name=\"SourceFilePanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"BookmarksPanelHost\"\n                  Title=\"Bookmarks\"\n                  ContentId=\"Bookmarks\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:BookmarksPanel x:Name=\"BookmarksPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"CallTreePanelHost\"\n                  Title=\"Call Tree\"\n                  ContentId=\"CallTree\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <profile:CallTreePanel x:Name=\"CallTreePanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"CallerCalleePanelHost\"\n                  Title=\"Caller/Callee\"\n                  ContentId=\"CallerCallee\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <profile:CallerCalleePanel x:Name=\"CallerCalleePanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"FlameGraphPanelHost\"\n                  Title=\"Flame Graph\"\n                  ContentId=\"FlameGraph\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <profile:FlameGraphPanel x:Name=\"FlameGraphPanel\" />\n                </avalonDock:LayoutAnchorable>\n\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"TimelinePanelHost\"\n                  Title=\"Timeline\"\n                  ContentId=\"Timeline\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <profile:TimelinePanel x:Name=\"TimelinePanel\" />\n                </avalonDock:LayoutAnchorable>\n\n                <avalonDock:LayoutAnchorable\n                  x:Name=\"SearchResultsPanelHost\"\n                  Title=\"Search Results\"\n                  ContentId=\"SearchResults\"\n                  IsActiveChanged=\"LayoutAnchorable_IsActiveChanged\"\n                  IsSelectedChanged=\"LayoutAnchorable_IsSelectedChanged\">\n                  <local:SearchResultsPanel x:Name=\"SearchResultsPanel\" />\n                </avalonDock:LayoutAnchorable>\n              </avalonDock:LayoutAnchorablePane>\n            </avalonDock:LayoutAnchorablePaneGroup>\n          </avalonDock:LayoutPanel>\n\n        </avalonDock:LayoutPanel>\n      </avalonDock:LayoutRoot>\n    </avalonDock:DockingManager>\n\n    <StatusBar\n      x:Name=\"MainStatusBar\"\n      Grid.Row=\"2\"\n      Height=\"24\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Image\n        Width=\"14\"\n        Height=\"14\"\n        Source=\"{StaticResource DocumentIcon}\" />\n      <StatusBarItem\n        x:Name=\"IRTypeLabel\"\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\" />\n      <Separator />\n\n      <Image\n        Width=\"14\"\n        Height=\"14\"\n        Source=\"{StaticResource BlockIcon}\" />\n      <TextBlock\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\"\n        Text=\"Block\" />\n      <TextBlock\n        x:Name=\"BlockStatus\"\n        MinWidth=\"80\"\n        MaxWidth=\"80\"\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\"\n        Text=\"2 ($LL4)\"\n        TextTrimming=\"CharacterEllipsis\" />\n      <Separator />\n\n      <Image\n        Width=\"14\"\n        Height=\"14\"\n        Source=\"{StaticResource BookmarkIcon}\" />\n      <TextBlock\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\"\n        Text=\"Bookmark\" />\n      <TextBlock\n        x:Name=\"BookmarkStatus\"\n        MinWidth=\"50\"\n        MaxWidth=\"50\"\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\"\n        Text=\"2 / 3\" />\n      <Separator />\n\n      <TextBlock\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\"\n        Text=\"Workspace\"\n        ToolTip=\"A workspace is a snapshot of a view layout configuration\" />\n      <ComboBox\n        x:Name=\"WorkspaceCombobox\"\n        Width=\"120\"\n        Height=\"18\"\n        Padding=\"2,2,5,0\"\n        Background=\"Transparent\"\n        BorderBrush=\"Transparent\"\n        DisplayMemberPath=\"{Binding Name}\"\n        FontSize=\"11\"\n        SelectionChanged=\"WorkspaceCombobox_SelectionChanged\"\n        ToolTip=\"Switch the active workspace\" />\n      <Button\n        x:Name=\"WorkspacesButton\"\n        Width=\"18\"\n        Height=\"18\"\n        Margin=\"-2,0,0,0\"\n        VerticalAlignment=\"Center\"\n        Background=\"Transparent\"\n        BorderBrush=\"Transparent\"\n        Click=\"WorkspacesButton_OnClick\"\n        FontSize=\"11\"\n        ToolTip=\"Manage workspaces list\">\n        <Image\n          VerticalAlignment=\"Top\"\n          Source=\"{StaticResource EditIcon}\" />\n      </Button>\n      <Separator />\n\n      <TextBlock\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\"\n        Text=\"Theme\" />\n      <ComboBox\n        x:Name=\"ThemeCombobox\"\n        Width=\"80\"\n        Height=\"18\"\n        Padding=\"2,0,0,0\"\n        VerticalAlignment=\"Center\"\n        VerticalContentAlignment=\"Center\"\n        Background=\"Transparent\"\n        FontSize=\"11\"\n        SelectedIndex=\"1\">\n        <ComboBox.Resources>\n          <Style TargetType=\"ComboBoxItem\">\n            <Setter Property=\"FocusVisualStyle\" Value=\"{x:Null}\" />\n          </Style>\n        </ComboBox.Resources>\n        <ComboBoxItem Content=\"Light\">\n          <ComboBoxItem.Tag>\n            <avalonDock:Vs2013LightTheme />\n          </ComboBoxItem.Tag>\n        </ComboBoxItem>\n        <ComboBoxItem Content=\"Dark\">\n          <ComboBoxItem.Tag>\n            <avalonDock:Vs2013DarkTheme />\n          </ComboBoxItem.Tag>\n        </ComboBoxItem>\n        <ComboBoxItem Content=\"Blue\">\n          <ComboBoxItem.Tag>\n            <avalonDock:Vs2013BlueTheme />\n          </ComboBoxItem.Tag>\n        </ComboBoxItem>\n      </ComboBox>\n      <Separator />\n\n      <Button\n        Height=\"18\"\n        Padding=\"2,0,2,0\"\n        VerticalAlignment=\"Center\"\n        Background=\"Transparent\"\n        BorderBrush=\"Transparent\"\n        Click=\"ResetUIZoomMenu_Click\"\n        FontSize=\"11\"\n        ToolTip=\"Restore default UI scaling for the entire application\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          FontSize=\"11\"\n          Text=\"{Binding WindowScaling, Converter={StaticResource RoundedPercentageConverter}}\" />\n      </Button>\n\n      <Button\n        Width=\"18\"\n        Height=\"18\"\n        VerticalAlignment=\"Center\"\n        Background=\"Transparent\"\n        BorderBrush=\"Transparent\"\n        Click=\"ZoomOutUIMenu_Click\"\n        FontSize=\"11\"\n        ToolTip=\"Shrink the UI for the entire application\">\n        <Image\n          VerticalAlignment=\"Center\"\n          Source=\"{StaticResource ZoomOutIcon}\" />\n      </Button>\n      <Button\n        Width=\"18\"\n        Height=\"18\"\n        Margin=\"-3,0,0,0\"\n        VerticalAlignment=\"Center\"\n        Background=\"Transparent\"\n        BorderBrush=\"Transparent\"\n        Click=\"ZoomInUIMenu_Click\"\n        FontSize=\"11\"\n        ToolTip=\"Enlarge the UI for the entire application\">\n        <Image\n          VerticalAlignment=\"Center\"\n          Source=\"{StaticResource ZoomInIcon}\" />\n      </Button>\n      <Separator />\n\n      <ToggleButton\n        x:Name=\"FullScreenButton\"\n        Margin=\"-2,0,0,0\"\n        Padding=\"2,0,2,0\"\n        VerticalAlignment=\"Center\"\n        Background=\"Transparent\"\n        BorderBrush=\"Transparent\"\n        Command=\"local:AppCommand.FullScreen\"\n        FontSize=\"11\"\n        ToolTip=\"Enter/exit full screen mode (F11)\">\n        <StackPanel\n          Margin=\"0,0,1,0\"\n          VerticalAlignment=\"Center\"\n          Orientation=\"Horizontal\">\n          <Image\n            Width=\"14\"\n            Height=\"14\"\n            VerticalAlignment=\"Center\"\n            Source=\"{StaticResource OpenExternalIcon}\" />\n          <TextBlock\n            Height=\"12\"\n            Margin=\"2,0,0,2\"\n            VerticalAlignment=\"Top\"\n            FontSize=\"11\"\n            Text=\"Full Screen\" />\n        </StackPanel>\n      </ToggleButton>\n\n      <ToggleButton\n        x:Name=\"AlwaysOnTopButton\"\n        Width=\"18\"\n        Height=\"18\"\n        Margin=\"-2,0,0,0\"\n        VerticalAlignment=\"Center\"\n        Background=\"Transparent\"\n        BorderBrush=\"Transparent\"\n        Click=\"AlwaysOnTopButton_Click\"\n        FontSize=\"11\"\n        ToolTip=\"Toggle always on top of the main window\">\n        <Image\n          VerticalAlignment=\"Center\"\n          Source=\"{StaticResource PinIcon}\" />\n      </ToggleButton>\n      <Separator />\n\n      <StackPanel\n        Name=\"DocumentLoadProgressPanel\"\n        Orientation=\"Horizontal\"\n        Visibility=\"Collapsed\">\n        <ProgressBar\n          x:Name=\"DocumentLoadProgressBar\"\n          Width=\"100\" />\n        <TextBlock\n          x:Name=\"DocumentLoadLabel\"\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FontSize=\"11\"\n          Text=\"Loading\" />\n      </StackPanel>\n\n      <Button\n        x:Name=\"UpdateButton\"\n        VerticalAlignment=\"Center\"\n        Background=\"#FFAFEABF\"\n        Click=\"UpdateButton_Click\"\n        FontSize=\"11\"\n        FontWeight=\"Medium\"\n        ToolTip=\"Update application to newest version\"\n        Visibility=\"Hidden\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            VerticalAlignment=\"Center\"\n            Source=\"{StaticResource ReloadIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontSize=\"11\"\n            Text=\"Update Available\" />\n        </StackPanel>\n      </Button>\n\n      <TextBlock\n        x:Name=\"OptionalStatusText\"\n        VerticalAlignment=\"Center\"\n        FontSize=\"11\"\n        FontWeight=\"Medium\"\n        Foreground=\"DarkRed\" />\n\n      <CheckBox\n        x:Name=\"DiffPreviousSectionCheckbox\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n        Content=\"Diff with previous\"\n        IsChecked=\"False\"\n        Visibility=\"Collapsed\" />\n\n    </StatusBar>\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/MainWindow.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Interop;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing AutoUpdaterDotNET;\nusing AvalonDock;\nusing AvalonDock.Layout;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.UI.Compilers.ASM;\nusing ProfileExplorer.UI.Compilers.LLVM;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Scripting;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorerUI.Session;\nusing ProfileExplorer.UI.Providers;\nusing ProfileExplorer.UI.Compilers.Default;\nusing ProfileExplorer.Core.Compilers.LLVM;\n\nnamespace ProfileExplorer.UI;\n\npublic static class AppCommand {\n  public static readonly RoutedUICommand FullScreen = new(\"Untitled\", \"FullScreen\", typeof(Window));\n  public static readonly RoutedUICommand OpenDocument = new(\"Untitled\", \"OpenDocument\", typeof(Window));\n  public static readonly RoutedUICommand OpenNewDocument = new(\"Untitled\", \"OpenNewDocument\", typeof(Window));\n  public static readonly RoutedUICommand OpenDebug = new(\"Untitled\", \"OpenDebug\", typeof(Window));\n  public static readonly RoutedUICommand OpenDiffDebug = new(\"Untitled\", \"OpenDiffDebug\", typeof(Window));\n  public static readonly RoutedUICommand OpenExecutable = new(\"Untitled\", \"OpenExecutable\", typeof(Window));\n  public static readonly RoutedUICommand OpenExecutableDiff = new(\"Untitled\", \"OpenExecutableDiff\", typeof(Window));\n  public static readonly RoutedUICommand CloseDocument = new(\"Untitled\", \"CloseDocument\", typeof(Window));\n  public static readonly RoutedUICommand SaveDocument = new(\"Untitled\", \"SaveDocument\", typeof(Window));\n  public static readonly RoutedUICommand SaveAsDocument = new(\"Untitled\", \"SaveAsDocument\", typeof(Window));\n  public static readonly RoutedUICommand ToggleDiffMode = new(\"Untitled\", \"ToggleDiffMode\", typeof(Window));\n  public static readonly RoutedUICommand ReloadDocument = new(\"Untitled\", \"ReloadDocument\", typeof(Window));\n  public static readonly RoutedUICommand AutoReloadDocument = new(\"Untitled\", \"AutoReloadDocument\", typeof(Window));\n  public static readonly RoutedUICommand OpenDiffDocument = new(\"Untitled\", \"OpenDiffDocument\", typeof(Window));\n  public static readonly RoutedUICommand OpenBaseDiffDocuments =\n    new(\"Untitled\", \"OpenBaseDiffDocuments\", typeof(Window));\n  public static readonly RoutedUICommand CloseDiffDocument = new(\"Untitled\", \"CloseDiffDocument\", typeof(Window));\n  public static readonly RoutedUICommand SwapDiffDocuments = new(\"Untitled\", \"SwapDiffDocuments\", typeof(Window));\n  public static readonly RoutedUICommand ShowDocumentSearch = new(\"Untitled\", \"ShowDocumentSearch\", typeof(Window));\n  public static readonly RoutedUICommand LoadProfile = new(\"Untitled\", \"LoadProfile\", typeof(Window));\n  public static readonly RoutedUICommand RecordProfile = new(\"Untitled\", \"RecordProfile\", typeof(Window));\n  public static readonly RoutedUICommand ViewProfileReport = new(\"Untitled\", \"ViewProfileReport\", typeof(Window));\n  public static readonly RoutedUICommand ShowProfileCallGraph = new(\"Untitled\", \"ShowProfileCallGraph\", typeof(Window));\n  public static readonly RoutedUICommand OpenHelpPage = new(\"Untitled\", \"OpenHelpPage\", typeof(Window));\n  public static readonly RoutedUICommand OpenHelpPanel = new(\"Untitled\", \"OpenHelpPanel\", typeof(Window));\n}\n\npublic partial class MainWindow : Window, IUISession, INotifyPropertyChanged {\n  private LayoutDocumentPane activeDocumentPanel_;\n  private AssemblyMetadataTag addressTag_;\n  private bool appIsActivated_;\n  private DispatcherTimer autoSaveTimer_;\n  private Dictionary<string, DateTime> changedDocuments_;\n  private ICompilerInfoProvider compilerInfo_;\n  private ISectionStyleProvider sectionStyleProvider_;\n  private IRRemarkProvider remarkProvider_;\n  private ILoadedSectionHandler loadedSectionHandler_;\n  private IBlockFoldingStrategyProvider blockFoldingStrategyProvider_;\n  private MainWindowState fullScreenRestoreState_;\n  private Dictionary<GraphKind, GraphLayoutCache> graphLayout_;\n  private bool ignoreDiffModeButtonEvent_;\n  private Dictionary<ToolPanelKind, List<PanelHostInfo>> panelHostSet_;\n  private IRTextSection previousDebugSection_;\n  private SessionStateManager sessionState_;\n  private DispatcherTimer updateTimer_;\n  private List<DraggablePopup> detachedPanels_;\n  private Point previousWindowPosition_;\n  private DateTime lastDocumentLoadTime_;\n  private DateTime lastDocumentReloadQueryTime_;\n  private DelayedAction statusTextAction_;\n  private CancelableTaskInstance documentLoadTask_;\n  private object lockObject_;\n  private bool documentSearchVisible_;\n  private DocumentSearchPanel documentSearchPanel_;\n  private bool initialDockLayoutRestored_;\n  private bool profileControlsVisible;\n\n  public MainWindow() {\n    InitializeComponent();\n    panelHostSet_ = new Dictionary<ToolPanelKind, List<PanelHostInfo>>();\n    changedDocuments_ = new Dictionary<string, DateTime>();\n    detachedPanels_ = new List<DraggablePopup>();\n    lockObject_ = new object();\n\n    SetupMainWindow();\n    SetupGraphLayoutCache();\n    SetupEvents();\n    DataContext = this;\n  }\n\n  public FunctionMarkingSettings MarkingSettings => App.Settings.MarkingSettings;\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public bool ProfileControlsVisible {\n    get => profileControlsVisible;\n    set {\n      if (value == profileControlsVisible) return;\n      profileControlsVisible = value;\n      OnPropertyChanged();\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n  public SessionStateManager SessionState => sessionState_;\n\n  public IRTextSummary GetDocumentSummary(IRTextSection section) {\n    return sessionState_.FindLoadedDocument(section).Summary;\n  }\n\n  public void SetSectionAnnotationState(IRTextSection section, bool hasAnnotations) {\n    SectionPanel.SetSectionAnnotationState(section, hasAnnotations);\n  }\n\n  public async Task<IRDocumentHost> SwitchDocumentSectionAsync(OpenSectionEventArgs args) {\n    var documentHost = args.TargetDocument;\n\n    if (documentHost != null) {\n      // Use the existing editor to show the section.\n      documentHost = await OpenDocumentSectionAsync(args, documentHost);\n    }\n    else {\n      // Open a new editor to show the section.\n      documentHost = await OpenDocumentSectionAsync(args);\n    }\n\n    await SectionPanel.SelectSection(args.Section, false);\n    return documentHost;\n  }\n\n  public async Task SwitchGraphsAsync(GraphPanel graphPanel, IRTextSection section,\n                                      IRDocument document) {\n    var action = GetComputeGraphAction(graphPanel.PanelKind);\n    await SwitchGraphsAsync(graphPanel, section, document, action);\n  }\n\n  public void ShowAllReferences(IRElement element, IRDocument document) {\n    ShowAllReferencesImpl(element, document, false);\n  }\n\n  public void ShowSSAUses(IRElement element, IRDocument document) {\n    ShowAllReferencesImpl(element, document, true);\n  }\n\n  public Task SwitchActiveFunction(IRTextFunction function, bool handleProfiling = true) {\n    return SectionPanel.SelectFunction(function, handleProfiling);\n  }\n\n  private void SetupEvents() {\n    ContentRendered += MainWindow_ContentRendered;\n    StateChanged += MainWindow_StateChanged;\n    LocationChanged += MainWindow_LocationChanged;\n    Closing += MainWindow_Closing;\n    Activated += MainWindow_Activated;\n    Deactivated += MainWindow_Deactivated;\n    SizeChanged += MainWindow_SizeChanged;\n  }\n\n  private static void CheckForUpdate() {\n    string autoUpdateInfo;\n\n    switch (RuntimeInformation.OSArchitecture) {\n      case Architecture.Arm64:\n        autoUpdateInfo = App.AutoUpdateInfoArm64;\n        break;\n      case Architecture.X64:\n        autoUpdateInfo = App.AutoUpdateInfox64;\n        break;\n      default:\n        autoUpdateInfo = App.AutoUpdateInfox64;\n        break;\n    }\n\n    try {\n      AutoUpdater.Start(autoUpdateInfo);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed update check: {ex}\");\n    }\n  }\n\n  private static void InstallExtension() {\n    App.InstallExtension();\n  }\n\n  protected override void OnSourceInitialized(EventArgs e) {\n    base.OnSourceInitialized(e);\n    WindowPlacement.SetPlacement(this, App.Settings.MainWindowPlacement);\n\n    // Handle touchpad horizontal scroll event, which is not supported\n    // in WPF by default. This sends the event to any ScrollViewer.\n    var source = PresentationSource.FromVisual(this);\n    ((HwndSource)source)?.AddHook(Hook);\n  }\n\n  private IntPtr Hook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) {\n    switch (msg) {\n      case NativeMethods.WM_MOUSEHWHEEL:\n        int tilt = (short)NativeMethods.HIWORD(wParam);\n        OnMouseTilt(tilt);\n        return (IntPtr)1;\n    }\n\n    return IntPtr.Zero;\n  }\n\n  private void OnMouseTilt(int tilt) {\n    var element = Mouse.DirectlyOver as UIElement;\n\n    if (element == null) return;\n\n    var scrollViewer = element is ScrollViewer viewer ?\n      viewer : Utils.FindParent<ScrollViewer>(element);\n\n    if (scrollViewer != null) {\n      scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset + tilt);\n    }\n  }\n\n  private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e) {\n    UpdateStartPagePanelPosition();\n  }\n\n  private void MainWindow_StateChanged(object sender, EventArgs e) {\n    if (WindowState == WindowState.Minimized) {\n      detachedPanels_.ForEach(panel => panel.Minimize());\n    }\n    else if (WindowState == WindowState.Normal) {\n      detachedPanels_.ForEach(panel => panel.Restore());\n    }\n  }\n\n  private void MainWindow_LocationChanged(object sender, EventArgs e) {\n    var currentWindowPosition = new Point(Left, Top);\n\n    if (detachedPanels_.Count > 0) {\n      var diff = currentWindowPosition - previousWindowPosition_;\n\n      detachedPanels_.ForEach(panel => {\n        panel.HorizontalOffset += diff.X;\n        panel.VerticalOffset += diff.Y;\n      });\n    }\n\n    previousWindowPosition_ = currentWindowPosition;\n  }\n\n  private void CloseDetachedPanels() {\n    // Close all popups.\n    var clone = detachedPanels_.CloneList();\n    clone.ForEach(panel => panel.ClosePopup());\n    detachedPanels_.Clear();\n  }\n\n  private void ShowAllReferencesImpl(IRElement element, IRDocument document, bool showSSAUses) {\n    var panelInfo = FindTargetPanel(document, ToolPanelKind.References);\n    var refPanel = panelInfo.Panel as ReferencesPanel;\n    panelInfo.Host.IsSelected = true;\n    refPanel.FindAllReferences(element, showSSAUses);\n  }\n\n  private void MainWindow_Deactivated(object sender, EventArgs e) {\n    appIsActivated_ = false;\n\n    detachedPanels_.ForEach(panel => {\n      panel.SendToBack();\n    });\n  }\n\n  private async void MainWindow_Activated(object sender, EventArgs e) {\n    appIsActivated_ = true;\n\n    detachedPanels_.ForEach(panel => {\n      panel.BringToFront();\n    });\n\n    await HandleChangedDocuments();\n  }\n\n  private async Task HandleChangedDocuments() {\n    var reloadedDocuments = new List<string>();\n\n    lock (lockObject_) {\n      foreach (var pair in changedDocuments_) {\n        if (pair.Value < lastDocumentLoadTime_ ||\n            pair.Value < lastDocumentReloadQueryTime_) {\n          continue; // Event happened before the last document reload, ignore.\n        }\n\n        reloadedDocuments.Add(pair.Key);\n      }\n\n      changedDocuments_.Clear();\n    }\n\n    foreach (string documentPath in reloadedDocuments) {\n      if (ShowDocumentReloadQuery(documentPath)) {\n        await ReloadDocument(documentPath);\n      }\n      else {\n        // Don't keep showing the dialog if no reload is wanted.\n        changedDocuments_.Clear();\n      }\n    }\n  }\n\n  private void SetupMainWindow() {\n    App.Session = this;\n    PopulateRecentFilesMenu();\n    PopulateWorkspacesCombobox();\n    ThemeCombobox.SelectedIndex = App.Settings.GeneralSettings.ThemeIndex;\n    DiffModeButton.IsEnabled = false;\n    SetActiveProfileFilter(new ProfileFilterState());\n  }\n\n  private void SetupMainWindowCompilerTarget() {\n    IRTypeLabel.Content = compilerInfo_.CompilerDisplayName;\n  }\n\n  private void AddRecentFile(string path) {\n    App.Settings.AddRecentFile(path);\n    App.SaveApplicationSettings();\n    PopulateRecentFilesMenu();\n  }\n\n  private void PopulateRecentFilesMenu() {\n    var savedItems = new List<object>();\n\n    foreach (object item in RecentFilesMenu.Items) {\n      if (item is MenuItem menuItem) {\n        if (menuItem.Tag == null) {\n          savedItems.Add(menuItem);\n        }\n      }\n      else {\n        savedItems.Add(item);\n      }\n    }\n\n    RecentFilesMenu.Items.Clear();\n\n    foreach (string path in App.Settings.RecentFiles) {\n      var item = new MenuItem();\n      item.Header = path;\n      item.Tag = path;\n      item.Click += RecentMenuItem_Click;\n      RecentFilesMenu.Items.Add(item);\n    }\n\n    foreach (object item in savedItems) {\n      RecentFilesMenu.Items.Add(item);\n    }\n  }\n\n  private async void RecentMenuItem_Click(object sender, RoutedEventArgs e) {\n    var menuItem = sender as MenuItem;\n\n    if (menuItem?.Tag != null) {\n      await OpenDocument((string)menuItem.Tag);\n    }\n  }\n\n  private async void MainWindow_Closing(object sender, CancelEventArgs e) {\n    // Save settings, including the window state.\n    App.Settings.MainWindowPlacement = WindowPlacement.GetPlacement(this);\n    App.Settings.GeneralSettings.ThemeIndex = ThemeCombobox.SelectedIndex;\n\n    SaveDockLayout();\n    App.SaveApplicationSettings();\n    Trace.Flush();\n\n    if (!IsSessionStarted) {\n      return;\n    }\n\n    // Skip confirmation dialogs during MCP automation\n    if (App.SuppressDialogsForAutomation) {\n      return;\n    }\n\n    // If the window is minimized, restore it first, otherwise\n    // the message box will not be visible even after restoring the window\n    // and the entire UI is blocked.\n    if (WindowState == WindowState.Minimized) {\n      WindowState = WindowState.Normal;\n    }\n\n    if (sessionState_.Info.IsFileSession) {\n      using var centerForm = new DialogCenteringHelper(this);\n\n      if (IsProfileSession) {\n        // TODO: Profile session saving not yet implemented.\n        var result = MessageBox.Show(\"Do you want to close the application?\", \"Profile Explorer\",\n                                     MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes);\n\n        if (result == MessageBoxResult.No) {\n          e.Cancel = true;\n          return;\n        }\n      }\n      else {\n        var result = MessageBox.Show(\"Save session changes before closing?\", \"Profile Explorer\",\n                                     MessageBoxButton.YesNoCancel, MessageBoxImage.Question, MessageBoxResult.No);\n\n        if (result == MessageBoxResult.Yes) {\n          SaveDocumentExecuted(this, null);\n        }\n        else if (result == MessageBoxResult.Cancel) {\n          e.Cancel = true;\n          return;\n        }\n      }\n    }\n    else {\n      NotifyPanelsOfSessionSave();\n      NotifyDocumentsOfSessionSave();\n\n      if (SectionPanel.HasAnnotatedSections) {\n        using var centerForm = new DialogCenteringHelper(this);\n        var result = MessageBox.Show(\"Save file changes as a new session before closing?\", \"Profile Explorer\",\n                                     MessageBoxButton.YesNoCancel, MessageBoxImage.Question, MessageBoxResult.No);\n\n        if (result == MessageBoxResult.Yes) {\n          SaveDocumentExecuted(this, null);\n        }\n        else if (result == MessageBoxResult.Cancel) {\n          e.Cancel = true;\n          return;\n        }\n      }\n    }\n\n    await EndSession();\n    App.SaveApplicationSettings();\n    Trace.Flush();\n  }\n\n  private async void MainWindow_ContentRendered(object sender, EventArgs e) {\n    SetupStartPagePanel();\n\n    if (!IsSessionStarted) {\n      ShowStartPage();\n    }\n\n    var time = DateTime.UtcNow - App.AppStartTime;\n    DevMenuStartupTime.Header = $\"Startup time: {time.TotalMilliseconds} ms\";\n\n    if (App.Settings.GeneralSettings.CheckForUpdates) {\n      CheckForUpdatesOnStartup();\n    }\n\n    string[] args = Environment.GetCommandLineArgs();\n\n    if (args.Length > 1 && args[1] == \"--open-trace\") {\n      var session = RecordingSession.FromCommandLineArgs();\n      await LoadProfileSession(session);\n    }\n  }\n\n  private async Task LoadProfileSession(RecordingSession session) {\n    var window = new ProfileLoadWindow(this, false, session, true);\n    window.Owner = this;\n    bool? result = window.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      await SetupLoadedProfile();\n    }\n  }\n\n  private void CheckForUpdatesOnStartup() {\n    DelayedAction.StartNew(TimeSpan.FromSeconds(1), () => {\n      Dispatcher.BeginInvoke(new Action(() => {\n        CheckForUpdate();\n      }));\n    });\n  }\n\n  private void StartApplicationUpdateTimer() {\n    AutoUpdater.RunUpdateAsAdmin = true;\n    AutoUpdater.ShowRemindLaterButton = false;\n\n    AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent;\n    updateTimer_ = new DispatcherTimer {Interval = TimeSpan.FromMinutes(10)};\n    updateTimer_.Tick += delegate { CheckForUpdate(); };\n    updateTimer_.Start();\n  }\n\n  private void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args) {\n    if (args == null) {\n      return;\n    }\n\n    if (args.IsUpdateAvailable) {\n      UpdateButton.Visibility = Visibility.Visible;\n      UpdateButton.Tag = args;\n    }\n  }\n\n  private async Task ShowSectionPanelDiffs(ILoadedDocument result) {\n    await SectionPanel.AnalyzeDocumentDiffs();\n    await SectionPanel.RefreshDocumentsDiffs();\n  }\n\n  private void ShowProgressBar(string title) {\n    documentLoadProgressVisible_ = true;\n    DocumentLoadProgressBar.Value = 0;\n    DocumentLoadProgressBar.Visibility = Visibility.Visible;\n    DocumentLoadProgressPanel.Visibility = Visibility.Visible;\n\n    if (string.IsNullOrEmpty(title)) {\n      title = \"Loading\";\n    }\n\n    DocumentLoadLabel.Text = title;\n  }\n\n  private void HideProgressBar() {\n    DocumentLoadProgressPanel.Visibility = Visibility.Collapsed;\n    DocumentLoadProgressBar.Visibility = Visibility.Hidden;\n    DocumentLoadProgressBar.IsIndeterminate = false;\n    DocumentLoadProgressBar.Value = 0;\n    documentLoadProgressVisible_ = false;\n  }\n\n  private void UpdateWindowTitle() {\n    string title = \"Profile Explorer\";\n\n    if (sessionState_.Info.IsFileSession) {\n      title += $\" - {sessionState_.Info.FilePath}\";\n\n      if (sessionState_.MainDocument != null &&\n          sessionState_.MainDocument.BinaryFileExists) {\n        if (ProfileData != null && !string.IsNullOrEmpty(ProfileData.Report.TraceInfo.TraceFilePath)) {\n          title +=\n            $\" ({Utils.TryGetFileName(ProfileData.Report.TraceInfo.TraceFilePath)}, {sessionState_.MainDocument.BinaryFile})\";\n        }\n        else {\n          title += $\" ({sessionState_.MainDocument.BinaryFile})\";\n        }\n      }\n    }\n    else {\n      if (sessionState_.Documents.Count == 1) {\n        string name = sessionState_.Documents[0].BinaryFile?.FilePath ?? sessionState_.Documents[0].FilePath;\n        title += $\" - {name}\";\n      }\n      else if (sessionState_.Documents.Count == 2) {\n        string baseName = sessionState_.Documents[0].BinaryFile?.FilePath ?? sessionState_.Documents[0].FilePath;\n        string diffName = sessionState_.Documents[1].BinaryFile?.FilePath ?? sessionState_.Documents[1].FilePath;\n        title += $\" - Base: {baseName}  | Diff: {diffName}\";\n      }\n    }\n\n    Title = title;\n  }\n\n  private async void Window_Loaded(object sender, RoutedEventArgs e) {\n    await SetupCompilerTarget();\n    SectionPanel.OpenSection += SectionPanel_OpenSection;\n    SectionPanel.EnterDiffMode += SectionPanel_EnterDiffMode;\n    SectionPanel.SyncDiffedDocumentsChanged += SectionPanel_SyncDiffedDocumentsChanged;\n    SectionPanel.DisplayCallGraph += SectionPanel_DisplayCallGraph;\n    SearchResultsPanel.OpenSection += SectionPanel_OpenSection;\n\n    if (!RestoreDockLayout()) {\n      RegisterDefaultToolPanels();\n    }\n\n    ResetStatusBar();\n\n    // Make help panel active on the first run.\n    if (App.IsFirstRun) {\n      await ShowPanel(ToolPanelKind.Help);\n    }\n\n    await ProcessStartupArgs();\n\n    if (!IsSessionStarted) {\n      UpdatePanelEnabledState(false);\n    }\n    else {\n      // Hide the start page if a file was loaded on start.\n      HideStartPage();\n    }\n\n    if (App.Settings.GeneralSettings.CheckForUpdates) {\n      StartApplicationUpdateTimer();\n    }\n  }\n\n  private async Task ProcessStartupArgs() {\n    //? TODO: This needs a proper arg parsing lib\n    string[] args = Environment.GetCommandLineArgs();\n\n    if (args.Length > 1 && args[1] == \"--open-trace\") {\n      // TODO: Opening Profile Explorer with a trace is handled once the ProfileLoadWindow is rendered.\n    }\n    else if (args.Length >= 3) {\n      // Mode for comparing the functions from two different files.\n      string baseFilePath = args[1];\n      string diffFilePath = args[2];\n      bool opened = false;\n\n      if (File.Exists(baseFilePath) && File.Exists(diffFilePath)) {\n        baseFilePath = Path.GetFullPath(baseFilePath);\n        diffFilePath = Path.GetFullPath(diffFilePath);\n        var (baseLoadedDoc, diffLoadedDoc) = await OpenBaseDiffIRDocumentsImpl(baseFilePath, diffFilePath);\n        opened = baseLoadedDoc != null && diffLoadedDoc != null;\n      }\n\n      if (!opened) {\n        MessageBox.Show($\"Failed to open base/diff files {baseFilePath} and {diffFilePath}\");\n        return;\n      }\n\n      if (args.Length >= 5 && IsInTwoDocumentsDiffMode) {\n        if (args[3].EndsWith(\"script\")) {\n          SilentMode = true;\n          string scriptPath = args[4];\n          var script = Script.LoadFromFile(scriptPath);\n\n          if (script == null) {\n            MessageBox.Show($\"Failed {scriptPath}\");\n            MessageBox.Show(string.Join(Environment.NewLine, args));\n          }\n\n          string scriptOutPath = null;\n\n          if (args.Length >= 7) {\n            if (args[5].EndsWith(\"out\")) {\n              scriptOutPath = args[6];\n            }\n          }\n\n          var session = new ScriptSession(null, this) {\n            SilentMode = true,\n            SessionName = scriptOutPath\n          };\n\n          script.Execute(session);\n          Close();\n        }\n        else if (args[3].EndsWith(\"func\")) {\n          // Open a certain function and section from a file.\n          string funcName = args[4];\n          var func = sessionState_.MainDocument.Summary.FindFunction(funcName);\n\n          if (func != null) {\n            await SectionPanel.SelectFunction(func);\n\n            if (args.Length >= 7) {\n              if (args[5].EndsWith(\"section\")) {\n                string sectionName = args[6];\n                var section = func.FindSection(sectionName);\n\n                if (section != null) {\n                  await SectionPanel.SelectSection(section);\n                  SectionPanel.DiffSelectedSection();\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n    else if (args.Length == 2) {\n      // Mode for opening a single file.\n      string filePath = args[1];\n\n      if (File.Exists(filePath)) {\n        filePath = Path.GetFullPath(filePath);\n        await OpenDocument(filePath);\n      }\n    }\n\n    // Mode for starting the GRPC server used by the VS extension.\n    foreach (string arg in args) {\n      if (arg.Contains(\"grpc-server\")) {\n        StartGrpcServer();\n        break;\n      }\n    }\n  }\n\n  private async void SectionPanel_DisplayCallGraph(object sender, DisplayCallGraphEventArgs e) {\n    await DisplayCallGraph(e.Summary, e.Section, e.BuildPartialGraph);\n  }\n\n  private void SetupStartPagePanel() {\n    StartPage.OpenRecentDocument += StartPage_OpenRecentDocument;\n    StartPage.OpenRecentDiffDocuments += StartPage_OpenRecentDiffDocuments;\n    StartPage.OpenRecentProfileSession += StartPage_OpenRecentProfileSession;\n    StartPage.OpenFile += StartPage_OpenFile;\n    StartPage.CompareFiles += StartPage_CompareFiles;\n    StartPage.ClearRecentDocuments += StartPage_ClearRecentDocuments;\n    StartPage.ClearRecentDiffDocuments += StartPage_ClearRecentDiffDocuments;\n    StartPage.ClearRecentProfileSessions += StartPage_ClearRecentProfileSessions;\n    StartPage.LoadProfile += StartPage_LoadProfile;\n    StartPage.RecordProfile += StartPage_RecordProfile;\n    UpdateStartPagePanelPosition();\n  }\n\n  private void StartPage_ClearRecentProfileSessions(object sender, EventArgs e) {\n    using var centerForm = new DialogCenteringHelper(this);\n\n    if (MessageBox.Show(\"Clear the list of recent profile sessions?\", \"Profile Explorer\",\n                        MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) ==\n        MessageBoxResult.Yes) {\n      App.Settings.ClearLoadedProfileSession();\n      App.SaveApplicationSettings();\n      StartPage.ReloadFileList();\n    }\n  }\n\n  private async void StartPage_OpenRecentProfileSession(object sender, RecordingSession session) {\n    await LoadProfileSession(session);\n  }\n\n  private async void StartPage_LoadProfile(object sender, EventArgs e) {\n    await LoadProfile();\n  }\n\n  private async void StartPage_RecordProfile(object sender, EventArgs e) {\n    await RecordProfile();\n  }\n\n  private void StartPage_ClearRecentDiffDocuments(object sender, EventArgs e) {\n    using var centerForm = new DialogCenteringHelper(this);\n\n    if (MessageBox.Show(\"Clear the list of recent compared documents?\", \"Profile Explorer\",\n                        MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) ==\n        MessageBoxResult.Yes) {\n      App.Settings.ClearRecentComparedFiles();\n      App.SaveApplicationSettings();\n      StartPage.ReloadFileList();\n    }\n  }\n\n  private void StartPage_ClearRecentDocuments(object sender, EventArgs e) {\n    using var centerForm = new DialogCenteringHelper(this);\n\n    if (MessageBox.Show(\"Clear the list of recent documents?\", \"Profile Explorer\",\n                        MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) ==\n        MessageBoxResult.Yes) {\n      App.Settings.ClearRecentFiles();\n      App.SaveApplicationSettings();\n      StartPage.ReloadFileList();\n    }\n  }\n\n  private async void StartPage_CompareFiles(object sender, EventArgs e) {\n    await OpenBaseDiffDocuments();\n  }\n\n  private async void StartPage_OpenFile(object sender, EventArgs e) {\n    await OpenDocument();\n  }\n\n  private async void StartPage_OpenRecentDiffDocuments(object sender, Tuple<string, string> e) {\n    await OpenBaseDiffDocuments(e.Item1, e.Item2);\n  }\n\n  private async void StartPage_OpenRecentDocument(object sender, string e) {\n    await OpenDocument(e);\n  }\n\n  private void UpdateStartPagePanelPosition() {\n    if (IsSessionStarted) {\n      return;\n    }\n\n    var documentHost = Utils.FindChildLogical<DockingManager>(this);\n\n    if (documentHost != null) {\n      double height = Math.Max(StartPage.MinHeight, documentHost.ActualHeight * 0.5);\n      StartPage.Height = height;\n    }\n  }\n\n  private void ShowStartPage() {\n    StartPage.ReloadFileList();\n    StartPage.Visibility = Visibility.Visible;\n    Utils.EnableControl(StartPage);\n  }\n\n  private void HideStartPage() {\n    StartPage.Visibility = Visibility.Collapsed;\n  }\n\n  private void UpdateBlockStatusBar(BlockIR block) {\n    string text = Utils.MakeBlockDescription(block);\n    BlockStatus.Text = text;\n    BlockStatus.ToolTip = text;\n  }\n\n  private void ResetStatusBar() {\n    BlockStatus.Text = \"\";\n    BlockStatus.ToolTip = null;\n    BookmarkStatus.Text = \"\";\n    BookmarkStatus.ToolTip = \"\";\n    DiffStatusText.Text = \"\";\n    OptionalStatusText.Text = \"\";\n    OptionalStatusText.ToolTip = \"\";\n  }\n\n  private void FullScreenExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (e.Source != FullScreenButton) {\n      FullScreenButton.IsChecked = !FullScreenButton.IsChecked;\n    }\n\n    if (FullScreenButton.IsChecked.HasValue && FullScreenButton.IsChecked.Value) {\n      fullScreenRestoreState_ = new MainWindowState(this);\n      Visibility = Visibility.Collapsed;\n      ResizeMode = ResizeMode.NoResize;\n      WindowStyle = WindowStyle.None;\n      WindowState = WindowState.Maximized;\n      Visibility = Visibility.Visible;\n      Focus();\n    }\n    else if (fullScreenRestoreState_ != null) {\n      fullScreenRestoreState_.Restore(this);\n      Focus();\n    }\n\n    e.Handled = true;\n  }\n\n  private void ShowDocumentSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ShowDocumentSearchPanel();\n  }\n\n  private void CanExecuteAlways(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = true;\n    e.Handled = true;\n  }\n\n  private string GetDocumentTitle(IRDocumentHost document, IRTextSection section) {\n    bool includeNumber = ProfileData == null || section.ParentFunction.SectionCount > 1;\n    string title = compilerInfo_.NameProvider.GetSectionName(section, includeNumber);\n\n    if (sessionState_.SectionDiffState.IsEnabled) {\n      if (sessionState_.SectionDiffState.LeftDocument == document) {\n        return $\"Base: {title}\";\n      }\n\n      if (sessionState_.SectionDiffState.RightDocument == document) {\n        return $\"Diff: {title}\";\n      }\n    }\n\n    if (!string.IsNullOrEmpty(document.TitlePrefix)) {\n      title = $\"{document.TitlePrefix}{title}\";\n    }\n\n    if (!string.IsNullOrEmpty(document.TitleSuffix)) {\n      title = $\"{title}{document.TitleSuffix}\";\n    }\n\n    return title;\n  }\n\n  private string GetDocumentDescription(IRDocumentHost document, IRTextSection section) {\n    var docInfo = sessionState_.FindLoadedDocument(section);\n    string funcName = compilerInfo_.NameProvider.FormatFunctionName(section.ParentFunction);\n    funcName = DocumentUtils.FormatLongFunctionName(funcName);\n    string text = $\"Module: {section.ModuleName}\\nFunction: {funcName}\";\n\n    if (!string.IsNullOrEmpty(document.DescriptionPrefix)) {\n      text = $\"{document.DescriptionPrefix}{text}\";\n    }\n\n    if (!string.IsNullOrEmpty(document.DescriptionSuffix)) {\n      text = $\"{text}{document.DescriptionSuffix}\";\n    }\n\n    return text.Trim();\n  }\n\n  private async Task DisplayCallGraph(IRTextSummary summary, IRTextSection section,\n                                      bool buildPartialGraph) {\n    var loadedDoc = sessionState_.FindLoadedDocument(summary);\n    var layoutGraph = await Task.Run(() =>\n                                       CallGraphUtils.BuildCallGraphLayout(summary, section, loadedDoc,\n                                                                           CompilerInfo, buildPartialGraph));\n    DisplayCallGraph(layoutGraph, section);\n  }\n\n  private void DisplayCallGraph(Graph layoutGraph, IRTextSection section) {\n    var panel = new CallGraphPanel(this);\n    panel.TitleSuffix = $\" - S{section.Number} ({CompilerInfo.NameProvider.GetSectionName(section)})\";\n\n    DisplayFloatingPanel(panel);\n    panel.DisplayGraph(layoutGraph);\n  }\n\n  private async void GraphViewer_NodeSelected(object sender, TaggedObject e) {\n    var graphNode = e as CallGraphNode;\n\n    if (graphNode != null && graphNode.Function != null) {\n      await SectionPanel.SelectFunction(graphNode.Function);\n    }\n  }\n\n  private void UpdateButton_Click(object sender, RoutedEventArgs e) {\n    var updateWindow = new UpdateWindow(UpdateButton.Tag as UpdateInfoEventArgs);\n    updateWindow.Owner = this;\n    bool? installUpdate = updateWindow.ShowDialog();\n\n    if (installUpdate.HasValue && installUpdate.Value) {\n      Close();\n    }\n\n    UpdateButton.Visibility = Visibility.Collapsed;\n  }\n\n  private void ExitMenuItem_Click(object sender, RoutedEventArgs e) {\n    Close();\n  }\n\n  private void RecentFilesMenu_Click(object sender, RoutedEventArgs e) {\n    App.Settings.ClearRecentFiles();\n    PopulateRecentFilesMenu();\n  }\n\n  private void SettingsMenu_Click(object sender, RoutedEventArgs e) {\n    var optionsWindow = new OptionsWindow(this);\n    optionsWindow.Owner = this;\n    optionsWindow.ShowDialog();\n  }\n\n  private void OpenHelpPageExecuted(object sender, ExecutedRoutedEventArgs e) {\n    App.OpenDocumentation();\n  }\n\n  private async void OpenHelpPanelExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await ShowPanel(ToolPanelKind.Help);\n  }\n\n  private void AboutMenu_Click(object sender, RoutedEventArgs e) {\n    var window = new AboutWindow();\n    window.Owner = this;\n    window.ShowDialog();\n  }\n\n  private void DiagnosticLogMenu_Click(object sender, RoutedEventArgs e) {\n    try {\n      string logInfo = DiagnosticLogger.GetLogFileInfo();\n      var result = MessageBox.Show(logInfo + \"\\n\\nClick OK to open the log file location in Windows Explorer.\", \n                                   \"Diagnostic Log\", MessageBoxButton.OKCancel, MessageBoxImage.Information);\n      \n      if (result == MessageBoxResult.OK) {\n        DiagnosticLogger.ShowLogFileLocation();\n      }\n    }\n    catch (Exception ex) {\n      MessageBox.Show($\"Failed to access diagnostic log: {ex.Message}\", \"Error\", \n                      MessageBoxButton.OK, MessageBoxImage.Error);\n    }\n  }\n\n  private void SetOptionalStatus(TimeSpan duration, string text, string tooltip = \"\", Brush textBrush = null) {\n    SetOptionalStatus(text, tooltip, textBrush);\n    statusTextAction_ = DelayedAction.StartNew(duration, () => SetOptionalStatus(\"\"));\n  }\n\n  private void SetOptionalStatus(string text, string tooltip = \"\", Brush textBrush = null) {\n    statusTextAction_?.Cancel();\n\n    if (!Dispatcher.CheckAccess()) {\n      Dispatcher.Invoke(() => SetOptionalStatusImpl(text, tooltip, textBrush));\n    }\n    else {\n      SetOptionalStatusImpl(text, tooltip, textBrush);\n    }\n  }\n\n  private void SetOptionalStatusImpl(string text, string tooltip = \"\", Brush textBrush = null) {\n    OptionalStatusText.Text = text;\n    OptionalStatusText.Foreground = textBrush ?? Brushes.Black;\n    OptionalStatusText.ToolTip = tooltip;\n    OptionalStatusText.Visibility = !string.IsNullOrEmpty(text) ? Visibility.Visible : Visibility.Collapsed;\n  }\n\n  private void MenuItem_Click_9(object sender, RoutedEventArgs e) {\n    InstallExtension();\n  }\n\n  private void AlwaysOnTopMenu_Click(object sender, RoutedEventArgs e) {\n    SetAlwaysOnTop(AlwaysOnTopCheckbox.IsChecked);\n  }\n\n  private void AlwaysOnTopButton_Click(object sender, RoutedEventArgs e) {\n    SetAlwaysOnTop(AlwaysOnTopButton.IsChecked.HasValue && AlwaysOnTopButton.IsChecked.Value);\n  }\n\n  private void SetAlwaysOnTop(bool state) {\n    Topmost = state;\n    AlwaysOnTopCheckbox.IsChecked = state;\n    AlwaysOnTopButton.IsChecked = state;\n  }\n\n  private async Task SwitchCompilerTarget(ICompilerInfoProvider compilerInfo) {\n    await EndSession();\n    compilerInfo_ = compilerInfo;\n    remarkProvider_ = new DefaultRemarkProvider(compilerInfo);\n    blockFoldingStrategyProvider_ = new BasicBlockFoldingStrategyProvider();\n\n    switch (compilerInfo.CompilerIRKind) {\n      case CompilerIRKind.ASM:\n        sectionStyleProvider_ = new DummySectionStyleProvider();\n        loadedSectionHandler_ = new ASMLoadedSectionHandler(compilerInfo);\n        break;\n      case CompilerIRKind.LLVM:\n        sectionStyleProvider_ = new DefaultSectionStyleProvider(compilerInfo);\n        loadedSectionHandler_ = new LLVMLoadedSectionHandler();\n        break;\n      default:\n        throw new NotSupportedException($\"Unsupported compiler IR kind: {compilerInfo.CompilerIRKind}\");\n    }\n    \n    App.Settings.CompilerIRSwitched(compilerInfo_.CompilerIRName, compilerInfo.IR.Mode);\n    SetupMainWindowCompilerTarget();\n  }\n\n  private async Task SetupCompilerTarget() {\n    await SwitchCompilerTarget(App.Settings.DefaultCompilerIR, App.Settings.DefaultIRMode);\n  }\n\n  private async Task SwitchCompilerTarget(string name, IRMode irMode = IRMode.Default) {\n    if (Enum.TryParse<CompilerIRKind>(name, out var compilerKind)) {\n      switch (compilerKind) {\n        case CompilerIRKind.LLVM: {\n          await SwitchCompilerTarget(new LLVMCompilerInfoProvider());\n          break;\n        }\n        case CompilerIRKind.ASM: {\n          await SwitchCompilerTarget(new ASMCompilerInfoProvider(irMode));\n          break;\n        }\n      }\n    }\n    else {\n      await SwitchCompilerTarget(new ASMCompilerInfoProvider(IRMode.x86_64));\n    }\n \n    App.Settings.SwitchDefaultCompilerIR(compilerInfo_.CompilerIRName, irMode);\n    App.SaveApplicationSettings();\n  }\n\n  private void FindButton_Click(object sender, RoutedEventArgs e) {\n    ShowDocumentSearchPanel();\n  }\n\n  private async void FunctionReportMenu_Click(object sender, RoutedEventArgs e) {\n    await SectionPanel.ShowModuleReport();\n  }\n\n  private void ShowWorkspacesMenu_Click(object sender, RoutedEventArgs e) {\n    ShowWorkspacesWindow();\n  }\n\n  private async void HelpButton_Click(object sender, RoutedEventArgs e) {\n    await ShowPanel(ToolPanelKind.Help);\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private void ProfileMenuItem_Click(object sender, RoutedEventArgs e) {\n    ReloadMarkingSettings();\n  }\n\n  private void ZoomInUIMenu_Click(object sender, RoutedEventArgs e) {\n    App.Settings.GeneralSettings.ZoomInWindow();\n    OnPropertyChanged(nameof(WindowScaling));\n  }\n\n  private void ZoomOutUIMenu_Click(object sender, RoutedEventArgs e) {\n    App.Settings.GeneralSettings.ZoomOutWindow();\n    OnPropertyChanged(nameof(WindowScaling));\n  }\n\n  private void ResetUIZoomMenu_Click(object sender, RoutedEventArgs e) {\n    App.Settings.GeneralSettings.ResetWindowZoom();\n    OnPropertyChanged(nameof(WindowScaling));\n  }\n\n  private void CheckUpdatesMenu_Click(object sender, RoutedEventArgs e) {\n    CheckForUpdate();\n  }\n\n  private class MainWindowState {\n    public MainWindowState(MainWindow window) {\n      CurrentResizeMode = window.ResizeMode;\n      CurrentWindowStyle = window.WindowStyle;\n      CurrentWindowState = window.WindowState;\n      IsTopmost = window.Topmost;\n      CurrentMenuVisibility = window.MainMenu.Visibility;\n      CurrentMenuHeight = window.MainGrid.RowDefinitions[0].Height;\n    }\n\n    public ResizeMode CurrentResizeMode { get; set; }\n    public WindowStyle CurrentWindowStyle { get; set; }\n    public WindowState CurrentWindowState { get; set; }\n    public bool IsTopmost { get; set; }\n    public Visibility CurrentMenuVisibility { get; set; }\n    public GridLength CurrentMenuHeight { get; set; }\n\n    public void Restore(MainWindow window) {\n      window.ResizeMode = CurrentResizeMode;\n      window.WindowStyle = CurrentWindowStyle;\n      window.WindowState = CurrentWindowState;\n      window.Topmost = IsTopmost;\n      window.MainMenu.Visibility = CurrentMenuVisibility;\n      window.MainGrid.RowDefinitions[0].Height = CurrentMenuHeight;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/MainWindowDebugRpc.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.UI.DebugServer;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class MainWindow : Window, IUISession {\n  private DebugServer.DebugService debugService_;\n  private Dictionary<ElementIteratorId, IRElement> debugCurrentIteratorElement_;\n  private StackFrame debugCurrentStackFrame_;\n  private IRTextFunction debugFunction_;\n  private long debugProcessId_;\n  private int debugSectionId_;\n  private DebugSectionLoader debugSections_;\n  private IRTextSummary debugSummary_;\n  private CancelableTask sessionStartTask_;\n\n  private void StartGrpcServer() {\n    try {\n      Trace.TraceInformation(\"Starting Grpc server...\");\n      debugService_ = new DebugServer.DebugService();\n      debugService_.OnStartSession += DebugService_OnSessionStarted;\n      debugService_.OnUpdateIR += DebugService_OnIRUpdated;\n      debugService_.OnMarkElement += DebugService_OnElementMarked;\n      debugService_.OnSetCurrentElement += DebugService_OnSetCurrentElement;\n      debugService_.OnExecuteCommand += DebugService_OnExecuteCommand;\n      debugService_.OnHasActiveBreakpoint += DebugService_OnHasActiveBreakpoint;\n      debugService_.OnClearTemporaryHighlighting += DebugService__OnClearTemporaryHighlighting;\n      debugService_.OnUpdateCurrentStackFrame += DebugService__OnUpdateCurrentStackFrame;\n\n      Trace.TraceInformation(\"Grpc server started, waiting for client...\");\n      SetOptionalStatus(\"Waiting for client...\");\n      DiffPreviousSectionCheckbox.Visibility = Visibility.Visible;\n\n      DebugServer.DebugService.StartServer(debugService_);\n    }\n    catch (Exception ex) {\n      Trace.TraceError(\"Failed to start Grpc server: {0}\", $\"{ex.Message}\\n{ex.StackTrace}\");\n      SetOptionalStatus(\"Failed to start Grpc server.\", $\"{ex.Message}\\n{ex.StackTrace}\", Brushes.Red);\n    }\n  }\n\n  private async Task<bool> WaitForSessionInitialization() {\n    // Wait until the session initialized properly.\n    if (sessionStartTask_ == null) {\n      return false;\n    }\n\n    Trace.WriteLine(\"=> WaitForSessionInitialization\\n\");\n\n    if (sessionStartTask_.IsCompleted) {\n      Trace.WriteLine(\"  < already completed\\n\");\n      return true;\n    }\n\n    Trace.WriteLine(\"  > start waiting\\n\");\n\n    if (!await Task.Run(() => sessionStartTask_.WaitToComplete(TimeSpan.FromSeconds(30))).ConfigureAwait(false)) {\n      Trace.WriteLine(\"    < timeout\\n\");\n      return false;\n    }\n\n    Trace.WriteLine($\"    < completed {sessionStartTask_.IsCompleted}\\n\");\n    return sessionStartTask_.IsCompleted;\n  }\n\n  private async void DebugService__OnUpdateCurrentStackFrame(object sender, CurrentStackFrameRequest e) {\n    if (!await WaitForSessionInitialization().ConfigureAwait(false)) {\n      return;\n    }\n\n    await Dispatcher.BeginInvoke(new Action(async () => {\n      debugCurrentStackFrame_ = e.CurrentFrame;\n    }));\n  }\n\n  private async void DebugService__OnClearTemporaryHighlighting(object sender, ClearHighlightingRequest e) {\n    if (!await WaitForSessionInitialization().ConfigureAwait(false)) {\n      return;\n    }\n\n    await Dispatcher.BeginInvoke(new Action(async () => {\n      var activeDoc = await GetDebugSessionDocument();\n\n      if (activeDoc == null) {\n        return;\n      }\n\n      var action = new DocumentAction(DocumentActionKind.ClearTemporaryMarkers);\n      activeDoc.TextView.ExecuteDocumentAction(action);\n    }));\n  }\n\n  private async void DebugService_OnHasActiveBreakpoint(object sender,\n                                                        RequestResponsePair<ActiveBreakpointRequest, bool> e) {\n    if (!await WaitForSessionInitialization().ConfigureAwait(false)) {\n      return;\n    }\n\n    if (addressTag_ == null) {\n      return;\n    }\n\n    if (addressTag_.AddressToElementMap.TryGetValue(e.Request.ElementAddress, out var element)) {\n      await Dispatcher.BeginInvoke(async () => {\n        var activeDoc = await GetDebugSessionDocument();\n        if (activeDoc == null)\n          return;\n        e.Response = activeDoc.TextView.BookmarkManager.FindBookmark(element) != null;\n      });\n    }\n  }\n\n  private DocumentActionKind CommandToAction(ElementCommand command) {\n    return command switch {\n      ElementCommand.GoToDefinition => DocumentActionKind.GoToDefinition,\n      ElementCommand.MarkBlock      => DocumentActionKind.MarkBlock,\n      ElementCommand.MarkExpression => DocumentActionKind.MarkExpression,\n      ElementCommand.MarkReferences => DocumentActionKind.MarkReferences,\n      ElementCommand.MarkUses       => DocumentActionKind.MarkUses,\n      ElementCommand.ShowExpression => DocumentActionKind.ShowExpressionGraph,\n      ElementCommand.ShowReferences => DocumentActionKind.ShowReferences,\n      ElementCommand.ShowUses       => DocumentActionKind.ShowUses,\n      ElementCommand.ClearMarker    => DocumentActionKind.ClearMarker,\n      _                             => throw new NotImplementedException()\n    };\n  }\n\n  private async void DebugService_OnExecuteCommand(object sender, ElementCommandRequest e) {\n    if (!await WaitForSessionInitialization().ConfigureAwait(false)) {\n      return;\n    }\n\n    //? TODO: This can be another race condition, it should wait for the IR to be set\n    if (addressTag_ == null) {\n      return;\n    }\n\n    if (addressTag_.AddressToElementMap.TryGetValue(e.ElementAddress, out var element)) {\n      await Dispatcher.BeginInvoke(new Action(async () => {\n        var activeDoc = await GetDebugSessionDocument();\n        if (activeDoc == null)\n          return;\n\n        AppendNotesTag(element, e.Label);\n        var style = new PairHighlightingStyle();\n        style.ParentStyle = new HighlightingStyle(Colors.Transparent, ColorPens.GetPen(Colors.Purple));\n\n        style.ChildStyle = new HighlightingStyle(Colors.LightPink,\n                                                 ColorPens.GetPen(Colors.MediumVioletRed));\n\n        var actionKind = CommandToAction(e.Command);\n\n        if (actionKind == DocumentActionKind.MarkExpression) {\n          var data = new MarkActionData {\n            IsTemporary = e.Highlighting == HighlightingType.Temporary\n          };\n\n          var action = new DocumentAction(actionKind, element, data);\n          activeDoc.TextView.ExecuteDocumentAction(action);\n        }\n        else {\n          var action = new DocumentAction(actionKind, element, style);\n          activeDoc.TextView.ExecuteDocumentAction(action);\n        }\n      }));\n    }\n  }\n\n  private async void DebugService_OnSetCurrentElement(object sender, SetCurrentElementRequest e) {\n    if (!await WaitForSessionInitialization().ConfigureAwait(false)) {\n      return;\n    }\n\n    if (addressTag_ == null) {\n      return;\n    }\n\n    await Dispatcher.BeginInvoke(new Action(async () => {\n      var activeDoc = await GetDebugSessionDocument();\n      if (activeDoc == null)\n        return;\n\n      try {\n        var elementIteratorId = new ElementIteratorId(e.ElementId, e.ElementKind);\n\n        if (debugCurrentIteratorElement_.TryGetValue(elementIteratorId, out var currentElement)) {\n          currentElement.RemoveTag<NotesTag>();\n          activeDoc.TextView.ClearMarkedElement(currentElement);\n          debugCurrentIteratorElement_.Remove(elementIteratorId);\n        }\n\n        if (e.ElementAddress != 0 &&\n            addressTag_.AddressToElementMap.TryGetValue(e.ElementAddress, out var element)) {\n          var notesTag = AppendNotesTag(element, e.Label);\n\n          if (e.ElementKind == IRElementKind.Block) {\n            activeDoc.TextView.MarkBlock(element, GetIteratorElementStyle(elementIteratorId));\n          }\n          else {\n            activeDoc.TextView.MarkElement(element, GetIteratorElementStyle(elementIteratorId));\n          }\n\n          activeDoc.TextView.BringElementIntoView(element);\n          debugCurrentIteratorElement_[elementIteratorId] = element;\n        }\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed OnSetCurrentElement: {ex.Message}, {ex.StackTrace}\");\n      }\n    }));\n  }\n\n  private NotesTag AppendNotesTag(IRElement element, string label) {\n    if (!string.IsNullOrEmpty(label)) {\n      element.RemoveTag<NotesTag>();\n      var notesTag = element.GetOrAddTag<NotesTag>();\n      notesTag.Title = label;\n\n      if (debugCurrentStackFrame_ != null) {\n        notesTag.Notes.Add(\n          $\"{debugCurrentStackFrame_.Function}:{debugCurrentStackFrame_.LineNumber}\");\n      }\n\n      return notesTag;\n    }\n\n    return null;\n  }\n\n  private HighlightingStyle GetIteratorElementStyle(ElementIteratorId elementIteratorId) {\n    return elementIteratorId.ElementKind switch {\n      IRElementKind.Instruction => new HighlightingStyle(\n        Colors.LightBlue, ColorPens.GetPen(Colors.MediumBlue)),\n      IRElementKind.Operand => new HighlightingStyle(Colors.PeachPuff,\n                                                     ColorPens.GetPen(Colors.SaddleBrown)),\n      IRElementKind.User => new HighlightingStyle(Utils.ColorFromString(\"#EFBEE6\"),\n                                                  ColorPens.GetPen(Colors.Purple)),\n      IRElementKind.UserParent =>\n        new HighlightingStyle(Colors.Lavender, ColorPens.GetPen(Colors.Purple)),\n      IRElementKind.Block => new HighlightingStyle(Colors.LightBlue, ColorPens.GetPen(Colors.LightBlue)),\n      _                   => new HighlightingStyle(Colors.Gray)\n    };\n  }\n\n  private async void DebugService_OnElementMarked(object sender, MarkElementRequest e) {\n    if (!await WaitForSessionInitialization().ConfigureAwait(false)) {\n      return;\n    }\n\n    if (addressTag_ == null) {\n      return;\n    }\n\n    if (addressTag_.AddressToElementMap.TryGetValue(e.ElementAddress, out var element)) {\n      Dispatcher.BeginInvoke(new Action(async () => {\n        var activeDoc = await GetDebugSessionDocument();\n        var notesTag = AppendNotesTag(element, e.Label);\n\n        if (e.Highlighting == HighlightingType.Temporary) {\n          activeDoc.TextView.HighlightElement(element, HighlighingType.Selected);\n        }\n        else {\n          HighlightingStyle style;\n\n          if (e.Color != null && e.Color.IsValidRGBColor()) {\n            style = new HighlightingStyle(e.Color.ToColor());\n          }\n          else if (debugCurrentStackFrame_ != null) {\n            // Pick a color based on the source line number.\n            style = DefaultHighlightingStyles.StyleSet.ForIndex(debugCurrentStackFrame_.LineNumber);\n          }\n          else {\n            style = new HighlightingStyle(Colors.Gray);\n          }\n\n          activeDoc.TextView.MarkElement(element, style);\n        }\n\n        activeDoc.TextView.BringElementIntoView(element);\n      }));\n    }\n  }\n\n  private async Task<IRDocumentHost> GetDebugSessionDocument() {\n    // Find the document with the last version of the IR loaded.\n    // If there is none, use the current active document.\n    var result = FindDebugSessionDocument();\n\n    if (result != null) {\n      return result;\n    }\n\n    var activeDoc = FindActiveDocumentHost();\n\n    if (activeDoc != null) {\n      return activeDoc;\n    }\n\n    return await ReopenDebugSessionDocument();\n  }\n\n  private IRDocumentHost FindDebugSessionDocument() {\n    var result = sessionState_.DocumentHosts.Find(item => item.DocumentHost.Section == previousDebugSection_);\n\n    if (result != null) {\n      return result.DocumentHost;\n    }\n\n    return null;\n  }\n\n  private async Task<IRDocumentHost> ReopenDebugSessionDocument() {\n    if (previousDebugSection_ == null) {\n      return null;\n    }\n\n    return await OpenDocumentSectionAsync(\n      new OpenSectionEventArgs(previousDebugSection_, OpenSectionKind.ReplaceCurrent));\n  }\n\n  private string ExtractFunctionName(string text) {\n    int startIndex = 0;\n\n    while (startIndex < text.Length) {\n      int index = text.IndexOfAny(new[] {'\\r', '\\n'}, startIndex);\n\n      if (index != -1) {\n        string line = text.Substring(startIndex, index - startIndex + 1);\n        startIndex = index + 1;\n      }\n      else {\n        break;\n      }\n    }\n\n    return null;\n  }\n\n  private async void DebugService_OnIRUpdated(object sender, UpdateIRRequest e) {\n    if (!await WaitForSessionInitialization().ConfigureAwait(false)) {\n      return;\n    }\n\n    await Dispatcher.BeginInvoke(new Action(async () => {\n      if (!IsSessionStarted ||\n          sessionState_.MainDocument == null) {\n        return;\n      }\n\n      string funcName = ExtractFunctionName(e.Text);\n      funcName ??= \"Debugged function\";\n\n      if (previousDebugSection_ != null) {\n        // Task.Run(() => previousDebugSection_.CompressLineMetadata());\n        previousDebugSection_.CompressLineMetadata();\n      }\n\n      if (debugFunction_ == null || funcName != debugFunction_.Name) {\n        debugFunction_ = new IRTextFunction(funcName);\n        previousDebugSection_ = null;\n        debugSectionId_ = 0;\n        debugCurrentIteratorElement_ = new Dictionary<ElementIteratorId, IRElement>();\n        sessionState_.MainDocument.Summary.AddFunction(debugFunction_);\n      }\n\n      string sectionName = $\"Version {debugSectionId_ + 1}\";\n\n      if (debugCurrentStackFrame_ != null) {\n        sectionName += $\" ({debugCurrentStackFrame_.Function}:{debugCurrentStackFrame_.LineNumber})\";\n      }\n\n      var section = new IRTextSection(debugFunction_, sectionName, IRPassOutput.Empty);\n      string filteredText = ExtractLineMetadata(section, e.Text);\n\n      // Ignore if nothing changed.\n      try {\n        if (previousDebugSection_ != null &&\n            debugSections_.GetSectionText(previousDebugSection_) == filteredText) {\n          return; // Text unchanged\n        }\n      }\n      catch (Exception ex) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Unexpected RPC failure: {ex.Message}\\n {ex.StackTrace}\");\n      }\n\n      debugFunction_.AddSection(section);\n      debugSummary_.AddSection(section);\n      debugSections_.AddSection(section, filteredText);\n\n      // Force function list update when updating summary.\n      await SectionPanel.SetMainSummary(debugSummary_, true);\n      await SectionPanel.SelectSection(section);\n\n      //? TODO: After switch, try to restore same position in doc\n      //? Markers, bookmarks, notes, etc should be copied over\n      var document = FindDebugSessionDocument();\n      double horizontalOffset = 0;\n      double verticalOffset = 0;\n\n      if (previousDebugSection_ != null && document != null) {\n        horizontalOffset = document.TextView.HorizontalOffset;\n        verticalOffset = document.TextView.VerticalOffset;\n      }\n\n      await OpenDocumentSectionAsync(new OpenSectionEventArgs(section, OpenSectionKind.ReplaceCurrent), document);\n\n      //? TODO: Have a proper option in the UI for diffing previous section\n      if (previousDebugSection_ != null && document != null) {\n        if (DiffPreviousSectionCheckbox.IsChecked.HasValue &&\n            DiffPreviousSectionCheckbox.IsChecked.Value) {\n          await DiffSingleDocumentSections(document, section, previousDebugSection_);\n          document.TextView.ScrollToHorizontalOffset(horizontalOffset);\n          document.TextView.ScrollToVerticalOffset(verticalOffset);\n        }\n      }\n\n      previousDebugSection_ = section;\n      debugSectionId_++;\n    }));\n  }\n\n  //? TODO: Not needed anymore, parser should have extracted metadata already\n  private string ExtractLineMetadata(IRTextSection section, string text) {\n    var builder = new StringBuilder(text.Length);\n    string[] lines = text.Split(new[] {\"\\r\\n\", \"\\r\", \"\\n\"}, StringSplitOptions.None);\n    int metadataLines = 0;\n\n    for (int i = 0; i < lines.Length; i++) {\n      string line = lines[i];\n\n      if (line.StartsWith(\"/// metadata:\")) {\n        section.AddLineMetadata(i - metadataLines - 1, line);\n        metadataLines++;\n      }\n      else {\n        builder.AppendLine(line);\n      }\n    }\n\n    return builder.ToString();\n  }\n\n  private async void DebugService_OnSessionStarted(object sender, StartSessionRequest e) {\n    if (e.ProcessId == debugProcessId_) {\n      return;\n    }\n\n    // Mark that session is about to start.\n    await WaitForSessionInitialization().ConfigureAwait(false);\n    sessionStartTask_ = new CancelableTask();\n    Trace.WriteLine(\"=> OnSessionStarted\\n\");\n\n    Dispatcher.BeginInvoke(new Action(async () => {\n      try {\n        Trace.WriteLine(\"=> BeginInvoke OnSessionStarted\\n\");\n        SetOptionalStatus(TimeSpan.FromSeconds(10), $\"Client connected to process #{e.ProcessId}\");\n        await EndSession();\n\n        FunctionAnalysisCache.DisableCache(); // Reduce memory usage.\n        var result = new LoadedDocument(\"Debug session\", \"\", Guid.NewGuid());\n        debugSections_ = new DebugSectionLoader(compilerInfo_.IR);\n        debugSummary_ = await debugSections_.LoadDocument(null);\n        result.Loader = debugSections_;\n        result.Summary = debugSummary_;\n        result.ModuleName = \"Debug session\";\n\n        SetupOpenedIRDocument(SessionKind.DebugSession, result).Wait();\n\n        debugCurrentIteratorElement_ = new Dictionary<ElementIteratorId, IRElement>();\n        debugProcessId_ = e.ProcessId;\n        debugSectionId_ = 0;\n        debugFunction_ = null;\n        previousDebugSection_ = null;\n\n        // Mark session started.\n        Trace.WriteLine(\"<= OnSessionStarted\\n\");\n        sessionStartTask_.Complete();\n      }\n      catch (Exception ex) {\n        Trace.TraceError(\"Failed to start debug session: {0}\", $\"{ex.Message}\\n{ex.StackTrace}\");\n        SetOptionalStatus(\"Failed to start debug session\", ex.Message, Brushes.Red);\n        sessionStartTask_.Cancel();\n      }\n    }), DispatcherPriority.Send);\n  }\n\n  private struct ElementIteratorId {\n    public int ElementId;\n    public IRElementKind ElementKind;\n\n    public ElementIteratorId(int elementId, IRElementKind elementKind) {\n      ElementId = elementId;\n      ElementKind = elementKind;\n    }\n\n    public override bool Equals(object obj) {\n      return obj is ElementIteratorId id &&\n             ElementId == id.ElementId &&\n             ElementKind == id.ElementKind;\n    }\n\n    public override int GetHashCode() {\n      return HashCode.Combine(ElementId, ElementKind);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/MainWindowDiff.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing DiffPlex.DiffBuilder.Model;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Document.Renderers.Highlighters;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Diff;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorerUI.Session;\nusing static System.Runtime.InteropServices.JavaScript.JSType;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class MainWindow : Window, IUISession {\n  private OptionsPanelHostPopup diffOptionsPanelHost_;\n  private DateTime documentLoadStartTime_;\n  private bool documentLoadProgressVisible_;\n  private bool loadingDocuments_;\n  private bool diffOptionsVisible_;\n\n  public async Task ReloadDiffSettings(DiffSettings newSettings, bool hasHandlingChanges) {\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    if (hasHandlingChanges) {\n      // Diffs must be recomputed.\n      var leftDocument = sessionState_.SectionDiffState.LeftDocument;\n      var rightDocument = sessionState_.SectionDiffState.RightDocument;\n\n      await ExitDocumentDiffState();\n      await EnterDocumentDiffState(leftDocument, rightDocument);\n    }\n    else {\n      // Only diff style must be updated.\n      await sessionState_.SectionDiffState.LeftDocument.ReloadSettings();\n      await sessionState_.SectionDiffState.RightDocument.ReloadSettings();\n    }\n  }\n\n  private async void OpenBaseDiffDocumentsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await OpenBaseDiffDocuments();\n  }\n\n  private async Task OpenBaseDiffDocuments() {\n    var openWindow = new DiffOpenWindow(this);\n    openWindow.Owner = this;\n    bool? result = openWindow.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      await OpenBaseDiffDocuments(openWindow.BaseFilePath, openWindow.DiffFilePath);\n    }\n  }\n\n  private async Task<(ILoadedDocument, ILoadedDocument)>\n    OpenBaseDiffDocuments(string baseFilePath, string diffFilePath) {\n    var (baseDoc, diffDoc) = await OpenBaseDiffIRDocumentsImpl(baseFilePath, diffFilePath);\n\n    if (baseDoc == null || diffDoc == null) {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show(\"Failed to load base/diff files\", \"Profile Explorer\", MessageBoxButton.OK,\n                      MessageBoxImage.Exclamation);\n    }\n\n    return (baseDoc, diffDoc);\n  }\n\n  private async void ToggleDiffModeExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!IsSessionStarted) {\n      return; // No sessions started yet.\n    }\n\n    if (IsInDiffMode) {\n      await ExitDocumentDiffState();\n    }\n    else {\n      await EnterDocumentDiffState();\n    }\n  }\n\n  private async void SwapDiffDocumentsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!IsSessionStarted) {\n      return; // No sessions started yet.\n    }\n\n    await SwapDiffedDocuments();\n  }\n\n  private async Task<(ILoadedDocument, ILoadedDocument)>\n    OpenBaseDiffIRDocumentsImpl(string baseFilePath, string diffFilePath) {\n    ILoadedDocument baseResult = null;\n    ILoadedDocument diffResult = null;\n\n    try {\n      await EndSession();\n      UpdateUIBeforeLoadDocument($\"Loading {baseFilePath}, {diffFilePath}\");\n\n      if (Utils.IsBinaryFile(baseFilePath) &&\n          Utils.IsBinaryFile(diffFilePath)) {\n        (baseResult, diffResult) = await OpenBinaryBaseDiffIRDocuments(baseFilePath, diffFilePath);\n      }\n      else {\n        //? HACK: Set the module name of both docs to be the same,\n        //? otherwise lookup by IRTextFunction in the diff doc will fail the hash checks.\n        (baseResult, diffResult) =\n          await LoadBaseDiffIRDocuments(baseFilePath, baseFilePath, diffFilePath, diffFilePath);\n      }\n    }\n    catch (Exception ex) {\n      await EndSession();\n      Trace.TraceError($\"Failed to load base/diff documents: {ex}\");\n    }\n\n    UpdateUIAfterLoadDocument();\n    return (baseResult, diffResult);\n  }\n\n  private async Task<(ILoadedDocument, ILoadedDocument)>\n    LoadBinaryBaseDiffIRDocuments(string baseFilePath, string baseModuleName, string diffFilePath,\n                                  string diffModuleName) {\n    await SwitchBinaryCompilerTarget(baseFilePath);\n\n    var baseTask =\n      Task.Run(() => LoadBinaryDocument(baseFilePath, baseModuleName, Guid.NewGuid(), UpdateIRDocumentLoadProgress));\n    var diffTask =\n      Task.Run(() => LoadBinaryDocument(diffFilePath, diffModuleName, Guid.NewGuid(), UpdateIRDocumentLoadProgress));\n    var baseResult = await baseTask;\n    var diffResult = await diffTask;\n\n    if (baseResult != null && diffResult != null) {\n      await SetupOpenedIRDocument(SessionKind.Default, baseResult);\n      await SetupOpenedDiffIRDocument(diffFilePath, diffResult);\n      return (baseResult, diffResult);\n    }\n\n    await EndSession();\n    Trace.TraceWarning($\"Failed to load base/diff documents: base {baseResult != null}, diff {diffResult != null}\");\n\n    return (null, null);\n  }\n\n  private async Task<(ILoadedDocument, ILoadedDocument)>\n    LoadBaseDiffIRDocuments(string baseFilePath, string baseModuleName, string diffFilePath, string diffModuleName) {\n    var baseTask =\n      Task.Run(() => LoadDocument(baseFilePath, baseModuleName, Guid.NewGuid(), UpdateIRDocumentLoadProgress));\n    var diffTask =\n      Task.Run(() => LoadDocument(diffFilePath, diffModuleName, Guid.NewGuid(), UpdateIRDocumentLoadProgress));\n    var baseResult = await baseTask;\n    var diffResult = await diffTask;\n\n    if (baseResult != null && diffResult != null) {\n      await SetupOpenedIRDocument(SessionKind.Default, baseResult);\n      await SetupOpenedDiffIRDocument(diffFilePath, diffResult);\n      return (baseResult, diffResult);\n    }\n\n    await EndSession();\n    Trace.TraceWarning($\"Failed to load base/diff documents: base {baseResult != null}, diff {diffResult != null}\");\n\n    return (null, null);\n  }\n\n  private async Task<(ILoadedDocument, ILoadedDocument)>\n    OpenBinaryBaseDiffIRDocuments(string baseFilePath, string diffFilePath) {\n    //? HACK: Set the module name of both docs to be the same,\n    //? otherwise lookup by IRTextFunction in the diff doc will fail the hash checks.\n    var (baseLoadedDoc, diffLoadedDoc) =\n      await LoadBinaryBaseDiffIRDocuments(baseFilePath, baseFilePath,\n                                          diffFilePath, baseFilePath);\n\n    UpdateWindowTitle();\n    return (baseLoadedDoc, diffLoadedDoc);\n  }\n\n  private async void ToggleButton_Checked(object sender, RoutedEventArgs e) {\n    if (ignoreDiffModeButtonEvent_) {\n      return;\n    }\n\n    bool result = await EnterDocumentDiffState();\n\n    if (!result) {\n      UpdateDiffModeButton(false);\n    }\n  }\n\n  private async void OpenDiffDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await Utils.ShowOpenFileDialogAsync(CompilerInfo.OpenFileFilter, \"*.*\", \"Open diff file\",\n                                        async path => {\n                                          bool loaded = await OpenDiffIRDocument(path);\n\n                                          if (!loaded) {\n                                            using var centerForm = new DialogCenteringHelper(this);\n                                            MessageBox.Show($\"Failed to load diff file {path}\", \"Profile Explorer\",\n                                                            MessageBoxButton.OK, MessageBoxImage.Exclamation);\n                                          }\n                                        });\n  }\n\n  private async void CloseDiffDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!sessionState_.IsInTwoDocumentsDiffMode) {\n      await ExitDocumentDiffState();\n\n      // Close each opened section associated with this document.\n      var closedDocuments = new List<DocumentHostInfo>();\n\n      foreach (var docHostInfo in sessionState_.DocumentHosts) {\n        var summary = docHostInfo.DocumentHost.Section.ParentFunction.ParentSummary;\n\n        if (summary == sessionState_.DiffDocument.Summary) {\n          CloseDocument(docHostInfo);\n          closedDocuments.Add(docHostInfo);\n        }\n      }\n\n      foreach (var docHostInfo in closedDocuments) {\n        sessionState_.DocumentHosts.Remove(docHostInfo);\n      }\n\n      sessionState_.RemoveLoadedDocuemnt(sessionState_.DiffDocument);\n\n      // Reset the section panel.\n      await SectionPanel.SetDiffSummary(null);\n      sessionState_.ExitTwoDocumentDiffMode();\n      UpdateWindowTitle();\n    }\n  }\n\n  private bool IsDiffModeDocument(IRDocumentHost document) {\n    return IsInDiffMode &&\n           (document == sessionState_.SectionDiffState.LeftDocument ||\n            document == sessionState_.SectionDiffState.RightDocument);\n  }\n\n  private async Task<bool> EnterDocumentDiffState() {\n    if (!IsSessionStarted) {\n      // No session started yet.\n      return false;\n    }\n\n    await sessionState_.SectionDiffState.StartModeChange();\n\n    if (IsInDiffMode) {\n      sessionState_.SectionDiffState.EndModeChange();\n      return true;\n    }\n\n    if (!PickLeftRightDocuments(out var leftDocument, out var rightDocument)) {\n      sessionState_.SectionDiffState.EndModeChange();\n      return false;\n    }\n\n    bool result = await EnterDocumentDiffState(leftDocument, rightDocument);\n    sessionState_.SectionDiffState.EndModeChange();\n    return result;\n  }\n\n  private async Task<bool> EnterDocumentDiffState(IRDocumentHost leftDocument,\n                                                  IRDocumentHost rightDocument) {\n    //? TODO: Both these checks should be an assert\n    if (!IsSessionStarted) {\n      // No session started yet.\n      return false;\n    }\n\n    if (IsInDiffMode) {\n      return true;\n    }\n\n    sessionState_.SectionDiffState.LeftDocument = leftDocument;\n    sessionState_.SectionDiffState.RightDocument = rightDocument;\n\n    if (sessionState_.IsInTwoDocumentsDiffMode) {\n      // Used when diffing two different documents.\n      await SwitchDiffedDocumentSection(leftDocument.Section, leftDocument, false);\n    }\n    else {\n      sessionState_.SectionDiffState.LeftSection = leftDocument.Section;\n      sessionState_.SectionDiffState.RightSection = rightDocument.Section;\n      await DiffCurrentDocuments(sessionState_.SectionDiffState);\n    }\n\n    // CreateDefaultSideBySidePanels();\n    ShowDiffsControlsPanel();\n    await UpdateUIAfterSectionSwitch(leftDocument.Section, leftDocument);\n    await UpdateUIAfterSectionSwitch(rightDocument.Section, rightDocument);\n    return true;\n  }\n\n  private bool PickLeftRightDocuments(out IRDocumentHost leftDocument,\n                                      out IRDocumentHost rightDocument) {\n    if (sessionState_.DocumentHosts.Count < 2) {\n      leftDocument = rightDocument = null;\n      return false;\n    }\n\n    // If one of the sections is already open, pick the associated document.\n    // Otherwise, pick the last two created ones.\n    leftDocument = sessionState_.DocumentHosts[^2].DocumentHost;\n    rightDocument = sessionState_.DocumentHosts[^1].DocumentHost;\n    return true;\n  }\n\n  private async Task ExitDocumentDiffState(bool isSessionEnding = false, bool disableControls = true) {\n    await sessionState_.SectionDiffState.StartModeChange();\n\n    if (!IsInDiffMode) {\n      sessionState_.SectionDiffState.EndModeChange();\n      return;\n    }\n\n    if (!isSessionEnding) {\n      // Reload sections in the same documents.\n      Trace.TraceInformation(\"Diff mode: Reload original sections\");\n      var leftDocument = sessionState_.SectionDiffState.LeftDocument;\n      var rightDocument = sessionState_.SectionDiffState.RightDocument;\n      await DisableDocumentDiffState(sessionState_.SectionDiffState);\n\n      var leftArgs = new OpenSectionEventArgs(leftDocument.Section, OpenSectionKind.ReplaceCurrent);\n      var rightArgs = new OpenSectionEventArgs(rightDocument.Section, OpenSectionKind.ReplaceCurrent);\n      await OpenDocumentSectionAsync(leftArgs, leftDocument, false);\n      await OpenDocumentSectionAsync(rightArgs, rightDocument, false);\n    }\n    else {\n      sessionState_.SectionDiffState.End();\n    }\n\n    if (disableControls) {\n      HideDiffsControlsPanel();\n    }\n\n    sessionState_.SectionDiffState.EndModeChange();\n    sessionState_.ClearDiffModePanelState();\n    Trace.TraceInformation(\"Diff mode: Exited\");\n  }\n\n  private async void SectionPanel_EnterDiffMode(object sender, DiffModeEventArgs e) {\n    if (IsInDiffMode) {\n      sessionState_.SectionDiffState.End();\n    }\n\n    await sessionState_.SectionDiffState.StartModeChange();\n    var leftDocument = FindDocumentWithSection(e.Left.Section);\n    var rightDocument = FindDocumentWithSection(e.Right.Section);\n\n    Trace.TraceInformation($\"Diff mode: Start with left doc. {ObjectTracker.Track(leftDocument)}, \" +\n                           $\"right doc. {ObjectTracker.Track(rightDocument)}\");\n\n    leftDocument = await OpenDocumentSectionAsync(e.Left, leftDocument, false);\n    rightDocument = await OpenDocumentSectionAsync(e.Right, rightDocument, false);\n    bool result = await EnterDocumentDiffState(leftDocument, rightDocument);\n\n    UpdateDiffModeButton(result);\n    sessionState_.SectionDiffState.EndModeChange();\n    Trace.TraceInformation(\"Diff mode: Entered\");\n  }\n\n  private async void SectionPanel_SyncDiffedDocumentsChanged(object sender, bool value) {\n    if (IsInDiffMode) {\n      if (IsInTwoDocumentsDiffMode && !value ||\n          !IsInTwoDocumentsDiffMode && value) {\n        await ExitDocumentDiffState();\n      }\n    }\n\n    sessionState_.SyncDiffedDocuments = value;\n  }\n\n  private async Task DiffCurrentDocuments(DiffModeInfo diffState) {\n    await EnableDocumentDiffState(diffState);\n    var leftDocument = diffState.LeftDocument.TextView;\n    var rightDocument = diffState.RightDocument.TextView;\n\n    string leftText = await GetSectionTextAsync(leftDocument.Section);\n    string rightText = await GetSectionTextAsync(rightDocument.Section);\n    await DiffDocuments(leftDocument, rightDocument, leftText, rightText,\n                        leftDocument.Section, rightDocument.Section);\n\n    if (diffState.PassOutputVisible) {\n      await DiffDocumentPassOutput(leftDocument, rightDocument,\n                                   diffState.PassOutputShowBefore);\n    }\n  }\n\n  private async Task EnableDocumentDiffState(DiffModeInfo diffState) {\n    // Notify panels about the current sections being unloaded\n    // before diff mode is activated, since otherwise those sections\n    // may be wrongly be associated with diff mode, for ex. the panel states.\n    var leftDocumentHost = FindDocumentHost(diffState.LeftDocument.TextView);\n    var rightDocumentHost = FindDocumentHost(diffState.RightDocument.TextView);\n    await NotifyPanelsOfSectionUnload(diffState.LeftDocument.Section, leftDocumentHost, true);\n    await NotifyPanelsOfSectionUnload(diffState.RightDocument.Section, rightDocumentHost, true);\n\n    // Prepare documents for diff mode.\n    await diffState.LeftDocument.EnterDiffMode();\n    await diffState.RightDocument.EnterDiffMode();\n    sessionState_.SectionDiffState.IsEnabled = true;\n  }\n\n  private async Task DisableDocumentDiffState(DiffModeInfo diffState) {\n    // Notify panels about the current sections being unloaded\n    // before diff mode is ended, since otherwise those sections\n    // may be wrongly be associated with diff mode, for ex. the panel states.\n    var leftDocumentHost = FindDocumentHost(diffState.LeftDocument.TextView);\n    var rightDocumentHost = FindDocumentHost(diffState.RightDocument.TextView);\n    await NotifyPanelsOfSectionUnload(diffState.LeftDocument.Section, leftDocumentHost, true);\n    await NotifyPanelsOfSectionUnload(diffState.RightDocument.Section, rightDocumentHost, true);\n\n    await diffState.LeftDocument.ExitDiffMode();\n    await diffState.RightDocument.ExitDiffMode();\n    sessionState_.SectionDiffState.End();\n  }\n\n  private Task<DiffMarkingResult>\n    MarkSectionDiffs(IRTextSection section, string text, string otherText,\n                     DiffPaneModel diff, DiffPaneModel otherDiff, bool isRightDoc,\n                     IDiffOutputFilter diffFilter, FilteredDiffInput filteredInput,\n                     DiffStatistics diffStats) {\n    var diffUpdater = new DocumentDiffUpdater(diffFilter, App.Settings.DiffSettings, compilerInfo_);\n\n    return Task.Run(async () => {\n      var result = diffUpdater.MarkDiffs(text, otherText, diff, otherDiff,\n                                         isRightDoc, filteredInput, diffStats);\n      var loadedDoc = FindLoadedDocument(section.ParentFunction);\n      await diffUpdater.ReparseDiffedFunction(result, section, loadedDoc);\n      return result;\n    });\n  }\n\n  private Task<DiffMarkingResult> MarkIdenticalSectionDiffs(IRTextSection section, string text,\n                                                            IDiffOutputFilter diffFilter) {\n    var diffUpdater = new DocumentDiffUpdater(diffFilter, App.Settings.DiffSettings, compilerInfo_);\n\n    return Task.Run(async () => {\n      var result = diffUpdater.CreateNoDiffDocument(text);\n      var loadedDoc = FindLoadedDocument(section.ParentFunction);\n      await diffUpdater.ReparseDiffedFunction(result, section, loadedDoc);\n      return result;\n    });\n  }\n\n  private async Task<SideBySideDiffModel> ComputeSectionDiffs(string leftText, string rightText,\n                                                              IRTextSection newLeftSection,\n                                                              IRTextSection newRightSection) {\n    if (CanReuseSectionDiffs(newLeftSection, newRightSection)) {\n      return sessionState_.SectionDiffState.CurrentDiffResults;\n    }\n\n    // Start the actual document diffing on another thread.\n    var diffBuilder = new DocumentDiffBuilder(App.Settings.DiffSettings);\n    var diff = await Task.Run(() => diffBuilder.ComputeDiffs(leftText, rightText));\n    sessionState_.SectionDiffState.CurrentDiffResults = diff;\n    sessionState_.SectionDiffState.CurrentDiffSettings = App.Settings.DiffSettings;\n    return diff;\n  }\n\n  private bool IsSectionTextDifferent(IRTextSection sectionA, IRTextSection sectionB) {\n    if (!sessionState_.AreSectionSignaturesComputed(sectionA) ||\n        !sessionState_.AreSectionSignaturesComputed(sectionB)) {\n      return true;\n    }\n\n    return sectionA.IsSectionTextDifferent(sectionB);\n  }\n\n  private bool CanReuseSectionDiffs(IRTextSection newLeftSection, IRTextSection newRightSection) {\n    // Check if the text of the two sections is the same\n    // as the ones being currently compared.\n    if (sessionState_.SectionDiffState.CurrentDiffResults == null ||\n        sessionState_.SectionDiffState.CurrentDiffSettings == null) {\n      return false;\n    }\n\n    if (!sessionState_.SectionDiffState.CurrentDiffSettings.Equals(App.Settings.DiffSettings)) {\n      return false;\n    }\n\n    return !IsSectionTextDifferent(newLeftSection, sessionState_.SectionDiffState.LeftSection) &&\n           !IsSectionTextDifferent(newRightSection, sessionState_.SectionDiffState.RightSection);\n  }\n\n  private async Task DiffDocuments(IRDocument leftDocument, IRDocument rightDocument,\n                                   string leftText, string rightText,\n                                   IRTextSection newLeftSection,\n                                   IRTextSection newRightSection) {\n    var leftDocumentHost = FindDocumentHost(leftDocument);\n    var rightDocumentHost = FindDocumentHost(rightDocument);\n    var leftDiffStats = new DiffStatistics();\n    var rightDiffStats = new DiffStatistics();\n    DiffMarkingResult leftDiffResult;\n    DiffMarkingResult rightDiffResult;\n\n    // Create the diff filter that will post-process the diff results.\n  var leftDiffInputFilter = compilerInfo_.DiffFilterProvider?.CreateDiffInputFilter();\n  var rightDiffInputFilter = compilerInfo_.DiffFilterProvider?.CreateDiffInputFilter();\n  var diffFilter = compilerInfo_.DiffFilterProvider?.CreateDiffOutputFilter();\n    diffFilter?.Initialize(App.Settings.DiffSettings, compilerInfo_.IR);\n\n    // Fairly often the text is identical, don't do the diffing for such cases.\n    // Also frequent is to have different text, but it is on both left/right sides\n    // identical to the previous sections - in this case the diff results are reused.\n    if (IsSectionTextDifferent(newLeftSection, newRightSection)) {\n      string leftDiffText = leftText;\n      string rightDiffText = rightText;\n      FilteredDiffInput leftFilteredInput = null;\n      FilteredDiffInput rightFilteredInput = null;\n\n      if (leftDiffInputFilter != null) {\n        var leftTask = Task.Run(() => leftDiffInputFilter.FilterInputText(leftText));\n        var rightTask = Task.Run(() => rightDiffInputFilter.FilterInputText(rightText));\n        await Task.WhenAll(leftTask, rightTask);\n\n        leftFilteredInput = await leftTask;\n        rightFilteredInput = await rightTask;\n        leftDiffText = leftFilteredInput.Text;\n        rightDiffText = rightFilteredInput.Text;\n      }\n\n      var diff = await ComputeSectionDiffs(leftDiffText, rightDiffText, newLeftSection, newRightSection);\n\n      // Apply the diff results on the left and right documents in parallel.\n      // This will produce two AvalonEdit documents that will be installed\n      // in the doc. hosts once back on the UI thread.\n      var leftMarkTask = MarkSectionDiffs(newLeftSection, leftText, rightText,\n                                          diff.OldText, diff.NewText,\n                                          false, diffFilter, leftFilteredInput, leftDiffStats);\n      var rightMarkTask = MarkSectionDiffs(newRightSection, leftText, rightText,\n                                           diff.NewText, diff.OldText,\n                                           true, diffFilter, rightFilteredInput, rightDiffStats);\n\n      await Task.WhenAll(leftMarkTask, rightMarkTask);\n      leftDiffResult = await leftMarkTask;\n      rightDiffResult = await rightMarkTask;\n    }\n    else {\n      var leftMarkTask = MarkIdenticalSectionDiffs(newLeftSection, leftText, diffFilter);\n      var rightMarkTask = MarkIdenticalSectionDiffs(newRightSection, rightText, diffFilter);\n\n      await Task.WhenAll(leftMarkTask, rightMarkTask);\n      leftDiffResult = await leftMarkTask;\n      rightDiffResult = await rightMarkTask;\n    }\n\n    // Update the diff session state.\n    sessionState_.SectionDiffState.UpdateResults(leftDiffResult, newLeftSection,\n                                                 rightDiffResult, newRightSection);\n\n    // The UI-thread dependent work.\n\n    //? TODO: Workaround for some cases where the updated left/right docs\n    //? don't have the same length due to a bug in diff updating.\n    //? Making the docs the same length by appending whitespace prevents other\n    //? problems that usually end up with the application asserting.\n    if (leftDiffResult.DiffText.Length !=\n        rightDiffResult.DiffText.Length) {\n      int length = Math.Max(leftDiffResult.DiffText.Length,\n                            rightDiffResult.DiffText.Length);\n      leftDiffResult.DiffText = leftDiffResult.DiffText.PadRight(length);\n      rightDiffResult.DiffText = rightDiffResult.DiffText.PadRight(length);\n    }\n\n    await leftDocumentHost.LoadDiffedFunction(leftDiffResult, newLeftSection);\n    await rightDocumentHost.LoadDiffedFunction(rightDiffResult, newRightSection);\n\n    ScrollToFirstDiff(leftDocument, rightDocument, leftDiffResult, rightDiffResult);\n    UpdateDiffStatus(rightDiffStats);\n\n    // For the active document only, notify panels of the change\n    // and redo other section post-load tasks.\n    if (IsActiveDocument(leftDocumentHost)) {\n      await NotifyPanelsOfSectionLoad(newLeftSection, leftDocumentHost, true);\n      await GenerateGraphs(newLeftSection, leftDocument, false);\n    }\n    else if (IsActiveDocument(rightDocumentHost)) {\n      await NotifyPanelsOfSectionLoad(newRightSection, rightDocumentHost, true);\n      await GenerateGraphs(newRightSection, rightDocument, false);\n    }\n  }\n\n  private async Task DiffDocumentPassOutput() {\n    await DiffDocumentPassOutput(sessionState_.SectionDiffState.LeftDocument.TextView,\n                                 sessionState_.SectionDiffState.RightDocument.TextView,\n                                 sessionState_.SectionDiffState.PassOutputShowBefore);\n  }\n\n  private async Task DiffDocumentPassOutput(IRDocument leftDocument,\n                                            IRDocument rightDocument,\n                                            bool useOutputBefore) {\n    string leftText = await GetSectionOutputTextAsync(leftDocument.Section, useOutputBefore);\n    string rightText = await GetSectionOutputTextAsync(rightDocument.Section, useOutputBefore);\n\n    // Start the actual document diffing on another thread.\n    var diffBuilder = new DocumentDiffBuilder(App.Settings.DiffSettings);\n    var diff = await Task.Run(() => diffBuilder.ComputeDiffs(leftText, rightText));\n\n    // Apply the diff results on the left and right documents in parallel.\n    // This will produce two AvalonEdit documents that will be installed\n    // in the doc. hosts once back on the UI thread.\n    var leftDiffStats = new DiffStatistics();\n    var rightDiffStats = new DiffStatistics();\n  var diffFilter = compilerInfo_.DiffFilterProvider?.CreateDiffOutputFilter();\n    diffFilter.Initialize(App.Settings.DiffSettings, compilerInfo_.IR);\n\n    var leftMarkTask = MarkSectionDiffs(leftDocument.Section, leftText, rightText,\n                                        diff.OldText, diff.NewText,\n                                        false, diffFilter, null, leftDiffStats);\n    var rightMarkTask = MarkSectionDiffs(rightDocument.Section, leftText, rightText,\n                                         diff.NewText, diff.OldText,\n                                         true, diffFilter, null, rightDiffStats);\n    await Task.WhenAll(leftMarkTask, rightMarkTask);\n    var leftDiffResult = await leftMarkTask;\n    var rightDiffResult = await rightMarkTask;\n\n    var leftDocumentHost = FindDocumentHost(leftDocument);\n    var rightDocumentHost = FindDocumentHost(rightDocument);\n    await leftDocumentHost.LoadDiffedPassOutput(leftDiffResult);\n    await rightDocumentHost.LoadDiffedPassOutput(rightDiffResult);\n  }\n\n  private void ScrollToFirstDiff(IRDocument leftDocument, IRDocument rightDocument,\n                                 DiffMarkingResult leftDiffResult, DiffMarkingResult rightDiffResult) {\n    // Scroll to the first diff. If minor diffs are enabled, scroll to the first\n    // major diff in either the left or right document.\n    var firstLeftDiff = SelectFirstDiff(leftDiffResult);\n    var firstRightDiff = SelectFirstDiff(rightDiffResult);\n    var firstDiff = firstLeftDiff;\n    var firstDiffDocument = leftDocument;\n\n    if (firstRightDiff != null) {\n      if (firstDiff == null || firstDiff.StartOffset > firstRightDiff.StartOffset) {\n        firstDiff = firstRightDiff;\n        firstDiffDocument = rightDocument;\n      }\n    }\n\n    if (firstDiff != null) {\n      firstDiffDocument.BringTextOffsetIntoView(firstDiff.StartOffset);\n    }\n    else {\n      // When there are no diffs, scroll both documents to the start.\n      leftDocument.BringTextOffsetIntoView(0);\n      rightDocument.BringTextOffsetIntoView(0);\n    }\n  }\n\n  private DiffTextSegment SelectFirstDiff(DiffMarkingResult diffResult) {\n    if (diffResult.DiffSegments.Count == 0) {\n      return null;\n    }\n\n    if (App.Settings.DiffSettings.IdentifyMinorDiffs) {\n      // Pick the first major diff.\n      foreach (var diff in diffResult.DiffSegments) {\n        if (diff.Kind != DiffKind.MinorModification) {\n          return diff;\n        }\n      }\n\n      return null;\n    }\n\n    return diffResult.DiffSegments[0];\n  }\n\n  private async Task SwitchDiffedDocumentSection(IRTextSection section, IRDocumentHost document,\n                                                 bool redoDiffs = true) {\n    string leftText = null;\n    string rightText = null;\n    IRTextSection newLeftSection = null;\n    IRTextSection newRightSection = null;\n\n    if (document == sessionState_.SectionDiffState.LeftDocument) {\n      var result = await LoadAndParseSection(section);\n      leftText = result.Text.ToString(); //? TODO: Use Span\n      newLeftSection = section;\n\n      (rightText, newRightSection) =\n        await SwitchOtherDiffedDocumentSide(section, sessionState_.SectionDiffState.RightDocument.Section,\n                                            sessionState_.DiffDocument);\n      newRightSection ??= sessionState_.SectionDiffState.RightDocument.Section;\n    }\n    else if (document == sessionState_.SectionDiffState.RightDocument) {\n      var result = await LoadAndParseSection(section);\n      rightText = result.Text.ToString(); //? TODO: Use Span\n      newRightSection = section;\n\n      (leftText, newLeftSection) =\n        await SwitchOtherDiffedDocumentSide(section, sessionState_.SectionDiffState.LeftDocument.Section,\n                                            sessionState_.MainDocument);\n      newLeftSection ??= sessionState_.SectionDiffState.LeftDocument.Section;\n    }\n    else {\n      // Document is not part of the diff set.\n      return;\n    }\n\n    var leftDocument = sessionState_.SectionDiffState.LeftDocument;\n    var rightDocument = sessionState_.SectionDiffState.RightDocument;\n    await EnableDocumentDiffState(sessionState_.SectionDiffState);\n\n    if (newLeftSection != null) {\n      await UpdateUIAfterSectionSwitch(newLeftSection, leftDocument);\n    }\n\n    if (newRightSection != null) {\n      await UpdateUIAfterSectionSwitch(newRightSection, rightDocument);\n    }\n\n    await DiffDocuments(leftDocument.TextView, rightDocument.TextView,\n                        leftText, rightText,\n                        newLeftSection, newRightSection);\n\n    if (sessionState_.SectionDiffState.PassOutputVisible) {\n      await DiffDocumentPassOutput(leftDocument.TextView, rightDocument.TextView,\n                                   sessionState_.SectionDiffState.PassOutputShowBefore);\n    }\n  }\n\n  private void HandleNoDiffDocuments(IRDocument leftDocument, IRDocument rightDocument) {\n    // No diffs, don't run the differ.\n    leftDocument.RemoveDiffTextSegments();\n    rightDocument.RemoveDiffTextSegments();\n    UpdateDiffStatus(new DiffStatistics());\n  }\n\n  private async Task<(string, IRTextSection)>\n    SwitchOtherDiffedDocumentSide(IRTextSection section, IRTextSection otherSection,\n                                  ILoadedDocument otherDocument) {\n    if (sessionState_.DiffDocument != null) {\n      // When two documents are compared, try to pick\n      // the other section from that other document.\n      var diffSection = FindDiffDocumentSection(section, otherDocument);\n\n      if (diffSection != null) {\n        var result = await LoadAndParseSection(diffSection);\n        return (result.Text.ToString(), diffSection);\n      }\n\n      return ($\"Diff document does not have section {section.Name}\", null);\n    }\n\n    {\n      // Load the text of the other section, but don't reload anything else.\n      var result = await LoadAndParseSection(otherSection);\n      return (result.Text.ToString(), null); //? TODO: Use span\n    }\n  }\n\n  private IRTextSection FindDiffDocumentSection(IRTextSection section, ILoadedDocument diffDoc) {\n    return SectionPanel.FindDiffDocumentSection(section);\n  }\n\n  private void UpdateDiffModeButton(bool state) {\n    ignoreDiffModeButtonEvent_ = true;\n    DiffModeButton.IsChecked = state;\n    ignoreDiffModeButtonEvent_ = false;\n  }\n\n  private void UpdateDiffStatus(DiffStatistics stats) {\n    string text = \"\";\n\n    if (stats.LinesAdded == 0 && stats.LinesDeleted == 0 && stats.LinesModified == 0) {\n      text = \"0 diffs\";\n    }\n    else {\n      text = $\"A {stats.LinesAdded}, D {stats.LinesDeleted}, M {stats.LinesModified}\";\n    }\n\n    DiffStatusText.Text = text;\n  }\n\n  private async Task UpdateDiffedFunction(IRDocument document, DiffMarkingResult diffResult,\n                                          IRTextSection newSection) {\n    var documentHost = FindDocumentHost(document);\n    await NotifyPanelsOfSectionUnload(document.Section, documentHost, true);\n\n    // Load new text and function after diffing.\n    await documentHost.LoadDiffedFunction(diffResult, newSection);\n    await NotifyPanelsOfSectionLoad(document.Section, documentHost, true);\n\n    await GenerateGraphs(newSection, document, false);\n  }\n\n  private async void DiffModeButton_Unchecked(object sender, RoutedEventArgs e) {\n    if (ignoreDiffModeButtonEvent_) {\n      return;\n    }\n\n    await ExitDocumentDiffState();\n  }\n\n  private void HideDiffsControlsPanel() {\n    UpdateDiffModeButton(false);\n    DiffControlsPanel.Visibility = Visibility.Collapsed;\n  }\n\n  private void ShowDiffsControlsPanel() {\n    UpdateDiffModeButton(true);\n    DiffControlsPanel.Visibility = Visibility.Visible;\n  }\n\n  //? TODO: Switch to OptionsPanelHostPopup.Create\n  private void ShowDiffOptionsPanel() {\n    if (diffOptionsVisible_) {\n      return;\n    }\n\n    double width = Math.Max(DiffOptionsPanel.MinimumWidth,\n                            Math.Min(MainGrid.ActualWidth, DiffOptionsPanel.DefaultWidth));\n    double height = Math.Max(DiffOptionsPanel.MinimumHeight,\n                             Math.Min(MainGrid.ActualHeight, DiffOptionsPanel.DefaultHeight));\n    var position = new Point(230, MainMenu.ActualHeight + 1);\n    diffOptionsPanelHost_ = new OptionsPanelHostPopup(new DiffOptionsPanel(), position, width, height, MainGrid,\n                                                      App.Settings.DiffSettings.Clone(), this);\n    diffOptionsPanelHost_.PanelClosed += DiffOptionsPanel_PanelClosed;\n    diffOptionsPanelHost_.PanelReset += DiffOptionsPanel_PanelReset;\n    diffOptionsPanelHost_.SettingsChanged += DiffOptionsPanel_SettingsChanged;\n    diffOptionsPanelHost_.IsOpen = true;\n    diffOptionsVisible_ = true;\n  }\n\n  private async Task CloseDiffOptionsPanel() {\n    if (!diffOptionsVisible_) {\n      return;\n    }\n\n    diffOptionsPanelHost_.IsOpen = false;\n    diffOptionsPanelHost_.PanelClosed -= DiffOptionsPanel_PanelClosed;\n    diffOptionsPanelHost_.PanelReset -= DiffOptionsPanel_PanelReset;\n    diffOptionsPanelHost_.SettingsChanged -= DiffOptionsPanel_SettingsChanged;\n\n    var newSettings = (UIDiffSettings)diffOptionsPanelHost_.Settings;\n    await HandleNewDiffSettings(newSettings, true);\n\n    diffOptionsPanelHost_ = null;\n    diffOptionsVisible_ = false;\n  }\n\n  private async Task HandleNewDiffSettings(UIDiffSettings newSettings, bool commit, bool force = false) {\n    if (force || !newSettings.Equals(App.Settings.DiffSettings)) {\n      bool hasHandlingChanges = App.Settings.DiffSettings.HasDiffHandlingChanges(newSettings);\n      App.Settings.DiffSettings = newSettings;\n      await ReloadDiffSettings(newSettings, hasHandlingChanges);\n\n      if (commit) {\n        App.SaveApplicationSettings();\n      }\n    }\n  }\n\n  private async void DiffOptionsPanel_PanelReset(object sender, EventArgs e) {\n    var newSettings = new UIDiffSettings();\n    diffOptionsPanelHost_.Settings = newSettings;\n    await HandleNewDiffSettings(newSettings, true);\n  }\n\n  private async void DiffOptionsPanel_SettingsChanged(object sender, EventArgs e) {\n    var newSettings = (UIDiffSettings)diffOptionsPanelHost_.Settings;\n\n    if (newSettings != null) {\n      await HandleNewDiffSettings(newSettings, false);\n\n      // It's possible that the options panel closes before the async method returns.\n      if (diffOptionsPanelHost_ != null) {\n        diffOptionsPanelHost_.Settings = newSettings.Clone();\n      }\n    }\n  }\n\n  private async void DiffSettingsButton_Click(object sender, RoutedEventArgs e) {\n    if (diffOptionsVisible_) {\n      await CloseDiffOptionsPanel();\n    }\n    else {\n      ShowDiffOptionsPanel();\n    }\n  }\n\n  private async void DiffOptionsPanel_PanelClosed(object sender, EventArgs e) {\n    await CloseDiffOptionsPanel();\n  }\n\n  private async Task DiffSingleDocumentSections(IRDocumentHost doc, IRTextSection section, IRTextSection prevSection) {\n    string prevText = sessionState_.FindLoadedDocument(prevSection).Loader.GetSectionText(prevSection);\n    string currentText = sessionState_.FindLoadedDocument(section).Loader.GetSectionText(section);\n\n    var diffBuilder = new DocumentDiffBuilder(App.Settings.DiffSettings);\n    var diff = await Task.Run(() => diffBuilder.ComputeDiffs(prevText, currentText));\n\n    var diffStats = new DiffStatistics();\n  var diffFilter = compilerInfo_.DiffFilterProvider?.CreateDiffOutputFilter();\n    diffFilter.Initialize(App.Settings.DiffSettings, compilerInfo_.IR);\n\n    var diffResult = await MarkSectionDiffs(section, prevText, currentText,\n                                            diff.NewText, diff.OldText,\n                                            true, diffFilter, null, diffStats);\n    await UpdateDiffedFunction(doc.TextView, diffResult, section);\n    DiffStatusText.Text = diffStats.ToString();\n  }\n\n  private void PreviousSegmentDiffButton_Click(object sender, RoutedEventArgs e) {\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    //? TODO: Diff segments from left/right should be combined and sorted by offset,\n    //? right now considers only diff doc on right side.\n    //? TODO: Code here is almost identical to the next case segment case below.\n    var diffResults = sessionState_.SectionDiffState.RightDiffResults;\n    var document = sessionState_.SectionDiffState.RightDocument;\n\n    if (diffResults.DiffSegments.Count > 0) {\n      int offset = document.TextView.CaretOffset;\n      int index = diffResults.CurrentSegmentIndex;\n      var currentSegment = diffResults.DiffSegments[index];\n      int currentLine = document.TextView.Document.GetLineByOffset(offset).LineNumber;\n      bool found = false;\n\n      //? TODO: Should use binary search\n      while (index >= 0) {\n        var candidate = diffResults.DiffSegments[index];\n\n        if (candidate.StartOffset < offset) {\n          int line = document.TextView.Document.GetLineByOffset(candidate.StartOffset).LineNumber;\n\n          if (line < currentLine) {\n            // Skip groups of segments of the same type following one after another in the text\n            // after the first one in the group has been selected.\n            if (candidate.Kind == currentSegment.Kind && line == currentLine - 1) {\n              currentLine = line;\n              currentSegment = candidate;\n              index--;\n              continue;\n            }\n\n            found = true;\n            break;\n          }\n        }\n\n        index--;\n      }\n\n      if (found) {\n        JumpToDiffSegmentAtIndex(index, diffResults, document);\n      }\n    }\n  }\n\n  private void NextDiffSegmentButton_Click(object sender, RoutedEventArgs e) {\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    //? TODO: Diff segments from left/right should be combined and sorted by offset,\n    //? right now considers only diff doc on right side.\n    //? TODO: Code here is almost identical to the next case segment case below.\n    var diffResults = sessionState_.SectionDiffState.RightDiffResults;\n    var document = sessionState_.SectionDiffState.RightDocument;\n\n    if (diffResults.DiffSegments.Count > 0) {\n      int offset = document.TextView.CaretOffset;\n      int index = diffResults.CurrentSegmentIndex;\n      var currentSegment = diffResults.DiffSegments[index];\n      int currentLine = document.TextView.Document.GetLineByOffset(offset).LineNumber;\n      bool found = false;\n\n      //? TODO: Should use binary search\n      while (index < diffResults.DiffSegments.Count) {\n        var candidate = diffResults.DiffSegments[index];\n\n        if (candidate.StartOffset > offset) {\n          int line = document.TextView.Document.GetLineByOffset(candidate.StartOffset).LineNumber;\n\n          if (line > currentLine) {\n            // Skip groups of segments of the same type following one after another in the text\n            // after the first one in the group has been selected.\n            if (candidate.Kind == currentSegment.Kind && line == currentLine + 1) {\n              currentLine = line;\n              currentSegment = candidate;\n              index++;\n              continue;\n            }\n\n            found = true;\n            break;\n          }\n        }\n\n        index++;\n      }\n\n      if (found) {\n        JumpToDiffSegmentAtIndex(index, diffResults, document);\n      }\n    }\n  }\n\n  private async void DiffSwapButton_Click(object sender, RoutedEventArgs e) {\n    await SwapDiffedDocuments();\n  }\n\n  private async Task SwapDiffedDocuments() {\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    var leftDocHost = sessionState_.SectionDiffState.LeftDocument;\n    var rightDocHost = sessionState_.SectionDiffState.RightDocument;\n    var leftSection = leftDocHost.Section;\n    var rightSection = rightDocHost.Section;\n\n    DiffSwapButton.IsEnabled = false;\n    await ExitDocumentDiffState(false, false);\n\n    // Swap the section displayed in the documents.\n    await SwitchSection(rightSection, leftDocHost, false);\n    await SwitchSection(leftSection, rightDocHost, false);\n    await EnterDocumentDiffState(leftDocHost, rightDocHost);\n    DiffSwapButton.IsEnabled = true;\n  }\n\n  private async void ExternalDiffButton_Click(object sender, RoutedEventArgs e) {\n    var newSettings = App.Settings.DiffSettings.Clone();\n    newSettings.DiffImplementation = newSettings.DiffImplementation == DiffImplementationKind.Internal ?\n      DiffImplementationKind.External : DiffImplementationKind.Internal;\n    await HandleNewDiffSettings(newSettings, false);\n  }\n\n  private async void PreviousDiffButton_Click(object sender, RoutedEventArgs e) {\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    var leftSection = sessionState_.SectionDiffState.LeftSection;\n    var rightSection = sessionState_.SectionDiffState.RightSection;\n\n    int leftIndex = leftSection.Number - 1;\n    int rightIndex = rightSection.Number - 1;\n\n    if (leftIndex > 0 && rightIndex > 0) {\n      var prevLeftSection = leftSection.ParentFunction.Sections[leftIndex - 1];\n      var leftArgs = new OpenSectionEventArgs(prevLeftSection, OpenSectionKind.ReplaceCurrent);\n      await OpenDocumentSectionAsync(leftArgs, sessionState_.SectionDiffState.LeftDocument);\n\n      var prevRightSection = rightSection.ParentFunction.Sections[rightIndex - 1];\n      var rightArgs = new OpenSectionEventArgs(prevRightSection, OpenSectionKind.ReplaceCurrent);\n      await OpenDocumentSectionAsync(rightArgs, sessionState_.SectionDiffState.RightDocument);\n    }\n  }\n\n  private async void NextDiffButton_Click(object sender, RoutedEventArgs e) {\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    var leftSection = sessionState_.SectionDiffState.LeftSection;\n    var rightSection = sessionState_.SectionDiffState.RightSection;\n\n    int leftIndex = leftSection.Number - 1;\n    int rightIndex = rightSection.Number - 1;\n\n    if (leftIndex < leftSection.ParentFunction.SectionCount - 1 &&\n        rightIndex < rightSection.ParentFunction.SectionCount - 1) {\n      var prevLeftSection = leftSection.ParentFunction.Sections[leftIndex + 1];\n      var leftArgs = new OpenSectionEventArgs(prevLeftSection, OpenSectionKind.ReplaceCurrent);\n      await OpenDocumentSectionAsync(leftArgs, sessionState_.SectionDiffState.LeftDocument);\n\n      var prevRightSection = rightSection.ParentFunction.Sections[rightIndex + 1];\n      var rightArgs = new OpenSectionEventArgs(prevRightSection, OpenSectionKind.ReplaceCurrent);\n      await OpenDocumentSectionAsync(rightArgs, sessionState_.SectionDiffState.RightDocument);\n    }\n  }\n\n  private void JumpToDiffSegmentAtIndex(int index, DiffMarkingResult diffResults, IRDocumentHost document) {\n    var nextDiff = diffResults.DiffSegments[index];\n    document.TextView.BringTextOffsetIntoView(nextDiff.StartOffset);\n    document.TextView.SetCaretAtOffset(nextDiff.StartOffset);\n    diffResults.CurrentSegmentIndex = index;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/MainWindowPanels.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing AvalonDock.Layout;\nusing AvalonDock.Layout.Serialization;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Settings;\nusing ProfileExplorer.UI.Windows;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class MainWindow : Window, IUISession {\n  public void UpdatePanelTitles() {\n    RenameAllPanels();\n  }\n\n  public void DisplayFloatingPanel(IToolPanel panel) {\n    var panelHost = DisplayNewPanel(panel, null, DuplicatePanelKind.Floating);\n    panelHost.Host.CanClose = true;\n    panelHost.Host.CanAutoHide = false;\n    panelHost.Host.CanHide = false;\n    RenameAllPanels();\n  }\n\n  public void RedrawPanels(params ToolPanelKind[] kinds) {\n    foreach (var (kind, list) in panelHostSet_) {\n      list.ForEach(item => {\n        if (kinds.Length == 0 || kinds.Contains(item.PanelKind)) {\n          item.Panel.OnRedrawPanel();\n        }\n      });\n    }\n  }\n\n  public void PopulateBindMenu(IToolPanel panel, BindMenuItemsArgs args) {\n    foreach (var doc in sessionState_.DocumentHosts) {\n      var menuItem = new BindMenuItem {\n        Header = compilerInfo_.NameProvider.GetSectionName(doc.DocumentHost.Section),\n        ToolTip = doc.DocumentHost.Section.ParentFunction.Name,\n        Tag = doc.DocumentHost.TextView,\n        IsChecked = panel.BoundDocument == doc.DocumentHost.TextView\n      };\n\n      args.MenuItems.Add(menuItem);\n    }\n  }\n\n  public void BindToDocument(IToolPanel panel, BindMenuItem args) {\n    var document = args.Tag as IRDocument;\n\n    if (panel.BoundDocument == document) {\n      // Unbind on second click.\n      panel.BoundDocument = null;\n    }\n    else {\n      panel.BoundDocument = document;\n    }\n  }\n\n  public IRDocument FindAssociatedDocument(IToolPanel panel) {\n    return panel.BoundDocument ?? FindActiveDocumentView();\n  }\n\n  public IRDocumentHost FindAssociatedDocumentHost(IToolPanel panel) {\n    if (panel.BoundDocument != null) {\n      return FindDocumentHost(panel.BoundDocument);\n    }\n\n    return FindActiveDocumentHost();\n  }\n\n  public void SavePanelState(object stateObject, IToolPanel panel,\n                             IRTextSection section, IRDocument document) {\n    //? TODO: Find a way to at least temporarily save state for the two diffed docs\n    //? Issue is that in diff mode a section can have a different FunctionIR depending\n    //? on the other section is compared with\n    if (IsInDiffMode) {\n      if (document == null) {\n        return;\n      }\n\n      var docHost = FindDocumentHost(document);\n\n      if (sessionState_.SectionDiffState.IsDiffDocument(docHost)) {\n        sessionState_.SaveDiffModePanelState(stateObject, panel, section);\n        return;\n      }\n    }\n\n    sessionState_.SavePanelState(stateObject, panel, section);\n  }\n\n  public object LoadPanelState(IToolPanel panel, IRTextSection section, IRDocument document) {\n    if (IsInDiffMode) {\n      if (document == null) {\n        return null;\n      }\n\n      var docHost = FindDocumentHost(document);\n\n      if (sessionState_.SectionDiffState.IsDiffDocument(docHost)) {\n        return sessionState_.LoadDiffModePanelState(panel, section);\n      }\n    }\n\n    return sessionState_.LoadPanelState(panel, section);\n  }\n\n  public void DuplicatePanel(IToolPanel panel, DuplicatePanelKind duplicateKind) {\n    var newPanel = CreateNewPanel(panel.PanelKind);\n\n    if (newPanel != null) {\n      DisplayNewPanel(newPanel, panel, duplicateKind);\n      RenamePanels(newPanel.PanelKind);\n      newPanel.ClonePanel(panel);\n    }\n  }\n\n  public void RegisterDetachedPanel(DraggablePopup panel) {\n    if (!detachedPanels_.Contains(panel)) {\n      detachedPanels_.Add(panel);\n    }\n  }\n\n  public void UnregisterDetachedPanel(DraggablePopup panel) {\n    if (panel.IsDetached) {\n      detachedPanels_.Remove(panel);\n    }\n  }\n\n  public async Task<IToolPanel> ShowPanel(ToolPanelKind panelKind) {\n    // Panel hosts must be found at runtime because of deserialization.\n    RegisterDefaultToolPanels(false);\n    var panelHost = FindPanelHostForKind(panelKind);\n\n    if (panelHost != null) {\n      if (panelHost.IsAutoHidden) {\n        panelHost.ToggleAutoHide();\n      }\n\n      panelHost.Show();\n      panelHost.IsActive = true;\n    }\n\n    return FindPanel(panelKind);\n  }\n\n  private void RegisterDefaultToolPanels(bool reloadWorkspace = true) {\n    Trace.WriteLine($\"Register default tool panels\");\n    RegisterPanel(SectionPanel, SectionPanelHost);\n    RegisterPanel(FlowGraphPanel, FlowGraphPanelHost);\n    RegisterPanel(DominatorTreePanel, DominatorTreePanelHost);\n    // RegisterPanel(PostDominatorTreePanel, PostDominatorTreePanelHost);\n    RegisterPanel(DefinitionPanel, DefinitionPanelHost);\n    RegisterPanel(DeveloperPanel, DeveloperPanelHost);\n    RegisterPanel(SourceFilePanel, SourceFilePanelHost);\n    RegisterPanel(BookmarksPanel, BookmarksPanelHost);\n    RegisterPanel(ReferencesPanel, ReferencesPanelHost);\n    RegisterPanel(NotesPanel, NotesPanelHost);\n    // RegisterPanel(PassOutputPanel, PassOutputHost);\n    RegisterPanel(SearchResultsPanel, SearchResultsPanelHost);\n    // RegisterPanel(ScriptingPanel, ScriptingPanelHost);\n    RegisterPanel(ExpressionGraphPanel, ExpressionGraphPanelHost);\n    RegisterPanel(CallTreePanel, CallTreePanelHost);\n    RegisterPanel(CallerCalleePanel, CallerCalleePanelHost);\n    RegisterPanel(FlameGraphPanel, FlameGraphPanelHost);\n    RegisterPanel(TimelinePanel, TimelinePanelHost);\n    RegisterPanel(HelpPanel, HelpPanelHost);\n    RenameAllPanels();\n\n    if (reloadWorkspace) {\n      var defaultWs = App.Settings.WorkspaceOptions.CreateNewActiveWorkspace();\n      SaveDockLayout(defaultWs.FilePath);\n      PopulateWorkspacesCombobox();\n      RestoreDockLayout(defaultWs.FilePath);\n    }\n  }\n\n  private async Task NotifyPanelsOfElementEvent(HandledEventKind eventKind, IRDocument document,\n                                                Action<IToolPanel> action) {\n    foreach (var (kind, list) in panelHostSet_) {\n      foreach (var panelHost in list) {\n        var panel = panelHost.Panel;\n\n        if (!panel.IsPanelEnabled) {\n          continue;\n        }\n\n        // Accept enabled panels handling the event.\n        if (eventKind != HandledEventKind.None &&\n            (panel.HandledEvents & eventKind) == 0) {\n          continue;\n        }\n\n        // Don't notify panels bound to another document\n        // or with pinned content.\n        if (!ShouldNotifyPanel(panel, document)) {\n          continue;\n        }\n\n        // Sometimes the selection event is triggered before the\n        // section-switched event, for ex. when clicking directly on\n        // an element in another document, not first on the document\n        // tab header. Ensure that the panel is connected properly.\n        if (panel.IsUnloaded || panel.Document != document) {\n          if (!panel.IsUnloaded) {\n            await panel.OnDocumentSectionUnloaded(panel.Document.Section, panel.Document);\n          }\n\n          await panel.OnDocumentSectionLoaded(document.Section, document);\n\n          // After this action, the load/unload events for the panel\n          // will trigger, but since it was done here already,\n          // don't do it again, slows down UI for no reason.\n          //? TODO: Breaks proper switching of Flow Graph\n          // panel.IgnoreNextLoadEvent = true;\n          // panel.IgnoreNextUnloadEvent = true;\n        }\n\n        action(panel);\n      }\n    }\n  }\n\n  private void NotifyPanelsOfSessionStart() {\n    ForEachPanel(panel => { panel.OnSessionStart(); });\n  }\n\n  private void NotifyPanelsOfSessionEnd() {\n    ForEachPanel(panel => {\n      panel.OnSessionEnd();\n      panel.BoundDocument = null;\n    });\n\n    // Hide other panels that are not dockable.\n    CloseDocumentSearchPanel();\n    CloseDetachedPanels();\n  }\n\n  private void NotifyPanelsOfSessionSave() {\n    ForEachPanel(panel => { panel.OnSessionSave(); });\n  }\n\n  private void NotifyDocumentsOfSessionSave() {\n    sessionState_.DocumentHosts.ForEach(document => { document.DocumentHost.OnSessionSave(); });\n  }\n\n  private async Task NotifyPanelsOfSectionLoad(IRTextSection section, IRDocumentHost document, bool notifyAll) {\n    ForEachPanel(async panel => {\n      // See comments in NotifyPanelsOfElementEvent about this check.\n      if (panel.IgnoreNextLoadEvent) {\n        panel.IgnoreNextLoadEvent = false;\n      }\n      else if (ShouldNotifyPanel(panel, document.TextView, notifyAll)) {\n        await panel.OnDocumentSectionLoaded(section, document.TextView);\n      }\n    });\n  }\n\n  private async Task NotifyPanelsOfSectionUnload(IRTextSection section, IRDocumentHost document,\n                                                 bool notifyAll, bool ignoreBoundPanels = false) {\n    ForEachPanel(async panel => {\n      // See comments in NotifyPanelsOfElementEvent about this check.\n      if (panel.IgnoreNextUnloadEvent) {\n        panel.IgnoreNextUnloadEvent = false;\n      }\n      else if (ShouldNotifyPanel(panel, document.TextView, notifyAll, ignoreBoundPanels)) {\n        await panel.OnDocumentSectionUnloaded(section, document.TextView);\n      }\n    });\n  }\n\n  private bool ShouldNotifyPanel(IToolPanel panel, IRDocument document,\n                                 bool notifyAll = false,\n                                 bool ignoreBoundPanels = false) {\n    // Don't notify panels bound to another document or with pinned content.\n    // If all panels should be notified, pinning in ignored.\n    if (panel.BoundDocument == null) {\n      if (notifyAll) {\n        return true;\n      }\n\n      return !panel.HasPinnedContent;\n    }\n\n    if (ignoreBoundPanels) {\n      return false;\n    }\n\n    return panel.BoundDocument == document;\n  }\n\n  private async Task NotifyOfSectionUnload(IRDocumentHost document, bool notifyAll,\n                                           bool ignoreBoundPanels = false,\n                                           bool switchingActiveDocument = false) {\n    var section = document.Section;\n\n    if (section != null) {\n      document.UnloadSection(section, switchingActiveDocument);\n      await NotifyPanelsOfSectionUnload(section, document, notifyAll, ignoreBoundPanels);\n    }\n  }\n\n  private async Task NotifyPanelsOfElementHighlight(IRHighlightingEventArgs e, IRDocument document) {\n    await NotifyPanelsOfElementEvent(HandledEventKind.ElementHighlighting, document,\n                                     panel => panel.OnElementHighlighted(e));\n  }\n\n  private async Task NotifyPanelsOfElementSelection(IRElementEventArgs e, IRDocument document) {\n    await NotifyPanelsOfElementEvent(HandledEventKind.ElementSelection, document,\n                                     panel => panel.OnElementSelected(e));\n  }\n\n  private void SetupPanelEvents(PanelHostInfo panelHost) {\n    panelHost.Host.Hiding += PanelHost_Hiding;\n    panelHost.Host.Closing += PanelHost_Hiding;\n\n    switch (panelHost.PanelKind) {\n      case ToolPanelKind.FlowGraph:\n      case ToolPanelKind.DominatorTree:\n      case ToolPanelKind.PostDominatorTree: {\n        var flowGraphPanel = panelHost.Panel as GraphPanel;\n        flowGraphPanel.GraphViewer.BlockSelected += GraphViewer_GraphNodeSelected;\n        flowGraphPanel.GraphViewer.BlockMarked += GraphViewer_BlockMarked;\n        flowGraphPanel.GraphViewer.BlockUnmarked += GraphViewer_BlockUnmarked;\n        flowGraphPanel.GraphViewer.GraphLoaded += GraphViewer_GraphLoaded;\n        break;\n      }\n      case ToolPanelKind.ExpressionGraph: {\n        var flowGraphPanel = panelHost.Panel as GraphPanel;\n        flowGraphPanel.GraphViewer.BlockSelected += GraphViewer_GraphNodeSelected;\n        flowGraphPanel.GraphViewer.GraphLoaded += GraphViewer_GraphLoaded;\n        break;\n      }\n      case ToolPanelKind.CallGraph: {\n        var callGraphPanel = panelHost.Panel as CallGraphPanel;\n        callGraphPanel.GraphViewer.NodeSelected += GraphViewer_NodeSelected;\n        break;\n      }\n    }\n  }\n\n  private void ResetPanelEvents(PanelHostInfo panelHost) {\n    panelHost.Host.Hiding -= PanelHost_Hiding;\n    panelHost.Host.Closing -= PanelHost_Hiding;\n\n    switch (panelHost.PanelKind) {\n      case ToolPanelKind.FlowGraph:\n      case ToolPanelKind.DominatorTree:\n      case ToolPanelKind.PostDominatorTree: {\n        var flowGraphPanel = panelHost.Panel as GraphPanel;\n        flowGraphPanel.GraphViewer.BlockSelected -= GraphViewer_GraphNodeSelected;\n        flowGraphPanel.GraphViewer.BlockMarked -= GraphViewer_BlockMarked;\n        flowGraphPanel.GraphViewer.BlockUnmarked -= GraphViewer_BlockUnmarked;\n        flowGraphPanel.GraphViewer.GraphLoaded -= GraphViewer_GraphLoaded;\n        break;\n      }\n      case ToolPanelKind.ExpressionGraph: {\n        var flowGraphPanel = panelHost.Panel as GraphPanel;\n        flowGraphPanel.GraphViewer.BlockSelected -= GraphViewer_GraphNodeSelected;\n        flowGraphPanel.GraphViewer.GraphLoaded -= GraphViewer_GraphLoaded;\n        break;\n      }\n      case ToolPanelKind.CallGraph: {\n        var callGraphPanel = panelHost.Panel as CallGraphPanel;\n        callGraphPanel.GraphViewer.NodeSelected -= GraphViewer_NodeSelected;\n        break;\n      }\n    }\n  }\n\n  private async void DocumentHost_Closed(object sender, EventArgs e) {\n    if (!(sender is LayoutDocument docHost)) {\n      return;\n    }\n\n    var docHostInfo = FindDocumentHostPair(docHost);\n    var document = docHostInfo.DocumentHost;\n\n    // If the document is part of the active diff mode,\n    // exit diff mode before removing it.\n    if (IsDiffModeDocument(document)) {\n      await ExitDocumentDiffState();\n    }\n\n    await NotifyOfSectionUnload(document, true);\n    UnbindPanels(docHostInfo.DocumentHost);\n    RenameAllPanels();\n    ResetDocumentEvents(docHostInfo.DocumentHost);\n    sessionState_.DocumentHosts.Remove(docHostInfo);\n\n    if (sessionState_.DocumentHosts.Count > 0) {\n      await SetActiveDocument(sessionState_.DocumentHosts[0]);\n    }\n    else {\n      ResetActiveDocument();\n    }\n  }\n\n  private async Task SetActiveDocument(DocumentHostInfo newActivePanel, bool updateUI = true) {\n    // Sometimes this is triggered when closing the app after the session was closed.\n    if (!IsSessionStarted) {\n      return;\n    }\n\n    activeDocumentPanel_ = newActivePanel.HostParent;\n\n    foreach (var item in sessionState_.DocumentHosts) {\n      item.IsActiveDocument = false;\n    }\n\n    newActivePanel.IsActiveDocument = true;\n\n    if (updateUI) {\n      var docHost = newActivePanel.DocumentHost;\n\n      if (docHost.Section != null) {\n        await SectionPanel.SelectSection(docHost.Section, false);\n        await NotifyPanelsOfSectionLoad(docHost.Section, docHost, false);\n      }\n    }\n  }\n\n  private void ResetActiveDocument() {\n    activeDocumentPanel_ = null;\n  }\n\n  private void UnbindPanels(IRDocumentHost document) {\n    foreach (var (kind, list) in panelHostSet_) {\n      foreach (var panelInfo in list) {\n        if (panelInfo.Panel.BoundDocument == document.TextView) {\n          panelInfo.Panel.BoundDocument = null;\n        }\n      }\n    }\n  }\n\n  private async void DocumentHost_IsActiveChanged(object sender, EventArgs e) {\n    if (!(sender is LayoutDocument docHost)) {\n      return;\n    }\n\n    if (!IsSessionStarted) {\n      return; // When closing main window, ignore even if triggered.\n    }\n\n    if (!(docHost.Content is IRDocumentHost document)) {\n      return;\n    }\n\n    if (docHost.IsSelected) {\n      var activeDocument = FindActiveDocumentHost();\n\n      if (activeDocument == document) {\n        return; // Already active one.\n      }\n\n      if (activeDocument != null) {\n        await NotifyOfSectionUnload(activeDocument, false, true, true);\n      }\n\n      var hostDocPair = FindDocumentHostPair(document);\n      await SetActiveDocument(hostDocPair);\n    }\n  }\n\n  private DocumentHostInfo FindDocumentHostPair(IRDocumentHost document) {\n    return sessionState_.DocumentHosts.Find(item => item.DocumentHost == document);\n  }\n\n  private DocumentHostInfo FindDocumentHostPair(LayoutDocument host) {\n    return sessionState_.DocumentHosts.Find(item => item.Host == host);\n  }\n\n  private IRDocumentHost FindDocumentHost(IRDocument document) {\n    if (document == null) {\n      return null;\n    }\n\n    return sessionState_.DocumentHosts.Find(item => item.DocumentHost.TextView == document).DocumentHost;\n  }\n\n  private IRDocumentHost FindSameSummaryDocumentHost(IRTextSection section) {\n    var summary = section.ParentFunction.ParentSummary;\n\n    var results = sessionState_.DocumentHosts.FindAll(\n      item => item.DocumentHost.Section != null &&\n              item.DocumentHost.Section.ParentFunction.ParentSummary ==\n              summary);\n\n    // Try to pick the active document out of the list.\n    foreach (var result in results) {\n      if (result.IsActiveDocument) {\n        return result.DocumentHost;\n      }\n    }\n\n    if (results.Count > 0) {\n      return results[0].DocumentHost;\n    }\n\n    return null;\n  }\n\n  private IRDocumentHost FindActiveDocumentHost() {\n    if (!IsSessionStarted) {\n      return null;\n    }\n\n    var result = sessionState_.DocumentHosts.Find(item => item.IsActiveDocument);\n    return result?.DocumentHost;\n  }\n\n  private IRDocument FindActiveDocumentView() {\n    if (!IsSessionStarted) {\n      return null;\n    }\n\n    var result = sessionState_.DocumentHosts.Find(item => item.IsActiveDocument);\n    return result?.DocumentHost?.TextView;\n  }\n\n  private bool IsActiveDocument(IRDocumentHost document) {\n    return FindActiveDocumentHost() == document;\n  }\n\n  private PanelHostInfo FindActivePanel(ToolPanelKind kind) {\n    return panelHostSet_.TryGetValue(kind, out var list)\n      ? list.Find(item => item.Panel.HasCommandFocus)\n      : null;\n  }\n\n  private T FindActivePanel<T>(ToolPanelKind kind) where T : class {\n    var panelHost = FindActivePanel(kind);\n    return panelHost?.Panel as T;\n  }\n\n  private List<PanelHostInfo> FindTargetPanels(IRDocument document, ToolPanelKind kind) {\n    var panelList = new List<PanelHostInfo>();\n\n    if (panelHostSet_.TryGetValue(kind, out var list)) {\n      // Add every panel not bound to another document.\n      foreach (var panelInfo in list) {\n        if (panelInfo.Panel.BoundDocument == null ||\n            panelInfo.Panel.BoundDocument == document) {\n          panelList.Add(panelInfo);\n        }\n      }\n    }\n\n    return panelList;\n  }\n\n  private PanelHostInfo FindTargetPanel(IRDocument document, ToolPanelKind kind) {\n    if (panelHostSet_.TryGetValue(kind, out var list)) {\n      // Use the panel bound to the document.\n      var boundPanel = list.Find(item => item.Panel.BoundDocument == document);\n\n      if (boundPanel != null) {\n        return boundPanel;\n      }\n\n      // Otherwise use, in order of preference:\n      // - the last active panel that is unbound\n      // - the last unbound panel\n      // - the last active panel\n      // - the last panel\n      PanelHostInfo unboundPanelInfo = null;\n      PanelHostInfo commandFocusPanelInfo = null;\n\n      foreach (var item in list) {\n        if (item.Panel.HasCommandFocus) {\n          if (item.Panel.BoundDocument == null) {\n            return item;\n          }\n\n          commandFocusPanelInfo = item;\n        }\n        else if (item.Panel.BoundDocument == null) {\n          unboundPanelInfo = item;\n        }\n      }\n\n      if (unboundPanelInfo != null) {\n        return unboundPanelInfo;\n      }\n\n      if (commandFocusPanelInfo != null) {\n        return commandFocusPanelInfo;\n      }\n\n      if (list.Count > 0) {\n        return list[^1];\n      }\n    }\n\n    return null;\n  }\n\n  private T FindTargetPanel<T>(IRDocument document, ToolPanelKind kind) where T : class {\n    var panelInfo = FindTargetPanel(document, kind);\n    return panelInfo?.Panel as T;\n  }\n\n  private PanelHostInfo FindPanelHost(IToolPanel panel) {\n    if (panelHostSet_.TryGetValue(panel.PanelKind, out var list)) {\n      return list.Find(item => item.Panel == panel);\n    }\n\n    return null;\n  }\n\n  private PanelHostInfo FindPanel(LayoutAnchorable panelHost) {\n    foreach (var (kind, list) in panelHostSet_) {\n      var result = list.Find(item => item.Host == panelHost);\n\n      if (result != null) {\n        return result;\n      }\n    }\n\n    return null;\n  }\n\n  private string GetDefaultPanelName(ToolPanelKind kind) {\n    return kind switch {\n      ToolPanelKind.Bookmarks         => \"Bookmarks\",\n      ToolPanelKind.Definition        => \"Definition\",\n      ToolPanelKind.FlowGraph         => \"Flow Graph\",\n      ToolPanelKind.DominatorTree     => \"Dominator Tree\",\n      ToolPanelKind.PostDominatorTree => \"Post-Dominator Tree\",\n      ToolPanelKind.ExpressionGraph   => \"Expression Graph\",\n      ToolPanelKind.CallGraph         => \"Call Graph\",\n      ToolPanelKind.CallTree          => \"Call Tree\",\n      ToolPanelKind.CallerCallee      => \"Caller/Callee\",\n      ToolPanelKind.FlameGraph        => \"Flame Graph\",\n      ToolPanelKind.Timeline          => \"Timeline\",\n      ToolPanelKind.Developer         => \"Developer\",\n      ToolPanelKind.Notes             => \"Notes\",\n      ToolPanelKind.References        => \"References\",\n      ToolPanelKind.Section           => \"Summary\",\n      ToolPanelKind.Source            => \"Source File\",\n      ToolPanelKind.PassOutput        => \"Pass Output\",\n      ToolPanelKind.SearchResults     => \"Search Results\",\n      ToolPanelKind.Scripting         => \"Scripting\",\n      ToolPanelKind.Help              => \"Help\",\n      _                               => \"\"\n    };\n  }\n\n  private void RenamePanels(ToolPanelKind kind) {\n    if (panelHostSet_.TryGetValue(kind, out var list)) {\n      RenamePanels(kind, list);\n    }\n  }\n\n  private string GetPanelName(ToolPanelKind kind, IToolPanel panel) {\n    string name = GetDefaultPanelName(kind);\n\n    if (!string.IsNullOrEmpty(panel.TitlePrefix)) {\n      name = $\"{panel.TitlePrefix}{name}\";\n    }\n\n    if (!string.IsNullOrEmpty(panel.TitleSuffix)) {\n      name = $\"{name}{panel.TitleSuffix}\";\n    }\n\n    if (panel.BoundDocument != null) {\n      name = $\"{name} - Bound to S{panel.BoundDocument.Section.Number} \";\n    }\n\n    return name;\n  }\n\n  private void RenamePanels(ToolPanelKind kind, List<PanelHostInfo> list) {\n    if (list.Count == 1) {\n      list[0].Host.Title = GetPanelName(kind, list[0].Panel);\n      list[0].Host.ToolTip = list[0].Panel.TitleToolTip;\n    }\n    else {\n      for (int i = 0; i < list.Count; i++) {\n        string name = GetPanelName(kind, list[i].Panel);\n        list[i].Host.Title = $\"{name}:{i + 1}\";\n        list[i].Host.ToolTip = list[i].Panel.TitleToolTip;\n      }\n    }\n  }\n\n  private void RenameAllPanels() {\n    foreach (var (kind, list) in panelHostSet_) {\n      RenamePanels(kind, list);\n    }\n  }\n\n  private IToolPanel CreateNewPanel(ToolPanelKind kind) {\n    return kind switch {\n      ToolPanelKind.Definition        => new DefinitionPanel(),\n      ToolPanelKind.References        => new ReferencesPanel(),\n      ToolPanelKind.Notes             => new NotesPanel(),\n      ToolPanelKind.PassOutput        => new PassOutputPanel(),\n      ToolPanelKind.FlowGraph         => new GraphPanel(),\n      ToolPanelKind.DominatorTree     => new GraphPanel(),\n      ToolPanelKind.PostDominatorTree => new GraphPanel(),\n      ToolPanelKind.ExpressionGraph   => new ExpressionGraphPanel(),\n      ToolPanelKind.SearchResults     => new SearchResultsPanel(),\n      ToolPanelKind.Scripting         => new ScriptingPanel(),\n      _                               => throw new InvalidOperationException()\n    };\n  }\n\n  private T CreateNewPanel<T>(ToolPanelKind kind) where T : class {\n    return CreateNewPanel(kind) as T;\n  }\n\n  private PanelHostInfo DisplayNewPanel(IToolPanel newPanel, IToolPanel relativePanel,\n                                        DuplicatePanelKind duplicateKind) {\n    var panelHost = AddNewPanel(newPanel);\n    bool attached = false;\n\n    switch (duplicateKind) {\n      case DuplicatePanelKind.Floating: {\n        DisplayFloatingWindow(panelHost.Host);\n        attached = true;\n        break;\n      }\n      case DuplicatePanelKind.NewSetDockedLeft: {\n        panelHost.Host.AddToLayout(DockManager, AnchorableShowStrategy.Right);\n\n        if (relativePanel != null) {\n          var baseHost = FindPanelHost(relativePanel).Host;\n          var baseGroup = baseHost.FindParent<LayoutAnchorablePaneGroup>();\n\n          if (baseGroup == null) {\n            break;\n          }\n\n          baseGroup.Children.Insert(0, new LayoutAnchorablePane(panelHost.Host));\n          attached = true;\n        }\n\n        break;\n      }\n      case DuplicatePanelKind.NewSetDockedRight: {\n        panelHost.Host.AddToLayout(DockManager, AnchorableShowStrategy.Right);\n\n        if (relativePanel != null) {\n          var baseHost = FindPanelHost(relativePanel).Host;\n          var baseGroup = baseHost.FindParent<LayoutAnchorablePaneGroup>();\n\n          if (baseGroup == null) {\n            break;\n          }\n\n          baseGroup.Children.Add(new LayoutAnchorablePane(panelHost.Host));\n          attached = true;\n        }\n\n        break;\n      }\n      case DuplicatePanelKind.SameSet: {\n        // Insert the new panel on the right of the cloned one.\n        panelHost.Host.AddToLayout(DockManager, AnchorableShowStrategy.Right);\n\n        var relativePanelHost = FindPanelHost(relativePanel);\n        var relativeLayoutPane = relativePanelHost.Host.FindParent<LayoutAnchorablePane>();\n\n        if (relativeLayoutPane == null) {\n          break;\n        }\n\n        int basePaneIndex = relativeLayoutPane.Children.IndexOf(relativePanelHost.Host);\n        relativeLayoutPane.Children.Insert(basePaneIndex + 1, panelHost.Host);\n        attached = true;\n        break;\n      }\n      default:\n        throw new ArgumentOutOfRangeException(nameof(duplicateKind), duplicateKind, null);\n    }\n\n    // Docking can fail if the target panel is hidden, make it a floating panel.\n    //? TODO: Should try to make the hidden panel visible\n    if (!attached) {\n      panelHost.Host.Float();\n    }\n\n    panelHost.Host.IsSelected = true;\n    return panelHost;\n  }\n\n  private void DisplayFloatingWindow(LayoutContent host) {\n    //? TODO: Use saved position settings\n    host.FloatingLeft = Left + 100;\n    host.FloatingTop = Top + 100;\n    host.FloatingWidth = 800;\n    host.FloatingHeight = 600;\n\n    var window = DockManager.CreateFloatingWindow(host, false);\n    window.Show();\n  }\n\n  private PanelHostInfo AddNewPanel(IToolPanel panel) {\n    return RegisterPanel(panel, new LayoutAnchorable {\n      Content = panel\n    });\n  }\n\n  private PanelHostInfo RegisterPanel(IToolPanel panel, LayoutAnchorable host) {\n    var existingHost = FindPanelHost(panel);\n\n    if (existingHost != null) {\n      return existingHost;\n    }\n\n    if (!panelHostSet_.TryGetValue(panel.PanelKind, out var list)) {\n      list = new List<PanelHostInfo>();\n    }\n\n    var panelHost = new PanelHostInfo(panel, host);\n    list.Add(panelHost);\n    panelHostSet_[panel.PanelKind] = list;\n\n    // Setup events.\n    SetupPanelEvents(panelHost);\n    panel.OnRegisterPanel();\n    panel.Session = this;\n\n    // Make it the active panel in the group.\n    SwitchCommandFocusToPanel(panelHost);\n    return panelHost;\n  }\n\n  private void UnregisterPanel(PanelHostInfo panelHost) {\n    if (panelHostSet_.TryGetValue(panelHost.PanelKind, out var list)) {\n      list.Remove(panelHost);\n      panelHost.Panel.OnUnregisterPanel();\n      panelHost.Panel.Session = null;\n    }\n  }\n\n  private void ForEachPanel(ToolPanelKind panelKind, Action<IToolPanel> action) {\n    if (panelHostSet_.TryGetValue(panelKind, out var list)) {\n      list.ForEach(item => action(item.Panel));\n    }\n  }\n\n  private void ForEachPanel(Action<IToolPanel> action) {\n    foreach (var (kind, list) in panelHostSet_) {\n      list.ForEach(item => action(item.Panel));\n    }\n  }\n\n  private async Task ForEachPanelAsync(Func<IToolPanel, Task> action) {\n    foreach (var (kind, list) in panelHostSet_) {\n      foreach (var item in list) {\n        await action(item.Panel);\n      }\n    }\n  }\n\n  private void ForEachPanelHost(Action<PanelHostInfo> action) {\n    foreach (var (kind, list) in panelHostSet_) {\n      list.ForEach(item => action(item));\n    }\n  }\n\n  private void UpdatePanelEnabledState(bool enabled) {\n    ForEachPanelHost(pair => {\n      // Always keep the help panel enabled.\n      if (pair.Panel.PanelKind != ToolPanelKind.Help) {\n        if (enabled) {\n          Utils.EnableControl(pair.Panel as UIElement);\n        }\n        else {\n          Utils.DisableControl(pair.Panel as UIElement, 0.85);\n        }\n      }\n    });\n  }\n\n  private void SwitchCommandFocusToPanel(PanelHostInfo panelHost) {\n    var activePanel = FindActivePanel(panelHost.PanelKind);\n\n    if (activePanel != null) {\n      activePanel.Panel.HasCommandFocus = false;\n    }\n\n    panelHost.Panel.HasCommandFocus = true;\n  }\n\n  private void PickCommandFocusPanel(ToolPanelKind kind) {\n    // Pick last panel without pinned content.\n    if (!panelHostSet_.TryGetValue(kind, out var list)) {\n      return;\n    }\n\n    if (list.Count == 0) {\n      return;\n    }\n\n    var lastPanel = list.FindLast(item => !item.Panel.HasPinnedContent);\n\n    if (lastPanel == null) {\n      // If not found, just pick the last panel.\n      lastPanel = list[^1];\n    }\n\n    lastPanel.Panel.HasCommandFocus = true;\n  }\n\n  private void PanelHost_Hiding(object sender, CancelEventArgs e) {\n    var panelHost = sender as LayoutAnchorable;\n    var panelInfo = FindPanel(panelHost);\n    panelInfo.Panel.HasCommandFocus = false;\n\n    // panelInfo.Panel.IsPanelEnabled = false;\n    UnregisterPanel(panelInfo);\n    ResetPanelEvents(panelInfo);\n    RenamePanels(panelInfo.PanelKind);\n    PickCommandFocusPanel(panelInfo.PanelKind);\n  }\n\n  private void LayoutAnchorable_IsActiveChanged(object sender, EventArgs e) {\n    if (!(sender is LayoutAnchorable panelHost)) {\n      return;\n    }\n\n    if (!IsSessionStarted) {\n      return; // When closing main window, ignore even if triggered.\n    }\n\n    if (!(panelHost.Content is IToolPanel toolPanel)) {\n      return;\n    }\n\n    if (panelHost.IsActive) {\n      toolPanel.OnActivatePanel();\n    }\n    else {\n      toolPanel.OnDeactivatePanel();\n    }\n  }\n\n  private void LayoutAnchorable_IsSelectedChanged(object sender, EventArgs e) {\n    if (!(sender is LayoutAnchorable panelHost)) {\n      return;\n    }\n\n    if (!(panelHost.Content is IToolPanel toolPanel)) {\n      return;\n    }\n\n    if (panelHost.IsSelected) {\n      toolPanel.OnShowPanel();\n    }\n    else {\n      toolPanel.OnHidePanel();\n    }\n  }\n\n  private async Task<DocumentHostInfo> AddNewDocument(OpenSectionKind kind) {\n    var document = new IRDocumentHost(this);\n    var host = new LayoutDocument {\n      Content = document\n    };\n\n    // The document group must be found at runtime since when restoring\n    // the dock layout to a previous state, it creates another layout tree\n    // that is different than the initial layout defined in the XAML file.\n    var documentGroup = DockManager.Layout.Descendents().\n      OfType<LayoutDocumentPaneGroup>().FirstOrDefault();\n\n    switch (kind) {\n      case OpenSectionKind.ReplaceCurrent:\n      case OpenSectionKind.NewTab: {\n        if (activeDocumentPanel_ == null) {\n          activeDocumentPanel_ = new LayoutDocumentPane(host);\n          documentGroup.Children.Add(activeDocumentPanel_);\n        }\n        else {\n          activeDocumentPanel_.Children.Add(host);\n        }\n\n        break;\n      }\n      case OpenSectionKind.NewTabDockLeft:\n      case OpenSectionKind.ReplaceLeft: {\n        activeDocumentPanel_ = new LayoutDocumentPane(host);\n        documentGroup.Children.Insert(0, activeDocumentPanel_);\n        break;\n      }\n      case OpenSectionKind.NewTabDockRight:\n      case OpenSectionKind.ReplaceRight: {\n        activeDocumentPanel_ = new LayoutDocumentPane(host);\n        documentGroup.Children.Add(activeDocumentPanel_);\n        break;\n      }\n      default: {\n        throw new ArgumentOutOfRangeException(nameof(kind), kind, null);\n      }\n    }\n\n    var documentHost = new DocumentHostInfo(document, host);\n    documentHost.HostParent = activeDocumentPanel_;\n    sessionState_.DocumentHosts.Add(documentHost);\n\n    await SetActiveDocument(documentHost, false);\n    host.IsActiveChanged += DocumentHost_IsActiveChanged;\n    host.Closed += DocumentHost_Closed;\n    host.IsSelected = true;\n    return documentHost;\n  }\n\n  private async Task SetupPanels() {\n    NotifyPanelsOfSessionStart();\n    await SetupSectionPanel();\n  }\n\n  private async Task SetupSectionPanel() {\n    if (SectionPanel.MainSummary == null) {\n      SectionPanel.CompilerInfo = compilerInfo_;\n      SectionPanel.Session = this;\n\n      // Clear stale module summaries from any previous session\n      // before adding the new ones.\n      SectionPanel.ClearModuleSummaries();\n\n      foreach (var doc in sessionState_.Documents) {\n        if (doc != sessionState_.MainDocument &&\n            doc != sessionState_.DiffDocument) {\n          SectionPanel.AddModuleSummary(doc.Summary);\n        }\n      }\n\n      await SectionPanel.SetMainSummary(sessionState_.MainDocument.Summary);\n      SectionPanel.MainTitle = sessionState_.MainDocument.ModuleName;\n      SectionPanel.OnSessionStart();\n    }\n\n    if (sessionState_.IsInTwoDocumentsDiffMode) {\n      await SectionPanel.SetDiffSummary(sessionState_.DiffDocument.Summary);\n      SectionPanel.DiffTitle = sessionState_.DiffDocument.ModuleName;\n    }\n\n    if (sessionState_.IsInTwoDocumentsDiffMode) {\n      await ShowSectionPanelDiffs(sessionState_.DiffDocument);\n    }\n  }\n\n  private bool RestoreDockLayout() {\n    if (App.Settings.WorkspaceOptions.RestoreDefaultActiveWorkspace() ||\n        !initialDockLayoutRestored_) { // Initial load and registration of active panel config.\n      var activeWs = App.Settings.WorkspaceOptions.ActiveWorkspace;\n      WorkspaceCombobox.SelectedIndex = activeWs.Order;\n      initialDockLayoutRestored_ = true;\n      return RestoreDockLayout(activeWs.FilePath);\n    }\n\n    return true; // No change needed.\n  }\n\n  private bool RestoreDockLayout(string dockLayoutFile) {\n    try {\n      Trace.WriteLine($\"Restore dock layout from {dockLayoutFile}\");\n      var serializer = new XmlLayoutSerializer(DockManager);\n      var visiblePanels = new List<IToolPanel>();\n      var registeredPanelKinds = new HashSet<ToolPanelKind>();\n\n      serializer.LayoutSerializationCallback += (s, args) => {\n        if (args.Model is LayoutDocument) {\n          args.Cancel = true; // Don't recreate any document panels.\n        }\n        else {\n          args.Content = args.Content;\n\n          if (args.Content is not IToolPanel panel) {\n            args.Cancel = true;\n            return;\n          }\n\n          if (panel.PanelKind == ToolPanelKind.Other) {\n            args.Cancel = true;\n            return;\n          }\n\n          var panelHost = (LayoutAnchorable)args.Model;\n          panelHost.IsActiveChanged += LayoutAnchorable_IsActiveChanged;\n          panelHost.IsSelectedChanged += LayoutAnchorable_IsSelectedChanged;\n          registeredPanelKinds.Add(panel.PanelKind);\n\n          if (panelHost.IsVisible && panelHost.IsSelected) {\n            visiblePanels.Add(panel);\n          }\n\n          switch (panel.PanelKind) {\n            case ToolPanelKind.CallTree: {\n              CallTreePanel = (CallTreePanel)panel;\n              CallTreePanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(CallTreePanel, CallTreePanelHost);\n              break;\n            }\n            case ToolPanelKind.CallerCallee: {\n              CallerCalleePanel = (CallerCalleePanel)panel;\n              CallerCalleePanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(CallerCalleePanel, CallerCalleePanelHost);\n              break;\n            }\n            case ToolPanelKind.FlameGraph: {\n              FlameGraphPanel = (FlameGraphPanel)panel;\n              FlameGraphPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(FlameGraphPanel, FlameGraphPanelHost);\n              break;\n            }\n            case ToolPanelKind.Timeline: {\n              TimelinePanel = (TimelinePanel)panel;\n              TimelinePanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(TimelinePanel, TimelinePanelHost);\n              break;\n            }\n            case ToolPanelKind.Bookmarks: {\n              BookmarksPanel = (BookmarksPanel)panel;\n              BookmarksPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(BookmarksPanel, BookmarksPanelHost);\n              break;\n            }\n            case ToolPanelKind.Definition: {\n              DefinitionPanel = (DefinitionPanel)panel;\n              DefinitionPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(DefinitionPanel, DefinitionPanelHost);\n              break;\n            }\n            case ToolPanelKind.FlowGraph: {\n              FlowGraphPanel = (GraphPanel)panel;\n              FlowGraphPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(FlowGraphPanel, FlowGraphPanelHost);\n              break;\n            }\n            case ToolPanelKind.DominatorTree: {\n              DominatorTreePanel = (DominatorTreePanel)panel;\n              DominatorTreePanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(DominatorTreePanel, DominatorTreePanelHost);\n              break;\n            }\n            // case ToolPanelKind.PostDominatorTree: {\n            //   PostDominatorTreePanel = (PostDominatorTreePanel)panel;\n            //   PostDominatorTreePanelHost = (LayoutAnchorable)args.Model;\n            //   RegisterPanel(PostDominatorTreePanel, PostDominatorTreePanelHost);\n            //   break;\n            // }\n            case ToolPanelKind.ExpressionGraph: {\n              ExpressionGraphPanel = (ExpressionGraphPanel)panel;\n              ExpressionGraphPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(ExpressionGraphPanel, ExpressionGraphPanelHost);\n              break;\n            }\n            case ToolPanelKind.Developer: {\n              DeveloperPanel = (DeveloperPanel)panel;\n              DeveloperPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(DeveloperPanel, DeveloperPanelHost);\n              break;\n            }\n            case ToolPanelKind.Notes: {\n              NotesPanel = (NotesPanel)panel;\n              NotesPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(NotesPanel, NotesPanelHost);\n              break;\n            }\n            case ToolPanelKind.References: {\n              ReferencesPanel = (ReferencesPanel)panel;\n              ReferencesPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(ReferencesPanel, ReferencesPanelHost);\n              break;\n            }\n            case ToolPanelKind.Section: {\n              SectionPanel = (SectionPanelPair)panel;\n              SectionPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(SectionPanel, SectionPanelHost);\n              break;\n            }\n            case ToolPanelKind.Source: {\n              SourceFilePanel = (SourceFilePanel)panel;\n              SourceFilePanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(SourceFilePanel, SourceFilePanelHost);\n              break;\n            }\n            //case ToolPanelKind.PassOutput: {\n            //  PassOutputPanel = (PassOutputPanel)panel;\n            //  PassOutputHost = (LayoutAnchorable)args.Model;\n            //  RegisterPanel(PassOutputPanel, PassOutputHost);\n            //  break;\n            //}\n            case ToolPanelKind.SearchResults: {\n              SearchResultsPanel = (SearchResultsPanel)panel;\n              SearchResultsPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(SearchResultsPanel, SearchResultsPanelHost);\n              break;\n            }\n            // case ToolPanelKind.Scripting: {\n            //   ScriptingPanel = (ScriptingPanel)panel;\n            //   ScriptingPanelHost = (LayoutAnchorable)args.Model;\n            //   RegisterPanel(ScriptingPanel, ScriptingPanelHost);\n            //   break;\n            // }\n            case ToolPanelKind.Help: {\n              HelpPanel = (HelpPanel)panel;\n              HelpPanelHost = (LayoutAnchorable)args.Model;\n              RegisterPanel(HelpPanel, HelpPanelHost);\n              break;\n            }\n          }\n        }\n      };\n\n      // Unregister existing panels.\n      UnregisterAllPanels();\n\n      // Load panels from layout file.\n      serializer.Deserialize(dockLayoutFile);\n\n      // Manually invoke the events, they are not triggered automatically.\n      foreach (var visiblePanel in visiblePanels) {\n        visiblePanel.OnShowPanel();\n        visiblePanel.OnActivatePanel();\n      }\n\n      RegisterNewVersionPanels(registeredPanelKinds);\n      RenameAllPanels();\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load dock layout: {ex}\");\n      return false;\n    }\n  }\n\n  private void RegisterNewVersionPanels(HashSet<ToolPanelKind> registeredPanelKinds) {\n    // When a new panel kind is added in a new version of the app,\n    // the previous dock layout files don't reference it and when restoring\n    // the new panel is not registered properly in the UI. Code below fixes this\n    // by re-adding the panel to the loaded dock layout.\n    var panelKinds = Enum.GetValues<ToolPanelKind>();\n\n    foreach (var kind in panelKinds) {\n      if (!registeredPanelKinds.Contains(kind)) {\n        var newPanelHost = FindPanelHostForKind(kind);\n\n        if (newPanelHost != null) {\n          newPanelHost.Parent.RemoveChild(newPanelHost);\n          newPanelHost.AddToLayout(DockManager, AnchorableShowStrategy.Right);\n        }\n      }\n    }\n  }\n\n  private void UnregisterAllPanels() {\n    var panelList = new List<PanelHostInfo>();\n\n    foreach (var panelSet in panelHostSet_) {\n      foreach (var panel in panelSet.Value) {\n        panelList.Add(panel);\n      }\n    }\n\n    foreach (var panel in panelList) {\n      UnregisterPanel(panel);\n    }\n\n    panelHostSet_.Clear();\n  }\n\n  private void ShowDocumentSearchPanel() {\n    if (documentSearchVisible_) {\n      return;\n    }\n\n    if (!IsSessionStarted || sessionState_.Documents.Count == 0) {\n      // No proper session started yet.\n      return;\n    }\n\n    var position = new Point(236, MainMenu.ActualHeight + 1);\n    documentSearchPanel_ = new DocumentSearchPanel(position, 800, 500, this, this, sessionState_.Documents[0]);\n    documentSearchPanel_.PopupClosed += DocumentSearchPanel__PopupClosed;\n    documentSearchPanel_.PopupDetached += DocumentSearchPanel__PopupDetached;\n    documentSearchPanel_.IsOpen = true;\n    documentSearchVisible_ = true;\n  }\n\n  private void DocumentSearchPanel__PopupDetached(object sender, EventArgs e) {\n    RegisterDetachedPanel(documentSearchPanel_);\n  }\n\n  private void DocumentSearchPanel__PopupClosed(object sender, EventArgs e) {\n    CloseDocumentSearchPanel();\n  }\n\n  private void CloseDocumentSearchPanel() {\n    if (!documentSearchVisible_) {\n      return;\n    }\n\n    if (documentSearchPanel_.IsDetached) {\n      UnregisterDetachedPanel(documentSearchPanel_);\n    }\n\n    documentSearchPanel_.IsOpen = false;\n    documentSearchPanel_.PopupClosed -= DocumentSearchPanel__PopupClosed;\n    documentSearchPanel_.PopupDetached -= DocumentSearchPanel__PopupDetached;\n    documentSearchPanel_ = null;\n    documentSearchVisible_ = false;\n  }\n\n  private bool SaveDockLayout() {\n    if (App.Settings.WorkspaceOptions.ActiveWorkspace == null) {\n      App.Settings.WorkspaceOptions.RestoreDefaultActiveWorkspace();\n    }\n\n    return SaveDockLayout(App.Settings.WorkspaceOptions.ActiveWorkspace.FilePath);\n  }\n\n  public bool SaveDockLayout(string dockLayoutFile) {\n    try {\n      var serializer = new XmlLayoutSerializer(DockManager);\n      Utils.TryDeleteFile(dockLayoutFile);\n      serializer.Serialize(dockLayoutFile);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to save dock layout: {ex}\");\n      return false;\n    }\n  }\n\n  private void WorkspaceCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    var selectedWs = WorkspaceCombobox.SelectedItem as Workspace;\n\n    if (selectedWs != null &&\n        selectedWs != App.Settings.WorkspaceOptions.ActiveWorkspace) {\n      SaveDockLayout(); // Save current layout before switching.\n      App.Settings.WorkspaceOptions.ActiveWorkspace = selectedWs;\n      RestoreDockLayout(selectedWs.FilePath);\n    }\n  }\n\n  private void PopulateWorkspacesCombobox() {\n    var list = App.Settings.WorkspaceOptions.Workspaces;\n    WorkspaceCombobox.ItemsSource = new ObservableCollectionRefresh<Workspace>(list);\n\n    if (App.Settings.WorkspaceOptions.ActiveWorkspace != null) {\n      WorkspaceCombobox.SelectedIndex = App.Settings.WorkspaceOptions.ActiveWorkspace.Order;\n    }\n  }\n\n  private void WorkspacesButton_OnClick(object sender, RoutedEventArgs e) {\n    ShowWorkspacesWindow();\n  }\n\n  private void ShowWorkspacesWindow() {\n    var wsWindow = new WorkspacesWindow();\n    wsWindow.Owner = this;\n    wsWindow.ShowDialog();\n    PopulateWorkspacesCombobox();\n  }\n\n  private async void ShowPanelMenu_Click(object sender, RoutedEventArgs e) {\n    string panelName = ((MenuItem)sender).Tag as string;\n    var panelKind = Enum.Parse<ToolPanelKind>(panelName);\n    await ShowPanel(panelKind);\n  }\n\n  private LayoutAnchorable FindPanelHostForKind(ToolPanelKind panelKind) {\n    switch (panelKind) {\n      case ToolPanelKind.Section: {\n        return SectionPanelHost;\n      }\n      case ToolPanelKind.Definition: {\n        return DefinitionPanelHost;\n      }\n      case ToolPanelKind.References: {\n        return ReferencesPanelHost;\n      }\n      case ToolPanelKind.Bookmarks: {\n        return SectionPanelHost;\n      }\n      case ToolPanelKind.Source: {\n        return SourceFilePanelHost;\n      }\n      // case ToolPanelKind.PassOutput: {\n      //   return PassOutputHost;\n      // }\n      case ToolPanelKind.SearchResults: {\n        return SearchResultsPanelHost;\n      }\n      case ToolPanelKind.Notes: {\n        return NotesPanelHost;\n      }\n      // case ToolPanelKind.Scripting: {\n      //   return ScriptingPanelHost;\n      // }\n      case ToolPanelKind.Developer: {\n        return DeveloperPanelHost;\n      }\n      case ToolPanelKind.FlowGraph: {\n        return FlowGraphPanelHost;\n      }\n      case ToolPanelKind.DominatorTree: {\n        return DominatorTreePanelHost;\n      }\n      // case ToolPanelKind.PostDominatorTree: {\n      //   return PostDominatorTreePanelHost;\n      // }\n      case ToolPanelKind.ExpressionGraph: {\n        return ExpressionGraphPanelHost;\n      }\n      case ToolPanelKind.CallTree: {\n        return CallTreePanelHost;\n      }\n      case ToolPanelKind.CallerCallee: {\n        return CallerCalleePanelHost;\n      }\n      case ToolPanelKind.FlameGraph: {\n        return FlameGraphPanelHost;\n      }\n      case ToolPanelKind.Timeline: {\n        return TimelinePanelHost;\n      }\n      case ToolPanelKind.Help: {\n        return HelpPanelHost;\n      }\n      default:\n        return null;\n    }\n  }\n\n  private void OpenLogMenu_Click(object sender, RoutedEventArgs e) {\n    Trace.Flush();\n    string file = App.GetTraceFilePath();\n\n    if (File.Exists(file)) {\n      try {\n        var psi = new ProcessStartInfo(file) {\n          UseShellExecute = true\n        };\n\n        Process.Start(psi);\n      }\n      catch (Exception ex) {\n        MessageBox.Show($\"Failed to open log file {file}\\n{ex.Message}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Error);\n      }\n    }\n    else {\n      MessageBox.Show($\"No log file found: {file}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Warning);\n    }\n  }\n\n  private void ResetWorkspaceMenu_Click(object sender, RoutedEventArgs e) {\n    App.Settings.WorkspaceOptions.RestoreDefaultActiveWorkspace();\n    RestoreDockLayout();\n  }\n\n  private void ForceGCMenu_Click(object sender, RoutedEventArgs e) {\n    Trace.WriteLine(\"Force GC start\");\n    GC.Collect(GC.MaxGeneration, GCCollectionMode.Aggressive, true, true);\n    GC.WaitForPendingFinalizers();\n    Trace.WriteLine(\"Force GC end\");\n    Trace.Flush();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/MainWindowProfiling.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Compilers;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Windows;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.ETW;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Profile.Timeline;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.UI.Compilers.ASM;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class MainWindow : Window, IUISession {\n  private CancelableTaskInstance updateProfileTask_ = new();\n  private ProfileData.ProcessingResult allThreadsProfile_;\n  private ProfileFilterState profileFilter_;\n  private OptionsPanelHostPopup markingOptionsPanelPopup_;\n  public bool IsProfileSession => ProfileData != null;\n  public bool HasEnabledMarkedFunctions =>\n    MarkingSettings.HasEnabledFunctionMarkings;\n  public bool HasEnabledMarkedModules =>\n    MarkingSettings.HasEnabledModuleMarkings;\n  public ProfileData ProfileData => sessionState_?.ProfileData;\n\n  public ProfileFilterState ProfileFilter {\n    get => profileFilter_;\n    set => profileFilter_ = value;\n  }\n\n  public async Task<bool> LoadProfileData(string profileFilePath, List<int> processIds,\n                                          ProfileDataProviderOptions options,\n                                          SymbolFileSourceSettings symbolSettings,\n                                          ProfileDataReport report,\n                                          ProfileLoadProgressHandler progressCallback,\n                                          CancelableTask cancelableTask) {\n    Trace.WriteLine($\"LoadProfileData: Starting profile data loading for {profileFilePath}\");\n    var sw = Stopwatch.StartNew();\n    using var provider = new ETWProfileDataProvider();\n    \n    // Subscribe to events to replace the old session callbacks\n    provider.SetupNewSessionRequested += OnSetupNewSessionRequested;\n    provider.StartNewSessionRequested += OnStartNewSessionRequested;\n    \n    var result = await provider.LoadTraceAsync(profileFilePath, processIds,\n                                               options, symbolSettings,\n                                               report, progressCallback, cancelableTask);\n\n    Trace.WriteLine($\"LoadProfileData: LoadTraceAsync completed, result is {(result != null ? \"NOT NULL\" : \"NULL\")}\");\n    Trace.WriteLine($\"LoadProfileData: IsSessionStarted = {IsSessionStarted}\");\n    \n    if (!IsSessionStarted) {\n      Trace.WriteLine($\"LoadProfileData: ERROR - Session not started, returning false\");\n      return false;\n    }\n\n    if (result != null) {\n      result.Report = report;\n      sessionState_.ProfileData = result;\n      UpdateWindowTitle();\n      UnloadProfilingDebugInfo();\n      Trace.WriteLine($\"LoadProfileData: Successfully set profile data in session\");\n    }\n    else {\n      Trace.WriteLine($\"LoadProfileData: ERROR - LoadTraceAsync returned null result\");\n    }\n\n    Trace.WriteLine($\"Done profile load and setup: {sw}, {sw.ElapsedMilliseconds} ms\");\n    Trace.Flush();\n    return result != null;\n  }\n\n  public async Task<bool> LoadProfileData(RawProfileData data, List<int> processIds,\n                                          ProfileDataProviderOptions options,\n                                          SymbolFileSourceSettings symbolSettings,\n                                          ProfileDataReport report,\n                                          ProfileLoadProgressHandler progressCallback,\n                                          CancelableTask cancelableTask) {\n    var sw = Stopwatch.StartNew();\n    using var provider = new ETWProfileDataProvider();\n    \n    // Subscribe to events to replace the old session callbacks\n    provider.SetupNewSessionRequested += OnSetupNewSessionRequested;\n    provider.StartNewSessionRequested += OnStartNewSessionRequested;\n    \n    var result = await provider.LoadTraceAsync(data, processIds,\n                                               options, symbolSettings,\n                                               report, progressCallback, cancelableTask);\n\n    if (!IsSessionStarted) {\n      return false;\n    }\n\n    if (result != null) {\n      result.Report = report;\n      sessionState_.ProfileData = result;\n      UpdateWindowTitle();\n      UnloadProfilingDebugInfo();\n    }\n\n    Trace.WriteLine($\"Done profile load and setup: {sw}, {sw.ElapsedMilliseconds} ms\");\n    Trace.Flush();\n    return result != null;\n  }\n\n  public async Task<bool> FilterProfileSamples(ProfileFilterState state) {\n    using var cancelableTask = await updateProfileTask_.CancelCurrentAndCreateTaskAsync();\n\n    SetApplicationProgress(true, double.NaN, \"Filtering profiling data\");\n    StartUIUpdate();\n\n    // Update the active profile UI.\n    SetActiveProfileFilter(state);\n\n    var totalSw = Stopwatch.StartNew();\n    Trace.WriteLine(\"--------------------------------------------------------\\n\");\n    Trace.WriteLine($\"Profile filter {state.Filter}, samples {ProfileData.Samples.Count}\");\n\n    var filterSw = Stopwatch.StartNew();\n    ProfileData.ProcessingResult result = null; // Profile before filtering.\n\n    if (state.Filter.IncludesAll && allThreadsProfile_ != null) {\n      // This speeds up going back to the unfiltered profile.\n      Trace.WriteLine(\"Restore main profile\");\n      result = ProfileData.RestorePreviousProfile(allThreadsProfile_);\n    }\n    else {\n      Trace.WriteLine(\"Compute new profile\");\n      result = await Task.Run(() => ProfileData.FilterFunctionProfile(state.Filter));\n    }\n\n    if (result.Filter.IncludesAll) {\n      Trace.WriteLine(\"Save main profile\");\n      allThreadsProfile_ = result;\n    }\n\n    Trace.WriteLine($\"ComputeFunctionProfile time: {filterSw.ElapsedMilliseconds} ms\");\n\n    // Update all profiling panels.\n    var updateSw = Stopwatch.StartNew();\n    await SectionPanel.RefreshProfile();\n    await RefreshProfilingPanels();\n    await ProfileSampleRangeDeselected();\n\n    Trace.WriteLine($\"RefreshProfile time: {updateSw.ElapsedMilliseconds} ms\");\n    Trace.WriteLine($\"FilterProfileSamples time: {totalSw.ElapsedMilliseconds} ms\");\n    Trace.WriteLine(\"--------------------------------------------------------\\n\");\n\n    ResetApplicationProgress();\n    StopUIUpdate();\n    return true;\n  }\n\n  public async Task<bool> RemoveProfileSamplesFilter() {\n    await FilterProfileSamples(new ProfileFilterState());\n    await ProfileSampleRangeDeselected();\n    return true;\n  }\n\n  public async Task<bool> OpenProfileFunction(ProfileCallTreeNode node, OpenSectionKind openMode,\n                                              ProfileSampleFilter instanceFilter = null,\n                                              IRDocumentHost targetDocument = null) {\n    if (node is not {HasFunction: true}) {\n      return false;\n    }\n\n    return await OpenProfileFunction(node.Function, openMode, instanceFilter, targetDocument);\n  }\n\n  public async Task<bool> OpenProfileFunction(IRTextFunction function, OpenSectionKind openMode,\n                                              ProfileSampleFilter instanceFilter = null,\n                                              IRDocumentHost targetDocument = null) {\n    var args = new OpenSectionEventArgs(function.Sections[0], openMode, targetDocument);\n    var docHost = await SwitchDocumentSectionAsync(args);\n\n    if (instanceFilter != null) {\n      await docHost.SwitchProfileInstanceAsync(instanceFilter);\n    }\n\n    return true;\n  }\n\n  public async Task<bool> SwitchActiveProfileFunction(ProfileCallTreeNode node) {\n    if (node is not {HasFunction: true}) {\n      return false;\n    }\n\n    await SwitchActiveFunction(node.Function);\n    return true;\n  }\n\n  public async Task<bool> OpenProfileSourceFile(ProfileCallTreeNode node, ProfileSampleFilter profileFilter = null) {\n    if (node is not {HasFunction: true}) {\n      return false;\n    }\n\n    return await OpenProfileSourceFile(node.Function, profileFilter);\n  }\n\n  public async Task<bool> OpenProfileSourceFile(IRTextFunction function, ProfileSampleFilter profileFilter = null) {\n    if (FindPanel(ToolPanelKind.Source) is not SourceFilePanel panel) {\n      panel = await ShowPanel(ToolPanelKind.Source) as SourceFilePanel;\n    }\n\n    if (panel != null && function.HasSections) {\n      await panel.LoadSourceFile(function.Sections[0], profileFilter);\n    }\n\n    return true;\n  }\n\n  public async Task<bool> SelectProfileFunctionInPanel(ProfileCallTreeNode node, ToolPanelKind panelKind) {\n    using var cancelableTask = await updateProfileTask_.CancelCurrentAndCreateTaskAsync();\n\n    switch (panelKind) {\n      case ToolPanelKind.CallTree: {\n        if (FindAndActivatePanel(ToolPanelKind.CallTree) is not CallTreePanel panel) {\n          panel = await ShowPanel(ToolPanelKind.CallTree) as CallTreePanel;\n        }\n\n        panel?.SelectFunction(node);\n        break;\n      }\n      case ToolPanelKind.FlameGraph: {\n        if (FindAndActivatePanel(ToolPanelKind.FlameGraph) is not FlameGraphPanel panel) {\n          panel = await ShowPanel(ToolPanelKind.FlameGraph) as FlameGraphPanel;\n        }\n\n        panel?.SelectFunction(node);\n        break;\n      }\n      case ToolPanelKind.Timeline: {\n        if (FindAndActivatePanel(ToolPanelKind.Timeline) is not TimelinePanel panel) {\n          panel = await ShowPanel(ToolPanelKind.Timeline) as TimelinePanel;\n        }\n\n        if (panel != null) {\n          await SelectFunctionSamples(node, panel);\n        }\n\n        break;\n      }\n      case ToolPanelKind.Source: {\n        await OpenProfileSourceFile(node);\n        break;\n      }\n      case ToolPanelKind.Section: {\n        if (FindAndActivatePanel(ToolPanelKind.Section) is not SectionPanel panel) {\n          await ShowPanel(ToolPanelKind.Section);\n        }\n\n        await SwitchActiveProfileFunction(node);\n        break;\n      }\n      default: {\n        throw new InvalidOperationException();\n      }\n    }\n\n    return true;\n  }\n\n  public async Task<bool> SelectProfileFunctionInPanel(IRTextFunction func, ToolPanelKind panelKind) {\n    using var cancelableTask = await updateProfileTask_.CancelCurrentAndCreateTaskAsync();\n\n    switch (panelKind) {\n      case ToolPanelKind.CallTree: {\n        if (FindAndActivatePanel(ToolPanelKind.CallTree) is not CallTreePanel panel) {\n          panel = await ShowPanel(ToolPanelKind.CallTree) as CallTreePanel;\n        }\n\n        panel?.SelectFunction(func);\n        break;\n      }\n      case ToolPanelKind.FlameGraph: {\n        if (FindAndActivatePanel(ToolPanelKind.FlameGraph) is not FlameGraphPanel panel) {\n          panel = await ShowPanel(ToolPanelKind.FlameGraph) as FlameGraphPanel;\n        }\n\n        if (panel != null) {\n          await panel.SelectFunction(func);\n        }\n\n        break;\n      }\n      case ToolPanelKind.Timeline: {\n        if (FindAndActivatePanel(ToolPanelKind.Timeline) is not TimelinePanel panel) {\n          panel = await ShowPanel(ToolPanelKind.Timeline) as TimelinePanel;\n        }\n\n        if (panel != null) {\n          var nodeList = ProfileData.CallTree.GetSortedCallTreeNodes(func);\n\n          if (nodeList is {Count: > 0}) {\n            await SelectFunctionSamples(nodeList[0], panel);\n          }\n        }\n\n        break;\n      }\n      default: {\n        throw new InvalidOperationException();\n      }\n    }\n\n    return true;\n  }\n\n  public async Task<bool> ProfileSampleRangeSelected(SampleTimeRangeInfo range) {\n    using var cancelableTask = await updateProfileTask_.CancelCurrentAndCreateTaskAsync();\n\n    //? TODO: If an event fires during the call tree/sample filtering,\n    //? either ignore it or better run it after the filtering is done\n    if (ProfileData.CallTree == null) {\n      return false;\n    }\n\n    var funcs = await Task.Run(() =>\n                                 FindFunctionsForSamples(range.StartSampleIndex, range.EndSampleIndex,\n                                                         range.ThreadId, ProfileData));\n    var sectionPanel = FindPanel(ToolPanelKind.Section) as SectionPanelPair;\n    sectionPanel?.MarkFunctions(funcs.ToList());\n\n    var nodes = await Task.Run(() =>\n                                 FindCallTreeNodesForSamples(funcs, ProfileData));\n    var panel = FindPanel(ToolPanelKind.FlameGraph) as FlameGraphPanel;\n    panel?.MarkFunctions(nodes);\n    return true;\n  }\n\n  public async Task<bool> ProfileFunctionSelected(ProfileCallTreeNode node, ToolPanelKind sourcePanelKind) {\n    using var cancelableTask = await updateProfileTask_.CancelCurrentAndCreateTaskAsync();\n\n    //? TODO: If an event fires during the call tree/sample filtering,\n    //? either ignore it or better run it after the filtering is done\n    if (ProfileData.CallTree == null) {\n      return false;\n    }\n\n    if (sourcePanelKind != ToolPanelKind.Section) {\n      await SwitchActiveFunction(node.Function, false);\n    }\n\n    if (sourcePanelKind != ToolPanelKind.FlameGraph) {\n      if (FindPanel(ToolPanelKind.FlameGraph) is FlameGraphPanel flameGraphPanel) {\n        await flameGraphPanel.SelectFunction(node.Function, false);\n      }\n    }\n\n    if (sourcePanelKind != ToolPanelKind.CallTree) {\n      var callTreePanel = FindPanel(ToolPanelKind.CallTree) as CallTreePanel;\n      callTreePanel?.SelectFunction(node);\n    }\n\n    if (sourcePanelKind != ToolPanelKind.CallerCallee) {\n      if (FindPanel(ToolPanelKind.CallerCallee) is CallTreePanel callerCalleePanel) {\n        //? TODO: Make it path-sensitive (show exact instance, not combined?)\n        await callerCalleePanel?.DisplayProfileCallerCalleeTree(node.Function);\n      }\n    }\n\n    if (FindPanel(ToolPanelKind.Timeline) is TimelinePanel panel) {\n      //? TODO: Select only samples included in this call node,\n      //? right now selects any instance of the func\n      await SelectFunctionSamples(node, panel);\n    }\n\n    return true;\n  }\n\n  public async Task<bool> MarkProfileFunction(ProfileCallTreeNode node, ToolPanelKind sourcePanelKind,\n                                              HighlightingStyle style) {\n    if (sourcePanelKind == ToolPanelKind.Timeline) {\n      if (FindPanel(ToolPanelKind.Timeline) is TimelinePanel panel) {\n        var threadSamples = await Task.Run(() => FindFunctionSamples(node, ProfileData));\n        panel.MarkFunctionSamples(node, threadSamples, style);\n      }\n    }\n\n    return true;\n  }\n\n  public async Task<bool> ProfileFunctionSelected(IRTextFunction function, ToolPanelKind sourcePanelKind) {\n    if (ProfileData.CallTree == null) {\n      return false;\n    }\n\n    var funcNodes = ProfileData.CallTree.GetSortedCallTreeNodes(function);\n\n    if (funcNodes is {Count: > 0}) {\n      await ProfileFunctionSelected(funcNodes[0], sourcePanelKind);\n    }\n\n    return true;\n  }\n\n  public async Task<bool> ProfileSampleRangeDeselected() {\n    using var cancelableTask = await updateProfileTask_.CancelCurrentAndCreateTaskAsync();\n\n    var panel = FindPanel(ToolPanelKind.FlameGraph) as FlameGraphPanel;\n    panel?.ClearMarkedFunctions();\n\n    var sectionPanel = FindPanel(ToolPanelKind.Section) as SectionPanelPair;\n    sectionPanel?.ClearMarkedFunctions();\n    return true;\n  }\n\n  public async Task<bool> ProfileFunctionDeselected() {\n    using var cancelableTask = await updateProfileTask_.CancelCurrentAndCreateTaskAsync();\n\n    var panel = FindPanel(ToolPanelKind.Timeline) as TimelinePanel;\n    panel?.ClearSelectedFunctionSamples();\n\n    var callerCalleePanel = FindPanel(ToolPanelKind.CallerCallee) as CallTreePanel;\n    callerCalleePanel?.Reset();\n    return true;\n  }\n\n  public async Task<IDebugInfoProvider> GetDebugInfoProvider(IRTextFunction function) {\n    var loadedDoc = FindLoadedDocument(function);\n\n    return CompilerInfo.DebugInfoProviderFactory.GetOrCreateDebugInfoProvider(function, loadedDoc);\n  }\n\n  public async Task<bool> FunctionMarkingChanged(ToolPanelKind sourcePanelKind) {\n    if (sourcePanelKind != ToolPanelKind.Section) {\n      if (FindPanel(ToolPanelKind.Section) is SectionPanelPair panel) {\n        await panel.UpdateMarkedFunctions(true);\n      }\n    }\n\n    if (sourcePanelKind != ToolPanelKind.FlameGraph) {\n      var panel = FindPanel(ToolPanelKind.FlameGraph) as FlameGraphPanel;\n      panel?.UpdateMarkedFunctions(true);\n    }\n\n    if (sourcePanelKind != ToolPanelKind.CallTree) {\n      if (FindPanel(ToolPanelKind.CallTree) is CallTreePanel panel) {\n        await panel.UpdateMarkedFunctions(true);\n      }\n    }\n\n    if (sourcePanelKind != ToolPanelKind.CallerCallee) {\n      if (FindPanel(ToolPanelKind.CallerCallee) is CallTreePanel panel) {\n        await panel.UpdateMarkedFunctions(true);\n      }\n    }\n\n    // Also update any detached profiling popup.\n    foreach (var popup in detachedPanels_) {\n      if (popup is CallTreeNodePopup nodePopup) {\n        nodePopup.UpdateMarkedFunctions();\n      }\n    }\n\n    OnPropertyChanged(nameof(HasEnabledMarkedModules));\n    OnPropertyChanged(nameof(HasEnabledMarkedFunctions));\n    return true;\n  }\n\n  private void SetActiveProfileFilter(ProfileFilterState state) {\n    ProfileFilter = state;\n    ProfileFilterStateHost.DataContext = null;\n    ProfileFilterStateHost.DataContext = state;\n  }\n\n  private void UnloadProfilingDebugInfo() {\n    if (ProfileData == null) {\n      return;\n    }\n\n    // Free memory used by the debug info by unloading any objects\n    // such as the PDB DIA reader using COM.\n    Task.Run(() => {\n      foreach ((string module, var debugInfo) in ProfileData.ModuleDebugInfo) {\n        debugInfo.Unload();\n      }\n    });\n  }\n\n  private async void LoadProfileExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await LoadProfile();\n  }\n\n  private async Task LoadProfile() {\n    var window = new ProfileLoadWindow(this, false);\n    window.Owner = this;\n    bool? result = window.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      await SetupLoadedProfile();\n    }\n  }\n\n  private async Task SetupLoadedProfile() {\n    UpdateWindowTitle();\n    SetApplicationProgress(true, double.NaN, \"Loading profiling data\");\n    StartUIUpdate();\n    ProfileControlsVisible = true;\n\n    await SetupPanels();\n    await RefreshProfilingPanels();\n\n    StopUIUpdate();\n    ResetApplicationProgress();\n    SetOptionalStatus(TimeSpan.FromSeconds(10), \"Profile data loaded\");\n\n    // Check for critical errors like DIA SDK registration failure\n    if (PDBDebugInfoProvider.HasDiaRegistrationError) {\n      await Dispatcher.BeginInvoke(() => {\n        MessageBox.Show(this,\n          $\"Symbol resolution failed: {PDBDebugInfoProvider.DiaRegistrationError}\\n\\n\" +\n          \"Function names will not be displayed until this is fixed.\",\n          \"DIA SDK Not Registered\",\n          MessageBoxButton.OK,\n          MessageBoxImage.Error);\n      });\n    }\n  }\n\n  private async Task RefreshProfilingPanels() {\n    var panelTasks = new List<Task>();\n\n    if (FindPanel(ToolPanelKind.CallTree) is CallTreePanel panel) {\n      panelTasks.Add(panel.DisplayProfileCallTree());\n    }\n\n    if (FindPanel(ToolPanelKind.FlameGraph) is FlameGraphPanel fgPanel) {\n      panelTasks.Add(fgPanel.DisplayFlameGraph());\n    }\n\n    if (FindPanel(ToolPanelKind.Timeline) is TimelinePanel timelinePanel) {\n      panelTasks.Add(timelinePanel.DisplayFlameGraph());\n    }\n\n    await Task.WhenAll(panelTasks.ToArray());\n  }\n\n  private async void RecordProfileExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await RecordProfile();\n  }\n\n  private async Task RecordProfile() {\n    var window = new ProfileLoadWindow(this, true);\n    window.Owner = this;\n    bool? result = window.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      await SetupLoadedProfile();\n    }\n  }\n\n  private void CanExecuteProfileCommand(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = IsSessionStarted && sessionState_.ProfileData != null;\n    e.Handled = true;\n  }\n\n  private void CanExecuteLoadProfileCommand(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = !IsSessionStarted || sessionState_.ProfileData == null;\n    e.Handled = true;\n  }\n\n  private void ViewProfileReportExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (ProfileData?.Report != null) {\n      ProfileReportPanel.ShowReportWindow(ProfileData.Report, this);\n    }\n  }\n\n  private async Task SelectFunctionSamples(ProfileCallTreeNode node, TimelinePanel panel) {\n    var threadSamples = await Task.Run(() => FindFunctionSamples(node, ProfileData));\n    panel.SelectFunctionSamples(threadSamples);\n  }\n\n  private Dictionary<int, List<SampleIndex>>\n    FindFunctionSamples(ProfileCallTreeNode node, ProfileData profile) {\n    return FunctionSamplesProcessor.Compute(node, profile, new ProfileSampleFilter());\n  }\n\n  private HashSet<IRTextFunction> FindFunctionsForSamples(int sampleStartIndex, int sampleEndIndex, int threadId,\n                                                          ProfileData profile) {\n    var filter = new ProfileSampleFilter();\n    filter.TimeRange = new SampleTimeRangeInfo(TimeSpan.Zero, TimeSpan.Zero,\n                                               sampleStartIndex, sampleEndIndex, threadId);\n\n    if (threadId != -1) {\n      filter.AddThread(threadId);\n    }\n\n    return FunctionsForSamplesProcessor.Compute(filter, profile);\n  }\n\n  private List<ProfileCallTreeNode> FindCallTreeNodesForSamples(HashSet<IRTextFunction> funcs, ProfileData profile) {\n    //? TODO: If an event fires during the call tree/sample filtering,\n    //? either ignore it or better run it after the filtering is done\n    if (ProfileData.CallTree == null) {\n      return new List<ProfileCallTreeNode>();\n    }\n\n    var callNodes = new HashSet<ProfileCallTreeNode>(funcs.Count);\n\n    foreach (var func in funcs) {\n      var nodes = profile.CallTree.GetCallTreeNodes(func);\n\n      if (nodes == null)\n        continue;\n\n      // Filter out nodes that are not in the call path leading to the function,\n      // meaning that all parents of the node instance must be in the initial set\n      // of functions covered by the samples.\n      foreach (var node in nodes) {\n        var parentNode = node.Caller;\n        bool addNode = true;\n\n        while (parentNode != null) {\n          if (!funcs.Contains(parentNode.Function)) {\n            addNode = false;\n            break;\n          }\n\n          parentNode = parentNode.Caller;\n        }\n\n        if (addNode) {\n          callNodes.Add(node);\n        }\n      }\n    }\n\n    return callNodes.ToList();\n  }\n\n  private void RemoveProfileTimeRangeButton_Click(object sender, RoutedEventArgs e) {\n    ProfileFilter?.RemoveTimeRangeFilter?.Invoke();\n  }\n\n  private void RemoveProfileThreadButton_Click(object sender, RoutedEventArgs e) {\n    ProfileFilter?.RemoveThreadFilter?.Invoke();\n  }\n\n  private void RemoveProfileAllFiltersButton_Click(object sender, RoutedEventArgs e) {\n    ProfileFilter?.RemoveAllFilters?.Invoke();\n  }\n\n  private async void ClearFunctionsButton_Click(object sender, RoutedEventArgs e) {\n    MarkingSettings.FunctionColors.Clear();\n    await ReloadMarkingSettings();\n  }\n\n  private async void ClearModulesButton_Click(object sender, RoutedEventArgs e) {\n    MarkingSettings.ModuleColors.Clear();\n    await ReloadMarkingSettings();\n  }\n\n  private async void MarkingMenu_OnSubmenuOpened(object sender, RoutedEventArgs e) {\n    // Add the saved markings menu items.\n    CreateSavedMarkingMenu(SwitchMarkingsMenu, async markingSet => {\n      MarkingSettings.SwitchMarkingSet(markingSet);\n      await ReloadMarkingSettings();\n    });\n\n    CreateSavedMarkingMenu(AppendMarkingsMenu, async markingSet => {\n      MarkingSettings.AppendMarkingSet(markingSet);\n      await ReloadMarkingSettings();\n    });\n\n    // Add the built-in function markings to the menu,\n    // if not already added, after the title \"builtin markings\" title.\n    int insertionIndex = 1;\n\n    foreach (object item in MarkingMenu.Items) {\n      if (item is MenuItem menuItem &&\n          menuItem.Name == \"BuiltinMarkingsMenu\") {\n        break;\n      }\n\n      insertionIndex++;\n    }\n\n    if (MarkingMenu.Items[insertionIndex] is not MenuItem stopMenuItem ||\n        !stopMenuItem.Tag.Equals(\"BuiltinMarkingsMenuEnd\")) {\n      return; // Already populated.\n    }\n\n    var builtinMarkings = MarkingSettings.BuiltinMarkingCategories;\n\n    foreach (var markingSet in builtinMarkings.FunctionColors) {\n      var item = new MenuItem {\n        Header = markingSet.Title,\n        ToolTip = DocumentUtils.FormatLongFunctionName(markingSet.Name),\n        Tag = markingSet\n      };\n\n      var colorSelector = new ColorSelector();\n      var selectorItem = new MenuItem {\n        Header = colorSelector,\n        Tag = markingSet\n      };\n\n      colorSelector.ColorSelected += async (o, args) => {\n        var style = markingSet.CloneWithNewColor(args.SelectedColor);\n        MarkingSettings.UseFunctionColors = true;\n        MarkingSettings.AddFunctionColor(style);\n        await ReloadMarkingSettings();\n      };\n\n      item.Items.Add(selectorItem);\n      MarkingMenu.Items.Insert(insertionIndex, item);\n      insertionIndex++;\n    }\n  }\n\n  private void CreateSavedMarkingMenu(MenuItem menu, Action<FunctionMarkingSet> action) {\n    menu.Items.Clear();\n\n    foreach (var markingSet in MarkingSettings.SavedSets) {\n      string tooltip = $\"Function markings: {markingSet.FunctionColors.Count}\";\n      tooltip += $\"\\nModule markings: {markingSet.ModuleColors.Count}\";\n      tooltip += \"\\nRight-click to remove marking set\";\n\n      var item = new MenuItem {\n        Header = markingSet.Title,\n        ToolTip = tooltip,\n        Tag = markingSet\n      };\n\n      item.Click += (sender, args) => action(markingSet);\n      item.PreviewMouseRightButtonDown += (sender, args) => {\n        MarkingSettings.RemoveMarkingSet(markingSet);\n        menu.IsSubmenuOpen = false;\n      };\n\n      menu.Items.Add(item);\n    }\n  }\n\n  private async Task ReloadMarkingSettings() {\n    // Notify all panels about the marking changes.\n    await FunctionMarkingChanged(ToolPanelKind.Other);\n  }\n\n  private void SaveMarkingsMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    TextInputWindow input = new(\"Save marked functions/modules\", \"Saved marking set name:\", \"Save\", \"Cancel\");\n\n    if (input.Show(out string result, true)) {\n      MarkingSettings.SaveCurrentMarkingSet(result);\n    }\n  }\n\n  private async void ImportMarkingsMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    if (MarkingSettings.ImportMarkings(this)) {\n      await ReloadMarkingSettings();\n    }\n  }\n\n  private void ExportMarkingsMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    MarkingSettings.ExportMarkings(this);\n  }\n\n  private void EditMarkingsMenu_OnClick(object sender, RoutedEventArgs e) {\n    string filePath = App.GetFunctionMarkingsFilePath(compilerInfo_.CompilerIRName);\n    Utils.OpenExternalFile(filePath);\n  }\n\n  private async void CategoriesMenu_OnSubmenuOpened(object sender, RoutedEventArgs e) {\n    if (e.OriginalSource is MenuItem menuItem &&\n        menuItem.Tag != null) {\n      return;\n    }\n\n    await ProfilingUtils.CreateFunctionsCategoriesMenu(CategoriesMenu, async (o, args) => {\n                                                         if (o is MenuItem menuItem &&\n                                                             menuItem.Tag is IRTextFunction func) {\n                                                           await SwitchActiveFunction(func);\n                                                         }\n                                                       }, null,\n                                                       MarkingSettings, this);\n  }\n\n  private async void FunctionMenu_OnSubmenuOpened(object sender, RoutedEventArgs e) {\n    await ProfilingUtils.PopulateMarkedFunctionsMenu(FunctionMenu, MarkingSettings, this,\n                                                     e.OriginalSource, ReloadMarkingSettings);\n  }\n\n  private async void ModuleMenu_OnSubmenuOpened(object sender, RoutedEventArgs e) {\n    await ProfilingUtils.PopulateMarkedModulesMenu(ModuleMenu, MarkingSettings, this,\n                                                   e.OriginalSource, ReloadMarkingSettings);\n  }\n\n  private async void CopyOverviewMenu_OnClick(object sender, RoutedEventArgs e) {\n    (string html, string plaintext) = await ExportProfilingReportAsHtml();\n    Utils.CopyHtmlToClipboard(html, plaintext);\n  }\n\n  private async Task<(string Html, string Plaintext)>\n    ExportProfilingReportAsHtml() {\n    var markings = App.Settings.MarkingSettings.BuiltinMarkingCategories.FunctionColors;\n    var markingCategoryList =\n      await Task.Run(() => ProfilingUtils.CollectMarkedFunctions(markings, false, this));\n    return ProfilingExporting.ExportProfilingReportAsHtml(markingCategoryList, this, true, 20);\n  }\n\n  private async void ExportOverviewHtmlMenu_OnClick(object sender, RoutedEventArgs e) {\n    string path = Utils.ShowSaveFileDialog(\"HTML file|*.html\", \"*.html|All Files|*.*\");\n    bool success = true;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        (string html, _) = await ExportProfilingReportAsHtml();\n        await File.WriteAllTextAsync(path, html);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save report to {path}: {ex.Message}\");\n        success = false;\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Failed to save profiling report to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  private async void ExportOverviewMarkdownMenu_OnClick(object sender, RoutedEventArgs e) {\n    string path = Utils.ShowSaveFileDialog(\"Markdown file|*.md\", \"*.md|All Files|*.*\");\n    bool success = true;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        (_, string plaintext) = await ExportProfilingReportAsHtml();\n        await File.WriteAllTextAsync(path, plaintext);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save report to {path}: {ex.Message}\");\n        success = false;\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Failed to save profiling report to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  private async void CopyMarkedFunctionMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.CopyFunctionMarkingsAsHtml(this);\n  }\n\n  private async void ExportMarkedFunctionsHtmlMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportFunctionMarkingsAsHtmlFile(this);\n  }\n\n  private async void ExportMarkedFunctionsMarkdownMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportFunctionMarkingsAsMarkdownFile(this);\n  }\n\n  private async void CopyMarkedModulesMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.CopyModuleMarkingsAsHtml(this);\n  }\n\n  private async void ExportMarkedModulesHtmlMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportModuleMarkingsAsHtmlFile(this);\n  }\n\n  private async void ExportMarkedModulesMarkdownMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportModuleMarkingsAsMarkdownFile(this);\n  }\n\n  private void MarkingSettingsButton_Click(object sender, RoutedEventArgs e) {\n    if (markingOptionsPanelPopup_ != null) {\n      markingOptionsPanelPopup_.ClosePopup();\n      markingOptionsPanelPopup_ = null;\n      return;\n    }\n\n    var positionAdjustment = new Point(330, MainMenu.ActualHeight + 1);\n    markingOptionsPanelPopup_ = OptionsPanelHostPopup.Create<FunctionMarkingOptionsPanel, FunctionMarkingSettings>(\n      MarkingSettings.Clone(), MainGrid, this,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(MarkingSettings)) {\n          App.Settings.MarkingSettings = newSettings;\n          await ReloadMarkingSettings();\n\n          if (commit) {\n            App.SaveApplicationSettings();\n          }\n\n          return newSettings.Clone();\n        }\n\n        return null;\n      },\n      () => markingOptionsPanelPopup_ = null,\n      positionAdjustment, true);\n  }\n\n  // Event handlers for ETWProfileDataProvider events to replace session callbacks\n  private async Task OnSetupNewSessionRequested(ILoadedDocument mainDocument,\n                                                List<ILoadedDocument> otherDocuments,\n                                                ProfileData profileData) {\n    await Dispatcher.InvokeAsync(async () => {\n      sessionState_.MainDocument = mainDocument;\n      sessionState_.RegisterLoadedDocument(mainDocument);\n\n      foreach (var loadedDoc in otherDocuments) {\n        sessionState_.RegisterLoadedDocument(loadedDoc);\n      }\n\n      // For profiling sessions, setup the UI is done\n      // after the profiling window closes.\n      if (profileData == null) {\n        UpdateWindowTitle();\n        await SetupPanels();\n      }\n    });\n  }\n\n  private async Task OnStartNewSessionRequested(string sessionName, SessionKind sessionKind, ICompilerInfoProvider compilerInfo) {\n    await Dispatcher.InvokeAsync(async () => {\n      UpdateUIBeforeLoadDocument(\"profile\");\n      \n      // Create the UI compiler info provider using the provided IRMode\n      await SwitchCompilerTarget(compilerInfo);\n\n      StartSession(sessionName, sessionKind);\n      UpdateUIAfterLoadDocument();\n    });\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/MainWindowSession.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Reflection.PortableExecutable;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.UI.Compilers;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorerUI.Session;\nusing System.Linq;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.UI.Compilers.ASM;\nusing ProfileExplorer.UI.Providers;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class MainWindow : Window, IUISession {\n  private SemaphoreSlim SessionLoadCompleted = new(1);\n  public bool SilentMode { get; set; }\n  public ICompilerInfoProvider CompilerInfo => compilerInfo_;\n  public ISectionStyleProvider SectionStyleProvider => sectionStyleProvider_;\n  public IRRemarkProvider RemarkProvider => remarkProvider_;\n  public IBlockFoldingStrategyProvider BlockFoldingStrategyProvider => blockFoldingStrategyProvider_;\n  public ILoadedSectionHandler LoadedSectionHandler => loadedSectionHandler_;\n  public IRDocument CurrentDocument => FindActiveDocumentHost()?.TextView;\n  public bool IsInDiffMode => sessionState_.SectionDiffState.IsEnabled;\n  public bool IsInTwoDocumentsDiffMode => sessionState_.IsInTwoDocumentsDiffMode;\n  public bool IsInTwoDocumentsMode => DiffDocumentSummary != null;\n  public DiffModeInfo DiffModeInfo => sessionState_.SectionDiffState;\n  public IRTextSummary MainDocumentSummary => sessionState_.MainDocument?.Summary;\n  public IRTextSummary DiffDocumentSummary => sessionState_.DiffDocument?.Summary;\n  public bool IsSessionStarted => sessionState_ != null;\n\n  public IRTextSection CurrentDocumentSection {\n    get {\n      var activeDocument = FindActiveDocumentHost();\n      return activeDocument?.Section;\n    }\n  }\n\n  public List<IRDocument> OpenDocuments {\n    get {\n      var list = new List<IRDocument>();\n\n      if (IsSessionStarted) {\n        sessionState_.DocumentHosts.ForEach(doc => list.Add(doc.DocumentHost.TextView));\n      }\n\n      return list;\n    }\n  }\n\n  ICompilerInfoProvider ISession.CompilerInfo => CompilerInfo;\n\n  public IReadOnlyList<ILoadedDocument> Documents => sessionState_.Documents;\n\n  public IRTextFunction FindFunctionWithId(int funcNumber, Guid summaryId) {\n    return sessionState_.FindFunctionWithId(funcNumber, summaryId);\n  }\n\n  public async Task<ILoadedDocument> OpenSessionDocument(string filePath) {\n    try {\n      await EndSession();\n      UpdateUIBeforeReadSession(filePath);\n      byte[] data = await File.ReadAllBytesAsync(filePath);\n      var state = await SessionStateManager.DeserializeSession(data);\n\n      if (state != null) {\n        var loadedDoc = await LoadSessionDocument(state);\n        return loadedDoc;\n      }\n    }\n    catch (Exception ex) {\n      await EndSession();\n      Trace.TraceError($\"Failed to load session, exception: {ex}\");\n    }\n    finally {\n      UpdateUIAfterLoadDocument();\n    }\n\n    return null;\n  }\n\n  public async Task<bool> SaveSessionDocument(string filePath) {\n    try {\n      NotifyPanelsOfSessionSave();\n      NotifyDocumentsOfSessionSave();\n      sessionState_.Info.IsSaved = true;\n      byte[] data = await sessionState_.SerializeSession().ConfigureAwait(false);\n\n      if (data != null) {\n        await File.WriteAllBytesAsync(filePath, data).ConfigureAwait(false);\n        SetOptionalStatus(TimeSpan.FromSeconds(10), \"Session saved\");\n        return true;\n      }\n    }\n    catch (Exception ex) {\n      SetOptionalStatus(TimeSpan.FromSeconds(10), \"Failed to save session\", ex.Message, Colors.DarkRed.AsBrush());\n      Trace.TraceError($\"Failed to save session, exception: {ex}\");\n    }\n\n    return false;\n  }\n  \n  public async Task<IRDocumentHost>\n    OpenDocumentSectionAsync(OpenSectionEventArgs args)\n  {\n    return await OpenDocumentSectionAsync(args, args.TargetDocument);\n  }\n\n  public async Task<ParsedIRTextSection> LoadAndParseSection(IRTextSection section) {\n    return await Task.Run(async () => {\n      var docInfo = sessionState_.FindLoadedDocument(section);\n\n      // This shouldn't happen if document was loaded properly...\n      if (docInfo == null || docInfo.Loader == null) {\n        Trace.WriteLine($\"Failed LoadAndParseSection for function {section.ParentFunction.Name}\");\n        Utils.WaitForDebugger();\n        return null;\n      }\n\n      // LAZY BINARY LOADING: If binary isn't loaded yet, try to load it now.\n      // This happens during profiling when binaries are skipped during trace load.\n      if (!docInfo.BinaryFileExists && docInfo.EnsureBinaryLoaded != null) {\n        string moduleName = docInfo.ModuleName ?? section.ParentFunction.ParentSummary?.ModuleName ?? \"binary\";\n        Trace.WriteLine($\"LoadAndParseSection: Binary not loaded for {section.ParentFunction.Name}, attempting lazy load...\");\n\n        // Show status in UI while downloading\n        await Dispatcher.InvokeAsync(() => {\n          OptionalStatusText.Text = $\"Downloading {moduleName} from symbol server...\";\n          OptionalStatusText.ToolTip = $\"Lazy loading binary for disassembly view. This may take a few seconds.\";\n        });\n\n        bool loaded = await docInfo.EnsureBinaryLoaded().ConfigureAwait(false);\n        Trace.WriteLine($\"LoadAndParseSection: Lazy binary load result: {loaded}\");\n\n        // Clear status after download completes\n        await Dispatcher.InvokeAsync(() => {\n          if (loaded) {\n            OptionalStatusText.Text = $\"Downloaded {moduleName}\";\n          } else {\n            OptionalStatusText.Text = $\"Failed to download {moduleName}\";\n          }\n          OptionalStatusText.ToolTip = \"\";\n        });\n      }\n\n      var parsedSection = docInfo.Loader.LoadSection(section);\n\n      if (parsedSection != null && parsedSection.Function != null) {\n        var funcDebugInfo = ProfileData?.GetFunctionProfile(section.ParentFunction)?.FunctionDebugInfo;\n        var loadedDoc = FindLoadedDocument(section.ParentFunction);\n        await compilerInfo_.AnalyzeLoadedFunction(parsedSection.Function, section, loadedDoc, funcDebugInfo);\n        addressTag_ = parsedSection.Function.GetTag<AssemblyMetadataTag>();\n        return parsedSection;\n      }\n\n      string placeholderText = \"Could not find function code\";\n      var dummyFunc = new FunctionIR(section.ParentFunction.Name);\n      return new ParsedIRTextSection(section, placeholderText.AsMemory(), dummyFunc) {\n        LoadFailed = true\n      };\n    });\n  }\n\n  public async Task<Graph> ComputeGraphAsync(GraphKind kind, IRTextSection section,\n                                             IRDocument document, CancelableTask loadTask = null,\n                                             object options = null) {\n    var graphLayout = GetGraphLayoutCache(kind);\n    loadTask ??= new CancelableTask(); // Required, but client may not care about canceling.\n    return await Task.Run(() => graphLayout.GenerateGraph(document.Function, section,\n                                                          loadTask, options));\n  }\n\n  public async Task ReloadDocumentSettings(DocumentSettings newSettings, IRDocument document) {\n  // CompilerInfo no longer exposes ReloadSettings.\n\n    foreach (var docHostInfo in sessionState_.DocumentHosts) {\n      if (docHostInfo.DocumentHost.TextView != document) {\n        docHostInfo.DocumentHost.Settings = newSettings;\n        await docHostInfo.DocumentHost.ReloadSettings();\n      }\n    }\n  }\n\n  public async Task ReloadRemarkSettings(RemarkSettings newSettings, IRDocument document) {\n    foreach (var docHostInfo in sessionState_.DocumentHosts) {\n      if (docHostInfo.DocumentHost.TextView != document) {\n        await docHostInfo.DocumentHost.UpdateRemarkSettings(newSettings);\n      }\n    }\n  }\n\n  public async Task ReloadSettings() {\n    // Reload UI settings.\n    OnPropertyChanged(nameof(WindowScaling));\n\n  // Compiler provider no longer exposes ReloadSettings.\n\n    if (!IsSessionStarted) {\n      return;\n    }\n\n    // Reload settings for all open documents views.\n    foreach (var docHostInfo in sessionState_.DocumentHosts) {\n      await docHostInfo.DocumentHost.ReloadSettings();\n    }\n\n    // Reload settings for all panels.\n    await ForEachPanelAsync(async (panel) => await panel.OnReloadSettings());\n    await HandleNewDiffSettings(App.Settings.DiffSettings, false, true);\n  }\n\n  public Task<string> GetSectionTextAsync(IRTextSection section, IRDocument targetDiffDocument = null) {\n    if (IsInDiffMode && targetDiffDocument != null) {\n      IRDocument diffDocument = null;\n\n      if (targetDiffDocument == sessionState_.SectionDiffState.LeftDocument.TextView) {\n        diffDocument = sessionState_.SectionDiffState.LeftDocument.TextView;\n      }\n      else if (targetDiffDocument == sessionState_.SectionDiffState.RightDocument.TextView) {\n        diffDocument = sessionState_.SectionDiffState.RightDocument.TextView;\n      }\n\n      if (diffDocument != null) {\n        return Task.FromResult(diffDocument.Text);\n      }\n    }\n\n    var docInfo = sessionState_.FindLoadedDocument(section);\n    return Task.Run(() => docInfo.Loader.GetSectionText(section));\n  }\n\n  public Task<string> GetSectionOutputTextAsync(IRPassOutput output, IRTextSection section) {\n    var docInfo = sessionState_.FindLoadedDocument(section);\n    return Task.Run(() => docInfo.Loader.GetSectionOutputText(output));\n  }\n\n  public Task<List<string>> GetSectionOutputTextLinesAsync(IRPassOutput output, IRTextSection section) {\n    var docInfo = sessionState_.FindLoadedDocument(section);\n    return Task.Run(() => docInfo.Loader.GetSectionPassOutputTextLines(output));\n  }\n\n  public Task<string> GetDocumentTextAsync(IRTextSummary summary) {\n    var docInfo = sessionState_.FindLoadedDocument(summary);\n    return Task.Run(() => docInfo.Loader.GetDocumentOutputText());\n  }\n\n  public IToolPanel FindPanel(ToolPanelKind kind) {\n    var panelInfo = FindTargetPanel(null, kind);\n\n    if (panelInfo != null) {\n      return panelInfo.Panel;\n    }\n\n    return null;\n  }\n\n  public void ActivatePanel(IToolPanel panel) {\n    var panelHost = FindPanelHost(panel);\n\n    if (panelHost != null) {\n      panelHost.Host.Show();\n      panelHost.Host.IsActive = true;\n    }\n  }\n\n  public async Task<SectionSearchResult> SearchSectionAsync(\n    SearchInfo searchInfo, IRTextSection section, IRDocument document) {\n    var docInfo = sessionState_.FindLoadedDocument(section);\n    var searcher = new SectionTextSearcher(docInfo.Loader);\n\n    if (searchInfo.SearchAll) {\n      var sections = section.ParentFunction.Sections;\n      var results = await searcher.SearchAsync(searchInfo.SearchedText, searchInfo.SearchKind, sections);\n\n      var panelInfo = FindTargetPanel(document, ToolPanelKind.SearchResults);\n      var searchPanel = panelInfo.Panel as SearchResultsPanel;\n      searchPanel.UpdateSearchResults(results, searchInfo);\n\n      if (results.Count > 0) {\n        panelInfo.Host.IsSelected = true;\n      }\n\n      // Return the results for the section that started the search, if any.\n      var sectionResult = results.Find(item => item.Section == section);\n      return sectionResult ?? new SectionSearchResult(section);\n    }\n\n    // In diff mode, use the diff text being displayed, which may be different\n    // than the original section text due to diff annotations.\n    if (document.DiffModeEnabled) {\n      return await searcher.SearchSectionWithTextAsync(document.Text, searchInfo.SearchedText,\n                                                       searchInfo.SearchKind, section);\n    }\n\n    return await searcher.SearchSectionAsync(searchInfo.SearchedText, searchInfo.SearchKind, section);\n  }\n\n  public bool SwitchToPreviousSection(IRTextSection section, IRDocument document) {\n    var prevSection = GetPreviousSection(section);\n\n    if (prevSection != null) {\n      var docHost = FindDocumentHost(document);\n      SectionPanel.SwitchToSection(prevSection, docHost);\n      return true;\n    }\n\n    return false;\n  }\n\n  public bool SwitchToNextSection(IRTextSection section, IRDocument document) {\n    var nextSection = GetNextSection(section);\n\n    if (nextSection != null) {\n      var docHost = FindDocumentHost(document);\n      SectionPanel.SwitchToSection(nextSection, docHost);\n      return true;\n    }\n\n    return false;\n  }\n\n  public IRTextSection GetNextSection(IRTextSection section) {\n    int index = section.Number - 1;\n\n    if (index < section.ParentFunction.SectionCount - 1) {\n      return section.ParentFunction.Sections[index + 1];\n    }\n\n    return null;\n  }\n\n  public IRTextSection GetPreviousSection(IRTextSection section) {\n    int index = section.Number - 1;\n\n    if (index > 0) {\n      return section.ParentFunction.Sections[index - 1];\n    }\n\n    return null;\n  }\n\n  public void SaveDocumentState(object stateObject, IRTextSection section) {\n    if (IsInDiffMode) {\n      //? TODO: Find a way to at least temporarily save state for the two diffed docs\n      //? Issue is that in diff mode a section can have a different FunctionIR depending\n      //? on the other section is compared with\n      if (section == sessionState_.SectionDiffState.LeftSection ||\n          section == sessionState_.SectionDiffState.RightSection) {\n        return;\n      }\n    }\n\n    sessionState_.SaveDocumentState(stateObject, section);\n  }\n\n  public object LoadDocumentState(IRTextSection section) {\n    if (IsInDiffMode) {\n      if (section == sessionState_.SectionDiffState.LeftSection ||\n          section == sessionState_.SectionDiffState.RightSection) {\n        return null;\n      }\n    }\n\n    return sessionState_.LoadDocumentState(section);\n  }\n\n  public bool SaveFunctionTaskOptions(FunctionTaskInfo taskInfo, IFunctionTaskOptions options) {\n    byte[] data = FunctionTaskOptionsSerializer.Serialize(options);\n    App.Settings.SaveFunctionTaskOptions(taskInfo, data);\n    return true;\n  }\n\n  public IFunctionTaskOptions LoadFunctionTaskOptions(FunctionTaskInfo taskInfo) {\n    byte[] data = App.Settings.LoadFunctionTaskOptions(taskInfo);\n\n    if (data != null) {\n      return FunctionTaskOptionsSerializer.Deserialize(data, taskInfo.OptionsType);\n    }\n\n    return null;\n  }\n\n  public void SetApplicationStatus(string text, string tooltip) {\n    SetOptionalStatus(text, tooltip, Brushes.MediumBlue);\n  }\n\n  public void SetApplicationProgress(bool visible, double percentage, string title = null) {\n    Dispatcher.BeginInvoke(() => {\n      if (visible && !documentLoadProgressVisible_) {\n        Mouse.OverrideCursor = Cursors.AppStarting;\n        ShowProgressBar(title);\n      }\n      else if (!visible) {\n        Mouse.OverrideCursor = null;\n        HideProgressBar();\n        return;\n      }\n\n      if (double.IsNaN(percentage)) {\n        DocumentLoadProgressBar.IsIndeterminate = true;\n      }\n      else {\n        DocumentLoadProgressBar.IsIndeterminate = false;\n        percentage = Math.Max(percentage, DocumentLoadProgressBar.Value);\n        DocumentLoadProgressBar.Value = percentage;\n      }\n    }, DispatcherPriority.Render);\n  }\n\n  public void UpdateDocumentTitles() {\n    foreach (var docHostPair in sessionState_.DocumentHosts) {\n      docHostPair.Host.Title = GetDocumentTitle(docHostPair.DocumentHost, docHostPair.Section);\n      docHostPair.Host.ToolTip = GetDocumentDescription(docHostPair.DocumentHost, docHostPair.Section);\n    }\n  }\n\n  public async Task SwitchGraphsAsync(GraphPanel graphPanel, IRTextSection section, IRDocument document,\n                                      Func<FunctionIR, IRTextSection, CancelableTask, Graph> computeGraphAction) {\n    if (document.Function == null) {\n      return; // Function failed to load, ignore.\n    }\n\n    using var loadTask = await graphPanel.OnGenerateGraphStart(section);\n    var functionGraph = await Task.Run(() => computeGraphAction(document.Function, section, loadTask));\n\n    if (functionGraph != null) {\n      graphPanel.DisplayGraph(functionGraph);\n      graphPanel.OnGenerateGraphDone(loadTask);\n    }\n    else {\n      //? TODO: Handle CFG failure in the UI\n      graphPanel.OnGenerateGraphDone(loadTask, true);\n      Trace.TraceError($\"Document {ObjectTracker.Track(document)}: Failed to load CFG\");\n    }\n  }\n\n  public Task<string> GetRawSectionTextAsync(IRTextSection section, IRDocument targetDiffDocument = null) {\n    var docInfo = sessionState_.FindLoadedDocument(section);\n    return Task.Run(() => docInfo.Loader.GetSectionText(section));\n  }\n\n  public Task<string> GetSectionOutputTextAsync(IRTextSection section, bool useOutputBefore) {\n    var output = useOutputBefore ? section.OutputBefore : section.OutputAfter;\n    var docInfo = sessionState_.FindLoadedDocument(section);\n    return Task.Run(() => docInfo.Loader.GetSectionOutputText(output));\n  }\n\n  public IToolPanel FindAndActivatePanel(ToolPanelKind kind) {\n    var panelInfo = FindTargetPanel(null, kind);\n\n    if (panelInfo != null) {\n      panelInfo.Host.IsActive = true;\n      panelInfo.Host.IsSelected = true;\n      return panelInfo.Panel;\n    }\n\n    return null;\n  }\n\n  public void ResetApplicationProgress() {\n    SetApplicationProgress(false, double.NaN);\n  }\n\n  private async Task<ILoadedDocument> OpenDocument(string filePath) {\n    ILoadedDocument loadedDoc = null;\n    bool failed = false;\n    bool isProfilingFile = false;\n\n    if (Path.HasExtension(filePath)) {\n      if (Utils.FileHasExtension(filePath, \".pex\")) {\n        loadedDoc = await OpenSessionDocument(filePath);\n        failed = loadedDoc == null;\n      }\n      else if (Utils.IsBinaryFile(filePath)) {\n        loadedDoc = await OpenBinaryDocument(filePath);\n        failed = loadedDoc == null;\n      }\n      else if (Utils.FileHasExtension(filePath, \".etl\")) {\n        var profileSession = RecordingSession.FromFile(filePath);\n        var window = new ProfileLoadWindow(this, false, profileSession);\n        window.Owner = this;\n        isProfilingFile = true;\n\n        bool? result = window.ShowDialog();\n        failed = !result.HasValue || !result.Value;\n\n        if (!failed) {\n          await SetupLoadedProfile();\n          return sessionState_.MainDocument;\n        }\n      }\n    }\n\n    if (loadedDoc == null && !failed) {\n      loadedDoc = await OpenIRDocument(filePath, filePath, LoadDocument);\n    }\n\n    if (loadedDoc == null && !isProfilingFile) {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show($\"Failed to load file {filePath}\", \"Profile Explorer\", MessageBoxButton.OK,\n                      MessageBoxImage.Exclamation);\n    }\n\n    return loadedDoc;\n  }\n\n  private async Task SwitchBinaryCompilerTarget(string filePath) {\n    // Identify compiler target and switch IR mode.\n    var binaryInfo = PEBinaryInfoProvider.GetBinaryFileInfo(filePath);\n\n    if (binaryInfo == null) {\n      return;\n    }\n\n    switch (binaryInfo.Architecture) {\n      case Machine.I386:\n      case Machine.Amd64: {\n        switch (binaryInfo.FileKind) {\n          case BinaryFileKind.Native: {\n            await SwitchCompilerTarget(\"ASM\", IRMode.x86_64);\n            break;\n          }\n        }\n\n        break;\n      }\n      case Machine.Arm:\n      case Machine.Arm64: {\n        switch (binaryInfo.FileKind) {\n          case BinaryFileKind.Native: {\n            await SwitchCompilerTarget(\"ASM\", IRMode.ARM64);\n            break;\n          }\n        }\n\n        break;\n      }\n    }\n  }\n\n  private async Task<ILoadedDocument> OpenBinaryDocument(string filePath) {\n    await SwitchBinaryCompilerTarget(filePath);\n    var result = await OpenIRDocument(filePath, filePath, LoadBinaryDocument);\n\n    if (result != null) {\n      SectionPanel.EnterBinaryDisplayMode();\n    }\n\n    return result;\n  }\n\n  private async void OpenDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await OpenDocument();\n  }\n\n  private void OpenDebugExecuted(object sender, ExecutedRoutedEventArgs e) {\n    Utils.ShowOpenFileDialog(CompilerInfo.OpenDebugFileFilter, \"*.pdb\", \"Open debug info file\",\n                             path => sessionState_.MainDocument.DebugInfoFile =\n                               DebugFileSearchResult.Success(path));\n  }\n\n  private void OpenDiffDebugExecuted(object sender, ExecutedRoutedEventArgs e) {\n    Utils.ShowOpenFileDialog(CompilerInfo.OpenDebugFileFilter, \"*.pdb\", \"Open debug info file\",\n                             path => sessionState_.DiffDocument.DebugInfoFile =\n                               DebugFileSearchResult.Success(path));\n  }\n\n  private void CanExecuteDiffDocumentCommand(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = sessionState_ != null && sessionState_.IsInTwoDocumentsDiffMode;\n    e.Handled = true;\n  }\n\n  private async Task OpenDocument() {\n    await Utils.ShowOpenFileDialogAsync(CompilerInfo.OpenFileFilter, \"*.*\", \"Open file\",\n                                        async path => {\n                                          var loadedDoc = await OpenDocument(path);\n\n                                          if (loadedDoc != null) {\n                                            AddRecentFile(path);\n                                          }\n                                        });\n  }\n\n  private async Task<ILoadedDocument>\n    InitializeFromLoadedSession(SessionState state, Dictionary<Guid, ILoadedDocument> idToDocumentMap) {\n    sessionState_.Info.Notes = state.Info.Notes;\n    int index = 0;\n\n    foreach (var docState in state.Documents) {\n      var summary = sessionState_.Documents[index].Summary;\n      index++;\n\n      // Reload state of document annotations.\n      foreach (var sectionState in docState.SectionStates) {\n        var section = summary.GetSectionWithId(sectionState.Item1);\n        sessionState_.SaveDocumentState(sectionState.Item2, section);\n      }\n    }\n\n    // Reload state of panels from the session state.\n    foreach (var docPanelStates in state.DocumentPanelStates) {\n      var loadedDoc = idToDocumentMap[docPanelStates.Key];\n      var summary = loadedDoc.Summary;\n      \n      foreach (var panelState in docPanelStates.Value) {\n        var section = summary.GetSectionWithId(panelState.Item1);\n        var panelInfo = FindActivePanel(panelState.Item2.PanelKind);\n        sessionState_.SavePanelState(panelState.Item2.StateObject, panelInfo.Panel, section);\n      }\n    }\n\n    foreach (var panelState in state.GlobalPanelStates) {\n      var panelInfo = FindActivePanel(panelState.PanelKind);\n      sessionState_.SavePanelState(panelState.StateObject, panelInfo.Panel, null);\n    }\n\n    await SetupPanels();\n\n    // Reload sections left open.\n    var idToDocumentHostMap = new Dictionary<Guid, IRDocumentHost>();\n\n    foreach (var openSection in state.OpenSections) {\n      var loadedDoc = idToDocumentMap[openSection.DocumentId];\n      var section = loadedDoc.Summary.GetSectionWithId(openSection.SectionId);\n      var openKind = OpenSectionKind.NewTab;\n\n      if (sessionState_.IsInTwoDocumentsDiffMode) {\n        if (loadedDoc == sessionState_.MainDocument) {\n          openKind = OpenSectionKind.NewTabDockLeft;\n        }\n        else if (loadedDoc == sessionState_.DiffDocument) {\n          openKind = OpenSectionKind.NewTabDockRight;\n        }\n      }\n\n      var args = new OpenSectionEventArgs(section, openKind);\n      var docHost = await OpenDocumentSectionAsync(args);\n      idToDocumentHostMap[openSection.DocumentId] = docHost;\n    }\n\n    // Enter diff mode if it was active.\n    if (state.SectionDiffState.IsEnabled &&\n        state.OpenSections.Count > 1 &&\n        idToDocumentHostMap.TryGetValue(state.SectionDiffState.LeftSection.DocumentId, out var leftDocument) &&\n        idToDocumentHostMap.TryGetValue(state.SectionDiffState.RightSection.DocumentId, out var rightDocument)) {\n      await EnterDocumentDiffState(leftDocument, rightDocument);\n\n      // Compare the two files.\n      if (sessionState_.IsInTwoDocumentsDiffMode) {\n        await ShowSectionPanelDiffs(sessionState_.DiffDocument);\n      }\n    }\n\n    StartAutoSaveTimer();\n    return sessionState_.MainDocument;\n  }\n\n  private bool RequestSessionFilePath(bool forceNewFile = false) {\n    if (!forceNewFile && sessionState_.Info.IsSavedFileSession) {\n      return true; // Save over same session file.\n    }\n\n    string filePath = Utils.ShowSaveFileDialog(\"Profile Explorer Session File|*.pex\", \"*.pex\");\n\n    if (filePath == null) {\n      return false;\n    }\n\n    sessionState_.Info.FilePath = filePath;\n    sessionState_.Info.Kind = SessionKind.FileSession;\n    UpdateWindowTitle();\n    return true;\n  }\n\n  private void StartSession(string filePath, SessionKind sessionKind) {\n    sessionState_ = new SessionStateManager(filePath, sessionKind, compilerInfo_);\n    sessionState_.DocumentChanged += DocumentState_DocumentChangedEvent;\n    sessionState_.ChangeDocumentWatcherState(App.Settings.AutoReloadDocument);\n    documentLoadTask_ = new CancelableTaskInstance(false, SessionState.RegisterCancelableTask,\n                                                   SessionState.UnregisterCancelableTask);\n    ClearGraphLayoutCache();\n  // Compiler provider no longer exposes ReloadSettings.\n\n    DiffModeButton.IsEnabled = true;\n    HideStartPage();\n  }\n\n  private async Task EndSession(bool showStartPage = true) {\n    await BeginSessionStateChange();\n\n    if (!IsSessionStarted) {\n      EndSessionStateChange();\n      return;\n    }\n\n    if (autoSaveTimer_ != null) {\n      autoSaveTimer_.Stop();\n      autoSaveTimer_ = null;\n    }\n\n    // Wait for any pending tasks to complete.\n    await sessionState_.CancelPendingTasks();\n\n    // Close all documents and notify all panels.\n    NotifyPanelsOfSessionEnd();\n\n    foreach (var docHostInfo in sessionState_.DocumentHosts) {\n      CloseDocument(docHostInfo);\n    }\n\n    await ExitDocumentDiffState(true);\n    sessionState_.DocumentChanged -= DocumentState_DocumentChangedEvent;\n    sessionState_.EndSession();\n\n    FunctionAnalysisCache.ResetCache();\n    DiffModeButton.IsEnabled = false;\n\n    if (showStartPage) {\n      ShowStartPage();\n    }\n\n    EndSessionStateChange();\n  }\n\n  private void CloseDocument(DocumentHostInfo docHostInfo) {\n    ResetDocumentEvents(docHostInfo.DocumentHost);\n    docHostInfo.HostParent.Children.Remove(docHostInfo.Host);\n  }\n\n  private async Task<ILoadedDocument> OpenIRDocument(string filePath, string modulePath,\n                                                    Func<string, string, Guid, ProgressInfoHandler,\n                                                      Task<ILoadedDocument>> loadFunc) {\n    try {\n      await EndSession();\n      await BeginSessionStateChange();\n      UpdateUIBeforeLoadDocument(filePath);\n      var result = await Task.Run(async () => await loadFunc(filePath, modulePath, Guid.NewGuid(),\n                                                             UpdateIRDocumentLoadProgress));\n\n      if (result != null) {\n        await SetupOpenedIRDocument(SessionKind.Default, result);\n        return result;\n      }\n    }\n    catch (Exception ex) {\n      await EndSession();\n      Trace.TraceError($\"Failed to load document: {ex}\");\n    }\n    finally {\n      UpdateUIAfterLoadDocument();\n      EndSessionStateChange();\n    }\n\n    // Failed to start a session.\n    return null;\n  }\n\n  private async Task BeginSessionStateChange() {\n    // Wait for any running state changes.\n    await SessionLoadCompleted.WaitAsync();\n    await updateProfileTask_.CancelTaskAndWaitAsync();\n\n    loadingDocuments_ = true;\n    documentLoadStartTime_ = DateTime.UtcNow;\n    lastDocumentLoadTime_ = DateTime.UtcNow;\n  }\n\n  private void EndSessionStateChange() {\n    SessionLoadCompleted.Release();\n  }\n\n  private void UpdateIRDocumentLoadProgress(IRSectionReader reader, SectionReaderProgressInfo info) {\n    if (info.IsIndeterminate) {\n      Dispatcher.BeginInvoke(new Action(() => {\n        SetApplicationProgress(true, double.NaN);\n      }), DispatcherPriority.Render);\n    }\n    else if (info.TotalBytes == 0) {\n      Dispatcher.BeginInvoke(new Action(() => {\n        SetApplicationProgress(false, 0);\n      }), DispatcherPriority.Render);\n      return;\n    }\n\n    // Updating too often slows down the file parsing by about\n    // 20-30% due to Dispatcher.BeginInvoke overhead.\n    var currentTime = DateTime.UtcNow;\n    var diffTime = currentTime - lastDocumentLoadTime_;\n\n    if (diffTime.TotalMilliseconds < 100) {\n      return;\n    }\n\n    // Schedule the UI update.\n    Dispatcher.BeginInvoke(new Action(() => {\n      if (!loadingDocuments_) {\n        // It can happen that this code on the dispatchers runs after\n        // the document has already been loaded, so just ignore the events.\n        return;\n      }\n\n      bool firstTimeShowPanel = false;\n\n      if (!documentLoadProgressVisible_) {\n        // Progress panel not displayed yet, show it only after a bit of time\n        // passes since most files are small and load instantly.\n        var timeDiff = DateTime.UtcNow - documentLoadStartTime_;\n\n        if (timeDiff.TotalMilliseconds < 500) {\n          return;\n        }\n\n        firstTimeShowPanel = true;\n      }\n\n      double percentage = Math.Ceiling(100 * (info.BytesProcessed / (double)info.TotalBytes));\n\n      // If the progress panel is about to be displayed, but most of the file\n      // as been processed already, there's no point in showing it anymore.\n      if (firstTimeShowPanel) {\n        if (percentage > 50) {\n          return;\n        }\n      }\n\n      SetApplicationProgress(true, percentage);\n    }), DispatcherPriority.Render);\n  }\n\n  private async Task SetupOpenedIRDocument(SessionKind sessionKind, ILoadedDocument result) {\n    StartSession(result.FilePath, sessionKind);\n    sessionState_.RegisterLoadedDocument(result);\n    sessionState_.MainDocument = result;\n\n    UpdateUIAfterLoadDocument();\n    StartAutoSaveTimer();\n    await SetupPanels();\n  }\n\n  private async Task<bool> OpenDiffIRDocument(string filePath) {\n    try {\n      var result = await Task.Run(() => LoadDocument(filePath, filePath, Guid.NewGuid(),\n                                                     UpdateIRDocumentLoadProgress));\n\n      if (result != null) {\n        await SetupOpenedDiffIRDocument(filePath, result);\n        return true;\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load diff document {filePath}: {ex}\");\n    }\n\n    UpdateUIAfterLoadDocument();\n    return false;\n  }\n\n  private async Task SetupOpenedDiffIRDocument(string diffFilePath, ILoadedDocument result) {\n    sessionState_.RegisterLoadedDocument(result);\n    sessionState_.EnterTwoDocumentDiffMode(result);\n    await SetupPanels();\n    //await ShowSectionPanelDiffs(result);\n  }\n\n  private async Task<ILoadedDocument> LoadDocument(string filePath, string modulePath, Guid id,\n                                                  ProgressInfoHandler progressHandler) {\n    return await LoadDocument(filePath, modulePath, id, progressHandler,\n                              new DocumentSectionLoader(filePath, compilerInfo_.IR));\n  }\n\n  private async Task<ILoadedDocument> LoadBinaryDocument(string filePath, string modulePath, Guid id,\n                                                        ProgressInfoHandler progressHandler) {\n    return await LoadBinaryDocument(filePath, modulePath, id, null, progressHandler).ConfigureAwait(false);\n  }\n\n  private async Task<ILoadedDocument> LoadBinaryDocument(string filePath, string modulePath, Guid id,\n                                                        IDebugInfoProvider debugInfo,\n                                                        ProgressInfoHandler progressHandler) {\n    var binaryInfo = PEBinaryInfoProvider.GetBinaryFileInfo(filePath);\n    bool isManagedImage = binaryInfo?.IsManagedImage ?? false;\n    var loader = new DisassemblerSectionLoader(filePath, compilerInfo_, debugInfo, true, isManagedImage);\n    var result = await LoadDocument(filePath, modulePath, id, progressHandler, loader);\n\n    if (result != null) {\n      result.BinaryFile = BinaryFileSearchResult.Success(filePath);\n\n      if (debugInfo == null) {\n        result.DebugInfo = loader.DebugInfo;\n        result.DebugInfoFile = loader.DebugInfoFile;\n      }\n    }\n\n    return result;\n  }\n\n  private async Task<ILoadedDocument> LoadDocument(string filePath, string modulePath, Guid id,\n                                                  ProgressInfoHandler progressHandler,\n                                                  IRTextSectionLoader loader) {\n    try {\n      var result = await Task.Run(async () => {\n        var result = new LoadedDocument(filePath, modulePath, id);\n        result.Loader = loader;\n        result.Summary = await result.Loader.LoadDocument(progressHandler);\n        return result;\n      });\n\n      return result;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load document {filePath}: {ex}\");\n      return null;\n    }\n  }\n\n  private async Task<ILoadedDocument> LoadDocument(byte[] data, string filePath, string modulePath, Guid id,\n                                      ProgressInfoHandler progressHandler) {\n    try {\n      var result = new LoadedDocument(filePath, modulePath, id);\n      result.Loader = new DocumentSectionLoader(data, compilerInfo_.IR);\n      result.Summary = await result.Loader.LoadDocument(progressHandler);\n      return result;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load in-memory document: {ex}\");\n      return null;\n    }\n  }\n\n  private async Task<ILoadedDocument> LoadSessionDocument(SessionState state) {\n    try {\n      if (!string.IsNullOrEmpty(state.Info.IRName)) {\n        await SwitchCompilerTarget(state.Info.IRName, state.Info.IRMode);\n      }\n\n      StartSession(state.Info.FilePath, SessionKind.FileSession);\n      var idToDocumentMap = new Dictionary<Guid, ILoadedDocument>();\n\n      foreach (var docState in state.Documents) {\n        ILoadedDocument result = null;\n\n        if (docState.DocumentText != null && docState.DocumentText.Length > 0) {\n          result = await Task.Run(() => LoadDocument(docState.DocumentText, docState.FilePath,\n                                                     docState.ModuleName, docState.Id,\n                                                     UpdateIRDocumentLoadProgress));\n        }\n        else if (docState.BinaryFile != null) {\n          result = await Task.Run(() => LoadBinaryDocument(docState.BinaryFile.FilePath,\n                                                           docState.ModuleName, docState.Id,\n                                                           UpdateIRDocumentLoadProgress));\n        }\n        else if (!string.IsNullOrEmpty(docState.ModuleName)) {\n          // Fake document used by profiling to represent missing binaries.\n          result = LoadedDocument.CreateDummyDocument(docState.ModuleName, docState.Id);\n        }\n\n        if (result == null) {\n          UpdateUIAfterLoadDocument();\n          return null;\n        }\n\n        // Profiling can add extra dummy functions to a document, restore them.\n        if (docState.FunctionNames != null) {\n          result.AddDummyFunctions(docState.FunctionNames);\n        }\n\n        sessionState_.RegisterLoadedDocument(result);\n        idToDocumentMap[docState.Id] = result;\n\n        if (state.IsInTwoDocumentsDiffMode) {\n          if (docState.Id == state.MainDocumentId) {\n            sessionState_.MainDocument = result;\n          }\n          else if (docState.Id == state.DiffDocumentId) {\n            sessionState_.EnterTwoDocumentDiffMode(result);\n          }\n        }\n        else {\n          // Outside of diff mode there can still be multiple documents\n          // loaded with profile sessions, for ex.\n          if (docState.Id == state.MainDocumentId) {\n            sessionState_.MainDocument = result;\n          }\n        }\n      }\n\n      UpdateUIAfterLoadDocument();\n      return await InitializeFromLoadedSession(state, idToDocumentMap);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load in-memory document: {ex}\");\n    }\n\n    UpdateUIAfterLoadDocument();\n    return null;\n  }\n\n  private async void SectionPanel_OpenSection(object sender, OpenSectionEventArgs args) {\n    await OpenDocumentSectionAsync(args, args.TargetDocument);\n  }\n\n  private async Task<IRDocumentHost>\n    OpenDocumentSectionAsync(OpenSectionEventArgs args, IRDocumentHost targetDocument = null,\n                             bool runExtraTasks = true) {\n    var document = targetDocument;\n\n    if (args.OpenKind == OpenSectionKind.NewTab ||\n        args.OpenKind == OpenSectionKind.NewTabDockLeft ||\n        args.OpenKind == OpenSectionKind.NewTabDockRight) {\n      document = (await AddNewDocument(args.OpenKind)).DocumentHost;\n    }\n    else if (args.OpenKind == OpenSectionKind.ReplaceCurrent ||\n             args.OpenKind == OpenSectionKind.ReplaceLeft ||\n             args.OpenKind == OpenSectionKind.ReplaceRight) {\n      // Try to pick a host from the same module first.\n      document = FindSameSummaryDocumentHost(args.Section);\n\n      // Otherwise pick the active host, if any, or create a new one.\n      if (document == null && args.OpenKind == OpenSectionKind.ReplaceCurrent) {\n        document = FindActiveDocumentHost();\n      }\n\n      if (document == null) {\n        document = (await AddNewDocument(args.OpenKind)).DocumentHost;\n      }\n    }\n    else {\n      throw new InvalidOperationException(\"Unhandled OpenSectionKind\");\n    }\n\n    // In diff mode, reload both left/right sections and redo the diffs.\n    if (IsInDiffMode &&\n        sessionState_.SectionDiffState.IsDiffDocument(document)) {\n      await SwitchDiffedDocumentSection(args.Section, document);\n      return document;\n    }\n\n    await SwitchSection(args.Section, document, runExtraTasks);\n    return document;\n  }\n\n  private async Task<ParsedIRTextSection>\n    SwitchSection(IRTextSection section, IRDocumentHost document, bool runExtraTasks) {\n    Trace.TraceInformation(\n      $\"Document {ObjectTracker.Track(document)}: Switch to section ({section.Number}) {section.Name}\");\n\n    // Wait for any other pending opening tasks to complete,\n    // otherwise the opened document and panels can get out of sync.\n    using var task = await documentLoadTask_.CancelCurrentAndCreateTaskAsync();\n\n    await NotifyOfSectionUnload(document, true);\n    ResetDocumentEvents(document);\n    ResetStatusBar();\n    var delayedAction = UpdateUIBeforeSectionLoad(section, document);\n\n    // Load section and try to parse it.\n    var result = await LoadAndParseSection(section);\n\n    if (task.IsCanceled) {\n      return null;\n    }\n\n    // Handle loading failures.\n    UpdateUIForSectionLoading(result, document);\n\n    if (result == null) {\n      // Hide any UI that may show due to long-running tasks.\n      UpdateUIAfterSectionLoad(section, document, delayedAction);\n      return null;\n    }\n\n    // Update UI to reflect new section before starting long-running tasks.\n    await document.LoadSectionMinimal(result);\n\n    if (task.IsCanceled) {\n      return null;\n    }\n\n    await NotifyPanelsOfSectionLoad(section, document, true);\n\n    if (task.IsCanceled) {\n      return null;\n    }\n\n    SetupDocumentEvents(document);\n    await UpdateUIAfterSectionSwitch(section, document);\n\n    if (task.IsCanceled) {\n      return null;\n    }\n\n    // Load both the document and generate graphs in parallel,\n    // since both can be fairly time-consuming for huge functions.\n    var documentTask = document.LoadSection(result);\n    Task graphTask = null;\n\n    if (runExtraTasks) {\n      graphTask = GenerateGraphs(section, document.TextView);\n    }\n\n    await documentTask;\n    UpdateUIAfterSectionLoad(section, document, delayedAction);\n\n    if (graphTask != null) {\n      await graphTask;\n    }\n\n    return result;\n  }\n\n  private void UpdateUIForSectionLoading(ParsedIRTextSection result, IRDocumentHost document) {\n    if (result == null || result.Function == null) {\n      Trace.TraceError($\"Document {ObjectTracker.Track(document)}: Failed to parse function\");\n      OptionalStatusText.Text = \"Failed to parser section IR\";\n      OptionalStatusText.ToolTip = FormatParsingErrors(result, \"Section IR parsing errors\");\n    }\n    else if (result.HadParsingErrors) {\n      Trace.TraceWarning($\"Document {ObjectTracker.Track(document)}: Parsed function with errors\");\n      OptionalStatusText.Text = \"IR parsing issues\";\n      OptionalStatusText.ToolTip = FormatParsingErrors(result, \"Section IR parsing errors\");\n    }\n    else {\n      OptionalStatusText.Text = \"\";\n    }\n  }\n\n  private string FormatParsingErrors(ParsedIRTextSection result, string message) {\n    if (result == null || !result.HadParsingErrors) {\n      return \"\";\n    }\n\n    var builder = new StringBuilder();\n    builder.AppendLine($\"{message}: {result.ParsingErrors.Count}\");\n\n    foreach (var error in result.ParsingErrors) {\n      builder.AppendLine(error.ToString());\n    }\n\n    return builder.ToString();\n  }\n\n  private async Task GenerateGraphs(IRTextSection section, IRDocument document,\n                                    bool awaitTasks = true) {\n    var tasks = new[] {\n      GenerateGraphs(GraphKind.FlowGraph, section, document),\n      GenerateGraphs(GraphKind.DominatorTree, section, document),\n      GenerateGraphs(GraphKind.PostDominatorTree, section, document)\n    };\n\n    if (awaitTasks) {\n      await Task.WhenAll(tasks);\n    }\n  }\n\n  private async Task GenerateGraphs(GraphKind graphKind, IRTextSection section, IRDocument document) {\n    var panelKind = graphKind switch {\n      GraphKind.FlowGraph         => ToolPanelKind.FlowGraph,\n      GraphKind.DominatorTree     => ToolPanelKind.DominatorTree,\n      GraphKind.PostDominatorTree => ToolPanelKind.PostDominatorTree,\n      _                           => throw new InvalidOperationException(\"Unexpected graph kind!\")\n    };\n\n    var action = GetComputeGraphAction(graphKind);\n    var flowGraphPanels = FindTargetPanels(document, panelKind);\n\n    foreach (var panelInfo in flowGraphPanels) {\n      await SwitchGraphsAsync((GraphPanel)panelInfo.Panel, section, document, action);\n    }\n  }\n\n  private Func<FunctionIR, IRTextSection, CancelableTask, Graph> GetComputeGraphAction(\n    GraphKind graphKind) {\n    return graphKind switch {\n      GraphKind.FlowGraph         => ComputeFlowGraph,\n      GraphKind.DominatorTree     => ComputeDominatorTree,\n      GraphKind.PostDominatorTree => ComputePostDominatorTree,\n      _                           => throw new InvalidOperationException(\"Unexpected graph kind!\")\n    };\n  }\n\n  private Func<FunctionIR, IRTextSection, CancelableTask, Graph> GetComputeGraphAction(\n    ToolPanelKind graphKind) {\n    return graphKind switch {\n      ToolPanelKind.FlowGraph         => ComputeFlowGraph,\n      ToolPanelKind.DominatorTree     => ComputeDominatorTree,\n      ToolPanelKind.PostDominatorTree => ComputePostDominatorTree,\n      _                               => throw new InvalidOperationException(\"Unexpected graph kind!\")\n    };\n  }\n\n  private void GraphViewer_GraphNodeSelected(object sender, IRElementEventArgs e) {\n    var panel = ((GraphViewer)sender).HostPanel;\n    var document = FindTargetDocument(panel);\n    document.TextView.HighlightElement(e.Element, HighlighingType.Selected);\n  }\n\n  private Graph ComputeFlowGraph(FunctionIR function, IRTextSection section,\n                                 CancelableTask loadTask) {\n    var graphLayout = GetGraphLayoutCache(GraphKind.FlowGraph);\n    return graphLayout.GenerateGraph(function, section, loadTask, (object)null);\n  }\n\n  private Graph ComputeDominatorTree(FunctionIR function, IRTextSection section,\n                                     CancelableTask loadTask) {\n    var graphLayout = GetGraphLayoutCache(GraphKind.DominatorTree);\n    return graphLayout.GenerateGraph(function, section, loadTask, (object)null);\n  }\n\n  private Graph ComputePostDominatorTree(FunctionIR function, IRTextSection section,\n                                         CancelableTask loadTask) {\n    var graphLayout = GetGraphLayoutCache(GraphKind.PostDominatorTree);\n    return graphLayout.GenerateGraph(function, section, loadTask, (object)null);\n  }\n\n  private void GraphViewer_BlockUnmarked(object sender, IRElementMarkedEventArgs e) {\n    var panel = ((GraphViewer)sender).HostPanel;\n    var document = FindTargetDocument(panel);\n    document.TextView.UnmarkBlock(e.Element, HighlighingType.Marked);\n  }\n\n  private void GraphViewer_BlockMarked(object sender, IRElementMarkedEventArgs e) {\n    var panel = ((GraphViewer)sender).HostPanel;\n    var document = FindTargetDocument(panel);\n    document.TextView.MarkBlock(e.Element, e.Style);\n  }\n\n  private void GraphViewer_GraphLoaded(object sender, EventArgs e) {\n    var panel = ((GraphViewer)sender).HostPanel;\n    var document = FindTargetDocument(panel);\n    document.TextView.PanelContentLoaded(panel);\n  }\n\n  private void SetupGraphLayoutCache() {\n    graphLayout_ = new Dictionary<GraphKind, GraphLayoutCache>();\n    graphLayout_.Add(GraphKind.FlowGraph, new GraphLayoutCache(GraphKind.FlowGraph));\n    graphLayout_.Add(GraphKind.DominatorTree, new GraphLayoutCache(GraphKind.DominatorTree));\n    graphLayout_.Add(GraphKind.PostDominatorTree, new GraphLayoutCache(GraphKind.PostDominatorTree));\n    graphLayout_.Add(GraphKind.ExpressionGraph, new GraphLayoutCache(GraphKind.ExpressionGraph));\n  }\n\n  private void ClearGraphLayoutCache() {\n    foreach (var cache in graphLayout_.Values) {\n      cache.ClearCache();\n    }\n  }\n\n  private GraphLayoutCache GetGraphLayoutCache(GraphKind kind) {\n    return graphLayout_[kind];\n  }\n\n  private DelayedAction UpdateUIBeforeSectionLoad(IRTextSection section, IRDocumentHost document) {\n    var delayedAction = new DelayedAction();\n    //delayedAction.Start(TimeSpan.FromMilliseconds(500), () => { document.Opacity = 0.5; });\n    return delayedAction;\n  }\n\n  private async Task UpdateUIAfterSectionSwitch(IRTextSection section, IRDocumentHost document,\n                                                DelayedAction delayedAction = null) {\n    var docHostPair = FindDocumentHostPair(document);\n\n    //? TODO: Can happen if the loading is slow (debug mode?)\n    //? and doc view is closed by user.\n    if (docHostPair == null) {\n      return;\n    }\n\n    docHostPair.Host.Title = GetDocumentTitle(document, section);\n    docHostPair.Host.ToolTip = GetDocumentDescription(document, section);\n\n    RenameAllPanels(); // For bound panels.\n    await SectionPanel.SelectSection(section, false);\n\n    if (delayedAction != null) {\n      UpdateUIAfterSectionLoad(section, document, delayedAction);\n    }\n  }\n\n  private void UpdateUIAfterSectionLoad(IRTextSection section, IRDocumentHost document,\n                                        DelayedAction delayedAction) {\n    delayedAction.Cancel();\n    //document.Opacity = 1;\n  }\n\n  private IRDocumentHost FindTargetDocument(IToolPanel panel) {\n    if (panel.BoundDocument != null) {\n      return FindDocumentHost(panel.BoundDocument);\n    }\n\n    return FindActiveDocumentHost();\n  }\n\n  private void SetupDocumentEvents(IRDocumentHost document) {\n    document.TextView.ActionPerformed += TextView_ActionPerformed;\n    document.TextView.ElementSelected += TextView_IRElementSelected;\n    document.TextView.ElementHighlighting += TextView_IRElementHighlighting;\n    document.TextView.BlockSelected += TextView_BlockSelected;\n    document.TextView.BookmarkAdded += TextView_BookmarkAdded;\n    document.TextView.BookmarkRemoved += TextView_BookmarkRemoved;\n    document.TextView.BookmarkChanged += TextView_BookmarkChanged;\n    document.TextView.BookmarkSelected += TextView_BookmarkSelected;\n    document.TextView.BookmarkListCleared += TextView_BookmarkListCleared;\n    document.TextView.CaretChanged += TextView_CaretChanged;\n    document.VerticalScrollChanged += DocumentVerticalScrollChanged;\n    document.PassOutputVerticalScrollChanged += DocumentPassOutputVerticalScrollChanged;\n    document.PassOutputVisibilityChanged += Document_PassOutputVisibilityChanged;\n    document.PassOutputShowBeforeChanged += Document_PassOutputShowBeforeChanged;\n  }\n\n  private void ResetDocumentEvents(IRDocumentHost document) {\n    document.TextView.ElementSelected -= TextView_IRElementSelected;\n    document.TextView.ElementHighlighting -= TextView_IRElementHighlighting;\n    document.TextView.BlockSelected -= TextView_BlockSelected;\n    document.TextView.BookmarkAdded -= TextView_BookmarkAdded;\n    document.TextView.BookmarkRemoved -= TextView_BookmarkRemoved;\n    document.TextView.BookmarkChanged -= TextView_BookmarkChanged;\n    document.TextView.BookmarkSelected -= TextView_BookmarkSelected;\n    document.TextView.BookmarkListCleared -= TextView_BookmarkListCleared;\n    document.TextView.CaretChanged -= TextView_CaretChanged;\n    document.VerticalScrollChanged -= DocumentVerticalScrollChanged;\n    document.PassOutputVerticalScrollChanged -= DocumentPassOutputVerticalScrollChanged;\n    document.PassOutputVisibilityChanged -= Document_PassOutputVisibilityChanged;\n    document.PassOutputShowBeforeChanged -= Document_PassOutputShowBeforeChanged;\n  }\n\n  private void DocumentVerticalScrollChanged(object sender, (double offset, double offsetChangeAmount) value) {\n    if (!IsInDiffMode || Math.Abs(value.offsetChangeAmount) < double.Epsilon) {\n      return;\n    }\n\n    var document = sender as IRDocumentHost;\n    var otherDocument = sessionState_.SectionDiffState.GetOtherDocument(document);\n\n    if (otherDocument != null) {\n      otherDocument.TextView.ScrollToVerticalOffset(value.offset);\n    }\n  }\n\n  private async void Document_PassOutputShowBeforeChanged(object sender, bool e) {\n    sessionState_.SectionDiffState.PassOutputShowBefore = e;\n\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    var document = sender as IRDocumentHost;\n    var otherDocument = sessionState_.SectionDiffState.GetOtherDocument(document);\n\n    if (otherDocument != null) {\n      otherDocument.PassOutput.ShowBeforeOutput = e;\n      await DiffDocumentPassOutput();\n    }\n  }\n\n  private async void Document_PassOutputVisibilityChanged(object sender, bool e) {\n    sessionState_.SectionDiffState.PassOutputVisible = e;\n\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    var document = sender as IRDocumentHost;\n    var otherDocument = sessionState_.SectionDiffState.GetOtherDocument(document);\n\n    if (otherDocument != null) {\n      otherDocument.PassOutputVisible = e;\n\n      if (e) {\n        await DiffDocumentPassOutput();\n      }\n    }\n  }\n\n  private void\n    DocumentPassOutputVerticalScrollChanged(object sender, (double offset, double offsetChangeAmount) value) {\n    if (!IsInDiffMode || Math.Abs(value.offsetChangeAmount) < double.Epsilon) {\n      return;\n    }\n\n    var document = sender as IRDocumentHost;\n    var otherDocument = sessionState_.SectionDiffState.GetOtherDocument(document);\n\n    if (otherDocument != null) {\n      otherDocument.PassOutput.TextView.ScrollToVerticalOffset(value.offset);\n    }\n  }\n\n  private void TextView_CaretChanged(object sender, int caretOffset) {\n    if (!IsInDiffMode) {\n      return;\n    }\n\n    // Move the caret in the other document to the same position.\n    var document = sender as IRDocument;\n    var docHost = FindDocumentHost(document);\n\n    if (!sessionState_.SectionDiffState.IsDiffDocument(docHost)) {\n      return;\n    }\n\n    var otherDocHost = sessionState_.SectionDiffState.GetOtherDocument(docHost);\n    otherDocHost.TextView.SetCaretAtOffset(caretOffset);\n  }\n\n  private async void TextView_ActionPerformed(object sender, DocumentAction e) {\n    var document = sender as IRDocument;\n    Debug.Assert(document != null);\n\n    if (e.ActionKind == DocumentActionKind.ShowExpressionGraph) {\n      var section = document.Section;\n      using var loadTask = await ExpressionGraphPanel.OnGenerateGraphStart(section);\n\n      var graphLayout = GetGraphLayoutCache(GraphKind.ExpressionGraph);\n      var options = App.Settings.ExpressionGraphSettings.GetGraphPrinterOptions();\n      options.IR = CompilerInfo.IR;\n      var graph = graphLayout.GenerateGraph(e.Element, section, loadTask, options);\n\n      if (graph != null) {\n        ExpressionGraphPanel.DisplayGraph(graph);\n        ExpressionGraphPanel.OnGenerateGraphDone(loadTask);\n        var panelHost = FindPanelHost(ExpressionGraphPanel).Host;\n\n        if (!panelHost.IsActive) {\n          panelHost.IsActive = true;\n        }\n      }\n      else {\n        ExpressionGraphPanel.OnGenerateGraphDone(loadTask, true);\n        Trace.TraceError($\"Document {ObjectTracker.Track(document)}: Failed to load CFG\");\n      }\n\n      return;\n    }\n\n    MirrorElementAction(e.Element, document,\n                        (otherElement, otherDocument) => {\n                          otherDocument.ExecuteDocumentAction(e.WithNewElement(otherElement));\n                        });\n  }\n\n  private async void TextView_BlockSelected(object sender, IRElementEventArgs e) {\n    var document = sender as IRDocument;\n\n    if (document != null) {\n      await NotifyPanelsOfElementSelection(e, document);\n    }\n\n    var block = e.Element.ParentBlock;\n    UpdateBlockStatusBar(block);\n  }\n\n  private void TextView_BookmarkSelected(object sender, SelectedBookmarkInfo e) {\n    var document = sender as IRDocument;\n    var bookmarksPanel = FindTargetPanel<BookmarksPanel>(document, ToolPanelKind.Bookmarks);\n    bookmarksPanel.Bookmarks.Refresh();\n    BookmarkStatus.Text = $\"{e.SelectedIndex + 1} / {e.TotalBookmarks}\";\n  }\n\n  private void TextView_BookmarkListCleared(object sender, EventArgs e) {\n    var document = sender as IRDocument;\n    var bookmarksPanel = FindTargetPanel<BookmarksPanel>(document, ToolPanelKind.Bookmarks);\n    bookmarksPanel.Bookmarks.Clear();\n  }\n\n  private void TextView_BookmarkRemoved(object sender, Bookmark e) {\n    var document = sender as IRDocument;\n    var bookmarksPanel = FindTargetPanel<BookmarksPanel>(document, ToolPanelKind.Bookmarks);\n    bookmarksPanel.Bookmarks.Remove(e);\n  }\n\n  private void TextView_BookmarkAdded(object sender, Bookmark e) {\n    var document = sender as IRDocument;\n    var bookmarksPanel = FindTargetPanel<BookmarksPanel>(document, ToolPanelKind.Bookmarks);\n    bookmarksPanel.Bookmarks.Add(e);\n  }\n\n  private void TextView_BookmarkChanged(object sender, Bookmark e) {\n    var document = sender as IRDocument;\n    var bookmarksPanel = FindTargetPanel<BookmarksPanel>(document, ToolPanelKind.Bookmarks);\n    bookmarksPanel.Bookmarks.Refresh();\n  }\n\n  private async void TextView_IRElementHighlighting(object sender, IRHighlightingEventArgs e) {\n    var document = sender as IRDocument;\n\n    if (document != null) {\n      await NotifyPanelsOfElementHighlight(e, document);\n    }\n  }\n\n  private async void TextView_IRElementSelected(object sender, IRElementEventArgs e) {\n    if (sender is IRDocument document) {\n      await NotifyPanelsOfElementSelection(e, document);\n    }\n  }\n\n  private void MirrorElementAction(IRElement element, IRDocument sourceDocument,\n                                   Action<IRElement, IRDocument> action) {\n    Trace.TraceInformation(\n      $\"Mirror action from {ObjectTracker.Track(sourceDocument)} on element {element}\");\n\n    foreach (var docInfo in sessionState_.DocumentHosts) {\n      var otherDocument = docInfo.DocumentHost.TextView;\n\n      // Skip if same section or from another function.\n      if (otherDocument == sourceDocument ||\n          otherDocument.Section.ParentFunction != sourceDocument.Section.ParentFunction) {\n        continue;\n      }\n\n      if (element != null) {\n        var finder = new ReferenceFinder(otherDocument.Function);\n        var otherOp = finder.FindEquivalentValue(element);\n\n        if (otherOp != null) {\n          action(otherOp, otherDocument);\n          continue;\n        }\n      }\n\n      action(null, otherDocument);\n    }\n  }\n\n  private void UpdateUIBeforeReadSession(string documentTitle) {\n    if (!string.IsNullOrEmpty(documentTitle)) {\n      Title = $\"Profile Explorer - Reading {documentTitle}\";\n    }\n\n    UpdatePanelEnabledState(false);\n    Utils.DisableControl(StartPage, 0.85);\n    Mouse.OverrideCursor = Cursors.AppStarting;\n    SetApplicationProgress(true, double.NaN, \"Loading session\");\n  }\n\n  private void UpdateUIBeforeLoadDocument(string documentTitle) {\n    if (!string.IsNullOrEmpty(documentTitle)) {\n      Title = $\"Profile Explorer - Loading {documentTitle}\";\n    }\n\n    StartUIUpdate();\n  }\n\n  private void StartUIUpdate() {\n    UpdatePanelEnabledState(false);\n    Utils.DisableControl(StartPage, 0.85);\n    Mouse.OverrideCursor = Cursors.AppStarting;\n  }\n\n  private void StopUIUpdate() {\n    Mouse.OverrideCursor = null;\n    UpdatePanelEnabledState(true);\n  }\n\n  private void UpdateUIAfterLoadDocument() {\n    StopUIUpdate();\n    loadingDocuments_ = false;\n\n    if (sessionState_ != null) {\n      UpdateWindowTitle();\n    }\n    else {\n      Title = \"Profile Explorer - Failed to load file\";\n      UpdatePanelEnabledState(false);\n    }\n\n    // Hide temporary UI.\n    HideProgressBar();\n  }\n\n  private IRDocumentHost FindDocumentWithSection(IRTextSection section) {\n    var result = sessionState_.DocumentHosts.Find(item => item.DocumentHost.Section == section);\n    return result?.DocumentHost;\n  }\n\n  private async void DocumentState_DocumentChangedEvent(object sender, EventArgs e) {\n    var loadedDoc = (ILoadedDocument)sender;\n    var eventTime = DateTime.UtcNow;\n\n    // Queue for later, when the application gets focus back.\n    // A lock is needed, since the event can fire concurrently.\n    lock (lockObject_) {\n      changedDocuments_[loadedDoc.FilePath] = eventTime;\n    }\n\n    if (appIsActivated_) {\n      // The event doesn't run on the main thread, redirect.\n      await Dispatcher.BeginInvoke(new Action(async () => {\n        await HandleChangedDocuments();\n      }));\n    }\n  }\n\n  private bool ShowDocumentReloadQuery(string filePath) {\n    if (SilentMode) {\n      return false;\n    }\n\n    lastDocumentReloadQueryTime_ = DateTime.UtcNow;\n\n    using var centerForm = new DialogCenteringHelper(this);\n    return MessageBox.Show(\n             $\"File {filePath} changed by an external application?\\nDo you want to reload?\",\n             \"Profile Explorer\", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No,\n             MessageBoxOptions.DefaultDesktopOnly) ==\n           MessageBoxResult.Yes;\n  }\n\n  private async Task ReloadDocument(string filePath) {\n    if (sessionState_.IsInTwoDocumentsDiffMode) {\n      await CheckedOpenBaseDiffIRDocuments(sessionState_.MainDocument.FilePath,\n                                           sessionState_.DiffDocument.FilePath);\n    }\n    else {\n      await CheckedOpenDocument(filePath);\n    }\n  }\n\n  private void StartAutoSaveTimer() {\n    //? TODO: Disabled since saving of profile sessions is also not supported yet.\n    // try {\n    //   string filePath = Utils.GetAutoSaveFilePath();\n    //\n    //   if (File.Exists(filePath)) {\n    //     File.Delete(filePath);\n    //   }\n    // }\n    // catch (Exception) {\n    //   Trace.TraceError(\"Failed to delete autosave file\");\n    // }\n    //\n    // //? TODO: For huge files, autosaving uses a lot of memory.\n    // if (!sessionState_.Info.IsDebugSession) {\n    //   try {\n    //     long fileSize = new FileInfo(sessionState_.Info.FilePath).Length;\n    //\n    //     if (fileSize > SectionReaderBase.MAX_PRELOADED_FILE_SIZE) {\n    //       Trace.TraceWarning(\n    //         $\"Disabling auto-saving for large file: {sessionState_.Info.FilePath}\");\n    //\n    //       sessionState_.IsAutoSaveEnabled = false;\n    //       return;\n    //     }\n    //   }\n    //   catch (Exception ex) {\n    //     Trace.TraceError($\"Failed to get auto-saved file size: {ex}\");\n    //   }\n    // }\n    //\n    // sessionState_.IsAutoSaveEnabled = true;\n    // autoSaveTimer_ = new DispatcherTimer {Interval = TimeSpan.FromSeconds(300)};\n    // autoSaveTimer_.Tick += async delegate { await AutoSaveSession().ConfigureAwait(false); };\n    // autoSaveTimer_.Start();\n  }\n\n  private async Task AutoSaveSession() {\n    //? TODO: Disabled since saving of profile sessions is also not supported yet.\n    // if (sessionState_ == null || !sessionState_.IsAutoSaveEnabled) {\n    //   return;\n    // }\n    //\n    // string filePath = Utils.GetAutoSaveFilePath();\n    // bool saved = await SaveSessionDocument(filePath).ConfigureAwait(false);\n    // Trace.TraceInformation($\"Auto-saved session: {saved}\");\n  }\n\n  private void OpenNewDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!App.StartNewApplicationInstance()) {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show(\"Failed to start new Profile Explorer instance\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Error);\n    }\n  }\n\n  private async Task CheckedOpenDocument(string filePath) {\n    var loadedDoc = await OpenDocument(filePath);\n\n    if (loadedDoc == null) {\n      MessageBox.Show($\"Filed to open binary file {filePath}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n    }\n  }\n\n  private async Task CheckedOpenBaseDiffIRDocuments(string baseFilePath, string diffFilePath) {\n    var (baseLoadedDoc, diffLoadedDoc) =\n      await OpenBaseDiffDocuments(baseFilePath, diffFilePath);\n\n    if (baseLoadedDoc == null || diffLoadedDoc == null) {\n      MessageBox.Show($\"Filed to open base/diff binary files {baseFilePath}\\nand {diffFilePath}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n    }\n  }\n\n  private async void CloseDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await EndSession(showStartPage: true);\n  }\n\n  private async void SaveDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!RequestSessionFilePath()) {\n      return;\n    }\n\n    string filePath = sessionState_.Info.FilePath;\n    bool loaded = await SaveSessionDocument(filePath);\n\n    if (!loaded) {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show($\"Failed to save session file {filePath}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n    }\n  }\n\n  private async void SaveAsDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!RequestSessionFilePath(true)) {\n      return;\n    }\n\n    string filePath = sessionState_.Info.FilePath;\n    bool loaded = await SaveSessionDocument(filePath);\n\n    if (!loaded) {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show($\"Failed to save session file {filePath}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n    }\n  }\n\n  private async void ReloadDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (sessionState_ != null && !sessionState_.Info.IsFileSession && !sessionState_.Info.IsDebugSession) {\n      await ReloadDocument(sessionState_.Info.FilePath);\n    }\n  }\n\n  private void AutoReloadDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (sessionState_ != null) {\n      App.Settings.AutoReloadDocument = (e.OriginalSource as MenuItem).IsChecked;\n      sessionState_.ChangeDocumentWatcherState(App.Settings.AutoReloadDocument);\n    }\n  }\n\n  private void CanExecuteDocumentCommand(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = IsSessionStarted;\n    e.Handled = true;\n  }\n\n  private ILoadedDocument FindLoadedDocument(IRTextFunction func) {\n    return sessionState_.FindLoadedDocument(func);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Mcp/McpActionExecutor.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Threading;\nusing ProfileExplorer.Mcp;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.ETW;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Mcp;\n\n/// <summary>\n/// Implementation of IMcpActionExecutor that provides Profile Explorer integration for AI agent interactions.\n/// This connects MCP tools to the actual Profile Explorer UI functionality.\n/// </summary>\npublic class McpActionExecutor : IMcpActionExecutor\n{\n    private readonly MainWindow mainWindow;\n    private readonly Dispatcher dispatcher;\n\n    public McpActionExecutor(MainWindow mainWindow)\n    {\n        this.mainWindow = mainWindow ?? throw new ArgumentNullException(nameof(mainWindow));\n        this.dispatcher = mainWindow.Dispatcher;\n    }\n\n    public async Task<OpenTraceResult> OpenTraceAsync(string profileFilePath, string processIdentifier)\n    {\n        // Mark that MCP automation is active - suppress UI dialogs\n        App.SuppressDialogsForAutomation = true;\n\n        // Validate file exists first\n        if (!File.Exists(profileFilePath))\n        {\n            return new OpenTraceResult\n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.FileNotFound,\n                ErrorMessage = $\"Trace file not found: {profileFilePath}\"\n            };\n        }\n\n        // Check if the requested trace and process is already loaded\n        var alreadyLoadedResult = await CheckIfTraceAlreadyLoadedAsync(profileFilePath, processIdentifier);\n        if (alreadyLoadedResult != null)\n        {\n            return alreadyLoadedResult;\n        }\n\n        // Try to parse as a process ID first\n        if (int.TryParse(processIdentifier, out int processId))\n        {\n            if (processId <= 0)\n            {\n                return new OpenTraceResult\n                {\n                    Success = false,\n                    FailureReason = OpenTraceFailureReason.UnknownError,\n                    ErrorMessage = \"Process ID must be a positive integer.\"\n                };\n            }\n            return await OpenTraceByProcessIdAsync(profileFilePath, processId);\n        }\n\n        // If not a number, treat as process name\n        return await OpenTraceByProcessNameAsync(profileFilePath, processIdentifier);\n    }\n\n    /// <summary>\n    /// Checks if the requested trace file and process is already loaded.\n    /// Returns a successful OpenTraceResult if already loaded, or null if not loaded.\n    /// This helps avoid timeout errors when a trace was already loaded but MCP timed out waiting.\n    /// </summary>\n    private async Task<OpenTraceResult> CheckIfTraceAlreadyLoadedAsync(string profileFilePath, string processIdentifier)\n    {\n        return await dispatcher.InvokeAsync(() =>\n        {\n            try\n            {\n                var sessionState = mainWindow.SessionState;\n                var profileData = sessionState?.ProfileData;\n                var report = profileData?.Report;\n\n                if (report == null)\n                {\n                    return null; // No profile loaded\n                }\n\n                // Get the currently loaded trace path\n                string loadedTracePath = report.TraceInfo?.TraceFilePath;\n                if (string.IsNullOrEmpty(loadedTracePath))\n                {\n                    return null;\n                }\n\n                // Normalize paths for comparison\n                string normalizedRequestedPath = Path.GetFullPath(profileFilePath).ToLowerInvariant();\n                string normalizedLoadedPath = Path.GetFullPath(loadedTracePath).ToLowerInvariant();\n\n                if (normalizedRequestedPath != normalizedLoadedPath)\n                {\n                    return null; // Different trace file\n                }\n\n                // Check if the requested process matches\n                var currentProcess = report.Process;\n                if (currentProcess == null)\n                {\n                    return null;\n                }\n\n                bool processMatches = false;\n                \n                // Check by process ID\n                if (int.TryParse(processIdentifier, out int requestedPid))\n                {\n                    processMatches = currentProcess.ProcessId == requestedPid;\n                }\n                else\n                {\n                    // Check by process name (case-insensitive, partial match)\n                    processMatches = \n                        (currentProcess.Name != null && \n                         currentProcess.Name.Contains(processIdentifier, StringComparison.OrdinalIgnoreCase)) ||\n                        (currentProcess.ImageFileName != null && \n                         currentProcess.ImageFileName.Contains(processIdentifier, StringComparison.OrdinalIgnoreCase));\n                }\n\n                if (processMatches)\n                {\n                    // The requested trace and process is already loaded!\n                    return new OpenTraceResult\n                    {\n                        Success = true,\n                        AlreadyLoaded = true,\n                        Message = $\"Trace and process already loaded (PID: {currentProcess.ProcessId}, Name: {currentProcess.Name})\"\n                    };\n                }\n\n                return null; // Same trace but different process requested\n            }\n            catch (Exception)\n            {\n                return null; // On any error, proceed with normal loading\n            }\n        });\n    }\n\n    private async Task<OpenTraceResult> OpenTraceByProcessIdAsync(string profileFilePath, int processId)\n    {\n        try\n        {\n            var loadResult = await LoadTraceAsync(profileFilePath);\n            if (!loadResult.Success) {\n                return loadResult.Result;\n            }\n            \n            // Select the process by PID\n            return await SelectProcessByPidAsync(loadResult.ProfileLoadWindow, processId);\n        }\n        catch (Exception ex)\n        {\n            return new OpenTraceResult\n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.UnknownError,\n                ErrorMessage = $\"Unexpected error: {ex.Message}\"\n            };\n        }\n    }\n\n    private async Task<OpenTraceResult> OpenTraceByProcessNameAsync(string profileFilePath, string processName) {\n        try {\n            // Load the trace and prepare the process list\n            var loadResult = await LoadTraceAsync(profileFilePath);\n            if (!loadResult.Success) {\n                return loadResult.Result;\n            }\n\n            // Select the process by name\n            return await SelectProcessByNameAsync(loadResult.ProfileLoadWindow, processName);\n        }\n        catch (Exception ex) {\n            return new OpenTraceResult {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.UnknownError,\n                ErrorMessage = $\"Unexpected error: {ex.Message}\"\n            };\n        }\n    }\n\n    private async Task<(bool Success, ProfileExplorer.UI.ProfileLoadWindow ProfileLoadWindow, OpenTraceResult Result)> LoadTraceAsync(string profileFilePath) {\n        // Execute the command in the background since ShowDialog() blocks\n        var task = Task.Run(() =>\n        {\n            dispatcher.Invoke(() => AppCommand.LoadProfile.Execute(null, mainWindow));\n        });\n        \n        // Wait for the dialog to be created and shown (with timeout)\n        var profileLoadWindow = await WaitForWindowAsync<ProfileExplorer.UI.ProfileLoadWindow>(TimeSpan.FromSeconds(5));\n        if (profileLoadWindow == null)\n        {\n            var errorResult = new OpenTraceResult \n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.UIError,\n                ErrorMessage = \"Failed to open profile load dialog window\"\n            };\n            return (false, null, errorResult);\n        }\n        \n        // Step 1: Set the profile file path\n        await dispatcher.InvokeAsync(() => {\n            profileLoadWindow.ProfileFilePath = profileFilePath;\n        });\n\n        // Step 2: Trigger the text changed logic to load the process list\n        await dispatcher.InvokeAsync(() => \n        {\n            var textChangedMethod = profileLoadWindow.GetType().GetMethod(\"ProfileAutocompleteBox_TextChanged\",\n                BindingFlags.NonPublic | BindingFlags.Instance);\n            if (textChangedMethod != null) \n            {\n                textChangedMethod.Invoke(profileLoadWindow, new object[] { profileLoadWindow, new RoutedEventArgs() });\n            }\n        });\n\n        // Step 3: Wait for process list to finish loading (with timeout)\n        bool processListLoaded = await WaitForProcessListLoadedAsync(profileLoadWindow, TimeSpan.FromMinutes(2));\n        if (!processListLoaded) \n        {\n            var errorResult = new OpenTraceResult \n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.ProcessListLoadTimeout,\n                ErrorMessage = \"Timeout while loading process list from trace file\"\n            };\n            return (false, profileLoadWindow, errorResult);\n        }\n\n        // Step 4: Additional verification that ItemsSource is actually populated\n        var verificationResult = await WaitForItemsSourceAsync(profileLoadWindow, TimeSpan.FromSeconds(10));\n        if (!verificationResult) \n        {\n            var errorResult = new OpenTraceResult \n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.ProcessListLoadTimeout,\n                ErrorMessage = \"Process list failed to load properly\"\n            };\n            return (false, profileLoadWindow, errorResult);\n        }\n\n        return (true, profileLoadWindow, null);\n    }\n\n    private async Task<OpenTraceResult> SelectProcessByPidAsync(ProfileExplorer.UI.ProfileLoadWindow profileLoadWindow, int processId) {\n        // Step 5: Select the specified process from the process list\n        // Use retry logic in case there are still brief timing issues\n        bool processSelected = false;\n        for (int retryCount = 0; retryCount < 3 && !processSelected; retryCount++)\n        {\n            if (retryCount > 0)\n            {\n                await Task.Delay(500); // Brief delay between retries\n            }\n            \n            processSelected = await dispatcher.InvokeAsync(() =>\n            {\n                var processListControl = profileLoadWindow.FindName(\"ProcessList\") as System.Windows.Controls.ListView;\n                if (processListControl?.ItemsSource != null)\n                {\n                    try\n                    {\n                        var processSummaries = processListControl.ItemsSource.Cast<ProcessSummary>().ToList();\n                        var targetProcess = processSummaries.FirstOrDefault(p => p.Process.ProcessId == processId);\n                        \n                        if (targetProcess != null)\n                        {\n                            processListControl.SelectedItems.Clear();\n                            processListControl.SelectedItems.Add(targetProcess);\n                            \n                            // Trigger the selection changed event\n                            var selectionChangedMethod = profileLoadWindow.GetType().GetMethod(\"ProcessList_OnSelectionChanged\", \n                                BindingFlags.NonPublic | BindingFlags.Instance);\n                            if (selectionChangedMethod != null)\n                            {\n                                var args = new System.Windows.Controls.SelectionChangedEventArgs(\n                                    System.Windows.Controls.Primitives.Selector.SelectionChangedEvent,\n                                    new object[0], new object[] { targetProcess });\n                                selectionChangedMethod.Invoke(profileLoadWindow, new object[] { processListControl, args });\n                            }\n                            return true;\n                        }\n                    }\n                    catch (Exception)\n                    {\n                        // If casting or process selection fails, return false\n                        return false;\n                    }\n                }\n                return false;\n            });\n        }\n        \n        if (!processSelected)\n        {\n            return new OpenTraceResult\n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.ProcessNotFound,\n                ErrorMessage = $\"Process with ID {processId} not found in trace file\",\n            };\n        }\n        \n        // Step 6: Execute the profile load (click Load button)\n        await dispatcher.InvokeAsync(() =>\n        {\n            var loadButtonClickMethod = profileLoadWindow.GetType().GetMethod(\"LoadButton_Click\", \n                BindingFlags.NonPublic | BindingFlags.Instance);\n            if (loadButtonClickMethod != null)\n            {\n                loadButtonClickMethod.Invoke(profileLoadWindow, new object[] { profileLoadWindow, new RoutedEventArgs() });\n            }\n        });\n        \n        // Step 7: Wait for the profile to finish loading\n        bool profileLoadCompleted = await WaitForProfileLoadingCompletedAsync(profileLoadWindow, TimeSpan.FromMinutes(30));\n        if (!profileLoadCompleted)\n        {\n            return new OpenTraceResult\n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.ProfileLoadTimeout,\n                ErrorMessage = \"Timeout while waiting for profile loading to complete. The profile may be very large or there may be symbol loading issues.\"\n            };\n        }\n        \n        return new OpenTraceResult { Success = true };\n    }\n\n    private async Task<OpenTraceResult> SelectProcessByNameAsync(ProfileExplorer.UI.ProfileLoadWindow profileLoadWindow, string processName) {\n        // Step 5: Select the specified process by name from the process list\n        bool processSelected = false;\n        for (int retryCount = 0; retryCount < 3 && !processSelected; retryCount++) {\n            if (retryCount > 0) {\n                await Task.Delay(500); // Brief delay between retries\n            }\n\n            processSelected = await dispatcher.InvokeAsync(() => {\n                var processListControl = profileLoadWindow.FindName(\"ProcessList\") as System.Windows.Controls.ListView;\n                if (processListControl?.ItemsSource != null) {\n                    try {\n                        var processSummaries = processListControl.ItemsSource.Cast<ProcessSummary>().ToList();\n\n                        // Look for process by name (case-insensitive, supports partial matching)\n                        var targetProcess = processSummaries.FirstOrDefault(p =>\n                            p.Process.Name != null &&\n                            p.Process.Name.Contains(processName, StringComparison.OrdinalIgnoreCase));\n\n                        // If no partial match, try exact match\n                        if (targetProcess == null) {\n                            targetProcess = processSummaries.FirstOrDefault(p =>\n                                string.Equals(p.Process.Name, processName, StringComparison.OrdinalIgnoreCase));\n                        }\n\n                        // If still no match, try matching against image file name\n                        if (targetProcess == null) {\n                            targetProcess = processSummaries.FirstOrDefault(p =>\n                                p.Process.ImageFileName != null &&\n                                p.Process.ImageFileName.Contains(processName, StringComparison.OrdinalIgnoreCase));\n                        }\n\n                        if (targetProcess != null) {\n                            processListControl.SelectedItems.Clear();\n                            processListControl.SelectedItems.Add(targetProcess);\n\n                            // Trigger the selection changed event\n                            var selectionChangedMethod = profileLoadWindow.GetType().GetMethod(\"ProcessList_OnSelectionChanged\",\n                                BindingFlags.NonPublic | BindingFlags.Instance);\n                            if (selectionChangedMethod != null) {\n                                var args = new System.Windows.Controls.SelectionChangedEventArgs(\n                                    System.Windows.Controls.Primitives.Selector.SelectionChangedEvent,\n                                    new object[0], new object[] { targetProcess });\n                                selectionChangedMethod.Invoke(profileLoadWindow, new object[] { processListControl, args });\n                            }\n                            return true;\n                        }\n                    }\n                    catch (Exception) {\n                        // If casting or process selection fails, return false\n                        return false;\n                    }\n                }\n                return false;\n            });\n        }\n\n        if (!processSelected) {\n            return new OpenTraceResult {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.ProcessNotFound,\n                ErrorMessage = $\"Process '{processName}' not found in trace file\",\n            };\n        }\n\n        // Step 6: Execute the profile load (click Load button)\n        await dispatcher.InvokeAsync(() => {\n            var loadButtonClickMethod = profileLoadWindow.GetType().GetMethod(\"LoadButton_Click\",\n                BindingFlags.NonPublic | BindingFlags.Instance);\n            if (loadButtonClickMethod != null) {\n                loadButtonClickMethod.Invoke(profileLoadWindow, new object[] { profileLoadWindow, new RoutedEventArgs() });\n            }\n        });\n\n        // Step 7: Wait for the profile to finish loading\n        bool profileLoadCompleted = await WaitForProfileLoadingCompletedAsync(profileLoadWindow, TimeSpan.FromMinutes(30));\n        if (!profileLoadCompleted)\n        {\n            return new OpenTraceResult\n            {\n                Success = false,\n                FailureReason = OpenTraceFailureReason.ProfileLoadTimeout,\n                ErrorMessage = \"Timeout while waiting for profile loading to complete. The profile may be very large or there may be symbol loading issues.\"\n            };\n        }\n\n        return new OpenTraceResult { Success = true };\n    }\n\n    /// <summary>\n    /// Waits for a window of type T to appear, with a timeout.\n    /// </summary>\n    private async Task<T> WaitForWindowAsync<T>(TimeSpan timeout) where T : Window\n    {\n        var startTime = DateTime.UtcNow;\n        \n        while (DateTime.UtcNow - startTime < timeout)\n        {\n            var window = await dispatcher.InvokeAsync(() => \n                mainWindow.OwnedWindows.OfType<T>().FirstOrDefault());\n            \n            if (window != null)\n            {\n                return window;\n            }\n            \n            await Task.Delay(100); // Check every 100ms\n        }\n        \n        return null;\n    }\n\n    /// <summary>\n    /// Waits for the process list to finish loading in the ProfileLoadWindow.\n    /// Monitors the IsLoadingProcessList and ShowProcessList properties.\n    /// Also ensures at least 2 processes are loaded to avoid partial loading issues.\n    /// </summary>\n    private async Task<bool> WaitForProcessListLoadedAsync(ProfileExplorer.UI.ProfileLoadWindow window, TimeSpan timeout)\n    {\n        var startTime = DateTime.UtcNow;\n        const int MinimumProcessCount = 2; // Wait for at least 2 processes to ensure full loading\n        \n        while (DateTime.UtcNow - startTime < timeout)\n        {\n            var (isLoading, showList, hasItemsSource, processCount) = await dispatcher.InvokeAsync(() =>\n            {\n                var isLoadingProp = window.GetType().GetProperty(\"IsLoadingProcessList\");\n                var showListProp = window.GetType().GetProperty(\"ShowProcessList\");\n                var processListControl = window.FindName(\"ProcessList\") as System.Windows.Controls.ListView;\n                \n                bool isLoading = isLoadingProp?.GetValue(window) as bool? ?? false;\n                bool showList = showListProp?.GetValue(window) as bool? ?? false;\n                bool hasItemsSource = processListControl?.ItemsSource != null;\n                int processCount = 0;\n                \n                if (hasItemsSource)\n                {\n                    try\n                    {\n                        processCount = processListControl.ItemsSource.Cast<ProcessSummary>().Count();\n                    }\n                    catch\n                    {\n                        processCount = 0;\n                        hasItemsSource = false; // If we can't cast, treat as not having items source\n                    }\n                }\n                \n                return (isLoading, showList, hasItemsSource, processCount);\n            });\n            \n            // Process list is ready when:\n            // 1. It's not currently loading (IsLoadingProcessList = false)\n            // 2. The process list is shown (ShowProcessList = true)\n            // 3. The ProcessList control has a valid ItemsSource\n            // 4. The ProcessList control has at least the minimum number of processes OR we've waited long enough\n            if (!isLoading && showList && hasItemsSource && \n                (processCount >= MinimumProcessCount || \n                    (processCount > 0 && DateTime.UtcNow - startTime > TimeSpan.FromSeconds(10))))\n            {\n                return true;\n            }\n            \n            // Additional check: If we're not loading but still don't have ItemsSource,\n            // even though ShowProcessList is true, continue waiting as this indicates\n            // the UI update cycle hasn't completed yet\n            if (!isLoading && showList && !hasItemsSource)\n            {\n                // This is likely a timing issue - UI state says ready but ItemsSource not set yet\n                // Continue waiting unless we've been in this state for too long\n                if (DateTime.UtcNow - startTime > TimeSpan.FromSeconds(10))\n                {\n                    return false; // Likely an error occurred - UI says ready but no data\n                }\n            }\n            \n            // If we're not loading and not showing the list, it might indicate an error\n            if (!isLoading && !showList)\n            {\n                // Give it a bit more time in case the state transitions haven't completed\n                if (DateTime.UtcNow - startTime > TimeSpan.FromSeconds(5))\n                {\n                    return false; // Likely an error occurred\n                }\n            }\n            \n            await Task.Delay(200); // Check every 200ms\n        }\n        \n        return false; // Timeout\n    }\n\n    /// <summary>\n    /// Additional verification that ItemsSource is populated.\n    /// This handles edge cases where the main waiting logic completes but ItemsSource is still briefly null.\n    /// </summary>\n    private async Task<bool> WaitForItemsSourceAsync(ProfileExplorer.UI.ProfileLoadWindow window, TimeSpan timeout)\n    {\n        var startTime = DateTime.UtcNow;\n        \n        while (DateTime.UtcNow - startTime < timeout)\n        {\n            var (hasItemsSource, processCount, isAccessible) = await dispatcher.InvokeAsync(() =>\n            {\n                var processListControl = window.FindName(\"ProcessList\") as System.Windows.Controls.ListView;\n                bool hasItemsSource = processListControl?.ItemsSource != null;\n                int processCount = 0;\n                bool isAccessible = false;\n                \n                if (hasItemsSource)\n                {\n                    try\n                    {\n                        // Try to access the items to ensure they're actually available\n                        var items = processListControl.ItemsSource.Cast<ProcessSummary>().ToList();\n                        processCount = items.Count;\n                        isAccessible = true;\n                    }\n                    catch\n                    {\n                        hasItemsSource = false;\n                        processCount = 0;\n                        isAccessible = false;\n                    }\n                }\n                \n                return (hasItemsSource, processCount, isAccessible);\n            });\n            \n            if (hasItemsSource && processCount > 0 && isAccessible)\n            {\n                return true;\n            }\n            \n            await Task.Delay(50); // Check every 50ms for more responsive verification\n        }\n        \n        return false; // Timeout - ItemsSource never became available\n    }\n\n    /// <summary>\n    /// Waits for the profile loading to complete by monitoring the IsLoadingProfile property.\n    /// This ensures the profile is fully loaded before operations like GetAvailableFunctions can succeed.\n    /// </summary>\n    private async Task<bool> WaitForProfileLoadingCompletedAsync(ProfileExplorer.UI.ProfileLoadWindow window, TimeSpan timeout)\n    {\n        var startTime = DateTime.UtcNow;\n\n        // Phase 1: Wait for the profile load dialog to finish\n        while (DateTime.UtcNow - startTime < timeout)\n        {\n            bool isLoadingProfile = await dispatcher.InvokeAsync(() =>\n            {\n                var isLoadingProp = window.GetType().GetProperty(\"IsLoadingProfile\");\n                return isLoadingProp?.GetValue(window) as bool? ?? false;\n            });\n\n            // Profile dialog loading is complete when IsLoadingProfile is false\n            if (!isLoadingProfile)\n            {\n                break;\n            }\n\n            await Task.Delay(500); // Check every 500ms since profile loading can take a long time\n        }\n\n        // Phase 2: Wait for the main window to have fully loaded profile data with functions\n        // This ensures symbol loading is complete and GetAvailableFunctions will work\n        var remainingTimeout = timeout - (DateTime.UtcNow - startTime);\n        if (remainingTimeout <= TimeSpan.Zero)\n        {\n            return false; // Timeout during dialog loading phase\n        }\n\n        return await WaitForMainWindowProfileReadyAsync(remainingTimeout);\n    }\n\n    /// <summary>\n    /// Waits for the main window to have a fully loaded profile with functions available.\n    /// This handles the case where symbol loading continues after the profile dialog closes.\n    /// </summary>\n    private async Task<bool> WaitForMainWindowProfileReadyAsync(TimeSpan timeout)\n    {\n        var startTime = DateTime.UtcNow;\n\n        while (DateTime.UtcNow - startTime < timeout)\n        {\n            var (isReady, functionCount) = await dispatcher.InvokeAsync(() =>\n            {\n                try\n                {\n                    var sessionState = mainWindow.SessionState;\n                    var profileData = sessionState?.ProfileData;\n                    var report = profileData?.Report;\n\n                    // Check if we have basic profile data\n                    if (report == null || profileData == null)\n                    {\n                        return (false, 0);\n                    }\n\n                    // Check if function list is populated (indicates symbol loading is complete)\n                    var sectionPanel = mainWindow.FindName(\"SectionPanel\") as ProfileExplorer.UI.SectionPanelPair ??\n                                       mainWindow.FindPanel(ProfileExplorer.UI.ToolPanelKind.Section) as ProfileExplorer.UI.SectionPanelPair;\n\n                    if (sectionPanel?.MainPanel == null)\n                    {\n                        return (false, 0);\n                    }\n\n                    var functionListControl = sectionPanel.MainPanel.FindName(\"FunctionList\") as System.Windows.Controls.ListView;\n                    if (functionListControl?.ItemsSource == null)\n                    {\n                        return (false, 0);\n                    }\n\n                    // Count functions to ensure the list is populated\n                    int count = 0;\n                    foreach (var _ in functionListControl.ItemsSource)\n                    {\n                        count++;\n                        if (count >= 5) break; // We just need to confirm there are functions\n                    }\n\n                    return (count > 0, count);\n                }\n                catch\n                {\n                    return (false, 0);\n                }\n            });\n\n            if (isReady && functionCount > 0)\n            {\n                return true;\n            }\n\n            await Task.Delay(500); // Check every 500ms\n        }\n\n        return false; // Timeout\n    }\n\n    /// <summary>\n    /// Helper method to get the section panel and function list control\n    /// </summary>\n    private async Task<(ProfileExplorer.UI.SectionPanelPair SectionPanel, System.Windows.Controls.ListView FunctionList)> \n        GetFunctionListControlAsync()\n    {\n        var sectionPanel = await dispatcher.InvokeAsync(() =>\n        {\n            return mainWindow.FindName(\"SectionPanel\") as ProfileExplorer.UI.SectionPanelPair ??\n                    mainWindow.FindPanel(ProfileExplorer.UI.ToolPanelKind.Section) as ProfileExplorer.UI.SectionPanelPair;\n        });\n\n        if (sectionPanel?.MainPanel == null)\n        {\n            return (null, null);\n        }\n\n        var functionListControl = await dispatcher.InvokeAsync(() => \n            sectionPanel.MainPanel.FindName(\"FunctionList\") as System.Windows.Controls.ListView);\n\n        return (sectionPanel, functionListControl);\n    }\n\n    public async Task<ProfilerStatus> GetStatusAsync()\n    {\n        return await dispatcher.InvokeAsync(() =>\n        {\n            try\n            {\n                var sessionState = mainWindow.SessionState;\n                var profileData = sessionState?.ProfileData;\n                var report = profileData?.Report; // This is the ProfileDataReport with all the info\n\n                // Check if we have profile data loaded\n                bool isProfileLoaded = profileData != null && report != null;\n                string currentProfilePath = null;\n                int[] loadedProcesses = Array.Empty<int>();\n                string[] activeFilters = Array.Empty<string>();\n                ProcessInfo? currentProcess = null;\n\n                if (isProfileLoaded && report != null)\n                {\n                    // Get trace file path and duration from ProfileDataReport.TraceInfo\n                    currentProfilePath = report.TraceInfo?.TraceFilePath;\n\n                    // Get process information from ProfileDataReport.Process (main process)\n                    if (report.Process != null)\n                    {\n                        currentProcess = new ProcessInfo\n                        {\n                            ProcessId = report.Process.ProcessId,\n                            Name = report.Process.Name ?? string.Empty,\n                            ImageFileName = report.Process.ImageFileName ?? string.Empty,\n                            CommandLine = report.Process.CommandLine ?? string.Empty\n                        };\n                    }\n\n                    // Get all running processes from ProfileDataReport.RunningProcesses\n                    if (report.RunningProcesses?.Count > 0)\n                    {\n                        loadedProcesses = report.RunningProcesses\n                            .Select(p => p.Process.ProcessId)  // ProcessSummary.Process.ProcessId\n                            .ToArray();\n                    }\n\n                    // Get active filter information from session state\n                    var filterList = new List<string>();\n                    var profileFilter = sessionState?.ProfileFilter;\n                    \n                    if (profileFilter != null)\n                    {\n                        if (profileFilter.HasFilter)\n                        {\n                            filterList.Add(\"Has active filter\");\n                        }\n                        \n                        if (profileFilter.HasThreadFilter)\n                        {\n                            filterList.Add($\"Thread filter: {profileFilter.ThreadFilterText}\");\n                        }\n                        \n                        if (profileFilter.FilteredTime != TimeSpan.Zero)\n                        {\n                            filterList.Add($\"Filtered time: {profileFilter.FilteredTime}\");\n                        }\n                    }\n\n                    activeFilters = filterList.ToArray();\n                }\n\n                return new ProfilerStatus\n                {\n                    IsProfileLoaded = isProfileLoaded,\n                    CurrentProfilePath = currentProfilePath,\n                    LoadedProcesses = loadedProcesses,\n                    ActiveFilters = activeFilters,\n                    CurrentProcess = currentProcess,\n                    LastUpdated = DateTime.UtcNow\n                };\n            }\n            catch (Exception)\n            {\n                // Return safe defaults if anything goes wrong\n                return new ProfilerStatus\n                {\n                    IsProfileLoaded = false,\n                    CurrentProfilePath = null,\n                    LoadedProcesses = Array.Empty<int>(),\n                    ActiveFilters = Array.Empty<string>(),\n                    CurrentProcess = null,\n                    LastUpdated = DateTime.UtcNow\n                };\n            }\n        });\n    }\n\n    private async Task<string> GetFunctionAssemblyAsync(string functionName)\n    {\n        try\n        {\n            // Step 1: Get the section panel for UI operations\n            var (sectionPanel, functionListControl) = await GetFunctionListControlAsync();\n            if (sectionPanel == null || functionListControl == null)\n            {\n                return null;\n            }\n\n            // Step 2: Parse function name - handle \"module!function\" format\n            string targetModule = null;\n            string targetFuncName = functionName;\n            if (functionName.Contains(\"!\"))\n            {\n                var parts = functionName.Split('!', 2);\n                targetModule = parts[0];\n                targetFuncName = parts[1];\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Parsed function name: module={targetModule}, function={targetFuncName}\");\n            }\n\n            // Step 3: Search through ALL functions in the profile (not just visible list)\n            var foundFunction = await dispatcher.InvokeAsync(() =>\n            {\n                var sessionState = mainWindow.SessionState;\n                var profileData = sessionState?.ProfileData;\n\n                if (profileData?.FunctionProfiles == null)\n                {\n                    ProfileExplorer.Core.Utilities.DiagnosticLogger.LogWarning(\"[MCP] No FunctionProfiles available\");\n                    return null;\n                }\n\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Searching through {profileData.FunctionProfiles.Count} functions for '{functionName}'\");\n\n                // First, try to find in the visible list (for UI operations later)\n                ProfileExplorer.UI.IRTextFunctionEx visibleFuncEx = null;\n                if (functionListControl?.ItemsSource != null)\n                {\n                    foreach (var item in functionListControl.ItemsSource)\n                    {\n                        if (item is ProfileExplorer.UI.IRTextFunctionEx funcEx)\n                        {\n                            // Match by exact name or by module!function format\n                            bool matches = funcEx.ToolTip == functionName ||\n                                          funcEx.ToolTip == targetFuncName ||\n                                          funcEx.Name == targetFuncName;\n\n                            // Also check if module matches when specified\n                            if (matches && targetModule != null)\n                            {\n                                matches = string.Equals(funcEx.ModuleName, targetModule, StringComparison.OrdinalIgnoreCase);\n                            }\n\n                            if (matches)\n                            {\n                                visibleFuncEx = funcEx;\n                                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Found function in visible list: {funcEx.Name} (module: {funcEx.ModuleName})\");\n                                break;\n                            }\n                        }\n                    }\n                }\n\n                // If found in visible list, use that\n                if (visibleFuncEx != null)\n                {\n                    return visibleFuncEx;\n                }\n\n                // Otherwise, search through ALL functions in the profile\n                foreach (var kvp in profileData.FunctionProfiles)\n                {\n                    var func = kvp.Key;\n                    string funcName = func.Name;\n                    string moduleName = func.ModuleName;\n\n                    // Match by function name\n                    bool matches = funcName == targetFuncName ||\n                                  funcName.Contains(targetFuncName) ||\n                                  (targetFuncName.Contains(\"::\") && funcName.Contains(targetFuncName.Split(\"::\").Last()));\n\n                    // Also check module when specified\n                    if (matches && targetModule != null)\n                    {\n                        matches = string.Equals(moduleName, targetModule, StringComparison.OrdinalIgnoreCase);\n                    }\n\n                    if (matches)\n                    {\n                        ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Found function in profile: {funcName} (module: {moduleName})\");\n                        // Create a temporary IRTextFunctionEx wrapper for the found function\n                        // We need to get the actual extension from the SectionPanel if possible\n                        var funcExtension = sectionPanel.MainPanel.GetFunctionExtension(func);\n                        if (funcExtension != null)\n                        {\n                            return funcExtension;\n                        }\n                        // If not in extension map, we can still work with the raw function\n                        // Return null here and handle below\n                        return null;\n                    }\n                }\n\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogWarning($\"[MCP] Function not found in profile: {functionName}\");\n                return null;\n            });\n\n            if (foundFunction == null)\n            {\n                return null; // Function not found\n            }\n\n            // Step 3.5: LAZY BINARY LOADING - If binary isn't loaded yet, trigger lazy load\n            // This is needed for MCP automation where binaries are loaded on-demand.\n            var lazyLoadResult = await EnsureBinaryLoadedForFunctionAsync(foundFunction.Function);\n            if (lazyLoadResult.HasValue && !lazyLoadResult.Value)\n            {\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogWarning($\"[MCP] Failed to lazy load binary for function {functionName}\");\n                // Continue anyway - the function may still have assembly data from other sources\n            }\n            else if (lazyLoadResult.HasValue && lazyLoadResult.Value)\n            {\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Successfully lazy loaded binary for function {functionName}\");\n            }\n\n            // Step 4: Verify function has assembly data and trigger double-click\n            var functionFound = await dispatcher.InvokeAsync(() =>\n            {\n                try\n                {\n                    // Check if the function has assembly data\n                    if (!HasAssemblyData(foundFunction))\n                    {\n                        ProfileExplorer.Core.Utilities.DiagnosticLogger.LogWarning($\"[MCP] Function has no assembly data after lazy load: {functionName}\");\n                        return false; // Function found but has no assembly data\n                    }\n                    // Select the function\n                    functionListControl.SelectedItems.Clear();\n                    functionListControl.SelectedItems.Add(foundFunction);\n                    functionListControl.ScrollIntoView(foundFunction);\n\n                    // Programmatically trigger the double-click event\n                    var method = sectionPanel.MainPanel.GetType().GetMethod(\"FunctionDoubleClick\",\n                        System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);\n                    if (method != null)\n                    {\n                        // Create a ListViewItem to simulate the sender\n                        var listViewItem = functionListControl.ItemContainerGenerator.ContainerFromItem(foundFunction)\n                            as System.Windows.Controls.ListViewItem;\n                        if (listViewItem != null)\n                        {\n                            listViewItem.Content = foundFunction;\n                            var mouseEventArgs = new System.Windows.Input.MouseButtonEventArgs(\n                                System.Windows.Input.Mouse.PrimaryDevice,\n                                Environment.TickCount,\n                                System.Windows.Input.MouseButton.Left)\n                            {\n                                RoutedEvent = System.Windows.Controls.Control.MouseDoubleClickEvent\n                            };\n                            method.Invoke(sectionPanel.MainPanel, new object[] { listViewItem, mouseEventArgs });\n                            return true;\n                        }\n                    }\n                    return false;\n                }\n                catch (Exception)\n                {\n                    return false;\n                }\n            });\n\n            if (!functionFound)\n            {\n                return null; // Function not found in the list\n            }\n\n            // Add a delay to let the UI process the double-click and open the document\n            await Task.Delay(500); // Increased delay to allow more time for document and timing data loading\n\n            // Step 4: Wait for the assembly document to be opened\n            var assemblyDocument = await WaitForAssemblyDocumentAsync(TimeSpan.FromSeconds(10));\n            if (assemblyDocument == null)\n            {\n                return null; // Timeout waiting for assembly document\n            }\n\n            // Step 4.5: Wait for timing information to be available\n            var timingDataAvailable = await WaitForTimingDataAsync(assemblyDocument, TimeSpan.FromSeconds(15));\n            \n            // Step 5: Retrieve the assembly content and timing information from the document\n            var assemblyContentWithTiming = await dispatcher.InvokeAsync(() =>\n            {\n                var assemblyText = assemblyDocument.TextView.Text;\n                var columnData = assemblyDocument.TextView.ProfileColumnData;\n\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Extracting timing data - columnData null: {columnData == null}, HasData: {columnData?.HasData ?? false}\");\n\n                if (columnData == null || !columnData.HasData)\n                {\n                    // No timing information available, return just the assembly text\n                    ProfileExplorer.Core.Utilities.DiagnosticLogger.LogWarning($\"[MCP] No timing data available for assembly\");\n                    return assemblyText;\n                }\n\n                // Extract timing information and combine with assembly text\n                var lines = assemblyText.Split('\\n');\n                var result = new System.Text.StringBuilder();\n                var function = assemblyDocument.TextView.Function;\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Assembly has {lines.Length} lines, function null: {function == null}\");\n                \n                int elementsFound = 0;\n                int elementsWithTiming = 0;\n\n                for (int i = 0; i < lines.Length; i++)\n                {\n                    var line = lines[i];\n\n                    // Try to get timing information for this line by finding the IR element\n                    // Line numbers in TextLocation are 0-based, but we're iterating 0-based as well\n                    IRElement elementAtLine = null;\n                    string timePercentage = null;\n                    string timeValue = null;\n\n                    if (function != null)\n                    {\n                        // Find elements that correspond to this line\n                        foreach (var block in function.Blocks)\n                        {\n                            foreach (var tuple in block.Tuples)\n                            {\n                                if (tuple.TextLocation.Line == i) // Both are 0-based\n                                {\n                                    elementAtLine = tuple;\n                                    break;\n                                }\n                            }\n                            if (elementAtLine != null) break;\n                        }\n                    }\n\n                    if (elementAtLine != null)\n                    {\n                        elementsFound++;\n                        var rowValue = columnData.GetValues(elementAtLine);\n                        if (rowValue != null)\n                        {\n                            // Extract Time(%) and Time(ms) information\n                            foreach (var columnValue in rowValue.ColumnValues)\n                            {\n                                var column = columnValue.Key;\n                                var value = columnValue.Value;\n\n                                // Check for time percentage column\n                                if (column.Title.Contains(\"Time (%)\") || column.ColumnName.Contains(\"TimePercentage\"))\n                                {\n                                    timePercentage = value.Text;\n                                }\n                                // Check for time value column\n                                else if (column.Title.Contains(\"Time (\") || column.ColumnName.Contains(\"Time\"))\n                                {\n                                    timeValue = value.Text;\n                                }\n                            }\n                            if (!string.IsNullOrEmpty(timePercentage) || !string.IsNullOrEmpty(timeValue))\n                            {\n                                elementsWithTiming++;\n                            }\n                        }\n                    }\n\n                    // Build the complete line with timing information on the same line\n                    result.Append(line);\n                    \n                    // Append timing information if available, aligned to the right on the same line\n                    if (!string.IsNullOrEmpty(timePercentage) || !string.IsNullOrEmpty(timeValue))\n                    {\n                        // Calculate padding to align timing info to the right (assuming 100-character width)\n                        const int TargetWidth = 100;\n                        int currentLength = line.Length;\n                        int timingInfoLength = 15; // Approximate length of timing info\n                        if (!string.IsNullOrEmpty(timePercentage)) timingInfoLength += timePercentage.Length + 12; // \"Time(%): \" + value\n                        if (!string.IsNullOrEmpty(timeValue)) timingInfoLength += timeValue.Length + 8; // \"Time: \" + value\n                        if (!string.IsNullOrEmpty(timePercentage) && !string.IsNullOrEmpty(timeValue)) timingInfoLength += 2; // \", \"\n                        \n                        int paddingNeeded = Math.Max(2, TargetWidth - currentLength - timingInfoLength);\n                        \n                        result.Append(new string(' ', paddingNeeded));\n                        result.Append(\"[\");\n                        if (!string.IsNullOrEmpty(timePercentage))\n                        {\n                            result.Append($\"Time(%): {timePercentage}\");\n                        }\n                        if (!string.IsNullOrEmpty(timeValue))\n                        {\n                            if (!string.IsNullOrEmpty(timePercentage))\n                                result.Append(\", \");\n                            result.Append($\"Time: {timeValue}\");\n                        }\n                        result.Append(\"]\");\n                    }\n                    \n                    // Add line break only at the end, after timing info is added\n                    if (i < lines.Length - 1)\n                        result.AppendLine();\n                }\n\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Timing extraction complete: {elementsFound} elements found, {elementsWithTiming} with timing data\");\n                return result.ToString();\n            });\n\n            return assemblyContentWithTiming;\n        }\n        catch (Exception)\n        {\n            return null;\n        }\n    }\n\n    /// <summary>\n    /// Waits for a new assembly document to be opened after the function double-click.\n    /// Simplified approach: just wait for any document with assembly content to appear.\n    /// </summary>\n    private async Task<ProfileExplorer.UI.IRDocumentHost> WaitForAssemblyDocumentAsync(TimeSpan timeout)\n    {\n        var startTime = DateTime.UtcNow;\n\n        // Simple approach: continuously check all open documents for assembly content\n        while (DateTime.UtcNow - startTime < timeout)\n        {\n            var assemblyDocument = await dispatcher.InvokeAsync(() =>\n            {\n                try\n                {\n                    if (mainWindow is ProfileExplorer.UI.IUISession session)\n                    {\n                        var openDocs = session.OpenDocuments;\n\n                        // Check each document for assembly content\n                        foreach (var document in openDocs)\n                        {\n                            if (document?.Text != null && !string.IsNullOrEmpty(document.Text))\n                            {\n                                var text = document.Text;\n                                \n                                // Enhanced assembly detection with more patterns\n                                bool hasAssemblyInstructions = text.Contains(\"mov \") || text.Contains(\"call \") || \n                                    text.Contains(\"ret\") || text.Contains(\"push \") || text.Contains(\"pop \") || \n                                    text.Contains(\"jmp \") || text.Contains(\"add \") || text.Contains(\"sub \") || \n                                    text.Contains(\"lea \") || text.Contains(\"cmp \") || text.Contains(\"test \") ||\n                                    text.Contains(\"xor \") || text.Contains(\"and \") || text.Contains(\"or \");\n                                \n                                // Also check for register patterns and memory addresses\n                                bool hasAssemblyPatterns = text.Contains(\"rax\") || text.Contains(\"rbx\") || \n                                    text.Contains(\"rcx\") || text.Contains(\"rdx\") || text.Contains(\"rsp\") ||\n                                    text.Contains(\"rbp\") || text.Contains(\"eax\") || text.Contains(\"ebx\") ||\n                                    (text.Contains(\"[\") && text.Contains(\"]\")); // Memory addressing\n\n                                if (hasAssemblyInstructions || hasAssemblyPatterns)\n                                {\n                                    // Found a document with assembly content, find its IRDocumentHost\n                                    var sessionStateField = mainWindow.GetType().GetField(\"sessionState_\", \n                                        System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);\n                                    if (sessionStateField?.GetValue(mainWindow) is object sessionState)\n                                    {\n                                        var documentHostsProperty = sessionState.GetType().GetProperty(\"DocumentHosts\");\n                                        if (documentHostsProperty?.GetValue(sessionState) is System.Collections.IList documentHosts)\n                                        {\n                                            foreach (var hostInfo in documentHosts)\n                                            {\n                                                var documentHostProperty = hostInfo.GetType().GetProperty(\"DocumentHost\");\n                                                var docHost = documentHostProperty?.GetValue(hostInfo) as ProfileExplorer.UI.IRDocumentHost;\n                                                if (docHost?.TextView == document)\n                                                {\n                                                    return docHost;\n                                                }\n                                            }\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                }\n                catch\n                {\n                    // If there's any exception, continue searching\n                }\n                return null;\n            });\n\n            if (assemblyDocument != null)\n            {\n                return assemblyDocument;\n            }\n\n            await Task.Delay(200); // Check every 200ms\n        }\n\n        return null; // Timeout\n    }\n\n    /// <summary>\n    /// Waits for timing data to be available in the assembly document.\n    /// The ProfileColumnData might not be immediately available after the document opens.\n    /// </summary>\n    private async Task<bool> WaitForTimingDataAsync(ProfileExplorer.UI.IRDocumentHost documentHost, TimeSpan timeout)\n    {\n        var startTime = DateTime.UtcNow;\n        \n        while (DateTime.UtcNow - startTime < timeout)\n        {\n            var hasTimingData = await dispatcher.InvokeAsync(() =>\n            {\n                try\n                {\n                    var columnData = documentHost.TextView?.ProfileColumnData;\n                    if (columnData != null && columnData.HasData)\n                    {\n                        // Additionally check if we can actually get timing values from at least one element\n                        var function = documentHost.TextView.Function;\n                        if (function != null)\n                        {\n                            // Try to find at least one element with timing data\n                            foreach (var block in function.Blocks)\n                            {\n                                foreach (var tuple in block.Tuples)\n                                {\n                                    var rowValue = columnData.GetValues(tuple);\n                                    if (rowValue?.ColumnValues != null && rowValue.ColumnValues.Any())\n                                    {\n                                        // Check if any column contains timing information\n                                        foreach (var columnValue in rowValue.ColumnValues)\n                                        {\n                                            var column = columnValue.Key;\n                                            if (column.Title.Contains(\"Time\") || column.ColumnName.Contains(\"Time\"))\n                                            {\n                                                return true; // Found timing data\n                                            }\n                                        }\n                                    }\n                                }\n                            }\n                        }\n                    }\n                    return false;\n                }\n                catch\n                {\n                    return false;\n                }\n            });\n            \n            if (hasTimingData)\n            {\n                return true;\n            }\n            \n            await Task.Delay(500); // Check every 500ms - timing data loading can take a bit longer\n        }\n        \n        return false; // Timeout - proceed without timing data\n    }\n\n    public async Task<string?> GetFunctionAssemblyToFileAsync(string functionName)\n    {\n        try\n        {\n            // Get the assembly content first\n            string assemblyContent = await GetFunctionAssemblyAsync(functionName);\n            \n            if (assemblyContent == null)\n            {\n                return null; // Function not found\n            }\n\n            // Get the current process name from the loaded session\n            string processName = await GetCurrentProcessNameAsync();\n\n            // Create the tmp directory path\n            string currentDirectory = Directory.GetCurrentDirectory();\n            string srcPath = Path.GetFullPath(Path.Combine(currentDirectory, \"..\", \"..\", \"src\"));\n            string tmpDirectory = Path.Combine(srcPath, \"tmp\");\n            \n            // Ensure the tmp directory exists\n            Directory.CreateDirectory(tmpDirectory);\n            \n            // Sanitize the names for file system compatibility\n            string sanitizedProcessName = SanitizeFileName(processName);\n            string sanitizedFunctionName = SanitizeFileName(functionName);\n            \n            // Create the file name\n            string fileName = $\"{sanitizedProcessName}-{sanitizedFunctionName}.asm\";\n            string filePath = Path.Combine(tmpDirectory, fileName);\n            \n            // Write the assembly content to the file\n            await File.WriteAllTextAsync(filePath, assemblyContent);\n\n            return filePath;\n        }\n        catch\n        {\n            return null;\n        }\n    }\n\n    public async Task<GetAvailableProcessesResult> GetAvailableProcessesAsync(string profileFilePath, double? minWeightPercentage = null, int? topCount = null)\n    {\n        // Validate file exists first\n        if (!File.Exists(profileFilePath))\n        {\n            return new GetAvailableProcessesResult\n            {\n                Success = false,\n                ErrorMessage = $\"Trace file not found: {profileFilePath}\"\n            };\n        }\n\n        try\n        {\n            // Call FindTraceProcesses directly instead of opening the UI window.\n            // This avoids a race condition where the UI's double TextChanged invocation\n            // could cause WaitForProcessListLoadedAsync to read an incomplete intermediate list.\n            using var cancelableTask = new CancelableTask();\n            var options = App.Settings.ProfileOptions;\n\n            // Progress callback must be non-null (ETWEventProcessor calls it unconditionally).\n            var processSummaries = await ETWProfileDataProvider.FindTraceProcesses(\n                profileFilePath, options, _ => { }, cancelableTask);\n\n            if (processSummaries == null || processSummaries.Count == 0)\n            {\n                return new GetAvailableProcessesResult\n                {\n                    Success = false,\n                    ErrorMessage = \"Failed to extract process list from trace file\"\n                };\n            }\n\n            // Exclude Idle/kernel process and use non-idle percentages for meaningful results.\n            var processes = processSummaries\n                .Where(p => p.Process.ProcessId != ETWEventProcessor.KernelProcessId)\n                .Select(p => new ProcessInfo\n            {\n                ProcessId = p.Process.ProcessId,\n                Name = p.Process.Name ?? string.Empty,\n                ImageFileName = p.Process.ImageFileName,\n                CommandLine = p.Process.CommandLine,\n                Weight = p.Weight,\n                WeightPercentage = p.WeightPercentageExcludingIdle,\n                Duration = p.Duration\n            }).ToArray();\n\n            // Apply weight filtering if specified\n            if (minWeightPercentage.HasValue)\n            {\n                if (minWeightPercentage < 0 || minWeightPercentage > 100)\n                {\n                    return new GetAvailableProcessesResult\n                    {\n                        Success = false,\n                        ErrorMessage = \"minWeightPercentage must be nonnegative, between 0 and 100.\"\n                    };\n                }\n                processes = processes\n                    .Where(p => p.WeightPercentage >= minWeightPercentage.Value)\n                    .ToArray();\n            }\n\n            // Apply top N filtering if specified\n            if (topCount.HasValue)\n            {\n                if (topCount < 1) {\n                    return new GetAvailableProcessesResult {\n                        Success = false,\n                        ErrorMessage = \"topCount must be a positive integer.\"\n                    };\n                }\n                // Sort by weight percentage descending and take top N\n                if (processes.Length > topCount.Value) {\n                    processes = processes\n                    .OrderByDescending(p => p.WeightPercentage)\n                    .Take(topCount.Value)\n                    .ToArray();\n                }\n            }\n\n            return new GetAvailableProcessesResult\n            {\n                Success = true,\n                Processes = processes\n            };\n        }\n        catch (Exception ex)\n        {\n            return new GetAvailableProcessesResult\n            {\n                Success = false,\n                ErrorMessage = $\"Unexpected error: {ex.Message}\"\n            };\n        }\n    }\n\n    /// <summary>\n    /// Get the current process name from the loaded session\n    /// </summary>\n    private async Task<string> GetCurrentProcessNameAsync()\n    {\n        try\n        {\n            var status = await GetStatusAsync();\n            \n            // Use the current process information if available\n            if (status.CurrentProcess != null)\n            {\n                if (!string.IsNullOrEmpty(status.CurrentProcess.Name))\n                {\n                    return status.CurrentProcess.Name;\n                }\n                \n                return $\"process-{status.CurrentProcess.ProcessId}\";\n            }\n            \n            // Try to extract process name from loaded processes\n            if (status.LoadedProcesses?.Length > 0)\n            {\n                return $\"process-{status.LoadedProcesses[0]}\";\n            }\n            \n            // If we have a profile path, try to extract a meaningful name from it\n            if (!string.IsNullOrEmpty(status.CurrentProfilePath))\n            {\n                string fileName = Path.GetFileNameWithoutExtension(status.CurrentProfilePath);\n                return !string.IsNullOrEmpty(fileName) ? fileName : \"trace\";\n            }\n            \n            return \"unknown\";\n        }\n        catch\n        {\n            return \"unknown\";\n        }\n    }\n\n    /// <summary>\n    /// Sanitize a string to be safe for use as a file name\n    /// </summary>\n    private static string SanitizeFileName(string fileName)\n    {\n        if (string.IsNullOrWhiteSpace(fileName))\n            return \"unknown\";\n            \n        // Remove or replace invalid file name characters\n        char[] invalidChars = Path.GetInvalidFileNameChars();\n        string sanitized = fileName;\n        \n        foreach (char invalidChar in invalidChars)\n        {\n            sanitized = sanitized.Replace(invalidChar, '_');\n        }\n        \n        // Also replace some common problematic characters\n        sanitized = sanitized.Replace(':', '_')\n                                .Replace('<', '_')\n                                .Replace('>', '_')\n                                .Replace('*', '_')\n                                .Replace('?', '_')\n                                .Replace('|', '_')\n                                .Replace('\"', '_');\n        \n        // Limit length to avoid very long file names\n        if (sanitized.Length > 100)\n        {\n            sanitized = sanitized.Substring(0, 100);\n        }\n        \n        return sanitized;\n    }\n\n    public async Task<GetAvailableFunctionsResult> GetAvailableFunctionsAsync(FunctionFilter? filter = null)\n    {\n        try\n        {\n            // Check if a profile is currently loaded\n            var status = await GetStatusAsync();\n            if (!status.IsProfileLoaded)\n            {\n                return new GetAvailableFunctionsResult\n                {\n                    Success = false,\n                    ErrorMessage = \"No profile is currently loaded. Please open a trace file first using OpenTrace.\"\n                };\n            }\n\n            // Extract function information from the currently loaded session\n            var functions = await ExtractFunctionInfoAsync();\n\n            if (functions.Length == 0)\n            {\n                return new GetAvailableFunctionsResult\n                {\n                    Success = false,\n                    ErrorMessage = \"No functions found in the currently loaded profile. If you just opened a trace file, \" +\n                                 \"please wait for the profile loading to complete (this can take 20+ seconds for large traces) \" +\n                                 \"before calling GetAvailableFunctions. The loading includes multiple stages: \" +\n                                 \"'Reading Trace' → 'Downloading and loading binaries' → 'Downloading and loading symbols' → \" +\n                                 \"'Processing trace samples' → 'Computing Call Tree'.\"\n                };\n            }\n\n            // Apply module filtering if specified\n            if (!string.IsNullOrWhiteSpace(filter?.ModuleName))\n            {\n                functions = functions\n                    .Where(f => !string.IsNullOrEmpty(f.ModuleName) && \n                               f.ModuleName.Contains(filter.ModuleName, StringComparison.OrdinalIgnoreCase))\n                    .ToArray();\n                    \n                if (functions.Length == 0)\n                {\n                    // Provide helpful error message with available module suggestions\n                    var availableModules = (await ExtractFunctionInfoAsync())\n                        .Where(f => !string.IsNullOrEmpty(f.ModuleName))\n                        .Select(f => f.ModuleName!)\n                        .Distinct()\n                        .OrderBy(m => m)\n                        .Take(10) // Show first 10 modules as examples\n                        .ToArray();\n                    \n                    var modulesSuggestion = availableModules.Length > 0 \n                        ? $\" Available modules include: {string.Join(\", \", availableModules)}{(availableModules.Length == 10 ? \", ...\" : \"\")}\" \n                        : \"\";\n                    \n                    return new GetAvailableFunctionsResult\n                    {\n                        Success = false,\n                        ErrorMessage = $\"No functions found in module '{filter.ModuleName}'. The module name might not exist, be spelled differently, or not be loaded.{modulesSuggestion}\"\n                    };\n                }\n            }\n\n            // Apply self time filtering if specified\n            if (filter?.MinSelfTimePercentage.HasValue == true)\n            {\n                if (filter.MinSelfTimePercentage < 0 || filter.MinSelfTimePercentage > 100)\n                {\n                    return new GetAvailableFunctionsResult\n                    {\n                        Success = false,\n                        ErrorMessage = \"MinSelfTimePercentage must be between 0 and 100.\"\n                    };\n                }\n                functions = functions\n                    .Where(f => f.SelfTimePercentage >= filter.MinSelfTimePercentage.Value)\n                    .ToArray();\n            }\n\n            // Apply total time filtering if specified\n            if (filter?.MinTotalTimePercentage.HasValue == true)\n            {\n                if (filter.MinTotalTimePercentage < 0 || filter.MinTotalTimePercentage > 100)\n                {\n                    return new GetAvailableFunctionsResult\n                    {\n                        Success = false,\n                        ErrorMessage = \"MinTotalTimePercentage must be between 0 and 100.\"\n                    };\n                }\n                functions = functions\n                    .Where(f => f.TotalTimePercentage >= filter.MinTotalTimePercentage.Value)\n                    .ToArray();\n            }\n\n            // Apply top N filtering if specified\n            if (filter?.TopCount.HasValue == true)\n            {\n                if (filter.TopCount < 1)\n                {\n                    return new GetAvailableFunctionsResult\n                    {\n                        Success = false,\n                        ErrorMessage = \"TopCount must be a positive integer.\"\n                    };\n                }\n                // Sort by the chosen metric and take top N\n                if (functions.Length > filter.TopCount.Value)\n                {\n                    functions = (filter.SortBySelfTime)\n                        ? functions.OrderByDescending(f => f.SelfTimePercentage).Take(filter.TopCount.Value).ToArray()\n                        : functions.OrderByDescending(f => f.TotalTimePercentage).Take(filter.TopCount.Value).ToArray();\n                }\n            }\n            else\n            {\n                // If no topCount specified, still sort the results\n                functions = (filter?.SortBySelfTime ?? true)\n                    ? functions.OrderByDescending(f => f.SelfTimePercentage).ToArray()\n                    : functions.OrderByDescending(f => f.TotalTimePercentage).ToArray();\n            }\n\n            return new GetAvailableFunctionsResult\n            {\n                Success = true,\n                Functions = functions\n            };\n        }\n        catch (Exception ex)\n        {\n            return new GetAvailableFunctionsResult\n            {\n                Success = false,\n                ErrorMessage = $\"Unexpected error: {ex.Message}\"\n            };\n        }\n    }\n\n    /// <summary>\n    /// Extract function information from the currently loaded profile session\n    /// </summary>\n    private async Task<FunctionInfo[]> ExtractFunctionInfoAsync()\n    {\n        try\n        {\n            // Use the shared helper to get the function list control\n            var (sectionPanel, functionListControl) = await GetFunctionListControlAsync();\n            if (functionListControl?.ItemsSource == null)\n            {\n                return Array.Empty<FunctionInfo>();\n            }\n\n            return await dispatcher.InvokeAsync(() =>\n            {\n                try\n                {\n                    var functionInfos = new List<FunctionInfo>();\n\n                    // Iterate through the function list and extract information\n                    foreach (var item in functionListControl.ItemsSource)\n                    {\n                        if (item is ProfileExplorer.UI.IRTextFunctionEx functionEx)\n                        {\n                            var functionInfo = new FunctionInfo\n                            {\n                                Name = functionEx.Name ?? string.Empty,\n                                FullName = functionEx.ToolTip ?? functionEx.Name ?? string.Empty,\n                                ModuleName = ExtractModuleName(functionEx),\n                                SelfTimePercentage = Math.Round(functionEx.ExclusivePercentage * 100, 4), // Convert fraction to percentage\n                                TotalTimePercentage = Math.Round(functionEx.Percentage * 100, 4), // Convert fraction to percentage\n                                SelfTime = functionEx.ExclusiveWeight,\n                                TotalTime = functionEx.Weight,\n                                SourceFile = ExtractSourceFile(functionEx),\n                                HasAssembly = HasAssemblyData(functionEx)\n                            };\n\n                            functionInfos.Add(functionInfo);\n                        }\n                    }\n\n                    // Sort by self time percentage descending (most expensive functions first)\n                    return functionInfos\n                        .OrderByDescending(f => f.SelfTimePercentage)\n                        .ToArray();\n                }\n                catch\n                {\n                    return Array.Empty<FunctionInfo>();\n                }\n            });\n        }\n        catch\n        {\n            return Array.Empty<FunctionInfo>();\n        }\n    }\n\n    /// <summary>\n    /// Extract module name from function information\n    /// </summary>\n    private string ExtractModuleName(ProfileExplorer.UI.IRTextFunctionEx functionEx)\n    {\n        try\n        {\n            // Get module name directly from the function\n            if (!string.IsNullOrEmpty(functionEx.ModuleName))\n            {\n                return functionEx.ModuleName;\n            }\n\n            // Alternative: extract from full name if it contains module info\n            var fullName = functionEx.ToolTip ?? functionEx.Name ?? string.Empty;\n            if (fullName.Contains(\"!\"))\n            {\n                var parts = fullName.Split('!');\n                if (parts.Length > 1)\n                {\n                    return parts[0];\n                }\n            }\n\n            return null;\n        }\n        catch\n        {\n            return null;\n        }\n    }\n\n    /// <summary>\n    /// Extract source file information from function\n    /// </summary>\n    private string ExtractSourceFile(ProfileExplorer.UI.IRTextFunctionEx functionEx)\n    {\n        try\n        {\n            // Try to get source file information from debug info\n            var sessionState = mainWindow.SessionState;\n            var profileData = sessionState?.ProfileData;\n            \n            if (profileData?.ModuleDebugInfo != null && functionEx.Function != null)\n            {\n                // Look through module debug info for this function\n                foreach (var debugInfo in profileData.ModuleDebugInfo.Values)\n                {\n                    var sourceInfo = debugInfo.FindFunctionSourceFilePath(functionEx.Function);\n                    if (!sourceInfo.IsUnknown && sourceInfo.HasFilePath)\n                    {\n                        return sourceInfo.FilePath;\n                    }\n                }\n            }\n\n            return null;\n        }\n        catch\n        {\n            return null;\n        }\n    }\n\n    /// <summary>\n    /// Check if function has assembly data available\n    /// </summary>\n    private bool HasAssemblyData(ProfileExplorer.UI.IRTextFunctionEx functionEx)\n    {\n        try\n        {\n            // Check if the function has any sections (indicating code/assembly data)\n            return functionEx.Function?.HasSections ?? false;\n        }\n        catch\n        {\n            return false;\n        }\n    }\n\n    /// <summary>\n    /// Ensures the binary for a function's module is loaded, triggering lazy load if needed.\n    /// Returns: null if no lazy load was needed, true if lazy load succeeded, false if it failed.\n    /// </summary>\n    private async Task<bool?> EnsureBinaryLoadedForFunctionAsync(ProfileExplorer.Core.IRTextFunction function)\n    {\n        try\n        {\n            if (function?.ParentSummary == null)\n            {\n                return null; // Cannot determine module\n            }\n\n            // Get the document for this function's module\n            var docInfo = await dispatcher.InvokeAsync(() =>\n            {\n                return mainWindow.SessionState?.FindLoadedDocument(function.ParentSummary);\n            });\n\n            if (docInfo == null)\n            {\n                return null; // Document not found\n            }\n\n            // Check if lazy loading is needed\n            if (docInfo.BinaryFileExists)\n            {\n                return null; // Binary already loaded, no lazy load needed\n            }\n\n            if (docInfo.EnsureBinaryLoaded == null)\n            {\n                return null; // No lazy load callback available\n            }\n\n            // Trigger lazy loading\n            string moduleName = docInfo.ModuleName ?? function.ModuleName ?? \"binary\";\n            ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Triggering lazy binary load for module: {moduleName}\");\n\n            bool loaded = await docInfo.EnsureBinaryLoaded().ConfigureAwait(false);\n\n            ProfileExplorer.Core.Utilities.DiagnosticLogger.LogInfo($\"[MCP] Lazy binary load result for {moduleName}: {loaded}\");\n            return loaded;\n        }\n        catch (Exception ex)\n        {\n            ProfileExplorer.Core.Utilities.DiagnosticLogger.LogError($\"[MCP] Error during lazy binary load: {ex.Message}\");\n            return false;\n        }\n    }\n\n    public async Task<GetAvailableBinariesResult> GetAvailableBinariesAsync(double? minTimePercentage = null, TimeSpan? minTime = null, int? topCount = null)\n    {\n        try\n        {\n            // Check if a profile is currently loaded\n            var status = await GetStatusAsync();\n            if (!status.IsProfileLoaded)\n            {\n                return new GetAvailableBinariesResult\n                {\n                    Success = false,\n                    ErrorMessage = \"No profile is currently loaded. Please open a trace file first using OpenTrace.\",\n                    Binaries = Array.Empty<BinaryInfo>()\n                };\n            }\n\n            // Get module data directly from ProfileData CallTree\n            var moduleInfos = await GetModuleDataFromCallTreeAsync();\n            if (moduleInfos.Length == 0)\n            {\n                return new GetAvailableBinariesResult\n                {\n                    Success = false,\n                    ErrorMessage = \"No module data available. Ensure the profile has finished loading completely.\",\n                    Binaries = Array.Empty<BinaryInfo>()\n                };\n            }\n\n            // Slice ModuleEx into BinaryInfo\n            var binaryInfos = moduleInfos.Select(module => {\n                var binaryInfo = new BinaryInfo {\n                    Name = module.Name ?? string.Empty,\n                    FullPath = ExtractModuleFullPath(module.Name),\n                    TimePercentage = Math.Round(module.ExclusivePercentage, 4),\n                    Time = module.ExclusiveWeight,\n                    BinaryFileMissing = module.BinaryFileMissing,\n                    DebugFileMissing = module.DebugFileMissing\n                };\n                \n                // Log binary info for diagnostics\n                ProfileExplorer.Core.Utilities.DiagnosticLogger.LogDebug($\"[MCP-BinaryInfo] Module: {binaryInfo.Name}, BinaryMissing: {binaryInfo.BinaryFileMissing}, DebugMissing: {binaryInfo.DebugFileMissing}\");\n                \n                return binaryInfo;\n            }).ToArray();\n\n            // Apply filtering\n            var filteredBinaries = binaryInfos;\n\n            if (minTimePercentage.HasValue)\n            {\n                filteredBinaries = filteredBinaries\n                    .Where(b => b.TimePercentage >= minTimePercentage.Value)\n                    .ToArray();\n            }\n\n            if (minTime.HasValue)\n            {\n                filteredBinaries = filteredBinaries\n                    .Where(b => b.Time >= minTime.Value)\n                    .ToArray();\n            }\n\n            // Sort by time percentage descending\n            filteredBinaries = filteredBinaries\n                .OrderByDescending(b => b.TimePercentage)\n                .ToArray();\n\n            // Apply top count filter if specified\n            if (topCount.HasValue)\n            {\n                filteredBinaries = filteredBinaries\n                    .Take(topCount.Value)\n                    .ToArray();\n            }\n\n            return new GetAvailableBinariesResult\n            {\n                Success = true,\n                Binaries = filteredBinaries\n            };\n        }\n        catch (Exception ex)\n        {\n            return new GetAvailableBinariesResult\n            {\n                Success = false,\n                ErrorMessage = $\"Error retrieving binaries: {ex.Message}\",\n                Binaries = Array.Empty<BinaryInfo>()\n            };\n        }\n    }\n\n    /// <summary>\n    /// Get module data directly from SessionState.ProfileData (same source as UI)\n    /// </summary>\n    private async Task<ProfileExplorer.UI.ModuleEx[]> GetModuleDataFromCallTreeAsync()\n    {\n        try\n        {\n            return await dispatcher.InvokeAsync(() =>\n            {\n                try\n                {\n                    var sessionState = mainWindow.SessionState;\n                    var profileData = sessionState?.ProfileData;\n\n                    if (profileData?.ModuleWeights == null || profileData.Modules == null)\n                    {\n                        return Array.Empty<ProfileExplorer.UI.ModuleEx>();\n                    }\n\n                    var moduleInfos = new List<ProfileExplorer.UI.ModuleEx>();\n\n                    // Extract module information directly from ProfileData (same logic as LoadFunctionProfile)\n                    foreach (var pair in profileData.ModuleWeights)\n                    {\n                        var module = profileData.Modules[pair.Key];\n                        double weightPercentage = profileData.ScaleModuleWeight(pair.Value);\n\n                        // Get module status for additional info\n                        var moduleStatus = profileData.Report?.GetModuleStatus(module.ModuleName);\n\n                        var moduleInfo = new ProfileExplorer.UI.ModuleEx {\n                            Name = module.ModuleName,\n                            ExclusivePercentage = weightPercentage * 100.0, // convert 0.abcd decimal to ab.cd percent\n                            ExclusiveWeight = pair.Value,\n                            Status = moduleStatus,\n                            DebugFileMissing = moduleStatus != null ? !moduleStatus.HasDebugInfoLoaded : false,\n                        };\n\n                        moduleInfos.Add(moduleInfo);\n                    }\n\n                    return moduleInfos.OrderByDescending(m => m.ExclusivePercentage).ToArray();\n                }\n                catch\n                {\n                    return Array.Empty<ProfileExplorer.UI.ModuleEx>();\n                }\n            });\n        }\n        catch\n        {\n            return Array.Empty<ProfileExplorer.UI.ModuleEx>();\n        }\n    }\n\n    /// <summary>\n    /// Extract full path for a module if available\n    /// </summary>\n    private string ExtractModuleFullPath(string moduleName)\n    {\n        try\n        {\n            var sessionState = mainWindow.SessionState;\n            var profileData = sessionState?.ProfileData;\n            \n            if (profileData?.Modules != null)\n            {\n                // Look for a module with matching name\n                var module = profileData.Modules.FirstOrDefault(m => \n                    string.Equals(m.Value.ModuleName, moduleName, StringComparison.OrdinalIgnoreCase) ||\n                    Path.GetFileName(m.Value.FilePath).Equals(moduleName, StringComparison.OrdinalIgnoreCase));\n                \n                return module.Value?.FilePath;\n            }\n\n            return null;\n        }\n        catch\n        {\n            return null;\n        }\n    }\n}\n"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/CallTreeOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.CallTreeOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <!-- <CheckBox -->\n          <!--   Margin=\"0,2,0,2\" -->\n          <!--   Content=\"Show function details panel\" -->\n          <!--   IsChecked=\"{Binding ShowDetailsPanel, Mode=TwoWay}\" -->\n          <!--   IsEnabled=\"False\" -->\n          <!--   ToolTip=\"NYI: Show the function details panel on the right-hand side\"/> -->\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Sync function in other profiling views\"\n            IsChecked=\"{Binding SyncSelection, Mode=TwoWay}\"\n            ToolTip=\"Sync function displayed in other profiling views with selection\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Sync Source File view with selection\"\n            IsChecked=\"{Binding SyncSourceFile, Mode=TwoWay}\"\n            ToolTip=\"Sync file displayed in the Source File view with selection\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Function nodes\" />\n\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Auto-expand hottest call path\"\n            IsChecked=\"{Binding ExpandHottestPath, Mode=TwoWay}\"\n            ToolTip=\"Show the module name in front of the function name\" />\n\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Append module name before function\"\n            IsChecked=\"{Binding PrependModuleToFunction, Mode=TwoWay}\"\n            ToolTip=\"Show the module name in front of the function name\" />\n          <CheckBox\n            x:Name=\"ShowCallStackPopupCheckbox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Show function details on hover\"\n            IsChecked=\"{Binding ShowNodePopup, Mode=TwoWay}\"\n            ToolTip=\"On mouse hover over a function, show a popup with details.&#x0a;If pinned, the popup expands into a Function Details panel popup\" />\n          <StackPanel\n            Margin=\"20,2,0,2\"\n            IsEnabled=\"{Binding ElementName=ShowCallStackPopupCheckbox, Path=IsChecked}\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              VerticalAlignment=\"Center\"\n              Text=\"Hover duration (ms)\" />\n            <xctk:IntegerUpDown\n              Width=\"70\"\n              Margin=\"8,0,0,0\"\n              Maximum=\"5000\"\n              Minimum=\"50\"\n              ParsingNumberStyle=\"Number\"\n              ShowButtonSpinner=\"True\"\n              Value=\"{Binding Path=NodePopupDuration, Mode=TwoWay}\" />\n            <Button\n              Height=\"20\"\n              Margin=\"4,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"ResetCallStackPopupDurationButton_Click\"\n              Content=\"Default\"\n              ToolTip=\"Reset value to default duration\" />\n            <Button\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"ShortCallStackPopupDurationButton_Click\"\n              Content=\"Short\"\n              ToolTip=\"Reset value to default duration\" />\n            <Button\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"LongCallStackPopupDurationButton_Click\"\n              Content=\"Long\"\n              ToolTip=\"Reset value to default duration\" />\n          </StackPanel>\n\n        </StackPanel>\n      </TabItem>\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/CallTreeOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class CallTreeOptionsPanel : OptionsPanelBase {\n  public CallTreeOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override double DefaultHeight => 450;\n  public override double DefaultWidth => 400;\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n  }\n\n  private void ResetCallStackPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((CallTreeSettings)Settings).NodePopupDuration = CallTreeSettings.DefaultNodePopupDuration;\n    ReloadSettings();\n  }\n\n  private void ShortCallStackPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((CallTreeSettings)Settings).NodePopupDuration = HoverPreview.HoverDurationMs;\n    ReloadSettings();\n  }\n\n  private void LongCallStackPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((CallTreeSettings)Settings).NodePopupDuration = HoverPreview.LongHoverDurationMs;\n    ReloadSettings();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/ColumnOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.ColumnOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"300\"\n  d:DesignWidth=\"280\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel Margin=\"4,4,4,4\">\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Column Style\" />\n\n      <StackPanel\n        Margin=\"0,2,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"115\"\n          VerticalAlignment=\"Center\"\n          Text=\"Show background\" />\n        <ComboBox\n          x:Name=\"ShowBackgroundComboBox\"\n          Width=\"120\"\n          Height=\"20\"\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          DisplayMemberPath=\"Value\"\n          SelectedValue=\"{Binding Path=UseBackColor, Mode=TwoWay}\"\n          SelectedValuePath=\"Key\" />\n      </StackPanel>\n      <StackPanel\n        Margin=\"0,2,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"115\"\n          VerticalAlignment=\"Center\"\n          Text=\"Show percentage bar\" />\n        <ComboBox\n          x:Name=\"ShowPercentageComboBox\"\n          Width=\"120\"\n          Height=\"20\"\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          DisplayMemberPath=\"Value\"\n          SelectedValue=\"{Binding Path=ShowPercentageBar, Mode=TwoWay}\"\n          SelectedValuePath=\"Key\" />\n      </StackPanel>\n      <StackPanel\n        Margin=\"0,2,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"115\"\n          VerticalAlignment=\"Center\"\n          Text=\"Show icon\" />\n        <ComboBox\n          x:Name=\"ShowIconsComboBox\"\n          Width=\"120\"\n          Height=\"20\"\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          DisplayMemberPath=\"Value\"\n          SelectedValue=\"{Binding Path=ShowIcon, Mode=TwoWay}\"\n          SelectedValuePath=\"Key\" />\n      </StackPanel>\n      <StackPanel\n        Margin=\"0,4,0,2\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Title\" />\n        <TextBox\n          Width=\"208\"\n          MinWidth=\"188\"\n          Margin=\"8,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"{Binding AlternateTitle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n          ToolTip=\"Alternate column title to use instead of the default one\" />\n      </StackPanel>\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Pick background color based on percentage\"\n        IsChecked=\"{Binding PickColorForPercentage, Mode=TwoWay}\" />\n\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Colors\" />\n      <Grid Margin=\"0,4,0,0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding TextColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Column text color\" />\n      </Grid>\n      <Grid Margin=\"0,2,0,0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding BackgroundColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Column background color\" />\n      </Grid>\n      <Grid Margin=\"0,2,0,0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding PercentageBarBackColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Percentage bar color\" />\n      </Grid>\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/ColumnOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class ColumnOptionsPanel : OptionsPanelBase {\n  public ColumnOptionsPanel() {\n    InitializeComponent();\n    ShowIconsComboBox.ItemsSource = PartVisibilityKinds;\n    ShowBackgroundComboBox.ItemsSource = PartVisibilityKinds;\n    ShowPercentageComboBox.ItemsSource = PartVisibilityKinds;\n  }\n\n  public override double DefaultHeight => 340;\n  public override double MinimumHeight => 340;\n  public override double DefaultWidth => 280;\n  public override double MinimumWidth => 300;\n  public Dictionary<OptionalColumnStyle.PartVisibility, string>\n    PartVisibilityKinds { get; } =\n    new() {\n      {OptionalColumnStyle.PartVisibility.Always, \"Always\"},\n      {OptionalColumnStyle.PartVisibility.Never, \"Never\"},\n      {OptionalColumnStyle.PartVisibility.IfActiveColumn, \"If Active Column\"}\n    };\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/DiffOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.DiffOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:settings=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:core2ui=\"clr-namespace:ProfileExplorer.Core.Diff;assembly=ProfileExplorerCore\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"560\"\n  d:DesignWidth=\"340 \"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Displayed changes\" />\n          <StackPanel\n            Margin=\"0,4,0,2\"\n            Orientation=\"Horizontal\">\n            <ToggleButton\n              Margin=\"0,0,2,0\"\n              Padding=\"4,0,4,0\"\n              Content=\"Insertions\"\n              IsChecked=\"{Binding ShowInsertions, Mode=TwoWay}\"\n              ToolTip=\"Show inserted lines in the diff view\" />\n            <ToggleButton\n              Margin=\"2,0,2,0\"\n              Padding=\"4,0,4,0\"\n              Content=\"Deletions\"\n              IsChecked=\"{Binding ShowDeletions, Mode=TwoWay}\"\n              ToolTip=\"Show deleted lines in the diff view\" />\n            <ToggleButton\n              Margin=\"2,0,2,0\"\n              Padding=\"4,0,4,0\"\n              Content=\"Modifications\"\n              IsChecked=\"{Binding ShowModifications, Mode=TwoWay}\"\n              ToolTip=\"Show modified lines in the diff view\" />\n            <ToggleButton\n              Margin=\"2,0,2,0\"\n              Padding=\"4,0,4,0\"\n              Content=\"Minor modifications\"\n              IsChecked=\"{Binding ShowMinorModifications, Mode=TwoWay}\"\n              ToolTip=\"Show minor, insignificant modifications in the diff view\" />\n          </StackPanel>\n\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Diffs Handling\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Mark minor IR modifications differently\"\n            IsChecked=\"{Binding IdentifyMinorDiffs, Mode=TwoWay}\"\n            ToolTip=\"Makr minor changes in the IR, such as different kinds of temporary variables\" />\n          <CheckBox\n            Margin=\"20,4,0,2\"\n            Content=\"Temporary variable name changes\"\n            IsChecked=\"{Binding FilterTempVariableNames, Mode=TwoWay}\"\n            ToolTip=\"Treat name changes of temporary variables as minor\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"SSA variable identifier changes\"\n            IsChecked=\"{Binding FilterSSADefNumbers, Mode=TwoWay}\"\n            ToolTip=\"Treat changes of SSA variable identifiers (name/number) as minor\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Filter out insignificant, noisy changes\"\n            IsChecked=\"{Binding FilterInsignificantDiffs, Mode=TwoWay}\"\n            ToolTip=\"Ignore changes in whitespace and punctuation characters\" />\n          <CheckBox\n            Name=\"WholeNameCheckbox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Mark whole line if most parts changed\"\n            IsChecked=\"{Binding ManyDiffsMarkWholeLine, Mode=TwoWay}\"\n            ToolTip=\"Combine multiple small changes in a line into one line change\" />\n          <TextBlock\n            Margin=\"20,4,0,2\"\n            Text=\"Mark as modified line change percentage\" />\n          <StackPanel\n            Margin=\"20,0,0,4\"\n            HorizontalAlignment=\"Stretch\"\n            Orientation=\"Horizontal\">\n            <Slider\n              Width=\"150\"\n              Foreground=\"{DynamicResource DisabledForegroundBrush}\"\n              IsEnabled=\"{Binding ElementName=WholeNameCheckbox, Path=IsChecked}\"\n              Maximum=\"100\"\n              Minimum=\"1\"\n              TickFrequency=\"5\"\n              TickPlacement=\"BottomRight\"\n              ToolTip=\"Percentage of changed letters in the line for it to be marked entirely\"\n              Value=\"{Binding ManyDiffsModificationPercentage, Mode=TwoWay}\" />\n            <TextBlock\n              Margin=\"8,0,0,0\"\n              Text=\"{Binding ManyDiffsModificationPercentage}\" />\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              Text=\"%\" />\n          </StackPanel>\n\n          <TextBlock\n            Margin=\"20,2,0,2\"\n            Text=\"Mark as inserted/deleted line change percentage\" />\n          <StackPanel\n            Margin=\"20,0,0,4\"\n            HorizontalAlignment=\"Stretch\"\n            Orientation=\"Horizontal\">\n            <Slider\n              Width=\"150\"\n              Foreground=\"{DynamicResource DisabledForegroundBrush}\"\n              IsEnabled=\"{Binding ElementName=WholeNameCheckbox, Path=IsChecked}\"\n              Maximum=\"100\"\n              Minimum=\"1\"\n              TickFrequency=\"5\"\n              TickPlacement=\"BottomRight\"\n              ToolTip=\"Percentage of changed letters in the line for it to be marked entirely\"\n              Value=\"{Binding ManyDiffsInsertionPercentage, Mode=TwoWay}\" />\n            <TextBlock\n              Margin=\"8,0,0,0\"\n              Text=\"{Binding ManyDiffsInsertionPercentage}\" />\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              Text=\"%\" />\n          </StackPanel>\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Diff Implementation\" />\n          <StackPanel\n            Margin=\"0,4,0,0\"\n            Orientation=\"Vertical\">\n            <RadioButton\n              Content=\"Internal\"\n              IsChecked=\"{Binding DiffImplementation, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static core2ui:DiffImplementationKind.Internal}}\"\n              ToolTip=\"Use the internal diff implementation, which is faster but less accurate\" />\n            <RadioButton\n              x:Name=\"ExternalDiffRadioButton\"\n              Margin=\"0,2,0,2\"\n              Content=\"Beyond Compare\"\n              IsChecked=\"{Binding DiffImplementation, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static core2ui:DiffImplementationKind.External}}\"\n              ToolTip=\"Use Beyond Compare as the external diff tool (requires Beyond Compare to be installed)\" />\n            <DockPanel\n              Margin=\"0,2,0,2\"\n              LastChildFill=\"True\">\n              <TextBlock\n                Margin=\"20,0,0,0\"\n                VerticalAlignment=\"Center\"\n                Text=\"Path\" />\n              <Grid DockPanel.Dock=\"Right\">\n                <controls:FileSystemTextBox\n                  x:Name=\"ExternalAppPathTextbox\"\n                  Height=\"20\"\n                  Margin=\"8,0,62,0\"\n                  BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                  IsEnabled=\"{Binding ElementName=ExternalDiffRadioButton, Path=IsChecked}\"\n                  Text=\"{Binding ExternalDiffAppPath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n                  ToolTip=\"Path to the Beyond Compare executable\" />\n                <Button\n                  Name=\"ExternalAppPathButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"0,0,41,0\"\n                  HorizontalAlignment=\"Right\"\n                  Click=\"ExternalAppPathButton_Click\"\n                  Content=\"...\"\n                  IsEnabled=\"{Binding ElementName=ExternalDiffRadioButton, Path=IsChecked}\"\n                  ToolTip=\"Browse to select the location of the Beyond Compare executable\" />\n                <Button\n                  Name=\"DefaultAppPathButton\"\n                  Width=\"40\"\n                  Height=\"20\"\n                  HorizontalAlignment=\"Right\"\n                  Click=\"DefaultAppPathButton_Click\"\n                  Content=\"Detect\"\n                  IsEnabled=\"{Binding ElementName=ExternalDiffRadioButton, Path=IsChecked}\"\n                  ToolTip=\"Auto-detect the location of the Beyond Compare executable\" />\n              </Grid>\n            </DockPanel>\n          </StackPanel>\n        </StackPanel>\n      </TabItem>\n\n      <TabItem\n        Header=\"Appearance\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Diffs Colors\" />\n          <StackPanel\n            Margin=\"0,4,0,0\"\n            Orientation=\"Vertical\">\n\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                x:Name=\"InsertionColorPicker\"\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding InsertionColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Insertion color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                x:Name=\"InsertionBorderColorPicker\"\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding InsertionBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Insertion border color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding DeletionColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Deletion color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding DeletionBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Deletion border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding ModificationColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Modification color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding ModificationBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Modification border color\" />\n            </Grid>\n\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding MinorModificationColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Minor modification color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding MinorModificationBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Minor modification border color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding PlaceholderBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Placeholder (empty lines) pattern color\" />\n            </Grid>\n          </StackPanel>\n        </StackPanel>\n      </TabItem>\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/DiffOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing Microsoft.Win32;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.UI.Diff;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class DiffOptionsPanel : OptionsPanelBase {\n  public const double DefaultHeight = 650;\n  public const double MinimumHeight = 200;\n  public const double DefaultWidth = 360;\n  public const double MinimumWidth = 360;\n\n  public DiffOptionsPanel() {\n    InitializeComponent();\n    ExternalAppPathTextbox.ExtensionFilter = \"*.exe\";\n  }\n\n  private void ExternalAppPathButton_Click(object sender, RoutedEventArgs e) {\n    using var centerForm = new DialogCenteringHelper(this);\n\n    var fileDialog = new OpenFileDialog {\n      DefaultExt = \"bcompare.exe\",\n      Filter = \"BC executables|bcompare.exe\"\n    };\n\n    bool? result = fileDialog.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      ExternalAppPathTextbox.Text = fileDialog.FileName;\n    }\n  }\n\n  private void DefaultAppPathButton_Click(object sender, RoutedEventArgs e) {\n    string path = BeyondCompareDiffBuilder.FindBeyondCompareExecutable();\n\n    if (!string.IsNullOrEmpty(path)) {\n      ExternalAppPathTextbox.Text = path;\n    }\n    else {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show(\"Could not find Beyond Compare executable\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/DocumentOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.DocumentOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:utilities=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:xctk=\"clr-namespace:Xceed.Wpf.Toolkit;assembly=DotNetProjects.Wpf.Extended.Toolkit\"\n  d:DesignHeight=\"600\"\n  d:DesignWidth=\"400\"\n  mc:Ignorable=\"d\">\n\n  <local:OptionsPanelBase.Resources>\n    <CollectionViewSource\n      x:Key=\"FontCollection\"\n      Source=\"{Binding Source={x:Static Fonts.SystemFontFamilies}}\" />\n    <utilities:FontFamilyConverter x:Key=\"FontFamilyConverter\" />\n\n    <DataTemplate x:Key=\"ColorPickerItemList\">\n      <Grid>\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"#707070\"\n          SelectedColor=\"{Binding Path=Value, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"{Binding Path=Name}\" />\n      </Grid>\n    </DataTemplate>\n  </local:OptionsPanelBase.Resources>\n\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel\n          Grid.Row=\"0\"\n          Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Document Style\" />\n          <StackPanel\n            Margin=\"0,4,0,2\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              Width=\"50\"\n              VerticalAlignment=\"Center\"\n              Text=\"IR syntax\" />\n            <ComboBox\n              Name=\"IRSyntaxCombobox\"\n              Width=\"180\"\n              Margin=\"4,0,0,0\"\n              VerticalAlignment=\"Center\"\n              DisplayMemberPath=\"Name\"\n              SelectedIndex=\"0\" />\n\n            <ToggleButton\n              x:Name=\"SyntaxEditButton\"\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"4,0,0,0\"\n              HorizontalAlignment=\"Right\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"SyntaxEditButton_Click\"\n              DockPanel.Dock=\"Right\"\n              IsEnabled=\"{Binding HasItems, ElementName=IRSyntaxCombobox}\"\n              ToolTip=\"Edit colors used by selected IR syntax highlighting\">\n              <Image Source=\"{StaticResource ThemeIcon}\" />\n            </ToggleButton>\n\n            <Button\n              x:Name=\"OpenSyntaxStyleButton\"\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              HorizontalAlignment=\"Right\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"OpenSyntaxStyleButton_Click\"\n              DockPanel.Dock=\"Right\"\n              ToolTip=\"Open the directory with the IR syntax highlighting files\">\n              <Image Source=\"{StaticResource FolderIcon}\" />\n            </Button>\n\n            <Button\n              x:Name=\"ReloadSyntaxStyleButton\"\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              HorizontalAlignment=\"Right\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"ReloadSyntaxStyleButton_Click\"\n              DockPanel.Dock=\"Right\"\n              ToolTip=\"Reload all IR syntax highlighting files\">\n              <Image Source=\"{StaticResource ReloadIcon}\" />\n            </Button>\n\n          </StackPanel>\n\n          <Border\n            x:Name=\"SyntaxHighlightingPanel\"\n            Height=\"Auto\"\n            Margin=\"0,4,0,4\"\n            Padding=\"4,4,4,4\"\n            BorderBrush=\"#707070\"\n            BorderThickness=\"1,1,1,1\"\n            Visibility=\"Collapsed\">\n            <StackPanel Orientation=\"Vertical\">\n              <StackPanel Orientation=\"Horizontal\">\n                <TextBlock\n                  Margin=\"0,0,0,4\"\n                  FontWeight=\"Medium\"\n                  Text=\"Syntax Highlighting Colors\" />\n                <Button\n                  x:Name=\"ResetSyntaxStyleButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"8,0,0,0\"\n                  Padding=\"0,2,0,-1\"\n                  HorizontalAlignment=\"Right\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  Click=\"ResetSyntaxStyleButton_Click\"\n                  DockPanel.Dock=\"Right\"\n                  ToolTip=\"Reset the syntax highlighting file to initial state\">\n                  <Image Source=\"{StaticResource UndoIcon}\" />\n                </Button>\n\n                <Button\n                  x:Name=\"EditSyntaxFileButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Right\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  Click=\"EditSyntaxFileButton_Click\"\n                  DockPanel.Dock=\"Right\"\n                  ToolTip=\"Edit the syntax highlighting file in external text editor\">\n                  <Image Source=\"{StaticResource EditIcon}\" />\n                </Button>\n\n              </StackPanel>\n              <ItemsControl\n                x:Name=\"SyntaxHighlightingColorPickers\"\n                ItemTemplate=\"{StaticResource ColorPickerItemList}\">\n                <ItemsControl.ItemsPanel>\n                  <ItemsPanelTemplate>\n                    <StackPanel Orientation=\"Vertical\" />\n                  </ItemsPanelTemplate>\n                </ItemsControl.ItemsPanel>\n              </ItemsControl>\n            </StackPanel>\n          </Border>\n\n          <StackPanel\n            Margin=\"0,0,0,2\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              Width=\"50\"\n              VerticalAlignment=\"Center\"\n              Text=\"Font\" />\n            <ComboBox\n              Width=\"180\"\n              Margin=\"4,0,0,0\"\n              VerticalAlignment=\"Center\"\n              IsSynchronizedWithCurrentItem=\"True\"\n              ItemsSource=\"{Binding Source={StaticResource FontCollection}}\"\n              SelectedValue=\"{Binding Path=FontName, Mode=TwoWay, Converter={StaticResource FontFamilyConverter}}\" />\n          </StackPanel>\n          <StackPanel\n            Margin=\"0,0,0,2\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              Width=\"50\"\n              VerticalAlignment=\"Center\"\n              Text=\"Font size\" />\n            <xctk:DoubleUpDown\n              Margin=\"4,0,0,0\"\n              Increment=\"1\"\n              Maximum=\"36.0\"\n              Minimum=\"5.0\"\n              ParsingNumberStyle=\"Number\"\n              ShowButtonSpinner=\"True\"\n              Value=\"{Binding Path=FontSize, Mode=TwoWay}\" />\n          </StackPanel>\n\n          <CheckBox\n            Margin=\"0,8,0,2\"\n            Content=\"Highlight current text line\"\n            IsChecked=\"{Binding Path=HighlightCurrentLine, Mode=TwoWay}\"\n            ToolTip=\"Mark the current line in the document with a border\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Show block separator lines\"\n            IsChecked=\"{Binding Path=ShowBlockSeparatorLine, Mode=TwoWay}\"\n            ToolTip=\"Draw a line between blocks in the document\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Allow block folding\"\n            IsChecked=\"{Binding Path=ShowBlockFolding, Mode=TwoWay}\"\n            ToolTip=\"Enable the ability to fold blocks in the document\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"IR Value Interaction\" />\n\n          <CheckBox\n            x:Name=\"HighlightDefinitionCheckbox\"\n            Margin=\"0,4,0,2\"\n            Content=\"Highlight definition(s) of selected source value\"\n            IsChecked=\"{Binding Path=HighlightSourceDefinition, Mode=TwoWay}\"\n            ToolTip=\"Mark the definition operands of the selected source operand\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Consider only reaching definitions\"\n            IsChecked=\"{Binding Path=FilterSourceDefinitions, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=HighlightDefinitionCheckbox, Path=IsChecked}\"\n            ToolTip=\"Filter out any definition that can't reach the source value in the flow graph\" />\n          <CheckBox\n            x:Name=\"HighlightUsesCheckbox\"\n            Margin=\"0,4,0,2\"\n            Content=\"Highlight uses of selected destination value\"\n            IsChecked=\"{Binding Path=HighlightDestinationUses, Mode=TwoWay}\"\n            ToolTip=\"Mark the use operands of the selected destination operand\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Consider only reachable uses\"\n            IsChecked=\"{Binding Path=FilterDestinationUses, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=HighlightUsesCheckbox, Path=IsChecked}\"\n            ToolTip=\"Filter out any use that can't be reached by the destination value in the flow graph\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Highlight definitions of all sources of selected instruction\"\n            IsChecked=\"{Binding Path=HighlightInstructionOperands, Mode=TwoWay}\"\n            ToolTip=\"Mark the definition operands of all source operands of the selected instruction\" />\n\n          <CheckBox\n            x:Name=\"HoverCheckbox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Show additional value info on hover\"\n            IsChecked=\"{Binding Path=ShowInfoOnHover, Mode=TwoWay}\" />\n\n          <CheckBox\n            x:Name=\"ShowPreviewCheckbox\"\n            Margin=\"20,2,0,2\"\n            Content=\"Show definition preview popup on hover\"\n            IsChecked=\"{Binding Path=ShowPreviewPopup, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=HoverCheckbox, Path=IsChecked}\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Only when a modifier key is pressed (Shift/Ctrl/Alt)\"\n            IsChecked=\"{Binding Path=ShowInfoOnHoverWithModifier, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=HoverCheckbox, Path=IsChecked}\" />\n          <TextBlock\n            Margin=\"0,12,0,0\"\n            FontSize=\"11\"\n            Text=\"Combine with Ctrl key to consider expressions when highlighting.\" />\n          <TextBlock\n            Margin=\"0,2,0,0\"\n            FontSize=\"11\"\n            Text=\"Combine with Shift key to all references when highlighting.\" />\n\n        </StackPanel>\n      </TabItem>\n\n      <TabItem\n        Header=\"Appearance\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n\n          <DockPanel>\n            <TextBlock\n              FontWeight=\"Medium\"\n              Text=\"Document Colors\" />\n            <Button\n              x:Name=\"StyleButton\"\n              Width=\"20\"\n              Height=\"20\"\n              HorizontalAlignment=\"Right\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"StyleButton_Click\"\n              DockPanel.Dock=\"Right\"\n              ToolTip=\"Use a custom document colors style\">\n              <Image Source=\"{StaticResource StyleIcon}\" />\n              <Button.ContextMenu>\n                <ContextMenu x:Name=\"StyleContextMenu\">\n                  <MenuItem Header=\"Default\" />\n                </ContextMenu>\n              </Button.ContextMenu>\n            </Button>\n          </DockPanel>\n          <StackPanel\n            Margin=\"0,2,0,0\"\n            Orientation=\"Vertical\">\n\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                IsManipulationEnabled=\"True\"\n                SelectedColor=\"{Binding Path=BackgroundColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Background color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=AlternateBackgroundColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Background color (alternate)\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=TextColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Default text color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=CurrentLineBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Current line border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=BlockSeparatorColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Block separator color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=MarginBackgroundColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Left margin background color\" />\n            </Grid>\n          </StackPanel>\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"IR Value Colors\" />\n          <StackPanel\n            Margin=\"0,4,0,0\"\n            Orientation=\"Vertical\">\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SelectedValueColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Selected value color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=DefinitionValueColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Source definition value color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=UseValueColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Destination use values color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=BorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Border color\" />\n            </Grid>\n          </StackPanel>\n        </StackPanel>\n      </TabItem>\n      <TabItem\n        Header=\"Source File\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Options for code annotations based on source code debug info\">\n        <StackPanel\n          x:Name=\"SourceOptionsPanel\"\n          Margin=\"4,4,4,4\">\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Annotate instrs. with source line numbers\"\n            IsChecked=\"{Binding Path=AnnotateSourceLines, Mode=TwoWay}\"\n            ToolTip=\"Append the associated source code line based on the debug info file\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Annotate instrs. with inlined functions trace (inlinees)\"\n            IsChecked=\"{Binding Path=AnnotateInlinees, Mode=TwoWay}\"\n            ToolTip=\"Append the associated list of inlined functions (inlinees) based on the debug info file\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Use links for call instruction targets\"\n            IsChecked=\"{Binding Path=MarkCallTargets, Mode=TwoWay}\"\n            ToolTip=\"Underline the names of the called functions whose code is available.&#x0a;Double-click opens the target function in the current view.\" />\n          <TextBlock\n            Margin=\"0,6,0,0\"\n            FontSize=\"11\"\n            Text=\"Double-click on call target navigates to function.\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Annotation Colors\" />\n          <StackPanel\n            Margin=\"0,4,0,0\"\n            Orientation=\"Vertical\">\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SourceLineTextColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Line number text color\" />\n            </Grid>\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SourceLineBackColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Line number background color\" />\n            </Grid>\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=InlineeOverlayTextColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Inlined functions text color\" />\n            </Grid>\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=InlineeOverlayBackColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Inlined functions background color\" />\n            </Grid>\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=CallTargetTextColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Call target function text color\" />\n            </Grid>\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=CallTargetBackColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Call target function background color\" />\n            </Grid>\n          </StackPanel>\n        </StackPanel>\n      </TabItem>\n      <TabItem\n        Header=\"Profiling\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Options for profiling UI and code annotations\">\n        <local:DocumentProfilingOptionsPanel\n          x:Name=\"ProfilingOptionsPanel\"\n          ShowsDocumentSettings=\"True\" />\n      </TabItem>\n\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/DocumentOptionsPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Media;\nusing System.Xml;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class DocumentOptionsPanel : OptionsPanelBase {\n  private const string DocumentStylesFilePath = @\"documentStyles.xml\";\n  private bool syntaxEditPanelVisible_;\n  private List<ColorPickerInfo> syntaxHighlightingColors_;\n  private DocumentColorStyle syntaxHighlightingStyle_;\n  private List<SyntaxFileInfo> syntaxFiles_;\n  private SyntaxFileInfo selectedSyntaxFile_;\n  private DocumentSettings settings_;\n\n  public DocumentOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override double DefaultHeight => 470;\n  public bool SyntaxFileChanged { get; set; }\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n    settings_ = (DocumentSettings)Settings;\n    ProfilingOptionsPanel.DataContext = settings_.ProfileMarkerSettings;\n    SourceOptionsPanel.DataContext = settings_.SourceMarkerSettings;\n    ReloadSyntaxHighlightingList();\n  }\n\n  public override void OnSettingsChanged(object newSettings) {\n    settings_ = (DocumentSettings)newSettings;\n    ProfilingOptionsPanel.DataContext = null;\n    ProfilingOptionsPanel.DataContext = settings_.ProfileMarkerSettings;\n    SourceOptionsPanel.DataContext = null;\n    SourceOptionsPanel.DataContext = settings_.SourceMarkerSettings;\n    ReloadSyntaxHighlightingList();\n  }\n\n  public override void PanelClosing() {\n    SyntaxFileChanged = UpdateSyntaxHighlightingStyle();\n  }\n\n  public override void PanelResetting() {\n    syntaxHighlightingStyle_ = null;\n    syntaxHighlightingColors_ = null;\n  }\n\n  public override void PanelAfterReset() {\n    if (syntaxEditPanelVisible_) {\n      ShowSyntaxEditPanel(null);\n    }\n  }\n\n  private void ReloadSyntaxHighlightingList() {\n    syntaxFiles_ = App.ReloadSyntaxHighlightingFiles(App.Session.CompilerInfo.CompilerIRName);\n    selectedSyntaxFile_ = App.GetSyntaxHighlightingFileInfo(settings_.SyntaxHighlightingName,\n                                                            App.Session.CompilerInfo.CompilerIRName);\n\n    // Unbind the combobox event while loading the list\n    // so that it doesn't change the selected syntax file.\n    IRSyntaxCombobox.SelectionChanged -= IRSyntaxCombobox_SelectionChanged;\n    IRSyntaxCombobox.ItemsSource = new CollectionView(syntaxFiles_);\n    IRSyntaxCombobox.SelectedItem = selectedSyntaxFile_;\n    IRSyntaxCombobox.SelectionChanged += IRSyntaxCombobox_SelectionChanged;\n  }\n\n  protected override void NotifySettingsChanged() {\n    SyntaxFileChanged = DataContext != null && UpdateSyntaxHighlightingStyle();\n    base.NotifySettingsChanged();\n  }\n\n  private void StyleButton_Click(object sender, RoutedEventArgs e) {\n    try {\n      var docStyles = LoadDocumentStyles(DocumentStylesFilePath);\n      StyleContextMenu.Items.Clear();\n\n      foreach (var style in docStyles) {\n        var menuItem = new MenuItem();\n        menuItem.Header = style.Name;\n        menuItem.Tag = style;\n        menuItem.Click += StyleContextMenuItem_Click;\n        StyleContextMenu.Items.Add(menuItem);\n      }\n\n      if (Parent is OptionsPanelHostPopup popup) {\n        popup.StaysOpen = true;\n        StyleContextMenu.Closed += StyleContextMenu_Closed;\n      }\n\n      StyleContextMenu.IsOpen = true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load style document XML: {ex}\");\n    }\n  }\n\n  private void StyleContextMenu_Closed(object sender, RoutedEventArgs e) {\n    var popup = Parent as OptionsPanelHostPopup;\n    popup.StaysOpen = false;\n  }\n\n  private void StyleContextMenuItem_Click(object sender, RoutedEventArgs e) {\n    var style = ((MenuItem)sender).Tag as DocumentColorStyle;\n    ApplyDocumentStyle(style);\n  }\n\n  private void ApplyDocumentStyle(DocumentColorStyle style) {\n    settings_.BackgroundColor = style.Colors[\"BackgroundColor\"];\n    settings_.AlternateBackgroundColor = style.Colors[\"AlternateBackgroundColor\"];\n    settings_.MarginBackgroundColor = style.Colors[\"MarginBackgroundColor\"];\n    settings_.BlockSeparatorColor = style.Colors[\"BlockSeparatorColor\"];\n    settings_.TextColor = style.Colors[\"TextColor\"];\n    settings_.SelectedValueColor = style.Colors[\"SelectedValueColor\"];\n    settings_.DefinitionValueColor = style.Colors[\"DefinitionValueColor\"];\n    settings_.UseValueColor = style.Colors[\"UseValueColor\"];\n    settings_.BorderColor = style.Colors[\"BorderColor\"];\n    DataContext = null;\n    DataContext = settings_;\n    NotifySettingsChanged();\n  }\n\n  private void PopulateSyntaxHighlightingColorPickers(DocumentColorStyle style) {\n    syntaxHighlightingStyle_ = style;\n    syntaxHighlightingColors_ = new List<ColorPickerInfo>();\n\n    foreach (var pair in style.Colors) {\n      syntaxHighlightingColors_.Add(new ColorPickerInfo(pair.Key, pair.Value));\n    }\n\n    SyntaxHighlightingColorPickers.ItemsSource = new CollectionView(syntaxHighlightingColors_);\n  }\n\n  private bool UpdateSyntaxHighlightingStyle() {\n    if (selectedSyntaxFile_ == null) {\n      return false; // Happens if there are no syntax files found.\n    }\n\n    return CreateSyntaxHighlightingStyle(selectedSyntaxFile_.Path, selectedSyntaxFile_.Path);\n  }\n\n  private bool CreateSyntaxHighlightingStyle(string inputFile, string outputFile) {\n    if (syntaxHighlightingStyle_ == null) {\n      return false;\n    }\n\n    foreach (var info in syntaxHighlightingColors_) {\n      syntaxHighlightingStyle_.Colors[info.Name] = info.Value;\n    }\n\n    string newSyntaxFile = App.GetSyntaxHighlightingFilePath(outputFile, App.Session.CompilerInfo.CompilerIRName);\n    ApplySyntaxHighlightingStyles(inputFile, newSyntaxFile, syntaxHighlightingStyle_);\n    return true;\n  }\n\n  private DocumentColorStyle ApplySyntaxHighlightingStyles(string stylePath,\n                                                           string outputStylePath = null,\n                                                           DocumentColorStyle replacementStyles = null) {\n    var xmlDoc = new XmlDocument();\n    xmlDoc.Load(stylePath);\n    var root = xmlDoc.DocumentElement;\n    string name = root.Attributes.GetNamedItem(\"name\").InnerText;\n    var docStyle = new DocumentColorStyle(name);\n\n    foreach (XmlNode node in root.ChildNodes) {\n      if (node.Name != \"Color\") {\n        continue;\n      }\n\n      string colorName = node.Attributes.GetNamedItem(\"name\").InnerText;\n      var colorNode = node.Attributes.GetNamedItem(\"foreground\");\n\n      if (replacementStyles != null) {\n        if (!replacementStyles.Colors.ContainsKey(colorName)) {\n          continue;\n        }\n\n        var newColor = replacementStyles.Colors[colorName];\n        colorNode.Value = $\"#{newColor.R:X2}{newColor.G:X2}{newColor.B:X2}\";\n      }\n      else {\n        docStyle.Colors[colorName] = Utils.ColorFromString(colorNode.InnerText);\n      }\n    }\n\n    if (outputStylePath != null) {\n      xmlDoc.Save(outputStylePath);\n    }\n\n    return docStyle;\n  }\n\n  private List<DocumentColorStyle> LoadDocumentStyles(string stylePath) {\n    //? TODO: This should be a JSOn doc, easier to read and same foramt as other settings\n    var xmlDoc = new XmlDocument();\n    xmlDoc.Load(stylePath);\n    var docStyles = new List<DocumentColorStyle>();\n    var styles = xmlDoc.SelectNodes(\"/SyntaxDefinitions/SyntaxDefinition\");\n\n    foreach (XmlNode style in styles) {\n      string name = style.Attributes.GetNamedItem(\"name\").InnerText;\n      var docStyle = new DocumentColorStyle(name);\n      docStyles.Add(docStyle);\n\n      foreach (XmlNode color in style.ChildNodes) {\n        string colorName = color.Attributes.GetNamedItem(\"name\").InnerText;\n        string colorValue = color.Attributes.GetNamedItem(\"background\").InnerText;\n        docStyle.Colors[colorName] = Utils.ColorFromString(colorValue);\n      }\n    }\n\n    return docStyles;\n  }\n\n  private void SyntaxEditButton_Click(object sender, RoutedEventArgs e) {\n    if (!syntaxEditPanelVisible_) {\n      ShowSyntaxEditPanel(null);\n    }\n    else {\n      HideSyntaxEditPanel();\n    }\n  }\n\n  private void ShowSyntaxEditPanel(string filePath, bool force = false) {\n    if (syntaxEditPanelVisible_ && !force) {\n      return;\n    }\n\n    filePath ??= App.GetSyntaxHighlightingFilePath(selectedSyntaxFile_);\n    var compilerStyle = ApplySyntaxHighlightingStyles(filePath);\n    PopulateSyntaxHighlightingColorPickers(compilerStyle);\n    SyntaxHighlightingPanel.Visibility = Visibility.Visible;\n    SyntaxEditButton.IsChecked = true;\n    syntaxEditPanelVisible_ = true;\n  }\n\n  private void HideSyntaxEditPanel(bool reset = false) {\n    if (!syntaxEditPanelVisible_) {\n      return;\n    }\n\n    SyntaxHighlightingPanel.Visibility = Visibility.Collapsed;\n    SyntaxEditButton.IsChecked = false;\n    syntaxEditPanelVisible_ = false;\n\n    if (reset) {\n      syntaxHighlightingStyle_ = null;\n    }\n  }\n\n  private void IRSyntaxCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (IRSyntaxCombobox.SelectedItem != null) {\n      bool syntaxPanelVisible = syntaxEditPanelVisible_;\n      HideSyntaxEditPanel();\n\n      selectedSyntaxFile_ = (SyntaxFileInfo)IRSyntaxCombobox.SelectedItem;\n      settings_.SyntaxHighlightingName = selectedSyntaxFile_.Name;\n\n      if (syntaxPanelVisible) {\n        ShowSyntaxEditPanel(selectedSyntaxFile_.Path);\n      }\n    }\n  }\n\n  private void OpenSyntaxStyleButton_Click(object sender, RoutedEventArgs e) {\n    string path = App.GetCompilerSettingsDirectoryPath(App.Session.CompilerInfo.CompilerIRName);\n    App.OpenSettingsFolder(path);\n  }\n\n  private void EditSyntaxFileButton_Click(object sender, RoutedEventArgs e) {\n    string path = selectedSyntaxFile_.Path;\n    App.LaunchSettingsFileEditor(path);\n  }\n\n  private void ResetSyntaxStyleButton_Click(object sender, RoutedEventArgs e) {\n    // Try to restore the internal syntax file.\n    using var centerForm = new DialogCenteringHelper(Parent);\n\n    if (MessageBox.Show(\"Do you want to reset syntax highlighting style?\", \"Profile Explorer\",\n                        MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes) {\n      return;\n    }\n\n    string path =\n      App.GetInternalSyntaxHighlightingFilePath(selectedSyntaxFile_.Name, App.Session.CompilerInfo.CompilerIRName);\n\n    if (path != null) {\n      ShowSyntaxEditPanel(path, true);\n      UpdateSyntaxHighlightingStyle();\n    }\n  }\n\n  private void ReloadSyntaxStyleButton_Click(object sender, RoutedEventArgs e) {\n    ReloadSyntaxHighlightingList();\n  }\n\n  private void CloneSyntaxFileButton_Click(object sender, RoutedEventArgs e) {\n  }\n\n  private class DocumentColorStyle {\n    public DocumentColorStyle(string name) {\n      Name = name;\n      Colors = new Dictionary<string, Color>();\n    }\n\n    public string Name { get; set; }\n    public Dictionary<string, Color> Colors { get; set; }\n  }\n\n  private class ColorPickerInfo {\n    public ColorPickerInfo(string name, Color value) {\n      Name = name;\n      Value = value;\n    }\n\n    public string Name { get; set; }\n    public Color Value { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/DocumentProfilingOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.DocumentProfilingOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel Margin=\"4,4,4,4\">\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Jump to the hottest function line\"\n        IsChecked=\"{Binding JumpToHottestElement, Mode=TwoWay}\" />\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Mark lines based on duration\"\n        IsChecked=\"{Binding MarkElements, Mode=TwoWay}\" />\n      <CheckBox\n        x:Name=\"MarkBlocksCheckbox\"\n        Margin=\"0,2,0,2\"\n        Content=\"Mark blocks based on duration\"\n        IsChecked=\"{Binding MarkBlocks, Mode=TwoWay}\"\n        Visibility=\"{Binding ShowsDocumentSettings, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DocumentProfilingOptionsPanel}}\" />\n      <CheckBox\n        Margin=\"20,2,0,2\"\n        Content=\"Also mark blocks in Flow Graph panel\"\n        IsChecked=\"{Binding MarkBlocksInFlowGraph, Mode=TwoWay}\"\n        IsEnabled=\"{Binding ElementName=MarkBlocksCheckbox, Path=IsChecked}\"\n        Visibility=\"{Binding ShowsDocumentSettings, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DocumentProfilingOptionsPanel}}\" />\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Display called function list for calls\"\n        IsChecked=\"{Binding MarkCallTargets, Mode=TwoWay}\" />\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Columns\" />\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Show icons for hottest lines\"\n        IsChecked=\"{Binding DisplayIcons, Mode=TwoWay}\" />\n      <CheckBox\n        x:Name=\"PercentageBarCheckBox\"\n        Margin=\"0,2,0,2\"\n        Content=\"Show percentage bars\"\n        IsChecked=\"{Binding DisplayPercentageBar, Mode=TwoWay}\" />\n      <StackPanel\n        Margin=\"20,0,0,2\"\n        IsEnabled=\"{Binding ElementName=PercentageBarCheckBox, Path=IsChecked}\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Max width (px)\"\n          ToolTip=\"Maximum width of the percentage bar in the column\" />\n        <xctk:IntegerUpDown\n          Width=\"64\"\n          Margin=\"8,0,0,0\"\n          Increment=\"1\"\n          Maximum=\"100\"\n          Minimum=\"10\"\n          ParsingNumberStyle=\"Integer\"\n          ShowButtonSpinner=\"True\"\n          ToolTip=\"Only show lines with a weight greater than this value\"\n          Value=\"{Binding Path=MaxPercentageBarWidth, Mode=TwoWay}\" />\n        <Button\n          Height=\"20\"\n          Margin=\"8,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Click=\"MaxWidthButton_Click\"\n          Content=\"Default\"\n          ToolTip=\"Reset value to default weight cutoff\" />\n      </StackPanel>\n\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Append time format suffix\"\n        IsChecked=\"{Binding AppendValueUnitSuffix, Mode=TwoWay}\"\n        ToolTip=\"Append the time format suffix (ms) to each value\" />\n\n\n      <StackPanel\n        Margin=\"0,4,0,2\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Time format\" />\n        <ComboBox\n          x:Name=\"ValueUnitComboBox\"\n          Width=\"151\"\n          Height=\"20\"\n          Margin=\"8,0,0,0\"\n          DisplayMemberPath=\"Value\"\n          SelectedValue=\"{Binding ValueUnit, Mode=TwoWay}\"\n          SelectedValuePath=\"Key\" />\n      </StackPanel>\n      <StackPanel\n        Margin=\"0,4,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Weight cutoff (%)\"\n          ToolTip=\"Only show lines with a weight greater than this value\" />\n        <xctk:DoubleUpDown\n          Width=\"65\"\n          Margin=\"14,0,0,0\"\n          FormatString=\"F2\"\n          Increment=\"0.1\"\n          Maximum=\"100\"\n          Minimum=\"0\"\n          ShowButtonSpinner=\"True\"\n          ToolTip=\"Only show lines with a weight greater than this value\"\n          Value=\"{Binding Path=ElementWeightCutoff, Mode=TwoWay, Converter={StaticResource DoubleScalingConverter}, ConverterParameter=100.0}\" />\n        <Button\n          Height=\"20\"\n          Margin=\"8,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Click=\"WeightCutoffButton_Click\"\n          Content=\"Default\"\n          ToolTip=\"Reset value to default weight cutoff\" />\n      </StackPanel>\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Colors\" />\n      <Grid Margin=\"0,4,0,0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding ColumnTextColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Column text color\" />\n      </Grid>\n      <Grid Margin=\"0,2,0,0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding PercentageBarBackColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Percentage bar color\" />\n      </Grid>\n      <Grid Margin=\"0,2,0,0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding PerformanceCounterBackColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Performance counter column color\" />\n      </Grid>\n      <Grid Margin=\"0,2,0,0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding PerformanceMetricBackColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Performance metric column color\" />\n      </Grid>\n      <Grid\n        Margin=\"0,2,0,0\"\n        IsEnabled=\"{Binding ElementName=MarkBlocksCheckbox, Path=IsChecked}\"\n        Visibility=\"{Binding ShowsDocumentSettings, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DocumentProfilingOptionsPanel}}\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding BlockOverlayTextColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Marked block text color\" />\n      </Grid>\n      <Grid\n        Margin=\"0,2,0,0\"\n        IsEnabled=\"{Binding ElementName=MarkBlocksCheckbox, Path=IsChecked}\"\n        Visibility=\"{Binding ShowsDocumentSettings, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DocumentProfilingOptionsPanel}}\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding HotBlockOverlayTextColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Marked hot block text color\" />\n      </Grid>\n      <Grid\n        Margin=\"0,2,0,0\"\n        IsEnabled=\"{Binding ElementName=MarkBlocksCheckbox, Path=IsChecked}\"\n        Visibility=\"{Binding ShowsDocumentSettings, Converter={StaticResource BoolToVisibilityConverter}, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DocumentProfilingOptionsPanel}}\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"70\" />\n          <ColumnDefinition />\n        </Grid.ColumnDefinitions>\n        <xctk:ColorPicker\n          Grid.Column=\"0\"\n          Width=\"64\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          AvailableColorsSortingMode=\"HueSaturationBrightness\"\n          BorderBrush=\"Gray\"\n          SelectedColor=\"{Binding BlockOverlayBorderColor, Mode=TwoWay}\"\n          ShowDropDownButton=\"True\" />\n        <TextBlock\n          Grid.Column=\"1\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Center\"\n          Text=\"Marked block border color\" />\n      </Grid>\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/DocumentProfilingOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows;\nusing static ProfileExplorer.UI.ProfileDocumentMarkerSettings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class DocumentProfilingOptionsPanel : OptionsPanelBase {\n  private bool showsDocumentSettings_;\n\n  public DocumentProfilingOptionsPanel() {\n    InitializeComponent();\n    ValueUnitComboBox.ItemsSource = ValueUnitKinds;\n  }\n\n  public Dictionary<ValueUnitKind, string>\n    ValueUnitKinds { get; } =\n    new() {\n      {ValueUnitKind.Second, \"Second\"},\n      {ValueUnitKind.Millisecond, \"Millisecond\"},\n      {ValueUnitKind.Microsecond, \"Microsecond\"},\n      {ValueUnitKind.Nanosecond, \"Nanosecond\"}\n    };\n\n  public bool ShowsDocumentSettings {\n    get => showsDocumentSettings_;\n    set => SetField(ref showsDocumentSettings_, value);\n  }\n\n  private void MaxWidthButton_Click(object sender, RoutedEventArgs e) {\n    ((ProfileDocumentMarkerSettings)Settings).MaxPercentageBarWidth =\n      DefaultMaxPercentageBarWidth;\n    ReloadSettings();\n  }\n\n  private void WeightCutoffButton_Click(object sender, RoutedEventArgs e) {\n    ((ProfileDocumentMarkerSettings)Settings).ElementWeightCutoff =\n      DefaultElementWeightCutoff;\n    ReloadSettings();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/ExpressionGraphOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.ExpressionGraphOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:toolkit=\"clr-namespace:Xceed.Wpf.Toolkit;assembly=DotNetProjects.Wpf.Extended.Toolkit\"\n  d:DesignHeight=\"600\"\n  d:DesignWidth=\"400              \"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Graph Content\" />\n          <StackPanel\n            Margin=\"0,0,0,2\"\n            Orientation=\"Horizontal\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Show variable names\"\n            IsChecked=\"{Binding Path=PrintVariableNames, Mode=TwoWay}\"\n            ToolTip=\"Show the destination variable name for each instruction\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Show variable SSA definition numbers\"\n            IsChecked=\"{Binding Path=PrintSSANumbers, Mode=TwoWay}\"\n            ToolTip=\"Show the SSA definition numbers for instructions and other operands\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Skip over copy instructions\"\n            IsChecked=\"{Binding Path=SkipCopyInstructions, Mode=TwoWay}\"\n            ToolTip=\"Don't include in the graph instructions that only copy values\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Group instructions by basic block\"\n            IsChecked=\"{Binding Path=GroupInstructions, Mode=TwoWay}\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Show expression bottom-up\"\n            IsChecked=\"{Binding Path=PrintBottomUp, Mode=TwoWay}\"\n            ToolTip=\"Show the expression inverted, with the start point placed up and the leaf operands placed down\" />\n          <TextBlock\n            Margin=\"0,6,0,2\"\n            Text=\"Maximum expression depth\" />\n          <StackPanel\n            Margin=\"0,0,0,4\"\n            HorizontalAlignment=\"Stretch\"\n            Orientation=\"Horizontal\">\n            <Slider\n              Width=\"150\"\n              AutoToolTipPlacement=\"TopLeft\"\n              Foreground=\"{DynamicResource DisabledForegroundBrush}\"\n              Maximum=\"32\"\n              Minimum=\"1\"\n              TickFrequency=\"2\"\n              TickPlacement=\"BottomRight\"\n              ToolTip=\"The maximum depth of the expression tree to show in the graph\"\n              Value=\"{Binding Path=MaxExpressionDepth, Mode=TwoWay}\" />\n            <TextBlock\n              Margin=\"8,0,0,0\"\n              Text=\"{Binding Path=MaxExpressionDepth}\" />\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              Text=\"instructions\" />\n          </StackPanel>\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Graph Interaction\" />\n\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Bring selected node into view\"\n            IsChecked=\"{Binding Path=BringNodesIntoView, Mode=TwoWay}\"\n            ToolTip=\"Scroll the graph to show the node corresponding to the selected line in the associated document\" />\n\n          <CheckBox\n            x:Name=\"ShowPreviewCheckbox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Show node preview popup on hover\"\n            IsChecked=\"{Binding Path=ShowPreviewPopup, Mode=TwoWay}\"\n            ToolTip=\"Show a preview of the corresponding lines from the associated document\" />\n          <CheckBox\n            Margin=\"20,3,0,2\"\n            Content=\"Only when a modifier key is pressed (Shift/Ctrl/Alt)\"\n            IsChecked=\"{Binding Path=ShowPreviewPopupWithModifier, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=ShowPreviewCheckbox, Path=IsChecked}\" />\n        </StackPanel>\n      </TabItem>\n\n      <TabItem\n        Header=\"Appearance\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Graph Node Style\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Use semantic colorization for nodes\"\n            IsChecked=\"{Binding Path=ColorizeNodes, Mode=TwoWay}\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Use semantic colorization for edges\"\n            IsChecked=\"{Binding Path=ColorizeEdges, Mode=TwoWay}\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Highlight connected nodes on hover\"\n            IsChecked=\"{Binding Path=HighlightConnectedNodesOnHover, Mode=TwoWay}\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Highlight connected nodes on selection\"\n            IsChecked=\"{Binding Path=HighlightConnectedNodesOnSelection, Mode=TwoWay}\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Graph Colors\" />\n          <StackPanel\n            Margin=\"0,4,0,0\"\n            Orientation=\"Vertical\">\n\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=TextColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Text color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=BackgroundColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Background color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=NodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Node color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SelectedNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Selected node color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=NodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Node border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=PredecessorNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Predecessor node border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SuccessorNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Successor node border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=EdgeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Edge color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=UnaryInstructionNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Unary instruction node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=BinaryInstructionNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Binary instruction node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=CopyInstructionNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Copy instruction node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=LoadStoreInstructionNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Load/store instruction node color\" />\n            </Grid>\n\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=CallInstructionNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Call/intrinsic instruction node color\" />\n            </Grid>\n\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=OperandNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Operand node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=NumberOperandNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Number operand node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=IndirectionOperandNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Indirect operand node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=AddressOperandNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Address operand node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=LoopPhiBackedgeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"PHI loop back-edge incoming value color\" />\n            </Grid>\n          </StackPanel>\n        </StackPanel>\n      </TabItem>\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/ExpressionGraphOptionsPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class ExpressionGraphOptionsPanel : OptionsPanelBase {\n  public ExpressionGraphOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override double DefaultHeight => 450;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/FlameGraphOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.FlameGraphOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"750\"\n  d:DesignWidth=\"400\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Show Function Details panel\"\n            IsChecked=\"{Binding ShowDetailsPanel, Mode=TwoWay}\"\n            ToolTip=\"Show the Function Details panel on the right-hand side\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Sync function in other profiling views\"\n            IsChecked=\"{Binding SyncSelection, Mode=TwoWay}\"\n            ToolTip=\"Sync function displayed in other profiling views with selection\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Sync Source File view with selection\"\n            IsChecked=\"{Binding SyncSourceFile, Mode=TwoWay}\"\n            ToolTip=\"Sync file displayed in the Source File view with selection\" />\n\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Function nodes\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Include module name\"\n            IsChecked=\"{Binding PrependModuleToFunction, Mode=TwoWay}\"\n            ToolTip=\"Show the module name in front of the function name\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Include function percentage\"\n            IsChecked=\"{Binding AppendPercentageToFunction, Mode=TwoWay}\"\n            ToolTip=\"Show the function instance time percentage after the name\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Include function time\"\n            IsChecked=\"{Binding AppendDurationToFunction, Mode=TwoWay}\"\n            ToolTip=\"Show the function instance duration after the name\" />\n          <CheckBox\n            x:Name=\"ShowCallStackPopupCheckbox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Show function details on hover\"\n            IsChecked=\"{Binding ShowNodePopup, Mode=TwoWay}\"\n            ToolTip=\"On mouse hover over a function, show a popup with details.&#x0a;If pinned, the popup expands into a Function Details panel popup\" />\n          <StackPanel\n            Margin=\"20,2,0,2\"\n            IsEnabled=\"{Binding ElementName=ShowCallStackPopupCheckbox, Path=IsChecked}\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              VerticalAlignment=\"Center\"\n              Text=\"Hover duration (ms)\" />\n            <xctk:IntegerUpDown\n              Width=\"70\"\n              Margin=\"8,0,0,0\"\n              Increment=\"100\"\n              Maximum=\"5000\"\n              Minimum=\"50\"\n              ParsingNumberStyle=\"Number\"\n              ShowButtonSpinner=\"True\"\n              Value=\"{Binding Path=NodePopupDuration, Mode=TwoWay}\" />\n            <Button\n              Height=\"20\"\n              Margin=\"4,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"ResetNodePopupDurationButton_Click\"\n              Content=\"Default\"\n              ToolTip=\"Reset value to default duration\" />\n            <Button\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"ShortNodePopupDurationButton_Click\"\n              Content=\"Short\"\n              ToolTip=\"Reset value to default duration\" />\n            <Button\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"LongNodePopupDurationButton_Click\"\n              Content=\"Long\"\n              ToolTip=\"Reset value to default duration\" />\n          </StackPanel>\n\n        </StackPanel>\n      </TabItem>\n      <TabItem\n        x:Name=\"StylePanel\"\n        Header=\"Appearance\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Use compact mode\"\n            ToolTip=\"Use a smaller font size for the Flame Graph nodes\"\n            IsChecked=\"{Binding UseCompactMode, Mode=TwoWay}\" />\n          <CheckBox\n            x:Name=\"KernelCheckBox\"\n            Margin=\"0,4,0,2\"\n            Content=\"Use different color palette for kernel code\"\n            ToolTip=\"Use the color palette specified below for code executing in kernel mode context\"\n            IsChecked=\"{Binding UseKernelColorPalette, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=ModuleColorsCheckBox, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\" />\n          <CheckBox\n            x:Name=\"ManagedCheckBox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Use different color palette for managed (.NET) code\"\n            ToolTip=\"Use the color palette specified below for code executing in managed (.NET) context\"\n            IsChecked=\"{Binding UseManagedColorPalette, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=ModuleColorsCheckBox, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\" />\n          <StackPanel\n            Margin=\"0,4,0,0\"\n            IsEnabled=\"{Binding ElementName=ModuleColorsCheckBox, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\"\n            Orientation=\"Horizontal\">\n            <controls:ColorPaletteSelector\n              x:Name=\"DefaultPaletteSelector\"\n              Width=\"120\"\n              Height=\"20\"\n              HorizontalAlignment=\"Left\"\n              PreviewWidth=\"200\"\n              SelectedPalette=\"{Binding DefaultColorPalette, Mode=TwoWay, Converter={StaticResource ColorPaletteConverter}}\" />\n            <TextBlock\n              Margin=\"8,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Text=\"Default color palette\" />\n          </StackPanel>\n          <StackPanel\n            Margin=\"0,2,0,0\"\n            IsEnabled=\"{Binding ElementName=KernelCheckBox, Path=IsChecked}\"\n            Orientation=\"Horizontal\">\n            <controls:ColorPaletteSelector\n              x:Name=\"KernelPaletteSelector\"\n              Width=\"120\"\n              Height=\"20\"\n              HorizontalAlignment=\"Left\"\n              PreviewWidth=\"200\"\n              SelectedPalette=\"{Binding KernelColorPalette, Mode=TwoWay, Converter={StaticResource ColorPaletteConverter}}\" />\n            <TextBlock\n              Margin=\"8,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Text=\"Kernel code color palette\" />\n          </StackPanel>\n          <StackPanel\n            Margin=\"0,2,0,0\"\n            IsEnabled=\"{Binding ElementName=ManagedCheckBox, Path=IsChecked}\"\n            Orientation=\"Horizontal\">\n            <controls:ColorPaletteSelector\n              x:Name=\"ManagedPaletteSelector\"\n              Width=\"120\"\n              Height=\"20\"\n              HorizontalAlignment=\"Left\"\n              PreviewWidth=\"200\"\n              SelectedPalette=\"{Binding ManagedColorPalette, Mode=TwoWay, Converter={StaticResource ColorPaletteConverter}}\" />\n            <TextBlock\n              Margin=\"8,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Text=\"Managed (.NET) code color palette\" />\n          </StackPanel>\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            Margin=\"0,4,0,4\"\n            FontWeight=\"Medium\"\n            Text=\"Colors\" />\n          <Grid>\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=NodeTextColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Function text color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=KernelNodeTextColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Kernel function text color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=ManagedNodeTextColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Managed function text color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=NodeModuleColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Module text color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=NodePercentageColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Percentage text color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=NodeWeightColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Time text color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=NodeBorderColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Function border color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=KernelNodeBorderColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Kernel function border color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=ManagedNodeBorderColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Managed function border color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=SelectedNodeColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Selected function color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=SelectedNodeBorderColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Selected function border color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=SearchResultMarkingColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Search result marking color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=SearchedNodeColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Search result function color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=SearchedNodeBorderColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Search result border color\" />\n          </Grid>\n        </StackPanel>\n      </TabItem>\n      <TabItem\n        x:Name=\"DetailsPanel\"\n        Header=\"Function Details panel\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Auto-expand Instance Statistics section\"\n            IsChecked=\"{Binding ExpandInstances, Mode=TwoWay}\"\n            ToolTip=\"Instances section expanded by default when selecting a function\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Auto-expand Histogram section\"\n            IsChecked=\"{Binding ExpandHistogram, Mode=TwoWay}\"\n            ToolTip=\"Histogram section expanded by default when selecting a function\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Auto-expand Threads section\"\n            IsChecked=\"{Binding ExpandThreads, Mode=TwoWay}\"\n            ToolTip=\"Threads list section expanded by default when selecting a function\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Alternate list view background color\"\n            IsChecked=\"{Binding AlternateListRows, Mode=TwoWay}\"\n            ToolTip=\"Alternate the background color of the function/module list view items\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Function Lists\" />\n          <StackPanel x:Name=\"FunctionListOptionsPanel\">\n            <CheckBox\n              x:Name=\"FilterWeightCheckBox\"\n              Margin=\"0,4,0,2\"\n              Content=\"Filter out insignificant functions\"\n              IsChecked=\"{Binding FilterByWeight, Mode=TwoWay}\"\n              ToolTip=\"Filter out functions with a time less than this value\" />\n            <StackPanel\n              Margin=\"20,2,0,2\"\n              IsEnabled=\"{Binding ElementName=FilterWeightCheckBox, Path=IsChecked}\"\n              Orientation=\"Horizontal\">\n              <TextBlock\n                VerticalAlignment=\"Center\"\n                Text=\"Minimum time (ms)\" />\n              <xctk:DoubleUpDown\n                Width=\"70\"\n                Margin=\"8,0,0,0\"\n                Increment=\"100\"\n                Maximum=\"1000\"\n                Minimum=\"0\"\n                ShowButtonSpinner=\"True\"\n                ToolTip=\"Filter out functions with a time less than this value\"\n                Value=\"{Binding Path=MinWeight, Mode=TwoWay}\" />\n              <Button\n                Height=\"20\"\n                Margin=\"4,0,0,0\"\n                Padding=\"2,0,2,0\"\n                VerticalAlignment=\"Center\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                Click=\"ResetFilterWeightButton_Click\"\n                Content=\"Default\"\n                ToolTip=\"Reset value to default duration\" />\n            </StackPanel>\n\n            <TextBlock\n              Margin=\"0,2,0,0\"\n              Text=\"Sort functions by:\" />\n            <RadioButton\n              Margin=\"0,4,8,0\"\n              Content=\"Total time (inclusive)\"\n              IsChecked=\"{Binding SortByExclusiveTime, Converter={StaticResource InvertedBoolConverter}}\" />\n            <RadioButton\n              Margin=\"0,2,8,2\"\n              Content=\"Self time (exclusive)\"\n              IsChecked=\"{Binding SortByExclusiveTime}\" />\n          </StackPanel>\n\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Preview Popup\" />\n          <CheckBox\n            x:Name=\"ShowDetailsPopupCheckbox\"\n            Margin=\"0,4,0,2\"\n            Content=\"Show function preview on hover\"\n            IsChecked=\"{Binding ShowPreviewPopup, Mode=TwoWay}\"\n            ToolTip=\"On mouse hover over a function, show a popup with details.&#x0a;If pinned, the popup expands into a Function Details panel popup\" />\n\n          <StackPanel Margin=\"20,2,0,0\">\n            <StackPanel\n              IsEnabled=\"{Binding ElementName=ShowDetailsPopupCheckbox, Path=IsChecked}\"\n              Orientation=\"Horizontal\">\n              <TextBlock\n                VerticalAlignment=\"Center\"\n                Text=\"Hover duration (ms):\" />\n              <xctk:IntegerUpDown\n                Width=\"70\"\n                Margin=\"8,0,0,0\"\n                Maximum=\"5000\"\n                Minimum=\"50\"\n                ParsingNumberStyle=\"Number\"\n                ShowButtonSpinner=\"True\"\n                Value=\"{Binding Path=PreviewPopupDuration, Mode=TwoWay}\" />\n              <Button\n                Height=\"20\"\n                Margin=\"4,0,0,0\"\n                Padding=\"2,0,2,0\"\n                VerticalAlignment=\"Center\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                Click=\"ResetDetailsPopupDurationButton_Click\"\n                Content=\"Default\"\n                ToolTip=\"Reset value to default duration\" />\n              <Button\n                Height=\"20\"\n                Margin=\"2,0,0,0\"\n                Padding=\"2,0,2,0\"\n                VerticalAlignment=\"Center\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                Click=\"ShortDetailsPopupDurationButton_Click\"\n                Content=\"Short\"\n                ToolTip=\"Reset value to default duration\" />\n              <Button\n                Height=\"20\"\n                Margin=\"2,0,0,0\"\n                Padding=\"2,0,2,0\"\n                VerticalAlignment=\"Center\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                Click=\"LongDetailsPopupDurationButton_Click\"\n                Content=\"Long\"\n                ToolTip=\"Reset value to default duration\" />\n            </StackPanel>\n          </StackPanel>\n          <TextBlock\n            Margin=\"0,6,0,0\"\n            FontSize=\"11\"\n            Text=\"More settings available from Preview popup and Options window.\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Histogram Colors\" />\n          <Grid Margin=\"0,4,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=HistogramBarColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Function group color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=HistogramAverageColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Average line color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=HistogramMedianColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Median line color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              IsManipulationEnabled=\"True\"\n              SelectedColor=\"{Binding Path=HistogramCurrentColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Current instance color\" />\n          </Grid>\n        </StackPanel>\n\n      </TabItem>\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/FlameGraphOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class FlameGraphOptionsPanel : OptionsPanelBase {\n  private FlameGraphSettings settings_;\n\n  public FlameGraphOptionsPanel() {\n    InitializeComponent();\n    DefaultPaletteSelector.PalettesSource = ColorPalette.BuiltinPalettes;\n    KernelPaletteSelector.PalettesSource = ColorPalette.BuiltinPalettes;\n    ManagedPaletteSelector.PalettesSource = ColorPalette.BuiltinPalettes;\n\n    //? TODO: Change to calling Initialize\n    DetailsPanel.DataContext = App.Settings.CallTreeNodeSettings;\n    FunctionListOptionsPanel.DataContext = App.Settings.CallTreeNodeSettings.FunctionListViewFilter;\n  }\n\n  public override double DefaultHeight => 450;\n  public override double DefaultWidth => 400;\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n    settings_ = (FlameGraphSettings)Settings;\n  }\n\n  public override void OnSettingsChanged(object newSettings) {\n    settings_ = (FlameGraphSettings)newSettings;\n    ReloadAdditionalSettings();\n  }\n\n  public override void ReloadSettings() {\n    base.ReloadSettings();\n    ReloadAdditionalSettings();\n  }\n\n  private void ReloadAdditionalSettings() {\n    DetailsPanel.DataContext = null;\n    DetailsPanel.DataContext = App.Settings.CallTreeNodeSettings;\n    FunctionListOptionsPanel.DataContext = null;\n    FunctionListOptionsPanel.DataContext = App.Settings.CallTreeNodeSettings.FunctionListViewFilter;\n  }\n\n  public override void PanelResetting() {\n    base.PanelResetting();\n    App.Settings.CallTreeNodeSettings.Reset();\n  }\n\n  private void ResetNodePopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    settings_.NodePopupDuration = FlameGraphSettings.DefaultNodePopupDuration;\n    ReloadSettings();\n  }\n\n  private void ShortNodePopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    settings_.NodePopupDuration = HoverPreview.HoverDurationMs;\n    ReloadSettings();\n  }\n\n  private void LongNodePopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    settings_.NodePopupDuration = HoverPreview.LongHoverDurationMs;\n    ReloadSettings();\n  }\n\n  private void ResetDetailsPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((CallTreeNodeSettings)DetailsPanel.DataContext).PreviewPopupDuration =\n      CallTreeNodeSettings.DefaultPreviewPopupDuration;\n    ReloadSettings();\n  }\n\n  private void ShortDetailsPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((CallTreeNodeSettings)DetailsPanel.DataContext).PreviewPopupDuration = HoverPreview.HoverDurationMs;\n    ReloadSettings();\n  }\n\n  private void LongDetailsPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((CallTreeNodeSettings)DetailsPanel.DataContext).PreviewPopupDuration = HoverPreview.LongHoverDurationMs;\n    ReloadSettings();\n  }\n\n  private void ResetFilterWeightButton_Click(object sender, RoutedEventArgs e) {\n    ((ProfileListViewFilter)FunctionListOptionsPanel.DataContext).MinWeight = ProfileListViewFilter.DefaultMinWeight;\n    ReloadSettings();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/FlowGraphOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.FlowGraphOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:toolkit=\"clr-namespace:Xceed.Wpf.Toolkit;assembly=DotNetProjects.Wpf.Extended.Toolkit\"\n  d:DesignHeight=\"600\"\n  d:DesignWidth=\"400\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Graph Interaction\" />\n          <StackPanel\n            Margin=\"0,0,0,2\"\n            Orientation=\"Horizontal\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Sync selected/hovered nodes with document\"\n            IsChecked=\"{Binding Path=SyncSelectedNodes, Mode=TwoWay}\"\n            ToolTip=\"Select in associated document the lines corresponding to a node\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Sync marked nodes with document\"\n            IsChecked=\"{Binding Path=SyncMarkedNodes, Mode=TwoWay}\"\n            ToolTip=\"Mark the nodes corresponding to marked lines in the associated document\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Show immediate dominator edges\"\n            IsChecked=\"{Binding Path=ShowImmDominatorEdges, Mode=TwoWay}\"\n            ToolTip=\"Show edges between a node and its immediate dominator\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Bring selected node into view\"\n            IsChecked=\"{Binding Path=BringNodesIntoView, Mode=TwoWay}\"\n            ToolTip=\"Scroll the graph to show the node corresponding to the selected line in the associated document\" />\n          <CheckBox\n            x:Name=\"ShowPreviewCheckbox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Show node preview popup on hover\"\n            IsChecked=\"{Binding Path=ShowPreviewPopup, Mode=TwoWay}\"\n            ToolTip=\"Show a preview of the corresponding lines from the associated document\" />\n          <CheckBox\n            Margin=\"20,3,0,2\"\n            Content=\"Only when a modifier key is pressed (Shift/Ctrl/Alt)\"\n            IsChecked=\"{Binding Path=ShowPreviewPopupWithModifier, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=ShowPreviewCheckbox, Path=IsChecked}\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Graph Node Style\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Use semantic colorization for nodes\"\n            IsChecked=\"{Binding Path=ColorizeNodes, Mode=TwoWay}\"\n            ToolTip=\"Colorize nodes based on their type (e.g. branch, loop, switch)\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Use semantic colorization for edges\"\n            IsChecked=\"{Binding Path=ColorizeEdges, Mode=TwoWay}\"\n            ToolTip=\"Colorize edges based on their type (e.g. branch, true, false, return)\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Highlight connected nodes on hover\"\n            IsChecked=\"{Binding Path=HighlightConnectedNodesOnHover, Mode=TwoWay}\"\n            ToolTip=\"Highlight nodes connected to the hovered node\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Highlight connected nodes on selection\"\n            IsChecked=\"{Binding Path=HighlightConnectedNodesOnSelection, Mode=TwoWay}\"\n            ToolTip=\"Highlight nodes connected to the selected node\" />\n        </StackPanel>\n      </TabItem>\n\n      <TabItem\n        Header=\"Appearance\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Graph Colors\" />\n          <StackPanel\n            Margin=\"0,4,0,0\"\n            Orientation=\"Vertical\">\n\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=TextColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Text color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=BackgroundColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Background color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=NodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SelectedNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Selected node color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=EdgeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Edge color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=NodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Node border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=PredecessorNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Predecessor node border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SuccessorNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Successor node border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=EmptyNodeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Empty node color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=BranchNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Branch node border color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=SwitchNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Switch node border color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=ReturnNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Return node border color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=LoopNodeBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Loop header node border color\" />\n            </Grid>\n\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=DominatorEdgeColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Immediate dominator edge color\" />\n            </Grid>\n\n            <Separator\n              Margin=\"0,4,0,4\"\n              Background=\"LightGray\" />\n            <TextBlock\n              FontWeight=\"Medium\"\n              Text=\"Loop Graph Colors\" />\n            <CheckBox\n              x:Name=\"LoopCheckbox\"\n              Margin=\"0,4,0,2\"\n              Content=\"Colorize loop nodes\"\n              IsChecked=\"{Binding Path=MarkLoopBlocks, Mode=TwoWay}\" />\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                IsEnabled=\"{Binding ElementName=LoopCheckbox, Path=IsChecked}\"\n                SelectedColor=\"{Binding Path=LoopNodeColors[0], Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Loop node color - nesting level 1\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                IsEnabled=\"{Binding ElementName=LoopCheckbox, Path=IsChecked}\"\n                SelectedColor=\"{Binding Path=LoopNodeColors[1], Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Loop node color - nesting level 2\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                IsEnabled=\"{Binding ElementName=LoopCheckbox, Path=IsChecked}\"\n                SelectedColor=\"{Binding Path=LoopNodeColors[2], Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Loop node color - nesting level 3\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <toolkit:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                IsEnabled=\"{Binding ElementName=LoopCheckbox, Path=IsChecked}\"\n                SelectedColor=\"{Binding Path=LoopNodeColors[3], Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Loop node color - nesting level 4+\" />\n            </Grid>\n          </StackPanel>\n        </StackPanel>\n      </TabItem>\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/FlowGraphOptionsPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class FlowGraphOptionsPanel : OptionsPanelBase {\n  public FlowGraphOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override double DefaultHeight => 450;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/FunctionMarkingOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.FunctionMarkingOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"550\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel Margin=\"4,4,4,4\">\n      <CheckBox\n        x:Name=\"ModuleColorsCheckBox\"\n        Margin=\"0,2,0,2\"\n        Content=\"Pick function color based on module\"\n        IsChecked=\"{Binding UseAutoModuleColors, Mode=TwoWay}\"\n        ToolTip=\"Automatically pick a function color based on the module name.&#x0a;If disabled, the Flame Graph view will use the color palettes defined in the options\" />\n      <StackPanel\n        Margin=\"0,2,0,0\"\n        IsEnabled=\"{Binding ElementName=ModuleColorsCheckBox, Path=IsChecked}\"\n        Orientation=\"Horizontal\">\n        <controls:ColorPaletteSelector\n          x:Name=\"ModulePaletteSelector\"\n          Width=\"120\"\n          Height=\"20\"\n          HorizontalAlignment=\"Left\"\n          PreviewWidth=\"200\"\n          SelectedPalette=\"{Binding ModulesColorPalette, Mode=TwoWay, Converter={StaticResource ColorPaletteConverter}}\" />\n        <TextBlock\n          Margin=\"8,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"Module color palette\" />\n      </StackPanel>\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Module marking\" />\n      <CheckBox\n        x:Name=\"ModuleCheckBox\"\n        Margin=\"0,4,0,2\"\n        Content=\"Mark functions based on module name\"\n        IsChecked=\"{Binding UseModuleColors, Mode=TwoWay}\"\n        ToolTip=\"Use a different color for the specified modules\" />\n      <Grid\n        Margin=\"0,0,0,0\"\n        IsEnabled=\"{Binding ElementName=ModuleCheckBox, Path=IsChecked}\">\n        <Grid.RowDefinitions>\n          <RowDefinition Height=\"*\" />\n        </Grid.RowDefinitions>\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"80\" />\n        </Grid.ColumnDefinitions>\n\n        <ListView\n          x:Name=\"ModuleList\"\n          Grid.Row=\"0\"\n          Grid.Column=\"0\"\n          MinHeight=\"100\"\n          MaxHeight=\"300\"\n          Margin=\"0,4,4,4\"\n          HorizontalContentAlignment=\"Left\"\n          VerticalContentAlignment=\"Center\"\n          IsTextSearchEnabled=\"True\"\n          ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n          SelectionMode=\"Single\"\n          TextSearch.TextPath=\"Name\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn\n                Width=\"150\"\n                Header=\"Module name\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"ToolTip\" Value=\"Module name substring or Regex pattern\" />\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Grid>\n                      <CheckBox\n                        VerticalAlignment=\"Center\"\n                        IsChecked=\"{Binding Path=IsEnabled, Mode=TwoWay}\"\n                        MouseUp=\"MarkingCheckBox_Changed\" />\n                      <TextBox\n                        Height=\"20\"\n                        Margin=\"18,0,0,0\"\n                        HorizontalAlignment=\"Left\"\n                        VerticalAlignment=\"Center\"\n                        VerticalContentAlignment=\"Center\"\n                        BorderThickness=\"0\"\n                        PreviewMouseLeftButtonDown=\"TextBox_PreviewMouseLeftButtonDown\"\n                        Text=\"{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=LostFocus}\"\n                        ToolTip=\"{Binding Path=Name}\" />\n                    </Grid>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"80\"\n                Header=\"Color\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <xctk:ColorPicker\n                      Width=\"64\"\n                      HorizontalAlignment=\"Left\"\n                      VerticalAlignment=\"Center\"\n                      AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                      BorderBrush=\"#707070\"\n                      IsManipulationEnabled=\"True\"\n                      SelectedColor=\"{Binding Path=Color, Mode=TwoWay}\"\n                      ShowDropDownButton=\"True\" />\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"35\"\n                Header=\"Regex\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <CheckBox\n                      HorizontalAlignment=\"Left\"\n                      VerticalAlignment=\"Center\"\n                      IsChecked=\"{Binding Path=IsRegex, Mode=TwoWay}\" />\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n              <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n              <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n            </Style>\n          </ListView.ItemContainerStyle>\n        </ListView>\n\n        <StackPanel\n          Grid.Row=\"0\"\n          Grid.Column=\"1\"\n          Margin=\"2,4,4,4\">\n          <Button\n            Height=\"24\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"ModuleAdd_Click\"\n            ToolTip=\"Add new module to the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PlusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Add\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"ModuleRemove_Click\"\n            ToolTip=\"Remove module from the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource MinusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Remove\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"ClearModule_Click\"\n            ToolTip=\"Remove all modules from the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource RemoveIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Clear\" />\n            </StackPanel>\n          </Button>\n\n        </StackPanel>\n      </Grid>\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Function marking\" />\n\n      <CheckBox\n        x:Name=\"FunctionCheckBox\"\n        Margin=\"0,4,0,2\"\n        Content=\"Mark functions based on function name\"\n        IsChecked=\"{Binding UseFunctionColors, Mode=TwoWay}\"\n        ToolTip=\"Use a different color for the specified functions\" />\n      <Grid\n        Margin=\"0,0,0,0\"\n        IsEnabled=\"{Binding ElementName=FunctionCheckBox, Path=IsChecked}\">\n        <Grid.RowDefinitions>\n          <RowDefinition Height=\"*\" />\n        </Grid.RowDefinitions>\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"80\" />\n        </Grid.ColumnDefinitions>\n\n        <ListView\n          x:Name=\"FunctionList\"\n          Grid.Row=\"0\"\n          Grid.Column=\"0\"\n          MinHeight=\"100\"\n          MaxHeight=\"300\"\n          Margin=\"0,4,4,4\"\n          HorizontalContentAlignment=\"Left\"\n          VerticalContentAlignment=\"Center\"\n          IsTextSearchEnabled=\"True\"\n          ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n          SelectionMode=\"Single\"\n          TextSearch.TextPath=\"Name\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn\n                Width=\"150\"\n                Header=\"Function name\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"ToolTip\" Value=\"Function name substring or Regex pattern\" />\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Grid>\n                      <CheckBox\n                        VerticalAlignment=\"Center\"\n                        IsChecked=\"{Binding Path=IsEnabled, Mode=TwoWay}\"\n                        MouseUp=\"MarkingCheckBox_Changed\" />\n                      <TextBox\n                        Height=\"20\"\n                        Margin=\"18,0,0,0\"\n                        HorizontalAlignment=\"Left\"\n                        VerticalAlignment=\"Center\"\n                        VerticalContentAlignment=\"Center\"\n                        BorderThickness=\"0\"\n                        PreviewMouseLeftButtonDown=\"TextBox_PreviewMouseLeftButtonDown\"\n                        Text=\"{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=LostFocus}\"\n                        ToolTip=\"{Binding Path=Name}\" />\n                    </Grid>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"80\"\n                Header=\"Color\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <xctk:ColorPicker\n                      Width=\"64\"\n                      HorizontalAlignment=\"Left\"\n                      VerticalAlignment=\"Center\"\n                      AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                      BorderBrush=\"#707070\"\n                      IsManipulationEnabled=\"True\"\n                      SelectedColor=\"{Binding Path=Color, Mode=TwoWay}\"\n                      ShowDropDownButton=\"True\" />\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"35\"\n                Header=\"Regex\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <CheckBox\n                      HorizontalAlignment=\"Left\"\n                      VerticalAlignment=\"Center\"\n                      IsChecked=\"{Binding Path=IsRegex, Mode=TwoWay}\" />\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n              <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n              <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n            </Style>\n          </ListView.ItemContainerStyle>\n        </ListView>\n\n        <StackPanel\n          Grid.Row=\"0\"\n          Grid.Column=\"1\"\n          Margin=\"2,4,4,4\">\n          <Button\n            Height=\"24\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"FunctionAdd_Click\"\n            ToolTip=\"Add new function to the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PlusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Add\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"FunctionRemove_Click\"\n            ToolTip=\"Remove function from the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource MinusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Remove\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"ClearFunction_Click\"\n            ToolTip=\"Remove all functions from the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource RemoveIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Clear\" />\n            </StackPanel>\n          </Button>\n\n        </StackPanel>\n      </Grid>\n\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Saved marking sets\" />\n      <Grid>\n        <Grid.RowDefinitions>\n          <RowDefinition Height=\"*\" />\n          <RowDefinition Height=\"25\" />\n        </Grid.RowDefinitions>\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"80\" />\n        </Grid.ColumnDefinitions>\n\n        <ListView\n          x:Name=\"MarkingsList\"\n          Grid.Row=\"0\"\n          Grid.Column=\"0\"\n          MinHeight=\"100\"\n          MaxHeight=\"300\"\n          Margin=\"0,4,4,4\"\n          HorizontalContentAlignment=\"Left\"\n          VerticalContentAlignment=\"Center\"\n          IsTextSearchEnabled=\"True\"\n          ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n          SelectionMode=\"Single\"\n          TextSearch.TextPath=\"Name\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn\n                Width=\"130\"\n                DisplayMemberBinding=\"{Binding Title}\"\n                Header=\"Name\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"ToolTip\" Value=\"Marking set name\" />\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"Auto\"\n                DisplayMemberBinding=\"{Binding FunctionColors.Count}\"\n                Header=\"Functions\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"ToolTip\" Value=\"Number of function patterns in the set\" />\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"Auto\"\n                DisplayMemberBinding=\"{Binding ModuleColors.Count}\"\n                Header=\"Modules\">\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"ToolTip\" Value=\"Number of module patterns in the set\" />\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n              <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n              <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n            </Style>\n          </ListView.ItemContainerStyle>\n        </ListView>\n\n        <StackPanel\n          Grid.Row=\"0\"\n          Grid.Column=\"1\"\n          Margin=\"2,4,4,4\">\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"MarkingSave_Click\"\n            ToolTip=\"Export current and saved marking sets as a JSON file\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PlusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Save\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"MarkingLoad_Click\"\n            ToolTip=\"Add saved markings to the current function/module markings\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource AddBookmarkIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Load\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"MarkingRemove_Click\"\n            ToolTip=\"Remove selected marking set from the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource MinusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Remove\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"0,2,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"MarkingClear_Click\"\n            ToolTip=\"Remove all marking sets from the list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource RemoveIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Clear\" />\n            </StackPanel>\n          </Button>\n        </StackPanel>\n        <StackPanel\n          Grid.Row=\"1\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Orientation=\"Horizontal\">\n          <Button\n            Height=\"24\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"MarkingImport_Click\"\n            ToolTip=\"Import current and saved marking sets from a JSON file.&#x0a;This appends the new marking sets to the existing ones\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource FolderIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Import\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Height=\"24\"\n            Margin=\"4,0,0,0\"\n            Padding=\"2\"\n            HorizontalContentAlignment=\"Left\"\n            Click=\"MarkingExport_Click\"\n            ToolTip=\"Export current and saved marking sets as a JSON file\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SaveIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Export\" />\n            </StackPanel>\n          </Button>\n        </StackPanel>\n      </Grid>\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/FunctionMarkingOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing ProfileExplorer.UI.Windows;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class FunctionMarkingOptionsPanel : OptionsPanelBase {\n  private FunctionMarkingSettings settings_;\n\n  public FunctionMarkingOptionsPanel() {\n    InitializeComponent();\n    ModulePaletteSelector.PalettesSource = ColorPalette.GradientBuiltinPalettes;\n  }\n\n  public override double DefaultHeight => 550;\n  public override double DefaultWidth => 400;\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n    settings_ = (FunctionMarkingSettings)Settings;\n    ReloadModuleList();\n    ReloadFunctionList();\n    ReloadMarkingsList();\n  }\n\n  public override void OnSettingsChanged(object newSettings) {\n    settings_ = (FunctionMarkingSettings)newSettings;\n    ReloadModuleList();\n    ReloadFunctionList();\n    ReloadMarkingsList();\n  }\n\n  private void ReloadModuleList() {\n    var list = new ObservableCollectionRefresh<FunctionMarkingStyle>(settings_.ModuleColors);\n    ModuleList.ItemsSource = list;\n  }\n\n  private void ReloadFunctionList() {\n    var list = new ObservableCollectionRefresh<FunctionMarkingStyle>(settings_.FunctionColors);\n    FunctionList.ItemsSource = list;\n  }\n\n  private void ReloadMarkingsList() {\n    var list = new ObservableCollectionRefresh<FunctionMarkingSet>(settings_.SavedSets);\n    MarkingsList.ItemsSource = list;\n  }\n\n  private void TextBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    if (sender is TextBox textBox) {\n      Utils.SelectTextBoxListViewItem(textBox, ModuleList);\n    }\n  }\n\n  private void ModuleRemove_Click(object sender, RoutedEventArgs e) {\n    if (ModuleList.SelectedItem is FunctionMarkingStyle pair) {\n      settings_.ModuleColors.Remove(pair);\n      ReloadModuleList();\n      NotifySettingsChanged();\n    }\n  }\n\n  private void ModuleAdd_Click(object sender, RoutedEventArgs e) {\n    settings_.ModuleColors.Add(new FunctionMarkingStyle(\"\", Colors.White));\n    ReloadModuleList();\n    NotifySettingsChanged();\n\n    Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, () => {\n      Utils.SelectEditableListViewItem(ModuleList, settings_.ModuleColors.Count - 1);\n    });\n  }\n\n  private void ClearModule_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to clear the list?\", this) == MessageBoxResult.Yes) {\n      settings_.ModuleColors.Clear();\n      ReloadModuleList();\n      NotifySettingsChanged();\n    }\n  }\n\n  private void ClearFunction_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to clear the list?\", this) == MessageBoxResult.Yes) {\n      settings_.FunctionColors.Clear();\n      ReloadFunctionList();\n      NotifySettingsChanged();\n    }\n  }\n\n  private void FunctionRemove_Click(object sender, RoutedEventArgs e) {\n    if (FunctionList.SelectedItem is FunctionMarkingStyle pair) {\n      settings_.FunctionColors.Remove(pair);\n      ReloadFunctionList();\n      NotifySettingsChanged();\n    }\n  }\n\n  private void FunctionAdd_Click(object sender, RoutedEventArgs e) {\n    settings_.FunctionColors.Add(new FunctionMarkingStyle(\"\", Colors.White));\n    ReloadFunctionList();\n    NotifySettingsChanged();\n\n    Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, () => {\n      Utils.SelectEditableListViewItem(FunctionList, settings_.FunctionColors.Count - 1);\n    });\n  }\n\n  private void MarkingClear_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to clear the list?\", this) == MessageBoxResult.Yes) {\n      settings_.SavedSets.Clear();\n      ReloadMarkingsList();\n      NotifySettingsChanged();\n    }\n  }\n\n  private void MarkingRemove_Click(object sender, RoutedEventArgs e) {\n    if (MarkingsList.SelectedItem is FunctionMarkingSet set) {\n      settings_.SavedSets.Remove(set);\n      ReloadMarkingsList();\n      NotifySettingsChanged();\n    }\n  }\n\n  private void MarkingImport_Click(object sender, RoutedEventArgs e) {\n    if (settings_.ImportMarkings(this)) {\n      ReloadMarkingsList();\n      ReloadFunctionList();\n      ReloadModuleList();\n      NotifySettingsChanged();\n    }\n  }\n\n  private void MarkingExport_Click(object sender, RoutedEventArgs e) {\n    settings_.ExportMarkings(this);\n  }\n\n  private void MarkingSave_Click(object sender, RoutedEventArgs e) {\n    TextInputWindow input = new(\"Save marked functions/modules\", \"Saved marking set name:\", \"Save\", \"Cancel\");\n\n    if (input.Show(out string result, true)) {\n      settings_.SaveCurrentMarkingSet(result);\n      ReloadMarkingsList();\n    }\n  }\n\n  private void MarkingLoad_Click(object sender, RoutedEventArgs e) {\n    if (MarkingsList.SelectedItem is FunctionMarkingSet set) {\n      settings_.AppendMarkingSet(set);\n      NotifySettingsChanged();\n    }\n  }\n\n  private void MarkingCheckBox_Changed(object sender, RoutedEventArgs e) {\n    NotifySettingsChanged();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/GeneralOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.GeneralOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel Margin=\"4,4,4,4\">\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Check for updates on application startup\"\n        IsChecked=\"{Binding CheckForUpdates, Mode=TwoWay}\"\n        ToolTip=\"Automatically check for new versions of the application on startup\" />\n      <StackPanel\n        Margin=\"0,2,0,0\"\n        IsEnabled=\"{Binding ElementName=FilterWeightCheckBox, Path=IsChecked}\"\n        Orientation=\"Horizontal\" />\n\n      <Separator\n        Margin=\"0,6,0,4\"\n        Background=\"LightGray\" />\n\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"User Interface\" />\n      <StackPanel\n        Margin=\"0,4,0,4\"\n        IsEnabled=\"{Binding ElementName=FilterWeightCheckBox, Path=IsChecked}\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Window UI scaling\" />\n        <xctk:DoubleUpDown\n          Width=\"70\"\n          Margin=\"18,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FormatString=\"F0\"\n          Increment=\"5\"\n          Maximum=\"200\"\n          Minimum=\"50\"\n          ShowButtonSpinner=\"True\"\n          ToolTip=\"Scaling factor for the entire application UI\"\n          Value=\"{Binding Path=WindowScaling, Mode=TwoWay, Converter={StaticResource DoubleScalingConverter}, ConverterParameter=100.0}\" />\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"%\" />\n        <Button\n          Height=\"20\"\n          Margin=\"8,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Click=\"ResetUIZoomButton_Click\"\n          Content=\"Default\"\n          ToolTip=\"Reset the application UI scaling to 100%\" />\n      </StackPanel>\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Disable animations\"\n        IsChecked=\"{Binding DisableAnimations, Mode=TwoWay}\"\n        ToolTip=\"Disable all animations in the application UI\" />\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Disable hardware-accelerated rendering\"\n        IsChecked=\"{Binding DisableHardwareRendering, Mode=TwoWay}\"\n        ToolTip=\"Switch from hardware-accelerated to software rendering of the application UI\" />\n      <Separator\n        Margin=\"0,6,0,4\"\n        Background=\"LightGray\" />\n\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Advanced\" />\n      <StackPanel\n        Margin=\"0,4,0,4\"\n        IsEnabled=\"{Binding ElementName=FilterWeightCheckBox, Path=IsChecked}\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Max CPU cores used\" />\n        <xctk:DoubleUpDown\n          Width=\"70\"\n          Margin=\"8,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FormatString=\"F0\"\n          Increment=\"5\"\n          Maximum=\"200\"\n          Minimum=\"50\"\n          ShowButtonSpinner=\"True\"\n          ToolTip=\"Maximum number of logical cores used when loading profile traces and other UI tasks\"\n          Value=\"{Binding Path=CpuCoreLimit, Mode=TwoWay, Converter={StaticResource DoubleScalingConverter}, ConverterParameter=100.0}\" />\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"%\" />\n        <Button\n          Height=\"20\"\n          Margin=\"8,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Click=\"CpuCoreLimitButton_Click\"\n          Content=\"Default\"\n          ToolTip=\"Reset the application UI scaling to 100%\" />\n      </StackPanel>\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/GeneralOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class GeneralOptionsPanel : OptionsPanelBase {\n  private GeneralSettings settings_;\n\n  public GeneralOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n    settings_ = (GeneralSettings)Settings;\n  }\n\n  public override void OnSettingsChanged(object newSettings) {\n    settings_ = (GeneralSettings)newSettings;\n  }\n\n  private void ResetUIZoomButton_Click(object sender, RoutedEventArgs e) {\n    settings_.WindowScaling = 1.0;\n    ReloadSettings();\n  }\n\n  private void CpuCoreLimitButton_Click(object sender, RoutedEventArgs e) {\n    settings_.CpuCoreLimit = GeneralSettings.DefaultCpuCoreLimit;\n    ReloadSettings();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/LightDocumentOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.LightDocumentOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:utilities=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:xctk=\"clr-namespace:Xceed.Wpf.Toolkit;assembly=DotNetProjects.Wpf.Extended.Toolkit\"\n  d:DesignHeight=\"600\"\n  d:DesignWidth=\"400\"\n  mc:Ignorable=\"d\">\n\n  <local:OptionsPanelBase.Resources>\n    <CollectionViewSource\n      x:Key=\"FontCollection\"\n      Source=\"{Binding Source={x:Static Fonts.SystemFontFamilies}}\" />\n\n    <utilities:FontFamilyConverter x:Key=\"FontFamilyConverter\" />\n  </local:OptionsPanelBase.Resources>\n\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel\n      Grid.Row=\"0\"\n      Margin=\"4,4,4,4\">\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Document Style\" />\n\n      <StackPanel\n        Margin=\"0,0,0,2\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"50\"\n          VerticalAlignment=\"Center\"\n          Text=\"Font\" />\n        <ComboBox\n          Width=\"180\"\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          IsSynchronizedWithCurrentItem=\"True\"\n          ItemsSource=\"{Binding Source={StaticResource FontCollection}}\"\n          SelectedValue=\"{Binding Path=FontName, Mode=TwoWay, Converter={StaticResource FontFamilyConverter}}\" />\n      </StackPanel>\n      <StackPanel\n        Margin=\"0,0,0,2\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"50\"\n          VerticalAlignment=\"Center\"\n          Text=\"Font size\" />\n        <xctk:DoubleUpDown\n          Margin=\"4,0,0,0\"\n          Increment=\"1\"\n          Maximum=\"36.0\"\n          Minimum=\"5.0\"\n          ParsingNumberStyle=\"Number\"\n          ShowButtonSpinner=\"True\"\n          Value=\"{Binding Path=TextFontSize, Mode=TwoWay}\" />\n      </StackPanel>\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Use IR syntax highlighting\"\n        IsChecked=\"{Binding Path=ShowInfoOnHover, Mode=TwoWay}\" />\n\n\n      <CheckBox\n        x:Name=\"HoverCheckbox\"\n        Margin=\"0,2,0,2\"\n        Content=\"Show line numbers\"\n        IsChecked=\"{Binding Path=ShowInfoOnHover, Mode=TwoWay}\" />\n\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Word-wrap long lines\"\n        IsChecked=\"{Binding Path=ShowInfoOnHover, Mode=TwoWay}\" />\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n\n      <DockPanel>\n        <TextBlock\n          FontWeight=\"Medium\"\n          Text=\"Document Colors\" />\n      </DockPanel>\n\n\n      <StackPanel\n        Margin=\"0,0,0,0\"\n        Orientation=\"Vertical\">\n\n        <Grid>\n          <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"70\" />\n            <ColumnDefinition />\n          </Grid.ColumnDefinitions>\n          <xctk:ColorPicker\n            Grid.Column=\"0\"\n            Width=\"64\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            AvailableColorsSortingMode=\"HueSaturationBrightness\"\n            BorderBrush=\"#707070\"\n            IsManipulationEnabled=\"True\"\n            SelectedColor=\"{Binding Path=BackgroundColor, Mode=TwoWay}\"\n            ShowDropDownButton=\"True\" />\n          <TextBlock\n            Grid.Column=\"1\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            Text=\"Background color\" />\n        </Grid>\n        <Grid Margin=\"0,2,0,0\">\n          <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"70\" />\n            <ColumnDefinition />\n          </Grid.ColumnDefinitions>\n          <xctk:ColorPicker\n            Grid.Column=\"0\"\n            Width=\"64\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            AvailableColorsSortingMode=\"HueSaturationBrightness\"\n            BorderBrush=\"#707070\"\n            SelectedColor=\"{Binding Path=TextColor, Mode=TwoWay}\"\n            ShowDropDownButton=\"True\" />\n          <TextBlock\n            Grid.Column=\"1\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            Text=\"Default text color\" />\n        </Grid>\n        <Grid Margin=\"0,2,0,0\">\n          <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"70\" />\n            <ColumnDefinition />\n          </Grid.ColumnDefinitions>\n          <xctk:ColorPicker\n            Grid.Column=\"0\"\n            Width=\"64\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            AvailableColorsSortingMode=\"HueSaturationBrightness\"\n            BorderBrush=\"#707070\"\n            SelectedColor=\"{Binding Path=TextColor, Mode=TwoWay}\"\n            ShowDropDownButton=\"True\" />\n          <TextBlock\n            Grid.Column=\"1\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            Text=\"IR element highlight color\" />\n        </Grid>\n      </StackPanel>\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/LightDocumentOptionsPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class LightDocumentOptionsPanel : OptionsPanelBase {\n  public LightDocumentOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public bool SyntaxFileChanged { get; set; }\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n  }\n\n  public override void OnSettingsChanged(object newSettings) {\n  }\n\n  public override void PanelClosing() {\n  }\n\n  public override void PanelResetting() {\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/OptionsPanelBase.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Windows;\nusing System.Windows.Controls;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic interface IOptionsPanel {\n  SettingsBase Settings { get; set; }\n  IUISession Session { get; set; }\n  event EventHandler PanelClosed;\n  event EventHandler PanelReset;\n  event EventHandler SettingsChanged;\n  event EventHandler<bool> StayOpenChanged;\n  void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session);\n  void PanelClosing();\n  void PanelResetting();\n  void PanelAfterReset();\n}\n\npublic class OptionsPanelBase : UserControl, IOptionsPanel, INotifyPropertyChanged {\n  private bool initialized_;\n  public virtual double DefaultHeight => 320;\n  public virtual double MinimumHeight => 200;\n  public virtual double DefaultWidth => 380;\n  public virtual double MinimumWidth => 380;\n  public FrameworkElement Parent { get; set; }\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler PanelClosed;\n  public event EventHandler PanelReset;\n  public event EventHandler SettingsChanged;\n  public event EventHandler<bool> StayOpenChanged;\n  public IUISession Session { get; set; }\n\n  public SettingsBase Settings {\n    get => (SettingsBase)DataContext;\n    set {\n      if (DataContext != value) {\n        DataContext = null;\n        DataContext = value;\n\n        if (value != null && initialized_) {\n          OnSettingsChanged(value);\n        }\n      }\n    }\n  }\n\n  public virtual void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    Parent = parent;\n    Settings = settings;\n    Session = session;\n    PreviewMouseUp += (sender, args) => {\n      if (Utils.IsOptionsUpdateEvent(args)) {\n        NotifySettingsChanged();\n      }\n    };\n\n    PreviewKeyUp += (sender, args) => {\n      if (Utils.IsOptionsUpdateEvent(args)) {\n        NotifySettingsChanged();\n      }\n    };\n\n    initialized_ = true;\n  }\n\n  public virtual void PanelClosing() { }\n  public virtual void PanelResetting() { }\n  public virtual void PanelAfterReset() { }\n\n  public virtual void OnSettingsChanged(object newSettings) {\n  }\n\n  public virtual void ReloadSettings() {\n    var temp = Settings;\n    Settings = null;\n    Settings = temp;\n  }\n\n  protected virtual void NotifySettingsChanged() {\n    DelayedAction.StartNew(TimeSpan.FromMilliseconds(100), () => {\n      RaiseSettingsChanged(null);\n    });\n  }\n\n  public void RaisePanelClosed(EventArgs e) {\n    PanelClosed?.Invoke(this, e);\n  }\n\n  public void RaisePanelReset(EventArgs e) {\n    PanelReset?.Invoke(this, e);\n  }\n\n  public void RaiseSettingsChanged(EventArgs e) {\n    SettingsChanged?.Invoke(this, e);\n  }\n\n  public void RaiseStayOpenChanged(bool staysOpen) {\n    StayOpenChanged?.Invoke(this, staysOpen);\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value))\n      return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/OptionsPanelHostPopup.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.OptionsPanelHostPopup\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  Width=\"500\"\n  Height=\"450\"\n  AllowsTransparency=\"True\"\n  SnapsToDevicePixels=\"True\"\n  StaysOpen=\"False\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform x:Name=\"ZoomTransform\" />\n  </controls:DraggablePopup.LayoutTransform>\n  <Border\n    x:Name=\"Host\"\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <Grid>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"*\" />\n        <RowDefinition Height=\"32\" />\n      </Grid.RowDefinitions>\n      <ScrollViewer\n        x:Name=\"PanelHost\"\n        Grid.Row=\"0\"\n        HorizontalScrollBarVisibility=\"Disabled\"\n        VerticalScrollBarVisibility=\"Auto\" />\n\n      <Grid\n        Grid.Row=\"1\"\n        Margin=\"4,4,4,4\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"50\" />\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"50\" />\n        </Grid.ColumnDefinitions>\n        <Button\n          x:Name=\"ResetButton\"\n          Grid.Column=\"0\"\n          Width=\"50\"\n          Height=\"24\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderThickness=\"1,1,1,1\"\n          Click=\"ResetButton_Click\"\n          Content=\"Reset\"\n          Visibility=\"{Binding Path=ShowResetButton, Converter={StaticResource BoolToVisibilityConverter}}\" />\n        <Button\n          x:Name=\"CloseButton\"\n          Grid.Column=\"2\"\n          Width=\"50\"\n          Height=\"24\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderThickness=\"1,1,1,1\"\n          Click=\"CloseButton_Click\"\n          Content=\"Close\" />\n\n      </Grid>\n      <controls:ResizeGrip\n        x:Name=\"PanelResizeGrip\"\n        Grid.Row=\"1\"\n        Width=\"16\"\n        Height=\"16\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Bottom\"\n        Panel.ZIndex=\"100\" />\n    </Grid>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/OptionsPanelHostPopup.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class OptionsPanelHostPopup : DraggablePopup, IOptionsPanel {\n  private bool closed_;\n  private IOptionsPanel optionsPanel_;\n\n  public OptionsPanelHostPopup(UserControl panel, Point position,\n                               double width, double height,\n                               UIElement referenceElement,\n                               SettingsBase settings, IUISession session,\n                               bool showResetButton = true) {\n    InitializeComponent();\n\n    // Offset to account for drop shadow margin.\n    position.Offset(6, 0);\n    Initialize(position, width, height, referenceElement);\n    ZoomTransform.ScaleX = WindowScaling;\n    ZoomTransform.ScaleY = WindowScaling;\n\n    StaysOpen = true; // Keep popup open when clicking outside.\n    PanelResizeGrip.ResizedControl = this;\n    ShowResetButton = showResetButton;\n\n    optionsPanel_ = (IOptionsPanel)panel;\n    optionsPanel_.Initialize(this, settings, session);\n    optionsPanel_.PanelClosed += SettingsPanel_PanelClosed;\n    optionsPanel_.PanelReset += SettingsPanel_PanelReset;\n    optionsPanel_.SettingsChanged += SettingsPanel_SettingsChanged;\n    optionsPanel_.StayOpenChanged += OptionsPanel_StayOpenChanged;\n    PanelHost.Content = panel;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public bool ShowResetButton { get; set; }\n  public event EventHandler PanelClosed;\n  public event EventHandler PanelReset;\n  public event EventHandler SettingsChanged;\n  public event EventHandler<bool> StayOpenChanged;\n\n  public SettingsBase Settings {\n    get => optionsPanel_.Settings;\n    set => optionsPanel_.Settings = value;\n  }\n\n  public IUISession Session {\n    get => optionsPanel_.Session;\n    set => optionsPanel_.Session = value;\n  }\n\n  public void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    Settings = settings;\n    Session = session;\n  }\n\n  public void PanelClosing() { }\n  public void PanelResetting() { }\n  public void PanelAfterReset() { }\n\n  public static OptionsPanelHostPopup Create<T, S>(SettingsBase settings, FrameworkElement relativeControl,\n                                                   IUISession session,\n                                                   Func<S, bool, Task<S>> newSettingsHandler,\n                                                   Action panelClosedHandler,\n                                                   Point positionAdjustment = new(),\n                                                   bool dockLeft = false)\n    where T : OptionsPanelBase, new()\n    where S : SettingsBase, new() {\n    var panel = new T();\n    double width = Math.Max(panel.MinimumWidth,\n                            Math.Min(relativeControl.ActualWidth, panel.DefaultWidth));\n    double height = Math.Max(panel.MinimumHeight,\n                             Math.Min(relativeControl.ActualHeight, panel.DefaultHeight));\n    var position = dockLeft ? new Point(0, 0) :\n      new Point(relativeControl.ActualWidth - width, 0);\n    position.Offset(positionAdjustment.X, positionAdjustment.Y);\n    var panelHost = new OptionsPanelHostPopup(panel, position, width, height, relativeControl,\n                                              settings, session);\n    panelHost.SettingsChanged += async (sender, args) => {\n      var result = await newSettingsHandler((S)panelHost.Settings, false);\n\n      if (result != null) {\n        panel.Settings = result;\n      }\n    };\n    panelHost.PanelReset += async (sender, args) => {\n      var newSettings = new S();\n      panelHost.Settings = newSettings;\n      var result = await newSettingsHandler(newSettings, true);\n\n      if (result != null) {\n        panel.Settings = result;\n      }\n    };\n    panelHost.PanelClosed += (sender, args) => {\n      panelHost.IsOpen = false;\n      panelHost.PanelClosed = null;\n      panelHost.PanelReset = null;\n      panelHost.SettingsChanged = null;\n      newSettingsHandler((S)panelHost.Settings, true);\n      panelClosedHandler();\n    };\n\n    panelHost.IsOpen = true;\n    return panelHost;\n  }\n\n  protected override void OnClosed(EventArgs e) {\n    base.OnClosed(e);\n\n    optionsPanel_.PanelClosed -= SettingsPanel_PanelClosed;\n    optionsPanel_.PanelReset -= SettingsPanel_PanelReset;\n    optionsPanel_.SettingsChanged -= SettingsPanel_SettingsChanged;\n\n    if (!closed_) {\n      closed_ = true;\n      PanelClosed?.Invoke(this, e);\n    }\n  }\n\n  private void SettingsPanel_SettingsChanged(object sender, EventArgs e) {\n    SettingsChanged?.Invoke(this, e);\n  }\n\n  private void SettingsPanel_PanelReset(object sender, EventArgs e) {\n    PanelReset?.Invoke(this, e);\n  }\n\n  private void SettingsPanel_PanelClosed(object sender, EventArgs e) {\n    closed_ = true;\n    PanelClosed?.Invoke(this, e);\n  }\n\n  private void OptionsPanel_StayOpenChanged(object sender, bool staysOpen) {\n    StaysOpen = staysOpen;\n  }\n\n  private void ResetButton_Click(object sender, RoutedEventArgs e) {\n    using var centerForm = new DialogCenteringHelper(this);\n\n    if (MessageBox.Show(\"Do you want to reset all settings?\", \"Profile Explorer\",\n                        MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes) {\n      return;\n    }\n\n    optionsPanel_.PanelResetting();\n    PanelReset?.Invoke(this, e);\n    optionsPanel_.PanelAfterReset();\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    closed_ = true;\n    optionsPanel_.PanelClosing();\n    PanelClosed?.Invoke(this, e);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/PreviewPopupOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.PreviewPopupOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel Margin=\"4,4,4,4\">\n      <TextBlock\n        Margin=\"0,4,0,0\"\n        FontWeight=\"Medium\"\n        Text=\"Preview Popup\" />\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Jump to the hottest function line\"\n        IsChecked=\"{Binding JumpToHottestElement, Mode=TwoWay}\"\n        ToolTip=\"Jump to the hottest profiled instruction/source line\" />\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Use compact profiling time columns\"\n        IsChecked=\"{Binding UseCompactProfilingColumns, Mode=TwoWay}\"\n        ToolTip=\"Display only the profiling duration column\" />\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Show performance counter columns\"\n        IsChecked=\"{Binding ShowPerformanceCounterColumns, Mode=TwoWay}\"\n        IsEnabled=\"True\"\n        ToolTip=\"Display the performance counter columns\" />\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Show performance metric columns\"\n        IsChecked=\"{Binding ShowPerformanceMetricColumns, Mode=TwoWay}\"\n        IsEnabled=\"True\"\n        ToolTip=\"Display the performance metric columns\" />\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Use smaller font size\"\n        IsChecked=\"{Binding UseSmallerFontSize, Mode=TwoWay}\"\n        ToolTip=\"Use a more compact, smaller font size\" />\n      <TextBlock\n        Margin=\"0,4,0,0\"\n        VerticalAlignment=\"Center\"\n        Text=\"Initial function view:\" />\n      <RadioButton\n        Margin=\"0,4,0,2\"\n        VerticalAlignment=\"Center\"\n        Content=\"Assembly\"\n        IsChecked=\"{Binding ShowSourcePreviewPopup, Converter={StaticResource InvertedBoolConverter}}\" />\n      <RadioButton\n        Margin=\"0,2,0,0\"\n        VerticalAlignment=\"Center\"\n        Content=\"Source code\"\n        IsChecked=\"{Binding ShowSourcePreviewPopup}\" />\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/PreviewPopupOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class PreviewPopupOptionsPanel : OptionsPanelBase {\n  public PreviewPopupOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override double DefaultHeight => 250;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/ProfilingOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.ProfilingOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TextBlock Text=\"TODO: Move Profiling Options from window here\" />\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/ProfilingOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class ProfilingOptionsPanel : OptionsPanelBase {\n  public ProfilingOptionsPanel() {\n    InitializeComponent();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/RemarkOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.RemarkOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"480\"\n  d:DesignWidth=\"330\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"142\" />\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"145\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      Grid.Row=\"0\"\n      Margin=\"4,4,4,4\">\n      <StackPanel>\n        <TextBlock\n          FontWeight=\"Medium\"\n          Text=\"Remarks\" />\n        <CheckBox\n          Margin=\"0,4,0,2\"\n          Content=\"Show remarks\"\n          IsChecked=\"{Binding Path=ShowRemarks}\" />\n        <CheckBox\n          Name=\"PreviousSectionsCheckbox\"\n          Margin=\"0,0,0,2\"\n          Content=\"Include remarks from previous sections\"\n          IsChecked=\"{Binding Path=ShowPreviousSections}\" />\n\n        <StackPanel\n          Margin=\"0,2,0,2\"\n          Orientation=\"Horizontal\">\n          <TextBlock\n            Margin=\"32,0,4,2\"\n            VerticalAlignment=\"Center\"\n            Text=\"History depth\" />\n          <xctk:IntegerUpDown\n            Margin=\"0,0,8,0\"\n            IsEnabled=\"{Binding ElementName=PreviousSectionsCheckbox, Path=IsChecked}\"\n            Maximum=\"16\"\n            Minimum=\"1\"\n            ParsingNumberStyle=\"Number\"\n            ShowButtonSpinner=\"True\"\n            ToolTip=\"Number of whitespace letters to use for each level of indentation\"\n            Value=\"{Binding Path=SectionHistoryDepth, Mode=TwoWay}\" />\n          <TextBlock\n            VerticalAlignment=\"Center\"\n            Text=\"sections\" />\n        </StackPanel>\n        <CheckBox\n          Margin=\"32,2,0,2\"\n          Content=\"Stop at section boundaries\"\n          IsChecked=\"{Binding Path=StopAtSectionBoundaries}\"\n          IsEnabled=\"{Binding ElementName=PreviousSectionsCheckbox, Path=IsChecked}\" />\n        <CheckBox\n          Margin=\"32,0,0,2\"\n          Content=\"Show previous optimization remarks on margin\"\n          IsChecked=\"{Binding Path=ShowPreviousOptimizationRemarks}\"\n          IsEnabled=\"{Binding ElementName=PreviousSectionsCheckbox, Path=IsChecked}\" />\n        <CheckBox\n          Margin=\"32,0,0,2\"\n          Content=\"Show previous analysis remarks on margin\"\n          IsChecked=\"{Binding Path=ShowPreviousAnalysisRemarks}\"\n          IsEnabled=\"{Binding ElementName=PreviousSectionsCheckbox, Path=IsChecked}\" />\n        <Separator\n          Margin=\"0,4,0,0\"\n          Background=\"LightGray\" />\n      </StackPanel>\n    </Grid>\n\n    <Grid\n      Grid.Row=\"1\"\n      Margin=\"4,8,4,4\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"124\" />\n        <ColumnDefinition Width=\"1\" />\n        <ColumnDefinition Width=\"*\" />\n      </Grid.ColumnDefinitions>\n\n      <StackPanel\n        Grid.Column=\"0\"\n        Margin=\"0,0,4,0\">\n        <StackPanel Orientation=\"Horizontal\">\n          <TextBlock\n            Margin=\"0,2,0,4\"\n            FontWeight=\"Medium\"\n            Text=\"Filter by Kind\" />\n          <Button\n            Name=\"SetAllKindCheckboxesButton\"\n            Width=\"20\"\n            Height=\"20\"\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"{x:Null}\"\n            Click=\"SetAllKindCheckboxesButton_Click\"\n            ToolTip=\"Select All\">\n            <Image Source=\"{StaticResource TasklistIcon}\" />\n          </Button>\n          <Button\n            Name=\"ResetAllKindCheckboxesButton\"\n            Width=\"20\"\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"{x:Null}\"\n            Click=\"ResetAllKindCheckboxesButton_Click\"\n            ToolTip=\"Clear All\">\n            <Image Source=\"{StaticResource ClearIcon}\" />\n          </Button>\n        </StackPanel>\n\n        <CheckBox\n          Name=\"OptimizationCheckbox\"\n          Margin=\"0,0,0,2\"\n          Content=\"Optimization\"\n          IsChecked=\"{Binding Path=Optimization}\" />\n        <CheckBox\n          Name=\"AnalysisCheckbox\"\n          Margin=\"0,0,0,2\"\n          Content=\"Analysis\"\n          IsChecked=\"{Binding Path=Analysis}\" />\n        <CheckBox\n          Name=\"StandardCheckbox\"\n          Margin=\"0,8,0,2\"\n          Content=\"Standard\"\n          IsChecked=\"{Binding Path=Default}\" />\n        <CheckBox\n          Name=\"VerboseCheckbox\"\n          Margin=\"0,0,0,2\"\n          Content=\"Verbose\"\n          IsChecked=\"{Binding Path=Verbose}\" />\n        <CheckBox\n          Name=\"TraceCheckbox\"\n          Margin=\"0,0,0,2\"\n          Content=\"Trace\"\n          IsChecked=\"{Binding Path=Trace}\" />\n\n      </StackPanel>\n      <Grid\n        Grid.Column=\"1\"\n        Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\" />\n\n      <StackPanel\n        Grid.Column=\"2\"\n        Margin=\"8,0,0,0\">\n        <StackPanel Orientation=\"Horizontal\">\n          <TextBlock\n            Margin=\"0,2,0,4\"\n            FontWeight=\"Medium\"\n            Text=\"Filter by Category\" />\n\n          <Button\n            Name=\"SetAllCategoryCheckboxesButton\"\n            Width=\"20\"\n            Height=\"20\"\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"{x:Null}\"\n            Click=\"SetAllCategoryCheckboxesButton_Click\"\n            ToolTip=\"Select all\">\n            <Image Source=\"{StaticResource TasklistIcon}\" />\n          </Button>\n\n          <Button\n            Name=\"ResetAllCategoryCheckboxesButton\"\n            Width=\"20\"\n            Height=\"20\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"{x:Null}\"\n            Click=\"ResetAllCategoryCheckboxesButton_Click\"\n            ToolTip=\"Clear all\">\n            <Image Source=\"{StaticResource ClearIcon}\" />\n          </Button>\n\n          <Button\n            Name=\"EditButton\"\n            Width=\"20\"\n            Height=\"20\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"{x:Null}\"\n            Click=\"EditButton_Click\"\n            ToolTip=\"Edit remark definition file (JSON format)\">\n            <Image Source=\"{StaticResource EditIcon}\" />\n          </Button>\n          <Button\n            Name=\"ReloadButton\"\n            Width=\"20\"\n            Height=\"20\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            BorderBrush=\"{x:Null}\"\n            Click=\"ReloadButton_Click\"\n            ToolTip=\"Reload the remark definitions\">\n            <Image Source=\"{StaticResource ReloadIcon}\" />\n          </Button>\n        </StackPanel>\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <StackPanel Name=\"CategoriesList\">\n            <CheckBox Content=\"CSE\" />\n            <CheckBox Content=\"PEEP\" />\n            <CheckBox Content=\"CFG\" />\n          </StackPanel>\n        </ScrollViewer>\n      </StackPanel>\n    </Grid>\n\n    <Grid\n      Grid.Row=\"2\"\n      Margin=\"4,4,4,4\">\n      <StackPanel>\n\n        <Separator\n          Margin=\"0,0,0,4\"\n          Background=\"LightGray\" />\n        <TextBlock\n          Margin=\"0,0,0,4\"\n          FontWeight=\"Medium\"\n          Text=\"Remark Interaction and Style\" />\n        <CheckBox\n          Name=\"ActionButtonCheckbox\"\n          Margin=\"0,0,0,2\"\n          Content=\"Show action button on element hover\"\n          IsChecked=\"{Binding Path=ShowActionButtonOnHover}\" />\n        <CheckBox\n          Margin=\"20,2,0,2\"\n          Content=\"Only when the Ctrl/Alt/Shift key is pressed\"\n          IsChecked=\"{Binding Path=ShowActionButtonWithModifier}\"\n          IsEnabled=\"{Binding ElementName=ActionButtonCheckbox, Path=IsChecked}\" />\n        <CheckBox\n          Margin=\"0,2,0,2\"\n          Content=\"Show remarks on left document margin\"\n          IsChecked=\"{Binding Path=ShowMarginRemarks}\" />\n        <CheckBox\n          Margin=\"0,0,0,2\"\n          Content=\"Show remarks on document text\"\n          IsChecked=\"{Binding Path=ShowDocumentRemarks}\" />\n        <CheckBox\n          Name=\"UseRemarkBackgroundCheckbox\"\n          Margin=\"0,0,0,2\"\n          Content=\"Use background color for document remarks\"\n          IsChecked=\"{Binding Path=UseRemarkBackground}\" />\n\n        <StackPanel Orientation=\"Horizontal\">\n          <CheckBox\n            Name=\"UseTransparentRemarkBackgroundCheckbox\"\n            Margin=\"20,2,0,2\"\n            Content=\"Background color opacity\"\n            IsChecked=\"{Binding Path=UseTransparentRemarkBackground}\"\n            IsEnabled=\"{Binding ElementName=UseRemarkBackgroundCheckbox, Path=IsChecked}\" />\n          <Slider\n            Width=\"75\"\n            Margin=\"8,0,0,0\"\n            Foreground=\"{DynamicResource DisabledForegroundBrush}\"\n            IsEnabled=\"{Binding ElementName=UseTransparentRemarkBackgroundCheckbox, Path=IsChecked}\"\n            Maximum=\"100\"\n            Minimum=\"1\"\n            TickFrequency=\"10\"\n            TickPlacement=\"BottomRight\"\n            Value=\"{Binding Path=RemarkBackgroundOpacity}\" />\n          <TextBlock\n            Margin=\"8,0,0,0\"\n            Text=\"{Binding Path=RemarkBackgroundOpacity}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"%\" />\n        </StackPanel>\n      </StackPanel>\n    </Grid>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/RemarkOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class RemarkOptionsPanel : OptionsPanelBase {\n  public const double LeftMargin = 200;\n  private List<CheckBox> kindCheckboxes_;\n  private List<CheckBox> categoryCheckboxes_;\n\n  public RemarkOptionsPanel() {\n    InitializeComponent();\n    kindCheckboxes_ = new List<CheckBox>();\n    kindCheckboxes_.Add(OptimizationCheckbox);\n    kindCheckboxes_.Add(AnalysisCheckbox);\n    kindCheckboxes_.Add(StandardCheckbox);\n    kindCheckboxes_.Add(VerboseCheckbox);\n    kindCheckboxes_.Add(TraceCheckbox);\n  }\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n    PopulateCategoryList();\n  }\n\n  private void SetCheckboxesState(List<CheckBox> list, bool state) {\n    list.ForEach(item => item.IsChecked = state);\n  }\n\n  private bool PopulateCategoryList() {\n    var remarkSettings = (RemarkSettings)DataContext;\n    categoryCheckboxes_ = new List<CheckBox>();\n\n    bool initialLoad = !remarkSettings.HasCategoryFilters;\n    var categories = App.Session.RemarkProvider.RemarkCategories;\n\n    if (categories == null) {\n      using var centerForm = new DialogCenteringHelper(Parent);\n      MessageBox.Show(\"Failed to load remark settings file,\\ncheck JSON for any syntax errors!\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Error);\n      return false;\n    }\n\n    CategoriesList.Children.Clear();\n\n    foreach (var category in categories) {\n      if (!string.IsNullOrEmpty(category.Title)) {\n        var checkbox = new CheckBox();\n        checkbox.Content = category.Title;\n        checkbox.Margin = new Thickness(0, 0, 0, 2);\n\n        if (category.AddTextMark) {\n          checkbox.Background = ColorBrushes.GetBrush(category.TextMarkBorderColor);\n        }\n        else if (category.AddLeftMarginMark) {\n          checkbox.Background = ColorBrushes.GetBrush(category.MarkColor);\n        }\n\n        if (initialLoad) {\n          checkbox.IsChecked = true;\n        }\n        else if (remarkSettings.CategoryFilter.TryGetValue(category.Title, out bool state)) {\n          checkbox.IsChecked = state;\n        }\n\n        checkbox.Tag = category;\n        checkbox.Checked += Checkbox_CheckedChanged;\n        checkbox.Unchecked += Checkbox_CheckedChanged;\n        CategoriesList.Children.Add(checkbox);\n        categoryCheckboxes_.Add(checkbox);\n      }\n    }\n\n    return true;\n  }\n\n  private void Checkbox_CheckedChanged(object sender, RoutedEventArgs e) {\n    UpdateCategoryFilter();\n    NotifySettingsChanged();\n  }\n\n  private void UpdateCategoryFilter() {\n    var remarkSettings = (RemarkSettings)DataContext;\n    remarkSettings.CategoryFilter = new Dictionary<string, bool>();\n\n    foreach (var checkbox in categoryCheckboxes_) {\n      var category = (RemarkCategory)checkbox.Tag;\n      remarkSettings.CategoryFilter[category.Title] = checkbox.IsChecked.HasValue && checkbox.IsChecked.Value;\n    }\n  }\n\n  private void SetAllKindCheckboxesButton_Click(object sender, RoutedEventArgs e) {\n    SetCheckboxesState(kindCheckboxes_, true);\n  }\n\n  private void ResetAllKindCheckboxesButton_Click(object sender, RoutedEventArgs e) {\n    SetCheckboxesState(kindCheckboxes_, false);\n  }\n\n  private void EditButton_Click(object sender, RoutedEventArgs e) {\n    string settingsPath = App.GetRemarksDefinitionFilePath(App.Session.CompilerInfo.CompilerIRName);\n    App.LaunchSettingsFileEditor(settingsPath);\n  }\n\n  private void SetAllCategoryCheckboxesButton_Click(object sender, RoutedEventArgs e) {\n    SetCheckboxesState(categoryCheckboxes_, true);\n  }\n\n  private void ResetAllCategoryCheckboxesButton_Click(object sender, RoutedEventArgs e) {\n    SetCheckboxesState(categoryCheckboxes_, false);\n  }\n\n  private void ReloadButton_Click(object sender, RoutedEventArgs e) {\n    PopulateCategoryList();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/SectionOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.SectionOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Function List\" />\n          <CheckBox\n            x:Name=\"StatisticsCheckbox\"\n            Margin=\"0,4,0,2\"\n            Content=\"Compute instruction statistics\"\n            IsChecked=\"{Binding ComputeStatistics, Mode=TwoWay}\"\n            ToolTip=\"Compute IR statistics on load and show extra columns with the values for each function\" />\n          <CheckBox\n            x:Name=\"CallGraphStatisticsCheckbox\"\n            Margin=\"20,2,0,2\"\n            Content=\"Include call statistics\"\n            IsChecked=\"{Binding IncludeCallGraphStatistics, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=StatisticsCheckbox, Path=IsChecked}\"\n            ToolTip=\"Include caller/callee count function statistics\" />\n          <CheckBox\n            x:Name=\"DemanglingCheckbox\"\n            Margin=\"0,4,0,2\"\n            Content=\"Show demangled function names\"\n            IsChecked=\"{Binding ShowDemangledNames, Mode=TwoWay}\"\n            ToolTip=\"Automatically demangle (undecorate) C++ function names\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Exclude return types\"\n            IsChecked=\"{Binding DemangleNoReturnType, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=DemanglingCheckbox, Path=IsChecked}\"\n            ToolTip=\"Exclude the function return type from the demangled name\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Exclude special keywords\"\n            IsChecked=\"{Binding DemangleNoSpecialKeywords, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=DemanglingCheckbox, Path=IsChecked}\"\n            ToolTip=\"Exclude any vendor-specific keywords from the demangled name\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Use simplified demangled form\"\n            IsChecked=\"{Binding DemangleOnlyNames, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=DemanglingCheckbox, Path=IsChecked}\"\n            ToolTip=\"Demangle only the scope and function name, without parameters\" />\n          <CheckBox\n            Margin=\"20,2,0,0\"\n            Content=\"Show mangled names column\"\n            IsChecked=\"{Binding ShowMangleNamesColumn, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=DemanglingCheckbox, Path=IsChecked}\"\n            ToolTip=\"Show a column with the mangled (decorated) function names\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Alternate list view background color\"\n            IsChecked=\"{Binding AlternateListRows, Mode=TwoWay}\"\n            ToolTip=\"Alternate the background color of the function/module list view items\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"List Filtering\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Use case-sensitive function name search\"\n            IsChecked=\"{Binding FunctionSearchCaseSensitive, Mode=TwoWay}\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Use case-sensitive section name search\"\n            IsChecked=\"{Binding SectionSearchCaseSensitive, Mode=TwoWay}\" />\n\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Document Diffs\" />\n\n          <Grid Margin=\"0,4,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"Gray\"\n              SelectedColor=\"{Binding NewSectionColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"New section border color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"Gray\"\n              SelectedColor=\"{Binding MissingSectionColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Missing section border color\" />\n          </Grid>\n          <Grid Margin=\"0,2,0,0\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"Gray\"\n              SelectedColor=\"{Binding ChangedSectionColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Changed section border color\" />\n          </Grid>\n        </StackPanel>\n      </TabItem>\n      <TabItem\n        Header=\"Profiling\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Options for profiling UI and annotations\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Show Modules list section\"\n            IsChecked=\"{Binding ShowModulePanel, Mode=TwoWay}\"\n            ToolTip=\"Show the list of modules (binaries) on the left-hand side\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Sync function in other profiling views\"\n            IsChecked=\"{Binding SyncSelection, Mode=TwoWay}\"\n            ToolTip=\"Sync function displayed in other profiling views with selection\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Sync Source File view with selection\"\n            IsChecked=\"{Binding SyncSourceFile, Mode=TwoWay}\"\n            ToolTip=\"Sync file displayed in the Source File view with selection\" />\n          <!-- <CheckBox -->\n          <!--   Margin=\"0,2,0,2\" -->\n          <!--   Content=\"Append module name before function\" -->\n          <!--   IsChecked=\"{Binding SyncSelection, Mode=TwoWay}\" -->\n          <!--   IsEnabled=\"False\" -->\n          <!--   ToolTip=\"NYI: Show the module name in front of the function name\" /> -->\n          <CheckBox\n            x:Name=\"ShowCallStackPopupCheckbox\"\n            Margin=\"0,2,0,2\"\n            Content=\"Show hottest call stack popup on hover\"\n            IsChecked=\"{Binding ShowCallStackPopup, Mode=TwoWay}\"\n            ToolTip=\"On mouse hover over a function, show a popup with the hottest call stack including it\" />\n\n          <StackPanel\n            Margin=\"20,2,0,2\"\n            IsEnabled=\"{Binding ElementName=ShowCallStackPopupCheckbox, Path=IsChecked}\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              VerticalAlignment=\"Center\"\n              Text=\"Hover duration (ms)\" />\n            <xctk:IntegerUpDown\n              Width=\"70\"\n              Margin=\"8,0,0,0\"\n              Maximum=\"5000\"\n              Minimum=\"50\"\n              ParsingNumberStyle=\"Number\"\n              ShowButtonSpinner=\"True\"\n              Value=\"{Binding Path=CallStackPopupDuration, Mode=TwoWay}\" />\n            <Button\n              Height=\"20\"\n              Margin=\"4,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"ResetCallStackPopupDurationButton_Click\"\n              Content=\"Default\"\n              ToolTip=\"Reset value to default duration\" />\n            <Button\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"ShortCallStackPopupDurationButton_Click\"\n              Content=\"Short\"\n              ToolTip=\"Reset value to default duration\" />\n            <Button\n              Height=\"20\"\n              Margin=\"2,0,0,0\"\n              Padding=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Click=\"LongCallStackPopupDurationButton_Click\"\n              Content=\"Long\"\n              ToolTip=\"Reset value to default duration\" />\n          </StackPanel>\n\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Function List Columns\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Show performance counter columns\"\n            IsChecked=\"{Binding ShowPerformanceCounterColumns, Mode=TwoWay}\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Show performance metric columns\"\n            IsChecked=\"{Binding ShowPerformanceMetricColumns, Mode=TwoWay}\" />\n\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Include duration in total time column\"\n            IsChecked=\"{Binding AppendTimeToTotalColumn, Mode=TwoWay}\" />\n          <CheckBox\n            Margin=\"0,2,0,2\"\n            Content=\"Include duration in self time column\"\n            IsChecked=\"{Binding AppendTimeToSelfColumn, Mode=TwoWay}\" />\n        </StackPanel>\n      </TabItem>\n      <!-- <TabItem -->\n      <!--   x:Name=\"SectionsPanel\" -->\n      <!--   Header=\"Sections\" -->\n      <!--   Style=\"{StaticResource TabControlStyle}\"> -->\n      <!--   <StackPanel Margin=\"4,4,4,4\"> -->\n      <!--     <TextBlock -->\n      <!--       FontWeight=\"Medium\" -->\n      <!--       Text=\"Section List\" /> -->\n      <!--     <StackPanel Orientation=\"Horizontal\"> -->\n      <!--       <CheckBox -->\n      <!--         Margin=\"0,4,20,2\" -->\n      <!--         Content=\"Use semantic colorization of section names\" -->\n      <!--         IsChecked=\"{Binding ColorizeSectionNames, Mode=TwoWay}\" /> -->\n      <!--       <Button -->\n      <!--         Name=\"EditButton\" -->\n      <!--         Width=\"20\" -->\n      <!--         Height=\"20\" -->\n      <!--         VerticalAlignment=\"Top\" -->\n      <!--         Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n      <!--         Click=\"EditButton_Click\" -->\n      <!--         ToolTip=\"Edit section style definition file (JSON format)\"> -->\n      <!--         <Image Source=\"{StaticResource EditIcon}\" /> -->\n      <!--       </Button> -->\n      <!-- -->\n      <!--       <Button -->\n      <!--         Name=\"ReloadButton\" -->\n      <!--         Width=\"20\" -->\n      <!--         Height=\"20\" -->\n      <!--         VerticalAlignment=\"Top\" -->\n      <!--         Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n      <!--         Click=\"ReloadButton_Click\" -->\n      <!--         ToolTip=\"Reload the session style definitions\"> -->\n      <!--         <Image Source=\"{StaticResource ReloadIcon}\" /> -->\n      <!--       </Button> -->\n      <!--     </StackPanel> -->\n      <!-- -->\n      <!--     <CheckBox -->\n      <!--       Name=\"IndentationCheckbox\" -->\n      <!--       Margin=\"0,2,0,2\" -->\n      <!--       Content=\"Use indentation for nested section names\" -->\n      <!--       IsChecked=\"{Binding UseNameIndentation, Mode=TwoWay}\" -->\n      <!--       ToolTip=\"Show section names indentend based on the parent/child relationship\" /> -->\n      <!--     <StackPanel -->\n      <!--       Margin=\"20,2,0,2\" -->\n      <!--       Orientation=\"Horizontal\"> -->\n      <!--       <TextBlock -->\n      <!--         VerticalAlignment=\"Center\" -->\n      <!--         Text=\"Indentation amount\" /> -->\n      <!--       <xctk:IntegerUpDown -->\n      <!--         Margin=\"4,0,0,0\" -->\n      <!--         IsEnabled=\"{Binding ElementName=IndentationCheckbox, Path=IsChecked}\" -->\n      <!--         Maximum=\"16\" -->\n      <!--         Minimum=\"1\" -->\n      <!--         ParsingNumberStyle=\"Number\" -->\n      <!--         ShowButtonSpinner=\"True\" -->\n      <!--         ToolTip=\"Number of whitespace letters to use for each level of indentation\" -->\n      <!--         Value=\"{Binding Path=IndentationAmount, Mode=TwoWay}\" /> -->\n      <!--     </StackPanel> -->\n      <!--     <CheckBox -->\n      <!--       Margin=\"0,2,0,2\" -->\n      <!--       Content=\"Show section group separators\" -->\n      <!--       IsChecked=\"{Binding ShowSectionSeparators, Mode=TwoWay}\" -->\n      <!--       ToolTip=\"Show before/after section separator lines for groups of sections\" /> -->\n      <!-- -->\n      <!-- -->\n      <!--     <CheckBox -->\n      <!--       x:Name=\"IdenticalToPreviousCheckbox\" -->\n      <!--       Margin=\"0,2,0,2\" -->\n      <!--       Content=\"Mark sections identical to previous\" -->\n      <!--       IsChecked=\"{Binding MarkSectionsIdenticalToPrevious, Mode=TwoWay}\" -->\n      <!--       ToolTip=\"Identify sequences of sections with no changes in the IR compared to previous one\" /> -->\n      <!--     <CheckBox -->\n      <!--       Margin=\"20,2,0,2\" -->\n      <!--       Content=\"Lower text opacity for identical sections\" -->\n      <!--       IsChecked=\"{Binding LowerIdenticalToPreviousOpacity, Mode=TwoWay}\" -->\n      <!--       IsEnabled=\"{Binding ElementName=IdenticalToPreviousCheckbox, Path=IsChecked}\" -->\n      <!--       ToolTip=\"Make the section name semi-transparent if it's identical to the previous one\" /> -->\n      <!--     <CheckBox -->\n      <!--       Margin=\"0,4,0,2\" -->\n      <!--       Content=\"Mark sections with annotations\" -->\n      <!--       IsChecked=\"{Binding MarkAnnotatedSections, Mode=TwoWay}\" -->\n      <!--       ToolTip=\"Tag sections that have highlighted IR, bookmarks and other annotations\" /> -->\n      <!-- -->\n      <!--   </StackPanel> -->\n      <!-- </TabItem> -->\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/SectionOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class SectionOptionsPanel : OptionsPanelBase {\n  public SectionOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override double DefaultHeight => 450;\n  public override double DefaultWidth => 400;\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n  }\n\n  private void EditButton_Click(object sender, RoutedEventArgs e) {\n    string settingsPath = App.GetSectionsDefinitionFilePath(Session.CompilerInfo.CompilerIRName);\n    App.LaunchSettingsFileEditor(settingsPath);\n  }\n\n  private void ReloadButton_Click(object sender, RoutedEventArgs e) {\n    Session.SectionStyleProvider.LoadSettings();\n  }\n\n  private void ResetCallStackPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((UISectionSettings)Settings).CallStackPopupDuration = UISectionSettings.DefaultCallStackPopupDuration;\n    ReloadSettings();\n  }\n\n  private void ShortCallStackPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((UISectionSettings)Settings).CallStackPopupDuration = HoverPreview.HoverDurationMs;\n    ReloadSettings();\n  }\n\n  private void LongCallStackPopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((UISectionSettings)Settings).CallStackPopupDuration = HoverPreview.LongHoverDurationMs;\n    ReloadSettings();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/SourceFileOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.SourceFileOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:utilities=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <local:OptionsPanelBase.Resources>\n    <CollectionViewSource\n      x:Key=\"FontCollection\"\n      Source=\"{Binding Source={x:Static Fonts.SystemFontFamilies}}\" />\n    <utilities:FontFamilyConverter x:Key=\"FontFamilyConverter\" />\n  </local:OptionsPanelBase.Resources>\n\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <TabControl\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <CheckBox\n            x:Name=\"AssemblyCheckBox\"\n            Margin=\"0,2,0,0\"\n            Content=\"Show assembly sections for source lines\"\n            IsChecked=\"{Binding Path=ShowInlineAssembly, Mode=TwoWay}\"\n            ToolTip=\"Display the associated assembly instructions for each source line\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Auto-expand all assembly sections\"\n            IsChecked=\"{Binding Path=AutoExpandInlineAssembly, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=AssemblyCheckBox, Path=IsChecked}\"\n            ToolTip=\"Display the assembly sections in expanded state by default\" />\n          <CheckBox\n            x:Name=\"StatementsCheckBox\"\n            Margin=\"0,4,0,0\"\n            Content=\"Show source code statement annotations\"\n            IsChecked=\"{Binding Path=ShowSourceStatements, Mode=TwoWay}\"\n            ToolTip=\"Parse source file and mark loops and if/else/switch statements in the profiling columns\" />\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Replace only insignificant column values\"\n            IsChecked=\"{Binding Path=ReplaceInsignificantSourceStatements, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=StatementsCheckBox, Path=IsChecked}\"\n            ToolTip=\"Show annotations in the profiling columns only if replacing insignificant values.&#x0a;If not replaced, annotation is displayed in document left margin\" />\n\n          <CheckBox\n            Margin=\"20,2,0,2\"\n            Content=\"Show statement annotations on left margin\"\n            IsChecked=\"{Binding Path=ShowSourceStatementsOnMargin, Mode=TwoWay}\"\n            IsEnabled=\"{Binding ElementName=StatementsCheckBox, Path=IsChecked}\"\n            ToolTip=\"Show the statement annotations as icons in the document left margin\" />\n\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Sync selected line with Assembly view\"\n            IsChecked=\"{Binding Path=SyncLineWithDocument, Mode=TwoWay}\"\n            ToolTip=\"Sync the corresponding lines with the selection in the Assembly view\" />\n          <CheckBox\n            Margin=\"0,2,0,0\"\n            Content=\"Sync inlinee with Assembly view\"\n            IsChecked=\"{Binding Path=SyncInlineeWithDocument, Mode=TwoWay}\"\n            ToolTip=\"Display the deepest inlined function for the selection in the Assembly view\" />\n\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Document Style\" />\n          <CheckBox\n            Margin=\"0,4,0,2\"\n            Content=\"Highlight current text line\"\n            IsChecked=\"{Binding Path=HighlightCurrentLine, Mode=TwoWay}\"\n            ToolTip=\"Mark the current line in the document with a border\" />\n          <CheckBox\n            x:Name=\"SyncWithDocumentCheckBox\"\n            Margin=\"0,2,0,4\"\n            Content=\"Sync style with Assembly view\"\n            IsChecked=\"{Binding Path=SyncStyleWithDocument, Mode=TwoWay}\"\n            ToolTip=\"Use the same font and text size as the associated Assembly view\" />\n          <StackPanel\n            Margin=\"0,2,0,2\"\n            IsEnabled=\"{Binding ElementName=SyncWithDocumentCheckBox, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              Width=\"50\"\n              VerticalAlignment=\"Center\"\n              Text=\"Font\" />\n            <ComboBox\n              Width=\"180\"\n              Margin=\"4,0,0,0\"\n              VerticalAlignment=\"Center\"\n              IsSynchronizedWithCurrentItem=\"True\"\n              ItemsSource=\"{Binding Source={StaticResource FontCollection}}\"\n              SelectedValue=\"{Binding Path=FontName, Mode=TwoWay, Converter={StaticResource FontFamilyConverter}}\" />\n          </StackPanel>\n          <StackPanel\n            Margin=\"0,0,0,2\"\n            IsEnabled=\"{Binding ElementName=SyncWithDocumentCheckBox, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              Width=\"50\"\n              VerticalAlignment=\"Center\"\n              Text=\"Font size\" />\n            <xctk:DoubleUpDown\n              Margin=\"4,0,0,0\"\n              Increment=\"1\"\n              Maximum=\"36.0\"\n              Minimum=\"5.0\"\n              ParsingNumberStyle=\"Number\"\n              ShowButtonSpinner=\"True\"\n              Value=\"{Binding Path=FontSize, Mode=TwoWay}\" />\n          </StackPanel>\n\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n          <DockPanel\n            IsEnabled=\"{Binding ElementName=SyncWithDocumentCheckBox, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\">\n            <TextBlock\n              FontWeight=\"Medium\"\n              Text=\"Document Colors\" />\n            <Button\n              x:Name=\"StyleButton\"\n              Width=\"20\"\n              Height=\"20\"\n              HorizontalAlignment=\"Right\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              DockPanel.Dock=\"Right\"\n              ToolTip=\"Use custom document colors style\">\n              <Image Source=\"{StaticResource StyleIcon}\" />\n              <Button.ContextMenu>\n                <ContextMenu x:Name=\"StyleContextMenu\">\n                  <MenuItem Header=\"Default\" />\n                </ContextMenu>\n              </Button.ContextMenu>\n            </Button>\n          </DockPanel>\n          <StackPanel\n            Margin=\"0,2,0,0\"\n            IsEnabled=\"{Binding ElementName=SyncWithDocumentCheckBox, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\"\n            Orientation=\"Vertical\">\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                IsManipulationEnabled=\"True\"\n                SelectedColor=\"{Binding Path=BackgroundColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Background color\" />\n            </Grid>\n\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=TextColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Default text color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=CurrentLineBorderColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Current line border color\" />\n            </Grid>\n            <Grid Margin=\"0,2,0,0\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"70\" />\n                <ColumnDefinition />\n              </Grid.ColumnDefinitions>\n              <xctk:ColorPicker\n                Grid.Column=\"0\"\n                Width=\"64\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                BorderBrush=\"#707070\"\n                SelectedColor=\"{Binding Path=MarginBackgroundColor, Mode=TwoWay}\"\n                ShowDropDownButton=\"True\" />\n              <TextBlock\n                Grid.Column=\"1\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Left margin background color\" />\n            </Grid>\n          </StackPanel>\n          <Grid\n            Margin=\"0,2,0,0\"\n            IsEnabled=\"{Binding ElementName=AssemblyCheckBox, Path=IsChecked}\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              SelectedColor=\"{Binding Path=AssemblyTextColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Assembly line text color\" />\n          </Grid>\n          <Grid\n            Margin=\"0,2,0,0\"\n            IsEnabled=\"{Binding ElementName=AssemblyCheckBox, Path=IsChecked}\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"70\" />\n              <ColumnDefinition />\n            </Grid.ColumnDefinitions>\n            <xctk:ColorPicker\n              Grid.Column=\"0\"\n              Width=\"64\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              AvailableColorsSortingMode=\"HueSaturationBrightness\"\n              BorderBrush=\"#707070\"\n              SelectedColor=\"{Binding Path=AssemblyBackColor, Mode=TwoWay}\"\n              ShowDropDownButton=\"True\" />\n            <TextBlock\n              Grid.Column=\"1\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"Assembly line background color\" />\n          </Grid>\n        </StackPanel>\n      </TabItem>\n      <TabItem\n        Header=\"Source Files\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Options for finding source files\">\n        <StackPanel Margin=\"4,4,4,4\">\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Excluded File Paths\" />\n          <TextBlock\n            Margin=\"0,2,0,0\"\n            Text=\"Original source file paths excluded from mapping\" />\n          <Grid Margin=\"0,4,0,0\">\n            <Grid.RowDefinitions>\n              <RowDefinition Height=\"*\" />\n            </Grid.RowDefinitions>\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"*\" />\n              <ColumnDefinition Width=\"80\" />\n            </Grid.ColumnDefinitions>\n\n            <ListView\n              x:Name=\"ExcludedPathsList\"\n              Grid.Row=\"0\"\n              Grid.Column=\"0\"\n              MinHeight=\"70\"\n              MaxHeight=\"300\"\n              Margin=\"0,4,4,4\"\n              IsTextSearchEnabled=\"True\"\n              ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n              SelectionMode=\"Extended\"\n              TextSearch.TextPath=\"Name\">\n              <ListView.View>\n                <GridView>\n                  <GridViewColumn\n                    Width=\"Auto\"\n                    Header=\"Path\">\n                    <GridViewColumn.HeaderContainerStyle>\n                      <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                        <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                      </Style>\n                    </GridViewColumn.HeaderContainerStyle>\n                    <GridViewColumn.CellTemplate>\n                      <DataTemplate>\n                        <TextBox\n                          BorderThickness=\"0\"\n                          PreviewMouseLeftButtonDown=\"TextBox_PreviewMouseLeftButtonDown\"\n                          Text=\"{Binding Path=., Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" />\n                      </DataTemplate>\n                    </GridViewColumn.CellTemplate>\n                  </GridViewColumn>\n                </GridView>\n              </ListView.View>\n              <ListView.ItemContainerStyle>\n                <Style\n                  BasedOn=\"{StaticResource FlatListViewItem}\"\n                  TargetType=\"{x:Type ListViewItem}\">\n                  <Setter Property=\"Background\"\n                          Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n                </Style>\n              </ListView.ItemContainerStyle>\n            </ListView>\n\n            <StackPanel\n              Grid.Row=\"0\"\n              Grid.Column=\"1\"\n              Margin=\"2,4,4,4\">\n              <Button\n                Height=\"24\"\n                Padding=\"2\"\n                HorizontalContentAlignment=\"Left\"\n                Click=\"AddExcludedPath_Click\"\n                ToolTip=\"Add new symbol path to the list\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource PlusIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <TextBlock\n                    Margin=\"4,0,0,0\"\n                    Text=\"Add\" />\n                </StackPanel>\n              </Button>\n              <Button\n                Height=\"24\"\n                Margin=\"0,2,0,0\"\n                Padding=\"2\"\n                HorizontalContentAlignment=\"Left\"\n                Click=\"RemoveExcludedPath_Click\"\n                ToolTip=\"Remove path from the list\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource MinusIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <TextBlock\n                    Margin=\"4,0,0,0\"\n                    Text=\"Remove\" />\n                </StackPanel>\n              </Button>\n              <Button\n                Height=\"24\"\n                Margin=\"0,2,0,0\"\n                Padding=\"2\"\n                HorizontalContentAlignment=\"Left\"\n                Click=\"ClearExcludedPath_Click\"\n                ToolTip=\"Remove all paths from the list\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource RemoveIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <TextBlock\n                    Margin=\"4,0,0,0\"\n                    Text=\"Clear\" />\n                </StackPanel>\n              </Button>\n\n            </StackPanel>\n\n            <StackPanel\n              Grid.Row=\"1\"\n              Grid.Column=\"0\"\n              Grid.ColumnSpan=\"2\"\n              Margin=\"0,0,4,4\"\n              VerticalAlignment=\"Top\"\n              Orientation=\"Horizontal\" />\n          </Grid>\n          <TextBlock\n            FontSize=\"11\"\n            Text=\"Wildcards * in the path are accepted, e.g. *path\\foo*\" />\n          <Separator\n            Margin=\"0,4,0,4\"\n            Background=\"LightGray\" />\n\n\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"File Path Mappings\" />\n          <TextBlock\n            Margin=\"0,2,0,0\"\n            Text=\"Mappings from original source file path to local path\" />\n          <Grid Margin=\"0,4,0,0\">\n            <Grid.RowDefinitions>\n              <RowDefinition Height=\"*\" />\n              <RowDefinition Height=\"*\" />\n            </Grid.RowDefinitions>\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition Width=\"*\" />\n              <ColumnDefinition Width=\"80\" />\n            </Grid.ColumnDefinitions>\n\n            <ListView\n              x:Name=\"MappedPathsList\"\n              Grid.Row=\"0\"\n              Grid.Column=\"0\"\n              MinHeight=\"70\"\n              MaxHeight=\"300\"\n              Margin=\"0,4,4,4\"\n              IsTextSearchEnabled=\"True\"\n              ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n              SelectionMode=\"Extended\"\n              TextSearch.TextPath=\"Name\">\n              <ListView.View>\n                <GridView>\n                  <GridViewColumn\n                    Width=\"Auto\"\n                    Header=\"Path\">\n                    <GridViewColumn.HeaderContainerStyle>\n                      <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                        <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                      </Style>\n                    </GridViewColumn.HeaderContainerStyle>\n                    <GridViewColumn.CellTemplate>\n                      <DataTemplate>\n                        <StackPanel>\n                          <TextBlock\n                            HorizontalAlignment=\"Stretch\"\n                            Text=\"{Binding Key}\"\n                            TextTrimming=\"CharacterEllipsis\" />\n                          <TextBlock\n                            HorizontalAlignment=\"Stretch\"\n                            Text=\"{Binding Value}\"\n                            TextTrimming=\"CharacterEllipsis\" />\n                          <Separator />\n\n                        </StackPanel>\n                      </DataTemplate>\n                    </GridViewColumn.CellTemplate>\n                  </GridViewColumn>\n                </GridView>\n              </ListView.View>\n              <ListView.ItemContainerStyle>\n                <Style\n                  BasedOn=\"{StaticResource FlatListViewItem}\"\n                  TargetType=\"{x:Type ListViewItem}\">\n                  <Setter Property=\"Background\"\n                          Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n                </Style>\n              </ListView.ItemContainerStyle>\n            </ListView>\n\n            <StackPanel\n              Grid.Row=\"0\"\n              Grid.Column=\"1\"\n              Margin=\"2,4,4,4\">\n              <Button\n                Height=\"24\"\n                Margin=\"0,2,0,0\"\n                Padding=\"2\"\n                HorizontalContentAlignment=\"Left\"\n                Click=\"RemoveMappedPath_Click\"\n                ToolTip=\"Remove path from the list\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource MinusIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <TextBlock\n                    Margin=\"4,0,0,0\"\n                    Text=\"Remove\" />\n                </StackPanel>\n              </Button>\n              <Button\n                Height=\"24\"\n                Margin=\"0,2,0,0\"\n                Padding=\"2\"\n                HorizontalContentAlignment=\"Left\"\n                Click=\"ClearMappedPath_Click\"\n                ToolTip=\"Remove all paths from the list\">\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource RemoveIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <TextBlock\n                    Margin=\"4,0,0,0\"\n                    Text=\"Clear\" />\n                </StackPanel>\n              </Button>\n\n            </StackPanel>\n\n            <StackPanel\n              Grid.Row=\"1\"\n              Grid.Column=\"0\"\n              Grid.ColumnSpan=\"2\"\n              Margin=\"0,0,4,4\"\n              VerticalAlignment=\"Top\"\n              Orientation=\"Horizontal\" />\n          </Grid>\n        </StackPanel>\n      </TabItem>\n\n      <TabItem\n        x:Name=\"ProfilingOptionsPanel\"\n        Header=\"Profiling\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <local:DocumentProfilingOptionsPanel />\n      </TabItem>\n    </TabControl>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/SourceFileOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class SourceFileOptionsPanel : OptionsPanelBase {\n  private SourceFileSettings settings_;\n\n  public SourceFileOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public override double DefaultHeight => 450;\n  public override double DefaultWidth => 400;\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n    settings_ = (SourceFileSettings)Settings;\n    ProfilingOptionsPanel.DataContext = settings_.ProfileMarkerSettings;\n    ReloadMappedPathsList();\n    ReloadExcludedPathsList();\n  }\n\n  public override void OnSettingsChanged(object newSettings) {\n    settings_ = (SourceFileSettings)newSettings;\n    ProfilingOptionsPanel.DataContext = null;\n    ProfilingOptionsPanel.DataContext = settings_.ProfileMarkerSettings;\n  }\n\n  private void ReloadMappedPathsList() {\n    var mappings = new List<KeyValuePair<string, string>>();\n\n    foreach (var pair in settings_.FinderSettings.SourceMappings) {\n      mappings.Add(pair);\n    }\n\n    var list = new ObservableCollectionRefresh<KeyValuePair<string, string>>(mappings);\n    MappedPathsList.ItemsSource = list;\n  }\n\n  private void ReloadExcludedPathsList() {\n    var list = new ObservableCollectionRefresh<string>(settings_.FinderSettings.DisabledSourceMappings);\n    ExcludedPathsList.ItemsSource = list;\n  }\n\n  private void TextBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    if (sender is TextBox textBox) {\n      Utils.SelectTextBoxListViewItem(textBox, ExcludedPathsList);\n      e.Handled = true;\n    }\n  }\n\n  private void RemoveMappedPath_Click(object sender, RoutedEventArgs e) {\n    if (MappedPathsList.SelectedItem is KeyValuePair<string, string> pair) {\n      settings_.FinderSettings.SourceMappings.Remove(pair.Key);\n      ReloadMappedPathsList();\n    }\n  }\n\n  private void ClearMappedPath_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to clear the list?\", this) == MessageBoxResult.Yes) {\n      settings_.FinderSettings.SourceMappings.Clear();\n      ReloadMappedPathsList();\n    }\n  }\n\n  private void AddExcludedPath_Click(object sender, RoutedEventArgs e) {\n    settings_.FinderSettings.DisabledSourceMappings.Add(\"\");\n    ReloadExcludedPathsList();\n\n    // Wait for the UI to update\n    Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, () => {\n      Utils.SelectEditableListViewItem(ExcludedPathsList, settings_.FinderSettings.DisabledSourceMappings.Count - 1);\n    });\n  }\n\n  private void ClearExcludedPath_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to clear the list?\", this) == MessageBoxResult.Yes) {\n      settings_.FinderSettings.DisabledSourceMappings.Clear();\n      ReloadExcludedPathsList();\n    }\n  }\n\n  private void RemoveExcludedPath_Click(object sender, RoutedEventArgs e) {\n    if (ExcludedPathsList.SelectedItem is string path) {\n      settings_.FinderSettings.DisabledSourceMappings.Remove(path);\n      ReloadExcludedPathsList();\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/SymbolOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.SymbolOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel\n      Margin=\"4,4,4,4\"\n      Orientation=\"Vertical\">\n\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Include __NT__SYMBOL__PATH environment variable\"\n        IsChecked=\"{Binding Path=UseEnvironmentVarSymbolPaths, Mode=TwoWay}\"\n        ToolTip=\"Append the NT__SYMBOL__PATH environment variable to the list of sources\" />\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Include subdirectories for local paths\"\n        IsChecked=\"{Binding Path=IncludeSymbolSubdirectories, Mode=TwoWay}\"\n        ToolTip=\"Scan and include all subdirectories with symbols for the local paths in the list\" />\n      <CheckBox\n        x:Name=\"ModuleSamplesCheckBox\"\n        Margin=\"0,2,0,2\"\n        Content=\"Don't load symbols for very low sample modules\"\n        IsChecked=\"{Binding Path=SkipLowSampleModules, Mode=TwoWay}\"\n        ToolTip=\"Skip downloading and loading of symbols for insignificant modules with very few samples\" />\n      <StackPanel\n        Margin=\"20,2,0,2\"\n        IsEnabled=\"{Binding ElementName=ModuleSamplesCheckBox, Path=IsChecked}\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Minimum samples (%)\" />\n        <xctk:DoubleUpDown\n          Width=\"70\"\n          Margin=\"8,0,0,0\"\n          FormatString=\"F1\"\n          Increment=\"0.1\"\n          Maximum=\"50\"\n          Minimum=\"0.1\"\n          ShowButtonSpinner=\"True\"\n          ToolTip=\"Exclude modules with a number of samples below this percentage\"\n          Value=\"{Binding Path=LowSampleModuleCutoff, Mode=TwoWay, Converter={StaticResource DoubleScalingConverter}, ConverterParameter=100.0}\" />\n        <Button\n          Height=\"20\"\n          Margin=\"4,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Click=\"ResetFilterModuleSamplesButton_Click\"\n          Content=\"Default\"\n          ToolTip=\"Reset value to default percentage\" />\n      </StackPanel>\n      <CheckBox\n        Margin=\"0,4,0,0\"\n        Content=\"Allow approximate binary match (matching timestamp, different size)\"\n        IsChecked=\"{Binding Path=AllowApproximateBinaryMatch, Mode=TwoWay}\"\n        ToolTip=\"When a binary file is found with a matching timestamp but different image size, use it as a fallback for disassembly. This helps when the kernel-reported image size differs from the PE header, or when a DLL was serviced.\" />\n      <CheckBox\n        Margin=\"0,4,0,0\"\n        Content=\"Don't load symbols that failed in previous sessions\"\n        IsChecked=\"{Binding Path=RejectPreviouslyFailedFiles, Mode=TwoWay}\"\n        ToolTip=\"Skip downloading and loading of symbols that could not be found in previous sessions\" />\n      <StackPanel\n        Margin=\"20,2,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Excluded binaries:\" />\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"{Binding RejectedBinaryFiles.Count}\" />\n        <TextBlock\n          Margin=\"24,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"Excluded symbols:\" />\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"{Binding RejectedSymbolFiles.Count}\" />\n        <ToggleButton\n          x:Name=\"ExcludedToggleButton\"\n          Height=\"22\"\n          Margin=\"16,0,0,0\"\n          Padding=\"4,2,4,2\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Center\"\n          Content=\"View\"\n          IsEnabled=\"{Binding InputControlsEnabled}\"\n          ToolTip=\"View rejected binaries and symbols\" />\n        <Button\n          Height=\"22\"\n          Margin=\"4,0,0,0\"\n          Padding=\"4,2,4,2\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Center\"\n          Click=\"ClearRejectedButton_Click\"\n          Content=\"Clear\"\n          IsEnabled=\"{Binding InputControlsEnabled}\"\n          ToolTip=\"Reset lists of rejected binaries and symbols\" />\n      </StackPanel>\n      <Border\n        Margin=\"20,4,0,0\"\n        BorderBrush=\"LightGray\"\n        BorderThickness=\"1\"\n        Visibility=\"{Binding IsChecked, ElementName=ExcludedToggleButton, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <TabControl\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderThickness=\"0\">\n          <TabItem\n            Header=\"Symbols\"\n            Style=\"{StaticResource TabControlStyle}\">\n            <Grid>\n              <Grid.RowDefinitions>\n                <RowDefinition Height=\"*\" />\n                <RowDefinition Height=\"*\" />\n              </Grid.RowDefinitions>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"*\" />\n                <ColumnDefinition Width=\"80\" />\n              </Grid.ColumnDefinitions>\n\n              <ListView\n                x:Name=\"RejectedSymbolsList\"\n                Grid.Row=\"0\"\n                Grid.Column=\"0\"\n                MaxHeight=\"200\"\n                Margin=\"0,4,4,4\"\n                IsTextSearchEnabled=\"True\"\n                SelectionMode=\"Extended\"\n                TextSearch.TextPath=\"ImageName\">\n                <ListView.View>\n                  <GridView>\n                    <GridViewColumn\n                      Width=\"Auto\"\n                      DisplayMemberBinding=\"{Binding SymbolName}\"\n                      Header=\"File\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                    <GridViewColumn\n                      Width=\"150\"\n                      DisplayMemberBinding=\"{Binding FileName}\"\n                      Header=\"File\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                    <GridViewColumn\n                      Width=\"Auto\"\n                      DisplayMemberBinding=\"{Binding Id}\"\n                      Header=\"Id\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                    <GridViewColumn\n                      Width=\"Auto\"\n                      DisplayMemberBinding=\"{Binding Age}\"\n                      Header=\"Age\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                  </GridView>\n                </ListView.View>\n                <ListView.ItemContainerStyle>\n                  <Style\n                    BasedOn=\"{StaticResource FlatListViewItem}\"\n                    TargetType=\"{x:Type ListViewItem}\">\n                    <Setter Property=\"Background\"\n                            Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n                  </Style>\n                </ListView.ItemContainerStyle>\n              </ListView>\n\n              <StackPanel\n                Grid.Row=\"0\"\n                Grid.Column=\"1\"\n                Margin=\"2,4,4,4\">\n                <Button\n                  Height=\"24\"\n                  Padding=\"2\"\n                  HorizontalContentAlignment=\"Left\"\n                  Click=\"RemoveRejectedSymbolsButton_Click\">\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource MinusIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"4,0,0,0\"\n                      Text=\"Remove\" />\n                  </StackPanel>\n                </Button>\n                <Button\n                  Height=\"24\"\n                  Margin=\"0,2,0,0\"\n                  Padding=\"2\"\n                  HorizontalContentAlignment=\"Left\"\n                  Click=\"ClearRejectedSymbolsButton_Click\">\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource RemoveIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"4,0,0,0\"\n                      Text=\"Clear\" />\n                  </StackPanel>\n                </Button>\n              </StackPanel>\n\n            </Grid>\n          </TabItem>\n          <TabItem\n            Header=\"Binaries\"\n            Style=\"{StaticResource TabControlStyle}\">\n            <Grid>\n              <Grid.RowDefinitions>\n                <RowDefinition Height=\"*\" />\n                <RowDefinition Height=\"*\" />\n              </Grid.RowDefinitions>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"*\" />\n                <ColumnDefinition Width=\"80\" />\n              </Grid.ColumnDefinitions>\n\n              <ListView\n                x:Name=\"RejectedBinariesList\"\n                Grid.Row=\"0\"\n                Grid.Column=\"0\"\n                MaxHeight=\"200\"\n                Margin=\"0,4,4,4\"\n                IsTextSearchEnabled=\"True\"\n                SelectionMode=\"Extended\"\n                TextSearch.TextPath=\"ImageName\">\n                <ListView.View>\n                  <GridView>\n                    <GridViewColumn\n                      Width=\"Auto\"\n                      DisplayMemberBinding=\"{Binding ImageName}\"\n                      Header=\"File\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                    <GridViewColumn\n                      Width=\"150\"\n                      DisplayMemberBinding=\"{Binding ImagePath}\"\n                      Header=\"Path\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                    <GridViewColumn\n                      Width=\"Auto\"\n                      DisplayMemberBinding=\"{Binding ImageSize}\"\n                      Header=\"Size\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                    <GridViewColumn\n                      Width=\"Auto\"\n                      DisplayMemberBinding=\"{Binding TimeStamp}\"\n                      Header=\"Timestamp\">\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                  </GridView>\n                </ListView.View>\n                <ListView.ItemContainerStyle>\n                  <Style\n                    BasedOn=\"{StaticResource FlatListViewItem}\"\n                    TargetType=\"{x:Type ListViewItem}\">\n                    <Setter Property=\"Background\"\n                            Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n                  </Style>\n                </ListView.ItemContainerStyle>\n              </ListView>\n\n              <StackPanel\n                Grid.Row=\"0\"\n                Grid.Column=\"1\"\n                Margin=\"2,4,4,4\">\n                <Button\n                  Height=\"24\"\n                  Padding=\"2\"\n                  HorizontalContentAlignment=\"Left\"\n                  Click=\"RemoveRejectedBinariesButton_Click\">\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource MinusIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"4,0,0,0\"\n                      Text=\"Remove\" />\n                  </StackPanel>\n                </Button>\n                <Button\n                  Height=\"24\"\n                  Margin=\"0,2,0,0\"\n                  Padding=\"2\"\n                  HorizontalContentAlignment=\"Left\"\n                  Click=\"ClearRejectedBinariesButton_Click\">\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource RemoveIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"4,0,0,0\"\n                      Text=\"Clear\" />\n                  </StackPanel>\n                </Button>\n              </StackPanel>\n\n            </Grid>\n          </TabItem>\n        </TabControl>\n      </Border>\n\n      <CheckBox\n        Margin=\"0,4,0,0\"\n        Content=\"Cache processed symbol files\"\n        IsChecked=\"{Binding Path=CacheSymbolFiles, Mode=TwoWay}\"\n        ToolTip=\"Save the symbol files processing results to the %TEMP% directory for faster subsequent load\" />\n      <StackPanel\n        Margin=\"20,2,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Size on disk:\" />\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          Text=\"{Binding SymbolCacheDirectorySizeMB, StringFormat={}{0} MB}\" />\n        <Button\n          Height=\"22\"\n          Margin=\"16,0,0,0\"\n          Padding=\"4,2,4,2\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Center\"\n          Click=\"OpenSymbolCacheButton_Click\"\n          Content=\"Open\"\n          IsEnabled=\"{Binding InputControlsEnabled}\"\n          ToolTip=\"Open the with cached symbol files directory\" />\n        <Button\n          Height=\"22\"\n          Margin=\"4,0,0,0\"\n          Padding=\"4,2,4,2\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Center\"\n          Click=\"ClearSymbolCacheButton_Click\"\n          Content=\"Clear\"\n          IsEnabled=\"{Binding InputControlsEnabled}\"\n          ToolTip=\"Reset lists of cached symbol files\" />\n      </StackPanel>\n\n      <Expander\n        Margin=\"4,10,4,0\"\n        IsEnabled=\"{Binding InputControlsEnabled}\"\n        IsExpanded=\"True\">\n        <Expander.Header>\n          <TextBlock\n            FontWeight=\"Medium\"\n            Text=\"Symbol Paths\"\n            ToolTip=\"Symbol server and local search paths for debug info and binary files\" />\n        </Expander.Header>\n\n        <Grid Height=\"280\">\n          <Grid.RowDefinitions>\n            <RowDefinition Height=\"*\" />\n            <RowDefinition Height=\"30\" />\n          </Grid.RowDefinitions>\n          <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"*\" />\n            <ColumnDefinition Width=\"80\" />\n          </Grid.ColumnDefinitions>\n\n          <ListView\n            x:Name=\"SymbolPathsList\"\n            Grid.Row=\"0\"\n            Grid.Column=\"0\"\n            Margin=\"0,8,4,4\"\n            IsTextSearchEnabled=\"True\"\n            SelectionMode=\"Single\"\n            TextSearch.TextPath=\"Name\">\n            <ListView.View>\n              <GridView>\n                <GridViewColumn\n                  Width=\"Auto\"\n                  Header=\"Symbol Path\">\n                  <GridViewColumn.HeaderContainerStyle>\n                    <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                      <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                    </Style>\n                  </GridViewColumn.HeaderContainerStyle>\n                  <GridViewColumn.CellTemplate>\n                    <DataTemplate>\n                      <controls:FileSystemTextBox\n                        BorderThickness=\"0\"\n                        DropDownClosed=\"SymbolPath_OnDropDownClosed\"\n                        FilterMode=\"StartsWithOrdinal\"\n                        KeyDown=\"SymbolPath_KeyDown\"\n                        LostFocus=\"SymbolPath_LostFocus\"\n                        MinimumPrefixLength=\"0\"\n                        PreviewMouseLeftButtonDown=\"TextBox_PreviewMouseLeftButtonDown\"\n                        ShowOnlyDirectories=\"True\"\n                        Text=\"{Binding Path=.}\" />\n                    </DataTemplate>\n                  </GridViewColumn.CellTemplate>\n                </GridViewColumn>\n                <GridViewColumn Width=\"Auto\">\n                  <GridViewColumn.HeaderContainerStyle>\n                    <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                      <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                    </Style>\n                  </GridViewColumn.HeaderContainerStyle>\n                  <GridViewColumn.CellTemplate>\n                    <DataTemplate>\n                      <Button\n                        x:Name=\"BaseBrowseButton\"\n                        Height=\"20\"\n                        Padding=\"4,2,4,2\"\n                        HorizontalAlignment=\"Right\"\n                        Background=\"Transparent\"\n                        BorderThickness=\"0\"\n                        Click=\"SymbolPathBrowseButton_Click\"\n                        ToolTip=\"Select symbols directory from file system\">\n                        <Image\n                          Source=\"{StaticResource FolderIcon}\"\n                          Style=\"{StaticResource DisabledImageStyle}\" />\n                      </Button>\n                    </DataTemplate>\n                  </GridViewColumn.CellTemplate>\n                </GridViewColumn>\n              </GridView>\n            </ListView.View>\n            <ListView.ItemContainerStyle>\n              <Style\n                BasedOn=\"{StaticResource FlatListViewItem}\"\n                TargetType=\"{x:Type ListViewItem}\">\n                <Setter Property=\"Background\"\n                        Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n              </Style>\n            </ListView.ItemContainerStyle>\n          </ListView>\n\n          <StackPanel\n            Grid.Row=\"0\"\n            Grid.Column=\"1\"\n            Margin=\"2,8,4,4\">\n            <Button\n              Height=\"24\"\n              Padding=\"2\"\n              HorizontalContentAlignment=\"Left\"\n              Click=\"AddSymbolPathButton_Click\"\n              ToolTip=\"Add new symbol path to list\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource PlusIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  Text=\"Add\" />\n              </StackPanel>\n            </Button>\n            <Button\n              Height=\"24\"\n              Margin=\"0,2,0,0\"\n              Padding=\"2\"\n              HorizontalContentAlignment=\"Left\"\n              Click=\"RemoveSymbolPathButton_Click\"\n              ToolTip=\"Remove selected symbol path from list\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource MinusIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  Text=\"Remove\" />\n              </StackPanel>\n            </Button>\n            <Button\n              Height=\"24\"\n              Margin=\"0,2,0,0\"\n              Padding=\"2\"\n              HorizontalContentAlignment=\"Left\"\n              Click=\"MoveSymbolPathUpButton_Click\"\n              ToolTip=\"Move selected symbol path up in list\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource UpArrowIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  Text=\"Up\" />\n              </StackPanel>\n            </Button>\n            <Button\n              Height=\"24\"\n              Margin=\"0,2,0,0\"\n              Padding=\"2\"\n              HorizontalContentAlignment=\"Left\"\n              Click=\"MoveSymbolPathDownButton_Click\"\n              ToolTip=\"Move selected symbol path down in list\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource DownArrowIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  Text=\"Down\" />\n              </StackPanel>\n            </Button>\n          </StackPanel>\n\n          <StackPanel\n            Grid.Row=\"1\"\n            Grid.Column=\"0\"\n            Grid.ColumnSpan=\"2\"\n            Margin=\"0,0,4,4\"\n            VerticalAlignment=\"Top\"\n            Orientation=\"Horizontal\"\n            ToolTip=\"Restore the predefined workspaces\">\n\n            <Button\n              Height=\"24\"\n              Padding=\"4,2,4,2\"\n              HorizontalContentAlignment=\"Left\"\n              Click=\"AddPublicSymbolServer_OnClick\"\n              ToolTip=\"Add public symbol server path to list\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource PlusIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  Text=\"Public Server\" />\n              </StackPanel>\n            </Button>\n            <Button\n              Height=\"24\"\n              Margin=\"2,0,0,0\"\n              Padding=\"4,2,4,2\"\n              HorizontalContentAlignment=\"Left\"\n              Click=\"AddPrivateSymbolServer_OnClick\"\n              ToolTip=\"Add private symbol server path to list\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource PlusIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  Text=\"Private Server\" />\n              </StackPanel>\n            </Button>\n            <TextBlock\n              Margin=\"10,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Cursor=\"Hand\"\n              Foreground=\"DarkBlue\">\n              <Hyperlink\n                NavigateUri=\"https://learn.microsoft.com/en-us/windows/win32/debug/using-symsrv\"\n                RequestNavigate=\"Hyperlink_RequestNavigate\">\n                Symbol configuration help\n              </Hyperlink>\n            </TextBlock>\n          </StackPanel>\n\n        </Grid>\n\n      </Expander>\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/SymbolOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Navigation;\nusing System.Windows.Threading;\nusing Microsoft.Win32;\nusing ProfileExplorer.UI.Compilers;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class SymbolOptionsPanel : OptionsPanelBase, INotifyPropertyChanged {\n  private SymbolFileSourceSettings symbolSettings_;\n\n  public SymbolOptionsPanel() {\n    InitializeComponent();\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public override void Initialize(FrameworkElement parent, SettingsBase settings, IUISession session) {\n    base.Initialize(parent, settings, session);\n    symbolSettings_ = (SymbolFileSourceSettings)Settings;\n    ReloadSymbolPathsList();\n  }\n\n  public override void OnSettingsChanged(object newSettings) {\n    symbolSettings_ = (SymbolFileSourceSettings)newSettings;\n  }\n\n  private void ClearRejectedButton_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to remove all excluded binaries and symbols?\", this) ==\n        MessageBoxResult.Yes) {\n      symbolSettings_.ClearRejectedFiles();\n      ReloadSymbolPathsList();\n    }\n  }\n\n  private void RemoveRejectedBinariesButton_Click(object sender, RoutedEventArgs e) {\n    foreach (object item in RejectedBinariesList.SelectedItems) {\n      symbolSettings_.RejectedBinaryFiles.Remove(item as BinaryFileDescriptor);\n    }\n\n    ReloadSettings();\n  }\n\n  private void ClearRejectedBinariesButton_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to remove all excluded binaries?\", this) ==\n        MessageBoxResult.Yes) {\n      symbolSettings_.RejectedBinaryFiles.Clear();\n      ReloadSymbolPathsList();\n    }\n  }\n\n  private void RemoveRejectedSymbolsButton_Click(object sender, RoutedEventArgs e) {\n    foreach (object item in RejectedSymbolsList.SelectedItems) {\n      symbolSettings_.RejectedSymbolFiles.Remove(item as SymbolFileDescriptor);\n    }\n\n    ReloadSymbolPathsList();\n  }\n\n  private void ClearRejectedSymbolsButton_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to remove all excluded symbols?\", this) ==\n        MessageBoxResult.Yes) {\n      symbolSettings_.RejectedSymbolFiles.Clear();\n      ReloadSymbolPathsList();\n    }\n  }\n\n  private void SymbolPathBrowseButton_Click(object sender, RoutedEventArgs e) {\n    var listViewItem = Utils.FocusParentListViewItem(sender as Control, SymbolPathsList);\n    var textBox = Utils.FindChild<FileSystemTextBox>(listViewItem);\n\n    using var centerForm = new DialogCenteringHelper(this);\n    var dialog = new OpenFolderDialog();\n    dialog.Title = \"Select symbols directory\";\n\n    if (dialog.ShowDialog() == true) {\n      textBox.Text = dialog.FolderName;\n      UpdateSymbolPath(textBox);\n    }\n  }\n\n  private void ClearSymbolCacheButton_Click(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to remove all cached symbol files?\", this) ==\n        MessageBoxResult.Yes) {\n      symbolSettings_.ClearSymbolFileCache();\n      ReloadSettings();\n    }\n  }\n\n  private void OpenSymbolCacheButton_Click(object sender, RoutedEventArgs e) {\n    Utils.OpenExplorerAtFile(symbolSettings_.SymbolCacheDirectoryPath);\n  }\n\n  private void SymbolPath_LostFocus(object sender, RoutedEventArgs e) {\n    var textBox = sender as FileSystemTextBox;\n    UpdateSymbolPath(textBox);\n  }\n\n  private void SymbolPath_KeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Enter) {\n      var textBox = sender as FileSystemTextBox;\n      UpdateSymbolPath(textBox);\n    }\n  }\n\n  private void SymbolPath_OnDropDownClosed(object sender, RoutedPropertyChangedEventArgs<bool> e) {\n    var textBox = sender as FileSystemTextBox;\n    UpdateSymbolPath(textBox);\n  }\n\n  private void UpdateSymbolPath(FileSystemTextBox textBox) {\n    if (textBox == null) {\n      return;\n    }\n\n    object item = textBox.DataContext;\n    int index = symbolSettings_.SymbolPaths.IndexOf(item as string);\n\n    if (index == -1) {\n      return;\n    }\n\n    // Update list with the new text.\n    string newSymbolPath = Utils.RemovePathQuotes(textBox.Text);\n    textBox.Text = newSymbolPath;\n\n    if (symbolSettings_.SymbolPaths[index] != newSymbolPath) {\n      symbolSettings_.SymbolPaths[index] = newSymbolPath;\n      ReloadSymbolPathsList();\n    }\n  }\n\n  private void TextBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    if (sender is FileSystemTextBox textBox) {\n      Utils.SelectTextBoxListViewItem(textBox, SymbolPathsList);\n    }\n  }\n\n  private void AddPrivateSymbolServer_OnClick(object sender, RoutedEventArgs e) {\n    symbolSettings_.AddSymbolServer(usePrivateServer: true);\n    ReloadSymbolPathsList();\n  }\n\n  private void AddPublicSymbolServer_OnClick(object sender, RoutedEventArgs e) {\n    symbolSettings_.AddSymbolServer(usePrivateServer: false);\n    ReloadSymbolPathsList();\n  }\n\n  private void AddSymbolPathButton_Click(object sender, RoutedEventArgs e) {\n    symbolSettings_.SymbolPaths.Add(\"\");\n    ReloadSymbolPathsList();\n\n    // Wait for the UI to update\n    Dispatcher.BeginInvoke(DispatcherPriority.ContextIdle, () => {\n      Utils.SelectEditableListViewItem(SymbolPathsList, symbolSettings_.SymbolPaths.Count - 1);\n    });\n  }\n\n  private void RemoveSymbolPathButton_Click(object sender, RoutedEventArgs e) {\n    foreach (object item in SymbolPathsList.SelectedItems) {\n      string symbolPath = item as string;\n      symbolSettings_.SymbolPaths.Remove(symbolPath);\n    }\n\n    ReloadSymbolPathsList();\n  }\n\n  private void MoveSymbolPathUpButton_Click(object sender, RoutedEventArgs e) {\n    if (SymbolPathsList.SelectedItems.Count != 1) {\n      return; // Only remove if there is exactly one item selected\n    }\n\n    if (SymbolPathsList.SelectedIndex == 0) {\n      return; // Cannot move an item up if it is already at the top of the list\n    }\n\n    int selectedIndex = SymbolPathsList.SelectedIndex;\n    string selectedItem = SymbolPathsList.SelectedItem as string;\n    symbolSettings_.SymbolPaths.RemoveAt(selectedIndex);\n    symbolSettings_.SymbolPaths.Insert(selectedIndex - 1, selectedItem);\n    ReloadSymbolPathsList();\n  }\n\n  private void MoveSymbolPathDownButton_Click(object sender, RoutedEventArgs e) {\n    if (SymbolPathsList.SelectedItems.Count != 1) {\n      return; // Only remove if there is exactly one item selected\n    }\n\n    if (SymbolPathsList.SelectedIndex == SymbolPathsList.Items.Count - 1) {\n      return; // Cannot move an item down if it is already at the bottom of the list\n    }\n\n    int selectedIndex = SymbolPathsList.SelectedIndex;\n    string selectedItem = SymbolPathsList.SelectedItem as string;\n    symbolSettings_.SymbolPaths.RemoveAt(selectedIndex);\n    symbolSettings_.SymbolPaths.Insert(selectedIndex + 1, selectedItem);\n    ReloadSymbolPathsList();\n  }\n\n  private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) {\n    Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) {\n      UseShellExecute = true\n    });\n  }\n\n  private void ReloadSymbolPathsList() {\n    var list = new ObservableCollectionRefresh<string>(symbolSettings_.SymbolPaths);\n    SymbolPathsList.ItemsSource = list;\n\n    var binariesList = symbolSettings_.RejectedBinaryFiles.ToList();\n    binariesList.Sort((a, b) => string.Compare(a.ImageName, b.ImageName, StringComparison.OrdinalIgnoreCase));\n    RejectedBinariesList.ItemsSource = binariesList;\n\n    var symbolList = symbolSettings_.RejectedSymbolFiles.ToList();\n    symbolList.Sort((a, b) => string.Compare(a.FileName, b.FileName, StringComparison.OrdinalIgnoreCase));\n    RejectedSymbolsList.ItemsSource = symbolList;\n\n    // Force refresh of count bindings since HashSet doesn't notify on changes.\n    var dc = DataContext;\n    DataContext = null;\n    DataContext = dc;\n  }\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void ResetFilterModuleSamplesButton_Click(object sender, RoutedEventArgs e) {\n    symbolSettings_.LowSampleModuleCutoff = SymbolFileSourceSettings.DefaultLowSampleModuleCutoff;\n    ReloadSettings();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/TimelineOptionsPanel.xaml",
    "content": "﻿<local:OptionsPanelBase\n  x:Class=\"ProfileExplorer.UI.OptionsPanels.TimelineOptionsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"350\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <StackPanel Margin=\"4,4,4,4\">\n      <CheckBox\n        Margin=\"0,2,0,2\"\n        Content=\"Mark functions in other profiling views\"\n        IsChecked=\"{Binding SyncSelection, Mode=TwoWay}\"\n        ToolTip=\"Mark the functions covered by the selected time range in the other profiling views\" />\n      <CheckBox\n        x:Name=\"ShowCallStackPopupCheckbox\"\n        Margin=\"0,2,0,2\"\n        Content=\"Show hottest call stack popup on hover\"\n        IsChecked=\"{Binding ShowCallStackPopup, Mode=TwoWay}\"\n        ToolTip=\"On mouse hover over a function, show a popup with the hottest call stack including it\" />\n      <StackPanel\n        Margin=\"20,2,0,2\"\n        IsEnabled=\"{Binding ElementName=ShowCallStackPopupCheckbox, Path=IsChecked}\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          VerticalAlignment=\"Center\"\n          Text=\"Hover duration (ms)\" />\n        <xctk:IntegerUpDown\n          Width=\"70\"\n          Margin=\"8,0,0,0\"\n          Maximum=\"5000\"\n          Minimum=\"50\"\n          ParsingNumberStyle=\"Number\"\n          ShowButtonSpinner=\"True\"\n          Value=\"{Binding Path=CallStackPopupDuration, Mode=TwoWay}\" />\n        <Button\n          Height=\"20\"\n          Margin=\"4,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Click=\"ResetNodePopupDurationButton_Click\"\n          Content=\"Default\"\n          ToolTip=\"Reset value to default duration\" />\n        <Button\n          Height=\"20\"\n          Margin=\"2,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Click=\"ShortNodePopupDurationButton_Click\"\n          Content=\"Short\"\n          ToolTip=\"Reset value to default duration\" />\n        <Button\n          Height=\"20\"\n          Margin=\"2,0,0,0\"\n          Padding=\"2,0,2,0\"\n          VerticalAlignment=\"Center\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Click=\"LongNodePopupDurationButton_Click\"\n          Content=\"Long\"\n          ToolTip=\"Reset value to default duration\" />\n      </StackPanel>\n      <Separator\n        Margin=\"0,4,0,4\"\n        Background=\"LightGray\" />\n      <TextBlock\n        FontWeight=\"Medium\"\n        Text=\"Threads\" />\n      <CheckBox\n        Margin=\"0,4,0,2\"\n        Content=\"Use colors based on thread name\"\n        IsChecked=\"{Binding UseThreadColors, Mode=TwoWay}\"\n        ToolTip=\"Mark the functions covered by the selected time range in the other profiling views\" />\n      <CheckBox\n        Margin=\"0,4,0,0\"\n        Content=\"Group threads by name\"\n        IsChecked=\"{Binding GroupThreads, Mode=TwoWay}\"\n        IsEnabled=\"False\"\n        ToolTip=\"Partition threads into groups based on their name\"\n        Visibility=\"Collapsed\" />\n    </StackPanel>\n  </Grid>\n</local:OptionsPanelBase>"
  },
  {
    "path": "src/ProfileExplorerUI/OptionsPanels/TimelineOptionsPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\n\nnamespace ProfileExplorer.UI.OptionsPanels;\n\npublic partial class TimelineOptionsPanel : OptionsPanelBase {\n  public TimelineOptionsPanel() {\n    InitializeComponent();\n  }\n\n  private void ResetNodePopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((TimelineSettings)Settings).CallStackPopupDuration = TimelineSettings.DefaultCallStackPopupDuration;\n    ReloadSettings();\n  }\n\n  private void ShortNodePopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((TimelineSettings)Settings).CallStackPopupDuration = HoverPreview.HoverDurationMs;\n    ReloadSettings();\n  }\n\n  private void LongNodePopupDurationButton_Click(object sender, RoutedEventArgs e) {\n    ((TimelineSettings)Settings).CallStackPopupDuration = HoverPreview.LongHoverDurationMs;\n    ReloadSettings();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/BookmarksPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.BookmarksPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:BookmarkCommand.JumpToBookmark\"\n      Executed=\"JumpToBookmarkExecuted\" />\n    <CommandBinding\n      Command=\"local:BookmarkCommand.RemoveBookmark\"\n      Executed=\"RemoveBookmarkExecuted\" />\n    <CommandBinding\n      Command=\"local:BookmarkCommand.RemoveAllBookmarks\"\n      Executed=\"RemoveAllBookmarksExecuted\" />\n    <CommandBinding\n      Command=\"local:BookmarkCommand.MarkBookmark\"\n      Executed=\"MarkBookmarkExecuted\" />\n    <CommandBinding\n      Command=\"local:BookmarkCommand.UnmarkBookmark\"\n      Executed=\"UnmarkBookmarkExecuted\" />\n  </local:ToolPanelControl.CommandBindings>\n\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <DockPanel\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <ToolBarTray\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <Button\n            Command=\"local:BookmarkCommand.JumpToBookmark\"\n            CommandParameter=\"{Binding ElementName=BookmarkList, Path=SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=BookmarkList}\"\n            ToolTip=\"Jump to Bookmark (Return)\">\n            <Image\n              Source=\"{StaticResource BookmarkArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Separator />\n\n          <Button\n            Margin=\"4,0,0,0\"\n            Command=\"local:DocumentCommand.PreviousBookmark\"\n            CommandTarget=\"{Binding ElementName=BookmarkList}\"\n            ToolTip=\"Jump to previous bookmark (Shift+F2)\">\n            <Image\n              Source=\"{StaticResource UpArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Button\n            Command=\"local:DocumentCommand.NextBookmark\"\n            ToolTip=\"Jump to next bookmark (F2)\">\n            <Image\n              Source=\"{StaticResource DownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Separator />\n\n          <Button\n            Margin=\"4,0,0,0\"\n            Command=\"local:DocumentCommand.FirstBookmark\"\n            CommandTarget=\"{Binding ElementName=BookmarkList}\"\n            ToolTip=\"Jump to first bookmark\">\n            <Image\n              Source=\"{StaticResource BoldUpArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Button\n            Margin=\"4,0,0,0\"\n            Command=\"local:DocumentCommand.LastBookmark\"\n            CommandTarget=\"{Binding ElementName=BookmarkList}\"\n            ToolTip=\"Jump to last bookmark\">\n            <Image\n              Source=\"{StaticResource BoldDownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Separator />\n\n          <Menu\n            VerticalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n            <MenuItem\n              Margin=\"0,0,0,0\"\n              Padding=\"0,2,2,2\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Header=\"Remove\"\n              OverridesDefaultStyle=\"True\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource RemoveIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </MenuItem.Icon>\n              <MenuItem\n                Command=\"local:BookmarkCommand.RemoveBookmark\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=BookmarkList}\"\n                Header=\"Selected Bookmark\"\n                InputGestureText=\"Ctrl+Shift+B\" />\n              <MenuItem\n                Command=\"local:BookmarkCommand.RemoveAllBookmarks\"\n                CommandTarget=\"{Binding ElementName=BookmarkList}\"\n                Header=\"Remove All Bookmarks\" />\n            </MenuItem>\n          </Menu>\n        </ToolBar>\n      </ToolBarTray>\n      <local:PanelToolbarTray\n        DockPanel.Dock=\"Right\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        HasPinButton=\"False\" />\n    </DockPanel>\n\n    <ListView\n      x:Name=\"BookmarkList\"\n      Grid.Row=\"1\"\n      Margin=\"0,-1,0,0\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      BorderBrush=\"{x:Null}\"\n      BorderThickness=\"0,0,0,0\"\n      VirtualizingPanel.IsVirtualizing=\"True\"\n      VirtualizingPanel.VirtualizationMode=\"Recycling\">\n      <ListView.View>\n        <GridView>\n          <GridViewColumn\n            Width=\"30\"\n            DisplayMemberBinding=\"{Binding Index}\"\n            Header=\"#\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n          <GridViewColumn\n            Width=\"30\"\n            Header=\"Pin\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <CheckBox\n                  Background=\"Transparent\"\n                  BorderThickness=\"0\"\n                  Checked=\"CheckBox_Checked\"\n                  IsChecked=\"{Binding IsPinned, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n                  Unchecked=\"CheckBox_Unchecked\" />\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n          <GridViewColumn\n            Width=\"70\"\n            DisplayMemberBinding=\"{Binding Line}\"\n            Header=\"Line\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n          <GridViewColumn\n            Width=\"100\"\n            DisplayMemberBinding=\"{Binding Block}\"\n            Header=\"Block\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n          <GridViewColumn\n            Width=\"300\"\n            Header=\"Description\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <TextBox\n                  AcceptsReturn=\"False\"\n                  Background=\"Transparent\"\n                  BorderThickness=\"0\"\n                  FontWeight=\"Medium\"\n                  GotKeyboardFocus=\"TextBox_GotKeyboardFocus\"\n                  MaxLines=\"1\"\n                  PreviewMouseLeftButtonDown=\"TextBox_PreviewMouseLeftButtonDown\"\n                  Text=\"{Binding Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n                  TextChanged=\"TextBox_TextChanged\" />\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n        </GridView>\n      </ListView.View>\n      <ListView.ItemContainerStyle>\n        <Style\n          BasedOn=\"{StaticResource FlatListViewItem}\"\n          TargetType=\"{x:Type ListViewItem}\">\n          <EventSetter\n            Event=\"MouseDoubleClick\"\n            Handler=\"ListViewItem_MouseDoubleClick\" />\n          <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" />\n\n          <Style.Triggers>\n            <DataTrigger\n              Binding=\"{Binding Path=IsSelected}\"\n              Value=\"True\">\n              <Setter Property=\"FontWeight\" Value=\"Bold\" />\n            </DataTrigger>\n\n            <DataTrigger\n              Binding=\"{Binding Path=IsSelected}\"\n              Value=\"False\">\n              <Setter Property=\"Background\" Value=\"Transparent\" />\n            </DataTrigger>\n\n            <DataTrigger\n              Binding=\"{Binding Path=HasStyle}\"\n              Value=\"True\">\n              <Setter Property=\"BorderBrush\" Value=\"{Binding Path=StyleBackColor}\" />\n              <Setter Property=\"BorderThickness\" Value=\"1,1,1,1\" />\n            </DataTrigger>\n\n            <DataTrigger\n              Binding=\"{Binding Path=HasStyle}\"\n              Value=\"False\">\n              <Setter Property=\"BorderBrush\" Value=\"Transparent\" />\n              <Setter Property=\"BorderThickness\" Value=\"0,0,0,0\" />\n            </DataTrigger>\n          </Style.Triggers>\n        </Style>\n      </ListView.ItemContainerStyle>\n      <ListView.ContextMenu>\n        <ContextMenu>\n          <MenuItem\n            Command=\"local:BookmarkCommand.JumpToBookmark\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=BookmarkList}\"\n            Header=\"Jump to Bookmark\"\n            InputGestureText=\"Enter\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource BookmarkArrowIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:BookmarkCommand.RemoveBookmark\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=BookmarkList}\"\n            Header=\"Remove Bookmark\"\n            InputGestureText=\"Ctrl+Shift+B\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource RemoveIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <Separator />\n\n          <MenuItem\n            Focusable=\"False\"\n            Header=\"Mark Bookmark\"\n            IsHitTestVisible=\"False\" />\n          <MenuItem>\n            <MenuItem.Header>\n              <local:ColorSelector ColorSelectedCommand=\"local:BookmarkCommand.MarkBookmark\" />\n            </MenuItem.Header>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:BookmarkCommand.UnmarkBookmark\"\n            Header=\"Clear Marker\" />\n          <Separator />\n\n        </ContextMenu>\n      </ListView.ContextMenu>\n      <ListView.InputBindings>\n        <KeyBinding\n          Key=\"Return\"\n          Command=\"local:BookmarkCommand.JumpToBookmark\"\n          CommandParameter=\"{Binding ElementName=BookmarkList, Path=SelectedItem}\"\n          CommandTarget=\"{Binding ElementName=BookmarkList}\" />\n      </ListView.InputBindings>\n    </ListView>\n  </Grid>\n\n\n  <local:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:BookmarkCommand.JumpToBookmark\"\n      CommandParameter=\"{Binding ElementName=BookmarkList, Path=SelectedItem}\" />\n    <KeyBinding\n      Key=\"F2\"\n      Command=\"local:DocumentCommand.NextBookmark\" />\n    <KeyBinding\n      Key=\"F2\"\n      Command=\"local:DocumentCommand.PreviousBookmark\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"B\"\n      Command=\"local:BookmarkCommand.RemoveBookmark\"\n      CommandParameter=\"{Binding ElementName=BookmarkList, Path=SelectedItem}\"\n      Modifiers=\"Ctrl+Shift\" />\n    <KeyBinding\n      Key=\"M\"\n      Command=\"local:BookmarkCommand.MarkBookmark\"\n      CommandParameter=\"{Binding ElementName=BookmarkList, Path=SelectedItem}\"\n      Modifiers=\"Ctrl\" />\n  </local:ToolPanelControl.InputBindings>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/BookmarksPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Controls;\n\nnamespace ProfileExplorer.UI;\n\npublic static class BookmarkCommand {\n  public static readonly RoutedUICommand JumpToBookmark = new(\"Untitled\", \"JumpToBookmark\", typeof(BookmarksPanel));\n  public static readonly RoutedUICommand RemoveBookmark = new(\"Untitled\", \"RemoveBookmark\", typeof(BookmarksPanel));\n  public static readonly RoutedUICommand RemoveAllBookmarks =\n    new(\"Untitled\", \"RemoveAllBookmarks\", typeof(BookmarksPanel));\n  public static readonly RoutedUICommand MarkBookmark = new(\"Untitled\", \"MarkBookmark\", typeof(BookmarksPanel));\n  public static readonly RoutedUICommand UnmarkBookmark = new(\"Untitled\", \"UnmarkBookmark\", typeof(BookmarksPanel));\n}\n\npublic partial class BookmarksPanel : ToolPanelControl {\n  private ObservableCollectionRefresh<Bookmark> bookmarks_;\n  private IRDocumentPopupInstance previewPopup_;\n\n  public BookmarksPanel() {\n    InitializeComponent();\n    ResetBookmarks();\n    SetupPreviewPopup();\n  }\n\n  public ObservableCollectionRefresh<Bookmark> Bookmarks => bookmarks_;\n  public override ToolPanelKind PanelKind => ToolPanelKind.Bookmarks;\n\n  public void InitializeForDocument(IRDocument document) {\n    Document = document;\n  }\n\n  private void TextBox_TextChanged(object sender, TextChangedEventArgs e) {\n    var bookmark = ((TextBox)sender).DataContext as Bookmark;\n    Document.BookmarkInfoChanged(bookmark);\n  }\n\n  private void SetupPreviewPopup() {\n    if (previewPopup_ != null) {\n      previewPopup_.UnregisterHoverEvents();\n      previewPopup_ = null;\n    }\n\n    previewPopup_ =\n      new IRDocumentPopupInstance(App.Settings.GetElementPreviewPopupSettings(ToolPanelKind.Bookmarks), Session);\n    previewPopup_.SetupHoverEvents(BookmarkList, HoverPreview.HoverDuration, () => {\n      var hoveredItem = Utils.FindPointedListViewItem(BookmarkList);\n\n      if (hoveredItem?.DataContext is Bookmark bookmark) {\n        return PreviewPopupArgs.ForDocument(Document, bookmark.Element, BookmarkList,\n                                            $\"Bookmark {bookmark.Text}\");\n      }\n\n      return null;\n    });\n  }\n\n  private void TextBox_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) {\n    var textBox = e.OriginalSource as TextBox;\n    textBox?.SelectAll();\n  }\n\n  private void TextBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    if (sender is TextBox textbox && !textbox.IsKeyboardFocusWithin) {\n      if (e.OriginalSource.GetType().Name == \"TextBoxView\") {\n        e.Handled = true;\n        textbox.Focus();\n      }\n    }\n  }\n\n  private void CheckBox_Checked(object sender, RoutedEventArgs e) {\n    var bookmark = ((CheckBox)sender).DataContext as Bookmark;\n    Document.BookmarkInfoChanged(bookmark);\n  }\n\n  private void CheckBox_Unchecked(object sender, RoutedEventArgs e) {\n    var bookmark = ((CheckBox)sender).DataContext as Bookmark;\n    Document.BookmarkInfoChanged(bookmark);\n  }\n\n  private void ListViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    var bookmark = ((ListViewItem)sender).DataContext as Bookmark;\n    Document.JumpToBookmark(bookmark);\n    bookmarks_.Refresh();\n  }\n\n  private void JumpToBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var bookmark = e.Parameter as Bookmark;\n    Document.JumpToBookmark(bookmark);\n    bookmarks_.Refresh();\n  }\n\n  private void RemoveBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var bookmark = e.Parameter as Bookmark;\n    Document.RemoveBookmark(bookmark);\n    bookmarks_.Refresh();\n  }\n\n  private void RemoveAllBookmarksExecuted(object sender, ExecutedRoutedEventArgs e) {\n    Document.RemoveAllBookmarks();\n    bookmarks_.Refresh();\n  }\n\n  private void MarkBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SetSelectedBookmarkStyle(Utils.GetSelectedColorStyle(e.Parameter as SelectedColorEventArgs,\n                                                         ColorPens.GetPen(Colors.Silver)));\n  }\n\n  private void UnmarkBookmarkExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SetSelectedBookmarkStyle(null);\n  }\n\n  private void SetSelectedBookmarkStyle(HighlightingStyle style) {\n    if (!(BookmarkList.SelectedItem is Bookmark bookmark)) {\n      return;\n    }\n\n    bookmark.Style = style;\n    Document.BookmarkInfoChanged(bookmark);\n    bookmarks_.Refresh();\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  public override async Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    InitializeForDocument(document);\n    IsPanelEnabled = Document != null;\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    ResetBookmarks();\n  }\n\n  private void ResetBookmarks() {\n    bookmarks_ = new ObservableCollectionRefresh<Bookmark>();\n    BookmarkList.ItemsSource = bookmarks_;\n  }\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    ResetBookmarks();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/CallGraphPanel.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI;\n\npublic class CallGraphPanel : GraphPanel {\n  public CallGraphPanel() {\n  }\n\n  public CallGraphPanel(IUISession session) {\n    Session = session;\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.CallGraph;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/CallerCalleePanel.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI.Profile;\n\npublic class CallerCalleePanel : CallTreePanel {\n  public CallerCalleePanel() {\n  }\n\n  public CallerCalleePanel(IUISession session) {\n    Session = session;\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.CallerCallee;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/DefinitionPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.DefinitionPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"50\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Grid.Column=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          Height=\"28\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n\n          <TextBlock\n            Margin=\"5,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"Symbol\" />\n          <TextBlock\n            x:Name=\"SymbolName\"\n            MinWidth=\"100\"\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Text=\"\" />\n\n        </ToolBar>\n      </ToolBarTray>\n\n      <local:PanelToolbarTray\n        x:Name=\"FixedToolbar\"\n        Grid.Column=\"1\"\n        DuplicateClicked=\"PanelToolbarTray_DuplicateClicked\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        PinnedChanged=\"PanelToolbarTray_PinnedChanged\" />\n    </Grid>\n\n    <local:IRDocument\n      x:Name=\"TextView\"\n      Grid.Row=\"1\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      FontFamily=\"Consolas\"\n      FontSize=\"12\"\n      HorizontalScrollBarVisibility=\"Hidden\"\n      ScrollViewer.HorizontalScrollBarVisibility=\"Hidden\"\n      ScrollViewer.VerticalScrollBarVisibility=\"Hidden\"\n      ShowLineNumbers=\"True\"\n      VerticalScrollBarVisibility=\"Hidden\"\n      WordWrap=\"False\" />\n  </Grid>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/DefinitionPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class DefinitionPanelState {\n  public int CaretOffset;\n  public IRElement DefinedOperand;\n  public bool HasPinnedContent;\n  public double HorizontalOffset;\n  public double VerticalOffset;\n}\n\npublic partial class DefinitionPanel : ToolPanelControl {\n  private IRElement definedOperand_;\n  private CancelableTaskInstance loadTask_;\n\n  public DefinitionPanel() {\n    InitializeComponent();\n    loadTask_ = new CancelableTaskInstance(false);\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Definition;\n  public override HandledEventKind HandledEvents => HandledEventKind.ElementSelection;\n\n  public override bool HasPinnedContent {\n    get => FixedToolbar.IsPinned;\n    set => FixedToolbar.IsPinned = value;\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private void PanelToolbarTray_DuplicateClicked(object sender, DuplicateEventArgs e) {\n    Session.DuplicatePanel(this, e.Kind);\n  }\n\n  private void PanelToolbarTray_PinnedChanged(object sender, PinEventArgs e) {\n    HasPinnedContent = e.IsPinned;\n  }\n\n  public override void OnElementSelected(IRElementEventArgs e) {\n    SwitchSelectedElement(e.Element, e.Document);\n  }\n\n  private void SwitchSelectedElement(IRElement element, IRDocument document) {\n    if (HasPinnedContent) {\n      return;\n    }\n\n    if (Document == null || !(element is OperandIR op)) {\n      return;\n    }\n\n    if (op.IsLabelAddress) {\n      SwitchDefinitionElement(op, op.BlockLabelValue);\n      return;\n    }\n\n    var refFinder = DocumentUtils.CreateReferenceFinder(Document.Function, Session,\n                                                        App.Settings.DocumentSettings);\n    var defOp = refFinder.FindSingleDefinition(element);\n\n    if (defOp != null && defOp != op) {\n      SwitchDefinitionElement(op, defOp);\n      return;\n    }\n\n    SymbolName.Text = \"\";\n  }\n\n  private void SwitchDefinitionElement(OperandIR op, IRElement defOp) {\n    //? TODO: Go through the NameProvider\n    SymbolName.Text = op.GetText(Document.SectionText).ToString();\n    TextView.MarkElementWithDefaultStyle(defOp);\n    TextView.BringElementIntoView(defOp);\n    definedOperand_ = op;\n  }\n\n  public override async Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (TextView.Section == section) {\n      return;\n    }\n\n    await TextView.InitializeFromDocument(document, false, null, false);\n    Document = document;\n\n    if (Session.LoadPanelState(this, section, document) is DefinitionPanelState savedState) {\n      SwitchSelectedElement(savedState.DefinedOperand, document);\n\n      TextView.SetCaretAtOffset(savedState.CaretOffset);\n      TextView.ScrollToHorizontalOffset(savedState.HorizontalOffset);\n      TextView.ScrollToVerticalOffset(savedState.VerticalOffset);\n      HasPinnedContent = savedState.HasPinnedContent;\n    }\n    else {\n      TextView.SetCaretAtOffset(0);\n      TextView.ScrollToHorizontalOffset(0);\n      TextView.ScrollToVerticalOffset(0);\n      HasPinnedContent = false;\n    }\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (TextView.Section != section) {\n      return;\n    }\n\n    if (definedOperand_ != null) {\n      var savedState = new DefinitionPanelState();\n      savedState.DefinedOperand = definedOperand_;\n      savedState.VerticalOffset = TextView.VerticalOffset;\n      savedState.HorizontalOffset = TextView.HorizontalOffset;\n      savedState.CaretOffset = TextView.CaretOffset;\n      savedState.HasPinnedContent = HasPinnedContent;\n      Session.SavePanelState(savedState, this, section, Document);\n      ResetDefinedOperand();\n    }\n\n    TextView.UnloadDocument();\n    Document = null;\n  }\n\n  private void ResetDefinedOperand() {\n    definedOperand_ = null;\n    SymbolName.Text = \"\";\n  }\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    ResetDefinedOperand();\n    TextView.UnloadDocument();\n  }\n\n  public override async void ClonePanel(IToolPanel sourcePanel) {\n    var defPanel = sourcePanel as DefinitionPanel;\n    await TextView.InitializeFromDocument(defPanel.TextView);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/DeveloperPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.DeveloperPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:document=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"30\" />\n      </Grid.ColumnDefinitions>\n\n      <ToolBarTray\n        Grid.Row=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n\n          <Button\n            Click=\"Button_Click\"\n            ToolTip=\"Show internal function IR\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource DocumentIcon}\" />\n              <TextBlock Text=\"Internal IR\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Click=\"Button_Click_1\"\n            ToolTip=\"Show IR parsing error list\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource WarningIcon}\" />\n              <TextBlock Text=\"Parsing Errors\" />\n            </StackPanel>\n          </Button>\n          <Separator />\n\n          <Button\n            Click=\"ButtonBase_OnClick\"\n            ToolTip=\"Show log file\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource ListIcon}\" />\n              <TextBlock Text=\"Log\" />\n            </StackPanel>\n          </Button>\n          <ToggleButton\n            Checked=\"ToggleButton_OnChecked\"\n            Content=\"Refresh\"\n            IsChecked=\"False\"\n            Style=\"{x:Null}\"\n            ToolTip=\"Continuously reload the log file\"\n            Unchecked=\"ToggleButton_OnUnchecked\" />\n        </ToolBar>\n      </ToolBarTray>\n\n      <local:PanelToolbarTray\n        Grid.Column=\"1\"\n        Visibility=\"Collapsed\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        HasPinButton=\"False\" />\n    </Grid>\n\n    <document:SearcheableIRDocument\n      x:Name=\"TextView\"\n      Grid.Row=\"1\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      FontFamily=\"Consolas\"\n      FontSize=\"12\" />\n\n    <ListBox\n      x:Name=\"ErrorList\"\n      Grid.Row=\"1\"\n      SelectionChanged=\"ErrorList_SelectionChanged\"\n      Visibility=\"Collapsed\" />\n  </Grid>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/DeveloperPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Parser;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class DeveloperPanel : ToolPanelControl {\n  private DispatcherTimer logFileTimer_;\n  private string previousLogFileText_;\n\n  public DeveloperPanel() {\n    InitializeComponent();\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Developer;\n  public override HandledEventKind HandledEvents => HandledEventKind.ElementSelection;\n\n  private async void Button_Click(object sender, RoutedEventArgs e) {\n    ErrorList.Visibility = Visibility.Collapsed;\n    TextView.Visibility = Visibility.Visible;\n\n    if (Session.CurrentDocument != null) {\n      var printer = new IRPrinter(Session.CurrentDocument.Function);\n      await TextView.SetText(printer.Print(),\n                             Utils.LoadSyntaxHighlightingFile(App.GetInternalIRSyntaxHighlightingFilePath()));\n    }\n    else {\n      await TextView.SetText(\"No document opened\");\n    }\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async void Button_Click_1(object sender, RoutedEventArgs e) {\n    ErrorList.Visibility = Visibility.Visible;\n    TextView.Visibility = Visibility.Collapsed;\n\n    if (Session.CurrentDocument != null) {\n      var section = Session.CurrentDocument.Section;\n      var loader = Session.SessionState.FindLoadedDocument(section).Loader;\n      var loadedSection = loader.TryGetLoadedSection(section);\n\n      if (loadedSection != null && loadedSection.HadParsingErrors) {\n        ErrorList.ItemsSource = loadedSection.ParsingErrors;\n      }\n      else {\n        ErrorList.ItemsSource = null;\n      }\n    }\n    else {\n      await TextView.SetText(\"No document opened\");\n    }\n  }\n\n  private void ErrorList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (e.AddedItems.Count == 1) {\n      var error = e.AddedItems[0] as IRParsingError;\n      var document = Session.FindAssociatedDocument(this);\n      document.MarkTextRange(error.Location.Offset, 1, Colors.IndianRed);\n      document.SetCaretAtOffset(error.Location.Offset);\n      document.BringTextOffsetIntoView(error.Location.Offset);\n    }\n  }\n\n  public override async void OnElementSelected(IRElementEventArgs e) {\n    var builder = new StringBuilder();\n    builder.AppendLine(e.Element.ToString());\n\n    if (e.Element.Tags != null) {\n      builder.AppendLine($\"{e.Element.Tags.Count} tags:\");\n\n      foreach (var tag in e.Element.Tags) {\n        builder.AppendLine($\"  - {tag.ToString().Indent(4)}\");\n      }\n    }\n\n    await TextView.SetText(builder.ToString());\n  }\n\n  private async void ButtonBase_OnClick(object sender, RoutedEventArgs e) {\n    ErrorList.Visibility = Visibility.Collapsed;\n    TextView.Visibility = Visibility.Visible;\n    await ReloadLogFile();\n  }\n\n  private async Task ReloadLogFile() {\n    string traceFile = App.GetTraceFilePath();\n\n    if (File.Exists(traceFile)) {\n      try {\n        Trace.Flush();\n        using var stream = new FileStream(traceFile, FileMode.Open,\n                                          FileAccess.Read, FileShare.ReadWrite);\n        using var streamReader = new StreamReader(stream);\n        string text = await streamReader.ReadToEndAsync();\n\n        if (text != previousLogFileText_) {\n          await TextView.SetText(text);\n          TextView.ScrollToEnd();\n          previousLogFileText_ = text;\n        }\n      }\n      catch (Exception ex) {\n        await TextView.SetText($\"Failed to load log file: {ex.Message}\");\n      }\n    }\n  }\n\n  private async void ToggleButton_OnChecked(object sender, RoutedEventArgs e) {\n    StopLogFileTimer();\n    logFileTimer_ = new DispatcherTimer();\n    logFileTimer_.Interval = TimeSpan.FromMilliseconds(500);\n    logFileTimer_.Tick += async (o, args) => await ReloadLogFile();\n    logFileTimer_.Start();\n  }\n\n  private void ToggleButton_OnUnchecked(object sender, RoutedEventArgs e) {\n    StopLogFileTimer();\n  }\n\n  private void StopLogFileTimer() {\n    if (logFileTimer_ != null) {\n      logFileTimer_.Stop();\n      logFileTimer_ = null;\n    }\n  }\n\n  public override void OnSessionStart() {\n    base.OnSessionStart();\n    TextView.Session = Session;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/DocumentSearchPanel.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.Panels.DocumentSearchPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorer=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:doc=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  AllowsTransparency=\"True\"\n  SnapsToDevicePixels=\"True\"\n  StaysOpen=\"False\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </controls:DraggablePopup.LayoutTransform>\n\n  <Border\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <DockPanel LastChildFill=\"True\">\n      <DockPanel\n        x:Name=\"SearchPanelHost\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        DockPanel.Dock=\"Top\"\n        LastChildFill=\"True\">\n        <doc:SearchPanel\n          x:Name=\"SearchPanel\"\n          Height=\"28\"\n          Margin=\"-1,-1,0,0\"\n          DockPanel.Dock=\"Left\" />\n\n        <Border\n          BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n          BorderThickness=\"0,0,0,1\"\n          DockPanel.Dock=\"Right\">\n          <Grid>\n            <Button\n              x:Name=\"PinPanelButton\"\n              Grid.Row=\"0\"\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"0,0,2,0\"\n              HorizontalAlignment=\"Right\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{x:Null}\"\n              Click=\"PinPanelButton_Click\"\n              Visibility=\"{Binding IsPanelDetached, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PinIcon}\" />\n            </Button>\n            <Button\n              x:Name=\"ClosePanelButton\"\n              Grid.Row=\"0\"\n              Width=\"20\"\n              Height=\"20\"\n              Margin=\"0,0,2,0\"\n              HorizontalAlignment=\"Right\"\n              Background=\"#01FFFFFF\"\n              BorderBrush=\"{x:Null}\"\n              Click=\"ClosePanelButton_Click\"\n              Visibility=\"{Binding IsPanelDetached, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource CloseIcon}\" />\n            </Button>\n          </Grid>\n        </Border>\n      </DockPanel>\n\n      <Grid DockPanel.Dock=\"Bottom\">\n        <controls:ResizeGrip\n          x:Name=\"PanelResizeGrip\"\n          Grid.Row=\"0\"\n          Width=\"16\"\n          Height=\"16\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Bottom\"\n          Panel.ZIndex=\"100\" />\n\n        <ProfileExplorer:SearchResultsPanel x:Name=\"ResultsPanel\" />\n      </Grid>\n    </DockPanel>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/DocumentSearchPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorerUI.Session;\n\nnamespace ProfileExplorer.UI.Panels;\n\npublic partial class DocumentSearchPanel : DraggablePopup {\n  private IUISession session_;\n  private ILoadedDocument document_;\n  private CancelableTask searchTask_;\n  private SearchInfo searchInfo_;\n  private DocumentSearchInfo data_;\n\n  public DocumentSearchPanel(Point position, double width, double height,\n                             UIElement referenceElement, IUISession session, ILoadedDocument document) {\n    InitializeComponent();\n    Initialize(position, width, height, referenceElement);\n    PanelResizeGrip.ResizedControl = this;\n\n    data_ = new DocumentSearchInfo();\n    DataContext = data_;\n    session_ = session;\n    document_ = document;\n    SetupSearchPanel();\n    SetupResultsPanel();\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public override bool ShouldStartDragging(MouseButtonEventArgs e) {\n    if (e.LeftButton == MouseButtonState.Pressed && SearchPanelHost.IsMouseOver) {\n      DetachPanel();\n      return true;\n    }\n\n    return false;\n  }\n\n  private void SetupResultsPanel() {\n    ResultsPanel.HideToolbarTray = true;\n    ResultsPanel.HideSearchedText = true;\n    ResultsPanel.OpenSection += ResultsPanel_OpenSection;\n  }\n\n  private void SetupSearchPanel() {\n    searchInfo_ = new SearchInfo {\n      ShowSearchAllButton = false,\n      ShowNavigationSection = false\n    };\n\n    SearchPanel.SearchChanged += SearchPanel_SearchChanged;\n    SearchPanel.Show(searchInfo_);\n  }\n\n  private async void ResultsPanel_OpenSection(object sender, OpenSectionEventArgs e) {\n    await session_.SwitchDocumentSectionAsync(e);\n  }\n\n  private async void SearchPanel_SearchChanged(object sender, SearchInfo e) {\n    string searchedText = e.SearchedText;\n\n    if (searchedText.Length < 2) {\n      ResultsPanel.ClearSearchResults();\n      ResultsPanel.OptionalText = \"\";\n      return;\n    }\n\n    var results = await UpdateSearchPanel(searchedText);\n\n    if (results != null) {\n      // Update UI if search was not cancelled.\n      ResultsPanel.Session = session_;\n      ResultsPanel.UpdateSearchResults(results, new SearchInfo());\n\n      // Update result details.\n      var functions = new HashSet<IRTextFunction>();\n      int sectionCount = 0;\n\n      foreach (var result in results) {\n        if (result.Results.Count > 0) {\n          sectionCount++;\n          functions.Add(result.Section.ParentFunction);\n        }\n      }\n\n      ResultsPanel.OptionalText = $\"Functions: {functions.Count}        Sections: {sectionCount}\";\n    }\n  }\n\n  private async Task<List<SectionSearchResult>> UpdateSearchPanel(string searchedText) {\n    // Create a task that can be used later to cancel the search\n    // if another letter is being pressed.\n    var searchTask = new CancelableTask();\n\n    lock (this) {\n      if (searchTask_ != null) {\n        searchTask_.Cancel();\n      }\n\n      searchTask_ = searchTask;\n    }\n\n    var docInfo = document_;\n    var searcherOptions = new SectionTextSearcherOptions {\n      SearchBeforeOutput = false,\n      KeepSectionText = false, // Reduces memory usage for large files.\n      UseRawSectionText = true // Speeds up reading large sections.\n    };\n\n    var searcher = new SectionTextSearcher(docInfo.Loader, searcherOptions);\n    var list = new List<IRTextSection>();\n\n    foreach (var func in docInfo.Summary.Functions) {\n      list.AddRange(func.Sections);\n    }\n\n    // Start the search on another thread.,\n    var results = await searcher.SearchAsync(searchedText, searchInfo_.SearchKind, list, searchTask_);\n\n    if (searchTask.IsCanceled) {\n      return null;\n    }\n\n    searchTask.Complete();\n\n    lock (this) {\n      if (searchTask_ == searchTask) {\n        searchTask_ = null;\n      }\n    }\n\n    return results;\n  }\n\n  private void DetachPanel() {\n    if (IsDetached) {\n      return;\n    }\n\n    DetachPopup();\n    StaysOpen = true;\n    data_.IsPanelDetached = true;\n  }\n\n  private void PinPanelButton_Click(object sender, RoutedEventArgs e) {\n    DetachPanel();\n  }\n\n  private void ClosePanelButton_Click(object sender, RoutedEventArgs e) {\n    ClosePopup();\n  }\n\n  private class DocumentSearchInfo : INotifyPropertyChanged {\n    private bool panelDetached_;\n    public int FunctionCount { get; set; }\n    public int SectionCount { get; set; }\n    public int InstanceCount { get; set; }\n    public long Duration { get; set; }\n\n    public bool IsPanelDetached {\n      get => panelDetached_;\n      set {\n        if (panelDetached_ != value) {\n          panelDetached_ = value;\n          NotifyPropertyChanged(nameof(IsPanelDetached));\n        }\n      }\n    }\n\n    public event PropertyChangedEventHandler PropertyChanged;\n\n    public void NotifyPropertyChanged(string propertyName) {\n      PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/DominatorTreePanel.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI;\n\npublic class DominatorTreePanel : GraphPanel {\n  public override ToolPanelKind PanelKind => ToolPanelKind.DominatorTree;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ExpressionGraphPanel.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI;\n\npublic class ExpressionGraphPanel : GraphPanel {\n  public override ToolPanelKind PanelKind => ToolPanelKind.ExpressionGraph;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/FunctionCodeStatistics.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.UI;\n\npublic class FunctionCodeStatistics {\n  public long Size { get; set; }\n  public int Instructions { get; set; }\n  public int Loads { get; set; }\n  public int Stores { get; set; }\n  public int Branches { get; set; }\n  public int Calls { get; set; }\n  public int Callers { get; set; }\n  public int IndirectCalls { get; set; }\n  public int Callees { get; set; }\n  public int OpcodeHash { get; set; }\n\n  public static FunctionCodeStatistics Compute(FunctionIR function, ICompilerIRInfo irInfo) {\n    var stats = new FunctionCodeStatistics();\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n\n    if (metadataTag != null) {\n      stats.Size = metadataTag.FunctionSize;\n    }\n\n    foreach (var instr in function.AllInstructions) {\n      stats.Instructions++;\n\n      //? TODO: Add hash for branch targets, other diff registers, etc - configurable with options\n      if (instr.Opcode != null) {\n        stats.OpcodeHash = HashCode.Combine(stats.OpcodeHash, instr.Opcode.GetHashCode());\n      }\n      else if (!instr.OpcodeText.IsEmpty) {\n        stats.OpcodeHash = HashCode.Combine(stats.OpcodeHash, instr.OpcodeText.ToString().GetHashCode());\n      }\n\n      if (instr.IsBranch || instr.IsGoto || instr.IsSwitch) {\n        stats.Branches++;\n      }\n\n      if (irInfo.IsLoadInstruction(instr)) {\n        stats.Loads++;\n      }\n\n      if (irInfo.IsStoreInstruction(instr)) {\n        stats.Stores++;\n      }\n\n      if (irInfo.IsCallInstruction(instr)) {\n        if (irInfo.GetCallTarget(instr) == null) {\n          stats.IndirectCalls++;\n        }\n\n        stats.Calls++;\n      }\n    }\n\n    return stats;\n  }\n\n  public bool ComputeDiff(FunctionCodeStatistics other) {\n    Size = other.Size - Size;\n    Instructions = other.Instructions - Instructions;\n    Loads = other.Loads - Loads;\n    Stores = other.Stores - Stores;\n    Branches = other.Branches - Branches;\n    Calls = other.Calls - Calls;\n    Callers = other.Callers - Callers;\n    IndirectCalls = other.IndirectCalls - IndirectCalls;\n    Callees = other.Callees - Callees;\n    return Size != 0 || Instructions != 0 ||\n           Loads != 0 || Stores != 0 ||\n           Branches != 0 || Calls != 0 ||\n           Callers != 0 || IndirectCalls != 0 || Callees != 0;\n  }\n\n  public void Add(FunctionCodeStatistics other) {\n    Size = other.Size + Size;\n    Instructions = other.Instructions + Instructions;\n    Loads = other.Loads + Loads;\n    Stores = other.Stores + Stores;\n    Branches = other.Branches + Branches;\n    Calls = other.Calls + Calls;\n    Callers = other.Callers + Callers;\n    IndirectCalls = other.IndirectCalls + IndirectCalls;\n    Callees = other.Callees + Callees;\n    OpcodeHash = HashCode.Combine(OpcodeHash, other.OpcodeHash);\n  }\n\n  public override string ToString() {\n    return $\"Size: {Size}\\n\" +\n           $\"Instructions: {Instructions}\\n\" +\n           $\"Loads: {Loads}\\n\" +\n           $\"Stores: {Stores}\\n\" +\n           $\"Branches: {Branches}\\n\" +\n           $\"Calls: {Calls}\\n\" +\n           $\"Callers: {Callers}\\n\" +\n           $\"IndirectCalls: {IndirectCalls}\\n\" +\n           $\"Callees: {Callees}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/GraphCommand.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI;\n\npublic static class GraphCommand {\n  public static readonly RoutedCommand GraphFitWidth = new(\"GraphFitWidth\", typeof(GraphPanel));\n  public static readonly RoutedCommand GraphResetWidth = new(\"GraphResetWidth\", typeof(GraphPanel));\n  public static readonly RoutedCommand GraphFitAll = new(\"GraphFitAll\", typeof(GraphPanel));\n  public static readonly RoutedCommand GraphZoomIn = new(\"GraphZoomIn\", typeof(GraphPanel));\n  public static readonly RoutedCommand GraphZoomOut = new(\"GraphZoomOut\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkBlock = new(\"MarkBlock\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkPredecessors = new(\"MarkPredecessors\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkSuccessors = new(\"MarkSuccessors\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkGroup = new(\"MarkGroup\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkLoop = new(\"MarkLoop\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkLoopNest = new(\"MarkLoopNest\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkDominators = new(\"MarkDominators\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkPostDominators = new(\"MarkPostDominators\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkDominanceFrontier = new(\"MarkDominanceFrontier\", typeof(GraphPanel));\n  public static readonly RoutedCommand MarkPostDominanceFrontier = new(\"MarkPostDominanceFrontier\", typeof(GraphPanel));\n  public static readonly RoutedCommand ClearMarked = new(\"ClearMarked\", typeof(GraphPanel));\n  public static readonly RoutedCommand ClearAllMarked = new(\"ClearAllMarked\", typeof(GraphPanel));\n  public static readonly RoutedCommand SelectQueryBlock1 = new(\"SelectQueryBlock1\", typeof(GraphPanel));\n  public static readonly RoutedCommand SelectQueryBlock2 = new(\"SelectQueryBlock2\", typeof(GraphPanel));\n  public static readonly RoutedCommand SwapQueryBlocks = new(\"SwapQueryBlocks\", typeof(GraphPanel));\n  public static readonly RoutedCommand CloseQueryPanel = new(\"CloseQueryPanel\", typeof(GraphPanel));\n  public static readonly RoutedCommand ShowReachablePath = new(\"ShowReachablePath\", typeof(GraphPanel));\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/GraphPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.GraphPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"500\"\n  Focusable=\"True\"\n  IsTabStop=\"True\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:GraphCommand.GraphFitWidth\"\n      Executed=\"ExecuteGraphFitWidth\" />\n    <CommandBinding\n      Command=\"local:GraphCommand.GraphResetWidth\"\n      Executed=\"ExecuteGraphResetWidth\" />\n    <CommandBinding\n      Command=\"local:GraphCommand.GraphFitAll\"\n      Executed=\"ExecuteGraphFitAll\" />\n    <CommandBinding\n      Command=\"local:GraphCommand.GraphZoomIn\"\n      Executed=\"ExecuteGraphZoomIn\" />\n    <CommandBinding\n      Command=\"local:GraphCommand.GraphZoomOut\"\n      Executed=\"ExecuteGraphZoomOut\" />\n  </local:ToolPanelControl.CommandBindings>\n\n  <local:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"W\"\n      Command=\"local:GraphCommand.GraphFitWidth\"\n      CommandTarget=\"{Binding ElementName=GraphHost}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"R\"\n      Command=\"local:GraphCommand.GraphResetWidth\"\n      CommandTarget=\"{Binding ElementName=GraphHost}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"D0\"\n      Command=\"local:GraphCommand.GraphResetWidth\"\n      CommandTarget=\"{Binding ElementName=GraphHost}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"R\"\n      Command=\"local:GraphCommand.GraphResetWidth\"\n      CommandTarget=\"{Binding ElementName=GraphHost}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"A\"\n      Command=\"local:GraphCommand.GraphFitAll\"\n      CommandTarget=\"{Binding ElementName=GraphHost}\"\n      Modifiers=\"Ctrl\" />\n    <!-- <KeyBinding -->\n    <!--   Key=\"M\" -->\n    <!--   Command=\"local:GraphCommand.MarkBlock\" -->\n    <!--   CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--   Modifiers=\"Ctrl\" /> -->\n    <!-- <KeyBinding -->\n    <!--   Key=\"M\" -->\n    <!--   Command=\"local:GraphCommand.MarkGroup\" -->\n    <!--   CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--   Modifiers=\"Shift+Ctrl\" /> -->\n    <!-- <KeyBinding -->\n    <!--   Key=\"P\" -->\n    <!--   Command=\"local:GraphCommand.MarkPredecessors\" -->\n    <!--   CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--   Modifiers=\"Ctrl\" /> -->\n    <!-- <KeyBinding -->\n    <!--   Key=\"S\" -->\n    <!--   Command=\"local:GraphCommand.MarkSuccessors\" -->\n    <!--   CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--   Modifiers=\"Ctrl\" /> -->\n    <!-- <KeyBinding -->\n    <!--   Key=\"L\" -->\n    <!--   Command=\"local:GraphCommand.MarkLoop\" -->\n    <!--   CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--   Modifiers=\"Ctrl\" /> -->\n    <!-- <KeyBinding -->\n    <!--   Key=\"L\" -->\n    <!--   Command=\"local:GraphCommand.MarkLoopNest\" -->\n    <!--   CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--   Modifiers=\"Shift+Ctrl\" /> -->\n  </local:ToolPanelControl.InputBindings>\n\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      x:Name=\"ToolbarHost\"\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"70\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        DockPanel.Dock=\"Left\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <Button\n            Command=\"local:GraphCommand.GraphResetWidth\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom the graph view to 100% (Ctrl+0/Ctrl+R)\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource ResetWidthIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Reset\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Margin=\"4,0,0,0\"\n            Command=\"local:GraphCommand.GraphZoomOut\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom Out (Ctrl+_\">\n            <Image\n              Width=\"15\"\n              Height=\"15\"\n              Source=\"{StaticResource ZoomOutIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Button\n            Command=\"local:GraphCommand.GraphZoomIn\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom In (Ctrl+=)\">\n            <Image\n              Width=\"15\"\n              Height=\"15\"\n              Source=\"{StaticResource ZoomInIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Separator />\n          <Button\n            Margin=\"4,0,0,0\"\n            Command=\"local:GraphCommand.GraphFitWidth\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom the view to fit the graph horizontally (Ctrl+W)\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource FitWidthIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Width\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Command=\"local:GraphCommand.GraphFitAll\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom the view to show the entire graph (Ctrl+A)\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource FitAllIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"All\" />\n            </StackPanel>\n          </Button>\n\n          <!-- <Separator /> -->\n          <!-- <Menu -->\n          <!--   VerticalAlignment=\"Center\" -->\n          <!--   Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"> -->\n          <!--   <MenuItem -->\n          <!--     Padding=\"0,2,0,2\" -->\n          <!--     Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n          <!--     BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" -->\n          <!--     Header=\"Clear\" -->\n          <!--     OverridesDefaultStyle=\"True\"> -->\n          <!--     <MenuItem.Icon> -->\n          <!--       <Image -->\n          <!--         Width=\"16\" -->\n          <!--         Height=\"16\" -->\n          <!--         Source=\"{StaticResource RemoveIcon}\" -->\n          <!--         Style=\"{StaticResource DisabledImageStyle}\" /> -->\n          <!--     </MenuItem.Icon> -->\n          <!--     <MenuItem -->\n          <!--       Command=\"local:GraphCommand.ClearMarked\" -->\n          <!--       CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n          <!--       Header=\"Selected Marker\" /> -->\n          <!--     <MenuItem -->\n          <!--       Command=\"local:GraphCommand.ClearAllMarked\" -->\n          <!--       CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n          <!--       Header=\"All Markers\" /> -->\n          <!--   </MenuItem> -->\n          <!-- </Menu> -->\n        </ToolBar>\n      </ToolBarTray>\n\n      <local:PanelToolbarTray\n        Grid.Column=\"1\"\n        BindMenuItemSelected=\"PanelToolbarTray_BindMenuItemSelected\"\n        BindMenuOpen=\"PanelToolbarTray_BindMenuOpen\"\n        DuplicateClicked=\"PanelToolbarTray_DuplicateClicked\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"True\"\n        PinnedChanged=\"PanelToolbarTray_PinnedChanged\"\n        HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n        SettingsClicked=\"PanelToolbarTray_SettingsClicked\" />\n    </Grid>\n\n    <local:ScrollViewerClickable\n      x:Name=\"GraphHost\"\n      Grid.Row=\"1\"\n      Background=\"#EFECE2\"\n      HorizontalScrollBarVisibility=\"Auto\"\n      VerticalScrollBarVisibility=\"Auto\">\n      <local:GraphViewer\n        x:Name=\"GraphViewer\"\n        ContextMenu=\"{StaticResource GraphContextMenu}\" />\n    </local:ScrollViewerClickable>\n\n    <Grid\n      x:Name=\"LongOperationView\"\n      Grid.Row=\"1\"\n      Panel.ZIndex=\"1\"\n      Visibility=\"Collapsed\">\n      <Border\n        Width=\"150\"\n        Height=\"50\"\n        Background=\"#FFB4D9FF\"\n        BorderBrush=\"DarkGray\"\n        BorderThickness=\"1\"\n        CornerRadius=\"4\">\n        <StackPanel Orientation=\"Vertical\">\n          <TextBlock\n            Margin=\"0,4,0,4\"\n            HorizontalAlignment=\"Center\"\n            Text=\"Generating graph\" />\n          <Button\n            x:Name=\"CancelButton\"\n            Padding=\"4,1,4,1\"\n            HorizontalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            Click=\"CancelButton_Click\"\n            Content=\"Cancel\" />\n        </StackPanel>\n      </Border>\n    </Grid>\n\n    <Grid\n      x:Name=\"QueryPanel\"\n      Grid.Row=\"1\"\n      Width=\"200\"\n      Height=\"172\"\n      Margin=\"5,0,0,5\"\n      HorizontalAlignment=\"Left\"\n      VerticalAlignment=\"Bottom\"\n      Panel.ZIndex=\"3\"\n      Background=\"LightGray\"\n      MouseEnter=\"QueryPanel_MouseEnter\"\n      MouseLeave=\"QueryPanel_MouseLeave\"\n      Opacity=\"0.5\"\n      Visibility=\"Collapsed\">\n      <Border\n        BorderBrush=\"DarkGray\"\n        BorderThickness=\"1,1,1,1\">\n        <Grid>\n          <StackPanel Orientation=\"Vertical\">\n            <Grid>\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition Width=\"*\" />\n                <ColumnDefinition Width=\"20\" />\n              </Grid.ColumnDefinitions>\n              <Grid.RowDefinitions>\n                <RowDefinition Height=\"20\" />\n                <RowDefinition Height=\"20\" />\n                <RowDefinition Height=\"20\" />\n              </Grid.RowDefinitions>\n\n              <Grid\n                Grid.Row=\"0\"\n                Grid.Column=\"0\"\n                Grid.ColumnSpan=\"2\"\n                Background=\"{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}\">\n                <TextBlock\n                  Margin=\"4,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  FontWeight=\"Bold\"\n                  Text=\"Query Results\" />\n              </Grid>\n\n              <StackPanel\n                Grid.Row=\"1\"\n                Grid.Column=\"0\"\n                Margin=\"4,0,4,0\"\n                Orientation=\"Horizontal\">\n                <TextBlock\n                  VerticalAlignment=\"Center\"\n                  Text=\"Block A:\" />\n                <TextBlock\n                  Margin=\"8,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  FontWeight=\"Medium\"\n                  Text=\"{Binding Block1Name}\"\n                  TextTrimming=\"CharacterEllipsis\" />\n              </StackPanel>\n\n              <Button\n                Grid.Row=\"0\"\n                Grid.Column=\"1\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Command=\"local:GraphCommand.CloseQueryPanel\"\n                CommandTarget=\"{Binding ElementName=GraphHost}\"\n                ToolTip=\"Close query panel\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource CloseIcon}\" />\n              </Button>\n\n              <Button\n                Grid.Row=\"2\"\n                Grid.Column=\"1\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Command=\"local:GraphCommand.SwapQueryBlocks\"\n                CommandTarget=\"{Binding ElementName=GraphHost}\"\n                ToolTip=\"Swap blocks\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource DiffIcon}\" />\n              </Button>\n\n              <StackPanel\n                Grid.Row=\"2\"\n                Grid.Column=\"0\"\n                Margin=\"4,0,4,0\"\n                Orientation=\"Horizontal\">\n                <TextBlock\n                  VerticalAlignment=\"Center\"\n                  Text=\"Block B:\" />\n                <TextBlock\n                  Margin=\"8,0,0,0\"\n                  VerticalAlignment=\"Center\"\n                  FontWeight=\"Medium\"\n                  Text=\"{Binding Block2Name}\"\n                  TextTrimming=\"CharacterEllipsis\" />\n              </StackPanel>\n            </Grid>\n\n            <Separator />\n            <CheckBox\n              Margin=\"4,0,0,0\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Content=\"A dominates B\"\n              IsChecked=\"{Binding Dominates}\"\n              IsHitTestVisible=\"False\" />\n            <Separator />\n            <CheckBox\n              Margin=\"4,0,0,0\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Content=\"A post-dominates B\"\n              IsChecked=\"{Binding PostDominates}\"\n              IsHitTestVisible=\"False\" />\n\n            <Separator />\n\n            <StackPanel Orientation=\"Horizontal\">\n              <CheckBox\n                Margin=\"4,0,0,0\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                Content=\"A reaches B\"\n                IsChecked=\"{Binding Reaches}\"\n                IsHitTestVisible=\"False\" />\n              <Button\n                Margin=\"16,0,0,0\"\n                HorizontalAlignment=\"Right\"\n                VerticalAlignment=\"Center\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Command=\"local:GraphCommand.ShowReachablePath\"\n                CommandTarget=\"{Binding ElementName=GraphHost}\"\n                ToolTip=\"Mark path connecting blocks A and B\">\n                <Image\n                  Width=\"12\"\n                  Height=\"12\"\n                  Source=\"{StaticResource PeekDefinitionIcon}\" />\n              </Button>\n            </StackPanel>\n            <Separator />\n            <CheckBox\n              Margin=\"4,0,0,0\"\n              Content=\"A control-dependent on B\"\n              Foreground=\"{DynamicResource DisabledForegroundBrush}\"\n              IsChecked=\"{Binding ControlDependent}\"\n              IsEnabled=\"False\"\n              IsHitTestVisible=\"False\" />\n            <Separator />\n            <CheckBox\n              Margin=\"4,0,0,0\"\n              Content=\"A on dom. frontier of B\"\n              Foreground=\"{DynamicResource DisabledForegroundBrush}\"\n              IsChecked=\"{Binding OnDomFrontier}\"\n              IsEnabled=\"False\"\n              IsHitTestVisible=\"False\" />\n          </StackPanel>\n        </Grid>\n      </Border>\n    </Grid>\n  </Grid>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/GraphPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Animation;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Panels;\nusing ProtoBuf;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.IR.Tags;\n\nnamespace ProfileExplorer.UI;\n\n// ScrollViewer that ignores click events so they get passed\n// to the hosted control, allowing for dragging the graphs for ex.\npublic class ScrollViewerClickable : ScrollViewer {\n  protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) {\n    Keyboard.Focus(this);\n  }\n\n  protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { }\n\n  protected override void OnMouseRightButtonDown(MouseButtonEventArgs e) {\n    Keyboard.Focus(this);\n  }\n\n  protected override void OnMouseRightButtonUp(MouseButtonEventArgs e) { }\n}\n\n[ProtoContract]\npublic class GraphPanelState {\n  [ProtoMember(3)]\n  public double HorizontalOffset;\n  [ProtoMember(2)]\n  public double VerticalOffset;\n  [ProtoMember(1)]\n  public double ZoomLevel;\n}\n\npublic partial class GraphPanel : ToolPanelControl {\n  private const double FastPanOffset = 80;\n  private const double FastZoomFactor = 4;\n  private const double MaxZoomLevel = 2.0;\n  private const double MinZoomLevel = 0.25;\n  private const double PanOffset = 20;\n  private const double ZoomAdjustment = 0.05;\n  private const double HorizontalViewMargin = 50;\n  private const double VerticalViewMargin = 100;\n  private bool delayFitSize_;\n  private bool delayRestoreState_;\n  private bool dragging_;\n  private Point draggingStart_;\n  private Point draggingViewStart_;\n  private Graph graph_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private GraphNode hoveredNode_;\n  private bool ignoreNextHover_;\n  private CancelableTaskInstance loadTask_;\n  private IRDocumentPopup previewPopup_;\n  private GraphQueryInfo queryInfo_;\n  private bool queryPanelVisible_;\n  private DelayedAction removeHoveredAction_;\n  private bool restoredState_;\n\n  public GraphPanel() {\n    InitializeComponent();\n    GraphViewer.HostPanel = this;\n    GraphViewer.MaxZoomLevel = MaxZoomLevel;\n    SetupEvents();\n\n    //? TODO: No context menu for expr graph yet, don't show CFG one.\n    if (PanelKind == ToolPanelKind.ExpressionGraph) {\n      GraphViewer.ContextMenu = null;\n    }\n\n    SetupCommands();\n  }\n\n  public IRElement SelectedElement {\n    get => GraphViewer.SelectedElement;\n    set {\n      GraphViewer.SelectElement(value);\n\n      if (!HasPinnedContent && Settings.BringNodesIntoView) {\n        BringIntoView(value);\n      }\n    }\n  }\n\n  public IRTextSection Section => Document?.Section;\n  public override ToolPanelKind PanelKind => ToolPanelKind.FlowGraph;\n  public override HandledEventKind HandledEvents =>\n    HandledEventKind.ElementSelection | HandledEventKind.ElementHighlighting;\n  public GraphSettings Settings =>\n    PanelKind == ToolPanelKind.ExpressionGraph\n      ? App.Settings.ExpressionGraphSettings\n      : App.Settings.FlowGraphSettings;\n\n  public void BringIntoView(IRElement element) {\n    var node = GraphViewer.FindElementNode(element);\n\n    if (node == null) {\n      return;\n    }\n\n    var position = GraphViewer.GetNodePosition(node);\n    double offsetX = GraphHost.HorizontalOffset;\n    double offsetY = GraphHost.VerticalOffset;\n\n    if (position.X < offsetX || position.X > offsetX + GraphHost.ActualWidth) {\n      GraphHost.ScrollToHorizontalOffset(Math.Max(0, position.X - HorizontalViewMargin));\n    }\n\n    if (position.Y < offsetY || position.Y > offsetY + GraphHost.ActualHeight) {\n      GraphHost.ScrollToVerticalOffset(Math.Max(0, position.Y - VerticalViewMargin));\n    }\n  }\n\n  public void DisplayGraph(Graph graph) {\n    graph_ = graph;\n    GraphViewer.ShowGraph(graph, Session.CompilerInfo);\n    FitGraphIntoView();\n\n    if (delayRestoreState_) {\n      Dispatcher.BeginInvoke(() => LoadSavedState(), DispatcherPriority.Render);\n    }\n\n    HasPinnedContent = false;\n    EnablePanel();\n  }\n\n  public void HideGraph() {\n    if (graph_ == null) {\n      return;\n    }\n\n    GraphViewer.HideGraph();\n    Document = null;\n    graph_ = null;\n    hoveredNode_ = null;\n    DisablePanel();\n  }\n\n  private void Highlight(IRHighlightingEventArgs info) {\n    if (!Settings.SyncMarkedNodes && info.Type == HighlighingType.Marked) {\n      return;\n    }\n\n    GraphViewer.Highlight(info);\n  }\n\n  public void InitializeFromDocument(IRDocument document) {\n#if DEBUG\n    Trace.TraceInformation(\n      $\"Graph panel {ObjectTracker.Track(this)}: initialize with doc {ObjectTracker.Track(document)}\");\n#endif\n    Document = document;\n  }\n\n  public async Task<CancelableTask> OnGenerateGraphStart(IRTextSection section) {\n    var animation = new DoubleAnimation(0.25, TimeSpan.FromSeconds(0.5));\n    animation.BeginTime = TimeSpan.FromSeconds(1);\n    GraphViewer.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    LongOperationView.Opacity = 0.0;\n    LongOperationView.Visibility = Visibility.Visible;\n    var animation2 = new DoubleAnimation(1.0, TimeSpan.FromSeconds(0.5));\n    animation2.BeginTime = TimeSpan.FromSeconds(2);\n    LongOperationView.BeginAnimation(OpacityProperty, animation2, HandoffBehavior.SnapshotAndReplace);\n\n    return await CreateGraphLoadTask();\n  }\n\n  public void OnGenerateGraphDone(CancelableTask task, bool failed = false) {\n    if (!failed) {\n      GraphHost.ScrollToHorizontalOffset(0);\n      GraphHost.ScrollToVerticalOffset(0);\n      var animation = new DoubleAnimation(1.0, TimeSpan.FromSeconds(0.2));\n      GraphViewer.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    }\n\n    var animation2 = new DoubleAnimation(0, TimeSpan.FromSeconds(0.2));\n    animation2.Completed += Animation2_Completed;\n    LongOperationView.BeginAnimation(OpacityProperty, animation2, HandoffBehavior.SnapshotAndReplace);\n    CompleteGraphLoadTask(task);\n  }\n\n  public void RemoveHighlighting(IRElement element) {\n    var node = GraphViewer.FindElementNode(element);\n\n    if (node != null) {\n      GraphViewer.ResetMarkedNode(node, element);\n    }\n  }\n\n  public void RemoveAllHighlighting(HighlighingType type) {\n    GraphViewer.ResetHighlightedNodes(type);\n  }\n\n  private void SetupEvents() {\n    GraphViewer.BlockSelected += GraphViewer_BlockSelected;\n    PreviewMouseWheel += GraphPanel_PreviewMouseWheel;\n    PreviewMouseLeftButtonDown += GraphPanel_PreviewMouseLeftButtonDown;\n    PreviewMouseRightButtonDown += GraphPanel_PreviewMouseRightButtonDown;\n    MouseLeftButtonDown += GraphPanel_MouseLeftButtonDown;\n    MouseLeftButtonUp += GraphPanel_MouseLeftButtonUp;\n    MouseMove += GraphPanel_MouseMove;\n    MouseLeave += GraphPanel_MouseLeave;\n    PreviewKeyDown += GraphPanel_PreviewKeyDown;\n    GraphHost.ScrollChanged += GraphHost_ScrollChanged;\n\n    var hover = new MouseHoverLogic(this);\n    hover.MouseHover += Hover_MouseHover;\n    hover.MouseHoverStopped += Hover_MouseHoverStopped;\n  }\n\n  private void GraphPanel_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    var position = e.GetPosition(GraphViewer);\n    hoveredNode_ = GraphViewer.FindPointedNode(position);\n\n    if (hoveredNode_ != null) {\n      // Select A/B nodes in the query panel.\n      if (Keyboard.IsKeyDown(Key.A) ||\n          Keyboard.IsKeyDown(Key.NumPad1) ||\n          Keyboard.IsKeyDown(Key.D1)) {\n        SelectQueryBlock1Executed(this, null);\n        e.Handled = true;\n        return;\n      }\n\n      if (Keyboard.IsKeyDown(Key.B) ||\n          Keyboard.IsKeyDown(Key.NumPad2) ||\n          Keyboard.IsKeyDown(Key.D2)) {\n        SelectQueryBlock2Executed(this, null);\n        e.Handled = true;\n        return;\n      }\n\n      Focus();\n    }\n    else {\n      GraphViewer.ResetHighlightedNodes(HighlighingType.Selected);\n      GraphViewer.ResetHighlightedNodes(HighlighingType.Hovered);\n    }\n  }\n\n  private void GraphPanel_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e) {\n    hoveredNode_ = GraphViewer.FindPointedNode(e.GetPosition(GraphViewer));\n\n    if (hoveredNode_ != null) {\n      Focus();\n    }\n  }\n\n  private void FitGraphIntoView() {\n    var viewBounds = GetGraphBounds();\n\n    if (Math.Abs(viewBounds.Width) < double.Epsilon || Math.Abs(viewBounds.Height) < double.Epsilon) {\n      // Panel is not visible, set the graph size when it becomes visible.\n      delayFitSize_ = true;\n    }\n    else if (!restoredState_) {\n      GraphViewer.FitWidthToSize(viewBounds);\n      delayFitSize_ = false;\n    }\n  }\n\n  private Size GetGraphBounds() {\n    return new Size(Math.Max(0, RenderSize.Width - SystemParameters.VerticalScrollBarWidth),\n                    RenderSize.Height);\n  }\n\n  private async Task<CancelableTask> CreateGraphLoadTask() {\n    return await loadTask_.CancelCurrentAndCreateTaskAsync();\n  }\n\n  private void CompleteGraphLoadTask(CancelableTask task) {\n    loadTask_.CompleteTask();\n  }\n\n  private void AddCommand(RoutedCommand command, ExecutedRoutedEventHandler handler) {\n    var binding = new CommandBinding(command);\n    binding.Executed += handler;\n    CommandBindings.Add(binding);\n  }\n\n  private void AdjustZoom(double value) {\n    if (Utils.IsShiftModifierActive()) {\n      value *= FastZoomFactor;\n    }\n\n    SetZoom(GraphViewer.ZoomLevel + value);\n  }\n\n  private void Animation2_Completed(object sender, EventArgs e) {\n    LongOperationView.Visibility = Visibility.Collapsed;\n  }\n\n  private Size AvailableGraphSize() {\n    return new Size(GraphHost.RenderSize.Width -\n                    SystemParameters.VerticalScrollBarWidth -\n                    SystemParameters.BorderWidth * 2, GraphHost.RenderSize.Height);\n  }\n\n  private void Button_MouseDown(object sender, MouseButtonEventArgs e) {\n    AdjustZoom(-ZoomAdjustment);\n  }\n\n  private void Button_MouseDown_1(object sender, MouseButtonEventArgs e) {\n    AdjustZoom(ZoomAdjustment);\n  }\n\n  private void ClearAllMarkedExecuted(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.ResetAllMarkedNodes();\n  }\n\n  private void ClearMarkedExecuted(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.ResetSelectedNode();\n  }\n\n  private void ExecuteGraphFitAll(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.FitToSize(AvailableGraphSize());\n  }\n\n  private void ExecuteGraphFitWidth(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.FitWidthToSize(AvailableGraphSize());\n  }\n\n  private void ExecuteGraphResetWidth(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.ZoomLevel = 1;\n  }\n\n  private void ExecuteGraphZoomIn(object sender, ExecutedRoutedEventArgs e) {\n    AdjustZoom(ZoomAdjustment);\n  }\n\n  private void ExecuteGraphZoomOut(object sender, ExecutedRoutedEventArgs e) {\n    AdjustZoom(-ZoomAdjustment);\n  }\n\n  private double GetPanOffset() {\n    return Utils.IsKeyboardModifierActive() ? FastPanOffset : PanOffset;\n  }\n\n  private HighlightingStyle GetSelectedColorStyle(ExecutedRoutedEventArgs e) {\n    return Utils.GetSelectedColorStyle(e.Parameter as SelectedColorEventArgs, GraphViewer.DefaultBoldPen);\n  }\n\n  private void GraphHost_ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    HidePreviewPopup();\n  }\n\n  private void GraphPanel_MouseLeave(object sender, MouseEventArgs e) {\n    HidePreviewPopupDelayed();\n  }\n\n  private void GraphPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    // Start dragging the graph only if the click starts inside the scroll area,\n    // excluding the scroll bars, and it in an empty spot.\n    var point = e.GetPosition(GraphHost);\n    Focus();\n\n    if (point.X < 0 ||\n        point.Y < 0 ||\n        point.X >= GraphHost.ViewportWidth ||\n        point.Y >= GraphHost.ViewportHeight) {\n      return;\n    }\n\n    //? TODO: Also don't handle if over query panel\n    var pointedNode = GraphViewer.FindPointedNode(e.GetPosition(GraphViewer));\n\n    if (pointedNode != null) {\n      return;\n    }\n\n    StartMouseDragging(e);\n    e.Handled = true;\n  }\n\n  private void StartMouseDragging(MouseButtonEventArgs e) {\n    HidePreviewPopup();\n    dragging_ = true;\n    draggingStart_ = e.GetPosition(GraphHost);\n    draggingViewStart_ = new Point(GraphHost.HorizontalOffset, GraphHost.VerticalOffset);\n    Cursor = Cursors.SizeAll;\n    CaptureMouse();\n  }\n\n  private void GraphPanel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) {\n    if (dragging_) {\n      dragging_ = false;\n      Cursor = Cursors.Arrow;\n      ReleaseMouseCapture();\n      e.Handled = true;\n    }\n  }\n\n  private void GraphPanel_MouseMove(object sender, MouseEventArgs e) {\n    if (dragging_) {\n      var offset = draggingViewStart_ - (e.GetPosition(GraphHost) - draggingStart_);\n      GraphHost.ScrollToHorizontalOffset(offset.X);\n      GraphHost.ScrollToVerticalOffset(offset.Y);\n      e.Handled = true;\n    }\n  }\n\n  private void GraphPanel_PreviewKeyDown(object sender, KeyEventArgs e) {\n    double offsetX = GraphHost.HorizontalOffset;\n    double offsetY = GraphHost.VerticalOffset;\n\n    switch (e.Key) {\n      case Key.Right: {\n        offsetX += GetPanOffset();\n        e.Handled = true;\n        break;\n      }\n      case Key.Left: {\n        offsetX -= GetPanOffset();\n        e.Handled = true;\n        break;\n      }\n      case Key.Up: {\n        offsetY -= GetPanOffset();\n        e.Handled = true;\n        break;\n      }\n      case Key.Down: {\n        offsetY += GetPanOffset();\n        e.Handled = true;\n        break;\n      }\n      case Key.OemPlus:\n      case Key.Add: {\n        if (Utils.IsControlModifierActive()) {\n          AdjustZoom(ZoomAdjustment);\n          e.Handled = true;\n        }\n\n        return;\n      }\n      case Key.OemMinus:\n      case Key.Subtract: {\n        if (Utils.IsControlModifierActive()) {\n          e.Handled = true;\n          AdjustZoom(-ZoomAdjustment);\n        }\n\n        return;\n      }\n    }\n\n    if (e.Handled) {\n      HidePreviewPopup();\n      GraphHost.ScrollToHorizontalOffset(offsetX);\n      GraphHost.ScrollToVerticalOffset(offsetY);\n    }\n  }\n\n  private void GraphPanel_PreviewMouseWheel(object sender, MouseWheelEventArgs e) {\n    if (!Utils.IsKeyboardModifierActive()) {\n      return;\n    }\n\n    SetZoom(GraphViewer.ZoomLevel * Math.Abs(1 + e.Delta / 1000.0));\n    e.Handled = true;\n  }\n\n  private void GraphViewer_BlockSelected(object sender, IRElementEventArgs e) {\n    ignoreNextHover_ = true;\n  }\n\n  private void HidePreviewPopup(bool force = false) {\n    if (previewPopup_ != null && (force || !previewPopup_.IsMouseOver)) {\n      previewPopup_.ClosePopup();\n      previewPopup_ = null;\n    }\n  }\n\n  private async void Hover_MouseHover(object sender, MouseEventArgs e) {\n    if (!Settings.ShowPreviewPopup ||\n        Settings.ShowPreviewPopupWithModifier && !Utils.IsKeyboardModifierActive()) {\n      return;\n    }\n\n    if (ignoreNextHover_) {\n      // Don't show the block preview if the user jumped to it.\n      ignoreNextHover_ = false;\n      return;\n    }\n\n    var node = GraphViewer.FindPointedNode(e.GetPosition(GraphViewer));\n\n    if (node?.NodeInfo.ElementData != null) {\n      await ShowPreviewPopup(node);\n      hoveredNode_ = node;\n    }\n  }\n\n  private void Hover_MouseHoverStopped(object sender, MouseEventArgs e) {\n    HidePreviewPopupDelayed();\n  }\n\n  private void HidePreviewPopupDelayed() {\n    removeHoveredAction_ = DelayedAction.StartNew(() => {\n      if (removeHoveredAction_ != null) {\n        removeHoveredAction_ = null;\n        HidePreviewPopup();\n      }\n    });\n\n    ignoreNextHover_ = false;\n  }\n\n  private void MarkBlockExecuted(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.MarkSelectedNode(GetSelectedColorStyle(e));\n  }\n\n  private void MarkGroupExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var style = GetSelectedColorStyle(e);\n    GraphViewer.MarkSelectedNode(style);\n    GraphViewer.MarkSelectedNodeSuccessors(style);\n    GraphViewer.MarkSelectedNodePredecessors(style);\n  }\n\n  private void MarkLoopExecuted(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.MarkSelectedNodeLoop(GetSelectedColorStyle(e));\n  }\n\n  private void MarkLoopNestExecuted(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.MarkSelectedNodeLoopNest(GetSelectedColorStyle(e));\n  }\n\n  private void MarkPredecessorsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.MarkSelectedNodePredecessors(GetSelectedColorStyle(e));\n  }\n\n  private void MarkSuccessorsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    GraphViewer.MarkSelectedNodeSuccessors(GetSelectedColorStyle(e));\n  }\n\n  private async void MarkDominatorsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await GraphViewer.MarkSelectedNodeDominatorsAsync(GetSelectedColorStyle(e)).ConfigureAwait(true);\n  }\n\n  private async void MarkPostDominatorsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await GraphViewer.MarkSelectedNodePostDominatorsAsync(GetSelectedColorStyle(e)).ConfigureAwait(true);\n  }\n\n  private async void MarkDominanceFrontierExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await GraphViewer.MarkSelectedNodeDominanceFrontierAsync(GetSelectedColorStyle(e)).ConfigureAwait(true);\n  }\n\n  private async void MarkPostDominanceFrontierExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await GraphViewer.MarkSelectedNodePostDominanceFrontierAsync(GetSelectedColorStyle(e)).ConfigureAwait(true);\n  }\n\n  private void SelectQueryBlock1Executed(object sender, ExecutedRoutedEventArgs e) {\n    if (hoveredNode_ != null) {\n      if (hoveredNode_.NodeInfo.ElementData is BlockIR block) {\n        SetQueryBlock1(block);\n      }\n    }\n  }\n\n  private void SelectQueryBlock2Executed(object sender, ExecutedRoutedEventArgs e) {\n    if (hoveredNode_ != null) {\n      if (hoveredNode_.NodeInfo.ElementData is BlockIR block) {\n        SetQueryBlock2(block);\n      }\n    }\n  }\n\n  private async void SwapQueryBlocksExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!queryPanelVisible_) {\n      return;\n    }\n\n    queryInfo_.SwapBlocks();\n    await UpdateQueryResult();\n  }\n\n  private void CloseQueryPanelExecuted(object sender, ExecutedRoutedEventArgs e) {\n    HideQueryPanel();\n  }\n\n  private async void ShowReachablePathExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (queryPanelVisible_ && queryInfo_.Reaches) {\n      var cache = FunctionAnalysisCache.Get(Document.Function);\n\n      var pathBlocks =\n        (await cache.GetReachabilityAsync()).FindPath(queryInfo_.Block1, queryInfo_.Block2);\n\n      foreach (var block in pathBlocks) {\n        GraphViewer.Mark(block, Colors.Gold);\n      }\n    }\n  }\n\n  private void PanelToolbarTray_DuplicateClicked(object sender, DuplicateEventArgs e) {\n    Session.DuplicatePanel(this, e.Kind);\n  }\n\n  private void PanelToolbarTray_PinnedChanged(object sender, PinEventArgs e) {\n    HasPinnedContent = e.IsPinned;\n  }\n\n  private void PanelToolbarTray_SettingsClicked(object sender, EventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  private async void SetQueryBlock1(BlockIR block) {\n    ShowQueryPanel();\n\n    if (queryInfo_.Block1 != block) {\n      queryInfo_.Block1 = block;\n      queryInfo_.Block1Name = Utils.MakeBlockDescription(block);\n      await UpdateQueryResult();\n    }\n  }\n\n  private async void SetQueryBlock2(BlockIR block) {\n    ShowQueryPanel();\n\n    if (queryInfo_.Block2 != block) {\n      queryInfo_.Block2 = block;\n      queryInfo_.Block2Name = Utils.MakeBlockDescription(block);\n      await UpdateQueryResult();\n    }\n  }\n\n  private async Task UpdateQueryResult() {\n    QueryPanel.DataContext = null;\n\n    if (queryInfo_.Block1 != null && queryInfo_.Block2 != null) {\n      var cache = FunctionAnalysisCache.Get(Document.Function);\n      await cache.CacheAll();\n\n      queryInfo_.Dominates =\n        (await cache.GetDominatorsAsync()).Dominates(queryInfo_.Block1, queryInfo_.Block2);\n\n      queryInfo_.PostDominates =\n        (await cache.GetPostDominatorsAsync()).Dominates(queryInfo_.Block1, queryInfo_.Block2);\n\n      queryInfo_.Reaches =\n        (await cache.GetReachabilityAsync()).Reaches(queryInfo_.Block1, queryInfo_.Block2);\n    }\n\n    QueryPanel.DataContext = queryInfo_;\n  }\n\n  private void ShowQueryPanel() {\n    if (queryPanelVisible_) {\n      return;\n    }\n\n    queryInfo_ = new GraphQueryInfo();\n    QueryPanel.DataContext = queryInfo_;\n    QueryPanel.Visibility = Visibility.Visible;\n    queryPanelVisible_ = true;\n  }\n\n  private void HideQueryPanel() {\n    if (!queryPanelVisible_) {\n      return;\n    }\n\n    QueryPanel.DataContext = null;\n    QueryPanel.Visibility = Visibility.Collapsed;\n    queryPanelVisible_ = false;\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    if (PanelKind == ToolPanelKind.ExpressionGraph) {\n      optionsPanelPopup_ = OptionsPanelHostPopup.Create<ExpressionGraphOptionsPanel, ExpressionGraphSettings>(\n        Settings.Clone(), GraphHost, Session,\n        async (newSettings, commit) => {\n          if (!newSettings.Equals(Settings)) {\n            App.Settings.ExpressionGraphSettings = newSettings;\n            ReloadSettings();\n\n            if (commit) {\n              App.SaveApplicationSettings();\n            }\n          }\n\n          return newSettings.Clone();\n        },\n        () => optionsPanelPopup_ = null);\n    }\n    else {\n      optionsPanelPopup_ = OptionsPanelHostPopup.Create<FlowGraphOptionsPanel, FlowGraphSettings>(\n        Settings.Clone(), GraphHost, Session,\n        async (newSettings, commit) => {\n          if (!newSettings.Equals(Settings)) {\n            App.Settings.FlowGraphSettings = newSettings;\n            ReloadSettings();\n\n            if (commit) {\n              App.SaveApplicationSettings();\n            }\n          }\n\n          return newSettings.Clone();\n        },\n        () => optionsPanelPopup_ = null);\n    }\n  }\n\n  private void SetupCommands() {\n    AddCommand(GraphCommand.MarkBlock, MarkBlockExecuted);\n    AddCommand(GraphCommand.MarkPredecessors, MarkPredecessorsExecuted);\n    AddCommand(GraphCommand.MarkSuccessors, MarkSuccessorsExecuted);\n    AddCommand(GraphCommand.MarkDominators, MarkDominatorsExecuted);\n    AddCommand(GraphCommand.MarkPostDominators, MarkPostDominatorsExecuted);\n    AddCommand(GraphCommand.MarkDominanceFrontier, MarkDominanceFrontierExecuted);\n    AddCommand(GraphCommand.MarkPostDominanceFrontier, MarkPostDominanceFrontierExecuted);\n    AddCommand(GraphCommand.MarkGroup, MarkGroupExecuted);\n    AddCommand(GraphCommand.MarkLoop, MarkLoopExecuted);\n    AddCommand(GraphCommand.MarkLoopNest, MarkLoopNestExecuted);\n    AddCommand(GraphCommand.ClearMarked, ClearMarkedExecuted);\n    AddCommand(GraphCommand.ClearAllMarked, ClearAllMarkedExecuted);\n    AddCommand(GraphCommand.SelectQueryBlock1, SelectQueryBlock1Executed);\n    AddCommand(GraphCommand.SelectQueryBlock2, SelectQueryBlock2Executed);\n    AddCommand(GraphCommand.SwapQueryBlocks, SwapQueryBlocksExecuted);\n    AddCommand(GraphCommand.CloseQueryPanel, CloseQueryPanelExecuted);\n    AddCommand(GraphCommand.ShowReachablePath, ShowReachablePathExecuted);\n  }\n\n  private void SetZoom(double value) {\n    double currentZoom = GraphViewer.ZoomLevel;\n    double centerX = GraphHost.ViewportWidth / 2;\n    double centerY = GraphHost.ViewportHeight / 2;\n    double offsetX = (GraphHost.HorizontalOffset + centerX) / currentZoom;\n    double offsetY = (GraphHost.VerticalOffset + centerY) / currentZoom;\n    double zoom = value;\n    zoom = Math.Min(Math.Max(MinZoomLevel, zoom), MaxZoomLevel);\n    GraphViewer.ZoomLevel = zoom;\n    UpdateLayout();\n    GraphHost.ScrollToHorizontalOffset(offsetX * zoom - centerX);\n    GraphHost.ScrollToVerticalOffset(offsetY * zoom - centerY);\n  }\n\n  private async Task ShowPreviewPopup(GraphNode node) {\n    if (previewPopup_ != null) {\n      if (hoveredNode_ == node) {\n        return;\n      }\n\n      HidePreviewPopup();\n    }\n\n    if (node == null) {\n      return;\n    }\n\n    if (removeHoveredAction_ != null) {\n      removeHoveredAction_.Cancel();\n      removeHoveredAction_ = null;\n    }\n\n    var position = Mouse.GetPosition(GraphHost).AdjustForMouseCursor();\n    previewPopup_ = await IRDocumentPopup.CreateNew(Document, node.NodeInfo.ElementData, position,\n                                                    GraphHost,\n                                                    App.Settings.\n                                                      GetElementPreviewPopupSettings(ToolPanelKind.FlowGraph),\n                                                    \"Block \");\n    previewPopup_.PopupDetached += Popup_PopupDetached;\n    previewPopup_.ShowPopup();\n  }\n\n  private void Popup_PopupDetached(object sender, EventArgs e) {\n    var popup = (IRDocumentPopup)sender;\n\n    if (popup == previewPopup_) {\n      previewPopup_ = null; // Prevent automatic closing.\n    }\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async void CancelButton_Click(object sender, RoutedEventArgs e) {\n    await loadTask_.CancelTaskAndWaitAsync();\n  }\n\n  private void QueryPanel_MouseEnter(object sender, MouseEventArgs e) {\n    var animation = new DoubleAnimation(1, TimeSpan.FromSeconds(0.1));\n    QueryPanel.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n  }\n\n  private void QueryPanel_MouseLeave(object sender, MouseEventArgs e) {\n    var animation = new DoubleAnimation(0.5, TimeSpan.FromSeconds(0.3));\n    QueryPanel.BeginAnimation(OpacityProperty, animation, HandoffBehavior.SnapshotAndReplace);\n  }\n\n  private void PanelToolbarTray_BindMenuItemSelected(object sender, BindMenuItem e) {\n    Session.BindToDocument(this, e);\n  }\n\n  private void PanelToolbarTray_BindMenuOpen(object sender, BindMenuItemsArgs e) {\n    Session.PopulateBindMenu(this, e);\n  }\n\n  public override void OnRegisterPanel() {\n    IsPanelEnabled = false;\n    ReloadSettings();\n  }\n\n  public override void OnRedrawPanel() {\n    GraphViewer.RedrawCurrentGraph();\n  }\n\n  public override async Task OnReloadSettings() {\n    ReloadSettings();\n  }\n\n  private void ReloadSettings() {\n    GraphViewer.Settings = Settings;\n    GraphHost.Background = ColorBrushes.GetBrush(Settings.BackgroundColor);\n  }\n\n  public override async Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    var previousSection = Document?.Section;\n    InitializeFromDocument(document);\n\n    if (document.DuringSectionLoading) {\n#if DEBUG\n      Trace.TraceInformation(\n        $\"Graph panel {ObjectTracker.Track(this)}: Ignore graph reload during section switch\");\n#endif\n\n      delayRestoreState_ = !restoredState_;\n      return;\n    }\n\n    //? TODO: Implement switching for expressions\n    if (PanelKind == ToolPanelKind.ExpressionGraph ||\n        PanelKind == ToolPanelKind.CallGraph) {\n      HideGraph();\n      return;\n    }\n\n    if (section != null && section != previousSection) {\n      // User switched between two sections, reload the proper graph.\n      delayRestoreState_ = !delayRestoreState_;\n      await Session.SwitchGraphsAsync(this, section, document);\n      return;\n    }\n\n    if (!restoredState_) {\n      delayRestoreState_ = true;\n    }\n    else {\n      Dispatcher.BeginInvoke(() => LoadSavedState(), DispatcherPriority.Render);\n    }\n  }\n\n  public override void OnSessionStart() {\n    base.OnSessionStart();\n    loadTask_ = new CancelableTaskInstance(false, Session.SessionState.RegisterCancelableTask,\n                                           Session.SessionState.UnregisterCancelableTask);\n  }\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    HideGraph();\n  }\n\n  private void LoadSavedState() {\n    //? TODO: This can happen for the expression graph, which does not support switching.\n    if (Document == null) {\n      return;\n    }\n\n    byte[] data = Session.LoadPanelState(this, Document.Section) as byte[];\n    var state = UIStateSerializer.Deserialize<GraphPanelState>(data, Document.Function);\n\n    if (state != null) {\n      SetZoom(state.ZoomLevel);\n      GraphHost.ScrollToHorizontalOffset(state.HorizontalOffset);\n      GraphHost.ScrollToVerticalOffset(state.VerticalOffset);\n      restoredState_ = true;\n    }\n    else {\n      GraphHost.ScrollToHorizontalOffset(0);\n      GraphHost.ScrollToVerticalOffset(0);\n      restoredState_ = false;\n    }\n\n    delayRestoreState_ = false;\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    if (Section != section) {\n      return;\n    }\n\n    HidePreviewPopup(true);\n    HideQueryPanel();\n    DisablePanel();\n    restoredState_ = false;\n\n    var state = new GraphPanelState();\n    state.ZoomLevel = GraphViewer.ZoomLevel;\n    state.HorizontalOffset = GraphHost.HorizontalOffset;\n    state.VerticalOffset = GraphHost.VerticalOffset;\n    byte[] data = UIStateSerializer.Serialize(state, document.Function);\n    Session.SavePanelState(data, this, section);\n\n    // Clear references to IR objects that would keep the previous function alive.\n#if DEBUG\n    Trace.TraceInformation($\"Graph panel {ObjectTracker.Track(this)}: unloaded doc {ObjectTracker.Track(Document)}\");\n#endif\n\n    Document = null;\n    graph_ = null;\n    hoveredNode_ = null;\n  }\n\n  private void EnablePanel() {\n    IsPanelEnabled = true;\n    Utils.EnableControl(GraphHost);\n    Utils.EnableControl(ToolbarHost);\n  }\n\n  private void DisablePanel() {\n    Utils.DisableControl(ToolbarHost);\n    Utils.DisableControl(GraphHost, 0.5);\n    IsPanelEnabled = false;\n  }\n\n  public override void OnElementSelected(IRElementEventArgs e) {\n    if (!Settings.SyncSelectedNodes) {\n      return;\n    }\n\n    if (e.Element is BlockIR block) {\n      SelectedElement = block;\n    }\n  }\n\n  public override void OnElementHighlighted(IRHighlightingEventArgs e) {\n    if (!Settings.SyncSelectedNodes) {\n      return;\n    }\n\n    if (e.Action == HighlightingEventAction.ReplaceHighlighting ||\n        e.Action == HighlightingEventAction.AppendHighlighting) {\n      Highlight(e);\n    }\n    else if (e.Action == HighlightingEventAction.RemoveHighlighting) {\n      if (e.Element != null) {\n        RemoveHighlighting(e.Element);\n      }\n      else {\n        RemoveAllHighlighting(e.Type);\n      }\n    }\n  }\n\n  public override void OnActivatePanel() {\n    if (delayFitSize_ && GraphViewer.IsGraphLoaded) {\n      FitGraphIntoView();\n    }\n  }\n\n  public override async void ClonePanel(IToolPanel sourcePanel) {\n    var sourceGraphPanel = sourcePanel as GraphPanel;\n    InitializeFromDocument(sourceGraphPanel.Document);\n\n    // Rebuild the graph, otherwise the visual nodes\n    // point to the same instance.\n    var newGraph = await Session.ComputeGraphAsync(sourceGraphPanel.graph_.Kind,\n                                                   Section, Document);\n    DisplayGraph(newGraph);\n  }\n\n  private class BlockTooltipInfo {\n    public BlockTooltipInfo(BlockIR block) {\n      PredecessorCount = block.Predecessors.Count;\n      SuccessorCount = block.Successors.Count;\n      var loopTag = block.GetTag<LoopBlockTag>();\n\n      if (loopTag != null) {\n        InLoop = true;\n        LoopNesting = loopTag.NestingLevel;\n        LoopBlocks = loopTag.Loop.Blocks.Count;\n        NestedLoops = loopTag.Loop.NestedLoops.Count;\n      }\n    }\n\n    public bool InLoop { get; set; }\n    public int LoopBlocks { get; set; }\n    public int LoopNesting { get; set; }\n    public int NestedLoops { get; set; }\n    public int PredecessorCount { get; set; }\n    public int SuccessorCount { get; set; }\n  }\n\n  private async void PanelToolbarTray_OnHelpClicked(object sender, EventArgs e) {\n    await HelpPanel.DisplayPanelHelp(PanelKind, Session);\n  }\n}\n\nclass GraphQueryInfo {\n  public BlockIR Block1 { get; set; }\n  public BlockIR Block2 { get; set; }\n  public string Block1Name { get; set; }\n  public string Block2Name { get; set; }\n  public bool Dominates { get; set; }\n  public bool PostDominates { get; set; }\n  public bool Reaches { get; set; }\n  public bool ControlDependent { get; set; }\n  public bool OnDomFrontier { get; set; }\n\n  public void SwapBlocks() {\n    var tempBlock = Block1;\n    string tempBlockName = Block1Name;\n    Block1 = Block2;\n    Block1Name = Block2Name;\n    Block2 = tempBlock;\n    Block2Name = tempBlockName;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/HelpPanel.xaml",
    "content": "﻿<ProfileExplorerUi:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.Panels.HelpPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Panels\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:wpf=\"clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <Grid x:Name=\"BrowserHost\">\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <DockPanel\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <ToolBarTray\n        x:Name=\"Toolbar\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <Button\n            Width=\"20\"\n            VerticalAlignment=\"Center\"\n            Click=\"BackButton_Click\"\n            IsEnabled=\"{Binding CanGoBack, ElementName=Browser}\"\n            ToolTip=\"Home\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource DockLeftIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"/>\n          </Button>\n          <Button\n            Click=\"HomeButton_Click\"\n            ToolTip=\"Home\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource DetailsIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"/>\n          </Button>\n          <TextBlock\n            Margin=\"2,0,4,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"Topic\" />\n\n          <Grid>\n            <TextBox\n              x:Name=\"TopicTextBox\"\n              Width=\"200\"\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              Cursor=\"Arrow\"\n              Focusable=\"False\"\n              IsReadOnly=\"True\"\n              PreviewMouseDown=\"TopicsTextbox_PreviewMouseDown\" />\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Margin=\"0,1,5,0\"\n              HorizontalAlignment=\"Right\"\n              IsHitTestVisible=\"False\"\n              Source=\"{StaticResource DownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"/>\n          </Grid>\n          <Button\n            Margin=\"2,0,0,0\"\n            Click=\"ZoomOutButton_Click\"\n            ToolTip=\"Zoom Out (Ctrl+_\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ZoomOutIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"/>\n          </Button>\n          <Button\n            Click=\"ZoomInButton_Click\"\n            ToolTip=\"Zoom In (Ctrl+=)\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ZoomInIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"/>\n          </Button>\n          <Separator />\n          <Button\n            Click=\"ExternalButton_Click\"\n            ToolTip=\"Open documentation page in external browser\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource OpenExternalIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"/>\n          </Button>\n        </ToolBar>\n      </ToolBarTray>\n    </DockPanel>\n    <Popup\n      x:Name=\"TopicsTreePopup\"\n      AllowsTransparency=\"True\"\n      IsOpen=\"False\">\n      <TreeView\n        x:Name=\"TopicsTree\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n        MouseLeftButtonUp=\"TopicsTextbox_MouseLeftButtonUp\"\n        SelectedItemChanged=\"TopicsTree_SelectedItemChanged\">\n        <TreeView.ItemContainerStyle>\n          <Style TargetType=\"{x:Type TreeViewItem}\">\n            <Setter Property=\"IsExpanded\" Value=\"True\" />\n          </Style>\n        </TreeView.ItemContainerStyle>\n        <TreeView.Resources>\n          <HierarchicalDataTemplate\n            DataType=\"{x:Type local:HelpTopic}\"\n            ItemsSource=\"{Binding SubTopics}\">\n            <TextBlock Text=\"{Binding Path=Title}\" />\n          </HierarchicalDataTemplate>\n        </TreeView.Resources>\n      </TreeView>\n    </Popup>\n    <wpf:WebView2\n      x:Name=\"Browser\"\n      Grid.Row=\"1\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      CoreWebView2InitializationCompleted=\"Browser_CoreWebView2InitializationCompleted\"\n      DockPanel.Dock=\"Bottom\" />\n  </Grid>\n</ProfileExplorerUi:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/HelpPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Net.Http;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing Microsoft.Web.WebView2.Core;\n\nnamespace ProfileExplorer.UI.Panels;\n\npublic class HelpTopic {\n  public string Title { get; set; }\n  public string URL { get; set; }\n  public List<HelpTopic> SubTopics { get; set; }\n}\n\npublic class HelpIndex {\n  public HelpIndex() {\n    Topics = new List<HelpTopic>();\n    PanelTopics = new Dictionary<ToolPanelKind, HelpTopic>();\n  }\n\n  public List<HelpTopic> Topics { get; set; }\n  public Dictionary<ToolPanelKind, HelpTopic> PanelTopics { get; set; }\n  public HelpTopic HomeTopic { get; set; }\n\n  public static HelpIndex DeserializeFromFile(string filePath) {\n    if (UIJsonUtils.DeserializeFromFile(filePath, out HelpIndex index)) {\n      return index;\n    }\n\n    return new HelpIndex();\n  }\n\n  public static HelpIndex Deserialize(string text) {\n    if (UIJsonUtils.Deserialize(text, out HelpIndex index)) {\n      return index;\n    }\n\n    return new HelpIndex();\n  }\n}\n\npublic partial class HelpPanel : ToolPanelControl {\n  private HelpIndex helpIndex_;\n  private HelpTopic currentTopic_;\n  private SemaphoreSlim loadingTopic_;\n  private bool browserInitialized_;\n  private Window videoWindow_;\n  private Window previewWindow_;\n  private string previewUrl_;\n\n  public HelpPanel() {\n    loadingTopic_ = new SemaphoreSlim(1);\n    InitializeComponent();\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Help;\n\n  public override async void OnActivatePanel() {\n    await Initialize();\n  }\n\n  public override async void OnShowPanel() {\n    await Initialize();\n  }\n\n  private async Task Initialize() {\n    base.OnActivatePanel();\n    await loadingTopic_.WaitAsync();\n\n    if (currentTopic_ == null) {\n      await LoadHomeTopic();\n    }\n\n    loadingTopic_.Release();\n  }\n\n  private async Task<bool> DownloadHelpIndex() {\n    // Download index file from web location.\n    if (helpIndex_ != null) {\n      return true;\n    }\n\n    try {\n      using var client = new HttpClient();\n      using var response = await client.GetAsync(App.GetHelpIndexFilePath());\n\n      if (response.IsSuccessStatusCode) {\n        string contents = await response.Content.ReadAsStringAsync();\n        helpIndex_ = HelpIndex.Deserialize(contents);\n\n        if (helpIndex_ != null) {\n          TopicsTree.ItemsSource = helpIndex_.Topics;\n        }\n      }\n      else {\n        Trace.WriteLine($\"Failed to download file: {response.ReasonPhrase}\");\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to download file: {ex.Message}\");\n    }\n\n    return helpIndex_ != null;\n  }\n\n  public async Task LoadHomeTopic() {\n    if (await DownloadHelpIndex()) {\n      await NavigateToTopic(helpIndex_.HomeTopic);\n    }\n  }\n\n  public async Task LoadPanelHelp(ToolPanelKind kind) {\n    if (await DownloadHelpIndex()) {\n      if (helpIndex_.PanelTopics.TryGetValue(kind, out var topic)) {\n        await NavigateToTopic(topic);\n      }\n    }\n  }\n\n  public static async Task DisplayPanelHelp(ToolPanelKind kind, IUISession session) {\n    if (await session.ShowPanel(ToolPanelKind.Help) is HelpPanel panel) {\n      await panel.LoadPanelHelp(kind);\n    }\n  }\n\n  private async Task NavigateToTopic(HelpTopic topic) {\n    if (topic != null && !string.IsNullOrEmpty(topic.URL)) {\n      TopicTextBox.Text = topic.Title;\n      currentTopic_ = topic;\n      await NavigateToURL(App.GetHelpFilePath(topic.URL));\n    }\n  }\n\n  private async Task InitializeBrowser() {\n    if (browserInitialized_) {\n      return;\n    }\n\n    // Place cache files in the settings directory.\n    browserInitialized_ = true;\n    var webView2Environment = await CoreWebView2Environment.CreateAsync(null, App.GetSettingsDirectoryPath());\n\n    try {\n      await Browser.EnsureCoreWebView2Async(webView2Environment);\n\n      if (Browser.CoreWebView2 == null) {\n        Trace.WriteLine(\"Failed to initialize WebView2 control in HelpPanel.\");\n        return;\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to initialize WebView2 control in HelpPanel: {ex.Message}\");\n      return;\n    }\n\n    // Handle a video/image entering full-screen mode\n    // by making a new maximized window to which the browser control\n    // is moved. When exiting full-screen mode, the browser is moved\n    // back to the panel and the window is closed.\n    Browser.CoreWebView2.ContainsFullScreenElementChanged += (sender, args) => {\n      if (Browser.CoreWebView2.ContainsFullScreenElement) {\n        videoWindow_ = new Window();\n        videoWindow_.WindowState = WindowState.Maximized;\n        videoWindow_.WindowStyle = WindowStyle.None;\n        videoWindow_.ResizeMode = ResizeMode.NoResize;\n        videoWindow_.ShowInTaskbar = false;\n        BrowserHost.Children.Remove(Browser);\n        videoWindow_.Content = Browser;\n        videoWindow_.Show();\n      }\n      else {\n        if (videoWindow_ != null) {\n          videoWindow_.Content = null;\n          videoWindow_.Close();\n          BrowserHost.Children.Add(Browser);\n        }\n      }\n    };\n\n    Browser.NavigationStarting += (sender, args) => {\n      // Update current topic when navigating to a new page.\n      foreach (var topic in helpIndex_.Topics) {\n        if (args.Uri.Contains(topic.URL.Replace('\\\\', '/'), StringComparison.OrdinalIgnoreCase)) {\n          TopicTextBox.Text = topic.Title;\n          currentTopic_ = topic;\n          break;\n        }\n      }\n    };\n\n    // Force light mode for the WebView2 control for now\n    // screenshots don't look good in dark mode.\n    Browser.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Light;\n    Browser.ZoomFactor = 0.9;\n  }\n\n  private async Task NavigateToURL(string url) {\n    await InitializeBrowser();\n\n    if (Browser.Source != null) {\n      Browser.Stop();\n    }\n\n    Browser.Source = new Uri(url);\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async void TopicsTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e) {\n    if (sender is TreeView treeView &&\n        treeView.SelectedItem is HelpTopic selectedTopic) {\n      await NavigateToTopic(selectedTopic);\n    }\n\n    TopicsTreePopup.IsOpen = false;\n  }\n\n  private void TopicsTextbox_PreviewMouseDown(object sender, MouseButtonEventArgs e) {\n    if (TopicsTreePopup.IsOpen) {\n      TopicsTreePopup.IsOpen = false;\n      return;\n    }\n\n    TopicsTreePopup.Placement = PlacementMode.Relative;\n    TopicsTreePopup.PlacementTarget = TopicTextBox;\n    TopicsTreePopup.VerticalOffset = TopicTextBox.ActualHeight;\n    TopicsTreePopup.Height = TopicsTree.Height;\n    TopicsTreePopup.Width = TopicTextBox.Width;\n    TopicsTreePopup.IsOpen = true;\n  }\n\n  private void TopicsTextbox_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) {\n    TopicsTreePopup.IsOpen = false;\n  }\n\n  private void Browser_CoreWebView2InitializationCompleted(object sender,\n                                                           CoreWebView2InitializationCompletedEventArgs e) {\n    if (Browser.CoreWebView2 == null) {\n      return;\n    }\n\n    Browser.CoreWebView2.NewWindowRequested += Browser_NewWindowRequested;\n  }\n\n  private void Browser_NewWindowRequested(object sender, CoreWebView2NewWindowRequestedEventArgs e) {\n    try {\n      if (e.Uri.EndsWith(\".png\", StringComparison.OrdinalIgnoreCase) ||\n          e.Uri.EndsWith(\".gif\", StringComparison.OrdinalIgnoreCase) ||\n          e.Uri.EndsWith(\".jpg\", StringComparison.OrdinalIgnoreCase) ||\n          e.Uri.EndsWith(\".jpeg\", StringComparison.OrdinalIgnoreCase)) {\n        if (previewWindow_ != null) {\n          // Second click on same image closes current preview.\n          bool showPreview = previewUrl_ != e.Uri;\n          CloseImagePreview();\n\n          if (!showPreview) {\n            e.Handled = true;\n            return;\n          }\n        }\n\n        // Try to parse out an initial popup size from the image name.\n        if (!TryExtractImageSize(e.Uri, out int width, out int height)) {\n          width = 800;\n          height = 600;\n        }\n\n        width = (int)Math.Min(width, SystemParameters.PrimaryScreenWidth - 50);\n        height = (int)Math.Min(height, SystemParameters.PrimaryScreenHeight - 50);\n        ShowImagePreview(e.Uri, width, height);\n      }\n      else {\n        // Open in new external browser window.\n        var psi = new ProcessStartInfo() {\n          FileName = e.Uri,\n          UseShellExecute = true\n        };\n        Process.Start(psi);\n      }\n\n      e.Handled = true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to start external browser: {ex.Message}\");\n    }\n  }\n\n  private void ShowImagePreview(string url, int width, int height) {\n    var window = new Window();\n    window.WindowStyle = WindowStyle.None;\n    window.WindowStartupLocation = WindowStartupLocation.CenterOwner;\n    window.ResizeMode = ResizeMode.CanResizeWithGrip;\n    var browser = new Image();\n    browser.Source = new BitmapImage(new Uri(url));\n    browser.HorizontalAlignment = HorizontalAlignment.Stretch;\n    browser.VerticalAlignment = VerticalAlignment.Stretch;\n    browser.Stretch = Stretch.Uniform;\n    window.Content = browser;\n    window.Width = width;\n    window.Height = height;\n    window.Owner = Application.Current.MainWindow;\n\n    window.PreviewMouseDown += (sender, args) => {\n      CloseImagePreview();\n    };\n\n    window.PreviewKeyDown += (sender, args) => {\n      switch (args.Key) {\n        case Key.Escape:\n        case Key.Space:\n        case Key.Back: {\n          CloseImagePreview();\n          break;\n        }\n      }\n    };\n\n    previewWindow_ = window;\n    previewUrl_ = url;\n    window.Show();\n  }\n\n  private void CloseImagePreview() {\n    if (previewWindow_ != null) {\n      previewWindow_.Close();\n      previewWindow_ = null;\n      previewUrl_ = null;\n    }\n  }\n\n  private bool TryExtractImageSize(string url, out int width, out int height) {\n    // Try parse file_widthxheight.extension, like file_800x600.gif.\n    width = height = 0;\n    int start = url.LastIndexOf('_');\n    int end = url.LastIndexOf('.');\n\n    if (start == -1 || end <= start) {\n      return false;\n    }\n\n    int middle = url.IndexOf('x', start);\n\n    if (middle == -1) {\n      return false;\n    }\n\n    return int.TryParse(url.Substring(start + 1, middle - start - 1), out width) &&\n           int.TryParse(url.Substring(middle + 1, end - middle - 1), out height);\n  }\n\n  private void ZoomInButton_Click(object sender, RoutedEventArgs e) {\n    Browser.ZoomFactor = Math.Min(4, Browser.ZoomFactor + 0.1);\n  }\n\n  private void ZoomOutButton_Click(object sender, RoutedEventArgs e) {\n    Browser.ZoomFactor = Math.Max(0.5, Browser.ZoomFactor - 0.1);\n  }\n\n  private async void HomeButton_Click(object sender, RoutedEventArgs e) {\n    await LoadHomeTopic();\n  }\n\n  private void BackButton_Click(object sender, RoutedEventArgs e) {\n    Browser.GoBack();\n  }\n\n  private async void ExternalButton_Click(object sender, RoutedEventArgs e) {\n    try {\n      string helpURL = null;\n\n      if (currentTopic_ != null) {\n        // Open current topic if loaded.\n        helpURL = App.GetHelpFilePath(currentTopic_.URL);\n      }\n      else if (await DownloadHelpIndex()) {\n        helpURL = App.GetHelpFilePath(helpIndex_.HomeTopic.URL);\n      }\n\n      if (!string.IsNullOrEmpty(helpURL)) {\n        var psi = new ProcessStartInfo() {\n          FileName = helpURL,\n          UseShellExecute = true\n        };\n        Process.Start(psi);\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to start external browser: {ex.Message}\");\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/IToolPanel.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic enum ToolPanelKind {\n  Section,\n  References,\n  Notes,\n  Definition,\n  Bookmarks,\n  Source,\n  FlowGraph,\n  DominatorTree,\n  PostDominatorTree,\n  ExpressionGraph,\n  CallGraph,\n  CallTree,\n  CallerCallee,\n  FlameGraph,\n  Timeline,\n  PassOutput,\n  SearchResults,\n  Remarks,\n  Scripting,\n  Developer,\n  Help,\n  Other\n}\n\n[Flags]\npublic enum HandledEventKind {\n  None,\n  ElementSelection,\n  ElementHighlighting\n}\n\npublic interface IToolPanel {\n  ToolPanelKind PanelKind { get; }\n  string TitlePrefix { get; }\n  string TitleSuffix { get; }\n  string TitleToolTip { get; }\n  HandledEventKind HandledEvents { get; }\n  bool SavesStateToFile { get; }\n  bool IsUnloaded { get; }\n  IUISession Session { get; set; }\n  IRDocument Document { get; set; }\n  IRDocument BoundDocument { get; set; }\n  bool IsPanelEnabled { get; set; }\n  bool HasCommandFocus { get; set; }\n  bool HasPinnedContent { get; set; }\n  bool IgnoreNextLoadEvent { get; set; }\n  bool IgnoreNextUnloadEvent { get; set; }\n  void OnRegisterPanel();\n  void OnUnregisterPanel();\n  void OnShowPanel();\n  void OnHidePanel();\n  void OnActivatePanel();\n  void OnDeactivatePanel();\n  void OnRedrawPanel();\n  void OnSessionStart();\n  void OnSessionEnd();\n  void OnSessionSave();\n  Task OnReloadSettings();\n  Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document);\n  Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document);\n  void OnElementSelected(IRElementEventArgs e);\n  void OnElementHighlighted(IRHighlightingEventArgs e);\n  void ClonePanel(IToolPanel basePanel);\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ModuleReport.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic class ValueStatistics {\n  public List<Tuple<IRTextFunction, long>> Values;\n  public double Average { get; set; }\n  public long Median { get; set; }\n  public long Min { get; set; }\n  public long Max { get; set; }\n  public int MaxDistributionFactor => (int)Math.Ceiling(Math.Log10(Max));\n\n  public override string ToString() {\n    return $\"Average: {Average}\\n\" +\n           $\"Median: {Median}\\n\" +\n           $\"Min: {Min}\\n\" +\n           $\"Max: {Max}\\n\";\n  }\n\n  public int GetGroupSize(int factor) {\n    return Math.Max(1, (int)Math.Pow(10, Math.Round(Math.Log10(Max)) - factor));\n  }\n\n  public List<DistributionRange> ComputeDistribution(int factor) {\n    var list = new List<DistributionRange>();\n    int groupSize = GetGroupSize(factor);\n    var range = new DistributionRange(0, 0, groupSize - 1);\n    int total = 0;\n\n    foreach (var value in Values) {\n      int rangeIndex = (int)(value.Item2 / groupSize);\n\n      if (rangeIndex != range.Index) {\n        list.Add(range);\n        range = new DistributionRange(rangeIndex, rangeIndex * groupSize, (rangeIndex + 1) * groupSize - 1);\n      }\n\n      range.Count++;\n      range.Values.Add(value);\n      total++;\n    }\n\n    if (range.Count > 0) {\n      list.Add(range);\n    }\n\n    foreach (var item in list) {\n      item.Percentage = (double)item.Count / total;\n    }\n\n    return list;\n  }\n\n  public class Generator {\n    private List<Tuple<IRTextFunction, long>> values_ = new();\n    private long total_;\n    private long min_ = long.MaxValue;\n    private long max_ = long.MinValue;\n\n    public void Add(long value, IRTextFunction func) {\n      values_.Add(new Tuple<IRTextFunction, long>(func, value));\n      total_ += value;\n      min_ = Math.Min(min_, value);\n      max_ = Math.Max(max_, value);\n    }\n\n    public ValueStatistics Compute(int count) {\n      var stats = new ValueStatistics();\n\n      if (count == 0 || values_.Count == 0) {\n        return stats;\n      }\n\n      values_.Sort((a, b) => a.Item2.CompareTo(b.Item2));\n      stats.Values = values_;\n      stats.Average = (double)total_ / count;\n      stats.Median = values_[values_.Count / 2].Item2;\n      stats.Min = min_;\n      stats.Max = max_;\n      return stats;\n    }\n  }\n\n  public class DistributionRange {\n    public DistributionRange(int index, int rangeStart, int rangeEnd) {\n      Index = index;\n      RangeStart = rangeStart;\n      RangeEnd = rangeEnd;\n      Values = new List<Tuple<IRTextFunction, long>>();\n    }\n\n    public int Index { get; set; }\n    public int RangeStart { get; set; }\n    public int RangeEnd { get; set; }\n    public int Count { get; set; }\n    public double Percentage { get; set; }\n    public List<Tuple<IRTextFunction, long>> Values { get; set; }\n  }\n}\n\npublic class FunctionGroupStatistics {\n  public FunctionGroupStatistics(IDictionary<IRTextFunction, FunctionCodeStatistics> functions) {\n    Functions = functions;\n    Total = new FunctionCodeStatistics();\n  }\n\n  public IDictionary<IRTextFunction, FunctionCodeStatistics> Functions { get; set; }\n  public FunctionCodeStatistics Total { get; set; }\n  public ValueStatistics Size { get; set; }\n  public ValueStatistics Instructions { get; set; }\n  public ValueStatistics Calls { get; set; }\n  public ValueStatistics Callers { get; set; }\n\n  public override string ToString() {\n    return $\"Totals: {Total}\\n\" +\n           $\"Size: {Size}\\n\" +\n           $\"Instructions: {Instructions}\\n\" +\n           $\"Calls: {Calls}\\n\" +\n           $\"Callers: {Callers}\\n\";\n  }\n}\n\npublic class ModuleReport {\n  public ModuleReport(IDictionary<IRTextFunction, FunctionCodeStatistics> functionStatisticsMap) {\n    StatisticsMap = functionStatisticsMap;\n    Statistics = new FunctionGroupStatistics(functionStatisticsMap);\n    SingleCallerFunctions = new List<IRTextFunction>();\n    LeafFunctions = new List<IRTextFunction>();\n    InstructionsDistribution = new Dictionary<int, List<IRTextFunction>>();\n    CallsDistribution = new Dictionary<int, List<IRTextFunction>>();\n    CallersDistribution = new Dictionary<int, List<IRTextFunction>>();\n  }\n\n  public ICollection<IRTextFunction> Functions => StatisticsMap.Keys;\n  public int FunctionCount => StatisticsMap.Count;\n  public IDictionary<IRTextFunction, FunctionCodeStatistics> StatisticsMap { get; set; }\n  public FunctionGroupStatistics Statistics { get; set; }\n  public List<IRTextFunction> SingleCallerFunctions { get; set; }\n  public List<IRTextFunction> LeafFunctions { get; set; }\n  public Dictionary<int, List<IRTextFunction>> InstructionsDistribution { get; set; }\n  public Dictionary<int, List<IRTextFunction>> CallsDistribution { get; set; }\n  public Dictionary<int, List<IRTextFunction>> CallersDistribution { get; set; }\n  public double SingleCallerPercentage => FunctionCount > 0 ? (double)SingleCallerFunctions.Count / FunctionCount : 0;\n  public double LeafPercentage => FunctionCount > 0 ? (double)LeafFunctions.Count / FunctionCount : 0;\n\n  public void Generate() {\n    foreach (var pair in StatisticsMap) {\n      var func = pair.Key;\n      var stats = pair.Value;\n\n      AddToDistribution(stats.Instructions, func, InstructionsDistribution);\n      AddToDistribution(stats.Calls, func, CallsDistribution);\n      AddToDistribution(stats.Callers, func, CallersDistribution);\n\n      if (stats.Callers == 1) {\n        SingleCallerFunctions.Add(func);\n      }\n\n      if (stats.Calls == 0) {\n        LeafFunctions.Add(func);\n      }\n    }\n\n    ComputeStatistics();\n  }\n\n  public List<Tuple<int, int, List<IRTextFunction>>> ComputeHistogram(int step) {\n    return null;\n  }\n\n  public void ComputeStatistics() {\n    Statistics = ComputeGroupStatistics(StatisticsMap);\n  }\n\n  public FunctionGroupStatistics ComputeGroupStatistics(\n    List<IRTextFunction> values) {\n    var dict = new Dictionary<IRTextFunction, FunctionCodeStatistics>();\n\n    foreach (var func in values) {\n      dict[func] = StatisticsMap[func];\n    }\n\n    return ComputeGroupStatistics(dict);\n  }\n\n  public FunctionGroupStatistics ComputeGroupStatistics(\n    IDictionary<IRTextFunction, FunctionCodeStatistics> values) {\n    var groupStats = new FunctionGroupStatistics(values);\n    var calls = new ValueStatistics.Generator();\n    var callers = new ValueStatistics.Generator();\n    var size = new ValueStatistics.Generator();\n    var instrs = new ValueStatistics.Generator();\n    int functions = 0;\n\n    foreach (var pair in values) {\n      var func = pair.Key;\n      var stats = pair.Value;\n      groupStats.Total.Add(stats);\n      calls.Add(stats.Calls, func);\n      callers.Add(stats.Callers, func);\n      size.Add(stats.Size, func);\n      instrs.Add(stats.Instructions, func);\n      functions++;\n    }\n\n    groupStats.Calls = calls.Compute(functions);\n    groupStats.Callers = callers.Compute(functions);\n    groupStats.Size = size.Compute(functions);\n    groupStats.Instructions = instrs.Compute(functions);\n    return groupStats;\n  }\n\n  public override string ToString() {\n    return $\"Functions: {Functions}\\n\" +\n           $\"Statistics: {Statistics}\\n\" +\n           $\"SingleCallerFunctions: {SingleCallerFunctions.Count}\\n\" +\n           $\"LeafFunctions: {LeafFunctions.Count}\";\n  }\n\n  private void AddToDistribution(int times, IRTextFunction function, Dictionary<int, List<IRTextFunction>> map) {\n    if (!map.TryGetValue(times, out var list)) {\n      list = new List<IRTextFunction>();\n      map[times] = list;\n    }\n\n    list.Add(function);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ModuleReportPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.ModuleReportPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n\n  <Grid>\n    <Grid Grid.Row=\"1\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"330\" />\n        <ColumnDefinition Width=\"2\" />\n        <ColumnDefinition Width=\"*\" />\n      </Grid.ColumnDefinitions>\n\n      <Grid>\n        <ScrollViewer\n          Grid.Column=\"0\"\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n            <StackPanel>\n              <Expander IsExpanded=\"True\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"Summary\" />\n                </Expander.Header>\n                <Grid>\n                  <StackPanel Margin=\"4,4,16,4\">\n                    <StackPanel Orientation=\"Horizontal\">\n                      <TextBlock\n                        Width=\"100\"\n                        Margin=\"0,0,16,0\"\n                        Text=\"Instructions\" />\n                      <TextBlock\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Statistics.Total.Instructions}\" />\n                    </StackPanel>\n\n                    <StackPanel Orientation=\"Horizontal\">\n                      <TextBlock\n                        Width=\"100\"\n                        Margin=\"0,0,16,0\"\n                        Text=\"Size\" />\n                      <TextBlock\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Statistics.Total.Size}\" />\n                    </StackPanel>\n\n                    <StackPanel Orientation=\"Horizontal\">\n                      <TextBlock\n                        Width=\"100\"\n                        Margin=\"0,0,16,0\"\n                        Text=\"Functions\" />\n                      <TextBlock\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding FunctionCount}\" />\n                    </StackPanel>\n                    <StackPanel Orientation=\"Horizontal\">\n                      <TextBlock\n                        Width=\"100\"\n                        Margin=\"16,0,0,0\"\n                        Text=\"Single caller\" />\n                      <TextBlock\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding SingleCallerFunctions.Count}\" />\n                      <TextBlock\n                        Margin=\"8,0,0,0\"\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Path=SingleCallerPercentage, StringFormat=({0:p2})}\" />\n                    </StackPanel>\n                    <StackPanel Orientation=\"Horizontal\">\n                      <TextBlock\n                        Width=\"100\"\n                        Margin=\"16,0,0,0\"\n                        Text=\"Leafs\" />\n                      <TextBlock\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding LeafFunctions.Count}\" />\n                      <TextBlock\n                        Margin=\"8,0,0,0\"\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Path=LeafPercentage, StringFormat=({0:p2})}\" />\n                    </StackPanel>\n                  </StackPanel>\n                </Grid>\n              </Expander>\n              <Separator />\n\n              <Expander x:Name=\"InstructionsExpander\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"Instructions\" />\n                </Expander.Header>\n                <StackPanel Margin=\"4,4,16,4\">\n                  <local:ValueStatisticPanel\n                    DataContext=\"{Binding Statistics.Instructions}\"\n                    RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n                  <Expander Header=\"Instruction types\">\n                    <StackPanel Margin=\"4,4,16,4\">\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Width=\"100\"\n                          Margin=\"16,0,0,0\"\n                          Text=\"Loads\" />\n                        <TextBlock Text=\"{Binding Statistics.Total.Loads}\" />\n                      </StackPanel>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Width=\"100\"\n                          Margin=\"16,0,0,0\"\n                          Text=\"Stores\" />\n                        <TextBlock Text=\"{Binding Statistics.Total.Stores}\" />\n                      </StackPanel>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Width=\"100\"\n                          Margin=\"16,0,0,0\"\n                          Text=\"Branches\" />\n                        <TextBlock Text=\"{Binding Statistics.Total.Branches}\" />\n                      </StackPanel>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Width=\"100\"\n                          Margin=\"16,0,0,0\"\n                          Text=\"Calls\" />\n                        <TextBlock Text=\"{Binding Statistics.Total.Calls}\" />\n                      </StackPanel>\n                      <StackPanel Orientation=\"Horizontal\">\n                        <TextBlock\n                          Width=\"100\"\n                          Margin=\"16,0,0,0\"\n                          Text=\"Indirect calls\" />\n                        <TextBlock Text=\"{Binding Statistics.Total.IndirectCalls}\" />\n                      </StackPanel>\n                    </StackPanel>\n                  </Expander>\n                </StackPanel>\n              </Expander>\n              <Separator />\n\n              <Expander x:Name=\"SizeExpander\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"Size\" />\n                </Expander.Header>\n                <StackPanel Margin=\"4,4,16,4\">\n                  <local:ValueStatisticPanel\n                    DataContext=\"{Binding Statistics.Size}\"\n                    RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n                </StackPanel>\n              </Expander>\n              <Separator />\n\n              <Expander x:Name=\"CallTreeDepthExpander\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"Call tree depth\" />\n                </Expander.Header>\n                <local:ValueStatisticPanel\n                  DataContext=\"{Binding Statistics.Calls}\"\n                  RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n              </Expander>\n              <Separator />\n\n              <Expander x:Name=\"CallsExpander\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"Calls\" />\n                </Expander.Header>\n                <local:ValueStatisticPanel\n                  DataContext=\"{Binding Statistics.Calls}\"\n                  RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n              </Expander>\n              <Separator />\n\n              <Expander x:Name=\"CallerExpander\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"Callers\" />\n                </Expander.Header>\n                <local:ValueStatisticPanel\n                  DataContext=\"{Binding Statistics.Callers}\"\n                  RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n              </Expander>\n              <Separator />\n\n              <Expander x:Name=\"SingleCallerExpander\">\n                <Expander.Header>\n                  <DockPanel\n                    Width=\"300\"\n                    MinWidth=\"250\"\n                    HorizontalAlignment=\"Stretch\">\n                    <TextBlock\n                      VerticalAlignment=\"Center\"\n                      FontWeight=\"Medium\"\n                      Foreground=\"DarkBlue\"\n                      Text=\"Single caller functions\" />\n                    <Button\n                      x:Name=\"SingleCallListButton\"\n                      Padding=\"4,2,4,2\"\n                      HorizontalAlignment=\"Right\"\n                      VerticalAlignment=\"Center\"\n                      Click=\"SingleCallListButton_Click\"\n                      Content=\"Functions list\"\n                      DockPanel.Dock=\"Right\" />\n                  </DockPanel>\n                </Expander.Header>\n                <StackPanel\n                  Margin=\"16,4,4,4\"\n                  Orientation=\"Vertical\">\n                  <Expander Header=\"Instructions details\">\n                    <local:ValueStatisticPanel\n                      DataContext=\"{Binding Instructions}\"\n                      RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n                  </Expander>\n                  <Separator />\n\n                  <Expander\n                    Margin=\"0,4,0,0\"\n                    Header=\"Size details\">\n                    <local:ValueStatisticPanel\n                      DataContext=\"{Binding Size}\"\n                      RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n                  </Expander>\n                </StackPanel>\n              </Expander>\n              <Separator />\n\n              <Expander x:Name=\"LeafExpander\">\n                <Expander.Header>\n                  <DockPanel\n                    Width=\"300\"\n                    MinWidth=\"250\"\n                    HorizontalAlignment=\"Stretch\">\n                    <TextBlock\n                      VerticalAlignment=\"Center\"\n                      FontWeight=\"Medium\"\n                      Foreground=\"DarkBlue\"\n                      Text=\"Leaf functions\" />\n                    <Button\n                      x:Name=\"LeafListButton\"\n                      Padding=\"4,2,4,2\"\n                      HorizontalAlignment=\"Right\"\n                      VerticalAlignment=\"Center\"\n                      Click=\"LeafListButton_Click\"\n                      Content=\"Functions list\"\n                      DockPanel.Dock=\"Right\" />\n                  </DockPanel>\n                </Expander.Header>\n                <StackPanel\n                  Margin=\"16,4,4,4\"\n                  Orientation=\"Vertical\">\n                  <Expander Header=\"Instructions details\">\n                    <local:ValueStatisticPanel\n                      DataContext=\"{Binding Instructions}\"\n                      RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n                  </Expander>\n                  <Separator />\n\n                  <Expander\n                    Margin=\"0,4,0,0\"\n                    Header=\"Size details\">\n                    <local:ValueStatisticPanel\n                      DataContext=\"{Binding Size}\"\n                      RangeSelected=\"ValueStatisticPanel_RangeSelected\" />\n                  </Expander>\n                </StackPanel>\n              </Expander>\n            </StackPanel>\n          </Grid>\n        </ScrollViewer>\n      </Grid>\n\n      <GridSplitter\n        Grid.Column=\"1\"\n        Width=\"2\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\" />\n      <Grid Grid.Column=\"2\">\n        <Grid.RowDefinitions>\n          <RowDefinition Height=\"28\" />\n          <RowDefinition Height=\"*\" />\n        </Grid.RowDefinitions>\n\n        <ListView\n          x:Name=\"FunctionList\"\n          Panel.ZIndex=\"2\"\n          local:GridViewColumnVisibility.Enabled=\"True\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          BorderBrush=\"{x:Null}\"\n          BorderThickness=\"0,0,0,0\"\n          IsTextSearchEnabled=\"False\"\n          SelectionChanged=\"FunctionList_SelectionChanged\"\n          SelectionMode=\"Single\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn Width=\"200\">\n                <GridViewColumnHeader\n                  x:Name=\"ChildColumnHeader\"\n                  Content=\"Function\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <TextBlock\n                      Foreground=\"{Binding TextColor}\"\n                      Text=\"{Binding Name}\" />\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn DisplayMemberBinding=\"{Binding Statistics.Instructions}\">\n                <GridViewColumnHeader\n                  x:Name=\"InstructionCountColumnHeader\"\n                  Content=\"Instrs\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn DisplayMemberBinding=\"{Binding Statistics.Size}\">\n                <GridViewColumnHeader\n                  x:Name=\"SizeColumnHeader\"\n                  Content=\"Size\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn DisplayMemberBinding=\"{Binding Statistics.Calls}\">\n                <GridViewColumnHeader\n                  x:Name=\"CallCountColumnHeader\"\n                  Content=\"Calls\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn DisplayMemberBinding=\"{Binding Statistics.Callers}\">\n                <GridViewColumnHeader\n                  x:Name=\"CallerCountColumnHeader\"\n                  Content=\"Callers\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn\n                Width=\"200\"\n                local:GridViewColumnVisibility.IsVisible=\"{Binding AlternateNameColumnVisible}\">\n                <GridViewColumnHeader\n                  x:Name=\"ChildAlternateNameColumnHeader\"\n                  Content=\"Demangled Name\" />\n\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border HorizontalAlignment=\"Stretch\">\n                      <TextBlock\n                        Margin=\"6,2,6,2\"\n                        Text=\"{Binding AlternateName}\" />\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <EventSetter\n                Event=\"MouseDoubleClick\"\n                Handler=\"ListViewItem_MouseDoubleClick\" />\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n            </Style>\n          </ListView.ItemContainerStyle>\n        </ListView>\n      </Grid>\n\n      <GridSplitter\n        Grid.Column=\"3\"\n        Width=\"2\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\" />\n      <local:CallGraphPanel\n        x:Name=\"CallGraphView\"\n        Grid.Column=\"4\" />\n    </Grid>\n\n  </Grid>\n\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ModuleReportPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class ModuleReportPanel : ToolPanelControl {\n  private ModuleReport report_;\n  private IRTextSummary summary_;\n  private IUISession session_;\n\n  public ModuleReportPanel(IUISession session) {\n    InitializeComponent();\n    session_ = session;\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Other;\n\n  public void ShowReport(ModuleReport report, IRTextSummary summary) {\n    report_ = report;\n    summary_ = summary;\n    DataContext = report;\n\n    SingleCallerExpander.DataContext = report.ComputeGroupStatistics(report.SingleCallerFunctions);\n    LeafExpander.DataContext = report.ComputeGroupStatistics(report.LeafFunctions);\n\n    CallGraphView.Session = session_;\n    CallGraphView.OnRegisterPanel();\n  }\n\n  private void UpdateFunctionList(List<IRTextFunction> list) {\n    FunctionList.ItemsSource = CreateFunctionList(list);\n  }\n\n  private ListCollectionView CreateFunctionList(List<IRTextFunction> list) {\n    list.Sort((a, b) => a.Name.CompareTo(b.Name));\n    var listEx = new List<FunctionEx>(list.Count);\n\n    foreach (var func in list) {\n      listEx.Add(new FunctionEx {\n        Function = func,\n        Name = func.Name,\n        TextColor = Brushes.Black,\n        Statistics = report_.StatisticsMap[func]\n      });\n    }\n\n    return new ListCollectionView(listEx);\n  }\n\n  private void SingleCallListButton_Click(object sender, RoutedEventArgs e) {\n    UpdateFunctionList(report_.SingleCallerFunctions);\n  }\n\n  private void ValueStatisticPanel_RangeSelected(object sender, List<IRTextFunction> e) {\n    UpdateFunctionList(e);\n  }\n\n  private void LeafListButton_Click(object sender, RoutedEventArgs e) {\n    UpdateFunctionList(report_.LeafFunctions);\n  }\n\n  private async Task DisplayCallGraph(IRTextFunction func) {\n    var loadedDoc = session_.SessionState.FindLoadedDocument(summary_);\n    var section = func.Sections[0];\n    var layoutGraph = await Task.Run(() =>\n                                       CallGraphUtils.BuildCallGraphLayout(summary_, section, loadedDoc,\n                                                                           session_.CompilerInfo, true));\n    CallGraphView.DisplayGraph(layoutGraph);\n  }\n\n  private void FunctionFilter_TextChanged(object sender, TextChangedEventArgs e) {\n    RefreshFunctionList();\n  }\n\n  private void RefreshFunctionList() {\n    if (FunctionList.ItemsSource == null) {\n      return;\n    }\n\n    ((ListCollectionView)FunctionList.ItemsSource).Refresh();\n  }\n\n  private async void FunctionList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    var funcEx = FunctionList.SelectedItem as FunctionEx;\n\n    if (funcEx == null) {\n      return;\n    }\n\n    await Session.SwitchActiveFunction(funcEx.Function);\n  }\n\n  private async void ListViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    var funcEx = ((ListViewItem)sender).Content as FunctionEx;\n\n    if (funcEx == null) {\n      return;\n    }\n\n    var func = funcEx.Function;\n\n    if (func.SectionCount == 0) {\n      return;\n    }\n\n    await DisplayCallGraph(func);\n  }\n\n  public class FunctionEx {\n    public IRTextFunction Function { get; set; }\n    public string Name { get; set; }\n    public string AlternateName { get; set; }\n    public Brush TextColor { get; set; }\n    public Brush BackColor { get; set; }\n    public FunctionCodeStatistics Statistics { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/NotesPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.NotesPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:Command.ClearTextbox\"\n      Executed=\"ExecuteClearTextSearch\" />\n  </local:ToolPanelControl.CommandBindings>\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <DockPanel\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <ToolBarTray\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <TextBlock\n            Margin=\"5,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"Notes Scope\" />\n\n          <ComboBox\n            x:Name=\"FilterComboBox\"\n            Width=\"120\"\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            Loaded=\"ComboBox_Loaded\"\n            SelectedIndex=\"0\"\n            SelectionChanged=\"FilterComboBox_SelectionChanged\">\n            <ComboBoxItem\n              Content=\"Trace Notes\"\n              Tag=\"Trace\" />\n            <ComboBoxItem\n              Content=\"Function Notes\"\n              Tag=\"Function\" />\n          </ComboBox>\n\n          <ToggleButton\n            IsChecked=\"{Binding WordWrap, Mode=TwoWay}\"\n            ToolTip=\"Word wrap output text\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource WordWrapIcon}\" />\n          </ToggleButton>\n          <!-- <Separator /> -->\n          <!-- -->\n          <!-- <ToggleButton -->\n          <!--   IsChecked=\"{Binding SearchPanelVisible, Mode=TwoWay}\" -->\n          <!--   ToolTip=\"Search output text (Ctrl+F)\"> -->\n          <!--   <Image -->\n          <!--     Width=\"16\" -->\n          <!--     Height=\"16\" -->\n          <!--     Source=\"{StaticResource SearchIcon}\" /> -->\n          <!-- </ToggleButton> -->\n        </ToolBar>\n      </ToolBarTray>\n\n      <local:PanelToolbarTray\n        DockPanel.Dock=\"Right\"\n        DuplicateClicked=\"PanelToolbarTray_DuplicateClicked\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        HasPinButton=\"False\" />\n    </DockPanel>\n\n    <local:LightIRDocument\n      x:Name=\"TextView\"\n      Grid.Row=\"1\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      FontFamily=\"Consolas\"\n      FontSize=\"12\"\n      HorizontalScrollBarVisibility=\"Auto\"\n      ShowLineNumbers=\"True\"\n      VerticalScrollBarVisibility=\"Auto\" />\n  </Grid>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/NotesPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Document;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class NotesPanelState {\n  [ProtoMember(1)]\n  public string Text;\n  [ProtoMember(2)]\n  public bool ShowSectionNotes;\n}\n\npublic class NotesPanelSettings {\n  public bool FilterSearchedTextLines;\n}\n\npublic partial class NotesPanel : ToolPanelControl {\n  private bool showSectionText_;\n\n  public NotesPanel() {\n    InitializeComponent();\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Notes;\n  public override bool SavesStateToFile => true;\n\n  private void PanelToolbarTray_DuplicateClicked(object sender, DuplicateEventArgs e) {\n    Session.DuplicatePanel(this, e.Kind);\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private void ExecuteClearTextSearch(object sender, ExecutedRoutedEventArgs e) {\n    ((TextBox)e.Parameter).Text = string.Empty;\n  }\n\n  private async void FilterComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (!IsPanelEnabled || Session.CurrentDocument == null) {\n      return;\n    }\n\n    var item = e.AddedItems[0] as ComboBoxItem;\n    string kindString = item.Tag as string;\n    OnSessionSave();\n\n    showSectionText_ = kindString switch {\n      \"Trace\"    => false,\n      \"Function\" => true,\n      _          => showSectionText_\n    };\n\n    await SwitchText(Session.CurrentDocumentSection, Session.CurrentDocument);\n  }\n\n  private void ComboBox_Loaded(object sender, RoutedEventArgs e) {\n    if (sender is ComboBox control) {\n      Utils.PatchComboBoxStyle(control);\n    }\n  }\n\n  public override async void OnSessionStart() {\n    base.OnSessionStart();\n    TextView.Session = Session;\n    await LoadSessionNotes();\n  }\n\n  public override async Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    await SwitchText(section, document);\n  }\n\n  private async Task SwitchText(IRTextSection section, IRDocument document) {\n    if (!showSectionText_) {\n      await LoadSessionNotes();\n    }\n    else {\n      object data = Session.LoadPanelState(this, section);\n\n      if (data != null) {\n        var state = UIStateSerializer.Deserialize<NotesPanelState>(data, document.Function);\n        await TextView.SwitchText(state.Text, document.Function, section, document);\n        showSectionText_ = state.ShowSectionNotes;\n        FilterComboBox.SelectedIndex = showSectionText_ ? 1 : 0;\n      }\n      else {\n        await TextView.SwitchText(\"\", document.Function, section, document);\n        await TextView.SearchText(new SearchInfo());\n      }\n    }\n  }\n\n  private async Task LoadSessionNotes() {\n    await TextView.SwitchText(Session.SessionState.Info.Notes, null, null, null);\n    await TextView.SearchText(new SearchInfo());\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    if (!showSectionText_) {\n      SaveSessionNotes();\n    }\n    else {\n      SaveState(section, document);\n    }\n  }\n\n  private void SaveSessionNotes() {\n    Session.SessionState.Info.Notes = TextView.Text;\n  }\n\n  public override void OnSessionSave() {\n    if (!showSectionText_) {\n      Session.SessionState.Info.Notes = TextView.Text;\n    }\n    else {\n      var document = Session.FindAssociatedDocument(this);\n\n      if (document != null) {\n        SaveState(document.Section, document);\n      }\n    }\n  }\n\n  private void SaveState(IRTextSection section, IRDocument document) {\n    var state = new NotesPanelState();\n    state.Text = TextView.Text;\n    state.ShowSectionNotes = showSectionText_;\n    byte[] data = UIStateSerializer.Serialize(state, document.Function);\n    Session.SavePanelState(data, this, section);\n  }\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    TextView.UnloadDocument();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/PassOutputPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.PassOutputPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:doc=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:PassOutputPanelCommand.ToggleOutput\"\n      Executed=\"ToggleOutputExecuted\" />\n    <CommandBinding\n      Command=\"local:PassOutputPanelCommand.ToggleSearch\"\n      Executed=\"ToggleSearchExecuted\" />\n  </local:ToolPanelControl.CommandBindings>\n\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <DockPanel\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <ToolBarTray\n        x:Name=\"Toolbar\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <TextBlock\n            Margin=\"5,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"Show\" />\n\n          <ToggleButton\n            x:Name=\"BeforeButton\"\n            Width=\"50\"\n            Margin=\"8,0,0,0\"\n            Padding=\"4,2,4,2\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            Click=\"BeforeButton_Click\"\n            Content=\"Before\"\n            IsChecked=\"{Binding ShowBeforeOutput, Mode=OneWay}\" />\n          <ToggleButton\n            x:Name=\"AfterButton\"\n            Width=\"50\"\n            Margin=\"-1,0,0,0\"\n            Padding=\"4,2,4,2\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            Click=\"AfterButton_Click\"\n            Content=\"After\"\n            IsChecked=\"{Binding ShowAfterOutput, Mode=OneWay}\" />\n\n          <ToggleButton\n            x:Name=\"DiffToggleButton\"\n            Margin=\"4,0,0,0\"\n            Checked=\"DiffToggleButton_Checked\"\n            IsChecked=\"{Binding DiffModeEnabled}\"\n            IsEnabled=\"{Binding DiffModeButtonEnabled}\"\n            ToolTip=\"Diff output text with other section\"\n            Unchecked=\"DiffToggleButton_Unchecked\"\n            Visibility=\"{Binding DiffModeButtonVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource BookIcon}\" />\n          </ToggleButton>\n          <ToggleButton\n            IsChecked=\"{Binding WordWrap, Mode=TwoWay}\"\n            ToolTip=\"Word wrap output text\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource WordWrapIcon}\" />\n          </ToggleButton>\n          <Separator />\n\n          <ToggleButton\n            IsChecked=\"{Binding SearchPanelVisible, Mode=TwoWay}\"\n            ToolTip=\"Search output text (Ctrl+F)\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource SearchIcon}\" />\n          </ToggleButton>\n\n          <ToggleButton\n            IsChecked=\"{Binding FilterSearchResults, Mode=TwoWay}\"\n            IsEnabled=\"{Binding FilterSearchResultsButtonEnabled}\"\n            ToolTip=\"Display only lines part of the search result\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource TasklistIcon}\" />\n          </ToggleButton>\n          <Separator />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"Section\"\n            Visibility=\"{Binding SectionNameVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <TextBlock\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Text=\"{Binding SectionName}\"\n            Visibility=\"{Binding SectionNameVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n        </ToolBar>\n      </ToolBarTray>\n\n      <local:PanelToolbarTray\n        x:Name=\"FixedToolbar\"\n        BindMenuItemSelected=\"FixedToolbar_BindMenuItemSelected\"\n        BindMenuOpen=\"FixedToolbar_BindMenuOpen\"\n        DockPanel.Dock=\"Right\"\n        DuplicateClicked=\"PanelToolbarTray_DuplicateClicked\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        HasPinButton=\"True\"\n        SettingsClicked=\"FixedToolbar_SettingsClicked\" />\n    </DockPanel>\n\n    <local:LightIRDocument\n      x:Name=\"TextView\"\n      Grid.Row=\"1\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      FontFamily=\"Consolas\"\n      FontSize=\"12\"\n      HorizontalScrollBarVisibility=\"Auto\"\n      ScrollViewer.ScrollChanged=\"TextView_ScrollChanged\"\n      ShowLineNumbers=\"True\"\n      VerticalScrollBarVisibility=\"Auto\" />\n\n    <Grid\n      Grid.Row=\"1\"\n      Panel.ZIndex=\"100\">\n      <doc:SearchPanel\n        x:Name=\"SearchPanel\"\n        Width=\"500\"\n        Height=\"28\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Top\"\n        Opacity=\"1\"\n        Visibility=\"Collapsed\" />\n    </Grid>\n  </Grid>\n\n  <local:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"O\"\n      Command=\"local:PassOutputPanelCommand.ToggleOutput\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F\"\n      Command=\"local:PassOutputPanelCommand.ToggleSearch\"\n      CommandTarget=\"{Binding ElementName=TextView}\"\n      Modifiers=\"Ctrl\" />\n  </local:ToolPanelControl.InputBindings>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/PassOutputPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Diff;\nusing ProfileExplorer.UI.Document;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class PassOutputPanelState {\n  [ProtoMember(1)]\n  public SearchInfo SearchInfo;\n  [ProtoMember(2)]\n  public bool ShowAfterOutput;\n  [ProtoMember(3)]\n  public bool DiffModeEnabled;\n  [ProtoMember(4)]\n  public int CaretOffset;\n  [ProtoMember(5)]\n  public double HorizontalOffset;\n  [ProtoMember(6)]\n  public double VerticalOffset;\n}\n\npublic static class PassOutputPanelCommand {\n  public static readonly RoutedUICommand ToggleOutput = new(\"Untitled\", \"ToggleOutput\", typeof(PassOutputPanel));\n  public static readonly RoutedUICommand ToggleSearch = new(\"Untitled\", \"ToggleSearch\", typeof(PassOutputPanel));\n}\n\npublic partial class PassOutputPanel : ToolPanelControl, INotifyPropertyChanged {\n  private string initialText_;\n  private bool searchPanelVisible_;\n  private List<TextSearchResult> searchResults_;\n  private bool showAfterOutput_;\n  private bool diffModeEnabled_;\n  private bool diffModeButtonEnabled_;\n  private bool diffModeButtonVisible_;\n  private bool sectionNameVisible_;\n\n  public PassOutputPanel() {\n    InitializeComponent();\n    Toolbar.DataContext = this;\n    diffModeButtonVisible_ = true;\n    sectionNameVisible_ = true;\n\n    SearchPanel.SearchChanged += SearchPanel_SearchChanged;\n    SearchPanel.CloseSearchPanel += SearchPanel_CloseSearchPanel;\n    SearchPanel.NavigateToPreviousResult += SearchPanel_NaviateToPreviousResult;\n    SearchPanel.NavigateToNextResult += SearchPanel_NavigateToNextResult;\n  }\n\n  public bool ShowAfterOutput {\n    get => showAfterOutput_;\n    set {\n      if (showAfterOutput_ != value) {\n        showAfterOutput_ = value;\n        OnPropertyChange(nameof(ShowAfterOutput));\n        OnPropertyChange(nameof(ShowBeforeOutput));\n      }\n    }\n  }\n\n  public bool ShowBeforeOutput {\n    get => !showAfterOutput_;\n    set {\n      if (showAfterOutput_ == value) {\n        showAfterOutput_ = !value;\n        OnPropertyChange(nameof(ShowAfterOutput));\n        OnPropertyChange(nameof(ShowBeforeOutput));\n      }\n    }\n  }\n\n  public bool DiffModeButtonVisible {\n    get => diffModeButtonVisible_;\n    set {\n      if (diffModeButtonVisible_ != value) {\n        diffModeButtonVisible_ = value;\n        OnPropertyChange(nameof(DiffModeButtonVisible));\n      }\n    }\n  }\n\n  public bool SectionNameVisible {\n    get => sectionNameVisible_;\n    set {\n      if (sectionNameVisible_ != value) {\n        sectionNameVisible_ = value;\n        OnPropertyChange(nameof(SectionNameVisible));\n      }\n    }\n  }\n\n  public IRTextSection Section { get; set; }\n\n  public bool SearchPanelVisible {\n    get => searchPanelVisible_;\n    set {\n      if (value != searchPanelVisible_) {\n        searchPanelVisible_ = value;\n\n        if (searchPanelVisible_) {\n          SearchPanel.Visibility = Visibility.Visible;\n          SearchPanel.Show();\n        }\n        else {\n          SearchPanel.Reset();\n          SearchPanel.Visibility = Visibility.Collapsed;\n        }\n\n        OnPropertyChange(nameof(SearchPanelVisible));\n      }\n    }\n  }\n\n  public bool WordWrap {\n    get => TextView.WordWrap;\n    set {\n      TextView.WordWrap = value;\n      OnPropertyChange(nameof(WordWrap));\n    }\n  }\n\n  public bool FilterSearchResults {\n    get => TextView.SearchMode == LightIRDocument.TextSearchMode.Filter;\n    set {\n      var prevSearchMode = TextView.SearchMode;\n      TextView.SearchMode = value ? LightIRDocument.TextSearchMode.Filter :\n        LightIRDocument.TextSearchMode.Mark;\n\n      if (TextView.SearchMode != prevSearchMode) {\n        Dispatcher.InvokeAsync(async () => await SearchText());\n        OnPropertyChange(nameof(FilterSearchResults));\n      }\n    }\n  }\n\n  public bool FilterSearchResultsButtonEnabled => !DiffModeEnabled;\n  public string SectionName => TextView.Section != null ?\n    Session.CompilerInfo.NameProvider.GetSectionName(TextView.Section) : \"\";\n\n  private bool DiffModeEnabled {\n    get => diffModeEnabled_;\n    set {\n      if (value != diffModeEnabled_) {\n        diffModeEnabled_ = value;\n        OnPropertyChange(nameof(DiffModeEnabled));\n        OnPropertyChange(nameof(FilterSearchResultsButtonEnabled));\n      }\n    }\n  }\n\n  private bool DiffModeButtonEnabled {\n    get => diffModeButtonEnabled_;\n    set {\n      if (value != diffModeButtonEnabled_) {\n        diffModeButtonEnabled_ = value;\n        OnPropertyChange(nameof(DiffModeButtonEnabled));\n      }\n    }\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.PassOutput;\n\n  public override IUISession Session {\n    get => TextView.Session;\n    set => TextView.Session = value;\n  }\n\n  public override bool HasPinnedContent {\n    get => FixedToolbar.IsPinned;\n    set => FixedToolbar.IsPinned = value;\n  }\n\n  public bool HasPinButton {\n    get => FixedToolbar.HasPinButton;\n    set => FixedToolbar.HasPinButton = value;\n  }\n\n  public bool HasDuplicateButton {\n    get => FixedToolbar.HasDuplicateButton;\n    set => FixedToolbar.HasDuplicateButton = value;\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<ScrollChangedEventArgs> ScrollChanged;\n  public event EventHandler<bool> ShowBeforeOutputChanged;\n\n  public async Task LoadDiffedPassOutput(DiffMarkingResult diffResult) {\n    TextView.RemoveDiffTextSegments();\n    await TextView.SwitchDocument(diffResult.DiffDocument, diffResult.DiffText);\n    TextView.AddDiffTextSegments(diffResult.DiffSegments);\n    FilterSearchResults = false; // Not compatible.\n  }\n\n  public async Task RestorePassOutput() {\n    TextView.RemoveDiffTextSegments();\n    await TextView.SwitchText(initialText_);\n  }\n\n  private void SearchPanel_NaviateToPreviousResult(object sender, SearchInfo e) {\n    if (searchResults_ == null) {\n      return;\n    }\n\n    TextView.JumpToSearchResult(searchResults_[e.CurrentResult]);\n  }\n\n  private void SearchPanel_NavigateToNextResult(object sender, SearchInfo e) {\n    if (searchResults_ == null) {\n      return;\n    }\n\n    TextView.JumpToSearchResult(searchResults_[e.CurrentResult]);\n  }\n\n  private void SearchPanel_CloseSearchPanel(object sender, SearchInfo e) {\n    ResetTextSearch();\n  }\n\n  private async void SearchPanel_SearchChanged(object sender, SearchInfo e) {\n    await SearchText(e);\n  }\n\n  private void ResetTextSearch() {\n    if (searchPanelVisible_) {\n      SearchPanelVisible = false;\n      TextView.ResetTextSearch();\n    }\n  }\n\n  private async Task SearchText(SearchInfo info = null) {\n    if (info == null) {\n      if (searchPanelVisible_) {\n        info = SearchPanel.SearchInfo;\n      }\n      else {\n        return;\n      }\n    }\n\n    searchResults_ = await TextView.SearchText(info);\n\n    if (searchResults_ != null && searchResults_.Count > 0) {\n      info.ResultCount = searchResults_.Count;\n      TextView.JumpToSearchResult(searchResults_[0]);\n    }\n  }\n\n  private void PanelToolbarTray_DuplicateClicked(object sender, DuplicateEventArgs e) {\n    Session.DuplicatePanel(this, e.Kind);\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async void ToggleOutputExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ShowAfterOutput = !ShowAfterOutput;\n    await SwitchText(TextView.Section, TextView.Function, TextView.AssociatedDocument);\n    ShowBeforeOutputChanged?.Invoke(this, ShowBeforeOutput);\n  }\n\n  private void ToggleSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SearchPanelVisible = !SearchPanelVisible;\n  }\n\n  private void FixedToolbar_BindMenuItemSelected(object sender, BindMenuItem e) {\n    Session.BindToDocument(this, e);\n  }\n\n  private void FixedToolbar_BindMenuOpen(object sender, BindMenuItemsArgs e) {\n    Session.PopulateBindMenu(this, e);\n  }\n\n  private void FixedToolbar_SettingsClicked(object sender, EventArgs e) {\n    MessageBox.Show(\"TODO\");\n  }\n\n  private async void AfterButton_Click(object sender, RoutedEventArgs e) {\n    ShowAfterOutput = true;\n\n    if (ShowBeforeOutputChanged != null) {\n      // Let the owner handle the text change (used with diff mode).\n      ShowBeforeOutputChanged(this, ShowBeforeOutput);\n    }\n    else {\n      await SwitchText(TextView.Section, TextView.Function, TextView.AssociatedDocument);\n    }\n  }\n\n  private async void BeforeButton_Click(object sender, RoutedEventArgs e) {\n    ShowBeforeOutput = true;\n\n    if (ShowBeforeOutputChanged != null) {\n      // Let the owner handle the text change (used with diff mode).\n      ShowBeforeOutputChanged(this, ShowBeforeOutput);\n    }\n    else {\n      await SwitchText(TextView.Section, TextView.Function, TextView.AssociatedDocument);\n    }\n  }\n\n  private async Task EnterDiffMode() {\n    if (!Session.IsInDiffMode) {\n      return;\n    }\n\n    if (DiffModeEnabled) {\n      return;\n    }\n\n    // Load the output text of the other diffed section.\n    string text = initialText_;\n    string otherText;\n\n    if (Section == Session.DiffModeInfo.LeftSection) {\n      otherText = await GetSectionOutputText(Session.DiffModeInfo.RightSection);\n    }\n    else {\n      otherText = await GetSectionOutputText(Session.DiffModeInfo.LeftSection);\n    }\n\n    var diffBuilder = new DocumentDiffBuilder(App.Settings.DiffSettings);\n    var diff = await Task.Run(() => diffBuilder.ComputeDiffs(otherText, text));\n\n    var diffStats = new DiffStatistics();\n  var diffFilter = Session.CompilerInfo.DiffFilterProvider?.CreateDiffOutputFilter();\n    diffFilter.Initialize(App.Settings.DiffSettings, Session.CompilerInfo.IR);\n    var diffUpdater = new DocumentDiffUpdater(diffFilter, App.Settings.DiffSettings, Session.CompilerInfo);\n    var diffResult = await Task.Run(() => diffUpdater.MarkDiffs(otherText, text, diff.NewText, diff.OldText,\n                                                                true, null, diffStats, true));\n    ResetTextSearch(); // Reset current search, if there is any.\n\n    // Replace the current text document.\n    await LoadDiffedPassOutput(diffResult);\n    DiffModeEnabled = true;\n  }\n\n  private async Task<string> GetSectionOutputText(IRTextSection section) {\n    var output = SelectSectionOutput(section);\n    return await Session.GetSectionOutputTextAsync(output, section);\n  }\n\n  private async void DiffToggleButton_Checked(object sender, RoutedEventArgs e) {\n    await EnterDiffMode();\n  }\n\n  private async void DiffToggleButton_Unchecked(object sender, RoutedEventArgs e) {\n    await EndDiffMode();\n  }\n\n  private async Task EndDiffMode() {\n    if (!DiffModeEnabled) {\n      return;\n    }\n\n    await RestorePassOutput();\n    DiffModeEnabled = false;\n  }\n\n  private void TextView_ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    ScrollChanged?.Invoke(this, e);\n  }\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  public override void OnSessionStart() {\n    base.OnSessionStart();\n  }\n\n  public override async void ClonePanel(IToolPanel basePanel) {\n    var otherPanel = (PassOutputPanel)basePanel;\n    await SwitchText(otherPanel.TextView.Section, otherPanel.TextView.Function,\n                     otherPanel.TextView.AssociatedDocument);\n  }\n\n  public async Task SwitchSection(IRTextSection section, IRDocument document) {\n    Document = document;\n    Section = section;\n    OnPropertyChange(nameof(SectionName)); // Force update.\n\n    DiffModeButtonEnabled = Session.IsInTwoDocumentsDiffMode;\n    object data = Session.LoadPanelState(this, section, Document);\n\n    if (data != null) {\n      var state = UIStateSerializer.Deserialize<PassOutputPanelState>(data, document.Function);\n      await SwitchText(section, document.Function, document);\n      ShowAfterOutput = state.ShowAfterOutput;\n\n      if (state.SearchInfo != null) {\n        // Show search panel and redo the search.\n        SearchPanelVisible = true;\n        SearchPanel.Reset(state.SearchInfo);\n        await SearchText(state.SearchInfo);\n      }\n\n      if (state.DiffModeEnabled) {\n        await EnterDiffMode();\n      }\n\n      // Restore position in document.\n      TextView.TextArea.Caret.Offset = state.CaretOffset;\n      TextView.ScrollToVerticalOffset(state.VerticalOffset);\n      TextView.ScrollToHorizontalOffset(state.HorizontalOffset);\n    }\n    else {\n      await SwitchText(section, document.Function, document);\n      await TextView.SearchText(new SearchInfo());\n    }\n  }\n\n  public override async Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    if (HasPinnedContent) {\n      return;\n    }\n\n    await SwitchSection(section, document);\n  }\n\n  private void SaveState(IRTextSection section, IRDocument document) {\n    var state = new PassOutputPanelState();\n    state.ShowAfterOutput = ShowAfterOutput;\n    state.DiffModeEnabled = DiffModeEnabled;\n    state.SearchInfo = searchPanelVisible_ ? SearchPanel.SearchInfo : null;\n    state.CaretOffset = TextView.TextArea.Caret.Offset;\n    state.VerticalOffset = TextView.VerticalOffset;\n    state.HorizontalOffset = TextView.HorizontalOffset;\n    byte[] data = UIStateSerializer.Serialize(state, document.Function);\n    Session.SavePanelState(data, this, section, Document);\n  }\n\n  private IRPassOutput SelectSectionOutput(IRTextSection section) {\n    return ShowAfterOutput ? section.OutputAfter : section.OutputBefore;\n  }\n\n  private async Task SwitchText(IRTextSection section, FunctionIR function, IRDocument associatedDocument) {\n    var output = SelectSectionOutput(section);\n    initialText_ = await Session.GetSectionOutputTextAsync(output, section);\n\n    TextView.RemoveDiffTextSegments();\n    await TextView.SwitchText(initialText_, function, section, associatedDocument);\n    await SearchText();\n  }\n\n  public async Task UnloadSection(IRTextSection section, IRDocument document) {\n    await ResetOutputPanel();\n    Document = null;\n    Section = null;\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    if (HasPinnedContent || Section != section) {\n      return;\n    }\n\n    SaveState(section, document);\n    await UnloadSection(section, document);\n  }\n\n  private async Task ResetOutputPanel() {\n    SearchPanelVisible = false;\n    initialText_ = null;\n    searchResults_ = null;\n    await EndDiffMode();\n    TextView.UnloadDocument();\n    OnPropertyChange(nameof(SectionName)); // Force update.\n  }\n\n  public override void OnSessionSave() {\n    var document = Session.FindAssociatedDocument(this);\n\n    if (document != null) {\n      SaveState(document.Section, document);\n    }\n  }\n\n  public override async void OnSessionEnd() {\n    base.OnSessionEnd();\n    await ResetOutputPanel();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/PostDominatorTreePanel.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorer.UI;\n\npublic class PostDominatorTreePanel : GraphPanel {\n  public override ToolPanelKind PanelKind => ToolPanelKind.PostDominatorTree;\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ReferencesPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.ReferencesPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n    <Grid\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"50\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Grid.Column=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n\n          <TextBlock\n            Margin=\"5,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"Show\" />\n          <ToggleButton\n            MinWidth=\"75\"\n            Margin=\"8,0,0,0\"\n            Padding=\"4,2,4,2\"\n            HorizontalContentAlignment=\"Stretch\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            IsChecked=\"{Binding ShowLoad, Mode=TwoWay}\">\n            <ToggleButton.Content>\n              <StackPanel Orientation=\"Horizontal\">\n                <TextBlock Text=\"Loads\" />\n                <TextBlock\n                  Margin=\"8,0,0,0\"\n                  FontWeight=\"Medium\"\n                  Text=\"{Binding LoadCount}\" />\n              </StackPanel>\n            </ToggleButton.Content>\n          </ToggleButton>\n          <ToggleButton\n            MinWidth=\"75\"\n            Margin=\"-1,0,0,0\"\n            Padding=\"4,2,4,2\"\n            HorizontalContentAlignment=\"Stretch\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            IsChecked=\"{Binding ShowStore, Mode=TwoWay}\">\n            <ToggleButton.Content>\n              <StackPanel Orientation=\"Horizontal\">\n                <TextBlock Text=\"Stores\" />\n                <TextBlock\n                  Margin=\"8,0,0,0\"\n                  FontWeight=\"Medium\"\n                  Text=\"{Binding StoreCount}\" />\n              </StackPanel>\n            </ToggleButton.Content>\n          </ToggleButton>\n          <ToggleButton\n            MinWidth=\"75\"\n            Margin=\"-1,0,0,0\"\n            Padding=\"4,2,4,2\"\n            HorizontalContentAlignment=\"Stretch\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            IsChecked=\"{Binding ShowAddress, Mode=TwoWay}\">\n            <ToggleButton.Content>\n              <StackPanel Orientation=\"Horizontal\">\n                <TextBlock Text=\"Address\" />\n                <TextBlock\n                  Margin=\"8,0,0,0\"\n                  FontWeight=\"Medium\"\n                  Text=\"{Binding AddressCount}\" />\n              </StackPanel>\n            </ToggleButton.Content>\n          </ToggleButton>\n          <!-- <ToggleButton -->\n          <!--   MinWidth=\"75\" -->\n          <!--   Margin=\"-1,0,0,0\" -->\n          <!--   Padding=\"4,2,4,2\" -->\n          <!--   HorizontalContentAlignment=\"Stretch\" -->\n          <!--   BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\" -->\n          <!--   IsChecked=\"{Binding ShowSSA, Mode=TwoWay}\"> -->\n          <!--   <ToggleButton.Content> -->\n          <!--     <StackPanel Orientation=\"Horizontal\"> -->\n          <!--       <TextBlock Text=\"SSA uses\" /> -->\n          <!--       <TextBlock -->\n          <!--         Margin=\"8,0,0,0\" -->\n          <!--         FontWeight=\"Medium\" -->\n          <!--         Text=\"{Binding SSACount}\" /> -->\n          <!--     </StackPanel> -->\n          <!--   </ToggleButton.Content> -->\n          <!-- </ToggleButton> -->\n\n          <Button\n            Command=\"local:ReferenceCommand.CopyToClipboard\"\n            CommandTarget=\"{Binding ElementName=ReferenceList}\"\n            ToolTip=\"Copy reference list to clipboard (Ctrl+C)\">\n            <Image\n              Source=\"{StaticResource ClipboardIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Separator />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"Symbol\" />\n          <TextBlock\n            x:Name=\"SymbolName\"\n            MinWidth=\"100\"\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Text=\"\" />\n        </ToolBar>\n      </ToolBarTray>\n\n      <local:PanelToolbarTray\n        x:Name=\"FixedToolbar\"\n        Grid.Column=\"1\"\n        BindMenuItemSelected=\"FixedToolbar_BindMenuItemSelected\"\n        BindMenuOpen=\"FixedToolbar_BindMenuOpen\"\n        DuplicateClicked=\"PanelToolbarTray_DuplicateClicked\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        PinnedChanged=\"PanelToolbarTray_PinnedChanged\"\n        SettingsClicked=\"PanelToolbarTray_SettingsClicked\" />\n    </Grid>\n\n    <ListView\n      x:Name=\"ReferenceList\"\n      Grid.RowSpan=\"2\"\n      Margin=\"0,27,0,0\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      BorderBrush=\"{x:Null}\"\n      BorderThickness=\"0,0,0,0\"\n      VirtualizingPanel.IsVirtualizing=\"True\"\n      VirtualizingPanel.VirtualizationMode=\"Recycling\">\n      <ListView.View>\n        <GridView>\n          <GridViewColumn\n            Width=\"30\"\n            DisplayMemberBinding=\"{Binding Index}\"\n            Header=\"#\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n          <GridViewColumn\n            Width=\"60\"\n            DisplayMemberBinding=\"{Binding Kind}\"\n            Header=\"Kind\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"100\"\n            DisplayMemberBinding=\"{Binding Block}\"\n            Header=\"Block\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"400\"\n            Header=\"Preview\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <ContentPresenter Content=\"{Binding Preview}\" />\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"70\"\n            DisplayMemberBinding=\"{Binding Line}\"\n            Header=\"Line\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n        </GridView>\n      </ListView.View>\n      <ListView.ItemContainerStyle>\n        <Style\n          BasedOn=\"{StaticResource FlatListViewItem}\"\n          TargetType=\"{x:Type ListViewItem}\">\n          <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n          <EventSetter\n            Event=\"MouseDoubleClick\"\n            Handler=\"ListViewItem_MouseDoubleClick\" />\n\n          <Style.Triggers>\n            <DataTrigger\n              Binding=\"{Binding Kind}\"\n              Value=\"Store\">\n              <Setter Property=\"Foreground\" Value=\"#006700\" />\n            </DataTrigger>\n            <DataTrigger\n              Binding=\"{Binding Kind}\"\n              Value=\"Load\">\n              <Setter Property=\"Foreground\" Value=\"#4E0088\" />\n            </DataTrigger>\n            <DataTrigger\n              Binding=\"{Binding Kind}\"\n              Value=\"Address\">\n              <Setter Property=\"FontWeight\" Value=\"Medium\" />\n              <Setter Property=\"Foreground\" Value=\"#BE0000\" />\n            </DataTrigger>\n          </Style.Triggers>\n\n        </Style>\n      </ListView.ItemContainerStyle>\n      <ListView.ContextMenu>\n        <ContextMenu>\n          <MenuItem\n            Command=\"local:ReferenceCommand.JumpToReference\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            Header=\"Jump to Reference\"\n            InputGestureText=\"Return\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource JumpIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <Separator />\n\n          <MenuItem\n            Focusable=\"False\"\n            Header=\"Mark Reference\"\n            IsHitTestVisible=\"False\" />\n          <MenuItem>\n            <MenuItem.Header>\n              <local:ColorSelector ColorSelectedCommand=\"local:ReferenceCommand.MarkReference\" />\n            </MenuItem.Header>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:ReferenceCommand.UnmarkReference\"\n            Header=\"Clear Marker\" />\n          <Separator />\n\n          <MenuItem Header=\"Mark Symbol Referencess\">\n            <MenuItem>\n              <MenuItem.Header>\n                <local:ColorSelector ColorSelectedCommand=\"local:ReferenceCommand.MarkReference\" />\n              </MenuItem.Header>\n            </MenuItem>\n          </MenuItem>\n\n          <MenuItem Header=\"Mark Symbol Loads\">\n            <MenuItem>\n              <MenuItem.Header>\n                <local:ColorSelector ColorSelectedCommand=\"local:ReferenceCommand.MarkReference\" />\n              </MenuItem.Header>\n            </MenuItem>\n          </MenuItem>\n\n          <MenuItem Header=\"Mark Symbol Stores\">\n            <MenuItem>\n              <MenuItem.Header>\n                <local:ColorSelector ColorSelectedCommand=\"local:ReferenceCommand.MarkReference\" />\n              </MenuItem.Header>\n            </MenuItem>\n          </MenuItem>\n\n          <MenuItem Header=\"Mark Symbol Addresses\">\n            <MenuItem>\n              <MenuItem.Header>\n                <local:ColorSelector ColorSelectedCommand=\"local:ReferenceCommand.MarkReference\" />\n              </MenuItem.Header>\n            </MenuItem>\n          </MenuItem>\n        </ContextMenu>\n      </ListView.ContextMenu>\n      <ListView.InputBindings>\n        <KeyBinding\n          Key=\"Enter\"\n          Command=\"local:ReferenceCommand.JumpToReference\"\n          CommandParameter=\"{Binding SelectedItem, ElementName=ReferenceList}\" />\n      </ListView.InputBindings>\n    </ListView>\n  </Grid>\n\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:ReferenceCommand.JumpToReference\"\n      Executed=\"JumpToReferenceExecuted\" />\n    <CommandBinding\n      Command=\"local:ReferenceCommand.CopyToClipboard\"\n      Executed=\"CopyToClipboardExecuted\" />\n    <CommandBinding\n      Command=\"local:ReferenceCommand.MarkReference\"\n      Executed=\"MarkReferenceExecuted\" />\n    <CommandBinding\n      Command=\"local:ReferenceCommand.UnmarkReference\"\n      Executed=\"UnmarkReferenceExecuted\" />\n  </local:ToolPanelControl.CommandBindings>\n\n\n  <local:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:ReferenceCommand.JumpToReference\"\n      CommandParameter=\"{Binding ElementName=ReferenceList, Path=SelectedItem}\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"local:ReferenceCommand.CopyToClipboard\"\n      Modifiers=\"Ctrl\" />\n  </local:ToolPanelControl.InputBindings>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ReferencesPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\npublic static class ReferenceCommand {\n  public static readonly RoutedUICommand JumpToReference = new(\"Untitled\", \"JumpToReference\", typeof(ReferencesPanel));\n  public static readonly RoutedUICommand CopyToClipboard = new(\"Untitled\", \"CopyToClipboard\", typeof(ReferencesPanel));\n  public static readonly RoutedUICommand MarkReference = new(\"Untitled\", \"MarkReference\", typeof(ReferencesPanel));\n  public static readonly RoutedUICommand UnmarkReference = new(\"Untitled\", \"UnmarkReference\", typeof(ReferencesPanel));\n}\n\npublic class ReferenceSummary {\n  public int SSACount { get; set; }\n  public int LoadCount { get; set; }\n  public int StoreCount { get; set; }\n  public int AddressCount { get; set; }\n}\n\npublic class ReferenceInfo {\n  //? TODO: Should match editor font, not be hardcoded\n  //? Needs to listen to DocumentSettings event change to update font used too\n  private static readonly FontFamily PreviewFont = new(\"Consolas\");\n  private OperandIR operand_;\n  private ReadOnlyMemory<char> documentText_;\n  private string previewText_;\n  private TextBlock preview_;\n\n  public ReferenceInfo(int index, OperandIR operand, Reference info,\n                       ReadOnlyMemory<char> documentText) {\n    Index = index;\n    Info = info;\n    operand_ = operand;\n    documentText_ = documentText;\n  }\n\n  public Reference Info { get; set; }\n  public int Index { get; set; }\n  public int Line => Info.Element.TextLocation.Line;\n  public string Block => Utils.MakeBlockDescription(Info.Element.ParentBlock);\n\n  public string Kind {\n    get {\n      return Info.Kind switch {\n        ReferenceKind.Address => \"Address\",\n        ReferenceKind.Load    => \"Load\",\n        ReferenceKind.Store   => \"Store\",\n        ReferenceKind.SSA     => \"SSA use\",\n        _                     => \"\"\n      };\n    }\n  }\n\n  public TextBlock Preview {\n    get {\n      CreateOnDemandPreview();\n      return preview_;\n    }\n  }\n\n  public string PreviewText {\n    get {\n      CreateOnDemandPreview();\n      return previewText_;\n    }\n  }\n\n  private static (TextBlock, string)\n    CreatePreviewTextBlock(OperandIR operand, Reference reference,\n                           ReadOnlyMemory<char> documentText) {\n    // Mark every instance of the symbol name in the preview text (usually an instr).\n    string text = GeneratePreviewText(reference, documentText);\n    string symbolName = Utils.GetSymbolName(operand);\n    int index = 0;\n\n    var textBlock = new TextBlock();\n    textBlock.FontFamily = PreviewFont;\n    textBlock.Foreground = Brushes.Black;\n    textBlock.Margin = new Thickness(0, 2, 0, 0);\n\n    if (string.IsNullOrEmpty(symbolName)) {\n      textBlock.Inlines.Add(text);\n      return (textBlock, text);\n    }\n\n    while (index < text.Length) {\n      int symbolIndex = text.IndexOf(symbolName, index, StringComparison.Ordinal);\n\n      if (symbolIndex == -1) {\n        break;\n      }\n\n      // Append any text before the symbol name.\n      if (index < symbolIndex) {\n        textBlock.Inlines.Add(text.Substring(index, symbolIndex - index));\n      }\n\n      textBlock.Inlines.Add(new Run(symbolName) {\n        FontWeight = FontWeights.Bold\n      });\n\n      index = symbolIndex + symbolName.Length;\n    }\n\n    // Append remaining text at the end.\n    if (index < text.Length) {\n      textBlock.Inlines.Add(text.Substring(index, text.Length - index));\n    }\n\n    return (textBlock, text);\n  }\n\n  private static string GeneratePreviewText(Reference reference, ReadOnlyMemory<char> documentText) {\n    return DocumentUtils.GenerateElementPreviewText(reference.Element, documentText);\n  }\n\n  private void CreateOnDemandPreview() {\n    if (preview_ == null) {\n      (preview_, previewText_) = CreatePreviewTextBlock(operand_, Info, documentText_);\n    }\n  }\n}\n\n[ProtoContract]\npublic class ReferencePanelState {\n  [ProtoMember(2)]\n  public bool IsFindAll;\n  [ProtoMember(3)]\n  public bool HasPinnedContent;\n  [ProtoMember(4)]\n  public ReferenceKind FilterKind;\n  [ProtoMember(1)]\n  private IRElementReference elementRef_;\n\n  public IRElement Element {\n    get => elementRef_;\n    set => elementRef_ = value;\n  }\n}\n\npublic partial class ReferencesPanel : ToolPanelControl, INotifyPropertyChanged {\n  private ReadOnlyMemory<char> documentText_;\n  private IRElement element_;\n  private ReferenceKind filterKind_;\n  private bool ignoreNextElement_;\n  private IRDocumentPopup previewPopup_;\n  private DelayedAction removeHoveredAction_;\n  private List<ReferenceInfo> referenceList_;\n  private ListCollectionView referenceListView_;\n  private ReferenceSummary referenceSummary_;\n  private IRTextSection section_;\n\n  public ReferencesPanel() {\n    InitializeComponent();\n    DataContext = this;\n    MouseLeave += OnMouseLeave;\n\n    //? TODO: Replace with PopupHoverPreview\n    var hover = new MouseHoverLogic(this);\n    hover.MouseHover += Hover_MouseHover;\n    hover.MouseHoverStopped += Hover_MouseHoverStopped;\n  }\n\n  public ReferenceKind FilterKind {\n    get => filterKind_;\n    set {\n      if (filterKind_ != value) {\n        filterKind_ = value;\n        OnPropertyChange(nameof(FilterKind));\n        OnPropertyChange(nameof(ShowLoad));\n        OnPropertyChange(nameof(ShowStore));\n        OnPropertyChange(nameof(ShowAddress));\n        OnPropertyChange(nameof(ShowSSA));\n        referenceListView_?.Refresh();\n      }\n    }\n  }\n\n  public ReferenceSummary ReferenceSummary {\n    get => referenceSummary_;\n    set {\n      if (referenceSummary_ != value) {\n        referenceSummary_ = value;\n        OnPropertyChange(nameof(LoadCount));\n        OnPropertyChange(nameof(StoreCount));\n        OnPropertyChange(nameof(AddressCount));\n        OnPropertyChange(nameof(SSACount));\n      }\n    }\n  }\n\n  public int LoadCount => referenceSummary_?.LoadCount ?? 0;\n  public int StoreCount => referenceSummary_?.StoreCount ?? 0;\n  public int AddressCount => referenceSummary_?.AddressCount ?? 0;\n  public int SSACount => referenceSummary_?.SSACount ?? 0;\n\n  public bool ShowLoad {\n    get => filterKind_.HasFlag(ReferenceKind.Load);\n    set => SetFilterFlag(ReferenceKind.Load, value);\n  }\n\n  public bool ShowStore {\n    get => filterKind_.HasFlag(ReferenceKind.Store);\n    set => SetFilterFlag(ReferenceKind.Store, value);\n  }\n\n  public bool ShowAddress {\n    get => filterKind_.HasFlag(ReferenceKind.Address);\n    set => SetFilterFlag(ReferenceKind.Address, value);\n  }\n\n  public bool ShowSSA {\n    get => filterKind_.HasFlag(ReferenceKind.SSA);\n    set => SetFilterFlag(ReferenceKind.SSA, value);\n  }\n\n  public IRElement Element {\n    get => element_;\n    set {\n      if (ignoreNextElement_) {\n        ignoreNextElement_ = false;\n        return;\n      }\n\n      var operand = FindReferenceOperand(value);\n\n      if (element_ != operand) {\n        if (operand != null && HasPinnedContent) {\n          return; // Keep pinned element.\n        }\n\n        element_ = operand;\n        FindAllReferences(operand, true, false);\n      }\n    }\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.References;\n  public override HandledEventKind HandledEvents => HandledEventKind.ElementSelection;\n\n  public override bool HasPinnedContent {\n    get => FixedToolbar.IsPinned;\n    set => FixedToolbar.IsPinned = value;\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void OnPropertyChange(string propertyName) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  public bool FindAllReferences(IRElement element, bool alwaysShowSSAUses, bool pinElement = true) {\n    if (element is not OperandIR operand) {\n      ResetReferenceListView();\n      return false;\n    }\n\n    //? TODO: There should be an option to pick default behavior for SSA values\n    //?  - if SSA def, show only SSA uses\n    //?  - or always show all refs\n\n    // Enabled the filters.\n    // if (alwaysShowSSAUses) {\n    //   FilterKind |= ReferenceKind.SSA;\n    // }\n    FilterKind = ReferenceKind.Address | ReferenceKind.Load | ReferenceKind.Store;\n\n    var refFinder = new ReferenceFinder(Document.Function);\n    var operandRefs = refFinder.FindAllReferences(operand);\n    UpdateReferenceListView(operand, operandRefs);\n\n    FixedToolbar.IsPinned = pinElement;\n    return operandRefs.Count > 0;\n  }\n\n  public void InitializeFromDocument(IRDocument document) {\n    if (Document != document ||\n        section_ != document.Section) {\n      Document = document;\n      documentText_ = document.SectionText; // Cache text.\n      section_ = document.Section;\n      Element = null;\n    }\n  }\n\n  private OperandIR FindReferenceOperand(IRElement value) {\n    // Only operands can have references.\n    // For instrs. use the first destination operand.\n    if (value is OperandIR operand) {\n      return operand;\n    }\n\n    if (value is InstructionIR instr &&\n        instr.Destinations.Count > 0) {\n      return instr.Destinations[0];\n    }\n\n    return null;\n  }\n\n  private bool FilterReferenceList(object value) {\n    var refInfo = value as ReferenceInfo;\n    return filterKind_.HasFlag(refInfo.Info.Kind);\n  }\n\n  private void UpdateReferenceListView(OperandIR operand, List<Reference> operandRefs) {\n    referenceList_ = new List<ReferenceInfo>(operandRefs.Count);\n    var summary = new ReferenceSummary();\n    int index = 1;\n\n    // Sort based on the ref. element text offset.\n    operandRefs.Sort((a, b) => a.Element.TextLocation.Offset - b.Element.TextLocation.Offset);\n\n    foreach (var reference in operandRefs) {\n      referenceList_.Add(new ReferenceInfo(index, operand, reference, documentText_));\n      index++;\n\n      switch (reference.Kind) {\n        case ReferenceKind.Address:\n          summary.AddressCount++;\n          break;\n        case ReferenceKind.Load:\n          summary.LoadCount++;\n          break;\n        case ReferenceKind.Store:\n          summary.StoreCount++;\n          break;\n        case ReferenceKind.SSA:\n          summary.SSACount++;\n          break;\n        default:\n          throw new ArgumentOutOfRangeException();\n      }\n    }\n\n    referenceListView_ = new ListCollectionView(referenceList_);\n    referenceListView_.Filter = FilterReferenceList;\n    ReferenceList.ItemsSource = referenceListView_;\n    ReferenceSummary = summary;\n\n    if (operand != null) {\n      SymbolName.Text = Utils.GetSymbolName(operand);\n    }\n    else {\n      SymbolName.Text = \"\";\n    }\n  }\n\n  private void ResetReferenceListView() {\n    section_ = null;\n    element_ = null;\n    HasPinnedContent = false;\n    ReferenceList.ItemsSource = null;\n    ReferenceSummary = null;\n    SymbolName.Text = \"\";\n  }\n\n  private void ComboBox_Loaded(object sender, RoutedEventArgs e) {\n    if (sender is ComboBox control) {\n      Utils.PatchComboBoxStyle(control);\n    }\n  }\n\n  private void JumpToReferenceExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var refInfo = e.Parameter as ReferenceInfo;\n    JumpToReference(refInfo);\n  }\n\n  private void MarkReferenceExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (ReferenceList.SelectedItem is ReferenceInfo refInfo) {\n      var color = ((SelectedColorEventArgs)e.Parameter).SelectedColor;\n      Document.MarkElement(refInfo.Info.Element, color);\n    }\n  }\n\n  private void UnmarkReferenceExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var refInfo = ReferenceList.SelectedItem as ReferenceInfo;\n\n    if (refInfo != null) {\n      Document.ClearMarkedElement(refInfo.Info.Element);\n    }\n  }\n\n  private void CopyToClipboardExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (referenceList_ == null) {\n      return;\n    }\n\n    var sb = new StringBuilder();\n    sb.AppendLine($\"References for symbol: {SymbolName.Text}\");\n    sb.AppendLine($\"  SSA uses: {referenceSummary_.SSACount}\");\n    sb.AppendLine($\"  Load uses: {referenceSummary_.LoadCount}\");\n    sb.AppendLine($\"  Store uses: {referenceSummary_.StoreCount}\");\n    sb.AppendLine($\"  Address uses: {referenceSummary_.AddressCount}\");\n\n    foreach (var refInfo in referenceList_) {\n      sb.AppendLine($\"# {refInfo.Index}: {refInfo.Kind}, block {refInfo.Block}\");\n      sb.AppendLine($\"    {refInfo.PreviewText}\");\n    }\n\n    Clipboard.SetText(sb.ToString());\n  }\n\n  private void ListViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    var refInfo = ((ListViewItem)sender).DataContext as ReferenceInfo;\n    JumpToReference(refInfo);\n  }\n\n  private void JumpToReference(ReferenceInfo refInfo) {\n    ignoreNextElement_ = true;\n    Document.SelectElement(refInfo.Info.Element);\n    Document.BringElementIntoView(refInfo.Info.Element);\n  }\n\n  private async Task ShowPreviewPopup(IRElement element, UIElement relativeElement) {\n    if (previewPopup_ != null) {\n      if (previewPopup_.PreviewedElement == element) {\n        return;\n      }\n\n      HidePreviewPopup(true);\n    }\n\n    if (removeHoveredAction_ != null) {\n      removeHoveredAction_.Cancel();\n      removeHoveredAction_ = null;\n    }\n\n    var position = Mouse.GetPosition(relativeElement).AdjustForMouseCursor();\n    previewPopup_ = await IRDocumentPopup.CreateNew(Document, element, position,\n                                                    relativeElement,\n                                                    App.Settings.GetElementPreviewPopupSettings(\n                                                      ToolPanelKind.References),\n                                                    \"Use of \");\n    previewPopup_.PopupDetached += Popup_PopupDetached;\n    previewPopup_.ShowPopup();\n  }\n\n  private void HidePreviewPopup(bool force = false) {\n    if (previewPopup_ != null && (force || !previewPopup_.IsMouseOver)) {\n      previewPopup_.ClosePopup();\n      previewPopup_ = null;\n    }\n  }\n\n  private void Popup_PopupDetached(object sender, EventArgs e) {\n    var popup = (IRDocumentPopup)sender;\n\n    if (popup == previewPopup_) {\n      previewPopup_ = null; // Prevent automatic closing.\n    }\n  }\n\n  private void OnMouseLeave(object sender, MouseEventArgs e) {\n    HidePreviewPopup();\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private void PanelToolbarTray_SettingsClicked(object sender, EventArgs e) {\n    MessageBox.Show(\"TODO\");\n  }\n\n  private void PanelToolbarTray_PinnedChanged(object sender, PinEventArgs e) {\n    HasPinnedContent = e.IsPinned;\n  }\n\n  private void PanelToolbarTray_DuplicateClicked(object sender, DuplicateEventArgs e) {\n    Session.DuplicatePanel(this, e.Kind);\n  }\n\n  private void FixedToolbar_BindMenuOpen(object sender, BindMenuItemsArgs e) {\n    Session.PopulateBindMenu(this, e);\n  }\n\n  private void FixedToolbar_BindMenuItemSelected(object sender, BindMenuItem e) {\n    Session.BindToDocument(this, e);\n  }\n\n  private bool SetFilterFlag(ReferenceKind flag, bool value) {\n    if (value && !FilterKind.HasFlag(flag)) {\n      FilterKind |= flag;\n      return true;\n    }\n\n    if (!value && FilterKind.HasFlag(flag)) {\n      FilterKind &= ~flag;\n      return true;\n    }\n\n    return false;\n  }\n\n  private async void Hover_MouseHover(object sender, MouseEventArgs e) {\n    var hoveredItem = Utils.FindPointedListViewItem(ReferenceList);\n\n    if (hoveredItem != null) {\n      var refInfo = (ReferenceInfo)hoveredItem.DataContext;\n      await ShowPreviewPopup(refInfo.Info.Element, hoveredItem);\n    }\n  }\n\n  private void Hover_MouseHoverStopped(object sender, MouseEventArgs e) {\n    HidePreviewPopupDelayed();\n  }\n\n  private void HidePreviewPopupDelayed() {\n    removeHoveredAction_ = DelayedAction.StartNew(() => {\n      if (removeHoveredAction_ != null) {\n        removeHoveredAction_ = null;\n        HidePreviewPopup();\n      }\n    });\n  }\n\n  public override async Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    if (section == section_) {\n      return;\n    }\n\n    InitializeFromDocument(document);\n    object data = Session.LoadPanelState(this, section, document);\n    var state = UIStateSerializer.Deserialize<ReferencePanelState>(data, document.Function);\n\n    if (state != null) {\n      FindAllReferences(state.Element, !state.IsFindAll);\n      HasPinnedContent = state.HasPinnedContent;\n      FilterKind = state.FilterKind;\n    }\n    else {\n      ResetReferenceListView();\n    }\n\n    IsPanelEnabled = document != null;\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    if (element_ == null || section_ != section) {\n      return;\n    }\n\n    var state = new ReferencePanelState();\n    state.Element = Element;\n    state.HasPinnedContent = HasPinnedContent;\n    state.FilterKind = FilterKind;\n    byte[] data = UIStateSerializer.Serialize(state, document.Function);\n    Session.SavePanelState(data, this, section, Document);\n\n    ResetReferenceListView();\n    Document = null;\n  }\n\n  public override void OnSessionEnd() {\n    ResetReferenceListView();\n    base.OnSessionEnd();\n  }\n\n  public override void OnElementSelected(IRElementEventArgs e) {\n    Element = e.Element;\n  }\n\n  public override void ClonePanel(IToolPanel sourcePanel) {\n    var sourceRefPanel = sourcePanel as ReferencesPanel;\n    Document = sourceRefPanel.Document;\n    documentText_ = sourceRefPanel.documentText_;\n    IsPanelEnabled = Document != null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ScriptingPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.ScriptingPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:ScriptingCommand.ExecuteScript\"\n      Executed=\"ExecuteScriptExecuted\" />\n  </local:ToolPanelControl.CommandBindings>\n\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <DockPanel\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <ToolBarTray\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <Button\n            Command=\"local:ScriptingCommand.ExecuteScript\"\n            CommandTarget=\"{Binding ElementName=TextView}\"\n            ToolTip=\"Execute script (Ctrl+Return)\">\n            <Image Source=\"{StaticResource ExecuteIcon}\" />\n          </Button>\n        </ToolBar>\n      </ToolBarTray>\n\n      <local:PanelToolbarTray\n        DockPanel.Dock=\"Right\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        HasPinButton=\"False\" />\n    </DockPanel>\n\n    <Grid\n      Grid.Row=\"2\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"3*\" />\n        <RowDefinition Height=\"2\" />\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n\n      <avalonEdit:TextEditor\n        xmlns:avalonEdit=\"http://icsharpcode.net/sharpdevelop/avalonedit\"\n        x:Name=\"TextView\"\n        Grid.Row=\"0\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n        FontFamily=\"Consolas\"\n        FontSize=\"12\"\n        ShowLineNumbers=\"True\"\n        SyntaxHighlighting=\"C#\" />\n\n      <GridSplitter\n        Grid.Row=\"1\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        ResizeBehavior=\"PreviousAndNext\" />\n\n      <avalonEdit:TextEditor\n        xmlns:avalonEdit=\"http://icsharpcode.net/sharpdevelop/avalonedit\"\n        x:Name=\"OutputTextView\"\n        Grid.Row=\"2\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        FontFamily=\"Consolas\"\n        FontSize=\"12\"\n        HorizontalScrollBarVisibility=\"Auto\"\n        VerticalScrollBarVisibility=\"Auto\" />\n    </Grid>\n  </Grid>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ScriptingPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.CodeCompletion;\nusing ICSharpCode.AvalonEdit.Editing;\nusing Microsoft.CodeAnalysis;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Scripting;\n\nnamespace ProfileExplorer.UI;\n\npublic static class ScriptingCommand {\n  public static readonly RoutedUICommand ExecuteScript = new(\"Untitled\", \"ExecuteScript\", typeof(BookmarksPanel));\n}\n\npublic class CompletionWindowEx : CompletionWindow {\n  public CompletionWindowEx(TextArea textArea) : base(textArea) {\n  }\n\n  public void SetInitialWidth(double width) {\n    Width = Math.Clamp(width, 100, TextArea.ActualWidth);\n  }\n\n  public void SetStartOffset(TextArea textArea) {\n    StartOffset = EndOffset = textArea.Caret.Offset;\n  }\n\n  public void AdjustStartOffset(string currentWord) {\n    StartOffset -= currentWord.Length;\n  }\n\n  public void PreselectItem(string text) {\n    CompletionList.IsFiltering = false; // Disable filtering to still show complete list.\n    CompletionList.SelectItem(text);\n    CompletionList.ScrollIntoView(CompletionList.SelectedItem);\n  }\n}\n\npublic partial class ScriptingPanel : ToolPanelControl {\n  private const int SyntaxErrorHighlightingDelay = 1;\n  private static readonly string InitialScript =\n    string.Join(Environment.NewLine,\n                \"using System;\",\n                \"using System.Collections.Generic;\",\n                \"using System.Windows.Media;\",\n                \"using ProfileExplorer.Core;\", \"using ProfileExplorer.Core.IR;\",\n                \"using ProfileExplorer.Core.Analysis;\",\n                \"using ProfileExplorer.UI;\",\n                \"using ProfileExplorer.UI.Scripting;\",\n                \"\\n\",\n                \"public class Script {\",\n                \"    // s: provides script interaction with Profile Explorer (text output, marking, etc.)\",\n                \"    public bool Execute(ScriptSession s) {\",\n                \"        // Write C#-based script here.\",\n                \"        return true;\",\n                \"    }\",\n                \"}\");\n  private CompletionWindowEx completionWindow_;\n  private int currentAutocompleteHash_;\n  private ScriptAutoComplete autoComplete_;\n  private ElementHighlighter errorHighlighter_;\n  private DelayedAction errorHighlightingAction_;\n  private List<Diagnostic> errorDiagnostics_;\n  private ToolTip errorTooltip_;\n\n  public ScriptingPanel() {\n    InitializeComponent();\n    autoComplete_ = new ScriptAutoComplete();\n\n    errorHighlighter_ = new ElementHighlighter(HighlighingType.Marked);\n    TextView.TextArea.TextEntered += TextArea_TextEntered;\n    TextView.TextArea.KeyUp += TextArea_KeyUp;\n    TextView.MouseHover += TextView_MouseHover;\n    TextView.MouseHoverStopped += TextView_MouseHoverStopped;\n    TextView.TextArea.TextView.BackgroundRenderers.Add(errorHighlighter_);\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Scripting;\n\n  private void TextView_MouseHoverStopped(object sender, MouseEventArgs e) {\n    if (errorTooltip_ != null) {\n      errorTooltip_.IsOpen = false;\n      errorTooltip_ = null;\n      e.Handled = true;\n    }\n  }\n\n  private void TextView_MouseHover(object sender, MouseEventArgs e) {\n    if (errorDiagnostics_ == null) {\n      return;\n    }\n\n    var position = TextView.TextArea.TextView.GetPositionFloor(e.GetPosition(TextView.TextArea.TextView) +\n                                                               TextView.TextArea.TextView.ScrollOffset);\n\n    if (!position.HasValue) {\n      return;\n    }\n\n    var logicalPosition = position.Value.Location;\n    int offset = TextView.Document.GetOffset(logicalPosition);\n\n    foreach (var error in errorDiagnostics_) {\n      if (offset >= error.Location.SourceSpan.Start &&\n          offset <= error.Location.SourceSpan.End) {\n        errorTooltip_ = new ToolTip();\n        errorTooltip_.Closed += ErrorTooltip__Closed;\n        errorTooltip_.PlacementTarget = TextView;\n        errorTooltip_.Content = new TextBlock {\n          Text = error.ToString(),\n          TextWrapping = TextWrapping.Wrap\n        };\n\n        errorTooltip_.IsOpen = true;\n        e.Handled = true;\n        break;\n      }\n    }\n  }\n\n  private void ErrorTooltip__Closed(object sender, RoutedEventArgs e) {\n    if (errorTooltip_ != null) {\n      errorTooltip_.IsOpen = false;\n    }\n  }\n\n  private async void TextArea_KeyUp(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Back || e.Key == Key.Delete) {\n      ClearSyntaxErrorHighlighting();\n\n      e.Handled = true;\n      await HandleTextChange(TextView.Text, \"\");\n    }\n  }\n\n  private async Task HandleTextChange(string text, string changedText) {\n    //? TODO: More efficient ways of getting the text\n    // https://stackoverflow.com/questions/39422126/whats-the-right-way-to-update-roslyns-document-while-typing\n    // https://stackoverflow.com/questions/39421668/whats-the-most-efficient-way-to-use-roslyns-completionsevice-when-typing\n\n    // Get the list of autocomplete items.\n    int position = TextView.CaretOffset;\n    string word = ScriptAutoComplete.GetCurrentWord(text, position - 1);\n    var results = await autoComplete_.GetSuggestionsAsync(text, position, changedText);\n\n    if (results.Count == 0) {\n      HideAutocompleteBox();\n    }\n\n    // If it's the same list as before, keep  the current autocomplete box.\n    int hash = ComputeAutcompleteHash(results);\n\n    if (hash == currentAutocompleteHash_) {\n      return;\n    }\n\n    currentAutocompleteHash_ = hash;\n    ShowAutocompleteBox(results, word);\n  }\n\n  private void ShowAutocompleteBox(List<AutocompleteEntry> results, string word) {\n    // Reuse the existing auto-complete box if still visible, removes UI flickering\n    // that happens if a new box is always created to replace the old one.\n    bool newWindow = false;\n\n    if (completionWindow_ == null) {\n      completionWindow_ = new CompletionWindowEx(TextView.TextArea);\n      newWindow = true;\n    }\n    else {\n      completionWindow_.CompletionList.CompletionData.Clear();\n      completionWindow_.SetStartOffset(TextView.TextArea);\n    }\n\n    // Make the box wide enough to avoid horizontal scrolling.\n    string longestText = results.OrderByDescending(s => s.Text.Length).First().Text;\n    completionWindow_.SetInitialWidth(longestText.Length * 10);\n\n    // Populate window and check if an item is preferred and should be preselected.\n    string preferredItem = null;\n\n    foreach (var item in results) {\n      completionWindow_.CompletionList.CompletionData.Add(item);\n\n      if (item.IsPreferred) {\n        preferredItem = item.Text;\n      }\n    }\n\n    // Offset the start position so that the current word gets replaced\n    // when a suggestion is selected.\n    completionWindow_.AdjustStartOffset(word);\n\n    if (preferredItem != null) {\n      completionWindow_.PreselectItem(preferredItem);\n    }\n    else {\n      // Preselect first result if there was no preferred item.\n      string firstItem = results.First().Text;\n\n      if (firstItem.StartsWith(word, StringComparison.OrdinalIgnoreCase)) {\n        completionWindow_.PreselectItem(firstItem);\n      }\n    }\n\n    if (newWindow) {\n      completionWindow_.Closed += delegate {\n        completionWindow_ = null;\n        currentAutocompleteHash_ = 0;\n      };\n\n      completionWindow_.CloseAutomatically = false;\n      completionWindow_.Show();\n    }\n  }\n\n  private async void TextArea_TextEntered(object sender, TextCompositionEventArgs e) {\n    ClearSyntaxErrorHighlighting();\n\n    e.Handled = true;\n    string text = TextView.Text;\n    string changedText = e.Text;\n    await HandleTextChange(text, changedText).ConfigureAwait(false);\n\n    if (changedText == \".\") {\n      return;\n    }\n\n    // Start a task that checks for syntax errors after a delay.\n    if (errorHighlightingAction_ != null) {\n      errorHighlightingAction_.Cancel();\n      errorHighlightingAction_ = null;\n    }\n\n    var action = new DelayedAction();\n    errorHighlightingAction_ = action;\n\n    await action.Start(TimeSpan.FromSeconds(SyntaxErrorHighlightingDelay), async () => {\n      var errors = await autoComplete_.GetSourceErrorsAsync(text);\n      errorDiagnostics_ = errors;\n\n      await Dispatcher.BeginInvoke((Action)(() => {\n        ClearSyntaxErrorHighlighting();\n        var group = new HighlightedElementGroup(new HighlightingStyle(Colors.Red, 0.1, ColorPens.GetPen(Colors.Red)));\n\n        foreach (var error in errors) {\n          if (error.Location.SourceSpan.Length > 0) {\n            //? TODO: Have a highlighter that doesn't need making dummy IR elements...\n            var element = CreateDummyElement(error.Location.SourceSpan.Start, error.Location.SourceSpan.Length);\n            group.Add(element);\n          }\n        }\n\n        errorHighlighter_.Add(group);\n        TextView.TextArea.TextView.Redraw();\n      }));\n    });\n  }\n\n  private void ClearSyntaxErrorHighlighting() {\n    errorHighlighter_.Clear();\n    TextView.TextArea.TextView.Redraw();\n  }\n\n  private IRElement CreateDummyElement(int offset, int length) {\n    int line = TextView.Document.GetLineByOffset(offset).LineNumber;\n    var location = new TextLocation(offset, line, 0);\n    return new IRElement(location, length);\n  }\n\n  private int ComputeAutcompleteHash(List<AutocompleteEntry> sortedData) {\n    int hash = 0;\n\n    foreach (var item in sortedData) {\n      hash = hash * 31 + item.Text.GetHashCode();\n    }\n\n    return hash;\n  }\n\n  private void HideAutocompleteBox() {\n    if (completionWindow_ != null) {\n      completionWindow_.Close();\n      completionWindow_ = null;\n    }\n  }\n\n  private async void ExecuteScriptExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var document = Session.FindAssociatedDocument(this);\n    string userCode = TextView.Text.Trim();\n    var scriptSession = new ScriptSession(document, Session);\n    var script = new Script(userCode);\n\n    try {\n      var sw = Stopwatch.StartNew();\n      string outputText = \"\";\n      bool result = await script.ExecuteAsync(scriptSession);\n      sw.Stop();\n\n      if (!result) {\n        if (script.ScriptException != null) {\n          outputText += $\"Failed to run script: {script.ScriptException}\";\n        }\n      }\n      else {\n        //? TODO: Long-running scripts need a way to update text before this\n        outputText = string.Join(Environment.NewLine,\n                                 $\"Script result: {script.ScriptResult}\",\n                                 $\"Script completed in {sw.ElapsedMilliseconds} ms\",\n                                 \"----------------------------------------\\n\",\n                                 $\"{scriptSession.OutputText}\");\n      }\n\n      OutputTextView.Text = outputText;\n\n      foreach (var pair in scriptSession.MarkedElements) {\n        document.MarkElement(pair.Item1, pair.Item2);\n      }\n    }\n    catch (Exception ex) {\n      OutputTextView.Text = $\"Failed to run script: {ex}\";\n    }\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  public override void OnSessionStart() {\n    base.OnSessionStart();\n    TextView.Text = InitialScript;\n  }\n\n  public override void OnActivatePanel() {\n    base.OnActivatePanel();\n\n    Task.Run(() => Script.WarmUp());\n    Task.Run(() => ScriptAutoComplete.WarmUp());\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SearchResultsPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.SearchResultsPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.JumpToSelected\"\n      Executed=\"JumpToSelectedExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.JumpToNext\"\n      Executed=\"JumpToNextExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.JumpToPrevious\"\n      Executed=\"JumpToPreviousExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.JumpToNextSection\"\n      Executed=\"JumpToNextSectionExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.JumpToPreviousSection\"\n      Executed=\"JumpToPreviousSectionExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.OpenInNewTab\"\n      Executed=\"OpenInNewTabExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.OpenLeft\"\n      Executed=\"OpenLeftExecuted\" />\n    <CommandBinding\n      Command=\"local:SearchResultsCommand.OpenRight\"\n      Executed=\"OpenRightExecuted\" />\n  </local:ToolPanelControl.CommandBindings>\n\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"50\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Grid.Column=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n\n          <TextBlock\n            Visibility=\"Collapsed\"\n            Margin=\"5,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"Section\" />\n          <Button\n            Visibility=\"Collapsed\"\n            Margin=\"4,0,0,0\"\n            Command=\"local:SearchResultsCommand.JumpToPreviousSection\"\n            CommandTarget=\"{Binding ElementName=ResultList}\"\n            ToolTip=\"Jump to previous section results (Ctrl+Shift+F3)\">\n            <Image\n              Source=\"{StaticResource BoldUpArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Button\n            Visibility=\"Collapsed\"\n            Command=\"local:SearchResultsCommand.JumpToNextSection\"\n            CommandTarget=\"{Binding ElementName=ResultList}\"\n            ToolTip=\"Jump to next section results (Ctrl+F3)\">\n            <Image\n              Source=\"{StaticResource BoldDownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Separator Visibility=\"Collapsed\"/>\n\n          <Button\n            Margin=\"4,0,0,0\"\n            Command=\"local:SearchResultsCommand.JumpToPrevious\"\n            CommandTarget=\"{Binding ElementName=ResultList}\"\n            ToolTip=\"Jump to previous result (Shift+F3)\">\n            <Image\n              Source=\"{StaticResource UpArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Button\n            Command=\"local:SearchResultsCommand.JumpToNext\"\n            CommandTarget=\"{Binding ElementName=ResultList}\"\n            ToolTip=\"Jump to next result (F3)\">\n            <Image\n              Source=\"{StaticResource DownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"Results:\" />\n\n          <TextBlock\n            x:Name=\"ResultNumberText\"\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Text=\"\" />\n\n          <TextBlock\n            Margin=\"32,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"Searched text:\"\n            Visibility=\"{Binding HideSearchedText, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n          <TextBlock\n            x:Name=\"SearchedText\"\n            Margin=\"4,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Text=\"\"\n            Visibility=\"{Binding HideSearchedText, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n          <TextBlock\n            Margin=\"32,0,0,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding OptionalText}\" />\n        </ToolBar>\n      </ToolBarTray>\n      <local:PanelToolbarTray\n        Grid.Column=\"1\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"False\"\n        HasPinButton=\"False\"\n        Visibility=\"{Binding HideToolbarTray, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n    </Grid>\n\n    <ListView\n      x:Name=\"ResultList\"\n      Grid.Row=\"1\"\n      Margin=\"0,-1,0,0\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      BorderBrush=\"{x:Null}\"\n      BorderThickness=\"0,0,0,0\"\n      VirtualizingPanel.CacheLengthUnit=\"Item\"\n      VirtualizingPanel.IsVirtualizing=\"True\"\n      VirtualizingStackPanel.CacheLength=\"2,3\"\n      VirtualizingStackPanel.ScrollUnit=\"Item\"\n      VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n      <ListView.View>\n        <GridView>\n          <!-- <GridViewColumn -->\n          <!--   Width=\"300\" -->\n          <!--   DisplayMemberBinding=\"{Binding SectionName}\" -->\n          <!--   Header=\"Section\"> -->\n          <!--   <GridViewColumn.HeaderContainerStyle> -->\n          <!--     <Style TargetType=\"{x:Type GridViewColumnHeader}\"> -->\n          <!--       <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" /> -->\n          <!--     </Style> -->\n          <!--   </GridViewColumn.HeaderContainerStyle> -->\n          <!-- </GridViewColumn> -->\n\n          <GridViewColumn\n            Width=\"40\"\n            DisplayMemberBinding=\"{Binding Index}\"\n            Header=\"#\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"150\"\n            DisplayMemberBinding=\"{Binding FunctionName}\"\n            Header=\"#\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"350\"\n            Header=\"Search result\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <ContentPresenter Content=\"{Binding Preview}\" />\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n        </GridView>\n      </ListView.View>\n      <ListView.ItemContainerStyle>\n        <Style\n          BasedOn=\"{StaticResource FlatListViewItem}\"\n          TargetType=\"{x:Type ListViewItem}\">\n          <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n          <EventSetter\n            Event=\"MouseDoubleClick\"\n            Handler=\"ListViewItem_MouseDoubleClick\" />\n\n          <Style.Triggers>\n            <DataTrigger\n              Binding=\"{Binding Path=IsMarked}\"\n              Value=\"True\">\n              <Setter Property=\"Foreground\" Value=\"{Binding Path=TextColor}\" />\n            </DataTrigger>\n          </Style.Triggers>\n        </Style>\n      </ListView.ItemContainerStyle>\n\n      <ListView.ContextMenu>\n        <ContextMenu>\n          <MenuItem\n            Command=\"local:SearchResultsCommand.OpenInNewTab\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=ResultList}\"\n            Header=\"Open Function in New Tab\"\n            InputGestureText=\"Ctrl+Return\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource OpenExternalIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n\n          <MenuItem\n            Command=\"local:SearchResultsCommand.OpenLeft\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=ResultList}\"\n            Header=\"Open Function in Left Tab\"\n            InputGestureText=\"Ctrl+Left\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource DockLeftIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:SearchResultsCommand.OpenRight\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=ResultList}\"\n            Header=\"Open Function in Right Tab\"\n            InputGestureText=\"Ctrl+Right\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource DockRightIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n        </ContextMenu>\n      </ListView.ContextMenu>\n\n      <ListView.InputBindings>\n        <KeyBinding\n          Key=\"Return\"\n          Command=\"local:SearchResultsCommand.JumpToSelected\"\n          CommandParameter=\"{Binding ElementName=ResultList, Path=SelectedItem}\"\n          CommandTarget=\"{Binding ElementName=ResultList}\" />\n        <KeyBinding\n          Key=\"Return\"\n          Command=\"local:SearchResultsCommand.OpenInNewTab\"\n          CommandParameter=\"{Binding ElementName=ResultList, Path=SelectedItem}\"\n          CommandTarget=\"{Binding ElementName=ResultList}\"\n          Modifiers=\"Ctrl\" />\n      </ListView.InputBindings>\n    </ListView>\n  </Grid>\n\n  <local:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:SearchResultsCommand.JumpToNext\"\n      CommandTarget=\"{Binding ElementName=ResultList}\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:SearchResultsCommand.JumpToPrevious\"\n      CommandTarget=\"{Binding ElementName=ResultList}\"\n      Modifiers=\"Shift\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:SearchResultsCommand.JumpToNextSection\"\n      CommandTarget=\"{Binding ElementName=ResultList}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:SearchResultsCommand.JumpToPreviousSection\"\n      CommandTarget=\"{Binding ElementName=ResultList}\"\n      Modifiers=\"Ctrl+Shift\" />\n\n    <KeyBinding\n      Key=\"Left\"\n      Command=\"local:SearchResultsCommand.OpenLeft\"\n      CommandParameter=\"{Binding ElementName=ResultList, Path=SelectedItem}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Right\"\n      Command=\"local:SearchResultsCommand.OpenRight\"\n      CommandParameter=\"{Binding ElementName=ResultList, Path=SelectedItem}\"\n      Modifiers=\"Ctrl\" />\n  </local:ToolPanelControl.InputBindings>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SearchResultsPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic static class SearchResultsCommand {\n  public static readonly RoutedUICommand JumpToNext = new(\"Untitled\", \"JumpToNext\", typeof(SearchResultsPanel));\n  public static readonly RoutedUICommand JumpToPrevious = new(\"Untitled\", \"JumpToPrevious\", typeof(SearchResultsPanel));\n  public static readonly RoutedUICommand JumpToNextSection =\n    new(\"Untitled\", \"JumpToNextSection\", typeof(SearchResultsPanel));\n  public static readonly RoutedUICommand JumpToPreviousSection =\n    new(\"Untitled\", \"JumpToPreviousSection\", typeof(SearchResultsPanel));\n  public static readonly RoutedUICommand JumpToSelected = new(\"Untitled\", \"JumpToSelected\", typeof(SearchResultsPanel));\n  public static readonly RoutedUICommand OpenInNewTab =\n    new(\"Open section in new tab\", \"OpenInNewTab\", typeof(SearchResultsPanel));\n  public static readonly RoutedUICommand OpenLeft =\n    new(\"Open section in new tab\", \"OpenLeft\", typeof(SearchResultsPanel));\n  public static readonly RoutedUICommand OpenRight =\n    new(\"Open section in new tab\", \"OpenRight\", typeof(SearchResultsPanel));\n}\n\npublic class SearchResultInfo {\n  public delegate Task<string> SectionTextDelegate(SearchResultKind resultKind, IRTextSection section);\n\n  public enum SearchResultKind {\n    SectionResult,\n    BeforeOutputResult,\n    AfterOutputResult\n  }\n\n  private static readonly FontFamily PreviewFont = new(\"Consolas\");\n  private bool isMarked_;\n  private TextBlock preview_;\n  private Brush textColor_;\n  private SectionTextDelegate getSectionText_;\n\n  public SearchResultInfo(SearchResultKind resultkind, int index, TextSearchResult result,\n                          IRTextSection section, IUISession session,\n                          SectionTextDelegate getSectionText) {\n    ResultKind = resultkind;\n    Index = index;\n    Result = result;\n    Section = section;\n    Session = session;\n    getSectionText_ = getSectionText;\n  }\n\n  public SearchResultKind ResultKind { get; set; }\n  public int Index { get; set; }\n  public TextSearchResult Result { get; set; }\n  public IRTextSection Section { get; set; }\n  public IUISession Session { get; set; }\n  public string FunctionName => Section.ParentFunction.FormatFunctionName(Session);\n\n  public TextBlock Preview {\n    get {\n      if (preview_ != null) {\n        return preview_;\n      }\n\n      preview_ = new TextBlock();\n      preview_.FontFamily = PreviewFont;\n      preview_.Foreground = Brushes.Black;\n      preview_.Margin = new Thickness(0, 2, 0, 0);\n\n      // Load text on-demand and extract the line with the result.\n      //? TODO: use NotifyTask https://stackoverflow.com/a/48217792\n      string sectionText = getSectionText_(ResultKind, Section).Result;\n      (int startOffset, int endOffset) = ExtractTextLine(sectionText);\n\n      // Append text before search result.\n      if (startOffset < Result.Offset) {\n        preview_.Inlines.Add(sectionText.Substring(startOffset, Result.Offset - startOffset));\n      }\n\n      // Append search result.\n      preview_.Inlines.Add(new Run(sectionText.Substring(Result.Offset, Result.Length)) {\n        FontWeight = FontWeights.Bold,\n        Background = Brushes.Khaki\n      });\n\n      // Append text after search result.\n      int afterResultOffset = Result.Offset + Result.Length;\n\n      if (endOffset > afterResultOffset) {\n        preview_.Inlines.Add(sectionText.Substring(afterResultOffset, endOffset - afterResultOffset));\n      }\n\n      return preview_;\n    }\n  }\n\n  public string SectionName {\n    get {\n      string name = Session.CompilerInfo.NameProvider.GetSectionName(Section);\n      return $\"({Section.Number}) {name}\";\n    }\n  }\n\n  public Brush TextColor => textColor_;\n\n  public bool IsMarked {\n    get {\n      if (isMarked_) {\n        return true;\n      }\n\n      if (Session.SectionStyleProvider.IsMarkedSection(Section, out var markedName)) {\n        isMarked_ = true;\n        textColor_ = ColorBrushes.GetBrush(markedName.TextColor);\n      }\n\n      return isMarked_;\n    }\n  }\n\n  private bool IsNewLine(char value) {\n    return value == '\\n' || value == '\\r';\n  }\n\n  private (int, int) ExtractTextLine(string sectionText) {\n    // Extract the whole line containing the search result.\n    int startOffset = Result.Offset;\n    int endOffset = Result.Offset + Result.Length;\n\n    while (startOffset > 0) {\n      if (IsNewLine(sectionText[startOffset])) {\n        startOffset++; // Don't include the newline itself.\n        break;\n      }\n\n      startOffset--;\n    }\n\n    while (endOffset < sectionText.Length) {\n      if (IsNewLine(sectionText[endOffset])) {\n        endOffset--;\n        break;\n      }\n\n      endOffset++;\n    }\n\n    return (startOffset, endOffset);\n  }\n}\n\npublic partial class SearchResultsPanel : ToolPanelControl, INotifyPropertyChanged {\n  private SearchInfo searchInfo_;\n  private List<SearchResultInfo> searchResults_;\n  private Dictionary<IRTextSection, SectionSearchResult> searchResultsMap_;\n  private IRTextSection previousSection_;\n  private string previousSectionText_;\n  private string previousSectionBeforeOutput_;\n  private string previousSectionAfterOutput_;\n  private bool hideToolbarTray_;\n  private bool hideSearchedText_;\n  private string optionalText_;\n  private CancelableTaskInstance loadTask_;\n\n  public SearchResultsPanel() {\n    InitializeComponent();\n    DataContext = this;\n    loadTask_ = new CancelableTaskInstance(false);\n  }\n\n  public bool HideToolbarTray {\n    get => hideToolbarTray_;\n    set {\n      if (hideToolbarTray_ != value) {\n        hideToolbarTray_ = value;\n        NotifyPropertyChanged(nameof(HideToolbarTray));\n      }\n    }\n  }\n\n  public bool HideSearchedText {\n    get => hideSearchedText_;\n    set {\n      if (hideSearchedText_ != value) {\n        hideSearchedText_ = value;\n        NotifyPropertyChanged(nameof(HideSearchedText));\n      }\n    }\n  }\n\n  public string OptionalText {\n    get => optionalText_;\n    set {\n      if (optionalText_ != value) {\n        optionalText_ = value;\n        NotifyPropertyChanged(nameof(OptionalText));\n      }\n    }\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.SearchResults;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<OpenSectionEventArgs> OpenSection;\n\n  public void NotifyPropertyChanged(string propertyName) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async void ListViewItem_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    var searchResult = ((ListViewItem)sender).DataContext as SearchResultInfo;\n    await JumpToSearchResult(searchResult);\n  }\n\n  private async Task JumpToSearchResult(SearchResultInfo result) {\n    // If the document is in the middle of switching a section\n    // from the previous jump, wait for it to complete, otherwise\n    // the document text can get out of sync and assert.\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    var documentHost = Session.FindAssociatedDocumentHost(this);\n\n    if (documentHost == null) {\n      // Document may have been closed in the meantime.\n      var args = new OpenSectionEventArgs(result.Section, OpenSectionKind.NewTabDockLeft);\n      documentHost = await Session.SwitchDocumentSectionAsync(args);\n    }\n\n    if (!documentHost.HasSameSearchResultSection(result.Section)) {\n      var searchResults = searchResultsMap_[result.Section];\n      await documentHost.SwitchSearchResultsAsync(searchResults, result.Section, searchInfo_);\n    }\n\n    documentHost.JumpToSearchResult(result.Result, result.Index - 1);\n  }\n\n  private async Task JumpToSelectedSearchResult() {\n    await JumpToSearchResult(ResultList.Items[ResultList.SelectedIndex] as SearchResultInfo);\n  }\n\n  private async void JumpToSelectedExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var result = e.Parameter as SearchResultInfo;\n    await JumpToSearchResult(result);\n    e.Handled = true;\n  }\n\n  private async void JumpToNextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (ResultList.SelectedIndex < ResultList.Items.Count - 1) {\n      ResultList.SelectedIndex++;\n      ResultList.ScrollIntoView(ResultList.SelectedItem);\n      await JumpToSelectedSearchResult();\n      e.Handled = true;\n    }\n  }\n\n  private async void JumpToPreviousExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (ResultList.SelectedIndex > 0) {\n      ResultList.SelectedIndex--;\n      ResultList.ScrollIntoView(ResultList.SelectedItem);\n      await JumpToSelectedSearchResult();\n      e.Handled = true;\n    }\n  }\n\n  private async void JumpToNextSectionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    int index = ResultList.SelectedIndex;\n\n    if (index < 0) {\n      index = 0;\n    }\n\n    if (index < ResultList.Items.Count - 1) {\n      var startSection = searchResults_[index].Section;\n\n      for (++index; index < ResultList.Items.Count; index++) {\n        var section = searchResults_[index].Section;\n\n        if (section != startSection) {\n          ResultList.SelectedItem = searchResults_[index];\n          ResultList.ScrollIntoView(ResultList.SelectedItem);\n          await JumpToSelectedSearchResult();\n          e.Handled = true;\n          break;\n        }\n      }\n    }\n  }\n\n  private async void JumpToPreviousSectionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    int index = ResultList.SelectedIndex;\n\n    if (index > 0) {\n      var startSection = searchResults_[index].Section;\n\n      for (--index; index >= 0; index--) {\n        var section = searchResults_[index].Section;\n\n        if (section != startSection) {\n          ResultList.SelectedItem = searchResults_[index];\n          ResultList.ScrollIntoView(ResultList.SelectedItem);\n          await JumpToSelectedSearchResult();\n          e.Handled = true;\n          break;\n        }\n      }\n    }\n  }\n\n  private async void OpenInNewTabExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var result = e.Parameter as SearchResultInfo;\n\n    if (result != null) {\n      OpenSection?.Invoke(this, new OpenSectionEventArgs(result.Section, OpenSectionKind.NewTab));\n      await JumpToSearchResult(result);\n    }\n  }\n\n  private async void OpenLeftExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var result = e.Parameter as SearchResultInfo;\n\n    if (result != null) {\n      OpenSection?.Invoke(this, new OpenSectionEventArgs(result.Section, OpenSectionKind.NewTabDockLeft));\n      await JumpToSearchResult(result);\n    }\n  }\n\n  private async void OpenRightExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var result = e.Parameter as SearchResultInfo;\n\n    if (result != null) {\n      OpenSection?.Invoke(this, new OpenSectionEventArgs(result.Section, OpenSectionKind.NewTabDockRight));\n      await JumpToSearchResult(result);\n    }\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    await base.OnDocumentSectionUnloaded(section, document);\n    ResetSectionTextCache();\n  }\n\n  public void UpdateSearchResults(List<SectionSearchResult> results, SearchInfo searchInfo) {\n    searchResults_ = new List<SearchResultInfo>(8192);\n    searchResultsMap_ = new Dictionary<IRTextSection, SectionSearchResult>(results.Count);\n    searchInfo_ = searchInfo;\n\n    foreach (var sectionResult in results) {\n      searchResultsMap_[sectionResult.Section] = sectionResult;\n      int index = 1;\n\n      foreach (var result in sectionResult.Results) {\n        AddSearchResult(sectionResult, index, result,\n                        SearchResultInfo.SearchResultKind.SectionResult);\n        index++;\n      }\n\n      if (sectionResult.BeforeOutputResults != null) {\n        foreach (var result in sectionResult.BeforeOutputResults) {\n          AddSearchResult(sectionResult, index, result,\n                          SearchResultInfo.SearchResultKind.BeforeOutputResult);\n          index++;\n        }\n      }\n\n      if (sectionResult.AfterOutputResults != null) {\n        foreach (var result in sectionResult.AfterOutputResults) {\n          AddSearchResult(sectionResult, index, result,\n                          SearchResultInfo.SearchResultKind.AfterOutputResult);\n          index++;\n        }\n      }\n    }\n\n    UpdateResultList(searchInfo.SearchedText, searchResults_);\n    ResetSectionTextCache();\n  }\n\n  private void AddSearchResult(SectionSearchResult sectionResult, int index, TextSearchResult result,\n                               SearchResultInfo.SearchResultKind resultKind) {\n    var resultInfo = new SearchResultInfo(resultKind, index++, result,\n                                          sectionResult.Section, Session, GetSectionText);\n    searchResults_.Add(resultInfo);\n  }\n\n  private async Task<string> GetSectionText(SearchResultInfo.SearchResultKind resultKind, IRTextSection section) {\n    switch (resultKind) {\n      case SearchResultInfo.SearchResultKind.SectionResult: {\n        if (previousSection_ == section &&\n            previousSectionText_ != null) {\n          return previousSectionText_;\n        }\n\n        string text = await Session.GetSectionTextAsync(section).ConfigureAwait(false);\n        previousSection_ = section;\n        previousSectionText_ = text;\n        return text;\n      }\n      case SearchResultInfo.SearchResultKind.BeforeOutputResult: {\n        if (previousSection_ == section &&\n            previousSectionBeforeOutput_ != null) {\n          return previousSectionBeforeOutput_;\n        }\n\n        string text = await Session.GetSectionOutputTextAsync(section.OutputBefore, section).ConfigureAwait(false);\n        previousSection_ = section;\n        previousSectionBeforeOutput_ = text;\n        return text;\n      }\n      case SearchResultInfo.SearchResultKind.AfterOutputResult: {\n        if (previousSection_ == section &&\n            previousSectionAfterOutput_ != null) {\n          return previousSectionAfterOutput_;\n        }\n\n        string text = await Session.GetSectionOutputTextAsync(section.OutputAfter, section).ConfigureAwait(false);\n        previousSection_ = section;\n        previousSectionAfterOutput_ = text;\n        return text;\n      }\n    }\n\n    return string.Empty;\n  }\n\n  private void ResetSectionTextCache() {\n    previousSection_ = null;\n    previousSectionText_ = null;\n    previousSectionBeforeOutput_ = null;\n    previousSectionAfterOutput_ = null;\n  }\n\n  public void ClearSearchResults() {\n    UpdateResultList(\"\", new List<SearchResultInfo>());\n  }\n\n  private void UpdateResultList(string searchedText, List<SearchResultInfo> searchResults) {\n    searchResults_ = searchResults;\n    ResultList.ItemsSource = new ListCollectionView(searchResults_);\n    ResultNumberText.Text = searchResults_.Count.ToString();\n    SearchedText.Text = searchedText;\n\n    if (ResultList.Items.Count > 0) {\n      ResultList.ScrollIntoView(ResultList.Items[0]);\n    }\n  }\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    ClearSearchResults();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SectionPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.SectionPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"1200\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:Command.ClearTextbox\"\n      Executed=\"ExecuteClearTextbox\" />\n    <CommandBinding\n      Command=\"local:Command.OpenInNewTab\"\n      Executed=\"OpenInNewTabExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.OpenLeft\"\n      Executed=\"OpenLeftExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.OpenRight\"\n      Executed=\"OpenRightExecuted\" />\n    <CommandBinding\n      CanExecute=\"OpenSideBySideCanExecute\"\n      Command=\"local:Command.OpenSideBySide\"\n      Executed=\"OpenSideBySideExecuted\" />\n    <CommandBinding\n      CanExecute=\"OpenSideBySideCanExecute\"\n      Command=\"local:Command.DiffSideBySide\"\n      Executed=\"DiffSideBySideExecuted\" />\n    <CommandBinding\n      CanExecute=\"DiffWithOtherDocumentCanExecute\"\n      Command=\"local:Command.DiffWithOtherDocument\"\n      Executed=\"DiffWithOtherDocumentExecuted\" />\n    <CommandBinding\n      CanExecute=\"DiffWithOtherDocumentCanExecute\"\n      Command=\"local:Command.SyncDiffedDocuments\"\n      Executed=\"SyncDiffedDocumentsExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.Open\"\n      Executed=\"OpenExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.ToggleTag\"\n      Executed=\"ToggleTagExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.PreviousSection\"\n      Executed=\"PreviousSectionExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.NextSection\"\n      Executed=\"NextSectionExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.FocusSearch\"\n      Executed=\"FocusSearchExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.CopySectionText\"\n      Executed=\"CopySectionTextExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.SaveSectionText\"\n      Executed=\"SaveSectionTextExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.SaveFunctionText\"\n      Executed=\"SaveFunctionTextExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.CopyFunctionText\"\n      Executed=\"CopyFunctionTextExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.OpenDocumentInEditor\"\n      Executed=\"OpenDocumentInEditorExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.OpenDocumentInNewInstance\"\n      Executed=\"OpenDocumentInNewInstanceExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.DisplayCallGraph\"\n      Executed=\"DisplayCallGraphExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.DisplayPartialCallGraph\"\n      Executed=\"DisplayPartialCallGraphExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.CopyFunctionName\"\n      Executed=\"CopyFunctionNameExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.CopyDemangledFunctionName\"\n      Executed=\"CopyDemangledFunctionNameExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.ExportFunctionList\"\n      Executed=\"ExportFunctionListExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.CopyFunctionDetails\"\n      Executed=\"CopyFunctionDetailsExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.ExportFunctionListHtml\"\n      Executed=\"ExportFunctionListHtmlExecuted\" />\n    <CommandBinding\n      Command=\"local:Command.ExportFunctionListMarkdown\"\n      Executed=\"ExportFunctionListMarkdownExecuted\" />\n  </local:ToolPanelControl.CommandBindings>\n\n  <local:ToolPanelControl.Resources>\n    <Style\n      x:Key=\"IconTagged\"\n      TargetType=\"Image\">\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsTagged}\"\n          Value=\"False\">\n          <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"IconDifferentFromPrevious\"\n      TargetType=\"Image\">\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsDiffFromPrevious}\"\n          Value=\"False\">\n          <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"IconSelected\"\n      TargetType=\"Image\">\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsSelected}\"\n          Value=\"False\">\n          <Setter Property=\"Visibility\" Value=\"Hidden\" />\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"ColumnsGridSplitterStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"2\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding IsSectionListVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"ModulesColumnsGridSplitterStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"2\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding ModuleControlsVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"ModulesColumnsStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"210\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding ShowModules}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"FunctionsColumnsStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"*\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding IsFunctionListVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"SectionsColumnsStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"2*\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding IsSectionListVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n        <DataTrigger\n          Binding=\"{Binding ProfileControlsVisible}\"\n          Value=\"True\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"*\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n  </local:ToolPanelControl.Resources>\n\n  <Grid\n    x:Name=\"MainGrid\"\n    HorizontalAlignment=\"Stretch\"\n    VerticalAlignment=\"Stretch\">\n    <Grid.ColumnDefinitions>\n      <ColumnDefinition Style=\"{StaticResource FunctionsColumnsStyle}\" />\n      <ColumnDefinition Style=\"{StaticResource ColumnsGridSplitterStyle}\" />\n      <ColumnDefinition Style=\"{StaticResource SectionsColumnsStyle}\" />\n    </Grid.ColumnDefinitions>\n\n    <Grid\n      x:Name=\"FunctionPart\"\n      Grid.Column=\"0\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"28\" />\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n\n      <Grid Grid.Row=\"0\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"45\" />\n        </Grid.ColumnDefinitions>\n        <ToolBarTray\n          Name=\"FunctionToolbarTray\"\n          Grid.Column=\"0\"\n          Height=\"28\"\n          Margin=\"0,0,24,0\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          IsLocked=\"True\"\n          Visibility=\"{Binding IsFunctionListVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <ToolBar\n            Name=\"FunctionToolbar\"\n            Width=\"{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ToolBarTray}}, Path=ActualWidth}\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Top\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            Loaded=\"ToolBar_Loaded\"\n            SizeChanged=\"ToolBar_SizeChanged\">\n            <ToggleButton\n              Padding=\"4,2,4,2\"\n              HorizontalContentAlignment=\"Stretch\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              Content=\"Modules\"\n              IsChecked=\"{Binding ShowModules, Mode=TwoWay}\"\n              Visibility=\"{Binding ModuleControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n            <ToggleButton\n              Margin=\"-1,0,0,0\"\n              Padding=\"2,2,4,2\"\n              HorizontalContentAlignment=\"Stretch\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              Content=\"Sections\"\n              IsChecked=\"{Binding ShowSections, Mode=TwoWay}\"\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n            <ToggleButton\n              Height=\"20\"\n              Margin=\"4,0,0,0\"\n              Padding=\"0,0,2,0\"\n              BorderThickness=\"0\"\n              IsChecked=\"{Binding Path=SyncSelection, Mode=TwoWay}\"\n              ToolTip=\"Sync function displayed in other profiling views with selection\"\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Margin=\"0,1,0,0\"\n                  Source=\"{StaticResource SwitchIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"2,0,0,0\"\n                  Text=\"Sync\" />\n              </StackPanel>\n            </ToggleButton>\n\n            <ToggleButton\n              Height=\"20\"\n              Margin=\"0,0,0,0\"\n              Padding=\"0,0,2,0\"\n              BorderThickness=\"0\"\n              IsChecked=\"{Binding Path=SyncSourceFile, Mode=TwoWay}\"\n              ToolTip=\"Sync Source File view with selection\"\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <StackPanel Orientation=\"Horizontal\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource SourceIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n                <TextBlock\n                  Margin=\"2,0,0,0\"\n                  Text=\"Source\" />\n              </StackPanel>\n            </ToggleButton>\n\n            <Separator\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n            <Menu\n              Margin=\"0,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <MenuItem\n                Padding=\"0,0,0,0\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                OverridesDefaultStyle=\"True\"\n                ToolTip=\"Export function list\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <TextBlock\n                      Margin=\"2,0,0,0\"\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"Export\" />\n                    <Path\n                      Margin=\"4,2,0,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n                <MenuItem\n                  Command=\"local:Command.ExportFunctionList\"\n                  CommandTarget=\"{Binding ElementName=FunctionList}\"\n                  Header=\"Export as Excel File\"\n                  ToolTip=\"Save the list of functions and additional columns as an Excel worksheet\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource ExcelIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:Command.ExportFunctionListHtml\"\n                  CommandTarget=\"{Binding ElementName=FunctionList}\"\n                  Header=\"Export as HTML File\"\n                  ToolTip=\"Save the list of functions and additional columns as an HTML file\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource SourceIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"local:Command.ExportFunctionListMarkdown\"\n                  CommandTarget=\"{Binding ElementName=FunctionList}\"\n                  Header=\"Export as Markdown File\"\n                  ToolTip=\"Save the list of functions and additional columns as Markdown file\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource DocumentIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <Separator />\n                <MenuItem\n                  Command=\"{Binding CopyAllFunctionsCommand}\"\n                  CommandTarget=\"{Binding ElementName=FunctionList}\"\n                  Header=\"Copy as HTML/Markdown table\"\n                  ToolTip=\"Copy the list of functions and additional columns as an HTML file\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource ClipboardIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n              </MenuItem>\n            </Menu>\n\n            <Separator\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n            <Image\n              Margin=\"2,0,0,0\"\n              Source=\"{StaticResource SearchIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"\n              ToolBar.OverflowMode=\"Never\" />\n            <Grid\n              x:Name=\"FunctionFilterGrid\"\n              Height=\"24\"\n              MaxWidth=\"200\"\n              ToolBar.OverflowMode=\"Never\">\n              <TextBox\n                Name=\"FunctionFilter\"\n                Height=\"24\"\n                MaxWidth=\"200\"\n                Margin=\"4,0,0,0\"\n                HorizontalAlignment=\"Stretch\"\n                VerticalAlignment=\"Center\"\n                VerticalContentAlignment=\"Center\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                TextChanged=\"FunctionFilter_TextChanged\"\n                ToolTip=\"Filter function list based based on a substring (Ctrl+F).&#x0a;Wildcards * in the name are supported, e.g. prefix*foo*\">\n                <TextBox.InputBindings>\n                  <KeyBinding\n                    Key=\"Escape\"\n                    Command=\"local:Command.ClearTextbox\"\n                    CommandParameter=\"{Binding ElementName=FunctionFilter}\"\n                    CommandTarget=\"{Binding ElementName=FunctionList}\" />\n                </TextBox.InputBindings>\n\n              </TextBox>\n              <TextBlock\n                Margin=\"8,4\"\n                Foreground=\"DimGray\"\n                IsHitTestVisible=\"False\"\n                Text=\"Search functions\"\n                Visibility=\"{Binding ElementName=FunctionFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n            </Grid>\n\n            <Button\n              Command=\"local:Command.ClearTextbox\"\n              CommandParameter=\"{Binding ElementName=FunctionFilter}\"\n              CommandTarget=\"{Binding ElementName=FunctionList}\"\n              ToolBar.OverflowMode=\"Never\"\n              ToolTip=\"Reset function filter\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource ClearIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </Button>\n            <Separator\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n            <Button\n              Click=\"ScrollUpButton_OnClick\"\n              ToolTip=\"Scroll function list to the top\"\n              Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource UpArrowIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </Button>\n          </ToolBar>\n        </ToolBarTray>\n        <local:PanelToolbarTray\n          Grid.Column=\"1\"\n          HasDuplicateButton=\"False\"\n          HasHelpButton=\"True\"\n          HasPinButton=\"False\"\n          HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n          SettingsClicked=\"FixedToolbar_SettingsClicked\"\n          Visibility=\"{Binding IsSectionListVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n      </Grid>\n\n      <Grid\n        Grid.Row=\"1\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Style=\"{StaticResource ModulesColumnsStyle}\" />\n          <ColumnDefinition Style=\"{StaticResource ModulesColumnsGridSplitterStyle}\" />\n          <ColumnDefinition Width=\"2*\" />\n        </Grid.ColumnDefinitions>\n\n        <ListView\n          x:Name=\"ModulesList\"\n          Grid.Column=\"0\"\n          Panel.ZIndex=\"2\"\n          AlternationCount=\"{Binding Settings.AlternateListRows, Converter={StaticResource AlternateRowConverter}}\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          BorderBrush=\"{x:Null}\"\n          BorderThickness=\"0,0,0,0\"\n          IsTextSearchEnabled=\"True\"\n          SelectionChanged=\"ModulesList_OnSelectionChanged\"\n          SelectionMode=\"Single\"\n          TextSearch.TextPath=\"Name\"\n          VirtualizingStackPanel.IsVirtualizing=\"True\"\n          VirtualizingStackPanel.VirtualizationMode=\"Recycling\"\n          Visibility=\"{Binding ShowModules, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn Width=\"180\">\n                <GridViewColumnHeader\n                  x:Name=\"ModuleColumnHeader\"\n                  Content=\"Binary\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <DockPanel Margin=\"2\">\n                      <Grid\n                        Margin=\"0,0,0,2\"\n                        DockPanel.Dock=\"Top\">\n                        <TextBlock\n                          FontWeight=\"Medium\"\n                          Text=\"{Binding Name}\" />\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          HorizontalAlignment=\"Right\"\n                          VerticalAlignment=\"Top\"\n                          MouseDown=\"ModuleWarningImage_MouseUp\"\n                          Source=\"{StaticResource WarningIconColor}\"\n                          ToolTip=\"Debug info file not found.&#x0a;Click for details\"\n                          Visibility=\"{Binding DebugFileMissing, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          HorizontalAlignment=\"Right\"\n                          VerticalAlignment=\"Top\"\n                          MouseDown=\"ModuleWarningImage_MouseUp\"\n                          Source=\"{StaticResource WarningIconColor}\"\n                          ToolTip=\"Binary file not found.&#x0a;Click for details\"\n                          Visibility=\"{Binding BinaryFileMissing, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                      </Grid>\n                      <Border\n                        HorizontalAlignment=\"Stretch\"\n                        DockPanel.Dock=\"Bottom\">\n                        <ContentControl\n                          HorizontalAlignment=\"Stretch\"\n                          Content=\"{Binding}\"\n                          ContentTemplate=\"{StaticResource ModulePercentageTemplate}\" />\n                      </Border>\n                    </DockPanel>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n              <EventSetter\n                Event=\"MouseDoubleClick\"\n                Handler=\"ModuleDoubleClick\" />\n              <EventSetter\n                Event=\"PreviewKeyDown\"\n                Handler=\"ModulePreviewKeyDown\" />\n              <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n\n              <Style.Triggers>\n                <Trigger Property=\"ItemsControl.AlternationIndex\" Value=\"0\">\n                  <Setter Property=\"Background\"\n                          Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                </Trigger>\n                <Trigger Property=\"ItemsControl.AlternationIndex\" Value=\"1\">\n                  <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.MenuBrushKey}}\" />\n                </Trigger>\n              </Style.Triggers>\n            </Style>\n          </ListView.ItemContainerStyle>\n        </ListView>\n\n        <GridSplitter\n          Grid.Column=\"1\"\n          Width=\"2\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Stretch\"\n          Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\" />\n\n        <ListView\n          x:Name=\"FunctionList\"\n          Grid.Column=\"2\"\n          Panel.ZIndex=\"1\"\n          local:GridViewColumnVisibility.Enabled=\"True\"\n          AlternationCount=\"{Binding Settings.AlternateListRows, Converter={StaticResource AlternateRowConverter}}\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          BorderBrush=\"{x:Null}\"\n          BorderThickness=\"0,0,0,0\"\n          IsTextSearchEnabled=\"True\"\n          SelectionChanged=\"FunctionList_SelectionChanged\"\n          TextSearch.TextPath=\"Name\"\n          VirtualizingStackPanel.IsVirtualizing=\"True\"\n          VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n          <ListView.InputBindings>\n            <KeyBinding\n              Key=\"C\"\n              Command=\"local:Command.CopyDemangledFunctionName\"\n              CommandParameter=\"{Binding ElementName=FunctionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=FunctionList}\"\n              Modifiers=\"Control+Shift\" />\n            <KeyBinding\n              Key=\"C\"\n              Command=\"local:Command.CopyFunctionName\"\n              CommandParameter=\"{Binding ElementName=FunctionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=FunctionList}\"\n              Modifiers=\"Control+Alt\" />\n            <KeyBinding\n              Key=\"C\"\n              Command=\"local:Command.CopyFunctionDetails\"\n              CommandParameter=\"{Binding ElementName=FunctionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=FunctionList}\"\n              Modifiers=\"Control\" />\n            <KeyBinding\n              Key=\"Return\"\n              Command=\"{Binding PreviewFunctionCommand}\"\n              CommandParameter=\"{Binding ElementName=FunctionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=FunctionList}\"\n              Modifiers=\"Alt\" />\n          </ListView.InputBindings>\n          <ListView.View>\n            <GridView>\n              <GridViewColumn Width=\"200\">\n                <GridViewColumnHeader\n                  x:Name=\"FunctionColumnHeader\"\n                  Content=\"Function\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Grid\n                      HorizontalAlignment=\"Stretch\"\n                      Background=\"{Binding FunctionBackColor}\">\n                      <TextBlock\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Name}\"\n                        ToolTip=\"{Binding ToolTip}\" />\n                    </Grid>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"50\"\n                local:GridViewColumnVisibility.IsVisible=\"{Binding SectionCountColumnVisible}\"\n                DisplayMemberBinding=\"{Binding SectionCount}\">\n                <GridViewColumnHeader\n                  x:Name=\"SectionsColumnHeader\"\n                  Content=\"Sections\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn\n                Width=\"100\"\n                local:GridViewColumnVisibility.IsVisible=\"{Binding ModuleControlsVisible}\">\n                <GridViewColumnHeader\n                  x:Name=\"FunctionModuleColumnHeader\"\n                  Content=\"Module\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Grid\n                      HorizontalAlignment=\"Stretch\"\n                      Background=\"{Binding ModuleBackColor}\">\n                      <TextBlock\n                        HorizontalAlignment=\"Left\"\n                        VerticalAlignment=\"Center\"\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Path=ModuleName}\" />\n                    </Grid>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn\n                x:Name=\"OptionalDataColumn\"\n                Width=\"{Binding SelfTimeColumnWidth}\"\n                local:GridViewColumnVisibility.IsVisible=\"{Binding OptionalDataColumnVisible}\">\n                <GridViewColumnHeader\n                  x:Name=\"OptionalColumnHeader\"\n                  Content=\"{Binding OptionalDataColumnName}\" />\n\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Grid\n                      HorizontalAlignment=\"Stretch\"\n                      Background=\"{Binding BackColor}\">\n                      <TextBlock\n                        Width=\"45\"\n                        HorizontalAlignment=\"Left\"\n                        VerticalAlignment=\"Center\"\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Path=ExclusivePercentage, Converter={StaticResource PercentageConverter}}\"\n                        ToolTip=\"{Binding ExclusiveWeight, Converter={StaticResource MillisecondTimeConverter}}\"\n                        Visibility=\"{Binding Settings.AppendTimeToSelfColumn, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:SectionPanel}}, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n                      <ContentControl\n                        HorizontalAlignment=\"Stretch\"\n                        Content=\"{Binding}\"\n                        ContentTemplate=\"{StaticResource ProfileExclusivePercentageTemplate}\"\n                        Visibility=\"{Binding Settings.AppendTimeToSelfColumn, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:SectionPanel}}, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                    </Grid>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn\n                x:Name=\"OptionalDataColumn2\"\n                Width=\"{Binding TotalTimeColumnWidth}\"\n                local:GridViewColumnVisibility.IsVisible=\"{Binding OptionalDataColumnVisible2}\">\n                <GridViewColumnHeader\n                  x:Name=\"OptionalColumnHeader2\"\n                  Content=\"{Binding OptionalDataColumnName2}\" />\n\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Grid\n                      HorizontalAlignment=\"Stretch\"\n                      Background=\"{Binding BackColor2}\">\n                      <TextBlock\n                        Width=\"45\"\n                        HorizontalAlignment=\"Left\"\n                        VerticalAlignment=\"Center\"\n                        FontWeight=\"Medium\"\n                        Text=\"{Binding Path=Percentage, Converter={StaticResource PercentageConverter}}\"\n                        ToolTip=\"{Binding Weight, Converter={StaticResource MillisecondTimeConverter}}\"\n                        Visibility=\"{Binding Settings.AppendTimeToTotalColumn, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:SectionPanel}}, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n                      <ContentControl\n                        HorizontalAlignment=\"Stretch\"\n                        Content=\"{Binding}\"\n                        ContentTemplate=\"{StaticResource ProfilePercentageTemplate}\"\n                        Visibility=\"{Binding Settings.AppendTimeToTotalColumn, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:SectionPanel}}, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                    </Grid>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn\n                Width=\"200\"\n                local:GridViewColumnVisibility.IsVisible=\"{Binding AlternateNameColumnVisible}\">\n                <GridViewColumnHeader\n                  x:Name=\"AlternateNameColumnHeader\"\n                  Content=\"Mangled Name\" />\n\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border HorizontalAlignment=\"Stretch\">\n                      <TextBlock Text=\"{Binding AlternateName}\" />\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n              <EventSetter\n                Event=\"MouseDoubleClick\"\n                Handler=\"FunctionDoubleClick\" />\n              <EventSetter\n                Event=\"PreviewKeyDown\"\n                Handler=\"FunctionPreviewKeyDown\" />\n\n              <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n\n              <Style.Triggers>\n                <DataTrigger\n                  Binding=\"{Binding Path=IsDeletionDiff}\"\n                  Value=\"True\">\n                  <Setter Property=\"Background\"\n                          Value=\"{Binding Path=MissingSectionBrush, Converter={StaticResource ColorBrushOpacityConverter}, ConverterParameter=0.2}\" />\n                  <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                  <Setter Property=\"BorderBrush\" Value=\"{Binding Path=MissingSectionBrush}\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=IsInsertionDiff}\"\n                  Value=\"True\">\n                  <Setter Property=\"Background\"\n                          Value=\"{Binding Path=NewSectionBrush, Converter={StaticResource ColorBrushOpacityConverter}, ConverterParameter=0.2}\" />\n                  <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                  <Setter Property=\"BorderBrush\" Value=\"{Binding Path=NewSectionBrush}\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=HasDiffs}\"\n                  Value=\"True\">\n                  <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                  <Setter Property=\"Background\"\n                          Value=\"{Binding Path=ChangedSectionBrush, Converter={StaticResource ColorBrushOpacityConverter}, ConverterParameter=0.2}\" />\n                  <Setter Property=\"BorderBrush\" Value=\"{Binding Path=ChangedSectionBrush}\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=IsPlaceholderDiff}\"\n                  Value=\"True\">\n                  <Setter Property=\"BorderBrush\" Value=\"Transparent\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n\n                <Trigger Property=\"ItemsControl.AlternationIndex\" Value=\"0\">\n                  <Setter Property=\"Background\"\n                          Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                </Trigger>\n                <Trigger Property=\"ItemsControl.AlternationIndex\" Value=\"1\">\n                  <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.MenuBrushKey}}\" />\n                </Trigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=IsMarked}\"\n                  Value=\"True\">\n                  <Setter Property=\"Background\" Value=\"#D0E3F1\" />\n                </DataTrigger>\n              </Style.Triggers>\n            </Style>\n          </ListView.ItemContainerStyle>\n          <ListView.ContextMenu>\n            <ContextMenu>\n              <MenuItem\n                Command=\"{Binding PreviewFunctionCommand}\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                Header=\"Preview Function\"\n                InputGestureText=\"Alt+Return\"\n                ToolTip=\"Show a preview popup of the function asembly or source code\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource PeekDefinitionIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.Open\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open Function\"\n                InputGestureText=\"Return\"\n                ToolTip=\"Open the assembly view, replacing the active tab\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutOpenIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.OpenInNewTab\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open Function in New Tab\"\n                InputGestureText=\"Ctrl+Return\"\n                ToolTip=\"Open the assembly view in a new tab\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutOpenNewIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.OpenLeft\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open Function in Left Tab\"\n                InputGestureText=\"Ctrl+Shift+Left\"\n                ToolTip=\"Open the assembly view in a new tab docked left\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutLeftIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.OpenRight\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open Function in Right Tab\"\n                InputGestureText=\"Ctrl+Shift+Right\"\n                ToolTip=\"Open the assembly view in a new tab docked right\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutRightIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <Separator />\n              <MenuItem\n                Command=\"local:Command.CopyFunctionDetails\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Copy Function Details\"\n                InputGestureText=\"Ctrl+C\"\n                ToolTip=\"Copy the function name and additional information as an HTML table\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource ClipboardIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n\n              <MenuItem\n                Command=\"local:Command.CopyDemangledFunctionName\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Copy Function Name\"\n                InputGestureText=\"Ctrl+Shift+C\"\n                ToolTip=\"Copy the function name to the clipboard\" />\n              <MenuItem\n                Command=\"local:Command.CopyFunctionName\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Copy Mangled Function Name\"\n                InputGestureText=\"Ctrl+Alt+C\"\n                ToolTip=\"Copy the mangled function name to the clipboard (C++)\" />\n              <Separator />\n\n              <MenuItem\n                Command=\"local:Command.CopyFunctionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Copy Function Assembly Code\"\n                ToolTip=\"Copies the assembly code of the selected function to the clipboard\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource ClipboardIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.SaveFunctionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Save Function Assembly Code\"\n                ToolTip=\"Save the assembly code of the selected function to a file\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource SaveIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <Separator/>\n\n              <MenuItem\n                Header=\"Mark Module\"\n                ToolTip=\"Mark all functions belonging to this module (saved)\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource AddBookmarkIcon}\" />\n                </MenuItem.Icon>\n                <MenuItem>\n                  <MenuItem.Header>\n                    <local:ColorSelector ColorSelectedCommand=\"{Binding MarkModuleCommand}\" />\n                  </MenuItem.Header>\n\n                </MenuItem>\n              </MenuItem>\n              <MenuItem\n                Header=\"Mark Function\"\n                ToolTip=\"Mark all functions with the same name (saved)\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource BookmarkIcon}\" />\n                </MenuItem.Icon>\n                <MenuItem>\n                  <MenuItem.Header>\n                    <local:ColorSelector ColorSelectedCommand=\"{Binding MarkFunctionCommand}\" />\n                  </MenuItem.Header>\n\n                </MenuItem>\n              </MenuItem>\n              <Separator />\n\n              <MenuItem\n                Command=\"local:Command.ExportFunctionList\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Export Function List as Excel File\"\n                ToolTip=\"Save the list of functions and additional columns as an Excel worksheet\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource ExcelIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.ExportFunctionListHtml\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Export Function List as HTML File\"\n                ToolTip=\"Save the list of functions and additional columns as an HTML file\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource SourceIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.ExportFunctionListMarkdown\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Export Function List as Markdown File\"\n                ToolTip=\"Save the list of functions and additional columns as a Markdown file\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource DocumentIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <Separator />\n              <MenuItem\n                Command=\"local:Command.OpenDocumentInNewInstance\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open File in New Profile Explorer Instance\"\n                ToolTip=\"Opens the IR document in a new instance of Profile Explorer\"\n                Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n              <MenuItem\n                Command=\"local:Command.OpenDocumentInEditor\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open File in External Editor\"\n                ToolTip=\"Opens the IR document in the default external editor\"\n                Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n              <Separator\n                Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n              <MenuItem\n                Command=\"{Binding SelectFunctionCallTreeCommand}\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Select in Call Tree\"\n                ToolTip=\"Select the function instance in the Call Tree view\"\n                Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource TreeIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"{Binding SelectFunctionFlameGraphCommand}\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Select in Flame Graph\"\n                ToolTip=\"Select the function instance in the Flame Graph view\"\n                Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource FlameGraphIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"{Binding SelectFunctionTimelineCommand}\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Select in Timeline\"\n                ToolTip=\"Select the function instance in the Timeline view\"\n                Visibility=\"{Binding ProfileControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource TimelineIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n\n              <Separator\n                Visibility=\"{Binding IsInTwoDocumentsMode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n              <MenuItem\n                Command=\"local:Command.SaveFunctionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Copy Diff Function Text\"\n                ToolTip=\"Copies the text (IR) of all sections for the selected diff function to the clipboard\"\n                Visibility=\"{Binding IsInTwoDocumentsMode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n              <MenuItem\n                Command=\"local:Command.SaveFunctionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Save Function Text\"\n                ToolTip=\"Save the text (IR) of all sections for the selected diff function to a file\"\n                Visibility=\"{Binding IsInTwoDocumentsMode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n              <MenuItem\n                Command=\"local:Command.SaveFunctionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open Diff File in New Profile Explorer Instance\"\n                ToolTip=\"Opens the diff IR document in a new instance of Profile Explorer\"\n                Visibility=\"{Binding IsInTwoDocumentsMode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n              <MenuItem\n                Command=\"local:Command.SaveFunctionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=FunctionList}\"\n                Header=\"Open Diff File in External Editor\"\n                ToolTip=\"Opens the diff IR document in the default external editor\"\n                Visibility=\"{Binding IsInTwoDocumentsMode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n            </ContextMenu>\n          </ListView.ContextMenu>\n        </ListView>\n\n      </Grid>\n    </Grid>\n\n    <GridSplitter\n      x:Name=\"MainGridSplitter\"\n      Grid.Column=\"1\"\n      Width=\"2\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\" />\n\n    <Grid\n      Grid.Column=\"2\"\n      Visibility=\"{Binding IsSectionListVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n\n      <Grid\n        x:Name=\"SectionGrid\"\n        Visibility=\"{Binding ShowSections, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <Grid.RowDefinitions>\n          <RowDefinition Height=\"28\" />\n          <RowDefinition Height=\"*\" />\n        </Grid.RowDefinitions>\n\n        <Grid\n          x:Name=\"SectionToolbarGrid\"\n          Grid.Row=\"0\">\n          <Grid.ColumnDefinitions>\n            <ColumnDefinition Width=\"*\" />\n            <ColumnDefinition Width=\"45\" />\n          </Grid.ColumnDefinitions>\n\n          <ToolBarTray\n            x:Name=\"SectionToolbar\"\n            Grid.Column=\"0\"\n            Height=\"28\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            IsLocked=\"True\">\n            <ToolBar\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Top\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Loaded=\"ToolBar_Loaded\">\n\n              <Image Source=\"{StaticResource SearchIcon}\" />\n              <Grid Height=\"24\">\n                <TextBox\n                  x:Name=\"SectionFilter\"\n                  Width=\"200\"\n                  Margin=\"4,0,0,0\"\n                  HorizontalAlignment=\"Center\"\n                  VerticalContentAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                  BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                  TextChanged=\"SectionFilter_TextChanged\"\n                  ToolTip=\"Filter section list based on a case-insensitive string (Ctrl+F)\">\n                  <TextBox.InputBindings>\n                    <KeyBinding\n                      Key=\"Escape\"\n                      Command=\"local:Command.ClearTextbox\"\n                      CommandParameter=\"{Binding ElementName=SectionFilter}\"\n                      CommandTarget=\"{Binding ElementName=SectionList}\" />\n                  </TextBox.InputBindings>\n                </TextBox>\n                <TextBlock\n                  Margin=\"8,4\"\n                  Foreground=\"DimGray\"\n                  IsHitTestVisible=\"False\"\n                  Text=\"Search sections\"\n                  Visibility=\"{Binding ElementName=SectionFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n              </Grid>\n              <Button\n                Command=\"local:Command.ClearTextbox\"\n                CommandParameter=\"{Binding ElementName=SectionFilter}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                ToolTip=\"Reset section filter\">\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ClearIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </Button>\n              <Separator />\n\n              <ToggleButton\n                IsChecked=\"{Binding FilterTagged}\"\n                ToolTip=\"Show only sections with a tag\">\n                <Image\n                  Source=\"{StaticResource TagIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </ToggleButton>\n\n              <ToggleButton\n                IsChecked=\"{Binding FilterDiffFromPrevious}\"\n                ToolTip=\"Show only sections that are different from the previous one\">\n                <Image\n                  Source=\"{StaticResource EyeIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </ToggleButton>\n              <Separator />\n\n              <Button\n                x:Name=\"PreviousButton\"\n                Command=\"local:Command.PreviousSection\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                ToolTip=\"Switch to previous section (Ctrl+P)\">\n                <Image\n                  Source=\"{StaticResource LeftArrowIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </Button>\n              <Button\n                x:Name=\"NextButton\"\n                Command=\"local:Command.NextSection\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                ToolTip=\"Switch to next section (Ctrl+N)\">\n                <Image\n                  Source=\"{StaticResource RightArrowIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </Button>\n\n              <Separator />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                HorizontalAlignment=\"Center\"\n                VerticalAlignment=\"Center\"\n                Text=\"{Binding DocumentTitle}\" />\n            </ToolBar>\n          </ToolBarTray>\n\n          <local:PanelToolbarTray\n            x:Name=\"FixedToolbar\"\n            Grid.Column=\"1\"\n            HasDuplicateButton=\"False\"\n            HasHelpButton=\"True\"\n            HasPinButton=\"False\"\n            HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n            SettingsClicked=\"FixedToolbar_SettingsClicked\" />\n        </Grid>\n\n        <ListView\n          x:Name=\"SectionList\"\n          Grid.Row=\"1\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Stretch\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          BorderBrush=\"{x:Null}\"\n          BorderThickness=\"0,0,0,0\"\n          IsTextSearchEnabled=\"True\"\n          ScrollViewer.HorizontalScrollBarVisibility=\"Hidden\"\n          TextSearch.TextPath=\"Name\"\n          VirtualizingStackPanel.IsVirtualizing=\"True\"\n          VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn Width=\"50\">\n                <GridViewColumnHeader\n                  x:Name=\"NumberColumnHeader\"\n                  Content=\"#\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border\n                      Margin=\"-6,-2,-6,-2\"\n                      BorderBrush=\"{Binding BorderBrush}\"\n                      BorderThickness=\"{Binding BorderThickness}\">\n                      <StackPanel\n                        Margin=\"6,2,6,2\"\n                        Orientation=\"Horizontal\">\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource DockRightIcon}\"\n                          Style=\"{StaticResource IconSelected}\" />\n\n                        <TextBlock Text=\"{Binding NumberString}\" />\n                      </StackPanel>\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn Width=\"280\">\n                <GridViewColumnHeader\n                  x:Name=\"NameColumnHeader\"\n                  Content=\"Section\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border\n                      Margin=\"-6,-2,-6,-2\"\n                      BorderBrush=\"{Binding BorderBrush}\"\n                      BorderThickness=\"{Binding BorderThickness}\">\n                      <TextBlock\n                        Margin=\"6,2,6,2\"\n                        Text=\"{Binding Name}\" />\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n              <GridViewColumn Width=\"50\">\n                <GridViewColumnHeader\n                  x:Name=\"BlocksColumnHeader\"\n                  Width=\"50\"\n                  Content=\"Blocks\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border\n                      Margin=\"-6,-2,-6,-2\"\n                      BorderBrush=\"{Binding BorderBrush}\"\n                      BorderThickness=\"{Binding BorderThickness}\">\n                      <TextBlock\n                        Margin=\"6,2,6,2\"\n                        Text=\"{Binding BlockCountString}\" />\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn Width=\"40\">\n                <GridViewColumnHeader Content=\"Flags\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border\n                      Margin=\"-6,-2,-6,-2\"\n                      BorderBrush=\"{Binding BorderBrush}\"\n                      BorderThickness=\"{Binding BorderThickness}\">\n                      <StackPanel\n                        Margin=\"6,2,6,2\"\n                        Orientation=\"Horizontal\">\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource DotIconTransparent}\"\n                          Style=\"{StaticResource IconDifferentFromPrevious}\" />\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\"\n                          Source=\"{StaticResource TagIcon}\"\n                          Style=\"{StaticResource IconTagged}\" />\n                      </StackPanel>\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n            </GridView>\n          </ListView.View>\n\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <EventSetter\n                Event=\"MouseDoubleClick\"\n                Handler=\"SectionDoubleClick\" />\n              <EventSetter\n                Event=\"PreviewKeyDown\"\n                Handler=\"SectionPreviewKeyDown\" />\n\n\n              <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n              <Setter Property=\"VerticalContentAlignment\" Value=\"Stretch\" />\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n\n              <Style.Triggers>\n                <DataTrigger\n                  Binding=\"{Binding Path=IsSelected}\"\n                  Value=\"True\">\n                  <Setter Property=\"FontWeight\" Value=\"Bold\" />\n                </DataTrigger>\n\n                <MultiDataTrigger>\n                  <MultiDataTrigger.Conditions>\n                    <Condition Binding=\"{Binding Path=IsDiffFromPrevious}\" Value=\"False\" />\n                    <Condition Binding=\"{Binding Path=LowerIdenticalToPreviousOpacity}\" Value=\"True\" />\n                    <Condition Binding=\"{Binding Path=IsSelected}\" Value=\"False\" />\n                  </MultiDataTrigger.Conditions>\n                  <Setter Property=\"Opacity\" Value=\"0.6\" />\n                </MultiDataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=IsMarked}\"\n                  Value=\"True\">\n                  <Setter Property=\"Foreground\" Value=\"{Binding Path=TextColor}\" />\n                </DataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=IsDeletionDiff}\"\n                  Value=\"True\">\n                  <Setter Property=\"Background\"\n                          Value=\"{Binding Path=MissingSectionBrush, Converter={StaticResource ColorBrushOpacityConverter}, ConverterParameter=0.2}\" />\n                  <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                  <Setter Property=\"BorderBrush\" Value=\"{Binding Path=MissingSectionBrush}\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=IsInsertionDiff}\"\n                  Value=\"True\">\n                  <Setter Property=\"Background\"\n                          Value=\"{Binding Path=NewSectionBrush, Converter={StaticResource ColorBrushOpacityConverter}, ConverterParameter=0.2}\" />\n                  <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                  <Setter Property=\"BorderBrush\" Value=\"{Binding Path=NewSectionBrush}\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=HasDiffs}\"\n                  Value=\"True\">\n                  <Setter Property=\"FontWeight\" Value=\"Medium\" />\n                  <Setter Property=\"Background\"\n                          Value=\"{Binding Path=ChangedSectionBrush, Converter={StaticResource ColorBrushOpacityConverter}, ConverterParameter=0.2}\" />\n                  <Setter Property=\"BorderBrush\" Value=\"{Binding Path=ChangedSectionBrush}\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n\n                <DataTrigger\n                  Binding=\"{Binding Path=IsPlaceholderDiff}\"\n                  Value=\"True\">\n                  <Setter Property=\"BorderBrush\" Value=\"Transparent\" />\n                  <Setter Property=\"BorderThickness\" Value=\"1\" />\n                </DataTrigger>\n              </Style.Triggers>\n\n            </Style>\n          </ListView.ItemContainerStyle>\n          <ListView.ContextMenu>\n            <ContextMenu>\n              <MenuItem\n                Command=\"local:Command.Open\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Open\"\n                InputGestureText=\"Return\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutOpenIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.OpenInNewTab\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Open in New Tab\"\n                InputGestureText=\"Ctrl+Return\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutOpenNewIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.OpenLeft\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Open in Left Tab\"\n                InputGestureText=\"Ctrl+Left\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutLeftIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.OpenRight\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Open in Right Tab\"\n                InputGestureText=\"Ctrl+Right\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutRightIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem\n                Command=\"local:Command.OpenSideBySide\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Open Side-By-Side\"\n                InputGestureText=\"Return\"\n                ToolTip=\"Open the two selected sections from the same document\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutSplitIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <Separator />\n\n              <MenuItem\n                Command=\"local:Command.DiffSideBySide\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Compare Side-By-Side\"\n                InputGestureText=\"Shift+Return\"\n                ToolTip=\"Compare the two selected sections from the same document\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource BookIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n\n              <MenuItem\n                Command=\"local:Command.DiffWithOtherDocument\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Compare with Other Document\"\n                InputGestureText=\"Ctrl+Return\"\n                ToolTip=\"Compare section with same one from the other document\" />\n              <MenuItem\n                Command=\"local:Command.SyncDiffedDocuments\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Sync Section with Other Document\"\n                IsCheckable=\"True\"\n                IsChecked=\"{Binding Path=SyncDiffedDocuments, Mode=TwoWay}\"\n                ToolTip=\"Sync the diffed section between the two documents\" />\n              <Separator />\n\n              <MenuItem\n                Command=\"local:Command.CopySectionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Copy Section Text\"\n                ToolTip=\"Copy the section text (IR) to the clipboard\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource ClipboardIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n\n              <MenuItem\n                Command=\"local:Command.SaveSectionText\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Save Section Text\"\n                ToolTip=\"Save the section text (IR) to a file\" />\n              <Separator />\n\n              <MenuItem\n                Command=\"local:Command.ToggleTag\"\n                CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                CommandTarget=\"{Binding ElementName=SectionList}\"\n                Header=\"Toggle Tag\"\n                InputGestureText=\"Ctrl+T\">\n                <MenuItem.Icon>\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource TagIcon}\" />\n                </MenuItem.Icon>\n              </MenuItem>\n              <MenuItem Header=\"More...\">\n                <MenuItem\n                  Command=\"local:Command.DisplayPartialCallGraph\"\n                  CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                  CommandTarget=\"{Binding ElementName=FunctionList}\"\n                  Header=\"Show Function Call Graph\"\n                  ToolTip=\"Show the call graph that includes all reachable functions starting with the selected one\" />\n\n                <MenuItem\n                  Command=\"local:Command.DisplayCallGraph\"\n                  CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n                  CommandTarget=\"{Binding ElementName=FunctionList}\"\n                  Header=\"Show Call Graph\"\n                  ToolTip=\"Show the call graph for all the functions in the document\" />\n              </MenuItem>\n\n            </ContextMenu>\n          </ListView.ContextMenu>\n          <ListView.InputBindings>\n            <KeyBinding\n              Key=\"Enter\"\n              Command=\"local:Command.Open\"\n              CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=SectionList}\" />\n            <KeyBinding\n              Key=\"Enter\"\n              Command=\"local:Command.OpenInNewTab\"\n              CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=SectionList}\"\n              Modifiers=\"Ctrl\" />\n            <KeyBinding\n              Key=\"T\"\n              Command=\"local:Command.ToggleTag\"\n              CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=SectionList}\"\n              Modifiers=\"Ctrl\" />\n            <KeyBinding\n              Key=\"C\"\n              Command=\"local:Command.CopyFunctionName\"\n              CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n              CommandTarget=\"{Binding ElementName=SectionList}\"\n              Modifiers=\"Ctrl+Shift\" />\n          </ListView.InputBindings>\n        </ListView>\n\n      </Grid>\n    </Grid>\n  </Grid>\n\n  <local:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"P\"\n      Command=\"local:Command.PreviousSection\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"N\"\n      Command=\"local:Command.NextSection\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F\"\n      Command=\"local:Command.FocusSearch\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Left\"\n      Command=\"local:Command.OpenLeft\"\n      CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Right\"\n      Command=\"local:Command.OpenRight\"\n      CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:Command.DiffWithOtherDocument\"\n      CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:Command.DiffSideBySide\"\n      CommandParameter=\"{Binding ElementName=SectionList, Path=SelectedItem}\"\n      Modifiers=\"Shift\" />\n  </local:ToolPanelControl.InputBindings>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SectionPanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Web;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing ClosedXML.Excel;\nusing HtmlAgilityPack;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.UI.Compilers;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.UI.Profile;\nusing ProtoBuf;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Document.Renderers.Highlighters;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Profile.Data;\nusing PerformanceCounter = ProfileExplorer.Core.Profile.Data.PerformanceCounter;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Compilers.ASM;\nusing ProfileExplorer.Core.Diff;\n\nnamespace ProfileExplorer.UI;\n\npublic enum OpenSectionKind {\n  ReplaceCurrent,\n  ReplaceLeft,\n  ReplaceRight,\n  NewTab,\n  NewTabDockLeft,\n  NewTabDockRight\n}\n\npublic enum SectionFieldKind {\n  Number,\n  Name,\n  Blocks\n}\n\npublic enum FunctionFieldKind {\n  Name,\n  AlternateName,\n  Sections,\n  Module,\n  Optional,\n  Optional2,\n  StatisticSize,\n  StatisticInstructions,\n  StatisticLoads,\n  StatisticStores,\n  StatisticBranches,\n  StatisticCalls,\n  StatisticCallees,\n  StatisticCallers,\n  StatisticIndirectCalls,\n  StatisticDiff,\n  PerformanceCounter\n}\n\npublic enum ChildFunctionFieldKind {\n  Name,\n  AlternateName,\n  Time,\n  Children\n}\n\npublic enum ModuleFieldKind {\n  Name,\n  Time\n}\n\n//? TODo; Commands can be defined in code-behind with the RelayCommand pattern,\n//? will remove this and a lot of other Xaml code\n// https://www.c-sharpcorner.com/UploadFile/20c06b/icommand-and-relaycommand-in-wpf/\n// https://stackoverflow.com/questions/19573380/pass-different-commandparameters-to-same-command-using-relaycommand-wpf\n// https://stackoverflow.com/questions/1361350/keyboard-shortcuts-in-wpf\n//? https://stackoverflow.com/questions/13826504/how-do-you-bind-a-command-to-a-menuitem-wpf\npublic static class Command {\n  public static readonly RoutedUICommand ClearTextbox = new(\"Clear text\", \"ClearTextbox\", typeof(SectionPanel));\n  public static readonly RoutedUICommand Open = new(\"Open section\", \"Open\", typeof(SectionPanel));\n  public static readonly RoutedUICommand OpenInNewTab =\n    new(\"Open section in new tab\", \"OpenInNewTab\", typeof(SectionPanel));\n  public static readonly RoutedUICommand OpenLeft = new(\"Open section in new tab\", \"OpenLeft\", typeof(SectionPanel));\n  public static readonly RoutedUICommand OpenRight = new(\"Open section in new tab\", \"OpenRight\", typeof(SectionPanel));\n  public static readonly RoutedUICommand OpenSideBySide =\n    new(\"Open section in new tab\", \"OpenSideBySide\", typeof(SectionPanel));\n  public static readonly RoutedUICommand DiffSideBySide =\n    new(\"Open section in new tab\", \"DiffSideBySide\", typeof(SectionPanel));\n  public static readonly RoutedUICommand DiffWithOtherDocument =\n    new(\"Open section in new tab\", \"DiffWithOtherDocument\", typeof(SectionPanel));\n  public static readonly RoutedUICommand SyncDiffedDocuments =\n    new(\"Untitled\", \"SyncDiffedDocuments\", typeof(SectionPanel));\n  public static readonly RoutedUICommand ToggleTag = new(\"Toggle tag\", \"ToggleTag\", typeof(SectionPanel));\n  public static readonly RoutedUICommand PreviousSection = new(\"Untitled\", \"PreviousSection\", typeof(SectionPanel));\n  public static readonly RoutedUICommand NextSection = new(\"Untitled\", \"NextSection\", typeof(SectionPanel));\n  public static readonly RoutedUICommand FocusSearch = new(\"Untitled\", \"FocusSearch\", typeof(SectionPanel));\n  public static readonly RoutedUICommand CopySectionText = new(\"Untitled\", \"CopySectionText\", typeof(SectionPanel));\n  public static readonly RoutedUICommand SaveSectionText = new(\"Untitled\", \"SaveSectionText\", typeof(SectionPanel));\n  public static readonly RoutedUICommand SaveFunctionText = new(\"Untitled\", \"SaveFunctionText\", typeof(SectionPanel));\n  public static readonly RoutedUICommand CopyFunctionText = new(\"Untitled\", \"CopyFunctionText\", typeof(SectionPanel));\n  public static readonly RoutedUICommand OpenDocumentInEditor =\n    new(\"Untitled\", \"OpenDocumentInEditor\", typeof(SectionPanel));\n  public static readonly RoutedUICommand OpenDocumentInNewInstance =\n    new(\"Untitled\", \"OpenDocumentInNewInstance\", typeof(SectionPanel));\n  public static readonly RoutedUICommand DisplayCallGraph = new(\"Untitled\", \"DisplayCallGraph\", typeof(SectionPanel));\n  public static readonly RoutedUICommand DisplayPartialCallGraph =\n    new(\"Untitled\", \"DisplayPartialCallGraph\", typeof(SectionPanel));\n  public static readonly RoutedUICommand CopyFunctionName = new(\"Untitled\", \"CopyFunctionName\", typeof(SectionPanel));\n  public static readonly RoutedUICommand CopyDemangledFunctionName =\n    new(\"Untitled\", \"CopyDemangledFunctionName\", typeof(SectionPanel));\n  public static readonly RoutedUICommand ExportFunctionList =\n    new(\"Untitled\", \"ExportFunctionList\", typeof(SectionPanel));\n  public static readonly RoutedUICommand ExportModuleList = new(\"Untitled\", \"ExportModuleList\", typeof(SectionPanel));\n  public static readonly RoutedUICommand CopyFunctionDetails =\n    new(\"Untitled\", \"CopyFunctionDetails\", typeof(SectionPanel));\n  public static readonly RoutedUICommand ExportFunctionListHtml =\n    new(\"Untitled\", \"ExportFunctionListHtml\", typeof(SectionPanel));\n  public static readonly RoutedUICommand ExportFunctionListMarkdown =\n    new(\"Untitled\", \"ExportFunctionListMarkdown\", typeof(SectionPanel));\n}\n\npublic class OpenSectionEventArgs : EventArgs {\n  public OpenSectionEventArgs(IRTextSection section, OpenSectionKind kind,\n                              IRDocumentHost targetDocument = null) {\n    Section = section;\n    OpenKind = kind;\n    TargetDocument = targetDocument;\n  }\n\n  public IRTextSection Section { get; set; }\n  public OpenSectionKind OpenKind { get; set; }\n  public IRDocumentHost TargetDocument { get; set; }\n}\n\npublic class DiffModeEventArgs : EventArgs {\n  public bool IsWithOtherDocument { get; set; }\n  public OpenSectionEventArgs Left { get; set; }\n  public OpenSectionEventArgs Right { get; set; }\n}\n\npublic class DisplayCallGraphEventArgs : EventArgs {\n  public DisplayCallGraphEventArgs(IRTextSummary summary, IRTextSection section, bool buildPartialGraph) {\n    Summary = summary;\n    Section = section;\n    BuildPartialGraph = buildPartialGraph;\n  }\n\n  public IRTextSummary Summary { get; set; }\n  public IRTextSection Section { get; set; }\n  public bool BuildPartialGraph { get; set; }\n}\n\npublic class IRTextDiffBaseEx {\n  protected DiffKind diffKind_;\n\n  public IRTextDiffBaseEx(DiffKind diffKind) {\n    diffKind_ = diffKind;\n  }\n\n  public bool IsInsertionDiff => diffKind_ == DiffKind.Insertion;\n  public bool IsDeletionDiff => diffKind_ == DiffKind.Deletion;\n  public bool IsModificationDiff => diffKind_ == DiffKind.Modification || diffKind_ == DiffKind.MinorModification;\n  public bool IsPlaceholderDiff => diffKind_ == DiffKind.Placeholder;\n  public bool HasDiffs => diffKind_ == DiffKind.Modification;\n  public Brush NewSectionBrush => ColorBrushes.GetBrush(App.Settings.SectionSettings.NewSectionColor);\n  public Brush MissingSectionBrush => ColorBrushes.GetBrush(App.Settings.SectionSettings.MissingSectionColor);\n  public Brush ChangedSectionBrush => ColorBrushes.GetBrush(App.Settings.SectionSettings.ChangedSectionColor);\n}\n\npublic class IRTextSectionEx : IRTextDiffBaseEx, INotifyPropertyChanged {\n  private bool isSelected_;\n  private bool isTagged_;\n  private Thickness borderThickness_;\n  private Brush borderBrush_;\n  private string name_;\n  private bool isDiffFromPrevious_;\n  private bool isMarked_;\n\n  public IRTextSectionEx(IRTextSection section, int index) : base(DiffKind.None) {\n    Section = section;\n    Index = index;\n  }\n\n  public IRTextSectionEx(IRTextSection section, DiffKind diffKind, string name, int index) : base(diffKind) {\n    Section = section;\n    Name = name;\n    Index = index;\n  }\n\n  public int Index { get; set; }\n  public IRTextSection Section { get; set; }\n\n  public Thickness BorderThickness {\n    get => borderThickness_;\n    set {\n      borderThickness_ = value;\n      OnPropertyChanged(nameof(BorderThickness));\n    }\n  }\n\n  public bool HasBeforeBorder => BorderThickness.Top != 0;\n  public bool HasAfterBorder => BorderThickness.Bottom != 0;\n\n  public Brush BorderBrush {\n    get => borderBrush_;\n    set {\n      borderBrush_ = value;\n      OnPropertyChanged(nameof(BorderBrush));\n    }\n  }\n\n  public string Name {\n    get => name_;\n    set {\n      name_ = value;\n      OnPropertyChanged(nameof(Name));\n    }\n  }\n\n  public DiffKind SectionDiffKind {\n    get => diffKind_;\n    set {\n      diffKind_ = value;\n      OnPropertyChanged(nameof(IsInsertionDiff));\n      OnPropertyChanged(nameof(IsDeletionDiff));\n      OnPropertyChanged(nameof(IsPlaceholderDiff));\n      OnPropertyChanged(nameof(HasDiffs));\n    }\n  }\n\n  public bool IsTagged {\n    get => isTagged_;\n    set {\n      isTagged_ = value;\n      OnPropertyChanged(nameof(IsTagged));\n    }\n  }\n\n  public bool IsDiffFromPrevious {\n    get => isDiffFromPrevious_;\n    set {\n      isDiffFromPrevious_ = value;\n      OnPropertyChanged(nameof(IsDiffFromPrevious));\n    }\n  }\n\n  public bool IsSelected {\n    get => isSelected_;\n    set {\n      isSelected_ = value;\n      OnPropertyChanged(nameof(IsSelected));\n    }\n  }\n\n  public bool IsMarked {\n    get => isMarked_;\n    set {\n      isMarked_ = value;\n      OnPropertyChanged(nameof(IsMarked));\n    }\n  }\n\n  public Brush TextColor { get; set; }\n  public Brush BackColor { get; set; }\n  public bool LowerIdenticalToPreviousOpacity { get; set; }\n  public string NumberString => Section != null ? Section.Number.ToString() : \"\";\n  public string BlockCountString => Section != null ? Section.BlockCount.ToString() : \"\";\n  public int Number => Section?.Number ?? 0;\n  public int BlockCount => Section?.BlockCount ?? 0;\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void OnPropertyChanged(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n}\n\npublic class PerformanceCounterSetEx {\n  public PerformanceCounterSetEx(int count) {\n    Counters = new List<PerformanceCounterValueEx>(count);\n  }\n\n  public List<PerformanceCounterValueEx> Counters { get; set; }\n  public string this[int perfCounterId] => FindCounterLabel(perfCounterId);\n\n  public string FindCounterLabel(int perfCounterId) {\n    int index = Counters.FindIndex(item => item.CounterId == perfCounterId);\n    return index != -1 ? Counters[index].Label : null;\n  }\n\n  public double FindCounterValue(int perfCounterId) {\n    int index = Counters.FindIndex(item => item.CounterId == perfCounterId);\n    return index != -1 ? Counters[index].Value : 0;\n  }\n\n  public void Add(PerformanceCounterValueEx counterEx) {\n    Counters.Add(counterEx);\n  }\n\n  public class PerformanceCounterValueEx {\n    public int CounterId { get; set; }\n    public double Value { get; set; }\n    public string Label { get; set; }\n  }\n}\n\npublic class IRTextFunctionEx : IRTextDiffBaseEx, INotifyPropertyChanged {\n  private string functionName_;\n  private FunctionNameFormatter funcNameFormatter_;\n  private bool isMarked_;\n\n  public IRTextFunctionEx(IRTextFunction function, int index,\n                          FunctionNameFormatter funcNameFormatter) : base(DiffKind.None) {\n    Function = function;\n    Index = index;\n    funcNameFormatter_ = funcNameFormatter;\n\n    Statistics = new FunctionCodeStatistics();\n  }\n\n  public virtual string Name {\n    get {\n      if (functionName_ != null) {\n        return functionName_; // Cached.\n      }\n\n      functionName_ = Function.Name;\n\n      if (funcNameFormatter_ != null) {\n        functionName_ = funcNameFormatter_(functionName_);\n      }\n\n      return functionName_;\n    }\n    set => functionName_ = value;\n  }\n\n  public string ToolTip => DocumentUtils.FormatLongFunctionName(Name);\n  public int Index { get; set; }\n  public IRTextFunction Function { get; set; }\n  public string ModuleName => Function.ModuleName;\n  public TimeSpan Weight { get; set; }\n  public TimeSpan ExclusiveWeight { get; set; }\n  public string AlternateName { get; set; }\n  public double ExclusivePercentage { get; set; }\n  public double Percentage { get; set; }\n\n  public bool IsMarked {\n    get => isMarked_;\n    set {\n      isMarked_ = value;\n      OnPropertyChanged(nameof(IsMarked));\n    }\n  }\n\n  public Brush TextColor { get; set; }\n  public Brush BackColor { get; set; }\n  public Brush BackColor2 { get; set; }\n  public Brush ModuleBackColor { get; set; }\n  public Brush FunctionBackColor { get; set; }\n  public int SectionCount => Function.SectionCount;\n  public FunctionCodeStatistics Statistics { get; set; }\n  public FunctionCodeStatistics DiffStatistics { get; set; }\n  public PerformanceCounterSetEx Counters { get; set; }\n\n  public DiffKind FunctionDiffKind {\n    get => diffKind_;\n    set {\n      diffKind_ = value;\n      OnPropertyChanged(nameof(IsInsertionDiff));\n      OnPropertyChanged(nameof(IsDeletionDiff));\n      OnPropertyChanged(nameof(IsPlaceholderDiff));\n      OnPropertyChanged(nameof(HasDiffs));\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public void OnPropertyChanged(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n}\n\npublic class ModuleEx {\n  public bool IsAllEntry { get; set; }\n  public string Name { get; set; }\n  public Brush BackColor { get; set; }\n  public double ExclusivePercentage { get; set; }\n  public TimeSpan ExclusiveWeight { get; set; }\n  public bool BinaryFileMissing => Status != null ? !Status.IsBinaryAvailableOrPending : false;\n  public bool DebugFileMissing { get; set; }\n  public ProfileDataReport.ModuleStatus Status { get; set; }\n}\n\n[ProtoContract]\npublic class SectionPanelState {\n  [ProtoMember(1)]\n  public List<int> AnnotatedSections;\n  [ProtoMember(2)]\n  public int SelectedFunctionNumber;\n  [ProtoMember(3)]\n  public int SelectedSectionNumber;\n\n  public SectionPanelState() {\n    AnnotatedSections = new List<int>();\n  }\n}\n\npublic partial class SectionPanel : ToolPanelControl, INotifyPropertyChanged {\n  public static readonly DependencyProperty BottomSectionToolbarProperty =\n    DependencyProperty.Register(\"BottomSectionToolbar\", typeof(bool), typeof(SectionPanel),\n                                new PropertyMetadata(false, OnBottomSectionToolbarPropertyChanged));\n  public static readonly DependencyProperty FunctionPartVisibleProperty =\n    DependencyProperty.Register(\"FunctionPartVisible\", typeof(bool), typeof(SectionPanel),\n                                new PropertyMetadata(true, OnFunctionPartVisiblePropertyChanged));\n  public static readonly DependencyProperty HideToolbarsProperty =\n    DependencyProperty.Register(\"HideToolbars\", typeof(bool), typeof(SectionPanel),\n                                new PropertyMetadata(false, OnHideToolbarsPropertyChanged));\n  private static IValueConverter DiffValueConverter = new FunctionDiffValueConverter();\n  private static IValueConverter DiffKindConverter = new FunctionDiffKindConverter();\n  private static OptionalColumn[] StatisticsColumns = {\n    OptionalColumn.Binding(\"Statistics.Instructions\", \"InstructionsHeader\", \"Instrs{0}\", \"Instruction number{0}\",\n                           DiffValueConverter),\n    OptionalColumn.Binding(\"Statistics.Size\", \"SizeHeader\", \"Size{0}\", \"Function size in bytes{0}\", DiffValueConverter),\n    OptionalColumn.Binding(\"Statistics.Loads\", \"LoadsHeader\", \"Loads{0}\", \"Number of instructions reading memory{0}\",\n                           DiffValueConverter),\n    OptionalColumn.Binding(\"Statistics.Stores\", \"StoresHeader\", \"Stores{0}\", \"Number of instructions writing memory{0}\",\n                           DiffValueConverter),\n    OptionalColumn.Binding(\"Statistics.Branches\", \"BranchesHeader\", \"Branches{0}\",\n                           \"Number of branch/jump instructions{0}\", DiffValueConverter)\n  };\n  private static OptionalColumn[] CallStatisticsColumns = {\n    OptionalColumn.Binding(\"Statistics.Callees\", \"CalleesHeader\", \"Callees{0}\", \"Number of unique called functions{0}\",\n                           DiffValueConverter),\n    OptionalColumn.Binding(\"Statistics.Callers\", \"CallersHeader\", \"Callers{0}\", \"Number of unique caller functions{0}\",\n                           DiffValueConverter),\n    OptionalColumn.Binding(\"Statistics.Calls\", \"CallsHeader\", \"Calls{0}\", \"Number of call instructions{0}\",\n                           DiffValueConverter),\n    OptionalColumn.Binding(\"Statistics.IndirectCalls\", \"IndirectCallsHeader\", \"IndirectCalls{0}\",\n                           \"Number of indirect/virtual call instructions{0}\", DiffValueConverter)\n  };\n  private static OptionalColumn[] StatisticsDiffColumns = {\n    OptionalColumn.Binding(\"FunctionDiffKind\",\n                           \"DiffHeader\", \"Diff\", \"Difference kind (only in left/right document or modified)\",\n                           DiffKindConverter)\n  };\n  private HashSet<IRTextSectionEx> annotatedSections_;\n  private IRTextFunction currentFunction_;\n  private string documentTitle_;\n  private bool isDiffModeEnabled_;\n  private bool syncDiffedDocuments_;\n  private bool isFunctionListVisible_;\n  private bool isSectionListVisible_;\n  private bool useProfileCallTree_;\n  private UISectionSettings settings_;\n  private IRTextSummary summary_;\n  private IRTextSummary otherSummary_;\n  private List<IRTextSectionEx> sections_;\n  private List<IRTextFunctionEx> functions_;\n  private List<IRTextSummary> moduleSummaries_;\n  private bool sectionExtensionComputed_;\n  private Dictionary<IRTextSection, IRTextSectionEx> sectionExtMap_;\n  private Dictionary<IRTextFunction, IRTextFunctionEx> functionExtMap_;\n  private ScrollViewer sectionsScrollViewer_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private GridViewColumnValueSorter<FunctionFieldKind> functionValueSorter_;\n  private GridViewColumnValueSorter<SectionFieldKind> sectionValueSorter_;\n  private GridViewColumnValueSorter<ModuleFieldKind> moduleValueSorter_;\n  private ConcurrentDictionary<IRTextSummary, CallGraph> callGraphCache_;\n  private ModuleReport moduleReport_;\n  private CancelableTaskInstance statisticsTask_;\n  private CancelableTaskInstance callGraphTask_;\n  private ConcurrentDictionary<IRTextFunction, FunctionCodeStatistics> functionStatMap_;\n  private ModuleEx activeModuleFilter_;\n  private bool filterTagged_;\n  private bool filterDiffFromPrevious_;\n  private string optionalDataColumnName_;\n  private bool optionalDataColumnVisible_;\n  private string optionalDataColumnName2_;\n  private bool optionalDataColumnVisible2_;\n  private bool alternateNameColumnVisible_;\n  private bool childTimeColumnVisible_;\n  private bool showChildren_;\n  private bool showSections_;\n  private bool profileControlsVisible_;\n  private bool sectionCountColumnVisible_;\n  private bool moduleControlsVisible_;\n  private CallTreeNodePopup funcBacktracePreviewPopup_;\n  private PopupHoverPreview preview_;\n  private List<ModuleEx> modules_;\n  private FunctionMarkingSettings initialMarkingSettings_;\n  private TextSearcher nameSearcher_;\n\n  public SectionPanel() {\n    InitializeComponent();\n    sections_ = new List<IRTextSectionEx>();\n    moduleSummaries_ = new List<IRTextSummary>();\n    sectionExtMap_ = new Dictionary<IRTextSection, IRTextSectionEx>();\n    functionExtMap_ = new Dictionary<IRTextFunction, IRTextFunctionEx>();\n    annotatedSections_ = new HashSet<IRTextSectionEx>();\n    IsFunctionListVisible = true;\n    IsSectionListVisible = false;\n    ShowSections = false;\n    SectionCountColumnVisible = true;\n    SyncDiffedDocuments = true;\n    MainGrid.DataContext = this;\n    settings_ = App.Settings.SectionSettings;\n\n    functionValueSorter_ =\n      new GridViewColumnValueSorter<FunctionFieldKind>(FunctionList,\n                                                       name => name switch {\n                                                         \"FunctionColumnHeader\" => FunctionFieldKind.Name,\n                                                         \"AlternateNameColumnHeader\" => FunctionFieldKind.AlternateName,\n                                                         \"SectionsColumnHeader\" => FunctionFieldKind.Sections,\n                                                         \"FunctionModuleColumnHeader\" => FunctionFieldKind.Module,\n                                                         \"OptionalColumnHeader\" => FunctionFieldKind.Optional,\n                                                         \"OptionalColumnHeader2\" => FunctionFieldKind.Optional2,\n                                                         \"SizeHeader\" => FunctionFieldKind.StatisticSize,\n                                                         \"LoadsHeader\" => FunctionFieldKind.StatisticLoads,\n                                                         \"StoresHeader\" => FunctionFieldKind.StatisticStores,\n                                                         \"InstructionsHeader\" => FunctionFieldKind.\n                                                           StatisticInstructions,\n                                                         \"BranchesHeader\" => FunctionFieldKind.StatisticBranches,\n                                                         \"CallsHeader\"    => FunctionFieldKind.StatisticCalls,\n                                                         \"CallersHeader\"  => FunctionFieldKind.StatisticCallers,\n                                                         \"CalleesHeader\"  => FunctionFieldKind.StatisticCallees,\n                                                         \"IndirectCallsHeader\" => FunctionFieldKind.\n                                                           StatisticIndirectCalls,\n                                                         \"DiffHeader\" => FunctionFieldKind.StatisticDiff,\n                                                         _            => FunctionFieldKind.PerformanceCounter\n                                                       },\n                                                       (x, y, field, direction, tag) => {\n                                                         var functionX = x as IRTextFunctionEx;\n                                                         var functionY = y as IRTextFunctionEx;\n\n                                                         switch (field) {\n                                                           case FunctionFieldKind.Sections: {\n                                                             int result = functionY.SectionCount -\n                                                                          functionX.SectionCount;\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.Name: {\n                                                             int result = string.Compare(\n                                                               functionY.Name, functionX.Name,\n                                                               StringComparison.OrdinalIgnoreCase);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.AlternateName: {\n                                                             int result = string.Compare(\n                                                               functionY.AlternateName, functionX.AlternateName,\n                                                               StringComparison.OrdinalIgnoreCase);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.Module: {\n                                                             int result = string.Compare(\n                                                               functionY.ModuleName, functionX.ModuleName,\n                                                               StringComparison.OrdinalIgnoreCase);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.Optional: {\n                                                             int result =\n                                                               functionY.ExclusiveWeight.CompareTo(\n                                                                 functionX.ExclusiveWeight);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.Optional2: {\n                                                             int result = functionY.Weight.CompareTo(functionX.Weight);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticSize: {\n                                                             int result =\n                                                               functionY.Statistics.Size.CompareTo(\n                                                                 functionX.Statistics.Size);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticInstructions: {\n                                                             int result =\n                                                               functionY.Statistics.Instructions.CompareTo(\n                                                                 functionX.Statistics.Instructions);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticLoads: {\n                                                             int result =\n                                                               functionY.Statistics.Loads.CompareTo(\n                                                                 functionX.Statistics.Loads);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticStores: {\n                                                             int result =\n                                                               functionY.Statistics.Stores.CompareTo(\n                                                                 functionX.Statistics.Stores);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticBranches: {\n                                                             int result =\n                                                               functionY.Statistics.Branches.CompareTo(\n                                                                 functionX.Statistics.Branches);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticCalls: {\n                                                             int result =\n                                                               functionY.Statistics.Calls.CompareTo(\n                                                                 functionX.Statistics.Calls);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticCallees: {\n                                                             int result =\n                                                               functionY.Statistics.Callees.CompareTo(\n                                                                 functionX.Statistics.Callees);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticCallers: {\n                                                             int result =\n                                                               functionY.Statistics.Callers.CompareTo(\n                                                                 functionX.Statistics.Callers);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticIndirectCalls: {\n                                                             int result =\n                                                               functionY.Statistics.IndirectCalls.CompareTo(\n                                                                 functionX.Statistics.IndirectCalls);\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.StatisticDiff: {\n                                                             int result = 0;\n\n                                                             if (functionY.FunctionDiffKind !=\n                                                                 functionX.FunctionDiffKind) {\n                                                               if (functionY.IsDeletionDiff ||\n                                                                   functionX.IsInsertionDiff) {\n                                                                 result = -1;\n                                                               }\n                                                               else if (functionY.IsInsertionDiff ||\n                                                                        functionX.IsDeletionDiff) {\n                                                                 result = 1;\n                                                               }\n                                                               else if (functionY.IsModificationDiff) {\n                                                                 result = -1;\n                                                               }\n                                                               else if (functionX.IsModificationDiff) {\n                                                                 result = 1;\n                                                               }\n                                                               else {\n                                                                 result = string.Compare(\n                                                                   functionY.Name, functionX.Name,\n                                                                   StringComparison.Ordinal);\n                                                               }\n                                                             }\n                                                             else {\n                                                               result = string.Compare(\n                                                                 functionY.Name, functionX.Name,\n                                                                 StringComparison.Ordinal);\n                                                             }\n\n                                                             return direction == ListSortDirection.Ascending ? -result\n                                                               : result;\n                                                           }\n                                                           case FunctionFieldKind.PerformanceCounter: {\n                                                             if (tag is PerformanceCounter counter) {\n                                                               int result = 0;\n\n                                                               if (functionX.Counters != null &&\n                                                                   functionY.Counters != null) {\n                                                                 double valueX =\n                                                                   functionX.Counters.FindCounterValue(counter.Id);\n                                                                 double valueY =\n                                                                   functionY.Counters.FindCounterValue(counter.Id);\n                                                                 result = valueX.CompareTo(valueY);\n                                                               }\n                                                               else if (functionY.Counters == null &&\n                                                                        functionX.Counters != null) {\n                                                                 result = 1;\n                                                               }\n                                                               else if (functionX.Counters == null &&\n                                                                        functionY.Counters != null) {\n                                                                 result = -1;\n                                                               }\n\n                                                               return direction == ListSortDirection.Ascending ? -result\n                                                                 : result;\n                                                             }\n\n                                                             return 0;\n                                                           }\n                                                           default:\n                                                             throw new ArgumentOutOfRangeException();\n                                                         }\n                                                       });\n\n    sectionValueSorter_ =\n      new GridViewColumnValueSorter<SectionFieldKind>(SectionList,\n                                                      name => name switch {\n                                                        \"NumberColumnHeader\" => SectionFieldKind.Number,\n                                                        \"NameColumnHeader\"   => SectionFieldKind.Name,\n                                                        \"BlocksColumnHeader\" => SectionFieldKind.Blocks,\n                                                        _                    => throw new ArgumentOutOfRangeException()\n                                                      },\n                                                      (x, y, field, direction, tag) => {\n                                                        var sectionX = x as IRTextSectionEx;\n                                                        var sectionY = y as IRTextSectionEx;\n\n                                                        switch (field) {\n                                                          case SectionFieldKind.Number: {\n                                                            int result = sectionY.Number - sectionX.Number;\n                                                            return direction == ListSortDirection.Ascending ? -result\n                                                              : result;\n                                                          }\n                                                          case SectionFieldKind.Name: {\n                                                            int result = string.Compare(\n                                                              sectionY.Name, sectionX.Name, StringComparison.Ordinal);\n                                                            return direction == ListSortDirection.Ascending ? -result\n                                                              : result;\n                                                          }\n                                                          case SectionFieldKind.Blocks: {\n                                                            int result = sectionY.BlockCount - sectionX.BlockCount;\n                                                            return direction == ListSortDirection.Ascending ? -result\n                                                              : result;\n                                                          }\n                                                          default:\n                                                            throw new ArgumentOutOfRangeException();\n                                                        }\n                                                      });\n\n    moduleValueSorter_ =\n      new GridViewColumnValueSorter<ModuleFieldKind>(ModulesList,\n                                                     name => name switch {\n                                                       \"ModuleColumnHeader\" => ModuleFieldKind.Name,\n                                                       _                    => throw new ArgumentOutOfRangeException()\n                                                     },\n                                                     (x, y, field, direction, tag) => {\n                                                       var moduleX = x as ModuleEx;\n                                                       var moduleY = y as ModuleEx;\n\n                                                       switch (field) {\n                                                         case ModuleFieldKind.Name: {\n                                                           // Always sort modules by time.\n                                                           int result =\n                                                             moduleY.ExclusiveWeight.CompareTo(moduleX.ExclusiveWeight);\n                                                           return direction == ListSortDirection.Ascending ? -result\n                                                             : result;\n                                                         }\n                                                         default:\n                                                           throw new ArgumentOutOfRangeException();\n                                                       }\n                                                     });\n  }\n\n  public FunctionMarkingSettings MarkingSettings => App.Settings.MarkingSettings;\n\n  //? TODO: Replace all other commands with RelayCommand.\n  public RelayCommand<object> SelectFunctionCallTreeCommand => new(async obj => {\n    await SelectFunctionInPanel(obj, ToolPanelKind.CallTree);\n  });\n  public RelayCommand<object> SelectFunctionFlameGraphCommand => new(async obj => {\n    await SelectFunctionInPanel(obj, ToolPanelKind.FlameGraph);\n  });\n  public RelayCommand<object> SelectFunctionTimelineCommand => new(async obj => {\n    await SelectFunctionInPanel(obj, ToolPanelKind.Timeline);\n  });\n  public RelayCommand<object> PreviewFunctionCommand => new(async obj => {\n    if (obj is IRTextFunctionEx funcEx) {\n      var brush = GetMarkedNodeColor(funcEx);\n      await IRDocumentPopupInstance.ShowPreviewPopup(funcEx.Function, \"\",\n                                                     FunctionList, Session, null, false, brush);\n    }\n  });\n  public RelayCommand<object> CopyAllFunctionsCommand => new(async obj => {\n    CopyFunctionListAsHtml(true);\n  });\n\n  public bool BottomSectionToolbar {\n    get => (bool)GetValue(BottomSectionToolbarProperty);\n    set => SetValue(BottomSectionToolbarProperty, value);\n  }\n\n  public bool FunctionPartVisible {\n    get => (bool)GetValue(FunctionPartVisibleProperty);\n    set => SetValue(FunctionPartVisibleProperty, value);\n  }\n\n  public bool HideToolbars {\n    get => (bool)GetValue(HideToolbarsProperty);\n    set => SetValue(HideToolbarsProperty, value);\n  }\n\n  public bool IsFunctionListVisible {\n    get => isFunctionListVisible_;\n    set {\n      if (isFunctionListVisible_ != value) {\n        isFunctionListVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool IsSectionListVisible {\n    get => isSectionListVisible_;\n    set {\n      if (isSectionListVisible_ != value) {\n        isSectionListVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public string DocumentTitle {\n    get => documentTitle_;\n    set {\n      if (documentTitle_ != value) {\n        documentTitle_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool IsDiffModeEnabled {\n    get => isDiffModeEnabled_;\n    set {\n      if (isDiffModeEnabled_ != value) {\n        isDiffModeEnabled_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool SyncDiffedDocuments {\n    get => syncDiffedDocuments_;\n    set {\n      if (syncDiffedDocuments_ != value) {\n        syncDiffedDocuments_ = value;\n        OnPropertyChanged();\n        SyncDiffedDocumentsChanged?.Invoke(this, value);\n      }\n    }\n  }\n\n  public bool FilterTagged {\n    get => filterTagged_;\n    set {\n      if (filterTagged_ != value) {\n        filterTagged_ = value;\n        OnPropertyChanged();\n        RefreshSectionList();\n      }\n    }\n  }\n\n  public bool FilterDiffFromPrevious {\n    get => filterDiffFromPrevious_;\n    set {\n      if (filterDiffFromPrevious_ != value) {\n        filterDiffFromPrevious_ = value;\n        OnPropertyChanged();\n        RefreshSectionList();\n      }\n    }\n  }\n\n  public bool UseProfileCallTree {\n    get => useProfileCallTree_;\n    set {\n      if (useProfileCallTree_ != value) {\n        useProfileCallTree_ = value;\n        OnPropertyChanged();\n        OnPropertyChanged(nameof(UseIRCallTree));\n      }\n    }\n  }\n\n  public bool UseIRCallTree {\n    get => !useProfileCallTree_;\n    set {\n      if (useProfileCallTree_ == value) {\n        useProfileCallTree_ = !value;\n        OnPropertyChanged(nameof(UseProfileCallTree));\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool SyncSourceFile {\n    get => settings_.SyncSourceFile;\n    set {\n      if (value != settings_.SyncSourceFile) {\n        settings_.SyncSourceFile = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool SyncSelection {\n    get => settings_.SyncSelection;\n    set {\n      if (value != settings_.SyncSelection) {\n        settings_.SyncSelection = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  //? TODO: Remember column width, order\n  public double SelfTimeColumnWidth => settings_ is {AppendTimeToSelfColumn: true} ? 140 : 60;\n  public double TotalTimeColumnWidth => settings_ is {AppendTimeToTotalColumn: true} ? 140 : 60;\n\n  public IRTextSummary Summary {\n    get => summary_;\n    set {\n      if (value != summary_) {\n        summary_ = value;\n        sectionExtensionComputed_ = false;\n      }\n    }\n  }\n\n  public IRTextSummary OtherSummary {\n    get => otherSummary_;\n    set {\n      if (value != otherSummary_) {\n        otherSummary_ = value;\n      }\n    }\n  }\n\n  public bool IsInTwoDocumentsMode => Session != null && Session.IsInTwoDocumentsMode;\n\n  public string OptionalDataColumnName {\n    get => optionalDataColumnName_;\n    set {\n      if (optionalDataColumnName_ != value) {\n        optionalDataColumnName_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool OptionalDataColumnVisible {\n    get => optionalDataColumnVisible_;\n    set {\n      if (optionalDataColumnVisible_ != value) {\n        optionalDataColumnVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public string OptionalDataColumnName2 {\n    get => optionalDataColumnName2_;\n    set {\n      if (optionalDataColumnName2_ != value) {\n        optionalDataColumnName2_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool OptionalDataColumnVisible2 {\n    get => optionalDataColumnVisible2_;\n    set {\n      if (optionalDataColumnVisible2_ != value) {\n        optionalDataColumnVisible2_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool AlternateNameColumnVisible {\n    get => alternateNameColumnVisible_;\n    set {\n      if (alternateNameColumnVisible_ != value) {\n        alternateNameColumnVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool ChildTimeColumnVisible {\n    get => childTimeColumnVisible_;\n    set {\n      if (childTimeColumnVisible_ != value) {\n        childTimeColumnVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool ShowModules {\n    get => settings_.ShowModulePanel;\n    set {\n      if (settings_.ShowModulePanel != value) {\n        settings_.ShowModulePanel = value;\n        OnPropertyChanged();\n        ResizeFunctionFilter(FunctionToolbar.RenderSize.Width);\n      }\n    }\n  }\n\n  public bool ShowChildren {\n    get => showChildren_;\n    set {\n      if (showChildren_ != value) {\n        showChildren_ = value;\n\n        if (showChildren_) {\n          ShowSections = false;\n          IsSectionListVisible = true;\n        }\n        else {\n          IsSectionListVisible = false;\n        }\n\n        OnPropertyChanged(nameof(ShowSections));\n        OnPropertyChanged();\n        OnPropertyChanged(nameof(IsSectionListVisible));\n        ResizeFunctionFilter(FunctionToolbar.RenderSize.Width);\n      }\n    }\n  }\n\n  public bool ShowSections {\n    get => showSections_;\n    set {\n      if (showSections_ != value) {\n        showSections_ = value;\n\n        if (showSections_) {\n          ShowChildren = false;\n          IsSectionListVisible = true;\n        }\n        else {\n          IsSectionListVisible = false;\n        }\n\n        OnPropertyChanged();\n        OnPropertyChanged(nameof(ShowChildren));\n        OnPropertyChanged(nameof(IsSectionListVisible));\n        ResizeFunctionFilter(FunctionToolbar.RenderSize.Width);\n      }\n    }\n  }\n\n  public bool ProfileControlsVisible {\n    get => profileControlsVisible_;\n    set {\n      if (profileControlsVisible_ != value) {\n        profileControlsVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool SectionCountColumnVisible {\n    get => sectionCountColumnVisible_;\n    set {\n      if (sectionCountColumnVisible_ != value) {\n        sectionCountColumnVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool ModuleControlsVisible {\n    get => moduleControlsVisible_;\n    set {\n      if (moduleControlsVisible_ != value) {\n        moduleControlsVisible_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public IRTextFunction CurrentFunction => currentFunction_;\n  public bool HasAnnotatedSections => annotatedSections_.Count > 0;\n  public ICompilerInfoProvider CompilerInfo { get; set; }\n  public override ToolPanelKind PanelKind => ToolPanelKind.Section;\n  public override bool SavesStateToFile => true;\n\n  public List<IRTextSectionEx> Sections {\n    get => sections_;\n    set {\n      if (sections_ != value) {\n        sections_ = value;\n\n        foreach (var sectionEx in sections_) {\n          if (sectionEx.Section != null) {\n            sectionExtMap_[sectionEx.Section] = sectionEx;\n          }\n        }\n\n        UpdateSectionListView();\n      }\n    }\n  }\n\n  public UISectionSettings Settings {\n    get => settings_;\n    set => settings_ = value;\n  }\n\n  public RelayCommand<object> MarkModuleCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n    MarkSelectedNodes(obj, (node, color) =>\n                        markingSettings.AddModuleColor(node.ModuleName, color));\n    markingSettings.UseModuleColors = true;\n    await UpdateMarkedFunctions();\n  });\n  public RelayCommand<object> MarkFunctionCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n    MarkSelectedNodes(obj, (node, color) => {\n      if (settings_.ShowDemangledNames) {\n        markingSettings.AddFunctionColor(node.AlternateName, color);\n      }\n      else {\n        markingSettings.AddFunctionColor(node.Name, color);\n      }\n    });\n    markingSettings.UseFunctionColors = true;\n    await UpdateMarkedFunctions();\n  });\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<IRTextFunction> FunctionSwitched;\n  public event EventHandler<OpenSectionEventArgs> OpenSection;\n  public event EventHandler<DiffModeEventArgs> EnterDiffMode;\n  public event EventHandler<double> SectionListScrollChanged;\n  public event EventHandler<bool> SyncDiffedDocumentsChanged;\n  public event EventHandler<DisplayCallGraphEventArgs> DisplayCallGraph;\n\n  private Brush GetMarkedNodeColor(IRTextFunctionEx node) {\n    return App.Settings.MarkingSettings.\n      GetMarkedNodeBrush(node.Name, node.ModuleName);\n  }\n\n  private static void OnBottomSectionToolbarPropertyChanged(\n    DependencyObject d, DependencyPropertyChangedEventArgs e) {\n    var source = d as SectionPanel;\n    bool placeBottom = (bool)e.NewValue;\n\n    if (placeBottom) {\n      source.FunctionPartVisible = false;\n      var row0 = source.SectionGrid.RowDefinitions[0];\n      var row1 = source.SectionGrid.RowDefinitions[1];\n      double row0Value = row0.Height.Value;\n      var row0Type = row0.Height.GridUnitType;\n\n      source.SectionGrid.RowDefinitions[0].Height =\n        new GridLength(row1.Height.Value, row1.Height.GridUnitType);\n\n      source.SectionGrid.RowDefinitions[1].Height = new GridLength(row0Value, row0Type);\n      Grid.SetRow(source.SectionList, 0);\n      Grid.SetRow(source.SectionToolbarGrid, 1);\n\n      // Hide the settings button.\n      source.FixedToolbar.Visibility = Visibility.Collapsed;\n      source.SectionToolbarGrid.ColumnDefinitions[1].Width = new GridLength(0);\n    }\n  }\n\n  private static void OnFunctionPartVisiblePropertyChanged(DependencyObject d,\n                                                           DependencyPropertyChangedEventArgs e) {\n    var source = d as SectionPanel;\n    bool visible = (bool)e.NewValue;\n\n    if (visible) {\n      source.FunctionPart.Visibility = Visibility.Visible;\n    }\n    else {\n      //? TODO: Can be moved to XAML, similar to RemarkPanel.xaml\n      source.MainGrid.ColumnDefinitions[0].Width = new GridLength(0, GridUnitType.Pixel);\n      source.MainGrid.ColumnDefinitions[1].Width = new GridLength(0, GridUnitType.Pixel);\n      source.MainGrid.ColumnDefinitions[2].Width = new GridLength(1, GridUnitType.Star);\n    }\n  }\n\n  private static void OnHideToolbarsPropertyChanged(DependencyObject d,\n                                                    DependencyPropertyChangedEventArgs e) {\n    var source = d as SectionPanel;\n    bool hide = (bool)e.NewValue;\n\n    if (hide) {\n      source.SectionToolbarGrid.Visibility = Visibility.Collapsed;\n      source.SectionGrid.RowDefinitions[0].Height = new GridLength(0, GridUnitType.Pixel);\n    }\n  }\n\n  public void SetSectionAnnotationState(IRTextSection section, bool hasAnnotations) {\n    if (!settings_.MarkAnnotatedSections) {\n      return;\n    }\n\n    if (!sectionExtMap_.ContainsKey(section)) {\n      return;\n    }\n\n    var sectionExt = sectionExtMap_[section];\n\n    if (hasAnnotations) {\n      sectionExt.IsTagged = true;\n      annotatedSections_.Add(sectionExt);\n    }\n    else if (annotatedSections_.Contains(sectionExt)) {\n      sectionExt.IsTagged = false;\n      annotatedSections_.Remove(sectionExt);\n    }\n  }\n\n  public void SelectSection(IRTextSection section, bool focus = true, bool force = false) {\n    SetupSectionList(section.ParentFunction, force);\n    var sectionEx = GetSectionExtension(section);\n    SectionList.SelectedItem = sectionEx;\n\n    if (sectionEx != null) {\n      MarkCurrentSection(sectionEx);\n      BringIntoViewSelectedListItem(SectionList, focus);\n    }\n  }\n\n  public void AddModuleSummary(IRTextSummary summary) {\n    if (!moduleSummaries_.Contains(summary)) {\n      moduleSummaries_.Add(summary);\n      sectionExtensionComputed_ = false;\n    }\n  }\n\n  public void ClearModuleSummaries() {\n    moduleSummaries_.Clear();\n    sectionExtensionComputed_ = false;\n  }\n\n  public bool HasSummary(IRTextSummary summary) {\n    return summary == summary_ ||\n           moduleSummaries_.Contains(summary);\n  }\n\n  public IRTextSummary FindModuleSummary(string name) {\n    if (summary_.ModuleName == name) {\n      return summary_;\n    }\n\n    return moduleSummaries_.Find(item => item.ModuleName == name);\n  }\n\n  public void RegisterSectionListScrollEvent() {\n    if (sectionsScrollViewer_ != null) {\n      return;\n    }\n\n    // The internal ScrollViewer is not created until items are added,\n    // this is the reason the event is registered in the constructor.\n    sectionsScrollViewer_ = Utils.FindChild<ScrollViewer>(SectionList);\n\n    if (sectionsScrollViewer_ != null) {\n      sectionsScrollViewer_.ScrollChanged += SectionsScrollViewer__ScrollChanged;\n    }\n  }\n\n  public async Task Update(bool force = false, bool analyzeFunctions = true) {\n    if (summary_ != null) {\n      await SetupFunctionList(force);\n    }\n  }\n\n  public async Task ResetUI() {\n    await ResetStatistics();\n    ResetSectionPanel();\n  }\n\n  public async Task SetupFunctionList(bool force = false, bool analyzeFunctions = true) {\n    if (summary_ == null) {\n      await ResetUI();\n      return;\n    }\n\n    // Create mappings between each section and their UI counterpart.\n    if (!SetupSectionExtensions(force)) {\n      await ResetUI();\n      return;\n    }\n\n    // Create mappings between each function and their UI counterparts.\n    // In two-document diff mode, also add entries for functions that are found\n    // only in the left or in the right document and mark them as diffs.\n    functions_ = SetupFunctionExtensions();\n\n    // Prepare UI.\n    await SetupFunctionListUI();\n\n    // Attach additional data to the UI.\n    await LoadFunctionProfile();\n    RestoreListViewColumnsState();\n    await UpdateMarkedFunctions(true);\n\n    if (analyzeFunctions) {\n      await RunFunctionAnalysis();\n    }\n  }\n\n  public async Task UpdateMarkedFunctions(bool externalCall = false) {\n    if (functions_ != null) {\n      UpdateMarkedFunctionsImpl();\n\n      if (!externalCall) {\n        await Session.FunctionMarkingChanged(PanelKind);\n      }\n    }\n  }\n\n  private void UpdateMarkedFunctionsImpl() {\n    var fgSettings = App.Settings.MarkingSettings;\n\n    foreach (var f in functions_) {\n      f.ModuleBackColor = null;\n      f.FunctionBackColor = null;\n    }\n\n    foreach (var module in modules_) {\n      module.BackColor = null;\n    }\n\n    if (!fgSettings.UseAutoModuleColors &&\n        !fgSettings.UseModuleColors &&\n        !fgSettings.UseFunctionColors) {\n      RefreshFunctionList(false);\n      return;\n    }\n\n    foreach (var funcEx in functions_) {\n      if (fgSettings.UseModuleColors &&\n          fgSettings.GetModuleBrush(funcEx.ModuleName, out var brush)) {\n        funcEx.ModuleBackColor = brush;\n      }\n      else if (fgSettings.UseAutoModuleColors) {\n        funcEx.ModuleBackColor = fgSettings.GetAutoModuleBrush(funcEx.ModuleName);\n      }\n\n      if (fgSettings.UseFunctionColors &&\n          fgSettings.GetFunctionColor(funcEx.Name, out var color)) {\n        funcEx.FunctionBackColor = color.AsBrush();\n      }\n    }\n\n    foreach (var module in modules_) {\n      if (module.IsAllEntry) {\n        continue;\n      }\n\n      if (fgSettings.UseModuleColors &&\n          fgSettings.GetModuleBrush(module.Name, out var brush)) {\n        module.BackColor = brush;\n      }\n      else if (fgSettings.UseAutoModuleColors) {\n        module.BackColor = fgSettings.GetAutoModuleBrush(module.Name);\n      }\n    }\n\n    RefreshFunctionList(false);\n    RefreshModuleList();\n  }\n\n  public List<IRTextSectionEx> CreateSectionsExtension(bool force = false) {\n    if (!SetupSectionExtensions(force)) {\n      return new List<IRTextSectionEx>();\n    }\n\n    var sections = new List<IRTextSectionEx>();\n    int sectionIndex = 0;\n\n    if (currentFunction_ == null) {\n      return sections;\n    }\n\n    foreach (var section in currentFunction_.Sections) {\n#if DEBUG\n      if (!sectionExtMap_.ContainsKey(section)) {\n        Utils.WaitForDebugger();\n      }\n#endif\n      var sectionEx = sectionExtMap_[section];\n      sectionEx = new IRTextSectionEx(section, sectionEx.Index);\n      sectionEx.Name = CompilerInfo.NameProvider.GetSectionName(section, false);\n\n      sectionExtMap_[section] = sectionEx;\n      sections.Add(sectionEx);\n\n      if (Session.SectionStyleProvider.IsMarkedSection(section, out var markedName)) {\n        if (settings_.ColorizeSectionNames) {\n          sectionEx.IsMarked = true;\n          sectionEx.TextColor = ColorBrushes.GetBrush(markedName.TextColor);\n        }\n        else {\n          sectionEx.IsMarked = false;\n        }\n\n        if (settings_.ShowSectionSeparators) {\n          ApplySectionBorder(sectionEx, sectionIndex, markedName, sections);\n        }\n        else\n          sectionEx.BorderThickness = new Thickness();\n\n        if (settings_.UseNameIndentation &&\n            markedName.IndentationLevel > 0) {\n          ApplySectionNameIndentation(sectionEx, markedName);\n        }\n      }\n      else {\n        sectionEx.IsMarked = false;\n        sectionEx.BorderThickness = new Thickness();\n      }\n\n      sectionEx.SectionDiffKind = DiffKind.None;\n      sectionEx.LowerIdenticalToPreviousOpacity = sectionIndex > 0 &&\n                                                  settings_.LowerIdenticalToPreviousOpacity;\n      sectionIndex++;\n    }\n\n    return sections;\n  }\n\n  public void DiffSelectedSection() {\n    if (SectionList.SelectedItem != null) {\n      var sectionEx = SectionList.SelectedItem as IRTextSectionEx;\n      var args = new DiffModeEventArgs {\n        IsWithOtherDocument = true, Left = new OpenSectionEventArgs(sectionEx.Section, OpenSectionKind.NewTabDockLeft)\n      };\n      EnterDiffMode?.Invoke(this, args);\n    }\n  }\n\n  public void RefreshSectionList() {\n    if (SectionList.ItemsSource == null) {\n      return;\n    }\n\n    nameSearcher_ = null;\n    ((ListCollectionView)SectionList.ItemsSource).Refresh();\n\n    if (SectionList.Items.Count > 0) {\n      SectionList.ScrollIntoView(SectionList.Items[0]);\n    }\n  }\n\n  public void RefreshFunctionList(bool scrollToFirst = true) {\n    if (FunctionList.ItemsSource == null) {\n      return;\n    }\n\n    nameSearcher_ = null;\n    ((ListCollectionView)FunctionList.ItemsSource).Refresh();\n\n    if (scrollToFirst && FunctionList.Items.Count > 0) {\n      FunctionList.ScrollIntoView(FunctionList.Items[0]);\n    }\n  }\n\n  public void RefreshModuleList(bool scrollToFirst = true) {\n    if (ModulesList.ItemsSource == null) {\n      return;\n    }\n\n    nameSearcher_ = null;\n    ((ListCollectionView)ModulesList.ItemsSource).Refresh();\n  }\n\n  public bool SwitchToSection(int offset, IRDocumentHost targetDocument = null) {\n    int newIndex = SectionList.SelectedIndex + offset;\n\n    while (newIndex >= 0 && newIndex < SectionList.Items.Count) {\n      var section = Sections[newIndex];\n\n      if (!section.IsPlaceholderDiff) {\n        // Not a diff mode placeholder, switch.\n        SwitchToSection(section, targetDocument);\n        return true;\n      }\n\n      // Go left or right to find first real section.\n      if (offset > 0) {\n        newIndex++;\n      }\n      else {\n        newIndex--;\n      }\n    }\n\n    return false;\n  }\n\n  public void SwitchToSection(IRTextSectionEx section, IRDocumentHost targetDocument = null) {\n    SectionList.SelectedItem = section;\n    SectionList.ScrollIntoView(SectionList.SelectedItem);\n    OpenSectionImpl(section, OpenSectionKind.ReplaceCurrent, targetDocument);\n  }\n\n  public void SwitchToSection(IRTextSection section, IRDocumentHost targetDocument = null) {\n    SwitchToSection(Sections.Find(item => item.Section == section), targetDocument);\n  }\n\n  public void ScrollSectionList(double offset) {\n    RegisterSectionListScrollEvent();\n    sectionsScrollViewer_?.ScrollToVerticalOffset(offset);\n  }\n\n  public async Task WaitForStatistics() {\n    await statisticsTask_.WaitForTaskAsync();\n  }\n\n  public async Task ShowModuleReport() {\n    if (functionStatMap_ == null) {\n      await ComputeFunctionStatistics(functions_);\n      await WaitForStatistics();\n\n      if (functionStatMap_ == null) {\n        return;\n      }\n    }\n\n    moduleReport_ = new ModuleReport(functionStatMap_);\n    moduleReport_.Generate();\n\n    var panel = new ModuleReportPanel(Session);\n    panel.TitleSuffix = \"Function report\";\n    panel.ShowReport(moduleReport_, summary_);\n    Session.DisplayFloatingPanel(panel);\n  }\n\n  public void AddCountersFunctionListColumns(bool addDiffColumn, string titleSuffix = \"\", string tooltipSuffix = \"\",\n                                             double columnWidth = double.NaN) {\n    OptionalColumn.RemoveListViewColumns(FunctionList, header => header.Tag is PerformanceCounter);\n    var counters = Session.ProfileData.SortedPerformanceCounters;\n\n    for (int i = 0; i < counters.Count; i++) {\n      var counter = counters[i];\n\n      if (!ProfileDocumentMarker.IsPerfCounterVisible(counter)) {\n        continue;\n      }\n\n      if (!settings_.ShowPerformanceCounterColumns && !counter.IsMetric ||\n          !settings_.ShowPerformanceMetricColumns && counter.IsMetric) {\n        continue;\n      }\n\n      string name = $\"{ProfileDocumentMarker.ShortenPerfCounterName(counter.Name)}\";\n      string tooltip = /*counter?.Config?.Description != null ? $\"{counter.Config.Description}\" : */ $\"{counter.Name}\";\n      int insertionIndex = -1;\n\n      // Insert before the demangled func name column.\n      if (AlternateNameColumnVisible) {\n        insertionIndex = OptionalColumn.FindListViewColumnIndex(\"AlternateNameColumnHeader\", FunctionList);\n      }\n\n      var gridColumn = OptionalColumn.AddListViewColumn(FunctionList,\n                                                        OptionalColumn.Binding(\n                                                          $\"Counters[{counter.Id}]\", $\"PerfCounters{i}\", name, tooltip),\n                                                        functionValueSorter_, \"\", \" counter\", true, insertionIndex);\n      gridColumn.Header.Tag = counter;\n    }\n  }\n\n  public void AddStatisticsFunctionListColumns(bool addDiffColumn, string titleSuffix = \"\", string tooltipSuffix = \"\",\n                                               double columnWidth = double.NaN) {\n    OptionalColumn.RemoveListViewColumns(FunctionList, StatisticsColumns, functionValueSorter_);\n    OptionalColumn.RemoveListViewColumns(FunctionList, CallStatisticsColumns, functionValueSorter_);\n    OptionalColumn.RemoveListViewColumns(FunctionList, StatisticsDiffColumns, functionValueSorter_);\n\n    // Insert before the demangled func name column.\n    int insertionIndex = -1;\n\n    if (AlternateNameColumnVisible) {\n      insertionIndex = OptionalColumn.FindListViewColumnIndex(\"AlternateNameColumnHeader\", FunctionList);\n    }\n\n    var list = OptionalColumn.AddListViewColumns(FunctionList, StatisticsColumns, functionValueSorter_, titleSuffix,\n                                                 tooltipSuffix, addDiffColumn, insertionIndex);\n    insertionIndex = insertionIndex != -1 ? insertionIndex + list.Count : -1;\n\n    if (settings_.IncludeCallGraphStatistics) {\n      var list2 = OptionalColumn.AddListViewColumns(FunctionList, CallStatisticsColumns, functionValueSorter_,\n                                                    titleSuffix, tooltipSuffix, addDiffColumn, insertionIndex);\n      insertionIndex = insertionIndex != -1 ? insertionIndex + list2.Count : -1;\n    }\n\n    if (addDiffColumn) {\n      OptionalColumn.AddListViewColumns(FunctionList, StatisticsDiffColumns, functionValueSorter_, null, null, false,\n                                        insertionIndex);\n    }\n  }\n\n  public void MarkFunctions(List<IRTextFunction> list) {\n    foreach (var func in list) {\n      if (functionExtMap_.TryGetValue(func, out var funcEx)) {\n        funcEx.IsMarked = true;\n      }\n    }\n  }\n\n  public void ClearMarkedFunctions() {\n    foreach (var funcEx in functionExtMap_.Values) {\n      funcEx.IsMarked = false;\n    }\n  }\n\n  protected void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private async Task SelectFunctionInPanel(object target, ToolPanelKind panelKind) {\n    if (target is IRTextFunctionEx funcEx) {\n      await Session.SelectProfileFunctionInPanel(funcEx.Function, panelKind);\n    }\n  }\n\n  private void BringIntoViewSelectedListItem(ListView list, bool focus) {\n    list.ScrollIntoView(list.SelectedItem);\n\n    if (focus) {\n      var item = list.ItemContainerGenerator.ContainerFromItem(list.SelectedItem) as ListViewItem;\n      item?.Focus();\n    }\n  }\n\n  private void SectionsScrollViewer__ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    SectionListScrollChanged?.Invoke(this, e.VerticalOffset);\n  }\n\n  private void SetDemangledFunctionNames(List<IRTextFunctionEx> functions) {\n    if (!Session.CompilerInfo.NameProvider.IsDemanglingSupported ||\n        !Session.CompilerInfo.NameProvider.IsDemanglingEnabled) {\n      AlternateNameColumnVisible = false;\n\n      // Clear the cached names.\n      foreach (var funcEx in functions) {\n        funcEx.Name = null;\n      }\n\n      return;\n    }\n\n    // Set mangled name as alternate.\n    foreach (var funcEx in functions) {\n      funcEx.AlternateName = funcEx.Function.Name;\n    }\n\n    AlternateNameColumnVisible = settings_.ShowMangleNamesColumn;\n  }\n\n  private async Task LoadFunctionProfile() {\n    var profile = Session.ProfileData;\n\n    if (profile == null) {\n      OptionalDataColumnVisible = false;\n      OptionalDataColumnVisible2 = false;\n      return;\n    }\n\n    var modulesEx = new List<ModuleEx>();\n\n    foreach (var pair in profile.ModuleWeights) {\n      double weightPercentage = profile.ScaleModuleWeight(pair.Value);\n\n      var moduleInfo = new ModuleEx {\n        Name = profile.Modules[pair.Key].ModuleName,\n        ExclusivePercentage = weightPercentage,\n        ExclusiveWeight = pair.Value\n      };\n\n      // Set warnings for missing binary/debug files.\n      var moduleStatus = profile.Report?.GetModuleStatus(profile.Modules[pair.Key].ModuleName);\n\n      if (moduleStatus != null) {\n        moduleInfo.Status = moduleStatus;\n        moduleInfo.DebugFileMissing = !moduleStatus.HasDebugInfoLoaded;\n\n        // Log the module status for debugging\n        ProfileExplorer.Core.Utilities.DiagnosticLogger.LogDebug($\"[UI-ModuleStatus] Module {moduleInfo.Name}: BinaryLoaded={moduleStatus.HasBinaryLoaded}, LazyLoadPending={moduleStatus.State == ProfileExplorer.Core.Profile.Data.ModuleLoadState.LazyLoadPending}, DebugInfoLoaded={moduleStatus.HasDebugInfoLoaded}\");\n        ProfileExplorer.Core.Utilities.DiagnosticLogger.LogDebug($\"[UI-ModuleStatus] Module {moduleInfo.Name}: BinaryFileMissing={moduleInfo.BinaryFileMissing}, DebugFileMissing={moduleInfo.DebugFileMissing}\");\n      } else {\n        ProfileExplorer.Core.Utilities.DiagnosticLogger.LogWarning($\"[UI-ModuleStatus] No module status found for {moduleInfo.Name}\");\n      }\n\n      modulesEx.Add(moduleInfo);\n    }\n\n    // Add one entry to represent all modules.\n    double allWeightPercentage = profile.ScaleFunctionWeight(profile.ProfileWeight);\n    var allModules = new ModuleEx {\n      Name = \"All\",\n      IsAllEntry = true,\n      ExclusivePercentage = allWeightPercentage,\n      ExclusiveWeight = profile.ProfileWeight\n    };\n    modulesEx.Add(allModules);\n\n    var modulesFilter = new ListCollectionView(modulesEx);\n    ModulesList.ItemsSource = modulesFilter;\n    moduleValueSorter_.SortByField(ModuleFieldKind.Name);\n    ModulesList.SelectedItem = allModules;\n    modules_ = modulesEx;\n\n    OptionalDataColumnVisible = true;\n    OptionalDataColumnName = \"Time (self)\";\n    OptionalDataColumnVisible2 = true;\n    OptionalDataColumnName2 = \"Time (total)\";\n    var markerOptions = App.Settings.DocumentSettings.ProfileMarkerSettings;\n    bool hasPerfCounters = false;\n\n    // Add the profile info and column data to each function.\n    hasPerfCounters = await Task.Run(() =>\n                                       PrepareFunctionProfile(functions_, profile, markerOptions));\n\n    if (hasPerfCounters) {\n      // Wait for all other columns to be added to the UI first\n      // before adding the counter columns, which are relative to other\n      // columns, such as the mangled name.\n      Dispatcher.BeginInvoke(() => {\n        AddCountersFunctionListColumns(false);\n      }, DispatcherPriority.ContextIdle);\n    }\n\n    functionValueSorter_.SortByField(FunctionFieldKind.Optional);\n    ProfileControlsVisible = true;\n    ModuleControlsVisible = true;\n    IsFunctionListVisible = false;\n    IsFunctionListVisible = true;\n    SectionCountColumnVisible = false;\n    ShowSections = false;\n    UseProfileCallTree = true;\n\n    // Update column visibility and state.\n    GridViewColumnVisibility.UpdateListView(FunctionList);\n    Utils.ScrollToFirstListViewItem(FunctionList);\n    SetupStackFunctionHoverPreview();\n  }\n\n  private static bool PrepareFunctionProfile(List<IRTextFunctionEx> functions, ProfileData profile,\n                                             ProfileDocumentMarkerSettings markerOptions) {\n    bool hasPerfCounters = false;\n\n    foreach (var funcEx in functions) {\n      var funcProfile = profile.GetFunctionProfile(funcEx.Function);\n\n      if (funcProfile != null) {\n        double exclusivePercentage = profile.ScaleFunctionWeight(funcProfile.ExclusiveWeight);\n        funcEx.ExclusivePercentage = exclusivePercentage;\n        funcEx.ExclusiveWeight = funcProfile.ExclusiveWeight;\n        funcEx.BackColor = markerOptions.PickBrushForPercentage(exclusivePercentage);\n\n        double percentage = profile.ScaleFunctionWeight(funcProfile.Weight);\n        funcEx.Percentage = percentage;\n        funcEx.Weight = funcProfile.Weight;\n        funcEx.BackColor2 = markerOptions.PickBrushForPercentage(percentage);\n\n        if (funcProfile.HasPerformanceCounters) {\n          hasPerfCounters = true;\n          var counters = funcProfile.ComputeFunctionTotalCounters();\n          funcEx.Counters = new PerformanceCounterSetEx(counters.Count);\n\n          // Add values for metrics first.\n          foreach (var counter in profile.SortedPerformanceCounters) {\n            if (counter.IsMetric) {\n              var counterEx = new PerformanceCounterSetEx.PerformanceCounterValueEx {CounterId = counter.Id};\n              var metric = counter as PerformanceMetric;\n              counterEx.Value = metric.ComputeMetric(counters, out long _, out long _);\n              counterEx.Label = ProfileDocumentMarker.FormatPerformanceMetric(counterEx.Value, metric);\n              funcEx.Counters.Add(counterEx);\n            }\n          }\n\n          foreach (var counter in counters.Counters) {\n            var counterInfo = profile.GetPerformanceCounter(counter.CounterId);\n\n            if (!counterInfo.IsMetric) {\n              var counterEx = new PerformanceCounterSetEx.PerformanceCounterValueEx {CounterId = counter.CounterId};\n              counterEx.Value = counter.Value;\n              counterEx.Label = ProfileDocumentMarker.FormatPerformanceCounter(counter.Value, counterInfo);\n              funcEx.Counters.Add(counterEx);\n            }\n          }\n        }\n      }\n      else {\n        funcEx.ExclusiveWeight = TimeSpan.Zero;\n        funcEx.Weight = TimeSpan.Zero;\n      }\n    }\n\n    return hasPerfCounters;\n  }\n\n  private void SetupStackFunctionHoverPreview() {\n    if (preview_ != null) {\n      preview_.Unregister();\n      preview_ = null;\n    }\n\n    preview_ = new PopupHoverPreview(\n      FunctionList, TimeSpan.FromMilliseconds(settings_.CallStackPopupDuration),\n      (mousePoint, previewPoint) => {\n        if (!settings_.ShowCallStackPopup) {\n          return null;\n        }\n\n        var element = FunctionList.GetObjectAtPoint<ListViewItem>(mousePoint);\n\n        if (element == null ||\n            element.Content is not IRTextFunctionEx funcEx) {\n          return null;\n        }\n\n        var nodeList = Session.ProfileData.CallTree.GetSortedCallTreeNodes(funcEx.Function);\n\n        if (nodeList is not {Count: > 0}) {\n          return null;\n        }\n\n        // Show popup for hottest call stack.\n        var callNode = nodeList[0];\n\n        if (funcBacktracePreviewPopup_ != null) {\n          funcBacktracePreviewPopup_.UpdatePosition(previewPoint, FunctionList);\n        }\n        else {\n          funcBacktracePreviewPopup_ = new CallTreeNodePopup(\n            callNode, null, previewPoint,\n            FunctionList, Session);\n        }\n\n        //? TODO: Max backtrace depth 10 should be a a global profiling option\n        funcBacktracePreviewPopup_.ShowBackTrace(callNode, 10,\n                                                 Session.CompilerInfo.NameProvider.FormatFunctionName);\n        return funcBacktracePreviewPopup_;\n      },\n      (mousePoint, popup) => true,\n      popup => {\n        Session.RegisterDetachedPanel(popup);\n        funcBacktracePreviewPopup_ = null;\n      });\n  }\n\n  private List<IRTextFunctionEx> SetupFunctionExtensions() {\n    var functionsEx = new List<IRTextFunctionEx>();\n    int index = 0;\n\n    if (otherSummary_ != null) {\n      foreach (var function in summary_.Functions) {\n        //? TODO: Use CreateFunctionExtensions\n        var funcEx = new IRTextFunctionEx(function, index++, Session.CompilerInfo.NameProvider.FormatFunctionName);\n        functionExtMap_[function] = funcEx;\n        functionsEx.Add(funcEx);\n\n        if (otherSummary_.FindFunction(function) == null) {\n          // Function missing in right document (removed).\n          funcEx.FunctionDiffKind = DiffKind.Deletion;\n        }\n      }\n\n      foreach (var function in otherSummary_.Functions) {\n        if (summary_.FindFunction(function) == null) {\n          // Function missing in left document (new).\n          var funcEx = new IRTextFunctionEx(function, index++, Session.CompilerInfo.NameProvider.FormatFunctionName);\n          functionExtMap_[function] = funcEx;\n          functionsEx.Add(funcEx);\n          funcEx.FunctionDiffKind = DiffKind.Insertion;\n        }\n      }\n    }\n    else {\n      // Single document mode.\n      CreateFunctionExtensions(summary_, functionsEx);\n\n      foreach (var moduleSummary in moduleSummaries_) {\n        CreateFunctionExtensions(moduleSummary, functionsEx);\n      }\n    }\n\n    SetDemangledFunctionNames(functionsEx);\n    return functionsEx;\n  }\n\n  private async Task SetupFunctionListUI() {\n    if (!FunctionPartVisible) {\n      return;\n    }\n\n    // Set up the filter used to search the list.\n    var functionFilter = new ListCollectionView(functions_);\n    functionFilter.Filter = FilterFunctionList;\n    FunctionList.ItemsSource = functionFilter;\n    SectionList.ItemsSource = null;\n\n    if (summary_.Functions.Count == 1) {\n      await SelectFunction(summary_.Functions[0]);\n    }\n  }\n\n  private async Task RunFunctionAnalysis() {\n    if (settings_.ComputeStatistics) {\n      await ComputeFunctionStatistics(functions_);\n    }\n  }\n\n  private void CreateFunctionExtensions(IRTextSummary summary, List<IRTextFunctionEx> functionsEx) {\n    foreach (var func in summary.Functions) {\n      if (!functionExtMap_.TryGetValue(func, out var funcEx)) {\n        funcEx = new IRTextFunctionEx(func, functionsEx.Count, Session.CompilerInfo.NameProvider.FormatFunctionName);\n        functionExtMap_[func] = funcEx;\n      }\n      else {\n        funcEx.Index = functionsEx.Count;\n      }\n\n      functionsEx.Add(funcEx);\n    }\n  }\n\n  private void ResetSectionPanel() {\n    SectionCountColumnVisible = true;\n    ProfileControlsVisible = false;\n    ModuleControlsVisible = false;\n    SectionList.ItemsSource = null;\n    FunctionList.ItemsSource = null;\n\n    otherSummary_ = null;\n    currentFunction_ = null;\n    moduleReport_ = null;\n    sections_.Clear();\n    sectionExtMap_.Clear();\n    annotatedSections_.Clear();\n    functions_?.Clear();\n    modules_?.Clear();\n    sectionExtensionComputed_ = false;\n\n    SectionList.UpdateLayout();\n    FunctionList.UpdateLayout();\n  }\n\n  private async Task ResetStatistics() {\n    Trace.WriteLine($\"Cancel stats at {DateTime.Now}, ticks {Environment.TickCount64}\");\n\n    if (statisticsTask_ != null) {\n      await statisticsTask_.CancelTaskAndWaitAsync();\n    }\n\n    //Utils.WaitForDebugger(true);\n    Trace.WriteLine($\"Done cancel stats at {DateTime.Now}, ticks {Environment.TickCount64}\");\n    callGraphCache_ = null;\n    functionStatMap_ = null;\n  }\n\n  private bool SetupSectionExtensions(bool force = false) {\n    if (sectionExtensionComputed_ && !force) {\n      return true;\n    }\n\n    if (summary_ == null) {\n      return false;\n    }\n\n    sectionExtMap_.Clear();\n    annotatedSections_.Clear();\n\n    SetupSectionExtensions(summary_);\n\n    foreach (var moduleSummary in moduleSummaries_) {\n      SetupSectionExtensions(moduleSummary);\n    }\n\n    sectionExtensionComputed_ = true;\n    return true;\n  }\n\n  private void SetupSectionExtensions(IRTextSummary summary) {\n    foreach (var func in summary.Functions) {\n      CreateSectionExtensions(func);\n    }\n  }\n\n  private void CreateSectionExtensions(IRTextFunction func) {\n    int index = 0;\n\n    foreach (var section in func.Sections) {\n      if (!sectionExtMap_.ContainsKey(section)) {\n        var sectionEx = new IRTextSectionEx(section, index++);\n        sectionExtMap_[section] = sectionEx;\n      }\n    }\n  }\n\n  private void SetupSectionList(IRTextFunction function, bool force = false) {\n    if (function != null && function.Equals(currentFunction_) && !force) {\n      return;\n    }\n\n    currentFunction_ = function;\n    FunctionList.SelectedItem = function;\n    Sections = CreateSectionsExtension();\n    FunctionSwitched?.Invoke(this, currentFunction_);\n  }\n\n  private void ApplySectionBorder(IRTextSectionEx sectionEx, int sectionIndex,\n                                  MarkedSectionName markedName,\n                                  List<IRTextSectionEx> sections) {\n    // Don't show the border for the first and last sections in the list,\n    // and if there is a before-border following an after-border.\n    bool useBeforeBorder = sectionIndex > 0 && !sections[sectionIndex - 1].HasAfterBorder;\n    bool useAfterBorder = sectionIndex < currentFunction_.Sections.Count - 1;\n\n    sectionEx.BorderThickness = new Thickness(0, useBeforeBorder ? markedName.BeforeSeparatorWeight : 0,\n                                              0, useAfterBorder ? markedName.AfterSeparatorWeight : 0);\n    sectionEx.BorderBrush = ColorBrushes.GetBrush(markedName.SeparatorColor);\n  }\n\n  private void ApplySectionNameIndentation(IRTextSectionEx sectionEx, MarkedSectionName markedName) {\n    int level = markedName.IndentationLevel;\n    var builder = new StringBuilder(sectionEx.Name.Length + level * settings_.IndentationAmount);\n\n    while (level > 0) {\n      builder.Append(' ', settings_.IndentationAmount);\n      level--;\n    }\n\n    builder.Append(sectionEx.Name);\n    sectionEx.Name = builder.ToString();\n  }\n\n  private void UpdateSectionListView() {\n    var sectionFilter = new ListCollectionView(sections_);\n    sectionFilter.Filter = FilterSectionList;\n    SectionList.ItemsSource = sectionFilter;\n\n    if (SectionList.Items.Count > 0) {\n      SectionList.SelectedItem = SectionList.Items[0];\n      SectionList.ScrollIntoView(SectionList.SelectedItem);\n    }\n\n    RegisterSectionListScrollEvent();\n  }\n\n  private bool FilterFunctionList(object value) {\n    var functionEx = (IRTextFunctionEx)value;\n\n    if (activeModuleFilter_ != null) {\n      if (functionEx.ModuleName != activeModuleFilter_.Name) {\n        return false;\n      }\n    }\n\n    // Don't filter with less than 2 letters.\n    string text = FunctionFilter.Text.Trim();\n\n    if (text.Length < 2) {\n      return true;\n    }\n\n    if (nameSearcher_ == null) {\n      nameSearcher_ = new TextSearcher(text, !App.Settings.SectionSettings.FunctionSearchCaseSensitive);\n    }\n\n    // Search the function name.\n    if (nameSearcher_.Includes(functionEx.Name)) {\n      return true;\n    }\n\n    // Search the demangled name.\n    return !string.IsNullOrEmpty(functionEx.AlternateName) &&\n           nameSearcher_.Includes(functionEx.AlternateName);\n  }\n\n  private bool FilterSectionList(object value) {\n    var section = (IRTextSectionEx)value;\n\n    if (section.IsSelected) {\n      return true;\n    }\n\n    if (FilterTagged && !section.IsTagged) {\n      return false;\n    }\n\n    if (FilterDiffFromPrevious && !section.IsDiffFromPrevious) {\n      return false;\n    }\n\n    string text = SectionFilter.Text.Trim();\n    return text.Length <= 0 ||\n           (App.Settings.SectionSettings.SectionSearchCaseSensitive\n             ? section.Name.Contains(text, StringComparison.Ordinal)\n             : section.Name.Contains(text, StringComparison.OrdinalIgnoreCase));\n  }\n\n  private void ExecuteClearTextbox(object sender, ExecutedRoutedEventArgs e) {\n    ((TextBox)e.Parameter).Text = string.Empty;\n  }\n\n  private void OpenExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (SectionList.SelectedItems.Count == 2) {\n      OpenSideBySideExecuted(sender, e);\n      return;\n    }\n\n    if (GetCommandTargetSection(e) is { } section) {\n      OpenSectionImpl(section, OpenSectionKind.ReplaceCurrent);\n    }\n  }\n\n  private void OpenInNewTabExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (SectionList.SelectedItems.Count == 2) {\n      DiffSideBySideExecuted(sender, e);\n      return;\n    }\n\n    if (GetCommandTargetSection(e) is { } section) {\n      OpenSectionImpl(section, OpenSectionKind.NewTab);\n    }\n  }\n\n  private void OpenLeftExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetCommandTargetSection(e) is { } section) {\n      OpenSectionImpl(section, OpenSectionKind.NewTabDockLeft);\n    }\n  }\n\n  private void OpenRightExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GetCommandTargetSection(e) is { } section) {\n      OpenSectionImpl(section, OpenSectionKind.NewTabDockRight);\n    }\n  }\n\n  private IRTextSectionEx GetCommandTargetSection(ExecutedRoutedEventArgs e) {\n    var section = e.Parameter as IRTextSectionEx;\n\n    if (e.Parameter is IRTextFunctionEx functionEx) {\n      section = GetSectionExtension(functionEx.Function.Sections[0]);\n    }\n\n    return section;\n  }\n\n  private void OpenSideBySideExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (SectionList.SelectedItems.Count == 2) {\n      var leftSection = SectionList.SelectedItems[0] as IRTextSectionEx;\n      var rightSection = SectionList.SelectedItems[1] as IRTextSectionEx;\n      OpenSectionImpl(leftSection, OpenSectionKind.NewTabDockLeft);\n      OpenSectionImpl(rightSection, OpenSectionKind.NewTabDockRight);\n    }\n  }\n\n  private void OpenSideBySideCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = SectionList.SelectedItems.Count == 2;\n    e.Handled = true;\n  }\n\n  private void DiffWithOtherDocumentCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = IsDiffModeEnabled;\n    e.Handled = true;\n  }\n\n  private void SyncDiffedDocumentsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    e.Handled = true;\n  }\n\n  private void DiffSideBySideExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var leftSectionEx = SectionList.SelectedItems[0] as IRTextSectionEx;\n    var rightSectionEx = SectionList.SelectedItems[1] as IRTextSectionEx;\n\n    var args = new DiffModeEventArgs {\n      Left = new OpenSectionEventArgs(leftSectionEx.Section, OpenSectionKind.NewTabDockLeft),\n      Right = new OpenSectionEventArgs(rightSectionEx.Section, OpenSectionKind.NewTabDockRight)\n    };\n\n    EnterDiffMode?.Invoke(this, args);\n  }\n\n  private void DiffWithOtherDocumentExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var sectionEx = SectionList.SelectedItems[0] as IRTextSectionEx;\n    DiffWithOtherSection(sectionEx);\n  }\n\n  private void DiffWithOtherSection(IRTextSectionEx sectionEx) {\n    var args = new DiffModeEventArgs\n      {IsWithOtherDocument = true, Left = new OpenSectionEventArgs(sectionEx.Section, OpenSectionKind.NewTabDockLeft)};\n    EnterDiffMode?.Invoke(this, args);\n  }\n\n  private void ToggleTagExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var section = e.Parameter as IRTextSectionEx;\n\n    if (section != null) {\n      section.IsTagged = !section.IsTagged;\n    }\n  }\n\n  private void FocusSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    FunctionFilter.Focus();\n    FunctionFilter.SelectAll();\n  }\n\n  private async void FunctionList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (e.AddedItems.Count == 1) {\n      await SelectFunction(((IRTextFunctionEx)FunctionList.SelectedItem).Function);\n    }\n\n    if (FunctionList.SelectedItems.Count > 1) {\n      var selectedNodes = new List<ProfileCallTreeNode>();\n\n      foreach (object item in FunctionList.SelectedItems) {\n        if (item is IRTextFunctionEx funcEx) {\n          selectedNodes.Add(Session.ProfileData.CallTree.GetCombinedCallTreeNode(funcEx.Function));\n        }\n      }\n\n      var weightSum = ProfileCallTree.CombinedCallTreeNodesWeight(selectedNodes);\n      double weightPercentage = Session.ProfileData.ScaleFunctionWeight(weightSum);\n      string text =\n        $\"Selected {FunctionList.SelectedItems.Count}: {weightPercentage.AsPercentageString()} ({weightSum.AsMillisecondsString()})\";\n      Session.SetApplicationStatus(text, \"Sum of time for the selected functions\");\n    }\n  }\n\n  private (TimeSpan Weight, TimeSpan ExclusiveWeight) ComputeSelectedFunctionsWeight() {\n    var weight = TimeSpan.Zero;\n    var exclusiveWeight = TimeSpan.Zero;\n\n    foreach (var functionEx in FunctionList.SelectedItems.Cast<IRTextFunctionEx>()) {\n      weight += functionEx.Weight;\n      exclusiveWeight += functionEx.ExclusiveWeight;\n    }\n\n    return (weight, exclusiveWeight);\n  }\n\n  private void SectionFilter_TextChanged(object sender, TextChangedEventArgs e) {\n    SectionList.Focus();\n    RefreshSectionList();\n    SectionFilter.Focus();\n  }\n\n  private void FunctionFilter_TextChanged(object sender, TextChangedEventArgs e) {\n    FunctionList.Focus();\n    RefreshFunctionList();\n    FunctionFilter.Focus();\n  }\n\n  private void SectionDoubleClick(object sender, MouseButtonEventArgs e) {\n    var sectionEx = ((ListViewItem)sender).Content as IRTextSectionEx;\n    OpenSectionImpl(sectionEx);\n  }\n\n  private void OpenSectionImpl(IRTextSection section) {\n    OpenSectionImpl(GetSectionExtension(section));\n  }\n\n  private void OpenSectionImpl(IRTextSectionEx sectionEx) {\n    if (Session.IsInTwoDocumentsDiffMode) {\n      DiffWithOtherSection(sectionEx);\n    }\n    else {\n      bool inNewTab = (Keyboard.Modifiers & ModifierKeys.Control) != 0 ||\n                      (Keyboard.Modifiers & ModifierKeys.Shift) != 0;\n      OpenSectionImpl(sectionEx, inNewTab ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent);\n    }\n  }\n\n  private void OpenSectionImpl(IRTextSectionEx value, OpenSectionKind kind,\n                               IRDocumentHost targetDocument = null) {\n    if (OpenSection != null && value.Section != null) {\n      MarkCurrentSection(value);\n      OpenSection(this, new OpenSectionEventArgs(value.Section, kind, targetDocument));\n    }\n  }\n\n  private void PreviousButton_Click(object sender, RoutedEventArgs e) {\n    SwitchToSection(-1);\n  }\n\n  private void NextButton_Click(object sender, RoutedEventArgs e) {\n    SwitchToSection(1);\n  }\n\n  private void MarkCurrentSection(IRTextSectionEx section) {\n    foreach (var item in sections_) {\n      item.IsSelected = false;\n    }\n\n    section.IsSelected = true;\n  }\n\n  private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = true;\n    e.Handled = true;\n  }\n\n  private void PreviousSectionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SwitchToSection(-1);\n    e.Handled = true;\n  }\n\n  private void NextSectionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SwitchToSection(1);\n    e.Handled = true;\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async Task ComputeConsecutiveSectionDiffs() {\n    if (!settings_.MarkSectionsIdenticalToPrevious || sections_.Count < 2) {\n      return;\n    }\n\n    // Make a list of all section pairs like [i - 1, i] and diff each one.\n    // Note that when comparing two documents side-by-side, some of the sections\n    // may be placeholders that don't have a real section behind, those must be ignored.\n    var comparedSections = new List<(IRTextSection, IRTextSection)>();\n    int prevIndex = -1;\n\n    for (int i = 0; i < sections_.Count; i++) {\n      if (sections_[i].Section == null) {\n        continue;\n      }\n\n      if (prevIndex != -1) {\n        comparedSections.Add((sections_[prevIndex].Section, sections_[i].Section));\n      }\n\n      prevIndex = i;\n    }\n\n    //? TODO: Pass the LoadedDocument to the panel, not Summary.\n    var loader = Session.SessionState.FindLoadedDocument(Summary).Loader;\n    var diffBuilder = new DocumentDiffBuilder(App.Settings.DiffSettings);\n    var cancelableTask = new CancelableTask();\n    var results = await diffBuilder.AreSectionsDifferent(comparedSections, loader, loader,\n                                                         Session.CompilerInfo, true, cancelableTask);\n\n    foreach (var result in results) {\n      if (result.HasDiffs) {\n        var diffSection = GetSectionExtension(result.RightSection);\n        diffSection.IsDiffFromPrevious = true;\n      }\n    }\n  }\n\n  private void FixedToolbar_SettingsClicked(object sender, EventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<SectionOptionsPanel, UISectionSettings>(\n      Settings.Clone(), FunctionList, Session,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(Settings)) {\n          await HandleNewSettings(newSettings, commit);\n        }\n\n        return newSettings.Clone();\n      },\n      () => optionsPanelPopup_ = null);\n  }\n\n  public override Task OnReloadSettings() {\n    return HandleNewSettings(App.Settings.SectionSettings, false, true);\n  }\n\n  private async Task HandleNewSettings(UISectionSettings newSettings, bool commit, bool force = false) {\n    if (commit) {\n      App.Settings.SectionSettings = newSettings;\n      App.SaveApplicationSettings();\n    }\n\n    if (force || !newSettings.Equals(settings_) ||\n        !MarkingSettings.Equals(initialMarkingSettings_)) {\n      bool updateFunctionList = newSettings.HasFunctionListChanges(settings_);\n      App.Settings.SectionSettings = newSettings;\n      settings_ = newSettings;\n\n      if (updateFunctionList) {\n        CompilerInfo.NameProvider.SettingsChanged();\n        await SetupFunctionList();\n      }\n\n      SetupSectionList(currentFunction_, true);\n      RefreshSectionList();\n      await ComputeConsecutiveSectionDiffs();\n\n      if (ProfileControlsVisible) {\n        SetupStackFunctionHoverPreview();\n        OnPropertyChanged(nameof(SyncSelection));\n        OnPropertyChanged(nameof(SyncSourceFile));\n        OnPropertyChanged(nameof(ShowModules));\n      }\n\n      await UpdateMarkedFunctions();\n      initialMarkingSettings_ = MarkingSettings.Clone();\n    }\n  }\n\n  private async void CopySectionTextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (e.Parameter is IRTextSectionEx sectionEx) {\n      string text = await Session.GetSectionTextAsync(sectionEx.Section);\n      Clipboard.SetText(text);\n    }\n  }\n\n  private async void SaveSectionTextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!(e.Parameter is IRTextSectionEx sectionEx)) {\n      return;\n    }\n\n    string path = Utils.ShowSaveFileDialog(\"IR text|*.txt\", \"*.txt|All Files|*.*\");\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        string text = await Session.GetSectionTextAsync(sectionEx.Section);\n        await File.WriteAllTextAsync(path, text);\n      }\n      catch (Exception ex) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Failed to save IR text file {path}: {ex.Message}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  private async void SaveFunctionTextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!(e.Parameter is IRTextFunctionEx functionEx)) {\n      return;\n    }\n\n    string path = Utils.ShowSaveFileDialog(\"IR text|*.txt\", \"*.txt|All Files|*.*\");\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        await using var writer = new StreamWriter(path);\n        await CombineFunctionText(functionEx.Function, writer);\n      }\n      catch (Exception ex) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Failed to save IR text file {path}: {ex.Message}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  private async Task CombineFunctionText(IRTextFunction function, TextWriter writer) {\n    foreach (var section in function.Sections) {\n      string text = await Session.GetSectionTextAsync(section);\n\n      if (section.OutputBefore != null) {\n        string beforeText = await Session.GetSectionOutputTextAsync(section.OutputBefore, section);\n        await writer.WriteLineAsync(beforeText);\n      }\n\n      await writer.WriteLineAsync(text);\n    }\n  }\n\n  private void CopyFunctionNameExecuted(object sender, ExecutedRoutedEventArgs e) {\n    string text = \"\";\n\n    foreach (IRTextFunctionEx func in FunctionList.SelectedItems) {\n      if (!string.IsNullOrEmpty(text)) {\n        text += Environment.NewLine;\n      }\n\n      text += Session.CompilerInfo.NameProvider.GetFunctionName(func.Function);\n    }\n\n    Clipboard.SetText(text);\n  }\n\n  private void CopyDemangledFunctionNameExecuted(object sender, ExecutedRoutedEventArgs e) {\n    string text = \"\";\n\n    foreach (IRTextFunctionEx func in FunctionList.SelectedItems) {\n      if (!string.IsNullOrEmpty(text)) {\n        text += Environment.NewLine;\n      }\n\n      text += Session.CompilerInfo.NameProvider.FormatFunctionName(func.Function);\n    }\n\n    Clipboard.SetText(text);\n  }\n\n  private void DisplayCallGraphExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (e.Parameter is IRTextSectionEx sectionEx) {\n      DisplayCallGraph?.Invoke(this, new DisplayCallGraphEventArgs(Summary, sectionEx.Section, false));\n    }\n  }\n\n  private IRTextFunction GetSelectedFunction(ExecutedRoutedEventArgs e) {\n    if (e.Parameter is IRTextFunctionEx funcEx) {\n      return funcEx.Function;\n    }\n\n    if (e.Parameter is IRTextSectionEx sectionEx) {\n      return sectionEx.Section.ParentFunction;\n    }\n\n    return null;\n  }\n\n  private void DisplayPartialCallGraphExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (e.Parameter is IRTextSectionEx sectionEx) {\n      DisplayCallGraph?.Invoke(this, new DisplayCallGraphEventArgs(Summary, sectionEx.Section, true));\n    }\n  }\n\n  private void ToolBar_SizeChanged(object sender, SizeChangedEventArgs e) {\n    ResizeFunctionFilter(e.NewSize.Width);\n  }\n\n  private void ResizeFunctionFilter(double width) {\n    //? TODO: Hacky way to resize the function search textbox in the toolbar\n    //? when the toolbar gets smaller - couldn't find another way to do this in WPF...\n    double reservedWidth = 20;\n\n    if (profileControlsVisible_) {\n      reservedWidth += 120;\n    }\n\n    if (moduleControlsVisible_) {\n      reservedWidth += 80;\n    }\n\n    FunctionFilterGrid.Width = Math.Max(1, width - reservedWidth);\n  }\n\n  private async void FunctionDoubleClick(object sender, MouseButtonEventArgs e) {\n    await OpenFunction(sender);\n  }\n\n  private async Task OpenFunction(object sender) {\n    // A double-click on the +/- icon doesn't have an actual node selected.\n    var functionEx = ((ListViewItem)sender).Content as IRTextFunctionEx;\n\n    if (functionEx != null) {\n      await SelectFunction(functionEx.Function);\n\n      if (functionEx.SectionCount > 0) {\n        OpenSectionImpl(functionEx.Function.Sections[0]);\n      }\n    }\n  }\n\n  private async Task ComputeFunctionStatistics(List<IRTextFunctionEx> functions) {\n    Trace.TraceInformation(\"ComputeFunctionStatistics: start\");\n    using var cancelableTask = await statisticsTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (functionStatMap_ == null || functionStatMap_.Count < functions.Count) {\n      functionStatMap_ = await ComputeFunctionStatisticsImpl(functions, cancelableTask);\n\n      if (cancelableTask.IsCanceled) {\n        return;\n      }\n    }\n\n    foreach (var pair in functionStatMap_) {\n      var functionEx = GetFunctionExtension(pair.Key);\n      functionEx.Statistics = pair.Value;\n    }\n\n    Trace.TraceInformation(\"ComputeFunctionStatistics: done\");\n    statisticsTask_.CompleteTask();\n\n    AddStatisticsFunctionListColumns(addDiffColumn: false);\n    RefreshFunctionList();\n    Session.SetApplicationProgress(false, double.NaN);\n  }\n\n  private async Task<ConcurrentDictionary<IRTextFunction, FunctionCodeStatistics>>\n    ComputeFunctionStatisticsImpl(List<IRTextFunctionEx> functions, CancelableTask cancelableTask) {\n    var functionStatMap = new ConcurrentDictionary<IRTextFunction, FunctionCodeStatistics>();\n\n    if (functions.Count == 0) {\n      return functionStatMap;\n    }\n\n    callGraphCache_ ??= new ConcurrentDictionary<IRTextSummary, CallGraph>();\n    Session.SetApplicationProgress(true, double.NaN, \"Computing statistics\");\n\n    // If call graph not requested, don't waste time with called function names.\n    foreach (var loadedDoc in Session.SessionState.Documents) {\n      if (loadedDoc.Loader is DisassemblerSectionLoader disasmLoader) {\n        disasmLoader.ResolveCallTargetNames = settings_.IncludeCallGraphStatistics;\n      }\n    }\n\n    if (settings_.IncludeCallGraphStatistics) {\n      var summaries = new List<IRTextSummary>();\n      summaries.Add(summary_);\n      summaries.AddRange(moduleSummaries_);\n      var cgTasks = new List<Task>();\n      var cgTaskScheduler = new ConcurrentExclusiveSchedulerPair(TaskScheduler.Default, 8);\n      var cgTaskFactory = new TaskFactory(cgTaskScheduler.ConcurrentScheduler);\n\n      foreach (var summary in summaries) {\n        cgTasks.Add(cgTaskFactory.StartNew(async () => {\n          try {\n            if (cancelableTask.IsCanceled) {\n              return;\n            }\n\n            await GenerateCallGraph(summary);\n          }\n          catch (Exception ex) {\n            Trace.WriteLine($\"Failed to compute call graph: {ex.Message}\");\n          }\n        }, cancelableTask.Token));\n      }\n\n      await Task.WhenAll(cgTasks.ToArray());\n    }\n\n    var tasks = new List<Task>();\n    var taskScheduler = new ConcurrentExclusiveSchedulerPair(TaskScheduler.Default, 16);\n    var taskFactory = new TaskFactory(taskScheduler.ConcurrentScheduler);\n\n    foreach (var function in functions) {\n      if (function.SectionCount == 0) {\n        continue;\n      }\n\n      if (cancelableTask.IsCanceled) {\n        break;\n      }\n\n      tasks.Add(taskFactory.StartNew(async () => {\n        try {\n          if (cancelableTask.IsCanceled) {\n            return;\n          }\n\n          var section = function.Function.Sections[0];\n          var summary = function.Function.ParentSummary;\n          CallGraph callGraph = null;\n\n          if (settings_.IncludeCallGraphStatistics) {\n            callGraph = await GenerateCallGraph(summary);\n          }\n\n          var loadedDoc = Session.SessionState.FindLoadedDocument(summary);\n          var sectionStats = ComputeFunctionStatistics(section, loadedDoc.Loader, callGraph);\n\n          if (sectionStats != null) {\n            functionStatMap.TryAdd(function.Function, sectionStats);\n          }\n        }\n        catch (Exception ex) {\n          Trace.WriteLine($\"Failed to compute func statistics: {ex.Message}\");\n        }\n      }, cancelableTask.Token));\n    }\n\n    await Task.WhenAll(tasks.ToArray());\n\n    if (cancelableTask.IsCanceled) {\n      // Complete only now after all tasks were canceled,\n      // otherwise the session ending would move on and break the tasks still executing.\n      cancelableTask.Complete();\n    }\n\n    foreach (var loadedDoc in Session.SessionState.Documents) {\n      if (loadedDoc.Loader is DisassemblerSectionLoader disasmLoader) {\n        disasmLoader.ResolveCallTargetNames = true;\n      }\n    }\n\n    Session.SetApplicationProgress(false, double.NaN);\n    return functionStatMap;\n  }\n\n  private FunctionCodeStatistics ComputeFunctionStatistics(IRTextSection section, IRTextSectionLoader loader,\n                                                           CallGraph callGraph) {\n    var result = loader.LoadSection(section);\n\n    if (result == null) {\n      return null;\n    }\n\n    var stats = FunctionCodeStatistics.Compute(result.Function, Session.CompilerInfo.IR);\n\n    if (callGraph != null) {\n      var node = callGraph.FindNode(section.ParentFunction);\n\n      if (node != null) {\n        stats.Callees = node.UniqueCalleeCount;\n        stats.Callers = node.UniqueCallerCount;\n      }\n    }\n\n    return stats;\n  }\n\n  private void ModuleDoubleClick(object sender, MouseButtonEventArgs e) {\n    SwitchModule(sender);\n  }\n\n  private void ModulesList_OnSelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (ModulesList.SelectedItem is ModuleEx moduleEx) {\n      SelectModule(moduleEx);\n    }\n  }\n\n  private void SelectModule(ModuleEx moduleEx) {\n    if (moduleEx != null) {\n      ClearMarkedFunctions();\n\n      if (!moduleEx.IsAllEntry) {\n        var summary = FindModuleSummary(moduleEx.Name);\n\n        if (summary != null) {\n          MarkFunctions(summary.Functions);\n        }\n      }\n    }\n  }\n\n  private void SwitchModule(object sender) {\n    var moduleEx = ((ListViewItem)sender).Content as ModuleEx;\n\n    if (moduleEx != null) {\n      ApplyModuleFilter(moduleEx);\n      ClearMarkedFunctions();\n    }\n  }\n\n  private void ApplyModuleFilter(ModuleEx moduleEx) {\n    if (moduleEx.IsAllEntry) {\n      activeModuleFilter_ = null;\n    }\n    else {\n      activeModuleFilter_ = moduleEx;\n    }\n\n    RefreshFunctionList();\n  }\n\n  private void ExportFunctionListExecuted(object sender, ExecutedRoutedEventArgs e) {\n    string path = Utils.ShowSaveFileDialog(\"Excel Worksheets|*.xlsx\", \"*.xlsx|All Files|*.*\");\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        ExportFunctionListAsExcelFile(path);\n      }\n      catch (Exception ex) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Failed to save function list to {path}: {ex.Message}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  private string ExportFunctionListAsMarkdown(List<IRTextFunctionEx> list) {\n    var sb = new StringBuilder();\n    string header = \"| Function | Module |\";\n    string separator = \"|----------|--------|\";\n\n    if (profileControlsVisible_) {\n      header += \" Time (ms) | Time (%) | Time incl (ms) | Time incl (%) |\";\n      separator += \"-----------|----------|----------------|---------------|\";\n    }\n\n    if (alternateNameColumnVisible_) {\n      header += \" Mangled name |\";\n      separator += \"--------------|\";\n    }\n\n    sb.AppendLine(header);\n    sb.AppendLine(separator);\n\n    foreach (var func in list) {\n      if (profileControlsVisible_) {\n        sb.Append($\"| {func.Name} | {func.ModuleName} \" +\n                  $\"| {func.ExclusiveWeight.TotalMilliseconds} \" +\n                  $\"| {func.ExclusivePercentage.AsPercentageString(2, false)} \" +\n                  $\"| {func.Weight.TotalMilliseconds} \" +\n                  $\"| {func.Percentage.AsPercentageString(2, false)} |\");\n      }\n      else {\n        sb.Append($\"| {func.Name} | {func.ModuleName} |\");\n      }\n\n      if (alternateNameColumnVisible_) {\n        sb.AppendLine($\" {func.AlternateName} |\");\n      }\n      else {\n        sb.AppendLine();\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  private HtmlNode ExportFunctionListAsHtml(List<IRTextFunctionEx> list) {\n    string TableStyle = @\"border-collapse:collapse;border-spacing:0;\";\n    string HeaderStyle =\n      @\"background-color:#D3D3D3;white-space:nowrap;text-align:left;vertical-align:top;border-color:black;border-style:solid;border-width:1px;overflow:hidden;padding:2px 2px;font-family:Arial, sans-serif;\";\n    string CellStyle =\n      @\"text-align:left;vertical-align:top;word-wrap:break-word;max-width:300px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;\";\n\n    var doc = new HtmlDocument();\n    var table = doc.CreateElement(\"table\");\n    table.SetAttributeValue(\"style\", TableStyle);\n\n    var thead = doc.CreateElement(\"thead\");\n    var tbody = doc.CreateElement(\"tbody\");\n    var tr = doc.CreateElement(\"tr\");\n\n    var th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Function\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Module\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n    thead.AppendChild(tr);\n\n    if (profileControlsVisible_) {\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = HttpUtility.HtmlEncode(\"Time (ms)\");\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = HttpUtility.HtmlEncode(\"Time (%)\");\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = HttpUtility.HtmlEncode(\"Tine incl (ms)\");\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = HttpUtility.HtmlEncode(\"Time incl (%)\");\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n    }\n\n    if (alternateNameColumnVisible_) {\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = HttpUtility.HtmlEncode(\"Mangled name\");\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n    }\n\n    table.AppendChild(thead);\n\n    foreach (var func in list) {\n      tr = doc.CreateElement(\"tr\");\n      var td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode(func.Name);\n      td.SetAttributeValue(\"style\", CellStyle);\n      tr.AppendChild(td);\n      td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode(func.ModuleName);\n      td.SetAttributeValue(\"style\", CellStyle);\n      tr.AppendChild(td);\n\n      if (profileControlsVisible_) {\n        string backColor = Utils.BrushToString(func.BackColor);\n        string colorAttr = backColor != null ? $\";background-color:{backColor}\" : \"\";\n\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode($\"{func.ExclusiveWeight.TotalMilliseconds}\");\n        td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n        tr.AppendChild(td);\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode($\"{func.ExclusivePercentage.AsPercentageString(2, false)}\");\n        td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n        tr.AppendChild(td);\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode($\"{func.Weight.TotalMilliseconds}\");\n        td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n        tr.AppendChild(td);\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode($\"{func.Percentage.AsPercentageString(2, false)}\");\n        td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n        tr.AppendChild(td);\n      }\n\n      if (alternateNameColumnVisible_) {\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode(func.AlternateName);\n        td.SetAttributeValue(\"style\", CellStyle);\n        tr.AppendChild(td);\n      }\n\n      tbody.AppendChild(tr);\n    }\n\n    table.AppendChild(tbody);\n    doc.DocumentNode.AppendChild(table);\n    return doc.DocumentNode;\n  }\n\n  private void CopyFunctionListAsHtml(bool allFunctions) {\n    var doc = new HtmlDocument();\n    List<IRTextFunctionEx> funcList = null;\n\n    if (allFunctions) {\n      funcList = functions_;\n    }\n    else {\n      funcList = new List<IRTextFunctionEx>();\n\n      foreach (object item in FunctionList.SelectedItems) {\n        funcList.Add((IRTextFunctionEx)item);\n      }\n    }\n\n    doc.DocumentNode.AppendChild(ExportFunctionListAsHtml(funcList));\n    var writer = new StringWriter();\n    doc.Save(writer);\n\n    // Also save as Markdown so that it can be pasted in plain text editors.\n    string plainText = ExportFunctionListAsMarkdown(funcList);\n    Utils.CopyHtmlToClipboard(writer.ToString(), plainText);\n  }\n\n  private async Task<bool> ExportFunctionListAsHtmlFile(string filePath) {\n    try {\n      var funcList = (ListCollectionView)FunctionList.ItemsSource;\n      var doc = new HtmlDocument();\n      doc.DocumentNode.AppendChild(ExportFunctionListAsHtml(funcList.ToList<IRTextFunctionEx>()));\n      var writer = new StringWriter();\n      doc.Save(writer);\n      await File.WriteAllTextAsync(filePath, writer.ToString());\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to export to HTML file: {filePath}, {ex.Message}\");\n      return false;\n    }\n  }\n\n  private async Task<bool> ExportFunctionListAsMarkdownFile(string filePath) {\n    try {\n      var funcList = (ListCollectionView)FunctionList.ItemsSource;\n      string text = ExportFunctionListAsMarkdown(funcList.ToList<IRTextFunctionEx>());\n      await File.WriteAllTextAsync(filePath, text);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to export to Markdown file: {filePath}, {ex.Message}\");\n      return false;\n    }\n  }\n\n  private void ExportFunctionListAsExcelFile(string filePath) {\n    var wb = new XLWorkbook();\n    var ws = wb.Worksheets.Add(\"Functions\");\n    int rowId = 1; // First row is for the table column names.\n    int maxLineLength = 0;\n    var funcList = (ListCollectionView)FunctionList.ItemsSource;\n\n    foreach (IRTextFunctionEx func in funcList) {\n      rowId++;\n      ws.Cell(rowId, 1).Value = func.Name;\n      ws.Cell(rowId, 1).Style.Alignment.Horizontal = XLAlignmentHorizontalValues.Left;\n      maxLineLength = Math.Max(func.Name.Length, maxLineLength);\n      ws.Cell(rowId, 2).Value = func.ModuleName;\n\n      if (profileControlsVisible_) {\n        int columnId = 3;\n        ws.Cell(rowId, columnId + 0).Value = $\"{func.ExclusiveWeight.TotalMilliseconds}\";\n        ws.Cell(rowId, columnId + 1).Value = $\"{func.ExclusivePercentage.AsPercentageString(2, false, \"\")}\";\n        ws.Cell(rowId, columnId + 2).Value = $\"{func.Weight.TotalMilliseconds}\";\n        ws.Cell(rowId, columnId + 3).Value = $\"{func.Percentage.AsPercentageString(2, false, \"\")}\";\n\n        if (func.BackColor != null && func.BackColor is SolidColorBrush colorBrush) {\n          var color = XLColor.FromArgb(colorBrush.Color.A, colorBrush.Color.R, colorBrush.Color.G, colorBrush.Color.B);\n          ws.Cell(rowId, 1).Style.Fill.BackgroundColor = color;\n          ws.Cell(rowId, 2).Style.Fill.BackgroundColor = color;\n          ws.Cell(rowId, columnId + 0).Style.Fill.BackgroundColor = color;\n          ws.Cell(rowId, columnId + 1).Style.Fill.BackgroundColor = color;\n          ws.Cell(rowId, columnId + 2).Style.Fill.BackgroundColor = color;\n          ws.Cell(rowId, columnId + 3).Style.Fill.BackgroundColor = color;\n        }\n\n        if (alternateNameColumnVisible_) {\n          ws.Cell(rowId, columnId + 4).Value = func.AlternateName;\n        }\n      }\n    }\n\n    var firstCell = ws.Cell(1, 1);\n    var lastCell = ws.LastCellUsed();\n    var range = ws.Range(firstCell.Address, lastCell.Address);\n    var table = range.CreateTable();\n    table.Theme = XLTableTheme.None;\n\n    foreach (var cell in table.HeadersRow().Cells()) {\n      if (cell.Address.ColumnNumber == 1) {\n        cell.Value = \"Function\";\n      }\n      else if (cell.Address.ColumnNumber == 2) {\n        cell.Value = \"Module\";\n      }\n      else if (profileControlsVisible_ && cell.Address.ColumnNumber - 3 <= 3) {\n        switch (cell.Address.ColumnNumber - 3) {\n          case 0: {\n            cell.Value = \"Time (ms)\";\n            break;\n          }\n          case 1: {\n            cell.Value = \"Time (%)\";\n            break;\n          }\n          case 2: {\n            cell.Value = \"Time incl (ms)\";\n            break;\n          }\n          case 3: {\n            cell.Value = \"Time incl (%)\";\n            break;\n          }\n        }\n      }\n      else if (alternateNameColumnVisible_) {\n        cell.Value = \"Mangled name\";\n      }\n\n      cell.Style.Font.Bold = true;\n      cell.Style.Fill.BackgroundColor = XLColor.LightGray;\n    }\n\n    for (int i = 1; i <= 1; i++) {\n      ws.Column(i).AdjustToContents((double)1, Math.Min(50, maxLineLength));\n    }\n\n    for (int i = 2; i <= lastCell.Address.ColumnNumber; i++) {\n      ws.Column(i).AdjustToContents();\n    }\n\n    wb.SaveAs(filePath);\n  }\n\n  private void OpenDocumentInNewInstanceExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var loadedDoc = Session.SessionState.FindLoadedDocument(Summary);\n\n    if (!App.StartNewApplicationInstance(loadedDoc.FilePath)) {\n      MessageBox.Show(\"Failed to start new application instance\", \"Profile Explorer\", MessageBoxButton.OK,\n                      MessageBoxImage.Error);\n    }\n  }\n\n  private void OpenDocumentInEditorExecuted(object sender, ExecutedRoutedEventArgs e) {\n    var loadedDoc = Session.SessionState.FindLoadedDocument(Summary);\n\n    if (!Utils.OpenExternalFile(loadedDoc.FilePath)) {\n      MessageBox.Show(\"Failed to open document\", \"Profile Explorer\", MessageBoxButton.OK, MessageBoxImage.Error);\n    }\n  }\n\n  private async void CopyFunctionTextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!(e.Parameter is IRTextFunctionEx functionEx)) {\n      return;\n    }\n\n    using var writer = new StringWriter();\n    await CombineFunctionText(functionEx.Function, writer);\n    Clipboard.SetText(writer.ToString());\n  }\n\n  private void ModuleWarningImage_MouseUp(object sender, MouseButtonEventArgs e) {\n    var moduleEx = ModulesList.SelectedItem as ModuleEx;\n    ProfileReportPanel.ShowReportWindow(Session.ProfileData.Report, Session, moduleEx?.Status);\n  }\n\n  public IRTextSectionEx GetSectionExtension(IRTextSection section) {\n    if (sectionExtMap_.TryGetValue(section, out var secitonEx)) {\n      return secitonEx;\n    }\n\n    CreateSectionExtensions(section.ParentFunction);\n    return sectionExtMap_[section];\n  }\n\n  public IRTextFunctionEx GetFunctionExtension(IRTextFunction function) {\n    if (functionExtMap_.TryGetValue(function, out var functionEx)) {\n      return functionEx;\n    }\n\n    if (IsDiffModeEnabled && function.ParentSummary == otherSummary_) {\n      //? TODO: Add name mapping using dictionary\n      foreach (var pair in functionExtMap_) {\n        if (pair.Key.Name == function.Name) {\n          return pair.Value;\n        }\n      }\n    }\n\n    Utils.WaitForDebugger();\n    throw new InvalidOperationException();\n  }\n\n  public override async void OnSessionStart() {\n    base.OnSessionStart();\n    statisticsTask_ = new CancelableTaskInstance(false, Session.SessionState.RegisterCancelableTask,\n                                                 Session.SessionState.UnregisterCancelableTask);\n    callGraphTask_ = new CancelableTaskInstance(false, Session.SessionState.RegisterCancelableTask,\n                                                Session.SessionState.UnregisterCancelableTask);\n    object data = Session.LoadPanelState(this, null);\n\n    if (data != null) {\n      var state = UIStateSerializer.Deserialize<SectionPanelState>(data);\n\n      foreach (int sectionId in state.AnnotatedSections) {\n        var section = summary_.GetSectionWithId(sectionId);\n        var sectionExt = GetSectionExtension(section);\n        sectionExt.IsTagged = true;\n        annotatedSections_.Add(sectionExt);\n      }\n\n      if (state.SelectedFunctionNumber > 0 &&\n          state.SelectedFunctionNumber < summary_.Functions.Count) {\n        await SelectFunction(summary_.Functions[state.SelectedFunctionNumber]);\n        BringIntoViewSelectedListItem(FunctionList, false);\n      }\n    }\n\n    // Reset search filters.\n    FunctionFilter.Text = \"\";\n    SectionFilter.Text = \"\";\n  }\n\n  public async Task SelectFunction(IRTextFunction function, bool handleProfiling = true) {\n    if (function.Equals(currentFunction_)) {\n      return;\n    }\n\n    SetupSectionList(function);\n    var funcEx = GetFunctionExtension(function);\n    FunctionList.SelectedItem = funcEx;\n    FunctionList.ScrollIntoView(FunctionList.SelectedItem);\n    RefreshSectionList();\n\n    if (handleProfiling && profileControlsVisible_) {\n      var funcProfile = Session.ProfileData.GetFunctionProfile(function);\n\n      if (funcProfile != null) {\n        if (SyncSelection) {\n          await Session.ProfileFunctionSelected(function, ToolPanelKind.Section);\n        }\n\n        if (SyncSourceFile) {\n          await Session.OpenProfileSourceFile(function);\n        }\n      }\n      else {\n        await Session.ProfileFunctionDeselected();\n      }\n    }\n\n    await ComputeConsecutiveSectionDiffs();\n  }\n\n  private async Task<(CallGraph, CallGraphNode)> GenerateFunctionCallGraph(\n    IRTextSummary summary, IRTextFunction function) {\n    var callGraph = await GenerateCallGraph(summary);\n    var callGraphNode = callGraph.FindNode(function);\n    return (callGraph, callGraphNode);\n  }\n\n  private async Task<CallGraph> GenerateCallGraph(IRTextSummary summary) {\n    if (callGraphCache_.TryGetValue(summary, out var callGraph)) {\n      return callGraph;\n    }\n\n    Session.SetApplicationProgress(true, double.NaN, \"Generating call graph\");\n    using var cancelableTask = await callGraphTask_.CancelCurrentAndCreateTaskAsync();\n\n    var loadedDoc = Session.SessionState.FindLoadedDocument(summary);\n    callGraph = new CallGraph(summary, loadedDoc.Loader, Session.CompilerInfo.IR);\n    await Task.Run(() => callGraph.Execute(null, cancelableTask));\n\n    if (!cancelableTask.IsCanceled) {\n      // Cache the call graph, can be expensive to compute.\n      callGraphCache_.TryAdd(summary, callGraph);\n    }\n\n    cancelableTask.Complete();\n    Session.SetApplicationProgress(false, 0);\n    return callGraph;\n  }\n\n  //private async Task<ChildFunctionEx> CreateCallTree(IRTextFunction function) {\n  //    var (_, callGraphNode) = await GenerateFunctionCallGraph(function.ParentSummary, function);\n  //    CallGraphNode otherNode = null;\n\n  //    if (otherSummary_ != null) {\n  //        var otherFunction = otherSummary_.GetOrCreateFunction(function);\n\n  //        if (otherFunction != null) {\n  //            (_, otherNode) = await GenerateFunctionCallGraph(otherSummary_, otherFunction);\n  //        }\n  //    }\n\n  //    var visitedNodes = new HashSet<CallGraphNode>();\n  //    var rootNode = new ChildFunctionEx(ChildFunctionExKind.CallTreeNode);\n  //    rootNode.Children = new List<ChildFunctionEx>();\n\n  //    if (callGraphNode != null) {\n  //        CreateCallTree(callGraphNode, otherNode, function, rootNode, visitedNodes);\n  //    }\n\n  //    return rootNode;\n  //}\n\n  //private void CreateCallTree(CallGraphNode node, CallGraphNode otherNode,\n  //    IRTextFunction function, ChildFunctionEx parentNode,\n  //    HashSet<CallGraphNode> visitedNodes) {\n  //    visitedNodes.Add(node);\n\n  //    if (node.HasCallers) {\n  //        //? TODO: Sort on top of the list\n  //        var callerInfo = CreateCallTreeChild(node, function);\n  //        callerInfo.FunctionName = \"Callers\";\n  //        callerInfo.IsMarked = true;\n  //        parentNode.Children.Add(callerInfo);\n\n  //        foreach (var callerNode in node.UniqueCallers) {\n  //            var callerFunc = function.ParentSummary.GetOrCreateFunction(callerNode.FunctionName);\n  //            if (callerFunc == null)\n  //                continue;\n\n  //            var callerNodeEx = CreateCallTreeChild(callerNode, callerFunc);\n  //            callerInfo.Children.Add(callerNodeEx);\n  //        }\n  //    }\n\n  //    foreach (var calleeNode in node.UniqueCallees) {\n  //        var childFunc = function.ParentSummary.GetOrCreateFunction(calleeNode.FunctionName);\n  //        if (childFunc == null) continue;\n\n  //        // Create node and attach statistics if available.\n  //        var childNode = CreateCallTreeChild(calleeNode, childFunc);\n  //        parentNode.Children.Add(childNode);\n\n  //        var otherCalleeNode = otherNode?.FindCallee(calleeNode);\n\n  //        if (otherSummary_ != null && otherCalleeNode == null) {\n  //            // Missing in right.\n  //            childNode.TextColor = ColorBrushes.GetBrush(settings_.NewSectionColor);\n  //            childNode.IsMarked = true;\n  //        }\n\n  //        if (calleeNode.HasCallees && !visitedNodes.Contains(calleeNode)) {\n  //            childNode.Children = new List<ChildFunctionEx>();\n  //            CreateCallTree(calleeNode, otherCalleeNode, childFunc, childNode, visitedNodes);\n\n  //            if (childNode.IsMarked && parentNode != null) {\n  //                parentNode.IsMarked = true;\n  //            }\n  //        }\n  //    }\n\n  //    // Sort children, since that is not yet supported by the TreeListView control.\n  //    parentNode.Children.Sort((a, b) => {\n  //        // Ensure the callers node is placed first.\n  //        if (b.Time > a.Time) {\n  //            return 1;\n  //        }\n  //        else if (b.Time < a.Time) {\n  //            return -1;\n  //        }\n\n  //        return string.Compare(b.FunctionName, a.FunctionName, StringComparison.Ordinal);\n  //    });\n  //}\n\n  //private FunctionCodeStatistics GetFunctionStatistics(IRTextFunction function) {\n  //    var functionEx = GetFunctionExtension(function);\n  //    return functionEx.Statistics;\n  //}\n\n  //private ChildFunctionEx CreateCallTreeChild(CallGraphNode childNode, IRTextFunction childFunc) {\n  //    var childInfo = new ChildFunctionEx(ChildFunctionExKind.CallTreeNode) {\n  //        Function = childFunc,\n  //        FunctionName = childNode.FunctionName,\n  //        TextColor = Brushes.Black,\n  //        BackColor = ColorBrushes.GetBrush(Colors.Transparent),\n  //        Children = new List<ChildFunctionEx>(),\n  //    };\n  //    return childInfo;\n  //}\n\n  public override void OnSessionSave() {\n    base.OnSessionSave();\n    var state = new SectionPanelState();\n    state.AnnotatedSections = annotatedSections_.ToList(item => item.Section.Id);\n\n    state.SelectedFunctionNumber = FunctionList.SelectedItem != null\n      ? ((IRTextFunctionEx)FunctionList.SelectedItem).Function.Number\n      : 0;\n\n    byte[] data = UIStateSerializer.Serialize(state);\n    Session.SavePanelState(data, this, null);\n  }\n\n  public override async void OnSessionEnd() {\n    base.OnSessionEnd();\n    await ResetUI(); //? TODO: Make OnSessionEnd async\n  }\n\n  public void SaveListViewColumnsState() {\n    settings_.FunctionListColumns.SaveColumnsState(FunctionList);\n    settings_.SectionListColumns.SaveColumnsState(SectionList);\n    settings_.ModuleListColumns.SaveColumnsState(ModulesList);\n  }\n\n  public void RestoreListViewColumnsState() {\n    settings_.FunctionListColumns.RestoreColumnsState(FunctionList);\n    settings_.SectionListColumns.RestoreColumnsState(SectionList);\n    settings_.ModuleListColumns.RestoreColumnsState(ModulesList);\n  }\n\n  private async void PanelToolbarTray_OnHelpClicked(object sender, EventArgs e) {\n    await HelpPanel.DisplayPanelHelp(PanelKind, Session);\n  }\n\n  private void SectionPreviewKeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Return) {\n      var sectionEx = ((ListViewItem)sender).Content as IRTextSectionEx;\n      OpenSectionImpl(sectionEx);\n      e.Handled = true;\n    }\n  }\n\n  private async void FunctionPreviewKeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Return) {\n      await OpenFunction(sender);\n    }\n  }\n\n  private void ModulePreviewKeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Return) {\n      SwitchModule(sender);\n    }\n  }\n\n  private void CopyFunctionDetailsExecuted(object sender, ExecutedRoutedEventArgs e) {\n    CopyFunctionListAsHtml(false);\n  }\n\n  private async void ExportFunctionListHtmlExecuted(object sender, ExecutedRoutedEventArgs e) {\n    string path = Utils.ShowSaveFileDialog(\"HTML file|*.html\", \"*.html|All Files|*.*\");\n    bool success = true;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        success = await ExportFunctionListAsHtmlFile(path);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save function list to {path}: {ex.Message}\");\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Failed to save function list to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  private async void ExportFunctionListMarkdownExecuted(object sender, ExecutedRoutedEventArgs e) {\n    string path = Utils.ShowSaveFileDialog(\"Markdown file|*.md\", \"*.md|All Files|*.*\");\n    bool success = true;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        success = await ExportFunctionListAsMarkdownFile(path);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save function list to {path}: {ex.Message}\");\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Failed to save function list to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  private async void CopyMarkedFunctionMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.CopyFunctionMarkingsAsHtml(Session);\n  }\n\n  private async void ExportMarkedFunctionsHtmlMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportFunctionMarkingsAsHtmlFile(Session);\n  }\n\n  private async void ExportMarkedFunctionsMarkdownMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportFunctionMarkingsAsMarkdownFile(Session);\n  }\n\n  private async void CopyMarkedModulesMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.CopyModuleMarkingsAsHtml(Session);\n  }\n\n  private async void ExportMarkedModulesHtmlMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportModuleMarkingsAsHtmlFile(Session);\n  }\n\n  private async void ExportMarkedModulesMarkdownMenu_OnClick(object sender, RoutedEventArgs e) {\n    await ProfilingExporting.ExportModuleMarkingsAsMarkdownFile(Session);\n  }\n\n  private void ScrollUpButton_OnClick(object sender, RoutedEventArgs e) {\n    if (FunctionList.Items is {Count: > 0}) {\n      FunctionList.ScrollIntoView(FunctionList.Items[0]);\n    }\n  }\n\n  public void EnterBinaryDisplayMode() {\n    IsFunctionListVisible = false;\n    IsFunctionListVisible = true;\n    SectionCountColumnVisible = false;\n    ShowModules = false;\n    ShowSections = false;\n  }\n\n  private void MarkSelectedNodes(object obj, Action<IRTextFunctionEx, Color> action) {\n    if (obj is SelectedColorEventArgs e) {\n      foreach (IRTextFunctionEx funcEx in FunctionList.SelectedItems) {\n        action(funcEx, e.SelectedColor);\n      }\n    }\n  }\n\n  private sealed class FunctionDiffKindConverter : IValueConverter {\n    public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n      if (value is DiffKind diffKind) {\n        return diffKind switch {\n          DiffKind.Insertion         => \"Diff only\",\n          DiffKind.Deletion          => \"Base only\",\n          DiffKind.Modification      => \"Modified\",\n          DiffKind.MinorModification => \"Modified\",\n          _                          => \"\"\n        };\n      }\n\n      return \"\";\n    }\n\n    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n      return null;\n    }\n  }\n\n  private sealed class FunctionDiffValueConverter : IValueConverter {\n    public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n      if (value is int intValue) {\n        if (intValue > 0) {\n          return $\"+{intValue}\";\n        }\n\n        if (intValue == 0) {\n          return $\" {intValue}\";\n        }\n      }\n      else if (value is long longValue) {\n        if (longValue > 0) {\n          return $\"+{longValue}\";\n        }\n\n        if (longValue == 0) {\n          return $\" {longValue}\";\n        }\n      }\n\n      return value;\n    }\n\n    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n      return null;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SectionPanelPair.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.SectionPanelPair\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <Grid x:Name=\"MainGrid\">\n    <Grid.ColumnDefinitions>\n      <ColumnDefinition Width=\"2*\" />\n      <ColumnDefinition Width=\"2\" />\n      <ColumnDefinition Width=\"*\" />\n    </Grid.ColumnDefinitions>\n\n    <local:SectionPanel\n      x:Name=\"MainPanel\"\n      Grid.Column=\"0\" />\n\n    <GridSplitter\n      x:Name=\"MainGridSplitter\"\n      Grid.Column=\"1\"\n      Width=\"2\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\" />\n    <local:SectionPanel\n      x:Name=\"DiffPanel\"\n      Grid.Column=\"2\"\n      FunctionPartVisible=\"False\" />\n  </Grid>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SectionPanelPair.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Diff;\nusing ProfileExplorer.Core.Document.Renderers.Highlighters;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class SectionPanelPair : ToolPanelControl {\n  private bool diffModeEnabled_;\n\n  public SectionPanelPair() {\n    InitializeComponent();\n    DiffPanel.Visibility = Visibility.Collapsed;\n    MainGrid.ColumnDefinitions[1].Width = new GridLength(0, GridUnitType.Pixel);\n    MainGrid.ColumnDefinitions[2].Width = new GridLength(0, GridUnitType.Pixel);\n    MainPanel.OpenSection += MainPanel_OpenSection;\n    MainPanel.EnterDiffMode += MainPanel_EnterDiffMode;\n    MainPanel.SyncDiffedDocumentsChanged += MainPanel_SyncDiffedDocumentsChanged;\n    MainPanel.FunctionSwitched += DiffPanel_FunctionSwitched;\n    MainPanel.SectionListScrollChanged += MainPanel_SectionListScrollChanged;\n    MainPanel.DisplayCallGraph += MainPanel_DisplayCallGraph;\n\n    DiffPanel.OpenSection += MainPanel_OpenSection;\n    DiffPanel.EnterDiffMode += MainPanel_EnterDiffMode;\n    DiffPanel.FunctionSwitched += DiffPanel_FunctionSwitched;\n    DiffPanel.SectionListScrollChanged += MainPanel_SectionListScrollChanged;\n    DiffPanel.SyncDiffedDocumentsChanged += MainPanel_SyncDiffedDocumentsChanged;\n    DiffPanel.DisplayCallGraph += MainPanel_DisplayCallGraph;\n  }\n\n  public ICompilerInfoProvider CompilerInfo {\n    get => MainPanel.CompilerInfo;\n    set {\n      MainPanel.CompilerInfo = value;\n      DiffPanel.CompilerInfo = value;\n    }\n  }\n\n  public bool HasAnnotatedSections => MainPanel.HasAnnotatedSections || DiffPanel.HasAnnotatedSections;\n  public bool SyncDiffedDocuments => MainPanel.SyncDiffedDocuments;\n  public IRTextSummary MainSummary => MainPanel.Summary;\n  public IRTextSummary DiffSummary => DiffPanel.Summary;\n\n  public string MainTitle {\n    get => MainPanel.DocumentTitle;\n    set => MainPanel.DocumentTitle = value;\n  }\n\n  public string DiffTitle {\n    get => DiffPanel.DocumentTitle;\n    set => DiffPanel.DocumentTitle = value;\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Section;\n  public override bool SavesStateToFile => true;\n\n  public override IUISession Session {\n    get => MainPanel.Session;\n    set {\n      MainPanel.Session = value;\n      DiffPanel.Session = value;\n    }\n  }\n\n  public event EventHandler<OpenSectionEventArgs> OpenSection;\n  public event EventHandler<DiffModeEventArgs> EnterDiffMode;\n  public event EventHandler<bool> SyncDiffedDocumentsChanged;\n  public event EventHandler<DisplayCallGraphEventArgs> DisplayCallGraph;\n\n  public async Task RefreshModuleSummaries() {\n    await MainPanel.Update();\n  }\n\n  public async Task RefreshProfile() {\n    await MainPanel.Update(true, false);\n  }\n\n  public async Task SetMainSummary(IRTextSummary summary, bool updateFunctionList = false) {\n    if (MainPanel.Summary == summary && !updateFunctionList) {\n      return;\n    }\n\n    MainPanel.Summary = summary;\n\n    if (summary != null) {\n      if (updateFunctionList) {\n        await MainPanel.SetupFunctionList();\n      }\n\n      await Update();\n    }\n  }\n\n  public async Task SetDiffSummary(IRTextSummary summary) {\n    if (DiffPanel.Summary == summary) {\n      return;\n    }\n\n    DiffPanel.Summary = summary;\n\n    if (!diffModeEnabled_) {\n      MainGrid.ColumnDefinitions[0].Width = new GridLength(1, GridUnitType.Star);\n      MainGrid.ColumnDefinitions[1].Width = new GridLength(2, GridUnitType.Pixel);\n      MainGrid.ColumnDefinitions[2].Width = new GridLength(1, GridUnitType.Star);\n      MainPanel.IsDiffModeEnabled = true;\n      DiffPanel.IsDiffModeEnabled = true;\n      DiffPanel.Visibility = Visibility.Visible;\n      MainPanel.OtherSummary = summary;\n\n      DiffPanel.FunctionPartVisible = false;\n      DiffPanel.OtherSummary = MainSummary;\n      diffModeEnabled_ = true;\n    }\n    else if (summary == null) {\n      MainGrid.ColumnDefinitions[0].Width = new GridLength(1, GridUnitType.Star);\n      MainGrid.ColumnDefinitions[1].Width = new GridLength(0, GridUnitType.Pixel);\n      MainGrid.ColumnDefinitions[2].Width = new GridLength(0, GridUnitType.Star);\n      MainPanel.IsDiffModeEnabled = false;\n      DiffPanel.IsDiffModeEnabled = false;\n      MainPanel.IsFunctionListVisible = true;\n      DiffPanel.Visibility = Visibility.Collapsed;\n\n      // Restore original section list, without diff placeholders/annotations.\n      if (MainPanel.Summary != null) { // If there was a prev. failure, may not be set up.\n        MainPanel.Sections = MainPanel.CreateSectionsExtension(true);\n      }\n\n      diffModeEnabled_ = false;\n    }\n\n    if (summary != null) {\n      await Update();\n    }\n  }\n\n  public async Task Update() {\n    await MainPanel.Update();\n    await DiffPanel.Update();\n  }\n\n  public void AddModuleSummary(IRTextSummary summary) {\n    MainPanel.AddModuleSummary(summary);\n  }\n\n  public void ClearModuleSummaries() {\n    MainPanel.ClearModuleSummaries();\n  }\n\n  public async Task RefreshDocumentsDiffs() {\n    if (MainPanel.CurrentFunction == null) {\n      return;\n    }\n\n    await SwitchPanelDiffFunction(MainPanel.CurrentFunction, DiffPanel);\n  }\n\n  public void SetSectionAnnotationState(IRTextSection section, bool hasAnnotations) {\n    SelectSectionPanel(section).SetSectionAnnotationState(section, hasAnnotations);\n  }\n\n  public async Task SelectSection(IRTextSection section, bool handleProfiling = true, bool focus = true) {\n    await SelectFunction(section.ParentFunction, handleProfiling);\n    SelectSectionPanel(section).SelectSection(section, focus);\n  }\n\n  public async Task SelectFunction(IRTextFunction function, bool handleProfiling = true) {\n    await MainPanel.SelectFunction(function, handleProfiling);\n\n    if (DiffPanel.IsDiffModeEnabled) {\n      await DiffPanel.SelectFunction(function, handleProfiling);\n    }\n  }\n\n  public void DiffSelectedSection() {\n    MainPanel.DiffSelectedSection();\n  }\n\n  public void SwitchToSection(IRTextSection section, IRDocumentHost targetDocument = null) {\n    SelectSectionPanel(section).SwitchToSection(section, targetDocument);\n  }\n\n  public IRTextSection FindDiffDocumentSection(IRTextSection section) {\n    if (!diffModeEnabled_) {\n      return null;\n    }\n\n    var panel = SelectSectionPanel(section);\n    var otherPanel = panel == MainPanel ? DiffPanel : MainPanel;\n    int sectionIndex = panel.Sections.FindIndex(item => item.Section == section);\n\n    if (sectionIndex == -1) {\n      return null;\n    }\n\n    var otherSection = otherPanel.Sections[sectionIndex];\n\n    if (!otherSection.IsPlaceholderDiff) {\n      return otherSection.Section;\n    }\n\n    while (sectionIndex > 0) {\n      sectionIndex--;\n      otherSection = otherPanel.Sections[sectionIndex];\n\n      if (!otherSection.IsPlaceholderDiff) {\n        return otherSection.Section;\n      }\n    }\n\n    return otherSection.Section;\n  }\n\n  public override void OnSessionStart() {\n    MainPanel.OnSessionStart();\n    DiffPanel.OnSessionStart();\n  }\n\n  public override void OnSessionEnd() {\n    SetMainSummary(null).Wait();\n    SetDiffSummary(null).Wait();\n    MainPanel.SaveListViewColumnsState();\n    MainPanel.OnSessionEnd(); //? TODO: Await, make OnSessionEnd async\n    DiffPanel.OnSessionEnd();\n  }\n\n  public override async Task OnReloadSettings() {\n    MainPanel.OnReloadSettings();\n    DiffPanel.OnReloadSettings();\n  }\n\n  public void EnterBinaryDisplayMode() {\n    // Update UI for viewing a binary, similar to profiling mode.\n    MainPanel.EnterBinaryDisplayMode();\n    DiffPanel.EnterBinaryDisplayMode();\n  }\n\n  public async Task AnalyzeDocumentDiffs() {\n    Trace.TraceInformation(\"AnalyzeDocumentDiffs: waiting\");\n    await MainPanel.WaitForStatistics();\n    await DiffPanel.WaitForStatistics();\n    Trace.TraceInformation(\"AnalyzeDocumentDiffs: start\");\n\n    var comparedSections = new List<(IRTextSection, IRTextSection)>();\n    var comparedFuncts = new List<IRTextFunctionEx>();\n\n    Session.SetApplicationProgress(true, double.NaN, \"Computing document diffs\");\n\n    foreach (var function in MainSummary.Functions) {\n      var functionEx = MainPanel.GetFunctionExtension(function);\n\n      if (functionEx.IsDeletionDiff || functionEx.IsInsertionDiff) {\n        functionEx.Statistics.ComputeDiff(functionEx.Statistics); // Consider as no diff.\n        continue;\n      }\n\n      var otherFunctionEx = DiffPanel.GetFunctionExtension(function);\n      var otherFunction = otherFunctionEx.Function;\n\n      //? TODO: With multiple, which should be compared? Probably all of them, but expensive\n      if (function.SectionCount > 0 && otherFunction.SectionCount > 0) {\n        comparedSections.Add((function.Sections[0], otherFunction.Sections[0]));\n        comparedFuncts.Add(functionEx);\n      }\n\n      functionEx.Statistics.ComputeDiff(otherFunctionEx.Statistics);\n    }\n\n    var results = await ComputeSectionIRDiffs(comparedSections);\n\n    for (int i = 0; i < comparedFuncts.Count; i++) {\n      if (results[i].HasDiffs) {\n        comparedFuncts[i].FunctionDiffKind = DiffKind.Modification;\n      }\n    }\n\n    MainPanel.AddStatisticsFunctionListColumns(true, \" (D)\", \" delta\", 55);\n    MainPanel.RefreshFunctionList();\n\n    Session.SetApplicationProgress(false, double.NaN);\n    Trace.TraceInformation(\"AnalyzeDocumentDiffs: done\");\n  }\n\n  public async Task ShowModuleReport() {\n    await MainPanel.ShowModuleReport();\n  }\n\n  public void MarkFunctions(List<IRTextFunction> list) {\n    MainPanel.MarkFunctions(list);\n  }\n\n  public void ClearMarkedFunctions() {\n    MainPanel.ClearMarkedFunctions();\n  }\n\n  private void MainPanel_SectionListScrollChanged(object sender, double offset) {\n    // When using the grid splitter to resize the left/right panels,\n    // the event gets called for some reason with a 0 offset and\n    // the current vertical offset gets reset.\n\n    //? TODO: Ignoring 0 offset causes other scroll issues, likely fix is to ignore\n    //? the event between grid splitter mouse down and up events.\n\n    if (SyncDiffedDocuments) {\n      var otherPanel = PickOtherPanel(sender);\n\n      if (otherPanel.Summary != null && diffModeEnabled_) {\n        otherPanel.ScrollSectionList(offset);\n      }\n    }\n  }\n\n  private SectionPanel PickOtherPanel(object sender) {\n    var panel = sender as SectionPanel;\n    return panel == MainPanel ? DiffPanel : MainPanel;\n  }\n\n  private async void DiffPanel_FunctionSwitched(object sender, IRTextFunction func) {\n    var otherPanel = PickOtherPanel(sender);\n\n    if (otherPanel.Summary != null && diffModeEnabled_) {\n      await SwitchPanelDiffFunction(func, otherPanel);\n    }\n  }\n\n  private async Task SwitchPanelDiffFunction(IRTextFunction func, SectionPanel otherPanel) {\n    var otherFunc = otherPanel.Summary.FindFunction(func.Name);\n\n    if (otherFunc != null) {\n      await otherPanel.SelectFunction(otherFunc);\n    }\n\n    await ComputePanelSectionDiff();\n  }\n\n  private void MainPanel_EnterDiffMode(object sender, DiffModeEventArgs e) {\n    if (e.IsWithOtherDocument) {\n      var panel = sender as SectionPanel;\n      var otherSection = FindDiffDocumentSection(e.Left.Section);\n\n      if (panel == MainPanel) {\n        e.Left.OpenKind = OpenSectionKind.ReplaceLeft;\n        e.Right = new OpenSectionEventArgs(otherSection, OpenSectionKind.ReplaceRight);\n      }\n      else {\n        e.Right = e.Left;\n        e.Right.OpenKind = OpenSectionKind.ReplaceRight;\n        e.Left = new OpenSectionEventArgs(otherSection, OpenSectionKind.ReplaceLeft);\n      }\n    }\n\n    EnterDiffMode?.Invoke(sender, e);\n  }\n\n  private void MainPanel_SyncDiffedDocumentsChanged(object sender, bool e) {\n    SyncDiffedDocumentsChanged?.Invoke(this, e);\n    PickOtherPanel(sender).SyncDiffedDocuments = e;\n  }\n\n  private void MainPanel_DisplayCallGraph(object sender, DisplayCallGraphEventArgs e) {\n    DisplayCallGraph?.Invoke(this, e);\n  }\n\n  private void MainPanel_OpenSection(object sender, OpenSectionEventArgs e) {\n    if (e.OpenKind == OpenSectionKind.ReplaceCurrent && diffModeEnabled_) {\n      if (sender == MainPanel) {\n        e.OpenKind = OpenSectionKind.ReplaceLeft;\n      }\n      else if (sender == DiffPanel) {\n        e.OpenKind = OpenSectionKind.ReplaceRight;\n      }\n    }\n\n    OpenSection?.Invoke(sender, e);\n  }\n\n  private async Task ComputePanelSectionDiff() {\n    var baseExtList = MainPanel.CreateSectionsExtension();\n    var diffExtList = DiffPanel.CreateSectionsExtension();\n    var (baseList, diffList) = ComputeSectionNameListDiff(baseExtList, diffExtList);\n    MainPanel.Sections = baseList;\n    DiffPanel.Sections = diffList;\n\n    var results = await ComputeSectionIRDiffs(baseList, diffList);\n    DocumentDiffResult firstDiffResult = null;\n\n    foreach (var result in results) {\n      if (result.HasDiffs) {\n        var baseSection = MainPanel.GetSectionExtension(result.LeftSection);\n        var diffSection = DiffPanel.GetSectionExtension(result.RightSection);\n        baseSection.SectionDiffKind = DiffKind.Modification;\n        diffSection.SectionDiffKind = DiffKind.Modification;\n        firstDiffResult ??= result;\n      }\n    }\n\n    // Scroll to the first diff section.\n    if (firstDiffResult != null) {\n      // Force scrolling to happen after other layout updates,\n      // otherwise the section lists scroll back to offset 0\n      // on the next layout update, looks like a WPF bug...\n      Dispatcher.Invoke(() => {\n        MainPanel.SelectSection(firstDiffResult.LeftSection, false);\n        DiffPanel.SelectSection(firstDiffResult.RightSection, false);\n      }, DispatcherPriority.Background);\n    }\n  }\n\n  private SectionPanel SelectSectionPanel(IRTextSection section) {\n    var summary = section.ParentFunction.ParentSummary;\n\n    if (MainPanel.HasSummary(summary)) {\n      return MainPanel;\n    }\n\n    if (DiffPanel.HasSummary(summary)) {\n      return DiffPanel;\n    }\n\n    return null;\n  }\n\n  private (List<IRTextSectionEx>, List<IRTextSectionEx>) ComputeSectionNameListDiff(\n    List<IRTextSectionEx> baseList, List<IRTextSectionEx> diffList) {\n    int[,] m = new int[baseList.Count + 1, diffList.Count + 1];\n    int x;\n    int y;\n\n    for (x = 1; x <= baseList.Count; x++) {\n      for (y = 1; y <= diffList.Count; y++) {\n        var baseSection = baseList[x - 1];\n        var diffSection = diffList[y - 1];\n\n        if (baseSection.Name == diffSection.Name) {\n          m[x, y] = m[x - 1, y - 1] + 1;\n        }\n        else {\n          m[x, y] = Math.Max(m[x, y - 1], m[x - 1, y]);\n        }\n      }\n    }\n\n    int index = 0;\n    var newBaseList = new List<IRTextSectionEx>(baseList.Count);\n    var newDiffList = new List<IRTextSectionEx>(diffList.Count);\n    x = baseList.Count;\n    y = diffList.Count;\n\n    while (!(x == 0 && y == 0)) {\n      if (x > 0 && y > 0) {\n        var baseSection = baseList[x - 1];\n        var diffSection = diffList[y - 1];\n\n        if (baseSection.Name == diffSection.Name) {\n          // Found in both diff and base.\n          newBaseList.Add(baseSection);\n          newDiffList.Add(diffSection);\n          x--;\n          y--;\n          continue;\n        }\n      }\n\n      if (y > 0 && (x == 0 || m[x, y - 1] >= m[x - 1, y])) {\n        // Found in diff, missing in base.\n        var diffSection = diffList[y - 1];\n\n        newDiffList.Add(\n          new IRTextSectionEx(diffSection.Section, DiffKind.Insertion,\n                              diffSection.Name, index++));\n\n        var placeholderSection = new IRTextSection(diffSection.Section.ParentFunction, \"\", IRPassOutput.Empty);\n        newBaseList.Add(new IRTextSectionEx(placeholderSection, DiffKind.Placeholder, \"\", index++));\n        y--;\n      }\n      else if (x > 0 && (y == 0 || m[x, y - 1] < m[x - 1, y])) {\n        // Not found in diff, removed from base.\n        var baseSection = baseList[x - 1];\n\n        newBaseList.Add(new IRTextSectionEx(baseSection.Section, DiffKind.Deletion, baseSection.Name, index++));\n        var placeholderSection = new IRTextSection(baseSection.Section.ParentFunction, \"\", IRPassOutput.Empty);\n        newDiffList.Add(new IRTextSectionEx(placeholderSection, DiffKind.Placeholder, \"\", index++));\n        x--;\n      }\n      else {\n        Debug.Assert(false);\n      }\n    }\n\n    newBaseList.Reverse();\n    newDiffList.Reverse();\n    return (newBaseList, newDiffList);\n  }\n\n  private async Task<List<DocumentDiffResult>> ComputeSectionIRDiffs(\n    List<IRTextSectionEx> baseSections, List<IRTextSectionEx> diffSections) {\n    var comparedSections = new List<(IRTextSection, IRTextSection)>();\n\n    for (int i = 0; i < baseSections.Count; i++) {\n      if (baseSections[i].SectionDiffKind == DiffKind.None &&\n          diffSections[i].SectionDiffKind == DiffKind.None) {\n        comparedSections.Add((baseSections[i].Section, diffSections[i].Section));\n      }\n    }\n\n    //? TODO: Pass the LoadedDocument to the panel, not Summary.\n    return await ComputeSectionIRDiffs(comparedSections);\n  }\n\n  private async Task<List<DocumentDiffResult>> ComputeSectionIRDiffs(\n    List<(IRTextSection, IRTextSection)> comparedSections) {\n    var baseLoader = Session.SessionState.FindLoadedDocument(MainPanel.Summary).Loader;\n    var diffLoader = Session.SessionState.FindLoadedDocument(DiffPanel.Summary).Loader;\n\n    var diffBuilder = new DocumentDiffBuilder(App.Settings.DiffSettings);\n    var cancelableTask = new CancelableTask();\n    return await diffBuilder.AreSectionsDifferent(comparedSections, baseLoader, diffLoader,\n                                                  Session.CompilerInfo, true, cancelableTask);\n  }\n\n  public async Task UpdateMarkedFunctions(bool externalCall) {\n    await MainPanel.UpdateMarkedFunctions(externalCall);\n    await DiffPanel.UpdateMarkedFunctions(externalCall);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SourceFilePanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.SourceFilePanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:doc=\"clr-namespace:ProfileExplorer.UI.Profile.Document\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"1000\"\n  mc:Ignorable=\"d\">\n  <local:ToolPanelControl.Resources />\n  <Grid>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"45\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Grid.Column=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <Button\n            Click=\"OpenButton_Click\"\n            ToolTip=\"Open a source file\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,1,0\"\n                Source=\"{StaticResource FolderIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock Text=\"Open\" />\n            </StackPanel>\n          </Button>\n\n          <Menu\n            VerticalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n            <MenuItem\n              Padding=\"0,0,0,0\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              OverridesDefaultStyle=\"True\"\n              ToolTip=\"Clear source file exclusions and mappings\">\n              <MenuItem.Header>\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"2,0,0,0\"\n                    Source=\"{StaticResource ReloadIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <TextBlock\n                    Margin=\"2,0,0,0\"\n                    VerticalAlignment=\"Bottom\"\n                    Text=\"Reset\" />\n                  <Path\n                    Margin=\"4,2,2,0\"\n                    VerticalAlignment=\"Center\"\n                    Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                    Fill=\"Black\" />\n                </StackPanel>\n              </MenuItem.Header>\n              <MenuItem\n                Click=\"ClearFileExclusion_Click\"\n                Header=\"Clear File Exclusion\"\n                ToolTip=\"Remove the local file mapping exclusion set on the current file\" />\n              <MenuItem\n                Click=\"ClearAllFileExclusions_Click\"\n                Header=\"Clear All File Exclusions\"\n                ToolTip=\"Remove all local file mapping exclusions\" />\n              <MenuItem\n                Click=\"ResetButton_Click\"\n                Header=\"Reset All File Settings\"\n                ToolTip=\"Reset all source file mappings and exclusions\" />\n            </MenuItem>\n          </Menu>\n\n          <Menu\n            VerticalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n            IsEnabled=\"{Binding SourceFileLoaded}\">\n            <MenuItem\n              Padding=\"0,0,0,0\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              OverridesDefaultStyle=\"True\"\n              ToolTip=\"Source file path actions\">\n              <MenuItem.Header>\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Margin=\"2,0,0,0\"\n                    Source=\"{StaticResource EditIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <TextBlock\n                    Margin=\"2,0,0,0\"\n                    VerticalAlignment=\"Bottom\"\n                    Text=\"Path\" />\n                  <Path\n                    Margin=\"4,2,2,0\"\n                    VerticalAlignment=\"Center\"\n                    Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                    Fill=\"Black\" />\n                </StackPanel>\n              </MenuItem.Header>\n              <MenuItem\n                Click=\"SourceFile_CopyPath\"\n                Header=\"Copy Source File Path\"\n                ToolTip=\"Copy the file path of the current source file\" />\n              <MenuItem\n                Click=\"SourceFile_Show\"\n                Header=\"Show Source File in File Explorer\"\n                ToolTip=\"Open the source file directory and select the file\" />\n              <MenuItem\n                Click=\"SourceFile_Open\"\n                Header=\"Open Source File\"\n                ToolTip=\"Open the current source file in the default editor\" />\n            </MenuItem>\n          </Menu>\n\n          <Separator />\n\n          <ToggleButton\n            Height=\"20\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.SyncLineWithDocument, Mode=TwoWay}\"\n            ToolTip=\"Sync selected line with associated assembly view\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource SwitchIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock Text=\"Sync\" />\n            </StackPanel>\n          </ToggleButton>\n          <ToggleButton\n            Visibility=\"Collapsed\"\n            Height=\"20\"\n            Margin=\"2,0,4,0\"\n            Padding=\"0,0,2,0\"\n            Click=\"InlineeButton_OnClick\"\n            IsChecked=\"{Binding Path=Settings.SyncInlineeWithDocument, Mode=TwoWay}\"\n            ToolTip=\"Display and sync inlinees for selected instruction in assembly view\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource TreeIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock Text=\"Inlinees\" />\n            </StackPanel>\n          </ToggleButton>\n          <Separator />\n          <ToggleButton\n            Height=\"20\"\n            Padding=\"0,0,0,0\"\n            Click=\"ToggleButton_Click\"\n            IsChecked=\"{Binding Path=Settings.ShowInlineAssembly, Mode=TwoWay}\"\n            IsEnabled=\"{Binding SourceFileLoaded}\"\n            ToolTip=\"Display the associated assembly instructions for each source line\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource InlineAssemblyIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"ASM\" />\n            </StackPanel>\n          </ToggleButton>\n          <Button\n            Width=\"20\"\n            Padding=\"0\"\n            Click=\"CollapseAssemblyButton_Click\"\n            IsEnabled=\"{Binding SourceFileLoaded}\"\n            ToolTip=\"Collapse all sections of assembly code\">\n            <Image\n              Width=\"18\"\n              Height=\"18\"\n              Margin=\"0,1,0,0\"\n              Source=\"{StaticResource ContractIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Button\n            Width=\"20\"\n            Padding=\"0\"\n            Click=\"ExpandAssemblyButton_Click\"\n            IsEnabled=\"{Binding SourceFileLoaded}\"\n            ToolTip=\"Expand all sections of assembly code\">\n            <Image\n              Width=\"18\"\n              Height=\"18\"\n              Margin=\"0,1,0,0\"\n              Source=\"{StaticResource ExpandIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Separator Visibility=\"Collapsed\"/>\n          <ComboBox\n            Name=\"InlineeComboBox\"\n            Visibility=\"Collapsed\"\n            Width=\"200\"\n            MinWidth=\"100\"\n            MaxWidth=\"200\"\n            IsEnabled=\"{Binding HasInlinees}\"\n            Loaded=\"InlineeComboBox_Loaded\"\n            SelectedValue=\"Function\"\n            SelectionChanged=\"InlineeCombobox_SelectionChanged\"\n            ToolTip=\"Inlined functions in calling order\">\n            <ComboBox.ItemTemplate>\n              <DataTemplate>\n                <TextBlock\n                  Text=\"{Binding Path=Function, Converter={StaticResource FunctionNameConverter}}\"\n                  ToolTip=\"{Binding Path=Function, Converter={StaticResource LongFunctionNameConverter}}\" />\n              </DataTemplate>\n            </ComboBox.ItemTemplate>\n          </ComboBox>\n          <Button\n            Visibility=\"Collapsed\"\n            Click=\"InlineUpButton_Click\"\n            IsEnabled=\"{Binding HasInlinees}\"\n            ToolTip=\"Switch to inlinee caller function (go up the call tree)\">\n            <Image\n              Source=\"{StaticResource UpArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Button\n            Visibility=\"Collapsed\"\n            Click=\"InlineDownButton_Click\"\n            IsEnabled=\"{Binding HasInlinees}\"\n            ToolTip=\"Switch to inlinee called function (go down the call tree)\">\n            <Image\n              Source=\"{StaticResource DownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <TextBlock\n            Margin=\"4,0,4,0\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding InlineeText}\"\n            Visibility=\"{Binding HasInlinees, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <Separator />\n          <Button\n            Width=\"20\"\n            Height=\"20\"\n            Margin=\"0,0,2,0\"\n            Padding=\"0,0,0,0\"\n            Click=\"OpenPopupButton_Click\"\n            IsEnabled=\"{Binding SourceFileLoaded}\"\n            ToolTip=\"Open the source file in a new popup window\">\n            <Image\n              Source=\"{StaticResource OpenExternalIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n        </ToolBar>\n      </ToolBarTray>\n      <local:PanelToolbarTray\n        Grid.Column=\"1\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"True\"\n        HasPinButton=\"False\"\n        HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n        SettingsClicked=\"PanelToolbarTray_OnSettingsClicked\" />\n    </Grid>\n\n    <doc:ProfileIRDocument\n      x:Name=\"ProfileTextView\"\n      Grid.Row=\"1\" />\n  </Grid>\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/SourceFilePanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Profile.Document;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Binary;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class SourceFilePanel : ToolPanelControl, INotifyPropertyChanged {\n  private SourceFileFinder sourceFileFinder_;\n  private IRTextSection section_;\n  private IRElement syncedElement_;\n  private bool sourceFileLoaded_;\n  private IRTextFunction sourceFileFunc_;\n  private string sourceFilePath_;\n  private SourceStackFrame currentInlinee_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private SourceFileSettings settings_;\n  private bool disableInlineeComboboxEvents_;\n  private IRDocument associatedDocument_;\n  private string inlineeText_;\n  private CancelableTaskInstance loadTask_;\n\n  public SourceFilePanel() {\n    InitializeComponent();\n    DataContext = this;\n    SetupEvents();\n    loadTask_ = new CancelableTaskInstance(false);\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Source;\n  public override HandledEventKind HandledEvents => HandledEventKind.ElementSelection;\n  public bool HasInlinees => InlineeComboBox.Items.Count > 0;\n\n  public override IUISession Session {\n    get => base.Session;\n    set {\n      base.Session = value;\n      ProfileTextView.Session = value;\n\n      if (value != null) {\n        Settings = App.Settings.SourceFileSettings;\n      }\n    }\n  }\n\n  public SourceFileSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      ReloadSourceFileFinder(settings_.FinderSettings);\n      OnPropertyChanged();\n\n      if (settings_.SyncStyleWithDocument) {\n        // Patch the settings with the document settings.\n        var clone = settings_.Clone();\n        clone.FontName = App.Settings.DocumentSettings.FontName;\n        clone.FontSize = App.Settings.DocumentSettings.FontSize;\n        clone.BackgroundColor = App.Settings.DocumentSettings.BackgroundColor;\n        clone.TextColor = App.Settings.DocumentSettings.TextColor;\n        ProfileTextView.Initialize(clone);\n      }\n      else {\n        ProfileTextView.Initialize(settings_);\n      }\n    }\n  }\n\n  public string InlineeText {\n    get => inlineeText_;\n    set {\n      inlineeText_ = value;\n      OnPropertyChanged();\n    }\n  }\n\n  public bool SourceFileLoaded {\n    get => sourceFileLoaded_;\n    set {\n      sourceFileLoaded_ = value;\n      OnPropertyChanged();\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void SetupEvents() {\n    ProfileTextView.LineSelected += (s, line) => {\n      if (settings_.SyncLineWithDocument) {\n        associatedDocument_?.SelectElementsOnSourceLine(line, currentInlinee_);\n      }\n    };\n  }\n\n  private void ReloadSourceFileFinder(SourceFileFinderSettings settings) {\n    sourceFileFinder_ = new SourceFileFinder(Session);\n    sourceFileFinder_.LoadSettings(settings);\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private void InlineeComboBox_Loaded(object sender, RoutedEventArgs e) {\n    if (sender is ComboBox control) {\n      Utils.PatchComboBoxStyle(control);\n    }\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private string BrowseSourceFile() {\n    return Utils.ShowOpenFileDialog(\n      \"C/C++ source files|*.c;*.cpp;*.cc;*.cxx;*.h;*.hpp;*.hxx;*.hh|.NET source files|*.cs;*.vb|All Files|*.*\",\n      string.Empty);\n  }\n\n  private void SetPanelName(string path) {\n    if (!string.IsNullOrEmpty(path)) {\n      TitleSuffix = $\" - {Utils.TryGetFileName(path)}\";\n      TitleToolTip = path;\n    }\n    else {\n      TitleSuffix = \"\";\n      TitleToolTip = null;\n    }\n\n    Session.UpdatePanelTitles();\n  }\n\n  private async void OpenButton_Click(object sender, RoutedEventArgs e) {\n    string path = BrowseSourceFile();\n\n    if (path != null) {\n      var sourceInfo = new SourceFileDebugInfo(path, path);\n\n      if (await ProfileTextView.LoadSourceFile(sourceInfo, section_)) {\n        HandleLoadedSourceFile(sourceInfo, section_.ParentFunction);\n      }\n    }\n  }\n\n  private async void InlineeCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    // Handling of inlinees not handled quite right, disable for now.\n    // if (InlineeComboBox.SelectedItem != null &&\n    //     !disableInlineeComboboxEvents_) {\n    //   UpdateInlineeText();\n    //   var inlinee = (SourceStackFrame)InlineeComboBox.SelectedItem;\n    //\n    //   if (InlineeComboBox.SelectedIndex > 0 &&\n    //       await LoadInlineeSourceFile(inlinee)) {\n    //     return;\n    //   }\n    //\n    //   // If failing to load inlinee, load main source file instead.\n    //   currentInlinee_ = null;\n    //   await LoadSourceFileForFunction(section_.ParentFunction, ProfileTextView.ProfileFilter);\n    // }\n  }\n\n  private void InlineUpButton_Click(object sender, RoutedEventArgs e) {\n    if (InlineeComboBox.ItemsSource != null &&\n        InlineeComboBox.SelectedIndex > 0) {\n      InlineeComboBox.SelectedIndex--;\n      UpdateInlineeText();\n    }\n  }\n\n  private void InlineDownButton_Click(object sender, RoutedEventArgs e) {\n    if (InlineeComboBox.ItemsSource != null &&\n        InlineeComboBox.SelectedIndex < ((ListCollectionView)InlineeComboBox.ItemsSource).Count - 1) {\n      InlineeComboBox.SelectedIndex++;\n      UpdateInlineeText();\n    }\n  }\n\n  private void UpdateInlineeText() {\n    int total = ((ListCollectionView)InlineeComboBox.ItemsSource).Count;\n    InlineeText = $\"{InlineeComboBox.SelectedIndex + 1}/{total}\";\n  }\n\n  private async void ResetButton_Click(object sender, RoutedEventArgs e) {\n    // Re-enable source mapper if it was disabled before.\n    if (Utils.ShowYesNoMessageBox(\"Do you want to reset all file mappings and exclusions?\", this) ==\n        MessageBoxResult.No) {\n      return;\n    }\n\n    sourceFileFinder_.Reset();\n    sourceFileFinder_.SaveSettings(settings_.FinderSettings);\n    await ReloadSourceFile();\n  }\n\n  private async void ClearAllFileExclusions_Click(object sender, RoutedEventArgs e) {\n    // Re-enable source mapper if it was disabled before.\n    if (Utils.ShowYesNoMessageBox(\"Do you want to remove all local file mapping exclusions?\", this) ==\n        MessageBoxResult.No) {\n      return;\n    }\n\n    sourceFileFinder_.ResetDisabledMappings();\n    sourceFileFinder_.SaveSettings(settings_.FinderSettings);\n    await ReloadSourceFile();\n  }\n\n  private async void ClearFileExclusion_Click(object sender, RoutedEventArgs e) {\n    sourceFileFinder_.ResetDisabledMappings(sourceFilePath_);\n    sourceFileFinder_.SaveSettings(settings_.FinderSettings);\n    await ReloadSourceFile();\n  }\n\n  private async Task ReloadSourceFile() {\n    if (section_ == null) {\n      return;\n    }\n\n    SourceFileLoaded = false; // Force a reload.\n    await LoadSourceFileForFunction(section_.ParentFunction, null);\n  }\n\n  private void SourceFile_CopyPath(object sender, RoutedEventArgs e) {\n    if (!string.IsNullOrEmpty(sourceFilePath_)) {\n      Clipboard.SetText(sourceFilePath_);\n    }\n  }\n\n  private void SourceFile_Open(object sender, RoutedEventArgs e) {\n    if (!string.IsNullOrEmpty(sourceFilePath_)) {\n      Utils.OpenExternalFile(sourceFilePath_);\n    }\n  }\n\n  private void SourceFile_Show(object sender, RoutedEventArgs e) {\n    if (!string.IsNullOrEmpty(sourceFilePath_)) {\n      Utils.OpenExplorerAtFile(sourceFilePath_);\n    }\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    FrameworkElement relativeControl = ProfileTextView;\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<SourceFileOptionsPanel, SourceFileSettings>(\n      settings_.Clone(), relativeControl, Session,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(settings_)) {\n          App.Settings.SourceFileSettings = newSettings;\n          Settings = newSettings;\n          await ReloadSourceFile();\n\n          if (commit) {\n            App.SaveApplicationSettings();\n          }\n\n          return settings_.Clone();\n        }\n\n        return null;\n      },\n      () => optionsPanelPopup_ = null);\n  }\n\n  public async Task LoadSourceFile(IRTextSection section, ProfileSampleFilter profileFilter = null,\n                                   IRDocument associatedDocument = null,\n                                   bool restoreState = false) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (section_ != null && section_.Equals(section)) {\n      return;\n    }\n\n    Utils.EnableControl(this);\n    section_ = section;\n    associatedDocument_ = associatedDocument;\n    await LoadSourceFileForFunction(section_.ParentFunction, profileFilter, restoreState);\n  }\n\n  public override async Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    await base.OnDocumentSectionLoaded(section, document);\n    await LoadSourceFile(section, null, document, true);\n  }\n\n  private async Task<bool>\n    LoadSourceFileForFunction(IRTextFunction function, ProfileSampleFilter profileFilter = null,\n                              bool restoreState = false) {\n    if (!ShouldReloadFunction(function, profileFilter)) {\n      return true;\n    }\n\n    // Get the associated source file from the debug info if available,\n    // since it also includes the start line number.\n    var (sourceInfo, failureReason) = await sourceFileFinder_.FindLocalSourceFile(function);\n    sourceFileFinder_.SaveSettings(settings_.FinderSettings);\n\n    byte[] data = Session.LoadPanelState(this, section_) as byte[];\n    var state = UIStateSerializer.Deserialize<ProfileIRDocument.SourceFileState>(data);\n\n    if (!sourceInfo.IsUnknown && failureReason == SourceFileFinder.FailureReason.None &&\n        await ProfileTextView.LoadSourceFile(sourceInfo, section_, profileFilter, null, state)) {\n      HandleLoadedSourceFile(sourceInfo, function);\n      return true;\n    }\n\n    await HandleMissingSourceFile(sourceInfo, failureReason);\n    return false;\n  }\n\n  private async Task<bool>\n    LoadSourceFileForInlinee(SourceStackFrame inlinee, ProfileSampleFilter profileFilter = null) {\n    if (!ShouldReloadInlinee(inlinee, profileFilter)) {\n      return true;\n    }\n\n    // Get the associated source file from the debug info if available,\n    // since it also includes the start line number.\n    var inlineeSourceInfo = new SourceFileDebugInfo(inlinee.FilePath, inlinee.FilePath);\n    var (sourceInfo, failureReason) =\n      await sourceFileFinder_.FindLocalSourceFile(inlineeSourceInfo);\n    sourceFileFinder_.SaveSettings(settings_.FinderSettings);\n\n    if (!sourceInfo.IsUnknown && failureReason == SourceFileFinder.FailureReason.None &&\n        await ProfileTextView.LoadSourceFile(sourceInfo, section_, profileFilter, inlinee)) {\n      HandleLoadedSourceFile(sourceInfo, null);\n      return true;\n    }\n\n    await HandleMissingSourceFile(sourceInfo, failureReason);\n    return false;\n  }\n\n  private bool ShouldReloadFunction(IRTextFunction function, ProfileSampleFilter profileFilter) {\n    if (!SourceFileLoaded) {\n      return true;\n    }\n\n    if (sourceFileFunc_ != function) {\n      return true;\n    }\n\n    return HasProfileFilterChange(profileFilter);\n  }\n\n  private bool ShouldReloadInlinee(SourceStackFrame inlinee, ProfileSampleFilter profileFilter) {\n    if (!SourceFileLoaded || currentInlinee_ == null) {\n      return true;\n    }\n\n    if (!currentInlinee_.HasSameFunction(inlinee)) {\n      return true;\n    }\n\n    return HasProfileFilterChange(profileFilter);\n  }\n\n  private bool HasProfileFilterChange(ProfileSampleFilter profileFilter) {\n    if (profileFilter != null) {\n      return !profileFilter.Equals(ProfileTextView.ProfileFilter);\n    }\n    else {\n      // Filter is being removed.\n      return ProfileTextView.ProfileFilter != null;\n    }\n  }\n\n  private void HandleLoadedSourceFile(SourceFileDebugInfo sourceInfo, IRTextFunction function) {\n    SetPanelName(sourceInfo.OriginalFilePath);\n    SourceFileLoaded = true;\n    sourceFileFunc_ = function;\n    sourceFilePath_ = sourceInfo.FilePath;\n  }\n\n  private async Task HandleMissingSourceFile(SourceFileDebugInfo sourceInfo,\n                                             SourceFileFinder.FailureReason reason) {\n    string failureText = reason switch {\n      SourceFileFinder.FailureReason.DebugInfoNotFound => \"Could not find debug info for function.\",\n      SourceFileFinder.FailureReason.MappingDisabled => \"\"\"\n                                                        Mapping to local file path disabled for current file.\n                                                        To re-enable mapping, use the Reset button -> Clear File Exclusion option.\n                                                        \"\"\",\n      _ => \"Could not find local copy of source file.\"\n    };\n\n    await ProfileTextView.HandleMissingSourceFile(failureText);\n    SetPanelName(\"\");\n    SourceFileLoaded = false;\n    sourceFileFunc_ = null;\n\n    // Saved failed source file path for resetting exclusions.\n    sourceFilePath_ = sourceInfo.FilePath;\n  }\n\n  public override async Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    if (section_ != section) {\n      return;\n    }\n\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    ProfileTextView.SaveSectionState(this);\n    await base.OnDocumentSectionUnloaded(section, document);\n    await ResetState();\n    Utils.DisableControl(this);\n  }\n\n  private async Task ResetState() {\n    ResetInlinee();\n    await ProfileTextView.Reset();\n    section_ = null;\n    SourceFileLoaded = false;\n    sourceFileFunc_ = null;\n    currentInlinee_ = null;\n    associatedDocument_ = null;\n    InlineeComboBox.ItemsSource = null;\n    OnPropertyChanged(nameof(HasInlinees));\n  }\n\n  public override async void OnElementSelected(IRElementEventArgs e) {\n    if (!SourceFileLoaded) {\n      return;\n    }\n\n    //Trace.WriteLine($\"Selected element: {element_}\");\n    syncedElement_ = e.Element;\n    var instr = syncedElement_.ParentInstruction;\n    var tag = instr?.GetTag<SourceLocationTag>();\n\n    if (tag != null) {\n      // Handling of inlinees not handled quite right, disable for now.\n      //\n      // if (tag.HasInlinees &&\n      //     settings_.SyncLineWithDocument &&\n      //     settings_.SyncInlineeWithDocument) {\n      //   // Display deepest inlinee instead, if that fails\n      //   // then it falls back to loading the function's source below.\n      //   if (!await LoadInlineeSourceFile(tag)) {\n      //     InlineeComboBox.SelectedIndex = 0; // First item means \"no inlinee\".\n      //   }\n      //\n      //   return;\n      // }\n      // else {\n      //   ResetInlinee();\n      // }\n\n      if (await LoadSourceFileForFunction(section_.ParentFunction, ProfileTextView.ProfileFilter)) {\n        if (settings_.SyncLineWithDocument) {\n          ProfileTextView.SelectLine(tag.Line);\n        }\n      }\n    }\n  }\n\n  private async Task<bool> LoadInlineeSourceFile(SourceLocationTag tag) {\n    var selectedInlinee = PopulateInlineePicker(tag);\n    return await LoadInlineeSourceFile(selectedInlinee);\n  }\n\n  private SourceStackFrame PopulateInlineePicker(SourceLocationTag tag) {\n    disableInlineeComboboxEvents_ = true;\n    var inlinees = tag.InlineesReversed;\n\n    // Add an entry that means \"no inlinee\" in the front.\n    inlinees.Insert(0, new SourceStackFrame(\"No Inlinee\", \"\", 0, 0));\n    InlineeComboBox.ItemsSource = new ListCollectionView(inlinees);\n    OnPropertyChanged(nameof(HasInlinees));\n\n    var selectedInlinee = inlinees[^1];\n    InlineeComboBox.SelectedItem = selectedInlinee;\n    disableInlineeComboboxEvents_ = false;\n    UpdateInlineeText();\n    return selectedInlinee;\n  }\n\n  private void ResetInlinee() {\n    InlineeComboBox.ItemsSource = null;\n    currentInlinee_ = null;\n    OnPropertyChanged(nameof(HasInlinees));\n  }\n\n  public async Task<bool> LoadInlineeSourceFile(SourceStackFrame inlinee) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (inlinee == currentInlinee_) {\n      return true;\n    }\n\n    bool fileLoaded = await LoadSourceFileForInlinee(inlinee);\n\n    if (fileLoaded) {\n      ProfileTextView.SelectLine(inlinee.Line);\n    }\n\n    currentInlinee_ = inlinee;\n    return fileLoaded;\n  }\n\n  public override async void OnSessionEnd() {\n    base.OnSessionEnd();\n    await ResetState(); //? TODO: Make OnSessionEnd async\n    ProfileTextView.SetSourceText(\"\", \"\");\n  }\n\n  private async void PanelToolbarTray_OnHelpClicked(object sender, EventArgs e) {\n    await HelpPanel.DisplayPanelHelp(PanelKind, Session);\n  }\n\n  private void PanelToolbarTray_OnSettingsClicked(object sender, EventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  public override async Task OnReloadSettings() {\n    sourceFileFinder_.SaveSettings(settings_.FinderSettings);\n    Settings = App.Settings.SourceFileSettings;\n  }\n\n  private async void CopySelectedLinesAsHtmlExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await ProfileTextView.CopySelectedLinesAsHtml();\n  }\n\n  private async void OpenPopupButton_Click(object sender, RoutedEventArgs e) {\n    if (ProfileTextView.Section == null) {\n      return; //? TODO: Button should rather be disabled\n    }\n\n    await IRDocumentPopupInstance.ShowPreviewPopup(ProfileTextView.Section.ParentFunction, \"\",\n                                                   this, Session, ProfileTextView.ProfileFilter, true);\n  }\n\n  private async void InlineeButton_OnClick(object sender, RoutedEventArgs e) {\n    // Load main function if inlinee syncing gets disabled.\n    if (!settings_.SyncInlineeWithDocument && section_ != null) {\n      await LoadSourceFileForFunction(section_.ParentFunction, ProfileTextView.ProfileFilter);\n    }\n  }\n\n  private void CollapseAssemblyButton_Click(object sender, RoutedEventArgs e) {\n    ProfileTextView.CollapseBlockFoldings();\n  }\n\n  private void ExpandAssemblyButton_Click(object sender, RoutedEventArgs e) {\n    ProfileTextView.ExpandBlockFoldings();\n  }\n\n  private async void ToggleButton_Click(object sender, RoutedEventArgs e) {\n    await OnReloadSettings();\n    await ReloadSourceFile();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/StartPagePanel.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Panels.StartPagePanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:toolkit=\"clr-namespace:System.Windows.Controls;assembly=DotNetProjects.Input.Toolkit\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"550\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <Border\n    Background=\"#FFD9EFFF\"\n    BorderThickness=\"0\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <DockPanel LastChildFill=\"True\">\n      <DockPanel\n        Margin=\"10,10,10,0\"\n        DockPanel.Dock=\"Top\">\n        <StackPanel\n          VerticalAlignment=\"Center\"\n          Orientation=\"Horizontal\">\n          <Image\n            Width=\"32\"\n            Height=\"32\"\n            Source=\"{StaticResource LogoImage}\" />\n          <TextBlock\n            Margin=\"8,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontSize=\"20\"\n            FontWeight=\"Normal\"\n            Text=\"Profile Explorer\" />\n\n        </StackPanel>\n        <StackPanel Visibility=\"Hidden\">\n          <TextBlock\n            HorizontalAlignment=\"Right\"\n            VerticalAlignment=\"Center\"\n            Cursor=\"Hand\"\n            DockPanel.Dock=\"Right\"\n            FontSize=\"14\"\n            MouseDown=\"TextBlock_MouseDown_1\"\n            Text=\"Documentation\">\n            <TextBlock.TextDecorations>\n              <TextDecoration />\n            </TextBlock.TextDecorations>\n          </TextBlock>\n          <TextBlock\n            HorizontalAlignment=\"Right\"\n            VerticalAlignment=\"Center\"\n            Cursor=\"Hand\"\n            DockPanel.Dock=\"Right\"\n            FontSize=\"14\"\n            MouseDown=\"TextBlock_MouseDown\"\n            Text=\"Visual Studio extension\">\n            <TextBlock.TextDecorations>\n              <TextDecoration />\n            </TextBlock.TextDecorations>\n          </TextBlock>\n        </StackPanel>\n      </DockPanel>\n\n      <ScrollViewer\n        Margin=\"0,12,0,0\"\n        Padding=\"10,10,10,10\"\n        Background=\"#F2F9FF\"\n        HorizontalScrollBarVisibility=\"Disabled\"\n        VerticalScrollBarVisibility=\"Auto\">\n        <StackPanel\n          VerticalAlignment=\"Top\"\n          Orientation=\"Vertical\">\n          <Expander\n            Margin=\"0,4,0,0\"\n            IsExpanded=\"True\">\n            <Expander.Header>\n              <DockPanel\n                HorizontalAlignment=\"{Binding HorizontalAlignment, RelativeSource={RelativeSource AncestorType=ContentPresenter}, Mode=OneWayToSource}\">\n                <TextBlock\n                  VerticalAlignment=\"Center\"\n                  Text=\"Recent Profile Sessions\" />\n                <StackPanel\n                  HorizontalAlignment=\"Right\"\n                  DockPanel.Dock=\"Right\"\n                  Orientation=\"Horizontal\">\n                  <Button\n                    Height=\"24\"\n                    Padding=\"2,2,2,2\"\n                    Click=\"OpenFileButton_Click\"\n                    ToolTip=\"Open profile trace file\">\n                    <StackPanel Orientation=\"Horizontal\">\n                      <Image\n                        VerticalAlignment=\"Center\"\n                        Source=\"{StaticResource FolderIcon}\" />\n                      <TextBlock\n                        Margin=\"2,0,2,0\"\n                        VerticalAlignment=\"Center\"\n                        Text=\"Open\" />\n                    </StackPanel>\n                  </Button>\n                  <Button\n                    Height=\"24\"\n                    Margin=\"4,0,0,0\"\n                    Padding=\"2,2,2,2\"\n                    Click=\"RecordProfileButton_Click\"\n                    ToolTip=\"Start a profile recording session\">\n                    <StackPanel Orientation=\"Horizontal\">\n                      <Image\n                        VerticalAlignment=\"Center\"\n                        Source=\"{StaticResource RecordIcon}\" />\n                      <TextBlock\n                        Margin=\"2,0,2,0\"\n                        VerticalAlignment=\"Center\"\n                        Text=\"Record\" />\n                    </StackPanel>\n                  </Button>\n                  <Button\n                    Width=\"24\"\n                    Height=\"24\"\n                    Margin=\"4,0,0,0\"\n                    Padding=\"2,2,2,2\"\n                    Click=\"LoadProfileButton_Click\"\n                    ToolTip=\"View previous profile sessions or start a new one\">\n                    <Image Source=\"{StaticResource HistoryBackIcon}\" />\n                  </Button>\n                  <toolkit:AutoCompleteBox\n                    Width=\"150\"\n                    Height=\"24\"\n                    Margin=\"8,0,2,0\"\n                    HorizontalAlignment=\"Right\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}\"\n                    DockPanel.Dock=\"Right\"\n                    FilterMode=\"ContainsOrdinal\"\n                    IsDropDownOpen=\"True\"\n                    IsTextCompletionEnabled=\"False\"\n                    KeyDown=\"ProfileTextSearch_KeyDown\"\n                    MinimumPrefixLength=\"1\"\n                    Placeholder=\"Search recent sessions\"\n                    Populating=\"ProfileTextSearch_Populating\"\n                    Text=\"{Binding Path=SearchedText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\">\n                    <toolkit:AutoCompleteBox.InputBindings>\n                      <KeyBinding\n                        Key=\"Escape\"\n                        CommandTarget=\"{Binding ElementName=SearchPanelControl}\" />\n                    </toolkit:AutoCompleteBox.InputBindings>\n                  </toolkit:AutoCompleteBox>\n                  <Button\n                    Width=\"24\"\n                    Height=\"24\"\n                    Margin=\"2,0,2,0\"\n                    Padding=\"2,2,2,2\"\n                    HorizontalAlignment=\"Right\"\n                    Click=\"ClearSessionsButton_Click\"\n                    DockPanel.Dock=\"Right\"\n                    ToolTip=\"Clear list of recent profile sessions\">\n                    <Image Source=\"{StaticResource RemoveIcon}\" />\n                  </Button>\n                </StackPanel>\n              </DockPanel>\n            </Expander.Header>\n            <ListBox\n              Name=\"RecentProfilesListBox\"\n              Margin=\"0,8,0,0\"\n              FontSize=\"12\"\n              KeyDown=\"RecentProfilesListBox_KeyDown\"\n              MouseDoubleClick=\"RecentProfilesListBox_MouseDoubleClick\"\n              ScrollViewer.HorizontalScrollBarVisibility=\"Disabled\"\n              SelectionMode=\"Single\">\n              <ListBox.ItemTemplate>\n                <DataTemplate>\n                  <Grid\n                    HorizontalAlignment=\"Stretch\"\n                    ToolTip=\"{Binding Title}\">\n                    <TextBlock\n                      HorizontalAlignment=\"Stretch\"\n                      Text=\"{Binding TraceFile}\"\n                      TextTrimming=\"CharacterEllipsis\" />\n                    <StackPanel\n                      HorizontalAlignment=\"Right\"\n                      Orientation=\"Horizontal\">\n                      <TextBlock\n                        Margin=\"0,0,16,0\"\n                        Foreground=\"DarkBlue\"\n                        Text=\"{Binding TraceProcess}\"\n                        TextTrimming=\"CharacterEllipsis\"\n                        ToolTip=\"Process loaded during session\" />\n                      <TextBlock\n                        Margin=\"0,0,30,0\"\n                        Foreground=\"DimGray\"\n                        Text=\"{Binding TraceTime}\"\n                        TextTrimming=\"CharacterEllipsis\"\n                        ToolTip=\"Trace recording date\" />\n                    </StackPanel>\n                    <StackPanel\n                      Margin=\"4,0,0,0\"\n                      HorizontalAlignment=\"Right\">\n                      <Button\n                        Name=\"RemoveButton\"\n                        Width=\"16\"\n                        Height=\"16\"\n                        Padding=\"1\"\n                        Background=\"Transparent\"\n                        BorderThickness=\"0\"\n                        Click=\"RemoveProfileButton_OnClick\"\n                        ToolTip=\"Remove session entry from history\">\n                        <Image\n                          Width=\"14\"\n                          Height=\"14\"\n                          Source=\"{StaticResource ClearIcon}\" />\n                      </Button>\n\n                      <StackPanel.Style>\n                        <Style TargetType=\"{x:Type StackPanel}\">\n                          <Style.Triggers>\n                            <DataTrigger\n                              Binding=\"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsMouseOver}\"\n                              Value=\"False\">\n                              <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n                            </DataTrigger>\n                          </Style.Triggers>\n                        </Style>\n                      </StackPanel.Style>\n                    </StackPanel>\n                  </Grid>\n                </DataTemplate>\n              </ListBox.ItemTemplate>\n              <ListBox.ItemContainerStyle>\n                <Style TargetType=\"ListBoxItem\">\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n                </Style>\n              </ListBox.ItemContainerStyle>\n            </ListBox>\n          </Expander>\n\n          <Expander\n            Margin=\"0,16,0,0\"\n            IsExpanded=\"True\">\n            <Expander.Header>\n              <DockPanel\n                HorizontalAlignment=\"{Binding HorizontalAlignment, RelativeSource={RelativeSource AncestorType=ContentPresenter}, Mode=OneWayToSource}\">\n                <TextBlock\n                  VerticalAlignment=\"Center\"\n                  Text=\"Recent Files\" />\n                <StackPanel\n                  HorizontalAlignment=\"Right\"\n                  DockPanel.Dock=\"Right\"\n                  Orientation=\"Horizontal\">\n                  <Button\n                    Name=\"OpenButton\"\n                    Height=\"24\"\n                    Padding=\"2,2,2,2\"\n                    Click=\"OpenFileButton_Click\"\n                    ToolTip=\"Open file\">\n                    <StackPanel Orientation=\"Horizontal\">\n                      <Image\n                        VerticalAlignment=\"Center\"\n                        Source=\"{StaticResource FolderIcon}\" />\n                      <TextBlock\n                        Margin=\"2,0,2,0\"\n                        VerticalAlignment=\"Center\"\n                        Text=\"Open\" />\n                    </StackPanel>\n                  </Button>\n                  <toolkit:AutoCompleteBox\n                    Name=\"TextSearch\"\n                    Width=\"150\"\n                    Height=\"24\"\n                    Margin=\"8,0,2,0\"\n                    HorizontalAlignment=\"Right\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}\"\n                    DockPanel.Dock=\"Right\"\n                    FilterMode=\"ContainsOrdinal\"\n                    IsDropDownOpen=\"True\"\n                    IsTextCompletionEnabled=\"False\"\n                    KeyDown=\"TextSearch_KeyDown\"\n                    MinimumPrefixLength=\"1\"\n                    Placeholder=\"Search recent files\"\n                    Populating=\"TextSearch_Populating\"\n                    Text=\"{Binding Path=SearchedText, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}\">\n                    <toolkit:AutoCompleteBox.InputBindings>\n                      <KeyBinding\n                        Key=\"Escape\"\n                        CommandTarget=\"{Binding ElementName=SearchPanelControl}\" />\n                    </toolkit:AutoCompleteBox.InputBindings>\n                  </toolkit:AutoCompleteBox>\n                  <Button\n                    Name=\"ClearButton\"\n                    Width=\"24\"\n                    Height=\"24\"\n                    Margin=\"2,0,2,0\"\n                    Padding=\"2,2,2,2\"\n                    Click=\"ClearButton_Click\"\n                    ToolTip=\"Clear list of recent opened files\">\n                    <Image Source=\"{StaticResource RemoveIcon}\" />\n                  </Button>\n                </StackPanel>\n              </DockPanel>\n            </Expander.Header>\n            <ListBox\n              Name=\"RecentFilesListBox\"\n              Margin=\"0,8,0,0\"\n              FontSize=\"12\"\n              KeyDown=\"RecentFilesListBox_KeyDown\"\n              MouseDoubleClick=\"RecentFilesListBox_MouseDoubleClick\"\n              ScrollViewer.HorizontalScrollBarVisibility=\"Disabled\"\n              SelectionMode=\"Single\">\n              <ListBox.ItemTemplate>\n                <DataTemplate>\n                  <Grid HorizontalAlignment=\"Stretch\">\n                    <TextBlock\n                      Margin=\"0,0,30,0\"\n                      HorizontalAlignment=\"Stretch\"\n                      Text=\"{Binding .}\"\n                      TextTrimming=\"CharacterEllipsis\" />\n                    <StackPanel\n                      Margin=\"4,0,0,0\"\n                      HorizontalAlignment=\"Right\">\n                      <Button\n                        Name=\"RemoveButton\"\n                        Width=\"16\"\n                        Height=\"16\"\n                        Padding=\"1\"\n                        Background=\"Transparent\"\n                        BorderThickness=\"0\"\n                        Click=\"RemoveButton_OnClick\"\n                        ToolTip=\"Remove file entry from history\">\n                        <Image\n                          Width=\"14\"\n                          Height=\"14\"\n                          Source=\"{StaticResource ClearIcon}\" />\n                      </Button>\n\n                      <StackPanel.Style>\n                        <Style TargetType=\"{x:Type StackPanel}\">\n                          <Style.Triggers>\n                            <DataTrigger\n                              Binding=\"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsMouseOver}\"\n                              Value=\"False\">\n                              <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n                            </DataTrigger>\n                          </Style.Triggers>\n                        </Style>\n                      </StackPanel.Style>\n                    </StackPanel>\n                  </Grid>\n                </DataTemplate>\n              </ListBox.ItemTemplate>\n              <ListBox.ItemContainerStyle>\n                <Style TargetType=\"ListBoxItem\">\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n                </Style>\n              </ListBox.ItemContainerStyle>\n            </ListBox>\n          </Expander>\n\n          <Expander\n            Margin=\"0,8,0,0\"\n            IsExpanded=\"False\"\n            Visibility=\"Collapsed\">\n            <Expander.Header>\n              <DockPanel\n                HorizontalAlignment=\"Stretch\"\n                LastChildFill=\"True\">\n                <TextBlock\n                  VerticalAlignment=\"Center\"\n                  Text=\"Recent Base/Diff Files\" />\n                <Button\n                  Width=\"24\"\n                  Height=\"24\"\n                  Margin=\"24,0,2,0\"\n                  Padding=\"2,2,2,2\"\n                  Click=\"OpenBaseDiffFilesButton_Click\"\n                  ToolTip=\"Clear list of recent files\">\n                  <Image Source=\"{StaticResource FolderIcon}\" />\n                </Button>\n                <Button\n                  Width=\"24\"\n                  Height=\"24\"\n                  Margin=\"2,0,2,0\"\n                  Padding=\"2,2,2,2\"\n                  Click=\"DiffRemoveButton_OnClick\"\n                  ToolTip=\"Clear list of recent files\">\n                  <Image Source=\"{StaticResource RemoveIcon}\" />\n                </Button>\n              </DockPanel>\n            </Expander.Header>\n            <ListBox\n              Name=\"RecentDiffFilesListBox\"\n              Margin=\"0,8,0,0\"\n              FontSize=\"14\"\n              KeyDown=\"RecentDiffFilesListBox_KeyDown\"\n              MouseDoubleClick=\"RecentDiffFilesListBox_MouseDoubleClick\"\n              ScrollViewer.HorizontalScrollBarVisibility=\"Disabled\"\n              SelectionMode=\"Single\">\n              <ListBox.ItemTemplate>\n                <DataTemplate>\n                  <Grid HorizontalAlignment=\"Stretch\">\n                    <StackPanel\n                      Margin=\"0,0,30,0\"\n                      HorizontalAlignment=\"Stretch\"\n                      Orientation=\"Vertical\">\n                      <TextBlock\n                        FontSize=\"12\"\n                        Text=\"{Binding Item1}\" />\n                      <Separator />\n                      <TextBlock\n                        FontSize=\"12\"\n                        Text=\"{Binding Item2}\" />\n                    </StackPanel>\n\n                    <StackPanel\n                      Margin=\"4,0,0,0\"\n                      HorizontalAlignment=\"Right\"\n                      VerticalAlignment=\"Center\">\n                      <Button\n                        Name=\"DiffRemoveButton\"\n                        Width=\"16\"\n                        Height=\"16\"\n                        Padding=\"1\"\n                        Background=\"Transparent\"\n                        BorderThickness=\"0\"\n                        Click=\"DiffRemoveButton_OnClick\"\n                        ToolTip=\"Remove entry from history\">\n                        <Image\n                          Width=\"14\"\n                          Height=\"14\"\n                          Source=\"{StaticResource ClearIcon}\" />\n                      </Button>\n                      <StackPanel.Style>\n                        <Style TargetType=\"{x:Type StackPanel}\">\n                          <Style.Triggers>\n                            <DataTrigger\n                              Binding=\"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsMouseOver}\"\n                              Value=\"False\">\n                              <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n                            </DataTrigger>\n                          </Style.Triggers>\n                        </Style>\n                      </StackPanel.Style>\n                    </StackPanel>\n                  </Grid>\n                </DataTemplate>\n              </ListBox.ItemTemplate>\n            </ListBox>\n          </Expander>\n        </StackPanel>\n      </ScrollViewer>\n    </DockPanel>\n  </Border>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/StartPagePanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI.Panels;\n\npublic partial class StartPagePanel : UserControl {\n  public StartPagePanel() {\n    InitializeComponent();\n  }\n\n  public event EventHandler<string> OpenRecentDocument;\n  public event EventHandler<Tuple<string, string>> OpenRecentDiffDocuments;\n  public event EventHandler<RecordingSession> OpenRecentProfileSession;\n  public event EventHandler OpenFile;\n  public event EventHandler CompareFiles;\n  public event EventHandler ClearRecentDocuments;\n  public event EventHandler ClearRecentDiffDocuments;\n  public event EventHandler ClearRecentProfileSessions;\n  public event EventHandler LoadProfile;\n  public event EventHandler RecordProfile;\n\n  public void ReloadFileList() {\n    RecentFilesListBox.ItemsSource = new ListCollectionView(App.Settings.RecentFiles);\n    RecentFilesListBox.Visibility = App.Settings.RecentFiles.Count > 0 ? Visibility.Visible : Visibility.Collapsed;\n    RecentDiffFilesListBox.ItemsSource = new ListCollectionView(App.Settings.RecentComparedFiles);\n    RecentDiffFilesListBox.Visibility =\n      App.Settings.RecentComparedFiles.Count > 0 ? Visibility.Visible : Visibility.Collapsed;\n\n    var profileSettings = App.Settings.ProfileOptions;\n    var sessionList = new List<RecordingSession>();\n\n    foreach (var prevSession in profileSettings.PreviousLoadedSessions) {\n      sessionList.Add(new RecordingSession(prevSession, true));\n    }\n\n    RecentProfilesListBox.ItemsSource = new ListCollectionView(sessionList);\n    RecentProfilesListBox.Visibility = profileSettings.PreviousLoadedSessions.Count > 0 ?\n      Visibility.Visible : Visibility.Collapsed;\n  }\n\n  private void RecentFilesListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    InvokeOpenRecentDocument();\n    e.Handled = true;\n  }\n\n  private void RecentFilesListBox_KeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Enter) {\n      InvokeOpenRecentDocument();\n      e.Handled = true;\n    }\n  }\n\n  private void RecentProfilesListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    InvokeOpenRecentProfileSession();\n    e.Handled = true;\n  }\n\n  private void RecentProfilesListBox_KeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Enter) {\n      InvokeOpenRecentProfileSession();\n      e.Handled = true;\n    }\n  }\n\n  private void RecentDiffFilesListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    InvokeOpenRecentDiffDocuments();\n    e.Handled = true;\n  }\n\n  private void RecentDiffFilesListBox_KeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Enter) {\n      InvokeOpenRecentDiffDocuments();\n      e.Handled = true;\n    }\n  }\n\n  private void InvokeOpenRecentDocument() {\n    if (RecentFilesListBox.SelectedItem != null) {\n      OpenRecentDocument?.Invoke(this, (string)RecentFilesListBox.SelectedItem);\n    }\n  }\n\n  private void InvokeOpenRecentDiffDocuments() {\n    if (RecentDiffFilesListBox.SelectedItem != null) {\n      OpenRecentDiffDocuments?.Invoke(this, (Tuple<string, string>)RecentDiffFilesListBox.SelectedItem);\n    }\n  }\n\n  private void InvokeOpenRecentProfileSession() {\n    if (RecentProfilesListBox.SelectedItem != null) {\n      OpenRecentProfileSession?.Invoke(this, (RecordingSession)RecentProfilesListBox.SelectedItem);\n    }\n  }\n\n  private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e) {\n    App.InstallExtension();\n  }\n\n  private void TextBlock_MouseDown_1(object sender, MouseButtonEventArgs e) {\n    App.OpenDocumentation();\n  }\n\n  private void OpenFileButton_Click(object sender, RoutedEventArgs e) {\n    OpenFile?.Invoke(this, null);\n  }\n\n  private void OpenBaseDiffFilesButton_Click(object sender, RoutedEventArgs e) {\n    CompareFiles?.Invoke(this, null);\n  }\n\n  private void ClearButton_Click(object sender, RoutedEventArgs e) {\n    ClearRecentDocuments?.Invoke(this, null);\n  }\n\n  private void ClearSessionsButton_Click(object sender, RoutedEventArgs e) {\n    ClearRecentProfileSessions?.Invoke(this, null);\n  }\n\n  private void ClearDiffButton_Click(object sender, RoutedEventArgs e) {\n    ClearRecentDiffDocuments?.Invoke(this, null);\n  }\n\n  private void TextSearch_Populating(object sender, PopulatingEventArgs e) {\n    var box = (AutoCompleteBox)sender;\n    box.ItemsSource = null;\n    box.ItemsSource = App.Settings.RecentFiles;\n    box.PopulateComplete();\n  }\n\n  private void TextSearch_KeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Escape) {\n      TextSearch.Text = \"\";\n    }\n    else if (e.Key == Key.Enter) {\n      RecentFilesListBox.SelectedItem = TextSearch.Text;\n      InvokeOpenRecentDocument();\n    }\n  }\n\n  private void ProfileTextSearch_Populating(object sender, PopulatingEventArgs e) {\n    var box = (AutoCompleteBox)sender;\n    box.ItemsSource = null;\n    box.ItemsSource = App.Settings.ProfileOptions.PreviousLoadedSessions;\n    box.PopulateComplete();\n  }\n\n  private void ProfileTextSearch_KeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Escape) {\n      TextSearch.Text = \"\";\n    }\n    else if (e.Key == Key.Enter) {\n      RecentProfilesListBox.SelectedItem = TextSearch.Text;\n      InvokeOpenRecentProfileSession();\n    }\n  }\n\n  private void RemoveButton_OnClick(object sender, RoutedEventArgs e) {\n    if (((Button)sender).DataContext is string item) {\n      App.Settings.RemoveRecentFile(item);\n      ReloadFileList();\n    }\n  }\n\n  private void DiffRemoveButton_OnClick(object sender, RoutedEventArgs e) {\n    if (((Button)sender).DataContext is Tuple<string, string> item) {\n      App.Settings.RemoveRecentComparedFiles(item);\n      ReloadFileList();\n    }\n  }\n\n  private void RemoveProfileButton_OnClick(object sender, RoutedEventArgs e) {\n    if (((Button)sender).DataContext is RecordingSession session) {\n      App.Settings.RemoveLoadedProfileSession(session.Report);\n      ReloadFileList();\n    }\n  }\n\n  private void RecordProfileButton_Click(object sender, RoutedEventArgs e) {\n    RecordProfile?.Invoke(this, null);\n  }\n\n  private void LoadProfileButton_Click(object sender, RoutedEventArgs e) {\n    LoadProfile?.Invoke(this, null);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ToolPanelControl.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing System.Windows.Controls;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic class ToolPanelControl : UserControl, IToolPanel {\n  public virtual ToolPanelKind PanelKind => ToolPanelKind.Other;\n  public virtual string TitlePrefix { get; set; }\n  public virtual string TitleSuffix { get; set; }\n  public virtual string TitleToolTip { get; set; }\n  public virtual HandledEventKind HandledEvents => HandledEventKind.None;\n  public virtual IRDocument Document { get; set; }\n  public virtual IRDocument BoundDocument { get; set; }\n  public virtual IUISession Session { get; set; }\n  public virtual bool SavesStateToFile => false;\n  public virtual bool IsUnloaded => Document == null;\n  public virtual bool IsPanelEnabled { get; set; }\n  public virtual bool HasCommandFocus { get; set; }\n  public virtual bool HasPinnedContent { get; set; }\n  public virtual bool IgnoreNextLoadEvent { get; set; }\n  public virtual bool IgnoreNextUnloadEvent { get; set; }\n\n  public virtual void OnRegisterPanel() {\n    IsPanelEnabled = true;\n  }\n\n  public virtual void OnUnregisterPanel() { }\n  public virtual void OnElementSelected(IRElementEventArgs e) { }\n  public virtual void OnElementHighlighted(IRHighlightingEventArgs e) { }\n\n  public virtual Task OnReloadSettings() {\n    return Task.CompletedTask;\n  }\n\n  public async virtual Task OnDocumentSectionLoaded(IRTextSection section, IRDocument document) {\n    Document = document;\n  }\n\n  public async virtual Task OnDocumentSectionUnloaded(IRTextSection section, IRDocument document) {\n    Document = null;\n  }\n\n  public virtual void OnActivatePanel() { }\n  public virtual void OnDeactivatePanel() { }\n  public virtual void OnRedrawPanel() { }\n  public virtual void OnHidePanel() { }\n  public virtual void OnShowPanel() { }\n  public virtual void ClonePanel(IToolPanel basePanel) { }\n\n  public virtual void OnSessionStart() {\n    Utils.EnableControl(this);\n  }\n\n  public virtual void OnSessionSave() { }\n\n  public virtual void OnSessionEnd() {\n    Document = null;\n    Utils.DisableControl(this, 0.75);\n  }\n\n  public virtual void OnDocumentLoaded(IRDocument document) { }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ValueStatisticPanel.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.ValueStatisticPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <Grid>\n    <StackPanel>\n      <StackPanel\n        Margin=\"4,0,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"100\"\n          Text=\"Average\" />\n        <TextBlock Text=\"{Binding Path=Average, StringFormat=f2}\" />\n      </StackPanel>\n      <StackPanel\n        Margin=\"4,0,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"100\"\n          Text=\"Median\" />\n        <TextBlock Text=\"{Binding Median}\" />\n      </StackPanel>\n      <StackPanel\n        Margin=\"4,0,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          Width=\"100\"\n          Text=\"Min/Max\" />\n        <TextBlock Text=\"{Binding Min}\" />\n        <TextBlock Text=\"/\" />\n        <TextBlock Text=\"{Binding Max}\" />\n      </StackPanel>\n      <Expander\n        x:Name=\"DistributionExpander\"\n        Margin=\"0,4,0,0\"\n        Expanded=\"Expander_Expanded\">\n        <Expander.Header>\n          <DockPanel\n            Width=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            LastChildFill=\"True\">\n            <TextBlock Text=\"Value distribution\" />\n            <StackPanel\n              Margin=\"64,0,0,0\"\n              DockPanel.Dock=\"Right\"\n              Orientation=\"Horizontal\"\n              Visibility=\"{Binding IsExpanded, ElementName=DistributionExpander, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <TextBlock Text=\"Group size\" />\n              <Slider\n                x:Name=\"FactorSlider\"\n                Width=\"50\"\n                Margin=\"4,0,0,0\"\n                DockPanel.Dock=\"Right\"\n                Maximum=\"5\"\n                Minimum=\"0\"\n                SmallChange=\"1\"\n                ValueChanged=\"Slider_ValueChanged\"\n                Value=\"1\" />\n              <TextBlock\n                x:Name=\"GroupSizeLabel\"\n                Margin=\"8,0,0,0\"\n                Text=\"1\" />\n            </StackPanel>\n          </DockPanel>\n        </Expander.Header>\n        <ListView\n          x:Name=\"DistributionList\"\n          Margin=\"0,4,0,0\"\n          Panel.ZIndex=\"2\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          BorderBrush=\"{x:Null}\"\n          BorderThickness=\"0,0,0,0\"\n          IsTextSearchEnabled=\"False\"\n          SelectionChanged=\"DistributionList_SelectionChanged\"\n          SelectionMode=\"Single\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn\n                Width=\"Auto\"\n                DisplayMemberBinding=\"{Binding RangeStart}\">\n                <GridViewColumnHeader Content=\"Start\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"Auto\"\n                DisplayMemberBinding=\"{Binding RangeEnd}\">\n                <GridViewColumnHeader Content=\"End\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n              <GridViewColumn\n                Width=\"100\"\n                DisplayMemberBinding=\"{Binding Count}\">\n                <GridViewColumnHeader Content=\"Times\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn Width=\"180\">\n                <GridViewColumnHeader Content=\"\" />\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <StackPanel\n                      VerticalAlignment=\"Center\"\n                      Orientation=\"Horizontal\">\n                      <Rectangle\n                        Width=\"{Binding Path=Percentage, Converter={StaticResource DoubleScalingConverter}, ConverterParameter=150.0}\"\n                        Height=\"16\"\n                        Fill=\"RoyalBlue\"\n                        Stroke=\"Black\" />\n                      <TextBlock\n                        Margin=\"4,0,0,0\"\n                        Text=\"{Binding Path=Percentage, StringFormat=p2}\" />\n                    </StackPanel>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n            </Style>\n          </ListView.ItemContainerStyle>\n        </ListView>\n      </Expander>\n    </StackPanel>\n  </Grid>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Panels/ValueStatisticPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class ValueStatisticPanel : UserControl {\n  private ValueStatistics valueStats_;\n  private int factor_;\n\n  public ValueStatisticPanel() {\n    InitializeComponent();\n    factor_ = 1;\n  }\n\n  public event EventHandler<List<IRTextFunction>> RangeSelected;\n\n  private void Expander_Expanded(object sender, RoutedEventArgs e) {\n    valueStats_ = (ValueStatistics)DataContext;\n    FactorSlider.Maximum = valueStats_.MaxDistributionFactor;\n    UpdateDistribution(factor_);\n  }\n\n  private void UpdateDistribution(int factor) {\n    var distribList = valueStats_.ComputeDistribution(factor);\n    DistributionList.ItemsSource = new ListCollectionView(distribList);\n    GroupSizeLabel.Text = valueStats_.GetGroupSize(factor).ToString();\n  }\n\n  private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) {\n    if (valueStats_ != null) {\n      factor_ = (int)e.NewValue;\n      UpdateDistribution(factor_);\n    }\n  }\n\n  private void DistributionList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    var range = DistributionList.SelectedItem as ValueStatistics.DistributionRange;\n\n    if (range == null) {\n      return;\n    }\n\n    var funcList = new List<IRTextFunction>(range.Values.Count);\n\n    foreach (var value in range.Values) {\n      funcList.Add(value.Item1);\n    }\n\n    range.Values.Sort((a, b) => {\n      int result = a.Item2.CompareTo(b.Item2);\n\n      if (result != 0) {\n        return result;\n      }\n\n      return a.Item1.Name.CompareTo(b.Item1.Name);\n    });\n\n    RangeSelected?.Invoke(this, funcList);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/CallTreeNodePanel.xaml",
    "content": "﻿<client:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.Profile.CallTreeNodePanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:client=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:profile=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  x:Name=\"Root\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <DockPanel\n    HorizontalAlignment=\"Stretch\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    LastChildFill=\"True\">\n    <Grid\n      HorizontalAlignment=\"Stretch\"\n      DockPanel.Dock=\"Top\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"Auto\" />\n      </Grid.ColumnDefinitions>\n      <StackPanel\n        Grid.Column=\"0\"\n        Margin=\"4,2,4,2\"\n        HorizontalAlignment=\"Stretch\">\n        <StackPanel\n          HorizontalAlignment=\"Stretch\"\n          Orientation=\"Horizontal\">\n          <TextBlock\n            Width=\"72\"\n            VerticalAlignment=\"Center\"\n            Text=\"Total Time\"\n            ToolTip=\"Inclusive (total) time for this function instance\" />\n\n          <ContentControl\n            Width=\"180\"\n            MinWidth=\"180\"\n            MaxWidth=\"180\"\n            HorizontalAlignment=\"Stretch\"\n            Content=\"{Binding CallTreeNode}\"\n            ContentTemplate=\"{StaticResource ProfilePercentageTemplate}\"\n            ToolTip=\"Inclusive (total) time for this function instance\" />\n        </StackPanel>\n        <StackPanel Orientation=\"Horizontal\">\n          <TextBlock\n            Width=\"72\"\n            Text=\"Self Time\"\n            ToolTip=\"Exclusive (self) time for this function instance\" />\n          <ContentControl\n            Width=\"180\"\n            MinWidth=\"180\"\n            MaxWidth=\"180\"\n            HorizontalAlignment=\"Stretch\"\n            Content=\"{Binding CallTreeNode}\"\n            ContentTemplate=\"{StaticResource ProfileExclusivePercentageTemplate}\"\n            ToolTip=\"Exclusive (self) time for this function instance\" />\n        </StackPanel>\n      </StackPanel>\n      <Grid\n        Grid.Column=\"1\"\n        Margin=\"0,0,4,0\"\n        Visibility=\"{Binding ShowInstanceNavigation, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <StackPanel\n          HorizontalAlignment=\"Left\"\n          Orientation=\"Horizontal\">\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"{Binding CurrentInstanceIndex}\"\n            ToolTip=\"Currently selected function instance\" />\n          <TextBlock Text=\" / \" />\n          <TextBlock\n            Text=\"{Binding FunctionInstancesCount}\"\n            ToolTip=\"Number  function instances\" />\n        </StackPanel>\n        <Button\n          x:Name=\"PreviousInstanceButton\"\n          Margin=\"0,18,14,0\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Top\"\n          Background=\"{x:Null}\"\n          BorderBrush=\"{x:Null}\"\n          Click=\"PreviousInstanceButton_Click\"\n          IsEnabled=\"{Binding ShowInstanceNavigation}\"\n          ToolTip=\"Jump to previous function instance\">\n          <Image\n            Width=\"14\"\n            Height=\"14\"\n            Source=\"{StaticResource DockLeftIcon}\"\n            Style=\"{StaticResource DisabledImageStyle}\" />\n        </Button>\n        <Button\n          x:Name=\"NextInstanceButton\"\n          Margin=\"0,18,-2,0\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Top\"\n          Background=\"{x:Null}\"\n          BorderBrush=\"{x:Null}\"\n          Click=\"NextInstanceButton_Click\"\n          IsEnabled=\"{Binding ShowInstanceNavigation}\"\n          ToolTip=\"Jump to next function instance\">\n          <Image\n            Width=\"14\"\n            Height=\"14\"\n            Source=\"{StaticResource DockRightIcon}\"\n            Style=\"{StaticResource DisabledImageStyle}\" />\n        </Button>\n      </Grid>\n    </Grid>\n\n    <TabControl\n      Margin=\"0,2,0,0\"\n      Padding=\"2\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\"\n      DockPanel.Dock=\"Bottom\"\n      Visibility=\"{Binding ShowDetails, Converter={StaticResource BoolToVisibilityConverter}}\">\n      <TabItem\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        HorizontalContentAlignment=\"Stretch\"\n        Header=\"Info\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalAlignment=\"Stretch\"\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <StackPanel\n            MaxWidth=\"{Binding ActualWidth, ElementName=ContentHost}\"\n            Margin=\"0,4,0,0\">\n            <Expander\n              x:Name=\"InstancesExpander\"\n              Margin=\"0,4,0,4\"\n              HorizontalAlignment=\"Stretch\"\n              Header=\"{Binding FunctionInstancesCount, Converter={StaticResource StringFormatConverter}, ConverterParameter='Instances ({0})'}\"\n              IsExpanded=\"{Binding IsInstancesExpanded}\"\n              ToolTip=\"Function instances statistics\">\n              <StackPanel Orientation=\"Vertical\">\n                <StackPanel\n                  Margin=\"4,8,0,0\"\n                  Orientation=\"Horizontal\">\n                  <TextBlock\n                    Width=\"72\"\n                    Text=\"Total Time\" />\n                  <ContentControl\n                    Width=\"200\"\n                    Margin=\"8,0,0,0\"\n                    HorizontalAlignment=\"Left\"\n                    Content=\"{Binding InstancesNode}\"\n                    ContentTemplate=\"{StaticResource ProfileCombinedPercentageTemplate}\"\n                    ToolTip=\"Total time across all function instances\" />\n                </StackPanel>\n\n                <StackPanel\n                  Margin=\"4,2,0,0\"\n                  Orientation=\"Horizontal\"\n                  Visibility=\"{Binding ShowInstanceNavigation, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <TextBlock\n                    Width=\"72\"\n                    Text=\"Average Time\" />\n                  <ContentControl\n                    Width=\"200\"\n                    Margin=\"8,0,0,0\"\n                    HorizontalAlignment=\"Left\"\n                    Content=\"{Binding AverageNode}\"\n                    ContentTemplate=\"{StaticResource ProfileCombinedPercentageTemplate}\"\n                    ToolTip=\"Average time across all function instances\" />\n                </StackPanel>\n\n                <StackPanel\n                  Margin=\"4,2,0,0\"\n                  Orientation=\"Horizontal\"\n                  Visibility=\"{Binding ShowInstanceNavigation, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <TextBlock\n                    Width=\"72\"\n                    Text=\"Median Time\" />\n                  <ContentControl\n                    Width=\"200\"\n                    Margin=\"8,0,0,0\"\n                    HorizontalAlignment=\"Left\"\n                    Content=\"{Binding MedianNode}\"\n                    ContentTemplate=\"{StaticResource ProfileCombinedPercentageTemplate}\"\n                    ToolTip=\"Median time across all function instances\" />\n                </StackPanel>\n              </StackPanel>\n            </Expander>\n\n            <Expander\n              x:Name=\"HistogramExpander\"\n              Margin=\"0,0,0,4\"\n              HorizontalAlignment=\"Stretch\"\n              Expanded=\"HistogramHost_Expanded\"\n              Header=\"Histogram\"\n              IsExpanded=\"{Binding IsHistogramExpanded}\"\n              ToolTip=\"Histogram representing time distribution across all function instances\">\n              <Border\n                Height=\"150\"\n                Margin=\"0,4,0,0\"\n                BorderBrush=\"DarkGray\"\n                BorderThickness=\"0.5\">\n                <StackPanel>\n                  <Canvas\n                    x:Name=\"InstanceHistogramHost\"\n                    Height=\"130\"\n                    Margin=\"0,-4,0,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    VerticalAlignment=\"Stretch\" />\n                  <Grid>\n                    <StackPanel\n                      Margin=\"4,2,4,2\"\n                      HorizontalAlignment=\"Left\"\n                      Orientation=\"Horizontal\">\n                      <RadioButton\n                        VerticalAlignment=\"Center\"\n                        Content=\"Total\"\n                        IsChecked=\"{Binding UseSelfTimeHistogram, Mode=TwoWay, Converter={StaticResource InvertedBoolConverter}}\" />\n                      <RadioButton\n                        Margin=\"4,0,0,0\"\n                        VerticalAlignment=\"Center\"\n                        Content=\"Self\"\n                        IsChecked=\"{Binding UseSelfTimeHistogram, Mode=TwoWay}\" />\n                    </StackPanel>\n                    <StackPanel\n                      Margin=\"4\"\n                      HorizontalAlignment=\"Right\"\n                      Orientation=\"Horizontal\">\n                      <Grid>\n                        <Border\n                          Width=\"12\"\n                          Height=\"12\"\n                          HorizontalAlignment=\"Left\"\n                          VerticalAlignment=\"Center\"\n                          Background=\"{Binding HistogramInstanceBrush}\" />\n                        <TextBlock\n                          Margin=\"16,0,0,0\"\n                          VerticalAlignment=\"Center\"\n                          FontSize=\"11\"\n                          Text=\"Instance\" />\n                      </Grid>\n                      <Grid Margin=\"6,0,0,0\">\n                        <Border\n                          Width=\"12\"\n                          Height=\"12\"\n                          HorizontalAlignment=\"Left\"\n                          VerticalAlignment=\"Center\"\n                          Background=\"{Binding HistogramMedianBrush}\" />\n                        <TextBlock\n                          Margin=\"16,0,0,0\"\n                          VerticalAlignment=\"Center\"\n                          FontSize=\"11\"\n                          Text=\"Median\" />\n                      </Grid>\n                      <Grid Margin=\"6,0,0,0\">\n                        <Border\n                          Width=\"12\"\n                          Height=\"12\"\n                          HorizontalAlignment=\"Left\"\n                          VerticalAlignment=\"Center\"\n                          Background=\"{Binding HistogramAverageBrush}\" />\n                        <TextBlock\n                          Margin=\"16,0,0,0\"\n                          VerticalAlignment=\"Center\"\n                          FontSize=\"11\"\n                          Text=\"Average\" />\n                      </Grid>\n\n                    </StackPanel>\n                  </Grid>\n                </StackPanel>\n              </Border>\n            </Expander>\n\n            <Expander\n              x:Name=\"ThreadsExpander\"\n              MaxHeight=\"155\"\n              Margin=\"0,0,0,8\"\n              HorizontalAlignment=\"Stretch\"\n              Header=\"{Binding Path=Items.Count, ElementName=ThreadList, Converter={StaticResource StringFormatConverter}, ConverterParameter='Threads ({0})'}\"\n              IsExpanded=\"{Binding IsThreadsListExpanded}\"\n              ToolTip=\"Threads on which the selected instance executed\">\n              <ItemsControl\n                x:Name=\"ThreadList\"\n                Margin=\"4,8,4,4\">\n                <ItemsControl.ItemTemplate>\n                  <DataTemplate>\n                    <StackPanel\n                      x:Name=\"ThreadItemHost\"\n                      Height=\"20\"\n                      MouseDown=\"ThreadListItem_MouseDown\"\n                      Orientation=\"Horizontal\"\n                      Tag=\"{Binding ElementName=Root}\"\n                      ToolTip=\"{Binding ToolTip}\">\n                      <Border\n                        x:Name=\"ThreadTitleBorder\"\n                        Width=\"72\"\n                        Margin=\"0,0,8,0\"\n                        Background=\"{Binding Background}\"\n                        BorderBrush=\"DarkGray\"\n                        BorderThickness=\"0.5\">\n                        <Grid>\n                          <TextBlock\n                            Padding=\"4,0,0,0\"\n                            VerticalAlignment=\"Center\"\n                            FontWeight=\"Medium\"\n                            Text=\"{Binding Title}\" />\n                          <Grid\n                            Width=\"18\"\n                            Height=\"18\"\n                            HorizontalAlignment=\"Right\"\n                            VerticalAlignment=\"Top\"\n                            PreviewMouseLeftButtonDown=\"ThreadContextMenuButton_Click\"\n                            ToolTip=\"Show Thread Actions\">\n                            <Image\n                              Width=\"16\"\n                              Height=\"16\"\n                              Source=\"{StaticResource BlockIcon}\"\n                              Style=\"{StaticResource DisabledImageStyle}\" />\n                          </Grid>\n                        </Grid>\n                      </Border>\n                      <ContentControl\n                        Width=\"200\"\n                        VerticalAlignment=\"Center\"\n                        Content=\"{Binding}\"\n                        ContentTemplate=\"{StaticResource ProfileCombinedPercentageTemplate}\"\n                        ToolTip=\"{Binding WeightToolTip}\" />\n                      <StackPanel.ContextMenu>\n                        <ContextMenu\n                          DataContext=\"{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Mode=Self}}\"\n                          Tag=\"{Binding PlacementTarget.Content, RelativeSource={RelativeSource Mode=Self}}\">\n                          <MenuItem\n                            Command=\"{Binding PreviewFunctionCommand}\"\n                            CommandParameter=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}\"\n                            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                            Header=\"Preview Thread Instance\"\n                            ToolTip=\"Show a preview popup of the function assembly or source code\">\n                            <MenuItem.Icon>\n                              <Image\n                                Width=\"16\"\n                                Height=\"16\"\n                                Source=\"{StaticResource PeekDefinitionIcon}\" />\n                            </MenuItem.Icon>\n                          </MenuItem>\n                          <MenuItem\n                            Command=\"{Binding OpenFunctionCommand}\"\n                            CommandParameter=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}\"\n                            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                            Header=\"Open Thread Instance\"\n                            ToolTip=\"Open the function assembly view\">\n                            <MenuItem.Icon>\n                              <Image\n                                Width=\"16\"\n                                Height=\"16\"\n                                Source=\"{StaticResource LayoutOpenIcon}\" />\n                            </MenuItem.Icon>\n                          </MenuItem>\n                          <MenuItem\n                            Command=\"{Binding OpenFunctionInNewTabCommand}\"\n                            CommandParameter=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}\"\n                            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                            Header=\"Open Thread Instance in New Tab\"\n                            ToolTip=\"Open the function assembly view in a new tab\">\n                            <MenuItem.Icon>\n                              <Image\n                                Width=\"16\"\n                                Height=\"16\"\n                                Source=\"{StaticResource LayoutOpenNewIcon}\" />\n                            </MenuItem.Icon>\n                          </MenuItem>\n                          <Separator Background=\"LightGray\" />\n                          <MenuItem\n                            Command=\"{Binding DataContext.FilterToThreadCommand}\"\n                            CommandParameter=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}\"\n                            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                            Header=\"Filter to Thread\"\n                            ToolTip=\"Display activity from only this thread\">\n                            <MenuItem.Icon>\n                              <Image\n                                Width=\"16\"\n                                Height=\"16\"\n                                Source=\"{StaticResource FilterIcon}\" />\n                            </MenuItem.Icon>\n                          </MenuItem>\n                          <MenuItem\n                            Command=\"{Binding DataContext.ExcludeThreadCommand}\"\n                            CommandParameter=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}\"\n                            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                            Header=\"Exclude Thread\" />\n                          <Separator Background=\"LightGray\" />\n\n                          <MenuItem\n                            Command=\"{Binding DataContext.FilterToSameNameThreadCommand}\"\n                            CommandParameter=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}\"\n                            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                            Header=\"Filter to Same Name Threads\"\n                            ToolTip=\"Display activity from only threads with the same name\" />\n                          <MenuItem\n                            Command=\"{Binding DataContext.ExcludeSameNameThreadCommand}\"\n                            CommandParameter=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}\"\n                            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n                            Header=\"Exclude Same Name Threads\" />\n                        </ContextMenu>\n                      </StackPanel.ContextMenu>\n                    </StackPanel>\n\n                    <DataTemplate.Triggers>\n                      <Trigger Property=\"IsMouseOver\" Value=\"True\">\n                        <Setter TargetName=\"ThreadTitleBorder\" Property=\"BorderBrush\" Value=\"Black\" />\n                        <Setter TargetName=\"ThreadItemHost\" Property=\"Background\" Value=\"#D0E3F1\" />\n                      </Trigger>\n                    </DataTemplate.Triggers>\n                  </DataTemplate>\n                </ItemsControl.ItemTemplate>\n                <ItemsControl.ItemsPanel>\n                  <ItemsPanelTemplate>\n                    <StackPanel Orientation=\"Vertical\" />\n                  </ItemsPanelTemplate>\n                </ItemsControl.ItemsPanel>\n\n                <ItemsControl.Template>\n                  <ControlTemplate>\n                    <ScrollViewer\n                      x:Name=\"ScrollViewer\"\n                      Padding=\"{TemplateBinding Padding}\"\n                      HorizontalScrollBarVisibility=\"Disabled\"\n                      VerticalScrollBarVisibility=\"Auto\">\n                      <ItemsPresenter />\n                    </ScrollViewer>\n                  </ControlTemplate>\n                </ItemsControl.Template>\n              </ItemsControl>\n            </Expander>\n\n            <Separator Background=\"LightGray\" />\n            <Grid>\n              <TextBlock\n                Margin=\"4,4,0,2\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Module\" />\n              <StackPanel\n                Margin=\"0,0,4,0\"\n                HorizontalAlignment=\"Right\"\n                Orientation=\"Horizontal\">\n                <Button\n                  x:Name=\"MarkModuleButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderThickness=\"0\"\n                  Click=\"MarkModuleButton_OnClick\"\n                  ToolTip=\"Mark all functions belonging to this module (saved)\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"0,1,0,0\"\n                    Source=\"{StaticResource AddBookmarkIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <Button.ContextMenu>\n                    <ContextMenu\n                      DataContext=\"{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Mode=Self}}\"\n                      Tag=\"{Binding PlacementTarget.Content, RelativeSource={RelativeSource Mode=Self}}\">\n                      <MenuItem>\n                        <MenuItem.Header>\n                          <client:ColorSelector ColorSelectedCommand=\"{Binding MarkModuleCommand}\" />\n                        </MenuItem.Header>\n                      </MenuItem>\n                    </ContextMenu>\n                  </Button.ContextMenu>\n                </Button>\n                <Button\n                  x:Name=\"CopyModuleButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderThickness=\"0\"\n                  Click=\"CopyModuleButton_OnClick\"\n                  ToolTip=\"Copy module name to clipboard\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource ClipboardIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n              </StackPanel>\n            </Grid>\n            <Canvas\n              x:Name=\"ModuleCanvas\"\n              Height=\"{Binding ElementName=ModuleTextBlock, Path=ActualHeight}\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Stretch\">\n              <TextBox\n                x:Name=\"ModuleTextBlock\"\n                Width=\"{Binding ElementName=ModuleCanvas, Path=ActualWidth}\"\n                Margin=\"2,0,2,0\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                FontWeight=\"Medium\"\n                IsReadOnly=\"True\"\n                MaxLines=\"2\"\n                ScrollViewer.CanContentScroll=\"True\"\n                ScrollViewer.HorizontalScrollBarVisibility=\"Auto\"\n                ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n                Text=\"{Binding Path=CallTreeNode.ModuleName}\"\n                TextWrapping=\"Wrap\" />\n            </Canvas>\n\n            <Grid>\n              <TextBlock\n                Margin=\"4,4,8,2\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Text=\"Function\" />\n              <ContentPresenter\n                Margin=\"60,4,6,0\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Content=\"{Binding CallTreeNode}\"\n                ContentTemplate=\"{StaticResource ExecutionContextTemplate}\"\n                ToolTip=\"Function execution context\" />\n              <StackPanel\n                Margin=\"0,0,4,0\"\n                HorizontalAlignment=\"Right\"\n                Orientation=\"Horizontal\">\n                <Button\n                  x:Name=\"PreviewButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderThickness=\"0\"\n                  Click=\"PreviewButton_OnClick\"\n                  ToolTip=\"Show a preview popup of the function assembly or source code\"\n                  Visibility=\"{Binding EnableSingleNodeActions, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"17\"\n                    Source=\"{StaticResource PeekDefinitionIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n\n                <Button\n                  x:Name=\"OpenButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderThickness=\"0\"\n                  Click=\"OpenButton_OnClick\"\n                  ToolTip=\"Open the function assembly view in a new tab\"\n                  Visibility=\"{Binding EnableSingleNodeActions, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource LayoutOpenNewIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n\n                <Button\n                  x:Name=\"MarkFunctionButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderThickness=\"0\"\n                  Click=\"MarkModuleButton_OnClick\"\n                  ToolTip=\"Mark all functions with the same name (saved)\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"0,1,0,0\"\n                    Source=\"{StaticResource BookmarkIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                  <Button.ContextMenu>\n                    <ContextMenu\n                      DataContext=\"{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Mode=Self}}\"\n                      Tag=\"{Binding PlacementTarget.Content, RelativeSource={RelativeSource Mode=Self}}\">\n                      <MenuItem>\n                        <MenuItem.Header>\n                          <client:ColorSelector ColorSelectedCommand=\"{Binding MarkFunctionCommand}\" />\n                        </MenuItem.Header>\n                      </MenuItem>\n                    </ContextMenu>\n                  </Button.ContextMenu>\n                </Button>\n                <Button\n                  x:Name=\"CopyFUnctionButton\"\n                  Width=\"20\"\n                  Height=\"20\"\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                  BorderThickness=\"0\"\n                  Click=\"CopyFUnctionButton_OnClick\"\n                  ToolTip=\"Copy function name to clipboard\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource ClipboardIcon}\"\n                    Style=\"{StaticResource DisabledImageStyle}\" />\n                </Button>\n              </StackPanel>\n            </Grid>\n            <Canvas\n              x:Name=\"FunctionCanvas\"\n              Height=\"{Binding ElementName=FunctionTextBlock, Path=ActualHeight}\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Stretch\">\n              <TextBox\n                x:Name=\"FunctionTextBlock\"\n                Width=\"{Binding ElementName=FunctionCanvas, Path=ActualWidth}\"\n                Margin=\"2,0,2,0\"\n                HorizontalAlignment=\"Stretch\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                FontWeight=\"Medium\"\n                IsReadOnly=\"True\"\n                ScrollViewer.CanContentScroll=\"True\"\n                ScrollViewer.HorizontalScrollBarVisibility=\"Auto\"\n                ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n                Text=\"{Binding Path=CallTreeNode.FullFunctionName}\"\n                TextWrapping=\"Wrap\" />\n            </Canvas>\n          </StackPanel>\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Header=\"Stack\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Reversed call stack for current function instance\">\n        <profile:ProfileListView\n          x:Name=\"BacktraceList\"\n          NameColumnTitle=\"Function\"\n          ShowCombinedTimeNameRow=\"True\"\n          ShowContextColumn=\"True\"\n          ShowModuleColumn=\"True\" />\n      </TabItem>\n\n      <TabItem\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Header=\"Functions\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Exclusive (self) time for functions executing under this instance\">\n        <profile:ProfileListView\n          x:Name=\"FunctionList\"\n          NameColumnTitle=\"Function\"\n          ShowCombinedTimeNameRow=\"True\"\n          ShowContextColumn=\"True\"\n          ShowModuleColumn=\"True\" />\n      </TabItem>\n      <TabItem\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Header=\"Modules\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Time for modules executing under this function instance\">\n        <Grid>\n          <Grid.RowDefinitions>\n            <RowDefinition Height=\"1*\" />\n            <RowDefinition Height=\"3\" />\n            <RowDefinition Height=\"1*\" />\n          </Grid.RowDefinitions>\n          <profile:ProfileListView\n            x:Name=\"ModuleList\"\n            Grid.Row=\"0\"\n            MinHeight=\"100\"\n            ExclusiveTimeColumnTitle=\"Time\"\n            NameColumnTitle=\"Module\"\n            ShowTimeNameRow=\"True\" />\n          <GridSplitter\n            Grid.Row=\"1\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\"\n            Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            ResizeBehavior=\"PreviousAndNext\" />\n          <profile:ProfileListView\n            x:Name=\"ModuleFunctionList\"\n            Grid.Row=\"2\"\n            MinHeight=\"100\"\n            NameColumnTitle=\"Module Function\"\n            ShowCombinedTimeNameRow=\"True\"\n            ShowContextColumn=\"True\" />\n        </Grid>\n      </TabItem>\n      <TabItem\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Header=\"Categories\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"Categorized time for functions executing under this instance\">\n        <Grid>\n          <Grid.RowDefinitions>\n            <RowDefinition Height=\"1*\" />\n            <RowDefinition Height=\"3\" />\n            <RowDefinition Height=\"1*\" />\n          </Grid.RowDefinitions>\n          <profile:ProfileListView\n            x:Name=\"CategoryList\"\n            Grid.Row=\"0\"\n            MinHeight=\"100\"\n            ExclusiveTimeColumnTitle=\"Time\"\n            NameColumnTitle=\"Category\"\n            ShowTimeNameRow=\"True\" />\n          <GridSplitter\n            Grid.Row=\"1\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\"\n            Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            ResizeBehavior=\"PreviousAndNext\" />\n          <profile:ProfileListView\n            x:Name=\"CategoryFunctionList\"\n            Grid.Row=\"2\"\n            MinHeight=\"100\"\n            NameColumnTitle=\"Category Function\"\n            ShowCombinedTimeNameRow=\"True\"\n            ShowContextColumn=\"True\"\n            ShowModuleColumn=\"True\" />\n        </Grid>\n      </TabItem>\n      <TabItem\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Header=\"Instances\"\n        Style=\"{StaticResource TabControlStyle}\"\n        ToolTip=\"All instances of this function\">\n        <profile:ProfileListView\n          x:Name=\"InstancesList\"\n          NameColumnTitle=\"Function\"\n          ShowCombinedTimeNameRow=\"True\"\n          ShowContextColumn=\"True\" />\n      </TabItem>\n    </TabControl>\n  </DockPanel>\n</client:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/CallTreeNodePanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing OxyPlot;\nusing OxyPlot.Annotations;\nusing OxyPlot.Axes;\nusing OxyPlot.Series;\nusing OxyPlot.Wpf;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Controls;\nusing PlotCommands = OxyPlot.PlotCommands;\nusing VerticalAlignment = System.Windows.VerticalAlignment;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic interface IFunctionProfileInfoProvider {\n  List<ProfileCallTreeNode> GetBacktrace(ProfileCallTreeNode node);\n  (List<ProfileCallTreeNode>, List<ModuleProfileInfo> Modules) GetTopFunctionsAndModules(ProfileCallTreeNode node);\n}\n\npublic class ProfileCallTreeNodeEx : BindableObject {\n  public ProfileCallTreeNodeEx(ProfileCallTreeNode callTreeNode) {\n    CallTreeNode = callTreeNode;\n  }\n\n  public ProfileCallTreeNode CallTreeNode { get; }\n  public string FunctionName { get; set; }\n  public string FullFunctionName { get; set; }\n  public string ModuleName { get; set; }\n  public double Percentage { get; set; }\n  public double ExclusivePercentage { get; set; }\n  public bool IsMarked { get; set; }\n  public TimeSpan Weight => CallTreeNode.Weight;\n  public TimeSpan ExclusiveWeight => CallTreeNode.ExclusiveWeight;\n}\n\npublic class ThreadListItem {\n  public int ThreadId { get; set; }\n  public string Title { get; set; }\n  public string ToolTip { get; set; }\n  public string WeightToolTip { get; set; }\n  public TimeSpan Weight { get; set; }\n  public TimeSpan ExclusiveWeight { get; set; }\n  public double Percentage { get; set; }\n  public double ExclusivePercentage { get; set; }\n  public Brush Background { get; set; }\n}\n\npublic partial class CallTreeNodePanel : ToolPanelControl, INotifyPropertyChanged {\n  private const int MaxFunctionNameLength = 100;\n  private const int MaxModuleNameLength = 50;\n  private ProfileCallTreeNodeEx nodeEx_;\n  private int nodeInstanceIndex_;\n  private List<ProfileCallTreeNode> instanceNodes_;\n  private IFunctionProfileInfoProvider funcInfoProvider_;\n  private bool histogramVisible_;\n  private ProfileCallTreeNodeEx instancesNode_;\n  private ProfileCallTreeNodeEx averageNode_;\n  private ProfileCallTreeNodeEx mediansNode_;\n  private int funcInstancesCount_;\n  private int currentInstanceIndex_;\n  private bool showDetails_;\n  private bool showInstanceNavigation_;\n  private bool useSelfTimeHistogram_;\n  private CallTreeNodeSettings settings_;\n  private bool enableSingleNodeActions_;\n\n  public CallTreeNodePanel() {\n    InitializeComponent();\n    SetupEvents();\n    DataContext = this;\n    CallTreeNode = null;\n  }\n\n  public override IUISession Session {\n    get => base.Session;\n    set {\n      base.Session = value;\n      BacktraceList.Session = value;\n      FunctionList.Session = value;\n      ModuleList.Session = value;\n      ModuleFunctionList.Session = value;\n      CategoryList.Session = value;\n      CategoryFunctionList.Session = value;\n      InstancesList.Session = value;\n    }\n  }\n\n  public CallTreeNodeSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      BacktraceList.Settings = value;\n      FunctionList.Settings = value;\n      ModuleList.Settings = value;\n      ModuleFunctionList.Settings = value;\n      CategoryList.Settings = value;\n      CategoryFunctionList.Settings = value;\n      InstancesList.Settings = value;\n\n      BacktraceList.RestoreColumnsState(settings_.StackListColumns);\n      FunctionList.RestoreColumnsState(settings_.FunctionListColumns);\n      ModuleList.RestoreColumnsState(settings_.ModuleListColumns);\n      ModuleFunctionList.RestoreColumnsState(settings_.ModuleFunctionListColumns);\n      CategoryList.RestoreColumnsState(settings_.CategoryListColumns);\n      CategoryFunctionList.RestoreColumnsState(settings_.CategoryFunctionListColumns);\n      InstancesList.RestoreColumnsState(settings_.InstanceListColumns);\n\n      OnPropertyChanged(nameof(HistogramInstanceBrush));\n      OnPropertyChanged(nameof(HistogramAverageBrush));\n      OnPropertyChanged(nameof(HistogramMedianBrush));\n\n      if (IsHistogramExpanded) {\n        InvokeSetupInstancesHistogram();\n      }\n    }\n  }\n\n  public bool IsInstancesExpanded {\n    get => settings_ is {ExpandInstances: true};\n    set {\n      settings_.ExpandInstances = value;\n      OnPropertyChanged();\n    }\n  }\n\n  public bool IsHistogramExpanded {\n    get => settings_ is {ExpandHistogram: true};\n    set {\n      settings_.ExpandHistogram = value;\n      OnPropertyChanged();\n    }\n  }\n\n  public bool IsThreadsListExpanded {\n    get => settings_ is {ExpandThreads: true};\n    set {\n      settings_.ExpandThreads = value;\n      OnPropertyChanged();\n    }\n  }\n\n  public ProfileCallTreeNodeEx CallTreeNode {\n    get => nodeEx_;\n    set {\n      SetField(ref nodeEx_, value);\n\n      if (value != null) {\n        Utils.EnableControl(this);\n      }\n      else {\n        Utils.DisableControl(this);\n      }\n    }\n  }\n\n  public Brush HistogramInstanceBrush => settings_?.HistogramCurrentColor.AsBrush();\n  public Brush HistogramAverageBrush => settings_?.HistogramAverageColor.AsBrush();\n  public Brush HistogramMedianBrush => settings_?.HistogramMedianColor.AsBrush();\n\n  public ProfileCallTreeNodeEx InstancesNode {\n    get => instancesNode_;\n    set => SetField(ref instancesNode_, value);\n  }\n\n  public ProfileCallTreeNodeEx AverageNode {\n    get => averageNode_;\n    set => SetField(ref averageNode_, value);\n  }\n\n  public ProfileCallTreeNodeEx MedianNode {\n    get => mediansNode_;\n    set => SetField(ref mediansNode_, value);\n  }\n\n  public int FunctionInstancesCount {\n    get => funcInstancesCount_;\n    set => SetField(ref funcInstancesCount_, value);\n  }\n\n  public int CurrentInstanceIndex {\n    get => currentInstanceIndex_;\n    set => SetField(ref currentInstanceIndex_, value);\n  }\n\n  public bool ShowDetails {\n    get => showDetails_;\n    set {\n      SetField(ref showDetails_, value);\n      OnPropertyChanged(nameof(ShowInstanceNavigation));\n    }\n  }\n\n  public bool ShowInstanceNavigation {\n    get => showInstanceNavigation_ && showDetails_;\n    set => SetField(ref showInstanceNavigation_, value);\n  }\n\n  public bool UseSelfTimeHistogram {\n    get => useSelfTimeHistogram_;\n    set {\n      if (SetField(ref useSelfTimeHistogram_, value)) {\n        SetupInstancesHistogram(instanceNodes_, CallTreeNode.CallTreeNode, useSelfTimeHistogram_);\n      }\n    }\n  }\n\n  public bool EnableSingleNodeActions {\n    get => enableSingleNodeActions_;\n    set => SetField(ref enableSingleNodeActions_, value);\n  }\n\n  public RelayCommand<object> ExcludeThreadCommand =>\n    new(async obj => {\n      if (((FrameworkElement)obj).DataContext is ThreadListItem threadItem) {\n        await ApplyThreadFilterAction(threadItem, ThreadActivityAction.ExcludeThread);\n      }\n    });\n  public RelayCommand<object> ExcludeSameNameThreadCommand =>\n    new(async obj => {\n      if (((FrameworkElement)obj).DataContext is ThreadListItem threadItem) {\n        await ApplyThreadFilterAction(threadItem, ThreadActivityAction.ExcludeSameNameThread);\n      }\n    });\n  public RelayCommand<object> FilterToThreadCommand =>\n    new(async obj => {\n      if (((FrameworkElement)obj).DataContext is ThreadListItem threadItem) {\n        await ApplyThreadFilterAction(threadItem, ThreadActivityAction.FilterToThread);\n      }\n    });\n  public RelayCommand<object> FilterToSameNameThreadCommand =>\n    new(async obj => {\n      if (((FrameworkElement)obj).DataContext is ThreadListItem threadItem) {\n        await ApplyThreadFilterAction(threadItem, ThreadActivityAction.FilterToSameNameThread);\n      }\n    });\n  public RelayCommand<object> PreviewFunctionCommand => new(async obj => {\n    if (((FrameworkElement)obj).DataContext is ThreadListItem threadItem &&\n        instancesNode_.CallTreeNode != null) {\n      var filter = new ProfileSampleFilter(threadItem.ThreadId);\n      await IRDocumentPopupInstance.ShowPreviewPopup(instancesNode_.CallTreeNode.Function, \"\",\n                                                     ThreadsExpander, Session, filter);\n    }\n  });\n  public RelayCommand<object> OpenFunctionCommand => new(async obj => {\n    var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n    await OpenFunction(obj, mode);\n  });\n  public RelayCommand<object> OpenFunctionInNewTabCommand => new(async obj => {\n    await OpenFunction(obj, OpenSectionKind.NewTab);\n  });\n  public RelayCommand<object> MarkModuleCommand => new(async obj => {\n    if (obj is SelectedColorEventArgs e) {\n      if (CallTreeNode.CallTreeNode is ProfileCallTreeGroupNode groupNode) {\n        foreach (var node in groupNode.Nodes) {\n          MarkModule(node.ModuleName, e.SelectedColor);\n        }\n      }\n      else {\n        MarkModule(CallTreeNode.CallTreeNode.ModuleName, e.SelectedColor);\n      }\n    }\n  });\n  public RelayCommand<object> MarkFunctionCommand => new(async obj => {\n    if (obj is SelectedColorEventArgs e) {\n      if (CallTreeNode.CallTreeNode is ProfileCallTreeGroupNode groupNode) {\n        foreach (var node in groupNode.Nodes) {\n          string funcName = node.FormatFunctionName(Session);\n          MarkFunction(funcName, e.SelectedColor);\n        }\n      }\n      else {\n        string funcName = CallTreeNode.CallTreeNode.FormatFunctionName(Session);\n        MarkFunction(funcName, e.SelectedColor);\n      }\n    }\n  });\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<ProfileCallTreeNode> NodeInstanceChanged;\n  public event EventHandler<ProfileCallTreeNode> BacktraceNodeClick;\n  public event EventHandler<ProfileCallTreeNode> BacktraceNodeDoubleClick;\n  public event EventHandler<ProfileCallTreeNode> InstanceNodeClick;\n  public event EventHandler<ProfileCallTreeNode> InstanceNodeDoubleClick;\n  public event EventHandler<ProfileCallTreeNode> FunctionNodeClick;\n  public event EventHandler<ProfileCallTreeNode> FunctionNodeDoubleClick;\n  public event EventHandler<ProfileCallTreeNode> ModuleNodeClick;\n  public event EventHandler<ProfileCallTreeNode> ModuleNodeDoubleClick;\n  public event EventHandler<List<ProfileCallTreeNode>> NodesSelected;\n  public event EventHandler MarkingChanged;\n\n  public void SaveListColumnSettings() {\n    BacktraceList.SaveColumnsState(settings_.StackListColumns);\n    FunctionList.SaveColumnsState(settings_.FunctionListColumns);\n    ModuleList.SaveColumnsState(settings_.ModuleListColumns);\n    ModuleFunctionList.SaveColumnsState(settings_.ModuleFunctionListColumns);\n    CategoryList.SaveColumnsState(settings_.CategoryListColumns);\n    CategoryFunctionList.SaveColumnsState(settings_.CategoryFunctionListColumns);\n    InstancesList.SaveColumnsState(settings_.InstanceListColumns);\n  }\n\n  public void Show(ProfileCallTreeNodeEx nodeEx) {\n    CallTreeNode = nodeEx;\n  }\n\n  public async Task ShowWithDetailsAsync(ProfileCallTreeNode node) {\n    await ShowWithDetailsAsync(SetupNodeExtension(node, Session));\n  }\n\n  public async Task ShowWithDetailsAsync(ProfileCallTreeNodeEx node) {\n    CallTreeNode = node;\n    await ShowDetailsAsync();\n  }\n\n  public async Task ShowDetailsAsync() {\n    ModuleFunctionList.Reset();\n    CategoryFunctionList.Reset();\n\n    await SetupInstanceInfo(CallTreeNode.CallTreeNode);\n    ShowDetails = true;\n\n    var markings = App.Settings.MarkingSettings.BuiltinMarkingCategories.FunctionColors;\n    var task1 = Task.Run(() => funcInfoProvider_.GetBacktrace(CallTreeNode.CallTreeNode));\n    var task2 = Task.Run(() => funcInfoProvider_.GetTopFunctionsAndModules(CallTreeNode.CallTreeNode));\n    var task4 = Task.Run(() => ProfilingUtils.CollectMarkedFunctions(markings, false,\n                                                                     Session, CallTreeNode.CallTreeNode));\n    BacktraceList.ShowFunctions(await task1);\n    var (funcList, moduleList) = await task2;\n    FunctionList.ShowFunctions(funcList, settings_.FunctionListViewFilter);\n    ModuleList.ShowModules(moduleList);\n    CategoryList.ShowCategories(await task4);\n\n    ModuleList.SelectFirstItem();\n    CategoryList.SelectFirstItem();\n  }\n\n  public void Initialize(IUISession session, IFunctionProfileInfoProvider funcInfoProvider) {\n    Session = session;\n    Settings = App.Settings.CallTreeNodeSettings;\n    funcInfoProvider_ = funcInfoProvider;\n  }\n\n  public void UpdateMarkedFunctions() {\n    BacktraceList.UpdateMarkedFunctions();\n    FunctionList.UpdateMarkedFunctions();\n    BacktraceList.UpdateMarkedFunctions();\n    InstancesList.UpdateMarkedFunctions();\n    ModuleList.UpdateMarkedFunctions();\n    ModuleFunctionList.UpdateMarkedFunctions();\n    CategoryList.UpdateMarkedFunctions();\n    CategoryFunctionList.UpdateMarkedFunctions();\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private void SetupEvents() {\n    BacktraceList.NodeClick += (sender, node) => BacktraceNodeClick?.Invoke(sender, node);\n    BacktraceList.NodeDoubleClick += (sender, node) => BacktraceNodeDoubleClick?.Invoke(sender, node);\n    BacktraceList.MarkingChanged += (sender, args) => MarkingChanged?.Invoke(sender, args);\n    FunctionList.NodeClick += (sender, node) => FunctionNodeClick?.Invoke(sender, node);\n    FunctionList.NodeDoubleClick += (sender, node) => FunctionNodeDoubleClick?.Invoke(sender, node);\n    FunctionList.MarkingChanged += (sender, args) => MarkingChanged?.Invoke(sender, args);\n    InstancesList.NodeClick += (sender, node) => InstanceNodeClick?.Invoke(sender, node);\n    InstancesList.NodeDoubleClick += (sender, node) => InstanceNodeDoubleClick?.Invoke(sender, node);\n    InstancesList.MarkingChanged += (sender, args) => MarkingChanged?.Invoke(sender, args);\n    ModuleList.NodeClick += (sender, node) => ModuleNodeClick?.Invoke(sender, node);\n    ModuleList.NodeDoubleClick += (sender, node) => ModuleNodeDoubleClick?.Invoke(sender, node);\n    ModuleList.ModuleClick += (sender, moduleInfo) => UpdateModuleFunctions(moduleInfo);\n    ModuleList.MarkingChanged += (sender, args) => MarkingChanged?.Invoke(sender, args);\n    ModuleFunctionList.NodeClick += (sender, node) => FunctionNodeClick?.Invoke(sender, node);\n    ModuleFunctionList.NodeDoubleClick += (sender, node) => FunctionNodeDoubleClick?.Invoke(sender, node);\n    ModuleFunctionList.MarkingChanged += (sender, args) => MarkingChanged?.Invoke(sender, args);\n    CategoryList.CategoryClick += (sender, category) => UpdateCategoryFunctions(category);\n    CategoryFunctionList.NodeClick += (sender, node) => FunctionNodeClick?.Invoke(sender, node);\n    CategoryFunctionList.NodeDoubleClick += (sender, node) => FunctionNodeDoubleClick?.Invoke(sender, node);\n    CategoryFunctionList.MarkingChanged += (sender, args) => MarkingChanged?.Invoke(sender, args);\n  }\n\n  private void UpdateCategoryFunctions(FunctionMarkingCategory category) {\n    CategoryFunctionList.ShowFunctions(category.SortedFunctions, settings_.FunctionListViewFilter);\n  }\n\n  private void UpdateModuleFunctions(ModuleProfileInfo moduleInfo) {\n    ModuleFunctionList.ShowFunctions(moduleInfo.Functions, settings_.FunctionListViewFilter);\n  }\n\n  private async Task SetupInstanceInfo(ProfileCallTreeNode node) {\n    var callTree = Session.ProfileData.CallTree;\n    var groupNode = node as ProfileCallTreeGroupNode;\n\n    // Collect all instances associated with the node's function.\n    // With multiple nodes selected, the node is a ProfileCallTreeGroupNode,\n    // combine the instances of all functions in the group to get the list.\n    if (groupNode != null) {\n      instanceNodes_ = await Task.Run(() => {\n        // For a node group, combine the instances for each node.\n        var instanceNodes = new List<ProfileCallTreeNode>();\n        var handledFuncts = new HashSet<IRTextFunction>();\n\n        foreach (var n in groupNode.Nodes) {\n          if (handledFuncts.Add(n.Function)) {\n            instanceNodes.AddRange(callTree.GetSortedCallTreeNodes(n.Function));\n          }\n        }\n\n        return instanceNodes;\n      });\n    }\n    else {\n      instanceNodes_ = callTree.GetSortedCallTreeNodes(node.Function);\n    }\n\n    if (instanceNodes_.Count == 0) {\n      ShowInstanceNavigation = false;\n      return;\n    }\n\n    // Create the node that sums up all selected nodes.\n    ProfileCallTreeNode combinedNode = null;\n\n    if (groupNode != null) {\n      // With multiple nodes selected, the node is a ProfileCallTreeGroupNode,\n      // the instances of all functions in the group are already combined.\n      combinedNode = groupNode;\n    }\n    else {\n      combinedNode = await Task.Run(() => callTree.GetCombinedCallTreeNode(node.Function));\n    }\n\n    InstancesNode = SetupNodeExtension(combinedNode, Session);\n    FunctionInstancesCount = instanceNodes_.Count;\n\n    // Show all instances.\n    InstancesList.ShowFunctions(instanceNodes_);\n    ShowInstanceNavigation = instanceNodes_.Count > 1;\n    EnableSingleNodeActions = groupNode == null;\n\n    // Setup instance navigation controls.\n    if (groupNode == null) {\n      nodeInstanceIndex_ = instanceNodes_.FindIndex(instanceNode => instanceNode == node);\n    }\n    else {\n      nodeInstanceIndex_ = 0;\n    }\n\n    CurrentInstanceIndex = nodeInstanceIndex_ + 1;\n\n    // Show average time.\n    var averageNode = instanceNodes_[0].Clone();\n    averageNode.Weight = combinedNode.Weight / instanceNodes_.Count;\n    averageNode.ExclusiveWeight = combinedNode.ExclusiveWeight / instanceNodes_.Count;\n    var averageNodeEx = SetupNodeExtension(averageNode, Session);\n    averageNodeEx.Percentage = Session.ProfileData.ScaleFunctionWeight(averageNodeEx.Weight);\n    averageNodeEx.ExclusivePercentage = Session.ProfileData.ScaleFunctionWeight(averageNodeEx.ExclusiveWeight);\n    AverageNode = averageNodeEx;\n\n    // Show median time.\n    var medianNode = instanceNodes_[instanceNodes_.Count / 2];\n    var medianNodeEx = SetupNodeExtension(medianNode, Session);\n    medianNodeEx.Percentage = Session.ProfileData.ScaleFunctionWeight(medianNodeEx.Weight);\n    medianNodeEx.ExclusivePercentage = Session.ProfileData.ScaleFunctionWeight(medianNodeEx.ExclusiveWeight);\n    MedianNode = medianNodeEx;\n\n    SetupThreadList(node);\n    InstancesExpander.IsExpanded = settings_.ExpandInstances;\n    HistogramExpander.IsExpanded = settings_.ExpandHistogram;\n    ThreadsExpander.IsExpanded = settings_.ExpandThreads;\n\n    if (settings_.ExpandHistogram) {\n      InvokeSetupInstancesHistogram();\n    }\n  }\n\n  private void SetupThreadList(ProfileCallTreeNode node) {\n    var threadList = node.SortedByWeightPerThreadWeights;\n    var itemsList = new List<ThreadListItem>();\n\n    foreach (var item in threadList) {\n      var threadInfo = Session.ProfileData.FindThread(item.ThreadId);\n      var backColor = App.Settings.TimelineSettings.\n        GetThreadBackgroundColors(threadInfo, item.ThreadId).Margin;\n\n      // Compute thread percentage relative to selected node instance.\n      double threadPercentage = node.Weight.Ticks > 0 ?\n        (double)item.Values.Weight.Ticks / node.Weight.Ticks : 0;\n      double selfThreadPercentage = node.ExclusiveWeight.Ticks > 0 ?\n        (double)item.Values.ExclusiveWeight.Ticks / node.ExclusiveWeight.Ticks : 0;\n\n      itemsList.Add(new ThreadListItem() {\n        ThreadId = item.ThreadId,\n        Title = $\"{item.ThreadId}\",\n        ToolTip = threadInfo != null ? threadInfo.Name : null,\n        WeightToolTip = $\"{threadPercentage.AsPercentageString()} of instance time\\n\" +\n                        $\"{selfThreadPercentage.AsPercentageString()} of instance self time\",\n        Background = backColor,\n        Weight = item.Values.Weight,\n        ExclusiveWeight = item.Values.ExclusiveWeight,\n        Percentage = Session.ProfileData.ScaleFunctionWeight(item.Values.Weight),\n        ExclusivePercentage = Session.ProfileData.ScaleFunctionWeight(item.Values.ExclusiveWeight)\n      });\n    }\n\n    ThreadList.ItemsSource = itemsList;\n  }\n\n  private void SetupInstancesHistogram(List<ProfileCallTreeNode> nodes,\n                                       ProfileCallTreeNode currentNode, bool useSelfTime) {\n    if (useSelfTime) {\n      SetupInstancesHistogramImpl(nodes, currentNode, node => node.ExclusiveWeight);\n    }\n    else {\n      SetupInstancesHistogramImpl(nodes, currentNode, node => node.Weight);\n    }\n  }\n\n  private void SetupInstancesHistogramImpl(List<ProfileCallTreeNode> nodes, ProfileCallTreeNode currentNode,\n                                           Func<ProfileCallTreeNode, TimeSpan> selectWeight) {\n    nodes = new List<ProfileCallTreeNode>(nodes);\n    nodes.Sort((a, b) => selectWeight(a).CompareTo(selectWeight(b)));\n\n    const double maxBinCount = 20;\n    var maxWeight = selectWeight(nodes[^1]);\n    var minWeight = selectWeight(nodes[0]);\n    var delta = maxWeight - minWeight;\n    long weightPerBin = (long)Math.Ceiling(delta.Ticks / maxBinCount);\n    double maxHeight = InstanceHistogramHost.ActualHeight;\n\n    // Partition nodes into bins.\n    var bins = new List<(TimeSpan Weight, TimeSpan TotalWeight, int StartIndex, int Count)>();\n    var binWeight = selectWeight(nodes[0]);\n    var binTotalWeight = binWeight;\n    int binStartIndex = 0;\n    int binCount = 1;\n\n    for (int i = 1; i < nodes.Count; i++) {\n      var node = nodes[i];\n\n      if ((selectWeight(node) - binWeight).Ticks > weightPerBin) {\n        bins.Add((binWeight, binTotalWeight, binStartIndex, binCount));\n        binWeight = selectWeight(node);\n        binTotalWeight = binWeight;\n        binStartIndex = i;\n        binCount = 1;\n      }\n      else {\n        binTotalWeight += selectWeight(node);\n        binCount++;\n      }\n    }\n\n    bins.Add((binWeight, binTotalWeight, binStartIndex, binCount));\n\n    // Add each bin to the graph.\n    var model = new PlotModel();\n    var series = new HistogramSeries();\n    series.FillColor = OxyColors.WhiteSmoke;\n    series.StrokeThickness = 0.5;\n\n    OxyColor ColorFromArgb(Color color) {\n      return OxyColor.FromArgb(color.A, color.R, color.G, color.B);\n    }\n\n    foreach (var bin in bins) {\n      if (bin.Count == 0) {\n        continue;\n      }\n\n      long start = bin.Weight.Ticks;\n      long end = (bin.Weight + TimeSpan.FromTicks(weightPerBin)).Ticks;\n      var barColor = ColorFromArgb(settings_.HistogramBarColor);\n      var item = new BinHistogramItem(start, end, bin.Count, bin.Count, barColor) {\n        Count = bin.Count,\n        TotalWeight = bin.TotalWeight,\n        AverageWeight = TimeSpan.FromTicks(bin.TotalWeight.Ticks / bin.Count),\n        Nodes = nodes.GetRange(bin.StartIndex, bin.Count)\n      };\n      series.Items.Add(item);\n    }\n\n    series.LabelFormatString = \"{3}\";\n    series.LabelMargin = 2;\n    series.MouseDown += (sender, e) => {\n      if (e.HitTestResult.Item is BinHistogramItem binItem) {\n        NodesSelected?.Invoke(this, binItem.Nodes);\n      }\n    };\n    model.Series.Add(series);\n\n    // Setup horizontal axis.\n    var weightAxis = new LinearAxis();\n    weightAxis.Position = AxisPosition.Bottom;\n    weightAxis.TickStyle = TickStyle.None;\n\n    if (delta.TotalSeconds <= 1) {\n      weightAxis.LabelFormatter = value => TimeSpan.FromTicks((long)value).AsMillisecondsString();\n    }\n    else {\n      weightAxis.LabelFormatter = value => TimeSpan.FromTicks((long)value).AsSecondsString();\n    }\n\n    weightAxis.MinimumPadding = 0;\n    weightAxis.MinimumDataMargin = 6;\n    weightAxis.IsPanEnabled = false;\n    weightAxis.IsZoomEnabled = false;\n    model.Axes.Add(weightAxis);\n\n    // Setup vertical axis.\n    var countAxis = new LinearAxis();\n    countAxis.Position = AxisPosition.Right;\n    countAxis.TickStyle = TickStyle.None;\n    countAxis.Title = \"Instances\";\n    countAxis.StringFormat = \" \";\n    countAxis.IsPanEnabled = false;\n    countAxis.IsZoomEnabled = false;\n    countAxis.MinimumPadding = 0;\n    countAxis.MaximumDataMargin = 20;\n    model.Axes.Add(countAxis);\n\n    // Add line for current instance.\n    void AddLineAnnotation(double value, OxyColor color, LineStyle lineStyle) {\n      var line = new LineAnnotation();\n      line.Type = LineAnnotationType.Vertical;\n      line.X = value;\n      line.StrokeThickness = 2;\n      line.Color = color;\n      line.LineStyle = lineStyle;\n      model.Annotations.Add(line);\n    }\n\n    void AddPointAnnotation(double value, OxyColor color) {\n      var point = new PointAnnotation();\n      point.Shape = MarkerType.Diamond;\n      point.X = value;\n      point.Fill = color;\n      model.Annotations.Add(point);\n    }\n\n    AddPointAnnotation(currentNode.Weight.Ticks, ColorFromArgb(settings_.HistogramCurrentColor));\n\n    // Add lines for median and average time.\n    double average = nodes.Average(node => node.Weight.Ticks);\n    AddLineAnnotation(average, ColorFromArgb(settings_.HistogramAverageColor), LineStyle.Dot);\n\n    long median = nodes[nodes.Count / 2].Weight.Ticks;\n    AddLineAnnotation(median, ColorFromArgb(settings_.HistogramMedianColor), LineStyle.Dot);\n\n    var plotView = new PlotView();\n    plotView.Model = model;\n    model.IsLegendVisible = false;\n    plotView.VerticalContentAlignment = VerticalAlignment.Center;\n    plotView.Width = InstanceHistogramHost.ActualWidth;\n    plotView.Height = InstanceHistogramHost.ActualHeight;\n    plotView.MinHeight = plotView.Height;\n    model.PlotAreaBorderThickness = new OxyThickness(0, 0, 0, 0.5);\n    plotView.Background = InstanceHistogramHost.Background;\n\n    // Override tooltip.\n    plotView.Controller = new PlotController();\n    plotView.Controller.UnbindMouseDown(OxyMouseButton.Left);\n    plotView.Controller.BindMouseEnter(PlotCommands.HoverSnapTrack);\n\n    object tooltipTemplate = Application.Current.FindResource(\"HistogramTooltipTemplate\");\n    plotView.DefaultTrackerTemplate = (ControlTemplate)tooltipTemplate;\n\n    InstanceHistogramHost.Children.Clear();\n    InstanceHistogramHost.Children.Add(plotView);\n    histogramVisible_ = true;\n  }\n\n  public static ProfileCallTreeNodeEx SetupNodeExtension(ProfileCallTreeNode node, IUISession session) {\n    if (node == null) {\n      return null;\n    }\n\n    var nameProvider = session.CompilerInfo.NameProvider;\n    var moduleMap = new Dictionary<string, int>();\n    var functionMap = new Dictionary<string, int>();\n    var fullFunctionMap = new Dictionary<string, int>();\n    string moduleNames = null;\n    string functionNames = null;\n    string fullFunctionNames = null;\n\n    if (node is ProfileCallTreeGroupNode groupNode) {\n      foreach (var n in groupNode.Nodes) {\n        moduleMap.AccumulateValue(n.FormatModuleName(nameProvider.FormatFunctionName, MaxModuleNameLength), 1);\n        functionMap.AccumulateValue(n.FormatFunctionName(nameProvider.FormatFunctionName, MaxFunctionNameLength), 1);\n        fullFunctionMap.AccumulateValue(n.FormatFunctionName(nameProvider.FormatFunctionName), 1);\n      }\n\n      moduleNames = GenerateNameListText(moduleMap, \"\\n\");\n      functionNames = GenerateNameListText(functionMap, \"\\n\");\n      fullFunctionNames = GenerateNameListText(fullFunctionMap, \"\\n\");\n    }\n    else {\n      moduleNames = node.FormatModuleName(nameProvider.FormatFunctionName, MaxModuleNameLength);\n      functionNames = node.FormatFunctionName(nameProvider.FormatFunctionName, MaxFunctionNameLength);\n      fullFunctionNames = node.FormatFunctionName(nameProvider.FormatFunctionName);\n    }\n\n    var nodeEx = new ProfileCallTreeNodeEx(node) {\n      FullFunctionName = fullFunctionNames,\n      FunctionName = functionNames,\n      ModuleName = moduleNames,\n      Percentage = session.ProfileData.ScaleFunctionWeight(node.Weight),\n      ExclusivePercentage = session.ProfileData.ScaleFunctionWeight(node.ExclusiveWeight)\n    };\n\n    return nodeEx;\n  }\n\n  private static string GenerateNameListText(Dictionary<string, int> nameMap, string separator) {\n    var nameList = nameMap.ToList();\n    nameList.Sort((a, b) => string.Compare(a.Item1, b.Item1, StringComparison.Ordinal));\n    var sb = new StringBuilder();\n\n    foreach (var pair in nameList) {\n      if (pair.Item2 > 1) {\n        sb.Append($\"{pair.Item2} x {pair.Item1}{separator}\");\n      }\n      else {\n        sb.Append($\"{pair.Item1}{separator}\");\n      }\n    }\n\n    return sb.ToString().Trim();\n  }\n\n  private async void PreviousInstanceButton_Click(object sender, RoutedEventArgs e) {\n    if (nodeInstanceIndex_ > 0) {\n      int index = Utils.IsKeyboardModifierActive() ? 0 : nodeInstanceIndex_ - 1;\n      var node = instanceNodes_[index];\n      NodeInstanceChanged?.Invoke(this, node);\n      await ShowWithDetailsAsync(node);\n    }\n  }\n\n  private async void NextInstanceButton_Click(object sender, RoutedEventArgs e) {\n    if (nodeInstanceIndex_ < FunctionInstancesCount - 1) {\n      int index = Utils.IsKeyboardModifierActive() ? FunctionInstancesCount - 1 : nodeInstanceIndex_ + 1;\n      var node = instanceNodes_[index];\n      NodeInstanceChanged?.Invoke(this, node);\n      await ShowWithDetailsAsync(node);\n    }\n  }\n\n  private void HistogramHost_Expanded(object sender, RoutedEventArgs e) {\n    if (!histogramVisible_ && instanceNodes_ != null) {\n      InvokeSetupInstancesHistogram();\n    }\n  }\n\n  private void InvokeSetupInstancesHistogram() {\n    // Create the histogram on the next render pass,\n    // after the host has been expanded, otherwise some computations assert.\n    Dispatcher.BeginInvoke(() => {\n      if (instanceNodes_ != null) {\n        SetupInstancesHistogram(instanceNodes_, CallTreeNode.CallTreeNode, useSelfTimeHistogram_);\n      }\n    }, DispatcherPriority.Render);\n  }\n\n  public void Reset() {\n    Utils.DisableControl(this);\n  }\n\n  private async void ThreadListItem_MouseDown(object sender, MouseButtonEventArgs e) {\n    if (e.LeftButton == MouseButtonState.Pressed &&\n        e.ClickCount >= 2) {\n      var threadItem = ((FrameworkElement)sender).DataContext as ThreadListItem;\n      await ApplyThreadFilterAction(threadItem, ThreadActivityAction.FilterToThread);\n    }\n  }\n\n  private async Task ApplyThreadFilterAction(ThreadListItem threadItem, ThreadActivityAction action) {\n    if (Session.FindPanel(ToolPanelKind.Timeline) is TimelinePanel timelinePanel && threadItem != null) {\n      await timelinePanel.ApplyThreadFilterAction(threadItem.ThreadId, action);\n    }\n  }\n\n  private void ThreadContextMenuButton_Click(object sender, RoutedEventArgs e) {\n    Utils.ShowContextMenu(sender as FrameworkElement, this);\n  }\n\n  private async Task OpenFunction(object obj, OpenSectionKind openMode) {\n    if (((FrameworkElement)obj).DataContext is ThreadListItem threadItem &&\n        instancesNode_.CallTreeNode != null) {\n      var filter = new ProfileSampleFilter(threadItem.ThreadId);\n      await Session.OpenProfileFunction(instancesNode_.CallTreeNode, openMode, filter);\n    }\n  }\n\n  private void CopyModuleButton_OnClick(object sender, RoutedEventArgs e) {\n    Clipboard.SetText(instancesNode_.ModuleName);\n  }\n\n  private void CopyFUnctionButton_OnClick(object sender, RoutedEventArgs e) {\n    Clipboard.SetText(instancesNode_.FullFunctionName);\n  }\n\n  private async void PreviewButton_OnClick(object sender, RoutedEventArgs e) {\n    await IRDocumentPopupInstance.ShowPreviewPopup(instancesNode_.CallTreeNode.Function, \"\",\n                                                   ThreadsExpander, Session);\n  }\n\n  private async void OpenButton_OnClick(object sender, RoutedEventArgs e) {\n    await Session.OpenProfileFunction(instancesNode_.CallTreeNode, OpenSectionKind.NewTab);\n  }\n\n  private void MarkModuleButton_OnClick(object sender, RoutedEventArgs e) {\n    Utils.ShowContextMenu(sender as FrameworkElement, this);\n  }\n\n  private void MarkModule(string module, Color color) {\n    var markingSettings = App.Settings.MarkingSettings;\n    markingSettings.UseModuleColors = true;\n    markingSettings.AddModuleColor(module, color);\n    MarkingChanged?.Invoke(this, EventArgs.Empty);\n  }\n\n  private void MarkFunction(string function, Color color) {\n    var markingSettings = App.Settings.MarkingSettings;\n    markingSettings.UseFunctionColors = true;\n    markingSettings.AddFunctionColor(function, color);\n    MarkingChanged?.Invoke(this, EventArgs.Empty);\n  }\n\n  public class BinHistogramItem : HistogramItem {\n    public BinHistogramItem(double rangeStart, double rangeEnd, double area, int count) : base(\n      rangeStart, rangeEnd, area, count) {\n    }\n\n    public BinHistogramItem(double rangeStart, double rangeEnd, double area, int count, OxyColor color) : base(\n      rangeStart, rangeEnd, area, count, color) {\n    }\n\n    public new int Count { get; set; }\n    public TimeSpan AverageWeight { get; set; }\n    public TimeSpan TotalWeight { get; set; }\n    public List<ProfileCallTreeNode> Nodes { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/CallTreeNodePopup.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.Profile.CallTreeNodePopup\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:profile=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  MinWidth=\"300\"\n  MinHeight=\"75\"\n  MaxWidth=\"800\"\n  MaxHeight=\"500\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  AllowsTransparency=\"True\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </controls:DraggablePopup.LayoutTransform>\n\n  <Border\n    x:Name=\"PanelBorder\"\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <DockPanel\n      x:Name=\"ContentHost\"\n      LastChildFill=\"True\">\n      <Grid\n        Panel.ZIndex=\"100\"\n        DockPanel.Dock=\"Top\">\n        <Grid.ColumnDefinitions>\n          <ColumnDefinition Width=\"*\" />\n          <ColumnDefinition Width=\"20\" />\n          <ColumnDefinition Width=\"20\" />\n        </Grid.ColumnDefinitions>\n\n        <Grid\n          x:Name=\"ToolbarPanel\"\n          Grid.Row=\"0\"\n          Grid.Column=\"0\"\n          Grid.ColumnSpan=\"3\"\n          Background=\"{DynamicResource {x:Static SystemColors.GradientInactiveCaptionBrushKey}}\"\n          ContextMenu=\"{StaticResource PopupContextMenu}\">\n          <StackPanel Margin=\"0,0,0,1\">\n            <Grid HorizontalAlignment=\"Stretch\">\n              <Canvas\n                x:Name=\"Canvas\"\n                Height=\"{Binding ElementName=TitleTextBlock, Path=ActualHeight}\"\n                Margin=\"0,0,42,0\"\n                HorizontalAlignment=\"Stretch\"\n                VerticalAlignment=\"Stretch\">\n                <TextBox\n                  x:Name=\"TitleTextBlock\"\n                  Width=\"{Binding ElementName=Canvas, Path=ActualWidth}\"\n                  Background=\"{x:Null}\"\n                  BorderBrush=\"{x:Null}\"\n                  FontWeight=\"Medium\"\n                  IsHitTestVisible=\"False\"\n                  IsReadOnly=\"True\"\n                  MaxLines=\"2\"\n                  Text=\"{Binding TitleText}\"\n                  TextWrapping=\"Wrap\">\n                  <TextBox.ToolTip>\n                    <ToolTip Visibility=\"Visible\">\n                      <TextBlock Text=\"{Binding TitleTooltipText}\" />\n                    </ToolTip>\n                  </TextBox.ToolTip>\n                </TextBox>\n              </Canvas>\n            </Grid>\n            <TextBlock\n              Margin=\"4,0,4,0\"\n              VerticalAlignment=\"Center\"\n              Text=\"{Binding DescriptionText}\"\n              TextTrimming=\"CharacterEllipsis\"\n              Visibility=\"{Binding Path=HasDescriptionText, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </StackPanel>\n        </Grid>\n        <Button\n          x:Name=\"ExpandButton\"\n          Grid.Row=\"0\"\n          Grid.Column=\"1\"\n          VerticalAlignment=\"Top\"\n          Background=\"{x:Null}\"\n          BorderBrush=\"{x:Null}\"\n          Click=\"ExpandButton_OnClick\"\n          Visibility=\"{Binding Path=CanExpand, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource PinIcon}\" />\n        </Button>\n        <Button\n          x:Name=\"CloseButton\"\n          Grid.Row=\"0\"\n          Grid.Column=\"2\"\n          VerticalAlignment=\"Top\"\n          Background=\"{x:Null}\"\n          BorderBrush=\"{x:Null}\"\n          Click=\"CloseButton_Click\"\n          ToolTip=\"Close query panel\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource CloseIcon}\" />\n        </Button>\n      </Grid>\n\n      <Grid DockPanel.Dock=\"Bottom\">\n        <Grid Visibility=\"{Binding Path=ShowSimpleView, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n          <profile:CallTreeNodePanel x:Name=\"PanelHost\" />\n        </Grid>\n        <Grid\n          Margin=\"0,-20,0,0\"\n          Visibility=\"{Binding Path=ShowSimpleView, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <profile:ProfileListView\n            x:Name=\"FunctionListView\"\n            Width=\"{Binding ElementName=ContentHost, Path=ActualWidth}\"\n            Background=\"{x:Null}\"\n            BorderBrush=\"{x:Null}\"\n            ShowCombinedTimeColumn=\"False\"\n            ShowCombinedTimeNameRow=\"True\"\n            ShowContextColumn=\"False\"\n            ShowExclusiveTimeColumn=\"False\"\n            ShowModuleColumn=\"False\"\n            ShowTimeColumn=\"False\" />\n        </Grid>\n\n        <controls:ResizeGrip\n          x:Name=\"PanelResizeGrip\"\n          Width=\"16\"\n          Height=\"16\"\n          HorizontalAlignment=\"Right\"\n          VerticalAlignment=\"Bottom\"\n          Panel.ZIndex=\"100\"\n          Visibility=\"{Binding Path=ShowResizeGrip, Converter={StaticResource BoolToVisibilityConverter}}\" />\n      </Grid>\n    </DockPanel>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/CallTreeNodePopup.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic partial class CallTreeNodePopup : DraggablePopup, INotifyPropertyChanged {\n  internal const double DefaultTextSize = 12;\n  private const int MaxPreviewNameLength = 80;\n  private const double InitialWidth = 450;\n  private const double InitialHeight = 400;\n  private const double MaxPopupWidth = 800;\n  private const double MinPopupWidth = 300;\n  private Typeface defaultTextFont_;\n  private bool showResizeGrip_;\n  private bool canExpand_;\n  private bool showBacktraceView_;\n  private ProfileCallTreeNodeEx nodeEx_;\n  private string title_;\n  private string titleTooltipText_;\n  private string descriptionText_;\n\n  public CallTreeNodePopup(ProfileCallTreeNode node, IFunctionProfileInfoProvider funcInfoProvider,\n                           Point position, UIElement referenceElement,\n                           IUISession session, bool canExpand = true) {\n    InitializeComponent();\n    Initialize(position, referenceElement);\n    PanelResizeGrip.ResizedControl = this;\n\n    //? TODO: Use GetTextTypeface everywhere instead of hardcoding fonts\n    defaultTextFont_ = Utils.GetTextTypeface(TitleTextBlock);\n\n    Session = session;\n    CanExpand = canExpand;\n    PanelHost.ShowInstanceNavigation = false;\n    PanelHost.Settings = App.Settings.CallTreeNodeSettings;\n    PanelHost.Initialize(session, funcInfoProvider);\n    FunctionListView.Session = Session;\n    FunctionListView.Settings = App.Settings.CallTreeNodeSettings;\n    UpdateNode(node);\n    SetupEvents();\n    DataContext = this;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public IUISession Session { get; set; }\n\n  public ProfileCallTreeNodeEx CallTreeNode {\n    get => nodeEx_;\n    set {\n      SetField(ref nodeEx_, value);\n      OnPropertyChanged(nameof(TitleText));\n      OnPropertyChanged(nameof(TitleTooltipText));\n      OnPropertyChanged(nameof(DescriptionText));\n    }\n  }\n\n  public bool ShowResizeGrip {\n    get => showResizeGrip_;\n    set => SetField(ref showResizeGrip_, value);\n  }\n\n  public bool CanExpand {\n    get => canExpand_;\n    set => SetField(ref canExpand_, value);\n  }\n\n  public bool ShowSimpleView {\n    get => showBacktraceView_;\n    set => SetField(ref showBacktraceView_, value);\n  }\n\n  public string TitleText {\n    get => CallTreeNode != null ? CallTreeNode.FunctionName : title_;\n    set => SetField(ref title_, value);\n  }\n\n  public string TitleTooltipText {\n    get => CallTreeNode != null ? CallTreeNode.FullFunctionName : titleTooltipText_;\n    set => SetField(ref titleTooltipText_, value);\n  }\n\n  public string DescriptionText {\n    get => CallTreeNode != null ? CallTreeNode.ModuleName : descriptionText_;\n    set {\n      SetField(ref descriptionText_, value);\n      OnPropertyChanged(nameof(HasDescriptionText));\n    }\n  }\n\n  public bool HasDescriptionText => !string.IsNullOrEmpty(DescriptionText);\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void SetupEvents() {\n    FunctionListView.NodeClick += async (sender, treeNode) => {\n      await Session.ProfileFunctionSelected(treeNode, ToolPanelKind.Other);\n    };\n\n    FunctionListView.NodeDoubleClick += async (sender, treeNode) => {\n      var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n      await Session.OpenProfileFunction(treeNode, mode);\n    };\n\n    PanelHost.MarkingChanged += (sender, args) => UpdateMarkingUI();\n    FunctionListView.MarkingChanged += (sender, args) => UpdateMarkingUI();\n  }\n\n  private void UpdateMarkingUI() {\n    Session.FunctionMarkingChanged(ToolPanelKind.Other);\n  }\n\n  protected override void SetPanelAccentColor(Color color) {\n    ToolbarPanel.Background = ColorBrushes.GetBrush(color);\n    PanelBorder.BorderBrush = ColorBrushes.GetBrush(color);\n  }\n\n  public void ShowBackTrace(ProfileCallTreeNode node, int maxLevel,\n                            FunctionNameFormatter nameFormatter) {\n    UpdateNode(node); // Set title.\n    var list = new List<ProfileCallTreeNode>();\n\n    while (node != null && maxLevel-- > 0) {\n      list.Add(node);\n      node = node.Caller;\n    }\n\n    ShowSimpleView = true;\n    UpdatePopupWidth(MeasureMaxTextWidth(list, nameFormatter));\n    FunctionListView.ShowSimpleList(list);\n  }\n\n  public void ShowFunctions(List<ProfileCallTreeNode> list,\n                            FunctionNameFormatter nameFormatter) {\n    ShowSimpleView = true;\n    UpdatePopupWidth(MeasureMaxTextWidth(list, nameFormatter));\n    FunctionListView.ShowSimpleList(list);\n  }\n\n  public void UpdateNode(ProfileCallTreeNode node) {\n    CallTreeNode = CallTreeNodePanel.SetupNodeExtension(node, Session);\n\n    if (!ShowSimpleView) {\n      PanelHost.Show(CallTreeNode);\n    }\n  }\n\n  public override bool ShouldStartDragging(MouseButtonEventArgs e) {\n    base.ShouldStartDragging(e);\n\n    if (e.LeftButton == MouseButtonState.Pressed && ToolbarPanel.IsMouseOver) {\n      if (!IsDetached) {\n        DetachPopup();\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  public override async void DetachPopup() {\n    base.DetachPopup();\n    await ExpandDetailsPanel();\n  }\n\n  protected override void OnClosed(EventArgs e) {\n    base.OnClosed(e);\n    PanelHost.SaveListColumnSettings();\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private double MeasureMaxTextWidth(List<ProfileCallTreeNode> list,\n                                     FunctionNameFormatter nameFormatter) {\n    double maxTextWidth = 0;\n\n    foreach (var node in list) {\n      string funcName = node.FormatFunctionName(nameFormatter, MaxPreviewNameLength);\n      var textSize = Utils.MeasureString(funcName, defaultTextFont_, DefaultTextSize);\n      maxTextWidth = Math.Max(maxTextWidth, textSize.Width);\n    }\n\n    return maxTextWidth;\n  }\n\n  private void UpdatePopupWidth(double maxTextWidth) {\n    double margin = SystemParameters.VerticalScrollBarWidth;\n    Width = Math.Max(MinPopupWidth, Math.Min(maxTextWidth, MaxPopupWidth));\n\n    // Leave some space for the vertical scroll bar\n    // to avoid having a horizontal one by default.\n    FunctionListView.FunctionColumnWidth = Math.Max(MinPopupWidth - 2 * margin, Width - 2 * margin);\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    Session.UnregisterDetachedPanel(this);\n    ClosePopup();\n  }\n\n  private void ExpandButton_OnClick(object sender, RoutedEventArgs e) {\n    DetachPopup();\n  }\n\n  private async Task ExpandDetailsPanel() {\n    if (!ShowSimpleView) {\n      await PanelHost.ShowDetailsAsync();\n    }\n\n    MinWidth = InitialWidth;\n    Width = Math.Max(Width, InitialWidth);\n    Height = Math.Max(Height, InitialHeight);\n    ShowResizeGrip = true;\n    CanExpand = false;\n  }\n\n  public void UpdateMarkedFunctions() {\n    FunctionListView.UpdateMarkedFunctions();\n    PanelHost.UpdateMarkedFunctions();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/CallTreePanel.xaml",
    "content": "﻿<ProfileExplorerUi:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.Profile.CallTreePanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:tree=\"clr-namespace:Aga.Controls.Tree;assembly=TreeListView\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <ProfileExplorerUi:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"local:CallTreeCommand.ExpandHottestCallPath\"\n      Executed=\"ExpandHottestCallPathExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.ExpandCallPath\"\n      Executed=\"ExpandCallPathExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.CollapseCallPath\"\n      Executed=\"CollapseCallPathExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.SelectFunction\"\n      Executed=\"SelectFunctionExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.OpenFunction\"\n      Executed=\"OpenFunctionExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.OpenFunctionInNewTab\"\n      Executed=\"OpenFunctionInNewTab\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.FocusSearch\"\n      Executed=\"FocusSearchExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.ClearSearch\"\n      Executed=\"ClearSearchExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.PreviousSearchResult\"\n      Executed=\"PreviousSearchResultExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.NextSearchResult\"\n      Executed=\"NextSearchResultExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.GoBack\"\n      Executed=\"GoBackExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.CollapseNodes\"\n      Executed=\"CollapseNodesExecuted\" />\n  </ProfileExplorerUi:ToolPanelControl.CommandBindings>\n\n  <Grid IsEnabled=\"{Binding HasCallTree}\">\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"45\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Grid.Column=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n\n          <Button\n            Margin=\"4,0,0,0\"\n            Command=\"local:CallTreeCommand.GoBack\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            IsEnabled=\"{Binding HasPreviousState}\"\n            ToolTip=\"Go back to the previous function (Backspace/Mouse Back button)\"\n            Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource DockLeftIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Back\" />\n            </StackPanel>\n          </Button>\n          <Separator Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource BoolToVisibilityConverter}}\"/>\n          <Button\n            Command=\"local:CallTreeCommand.CollapseNodes\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            ToolTip=\"Reset call tree to initial state (Ctrl+R/Ctrl+0)\"\n            Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource ResetWidthIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Reset\" />\n            </StackPanel>\n          </Button>\n          <Separator Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n          <Button\n            Command=\"local:CallTreeCommand.ExpandHottestCallPath\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            ToolTip=\"Expand hottest call path (Ctrl+H)\"\n            Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <Image\n              Source=\"{StaticResource HotFlameIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Separator\n            Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.SyncSelection, Mode=TwoWay}\"\n            ToolTip=\"Sync function displayed in other profiling views with selection\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource SwitchIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"2,0,0,0\"\n                Text=\"Sync\" />\n            </StackPanel>\n          </ToggleButton>\n\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.SyncSourceFile, Mode=TwoWay}\"\n            ToolTip=\"Sync Source File view with selection\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SourceIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"2,0,0,0\"\n                Text=\"Source\" />\n            </StackPanel>\n          </ToggleButton>\n          <Separator />\n\n          <ToggleButton\n            Click=\"ToggleButton_Click\"\n            IsChecked=\"{Binding Settings.CombineInstances, Mode=TwoWay}\"\n            ToolTip=\"Combine all function instances into one\"\n            Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"15\"\n                Height=\"15\"\n                Margin=\"0,0,2,0\"\n                Source=\"{StaticResource CombineIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"2,0,0,0\"\n                Text=\"Combine\" />\n            </StackPanel>\n          </ToggleButton>\n\n          <ToggleButton\n            Click=\"ToggleButton_Click\"\n            Content=\"m!F\"\n            Padding=\"0,0,0,1\"\n            IsChecked=\"{Binding Path=Settings.PrependModuleToFunction, Mode=TwoWay}\"\n            ToolTip=\"Show the module name in front of the function name\" />\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.ShowDetailsPanel, Mode=TwoWay}\"\n            IsEnabled=\"False\"\n            ToolTip=\"Show the Function Details panel on the right-hand side\"\n            Visibility=\"Collapsed\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"18\"\n                Height=\"18\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource SidebarIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                VerticalAlignment=\"Center\"\n                Text=\"Details\" />\n            </StackPanel>\n          </ToggleButton>\n          <Separator />\n\n          <Image\n            Margin=\"2,0,0,0\"\n            Source=\"{StaticResource SearchIcon}\"\n            Style=\"{StaticResource DisabledImageStyle}\" />\n          <Grid Height=\"24\">\n            <TextBox\n              x:Name=\"FunctionFilter\"\n              Width=\"200\"\n              Margin=\"4,0,0,0\"\n              HorizontalAlignment=\"Center\"\n              VerticalContentAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              TextChanged=\"FunctionFilter_TextChanged\"\n              ToolTip=\"Filter function list based based on a substring (Ctrl+F).&#x0a;Wildcards * in the name are supported, e.g. prefix*foo*\">\n              <TextBox.InputBindings>\n                <KeyBinding\n                  Key=\"Escape\"\n                  Command=\"local:CallTreeCommand.ClearSearch\"\n                  CommandParameter=\"{Binding ElementName=FunctionFilter}\"\n                  CommandTarget=\"{Binding ElementName=CallTreeList}\" />\n              </TextBox.InputBindings>\n            </TextBox>\n            <TextBlock\n              Margin=\"8,4\"\n              Foreground=\"DimGray\"\n              IsHitTestVisible=\"False\"\n              Text=\"Search functions\"\n              Visibility=\"{Binding ElementName=FunctionFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Grid>\n\n          <Button\n            Command=\"local:CallTreeCommand.ClearSearch\"\n            CommandParameter=\"{Binding ElementName=FunctionFilter}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            ToolTip=\"Reset searched function\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ClearIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Button\n            Command=\"local:CallTreeCommand.PreviousSearchResult\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            ToolTip=\"Previous search result\">\n            <Image\n              Source=\"{StaticResource UpArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"\n              Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Button>\n          <Button\n            Command=\"local:CallTreeCommand.NextSearchResult\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            ToolTip=\"Next search result\">\n            <Image\n              Source=\"{StaticResource DownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"\n              Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Button>\n\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding Path=SearchResultText, UpdateSourceTrigger=PropertyChanged}\"\n            Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n        </ToolBar>\n      </ToolBarTray>\n\n      <ProfileExplorerUi:PanelToolbarTray\n        Grid.Column=\"1\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"True\"\n        HasPinButton=\"False\"\n        HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n        SettingsClicked=\"PanelToolbarTray_OnSettingsClicked\" />\n    </Grid>\n\n    <tree:TreeList\n      x:Name=\"CallTreeList\"\n      Grid.Row=\"1\"\n      Panel.ZIndex=\"2\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      BorderBrush=\"{x:Null}\"\n      BorderThickness=\"0,0,0,0\"\n      IsTextSearchEnabled=\"False\"\n      SelectionChanged=\"CallTree_SelectionChanged\"\n      SelectionMode=\"Single\">\n      <tree:TreeList.View>\n        <GridView>\n          <GridViewColumn Width=\"300\">\n            <GridViewColumnHeader\n              x:Name=\"ChildColumnHeader\"\n              Content=\"Function\" />\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <StackPanel\n                  Height=\"20\"\n                  Margin=\"0,0,0,0\"\n                  HorizontalAlignment=\"Stretch\"\n                  Orientation=\"Horizontal\">\n                  <tree:RowExpander Padding=\"0\" />\n                  <Border\n                    Margin=\"0,2,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"{Binding FunctionBackColor}\">\n                    <ContentPresenter Content=\"{Binding Name}\" />\n                  </Border>\n                </StackPanel>\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn Width=\"150\">\n            <GridViewColumnHeader\n              x:Name=\"ChildTimeColumnHeader\"\n              Content=\"Time (total)\" />\n\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <Border\n                  HorizontalAlignment=\"Stretch\"\n                  Background=\"{Binding BackColor}\">\n                  <ContentControl\n                    HorizontalAlignment=\"Stretch\"\n                    Content=\"{Binding}\"\n                    ContentTemplate=\"{StaticResource ProfilePercentageTemplate}\"\n                    Visibility=\"{Binding HasCallTreeNode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                </Border>\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn Width=\"150\">\n            <GridViewColumnHeader\n              x:Name=\"ExclusiveChildTimeColumnHeader\"\n              Content=\"Time (self)\" />\n\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <Border\n                  HorizontalAlignment=\"Stretch\"\n                  Background=\"{Binding BackColor2}\">\n                  <ContentControl\n                    HorizontalAlignment=\"Stretch\"\n                    Content=\"{Binding}\"\n                    ContentTemplate=\"{StaticResource ProfileExclusivePercentageTemplate}\"\n                    Visibility=\"{Binding HasCallTreeNode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                </Border>\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn Width=\"120\">\n            <GridViewColumnHeader\n              x:Name=\"ChildAlternateNameColumnHeader\"\n              Content=\"Module\" />\n\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <Border\n                  HorizontalAlignment=\"Stretch\"\n                  Background=\"{Binding ModuleBackColor}\">\n                  <TextBlock\n                    Margin=\"6,2,6,2\"\n                    Text=\"{Binding ModuleName}\" />\n                </Border>\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n        </GridView>\n      </tree:TreeList.View>\n\n      <ListView.ItemContainerStyle>\n        <Style\n          BasedOn=\"{StaticResource TreeListViewItem}\"\n          TargetType=\"{x:Type ListViewItem}\">\n          <EventSetter\n            Event=\"MouseDoubleClick\"\n            Handler=\"ChildDoubleClick\" />\n          <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n          <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n        </Style>\n      </ListView.ItemContainerStyle>\n\n      <tree:TreeList.InputBindings>\n        <KeyBinding\n          Key=\"C\"\n          Command=\"{Binding CopyFunctionNameCommand}\"\n          Modifiers=\"Control+Shift\" />\n        <KeyBinding\n          Key=\"C\"\n          Command=\"{Binding CopyDemangledFunctionNameCommand}\"\n          Modifiers=\"Control\" />\n        <KeyBinding\n          Key=\"C\"\n          Command=\"{Binding CopyFunctionDetailsCommand}\"\n          Modifiers=\"Control+Alt\" />\n      </tree:TreeList.InputBindings>\n\n      <ListView.ContextMenu>\n        <ContextMenu>\n          <MenuItem\n            Command=\"{Binding PreviewFunctionCommand}\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Preview Function\"\n            InputGestureText=\"Alt+Enter\"\n            ToolTip=\"Show a preview popup of the function assembly or source code\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PeekDefinitionIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:CallTreeCommand.OpenFunction\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Open Function\"\n            InputGestureText=\"Return/Double-Click\"\n            ToolTip=\"Open the function assembly view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource LayoutOpenIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:CallTreeCommand.OpenFunctionInNewTab\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Open Function in New Tab\"\n            InputGestureText=\"Ctrl+Return\"\n            ToolTip=\"Open the function assembly view in a new tab\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource LayoutOpenNewIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem Header=\"Instance\">\n            <MenuItem\n              Command=\"{Binding PreviewFunctionInstanceCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Preview Function Instance\"\n              InputGestureText=\"Alt+Shift+Return\"\n              ToolTip=\"Show a preview popup of the function assembly or source code\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource PeekDefinitionIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"{Binding OpenInstanceCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Open Function Instance\"\n              InputGestureText=\"Shift+Return\"\n              ToolTip=\"Open the function assembly view for only this instance of the function\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource LayoutOpenIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"{Binding OpenInstanceInNewTabCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Open Function Instance in New Tab\"\n              InputGestureText=\"Ctrl+Shift+Return\"\n              ToolTip=\"Open the function assembly view for only this instance of the function in a new tab\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource LayoutOpenNewIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n          </MenuItem>\n          <Separator />\n\n          <MenuItem\n            Command=\"local:CallTreeCommand.ExpandCallPath\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Expand Hottest Call Path\"\n            InputGestureText=\"Ctrl+=\"\n            ToolTip=\"Expand several levels following the hottest path starting with the selected function\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PlusIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:CallTreeCommand.CollapseCallPath\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Collapse Call Path\"\n            InputGestureText=\"Ctrl+-\"\n            ToolTip=\"Collapse the expanded node starting under the selected function\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource MinusIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <Separator />\n          <MenuItem\n            Command=\"{Binding CopyFunctionDetailsCommand}\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Copy Function Details\"\n            InputGestureText=\"Ctrl+C\"\n            ToolTip=\"Copy the function name and additional information as an HTML table\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource ClipboardIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding CopyDemangledFunctionNameCommand}\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Copy Function Name\"\n            InputGestureText=\"Ctrl+Shift+C\"\n            ToolTip=\"Copy the function name to the clipboard\" />\n\n          <MenuItem\n            Command=\"{Binding CopyFunctionNameCommand}\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Copy Mangled Function Name\"\n            InputGestureText=\"Ctrl+Alt+C\"\n            ToolTip=\"Copy the mangled function name to the clipboard (C++)\" />\n          <Separator />\n          <MenuItem\n            Header=\"Mark Module\"\n            ToolTip=\"Mark all functions belonging to this module (saved)\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource AddBookmarkIcon}\" />\n            </MenuItem.Icon>\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkModuleCommand}\" />\n              </MenuItem.Header>\n\n            </MenuItem>\n          </MenuItem>\n          <MenuItem\n            Header=\"Mark Function\"\n            ToolTip=\"Mark all functions with the same name (saved)\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource BookmarkIcon}\" />\n            </MenuItem.Icon>\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkFunctionCommand}\" />\n              </MenuItem.Header>\n\n            </MenuItem>\n          </MenuItem>\n          <Separator />\n\n          <MenuItem\n            Command=\"local:CallTreeCommand.SelectFunction\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Select in Summary\"\n            ToolTip=\"Select the function in the Summary view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SummaryIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding SelectFunctionCallTreeCommand}\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Select in Call Tree\"\n            ToolTip=\"Select the function instance in the Call Tree view\"\n            Visibility=\"{Binding IsCallerCalleePanel, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource FlowChartIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n\n          <MenuItem\n            Command=\"{Binding SelectFunctionFlameGraphCommand}\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Select in Flame Graph\"\n            ToolTip=\"Select the function instance in the Flame Graph view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource FlameGraphIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n\n          <MenuItem\n            Command=\"{Binding SelectFunctionTimelineCommand}\"\n            CommandParameter=\"{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItem}\"\n            CommandTarget=\"{Binding ElementName=CallTreeList}\"\n            Header=\"Select in Timeline\"\n            ToolTip=\"Select the function instance in the Timeline view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource TimelineIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n        </ContextMenu>\n      </ListView.ContextMenu>\n    </tree:TreeList>\n  </Grid>\n\n  <ProfileExplorerUi:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"H\"\n      Command=\"local:CallTreeCommand.ExpandHottestCallPath\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"OemPlus\"\n      Command=\"local:CallTreeCommand.ExpandCallPath\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"OemMinus\"\n      Command=\"local:CallTreeCommand.CollapseCallPath\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:CallTreeCommand.SelectFunction\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:CallTreeCommand.OpenFunction\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"local:CallTreeCommand.OpenFunctionInNewTab\"\n      Modifiers=\"Ctrl+Shift\" />\n    <KeyBinding\n      Key=\"F\"\n      Command=\"local:CallTreeCommand.FocusSearch\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Back\"\n      Command=\"local:CallTreeCommand.GoBack\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:CallTreeCommand.PreviousSearchResult\"\n      Modifiers=\"Shift\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:CallTreeCommand.NextSearchResult\" />\n    <KeyBinding\n      Key=\"R\"\n      Command=\"local:CallTreeCommand.CollapseNodes\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"D0\"\n      Command=\"local:CallTreeCommand.CollapseNodes\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding PreviewFunctionCommand}\"\n      Modifiers=\"Alt\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding PreviewFunctionInstanceCommand}\"\n      Modifiers=\"Alt+Shift\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyFunctionNameCommand}\"\n      Modifiers=\"Control+Alt\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyDemangledFunctionNameCommand}\"\n      Modifiers=\"Control+Shift\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyFunctionDetailsCommand}\"\n      Modifiers=\"Control\" />\n  </ProfileExplorerUi:ToolPanelControl.InputBindings>\n</ProfileExplorerUi:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/CallTreePanel.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing Aga.Controls.Tree;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic enum CallTreeListItemKind {\n  Root,\n  ChildrenPlaceholder,\n  CallerNode,\n  CalleeNode,\n  CallTreeNode,\n  Header\n}\n\n//? TODO: Replace all with RelayCommand pattern.\npublic static class CallTreeCommand {\n  public static readonly RoutedCommand ExpandHottestCallPath = new(\"ExpandHottestCallPath\", typeof(FrameworkElement));\n  public static readonly RoutedCommand ExpandCallPath = new(\"ExpandCallPath\", typeof(FrameworkElement));\n  public static readonly RoutedCommand CollapseCallPath = new(\"CollapseCallPath\", typeof(FrameworkElement));\n  public static readonly RoutedCommand SelectFunction = new(\"SelectFunction\", typeof(FrameworkElement));\n  public static readonly RoutedCommand OpenFunction = new(\"OpenFunction\", typeof(FrameworkElement));\n  public static readonly RoutedCommand OpenFunctionInNewTab = new(\"OpenFunctionInNewTab\", typeof(FrameworkElement));\n  public static readonly RoutedCommand FocusSearch = new(\"FocusSearch\", typeof(FrameworkElement));\n  public static readonly RoutedCommand ClearSearch = new(\"ClearSearch\", typeof(FrameworkElement));\n  public static readonly RoutedCommand PreviousSearchResult = new(\"PreviousSearchResult\", typeof(FrameworkElement));\n  public static readonly RoutedCommand NextSearchResult = new(\"NextSearchResult\", typeof(FrameworkElement));\n  public static readonly RoutedCommand GoBack = new(\"GoBack\", typeof(FrameworkElement));\n  public static readonly RoutedCommand CollapseNodes = new(\"CollapseNodes\", typeof(FrameworkElement));\n\n  // FlameGraph specific commands.\n  public static readonly RoutedCommand EnlargeNode = new(\"EnlargeNode\", typeof(FrameworkElement));\n  public static readonly RoutedCommand ChangeRootNode = new(\"ChangeRootNode\", typeof(FrameworkElement));\n  public static readonly RoutedCommand MarkAllInstances = new(\"MarkAllInstances\", typeof(FrameworkElement));\n  public static readonly RoutedCommand MarkInstance = new(\"MarkInstance\", typeof(FrameworkElement));\n  public static readonly RoutedCommand ClearMarkedNodes = new(\"ClearMarkedNodes\", typeof(FrameworkElement));\n\n  // Timeline specific commands.\n  public static readonly RoutedCommand RemoveFilters = new(\"RemoveFilters\", typeof(FrameworkElement));\n  public static readonly RoutedCommand RemoveThreadFilters = new(\"RemoveThreadFilters\", typeof(FrameworkElement));\n  public static readonly RoutedCommand RemoveAllFilters = new(\"RemoveAllFilters\", typeof(FrameworkElement));\n}\n\npublic class CallTreeListItem : SearchableProfileItem, ITreeModel {\n  private string cacheFunctionName_;\n  private Brush functionBackColor_;\n  private Brush moduleBackColor_;\n\n  public CallTreeListItem(CallTreeListItemKind kind, CallTreePanel owner,\n                          FunctionNameFormatter funcNameFormatter = null) :\n    base(funcNameFormatter) {\n    Children = new List<CallTreeListItem>();\n    Kind = kind;\n    Owner = owner;\n  }\n\n  public CallTreePanel Owner { get; set; }\n  public IRTextFunction Function { get; set; }\n  public ProfileCallTreeNode CallTreeNode { get; set; }\n  public Brush TextColor { get; set; }\n  public Brush BackColor { get; set; }\n  public Brush BackColor2 { get; set; }\n\n  public Brush FunctionBackColor {\n    get => functionBackColor_;\n    set => SetAndNotify(ref functionBackColor_, value);\n  }\n\n  public Brush ModuleBackColor {\n    get => moduleBackColor_;\n    set => SetAndNotify(ref moduleBackColor_, value);\n  }\n\n  public CallTreeListItem Parent { get; set; }\n  public List<CallTreeListItem> Children { get; set; }\n  public long Time { get; set; }\n  public CallTreeListItemKind Kind { get; set; }\n  public bool HasCallTreeNode => CallTreeNode?.Function != null;\n  public override TimeSpan Weight => HasCallTreeNode ? CallTreeNode.Weight : TimeSpan.Zero;\n  public override TimeSpan ExclusiveWeight => HasCallTreeNode ? CallTreeNode.ExclusiveWeight : TimeSpan.Zero;\n  public override string ModuleName =>\n    CallTreeNode is {HasFunction: true} ? CallTreeNode.ModuleName : null;\n  public bool HasAnyChildren => Children is {Count: > 0};\n\n  public override string FunctionName {\n    get {\n      string name = base.FunctionName;\n\n      if (Kind != CallTreeListItemKind.Header) {\n        if (cacheFunctionName_ == null) {\n          cacheFunctionName_ = $\"{name} ({Percentage.AsPercentageString()})\";\n        }\n\n        return cacheFunctionName_;\n      }\n\n      return name;\n    }\n    set => base.FunctionName = value;\n  }\n\n  public TreeNode TreeNode { get; set; } // Associated UI tree node.\n\n  public IEnumerable GetChildren(object node) {\n    if (node == null) {\n      return Children;\n    }\n\n    var parentNode = (CallTreeListItem)node;\n    return parentNode.Children;\n  }\n\n  public bool HasChildren(object node) {\n    if (node == null)\n      return false;\n    var parentNode = (CallTreeListItem)node;\n    return parentNode.Children != null && parentNode.Children.Count > 0;\n  }\n\n  public void AddChild(CallTreeListItem child) {\n    Children ??= new List<CallTreeListItem>();\n    Children.Add(child);\n  }\n\n  public void ClearChildren() {\n    Children = null;\n  }\n\n  protected override string GetFunctionName() {\n    return CallTreeNode is {HasFunction: true} ? CallTreeNode.FunctionName : null;\n  }\n\n  protected override bool ShouldPrependModule() {\n    return Kind != CallTreeListItemKind.Header &&\n           Owner.Settings.PrependModuleToFunction;\n  }\n}\n\npublic partial class CallTreePanel : ToolPanelControl, IFunctionProfileInfoProvider, INotifyPropertyChanged {\n  public static readonly DependencyProperty ShowToolbarProperty =\n    DependencyProperty.Register(\"ShowToolbar\", typeof(bool), typeof(CallTreePanel));\n  private IRTextFunction function_;\n  private PopupHoverPreview nodeHoverPreview_;\n  private ProfileCallTree callTree_;\n  private CallTreeListItem callTreeEx_;\n  private List<CallTreeListItem> searchResultNodes_;\n  private int searchResultIndex_;\n  private CallTreeSettings settings_;\n  private CancelableTaskInstance searchTask_;\n  private Stack<IRTextFunction> stateStack_;\n  private Dictionary<ProfileCallTreeNode, CallTreeListItem> callTreeNodeToNodeExMap_;\n  private bool ignoreNextSelectionEvent_;\n  private bool showSearchSection_;\n  private string searchResultText_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private CancelableTaskInstance loadTask_;\n  private double profileDurationReciprocal_;\n\n  public CallTreePanel() {\n    InitializeComponent();\n    Settings = PanelKind == ToolPanelKind.CallTree ?\n      App.Settings.CallTreeSettings :\n      App.Settings.CallerCalleeSettings;\n    searchTask_ = new CancelableTaskInstance(false);\n    callTreeNodeToNodeExMap_ = new Dictionary<ProfileCallTreeNode, CallTreeListItem>();\n    stateStack_ = new Stack<IRTextFunction>();\n    loadTask_ = new CancelableTaskInstance(false);\n    DataContext = this;\n    SetupEvents();\n  }\n\n  public CallTreeSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      settings_.TreeListColumns.RestoreColumnsState(CallTreeList);\n      SetupPreviewPopup();\n      OnPropertyChanged();\n    }\n  }\n\n  public FunctionMarkingSettings MarkingSettings => App.Settings.MarkingSettings;\n\n  //? TODO: Replace all other commands with RelayCommand.\n  public RelayCommand<object> SelectFunctionCallTreeCommand => new(async obj => {\n    await SelectFunctionInPanel(obj, ToolPanelKind.CallTree);\n  });\n  public RelayCommand<object> SelectFunctionFlameGraphCommand => new(async obj => {\n    await SelectFunctionInPanel(obj, ToolPanelKind.FlameGraph);\n  });\n  public RelayCommand<object> SelectFunctionTimelineCommand => new(async obj => {\n    await SelectFunctionInPanel(obj, ToolPanelKind.Timeline);\n  });\n  public RelayCommand<object> SelectFunctionSourceCommand => new(async obj => {\n    await SelectFunctionInPanel(obj, ToolPanelKind.Source);\n  });\n  public RelayCommand<object> CopyFunctionNameCommand => new(async obj => {\n    if (CallTreeList.SelectedItem is TreeNode node &&\n        node.Tag is CallTreeListItem {HasCallTreeNode: true} item) {\n      string text = Session.CompilerInfo.NameProvider.GetFunctionName(item.Function);\n      Clipboard.SetText(text);\n    }\n  });\n  public RelayCommand<object> CopyDemangledFunctionNameCommand => new(async obj => {\n    if (CallTreeList.SelectedItem is TreeNode node && node.Tag is CallTreeListItem item) {\n      var options = FunctionNameDemanglingOptions.Default;\n      string text = Session.CompilerInfo.NameProvider.DemangleFunctionName(item.Function, options);\n      Clipboard.SetText(text);\n    }\n  });\n  public RelayCommand<object> CopyFunctionDetailsCommand => new(async obj => {\n    if (CallTreeList.SelectedItems.Count > 0) {\n      var funcList = new List<SearchableProfileItem>();\n\n      foreach (TreeNode node in CallTreeList.SelectedItems) {\n        if (node.Tag is CallTreeListItem {HasCallTreeNode: true} item) {\n          funcList.Add(item);\n        }\n      }\n\n      SearchableProfileItem.CopyFunctionListAsHtml(funcList);\n    }\n  });\n  public RelayCommand<object> PreviewFunctionCommand => new(async obj => {\n    if (CallTreeList.SelectedItem is TreeNode node &&\n        node.Tag is CallTreeListItem {HasCallTreeNode: true} item) {\n      var brush = GetMarkedNodeColor(item);\n      await IRDocumentPopupInstance.ShowPreviewPopup(item.Function, \"\",\n                                                     CallTreeList, Session, null, false, brush);\n    }\n  });\n  public RelayCommand<object> PreviewFunctionInstanceCommand => new(async obj => {\n    if (CallTreeList.SelectedItem is TreeNode node &&\n        node.Tag is CallTreeListItem {HasCallTreeNode: true} item) {\n      var filter = new ProfileSampleFilter(item.CallTreeNode);\n      var brush = GetMarkedNodeColor(item);\n      await IRDocumentPopupInstance.ShowPreviewPopup(item.Function, \"\",\n                                                     CallTreeList, Session, filter, false, brush);\n    }\n  });\n  public RelayCommand<object> OpenInstanceCommand => new(async obj => {\n    if (CallTreeList.SelectedItem is TreeNode node) {\n      if (node.Tag is CallTreeListItem {HasCallTreeNode: true} item) {\n        var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n        await OpenFunctionInstance(item, mode);\n      }\n    }\n  });\n  public RelayCommand<object> OpenInstanceInNewTabCommand => new(async obj => {\n    if (CallTreeList.SelectedItem is TreeNode node) {\n      if (node.Tag is CallTreeListItem {HasCallTreeNode: true} item) {\n        await OpenFunctionInstance(item, OpenSectionKind.NewTab);\n      }\n    }\n  });\n\n  public ProfileCallTree CallTree {\n    get => callTree_;\n    set {\n      SetField(ref callTree_, value);\n\n      if (Session?.ProfileData == null) {\n        return;\n      }\n\n      profileDurationReciprocal_ = 1.0 / Session.ProfileData.ProfileWeight.Ticks;\n      OnPropertyChanged(nameof(HasCallTree));\n    }\n  }\n\n  public bool IsCallerCalleePanel => PanelKind == ToolPanelKind.CallerCallee;\n  public bool HasCallTree => callTree_ != null;\n\n  public bool ShowSearchSection {\n    get => showSearchSection_;\n    set {\n      if (showSearchSection_ != value) {\n        showSearchSection_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public string SearchResultText {\n    get => searchResultText_;\n    set {\n      if (searchResultText_ != value) {\n        searchResultText_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool HasPreviousState => stateStack_.Count > 0;\n  public RelayCommand<object> MarkModuleCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n    MarkSelectedNodes(obj, (node, color) => {\n      if (node.HasCallTreeNode) {\n        markingSettings.AddModuleColor(node.ModuleName, color);\n      }\n    });\n\n    markingSettings.UseModuleColors = true;\n    await UpdateMarkedFunctions();\n  });\n  public RelayCommand<object> MarkFunctionCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n    MarkSelectedNodes(obj, (node, color) => {\n      if (node.HasCallTreeNode) {\n        markingSettings.AddFunctionColor(node.FunctionName, color);\n      }\n    });\n\n    markingSettings.UseFunctionColors = true;\n    await UpdateMarkedFunctions();\n  });\n\n  public List<ProfileCallTreeNode> GetBacktrace(ProfileCallTreeNode node) {\n    return callTree_.GetBacktrace(node);\n  }\n\n  public (List<ProfileCallTreeNode>, List<ModuleProfileInfo> Modules) GetTopFunctionsAndModules(\n    ProfileCallTreeNode node) {\n    return callTree_.GetTopFunctionsAndModules(node);\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private Brush GetMarkedNodeColor(CallTreeListItem node) {\n    return App.Settings.MarkingSettings.\n      GetMarkedNodeBrush(node.FunctionName, node.ModuleName);\n  }\n\n  private async Task UpdateCallTree() {\n    callTreeEx_ = null;\n\n    if (IsCallerCalleePanel) {\n      await DisplayProfileCallerCalleeTree(function_);\n    }\n    else {\n      await DisplayProfileCallTree();\n    }\n  }\n\n  private static void SortCallTreeNodes(CallTreeListItem node) {\n    // Sort children in descending order,\n    // since that is not yet supported by the TreeListView control.\n    if (!node.HasAnyChildren) {\n      return;\n    }\n\n    node.Children.Sort((a, b) => {\n      int result = b.Time.CompareTo(a.Time);\n      return result != 0 ? result : string.Compare(a.FunctionName, b.FunctionName, StringComparison.Ordinal);\n    });\n  }\n\n  private static void ExpandPathToNode(CallTreeListItem nodeEx, bool markPathNodes) {\n    // Expansion must be done starting from the root node,\n    // because the TreeNode is created on-demand by the control\n    // when a node is expanded, so walk parents recursively.\n    if (nodeEx.Parent != null) {\n      ExpandPathToNode(nodeEx.Parent, markPathNodes);\n    }\n\n    if (nodeEx.TreeNode != null) {\n      nodeEx.TreeNode.IsExpanded = true;\n      nodeEx.IsMarked = markPathNodes;\n    }\n  }\n\n  public async Task DisplayProfileCallTree() {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (callTreeEx_ != null) {\n      Reset();\n    }\n\n    CallTree = Session.ProfileData.CallTree;\n    callTreeEx_ = await Task.Run(() => CreateProfileCallTree());\n    CallTreeList.Model = callTreeEx_;\n    await UpdateMarkedFunctionsNoLock(true);\n\n    if (settings_.ExpandHottestPath) {\n      ExpandHottestFunctionPath();\n    }\n  }\n\n  public async Task DisplayProfileCallerCalleeTree(IRTextFunction function) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    function_ = function;\n    ignoreNextSelectionEvent_ = true; // Prevent deselection even to be triggered.\n\n    CallTree = Session.ProfileData.CallTree;\n    callTreeEx_ = await Task.Run(() => CreateProfileCallerCalleeTree(function));\n    CallTreeList.Model = callTreeEx_;\n    await UpdateMarkedFunctionsNoLock(true);\n    ExpandCallTreeTop();\n    ignoreNextSelectionEvent_ = false;\n  }\n\n  public void Reset() {\n    CallTreeList.Model = null;\n    function_ = null;\n    CallTree = null;\n    callTreeEx_ = null;\n    callTreeNodeToNodeExMap_.Clear();\n    stateStack_.Clear();\n    OnPropertyChanged(nameof(HasPreviousState));\n  }\n\n  public void SelectFunction(IRTextFunction function) {\n    var nodeList = callTree_.GetSortedCallTreeNodes(function);\n\n    if (nodeList != null && nodeList.Count > 0) {\n      SelectFunction(nodeList[0], false);\n    }\n  }\n\n  public void SelectFunction(ProfileCallTreeNode node, bool markPath = true) {\n    if (node is ProfileCallTreeGroupNode nodeGroup) {\n      foreach (var groupNode in nodeGroup.Nodes) {\n        SelectFunction(groupNode, markPath);\n        return; //? TODO: Should it select everything instead?\n      }\n    }\n\n    if (!callTreeNodeToNodeExMap_.TryGetValue(node, out var nodeEx)) {\n      return;\n    }\n\n    ExpandPathToNode(nodeEx, markPath);\n    BringIntoView(nodeEx);\n\n    if (CallTreeList.SelectedItem != nodeEx.TreeNode) {\n      ignoreNextSelectionEvent_ = true;\n      CallTreeList.SelectedItem = nodeEx.TreeNode;\n    }\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private async Task SelectFunctionInPanel(object target, ToolPanelKind panelKind) {\n    if (target is TreeNode node) {\n      var item = node.Tag as CallTreeListItem;\n\n      if (item?.CallTreeNode != null) {\n        await Session.SelectProfileFunctionInPanel(item.CallTreeNode, panelKind);\n      }\n    }\n  }\n\n  private void SetupEvents() {\n    CallTreeList.NodeExpanded += CallTreeOnNodeExpanded;\n    PreviewMouseDown += OnPreviewMouseDown;\n    SetupPreviewPopup();\n  }\n\n  private async void OnPreviewMouseDown(object sender, MouseButtonEventArgs e) {\n    if (IsCallerCalleePanel &&\n        e.ChangedButton == MouseButton.XButton1) {\n      e.Handled = true;\n      await RestorePreviousState();\n      return;\n    }\n  }\n\n  private void SetupPreviewPopup() {\n    if (nodeHoverPreview_ != null) {\n      nodeHoverPreview_.Unregister();\n      nodeHoverPreview_ = null;\n    }\n\n    if (!settings_.ShowNodePopup) {\n      return;\n    }\n\n    nodeHoverPreview_ = new PopupHoverPreview(CallTreeList,\n                                              TimeSpan.FromMilliseconds(settings_.NodePopupDuration),\n                                              (mousePoint, previewPoint) => {\n                                                var element =\n                                                  (UIElement)CallTreeList.GetObjectAtPoint<ListViewItem>(\n                                                    mousePoint);\n\n                                                if (element is not TreeListItem treeItem) {\n                                                  return null;\n                                                }\n\n                                                var funcNode = treeItem.Node?.Tag as CallTreeListItem;\n                                                var callNode = funcNode?.CallTreeNode;\n\n                                                if (callNode is {HasFunction: true}) {\n                                                  // If popup already opened for this node reuse the instance.\n                                                  if (nodeHoverPreview_.PreviewPopup is CallTreeNodePopup\n                                                    popup) {\n                                                    popup.UpdatePosition(previewPoint, CallTreeList);\n                                                    popup.UpdateNode(callNode);\n                                                    return popup;\n                                                  }\n\n                                                  return new CallTreeNodePopup(\n                                                    callNode, this, previewPoint, CallTreeList, Session);\n                                                }\n\n                                                return null;\n                                              },\n                                              (mousePoint, popup) => true,\n                                              popup => {\n                                                if (popup.IsDetached) {\n                                                  Session.RegisterDetachedPanel(popup);\n                                                }\n                                              });\n  }\n\n  private void CallTreeOnNodeExpanded(object sender, TreeNode node) {\n    if (node.Tag is not CallTreeListItem funcNode) {\n      return;\n    }\n\n    // If children not populated yet, there is a single dummy node.\n    if (funcNode.HasAnyChildren &&\n        funcNode.Children.Count == 1 &&\n        funcNode.Children[0].Kind == CallTreeListItemKind.ChildrenPlaceholder) {\n      var callNode = funcNode.CallTreeNode;\n      var visitedNodes = new HashSet<ProfileCallTreeNode>();\n\n      // Remove the dummy node and add the real children.\n      // If the children have children on their own, new dummy nodes will be used.\n      funcNode.ClearChildren();\n      CallTreeListItem firstNodeEx = null;\n\n      if (funcNode.Kind == CallTreeListItemKind.CalleeNode && callNode.HasChildren) {\n        foreach (var childNode in callNode.Children) {\n          firstNodeEx ??= CreateProfileCallTree(childNode, funcNode, funcNode.Kind, visitedNodes);\n        }\n      }\n      else if (funcNode.Kind == CallTreeListItemKind.CallerNode && callNode.HasCallers) {\n        foreach (var childNode in callNode.Callers) {\n          firstNodeEx = CreateProfileCallTree(childNode, funcNode, funcNode.Kind, visitedNodes);\n        }\n      }\n\n      if (firstNodeEx != null) {\n        BringIntoView(firstNodeEx);\n      }\n    }\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private Func<TimeSpan, double> PickPercentageFunction(TimeSpan totalWeight) {\n    return weight => weight.Ticks / (double)totalWeight.Ticks;\n  }\n\n  private void BringIntoView(CallTreeListItem nodeEx) {\n    if (nodeEx.TreeNode != null) {\n      CallTreeList.ScrollIntoView(nodeEx.TreeNode);\n    }\n  }\n\n  private List<ProfileCallTreeNode> GetCallTreeNodes(IRTextFunction function, ProfileCallTree callTree) {\n    if (settings_.CombineInstances) {\n      var combinedNode = callTree.GetCombinedCallTreeNode(function);\n      return combinedNode == null ? null : new List<ProfileCallTreeNode> {combinedNode};\n    }\n\n    return callTree.GetCallTreeNodes(function);\n  }\n\n  private ProfileCallTreeNode GetChildCallTreeNode(ProfileCallTreeNode childNode, ProfileCallTreeNode parentNode,\n                                                   ProfileCallTree callTree) {\n    if (settings_.CombineInstances) {\n      return callTree.GetCombinedCallTreeNode(childNode.Function, parentNode);\n    }\n\n    return childNode;\n  }\n\n  private CallTreeListItem CreateProfileCallerCalleeTree(IRTextFunction function) {\n    var visitedNodes = new HashSet<ProfileCallTreeNode>();\n    var rootNode = new CallTreeListItem(CallTreeListItemKind.Root, this);\n    rootNode.Children = new List<CallTreeListItem>();\n    var nodeList = GetCallTreeNodes(function, callTree_);\n\n    if (nodeList == null) {\n      return null;\n    }\n\n    int index = 1;\n    var combinedWeight = callTree_.GetCombinedCallTreeNodeWeight(function);\n\n    foreach (var instance in nodeList) {\n      bool isSelf = nodeList.Count == 1;\n      string name = isSelf ? \"Function\" : $\"Function instance {index++}\";\n      string funcName = Session.CompilerInfo.NameProvider.FormatFunctionName(instance.Function);\n\n      if (isSelf && !string.IsNullOrEmpty(funcName)) {\n        name = funcName;\n      }\n\n      var percentageFunc = PickPercentageFunction(combinedWeight);\n      var instanceNode = CreateProfileCallTreeInstance(name, instance, percentageFunc);\n\n      if (isSelf) {\n        instanceNode.Time = long.MaxValue; // Ensure Self is on top.\n      }\n\n      rootNode.AddChild(instanceNode);\n\n      if (instance.HasCallers) {\n        // Percentage relative to entire profile for callers.\n        var callersNode = CreateProfileCallTreeHeader(CallTreeListItemKind.Header, \"Callers\", 2);\n\n        if (nodeList.Count > 1) {\n          instanceNode.AddChild(callersNode);\n        }\n        else {\n          rootNode.AddChild(callersNode);\n        }\n\n        foreach (var callerNode in instance.Callers) {\n          CreateProfileCallTree(callerNode, callersNode, instanceNode,\n                                CallTreeListItemKind.CallerNode, visitedNodes);\n        }\n\n        visitedNodes.Clear();\n      }\n\n      if (instance.HasChildren) {\n        // Percentage relative to current function callers.\n        //percentageFunc = PickPercentageFunction(instance.Weight);\n        var (childrenWeight, childrentExcWeight) = instance.ChildrenWeight;\n        var childrenNode =\n          CreateProfileCallTreeHeader(\"Calling\", childrenWeight, childrentExcWeight, percentageFunc, 1);\n\n        if (nodeList.Count > 1) {\n          instanceNode.AddChild(childrenNode);\n        }\n        else {\n          rootNode.AddChild(childrenNode);\n        }\n\n        foreach (var childNode in instance.Children) {\n          CreateProfileCallTree(childNode, childrenNode, instanceNode,\n                                CallTreeListItemKind.CalleeNode, visitedNodes, percentageFunc);\n        }\n\n        visitedNodes.Clear();\n      }\n\n      SortCallTreeNodes(instanceNode);\n    }\n\n    SortCallTreeNodes(rootNode);\n    return rootNode;\n  }\n\n  private CallTreeListItem CreateProfileCallTree() {\n    var visitedNodes = new HashSet<ProfileCallTreeNode>();\n    var rootNode = new CallTreeListItem(CallTreeListItemKind.Root, this);\n    rootNode.Children = new List<CallTreeListItem>();\n\n    foreach (var node in callTree_.RootNodes) {\n      visitedNodes.Clear();\n      CreateProfileCallTree(node, rootNode, CallTreeListItemKind.CallTreeNode, visitedNodes);\n    }\n\n    SortCallTreeNodes(rootNode);\n    return rootNode;\n  }\n\n  private CallTreeListItem CreateProfileCallTree(ProfileCallTreeNode node, CallTreeListItem parentNodeEx,\n                                                 CallTreeListItemKind kind,\n                                                 HashSet<ProfileCallTreeNode> visitedNodes,\n                                                 Func<TimeSpan, double> percentageFunc = null) {\n    return CreateProfileCallTree(node, parentNodeEx, parentNodeEx, kind, visitedNodes, percentageFunc);\n  }\n\n  private CallTreeListItem CreateProfileCallTree(ProfileCallTreeNode node, CallTreeListItem parentNodeEx,\n                                                 CallTreeListItem actualParentNode, CallTreeListItemKind kind,\n                                                 HashSet<ProfileCallTreeNode> visitedNodes,\n                                                 Func<TimeSpan, double> percentageFunc = null) {\n    bool newFunc = visitedNodes.Add(node);\n    var nodeEx = CreateProfileCallTreeChild(node, kind, percentageFunc, parentNodeEx);\n    parentNodeEx.AddChild(nodeEx);\n\n    if (!newFunc) {\n      return nodeEx; // Recursion in the call graph.\n    }\n\n    if (kind == CallTreeListItemKind.CalleeNode) {\n      //? TODO: This is still not quite right, the selected nodes\n      //? should be found on a path that has the current stack frame as a prefix in theirs.\n      //? actualParentNode is just the last in that list\n      node = GetChildCallTreeNode(node, actualParentNode.CallTreeNode, callTree_);\n      nodeEx.CallTreeNode = node;\n    }\n    else if (kind == CallTreeListItemKind.CallerNode) {\n      node = GetChildCallTreeNode(node, null, callTree_);\n      nodeEx.CallTreeNode = node;\n    }\n\n    switch (kind) {\n      case CallTreeListItemKind.CallTreeNode when node.HasChildren: {\n        foreach (var childNode in node.Children) {\n          CreateProfileCallTree(childNode, nodeEx, nodeEx, kind, visitedNodes, percentageFunc);\n        }\n\n        SortCallTreeNodes(nodeEx);\n        break;\n      }\n      case CallTreeListItemKind.CalleeNode when node.HasChildren: {\n        // For caller-callee mode, use a placeholder than when the tree gets expanded,\n        // gets replaced by the real callee nodes.\n        var dummyChildNode = CreateProfileCallTreeHeader(CallTreeListItemKind.ChildrenPlaceholder, \"Placeholder\", 0);\n        dummyChildNode.CallTreeNode = node;\n        nodeEx.AddChild(dummyChildNode);\n        break;\n      }\n      case CallTreeListItemKind.CallerNode when node.HasCallers: {\n        // For caller-callee mode, use a placeholder than when tree gets expanded,\n        // gets replaced by the real caller (backtrace) nodes.\n        var dummyChildNode = CreateProfileCallTreeHeader(CallTreeListItemKind.ChildrenPlaceholder, \"Placeholder\", 0);\n        dummyChildNode.CallTreeNode = node;\n        nodeEx.AddChild(dummyChildNode);\n        break;\n      }\n    }\n\n    visitedNodes.Remove(node);\n    return nodeEx;\n  }\n\n  private void ExpandCallTreeTop() {\n    if (CallTreeList.Nodes.Count > 0) {\n      foreach (var childNode in CallTreeList.Nodes) {\n        childNode.IsExpanded = true;\n      }\n    }\n  }\n\n  private double ComputeNodePercentage(TimeSpan weight, Func<TimeSpan, double> percentageFunc) {\n    if (percentageFunc != null) {\n      return percentageFunc(weight);\n    }\n\n    return weight.Ticks * profileDurationReciprocal_;\n  }\n\n  private CallTreeListItem CreateProfileCallTreeChild(ProfileCallTreeNode node, CallTreeListItemKind kind,\n                                                      Func<TimeSpan, double> percentageFunc,\n                                                      CallTreeListItem parentNodeEx = null) {\n    double weightPercentage = ComputeNodePercentage(node.Weight, percentageFunc);\n    double exclusiveWeightPercentage = ComputeNodePercentage(node.ExclusiveWeight, percentageFunc);\n\n    var result = new CallTreeListItem(kind, this, Session.CompilerInfo.NameProvider.FormatFunctionName) {\n      Function = node.Function,\n      ModuleName = node.ModuleName,\n      Time = node.Weight.Ticks,\n      CallTreeNode = node,\n      Parent = parentNodeEx,\n      Percentage = weightPercentage,\n      ExclusivePercentage = exclusiveWeightPercentage,\n      TextColor = Brushes.Black,\n      BackColor = App.Settings.DocumentSettings.ProfileMarkerSettings.PickBrushForPercentage(weightPercentage),\n      BackColor2 = App.Settings.DocumentSettings.ProfileMarkerSettings.PickBrushForPercentage(exclusiveWeightPercentage)\n    };\n\n    callTreeNodeToNodeExMap_[node] = result;\n    return result;\n  }\n\n  private CallTreeListItem CreateProfileCallTreeHeader(string name, TimeSpan weight, TimeSpan exclusiveWeight,\n                                                       Func<TimeSpan, double> percentageFunc, int priority) {\n    double weightPercentage = ComputeNodePercentage(weight, percentageFunc);\n    double exclusiveWeightPercentage = ComputeNodePercentage(exclusiveWeight, percentageFunc);\n    return new CallTreeListItem(CallTreeListItemKind.Header, this) {\n      CallTreeNode = new ProfileCallTreeNode(null, null) {Weight = weight, ExclusiveWeight = exclusiveWeight},\n      Time = TimeSpan.MaxValue.Ticks - priority,\n      FunctionName = name,\n      Percentage = weightPercentage,\n      ExclusivePercentage = exclusiveWeightPercentage,\n      TextColor = Brushes.Black,\n      BackColor = App.Settings.DocumentSettings.ProfileMarkerSettings.PickBrushForPercentage(weightPercentage),\n      BackColor2 =\n        App.Settings.DocumentSettings.ProfileMarkerSettings.PickBrushForPercentage(exclusiveWeightPercentage),\n      IsMarked = true\n    };\n  }\n\n  private CallTreeListItem CreateProfileCallTreeHeader(CallTreeListItemKind kind, string name, int priority) {\n    return new CallTreeListItem(kind, this)\n      {Time = TimeSpan.MaxValue.Ticks - priority, FunctionName = name, TextColor = Brushes.Black, IsMarked = true};\n  }\n\n  private CallTreeListItem CreateProfileCallTreeInstance(string name, ProfileCallTreeNode node,\n                                                         Func<TimeSpan, double> percentageFunc) {\n    var result = CreateProfileCallTreeChild(node, CallTreeListItemKind.Header, percentageFunc);\n    result.FunctionName = name;\n    result.IsMarked = true;\n    return result;\n  }\n\n  private async void ChildDoubleClick(object sender, MouseButtonEventArgs e) {\n    var item = ((ListViewItem)sender).Content as CallTreeListItem;\n\n    if (item != null) {\n      if (!Utils.IsAltModifierActive()) {\n        var openMode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n        await OpenFunction(item, openMode);\n      }\n      else {\n        await SwitchFunction(item);\n\n        if (IsCallerCalleePanel) {\n          await DisplayProfileCallerCalleeTree(item.Function);\n        }\n      }\n    }\n  }\n\n  private void ExpandHottestFunctionPath() {\n    if (CallTreeList.Nodes.Count > 0) {\n      ExpandHottestFunctionPath(CallTreeList.Nodes[0]);\n    }\n  }\n\n  private void UnmarkAllFunctions() {\n    foreach (var funcEx in callTreeNodeToNodeExMap_.Values) {\n      funcEx.IsMarked = false;\n    }\n  }\n\n  private void ExpandHottestFunctionPath(TreeNode node) {\n    UnmarkAllFunctions();\n    ExpandHottestFunctionPathImpl(node);\n  }\n\n  private void ExpandHottestFunctionPathImpl(TreeNode node, int depth = 0) {\n    var item = node.Tag as CallTreeListItem;\n    item.IsMarked = true;\n\n    if (node.HasChildren && depth <= 10) {\n      node.IsExpanded = true;\n      ExpandHottestFunctionPathImpl(node.Nodes[0], depth + 1);\n    }\n  }\n\n  private void CollapseAllFunctionPaths() {\n    foreach (var node in CallTreeList.Nodes) {\n      CollapseFunctionPath(node);\n    }\n  }\n\n  private void CollapseFunctionPath(TreeNode node) {\n    foreach (var child in node.Nodes) {\n      CollapseFunctionPath(child);\n    }\n\n    node.IsExpanded = false;\n  }\n\n  private void ExpandCallPathExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (CallTreeList.SelectedItem is TreeNode node) {\n      // Expand hottest path starting with the node.\n      ExpandHottestFunctionPath(node);\n    }\n    else {\n      // Expand hottest path in the tree.\n      ExpandHottestFunctionPath();\n    }\n  }\n\n  private void ExpandHottestCallPathExecuted(object sender, ExecutedRoutedEventArgs e) {\n    // Expand hottest path in the tree.\n    ExpandHottestFunctionPath();\n  }\n\n  private void CollapseCallPathExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (CallTreeList.SelectedItem is TreeNode node) {\n      CollapseFunctionPath(node);\n    }\n  }\n\n  private async void SelectFunctionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (CallTreeList.SelectedItem is TreeNode node) {\n      if (node.Tag is CallTreeListItem {HasCallTreeNode: true} item) {\n        await SwitchFunction(item);\n\n        if (IsCallerCalleePanel) {\n          await DisplayProfileCallerCalleeTree(item.Function);\n        }\n      }\n    }\n  }\n\n  private async void OpenFunctionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (CallTreeList.SelectedItem is TreeNode node) {\n      var item = node.Tag as CallTreeListItem;\n      var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n      await OpenFunction(item, mode);\n    }\n  }\n\n  private async void OpenFunctionInNewTab(object sender, ExecutedRoutedEventArgs e) {\n    if (CallTreeList.SelectedItem is TreeNode node) {\n      var item = node.Tag as CallTreeListItem;\n      await OpenFunction(item, OpenSectionKind.NewTab);\n    }\n  }\n\n  private async void GoBackExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await RestorePreviousState();\n  }\n\n  private async Task OpenFunction(CallTreeListItem item, OpenSectionKind openMode) {\n    if (item.HasCallTreeNode) {\n      await Session.OpenProfileFunction(item.CallTreeNode, openMode);\n    }\n  }\n\n  private async Task OpenFunctionInstance(CallTreeListItem item, OpenSectionKind openMode) {\n    if (item.HasCallTreeNode) {\n      var filter = new ProfileSampleFilter(item.CallTreeNode);\n      await Session.OpenProfileFunction(item.CallTreeNode, openMode, filter);\n    }\n  }\n\n  private async Task SwitchFunction(CallTreeListItem item) {\n    if (item.HasCallTreeNode) {\n      if (function_ != null) {\n        stateStack_.Push(function_);\n        OnPropertyChanged(nameof(HasPreviousState));\n      }\n\n      await Session.SwitchActiveProfileFunction(item.CallTreeNode);\n    }\n  }\n\n  private async void FunctionFilter_TextChanged(object sender, TextChangedEventArgs e) {\n    string text = FunctionFilter.Text.Trim();\n    await SearchCallTree(text);\n  }\n\n  private async Task SearchCallTree(string text) {\n    using var cancelableTask = await searchTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (searchResultNodes_ != null) {\n      // Clear previous search results.\n      foreach (var node in searchResultNodes_) {\n        node.SearchResult = null;\n        node.ResetCachedName();\n      }\n    }\n\n    if (text.Length > 1) {\n      searchResultNodes_ = new List<CallTreeListItem>();\n      var searcher = new TextSearcher(text, !App.Settings.SectionSettings.FunctionSearchCaseSensitive);\n      await Task.Run(() => SearchCallTree(text, callTreeEx_, searcher, searchResultNodes_));\n\n      if (cancelableTask.IsCanceled) {\n        return;\n      }\n\n      foreach (var node in searchResultNodes_) {\n        node.ResetCachedName();\n      }\n\n      searchResultIndex_ = -1;\n      SelectNextSearchResult();\n      ShowSearchSection = true;\n    }\n    else {\n      searchResultNodes_ = null;\n      ShowSearchSection = false;\n    }\n  }\n\n  private void UpdateSearchResultText() {\n    SearchResultText = searchResultNodes_ is {Count: > 0} ? $\"{searchResultIndex_ + 1} / {searchResultNodes_.Count}\"\n      : \"Not found\";\n  }\n\n  private void SearchCallTree(string text, CallTreeListItem node, TextSearcher searcher,\n                              List<CallTreeListItem> matchingNodes) {\n    var result = searcher.FirstIndexOf(node.FunctionName);\n\n    if (result.HasValue) {\n      node.SearchResult = result;\n      matchingNodes.Add(node);\n    }\n\n    foreach (var child in node.Children) {\n      SearchCallTree(text, child, searcher, matchingNodes);\n    }\n  }\n\n  private void FocusSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    FunctionFilter.Focus();\n    FunctionFilter.SelectAll();\n  }\n\n  private void ClearSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ((TextBox)e.Parameter).Text = string.Empty;\n  }\n\n  private async void CallTree_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (ignoreNextSelectionEvent_) {\n      ignoreNextSelectionEvent_ = false;\n      return;\n    }\n\n    if (CallTreeList.SelectedItem is TreeNode node &&\n        node.Tag is CallTreeListItem funcEx &&\n        funcEx.HasCallTreeNode) {\n      if (settings_.SyncSourceFile) {\n        // Load the source file and scroll to the hottest line.\n        await Session.OpenProfileSourceFile(funcEx.CallTreeNode);\n      }\n\n      if (settings_.SyncSelection) {\n        await Session.ProfileFunctionSelected(funcEx.CallTreeNode, PanelKind);\n      }\n    }\n    else if (CallTreeList.SelectedItem == null && settings_.SyncSelection) {\n      await Session.ProfileFunctionDeselected();\n    }\n  }\n\n  private async Task RestorePreviousState() {\n    if (stateStack_.TryPop(out var prevFunc)) {\n      await Session.SwitchActiveFunction(prevFunc);\n      OnPropertyChanged(nameof(HasPreviousState));\n    }\n  }\n\n  private void PreviousSearchResultExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SelectPreviousSearchResult();\n  }\n\n  private void NextSearchResultExecuted(object sender, ExecutedRoutedEventArgs e) {\n    SelectNextSearchResult();\n  }\n\n  private void SelectPreviousSearchResult() {\n    if (searchResultNodes_ != null && searchResultIndex_ > 0) {\n      searchResultIndex_--;\n      UpdateSearchResultText();\n      SelectFunction(searchResultNodes_[searchResultIndex_].CallTreeNode);\n    }\n  }\n\n  private void SelectNextSearchResult() {\n    if (searchResultNodes_ != null && searchResultIndex_ < searchResultNodes_.Count - 1) {\n      searchResultIndex_++;\n      UpdateSearchResultText();\n      SelectFunction(searchResultNodes_[searchResultIndex_].CallTreeNode);\n    }\n  }\n\n  private void CollapseNodesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    CollapseAllFunctionPaths();\n    ExpandHottestFunctionPath();\n  }\n\n  private async void PanelToolbarTray_OnHelpClicked(object sender, EventArgs e) {\n    await HelpPanel.DisplayPanelHelp(PanelKind, Session);\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    //? TODO: Redesign settings change detection, doesn't work well\n    //? when a panel shows multiple settings objects.\n    var initialMarkingSettings = MarkingSettings.Clone();\n    FrameworkElement relativeControl = CallTreeList;\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<CallTreeOptionsPanel, CallTreeSettings>(\n      settings_.Clone(), relativeControl, Session,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(settings_) ||\n            !initialMarkingSettings.Equals(MarkingSettings)) {\n          Settings = newSettings;\n\n          if (IsCallerCalleePanel) {\n            App.Settings.CallerCalleeSettings = newSettings;\n          }\n          else {\n            App.Settings.CallTreeSettings = newSettings;\n          }\n\n          await UpdateCallTree();\n          await UpdateMarkedFunctions();\n\n          if (commit) {\n            App.SaveApplicationSettings();\n          }\n\n          initialMarkingSettings = MarkingSettings.Clone();\n          return settings_.Clone();\n        }\n\n        return null;\n      },\n      () => optionsPanelPopup_ = null);\n  }\n\n  public override async Task OnReloadSettings() {\n    Settings = PanelKind == ToolPanelKind.CallTree ?\n      App.Settings.CallTreeSettings :\n      App.Settings.CallerCalleeSettings;\n  }\n\n  private void PanelToolbarTray_OnSettingsClicked(object sender, EventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  private async void ToggleButton_Click(object sender, RoutedEventArgs e) {\n    await UpdateCallTree();\n    await UpdateMarkedFunctions();\n  }\n\n  private void MarkSelectedNodes(object obj, Action<CallTreeListItem, Color> action) {\n    if (obj is SelectedColorEventArgs e) {\n      foreach (TreeNode node in CallTreeList.SelectedItems) {\n        if (node.Tag is CallTreeListItem item) {\n          action(item, e.SelectedColor);\n        }\n      }\n    }\n  }\n\n  public async Task UpdateMarkedFunctions(bool externalCall = false) {\n    using var task = await loadTask_.WaitAndCreateTaskAsync();\n    await UpdateMarkedFunctionsNoLock(externalCall);\n  }\n\n  private async Task UpdateMarkedFunctionsNoLock(bool externalCall) {\n    if (callTreeNodeToNodeExMap_ != null) {\n      UpdateMarkedFunctionsImpl();\n\n      if (!externalCall) {\n        await Session.FunctionMarkingChanged(PanelKind);\n      }\n    }\n  }\n\n  private void UpdateMarkedFunctionsImpl() {\n    var fgSettings = App.Settings.MarkingSettings;\n\n    foreach (var f in callTreeNodeToNodeExMap_.Values) {\n      f.ModuleBackColor = null;\n      f.FunctionBackColor = null;\n    }\n\n    if (!fgSettings.UseAutoModuleColors &&\n        !fgSettings.UseModuleColors &&\n        !fgSettings.UseFunctionColors) {\n      return;\n    }\n\n    foreach (var item in callTreeNodeToNodeExMap_.Values) {\n      if (fgSettings.UseModuleColors &&\n          fgSettings.GetModuleBrush(item.ModuleName, out var brush)) {\n        item.ModuleBackColor = brush;\n      }\n      else if (fgSettings.UseAutoModuleColors) {\n        item.ModuleBackColor = fgSettings.GetAutoModuleBrush(item.ModuleName);\n      }\n\n      if (fgSettings.UseFunctionColors &&\n          fgSettings.GetFunctionColor(item.FunctionName, out var color)) {\n        item.FunctionBackColor = color.AsBrush();\n      }\n    }\n  }\n\n  #region IToolPanel\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.CallTree;\n  public override bool SavesStateToFile => false;\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    Settings.TreeListColumns.SaveColumnsState(CallTreeList.View as GridView);\n    Reset();\n  }\n\n    #endregion\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/DocumentColumns.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Document.DocumentColumns\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n\n  <ListView\n    x:Name=\"ColumnsList\"\n    HorizontalAlignment=\"Stretch\"\n    VerticalAlignment=\"Stretch\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"0,1,0,0\"\n    ScrollViewer.CanContentScroll=\"True\"\n    ScrollViewer.ScrollChanged=\"ColumnsList_ScrollChanged\"\n    ScrollViewer.VerticalScrollBarVisibility=\"Hidden\"\n    SelectionChanged=\"ColumnsList_OnSelectionChanged\"\n    SelectionMode=\"Single\"\n    UseLayoutRounding=\"False\"\n    VirtualizingPanel.CacheLengthUnit=\"Pixel\"\n    VirtualizingPanel.ScrollUnit=\"Pixel\"\n    VirtualizingStackPanel.CacheLength=\"0,0\"\n    VirtualizingStackPanel.IsVirtualizing=\"True\"\n    VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n    <ListView.View>\n      <GridView>\n        <GridView.ColumnHeaderContainerStyle>\n          <Style TargetType=\"GridViewColumnHeader\">\n            <Setter Property=\"Template\">\n              <Setter.Value>\n                <ControlTemplate TargetType=\"{x:Type GridViewColumnHeader}\">\n                  <Border\n                    Height=\"21\"\n                    Margin=\"-1,-1,0,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    VerticalAlignment=\"Stretch\"\n                    Background=\"{DynamicResource {x:Static SystemColors.MenuBarBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    BorderThickness=\"0,0,1,1\">\n                    <TextBlock\n                      x:Name=\"ContentHeader\"\n                      Width=\"{TemplateBinding Width}\"\n                      Margin=\"4,0,4,0\"\n                      HorizontalAlignment=\"Left\"\n                      VerticalAlignment=\"Center\"\n                      Text=\"{TemplateBinding Content}\" />\n                  </Border>\n                </ControlTemplate>\n              </Setter.Value>\n            </Setter>\n          </Style>\n        </GridView.ColumnHeaderContainerStyle>\n      </GridView>\n    </ListView.View>\n\n    <ListView.ItemContainerStyle>\n      <Style TargetType=\"{x:Type ListViewItem}\">\n        <EventSetter\n          Event=\"MouseEnter\"\n          Handler=\"ListViewItem_MouseEnter\" />\n        <EventSetter\n          Event=\"MouseLeave\"\n          Handler=\"ListViewItem_MouseLeave\" />\n\n        <Setter Property=\"OverridesDefaultStyle\" Value=\"true\" />\n        <Setter Property=\"Height\"\n                Value=\"{Binding ColumnsListItemHeight, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}\" />\n        <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n        <Setter Property=\"VerticalContentAlignment\" Value=\"Stretch\" />\n        <Setter Property=\"Background\" Value=\"{Binding BackColor}\" />\n        <Setter Property=\"BorderBrush\" Value=\"{Binding BorderBrush}\" />\n        <Setter Property=\"BorderThickness\" Value=\"{Binding BorderThickness}\" />\n        <Setter Property=\"Template\">\n          <Setter.Value>\n            <ControlTemplate TargetType=\"ListBoxItem\">\n              <Border\n                Name=\"Border\"\n                Padding=\"0\"\n                Background=\"{TemplateBinding Background}\"\n                BorderBrush=\"{TemplateBinding BorderBrush}\"\n                BorderThickness=\"{TemplateBinding BorderThickness}\">\n                <GridViewRowPresenter\n                  HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n                  VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\" />\n              </Border>\n\n              <ControlTemplate.Triggers>\n                <Trigger Property=\"IsSelected\" Value=\"true\">\n                  <Setter TargetName=\"Border\" Property=\"Background\"\n                          Value=\"{Binding SelectedLineBrush, RelativeSource={RelativeSource AncestorType={x:Type ProfileExplorerUi:IRDocumentHost}}}\" />\n                </Trigger>\n              </ControlTemplate.Triggers>\n            </ControlTemplate>\n          </Setter.Value>\n        </Setter>\n      </Style>\n    </ListView.ItemContainerStyle>\n  </ListView>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/DocumentColumns.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic partial class DocumentColumns : UserControl, INotifyPropertyChanged {\n  private TextViewSettingsBase settings_;\n  private OptionalColumnSettings columnSettings_;\n  private List<ElementRowValue> profileDataRows_;\n  private List<(GridViewColumnHeader Header, GridViewColumn Column)> profileColumnHeaders_;\n  private double columnsListItemHeight_;\n  private ListCollectionView profileRowCollection_;\n  private List<(int StartOffset, int EndOffset)> foldedTextRegions_;\n  private int rowFilterIndex_;\n  private IRDocument associatedDocument_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private Dictionary<IRElement, ElementRowValue> profileDataRowsMap_;\n\n  public DocumentColumns() {\n    InitializeComponent();\n    profileColumnHeaders_ = new List<(GridViewColumnHeader Header, GridViewColumn Column)>();\n    profileDataRows_ = new List<ElementRowValue>();\n    foldedTextRegions_ = new List<(int StartOffset, int EndOffset)>();\n    profileDataRowsMap_ = new Dictionary<IRElement, ElementRowValue>();\n  }\n\n  public double ColumnsListItemHeight {\n    get => columnsListItemHeight_;\n    set {\n      if (Math.Abs(columnsListItemHeight_ - value) > double.Epsilon) {\n        columnsListItemHeight_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public TextViewSettingsBase Settings {\n    get => settings_;\n    set => settings_ = value;\n  }\n\n  public OptionalColumnSettings ColumnSettings {\n    get => columnSettings_;\n    set => columnSettings_ = value;\n  }\n\n  public bool UseSmallerFontSize { get; set; }\n  public double TextFontSize => UseSmallerFontSize ? settings_.FontSize - 1 : settings_.FontSize;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<ScrollChangedEventArgs> ScrollChanged;\n  public event EventHandler<int> RowSelected;\n  public event EventHandler<ElementRowValue> RowHoverStart;\n  public event EventHandler<ElementRowValue> RowHoverStop;\n  public event EventHandler<OptionalColumn> ColumnSettingsChanged;\n\n  public void SelectRow(int index) {\n    if (index >= 0 && ColumnsList.Items.Count > index) {\n      ColumnsList.SelectedIndex = index;\n    }\n  }\n\n  public void Reset() {\n    // Unregister column header event handlers.\n    foreach (var columnHeader in profileColumnHeaders_) {\n      columnHeader.Header.MouseLeftButtonDown -= ColumnHeaderOnClick;\n      columnHeader.Header.MouseDoubleClick -= ColumnHeaderOnDoubleClick;\n      columnHeader.Header.MouseRightButtonUp -= ColumnHeaderOnRightClick;\n      columnHeader.Header.MouseRightButtonUp -= ColumnSettingsClickHandler;\n    }\n\n    OptionalColumn.RemoveListViewColumns(ColumnsList);\n    ColumnsList.ItemsSource = null;\n    profileColumnHeaders_.Clear();\n    foldedTextRegions_.Clear();\n  }\n\n  public async Task Display(IRDocumentColumnData columnData, IRDocument associatedDocument) {\n    Reset(); // Remove any existing columns.\n    UpdateColumnsList();\n\n    if (!columnData.HasData) {\n      return;\n    }\n\n    associatedDocument_ = associatedDocument;\n    var function = associatedDocument.Function;\n    int rowCount = associatedDocument.LineCount;\n\n    // Make a row for each line of the associated document,\n    // with each row having cells in case there is associated profile data.\n    var elementValueList = await Task.Run(() => {\n      var elementValueList = new List<ElementRowValue>(function.TupleCount);\n      var oddBackColor = settings_.AlternateBackgroundColor.AsBrush();\n      var blockSeparatorColor = settings_.ShowBlockSeparatorLine ? settings_.BlockSeparatorColor.AsBrush() : null;\n      var font = new FontFamily(settings_.FontName);\n      double fontSize = TextFontSize;\n\n      var comparer = new IRDocumentColumnData.ColumnComparer();\n      Dictionary<OptionalColumn, ElementColumnValue> dummyCells = new(comparer);\n      Dictionary<OptionalColumn, ElementColumnValue> separatorDummyCells = new(comparer);\n\n      // Since many cells (and often entire rows) are empty,\n      // re-use the same cells to speed up processing.\n      ElementColumnValue MakeDummyCell(bool hasSeparator) {\n        var columnValue = new ElementColumnValue(\"\");\n        columnValue.TextFont = font;\n        columnValue.TextSize = fontSize;\n        return columnValue;\n      }\n\n      ElementColumnValue GetDummyCell(OptionalColumn column, bool hasSeparator) {\n        return hasSeparator ? separatorDummyCells[column] : dummyCells[column];\n      }\n\n      ElementRowValue MakeDummyRow(bool hasSeparator, Brush backColor = null) {\n        var row = new ElementRowValue(null) {\n          BackColor = backColor,\n          BorderBrush = blockSeparatorColor\n        };\n\n        foreach (var column in columnData.Columns) {\n          var cell = MakeDummyCell(hasSeparator);\n          row.ColumnValues[column] = cell;\n          columnData.AddColumnValue(cell, column);\n\n          if (hasSeparator) {\n            separatorDummyCells[column] = cell;\n          }\n          else {\n            dummyCells[column] = cell;\n          }\n        }\n\n        if (hasSeparator) {\n          row.BorderThickness = new Thickness(0, 0, 0, 1);\n          row.BorderBrush = blockSeparatorColor;\n        }\n\n        SetValueBorder(row);\n        return row;\n      }\n\n      void SetValueBorder(ElementRowValue row) {\n        foreach (var value in row.Values) {\n          value.BorderBrush = blockSeparatorColor;\n          value.BorderThickness = new Thickness(1, 0, 1, 0);\n        }\n      }\n\n      var dummyRow = MakeDummyRow(false);\n      var separatorDummyRow = MakeDummyRow(true);\n      var oddDummyRow = MakeDummyRow(false, oddBackColor);\n      var oddSeparatorDummyRow = MakeDummyRow(true, oddBackColor);\n      int prevLine = -1;\n      bool prevIsOddBlock = false;\n\n      void AddDummyRows(int count, bool isOddBlock) {\n        for (int i = 0; i < count; i++) {\n          elementValueList.Add(isOddBlock ? oddDummyRow : dummyRow);\n        }\n      }\n\n      // Go through the blocks and each tuple in the block\n      // and either create a row with profile data or use a dummy row.\n      profileDataRows_ = new List<ElementRowValue>();\n\n      foreach (var block in function.SortedBlocks) {\n        bool isOddBlock = block.HasOddIndexInFunction;\n\n        for (int i = 0; i < block.Tuples.Count; i++) {\n          var tuple = block.Tuples[i];\n          int currentLine = tuple.TextLocation.Line;\n          bool isSeparatorLine = settings_.ShowBlockSeparatorLine &&\n                                 block.IndexInFunction < function.BlockCount - 1 &&\n                                 i == block.TupleCount - 1;\n\n          // Add dummy empty list view lines to match document text.\n          if (currentLine > prevLine + 1) {\n            AddDummyRows(currentLine - prevLine - 1, isOddBlock);\n          }\n\n          // Check if there is any data associated with the element.\n          // Have the row match the background color used in the doc.\n          var rowValues = columnData.GetValues(tuple);\n\n          if (rowValues != null) {\n            rowValues.BorderBrush = blockSeparatorColor;\n\n            if (rowValues.BackColor == null && isOddBlock) {\n              rowValues.BackColor = oddBackColor;\n            }\n\n            foreach (var columnValue in rowValues.ColumnValues) {\n              columnValue.Value.TextFont = font;\n              columnValue.Value.TextSize = fontSize;\n            }\n\n            // Add dummy cells for the missing ones, needed for column separators.\n            if (rowValues.ColumnValues.Count != columnData.Columns.Count) {\n              foreach (var column in columnData.Columns) {\n                if (!rowValues.Columns.Contains(column)) {\n                  rowValues.ColumnValues[column] = GetDummyCell(column, isSeparatorLine);\n                }\n              }\n            }\n\n            // Add a separator line at the bottom of the current row\n            // if the next instr. is found in another block.\n            if (isSeparatorLine) {\n              rowValues.BorderBrush = blockSeparatorColor;\n              rowValues.BorderThickness = new Thickness(0, 0, 0, 1);\n            }\n\n            SetValueBorder(rowValues);\n            profileDataRows_.Add(rowValues);\n            profileDataRowsMap_[tuple] = rowValues;\n          }\n          else {\n            // No data at all, use an empty row.\n            if (isSeparatorLine) {\n              rowValues = isOddBlock ? oddSeparatorDummyRow : separatorDummyRow;\n            }\n            else {\n              rowValues = isOddBlock ? oddDummyRow : dummyRow;\n            }\n          }\n\n          elementValueList.Add(rowValues);\n          prevLine = currentLine;\n        }\n\n        prevIsOddBlock = isOddBlock;\n      }\n\n      // Add empty lines at the end to match document,\n      // otherwise scrolling can get out of sync.\n      if (rowCount != prevLine + 1) {\n        AddDummyRows(rowCount - prevLine, prevIsOddBlock);\n      }\n\n      return elementValueList;\n    });\n\n    // Handle clicks on the column headers.\n    var sortedColumns = columnSettings_.FilterAndSortColumns(columnData.Columns);\n    profileColumnHeaders_ = OptionalColumn.AddListViewColumns(ColumnsList, sortedColumns);\n\n    foreach (var columnHeader in profileColumnHeaders_) {\n      columnHeader.Header.MouseLeftButtonDown += ColumnHeaderOnClick;\n      columnHeader.Header.MouseDoubleClick += ColumnHeaderOnDoubleClick;\n      columnHeader.Header.MouseRightButtonUp += ColumnHeaderOnRightClick;\n      columnHeader.Header.MouseRightButtonUp += ColumnSettingsClickHandler;\n    }\n\n    // Display the columns.\n    profileRowCollection_ = new ListCollectionView(elementValueList);\n    profileRowCollection_.Filter += ProfileListRowFilter;\n    UpdateColumnWidths();\n    ColumnsList.ItemsSource = profileRowCollection_;\n    UpdateColumnsList();\n  }\n\n  public ElementRowValue GetRowValue(IRElement element) {\n    return profileDataRowsMap_.GetValueOrDefault(element);\n  }\n\n  private void ColumnSettingsClickHandler(object sender, RoutedEventArgs e) {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    var columnHeader = (GridViewColumnHeader)sender;\n    var column = (OptionalColumn)columnHeader.Tag;\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<ColumnOptionsPanel, OptionalColumnStyle>(\n      column.Style.Clone(), columnHeader, null,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(column.Style)) {\n          column.Style = newSettings;\n          ColumnSettingsChanged?.Invoke(this, column);\n\n          if (commit) {\n            columnSettings_.AddColumnStyle(column, newSettings);\n            App.SaveApplicationSettings();\n          }\n\n          return newSettings.Clone();\n        }\n\n        if (commit) {\n          columnSettings_.AddColumnStyle(column, newSettings);\n          App.SaveApplicationSettings();\n        }\n\n        return null;\n      },\n      () => optionsPanelPopup_ = null,\n      new Point(0, columnHeader.ActualHeight - 1));\n  }\n\n  public void BuildColumnsVisibilityMenu(IRDocumentColumnData columnData, MenuItem menu,\n                                         Action columnsChanged) {\n    // Add the columns at the end of the menu,\n    // keeping the original items.\n    var defaultItems = DocumentUtils.SaveDefaultMenuItems(menu);\n    menu.Items.Clear();\n\n    foreach (var column in columnData.Columns) {\n      var item = new MenuItem {\n        Header = column.Title,\n        Tag = column,\n        IsCheckable = true,\n        IsChecked = column.IsVisible,\n        StaysOpenOnClick = true,\n        Style = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\")\n      };\n\n      item.Checked += (sender, args) => {\n        if (sender is MenuItem menuItem &&\n            menuItem.Tag is OptionalColumn column) {\n          column.IsVisible = menuItem.IsChecked;\n          columnSettings_.SetColumnVisibility(column, menuItem.IsChecked);\n          columnsChanged();\n        }\n      };\n      item.Unchecked += (sender, args) => {\n        if (sender is MenuItem menuItem &&\n            menuItem.Tag is OptionalColumn column) {\n          column.IsVisible = menuItem.IsChecked;\n          columnSettings_.SetColumnVisibility(column, menuItem.IsChecked);\n          columnsChanged();\n        }\n      };\n\n      defaultItems.Add(item);\n    }\n\n    DocumentUtils.RestoreDefaultMenuItems(menu, defaultItems);\n  }\n\n  public void SetupFoldedTextRegions(IEnumerable<FoldingSection> regions) {\n    // Used to sync the visible rows with the folding\n    // that can be applied on blocks in the associated document.\n    foldedTextRegions_.Clear();\n\n    foreach (var region in regions) {\n      if (region.IsFolded) {\n        foldedTextRegions_.Add((region.StartOffset, region.EndOffset));\n      }\n    }\n\n    foldedTextRegions_.Sort((a, b) => a.StartOffset.CompareTo(b.StartOffset));\n    rowFilterIndex_ = 0;\n    profileRowCollection_.Refresh();\n  }\n\n  public void HandleTextRegionFolded(FoldingSection section) {\n    HandleTextRegionFolded((section.StartOffset, section.EndOffset));\n  }\n\n  public void HandleTextRegionFolded((int StartOffset, int EndOffset) section) {\n    if (foldedTextRegions_.Contains(section)) {\n      return;\n    }\n\n    foldedTextRegions_.Add(section);\n    foldedTextRegions_.Sort((a, b) => a.StartOffset.CompareTo(b.StartOffset));\n    rowFilterIndex_ = 0;\n    profileRowCollection_.Refresh();\n  }\n\n  public void HandleTextRegionUnfolded(FoldingSection section) {\n    HandleTextRegionUnfolded((section.StartOffset, section.EndOffset));\n  }\n\n  public void HandleTextRegionUnfolded((int StartOffset, int EndOffset) section) {\n    foldedTextRegions_.Remove(section);\n    rowFilterIndex_ = 0;\n    profileRowCollection_.Refresh();\n  }\n\n  private bool ProfileListRowFilter(object item) {\n    // Filter out rows to keep in sync with the collapsed\n    // block foldings in the associated document.\n    foreach (var range in foldedTextRegions_) {\n      var startLine = associatedDocument_.GetLineByOffset(range.StartOffset);\n      var endLine = associatedDocument_.GetLineByOffset(range.EndOffset);\n\n      if (startLine.LineNumber - 1 > rowFilterIndex_) {\n        break; // Early stop in sorted range list.\n      }\n\n      if (rowFilterIndex_ >= startLine.LineNumber &&\n          rowFilterIndex_ < endLine.LineNumber) {\n        rowFilterIndex_++;\n        return false;\n      }\n    }\n\n    rowFilterIndex_++;\n    return true;\n  }\n\n  public void UpdateColumnWidths() {\n    if (profileDataRows_ == null ||\n        profileColumnHeaders_ == null) {\n      return;\n    }\n\n    var maxColumnTextSize = new Dictionary<OptionalColumn, double>();\n    var maxColumnExtraSize = new Dictionary<OptionalColumn, double>();\n    var font = new FontFamily(settings_.FontName);\n    double fontSize = TextFontSize;\n    double maxBarWidth = settings_.ProfileMarkerSettings.MaxPercentageBarWidth;\n    const double columnMargin = 8;\n\n    foreach (var rowValues in profileDataRows_) {\n      foreach (var columnValue in rowValues.ColumnValues) {\n        columnValue.Value.TextFont = font;\n        columnValue.Value.TextSize = fontSize;\n\n        // Remember the max text length for each column\n        // to later set the MinWidth for alignment.\n        maxColumnTextSize.CollectMaxValue(columnValue.Key, columnValue.Value.Text.Length);\n\n        if (columnValue.Value.ShowPercentageBar ||\n            columnValue.Value.ShowIcon) {\n          double extraColumnWidth = columnMargin;\n\n          if (columnValue.Value.ShowPercentageBar) {\n            extraColumnWidth += columnValue.Value.ValuePercentage * maxBarWidth;\n          }\n\n          if (columnValue.Value.ShowIcon) {\n            // Width of the icon is at most the height of the row.\n            extraColumnWidth += ColumnsListItemHeight + columnMargin;\n          }\n\n          maxColumnExtraSize.CollectMaxValue(columnValue.Key, extraColumnWidth);\n        }\n      }\n    }\n\n    // Set the MinWidth of the text for each cell.\n    foreach (var pair in maxColumnTextSize) {\n      var columnContentSize = Utils.MeasureString((int)pair.Value, settings_.FontName, TextFontSize);\n      double columnWidth = columnContentSize.Width + columnMargin;\n      maxColumnTextSize[pair.Key] = Math.Ceiling(columnWidth);\n\n      // Also set the initial width of each column header.\n      // For the header, consider image and percentage bar too.\n      if (maxColumnExtraSize.TryGetValue(pair.Key, out double extraSize)) {\n        columnWidth += extraSize;\n      }\n\n      if (columnWidth == 0 && columnSettings_.RemoveEmptyColumns) {\n        pair.Key.IsVisible = false;\n      }\n      else {\n        var columnTitleSize = Utils.MeasureString(pair.Key.Title, settings_.FontName, TextFontSize);\n        var gridColumn = profileColumnHeaders_.Find(item => item.Header.Tag.Equals(pair.Key));\n\n        if (gridColumn.Column == null || gridColumn.Header == null) {\n          continue;\n        }\n\n        columnWidth = Math.Max(columnWidth, columnTitleSize.Width + columnMargin);\n        gridColumn.Header.Width = columnWidth;\n        gridColumn.Column.Width = columnWidth;\n      }\n\n      //Trace.WriteLine($\"Column width {columnWidth} for {pair.Key.ColumnName}\");\n    }\n\n    foreach (var row in profileDataRows_) {\n      foreach (var columnValue in row.ColumnValues) {\n        columnValue.Value.MinTextWidth = maxColumnTextSize[columnValue.Key];\n      }\n    }\n  }\n\n  public void ScrollToVerticalOffset(double offset) {\n    // Sync scrolling with the optional columns.\n    var columnScrollViewer = Utils.FindChild<ScrollViewer>(ColumnsList);\n\n    if (columnScrollViewer != null) {\n      columnScrollViewer.ScrollToVerticalOffset(offset);\n    }\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  public void UpdateColumnsList() {\n    ColumnsList.Background = settings_.BackgroundColor.AsBrush();\n    ColumnsList.Background = ColorBrushes.GetBrush(settings_.BackgroundColor);\n    ColumnsListItemHeight = Utils.MeasureString(\"0123456789ABCXYZ!?|()\",\n                                                settings_.FontName, TextFontSize).Height;\n  }\n\n  private void ColumnHeaderOnClick(object sender, RoutedEventArgs e) {\n    if (((GridViewColumnHeader)sender).Tag is OptionalColumn column &&\n        column.HeaderClickHandler != null) {\n      column.HeaderClickHandler(column, (GridViewColumnHeader)sender);\n      UpdateColumnWidths();\n      e.Handled = true;\n    }\n  }\n\n  private void ColumnHeaderOnRightClick(object sender, RoutedEventArgs e) {\n    if (((GridViewColumnHeader)sender).Tag is OptionalColumn column &&\n        column.HeaderRightClickHandler != null) {\n      column.HeaderRightClickHandler(column, (GridViewColumnHeader)sender);\n      UpdateColumnWidths();\n      e.Handled = true;\n    }\n  }\n\n  private void ColumnHeaderOnDoubleClick(object sender, RoutedEventArgs e) {\n    if (((GridViewColumnHeader)sender).Tag is OptionalColumn column &&\n        column.HeaderDoubleClickHandler != null) {\n      column.HeaderDoubleClickHandler(column, (GridViewColumnHeader)sender);\n      UpdateColumnWidths();\n      e.Handled = true;\n    }\n  }\n\n  private void ColumnsList_ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    if (Math.Abs(e.VerticalChange) < double.Epsilon) {\n      return;\n    }\n\n    ScrollChanged?.Invoke(this, e);\n  }\n\n  private void ColumnsList_OnSelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (ColumnsList.SelectedItem != null) {\n      RowSelected?.Invoke(this, ColumnsList.SelectedIndex);\n    }\n  }\n\n  private void ListViewItem_MouseEnter(object sender, MouseEventArgs e) {\n    if (sender is ListViewItem {DataContext: ElementRowValue row}) {\n      RowHoverStart?.Invoke(this, row);\n    }\n  }\n\n  private void ListViewItem_MouseLeave(object sender, MouseEventArgs e) {\n    if (sender is ListViewItem {DataContext: ElementRowValue row}) {\n      RowHoverStop?.Invoke(this, row);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/InlineAssemblyHelpers.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Editing;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.UI.Document;\n\nnamespace ProfileExplorer.UI.Profile.Document;\n\n// A custom line margin that overrides the default one, with support\n// for block folding - the lines part of a block folding are not numbered.\nsealed class SourceLineNumberMargin : LineNumberMargin {\n  private IRDocument textView_;\n  private SourceLineProfileResult sourceLineProfileResult_;\n\n  static SourceLineNumberMargin() {\n    DefaultStyleKeyProperty.OverrideMetadata(typeof(SourceLineNumberMargin),\n                                             new FrameworkPropertyMetadata(typeof(SourceLineNumberMargin)));\n  }\n\n  public SourceLineNumberMargin(IRDocument textView, SourceLineProfileResult sourceLineProfileResult) {\n    textView_ = textView;\n    sourceLineProfileResult_ = sourceLineProfileResult;\n  }\n\n  protected override void OnRender(DrawingContext drawingContext) {\n    var textView = TextView;\n    var renderSize = RenderSize;\n\n    if (textView == null || !textView.VisualLinesValid) {\n      return;\n    }\n\n    var foreground = textView_.LineNumbersForeground;\n\n    foreach (var line in textView.VisualLines) {\n      int lineNumber = line.FirstDocumentLine.LineNumber;\n\n      if (sourceLineProfileResult_ != null) {\n        if (lineNumber < sourceLineProfileResult_.SourceLineResult.FirstLineIndex) {\n          // Line numbers before function start are unchanged.\n        }\n        else if (lineNumber > sourceLineProfileResult_.SourceLineResult.LastLineIndex +\n          sourceLineProfileResult_.AssemblyLineCount) {\n          // For lines after function end, subtract the assembly line count.\n          lineNumber -= sourceLineProfileResult_.AssemblyLineCount;\n        }\n        else if (sourceLineProfileResult_.LineToOriginalLineMap.TryGetValue(lineNumber, out int mappedLine)) {\n          lineNumber = mappedLine;\n        }\n        else {\n          // Don't show line numbers for inline assembly.\n          continue;\n        }\n      }\n\n      var text = DocumentUtils.CreateFormattedText(this, lineNumber.ToString(),\n                                                   typeface, emSize, foreground);\n      double y = line.GetTextLineVisualYPosition(line.TextLines[0], VisualYPosition.TextTop);\n      drawingContext.DrawText(text, new Point(renderSize.Width - text.Width, y - textView.VerticalOffset));\n    }\n  }\n}\n\n// Creates block foldings for the specified ranges, used to display\n// the foldings for inline assembly sections in the source code document.\nsealed class RangeFoldingStrategy : IBlockFoldingStrategy {\n  private List<(int StartOffset, int EndOffset)> ranges_;\n  private bool defaultClosed_;\n\n  public RangeFoldingStrategy(List<(int StartOffset, int EndOffset)> ranges, bool defaultClosed = false) {\n    ranges_ = ranges;\n    defaultClosed_ = defaultClosed;\n  }\n\n  public void UpdateFoldings(FoldingManager manager, TextDocument document) {\n    var newFoldings = CreateNewFoldings(document);\n    manager.UpdateFoldings(newFoldings, -1);\n  }\n\n  private IEnumerable<NewFolding> CreateNewFoldings(TextDocument document) {\n    foreach (var range in ranges_) {\n      yield return new NewFolding(range.StartOffset, range.EndOffset) {\n        DefaultClosed = defaultClosed_\n      };\n    }\n  }\n}\n\n// Changes the style of a range of text in IRDocument.\nsealed class RangeColorizer : DocumentColorizingTransformer {\n  private List<(int StartOffset, int EndOffset)> ranges_;\n  private Brush textColor_;\n  private Brush backColor_;\n  private Typeface typeface_;\n  private CompareRanges comparer_;\n\n  public RangeColorizer(List<(int StartOffset, int EndOffset)> ranges,\n                        Brush textColor, Brush backColor = null, Typeface typeface = null) {\n    ranges_ = ranges;\n    textColor_ = textColor;\n    backColor_ = backColor;\n    typeface_ = typeface;\n    comparer_ = new CompareRanges();\n    ranges.Sort((a, b) => a.CompareTo(b));\n  }\n\n  protected override void ColorizeLine(DocumentLine line) {\n    if (line.Length == 0) {\n      return;\n    }\n\n    var query = (line.Offset, line.EndOffset);\n    int result = ranges_.BinarySearch(query, comparer_);\n\n    if (result >= 0) {\n      var range = ranges_[result];\n\n      if (line.Offset < range.StartOffset ||\n          line.Offset > range.EndOffset) {\n        return;\n      }\n\n      int start = line.Offset > range.StartOffset ? line.Offset : range.StartOffset;\n      int end = range.EndOffset > line.EndOffset ? line.EndOffset : range.EndOffset;\n      ChangeLinePart(start, end, element => {\n        if (textColor_ != null) {\n          element.TextRunProperties.SetForegroundBrush(textColor_);\n        }\n\n        if (backColor_ != null) {\n          element.TextRunProperties.SetBackgroundBrush(backColor_);\n        }\n\n        if (typeface_ != null) {\n          element.TextRunProperties.SetTypeface(typeface_);\n        }\n      });\n    }\n  }\n\n  private class CompareRanges : IComparer<(int StartOffset, int EndOffset)> {\n    public int Compare((int StartOffset, int EndOffset) x, (int StartOffset, int EndOffset) y) {\n      if (x.EndOffset < y.StartOffset) {\n        return -1;\n      }\n      else if (x.StartOffset > y.EndOffset) {\n        return 1;\n      }\n\n      return 0;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfileDocumentMarker.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Document;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Document;\nusing TextLocation = ProfileExplorer.Core.TextLocation;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing PerformanceCounter = ProfileExplorer.Core.Profile.Data.PerformanceCounter;\n\nnamespace ProfileExplorer.UI.Profile;\n\n//? TODO: Use better names for members\npublic record SourceLineProfileResult(\n  FunctionProcessingResult Result,\n  SourceLineProcessingResult SourceLineResult,\n  FunctionIR Function,\n  Dictionary<int, IRElement> LineToElementMap,\n  Dictionary<int, int> LineToOriginalLineMap,\n  Dictionary<int, int> OriginalLineToLineMap,\n  List<(int StartOffset, int EndOffset)> AssemblyRanges,\n  int AssemblyLineCount);\n\npublic class InlineeListItem {\n  public InlineeListItem(SourceStackFrame frame) {\n    InlineeFrame = frame;\n    ElementWeights = new List<(IRElement Element, TimeSpan Weight)>();\n  }\n\n  public SourceStackFrame InlineeFrame { get; set; }\n  public ProfileCallTreeNode CallTreeNode { get; set; }\n  public TimeSpan Weight { get; set; }\n  public TimeSpan ExclusiveWeight { get; set; }\n  public double Percentage { get; set; }\n  public double ExclusivePercentage { get; set; }\n  public List<(IRElement Element, TimeSpan Weight)> ElementWeights { get; }\n\n  public List<IRElement> SortedElements {\n    get {\n      ElementWeights.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n      return ElementWeights.ConvertAll(item => item.Element);\n    }\n  }\n}\n\npublic class ProfileDocumentMarker {\n  private static readonly string ProfileOverlayTag = \"ProfileTag\";\n\n  // Templates for the time columns defining the style.\n  public static readonly OptionalColumn TimeColumnDefinition =\n    OptionalColumn.Template(\"[TimeHeader]\", \"TimePercentageColumnValueTemplate\",\n                            \"TimeHeader\", \"Time (ms)\", \"Instruction time\",\n                            null, 50.0, \"TimeColumnHeaderTemplate\");\n  public static readonly OptionalColumn TimePercentageColumnDefinition =\n    OptionalColumn.Template(\"[TimePercentageHeader]\", \"TimePercentageColumnValueTemplate\",\n                            \"TimePercentageHeader\", \"Time (%)\", \"Instruction time percentage relative to function time\",\n                            null, 50.0, \"TimeColumnHeaderTemplate\");\n\n  //? TODO: Should be customizable (at least JSON if not UI)\n  //? TODO: Each column setting should have the abbreviation\n  private static readonly (string, string)[] PerfCounterNameReplacements = {\n    (\"Instruction\", \"Instr\"),\n    (\"Misprediction\", \"Mispred\")\n  };\n  private FunctionProfileData profile_;\n  private ProfileData globalProfile_;\n  private ProfileDocumentMarkerSettings settings_;\n  private OptionalColumnSettings columnSettings_;\n  private ICompilerInfoProvider irInfo_;\n\n  public ProfileDocumentMarker(FunctionProfileData profile, ProfileData globalProfile,\n                               ProfileDocumentMarkerSettings settings,\n                               OptionalColumnSettings columnSettings,\n                               ICompilerInfoProvider ir) {\n    profile_ = profile;\n    globalProfile_ = globalProfile;\n    settings_ = settings;\n    columnSettings_ = columnSettings;\n    irInfo_ = ir;\n  }\n\n  public OptionalColumn TimeColumnTemplate() {\n    string timeUnit = settings_.ValueUnit switch {\n      ProfileDocumentMarkerSettings.ValueUnitKind.Second      => \"sec\",\n      ProfileDocumentMarkerSettings.ValueUnitKind.Millisecond => \"ms\",\n      ProfileDocumentMarkerSettings.ValueUnitKind.Microsecond => \"µs\",\n      ProfileDocumentMarkerSettings.ValueUnitKind.Nanosecond  => \"ns\",\n      _                                                       => throw new ArgumentOutOfRangeException()\n    };\n\n    TimeColumnDefinition.Title = $\"Time ({timeUnit})\";\n    TimeColumnDefinition.Style = columnSettings_.GetColumnStyle(TimeColumnDefinition) ??\n                                 OptionalColumnSettings.DefaultTimeColumnStyle;\n    return TimeColumnDefinition;\n  }\n\n  public OptionalColumn TimePercentageColumnTemplate() {\n    TimePercentageColumnDefinition.Style = columnSettings_.GetColumnStyle(TimePercentageColumnDefinition) ??\n                                           OptionalColumnSettings.DefaultTimePercentageColumnStyle;\n    return TimePercentageColumnDefinition;\n  }\n\n  public OptionalColumn CounterColumnTemplate(PerformanceCounter counter, int index) {\n    var column = OptionalColumn.Template($\"[CounterHeader{counter.Id}]\",\n                                         \"TimePercentageColumnValueTemplate\",\n                                         $\"CounterHeader{counter.Id}\",\n                                         $\"{ShortenPerfCounterName(counter.Name)}\",\n                                         /*counterInfo?.Config?.Description != null ? $\"{counterInfo.Config.Description}\" :*/\n                                         $\"{counter.Name}\",\n                                         null, 50, \"TimeColumnHeaderTemplate\");\n    column.Style = columnSettings_.GetColumnStyle(column);\n\n    if (column.Style == null) {\n      column.Style = counter.IsMetric ?\n        OptionalColumnSettings.DefaultMetricsColumnStyle(index) :\n        OptionalColumnSettings.DefaultCounterColumnStyle(index);\n    }\n\n    return column;\n  }\n\n  public static bool IsPerfCounterVisible(PerformanceCounter counter) {\n    //? TODO: Use a filter list from options\n    return counter.Name != \"Timer\";\n  }\n\n  public static string FormatPerformanceMetric(double value, PerformanceMetric metric) {\n    if (value == 0) {\n      return \"\";\n    }\n\n    return metric.Config.IsPercentage ? value.AsPercentageString() : $\"{value:F2}\";\n  }\n\n  public static string FormatPerformanceCounter(long value, PerformanceCounter counter) {\n    if (counter.Frequency >= 1000) {\n      double valueK = (double)(value * counter.Frequency) / 1000;\n      return $\"{valueK:n0} K\";\n    }\n\n    return $\"{value * counter.Frequency}\";\n  }\n\n  public static string ShortenPerfCounterName(string name) {\n    foreach (var replacement in PerfCounterNameReplacements) {\n      int index = name.LastIndexOf(replacement.Item1, StringComparison.Ordinal);\n\n      if (index != -1) {\n        string suffix = \"\";\n\n        if (index + replacement.Item1.Length < name.Length) {\n          suffix = name.Substring(index + replacement.Item1.Length);\n        }\n\n        return name.Substring(0, index) + replacement.Item2 + suffix;\n      }\n    }\n\n    return name;\n  }\n\n  public async Task<IRDocumentColumnData> Mark(IRDocument document, FunctionIR function,\n                                               IRTextFunction textFunction) {\n    IRDocumentColumnData columnData = null;\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n    bool hasInstrOffsetMetadata = metadataTag != null && metadataTag.OffsetToElementMap.Count > 0;\n\n    if (hasInstrOffsetMetadata) {\n      document.SuspendUpdate();\n\n      var result = await Task.Run(() => profile_.Process(function, irInfo_.IR));\n      columnData = await MarkProfiledElements(result, function, document);\n      document.ProfileProcessingResult = result;\n      document.ProfileColumnData = columnData;\n\n      // Remove any overlays from a previous marking.\n      foreach (var block in function.Blocks) {\n        document.RemoveElementOverlays(block, ProfileOverlayTag);\n      }\n\n      foreach (var tuple in function.AllTuples) {\n        document.RemoveElementOverlays(tuple, ProfileOverlayTag);\n      }\n\n      MarkProfiledBlocks(result.BlockSampledElements, document, false);\n      MarkCallSites(document, function, textFunction, metadataTag, null, false);\n      document.ResumeUpdate();\n    }\n\n    return columnData;\n  }\n\n  public async Task<IRDocumentColumnData> MarkSourceLines(IRDocument document,\n                                                          SourceLineProfileResult processingResult) {\n    document.ProfileColumnData =\n      await MarkProfiledElements(processingResult.Result, processingResult.Function, document);\n    return document.ProfileColumnData;\n  }\n\n  public async Task<SourceLineProfileResult>\n    PrepareSourceLineProfile(FunctionProfileData profile, IRDocument document,\n                             SourceLineProcessingResult sourceProcResult,\n                             ParsedIRTextSection parsedSection = null) {\n    var sourceLineWeights = sourceProcResult.SourceLineWeightList;\n\n    if (sourceLineWeights.Count == 0) {\n      return null;\n    }\n\n    // Check for cases where instead of the source code smth. like\n    // a source server authentication failure response is displayed.\n    if (sourceProcResult.FirstLineIndex > document.LineCount &&\n        sourceProcResult.LastLineIndex > document.LineCount) {\n      return null;\n    }\n\n    //? TODO: Pretty hacky approach that makes a fake function\n    //? with IR elements to represent each source line.\n    var ids = IRElementId.NewFunctionId();\n    var dummyFunc = new FunctionIR();\n    var dummyBlock = new BlockIR(ids.NewBlock(0), 0, dummyFunc);\n    dummyFunc.Blocks.Add(dummyBlock);\n    dummyFunc.AssignBlockIndices();\n\n    var processingResult = new FunctionProcessingResult();\n    var lineToElementMap = new Dictionary<int, IRElement>();\n    var lineToOriginalLineMap = new Dictionary<int, int>();\n    var originalLineToLineMap = new Dictionary<int, int>();\n    var assemblyRanges = new List<(int StartOffset, int EndOffset)>();\n\n    TupleIR MakeDummyTuple(TextLocation textLocation, DocumentLine documentLine) {\n      var tupleIr = new TupleIR(ids.NextTuple(), TupleKind.Other, dummyBlock);\n      tupleIr.TextLocation = textLocation;\n      tupleIr.TextLength = documentLine.Length;\n      dummyBlock.Tuples.Add(tupleIr);\n      return tupleIr;\n    }\n\n    // If assembly should be inserted after each source line,\n    // precompute the list of instructions mapping to each line.\n    FunctionProcessingResult.SampledElementsToLineMapping instrToLineMap = null;\n\n    if (parsedSection != null) {\n      instrToLineMap = await Task.Run(() => {\n        var funcProcResult = profile.Process(parsedSection.Function, irInfo_.IR);\n\n        if (funcProcResult != null) {\n          return funcProcResult.BuildSampledElementsToLineMapping(profile, parsedSection);\n        }\n\n        return null;\n      });\n    }\n\n    // For each source line, accumulate the weight of all instructions\n    // mapped to that line, for both samples and performance counters.\n    int lastLine = Math.Min(sourceProcResult.LastLineIndex, document.LineCount);\n    int inserted = 0;\n    document.SuspendUpdate();\n\n    for (int lineNumber = sourceProcResult.FirstLineIndex; lineNumber <= lastLine; lineNumber++) {\n      var documentLine = document.GetLineByNumber(lineNumber + inserted);\n      var location = new TextLocation(documentLine.Offset, lineNumber + inserted - 1, 0);\n      var dummyTuple = MakeDummyTuple(location, documentLine);\n      lineToElementMap[lineNumber + inserted] = dummyTuple;\n      lineToOriginalLineMap[lineNumber + inserted] = lineNumber;\n      originalLineToLineMap[lineNumber] = lineNumber + inserted;\n\n      if (sourceProcResult.SourceLineWeight.TryGetValue(lineNumber, out var lineWeight)) {\n        processingResult.SampledElements.Add((dummyTuple, lineWeight));\n      }\n\n      if (sourceProcResult.SourceLineCounters.TryGetValue(lineNumber, out var counters)) {\n        processingResult.CounterElements.Add((dummyTuple, counters));\n      }\n\n      // Insert assembly instructions for each source line.\n      if (dummyTuple == null || instrToLineMap == null ||\n          !instrToLineMap.SampledElements.TryGetValue(lineNumber, out var lineInstrs)) {\n        continue;\n      }\n\n      var instrLine = document.GetLineByNumber(lineNumber + inserted);\n      int rangeStart = instrLine.EndOffset;\n      int rangeEnd = instrLine.EndOffset;\n\n      foreach (var pair in lineInstrs) {\n        var instr = pair.Element;\n        var instrWeight = pair.Profile.Weight;\n        var instrCounters = pair.Profile.Counters;\n        string instrText = parsedSection.Text.Slice(instr.TextLocation.Offset, instr.TextLength).ToString();\n        document.Document.Insert(instrLine.EndOffset, $\"\\n{instrText.TrimEnd()}\");\n\n        inserted++;\n        instrLine = document.GetLineByNumber(lineNumber + inserted);\n        rangeEnd = instrLine.EndOffset;\n\n        location = new TextLocation(instrLine.Offset, lineNumber + inserted - 1, 0);\n        dummyTuple = MakeDummyTuple(location, instrLine);\n        lineToElementMap[lineNumber + inserted] = dummyTuple;\n\n        if (instrWeight != TimeSpan.Zero) {\n          processingResult.SampledElements.Add((dummyTuple, instrWeight));\n        }\n\n        if (instrCounters != null) {\n          processingResult.CounterElements.Add((dummyTuple, instrCounters));\n        }\n      }\n\n      assemblyRanges.Add((rangeStart, rangeEnd));\n    }\n\n    document.ResumeUpdate();\n    processingResult.SortSampledElements(); // Used for ordering.\n    processingResult.FunctionCountersValue = sourceProcResult.FunctionCountersValue;\n    document.ProfileProcessingResult = processingResult;\n    return new SourceLineProfileResult(processingResult, sourceProcResult, dummyFunc,\n                                       lineToElementMap, lineToOriginalLineMap,\n                                       originalLineToLineMap, assemblyRanges, inserted);\n  }\n\n  public List<InlineeListItem> GenerateInlineeList(FunctionProcessingResult result) {\n    // Group the sample elements by the deepest inlinee they originate from.\n    // This computes the total time per inlinee and a list of elements associated with it.\n    var inlineeMap = new Dictionary<string, InlineeListItem>();\n\n    foreach (var pair in result.SampledElements) {\n      var element = pair.Item1;\n\n      if (!element.TryGetTag(out SourceLocationTag sourceTag) ||\n          !sourceTag.HasInlinees) {\n        continue;\n      }\n\n      for (int i = 0; i < sourceTag.Inlinees.Count; i++) {\n        var inlinee = sourceTag.Inlinees[i];\n\n        if (string.IsNullOrEmpty(inlinee.Function)) {\n          continue;\n        }\n\n        if (!inlineeMap.TryGetValue(inlinee.Function, out var inlineeItem)) {\n          inlineeItem = new InlineeListItem(inlinee);\n          inlineeMap[inlinee.Function] = inlineeItem;\n        }\n\n        inlineeItem.Weight += pair.Item2;\n        inlineeItem.ElementWeights.Add((element, pair.Item2));\n\n        if (i == 0) {\n          inlineeItem.ExclusiveWeight += pair.Item2;\n        }\n      }\n    }\n\n    // Sort by decreasing weight.\n    var inlineeList = inlineeMap.ToValueList();\n    inlineeList.Sort((a, b) => b.ExclusiveWeight.CompareTo(a.ExclusiveWeight));\n    return inlineeList;\n  }\n\n  public static void UpdateColumnStyle(OptionalColumn column, IRDocumentColumnData columnData,\n                                       FunctionIR function, IRDocument document,\n                                       ProfileDocumentMarkerSettings settings,\n                                       OptionalColumnSettings columnSettings) {\n#if DEBUG\n    Trace.WriteLine($\"Update column {column.ColumnName}, is main column: {column.IsMainColumn}\");\n#endif\n\n    column.IsVisible = columnSettings.IsColumnVisible(column);\n    var elementColorPairs = new List<ValueTuple<IRElement, Brush>>(function.TupleCount);\n    var cells = columnData.ColumnValues.GetValueOrNull(column);\n\n    // Empty columns don't have any values, ignore.\n    if (cells != null) {\n      foreach (var value in cells) {\n        value.BackColor = settings.PickDefaultBackColor(column);\n      }\n    }\n\n    foreach (var tuple in function.AllTuples) {\n      var value = columnData.GetColumnValue(tuple, column);\n      if (value == null)\n        continue;\n\n      int order = value.ValueOrder;\n      double percentage = value.ValuePercentage;\n\n      if (value.CanShowBackgroundColor) {\n        var color = settings.PickBackColor(column, order, percentage);\n\n        if (column.IsMainColumn && percentage >= settings.ElementWeightCutoff) {\n          elementColorPairs.Add(new ValueTuple<IRElement, Brush>(tuple, color));\n        }\n\n        // Don't override initial back color if no color is picked,\n        // mostly done for perf metrics column which have an initial back color.\n        if (!color.IsTransparent()) {\n          value.BackColor = color;\n        }\n      }\n\n      value.TextColor = settings.PickTextColor(column, order, percentage);\n      value.TextWeight = settings.PickTextWeight(column, order, percentage);\n\n      if (value.CanShowIcon) {\n        value.Icon = settings.PickIcon(column, value.ValueOrder, value.ValuePercentage).Icon;\n      }\n\n      value.ShowPercentageBar = value.CanShowPercentageBar && // Disabled per value\n                                settings.ShowPercentageBar(column, value.ValueOrder, value.ValuePercentage);\n      value.PercentageBarBackColor = settings.PickPercentageBarColor(column);\n      value.PercentageBarMaxWidth = settings.MaxPercentageBarWidth;\n    }\n\n    // Mark the elements themselves with a color.\n    if (column.IsMainColumn && document != null) {\n      document.ClearInstructionMarkers();\n\n      if (settings.MarkElements) {\n        document.MarkElements(elementColorPairs);\n      }\n    }\n  }\n\n  public void MarkCallSites(IRDocument document, FunctionIR function, IRTextFunction textFunction,\n                            SourceLineProfileResult processingResult) {\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n    bool hasInstrOffsetMetadata = metadataTag != null && metadataTag.OffsetToElementMap.Count > 0;\n\n    if (hasInstrOffsetMetadata) {\n      MarkCallSites(document, function, textFunction, metadataTag, processingResult);\n    }\n  }\n\n  private void MarkCallSites(IRDocument document, FunctionIR function, IRTextFunction textFunction,\n                             AssemblyMetadataTag metadataTag, SourceLineProfileResult processingResult = null,\n                             bool suspendUpdates = true) {\n    // Mark indirect call sites and list the hottest call targets.\n    // Useful especially for virtual function calls.\n    var callTree = globalProfile_.CallTree;\n\n    if (callTree == null || !settings_.MarkCallTargets) {\n      return;\n    }\n\n    var overlayMap = new Dictionary<IRElement, (List<ProfileCallTreeNode> List, bool HasIndirectCalls)>();\n    var node = callTree.GetCombinedCallTreeNode(textFunction);\n\n    if (node == null || !node.HasCallSites) {\n      return;\n    }\n\n    foreach (var callsite in node.CallSites.Values) {\n      if (!FunctionProfileData.TryFindElementForOffset(metadataTag, callsite.RVA - profile_.FunctionDebugInfo.RVA,\n                                                       irInfo_.IR, out var element)) {\n        continue;\n      }\n\n      //Trace.WriteLine($\"Found CS for elem at RVA {callsite.RVA}, weight {callsite.Weight}: {element}\");\n      var instr = element as InstructionIR;\n      if (instr == null || !irInfo_.IR.IsCallInstruction(instr))\n        continue;\n\n      // Mark direct, known call targets with a different icon.\n      var callTarget = irInfo_.IR.GetCallTarget(instr);\n      bool isDirectCall = callTarget is {HasName: true} &&\n                          !callTarget.HasTag<RegisterTag>();\n\n      // When annotating a source file, map the instruction to the\n      // fake tuple used the represent the source line.\n      if (processingResult != null) {\n        if (!instr.TryGetTag(out SourceLocationTag sourceTag)) {\n          continue; // Couldn't map for some reason, ignore.\n        }\n\n        // With assembly lines, source line numbers are shifted.\n        int sourceLine = sourceTag.Line;\n\n        if (processingResult.OriginalLineToLineMap.TryGetValue(sourceTag.Line, out int mappedLine)) {\n          sourceLine = mappedLine;\n        }\n\n        if (!processingResult.LineToElementMap.TryGetValue(sourceLine, out element)) {\n          continue; // Couldn't map for some reason, ignore.\n        }\n      }\n\n      // Collect call targets and override the weight\n      // to include only the weight at this call site.\n      if (!overlayMap.TryGetValue(element, out var pair)) {\n        pair = new ValueTuple<List<ProfileCallTreeNode>, bool>();\n        pair.List = new List<ProfileCallTreeNode>();\n        overlayMap[element] = pair;\n      }\n\n      // Mark if any of the calls are indirect.\n      if (!isDirectCall) {\n        pair.HasIndirectCalls = true;\n        overlayMap[element] = pair; // Update dictionary, since pair is a value type.\n      }\n\n      foreach (var target in callsite.SortedTargets) {\n        var callsiteNode = new ProfileCallTreeGroupNode(target.Node, target.Weight);\n        pair.List.Add(callsiteNode);\n      }\n    }\n\n    // Add the overlays to the document.\n    var indirectIcon = IconDrawing.FromIconResource(\"ExecuteIconColor\");\n    var directIcon = IconDrawing.FromIconResource(\"ExecuteIcon\");\n    var overlayListMap = new Dictionary<IElementOverlay, List<ProfileCallTreeNode>>();\n\n    if (suspendUpdates) {\n      document.SuspendUpdate();\n    }\n\n    foreach (var (element, pair) in overlayMap) {\n      var color = App.Settings.DocumentSettings.BackgroundColor;\n\n      if (element.ParentBlock != null && !element.ParentBlock.HasEvenIndexInFunction) {\n        color = App.Settings.DocumentSettings.AlternateBackgroundColor;\n      }\n\n      var icon = pair.HasIndirectCalls ? indirectIcon : directIcon;\n      var overlay = document.RegisterIconElementOverlay(element, icon, 16, 16);\n      overlay.Tag = ProfileOverlayTag;\n      overlay.Background = color.AsBrush();\n      overlay.IsLabelPinned = false;\n      overlay.AllowLabelEditing = false;\n      overlay.UseLabelBackground = true;\n      overlay.ShowBackgroundOnMouseOverOnly = true;\n      overlay.ShowBorderOnMouseOverOnly = true;\n      overlay.AlignmentX = HorizontalAlignment.Left;\n      overlay.MarginY = 2;\n      overlayListMap[overlay] = pair.List;\n\n      if (element is InstructionIR instr) {\n        // Place before the call opcode.\n        int lineOffset = instr.OpcodeLocation.Offset - instr.TextLocation.Offset;\n        overlay.MarginX = Utils.MeasureString(lineOffset, Utils.GetTextTypeface(document),\n                                              document.FontSize).Width - 20;\n      }\n    }\n\n    // Show a popup on hover with the list of call targets.\n    SetupCallSiteHoverPreview(overlayListMap, document);\n\n    if (suspendUpdates) {\n      document.ResumeUpdate();\n    }\n  }\n\n  private void SetupCallSiteHoverPreview(Dictionary<IElementOverlay, List<ProfileCallTreeNode>> overlayListMap,\n                                         IRDocument document) {\n    // The overlay hover preview is somewhat of a hack,\n    // since the hover event is fired over the entire document,\n    // but the popup should be shown only if mouse is over the overlay.\n    var view = document as UIElement;\n    CallTreeNodePopup popup = null;\n    (IElementOverlay Overlay, List<ProfileCallTreeNode> List) hoveredOverlay = (null, null);\n\n    // Create a single hover handler for all overlays.\n    var preview = new PopupHoverPreview(\n      view, HoverPreview.HoverDuration,\n      (mousePoint, previewPoint) => {\n        if (hoveredOverlay.Overlay == null) {\n          return null; // Nothing actually hovered.\n        }\n\n        if (popup == null) {\n          var dummy = new DummyFunctionProfileInfoProvider();\n          popup = new CallTreeNodePopup(null, dummy, previewPoint, view,\n                                        document.Session);\n          popup.TitleText = \"Call Targets\";\n        }\n        else {\n          popup.UpdatePosition(previewPoint, view);\n        }\n\n        popup.ShowFunctions(hoveredOverlay.List, irInfo_.NameProvider.FormatFunctionName);\n        return popup;\n      },\n      (mousePoint, popup) => true,\n      popup => {\n        document.Session.RegisterDetachedPanel(popup);\n      });\n\n    foreach (var pair in overlayListMap) {\n      pair.Key.OnHover += (sender, e) => {\n        hoveredOverlay.Overlay = sender as IElementOverlay;\n        hoveredOverlay.List = overlayListMap[hoveredOverlay.Overlay];\n      };\n\n      pair.Key.OnHoverEnd += (sender, e) => {\n        preview.HideDelayed();\n        hoveredOverlay = (null, null);\n      };\n    }\n\n    document.RegisterHoverPreview(preview);\n  }\n\n  private void MarkProfiledBlocks(List<(BlockIR, TimeSpan)> blockWeights, IRDocument document, bool suspendUpdates) {\n    if (!settings_.MarkBlocks) {\n      return;\n    }\n\n    if (suspendUpdates) {\n      document.SuspendUpdate();\n    }\n\n    double overlayHeight = document.DefaultLineHeight;\n    var blockPen = ColorPens.GetPen(settings_.BlockOverlayBorderColor,\n                                    settings_.BlockOverlayBorderThickness);\n\n    for (int i = 0; i < blockWeights.Count; i++) {\n      var block = blockWeights[i].Item1;\n      var weight = blockWeights[i].Item2;\n      double weightPercentage = profile_.ScaleWeight(weight);\n\n      var icon = settings_.PickIconForOrder(i, weightPercentage);\n      var color = settings_.PickBackColorForPercentage(weightPercentage);\n\n      if (color.IsTransparent()) {\n        // Match the background color of the corresponding text line.\n        color = block.HasEvenIndexInFunction ?\n          App.Settings.DocumentSettings.BackgroundColor.AsBrush() :\n          App.Settings.DocumentSettings.AlternateBackgroundColor.AsBrush();\n      }\n\n      bool markOnFlowGraph = settings_.IsSignificantValue(i, weightPercentage);\n      string label = $\"{weightPercentage.AsTrimmedPercentageString()}\";\n      string tooltip = settings_.FormatWeightValue(weight);\n      var overlay = document.RegisterIconElementOverlay(block, icon, 0, overlayHeight, label, tooltip);\n      overlay.Tag = ProfileOverlayTag;\n      overlay.Background = color;\n      overlay.Border = blockPen;\n      overlay.IsLabelPinned = true;\n      overlay.AllowLabelEditing = false;\n      overlay.UseLabelBackground = true;\n      overlay.ShowBackgroundOnMouseOverOnly = false;\n      overlay.ShowBorderOnMouseOverOnly = false;\n      overlay.AlignmentX = HorizontalAlignment.Left;\n      overlay.MarginX = -1;\n      overlay.Padding = 2;\n      (overlay.TextColor, overlay.TextWeight) = settings_.PickBlockOverlayStyle(i, weightPercentage);\n\n      // Mark the block itself with a color.\n      document.MarkBlock(block, color, markOnFlowGraph);\n\n      if (settings_.MarkBlocksInFlowGraph &&\n          weightPercentage > settings_.ElementWeightCutoff) {\n        block.AddTag(GraphNodeTag.MakeColor(weightPercentage.AsTrimmedPercentageString(),\n                                            ((SolidColorBrush)color).Color,\n                                            ((SolidColorBrush)overlay.TextColor).Color,\n                                            ((SolidColorBrush)overlay.TextColor).Color,\n                                            i < 3 || weightPercentage >= 0.1)); // Bold text for >10%.\n      }\n    }\n\n    if (suspendUpdates) {\n      document.ResumeUpdate();\n    }\n  }\n\n  private async Task<IRDocumentColumnData>\n    MarkProfiledElements(FunctionProcessingResult result,\n                         FunctionIR function, IRDocument document) {\n    // Add a time column.\n    var elements = result.SampledElements;\n    var columnData = new IRDocumentColumnData(function.InstructionCount);\n    var percentageColumn = columnData.AddColumn(TimePercentageColumnTemplate());\n    var timeColumn = columnData.AddColumn(TimeColumnTemplate());\n    percentageColumn.IsMainColumn = true;\n\n    await Task.Run(() => {\n      for (int i = 0; i < elements.Count; i++) {\n        var element = elements[i].Item1;\n        var weight = elements[i].Item2;\n        double weightPercentage = profile_.ScaleWeight(weight);\n\n        string label = settings_.FormatWeightValue(weight);\n        string percentageLabel = weightPercentage.AsTrimmedPercentageString();\n        var columnValue = new ElementColumnValue(label, weight.Ticks, weightPercentage, i);\n        var percentageColumnValue = new ElementColumnValue(percentageLabel, weight.Ticks, weightPercentage, i);\n        columnValue.ToolTip = percentageLabel;\n        percentageColumnValue.ToolTip = label;\n\n        columnData.AddValue(percentageColumnValue, element, percentageColumn);\n        var valueGroup = columnData.AddValue(columnValue, element, timeColumn);\n        //? valueGroup.BackColor = Brushes.Bisque;\n      }\n    });\n\n    // Handle performance counter columns.\n    var counterElements = result.CounterElements;\n\n    if (counterElements.Count == 0) {\n      SetupColumnHeaderEvents(function, document, columnData);\n      return columnData;\n    }\n\n    var perfCounters = globalProfile_.SortedPerformanceCounters;\n    var counterColumns = new OptionalColumn[perfCounters.Count];\n    var counterSortMap = new List<List<CounterSortHelper>>();\n\n    await Task.Run(() => {\n      // Add a column for each counter.\n      for (int k = 0; k < perfCounters.Count; k++) {\n        CreatePerfCounterColumn(function, document, columnData,\n                                perfCounters, counterColumns, k);\n      }\n\n      // Build lists, sort lists by value, then go over lists and assign ValueOrder.\n      for (int k = 0; k < perfCounters.Count; k++) {\n        counterSortMap.Add(new List<CounterSortHelper>(counterElements.Count));\n      }\n\n      for (int i = 0; i < counterElements.Count; i++) {\n        var element = counterElements[i].Item1;\n        var counterSet = counterElements[i].Item2;\n\n        for (int k = 0; k < perfCounters.Count; k++) {\n          var counter = perfCounters[k];\n          long value = 0;\n          double valuePercentage = 0;\n          string label = \"\";\n          string tooltip = null;\n          bool isValueBasedMetric = false;\n\n          if (counter.IsMetric) {\n            var metric = counter as PerformanceMetric;\n            valuePercentage = metric.ComputeMetric(counterSet, out long baseValue, out long relativeValue);\n\n            // Don't show metrics for counters with few hits,\n            // they tend to be the ones that are the most inaccurate.\n            double metricBasePercentage = result.ScaleCounterValue(baseValue, metric.BaseCounter);\n\n            if (metricBasePercentage > 0.01) {\n              label = FormatPerformanceMetric(valuePercentage, metric);\n              value = (long)(valuePercentage * 10000);\n              isValueBasedMetric = !metric.Config.IsPercentage;\n              tooltip = \"Per instruction\";\n            }\n            else {\n              valuePercentage = 0;\n            }\n          }\n          else {\n            value = counterSet.FindCounterValue(counter);\n\n            if (value == 0) {\n              continue;\n            }\n\n            valuePercentage = result.ScaleCounterValue(value, counter);\n            label = valuePercentage.AsTrimmedPercentageString();\n            tooltip = FormatPerformanceCounter(value, counter);\n          }\n\n          //? TODO: Could have a config for all/per-counter to pick % or value as label\n          //var label = $\"{value * counter.Interval}\";\n          var columnValue = new ElementColumnValue(label, value, valuePercentage, i, tooltip);\n          columnValue.ValuePercentage = valuePercentage;\n          columnValue.CanShowPercentageBar = !isValueBasedMetric &&\n                                             valuePercentage >= settings_.ElementWeightCutoff;\n          columnData.AddValue(columnValue, element, counterColumns[k]);\n\n          var counterValueList = counterSortMap[k];\n          counterValueList.Add(new CounterSortHelper(columnValue, value));\n        }\n      }\n    });\n\n    // Sort the counters from each column in decreasing order,\n    // then assign the ValueOrder for each counter based on the sorting index.\n    for (int k = 0; k < perfCounters.Count; k++) {\n      var counterValueList = counterSortMap[k];\n      counterValueList.Sort((a, b) => -a.Value.CompareTo(b.Value));\n\n      for (int i = 0; i < counterValueList.Count; i++) {\n        counterValueList[i].ColumnValue.ValueOrder = i;\n      }\n    }\n\n    SetupColumnHeaderEvents(function, document, columnData);\n    return columnData;\n  }\n\n  public void UpdateColumnStyles(IRDocumentColumnData columnData,\n                                 FunctionIR function, IRDocument document) {\n    document.SuspendUpdate();\n\n    foreach (var column in columnData.Columns) {\n      UpdateColumnStyle(column, columnData, function, document, settings_, columnSettings_);\n    }\n\n    document.ResumeUpdate();\n  }\n\n  private void SetupColumnHeaderEvents(FunctionIR function, IRDocument document,\n                                       IRDocumentColumnData columnData) {\n    foreach (var column in columnData.Columns) {\n      column.HeaderClickHandler += ColumnHeaderClickHandler(document, function, columnData);\n    }\n  }\n\n  private void CreatePerfCounterColumn(FunctionIR function, IRDocument document,\n                                       IRDocumentColumnData columnData, List<PerformanceCounter> perfCounters,\n                                       OptionalColumn[] counterColumns, int k) {\n    var counterInfo = perfCounters[k];\n    counterColumns[k] = CounterColumnTemplate(counterInfo, k);\n    counterColumns[k].IsVisible = IsPerfCounterVisible(counterInfo);\n    counterColumns[k].PerformanceCounter = counterInfo;\n    columnData.AddColumn(counterColumns[k]);\n  }\n\n  private OptionalColumnEventHandler ColumnHeaderClickHandler(IRDocument document, FunctionIR function,\n                                                              IRDocumentColumnData columnData) {\n    return (column, columnHeader) => {\n      var currentMainColumn = columnData.MainColumn;\n\n      if (column == currentMainColumn) {\n        return;\n      }\n\n      if (currentMainColumn != null) {\n        currentMainColumn.IsMainColumn = false;\n        UpdateColumnStyle(currentMainColumn, columnData, function, document, settings_, columnSettings_);\n      }\n\n      column.IsMainColumn = true;\n      UpdateColumnStyle(column, columnData, function, document, settings_, columnSettings_);\n    };\n  }\n\n  private class DummyFunctionProfileInfoProvider : IFunctionProfileInfoProvider {\n    public List<ProfileCallTreeNode> GetBacktrace(ProfileCallTreeNode node) {\n      return new List<ProfileCallTreeNode>();\n    }\n\n    public (List<ProfileCallTreeNode>, List<ModuleProfileInfo> Modules) GetTopFunctionsAndModules(\n      ProfileCallTreeNode node) {\n      return new ValueTuple<List<ProfileCallTreeNode>, List<ModuleProfileInfo>>();\n    }\n\n    public List<ModuleProfileInfo> GetTopModules(ProfileCallTreeNode node) {\n      return new List<ModuleProfileInfo>();\n    }\n  }\n\n  private struct CounterSortHelper {\n    public ElementColumnValue ColumnValue;\n    public long Value;\n\n    public CounterSortHelper(ElementColumnValue columnValue, long value) {\n      ColumnValue = columnValue;\n      Value = value;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfileHistoryManager.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Profile.Processing;\n\nnamespace ProfileExplorer.UI;\n\npublic class ProfileHistoryManager {\n  private Stack<ProfileFunctionState> prevFunctionsStack_;\n  private Stack<ProfileFunctionState> nextFunctionsStack_;\n  private bool ignoreNextSaveFunctionState_;\n  private Func<ProfileFunctionState> saveStateHandler_;\n  private Action stateChangeHandler_;\n\n  public ProfileHistoryManager(Func<ProfileFunctionState> saveStateHandler,\n                               Action stateChangeHandler) {\n    prevFunctionsStack_ = new Stack<ProfileFunctionState>();\n    nextFunctionsStack_ = new Stack<ProfileFunctionState>();\n    saveStateHandler_ = saveStateHandler;\n    stateChangeHandler_ = stateChangeHandler;\n  }\n\n  public bool HasNextStates => nextFunctionsStack_.Count > 0;\n  public bool HasPreviousStates => prevFunctionsStack_.Count > 0;\n  public Stack<ProfileFunctionState> PreviousFunctions => prevFunctionsStack_;\n  public Stack<ProfileFunctionState> NextFunctions => nextFunctionsStack_;\n\n  public void SaveCurrentState() {\n    SaveCurrentFunctionState(prevFunctionsStack_);\n  }\n\n  public ProfileFunctionState PopPreviousState() {\n    if (prevFunctionsStack_.Count == 0) {\n      return null;\n    }\n\n    // Save current function in the forward history.\n    var state = prevFunctionsStack_.Pop();\n    SaveCurrentFunctionState(nextFunctionsStack_);\n    ignoreNextSaveFunctionState_ = true;\n    stateChangeHandler_();\n    return state;\n  }\n\n  public ProfileFunctionState PopNextState() {\n    if (nextFunctionsStack_.Count == 0) {\n      return null;\n    }\n\n    // Save current function in the backward history.\n    var state = nextFunctionsStack_.Pop();\n    SaveCurrentFunctionState(prevFunctionsStack_);\n    ignoreNextSaveFunctionState_ = true;\n    stateChangeHandler_();\n    return state;\n  }\n\n  private void SaveCurrentFunctionState(Stack<ProfileFunctionState> stack) {\n    if (ignoreNextSaveFunctionState_) {\n      // Don't add to the history the function\n      // from which the going back action was started.\n      ignoreNextSaveFunctionState_ = false;\n    }\n    else {\n      var state = saveStateHandler_();\n\n      if (state == null) {\n        return;\n      }\n\n      // Don't duplicate the state.\n      if (stack.Count == 0 || !stack.Peek().Equals(state)) {\n        stack.Push(state);\n        stateChangeHandler_();\n      }\n    }\n  }\n\n  public void RevertToState(ProfileFunctionState state) {\n    // Add the current state in the next stack,\n    // plus all stats from the previous stack up to selected state.\n    SaveCurrentFunctionState(nextFunctionsStack_);\n\n    while (prevFunctionsStack_.Peek() != state) {\n      var skippedState = prevFunctionsStack_.Pop();\n      nextFunctionsStack_.Push(skippedState);\n    }\n\n    prevFunctionsStack_.Pop();\n    ignoreNextSaveFunctionState_ = true;\n    stateChangeHandler_();\n  }\n\n  public void ClearPreviousStates() {\n    prevFunctionsStack_.Clear();\n  }\n\n  public void ClearNextStates() {\n    nextFunctionsStack_.Clear();\n  }\n\n  public void Reset() {\n    prevFunctionsStack_.Clear();\n    nextFunctionsStack_.Clear();\n    ignoreNextSaveFunctionState_ = false;\n  }\n}\n\npublic class ProfileFunctionState {\n  public ProfileFunctionState(IRTextSection section, FunctionIR function,\n                              ReadOnlyMemory<char> text,\n                              ProfileSampleFilter profileFilter) {\n    Section = section;\n    Function = function;\n    Text = text;\n    ProfileFilter = profileFilter;\n  }\n\n  public IRTextSection Section { get; set; }\n  public FunctionIR Function { get; set; }\n  public ReadOnlyMemory<char> Text { get; set; }\n  public ProfileSampleFilter ProfileFilter { get; set; }\n  public TimeSpan Weight { get; set; }\n  public ParsedIRTextSection ParsedSection => new(Section, Text, Function);\n\n  protected bool Equals(ProfileFunctionState other) {\n    return Equals(Section, other.Section);\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj))\n      return false;\n    if (ReferenceEquals(this, obj))\n      return true;\n    if (obj.GetType() != GetType())\n      return false;\n    return Equals((ProfileFunctionState)obj);\n  }\n\n  public override int GetHashCode() {\n    return Section != null ? Section.GetHashCode() : 0;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfileIRDocument.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Profile.Document.ProfileIRDocument\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:document=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"300\"\n  d:DesignWidth=\"500\"\n  mc:Ignorable=\"d\">\n  <UserControl.Resources>\n    <Style\n      x:Key=\"ColumnsGridSplitterStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"2\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding ColumnsVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"ColumnsStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"*\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding ColumnsVisible}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding UseCompactProfilingColumns}\"\n          Value=\"True\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"100\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n  </UserControl.Resources>\n  <UserControl.CommandBindings>\n    <CommandBinding\n      Command=\"ProfileExplorerUi:DocumentHostCommand.JumpToProfiledElement\"\n      Executed=\"JumpToProfiledElementExecuted\" />\n    <CommandBinding\n      CanExecute=\"JumpToNextProfiledElementCanExecute\"\n      Command=\"ProfileExplorerUi:DocumentHostCommand.JumpToNextProfiledElement\"\n      Executed=\"JumpToNextProfiledElementExecuted\" />\n    <CommandBinding\n      CanExecute=\"JumpToPreviousProfiledElementCanExecute\"\n      Command=\"ProfileExplorerUi:DocumentHostCommand.JumpToPreviousProfiledElement\"\n      Executed=\"JumpToPreviousProfiledElementExecuted\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:DocumentHostCommand.ExportFunctionProfile\"\n      Executed=\"ExportSourceExecuted\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:DocumentHostCommand.ExportFunctionProfileHTML\"\n      Executed=\"ExportSourceHtmlExecuted\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:DocumentHostCommand.ExportFunctionProfileMarkdown\"\n      Executed=\"ExportSourceMarkdownExecuted\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:DocumentHostCommand.CopySelectedLinesAsHTML\"\n      Executed=\"CopySelectedLinesAsHtmlExecuted\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:DocumentHostCommand.CopySelectedText\"\n      Executed=\"CopySelectedTextExecuted\" />\n  </UserControl.CommandBindings>\n  <Grid>\n    <Grid.ColumnDefinitions>\n      <ColumnDefinition Width=\"2*\" />\n      <ColumnDefinition Style=\"{StaticResource ColumnsGridSplitterStyle}\" />\n      <ColumnDefinition Style=\"{StaticResource ColumnsStyle}\" />\n    </Grid.ColumnDefinitions>\n\n    <DockPanel\n      Grid.Column=\"0\"\n      LastChildFill=\"True\">\n      <Border\n        Height=\"23\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n        BorderThickness=\"0,1,0,1\"\n        DockPanel.Dock=\"Top\"\n        Visibility=\"{Binding ColumnsVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <ToolBarTray\n          x:Name=\"ProfileToolbar\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Stretch\"\n          Background=\"{DynamicResource {x:Static SystemColors.MenuBarBrushKey}}\"\n          IsLocked=\"True\">\n          <ToolBar\n            Height=\"22\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.MenuBarBrushKey}}\"\n            Loaded=\"ToolBar_Loaded\">\n            <Menu\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\">\n              <MenuItem\n                x:Name=\"ProfileElementsMenu\"\n                Margin=\"0,0,0,0\"\n                Padding=\"0,0,0,0\"\n                OverridesDefaultStyle=\"True\"\n                ToolTip=\"View sorted list of hottest lines\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <TextBlock\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"Profile\" />\n                    <Path\n                      Margin=\"4,2,0,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n              </MenuItem>\n            </Menu>\n            <Button\n              Margin=\"4,0,0,0\"\n              Padding=\"0\"\n              VerticalAlignment=\"Center\"\n              Command=\"ProfileExplorerUi:DocumentHostCommand.JumpToProfiledElement\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Jump to hottest profiled line (Ctrl+H)\"\n              Visibility=\"{Binding ProfileVisible, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <Image\n                Source=\"{StaticResource HotFlameIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </Button>\n            <Button\n              Margin=\"2,0,0,0\"\n              Padding=\"0\"\n              Command=\"ProfileExplorerUi:DocumentHostCommand.JumpToPreviousProfiledElement\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Jump to previous less hot line (Shift+F2)\">\n              <Image\n                Source=\"{StaticResource MinusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </Button>\n            <Button\n              Margin=\"0,0,2,0\"\n              Padding=\"0\"\n              Command=\"ProfileExplorerUi:DocumentHostCommand.JumpToNextProfiledElement\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              ToolTip=\"Jump to next hotter line (F2)\">\n              <Image\n                Source=\"{StaticResource PlusIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n            </Button>\n            <Separator\n              Visibility=\"{Binding IsSourceFileDocument, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n            <Menu\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\"\n              ToolTip=\"View sorted list of inlined functions\"\n              Visibility=\"{Binding IsSourceFileDocument, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n              <MenuItem\n                x:Name=\"InlineesMenu\"\n                Margin=\"0,0,0,0\"\n                Padding=\"0,0,0,0\"\n                OverridesDefaultStyle=\"True\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Source=\"{StaticResource TreeIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"2,0,0,0\"\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"Inlinees\" />\n                    <Path\n                      Margin=\"4,2,2,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n                <MenuItem\n                  Header=\"Non-Inlinee\"\n                  IsCheckable=\"False\"\n                  Style=\"{DynamicResource SubMenuItemHeaderStyle}\"\n                  ToolTip=\"Time for parts not originating from inlined functions\" />\n                <Separator />\n              </MenuItem>\n            </Menu>\n            <Separator />\n            <Menu\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\"\n              ToolTip=\"View outline of main source code statements and their associated time\">\n              <MenuItem\n                x:Name=\"OutlineMenu\"\n                Margin=\"0,0,0,0\"\n                Padding=\"0,0,0,0\"\n                Background=\"{Binding Path=HasProfileInstanceFilter, Converter={StaticResource BooToParameter}, ConverterParameter=#B4D4F4}\"\n                OverridesDefaultStyle=\"True\"\n                Visibility=\"{Binding IsSourceFileDocument, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Source=\"{StaticResource FlowChartSolidIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"2,0,0,0\"\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"Outline\" />\n                    <Path\n                      Margin=\"4,2,2,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n              </MenuItem>\n            </Menu>\n            <Menu\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\"\n              ToolTip=\"Select function instances to display\">\n              <MenuItem\n                x:Name=\"InstancesMenu\"\n                Margin=\"0,0,0,0\"\n                Padding=\"0,0,0,0\"\n                Background=\"{Binding Path=HasProfileInstanceFilter, Converter={StaticResource BooToParameter}, ConverterParameter=#B4D4F4}\"\n                OverridesDefaultStyle=\"True\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Source=\"{StaticResource TasklistIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"2,0,0,0\"\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"Instances\" />\n                    <Path\n                      Margin=\"4,2,2,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n                <MenuItem\n                  Click=\"InstanceMenuItem_OnClick\"\n                  Header=\"All Instances\"\n                  IsCheckable=\"False\"\n                  IsChecked=\"{Binding RemoveEmptyColumns}\"\n                  Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                <Separator />\n              </MenuItem>\n            </Menu>\n            <Menu\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\">\n              <MenuItem\n                x:Name=\"ThreadsMenu\"\n                Margin=\"0,0,0,0\"\n                Padding=\"0,0,0,0\"\n                Background=\"{Binding Path=HasProfileThreadFilter, Converter={StaticResource BooToParameter}, ConverterParameter=#B4D4F4}\"\n                OverridesDefaultStyle=\"True\"\n                ToolTip=\"Select threads the function ran on to display\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Height=\"15\"\n                      Source=\"{StaticResource FilterIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"2,0,0,0\"\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"Threads\" />\n                    <Path\n                      Margin=\"4,2,2,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n                <MenuItem\n                  Click=\"ThreadMenuItem_OnClick\"\n                  Header=\"All Threads\"\n                  IsCheckable=\"False\"\n                  Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                <Separator />\n              </MenuItem>\n            </Menu>\n            <Separator />\n            <Menu\n              Margin=\"2,0,2,0\"\n              VerticalAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n              <MenuItem\n                Padding=\"0,0,0,0\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n                OverridesDefaultStyle=\"True\"\n                ToolTip=\"Export function list\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <TextBlock\n                      Margin=\"2,0,0,0\"\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"Export\" />\n                    <Path\n                      Margin=\"4,2,0,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n                <MenuItem\n                  Command=\"ProfileExplorerUi:DocumentHostCommand.ExportFunctionProfile\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Export as Excel File\"\n                  ToolTip=\"Save the document lines and additional columns as an Excel worksheet\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource ExcelIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"ProfileExplorerUi:DocumentHostCommand.ExportFunctionProfileHTML\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Export as HTML File\"\n                  ToolTip=\"Save the document lines and additional columns as an HTML file\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource SourceIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <MenuItem\n                  Command=\"ProfileExplorerUi:DocumentHostCommand.ExportFunctionProfileMarkdown\"\n                  CommandTarget=\"{Binding ElementName=TextView}\"\n                  Header=\"Export as Markdown File\"\n                  ToolTip=\"Save the document lines and additional columns as a Markdown file\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource DocumentIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n                <Separator />\n                <MenuItem\n                  Command=\"{Binding CopyDocumentCommand}\"\n                  CommandTarget=\"{Binding ElementName=FunctionList}\"\n                  Header=\"Copy as HTML/Markdown table\"\n                  ToolTip=\"Copy the document lines and additional columns as an HTML file\">\n                  <MenuItem.Icon>\n                    <Image\n                      Width=\"16\"\n                      Height=\"16\"\n                      Source=\"{StaticResource ClipboardIcon}\" />\n                  </MenuItem.Icon>\n                </MenuItem>\n              </MenuItem>\n            </Menu>\n            <Menu\n              Margin=\"2,0,0,0\"\n              VerticalAlignment=\"Center\"\n              Visibility=\"{Binding IsPreviewDocument, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n              <MenuItem\n                x:Name=\"ProfileViewMenu\"\n                Margin=\"0,0,0,0\"\n                Padding=\"0,0,0,0\"\n                OverridesDefaultStyle=\"True\"\n                ToolTip=\"Configure displayed profiling columns\">\n                <MenuItem.Header>\n                  <StackPanel Orientation=\"Horizontal\">\n                    <Image\n                      Source=\"{StaticResource EyeIcon}\"\n                      Style=\"{StaticResource DisabledImageStyle}\" />\n                    <TextBlock\n                      Margin=\"4,0,0,0\"\n                      VerticalAlignment=\"Bottom\"\n                      Text=\"View\" />\n                    <Path\n                      Margin=\"4,2,0,0\"\n                      VerticalAlignment=\"Center\"\n                      Data=\"M 0 0 L 3 3 L 6 0 Z\"\n                      Fill=\"Black\" />\n                  </StackPanel>\n                </MenuItem.Header>\n                <MenuItem\n                  x:Name=\"ViewMenuItem1\"\n                  Header=\"Show Performance Counters\"\n                  IsCheckable=\"True\"\n                  IsChecked=\"{Binding ShowPerformanceCounterColumns}\"\n                  Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                <MenuItem\n                  x:Name=\"ViewMenuItem2\"\n                  Header=\"Show Performance Metrics\"\n                  IsCheckable=\"True\"\n                  IsChecked=\"{Binding ShowPerformanceMetricColumns}\"\n                  Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                <MenuItem\n                  x:Name=\"ViewMenuItem3\"\n                  Header=\"Hide Empty Columns\"\n                  IsCheckable=\"True\"\n                  IsChecked=\"{Binding RemoveEmptyColumns}\"\n                  Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n                <Separator />\n                <MenuItem\n                  Header=\"Columns\"\n                  IsEnabled=\"False\"\n                  IsHitTestVisible=\"False\"\n                  Style=\"{DynamicResource SubMenuItemHeaderStyle}\" />\n              </MenuItem>\n            </Menu>\n          </ToolBar>\n        </ToolBarTray>\n      </Border>\n\n      <ProfileExplorerUi:IRDocument\n        x:Name=\"TextView\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n        DockPanel.Dock=\"Bottom\"\n        FontFamily=\"Consolas\"\n        FontSize=\"12\"\n        HorizontalScrollBarVisibility=\"Auto\"\n        ShowLineNumbers=\"True\"\n        SyntaxHighlighting=\"C++\"\n        VerticalScrollBarVisibility=\"Auto\">\n        <ProfileExplorerUi:IRDocument.ContextMenu>\n          <ContextMenu>\n            <MenuItem\n              Command=\"ProfileExplorerUi:DocumentHostCommand.CopySelectedLinesAsHTML\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              Header=\"Copy Selection Details\"\n              InputGestureText=\"Ctrl+C\"\n              ToolTip=\"Copy the selected text and additional profiling columns as a HTML table\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource ClipboardIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"ProfileExplorerUi:DocumentHostCommand.CopySelectedText\"\n              CommandTarget=\"{Binding ElementName=TextView}\"\n              Header=\"Copy Text\"\n              InputGestureText=\"Ctrl+Shift+C\"\n              ToolTip=\"Copy the selected text only\" />\n          </ContextMenu>\n        </ProfileExplorerUi:IRDocument.ContextMenu>\n      </ProfileExplorerUi:IRDocument>\n    </DockPanel>\n\n    <GridSplitter\n      Grid.Column=\"1\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n      ResizeBehavior=\"PreviousAndNext\" />\n\n    <document:DocumentColumns\n      x:Name=\"ProfileColumns\"\n      Grid.Column=\"2\"\n      Padding=\"-1,0,0,0\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Visibility=\"{Binding ColumnsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n  </Grid>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfileIRDocument.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Threading;\nusing ICSharpCode.AvalonEdit.Folding;\nusing ICSharpCode.AvalonEdit.Highlighting;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.SourceParser;\nusing ProfileExplorer.UI.Document;\nusing ProtoBuf;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.CallTree;\n\nnamespace ProfileExplorer.UI.Profile.Document;\n\npublic partial class ProfileIRDocument : UserControl, INotifyPropertyChanged {\n  private List<(IRElement, TimeSpan)> profileElements_;\n  private int profileElementIndex_;\n  private SourceLineProcessingResult sourceProcessingResult_;\n  private SourceLineProfileResult sourceProfileResult_;\n  private bool columnsVisible_;\n  private bool ignoreNextCaretEvent_;\n  private bool disableCaretEvent_;\n  private bool selectedLines_;\n  private ReadOnlyMemory<char> originalSourceText_;\n  private ReadOnlyMemory<char> sourceText_;\n  private bool hasProfileInfo_;\n  private Brush selectedLineBrush_;\n  private TextViewSettingsBase settings_;\n  private ProfileDocumentMarker profileMarker_;\n  private bool isPreviewDocument_;\n  private bool isSourceFileDocument_;\n  private ProfileSampleFilter profileFilter_;\n  private CancelableTaskInstance loadTask_;\n  private SourceCodeLanguage sourceLanguage_;\n  private ProfileHistoryManager historyManager_;\n  private RangeColorizer assemblyColorizer_;\n  private SourceStackFrame inlinee_;\n  private bool ignoreNextRowSelectedEvent_;\n  private MenuItem[] viewMenuItems_;\n\n  public ProfileIRDocument() {\n    InitializeComponent();\n    UpdateDocumentStyle();\n    SetupEvents();\n    ShowPerformanceCounterColumns = true;\n    ShowPerformanceMetricColumns = true;\n    DataContext = this;\n    loadTask_ = new CancelableTaskInstance(false);\n    profileFilter_ = new ProfileSampleFilter();\n    historyManager_ = new ProfileHistoryManager(() =>\n                                                  new ProfileFunctionState(TextView.Section, TextView.Function,\n                                                                           TextView.SectionText, profileFilter_),\n                                                () => {\n                                                  FunctionHistoryChanged?.Invoke(this, EventArgs.Empty);\n                                                });\n    viewMenuItems_ = new[] {\n      ViewMenuItem1,\n      ViewMenuItem2,\n      ViewMenuItem3\n    };\n  }\n\n  public IUISession Session { get; set; }\n  public IRTextSection Section => TextView.Section;\n\n  public ProfileSampleFilter ProfileFilter {\n    get => profileFilter_;\n    set {\n      if (value == null) {\n        profileFilter_ = new ProfileSampleFilter();\n      }\n      else {\n        profileFilter_ = value.Clone(); // Clone to detect changes later.\n      }\n\n      UpdateProfileFilterUI();\n      ProfilingUtils.SyncInstancesMenuWithFilter(InstancesMenu, profileFilter_);\n      ProfilingUtils.SyncThreadsMenuWithFilter(ThreadsMenu, profileFilter_);\n    }\n  }\n\n  public bool HasProfileInfo {\n    get => hasProfileInfo_;\n    set => SetField(ref hasProfileInfo_, value);\n  }\n\n  public bool UseCompactProfilingColumns { get; set; }\n  public bool ShowPerformanceCounterColumns { get; set; }\n  public bool ShowPerformanceMetricColumns { get; set; }\n\n  public bool UseSmallerFontSize {\n    get => ProfileColumns.UseSmallerFontSize;\n    set => ProfileColumns.UseSmallerFontSize = value;\n  }\n\n  public bool ColumnsVisible {\n    get => columnsVisible_;\n    set => SetField(ref columnsVisible_, value);\n  }\n\n  public bool IsPreviewDocument {\n    get => isPreviewDocument_;\n    set => SetField(ref isPreviewDocument_, value);\n  }\n\n  public bool IsSourceFileDocument {\n    get => isSourceFileDocument_;\n    set => SetField(ref isSourceFileDocument_, value);\n  }\n\n  public Brush SelectedLineBrush {\n    get => selectedLineBrush_;\n    set => SetField(ref selectedLineBrush_, value);\n  }\n\n  public bool HasPreviousFunctions => historyManager_.HasPreviousStates;\n  public bool HasNextFunctions => historyManager_.HasNextStates;\n  public bool HasProfileInstanceFilter => profileFilter_ is {HasInstanceFilter: true};\n  public bool HasProfileThreadFilter => profileFilter_ is {HasThreadFilter: true};\n  public RelayCommand<object> CopyDocumentCommand => new(async obj => {\n    await CopyAllLinesAsHtml();\n  });\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void SetupEvents() {\n    TextView.CaretChanged += TextView_CaretChanged;\n    TextView.TextArea.TextView.ScrollOffsetChanged += TextViewOnScrollOffsetChanged;\n    TextView.TextArea.SelectionChanged += TextAreaOnSelectionChanged;\n    ProfileColumns.ScrollChanged += ProfileColumns_ScrollChanged;\n    ProfileColumns.RowSelected += ProfileColumns_RowSelected;\n    TextView.TextRegionFolded += TextViewOnTextRegionFolded;\n    TextView.TextRegionUnfolded += TextViewOnTextRegionUnfolded;\n    TextView.PreviewMouseDown += TextView_PreviewMouseDown;\n    TextView.PreviewMouseUp += TextView_PreviewMouseUp;\n    TextView.FunctionCallOpen += TextViewOnFunctionCallOpen;\n    PreviewKeyDown += TextView_PreviewKeyDown;\n    Loaded += (sender, args) => {\n      // Due to WPF layout update quirks, when the document is displayed\n      // in a popup that was just created, redo some UI actions once loaded.\n      if (TextView.IsLoaded) {\n        if (settings_.ProfileMarkerSettings.JumpToHottestElement) {\n          JumpToHottestProfiledElement(true);\n        }\n\n        TextView.Redraw();\n      }\n    };\n  }\n\n  private async void TextView_PreviewKeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Back) {\n      if (Utils.IsKeyboardModifierActive()) {\n        await LoadNextSection();\n      }\n      else {\n        await LoadPreviousSection();\n      }\n    }\n    else if (e.Key == Key.C && Utils.IsControlModifierActive()) {\n      // Override Ctrl+C to copy instruction details instead of just text,\n      // but not if Shift/Alt key is also pressed, copy plain text then.\n      if (!Utils.IsAltModifierActive() &&\n          !Utils.IsShiftModifierActive() &&\n          !TextView.HandleOverlayKeyPress(e)) { // Send to overlays first.\n        await CopySelectedLinesAsHtml();\n        e.Handled = true;\n      }\n    }\n    else if (e.Key == Key.H && Utils.IsControlModifierActive()) {\n      JumpToHottestProfiledElement();\n    }\n    else if (e.Key == Key.F2) {\n      if (Utils.IsShiftModifierActive()) {\n        JumpToProfiledElement(1);\n      }\n      else {\n        JumpToProfiledElement(-1);\n      }\n    }\n  }\n\n  private async void TextView_PreviewMouseDown(object sender, MouseButtonEventArgs e) {\n    // Handle the back/forward mouse buttons\n    // to navigate through the function history.\n    if (e.ChangedButton == MouseButton.XButton1) {\n      e.Handled = true;\n      await LoadPreviousSection();\n    }\n    else if (e.ChangedButton == MouseButton.XButton2) {\n      e.Handled = true;\n      await LoadNextSection();\n    }\n    else if (e.ChangedButton == MouseButton.Left) {\n      // Disable selecting the assembly lines associated with the source line\n      // during a selection of multiple lines.\n      disableCaretEvent_ = true;\n      selectedLines_ = false;\n    }\n  }\n\n  private async void TextView_PreviewMouseUp(object sender, MouseButtonEventArgs e) {\n    if (e.ChangedButton == MouseButton.Left) {\n      if (!selectedLines_) {\n        // No multi-line selection was done,\n        // select assembly lines associated with the source line.\n        HighlightElementsOnSelectedLine();\n      }\n\n      disableCaretEvent_ = false;\n      selectedLines_ = false;\n    }\n  }\n\n  public async Task LoadPreviousSection() {\n    var state = historyManager_.PopPreviousState();\n\n    if (state != null) {\n      await LoadPreviousSectionState(state);\n    }\n  }\n\n  public async Task LoadNextSection() {\n    var state = historyManager_.PopNextState();\n\n    if (state != null) {\n      await LoadPreviousSectionState(state);\n    }\n  }\n\n  private async Task LoadPreviousSectionState(ProfileFunctionState state) {\n    await LoadAssembly(state.ParsedSection, state.ProfileFilter);\n  }\n\n  private async void TextViewOnFunctionCallOpen(object sender, IRTextSection targetSection) {\n    var targetFunc = targetSection.ParentFunction;\n    ProfileSampleFilter targetFilter = null;\n\n    if (profileFilter_ is {IncludesAll: false}) {\n      targetFilter = profileFilter_.CloneForCallTarget(targetFunc);\n    }\n\n    historyManager_.ClearNextStates(); // Reset forward history.\n    var parsedSection = await Session.LoadAndParseSection(targetFunc.Sections[0]);\n\n    if (parsedSection != null) {\n      await LoadAssembly(parsedSection, targetFilter);\n    }\n  }\n\n  public event EventHandler<string> TitlePrefixChanged;\n  public event EventHandler<string> TitleSuffixChanged;\n  public event EventHandler<string> DescriptionPrefixChanged;\n  public event EventHandler<string> DescriptionSuffixChanged;\n  public event EventHandler<ParsedIRTextSection> LoadedFunctionChanged;\n  public event EventHandler<int> LineSelected;\n  public event EventHandler FunctionHistoryChanged;\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  public async Task<bool> LoadAssembly(ParsedIRTextSection parsedSection,\n                                       ProfileSampleFilter profileFilter = null) {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (TextView.IsLoaded && !IsSourceFileDocument) {\n      historyManager_.SaveCurrentState();\n    }\n\n    ResetInstance();\n    IsSourceFileDocument = false;\n    await TextView.LoadSection(parsedSection);\n\n    // Apply profile filter if needed.\n    ProfileFilter = profileFilter;\n    bool success = true;\n\n    if (!parsedSection.LoadFailed) {\n      if (profileFilter is {IncludesAll: false}) {\n        success = await LoadAssemblyProfileInstance(parsedSection);\n      }\n      else {\n        success = await LoadAssemblyProfile(parsedSection);\n      }\n    }\n    else {\n      success = false;\n    }\n\n    if (!success) {\n      await HideProfile();\n      return false;\n    }\n\n    LoadedFunctionChanged?.Invoke(this, parsedSection);\n    return true;\n  }\n\n  private async Task HideProfile() {\n    HasProfileInfo = false;\n    ColumnsVisible = false;\n    ResetProfilingMenus();\n  }\n\n  private void ResetProfilingMenus() {\n    DocumentUtils.RemoveNonDefaultMenuItems(ProfileElementsMenu);\n    DocumentUtils.RemoveNonDefaultMenuItems(InstancesMenu);\n    DocumentUtils.RemoveNonDefaultMenuItems(ThreadsMenu);\n    DocumentUtils.RemoveNonDefaultMenuItems(InlineesMenu);\n  }\n\n  private async Task<bool> LoadAssemblyProfile(ParsedIRTextSection parsedSection,\n                                               bool reloadFilterMenus = true) {\n    var funcProfile = Session.ProfileData?.GetFunctionProfile(parsedSection.ParentFunction);\n\n    if (funcProfile == null) {\n      return false;\n    }\n\n    await MarkAssemblyProfile(parsedSection, funcProfile);\n    CreateProfileElementMenus(funcProfile);\n\n    if (reloadFilterMenus) {\n      CreateProfileFilterMenus(parsedSection.Section, funcProfile);\n    }\n\n    return true;\n  }\n\n  private void CreateProfileElementMenus(FunctionProfileData funcProfile) {\n    if (TextView.ProfileProcessingResult != null) {\n      if (!isSourceFileDocument_) {\n        var inlineeList = profileMarker_.GenerateInlineeList(TextView.ProfileProcessingResult);\n        ProfilingUtils.CreateInlineesMenu(InlineesMenu, Section, inlineeList,\n                                          funcProfile, InlineeMenuItem_OnClick, settings_, Session);\n      }\n\n      CreateProfileElementMenu(funcProfile, TextView.ProfileProcessingResult);\n    }\n  }\n\n  private async Task<bool> LoadAssemblyProfileInstance(ParsedIRTextSection parsedSection,\n                                                       bool reloadFilterMenus = true) {\n    UpdateProfileFilterUI();\n    var instanceProfile = await ComputeInstanceProfile();\n    var funcProfile = instanceProfile.GetFunctionProfile(parsedSection.ParentFunction);\n\n    if (funcProfile == null) {\n      return false;\n    }\n\n    await MarkAssemblyProfile(parsedSection, funcProfile);\n    CreateProfileElementMenus(funcProfile);\n\n    if (reloadFilterMenus) {\n      CreateProfileFilterMenus(parsedSection.Section, funcProfile);\n    }\n\n    return true;\n  }\n\n  private async Task<ProfileData> ComputeInstanceProfile() {\n    return await LongRunningAction.Start(\n      async () => await Task.Run(() => Session.ProfileData.\n                                   ComputeProfile(Session.ProfileData, profileFilter_, false)),\n      TimeSpan.FromMilliseconds(500),\n      \"Filtering function instance\", this, Session);\n  }\n\n  private async Task<bool> LoadSourceFileProfileInstance(IRTextSection section,\n                                                         bool reloadFilterMenus = true,\n                                                         bool jumpToHottestLine = true) {\n    UpdateProfileFilterUI();\n    var instanceProfile = await ComputeInstanceProfile();\n    var funcProfile = instanceProfile.GetFunctionProfile(section.ParentFunction);\n\n    if (funcProfile == null) {\n      return false;\n    }\n\n    if (!await MarkSourceFileProfile(section, funcProfile, jumpToHottestLine)) {\n      return false;\n    }\n\n    CreateProfileElementMenus(funcProfile);\n\n    if (reloadFilterMenus) {\n      CreateProfileFilterMenus(section, funcProfile);\n    }\n\n    return true;\n  }\n\n  private async Task MarkAssemblyProfile(ParsedIRTextSection parsedSection, FunctionProfileData funcProfile) {\n    ResetInstanceProfiling();\n    profileMarker_ = new ProfileDocumentMarker(funcProfile, Session.ProfileData,\n                                               settings_.ProfileMarkerSettings,\n                                               settings_.ColumnSettings, Session.CompilerInfo);\n    await profileMarker_.Mark(TextView, parsedSection.Function,\n                              parsedSection.ParentFunction);\n\n    if (settings_.ProfileMarkerSettings.JumpToHottestElement) {\n      JumpToHottestProfiledElement(true);\n    }\n\n    UpdateProfileFilterUI();\n    UpdateProfileDescription(funcProfile);\n    await UpdateProfilingColumns();\n  }\n\n  private void UpdateProfileFilterUI() {\n    OnPropertyChanged(nameof(HasProfileInstanceFilter));\n    OnPropertyChanged(nameof(HasProfileThreadFilter));\n  }\n\n  private void UpdateProfileDescription(FunctionProfileData funcProfile) {\n    DescriptionPrefixChanged?.Invoke(this, ProfilingUtils.\n                                       CreateProfileFunctionDescription(funcProfile, settings_.ProfileMarkerSettings,\n                                                                        Session));\n    TitlePrefixChanged?.Invoke(this, ProfilingUtils.\n                                 CreateProfileFilterTitle(profileFilter_, Session));\n    DescriptionSuffixChanged?.Invoke(this, ProfilingUtils.\n                                       CreateProfileFilterDescription(profileFilter_, Session));\n  }\n\n  private string MakeSyntaxNodePreviewText(string text, int maxLength) {\n    if (string.IsNullOrEmpty(text)) {\n      return \"\";\n    }\n\n    // Extract until either a new line or the max length is reached.\n    int i = 0;\n\n    while (i < text.Length && text[i] != '\\n') {\n      i++;\n    }\n\n    i = Math.Min(i, maxLength);\n\n    if (i == 0) return null;\n\n    if (i <= text.Length) {\n      return text.Substring(0, i).Trim();\n    }\n    else {\n      return $\"{text.Substring(0, i)}...\".Trim();\n    }\n  }\n\n  private List<ProfileSourceSyntaxNode>\n    PrepareSourceSyntaxTree(string sourceText, SourceLineProcessingResult sourceProcessingResult,\n                            SourceLineProfileResult sourceProfileResult,\n                            SourceCodeLanguage sourceLanguage) {\n    var parser = new SourceCodeParser(sourceLanguage);\n    var tree = parser.Parse(sourceText);\n    if (tree == null) return null;\n\n    var funcTreeNoe = tree.FindFunctionNode(sourceProcessingResult.FirstLineIndex);\n\n    if (funcTreeNoe == null) {\n      Trace.WriteLine($\"Couldn't find function in the syntax tree at line {sourceProcessingResult.FirstLineIndex}\");\n      return null;\n    }\n\n    // Trace.WriteLine(\"-------------------------------------------\");\n    // Trace.WriteLine(\"Source Syntax Tree:\");\n    // Trace.WriteLine($\"{funcTreeNoe.Print()}\");\n\n    var profileNodes = new List<ProfileSourceSyntaxNode>();\n    var profileNodeMap = new Dictionary<SourceSyntaxNode, ProfileSourceSyntaxNode>();\n\n    funcTreeNoe.WalkNodes((node, depth) => {\n      IRElement startElement = null;\n      var weight = TimeSpan.Zero;\n      var counters = new PerformanceCounterValueSet();\n      List<IRElement> elements = new();\n\n      // Collect the elements for the source lines that are part of the node\n      // and accumulate the weight of the source lines.\n      int startLine = node.Start.Line;\n      int endLine = node.End.Line;\n\n      // For if statements, the syntax node covers the line range\n      // of any any other nested if/else statements, but here consider\n      // only the lines in the \"then\" part of the if statement.\n      if (node.Kind == SourceSyntaxNodeKind.If) {\n        var elseNode = node.GetChildOfKind(SourceSyntaxNodeKind.Else);\n\n        if (elseNode != null) {\n          var thenNode = node.GetChildOfKind(SourceSyntaxNodeKind.Compound);\n\n          if (thenNode != null) {\n            endLine = thenNode.End.Line;\n            node.End = thenNode.End;\n          }\n          else {\n            endLine = elseNode.Start.Line;\n            node.End = elseNode.Start;\n          }\n        }\n      }\n\n      // Accumulate profile values in range.\n      for (int line = startLine; line <= endLine; line++) {\n        int mappedLine = MapFromOriginalSourceLineNumber(line);\n\n        if (sourceProfileResult.LineToElementMap.TryGetValue(mappedLine, out var element)) {\n          startElement ??= element;\n          elements.Add(element);\n\n          if (sourceProcessingResult.SourceLineWeight.TryGetValue(line, out var w)) {\n            weight += w;\n          }\n\n          if (sourceProcessingResult.SourceLineCounters.TryGetValue(line, out var c)) {\n            counters.Add(c);\n          }\n        }\n      }\n\n      // Create a profile node for the syntax node,\n      // except for nodes that are not interesting.\n      ProfileSourceSyntaxNode profileNode = null;\n\n      if (startElement != null &&\n          node.Kind != SourceSyntaxNodeKind.Compound &&\n          node.Kind != SourceSyntaxNodeKind.Condition &&\n          node.Kind != SourceSyntaxNodeKind.Other) {\n        profileNode = new ProfileSourceSyntaxNode(node) {\n          Weight = weight,\n          Counters = counters,\n          StartElement = startElement,\n          Elements = elements\n        };\n\n        // Connect node to the parent (because some nodes are skipped,\n        // parent may not be the direct parent from the syntax tree).\n        var parentNode = node.ParentNode;\n\n        while (parentNode != null) {\n          if (profileNodeMap.TryGetValue(parentNode, out var nodeParent)) {\n            profileNode.Parent = nodeParent;\n            profileNode.Level = nodeParent.Level + 1;\n            break;\n          }\n\n          parentNode = parentNode.ParentNode;\n        }\n\n        profileNodes.Add(profileNode);\n        profileNodeMap[node] = profileNode;\n      }\n\n      // Distinguish between the body and the whole statement\n      // by recording the weight of the body part too.\n      if (profileNode != null &&\n          node.ParentNode != null &&\n          profileNodeMap.TryGetValue(node.ParentNode, out var parent)) {\n        if (node.ParentNode.Kind == SourceSyntaxNodeKind.If ||\n            node.ParentNode.Kind == SourceSyntaxNodeKind.ElseIf) {\n          if (node.Kind == SourceSyntaxNodeKind.Condition) {\n            parent.ConditionWeight = weight;\n            parent.BodyWeight = parent.Weight - weight;\n          }\n        }\n\n        if (node.ParentNode.Kind == SourceSyntaxNodeKind.Else) {\n          // Replace an else { if } pair with an IfElse statement.\n          if (node.Kind == SourceSyntaxNodeKind.If) {\n            node.Kind = SourceSyntaxNodeKind.ElseIf;\n            node.Start = node.ParentNode.Start; // Include the \"else\" text.\n            profileNode.Level = parent.Level;\n            profileNodeMap.Remove(node.ParentNode);\n            profileNodes.Remove(parent);\n          }\n        }\n        else if (node.ParentNode.Kind == SourceSyntaxNodeKind.Else) {\n          if (node.Kind == SourceSyntaxNodeKind.Else) {\n            parent.BodyWeight = weight;\n          }\n        }\n        else if (node.ParentNode.Kind == SourceSyntaxNodeKind.Loop) {\n          if (node.Kind == SourceSyntaxNodeKind.Condition) {\n            parent.ConditionWeight = weight;\n          }\n          else if (node.Kind == SourceSyntaxNodeKind.Compound) {\n            parent.BodyWeight = weight;\n          }\n        }\n      }\n\n      return true;\n    });\n\n    return profileNodes;\n  }\n\n  private int MapFromOriginalSourceLineNumber(int line) {\n    // Map from original line to adjusted line with assembly.\n    if (sourceProfileResult_ != null) {\n      if (sourceProfileResult_.OriginalLineToLineMap.TryGetValue(line, out int mappedLine)) {\n        return mappedLine;\n      }\n\n      return -1; // Line is assembly.\n    }\n\n    return line;\n  }\n\n  private int MapToOriginalSourceLineNumber(int line) {\n    // Map from original line to adjusted line with assembly.\n    if (sourceProfileResult_ != null) {\n      if (sourceProfileResult_.LineToOriginalLineMap.TryGetValue(line, out int mappedLine)) {\n        return mappedLine;\n      }\n\n      return -1; // Line is assembly.\n    }\n\n    return line;\n  }\n\n  public async Task<bool> LoadSourceFile(SourceFileDebugInfo sourceInfo,\n                                         IRTextSection section,\n                                         ProfileSampleFilter profileFilter = null,\n                                         SourceStackFrame inlinee = null,\n                                         SourceFileState previousState = null) {\n    try {\n      using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n      ResetInstance();\n      IsSourceFileDocument = true;\n\n      string text = await File.ReadAllTextAsync(sourceInfo.FilePath);\n      SetSourceText(text, sourceInfo.FilePath);\n\n      // Apply profile filter if needed.\n      ProfileFilter = profileFilter;\n      inlinee_ = inlinee;\n      ignoreNextCaretEvent_ = true;\n      bool success = true;\n\n      // When applying profile, jump to hottest line\n      // only if the vertical offset is 0.\n      double horizontalOffset = 0;\n      double verticalOffset = 0;\n\n      if (previousState != null) {\n        horizontalOffset = previousState.HorizontalOffset;\n        verticalOffset = previousState.VerticalOffset;\n      }\n\n      bool jumpToHottestLine = verticalOffset < double.Epsilon;\n\n      if (profileFilter is {IncludesAll: false}) {\n        success = await LoadSourceFileProfileInstance(section);\n      }\n      else {\n        success = await LoadSourceFileProfile(section, true, jumpToHottestLine);\n      }\n\n      if (!success) {\n        await HideProfile();\n        return true; // Only profile part failed, keep text.\n      }\n\n      //? TODO: Is panel is not visible, scroll doesn't do anything,\n      //? should be executed again when panel is activated.\n      if (previousState != null && !jumpToHottestLine) {\n        if (previousState.AssemblyFoldingStates != null) {\n          RestoreFoldingsState(previousState.AssemblyFoldingStates);\n        }\n\n        Dispatcher.BeginInvoke(() => {\n          TextView.ScrollToHorizontalOffset(horizontalOffset);\n          TextView.ScrollToVerticalOffset(verticalOffset);\n        }, DispatcherPriority.Render);\n      }\n      else if (!settings_.ProfileMarkerSettings.JumpToHottestElement) {\n        (int firstSourceLineIndex, int lastSourceLineIndex) =\n          await DocumentUtils.FindFunctionSourceLineRange(section.ParentFunction, TextView);\n\n        if (firstSourceLineIndex != 0) {\n          SelectLine(firstSourceLineIndex);\n        }\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load source file {sourceInfo.FilePath}: {ex.Message}\");\n      Trace.TraceError(ex.StackTrace);\n      Trace.Flush();\n      return false;\n    }\n  }\n\n  public async Task HandleMissingSourceFile(string failureText) {\n    string text = \"Failed to load source file.\";\n\n    if (!string.IsNullOrEmpty(failureText)) {\n      text += $\"\\n{failureText}\";\n    }\n\n    TextView.UnloadDocument();\n    SetSourceText(text, \"\");\n    await HideProfile();\n  }\n\n  private async Task<bool> LoadSourceFileProfile(IRTextSection section, bool reloadFilterMenus = true,\n                                                 bool jumpToHottestLine = true) {\n    var funcProfile = Session.ProfileData?.GetFunctionProfile(section.ParentFunction);\n\n    if (funcProfile == null) {\n      return false;\n    }\n\n    if (!await MarkSourceFileProfile(section, funcProfile, jumpToHottestLine)) {\n      return false;\n    }\n\n    if (reloadFilterMenus) {\n      CreateProfileFilterMenus(section, funcProfile);\n    }\n\n    return true;\n  }\n\n  private void CreateProfileFilterMenus(IRTextSection section, FunctionProfileData funcProfile) {\n    ProfilingUtils.CreateInstancesMenu(InstancesMenu, section, funcProfile,\n                                       InstanceMenuItem_OnClick,\n                                       InstanceMenuItem_OnRightClick,\n                                       settings_, Session);\n    ProfilingUtils.CreateThreadsMenu(ThreadsMenu, section, funcProfile,\n                                     ThreadMenuItem_OnClick, settings_, Session);\n    ProfilingUtils.SyncInstancesMenuWithFilter(InstancesMenu, profileFilter_);\n    ProfilingUtils.SyncThreadsMenuWithFilter(ThreadsMenu, profileFilter_);\n  }\n\n  private async Task<bool> MarkSourceFileProfile(IRTextSection section,\n                                                 FunctionProfileData funcProfile,\n                                                 bool jumpToHottestLine = true) {\n    ResetInstanceProfiling();\n    profileMarker_ = new ProfileDocumentMarker(funcProfile, Session.ProfileData,\n                                               settings_.ProfileMarkerSettings,\n                                               settings_.ColumnSettings,\n                                               Session.CompilerInfo);\n    // Accumulate the instruction weight for each source line.\n    var sourceLineProfileResult = await Task.Run(async () => {\n      var debugInfo = await Session.GetDebugInfoProvider(section.ParentFunction).ConfigureAwait(false);\n      return funcProfile.ProcessSourceLines(debugInfo, Session.CompilerInfo.IR, inlinee_);\n    });\n\n    // Clear markers when switching between ASM/source modes.\n    if (TextView.IsLoaded) {\n      TextView.ClearInstructionMarkers();\n    }\n\n    // Insert assembly lines corresponding to each source code line,\n    // grouped as a code folding that can be hidden.\n    bool showAssemblyLines = ((SourceFileSettings)settings_).ShowInlineAssembly;\n    bool showSourceStatements = ((SourceFileSettings)settings_).ShowSourceStatements;\n    ParsedIRTextSection parsedSection = null;\n\n    if (showAssemblyLines) {\n      // In case of changing the instance, start again from\n      // the original source code text when inserting the assembly lines.\n      TextView.Text = originalSourceText_.ToString();\n      sourceText_ = originalSourceText_;\n      parsedSection = await Session.LoadAndParseSection(section);\n    }\n\n    // Create a dummy FunctionIR that has fake tuples representing each\n    // source line, with the profiling data attached to the tuples.\n    var processingResult = await profileMarker_.\n      PrepareSourceLineProfile(funcProfile, TextView,\n                               sourceLineProfileResult, parsedSection);\n\n    if (processingResult == null) {\n      return false;\n    }\n\n    sourceProcessingResult_ = sourceLineProfileResult;\n    sourceProfileResult_ = processingResult;\n\n    // Parse the source code to get the syntax tree nodes.\n    List<ProfileSourceSyntaxNode> syntaxNodes = null;\n\n    if (showSourceStatements) {\n      syntaxNodes = await Task.Run(() =>\n                                     PrepareSourceSyntaxTree(sourceText_.ToString(), sourceLineProfileResult,\n                                                             processingResult, sourceLanguage_));\n    }\n\n    // Replace the text after the assembly lines were inserted.\n    if (showAssemblyLines) {\n      sourceText_ = TextView.Text.AsMemory();\n    }\n\n    // Load the dummy section with the source lines.\n    var dummyParsedSection = new ParsedIRTextSection(section, sourceText_, processingResult.Function);\n    await TextView.LoadSection(dummyParsedSection, true);\n    CreateProfileElementMenus(funcProfile);\n\n    // Annotate the source lines with the profiling data based on the code statements.\n    if (syntaxNodes != null) {\n      await MarkSourceFileStructure(syntaxNodes, processingResult,\n                                    originalSourceText_, section.ParentFunction);\n    }\n\n    TextView.SuspendUpdate();\n    await profileMarker_.MarkSourceLines(TextView, processingResult);\n\n    // Annotate call sites next to source lines by parsing the actual section\n    // and mapping back the call sites to the dummy elements representing the source lines.\n\n    if (parsedSection != null) {\n      profileMarker_.MarkCallSites(TextView, parsedSection.Function,\n                                   section.ParentFunction, processingResult);\n    }\n\n    TextView.ResumeUpdate();\n\n    if (syntaxNodes != null) {\n      PatchSourceStructureRows(syntaxNodes, funcProfile);\n    }\n\n    if (jumpToHottestLine &&\n        settings_.ProfileMarkerSettings.JumpToHottestElement) {\n      JumpToHottestProfiledElement(true);\n    }\n\n    UpdateProfileFilterUI();\n    UpdateProfileDescription(funcProfile);\n    await UpdateProfilingColumns();\n\n    if (showAssemblyLines) {\n      SetupSourceAssembly(processingResult);\n    }\n\n    return true;\n  }\n\n  private async Task MarkSourceFileStructure(List<ProfileSourceSyntaxNode> nodes,\n                                             SourceLineProfileResult sourceProfileResult,\n                                             ReadOnlyMemory<char> sourceText, IRTextFunction function) {\n    var profileItems = new List<ProfileMenuItem>();\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings_.ProfileMarkerSettings;\n    var funcProfile = Session.ProfileData.GetFunctionProfile(function);\n    double maxWidth = 0;\n\n    OutlineMenu.Items.Clear();\n\n    foreach (var node in nodes) {\n      MarkSourceSyntaxNode(node, sourceProfileResult, funcProfile, markerSettings);\n\n      // Build outline menu.\n      double weightPercentage = funcProfile.ScaleWeight(node.Weight);\n\n      if (!markerSettings.IsVisibleValue(weightPercentage)) {\n        continue;\n      }\n\n      // Append | chars for alignment based on node level.\n      string nesting = \"\";\n\n      for (int i = 0; i < node.Level - 1; i++) {\n        nesting += \" \\u250A   \";\n      }\n\n      int CountDigits(int number) {\n        int count = 1;\n\n        while (number >= 10) {\n          count++;\n          number /= 10;\n        }\n\n        return count;\n      }\n\n      // Append node start line number.\n      string line = node.Kind != SourceSyntaxNodeKind.Function ? node.Start.Line.ToString() : \"\";\n      line = line.PadRight(CountDigits(TextView.LineCount));\n\n      string nodeText = null;\n\n      if (node.SyntaxNode.Kind == SourceSyntaxNodeKind.Function) {\n        nodeText = function.FormatFunctionName(Session);\n      }\n      else {\n        nodeText = node.SyntaxNode.GetText(sourceText);\n      }\n\n      string preview = MakeSyntaxNodePreviewText(nodeText, 50);\n      string title = $\"{line} {nesting}{node.GetTextIcon()} {preview}\";\n      string tooltip = nodeText;\n      string nodeTitle = $\"({markerSettings.FormatWeightValue(node.Weight)})\";\n\n      var value = new ProfileMenuItem(nodeTitle, node.Weight.Ticks, weightPercentage) {\n        PrefixText = title,\n        ToolTip = tooltip,\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = node.Kind != SourceSyntaxNodeKind.Function ?\n          markerSettings.PickTextWeight(weightPercentage) : FontWeights.Normal,\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      node.SetTextStyle(value);\n\n      var item = new MenuItem {\n        Tag = node,\n        Header = value,\n        IsEnabled = node.Kind != SourceSyntaxNodeKind.Function,\n        HeaderTemplate = valueTemplate,\n        Style = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\")\n      };\n\n      // Set mouse events for jump and hover.\n      item.Click += (sender, args) => {\n        if (sender is MenuItem menuItem &&\n            menuItem.Tag is ProfileSourceSyntaxNode syntaxNode) {\n          TextView.SelectLine(syntaxNode.StartElement.TextLocation.Line + 1);\n        }\n      };\n\n      item.MouseEnter += (sender, args) => {\n        if (sender is MenuItem menuItem &&\n            menuItem.Tag is ProfileSourceSyntaxNode syntaxNode) {\n          SelectSyntaxNodeLineRange(syntaxNode);\n        }\n      };\n\n      item.MouseLeave += (sender, args) => {\n        TextView.ClearSelectedElements();\n      };\n\n      profileItems.Add(value);\n      OutlineMenu.Items.Add(item);\n      double width = Utils.MeasureString(title, settings_.FontName, settings_.FontSize).Width;\n      maxWidth = Math.Max(width, maxWidth);\n    }\n\n    foreach (var value in profileItems) {\n      value.MinTextWidth = maxWidth;\n    }\n  }\n\n  private void MarkSourceSyntaxNode(ProfileSourceSyntaxNode node,\n                                    SourceLineProfileResult sourceProfileResult, FunctionProfileData funcProfile,\n                                    ProfileDocumentMarkerSettings markerSettings) {\n    if (!node.IsMarkedNode ||\n        node.StartElement == null) return;\n\n    // Show statement time in the columns, but only if\n    // it doesn't replace a large enough value already associated with the line.\n    int existingIndex = sourceProfileResult.Result.SampledElements.FindIndex((item) => item.Item1 == node.StartElement);\n    bool replaceOnlyInsignificant = ((SourceFileSettings)settings_).ReplaceInsignificantSourceStatements;\n    bool failedReplaceAttempt = false;\n    bool mark = true;\n\n    if (existingIndex != -1) {\n      var existingWeight = sourceProfileResult.Result.SampledElements[existingIndex].Item2;\n      double existingWeightPercentage = funcProfile.ScaleWeight(existingWeight);\n\n      mark = !replaceOnlyInsignificant || // Always replace.\n             !markerSettings.IsVisibleValue(existingWeightPercentage, 2.0);\n      failedReplaceAttempt = !mark;\n\n      if (mark) {\n        sourceProfileResult.Result.SampledElements.RemoveAt(existingIndex);\n        sourceProfileResult.Result.CounterElements.RemoveAll((item) => item.Item1 == node.StartElement);\n      }\n    }\n\n    if (mark) {\n      node.ShowInDocumentColumns = true;\n      sourceProfileResult.Result.SampledElements.Add((node.StartElement, node.Weight));\n\n      if (node.Counters is {Count: > 0}) {\n        sourceProfileResult.Result.CounterElements.Add((node.StartElement, node.Counters));\n      }\n    }\n\n    bool showStatementOverlays = ((SourceFileSettings)settings_).ShowSourceStatementsOnMargin;\n\n    if (showStatementOverlays || failedReplaceAttempt && replaceOnlyInsignificant) {\n      CreateFileStructureOverlay(node, funcProfile, markerSettings);\n    }\n  }\n\n  private void CreateFileStructureOverlay(ProfileSourceSyntaxNode node,\n                                          FunctionProfileData funcProfile,\n                                          ProfileDocumentMarkerSettings markerSettings) {\n    double weightPercentage = funcProfile.ScaleWeight(node.Weight);\n    var color = App.Settings.DocumentSettings.BackgroundColor;\n\n    if (node.StartElement.ParentBlock != null &&\n        !node.StartElement.ParentBlock.HasEvenIndexInFunction) {\n      color = App.Settings.DocumentSettings.AlternateBackgroundColor;\n    }\n\n    string label =\n      $\"{node.GetKindText()}: {weightPercentage.AsPercentageString()} ({node.Weight.AsMillisecondsString()})\";\n    string overalyTooltip = node.GetTooltip(funcProfile);\n    var overlay = TextView.RegisterIconElementOverlay(node.StartElement, node.GetIcon(), 16, 16,\n                                                      label, overalyTooltip, true);\n    overlay.Tag = node;\n    overlay.Background = color.AsBrush();\n    overlay.IsLabelPinned = false;\n    overlay.AllowLabelEditing = false;\n    overlay.UseLabelBackground = true;\n    overlay.ShowBackgroundOnMouseOverOnly = true;\n    overlay.ShowBorderOnMouseOverOnly = true;\n    overlay.AlignmentX = HorizontalAlignment.Left;\n    overlay.MarginY = 2;\n    (overlay.TextColor, overlay.TextWeight) = markerSettings.PickBlockOverlayStyle(weightPercentage);\n\n    overlay.OnHover += (s, e) => {\n      if (node.Elements != null) {\n        SelectSyntaxNodeLineRange(node);\n      }\n    };\n\n    overlay.OnHoverEnd += (sender, args) => {\n      TextView.ClearSelectedElements();\n    };\n\n    if (node.StartElement is InstructionIR instr) {\n      // Place before the call opcode.\n      int lineOffset = instr.OpcodeLocation.Offset - instr.TextLocation.Offset;\n      overlay.MarginX = Utils.MeasureString(lineOffset, Utils.GetTextTypeface(TextView),\n                                            TextView.FontSize).Width - 20;\n    }\n  }\n\n  private void PatchSourceStructureRows(List<ProfileSourceSyntaxNode> nodes, FunctionProfileData funcProfile) {\n    // Override icons and tooltips for each row that corresponds\n    // to a source code statement like for/if.\n    var sourceColumnData = TextView.ProfileColumnData;\n\n    if (sourceColumnData.GetColumn(ProfileDocumentMarker.TimePercentageColumnDefinition) is var timeColumn) {\n      foreach (var node in nodes) {\n        if (node.StartElement == null || !node.IsMarkedNode ||\n            !node.ShowInDocumentColumns) {\n          continue;\n        }\n\n        var row = sourceColumnData.GetValues(node.StartElement);\n        if (row == null) continue;\n\n        foreach (var pair in row.ColumnValues) {\n          bool showIcon = Equals(pair.Key, timeColumn);\n          var cell = pair.Value;\n\n          if (showIcon) {\n            // Override default icon.\n            cell.Icon = node.GetIcon()?.Icon;\n          }\n\n          cell.CanShowIcon = false; // Disable auto-icon.\n          cell.ToolTip = node.GetTooltip(funcProfile);\n          cell.CanShowPercentageBar = false;\n          cell.CanShowBackgroundColor = false;\n          row.Tag = node;\n        }\n      }\n    }\n\n    // Select statement line range when hovering over the column cell.\n    ProfileColumns.RowHoverStart += (sender, value) => {\n      if (value.Tag is ProfileSourceSyntaxNode node) {\n        SelectSyntaxNodeLineRange(node);\n      }\n    };\n\n    ProfileColumns.RowHoverStop += (sender, value) => {\n      TextView.ClearSelectedElements();\n    };\n  }\n\n  private void SelectSyntaxNodeLineRange(ProfileSourceSyntaxNode node) {\n    var selectionColor = ColorBrushes.GetTransparentBrush(settings_.SelectedValueColor, 0.5);\n    TextView.SelectElementsInLineRange(node.Start.Line, node.End.Line,\n                                       MapFromOriginalSourceLineNumber);\n  }\n\n  private void SetupSourceAssembly(SourceLineProfileResult processingResult) {\n    // Replace the default line number left margin with one\n    // that doesn't number the assembly lines, to keep same line numbers\n    // with the original source file.\n    var lineNumbers = new SourceLineNumberMargin(TextView, processingResult);\n    TextView.SetupCustomLineNumbers(lineNumbers);\n\n    // Create the block foldings for each source line and its assembly section.\n    bool defaultClosed = !((SourceFileSettings)settings_).AutoExpandInlineAssembly;\n    SetupSourceAssemblyFolding(defaultClosed);\n\n    // Change the text color of the assembly section to be the same\n    // (the source syntax highlighting may mark some ASM opcodes for ex).\n    var asmFont = new Typeface(TextView.FontFamily, FontStyles.Normal, FontWeights.Normal, FontStretches.Normal);\n    assemblyColorizer_ = new RangeColorizer(processingResult.AssemblyRanges,\n                                            ((SourceFileSettings)settings_).AssemblyTextColor.AsBrush(),\n                                            ((SourceFileSettings)settings_).AssemblyBackColor.AsBrush(), asmFont);\n    TextView.RegisterTextTransformer(assemblyColorizer_);\n  }\n\n  private void SetupSourceAssemblyFolding(bool defaultClosed) {\n    FoldingElementGenerator.TextBrush = ColorBrushes.Transparent;\n    var foldingStrategy = new RangeFoldingStrategy(sourceProfileResult_.AssemblyRanges, defaultClosed);\n    var foldings = TextView.SetupCustomBlockFolding(foldingStrategy);\n\n    // Sync the initial folding status in the columns with the document.\n    ProfileColumns.SetupFoldedTextRegions(foldings);\n  }\n\n  private List<bool> SaveFoldingsState() {\n    var foldings = TextView.BlockFoldings;\n    var list = new List<bool>();\n\n    if (foldings != null) {\n      foreach (var folding in foldings) {\n        list.Add(folding.IsFolded);\n      }\n    }\n\n    return list;\n  }\n\n  private void RestoreFoldingsState(List<bool> foldingStates) {\n    var foldings = TextView.BlockFoldings;\n\n    if (foldings == null) {\n      return;\n    }\n\n    int index = 0;\n\n    foreach (var folding in foldings) {\n      if (index == foldingStates.Count) {\n        break;\n      }\n\n      folding.IsFolded = foldingStates[index];\n      index++;\n    }\n\n    // Sync the initial folding status in the columns with the document.\n    ProfileColumns.SetupFoldedTextRegions(foldings);\n  }\n\n  public void SaveSectionState(IToolPanel panel) {\n    var state = new SourceFileState {\n      HorizontalOffset = TextView.HorizontalOffset,\n      VerticalOffset = TextView.VerticalOffset,\n      AssemblyFoldingStates = SaveFoldingsState()\n    };\n    byte[] data = UIStateSerializer.Serialize(state);\n    Session.SavePanelState(data, panel, Section);\n  }\n\n  private async Task ApplyProfileFilter() {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (isSourceFileDocument_) {\n      if (profileFilter_ is {IncludesAll: false}) {\n        await LoadSourceFileProfileInstance(TextView.Section, false);\n      }\n      else {\n        await LoadSourceFileProfile(TextView.Section, false);\n      }\n    }\n    else {\n      var parsedSection = new ParsedIRTextSection(TextView.Section,\n                                                  TextView.SectionText,\n                                                  TextView.Function);\n\n      if (profileFilter_ is {IncludesAll: false}) {\n        await LoadAssemblyProfileInstance(parsedSection, false);\n      }\n      else {\n        await LoadAssemblyProfile(parsedSection, false);\n      }\n    }\n  }\n\n  private async Task UpdateProfilingColumns() {\n    var sourceColumnData = TextView.ProfileColumnData;\n    ColumnsVisible = sourceColumnData is {HasData: true};\n\n    if (ColumnsVisible) {\n      if (UseCompactProfilingColumns) {\n        // Use compact mode that shows only the time column.\n        if (sourceColumnData.GetColumn(ProfileDocumentMarker.TimeColumnDefinition) is var timeColumn) {\n          timeColumn.Style.ShowIcon = OptionalColumnStyle.PartVisibility.Never;\n        }\n\n        if (sourceColumnData.GetColumn(ProfileDocumentMarker.TimePercentageColumnDefinition) is var timePercColumn) {\n          timePercColumn.IsVisible = false;\n        }\n      }\n\n      // Hide perf counter columns.\n      if (!ShowPerformanceCounterColumns ||\n          !ShowPerformanceMetricColumns) {\n        foreach (var column in sourceColumnData.Columns) {\n          if (!ShowPerformanceCounterColumns && column.IsPerformanceCounter ||\n              !ShowPerformanceMetricColumns && column.IsPerformanceMetric) {\n            column.IsVisible = false;\n          }\n        }\n      }\n\n      ResetViewMenuItemEvents();\n      ProfileColumns.Reset();\n      ProfileColumns.Settings = settings_;\n      ProfileColumns.ColumnSettings = settings_.ColumnSettings;\n\n      await ProfileColumns.Display(sourceColumnData, TextView);\n      profileMarker_.UpdateColumnStyles(sourceColumnData, TextView.Function, TextView);\n      ProfileColumns.UpdateColumnWidths();\n\n      profileElements_ = TextView.ProfileProcessingResult.SampledElements;\n      UpdateHighlighting();\n\n      // Add the columns to the View menu.\n      ProfileColumns.BuildColumnsVisibilityMenu(sourceColumnData, ProfileViewMenu, async () => {\n        await UpdateProfilingColumns();\n      });\n\n      SetViewMenuItemEvents();\n    }\n    else {\n      ProfileColumns.Reset();\n    }\n\n    HasProfileInfo = true;\n  }\n\n  private void SetViewMenuItemEvents() {\n    foreach (var item in viewMenuItems_) {\n      item.Checked += ViewMenuItem_OnCheckedChanged;\n      item.Unchecked += ViewMenuItem_OnCheckedChanged;\n    }\n  }\n\n  private void ResetViewMenuItemEvents() {\n    foreach (var item in viewMenuItems_) {\n      item.Checked -= ViewMenuItem_OnCheckedChanged;\n      item.Unchecked -= ViewMenuItem_OnCheckedChanged;\n    }\n  }\n\n  private void CreateProfileElementMenu(FunctionProfileData funcProfile,\n                                        FunctionProcessingResult result) {\n    var list = new List<ProfileMenuItem>(result.SampledElements.Count);\n    double maxWidth = 0;\n\n    ProfileElementsMenu.Items.Clear();\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings_.ProfileMarkerSettings;\n    int order = 0;\n    int index = 0;\n\n    foreach (var (element, weight) in result.SampledElements) {\n      // For source files, don't include assembly line elements.\n      if (isSourceFileDocument_ && !IsSourceLine(element.TextLocation.Line + 1)) {\n        index++;\n        continue;\n      }\n\n      double weightPercentage = funcProfile.ScaleWeight(weight);\n\n      if (!markerSettings.IsVisibleValue(order++, weightPercentage)) {\n        break;\n      }\n\n      string text = $\"({markerSettings.FormatWeightValue(weight)})\";\n      string prefixText;\n\n      if (isSourceFileDocument_) {\n        prefixText = element.GetText(TextView.SectionText).ToString();\n        prefixText = prefixText.Trim().TrimToLength(80);\n      }\n      else {\n        prefixText = DocumentUtils.GenerateElementPreviewText(element, TextView.SectionText, 50);\n      }\n\n      int line = MapToOriginalSourceLineNumber(element.TextLocation.Line + 1);\n      var value = new ProfileMenuItem(text, weight.Ticks, weightPercentage) {\n        Element = element,\n        PrefixText = prefixText,\n        ToolTip = $\"Line {line}\",\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = markerSettings.PickTextWeight(weightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var item = new MenuItem {\n        Header = value,\n        Tag = index,\n        HeaderTemplate = valueTemplate\n      };\n\n      item.Click += (sender, args) => {\n        var menuItem = (MenuItem)sender;\n        JumpToProfiledElementAt((int)menuItem.Tag);\n      };\n\n      ProfileElementsMenu.Items.Add(item);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(prefixText, ref maxWidth, ProfileElementsMenu);\n      list.Add(value);\n      index++;\n    }\n\n    foreach (var value in list) {\n      value.MinTextWidth = maxWidth;\n    }\n  }\n\n  public void SetSourceText(string text, string filePath) {\n    disableCaretEvent_ = true; // Changing the text triggers the caret event twice.\n    IHighlightingDefinition highlightingDef = null;\n\n    switch (Utils.GetFileExtension(filePath).ToLowerInvariant()) {\n      case \".c\":\n      case \".cpp\":\n      case \".cxx\":\n      case \".c++\":\n      case \".cc\":\n      case \".cp\":\n      case \".h\":\n      case \".hh\":\n      case \".hpp\":\n      case \".hxx\":\n      case \".inl\":\n      case \".ixx\": {\n        highlightingDef = HighlightingManager.Instance.GetDefinition(\"C++\");\n        sourceLanguage_ = SourceCodeLanguage.Cpp;\n        break;\n      }\n      case \".cs\": {\n        highlightingDef = HighlightingManager.Instance.GetDefinition(\"C#\");\n        sourceLanguage_ = SourceCodeLanguage.CSharp;\n        break;\n      }\n      case \".rs\": {\n        //? TODO: Rust syntax highlighting\n        highlightingDef = HighlightingManager.Instance.GetDefinition(\"C++\");\n        sourceLanguage_ = SourceCodeLanguage.Rust;\n        break;\n      }\n    }\n\n    TextView.Text = text;\n    TextView.SyntaxHighlighting = highlightingDef;\n    sourceText_ = text.AsMemory();\n    originalSourceText_ = sourceText_;\n    disableCaretEvent_ = false;\n  }\n\n  private void ProfileColumns_ScrollChanged(object sender, ScrollChangedEventArgs e) {\n    if (Math.Abs(e.VerticalChange) < double.Epsilon) {\n      return;\n    }\n\n    TextView.ScrollToVerticalOffset(e.VerticalOffset);\n  }\n\n  private void UpdateDocumentStyle() {\n    var settings = App.Settings.DocumentSettings;\n    TextView.Background = ColorBrushes.GetBrush(settings.BackgroundColor);\n    TextView.Foreground = ColorBrushes.GetBrush(settings.TextColor);\n    TextView.FontFamily = new FontFamily(settings.FontName);\n    TextView.FontSize = settings.FontSize;\n  }\n\n  private void JumpToProfiledElementExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!HasProfileElements()) {\n      return;\n    }\n\n    profileElementIndex_ = 0;\n    JumpToProfiledElement(profileElements_[profileElementIndex_].Item1);\n  }\n\n  private bool HasProfileElements() {\n    return ColumnsVisible && profileElements_ is {Count: > 0};\n  }\n\n  private bool HasProfileElement(int offset) {\n    return ColumnsVisible && profileElements_ != null &&\n           profileElementIndex_ + offset >= 0 &&\n           profileElementIndex_ + offset < profileElements_.Count;\n  }\n\n  private void JumpToNextProfiledElementExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToProfiledElement(-1);\n  }\n\n  private void JumpToPreviousProfiledElementExecuted(object sender, ExecutedRoutedEventArgs e) {\n    JumpToProfiledElement(1);\n  }\n\n  public void JumpToHottestProfiledElement(bool onLoad = false) {\n    Dispatcher.BeginInvoke(() => {\n      if (onLoad) {\n        // Don't select the associated document instructions\n        // when jumping during the source file load.\n        ignoreNextCaretEvent_ = true;\n      }\n\n      JumpToProfiledElement(0);\n    }, DispatcherPriority.Background);\n  }\n\n  private void JumpToProfiledElement(int offset) {\n    if (!HasProfileElement(offset)) {\n      return;\n    }\n\n    profileElementIndex_ += offset;\n    JumpToProfiledElement(profileElements_[profileElementIndex_].Item1);\n  }\n\n  private void JumpToProfiledElement(IRElement element) {\n    TextView.SetCaretAtElement(element);\n    double offset = TextView.TextArea.TextView.VerticalOffset;\n    SyncColumnsVerticalScrollOffset(offset);\n  }\n\n  private void JumpToProfiledElementAt(int index) {\n    profileElementIndex_ = index;\n    JumpToProfiledElement(0);\n  }\n\n  private void JumpToNextProfiledElementCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = HasProfileElement(-1);\n  }\n\n  private void JumpToPreviousProfiledElementCanExecute(object sender, CanExecuteRoutedEventArgs e) {\n    e.CanExecute = HasProfileElement(1);\n  }\n\n  private void TextView_CaretChanged(object sender, int e) {\n    if (!TextView.IsLoaded) {\n      return; // Event still triggered when unloading document, ignore.\n    }\n\n    if (columnsVisible_) {\n      ignoreNextRowSelectedEvent_ = true;\n      var line = TextView.Document.GetLineByOffset(TextView.TextArea.Caret.Offset);\n      ProfileColumns.SelectRow(line.LineNumber - 1);\n    }\n\n    if (ignoreNextCaretEvent_) {\n      ignoreNextCaretEvent_ = false;\n      return;\n    }\n\n    if (disableCaretEvent_) {\n      return;\n    }\n\n    HighlightElementsOnSelectedLine();\n  }\n\n  private void HighlightElementsOnSelectedLine() {\n    var line = TextView.Document.GetLineByOffset(TextView.CaretOffset);\n\n    if (line != null) {\n      // With assembly lines, source line numbers are shifted.\n      if (sourceProfileResult_ != null) {\n        if (sourceProfileResult_.LineToOriginalLineMap.\n          TryGetValue(line.LineNumber, out int originalLineNumber)) {\n          LineSelected?.Invoke(this, originalLineNumber);\n        }\n\n        return; // One of the assembly lines, ignore.\n      }\n\n      LineSelected?.Invoke(this, line.LineNumber);\n    }\n  }\n\n  public void SelectLine(int line) {\n    ignoreNextCaretEvent_ = true;\n    int mappedLine = MapFromOriginalSourceLineNumber(line);\n\n    if (mappedLine != -1) {\n      TextView.SelectLine(mappedLine);\n    }\n  }\n\n  private bool IsSourceLine(int line) {\n    return sourceProfileResult_ == null ||\n           sourceProfileResult_.LineToOriginalLineMap.ContainsKey(line);\n  }\n\n  public async Task Reset() {\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    ResetProfilingMenus();\n    ResetInstance();\n    ProfileFilter = new ProfileSampleFilter();\n    historyManager_.Reset();\n    originalSourceText_ = null;\n  }\n\n  private void ResetInstance() {\n    ResetInstanceProfiling();\n    TextView.UnloadDocument();\n    sourceText_ = null;\n    inlinee_ = null;\n  }\n\n  private void ResetInstanceProfiling() {\n    ProfileColumns.Reset();\n    profileElements_ = null;\n    sourceProcessingResult_ = null;\n    sourceProfileResult_ = null;\n\n    if (assemblyColorizer_ != null) {\n      TextView.UnregisterTextTransformer(assemblyColorizer_);\n      TextView.UninstallBlockFolding();\n      assemblyColorizer_ = null;\n    }\n  }\n\n  private void TextViewOnScrollOffsetChanged(object? sender, EventArgs e) {\n    // Sync scrolling with the optional columns.\n    double offset = TextView.TextArea.TextView.VerticalOffset;\n    SyncColumnsVerticalScrollOffset(offset);\n  }\n\n  private void SyncColumnsVerticalScrollOffset(double offset) {\n    // Sync scrolling with the optional columns.\n    if (columnsVisible_) {\n      ProfileColumns.ScrollToVerticalOffset(offset);\n    }\n  }\n\n  private void UpdateHighlighting() {\n    TextView.TextArea.TextView.Redraw();\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  public async Task ReloadSettings() {\n    Initialize(settings_);\n    await UpdateProfilingColumns();\n  }\n\n  public void Initialize(TextViewSettingsBase settings) {\n    settings_ = settings;\n    Background = settings_.BackgroundColor.AsBrush();\n    ProfileViewMenu.DataContext = settings_.ColumnSettings;\n    TextView.Initialize(settings, Session);\n    TextView.FontFamily = new FontFamily(settings_.FontName);\n\n    if (settings_ is SourceFileSettings sourceSettings &&\n        !sourceSettings.ShowInlineAssembly) {\n      TextView.UninstallCustomLineNumbers(true);\n    }\n\n    if (UseSmallerFontSize) {\n      TextView.FontSize = settings_.FontSize - 1;\n    }\n    else {\n      TextView.FontSize = settings_.FontSize;\n    }\n  }\n\n  private async void ViewMenuItem_OnCheckedChanged(object sender, RoutedEventArgs e) {\n    await UpdateProfilingColumns();\n  }\n\n  private async void ExportSourceExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the source file/function failed to load.\n    }\n\n    if (isSourceFileDocument_) {\n      await DocumentExporting.ExportSourceToExcelFile(TextView, MapToOriginalSourceLineNumber,\n                                                      MapFromOriginalSourceLineNumber);\n    }\n    else {\n      await DocumentExporting.ExportToExcelFile(TextView, DocumentExporting.ExportFunctionAsHtmlFile);\n    }\n  }\n\n  private async void ExportSourceHtmlExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the source file/function failed to load.\n    }\n\n    if (isSourceFileDocument_) {\n      await DocumentExporting.ExportSourceToHtmlFile(TextView, MapToOriginalSourceLineNumber,\n                                                     MapFromOriginalSourceLineNumber);\n    }\n    else {\n      await DocumentExporting.ExportToHtmlFile(TextView, DocumentExporting.ExportFunctionAsHtmlFile);\n    }\n  }\n\n  private async void ExportSourceMarkdownExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the source file/function failed to load.\n    }\n\n    if (isSourceFileDocument_) {\n      await DocumentExporting.ExportSourceToMarkdownFile(TextView, MapToOriginalSourceLineNumber,\n                                                         MapFromOriginalSourceLineNumber);\n    }\n    else {\n      await DocumentExporting.ExportToMarkdownFile(TextView, DocumentExporting.ExportFunctionAsMarkdownFile);\n    }\n  }\n\n  private async void CopySelectedLinesAsHtmlExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await CopySelectedLinesAsHtml();\n  }\n\n  public async Task CopySelectedLinesAsHtml() {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the source file/function failed to load.\n    }\n\n    if (isSourceFileDocument_) {\n      await DocumentExporting.CopySelectedSourceLinesAsHtml(TextView, MapToOriginalSourceLineNumber,\n                                                            MapFromOriginalSourceLineNumber);\n    }\n    else {\n      await DocumentExporting.CopySelectedLinesAsHtml(TextView);\n    }\n  }\n\n  public async Task CopyAllLinesAsHtml() {\n    if (!TextView.IsLoaded) {\n      return; // Happens when the source file/function failed to load.\n    }\n\n    if (isSourceFileDocument_) {\n      await DocumentExporting.CopyAllSourceLinesAsHtml(TextView, MapToOriginalSourceLineNumber,\n                                                       MapFromOriginalSourceLineNumber);\n    }\n    else {\n      await DocumentExporting.CopyAllLinesAsHtml(TextView);\n    }\n  }\n\n  private async void InstanceMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    ProfilingUtils.HandleInstanceMenuItemChanged(sender as MenuItem, InstancesMenu, profileFilter_);\n    await ApplyProfileFilter();\n  }\n\n  private void InstanceMenuItem_OnRightClick(object sender, MouseButtonEventArgs e) {\n    if (sender is MenuItem menuItem) {\n      if (menuItem.Tag is ProfileCallTreeNode node) {\n        Session.SelectProfileFunctionInPanel(node, ToolPanelKind.FlameGraph);\n        Session.SelectProfileFunctionInPanel(node, ToolPanelKind.CallTree);\n        e.Handled = true;\n      }\n    }\n  }\n\n  private async void ThreadMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    ProfilingUtils.HandleThreadMenuItemChanged(sender as MenuItem, ThreadsMenu, profileFilter_);\n    await ApplyProfileFilter();\n  }\n\n  private void ProfileColumns_RowSelected(object sender, int line) {\n    if (ignoreNextRowSelectedEvent_) {\n      ignoreNextRowSelectedEvent_ = false;\n      return;\n    }\n\n    TextView.SelectLine(line + 1);\n  }\n\n  private void TextAreaOnSelectionChanged(object sender, EventArgs e) {\n    if (Section == null) {\n      return; // Nothing loaded, ignore.\n    }\n\n    // For source files, compute the sum of the selected lines time.\n    int startLine = TextView.TextArea.Selection.StartPosition.Line;\n    int endLine = TextView.TextArea.Selection.EndPosition.Line;\n    var funcProfile = Session.ProfileData?.GetFunctionProfile(Section.ParentFunction);\n\n    if (sourceProcessingResult_ == null) {\n      if (funcProfile == null ||\n          !ProfilingUtils.ComputeAssemblyWeightInRange(startLine, endLine,\n                                                       TextView.Function, funcProfile,\n                                                       out var weightSum, out int count)) {\n        Session.SetApplicationStatus(\"\");\n        return;\n      }\n\n      double weightPercentage = funcProfile.ScaleWeight(weightSum);\n      string text = $\"Selected {count}: {weightPercentage.AsPercentageString()} ({weightSum.AsMillisecondsString()})\";\n      Session.SetApplicationStatus(text, \"Sum of time for the selected instructions\");\n      selectedLines_ = true;\n    }\n    else {\n      if (funcProfile == null ||\n          !ProfilingUtils.ComputeSourceWeightInRange(startLine, endLine,\n                                                     sourceProcessingResult_, sourceProfileResult_,\n                                                     out var weightSum, out int count)) {\n        Session.SetApplicationStatus(\"\");\n        return;\n      }\n\n      double weightPercentage = funcProfile.ScaleWeight(weightSum);\n      string text = $\"Selected {count}: {weightPercentage.AsPercentageString()} ({weightSum.AsMillisecondsString()})\";\n      Session.SetApplicationStatus(text, \"Sum of time for the selected source lines\");\n      selectedLines_ = true;\n    }\n  }\n\n  private void TextViewOnTextRegionUnfolded(object sender, FoldingSection e) {\n    ProfileColumns.HandleTextRegionUnfolded(e);\n  }\n\n  private void TextViewOnTextRegionFolded(object sender, FoldingSection e) {\n    ProfileColumns.HandleTextRegionFolded(e);\n  }\n\n  public async Task SwitchProfileInstanceAsync(ProfileSampleFilter instanceFilter) {\n    ProfileFilter = instanceFilter;\n    await ApplyProfileFilter();\n  }\n\n  private async void InlineeMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    var inlinee = ((MenuItem)sender)?.Tag as InlineeListItem;\n\n    if (inlinee != null && inlinee.ElementWeights is {Count: > 0}) {\n      // Sort by weight and bring the hottest element into view.\n      var elements = inlinee.SortedElements;\n      TextView.SelectElements(elements);\n      TextView.BringElementIntoView(elements[0]);\n    }\n  }\n\n  private void CopySelectedTextExecuted(object sender, ExecutedRoutedEventArgs e) {\n    TextView.Copy();\n  }\n\n  public void ExpandBlockFoldings() {\n    SetupSourceAssemblyFolding(false);\n  }\n\n  public void CollapseBlockFoldings() {\n    SetupSourceAssemblyFolding(true);\n  }\n\n  [ProtoContract]\n  public class SourceFileState {\n    [ProtoMember(1)]\n    public double HorizontalOffset;\n    [ProtoMember(2)]\n    public double VerticalOffset;\n    [ProtoMember(3)]\n    public List<bool> AssemblyFoldingStates;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfileMenuItem.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Profile.Document;\n\npublic class ProfileMenuItem : BindableObject {\n  private Thickness borderThickness_;\n  private Brush borderBrush_;\n  private string text_;\n  private string prefixText_;\n  private double minTextWidth_;\n  private string toolTip_;\n  private Brush textColor_;\n  private Brush backColor_;\n  private bool showPercentageBar_;\n  private Brush percentageBarBackColor__;\n  private double percentageBarBorderThickness_;\n  private Brush percentageBarBorderBrush_;\n  private FontWeight textWeight_;\n  private double textSize_;\n  private FontFamily textFont_;\n\n  public ProfileMenuItem(string text, long value = 0, double valueValuePercentage = 0.0) {\n    Text = text;\n    Value = value;\n    ValuePercentage = valueValuePercentage;\n    TextWeight = FontWeights.Normal;\n    TextColor = Brushes.Black;\n  }\n\n  public IRElement Element { get; set; }\n  public long Value { get; set; }\n  public double ValuePercentage { get; set; }\n\n  public Thickness BorderThickness {\n    get => borderThickness_;\n    set => SetAndNotify(ref borderThickness_, value);\n  }\n\n  public Brush BorderBrush {\n    get => borderBrush_;\n    set => SetAndNotify(ref borderBrush_, value);\n  }\n\n  public string Text {\n    get => text_;\n    set => SetAndNotify(ref text_, value);\n  }\n\n  public string PrefixText {\n    get => prefixText_;\n    set => SetAndNotify(ref prefixText_, value);\n  }\n\n  public double MinTextWidth {\n    get => minTextWidth_;\n    set => SetAndNotify(ref minTextWidth_, value);\n  }\n\n  public string ToolTip {\n    get => toolTip_;\n    set => SetAndNotify(ref toolTip_, value);\n  }\n\n  public Brush TextColor {\n    get => textColor_;\n    set => SetAndNotify(ref textColor_, value);\n  }\n\n  public Brush BackColor {\n    get => backColor_;\n    set => SetAndNotify(ref backColor_, value);\n  }\n\n  public bool ShowPercentageBar {\n    get => showPercentageBar_;\n    set => SetAndNotify(ref showPercentageBar_, value);\n  }\n\n  public Brush PercentageBarBackColor {\n    get => percentageBarBackColor__;\n    set => SetAndNotify(ref percentageBarBackColor__, value);\n  }\n\n  public double PercentageBarBorderThickness {\n    get => percentageBarBorderThickness_;\n    set => SetAndNotify(ref percentageBarBorderThickness_, value);\n  }\n\n  public Brush PercentageBarBorderBrush {\n    get => percentageBarBorderBrush_;\n    set => SetAndNotify(ref percentageBarBorderBrush_, value);\n  }\n\n  public FontWeight TextWeight {\n    get => textWeight_;\n    set => SetAndNotify(ref textWeight_, value);\n  }\n\n  public double TextSize {\n    get => textSize_;\n    set => SetAndNotify(ref textSize_, value);\n  }\n\n  public FontFamily TextFont {\n    get => textFont_;\n    set => SetAndNotify(ref textFont_, value);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfileSourceSyntaxNode.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.SourceParser;\n\nnamespace ProfileExplorer.UI.Profile.Document;\n\npublic class ProfileSourceSyntaxNode {\n  private static readonly IconDrawing LoopIcon;\n  private static readonly IconDrawing ThenIcon;\n  private static readonly IconDrawing ElseIcon;\n  private static readonly IconDrawing SwitchCaseIcon;\n  private static readonly IconDrawing SwitchIcon;\n\n  static ProfileSourceSyntaxNode() {\n    LoopIcon = IconDrawing.FromIconResource(\"LoopIcon\");\n    ThenIcon = IconDrawing.FromIconResource(\"ThenArrowIcon\");\n    ElseIcon = IconDrawing.FromIconResource(\"ElseArrowIcon\");\n    SwitchIcon = IconDrawing.FromIconResource(\"SwitchArrowIcon\");\n    SwitchCaseIcon = IconDrawing.FromIconResource(\"SwitchCaseArrowIcon\");\n  }\n\n  public ProfileSourceSyntaxNode(SourceSyntaxNode syntaxNode) {\n    SyntaxNode = syntaxNode;\n    Weight = TimeSpan.Zero;\n    Start = syntaxNode.Start;\n    End = syntaxNode.End;\n  }\n\n  public SourceSyntaxNode SyntaxNode { get; set; }\n  public int Level { get; set; }\n  public ProfileSourceSyntaxNode Parent { get; set; }\n  public IRElement StartElement { get; set; }\n  public List<IRElement> Elements { get; set; }\n  public TimeSpan Weight { get; set; }\n  public TimeSpan BodyWeight { get; set; }\n  public TimeSpan ConditionWeight { get; set; }\n  public PerformanceCounterValueSet Counters { get; set; }\n  public bool ShowInDocumentColumns { get; set; }\n  public SourceSyntaxNodeKind Kind => SyntaxNode.Kind;\n  public TextLocation Start { get; set; }\n  public TextLocation End { get; set; }\n  public int Length => End.Offset - Start.Offset;\n  public bool IsMarkedNode => SyntaxNode.Kind == SourceSyntaxNodeKind.If ||\n                              SyntaxNode.Kind == SourceSyntaxNodeKind.Else ||\n                              SyntaxNode.Kind == SourceSyntaxNodeKind.ElseIf ||\n                              SyntaxNode.Kind == SourceSyntaxNodeKind.Loop ||\n                              SyntaxNode.Kind == SourceSyntaxNodeKind.Switch ||\n                              SyntaxNode.Kind == SourceSyntaxNodeKind.SwitchCase;\n\n  public IconDrawing GetIcon() {\n    return Kind switch {\n      SourceSyntaxNodeKind.Loop       => LoopIcon,\n      SourceSyntaxNodeKind.If         => ThenIcon,\n      SourceSyntaxNodeKind.Else       => ElseIcon,\n      SourceSyntaxNodeKind.ElseIf     => ElseIcon,\n      SourceSyntaxNodeKind.Switch     => SwitchIcon,\n      SourceSyntaxNodeKind.SwitchCase => SwitchCaseIcon,\n      _                               => null\n    };\n  }\n\n  public string GetTextIcon() {\n    return Kind switch {\n      SourceSyntaxNodeKind.Loop       => \"\\u2B6F\",\n      SourceSyntaxNodeKind.If         => \"\\u2BA7\",\n      SourceSyntaxNodeKind.Else       => \"\\u2BA6\",\n      SourceSyntaxNodeKind.ElseIf     => \"\\u2BA7\",\n      SourceSyntaxNodeKind.Switch     => \"\\u21C9\",\n      SourceSyntaxNodeKind.SwitchCase => \"\\u2BA3\",\n      _                               => \"\"\n    };\n  }\n\n  public string GetKindText() {\n    return Kind switch {\n      SourceSyntaxNodeKind.Loop       => \"Loop\",\n      SourceSyntaxNodeKind.If         => \"If\",\n      SourceSyntaxNodeKind.Else       => \"Else\",\n      SourceSyntaxNodeKind.ElseIf     => \"Else If\",\n      SourceSyntaxNodeKind.Switch     => \"Switch\",\n      SourceSyntaxNodeKind.SwitchCase => \"Switch Case\",\n      SourceSyntaxNodeKind.Call       => \"Call\",\n      _                               => \"\"\n    };\n  }\n\n  public void SetTextStyle(ProfileMenuItem value) {\n    if (Kind == SourceSyntaxNodeKind.Loop) {\n      value.TextColor = Brushes.DarkGreen;\n      value.TextWeight = FontWeights.Bold;\n    }\n    else if (Kind == SourceSyntaxNodeKind.If ||\n             Kind == SourceSyntaxNodeKind.Else ||\n             Kind == SourceSyntaxNodeKind.ElseIf) {\n      value.TextColor = Brushes.DarkBlue;\n      value.TextWeight = FontWeights.SemiBold;\n    }\n  }\n\n  public string GetTooltip(FunctionProfileData funcProfile) {\n    var tooltip = new StringBuilder();\n    tooltip.Append($\"{GetKindText()} statement\");\n    tooltip.Append($\"\\nWeight: {funcProfile.ScaleWeight(Weight).AsPercentageString()}\");\n    tooltip.Append($\" ({Weight.AsMillisecondsString()})\");\n\n    if ((SyntaxNode.Kind == SourceSyntaxNodeKind.If ||\n         SyntaxNode.Kind == SourceSyntaxNodeKind.Loop) &&\n        ConditionWeight != TimeSpan.Zero &&\n        BodyWeight != TimeSpan.Zero) {\n      tooltip.Append($\"\\n    Condition: {funcProfile.ScaleWeight(ConditionWeight).AsPercentageString()}\");\n      tooltip.Append($\" ({ConditionWeight.AsMillisecondsString()})\");\n\n      tooltip.Append($\"\\n    Body: {funcProfile.ScaleWeight(BodyWeight).AsPercentageString()}\");\n      tooltip.Append($\" ({BodyWeight.AsMillisecondsString()})\");\n    }\n\n    return tooltip.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfilingExporting.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Web;\nusing System.Windows;\nusing HtmlAgilityPack;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic static class ProfilingExporting {\n  private static HtmlNode ExportFunctionListAsHtmlTable(List<ProfileCallTreeNode> list, HtmlDocument doc,\n                                                        ISession session) {\n    var itemList = new List<SearchableProfileItem>();\n    var markerOptions = App.Settings.DocumentSettings.ProfileMarkerSettings;\n\n    foreach (var node in list) {\n      if (!node.HasFunction) {\n        continue;\n      }\n\n      var item = ProfileListViewItem.From(node, session.ProfileData,\n                                          session.CompilerInfo.NameProvider.FormatFunctionName, null);\n      item.FunctionBackColor = markerOptions.PickBrushForPercentage(item.ExclusivePercentage);\n      itemList.Add(item);\n    }\n\n    return ExportFunctionListAsHtmlTable(itemList, doc);\n  }\n\n  public static HtmlNode ExportFunctionListAsHtmlTable(List<SearchableProfileItem> list, HtmlDocument doc) {\n    string TableStyle = @\"border-collapse:collapse;border-spacing:0;\";\n    string HeaderStyle =\n      @\"background-color:#D3D3D3;white-space:nowrap;text-align:left;vertical-align:top;border-color:black;border-style:solid;border-width:1px;overflow:hidden;padding:2px 2px;font-family:Arial, sans-serif;\";\n    string CellStyle =\n      @\"text-align:left;vertical-align:top;word-wrap:break-word;max-width:300px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;\";\n    var markingSettings = App.Settings.DocumentSettings.ProfileMarkerSettings;\n    var table = doc.CreateElement(\"table\");\n    table.SetAttributeValue(\"style\", TableStyle);\n\n    var thead = doc.CreateElement(\"thead\");\n    var tbody = doc.CreateElement(\"tbody\");\n    var tr = doc.CreateElement(\"tr\");\n\n    var th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Function\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = \"Module\";\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n    thead.AppendChild(tr);\n\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = HttpUtility.HtmlEncode($\"Time ({markingSettings.ValueUnitSuffix})\");\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = HttpUtility.HtmlEncode(\"Time (%)\");\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = HttpUtility.HtmlEncode($\"Tine incl ({markingSettings.ValueUnitSuffix})\");\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n\n    th = doc.CreateElement(\"th\");\n    th.InnerHtml = HttpUtility.HtmlEncode(\"Time incl (%)\");\n    th.SetAttributeValue(\"style\", HeaderStyle);\n    tr.AppendChild(th);\n\n    table.AppendChild(thead);\n\n    foreach (var node in list) {\n      tr = doc.CreateElement(\"tr\");\n      var td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode(node.FunctionName);\n      td.SetAttributeValue(\"style\", CellStyle);\n      tr.AppendChild(td);\n      td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode(node.ModuleName);\n      td.SetAttributeValue(\"style\", CellStyle);\n      tr.AppendChild(td);\n\n      // Use a background color if defined.\n      string colorAttr = \"\";\n\n      if (node is ProfileListViewItem listViewItem) {\n        string backColor = Utils.BrushToString(listViewItem.FunctionBackColor);\n        colorAttr = backColor != null ? $\";background-color:{backColor}\" : \"\";\n      }\n\n      td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode($\"{node.ExclusiveWeight.TotalMilliseconds}\");\n      td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n      tr.AppendChild(td);\n      td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode($\"{node.ExclusivePercentage.AsPercentageString()}\");\n      td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n      tr.AppendChild(td);\n      td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode($\"{node.Weight.TotalMilliseconds}\");\n      td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n      tr.AppendChild(td);\n      td = doc.CreateElement(\"td\");\n      td.InnerHtml = HttpUtility.HtmlEncode($\"{node.Percentage.AsPercentageString()}\");\n      td.SetAttributeValue(\"style\", $\"{CellStyle}{colorAttr}\");\n      tr.AppendChild(td);\n\n      tbody.AppendChild(tr);\n    }\n\n    table.AppendChild(tbody);\n    return table;\n  }\n\n  private static string ExportFunctionListAsMarkdownTable(List<ProfileCallTreeNode> list,\n                                                          ISession session) {\n    var itemList = new List<SearchableProfileItem>();\n    var nameFormatter = session.CompilerInfo.NameProvider;\n\n    foreach (var node in list) {\n      if (!node.HasFunction) {\n        continue;\n      }\n\n      itemList.Add(ProfileListViewItem.From(node, session.ProfileData,\n                                            session.CompilerInfo.NameProvider.FormatFunctionName, null));\n    }\n\n    return ExportFunctionListAsMarkdownTable(itemList);\n  }\n\n  public static string ExportFunctionListAsMarkdownTable(List<SearchableProfileItem> list) {\n    var markingSettings = App.Settings.DocumentSettings.ProfileMarkerSettings;\n    var sb = new StringBuilder();\n    string header = \"| Function | Module |\";\n    string separator = \"|----------|--------|\";\n    header +=\n      $\" Time ({markingSettings.ValueUnitSuffix}) | Time (%) | Time incl ({markingSettings.ValueUnitSuffix}) | Time incl (%) |\";\n    separator += \"-----------|----------|----------------|---------------|\";\n\n    sb.AppendLine(header);\n    sb.AppendLine(separator);\n\n    foreach (var func in list) {\n      sb.Append($\"| {func.FunctionName} | {func.ModuleName} \" +\n                $\"| {func.ExclusiveWeight.TotalMilliseconds} \" +\n                $\"| {func.ExclusivePercentage.AsPercentageString()} \" +\n                $\"| {func.Weight.TotalMilliseconds} \" +\n                $\"| {func.Percentage.AsPercentageString()} |\\n\");\n    }\n\n    return sb.ToString();\n  }\n\n  public static (string Html, string Plaintext)\n    ExportProfilingReportAsHtml(List<FunctionMarkingCategory> markingCategoryList, ISession session,\n                                bool includeHottestFunctions, int hotFuncLimit = 20,\n                                bool includeCategoriesTable = true,\n                                bool includeOverview = true,\n                                bool isCategoryList = true) {\n    string TableStyle = @\"border-collapse:collapse;border-spacing:0;\";\n    string HeaderStyle =\n      @\"background-color:#D3D3D3;white-space:nowrap;text-align:left;vertical-align:top;border-color:black;border-style:solid;border-width:1px;overflow:hidden;padding:2px 2px;font-family:Arial, sans-serif;\";\n    string CellStyle =\n      @\"text-align:left;vertical-align:top;word-wrap:break-word;max-width:300px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;\";\n    string PatternCellStyle =\n      @\"text-align:left;vertical-align:top;word-wrap:break-word;max-width:500px;overflow:hidden;padding:2px 2px;border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;\";\n\n    var doc = new HtmlDocument();\n    var sb = new StringBuilder();\n    var markingSettings = App.Settings.DocumentSettings.ProfileMarkerSettings;\n\n    if (includeCategoriesTable) {\n      if (includeOverview) {\n        ExportTraceOverviewAsHtml(session, doc, sb);\n      }\n\n      AppendTitleParagraph(includeHottestFunctions ? \"Categories Summary\" : \"Markings Summary\", doc);\n      var table = doc.CreateElement(\"table\");\n      table.SetAttributeValue(\"style\", TableStyle);\n\n      var thead = doc.CreateElement(\"thead\");\n      var tbody = doc.CreateElement(\"tbody\");\n      var tr = doc.CreateElement(\"tr\");\n      var th = doc.CreateElement(\"th\");\n      string title = isCategoryList ? \"Category\" : \"Marking\";\n      th.InnerHtml = title;\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = $\"Time ({markingSettings.ValueUnitSuffix})\";\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = \"Time (%)\";\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n      thead.AppendChild(tr);\n      table.AppendChild(thead);\n\n      string header = $\"| {title} | Time ({markingSettings.ValueUnitSuffix}) | Time (%) |\";\n      string separator = \"|----------|--------|--------|\";\n      sb.AppendLine(header);\n      sb.AppendLine(separator);\n\n      foreach (var category in markingCategoryList) {\n        if (category.Weight == TimeSpan.Zero && !includeOverview) {\n          continue;\n        }\n\n        tr = doc.CreateElement(\"tr\");\n        var td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode(category.Marking.TitleOrName);\n        td.SetAttributeValue(\"style\", CellStyle);\n        tr.AppendChild(td);\n\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode(category.Weight.TotalMilliseconds);\n        td.SetAttributeValue(\"style\", CellStyle);\n        tr.AppendChild(td);\n\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode(category.Percentage.AsPercentageString());\n        td.SetAttributeValue(\"style\", CellStyle);\n        tr.AppendChild(td);\n        tbody.AppendChild(tr);\n\n        sb.AppendLine(\n          $\"| {category.Marking.TitleOrName} | {category.Weight.TotalMilliseconds} | {category.Percentage.AsPercentageString()} |\");\n      }\n\n      table.AppendChild(tbody);\n      doc.DocumentNode.AppendChild(table);\n      AppendHtmlNewLine(doc, sb);\n    }\n\n    if (includeHottestFunctions) {\n      // Add a table with the hottest functions overall.\n      var hottestFuncts = new List<ProfileCallTreeNode>();\n      var funcList = session.ProfileData.GetSortedFunctions();\n\n      string funcTitle = $\"Hottest {hotFuncLimit} Functions\";\n      AppendTitleParagraph(funcTitle, doc, sb);\n\n      foreach (var pair in funcList.Take(hotFuncLimit)) {\n        hottestFuncts.Add(session.ProfileData.CallTree.GetCombinedCallTreeNode(pair.Item1));\n      }\n\n      var hotFuncTable = ExportFunctionListAsHtmlTable(hottestFuncts, doc, session);\n      doc.DocumentNode.AppendChild(hotFuncTable);\n\n      sb.AppendLine();\n      sb.AppendLine(ExportFunctionListAsMarkdownTable(hottestFuncts, session));\n    }\n\n    // Add a table for each category.\n    foreach (var category in markingCategoryList) {\n      if (category.SortedFunctions.Count == 0) {\n        continue;\n      }\n\n      string time = markingSettings.FormatWeightValue(category.Weight);\n      string percentage = category.Percentage.AsPercentageString();\n\n      AppendHtmlNewLine(doc);\n      AppendTitleParagraph(category.Marking.TitleOrName, doc, sb);\n      AppendParagraph($\"Time: {time} ({percentage})\", doc, sb);\n\n      var table = ExportFunctionListAsHtmlTable(category.SortedFunctions, doc, session);\n      doc.DocumentNode.AppendChild(table);\n      sb.AppendLine();\n\n      string plainText = ExportFunctionListAsMarkdownTable(category.SortedFunctions, session);\n      sb.AppendLine(plainText);\n    }\n\n    if (includeCategoriesTable) {\n      AppendHtmlNewLine(doc, sb);\n      AppendTitleParagraph(includeHottestFunctions ? \"Categories Definitions\" :\n                             \"Markings Definitions\", doc);\n      var table = doc.CreateElement(\"table\");\n      table.SetAttributeValue(\"style\", TableStyle);\n\n      var thead = doc.CreateElement(\"thead\");\n      var tbody = doc.CreateElement(\"tbody\");\n      var tr = doc.CreateElement(\"tr\");\n\n      string title = isCategoryList ? \"Category\" : \"Marking\";\n      var th = doc.CreateElement(\"th\");\n      th.InnerHtml = title;\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n\n      th = doc.CreateElement(\"th\");\n      th.InnerHtml = \"Pattern\";\n      th.SetAttributeValue(\"style\", HeaderStyle);\n      tr.AppendChild(th);\n      thead.AppendChild(tr);\n      table.AppendChild(thead);\n\n      string header = $\"| {title} | Pattern |\";\n      string separator = \"|----------|--------|\";\n      sb.AppendLine(header);\n      sb.AppendLine(separator);\n\n      foreach (var category in markingCategoryList) {\n        if (category.Weight == TimeSpan.Zero && !includeOverview) {\n          continue;\n        }\n\n        tr = doc.CreateElement(\"tr\");\n        var td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode(category.Marking.TitleOrName);\n        td.SetAttributeValue(\"style\", CellStyle);\n        tr.AppendChild(td);\n\n        td = doc.CreateElement(\"td\");\n        td.InnerHtml = HttpUtility.HtmlEncode(category.Marking.Name);\n        td.SetAttributeValue(\"style\", PatternCellStyle);\n        tr.AppendChild(td);\n        tbody.AppendChild(tr);\n\n        sb.AppendLine($\"| {category.Marking.TitleOrName} | {category.Marking.Name} |\");\n      }\n\n      table.AppendChild(tbody);\n      doc.DocumentNode.AppendChild(table);\n    }\n\n    var writer = new StringWriter();\n    doc.Save(writer);\n    return (writer.ToString(), sb.ToString());\n  }\n\n  private static void ExportTraceOverviewAsHtml(ISession session, HtmlDocument doc, StringBuilder sb) {\n    var report = session.ProfileData.Report;\n\n    if (report != null) {\n      AppendTitleParagraph(\"Overview\", doc, sb);\n      AppendParagraph($\"Trace File: {report.TraceInfo.TraceFilePath}\", doc, sb);\n      AppendParagraph($\"Trace Duration: {report.TraceInfo.ProfileDuration}\", doc, sb);\n      AppendParagraph($\"Process Name: {report.Process.Name}\", doc, sb);\n      AppendParagraph($\"Process Id: {report.Process.ProcessId}\", doc, sb);\n      AppendParagraph($\"Total Time: {session.ProfileData.TotalWeight}\", doc, sb);\n      AppendParagraph($\"Total Time (ms): {session.ProfileData.TotalWeight.AsMillisecondsString(2, \"\")}\", doc, sb);\n      AppendHtmlNewLine(doc, sb);\n    }\n  }\n\n  private static void AppendParagraph(string text, HtmlDocument doc, StringBuilder sb = null) {\n    string SubtitleStyle =\n      @\"margin:5;text-align:left;font-family:Arial, sans-serif;font-size:14px;margin-top:0em\";\n    var paragraph = doc.CreateElement(\"p\");\n    paragraph.InnerHtml = HttpUtility.HtmlEncode(text);\n    paragraph.SetAttributeValue(\"style\", SubtitleStyle);\n    doc.DocumentNode.AppendChild(paragraph);\n\n    if (sb != null) {\n      sb.AppendLine($\"{text}  \");\n    }\n  }\n\n  private static void AppendTitleParagraph(string text, HtmlDocument doc, StringBuilder sb = null) {\n    string TitleStyle =\n      @\"margin:5;text-align:left;font-family:Arial, sans-serif;font-weight:bold;font-size:16px;margin-top:0em\";\n    var paragraph = doc.CreateElement(\"p\");\n    paragraph.InnerHtml = HttpUtility.HtmlEncode(text);\n    paragraph.SetAttributeValue(\"style\", TitleStyle);\n    doc.DocumentNode.AppendChild(paragraph);\n\n    if (sb != null) {\n      sb.AppendLine($\"**{text}**  \");\n    }\n  }\n\n  private static void AppendHtmlNewLine(HtmlDocument doc, StringBuilder sb = null) {\n    var newLineParagraph = doc.CreateElement(\"p\");\n    newLineParagraph.InnerHtml = \"&nbsp;\";\n    newLineParagraph.SetAttributeValue(\"style\", \"margin:5;\");\n    doc.DocumentNode.AppendChild(newLineParagraph);\n\n    if (sb != null) {\n      sb.AppendLine(\"  \");\n    }\n  }\n\n  public static async Task CopyFunctionMarkingsAsHtml(ISession session) {\n    (string html, string plaintext) = await ExportFunctionMarkingsAsHtml(session);\n    Utils.CopyHtmlToClipboard(html, plaintext);\n  }\n\n  public static void CopyFunctionMarkingsAsHtml(List<FunctionMarkingCategory> markings, ISession session) {\n    (string html, string plaintext) = ExportFunctionMarkingsAsHtml(markings, session);\n    Utils.CopyHtmlToClipboard(html, plaintext);\n  }\n\n  private static (string Html, string Plaintext)\n    ExportFunctionMarkingsAsHtml(List<FunctionMarkingCategory> markings, ISession session) {\n    return ExportProfilingReportAsHtml(markings, session, false, 0, true, false, true);\n  }\n\n  private static async Task<(string html, string plaintext)>\n    ExportFunctionMarkingsAsHtml(ISession session) {\n    var markingCategoryList = await Task.Run(() =>\n                                               ProfilingUtils.CollectMarkedFunctions(\n                                                 App.Settings.MarkingSettings.FunctionColors, false, session));\n    return ExportProfilingReportAsHtml(markingCategoryList, session,\n                                       false, 0, true, false, false);\n  }\n\n  private static async Task<(string html, string plaintext)>\n    ExportModuleMarkingsAsHtml(ISession session) {\n    var markingCategoryList = await Task.Run<List<FunctionMarkingCategory>>(() =>\n                                                                              ProfilingUtils.\n                                                                                CreateModuleMarkingCategories(\n                                                                                  App.Settings.MarkingSettings,\n                                                                                  session));\n    return ExportProfilingReportAsHtml(markingCategoryList, session,\n                                       false, 0, true, false, false);\n  }\n\n  public static async Task ExportFunctionMarkingsAsHtmlFile(ISession session) {\n    (string html, _) = await ExportFunctionMarkingsAsHtml(session);\n    await ExportFunctionMarkingsAsHtmlFile(html, session);\n  }\n\n  private static async Task ExportFunctionMarkingsAsHtmlFile(string text, ISession session) {\n    string path = Utils.ShowSaveFileDialog(\"HTML file|*.html\", \"*.html|All Files|*.*\");\n    bool success = true;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        await File.WriteAllTextAsync(path, text);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save marked functions report to {path}: {ex.Message}\");\n        success = false;\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(Application.Current.MainWindow);\n        MessageBox.Show($\"Failed to save marked functions report to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  public static async Task ExportFunctionMarkingsAsMarkdownFile(ISession session) {\n    (_, string plaintext) = await ExportFunctionMarkingsAsHtml(session);\n    await ExportFunctionMarkingsAsMarkdownFile(plaintext, session);\n  }\n\n  private static async Task ExportFunctionMarkingsAsMarkdownFile(string text, ISession session) {\n    string path = Utils.ShowSaveFileDialog(\"Markdown file|*.md\", \"*.md|All Files|*.*\");\n    bool success = true;\n\n    if (!string.IsNullOrEmpty(path)) {\n      try {\n        await File.WriteAllTextAsync(path, text);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to save marked functions report to {path}: {ex.Message}\");\n        success = false;\n      }\n\n      if (!success) {\n        using var centerForm = new DialogCenteringHelper(Application.Current.MainWindow);\n        MessageBox.Show($\"Failed to save marked functions report to {path}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      }\n    }\n  }\n\n  public static async Task\n    ExportFunctionMarkingsAsHtmlFile(List<FunctionMarkingCategory> categories, ISession session) {\n    (string html, _) = ExportFunctionMarkingsAsHtml(categories, session);\n    await ExportFunctionMarkingsAsHtmlFile(html, session);\n  }\n\n  public static async Task ExportFunctionMarkingsAsMarkdownFile(List<FunctionMarkingCategory> categories,\n                                                                ISession session) {\n    (_, string plaintext) = ExportFunctionMarkingsAsHtml(categories, session);\n    await ExportFunctionMarkingsAsMarkdownFile(plaintext, session);\n  }\n\n  public static async Task CopyModuleMarkingsAsHtml(ISession session) {\n    (string html, string plaintext) = await ExportModuleMarkingsAsHtml(session);\n    Utils.CopyHtmlToClipboard(html, plaintext);\n  }\n\n  public static async Task ExportModuleMarkingsAsHtmlFile(ISession session) {\n    (string html, _) = await ExportModuleMarkingsAsHtml(session);\n    await ExportFunctionMarkingsAsHtmlFile(html, session);\n  }\n\n  public static async Task ExportModuleMarkingsAsMarkdownFile(ISession session) {\n    (_, string plaintext) = await ExportModuleMarkingsAsHtml(session);\n    await ExportFunctionMarkingsAsMarkdownFile(plaintext, session);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/ProfilingUtils.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.Profile.Document;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic record FunctionMarkingCategory(\n  FunctionMarkingStyle Marking,\n  TimeSpan Weight,\n  double Percentage,\n  ProfileCallTreeNode HottestFunction,\n  List<ProfileCallTreeNode> SortedFunctions) {\n  public virtual bool Equals(FunctionMarkingCategory other) {\n    if (ReferenceEquals(null, other)) return false;\n    if (ReferenceEquals(this, other)) return true;\n    return Equals(Marking, other.Marking) &&\n           Weight.Equals(other.Weight) && Equals(HottestFunction, other.HottestFunction) &&\n           SortedFunctions.AreEqual(other.SortedFunctions);\n  }\n}\n\npublic static class ProfilingUtils {\n  public static void CreateInstancesMenu(MenuItem menu, IRTextSection section,\n                                         FunctionProfileData funcProfile,\n                                         RoutedEventHandler menuClickHandler,\n                                         MouseButtonEventHandler menuRightClickHandler,\n                                         TextViewSettingsBase settings, ISession session) {\n    var defaultItems = DocumentUtils.SaveDefaultMenuItems(menu);\n    var profileItems = new List<ProfileMenuItem>();\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings.ProfileMarkerSettings;\n    int order = 0;\n    double maxWidth = 0;\n\n    var nodes = session.ProfileData.CallTree.GetSortedCallTreeNodes(section.ParentFunction);\n    int maxCallers = nodes.Count >= 2 ? CommonParentCallerIndex(nodes[0], nodes[1]) : int.MaxValue;\n\n    foreach (var node in nodes) {\n      double weightPercentage = funcProfile.ScaleWeight(node.Weight);\n\n      if (!markerSettings.IsVisibleValue(order++, weightPercentage) ||\n          !node.HasCallers) {\n        break;\n      }\n\n      (string title, string tooltip) = GenerateInstancePreviewText(node, session, maxCallers);\n      string text = $\"({markerSettings.FormatWeightValue(node.Weight)})\";\n\n      var value = new ProfileMenuItem(text, node.Weight.Ticks, weightPercentage) {\n        PrefixText = title,\n        ToolTip = tooltip,\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = markerSettings.PickTextWeight(weightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var item = new MenuItem {\n        Header = value,\n        IsCheckable = true,\n        StaysOpenOnClick = true,\n        Tag = node,\n        HeaderTemplate = valueTemplate,\n        Style = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\")\n      };\n\n      item.Click += menuClickHandler;\n\n      if (menuRightClickHandler != null) {\n        item.PreviewMouseRightButtonUp += menuRightClickHandler;\n      }\n\n      defaultItems.Add(item);\n      profileItems.Add(value);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(title, ref maxWidth, menu);\n    }\n\n    foreach (var value in profileItems) {\n      value.MinTextWidth = maxWidth;\n    }\n\n    menu.Items.Clear();\n    DocumentUtils.RestoreDefaultMenuItems(menu, defaultItems);\n  }\n\n  public static void CreateThreadsMenu(MenuItem menu, IRTextSection section,\n                                       FunctionProfileData funcProfile,\n                                       RoutedEventHandler menuClickHandler,\n                                       TextViewSettingsBase settings, ISession session) {\n    var defaultItems = DocumentUtils.SaveDefaultMenuItems(menu);\n    var profileItems = new List<ProfileMenuItem>();\n\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings.ProfileMarkerSettings;\n    var timelineSettings = App.Settings.TimelineSettings;\n    double maxWidth = 0;\n\n    var node = session.ProfileData.CallTree.GetCombinedCallTreeNode(section.ParentFunction);\n\n    foreach (var thread in node.SortedByWeightPerThreadWeights) {\n      double weightPercentage = funcProfile.ScaleWeight(thread.Values.Weight);\n\n      var threadInfo = session.ProfileData.FindThread(thread.ThreadId);\n      var backColor = timelineSettings.GetThreadBackgroundColors(threadInfo, thread.ThreadId).Margin;\n\n      string text = $\"({markerSettings.FormatWeightValue(thread.Values.Weight)})\";\n      string tooltip = threadInfo is {HasName: true} ? threadInfo.Name : null;\n      string title = !string.IsNullOrEmpty(tooltip) ? $\"{thread.ThreadId} ({tooltip})\" : $\"{thread.ThreadId}\";\n\n      var value = new ProfileMenuItem(text, node.Weight.Ticks, weightPercentage) {\n        PrefixText = title,\n        ToolTip = tooltip,\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = markerSettings.PickTextWeight(weightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var item = new MenuItem {\n        Header = value,\n        IsCheckable = true,\n        StaysOpenOnClick = true,\n        Tag = thread.ThreadId,\n        Background = backColor,\n        HeaderTemplate = valueTemplate,\n        Style = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\")\n      };\n\n      item.Click += menuClickHandler;\n      defaultItems.Add(item);\n      profileItems.Add(value);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(title, ref maxWidth, menu);\n    }\n\n    foreach (var value in profileItems) {\n      value.MinTextWidth = maxWidth;\n    }\n\n    menu.Items.Clear();\n    DocumentUtils.RestoreDefaultMenuItems(menu, defaultItems);\n  }\n\n  public static void CreateInlineesMenu(MenuItem menu, IRTextSection section,\n                                        List<InlineeListItem> inlineeList,\n                                        FunctionProfileData funcProfile,\n                                        RoutedEventHandler menuClickHandler,\n                                        TextViewSettingsBase settings, ISession session) {\n    var defaultItems = DocumentUtils.SaveDefaultMenuItems(menu);\n    var profileItems = new List<ProfileMenuItem>();\n    var valueTemplate = (DataTemplate)Application.Current.FindResource(\"ProfileMenuItemValueTemplate\");\n    var markerSettings = settings.ProfileMarkerSettings;\n    int order = 0;\n    double maxWidth = 0;\n\n    // Compute time spent in non-inlinee parts.\n    var inlineeWeightSum = TimeSpan.Zero;\n\n    foreach (var node in inlineeList) {\n      inlineeWeightSum += node.ExclusiveWeight;\n    }\n\n    var nonInlineeWeight = funcProfile.Weight - inlineeWeightSum;\n    double nonInlineeWeightPercentage = funcProfile.ScaleWeight(nonInlineeWeight);\n    string nonInlineeText = $\"({markerSettings.FormatWeightValue(nonInlineeWeight)})\";\n\n    var nonInlineeValue = new ProfileMenuItem(nonInlineeText, nonInlineeWeight.Ticks, nonInlineeWeightPercentage) {\n      PrefixText = \"Non-Inlinee Code\",\n      ToolTip = \"Time for code not originating from an inlined function\",\n      ShowPercentageBar = markerSettings.ShowPercentageBar(nonInlineeWeightPercentage),\n      TextWeight = markerSettings.PickTextWeight(nonInlineeWeightPercentage),\n      PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n    };\n    profileItems.Add(nonInlineeValue);\n\n    if (defaultItems.Count > 0 &&\n        defaultItems[0] is MenuItem nonInlineeItem) {\n      nonInlineeItem.Header = nonInlineeValue;\n      nonInlineeItem.HeaderTemplate = valueTemplate;\n    }\n\n    foreach (var node in inlineeList) {\n      double weightPercentage = funcProfile.ScaleWeight(node.ExclusiveWeight);\n\n      if (!markerSettings.IsVisibleValue(order++, weightPercentage)) {\n        break;\n      }\n\n      string title = node.InlineeFrame.Function.FormatFunctionName(session, 80);\n      string text = $\"({markerSettings.FormatWeightValue(node.ExclusiveWeight)})\";\n      string tooltip = $\"File {Utils.TryGetFileName(node.InlineeFrame.FilePath)}:{node.InlineeFrame.Line}\\n\";\n      tooltip += CreateInlineeFunctionDescription(node, funcProfile, settings.ProfileMarkerSettings, session);\n\n      tooltip += $\"\\n\\nFile path: {node.InlineeFrame.FilePath}\";\n      tooltip += $\"\\nFunction: {node.InlineeFrame.Function.FormatFunctionName(session)}\";\n\n      var value = new ProfileMenuItem(text, node.ExclusiveWeight.Ticks, weightPercentage) {\n        PrefixText = title,\n        ToolTip = tooltip,\n        ShowPercentageBar = markerSettings.ShowPercentageBar(weightPercentage),\n        TextWeight = markerSettings.PickTextWeight(weightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var item = new MenuItem {\n        Header = value,\n        Tag = node,\n        HeaderTemplate = valueTemplate,\n        Style = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\")\n      };\n\n      item.Click += menuClickHandler;\n      defaultItems.Add(item);\n      profileItems.Add(value);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(title, ref maxWidth, menu);\n    }\n\n    // If no items were added (besides \"Non-Inlinee Code\"),\n    // add an entry about there being no significant inlinees.\n    if (profileItems.Count == 1) {\n      defaultItems.Add(new MenuItem() {\n        Header = \"No significant inlined functions\",\n        IsHitTestVisible = false,\n        Tag = true, // Give it a tag so it can be removed later.\n        Style = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\")\n      });\n    }\n\n    foreach (var value in profileItems) {\n      value.MinTextWidth = maxWidth;\n    }\n\n    menu.Items.Clear();\n    DocumentUtils.RestoreDefaultMenuItems(menu, defaultItems);\n  }\n\n  public static async Task PopulateMarkedModulesMenu(MenuItem menu, FunctionMarkingSettings settings,\n                                                     IUISession session, object triggerObject,\n                                                     Func<Task> changedHandler) {\n    if (IsTopLevelSubmenu(triggerObject)) return;\n\n    await CreateMarkedModulesMenu(menu,\n                                  async (o, args) => {\n                                    if (args.Source is MenuItem menuItem) {\n                                      if (menuItem.Tag is FunctionMarkingStyle style) {\n                                        style.IsEnabled = menuItem.IsChecked;\n\n                                        if (style.IsEnabled) {\n                                          settings.UseModuleColors = true;\n                                        }\n\n                                        await changedHandler();\n                                      }\n                                      else if (menuItem.Tag is IRTextFunction func) {\n                                        // Click on submenu with individual functions.\n                                        await session.SwitchActiveFunction(func);\n                                      }\n                                    }\n                                  },\n                                  (o, args) => {\n                                    if (args.Source is MenuItem menuItem) {\n                                      var style = menuItem.Tag as FunctionMarkingStyle;\n                                      settings.ModuleColors.Remove(style);\n                                      menu.IsSubmenuOpen = false;\n                                      changedHandler();\n                                    }\n                                  },\n                                  settings, session);\n  }\n\n  public static async Task PopulateMarkedFunctionsMenu(MenuItem menu, FunctionMarkingSettings settings,\n                                                       IUISession session, object triggerObject,\n                                                       Func<Task> changedHandler) {\n    if (IsTopLevelSubmenu(triggerObject)) return;\n\n    await CreateMarkedFunctionsMenu(menu,\n                                    async (o, args) => {\n                                      if (args.Source is MenuItem menuItem) {\n                                        if (menuItem.Tag is FunctionMarkingStyle style) {\n                                          style.IsEnabled = menuItem.IsChecked;\n\n                                          if (style.IsEnabled) {\n                                            settings.UseFunctionColors = true;\n                                          }\n\n                                          await changedHandler();\n                                        }\n                                        else if (menuItem.Tag is IRTextFunction func) {\n                                          // Click on submenu with individual functions.\n                                          await session.SwitchActiveFunction(func);\n                                        }\n                                      }\n                                    },\n                                    (o, args) => {\n                                      if (args.Source is MenuItem menuItem) {\n                                        var style = menuItem.Tag as FunctionMarkingStyle;\n                                        settings.FunctionColors.Remove(style);\n                                        menu.IsSubmenuOpen = false;\n                                        changedHandler();\n                                      }\n                                    },\n                                    settings, session);\n  }\n\n  private static bool IsTopLevelSubmenu(object triggerObject) {\n    // The OnSubmenuOpened event is triggered not only for the top-level menu,\n    // but also for any submenus added from code-behind. Those need to be ignored\n    // because otherwise the entire menu gets created below again, and it also gets hidden.\n    if (triggerObject is not MenuItem triggerMenu ||\n        triggerMenu.Tag != null) {\n      return true;\n    }\n\n    return false;\n  }\n\n  public static async Task\n    CreateMarkedModulesMenu(MenuItem menu,\n                            MouseButtonEventHandler menuClickHandler,\n                            MouseButtonEventHandler menuRightClickHandler,\n                            FunctionMarkingSettings settings, ISession session) {\n    var categories = await CreateModuleMarkingCategories(settings, session);\n    CreateCategoriesMenu(categories, menu, false, menuClickHandler, menuRightClickHandler, session);\n  }\n\n  public static async Task<List<FunctionMarkingCategory>> CreateModuleMarkingCategories(\n    FunctionMarkingSettings settings, ISession session) {\n    var sortedModules = new List<(FunctionMarkingStyle Module, TimeSpan Weight)>();\n\n    foreach (var moduleStyle in settings.ModuleColors) {\n      var moduleWeight = session.ProfileData.FindModulesWeight(name =>\n                                                                 moduleStyle.NameMatches(name));\n      sortedModules.Add((moduleStyle, moduleWeight));\n    }\n\n    sortedModules.Sort((a, b) => a.Weight.CompareTo(b.Weight));\n    var moduleFuncs = await Task.Run(() => CollectModuleSortedFunctions(session, 10));\n\n    var categories = new List<FunctionMarkingCategory>();\n\n    foreach (var pair in sortedModules) {\n      double weightPercentage = session.ProfileData.ScaleModuleWeight(pair.Weight);\n      var functs = moduleFuncs.GetValueOrNull(pair.Module.Name);\n      var hottestFunc = functs?.Count > 0 ? functs[0] : null;\n      var category = new FunctionMarkingCategory(pair.Module, pair.Weight, weightPercentage,\n                                                 hottestFunc, functs);\n      categories.Add(category);\n    }\n\n    categories.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n    return categories;\n  }\n\n  public static async Task CreateMarkedFunctionsMenu(MenuItem menu,\n                                                     MouseButtonEventHandler menuClickHandler,\n                                                     MouseButtonEventHandler menuRightClickHandler,\n                                                     FunctionMarkingSettings settings, ISession session) {\n    await CreateMarkedFunctionsMenu(menu, false, menuClickHandler, menuRightClickHandler,\n                                    settings.FunctionColors, session);\n  }\n\n  public static async Task\n    CreateFunctionsCategoriesMenu(MenuItem menu,\n                                  MouseButtonEventHandler menuClickHandler,\n                                  MouseButtonEventHandler menuRightClickHandler,\n                                  FunctionMarkingSettings settings, ISession session) {\n    await CreateMarkedFunctionsMenu(menu, true, menuClickHandler, menuRightClickHandler,\n                                    settings.BuiltinMarkingCategories.FunctionColors, session);\n  }\n\n  public static List<FunctionMarkingCategory> CollectMarkedFunctions(List<FunctionMarkingStyle> markings,\n                                                                     bool isCategoriesMenu, ISession session,\n                                                                     ProfileCallTreeNode startNode = null) {\n    // Collect functions across all markings to compute the \"Unmarked\" weight.\n    var markingCategoryList = new List<FunctionMarkingCategory>();\n    object lockObject = new();\n    var tasks = new List<Task>();\n\n    foreach (var marking in markings) {\n      tasks.Add(Task.Run(() => {\n        // Find all functions matching the marked name. There can be multiple\n        // since the same func. name may be used in multiple modules,\n        // and also because the name matching may use Regex.\n        var funcNodeList = new List<ProfileCallTreeNode>();\n        var funcMap = new Dictionary<IRTextFunction, List<ProfileCallTreeNode>>();\n\n        if (startNode == null) {\n          CollectGlobalMarkedFunctions(marking, funcNodeList, funcMap, session);\n        }\n        else {\n          CollectCallTreeMarkedFunctions(marking, startNode, funcNodeList, funcMap, session);\n        }\n\n        // Combine all marked functions to obtain the proper total weight.\n        var weight = ProfileCallTree.CombinedCallTreeNodesWeight(funcNodeList);\n        double weightPercentage = session.ProfileData.ScaleFunctionWeight(weight);\n        var funcList = new List<ProfileCallTreeNode>();\n\n        foreach (var pair in funcMap) {\n          funcList.Add(ProfileCallTree.CombinedCallTreeNodes(pair.Value, false));\n        }\n\n        funcList.Sort((a, b) =>\n                        b.Weight.CompareTo(a.Weight));\n        var hottestFunc = funcList.Count > 0 ? funcList[0] : null;\n\n        lock (lockObject) {\n          markingCategoryList.Add(new FunctionMarkingCategory(marking, weight, weightPercentage,\n                                                              hottestFunc, funcList));\n        }\n      }));\n    }\n\n    // Sort markings by weight in decreasing order.\n    Task.WaitAll(tasks.ToArray());\n    markingCategoryList.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n\n    if (isCategoriesMenu) {\n      // Compute the \"Unmarked\" weight and add it as the last entry.\n      var allFuncNodeList = new List<ProfileCallTreeNode>();\n\n      foreach (var category in markingCategoryList) {\n        allFuncNodeList.AddRange(category.SortedFunctions);\n      }\n\n      var categoriesWeight = ProfileCallTree.CombinedCallTreeNodesWeight(allFuncNodeList);\n      var otherWeight = session.ProfileData.TotalWeight - categoriesWeight;\n      double otherWeightPercentage = session.ProfileData.ScaleFunctionWeight(otherWeight);\n      var uncategorizedMarking = new FunctionMarkingCategory(\n        new FunctionMarkingStyle(\"Other functions not covered by categories\",\n                                 Colors.Transparent, \"Uncategorized\"),\n        otherWeight, otherWeightPercentage, null, null);\n      markingCategoryList.Add(uncategorizedMarking);\n    }\n\n    return markingCategoryList;\n  }\n\n  private static void CollectCallTreeMarkedFunctions(FunctionMarkingStyle marking, ProfileCallTreeNode startNode,\n                                                     List<ProfileCallTreeNode> funcNodeList,\n                                                     Dictionary<IRTextFunction, List<ProfileCallTreeNode>> funcNodeMap,\n                                                     ISession session) {\n    var nameProvider = session.CompilerInfo.NameProvider;\n    var visited = new HashSet<ProfileCallTreeNode>();\n    var queue = new Queue<ProfileCallTreeNode>();\n    queue.Enqueue(startNode);\n\n    while (queue.Count > 0) {\n      var node = queue.Dequeue();\n\n#if DEBUG\n      Debug.Assert(!visited.Contains(node), \"Cycle detected in call tree\");\n      visited.Add(node);\n#endif\n\n      if (marking.NameMatches(nameProvider.FormatFunctionName(node.Function.Name))) {\n        funcNodeList.Add(node); // Per-category list.\n        var instanceNodeList = funcNodeMap.GetOrAddValue(node.Function);\n        instanceNodeList.Add(node);\n      }\n\n      if (node.HasChildren) {\n        foreach (var child in node.Children) {\n          queue.Enqueue(child);\n        }\n      }\n    }\n  }\n\n  private static void CollectGlobalMarkedFunctions(FunctionMarkingStyle marking,\n                                                   List<ProfileCallTreeNode> funcNodeList,\n                                                   Dictionary<IRTextFunction, List<ProfileCallTreeNode>> funcNodeMap,\n                                                   ISession session) {\n    var nameProvider = session.CompilerInfo.NameProvider;\n\n    foreach (var loadedDoc in session.Documents) {\n      if (loadedDoc.Summary == null) {\n        continue;\n      }\n\n      var matchingFuncList = loadedDoc.Summary.FindFunctions(name =>\n                                                               marking.NameMatches(\n                                                                 nameProvider.FormatFunctionName(name)));\n\n      foreach (var func in matchingFuncList) {\n        var nodeList = session.ProfileData.CallTree.GetCallTreeNodes(func);\n\n        if (nodeList != null) {\n          funcNodeList.AddRange(nodeList); // Per-category list.\n        }\n\n        funcNodeMap[func] = nodeList;\n      }\n    }\n  }\n\n  private static Dictionary<string, List<ProfileCallTreeNode>>\n    CollectModuleSortedFunctions(ISession session, int maxFunctsPerModule) {\n    var functs = session.ProfileData.GetSortedFunctions();\n    var moduleFuncs = new Dictionary<string, List<ProfileCallTreeNode>>();\n\n    // Pick top N function per module, in exclusive weight order.\n    foreach (var pair in functs) {\n      var func = pair.Item1;\n      var list = moduleFuncs.GetOrAddValue(func.ModuleName);\n\n      if (list.Count < maxFunctsPerModule) {\n        list.Add(session.ProfileData.CallTree.GetCombinedCallTreeNode(func));\n      }\n    }\n\n    // Sort functions by weight in decreasing order.\n    foreach (var pair in moduleFuncs) {\n      pair.Value.Sort((a, b) => b.ExclusiveWeight.CompareTo(a.ExclusiveWeight));\n    }\n\n    return moduleFuncs;\n  }\n\n  private static int CommonParentCallerIndex(ProfileCallTreeNode a, ProfileCallTreeNode b) {\n    int index = 0;\n\n    do {\n      index++;\n      a = a.Caller;\n      b = b.Caller;\n    } while (a != b && a != null && b != null);\n\n    return index;\n  }\n\n  public static (string Short, string Long)\n    GenerateInstancePreviewText(ProfileCallTreeNode node, ISession session, int maxCallers = int.MaxValue) {\n    return GenerateInstancePreviewText(node, maxCallers, 80, 25, 1000, 50, session);\n  }\n\n  private static (string Short, string Long)\n    GenerateInstancePreviewText(ProfileCallTreeNode node, int maxCallers,\n                                int maxLength, int maxSingleLength,\n                                int maxCompleteLength, int maxCompleteLineLength, ISession session) {\n    const string Separator = \" \\ud83e\\udc70 \"; // Arrow character.\n    var sb = new StringBuilder();\n    var completeSb = new StringBuilder();\n    var nameProvider = session.CompilerInfo.NameProvider;\n    int remaining = maxLength;\n    int completeRemaining = maxCompleteLength;\n    int completeLineRemaining = maxCompleteLineLength;\n    int index = 0;\n    node = node.Caller;\n\n    completeSb.AppendLine(\"Right-click to select instance in Flame Graph and Call Tree\\n\");\n\n    while (node != null) {\n      // Build the shorter title stack trace.\n      if (index < maxCallers && remaining > 0) {\n        int maxNameLength = Math.Min(remaining, maxSingleLength);\n        string name = node.FormatFunctionName(nameProvider.FormatFunctionName, maxNameLength);\n        remaining -= name.Length;\n\n        if (index == 0) {\n          sb.Append(name);\n        }\n        else {\n          sb.Append($\"{Separator}{name}\");\n        }\n      }\n\n      // Build the longer tooltip stack trace.\n      if (completeRemaining > 0) {\n        int maxNameLength = Math.Min(completeRemaining, maxSingleLength);\n        string name = node.FormatFunctionName(nameProvider.FormatFunctionName, maxNameLength);\n\n        if (index == 0) {\n          completeSb.Append(name);\n        }\n        else {\n          completeSb.Append($\"{Separator}{name}\");\n        }\n\n        completeRemaining -= name.Length;\n        completeLineRemaining -= name.Length;\n\n        if (completeLineRemaining < 0) {\n          completeSb.Append(\"\\n\");\n          completeLineRemaining = maxCompleteLineLength;\n        }\n      }\n\n      node = node.Caller;\n      index++;\n    }\n\n    return (sb.ToString().Trim(), completeSb.ToString().Trim());\n  }\n\n  public static void HandleInstanceMenuItemChanged(MenuItem menuItem, MenuItem menu,\n                                                   ProfileSampleFilter instanceFilter) {\n    if (menuItem.Tag is ProfileCallTreeNode node) {\n      instanceFilter ??= new ProfileSampleFilter();\n\n      if (menuItem.IsChecked) {\n        instanceFilter.AddInstance(node);\n      }\n      else {\n        instanceFilter.RemoveInstance(node);\n      }\n    }\n    else {\n      instanceFilter.ClearInstances();\n      UncheckMenuItems(menu, menuItem);\n    }\n  }\n\n  public static void HandleThreadMenuItemChanged(MenuItem menuItem, MenuItem menu,\n                                                 ProfileSampleFilter instanceFilter) {\n    if (menuItem.Tag is int threadId) {\n      instanceFilter ??= new ProfileSampleFilter();\n\n      if (menuItem.IsChecked) {\n        instanceFilter.AddThread(threadId);\n      }\n      else {\n        instanceFilter.RemoveThread(threadId);\n      }\n    }\n    else {\n      instanceFilter.ClearThreads();\n      UncheckMenuItems(menu, menuItem);\n    }\n  }\n\n  public static void SyncThreadsMenuWithFilter(MenuItem menu, ProfileSampleFilter instanceFilter) {\n    foreach (object item in menu.Items) {\n      if (item is MenuItem menuItem && menuItem.Tag is int threadId) {\n        menuItem.IsChecked = instanceFilter != null && instanceFilter.IncludesThread(threadId);\n      }\n    }\n  }\n\n  public static string CreateProfileFilterTitle(ProfileSampleFilter instanceFilter, ISession session) {\n    if (instanceFilter == null) {\n      return \"\";\n    }\n\n    return !instanceFilter.IncludesAll ? \"Instance: \" : \"\";\n  }\n\n  public static string CreateProfileFilterDescription(ProfileSampleFilter instanceFilter, ISession session) {\n    if (instanceFilter == null) {\n      return \"\";\n    }\n\n    var sb = new StringBuilder(\"\\n\");\n\n    if (instanceFilter.HasInstanceFilter) {\n      sb.AppendLine(\"\\nInstances included:\");\n\n      foreach (var node in instanceFilter.FunctionInstances) {\n        sb.AppendLine($\" - {GenerateInstancePreviewText(node, session).Short}\");\n      }\n    }\n\n    if (instanceFilter.HasThreadFilter) {\n      sb.AppendLine(\"\\nThreads included:\");\n\n      foreach (int threadId in instanceFilter.ThreadIds) {\n        var threadInfo = session.ProfileData.FindThread(threadId);\n        string threadName = threadInfo is {HasName: true} ? threadInfo.Name : null;\n\n        if (!string.IsNullOrEmpty(threadName)) {\n          sb.AppendLine($\" - {threadId} ({threadName})\");\n        }\n        else {\n          sb.AppendLine($\" - {threadId}\");\n        }\n      }\n    }\n\n    return sb.ToString().Trim();\n  }\n\n  public static string CreateProfileFunctionDescription(FunctionProfileData funcProfile,\n                                                        ProfileDocumentMarkerSettings settings, ISession session) {\n    return CreateProfileDescription(funcProfile.Weight, funcProfile.ExclusiveWeight,\n                                    settings, session.ProfileData.ScaleFunctionWeight);\n  }\n\n  public static string CreateInlineeFunctionDescription(InlineeListItem inlinee,\n                                                        FunctionProfileData funcProfile,\n                                                        ProfileDocumentMarkerSettings settings, ISession session) {\n    return CreateProfileDescription(inlinee.Weight, inlinee.ExclusiveWeight,\n                                    settings, funcProfile.ScaleWeight);\n  }\n\n  public static string CreateProfileDescription(TimeSpan weight, TimeSpan exclusiveWeight,\n                                                ProfileDocumentMarkerSettings settings,\n                                                Func<TimeSpan, double> weightFunc) {\n    double weightPerc = weightFunc(weight);\n    double exclusiveWeightPerc = weightFunc(exclusiveWeight);\n    string weightText = $\"{weightPerc.AsPercentageString()} ({settings.FormatWeightValue(weight)})\";\n    string exclusiveWeightText =\n      $\"{exclusiveWeightPerc.AsPercentageString()} ({settings.FormatWeightValue(exclusiveWeight)})\";\n    return $\"Total time: {weightText}\\nSelf time: {exclusiveWeightText}\";\n  }\n\n  public static void SyncInstancesMenuWithFilter(MenuItem menu, ProfileSampleFilter instanceFilter) {\n    foreach (object item in menu.Items) {\n      if (item is MenuItem menuItem && menuItem.Tag is ProfileCallTreeNode node) {\n        menuItem.IsChecked = instanceFilter != null && instanceFilter.IncludesInstance(node);\n      }\n    }\n  }\n\n  public static async Task\n    CreateMarkedFunctionsMenu(MenuItem menu, bool isCategoriesMenu,\n                              MouseButtonEventHandler menuClickHandler,\n                              MouseButtonEventHandler menuRightClickHandler,\n                              List<FunctionMarkingStyle> markings, ISession session) {\n    // Collect all marked functions and their weight by category.\n    var markingCategoryList =\n      await Task.Run(() => CollectMarkedFunctions(markings, isCategoriesMenu, session));\n\n    CreateCategoriesMenu(markingCategoryList, menu, isCategoriesMenu,\n                         menuClickHandler, menuRightClickHandler, session);\n  }\n\n  private static void CreateCategoriesMenu(List<FunctionMarkingCategory> temp, MenuItem menu, bool isCategoriesMenu,\n                                           MouseButtonEventHandler menuClickHandler,\n                                           MouseButtonEventHandler menuRightClickHandler, ISession session) {\n    var defaultItems = DocumentUtils.SaveDefaultMenuItems(menu);\n    var profileItems = new List<ProfileMenuItem>();\n    int separatorIndex = !isCategoriesMenu ? defaultItems.FindIndex(item => item is Separator) : -1;\n    var markerSettings = App.Settings.DocumentSettings.ProfileMarkerSettings;\n    var categoriesValueTemplate = (DataTemplate)Application.Current.\n      FindResource(\"CategoriesProfileMenuItemValueTemplate\");\n    var checkableValueTemplate = (DataTemplate)Application.Current.\n      FindResource(\"CheckableProfileMenuItemValueTemplate\");\n    var submenuStyle = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle2\");\n    var menuStyle = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\");\n    double maxWidth = 0;\n\n    foreach (var category in temp) {\n      string text = $\"({markerSettings.FormatWeightValue(category.Weight)})\";\n      string title = null;\n      string tooltip = null;\n\n      if (isCategoriesMenu) {\n        title = category.Marking.TitleOrName;\n        tooltip = DocumentUtils.FormatLongFunctionName(category.Marking.Name);\n      }\n      else {\n        tooltip = \"Right-click to remove function marking\";\n        title = category.Marking.Name.TrimToLength(80);\n\n        if (category.Marking.HasTitle && category.Marking.IsRegex) {\n          title = $\"{category.Marking.Title.TrimToLength(40)} ({title.TrimToLength(40)}) (Regex)\";\n        }\n        else {\n          if (category.Marking.HasTitle) {\n            title = $\"{category.Marking.Title} ({title})\";\n          }\n\n          if (category.Marking.IsRegex) {\n            title = $\"{title} (Regex)\";\n          }\n        }\n      }\n\n      var value = new ProfileMenuItem(text, category.Weight.Ticks, category.Percentage) {\n        PrefixText = title,\n        ToolTip = tooltip,\n        ShowPercentageBar = markerSettings.ShowPercentageBar(category.Percentage),\n        TextWeight = markerSettings.PickTextWeight(category.Percentage),\n        PercentageBarBackColor = category.HottestFunction != null ?\n          markerSettings.PercentageBarBackColor.AsBrush() :\n          (Brush)Application.Current.FindResource(\"ProfileUncategorizedBrush\"),\n        BackColor = !isCategoriesMenu ? category.Marking.Color.AsBrush() : ColorBrushes.Transparent\n      };\n\n      var item = new MenuItem {\n        IsChecked = !isCategoriesMenu && category.Marking.IsEnabled,\n        StaysOpenOnClick = true,\n        Header = value,\n        Tag = !isCategoriesMenu ? category.Marking : category.HottestFunction ?? new object(),\n        HeaderTemplate = !isCategoriesMenu ? checkableValueTemplate : categoriesValueTemplate,\n        Style = category.SortedFunctions is {Count: > 0} ? submenuStyle : menuStyle\n      };\n\n      if (menuClickHandler != null) {\n        item.PreviewMouseLeftButtonUp += menuClickHandler;\n      }\n\n      if (menuRightClickHandler != null) {\n        item.PreviewMouseRightButtonDown += menuRightClickHandler;\n      }\n\n      item.PreviewMouseLeftButtonDown += (o, args) => {\n        if (!isCategoriesMenu && args.Source is MenuItem menuItem &&\n            menuItem.Tag is FunctionMarkingStyle) {\n          menuItem.IsChecked = !menuItem.IsChecked;\n        }\n      };\n\n      // Create a submenu with the sorted functions\n      // part of the marking/category.\n      if (category.SortedFunctions is {Count: > 0}) {\n        CreateFunctionsSubmenu(category.SortedFunctions, item, menuClickHandler, session);\n      }\n\n      defaultItems.Insert(++separatorIndex, item);\n      profileItems.Add(value);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(title, ref maxWidth, menu);\n    }\n\n    foreach (var item in profileItems) {\n      item.MinTextWidth = maxWidth;\n    }\n\n    // Populate the menu.\n    menu.Items.Clear();\n    DocumentUtils.RestoreDefaultMenuItems(menu, defaultItems);\n  }\n\n  private static void CreateFunctionsSubmenu(List<ProfileCallTreeNode> functions,\n                                             MenuItem parentMenuItem,\n                                             MouseButtonEventHandler menuClickHandler,\n                                             ISession session) {\n    var markerSettings = App.Settings.DocumentSettings.ProfileMarkerSettings;\n    var valueTemplate = (DataTemplate)Application.Current.\n      FindResource(\"ProfileMenuItemValueTemplate\");\n    var menuStyle = (Style)Application.Current.FindResource(\"SubMenuItemHeaderStyle\");\n    var profileSubItems = new List<ProfileMenuItem>();\n    double subitemMaxWidth = 0;\n    int order = 0;\n\n    foreach (var node in functions) {\n      double funcWeightPercentage = session.ProfileData.ScaleFunctionWeight(node.Weight);\n      double exclFuncWeightPercentage = session.ProfileData.ScaleFunctionWeight(node.ExclusiveWeight);\n      string funcText = $\"({markerSettings.FormatWeightValue(node.Weight)})\";\n\n      // Stop once the weight is too small to be significant.\n      if (!markerSettings.IsVisibleValue(order++, funcWeightPercentage)) {\n        break;\n      }\n\n      string tooltip =\n        $\"Exclusive Weight: {exclFuncWeightPercentage.AsPercentageString()} ({markerSettings.FormatWeightValue(node.ExclusiveWeight)})\\n\";\n      tooltip +=\n        $\"Weight: {funcWeightPercentage.AsPercentageString()} ({markerSettings.FormatWeightValue(node.Weight)})\\n\";\n      tooltip += $\"Module: {node.ModuleName}\";\n\n      if (node is ProfileCallTreeGroupNode groupNode) {\n        tooltip += $\"\\nInstances: {groupNode.Nodes.Count}\";\n      }\n\n      var funcValue = new ProfileMenuItem(funcText, node.Weight.Ticks, funcWeightPercentage) {\n        PrefixText = node.Function.FormatFunctionName(session, 60),\n        ToolTip = tooltip,\n        ShowPercentageBar = markerSettings.ShowPercentageBar(funcWeightPercentage),\n        TextWeight = markerSettings.PickTextWeight(funcWeightPercentage),\n        PercentageBarBackColor = markerSettings.PercentageBarBackColor.AsBrush()\n      };\n\n      var nodeItem = new MenuItem {\n        Header = funcValue,\n        Tag = node.Function,\n        HeaderTemplate = valueTemplate,\n        Style = menuStyle\n      };\n\n      if (menuClickHandler != null) {\n        nodeItem.PreviewMouseLeftButtonUp += menuClickHandler;\n      }\n\n      parentMenuItem.Items.Add(nodeItem);\n      profileSubItems.Add(funcValue);\n\n      // Make sure percentage rects are aligned.\n      Utils.UpdateMaxMenuItemWidth(funcValue.PrefixText, ref subitemMaxWidth, nodeItem);\n    }\n\n    foreach (var subItem in profileSubItems) {\n      subItem.MinTextWidth = subitemMaxWidth;\n    }\n  }\n\n  private static void UncheckMenuItems(MenuItem menu, MenuItem excludedItem) {\n    foreach (object item in menu.Items) {\n      if (item is MenuItem menuItem && menuItem != excludedItem) {\n        menuItem.IsChecked = false;\n      }\n    }\n  }\n\n  public static bool ComputeAssemblyWeightInRange(int startLine, int endLine,\n                                                  FunctionIR function, FunctionProfileData funcProfile,\n                                                  out TimeSpan weightSum, out int count) {\n    var metadataTag = function.GetTag<AssemblyMetadataTag>();\n    bool hasInstrOffsetMetadata = metadataTag != null && metadataTag.OffsetToElementMap.Count > 0;\n\n    if (!hasInstrOffsetMetadata) {\n      weightSum = TimeSpan.Zero;\n      count = 0;\n      return false;\n    }\n\n    weightSum = TimeSpan.Zero;\n    count = 0;\n\n    if (startLine > endLine) {\n      // Happens when selecting bottom-up.\n      (startLine, endLine) = (endLine, startLine);\n    }\n\n    foreach (var tuple in function.AllTuples) {\n      if (tuple.TextLocation.Line >= startLine &&\n          tuple.TextLocation.Line <= endLine) {\n        if (metadataTag.ElementToOffsetMap.TryGetValue(tuple, out long offset) &&\n            funcProfile.InstructionWeight.TryGetValue(offset, out var weight)) {\n          weightSum += weight;\n          count++;\n        }\n      }\n    }\n\n    return count > 1;\n  }\n\n  public static bool ComputeSourceWeightInRange(int startLine, int endLine,\n                                                SourceLineProcessingResult profileResult,\n                                                SourceLineProfileResult processingResult,\n                                                out TimeSpan weightSum, out int count) {\n    weightSum = TimeSpan.Zero;\n    count = 0;\n\n    if (startLine > endLine) {\n      // Happens when selecting bottom-up.\n      (startLine, endLine) = (endLine, startLine);\n    }\n\n    for (int i = startLine; i <= endLine; i++) {\n      int line = i;\n\n      // With assembly lines, source line numbers are shifted.\n      if (processingResult != null) {\n        if (processingResult.LineToOriginalLineMap.TryGetValue(line, out int mappedLine)) {\n          line = mappedLine;\n        }\n        else continue;\n      }\n\n      if (profileResult.SourceLineWeight.TryGetValue(line, out var weight)) {\n        weightSum += weight;\n      }\n\n      count++; // Also count lines without weight.\n    }\n\n    return count > 1;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Document/SourceDocumentMarker.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Rendering;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core;\nusing System.CodeDom.Compiler;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic class SourceDocumentMarker {\n  private const int FunctionNameMaxLength = 80;\n  private static readonly string SourceOverlayTag = \"SourceTag\";\n  private SourceDocumentMarkerSettings settings_;\n  private ICompilerIRInfo irInfo_;\n  private INameProvider nameProvider_;\n\n  public SourceDocumentMarker(SourceDocumentMarkerSettings settings, ICompilerInfoProvider compilerInfo) {\n    settings_ = settings;\n    irInfo_ = compilerInfo.IR;\n    nameProvider_ = compilerInfo.NameProvider ;\n  }\n\n  public async Task Mark(IRDocument document, FunctionIR function) {\n    if (!settings_.AnnotateSourceLines && !settings_.AnnotateInlinees) {\n      return;\n    }\n\n    var overlays = new List<IconElementOverlay>(function.InstructionCount);\n    var inlineeOverlays = new List<IconElementOverlay>(function.InstructionCount);\n    var lineLengths = new List<int>(function.InstructionCount);\n    var lineToOperandMap = new Dictionary<int, OperandIR>();\n    document.SuspendUpdate();\n\n    await Task.Run(() => {\n      // Cache the strings generated for each line and inlinee frame.\n      string lineNumberTooltip = null;\n      var inlineeLineNumberMap = new Dictionary<int, string>();\n      var inlineeFrameMap = new Dictionary<SourceStackFrame, (string Title, string Tooltip)>();\n\n      foreach (var instr in function.AllInstructions) {\n        if (settings_.MarkCallTargets) {\n          MarkCallInstruction(instr, document, lineToOperandMap);\n        }\n\n        // Annotate right-hand side with source line and inlinee info.\n        var tag = instr.GetTag<SourceLocationTag>();\n\n        if (tag == null) {\n          continue;\n        }\n\n        if (tag.Line != 0 && settings_.AnnotateSourceLines) {\n          if (!inlineeLineNumberMap.TryGetValue(tag.Line, out string label)) {\n            label = $\"{tag.Line}\";\n            inlineeLineNumberMap[tag.Line] = label;\n          }\n\n          if (lineNumberTooltip == null) {\n            string fileName = Utils.TryGetFileName(tag.FilePath);\n            lineNumberTooltip = $\"Line number for file {fileName}\\nFile path: {tag.FilePath}\";\n          }\n\n          var overlay = document.RegisterIconElementOverlay(instr, null, 16, 0, label, lineNumberTooltip);\n          overlay.Tag = SourceOverlayTag;\n          overlay.IsLabelPinned = true;\n          overlay.AllowLabelEditing = false;\n          overlay.TextColor = settings_.SourceLineTextColor.AsBrush();\n          overlay.Background = settings_.SourceLineBackColor.AsBrush();\n\n          overlays.Add(overlay);\n          lineLengths.Add(instr.TextLength);\n        }\n\n        if (tag.HasInlinees && settings_.AnnotateInlinees) {\n          var sb = new StringBuilder();\n          var tooltipSb = new StringBuilder();\n          tooltipSb.AppendLine(\"Inlined functions\");\n          tooltipSb.AppendLine(\"name:line (file) in calling order:\\n\");\n\n          var inlinees = tag.Inlinees;\n          inlineeOverlays.EnsureCapacity(inlineeOverlays.Count + inlinees.Count);\n\n          for (int k = 0; k < inlinees.Count; k++) {\n            var inlinee = inlinees[inlinees.Count - k - 1]; // Append backwards.\n\n            if (!inlineeFrameMap.TryGetValue(inlinee, out var inlineeText)) {\n              string inlineeName = nameProvider_.FormatFunctionName(inlinee.Function);\n\n              inlineeText = new ValueTuple<string, string>();\n              inlineeText.Title = $\"{inlineeName}:{inlinees[k].Line}\";\n              inlineeText.Tooltip = MakeInlineeTooltip(inlineeName, inlinee.Line, inlinee.FilePath, k);\n              inlineeFrameMap[inlinee] = inlineeText;\n            }\n\n            sb.Append(inlineeText.Title);\n            tooltipSb.AppendLine(inlineeText.Tooltip);\n\n            if (k != inlinees.Count - 1) {\n              sb.Append(\"  |  \");\n            }\n          }\n\n          // MakeInlineeTooltip(funcName, tag.Line, null, tag.Inlinees.Count, tooltipSb);\n          var inlineeOverlay =\n            document.RegisterIconElementOverlay(instr, null, 16, 0,\n                                                sb.ToString().Trim(), tooltipSb.ToString().Trim());\n          inlineeOverlay.Tag = SourceOverlayTag;\n          inlineeOverlay.TextColor = settings_.InlineeOverlayTextColor.AsBrush();\n          inlineeOverlay.Background = settings_.SourceLineBackColor.AsBrush();\n          inlineeOverlay.IsLabelPinned = true;\n          inlineeOverlay.AllowLabelEditing = false;\n          inlineeOverlays.Add(inlineeOverlay);\n        }\n      }\n\n      lineLengths.Sort();\n    });\n\n    // Place the line numbers on a column aligned with most instrs.\n    var settings = App.Settings.DocumentSettings;\n    const double lengthPercentile = 0.9; // Consider length of most lines.\n    const int overlayMargin = 10; // Distance from instruction end.\n    const int inlineeOverlayMargin = 30;\n\n    int percentileLength =\n      lineLengths.Count > 0 ? lineLengths[(int)Math.Floor(lineLengths.Count * lengthPercentile)] : 0;\n    double columnPosition = Utils.MeasureString(percentileLength, settings.FontName, settings.FontSize).Width;\n\n    // Adjust position of all overlays.\n    foreach (var overlay in overlays) {\n      double position = Math.Max(settings_.VirtualColumnPosition, columnPosition);\n      overlay.VirtualColumn = position + overlayMargin;\n    }\n\n    foreach (var overlay in inlineeOverlays) {\n      double position = Math.Max(settings_.VirtualColumnPosition, columnPosition);\n      overlay.VirtualColumn = position + overlayMargin + inlineeOverlayMargin;\n    }\n\n    if (settings_.MarkCallTargets) {\n      var callTypeFace = new Typeface(document.FontFamily, document.FontStyle, FontWeights.Bold, document.FontStretch);\n      var colorizer = new OperandColorizer(lineToOperandMap, settings_.CallTargetTextColor.AsBrush(),\n                                           settings_.CallTargetBackColor.AsBrush(), callTypeFace);\n      document.RegisterTextTransformer(colorizer);\n    }\n\n    document.ResumeUpdate();\n  }\n\n  private void MarkCallInstruction(InstructionIR instr, IRDocument document,\n                                   Dictionary<int, OperandIR> lineToOperandMap) {\n    if (irInfo_.IsCallInstruction(instr) &&\n        irInfo_.GetCallTarget(instr) is OperandIR callTargetOp &&\n        callTargetOp.HasName) {\n      // Mark only functions whose code is available in the session.\n      if (DocumentUtils.FindCallTargetSection(callTargetOp, document.Section, document.Session) != null) {\n        lineToOperandMap[instr.TextLocation.Line] = callTargetOp;\n      }\n    }\n  }\n\n  //? Currently calls are marked only with profiling data, here could be a mode\n  //? that instead uses only the IR to mark calls.\n  //private void MarkCallInstruction(InstructionIR instr, IRDocument document) {\n  //  if (irInfo_.IR.IsCallInstruction(instr) &&\n  //          irInfo_.IR.GetCallTarget(instr) is OperandIR callTargetOp &&\n  //          callTargetOp.HasName) {\n  //    var icon = IconDrawing.FromIconResource(\"ExecuteIcon\");\n  //    var overlay = document.RegisterIconElementOverlay(instr, icon, 16, 16);\n  //    overlay.IsLabelPinned = false;\n  //    overlay.UseLabelBackground = true;\n  //    overlay.AlignmentX = System.Windows.HorizontalAlignment.Left;\n\n  //    // Place before the call opcode.\n  //    int lineOffset = lineOffset = instr.OpcodeLocation.Offset - instr.TextLocation.Offset;\n  //    overlay.MarginX = Utils.MeasureString(lineOffset, App.Settings.DocumentSettings.FontName,\n  //                                          App.Settings.DocumentSettings.FontSize).Width - 20;\n  //    overlay.MarginY = 1;\n  //  }\n  //}\n\n  private string MakeInlineeTooltip(string inlineeName, int inlineeLine, string inlineeFilePath, int index) {\n    string inlineeFileName = Utils.TryGetFileName(inlineeFilePath);\n    inlineeName = inlineeName.TrimToLength(FunctionNameMaxLength);\n\n    if (!string.IsNullOrEmpty(inlineeFileName)) {\n      return $\"{inlineeName}:{inlineeLine} ({inlineeFileName})\";\n    }\n    else {\n      return $\"{inlineeName}:{inlineeLine}\";\n    }\n  }\n\n  // Use to mark the call target function names.\n  public sealed class OperandColorizer : DocumentColorizingTransformer {\n    private Dictionary<int, OperandIR> lineToOperandMap_;\n    private Brush textColor_;\n    private Brush backColor_;\n    private Typeface typeface_;\n\n    public OperandColorizer(Dictionary<int, OperandIR> lineToOperandMap,\n                            Brush textColor, Brush backColor, Typeface typeface = null) {\n      lineToOperandMap_ = lineToOperandMap;\n      textColor_ = textColor;\n      backColor_ = backColor;\n      typeface_ = typeface;\n    }\n\n    protected override void ColorizeLine(DocumentLine line) {\n      if (line.Length == 0) {\n        return;\n      }\n\n      if (!lineToOperandMap_.TryGetValue(line.LineNumber - 1, out var operand)) {\n        return;\n      }\n\n      int start = operand.TextLocation.Offset;\n      int end = start + operand.TextLength;\n\n      if (start < line.Offset || end > line.EndOffset) {\n        return;\n      }\n\n      ChangeLinePart(start, end, element => {\n        element.TextRunProperties.SetTextDecorations(TextDecorations.Underline);\n\n        if (textColor_ != null) {\n          element.TextRunProperties.SetForegroundBrush(textColor_);\n        }\n\n        if (backColor_ != null) {\n          element.TextRunProperties.SetBackgroundBrush(backColor_);\n        }\n\n        if (typeface_ != null) {\n          element.TextRunProperties.SetTypeface(typeface_);\n        }\n      });\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraph.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic class FlameGraphNode : SearchableProfileItem, IEquatable<FlameGraphNode> {\n  internal const double DefaultMargin = 4;\n  internal const double ExtraValueMargin = 20;\n  internal const double MinVisibleRectWidth = 4;\n  internal const double RecomputeVisibleRectWidth = MinVisibleRectWidth * 4;\n  internal const double MinVisibleWidth = 1;\n  internal const int MaxTextParts = 3;\n\n  public FlameGraphNode(ProfileCallTreeNode callTreeNode, TimeSpan weight, int depth,\n                        FunctionNameFormatter funcNameFormatter) :\n    base(funcNameFormatter) {\n    CallTreeNode = callTreeNode;\n    Weight = weight;\n    Depth = depth;\n  }\n\n  public virtual bool IsGroup => false;\n  public ProfileCallTreeNode CallTreeNode { get; }\n  public FlameGraphRenderer Owner { get; set; }\n  public FlameGraphNode Parent { get; set; }\n  public List<FlameGraphNode> Children { get; set; }\n  public TimeSpan ChildrenWeight { get; set; }\n  public int Depth { get; set; }\n  public HighlightingStyle Style { get; set; }\n  public Brush TextColor { get; set; }\n  public Brush ModuleTextColor { get; set; }\n  public Brush WeightTextColor { get; set; }\n  public Brush PercentageTextColor { get; set; }\n  public Rect Bounds { get; set; }\n  public double PercentageTextPosition { get; set; }\n  public uint RenderVersion { get; set; }\n  public bool IsDummyNode { get; set; }\n  public bool IsHidden { get; set; }\n  public bool HasFunction => CallTreeNode != null;\n  public bool HasChildren => Children is {Count: > 0};\n  public IRTextFunction Function => CallTreeNode?.Function;\n  public TimeSpan StartTime { get; set; }\n  public TimeSpan EndTime { get; set; }\n  public TimeSpan Duration => EndTime - StartTime;\n  public override string ModuleName =>\n    CallTreeNode is {HasFunction: true} ? CallTreeNode.ModuleName : null;\n\n  public bool IsDummyNodeOrChild {\n    get {\n      if (IsDummyNode) {\n        return true;\n      }\n\n      var node = Parent;\n\n      while (node != null) {\n        if (node.IsDummyNode) {\n          return true;\n        }\n\n        node = node.Parent;\n      }\n\n      return false;\n    }\n  }\n\n  public bool Equals(FlameGraphNode other) {\n    if (ReferenceEquals(null, other)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, other)) {\n      return true;\n    }\n\n    return Equals(CallTreeNode, other.CallTreeNode);\n  }\n\n  public static bool operator ==(FlameGraphNode left, FlameGraphNode right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(FlameGraphNode left, FlameGraphNode right) {\n    return !Equals(left, right);\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj)) {\n      return false;\n    }\n\n    if (ReferenceEquals(this, obj)) {\n      return true;\n    }\n\n    if (obj.GetType() != GetType()) {\n      return false;\n    }\n\n    return Equals((FlameGraphNode)obj);\n  }\n\n  public override int GetHashCode() {\n    return CallTreeNode != null ? CallTreeNode.GetHashCode() : 0;\n  }\n\n  protected override string GetFunctionName() {\n    return CallTreeNode is {HasFunction: true} ? CallTreeNode.FunctionName : null;\n  }\n}\n\npublic sealed class FlameGraphGroupNode : FlameGraphNode {\n  public FlameGraphGroupNode(FlameGraphNode parentNode, int startIndex,\n                             int replacedNodeCount, TimeSpan weight, int depth) :\n    base(null, weight, depth, null) {\n    Parent = parentNode;\n    ReplacedStartIndex = startIndex;\n    ReplacedNodeCount = replacedNodeCount;\n  }\n\n  public override bool IsGroup => true;\n  public int ReplacedNodeCount { get; }\n  public int ReplacedStartIndex { get; }\n  public int ReplacedEndIndex => ReplacedStartIndex + ReplacedNodeCount;\n}\n\npublic sealed class FlameGraph {\n  private FlameGraphNode rootNode_;\n  private TimeSpan rootWeight_;\n  private TimeSpan profileStartTime_;\n  private TimeSpan profileEndTime_;\n  private double rootWeightReciprocal_;\n  private double rootDurationReciprocal_;\n  private double profileDurationReciprocal_;\n  private FunctionNameFormatter nameFormatter_;\n\n  public FlameGraph(ProfileCallTree callTree, FunctionNameFormatter nameFormatter) {\n    CallTree = callTree;\n    nameFormatter_ = nameFormatter;\n  }\n\n  public ProfileCallTree CallTree { get; set; }\n\n  public FlameGraphNode RootNode {\n    get => rootNode_;\n    set {\n      rootNode_ = value;\n\n      if (rootNode_.Duration.Ticks != 0) {\n        rootDurationReciprocal_ = 1.0 / rootNode_.Duration.Ticks;\n        profileDurationReciprocal_ = 1.0 / (profileEndTime_ - profileStartTime_).Ticks;\n      }\n    }\n  }\n\n  public TimeSpan RootWeight {\n    get => rootWeight_;\n    set {\n      rootWeight_ = value;\n\n      if (rootWeight_.Ticks != 0) {\n        rootWeightReciprocal_ = 1.0 / rootWeight_.Ticks;\n      }\n    }\n  }\n\n  public List<FlameGraphNode> GetNodes(ProfileCallTreeNode node) {\n    var list = new List<FlameGraphNode>();\n    AppendNodes(node, list);\n    return list;\n  }\n\n  public void AppendNodes(ProfileCallTreeNode node, List<FlameGraphNode> resultList) {\n    if (!node.IsGroup) {\n      if (node.Tag is FlameGraphNode fgNode) {\n        resultList.Add(fgNode);\n      }\n\n      return;\n    }\n\n    var groupNode = node as ProfileCallTreeGroupNode;\n\n    foreach (var childNode in groupNode.Nodes) {\n      if (childNode.Tag is FlameGraphNode fgNode) {\n        resultList.Add(fgNode);\n      }\n    }\n  }\n\n  public FlameGraphNode GetFlameGraphNode(ProfileCallTreeNode callNode) {\n    return callNode.Tag as FlameGraphNode;\n  }\n\n  public List<FlameGraphNode> SearchNodes(string text, bool caseInsensitive) {\n    var nodes = new List<FlameGraphNode>();\n    var searcher = new TextSearcher(text, caseInsensitive);\n    SearchNodesImpl(RootNode, text, searcher, nodes);\n\n    // Sort the nodes by weight, descending.\n    nodes.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n    return nodes;\n  }\n\n  private void SearchNodesImpl(FlameGraphNode node, string text, TextSearcher searcher,\n                               List<FlameGraphNode> nodes) {\n    if (node.HasFunction) {\n      var result = searcher.FirstIndexOf(node.FunctionName);\n\n      if (result.HasValue) {\n        node.SearchResult = result;\n        nodes.Add(node);\n      }\n    }\n\n    if (node.HasChildren) {\n      foreach (var child in node.Children) {\n        SearchNodesImpl(child, text, searcher, nodes);\n      }\n    }\n  }\n\n  public void ResetSearchResults(List<FlameGraphNode> nodes) {\n    foreach (var node in nodes) {\n      node.SearchResult = null;\n    }\n  }\n\n  public List<FlameGraphNode> GetNodesInTimeRange(TimeSpan startTime, TimeSpan endTime) {\n    var nodes = new List<FlameGraphNode>();\n    GetNodesInTimeRangeImpl(RootNode, startTime, endTime, nodes);\n    return nodes;\n  }\n\n  public void Build(ProfileCallTreeNode rootNode) {\n    if (rootNode == null) {\n      // Make a dummy root node that hosts all real root nodes.\n      RootWeight = CallTree.TotalRootNodesWeight;\n      var flameNode = CreateFlameGraphNode(null, RootWeight, 0);\n      RootNode = Build(flameNode, CallTree.RootNodes, 0);\n    }\n    else {\n      // Root node overriden (consider only a call tree subset).\n      RootWeight = rootNode.Weight;\n      var flameNode = CreateFlameGraphNode(rootNode, rootNode.Weight, 0);\n      RootNode = Build(flameNode, rootNode.Children, 0);\n    }\n  }\n\n  public double ScaleWeight(FlameGraphNode node) {\n    return node.Weight.Ticks * rootWeightReciprocal_;\n  }\n\n  public double ScaleExclusiveWeight(FlameGraphNode node) {\n    return node.ExclusiveWeight.Ticks * rootWeightReciprocal_;\n  }\n\n  public double ScaleStartTime(TimeSpan time) {\n    return (time.Ticks - profileStartTime_.Ticks) * profileDurationReciprocal_;\n  }\n\n  public double ScaleStartTime(FlameGraphNode node) {\n    if (node.CallTreeNode != null) {\n      return (node.StartTime.Ticks - profileStartTime_.Ticks) * profileDurationReciprocal_;\n    }\n\n    return (node.StartTime.Ticks - RootNode.StartTime.Ticks) * rootDurationReciprocal_;\n  }\n\n  public double ScaleDuration(FlameGraphNode node) {\n    if (node.CallTreeNode != null) {\n      return (node.EndTime.Ticks - node.StartTime.Ticks) * profileDurationReciprocal_;\n    }\n\n    return (node.EndTime.Ticks - node.StartTime.Ticks) * rootDurationReciprocal_;\n  }\n\n  public double InverseScaleWeight(TimeSpan weight) {\n    return (double)RootWeight.Ticks / weight.Ticks;\n  }\n\n  private void GetNodesInTimeRangeImpl(FlameGraphNode node, TimeSpan startTime, TimeSpan endTime,\n                                       List<FlameGraphNode> nodes) {\n    if (node.StartTime >= endTime || node.EndTime <= startTime) {\n      return;\n    }\n\n    if (node.HasFunction) {\n      nodes.Add(node);\n    }\n\n    if (node.HasChildren) {\n      foreach (var child in node.Children) {\n        GetNodesInTimeRangeImpl(child, startTime, endTime, nodes);\n      }\n    }\n  }\n\n  private void AddSample(FlameGraphNode rootNode, ProfileSample sample, ResolvedProfileStack stack) {\n    var node = rootNode;\n    int depth = 0;\n\n    for (int k = stack.FrameCount - 1; k >= 0; k--) {\n      var resolvedFrame = stack.StackFrames[k];\n      \n      if (resolvedFrame.FrameDetails.Function == null) {\n        continue;\n      }\n\n      FlameGraphNode targetNode = null;\n\n      if (node.HasChildren) {\n        for (int i = node.Children.Count - 1; i >= 0; i--) {\n          var child = node.Children[i];\n\n          if (!child.CallTreeNode.Function.Equals(resolvedFrame.FrameDetails.Function)) {\n            break; // Last func is different, stop and start a new stack.\n          }\n\n          if (sample.Time - child.EndTime < TimeSpan.FromMilliseconds(100)) {\n            targetNode = child; // Also start a new stack if nothing executed for a while.\n          }\n\n          break;\n        }\n      }\n\n      if (targetNode == null) {\n        var callNode = new ProfileCallTreeNode(resolvedFrame.FrameDetails.DebugInfo,\n                                               resolvedFrame.FrameDetails.Function,\n                                               null, node.CallTreeNode);\n        targetNode = new FlameGraphNode(callNode, TimeSpan.Zero, depth, nameFormatter_);\n        node.Children ??= new List<FlameGraphNode>();\n        node.Children.Add(targetNode);\n        targetNode.StartTime = sample.Time;\n        targetNode.EndTime = sample.Time + sample.Weight;\n        targetNode.Parent = node;\n      }\n      else {\n        targetNode.StartTime = TimeSpan.FromTicks(Math.Min(targetNode.StartTime.Ticks, sample.Time.Ticks));\n        targetNode.EndTime =\n          TimeSpan.FromTicks(Math.Max(targetNode.EndTime.Ticks, sample.Time.Ticks + sample.Weight.Ticks));\n      }\n\n      if (k > 0) {\n        node.ChildrenWeight += sample.Weight;\n      }\n      else {\n        node.Weight += sample.Weight;\n      }\n\n      targetNode.Weight += sample.Weight;\n      node = targetNode;\n      depth++;\n    }\n  }\n\n  private FlameGraphNode Build(FlameGraphNode flameNode,\n                               ICollection<ProfileCallTreeNode> children, int depth) {\n    if (children == null || children.Count == 0) {\n      return flameNode;\n    }\n\n    var sortedChildren = new List<ProfileCallTreeNode>(children.Count);\n    var childrenWeight = TimeSpan.Zero;\n\n    foreach (var child in children) {\n      sortedChildren.Add(child);\n      childrenWeight += child.Weight;\n    }\n\n    // Place nodes left to right based on weight, heaviest first.\n    sortedChildren.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n\n    flameNode.Children = new List<FlameGraphNode>(children.Count);\n    flameNode.ChildrenWeight = childrenWeight;\n\n    foreach (var child in sortedChildren) {\n      var childFlameNode = CreateFlameGraphNode(child, child.Weight, depth + 1);\n      var childNode = Build(childFlameNode, child.Children, depth + 1);\n      childNode.Parent = flameNode;\n      flameNode.Children.Add(childNode);\n      child.Tag = childFlameNode; // Quick mapping between call tree and flame graph node.\n    }\n\n    return flameNode;\n  }\n\n  private FlameGraphNode CreateFlameGraphNode(ProfileCallTreeNode callTreeNode, TimeSpan weight, int depth) {\n    var flameNode = new FlameGraphNode(callTreeNode, weight, depth, nameFormatter_);\n\n    if (callTreeNode != null) {\n      flameNode.ExclusiveWeight = callTreeNode.ExclusiveWeight;\n      flameNode.Percentage = ScaleWeight(flameNode);\n      flameNode.ExclusivePercentage = ScaleExclusiveWeight(flameNode);\n    }\n    else {\n      // For the root node, exclusive time is 0% and inclusive 100%.\n      flameNode.Percentage = 1;\n    }\n\n    return flameNode;\n  }\n\n  //? TODO: Timeline not implemented\n  // public void BuildTimeline(ProfileData data, int threadId) {\n  //   Trace.WriteLine($\"Timeline Samples: {data.Samples.Count}\");\n  //   data.Samples.Sort((a, b) => a.Sample.Time.CompareTo(b.Sample.Time));\n  //\n  //   var flameNode = CreateFlameGraphNode(null, RootWeight, 0);\n  //   flameNode.StartTime = TimeSpan.MaxValue;\n  //   flameNode.EndTime = TimeSpan.MinValue;\n  //\n  //   if (data.Samples.Count > 0) {\n  //     profileStartTime_ = data.Samples[0].Sample.Time;\n  //     profileEndTime_ = data.Samples[^1].Sample.Time;\n  //   }\n  //\n  //   foreach (var (sample, stack) in data.Samples) {\n  //     if (threadId != -1 && stack.Context.ThreadId != threadId) {\n  //       continue;\n  //     }\n  //\n  //     AddSample(flameNode, sample, stack);\n  //\n  //     flameNode.StartTime = TimeSpan.FromTicks(Math.Min(flameNode.StartTime.Ticks, sample.Time.Ticks));\n  //     flameNode.EndTime =\n  //       TimeSpan.FromTicks(Math.Max(flameNode.EndTime.Ticks, sample.Time.Ticks + sample.Weight.Ticks));\n  //     flameNode.Weight = flameNode.EndTime - flameNode.StartTime + sample.Weight;\n  //   }\n  //\n  //   //flameNode.Duration = flameNode.EndTime - flameNode.StartTime;\n  //   RootNode = flameNode;\n  //   RootWeight = flameNode.Weight;\n  // }\n\n  public void Dump(FlameGraphNode node, int level = 0) {\n    Trace.Write(new string(' ', level * 2));\n    Trace.WriteLine($\"{node.CallTreeNode?.FunctionName}  | {node.Depth} | {node.Weight.TotalMilliseconds}\");\n\n    if (node.Weight.Ticks == 0) {\n      Trace.WriteLine(\"=> no weight\");\n    }\n\n    if (node.HasChildren) {\n      foreach (var child in node.Children) {\n        Dump(child, level + 1);\n      }\n    }\n\n    if (level < 1) {\n      Trace.WriteLine(\"==============================================\");\n    }\n\n    else if (level < 2) {\n      Trace.WriteLine(\"----------------------\");\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraphHost.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Profile.FlameGraphHost\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <!--  Replace CommandBindings by RelayCommand everywhere  -->\n  <UserControl.CommandBindings>\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomIn\"\n      Executed=\"ExecuteGraphZoomIn\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomOut\"\n      Executed=\"ExecuteGraphZoomOut\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.SelectFunction\"\n      Executed=\"SelectFunctionExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.OpenFunction\"\n      Executed=\"OpenFunctionExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.OpenFunctionInNewTab\"\n      Executed=\"OpenFunctionInNewTab\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.EnlargeNode\"\n      Executed=\"EnlargeNodeExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.ChangeRootNode\"\n      Executed=\"ChangeRootNodeExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.MarkAllInstances\"\n      Executed=\"MarkAllInstancesExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.MarkInstance\"\n      Executed=\"MarkInstanceExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.ClearMarkedNodes\"\n      Executed=\"ClearMarkedNodesExecuted\" />\n  </UserControl.CommandBindings>\n\n  <ProfileExplorerUi:ScrollViewerClickable\n    x:Name=\"GraphHost\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    HorizontalScrollBarVisibility=\"Auto\"\n    ScrollChanged=\"GraphHost_OnScrollChanged\"\n    VerticalScrollBarVisibility=\"Auto\">\n    <local:FlameGraphViewer x:Name=\"GraphViewer\">\n      <local:FlameGraphViewer.ContextMenu>\n        <ContextMenu>\n          <MenuItem\n            Command=\"{Binding PreviewFunctionCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Preview Function\"\n            InputGestureText=\"Alt+Return\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Show a preview popup of the function assembly or source code\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PeekDefinitionIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:CallTreeCommand.OpenFunction\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Open Function\"\n            InputGestureText=\"Return/Double-Click\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Open the function assembly view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource LayoutOpenIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:CallTreeCommand.OpenFunctionInNewTab\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Open Function in New Tab\"\n            InputGestureText=\"Ctrl+Return\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Open the function assembly view in a new tab\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource LayoutOpenNewIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Header=\"Instance\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\">\n            <MenuItem\n              Command=\"{Binding PreviewFunctionInstanceCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Preview Function Instance\"\n              InputGestureText=\"Alt+Shift+Return\"\n              IsEnabled=\"{Binding EnableSingleNodeActions}\"\n              ToolTip=\"Show a preview popup of the function assembly or source code\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource PeekDefinitionIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"{Binding OpenInstanceCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Open Function Instance\"\n              InputGestureText=\"Shift+Return\"\n              IsEnabled=\"{Binding EnableSingleNodeActions}\"\n              ToolTip=\"Open the function assembly view for only this instance of the function\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource LayoutOpenIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"{Binding OpenInstanceInNewTabCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Open Function Instance in New Tab\"\n              InputGestureText=\"Ctrl+Shift+Return\"\n              IsEnabled=\"{Binding EnableSingleNodeActions}\"\n              ToolTip=\"Open the function assembly view for only this instance of the function in a new tab\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource LayoutOpenNewIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n          </MenuItem>\n          <Separator />\n\n          <MenuItem\n            Command=\"local:CallTreeCommand.EnlargeNode\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Focus on Function\"\n            InputGestureText=\"Space/Middle-click\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Enlarge the function in the view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource FitWidthIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:CallTreeCommand.ChangeRootNode\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Set Function as Root\"\n              InputGestureText=\"Alt+Double-Click\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Restrict the view to the function instance and its callees\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource RootIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <Separator />\n          <MenuItem\n            Command=\"{Binding CopyFunctionDetailsCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Copy Function Details\"\n            InputGestureText=\"Ctrl+C\"\n            ToolTip=\"Copy the function name and additional information as an HTML table\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource ClipboardIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n\n          <MenuItem\n            Command=\"{Binding CopyDemangledFunctionNameCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Copy Function Name\"\n            InputGestureText=\"Ctrl+Shift+C\"\n            ToolTip=\"Copy the function name to the clipboard\" />\n          <MenuItem\n            Command=\"{Binding CopyFunctionNameCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Copy Mangled Function Name\"\n            InputGestureText=\"Ctrl+Alt+C\"\n            ToolTip=\"Copy the mangled function name to the clipboard (C++)\" />\n          <Separator />\n\n          <MenuItem\n            Header=\"Mark Module\"\n            ToolTip=\"Mark all functions belonging to this module (saved)\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource AddBookmarkIcon}\" />\n            </MenuItem.Icon>\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkModuleCommand}\" />\n              </MenuItem.Header>\n\n            </MenuItem>\n          </MenuItem>\n          <MenuItem\n            Header=\"Mark Function\"\n            ToolTip=\"Mark all functions with the same name (saved)\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource BookmarkIcon}\" />\n            </MenuItem.Icon>\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkFunctionCommand}\" />\n              </MenuItem.Header>\n\n            </MenuItem>\n          </MenuItem>\n          <MenuItem\n            Command=\"local:CallTreeCommand.MarkInstance\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Mark Instance\"\n            ToolTip=\"Mark this instance of the function (temporary)\">\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkInstanceCommand}\" />\n              </MenuItem.Header>\n            </MenuItem>\n          </MenuItem>\n\n          <MenuItem\n            Command=\"local:CallTreeCommand.MarkAllInstances\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Mark All Instances\"\n            ToolTip=\"Mark all instances of the function (temporary)\">\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkAllInstancesCommand}\" />\n              </MenuItem.Header>\n            </MenuItem>\n          </MenuItem>\n\n          <MenuItem\n            Command=\"local:CallTreeCommand.ClearMarkedNodes\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Clear Marked Instances\"\n            ToolTip=\"Clear all temporarily marked function instances\" />\n          <Separator />\n\n          <MenuItem\n            Command=\"local:CallTreeCommand.SelectFunction\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Select in Summary\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Select the function in the Summary view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SummaryIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding SelectFunctionCallTreeCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Select in Call Tree\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Select the function instance in the Call Tree view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource TreeIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding SelectFunctionTimelineCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Select in Timeline\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Select the function instance in the Timeline view\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource TimelineIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Header=\"Mark in Timeline\"\n            IsEnabled=\"{Binding EnableSingleNodeActions}\"\n            ToolTip=\"Mark the function instance's samples in the Timeline view\">\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkTimelineCommand}\" />\n              </MenuItem.Header>\n            </MenuItem>\n          </MenuItem>\n        </ContextMenu>\n      </local:FlameGraphViewer.ContextMenu>\n    </local:FlameGraphViewer>\n  </ProfileExplorerUi:ScrollViewerClickable>\n\n  <UserControl.InputBindings>\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding PreviewFunctionCommand}\"\n      Modifiers=\"Alt\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding PreviewFunctionInstanceCommand}\"\n      Modifiers=\"Alt+Shift\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyFunctionNameCommand}\"\n      Modifiers=\"Control+Alt\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyDemangledFunctionNameCommand}\"\n      Modifiers=\"Control+Shift\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyFunctionDetailsCommand}\"\n      Modifiers=\"Control\" />\n  </UserControl.InputBindings>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraphHost.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Animation;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic partial class FlameGraphHost : UserControl, IFunctionProfileInfoProvider, INotifyPropertyChanged {\n  private const double ZoomAmount = 1200;\n  private const double ScrollWheelZoomAmount = 800;\n  private const double TimePerFrame = 1000.0 / 60; // ~16.6ms per frame at 60Hz.\n  private const double FastPanOffset = 1000;\n  private const double DefaultPanOffset = 100;\n  private const double ZoomAnimationDuration = TimePerFrame * 8;\n  private const double EnlargeAnimationDuration = TimePerFrame * 10;\n  private const double ScrollWheelZoomAnimationDuration = TimePerFrame * 4;\n  private Stack<FlameGraphState> stateStack_;\n  private ProfileCallTree callTree_;\n  private bool dragging_;\n  private Point draggingStart_;\n  private Point draggingViewStart_;\n  private double endOffsetX_;\n  private FlameGraphNode enlargedNode_;\n  private bool ignoreScrollEvent_;\n  private double initialOffsetX_;\n  private double initialWidth_;\n  private DateTime lastWheelZoomTime_;\n  private FlameGraphNode rootNode_;\n  private FlameGraphSettings settings_;\n  private bool showNodePanel_;\n  private PopupHoverPreview nodeHoverPreview_;\n  private DoubleAnimation widthAnimation_;\n  private DoubleAnimation zoomAnimation_;\n  private double zoomPointX_;\n  private bool enableSingleNodeActions_;\n  private List<(ProfileCallTreeNode Node, HighlightingStyle Style)> unmatchedMarkedNodes_;\n\n  public FlameGraphHost() {\n    InitializeComponent();\n    settings_ = App.Settings.FlameGraphSettings;\n    stateStack_ = new Stack<FlameGraphState>();\n    SetupEvents();\n    DataContext = this;\n    ShowNodePanel = true;\n  }\n\n  public IUISession Session { get; set; }\n  public FlameGraph FlameGraph => GraphViewer.FlameGraph;\n  public List<FlameGraphNode> SelectedNodes => GraphViewer.SelectedNodes;\n  public bool UseAnimations => App.Settings.GeneralSettings.UseAnimations;\n\n  public bool EnableSingleNodeActions {\n    get => enableSingleNodeActions_;\n    set => SetField(ref enableSingleNodeActions_, value);\n  }\n\n  public RelayCommand<object> SelectFunctionCallTreeCommand => new(async obj => {\n    await SelectFunctionInPanel(ToolPanelKind.CallTree);\n  });\n  public RelayCommand<object> SelectFunctionTimelineCommand => new(async obj => {\n    await SelectFunctionInPanel(ToolPanelKind.Timeline);\n  });\n  public RelayCommand<object> SelectFunctionSourceCommand => new(async obj => {\n    await SelectFunctionInPanel(ToolPanelKind.Source);\n  });\n  public RelayCommand<object> CopyFunctionNameCommand => new(async obj => {\n    string text = \"\";\n\n    foreach (var node in SelectedNodes) {\n      if (!string.IsNullOrEmpty(text)) {\n        text += Environment.NewLine;\n      }\n\n      if (node.HasFunction) {\n        text += Session.CompilerInfo.NameProvider.GetFunctionName(node.Function);\n      }\n    }\n\n    Clipboard.SetText(text);\n  });\n  public RelayCommand<object> CopyDemangledFunctionNameCommand => new(async obj => {\n    string text = \"\";\n\n    foreach (var node in SelectedNodes) {\n      if (!string.IsNullOrEmpty(text)) {\n        text += Environment.NewLine;\n      }\n\n      if (node.HasFunction) {\n        text += Session.CompilerInfo.NameProvider.FormatFunctionName(node.Function);\n      }\n    }\n\n    Clipboard.SetText(text);\n  });\n  public RelayCommand<object> CopyFunctionDetailsCommand => new(async obj => {\n    if (SelectedNodes.Count > 0) {\n      var funcList = new List<SearchableProfileItem>();\n\n      foreach (var item in SelectedNodes) {\n        if (item.HasFunction) {\n          funcList.Add(item);\n        }\n      }\n\n      SearchableProfileItem.CopyFunctionListAsHtml(funcList);\n    }\n  });\n  public RelayCommand<object> MarkInstanceCommand => new(async obj => {\n    MarkSelectedNodes(obj, (node, color) => GraphViewer.MarkNode(node, GraphViewer.MarkedColoredNodeStyle(color)));\n  });\n  public RelayCommand<object> MarkAllInstancesCommand => new(async obj => {\n    MarkSelectedNodes(\n      obj, (node, color) => MarkFunctionInstances(node.Function, GraphViewer.MarkedColoredNodeStyle(color)));\n  });\n  public RelayCommand<object> MarkModuleCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n    MarkSelectedNodes(obj, (node, color) => markingSettings.AddModuleColor(node.ModuleName, color));\n    markingSettings.UseModuleColors = true;\n    SettingsUpdated(settings_);\n    MarkingChanged?.Invoke(this, EventArgs.Empty);\n  });\n  public RelayCommand<object> MarkFunctionCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n    MarkSelectedNodes(obj, (node, color) => markingSettings.AddFunctionColor(node.FunctionName, color));\n    markingSettings.UseFunctionColors = true;\n    SettingsUpdated(settings_);\n    MarkingChanged?.Invoke(this, EventArgs.Empty);\n  });\n  public RelayCommand<object> MarkTimelineCommand => new(async obj => {\n    if (obj is SelectedColorEventArgs e && GraphViewer.SelectedNode is {HasFunction: true}) {\n      GraphViewer.MarkNode(GraphViewer.SelectedNode, GraphViewer.MarkedColoredNodeStyle(e.SelectedColor));\n      await Session.MarkProfileFunction(GraphViewer.SelectedNode.CallTreeNode, ToolPanelKind.Timeline,\n                                        GraphViewer.MarkedColoredNodeStyle(e.SelectedColor));\n    }\n  });\n  public RelayCommand<object> PreviewFunctionCommand => new(async obj => {\n    if (GraphViewer.SelectedNode is {HasFunction: true}) {\n      var brush = GetMarkedNodeColor(GraphViewer.SelectedNode);\n      await IRDocumentPopupInstance.ShowPreviewPopup(GraphViewer.SelectedNode.Function, \"\",\n                                                     GraphViewer, Session, null, false, brush);\n    }\n  });\n  public RelayCommand<object> PreviewFunctionInstanceCommand => new(async obj => {\n    if (GraphViewer.SelectedNode is {HasFunction: true}) {\n      var filter = new ProfileSampleFilter(GraphViewer.SelectedNode.CallTreeNode);\n      var brush = GetMarkedNodeColor(GraphViewer.SelectedNode);\n      await IRDocumentPopupInstance.ShowPreviewPopup(GraphViewer.SelectedNode.Function, \"\",\n                                                     GraphViewer, Session, filter, false, brush);\n    }\n  });\n  public RelayCommand<object> OpenInstanceCommand => new(async obj => {\n    if (GraphViewer.SelectedNode is {HasFunction: true}) {\n      var filter = new ProfileSampleFilter(GraphViewer.SelectedNode.CallTreeNode);\n      var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n      await Session.OpenProfileFunction(GraphViewer.SelectedNode.CallTreeNode, mode, filter);\n    }\n  });\n  public RelayCommand<object> OpenInstanceInNewTabCommand => new(async obj => {\n    if (GraphViewer.SelectedNode is {HasFunction: true}) {\n      var filter = new ProfileSampleFilter(GraphViewer.SelectedNode.CallTreeNode);\n      await Session.OpenProfileFunction(GraphViewer.SelectedNode.CallTreeNode,\n                                        OpenSectionKind.NewTab, filter);\n    }\n  });\n\n  public bool ShowNodePanel {\n    get => showNodePanel_;\n    set => SetField(ref showNodePanel_, value);\n  }\n\n  private double GraphAreaWidth => Math.Max(0, GraphHost.ActualWidth - SystemParameters.VerticalScrollBarWidth);\n  private double GraphAreaHeight => GraphHost.ViewportHeight;\n  private Rect GraphArea => new(0, 0, GraphAreaWidth, GraphAreaHeight);\n  private Rect GraphVisibleArea => new(GraphHost.HorizontalOffset,\n                                       GraphHost.VerticalOffset,\n                                       GraphAreaWidth, GraphAreaHeight);\n  private Rect GraphHostBounds => new(0, 0, GraphHost.ActualWidth, GraphHost.ActualHeight);\n  private double GraphZoomRatio => GraphViewer.MaxGraphWidth / GraphAreaWidth;\n  private double CenterZoomPointX => GraphHost.HorizontalOffset + GraphAreaWidth / 2;\n  private double PanOffset => Utils.IsKeyboardModifierActive() ?\n    FastPanOffset : DefaultPanOffset;\n\n  public List<ProfileCallTreeNode> GetBacktrace(ProfileCallTreeNode node) {\n    return callTree_.GetBacktrace(node);\n  }\n\n  public (List<ProfileCallTreeNode>, List<ModuleProfileInfo> Modules) GetTopFunctionsAndModules(\n    ProfileCallTreeNode node) {\n    return callTree_.GetTopFunctionsAndModules(node);\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void MarkSelectedNodes(object obj, Action<FlameGraphNode, Color> action) {\n    if (obj is SelectedColorEventArgs e) {\n      foreach (var node in SelectedNodes) {\n        if (node.HasFunction) {\n          action(node, e.SelectedColor);\n        }\n      }\n    }\n  }\n\n  private Brush GetMarkedNodeColor(FlameGraphNode node) {\n    if (node is not {HasFunction: true}) {\n      return null;\n    }\n\n    return App.Settings.MarkingSettings.\n      GetMarkedNodeBrush(node.FunctionName, node.ModuleName);\n  }\n\n  public event EventHandler MarkingChanged;\n  public event EventHandler<FlameGraphNode> NodeSelected;\n  public event EventHandler NodesDeselected;\n  public event EventHandler<double> HorizontalOffsetChanged;\n  public event EventHandler<double> MaxWidthChanged;\n  public event EventHandler<FlameGraphNode> RootNodeChanged;\n  public event EventHandler RootNodeCleared;\n\n  private static double Lerp(double start, double end, double progress) {\n    return start + (end - start) * progress;\n  }\n\n  public async Task InitializeFlameGraph(ProfileCallTree callTree) {\n    List<(ProfileCallTreeNode Node, HighlightingStyle Style)> markedNodes = null;\n\n    if (GraphViewer.IsInitialized) {\n      markedNodes = new List<(ProfileCallTreeNode Node, HighlightingStyle Style)>();\n      GraphViewer.SaveFixedMarkedNodes(markedNodes);\n\n      // Combined nodes currently marked in instance N-1 of the call tree,\n      // with nodes marked from a previous call tree instance N-2... which\n      // could not be associated with flame graph nodes because they were filtered out.\n      if (unmatchedMarkedNodes_ != null) {\n        markedNodes.AddRange(unmatchedMarkedNodes_);\n      }\n\n      Reset();\n    }\n\n    callTree_ = callTree;\n\n    if (callTree_ != null) {\n      await GraphViewer.Initialize(callTree, GraphArea, settings_, Session);\n      ResetWidth();\n\n      if (markedNodes != null) {\n        unmatchedMarkedNodes_ = GraphViewer.RestoreFixedMarkedNodes(markedNodes, callTree);\n      }\n    }\n  }\n\n  public async Task InitializeTimeline(ProfileCallTree callTree, int threadId) {\n    //? TODO: Timeline-style view not used yet.\n    if (GraphViewer.IsInitialized) {\n      Reset();\n    }\n\n    callTree_ = callTree;\n\n    if (callTree != null && !GraphViewer.IsInitialized) {\n      await GraphViewer.Initialize(callTree, GraphArea, settings_, Session, true, threadId);\n    }\n  }\n\n  public void Redraw() {\n    GraphViewer.Redraw();\n  }\n\n  private void HostOnKeyUp(object sender, KeyEventArgs e) {\n    if (Utils.IsControlModifierActive()) {\n      Cursor = Cursors.Arrow;\n    }\n  }\n\n  private void BringNodeIntoView(FlameGraphNode node, bool fitSize) {\n    if (node.IsDummyNodeOrChild) {\n      // If the node is not visible at all and has no bounds computed,\n      // adjust the zoom first to make the node visible, then scroll to it.\n      EnlargeNodeIntoView(node);\n    }\n\n    var bounds = GraphViewer.ComputeNodeBounds(node);\n    var graphArea = GraphVisibleArea;\n    DoubleAnimation animation1 = null;\n    DoubleAnimation animation2 = null;\n\n    if (bounds.Left < graphArea.Left || bounds.Right > graphArea.Right) {\n      //? TODO: If node is outside on the right, increase offset to show it all\n      animation1 = ScrollToHorizontalOffset(bounds.Left);\n    }\n\n    if (bounds.Top < graphArea.Top || bounds.Bottom > graphArea.Bottom) {\n      animation2 = ScrollToVerticalOffset(bounds.Top);\n    }\n\n    if (fitSize) {\n      switch ((animation1 != null, animation2 != null)) {\n        case (true, true):\n        case (true, false): {\n          animation1.Completed += (sender, e) => EnlargeNodeIntoView(node);\n          break;\n        }\n        case (false, true): {\n          animation2.Completed += (sender, e) => EnlargeNodeIntoView(node);\n          break;\n        }\n        default: {\n          EnlargeNodeIntoView(node);\n          break;\n        }\n      }\n    }\n\n    if (UseAnimations) {\n      animation1?.BeginAnimation(FlameGraphHorizontalOffsetProperty, animation1, HandoffBehavior.SnapshotAndReplace);\n      animation2?.BeginAnimation(FlameGraphVerticalOffsetProperty, animation2, HandoffBehavior.SnapshotAndReplace);\n    }\n  }\n\n  public void SetHorizontalOffset(double offset) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    ignoreScrollEvent_ = true;\n    GraphHost.ScrollToHorizontalOffset(offset);\n  }\n\n  public async Task ChangeRootNode(FlameGraphNode node, bool saveState = true) {\n    // Update the undo stack.\n    if (saveState) {\n      SaveCurrentState(FlameGraphStateKind.ChangeRootNode);\n    }\n\n    ResetHighlightedNodes();\n    SetHorizontalOffset(0);\n    rootNode_ = node;\n    await GraphViewer.Initialize(GraphViewer.FlameGraph.CallTree, node.CallTreeNode,\n                                 GraphHostBounds, settings_, Session);\n    GraphViewer.RestoreFixedMarkedNodes();\n\n    if (node.HasFunction) {\n      RootNodeChanged?.Invoke(this, node);\n    }\n  }\n\n  public async Task RestorePreviousState() {\n    if (!stateStack_.TryPop(out var state)) {\n      return;\n    }\n\n    switch (state.Kind) {\n      case FlameGraphStateKind.EnlargeNode: {\n        // IF there is no node the root node should be selected.\n        var node = state.Node ?? GraphViewer.FlameGraph.RootNode;\n        await EnlargeNode(node, false, state.VerticalOffset, state.HorizontalOffset);\n        break;\n      }\n      case FlameGraphStateKind.ChangeRootNode: {\n        RootNodeCleared?.Invoke(this, EventArgs.Empty);\n        await ChangeRootNode(state.Node, false);\n        GraphViewer.RestoreFixedMarkedNodes();\n        break;\n      }\n      default: {\n        SetMaxWidth(state.MaxGraphWidth);\n        GraphHost.ScrollToHorizontalOffset(state.HorizontalOffset);\n        GraphHost.ScrollToVerticalOffset(state.VerticalOffset);\n        break;\n      }\n    }\n  }\n\n  public void SetMaxWidth(double maxWidth, double duration = ZoomAnimationDuration) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    if (Math.Abs(maxWidth - GraphViewer.MaxGraphWidth) < double.Epsilon) {\n      return;\n    }\n\n    if (UseAnimations) {\n      var animation = new DoubleAnimation(GraphViewer.MaxGraphWidth, maxWidth, TimeSpan.FromMilliseconds(duration));\n      animation.Completed += (sender, args) => {\n        widthAnimation_ = null;\n        MaxWidthChanged?.Invoke(this, GraphViewer.MaxGraphWidth);\n      };\n\n      widthAnimation_ = animation;\n      BeginAnimation(FlameGraphWidthProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    }\n    else {\n      CancelWidthAnimation();\n      GraphViewer.UpdateMaxWidth(maxWidth);\n      MaxWidthChanged?.Invoke(this, GraphViewer.MaxGraphWidth);\n    }\n  }\n\n  public void ResetWidth() {\n    // Hack due to possible WPF bug that forces a re-layout of the flame graph\n    // so that the scroll bars are displayed if needed.\n    Dispatcher.Invoke(() => {\n      GraphViewer.InvalidateMeasure();\n      GraphViewer.InvalidateVisual();\n\n      // If there is a vertical scroll bar, resize the flame graph to fit\n      // the view and not show a horizontal scroll bar initially.\n      Dispatcher.Invoke(() => {\n        ResetWidthImpl();\n      }, DispatcherPriority.ContextIdle);\n    }, DispatcherPriority.Normal);\n  }\n\n  private void ResetWidthImpl() {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    SetMaxWidth(GraphAreaWidth);\n    ScrollToVerticalOffset(0);\n    ScrollToHorizontalOffset(0);\n    ResetHighlightedNodes();\n  }\n\n  public void ZoomIn() {\n    ZoomIn(CenterZoomPointX);\n  }\n\n  public void ZoomOut() {\n    ZoomOut(CenterZoomPointX);\n  }\n\n  private async Task NavigateToParentNode() {\n    if (enlargedNode_ != null && enlargedNode_.Parent != null) {\n      SelectNode(enlargedNode_.Parent);\n      await EnlargeNode(enlargedNode_.Parent);\n    }\n    else if (rootNode_ != null && rootNode_.Parent != null) {\n      await ChangeRootNode(rootNode_.Parent);\n    }\n  }\n\n  public void Reset() {\n    callTree_ = null;\n    ScrollToOffsets(0, 0);\n\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    ResetHighlightedNodes();\n    GraphViewer.Reset();\n  }\n\n  public void SelectNode(FlameGraphNode node, bool fitSize = false, bool bringIntoView = true) {\n    GraphViewer.SelectNode(node);\n\n    if (bringIntoView) {\n      BringNodeIntoView(node, fitSize);\n    }\n  }\n\n  public void SelectNode(ProfileCallTreeNode node, bool fitSize = false, bool bringIntoView = true) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    var fgNode = GraphViewer.SelectNode(node);\n\n    if (bringIntoView) {\n      BringNodeIntoView(fgNode, fitSize);\n    }\n  }\n\n  public void SelectNodes(List<ProfileCallTreeNode> nodes, bool fitSize = false, bool bringIntoView = true) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    var fgNodes = GraphViewer.SelectNodes(nodes);\n\n    if (bringIntoView && fgNodes.Count > 0) {\n      BringNodeIntoView(fgNodes[0], fitSize);\n    }\n  }\n\n  public void MarkFunctions(List<ProfileCallTreeNode> nodes, HighlightingStyle style) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    GraphViewer.MarkNodes(nodes, style, false);\n  }\n\n  public void MarkFunctionInstances(IRTextFunction func, HighlightingStyle style) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    var nodes = callTree_.GetCallTreeNodes(func);\n    GraphViewer.MarkNodes(nodes, style, true);\n  }\n\n  public void ClearMarkedFunctions(bool clearFixedNodes = false) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    GraphViewer.ResetMarkedNodes(clearFixedNodes);\n\n    if (clearFixedNodes) {\n      unmatchedMarkedNodes_ = null;\n    }\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private async Task SelectFunctionInPanel(ToolPanelKind panelKind) {\n    if (GraphViewer.SelectedNode is {HasFunction: true}) {\n      await Session.SelectProfileFunctionInPanel(GraphViewer.SelectedNode.CallTreeNode, panelKind);\n    }\n  }\n\n  private void SetupEvents() {\n    GraphHost.SizeChanged += (sender, args) => {\n      if (GraphViewer.IsInitialized && args.NewSize.Width > GraphViewer.MaxGraphWidth) {\n        SetMaxWidth(args.NewSize.Width);\n      }\n    };\n\n    // Setup events for the flame graph area.\n    GraphHost.PreviewMouseWheel += OnPreviewMouseWheel;\n    MouseLeftButtonDown += OnMouseLeftButtonDown;\n    MouseLeftButtonUp += OnMouseLeftButtonUp;\n    MouseRightButtonDown += OnMouseRightButtonDown;\n    MouseDoubleClick += OnMouseDoubleClick;\n    MouseMove += OnMouseMove;\n    MouseDown += OnMouseDown; // Handles back button.\n    KeyDown += HostOnKeyDown;\n    KeyUp += HostOnKeyUp;\n\n    SetupPreviewPopup();\n  }\n\n  private void SetupPreviewPopup() {\n    if (nodeHoverPreview_ != null) {\n      nodeHoverPreview_.Unregister();\n      nodeHoverPreview_ = null;\n    }\n\n    if (!settings_.ShowNodePopup) {\n      return;\n    }\n\n    nodeHoverPreview_ = new PopupHoverPreview(GraphViewer,\n                                              TimeSpan.FromMilliseconds(settings_.NodePopupDuration),\n                                              (mousePoint, previewPoint) => {\n                                                var pointedNode = GraphViewer.FindPointedNode(mousePoint);\n                                                var callNode = pointedNode?.CallTreeNode;\n\n                                                if (callNode != null) {\n                                                  // If popup already opened for this node reuse the instance.\n                                                  if (nodeHoverPreview_.PreviewPopup is CallTreeNodePopup\n                                                    popup) {\n                                                    popup.UpdatePosition(previewPoint, GraphViewer);\n                                                  }\n                                                  else {\n                                                    popup = new CallTreeNodePopup(\n                                                      callNode, this, previewPoint, GraphViewer, Session);\n                                                  }\n\n                                                  popup.UpdateNode(callNode);\n                                                  return popup;\n                                                }\n\n                                                return null;\n                                              },\n                                              (mousePoint, popup) => {\n                                                if (popup is CallTreeNodePopup previewPopup) {\n                                                  // Hide if not over the same node anymore.\n                                                  var pointedNode = GraphViewer.FindPointedNode(mousePoint);\n                                                  return previewPopup.CallTreeNode.CallTreeNode !=\n                                                         pointedNode?.CallTreeNode;\n                                                }\n\n                                                return true;\n                                              },\n                                              popup => {\n                                                Session.RegisterDetachedPanel(popup);\n                                              });\n  }\n\n  private void HidePreviewPopup() {\n    if (nodeHoverPreview_ != null) {\n      nodeHoverPreview_.Hide();\n    }\n  }\n\n  private async void OnMouseDown(object sender, MouseButtonEventArgs e) {\n    if (e.ChangedButton == MouseButton.Middle &&\n        e.ButtonState == MouseButtonState.Pressed) {\n      // Select the node under the mouse cursor first, then expand.\n      var point = e.GetPosition(GraphViewer);\n      var node = GraphViewer.FindPointedNode(point);\n\n      if (node != null && node != GraphViewer.SelectedNode) {\n        SelectNode(node, false, false);\n      }\n\n      await EnlargeNode(GraphViewer.SelectedNode);\n      e.Handled = true;\n    }\n    else if (e.ChangedButton == MouseButton.XButton1 &&\n             e.ButtonState == MouseButtonState.Pressed) {\n      await RestorePreviousState();\n      e.Handled = true;\n    }\n  }\n\n  private async void OnMouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    if (IsMouseOutsideViewport(e)) {\n      return;\n    }\n\n    var point = e.GetPosition(GraphViewer);\n    var pointedNode = GraphViewer.FindPointedNode(point);\n\n    if (pointedNode != null) {\n      await HandleOpenFunctionAction(pointedNode);\n      e.Handled = true;\n    }\n    else {\n      double zoomPointX = e.GetPosition(GraphViewer).X;\n\n      if (Utils.IsShiftModifierActive()) {\n        ZoomOut(zoomPointX, false);\n        e.Handled = true;\n      }\n      else {\n        ZoomIn(zoomPointX, false);\n        e.Handled = true;\n      }\n    }\n  }\n\n  private async Task OpenFunction(FlameGraphNode node) {\n    await OpenFunction(node.CallTreeNode);\n  }\n\n  private async Task OpenFunction(ProfileCallTreeNode node) {\n    if (node is {HasFunction: true} && node.Function.HasSections) {\n      var openMode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n      await Session.OpenProfileFunction(node, openMode);\n    }\n  }\n\n  private DoubleAnimation ScrollToHorizontalOffset(double offset, double duration = ZoomAnimationDuration) {\n    if (UseAnimations) {\n      var animation = new DoubleAnimation(GraphHost.HorizontalOffset, offset, TimeSpan.FromMilliseconds(duration));\n      BeginAnimation(FlameGraphHorizontalOffsetProperty, animation, HandoffBehavior.SnapshotAndReplace);\n      return animation;\n    }\n    else {\n      GraphHost.ScrollToHorizontalOffset(offset);\n      return null;\n    }\n  }\n\n  private DoubleAnimation ScrollToVerticalOffset(double offset, double duration = ZoomAnimationDuration) {\n    if (UseAnimations) {\n      var animation1 = new DoubleAnimation(GraphHost.VerticalOffset, offset, TimeSpan.FromMilliseconds(duration));\n      BeginAnimation(FlameGraphVerticalOffsetProperty, animation1, HandoffBehavior.SnapshotAndReplace);\n      return animation1;\n    }\n    else {\n      GraphHost.ScrollToVerticalOffset(offset);\n      return null;\n    }\n  }\n\n  private void EnlargeNodeIntoView(FlameGraphNode node) {\n    // Adjust the zoom level so that the node is at least MinNodeWidth large.\n    const double MinNodeWidth = 20;\n    var bounds = GraphViewer.ComputeNodeBounds(node);\n    double zoomX = 0;\n\n    if (bounds.Width < MinNodeWidth) {\n      zoomX = MinNodeWidth - bounds.Width;\n    }\n    else if (bounds.Width > GraphAreaWidth) {\n      zoomX = GraphAreaWidth - bounds.Width;\n    }\n    else {\n      return;\n    }\n\n    double zoomPointX = bounds.Left;\n    double nodeRatio = GraphViewer.FlameGraph.InverseScaleWeight(node.Weight);\n    double zoomAmount = zoomX * nodeRatio;\n    AdjustZoom(zoomAmount, zoomPointX, UseAnimations, ZoomAnimationDuration);\n  }\n\n  private async Task EnlargeNode(FlameGraphNode node, bool saveState = true,\n                                 double verticalOffset = double.NaN,\n                                 double horizontalOffset = double.NaN) {\n    if (node == null) {\n      return;\n    }\n\n    if (Utils.IsAltModifierActive()) {\n      await ChangeRootNode(node);\n      return;\n    }\n\n    // Update the undo stack.\n    if (saveState) {\n      SaveCurrentState(FlameGraphStateKind.EnlargeNode);\n    }\n\n    // How wide the entire graph needs to be so that the node fils the view.\n    double ratio = GraphViewer.FlameGraph.InverseScaleWeight(node.Weight);\n    double newMaxWidth = GraphAreaWidth * ratio;\n    double prevRatio = GraphViewer.MaxGraphWidth / GraphAreaWidth;\n    double offsetRatio = prevRatio > 0 ? ratio / prevRatio : ratio;\n\n    enlargedNode_ = node;\n    initialWidth_ = newMaxWidth;\n    initialOffsetX_ = GraphHost.HorizontalOffset;\n    endOffsetX_ = GraphViewer.ComputeNodeBounds(node).X * offsetRatio;\n\n    if (!double.IsNaN(horizontalOffset)) {\n      endOffsetX_ = horizontalOffset;\n    }\n\n    SetMaxWidth(newMaxWidth, EnlargeAnimationDuration);\n\n    if (UseAnimations) {\n      var horizontalAnim = new DoubleAnimation(0.0, 1.0, TimeSpan.FromMilliseconds(EnlargeAnimationDuration));\n      BeginAnimation(FlameGraphEnlargeNodeProperty, horizontalAnim, HandoffBehavior.SnapshotAndReplace);\n    }\n    else {\n      GraphHost.ScrollToHorizontalOffset(endOffsetX_);\n    }\n\n    if (!double.IsNaN(verticalOffset)) {\n      if (UseAnimations) {\n        var verticalAnim = new DoubleAnimation(GraphHost.VerticalOffset, verticalOffset,\n                                               TimeSpan.FromMilliseconds(EnlargeAnimationDuration));\n        BeginAnimation(FlameGraphVerticalOffsetProperty, verticalAnim, HandoffBehavior.SnapshotAndReplace);\n      }\n      else {\n        GraphHost.ScrollToVerticalOffset(verticalOffset);\n      }\n    }\n  }\n\n  private void SaveCurrentState(FlameGraphStateKind changeKind) {\n    var state = new FlameGraphState {\n      Kind = changeKind,\n      MaxGraphWidth = GraphViewer.MaxGraphWidth,\n      HorizontalOffset = GraphHost.HorizontalOffset,\n      VerticalOffset = GraphHost.VerticalOffset\n    };\n\n    switch (changeKind) {\n      case FlameGraphStateKind.EnlargeNode: {\n        state.Node = enlargedNode_;\n        break;\n      }\n      case FlameGraphStateKind.ChangeRootNode: {\n        state.Node = GraphViewer.FlameGraph.RootNode;\n        break;\n      }\n    }\n\n    stateStack_.Push(state);\n  }\n\n  private void ResetHighlightedNodes() {\n    GraphViewer.ResetNodeHighlighting();\n  }\n\n  private void OnMouseMove(object sender, MouseEventArgs e) {\n    if (dragging_) {\n      var offset = draggingViewStart_ - (e.GetPosition(GraphHost) - draggingStart_);\n      GraphHost.ScrollToHorizontalOffset(offset.X);\n      GraphHost.ScrollToVerticalOffset(offset.Y);\n      CaptureMouse();\n      e.Handled = true;\n    }\n  }\n\n  private async void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) {\n    if (dragging_) {\n      EndMouseDragging();\n      e.Handled = true;\n\n      // Don't deselect nodes if dragging was done.\n      var draggingEnd = e.GetPosition(GraphHost);\n      var draggingDistance = draggingEnd - draggingStart_;\n\n      if (Math.Abs(draggingDistance.X) > double.Epsilon ||\n          Math.Abs(draggingDistance.Y) > double.Epsilon) {\n        return;\n      }\n    }\n\n    HandleNodeSelection(e);\n  }\n\n  private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    // Start dragging the graph only if the click starts inside the scroll area,\n    // excluding the scroll bars, and it in an empty spot.\n    if (IsMouseOutsideViewport(e)) {\n      return;\n    }\n\n    HidePreviewPopup();\n    var pointedNode = GraphViewer.FindPointedNode(e.GetPosition(GraphViewer));\n\n    if (pointedNode == null) {\n      StartMouseDragging(e);\n      e.Handled = true;\n    }\n  }\n\n  private void OnMouseRightButtonDown(object sender, MouseButtonEventArgs e) {\n    HidePreviewPopup();\n    HandleNodeSelection(e);\n  }\n\n  private bool HandleNodeSelection(MouseButtonEventArgs e) {\n    if (IsMouseOutsideViewport(e)) {\n      return false;\n    }\n\n    var pointedNode = GraphViewer.FindPointedNode(e.GetPosition(GraphViewer));\n\n    if (pointedNode == null) {\n      GraphViewer.ClearSelection(); // Click outside graph is captured here.\n      NodesDeselected?.Invoke(this, EventArgs.Empty);\n      EnableSingleNodeActions = SelectedNodes.Count < 2;\n      return false;\n    }\n    else {\n      NodeSelected?.Invoke(this, pointedNode);\n      EnableSingleNodeActions = SelectedNodes.Count < 2;\n      return true;\n    }\n  }\n\n  private void StartMouseDragging(MouseButtonEventArgs e) {\n    HidePreviewPopup();\n    dragging_ = true;\n    draggingStart_ = e.GetPosition(GraphHost);\n    draggingViewStart_ = new Point(GraphHost.HorizontalOffset, GraphHost.VerticalOffset);\n    Cursor = Cursors.SizeAll;\n  }\n\n  private bool IsMouseOutsideViewport(MouseButtonEventArgs e) {\n    var point = e.GetPosition(GraphHost);\n    return point.X < 0 ||\n           point.Y < 0 ||\n           point.X >= GraphHost.ViewportWidth ||\n           point.Y >= GraphHost.ViewportHeight;\n  }\n\n  private async void HostOnKeyDown(object sender, KeyEventArgs e) {\n    switch (e.Key) {\n      case Key.Return: {\n        if (GraphViewer.SelectedNode != null) {\n          await HandleOpenFunctionAction(GraphViewer.SelectedNode);\n          e.Handled = true;\n        }\n\n        break;\n      }\n      case Key.Space: {\n        await EnlargeNode(GraphViewer.SelectedNode);\n        e.Handled = true;\n        break;\n      }\n      case Key.Left: {\n        ScrollToRelativeOffsets(-PanOffset, 0);\n        e.Handled = true;\n        break;\n      }\n      case Key.Right: {\n        ScrollToRelativeOffsets(PanOffset, 0);\n        e.Handled = true;\n        break;\n      }\n      case Key.Up: {\n        if (Utils.IsControlModifierActive()) {\n          await NavigateToParentNode();\n        }\n        else {\n          ScrollToRelativeOffsets(0, -PanOffset);\n        }\n\n        e.Handled = true;\n        break;\n      }\n      case Key.Down: {\n        if (Utils.IsControlModifierActive()) {\n          await NavigateToChildNode();\n        }\n        else {\n          ScrollToRelativeOffsets(0, PanOffset);\n        }\n\n        e.Handled = true;\n        break;\n      }\n      case Key.OemPlus:\n      case Key.Add: {\n        if (Utils.IsControlModifierActive()) {\n          ZoomIn(CenterZoomPointX);\n          e.Handled = true;\n        }\n\n        break;\n      }\n      case Key.OemMinus:\n      case Key.Subtract: {\n        if (Utils.IsControlModifierActive()) {\n          ZoomOut(CenterZoomPointX);\n          e.Handled = true;\n        }\n\n        break;\n      }\n      case Key.D0:\n      case Key.NumPad0: {\n        if (Utils.IsControlModifierActive()) {\n          ResetWidth();\n          e.Handled = true;\n        }\n\n        break;\n      }\n      case Key.Back: {\n        await RestorePreviousState();\n        e.Handled = true;\n        break;\n      }\n    }\n\n    if (e.Handled) {\n      HidePreviewPopup();\n    }\n  }\n\n  private async Task HandleOpenFunctionAction(FlameGraphNode node) {\n    if (Utils.IsAltModifierActive()) {\n      if (Utils.IsShiftModifierActive()) {\n        // Ctrl+Shift+action => preview function instance.\n        PreviewFunctionInstanceCommand.Execute(node);\n      }\n      else {\n        // Ctrl+Shift+action => preview function.\n        PreviewFunctionCommand.Execute(node);\n      }\n    }\n    else {\n      // action => open function.\n      // Shift+action => open function instance.\n      if (Utils.IsShiftModifierActive()) {\n        OpenInstanceInNewTabCommand.Execute(node);\n      }\n      else {\n        await OpenFunction(node);\n      }\n    }\n  }\n\n  private void ScrollToRelativeOffsets(double adjustmentX, double adjustmentY) {\n    double offsetX = GraphHost.HorizontalOffset;\n    double offsetY = GraphHost.VerticalOffset;\n    ScrollToOffsets(offsetX + adjustmentX, offsetY + adjustmentY);\n  }\n\n  private void ScrollToOffsets(double offsetX, double offsetY) {\n    GraphHost.ScrollToHorizontalOffset(offsetX);\n    GraphHost.ScrollToVerticalOffset(offsetY);\n  }\n\n  private void CancelWidthAnimation() {\n    if (widthAnimation_ != null) {\n      widthAnimation_.BeginTime = null;\n      BeginAnimation(FlameGraphWidthProperty, widthAnimation_);\n      widthAnimation_ = null;\n    }\n  }\n\n  private void CancelZoomAnimation() {\n    if (zoomAnimation_ != null) {\n      zoomAnimation_.BeginTime = null;\n      BeginAnimation(FlameGraphWidthProperty, zoomAnimation_);\n      zoomAnimation_ = null;\n    }\n  }\n\n  private void AdjustMaxWidth(double amount, double duration = ZoomAnimationDuration) {\n    double newWidth = Math.Max(GraphAreaWidth, GraphViewer.MaxGraphWidth + amount);\n    SetMaxWidth(newWidth, duration);\n  }\n\n  private void OnPreviewMouseWheel(object sender, MouseWheelEventArgs e) {\n    HidePreviewPopup();\n\n    if (Utils.IsShiftModifierActive()) {\n      // Turn vertical scrolling into horizontal scrolling.\n      GraphHost.ScrollToHorizontalOffset(GraphHost.HorizontalOffset - e.Delta);\n      e.Handled = true;\n      return;\n    }\n\n    if (!(Utils.IsKeyboardModifierActive() ||\n          e.LeftButton == MouseButtonState.Pressed ||\n          e.RightButton == MouseButtonState.Pressed)) {\n      // Zoom when Ctrl/Alt/Shift or left mouse button are pressed.\n      return;\n    }\n\n    // Cancel ongoing dragging operation.\n    if (dragging_) {\n      EndMouseDragging();\n    }\n\n    // Disable animation if scrolling without interruption.\n    var time = DateTime.UtcNow;\n    var timeElapsed = time - lastWheelZoomTime_;\n    bool animate = UseAnimations && timeElapsed.TotalMilliseconds > ScrollWheelZoomAnimationDuration;\n\n    double amount = ScrollWheelZoomAmount * GraphZoomRatio; // Keep step consistent.\n    double step = amount * Math.CopySign(1 + e.Delta / 1000.0, e.Delta);\n    double zoomPointX = e.GetPosition(GraphViewer).X;\n    AdjustZoom(step, zoomPointX, animate, ScrollWheelZoomAnimationDuration);\n\n    lastWheelZoomTime_ = time;\n    e.Handled = true;\n  }\n\n  private void EndMouseDragging() {\n    dragging_ = false;\n    Cursor = Cursors.Arrow;\n    ReleaseMouseCapture();\n  }\n\n  private void AdjustZoom(double step, double zoomPointX, bool animate, double duration = 0.0) {\n    double initialWidth = GraphViewer.MaxGraphWidth;\n    double initialOffsetX = GraphHost.HorizontalOffset;\n    AdjustMaxWidth(step, duration);\n\n    // Maintain the zoom point under the mouse by adjusting the horizontal offset.\n    if (UseAnimations) {\n      zoomPointX_ = zoomPointX;\n      initialWidth_ = initialWidth;\n      initialOffsetX_ = initialOffsetX;\n      var animation = new DoubleAnimation(0.0, 1.0, TimeSpan.FromMilliseconds(duration));\n\n      animation.Completed += (sender, args) => {\n        zoomAnimation_ = null;\n      };\n\n      zoomAnimation_ = animation;\n      BeginAnimation(FlameGraphZoomProperty, animation, HandoffBehavior.SnapshotAndReplace);\n    }\n    else {\n      CancelWidthAnimation();\n      CancelZoomAnimation();\n      AdjustGraphOffset(zoomPointX, initialWidth, initialOffsetX);\n    }\n  }\n\n  private void AdjustGraphOffset(double zoomPointX, double initialWidth, double initialOffsetX) {\n    double zoom = GraphViewer.MaxGraphWidth / initialWidth;\n    double offsetAdjustment = initialOffsetX / zoom + zoomPointX;\n    GraphHost.ScrollToHorizontalOffset(offsetAdjustment * zoom - zoomPointX);\n  }\n\n  private void AdjustEnlargedNodeOffset(double progress) {\n    double offset = Lerp(initialOffsetX_, endOffsetX_, progress);\n    GraphHost.ScrollToHorizontalOffset(offset);\n  }\n\n  private void AdjustZoomPointOffset(double progress) {\n    double zoom = GraphViewer.MaxGraphWidth / initialWidth_;\n    double offsetAdjustment = initialOffsetX_ / zoom + zoomPointX_;\n    GraphHost.ScrollToHorizontalOffset(offsetAdjustment * zoom - zoomPointX_);\n  }\n\n  private void ExecuteGraphZoomIn(object sender, ExecutedRoutedEventArgs e) {\n    ZoomIn(CenterZoomPointX);\n  }\n\n  private void ZoomIn(double zoomPointX, bool considerSelectedNode = true) {\n    if (considerSelectedNode && GraphViewer.SelectedNode != null) {\n      var bounds = GraphViewer.ComputeNodeBounds(GraphViewer.SelectedNode);\n      zoomPointX = bounds.Left + bounds.Width / 2;\n    }\n\n    AdjustZoom(ZoomAmount * GraphZoomRatio, zoomPointX, UseAnimations, ZoomAnimationDuration);\n  }\n\n  private void ExecuteGraphZoomOut(object sender, ExecutedRoutedEventArgs e) {\n    ZoomOut(CenterZoomPointX);\n  }\n\n  private void ZoomOut(double zoomPointX, bool considerSelectedNode = true) {\n    if (considerSelectedNode && GraphViewer.SelectedNode != null) {\n      var bounds = GraphViewer.ComputeNodeBounds(GraphViewer.SelectedNode);\n      zoomPointX = bounds.Left + bounds.Width / 2;\n    }\n\n    AdjustZoom(-ZoomAmount * (GraphZoomRatio * 0.5), zoomPointX, UseAnimations, ZoomAnimationDuration);\n  }\n\n  private void GraphHost_OnScrollChanged(object sender, ScrollChangedEventArgs e) {\n    if (!GraphViewer.IsInitialized) {\n      return;\n    }\n\n    GraphViewer.UpdateVisibleArea(GraphVisibleArea);\n\n    if (!ignoreScrollEvent_) {\n      HorizontalOffsetChanged?.Invoke(this, GraphHost.HorizontalOffset);\n    }\n    else {\n      ignoreScrollEvent_ = false;\n    }\n  }\n\n  private async Task NavigateToChildNode() {\n    if (enlargedNode_ != null && enlargedNode_.HasChildren) {\n      GraphViewer.SelectNode(enlargedNode_.Children[0]);\n      await EnlargeNode(enlargedNode_.Children[0]);\n    }\n    else if (rootNode_ != null && rootNode_.HasChildren) {\n      await ChangeRootNode(rootNode_.Children[0]);\n    }\n  }\n\n  private async void SelectFunctionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await SelectFunctionInPanel(ToolPanelKind.Section);\n  }\n\n  private async void OpenFunctionExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await OpenFunction(GraphViewer.SelectedNode, OpenSectionKind.ReplaceCurrent);\n  }\n\n  private async Task OpenFunction(FlameGraphNode node, OpenSectionKind openMode) {\n    if (node is {HasFunction: true}) {\n      await Session.OpenProfileFunction(node.CallTreeNode, openMode);\n    }\n  }\n\n  private async void OpenFunctionInNewTab(object sender, ExecutedRoutedEventArgs e) {\n    await OpenFunction(GraphViewer.SelectedNode, OpenSectionKind.NewTab);\n  }\n\n  private async void ChangeRootNodeExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GraphViewer.SelectedNode != null) {\n      await ChangeRootNode(GraphViewer.SelectedNode);\n    }\n  }\n\n  private void MarkAllInstancesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GraphViewer.SelectedNode != null &&\n        GraphViewer.SelectedNode.HasFunction) {\n      MarkFunctionInstances(GraphViewer.SelectedNode.Function,\n                            GraphViewer.MarkedNodeStyle);\n    }\n  }\n\n  private void MarkInstanceExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GraphViewer.SelectedNode != null &&\n        GraphViewer.SelectedNode.HasFunction) {\n      GraphViewer.MarkNode(GraphViewer.SelectedNode, GraphViewer.MarkedNodeStyle);\n    }\n  }\n\n  private void ClearMarkedNodesExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ClearMarkedFunctions(true);\n  }\n\n  private async void EnlargeNodeExecuted(object sender, ExecutedRoutedEventArgs e) {\n    if (GraphViewer.SelectedNode != null) {\n      await EnlargeNode(GraphViewer.SelectedNode);\n    }\n  }\n\n  public async Task ClearRootNode() {\n    // Undo all states until a root node change is found.\n    while (stateStack_.TryPop(out var state)) {\n      if (state.Kind == FlameGraphStateKind.ChangeRootNode) {\n        RootNodeCleared?.Invoke(this, EventArgs.Empty);\n        GraphViewer.RestoreFixedMarkedNodes();\n        await ChangeRootNode(state.Node, false); // May enable a previous root node.\n        break;\n      }\n    }\n  }\n\n  public void SettingsUpdated(FlameGraphSettings value) {\n    settings_ = value;\n    GraphViewer.SettingsUpdated(value);\n    SetupPreviewPopup();\n  }\n\n  public void ClearSelection() {\n    GraphViewer.ClearSelection();\n  }\n\n  private enum FlameGraphStateKind {\n    Default,\n    EnlargeNode,\n    ChangeRootNode\n  }\n\n  private class FlameGraphState {\n    public FlameGraphStateKind Kind { get; set; }\n    public FlameGraphNode Node { get; set; }\n    public double MaxGraphWidth { get; set; }\n    public double HorizontalOffset { get; set; }\n    public double VerticalOffset { get; set; }\n  }\n\n    #region Animation support\n\n  public static DependencyProperty FlameGraphWidthProperty =\n    DependencyProperty.Register(nameof(FlameGraphWidth), typeof(double), typeof(FlameGraphHost),\n                                new PropertyMetadata(0.0, FlameGraphWidthChanged));\n  public static DependencyProperty FlameGraphZoomProperty =\n    DependencyProperty.Register(nameof(FlameGraphOffset), typeof(double), typeof(FlameGraphHost),\n                                new PropertyMetadata(0.0, FlameGraphOffsetChanged));\n  public static DependencyProperty FlameGraphEnlargeNodeProperty =\n    DependencyProperty.Register(nameof(FlameGraphEnlargeNodeProperty), typeof(double), typeof(FlameGraphHost),\n                                new PropertyMetadata(0.0, FlameGraphOffsetChanged));\n  public static DependencyProperty FlameGraphHorizontalOffsetProperty =\n    DependencyProperty.Register(nameof(FlameGraphHorizontalOffset), typeof(double), typeof(FlameGraphHost),\n                                new PropertyMetadata(0.0, FlameGraphHorizontalOffsetChanged));\n  public static DependencyProperty FlameGraphVerticalOffsetProperty =\n    DependencyProperty.Register(nameof(FlameGraphVerticalOffset), typeof(double), typeof(FlameGraphHost),\n                                new PropertyMetadata(0.0, FlameGraphVerticalOffsetChanged));\n\n  private static void FlameGraphWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n    if (d is FlameGraphHost panel) {\n      panel.FlameGraphWidth = (double)e.NewValue;\n    }\n  }\n\n  private static void FlameGraphOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n    if (d is FlameGraphHost panel) {\n      if (e.Property == FlameGraphZoomProperty) {\n        panel.AdjustZoomPointOffset((double)e.NewValue);\n      }\n      else {\n        panel.AdjustEnlargedNodeOffset((double)e.NewValue);\n      }\n    }\n  }\n\n  private static void FlameGraphVerticalOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n    if (d is FlameGraphHost panel) {\n      panel.GraphHost.ScrollToVerticalOffset((double)e.NewValue);\n    }\n  }\n\n  private static void FlameGraphHorizontalOffsetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {\n    if (d is FlameGraphHost panel) {\n      panel.GraphHost.ScrollToHorizontalOffset((double)e.NewValue);\n    }\n  }\n\n  public double FlameGraphWidth {\n    get => GraphViewer.MaxGraphWidth;\n    set {\n      GraphViewer.UpdateMaxWidth(value);\n      MaxWidthChanged?.Invoke(this, value);\n    }\n  }\n\n  public double FlameGraphOffset {\n    get => 0;\n    set { }\n  }\n\n  public double FlameGraphVerticalOffset {\n    get => 0;\n    set { }\n  }\n\n  public double FlameGraphHorizontalOffset {\n    get => 0;\n    set { }\n  }\n\n    #endregion\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraphPanel.xaml",
    "content": "﻿<ProfileExplorerUi:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.Profile.FlameGraphPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <ProfileExplorerUi:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n      Executed=\"ExecuteGraphResetWidth\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomIn\"\n      Executed=\"ExecuteGraphZoomIn\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomOut\"\n      Executed=\"ExecuteGraphZoomOut\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.PreviousSearchResult\"\n      Executed=\"PreviousSearchResultExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.NextSearchResult\"\n      Executed=\"NextSearchResultExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.ClearSearch\"\n      Executed=\"ClearSearchExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.FocusSearch\"\n      Executed=\"FocusSearchExecuted\" />\n  </ProfileExplorerUi:ToolPanelControl.CommandBindings>\n\n  <ProfileExplorerUi:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"R\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n      CommandTarget=\"{Binding ElementName=GraphHost}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"D0\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n      CommandTarget=\"{Binding ElementName=GraphHost}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:CallTreeCommand.PreviousSearchResult\"\n      Modifiers=\"Shift\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:CallTreeCommand.NextSearchResult\" />\n    <KeyBinding\n      Key=\"F\"\n      Command=\"local:CallTreeCommand.FocusSearch\"\n      Modifiers=\"Ctrl\" />\n  </ProfileExplorerUi:ToolPanelControl.InputBindings>\n\n  <ProfileExplorerUi:ToolPanelControl.Resources>\n    <Style\n      x:Key=\"ColumnsGridSplitterStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"2\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Settings.ShowDetailsPanel}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"NodePanelColumnsStyle\"\n      TargetType=\"{x:Type ColumnDefinition}\">\n      <Style.Setters>\n        <Setter Property=\"Width\" Value=\"325\" />\n        <Setter Property=\"MinWidth\" Value=\"325\" />\n      </Style.Setters>\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Settings.ShowDetailsPanel}\"\n          Value=\"False\">\n          <DataTrigger.Setters>\n            <Setter Property=\"Width\" Value=\"0\" />\n            <Setter Property=\"MaxWidth\" Value=\"0\" />\n            <Setter Property=\"MinWidth\" Value=\"0\" />\n          </DataTrigger.Setters>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n  </ProfileExplorerUi:ToolPanelControl.Resources>\n\n  <Grid IsEnabled=\"{Binding HasCallTree}\">\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      x:Name=\"ToolbarHost\"\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"45\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Grid.Column=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        DockPanel.Dock=\"Left\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <Button\n            Margin=\"4,0,0,0\"\n            Click=\"UndoButton_Click\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Go back to previous state (Backspace/Mouse Back)\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource DockLeftIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Back\" />\n            </StackPanel>\n          </Button>\n          <Separator />\n\n          <Button\n            Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom the graph view to 100% (Ctrl+R/Ctrl+0)\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource ResetWidthIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Reset\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Command=\"ProfileExplorerUi:GraphCommand.GraphZoomOut\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom Out (Ctrl+_\">\n            <Image\n              Width=\"15\"\n              Height=\"15\"\n              Source=\"{StaticResource ZoomOutIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Button\n            Command=\"ProfileExplorerUi:GraphCommand.GraphZoomIn\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Zoom In (Ctrl+=)\">\n            <Image\n              Width=\"15\"\n              Height=\"15\"\n              Source=\"{StaticResource ZoomInIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Separator />\n\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.SyncSelection, Mode=TwoWay}\"\n            ToolTip=\"Sync function displayed in other profiling views with selection\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource SwitchIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"2,0,0,0\"\n                Text=\"Sync\" />\n            </StackPanel>\n          </ToggleButton>\n\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.SyncSourceFile, Mode=TwoWay}\"\n            ToolTip=\"Sync Source File view with selection\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SourceIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"2,0,0,0\"\n                Text=\"Source\" />\n            </StackPanel>\n          </ToggleButton>\n          <Separator />\n\n          <ToggleButton\n            Height=\"20\"\n            Click=\"ToggleButton_Click\"\n            Content=\"m!F\"\n            Padding=\"0,0,0,1\"\n            IsChecked=\"{Binding Path=Settings.PrependModuleToFunction, Mode=TwoWay}\"\n            ToolTip=\"Show the module name in front of the function name\" />\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.ShowDetailsPanel, Mode=TwoWay}\"\n            ToolTip=\"Show the Function Details panel on the right-hand side\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource SidebarIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock Text=\"Details\" />\n            </StackPanel>\n          </ToggleButton>\n          <Separator />\n\n          <TextBlock\n            Margin=\"2,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Foreground=\"Indigo\"\n            Text=\"Root: \"\n            ToolTip=\"Root function of the flame graph\"\n            Visibility=\"{Binding HasRootNode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <TextBlock\n            MaxWidth=\"200\"\n            Margin=\"2,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Foreground=\"Indigo\"\n            Text=\"{Binding RootNode.FunctionName}\"\n            TextTrimming=\"CharacterEllipsis\"\n            ToolTip=\"{Binding RootNode.FunctionName, Converter={StaticResource LongFunctionNameConverter}}\"\n            Visibility=\"{Binding HasRootNode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <Button\n            x:Name=\"RootNodeResetButton\"\n            Click=\"RootNodeResetButton_OnClick\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            ToolTip=\"Reset root function and display whole flame graph\"\n            Visibility=\"{Binding HasRootNode, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ClearIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Separator Visibility=\"{Binding HasRootNode, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          <Image\n            Margin=\"2,0,0,0\"\n            Source=\"{StaticResource SearchIcon}\"\n            Style=\"{StaticResource DisabledImageStyle}\" />\n          <Grid Height=\"24\">\n            <TextBox\n              x:Name=\"FunctionFilter\"\n              Width=\"200\"\n              Margin=\"4,0,0,0\"\n              HorizontalAlignment=\"Center\"\n              VerticalContentAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              TextChanged=\"FunctionFilter_OnTextChanged\"\n              ToolTip=\"Filter function list based based on a substring (Ctrl+F).&#x0a;Wildcards * in the name are supported, e.g. prefix*foo*\">\n              <TextBox.InputBindings>\n                <KeyBinding\n                  Key=\"Escape\"\n                  Command=\"local:CallTreeCommand.ClearSearch\"\n                  CommandParameter=\"{Binding ElementName=FunctionFilter}\"\n                  CommandTarget=\"{Binding ElementName=GraphHost}\" />\n              </TextBox.InputBindings>\n            </TextBox>\n            <TextBlock\n              Margin=\"8,4\"\n              Foreground=\"DimGray\"\n              IsHitTestVisible=\"False\"\n              Text=\"Search functions\"\n              Visibility=\"{Binding ElementName=FunctionFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Grid>\n\n          <Button\n            Command=\"local:CallTreeCommand.ClearSearch\"\n            CommandParameter=\"{Binding ElementName=FunctionFilter}\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Reset searched function\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ClearIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <TextBlock\n            Margin=\"8,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"Results:\"\n            Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding Path=SearchResultText, UpdateSourceTrigger=PropertyChanged}\"\n            Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <Button\n            Command=\"local:CallTreeCommand.PreviousSearchResult\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Previous search result\">\n            <Image\n              Source=\"{StaticResource UpArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"\n              Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Button>\n          <Button\n            Command=\"local:CallTreeCommand.NextSearchResult\"\n            CommandTarget=\"{Binding ElementName=GraphHost}\"\n            ToolTip=\"Next search result\">\n            <Image\n              Source=\"{StaticResource DownArrowIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\"\n              Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Button>\n        </ToolBar>\n      </ToolBarTray>\n\n      <ProfileExplorerUi:PanelToolbarTray\n        Grid.Column=\"1\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"True\"\n        HasPinButton=\"False\"\n        HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n        SettingsClicked=\"PanelToolbarTray_SettingsClicked\" />\n    </Grid>\n\n    <Grid\n      x:Name=\"GraphDetailsPanelHost\"\n      Grid.Row=\"1\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Style=\"{StaticResource ColumnsGridSplitterStyle}\" />\n        <ColumnDefinition Style=\"{StaticResource NodePanelColumnsStyle}\" />\n      </Grid.ColumnDefinitions>\n\n      <local:FlameGraphHost x:Name=\"GraphHost\" />\n\n      <GridSplitter\n        Grid.Column=\"1\"\n        Width=\"2\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        Background=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\" />\n\n      <local:CallTreeNodePanel\n        x:Name=\"NodeDetailsPanel\"\n        Grid.Column=\"2\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Stretch\"\n        ShowDetails=\"True\" />\n    </Grid>\n  </Grid>\n</ProfileExplorerUi:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraphPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic partial class FlameGraphPanel : ToolPanelControl, IFunctionProfileInfoProvider, INotifyPropertyChanged {\n  private FlameGraphSettings settings_;\n  private bool panelVisible_;\n  private ProfileCallTree callTree_;\n  private ProfileCallTree pendingCallTree_; // Tree to show when panel becomes visible.\n  private List<FlameGraphNode> searchResultNodes_;\n  private int searchResultIndex_;\n  private bool showSearchSection_;\n  private string searchResultText_;\n  private bool hasRootNode;\n  private FlameGraphNode rootNode_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private CancelableTaskInstance searchTask_;\n\n  public FlameGraphPanel() {\n    InitializeComponent();\n    settings_ = App.Settings.FlameGraphSettings;\n    searchTask_ = new CancelableTaskInstance(false);\n    SetupEvents();\n    DataContext = this;\n    CallTree = null;\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.FlameGraph;\n\n  public override IUISession Session {\n    get => base.Session;\n    set {\n      base.Session = value;\n      GraphHost.Session = value;\n      NodeDetailsPanel.Initialize(value, this);\n    }\n  }\n\n  public FlameGraphSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      ReloadSettings();\n      OnPropertyChanged();\n    }\n  }\n\n  public ProfileCallTree CallTree {\n    get => callTree_;\n    set {\n      SetField(ref callTree_, value);\n      OnPropertyChanged(nameof(HasCallTree));\n    }\n  }\n\n  public bool HasCallTree => callTree_ != null;\n\n  public bool ShowSearchSection {\n    get => showSearchSection_;\n    set {\n      if (showSearchSection_ != value) {\n        showSearchSection_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public string SearchResultText {\n    get => searchResultText_;\n    set {\n      if (searchResultText_ != value) {\n        searchResultText_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public bool HasRootNode {\n    get => hasRootNode;\n    set {\n      if (hasRootNode != value) {\n        hasRootNode = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public FunctionMarkingSettings MarkingSettings => App.Settings.MarkingSettings;\n\n  public FlameGraphNode RootNode {\n    get => rootNode_;\n    set => SetField(ref rootNode_, value);\n  }\n\n  public List<ProfileCallTreeNode> GetBacktrace(ProfileCallTreeNode node) {\n    return callTree_.GetBacktrace(node);\n  }\n\n  public (List<ProfileCallTreeNode>, List<ModuleProfileInfo> Modules) GetTopFunctionsAndModules(\n    ProfileCallTreeNode node) {\n    return callTree_.GetTopFunctionsAndModules(node);\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public override async void OnShowPanel() {\n    base.OnShowPanel();\n    panelVisible_ = true;\n    await InitializePendingCallTree();\n  }\n\n  public override async void OnSessionStart() {\n    base.OnSessionStart();\n    await InitializePendingCallTree();\n  }\n\n  public async Task DisplayFlameGraph() {\n    var callTree = Session.ProfileData.CallTree;\n    await SchedulePendingCallTree(callTree);\n  }\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    NodeDetailsPanel.SaveListColumnSettings();\n    NodeDetailsPanel.Reset();\n    GraphHost.Reset();\n    CallTree = null;\n    pendingCallTree_ = null;\n  }\n\n  public void MarkFunctions(List<ProfileCallTreeNode> nodes) {\n    GraphHost.MarkFunctions(nodes, GraphHost.GraphViewer.SelectedNodeStyle);\n  }\n\n  public void ClearMarkedFunctions() {\n    GraphHost.ClearMarkedFunctions();\n  }\n\n  public async Task SelectFunction(IRTextFunction function, bool bringIntoView = true) {\n    if (!HasCallTree) {\n      return;\n    }\n\n    GraphHost.ClearSelection();\n    var groupNode = callTree_.GetCombinedCallTreeNode(function);\n\n    if (groupNode is {Nodes.Count: > 0}) {\n      GraphHost.SelectNode(groupNode, true, bringIntoView);\n      await NodeDetailsPanel.ShowWithDetailsAsync(groupNode);\n    }\n  }\n\n  public async Task SelectFunction(ProfileCallTreeNode node, bool bringIntoView = true, bool showDetails = true) {\n    if (!HasCallTree) {\n      return;\n    }\n\n    if (node is ProfileCallTreeGroupNode groupNode) {\n      node = groupNode.Nodes[0];\n    }\n\n    GraphHost.ClearSelection();\n    GraphHost.SelectNode(node, true, bringIntoView);\n\n    if (showDetails) {\n      await NodeDetailsPanel.ShowWithDetailsAsync(node);\n    }\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  private bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private async Task SchedulePendingCallTree(ProfileCallTree callTree) {\n    // Display flame graph once the panel is visible and visible area is valid.\n    if (pendingCallTree_ == null) {\n      pendingCallTree_ = callTree;\n      await InitializePendingCallTree();\n    }\n  }\n\n  private async Task InitializePendingCallTree() {\n    if (pendingCallTree_ != null && panelVisible_) {\n      // Delay the initialization to ensure the panel is actually visible\n      // and the available area is valid.\n      await Dispatcher.BeginInvoke(async () => {\n        await InitializeCallTree(pendingCallTree_);\n      }, DispatcherPriority.Render);\n\n      pendingCallTree_ = null;\n    }\n  }\n\n  private async Task InitializeCallTree(ProfileCallTree callTree) {\n    CallTree = callTree;\n    NodeDetailsPanel.Reset();\n    await GraphHost.InitializeFlameGraph(callTree);\n  }\n\n  private void SetupEvents() {\n    GraphHost.NodeSelected += GraphHost_NodeSelected;\n    GraphHost.NodesDeselected += GraphHost_NodesDeselected;\n    GraphHost.RootNodeChanged += GraphHostOnRootNodeChanged;\n    GraphHost.RootNodeCleared += GraphHostOnRootNodeCleared;\n    GraphHost.MarkingChanged += (sender, args) => UpdateMarkingUI();\n\n    // Setup events for the node details view.\n    NodeDetailsPanel.NodeInstanceChanged += NodeDetailsPanel_NodeInstanceChanged;\n    NodeDetailsPanel.BacktraceNodeClick += NodeDetailsPanel_NodeClick;\n    NodeDetailsPanel.BacktraceNodeDoubleClick += NodeDetailsPanel_NodeDoubleClick;\n    NodeDetailsPanel.InstanceNodeClick += NodeDetailsPanel_NodeClick;\n    NodeDetailsPanel.InstanceNodeDoubleClick += NodeDetailsPanel_NodeDoubleClick;\n    NodeDetailsPanel.FunctionNodeClick += NodeDetailsPanel_NodeClick;\n    NodeDetailsPanel.FunctionNodeDoubleClick += NodeDetailsPanel_NodeDoubleClick;\n    NodeDetailsPanel.NodesSelected += NodeDetailsPanel_NodesSelected;\n    NodeDetailsPanel.MarkingChanged += (sender, args) => UpdateMarkingUI();\n  }\n\n  private void GraphHostOnRootNodeCleared(object sender, EventArgs e) {\n    HasRootNode = false;\n    RootNode = null;\n    GraphHost.ResetWidth();\n  }\n\n  private void GraphHostOnRootNodeChanged(object sender, FlameGraphNode node) {\n    HasRootNode = true;\n    RootNode = node;\n    GraphHost.ResetWidth();\n  }\n\n  private async Task UpdateNodeDetailsPanel() {\n    var selectedNodes = GraphHost.SelectedNodes;\n\n    if (selectedNodes.Count == 0) {\n      NodeDetailsPanel.Reset();\n    }\n    else {\n      var callTreeNodes = new List<ProfileCallTreeNode>();\n\n      foreach (var node in selectedNodes) {\n        if (node.HasFunction) {\n          callTreeNodes.Add(node.CallTreeNode);\n        }\n      }\n\n      // Display the a combined view of all selected nodes.\n      var combinedNode = await Task.Run(() => ProfileCallTree.CombinedCallTreeNodes(callTreeNodes));\n      await NodeDetailsPanel.ShowWithDetailsAsync(combinedNode);\n    }\n  }\n\n  private async void GraphHost_NodesDeselected(object sender, EventArgs e) {\n    await UpdateNodeDetailsPanel();\n\n    if (settings_.SyncSelection) {\n      await Session.ProfileFunctionDeselected();\n    }\n\n    if (GraphHost.SelectedNodes.Count == 0) {\n      Session.SetApplicationStatus(\"\");\n    }\n  }\n\n  private async void GraphHost_NodeSelected(object sender, FlameGraphNode node) {\n    if (!node.HasFunction) {\n      return;\n    }\n\n    await UpdateNodeDetailsPanel();\n\n    if (settings_.SyncSourceFile) {\n      // Load the source file and scroll to the hottest line.\n      await Session.OpenProfileSourceFile(node.CallTreeNode);\n    }\n\n    if (settings_.SyncSelection) {\n      await Session.ProfileFunctionSelected(node.CallTreeNode, PanelKind);\n    }\n\n    // When selecting multiple nodes, display the weight sum in the status bar.\n    var selectedNodes = GraphHost.SelectedNodes;\n\n    if (selectedNodes.Count > 1) {\n      var nodes = new List<ProfileCallTreeNode>();\n\n      foreach (var selectedNode in selectedNodes) {\n        if (selectedNode.HasFunction) {\n          nodes.Add(selectedNode.CallTreeNode);\n        }\n      }\n\n      var selectionWeight = ProfileCallTree.CombinedCallTreeNodesWeight(nodes);\n      double weightPercentage = 0;\n\n      if (rootNode_ != null) {\n        // Scale based on the current root node, which may be overriden.\n        weightPercentage = selectionWeight.Ticks / (double)rootNode_.Weight.Ticks;\n      }\n      else {\n        weightPercentage = Session.ProfileData.ScaleFunctionWeight(selectionWeight);\n      }\n\n      string text =\n        $\"Selected {nodes.Count}: {weightPercentage.AsPercentageString()} ({selectionWeight.AsMillisecondsString()})\";\n      Session.SetApplicationStatus(text, \"Sum of selected flame graph nodes\");\n    }\n    else {\n      Session.SetApplicationStatus(\"\");\n    }\n  }\n\n  private void NodeDetailsPanel_NodesSelected(object sender, List<ProfileCallTreeNode> e) {\n    GraphHost.SelectNodes(e, true);\n  }\n\n  private void NodeDetailsPanel_NodeInstanceChanged(object sender, ProfileCallTreeNode e) {\n    GraphHost.SelectNode(e, true);\n  }\n\n  private async void NodeDetailsPanel_NodeClick(object sender, ProfileCallTreeNode e) {\n    if (settings_.SyncSelection) {\n      await Session.ProfileFunctionSelected(e, ToolPanelKind.FlameGraph);\n    }\n  }\n\n  private async void NodeDetailsPanel_NodeDoubleClick(object sender, ProfileCallTreeNode e) {\n    await OpenFunction(e);\n  }\n\n  private async Task OpenFunction(ProfileCallTreeNode node) {\n    if (node is {HasFunction: true} && node.Function.HasSections) {\n      var openMode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n      await Session.OpenProfileFunction(node, openMode);\n    }\n  }\n\n  private void ExecuteGraphResetWidth(object sender, ExecutedRoutedEventArgs e) {\n    GraphHost.ResetWidth();\n  }\n\n  private void ExecuteGraphZoomIn(object sender, ExecutedRoutedEventArgs e) {\n    GraphHost.ZoomIn();\n  }\n\n  private void ExecuteGraphZoomOut(object sender, ExecutedRoutedEventArgs e) {\n    GraphHost.ZoomOut();\n  }\n\n  private void PanelToolbarTray_SettingsClicked(object sender, EventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private async void UndoButton_Click(object sender, RoutedEventArgs e) {\n    await GraphHost.RestorePreviousState();\n  }\n\n  private async void FunctionFilter_OnTextChanged(object sender, TextChangedEventArgs e) {\n    string text = FunctionFilter.Text.Trim();\n    await SearchFlameGraph(text);\n  }\n\n  private async Task SearchFlameGraph(string text) {\n    // Wait for a potentially ongoing search to finish.\n    using var task = await searchTask_.CancelCurrentAndCreateTaskAsync();\n\n    // Reset marking of previous results.\n    var prevSearchResultNodes = searchResultNodes_;\n    searchResultNodes_ = null;\n\n    if (prevSearchResultNodes != null) {\n      GraphHost.GraphViewer.ResetSearchResultNodes(prevSearchResultNodes);\n    }\n\n    if (text.Length > 1) {\n      bool caseInsensitive = !App.Settings.SectionSettings.FunctionSearchCaseSensitive;\n      searchResultNodes_ = await Task.Run(() => GraphHost.FlameGraph.SearchNodes(text, caseInsensitive));\n      GraphHost.GraphViewer.MarkSearchResultNodes(searchResultNodes_);\n      UpdateSearchResultText();\n\n      // Update search result navigation.\n      searchResultIndex_ = -1;\n      ShowSearchSection = true;\n      SelectNextSearchResultNoLock();\n    }\n    else {\n      ShowSearchSection = false;\n    }\n  }\n\n  private void UpdateSearchResultText() {\n    SearchResultText = searchResultNodes_ is {Count: > 0} ?\n      $\"{searchResultIndex_ + 1} / {searchResultNodes_.Count}\"\n      : \"Not found\";\n  }\n\n  private async Task SelectPreviousSearchResult() {\n    using var task = await searchTask_.CancelCurrentAndCreateTaskAsync();\n\n    if (searchResultNodes_ != null && searchResultIndex_ > 0) {\n      searchResultIndex_--;\n      UpdateSearchResultText();\n      GraphHost.SelectNode(searchResultNodes_[searchResultIndex_], true);\n    }\n  }\n\n  private async Task SelectNextSearchResult() {\n    using var task = await searchTask_.CancelCurrentAndCreateTaskAsync();\n    SelectNextSearchResultNoLock();\n  }\n\n  private void SelectNextSearchResultNoLock() {\n    if (searchResultNodes_ != null && searchResultIndex_ < searchResultNodes_.Count - 1) {\n      searchResultIndex_++;\n      UpdateSearchResultText();\n      GraphHost.SelectNode(searchResultNodes_[searchResultIndex_], true);\n    }\n  }\n\n  private async void PreviousSearchResultExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await SelectPreviousSearchResult();\n  }\n\n  private async void NextSearchResultExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await SelectNextSearchResult();\n  }\n\n  private void ClearSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    ((TextBox)e.Parameter).Text = string.Empty;\n  }\n\n  private void FocusSearchExecuted(object sender, ExecutedRoutedEventArgs e) {\n    FunctionFilter.Focus();\n    FunctionFilter.SelectAll();\n  }\n\n  private async void PanelToolbarTray_OnHelpClicked(object sender, EventArgs e) {\n    await HelpPanel.DisplayPanelHelp(PanelKind, Session);\n  }\n\n  private async void RootNodeResetButton_OnClick(object sender, RoutedEventArgs e) {\n    await GraphHost.ClearRootNode();\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    //? TODO: Redesign settings change detection, doesn't work well\n    //? when a panel shows multiple settings objects.\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<FlameGraphOptionsPanel, FlameGraphSettings>(\n      settings_.Clone(), GraphDetailsPanelHost, Session,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(settings_)) {\n          Settings = newSettings;\n          NodeDetailsPanel.Settings = App.Settings.CallTreeNodeSettings;\n          App.Settings.FlameGraphSettings = newSettings;\n\n          if (commit) {\n            App.SaveApplicationSettings();\n          }\n\n          return settings_.Clone();\n        }\n\n        return null;\n      },\n      () => optionsPanelPopup_ = null);\n  }\n\n  private async void ToggleButton_Click(object sender, RoutedEventArgs e) {\n    // Force an update for toolbar buttons.\n    await ReloadSettings();\n  }\n\n  private async Task ReloadSettings() {\n    GraphHost.SettingsUpdated(settings_);\n    UpdateMarkingUI();\n  }\n\n  private void UpdateMarkingUI() {\n    UpdateMarkedFunctions(false);\n    Session.FunctionMarkingChanged(ToolPanelKind.FlameGraph);\n  }\n\n  public override async Task OnReloadSettings() {\n    Settings = App.Settings.FlameGraphSettings;\n  }\n\n  public void UpdateMarkedFunctions(bool externalCall) {\n    GraphHost.Redraw();\n    NodeDetailsPanel.UpdateMarkedFunctions();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraphRenderer.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Profile.CallTree;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic class FlameGraphRenderer {\n  private const double DefaultTextSize = 12;\n  private const double DefaultNodeHeight = 18;\n  private const double CompactTextSize = 11;\n  private const double CompactNodeHeight = 15;\n  private const string FontName = \"Segoe UI\";\n  private FlameGraphSettings settings_;\n  private FlameGraph flameGraph_;\n  private int maxNodeDepth_;\n  private uint renderVersion_;\n  private double nodeHeight_;\n  private double maxWidth_;\n  private double prevMaxWidth_;\n  private double minVisibleRectWidth_;\n  private Rect visibleArea_;\n  private Rect quadVisibleArea_;\n  private Rect quadGraphArea_;\n  private Typeface font_;\n  private Typeface nameFont_;\n  private double fontSize_;\n  private Pen defaultBorder_;\n  private Pen kernelBorder_;\n  private Pen managedBorder_;\n  private Brush placeholderTileBrush_;\n  private DrawingVisual graphVisual_;\n  private GlyphRunCache glyphs_;\n  private GlyphRunCache nameGlyphs_;\n  private QuadTree<FlameGraphNode> nodesQuadTree_;\n  private QuadTree<FlameGraphGroupNode> dummyNodesQuadTree_;\n  private Dictionary<HighlightingStyle, HighlightingStyle> dummyNodeStyles_;\n  private GuidelineSet cachedTextGuidelines_;\n  private GuidelineSet cachedNodeGuidelines_;\n  private GuidelineSet cachedDummyNodeGuidelines_;\n  private SolidColorBrush nodeTextBrush_;\n  private SolidColorBrush kernelNodeTextBrush_;\n  private SolidColorBrush managedNodeTextBrush_;\n  private SolidColorBrush nodeModuleBrush_;\n  private SolidColorBrush nodeWeightBrush_;\n  private SolidColorBrush nodePercentageBrush_;\n  private SolidColorBrush searchResultMarkingBrush_;\n\n  public FlameGraphRenderer(FlameGraph flameGraph, Rect visibleArea, FlameGraphSettings settings) {\n    settings_ = settings;\n    flameGraph_ = flameGraph;\n    maxWidth_ = visibleArea.Width;\n    prevMaxWidth_ = maxWidth_;\n    visibleArea_ = visibleArea;\n    UpdateGraphSizes();\n    ReloadSettings();\n    dummyNodeStyles_ = new Dictionary<HighlightingStyle, HighlightingStyle>();\n  }\n\n  public double MaxGraphWidth => maxWidth_;\n  public double MaxGraphHeight => (maxNodeDepth_ + 1) * nodeHeight_;\n  public Rect VisibleArea => visibleArea_;\n  public Rect GraphArea => new(0, 0, MaxGraphWidth, MaxGraphHeight);\n  public Dictionary<FlameGraphNode, HighlightingStyle> SelectedNodes { get; set; }\n\n  private void ReloadSettings() {\n    settings_.ResedCachedPalettes();\n    App.Settings.MarkingSettings.ResetCachedPalettes();\n    defaultBorder_ = ColorPens.GetPen(settings_.NodeBorderColor, 0.5);\n    kernelBorder_ = ColorPens.GetPen(settings_.KernelNodeBorderColor, 1);\n    managedBorder_ = ColorPens.GetPen(settings_.ManagedNodeBorderColor, 1);\n\n    font_ = new Typeface(FontName);\n    nameFont_ = new Typeface(new FontFamily(FontName), FontStyles.Normal,\n                             FontWeights.Medium, FontStretches.Normal);\n    nodeTextBrush_ = settings_.NodeTextColor.AsBrush();\n    kernelNodeTextBrush_ = settings_.KernelNodeTextColor.AsBrush();\n    managedNodeTextBrush_ = settings_.ManagedNodeTextColor.AsBrush();\n    nodeModuleBrush_ = settings_.NodeModuleColor.AsBrush();\n    nodeWeightBrush_ = settings_.NodeWeightColor.AsBrush();\n    nodePercentageBrush_ = settings_.NodePercentageColor.AsBrush();\n    searchResultMarkingBrush_ = settings_.SearchResultMarkingColor.AsBrush();\n\n    if (settings_.UseCompactMode) {\n      nodeHeight_ = CompactNodeHeight;\n      fontSize_ = CompactTextSize;\n    }\n    else {\n      nodeHeight_ = DefaultNodeHeight;\n      fontSize_ = DefaultTextSize;\n    }\n\n    if (graphVisual_ != null) {\n      glyphs_ = new GlyphRunCache(font_, fontSize_, VisualTreeHelper.GetDpi(graphVisual_).PixelsPerDip);\n      nameGlyphs_ = new GlyphRunCache(nameFont_, fontSize_, VisualTreeHelper.GetDpi(graphVisual_).PixelsPerDip);\n    }\n  }\n\n  public void SettingsUpdated(FlameGraphSettings settings) {\n    settings_ = settings;\n    ReloadSettings();\n\n    // Use potentially new node style.\n    SetupNode(flameGraph_.RootNode);\n    RedrawGraph();\n  }\n\n  public DrawingVisual Setup() {\n    graphVisual_ = new DrawingVisual();\n\n    if (flameGraph_.RootNode != null) {\n      SetupNode(flameGraph_.RootNode);\n    }\n\n    // Text glyph cache used to speed up rendering.\n    glyphs_ = new GlyphRunCache(font_, fontSize_, VisualTreeHelper.GetDpi(graphVisual_).PixelsPerDip);\n    nameGlyphs_ = new GlyphRunCache(nameFont_, fontSize_, VisualTreeHelper.GetDpi(graphVisual_).PixelsPerDip);\n\n    RedrawGraph();\n    graphVisual_.Drawing?.Freeze();\n    return graphVisual_;\n  }\n\n  public HighlightingStyle GetNodeStyle(FlameGraphNode node) {\n    var backColor = settings_.GetNodeDefaultBrush(node);\n    var markingSettings = App.Settings.MarkingSettings;\n\n    // Override color based on function name or module name,\n    // with function name marking having priority.\n    if (!string.IsNullOrEmpty(node.FunctionName) &&\n        markingSettings.UseFunctionColors &&\n        markingSettings.GetFunctionColor(node.FunctionName, out var functionColor)) {\n      backColor = functionColor.AsBrush();\n    }\n    else if (!string.IsNullOrEmpty(node.ModuleName)) {\n      if (markingSettings.UseModuleColors &&\n          markingSettings.GetModuleColor(node.ModuleName, out var moduleColor)) {\n        backColor = moduleColor.AsBrush();\n      }\n      else if (markingSettings.UseAutoModuleColors) {\n        // Use a color based on the module name.\n        backColor = markingSettings.GetAutoModuleBrush(node.ModuleName);\n      }\n    }\n\n    // Select border based on execution context.\n    var border = defaultBorder_;\n\n    if (node.CallTreeNode != null) {\n      if (node.CallTreeNode.Kind == ProfileCallTreeNodeKind.NativeKernel) {\n        border = kernelBorder_;\n      }\n      else if (node.CallTreeNode.Kind == ProfileCallTreeNodeKind.Managed) {\n        border = managedBorder_;\n      }\n    }\n\n    return new HighlightingStyle(backColor, border);\n  }\n\n  public void Redraw() {\n    RedrawGraph(false);\n  }\n\n  public void UpdateMaxWidth(double maxWidth) {\n    prevMaxWidth_ = maxWidth_;\n    maxWidth_ = Math.Max(maxWidth, 1);\n    RedrawGraph();\n    prevMaxWidth_ = maxWidth_;\n  }\n\n  public void UpdateVisibleArea(Rect visibleArea) {\n    visibleArea_ = visibleArea;\n    RedrawGraph(false);\n  }\n\n  public FlameGraphNode HitTestNode(Point point) {\n    var queryRect = new Rect(point.X / maxWidth_, point.Y, 1.0 / maxWidth_, 1);\n\n    if (nodesQuadTree_ != null) {\n      var nodes = nodesQuadTree_.GetNodesInside(queryRect);\n\n      foreach (var node in nodes) {\n        return node;\n      }\n    }\n\n    if (dummyNodesQuadTree_ != null) {\n      var nodes = dummyNodesQuadTree_.GetNodesInside(queryRect);\n\n      foreach (var node in nodes) {\n        return node;\n      }\n    }\n\n    return null;\n  }\n\n  public Rect ComputeNodeBounds(FlameGraphNode node) {\n    return new Rect(node.Bounds.Left * maxWidth_, node.Bounds.Top,\n                    node.Bounds.Width * maxWidth_, node.Bounds.Height);\n  }\n\n  public void DrawNode(FlameGraphNode node, DrawingContext dc, bool issueDraw = true) {\n    // Mark the node as part of this rendering step.\n    node.RenderVersion = renderVersion_;\n\n    if (node.IsDummyNode) {\n      return;\n    }\n\n    var bounds = new Rect(node.Bounds.Left * maxWidth_,\n                          node.Bounds.Top,\n                          node.Bounds.Width * maxWidth_,\n                          node.Bounds.Height);\n\n    if (bounds.Width <= 1) {\n      return;\n    }\n\n    if (cachedNodeGuidelines_ == null) {\n      cachedNodeGuidelines_ = CreateGuidelineSet(bounds, 0.5f);\n    }\n\n    if (issueDraw) {\n      dc.PushGuidelineSet(cachedNodeGuidelines_);\n      dc.DrawRectangle(node.Style.BackColor, node.Style.Border, bounds);\n    }\n\n    // Draw each text part of the node (module, func name, percentage, time).\n    int index = 0;\n    bool trimmed = false;\n    bool alignedWithParent = false;\n    bool setPercentagePosition = false;\n    double margin = FlameGraphNode.DefaultMargin;\n\n    // Start the text in the visible area.\n    bool startsInView = bounds.Left >= visibleArea_.Left;\n    double offsetY = bounds.Top + 1;\n    double offsetX = startsInView ? bounds.Left : visibleArea_.Left;\n    double maxWidth = bounds.Width - 2 * FlameGraphNode.DefaultMargin;\n\n    if (!startsInView) {\n      maxWidth -= visibleArea_.Left - bounds.Left;\n    }\n\n    // Compute layout and render each text part.\n    while (maxWidth > 8 && index < FlameGraphNode.MaxTextParts && !trimmed) {\n      string label = \"\";\n      bool useNameFont = false;\n      var textColor = node.TextColor;\n\n      void TryAlignTextWithParentNode() {\n        if (alignedWithParent || node.Parent == null) {\n          return;\n        }\n\n        // If the parent node is outside the view and was not rendered,\n        // force a pass that only computes the coordinates, without actual\n        // rendering. This is recursive and over the entire flame graph\n        // will visit each node a single time.\n        if (node.Parent.RenderVersion != renderVersion_) {\n          DrawNode(node.Parent, dc, false);\n        }\n\n        // If the position of text after the function name is close enough\n        // to the one in the parent and text will not get trimmed\n        // because of it, use it to align the percentage/time text.\n        double offsetDiff = node.Parent.PercentageTextPosition - offsetX;\n\n        if (offsetDiff > 0 && offsetDiff < 150) {\n          // Align by matching the parent offset.\n          double availableWidth = maxWidth - margin - offsetDiff;\n\n          if (availableWidth > 0) {\n            (_, _, bool textTrimmed, var size) =\n              TrimTextToWidth(label, availableWidth, useNameFont);\n\n            if (!textTrimmed && size.Width < maxWidth) {\n              offsetX = node.Parent.PercentageTextPosition - margin;\n              maxWidth -= offsetDiff;\n            }\n          }\n        }\n        else if (offsetDiff < 0 && Math.Abs(offsetDiff) < margin * 0.5) {\n          // Align by reducing the margin from previous text\n          // to match the parent offset.\n          margin += offsetDiff;\n        }\n\n        alignedWithParent = true;\n      }\n\n      switch (index) {\n        case 0: {\n          if (node.HasFunction) {\n            label = node.FunctionName;\n\n            if (settings_.PrependModuleToFunction) {\n              string moduleLabel = node.ModuleName + \"!\";\n              (string modText, var modGlyphs, bool modTextTrimmed, var modTextSize) =\n                TrimTextToWidth(moduleLabel, maxWidth - margin, false);\n\n              if (modText.Length > 0 && issueDraw) {\n                DrawText(modGlyphs, bounds, node.ModuleTextColor, offsetX + margin, offsetY, modTextSize, dc);\n              }\n\n              maxWidth -= modTextSize.Width + 1;\n              offsetX += modTextSize.Width + 1;\n            }\n          }\n          else {\n            label = \"All\";\n          }\n\n          margin = FlameGraphNode.DefaultMargin;\n          useNameFont = true;\n          break;\n        }\n        case 1: {\n          if (settings_.AppendPercentageToFunction) {\n            label = node.Percentage.AsPercentageString();\n            margin = FlameGraphNode.ExtraValueMargin;\n            textColor = node.PercentageTextColor;\n            useNameFont = true;\n            TryAlignTextWithParentNode();\n          }\n\n          break;\n        }\n        case 2: {\n          if (settings_.AppendDurationToFunction) {\n            label = settings_.AppendPercentageToFunction ?\n              $\"({node.Weight.AsMillisecondsString()})\" :\n              $\"{node.Weight.AsMillisecondsString()}\";\n            margin = FlameGraphNode.DefaultMargin;\n            textColor = node.WeightTextColor;\n            TryAlignTextWithParentNode();\n          }\n\n          break;\n        }\n        default: {\n          throw new InvalidOperationException();\n        }\n      }\n\n      // Trim the text to fit into the remaining space and draw it.\n      (string text, var glyphs, bool textTrimmed, var textSize) =\n        TrimTextToWidth(label, maxWidth - margin, useNameFont);\n\n      if (text.Length > 0) {\n        if (issueDraw) {\n          if (index == 0 && node.SearchResult.HasValue) {\n            DrawSearchResultSelection(node.SearchResult.Value, text, glyphs, bounds, offsetX + margin, offsetY, dc);\n          }\n\n          DrawText(glyphs, bounds, textColor, offsetX + margin, offsetY, textSize, dc);\n        }\n\n        // Remember starting position after function name\n        // to be used for aligning the same text in descendants.\n        if (index > 0 && !setPercentagePosition) {\n          node.PercentageTextPosition = offsetX + margin;\n          setPercentagePosition = true;\n        }\n      }\n\n      trimmed = textTrimmed;\n      maxWidth -= textSize.Width + margin;\n      offsetX += textSize.Width + margin;\n      index++;\n    }\n\n    if (issueDraw) {\n      dc.Pop(); // PushGuidelineSet\n    }\n  }\n\n  private void UpdateGraphSizes() {\n    minVisibleRectWidth_ = FlameGraphNode.MinVisibleRectWidth / maxWidth_;\n    quadGraphArea_ = new Rect(0, 0, 1.0, MaxGraphHeight);\n    quadVisibleArea_ = new Rect(visibleArea_.Left / maxWidth_, visibleArea_.Top,\n                                visibleArea_.Width / maxWidth_, visibleArea_.Height);\n  }\n\n  private void SetupNode(FlameGraphNode node) {\n    node.Style = GetNodeStyle(node);\n    node.TextColor = GetNodeTextColor(node);\n    node.ModuleTextColor = nodeModuleBrush_;\n    node.WeightTextColor = nodeWeightBrush_;\n    node.PercentageTextColor = nodePercentageBrush_;\n    node.Owner = this;\n\n    if (node.Children != null) {\n      foreach (var childNode in node.Children) {\n        SetupNode(childNode);\n      }\n    }\n  }\n\n  private Brush GetNodeTextColor(FlameGraphNode node) {\n    var textBrush = nodeTextBrush_;\n\n    if (node.CallTreeNode != null) {\n      if (node.CallTreeNode.Kind == ProfileCallTreeNodeKind.NativeKernel) {\n        textBrush = kernelNodeTextBrush_;\n      }\n      else if (node.CallTreeNode.Kind == ProfileCallTreeNodeKind.Managed) {\n        textBrush = managedNodeTextBrush_;\n      }\n    }\n\n    return textBrush;\n  }\n\n  private void RedrawGraph(bool updateLayout = true) {\n    if (!RedrawGraphImpl(updateLayout)) {\n      RedrawGraphImpl(true); // Force layout update.\n    }\n  }\n\n  private bool RedrawGraphImpl(bool updateLayout = true) {\n    using var graphDC = graphVisual_.RenderOpen();\n    bool nodeLayoutRecomputed = false;\n    UpdateGraphSizes();\n\n    if (updateLayout) {\n      // Recompute the position of all nodes and rebuild the quad tree.\n      // This is done once, with node position/size being relative to the maxWidth,\n      // except when dummy nodes get involved, which can force a re-layout.\n      nodesQuadTree_ = new QuadTree<FlameGraphNode>();\n      dummyNodesQuadTree_ = new QuadTree<FlameGraphGroupNode>();\n      nodesQuadTree_.Bounds = quadGraphArea_;\n      dummyNodesQuadTree_.Bounds = quadGraphArea_;\n      maxNodeDepth_ = 0;\n\n      UpdateNodeLayout(flameGraph_.RootNode, 0, 0, true);\n      nodeLayoutRecomputed = true;\n    }\n\n    // Update only the visible nodes on scrolling.\n    bool layoutChanged = !nodeLayoutRecomputed && Math.Abs(maxWidth_ - prevMaxWidth_) > double.Epsilon;\n    int shrinkingNodes = 0;\n    renderVersion_++; // Mark a new rendering pass.\n\n    foreach (var node in nodesQuadTree_.GetNodesInside(quadVisibleArea_)) {\n      DrawNode(node, graphDC);\n\n      if (layoutChanged && ScaleNode(node) < minVisibleRectWidth_) {\n        shrinkingNodes++;\n      }\n    }\n\n    if (shrinkingNodes > 0) {\n      //? TODO: Removing from the quad tree is very slow,\n      //? recompute the entire layout instead...\n      return false;\n    }\n\n    // Draw the placeholders for insignificant nodes.\n    bool unchanged = DrawDummyNodes(graphDC, layoutChanged);\n\n    // Redraw selected nodes to show on top of everything else.\n    DrawSelectedNodes(graphDC);\n    return unchanged;\n  }\n\n  private void DrawSelectedNodes(DrawingContext graphDC) {\n    foreach (var node in SelectedNodes.Keys) {\n      // When a different root node is used, the selected nodes\n      // may not be part of the view, don't draw them in that case.\n      bool onPath = false;\n      var pathNode = node;\n\n      while (pathNode != null) {\n        if (pathNode == flameGraph_.RootNode) {\n          onPath = true;\n          break;\n        }\n        else if (pathNode.IsHidden) {\n          // If node is collapsed itself or a descendant\n          // of a collapsed node, don't select it since it's not visible.\n          break;\n        }\n\n        pathNode = pathNode.Parent;\n      }\n\n      if (onPath) {\n        DrawNode(node, graphDC);\n      }\n    }\n  }\n\n  private double ScaleNode(FlameGraphNode node) {\n    return flameGraph_.ScaleWeight(node);\n  }\n\n  private bool DrawDummyNodes(DrawingContext graphDC, bool layoutChanged) {\n    int shrinkingNodes = 0;\n    int growingNodes = 0;\n    double halfMinVisibleRectWidth = minVisibleRectWidth_ * 0.5;\n\n    foreach (var node in dummyNodesQuadTree_.GetNodesInside(quadVisibleArea_)) {\n      double width = ScaleNode(node);\n\n      if (width < halfMinVisibleRectWidth) {\n        shrinkingNodes++;\n        continue;\n      }\n\n      // Reconsider replacing the dummy node.\n      if (layoutChanged && ScaleNode(node) > halfMinVisibleRectWidth) {\n        growingNodes++;\n      }\n      else {\n        DrawDummyNode(node, graphDC);\n      }\n    }\n\n    if (growingNodes == 0 && shrinkingNodes == 0) {\n      return true;\n    }\n\n    // Replace/split the enlarged dummy nodes.\n    //? TODO: Still doesn't always expand like recomputing layout does\n#if false\n        bool update = false;\n\n        foreach (var node in enlargeList) {\n            if (node.Parent == null) {\n                continue;\n            }\n\n            dummyNodesQuadTree_.Remove(node);\n\n            // The dummy node may be recreated back, don't update in that case.\n            if (UpdateChildrenNodeLayout(node.Parent, node.Parent.Bounds.Left,\n                    node.Parent.Bounds.Top,\n                    node.ReplacedStartIndex,\n                    node.ReplacedEndIndex)) {\n                update = true;\n            }\n        }\n\n        // Redraw to show the newly create nodes replacing the dummy ones.\n        if (update) {\n            foreach (var node in nodesQuadTree_.GetNodesInside(quadVisibleArea_)) {\n                DrawNode(node, graphDC);\n            }\n\n            foreach (var node in dummyNodesQuadTree_.GetNodesInside(quadVisibleArea_)) {\n                DrawDummyNode(node, graphDC);\n            }\n        }\n#else\n    return false;\n#endif\n  }\n\n  private void DrawDummyNode(FlameGraphGroupNode node, DrawingContext graphDC) {\n    var scaledBounds = new Rect(node.Bounds.Left * maxWidth_, node.Bounds.Top,\n                                node.Bounds.Width * maxWidth_, node.Bounds.Height);\n\n    if (cachedDummyNodeGuidelines_ == null) {\n      cachedDummyNodeGuidelines_ = CreateGuidelineSet(scaledBounds, 0.5f);\n    }\n\n    graphDC.PushGuidelineSet(cachedDummyNodeGuidelines_);\n    graphDC.DrawRectangle(node.Style.BackColor, node.Style.Border, scaledBounds);\n    graphDC.DrawRectangle(CreatePlaceholderTiledBrush(8), null, scaledBounds);\n    graphDC.Pop();\n  }\n\n  private void DrawCenteredText(string text, double x, double y, DrawingContext dc) {\n    var glyphInfo = glyphs_.GetGlyphs(text);\n    x = Math.Max(0, x - glyphInfo.TextWidth / 2);\n    y = Math.Max(0, y + glyphInfo.TextHeight / 2);\n\n    dc.PushTransform(new TranslateTransform(x, y));\n    dc.DrawGlyphRun(Brushes.Black, glyphInfo.Glyphs);\n    dc.Pop();\n  }\n\n  private void UpdateNodeLayout(FlameGraphNode node, double x, double y, bool redraw) {\n    double width = ScaleNode(node);\n    node.Bounds = new Rect(x, y, width, nodeHeight_);\n    node.IsDummyNode = !redraw;\n    node.IsHidden = false;\n\n    if (redraw) {\n      maxNodeDepth_ = Math.Max(node.Depth, maxNodeDepth_);\n      double minWidth = minVisibleRectWidth_;\n\n      if (node.Bounds.Width > minWidth) {\n        nodesQuadTree_.Insert(node, node.Bounds);\n      }\n    }\n\n    if (node.Children == null || node.Children.Count == 0) {\n      return;\n    }\n\n    // Children are sorted by weight or time.\n    UpdateChildrenNodeLayout(node, x, y);\n  }\n\n  private bool UpdateChildrenNodeLayout(FlameGraphNode node, double x, double y,\n                                        int startIndex = 0, int stopIndex = int.MaxValue) {\n    int skippedChildren = 0;\n    int totalSkippedChildren = 0;\n\n    // Ignore children that have layout already computed.\n    // Note that currently startIndex is always 0.\n    for (int i = 0; i < startIndex; i++) {\n      var childNode = node.Children[i];\n      double childWidth = flameGraph_.ScaleWeight(childNode);\n      x += childWidth;\n    }\n\n    stopIndex = Math.Min(stopIndex, node.Children.Count);\n    int range = stopIndex - startIndex;\n\n    for (int i = startIndex; i < stopIndex; i++) {\n      var childNode = node.Children[i];\n      double childWidth = flameGraph_.ScaleWeight(childNode);\n\n      if (skippedChildren == 0) {\n        if (childWidth < minVisibleRectWidth_) {\n          // If multiple children below width, use a single dummy node.\n          CreateSmallWeightDummyNode(node, x, y, i, stopIndex, out skippedChildren);\n          totalSkippedChildren += skippedChildren;\n          childNode.IsDummyNode = true;\n        }\n      }\n      else {\n        // Once children were combined into a dummy node and skipped,\n        // all others are skipped since they are sorted by weight.\n        childNode.IsDummyNode = true;\n      }\n\n      // If all child nodes were merged into a dummy node don't recurse.\n      if (totalSkippedChildren < range) {\n        UpdateNodeLayout(childNode, x, y + nodeHeight_, skippedChildren == 0);\n      }\n\n      x += childWidth;\n    }\n\n    return totalSkippedChildren < range;\n  }\n\n  private FlameGraphNode CreateSmallWeightDummyNode(FlameGraphNode node, double x, double y,\n                                                    int startIndex, int stopIndex, out int skippedChildren) {\n    var totalWeight = TimeSpan.Zero;\n    double totalWidth = 0;\n\n    // Collect all the child nodes that have a small weight\n    // and replace them by one dummy node.\n    var startTime = TimeSpan.MaxValue;\n    var endTime = TimeSpan.MinValue;\n    int k;\n\n    for (k = startIndex; k < stopIndex; k++) {\n      var childNode = node.Children[k];\n      double childWidth = ScaleNode(childNode);\n\n      // In case child sorting is not by weight, stop extending the range\n      // when a larger one is found again.\n      if (childWidth > minVisibleRectWidth_) {\n        break;\n      }\n\n      totalWidth += childWidth;\n      totalWeight += childNode.Weight;\n      startTime = TimeSpan.FromTicks(Math.Min(startTime.Ticks, childNode.StartTime.Ticks));\n      endTime = TimeSpan.FromTicks(Math.Max(endTime.Ticks, childNode.EndTime.Ticks));\n      childNode.IsHidden = true;\n    }\n\n    skippedChildren = k - startIndex; // Caller should ignore these children.\n\n    if (totalWidth < minVisibleRectWidth_) {\n      return null; // Nothing to draw.\n    }\n\n    //? TODO: Use a pool for FlameGraphGroupNode instead of new (JIT_New dominates)\n    var replacement = new Rect(x, y + nodeHeight_, totalWidth, nodeHeight_);\n    var dummyNode = new FlameGraphGroupNode(node, startIndex, skippedChildren, totalWeight, node.Depth);\n    dummyNode.IsDummyNode = true;\n    dummyNode.Bounds = replacement;\n    dummyNode.Style = PickDummyNodeStyle(node.Style);\n    dummyNode.StartTime = startTime;\n    dummyNode.EndTime = endTime;\n    dummyNodesQuadTree_.Insert(dummyNode, replacement);\n    return dummyNode;\n  }\n\n  private HighlightingStyle PickDummyNodeStyle(HighlightingStyle style) {\n    if (!dummyNodeStyles_.TryGetValue(style, out var dummyStyle)) {\n      var newColor = ColorUtils.AdjustSaturation(((SolidColorBrush)style.BackColor).Color, 0.2f);\n      newColor = ColorUtils.AdjustLight(newColor, 2.0f);\n      dummyStyle = new HighlightingStyle(newColor, defaultBorder_);\n      dummyNodeStyles_[style] = dummyStyle;\n    }\n\n    return dummyStyle;\n  }\n\n  private Brush CreatePlaceholderTiledBrush(double tileSize) {\n    // Create the brush once, freeze and reuse it everywhere.\n    if (placeholderTileBrush_ != null) {\n      return placeholderTileBrush_;\n    }\n\n    tileSize = Math.Ceiling(tileSize);\n    var line = new LineSegment(new Point(0, 0), true);\n    line.IsSmoothJoin = false;\n    line.Freeze();\n    var figure = new PathFigure();\n    figure.IsClosed = false;\n    figure.StartPoint = new Point(tileSize, tileSize);\n    figure.Segments.Add(line);\n    figure.Freeze();\n    var geometry = new PathGeometry();\n    geometry.Figures.Add(figure);\n    geometry.Freeze();\n    var drawing = new GeometryDrawing();\n    drawing.Geometry = geometry;\n\n    var penBrush = ColorBrushes.GetBrush(Colors.Gray);\n    drawing.Pen = new Pen(penBrush, 1.0f);\n    drawing.Freeze();\n    var brush = new DrawingBrush();\n    brush.Drawing = drawing;\n    brush.Stretch = Stretch.None;\n    brush.TileMode = TileMode.Tile;\n    brush.Viewbox = new Rect(0, 0, tileSize, tileSize);\n    brush.ViewboxUnits = BrushMappingMode.Absolute;\n    brush.Viewport = new Rect(0, 0, tileSize, tileSize);\n    brush.ViewportUnits = BrushMappingMode.Absolute;\n    RenderOptions.SetCachingHint(brush, CachingHint.Cache);\n    brush.Freeze();\n    placeholderTileBrush_ = brush;\n    return placeholderTileBrush_;\n  }\n\n  private void DrawSearchResultSelection(TextSearchResult searchResult, string text, GlyphRun glyphs,\n                                         Rect bounds, double offsetX, double offsetY, DrawingContext dc) {\n    var glypWidths = glyphs.AdvanceWidths;\n    int startIndex = Math.Min(searchResult.Offset, glypWidths.Count);\n    int endIndex = Math.Min(searchResult.Offset + searchResult.Length, glypWidths.Count);\n\n    if (startIndex == text.Length || startIndex == endIndex) {\n      return; // Result outside of visible text part.\n    }\n\n    for (int i = 0; i < startIndex; i++) {\n      offsetX += glypWidths[i];\n    }\n\n    double width = 0;\n\n    for (int i = startIndex; i < endIndex; i++) {\n      width += glypWidths[i];\n    }\n\n    var selectionBounds = new Rect(offsetX, offsetY, width, nodeHeight_ - 2);\n    dc.DrawRectangle(searchResultMarkingBrush_, null, selectionBounds);\n  }\n\n  private void DrawText(GlyphRun glyphs, Rect bounds, Brush textColor, double offsetX, double offsetY,\n                        Size textSize, DrawingContext dc) {\n    double x = offsetX;\n    double y = bounds.Height * 0.5 + textSize.Height * 0.25 + offsetY;\n\n    if (cachedTextGuidelines_ == null) {\n      var rect = glyphs.ComputeAlignmentBox();\n      cachedTextGuidelines_ = CreateGuidelineSet(rect, 1.0f);\n    }\n\n    dc.PushTransform(new TranslateTransform(x, y));\n    dc.PushGuidelineSet(cachedTextGuidelines_);\n    dc.DrawGlyphRun(textColor, glyphs);\n    dc.Pop();\n    dc.Pop(); // PushGuidelineSet\n  }\n\n  private (string Text, GlyphRun glyphs, bool Trimmed, Size TextSize)\n    TrimTextToWidth(string text, double maxWidth, bool useNameFont) {\n    string originalText = text;\n    var glyphsCache = useNameFont ? nameGlyphs_ : glyphs_;\n\n    if (maxWidth <= 0 || string.IsNullOrEmpty(text)) {\n      return (\"\", glyphsCache.GetGlyphs(\"\").Glyphs, false, new Size(0, 0));\n    }\n\n    var glyphInfo = glyphsCache.GetGlyphs(text, maxWidth);\n    bool trimmed = glyphInfo.IsTrimmed;\n\n    if (glyphInfo.TextWidth > maxWidth) {\n      // The width of letters is the same only for monospace fonts,\n      // use the glyph width to find where to trim the string instead.\n      double trimmedWidth = 0;\n      int trimmedLength = 0;\n      var widths = glyphInfo.Glyphs.AdvanceWidths;\n\n      double letterWidth = Math.Ceiling(glyphInfo.TextWidth / text.Length);\n      double availableWidth = maxWidth - letterWidth * 2; // Space for ..\n\n      for (trimmedLength = 0; trimmedLength < text.Length; trimmedLength++) {\n        trimmedWidth += widths[trimmedLength];\n\n        if (trimmedWidth >= availableWidth) {\n          break;\n        }\n      }\n\n      trimmed = true;\n\n      if (trimmedLength > 0) {\n        text = text.Substring(0, trimmedLength) + \"..\";\n        glyphInfo = glyphsCache.GetGlyphs(text, maxWidth);\n      }\n      else {\n        text = \"\";\n        glyphInfo = glyphsCache.GetGlyphs(text, maxWidth);\n        glyphInfo.TextWidth = maxWidth;\n      }\n    }\n\n    glyphInfo.IsTrimmed = trimmed;\n    glyphsCache.CacheGlyphs(glyphInfo, originalText, maxWidth);\n\n    return (text, glyphInfo.Glyphs, trimmed,\n            new Size(glyphInfo.TextWidth, glyphInfo.TextHeight));\n  }\n\n  private GuidelineSet CreateGuidelineSet(Rect rect, double penWidth) {\n    var guidelines = new GuidelineSet();\n    guidelines.GuidelinesX.Add(rect.Left + penWidth);\n    guidelines.GuidelinesX.Add(rect.Right + penWidth);\n    guidelines.GuidelinesY.Add(rect.Top + penWidth);\n    guidelines.GuidelinesY.Add(rect.Bottom + penWidth);\n    return guidelines;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraphViewer.xaml",
    "content": "﻿<FrameworkElement\n  x:Class=\"ProfileExplorer.UI.Profile.FlameGraphViewer\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"300\"\n  d:DesignWidth=\"300\"\n  mc:Ignorable=\"d\" />"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/FlameGraph/FlameGraphViewer.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic partial class FlameGraphViewer : FrameworkElement {\n  private FlameGraph flameGraph_;\n  private FlameGraphRenderer renderer_;\n  private DrawingVisual graphVisual_;\n  private FlameGraphNode hoveredNode_;\n  private FlameGraphNode selectedNode_;\n  private bool isTimelineView_;\n  private bool initialized_;\n  private Brush markedNodeBackColor_;\n  private Brush selectedNodeBackColor_;\n  private Pen searchResultBorderColor_;\n  private Pen selectedNodeBorderColor_;\n  private Pen markedNodeBorderColor_;\n  private Dictionary<FlameGraphNode, HighlightingStyle> hoverNodes_;\n  private Dictionary<FlameGraphNode, HighlightingStyle> markedNodes_;\n  private Dictionary<FlameGraphNode, HighlightingStyle> fixedMarkedNodes_;\n  private Dictionary<FlameGraphNode, HighlightingStyle> selectedNodes_;\n  private FlameGraphSettings settings_;\n\n  public FlameGraphViewer() {\n    InitializeComponent();\n    hoverNodes_ = new Dictionary<FlameGraphNode, HighlightingStyle>();\n    markedNodes_ = new Dictionary<FlameGraphNode, HighlightingStyle>();\n    fixedMarkedNodes_ = new Dictionary<FlameGraphNode, HighlightingStyle>();\n    selectedNodes_ = new Dictionary<FlameGraphNode, HighlightingStyle>();\n    SetupEvents();\n  }\n\n  public new bool IsInitialized => initialized_;\n  public FlameGraph FlameGraph => flameGraph_;\n  public double MaxGraphWidth => renderer_.MaxGraphWidth;\n  public Rect VisibleArea => renderer_.VisibleArea;\n  public bool IsZoomed => Math.Abs(MaxGraphWidth - VisibleArea.Width) > 1;\n  public FlameGraphNode SelectedNode => selectedNode_;\n  public IUISession Session { get; set; }\n  public HighlightingStyle SelectedNodeStyle { get; private set; }\n  public HighlightingStyle MarkedNodeStyle { get; private set; }\n  public List<FlameGraphNode> SelectedNodes => selectedNodes_.ToKeyList();\n  protected override int VisualChildrenCount => 1;\n\n  public HighlightingStyle MarkedColoredNodeStyle(Color color) {\n    return new HighlightingStyle(color, markedNodeBorderColor_);\n  }\n\n  public void SaveFixedMarkedNodes(List<(ProfileCallTreeNode Node,\n                                     HighlightingStyle Style)> list) {\n    foreach (var pair in fixedMarkedNodes_) {\n      if (pair.Key.HasFunction) {\n        list.Add((pair.Key.CallTreeNode, pair.Value));\n      }\n    }\n  }\n\n  public List<(ProfileCallTreeNode Node,\n      HighlightingStyle Style)>\n    RestoreFixedMarkedNodes(List<(ProfileCallTreeNode Node,\n                              HighlightingStyle Style)> markedNodes,\n                            ProfileCallTree callTree) {\n    if (markedNodes.Count == 0) {\n      return null;\n    }\n\n    List<(ProfileCallTreeNode Node,\n      HighlightingStyle Style)> unmatchedList = null;\n\n    foreach (var pair in markedNodes) {\n      // Find in the call tree node that corresponds to\n      // a node from another instance of a call tree.\n      // This happens when filtering the profile, which creates\n      // a new call tree. Function marked in the flame graph\n      // should still be marked in the filtered profile.\n      bool added = false;\n      var treeNode = callTree.FindMatchingNode(pair.Node);\n\n      if (treeNode != null) {\n        var fgNode = flameGraph_.GetFlameGraphNode(treeNode);\n\n        if (fgNode != null) {\n          MarkNodeImpl(fgNode, HighlighingType.Marked, pair.Style, true);\n          added = true;\n        }\n      }\n\n      // If a marked node could not be mapped to one in the current\n      // call tree instance, remember it in case the filtering changes\n      // later to a state where the call tree includes it again.\n      if (!added) {\n        unmatchedList ??= new List<(ProfileCallTreeNode Node, HighlightingStyle Style)>();\n        unmatchedList.Add(pair);\n      }\n    }\n\n    renderer_.Redraw();\n    return unmatchedList;\n  }\n\n  public void RestoreFixedMarkedNodes() {\n    if (fixedMarkedNodes_.Count == 0) {\n      return;\n    }\n\n    foreach (var pair in fixedMarkedNodes_) {\n      if (pair.Key.HasFunction) {\n        // Map the call tree node to the current flame graph node,\n        // needed in case the flame graph got rebuilt.\n        var node = flameGraph_.GetFlameGraphNode(pair.Key.CallTreeNode);\n\n        if (node != null) {\n          MarkNodeImpl(node, HighlighingType.Marked, pair.Value);\n        }\n      }\n    }\n\n    renderer_.Redraw();\n  }\n\n  public void ResetNodeHighlighting() {\n    ResetHighlightedNodes(HighlighingType.Selected);\n    ResetHighlightedNodes(HighlighingType.Hovered);\n    selectedNodes_.Clear();\n    selectedNode_ = null;\n    hoveredNode_ = null;\n    Session.SetApplicationStatus(\"\");\n  }\n\n  public void SelectNode(FlameGraphNode graphNode, bool append = false,\n                         bool deselectIfSelected = true) {\n    if (!selectedNodes_.ContainsKey(graphNode)) {\n      // Select a currently unselected node.\n      if (!append) {\n        ResetNodeHighlighting(); // Deselect all other nodes.\n      }\n\n      HighlightNode(graphNode, HighlighingType.Selected);\n      selectedNode_ = graphNode; // Last selected node.\n    }\n    else if (deselectIfSelected) {\n      // Handle a currently selected node.\n      if (append) {\n        // Remove selection if node is already selected in append mode.\n        selectedNodes_.Remove(graphNode);\n        selectedNode_ = selectedNodes_.Count > 0 ? selectedNodes_.First().Key : null;\n        RestoreNodeStyle(graphNode, true);\n      }\n      else {\n        // Keep the node selected and deselect others.\n        ResetNodeHighlighting();\n        HighlightNode(graphNode, HighlighingType.Selected);\n        selectedNode_ = graphNode; // Last selected node.\n      }\n    }\n  }\n\n  public void SelectNodes(List<FlameGraphNode> nodes) {\n    ResetNodeHighlighting();\n\n    foreach (var node in nodes) {\n      MarkNodeImpl(node, HighlighingType.Selected);\n    }\n\n    renderer_.Redraw();\n  }\n\n  public void MarkSearchResultNodes(List<FlameGraphNode> searchResultNodes) {\n    foreach (var node in searchResultNodes) {\n      MarkNodeImpl(node, HighlighingType.Marked);\n    }\n\n    renderer_.Redraw();\n  }\n\n  public void ResetSearchResultNodes(List<FlameGraphNode> nodes, bool redraw = true) {\n    ResetHighlightedNodes(HighlighingType.Marked, redraw);\n    flameGraph_.ResetSearchResults(nodes);\n\n    if (redraw) {\n      renderer_.Redraw();\n    }\n  }\n\n  public void MarkNodes(List<ProfileCallTreeNode> nodes, HighlightingStyle style, bool overwriteStyle) {\n    foreach (var node in nodes) {\n      MarkNodeNoRedraw(node, style, overwriteStyle);\n    }\n\n    renderer_.Redraw();\n  }\n\n  public void MarkNode(FlameGraphNode node, HighlightingStyle style) {\n    MarkNodeImpl(node, HighlighingType.Marked, style, true);\n    renderer_.Redraw();\n  }\n\n  public void ResetMarkedNodes(bool clearFixedNodes) {\n    if (clearFixedNodes) {\n      fixedMarkedNodes_.Clear();\n    }\n\n    ResetHighlightedNodes(HighlighingType.Marked);\n  }\n\n  public FlameGraphNode SelectNode(ProfileCallTreeNode graphNode) {\n    var fgNodes = flameGraph_.GetNodes(graphNode);\n\n    // Because the flame graph can be rooted at a different node then\n    // the call tree, parts of the call tree may not have a flame graph node.\n    if (fgNodes is {Count: > 0}) {\n      SelectNodes(fgNodes);\n      return fgNodes[0];\n    }\n\n    return null;\n  }\n\n  public List<FlameGraphNode> SelectNodes(ProfileCallTreeNode graphNode) {\n    var fgNodes = flameGraph_.GetNodes(graphNode);\n    SelectNodes(fgNodes);\n    return fgNodes;\n  }\n\n  public List<FlameGraphNode> SelectNodes(List<ProfileCallTreeNode> nodes) {\n    if (nodes == null || nodes.Count == 0) {\n      return null;\n    }\n\n    var fgNodes = new List<FlameGraphNode>(nodes.Count);\n\n    foreach (var node in nodes) {\n      flameGraph_.AppendNodes(node, fgNodes);\n    }\n\n    SelectNodes(fgNodes);\n    return fgNodes;\n  }\n\n  public void ClearSelection() {\n    if (!initialized_) {\n      return;\n    }\n\n    ResetNodeHighlighting();\n  }\n\n  public async Task Initialize(ProfileCallTree callTree, ProfileCallTreeNode rootNode,\n                               Rect visibleArea, FlameGraphSettings settings, IUISession session,\n                               bool isTimelineView = false, int threadId = -1) {\n    if (initialized_) {\n      Reset();\n    }\n\n    Session = session;\n    flameGraph_ = new FlameGraph(callTree, Session.CompilerInfo.NameProvider.FormatFunctionName);\n    isTimelineView_ = isTimelineView;\n\n    if (isTimelineView_) {\n      // TODO: Timeline not implemented.\n      // await Task.Run(() => flameGraph_.BuildTimeline(Session.ProfileData, threadId));\n    }\n    else {\n      await Task.Run(() => flameGraph_.Build(rootNode));\n    }\n\n    settings_ = settings;\n    ReloadSettings();\n\n    // Create the rendered and add the drawing surface as a child control.\n    renderer_ = new FlameGraphRenderer(flameGraph_, visibleArea, settings);\n    renderer_.SelectedNodes = selectedNodes_;\n    graphVisual_ = renderer_.Setup();\n\n    AddVisualChild(graphVisual_);\n    AddLogicalChild(graphVisual_);\n    UpdateMaxWidth(renderer_.MaxGraphWidth);\n    initialized_ = true;\n  }\n\n  public void Redraw() {\n    // Force re-evaluating the styles and redraw.\n    SettingsUpdated(settings_);\n  }\n\n  private void ReloadSettings() {\n    markedNodeBackColor_ = ColorBrushes.GetBrush(settings_.SearchedNodeColor);\n    markedNodeBorderColor_ = ColorPens.GetPen(settings_.NodeBorderColor, 2);\n    selectedNodeBackColor_ = ColorBrushes.GetBrush(settings_.SelectedNodeColor);\n    selectedNodeBorderColor_ = ColorPens.GetPen(settings_.SelectedNodeBorderColor, 2);\n    searchResultBorderColor_ = ColorPens.GetPen(settings_.SearchedNodeBorderColor, 2);\n    SelectedNodeStyle = new HighlightingStyle(selectedNodeBackColor_, selectedNodeBorderColor_);\n    MarkedNodeStyle = new HighlightingStyle(markedNodeBackColor_, markedNodeBorderColor_);\n  }\n\n  public void SettingsUpdated(FlameGraphSettings settings) {\n    settings_ = settings;\n    ReloadSettings();\n\n    // Render the flame graph again.\n    renderer_.SettingsUpdated(settings);\n    InvalidateMeasure();\n    InvalidateVisual();\n  }\n\n  public async Task Initialize(ProfileCallTree callTree, Rect visibleArea, FlameGraphSettings settings,\n                               IUISession session, bool isTimelineView = false, int threadId = -1) {\n    await Initialize(callTree, null, visibleArea, settings, session, isTimelineView, threadId);\n  }\n\n  public void UpdateMaxWidth(double maxWidth) {\n    if (!initialized_) {\n      return;\n    }\n\n    renderer_.UpdateMaxWidth(maxWidth);\n    InvalidateMeasure();\n    InvalidateVisual();\n  }\n\n  public void AdjustMaxWidth(double amount) {\n    if (!initialized_) {\n      return;\n    }\n\n    renderer_.UpdateMaxWidth(renderer_.MaxGraphWidth + amount);\n    InvalidateMeasure();\n  }\n\n  public FlameGraphNode FindPointedNode(Point point) {\n    if (!initialized_) {\n      return null;\n    }\n\n    return renderer_.HitTestNode(point);\n  }\n\n  public Rect ComputeNodeBounds(FlameGraphNode node) {\n    return renderer_.ComputeNodeBounds(node);\n  }\n\n  public Point ComputeNodePosition(FlameGraphNode node) {\n    return ComputeNodeBounds(node).TopLeft;\n  }\n\n  public Size ComputeNodeSize(FlameGraphNode node) {\n    return ComputeNodeBounds(node).Size;\n  }\n\n  public void UpdateVisibleArea(Rect visibleArea) {\n    if (!initialized_) {\n      return;\n    }\n\n    renderer_.UpdateVisibleArea(visibleArea);\n  }\n\n  public void Reset() {\n    if (!initialized_) {\n      return;\n    }\n\n    RemoveVisualChild(graphVisual_);\n    RemoveLogicalChild(graphVisual_);\n    hoverNodes_.Clear();\n    markedNodes_.Clear();\n    fixedMarkedNodes_.Clear();\n    selectedNodes_.Clear();\n    selectedNode_ = null;\n    graphVisual_ = null;\n    flameGraph_ = null;\n    renderer_ = null;\n    initialized_ = false;\n  }\n\n  protected override void OnMouseLeave(MouseEventArgs e) {\n    if (!initialized_) {\n      return;\n    }\n\n    ResetHighlightedNodes(HighlighingType.Hovered);\n  }\n\n  protected override Visual GetVisualChild(int index) {\n    return graphVisual_;\n  }\n\n  protected override Size MeasureOverride(Size availableSize) {\n    if (graphVisual_ == null) {\n      return new Size(0, 0);\n    }\n\n    return renderer_.GraphArea.Size;\n  }\n\n  private void SetupEvents() {\n    MouseLeftButtonUp += OnMouseLeftButtonUp;\n    MouseRightButtonDown += OnMouseRightButtonDown;\n    MouseMove += OnMouseMove;\n  }\n\n  private void OnMouseMove(object sender, MouseEventArgs e) {\n    var point = e.GetPosition(this);\n    var graphNode = FindPointedNode(point);\n\n    if (graphNode != null) {\n      if (hoveredNode_ != graphNode) {\n        ResetHighlightedNodes(HighlighingType.Hovered);\n        HighlightNode(graphNode, HighlighingType.Hovered);\n        hoveredNode_ = graphNode;\n        e.Handled = true;\n      }\n    }\n    else {\n      ResetHighlightedNodes(HighlighingType.Hovered);\n      hoveredNode_ = null;\n      e.Handled = true;\n    }\n  }\n\n  private void HighlightNode(FlameGraphNode node, HighlighingType type) {\n    node.Style = type switch {\n      HighlighingType.Hovered  => PickHoveredNodeStyle(node.Style),\n      HighlighingType.Selected => PickSelectedNodeStyle(node.Style),\n      _                        => node.Style\n    };\n\n    var group = GetHighlightedNodeGroup(type);\n    group[node] = node.Style;\n    renderer_.Redraw();\n  }\n\n  private void MarkNodeImpl(FlameGraphNode node, HighlighingType type, HighlightingStyle style = null,\n                            bool overwriteStyle = false) {\n    if (type == HighlighingType.Marked && !overwriteStyle &&\n        markedNodes_.TryGetValue(node, out var markedStyle)) {\n      fixedMarkedNodes_[node] = markedStyle; // Save current marked style.\n    }\n\n    node.Style = type switch {\n      HighlighingType.Hovered  => PickHoveredNodeStyle(style),\n      HighlighingType.Selected => PickSelectedNodeStyle(style),\n      HighlighingType.Marked   => PickMarkedNodeStyle(node, style),\n      _                        => node.Style\n    };\n\n    var group = GetHighlightedNodeGroup(type);\n    group[node] = node.Style;\n\n    if (type == HighlighingType.Marked && overwriteStyle) {\n      fixedMarkedNodes_[node] = style;\n    }\n  }\n\n  private void ResetHighlightedNodes(HighlighingType type, bool redraw = true) {\n    var group = GetHighlightedNodeGroup(type);\n\n    if (group.Count == 0) {\n      return;\n    }\n\n    var tempNodes = new List<FlameGraphNode>(group.Keys);\n    group.Clear();\n\n    foreach (var node in tempNodes) {\n      RestoreNodeStyle(node);\n    }\n\n    if (redraw) {\n      renderer_.Redraw();\n    }\n  }\n\n  private void RestoreNodeStyle(FlameGraphNode node, bool redraw = false) {\n    if (!markedNodes_.TryGetValue(node, out var style) &&\n        !selectedNodes_.TryGetValue(node, out style) &&\n        !hoverNodes_.TryGetValue(node, out style)) {\n      // Check marked directly by user.\n      if (fixedMarkedNodes_.TryGetValue(node, out style)) {\n        MarkNodeImpl(node, HighlighingType.Marked, style);\n        return;\n      }\n\n      style = renderer_.GetNodeStyle(node);\n    }\n\n    node.Style = style;\n\n    if (redraw) {\n      renderer_.Redraw();\n    }\n  }\n\n  private Dictionary<FlameGraphNode, HighlightingStyle> GetHighlightedNodeGroup(HighlighingType type) {\n    return type switch {\n      HighlighingType.Hovered  => hoverNodes_,\n      HighlighingType.Selected => selectedNodes_,\n      HighlighingType.Marked   => markedNodes_,\n      _                        => throw new InvalidOperationException(\"Unsupported highlighting type\")\n    };\n  }\n\n  private HighlightingStyle ApplyBorderToStyle(HighlightingStyle style, Pen border) {\n    return new HighlightingStyle(style.BackColor, border);\n  }\n\n  private HighlightingStyle PickHoveredNodeStyle(HighlightingStyle style) {\n    var newColor = ColorUtils.AdjustLight(((SolidColorBrush)style.BackColor).Color, 0.9f);\n    return new HighlightingStyle(newColor, style.Border);\n  }\n\n  private HighlightingStyle PickSelectedNodeStyle(HighlightingStyle style) {\n    var newColor = selectedNodeBackColor_;\n    var newPen = selectedNodeBorderColor_;\n    return new HighlightingStyle(newColor, newPen);\n  }\n\n  private HighlightingStyle PickMarkedNodeStyle(FlameGraphNode node, HighlightingStyle style = null) {\n    if (style != null) {\n      return style;\n    }\n\n    var newColor = markedNodeBackColor_;\n    var newPen = markedNodeBorderColor_;\n\n    if (node.SearchResult.HasValue) {\n      newPen = searchResultBorderColor_;\n    }\n\n    return new HighlightingStyle(newColor, newPen);\n  }\n\n  private void OnMouseRightButtonDown(object sender, MouseButtonEventArgs e) {\n    // On right click, don't deselect node if already selected.\n    SelectPointedNode(e, false);\n  }\n\n  private void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) {\n    // On left click, deselect node if already selected.\n    SelectPointedNode(e, true);\n  }\n\n  private void SelectPointedNode(MouseButtonEventArgs e, bool deselectIfSelected) {\n    var point = e.GetPosition(this);\n    var graphNode = FindPointedNode(point);\n\n    if (graphNode != null) {\n      if (Utils.IsShiftModifierActive() && selectedNode_ != null) {\n        // Try to extend the selection to include all nodes between\n        // the currently selected one and new one.\n        var nodes = FindNodesInBetween(graphNode, selectedNode_);\n\n        if (nodes is {Count: > 0}) {\n          foreach (var node in nodes) {\n            SelectNode(node, true, false);\n          }\n\n          return;\n        }\n      }\n\n      SelectNode(graphNode, append: Utils.IsControlModifierActive(), deselectIfSelected);\n    }\n    else {\n      ClearSelection();\n    }\n  }\n\n  private List<FlameGraphNode> FindNodesInBetween(FlameGraphNode startNode, FlameGraphNode stopNode) {\n    var list = new List<FlameGraphNode>();\n    bool found = false;\n\n    // Ensure start node has a larger depth than end node.\n    if (startNode.Depth < stopNode.Depth) {\n      Utils.Swap(ref startNode, ref stopNode);\n    }\n\n    while (startNode.Depth >= stopNode.Depth) {\n      list.Add(startNode);\n\n      if (startNode == stopNode) {\n        found = true;\n        break;\n      }\n\n      startNode = startNode.Parent;\n    }\n\n    return found ? list : null;\n  }\n\n  private void MarkNodeNoRedraw(ProfileCallTreeNode node, HighlightingStyle style, bool overwriteStyle) {\n    var fgNodes = flameGraph_.GetNodes(node);\n\n    foreach (var fgNode in fgNodes) {\n      MarkNodeImpl(fgNode, HighlighingType.Marked, style, overwriteStyle);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/ProfileListView.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Profile.ProfileListView\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:document=\"clr-namespace:ProfileExplorer.UI.Document\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n\n  <DockPanel LastChildFill=\"True\">\n    <document:SearchPanel\n      x:Name=\"SearchPanel\"\n      Height=\"28\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Top\"\n      DockPanel.Dock=\"Top\"\n      Opacity=\"1\"\n      Visibility=\"Collapsed\" />\n    <ListView\n      x:Name=\"ItemList\"\n      Panel.ZIndex=\"1\"\n      ProfileExplorerUi:GridViewColumnVisibility.Enabled=\"True\"\n      AlternationCount=\"{Binding Settings.AlternateListRows, Converter={StaticResource AlternateRowConverter}}\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n      BorderBrush=\"{x:Null}\"\n      BorderThickness=\"0,0,0,0\"\n      DockPanel.Dock=\"Bottom\"\n      IsTextSearchEnabled=\"True\"\n      SelectionChanged=\"ItemList_SelectionChanged\"\n      SelectionMode=\"Extended\"\n      TextSearch.TextPath=\"Name\"\n      VirtualizingStackPanel.IsVirtualizing=\"True\"\n      VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n      <ListView.View>\n        <GridView>\n          <GridViewColumn\n            Width=\"24\"\n            ProfileExplorerUi:GridViewColumnVisibility.IsVisible=\"{Binding ShowContextColumn}\"\n            CellTemplate=\"{StaticResource ExecutionContextTemplate}\">\n            <GridViewColumnHeader\n              x:Name=\"ContextColumnHeader\"\n              Content=\"C\"\n              ToolTip=\"Execution context\" />\n          </GridViewColumn>\n\n          <GridViewColumn Width=\"{Binding FunctionColumnWidth}\">\n            <GridViewColumnHeader\n              x:Name=\"FunctionColumnHeader\"\n              Content=\"{Binding NameColumnTitle}\" />\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <StackPanel>\n                  <Grid Background=\"{Binding FunctionBackColor}\">\n                    <ContentPresenter\n                      Content=\"{Binding Name}\"\n                      ToolTip=\"{Binding FunctionName}\" />\n                  </Grid>\n                  <ContentControl\n                    HorizontalAlignment=\"Stretch\"\n                    Content=\"{Binding}\"\n                    ContentTemplate=\"{StaticResource ProfileCombinedPercentageTemplate}\"\n                    Visibility=\"{Binding Path=DataContext.ShowCombinedTimeNameRow, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ItemsControl}}, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                  <ContentControl\n                    HorizontalAlignment=\"Stretch\"\n                    Content=\"{Binding}\"\n                    ContentTemplate=\"{StaticResource ProfilePercentageTemplate}\"\n                    Visibility=\"{Binding Path=DataContext.ShowTimeNameRow, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ItemsControl}}, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                  <ContentControl\n                    HorizontalAlignment=\"Stretch\"\n                    Content=\"{Binding}\"\n                    ContentTemplate=\"{StaticResource ProfileExclusivePercentageTemplate}\"\n                    Visibility=\"{Binding Path=DataContext.ShowExclusiveTimeNameRow, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ItemsControl}}, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                </StackPanel>\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"80\"\n            ProfileExplorerUi:GridViewColumnVisibility.IsVisible=\"{Binding ShowModuleColumn}\">\n            <GridViewColumnHeader\n              x:Name=\"ModuleColumnHeader\"\n              Content=\"Module\" />\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <Grid\n                  HorizontalAlignment=\"Stretch\"\n                  Background=\"{Binding ModuleBackColor}\">\n                  <TextBlock\n                    Margin=\"1,0,0,0\"\n                    HorizontalAlignment=\"Left\"\n                    VerticalAlignment=\"Center\"\n                    FontWeight=\"Medium\"\n                    Text=\"{Binding Path=ModuleName}\">\n                    <TextBlock.Style>\n                      <Style TargetType=\"{x:Type TextBlock}\">\n                        <Style.Triggers>\n                          <DataTrigger\n                            Binding=\"{Binding Path=IsMarked}\"\n                            Value=\"True\">\n                            <Setter Property=\"FontWeight\" Value=\"Bold\" />\n                          </DataTrigger>\n                        </Style.Triggers>\n                      </Style>\n                    </TextBlock.Style>\n                  </TextBlock>\n                </Grid>\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"150\"\n            ProfileExplorerUi:GridViewColumnVisibility.IsVisible=\"{Binding ShowExclusiveTimeColumn}\">\n            <GridViewColumnHeader\n              x:Name=\"ChildExclusiveTimeColumnHeader\"\n              Content=\"{Binding ExclusiveTimeColumnTitle}\" />\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <ContentControl\n                  HorizontalAlignment=\"Stretch\"\n                  Content=\"{Binding}\"\n                  ContentTemplate=\"{StaticResource ProfileExclusivePercentageTemplate}\" />\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"150\"\n            ProfileExplorerUi:GridViewColumnVisibility.IsVisible=\"{Binding ShowTimeColumn}\">\n            <GridViewColumnHeader\n              x:Name=\"ChildTimeColumnHeader\"\n              Content=\"{Binding TimeColumnTitle}\" />\n\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <ContentControl\n                  HorizontalAlignment=\"Stretch\"\n                  Content=\"{Binding}\"\n                  ContentTemplate=\"{StaticResource ProfilePercentageTemplate}\" />\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n\n          <GridViewColumn\n            Width=\"180\"\n            ProfileExplorerUi:GridViewColumnVisibility.IsVisible=\"{Binding ShowCombinedTimeColumn}\">\n            <GridViewColumnHeader\n              x:Name=\"ChildCombinedTimeColumnHeader\"\n              Content=\"{Binding TimeColumnTitle}\" />\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <ContentControl\n                  HorizontalAlignment=\"Stretch\"\n                  Content=\"{Binding}\"\n                  ContentTemplate=\"{StaticResource ProfileCombinedPercentageTemplate}\" />\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n        </GridView>\n      </ListView.View>\n\n      <ListView.ItemContainerStyle>\n        <Style\n          BasedOn=\"{StaticResource FlatListViewItem}\"\n          TargetType=\"{x:Type ListViewItem}\">\n          <EventSetter\n            Event=\"MouseDoubleClick\"\n            Handler=\"ItemList_MouseDoubleClick\" />\n          <EventSetter\n            Event=\"PreviewKeyDown\"\n            Handler=\"ItemList_PreviewKeyDown\" />\n          <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n          <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n\n          <Style.Triggers>\n            <Trigger Property=\"ItemsControl.AlternationIndex\" Value=\"0\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n            </Trigger>\n            <Trigger Property=\"ItemsControl.AlternationIndex\" Value=\"1\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.MenuBrushKey}}\" />\n            </Trigger>\n          </Style.Triggers>\n        </Style>\n      </ListView.ItemContainerStyle>\n\n      <ListView.ContextMenu>\n        <ContextMenu>\n          <MenuItem\n            Command=\"{Binding PreviewFunctionCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Preview Function\"\n            InputGestureText=\"Alt+Return\"\n            ToolTip=\"Show a preview popup of the function assembly or source code\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource PeekDefinitionIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding OpenFunctionCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Open Function\"\n            InputGestureText=\"Return/Double-Click\"\n            ToolTip=\"Open the function assembly view\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource LayoutOpenIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding OpenFunctionInNewTabCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Open Function in New Tab\"\n            InputGestureText=\"Ctrl+Return\"\n            ToolTip=\"Open the function assembly view in a new tab\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource LayoutOpenNewIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Header=\"Instance\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem\n              Command=\"{Binding PreviewFunctionInstanceCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Preview Function Instance\"\n              InputGestureText=\"Alt+Shift+Return\"\n              ToolTip=\"Show a preview popup of the function assembly or source code\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource PeekDefinitionIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"{Binding OpenInstanceCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Open Function Instance\"\n              InputGestureText=\"Shift+Return\"\n              ToolTip=\"Open the function assembly view for only this instance of the function\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource LayoutOpenIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n            <MenuItem\n              Command=\"{Binding OpenInstanceInNewTabCommand}\"\n              CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n              Header=\"Open Function Instance in New Tab\"\n              InputGestureText=\"Ctrl+Shift+Return\"\n              ToolTip=\"Open the function assembly view for only this instance of the function in a new tab\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Source=\"{StaticResource LayoutOpenNewIcon}\" />\n              </MenuItem.Icon>\n            </MenuItem>\n          </MenuItem>\n          <Separator\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n          <MenuItem\n            Command=\"{Binding CopyFunctionDetailsCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Copy Function Details\"\n            InputGestureText=\"Ctrl+C\"\n            ToolTip=\"Copy the function name and additional information as an HTML table\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource ClipboardIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding CopyDemangledFunctionNameCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Copy Function Name\"\n            InputGestureText=\"Ctrl+Shift+C\"\n            ToolTip=\"Copy the function name to the clipboard\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n          <MenuItem\n            Command=\"{Binding CopyFunctionNameCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Copy Mangled Function Name\"\n            InputGestureText=\"Ctrl+Alt+C\"\n            ToolTip=\"Copy the mangled function name to the clipboard (C++)\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n          <Separator\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n          <MenuItem\n            Header=\"Mark Module\"\n            ToolTip=\"Mark all functions belonging to this module (saved)\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource AddBookmarkIcon}\" />\n            </MenuItem.Icon>\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkModuleCommand}\" />\n              </MenuItem.Header>\n\n            </MenuItem>\n          </MenuItem>\n          <MenuItem\n            Header=\"Mark Function\"\n            ToolTip=\"Mark all functions with the same name (saved)\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource BookmarkIcon}\" />\n            </MenuItem.Icon>\n            <MenuItem>\n              <MenuItem.Header>\n                <ProfileExplorerUi:ColorSelector ColorSelectedCommand=\"{Binding MarkFunctionCommand}\" />\n              </MenuItem.Header>\n\n            </MenuItem>\n          </MenuItem>\n          <Separator\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n          <MenuItem\n            Command=\"{Binding SelectFunctionSummaryCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Select in Summary\"\n            ToolTip=\"Select the function in the Summary panel\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SummaryIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding SelectFunctionCallTreeCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Select in Call Tree\"\n            ToolTip=\"Select the function instance in the Call Tree view\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource TreeIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding SelectFunctionFlameGraphCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Select in Flame Graph\"\n            ToolTip=\"Select the function instance in the Flame Graph view\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource FlameGraphIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding SelectFunctionTimelineCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Select in Timeline\"\n            ToolTip=\"Select the function instance in the Timeline view\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource TimelineIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n\n          <MenuItem\n            Command=\"{Binding ExportCategoriesHtmlCommand}\"\n            Header=\"Export Categories as HTML File\"\n            ToolTip=\"Save the report with function categories as an HTML file\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource SourceIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding ExportCategoriesMarkdownCommand}\"\n            Header=\"Export Categories as Markdown File\"\n            ToolTip=\"Save the report with function categories as a Markdown file\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource DocumentIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <Separator Visibility=\"{Binding IsCategoriesList, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <MenuItem\n            Command=\"{Binding CopyCategoriesCommand}\"\n            Header=\"Copy Categories as HTML/Markdown\"\n            ToolTip=\"Copy the report with function categories as an HTML table\"\n            Visibility=\"{Binding IsCategoriesList, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource ClipboardIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n        </ContextMenu>\n      </ListView.ContextMenu>\n    </ListView>\n  </DockPanel>\n  <UserControl.InputBindings>\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding OpenFunctionCommand}\"\n      Modifiers=\"Control\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding OpenFunctionInNewTabCommand}\"\n      Modifiers=\"Control+Shift\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding PreviewFunctionCommand}\"\n      Modifiers=\"Alt\" />\n    <KeyBinding\n      Key=\"Return\"\n      Command=\"{Binding PreviewFunctionInstanceCommand}\"\n      Modifiers=\"Alt+Shift\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyFunctionNameCommand}\"\n      Modifiers=\"Control+Alt\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyDemangledFunctionNameCommand}\"\n      Modifiers=\"Control+Shift\" />\n    <KeyBinding\n      Key=\"C\"\n      Command=\"{Binding CopyFunctionDetailsCommand}\"\n      Modifiers=\"Control\" />\n    <KeyBinding\n      Key=\"F\"\n      Command=\"{Binding ToggleSearchCommand}\"\n      Modifiers=\"Ctrl\" />\n  </UserControl.InputBindings>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/ProfileListView.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic class ProfileListViewItem : SearchableProfileItem {\n  private CallTreeNodeSettings settings_;\n  private object associatedObject_;\n  private Brush functionBackColor_;\n  private Brush moduleBackColor_;\n\n  private ProfileListViewItem(FunctionNameFormatter funcNameFormatter,\n                              CallTreeNodeSettings settings) :\n    base(funcNameFormatter) {\n    settings_ = settings;\n  }\n\n  public ProfileCallTreeNode CallTreeNode {\n    get => associatedObject_ as ProfileCallTreeNode;\n    set => associatedObject_ = value;\n  }\n\n  public ModuleProfileInfo ModuleInfo {\n    get => associatedObject_ as ModuleProfileInfo;\n    set => associatedObject_ = value;\n  }\n\n  public FunctionMarkingCategory MarkingCategory {\n    get => associatedObject_ as FunctionMarkingCategory;\n    set => associatedObject_ = value;\n  }\n\n  public Brush FunctionBackColor {\n    get => functionBackColor_;\n    set => SetAndNotify(ref functionBackColor_, value);\n  }\n\n  public Brush ModuleBackColor {\n    get => moduleBackColor_;\n    set => SetAndNotify(ref moduleBackColor_, value);\n  }\n\n  protected override string GetFunctionName() {\n    return CallTreeNode?.FunctionName;\n  }\n\n  public static ProfileListViewItem From(ProfileCallTreeNode node, ProfileData profileData,\n                                         FunctionNameFormatter funcNameFormatter,\n                                         CallTreeNodeSettings settings) {\n    return new ProfileListViewItem(funcNameFormatter, settings) {\n      CallTreeNode = node,\n      ModuleName = node.ModuleName,\n      Weight = node.Weight,\n      ExclusiveWeight = node.ExclusiveWeight,\n      Percentage = profileData.ScaleFunctionWeight(node.Weight),\n      ExclusivePercentage = profileData.ScaleFunctionWeight(node.ExclusiveWeight)\n    };\n  }\n\n  public static ProfileListViewItem From(ModuleProfileInfo moduleInfo, ProfileData profileData,\n                                         FunctionNameFormatter funcNameFormatter,\n                                         CallTreeNodeSettings settings) {\n    return new ProfileListViewItem(funcNameFormatter, settings) {\n      ModuleInfo = moduleInfo,\n      FunctionName = moduleInfo.Name, // Override name, disables GetFunctionName.\n      Weight = moduleInfo.Weight,\n      Percentage = moduleInfo.Percentage\n    };\n  }\n\n  public static ProfileListViewItem From(FunctionMarkingCategory category, ProfileData profileData,\n                                         FunctionNameFormatter funcNameFormatter,\n                                         CallTreeNodeSettings settings) {\n    return new ProfileListViewItem(funcNameFormatter, settings) {\n      MarkingCategory = category,\n      FunctionName = category.Marking.Title, // Override name, disables GetFunctionName.\n      Weight = category.Weight,\n      Percentage = category.Percentage\n    };\n  }\n\n  protected override bool ShouldPrependModule() {\n    return settings_.PrependModuleToFunction;\n  }\n}\n\npublic partial class ProfileListView : UserControl, INotifyPropertyChanged {\n  private const double DefaultFunctionColumnWidth = 250;\n  private string nameColumnTitle_;\n  private string timeColumnTitle_;\n  private string exclusiveTimeColumnTitle_;\n  private bool showExclusiveTimeColumn_;\n  private bool showTimeColumn_;\n  private bool showCombinedTimeColumn_;\n  private bool showCombinedTimeNameRow_;\n  private bool showExclusiveTimeNameRow_;\n  private bool showTimeNameRow_;\n  private bool showModuleColumn_;\n  private bool showContextColumn_;\n  private double functionColumnWidth_;\n  private IUISession session_;\n  private IRDocumentPopupInstance previewPopup_;\n  private CallTreeNodeSettings settings_;\n  private bool searchPanelVisible_;\n  private List<ProfileListViewItem> itemList_;\n  private List<ProfileListViewItem> resultList_;\n  private List<FunctionMarkingCategory> categories_;\n  private bool isCategoriesList_;\n\n  public ProfileListView() {\n    InitializeComponent();\n    FunctionColumnWidth = DefaultFunctionColumnWidth;\n    DataContext = this;\n\n    SearchPanel.SearchChanged += SearchPanel_SearchChanged;\n    SearchPanel.CloseSearchPanel += SearchPanel_CloseSearchPanel;\n    SearchPanel.NavigateToPreviousResult += SearchPanel_NaviateToPreviousResult;\n    SearchPanel.NavigateToNextResult += SearchPanel_NavigateToNextResult;\n  }\n\n  public CallTreeNodeSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      OnPropertyChanged();\n\n      if (settings_ != null && session_ != null) {\n        SetupPreviewPopup();\n      }\n    }\n  }\n\n  public IUISession Session {\n    get => session_;\n    set => session_ = value;\n  }\n\n  public double FunctionColumnWidth {\n    get => functionColumnWidth_;\n    set => SetField(ref functionColumnWidth_, value);\n  }\n\n  public bool IsCategoriesList {\n    get => isCategoriesList_;\n    set => SetField(ref isCategoriesList_, value);\n  }\n\n  public RelayCommand<object> PreviewFunctionCommand => new(async obj => {\n    if (ItemList.SelectedItem is ProfileListViewItem item && item.CallTreeNode != null) {\n      var brush = GetMarkedNodeColor(item);\n      await IRDocumentPopupInstance.ShowPreviewPopup(item.CallTreeNode.Function, \"\",\n                                                     ItemList, session_, null, false, brush);\n    }\n  });\n  public RelayCommand<object> OpenFunctionCommand => new(async obj => {\n    var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n    await OpenFunction(mode);\n  });\n  public RelayCommand<object> OpenFunctionInNewTabCommand => new(async obj => {\n    await OpenFunction(OpenSectionKind.NewTab);\n  });\n  public RelayCommand<object> PreviewFunctionInstanceCommand => new(async obj => {\n    if (ItemList.SelectedItem is ProfileListViewItem item && item.CallTreeNode != null) {\n      var filter = new ProfileSampleFilter(item.CallTreeNode);\n      await IRDocumentPopupInstance.ShowPreviewPopup(item.CallTreeNode.Function, \"\",\n                                                     ItemList, session_, filter);\n    }\n  });\n  public RelayCommand<object> OpenInstanceCommand => new(async obj => {\n    var mode = Utils.IsControlModifierActive() ? OpenSectionKind.NewTab : OpenSectionKind.ReplaceCurrent;\n    await OpenFunction(mode);\n  });\n  public RelayCommand<object> OpenInstanceInNewTabCommand => new(async obj => {\n    await OpenFunctionInstance(OpenSectionKind.NewTab);\n  });\n  public RelayCommand<object> SelectFunctionSummaryCommand => new(async obj => {\n    await SelectFunctionInPanel(ToolPanelKind.Section);\n  });\n  public RelayCommand<object> SelectFunctionCallTreeCommand => new(async obj => {\n    await SelectFunctionInPanel(ToolPanelKind.CallTree);\n  });\n  public RelayCommand<object> SelectFunctionFlameGraphCommand => new(async obj => {\n    await SelectFunctionInPanel(ToolPanelKind.FlameGraph);\n  });\n  public RelayCommand<object> SelectFunctionTimelineCommand => new(async obj => {\n    await SelectFunctionInPanel(ToolPanelKind.Timeline);\n  });\n  public RelayCommand<object> ToggleSearchCommand => new(async obj => {\n    SearchPanelVisible = !SearchPanelVisible;\n  });\n  public RelayCommand<object> CopyFunctionNameCommand => new(async obj => {\n    if (ItemList.SelectedItem is ProfileListViewItem item) {\n      string text = Session.CompilerInfo.NameProvider.GetFunctionName(item.CallTreeNode.Function);\n      Clipboard.SetText(text);\n    }\n  });\n  public RelayCommand<object> CopyDemangledFunctionNameCommand => new(async obj => {\n    if (ItemList.SelectedItem is ProfileListViewItem item) {\n      var options = FunctionNameDemanglingOptions.Default;\n      string text = Session.CompilerInfo.NameProvider.DemangleFunctionName(item.CallTreeNode.Function, options);\n      Clipboard.SetText(text);\n    }\n  });\n  public RelayCommand<object> CopyFunctionDetailsCommand => new(async obj => {\n    if (ItemList.SelectedItems.Count > 0) {\n      var funcList = new List<SearchableProfileItem>();\n\n      foreach (object item in ItemList.SelectedItems) {\n        funcList.Add((SearchableProfileItem)item);\n      }\n\n      SearchableProfileItem.CopyFunctionListAsHtml(funcList);\n    }\n  });\n  public RelayCommand<object> MarkModuleCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n\n    foreach (object item in ItemList.SelectedItems) {\n      if (item is ProfileListViewItem profileItem &&\n          obj is SelectedColorEventArgs e) {\n        markingSettings.AddModuleColor(profileItem.ModuleName, e.SelectedColor);\n      }\n    }\n\n    markingSettings.UseModuleColors = true;\n    UpdateMarkedFunctions();\n    MarkingChanged?.Invoke(this, EventArgs.Empty);\n  });\n  public RelayCommand<object> MarkFunctionCommand => new(async obj => {\n    var markingSettings = App.Settings.MarkingSettings;\n\n    foreach (object item in ItemList.SelectedItems) {\n      if (item is ProfileListViewItem profileItem &&\n          obj is SelectedColorEventArgs e) {\n        markingSettings.AddFunctionColor(profileItem.FunctionName, e.SelectedColor);\n      }\n    }\n\n    markingSettings.UseFunctionColors = true;\n    UpdateMarkedFunctions();\n    MarkingChanged?.Invoke(this, EventArgs.Empty);\n  });\n  public RelayCommand<object> CopyCategoriesCommand => new(async obj => {\n    if (categories_ != null) {\n      ProfilingExporting.CopyFunctionMarkingsAsHtml(categories_, Session);\n    }\n  });\n  public RelayCommand<object> ExportCategoriesHtmlCommand => new(async obj => {\n    if (categories_ != null) {\n      await ProfilingExporting.ExportFunctionMarkingsAsHtmlFile(categories_, Session);\n    }\n  });\n  public RelayCommand<object> ExportCategoriesMarkdownCommand => new(async obj => {\n    if (categories_ != null) {\n      await ProfilingExporting.ExportFunctionMarkingsAsMarkdownFile(categories_, Session);\n    }\n  });\n\n  public bool SearchPanelVisible {\n    get => searchPanelVisible_;\n    set {\n      if (value != searchPanelVisible_) {\n        searchPanelVisible_ = value;\n\n        if (searchPanelVisible_) {\n          SearchPanel.Visibility = Visibility.Visible;\n          SearchPanel.Show();\n        }\n        else {\n          SearchPanel.Reset();\n          SearchPanel.Visibility = Visibility.Collapsed;\n        }\n\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public string NameColumnTitle {\n    get => nameColumnTitle_;\n    set => SetField(ref nameColumnTitle_, value);\n  }\n\n  public string TimeColumnTitle {\n    get => timeColumnTitle_;\n    set => SetField(ref timeColumnTitle_, value);\n  }\n\n  public string ExclusiveTimeColumnTitle {\n    get => exclusiveTimeColumnTitle_;\n    set => SetField(ref exclusiveTimeColumnTitle_, value);\n  }\n\n  public bool ShowExclusiveTimeColumn {\n    get => showExclusiveTimeColumn_;\n    set => SetField(ref showExclusiveTimeColumn_, value);\n  }\n\n  public bool ShowTimeColumn {\n    get => showTimeColumn_;\n    set => SetField(ref showTimeColumn_, value);\n  }\n\n  public bool ShowCombinedTimeColumn {\n    get => showCombinedTimeColumn_;\n    set => SetField(ref showCombinedTimeColumn_, value);\n  }\n\n  public bool ShowCombinedTimeNameRow {\n    get => showCombinedTimeNameRow_;\n    set => SetField(ref showCombinedTimeNameRow_, value);\n  }\n\n  public bool ShowExclusiveTimeNameRow {\n    get => showExclusiveTimeNameRow_;\n    set => SetField(ref showExclusiveTimeNameRow_, value);\n  }\n\n  public bool ShowTimeNameRow {\n    get => showTimeNameRow_;\n    set => SetField(ref showTimeNameRow_, value);\n  }\n\n  public bool ShowModuleColumn {\n    get => showModuleColumn_;\n    set => SetField(ref showModuleColumn_, value);\n  }\n\n  public bool ShowContextColumn {\n    get => showContextColumn_;\n    set => SetField(ref showContextColumn_, value);\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void SearchPanel_NavigateToNextResult(object sender, SearchInfo e) {\n    SelectSearchResult(e.CurrentResult);\n  }\n\n  private void SearchPanel_NaviateToPreviousResult(object sender, SearchInfo e) {\n    SelectSearchResult(e.CurrentResult);\n  }\n\n  private void SearchPanel_CloseSearchPanel(object sender, SearchInfo e) {\n    SearchPanelVisible = false;\n    resultList_ = null;\n  }\n\n  private void SearchPanel_SearchChanged(object sender, SearchInfo e) {\n    if (itemList_ == null) {\n      return;\n    }\n\n    resultList_ = new List<ProfileListViewItem>();\n\n    foreach (var item in itemList_) {\n      var result = TextSearcher.FirstIndexOf(item.FunctionName, e.SearchedText, 0,\n                                             e.SearchKind);\n\n      if (result.HasValue) {\n        item.SearchResult = result;\n        item.ResetCachedName();\n        resultList_.Add(item);\n      }\n      else {\n        item.SearchResult = null;\n        item.ResetCachedName();\n      }\n    }\n\n    e.CurrentResult = 0;\n    e.ResultCount = resultList_.Count;\n  }\n\n  private void SelectSearchResult(int index) {\n    if (resultList_ == null) {\n      return;\n    }\n\n    ItemList.SelectedItem = resultList_[index];\n    ItemList.ScrollIntoView(ItemList.SelectedItem);\n  }\n\n  ~ProfileListView() {\n    previewPopup_?.UnregisterHoverEvents();\n  }\n\n  private void SetupPreviewPopup() {\n    if (previewPopup_ != null) {\n      previewPopup_.UnregisterHoverEvents();\n      previewPopup_ = null;\n    }\n\n    if (!Settings.ShowPreviewPopup) {\n      return;\n    }\n\n    previewPopup_ = new IRDocumentPopupInstance(App.Settings.PreviewPopupSettings, Session);\n    previewPopup_.SetupHoverEvents(ItemList, TimeSpan.FromMilliseconds(Settings.PreviewPopupDuration), () => {\n      var hoveredItem = Utils.FindPointedListViewItem(ItemList);\n      if (hoveredItem == null)\n        return null;\n\n      var item = (ProfileListViewItem)hoveredItem.DataContext;\n\n      if (item.CallTreeNode != null) {\n        return PreviewPopupArgs.ForFunction(item.CallTreeNode.Function, ItemList);\n      }\n\n      return null;\n    });\n  }\n\n  public event EventHandler<ModuleProfileInfo> ModuleClick;\n  public event EventHandler<FunctionMarkingCategory> CategoryClick;\n  public event EventHandler<ProfileCallTreeNode> NodeClick;\n  public event EventHandler<ProfileCallTreeNode> NodeDoubleClick;\n  public event EventHandler MarkingChanged;\n\n  private Brush GetMarkedNodeColor(ProfileListViewItem node) {\n    return App.Settings.MarkingSettings.\n      GetMarkedNodeBrush(node.FunctionName, node.ModuleName);\n  }\n\n  private async Task OpenFunction(OpenSectionKind openMode) {\n    if (ItemList.SelectedItem is ProfileListViewItem item && item.CallTreeNode != null) {\n      await Session.OpenProfileFunction(item.CallTreeNode, openMode);\n    }\n  }\n\n  private async Task OpenFunctionInstance(OpenSectionKind openMode) {\n    if (ItemList.SelectedItem is ProfileListViewItem item && item.CallTreeNode != null) {\n      var filter = new ProfileSampleFilter(item.CallTreeNode);\n      await Session.OpenProfileFunction(item.CallTreeNode, openMode, filter);\n    }\n  }\n\n  private async Task SelectFunctionInPanel(ToolPanelKind panelKind) {\n    if (ItemList.SelectedItem is ProfileListViewItem item) {\n      await Session.SelectProfileFunctionInPanel(item.CallTreeNode, panelKind);\n    }\n  }\n\n  public void ShowSimpleList(List<ProfileCallTreeNode> nodes) {\n    ShowFunctions(nodes);\n\n    //? TODO: Hack for what looks like a WPF bug where the\n    // ProfileListView columns visibility is not read from the property\n    // when in a popup and the popup was first created.\n    GridViewColumnVisibility.RemoveAllColumnsExcept(\"FunctionColumnHeader\", ItemList);\n  }\n\n  public void ShowFunctions(List<ProfileCallTreeNode> nodes, ProfileListViewFilter filter = null) {\n    var filteredNodes = new List<ProfileCallTreeNode>();\n\n    if (filter is {IsEnabled: true}) {\n      if (filter.SortByExclusiveTime) {\n        nodes.Sort((a, b) => b.ExclusiveWeight.CompareTo(a.ExclusiveWeight));\n      }\n      else {\n        nodes.Sort((a, b) => b.Weight.CompareTo(a.Weight));\n      }\n\n      // Filter out functions under the MinWeight threshold.\n      var minWeight = filter.FilterByWeight ? TimeSpan.FromMilliseconds(filter.MinWeight) : TimeSpan.MaxValue;\n\n      if (filter.FilterByWeight) {\n        if (filter.SortByExclusiveTime) {\n          foreach (var node in nodes) {\n            if (node.ExclusiveWeight > minWeight) {\n              filteredNodes.Add(node);\n            }\n            else break;\n          }\n        }\n        else {\n          foreach (var node in nodes) {\n            if (node.Weight > minWeight) {\n              filteredNodes.Add(node);\n            }\n            else break;\n          }\n        }\n      }\n\n      // Have at least MinItems functs, even if they are below the MinWeight threshold\n      if (filteredNodes.Count < filter.MinItems && nodes.Count > filteredNodes.Count) {\n        for (int i = filteredNodes.Count; i < nodes.Count && filteredNodes.Count < filter.MinItems; i++) {\n          filteredNodes.Add(nodes[i]);\n        }\n      }\n\n      itemList_ = new List<ProfileListViewItem>(filteredNodes.Count);\n\n      foreach (var node in filteredNodes) {\n        var item = ProfileListViewItem.From(node, Session.ProfileData,\n                                            Session.CompilerInfo.NameProvider.FormatFunctionName, Settings);\n\n        // Stop once weight percentage drops under threshold.\n        if (item.Percentage >= filter.MinPercentage ||\n            itemList_.Count < filter.MinItems ||\n            item.Weight > minWeight && itemList_.Count < filter.MinItems * 10) {\n          itemList_.Add(item);\n        }\n        else {\n          break;\n        }\n      }\n    }\n    else {\n      // No filtering applied.\n      filteredNodes = nodes;\n      itemList_ = new List<ProfileListViewItem>(filteredNodes.Count);\n      filteredNodes.ForEach(node => itemList_.Add(ProfileListViewItem.From(node, Session.ProfileData,\n                                                                           Session.CompilerInfo.NameProvider.\n                                                                             FormatFunctionName, Settings)));\n    }\n\n    UpdateMarkedFunctions();\n    ItemList.ItemsSource = itemList_;\n    GridViewColumnVisibility.UpdateListView(ItemList);\n  }\n\n  public void ShowModules(List<ModuleProfileInfo> modules) {\n    itemList_ = new List<ProfileListViewItem>(modules.Count);\n    modules.ForEach(node => itemList_.Add(ProfileListViewItem.From(node, Session.ProfileData,\n                                                                   Session.CompilerInfo.NameProvider.FormatFunctionName,\n                                                                   Settings)));\n    UpdateMarkedFunctions();\n    ItemList.ItemsSource = new ListCollectionView(itemList_);\n    ItemList.ContextMenu = null;\n  }\n\n  public void ShowCategories(List<FunctionMarkingCategory> categories) {\n    itemList_ = new List<ProfileListViewItem>(categories.Count);\n\n    foreach (var node in categories) {\n      if (node.SortedFunctions.Count == 0) {\n        continue;\n      }\n\n      itemList_.Add(ProfileListViewItem.From(node, Session.ProfileData,\n                                             Session.CompilerInfo.NameProvider.FormatFunctionName, Settings));\n    }\n\n    UpdateMarkedFunctions();\n    ItemList.ItemsSource = new ListCollectionView(itemList_);\n    IsCategoriesList = true;\n    categories_ = categories;\n  }\n\n  public void UpdateMarkedFunctions() {\n    if (itemList_ == null) {\n      return; // Control not being used.\n    }\n\n    var fgSettings = App.Settings.MarkingSettings;\n\n    foreach (var f in itemList_) {\n      f.ModuleBackColor = null;\n      f.FunctionBackColor = null;\n    }\n\n    if (!fgSettings.UseAutoModuleColors &&\n        !fgSettings.UseModuleColors &&\n        !fgSettings.UseFunctionColors) {\n      return;\n    }\n\n    foreach (var item in itemList_) {\n      if (item.ModuleName == null || item.FunctionName == null) {\n        continue;\n      }\n\n      if (fgSettings.UseModuleColors &&\n          fgSettings.GetModuleBrush(item.ModuleName, out var brush)) {\n        item.ModuleBackColor = brush;\n      }\n      else if (fgSettings.UseAutoModuleColors) {\n        item.ModuleBackColor = fgSettings.GetAutoModuleBrush(item.ModuleName);\n      }\n\n      if (fgSettings.UseFunctionColors &&\n          fgSettings.GetFunctionColor(item.FunctionName, out var color)) {\n        item.FunctionBackColor = color.AsBrush();\n      }\n    }\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private void ItemList_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    var node = ((ListViewItem)sender).Content as ProfileListViewItem;\n\n    if (node?.CallTreeNode != null) {\n      NodeDoubleClick?.Invoke(this, node.CallTreeNode);\n    }\n  }\n\n  private void ItemList_PreviewKeyDown(object sender, KeyEventArgs e) {\n    var node = ((ListViewItem)sender).Content as ProfileListViewItem;\n\n    if (node?.CallTreeNode != null) {\n      NodeDoubleClick?.Invoke(this, node.CallTreeNode);\n    }\n  }\n\n  private void ItemList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    var node = ItemList.SelectedItem as ProfileListViewItem;\n\n    if (node?.CallTreeNode != null) {\n      NodeClick?.Invoke(this, node.CallTreeNode);\n    }\n    else if (node?.ModuleInfo != null) {\n      ModuleClick?.Invoke(this, node.ModuleInfo);\n    }\n    else if (node?.MarkingCategory != null) {\n      CategoryClick?.Invoke(this, node.MarkingCategory);\n    }\n\n    // Show the sum of the selected functions.\n    if (ItemList.SelectedItems.Count > 1) {\n      var selectedNodes = new List<ProfileCallTreeNode>();\n\n      foreach (object item in ItemList.SelectedItems) {\n        if (item is ProfileListViewItem profileItem && profileItem.CallTreeNode != null) {\n          selectedNodes.Add(profileItem.CallTreeNode);\n        }\n      }\n\n      var weightSum = ProfileCallTree.CombinedCallTreeNodesWeight(selectedNodes);\n      double weightPercentage = Session.ProfileData.ScaleFunctionWeight(weightSum);\n      string text =\n        $\"Selected {ItemList.SelectedItems.Count}: {weightPercentage.AsPercentageString()} ({weightSum.AsMillisecondsString()})\";\n      Session.SetApplicationStatus(text, \"Sum of time for the selected functions\");\n    }\n    else {\n      Session.SetApplicationStatus(\"\");\n    }\n  }\n\n  public void Reset() {\n    ItemList.ItemsSource = null;\n    itemList_ = null;\n    categories_ = null;\n  }\n\n  public void SelectFirstItem() {\n    if (ItemList.Items.Count > 0) {\n      ItemList.SelectedIndex = 0;\n    }\n  }\n\n  public void SaveColumnsState(ColumnSettings settings) {\n    settings.SaveColumnsState(ItemList);\n  }\n\n  public void RestoreColumnsState(ColumnSettings settings) {\n    settings.RestoreColumnsState(ItemList);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/ProfileReportPanel.xaml",
    "content": "﻿<local:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.Profile.ProfileReportPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:profile=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  xmlns:profileData=\"clr-namespace:ProfileExplorer.Core.Profile.Data;assembly=ProfileExplorerCore\"\n  d:DesignHeight=\"650\"\n  d:DesignWidth=\"800\"\n  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n  mc:Ignorable=\"d\">\n  <TabControl\n    x:Name=\"TabHost\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderThickness=\"0\"\n    ToolTip=\"Trace file and main process details\">\n    <TabItem\n      Header=\"Summary\"\n      Style=\"{StaticResource TabControlStyle}\">\n      <ScrollViewer>\n        <Grid>\n          <StackPanel Margin=\"8\">\n            <Expander\n              Header=\"Trace\"\n              IsExpanded=\"True\">\n              <StackPanel Margin=\"0,4,0,0\">\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Trace source\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.TraceFilePath}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Process\" />\n                  <TextBox\n                    Margin=\"100,0,0,1\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding Process.Name}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Process ID\" />\n                  <TextBox\n                    Margin=\"100,0,0,1\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding Process.ProcessId}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Image file\" />\n                  <TextBox\n                    Margin=\"100,0,0,1\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding Process.ImageFileName}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Command line\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding Process.CommandLine}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Start time\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.ProfileStartTime}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Duration\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.ProfileDuration, Mode=OneTime}\" />\n                </Grid>\n              </StackPanel>\n            </Expander>\n\n            <!-- Symbol loading warning - shown when ImageID events are missing -->\n            <Border\n              Margin=\"0,10,0,0\"\n              Padding=\"8\"\n              Background=\"#FFFFF0\"\n              BorderBrush=\"#FFD700\"\n              BorderThickness=\"1\"\n              CornerRadius=\"4\"\n              Visibility=\"{Binding TraceInfo.HasImageIdEvents, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n              <StackPanel>\n                <StackPanel Orientation=\"Horizontal\">\n                  <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Margin=\"0,0,6,0\"\n                    Source=\"{StaticResource WarningIconColor}\" />\n                  <TextBlock\n                    FontWeight=\"SemiBold\"\n                    Foreground=\"#B8860B\"\n                    Text=\"Symbol Loading Limited\" />\n                </StackPanel>\n                <TextBlock\n                  Margin=\"22,4,0,0\"\n                  Foreground=\"#666666\"\n                  TextWrapping=\"Wrap\">\n                  <Run Text=\"This trace is missing ImageID DbgID events (PDB GUID/Age). Symbol server lookups are disabled because PDB matching requires this information.\" />\n                  <LineBreak />\n                  <LineBreak />\n                  <Run Text=\"Function names will show as unresolved addresses. To get symbols, re-capture using:\" />\n                  <LineBreak />\n                  <Run Text=\"  • Profile Explorer's built-in trace capture (File → Record Profile)\" />\n                  <LineBreak />\n                  <Run Text=\"  • Or from command line: \" /><Run FontFamily=\"Consolas\" Text=\"wpr -start CPU\" />\n                </TextBlock>\n              </StackPanel>\n            </Border>\n\n            <Expander\n              Margin=\"0,10,0,0\"\n              Header=\"Machine details\"\n              IsExpanded=\"True\">\n              <StackPanel Margin=\"0,4,0,0\">\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Computer name\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.ComputerName}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Domain name\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.DomainName}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"CPU core count\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.CpuCount}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"CPU speed (Mhz)\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.CpuSpeed}\" />\n                </Grid>\n\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Memory size (MB)\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.MemorySize}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Is 64 bit\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding TraceInfo.Is64Bit, Mode=OneTime}\" />\n                </Grid>\n              </StackPanel>\n            </Expander>\n\n            <Expander\n              Margin=\"0,10,0,0\"\n              Header=\"Recording session\"\n              IsExpanded=\"True\"\n              Visibility=\"{Binding IsRecordingSession, Converter={StaticResource BoolToVisibilityConverter}}\">\n              <StackPanel Margin=\"0,4,0,0\">\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Application path\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SessionOptions.ApplicationPath}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Arguments\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SessionOptions.ApplicationArguments}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Working directory\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SessionOptions.WorkingDirectory}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Top\"\n                    Text=\"Environment vars.\" />\n                  <CheckBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Top\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"DarkBlue\"\n                    IsChecked=\"{Binding SessionOptions.EnableEnvironmentVars}\"\n                    IsHitTestVisible=\"False\" />\n                  <TextBox\n                    Margin=\"120,1,0,1\"\n                    VerticalAlignment=\"Top\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"LightGray\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding Path=SessionOptions.EnvironmentVariables, Converter={StaticResource StringListPairConverter}}\"\n                    Visibility=\"{Binding SessionOptions.EnableEnvironmentVars, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                </Grid>\n                <Separator Margin=\"0,4,0,4\" />\n\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Sampling freq.\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SessionOptions.SamplingFrequency}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Profile children\" />\n                  <CheckBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"DarkBlue\"\n                    IsChecked=\"{Binding SessionOptions.ProfileChildProcesses}\"\n                    IsHitTestVisible=\"False\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Profile .NET\" />\n                  <CheckBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"DarkBlue\"\n                    IsChecked=\"{Binding SessionOptions.ProfileDotNet}\"\n                    IsHitTestVisible=\"False\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Top\"\n                    Text=\"Perf. counters\" />\n                  <CheckBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Top\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"DarkBlue\"\n                    IsChecked=\"{Binding SessionOptions.RecordPerformanceCounters}\"\n                    IsHitTestVisible=\"False\" />\n                  <TextBox\n                    Margin=\"120,1,0,1\"\n                    VerticalAlignment=\"Top\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"LightGray\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding Path=SessionOptions.EnabledPerformanceCounters, Mode=OneWay, Converter={StaticResource PerformanceCounterConverter}}\"\n                    Visibility=\"{Binding SessionOptions.RecordPerformanceCounters, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                </Grid>\n              </StackPanel>\n            </Expander>\n          </StackPanel>\n        </Grid>\n      </ScrollViewer>\n    </TabItem>\n    <TabItem\n      Header=\"Modules\"\n      Style=\"{StaticResource TabControlStyle}\"\n      ToolTip=\"List of modules loaded by the main process\">\n      <DockPanel LastChildFill=\"True\">\n        <StackPanel\n          Margin=\"0,4,0,4\"\n          DockPanel.Dock=\"Top\"\n          Orientation=\"Horizontal\">\n          <Button\n            x:Name=\"LoadAllBinariesButton\"\n            Height=\"22\"\n            Padding=\"8,2,8,2\"\n            Click=\"LoadAllBinariesButton_Click\"\n            Content=\"Load All Binaries\"\n            ToolTip=\"Load binaries for all modules that have symbols loaded (for disassembly view)\" />\n        </StackPanel>\n        <ListView\n          x:Name=\"ModuleList\"\n          Height=\"250\"\n          MinHeight=\"100\"\n          MaxHeight=\"500\"\n          Margin=\"0,4,0,0\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          DockPanel.Dock=\"Top\"\n          IsEnabled=\"{Binding InputControlsEnabled}\"\n          IsTextSearchEnabled=\"True\"\n          ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n          SelectionMode=\"Single\"\n          TextSearch.TextPath=\"ImageFileInfo.ImageName\"\n          VirtualizingStackPanel.IsVirtualizing=\"True\"\n          VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n          <ListView.View>\n            <GridView>\n              <GridViewColumn\n                Width=\"150\"\n                DisplayMemberBinding=\"{Binding ImageFileInfo.ImageName}\">\n                <GridViewColumnHeader Content=\"Module\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn Width=\"85\">\n                <GridViewColumnHeader Content=\"Loaded\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border Margin=\"-6,-2,-6,-2\">\n                      <StackPanel\n                        Margin=\"6,2,6,2\"\n                        Orientation=\"Horizontal\">\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\">\n                          <Image.Style>\n                            <Style TargetType=\"{x:Type Image}\">\n                              <Style.Triggers>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.Loaded}\">\n                                  <Setter Property=\"Source\" Value=\"{StaticResource CheckIcon}\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.NotFound}\">\n                                  <Setter Property=\"Source\" Value=\"{StaticResource VoidIcon}\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.Failed}\">\n                                  <Setter Property=\"Source\" Value=\"{StaticResource WarningIconColor}\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.LazyLoadPending}\">\n                                  <Setter Property=\"Source\" Value=\"{StaticResource DotIconYellow}\" />\n                                </DataTrigger>\n                              </Style.Triggers>\n                            </Style>\n                          </Image.Style>\n                        </Image>\n\n                        <TextBlock>\n                          <TextBlock.Style>\n                            <Style TargetType=\"{x:Type TextBlock}\">\n                              <Style.Triggers>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.Loaded}\">\n                                  <Setter Property=\"Text\" Value=\"Yes\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.NotFound}\">\n                                  <Setter Property=\"Text\" Value=\"Not Found\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.Failed}\">\n                                  <Setter Property=\"Text\" Value=\"Failed\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding State}\"\n                                  Value=\"{x:Static profileData:ModuleLoadState.LazyLoadPending}\">\n                                  <Setter Property=\"Text\" Value=\"On-demand\" />\n                                </DataTrigger>\n                              </Style.Triggers>\n                            </Style>\n                          </TextBlock.Style>\n                        </TextBlock>\n                      </StackPanel>\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn\n                Width=\"150\"\n                DisplayMemberBinding=\"{Binding DebugInfoFile.SymbolFile.FileName, StringFormat={}{0:mm\\\\:ss\\\\.ff}}\">\n                <GridViewColumnHeader Content=\"Debug file\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n\n              <GridViewColumn Width=\"85\">\n                <GridViewColumnHeader Content=\"Debug loaded\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n                <GridViewColumn.CellTemplate>\n                  <DataTemplate>\n                    <Border Margin=\"-6,-2,-6,-2\">\n                      <StackPanel\n                        Margin=\"6,2,6,2\"\n                        Orientation=\"Horizontal\">\n                        <Image\n                          Width=\"16\"\n                          Height=\"16\">\n                          <Image.Style>\n                            <Style TargetType=\"{x:Type Image}\">\n                              <Style.Triggers>\n                                <DataTrigger\n                                  Binding=\"{Binding DebugInfoFile.Found}\"\n                                  Value=\"True\">\n                                  <Setter Property=\"Source\" Value=\"{StaticResource CheckIcon}\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding DebugInfoFile.Found}\"\n                                  Value=\"False\">\n                                  <Setter Property=\"Source\" Value=\"{StaticResource VoidIcon}\" />\n                                </DataTrigger>\n                              </Style.Triggers>\n                            </Style>\n                          </Image.Style>\n                        </Image>\n\n                        <TextBlock>\n                          <TextBlock.Style>\n                            <Style TargetType=\"{x:Type TextBlock}\">\n                              <Style.Triggers>\n                                <DataTrigger\n                                  Binding=\"{Binding DebugInfoFile.Found}\"\n                                  Value=\"True\">\n                                  <Setter Property=\"Text\" Value=\"Yes\" />\n                                </DataTrigger>\n                                <DataTrigger\n                                  Binding=\"{Binding DebugInfoFile.Found}\"\n                                  Value=\"False\">\n                                  <Setter Property=\"Text\" Value=\"Not Found\" />\n                                </DataTrigger>\n                              </Style.Triggers>\n                            </Style>\n                          </TextBlock.Style>\n                        </TextBlock>\n                      </StackPanel>\n                    </Border>\n                  </DataTemplate>\n                </GridViewColumn.CellTemplate>\n              </GridViewColumn>\n\n              <GridViewColumn\n                Width=\"250\"\n                DisplayMemberBinding=\"{Binding DebugInfoFile.FilePath}\">\n                <GridViewColumnHeader Content=\"Debug file local path\" />\n                <GridViewColumn.HeaderContainerStyle>\n                  <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                    <Setter Property=\"ToolTip\" Value=\"{Binding DebugInfoFile.FilePath}\" />\n                  </Style>\n                </GridViewColumn.HeaderContainerStyle>\n              </GridViewColumn>\n            </GridView>\n          </ListView.View>\n\n          <ListView.ItemContainerStyle>\n            <Style\n              BasedOn=\"{StaticResource FlatListViewItem}\"\n              TargetType=\"{x:Type ListViewItem}\">\n              <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n            </Style>\n          </ListView.ItemContainerStyle>\n        </ListView>\n        <TabControl\n          Margin=\"0,4,0,0\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderThickness=\"0\"\n          DockPanel.Dock=\"Bottom\"\n          TabStripPlacement=\"Top\">\n          <TabItem\n            Header=\"Image file\"\n            Style=\"{StaticResource TabControlStyle}\">\n            <DockPanel LastChildFill=\"True\">\n              <StackPanel\n                Margin=\"4,2,4,0\"\n                DockPanel.Dock=\"Top\">\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Name\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.ImageFileInfo.ImageName, ElementName=ModuleList}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Local path\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.BinaryFileInfo.FilePath, ElementName=ModuleList}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Architecture\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.BinaryFileInfo.BinaryFile.Architecture, ElementName=ModuleList}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Image size\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.BinaryFileInfo.BinaryFile.ImageSize, ElementName=ModuleList}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Code size\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.BinaryFileInfo.BinaryFile.CodeSize, ElementName=ModuleList}\" />\n                </Grid>\n\n\n              </StackPanel>\n              <Expander\n                Margin=\"0,8,0,0\"\n                Header=\"Logs\"\n                IsExpanded=\"True\">\n                <Grid>\n                  <TextBox\n                    Margin=\"0,2,0,0\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    FontFamily=\"Consolas\"\n                    Foreground=\"DarkBlue\"\n                    HorizontalScrollBarVisibility=\"Auto\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.BinaryFileInfo.Details, ElementName=ModuleList}\"\n                    TextWrapping=\"Wrap\"\n                    VerticalScrollBarVisibility=\"Auto\" />\n                </Grid>\n              </Expander>\n            </DockPanel>\n          </TabItem>\n          <TabItem\n            Header=\"Debug file\"\n            Style=\"{StaticResource TabControlStyle}\">\n            <DockPanel LastChildFill=\"True\">\n              <StackPanel\n                Margin=\"4,2,4,0\"\n                DockPanel.Dock=\"Top\">\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Name\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.DebugInfoFile.SymbolFile.FileName, ElementName=ModuleList}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Local path\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.DebugInfoFile.FilePath, ElementName=ModuleList}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Guid\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.DebugInfoFile.SymbolFile.Id, ElementName=ModuleList}\" />\n                </Grid>\n                <Grid>\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Age\" />\n                  <TextBox\n                    Margin=\"100,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    Foreground=\"DarkBlue\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.DebugInfoFile.SymbolFile.Age, ElementName=ModuleList}\" />\n                </Grid>\n\n              </StackPanel>\n              <Expander\n                Margin=\"0,8,0,0\"\n                Header=\"Logs\"\n                IsExpanded=\"True\">\n                <Grid>\n                  <TextBox\n                    Margin=\"0,2,0,0\"\n                    Background=\"Transparent\"\n                    BorderBrush=\"Transparent\"\n                    FontFamily=\"Consolas\"\n                    Foreground=\"DarkBlue\"\n                    HorizontalScrollBarVisibility=\"Auto\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding SelectedItem.DebugInfoFile.Details, ElementName=ModuleList}\"\n                    TextWrapping=\"Wrap\"\n                    VerticalScrollBarVisibility=\"Auto\" />\n                </Grid>\n              </Expander>\n            </DockPanel>\n          </TabItem>\n        </TabControl>\n      </DockPanel>\n    </TabItem>\n    <TabItem\n      Header=\"Process list\"\n      Style=\"{StaticResource TabControlStyle}\"\n      ToolTip=\"List of all processes found in the trace\">\n      <ListView\n        x:Name=\"ProcessList\"\n        MinHeight=\"100\"\n        Margin=\"0,4,0,0\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n        IsEnabled=\"{Binding InputControlsEnabled}\"\n        ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n        SelectionMode=\"Single\"\n        VirtualizingStackPanel.IsVirtualizing=\"True\"\n        VirtualizingStackPanel.VirtualizationMode=\"Recycling\"\n        Visibility=\"{Binding ShowProcessList, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <ListView.View>\n          <GridView>\n            <GridViewColumn\n              Width=\"150\"\n              DisplayMemberBinding=\"{Binding Process.Name}\">\n              <GridViewColumnHeader Content=\"Process\" />\n              <GridViewColumn.HeaderContainerStyle>\n                <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                </Style>\n              </GridViewColumn.HeaderContainerStyle>\n            </GridViewColumn>\n\n            <GridViewColumn\n              Width=\"80\"\n              DisplayMemberBinding=\"{Binding WeightPercentage, StringFormat={}{0:#0.00'%'}}\">\n              <GridViewColumnHeader Content=\"Weight\" />\n              <GridViewColumn.HeaderContainerStyle>\n                <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                </Style>\n              </GridViewColumn.HeaderContainerStyle>\n            </GridViewColumn>\n\n            <GridViewColumn\n              Width=\"80\"\n              DisplayMemberBinding=\"{Binding Duration, StringFormat={}{0:mm\\\\:ss\\\\.ff}}\">\n              <GridViewColumnHeader Content=\"Duration\" />\n              <GridViewColumn.HeaderContainerStyle>\n                <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                </Style>\n              </GridViewColumn.HeaderContainerStyle>\n            </GridViewColumn>\n\n            <GridViewColumn\n              Width=\"70\"\n              DisplayMemberBinding=\"{Binding Process.ProcessId}\">\n              <GridViewColumnHeader Content=\"Process ID\" />\n              <GridViewColumn.HeaderContainerStyle>\n                <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                </Style>\n              </GridViewColumn.HeaderContainerStyle>\n            </GridViewColumn>\n\n            <GridViewColumn\n              Width=\"100\"\n              DisplayMemberBinding=\"{Binding Process.CommandLine}\">\n              <GridViewColumnHeader Content=\"Command line\" />\n              <GridViewColumn.HeaderContainerStyle>\n                <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                  <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                </Style>\n              </GridViewColumn.HeaderContainerStyle>\n            </GridViewColumn>\n          </GridView>\n        </ListView.View>\n\n        <ListView.ItemContainerStyle>\n          <Style\n            BasedOn=\"{StaticResource FlatListViewItem}\"\n            TargetType=\"{x:Type ListViewItem}\">\n            <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n          </Style>\n        </ListView.ItemContainerStyle>\n      </ListView>\n    </TabItem>\n  </TabControl>\n\n</local:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/ProfileReportPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Data;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic partial class ProfileReportPanel : ToolPanelControl {\n  private ProfileDataReport report_;\n  private IUISession session_;\n\n  public ProfileReportPanel(IUISession session) {\n    InitializeComponent();\n    session_ = session;\n  }\n\n  public static void ShowReportWindow(ProfileDataReport report, IUISession session,\n                                      ProfileDataReport.ModuleStatus selectedModule = null) {\n    var panel = new ProfileReportPanel(session);\n    panel.TitleSuffix = \"Profile report\";\n\n    var window = new Window();\n    window.Content = panel;\n    window.Title = \"Profile report\";\n    window.WindowStyle = WindowStyle.ToolWindow;\n    window.ResizeMode = ResizeMode.CanResizeWithGrip;\n    window.Width = 800;\n    window.Height = 650;\n    window.Owner = Application.Current.MainWindow;\n    window.WindowStartupLocation = WindowStartupLocation.CenterOwner;\n    panel.ShowReport(report, selectedModule);\n    window.Show();\n  }\n\n  public void ShowReport(ProfileDataReport report, ProfileDataReport.ModuleStatus selectedModule) {\n    report_ = report;\n    DataContext = report;\n\n    var modules = report.Modules;\n    modules.Sort((a, b) => a.ImageFileInfo.ImageName.CompareTo(b.ImageFileInfo.ImageName));\n    ModuleList.ItemsSource = new ListCollectionView(modules);\n\n    if (report.RunningProcesses != null) {\n      // Process list is already sorted by weight.\n      ProcessList.ItemsSource = new ListCollectionView(report.RunningProcesses);\n    }\n\n    if (selectedModule != null) {\n      ModuleList.SelectedItem = selectedModule;\n      ModuleList.ScrollIntoView(selectedModule);\n      TabHost.SelectedIndex = 1;\n    }\n  }\n\n  private async void LoadAllBinariesButton_Click(object sender, RoutedEventArgs e) {\n    // Find all modules with symbols loaded but binary pending lazy load\n    var modulesToLoad = report_.Modules\n      .Where(m => m.State == ModuleLoadState.LazyLoadPending && m.HasDebugInfoLoaded)\n      .ToList();\n\n    if (modulesToLoad.Count == 0) {\n      MessageBox.Show(\"No modules with pending binary loads found.\\n\\nBinaries are loaded on-demand when you view disassembly for a function.\",\n                      \"Load All Binaries\", MessageBoxButton.OK, MessageBoxImage.Information);\n      return;\n    }\n\n    var result = MessageBox.Show($\"Load binaries for {modulesToLoad.Count} modules that have symbols?\\n\\nThis may take some time if binaries need to be downloaded from symbol servers.\",\n                                  \"Load All Binaries\", MessageBoxButton.YesNo, MessageBoxImage.Question);\n    if (result != MessageBoxResult.Yes) {\n      return;\n    }\n\n    LoadAllBinariesButton.IsEnabled = false;\n    LoadAllBinariesButton.Content = \"Loading...\";\n\n    int loaded = 0;\n    int failed = 0;\n\n    // Build a set of module names to load\n    var moduleNames = new HashSet<string>(modulesToLoad.Select(m => m.ImageFileInfo.ImageName),\n                                          System.StringComparer.OrdinalIgnoreCase);\n\n    await Task.Run(async () => {\n      // Find documents by module name and trigger lazy load\n      var documents = session_.SessionState?.Documents;\n      if (documents == null) return;\n\n      foreach (var doc in documents) {\n        try {\n          string moduleName = doc.ModuleName;\n          if (moduleName != null && moduleNames.Contains(moduleName) && doc.EnsureBinaryLoaded != null) {\n            DiagnosticLogger.LogInfo($\"[LoadAllBinaries] Loading binary for {moduleName}\");\n            bool success = await doc.EnsureBinaryLoaded().ConfigureAwait(false);\n            if (success) {\n              loaded++;\n            } else {\n              failed++;\n            }\n          }\n        }\n        catch {\n          failed++;\n        }\n      }\n    });\n\n    LoadAllBinariesButton.IsEnabled = true;\n    LoadAllBinariesButton.Content = \"Load All Binaries\";\n\n    // Refresh the module list\n    var modules = report_.Modules;\n    modules.Sort((a, b) => a.ImageFileInfo.ImageName.CompareTo(b.ImageFileInfo.ImageName));\n    ModuleList.ItemsSource = new ListCollectionView(modules);\n\n    MessageBox.Show($\"Loaded {loaded} binaries, {failed} failed.\",\n                    \"Load All Binaries\", MessageBoxButton.OK, MessageBoxImage.Information);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/SearchableProfileItem.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Documents;\nusing System.Windows.Media;\nusing HtmlAgilityPack;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class SearchableProfileItem : BindableObject {\n  private string functionName_;\n  private FunctionNameFormatter funcNameFormatter_;\n  private bool isMarked_;\n  private TextBlock name_;\n\n  public SearchableProfileItem(FunctionNameFormatter funcNameFormatter) {\n    funcNameFormatter_ = funcNameFormatter;\n  }\n\n  public virtual string FunctionName {\n    get {\n      if (functionName_ != null) {\n        return functionName_; // Cached.\n      }\n\n      functionName_ = GetFunctionName();\n\n      if (funcNameFormatter_ != null && functionName_ != null) {\n        functionName_ = funcNameFormatter_(functionName_);\n      }\n\n      return functionName_;\n    }\n    set => functionName_ = value;\n  }\n\n  public virtual string ModuleName { get; set; }\n  public virtual TimeSpan Weight { get; set; }\n  public virtual TimeSpan ExclusiveWeight { get; set; }\n  public double Percentage { get; set; }\n  public double ExclusivePercentage { get; set; }\n  public TextSearchResult? SearchResult { get; set; }\n\n  public bool IsMarked {\n    get => isMarked_;\n    set {\n      SetAndNotify(ref isMarked_, value);\n      ResetCachedName();\n    }\n  }\n\n  public TextBlock Name {\n    get {\n      if (name_ == null) {\n        name_ = CreateOnDemandName();\n      }\n\n      return name_;\n    }\n  }\n\n  public void ResetCachedName() {\n    SetAndNotify(ref name_, null, \"Name\");\n  }\n\n  protected virtual string GetFunctionName() {\n    return null;\n  }\n\n  protected TextBlock CreateOnDemandName() {\n    var textBlock = new TextBlock();\n\n    if (IsMarked) {\n      textBlock.FontWeight = FontWeights.Bold;\n    }\n\n    if (ShouldPrependModule() && !string.IsNullOrEmpty(ModuleName)) {\n      textBlock.Inlines.Add(new Run(ModuleName) {\n        Foreground = Brushes.DimGray,\n        FontWeight = IsMarked ? FontWeights.Medium : FontWeights.Normal\n      });\n\n      textBlock.Inlines.Add(\"!\");\n      var nameFontWeight = IsMarked ? FontWeights.Bold : FontWeights.SemiBold;\n\n      if (SearchResult.HasValue) {\n        CreateSearchResultName(textBlock, nameFontWeight);\n      }\n      else {\n        textBlock.Inlines.Add(new Run(FunctionName) {\n          FontWeight = nameFontWeight\n        });\n      }\n    }\n    else {\n      var nameFontWeight = IsMarked ? FontWeights.Bold : FontWeights.Medium;\n\n      if (SearchResult.HasValue) {\n        CreateSearchResultName(textBlock, nameFontWeight);\n      }\n      else {\n        textBlock.Inlines.Add(new Run(FunctionName) {\n          FontWeight = nameFontWeight\n        });\n      }\n    }\n\n    return textBlock;\n  }\n\n  protected virtual bool ShouldPrependModule() {\n    return true;\n  }\n\n  private void CreateSearchResultName(TextBlock textBlock, FontWeight nameFontWeight) {\n    if (SearchResult is {Offset: > 0}) {\n      textBlock.Inlines.Add(new Run(FunctionName.Substring(0, SearchResult.Value.Offset)) {\n        FontWeight = nameFontWeight\n      });\n    }\n\n    textBlock.Inlines.Add(new Run(FunctionName.Substring(SearchResult.Value.Offset, SearchResult.Value.Length)) {\n      Background = Brushes.Khaki\n    });\n\n    int remainingLength = FunctionName.Length - (SearchResult.Value.Offset + SearchResult.Value.Length);\n\n    if (remainingLength > 0) {\n      textBlock.Inlines.Add(new Run(FunctionName.Substring(FunctionName.Length - remainingLength, remainingLength)) {\n        FontWeight = nameFontWeight\n      });\n    }\n  }\n\n  public static void CopyFunctionListAsHtml(List<SearchableProfileItem> list) {\n    string html = ExportFunctionListAsHtml(list);\n    string plainText = ProfilingExporting.ExportFunctionListAsMarkdownTable(list);\n    Utils.CopyHtmlToClipboard(html, plainText);\n  }\n\n  public static string ExportFunctionListAsHtml(List<SearchableProfileItem> list) {\n    var doc = new HtmlDocument();\n    var table = ProfilingExporting.ExportFunctionListAsHtmlTable(list, doc);\n    doc.DocumentNode.AppendChild(table);\n\n    var writer = new StringWriter();\n    doc.Save(writer);\n    return writer.ToString();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Timeline/ActivityTimelineView.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Profile.ActivityTimelineView\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Profile\">\n  <UserControl.Resources>\n    <Style\n      x:Key=\"EyeCheckbox\"\n      TargetType=\"CheckBox\">\n      <Setter Property=\"Template\">\n        <Setter.Value>\n          <ControlTemplate TargetType=\"{x:Type CheckBox}\">\n            <Image\n              x:Name=\"EyeIcon\"\n              Width=\"14\"\n              Height=\"14\"\n              HorizontalAlignment=\"Center\"\n              VerticalAlignment=\"Center\"\n              Source=\"{StaticResource EyeIcon}\" />\n\n            <ControlTemplate.Triggers>\n              <Trigger Property=\"IsChecked\" Value=\"True\">\n                <Setter TargetName=\"EyeIcon\" Property=\"Opacity\" Value=\"1\" />\n              </Trigger>\n              <Trigger Property=\"IsChecked\" Value=\"False\">\n                <Setter TargetName=\"EyeIcon\" Property=\"Opacity\" Value=\"0.3\" />\n              </Trigger>\n            </ControlTemplate.Triggers>\n          </ControlTemplate>\n        </Setter.Value>\n      </Setter>\n    </Style>\n  </UserControl.Resources>\n\n  <Border\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"0,1,0,0\">\n    <Grid\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\">\n      <Border\n        Width=\"150\"\n        Height=\"25\"\n        HorizontalAlignment=\"Left\"\n        VerticalAlignment=\"Top\"\n        BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n        BorderThickness=\"0,0,1,0\">\n        <Grid\n          x:Name=\"Margin\"\n          Background=\"{Binding MarginBackColor}\"\n          MouseDown=\"Margin_MouseDown\">\n          <CheckBox\n            Width=\"14\"\n            Height=\"14\"\n            Margin=\"4,1,0,0\"\n            Padding=\"0\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Top\"\n            IsChecked=\"{Binding IsThreadIncluded, ElementName=ActivityHost}\"\n            Style=\"{StaticResource EyeCheckbox}\"\n            ToolTip=\"Include or exclude thread activity\" />\n          <Grid\n            Width=\"18\"\n            Height=\"18\"\n            Margin=\"20,-1,0,0\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Top\"\n            PreviewMouseLeftButtonDown=\"ThreadContextMenuButton_Click\"\n            ToolTip=\"Show Thread Actions\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource BlockIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Grid>\n          <TextBlock\n            Margin=\"42,0,0,0\"\n            VerticalAlignment=\"Top\"\n            FontSize=\"11\"\n            FontWeight=\"Medium\"\n            Text=\"{Binding Path=ThreadId, ElementName=ActivityHost}\"\n            ToolTip=\"Thread number\" />\n          <TextBlock\n            Margin=\"0,0,4,0\"\n            HorizontalAlignment=\"Right\"\n            VerticalAlignment=\"Top\"\n            FontSize=\"11\"\n            Text=\"{Binding Path=ThreadWeight, ElementName=ActivityHost, Converter={StaticResource SecondTimeConverter}}\"\n            ToolTip=\"Thread weight\" />\n          <TextBlock\n            MaxWidth=\"130\"\n            Margin=\"4,13,0,0\"\n            HorizontalAlignment=\"Left\"\n            FontSize=\"10\"\n            Text=\"{Binding ThreadName, ElementName=ActivityHost, Converter={StaticResource PercentageConverter}}\"\n            TextTrimming=\"CharacterEllipsis\"\n            ToolTip=\"{Binding ThreadName, ElementName=ActivityHost, Converter={StaticResource PercentageConverter}}\" />\n        </Grid>\n      </Border>\n\n      <local:ActivityView\n        x:Name=\"ActivityHost\"\n        Height=\"25\"\n        Margin=\"150,0,0,0\"\n        VerticalAlignment=\"Top\" />\n\n      <Grid.ContextMenu>\n        <ContextMenu>\n          <MenuItem\n            Command=\"{Binding FilterToThreadCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Filter to Thread\"\n            ToolTip=\"Display activity from only this thread\">\n            <MenuItem.Icon>\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource FilterIcon}\" />\n            </MenuItem.Icon>\n          </MenuItem>\n          <MenuItem\n            Command=\"{Binding IncludeThreadCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Include Thread\" />\n          <MenuItem\n            Command=\"{Binding ExcludeThreadCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Exclude Thread\" />\n          <Separator />\n\n          <MenuItem\n            Command=\"{Binding FilterToSameNameThreadCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Filter to Same Name Threads\"\n            ToolTip=\"Display activity from only threads with the same name\" />\n          <MenuItem\n            Command=\"{Binding IncludeSameNameThreadCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Include Same Name Threads\" />\n          <MenuItem\n            Command=\"{Binding ExcludeSameNameThreadCommand}\"\n            CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n            Header=\"Exclude Same Name Threads\" />\n        </ContextMenu>\n      </Grid.ContextMenu>\n    </Grid>\n  </Border>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Timeline/ActivityTimelineView.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic enum ThreadActivityAction {\n  IncludeThread,\n  IncludeSameNameThread,\n  ExcludeThread,\n  ExcludeSameNameThread,\n  FilterToThread,\n  FilterToSameNameThread,\n  SelectThread\n}\n\npublic partial class ActivityTimelineView : UserControl, INotifyPropertyChanged {\n  private Brush disabledMarginBackColor_;\n  private Brush marginBackColor_;\n  private bool pendingClick_;\n\n  public ActivityTimelineView() {\n    InitializeComponent();\n    disabledMarginBackColor_ = Brushes.GhostWhite;\n    marginBackColor_ = Brushes.Linen;\n    DataContext = this;\n  }\n\n  public RelayCommand<object> IncludeThreadCommand =>\n    new(obj => ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.IncludeThread));\n  public RelayCommand<object> IncludeSameNameThreadCommand =>\n    new(\n      obj => ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.IncludeSameNameThread));\n  public RelayCommand<object> ExcludeThreadCommand =>\n    new(obj => ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.ExcludeThread));\n  public RelayCommand<object> ExcludeSameNameThreadCommand =>\n    new(\n      obj => ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.ExcludeSameNameThread));\n  public RelayCommand<object> FilterToThreadCommand =>\n    new(obj => ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.FilterToThread));\n  public RelayCommand<object> FilterToSameNameThreadCommand =>\n    new(\n      obj => ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.FilterToSameNameThread));\n\n  public Brush DisabledMarginBackColor {\n    get => disabledMarginBackColor_;\n    set => SetField(ref disabledMarginBackColor_, value);\n  }\n\n  public Brush MarginBackColor {\n    get => IsThreadIncluded ? marginBackColor_ : disabledMarginBackColor_;\n    set => SetField(ref marginBackColor_, value);\n  }\n\n  public bool IsThreadIncluded {\n    get => ActivityHost.IsThreadIncluded;\n    set {\n      if (ActivityHost.IsThreadIncluded != value) {\n        ActivityHost.IsThreadIncluded = value;\n        OnPropertyChanged();\n        OnPropertyChanged(nameof(MarginBackColor));\n      }\n    }\n  }\n\n  public int ThreadId => ActivityHost.ThreadId;\n  public string ThreadName => ActivityHost.ThreadName;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<ThreadActivityAction> ThreadActivityAction;\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private void Margin_MouseDown(object sender, MouseButtonEventArgs e) {\n    if (e.LeftButton == MouseButtonState.Pressed &&\n        e.ClickCount >= 2) {\n      pendingClick_ = false; // Cancel click action.\n      ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.FilterToThread);\n    }\n    else if (e.LeftButton == MouseButtonState.Pressed) {\n      // There is no way in WPF to ignore a click event if double-click happens,\n      // add some delay to the action to see that a double-click happens.\n      pendingClick_ = true;\n\n      Task.Run(async () => {\n        // Wait system double-click time interval.\n        await Task.Delay(TimeSpan.FromMilliseconds(NativeMethods.GetDoubleClickTime()));\n\n        if (pendingClick_) { // No double-click happened.\n          pendingClick_ = false;\n          Dispatcher.Invoke(() =>\n                              ThreadActivityAction?.Invoke(this, Profile.ThreadActivityAction.SelectThread));\n        }\n      });\n    }\n  }\n\n  private void ThreadContextMenuButton_Click(object sender, RoutedEventArgs e) {\n    Utils.ShowContextMenu(sender as FrameworkElement, this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Timeline/ActivityView.xaml",
    "content": "﻿<FrameworkElement\n  x:Class=\"ProfileExplorer.UI.Profile.ActivityView\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <FrameworkElement.ContextMenu>\n    <ContextMenu>\n      <MenuItem\n        Command=\"{Binding FilterTimeRangeCommand}\"\n        CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n        Header=\"Filter to Time Range\"\n        InputGestureText=\"Double-Click\"\n        ToolTip=\"Only display activity in the selected time range\"\n        Visibility=\"{Binding HasSelection, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <MenuItem.Icon>\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource FilterIcon}\" />\n        </MenuItem.Icon>\n      </MenuItem>\n      <MenuItem\n        Command=\"{Binding RemoveTimeRangeFilterCommand}\"\n        CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n        Header=\"Remove Time Range Filter\"\n        ToolTip=\"Display activity for the entire application\"\n        Visibility=\"{Binding HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <MenuItem.Icon>\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource FilterRemoveIcon}\" />\n        </MenuItem.Icon>\n      </MenuItem>\n      <MenuItem\n        Command=\"{Binding FilterTimeRangeCommand}\"\n        CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n        Header=\"Zoom In to Time Range\"\n        IsEnabled=\"False\"\n        ToolTip=\"Zoom in the activity in the selected time range\"\n        Visibility=\"{Binding HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <MenuItem.Icon>\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource ZoomInIcon}\" />\n        </MenuItem.Icon>\n      </MenuItem>\n\n      <MenuItem\n        Command=\"{Binding FilterTimeRangeCommand}\"\n        CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n        Header=\"Zoom In to Time Range\"\n        IsEnabled=\"False\"\n        Visibility=\"{Binding HasSelection, Converter={StaticResource BoolToVisibilityConverter}}\">\n        <MenuItem.Icon>\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource ZoomInIcon}\" />\n        </MenuItem.Icon>\n      </MenuItem>\n      <MenuItem\n        Command=\"{Binding ClearSelectionCommand}\"\n        CommandTarget=\"{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType=ContextMenu}}\"\n        Header=\"Clear Selection\"\n        Visibility=\"{Binding HasSelection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n    </ContextMenu>\n  </FrameworkElement.ContextMenu>\n</FrameworkElement>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Timeline/ActivityView.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Timeline;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic class MarkedSamples {\n  public MarkedSamples(int index, ProfileCallTreeNode node, List<SampleIndex> samples, HighlightingStyle style) {\n    Index = index;\n    Node = node;\n    Samples = samples;\n    Style = style;\n  }\n\n  public int Index { get; set; }\n  public ProfileCallTreeNode Node { get; set; }\n  public List<SampleIndex> Samples { get; set; }\n  public HighlightingStyle Style { get; set; }\n}\n\npublic partial class ActivityView : FrameworkElement, INotifyPropertyChanged {\n  private const double DefaultSliceWidth = 4;\n  private const double TimeBarHeight = 18;\n  private const double MinSampleHeight = 4;\n  private const double TopMarginY = 1 + TimeBarHeight;\n  private const double BottomMarginY = 0;\n  private const string DefaultFont = \"Segoe UI\";\n  private const double DefaultTextSize = 11;\n  private const double MarkerHeight = 8;\n  private bool initialized_;\n  private DrawingVisual visual_;\n  private GlyphRunCache glyphs_;\n  private ProfileData profile_;\n  private TimeSpan samplingInterval_;\n  private double sliceWidth_;\n  private double maxSampleHeight_;\n  private double maxWidth_;\n  private double maxHeight_;\n  private double prevMaxWidth_;\n  private double topMargin_;\n  private double bottomMargin_;\n  private Rect visibleArea_;\n  private List<SliceList> slices_;\n  private bool showPositionLine_;\n  private double positionLineX_;\n  private bool startedSelection_;\n  private bool hasSelection_;\n  private bool hasAllSelection_;\n  private TimeSpan selectionStartTime_;\n  private TimeSpan selectionEndTime_;\n  private TimeSpan filterStartTime_;\n  private TimeSpan filterEndTime_;\n  private bool hasFilter_;\n  private Typeface font_;\n  private double fontSize_;\n  private Brush backColor_;\n  private TimeSpan startTime_;\n  private TimeSpan endTime_;\n  private List<MarkedSamples> markedSamples_;\n  private List<SampleIndex> selectedSamples_;\n  private CancelableTaskInstance sliceTask_;\n  private bool isThreadIncluded_;\n  private Brush timeBarBackColor_;\n  private Brush filteredBackColor_;\n  private Brush filteredOutColor_;\n  private Pen filteredOutBorderColor_;\n  private Brush markerBackColor_;\n  private bool isTimeBarVisible_;\n  private Brush sampleBackColor_;\n  private Pen sampleBorderColor_;\n  private Brush selectionBackColor_;\n  private Pen selectionBorderColor_;\n  private Pen markerBorderColor_;\n  private Pen positionLinePen_;\n\n  public ActivityView() {\n    InitializeComponent();\n    filteredOutColor_ = ColorBrushes.GetTransparentBrush(Colors.WhiteSmoke, 190);\n    selectionBackColor_ = ColorBrushes.GetTransparentBrush(\"#A7D5F5\", 150); // SelectedBackgroundBrush\n    filteredBackColor_ = ColorBrushes.GetBrush(Colors.Linen);\n    selectionBorderColor_ = ColorPens.GetPen(Colors.Black);\n    markerBackColor_ = ColorBrushes.GetTransparentBrush(\"#0F92EF\", 120);\n    markerBorderColor_ = ColorPens.GetPen(Colors.DimGray);\n    positionLinePen_ = ColorPens.GetBoldPen(Colors.DarkBlue);\n    filteredOutBorderColor_ = ColorPens.GetBoldPen(Colors.Black);\n    markedSamples_ = new List<MarkedSamples>();\n    ThreadId = -1;\n    DataContext = this;\n\n    MouseLeftButtonDown += OnMouseLeftButtonDown;\n    MouseLeftButtonUp += ActivityView_MouseLeftButtonUp;\n    MouseMove += ActivityView_MouseMove;\n    MouseLeave += ActivityView_MouseLeave;\n    PreviewMouseWheel += ActivityView_PreviewMouseWheel;\n  }\n\n  public List<MarkedSamples> MarkedSamples => markedSamples_;\n  public RelayCommand<object> FilterTimeRangeCommand => new(obj => ApplyTimeRangeFilter());\n  public RelayCommand<object> ClearSelectionCommand => new(obj => ClearSelectedTimeRange());\n  public RelayCommand<object> RemoveTimeRangeFilterCommand => new(obj => RemoveTimeRangeFilter());\n  public int ThreadId { get; private set; }\n  public string ThreadName { get; set; }\n  public TimeSpan ThreadWeight => slices_ != null ? slices_[0].TotalWeight : TimeSpan.Zero;\n  public bool IsSingleThreadView => ThreadId != -1;\n  public bool HasSelection => hasSelection_;\n  public TimeSpan SelectionStartTime => selectionStartTime_;\n  public TimeSpan SelectionTime => selectionEndTime_ - selectionStartTime_;\n  public bool HasFilter => hasFilter_;\n  public TimeSpan FilteredTime => filterEndTime_ - filterStartTime_;\n  public SampleTimeRangeInfo FilteredRange => GetFilteredTimeRange();\n  public SampleTimePointInfo CurrentTimePoint => GetCurrentTimePoint();\n  public double MaxViewWidth => maxWidth_;\n  public bool PreviousIsThreadIncluded { get; set; }\n\n  public bool IsThreadIncluded {\n    get => isThreadIncluded_;\n    set {\n      if (value != isThreadIncluded_) {\n        PreviousIsThreadIncluded = isThreadIncluded_;\n        SetField(ref isThreadIncluded_, value);\n        ThreadIncludedChanged?.Invoke(this, value);\n      }\n    }\n  }\n\n  public bool HasAllTimeSelected => hasSelection_ && hasAllSelection_;\n\n  public int MaxCpuUsage {\n    get {\n      if (slices_ == null) {\n        return 0;\n      }\n\n      double maxValue = double.MinValue;\n\n      foreach (var slice in slices_[0].Slices) {\n        double sliceCpuUsage = EstimateCpuUsage(slice, slices_[0].TimePerSlice, samplingInterval_);\n        maxValue = Math.Max(sliceCpuUsage, maxValue);\n      }\n\n      return (int)Math.Ceiling(maxValue);\n    }\n  }\n\n  public Brush BackColor {\n    get => backColor_;\n    set {\n      SetField(ref backColor_, value);\n      Redraw();\n    }\n  }\n\n  public Brush TimeBarBackColor {\n    get => timeBarBackColor_;\n    set {\n      SetField(ref timeBarBackColor_, value);\n      Redraw();\n    }\n  }\n\n  public Brush FilteredBackColor {\n    get => filteredBackColor_;\n    set {\n      SetField(ref filteredBackColor_, value);\n      Redraw();\n    }\n  }\n\n  public Brush FilteredOutColor {\n    get => filteredOutColor_;\n    set {\n      SetField(ref filteredOutColor_, value);\n      Redraw();\n    }\n  }\n\n  public Pen FilteredOutBorderColor {\n    get => filteredOutBorderColor_;\n    set {\n      SetField(ref filteredOutBorderColor_, value);\n      Redraw();\n    }\n  }\n\n  public Brush MarkerBackColor {\n    get => markerBackColor_;\n    set {\n      SetField(ref markerBackColor_, value);\n      Redraw();\n    }\n  }\n\n  public bool IsTimeBarVisible {\n    get => isTimeBarVisible_;\n    set {\n      SetField(ref isTimeBarVisible_, value);\n      Redraw();\n    }\n  }\n\n  public Brush SamplesBackColor {\n    get => sampleBackColor_;\n    set {\n      SetField(ref sampleBackColor_, value);\n      Redraw();\n    }\n  }\n\n  public Pen SampleBorderColor {\n    get => sampleBorderColor_;\n    set {\n      SetField(ref sampleBorderColor_, value);\n      Redraw();\n    }\n  }\n\n  public Brush SelectionBackColor {\n    get => selectionBackColor_;\n    set {\n      SetField(ref selectionBackColor_, value);\n      Redraw();\n    }\n  }\n\n  public Pen SelectionBorderColor {\n    get => selectionBorderColor_;\n    set {\n      SetField(ref selectionBorderColor_, value);\n      Redraw();\n    }\n  }\n\n  public Pen MarkerBorderColor {\n    get => markerBorderColor_;\n    set {\n      SetField(ref markerBorderColor_, value);\n      Redraw();\n    }\n  }\n\n  public Pen PositionLinePen {\n    get => positionLinePen_;\n    set {\n      SetField(ref positionLinePen_, value);\n      Redraw();\n    }\n  }\n\n  protected override int VisualChildrenCount => 1;\n  private TimeSpan SelectionTimeDiff => selectionEndTime_ - selectionStartTime_;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler<SampleTimeRangeInfo> SelectingTimeRange;\n  public event EventHandler<SampleTimeRangeInfo> SelectedTimeRange;\n  public event EventHandler<SampleTimeRangeInfo> FilteredTimeRange;\n  public event EventHandler<bool> ThreadIncludedChanged;\n  public event EventHandler ClearedSelectedTimeRange;\n  public event EventHandler ClearedFilteredTimeRange;\n  public event EventHandler<SampleTimePointInfo> HoveringTimePoint;\n  public event EventHandler<SampleTimePointInfo> SelectedTimePoint;\n  public event EventHandler ClearedTimePoint;\n\n  public void SelectTimeRange(SampleTimeRangeInfo range) {\n    selectionStartTime_ = range.StartTime - startTime_;\n    selectionEndTime_ = range.EndTime - startTime_;\n    hasSelection_ = true;\n    startedSelection_ = false;\n    hasAllSelection_ = false;\n    UpdateSelectionState();\n  }\n\n  public void ClearSelectedTimeRange() {\n    if (hasSelection_) {\n      hasSelection_ = false;\n      hasAllSelection_ = false;\n      startedSelection_ = false;\n      UpdateSelectionState();\n    }\n  }\n\n  public Task Initialize(ProfileData profile, Rect visibleArea, int threadId = -1) {\n    if (initialized_) {\n      return Task.CompletedTask;\n    }\n\n    initialized_ = true;\n    isThreadIncluded_ = true;\n    profile_ = profile;\n    visibleArea_ = visibleArea;\n    PreviousIsThreadIncluded = true;\n    ThreadId = threadId;\n\n    var thread = profile.FindThread(threadId);\n\n    if (thread != null) {\n      ThreadName = thread.Name;\n    }\n\n    samplingInterval_ = profile_.Report.SamplingInterval;\n    maxWidth_ = prevMaxWidth_ = Math.Max(0, visibleArea.Width);\n    visual_ = new DrawingVisual();\n    visual_.Drawing?.Freeze();\n    AddVisualChild(visual_);\n    AddLogicalChild(visual_);\n\n    font_ = new Typeface(DefaultFont);\n    fontSize_ = DefaultTextSize;\n    glyphs_ = new GlyphRunCache(font_, fontSize_, VisualTreeHelper.GetDpi(visual_).PixelsPerDip);\n    return StartComputeSampleSlices(DefaultSliceWidth);\n  }\n\n  public void InitializeDone() {\n    OnPropertyChanged(nameof(ThreadWeight));\n    OnPropertyChanged(nameof(ThreadId));\n    OnPropertyChanged(nameof(ThreadName));\n    Redraw();\n  }\n\n  public void SetMaxWidth(double maxWidth) {\n    if (Math.Abs(maxWidth - maxWidth_) < double.Epsilon) {\n      return;\n    }\n\n    prevMaxWidth_ = Math.Max(0, maxWidth);\n    maxWidth_ = Math.Max(0, maxWidth);\n    Redraw();\n    InvalidateMeasure();\n  }\n\n  public void FilterTimeRange(SampleTimeRangeInfo range) {\n    filterStartTime_ = range.StartTime - startTime_;\n    filterEndTime_ = range.EndTime - startTime_;\n    hasFilter_ = true;\n    ClearSelectedTimeRange();\n    UpdateFilterState();\n  }\n\n  public void ClearTimeRangeFilter() {\n    hasFilter_ = false;\n    UpdateFilterState();\n  }\n\n  public void SelectSamples(List<SampleIndex> samples) {\n    selectedSamples_ = samples;\n    Redraw();\n  }\n\n  public void MarkSamples(ProfileCallTreeNode node, List<SampleIndex> samples, HighlightingStyle style) {\n    markedSamples_.RemoveAll(s => s.Node == node);\n    markedSamples_.Add(new MarkedSamples(markedSamples_.Count, node, samples, style));\n    Redraw();\n  }\n\n  public void RemoveMarkedSamples(ProfileCallTreeNode node) {\n    markedSamples_.RemoveAll(s => s.Node == node);\n    Redraw();\n  }\n\n  public void ClearMarkedSamples() {\n    markedSamples_.Clear();\n    Redraw();\n  }\n\n  public void ClearSelectedSamples() {\n    selectedSamples_ = null;\n    Redraw();\n  }\n\n  public void Reset() {\n    if (visual_ == null) {\n      return;\n    }\n\n    RemoveVisualChild(visual_);\n    RemoveLogicalChild(visual_);\n  }\n\n  public void SetHorizontalOffset(double offset) {\n    visibleArea_ = new Rect(offset, 0, visibleArea_.Width, visibleArea_.Height);\n    Redraw();\n  }\n\n  public void SetVisibleWidth(double width) {\n    visibleArea_ = new Rect(visibleArea_.Left, 0, width, visibleArea_.Height);\n    Redraw();\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected override Visual GetVisualChild(int index) {\n    return visual_;\n  }\n\n  protected override Size MeasureOverride(Size availableSize) {\n    if (visual_ == null) {\n      return new Size(0, 0);\n    }\n\n    return visual_.ContentBounds.Size;\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value))\n      return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private void UpdateSizes() {\n    topMargin_ = IsTimeBarVisible ? TopMarginY : 2;\n    bottomMargin_ = BottomMarginY;\n    maxSampleHeight_ = visibleArea_.Height - topMargin_;\n    maxHeight_ = Math.Max(visibleArea_.Height, TimeBarHeight);\n  }\n\n  private void UpdateSelectionState() {\n    Redraw();\n    OnPropertyChanged(nameof(HasSelection));\n    OnPropertyChanged(nameof(SelectionTime));\n\n    if (!hasSelection_) {\n      ClearedSelectedTimeRange?.Invoke(this, EventArgs.Empty);\n    }\n  }\n\n  private SampleTimePointInfo GetSelectedTimePoint() {\n    return new SampleTimePointInfo(selectionStartTime_ + startTime_,\n                                   TimeToSampleIndex(selectionStartTime_), ThreadId);\n  }\n\n  private SampleTimePointInfo GetCurrentTimePoint() {\n    var time = PositionToTime(positionLineX_);\n    return new SampleTimePointInfo(time + startTime_,\n                                   TimeToSampleIndex(time), ThreadId);\n  }\n\n  private SampleTimeRangeInfo GetSelectedTimeRange() {\n    (int startIndex, int endIndex) = TimeRangeToSampleIndex(selectionStartTime_, selectionEndTime_);\n    return new SampleTimeRangeInfo(selectionStartTime_ + startTime_, selectionEndTime_ + startTime_,\n                                   startIndex, endIndex, ThreadId);\n  }\n\n  private SampleTimeRangeInfo GetFilteredTimeRange() {\n    (int startIndex, int endIndex) = TimeRangeToSampleIndex(filterStartTime_, filterEndTime_);\n    return new SampleTimeRangeInfo(filterStartTime_ + startTime_, filterEndTime_ + startTime_,\n                                   startIndex, endIndex, ThreadId);\n  }\n\n  private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    var time = PositionToTime(e.GetPosition(this).X);\n\n    if (hasSelection_) {\n      if (time >= selectionStartTime_ && time <= selectionEndTime_) {\n        if (e.ClickCount > 1) { // Check for double-click.\n          ApplyTimeRangeFilter();\n        }\n\n        return;\n      }\n\n      // Deselect with click outside the selection.\n      hasSelection_ = false;\n      UpdateSelectionState();\n    }\n\n    if (hasFilter_) {\n      if (time < filterStartTime_ || time > filterEndTime_) {\n        if (e.ClickCount > 1) { // Check for double-click.\n          RemoveTimeRangeFilter();\n        }\n      }\n    }\n\n    ClearedTimePoint?.Invoke(this, EventArgs.Empty);\n    startedSelection_ = true;\n    hasAllSelection_ = false;\n    selectionStartTime_ = time;\n    selectionEndTime_ = selectionStartTime_;\n    e.Handled = true;\n    CaptureMouse();\n    Redraw();\n  }\n\n  private void ActivityView_PreviewMouseWheel(object sender, MouseWheelEventArgs e) {\n    // Cancel any selection action.\n    startedSelection_ = false;\n    ReleaseMouseCapture();\n  }\n\n  private void RemoveTimeRangeFilter() {\n    ClearTimeRangeFilter();\n    ClearedFilteredTimeRange?.Invoke(this, EventArgs.Empty);\n  }\n\n  private void ApplyTimeRangeFilter() {\n    var range = GetSelectedTimeRange();\n    FilterTimeRange(range);\n    FilteredTimeRange?.Invoke(this, range);\n  }\n\n  private void ActivityView_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) {\n    if (startedSelection_) {\n      startedSelection_ = false;\n      selectionEndTime_ = PositionToTime(e.GetPosition(this).X);\n\n      // If selection is done moving to the left, end time becomes start time.\n      if (selectionEndTime_ < selectionStartTime_) {\n        (selectionStartTime_, selectionEndTime_) = (selectionEndTime_, selectionStartTime_);\n      }\n\n      hasSelection_ = SelectionTimeDiff.Ticks > 0;\n      showPositionLine_ = false;\n      ReleaseMouseCapture();\n      UpdateSelectionState();\n\n      if (hasSelection_) {\n        SelectedTimeRange?.Invoke(this, GetSelectedTimeRange());\n      }\n    }\n    else {\n      SelectedTimePoint?.Invoke(this, GetSelectedTimePoint());\n    }\n\n    e.Handled = true;\n  }\n\n  public void SelectAllTime() {\n    SelectTimeRange(new SampleTimeRangeInfo(startTime_, endTime_, 0, 0, 0));\n    hasAllSelection_ = true;\n    SelectedTimeRange?.Invoke(this, GetSelectedTimeRange());\n  }\n\n  private void ActivityView_MouseLeave(object sender, MouseEventArgs e) {\n    if (showPositionLine_) {\n      showPositionLine_ = false;\n      Redraw();\n    }\n  }\n\n  private void ActivityView_MouseMove(object sender, MouseEventArgs e) {\n    if (startedSelection_) {\n      selectionEndTime_ = PositionToTime(e.GetPosition(this).X);\n      Redraw();\n\n      SelectingTimeRange?.Invoke(this, GetSelectedTimeRange());\n    }\n    else {\n      showPositionLine_ = true;\n      positionLineX_ = e.GetPosition(this).X;\n      Redraw();\n\n      HoveringTimePoint?.Invoke(this, GetCurrentTimePoint());\n    }\n  }\n\n  private List<SliceList> ComputeSampleSlices(ProfileData profile, int threadId = -1) {\n    if (profile.Samples.Count == 0 || maxWidth_ < double.Epsilon) {\n      return new List<SliceList>();\n    }\n\n    startTime_ = profile.Samples[0].Sample.Time;\n    endTime_ = profile.Samples[^1].Sample.Time;\n    double slices = (maxWidth_ / sliceWidth_) * (prevMaxWidth_ / maxWidth_);\n\n    var timeDiff = endTime_ - startTime_;\n    double timePerSlice = timeDiff.Ticks / slices;\n    double timePerSliceReciproc = 1.0 / timePerSlice;\n    var sliceSeriesDict = new Dictionary<int, SliceList>();\n\n    int sampleIndex = 0;\n    int prevSliceIndex = -1;\n    SliceList prevSliceList = null;\n    var currentSlice = new Slice(TimeSpan.Zero, -1, 0);\n    var dummySlice = new Slice(TimeSpan.Zero, -1, 0);\n\n    var ranges = profile.ThreadSampleRanges.Ranges[threadId];\n    var sampleSpan = CollectionsMarshal.AsSpan(profile.Samples);\n\n    foreach (var range in ranges) {\n      sampleIndex = range.StartIndex;\n\n      for (int k = range.StartIndex; k < range.EndIndex; k++) {\n        // if (threadId != -1 && stack.Context.ThreadId != threadId) {\n        //   sampleIndex++;\n        //   continue;\n        // }\n\n        ref var sample = ref sampleSpan[k].Sample;\n        int sliceIndex = (int)((sample.Time - startTime_).Ticks * timePerSliceReciproc);\n\n        //int queryThreadId = stack.Context.ThreadId;\n        int queryThreadId = 0;\n\n        if (sliceIndex != prevSliceIndex) {\n          if (currentSlice.FirstSampleIndex != -1 && prevSliceList != null) {\n            prevSliceList.Slices.Add(currentSlice);\n            prevSliceList.TotalWeight += currentSlice.Weight;\n            prevSliceList.MaxWeight = TimeSpan.FromTicks(Math.Max(prevSliceList.MaxWeight.Ticks,\n                                                                  currentSlice.Weight.Ticks));\n          }\n\n          if (!sliceSeriesDict.TryGetValue(queryThreadId, out var sliceList)) {\n            sliceList = new SliceList(queryThreadId, (int)Math.Ceiling(slices)) {\n              TimePerSlice = TimeSpan.FromTicks((long)timePerSlice),\n              MaxSlices = (int)slices\n            };\n\n            sliceSeriesDict[queryThreadId] = sliceList;\n          }\n\n          prevSliceIndex = sliceIndex;\n          prevSliceList = sliceList;\n\n          if (sliceIndex >= sliceList.Slices.Count) {\n            for (int i = sliceList.Slices.Count; i < sliceIndex; i++) {\n              sliceList.Slices.Add(dummySlice);\n            }\n          }\n\n          currentSlice = new Slice(TimeSpan.Zero, sampleIndex, 0);\n        }\n\n        currentSlice.Weight += sample.Weight;\n        currentSlice.SampleCount++;\n        sampleIndex++;\n      }\n    }\n\n    if (currentSlice.FirstSampleIndex != -1 && prevSliceList != null) {\n      prevSliceList.Slices.Add(currentSlice);\n      prevSliceList.TotalWeight += currentSlice.Weight;\n      prevSliceList.MaxWeight = TimeSpan.FromTicks(Math.Max(prevSliceList.MaxWeight.Ticks,\n                                                            currentSlice.Weight.Ticks));\n    }\n\n    if (sliceSeriesDict.Count == 0) {\n      // Other code assumes there is at least one slice list, make a dummy one.\n      return new List<SliceList> {new(threadId)};\n    }\n\n    return sliceSeriesDict.ToValueList();\n  }\n\n  private void UpdateFilterState() {\n    Redraw();\n    OnPropertyChanged(nameof(HasFilter));\n    OnPropertyChanged(nameof(FilteredTime));\n  }\n\n  private void Redraw() {\n    if (!initialized_ || visibleArea_.Width <= 0) {\n      return;\n    }\n\n    UpdateSizes();\n\n    // Wait for sample slices to be computed.\n    if (sliceTask_ != null) {\n      sliceTask_.WaitForTask();\n    }\n\n    if (slices_ == null || slices_.Count == 0) {\n      return;\n    }\n\n    // Recompute the slices if zooming in/out, this will increase/reduces their number.\n    //? TODO: This check is needed only when maxWidth_ changes.\n    foreach (var list in slices_) {\n      double scaledSliceWidth = maxWidth_ / list.MaxSlices;\n\n      if (scaledSliceWidth > sliceWidth_ * 1.5) {\n        double newWidth = Math.Min(DefaultSliceWidth,\n                                   Math.Max(0.2, DefaultSliceWidth * (DefaultSliceWidth / scaledSliceWidth)));\n        StartComputeSampleSlices(newWidth);\n        return;\n      }\n\n      if (scaledSliceWidth < sliceWidth_ * 0.75) {\n        double newWidth = Math.Min(DefaultSliceWidth,\n                                   Math.Max(0.2, DefaultSliceWidth * (DefaultSliceWidth / scaledSliceWidth)));\n        StartComputeSampleSlices(newWidth);\n        return;\n      }\n    }\n\n    // Start redrawing the visible part of the activity view.\n    using var graphDC = visual_.RenderOpen();\n    var area = new Rect(0, 0, visibleArea_.Width, visibleArea_.Height);\n    graphDC.DrawRectangle(backColor_, null, area);\n\n    if (hasFilter_) {\n      DrawTimeRangeFilter(graphDC);\n    }\n\n    foreach (var list in slices_) {\n      double scaledSliceWidth = maxWidth_ / list.MaxSlices;\n      int startSlice = (int)(visibleArea_.Left / scaledSliceWidth);\n      int endSlice = Math.Min((int)(visibleArea_.Right / scaledSliceWidth), list.Slices.Count);\n\n      for (int i = startSlice; i < endSlice; i++) {\n        var weight = list.Slices[i].Weight;\n        double height = weight.Ticks / (double)list.MaxWeight.Ticks * maxSampleHeight_;\n\n        if (height < double.Epsilon) {\n          continue;\n        }\n\n        // Mark the slice that's under the mouse cursor.\n        var backColor = sampleBackColor_;\n        var borderColor = sampleBorderColor_;\n\n        if (showPositionLine_ && !startedSelection_) {\n          if (positionLineX_ + visibleArea_.Left > i * scaledSliceWidth &&\n              positionLineX_ + visibleArea_.Left < (i + 1) * scaledSliceWidth) {\n            var newColor = ColorUtils.AdjustLight(((SolidColorBrush)sampleBackColor_).Color, 0.75f);\n            backColor = ColorBrushes.GetBrush(newColor);\n          }\n        }\n\n        height = Math.Max(height, MinSampleHeight);\n        var rect = new Rect(i * scaledSliceWidth - visibleArea_.Left,\n                            maxSampleHeight_ - height + topMargin_,\n                            scaledSliceWidth, height);\n        graphDC.DrawRectangle(backColor, borderColor, rect);\n      }\n    }\n\n    foreach (var samples in markedSamples_) {\n      DrawMarkedSamples(samples, graphDC);\n    }\n\n    // Draw selected samples on top of marked samples.\n    if (selectedSamples_ != null) {\n      DrawSelectedSamples(selectedSamples_, graphDC);\n    }\n\n    if (IsTimeBarVisible) {\n      DrawTimeBar(graphDC);\n    }\n\n    // Draw filter overlays and selection.\n    if (hasFilter_ || !isThreadIncluded_) {\n      DrawExcludedTimeRangeFilter(graphDC);\n    }\n\n    if (startedSelection_ || hasSelection_) {\n      DrawSelection(graphDC);\n    }\n\n    if (showPositionLine_ && !startedSelection_) {\n      DrawPositionLine(graphDC);\n    }\n  }\n\n  private void DrawTimeRangeFilter(DrawingContext graphDC) {\n    double startX = TimeToPosition(filterStartTime_);\n    double endX = TimeToPosition(filterEndTime_);\n\n    if (startX > visibleArea_.Width) {\n      return;\n    }\n\n    startX = Math.Max(0, startX);\n    endX = Math.Min(endX, visibleArea_.Width);\n    double width = Math.Max(1, endX - startX);\n    var rect = new Rect(startX, 0, width, maxHeight_);\n    graphDC.DrawRectangle(filteredBackColor_, null, rect);\n  }\n\n  private void DrawPositionLine(DrawingContext graphDC) {\n    var lineStart = new Point(positionLineX_, 0);\n    var lineEnd = new Point(positionLineX_, maxHeight_);\n    graphDC.DrawLine(positionLinePen_, lineStart, lineEnd);\n\n    var time = PositionToTime(positionLineX_);\n    double textY = topMargin_ + 2;\n    string text = \"\";\n    var slice = TimeToSlice(time);\n    var timeDiff = endTime_ - startTime_;\n\n    if (slice.HasValue) {\n      double cpuUsage = EstimateCpuUsage(slice.Value, slices_[0].TimePerSlice, samplingInterval_);\n      text += $\"{time.AsTimeStringWithMilliseconds(timeDiff)} ms ({cpuUsage:F2} cores)\";\n    }\n    else {\n      text = time.AsTimeStringWithMilliseconds(timeDiff);\n    }\n\n    DrawText(text, positionLineX_, textY, Brushes.Black, graphDC, true, backColor_, sampleBorderColor_,\n             HorizontalAlignment.Center, VerticalAlignment.Center);\n\n    var markedSamples = FindMarkedSamples(time);\n\n    if (markedSamples != null) {\n      string markedText = markedSamples.Node.FunctionName;\n      DrawText(markedText, positionLineX_, topMargin_, Brushes.Black, graphDC, true, backColor_, sampleBorderColor_,\n               HorizontalAlignment.Center, VerticalAlignment.Center);\n    }\n  }\n\n  private MarkedSamples FindMarkedSamples(TimeSpan time) {\n    var closeTimeDiff = TimeSpan.FromMilliseconds(1);\n    var querySample = new SampleIndex(0, time);\n\n    foreach (var markedSamples in markedSamples_) {\n      int index = markedSamples.Samples.BinarySearch(querySample,\n                                                     Comparer<SampleIndex>.Create((a, b) => {\n                                                       var timeDiff = a.Time - startTime_ - b.Time;\n\n                                                       if (timeDiff > closeTimeDiff) {\n                                                         return 1;\n                                                       }\n\n                                                       if (timeDiff < -closeTimeDiff) {\n                                                         return -1;\n                                                       }\n\n                                                       return 0;\n                                                     }));\n\n      if (index >= 0) {\n        return markedSamples;\n      }\n    }\n\n    return null;\n  }\n\n  private void DrawSelection(DrawingContext graphDC) {\n    double startX = TimeToPosition(selectionStartTime_);\n    double endX = TimeToPosition(selectionEndTime_);\n\n    if (endX < startX) {\n      // Right-to-left mouse selection, ensure start < end.\n      (startX, endX) = (endX, startX);\n    }\n\n    if (startX > visibleArea_.Width) {\n      return;\n    }\n\n    double selectionWidth = Math.Max(1, endX - startX);\n    double selectionHeight = maxHeight_;\n    var rect = new Rect(startX, 0, selectionWidth, selectionHeight);\n    graphDC.DrawRectangle(selectionBackColor_, selectionBorderColor_, rect);\n\n    if (startedSelection_) {\n      var time = TimeSpan.FromTicks(Math.Abs((selectionEndTime_ - selectionStartTime_).Ticks));\n      double textX = startX + selectionWidth / 2;\n      double textY = topMargin_ + 2;\n\n      var timeDiff = endTime_ - startTime_;\n      string text = time.AsTimeStringWithMilliseconds(timeDiff);\n      DrawText(text, textX, textY, Brushes.Black, graphDC, true, backColor_, sampleBorderColor_,\n               HorizontalAlignment.Center, VerticalAlignment.Center);\n    }\n  }\n\n  private void DrawExcludedTimeRangeFilter(DrawingContext graphDC) {\n    if (isThreadIncluded_) {\n      double startX = TimeToPosition(filterStartTime_);\n      double endX = TimeToPosition(filterEndTime_);\n\n      if (startX > 0) {\n        var beforeRect = new Rect(0, 0, startX, maxHeight_);\n        graphDC.DrawRectangle(filteredOutColor_, null, beforeRect);\n        graphDC.DrawLine(filteredOutBorderColor_, new Point(startX, 0), new Point(startX, maxHeight_));\n      }\n\n      if (endX < visibleArea_.Width) {\n        var afterRect = new Rect(endX, 0, visibleArea_.Width - endX, maxHeight_);\n        graphDC.DrawRectangle(filteredOutColor_, null, afterRect);\n        graphDC.DrawLine(filteredOutBorderColor_, new Point(endX, 0), new Point(endX, maxHeight_));\n      }\n    }\n    else {\n      var region = new Rect(0, 0, visibleArea_.Width, visibleArea_.Height);\n      graphDC.DrawRectangle(filteredOutColor_, null, region);\n    }\n  }\n\n  private void DrawSelectedSamples(List<SampleIndex> samples, DrawingContext graphDC) {\n    double y = visibleArea_.Height - MarkerHeight;\n    DrawMarkedSamplesImpl(samples, markerBackColor_, null, topMargin_, maxSampleHeight_, graphDC);\n  }\n\n  private void DrawMarkedSamples(MarkedSamples samples, DrawingContext graphDC) {\n    double y = visibleArea_.Height - MarkerHeight;\n    y = Math.Max(0, y - samples.Index * (MarkerHeight / 2));\n    DrawMarkedSamplesImpl(samples.Samples, samples.Style.BackColor, sampleBorderColor_, y, MarkerHeight, graphDC);\n  }\n\n  private void DrawMarkedSamplesImpl(List<SampleIndex> samples, Brush backColor, Pen borderColor,\n                                     double y, double height, DrawingContext graphDC) {\n    double startX = double.MaxValue;\n    double endX = double.MaxValue;\n    bool first = true;\n\n    foreach (ref var sample in CollectionsMarshal.AsSpan(samples)) {\n      double x = TimeToPosition(sample.Time - startTime_);\n\n      if (x < 0)\n        continue;\n      if (x >= visibleArea_.Width)\n        break;\n\n      if (x - endX > 1) {\n        double width = Math.Max(2, Math.Ceiling(endX - startX));\n        var rect = new Rect(startX, y, width, height);\n        graphDC.DrawRectangle(backColor, borderColor, rect);\n        startX = x;\n        endX = x;\n      }\n      else if (first) {\n        startX = x;\n        endX = x;\n        first = false;\n      }\n      else {\n        endX = x;\n      }\n    }\n\n    if (endX - startX > 1) {\n      var rect = new Rect(startX, y, endX - startX, height);\n      graphDC.DrawRectangle(backColor, borderColor, rect);\n    }\n  }\n\n  private Task StartComputeSampleSlices(double newWidth) {\n    sliceTask_ ??= new CancelableTaskInstance();\n    sliceTask_.CreateTask();\n\n    return Task.Run(() => {\n      sliceTask_.CancelTaskAndWait();\n      sliceWidth_ = newWidth;\n      slices_ = ComputeSampleSlices(profile_, ThreadId);\n      sliceTask_.CompleteTask();\n\n      // Update UI.\n      Dispatcher.BeginInvoke(() => {\n        Redraw();\n        OnPropertyChanged(nameof(MaxCpuUsage));\n      });\n    });\n  }\n\n  private void DrawTimeBar(DrawingContext graphDC) {\n    const double MinTickDistance = 60;\n    const double MinSecondTickDistance = 40;\n    const double TextMarginY = 7;\n    var secTextColor = Brushes.Black;\n    var msTextColor = Brushes.DimGray;\n\n    var bar = new Rect(0, visibleArea_.Top,\n                       visibleArea_.Width, TimeBarHeight);\n    graphDC.DrawRectangle(timeBarBackColor_, null, bar);\n\n    // Decide how many major (per second) ticks to use for the entire time range.\n    var timeDiff = endTime_ - startTime_;\n    double maxTicks = maxWidth_ / MinSecondTickDistance;\n    double tickCount = Math.Ceiling(Math.Min(maxTicks, timeDiff.TotalSeconds));\n    double secondsPerTick = timeDiff.TotalSeconds / tickCount;\n\n    // Recompute the tick count and duration after rounding up\n    // to ensure each tick corresponds to an integer number of seconds.\n    tickCount = timeDiff.TotalSeconds / Math.Round(secondsPerTick);\n    secondsPerTick = timeDiff.TotalSeconds / tickCount;\n    double secondsTickDist = maxWidth_ / tickCount;\n\n    // Adjust start position to the nearest multiple of the tick time.\n    double startX = visibleArea_.Left;\n    double endX = Math.Min(visibleArea_.Right, maxWidth_);\n    double currentSec = Math.Floor(startX / secondsTickDist) * secondsPerTick;\n    startX = currentSec * secondsTickDist / secondsPerTick;\n\n    for (double x = startX; x < endX; x += secondsTickDist) {\n      var tickRect = new Rect(x - visibleArea_.Left, visibleArea_.Top, 3, 4);\n      graphDC.DrawRectangle(Brushes.Black, null, tickRect);\n      DrawText(TimeSpan.FromSeconds(currentSec).AsTimeString(timeDiff),\n               tickRect.Left, tickRect.Top + TextMarginY, secTextColor, graphDC, false);\n\n      int subTicks = (int)(secondsTickDist / MinTickDistance);\n      if (subTicks > 1 && subTicks % 2 == 0)\n        subTicks--;\n\n      double subTickDist = secondsTickDist / (subTicks + 1);\n      double timePerSubTick = secondsPerTick * 1000.0 / (subTicks + 1);\n      double msEndX = Math.Min(secondsTickDist - subTickDist, endX);\n      double currentMs = timePerSubTick;\n\n      for (double y = subTickDist; y <= msEndX; y += subTickDist) {\n        var msTickRect = new Rect(x + y - visibleArea_.Left, visibleArea_.Top, 2, 3);\n        graphDC.DrawRectangle(Brushes.DimGray, null, msTickRect);\n        double time = currentSec + currentMs / 1000;\n\n        if (subTicks == 1) {\n          DrawText($\"{time:0.0}\", msTickRect.Left, msTickRect.Top + TextMarginY, msTextColor, graphDC, false);\n        }\n        else if (subTicks <= 10) {\n          DrawText($\"{time:0.00}\", msTickRect.Left, msTickRect.Top + TextMarginY, msTextColor, graphDC, false);\n        }\n        else if (subTicks <= 100) {\n          DrawText($\"{time:0.000}\", msTickRect.Left, msTickRect.Top + TextMarginY, msTextColor, graphDC, false);\n        }\n        else {\n          int digits = (int)Math.Ceiling(Math.Log10(subTicks));\n          string timeStr = string.Format(\"{0:0.\" + new string('0', digits + 1) + \"}\", time);\n          DrawText(timeStr, msTickRect.Left, msTickRect.Top + TextMarginY, msTextColor, graphDC, false);\n        }\n\n        currentMs += timePerSubTick;\n      }\n\n      currentSec += secondsPerTick;\n    }\n  }\n\n  private void DrawText(string text, double x, double y, Brush color, DrawingContext dc,\n                        bool keepInView = true,\n                        Brush backColor = null, Pen borderColor = null,\n                        HorizontalAlignment horizontalAlign = HorizontalAlignment.Center,\n                        VerticalAlignment verticalAlign = VerticalAlignment.Top) {\n    if (visibleArea_.Width <= 0) {\n      return;\n    }\n\n    var glyphInfo = glyphs_.GetGlyphs(text);\n    var textMargin = new Thickness(2, 4, 4, 0);\n\n    if (horizontalAlign == HorizontalAlignment.Center) {\n      x = x - glyphInfo.TextWidth / 2;\n    }\n\n    if (verticalAlign == VerticalAlignment.Center) {\n      y = y + maxSampleHeight_ / 2 - glyphInfo.TextHeight / 2;\n    }\n\n    //? TODO: Extra check for this situation that seems to happen\n    //? on some machine but couldn't be reproduced...\n    if (textMargin.Left >= visibleArea_.Width - glyphInfo.TextWidth) {\n      return;\n    }\n\n    if (keepInView) {\n      x = Math.Clamp(x, textMargin.Left, visibleArea_.Width - glyphInfo.TextWidth);\n    }\n\n    if (backColor != null) {\n      double boxWidth = glyphInfo.TextWidth + textMargin.Right;\n      double boxHeight = glyphInfo.TextHeight + textMargin.Bottom;\n\n      var textRect = new Rect(x - textMargin.Left, y - textMargin.Top,\n                              boxWidth, boxHeight);\n      dc.DrawRectangle(backColor, borderColor, textRect);\n    }\n\n    y = y + glyphInfo.TextHeight / 2;\n    dc.PushTransform(new TranslateTransform(x, y));\n    dc.DrawGlyphRun(color, glyphInfo.Glyphs);\n    dc.Pop();\n  }\n\n  private TimeSpan PositionToTime(double positionX) {\n    positionX = Math.Max(0, positionX);\n    var timeDiff = endTime_ - startTime_;\n    long ticks = (long)((visibleArea_.Left + positionX) / maxWidth_ * timeDiff.Ticks);\n    return TimeSpan.FromTicks(ticks);\n  }\n\n  private double TimeToPosition(TimeSpan time) {\n    var timeDiff = endTime_ - startTime_;\n    return time.Ticks / (double)timeDiff.Ticks * maxWidth_ - visibleArea_.Left;\n  }\n\n  private int TimeToSampleIndex(TimeSpan time) {\n    // Search for a nearby sample in both directions.\n    var searchRange = TimeSpan.FromMilliseconds(10);\n    int index = TimeToSampleIndex(time, searchRange);\n\n    if (index > 0) {\n      return index;\n    }\n\n    return TimeToSampleIndexBack(time, searchRange);\n  }\n\n  private Slice? TimeToSlice(TimeSpan time) {\n    long ticks = slices_[0].TimePerSlice.Ticks;\n    if (ticks == 0) return null;\n\n    int sliceIndex = (int)(time.Ticks / ticks);\n\n    if (sliceIndex >= slices_[0].Slices.Count) {\n      return null;\n    }\n\n    return slices_[0].Slices[sliceIndex];\n  }\n\n  private (int, int) TimeRangeToSampleIndex(TimeSpan startTime, TimeSpan endTime) {\n    var timeRange = endTime - startTime;\n    int startIndex = TimeToSampleIndex(startTime, timeRange);\n    int endIndex = TimeToSampleIndexBack(endTime, timeRange);\n\n    if (startIndex > endIndex) {\n      (startIndex, endIndex) = (endIndex, startIndex);\n    }\n\n    return (startIndex, endIndex);\n  }\n\n  private int TimeToSampleIndex(TimeSpan time, TimeSpan timeRange) {\n    var queryTime = time + startTime_;\n    int sliceIndex = (int)(time.Ticks / slices_[0].TimePerSlice.Ticks);\n    timeRange += startTime_;\n\n    for (int i = sliceIndex; i < slices_[0].Slices.Count; i++) {\n      var slice = slices_[0].Slices[i];\n\n      if (slice.FirstSampleIndex >= 0) {\n        for (int sampleIndex = slice.FirstSampleIndex;\n             sampleIndex < slice.FirstSampleIndex + slice.SampleCount; sampleIndex++) {\n          if (profile_.Samples[sampleIndex].Sample.Time >= queryTime) {\n            if (!IsSingleThreadView || profile_.Samples[sampleIndex].Stack.Context.ThreadId == ThreadId) {\n              return sampleIndex;\n            }\n          }\n        }\n      }\n\n      if ((i + 1) * slices_[0].TimePerSlice > timeRange) {\n        break; // Early stop.\n      }\n    }\n\n    return 0;\n  }\n\n  private int TimeToSampleIndexBack(TimeSpan time, TimeSpan timeRange) {\n    var queryTime = time + startTime_;\n    int sliceIndex = (int)(time.Ticks / slices_[0].TimePerSlice.Ticks);\n    sliceIndex = Math.Min(sliceIndex, slices_[0].Slices.Count - 1);\n    timeRange += startTime_;\n\n    for (int i = sliceIndex; i >= 0; i--) {\n      var slice = slices_[0].Slices[i];\n\n      if (slice.FirstSampleIndex >= 0) {\n        for (int sampleIndex = slice.FirstSampleIndex + slice.SampleCount - 1; sampleIndex >= slice.FirstSampleIndex;\n             sampleIndex--) {\n          if (profile_.Samples[sampleIndex].Sample.Time <= queryTime) {\n            if (!IsSingleThreadView || profile_.Samples[sampleIndex].Stack.Context.ThreadId == ThreadId) {\n              return sampleIndex;\n            }\n          }\n        }\n      }\n\n      if ((sliceIndex - i + 1) * slices_[0].TimePerSlice > timeRange) {\n        break; // Early stop.\n      }\n    }\n\n    return 0;\n  }\n\n  private double EstimateCpuUsage(Slice slice, TimeSpan timePerSlice, TimeSpan samplingInterval) {\n    if (samplingInterval == TimeSpan.Zero) {\n      return 0;\n    }\n\n    double samples100Percent = timePerSlice / samplingInterval;\n    double usage = slice.SampleCount / samples100Percent;\n    return usage;\n  }\n\n  public struct Slice {\n    public TimeSpan Weight;\n    public int FirstSampleIndex;\n    public int SampleCount;\n\n    public Slice(TimeSpan weight, int firstSampleIndex, int sampleCount) {\n      Weight = weight;\n      FirstSampleIndex = firstSampleIndex;\n      SampleCount = sampleCount;\n    }\n  }\n\n  public class SliceList {\n    public SliceList(int threadId, int slices = 0) {\n      ThreadId = threadId;\n      Slices = new List<Slice>(slices);\n      MaxWeight = TimeSpan.MinValue;\n    }\n\n    public int ThreadId { get; set; }\n    public TimeSpan TotalWeight { get; set; }\n    public TimeSpan MaxWeight { get; set; }\n    public TimeSpan TimePerSlice { get; set; }\n    public List<Slice> Slices { get; set; }\n    public int MaxSlices { get; set; }\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Timeline/TImelinePanel.xaml",
    "content": "﻿<ProfileExplorerUi:ToolPanelControl\n  x:Class=\"ProfileExplorer.UI.Profile.TimelinePanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:ProfileExplorerUi=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n  <ProfileExplorerUi:ToolPanelControl.CommandBindings>\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n      Executed=\"ExecuteGraphResetWidth\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomIn\"\n      Executed=\"ExecuteGraphZoomIn\" />\n    <CommandBinding\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomOut\"\n      Executed=\"ExecuteGraphZoomOut\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.RemoveFilters\"\n      Executed=\"RemoveFiltersExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.RemoveThreadFilters\"\n      Executed=\"RemoveThreadFiltersExecuted\" />\n    <CommandBinding\n      Command=\"local:CallTreeCommand.RemoveAllFilters\"\n      Executed=\"RemoveAllFiltersExecuted\" />\n  </ProfileExplorerUi:ToolPanelControl.CommandBindings>\n\n  <ProfileExplorerUi:ToolPanelControl.InputBindings>\n    <KeyBinding\n      Key=\"R\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n      CommandTarget=\"{Binding ElementName=ActivityView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"D0\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n      CommandTarget=\"{Binding ElementName=ActivityView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"OemPlus\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomIn\"\n      CommandTarget=\"{Binding ElementName=ActivityView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Add\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomIn\"\n      CommandTarget=\"{Binding ElementName=ActivityView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"OemMinus\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomOut\"\n      CommandTarget=\"{Binding ElementName=ActivityView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"Subtract\"\n      Command=\"ProfileExplorerUi:GraphCommand.GraphZoomOut\"\n      CommandTarget=\"{Binding ElementName=ActivityView}\"\n      Modifiers=\"Ctrl\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:CallTreeCommand.PreviousSearchResult\"\n      Modifiers=\"Shift\" />\n    <KeyBinding\n      Key=\"F3\"\n      Command=\"local:CallTreeCommand.NextSearchResult\" />\n  </ProfileExplorerUi:ToolPanelControl.InputBindings>\n\n  <Grid IsEnabled=\"{Binding HasCallTree}\">\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"28\" />\n      <RowDefinition Height=\"*\" />\n    </Grid.RowDefinitions>\n\n    <Grid\n      x:Name=\"ToolbarHost\"\n      Grid.Row=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"45\" />\n      </Grid.ColumnDefinitions>\n      <ToolBarTray\n        Grid.Column=\"0\"\n        Height=\"28\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Top\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        DockPanel.Dock=\"Left\"\n        IsLocked=\"True\">\n        <ToolBar\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Top\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          Loaded=\"ToolBar_Loaded\">\n          <Button\n            Margin=\"4,0,0,0\"\n            Click=\"UndoButton_Click\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            IsEnabled=\"False\"\n            ToolTip=\"Not yet implemented\"\n            Visibility=\"Collapsed\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource DockLeftIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Back\" />\n            </StackPanel>\n          </Button>\n\n          <Separator Visibility=\"Collapsed\" />\n          <Button\n            Command=\"ProfileExplorerUi:GraphCommand.GraphResetWidth\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            ToolTip=\"Zoom the timeline view to 100% (Ctrl+R/Ctrl+0)\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Source=\"{StaticResource ResetWidthIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"4,0,0,0\"\n                Text=\"Reset\" />\n            </StackPanel>\n          </Button>\n          <Button\n            Command=\"ProfileExplorerUi:GraphCommand.GraphZoomOut\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            ToolTip=\"Zoom Out (Ctrl+_\">\n            <Image\n              Width=\"15\"\n              Height=\"15\"\n              Source=\"{StaticResource ZoomOutIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n          <Button\n            Command=\"ProfileExplorerUi:GraphCommand.GraphZoomIn\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            ToolTip=\"Zoom In (Ctrl+=)\">\n            <Image\n              Width=\"15\"\n              Height=\"15\"\n              Source=\"{StaticResource ZoomInIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Separator />\n\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsChecked=\"{Binding Path=Settings.SyncSelection, Mode=TwoWay}\"\n            ToolTip=\"Sync function displayed in other profiling views with selection\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource SwitchIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"2,0,0,0\"\n                Text=\"Sync\" />\n            </StackPanel>\n          </ToggleButton>\n\n          <ToggleButton\n            Height=\"20\"\n            Margin=\"0,0,0,0\"\n            Padding=\"0,0,2,0\"\n            IsEnabled=\"False\"\n            ToolTip=\"Group threads by name\"\n            Visibility=\"Collapsed\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"0,1,0,0\"\n                Source=\"{StaticResource GroupIcon}\"\n                Style=\"{StaticResource DisabledImageStyle}\" />\n              <TextBlock\n                Margin=\"1,0,0,0\"\n                Text=\"Group\" />\n            </StackPanel>\n          </ToggleButton>\n          <Separator />\n\n          <Menu\n            VerticalAlignment=\"Center\"\n            Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n            <MenuItem\n              x:Name=\"MarkersMenuItem\"\n              Padding=\"0,0,0,0\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n              Header=\"Markers\"\n              OverridesDefaultStyle=\"True\"\n              SubmenuOpened=\"MarkersMenuItem_SubmenuOpened\"\n              ToolTip=\"Show the list of marked time ranges\">\n              <MenuItem.Icon>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Margin=\"-2,0,-2,0\"\n                  HorizontalAlignment=\"Center\"\n                  VerticalAlignment=\"Center\"\n                  Source=\"{StaticResource TasklistIcon}\"\n                  Style=\"{StaticResource DisabledImageStyle}\" />\n              </MenuItem.Icon>\n              <Separator />\n              <MenuItem\n                Click=\"ClearMarkers_OnClick\"\n                Header=\"Clear All Markers\" />\n            </MenuItem>\n          </Menu>\n          <Separator />\n\n\n          <Button\n            Margin=\"0,0,6,0\"\n            Background=\"{x:Null}\"\n            BorderBrush=\"{x:Null}\"\n            Command=\"local:CallTreeCommand.RemoveAllFilters\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            ToolTip=\"Click to remove active filtering of entire profile by thread and/or time range\"\n            Visibility=\"{Binding ProfileFilter.HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <StackPanel Orientation=\"Horizontal\">\n              <Image\n                Width=\"16\"\n                Height=\"16\"\n                Source=\"{StaticResource FilterIcon}\" />\n              <TextBlock Text=\"Profile Filter\" />\n            </StackPanel>\n          </Button>\n\n          <TextBlock\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Foreground=\"DarkBlue\"\n            Text=\"Time:\"\n            Visibility=\"{Binding ProfileFilter.HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <TextBlock\n            Margin=\"4,0,2,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Foreground=\"DarkBlue\"\n            Text=\"{Binding ProfileFilter.FilteredTime, Converter={StaticResource MillisecondTimeConverter}}\"\n            ToolTip=\"Time range included in the view\"\n            Visibility=\"{Binding ProfileFilter.HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          <Button\n            Command=\"local:CallTreeCommand.RemoveFilters\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            ToolTip=\"Remove time range filter\"\n            Visibility=\"{Binding ProfileFilter.HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ClearIcon}\" />\n          </Button>\n          <Separator\n            Visibility=\"{Binding ProfileFilter.HasFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          <TextBlock\n            Margin=\"2,0,0,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Foreground=\"Indigo\"\n            Text=\"Threads:\"\n            Visibility=\"{Binding ProfileFilter.HasThreadFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <TextBlock\n            MaxWidth=\"200\"\n            Margin=\"4,0,2,0\"\n            VerticalAlignment=\"Center\"\n            FontWeight=\"Medium\"\n            Foreground=\"Indigo\"\n            Text=\"{Binding ProfileFilter.ThreadFilterText, Converter={StaticResource MillisecondTimeConverter}}\"\n            TextTrimming=\"CharacterEllipsis\"\n            ToolTip=\"Threads included in the view\"\n            Visibility=\"{Binding ProfileFilter.HasThreadFilter, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          <Button\n            Command=\"local:CallTreeCommand.RemoveThreadFilters\"\n            CommandTarget=\"{Binding ElementName=ActivityView}\"\n            ToolTip=\"Remove thread filters\"\n            Visibility=\"{Binding ProfileFilter.HasThreadFilter, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ClearIcon}\"\n              Style=\"{StaticResource DisabledImageStyle}\" />\n          </Button>\n\n          <Image\n            Source=\"{StaticResource SearchIcon}\"\n            Visibility=\"Collapsed\" />\n          <Grid\n            Height=\"24\"\n            Visibility=\"Collapsed\">\n            <TextBox\n              x:Name=\"FunctionFilter\"\n              Width=\"200\"\n              Margin=\"4,0,0,0\"\n              HorizontalAlignment=\"Center\"\n              VerticalContentAlignment=\"Center\"\n              Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              ToolTip=\"Search functions based on a case-insensitive string (Ctrl+F)\">\n              <TextBox.InputBindings>\n                <KeyBinding\n                  Key=\"Escape\"\n                  Command=\"local:CallTreeCommand.ClearSearch\"\n                  CommandParameter=\"{Binding ElementName=FunctionFilter}\" />\n              </TextBox.InputBindings>\n            </TextBox>\n            <TextBlock\n              Margin=\"8,4\"\n              Foreground=\"DimGray\"\n              IsHitTestVisible=\"False\"\n              Text=\"Search functions\"\n              Visibility=\"{Binding ElementName=FunctionFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          </Grid>\n\n          <Button\n            Command=\"local:CallTreeCommand.ClearSearch\"\n            CommandParameter=\"{Binding ElementName=FunctionFilter}\"\n            ToolTip=\"Reset searched function\"\n            Visibility=\"Collapsed\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource ClearIcon}\" />\n          </Button>\n\n          <TextBlock\n            Margin=\"8,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"Results:\"\n            Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding Path=SearchResultText, UpdateSourceTrigger=PropertyChanged}\"\n            Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          <Button\n            Command=\"local:CallTreeCommand.PreviousSearchResult\"\n            ToolTip=\"Previous search result\">\n            <Image\n              Source=\"{StaticResource UpArrowIcon}\"\n              Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Button>\n          <Button\n            Command=\"local:CallTreeCommand.NextSearchResult\"\n            ToolTip=\"Next search result\">\n            <Image\n              Source=\"{StaticResource DownArrowIcon}\"\n              Visibility=\"{Binding ShowSearchSection, Converter={StaticResource BoolToVisibilityConverter}}\" />\n          </Button>\n        </ToolBar>\n      </ToolBarTray>\n\n      <ProfileExplorerUi:PanelToolbarTray\n        Grid.Column=\"1\"\n        MaxWidth=\"75\"\n        DockPanel.Dock=\"Right\"\n        HasDuplicateButton=\"False\"\n        HasHelpButton=\"True\"\n        HasPinButton=\"False\"\n        HelpClicked=\"PanelToolbarTray_OnHelpClicked\"\n        SettingsClicked=\"PanelToolbarTray_SettingsClicked\" />\n    </Grid>\n\n    <Grid Grid.Row=\"1\">\n      <Border\n        BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n        BorderThickness=\"0,1,0,0\">\n        <Grid\n          x:Name=\"ActivityHost\"\n          Margin=\"0,0,0,20\">\n          <Border\n            Width=\"150\"\n            Height=\"50\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Top\"\n            BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n            BorderThickness=\"0,0,1,0\">\n            <Grid\n              Background=\"PapayaWhip\"\n              MouseDown=\"ActivityViewHeader_MouseDown\">\n              <Grid\n                x:Name=\"ActivityViewHeader\"\n                Margin=\"2,0,30,0\"\n                HorizontalAlignment=\"Stretch\">\n                <StackPanel Margin=\"2\">\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Text=\"All Threads\" />\n\n                  <TextBlock\n                    Margin=\"0,0,0,0\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"Selection\"\n                    Visibility=\"{Binding HasSelection, ElementName=ActivityView, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                  <TextBlock\n                    Margin=\"0,-2,0,0\"\n                    FontWeight=\"Medium\"\n                    Foreground=\"DarkBlue\"\n                    Text=\"{Binding SelectionTime, ElementName=ActivityView, Converter={StaticResource MillisecondTimeConverter}}\"\n                    Visibility=\"{Binding HasSelection, ElementName=ActivityView, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                </StackPanel>\n              </Grid>\n              <Grid\n                Width=\"30\"\n                HorizontalAlignment=\"Right\">\n                <TextBlock\n                  Margin=\"0,0,18,0\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Top\"\n                  Text=\"{Binding Path=MaxCpuUsage, ElementName=ActivityView}\"\n                  ToolTip=\"Maximum cores used\" />\n                <TextBlock\n                  Margin=\"0,0,18,0\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Bottom\"\n                  Text=\"0\" />\n                <TextBlock\n                  Margin=\"0,0,2,2\"\n                  HorizontalAlignment=\"Right\"\n                  FontSize=\"10\"\n                  Foreground=\"{StaticResource DisabledForegroundBrush}\"\n                  Text=\"CPU cores\"\n                  ToolTip=\"Maximum cores used\">\n                  <TextBlock.LayoutTransform>\n                    <TransformGroup>\n                      <RotateTransform Angle=\"90\" />\n                      <ScaleTransform ScaleX=\"-1\" ScaleY=\"-1\" />\n                    </TransformGroup>\n                  </TextBlock.LayoutTransform>\n                </TextBlock>\n              </Grid>\n            </Grid>\n          </Border>\n\n          <Grid\n            x:Name=\"TimelineHost\"\n            Grid.Column=\"0\">\n            <local:ActivityView\n              x:Name=\"ActivityView\"\n              Height=\"50\"\n              Margin=\"150,0,0,0\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Top\"\n              BackColor=\"Linen\" />\n\n            <ScrollViewer\n              x:Name=\"ActivityViewHost\"\n              Margin=\"0,50,0,0\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Stretch\"\n              CanContentScroll=\"True\"\n              HorizontalScrollBarVisibility=\"Disabled\"\n              VerticalScrollBarVisibility=\"Auto\"\n              VirtualizingStackPanel.IsVirtualizing=\"True\"\n              VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n\n              <ItemsControl x:Name=\"ActivityViewList\">\n                <ItemsControl.ItemsPanel>\n                  <ItemsPanelTemplate>\n                    <VirtualizingStackPanel Orientation=\"Vertical\" />\n                  </ItemsPanelTemplate>\n                </ItemsControl.ItemsPanel>\n              </ItemsControl>\n            </ScrollViewer>\n          </Grid>\n        </Grid>\n      </Border>\n      <ProfileExplorerUi:ScrollViewerClickable\n        x:Name=\"ActivityScrollBar\"\n        Height=\"20\"\n        VerticalAlignment=\"Bottom\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n        HorizontalScrollBarVisibility=\"Auto\"\n        ScrollChanged=\"ActivityScrollBar_OnScrollChanged\"\n        VerticalScrollBarVisibility=\"Disabled\">\n        <Grid\n          x:Name=\"ScrollElement\"\n          Height=\"0\"\n          HorizontalAlignment=\"Left\" />\n      </ProfileExplorerUi:ScrollViewerClickable>\n    </Grid>\n  </Grid>\n</ProfileExplorerUi:ToolPanelControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Timeline/TImelinePanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Threading;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.OptionsPanels;\nusing ProfileExplorer.UI.Panels;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.Timeline;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic partial class TimelinePanel : ToolPanelControl, IFunctionProfileInfoProvider, INotifyPropertyChanged {\n  private const double TimePerFrame = 1000.0 / 60; // ~16.6ms per frame at 60Hz.\n  private const double ZoomAmount = 500;\n  private const double ScrollWheelZoomAmount = 300;\n  private const double ZoomAnimationDuration = TimePerFrame * 10;\n  private const double ScrollWheelZoomAnimationDuration = TimePerFrame * 8;\n  private TimelineSettings settings_;\n  private bool panelVisible_;\n  private ProfileCallTree callTree_;\n  private ProfileCallTree pendingCallTree_; // Tree to show when panel becomes visible.\n  private List<ActivityTimelineView> threadActivityViews_;\n  private Dictionary<int, ActivityTimelineView> threadActivityViewsMap_;\n  private Dictionary<int, PopupHoverPreview> threadHoverPreviewMap_;\n  private bool changingThreadFiltering_;\n  private bool showSearchSection_;\n  private string searchResultText_;\n  private OptionsPanelHostPopup optionsPanelPopup_;\n  private ProfileFilterState profileFilter;\n\n  public TimelinePanel() {\n    InitializeComponent();\n    settings_ = App.Settings.TimelineSettings;\n    threadActivityViews_ = new List<ActivityTimelineView>();\n    threadActivityViewsMap_ = new Dictionary<int, ActivityTimelineView>();\n    threadHoverPreviewMap_ = new Dictionary<int, PopupHoverPreview>();\n\n    SetupEvents();\n    DataContext = this;\n    ProfileFilter = new ProfileFilterState();\n  }\n\n  public override ToolPanelKind PanelKind => ToolPanelKind.Timeline;\n\n  public ProfileCallTree CallTree {\n    get => callTree_;\n    set {\n      SetField(ref callTree_, value);\n      OnPropertyChanged(nameof(HasCallTree));\n    }\n  }\n\n  public TimelineSettings Settings {\n    get => settings_;\n    set {\n      settings_ = value;\n      UpdateHoverPreviewPopups();\n      OnPropertyChanged();\n    }\n  }\n\n  public bool HasCallTree => callTree_ != null;\n\n  public ProfileFilterState ProfileFilter {\n    get => profileFilter;\n    set => SetField(ref profileFilter, value);\n  }\n\n  public bool ShowSearchSection {\n    get => showSearchSection_;\n    set {\n      if (showSearchSection_ != value) {\n        showSearchSection_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  public string SearchResultText {\n    get => searchResultText_;\n    set {\n      if (searchResultText_ != value) {\n        searchResultText_ = value;\n        OnPropertyChanged();\n      }\n    }\n  }\n\n  private double ActivityViewZoomRatio => ActivityView.MaxViewWidth / ActivityViewAreaWidth;\n  private double ActivityViewAreaWidth =>\n    Math.Max(0, ActivityViewHost.ViewportWidth - ActivityViewHeader.ActualWidth - 1);\n  private double CenterZoomPointX => ActivityScrollBar.HorizontalOffset + ActivityViewAreaWidth / 2;\n\n  public List<ProfileCallTreeNode> GetBacktrace(ProfileCallTreeNode node) {\n    return callTree_.GetBacktrace(node);\n  }\n\n  public (List<ProfileCallTreeNode>, List<ModuleProfileInfo> Modules) GetTopFunctionsAndModules(\n    ProfileCallTreeNode node) {\n    return callTree_.GetTopFunctionsAndModules(node);\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public override async void OnShowPanel() {\n    base.OnShowPanel();\n    panelVisible_ = true;\n    await InitializePendingCallTree();\n  }\n\n  public void Reset() {\n    CallTree = null;\n    threadActivityViews_.Clear();\n    threadActivityViewsMap_.Clear();\n    threadHoverPreviewMap_.Clear();\n  }\n\n  public override async void OnSessionStart() {\n    base.OnSessionStart();\n    await InitializePendingCallTree();\n  }\n\n  private bool HasExcludedThreads() {\n    return CountExcludedThreads() > 0;\n  }\n\n  public async Task DisplayFlameGraph() {\n    var callTree = Session.ProfileData.CallTree;\n    await SchedulePendingCallTree(callTree);\n  }\n\n  public override void OnSessionEnd() {\n    base.OnSessionEnd();\n    CallTree = null;\n    pendingCallTree_ = null;\n  }\n\n  public void SelectFunctionSamples(Dictionary<int, List<SampleIndex>> threadSamples) {\n    ClearSelectedFunctionSamples();\n\n    foreach ((int threadId, var sampleList) in threadSamples) {\n      if (threadId == -1) {\n        ActivityView.SelectSamples(sampleList);\n      }\n      else if (threadActivityViewsMap_.TryGetValue(threadId, out var threadView)) {\n        threadView.ActivityHost.SelectSamples(sampleList);\n      }\n    }\n  }\n\n  public void MarkFunctionSamples(ProfileCallTreeNode node, Dictionary<int, List<SampleIndex>> threadSamples,\n                                  HighlightingStyle style) {\n    foreach ((int threadId, var sampleList) in threadSamples) {\n      if (threadId == -1) {\n        ActivityView.MarkSamples(node, sampleList, style);\n      }\n      else if (threadActivityViewsMap_.TryGetValue(threadId, out var threadView)) {\n        threadView.ActivityHost.MarkSamples(node, sampleList, style);\n      }\n    }\n  }\n\n  public void ClearSelectedFunctionSamples() {\n    ActivityView.ClearSelectedSamples();\n    threadActivityViews_.ForEach(threadView => threadView.ActivityHost.ClearSelectedSamples());\n  }\n\n  public void ClearMarkedFunctionSamples() {\n    ActivityView.ClearMarkedSamples();\n    threadActivityViews_.ForEach(threadView => threadView.ActivityHost.ClearMarkedSamples());\n  }\n\n  protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\n  }\n\n  protected bool SetField<T>(ref T field, T value, [CallerMemberName] string propertyName = null) {\n    if (EqualityComparer<T>.Default.Equals(field, value)) return false;\n    field = value;\n    OnPropertyChanged(propertyName);\n    return true;\n  }\n\n  private async Task SchedulePendingCallTree(ProfileCallTree callTree) {\n    // Display flame graph once the panel is visible and visible area is valid.\n    if (pendingCallTree_ == null) {\n      pendingCallTree_ = callTree;\n      await InitializePendingCallTree();\n    }\n  }\n\n  private async Task InitializePendingCallTree() {\n    if (pendingCallTree_ != null && panelVisible_) {\n      // Delay the initialization to ensure the panel is actually visible\n      // and the available area is valid.\n      await Dispatcher.BeginInvoke(async () => {\n        await InitializeCallTree(pendingCallTree_);\n      }, DispatcherPriority.Render);\n\n      pendingCallTree_ = null;\n    }\n  }\n\n  private async Task InitializeCallTree(ProfileCallTree callTree) {\n    if (HasCallTree) {\n      return;\n    }\n\n    CallTree = callTree;\n    var activityArea = new Rect(0, 0, ActivityViewAreaWidth, ActivityView.ActualHeight);\n    var threads = Session.ProfileData.SortedThreadWeights;\n    var initTasks = new List<Task>(threads.Count);\n\n    initTasks.Add(ActivityView.Initialize(Session.ProfileData, activityArea));\n    ActivityView.IsTimeBarVisible = true;\n    ActivityView.SampleBorderColor = ColorPens.GetPen(Colors.Black, 0.25);\n    ActivityView.SamplesBackColor = ColorBrushes.GetBrush(\"#F4A0A0\");\n\n    var threadActivityArea = new Rect(0, 0, ActivityViewAreaWidth, 25);\n\n    foreach (var thread in threads) {\n      var threadView = new ActivityTimelineView();\n      SetupActivityViewEvents(threadView.ActivityHost);\n      threadView.ActivityHost.BackColor = Brushes.WhiteSmoke;\n      threadView.ActivityHost.SampleBorderColor = ColorPens.GetPen(Colors.Black, 0.25);\n      threadView.ThreadActivityAction += ThreadView_ThreadActivityAction;\n\n      // Set thread background colors.\n      var threadInfo = Session.ProfileData.FindThread(thread.ThreadId);\n\n      (threadView.MarginBackColor, threadView.ActivityHost.SamplesBackColor) =\n        settings_.GetThreadBackgroundColors(threadInfo, thread.ThreadId);\n\n      threadActivityViews_.Add(threadView);\n      threadActivityViewsMap_[thread.ThreadId] = threadView;\n      initTasks.Add(threadView.ActivityHost.Initialize(Session.ProfileData, threadActivityArea,\n                                                       thread.ThreadId));\n      SetupActivityHoverPreview(threadView.ActivityHost);\n\n      //threadView.TimelineHost.Session = Session;\n      //threadView.TimelineHost.InitializeTimeline(callTree, thread.ThreadId);\n      //SetupTimelineViewEvents(threadView.TimelineHost);\n    }\n\n    await Task.WhenAll(initTasks);\n\n    // Redraw everything once all views are initialized.\n    ActivityView.InitializeDone();\n\n    foreach (var thread in threads) {\n      threadActivityViewsMap_[thread.ThreadId].ActivityHost.InitializeDone();\n    }\n\n    ActivityViewList.ItemsSource = new CollectionView(threadActivityViews_);\n  }\n\n  private void UpdateHoverPreviewPopups() {\n    SetupActivityHoverPreview(ActivityView);\n\n    foreach (var threadView in threadActivityViews_) {\n      SetupActivityHoverPreview(threadView.ActivityHost);\n    }\n  }\n\n  public async Task ApplyThreadFilterAction(int threadId, ThreadActivityAction action) {\n    var view = threadActivityViews_.Find(item => item.ThreadId == threadId);\n\n    if (view != null) {\n      await ApplyThreadFilterChange(view, action);\n    }\n  }\n\n  private async void ThreadView_ThreadActivityAction(object sender, ThreadActivityAction action) {\n    var view = sender as ActivityTimelineView;\n    await ApplyThreadFilterChange(view, action);\n  }\n\n  private async Task ApplyThreadFilterChange(ActivityTimelineView view, ThreadActivityAction action) {\n    Trace.WriteLine($\"Thread action {action} for thread {view.ThreadId}\");\n    bool changed = false;\n    changingThreadFiltering_ = true;\n\n    switch (action) {\n      case ThreadActivityAction.IncludeThread: {\n        changed = UpdateThreadFilter(view, true);\n        break;\n      }\n      case ThreadActivityAction.ExcludeThread: {\n        changed = UpdateThreadFilter(view, false);\n        break;\n      }\n      case ThreadActivityAction.FilterToThread: {\n        changed = UpdateThreadFilter(view, true);\n\n        foreach (var otherView in threadActivityViews_) {\n          if (otherView != view) {\n            otherView.ActivityHost.ClearSelectedTimeRange();\n\n            if (UpdateThreadFilter(otherView, false)) {\n              changed = true;\n            }\n          }\n        }\n\n        break;\n      }\n      case ThreadActivityAction.IncludeSameNameThread:\n      case ThreadActivityAction.ExcludeSameNameThread:\n      case ThreadActivityAction.FilterToSameNameThread: {\n        foreach (var otherView in threadActivityViews_) {\n          if (otherView.ThreadName.Equals(view.ThreadName, StringComparison.Ordinal)) {\n            if (UpdateThreadFilter(otherView,\n                                   action == ThreadActivityAction.IncludeSameNameThread ||\n                                   action == ThreadActivityAction.FilterToSameNameThread)) {\n              changed = true;\n            }\n          }\n          else if (action == ThreadActivityAction.FilterToSameNameThread &&\n                   UpdateThreadFilter(otherView, false)) {\n            changed = true; // Exclude threads with different name.\n          }\n        }\n\n        break;\n      }\n      case ThreadActivityAction.SelectThread: {\n        // Select the entire thread and deselect range in other ones.\n        bool wasSelected = view.ActivityHost.HasAllTimeSelected;\n\n        foreach (var otherView in threadActivityViews_) {\n          otherView.ActivityHost.ClearSelectedTimeRange();\n        }\n\n        // Click if already selected deselects.\n        if (!wasSelected) {\n          view.ActivityHost.SelectAllTime();\n        }\n\n        break;\n      }\n      default: throw new NotImplementedException();\n    }\n\n    changingThreadFiltering_ = false;\n\n    if (changed) {\n      await ApplyProfileFilter();\n    }\n  }\n\n  private void SetupEvents() {\n    TimelineHost.SizeChanged += (sender, args) => {\n      if (IsInitialized) {\n        // Resize activity view to fit the new region.\n        double newWidth = args.NewSize.Width - ActivityViewHeader.ActualWidth - 1;\n        SetMaxWidth(Math.Max(newWidth, ActivityView.MaxViewWidth), false);\n        SetVisibleWidth(newWidth);\n      }\n    };\n\n    SetupActivityViewEvents(ActivityView);\n    SetupActivityHoverPreview(ActivityView);\n  }\n\n  private void SetupActivityHoverPreview(ActivityView view) {\n    if (threadHoverPreviewMap_.TryGetValue(view.ThreadId, out var hover)) {\n      hover.Unregister();\n      threadHoverPreviewMap_.Remove(view.ThreadId);\n    }\n\n    if (!settings_.ShowCallStackPopup) {\n      return;\n    }\n\n    var preview = new PopupHoverPreview(\n      view, TimeSpan.FromMilliseconds(settings_.CallStackPopupDuration),\n      (mousePoint, previewPoint) => {\n        var timePoint = view.CurrentTimePoint;\n\n        // Find the call node at the current time point.\n        // Pick the hottest function in a small range of samples around the time point.\n        var filter = new ProfileSampleFilter {\n          TimeRange = new SampleTimeRangeInfo(timePoint.Time, timePoint.Time,\n                                              Math.Max(0, timePoint.SampleIndex - 20),\n                                              Math.Min(timePoint.SampleIndex + 20,\n                                                       Session.ProfileData.Samples.Count), timePoint.ThreadId),\n          ThreadIds = timePoint.ThreadId != -1\n            ? new List<int> {timePoint.ThreadId} : null\n        };\n\n        //? TODO: if selection, use range covered by it\n        ProfileCallTreeNode callNode = null;\n        var rangeProfile = Session.ProfileData.ComputeProfile(Session.ProfileData, filter, true, 1);\n        var funcs = rangeProfile.GetSortedFunctions();\n\n        if (funcs.Count > 0) {\n          var nodes = rangeProfile.CallTree.GetCallTreeNodes(funcs[0].Item1);\n          callNode = nodes[0];\n        }\n\n        if (callNode == null) {\n          return null;\n        }\n\n        // If popup already opened for this node reuse the instance.\n        if (threadHoverPreviewMap_.TryGetValue(\n              view.ThreadId, out var hoverPreview) &&\n            hoverPreview.PreviewPopup is CallTreeNodePopup popup) {\n          popup.UpdatePosition(previewPoint, view);\n        }\n        else {\n          popup = new CallTreeNodePopup(callNode, this, previewPoint, view, Session);\n        }\n\n        //? TODO: Max backtrace depth 10 should be an option\n        popup.ShowBackTrace(callNode, 10,\n                            Session.CompilerInfo.NameProvider.FormatFunctionName);\n        return popup;\n      },\n      (mousePoint, popup) => true,\n      popup => {\n        threadHoverPreviewMap_.Remove(view.ThreadId);\n        Session.RegisterDetachedPanel(popup);\n      });\n\n    threadHoverPreviewMap_[view.ThreadId] = preview;\n  }\n\n  private void SetupActivityViewEvents(ActivityView view) {\n    view.PreviewMouseWheel += ActivityView_PreviewMouseWheel;\n    view.SelectedTimePoint += ActivityView_SelectedTimePoint;\n    view.SelectedTimeRange += ActivityView_SelectedTimeRange;\n    view.SelectingTimeRange += ActivityView_SelectingTimeRange;\n    view.FilteredTimeRange += ActivityView_FilteredTimeRange;\n    view.ClearedSelectedTimeRange += ActivityView_ClearedSelectedTimeRange;\n    view.ClearedFilteredTimeRange += ActivityView_ClearedFilteredTimeRange;\n    view.ThreadIncludedChanged += ActivityView_ThreadIncludedChanged;\n  }\n\n  private void ActivityView_PreviewMouseWheel(object sender, MouseWheelEventArgs e) {\n    HidePreviewPopup();\n\n    if (Utils.IsShiftModifierActive()) {\n      // Turn vertical scrolling into horizontal scrolling.\n      ActivityScrollBar.ScrollToHorizontalOffset(ActivityScrollBar.HorizontalOffset - e.Delta);\n      e.Handled = true;\n      return;\n    }\n\n    if (!(Utils.IsKeyboardModifierActive() ||\n          e.LeftButton == MouseButtonState.Pressed)) {\n      // Zoom when Ctrl/Alt/Shift or left mouse button are pressed.\n      return;\n    }\n\n    bool animate = false; //? TODO: Option in UI\n    double amount = ScrollWheelZoomAmount * ActivityViewZoomRatio; // Keep step consistent.\n    double step = amount * Math.CopySign(1 + e.Delta / 1000.0, e.Delta);\n    double zoomPointX = e.GetPosition(ActivityView).X;\n    AdjustZoom(step, zoomPointX, animate, ScrollWheelZoomAnimationDuration);\n    e.Handled = true;\n  }\n\n  private void AdjustZoom(double step, double zoomPointX, bool animate = false, double duration = 0.0) {\n    double initialWidth = ActivityView.MaxViewWidth;\n    double initialOffsetX = ActivityScrollBar.HorizontalOffset;\n    AdjustMaxWidth(step);\n    AdjustGraphOffset(zoomPointX, initialWidth, initialOffsetX);\n  }\n\n  private void AdjustGraphOffset(double zoomPointX, double initialWidth, double initialOffsetX) {\n    double zoom = ActivityView.MaxViewWidth / initialWidth;\n    double offsetAdjustment = initialOffsetX / zoom + zoomPointX;\n    ActivityScrollBar.ScrollToHorizontalOffset(offsetAdjustment * zoom - zoomPointX);\n  }\n\n  private void HidePreviewPopup() {\n    foreach (var popup in threadHoverPreviewMap_.Values) {\n      popup.Hide();\n    }\n  }\n\n  private async void ActivityView_ThreadIncludedChanged(object sender, bool included) {\n    var view = sender as ActivityView;\n    UpdateThreadFilter(view, included);\n\n    if (!changingThreadFiltering_) {\n      await ApplyProfileFilter();\n    }\n  }\n\n  private void SetFilteredThreadsState(ProfileFilterState state) {\n    int excludedCount = CountExcludedThreads();\n\n    if (excludedCount == 0) {\n      state.HasThreadFilter = false;\n      state.ThreadFilterText = null;\n      return;\n    }\n\n    var sb = new StringBuilder();\n    int added = 0;\n\n    if (excludedCount < threadActivityViews_.Count / 2) {\n      sb.Append(\"All - \");\n\n      foreach (var threadView in threadActivityViews_) {\n        if (!threadView.IsThreadIncluded) {\n          sb.Append($\"{threadView.ThreadId} \");\n\n          if (added++ > 10) {\n            sb.Append(\"...\");\n            break;\n          }\n        }\n      }\n    }\n    else {\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.IsThreadIncluded) {\n          sb.Append($\"{threadView.ThreadId} \");\n\n          if (added++ > 10) {\n            sb.Append(\"...\");\n            break;\n          }\n        }\n      }\n    }\n\n    state.ThreadFilterText = sb.ToString().Trim();\n    state.HasThreadFilter = true;\n  }\n\n  private ProfileFilterState CreateProfileFilterState() {\n    var timeRange = ActivityView.HasFilter ? ActivityView.FilteredRange : null;\n    var filter = ConstructProfileSampleFilter(timeRange);\n\n    var state = new ProfileFilterState(filter);\n    state.HasFilter = ActivityView.HasFilter;\n    state.FilteredTime = ActivityView.FilteredTime;\n\n    state.RemoveThreadFilter += async () => {\n      await RemoveThreadFilters();\n    };\n    state.RemoveTimeRangeFilter += async () => {\n      await RemoveTimeRangeFilters();\n    };\n    state.RemoveAllFilters += async () => {\n      await RemoveAllFilters();\n    };\n\n    SetFilteredThreadsState(state);\n    return state;\n  }\n\n  private async Task ApplyProfileFilter() {\n    ProfileFilter = CreateProfileFilterState();\n    await Session.FilterProfileSamples(ProfileFilter);\n  }\n\n  private bool UpdateThreadFilter(ActivityView view, bool included) {\n    return UpdateThreadFilter(threadActivityViewsMap_[view.ThreadId], included);\n  }\n\n  private bool UpdateThreadFilter(ActivityTimelineView view, bool included) {\n    if (included) {\n      // Use the same filter as for the other threads.\n      if (ActivityView.HasFilter) {\n        view.ActivityHost.FilterTimeRange(ActivityView.FilteredRange);\n      }\n      else {\n        view.ActivityHost.ClearTimeRangeFilter();\n      }\n    }\n    else {\n      view.ActivityHost.ClearTimeRangeFilter();\n    }\n\n    bool changed = view.IsThreadIncluded != included;\n    view.IsThreadIncluded = included;\n    return changed;\n  }\n\n  private void SetupTimelineViewEvents(FlameGraphHost view) {\n    view.MaxWidthChanged += TimelineView_MaxWidthChanged;\n    view.HorizontalOffsetChanged += TimelineView_HorizontalOffsetChanged;\n  }\n\n  private void TimelineView_HorizontalOffsetChanged(object sender, double offset) {\n    ActivityScrollBar.ScrollToHorizontalOffset(offset);\n  }\n\n  private void TimelineView_MaxWidthChanged(object sender, double width) {\n    SetMaxWidth(width, sender);\n  }\n\n  private async void ActivityView_ClearedFilteredTimeRange(object sender, EventArgs e) {\n    var view = sender as ActivityView;\n    await RemoveTimeRangeFilters(view);\n  }\n\n  private async Task RemoveTimeRangeFilters(ActivityView view = null) {\n    RemoveTimeRangeFiltersImpl(view);\n    await ApplyProfileFilter();\n  }\n\n  private async Task RemoveAllFilters(ActivityView view = null) {\n    await RemoveThreadFilters();\n    await RemoveTimeRangeFilters(view);\n    await ApplyProfileFilter();\n  }\n\n  private void RemoveTimeRangeFiltersImpl(ActivityView view) {\n    changingThreadFiltering_ = true;\n\n    if (view == null || view.IsSingleThreadView) {\n      ActivityView.ClearTimeRangeFilter();\n    }\n\n    foreach (var threadView in threadActivityViews_) {\n      threadView.ActivityHost.ClearTimeRangeFilter();\n\n      if (view != null) {\n        UpdateThreadFilter(threadView, threadView.ActivityHost.PreviousIsThreadIncluded);\n      }\n    }\n\n    changingThreadFiltering_ = false;\n  }\n\n  private async Task RemoveThreadFilters() {\n    RemoveThreadFiltersImpl();\n    await ApplyProfileFilter();\n  }\n\n  private void RemoveThreadFiltersImpl() {\n    changingThreadFiltering_ = true;\n\n    foreach (var threadView in threadActivityViews_) {\n      UpdateThreadFilter(threadView, true);\n    }\n\n    changingThreadFiltering_ = false;\n  }\n\n  private async void ActivityView_FilteredTimeRange(object sender, SampleTimeRangeInfo range) {\n    var view = sender as ActivityView;\n    changingThreadFiltering_ = true;\n\n    if (view.IsSingleThreadView) {\n      ActivityView.FilterTimeRange(range);\n      UpdateThreadFilter(view, true);\n\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.ActivityHost != view) {\n          UpdateThreadFilter(threadView, false);\n        }\n      }\n    }\n    else {\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.IsThreadIncluded) {\n          threadView.ActivityHost.FilterTimeRange(range);\n        }\n      }\n    }\n\n    changingThreadFiltering_ = false;\n    await ApplyProfileFilter();\n  }\n\n  private int CountExcludedThreads() {\n    int count = 0;\n\n    foreach (var threadView in threadActivityViews_) {\n      if (!threadView.IsThreadIncluded) {\n        count++;\n      }\n    }\n\n    return count;\n  }\n\n  private ProfileSampleFilter ConstructProfileSampleFilter(SampleTimeRangeInfo timeRange) {\n    var filter = new ProfileSampleFilter {TimeRange = timeRange};\n\n    if (HasExcludedThreads()) {\n      // Make a list of the non-excluded threads.\n      filter.ThreadIds = new List<int>();\n\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.IsThreadIncluded) {\n          filter.ThreadIds.Add(threadView.ThreadId);\n        }\n      }\n    }\n\n    return filter;\n  }\n\n  private async void ActivityView_ClearedSelectedTimeRange(object sender, EventArgs e) {\n    var view = sender as ActivityView;\n\n    if (view.IsSingleThreadView) {\n      ActivityView.ClearSelectedTimeRange();\n    }\n\n    foreach (var threadView in threadActivityViews_) {\n      if (threadView.ActivityHost != view) {\n        threadView.ActivityHost.ClearSelectedTimeRange();\n      }\n    }\n\n    if (settings_.SyncSelection) {\n      await Session.ProfileSampleRangeDeselected();\n    }\n  }\n\n  private async void ActivityView_SelectedTimeRange(object sender, SampleTimeRangeInfo range) {\n    Trace.WriteLine(\n      $\"Selected {range.StartTime} / {range.EndTime}, range {range.StartSampleIndex}-{range.EndSampleIndex}\");\n    HidePreviewPopup();\n    var view = sender as ActivityView;\n\n    if (view.IsSingleThreadView) {\n      ActivityView.SelectTimeRange(range);\n\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.ActivityHost != view) {\n          threadView.ActivityHost.ClearSelectedTimeRange();\n        }\n      }\n    }\n    else {\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.IsThreadIncluded) {\n          threadView.ActivityHost.SelectTimeRange(range);\n        }\n      }\n    }\n\n    if (settings_.SyncSelection) {\n      await Session.ProfileSampleRangeSelected(range);\n    }\n  }\n\n  private async void ActivityView_SelectedTimePoint(object sender, SampleTimePointInfo point) {\n    if (settings_.SyncSelection) {\n      var range = new SampleTimeRangeInfo(point.Time, point.Time, point.SampleIndex, point.SampleIndex, point.ThreadId);\n      await Session.ProfileSampleRangeSelected(range);\n    }\n  }\n\n  private void ActivityView_SelectingTimeRange(object sender, SampleTimeRangeInfo range) {\n    HidePreviewPopup();\n    var view = sender as ActivityView;\n\n    if (view.IsSingleThreadView) {\n      ActivityView.SelectTimeRange(range);\n\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.ActivityHost != view) {\n          threadView.ActivityHost.ClearSelectedTimeRange();\n        }\n      }\n    }\n    else {\n      foreach (var threadView in threadActivityViews_) {\n        if (threadView.IsThreadIncluded) {\n          threadView.ActivityHost.SelectTimeRange(range);\n        }\n      }\n    }\n  }\n\n  private async void ExecuteGraphResetWidth(object sender, ExecutedRoutedEventArgs e) {\n    ActivityScrollBar.ScrollToHorizontalOffset(0);\n    SetMaxWidth(ActivityViewAreaWidth);\n  }\n\n  private void ExecuteGraphZoomIn(object sender, ExecutedRoutedEventArgs e) {\n    ZoomIn(CenterZoomPointX);\n  }\n\n  private void ExecuteGraphZoomOut(object sender, ExecutedRoutedEventArgs e) {\n    ZoomOut(CenterZoomPointX);\n  }\n\n  private void ZoomIn(double zoomPointX) {\n    AdjustZoom(ZoomAmount * ActivityViewZoomRatio, zoomPointX, true, ZoomAnimationDuration);\n  }\n\n  private void ZoomOut(double zoomPointX) {\n    AdjustZoom(-ZoomAmount * (ActivityViewZoomRatio * 0.5), zoomPointX, true, ZoomAnimationDuration);\n  }\n\n  private void AdjustMaxWidth(double amount) {\n    double newWidth = Math.Max(ActivityView.MaxViewWidth + amount, ActivityViewAreaWidth);\n    SetMaxWidth(newWidth);\n  }\n\n  private void SetMaxWidth(double newWidth, object source = null) {\n    ActivityView.SetMaxWidth(newWidth);\n    ScrollElement.Width = newWidth + ActivityViewHeader.ActualWidth;\n\n    foreach (var threadView in threadActivityViews_) {\n      threadView.ActivityHost.SetMaxWidth(newWidth);\n    }\n  }\n\n  private void SetVisibleWidth(double newWidth) {\n    if (newWidth <= 0) {\n      return; // Ignore value during panel undocking.\n    }\n\n    ActivityView.SetVisibleWidth(newWidth);\n\n    foreach (var threadView in threadActivityViews_) {\n      threadView.ActivityHost.SetVisibleWidth(newWidth);\n    }\n  }\n\n  private void PanelToolbarTray_SettingsClicked(object sender, EventArgs e) {\n    ShowOptionsPanel();\n  }\n\n  private void ToolBar_Loaded(object sender, RoutedEventArgs e) {\n    Utils.PatchToolbarStyle(sender as ToolBar);\n  }\n\n  private void ActivityScrollBar_OnScrollChanged(object sender, ScrollChangedEventArgs e) {\n    double offset = ActivityScrollBar.HorizontalOffset;\n    ActivityView.SetHorizontalOffset(offset);\n\n    foreach (var view in threadActivityViews_) {\n      view.ActivityHost.SetHorizontalOffset(offset);\n    }\n  }\n\n  private async void UndoButton_Click(object sender, RoutedEventArgs e) {\n    // TODO: await RestorePreviousState();\n  }\n\n  private async void RemoveFiltersExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await RemoveTimeRangeFilters();\n  }\n\n  private async void RemoveThreadFiltersExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await RemoveThreadFilters();\n  }\n\n  private async void RemoveAllFiltersExecuted(object sender, ExecutedRoutedEventArgs e) {\n    await RemoveAllFilters();\n  }\n\n  private async void ActivityViewHeader_MouseDown(object sender, MouseButtonEventArgs e) {\n    if (e.LeftButton == MouseButtonState.Pressed &&\n        e.ClickCount >= 2) {\n      await RemoveThreadFilters();\n    }\n  }\n\n  private void MarkersMenuItem_SubmenuOpened(object sender, RoutedEventArgs e) {\n    var defaultItems = DocumentUtils.SaveDefaultMenuItems(MarkersMenuItem);\n    MarkersMenuItem.Items.Clear();\n\n    foreach (var samples in ActivityView.MarkedSamples) {\n      var item = new MenuItem {\n        OverridesDefaultStyle = true,\n        Header = samples.Node.FormatFunctionName(Session.CompilerInfo.NameProvider.FormatFunctionName, 50),\n        Icon = CreateMarkerMenuIcon(samples),\n        Tag = samples,\n        ToolTip = \"Right-click to remove marking\"\n      };\n\n      item.MouseRightButtonUp += (s, args) => {\n        var samples = (MarkedSamples)((MenuItem)s).Tag;\n        ActivityView.RemoveMarkedSamples(samples.Node);\n\n        foreach (var threadView in threadActivityViews_) {\n          threadView.ActivityHost.RemoveMarkedSamples(samples.Node);\n        }\n      };\n\n      MarkersMenuItem.Items.Add(item);\n    }\n\n    DocumentUtils.RestoreDefaultMenuItems(MarkersMenuItem, defaultItems);\n  }\n\n  private void ClearMarkers_OnClick(object sender, RoutedEventArgs e) {\n    ActivityView.ClearMarkedSamples();\n\n    foreach (var threadView in threadActivityViews_) {\n      threadView.ActivityHost.ClearMarkedSamples();\n    }\n  }\n\n  private Image CreateMarkerMenuIcon(MarkedSamples samples) {\n    var visual = new DrawingVisual();\n\n    using (var dc = visual.RenderOpen()) {\n      dc.DrawRectangle(samples.Style.BackColor, ColorPens.GetPen(Colors.Black), new Rect(0, 0, 16, 16));\n    }\n\n    var targetBitmap = new RenderTargetBitmap(16, 16, 96, 96, PixelFormats.Default);\n    targetBitmap.Render(visual);\n    return new Image {Source = targetBitmap};\n  }\n\n  private async void PanelToolbarTray_OnHelpClicked(object sender, EventArgs e) {\n    await HelpPanel.DisplayPanelHelp(PanelKind, Session);\n  }\n\n  private void ShowOptionsPanel() {\n    if (optionsPanelPopup_ != null) {\n      optionsPanelPopup_.ClosePopup();\n      optionsPanelPopup_ = null;\n      return;\n    }\n\n    FrameworkElement relativeControl = TimelineHost;\n    optionsPanelPopup_ = OptionsPanelHostPopup.Create<TimelineOptionsPanel, TimelineSettings>(\n      settings_.Clone(), relativeControl, Session,\n      async (newSettings, commit) => {\n        if (!newSettings.Equals(settings_)) {\n          Settings = newSettings;\n          App.Settings.TimelineSettings = newSettings;\n\n          if (commit) {\n            App.SaveApplicationSettings();\n          }\n\n          return settings_.Clone();\n        }\n\n        return null;\n      },\n      () => optionsPanelPopup_ = null);\n  }\n\n  public override async Task OnReloadSettings() {\n    Settings = App.Settings.TimelineSettings;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Utils/GlyphRunCache.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI.Profile;\n\npublic class GlyphRunCache {\n  private static readonly Point ZeroPoint = new(0, 0);\n  private readonly GlyphTypeface glyphTypeface_;\n  private readonly Dictionary<string, Dictionary<double, GlyphInfo>> textGlyphsCache_;\n  private readonly Typeface typeFace_;\n  private readonly double textSize_;\n  private readonly float pixelsPerDip_;\n  private readonly bool useGlyphIndexFastPath_;\n  private readonly double[] advanceGlyphWidths_;\n\n  public GlyphRunCache(Typeface typeFace, double textSize, double pixelsPerDip) {\n    typeFace_ = typeFace;\n    textSize_ = textSize;\n    pixelsPerDip_ = (float)pixelsPerDip;\n    textGlyphsCache_ = new Dictionary<string, Dictionary<double, GlyphInfo>>();\n\n    if (!typeFace.TryGetGlyphTypeface(out glyphTypeface_)) {\n      throw new InvalidOperationException(\"Failed to get GlyphTypeface\");\n    }\n\n    // Check if a direct mapping from ASCII code to glyph index is possible.\n    char testLetter = 'a';\n    ushort glyphIndex = glyphTypeface_.CharacterToGlyphMap[testLetter];\n    useGlyphIndexFastPath_ = glyphIndex == testLetter - 29;\n\n    if (useGlyphIndexFastPath_) {\n      advanceGlyphWidths_ = new double[glyphTypeface_.GlyphCount];\n\n      for (int i = 0; i < glyphTypeface_.GlyphCount; i++) {\n        advanceGlyphWidths_[i] = glyphTypeface_.AdvanceWidths[(ushort)i] * textSize_;\n      }\n    }\n  }\n\n  public GlyphInfo GetGlyphs(string text) {\n    return GetGlyphs(text, double.MaxValue);\n  }\n\n  public GlyphInfo GetGlyphs(string text, double maxWidth) {\n    if (textGlyphsCache_.TryGetValue(text, out var glyphsList)) {\n      if (glyphsList.TryGetValue(maxWidth, out var info)) {\n        return info;\n      }\n    }\n\n    return MakeGlyphRun(text);\n  }\n\n  public void CacheGlyphs(GlyphInfo info, string text, double maxWidth) {\n    if (info.IsCached) {\n      return;\n    }\n\n    if (!textGlyphsCache_.TryGetValue(text, out var glyphsList)) {\n      glyphsList = new Dictionary<double, GlyphInfo>(new MaxWidthComparer());\n      textGlyphsCache_[text] = glyphsList;\n    }\n\n    glyphsList[maxWidth] = info;\n  }\n\n  private GlyphInfo MakeGlyphRun(string text) {\n    if (string.IsNullOrEmpty(text)) {\n      text = \" \"; // GlyphRun constructor doesn't like 0-length arrays.\n    }\n\n    double size = textSize_;\n    double totalWidth = 0;\n    ushort[] glyphIndexes = new ushort[text.Length];\n    double[] advanceWidths = new double[text.Length];\n\n    for (int i = 0; i < text.Length; i++) {\n      ushort glyphIndex;\n\n      if (useGlyphIndexFastPath_) {\n        glyphIndex = (ushort)(text[i] - 29);\n      }\n      else {\n        glyphIndex = glyphTypeface_.CharacterToGlyphMap[text[i]];\n      }\n\n      glyphIndexes[i] = glyphIndex;\n      double glyphWidth = 0;\n\n      if (useGlyphIndexFastPath_) {\n        glyphWidth = advanceGlyphWidths_[glyphIndex];\n      }\n      else {\n        glyphWidth = glyphTypeface_.AdvanceWidths[glyphIndex] * size;\n      }\n\n      advanceWidths[i] = glyphWidth;\n      totalWidth += glyphWidth;\n    }\n\n    var glyphRun = new GlyphRun(glyphTypeface_, 0, false, size, pixelsPerDip_,\n                                glyphIndexes, ZeroPoint, advanceWidths,\n                                null, null, null, null, null, null);\n    double height = glyphTypeface_.Height * size;\n    return new GlyphInfo(glyphRun, totalWidth, height, false);\n  }\n\n  public struct GlyphInfo {\n    public GlyphRun Glyphs;\n    public double TextWidth;\n    public double TextHeight;\n    public bool IsCached;\n    public bool IsTrimmed;\n\n    public GlyphInfo(GlyphRun glyphs, double textWidth, double textHeight, bool isTrimmed) {\n      Glyphs = glyphs;\n      TextWidth = textWidth;\n      TextHeight = textHeight;\n      IsTrimmed = isTrimmed;\n      IsCached = false;\n    }\n  }\n\n  private class MaxWidthComparer : IEqualityComparer<double> {\n    public bool Equals(double x, double y) {\n      return Math.Abs(x - y) < double.Epsilon;\n    }\n\n    public int GetHashCode(double value) {\n      return (int)value;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Utils/QuadTree.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\n\nnamespace ProfileExplorer.UI.Profile;\n#if DEBUG_DUMP\nusing System.Windows.Controls;\nusing System.Windows.Shapes;\nusing System.Windows.Media;\nusing System.Xml;\n#endif\n\n/// <summary>\n///   This class efficiently stores and retrieves arbitrarily sized and positioned\n///   objects in a quad-tree data structure.  This can be used to do efficient hit\n///   detection or visiblility checks on objects in a virtualized canvas.\n///   The object does not need to implement any special interface because the Rect Bounds\n///   of those objects is handled as a separate argument to Insert.\n/// </summary>\nclass QuadTree<T> where T : class {\n  private Rect bounds; // overall bounds we are indexing.\n  private Quadrant root;\n  private IDictionary<T, Quadrant> table;\n\n  /// <summary>\n  ///   This determines the overall quad-tree indexing strategy, changing this bounds\n  ///   is expensive since it has to re-divide the entire thing - like a re-hash operation.\n  /// </summary>\n  public Rect Bounds {\n    get => bounds;\n    set {\n      bounds = value;\n      ReIndex();\n    }\n  }\n\n  public int Count => table.Count;\n\n  /// <summary>\n  ///   Insert a node with given bounds into this QuadTree.\n  /// </summary>\n  /// <param name=\"node\">The node to insert</param>\n  /// <param name=\"bounds\">The bounds of this node</param>\n  public void Insert(T node, Rect bounds) {\n    if (this.bounds.Width == 0 || this.bounds.Height == 0) {\n      throw new ArgumentException();\n    }\n\n    if (bounds.Width == 0 || bounds.Height == 0) {\n      throw new ArgumentException();\n    }\n\n    if (root == null) {\n      root = new Quadrant(null, this.bounds);\n    }\n\n    var parent = root.Insert(node, bounds);\n\n    if (table == null) {\n      table = new Dictionary<T, Quadrant>();\n    }\n\n    table[node] = parent;\n  }\n\n  /// <summary>\n  ///   Get a list of the nodes that intersect the given bounds.\n  /// </summary>\n  /// <param name=\"bounds\">The bounds to test</param>\n  /// <returns>List of zero or mode nodes found inside the given bounds</returns>\n  public IEnumerable<T> GetNodesInside(Rect bounds) {\n    foreach (var n in GetNodes(bounds)) {\n      yield return n.Node;\n    }\n  }\n\n  /// <summary>\n  ///   Get a list of the nodes that intersect the given bounds.\n  /// </summary>\n  /// <param name=\"bounds\">The bounds to test</param>\n  /// <returns>List of zero or mode nodes found inside the given bounds</returns>\n  public bool HasNodesInside(Rect bounds) {\n    if (root == null) {\n      return false;\n    }\n\n    return root.HasIntersectingNodes(bounds);\n  }\n\n  /// <summary>\n  ///   Get list of nodes that intersect the given bounds.\n  /// </summary>\n  /// <param name=\"bounds\">The bounds to test</param>\n  /// <returns>The list of nodes intersecting the given bounds</returns>\n  private IEnumerable<QuadNode> GetNodes(Rect bounds) {\n    var result = new List<QuadNode>();\n\n    if (root != null) {\n      root.GetIntersectingNodes(result, bounds);\n    }\n\n    return result;\n  }\n\n  /// <summary>\n  ///   Remove the given node from this QuadTree.\n  /// </summary>\n  /// <param name=\"node\">The node to remove</param>\n  /// <returns>True if the node was found and removed.</returns>\n  public bool Remove(T node) {\n    if (table != null) {\n      Quadrant parent = null;\n\n      if (table.TryGetValue(node, out parent)) {\n        parent.RemoveNode(node);\n        table.Remove(node);\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  /// <summary>\n  ///   Rebuild all the Quadrants according to the current QuadTree Bounds.\n  /// </summary>\n  private void ReIndex() {\n    root = null;\n\n    foreach (var n in GetNodes(bounds)) {\n      Insert(n.Node, n.Bounds);\n    }\n  }\n\n  /// <summary>\n  ///   Each node stored in the tree has a position, width & height.\n  /// </summary>\n  internal class QuadNode {\n    private Rect bounds;\n    private QuadNode next; // linked in a circular list.\n    private T node; // the actual visual object being stored here.\n\n    /// <summary>\n    ///   Construct new QuadNode to wrap the given node with given bounds\n    /// </summary>\n    /// <param name=\"node\">The node</param>\n    /// <param name=\"bounds\">The bounds of that node</param>\n    public QuadNode(T node, Rect bounds) {\n      this.node = node;\n      this.bounds = bounds;\n    }\n\n    /// <summary>\n    ///   The node\n    /// </summary>\n    public T Node {\n      get => node;\n      set => node = value;\n    }\n\n    /// <summary>\n    ///   The Rect bounds of the node\n    /// </summary>\n    public Rect Bounds => bounds;\n\n    /// <summary>\n    ///   QuadNodes form a linked list in the Quadrant.\n    /// </summary>\n    public QuadNode Next {\n      get => next;\n      set => next = value;\n    }\n  }\n\n  /// <summary>\n  ///   The canvas is split up into four Quadrants and objects are stored in the quadrant that contains\n  ///   them\n  ///   and each quadrant is split up into four child Quadrants recurrsively.  Objects that overlap more\n  ///   than\n  ///   one quadrant are stored in the this.nodes list for this Quadrant.\n  /// </summary>\n  internal class Quadrant {\n    private Quadrant parent;\n    private Rect bounds; // quadrant bounds.\n    private QuadNode nodes; // nodes that overlap the sub quadrant boundaries.\n\n    // The quadrant is subdivided when nodes are inserted that are\n    // completely contained within those subdivisions.\n    private Quadrant topLeft;\n    private Quadrant topRight;\n    private Quadrant bottomLeft;\n    private Quadrant bottomRight;\n#if DEBUG_DUMP\n    public void ShowQuadTree(Canvas c) {\n      Rectangle r = new Rectangle();\n      r.Width = this.bounds.Width;\n      r.Height = this.bounds.Height;\n      Canvas.SetLeft(r, this.bounds.Left);\n      Canvas.SetTop(r, this.bounds.Top);\n      r.Stroke = Brushes.DarkRed;\n      r.StrokeThickness = 1;\n      r.StrokeDashArray = new DoubleCollection(new double[] {2.0, 3.0});\n      c.Children.Add(r);\n\n      if (this.topLeft != null) this.topLeft.ShowQuadTree(c);\n      if (this.topRight != null) this.topRight.ShowQuadTree(c);\n      if (this.bottomLeft != null) this.bottomLeft.ShowQuadTree(c);\n      if (this.bottomRight != null) this.bottomRight.ShowQuadTree(c);\n    }\n\n    public void Dump(LogWriter w) {\n      w.WriteAttribute(\"Bounds\", this.bounds.ToString());\n\n      if (this.nodes != null) {\n        QuadNode n = this.nodes;\n\n        do {\n          n = n.Next; // first node.\n          w.Open(\"node\");\n          w.WriteAttribute(\"Bounds\", n.Bounds.ToString());\n          w.Close();\n        } while (n != this.nodes);\n      }\n\n      DumpQuadrant(\"TopLeft\", this.topLeft, w);\n      DumpQuadrant(\"TopRight\", this.topRight, w);\n      DumpQuadrant(\"BottomLeft\", this.bottomLeft, w);\n      DumpQuadrant(\"BottomRight\", this.bottomRight, w);\n    }\n\n    public void DumpQuadrant(string label, Quadrant q, LogWriter w) {\n      if (q != null) {\n        w.Open(\"Quadrant\");\n        w.WriteAttribute(\"Name\", label);\n        q.Dump(w);\n        w.Close();\n      }\n    }\n#endif\n\n    /// <summary>\n    ///   Construct new Quadrant with a given bounds all nodes stored inside this quadrant\n    ///   will fit inside this bounds.\n    /// </summary>\n    /// <param name=\"parent\">The parent quadrant (if any)</param>\n    /// <param name=\"bounds\">The bounds of this quadrant</param>\n    public Quadrant(Quadrant parent, Rect bounds) {\n      this.parent = parent;\n\n      //Fx.Assert(bounds.Width != 0 && bounds.Height != 0, \"Cannot have empty bound\");\n      if (bounds.Width == 0 || bounds.Height == 0) {\n        throw new ArgumentException();\n      }\n\n      this.bounds = bounds;\n    }\n\n    /// <summary>\n    ///   The parent Quadrant or null if this is the root\n    /// </summary>\n    internal Quadrant Parent => parent;\n    /// <summary>\n    ///   The bounds of this quadrant\n    /// </summary>\n    internal Rect Bounds => bounds;\n\n    /// <summary>\n    ///   Insert the given node\n    /// </summary>\n    /// <param name=\"node\">The node </param>\n    /// <param name=\"bounds\">The bounds of that node</param>\n    /// <returns></returns>\n    internal Quadrant Insert(T node, Rect bounds) {\n      //Fx.Assert(bounds.Width != 0 && bounds.Height != 0, \"Cannot have empty bound\");\n      if (bounds.Width == 0 || bounds.Height == 0) {\n        throw new ArgumentException();\n      }\n\n      var toInsert = this;\n\n      while (true) {\n        double w = toInsert.bounds.Width / 2;\n        double h = toInsert.bounds.Height / 2;\n\n        // assumption that the Rect struct is almost as fast as doing the operations\n        // manually since Rect is a value type.\n\n        var topLeft = new Rect(toInsert.bounds.Left, toInsert.bounds.Top, w, h);\n        var topRight = new Rect(toInsert.bounds.Left + w, toInsert.bounds.Top, w, h);\n        var bottomLeft = new Rect(toInsert.bounds.Left, toInsert.bounds.Top + h, w, h);\n        var bottomRight = new Rect(toInsert.bounds.Left + w, toInsert.bounds.Top + h, w, h);\n\n        Quadrant child = null;\n\n        // See if any child quadrants completely contain this node.\n        if (topLeft.Contains(bounds)) {\n          if (toInsert.topLeft == null) {\n            toInsert.topLeft = new Quadrant(toInsert, topLeft);\n          }\n\n          child = toInsert.topLeft;\n        }\n        else if (topRight.Contains(bounds)) {\n          if (toInsert.topRight == null) {\n            toInsert.topRight = new Quadrant(toInsert, topRight);\n          }\n\n          child = toInsert.topRight;\n        }\n        else if (bottomLeft.Contains(bounds)) {\n          if (toInsert.bottomLeft == null) {\n            toInsert.bottomLeft = new Quadrant(toInsert, bottomLeft);\n          }\n\n          child = toInsert.bottomLeft;\n        }\n        else if (bottomRight.Contains(bounds)) {\n          if (toInsert.bottomRight == null) {\n            toInsert.bottomRight = new Quadrant(toInsert, bottomRight);\n          }\n\n          child = toInsert.bottomRight;\n        }\n\n        if (child != null) {\n          toInsert = child;\n        }\n        else {\n          var n = new QuadNode(node, bounds);\n\n          if (toInsert.nodes == null) {\n            n.Next = n;\n          }\n          else {\n            // link up in circular link list.\n            var x = toInsert.nodes;\n            n.Next = x.Next;\n            x.Next = n;\n          }\n\n          toInsert.nodes = n;\n          return toInsert;\n        }\n      }\n    }\n\n    /// <summary>\n    ///   Returns all nodes in this quadrant that intersect the given bounds.\n    ///   The nodes are returned in pretty much random order as far as the caller is concerned.\n    /// </summary>\n    /// <param name=\"nodes\">List of nodes found in the given bounds</param>\n    /// <param name=\"bounds\">The bounds that contains the nodes you want returned</param>\n    internal void GetIntersectingNodes(List<QuadNode> nodes, Rect bounds) {\n      if (bounds.IsEmpty) return;\n      double w = this.bounds.Width / 2;\n      double h = this.bounds.Height / 2;\n\n      // assumption that the Rect struct is almost as fast as doing the operations\n      // manually since Rect is a value type.\n\n      var topLeft = new Rect(this.bounds.Left, this.bounds.Top, w, h);\n      var topRight = new Rect(this.bounds.Left + w, this.bounds.Top, w, h);\n      var bottomLeft = new Rect(this.bounds.Left, this.bounds.Top + h, w, h);\n      var bottomRight = new Rect(this.bounds.Left + w, this.bounds.Top + h, w, h);\n\n      // See if any child quadrants completely contain this node.\n      if (topLeft.IntersectsWith(bounds) && this.topLeft != null) {\n        this.topLeft.GetIntersectingNodes(nodes, bounds);\n      }\n\n      if (topRight.IntersectsWith(bounds) && this.topRight != null) {\n        this.topRight.GetIntersectingNodes(nodes, bounds);\n      }\n\n      if (bottomLeft.IntersectsWith(bounds) && this.bottomLeft != null) {\n        this.bottomLeft.GetIntersectingNodes(nodes, bounds);\n      }\n\n      if (bottomRight.IntersectsWith(bounds) && this.bottomRight != null) {\n        this.bottomRight.GetIntersectingNodes(nodes, bounds);\n      }\n\n      GetIntersectingNodes(this.nodes, nodes, bounds);\n    }\n\n    /// <summary>\n    ///   Walk the given linked list of QuadNodes and check them against the given bounds.\n    ///   Add all nodes that intersect the bounds in to the list.\n    /// </summary>\n    /// <param name=\"last\">The last QuadNode in a circularly linked list</param>\n    /// <param name=\"nodes\">The resulting nodes are added to this list</param>\n    /// <param name=\"bounds\">The bounds to test against each node</param>\n    private static void GetIntersectingNodes(QuadNode last, List<QuadNode> nodes, Rect bounds) {\n      if (last != null) {\n        var n = last;\n\n        do {\n          n = n.Next; // first node.\n\n          if (n.Bounds.IntersectsWith(bounds)) {\n            nodes.Add(n);\n          }\n        } while (n != last);\n      }\n    }\n\n    /// <summary>\n    ///   Return true if there are any nodes in this Quadrant that intersect the given bounds.\n    /// </summary>\n    /// <param name=\"bounds\">The bounds to test</param>\n    /// <returns>boolean</returns>\n    internal bool HasIntersectingNodes(Rect bounds) {\n      if (bounds.IsEmpty) return false;\n      double w = this.bounds.Width / 2;\n      double h = this.bounds.Height / 2;\n\n      // assumption that the Rect struct is almost as fast as doing the operations\n      // manually since Rect is a value type.\n\n      var topLeft = new Rect(this.bounds.Left, this.bounds.Top, w, h);\n      var topRight = new Rect(this.bounds.Left + w, this.bounds.Top, w, h);\n      var bottomLeft = new Rect(this.bounds.Left, this.bounds.Top + h, w, h);\n      var bottomRight = new Rect(this.bounds.Left + w, this.bounds.Top + h, w, h);\n\n      bool found = false;\n\n      // See if any child quadrants completely contain this node.\n      if (topLeft.IntersectsWith(bounds) && this.topLeft != null) {\n        found = this.topLeft.HasIntersectingNodes(bounds);\n      }\n\n      if (!found && topRight.IntersectsWith(bounds) && this.topRight != null) {\n        found = this.topRight.HasIntersectingNodes(bounds);\n      }\n\n      if (!found && bottomLeft.IntersectsWith(bounds) && this.bottomLeft != null) {\n        found = this.bottomLeft.HasIntersectingNodes(bounds);\n      }\n\n      if (!found && bottomRight.IntersectsWith(bounds) && this.bottomRight != null) {\n        found = this.bottomRight.HasIntersectingNodes(bounds);\n      }\n\n      if (!found) {\n        found = HasIntersectingNodes(nodes, bounds);\n      }\n\n      return found;\n    }\n\n    /// <summary>\n    ///   Walk the given linked list and test each node against the given bounds/\n    /// </summary>\n    /// <param name=\"last\">The last node in the circularly linked list.</param>\n    /// <param name=\"bounds\">Bounds to test</param>\n    /// <returns>Return true if a node in the list intersects the bounds</returns>\n    private static bool HasIntersectingNodes(QuadNode last, Rect bounds) {\n      if (last != null) {\n        var n = last;\n\n        do {\n          n = n.Next; // first node.\n\n          if (n.Bounds.IntersectsWith(bounds)) {\n            return true;\n          }\n        } while (n != last);\n      }\n\n      return false;\n    }\n\n    /// <summary>\n    ///   Remove the given node from this Quadrant.\n    /// </summary>\n    /// <param name=\"node\">The node to remove</param>\n    /// <returns>Returns true if the node was found and removed.</returns>\n    internal bool RemoveNode(T node) {\n      bool rc = false;\n\n      if (nodes != null) {\n        var p = nodes;\n\n        while (p.Next.Node != node && p.Next != nodes) {\n          p = p.Next;\n        }\n\n        if (p.Next.Node == node) {\n          rc = true;\n          var n = p.Next;\n\n          if (p == n) {\n            // list goes to empty\n            nodes = null;\n          }\n          else {\n            if (nodes == n) nodes = p;\n            p.Next = n.Next;\n          }\n        }\n      }\n\n      return rc;\n    }\n  }\n#if DEBUG_DUMP\n  public void ShowQuadTree(Canvas container) {\n    if (this.root != null) {\n      this.root.ShowQuadTree(container);\n    }\n  }\n\n  public void Dump(LogWriter w) {\n    if (this.root != null) {\n      this.root.Dump(w);\n    }\n  }\n#endif\n}\n\n#if DEBUG_DUMP\npublic class LogWriter : IDisposable {\n  XmlWriter xw;\n  int indent;\n  int maxdepth;\n\n  public LogWriter(TextWriter w) {\n    XmlWriterSettings s = new XmlWriterSettings();\n    s.Indent = true;\n    this.xw = XmlWriter.Create(w, s);\n  }\n\n  public int MaxDepth {\n    get {\n      return this.maxdepth;\n    }\n  }\n\n  public void Open(string label) {\n    this.xw.WriteStartElement(label);\n    this.indent++;\n    if (this.indent > this.maxdepth) this.maxdepth = this.indent;\n  }\n\n  public void Close() {\n    this.indent--;\n    this.xw.WriteEndElement();\n  }\n\n  public void WriteAttribute(string name, string value) {\n    this.xw.WriteAttributeString(name, value);\n  }\n\n#region IDisposable Members\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  protected virtual void Dispose(bool disposing) {\n    if (disposing && this.xw != null) {\n      using (this.xw) {\n        this.xw.Flush();\n      }\n\n      this.xw = null;\n    }\n  }\n\n#endregion\n}\n#endif"
  },
  {
    "path": "src/ProfileExplorerUI/Profile/Utils/SourceFileFinder.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.IO.Enumeration;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Document;\n\npublic class SourceFileFinder {\n  public enum FailureReason {\n    None,\n    DebugInfoNotFound,\n    FileNotFound,\n    MappingDisabled,\n    MappingCanceled\n  }\n\n  private SourceFileMapper sourceFileMapper_;\n  private List<string> disabledSourceMappings_;\n  private IUISession session_;\n  private bool disableOpenDialog_;\n\n  public SourceFileFinder(IUISession session) {\n    session_ = session;\n  }\n\n  public void LoadSettings(SourceFileFinderSettings settings) {\n    disabledSourceMappings_ = settings.DisabledSourceMappings;\n    sourceFileMapper_ = new SourceFileMapper(settings.SourceMappings.CloneDictionary());\n  }\n\n  public void SaveSettings(SourceFileFinderSettings settings) {\n    settings.SourceMappings = sourceFileMapper_.SourceMap.CloneDictionary();\n    settings.DisabledSourceMappings = disabledSourceMappings_;\n    App.SaveApplicationSettings();\n  }\n\n  public async Task<(SourceFileDebugInfo, FailureReason)>\n    FindLocalSourceFile(SourceFileDebugInfo sourceInfo) {\n    return FindLocalSourceFile(sourceInfo, null);\n  }\n\n  public async Task<(SourceFileDebugInfo, FailureReason)>\n    FindLocalSourceFile(IRTextFunction function) {\n    return await Task.Run(async () => {\n      var debugInfo = await session_.GetDebugInfoProvider(function).ConfigureAwait(false);\n\n      if (debugInfo == null) {\n        return (SourceFileDebugInfo.Unknown, FailureReason.DebugInfoNotFound);\n      }\n\n      // First get the source file path from the debug file (this may download it\n      // from a source file server, if enabled). If the file path is not found\n      // on this machine, try to map it to a local path either automatically\n      // or by asking the user to manually locate the source file.\n      var sourceInfo = SourceFileDebugInfo.Unknown;\n      var funcProfile = session_.ProfileData?.GetFunctionProfile(function);\n\n      if (funcProfile != null) {\n        // Try precise function mapping from profiling data first.\n        sourceInfo = LocateSourceFile(funcProfile, debugInfo);\n      }\n\n      if (sourceInfo.IsUnknown) {\n        // Try again using the function name.\n        sourceInfo = debugInfo.FindFunctionSourceFilePath(function);\n      }\n\n      if (sourceInfo.HasFilePath) {\n        return FindLocalSourceFile(sourceInfo, debugInfo);\n      }\n\n      return (SourceFileDebugInfo.Unknown, FailureReason.FileNotFound);\n    });\n  }\n\n  private (SourceFileDebugInfo, FailureReason)\n    FindLocalSourceFile(SourceFileDebugInfo sourceInfo, IDebugInfoProvider debugInfo) {\n    // Check if the file can be found. If it's from another machine,\n    // a mapping is done after the user is asked to pick the new location of the file.\n    if (File.Exists(sourceInfo.FilePath)) {\n      // This assumes that a checksum match was done already\n      // and this is the right source file.\n      return (sourceInfo, FailureReason.None);\n    }\n    else if (!IsDisabledSourceFilePath(sourceInfo.FilePath)) {\n      string filePath = sourceFileMapper_.Map(sourceInfo.FilePath, () => {\n        if (disableOpenDialog_ || App.SuppressDialogsForAutomation) {\n          return null; // Open File dialog disabled for current session or MCP automation.\n        }\n\n        return Utils.ShowOpenFileDialog(\n          $\"Source File|{Utils.TryGetFileName(sourceInfo.OriginalFilePath)}\",\n          null, $\"Open {sourceInfo.OriginalFilePath}\");\n      });\n\n      if (!string.IsNullOrEmpty(filePath)) {\n        sourceInfo.FilePath = filePath;\n      }\n      else if (!disableOpenDialog_ && !App.SuppressDialogsForAutomation) {\n        var result = Utils.ShowYesNoCancelMessageBox(\"\"\"\n                                                     Continue asking for the location of this source file?\n\n                                                     Press Cancel to stop showing the Open File dialog during the current session for all source files that cannot be found.\n                                                     \"\"\", null);\n        if (result == MessageBoxResult.No ||\n            result == MessageBoxResult.Cancel) {\n          if (!disabledSourceMappings_.Contains(sourceInfo.FilePath)) {\n            disabledSourceMappings_.Add(sourceInfo.FilePath);\n          }\n\n          if (result == MessageBoxResult.Cancel) {\n            disableOpenDialog_ = true; // Stop showing open dialog for current session.\n          }\n        }\n      }\n\n      if (File.Exists(sourceInfo.FilePath)) {\n        return (sourceInfo, FailureReason.None);\n      }\n      else {\n        return (sourceInfo, FailureReason.MappingCanceled);\n      }\n    }\n    else {\n      return (sourceInfo, FailureReason.MappingDisabled);\n    }\n  }\n\n  private bool IsDisabledSourceFilePath(string filePath) {\n    foreach (string path in disabledSourceMappings_) {\n      // Do a case-insensitive wildcard (*) match.\n      if (path.Equals(filePath, StringComparison.OrdinalIgnoreCase) ||\n          FileSystemName.MatchesSimpleExpression(path, filePath)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  public void Reset() {\n    disabledSourceMappings_.Clear();\n    sourceFileMapper_.Reset();\n    disableOpenDialog_ = false;\n  }\n\n  public void ResetDisabledMappings() {\n    disabledSourceMappings_.Clear();\n    disableOpenDialog_ = false;\n  }\n\n  public void ResetDisabledMappings(string filePath) {\n    disabledSourceMappings_.Remove(filePath);\n    disableOpenDialog_ = false;\n  }\n\n  private SourceFileDebugInfo LocateSourceFile(FunctionProfileData funcProfile,\n                                               IDebugInfoProvider debugInfo) {\n    // Lookup function by RVA, more precise.\n    if (funcProfile.FunctionDebugInfo != null) {\n      return debugInfo.FindSourceFilePathByRVA(funcProfile.FunctionDebugInfo.RVA);\n    }\n\n    return SourceFileDebugInfo.Unknown;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/ProfileExplorerUI.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk.WindowsDesktop\">\n\n\t<PropertyGroup>\n\t\t<OutputType>WinExe</OutputType>\n\t\t<TargetFramework>net8.0-windows</TargetFramework>\n\t\t<UseWPF>true</UseWPF>\n\t\t<ApplicationIcon>main.ico</ApplicationIcon>\n\t\t<AssemblyVersion>1.2.1</AssemblyVersion>\n\t\t<FileVersion>1.2.1</FileVersion>\n\t\t<Version>1.2.1</Version>\n\t\t<Authors></Authors>\n\t\t<Company>Microsoft Corporation</Company>\n\t\t<Product>Profile Explorer</Product>\n\t\t<ApplicationManifest>app.manifest</ApplicationManifest>\n\t\t<AssemblyName>ProfileExplorer</AssemblyName>\n\t\t<Platforms>AnyCPU;ARM64</Platforms>\n\t\t<LangVersion>default</LangVersion>\n\t\t<RootNamespace>ProfileExplorer.UI</RootNamespace>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<ServerGarbageCollection>true</ServerGarbageCollection>\n\t\t<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>\n\t\t<GCHeapCount>16</GCHeapCount>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|AnyCPU'\">\n\t\t<OutputPath></OutputPath>\n\t\t<PlatformTarget>x64</PlatformTarget>\n\t\t<DebugType>full</DebugType>\n\t\t<DebugSymbols>true</DebugSymbols>\n\t\t<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|ARM64'\">\n\t\t<OutputPath />\n\t\t<PlatformTarget>ARM64</PlatformTarget>\n\t\t<DebugType>full</DebugType>\n\t\t<DebugSymbols>true</DebugSymbols>\n\t\t<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|AnyCPU'\">\n\t\t<OutputPath></OutputPath>\n\t\t<PlatformTarget>x64</PlatformTarget>\n\t\t<DefineConstants>TRACE</DefineConstants>\n\t\t<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n\t</PropertyGroup>\n\n\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|ARM64'\">\n\t\t<OutputPath />\n\t\t<PlatformTarget>ARM64</PlatformTarget>\n\t\t<DefineConstants>TRACE</DefineConstants>\n\t\t<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n\t</PropertyGroup>\n\n\t<PropertyGroup>\n\t\t<Copyright>Microsoft Corporation</Copyright>\n\t\t<StartupObject>ProfileExplorer.UI.App</StartupObject>\n\t\t<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>\n\t\t<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>\n\t\t<SignAssembly>false</SignAssembly>\n\t\t<RunAnalyzersDuringLiveAnalysis>False</RunAnalyzersDuringLiveAnalysis>\n\t\t<AnalysisLevel>none</AnalysisLevel>\n\t\t<PlatformTarget>AnyCPU</PlatformTarget>\n\t\t<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n\t</PropertyGroup>\n\n\t<ItemGroup>\n\t\t<Compile Remove=\"Themes\\**\" />\n\t\t<EmbeddedResource Remove=\"Themes\\**\" />\n\t\t<None Remove=\"Themes\\**\" />\n\t\t<Page Remove=\"Themes\\**\" />\n\t\t<Page Update=\"Profile\\CallTreeNodePanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Controls\\WebViewPopup.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\FlameGraphOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\TimelineOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\CallTreeOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\SourceFileOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\GeneralOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\ColumnOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\ProfilingOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\PreviewPopupOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\FunctionMarkingOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\SymbolOptionsPanel.xaml\">\n\t\t\t<Generator>MSBuild:Compile</Generator>\n\t\t\t<XamlRuntime>Wpf</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Profile\\Document\\DocumentColumns.xaml\">\n\t\t  <Generator>MSBuild:Compile</Generator>\n\t\t  <XamlRuntime>Wpf</XamlRuntime>\n\t\t  <SubType>Designer</SubType>\n\t\t</Page>\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<None Remove=\"refresh.png\" />\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<PackageReference Include=\"Autoupdater.NET.Official\" Version=\"1.9.2\" />\n\t\t<PackageReference Include=\"AvalonEdit\" Version=\"6.3.0.90\" />\n\t\t<PackageReference Include=\"ClosedXML\" Version=\"0.104.1\" />\n\t\t<PackageReference Include=\"CS-Script.Core\" Version=\"2.0.0\" />\n\t\t<PackageReference Include=\"DiffPlex\" Version=\"1.7.2\" />\n\t\t<PackageReference Include=\"Dirkster.AvalonDock\" Version=\"4.72.1\" />\n\t\t<PackageReference Include=\"Dirkster.AvalonDock.Themes.Aero\" Version=\"4.72.1\" />\n\t\t<PackageReference Include=\"Dirkster.AvalonDock.Themes.Metro\" Version=\"4.72.1\" />\n\t\t<PackageReference Include=\"Dirkster.AvalonDock.Themes.VS2010\" Version=\"4.72.1\" />\n\t\t<PackageReference Include=\"Dirkster.AvalonDock.Themes.VS2013\" Version=\"4.72.1\" />\n\t\t<PackageReference Include=\"DotNetProjects.Extended.Wpf.Toolkit\" Version=\"5.0.115\" />\n\t\t<PackageReference Include=\"DotNetProjects.WpfToolkit.Input\" Version=\"6.1.94\" />\n\t\t<PackageReference Include=\"Google.Protobuf\" Version=\"3.28.3\" />\n\t\t<PackageReference Include=\"Grpc\" Version=\"2.46.6\" />\n\t\t<PackageReference Include=\"Grpc.Core\" Version=\"2.46.6\" />\n\t\t<PackageReference Include=\"Grpc.Core.Api\" Version=\"2.66.0\" />\n\t\t<PackageReference Include=\"Grpc.Tools\" Version=\"2.67.0\">\n\t\t\t<PrivateAssets>all</PrivateAssets>\n\t\t\t<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n\t\t</PackageReference>\n\t\t<PackageReference Include=\"Microsoft.CodeAnalysis.Common\" Version=\"4.11.0\" />\n\t\t<PackageReference Include=\"Microsoft.CodeAnalysis.CSharp\" Version=\"4.11.0\" />\n\t\t<PackageReference Include=\"Microsoft.CodeAnalysis.CSharp.Features\" Version=\"4.11.0\" />\n\t\t<PackageReference Include=\"Microsoft.Diagnostics.Runtime\" Version=\"4.0.0-beta.24314.3\" />\n\t\t<PackageReference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent\" Version=\"3.1.30\" />\n\t\t<PackageReference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent.SupportFiles\" Version=\"1.0.23\" />\n\t\t<PackageReference Include=\"Microsoft.VisualStudio.SDK.Analyzers\" Version=\"17.7.47\">\n\t\t\t<PrivateAssets>all</PrivateAssets>\n\t\t\t<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n\t\t</PackageReference>\n\t\t<PackageReference Include=\"Microsoft.VisualStudio.Threading.Analyzers\" Version=\"17.11.20\">\n\t\t\t<PrivateAssets>all</PrivateAssets>\n\t\t\t<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n\t\t</PackageReference>\n\t\t<PackageReference Include=\"Microsoft.Web.WebView2\" Version=\"1.0.2849.39\" />\n\t\t<PackageReference Include=\"Microsoft.Xaml.Behaviors.Wpf\" Version=\"1.1.135\" />\n\t\t<PackageReference Include=\"OxyPlot.Wpf\" Version=\"2.2.0\" />\n\t\t<PackageReference Include=\"protobuf-net\" Version=\"3.2.45\" />\n\t\t<PackageReference Include=\"System.IO\" Version=\"4.3.0\" />\n\t\t<PackageReference Include=\"HtmlAgilityPack\" Version=\"1.11.68\" />\n\t\t<PackageReference Include=\"System.Text.Json\" Version=\"9.0.8\" />\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<ProjectReference Include=\"..\\GrpcLib\\GrpcLib.csproj\" />\n\t\t<ProjectReference Include=\"..\\external\\TreeListView\\TreeListView.csproj\" />\n\t\t<ProjectReference Include=\"..\\ProfileExplorerCore\\ProfileExplorerCore.csproj\" />\n\t\t<ProjectReference Include=\"..\\ProfileExplorer.Mcp\\ProfileExplorer.Mcp.csproj\" />\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<Compile Update=\"OptionsPanels\\ExpressionGraphOptionsPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"OptionsPanels\\FlowGraphOptionsPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\ModuleReportPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Profile\\CallTreePanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\ScriptingPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\PassOutputPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\NotesPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Properties\\Resources.Designer.cs\">\n\t\t\t<DesignTime>True</DesignTime>\n\t\t\t<AutoGen>True</AutoGen>\n\t\t\t<DependentUpon>Resources.resx</DependentUpon>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\IRInfoPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\ReferencesPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\SourceFilePanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\SectionPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Panels\\BookmarksPanel.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t\t<Compile Update=\"Properties\\Settings.Designer.cs\">\n\t\t\t<DesignTimeSharedInput>True</DesignTimeSharedInput>\n\t\t\t<AutoGen>True</AutoGen>\n\t\t\t<DependentUpon>Settings.settings</DependentUpon>\n\t\t</Compile>\n\t\t<Compile Update=\"Query\\InputQueryViewElement.xaml.cs\">\n\t\t\t<SubType>Code</SubType>\n\t\t</Compile>\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<EmbeddedResource Update=\"Properties\\Resources.resx\">\n\t\t\t<Generator>ResXFileCodeGenerator</Generator>\n\t\t\t<LastGenOutput>Resources.Designer.cs</LastGenOutput>\n\t\t</EmbeddedResource>\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<None Update=\"Properties\\Settings.settings\">\n\t\t\t<Generator>SettingsSingleFileGenerator</Generator>\n\t\t\t<LastGenOutput>Settings.Designer.cs</LastGenOutput>\n\t\t</None>\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<Page Update=\"Controls\\IconSelector.xaml\">\n\t\t\t<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>\n\t\t</Page>\n\t\t<Page Update=\"Controls\\IRDocumentPopup.xaml\">\n\t\t\t<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\LightDocumentOptionsPanel.xaml\">\n\t\t\t<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\ExpressionGraphOptionsPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"OptionsPanels\\FlowGraphOptionsPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\ModuleReportPanel.xaml\">\n\t\t\t<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Profile\\CallTreePanel.xaml\">\n\t\t\t<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\ScriptingPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\PassOutputPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\NotesPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\IRInfoPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\ReferencesPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\SourceFilePanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\SectionPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Panels\\BookmarksPanel.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Query\\InputQueryViewElement.xaml\">\n\t\t\t<SubType>Designer</SubType>\n\t\t</Page>\n\t\t<Page Update=\"Converters.xaml\">\n\t\t\t<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>\n\t\t</Page>\n\t\t<Page Update=\"Windows\\ProfileLoadWindow.xaml\">\n\t\t\t<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>\n\t\t</Page>\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<Reference Include=\"Microsoft.Diagnostics.Tracing.TraceEvent.SymbolsAuthentication\">\n\t\t\t<HintPath>..\\external\\Microsoft.Diagnostics.Tracing.TraceEvent.SymbolsAuthentication.dll</HintPath>\n\t\t</Reference>\n\t</ItemGroup>\n\n\t<!-- Copy msdia140.dll to output root so COM registration path (AppContext.BaseDirectory) works -->\n\t<ItemGroup Condition=\"'$(Platform)' == 'ARM64'\">\n\t\t<Content Include=\"..\\external\\arm64\\msdia140.dll\">\n\t\t\t<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n\t\t\t<Link>msdia140.dll</Link>\n\t\t</Content>\n\t</ItemGroup>\n\t<ItemGroup Condition=\"'$(Platform)' != 'ARM64'\">\n\t\t<Content Include=\"..\\external\\msdia140.dll\">\n\t\t\t<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>\n\t\t\t<Link>msdia140.dll</Link>\n\t\t</Content>\n\t</ItemGroup>\n\n\n</Project>\n"
  },
  {
    "path": "src/ProfileExplorerUI/ProfileStyles.xaml",
    "content": "﻿<ResourceDictionary\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:oxy=\"http://oxyplot.org/wpf\"\n  xmlns:profile=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  xmlns:callTree=\"clr-namespace:ProfileExplorer.Core.Profile.CallTree;assembly=ProfileExplorerCore\"\n  xmlns:system=\"clr-namespace:System;assembly=System.Runtime\">\n\n  <system:Boolean x:Key=\"TrueBool\">True</system:Boolean>\n  <SolidColorBrush\n    x:Key=\"ProfilePercentageBackBrush\"\n    Color=\"#66FFFFFF\" />\n  <SolidColorBrush\n    x:Key=\"ProfilePercentageBrush\"\n    Color=\"#88eb8888\" />\n  <SolidColorBrush\n    x:Key=\"ProfilePercentageExclusiveBrush\"\n    Color=\"#88A6C8F1\" />\n  <SolidColorBrush\n    x:Key=\"ProfileUncategorizedBrush\"\n    Color=\"#FFA6C8F1\" />\n\n  <DataTemplate x:Key=\"TimePercentageColumnValueTemplate\">\n    <Border\n      Margin=\"-5,-1,-8,1\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{Binding BackColor}\"\n      BorderBrush=\"{Binding BorderBrush}\"\n      BorderThickness=\"{Binding BorderThickness}\">\n      <StackPanel Orientation=\"Horizontal\">\n        <Image\n          Width=\"Auto\"\n          Height=\"Auto\"\n          Margin=\"4,0,2,1\"\n          VerticalAlignment=\"Stretch\"\n          Source=\"{Binding Icon}\"\n          Stretch=\"Uniform\"\n          ToolTip=\"{Binding ToolTip}\"\n          Visibility=\"{Binding Path=ShowIcon, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n        <TextBlock\n          MinWidth=\"{Binding MinTextWidth}\"\n          Margin=\"4,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"{Binding TextWeight}\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding Text}\"\n          ToolTip=\"{Binding ToolTip}\" />\n\n        <Rectangle\n          Height=\"Auto\"\n          Margin=\"4,0,2,0\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Stretch\"\n          Fill=\"{Binding PercentageBarBackColor}\"\n          Stroke=\"{Binding PercentageBarBorderBrush}\"\n          StrokeThickness=\"{Binding PercentageBarBorderThickness}\"\n          ToolTip=\"{Binding ToolTip}\"\n          Visibility=\"{Binding Path=ShowPercentageBar, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <Rectangle.Width>\n            <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n              <Binding Path=\"ValuePercentage\" />\n              <Binding\n                FallbackValue=\"50.0\"\n                Path=\"PercentageBarMaxWidth\" />\n            </MultiBinding>\n          </Rectangle.Width>\n        </Rectangle>\n      </StackPanel>\n    </Border>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"ProfileMenuItemValueTemplate\">\n    <Border\n      Padding=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{Binding BackColor}\"\n      BorderBrush=\"{Binding BorderBrush}\"\n      BorderThickness=\"{Binding BorderThickness}\">\n      <StackPanel Orientation=\"Horizontal\">\n        <TextBlock\n          MinWidth=\"{Binding MinTextWidth}\"\n          Margin=\"0,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"{Binding TextWeight}\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding PrefixText}\"\n          ToolTip=\"{Binding ToolTip}\" />\n        <Rectangle\n          Height=\"Auto\"\n          Margin=\"4,0,2,0\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Stretch\"\n          Fill=\"{Binding PercentageBarBackColor}\"\n          Stroke=\"{Binding PercentageBarBorderBrush}\"\n          StrokeThickness=\"{Binding PercentageBarBorderThickness}\"\n          ToolTip=\"{Binding ToolTip}\"\n          Visibility=\"{Binding Path=ShowPercentageBar, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <Rectangle.Width>\n            <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n              <Binding Path=\"ValuePercentage\" />\n              <Binding\n                FallbackValue=\"50.0\"\n                Path=\"PercentageBarMaxWidth\" />\n            </MultiBinding>\n          </Rectangle.Width>\n        </Rectangle>\n        <TextBlock\n          Margin=\"4,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"{Binding TextWeight}\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding ValuePercentage, StringFormat=p2}\"\n          ToolTip=\"{Binding ToolTip}\" />\n        <TextBlock\n          Margin=\"6,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"{Binding TextWeight}\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding Text}\"\n          ToolTip=\"{Binding ToolTip}\" />\n      </StackPanel>\n    </Border>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"CheckableProfileMenuItemValueTemplate\">\n    <Border\n      Padding=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      BorderBrush=\"{Binding BorderBrush}\"\n      BorderThickness=\"{Binding BorderThickness}\">\n      <StackPanel Orientation=\"Horizontal\">\n        <Border\n          Width=\"16\"\n          Height=\"16\"\n          Background=\"{Binding BackColor}\"\n          BorderBrush=\"Black\"\n          BorderThickness=\"1\" />\n        <TextBlock\n          MinWidth=\"{Binding MinTextWidth}\"\n          Margin=\"4,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"Medium\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding PrefixText}\"\n          ToolTip=\"{Binding ToolTip}\" />\n        <Rectangle\n          Height=\"Auto\"\n          Margin=\"4,0,2,0\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Stretch\"\n          Fill=\"{Binding PercentageBarBackColor}\"\n          Stroke=\"{Binding PercentageBarBorderBrush}\"\n          StrokeThickness=\"{Binding PercentageBarBorderThickness}\"\n          ToolTip=\"{Binding ToolTip}\"\n          Visibility=\"{Binding Path=ShowPercentageBar, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <Rectangle.Width>\n            <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n              <Binding Path=\"ValuePercentage\" />\n              <Binding\n                FallbackValue=\"50.0\"\n                Path=\"PercentageBarMaxWidth\" />\n            </MultiBinding>\n          </Rectangle.Width>\n        </Rectangle>\n        <TextBlock\n          Margin=\"4,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"Medium\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding ValuePercentage, StringFormat=p2}\"\n          ToolTip=\"{Binding ToolTip}\" />\n        <TextBlock\n          Margin=\"6,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"{Binding TextWeight}\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding Text}\"\n          ToolTip=\"{Binding ToolTip}\" />\n      </StackPanel>\n    </Border>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"CategoriesProfileMenuItemValueTemplate\">\n    <Border\n      Padding=\"0\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      BorderBrush=\"{Binding BorderBrush}\"\n      BorderThickness=\"{Binding BorderThickness}\">\n      <StackPanel\n        Margin=\"-10,0,0,0\"\n        Orientation=\"Horizontal\">\n        <TextBlock\n          MinWidth=\"{Binding MinTextWidth}\"\n          Margin=\"4,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"Medium\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding PrefixText}\"\n          ToolTip=\"{Binding ToolTip}\" />\n        <Rectangle\n          Height=\"Auto\"\n          Margin=\"4,0,2,0\"\n          HorizontalAlignment=\"Left\"\n          VerticalAlignment=\"Stretch\"\n          Fill=\"{Binding PercentageBarBackColor}\"\n          Stroke=\"{Binding PercentageBarBorderBrush}\"\n          StrokeThickness=\"{Binding PercentageBarBorderThickness}\"\n          ToolTip=\"{Binding ToolTip}\"\n          Visibility=\"{Binding Path=ShowPercentageBar, Converter={StaticResource BoolToVisibilityConverter}}\">\n          <Rectangle.Width>\n            <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n              <Binding Path=\"ValuePercentage\" />\n              <Binding\n                FallbackValue=\"50.0\"\n                Path=\"PercentageBarMaxWidth\" />\n            </MultiBinding>\n          </Rectangle.Width>\n        </Rectangle>\n        <TextBlock\n          Margin=\"4,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"Medium\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding ValuePercentage, StringFormat=p2}\"\n          ToolTip=\"{Binding ToolTip}\" />\n        <TextBlock\n          Margin=\"6,0,2,0\"\n          VerticalAlignment=\"Center\"\n          FontFamily=\"{Binding TextFont}\"\n          FontSize=\"{Binding TextSize}\"\n          FontWeight=\"{Binding TextWeight}\"\n          Foreground=\"{Binding TextColor}\"\n          Text=\"{Binding Text}\"\n          ToolTip=\"{Binding ToolTip}\" />\n      </StackPanel>\n    </Border>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"TimeColumnValueTemplate\">\n    <Border\n      Margin=\"-5,0,-8,0\"\n      HorizontalAlignment=\"Stretch\"\n      VerticalAlignment=\"Stretch\"\n      Background=\"{Binding BackColor}\"\n      BorderBrush=\"{Binding BorderBrush}\"\n      BorderThickness=\"{Binding BorderThickness}\">\n      <TextBlock\n        VerticalAlignment=\"Center\"\n        FontFamily=\"Consolas\"\n        FontSize=\"12\"\n        FontWeight=\"{Binding TextWeight}\"\n        Foreground=\"{Binding TextColor}\"\n        Text=\"{Binding Text}\"\n        ToolTip=\"{Binding ToolTip}\" />\n    </Border>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"ProfilePercentageTemplate\">\n    <Grid HorizontalAlignment=\"Stretch\">\n      <TextBlock\n        Width=\"45\"\n        HorizontalAlignment=\"Left\"\n        VerticalAlignment=\"Center\"\n        FontWeight=\"Medium\"\n        Text=\"{Binding Path=Percentage, Converter={StaticResource PercentageConverter}}\"\n        ToolTip=\"{Binding Weight, Converter={StaticResource MillisecondTimeConverter}}\">\n        <TextBlock.Style>\n          <Style TargetType=\"{x:Type TextBlock}\">\n            <Style.Triggers>\n              <DataTrigger\n                Binding=\"{Binding Path=IsMarked}\"\n                Value=\"True\">\n                <Setter Property=\"FontWeight\" Value=\"Bold\" />\n              </DataTrigger>\n            </Style.Triggers>\n          </Style>\n        </TextBlock.Style>\n      </TextBlock>\n\n      <Border\n        x:Name=\"RectBorder\"\n        Height=\"16\"\n        Margin=\"50,0,0,1\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Center\"\n        Background=\"{StaticResource ProfilePercentageBackBrush}\"\n        BorderBrush=\"Black\"\n        BorderThickness=\"0.5\"\n        CornerRadius=\"0\">\n        <Grid>\n          <Border\n            Height=\"16\"\n            HorizontalAlignment=\"Left\"\n            Background=\"{StaticResource ProfilePercentageBrush}\"\n            CornerRadius=\"0\">\n            <Border.Width>\n              <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n                <Binding Path=\"Percentage\" />\n                <Binding\n                  Path=\"ActualWidth\"\n                  RelativeSource=\"{RelativeSource Mode=FindAncestor,\n                                                  AncestorType=Border}\" />\n              </MultiBinding>\n            </Border.Width>\n          </Border>\n\n          <TextBlock\n            Margin=\"4,0,2,0\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding Weight, Converter={StaticResource MillisecondTimeConverter}}\"\n            TextTrimming=\"CharacterEllipsis\"\n            ToolTip=\"{Binding Percentage, Converter={StaticResource PercentageConverter}}\" />\n        </Grid>\n      </Border>\n    </Grid>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"ProfileExclusivePercentageTemplate\">\n    <Grid HorizontalAlignment=\"Stretch\">\n      <TextBlock\n        Width=\"45\"\n        HorizontalAlignment=\"Left\"\n        VerticalAlignment=\"Center\"\n        FontWeight=\"Medium\"\n        Text=\"{Binding Path=ExclusivePercentage, Converter={StaticResource PercentageConverter}}\"\n        ToolTip=\"{Binding ExclusiveWeight, Converter={StaticResource MillisecondTimeConverter}}\" />\n      <Border\n        Height=\"16\"\n        Margin=\"50,0,0,1\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Center\"\n        Background=\"{StaticResource ProfilePercentageBackBrush}\"\n        BorderBrush=\"Black\"\n        BorderThickness=\"0.5\"\n        CornerRadius=\"0\">\n        <Grid>\n          <Border\n            Height=\"16\"\n            HorizontalAlignment=\"Left\"\n            Background=\"{StaticResource ProfilePercentageExclusiveBrush}\"\n            CornerRadius=\"0\">\n            <Border.Width>\n              <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n                <Binding Path=\"ExclusivePercentage\" />\n                <Binding\n                  Path=\"ActualWidth\"\n                  RelativeSource=\"{RelativeSource Mode=FindAncestor,\n                                                  AncestorType=Border}\" />\n              </MultiBinding>\n            </Border.Width>\n          </Border>\n\n          <TextBlock\n            Margin=\"4,0,2,0\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding ExclusiveWeight, Converter={StaticResource MillisecondTimeConverter}}\"\n            TextTrimming=\"CharacterEllipsis\"\n            ToolTip=\"{Binding ExclusivePercentage, Converter={StaticResource PercentageConverter}}\" />\n        </Grid>\n      </Border>\n    </Grid>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"ModulePercentageTemplate\">\n    <Grid HorizontalAlignment=\"Stretch\">\n      <TextBlock\n        Width=\"45\"\n        HorizontalAlignment=\"Left\"\n        VerticalAlignment=\"Center\"\n        Background=\"{Binding BackColor}\"\n        FontWeight=\"Medium\"\n        Text=\"{Binding Path=ExclusivePercentage, Converter={StaticResource PercentageConverter}}\"\n        ToolTip=\"{Binding ExclusiveWeight, Converter={StaticResource MillisecondTimeConverter}}\" />\n      <Border\n        Height=\"16\"\n        Margin=\"50,0,0,1\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Center\"\n        Background=\"{StaticResource ProfilePercentageBackBrush}\"\n        BorderBrush=\"Black\"\n        BorderThickness=\"0.5\"\n        CornerRadius=\"0\">\n        <Grid>\n          <Border\n            Height=\"16\"\n            HorizontalAlignment=\"Left\"\n            Background=\"{StaticResource ProfilePercentageExclusiveBrush}\"\n            CornerRadius=\"0\">\n            <Border.Width>\n              <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n                <Binding Path=\"ExclusivePercentage\" />\n                <Binding\n                  Path=\"ActualWidth\"\n                  RelativeSource=\"{RelativeSource Mode=FindAncestor,\n                                                  AncestorType=Border}\" />\n              </MultiBinding>\n            </Border.Width>\n          </Border>\n\n          <TextBlock\n            Margin=\"4,0,2,0\"\n            HorizontalAlignment=\"Left\"\n            VerticalAlignment=\"Center\"\n            Text=\"{Binding ExclusiveWeight, Converter={StaticResource MillisecondTimeConverter}}\"\n            TextTrimming=\"CharacterEllipsis\"\n            ToolTip=\"{Binding ExclusivePercentage, Converter={StaticResource PercentageConverter}}\" />\n        </Grid>\n      </Border>\n    </Grid>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"ProfileCombinedPercentageTemplate\">\n    <Grid HorizontalAlignment=\"Stretch\">\n      <TextBlock\n        Width=\"45\"\n        HorizontalAlignment=\"Left\"\n        VerticalAlignment=\"Center\"\n        FontWeight=\"Medium\"\n        Text=\"{Binding Path=Percentage, Converter={StaticResource PercentageConverter}}\"\n        ToolTip=\"{Binding Weight, Converter={StaticResource MillisecondTimeConverter}}\">\n        <TextBlock.Style>\n          <Style TargetType=\"{x:Type TextBlock}\">\n            <Style.Triggers>\n              <DataTrigger\n                Binding=\"{Binding Path=IsMarked}\"\n                Value=\"True\">\n                <Setter Property=\"FontWeight\" Value=\"Bold\" />\n              </DataTrigger>\n            </Style.Triggers>\n          </Style>\n        </TextBlock.Style>\n      </TextBlock>\n\n      <Border\n        Height=\"16\"\n        Margin=\"50,0,0,1\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Center\"\n        Background=\"{StaticResource ProfilePercentageBackBrush}\"\n        BorderBrush=\"Black\"\n        BorderThickness=\"0.5\"\n        CornerRadius=\"0\">\n        <Grid>\n          <StackPanel\n            HorizontalAlignment=\"Left\"\n            Orientation=\"Horizontal\">\n            <Border\n              Height=\"16\"\n              HorizontalAlignment=\"Left\"\n              Background=\"{StaticResource ProfilePercentageExclusiveBrush}\"\n              CornerRadius=\"0\">\n              <Border.Width>\n                <MultiBinding Converter=\"{StaticResource DoubleScalingBoundConverter}\">\n                  <Binding Path=\"ExclusivePercentage\" />\n                  <Binding\n                    Path=\"ActualWidth\"\n                    RelativeSource=\"{RelativeSource Mode=FindAncestor,\n                                                    AncestorType=Border}\" />\n                </MultiBinding>\n              </Border.Width>\n            </Border>\n\n            <Border\n              Height=\"16\"\n              HorizontalAlignment=\"Left\"\n              Background=\"{StaticResource ProfilePercentageBrush}\"\n              CornerRadius=\"0\">\n              <Border.Width>\n                <MultiBinding Converter=\"{StaticResource DoubleDiffScalingBoundConverter}\">\n                  <Binding Path=\"ExclusivePercentage\" />\n                  <Binding Path=\"Percentage\" />\n                  <Binding\n                    Path=\"ActualWidth\"\n                    RelativeSource=\"{RelativeSource Mode=FindAncestor,\n                                                    AncestorType=Border}\" />\n                </MultiBinding>\n              </Border.Width>\n            </Border>\n          </StackPanel>\n\n          <StackPanel\n            Margin=\"2,0,0,0\"\n            Orientation=\"Horizontal\">\n            <TextBlock\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Text=\"{Binding Weight, Converter={StaticResource MillisecondTimeConverter}}\"\n              TextTrimming=\"CharacterEllipsis\" />\n            <TextBlock Text=\", \" />\n            <TextBlock\n              Margin=\"2,0,2,0\"\n              HorizontalAlignment=\"Left\"\n              VerticalAlignment=\"Center\"\n              Foreground=\"Black\"\n              Text=\"{Binding Path=ExclusivePercentage, Converter={StaticResource ExclusivePercentageConverter}}\"\n              ToolTip=\"{Binding ExclusiveWeight, Converter={StaticResource MillisecondTimeConverter}}\">\n              <TextBlock.Style>\n                <Style TargetType=\"{x:Type TextBlock}\">\n                  <Style.Triggers>\n                    <DataTrigger\n                      Binding=\"{Binding Path=IsMarked}\"\n                      Value=\"True\">\n                      <Setter Property=\"FontWeight\" Value=\"Bold\" />\n                    </DataTrigger>\n                  </Style.Triggers>\n                </Style>\n              </TextBlock.Style>\n            </TextBlock>\n          </StackPanel>\n        </Grid>\n      </Border>\n    </Grid>\n  </DataTemplate>\n\n  <DataTemplate x:Key=\"ExecutionContextTemplate\">\n    <Border\n      Width=\"16\"\n      Height=\"16\"\n      Margin=\"-4,0,-4,0\"\n      BorderBrush=\"Black\"\n      BorderThickness=\"0.5\">\n      <TextBlock\n        HorizontalAlignment=\"Center\"\n        VerticalAlignment=\"Center\"\n        FontWeight=\"Medium\"\n        Text=\"{Binding CallTreeNode.Kind, Converter={StaticResource CallTreeNodeKindConverter}, ConverterParameter={StaticResource TrueBool}}\"\n        ToolTip=\"{Binding CallTreeNode.Kind, Converter={StaticResource CallTreeNodeKindConverter}}\" />\n      <Border.Style>\n        <Style TargetType=\"{x:Type Border}\">\n          <Style.Triggers>\n            <DataTrigger\n              Binding=\"{Binding Path=CallTreeNode.Kind}\"\n              Value=\"{x:Static callTree:ProfileCallTreeNodeKind.NativeKernel}\">\n              <Setter Property=\"Background\" Value=\"#D7ECFF\" />\n            </DataTrigger>\n            <DataTrigger\n              Binding=\"{Binding Path=CallTreeNode.Kind}\"\n              Value=\"{x:Static callTree:ProfileCallTreeNodeKind.Managed}\">\n              <Setter Property=\"Background\" Value=\"MistyRose\" />\n            </DataTrigger>\n            <DataTrigger\n              Binding=\"{Binding Path=CallTreeNode.Kind}\"\n              Value=\"{x:Static callTree:ProfileCallTreeNodeKind.NativeUser}\">\n              <Setter Property=\"Opacity\" Value=\"0.5\" />\n            </DataTrigger>\n          </Style.Triggers>\n        </Style>\n      </Border.Style>\n    </Border>\n  </DataTemplate>\n\n  <ControlTemplate x:Key=\"HistogramTooltipTemplate\">\n    <oxy:TrackerControl\n      Background=\"WhiteSmoke\"\n      BorderThickness=\"1\"\n      Position=\"{Binding Position}\">\n      <oxy:TrackerControl.Content>\n        <StackPanel Margin=\"4,4,4,4\">\n          <DockPanel Background=\"WhiteSmoke\">\n            <TextBlock\n              Width=\"80\"\n              Text=\"Instances: \" />\n            <TextBlock\n              DockPanel.Dock=\"Right\"\n              FontWeight=\"Medium\"\n              Text=\"{Binding Item.Count}\" />\n          </DockPanel>\n          <DockPanel Background=\"WhiteSmoke\">\n            <TextBlock\n              Width=\"80\"\n              Text=\"Group Time: \" />\n            <TextBlock\n              DockPanel.Dock=\"Right\"\n              FontWeight=\"Medium\"\n              Text=\"{Binding Item.TotalWeight, Converter={StaticResource MillisecondTimeConverter}}\" />\n          </DockPanel>\n          <DockPanel Background=\"WhiteSmoke\">\n            <TextBlock\n              Width=\"80\"\n              Text=\"Average Time: \" />\n            <TextBlock\n              DockPanel.Dock=\"Right\"\n              FontWeight=\"Medium\"\n              Text=\"{Binding Item.AverageWeight, Converter={StaticResource MillisecondTimeConverter}}\" />\n          </DockPanel>\n        </StackPanel>\n      </oxy:TrackerControl.Content>\n    </oxy:TrackerControl>\n  </ControlTemplate>\n\n\n  <Style\n    x:Key=\"GridViewColumnHeaderGripper\"\n    TargetType=\"Thumb\">\n    <Setter Property=\"Width\" Value=\"18\" />\n    <Setter Property=\"Background\">\n      <Setter.Value>\n        <LinearGradientBrush StartPoint=\"0,0\" EndPoint=\"0,1\">\n          <LinearGradientBrush.GradientStops>\n            <GradientStopCollection>\n              <GradientStop Offset=\"0.0\" Color=\"{DynamicResource BorderLightColor}\" />\n              <GradientStop Offset=\"1.0\" Color=\"{DynamicResource BorderDarkColor}\" />\n            </GradientStopCollection>\n          </LinearGradientBrush.GradientStops>\n        </LinearGradientBrush>\n      </Setter.Value>\n    </Setter>\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"{x:Type Thumb}\">\n          <Border\n            Padding=\"{TemplateBinding Padding}\"\n            Background=\"Transparent\">\n            <Rectangle\n              Width=\"1\"\n              HorizontalAlignment=\"Center\"\n              Fill=\"{TemplateBinding Background}\" />\n          </Border>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n    <Setter Property=\"BorderBrush\">\n      <Setter.Value>\n        <LinearGradientBrush StartPoint=\"0.5,0\" EndPoint=\"0.5,1\">\n          <GradientStop Offset=\"0\" Color=\"Black\" />\n          <GradientStop Offset=\"1\" Color=\"White\" />\n        </LinearGradientBrush>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <Style\n    x:Key=\"TimeColumnHeaderTemplate\"\n    TargetType=\"GridViewColumnHeader\">\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"{x:Type GridViewColumnHeader}\">\n          <Grid\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\">\n            <Border\n              Width=\"{TemplateBinding Width}\"\n              Height=\"22\"\n              Margin=\"-1,-1,0,0\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Stretch\"\n              Background=\"{DynamicResource {x:Static SystemColors.MenuBarBrushKey}}\"\n              BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n              BorderThickness=\"0,0,1,1\">\n              <ContentPresenter\n                x:Name=\"HeaderContent\"\n                Width=\"{TemplateBinding Width}\"\n                Margin=\"4,0,4,0\"\n                HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n                VerticalAlignment=\"Center\"\n                RecognizesAccessKey=\"True\"\n                SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\" />\n            </Border>\n            <!--  <Thumb  -->\n            <!--  x:Name=\"PART_HeaderGripper\"  -->\n            <!--  Margin=\"0,0,-9,0\"  -->\n            <!--  HorizontalAlignment=\"Right\"  -->\n            <!--  Style=\"{StaticResource GridViewColumnHeaderGripper}\" />  -->\n          </Grid>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n    <Setter Property=\"OverridesDefaultStyle\" Value=\"True\" />\n    <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n  </Style>\n</ResourceDictionary>"
  },
  {
    "path": "src/ProfileExplorerUI/Properties/Resources.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace ProfileExplorer.UI.Properties {\n    using System;\n\n\n    /// <summary>\n    ///   A strongly-typed resource class, for looking up localized strings, etc.\n    /// </summary>\n    // This class was auto-generated by the StronglyTypedResourceBuilder\n    // class via a tool like ResGen or Visual Studio.\n    // To add or remove a member, edit your .ResX file then rerun ResGen\n    // with the /str option, or rebuild your VS project.\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"System.Resources.Tools.StronglyTypedResourceBuilder\", \"16.0.0.0\")]\n    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    internal class Resources {\n\n        private static global::System.Resources.ResourceManager resourceMan;\n\n        private static global::System.Globalization.CultureInfo resourceCulture;\n\n        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute(\"Microsoft.Performance\", \"CA1811:AvoidUncalledPrivateCode\")]\n        internal Resources() {\n        }\n\n        /// <summary>\n        ///   Returns the cached ResourceManager instance used by this class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Resources.ResourceManager ResourceManager {\n            get {\n                if (object.ReferenceEquals(resourceMan, null)) {\n                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(\"ProfileExplorer.UI.Properties.Resources\", typeof(Resources).Assembly);\n                    resourceMan = temp;\n                }\n                return resourceMan;\n            }\n        }\n\n        /// <summary>\n        ///   Overrides the current thread's CurrentUICulture property for all\n        ///   resource lookups using this strongly typed resource class.\n        /// </summary>\n        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]\n        internal static global::System.Globalization.CultureInfo Culture {\n            get {\n                return resourceCulture;\n            }\n            set {\n                resourceCulture = value;\n            }\n        }\n    }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Properties/Resources.resx",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n\t<!-- \n\t  Microsoft ResX Schema \n\t  \n\t  Version 2.0\n\t  \n\t  The primary goals of this format is to allow a simple XML format \n\t  that is mostly human readable. The generation and parsing of the \n\t  various data types are done through the TypeConverter classes \n\t  associated with the data types.\n\t  \n\t  Example:\n\t  \n\t  ... ado.net/XML headers & schema ...\n\t  <resheader name=\"resmimetype\">text/microsoft-resx</resheader>\n\t  <resheader name=\"version\">2.0</resheader>\n\t  <resheader name=\"reader\">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\n\t  <resheader name=\"writer\">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\n\t  <data name=\"Name1\"><value>this is my long string</value><comment>this is a comment</comment></data>\n\t  <data name=\"Color1\" type=\"System.Drawing.Color, System.Drawing\">Blue</data>\n\t  <data name=\"Bitmap1\" mimetype=\"application/x-microsoft.net.object.binary.base64\">\n\t\t  <value>[base64 mime encoded serialized .NET Framework object]</value>\n\t  </data>\n\t  <data name=\"Icon1\" type=\"System.Drawing.Icon, System.Drawing\" mimetype=\"application/x-microsoft.net.object.bytearray.base64\">\n\t\t  <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\n\t\t  <comment>This is a comment</comment>\n\t  </data>\n\t\t\t\t  \n\t  There are any number of \"resheader\" rows that contain simple \n\t  name/value pairs.\n\t  \n\t  Each data row contains a name, and value. The row also contains a \n\t  type or mimetype. Type corresponds to a .NET class that support \n\t  text/value conversion through the TypeConverter architecture. \n\t  Classes that don't support this are serialized and stored with the \n\t  mimetype set.\n\t  \n\t  The mimetype is used for serialized objects, and tells the \n\t  ResXResourceReader how to depersist the object. This is currently not \n\t  extensible. For a given mimetype the value must be set accordingly:\n\t  \n\t  Note - application/x-microsoft.net.object.binary.base64 is the format \n\t  that the ResXResourceWriter will generate, however the reader can \n\t  read any of the formats listed below.\n\t  \n\t  mimetype: application/x-microsoft.net.object.binary.base64\n\t  value   : The object must be serialized with \n\t\t\t  : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\n\t\t\t  : and then encoded with base64 encoding.\n\t  \n\t  mimetype: application/x-microsoft.net.object.soap.base64\n\t  value   : The object must be serialized with \n\t\t\t  : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\n\t\t\t  : and then encoded with base64 encoding.\n  \n\t  mimetype: application/x-microsoft.net.object.bytearray.base64\n\t  value   : The object must be serialized into a byte array \n\t\t\t  : using a System.ComponentModel.TypeConverter\n\t\t\t  : and then encoded with base64 encoding.\n\t  -->\n\t<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n\t\t\t\txmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\" id=\"root\"\n\t\t\t\txmlns=\"\">\n\t\t<xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\"/>\n\t\t<xsd:element name=\"root\" msdata:IsDataSet=\"true\">\n\t\t\t<xsd:complexType>\n\t\t\t\t<xsd:choice maxOccurs=\"unbounded\">\n\t\t\t\t\t<xsd:element name=\"metadata\">\n\t\t\t\t\t\t<xsd:complexType>\n\t\t\t\t\t\t\t<xsd:sequence>\n\t\t\t\t\t\t\t\t<xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\"/>\n\t\t\t\t\t\t\t</xsd:sequence>\n\t\t\t\t\t\t\t<xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\"/>\n\t\t\t\t\t\t\t<xsd:attribute name=\"type\" type=\"xsd:string\"/>\n\t\t\t\t\t\t\t<xsd:attribute name=\"mimetype\" type=\"xsd:string\"/>\n\t\t\t\t\t\t\t<xsd:attribute ref=\"xml:space\"/>\n\t\t\t\t\t\t</xsd:complexType>\n\t\t\t\t\t</xsd:element>\n\t\t\t\t\t<xsd:element name=\"assembly\">\n\t\t\t\t\t\t<xsd:complexType>\n\t\t\t\t\t\t\t<xsd:attribute name=\"alias\" type=\"xsd:string\"/>\n\t\t\t\t\t\t\t<xsd:attribute name=\"name\" type=\"xsd:string\"/>\n\t\t\t\t\t\t</xsd:complexType>\n\t\t\t\t\t</xsd:element>\n\t\t\t\t\t<xsd:element name=\"data\">\n\t\t\t\t\t\t<xsd:complexType>\n\t\t\t\t\t\t\t<xsd:sequence>\n\t\t\t\t\t\t\t\t<xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\"\n\t\t\t\t\t\t\t\t\t\t\t msdata:Ordinal=\"1\"/>\n\t\t\t\t\t\t\t\t<xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\"\n\t\t\t\t\t\t\t\t\t\t\t msdata:Ordinal=\"2\"/>\n\t\t\t\t\t\t\t</xsd:sequence>\n\t\t\t\t\t\t\t<xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\"\n\t\t\t\t\t\t\t\t\t\t   msdata:Ordinal=\"1\"/>\n\t\t\t\t\t\t\t<xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\"/>\n\t\t\t\t\t\t\t<xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\"/>\n\t\t\t\t\t\t\t<xsd:attribute ref=\"xml:space\"/>\n\t\t\t\t\t\t</xsd:complexType>\n\t\t\t\t\t</xsd:element>\n\t\t\t\t\t<xsd:element name=\"resheader\">\n\t\t\t\t\t\t<xsd:complexType>\n\t\t\t\t\t\t\t<xsd:sequence>\n\t\t\t\t\t\t\t\t<xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\"\n\t\t\t\t\t\t\t\t\t\t\t msdata:Ordinal=\"1\"/>\n\t\t\t\t\t\t\t</xsd:sequence>\n\t\t\t\t\t\t\t<xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\"/>\n\t\t\t\t\t\t</xsd:complexType>\n\t\t\t\t\t</xsd:element>\n\t\t\t\t</xsd:choice>\n\t\t\t</xsd:complexType>\n\t\t</xsd:element>\n\t</xsd:schema>\n\t<resheader name=\"resmimetype\">\n\t\t<value>text/microsoft-resx</value>\n\t</resheader>\n\t<resheader name=\"version\">\n\t\t<value>2.0</value>\n\t</resheader>\n\t<resheader name=\"reader\">\n\t\t<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0,\n\t\t\tCulture=neutral, PublicKeyToken=b77a5c561934e089\n\t\t</value>\n\t</resheader>\n\t<resheader name=\"writer\">\n\t\t<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0,\n\t\t\tCulture=neutral, PublicKeyToken=b77a5c561934e089\n\t\t</value>\n\t</resheader>\n\t<assembly alias=\"System.Windows.Forms\"\n\t\t\t  name=\"System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089\"/>\n</root>"
  },
  {
    "path": "src/ProfileExplorerUI/Properties/Settings.Designer.cs",
    "content": "﻿//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.42000\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\nnamespace ProfileExplorer.UI.Properties {\n\n\n    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\n    [global::System.CodeDom.Compiler.GeneratedCodeAttribute(\"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator\", \"16.7.0.0\")]\n    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\n\n        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\n\n        public static Settings Default {\n            get {\n                return defaultInstance;\n            }\n        }\n\n        [global::System.Configuration.UserScopedSettingAttribute()]\n        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\n        [global::System.Configuration.DefaultSettingValueAttribute(\"Test\")]\n        public string Data {\n            get {\n                return ((string)(this[\"Data\"]));\n            }\n            set {\n                this[\"Data\"] = value;\n            }\n        }\n    }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Properties/Settings.settings",
    "content": "﻿<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"http://schemas.microsoft.com/VisualStudio/2004/01/settings\"\n              CurrentProfile=\"(Default)\" GeneratedClassNamespace=\"Client\"\n              GeneratedClassName=\"Settings\">\n    <Profiles/>\n    <Settings>\n        <Setting Name=\"Data\" Type=\"System.String\" Scope=\"User\">\n            <Value Profile=\"(Default)\">Test</Value>\n        </Setting>\n    </Settings>\n</SettingsFile>"
  },
  {
    "path": "src/ProfileExplorerUI/Properties/launchSettings.json",
    "content": "{\n  \"profiles\": {\n    \"Client\": {\n      \"commandName\": \"Project\",\n      \"commandLineArgs\": \"\"\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Providers/IBlockFoldingStrategyProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Providers;\n\npublic interface IBlockFoldingStrategyProvider {\n  IBlockFoldingStrategy CreateFoldingStrategy(FunctionIR function);\n}\n"
  },
  {
    "path": "src/ProfileExplorerUI/Providers/IRemarkProvider.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorerUI.Session;\n\nnamespace ProfileExplorer.UI;\n\npublic interface IRRemarkProvider {\n  // TODO: add per-section cache of remarks, don't have to reparse\n  // all output when switching sections.\n  string SettingsFilePath { get; }\n  List<RemarkCategory> RemarkCategories { get; }\n  List<RemarkSectionBoundary> RemarkSectionBoundaries { get; }\n  List<RemarkTextHighlighting> RemarkTextHighlighting { get; }\n  bool SaveSettings();\n  bool LoadSettings();\n  List<IRTextSection> GetSectionList(IRTextSection currentSection, int maxDepth, bool stopAtSectionBoundaries);\n\n  List<Remark> ExtractAllRemarks(List<IRTextSection> sections, FunctionIR function, ILoadedDocument document,\n                                 RemarkProviderOptions options, CancelableTask cancelableTask);\n\n  List<Remark> ExtractRemarks(string text, FunctionIR function,\n                              IRTextSection section, RemarkProviderOptions options,\n                              CancelableTask cancelableTask);\n\n  List<Remark> ExtractRemarks(List<string> textLines, FunctionIR function,\n                              IRTextSection section, RemarkProviderOptions options,\n                              CancelableTask cancelableTask);\n\n  OptimizationRemark GetOptimizationRemarkInfo(Remark remark);\n}\n\npublic class OptimizationRemark {\n  public string OptimizationName { get; set; }\n  public object Info { get; set; }\n}\n\npublic class RemarkProviderOptions {\n  public RemarkProviderOptions() {\n    FindInstructionRemarks = true;\n    FindOperandRemarks = true;\n    IgnoreOverlappingOperandRemarks = false;\n  }\n\n  public bool FindInstructionRemarks { get; set; }\n  public bool FindOperandRemarks { get; set; }\n  public bool IgnoreOverlappingOperandRemarks { get; set; }\n\n  //? TODO: Options for multi-threading, max cores\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Providers/ISectionStyleProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic interface ISectionStyleProvider {\n  string SettingsFilePath { get; }\n  bool SaveSettings();\n  bool LoadSettings();\n  bool IsMarkedSection(IRTextSection section, out MarkedSectionName result);\n}\n\npublic class MarkedSectionName {\n  public MarkedSectionName() { }\n\n  public MarkedSectionName(string text, TextSearchKind searchKind) {\n    SearchedText = text;\n    SearchKind = searchKind;\n    TextColor = Colors.Transparent;\n  }\n\n  public MarkedSectionName(string text, TextSearchKind searchKind, Color textColor) {\n    SearchedText = text;\n    SearchKind = searchKind;\n    TextColor = textColor;\n  }\n\n  public string SearchedText { get; set; }\n  public TextSearchKind SearchKind { get; set; }\n  public Color TextColor { get; set; }\n  public Color SeparatorColor { get; set; }\n  public int BeforeSeparatorWeight { get; set; }\n  public int AfterSeparatorWeight { get; set; }\n  public int IndentationLevel { get; set; }\n}\n\nclass DummySectionStyleProvider : ISectionStyleProvider {\n  public string SettingsFilePath { get; }\n\n  public bool SaveSettings() {\n    return true;\n  }\n\n  public bool LoadSettings() {\n    return true;\n  }\n\n  public bool IsMarkedSection(IRTextSection section, out MarkedSectionName result) {\n    result = null;\n    return false;\n  }\n}\n\nclass SectionStyleProviderSerializer {\n  public bool Save(List<MarkedSectionName> sectionNameMarkers, string path) {\n    var data = new SerializedData {\n      List = sectionNameMarkers\n    };\n\n    return UIJsonUtils.SerializeToFile(data, path);\n  }\n\n  public bool Load(string path, out List<MarkedSectionName> sectionNameMarkers) {\n    if (UIJsonUtils.DeserializeFromFile(path, out SerializedData data)) {\n      sectionNameMarkers = data.List;\n      return true;\n    }\n\n    sectionNameMarkers = new List<MarkedSectionName>();\n    return false;\n  }\n\n  private class SerializedData {\n    public string Comment => \"Description\";\n    public string[] SearchKindValues =>\n      new[] {\n        \"default\", \"regex\", \"caseSensitive\", \"wholeWord\"\n      };\n    public List<MarkedSectionName> List { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/BuiltinElementQuery.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class BuiltinElementQuery : IElementQuery {\n  private IUISession session_;\n  public IUISession Session => session_;\n\n  public bool Initialize(IUISession session) {\n    session_ = session;\n    return true;\n  }\n\n  public bool Execute(QueryData data) {\n    //MessageBox.Show(\"Execute BuiltinElementQuery\");\n    data.SetOutput(\"Output A\", new Random().NextDouble() > 0.5);\n    data.SetOutput(\"Output B\", new Random().NextDouble() > 0.5);\n    data.SetOutput(\"Output C\", new Random().Next(10000));\n    return true;\n  }\n\n  public QueryDefinition GetDefinition() {\n    throw new NotImplementedException();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/BuiltinFunctionTask.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class BuiltinFunctionTask : IFunctionTask {\n  public delegate bool TaskCallback(FunctionIR function, IRDocument document,\n                                    IFunctionTaskOptions options, IUISession session,\n                                    CancelableTask cancelableTask);\n\n  private TaskCallback callback_;\n  public IUISession Session { get; private set; }\n  public IFunctionTaskOptions Options { get; private set; }\n  public FunctionTaskInfo TaskInfo { get; private set; }\n  public bool Result { get; set; }\n  public string ResultMessage { get; set; }\n  public string OutputText { get; set; }\n\n  public Task<bool> Execute(FunctionIR function, IRDocument document,\n                            CancelableTask cancelableTask) {\n    return Task.Run(() => callback_(function, document, Options,\n                                    Session, cancelableTask));\n  }\n\n  public bool Initialize(IUISession session, FunctionTaskInfo taskInfo, object optionalData) {\n    Session = session;\n    TaskInfo = taskInfo;\n    callback_ = (TaskCallback)optionalData;\n\n    LoadOptions();\n    return true;\n  }\n\n  public void SaveOptions() {\n    if (Options != null) {\n      Session.SaveFunctionTaskOptions(TaskInfo, Options);\n    }\n  }\n\n  public void ResetOptions() {\n    if (TaskInfo.OptionsType == null) {\n      return;\n    }\n\n    Options = (IFunctionTaskOptions)Activator.CreateInstance(TaskInfo.OptionsType);\n    Options.Reset();\n  }\n\n  public QueryData GetOptionsValues() {\n    var data = new QueryData();\n    data.AddInputs(Options);\n    return data;\n  }\n\n  public void LoadOptionsFromValues(QueryData data) {\n    Options = (IFunctionTaskOptions)data.ExtractInputs(TaskInfo.OptionsType);\n  }\n\n  public static FunctionTaskDefinition GetDefinition(FunctionTaskInfo taskInfo,\n                                                     TaskCallback callback) {\n    return new FunctionTaskDefinition(typeof(BuiltinFunctionTask), taskInfo, callback);\n  }\n\n  private void LoadOptions() {\n    var options = Session.LoadFunctionTaskOptions(TaskInfo);\n\n    if (options != null) {\n      Options = options;\n    }\n    else {\n      ResetOptions();\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/Buitin/InstructionSSAInfoQuery.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI.Query.Builtin;\n\npublic class InstructionSSAInfoQuery : IElementQuery {\n  private IUISession session_;\n  public IUISession Session => session_;\n\n  public bool Initialize(IUISession session) {\n    session_ = session;\n    return true;\n  }\n\n  public bool Execute(QueryData data) {\n    var element = data.GetInput<IRElement>(\"Instruction\");\n    data.ResetResults();\n\n    if (element is InstructionIR instr) {\n      if (instr.Destinations.Count > 0) {\n        var defTag = instr.Destinations[0].GetTag<SSADefinitionTag>();\n\n        if (defTag != null) {\n          data.SetOutput(\"User Count\", defTag.Users.Count);\n        }\n      }\n\n      bool allSourcesDominate = true;\n\n      foreach (var sourceOp in instr.Sources) {\n        var defOp = ReferenceFinder.GetSSADefinition(sourceOp);\n\n        if (defOp == null) {\n          continue;\n        }\n\n        var cache = FunctionAnalysisCache.Get(element.ParentFunction);\n        var dominatorAlgo = cache.GetDominators();\n\n        if (!dominatorAlgo.Dominates(defOp.ParentBlock, instr.ParentBlock)) {\n          allSourcesDominate = false;\n          data.SetOutput(\"Source Definitions Dominate\", false);\n\n          data.SetOutputWarning(\"Source Definitions Dominate\",\n                                $\"Definition {Utils.MakeElementDescription(defOp)} of source {Utils.MakeElementDescription(sourceOp)} does not dominate!\");\n\n          break;\n        }\n      }\n\n      if (allSourcesDominate) {\n        data.SetOutput(\"Source Definitions Dominate\", true);\n      }\n    }\n    else {\n      data.SetInputWarning(\"Instruction\", \"Selected element is not an instruction!\");\n    }\n\n    return true;\n  }\n\n  public static QueryDefinition GetDefinition() {\n    var query = new QueryDefinition(typeof(InstructionSSAInfoQuery),\n                                    \"Instruction SSA details\",\n                                    \"Details about values with SSA info\");\n    query.Data.AddInput(\"Instruction\", QueryValueKind.Element);\n    query.Data.AddOutput(\"User Count\", QueryValueKind.Number);\n    query.Data.AddOutput(\"Source Definitions Dominate\", QueryValueKind.Bool);\n    return query;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/Buitin/OperandSSAInfoQuery.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI.Query.Builtin;\n\npublic class OperandSSAInfoQuery : IElementQuery {\n  private IUISession session_;\n  public IUISession Session => session_;\n\n  public bool Initialize(IUISession session) {\n    session_ = session;\n    return true;\n  }\n\n  public bool Execute(QueryData data) {\n    var element = data.GetInput<IRElement>(\"Operand\");\n    data.ResetResults();\n\n    if (element is InstructionIR instr) {\n      if (instr.Destinations.Count > 0) {\n        element = instr.Destinations[0];\n      }\n    }\n\n    if (element is OperandIR op) {\n      var defOp = ReferenceFinder.GetSSADefinition(op);\n\n      if (defOp == null) {\n        data.SetOutputWarning(\"User Count\",\n                              $\"Definition for {Utils.MakeElementDescription(op)} could not be found!\");\n\n        return true;\n      }\n\n      var defTag = defOp.GetTag<SSADefinitionTag>();\n      data.SetOutput(\"User Count\", defTag.Users.Count);\n      data.SetOutput(\"Definition\", defOp);\n      data.SetOutput(\"Definition Block\", defOp.ParentBlock);\n      var cache = FunctionAnalysisCache.Get(element.ParentFunction);\n      var dominatorAlgo = cache.GetDominators();\n\n      //? TODO: Dom inside a block by checking instr order\n      if (dominatorAlgo.Dominates(defOp.ParentBlock, op.ParentBlock)) {\n        data.SetOutput(\"Definition Dominates\", true);\n      }\n      else {\n        data.SetOutput(\"Definition Dominates\", false);\n\n        data.SetOutputWarning(\"Definition Dominates\",\n                              $\"Definition {Utils.MakeElementDescription(defOp)} does not dominate!\");\n      }\n    }\n    else {\n      data.SetOutputWarning(\"Operand\", \"Selected element is not an operand!\");\n    }\n\n    return true;\n  }\n\n  public static QueryDefinition GetDefinition() {\n    var query = new QueryDefinition(typeof(OperandSSAInfoQuery),\n                                    \"Operand SSA details\",\n                                    \"Details about values with SSA info\");\n    query.Data.AddInput(\"Operand\", QueryValueKind.Element);\n    query.Data.AddOutput(\"User Count\", QueryValueKind.Number);\n    return query;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/ButtonQueryViewElement .xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Query.ButtonQueryViewElement\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  Height=\"24\"\n  d:DesignHeight=\"50\"\n  d:DesignWidth=\"200\"\n  Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n  mc:Ignorable=\"d\">\n  <UserControl.Resources>\n    <Style\n      x:Key=\"ButtonStyle\"\n      TargetType=\"{x:Type Button}\">\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=HasBoldText}\"\n          Value=\"True\">\n          <Setter Property=\"FontWeight\" Value=\"Bold\" />\n        </DataTrigger>\n        <DataTrigger\n          Binding=\"{Binding Path=HasMediumText}\"\n          Value=\"True\">\n          <Setter Property=\"FontWeight\" Value=\"Medium\" />\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n  </UserControl.Resources>\n  <Button\n    Height=\"20\"\n    MinWidth=\"20\"\n    Margin=\"2,0,2,0\"\n    Padding=\"4,0,4,0\"\n    VerticalAlignment=\"Center\"\n    Click=\"Button_Click\"\n    Content=\"{Binding Text}\"\n    IsEnabled=\"{Binding IsEnabled}\"\n    Style=\"{StaticResource ButtonStyle}\"\n    ToolTip=\"{Binding Description}\" />\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Query/ButtonQueryViewElement .xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic partial class ButtonQueryViewElement : UserControl {\n  public ButtonQueryViewElement() {\n    InitializeComponent();\n  }\n\n  private void Button_Click(object sender, RoutedEventArgs e) {\n    var button = (QueryButton)DataContext;\n    button.Action?.Invoke(button, button.Data);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/ElementQuery.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic interface IElementQuery {\n  public IUISession Session { get; }\n  public bool Initialize(IUISession session);\n  public bool Execute(QueryData data);\n}\n\npublic class QueryDefinition : INotifyPropertyChanged {\n  private Type queryType_;\n  private QueryData data_;\n  private IElementQuery queryInstance_;\n\n  public QueryDefinition(Type queryType) {\n    Data = new QueryData();\n    queryType_ = queryType;\n  }\n\n  public QueryDefinition(Type queryType, string name, string description) : this(queryType) {\n    Name = name;\n    Description = description;\n  }\n\n  public string Name { get; set; }\n  public string Description { get; set; }\n\n  public QueryData Data {\n    get => data_;\n    set {\n      if (value != data_) {\n        if (data_ != null) {\n          data_.ValueChanged -= InputValueChanged;\n          data_.PropertyChanged -= DataPropertyChanged;\n        }\n\n        data_ = value;\n        data_.ValueChanged += InputValueChanged;\n        data_.PropertyChanged += DataPropertyChanged;\n        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Data)));\n      }\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  public bool CreateQueryInstance(IUISession session) {\n    if (queryInstance_ == null) {\n      queryInstance_ = (IElementQuery)Activator.CreateInstance(queryType_);\n      data_.Instance = queryInstance_;\n      return queryInstance_.Initialize(session);\n    }\n\n    return true;\n  }\n\n  private void InputValueChanged(object sender, EventArgs e) {\n    if (AreAllInputValuesSet()) {\n      queryInstance_.Execute(Data);\n      PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Data)));\n    }\n  }\n\n  private bool AreAllInputValuesSet() {\n    return Data.InputValues.FindIndex(item => item.Value == null) == -1;\n  }\n\n  private void DataPropertyChanged(object sender, PropertyChangedEventArgs e) {\n    PropertyChanged?.Invoke(this, e);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/FunctionTask.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic interface IFunctionTaskOptions {\n  public void Reset();\n}\n\npublic interface IFunctionTask {\n  IFunctionTaskOptions Options { get; }\n  IUISession Session { get; }\n  FunctionTaskInfo TaskInfo { get; }\n  bool Result { get; }\n  string ResultMessage { get; }\n  string OutputText { get; }\n  void ResetOptions();\n  void SaveOptions();\n  QueryData GetOptionsValues();\n  void LoadOptionsFromValues(QueryData data);\n  bool Initialize(IUISession session, FunctionTaskInfo taskInfo, object optionalData);\n  Task<bool> Execute(FunctionIR function, IRDocument document, CancelableTask cancelableTask);\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/FunctionTaskDefinition.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class FunctionTaskInfo {\n  public FunctionTaskInfo(Guid id, string name, string description = \"\") {\n    Name = name;\n    Id = id;\n    Description = description;\n  }\n\n  public Guid Id { get; set; }\n  public string Name { get; set; }\n  public string Description { get; set; }\n  public bool HasOptionsPanel { get; set; }\n  public Type OptionsType { get; set; }\n  public string TargetCompilerIR { get; set; }\n\n  public override bool Equals(object obj) {\n    return obj is FunctionTaskInfo info &&\n           Id.Equals(info.Id);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Id);\n  }\n}\n\npublic class FunctionTaskDefinition {\n  private FunctionTaskInfo taskInfo_;\n  private Type taskType_;\n  private object optionalData_;\n\n  public FunctionTaskDefinition(Type taskType, object optionalData = null) {\n    taskType_ = taskType;\n    optionalData_ = optionalData;\n  }\n\n  public FunctionTaskDefinition(Type taskType, FunctionTaskInfo taskInfo,\n                                object optionalData = null) : this(taskType, optionalData) {\n    taskInfo_ = taskInfo;\n  }\n\n  public FunctionTaskInfo TaskInfo => taskInfo_;\n\n  public bool IsCompatibleWith(string compilerIR) {\n    return string.IsNullOrEmpty(taskInfo_.TargetCompilerIR) ||\n           taskInfo_.TargetCompilerIR == compilerIR;\n  }\n\n  public IFunctionTask CreateInstance(IUISession session) {\n    var actionInstance = (IFunctionTask)Activator.CreateInstance(taskType_);\n\n    if (!actionInstance.Initialize(session, taskInfo_, optionalData_)) {\n      return null;\n    }\n\n    return actionInstance;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/FunctionTaskOptionsSerializer.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text.Json;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class FunctionTaskOptionsSerializer {\n  public static byte[] Serialize(IFunctionTaskOptions inputObject) {\n    try {\n      // Save each property to a dictionary and serialize it in JSON format.\n      // Protobuf is not used here because by default it cannot handle the generic object values.\n      var fields = new Dictionary<string, object>();\n      var inputType = inputObject.GetType();\n\n      foreach (var property in inputType.GetProperties()) {\n        if (!property.CanRead || !property.CanWrite) {\n          continue;\n        }\n\n        fields[property.Name] = property.GetValue(inputObject);\n      }\n\n      return UIJsonUtils.SerializeToBytes(fields);\n    }\n    catch (Exception ex) {\n      return null;\n    }\n  }\n\n  public static IFunctionTaskOptions Deserialize(byte[] data, Type outputType) {\n    try {\n      if (!UIJsonUtils.DeserializeFromBytes<Dictionary<string, object>>(data, out var state)) {\n        return null;\n      }\n\n      object outputObject = Activator.CreateInstance(outputType);\n\n      foreach (var field in state) {\n        var property = outputType.GetProperty(field.Key);\n        var valueType = property.PropertyType;\n\n        // Because the values are serialized/deserialized as a generic object,\n        // instead of the proper type the values are plain JsonEleement (strings)\n        // which have to be converted now to the property type.\n        var jsonValue = (JsonElement)field.Value;\n        object value = null;\n\n        switch (valueType) {\n          case var _ when valueType == typeof(bool): {\n            value = jsonValue.GetBoolean();\n            break;\n          }\n          case var _ when valueType == typeof(int): {\n            value = jsonValue.GetInt32();\n            break;\n          }\n          case var _ when valueType == typeof(string): {\n            value = jsonValue.GetString();\n            break;\n          }\n          case var _ when valueType == typeof(Color): {\n            value = Utils.ColorFromString(jsonValue.GetString());\n            break;\n          }\n        }\n\n        property.SetValue(outputObject, value);\n      }\n\n      return (IFunctionTaskOptions)outputObject;\n    }\n    catch (Exception ex) {\n      return null;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/InputQueryViewElement.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Query.InputQueryViewElement\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Query\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:xctk=\"http://schemas.xceed.com/wpf/xaml/toolkit\"\n  Height=\"24\"\n  d:DesignHeight=\"50\"\n  d:DesignWidth=\"200\"\n  mc:Ignorable=\"d\">\n  <UserControl.Resources>\n    <local:ElementObjectConverter x:Key=\"ElementObjectConverter\" />\n\n    <Style\n      x:Key=\"BackgroundStyle\"\n      TargetType=\"{x:Type DockPanel}\">\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsWarning}\"\n          Value=\"True\">\n          <Setter Property=\"Background\" Value=\"#FAD5D2\" />\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding Path=IsWarning}\"\n          Value=\"False\">\n          <Setter Property=\"Background\" Value=\"#FFFCE7\" />\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"InOutTextStyle\"\n      TargetType=\"{x:Type Image}\">\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsInput}\"\n          Value=\"True\">\n          <Setter Property=\"Source\" Value=\"{StaticResource CrosshairIcon}\" />\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding Path=IsInput}\"\n          Value=\"False\">\n          <Setter Property=\"Source\" Value=\"{StaticResource RightArrowIcon}\" />\n        </DataTrigger>\n      </Style.Triggers>\n\n      <EventSetter\n        Event=\"MouseMove\"\n        Handler=\"Image_MouseMove\" />\n    </Style>\n\n    <Style\n      x:Key=\"ElementQueryValueStyle\"\n      TargetType=\"{x:Type ContentControl}\">\n      <Setter Property=\"ContentTemplate\">\n        <Setter.Value>\n          <DataTemplate />\n        </Setter.Value>\n      </Setter>\n\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsElement}\"\n          Value=\"True\">\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <TextBlock\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Stretch\"\n                  VerticalAlignment=\"Center\"\n                  DockPanel.Dock=\"Right\"\n                  FontWeight=\"Medium\"\n                  Foreground=\"DarkBlue\"\n                  Text=\"{Binding Path=Value, Converter={StaticResource ElementObjectConverter}}\"\n                  TextAlignment=\"Right\"\n                  TextTrimming=\"CharacterEllipsis\"\n                  ToolTip=\"{Binding Path=Value, Converter={StaticResource ElementObjectConverter}}\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"InputQueryValueStyle\"\n      TargetType=\"{x:Type ContentControl}\">\n      <Setter Property=\"ContentTemplate\">\n        <Setter.Value>\n          <DataTemplate />\n        </Setter.Value>\n      </Setter>\n\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsBool}\"\n          Value=\"True\">\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <CheckBox\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                  IsChecked=\"{Binding Path=Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding Path=IsElement}\"\n          Value=\"True\">\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <Image\n                  Width=\"16\"\n                  Height=\"16\"\n                  Margin=\"4,0,0,0\"\n                  HorizontalAlignment=\"Left\"\n                  VerticalAlignment=\"Center\"\n                  Style=\"{StaticResource InOutTextStyle}\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding Path=IsNumber}\"\n          Value=\"True\">\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <TextBox\n                  Width=\"100\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                  IsEnabled=\"{Binding Path=IsInput}\"\n                  Text=\"{Binding Path=Value, Mode=TwoWay, UpdateSourceTrigger=LostFocus}\"\n                  TextAlignment=\"Right\"\n                  ToolTip=\"Number value expected\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding Path=IsString}\"\n          Value=\"True\">\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <TextBox\n                  Width=\"75\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                  IsEnabled=\"{Binding Path=IsInput}\"\n                  Text=\"{Binding Path=Value, Mode=TwoWay, UpdateSourceTrigger=LostFocus}\"\n                  ToolTip=\"String value expected\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding Path=IsColor}\"\n          Value=\"True\">\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <xctk:ColorPicker\n                  Width=\"75\"\n                  Height=\"22\"\n                  HorizontalAlignment=\"Right\"\n                  VerticalAlignment=\"Center\"\n                  AvailableColorsSortingMode=\"HueSaturationBrightness\"\n                  BorderBrush=\"#707070\"\n                  SelectedColor=\"{Binding Path=Value, Mode=TwoWay}\"\n                  ShowDropDownButton=\"True\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n  </UserControl.Resources>\n\n  <Border\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderThickness=\"0,1,0,0\">\n    <DockPanel\n      LastChildFill=\"True\"\n      Style=\"{StaticResource BackgroundStyle}\">\n      <TextBlock\n        Margin=\"4,0,4,0\"\n        VerticalAlignment=\"Center\"\n        Text=\"{Binding Name}\"\n        ToolTip=\"{Binding Description}\" />\n\n      <Image\n        Width=\"16\"\n        Height=\"16\"\n        Margin=\"4,0,4,0\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Center\"\n        DockPanel.Dock=\"Right\"\n        Source=\"{StaticResource WarningIcon}\"\n        ToolTip=\"{Binding WarningMessage}\"\n        Visibility=\"{Binding IsWarning, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n      <ContentControl\n        Margin=\"4,0,4,0\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Center\"\n        Content=\"{Binding .}\"\n        DockPanel.Dock=\"Right\"\n        Style=\"{StaticResource ElementQueryValueStyle}\" />\n\n      <ContentControl\n        Margin=\"0,0,-4,0\"\n        HorizontalAlignment=\"Stretch\"\n        VerticalAlignment=\"Center\"\n        Panel.ZIndex=\"100\"\n        Content=\"{Binding .}\"\n        Style=\"{StaticResource InputQueryValueStyle}\" />\n\n    </DockPanel>\n  </Border>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Query/InputQueryViewElement.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class IRElementDragDropSelection {\n  public IRElement Element { get; set; }\n}\n\npublic partial class InputQueryViewElement : UserControl {\n  public InputQueryViewElement() {\n    InitializeComponent();\n  }\n\n  private void Image_MouseMove(object sender, MouseEventArgs e) {\n    var element = sender as FrameworkElement;\n\n    if (e.LeftButton == MouseButtonState.Pressed) {\n      var selection = new IRElementDragDropSelection();\n      var data = new DataObject(typeof(IRElementDragDropSelection), selection);\n\n      if (DragDrop.DoDragDrop(element, data, DragDropEffects.All) == DragDropEffects.All) {\n        ((QueryValue)element.DataContext).Value = selection.Element;\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/OutputQueryViewElement.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Query.OutputQueryViewElement\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Query\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  Height=\"24\"\n  d:DesignHeight=\"50\"\n  d:DesignWidth=\"200\"\n  mc:Ignorable=\"d\">\n  <UserControl.Resources>\n    <local:BoolObjectConverter x:Key=\"BoolObjectConverter\" />\n    <local:ElementObjectConverter x:Key=\"ElementObjectConverter\" />\n    <BooleanToVisibilityConverter x:Key=\"BoolToVisibility\" />\n\n    <Style\n      x:Key=\"BackgroundStyle\"\n      TargetType=\"{x:Type DockPanel}\">\n      <Style.Triggers>\n        <DataTrigger\n          Binding=\"{Binding Path=IsWarning}\"\n          Value=\"True\">\n          <Setter Property=\"Background\" Value=\"#FFD2CE\" />\n        </DataTrigger>\n\n        <DataTrigger\n          Binding=\"{Binding Path=IsWarning}\"\n          Value=\"False\">\n          <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n        </DataTrigger>\n      </Style.Triggers>\n    </Style>\n\n    <Style\n      x:Key=\"OutputQueryValueStyle\"\n      TargetType=\"{x:Type ContentControl}\">\n      <Style.Triggers>\n        <MultiDataTrigger>\n          <MultiDataTrigger.Conditions>\n            <Condition Binding=\"{Binding Path=IsBool}\" Value=\"True\" />\n            <Condition\n              Binding=\"{Binding Path=Value, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolObjectConverter}}\"\n              Value=\"True\" />\n          </MultiDataTrigger.Conditions>\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <CheckBox\n                  Background=\"#C3FFB8\"\n                  IsChecked=\"True\"\n                  IsHitTestVisible=\"False\"\n                  ToolTip=\"Positive query result\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </MultiDataTrigger>\n\n        <MultiDataTrigger>\n          <MultiDataTrigger.Conditions>\n            <Condition Binding=\"{Binding Path=IsBool}\" Value=\"True\" />\n            <Condition\n              Binding=\"{Binding Path=Value, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource BoolObjectConverter}}\"\n              Value=\"False\" />\n          </MultiDataTrigger.Conditions>\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <CheckBox\n                  Background=\"LightGray\"\n                  IsChecked=\"False\"\n                  IsHitTestVisible=\"False\"\n                  ToolTip=\"Negative query result\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </MultiDataTrigger>\n\n        <MultiDataTrigger>\n          <MultiDataTrigger.Conditions>\n            <Condition Binding=\"{Binding Path=IsBool}\" Value=\"False\" />\n            <Condition Binding=\"{Binding Path=IsElement}\" Value=\"True\" />\n          </MultiDataTrigger.Conditions>\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <TextBlock\n                  FontWeight=\"Medium\"\n                  Style=\"{StaticResource HoverUnderlineStyle}\"\n                  Text=\"{Binding Path=Value, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource ElementObjectConverter}}\"\n                  ToolTip=\"{Binding Path=Value, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource ElementObjectConverter}}\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </MultiDataTrigger>\n\n        <MultiDataTrigger>\n          <MultiDataTrigger.Conditions>\n            <Condition Binding=\"{Binding Path=IsBool}\" Value=\"False\" />\n            <Condition Binding=\"{Binding Path=IsElement}\" Value=\"False\" />\n          </MultiDataTrigger.Conditions>\n          <Setter Property=\"ContentTemplate\">\n            <Setter.Value>\n              <DataTemplate>\n                <TextBlock\n                  FontWeight=\"Medium\"\n                  Text=\"{Binding Path=Value, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}\"\n                  ToolTip=\"{Binding Path=Value, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}\" />\n              </DataTemplate>\n            </Setter.Value>\n          </Setter>\n        </MultiDataTrigger>\n      </Style.Triggers>\n\n    </Style>\n  </UserControl.Resources>\n\n  <Border\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderThickness=\"0,1,0,0\">\n    <DockPanel\n      LastChildFill=\"True\"\n      Style=\"{StaticResource BackgroundStyle}\">\n      <TextBlock\n        Margin=\"4,0,4,0\"\n        VerticalAlignment=\"Center\"\n        Text=\"{Binding Name}\"\n        ToolTip=\"{Binding Description}\" />\n      <Image\n        Width=\"16\"\n        Height=\"16\"\n        Margin=\"4,0,4,0\"\n        VerticalAlignment=\"Center\"\n        Source=\"{StaticResource WarningIcon}\"\n        ToolTip=\"{Binding WarningMessage}\"\n        Visibility=\"{Binding IsWarning, Converter={StaticResource BoolToVisibility}}\" />\n      <ContentControl\n        Margin=\"4,0,4,0\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Center\"\n        Content=\"{Binding ., Mode=OneWay, UpdateSourceTrigger=PropertyChanged}\"\n        DockPanel.Dock=\"Right\"\n        Style=\"{StaticResource OutputQueryValueStyle}\" />\n    </DockPanel>\n  </Border>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Query/OutputQueryViewElement.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Globalization;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class BoolObjectConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    try {\n      return (bool)value;\n    }\n    catch (Exception) {\n      return null;\n    }\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return value;\n  }\n}\n\npublic class ElementObjectConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    try {\n      return !(value is IRElement element) ? null : Utils.MakeElementDescription(element);\n    }\n    catch (Exception) {\n      return null;\n    }\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return value;\n  }\n}\n\npublic partial class OutputQueryViewElement : UserControl {\n  public OutputQueryViewElement() {\n    InitializeComponent();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/QueryData.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Reflection;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class QueryData : INotifyPropertyChanged {\n  private int nextId_;\n\n  public QueryData() {\n    InputValues = new List<QueryValue>();\n    OutputValues = new List<QueryValue>();\n    Buttons = new List<QueryButton>();\n  }\n\n  public List<QueryValue> InputValues { get; set; }\n  public List<QueryValue> OutputValues { get; set; }\n  public List<QueryButton> Buttons { get; set; }\n  public bool HasInputValuesSwitchButton { get; set; }\n  public IElementQuery Instance { get; set; }\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler ValueChanged;\n\n  private static bool ExtractInt(QueryValue queryValue, out int number) {\n    try {\n      number = Convert.ToInt32(queryValue.Value);\n      return true;\n    }\n    catch (Exception ex) {\n      number = 0;\n      return false;\n    }\n  }\n\n  private static T ExtractInputValue<T>(QueryValue value) {\n    if (value.Value == null) {\n      throw new InvalidOperationException($\"Input value not set: {value.Name}\");\n    }\n\n    if (value.Kind.HasFlag(QueryValueKind.Number)) {\n      if (!ExtractInt(value, out int result)) {\n        throw new InvalidOperationException($\"Invalid input number: {value.Name}\");\n      }\n\n      return (T)(object)result;\n    }\n\n    return (T)value.Value;\n  }\n\n  public QueryValue AddInput(QueryValue value) {\n    value.Kind |= QueryValueKind.Input;\n    value.PropertyChanged += InputValueChanged;\n    InputValues.Add(value);\n    OnPropertyChange(nameof(InputValues));\n    return value;\n  }\n\n  public QueryButton AddButton(string name, EventHandler<object> action = null, object data = null) {\n    var button = new QueryButton(name, action, data);\n    Buttons.Add(button);\n    OnPropertyChange(nameof(Buttons));\n    return button;\n  }\n\n  public void ClearButtons() {\n    Buttons.Clear();\n    OnPropertyChange(nameof(Buttons));\n  }\n\n  public void RemoveButton(string name) {\n    Buttons.RemoveAll(button => button.Text == name);\n    OnPropertyChange(nameof(Buttons));\n  }\n\n  public QueryButton ReplaceButton(string name, EventHandler<object> action = null, object data = null) {\n    RemoveButton(name);\n    return AddButton(name, action, data);\n  }\n\n  public void AddInputs(object inputObject) {\n    // Use reflection to add the corresponding input value\n    // for each of the properties.\n    var inputType = inputObject.GetType();\n\n    foreach (var property in inputType.GetProperties()) {\n      if (!property.CanRead || !property.CanWrite) {\n        continue;\n      }\n\n      // Extract name and description from attributes.\n      string name = \"\";\n      string description = \"\";\n      object[] attributes = property.GetCustomAttributes(true);\n\n      foreach (object attr in attributes) {\n        if (attr is DisplayNameAttribute nameAttr) {\n          name = nameAttr.DisplayName;\n        }\n\n        if (attr is DescriptionAttribute descrAttr) {\n          description = descrAttr.Description;\n        }\n      }\n\n      // Determine the value type.\n      var valueType = property.PropertyType;\n      var valueKind = QueryValueKind.Other;\n\n      switch (valueType) {\n        case var _ when valueType == typeof(bool): {\n          valueKind = QueryValueKind.Bool;\n          break;\n        }\n        case var _ when valueType == typeof(int): {\n          valueKind = QueryValueKind.Number;\n          break;\n        }\n        case var _ when valueType == typeof(string): {\n          valueKind = QueryValueKind.String;\n          break;\n        }\n        case var _ when valueType == typeof(Color): {\n          valueKind = QueryValueKind.Color;\n          break;\n        }\n      }\n\n      if (valueKind == QueryValueKind.Other) {\n        continue;\n      }\n\n      // If no name was provided, use the property name.\n      if (string.IsNullOrEmpty(name)) {\n        name = property.Name;\n      }\n\n      // Use current property value.\n      object value = property.GetValue(inputObject);\n      var queryValue = AddInput(name, valueKind, value, description);\n      queryValue.Tag = property;\n    }\n  }\n\n  public object ExtractInputs(Type outputType) {\n    object options = Activator.CreateInstance(outputType);\n\n    foreach (var inputValue in InputValues) {\n      // Consider input values mapped to properties of T.\n      if (inputValue.Tag is PropertyInfo propertyTag &&\n          outputType.GetProperty(propertyTag.Name) != null) {\n        // For numbers, try to convert to int.\n        if (inputValue.Kind.HasFlag(QueryValueKind.Number)) {\n          if (!ExtractInt(inputValue, out int result)) {\n            return null;\n          }\n\n          propertyTag.SetValue(options, result);\n          continue;\n        }\n\n        propertyTag.SetValue(options, inputValue.Value);\n      }\n    }\n\n    return options;\n  }\n\n  public QueryValue AddInput(string name, QueryValueKind kind, string description = null) {\n    return AddInput(new QueryValue(GetNextId(), name, QueryValue.GetDefaultValue(kind), kind, description));\n  }\n\n  public QueryValue AddInput(string name, QueryValueKind kind, object initialValue, string description = null) {\n    return AddInput(new QueryValue(GetNextId(), name, initialValue, kind, description));\n  }\n\n  public T GetInput<T>(string name) {\n    foreach (var value in InputValues) {\n      if (value.Name == name) {\n        return ExtractInputValue<T>(value);\n      }\n    }\n\n    throw new InvalidOperationException($\"Input value not found: {name}\");\n  }\n\n  public T GetInput<T>(int id) {\n    foreach (var value in InputValues) {\n      if (value.Id == id) {\n        return ExtractInputValue<T>(value);\n      }\n    }\n\n    throw new InvalidOperationException($\"Input value not found: {id}\");\n  }\n\n  public void AddOutput(string name, QueryValueKind kind, string description = null) {\n    SetOutput(name, QueryValue.GetDefaultValue(kind), kind, description);\n  }\n\n  public void SetOutput(string name, object value, QueryValueKind kind, string description = null) {\n    var existingValue = OutputValues.Find(item => item.Name == name);\n\n    if (existingValue != null) {\n      existingValue.Kind = kind;\n      existingValue.Value = value;\n    }\n    else {\n      var outputValue = new QueryValue(GetNextId(), name, value, kind, description);\n      outputValue.PropertyChanged += OutputValueChanged;\n      OutputValues.Add(outputValue);\n      OnPropertyChange(nameof(OutputValues));\n    }\n  }\n\n  public void SetOutput(string name, object value, string description = null) {\n    SetOutput(name, value, QueryValueKind.Other, description);\n  }\n\n  public void SetOutput(string name, bool value, string description = null) {\n    SetOutput(name, value, QueryValueKind.Bool, description);\n  }\n\n  public void SetOutput(string name, int value, string description = null) {\n    SetOutput(name, value, QueryValueKind.Number, description);\n  }\n\n  public void SetOutput(string name, long value, string description = null) {\n    SetOutput(name, value, QueryValueKind.Number, description);\n  }\n\n  public void SetOutput(string name, float value, string description = null) {\n    SetOutput(name, value, QueryValueKind.Number, description);\n  }\n\n  public void SetOutput(string name, double value, string description = null) {\n    SetOutput(name, value, QueryValueKind.Number, description);\n  }\n\n  public void SetOutput(string name, IRElement value, string description = null) {\n    SetOutput(name, value, QueryValueKind.Element, description);\n  }\n\n  public void SetOutput(string name, string value, string description = null) {\n    SetOutput(name, value, QueryValueKind.String, description);\n  }\n\n  public void SetOutput<T>(string name, IList<T> value, string description = null) where T : class {\n    SetOutput(name, value, QueryValueKind.List, description);\n  }\n\n  public void ResetWarningFlags() {\n    foreach (var value in OutputValues) {\n      value.IsWarning = false;\n    }\n\n    foreach (var value in InputValues) {\n      value.IsWarning = false;\n    }\n  }\n\n  public void ResetOutputValues() {\n    foreach (var value in OutputValues) {\n      value.ResetValue();\n    }\n  }\n\n  public void ResetResults() {\n    ResetOutputValues();\n    ResetWarningFlags();\n  }\n\n  public void SetOutputWarning(string name, string message = null) {\n    var value = SetOutputMessage(name);\n    value.SetWarning(message);\n    OnPropertyChange(nameof(OutputValues));\n  }\n\n  public void SetOutputInfo(string name, string message = null) {\n    var value = SetOutputMessage(name);\n    OnPropertyChange(nameof(OutputValues));\n  }\n\n  public void SetInputWarning(string name, string message = null) {\n    var existingValue = InputValues.Find(item => item.Name == name);\n\n    if (existingValue != null) {\n      existingValue.SetWarning(message);\n      OnPropertyChange(nameof(InputValues));\n    }\n  }\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void InputValueChanged(object sender, PropertyChangedEventArgs e) {\n    // Trigger a value changed event only if the actual value is modified,\n    // not for flags like IsWarning which can be set from within the query execution,\n    // which could end up in stack overflow by repeatedly executing the query.\n    if (e.PropertyName == \"Value\") {\n      ValueChanged?.Invoke(this, e);\n    }\n  }\n\n  private int GetNextId() {\n    return nextId_++;\n  }\n\n  private void OutputValueChanged(object sender, PropertyChangedEventArgs e) {\n    OnPropertyChange(nameof(OutputValues));\n  }\n\n  private QueryValue SetOutputMessage(string name) {\n    var existingValue = OutputValues.Find(item => item.Name == name);\n\n    if (existingValue != null) {\n      return existingValue;\n    }\n\n    var outputValue = new QueryValue(GetNextId(), name, null, QueryValueKind.Other);\n    outputValue.PropertyChanged += OutputValueChanged;\n    OutputValues.Add(outputValue);\n    return outputValue;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/QueryPanel.xaml",
    "content": "﻿<controls:DraggablePopup\n  x:Class=\"ProfileExplorer.UI.Query.QueryPanel\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Query\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"200\"\n  d:DesignWidth=\"300\"\n  AllowsTransparency=\"True\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  mc:Ignorable=\"d\">\n  <controls:DraggablePopup.LayoutTransform>\n    <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n  </controls:DraggablePopup.LayoutTransform>\n\n  <controls:DraggablePopup.Resources>\n    <DataTemplate x:Key=\"ListElementTemplate\">\n      <local:QueryView />\n    </DataTemplate>\n  </controls:DraggablePopup.Resources>\n\n  <Border\n    Margin=\"0,0,6,6\"\n    Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"1,1,1,1\">\n    <Border.Effect>\n      <DropShadowEffect\n        BlurRadius=\"5\"\n        Direction=\"315\"\n        RenderingBias=\"Performance\"\n        ShadowDepth=\"2\"\n        Color=\"#FF929292\" />\n    </Border.Effect>\n    <Grid>\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"20\" />\n        <ColumnDefinition Width=\"20\" />\n      </Grid.ColumnDefinitions>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"20\" />\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n\n      <Grid\n        Grid.Row=\"0\"\n        Grid.Column=\"0\"\n        Grid.ColumnSpan=\"3\">\n        <Grid.Style>\n          <Style TargetType=\"Grid\">\n            <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}\" />\n            <Style.Triggers>\n              <DataTrigger\n                Binding=\"{Binding IsActivePanel}\"\n                Value=\"False\">\n                <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.InactiveCaptionBrushKey}}\" />\n              </DataTrigger>\n            </Style.Triggers>\n          </Style>\n        </Grid.Style>\n\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FontWeight=\"Medium\"\n          Text=\"{Binding PanelTitle}\" />\n      </Grid>\n      <!--<Button\n                Grid.Row=\"0\"\n                Grid.Column=\"1\"\n                client:ContextMenuLeftClickBehavior.IsLeftClickEnabled=\"True\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                ToolTip=\"Add query\"\n                Visibility=\"{Binding ShowAddButton, Converter={StaticResource BoolToVisibility}}\">\n                <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource PlusIcon}\" />\n                <Button.ContextMenu>\n                    <ContextMenu x:Name=\"QueryContextMenu\" />\n                </Button.ContextMenu>\n            </Button>-->\n      <Button\n        x:Name=\"CloseButton\"\n        Grid.Row=\"0\"\n        Grid.Column=\"2\"\n        Background=\"{x:Null}\"\n        BorderBrush=\"{x:Null}\"\n        Click=\"CloseButton_Click\"\n        ToolTip=\"Close query panel\">\n        <Image\n          Width=\"16\"\n          Height=\"16\"\n          Source=\"{StaticResource CloseIcon}\" />\n      </Button>\n\n      <ScrollViewer\n        Grid.Row=\"1\"\n        Grid.Column=\"0\"\n        Grid.ColumnSpan=\"3\"\n        HorizontalAlignment=\"Stretch\"\n        CanContentScroll=\"True\"\n        HorizontalScrollBarVisibility=\"Disabled\"\n        VerticalScrollBarVisibility=\"Auto\"\n        VirtualizingStackPanel.IsVirtualizing=\"True\"\n        VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n\n        <ItemsControl\n          x:Name=\"QueryViewList\"\n          ItemTemplate=\"{StaticResource ListElementTemplate}\">\n          <ItemsControl.ItemsPanel>\n            <ItemsPanelTemplate>\n              <VirtualizingStackPanel Orientation=\"Vertical\" />\n            </ItemsPanelTemplate>\n          </ItemsControl.ItemsPanel>\n        </ItemsControl>\n      </ScrollViewer>\n\n      <controls:ResizeGrip\n        x:Name=\"PanelResizeGrip\"\n        Grid.Row=\"1\"\n        Grid.Column=\"2\"\n        Width=\"16\"\n        Height=\"16\"\n        HorizontalAlignment=\"Right\"\n        VerticalAlignment=\"Bottom\"\n        Panel.ZIndex=\"100\" />\n    </Grid>\n  </Border>\n</controls:DraggablePopup>"
  },
  {
    "path": "src/ProfileExplorerUI/Query/QueryPanel.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing ProfileExplorer.UI.Controls;\n\nnamespace ProfileExplorer.UI.Query;\n\n// This is mostly a workaround for an issue with how WPF updates the DataTemplates\n// used for the input/output values - the binding doesn't know an output value changed,\n// so this basically forces an update of the entire query panel.\npublic class ElementQueryInfoView : INotifyPropertyChanged {\n  private QueryDefinition view_;\n\n  public ElementQueryInfoView(QueryDefinition value) {\n    View = value;\n    InputValues = new ObservableCollectionRefresh<QueryValue>(value.Data.InputValues);\n    OutputValues = new ObservableCollectionRefresh<QueryValue>(value.Data.OutputValues);\n    Buttons = new ObservableCollectionRefresh<QueryButton>(value.Data.Buttons);\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  public QueryDefinition View {\n    get => view_;\n    set {\n      if (view_ != value) {\n        if (view_ != null) {\n          view_.PropertyChanged -= ViewPropertyChanged;\n        }\n\n        view_ = value;\n        view_.PropertyChanged += ViewPropertyChanged;\n        OnPropertyChange(\"View\");\n      }\n    }\n  }\n\n  public ObservableCollectionRefresh<QueryValue> InputValues { get; set; }\n  public ObservableCollectionRefresh<QueryValue> OutputValues { get; set; }\n  public ObservableCollectionRefresh<QueryButton> Buttons { get; set; }\n  public bool HasButtons => Buttons.Count > 0;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler Closed;\n\n  public void OnClose(object sender, EventArgs e) {\n    Closed?.Invoke(this, e);\n  }\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void ViewPropertyChanged(object sender, PropertyChangedEventArgs e) {\n    InputValues.Clear();\n    OutputValues.Clear();\n    Buttons.Clear();\n    InputValues.AddRange(View.Data.InputValues);\n    OutputValues.AddRange(View.Data.OutputValues);\n    Buttons.AddRange(View.Data.Buttons);\n    OnPropertyChange(\"View\");\n  }\n}\n\npublic partial class QueryPanel : DraggablePopup, INotifyPropertyChanged {\n  public const double DefaultHeight = 270;\n  public const double MinimumHeight = 100;\n  public const double DefaultWidth = 300;\n  public const double MinimumWidth = 100;\n  private List<ElementQueryInfoView> activeQueries_;\n  private List<QueryDefinition> registeredQueries_;\n  private List<QueryDefinition> registeredUserQueries_;\n  private string panelTitle_;\n  private bool showAddButton_;\n  private bool isActivePanel_;\n\n  public QueryPanel(Point position, double width, double height,\n                    UIElement referenceElement, IUISession session) {\n    InitializeComponent();\n    Initialize(position, width, height, referenceElement);\n    PanelResizeGrip.ResizedControl = this;\n    Session = session;\n\n    registeredQueries_ = new List<QueryDefinition>();\n    registeredUserQueries_ = new List<QueryDefinition>();\n    activeQueries_ = new List<ElementQueryInfoView>();\n\n    PreviewMouseLeftButtonDown += QueryPanel_PreviewMouseLeftButtonDown;\n    PreviewGotKeyboardFocus += QueryPanel_PreviewGotKeyboardFocus;\n    GotFocus += QueryPanel_GotFocus;\n\n    // Populate with the available queries.\n    //var queries = Session.CompilerInfo.BuiltinQueries;\n\n    //foreach (var query in queries) {\n    //    RegisterQuery(query, true);\n    //}\n\n    //UpdateContextMenu();\n    DataContext = this;\n  }\n\n  public IUISession Session { get; set; }\n\n  public string PanelTitle {\n    get => panelTitle_;\n    set {\n      if (panelTitle_ != value) {\n        panelTitle_ = value;\n        OnPropertyChange(nameof(PanelTitle));\n      }\n    }\n  }\n\n  public bool ShowAddButton {\n    get => showAddButton_;\n    set {\n      if (showAddButton_ != value) {\n        showAddButton_ = value;\n        OnPropertyChange(nameof(ShowAddButton));\n      }\n    }\n  }\n\n  public bool IsActivePanel {\n    get => isActivePanel_;\n    set {\n      if (isActivePanel_ != value) {\n        isActivePanel_ = value;\n        OnPropertyChange(nameof(IsActivePanel));\n      }\n    }\n  }\n\n  public int QueryCount => activeQueries_.Count;\n  public event PropertyChangedEventHandler PropertyChanged;\n  public event EventHandler PanelActivated;\n\n  public void RegisterQuery(QueryDefinition query, bool isBuiltin) {\n    if (isBuiltin) {\n      registeredQueries_.Add(query);\n    }\n    else {\n      registeredUserQueries_.Add(query);\n    }\n  }\n\n  public void AddQuery(QueryDefinition query) {\n    var queryView = new ElementQueryInfoView(query);\n    query.CreateQueryInstance(Session);\n    queryView.Closed += QueryView_Closed;\n    activeQueries_.Add(queryView);\n    QueryViewList.ItemsSource = new CollectionView(activeQueries_);\n  }\n\n  public void RemoveQuery(QueryDefinition query) {\n    foreach (var queryView in activeQueries_) {\n      if (queryView.View == query) {\n        queryView.Closed -= QueryView_Closed;\n        activeQueries_.Remove(queryView);\n        QueryViewList.ItemsSource = new CollectionView(activeQueries_);\n        break;\n      }\n    }\n  }\n\n  public QueryDefinition GetQueryAt(int index) {\n    return activeQueries_[index].View;\n  }\n\n  public void UpdateContextMenu() {\n    //foreach (MenuItem item in QueryContextMenu.Items) {\n    //    item.Click -= ContextMenuItem_Click;\n    //}\n\n    //QueryContextMenu.Items.Clear();\n\n    //foreach (var query in registeredQueries_) {\n    //    QueryContextMenu.Items.Add(CreateContextMenuItem(query));\n    //}\n\n    //if (registeredUserQueries_.Count > 0) {\n    //    QueryContextMenu.Items.Add(new Separator());\n\n    //    foreach (var query in registeredUserQueries_) {\n    //        QueryContextMenu.Items.Add(CreateContextMenuItem(query));\n    //    }\n    //}\n  }\n\n  private void QueryView_Closed(object sender, EventArgs e) {\n    var queryView = (ElementQueryInfoView)sender;\n    queryView.Closed -= QueryView_Closed;\n    activeQueries_.Remove(queryView);\n    QueryViewList.ItemsSource = new CollectionView(activeQueries_);\n  }\n\n  private MenuItem CreateContextMenuItem(QueryDefinition query) {\n    var item = new MenuItem {\n      Header = query.Name,\n      ToolTip = query.Description,\n      Tag = query\n    };\n\n    item.Click += ContextMenuItem_Click;\n    return item;\n  }\n\n  private void ContextMenuItem_Click(object sender, RoutedEventArgs e) {\n    var menuItem = (MenuItem)sender;\n    AddQuery((QueryDefinition)menuItem.Tag);\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    ClosePopup();\n  }\n\n  private void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void QueryPanel_GotFocus(object sender, RoutedEventArgs e) {\n    PanelActivated?.Invoke(this, e);\n  }\n\n  private void QueryPanel_PreviewGotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) {\n    PanelActivated?.Invoke(this, e);\n  }\n\n  private void QueryPanel_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    PanelActivated?.Invoke(this, e);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/QueryValues.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Query;\n\n[Flags]\npublic enum QueryValueKind {\n  Other = 0,\n  Bool = 1 << 0,\n  Number = 1 << 1,\n  String = 1 << 2,\n  Element = 1 << 3,\n  List = 1 << 7,\n  Color = 1 << 8,\n  Input = 1 << 16\n}\n\n// Needs a notification event so that the query is redone on change\npublic class QueryValue : BindableObject {\n  private string description_;\n  private bool isWarning_;\n  private QueryValueKind kind_;\n  private string name_;\n  private object value_;\n  private string warningMessage_;\n\n  public QueryValue(int id, string name, QueryValueKind kind, string description = null) {\n    Id = id;\n    Name = name;\n    Kind = kind;\n    Description = description;\n  }\n\n  public QueryValue(int id, string name, object value, QueryValueKind kind, string description = null) {\n    Id = id;\n    Name = name;\n    Kind = kind;\n    Value = value;\n    Description = description;\n  }\n\n  public int Id { get; set; }\n\n  public QueryValueKind Kind {\n    get => kind_;\n    set => SetAndNotify(ref kind_, value);\n  }\n\n  public string Name {\n    get => name_;\n    set => SetAndNotify(ref name_, value);\n  }\n\n  public string Description {\n    get => description_;\n    set => SetAndNotify(ref description_, value);\n  }\n\n  public bool IsWarning {\n    get => isWarning_;\n    set => SetAndNotify(ref isWarning_, value);\n  }\n\n  public string WarningMessage {\n    get => warningMessage_;\n    set => SetAndNotify(ref warningMessage_, value);\n  }\n\n  public object Value {\n    get => value_;\n    set => SetAndNotify(ref value_, value);\n  }\n\n  public object Tag { get; set; }\n  public bool IsBool => Kind.HasFlag(QueryValueKind.Bool);\n  public bool IsNumber => Kind.HasFlag(QueryValueKind.Number);\n  public bool IsString => Kind.HasFlag(QueryValueKind.Number);\n  public bool IsElement => Kind.HasFlag(QueryValueKind.Element);\n  public bool IsList => Kind.HasFlag(QueryValueKind.List);\n  public bool IsColor => Kind.HasFlag(QueryValueKind.Color);\n  public bool IsInput => Kind.HasFlag(QueryValueKind.Input);\n  public bool IsOutput => !Kind.HasFlag(QueryValueKind.Input);\n\n  public static object GetDefaultValue(QueryValueKind kind) {\n    return kind switch {\n      QueryValueKind.Bool    => false,\n      QueryValueKind.Element => null,\n      QueryValueKind.Number  => 0,\n      QueryValueKind.String  => \"\",\n      QueryValueKind.Color   => Colors.White,\n      _                      => null\n    };\n  }\n\n  public void ForceValueUpdate(object newValue) {\n    // If value is the same the notify event is not triggered, but sometimes\n    // that is needed to have the query redo the temporary marking, for ex.\n    if (!SetAndNotify(ref value_, newValue, \"Value\")) {\n      NotifyPropertyChanged(nameof(Value));\n    }\n  }\n\n  public void SetWarning(string message = null) {\n    WarningMessage = message;\n    IsWarning = true;\n  }\n\n  public void ResetValue() {\n    Value = GetDefaultValue(kind_);\n    IsWarning = false;\n  }\n}\n\npublic class QueryButton : BindableObject {\n  private string text_;\n  private string description_;\n  private bool hasBoldText_;\n  private bool hasMediumText_;\n  private bool isEnabled_;\n\n  public QueryButton(string text, EventHandler<object> action = null, object data = null) {\n    Text = text;\n    Action = action;\n    Data = data;\n    IsEnabled = true;\n  }\n\n  public string Text {\n    get => text_;\n    set => SetAndNotify(ref text_, value);\n  }\n\n  public string Description {\n    get => description_;\n    set => SetAndNotify(ref description_, value);\n  }\n\n  public bool HasBoldText {\n    get => hasBoldText_;\n    set => SetAndNotify(ref hasBoldText_, value);\n  }\n\n  public bool HasMediumText {\n    get => hasMediumText_;\n    set => SetAndNotify(ref hasMediumText_, value);\n  }\n\n  public bool IsEnabled {\n    get => isEnabled_ && Action != null;\n    set => SetAndNotify(ref isEnabled_, value);\n  }\n\n  public EventHandler<object> Action { get; set; }\n  public object Data { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/QueryView.xaml",
    "content": "﻿<UserControl\n  x:Class=\"ProfileExplorer.UI.Query.QueryView\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI.Query\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  d:DesignHeight=\"450\"\n  d:DesignWidth=\"800\"\n  mc:Ignorable=\"d\">\n\n  <UserControl.Resources>\n    <DataTemplate x:Key=\"InputListTemplate\">\n      <local:InputQueryViewElement />\n    </DataTemplate>\n\n    <DataTemplate x:Key=\"OutputListTemplate\">\n      <local:OutputQueryViewElement />\n    </DataTemplate>\n\n    <DataTemplate x:Key=\"ButtonListTemplate\">\n      <local:ButtonQueryViewElement />\n    </DataTemplate>\n  </UserControl.Resources>\n\n  <Border\n    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n    BorderThickness=\"0,1,0,1\">\n    <Grid>\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"20\" />\n      </Grid.ColumnDefinitions>\n      <Grid.RowDefinitions>\n        <RowDefinition Height=\"20\" />\n        <RowDefinition Height=\"*\" />\n      </Grid.RowDefinitions>\n\n      <Grid\n        Grid.Row=\"0\"\n        Grid.Column=\"0\"\n        Grid.ColumnSpan=\"2\"\n        Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n        <TextBlock\n          Margin=\"4,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FontWeight=\"Medium\"\n          Text=\"{Binding View.Name}\"\n          ToolTip=\"{Binding View.Description}\" />\n      </Grid>\n      <!--<Button\n                x:Name=\"CloseButton\"\n                Grid.Row=\"0\"\n                Grid.Column=\"1\"\n                Background=\"{x:Null}\"\n                BorderBrush=\"{x:Null}\"\n                Click=\"CloseButton_Click\"\n                ToolTip=\"Close query panel\">\n                <Image\n                    Width=\"16\"\n                    Height=\"16\"\n                    Source=\"{StaticResource RemoveIcon}\" />\n            </Button>-->\n\n      <StackPanel\n        Grid.Row=\"1\"\n        Grid.Column=\"0\"\n        Grid.ColumnSpan=\"2\">\n\n        <ItemsControl\n          x:Name=\"InputElementList\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          ItemTemplate=\"{StaticResource InputListTemplate}\"\n          ItemsSource=\"{Binding InputValues}\">\n          <ItemsControl.ItemsPanel>\n            <ItemsPanelTemplate>\n              <VirtualizingStackPanel Orientation=\"Vertical\" />\n            </ItemsPanelTemplate>\n          </ItemsControl.ItemsPanel>\n        </ItemsControl>\n\n        <ItemsControl\n          x:Name=\"OutputElementList\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          ItemTemplate=\"{StaticResource OutputListTemplate}\"\n          ItemsSource=\"{Binding OutputValues}\">\n          <ItemsControl.ItemsPanel>\n            <ItemsPanelTemplate>\n              <VirtualizingStackPanel Orientation=\"Vertical\" />\n            </ItemsPanelTemplate>\n          </ItemsControl.ItemsPanel>\n        </ItemsControl>\n\n        <ItemsControl\n          x:Name=\"ButtonList\"\n          Padding=\"2,0,2,0\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          ItemTemplate=\"{StaticResource ButtonListTemplate}\"\n          ItemsSource=\"{Binding Buttons}\">\n          <ItemsControl.ItemsPanel>\n            <ItemsPanelTemplate>\n              <WrapPanel />\n            </ItemsPanelTemplate>\n          </ItemsControl.ItemsPanel>\n        </ItemsControl>\n      </StackPanel>\n    </Grid>\n  </Border>\n</UserControl>"
  },
  {
    "path": "src/ProfileExplorerUI/Query/QueryView.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic partial class QueryView : UserControl {\n  private QueryDefinition query_;\n\n  public QueryView() {\n    InitializeComponent();\n    DataContextChanged += QueryView_DataContextChanged;\n  }\n\n  public QueryDefinition Query {\n    get => query_;\n    set {\n      if (value != query_) {\n        query_ = value;\n        DataContext = query_;\n        InputElementList.ItemsSource = new CollectionView(query_.Data.InputValues);\n        OutputElementList.ItemsSource = new CollectionView(query_.Data.OutputValues);\n      }\n    }\n  }\n\n  public event EventHandler Closed;\n\n  private void QueryView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) {\n    if (e.OldValue != null) {\n      Closed -= ((ElementQueryInfoView)e.OldValue).OnClose;\n    }\n\n    if (e.NewValue != null) {\n      Closed += ((ElementQueryInfoView)e.NewValue).OnClose;\n    }\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    Closed?.Invoke(this, null);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Query/ScriptFunctionTask.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.UI.Scripting;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Query;\n\npublic class ScriptFunctionTask : IFunctionTask {\n  private string scriptCode_;\n  private ScriptSession scriptSession_;\n  public Exception ScriptException { get; private set; }\n  public IUISession Session { get; private set; }\n  public IFunctionTaskOptions Options { get; private set; }\n  public FunctionTaskInfo TaskInfo { get; private set; }\n  public string OutputText => scriptSession_?.OutputText;\n  public bool Result { get; private set; }\n  public string ResultMessage { get; private set; }\n\n  public async Task<bool> Execute(FunctionIR function, IRDocument document,\n                                  CancelableTask cancelableTask) {\n    var script = ScriptCache.CreateScript(scriptCode_);\n\n    if (script == null) {\n      return false; // Failed to load script.\n    }\n\n    // Options are passed through SessionObject, function through CurrentFunction,\n    // taken by the session from the document.\n    scriptSession_ = new ScriptSession(document, Session) {\n      SessionObject = Options\n    };\n\n    bool scriptResult = await script.ExecuteAsync(scriptSession_);\n\n    foreach (var pair in scriptSession_.MarkedElements) {\n      document.MarkElement(pair.Item1, pair.Item2);\n    }\n\n    foreach (var pair in scriptSession_.IconElementOverlays) {\n      var info = pair.Item2;\n      document.AddIconElementOverlay(pair.Item1, info.Icon, 16, 16,\n                                     info.Label, info.ToolTip, info.AlignmentX,\n                                     VerticalAlignment.Center, info.MarginX);\n    }\n\n    ScriptException = script.ScriptException;\n    Result = scriptSession_.SessionResult;\n    ResultMessage = scriptSession_.SessionResultMessage;\n    return scriptResult;\n  }\n\n  public bool Initialize(IUISession session, FunctionTaskInfo taskInfo, object optionalData) {\n    Session = session;\n    TaskInfo = taskInfo;\n    scriptCode_ = (string)optionalData;\n    LoadOptions();\n    return true;\n  }\n\n  public void SaveOptions() {\n    if (Options != null) {\n      Session.SaveFunctionTaskOptions(TaskInfo, Options);\n    }\n  }\n\n  public void ResetOptions() {\n    if (TaskInfo.OptionsType == null) {\n      return;\n    }\n\n    Options = (IFunctionTaskOptions)Activator.CreateInstance(TaskInfo.OptionsType);\n    Options.Reset();\n  }\n\n  public QueryData GetOptionsValues() {\n    var data = new QueryData();\n    data.AddInputs(Options);\n    return data;\n  }\n\n  public void LoadOptionsFromValues(QueryData data) {\n    Options = (IFunctionTaskOptions)data.ExtractInputs(TaskInfo.OptionsType);\n  }\n\n  public static FunctionTaskDefinition GetDefinition(string scriptCode) {\n    try {\n      dynamic scriptInstance = ScriptCache.CreateScriptInstance(scriptCode);\n\n      if (scriptInstance == null) {\n        return null; // Failed to load script.\n      }\n\n      FunctionTaskInfo taskInfo = scriptInstance.GetTaskInfo();\n      return new FunctionTaskDefinition(typeof(ScriptFunctionTask), taskInfo, scriptCode);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load script function task: {ex.Message}\");\n      return null;\n    }\n  }\n\n  private void LoadOptions() {\n    var options = Session.LoadFunctionTaskOptions(TaskInfo);\n\n    if (options != null) {\n      Options = options;\n    }\n    else {\n      ResetOptions();\n    }\n  }\n\n  // The script cache is used mostly to ensure there is a single instance\n  // of the script object being created and the options type provided in GetDefinition\n  // (FunctionTaskInfo.OptionsType) will be compatible with the type when the script executes. \n  // Compiling the script twice would create two randomly-named binaries and the options type\n  // would be incompatible when it's exactly the same.\n  private static class ScriptCache {\n    private static Dictionary<string, Script> cache_;\n    private static Dictionary<string, dynamic> instanceCache_;\n    private static object lockObject_;\n\n    static ScriptCache() {\n      cache_ = new Dictionary<string, Script>();\n      instanceCache_ = new Dictionary<string, dynamic>();\n      lockObject_ = new object();\n    }\n\n    public static Script CreateScript(string scriptCode) {\n      lock (lockObject_) {\n        if (cache_.TryGetValue(scriptCode, out var script)) {\n          return script;\n        }\n\n        script = new Script(scriptCode);\n        cache_[scriptCode] = script;\n\n        dynamic instance = script.LoadScript();\n        instanceCache_[scriptCode] = instance;\n        return instance != null ? script : null;\n      }\n    }\n\n    public static dynamic CreateScriptInstance(string scriptCode) {\n      var script = CreateScript(scriptCode);\n\n      if (script != null) {\n        lock (lockObject_) {\n          return instanceCache_[scriptCode];\n        }\n      }\n\n      return null;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Remarks/Remark.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\n[Flags]\npublic enum RemarkKind {\n  None,\n  Default,\n  Verbose,\n  Trace,\n  Warning,\n  Error,\n  Optimization,\n  Analysis\n}\n\npublic class RemarkCategory {\n  public RemarkKind Kind { get; set; }\n  public string Title { get; set; } // VN,CE/BE/ALIAS, etc\n  public bool HasTitle => !string.IsNullOrEmpty(Title);\n  public bool ExpectInstructionIR { get; set; }\n  public string SearchedText { get; set; }\n  public TextSearchKind SearchKind { get; set; }\n  public bool AddTextMark { get; set; }\n  public Color TextMarkBorderColor { get; set; }\n  public double TextMarkBorderWeight { get; set; }\n  public bool AddLeftMarginMark { get; set; }\n  public Color MarkColor { get; set; }\n  public int MarkIconIndex { get; set; }\n}\n\npublic class RemarkSectionBoundary {\n  public string SearchedText { get; set; }\n  public TextSearchKind SearchKind { get; set; }\n}\n\npublic class RemarkTextHighlighting {\n  public string SearchedText { get; set; }\n  public TextSearchKind SearchKind { get; set; }\n  public bool UseBoldText { get; set; }\n  public bool UseItalicText { get; set; }\n  public Color TextColor { get; set; }\n  public Color BackgroundColor { get; set; }\n  public bool HasTextColor => TextColor != Colors.Black;\n  public bool HasBackgroundColor => BackgroundColor != Colors.Black;\n}\n\npublic class RemarkContext {\n  public RemarkContext(string id, string name, RemarkContext parent = null) {\n    Id = id;\n    Name = name;\n    Parent = parent;\n    Remarks = new List<Remark>();\n    Children = new List<RemarkContext>();\n  }\n\n  public string Id { get; set; }\n  public string Name { get; set; }\n  public int StartLine { get; set; }\n  public int EndLine { get; set; }\n  public List<Remark> Remarks { get; set; }\n  public RemarkContext Parent { get; set; }\n  public List<RemarkContext> Children { get; set; }\n  public int ContextTreeLevel => Parent != null ? Parent.ContextTreeLevel + 1 : 0;\n\n  public override string ToString() {\n    var builder = new StringBuilder();\n    builder.AppendLine($\"remark context name: {Name}, id: {Id}, has parent: {Parent != null}\");\n    builder.AppendLine($\"> {Remarks.Count} remarks:\");\n\n    foreach (var remark in Remarks) {\n      builder.AppendLine($\"  o \\\"{remark.RemarkText}\\\"\".Indent(4));\n    }\n\n    builder.AppendLine($\"> {Children.Count} children:\");\n\n    foreach (var child in Children) {\n      builder.AppendLine($\"  o {child}\".Indent(4));\n    }\n\n    return builder.ToString();\n  }\n}\n\npublic class Remark {\n  public Remark(RemarkCategory category, IRTextSection section,\n                string remarkText, string remarkLine,\n                TextLocation remarkLocation, bool isInstr) {\n    Category = category;\n    Section = section;\n    RemarkText = remarkText;\n    RemarkLine = remarkLine;\n    RemarkLocation = remarkLocation;\n    IsInstructionRemark = true;\n    ReferencedElements = new List<IRElement>(1);\n    OutputElements = new List<IRElement>(1);\n  }\n\n  public RemarkCategory Category { get; set; }\n  public RemarkKind Kind => Category.Kind;\n  public IRTextSection Section { get; set; }\n  public string RemarkText { get; set; }\n  public string RemarkLine { get; set; }\n  public TextLocation RemarkLocation { get; set; }\n  public List<IRElement> ReferencedElements { get; set; }\n  public List<IRElement> OutputElements { get; set; }\n  public RemarkContext Context { get; set; }\n  public bool IsInstructionRemark { get; set; }\n  public int Priority => Kind switch {\n    RemarkKind.Default      => 2,\n    RemarkKind.Verbose      => 3,\n    RemarkKind.Trace        => 4,\n    RemarkKind.Warning      => 5,\n    RemarkKind.Error        => 6,\n    RemarkKind.Optimization => 0, // 0 is most important\n    RemarkKind.Analysis     => 1,\n    _                       => throw new ArgumentOutOfRangeException()\n  };\n\n  public override string ToString() {\n    string text = $\"remark kind: {Kind}, text: \\\"{RemarkText}\\\", section: \\\"{Section}\\\"\";\n\n    if (Context != null) {\n      text += $\"\\n  {Context.ToString().Indent(2)}\";\n    }\n\n    return text;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Remarks/RemarkLineGroup.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic class RemarkLineGroup {\n  public RemarkLineGroup(int line) {\n    LineNumber = line;\n    Remarks = new List<Remark>();\n  }\n\n  public RemarkLineGroup(int line, Remark remark) : this(line) {\n    Add(remark, null);\n  }\n\n  public int LineNumber { get; set; }\n  public List<Remark> Remarks { get; set; }\n  public Remark LeaderRemark { get; set; }\n\n  public void Add(Remark remark, IRTextSection currentSection) {\n    // Don't add multiple remarks referencing the same output text location,\n    // can happen when both an instruction and its operands are marked.\n    if (Remarks.Find(item => item.RemarkLocation == remark.RemarkLocation) != null) {\n      return;\n    }\n\n    Remarks.Add(remark);\n\n    if (LeaderRemark == null || remark.Priority < LeaderRemark.Priority) {\n      LeaderRemark = remark;\n    }\n    else if (remark.Priority == LeaderRemark.Priority &&\n             remark.Section == currentSection &&\n             remark.IsInstructionRemark && !LeaderRemark.IsInstructionRemark) {\n      // Prefer a whole instruction remark if same priority.\n      LeaderRemark = remark;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Remarks/RemarksDefinitionSerializer.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\n\nnamespace ProfileExplorer.UI;\n\nclass RemarksDefinitionSerializer {\n  public bool Save(List<RemarkCategory> categories,\n                   List<RemarkSectionBoundary> boundaries,\n                   List<RemarkTextHighlighting> highlighting,\n                   string path) {\n    var data = new SerializedData {\n      RemarkCategoryList = categories,\n      SectionBoundaryList = boundaries\n    };\n\n    return UIJsonUtils.SerializeToFile(data, path);\n  }\n\n  public bool Load(string path,\n                   out List<RemarkCategory> categories,\n                   out List<RemarkSectionBoundary> boundaries,\n                   out List<RemarkTextHighlighting> highlighting) {\n    if (UIJsonUtils.DeserializeFromFile(path, out SerializedData data)) {\n      categories = data.RemarkCategoryList;\n      boundaries = data.SectionBoundaryList;\n      highlighting = data.RemarkHighlightingList;\n      return categories != null &&\n             boundaries != null &&\n             highlighting != null;\n    }\n\n    categories = new List<RemarkCategory>();\n    boundaries = new List<RemarkSectionBoundary>();\n    highlighting = new List<RemarkTextHighlighting>();\n    return false;\n  }\n\n  private class SerializedData {\n    public string Comment1 =>\n      \"Add remark definitions to the list found below, including the kind, searched text that should be part of the remark, a type of search to perform (simple/regex,etc) and how to highlight the remark, using an underline and/or marker on the left-side margin with a certain color\";\n    public string Comment2 =>\n      \"Remark categories are defined in the RemarkCategoryList, remark section stop boundaries in SectionBoundaryList\";\n    public string Comment3 =>\n      \"Use the KindValues/SearchKindValues strings listed below as the enumeration values for the corresponding members\";\n    public string[] KindValues =>\n      new[] {\n        \"default\", \"optimization\", \"analysis\", \"verbose\", \"trace\"\n      };\n    public string[] SearchKindValues =>\n      new[] {\n        \"default\", \"regex\", \"caseSensitive\", \"wholeWord\"\n      };\n    public List<RemarkCategory> RemarkCategoryList { get; set; }\n    public List<RemarkSectionBoundary> SectionBoundaryList { get; set; }\n    public List<RemarkTextHighlighting> RemarkHighlightingList { get; set; }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Scripting/ElementQueryScript.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing ProfileExplorer.UI.Query;\n\nnamespace ProfileExplorer.UI.Scripting;\n// Two parts: a static? method that returns a QueryData,\n// having the required input/output fields defined\n// The actual \"execute\" method that gets the QueryData,\n// runs the script and populates the output values\n\npublic class ElementQueryScript : Script, IElementQuery {\n  private IUISession session_;\n\n  public ElementQueryScript(string code) : base(code) {\n  }\n\n  public QueryDefinition Query { get; set; }\n  public IUISession Session => session_;\n\n  public bool Initialize(IUISession session) {\n    session_ = session;\n    return true;\n  }\n\n  public bool Execute(QueryData data) {\n    MessageBox.Show(\"Execute ElementQueryScript\");\n    return true;\n  }\n\n  public QueryDefinition GetDefinition() {\n    throw new NotImplementedException();\n  }\n\n  //public override bool Execute(ScriptSession session) {\n  //    return base.Execute(session);\n  //}\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Scripting/Script.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing CSScriptLib;\n\nnamespace ProfileExplorer.UI.Scripting;\n\npublic class Script {\n  private static readonly string WarmUpScript =\n    string.Join(Environment.NewLine,\n                \"using System;\",\n                \"using System.Collections.Generic;\",\n                \"using System.Windows.Media;\",\n                \"using ProfileExplorer.Core;\", \"using ProfileExplorer.Core.IR;\",\n                \"using ProfileExplorer.Core.Analysis;\",\n                \"using ProfileExplorer.UI;\",\n                \"using ProfileExplorer.UI.Scripting;\",\n                \"public class Script {\",\n                \"    public bool Execute(ScriptSession s) {\",\n                \"        return true;\",\n                \"    }\",\n                \"}\");\n  private static object lockObject_;\n  private static long initialized_;\n  private dynamic script_;\n\n  static Script() {\n    initialized_ = 0;\n    lockObject_ = new object();\n  }\n\n  public Script(string code, string name = \"\") {\n    Name = name;\n    Code = code;\n  }\n\n  public string Name { get; set; }\n  public string Code { get; set; }\n  public bool ScriptResult { get; set; }\n  public Exception ScriptException { get; set; }\n\n  public static Script LoadFromFile(string filePath, string name = \"\") {\n    try {\n      return new Script(File.ReadAllText(filePath), name);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load script from file {filePath}: {ex.Message}\");\n      return null;\n    }\n  }\n\n  public static bool WarmUp() {\n    // Initializing the Roslyn script engine can take 2-3 sec, a one-time cost,\n    // this allows it to be done on a background thread before any script runs.\n    if (Interlocked.Read(ref initialized_) != 0) {\n      return true;\n    }\n\n    lock (lockObject_) {\n      if (Interlocked.Read(ref initialized_) != 0) {\n        return true;\n      }\n\n      var script = new Script(WarmUpScript);\n      bool result = script.Execute(null, true);\n      Interlocked.Exchange(ref initialized_, 1);\n      return result;\n    }\n  }\n\n  public dynamic LoadScript() {\n    if (script_ == null) {\n      // Load and compile the script only once.\n      try {\n        CSScript.EvaluatorConfig.Engine = EvaluatorEngine.Roslyn;\n        script_ = CSScript.Evaluator.LoadCode(Code);\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to compile script: {ex.Message}\");\n        return null;\n      }\n    }\n\n    return script_;\n  }\n\n  public bool Execute(ScriptSession session) {\n    return Execute(session, false);\n  }\n\n  public Task<bool> ExecuteAsync(ScriptSession session) {\n    return Task.Run(() => Execute(session));\n  }\n\n  public async Task<bool> ExecuteAsync(ScriptSession session, TimeSpan timeout) {\n    var task = ExecuteAsync(session);\n\n    if (await Task.WhenAny(task, Task.Delay(timeout)).ConfigureAwait(false) == task) {\n      return await task.ConfigureAwait(false);\n    }\n\n    session.Cancel();\n    ScriptException = new TimeoutException(\"Script timed out\");\n    return false;\n  }\n\n  private bool Execute(ScriptSession session, bool fromWarmUp) {\n    if (!fromWarmUp && !WarmUp()) {\n      return false;\n    }\n\n    try {\n      LoadScript();\n      ScriptResult = script_.Execute(session);\n      return true;\n    }\n    catch (Exception ex) {\n      ScriptException = ex;\n      return false;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Scripting/ScriptAutoComplete.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Media;\nusing ICSharpCode.AvalonEdit.CodeCompletion;\nusing ICSharpCode.AvalonEdit.Document;\nusing ICSharpCode.AvalonEdit.Editing;\nusing Microsoft.CodeAnalysis;\nusing Microsoft.CodeAnalysis.Completion;\nusing Microsoft.CodeAnalysis.Host.Mef;\nusing Microsoft.CodeAnalysis.Text;\n\nnamespace ProfileExplorer.UI.Scripting;\n\npublic enum AutocompleteEntryKind {\n  Field,\n  Method,\n  Property,\n  Symbol,\n  Class,\n  Keyword\n}\n\npublic class AutocompleteEntry : ICompletionData {\n  private static Dictionary<AutocompleteEntryKind, ImageSource> icons_;\n\n  static AutocompleteEntry() {\n    icons_ = new Dictionary<AutocompleteEntryKind, ImageSource>();\n    icons_[AutocompleteEntryKind.Field] = (ImageSource)Application.Current.Resources[\"TagIcon\"];\n    icons_[AutocompleteEntryKind.Method] = (ImageSource)Application.Current.Resources[\"ZapIcon\"];\n    icons_[AutocompleteEntryKind.Property] = (ImageSource)Application.Current.Resources[\"TagIcon\"];\n    icons_[AutocompleteEntryKind.Symbol] = (ImageSource)Application.Current.Resources[\"WholeWordIcon\"];\n    icons_[AutocompleteEntryKind.Class] = (ImageSource)Application.Current.Resources[\"DocumentIcon\"];\n    icons_[AutocompleteEntryKind.Keyword] = (ImageSource)Application.Current.Resources[\"DotIcon\"];\n  }\n\n  public AutocompleteEntry(AutocompleteEntryKind kind, bool isPreferred, string text,\n                           CompletionItem completionItem) {\n    Kind = kind;\n    IsPreferred = isPreferred;\n    Text = text;\n    CompletionItem = completionItem;\n  }\n\n  public AutocompleteEntryKind Kind { get; set; }\n  public bool IsPreferred { get; set; }\n  public string DescriptionText { get; set; }\n  public CompletionItem CompletionItem { get; set; }\n  public string Text { get; set; }\n  public object Content => Text;\n  public double Priority => 1;\n  public object Description { get; set; }\n  public ImageSource Image => icons_[Kind];\n\n  public void Complete(TextArea textArea, ISegment completionSegment,\n                       EventArgs insertionRequestEventArgs) {\n    textArea.Document.Replace(completionSegment, Text);\n  }\n}\n\npublic class ScriptAutoComplete {\n  private static long initialized_;\n  private static object lockObject_;\n  private Microsoft.CodeAnalysis.Document roslynDocument_;\n\n  static ScriptAutoComplete() {\n    initialized_ = 0;\n    lockObject_ = new object();\n  }\n\n  public static bool WarmUp() {\n    if (Interlocked.Read(ref initialized_) != 0) {\n      return true;\n    }\n\n    lock (lockObject_) {\n      if (Interlocked.Read(ref initialized_) != 0) {\n        return true;\n      }\n\n      var autoComplete = new ScriptAutoComplete();\n      bool result = autoComplete.SetupAutocomplete(fromWarmUp: true);\n      Interlocked.Exchange(ref initialized_, 1);\n      return result;\n    }\n  }\n\n  public static string GetCurrentWord(string text, int position) {\n    // Extend left as long the characters are valid identifiers letters.\n    int endPosition = position;\n\n    while (position > 0) {\n      if (char.IsLetterOrDigit(text[position]) || text[position] == '_') {\n        position--;\n      }\n      else {\n        position++;\n        break;\n      }\n    }\n\n    return text.Substring(position, endPosition - position + 1);\n  }\n\n  public async Task<List<Diagnostic>> GetSourceErrorsAsync(string text) {\n    var diagnostics = new List<Diagnostic>();\n\n    if (!SetupAutocomplete()) {\n      return diagnostics;\n    }\n\n    var sourceText = SourceText.From(text);\n    var document = roslynDocument_.WithText(sourceText);\n    var model = await document.GetSemanticModelAsync().ConfigureAwait(false);\n    var results = model.GetDiagnostics();\n\n    if (results != null) {\n      foreach (var result in results) {\n        if (result.Severity == DiagnosticSeverity.Error) {\n          diagnostics.Add(result);\n        }\n      }\n    }\n\n    return diagnostics;\n  }\n\n  public async Task<List<AutocompleteEntry>>\n    GetSuggestionsAsync(string text, int position, string changedText = \"\") {\n    var suggestionList = new List<AutocompleteEntry>();\n\n    if (!IsAutocompleteTrigger(text, position - 1)) {\n      return suggestionList;\n    }\n\n    // If inserted text is whitespace, ignore.\n    if (!string.IsNullOrEmpty(changedText) && string.IsNullOrWhiteSpace(changedText)) {\n      return suggestionList;\n    }\n\n    if (!SetupAutocomplete()) {\n      return suggestionList; // Failed to initialize Roslyn.\n    }\n\n    // Get the initial list of suggestions from Roslyn. This list is usually\n    // very large and is filtered and sorted below.\n    var sourceText = SourceText.From(text);\n    var document = roslynDocument_.WithText(sourceText);\n    var completionService = CompletionService.GetService(document);\n    var results = await completionService.\n      GetCompletionsAsync(document, position).ConfigureAwait(false);\n\n    if (results == null) {\n      return suggestionList;\n    }\n\n    if (changedText == \".\") {\n      // Class member list, doesn't need extra filtering.\n      foreach (var item in results.Items) {\n        if (item.Tags.Contains(\"Public\")) {\n          bool preselect = preselect = item.Rules.MatchPriority == MatchPriority.Preselect;\n          suggestionList.Add(new AutocompleteEntry(AutocompleteEntryKind.Symbol,\n                                                   preselect, item.DisplayText, item));\n        }\n      }\n\n      await AddDescription(suggestionList, completionService, document).ConfigureAwait(false);\n      return suggestionList;\n    }\n\n    string word = GetCurrentWord(text, position - 1);\n\n    if (!IsValidWord(word) || word.Length < 2) {\n      // When using backspace, keep showing the autocomplete box for a single letter.\n      if (!(word.Length == 1 && char.IsLetter(word[0]) &&\n            string.IsNullOrEmpty(changedText))) {\n        return suggestionList;\n      }\n    }\n\n    // Variable/function/keyword list, needs filtering to trim down.\n    CompletionItem exactMatchItem = null;\n    int substringMatchItems = 0;\n\n    foreach (var item in results.Items) {\n      bool preselect = preselect = item.Rules.MatchPriority == MatchPriority.Preselect;\n      string displayText = item.DisplayText;\n      string completionText = displayText;\n\n      if (displayText.IsValidCompletionFor(word)) {\n        if (!item.UseDisplayTextAsCompletionText() &&\n            displayText.StartsWith(word, StringComparison.OrdinalIgnoreCase)) {\n          // Check for complete and prefix match of the current word.\n          substringMatchItems++;\n\n          if (displayText == word) {\n            exactMatchItem = item;\n          }\n        }\n\n        suggestionList.Add(new AutocompleteEntry(AutocompleteEntryKind.Symbol,\n                                                 preselect, completionText, item));\n      }\n    }\n\n    if (suggestionList.Count == 0) {\n      return suggestionList;\n    }\n\n    // If there's an exact match and no other items having it as a prefix,\n    // don't return any suggestions.\n    if (exactMatchItem != null && substringMatchItems == 1) {\n      suggestionList.Clear();\n      return suggestionList;\n    }\n\n    // Sort the suggestions by best match, then take the top N.\n    // The description is retrieved only for those, since it is fairly slow.\n    var sortedData = suggestionList.OrderByDescending(c => c.IsPreferred).\n      ThenByDescending(c => c.Text.StartsWithExactCase(word)).\n      ThenByDescending(c => c.Text.StartsWithIgnoreCase(word)).\n      ThenByDescending(c => c.Text.IsSubsequenceMatch(word)).\n      ThenBy(c => c.Text, StringComparer.OrdinalIgnoreCase).Take(20);\n\n    await AddDescription(sortedData, completionService, document).ConfigureAwait(false);\n\n    // The description includes the namespace, sort again so that\n    // Profile Explorer API entries are placed  closer to the front.\n    sortedData = sortedData.OrderByDescending(c => c.IsPreferred).\n      ThenByDescending(c => c.Text.StartsWithExactCase(word)).\n      ThenByDescending(c => c.DescriptionText.Contains(\"ProfileExplorer\",\n                                                       StringComparison.Ordinal));\n    return sortedData.ToList();\n  }\n\n  private async Task AddDescription(IEnumerable<AutocompleteEntry> sortedData,\n                                    CompletionService completionService,\n                                    Microsoft.CodeAnalysis.Document document) {\n    foreach (var item in sortedData) {\n      var description = await completionService.\n        GetDescriptionAsync(document, item.CompletionItem).ConfigureAwait(false);\n      string descriptionText = description != null ? description.Text : \"\";\n      item.Description = descriptionText;\n      item.DescriptionText = descriptionText;\n      item.Kind = GetAutocompleteKind(item.CompletionItem);\n    }\n  }\n\n  private bool SetupAutocomplete(bool fromWarmUp = false) {\n    if (!fromWarmUp && !WarmUp()) {\n      return false;\n    }\n\n    if (roslynDocument_ != null) {\n      return true;\n    }\n\n    try {\n      // Load the binaries currently referenced by Profile Explorer,\n      // this will include the entire API and all .NET Core libraries.\n      var host = MefHostServices.Create(MefHostServices.DefaultAssemblies);\n      var workspace = new AdhocWorkspace(host);\n      var assemblyRefs = new List<PortableExecutableReference>();\n\n      foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) {\n        try {\n          assemblyRefs.Add(MetadataReference.CreateFromFile(assembly.Location));\n        }\n        catch (Exception ex) {\n          // Dynamic assemblies don't have a valid location, ignore.\n          if (!assembly.IsDynamic) {\n            Trace.TraceWarning(\n              $\"Failed to setup scripting auto-complete for assembly {assembly.Location}: {ex.Message}\");\n          }\n        }\n      }\n\n      var projectInfo = ProjectInfo.Create(ProjectId.CreateNewId(), VersionStamp.Create(),\n                                           \"Script\", \"Script\", LanguageNames.CSharp).\n        WithMetadataReferences(assemblyRefs);\n      var project = workspace.AddProject(projectInfo);\n      roslynDocument_ = workspace.AddDocument(project.Id, \"script.cs\", SourceText.From(\"\"));\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to setup scripting auto-complete {ex.Message}\");\n      return false;\n    }\n  }\n\n  private bool IsValidWord(string word) {\n    foreach (char letter in word) {\n      if (!char.IsLetterOrDigit(letter)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  private bool IsAutocompleteTrigger(string text, int position) {\n    if (text[position] == '.') {\n      return true;\n    }\n\n    if (char.IsLetter(text[position])) {\n      return true;\n    }\n\n    if (char.IsDigit(text[position])) {\n      // Accept a digit only if it's part of an identifier.\n      bool foundLetter = false;\n\n      for (int i = position - 1; i >= 0; i--) {\n        if (char.IsLetter(text[i])) {\n          foundLetter = true;\n        }\n        else if (!char.IsDigit(text[i]) || text[i] == '_') {\n          break;\n        }\n      }\n\n      return foundLetter;\n    }\n\n    return false;\n  }\n\n  private AutocompleteEntryKind GetAutocompleteKind(CompletionItem result) {\n    if (result.Tags.Contains(\"Method\")) {\n      return AutocompleteEntryKind.Method;\n    }\n\n    if (result.Tags.Contains(\"Field\")) {\n      return AutocompleteEntryKind.Field;\n    }\n\n    if (result.Tags.Contains(\"Class\")) {\n      return AutocompleteEntryKind.Class;\n    }\n\n    if (result.Tags.Contains(\"Struct\")) {\n      return AutocompleteEntryKind.Class;\n    }\n\n    if (result.Tags.Contains(\"Keyword\")) {\n      return AutocompleteEntryKind.Keyword;\n    }\n\n    return AutocompleteEntryKind.Property;\n  }\n}\n\nstatic class StringExtensions {\n  private const string NamedParameterCompletionProvider =\n    \"Microsoft.CodeAnalysis.CSharp.Completion.Providers.NamedParameterCompletionProvider\";\n  private const string OverrideCompletionProvider =\n    \"Microsoft.CodeAnalysis.CSharp.Completion.Providers.OverrideCompletionProvider\";\n  private static readonly PropertyInfo getProviderName_;\n\n  static StringExtensions() {\n    getProviderName_ = typeof(CompletionItem).GetProperty(\"ProviderName\", BindingFlags.NonPublic |\n                                                                          BindingFlags.Instance);\n  }\n\n  public static bool UseDisplayTextAsCompletionText(this CompletionItem completionItem) {\n    string provider = GetProviderName(completionItem);\n    return provider == NamedParameterCompletionProvider || provider == OverrideCompletionProvider;\n  }\n\n  public static bool IsValidCompletionFor(this string completion, string partial) {\n    return completion.StartsWithIgnoreCase(partial) || completion.IsSubsequenceMatch(partial);\n  }\n\n  public static bool StartsWithExactCase(this string completion, string partial) {\n    return completion.StartsWith(partial, StringComparison.Ordinal);\n  }\n\n  public static bool StartsWithIgnoreCase(this string completion, string partial) {\n    return completion.StartsWith(partial, StringComparison.OrdinalIgnoreCase);\n  }\n\n  public static bool IsCamelCaseMatch(this string completion, string partial) {\n    return new string(completion.Where(c => c >= 'A' && c <= 'Z').ToArray()).\n      StartsWith(partial, StringComparison.OrdinalIgnoreCase);\n  }\n\n  public static bool IsSubsequenceMatch(this string completion, string partial) {\n    if (string.IsNullOrEmpty(partial)) {\n      return true;\n    }\n\n    if (partial.Length > 1 &&\n        completion.IndexOf(partial, StringComparison.InvariantCultureIgnoreCase) >= 0) {\n      return true;\n    }\n\n    return ComputeEditingDistance(completion, partial, 2) <= 1;\n  }\n\n  private static bool FirstLetterMatches(string word, string match) {\n    if (string.IsNullOrEmpty(match)) {\n      return false;\n    }\n\n    return char.ToLowerInvariant(word[0]) == char.ToLowerInvariant(match[0]);\n  }\n\n  private static string GetProviderName(CompletionItem item) {\n    return (string)getProviderName_.GetValue(item);\n  }\n\n  private static int ComputeEditingDistance(string source, string target, int threshold) {\n    // Damerau-Levenshtein editing distance algorithm based on https://stackoverflow.com/a/9454016\n    int length1 = source.Length;\n    int length2 = target.Length;\n\n    // Return trivial case - difference in string lengths exceeds threshold.\n    if (Math.Abs(length1 - length2) > threshold) { return int.MaxValue; }\n\n    // Ensure arrays [i] / length1 use shorter length\n    if (length1 > length2) {\n      Swap(ref target, ref source);\n      Swap(ref length1, ref length2);\n    }\n\n    int maxi = length1;\n    int maxj = length2;\n\n    int[] dCurrent = new int[maxi + 1];\n    int[] dMinus1 = new int[maxi + 1];\n    int[] dMinus2 = new int[maxi + 1];\n    int[] dSwap;\n\n    for (int i = 0; i <= maxi; i++) { dCurrent[i] = i; }\n\n    int jm1 = 0, im1 = 0, im2 = -1;\n\n    for (int j = 1; j <= maxj; j++) {\n      // Rotate\n      dSwap = dMinus2;\n      dMinus2 = dMinus1;\n      dMinus1 = dCurrent;\n      dCurrent = dSwap;\n\n      // Initialize\n      int minDistance = int.MaxValue;\n      dCurrent[0] = j;\n      im1 = 0;\n      im2 = -1;\n\n      for (int i = 1; i <= maxi; i++) {\n        int cost = source[im1] == target[jm1] ? 0 : 1;\n\n        int del = dCurrent[im1] + 1;\n        int ins = dMinus1[i] + 1;\n        int sub = dMinus1[im1] + cost;\n\n        //Fastest execution for min value of 3 integers\n        int min = del > ins ? ins > sub ? sub : ins : del > sub ? sub : del;\n\n        if (i > 1 && j > 1 && source[im2] == target[jm1] && source[im1] == target[j - 2])\n          min = Math.Min(min, dMinus2[im2] + cost);\n\n        dCurrent[i] = min;\n\n        if (min < minDistance) { minDistance = min; }\n\n        im1++;\n        im2++;\n      }\n\n      jm1++;\n\n      if (minDistance > threshold) { return int.MaxValue; }\n    }\n\n    int result = dCurrent[maxi];\n    return result > threshold ? int.MaxValue : result;\n  }\n\n  private static void Swap<T>(ref T arg1, ref T arg2) {\n    var temp = arg1;\n    arg1 = arg2;\n    arg2 = temp;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Scripting/ScriptSession.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI.Scripting;\n\npublic class IconOverlayInfo {\n  public IconDrawing Icon { get; set; }\n  public string Label { get; set; }\n  public string ToolTip { get; set; }\n  public HorizontalAlignment AlignmentX { get; set; }\n  public double MarginX { get; set; }\n}\n\npublic class ScriptSession {\n  private AnalysisInfo analysis_;\n  private StringBuilder builder_;\n  private IRDocument document_;\n  private List<Tuple<IRElement, Color>> markedElements_;\n  private List<Tuple<IRElement, IconOverlayInfo>> iconElementOverlays_;\n  private CancelableTask task_;\n  private IUISession session_;\n  private Dictionary<string, object> variables_;\n  private string sectionText_;\n\n  public ScriptSession(IRDocument document, IUISession session) {\n    task_ = new CancelableTask();\n    document_ = document;\n    session_ = session;\n    builder_ = new StringBuilder();\n    markedElements_ = new List<Tuple<IRElement, Color>>();\n    iconElementOverlays_ = new List<Tuple<IRElement, IconOverlayInfo>>();\n    variables_ = new Dictionary<string, object>();\n\n    if (document != null) {\n      analysis_ = new AnalysisInfo(document.Function, session.CompilerInfo.IR);\n    }\n  }\n\n  public string SessionName { get; set; }\n  public object SessionObject { get; set; }\n  public bool SessionResult { get; set; }\n  public string SessionResultMessage { get; set; }\n  public bool IsCanceled => task_.IsCanceled;\n  public bool SilentMode { get; set; }\n  public string OutputText => builder_.ToString();\n  public List<Tuple<IRElement, Color>> MarkedElements => markedElements_;\n  public List<Tuple<IRElement, IconOverlayInfo>> IconElementOverlays => iconElementOverlays_;\n  public AnalysisInfo Analysis => analysis_;\n  public FunctionIR CurrentFunction => document_?.Function;\n  public IRTextSection CurrentSection => document_?.Section;\n\n  public string CurrentSectionText {\n    get {\n      // Cache the section text.\n      if (sectionText_ == null && CurrentSection != null) {\n        sectionText_ = GetSectionText(CurrentSection);\n      }\n\n      return sectionText_;\n    }\n  }\n\n  public string IRName => session_.CompilerInfo.CompilerIRName;\n  public ICompilerIRInfo IR => session_.CompilerInfo.IR;\n  public bool IsInTwoDocumentsDiffMode => session_.IsInTwoDocumentsDiffMode;\n  public IRTextSummary MainDocument => session_.MainDocumentSummary;\n  public IRTextSummary DiffDocument => session_.DiffDocumentSummary;\n\n  public bool AddVariable<T>(string name, T value) where T : class {\n    return variables_.TryAdd(name, value);\n  }\n\n  public T GetVariable<T>(string name, T defaultValue = null) where T : class {\n    if (variables_.TryGetValue(name, out object value)) {\n      if (value is T valueOfT) {\n        return valueOfT;\n      }\n    }\n\n    if (defaultValue != null) {\n      return defaultValue;\n    }\n\n    throw new InvalidOperationException($\"Variable {name} not found or has unexpected type!\");\n  }\n\n  public FunctionIR ParseSection(IRTextSection section) {\n    var errorHandler = IR.CreateParsingErrorHandler();\n    var parser = IR.CreateSectionParser(errorHandler);\n    string text = session_.GetSectionTextAsync(section).Result;\n    return parser.ParseSection(section, text);\n  }\n\n  public string GetSectionText(IRTextSection section) {\n    return session_.GetSectionTextAsync(section).Result;\n  }\n\n  public void Cancel() {\n    task_.Cancel();\n  }\n\n  public void SetSessionResult(bool result, string message = \"\") {\n    SessionResult = result;\n    SessionResultMessage = message;\n  }\n\n  public void Mark(IRElement element, Color color) {\n    markedElements_.Add(new Tuple<IRElement, Color>(element, color));\n  }\n\n  public void Mark(IRElement element) {\n    markedElements_.Add(new Tuple<IRElement, Color>(element, Colors.Gold));\n  }\n\n  public void AddIcon(IRElement element, string iconName, string text = \"\") {\n    var icon = IconDrawing.FromIconResource(iconName);\n\n    if (icon == null) {\n      WriteLine($\"Failed to add element icon with name {iconName}\");\n      return;\n    }\n\n    iconElementOverlays_.Add(new Tuple<IRElement, IconOverlayInfo>(\n                               element,\n                               new IconOverlayInfo {\n                                 Icon = icon,\n                                 Label = text,\n                                 AlignmentX = HorizontalAlignment.Right\n                               }));\n  }\n\n  public void AddWarningIcon(IRElement element, string text = \"\") {\n    AddIcon(element, \"WarningIconColor\", text);\n  }\n\n  public void Write(string format, params object[] args) {\n    string text = string.Format(format, args);\n    builder_.Append(text);\n  }\n\n  public void WriteLine(string format, params object[] args) {\n    string text = string.Format(format, args);\n    builder_.AppendLine(text);\n  }\n\n  public void WriteLine() {\n    builder_.AppendLine();\n  }\n\n  /// <summary>\n  ///   Writes the text (IR) representing the element.\n  /// </summary>\n  /// <param name=\"element\">The IR element to print</param>\n  /// <param name=\"section\">\n  ///   The IR text section to use as a text source. If null it uses\n  ///   CurrentSectionText\n  /// </param>\n  public void Write(IRElement element, IRTextSection section = null) {\n    string text;\n\n    if (section == null) {\n      text = CurrentSectionText;\n    }\n    else {\n      text = GetSectionText(section);\n    }\n\n    Write(text.Substring(element.TextLocation.Offset, element.TextLength));\n  }\n\n  public void WriteLine(IRElement element, IRTextSection section = null) {\n    Write(element, section);\n    WriteLine();\n  }\n\n  public void Message(string format, params object[] args) {\n    string text = string.Format(format, args);\n\n    if (SilentMode) {\n      WriteLine($\"[silent] {text}\");\n      return;\n    }\n\n    //? TODO: using var centerForm = new DialogCenteringHelper(this);\n    MessageBox.Show(text, \"Profile Explorer - Script message\", MessageBoxButton.OK,\n                    MessageBoxImage.Information);\n  }\n\n  public bool QuestionMessage(string format, params object[] args) {\n    string text = string.Format(format, args);\n\n    if (SilentMode) {\n      WriteLine($\"[silent question] {text}\");\n      return false;\n    }\n\n    //using var centerForm = new DialogCenteringHelper(this);\n    return MessageBox.Show(text, \"Profile Explorer - Script message\", MessageBoxButton.YesNo,\n                           MessageBoxImage.Question) ==\n           MessageBoxResult.Yes;\n  }\n\n  public void ErrorMessage(string format, params object[] args) {\n    string text = string.Format(format, args);\n\n    if (SilentMode) {\n      WriteLine($\"[silent error] {text}\");\n      return;\n    }\n\n    //using var centerForm = new DialogCenteringHelper(this);\n    MessageBox.Show(text, \"Profile Explorer - Script message\", MessageBoxButton.OK,\n                    MessageBoxImage.Error);\n  }\n\n  public bool SaveOutput(string filePath) {\n    try {\n      File.WriteAllText(filePath, builder_.ToString());\n      return true;\n    }\n    catch (Exception ex) {\n      WriteLine($\"Failed to save output to file {filePath}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public class AnalysisInfo {\n    private DominatorAlgorithm domAlgorithm_;\n    private DominatorAlgorithm postdomAlgorithm_;\n    private FunctionIR function_;\n    private ReferenceFinder referenceFinder_;\n    private ICompilerIRInfo ir_;\n\n    public AnalysisInfo(FunctionIR function, ICompilerIRInfo ir) {\n      function_ = function;\n      ir_ = ir;\n    }\n\n    public ReferenceFinder References {\n      get {\n        if (referenceFinder_ == null) {\n          referenceFinder_ = new ReferenceFinder(function_, ir_);\n        }\n\n        return referenceFinder_;\n      }\n    }\n\n    public DominatorAlgorithm DominatorTree {\n      get {\n        if (domAlgorithm_ == null) {\n          domAlgorithm_ = new DominatorAlgorithm(\n            function_,\n            DominatorAlgorithmOptions.BuildTree |\n            DominatorAlgorithmOptions.BuildQueryCache);\n        }\n\n        return domAlgorithm_;\n      }\n    }\n\n    public DominatorAlgorithm PostDominatorTree {\n      get {\n        if (postdomAlgorithm_ == null) {\n          postdomAlgorithm_ = new DominatorAlgorithm(\n            function_,\n            DominatorAlgorithmOptions.PostDominators |\n            DominatorAlgorithmOptions.BuildTree |\n            DominatorAlgorithmOptions.BuildQueryCache);\n        }\n\n        return postdomAlgorithm_;\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/Bookmark.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class Bookmark {\n  [ProtoMember(1)]\n  private IRElementReference elementRef_;\n  public Bookmark() { }\n\n  public Bookmark(int index, IRElement element, string text, HighlightingStyle style) {\n    Index = index;\n    Element = element;\n    Text = text;\n    Style = style;\n  }\n\n  public IRElement Element {\n    get => elementRef_;\n    set => elementRef_ = value;\n  }\n\n  [ProtoMember(2)] public int Index { get; set; }\n  [ProtoMember(3)] public string Text { get; set; }\n  [ProtoMember(4)] public bool IsSelected { get; set; }\n  [ProtoMember(5)] public bool IsPinned { get; set; }\n  [ProtoMember(6)] public HighlightingStyle Style { get; set; }\n  public bool HasStyle => Style != null;\n  public Brush StyleBackColor => Style?.BackColor;\n  public int Line => Element.TextLocation.Line;\n  public string Block => Utils.MakeBlockDescription(Element.ParentBlock);\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/BookmarkManager.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class BookmarkManagerState {\n  [ProtoMember(1)]\n  public List<Bookmark> Bookmarks;\n  [ProtoMember(2)]\n  public List<Tuple<IRElementReference, Bookmark>> ElementBookmarkMap;\n  [ProtoMember(3)]\n  public int NextIndex;\n  [ProtoMember(4)]\n  public int SelectedIndex;\n}\n\npublic class BookmarkManager {\n  private List<Bookmark> bookmarks_;\n  private Dictionary<IRElement, Bookmark> elementBookmarkMap_;\n  private int nextIndex_;\n  private int selectedIndex_;\n\n  public BookmarkManager() {\n    bookmarks_ = new List<Bookmark>();\n    elementBookmarkMap_ = new Dictionary<IRElement, Bookmark>();\n    nextIndex_ = 1;\n    selectedIndex_ = -1;\n    Version = 1;\n  }\n\n  public HighlightingStyle DefaultStyle { get; set; }\n  public List<Bookmark> Bookmarks => bookmarks_;\n  public int SelectedIndex => selectedIndex_;\n  public int Version { get; set; }\n\n  public byte[] SaveState(FunctionIR function) {\n    var bookmarkState = new BookmarkManagerState {\n      Bookmarks = bookmarks_.CloneList(),\n      ElementBookmarkMap = elementBookmarkMap_?.ToList<IRElement, IRElementReference, Bookmark>(),\n      NextIndex = nextIndex_,\n      SelectedIndex = selectedIndex_\n    };\n\n    return UIStateSerializer.Serialize(bookmarkState, function);\n  }\n\n  public void LoadState(byte[] data, FunctionIR function) {\n    var bookmarkState = UIStateSerializer.Deserialize<BookmarkManagerState>(data, function);\n    bookmarks_ = bookmarkState.Bookmarks ?? new List<Bookmark>();\n    elementBookmarkMap_ =\n      bookmarkState.ElementBookmarkMap?.ToDictionary<IRElementReference, IRElement, Bookmark>() ??\n      new Dictionary<IRElement, Bookmark>();\n\n    nextIndex_ = bookmarkState.NextIndex;\n    selectedIndex_ = bookmarkState.SelectedIndex;\n    Version++;\n  }\n\n  public void CopyFrom(BookmarkManager other) {\n    bookmarks_ = other.bookmarks_;\n    elementBookmarkMap_ = other.elementBookmarkMap_;\n    nextIndex_ = other.nextIndex_;\n    selectedIndex_ = other.selectedIndex_;\n    Version++;\n  }\n\n  public Bookmark AddBookmark(IRElement element, string text = \"\") {\n    // Remove any previously associated bookmark.\n    RemoveBookmark(element);\n    var bookmark = new Bookmark(nextIndex_, element, text, DefaultStyle);\n    bookmarks_.Add(bookmark);\n    elementBookmarkMap_.Add(element, bookmark);\n    nextIndex_++;\n    Version++;\n    return bookmark;\n  }\n\n  public Bookmark FindBookmark(IRElement element) {\n    return elementBookmarkMap_.TryGetValue(element, out var value) ? value : null;\n  }\n\n  public void RemoveBookmark(Bookmark bookmark) {\n    RemoveBookmark(bookmark.Element);\n  }\n\n  public Bookmark RemoveBookmark(IRElement element) {\n    if (elementBookmarkMap_.TryGetValue(element, out var bookmark)) {\n      bookmarks_.Remove(bookmark);\n      elementBookmarkMap_.Remove(element);\n      selectedIndex_ = Math.Min(selectedIndex_, bookmarks_.Count - 1);\n      Version++;\n      return bookmark;\n    }\n\n    return null;\n  }\n\n  public void Clear() {\n    elementBookmarkMap_.Clear();\n    bookmarks_.Clear();\n    nextIndex_ = 1;\n    selectedIndex_ = -1;\n    Version++;\n  }\n\n  public Bookmark JumpToFirstBookmark() {\n    if (bookmarks_.Count > 0) {\n      selectedIndex_ = 0;\n      return bookmarks_[selectedIndex_];\n    }\n\n    return null;\n  }\n\n  public Bookmark JumpToLastBookmark() {\n    if (bookmarks_.Count > 0) {\n      selectedIndex_ = bookmarks_.Count - 1;\n      return bookmarks_[selectedIndex_];\n    }\n\n    return null;\n  }\n\n  public Bookmark GetNext() {\n    if (selectedIndex_ < bookmarks_.Count - 1) {\n      selectedIndex_++;\n      return bookmarks_[selectedIndex_];\n    }\n\n    return null;\n  }\n\n  public Bookmark GetPrevious() {\n    if (selectedIndex_ > 0) {\n      selectedIndex_--;\n      return bookmarks_[selectedIndex_];\n    }\n\n    return null;\n  }\n\n  public Bookmark GetNextAfter(Bookmark other) {\n    return null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/DiffModeInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing DiffPlex.DiffBuilder.Model;\nusing ICSharpCode.AvalonEdit.Document;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI;\n\npublic class DiffMarkingResult {\n  public TextDocument DiffDocument;\n  public List<DiffTextSegment> DiffSegments;\n  public string DiffText;\n  public bool FunctionReparsingRequired;\n  public int CurrentSegmentIndex;\n  internal FunctionIR DiffFunction;\n\n  public DiffMarkingResult(TextDocument diffDocument) {\n    DiffDocument = diffDocument;\n    DiffSegments = new List<DiffTextSegment>();\n  }\n}\n\npublic class DiffModeInfo {\n  public SemaphoreSlim DiffModeChangeCompleted = new(1);\n\n  public DiffModeInfo() {\n    PassOutputShowBefore = true; //? TODO: Restore settings\n  }\n\n  public bool IsEnabled { get; set; }\n  public bool IsChangeCompleted { get; set; }\n  public IRDocumentHost LeftDocument { get; set; }\n  public IRDocumentHost RightDocument { get; set; }\n  public IRTextSection LeftSection { get; set; }\n  public IRTextSection RightSection { get; set; }\n  public IRDocumentHost IgnoreNextScrollEventDocument { get; set; }\n  public DiffMarkingResult LeftDiffResults { get; set; }\n  public DiffMarkingResult RightDiffResults { get; set; }\n  public SideBySideDiffModel CurrentDiffResults { get; set; }\n  public DiffSettings CurrentDiffSettings { get; set; }\n  public bool PassOutputVisible { get; set; }\n  public bool PassOutputShowBefore { get; set; }\n\n  public async Task StartModeChange() {\n    // If a diff-mode change is in progress, wait until it's done.\n    await DiffModeChangeCompleted.WaitAsync();\n    IsChangeCompleted = false;\n  }\n\n  public void EndModeChange() {\n    IsChangeCompleted = true;\n    DiffModeChangeCompleted.Release();\n  }\n\n  public void End() {\n    IsEnabled = false;\n    LeftDocument = RightDocument = null;\n    LeftSection = RightSection = null;\n    IgnoreNextScrollEventDocument = null;\n    CurrentDiffResults = null;\n    CurrentDiffSettings = null;\n  }\n\n  public bool IsDiffDocument(IRDocumentHost docHost) {\n    return docHost == LeftDocument || docHost == RightDocument;\n  }\n\n  public bool IsDiffFunction(FunctionIR function) {\n    return function == LeftDiffResults.DiffFunction ||\n           function == RightDiffResults.DiffFunction;\n  }\n\n  public IRDocumentHost GetOtherDocument(IRDocumentHost docHost) {\n    if (docHost == LeftDocument) {\n      return RightDocument;\n    }\n\n    if (docHost == RightDocument) {\n      return LeftDocument;\n    }\n\n    return null;\n  }\n\n  public void UpdateResults(DiffMarkingResult leftResults, IRTextSection leftSection,\n                            DiffMarkingResult rightResults, IRTextSection rightSection) {\n    LeftDiffResults = leftResults;\n    LeftSection = leftSection;\n    RightDiffResults = rightResults;\n    RightSection = rightSection;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/GraphLayoutCache.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class GraphLayoutCache {\n  private GraphKind graphKind_;\n  private Dictionary<IRTextSection, CompressedString> graphLayout_;\n  private Dictionary<byte[], CompressedString> shapeGraphLayout_;\n  private ReaderWriterLockSlim rwLock_;\n\n  public GraphLayoutCache(GraphKind graphKind) {\n    graphKind_ = graphKind;\n    shapeGraphLayout_ = new Dictionary<byte[], CompressedString>();\n    graphLayout_ = new Dictionary<IRTextSection, CompressedString>();\n    rwLock_ = new ReaderWriterLockSlim();\n  }\n\n  public Graph GenerateGraph<T, U>(T element, IRTextSection section, CancelableTask task,\n                                   U options = null) where T : class where U : class {\n    GraphVizPrinter printer = null;\n    string graphText;\n\n    try {\n      rwLock_.EnterUpgradeableReadLock();\n\n      //? TODO: Currently only FunctionIR graphs (flow, dominator, etc) are cached.\n      bool useCache = typeof(T) == typeof(FunctionIR);\n\n      if (useCache && graphLayout_.TryGetValue(section, out var graphData)) {\n#if DEBUG\n        Trace.TraceInformation($\"Graph cache: Loading cached section graph for {section}\");\n#endif\n        graphText = graphData.ToString();\n      }\n      else {\n        // Check if the same Graphviz input was used before, since\n        // the resulting graph will be identical even though the function is not.\n        printer ??= GraphPrinterFactory.CreateInstance(graphKind_, element, options);\n        string inputText = printer.PrintGraph();\n\n        if (string.IsNullOrEmpty(inputText)) {\n          // Printing the graph failed for some reason, like running out of memory.\n          return null;\n        }\n\n        // The input text is looked up using a SHA256 hash that basically makes each\n        // input unique, use justs 32 bytes of memory and faster to look up.\n        byte[] inputTextHash = CompressionUtils.CreateSHA256(inputText);\n\n        if (useCache && shapeGraphLayout_.TryGetValue(inputTextHash, out var shapeGraphData)) {\n#if DEBUG\n          Trace.TraceInformation($\"Graph cache: Loading cached graph layout for {section}\");\n#endif\n          // Associate graph layout with the section.\n          graphText = shapeGraphData.ToString(); // Decompress.\n          CacheGraphLayoutAndShape(section, shapeGraphData);\n        }\n        else {\n          // This is a new graph layout that must be computed through Graphviz.\n#if DEBUG\n          Trace.TraceInformation($\"Graph cache: Compute new graph layout for {section}\");\n#endif\n          graphText = printer.CreateGraph(inputText, task);\n\n          if (string.IsNullOrEmpty(graphText)) {\n            Trace.TraceWarning($\"Graph cache: Failed to create graph for {section}\");\n            return null; // Failed or canceled by user.\n          }\n\n          if (useCache) {\n            CacheGraphLayoutAndShape(section, graphText, inputTextHash);\n          }\n        }\n      }\n    }\n    finally {\n      rwLock_.ExitUpgradeableReadLock();\n    }\n\n    // Parse the graph layout output from Graphviz to build\n    // the actual Graph object with nodes and edges.\n    printer ??= GraphPrinterFactory.CreateInstance(graphKind_, element, options);\n    var blockNodeMap = printer.CreateNodeDataMap();\n    var blockNodeGroupsMap = printer.CreateNodeDataGroupsMap();\n    var graphReader = new GraphvizReader(graphKind_, graphText, blockNodeMap);\n    var layoutGraph = graphReader.ReadGraph();\n\n    if (layoutGraph != null) {\n      layoutGraph.GraphOptions = options;\n      layoutGraph.DataNodeGroupsMap = blockNodeGroupsMap;\n    }\n\n    return layoutGraph;\n  }\n\n  public void ClearCache() {\n    graphLayout_.Clear();\n    shapeGraphLayout_.Clear();\n  }\n\n  private void CacheGraphLayoutAndShape(IRTextSection section, CompressedString shapeGraphData) {\n    // Acquire the write lock before updating shared data.\n    try {\n      rwLock_.EnterWriteLock();\n      graphLayout_.Add(section, shapeGraphData);\n    }\n    finally {\n      rwLock_.ExitWriteLock();\n    }\n  }\n\n  private void CacheGraphLayoutAndShape(IRTextSection section, string graphText, byte[] inputTextHash) {\n    var compressedGraphText = new CompressedString(graphText);\n\n    // Acquire the write lock before updating shared data.\n    try {\n      rwLock_.EnterWriteLock();\n      graphLayout_[section] = compressedGraphText;\n      shapeGraphLayout_[inputTextHash] = compressedGraphText;\n    }\n    finally {\n      rwLock_.ExitWriteLock();\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/IUILoadedDocument.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Reflection.Metadata;\nusing System.Threading.Tasks;\nusing ProfileExplorer.UI;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorerUI.Session;\n\npublic interface IUILoadedDocument : ILoadedDocument {\n  public void SavePanelState(object stateObject, IToolPanel panel, IRTextSection section);\n\n  public object LoadPanelState(IToolPanel panel, IRTextSection section);\n\n  new public IUILoadedDocumentState SerializeDocument();\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/IUILoadedDocumentState.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.UI;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorerUI.Session;\n\npublic interface IUILoadedDocumentState : ILoadedDocumentState {\n  // This interface is being removed as part of the refactoring.\n  // Panel states are now managed by PanelStateManager and stored in SessionState.\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/IUISession.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Profile.Timeline;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorerUI.Session;\nusing ProfileExplorer.UI.Providers;\n\nnamespace ProfileExplorer.UI;\n\npublic enum DuplicatePanelKind {\n  NewSetDockedLeft,\n  NewSetDockedRight,\n  SameSet,\n  Floating\n}\n\npublic interface IUISession : ISession {\n  ISectionStyleProvider SectionStyleProvider { get; }\n  IRRemarkProvider RemarkProvider { get; }\n  IBlockFoldingStrategyProvider BlockFoldingStrategyProvider { get; }\n  ILoadedSectionHandler LoadedSectionHandler { get; }\n  IRDocument CurrentDocument { get; }\n  IRTextSection CurrentDocumentSection { get; }\n  List<IRDocument> OpenDocuments { get; }\n  SessionStateManager SessionState { get; }\n  bool IsSessionStarted { get; }\n  bool IsInDiffMode { get; }\n  bool IsInTwoDocumentsDiffMode { get; }\n  bool IsInTwoDocumentsMode { get; }\n  DiffModeInfo DiffModeInfo { get; }\n  IRTextSummary MainDocumentSummary { get; }\n  IRTextSummary DiffDocumentSummary { get; }\n  ProfileFilterState ProfileFilter { get; set; }\n  IRTextSummary GetDocumentSummary(IRTextSection section);\n  IRTextFunction FindFunctionWithId(int funcNumber, Guid summaryId);\n  IRDocument FindAssociatedDocument(IToolPanel panel);\n  IRDocumentHost FindAssociatedDocumentHost(IToolPanel panel);\n  void PopulateBindMenu(IToolPanel panel, BindMenuItemsArgs args);\n  void BindToDocument(IToolPanel panel, BindMenuItem args);\n  void DuplicatePanel(IToolPanel panel, DuplicatePanelKind duplicateKind);\n  void DisplayFloatingPanel(IToolPanel panel);\n  void ShowAllReferences(IRElement element, IRDocument document);\n  void ShowSSAUses(IRElement element, IRDocument document);\n  object LoadDocumentState(IRTextSection section);\n  object LoadPanelState(IToolPanel panel, IRTextSection section, IRDocument document = null);\n  void SaveDocumentState(object stateObject, IRTextSection section);\n\n  void SavePanelState(object stateObject, IToolPanel panel,\n                      IRTextSection section, IRDocument document = null);\n\n  void RedrawPanels(params ToolPanelKind[] kinds);\n  IToolPanel FindPanel(ToolPanelKind kind);\n  Task<IToolPanel> ShowPanel(ToolPanelKind kind);\n  void ActivatePanel(IToolPanel panel);\n  Task<IRDocumentHost> SwitchDocumentSectionAsync(OpenSectionEventArgs args);\n  Task<IRDocumentHost> OpenDocumentSectionAsync(OpenSectionEventArgs args);\n  bool SwitchToPreviousSection(IRTextSection section, IRDocument document);\n  bool SwitchToNextSection(IRTextSection section, IRDocument document);\n  void SetSectionAnnotationState(IRTextSection section, bool hasAnnotations);\n  IRTextSection GetPreviousSection(IRTextSection section);\n  IRTextSection GetNextSection(IRTextSection section);\n  Task<ParsedIRTextSection> LoadAndParseSection(IRTextSection section);\n  Task<string> GetSectionOutputTextAsync(IRPassOutput output, IRTextSection section);\n  Task<List<string>> GetSectionOutputTextLinesAsync(IRPassOutput output, IRTextSection section);\n  Task<string> GetSectionTextAsync(IRTextSection section, IRDocument targetDiffDocument = null);\n  Task<string> GetDocumentTextAsync(IRTextSummary summary);\n  Task SwitchGraphsAsync(GraphPanel flowGraphPanel, IRTextSection section, IRDocument document);\n\n  Task<Graph> ComputeGraphAsync(GraphKind kind, IRTextSection section,\n                                IRDocument document, CancelableTask loadTask = null,\n                                object options = null);\n\n  Task<SectionSearchResult> SearchSectionAsync(SearchInfo searchInfo, IRTextSection section,\n                                               IRDocument document);\n\n  Task SwitchActiveFunction(IRTextFunction function, bool handleProfiling = true);\n  Task ReloadDocumentSettings(DocumentSettings newSettings, IRDocument document);\n  Task ReloadRemarkSettings(RemarkSettings newSettings, IRDocument document);\n  Task ReloadSettings();\n  void RegisterDetachedPanel(DraggablePopup panel);\n  void UnregisterDetachedPanel(DraggablePopup panel);\n  Task<bool> SaveSessionDocument(string filePath);\n  Task<ILoadedDocument> OpenSessionDocument(string filePath);\n\n\n  Task<IDebugInfoProvider> GetDebugInfoProvider(IRTextFunction function);\n\n  Task<bool> LoadProfileData(RawProfileData data, List<int> processIds,\n                             ProfileDataProviderOptions options,\n                             SymbolFileSourceSettings symbolSettings,\n                             ProfileDataReport report,\n                             ProfileLoadProgressHandler progressCallback,\n                             CancelableTask cancelableTask);\n\n  Task<bool> FilterProfileSamples(ProfileFilterState filter);\n  Task<bool> RemoveProfileSamplesFilter();\n\n  Task<bool> OpenProfileFunction(ProfileCallTreeNode node, OpenSectionKind openMode,\n                                 ProfileSampleFilter instanceFilter = null,\n                                 IRDocumentHost targetDocument = null);\n\n  Task<bool> OpenProfileFunction(IRTextFunction function, OpenSectionKind openMode,\n                                 ProfileSampleFilter instanceFilter = null,\n                                 IRDocumentHost targetDocument = null);\n\n  Task<bool> SwitchActiveProfileFunction(ProfileCallTreeNode node);\n  Task<bool> SelectProfileFunctionInPanel(ProfileCallTreeNode node, ToolPanelKind panelKind);\n  Task<bool> SelectProfileFunctionInPanel(IRTextFunction node, ToolPanelKind panelKind);\n  Task<bool> OpenProfileSourceFile(ProfileCallTreeNode node, ProfileSampleFilter profileFilter = null);\n  Task<bool> OpenProfileSourceFile(IRTextFunction function, ProfileSampleFilter profileFilter = null);\n  Task<bool> ProfileSampleRangeSelected(SampleTimeRangeInfo range);\n  Task<bool> ProfileSampleRangeDeselected();\n  Task<bool> ProfileFunctionSelected(ProfileCallTreeNode node, ToolPanelKind sourcePanelKind);\n\n  Task<bool> MarkProfileFunction(ProfileCallTreeNode node, ToolPanelKind sourcePanelKind,\n                                 HighlightingStyle style);\n\n  Task<bool> ProfileFunctionSelected(IRTextFunction function, ToolPanelKind sourcePanelKind);\n  Task<bool> ProfileFunctionDeselected();\n  Task<bool> FunctionMarkingChanged(ToolPanelKind sourcePanelKind);\n  bool SaveFunctionTaskOptions(FunctionTaskInfo taskInfo, IFunctionTaskOptions options);\n  IFunctionTaskOptions LoadFunctionTaskOptions(FunctionTaskInfo taskInfo);\n  void SetApplicationStatus(string text, string tooltip = \"\");\n  void SetApplicationProgress(bool visible, double percentage, string title = null);\n  void UpdatePanelTitles();\n  void UpdateDocumentTitles();\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/PanelStateManager.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI;\nusing ProtoBuf;\n\nnamespace ProfileExplorerUI.Session;\n\npublic class PanelObjectPair {\n  public PanelObjectPair(IToolPanel panel, object stateObject) {\n    Panel = panel;\n    StateObject = stateObject;\n  }\n\n  public IToolPanel Panel { get; set; }\n  public object StateObject { get; set; }\n}\n\npublic class PanelStateManager {\n  // Maps document ID -> section ID -> list of panel states\n  private Dictionary<Guid, Dictionary<int, List<PanelObjectPair>>> documentPanelStates_;\n  \n  // Maps section group (for diff mode) -> list of panel states  \n  private Dictionary<BaseDiffSectionGroup, List<PanelObjectPair>> diffPanelStates_;\n\n  public PanelStateManager() {\n    documentPanelStates_ = new Dictionary<Guid, Dictionary<int, List<PanelObjectPair>>>();\n    diffPanelStates_ = new Dictionary<BaseDiffSectionGroup, List<PanelObjectPair>>();\n  }\n\n  public void SavePanelState(object stateObject, IToolPanel panel, ILoadedDocument document, IRTextSection section) {\n    if (document == null || section == null) {\n      return;\n    }\n\n    var documentId = document.Id;\n    var sectionId = section.Id;\n\n    if (!documentPanelStates_.TryGetValue(documentId, out var sectionMap)) {\n      sectionMap = new Dictionary<int, List<PanelObjectPair>>();\n      documentPanelStates_[documentId] = sectionMap;\n    }\n\n    if (!sectionMap.TryGetValue(sectionId, out var list)) {\n      list = new List<PanelObjectPair>();\n      sectionMap[sectionId] = list;\n    }\n\n    var state = list.Find(item => item.Panel == panel);\n    if (state != null) {\n      state.StateObject = stateObject;\n    }\n    else {\n      list.Add(new PanelObjectPair(panel, stateObject));\n    }\n  }\n\n  public object LoadPanelState(IToolPanel panel, ILoadedDocument document, IRTextSection section) {\n    if (document == null || section == null) {\n      return null;\n    }\n\n    var documentId = document.Id;\n    var sectionId = section.Id;\n\n    if (documentPanelStates_.TryGetValue(documentId, out var sectionMap) &&\n        sectionMap.TryGetValue(sectionId, out var list)) {\n      var state = list.Find(item => item.Panel == panel);\n      return state?.StateObject;\n    }\n\n    return null;\n  }\n\n  public void SaveDiffModePanelState(object stateObject, IToolPanel panel, IRTextSection section) {\n    if (section == null) {\n      return;\n    }\n\n    // Create a diff section group - this requires the base section, diff section, and state section\n    // For now, we'll use the section as all three (this may need adjustment based on actual diff mode logic)\n    var group = new BaseDiffSectionGroup(section, section, section);\n\n    if (!diffPanelStates_.TryGetValue(group, out var list)) {\n      list = new List<PanelObjectPair>();\n      diffPanelStates_[group] = list;\n    }\n\n    var state = list.Find(item => item.Panel == panel);\n    if (state != null) {\n      state.StateObject = stateObject;\n    }\n    else {\n      list.Add(new PanelObjectPair(panel, stateObject));\n    }\n  }\n\n  public object LoadDiffModePanelState(IToolPanel panel, IRTextSection section) {\n    if (section == null) {\n      return null;\n    }\n\n    var group = new BaseDiffSectionGroup(section, section, section);\n    if (diffPanelStates_.TryGetValue(group, out var list)) {\n      var state = list.Find(item => item.Panel == panel);\n      return state?.StateObject;\n    }\n\n    return null;\n  }\n\n  public void ClearDiffModePanelState() {\n    diffPanelStates_.Clear();\n  }\n\n  public List<Tuple<int, PanelObjectPairState>> SerializePanelStatesForDocument(ILoadedDocument document) {\n    var result = new List<Tuple<int, PanelObjectPairState>>();\n    \n    if (!documentPanelStates_.TryGetValue(document.Id, out var sectionMap)) {\n      return result;\n    }\n\n    foreach (var sectionEntry in sectionMap) {\n      var sectionId = sectionEntry.Key;\n      var panelStates = sectionEntry.Value;\n\n      foreach (var panelState in panelStates) {\n        if (panelState.Panel.SavesStateToFile) {\n          result.Add(new Tuple<int, PanelObjectPairState>(\n            sectionId,\n            new PanelObjectPairState(panelState.Panel.PanelKind, panelState.StateObject)));\n        }\n      }\n    }\n\n    return result;\n  }\n\n  public void LoadPanelStatesForDocument(ILoadedDocument document, List<Tuple<int, PanelObjectPairState>> panelStates) {\n    // This method would be called during session restoration\n    // It requires access to panel instances, so it's implemented in SessionStateManager\n  }\n\n  public void RemoveDocumentPanelStates(Guid documentId) {\n    documentPanelStates_.Remove(documentId);\n  }\n}\n\npublic class BaseDiffSectionGroup {\n  public BaseDiffSectionGroup(IRTextSection baseSection,\n                              IRTextSection diffSection,\n                              IRTextSection stateSection) {\n    BaseSection = baseSection;\n    DiffSection = diffSection;\n    StateSection = stateSection;\n  }\n\n  public IRTextSection BaseSection { get; set; }\n  public IRTextSection DiffSection { get; set; }\n  public IRTextSection StateSection { get; set; }\n\n  public override bool Equals(object obj) {\n    if (obj is BaseDiffSectionGroup other) {\n      return BaseSection?.Id == other.BaseSection?.Id &&\n             DiffSection?.Id == other.DiffSection?.Id &&\n             StateSection?.Id == other.StateSection?.Id;\n    }\n    return false;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(BaseSection?.Id, DiffSection?.Id, StateSection?.Id);\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerUI/Session/SessionStateManager.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\nusing AvalonDock.Layout;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Profile;\nusing ProtoBuf;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.Processing;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorerUI.Session;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class SessionInfo {\n  [ProtoMember(1)]\n  public string FilePath;\n  [ProtoMember(2)]\n  public SessionKind Kind;\n  [ProtoMember(3)]\n  public string Notes;\n  [ProtoMember(4)]\n  public string IRName;\n  [ProtoMember(5)]\n  public IRMode IRMode;\n  [ProtoMember(6)]\n  public bool IsSaved;\n  public SessionInfo() { }\n\n  public SessionInfo(string filePath, SessionKind kind, string irName, IRMode irMode) {\n    FilePath = filePath;\n    Kind = kind;\n    IRName = irName;\n    IRMode = irMode;\n  }\n\n  public bool IsDebugSession => Kind == SessionKind.DebugSession;\n  public bool IsFileSession => Kind == SessionKind.FileSession;\n  public bool IsSavedFileSession => IsFileSession && IsSaved;\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class PanelObjectPairState {\n  [ProtoMember(1)]\n  public ToolPanelKind PanelKind;\n  [ProtoMember(2)]\n  public byte[] StateObject;\n\n  public PanelObjectPairState(ToolPanelKind panelKind, object stateObject) {\n    PanelKind = panelKind;\n    StateObject = stateObject as byte[];\n  }\n}\n\n[ProtoContract]\npublic class OpenSectionState {\n  [ProtoMember(1)]\n  public Guid DocumentId;\n  [ProtoMember(2)]\n  public int SectionId;\n  public OpenSectionState() { }\n\n  public OpenSectionState(Guid documentId, int sectionId) {\n    DocumentId = documentId;\n    SectionId = sectionId;\n  }\n}\n\n[ProtoContract]\npublic class SessionState {\n  [ProtoMember(1)]\n  public List<ILoadedDocumentState> Documents;\n  [ProtoMember(2)]\n  public List<PanelObjectPairState> GlobalPanelStates;\n  [ProtoMember(3)]\n  public List<OpenSectionState> OpenSections;\n  [ProtoMember(4)]\n  public SessionInfo Info;\n  [ProtoMember(5)]\n  public bool IsInTwoDocumentsDiffMode;\n  [ProtoMember(6)]\n  public Guid MainDocumentId;\n  [ProtoMember(7)]\n  public Guid DiffDocumentId;\n  [ProtoMember(8)]\n  public DiffModeState SectionDiffState;\n  [ProtoMember(9)]\n  public byte[] ProfileState;\n  [ProtoMember(10)]\n  public Dictionary<Guid, List<Tuple<int, PanelObjectPairState>>> DocumentPanelStates;\n\n  public SessionState() {\n    Documents = new List<ILoadedDocumentState>();\n    GlobalPanelStates = new List<PanelObjectPairState>();\n    OpenSections = new List<OpenSectionState>();\n    Info = new SessionInfo();\n    SectionDiffState = new DiffModeState();\n    DocumentPanelStates = new Dictionary<Guid, List<Tuple<int, PanelObjectPairState>>>();\n  }\n}\n\n[ProtoContract]\npublic class DiffModeState {\n  [ProtoMember(1)]\n  public bool IsEnabled;\n  [ProtoMember(2)]\n  public OpenSectionState LeftSection;\n  [ProtoMember(3)]\n  public OpenSectionState RightSection;\n\n  public DiffModeState() {\n    LeftSection = new OpenSectionState();\n    RightSection = new OpenSectionState();\n  }\n}\n\npublic class PanelHostInfo {\n  public PanelHostInfo(IToolPanel panel, LayoutAnchorable host) {\n    Panel = panel;\n    Host = host;\n  }\n\n  public IToolPanel Panel { get; set; }\n  public LayoutAnchorable Host { get; set; }\n  public ToolPanelKind PanelKind => Panel.PanelKind;\n}\n\npublic class DocumentHostInfo {\n  public DocumentHostInfo(IRDocumentHost document, LayoutDocument host) {\n    DocumentHost = document;\n    Host = host;\n  }\n\n  public IRDocumentHost DocumentHost { get; set; }\n  public IRDocument Document => DocumentHost.TextView;\n  public IRTextSection Section => Document.Section;\n  public LayoutDocument Host { get; set; }\n  public LayoutDocumentPane HostParent { get; set; }\n  public bool IsActiveDocument { get; set; }\n}\n\npublic class SessionSettings {\n  public bool AutoReloadDocument { get; set; }\n}\n\npublic class SessionStateManager : IDisposable {\n  // {IR section ID -> list [{panel ID, state}]}\n  private object lockObject_;\n  private List<ILoadedDocument> documents_;\n  private Dictionary<ToolPanelKind, object> globalPanelStates_;\n  private PanelStateManager panelStateManager_;\n  private List<CancelableTask> pendingTasks_;\n  private ICompilerInfoProvider compilerInfo_;\n  private bool watchDocumentChanges_;\n  private bool disposed_;\n\n  public SessionStateManager(string filePath, SessionKind sessionKind, ICompilerInfoProvider compilerInfo) {\n    lockObject_ = new object();\n    compilerInfo_ = compilerInfo;\n    Info = new SessionInfo(filePath, sessionKind, compilerInfo.CompilerIRName, compilerInfo.IR.Mode);\n    Info.Notes = \"\";\n    documents_ = new List<ILoadedDocument>();\n    globalPanelStates_ = new Dictionary<ToolPanelKind, object>();\n    panelStateManager_ = new PanelStateManager();\n    pendingTasks_ = new List<CancelableTask>();\n    DocumentHosts = new List<DocumentHostInfo>();\n    SectionDiffState = new DiffModeInfo();\n    SessionStartTime = DateTime.UtcNow;\n    IsAutoSaveEnabled = sessionKind != SessionKind.DebugSession;\n    SyncDiffedDocuments = false;\n  }\n\n  public SessionInfo Info { get; set; }\n  public List<ILoadedDocument> Documents => documents_;\n  public ILoadedDocument MainDocument { get; set; }\n  public ILoadedDocument DiffDocument { get; set; }\n  public List<DocumentHostInfo> DocumentHosts { get; set; }\n  public ProfileData ProfileData { get; set; }\n  public ProfileFilterState ProfileFilter { get; set; }\n  public DiffModeInfo SectionDiffState { get; set; }\n  public bool NotifiedSessionStart { get; set; }\n  public DateTime SessionStartTime { get; set; }\n  public bool IsAutoSaveEnabled { get; set; }\n  public bool IsInTwoDocumentsDiffMode => DiffDocument != null && SyncDiffedDocuments;\n  public bool SyncDiffedDocuments { get; set; }\n\n  public void Dispose() {\n    Dispose(true);\n    GC.SuppressFinalize(this);\n  }\n\n  public event EventHandler DocumentChanged;\n\n  public static Task<SessionState> DeserializeSession(byte[] data) {\n    return Task.Run(() => {\n      byte[] decompressedData = CompressionUtils.Decompress(data);\n      var state = UIStateSerializer.Deserialize<SessionState>(decompressedData);\n      return state;\n    });\n  }\n\n  public void EnterTwoDocumentDiffMode(ILoadedDocument diffDocument) {\n    DiffDocument = diffDocument;\n    SyncDiffedDocuments = true;\n  }\n\n  public void ExitTwoDocumentDiffMode() {\n    DiffDocument = null;\n    SyncDiffedDocuments = false;\n  }\n\n  public void RegisterLoadedDocument(ILoadedDocument docInfo) {\n    documents_.Add(docInfo);\n\n    if (!Info.IsFileSession && !Info.IsDebugSession) {\n      docInfo.SetupDocumentWatcher();\n      docInfo.DocumentChanged += DocumentWatcher_Changed;\n      docInfo.ChangeDocumentWatcherState(watchDocumentChanges_);\n    }\n  }\n\n  public void RemoveLoadedDocuemnt(ILoadedDocument document) {\n    document.ChangeDocumentWatcherState(false);\n    document.DocumentChanged -= DocumentWatcher_Changed;\n    panelStateManager_.RemoveDocumentPanelStates(document.Id);\n    documents_.Remove(document);\n  }\n\n  public ILoadedDocument FindLoadedDocument(IRTextSection section) {\n    var summary = section.ParentFunction.ParentSummary;\n    return documents_.Find(item => item.Summary == summary);\n  }\n\n  public ILoadedDocument FindLoadedDocument(IRTextFunction func) {\n    var summary = func.ParentSummary;\n    return documents_.Find(item => item.Summary == summary);\n  }\n\n  public ILoadedDocument FindLoadedDocument(IRTextSummary summary) {\n    return documents_.Find(item => item.Summary == summary);\n  }\n\n  public IRTextFunction FindFunctionWithId(int funcNumber, Guid summaryId) {\n    foreach (var doc in documents_) {\n      if (doc.Summary.Id == summaryId) {\n        return doc.Summary.GetFunctionWithId(funcNumber);\n      }\n    }\n\n    return null;\n  }\n\n  public bool AreSectionSignaturesComputed(IRTextSection section) {\n    var loadedDoc = FindLoadedDocument(section);\n    return loadedDoc?.Loader.SectionSignaturesComputed ?? false;\n  }\n\n  public void SavePanelState(object stateObject, IToolPanel panel, IRTextSection section) {\n    if (section == null) {\n      globalPanelStates_[panel.PanelKind] = stateObject;\n      return;\n    }\n\n    //? TODO: By not serializing the panel state object,\n    //? references to object in a FunctionIR could be kept around\n    //? after the section is unloaded, increasing memory usage more and more\n    //? when switching sections\n    var docInfo = FindLoadedDocument(section);\n    panelStateManager_.SavePanelState(stateObject, panel, docInfo, section);\n  }\n\n  public void SaveDiffModePanelState(object stateObject, IToolPanel panel, IRTextSection section) {\n    panelStateManager_.SaveDiffModePanelState(stateObject, panel, section);\n  }\n\n  public object LoadDiffModePanelState(IToolPanel panel, IRTextSection section) {\n    return panelStateManager_.LoadDiffModePanelState(panel, section);\n  }\n\n  public void ClearDiffModePanelState() {\n    panelStateManager_.ClearDiffModePanelState();\n  }\n\n  public object LoadPanelState(IToolPanel panel, IRTextSection section) {\n    if (section == null) {\n      return globalPanelStates_.TryGetValue(panel.PanelKind, out object value) ? value : null;\n    }\n\n    var docInfo = FindLoadedDocument(section);\n    return panelStateManager_.LoadPanelState(panel, docInfo, section);\n  }\n\n  public void SaveDocumentState(object stateObject, IRTextSection section) {\n    var docInfo = FindLoadedDocument(section);\n    docInfo.SaveSectionState(stateObject, section);\n  }\n\n  public object LoadDocumentState(IRTextSection section) {\n    var docInfo = FindLoadedDocument(section);\n    return docInfo.LoadSectionState(section);\n  }\n\n  public Task<byte[]> SerializeSession() {\n    var state = new SessionState();\n    state.Info = Info;\n    state.IsInTwoDocumentsDiffMode = IsInTwoDocumentsDiffMode;\n\n    foreach (var docInfo in documents_) {\n      var docState = docInfo.SerializeDocument();\n      state.Documents.Add(docState);\n      \n      // Add panel states for this document\n      var panelStates = panelStateManager_.SerializePanelStatesForDocument(docInfo);\n      if (panelStates.Count > 0) {\n        state.DocumentPanelStates[docInfo.Id] = panelStates;\n      }\n\n      if (docInfo == MainDocument) {\n        state.MainDocumentId = docState.Id;\n      }\n\n      // For two-document diff mode, save the document IDs\n      // so they are restored properly later.\n      if (IsInTwoDocumentsDiffMode) {\n        if (docInfo == DiffDocument) {\n          state.DiffDocumentId = docState.Id;\n        }\n      }\n    }\n\n    foreach (var panelState in globalPanelStates_) {\n      state.GlobalPanelStates.Add(\n        new PanelObjectPairState(panelState.Key, panelState.Value as byte[]));\n    }\n\n    foreach (var docHost in DocumentHosts) {\n      state.OpenSections.Add(CreateOpenSectionState(docHost.DocumentHost.Section));\n    }\n\n    if (SectionDiffState.IsEnabled && SectionDiffState.IsChangeCompleted) {\n      state.SectionDiffState.IsEnabled = true;\n      state.SectionDiffState.LeftSection = CreateOpenSectionState(SectionDiffState.LeftSection);\n      state.SectionDiffState.RightSection = CreateOpenSectionState(SectionDiffState.RightSection);\n    }\n\n    return Task.Run(() => {\n      byte[] data = UIStateSerializer.Serialize(state);\n      byte[] compressedData = CompressionUtils.Compress(data);\n      return compressedData;\n    });\n  }\n\n  public void EndSession() {\n    foreach (var docInfo in documents_) {\n      docInfo.ChangeDocumentWatcherState(false);\n      docInfo.Dispose();\n    }\n\n    documents_.Clear();\n    IsAutoSaveEnabled = false;\n  }\n\n  public async Task CancelPendingTasks() {\n    List<CancelableTask> tasks;\n\n    lock (lockObject_) {\n      tasks = pendingTasks_.CloneList();\n    }\n\n    foreach (var task in tasks) {\n      task.Cancel();\n      await task.WaitToCompleteAsync();\n    }\n  }\n\n  public void RegisterCancelableTask(CancelableTask task) {\n    lock (lockObject_) {\n      pendingTasks_.Add(task);\n    }\n  }\n\n  public void UnregisterCancelableTask(CancelableTask task) {\n    lock (lockObject_) {\n      pendingTasks_.Remove(task);\n    }\n  }\n\n  public void ChangeDocumentWatcherState(bool enabled) {\n    watchDocumentChanges_ = enabled;\n\n    foreach (var docInfo in documents_) {\n      docInfo.ChangeDocumentWatcherState(enabled);\n    }\n  }\n\n  private OpenSectionState CreateOpenSectionState(IRTextSection section) {\n    var loadedDoc = FindLoadedDocument(section);\n    return new OpenSectionState(loadedDoc.Id, section.Id);\n  }\n\n  private void DocumentWatcher_Changed(object sender, EventArgs e) {\n    DocumentChanged?.Invoke(sender, e);\n  }\n\n  protected virtual void Dispose(bool disposing) {\n    if (!disposed_) {\n      documents_.ForEach(item => item.Dispose());\n      documents_.Clear();\n      MainDocument = null;\n      DiffDocument = null;\n      disposed_ = true;\n    }\n  }\n\n  ~SessionStateManager() {\n    Dispose(false);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/UILoadedDocument.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Profile;\nusing ProtoBuf;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.Utils;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorerUI.Session;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class UILoadedDocumentState : LoadedDocumentState, IUILoadedDocumentState {\n  // Inherited properties from LoadedDocumentState (ProtoMember 1–7, 9)\n  // Panel states are now managed by PanelStateManager and stored in SessionState.\n\n  public UILoadedDocumentState() : base() {\n  }\n\n  public UILoadedDocumentState(Guid id) : this() {\n    Id = id;\n  }\n}\n\npublic class UILoadedDocument : LoadedDocument, IUILoadedDocument {\n  public Dictionary<IRTextSection, List<PanelObjectPair>> PanelStates;\n  private FileSystemWatcher documentWatcher_;\n  private IRTextSummary summary_;\n  private bool disposed_;\n\n  public UILoadedDocument(string filePath, string modulePath, Guid id) : base(filePath, modulePath, id) {\n    PanelStates = new Dictionary<IRTextSection, List<PanelObjectPair>>();\n  }\n\n  new public static UILoadedDocument CreateDummyDocument(string name) {\n    return CreateDummyDocument(name, Guid.NewGuid());\n  }\n\n  new public static UILoadedDocument CreateDummyDocument(string name, Guid id) {\n    var doc = new UILoadedDocument(name, name, id);\n    doc.Summary = new IRTextSummary(name);\n    doc.Loader = new DummySectionLoader(); // Placeholder used to prevent null pointers.\n    return doc;\n  }\n\n  public event EventHandler DocumentChanged;\n\n  public void SavePanelState(object stateObject, IToolPanel panel, IRTextSection section) {\n    if (!PanelStates.TryGetValue(section, out var list)) {\n      list = new List<PanelObjectPair>();\n      PanelStates.Add(section, list);\n    }\n\n    var state = list.Find(item => item.Panel == panel);\n\n    if (state != null) {\n      state.StateObject = stateObject;\n    }\n    else {\n      list.Add(new PanelObjectPair(panel, stateObject));\n    }\n  }\n\n  public object LoadPanelState(IToolPanel panel, IRTextSection section) {\n    if (PanelStates.TryGetValue(section, out var list)) {\n      var state = list.Find(item => item.Panel == panel);\n      return state?.StateObject;\n    }\n\n    return null;\n  }\n\n  public void SetupDocumentWatcher() {\n    try {\n      string fileDir = Path.GetDirectoryName(FilePath);\n      string fileName = Path.GetFileName(FilePath);\n      documentWatcher_ = new FileSystemWatcher(fileDir, fileName);\n      documentWatcher_.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size;\n      documentWatcher_.Changed += DocumentWatcher_Changed;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to setup document watcher for file {FilePath}: {ex.Message}\");\n      documentWatcher_ = null;\n    }\n  }\n\n  public override IUILoadedDocumentState SerializeDocument() {\n    var state = new UILoadedDocumentState(Id) {\n      ModuleName = ModuleName, FilePath = FilePath, BinaryFile = BinaryFile,\n      DebugInfoFile = DebugInfoFile,\n      DocumentText = Loader.GetDocumentTextBytes()\n    };\n\n    foreach (var sectionState in SectionStates) {\n      state.SectionStates.Add(new Tuple<int, byte[]>(sectionState.Key.Id,\n                                                     sectionState.Value as byte[]));\n    }\n\n    // Panel states are now managed by PanelStateManager in SessionStateManager.\n    // The serialization of panel states is handled separately.\n\n    // Used by profiling to represent missing binaries.\n    foreach (var func in summary_.Functions) {\n      state.FunctionNames.Add(func.Name);\n    }\n\n    return state;\n  }\n\n  public void ChangeDocumentWatcherState(bool enabled) {\n    if (documentWatcher_ != null) {\n      documentWatcher_.EnableRaisingEvents = enabled;\n    }\n  }\n\n  private void DocumentWatcher_Changed(object sender, FileSystemEventArgs e) {\n    if (e.ChangeType != WatcherChangeTypes.Changed) {\n      return;\n    }\n\n    DocumentChanged?.Invoke(this, EventArgs.Empty);\n  }\n\n  ~UILoadedDocument() {\n    Dispose(false);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Session/UIStateSerializer.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Session;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract]\npublic class ColorSurrogate {\n  [ProtoMember(4)]\n  public byte A;\n  [ProtoMember(3)]\n  public byte B;\n  [ProtoMember(2)]\n  public byte G;\n  [ProtoMember(1)]\n  public byte R;\n\n  public static implicit operator ColorSurrogate(Color color) {\n    return new ColorSurrogate {\n      R = color.R,\n      G = color.G,\n      B = color.B,\n      A = color.A\n    };\n  }\n\n  public static implicit operator Color(ColorSurrogate value) {\n    return Color.FromArgb(value.A, value.R, value.G, value.B);\n  }\n}\n\n[ProtoContract]\npublic class BrushSurrogate {\n  [ProtoMember(4)]\n  public byte A;\n  [ProtoMember(3)]\n  public byte B;\n  [ProtoMember(2)]\n  public byte G;\n  [ProtoMember(1)]\n  public byte R;\n\n  public static implicit operator BrushSurrogate(Brush brush) {\n    if (!(brush is SolidColorBrush colorBrush)) {\n      return null;\n    }\n\n    return new BrushSurrogate {\n      R = colorBrush.Color.R,\n      G = colorBrush.Color.G,\n      B = colorBrush.Color.B,\n      A = colorBrush.Color.A\n    };\n  }\n\n  public static implicit operator Brush(BrushSurrogate value) {\n    var color = Color.FromArgb(value.A, value.R, value.G, value.B);\n    return Utils.BrushFromColor(color);\n  }\n}\n\n[ProtoContract]\npublic class PenSurrogate {\n  [ProtoMember(1)]\n  private BrushSurrogate Brush;\n  [ProtoMember(2)]\n  private double Thickness;\n\n  public static implicit operator PenSurrogate(Pen pen) {\n    if (pen == null) {\n      return null;\n    }\n\n    return new PenSurrogate {\n      Brush = pen.Brush,\n      Thickness = pen.Thickness\n    };\n  }\n\n  public static implicit operator Pen(PenSurrogate value) {\n    return ColorPens.GetPen(value.Brush, value.Thickness);\n  }\n}\n\n[ProtoContract]\npublic class RectSurrogate {\n  [ProtoMember(2)]\n  private double Left;\n  [ProtoMember(1)]\n  private double Top;\n  [ProtoMember(3)]\n  private double Width;\n  [ProtoMember(4)]\n  private double Height;\n\n  public static implicit operator RectSurrogate(Rect rect) {\n    return new RectSurrogate {\n      Top = rect.Top,\n      Left = rect.Left,\n      Width = rect.Width,\n      Height = rect.Height\n    };\n  }\n\n  public static implicit operator Rect(RectSurrogate value) {\n    return new Rect(value.Top, value.Left, value.Width, value.Height);\n  }\n}\n\n[ProtoContract]\npublic class FontWeightSurrogate {\n  [ProtoMember(1)]\n  private int Weight;\n\n  public static implicit operator FontWeightSurrogate(FontWeight fontWeigth) {\n    return new FontWeightSurrogate {\n      Weight = fontWeigth.ToOpenTypeWeight()\n    };\n  }\n\n  public static implicit operator FontWeight(FontWeightSurrogate value) {\n    return FontWeight.FromOpenTypeWeight(value.Weight);\n  }\n}\n\npublic static class UIStateSerializer {\n  static UIStateSerializer() {\n    // Initialize the core StateSerializer\n    StateSerializer.Initialize();\n    \n    // Register UI-specific surrogates\n    StateSerializer.RegisterSurrogate<Color, ColorSurrogate>();\n    StateSerializer.RegisterSurrogate<Brush, BrushSurrogate>();\n    StateSerializer.RegisterSurrogate<Pen, PenSurrogate>();\n    StateSerializer.RegisterSurrogate<Rect, RectSurrogate>();\n    StateSerializer.RegisterSurrogate<FontWeight, FontWeightSurrogate>();\n  }\n\n  // UI-specific functionality for working with highlighted elements\n  public static List<ElementGroupState> SaveElementGroupState(List<HighlightedSegmentGroup> groups) {\n    var groupStates = new List<ElementGroupState>();\n\n    foreach (var segmentGroup in groups) {\n      if (!segmentGroup.SavesStateToFile) {\n        continue;\n      }\n\n      var groupState = new ElementGroupState();\n      groupStates.Add(groupState);\n      groupState.Style = segmentGroup.Group.Style;\n\n      foreach (var item in segmentGroup.Group.Elements) {\n        groupState.Elements.Add(new IRElementReference(item));\n      }\n    }\n\n    return groupStates;\n  }\n\n  public static List<HighlightedSegmentGroup>\n    LoadElementGroupState(List<ElementGroupState> groupStates) {\n    var groups = new List<HighlightedSegmentGroup>();\n\n    if (groupStates == null) {\n      return groups;\n    }\n\n    foreach (var groupState in groupStates) {\n      var group = new HighlightedElementGroup(groupState.Style);\n\n      foreach (var item in groupState.Elements) {\n        if (item.Value != null) {\n          group.Add(item);\n        }\n      }\n\n      groups.Add(new HighlightedSegmentGroup(group));\n    }\n\n    return groups;\n  }\n\n  // Delegate core serialization functionality to the Core StateSerializer\n  public static byte[] Serialize<T>(T state, FunctionIR function = null) where T : class {\n    return StateSerializer.Serialize(state, function);\n  }\n\n  public static bool Serialize<T>(string filePath, T state, FunctionIR function = null) where T : class {\n    return StateSerializer.Serialize(filePath, state, function);\n  }\n\n  public static T Deserialize<T>(byte[] data, FunctionIR function) where T : class {\n    return StateSerializer.Deserialize<T>(data, function);\n  }\n\n  public static T Deserialize<T>(byte[] data) where T : class {\n    return StateSerializer.Deserialize<T>(data);\n  }\n\n  public static T Deserialize<T>(string filePath) where T : class {\n    return StateSerializer.Deserialize<T>(filePath);\n  }\n\n  public static T Deserialize<T>(object data, FunctionIR function) where T : class {\n    return StateSerializer.Deserialize<T>(data, function);\n  }\n\n  public static T Deserialize<T>(object data) where T : class {\n    return StateSerializer.Deserialize<T>(data);\n  }\n\n  // Expose core functionality for advanced scenarios\n  public static void RegisterSurrogate<T1, T2>() {\n    StateSerializer.RegisterSurrogate<T1, T2>();\n  }\n\n  public static void RegisterSurrogate(Type realType, Type surrogateType) {\n    StateSerializer.RegisterSurrogate(realType, surrogateType);\n  }\n\n  public static void RegisterDerivedClass<T1, T2>(int id = 0) {\n    StateSerializer.RegisterDerivedClass<T1, T2>(id);\n  }\n\n  public static void RegisterDerivedClass(Type derivedType, Type baseType, int id = 0) {\n    StateSerializer.RegisterDerivedClass(derivedType, baseType, id);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/ApplicationSettings.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.IO.Compression;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Compilers;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.UI.Query;\nusing ProfileExplorer.UI.Settings;\nusing ProtoBuf;\nusing ProfileExplorer.Core.Compilers.Architecture;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ApplicationSettings {\n  public ApplicationSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)]\n  public List<string> RecentFiles { get; set; }\n  [ProtoMember(2)]\n  public bool AutoReloadDocument { get; set; }\n  [ProtoMember(3)]\n  public string MainWindowPlacement { get; set; }\n  [ProtoMember(4)]\n  public GeneralSettings GeneralSettings { get; set; }\n  [ProtoMember(5)]\n  public List<Tuple<string, string>> RecentComparedFiles { get; set; }\n  [ProtoMember(6)]\n  public DocumentSettings DocumentSettings { get; set; }\n  [ProtoMember(7)]\n  public FlowGraphSettings FlowGraphSettings { get; set; }\n  [ProtoMember(8)]\n  public ExpressionGraphSettings ExpressionGraphSettings { get; set; }\n  [ProtoMember(9)]\n  public RemarkSettings RemarkSettings { get; set; }\n  [ProtoMember(10)]\n  public UIDiffSettings DiffSettings { get; set; }\n  [ProtoMember(11)]\n  public UISectionSettings SectionSettings { get; set; }\n  [ProtoMember(12)]\n  public List<string> RecentTextSearches { get; set; }\n  [ProtoMember(13)]\n  public Dictionary<Guid, byte[]> FunctionTaskOptions { get; set; }\n  [ProtoMember(14)]\n  public string DefaultCompilerIR { get; set; }\n  [ProtoMember(15)]\n  public IRMode DefaultIRMode { get; set; }\n  [ProtoMember(16)]\n  public ProfileDataProviderOptions ProfileOptions { get; set; }\n  [ProtoMember(17)]\n  public SymbolFileSourceSettings SymbolSettings { get; set; }\n  [ProtoMember(18)]\n  public CallTreeSettings CallTreeSettings { get; set; }\n  [ProtoMember(19)]\n  public CallTreeSettings CallerCalleeSettings { get; set; }\n  [ProtoMember(20)]\n  public FlameGraphSettings FlameGraphSettings { get; set; }\n  [ProtoMember(21)]\n  public WorkspaceSettings WorkspaceOptions { get; set; }\n  [ProtoMember(22)]\n  public SourceFileSettings SourceFileSettings { get; set; }\n  [ProtoMember(25)]\n  public TimelineSettings TimelineSettings { get; set; }\n  [ProtoMember(26)]\n  public CallTreeNodeSettings CallTreeNodeSettings { get; set; }\n  [ProtoMember(27)]\n  public PreviewPopupSettings PreviewPopupSettings { get; set; }\n  [ProtoMember(28)]\n  public Dictionary<ToolPanelKind, PreviewPopupSettings> ElementPreviewPopupSettings { get; set; }\n  [ProtoMember(29)]\n  public FunctionMarkingSettings MarkingSettings { get; set; }\n  [ProtoMember(30)]\n  public HashSet<OptionValueId> KnownOptions { get; set; }\n\n  public void Reset() {\n    InitializeReferenceMembers();\n\n    GeneralSettings.Reset();\n    DocumentSettings.Reset();\n    FlowGraphSettings.Reset();\n    ExpressionGraphSettings.Reset();\n    RemarkSettings.Reset();\n    DiffSettings.Reset();\n    SectionSettings.Reset();\n    CallTreeSettings.Reset();\n    CallerCalleeSettings.Reset();\n    FlameGraphSettings.Reset();\n    SourceFileSettings.Reset();\n    TimelineSettings.Reset();\n    CallTreeNodeSettings.Reset();\n    PreviewPopupSettings.Reset();\n    MarkingSettings.Reset();\n    ElementPreviewPopupSettings.Clear();\n    KnownOptions.Clear();\n    AutoReloadDocument = true;\n  }\n\n  public void AddRecentFile(string path) {\n    // Keep at most N recent files, and move this one on the top of the list.\n    // Search as case-insensitive so that C:\\file and c:\\file are considered the same.\n    int index = RecentFiles.FindIndex(file => file.Equals(path,\n                                                          StringComparison.InvariantCultureIgnoreCase));\n\n    if (index != -1) {\n      RecentFiles.RemoveAt(index);\n    }\n    else if (RecentFiles.Count >= 10) {\n      RecentFiles.RemoveAt(RecentFiles.Count - 1);\n    }\n\n    RecentFiles.Insert(0, path);\n  }\n\n  public void RemoveRecentFile(string path) {\n    RecentFiles.Remove(path);\n  }\n\n  public void ClearRecentFiles() {\n    RecentFiles.Clear();\n  }\n\n  public void AddRecentTextSearch(string text) {\n    //? TODO: Use some weights (number of times used) to sort the list\n    //? and make it less likely to evict some often-used term\n    // Keep at most N recent files, and move this one on the top of the list.\n    if (RecentTextSearches.Contains(text)) {\n      RecentTextSearches.Remove(text);\n    }\n    else if (RecentTextSearches.Count >= 20) {\n      RecentTextSearches.RemoveAt(RecentTextSearches.Count - 1);\n    }\n\n    RecentTextSearches.Insert(0, text);\n  }\n\n  public void ClearRecentTextSearches() {\n    RecentTextSearches.Clear();\n  }\n\n  public void AddRecentComparedFiles(string basePath, string diffPath) {\n    // Keep at most N recent files, and move this one on the top of the list.\n    var pair = new Tuple<string, string>(basePath, diffPath);\n\n    if (RecentComparedFiles.Contains(pair)) {\n      RecentComparedFiles.Remove(pair);\n    }\n    else if (RecentComparedFiles.Count >= 10) {\n      RecentComparedFiles.RemoveAt(RecentComparedFiles.Count - 1);\n    }\n\n    RecentComparedFiles.Insert(0, pair);\n\n    // Also add both files to the recent file list.\n    AddRecentFile(basePath);\n    AddRecentFile(diffPath);\n  }\n\n  public void RemoveRecentComparedFiles(Tuple<string, string> pair) {\n    RecentComparedFiles.Remove(pair);\n  }\n\n  public void ClearRecentComparedFiles() {\n    RecentComparedFiles.Clear();\n  }\n\n  public void AddRecordedProfileSession(ProfileDataReport report) {\n    AddProfilingSession(report, ProfileOptions.PreviousRecordingSessions);\n  }\n\n  public void AddLoadedProfileSession(ProfileDataReport report) {\n    AddProfilingSession(report, ProfileOptions.PreviousLoadedSessions);\n  }\n\n  public void RemoveRecordedProfileSession(ProfileDataReport report) {\n    ProfileOptions.PreviousRecordingSessions.Remove(report);\n  }\n\n  public void RemoveLoadedProfileSession(ProfileDataReport report) {\n    ProfileOptions.PreviousLoadedSessions.Remove(report);\n  }\n\n  public void ClearLoadedProfileSession() {\n    ProfileOptions.PreviousLoadedSessions.Clear();\n  }\n\n  public void SaveFunctionTaskOptions(FunctionTaskInfo taskInfo, byte[] data) {\n    FunctionTaskOptions[taskInfo.Id] = data;\n  }\n\n  public byte[] LoadFunctionTaskOptions(FunctionTaskInfo taskInfo) {\n    if (FunctionTaskOptions.TryGetValue(taskInfo.Id, out byte[] data)) {\n      return data;\n    }\n\n    return null;\n  }\n\n  public void SwitchDefaultCompilerIR(string irName, IRMode irMode) {\n    DefaultCompilerIR = irName;\n    DefaultIRMode = irMode;\n  }\n\n  public void CompilerIRSwitched(string irName, IRMode irMode) {\n    //? TODO: Hack to get the default IR style picked when the IR changes\n    //? Should remember a last {ir -> ir style name} and restore based on that\n    DocumentSettings.SyntaxHighlightingName = null;\n    App.ReloadSyntaxHighlightingFiles(irName);\n  }\n\n  [ProtoBeforeSerialization]\n  public void SaveKnownOptions() {\n    // Collect all option members in the settings classes\n    // and store them in a set to be able to detect new options later\n    // when a newer version of the app is used.\n    KnownOptions = SettingsBase.CollectOptionMembers(this);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    RecentFiles ??= new List<string>();\n    RecentTextSearches ??= new List<string>();\n    RecentComparedFiles ??= new List<Tuple<string, string>>();\n    GeneralSettings ??= new GeneralSettings();\n    DocumentSettings ??= new DocumentSettings();\n    FlowGraphSettings ??= new FlowGraphSettings();\n    ExpressionGraphSettings ??= new ExpressionGraphSettings();\n    RemarkSettings ??= new RemarkSettings();\n    DiffSettings ??= new UIDiffSettings();\n    SectionSettings ??= new UISectionSettings();\n    FunctionTaskOptions ??= new Dictionary<Guid, byte[]>();\n    ProfileOptions ??= new ProfileDataProviderOptions();\n    SymbolSettings ??= new SymbolFileSourceSettings();\n    CallTreeSettings ??= new CallTreeSettings();\n    CallerCalleeSettings ??= new CallTreeSettings();\n    FlameGraphSettings ??= new FlameGraphSettings();\n    WorkspaceOptions ??= new WorkspaceSettings();\n    SourceFileSettings ??= new SourceFileSettings();\n    TimelineSettings ??= new TimelineSettings();\n    CallTreeNodeSettings ??= new CallTreeNodeSettings();\n    MarkingSettings ??= new FunctionMarkingSettings();\n    ElementPreviewPopupSettings ??= new Dictionary<ToolPanelKind, PreviewPopupSettings>();\n\n    if (PreviewPopupSettings == null) {\n      PreviewPopupSettings = new PreviewPopupSettings(false);\n      PreviewPopupSettings.Reset();\n    }\n\n    // When adding new options to existing settings classes in a newer version of the app,\n    // ensure they are initialized to their default values. This is done by walking\n    // the nested settings using reflection and handle each option that is not part\n    // of the KnownOptions set, generated on the previous save with an older app version.\n    if (KnownOptions != null) {\n      try {\n        SettingsBase.InitializeAllNewOptions(this, KnownOptions);\n      }\n      catch (Exception ex) {\n        Trace.TraceError($\"Failed to initialize new options: {ex.Message}\");\n      }\n    }\n\n    KnownOptions ??= new HashSet<OptionValueId>();\n  }\n\n  public PreviewPopupSettings GetElementPreviewPopupSettings(ToolPanelKind panelKind) {\n    return ElementPreviewPopupSettings.GetOrAddValue(panelKind, () => {\n      var settings = new PreviewPopupSettings(true);\n      settings.Reset();\n      return settings;\n    });\n  }\n\n  private void AddProfilingSession(ProfileDataReport report, List<ProfileDataReport> list) {\n    if (list.Contains(report)) {\n      list.Remove(report);\n    }\n    else if (list.Count >= 10) {\n      list.RemoveAt(list.Count - 1);\n    }\n\n    list.Insert(0, report);\n  }\n\n  public bool SaveToArchive(string filePath) {\n    try {\n      if (File.Exists(filePath)) {\n        File.Delete(filePath);\n      }\n\n      string appDir = App.GetSettingsDirectoryPath();\n      ZipFile.CreateFromDirectory(appDir, filePath, CompressionLevel.Optimal, false);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to save settings to {filePath}: {ex.Message}\");\n      return false;\n    }\n  }\n\n  public bool LoadFromArchive(string filePath) {\n    try {\n      // Extract first to a temp dir.\n      var tempPath = Directory.CreateTempSubdirectory(\"pex\");\n      ZipFile.ExtractToDirectory(filePath, tempPath.FullName, true);\n\n      if (!App.ContainsSettingsFile(tempPath.FullName)) {\n        Trace.TraceError($\"Invalid settings archive: {filePath}\");\n        return false;\n      }\n\n      // Remove current settings and move the new ones in place.\n      string appDir = App.GetSettingsDirectoryPath();\n      Directory.Delete(appDir, true);\n      Directory.Move(tempPath.FullName, appDir);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load settings from {filePath}: {ex.Message}\");\n      return false;\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/CallTreeNodeSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class CallTreeNodeSettings : SettingsBase {\n  public static readonly int DefaultPreviewPopupDuration = (int)HoverPreview.ExtraLongHoverDurationMs;\n\n  public CallTreeNodeSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool ShowPreviewPopup { get; set; }\n  [ProtoMember(2)][OptionValue(0)]\n  public int PreviewPopupDuration { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool ExpandInstances { get; set; }\n  [ProtoMember(4)][OptionValue(false)]\n  public bool ExpandHistogram { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool PrependModuleToFunction { get; set; }\n  [ProtoMember(6)][OptionValue()]\n  public ProfileListViewFilter FunctionListViewFilter { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool AlternateListRows { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool ExpandThreads { get; set; }\n  [ProtoMember(9)][OptionValue()]\n  public ColumnSettings StackListColumns { get; set; }\n  [ProtoMember(10)][OptionValue()]\n  public ColumnSettings FunctionListColumns { get; set; }\n  [ProtoMember(11)][OptionValue()]\n  public ColumnSettings ModuleListColumns { get; set; }\n  [ProtoMember(12)][OptionValue()]\n  public ColumnSettings ModuleFunctionListColumns { get; set; }\n  [ProtoMember(13)][OptionValue()]\n  public ColumnSettings CategoryListColumns { get; set; }\n  [ProtoMember(14)][OptionValue()]\n  public ColumnSettings CategoryFunctionListColumns { get; set; }\n  [ProtoMember(15)][OptionValue()]\n  public ColumnSettings InstanceListColumns { get; set; }\n  [ProtoMember(16)][OptionValue(\"#F2EA9D\")]\n  public Color HistogramBarColor { get; set; }\n  [ProtoMember(17)][OptionValue(\"#B22222\")]\n  public Color HistogramAverageColor { get; set; }\n  [ProtoMember(18)][OptionValue(\"#00008B\")]\n  public Color HistogramMedianColor { get; set; }\n  [ProtoMember(19)][OptionValue(\"#008000\")]\n  public Color HistogramCurrentColor { get; set; }\n\n  public override void Reset() {\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n    PreviewPopupDuration = DefaultPreviewPopupDuration;\n  }\n\n  public CallTreeNodeSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<CallTreeNodeSettings>(serialized);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProfileListViewFilter : SettingsBase {\n  public static double DefaultMinWeight = 1;\n  public static int DefaultMinItems = 10;\n\n  public ProfileListViewFilter() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool IsEnabled { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool FilterByWeight { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool SortByExclusiveTime { get; set; }\n  [ProtoMember(4)][OptionValue(10)]\n  public int MinItems { get; set; }\n  [ProtoMember(5)][OptionValue(1)]\n  public double MinWeight { get; set; }\n  [ProtoMember(6)][OptionValue(0.01)]\n  public double MinPercentage { get; set; }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/CallTreeSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class CallTreeSettings : SettingsBase {\n  public static readonly int DefaultNodePopupDuration = (int)HoverPreview.HoverDurationMs;\n\n  public CallTreeSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool CombineInstances { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool PrependModuleToFunction { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool ShowTimeAfterPercentage { get; set; }\n  [ProtoMember(4)][OptionValue(false)]\n  public bool ShowDetailsPanel { get; set; }\n  [ProtoMember(5)][OptionValue(false)]\n  public bool SyncSourceFile { get; set; }\n  [ProtoMember(6)][OptionValue(true)]\n  public bool SyncSelection { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool ShowNodePopup { get; set; }\n  [ProtoMember(8)][OptionValue(0)]\n  public int NodePopupDuration { get; set; }\n  [ProtoMember(9)][OptionValue()]\n  public ColumnSettings TreeListColumns { get; set; }\n  [ProtoMember(10)][OptionValue(true)]\n  public bool ExpandHottestPath { get; set; }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n    NodePopupDuration = DefaultNodePopupDuration;\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public CallTreeSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<CallTreeSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/ColorSettingsConverter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorerUI.Settings;\n\n/// <summary>\n/// Type converter for WPF Color types, enabling settings serialization/deserialization\n/// of Color values from string representations.\n/// </summary>\npublic class ColorSettingsConverter : ISettingsTypeConverter {\n  public Type TargetType => typeof(Color);\n\n  public object ConvertFromString(string stringValue) {\n    try {\n      return (Color)ColorConverter.ConvertFromString(stringValue);\n    }\n    catch (Exception) {\n      return Colors.Transparent;\n    }\n  }\n\n  public Array ConvertFromStringArray(string[] stringArray) {\n    var colors = new Color[stringArray.Length];\n    \n    for (int i = 0; i < stringArray.Length; i++) {\n      colors[i] = (Color)ConvertFromString(stringArray[i]);\n    }\n    \n    return colors;\n  }\n}\n"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/ColumnSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows.Controls;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ColumnSettings : SettingsBase {\n  public ColumnSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue()]\n  public Dictionary<string, ColumnState> ColumnStates { get; set; }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public void SaveColumnsState(ListView listView) {\n    if (listView.View is GridView gridView) {\n      SaveColumnsState(gridView);\n    }\n  }\n\n  public void SaveColumnsState(GridView gridView) {\n    foreach (var column in gridView.Columns) {\n      if (column.Header is GridViewColumnHeader header &&\n          !string.IsNullOrEmpty(header.Name)) {\n        var state = GetOrCreateColumnState(header.Name);\n        state.IsVisible = true; //? TODO: Support saving visibility\n        state.Width = (int)column.ActualWidth;\n        state.Order = gridView.Columns.IndexOf(column);\n      }\n    }\n  }\n\n  public void RestoreColumnsState(ListView listView) {\n    if (listView.View is GridView gridView) {\n      RestoreColumnsState(gridView);\n    }\n  }\n\n  public void RestoreColumnsState(GridView gridView) {\n    List<(GridViewColumn, ColumnState)> pairs = new();\n\n    foreach (var column in gridView.Columns) {\n      if (column.Header is not GridViewColumnHeader header ||\n          string.IsNullOrEmpty(header.Name)) continue;\n\n      if (ColumnStates.TryGetValue(header.Name, out var state)) {\n        column.Width = state.Width;\n        pairs.Add((column, state));\n      }\n      else {\n        pairs.Add((column, null));\n      }\n    }\n\n    // Restore column order.\n    pairs.Sort((a, b) => {\n      if (a.Item2 == null || b.Item2 == null) return 0;\n      return a.Item2.Order.CompareTo(b.Item2.Order);\n    });\n    gridView.Columns.Clear();\n\n    foreach (var (column, _) in pairs) {\n      gridView.Columns.Add(column);\n    }\n  }\n\n  private ColumnState GetOrCreateColumnState(string columnName) {\n    if (!ColumnStates.TryGetValue(columnName, out var state)) {\n      state = new ColumnState();\n      ColumnStates[columnName] = state;\n    }\n\n    return state;\n  }\n\n  public override void Reset() {\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n  }\n\n  public ColumnSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<ColumnSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class ColumnState : SettingsBase {\n  public ColumnState() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool IsVisible { get; set; }\n  [ProtoMember(2)][OptionValue(50)]\n  public int Width { get; set; }\n  [ProtoMember(3)][OptionValue(int.MaxValue)]\n  public int Order { get; set; }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public ColumnState Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<ColumnState>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/DocumentSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class DocumentSettings : TextViewSettingsBase {\n  public DocumentSettings() {\n    Reset();\n  }\n\n  [ProtoMember(3)][OptionValue(true)]\n  public bool ShowBlockFolding { get; set; }\n  [ProtoMember(4)][OptionValue(true)]\n  public bool HighlightSourceDefinition { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool HighlightDestinationUses { get; set; }\n  [ProtoMember(6)][OptionValue(false)]\n  public bool HighlightInstructionOperands { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool ShowInfoOnHover { get; set; }\n  [ProtoMember(8)][OptionValue(false)]\n  public bool ShowInfoOnHoverWithModifier { get; set; }\n  [ProtoMember(9)][OptionValue(true)]\n  public bool ShowPreviewPopup { get; set; }\n  [ProtoMember(13)][OptionValue(\"#EAE4BB\")]\n  public Color DefinitionValueColor { get; set; }\n  [ProtoMember(14)][OptionValue(\"#B7E5C6\")]\n  public Color UseValueColor { get; set; }\n  [ProtoMember(15)][OptionValue(\"#000000\")]\n  public Color BorderColor { get; set; }\n  [ProtoMember(16)][OptionValue(\"\")]\n  public string SyntaxHighlightingName { get; set; }\n  [ProtoMember(17)][OptionValue(0)]\n  public int DefaultExpressionsLevel { get; set; }\n  [ProtoMember(18)][OptionValue(false)]\n  public bool MarkMultipleDefinitionExpressions { get; set; }\n  [ProtoMember(19)][OptionValue(true)]\n  public bool FilterSourceDefinitions { get; set; }\n  [ProtoMember(20)][OptionValue(true)]\n  public bool FilterDestinationUses { get; set; }\n  [ProtoMember(21)][OptionValue()]\n  public SourceDocumentMarkerSettings SourceMarkerSettings { get; set; }\n\n  public override void Reset() {\n    base.Reset();\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public DocumentSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<DocumentSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is DocumentSettings settings &&\n           base.Equals(settings) &&\n           AreOptionsEqual(this, settings);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/ExpressionGraphSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ExpressionGraphSettings : GraphSettings {\n  public ExpressionGraphSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(\"#FFFACD\")]\n  public Color UnaryInstructionNodeColor { get; set; }\n  [ProtoMember(2)][OptionValue(\"#FFE4C4\")]\n  public Color BinaryInstructionNodeColor { get; set; }\n  [ProtoMember(3)][OptionValue(\"#F5F5F5\")]\n  public Color CopyInstructionNodeColor { get; set; }\n  [ProtoMember(4)][OptionValue(\"B6E8DE\")]\n  public Color PhiInstructionNodeColor { get; set; }\n  [ProtoMember(5)][OptionValue(\"#D3F8D5\")]\n  public Color OperandNodeColor { get; set; }\n  [ProtoMember(6)][OptionValue(\"#c6def1\")]\n  public Color NumberOperandNodeColor { get; set; }\n  [ProtoMember(7)][OptionValue(\"#b8bedd\")]\n  public Color IndirectionOperandNodeColor { get; set; }\n  [ProtoMember(8)][OptionValue(\"#D8BFD8\")]\n  public Color AddressOperandNodeColor { get; set; }\n  [ProtoMember(9)][OptionValue(\"#178D1F\")]\n  public Color LoopPhiBackedgeColor { get; set; }\n  [ProtoMember(10)][OptionValue(true)]\n  public bool PrintVariableNames { get; set; }\n  [ProtoMember(11)][OptionValue(true)]\n  public bool PrintSSANumbers { get; set; }\n  [ProtoMember(12)][OptionValue(true)]\n  public bool GroupInstructions { get; set; }\n  [ProtoMember(13)][OptionValue(false)]\n  public bool PrintBottomUp { get; set; }\n  [ProtoMember(14)][OptionValue(8)]\n  public int MaxExpressionDepth { get; set; }\n  [ProtoMember(15)][OptionValue(false)]\n  public bool SkipCopyInstructions { get; set; }\n  [ProtoMember(16)][OptionValue(\"#FFCAD1\")]\n  public Color LoadStoreInstructionNodeColor { get; set; }\n  [ProtoMember(17)][OptionValue(\"#F0E68C\")]\n  public Color CallInstructionNodeColor { get; set; }\n\n  public ExpressionGraphPrinterOptions GetGraphPrinterOptions() {\n    return new ExpressionGraphPrinterOptions {\n      PrintVariableNames = PrintVariableNames,\n      PrintSSANumbers = PrintSSANumbers,\n      GroupInstructions = GroupInstructions,\n      PrintBottomUp = PrintBottomUp,\n      SkipCopyInstructions = SkipCopyInstructions,\n      MaxExpressionDepth = MaxExpressionDepth\n    };\n  }\n\n  public override void Reset() {\n    base.Reset();\n    ResetAllOptions(this);\n  }\n\n  public ExpressionGraphSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<ExpressionGraphSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is ExpressionGraphSettings settings &&\n           base.Equals(settings) &&\n           AreOptionsEqual(this, settings);\n  }\n\n  protected override GraphSettings MakeClone() {\n    return Clone();\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/FlameGraphSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class FlameGraphSettings : SettingsBase {\n  public static readonly int DefaultNodePopupDuration = (int)HoverPreview.HoverDurationMs;\n\n  public FlameGraphSettings() {\n    Reset();\n  }\n\n  public ColorPalette[] Palettes { get; set; }\n  public ColorPalette ModulesPalette { get; set; }\n  [ProtoMember(1)][OptionValue(true)]\n  public bool PrependModuleToFunction { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool ShowDetailsPanel { get; set; }\n  [ProtoMember(3)][OptionValue(false)]\n  public bool SyncSourceFile { get; set; }\n  [ProtoMember(4)][OptionValue(true)]\n  public bool SyncSelection { get; set; }\n  [ProtoMember(5)][OptionValue(false)]\n  public bool UseCompactMode { get; set; }\n  [ProtoMember(6)][OptionValue(true)]\n  public bool ShowNodePopup { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool AppendPercentageToFunction { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool AppendDurationToFunction { get; set; }\n  [ProtoMember(9)][OptionValue(0)]\n  public int NodePopupDuration { get; set; }\n  [ProtoMember(10)][OptionValue(\"Profile\")]\n  public string DefaultColorPalette { get; set; }\n  [ProtoMember(11)][OptionValue(\"ProfileKernel\")]\n  public string KernelColorPalette { get; set; }\n  [ProtoMember(12)][OptionValue(\"ProfileManaged\")]\n  public string ManagedColorPalette { get; set; }\n  [ProtoMember(13)][OptionValue(true)]\n  public bool UseKernelColorPalette { get; set; }\n  [ProtoMember(14)][OptionValue(true)]\n  public bool UseManagedColorPalette { get; set; }\n  [ProtoMember(15)][OptionValue(\"#D0E3F1\")]\n  public Color SelectedNodeColor { get; set; }\n  [ProtoMember(16)][OptionValue(\"#F0E68C\")]\n  public Color SearchResultMarkingColor { get; set; }\n  [ProtoMember(17)][OptionValue(\"#000000\")]\n  public Color SelectedNodeBorderColor { get; set; }\n  [ProtoMember(18)][OptionValue(\"#000000\")]\n  public Color SearchedNodeBorderColor { get; set; }\n  [ProtoMember(19)][OptionValue(\"#000000\")]\n  public Color NodeBorderColor { get; set; }\n  [ProtoMember(20)][OptionValue(\"#000000\")]\n  public Color NodeTextColor { get; set; }\n  [ProtoMember(21)][OptionValue(\"#696969\")]\n  public Color NodeModuleColor { get; set; }\n  [ProtoMember(22)][OptionValue(\"#191970\")]\n  public Color NodeWeightColor { get; set; }\n  [ProtoMember(23)][OptionValue(\"#800000\")]\n  public Color NodePercentageColor { get; set; }\n  [ProtoMember(24)][OptionValue(\"#c3ebbc\")]\n  public Color SearchedNodeColor { get; set; }\n  [ProtoMember(25)][OptionValue(\"#00008B\")]\n  public Color KernelNodeBorderColor { get; set; }\n  [ProtoMember(26)][OptionValue(\"#4B0082\")]\n  public Color ManagedNodeBorderColor { get; set; }\n  [ProtoMember(27)][OptionValue(\"#00009B\")]\n  public Color KernelNodeTextColor { get; set; }\n  [ProtoMember(28)][OptionValue(\"#800080\")]\n  public Color ManagedNodeTextColor { get; set; }\n\n  public Brush GetNodeDefaultBrush(FlameGraphNode node) {\n    CachePalettes();\n    var palette = node.HasFunction ? Palettes[(int)node.CallTreeNode.Kind] :\n      Palettes[(int)ProfileCallTreeNodeKind.Unset];\n    int colorIndex = node.Depth % palette.Count;\n    return palette.PickBrush(palette.Count - colorIndex - 1);\n  }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n    NodePopupDuration = DefaultNodePopupDuration;\n  }\n\n  public FlameGraphSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<FlameGraphSettings>(serialized);\n  }\n\n  public void ResedCachedPalettes() {\n    Palettes = null;\n  }\n\n  private void CachePalettes() {\n    if (Palettes == null) {\n      // Mapping from node kind to palette done usign an array\n      // to avoid a dictionary lookup.\n      Palettes = new ColorPalette[4];\n      Palettes[(int)ProfileCallTreeNodeKind.Unset] = ColorPalette.GetPalette(DefaultColorPalette);\n      Palettes[(int)ProfileCallTreeNodeKind.NativeUser] = ColorPalette.GetPalette(DefaultColorPalette);\n      Palettes[(int)ProfileCallTreeNodeKind.NativeKernel] = UseKernelColorPalette ?\n        ColorPalette.GetPalette(KernelColorPalette) :\n        ColorPalette.GetPalette(DefaultColorPalette);\n      Palettes[(int)ProfileCallTreeNodeKind.Managed] = UseManagedColorPalette ?\n        ColorPalette.GetPalette(ManagedColorPalette) :\n        ColorPalette.GetPalette(DefaultColorPalette);\n    }\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/FlowGraphSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class FlowGraphSettings : GraphSettings {\n  public FlowGraphSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(\"#F4F4F4\")]\n  public Color EmptyNodeColor { get; set; }\n  [ProtoMember(2)][OptionValue(\"#0042B6\")]\n  public Color BranchNodeBorderColor { get; set; }\n  [ProtoMember(3)][OptionValue(\"#8500BE\")]\n  public Color SwitchNodeBorderColor { get; set; }\n  [ProtoMember(4)][OptionValue(\"#008D00\")]\n  public Color LoopNodeBorderColor { get; set; }\n  [ProtoMember(5)][OptionValue(\"#B30606\")]\n  public Color ReturnNodeBorderColor { get; set; }\n  [ProtoMember(6)][OptionValue(true)]\n  public bool MarkLoopBlocks { get; set; }\n  [ProtoMember(7, OverwriteList = true)][OptionValue(new string[] {\n    \"#FCD1A4\", \"#FFA56D\", \"#FF7554\", \"#FC5B5B\"\n  })]\n  public Color[] LoopNodeColors { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool ShowImmDominatorEdges { get; set; }\n  [ProtoMember(9)][OptionValue(\"#0042B6\")]\n  public Color DominatorEdgeColor { get; set; }\n\n  public override void Reset() {\n    base.Reset();\n    ResetAllOptions(this);\n  }\n\n  public FlowGraphSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<FlowGraphSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is FlowGraphSettings settings &&\n           base.Equals(settings) &&\n           AreOptionsEqual(this, settings);\n  }\n\n  protected override GraphSettings MakeClone() {\n    return Clone();\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/FunctionMarkingSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text.RegularExpressions;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class FunctionMarkingSettings : SettingsBase {\n  private ColorPalette modulesPalette_;\n  private FunctionMarkingSet builtinMarking_;\n\n  public FunctionMarkingSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(\"\")]\n  public string Title { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool UseAutoModuleColors { get; set; }\n  [ProtoMember(3)][OptionValue(false)]\n  public bool UseModuleColors { get; set; }\n  [ProtoMember(4)][OptionValue(false)]\n  public bool UseFunctionColors { get; set; }\n  [ProtoMember(5)][OptionValue(\"LightPastels\")]\n  public string ModulesColorPalette { get; set; }\n  [ProtoMember(6)][OptionValue()]\n  public FunctionMarkingSet CurrentSet { get; set; }\n  [ProtoMember(7)][OptionValue()]\n  public List<FunctionMarkingSet> SavedSets { get; set; }\n  public List<FunctionMarkingStyle> ModuleColors => CurrentSet?.ModuleColors;\n  public List<FunctionMarkingStyle> FunctionColors => CurrentSet?.FunctionColors;\n  public bool HasEnabledFunctionMarkings => UseFunctionColors &&\n                                            FunctionColors.Find(item => item.IsEnabled) != null;\n  public bool HasEnabledModuleMarkings => UseModuleColors &&\n                                          ModuleColors.Find(item => item.IsEnabled) != null;\n\n  public FunctionMarkingSet BuiltinMarkingCategories {\n    get {\n      if (builtinMarking_ != null) {\n        return builtinMarking_;\n      }\n\n      string markingsFile = App.GetFunctionMarkingsFilePath(App.Session.CompilerInfo.CompilerIRName);\n\n      if (!UIJsonUtils.DeserializeFromFile<FunctionMarkingSet>(markingsFile, out builtinMarking_)) {\n        builtinMarking_ = new FunctionMarkingSet();\n      }\n\n      return builtinMarking_;\n    }\n  }\n\n  public bool ImportMarkings(FrameworkElement owner) {\n    string filePath = Utils.ShowOpenFileDialog(\"JSON files|*.json\", \"*.*\", \"Import markings from file\");\n\n    if (filePath != null) {\n      (bool result, string failureText) = LoadFromFile(filePath);\n\n      if (!result) {\n        Utils.ShowWarningMessageBox($\"Failed to import markings from {filePath}.\\n{failureText}\", owner);\n        return false;\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  public bool ExportMarkings(FrameworkElement owner) {\n    string filePath = Utils.ShowSaveFileDialog(\"JSON files|*.json\", \"*.*\", \"Export markings to file\");\n\n    if (filePath != null) {\n      if (!SaveToFile(filePath)) {\n        Utils.ShowWarningMessageBox($\"Failed to export markings to {filePath}\", owner);\n        return false;\n      }\n\n      return true;\n    }\n\n    return false;\n  }\n\n  public void SwitchMarkingSet(FunctionMarkingSet set) {\n    CurrentSet = set.Clone();\n  }\n\n  public void AppendMarkingSet(FunctionMarkingSet set) {\n    foreach (var marking in set.FunctionColors) {\n      AddFunctionColor(marking);\n    }\n\n    foreach (var marking in set.ModuleColors) {\n      AddModuleColor(marking);\n    }\n  }\n\n  public void SaveCurrentMarkingSet(string title) {\n    SavedSets.RemoveAll(set => set.Title == title);\n    var clone = CurrentSet.Clone();\n    clone.Title = title;\n    SavedSets.Add(clone);\n  }\n\n  public void RemoveMarkingSet(FunctionMarkingSet markingSet) {\n    SavedSets.RemoveAll(set => set.Title == markingSet.Title);\n  }\n\n  public bool SaveToFile(string filePath) {\n    var markings = new Markings(CurrentSet, SavedSets);\n    return UIJsonUtils.SerializeToFile(markings, filePath);\n  }\n\n  public (bool, string) LoadFromFile(string filePath) {\n    if (!UIJsonUtils.DeserializeFromFile(filePath, out Markings data)) {\n      return (false, \"Failed to read markings file\");\n    }\n\n    if (!ValidateMarkings(data, out string failureText)) {\n      return (false, failureText);\n    }\n\n    CurrentSet.MergeWith(data.Current);\n\n    foreach (var savedSet in data.Saved) {\n      var existingSet = SavedSets.Find(set => set.Title == savedSet.Title);\n\n      if (existingSet != null) {\n        existingSet.MergeWith(savedSet);\n      }\n      else {\n        SavedSets.Add(savedSet);\n      }\n    }\n\n    return (true, null);\n  }\n\n  private bool ValidateMarkings(Markings data, out string failureText) {\n    failureText = null;\n\n    if (!data.Current.ValidateMarkings(out failureText)) {\n      return false;\n    }\n\n    foreach (var set in data.Saved) {\n      if (!set.ValidateMarkings(out failureText)) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  public override void Reset() {\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n    ResetCachedPalettes();\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public FunctionMarkingSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<FunctionMarkingSettings>(serialized);\n  }\n\n  public void AddModuleColor(string moduleName, Color color) {\n    AddMarkingColor(moduleName, color, ModuleColors);\n  }\n\n  public void AddFunctionColor(string functionName, Color color) {\n    AddMarkingColor(functionName, color, FunctionColors);\n  }\n\n  public void AddModuleColor(FunctionMarkingStyle style) {\n    AddMarkingColor(style, ModuleColors);\n  }\n\n  public void AddFunctionColor(FunctionMarkingStyle style) {\n    AddMarkingColor(style, FunctionColors);\n  }\n\n  private void AddMarkingColor(string name, Color color, List<FunctionMarkingStyle> markingColors) {\n    AddMarkingColor(new FunctionMarkingStyle(name, color), markingColors);\n  }\n\n  private void AddMarkingColor(FunctionMarkingStyle style, List<FunctionMarkingStyle> markingColors) {\n    // Overwrite marking by removing exact matches.\n    var existing = markingColors.Find(item => item.Name.Equals(style.Name, StringComparison.Ordinal));\n\n    if (existing != null) {\n      if (existing.IsEnabled) {\n        style.IsEnabled = true; // Keep enabled state.\n      }\n\n      markingColors.Remove(existing);\n    }\n\n    markingColors.Add(style);\n  }\n\n  public bool GetFunctionColor(string name, out Color color) {\n    return GetMarkingColor(name, FunctionColors, out color);\n  }\n\n  private bool GetMarkingColor(string name, List<FunctionMarkingStyle> markingColors, out Color color) {\n    foreach (var pair in markingColors) {\n      if (pair.IsEnabled && pair.NameMatches(name)) {\n        color = pair.Color;\n        return true;\n      }\n    }\n\n    color = default(Color);\n    return false;\n  }\n\n  public Brush GetAutoModuleBrush(string name) {\n    if (modulesPalette_ == null) {\n      modulesPalette_ = ColorPalette.GetPalette(ModulesColorPalette);\n    }\n\n    if (modulesPalette_ != null) {\n      return modulesPalette_.PickBrush(name);\n    }\n\n    return ColorBrushes.Transparent;\n  }\n\n  public bool GetModuleColor(string name, out Color color) {\n    return GetMarkingColor(name, ModuleColors, out color);\n  }\n\n  public bool GetModuleBrush(string name, out Brush brush) {\n    if (GetMarkingColor(name, ModuleColors, out var color)) {\n      brush = ColorBrushes.GetBrush(color);\n      return true;\n    }\n\n    brush = ColorBrushes.Transparent;\n    return false;\n  }\n\n  public Brush GetMarkedNodeBrush(string funcName, string moduleName) {\n    if (UseFunctionColors &&\n        GetFunctionColor(funcName, out var color)) {\n      return ColorBrushes.GetBrush(color);\n    }\n    else if (UseModuleColors &&\n             GetModuleColor(moduleName, out var color2)) {\n      return ColorBrushes.GetBrush(color2);\n    }\n\n    return null;\n  }\n\n  public void ResetCachedPalettes() {\n    modulesPalette_ = null;\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n\n  private record Markings(FunctionMarkingSet Current, List<FunctionMarkingSet> Saved);\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class FunctionMarkingSet : SettingsBase {\n  public FunctionMarkingSet() {\n    InitializeReferenceMembers();\n  }\n\n  [ProtoMember(1)][OptionValue()]\n  public List<FunctionMarkingStyle> ModuleColors { get; set; }\n  [ProtoMember(2)][OptionValue()]\n  public List<FunctionMarkingStyle> FunctionColors { get; set; }\n  [ProtoMember(3)][OptionValue(\"\")]\n  public string Title { get; set; }\n\n  public FunctionMarkingSet Clone() {\n    var clone = new FunctionMarkingSet();\n\n    foreach (var marking in FunctionColors) {\n      clone.FunctionColors.Add(marking.Clone());\n    }\n\n    foreach (var marking in ModuleColors) {\n      clone.ModuleColors.Add(marking.Clone());\n    }\n\n    return clone;\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n\n  public void MergeWith(FunctionMarkingSet set) {\n    foreach (var marking in set.FunctionColors) {\n      FunctionColors.RemoveAll(item =>\n                                 item.Name.Equals(marking.Name, StringComparison.Ordinal));\n      FunctionColors.Add(marking.Clone());\n    }\n\n    foreach (var marking in set.ModuleColors) {\n      ModuleColors.RemoveAll(item =>\n                               item.Name.Equals(marking.Name, StringComparison.Ordinal));\n      ModuleColors.Add(marking.Clone());\n    }\n  }\n\n  public bool ValidateMarkings(out string failureText) {\n    foreach (var marking in FunctionColors) {\n      if (!marking.ValidateMarking(out failureText)) {\n        return false;\n      }\n    }\n\n    foreach (var marking in ModuleColors) {\n      if (!marking.ValidateMarking(out failureText)) {\n        return false;\n      }\n    }\n\n    failureText = null;\n    return true;\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class FunctionMarkingStyle : SettingsBase {\n  private TextSearcher searcher_;\n  private string name_;\n\n  public FunctionMarkingStyle(string name, Color color,\n                              string title = null, bool isRegex = false,\n                              bool isEnabled = true) {\n    Name = name;\n    Color = color;\n    Title = title;\n    IsRegex = isRegex;\n    IsEnabled = isEnabled;\n  }\n\n  [ProtoMember(1)]\n  public bool IsEnabled { get; set; }\n  [ProtoMember(2)]\n  public string Title { get; set; }\n\n  [ProtoMember(3)]\n  public string Name {\n    get => name_;\n    set {\n      name_ = value;\n      searcher_ = new TextSearcher(); // Caches precompiled Regex.\n    }\n  }\n\n  [ProtoMember(4)]\n  public Color Color { get; set; }\n  [ProtoMember(5)]\n  public bool IsRegex { get; set; }\n  public bool HasTitle => !string.IsNullOrEmpty(Title);\n  public string TitleOrName => HasTitle ? Title : Name;\n\n  public bool NameMatches(string candidate) {\n    if (candidate == null ||\n        candidate.Length <= 0 || Name.Length <= 0) {\n      return false;\n    }\n\n    if (IsRegex) {\n      // Regex allows partial match.\n      return searcher_.Includes(candidate, Name, TextSearchKind.Regex);\n    }\n    else {\n      // Otherwise accept full match only, not substring,\n      // otherwise it finds all functions with a prefix/suffix too.\n      return Name.Equals(candidate, StringComparison.Ordinal);\n    }\n  }\n\n  public FunctionMarkingStyle CloneWithNewColor(Color newColor) {\n    return new FunctionMarkingStyle(Name, newColor, Title, IsRegex, IsEnabled);\n  }\n\n  public FunctionMarkingStyle Clone() {\n    return new FunctionMarkingStyle(Name, Color, Title, IsRegex, IsEnabled);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n\n  public bool ValidateMarking(out string failureText) {\n    if (IsRegex && !ValidateRegex(Name)) {\n      failureText = $\"Invalid Regex for marking definition.\\n\";\n      failureText += $\"  Title: {Title}\\n\";\n      failureText += $\"  Pattern: {Name}\\n\";\n      return false;\n    }\n\n    failureText = null;\n    return true;\n  }\n\n  private bool ValidateRegex(string pattern) {\n    if (string.IsNullOrEmpty(pattern)) {\n      return false;\n    }\n\n    try {\n      var re = new Regex(pattern, RegexOptions.None, TimeSpan.FromSeconds(1));\n      re.IsMatch(\" \");\n    }\n    catch { return false; }\n\n    return true;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/FunctionTaskSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI.Settings;\n\n[ProtoContract(SkipConstructor = true)]\nclass FunctionTaskSettings : SettingsBase {\n  [ProtoMember(1)]\n  public double OutputPanelWidth { get; set; }\n  [ProtoMember(2)]\n  public double OutputPanelHeight { get; set; }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/GraphSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\n[ProtoInclude(100, typeof(FlowGraphSettings))]\n[ProtoInclude(200, typeof(ExpressionGraphSettings))]\npublic class GraphSettings : SettingsBase {\n  public GraphSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool SyncSelectedNodes { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool SyncMarkedNodes { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool BringNodesIntoView { get; set; }\n  [ProtoMember(4)][OptionValue(true)]\n  public bool ShowPreviewPopup { get; set; }\n  [ProtoMember(5)][OptionValue(false)]\n  public bool ShowPreviewPopupWithModifier { get; set; }\n  [ProtoMember(6)][OptionValue(true)]\n  public bool ColorizeNodes { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool ColorizeEdges { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool HighlightConnectedNodesOnHover { get; set; }\n  [ProtoMember(9)][OptionValue(true)]\n  public bool HighlightConnectedNodesOnSelection { get; set; }\n  [ProtoMember(10)][OptionValue(\"#F0F0F0\")]\n  public Color BackgroundColor { get; set; }\n  [ProtoMember(11)][OptionValue(\"#000000\")]\n  public Color TextColor { get; set; }\n  [ProtoMember(12)][OptionValue(\"#CBCBCB\")]\n  public Color NodeColor { get; set; }\n  [ProtoMember(13)][OptionValue(\"#000000\")]\n  public Color NodeBorderColor { get; set; }\n  [ProtoMember(14)][OptionValue(\"#000000\")]\n  public Color EdgeColor { get; set; }\n  [ProtoMember(15)][OptionValue(\"#6927CC\")]\n  public Color PredecessorNodeBorderColor { get; set; }\n  [ProtoMember(16)][OptionValue(\"#008230\")]\n  public Color SuccessorNodeBorderColor { get; set; }\n  [ProtoMember(17)][OptionValue(\"#AEDCF4\")]\n  public Color SelectedNodeColor { get; set; }\n\n  public GraphSettings Clone() {\n    return MakeClone();\n  }\n\n  public override void Reset() {\n    ResetAllOptions(this, typeof(GraphSettings));\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj, typeof(GraphSettings));\n  }\n\n  protected virtual GraphSettings MakeClone() {\n    throw new NotImplementedException();\n  }\n\n  public override string ToString() {\n    return PrintOptions(this, typeof(GraphSettings));\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/OptionalColumnSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Utilities;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class OptionalColumnSettings : SettingsBase {\n  public OptionalColumnSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue()]\n  public Dictionary<string, OptionalColumnStyle> ColumnStyles { get; set; }\n  [ProtoMember(2)][OptionValue()]\n  public Dictionary<string, ColumnState> ColumnStates { get; set; }\n  [ProtoMember(3)][OptionValue(false)]\n  public bool RemoveEmptyColumns { get; set; }\n  [ProtoMember(4)][OptionValue(true)]\n  public bool ShowPerformanceCounterColumns { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool ShowPerformanceMetricColumns { get; set; }\n  public static OptionalColumnStyle DefaultTimePercentageColumnStyle =>\n    new() {\n      ShowPercentageBar = OptionalColumnStyle.PartVisibility.IfActiveColumn,\n      UseBackColor = OptionalColumnStyle.PartVisibility.Always,\n      ShowIcon = OptionalColumnStyle.PartVisibility.Always,\n      //BackColorPalette = ColorPalette.Profile,\n      InvertColorPalette = false,\n      PickColorForPercentage = true\n    };\n  public static OptionalColumnStyle DefaultTimeColumnStyle =>\n    new() {\n      ShowPercentageBar = OptionalColumnStyle.PartVisibility.IfActiveColumn,\n      UseBackColor = OptionalColumnStyle.PartVisibility.Always,\n      ShowIcon = OptionalColumnStyle.PartVisibility.IfActiveColumn,\n      //BackColorPalette = ColorPalette.Profile,\n      InvertColorPalette = false,\n      PickColorForPercentage = true\n    };\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public static OptionalColumnStyle DefaultMetricsColumnStyle(int k) {\n    return new OptionalColumnStyle() {\n      ShowPercentageBar = OptionalColumnStyle.PartVisibility.Always,\n      UseBackColor = OptionalColumnStyle.PartVisibility.Always,\n      ShowIcon = OptionalColumnStyle.PartVisibility.IfActiveColumn,\n      PickColorForPercentage = false,\n      //BackColorPalette = ColorPalette.Profile,\n      InvertColorPalette = false,\n      TextColor = ColorPalette.DarkHue.PickColor(k),\n      PercentageBarBackColor = ColorPalette.DarkHue.PickColor(k)\n    };\n  }\n\n  public static OptionalColumnStyle DefaultCounterColumnStyle(int k) {\n    return new OptionalColumnStyle() {\n      ShowPercentageBar = OptionalColumnStyle.PartVisibility.Always,\n      UseBackColor = OptionalColumnStyle.PartVisibility.IfActiveColumn,\n      ShowIcon = OptionalColumnStyle.PartVisibility.IfActiveColumn,\n      PickColorForPercentage = false,\n      //BackColorPalette = ColorPalette.Profile,\n      InvertColorPalette = false,\n      TextColor = ColorPalette.DarkHue.PickColor(k),\n      PercentageBarBackColor = ColorPalette.DarkHue.PickColor(k)\n    };\n  }\n\n  public OptionalColumnStyle GetColumnStyle(OptionalColumn column) {\n    return ColumnStyles.GetValueOrNull(column.ColumnName);\n  }\n\n  public void AddColumnStyle(OptionalColumn column, OptionalColumnStyle style) {\n    ColumnStyles[column.ColumnName] = style;\n  }\n\n  private ColumnState GetOrCreateColumnState(OptionalColumn column) {\n    if (!ColumnStates.TryGetValue(column.ColumnName, out var state)) {\n      state = new ColumnState();\n      ColumnStates[column.ColumnName] = state;\n      NumberColumnStates();\n    }\n\n    return state;\n  }\n\n  private void NumberColumnStates() {\n    var stateList = ColumnStates.ToValueList();\n    stateList.Sort((a, b) => a.Order.CompareTo(b.Order));\n\n    for (int i = 0; i < stateList.Count; ++i) {\n      stateList[i].Order = i;\n    }\n  }\n\n  public bool IsColumnVisible(OptionalColumn column) {\n    return GetOrCreateColumnState(column).IsVisible;\n  }\n\n  public void SetColumnVisibility(OptionalColumn column, bool visible) {\n    GetOrCreateColumnState(column).IsVisible = visible;\n  }\n\n  public List<OptionalColumn> FilterAndSortColumns(List<OptionalColumn> columns) {\n    NumberColumnStates();\n    var sortedColumns = new List<OptionalColumn>();\n\n    foreach (var column in columns) {\n      // Filter out columns.\n      if (column.IsPerformanceCounter && !ShowPerformanceCounterColumns ||\n          column.IsPerformanceMetric && !ShowPerformanceMetricColumns) {\n        continue;\n      }\n\n      GetOrCreateColumnState(column); // Ensure column state exists.\n      sortedColumns.Add(column);\n    }\n\n    sortedColumns.Sort((a, b) => {\n      var aState = ColumnStates[a.ColumnName];\n      var bState = ColumnStates[b.ColumnName];\n      return aState.Order.CompareTo(bState.Order);\n    });\n\n    return sortedColumns;\n  }\n\n  public override void Reset() {\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n  }\n\n  public OptionalColumnSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<OptionalColumnSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class OptionalColumnStyle : SettingsBase {\n  public enum PartVisibility {\n    Always,\n    IfActiveColumn,\n    Never\n  }\n\n  public OptionalColumnStyle() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(\"\")]\n  public string AlternateTitle { get; set; }\n  [ProtoMember(2)][OptionValue(PartVisibility.Never)]\n  public PartVisibility ShowPercentageBar { get; set; }\n  [ProtoMember(3)]\n  public Color PercentageBarBackColor { get; set; }\n  [ProtoMember(4)][OptionValue(\"#000000\")]\n  public Color TextColor { get; set; }\n  [ProtoMember(5)][OptionValue(PartVisibility.Never)]\n  public PartVisibility ShowIcon { get; set; }\n  [ProtoMember(6)][OptionValue(false)]\n  public bool PickColorForPercentage { get; set; }\n  [ProtoMember(7)][OptionValue(PartVisibility.Never)]\n  public PartVisibility UseBackColor { get; set; }\n  [ProtoMember(8)][OptionValue(\"\")]\n  public string BackColorPalette { get; set; }\n  [ProtoMember(9)][OptionValue(false)]\n  public bool InvertColorPalette { get; set; }\n  [ProtoMember(10)][OptionValue(\"#00FFFFFF\")]\n  public Color BackgroundColor { get; set; }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public OptionalColumnStyle Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<OptionalColumnStyle>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/PreviewPopupSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class PreviewPopupSettings : SettingsBase {\n  public PreviewPopupSettings() : this(false) { }\n\n  public PreviewPopupSettings(bool isElementPopup) {\n    IsElementPopup = isElementPopup;\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(false)]\n  public bool JumpToHottestElement { get; set; }\n  [ProtoMember(2)][OptionValue(false)]\n  public bool UseCompactProfilingColumns { get; set; }\n  [ProtoMember(3)][OptionValue(false)]\n  public bool ShowPerformanceCounterColumns { get; set; }\n  [ProtoMember(4)][OptionValue(false)]\n  public bool ShowPerformanceMetricColumns { get; set; }\n  [ProtoMember(5)][OptionValue(false)]\n  public bool UseSmallerFontSize { get; set; }\n  [ProtoMember(6)][OptionValue(false)]\n  public bool ShowSourcePreviewPopup { get; set; }\n  [ProtoMember(7)][OptionValue(550)]\n  public double PopupWidth { get; set; }\n  [ProtoMember(8)][OptionValue(400)]\n  public double PopupHeight { get; set; }\n  [ProtoMember(9)][OptionValue(false)]\n  public bool IsElementPopup { get; set; }\n\n  public override void Reset() {\n    bool isElementPopup = IsElementPopup;\n    ResetAllOptions(this);\n\n    if (isElementPopup) {\n      PopupHeight = 200;\n      IsElementPopup = true;\n    }\n    else {\n      JumpToHottestElement = true;\n      UseCompactProfilingColumns = true;\n    }\n  }\n\n  public PreviewPopupSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<PreviewPopupSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/ProfileDocumentMarkerSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class ProfileDocumentMarkerSettings : SettingsBase {\n  public enum ValueUnitKind {\n    Nanosecond,\n    Microsecond,\n    Millisecond,\n    Second,\n    Percent,\n    Value,\n    Default\n  }\n\n  private static ColorPalette defaultBackColorPalette_ = ColorPalette.Profile;\n  public static int DefaultMaxPercentageBarWidth = 50;\n  public static double DefaultElementWeightCutoff = 0.01; // 1%;\n  private static IconDrawing[] orderIcons_;\n\n  static ProfileDocumentMarkerSettings() {\n    // Preload icons used to mark hot elements.\n    orderIcons_ = [\n      IconDrawing.FromIconResource(\"HotFlameIcon1\"),\n      IconDrawing.FromIconResource(\"HotFlameIcon2\"),\n      IconDrawing.FromIconResource(\"HotFlameIcon3\"),\n      IconDrawing.FromIconResource(\"HotFlameIconTransparent\")\n    ];\n  }\n\n  public ProfileDocumentMarkerSettings() {\n    Reset();\n  }\n\n  //? TODO: Counter shortening list\n  // private static readonly (string, string)[] PerfCounterNameReplacements = {\n  //   (\"Instruction\", \"Instr\"),\n  //   (\"Misprediction\", \"Mispred\")\n  // };\n  [ProtoMember(1)][OptionValue(true)]\n  public bool MarkElements { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool MarkBlocks { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool MarkBlocksInFlowGraph { get; set; }\n  [ProtoMember(4)][OptionValue(true)]\n  public bool MarkCallTargets { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool JumpToHottestElement { get; set; }\n  [ProtoMember(7)][OptionValue(0.01)] // 1%\n  public double ElementWeightCutoff { get; set; }\n  [ProtoMember(8)][OptionValue(10)]\n  public int TopOrderCutoff { get; set; }\n  [ProtoMember(9)][OptionValue(0.01)] // 1%\n  public double IconBarWeightCutoff { get; set; }\n  [ProtoMember(10)][OptionValue(\"#000000\")]\n  public Color ColumnTextColor { get; set; }\n  [ProtoMember(11)][OptionValue(\"#00008B\")]\n  public Color BlockOverlayTextColor { get; set; }\n  [ProtoMember(12)][OptionValue(\"#8B0000\")]\n  public Color HotBlockOverlayTextColor { get; set; }\n  [ProtoMember(14)][OptionValue(\"#696969\")]\n  public Color BlockOverlayBorderColor { get; set; }\n  [ProtoMember(15)][OptionValue(1)]\n  public double BlockOverlayBorderThickness { get; set; }\n  [ProtoMember(16)][OptionValue(\"#AA4343\")]\n  public Color PercentageBarBackColor { get; set; }\n  [ProtoMember(17)][OptionValue(50)]\n  public int MaxPercentageBarWidth { get; set; }\n  [ProtoMember(18)][OptionValue(true)]\n  public bool DisplayPercentageBar { get; set; }\n  [ProtoMember(19)][OptionValue(true)]\n  public bool DisplayIcons { get; set; }\n  [ProtoMember(20)][OptionValue(ValueUnitKind.Millisecond)]\n  public ValueUnitKind ValueUnit { get; set; }\n  [ProtoMember(21)][OptionValue(true)]\n  public bool AppendValueUnitSuffix { get; set; }\n  [ProtoMember(22)][OptionValue(2)]\n  public int ValueUnitDecimals { get; set; }\n  [ProtoMember(23)][OptionValue(\"#FAEBD7\")]\n  public Color PerformanceMetricBackColor { get; set; }\n  [ProtoMember(24)][OptionValue(\"#F5F5F5\")]\n  public Color PerformanceCounterBackColor { get; set; }\n  public string ValueUnitSuffix => ValueUnit switch {\n    ValueUnitKind.Millisecond => \"ms\",\n    ValueUnitKind.Microsecond => \"µs\",\n    ValueUnitKind.Nanosecond  => \"ns\",\n    ValueUnitKind.Second      => \"s\",\n    _                         => \"\"\n  };\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public string FormatWeightValue(TimeSpan weight) {\n    string suffix = \"\";\n\n    if (AppendValueUnitSuffix) {\n      suffix = $\" {ValueUnitSuffix}\";\n    }\n\n    return ValueUnit switch {\n      ValueUnitKind.Millisecond => weight.AsMillisecondsString(ValueUnitDecimals, suffix),\n      ValueUnitKind.Microsecond => weight.AsMicrosecondString(ValueUnitDecimals, suffix),\n      ValueUnitKind.Nanosecond  => weight.AsNanosecondsString(ValueUnitDecimals, suffix),\n      ValueUnitKind.Second      => weight.AsSecondsString(ValueUnitDecimals, suffix),\n      _                         => weight.Ticks.ToString()\n    };\n  }\n\n  public Brush PickBackColor(OptionalColumn column, int order, double percentage) {\n    if (!ShouldUseBackColor(column)) {\n      return ColorBrushes.Transparent;\n    }\n\n    return column.Style.PickColorForPercentage &&\n           !ShouldOverridePercentage(order, percentage)\n      ? PickBackColorForPercentage(column, percentage)\n      : PickBackColorForOrder(column, order, percentage, !InvertColorPalette(column));\n  }\n\n  public Brush PickBackColorForPercentage(double percentage) {\n    return PickBackColorForPercentage(null, percentage);\n  }\n\n  private Brush PickBackColorForPercentage(OptionalColumn column, double percentage) {\n    if (percentage < ElementWeightCutoff) {\n      return ColorBrushes.Transparent;\n    }\n\n    var palette = PickColorPalette(column);\n    return palette.PickBrushForPercentage(percentage, InvertColorPalette(column));\n  }\n\n  private Brush PickBackColorForOrder(OptionalColumn column, int order, double percentage, bool inverted) {\n    if (!IsSignificantValue(order, percentage)) {\n      return ColorBrushes.Transparent;\n    }\n\n    var palette = PickColorPalette(column);\n    return palette.PickBrush(order, inverted);\n  }\n\n  public Brush PickDefaultBackColor(OptionalColumn column) {\n    if (!column.Style.BackgroundColor.IsTransparent()) {\n      return column.Style.BackgroundColor.AsBrush();\n    }\n\n    if (column.PerformanceCounter != null) {\n      return column.IsPerformanceCounter ?\n        PerformanceCounterBackColor.AsBrush() :\n        PerformanceMetricBackColor.AsBrush();\n    }\n\n    return ColorBrushes.Transparent;\n  }\n\n  public bool IsSignificantValue(int order, double percentage) {\n    return order < TopOrderCutoff && percentage >= IconBarWeightCutoff;\n  }\n\n  public bool IsVisibleValue(int order, double percentage) {\n    return order < TopOrderCutoff && percentage > double.Epsilon ||\n           percentage >= ElementWeightCutoff;\n  }\n\n  public bool IsVisibleValue(double percentage, double scale = 1.0) {\n    return percentage >= ElementWeightCutoff * scale;\n  }\n\n  public Brush PickBackColorForOrder(int order, double percentage, bool inverted) {\n    return PickBackColorForOrder(null, order, percentage, inverted);\n  }\n\n  public (Brush, FontWeight) PickBlockOverlayStyle(int order, double percentage) {\n    return IsSignificantValue(order, percentage)\n      ? (HotBlockOverlayTextColor.AsBrush(), FontWeights.Bold)\n      : (BlockOverlayTextColor.AsBrush(), FontWeights.Normal);\n  }\n\n  public (Brush, FontWeight) PickBlockOverlayStyle(double percentage) {\n    return PickBlockOverlayStyle(int.MaxValue, percentage);\n  }\n\n  public Brush PickTextColor(OptionalColumn column, int order, double percentage) {\n    return !column.Style.TextColor.IsTransparent() ?\n      ColorBrushes.GetBrush(column.Style.TextColor) : ColumnTextColor.AsBrush();\n  }\n\n  public FontWeight PickTextWeight(OptionalColumn column, int order, double percentage) {\n    if (column.Style.PickColorForPercentage &&\n        !ShouldOverridePercentage(order, percentage)) {\n      return percentage switch {\n        >= 0.9 => FontWeights.Bold,\n        >= 0.7 => FontWeights.Medium,\n        >= 0.5 => FontWeights.SemiBold,\n        _      => FontWeights.Normal\n      };\n    }\n\n    return order switch {\n      0 => FontWeights.Bold,\n      1 => FontWeights.Medium,\n      _ => IsSignificantValue(order, percentage)\n        ? FontWeights.SemiBold\n        : FontWeights.Normal\n    };\n  }\n\n  public FontWeight PickTextWeight(double percentage) {\n    return percentage switch {\n      >= 0.9  => FontWeights.Bold,\n      >= 0.75 => FontWeights.Medium,\n      _       => FontWeights.Normal\n    };\n  }\n\n  public Brush PickBrushForPercentage(double weightPercentage) {\n    return PickBackColorForPercentage(null, weightPercentage);\n  }\n\n  public IconDrawing PickIcon(OptionalColumn column, int order, double percentage) {\n    if (!ShouldShowIcon(column)) {\n      return IconDrawing.Empty;\n    }\n\n    return column.Style.PickColorForPercentage &&\n           !ShouldOverrideIconPercentage(order, percentage)\n      ? PickIconForPercentage(percentage)\n      : PickIconForOrder(order, percentage);\n  }\n\n  public IconDrawing PickIconForOrder(int order, double percentage) {\n    return order switch {\n      0 => orderIcons_[0],\n      1 => orderIcons_[1],\n      // Even if instr is the n-th hottest one, don't use an icon\n      // if the percentage is small.\n      _ => IsSignificantValue(order, percentage) ? orderIcons_[2] : orderIcons_[3]\n    };\n  }\n\n  public IconDrawing PickIconForPercentage(double percentage) {\n    return percentage switch {\n      >= 0.9 => orderIcons_[0],\n      >= 0.7 => orderIcons_[1],\n      >= 0.5 => orderIcons_[2],\n      _      => orderIcons_[3]\n    };\n  }\n\n  public bool ShowPercentageBar(OptionalColumn column, int order, double percentage) {\n    if (!ShouldShowPercentageBar(column)) {\n      return false;\n    }\n\n    // Don't use a bar if it ends up only a few pixels.\n    return percentage >= IconBarWeightCutoff;\n  }\n\n  public bool ShowPercentageBar(double percentage) {\n    if (!DisplayPercentageBar) {\n      return false;\n    }\n\n    // Don't use a bar if it ends up only a few pixels.\n    return percentage >= IconBarWeightCutoff;\n  }\n\n  public Brush PickPercentageBarColor(OptionalColumn column) {\n    return !column.Style.PercentageBarBackColor.IsTransparent() ?\n      ColorBrushes.GetBrush(column.Style.PercentageBarBackColor) :\n      PercentageBarBackColor.AsBrush();\n  }\n\n  private bool ShouldShowPercentageBar(OptionalColumn column) {\n    return DisplayPercentageBar &&\n           (column.Style.ShowPercentageBar == OptionalColumnStyle.PartVisibility.Always ||\n            column.IsMainColumn &&\n            column.Style.ShowPercentageBar == OptionalColumnStyle.PartVisibility.IfActiveColumn);\n  }\n\n  private bool ShouldShowIcon(OptionalColumn column) {\n    return DisplayIcons && (column.Style.ShowIcon == OptionalColumnStyle.PartVisibility.Always ||\n                            column.IsMainColumn &&\n                            column.Style.ShowIcon == OptionalColumnStyle.PartVisibility.IfActiveColumn);\n  }\n\n  private bool ShouldUseBackColor(OptionalColumn column) {\n    return column.Style.UseBackColor == OptionalColumnStyle.PartVisibility.Always ||\n           column.IsMainColumn &&\n           column.Style.UseBackColor == OptionalColumnStyle.PartVisibility.IfActiveColumn;\n  }\n\n  public Brush PickColorForPercentage(double percentage) {\n    return PickBackColorForPercentage(null, percentage);\n  }\n\n  private ColorPalette PickColorPalette(OptionalColumn column) {\n    return !string.IsNullOrEmpty(column?.Style?.BackColorPalette) ?\n      ColorPalette.GetPalette(column.Style.BackColorPalette) :\n      defaultBackColorPalette_;\n  }\n\n  private bool InvertColorPalette(OptionalColumn column) {\n    return column != null && column.Style.InvertColorPalette;\n  }\n\n  private bool ShouldOverridePercentage(int order, double percentage) {\n    // Hottest elements still handled by order.\n    return order == 0 ||\n           order < 3 && percentage > 0.2; // 20%\n  }\n\n  private bool ShouldOverrideIconPercentage(int order, double percentage) {\n    // Hottest elements still handled by order.\n    return order == 0 ||\n           order < 3 && percentage > 0.05; // 5%\n  }\n\n  public ProfileDocumentMarkerSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<ProfileDocumentMarkerSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/RemarkSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class RemarkSettings : SettingsBase {\n  public RemarkSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(false)]\n  public bool ShowRemarks { get; set; }\n  [ProtoMember(2)][OptionValue(false)]\n  public bool ShowPreviousSections { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool StopAtSectionBoundaries { get; set; }\n  [ProtoMember(4)][OptionValue(false)]\n  public int SectionHistoryDepth { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool ShowPreviousOptimizationRemarks { get; set; }\n  [ProtoMember(6)][OptionValue(true)]\n  public bool ShowActionButtonOnHover { get; set; }\n  [ProtoMember(7)][OptionValue(false)]\n  public bool ShowActionButtonWithModifier { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool ShowMarginRemarks { get; set; }\n  [ProtoMember(9)][OptionValue(true)]\n  public bool ShowDocumentRemarks { get; set; }\n  [ProtoMember(10)][OptionValue(true)]\n  public bool UseRemarkBackground { get; set; }\n  [ProtoMember(11)][OptionValue(true)]\n  public bool UseTransparentRemarkBackground { get; set; }\n  [ProtoMember(12)][OptionValue(25)]\n  public int RemarkBackgroundOpacity { get; set; }\n  [ProtoMember(13)][OptionValue(true)]\n  public bool Default { get; set; }\n  [ProtoMember(14)][OptionValue(true)]\n  public bool Verbose { get; set; }\n  [ProtoMember(15)][OptionValue(false)]\n  public bool Trace { get; set; }\n  [ProtoMember(16)][OptionValue(true)]\n  public bool Analysis { get; set; }\n  [ProtoMember(17)][OptionValue(true)]\n  public bool Optimization { get; set; }\n  [ProtoMember(18)][OptionValue()]\n  public Dictionary<string, bool> CategoryFilter { get; set; }\n  [ProtoMember(19)][OptionValue(false)]\n  public bool ShowPreviousAnalysisRemarks { get; set; }\n  public string SearchedText { get; set; }\n  public bool HasCategoryFilters => CategoryFilter != null && CategoryFilter.Count > 0;\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public RemarkSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<RemarkSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/SourceDocumentMarkerSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class SourceDocumentMarkerSettings : SettingsBase {\n  public SourceDocumentMarkerSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool AnnotateSourceLines { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool AnnotateInlinees { get; set; }\n  [ProtoMember(3)][OptionValue(0.5)]\n  public double VirtualColumnPosition { get; set; }\n  [ProtoMember(4)][OptionValue(\"#696969\")]\n  public Color SourceLineTextColor { get; set; }\n  [ProtoMember(5)][OptionValue(\"#00FFFFFF\")]\n  public Color SourceLineBackColor { get; set; }\n  [ProtoMember(6)][OptionValue(\"#008000\")]\n  public Color InlineeOverlayTextColor { get; set; }\n  [ProtoMember(7)][OptionValue(\"#00FFFFFF\")]\n  public Color InlineeOverlayBackColor { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool MarkCallTargets { get; set; }\n  [ProtoMember(9)][OptionValue(\"#00008B\")]\n  public Color CallTargetTextColor { get; set; }\n  [ProtoMember(10)][OptionValue(\"#00FFFFFF\")]\n  public Color CallTargetBackColor { get; set; }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n  }\n\n  public SourceDocumentMarkerSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<SourceDocumentMarkerSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/SourceFileSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class SourceFileSettings : TextViewSettingsBase {\n  public SourceFileSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue()]\n  public SourceFileFinderSettings FinderSettings { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool SyncStyleWithDocument { get; set; }\n  [ProtoMember(3)][OptionValue(true)]\n  public bool SyncLineWithDocument { get; set; }\n  [ProtoMember(4)][OptionValue(false)]\n  public bool SyncInlineeWithDocument { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool ShowInlineAssembly { get; set; }\n  [ProtoMember(6)][OptionValue(false)]\n  public bool AutoExpandInlineAssembly { get; set; }\n  [ProtoMember(7)][OptionValue(true)]\n  public bool ShowSourceStatements { get; set; }\n  [ProtoMember(8)][OptionValue(true)]\n  public bool ShowSourceStatementsOnMargin { get; set; }\n  [ProtoMember(9)][OptionValue(true)]\n  public bool ReplaceInsignificantSourceStatements { get; set; }\n  [ProtoMember(10)][OptionValue(\"#505050\")]\n  public Color AssemblyTextColor { get; set; }\n  [ProtoMember(11)][OptionValue(\"#00000000\")]\n  public Color AssemblyBackColor { get; set; }\n\n  public override void Reset() {\n    base.Reset();\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public SourceFileSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<SourceFileSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return obj is SourceFileSettings settings &&\n           base.Equals(settings) &&\n           AreOptionsEqual(this, settings);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class SourceFileFinderSettings : SettingsBase {\n  public SourceFileFinderSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue()]\n  public Dictionary<string, string> SourceMappings { get; set; }\n  [ProtoMember(2)][OptionValue()]\n  public List<string> DisabledSourceMappings { get; set; }\n\n  public override void Reset() {\n    InitializeReferenceMembers();\n    ResetAllOptions(this);\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/TextViewSettingsBase.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\n[ProtoInclude(100, typeof(DocumentSettings))]\n[ProtoInclude(200, typeof(SourceFileSettings))]\npublic abstract class TextViewSettingsBase : SettingsBase {\n  public TextViewSettingsBase() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue()]\n  public ProfileDocumentMarkerSettings ProfileMarkerSettings { get; set; }\n  [ProtoMember(2)][OptionValue()]\n  public OptionalColumnSettings ColumnSettings { get; set; }\n  [ProtoMember(3)][OptionValue(\"Consolas\")]\n  public string FontName { get; set; }\n  [ProtoMember(4)][OptionValue(12)]\n  public double FontSize { get; set; }\n  [ProtoMember(5)][OptionValue(\"#FFFAFA\")]\n  public Color BackgroundColor { get; set; }\n  [ProtoMember(6)][OptionValue(\"#f5f5f5\")]\n  public Color AlternateBackgroundColor { get; set; }\n  [ProtoMember(7)][OptionValue(\"#FFFAFA\")]\n  public Color MarginBackgroundColor { get; set; }\n  [ProtoMember(8)][OptionValue(\"#000000\")]\n  public Color TextColor { get; set; }\n  [ProtoMember(9)][OptionValue(\"#C5DEEA\")]\n  public Color SelectedValueColor { get; set; }\n  [ProtoMember(10)][OptionValue(true)]\n  public bool ShowBlockSeparatorLine { get; set; }\n  [ProtoMember(11)][OptionValue(\"#C0C0C0\")]\n  public Color BlockSeparatorColor { get; set; }\n  [ProtoMember(12)][OptionValue(\"#696969\")]\n  public Color CurrentLineBorderColor { get; set; }\n  [ProtoMember(13)][OptionValue(true)]\n  public bool HighlightCurrentLine { get; set; }\n\n  public override void Reset() {\n    InitializeReferenceMembers();\n    ResetAllOptions(this, typeof(TextViewSettingsBase));\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public bool HasProfilingChanges(TextViewSettingsBase other) {\n    return !ProfileMarkerSettings.Equals(other.ProfileMarkerSettings) ||\n           !ColumnSettings.Equals(other.ColumnSettings) ||\n           // Changing font means columns must be redrawn.\n           FontName != other.FontName ||\n           Math.Abs(FontSize - other.FontSize) >= double.Epsilon;\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj, typeof(TextViewSettingsBase));\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/TimelineSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class TimelineSettings : SettingsBase {\n  public static readonly int DefaultCallStackPopupDuration = (int)HoverPreview.ExtraLongHoverDurationMs;\n\n  public TimelineSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool SyncSelection { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool ShowCallStackPopup { get; set; }\n  [ProtoMember(3)][OptionValue(0)]\n  public int CallStackPopupDuration { get; set; }\n  [ProtoMember(4)][OptionValue(false)]\n  public bool GroupThreads { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool UseThreadColors { get; set; }\n\n  public (Brush Margin, Brush Samples)\n    GetThreadBackgroundColors(ProfileThread threadInfo, int threadId) {\n    if (!UseThreadColors) {\n      return (Brushes.WhiteSmoke, Brushes.LightSkyBlue);\n    }\n\n    // Set thread color based on name, if available,\n    // otherwise on the thread ID. The picked color is stable\n    // between different sessions loading the same trace.\n    uint colorIndex = 0;\n\n    if (threadInfo != null && threadInfo.HasName) {\n      colorIndex = (uint)threadInfo.Name.GetStableHashCode();\n    }\n    else {\n      colorIndex = (uint)threadId;\n    }\n\n    return (ColorBrushes.GetBrush(ColorUtils.GenerateLightPastelColor(colorIndex)),\n            ColorBrushes.GetBrush(ColorUtils.GeneratePastelColor(colorIndex)));\n  }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n    CallStackPopupDuration = DefaultCallStackPopupDuration;\n  }\n\n  public TimelineSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<TimelineSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/UIDiffSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.ComponentModel;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class UIDiffSettings : DiffSettings {\n  [ProtoMember(14)][OptionValue(\"#FFF6D9\")]\n  public Color ModificationColor { get; set; }\n  [ProtoMember(15)][OptionValue(\"#ff6f00\")]\n  public Color ModificationBorderColor { get; set; }\n  [ProtoMember(16)][OptionValue(\"#E2F0D3\")]\n  public Color InsertionColor { get; set; }\n  [ProtoMember(17)][OptionValue(\"#7FA72E\")]\n  public Color InsertionBorderColor { get; set; }\n  [ProtoMember(18)][OptionValue(\"#FFE8EA\")]\n  public Color DeletionColor { get; set; }\n  [ProtoMember(19)][OptionValue(\"#B33232\")]\n  public Color DeletionBorderColor { get; set; }\n  [ProtoMember(20)][OptionValue(\"#E1E1E1\")]\n  public Color MinorModificationColor { get; set; }\n  [ProtoMember(21)][OptionValue(\"#8F8F8F\")]\n  public Color MinorModificationBorderColor { get; set; }\n  [ProtoMember(22)][OptionValue(\"#A9A9A9\")]\n  public Color PlaceholderBorderColor { get; set; }\n  \n\n  public UIDiffSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<UIDiffSettings>(serialized);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/UISectionSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI;\n\n[ProtoContract(SkipConstructor = true)]\npublic class UISectionSettings : SectionSettings {\n  public static readonly int DefaultCallStackPopupDuration = (int)HoverPreview.ExtraLongHoverDurationMs;\n\n  public UISectionSettings() {\n    Reset();\n  }\n\n  [ProtoMember(1)][OptionValue(true)]\n  public bool ColorizeSectionNames { get; set; }\n  [ProtoMember(2)][OptionValue(true)]\n  public bool MarkAnnotatedSections { get; set; }\n  [ProtoMember(3)][OptionValue(false)]\n  public bool MarkNoDiffSectionGroups { get; set; }\n  [ProtoMember(4)][OptionValue(true)]\n  public bool ShowSectionSeparators { get; set; }\n  [ProtoMember(5)][OptionValue(true)]\n  public bool UseNameIndentation { get; set; }\n  [ProtoMember(6)][OptionValue(4)]\n  public int IndentationAmount { get; set; }\n  [ProtoMember(10)][OptionValue(\"#007200\")]\n  public Color NewSectionColor { get; set; }\n  [ProtoMember(11)][OptionValue(\"#BB0025\")]\n  public Color MissingSectionColor { get; set; }\n  [ProtoMember(12)][OptionValue(\"#DE8000\")]\n  public Color ChangedSectionColor { get; set; }\n  [ProtoMember(13)][OptionValue(false)]\n  public bool FunctionSearchCaseSensitive { get; set; }\n  [ProtoMember(14)][OptionValue(false)]\n  public bool SectionSearchCaseSensitive { get; set; }\n  [ProtoMember(15)][OptionValue(true)]\n  public bool MarkSectionsIdenticalToPrevious { get; set; }\n  [ProtoMember(16)][OptionValue(true)]\n  public bool LowerIdenticalToPreviousOpacity { get; set; }\n  [ProtoMember(17)][OptionValue(true)]\n  public override bool ShowDemangledNames { get; set; }\n  [ProtoMember(18)][OptionValue(true)]\n  public bool DemangleOnlyNames { get; set; }\n  [ProtoMember(19)][OptionValue(true)]\n  public bool DemangleNoReturnType { get; set; }\n  [ProtoMember(20)][OptionValue(true)]\n  public bool DemangleNoSpecialKeywords { get; set; }\n  [ProtoMember(21)][OptionValue(false)]\n  public bool ComputeStatistics { get; set; }\n  [ProtoMember(22)][OptionValue(false)]\n  public bool IncludeCallGraphStatistics { get; set; }\n  [ProtoMember(23)][OptionValue(false)]\n  public bool SyncSourceFile { get; set; }\n  [ProtoMember(24)][OptionValue(true)]\n  public bool SyncSelection { get; set; }\n  [ProtoMember(25)][OptionValue(true)]\n  public bool ShowCallStackPopup { get; set; }\n  [ProtoMember(26)][OptionValue(0)]\n  public int CallStackPopupDuration { get; set; }\n  [ProtoMember(28)][OptionValue(true)]\n  public bool ShowPerformanceCounterColumns { get; set; }\n  [ProtoMember(29)][OptionValue(true)]\n  public bool ShowPerformanceMetricColumns { get; set; }\n  [ProtoMember(30)][OptionValue(true)]\n  public bool AppendTimeToTotalColumn { get; set; }\n  [ProtoMember(31)][OptionValue(true)]\n  public bool AppendTimeToSelfColumn { get; set; }\n  [ProtoMember(32)][OptionValue(true)]\n  public bool ShowModulePanel { get; set; }\n  [ProtoMember(33)][OptionValue(true)]\n  public bool AlternateListRows { get; set; }\n  [ProtoMember(34)][OptionValue(false)]\n  public bool ShowMangleNamesColumn { get; set; }\n  [ProtoMember(35)][OptionValue()]\n  public ColumnSettings FunctionListColumns { get; set; }\n  [ProtoMember(36)][OptionValue()]\n  public ColumnSettings SectionListColumns { get; set; }\n  [ProtoMember(37)][OptionValue()]\n  public ColumnSettings ModuleListColumns { get; set; }\n\n  public override FunctionNameDemanglingOptions DemanglingOptions {\n    get {\n      var options = FunctionNameDemanglingOptions.Default;\n\n      if (DemangleOnlyNames) {\n        options |= FunctionNameDemanglingOptions.OnlyName;\n      }\n\n      if (DemangleNoReturnType) {\n        options |= FunctionNameDemanglingOptions.NoReturnType;\n      }\n\n      if (DemangleNoSpecialKeywords) {\n        options |= FunctionNameDemanglingOptions.NoSpecialKeywords;\n      }\n\n      return options;\n    }\n  }\n\n  public bool HasFunctionListChanges(UISectionSettings other) {\n    return ShowDemangledNames != other.ShowDemangledNames ||\n           DemangleOnlyNames != other.DemangleOnlyNames ||\n           DemangleNoReturnType != other.DemangleNoReturnType ||\n           DemangleNoSpecialKeywords != other.DemangleNoSpecialKeywords ||\n           ShowPerformanceCounterColumns != other.ShowPerformanceCounterColumns ||\n           ShowPerformanceMetricColumns != other.ShowPerformanceMetricColumns ||\n           AppendTimeToTotalColumn != other.AppendTimeToTotalColumn ||\n           AppendTimeToSelfColumn != other.AppendTimeToSelfColumn ||\n           ShowMangleNamesColumn != other.ShowMangleNamesColumn;\n  }\n\n  public override void Reset() {\n    ResetAllOptions(this);\n    CallStackPopupDuration = DefaultCallStackPopupDuration;\n  }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    InitializeReferenceOptions(this);\n  }\n\n  public override UISectionSettings Clone() {\n    byte[] serialized = UIStateSerializer.Serialize(this);\n    return UIStateSerializer.Deserialize<UISectionSettings>(serialized);\n  }\n\n  public override bool Equals(object obj) {\n    return AreOptionsEqual(this, obj);\n  }\n\n  public override string ToString() {\n    return PrintOptions(this);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/UISettingsProvider.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Settings;\n\nnamespace ProfileExplorer.UI.Settings;\n\n/// <summary>\n/// Settings provider that delegates to the UI application's settings.\n/// </summary>\npublic class UISettingsProvider : ISettingsProvider\n{\n    public SymbolFileSourceSettings SymbolSettings => App.Settings.SymbolSettings;\n    public ProfileDataProviderOptions ProfileOptions => App.Settings.ProfileOptions;\n    ProfileExplorer.Core.Settings.SectionSettings ISettingsProvider.SectionSettings => App.Settings.SectionSettings;\n    public DiffSettings DiffSettings => App.Settings.DiffSettings;\n    ProfileExplorer.Core.Settings.GeneralSettings ISettingsProvider.GeneralSettings => \n        App.Settings.GeneralSettings as ProfileExplorer.Core.Settings.GeneralSettings ?? \n        new ProfileExplorer.Core.Settings.GeneralSettings();\n}\n"
  },
  {
    "path": "src/ProfileExplorerUI/Settings/WorkspaceSettings.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing ProfileExplorer.Core.Settings;\nusing ProtoBuf;\n\nnamespace ProfileExplorer.UI.Settings;\n\n[ProtoContract(SkipConstructor = true)]\npublic class Workspace : IEquatable<Workspace> {\n  public Workspace() { }\n  [ProtoMember(1)]\n  public string Name { get; set; }\n  [ProtoMember(2)]\n  public string Description { get; set; }\n  [ProtoMember(3)]\n  public string FilePath { get; set; }\n  [ProtoMember(4)]\n  public int Order { get; set; }\n  public bool IsNew { get; set; }\n\n  public bool Equals(Workspace other) {\n    if (ReferenceEquals(null, other))\n      return false;\n    if (ReferenceEquals(this, other))\n      return true;\n    return Name == other.Name ||\n           Utils.TryGetFileName(FilePath) == Utils.TryGetFileName(other.FilePath);\n  }\n\n  public override bool Equals(object obj) {\n    if (ReferenceEquals(null, obj))\n      return false;\n    if (ReferenceEquals(this, obj))\n      return true;\n    if (obj.GetType() != GetType())\n      return false;\n    return Equals((Workspace)obj);\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Name, FilePath);\n  }\n\n  public static bool operator ==(Workspace left, Workspace right) {\n    return Equals(left, right);\n  }\n\n  public static bool operator !=(Workspace left, Workspace right) {\n    return !Equals(left, right);\n  }\n\n  public override string ToString() {\n    return Name;\n  }\n}\n\n[ProtoContract(SkipConstructor = true)]\npublic class WorkspaceSettings {\n  private static readonly string SettingsFileName = \"settings.proto\";\n  private static readonly string DefaultWorkspaceName = \"Default\";\n\n  public WorkspaceSettings() {\n    InitializeReferenceMembers();\n    RestoreDefaultWorkspaces();\n  }\n\n  [ProtoMember(1)][OptionValue()]\n  public List<Workspace> Workspaces { get; set; }\n  [ProtoMember(2)][OptionValue()]\n  public Workspace ActiveWorkspace { get; set; }\n  [ProtoMember(3)][OptionValue()]\n  public Dictionary<string, Workspace> CompilerDefaultWorkspace { get; set; }\n\n  [ProtoAfterDeserialization]\n  private void InitializeReferenceMembers() {\n    Workspaces ??= new List<Workspace>();\n    CompilerDefaultWorkspace ??= new Dictionary<string, Workspace>();\n\n    // Sync settings with files on disk.\n    CleanupWorkspaces();\n    LoadFromDirectory(App.GetWorkspacesPath(), out _);\n  }\n\n  public string GetBuiltinWorkspaceName(string compiler) {\n    return compiler switch {\n      \"ASM\" => \"Profiling\",\n      _     => \"Profiling\"\n    };\n  }\n\n  public bool RestoreDefaultWorkspaces() {\n    if (!LoadFromDirectory(App.GetInternalWorkspacesPath(), out _)) {\n      return false;\n    }\n\n    string wsName = GetBuiltinWorkspaceName(\"\");\n    ActiveWorkspace = Workspaces.FirstOrDefault(w => w.Name == wsName);\n    SortWorkspaces();\n    RenumberWorkspaces();\n    return true;\n  }\n\n  public bool RestoreDefaultActiveWorkspace() {\n    if (!HasValidActiveWorkspace()) {\n      string wsName = GetBuiltinWorkspaceName(App.Settings.DefaultCompilerIR);\n      var defaultWs = Workspaces.FirstOrDefault(w => w.Name == wsName);\n\n      if (defaultWs == null) {\n        defaultWs = CreateWorkspace(DefaultWorkspaceName);\n      }\n\n      ActiveWorkspace = defaultWs;\n      return true;\n    }\n\n    return false;\n  }\n\n  private bool HasValidActiveWorkspace() {\n    return ActiveWorkspace != null && File.Exists(ActiveWorkspace.FilePath);\n  }\n\n  public bool RenumberWorkspaces() {\n    int order = 0;\n\n    foreach (var ws in Workspaces) {\n      ws.Order = order++;\n    }\n\n    return true;\n  }\n\n  public void SaveWorkspaces() {\n    // Try to rename the on-disk file to match the workspace name.\n    foreach (var ws in Workspaces) {\n      ws.IsNew = false;\n      string fileName = Utils.TryGetFileNameWithoutExtension(ws.FilePath);\n\n      if (fileName != ws.Name) {\n        string newFilePath = Path.Combine(App.GetWorkspacesPath(), $\"{ws.Name}.xml\");\n\n        try {\n          File.Move(ws.FilePath, newFilePath);\n          ws.FilePath = newFilePath;\n        }\n        catch (Exception ex) {\n          Trace.WriteLine($\"Failed to rename workspace file {ws.FilePath} to {newFilePath}: {ex.Message}\");\n        }\n      }\n    }\n  }\n\n  public Workspace CreateWorkspace(string name) {\n    var existing = Workspaces.FirstOrDefault(w => w.Name == name);\n\n    if (existing != null) {\n      return existing;\n    }\n\n    string fileName = $\"{Guid.NewGuid()}.xml\";\n    var ws = new Workspace {\n      Name = name,\n      FilePath = Path.Combine(App.GetWorkspacesPath(), fileName),\n      Order = Workspaces.Count,\n      IsNew = true\n    };\n\n    Workspaces.Add(ws);\n    return ws;\n  }\n\n  public Workspace CreateNewActiveWorkspace() {\n    var ws = CreateWorkspace(DefaultWorkspaceName);\n    ActiveWorkspace = ws;\n    return ws;\n  }\n\n  public void RemoveWorkspace(Workspace ws) {\n    if (Workspaces.Remove(ws)) {\n      if (ws == ActiveWorkspace) {\n        ActiveWorkspace = null;\n\n        if (Workspaces.Count > 0) {\n          ActiveWorkspace = Workspaces[0];\n        }\n      }\n\n      try {\n        File.Delete(ws.FilePath);\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to remove workspace file {ws.FilePath}\", ex.Message);\n      }\n\n      RenumberWorkspaces();\n    }\n  }\n\n  private void CleanupWorkspaces() {\n    // Remove any workspaces that don't have a file.\n    try {\n      if (Workspaces.RemoveAll(w => !File.Exists(w.FilePath)) > 0) {\n        RenumberWorkspaces();\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to cleanup workspaces: {ex.Message}\");\n    }\n  }\n\n  public bool HasWorkspace(string name) {\n    return Workspaces.Any(w => w.Name == name);\n  }\n\n  private void SortWorkspaces() {\n    Workspaces = Workspaces.OrderBy(w => w.Order).ToList();\n  }\n\n  private bool LoadFromDirectory(string path, out int loadedCount) {\n    try {\n      string workspacesPath = App.GetWorkspacesPath();\n      App.CreateDirectories(workspacesPath);\n      string[] files = Directory.GetFiles(path, \"*.xml\");\n      int order = Workspaces.Count;\n      loadedCount = 0;\n\n      foreach (string file in files) {\n        var ws = new Workspace {\n          FilePath = file,\n          Name = Path.GetFileNameWithoutExtension(file)\n        };\n\n        if (!Workspaces.Contains(ws)) {\n          ws.Order = order++;\n          Workspaces.Add(ws);\n          loadedCount++;\n\n          string destFile = Path.Combine(workspacesPath, Path.GetFileName(file));\n\n          if (destFile != file) {\n            File.Copy(file, destFile, true);\n          }\n        }\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to load workspaces from directory {ex.Message}\");\n      loadedCount = 0;\n      return false;\n    }\n  }\n\n  private bool CopyToDirectory(string path) {\n    try {\n      foreach (var ws in Workspaces) {\n        string filePath = Path.Combine(path, Path.GetFileName(ws.FilePath));\n        File.Copy(ws.FilePath, filePath, true);\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to save workspaces to directory {ex.Message}\");\n      return false;\n    }\n  }\n\n  private bool SerializeWorkspaceSettings(string filePath) {\n    try {\n      using var file = File.Create(filePath);\n      Serializer.Serialize(file, this);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to save workspace settings {ex.Message}\");\n      return false;\n    }\n  }\n\n  private static WorkspaceSettings DeserializeWorkspaceSettings(string filePath) {\n    try {\n      using var file = File.OpenRead(filePath);\n      return Serializer.Deserialize<WorkspaceSettings>(file);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to load workspace settings {ex.Message}\");\n      return null;\n    }\n  }\n\n  public static WorkspaceSettings LoadFromArchive(string filePath, out int loadedCount) {\n    try {\n      if (File.Exists(filePath)) {\n        File.Delete(filePath);\n      }\n\n      var tempPath = Directory.CreateTempSubdirectory(\"pex\");\n      ZipFile.ExtractToDirectory(filePath, tempPath.FullName, true);\n      var settings = DeserializeWorkspaceSettings(Path.Combine(tempPath.FullName, SettingsFileName));\n      settings.LoadFromDirectory(tempPath.FullName, out loadedCount);\n      return settings;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to load workspaces from Zip {ex.Message}\");\n      loadedCount = 0;\n      return null;\n    }\n  }\n\n  public bool SaveToArchive(string filePath) {\n    try {\n      var tempPath = Directory.CreateTempSubdirectory(\"pex\");\n      CopyToDirectory(tempPath.FullName);\n      SerializeWorkspaceSettings(Path.Combine(tempPath.FullName, SettingsFileName));\n\n      if (File.Exists(filePath)) {\n        File.Delete(filePath);\n      }\n\n      ZipFile.CreateFromDirectory(tempPath.FullName, filePath, CompressionLevel.Optimal, false);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to save workspaces to Zip {ex.Message}\");\n      return false;\n    }\n  }\n\n  public override string ToString() {\n    return $\"Workspaces: {Workspaces.Count}, ActiveWorkspace: {ActiveWorkspace}\";\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Styles.xaml",
    "content": "﻿<ResourceDictionary\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:sys=\"clr-namespace:System;assembly=mscorlib\">\n\n  <!--  Hide ToolTips bound to a null or empty string  -->\n  <Style TargetType=\"ToolTip\">\n    <Style.Triggers>\n      <Trigger Property=\"Content\" Value=\"{x:Static sys:String.Empty}\">\n        <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n      </Trigger>\n      <Trigger Property=\"Content\" Value=\"{x:Null}\">\n        <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n      </Trigger>\n    </Style.Triggers>\n  </Style>\n\n  <Style\n    x:Key=\"DisabledImageStyle\"\n    TargetType=\"Image\">\n    <Style.Triggers>\n      <Trigger Property=\"IsEnabled\" Value=\"False\">\n        <Setter Property=\"Opacity\" Value=\"0.5\" />\n      </Trigger>\n    </Style.Triggers>\n  </Style>\n\n  <Style\n    x:Key=\"ListViewHeaderStyle\"\n    TargetType=\"{x:Type GridViewColumnHeader}\">\n    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n  </Style>\n\n  <Style\n    x:Key=\"HoverUnderlineStyle\"\n    TargetType=\"TextBlock\">\n    <Style.Triggers>\n      <Trigger Property=\"IsMouseOver\" Value=\"True\">\n        <Setter Property=\"TextBlock.TextDecorations\" Value=\"Underline\" />\n        <Setter Property=\"TextBlock.Foreground\" Value=\"DarkBlue\" />\n      </Trigger>\n    </Style.Triggers>\n  </Style>\n\n  <SolidColorBrush\n    x:Key=\"SelectedBackgroundBrush\"\n    Color=\"#FFB1D6F1\" />\n  <SolidColorBrush\n    x:Key=\"DisabledForegroundBrush\"\n    Color=\"#888\" />\n\n  <Style\n    x:Key=\"FlatListViewItem\"\n    TargetType=\"ListViewItem\">\n    <Setter Property=\"OverridesDefaultStyle\" Value=\"true\" />\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"ListBoxItem\">\n          <Border\n            Name=\"Border\"\n            Padding=\"1\"\n            Background=\"{TemplateBinding Background}\"\n            BorderBrush=\"{TemplateBinding BorderBrush}\"\n            BorderThickness=\"{TemplateBinding BorderThickness}\"\n            ToolTip=\"{TemplateBinding ToolTip}\">\n            <GridViewRowPresenter\n              HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n              VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\" />\n          </Border>\n          <ControlTemplate.Triggers>\n            <Trigger Property=\"IsSelected\" Value=\"true\">\n              <Setter TargetName=\"Border\" Property=\"Background\" Value=\"{StaticResource SelectedBackgroundBrush}\" />\n            </Trigger>\n            <Trigger Property=\"IsEnabled\" Value=\"false\">\n              <Setter Property=\"Foreground\" Value=\"{StaticResource DisabledForegroundBrush}\" />\n            </Trigger>\n\n            <MultiTrigger>\n              <MultiTrigger.Conditions>\n                <Condition Property=\"IsMouseOver\" Value=\"true\" />\n                <Condition Property=\"IsSelected\" Value=\"false\" />\n              </MultiTrigger.Conditions>\n              <Setter TargetName=\"Border\" Property=\"Background\" Value=\"#D0E3F1\" />\n            </MultiTrigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n\n  <Style\n    x:Key=\"TreeListViewItem\"\n    TargetType=\"ListViewItem\">\n    <Setter Property=\"OverridesDefaultStyle\" Value=\"true\" />\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"ListBoxItem\">\n          <Border\n            Name=\"Border\"\n            Padding=\"0\"\n            Background=\"{TemplateBinding Background}\"\n            BorderBrush=\"{TemplateBinding BorderBrush}\"\n            BorderThickness=\"{TemplateBinding BorderThickness}\"\n            ToolTip=\"{TemplateBinding ToolTip}\">\n            <GridViewRowPresenter\n              HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n              VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\" />\n          </Border>\n          <ControlTemplate.Triggers>\n            <Trigger Property=\"IsSelected\" Value=\"true\">\n              <Setter TargetName=\"Border\" Property=\"Background\" Value=\"{StaticResource SelectedBackgroundBrush}\" />\n            </Trigger>\n            <Trigger Property=\"IsEnabled\" Value=\"false\">\n              <Setter Property=\"Foreground\" Value=\"{StaticResource DisabledForegroundBrush}\" />\n            </Trigger>\n\n            <MultiTrigger>\n              <MultiTrigger.Conditions>\n                <Condition Property=\"IsMouseOver\" Value=\"true\" />\n                <Condition Property=\"IsSelected\" Value=\"false\" />\n              </MultiTrigger.Conditions>\n              <Setter TargetName=\"Border\" Property=\"Background\" Value=\"#D0E3F1\" />\n            </MultiTrigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <Style\n    x:Key=\"SimpleListViewItem\"\n    TargetType=\"ListViewItem\">\n    <Setter Property=\"OverridesDefaultStyle\" Value=\"true\" />\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"ListBoxItem\">\n          <Border\n            Name=\"Border\"\n            Padding=\"0\"\n            Background=\"{TemplateBinding Background}\"\n            BorderBrush=\"{TemplateBinding BorderBrush}\"\n            BorderThickness=\"{TemplateBinding BorderThickness}\">\n            <GridViewRowPresenter\n              HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n              VerticalAlignment=\"{TemplateBinding VerticalContentAlignment}\" />\n          </Border>\n\n          <ControlTemplate.Triggers>\n            <Trigger Property=\"IsSelected\" Value=\"true\">\n              <Setter TargetName=\"Border\" Property=\"Background\" Value=\"LightGray\" />\n            </Trigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <ContextMenu x:Key=\"PopupContextMenu\">\n    <MenuItem\n      Header=\"Always on Top\"\n      IsCheckable=\"True\"\n      IsChecked=\"{Binding Path=IsAlwaysOnTop}\">\n      <MenuItem.Icon>\n        <Image\n          Width=\"16\"\n          Height=\"16\"\n          Source=\"{StaticResource PinIcon}\" />\n      </MenuItem.Icon>\n    </MenuItem>\n    <Separator />\n\n    <MenuItem>\n      <MenuItem.Header>\n        <local:ColorSelector ColorSelectedCommand=\"{Binding PopupColorSelectedCommand}\" />\n      </MenuItem.Header>\n    </MenuItem>\n  </ContextMenu>\n\n  <ContextMenu x:Key=\"GraphContextMenu\">\n    <!-- <MenuItem -->\n    <!--   Focusable=\"False\" -->\n    <!--   Header=\"Mark Block\" -->\n    <!--   IsHitTestVisible=\"False\" /> -->\n    <!-- <MenuItem> -->\n    <!--   <MenuItem.Header> -->\n    <!--     <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkBlock\" /> -->\n    <!--   </MenuItem.Header> -->\n    <!-- </MenuItem> -->\n    <!-- <Separator /> -->\n    <!-- <MenuItem Header=\"Mark Predecessors\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkPredecessors\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <MenuItem Header=\"Mark Successors\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkSuccessors\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <MenuItem -->\n    <!--   Header=\"Mark Node Group\" -->\n    <!--   ToolTip=\"Mark block and all its predecessors and succesors\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkGroup\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <Separator /> -->\n    <!-- -->\n    <!-- <MenuItem -->\n    <!--   Header=\"Mark Dominators\" -->\n    <!--   ToolTip=\"Mark all the blocks that dominate it\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkDominators\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <MenuItem -->\n    <!--   Header=\"Mark Post-Dominators\" -->\n    <!--   ToolTip=\"Mark all the blocks that post-dominate it\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkPostDominators\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <MenuItem -->\n    <!--   Header=\"Mark Dominance Frontier\" -->\n    <!--   ToolTip=\"Mark all the blocks in its dominance frontier\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkDominanceFrontier\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <MenuItem -->\n    <!--   Header=\"Mark Post-Dominance Frontier\" -->\n    <!--   ToolTip=\"Mark all the blocks in its post-dominance frontier\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkPostDominanceFrontier\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <Separator /> -->\n\n    <!-- <MenuItem Header=\"Mark Loop\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector -->\n    <!--         ColorSelectedCommand=\"local:GraphCommand.MarkLoop\" -->\n    <!--         CommandTarget=\"{Binding ElementName=GraphHost}\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- -->\n    <!-- <MenuItem Header=\"Mark Loop Nest\"> -->\n    <!--   <MenuItem> -->\n    <!--     <MenuItem.Header> -->\n    <!--       <local:ColorSelector ColorSelectedCommand=\"local:GraphCommand.MarkLoopNest\" /> -->\n    <!--     </MenuItem.Header> -->\n    <!--   </MenuItem> -->\n    <!-- </MenuItem> -->\n    <!-- <Separator /> -->\n\n    <MenuItem Header=\"Query\">\n      <MenuItem\n        Command=\"local:GraphCommand.SelectQueryBlock1\"\n        CommandTarget=\"{Binding ElementName=GraphHost}\"\n        Header=\"Select Block A\"\n        InputGestureText=\"Click + Ctrl/Alt + A/1\" />\n\n      <MenuItem\n        Command=\"local:GraphCommand.SelectQueryBlock2\"\n        CommandTarget=\"{Binding ElementName=GraphHost}\"\n        Header=\"Select Block B\"\n        InputGestureText=\"Click + Ctrl/Alt + B/2\" />\n\n    </MenuItem>\n\n    <!-- <MenuItem Header=\"Clear\"> -->\n    <!--   <MenuItem.Icon> -->\n    <!--     <Image -->\n    <!--       Width=\"16\" -->\n    <!--       Height=\"16\" -->\n    <!--       Source=\"{StaticResource RemoveIcon}\" /> -->\n    <!--   </MenuItem.Icon> -->\n    <!--   <MenuItem -->\n    <!--     Command=\"local:GraphCommand.ClearMarked\" -->\n    <!--     CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--     Header=\"Selected Marker\" /> -->\n    <!--   <MenuItem -->\n    <!--     Command=\"local:GraphCommand.ClearAllMarked\" -->\n    <!--     CommandTarget=\"{Binding ElementName=GraphHost}\" -->\n    <!--     Header=\"All Markers\" /> -->\n    <!-- </MenuItem> -->\n  </ContextMenu>\n\n  <Style\n    x:Key=\"RemarkTreeViewItemStyle\"\n    TargetType=\"{x:Type TreeViewItem}\">\n    <Style.Resources>\n      <SolidColorBrush\n        x:Key=\"{x:Static SystemColors.HighlightBrushKey}\"\n        Color=\"#FFB1D6F1\" />\n      <SolidColorBrush\n        x:Key=\"{x:Static SystemColors.InactiveSelectionHighlightBrushKey}\"\n        Color=\"#FFB1D6F1\" />\n      <SolidColorBrush\n        x:Key=\"{x:Static SystemColors.HighlightTextBrushKey}\"\n        Color=\"Black\" />\n      <SolidColorBrush\n        x:Key=\"GlyphBrush\"\n        Color=\"#444\" />\n\n      <Style x:Key=\"TreeViewItemFocusVisual\">\n        <Setter Property=\"Control.Template\">\n          <Setter.Value>\n            <ControlTemplate>\n              <Rectangle\n                Margin=\"0,0,0,0\"\n                Opacity=\"0\"\n                Stroke=\"Black\"\n                StrokeDashArray=\"1 2\"\n                StrokeThickness=\"5\" />\n            </ControlTemplate>\n          </Setter.Value>\n        </Setter>\n      </Style>\n\n      <Style\n        x:Key=\"ExpandCollapseToggleStyle\"\n        TargetType=\"ToggleButton\">\n        <Setter Property=\"Template\">\n          <Setter.Value>\n            <ControlTemplate TargetType=\"ToggleButton\">\n              <Grid\n                Width=\"15\"\n                Height=\"13\"\n                Background=\"Transparent\">\n                <Path\n                  x:Name=\"ExpandPath\"\n                  Margin=\"1,1,1,1\"\n                  HorizontalAlignment=\"Left\"\n                  VerticalAlignment=\"Center\"\n                  Data=\"M 4 0 L 8 4 L 4 8 Z\"\n                  Fill=\"{StaticResource GlyphBrush}\" />\n              </Grid>\n              <ControlTemplate.Triggers>\n                <Trigger Property=\"IsChecked\" Value=\"True\">\n                  <Setter TargetName=\"ExpandPath\" Property=\"Data\" Value=\"M 0 4 L 8 4 L 4 8 Z\" />\n                </Trigger>\n              </ControlTemplate.Triggers>\n            </ControlTemplate>\n          </Setter.Value>\n        </Setter>\n      </Style>\n    </Style.Resources>\n\n    <Setter Property=\"Background\" Value=\"Transparent\" />\n    <Setter Property=\"HorizontalContentAlignment\"\n            Value=\"{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}\" />\n    <Setter Property=\"VerticalContentAlignment\"\n            Value=\"{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}\" />\n    <Setter Property=\"Padding\" Value=\"1,0,0,0\" />\n    <Setter Property=\"Foreground\" Value=\"{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}\" />\n    <Setter Property=\"FocusVisualStyle\" Value=\"{StaticResource TreeViewItemFocusVisual}\" />\n\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"{x:Type TreeViewItem}\">\n          <Grid SnapsToDevicePixels=\"true\">\n            <Grid.ColumnDefinitions>\n              <ColumnDefinition\n                Width=\"Auto\"\n                MinWidth=\"19\" />\n              <ColumnDefinition Width=\"Auto\" />\n              <ColumnDefinition Width=\"*\" />\n            </Grid.ColumnDefinitions>\n            <Grid.RowDefinitions>\n              <RowDefinition Height=\"Auto\" />\n              <RowDefinition />\n            </Grid.RowDefinitions>\n            <Rectangle\n              x:Name=\"VerLn\"\n              Grid.RowSpan=\"2\"\n              Width=\"1\"\n              Margin=\"0,0,0,0\"\n              Stroke=\"#66888888\"\n              StrokeThickness=\"1\" />\n\n            <ToggleButton\n              x:Name=\"Expander\"\n              Margin=\"5,-5,0,0\"\n              Panel.ZIndex=\"2\"\n              ClickMode=\"Press\"\n              IsChecked=\"{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}\"\n              Style=\"{StaticResource ExpandCollapseToggleStyle}\" />\n            <Border\n              x:Name=\"Bd\"\n              Grid.Column=\"1\"\n              Grid.ColumnSpan=\"2\"\n              Margin=\"-10,0,0,0\"\n              Padding=\"{TemplateBinding Padding}\"\n              Background=\"{TemplateBinding Background}\"\n              BorderBrush=\"{TemplateBinding BorderBrush}\"\n              BorderThickness=\"{TemplateBinding BorderThickness}\">\n              <Grid>\n                <Grid.RowDefinitions>\n                  <RowDefinition Height=\"*\" />\n                  <RowDefinition Height=\"4\" />\n                </Grid.RowDefinitions>\n                <ContentPresenter\n                  x:Name=\"PART_Header\"\n                  Grid.Row=\"0\"\n                  Margin=\"8,2,0,0\"\n                  HorizontalAlignment=\"{TemplateBinding HorizontalContentAlignment}\"\n                  ContentSource=\"Header\"\n                  SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\" />\n\n                <Rectangle\n                  Grid.Row=\"1\"\n                  Height=\"1\"\n                  VerticalAlignment=\"Bottom\"\n                  Stroke=\"#66888888\"\n                  StrokeThickness=\"1\" />\n              </Grid>\n            </Border>\n            <ItemsPresenter\n              x:Name=\"ItemsHost\"\n              Grid.Row=\"1\"\n              Grid.Column=\"1\"\n              Grid.ColumnSpan=\"2\" />\n\n\n          </Grid>\n          <ControlTemplate.Triggers>\n            <DataTrigger\n              Binding=\"{Binding RelativeSource={RelativeSource Self}, Converter={StaticResource LineConverter}}\"\n              Value=\"true\">\n              <Setter TargetName=\"VerLn\" Property=\"VerticalAlignment\" Value=\"Stretch\" />\n            </DataTrigger>\n            <Trigger Property=\"IsExpanded\" Value=\"false\">\n              <Setter TargetName=\"ItemsHost\" Property=\"Visibility\" Value=\"Collapsed\" />\n            </Trigger>\n            <Trigger Property=\"HasItems\" Value=\"false\">\n              <Setter TargetName=\"Expander\" Property=\"Visibility\" Value=\"Hidden\" />\n            </Trigger>\n            <MultiTrigger>\n              <MultiTrigger.Conditions>\n                <Condition Property=\"HasHeader\" Value=\"false\" />\n                <Condition Property=\"Width\" Value=\"Auto\" />\n              </MultiTrigger.Conditions>\n              <Setter TargetName=\"PART_Header\" Property=\"MinWidth\" Value=\"75\" />\n            </MultiTrigger>\n            <MultiTrigger>\n              <MultiTrigger.Conditions>\n                <Condition Property=\"HasHeader\" Value=\"false\" />\n                <Condition Property=\"Height\" Value=\"Auto\" />\n              </MultiTrigger.Conditions>\n              <Setter TargetName=\"PART_Header\" Property=\"MinHeight\" Value=\"19\" />\n            </MultiTrigger>\n            <Trigger Property=\"IsSelected\" Value=\"true\">\n              <Setter TargetName=\"Bd\" Property=\"Background\"\n                      Value=\"{DynamicResource {x:Static SystemColors.HighlightBrushKey}}\" />\n              <Setter Property=\"Foreground\" Value=\"{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}\" />\n            </Trigger>\n            <MultiTrigger>\n              <MultiTrigger.Conditions>\n                <Condition Property=\"IsSelected\" Value=\"true\" />\n                <Condition Property=\"IsSelectionActive\" Value=\"false\" />\n              </MultiTrigger.Conditions>\n              <Setter TargetName=\"Bd\" Property=\"Background\"\n                      Value=\"{DynamicResource {x:Static SystemColors.HighlightBrushKey}}\" />\n              <Setter Property=\"Foreground\" Value=\"{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}\" />\n            </MultiTrigger>\n            <Trigger Property=\"IsEnabled\" Value=\"false\">\n              <Setter Property=\"Foreground\" Value=\"{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}\" />\n            </Trigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <Style\n    x:Key=\"TabControlStyle\"\n    TargetType=\"TabItem\">\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"TabItem\">\n          <StackPanel Name=\"Panel\">\n            <ContentPresenter\n              x:Name=\"ContentSite\"\n              Margin=\"4,2\"\n              HorizontalAlignment=\"Center\"\n              VerticalAlignment=\"Center\"\n              ContentSource=\"Header\"\n              TextBlock.FontSize=\"12.5\"\n              TextBlock.FontWeight=\"SemiBold\" />\n            <Rectangle\n              Name=\"SelectedLine\"\n              Height=\"2\"\n              Margin=\"4,0,4,0\"\n              HorizontalAlignment=\"Stretch\"\n              Fill=\"DimGray\"\n              Stroke=\"DimGray\" />\n          </StackPanel>\n          <ControlTemplate.Triggers>\n            <Trigger Property=\"IsSelected\" Value=\"True\">\n              <Setter TargetName=\"SelectedLine\" Property=\"Visibility\" Value=\"Visible\" />\n            </Trigger>\n            <Trigger Property=\"IsSelected\" Value=\"False\">\n              <Setter TargetName=\"SelectedLine\" Property=\"Visibility\" Value=\"Hidden\" />\n            </Trigger>\n            <Trigger Property=\"IsMouseOver\" Value=\"True\">\n              <Setter TargetName=\"SelectedLine\" Property=\"Visibility\" Value=\"Visible\" />\n            </Trigger>\n            <Trigger Property=\"IsEnabled\" Value=\"False\">\n              <Setter TargetName=\"ContentSite\" Property=\"TextBlock.Foreground\"\n                      Value=\"{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}\" />\n            </Trigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <!--  MenuItem style that doesn't show a black box for a checked item like default one.  -->\n  <SolidColorBrush\n    x:Key=\"Menu.Background\"\n    Color=\"#FFEEF5FD\" />\n  <SolidColorBrush\n    x:Key=\"Menu.Static.Background\"\n    Color=\"#FFF0F0F0\" />\n  <SolidColorBrush\n    x:Key=\"Menu.Static.Border\"\n    Color=\"#FF999999\" />\n  <SolidColorBrush\n    x:Key=\"Menu.Static.Foreground\"\n    Color=\"#FF212121\" />\n  <SolidColorBrush\n    x:Key=\"Menu.Static.Separator\"\n    Color=\"#FFD7D7D7\" />\n  <SolidColorBrush\n    x:Key=\"Menu.Disabled.Foreground\"\n    Color=\"#FF707070\" />\n  <SolidColorBrush\n    x:Key=\"MenuItem.Selected.Background\"\n    Color=\"#3D26A0DA\" />\n  <SolidColorBrush\n    x:Key=\"MenuItem.Selected.Border\"\n    Color=\"#FF26A0DA\" />\n  <SolidColorBrush\n    x:Key=\"MenuItem.Highlight.Background\"\n    Color=\"#3D26A0DA\" />\n  <SolidColorBrush\n    x:Key=\"MenuItem.Highlight.Border\"\n    Color=\"#FF26A0DA\" />\n  <SolidColorBrush\n    x:Key=\"MenuItem.Highlight.Disabled.Background\"\n    Color=\"#0A000000\" />\n  <SolidColorBrush\n    x:Key=\"MenuItem.Highlight.Disabled.Border\"\n    Color=\"#21000000\" />\n  <Geometry x:Key=\"Checkmark\">F1 M 10.0,1.2 L 4.7,9.1 L 4.5,9.1 L 0,5.2 L 1.3,3.5 L 4.3,6.1L 8.3,0 L 10.0,1.2 Z</Geometry>\n  <Geometry x:Key=\"RightArrow\">M 0,0 L 4,3.5 L 0,7 Z</Geometry>\n\n  <Style\n    x:Key=\"SubMenuItemHeaderStyle2\"\n    TargetType=\"MenuItem\">\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"{x:Type MenuItem}\">\n          <Border\n            x:Name=\"templateRoot\"\n            Height=\"22\"\n            Background=\"{TemplateBinding Background}\"\n            BorderBrush=\"{TemplateBinding BorderBrush}\"\n            BorderThickness=\"{TemplateBinding BorderThickness}\"\n            SnapsToDevicePixels=\"true\">\n            <Grid Margin=\"-1\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition\n                  Width=\"Auto\"\n                  MinWidth=\"22\"\n                  SharedSizeGroup=\"MenuItemIconColumnGroup\" />\n                <ColumnDefinition Width=\"13\" />\n                <ColumnDefinition Width=\"*\" />\n                <ColumnDefinition Width=\"30\" />\n                <ColumnDefinition\n                  Width=\"Auto\"\n                  SharedSizeGroup=\"MenuItemIGTColumnGroup\" />\n                <ColumnDefinition Width=\"20\" />\n              </Grid.ColumnDefinitions>\n              <ContentPresenter\n                x:Name=\"Icon\"\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"3\"\n                HorizontalAlignment=\"Center\"\n                VerticalAlignment=\"Center\"\n                ContentSource=\"Icon\"\n                SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\" />\n              <Border\n                x:Name=\"GlyphPanel\"\n                Width=\"22\"\n                Height=\"22\"\n                Margin=\"-1,0,0,0\"\n                VerticalAlignment=\"Center\"\n                Background=\"{StaticResource MenuItem.Highlight.Background}\"\n                BorderBrush=\"{StaticResource MenuItem.Highlight.Border}\"\n                BorderThickness=\"1\"\n                Visibility=\"Hidden\">\n                <Path\n                  x:Name=\"Glyph\"\n                  Width=\"9\"\n                  Height=\"11\"\n                  Data=\"{DynamicResource Checkmark}\"\n                  Fill=\"{StaticResource Menu.Static.Foreground}\"\n                  FlowDirection=\"LeftToRight\" />\n              </Border>\n              <ContentPresenter\n                Grid.Column=\"2\"\n                Margin=\"{TemplateBinding Padding}\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                ContentSource=\"Header\"\n                RecognizesAccessKey=\"True\"\n                SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\" />\n              <TextBlock\n                Grid.Column=\"4\"\n                Margin=\"{TemplateBinding Padding}\"\n                VerticalAlignment=\"Center\"\n                Opacity=\"0.7\"\n                Text=\"{TemplateBinding InputGestureText}\" />\n              <Path\n                x:Name=\"RightArrow\"\n                Grid.Column=\"5\"\n                Margin=\"10,0,0,0\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                Data=\"{StaticResource RightArrow}\"\n                Fill=\"{StaticResource Menu.Static.Foreground}\" />\n              <Popup\n                x:Name=\"PART_Popup\"\n                AllowsTransparency=\"true\"\n                Focusable=\"false\"\n                HorizontalOffset=\"-2\"\n                IsOpen=\"{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}\"\n                Placement=\"Right\"\n                PopupAnimation=\"{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}\"\n                VerticalOffset=\"-3\">\n                <Border\n                  x:Name=\"SubMenuBorder\"\n                  Padding=\"2\"\n                  Background=\"{StaticResource Menu.Background}\"\n                  BorderBrush=\"{StaticResource Menu.Static.Border}\"\n                  BorderThickness=\"1\">\n                  <ScrollViewer\n                    x:Name=\"SubMenuScrollViewer\"\n                    Style=\"{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,\n                                                                  TypeInTargetAssembly={x:Type FrameworkElement}}}\">\n                    <Grid RenderOptions.ClearTypeHint=\"Enabled\">\n                      <Canvas\n                        Width=\"0\"\n                        Height=\"0\"\n                        HorizontalAlignment=\"Left\"\n                        VerticalAlignment=\"Top\">\n                        <Rectangle\n                          x:Name=\"OpaqueRect\"\n                          Width=\"{Binding ActualWidth, ElementName=SubMenuBorder}\"\n                          Height=\"{Binding ActualHeight, ElementName=SubMenuBorder}\"\n                          Fill=\"{Binding Background, ElementName=SubMenuBorder}\" />\n                      </Canvas>\n                      <Rectangle\n                        Width=\"1\"\n                        Margin=\"29,2,0,2\"\n                        HorizontalAlignment=\"Left\"\n                        Fill=\"{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}\" />\n                      <ItemsPresenter\n                        x:Name=\"ItemsPresenter\"\n                        Grid.IsSharedSizeScope=\"true\"\n                        KeyboardNavigation.DirectionalNavigation=\"Cycle\"\n                        KeyboardNavigation.TabNavigation=\"Cycle\"\n                        SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\" />\n                    </Grid>\n                  </ScrollViewer>\n                </Border>\n              </Popup>\n            </Grid>\n          </Border>\n          <ControlTemplate.Triggers>\n            <Trigger Property=\"IsSuspendingPopupAnimation\" Value=\"true\">\n              <Setter TargetName=\"PART_Popup\" Property=\"PopupAnimation\" Value=\"None\" />\n            </Trigger>\n            <Trigger Property=\"Icon\" Value=\"{x:Null}\">\n              <Setter TargetName=\"Icon\" Property=\"Visibility\" Value=\"Collapsed\" />\n            </Trigger>\n            <Trigger Property=\"IsChecked\" Value=\"True\">\n              <Setter TargetName=\"GlyphPanel\" Property=\"Visibility\" Value=\"Visible\" />\n              <Setter TargetName=\"Icon\" Property=\"Visibility\" Value=\"Collapsed\" />\n            </Trigger>\n            <Trigger Property=\"IsHighlighted\" Value=\"True\">\n              <Setter TargetName=\"templateRoot\" Property=\"Background\" Value=\"Transparent\" />\n              <Setter TargetName=\"templateRoot\" Property=\"BorderBrush\"\n                      Value=\"{StaticResource MenuItem.Highlight.Border}\" />\n            </Trigger>\n            <Trigger Property=\"IsEnabled\" Value=\"False\">\n              <Setter TargetName=\"templateRoot\" Property=\"TextElement.Foreground\"\n                      Value=\"{StaticResource Menu.Disabled.Foreground}\" />\n              <Setter TargetName=\"Glyph\" Property=\"Fill\" Value=\"{StaticResource Menu.Disabled.Foreground}\" />\n              <Setter TargetName=\"RightArrow\" Property=\"Fill\" Value=\"{StaticResource Menu.Disabled.Foreground}\" />\n            </Trigger>\n            <Trigger SourceName=\"SubMenuScrollViewer\" Property=\"ScrollViewer.CanContentScroll\" Value=\"false\">\n              <Setter TargetName=\"OpaqueRect\" Property=\"Canvas.Top\"\n                      Value=\"{Binding VerticalOffset, ElementName=SubMenuScrollViewer}\" />\n              <Setter TargetName=\"OpaqueRect\" Property=\"Canvas.Left\"\n                      Value=\"{Binding HorizontalOffset, ElementName=SubMenuScrollViewer}\" />\n            </Trigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <Style\n    x:Key=\"SubMenuItemHeaderStyle\"\n    TargetType=\"MenuItem\">\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"{x:Type MenuItem}\">\n          <Border\n            x:Name=\"templateRoot\"\n            Height=\"22\"\n            Background=\"{TemplateBinding Background}\"\n            BorderBrush=\"{TemplateBinding BorderBrush}\"\n            BorderThickness=\"{TemplateBinding BorderThickness}\"\n            SnapsToDevicePixels=\"true\">\n            <Grid Margin=\"-1\">\n              <Grid.ColumnDefinitions>\n                <ColumnDefinition\n                  Width=\"Auto\"\n                  MinWidth=\"22\"\n                  SharedSizeGroup=\"MenuItemIconColumnGroup\" />\n                <ColumnDefinition Width=\"13\" />\n                <ColumnDefinition Width=\"*\" />\n                <ColumnDefinition Width=\"30\" />\n                <ColumnDefinition\n                  Width=\"Auto\"\n                  SharedSizeGroup=\"MenuItemIGTColumnGroup\" />\n                <ColumnDefinition Width=\"20\" />\n              </Grid.ColumnDefinitions>\n              <ContentPresenter\n                x:Name=\"Icon\"\n                Width=\"16\"\n                Height=\"16\"\n                Margin=\"3\"\n                HorizontalAlignment=\"Center\"\n                VerticalAlignment=\"Center\"\n                ContentSource=\"Icon\"\n                SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\" />\n              <Border\n                x:Name=\"GlyphPanel\"\n                Width=\"22\"\n                Height=\"22\"\n                Margin=\"-1,0,0,0\"\n                HorizontalAlignment=\"Center\"\n                VerticalAlignment=\"Center\"\n                Background=\"{StaticResource MenuItem.Selected.Background}\"\n                BorderBrush=\"{StaticResource MenuItem.Selected.Border}\"\n                BorderThickness=\"1\"\n                ClipToBounds=\"False\"\n                Visibility=\"Hidden\">\n                <Path\n                  x:Name=\"Glyph\"\n                  Width=\"10\"\n                  Height=\"11\"\n                  Data=\"{StaticResource Checkmark}\"\n                  Fill=\"{StaticResource Menu.Static.Foreground}\"\n                  FlowDirection=\"LeftToRight\" />\n              </Border>\n              <ContentPresenter\n                x:Name=\"menuHeaderContainer\"\n                Grid.Column=\"2\"\n                Margin=\"{TemplateBinding Padding}\"\n                HorizontalAlignment=\"Left\"\n                VerticalAlignment=\"Center\"\n                ContentSource=\"Header\"\n                RecognizesAccessKey=\"True\"\n                SnapsToDevicePixels=\"{TemplateBinding SnapsToDevicePixels}\" />\n              <TextBlock\n                x:Name=\"menuGestureText\"\n                Grid.Column=\"4\"\n                Margin=\"{TemplateBinding Padding}\"\n                VerticalAlignment=\"Center\"\n                Opacity=\"0.7\"\n                Text=\"{TemplateBinding InputGestureText}\" />\n            </Grid>\n          </Border>\n          <ControlTemplate.Triggers>\n            <Trigger Property=\"Icon\" Value=\"{x:Null}\">\n              <Setter TargetName=\"Icon\" Property=\"Visibility\" Value=\"Collapsed\" />\n            </Trigger>\n            <Trigger Property=\"IsChecked\" Value=\"True\">\n              <Setter TargetName=\"GlyphPanel\" Property=\"Visibility\" Value=\"Visible\" />\n              <Setter TargetName=\"Icon\" Property=\"Visibility\" Value=\"Collapsed\" />\n            </Trigger>\n            <Trigger Property=\"IsHighlighted\" Value=\"True\">\n              <Setter TargetName=\"templateRoot\" Property=\"Background\"\n                      Value=\"{StaticResource MenuItem.Highlight.Background}\" />\n              <Setter TargetName=\"templateRoot\" Property=\"BorderBrush\"\n                      Value=\"{StaticResource MenuItem.Highlight.Border}\" />\n            </Trigger>\n            <Trigger Property=\"IsEnabled\" Value=\"False\">\n              <Setter TargetName=\"templateRoot\" Property=\"TextElement.Foreground\"\n                      Value=\"{StaticResource Menu.Disabled.Foreground}\" />\n              <Setter TargetName=\"Glyph\" Property=\"Fill\" Value=\"{StaticResource Menu.Disabled.Foreground}\" />\n            </Trigger>\n            <MultiTrigger>\n              <MultiTrigger.Conditions>\n                <Condition Property=\"IsHighlighted\" Value=\"True\" />\n                <Condition Property=\"IsEnabled\" Value=\"False\" />\n              </MultiTrigger.Conditions>\n              <Setter TargetName=\"templateRoot\" Property=\"Background\"\n                      Value=\"{StaticResource MenuItem.Highlight.Disabled.Background}\" />\n              <Setter TargetName=\"templateRoot\" Property=\"BorderBrush\"\n                      Value=\"{StaticResource MenuItem.Highlight.Disabled.Border}\" />\n            </MultiTrigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <Style TargetType=\"ListBoxItem\">\n    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n    <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n  </Style>\n\n  <Style TargetType=\"MenuItem\">\n    <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n    <Setter Property=\"VerticalContentAlignment\" Value=\"Center\" />\n  </Style>\n</ResourceDictionary>"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/CallGraphUtils.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Analysis;\nusing ProfileExplorer.Core.Graph;\nusing ProfileExplorer.Core.Providers;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorerUI.Session;\n\nnamespace ProfileExplorer.UI;\n\nclass CallGraphUtils {\n  public static Graph BuildCallGraphLayout(IRTextSummary summary, IRTextSection section,\n                                           ILoadedDocument loadedDocument,\n                                           ICompilerInfoProvider compilerInfo,\n                                           bool buildPartialGraph) {\n    var cg = GenerateCallGraph(summary, section, loadedDocument,\n                               compilerInfo, buildPartialGraph);\n    return BuildCallGraphLayout(cg);\n  }\n\n  public static CallGraph BuildCallGraph(IRTextSummary summary, IRTextSection section,\n                                         LoadedDocument loadedDocument,\n                                         ICompilerInfoProvider compilerInfo,\n                                         bool buildPartialGraph = false) {\n    return GenerateCallGraph(summary, section, loadedDocument,\n                             compilerInfo, buildPartialGraph);\n  }\n\n  public static Graph BuildCallGraphLayout(CallGraph cg) {\n    var options = new CallGraphPrinterOptions {\n      //UseSingleIncomingEdge = true,\n      //UseStraightLines = true,\n      UseExternalNode = true\n    };\n\n    var printer = new CallGraphPrinter(cg, options);\n    string result = printer.PrintGraph();\n    string graphText = printer.CreateGraph(result, new CancelableTask());\n\n    if (string.IsNullOrEmpty(graphText)) {\n      return new Graph(GraphKind.CallGraph);\n    }\n\n    var graphReader = new GraphvizReader(GraphKind.CallGraph, graphText, printer.CreateNodeDataMap());\n    var layoutGraph = graphReader.ReadGraph();\n    layoutGraph.GraphOptions = options;\n    return layoutGraph;\n  }\n\n  private static CallGraph GenerateCallGraph(IRTextSummary summary, IRTextSection section,\n                                             ILoadedDocument loadedDocument,\n                                             ICompilerInfoProvider compilerInfo,\n                                             bool buildPartialGraph) {\n    var cg = new CallGraph(summary, loadedDocument.Loader, compilerInfo.IR);\n    cg.CallGraphNodeCreated += (sender, e) => {\n      //? TODO: Should be customizable through a script\n      //? and have an option in the UI to pick what to show (profile, func size, script)\n\n      //var funcProfile = profileData?.GetFunctionProfile(e.TextFunction);\n\n      //if (funcProfile != null) {\n      //    double weightPercentage = profileData.ScaleFunctionWeight(funcProfile.Weight);\n      //    var tooltip = $\"{Math.Round(weightPercentage * 100, 2)}% ({Math.Round(funcProfile.Weight.TotalMilliseconds, 2):#,#} ms)\";\n\n      //    int colorIndex = (int)Math.Floor(10 * (1.0 - weightPercentage));\n      //    e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap(colorIndex, 10));\n      //    e.FunctionNode.GetOrAddTag<GraphNodeTag>().Label = tooltip;\n      //}\n\n      int instrCount = e.Function.InstructionCount;\n\n      string tooltip = $\"{instrCount} instr\";\n      int colorIndex = (int)Math.Clamp(Math.Log2(instrCount), 0, 10);\n\n      e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap(colorIndex, 10));\n      e.FunctionNode.GetOrAddTag<GraphNodeTag>().Label = tooltip;\n\n      //int instrs = e.Function.InstructionCount;\n      //\n      //if (instrs == 0) {\n      //    e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap2(0, 10));\n      //}\n      //else if (instrs <= 2) {\n      //    e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap2(2, 10));\n      //}\n      //else if (instrs <= 5) {\n      //    e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap2(4, 10));\n      //}\n      //else if (instrs <= 10) {\n      //    e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap2(5, 10));\n      //}\n      //else if (instrs <= 20) {\n      //    e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap2(6, 10));\n      //}\n      //else {\n      //    e.FunctionNode.AddTag(GraphNodeTag.MakeHeatMap2(8, 10));\n      //}\n    };\n\n    if (buildPartialGraph) {\n      cg.Execute(section.ParentFunction, section);\n    }\n    else {\n      cg.Execute(section);\n    }\n\n    return cg;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/DelayedAction.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Threading.Tasks;\n\nnamespace ProfileExplorer.UI;\n\npublic class DelayedAction {\n  public static TimeSpan DefaultDelay = TimeSpan.FromMilliseconds(500);\n  private bool canceled_;\n  private bool timedOut_;\n\n  public static DelayedAction StartNew(Action action) {\n    return StartNew(DefaultDelay, action);\n  }\n\n  public static DelayedAction StartNew(TimeSpan delay, Action action) {\n    var instance = new DelayedAction();\n    instance.Start(delay, action);\n    return instance;\n  }\n\n  public async Task Start(TimeSpan delay, Action action) {\n    canceled_ = false;\n    timedOut_ = false;\n\n    await Task.Delay(delay);\n\n    if (!canceled_) {\n      timedOut_ = true;\n      action();\n    }\n  }\n\n  public bool Cancel() {\n    canceled_ = true;\n    return timedOut_;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/ErrorReporting.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.IO;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Windows;\nusing Microsoft.Win32;\n\nnamespace ProfileExplorer.UI;\n\npublic static class ErrorReporting {\n  public static string CreateStackTraceDump(string stackTrace) {\n    var time = DateTime.Now;\n    string fileName = $\"ProfileExplorer-{time.Month}.{time.Day}-{time.Hour}.{time.Minute}.log\";\n    string folderPath =\n      Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), \"ProfileExplorer\");\n    string path = Path.Combine(folderPath, fileName);\n    Directory.CreateDirectory(folderPath);\n    File.WriteAllText(path, stackTrace);\n    return path;\n  }\n\n  public static string CreateSectionDump() {\n    var time = DateTime.Now;\n    string fileName = $\"ProfileExplorer-{time.Month}.{time.Day}-{time.Hour}.{time.Minute}.ir\";\n    string folderPath =\n      Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), \"ProfileExplorer\");\n    string path = Path.Combine(folderPath, fileName);\n    Directory.CreateDirectory(folderPath);\n\n    var window = Application.Current.MainWindow as MainWindow;\n    var builder = new StringBuilder();\n\n    if (window == null) {\n      builder.AppendLine(\">> COULD NOT FIND MAIN WINDOW <<\");\n      File.WriteAllText(path, builder.ToString());\n      return path;\n    }\n\n    if (window.OpenDocuments == null) {\n      File.WriteAllText(path, builder.ToString());\n      return path;\n    }\n\n    foreach (var document in window.OpenDocuments) {\n      if (document.Section == null) {\n        builder.AppendLine(\">> MISSING DOCUMENT SECTION <<\");\n      }\n      else if (document.Section.ParentFunction == null) {\n        builder.AppendLine(\">> MISSING DOCUMENT FUNCTION <<\");\n      }\n      else {\n        builder.AppendLine(\n          $\"IR for section {document.Section.Name} in func. {document.Section.ParentFunction.Name}\");\n\n        builder.AppendLine(document.Text);\n        builder.AppendLine();\n      }\n    }\n\n    File.WriteAllText(path, builder.ToString());\n    return path;\n  }\n\n  public static void\n    LogUnhandledException(Exception exception, string source, bool showUIPrompt = true) {\n    string message = $\"Unhandled exception:\\n{exception}\";\n\n    if (showUIPrompt) {\n      MessageBox.Show(message, \"Profile Explorer Crash\", MessageBoxButton.OK, MessageBoxImage.Error,\n                      MessageBoxResult.OK, MessageBoxOptions.None);\n    }\n\n    try {\n      string stackTrace = exception.StackTrace;\n\n      if (exception.InnerException != null) {\n        stackTrace += $\"\\n----------------------------\\n\";\n        stackTrace += $\"\\nInner exception:\";\n        stackTrace += $\"\\n    Message: {exception.InnerException.Message}\";\n        stackTrace += $\"\\n    Stack trace: {exception.InnerException.StackTrace}\";\n      }\n\n      // Report exception to telemetry service.\n      string trace = $\"Message: {exception.Message}\\nStack trace:\\n{stackTrace}\";\n      trace += $\"\\n----------------------------\\n\";\n      trace += $\"\\n{GetEnvironmentVersionInfo()}\";\n\n      string stackTracePath = CreateStackTraceDump(trace);\n      string sectionPath = CreateSectionDump();\n\n      if (showUIPrompt) {\n        MessageBox.Show(\n          $\"Crash information written to:\\n{sectionPath}\\n{stackTracePath}\",\n          \"Profile Explorer Crash\", MessageBoxButton.OK, MessageBoxImage.Information);\n\n        Utils.OpenExplorerAtFile(stackTracePath);\n\n        // Show auto-saved backup info.\n        string autosavePath = Utils.GetAutoSaveFilePath();\n\n        if (File.Exists(autosavePath)) {\n          MessageBox.Show($\"Current session auto-saved to: {autosavePath}\",\n                          \"Profile Explorer Crash\", MessageBoxButton.OK,\n                          MessageBoxImage.Information);\n\n          Utils.OpenExplorerAtFile(autosavePath);\n        }\n      }\n    }\n    catch (Exception ex) {\n      if (showUIPrompt) {\n        MessageBox.Show($\"Failed to save crash information: {ex}\");\n      }\n    }\n\n    Environment.Exit(-1);\n  }\n\n  private static string GetEnvironmentVersionInfo() {\n    string buildNumber = \"unknown\";\n\n    try {\n      RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(@\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\");\n      buildNumber = registryKey.GetValue(\"UBR\").ToString();\n    }\n    catch { }\n\n    var version = Environment.OSVersion.Version;\n    var trace = $\"Windows version: {version.Major}.{version.Minor} (Build {version.Build}.{buildNumber})\";\n    trace += $\"\\n.NET version: {RuntimeEnvironment.GetSystemVersion()}\";\n    return trace;\n  }\n\n  public static void SaveOpenSections() {\n    try {\n      string sectionPath = CreateSectionDump();\n      Utils.OpenExplorerAtFile(sectionPath);\n    }\n    catch (Exception ex) {\n      MessageBox.Show($\"Failed to save crash information: {ex}\");\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/ExtensionMethods.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Media;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Session;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI;\n\nstatic class ExtensionMethods {\n  private static readonly char[] NewLineChars = {'\\r', '\\n'};\n  private static ConcurrentDictionary<PercentageString, string> percentageStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> nanosecondsTimeStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> microsecondTimeStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> millisecondsTimeStringCache_ = new();\n  private static ConcurrentDictionary<TimeString, string> secondsTimeStringCache_ = new();\n\n  public static string RemoveChars(this string value, params char[] charList) {\n    if (string.IsNullOrEmpty(value)) {\n      return value;\n    }\n\n    var sb = new StringBuilder(value.Length);\n\n    foreach (char c in value) {\n      if (Array.IndexOf(charList, c) == -1) {\n        sb.Append(c);\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public static string RemoveNewLines(this string value) {\n    return value.RemoveChars(NewLineChars);\n  }\n\n  public static string TrimToLength(this string text, int maxLength) {\n    if (text.Length <= maxLength) {\n      return text;\n    }\n\n    return $\"{text.Substring(0, maxLength)}..\";\n  }\n\n  public static List<int> AllIndexesOf(this string text, string value) {\n    if (string.IsNullOrEmpty(value)) {\n      return new List<int>();\n    }\n\n    var offsetList = new List<int>(32);\n    int offset = text.IndexOf(value, StringComparison.InvariantCulture);\n\n    while (offset != -1 && offset < text.Length) {\n      offsetList.Add(offset);\n      offset += value.Length;\n      offset = text.IndexOf(value, offset, StringComparison.InvariantCulture);\n    }\n\n    return offsetList;\n  }\n\n  public static bool IsValidRGBColor(this RGBColor color) {\n    return color.R != 0 || color.G != 0 || color.B != 0;\n  }\n\n  public static Color ToColor(this RGBColor color) {\n    return Color.FromRgb((byte)color.R, (byte)color.G, (byte)color.B);\n  }\n\n  public static bool IsTransparent(this Color color) {\n    return color.A == 0;\n  }\n\n  public static bool IsTransparent(this SolidColorBrush brush) {\n    return brush.Color.A == 0;\n  }\n\n  public static bool IsTransparent(this Brush brush) {\n    return brush is SolidColorBrush {Color.A: 0};\n  }\n\n  public static SolidColorBrush AsBrush(this Color color) {\n    return ColorBrushes.GetBrush(color);\n  }\n\n  public static SolidColorBrush AsBrush(this Color color, double opacity) {\n    return ColorBrushes.GetTransparentBrush(color, opacity);\n  }\n\n  public static SolidColorBrush AsBrush(this Color color, byte alpha) {\n    return ColorBrushes.GetTransparentBrush(color, alpha);\n  }\n\n  public static Pen AsPen(this Color color, double thickness = 1.0) {\n    return ColorPens.GetPen(color, thickness);\n  }\n\n  public static Pen AsBoldPen(this Color color) {\n    return ColorPens.GetBoldPen(color);\n  }\n\n  public static string AsTrimmedPercentageString(this double value, int digits = 2, string suffix = \"%\") {\n    return AsPercentageString(value, digits, true, suffix);\n  }\n\n  public static string AsPercentageString(this double value, int digits = 2,\n                                          bool trim = false, string suffix = \"%\") {\n    var entry = new PercentageString(value, digits, trim, suffix);\n\n    if (percentageStringCache_.TryGetValue(entry, out string percentageString)) {\n      return percentageString;\n    }\n\n    value = Math.Round(value * 100, digits);\n\n    if (value == 0 && trim) {\n      percentageStringCache_.TryAdd(entry, \"\");\n      return \"\";\n    }\n\n    percentageString = digits switch {\n      1 => $\"{value:0.0}{suffix}\",\n      2 => $\"{value:0.00}{suffix}\",\n      _ => string.Format(\"{0:0.\" + new string('0', digits) + \"}\", value) + suffix\n    };\n\n    percentageStringCache_.TryAdd(entry, percentageString);\n    return percentageString;\n  }\n\n  public static string AsNanosecondsString(this TimeSpan value, int digits = 2,\n                                           string suffix = \" ns\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (nanosecondsTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalNanoseconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    nanosecondsTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsMicrosecondString(this TimeSpan value, int digits = 2,\n                                           string suffix = \" µs\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (microsecondTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalMicroseconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    microsecondTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsMillisecondsString(this TimeSpan value, int digits = 2,\n                                            string suffix = \" ms\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (millisecondsTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalMilliseconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    millisecondsTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsSecondsString(this TimeSpan value, int digits = 2,\n                                       string suffix = \" s\") {\n    var entry = new TimeString(value, digits, suffix);\n\n    if (secondsTimeStringCache_.TryGetValue(entry, out string timeString)) {\n      return timeString;\n    }\n\n    double roundedValue = value.TotalSeconds.TruncateToDigits(digits);\n    timeString = string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + suffix;\n    secondsTimeStringCache_.TryAdd(entry, timeString);\n    return timeString;\n  }\n\n  public static string AsTimeString(this TimeSpan value, int digits = 2) {\n    return AsTimeString(value, value, digits);\n  }\n\n  public static string AsTimeString(this TimeSpan value, TimeSpan totalValue, int digits = 2) {\n    if (value.Ticks == 0) {\n      return \"0\";\n    }\n\n    if (totalValue.TotalMinutes >= 60) {\n      return value.ToString(\"h\\\\:mm\\\\:ss\");\n    }\n\n    if (totalValue.TotalMinutes >= 10) {\n      return value.ToString(\"mm\\\\:ss\");\n    }\n\n    if (totalValue.TotalSeconds >= 60) {\n      return $\"{value.Minutes}:{value.Seconds:D2}\";\n    }\n\n    if (totalValue.TotalSeconds >= 10) {\n      return value.ToString(\"ss\");\n    }\n\n    if (totalValue.TotalSeconds >= 1) {\n      return $\"{value.Seconds}\";\n    }\n\n    double roundedValue = value.TotalMilliseconds.TruncateToDigits(digits);\n    return string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + \" ms\";\n  }\n\n  public static string AsTimeStringWithMilliseconds(this TimeSpan value, int digits = 2) {\n    return AsTimeStringWithMilliseconds(value, value, digits);\n  }\n\n  public static string AsTimeStringWithMilliseconds(this TimeSpan value, TimeSpan totalValue, int digits = 2) {\n    if (value.Ticks == 0) {\n      return \"0\";\n    }\n\n    if (totalValue.TotalMinutes >= 60) {\n      return value.ToString(\"h\\\\:mm\\\\:ss\\\\.fff\");\n    }\n\n    if (totalValue.TotalMinutes >= 10) {\n      return value.ToString(\"mm\\\\:ss\\\\.fff\");\n    }\n\n    if (totalValue.TotalSeconds >= 60) {\n      return $\"{value.Minutes}:{value:ss\\\\.fff}\";\n    }\n\n    if (totalValue.TotalSeconds >= 10) {\n      return value.ToString(\"ss\\\\.fff\");\n    }\n\n    if (totalValue.TotalSeconds >= 1) {\n      return $\"{value.Seconds}{value:\\\\.fff}\";\n    }\n\n    double roundedValue = value.TotalMilliseconds.TruncateToDigits(digits);\n    return string.Format(\"{0:N\" + Math.Abs(digits) + \"}\", roundedValue) + \" ms\";\n  }\n\n  public static double TruncateToDigits(this double value, int digits) {\n    double factor = Math.Pow(10, digits);\n    value *= factor;\n    value = Math.Truncate(value);\n    return value / factor;\n  }\n\n  public static Point AdjustForMouseCursor(this Point value) {\n    return new Point(value.X + SystemParameters.CursorWidth / 2,\n                     value.Y + SystemParameters.CursorHeight / 2);\n  }\n\n  public static ItemContainer GetObjectAtPoint<ItemContainer>(this ItemsControl control, Point p)\n    where ItemContainer : DependencyObject {\n    // ItemContainer - can be ListViewItem, or TreeViewItem and so on(depends on control)\n    return control.GetContainerAtPoint<ItemContainer>(p);\n  }\n\n  public static string FormatFunctionName(this ProfileCallTreeNode node, FunctionNameFormatter nameFormatter,\n                                          int maxLength = int.MaxValue) {\n    return FormatName(node.FunctionName, nameFormatter, maxLength);\n  }\n\n  public static string FormatModuleName(this ProfileCallTreeNode node, FunctionNameFormatter nameFormatter,\n                                        int maxLength = int.MaxValue) {\n    return FormatName(node.ModuleName, nameFormatter, maxLength);\n  }\n\n  public static string FormatFunctionName(this IRTextFunction func, ISession session, int maxLength = int.MaxValue) {\n    return FormatName(func.Name, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  public static string FormatFunctionName(this IRTextSection section, ISession session, int maxLength = int.MaxValue) {\n    return FormatName(section.ParentFunction.Name, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  public static string FormatFunctionName(this string name, ISession session, int maxLength = int.MaxValue) {\n    return FormatName(name, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  public static string FormatFunctionName(this ProfileCallTreeNode node, ISession session,\n                                          int maxLength = int.MaxValue) {\n    return FormatName(node.FunctionName, session.CompilerInfo.NameProvider.FormatFunctionName, maxLength);\n  }\n\n  private static ItemContainer GetContainerAtPoint<ItemContainer>(this ItemsControl control, Point p)\n    where ItemContainer : DependencyObject {\n    var result = VisualTreeHelper.HitTest(control, p);\n    var obj = result?.VisualHit;\n\n    if (obj == null) {\n      return null;\n    }\n\n    while (VisualTreeHelper.GetParent(obj) != null && !(obj is ItemContainer)) {\n      obj = VisualTreeHelper.GetParent(obj);\n    }\n\n    // Will return null if not found\n    return obj as ItemContainer;\n  }\n\n  private static string FormatName(string name, FunctionNameFormatter nameFormatter, int maxLength) {\n    if (string.IsNullOrEmpty(name)) {\n      return name;\n    }\n\n    name = nameFormatter != null ? nameFormatter(name) : name;\n\n    if (name.Length > maxLength) {\n      if (maxLength > 3) {\n        name = $\"{name.Substring(0, maxLength - 3)}...\";\n      }\n      else {\n        name = name.Substring(0, maxLength);\n      }\n    }\n\n    return name;\n  }\n\n  public static int GetStableHashCode(this string str) {\n    unchecked {\n      int hash1 = 5381;\n      int hash2 = hash1;\n\n      for (int i = 0; i < str.Length && str[i] != '\\0'; i += 2) {\n        hash1 = (hash1 << 5) + hash1 ^ str[i];\n        if (i == str.Length - 1 || str[i + 1] == '\\0')\n          break;\n        hash2 = (hash2 << 5) + hash2 ^ str[i + 1];\n      }\n\n      return hash1 + hash2 * 1566083941;\n    }\n  }\n\n  // Cache percentage and time value to string conversion result\n  // to reduce GC pressure when rendering.\n  private record PercentageString(double value, int digits, bool trim, string suffix);\n  private record TimeString(TimeSpan value, int digits, string suffix);\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/LongRunningAction.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Threading.Tasks;\nusing System.Windows;\n\nnamespace ProfileExplorer.UI;\n\npublic static class LongRunningAction {\n  public static async Task<T> Start<T>(Func<Task<T>> task, TimeSpan timeout,\n                                       Action timeoutExceeded,\n                                       Action afterTimeoutExceeded) where T : class {\n    // Start a timer that triggers the timeoutExceeded action\n    // if the timeout is exceeded while the task is running.\n    var timeoutAction = DelayedAction.StartNew(timeout, () => {\n      timeoutExceeded?.Invoke();\n    });\n\n    var result = await task();\n\n    // If the timeout was exceeded and the timeoutExceeded action ran,\n    // also execute the afterTimeoutExceeded action.\n    if (timeoutAction.Cancel()) {\n      afterTimeoutExceeded?.Invoke();\n    }\n\n    return result;\n  }\n\n  public static async Task Start(Func<Task> task, TimeSpan timeout,\n                                 Action timeoutExceeded,\n                                 Action afterTimeoutExceeded) {\n    // Start a timer that triggers the timeoutExceeded action\n    // if the timeout is exceeded while the task is running.\n    var timeoutAction = DelayedAction.StartNew(timeout, () => {\n      timeoutExceeded?.Invoke();\n    });\n\n    await task();\n\n    // If the timeout was exceeded and the timeoutExceeded action ran,\n    // also execute the afterTimeoutExceeded action.\n    if (timeoutAction.Cancel()) {\n      afterTimeoutExceeded?.Invoke();\n    }\n  }\n\n  public static async Task<T> Start<T>(Func<Task<T>> task, TimeSpan timeout,\n                                       string timeoutStatusText,\n                                       FrameworkElement timeoutDisabledControl,\n                                       IUISession session) where T : class {\n    return await Start<T>(task, timeout,\n                          () => {\n                            timeoutDisabledControl.IsEnabled = false;\n                            session.SetApplicationProgress(true, double.NaN, timeoutStatusText);\n                          },\n                          () => {\n                            timeoutDisabledControl.IsEnabled = true;\n                            session.SetApplicationProgress(false, double.NaN);\n                          });\n  }\n\n  public static async Task Start(Func<Task> task, TimeSpan timeout,\n                                 string timeoutStatusText,\n                                 FrameworkElement timeoutDisabledControl,\n                                 IUISession session) {\n    await Start(task, timeout,\n                () => {\n                  timeoutDisabledControl.IsEnabled = false;\n                  session.SetApplicationProgress(true, double.NaN, timeoutStatusText);\n                },\n                () => {\n                  timeoutDisabledControl.IsEnabled = true;\n                  session.SetApplicationProgress(false, double.NaN);\n                });\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/ObservableCollectionRefresh.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Collections.Specialized;\nusing System.ComponentModel;\nusing System.Windows.Data;\n\nnamespace ProfileExplorer.UI;\n\npublic class ObservableCollectionRefresh<T> : ObservableCollection<T> {\n  public ObservableCollectionRefresh() { }\n  public ObservableCollectionRefresh(List<T> inputValues) : base(inputValues) { }\n\n  public void Refresh() {\n    OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));\n  }\n\n  public void AddRange(List<T> values) {\n    foreach (var value in values) {\n      Add(value);\n    }\n\n    Refresh();\n  }\n\n  public ICollectionView GetFilterView() {\n    return CollectionViewSource.GetDefaultView(this);\n  }\n\n  protected override void InsertItem(int index, T item) {\n    base.InsertItem(index, item);\n    Refresh();\n  }\n\n  protected override void RemoveItem(int index) {\n    base.RemoveItem(index);\n    Refresh();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/RelayCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI;\n\npublic class RelayCommand<T> : ICommand {\n  private readonly Action<T> _execute;\n  private readonly Predicate<T> _canExecute;\n\n  /// <summary>\n  ///   Initializes a new instance of <see cref=\"DelegateCommand{T}\" />.\n  /// </summary>\n  /// <param name=\"execute\">\n  ///   Delegate to execute when Execute is called on the command.  This can be null\n  ///   to just hook up a CanExecute delegate.\n  /// </param>\n  /// <remarks><seealso cref=\"CanExecute\" /> will always return true.</remarks>\n  public RelayCommand(Action<T> execute)\n    : this(execute, null) {\n  }\n\n  /// <summary>\n  ///   Creates a new command.\n  /// </summary>\n  /// <param name=\"execute\">The execution logic.</param>\n  /// <param name=\"canExecute\">The execution status logic.</param>\n  public RelayCommand(Action<T> execute, Predicate<T> canExecute) {\n    if (execute == null)\n      throw new ArgumentNullException(\"execute\");\n\n    _execute = execute;\n    _canExecute = canExecute;\n  }\n\n  /// <summary>\n  ///   Defines the method that determines whether the command can execute in its current state.\n  /// </summary>\n  /// <param name=\"parameter\">\n  ///   Data used by the command.  If the command does not require data to be\n  ///   passed, this object can be set to null.\n  /// </param>\n  /// <returns>\n  ///   true if this command can be executed; otherwise, false.\n  /// </returns>\n  public bool CanExecute(object parameter) {\n    return _canExecute == null || _canExecute((T)parameter);\n  }\n\n  /// <summary>\n  ///   Occurs when changes occur that affect whether or not the command should execute.\n  /// </summary>\n  public event EventHandler CanExecuteChanged {\n    add => CommandManager.RequerySuggested += value;\n    remove => CommandManager.RequerySuggested -= value;\n  }\n\n  /// <summary>\n  ///   Defines the method to be called when the command is invoked.\n  /// </summary>\n  /// <param name=\"parameter\">\n  ///   Data used by the command. If the command does not require data to be\n  ///   passed, this object can be set to <see langword=\"null\" />.\n  /// </param>\n  public void Execute(object parameter) {\n    _execute((T)parameter);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/SectionTextSearcher.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class SectionSearchResult {\n  public SectionSearchResult(IRTextSection section) {\n    Section = section;\n  }\n\n  public bool HasResults => Results != null && Results.Count > 0;\n  public IRTextSection Section { get; set; }\n  public ReadOnlyMemory<char> SectionText { get; set; }\n  public List<TextSearchResult> Results { get; set; }\n  public List<TextSearchResult> BeforeOutputResults { get; set; }\n  public List<TextSearchResult> AfterOutputResults { get; set; }\n}\n\npublic class SectionTextSearcherOptions {\n  public SectionTextSearcherOptions() {\n    SearchBeforeOutput = false;\n    SearchAfterOutput = false;\n    KeepSectionText = true;\n    UseRawSectionText = false;\n    MaxThreadCount = App.Settings.GeneralSettings.CurrentCpuCoreLimit;\n  }\n\n  public bool SearchBeforeOutput { get; set; }\n  public bool SearchAfterOutput { get; set; }\n  public bool KeepSectionText { get; set; }\n  public bool UseRawSectionText { get; set; }\n  public int MaxThreadCount { get; set; }\n}\n\npublic class SectionTextSearcher {\n  private IRTextSectionLoader sectionLoader_;\n  private SectionTextSearcherOptions options_;\n\n  public SectionTextSearcher(IRTextSectionLoader sectionLoader, SectionTextSearcherOptions options = null) {\n    sectionLoader_ = sectionLoader;\n\n    if (options != null) {\n      options_ = options;\n    }\n    else {\n      // Use default options if not set.\n      options_ = new SectionTextSearcherOptions();\n    }\n  }\n\n  public async Task<List<SectionSearchResult>> SearchAsync(string searchedText,\n                                                           TextSearchKind searchKind,\n                                                           List<IRTextSection> sections,\n                                                           CancelableTask cancelableTask = null) {\n    var resultList = new List<SectionSearchResult>(sections.Count);\n\n    if (string.IsNullOrEmpty(searchedText)) {\n      return resultList;\n    }\n\n    using var concurrencySemaphore = new SemaphoreSlim(options_.MaxThreadCount);\n    const int BatchSize = 1024;\n    int batches = sections.Count / BatchSize;\n    int index = 0;\n\n    while (index < sections.Count) {\n      if (cancelableTask != null && cancelableTask.IsCanceled) {\n        break;\n      }\n\n      int batchStart = index;\n      int batchSize = Math.Min(BatchSize, sections.Count - batchStart);\n      var tasks = new Task<SectionSearchResult>[batchSize];\n\n      for (int i = 0; i < batchSize; i++) {\n        await concurrencySemaphore.WaitAsync().ConfigureAwait(false);\n\n        var section = sections[batchStart + i];\n        tasks[i] = Task.Run(() => {\n          try {\n            return SearchSection(searchedText, searchKind, section, cancelableTask);\n          }\n          finally {\n            concurrencySemaphore.Release();\n          }\n        });\n      }\n\n      await Task.WhenAll(tasks).ConfigureAwait(false);\n\n      foreach (var task in tasks) {\n        resultList.Add(await task);\n      }\n\n      index += batchSize;\n    }\n\n    return resultList;\n  }\n\n  public async Task<SectionSearchResult> SearchSectionAsync(string searchedText,\n                                                            TextSearchKind searchKind,\n                                                            IRTextSection section) {\n    var input = new List<IRTextSection> {section};\n    var resultList = await SearchAsync(searchedText, searchKind, input);\n\n    if (resultList.Count > 0) {\n      return resultList[0];\n    }\n\n    return new SectionSearchResult(section);\n  }\n\n  public SectionSearchResult SearchSection(string searchedText, TextSearchKind searchKind,\n                                           IRTextSection section, CancelableTask cancelableTask) {\n    var text = options_.UseRawSectionText ?\n      sectionLoader_.GetRawSectionTextSpan(section) :\n      sectionLoader_.GetSectionTextSpan(section);\n    return SearchSection(text, searchedText, searchKind, section, cancelableTask);\n  }\n\n  public SectionSearchResult SearchSection(ReadOnlyMemory<char> text, string searchedText, TextSearchKind searchKind,\n                                           IRTextSection section, CancelableTask cancelableTask = null) {\n    var result = new SectionSearchResult(section) {\n      SectionText = options_.KeepSectionText ? text : ReadOnlyMemory<char>.Empty,\n      Results = TextSearcher.AllIndexesOf(text, searchedText, 0, searchKind, cancelableTask)\n    };\n\n    if (cancelableTask != null && cancelableTask.IsCanceled) {\n      return result;\n    }\n\n    if (options_.SearchBeforeOutput) {\n      var beforeText = options_.UseRawSectionText ?\n        sectionLoader_.GetRawSectionPassOutputSpan(section.OutputBefore) :\n        sectionLoader_.GetSectionPassOutputTextSpan(section.OutputBefore);\n\n      if (beforeText.Length > 0) {\n        result.BeforeOutputResults = TextSearcher.AllIndexesOf(beforeText, searchedText, 0, searchKind, cancelableTask);\n      }\n    }\n\n    if (options_.SearchAfterOutput) {\n      var afterText = options_.UseRawSectionText ?\n        sectionLoader_.GetRawSectionPassOutputSpan(section.OutputAfter) :\n        sectionLoader_.GetSectionPassOutputTextSpan(section.OutputAfter);\n\n      if (afterText.Length > 0) {\n        result.BeforeOutputResults = TextSearcher.AllIndexesOf(afterText, searchedText, 0, searchKind, cancelableTask);\n      }\n    }\n\n    return result;\n  }\n\n  public async Task<SectionSearchResult> SearchSectionWithTextAsync(string text, string searchedText,\n                                                                    TextSearchKind searchKind,\n                                                                    IRTextSection section,\n                                                                    CancelableTask cancelableTask = null) {\n    var result = await Task.Run(() => TextSearcher.AllIndexesOf(text, searchedText, 0, searchKind, cancelableTask));\n\n    return new SectionSearchResult(section) {\n      SectionText = options_.KeepSectionText ? text.AsMemory() : ReadOnlyMemory<char>.Empty,\n      Results = result\n    };\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/TextSearcher.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO.Enumeration;\nusing System.Text.RegularExpressions;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\n[Flags]\npublic enum TextSearchKind {\n  Default = 1 << 0, // Case sensitive\n  CaseInsensitive = 1 << 1,\n  Regex = 1 << 2,\n  WholeWord = 1 << 3,\n  Wildcard = 1 << 4\n}\n\npublic struct TextSearchResult {\n  public int Offset;\n  public int Length;\n\n  public TextSearchResult(int offset, int length) {\n    Offset = offset;\n    Length = length;\n  }\n\n  public override bool Equals(object obj) {\n    return obj is TextSearchResult result && Offset == result.Offset && Length == result.Length;\n  }\n\n  public override int GetHashCode() {\n    return HashCode.Combine(Offset, Length);\n  }\n}\n\npublic class TextSearcher {\n  private Regex cachedRegex_;\n  private TextSearchKind searchKind_;\n  private string searchedText_;\n  public TextSearcher() { }\n\n  public TextSearcher(string text, bool caseInsensitive = false) {\n    searchedText_ = text;\n    searchKind_ = GetWildcardSearchKind(text, caseInsensitive);\n  }\n\n  public static TextSearchKind GetWildcardSearchKind(string pattern, bool caseInsensitive = false) {\n    if (pattern.Contains('*')) {\n      return caseInsensitive ?\n        TextSearchKind.Wildcard | TextSearchKind.CaseInsensitive :\n        TextSearchKind.Wildcard;\n    }\n\n    return caseInsensitive ?\n      TextSearchKind.Default | TextSearchKind.CaseInsensitive :\n      TextSearchKind.Default;\n  }\n\n  public static bool IsWholeWord(ReadOnlySpan<char> matchedText, ReadOnlySpan<char> text, int startOffset) {\n    if (startOffset > 0) {\n      if (IsWordLetter(text[startOffset - 1])) {\n        return false;\n      }\n    }\n\n    if (startOffset + matchedText.Length < text.Length) {\n      if (IsWordLetter(text[startOffset + matchedText.Length])) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  public static List<TextSearchResult> AllIndexesOf(ReadOnlyMemory<char> text,\n                                                    ReadOnlyMemory<char> searchedText,\n                                                    int startOffset = 0,\n                                                    TextSearchKind searchKind = TextSearchKind.Default,\n                                                    CancelableTask cancelableTask = null) {\n    if (text.Length == 0 || searchedText.Length == 0) {\n      return new List<TextSearchResult>();\n    }\n\n    var regex = searchKind.HasFlag(TextSearchKind.Regex) ?\n      CreateRegex(searchedText.ToString(), searchKind) : null;\n\n    var offsetList = new List<TextSearchResult>();\n    (int offset, int length) = IndexOf(text, searchedText, startOffset, searchKind, regex);\n\n    while (offset != -1 && offset + length < text.Length) {\n      offsetList.Add(new TextSearchResult(offset, length));\n      offset += length;\n\n      if (cancelableTask != null && cancelableTask.IsCanceled) {\n        break;\n      }\n\n      (offset, length) = IndexOf(text, searchedText, offset, searchKind, regex);\n    }\n\n    return offsetList;\n  }\n\n  public static TextSearchResult? FirstIndexOf(ReadOnlyMemory<char> text,\n                                               ReadOnlyMemory<char> searchedText,\n                                               int startOffset = 0,\n                                               TextSearchKind searchKind = TextSearchKind.Default) {\n    (int offset, int length) = IndexOf(text, searchedText, startOffset, searchKind);\n\n    if (offset != -1) {\n      return new TextSearchResult(offset, length);\n    }\n\n    return null;\n  }\n\n  public static bool Contains(ReadOnlyMemory<char> text,\n                              ReadOnlyMemory<char> searchedText,\n                              TextSearchKind searchKind = TextSearchKind.Default) {\n    (int offset, _) = IndexOf(text, searchedText, 0, searchKind);\n    return offset != -1;\n  }\n\n  public static bool Contains(string text,\n                              string searchedText,\n                              TextSearchKind searchKind = TextSearchKind.Default) {\n    (int offset, _) = IndexOf(text, searchedText, 0, searchKind);\n    return offset != -1;\n  }\n\n  public static List<TextSearchResult> AllIndexesOf(string text, string searchedText,\n                                                    int startOffset = 0,\n                                                    TextSearchKind searchKind = TextSearchKind.Default,\n                                                    CancelableTask cancelableTask = null) {\n    return AllIndexesOf(text.AsMemory(), searchedText.AsMemory(),\n                        startOffset, searchKind, cancelableTask);\n  }\n\n  public static TextSearchResult? FirstIndexOf(string text, string searchedText,\n                                               int startOffset = 0,\n                                               TextSearchKind searchKind = TextSearchKind.Default) {\n    return FirstIndexOf(text.AsMemory(), searchedText.AsMemory(),\n                        startOffset, searchKind);\n  }\n\n  public bool Includes(string text, string searchedText,\n                       TextSearchKind searchKind = TextSearchKind.Default) {\n    if (searchKind.HasFlag(TextSearchKind.Regex)) {\n      cachedRegex_ ??= CreateRegex(searchedText, searchKind);\n    }\n\n    (int offset, _) = IndexOf(text, searchedText, 0, searchKind, cachedRegex_);\n    return offset != -1;\n  }\n\n  public bool Includes(string text) {\n    if (searchKind_.HasFlag(TextSearchKind.Regex)) {\n      cachedRegex_ ??= CreateRegex(searchedText_, searchKind_);\n    }\n\n    (int offset, _) = IndexOf(text, searchedText_, 0, searchKind_, cachedRegex_);\n    return offset != -1;\n  }\n\n  public TextSearchResult? FirstIndexOf(string text) {\n    if (searchKind_.HasFlag(TextSearchKind.Regex)) {\n      cachedRegex_ ??= CreateRegex(searchedText_, searchKind_);\n    }\n\n    (int offset, int length) = IndexOf(text.AsMemory(), searchedText_.AsMemory(), 0, searchKind_, cachedRegex_);\n\n    if (offset != -1) {\n      return new TextSearchResult(offset, length);\n    }\n\n    return null;\n  }\n\n  public static List<TextSearchResult> AllIndexesOf(ReadOnlyMemory<char> text, string searchedText,\n                                                    int startOffset = 0,\n                                                    TextSearchKind searchKind = TextSearchKind.Default,\n                                                    CancelableTask cancelableTask = null) {\n    return AllIndexesOf(text, searchedText.AsMemory(),\n                        startOffset, searchKind, cancelableTask);\n  }\n\n  public static TextSearchResult? FirstIndexOf(ReadOnlyMemory<char> text, string searchedText,\n                                               int startOffset = 0,\n                                               TextSearchKind searchKind = TextSearchKind.Default) {\n    return FirstIndexOf(text, searchedText.AsMemory(),\n                        startOffset, searchKind);\n  }\n\n  public static bool Contains(ReadOnlyMemory<char> text, string searchedText,\n                              TextSearchKind searchKind = TextSearchKind.Default) {\n    return Contains(text, searchedText.AsMemory());\n  }\n\n  private static bool IsWordLetter(char letter) {\n    return char.IsLetter(letter) || char.IsDigit(letter) || letter == '_';\n  }\n\n  private static Regex CreateRegex(string pattern, TextSearchKind searchKind) {\n    try {\n      var options = RegexOptions.Compiled;\n\n      if (searchKind.HasFlag(TextSearchKind.CaseInsensitive)) {\n        options |= RegexOptions.IgnoreCase;\n      }\n\n      return new Regex(pattern, options);\n    }\n    catch (Exception ex) {\n      Debug.WriteLine($\"Failed regex text search: {ex}\");\n      return null;\n    }\n  }\n\n  private static (int, int) IndexOf(ReadOnlyMemory<char> text,\n                                    ReadOnlyMemory<char> searchedText, int startOffset = 0,\n                                    TextSearchKind searchKind = TextSearchKind.Default,\n                                    Regex regex = null) {\n    if (text.Length == 0 || searchedText.Length == 0) {\n      return (-1, 0);\n    }\n\n    if (searchKind.HasFlag(TextSearchKind.Regex)) {\n      try {\n        regex ??= CreateRegex(searchedText.ToString(), searchKind);\n\n        if (regex == null) {\n          // Regex pattern is invalid if it cannot be created.\n          return (-1, searchedText.Length);\n        }\n\n        var result = regex.Matches(text.ToString(), startOffset);\n\n        if (result.Count > 0) {\n          return (result[0].Index, result[0].Length);\n        }\n      }\n      catch (Exception ex) {\n        //? TODO: Handle invalid regex, report in UI\n        Debug.WriteLine($\"Failed regex text search: {ex}\");\n      }\n    }\n    else if (searchKind.HasFlag(TextSearchKind.Wildcard)) {\n      if (FileSystemName.MatchesSimpleExpression(searchedText.ToString(), text.ToString(),\n                                                 searchKind.HasFlag(TextSearchKind.CaseInsensitive))) {\n        return (startOffset, searchedText.Length);\n      }\n    }\n    else {\n      var comparisonKind = searchKind.HasFlag(TextSearchKind.CaseInsensitive) ?\n        StringComparison.OrdinalIgnoreCase :\n        StringComparison.Ordinal;\n      var adjustedText = text.Slice(startOffset);\n      int index = adjustedText.Span.IndexOf(searchedText.Span, comparisonKind);\n\n      if (index == -1) {\n        return (-1, searchedText.Length);\n      }\n\n      if (searchKind.HasFlag(TextSearchKind.WholeWord)) {\n        if (!IsWholeWord(searchedText.Span, text.Span, index + startOffset)) {\n          return (-1, searchedText.Length);\n        }\n      }\n\n      return (startOffset + index, searchedText.Length);\n    }\n\n    return (-1, searchedText.Length);\n  }\n\n  private static (int, int) IndexOf(string text, string searchedText, int startOffset = 0,\n                                    TextSearchKind searchKind = TextSearchKind.Default,\n                                    Regex regex = null) {\n    if (text.Length == 0 || searchedText.Length == 0) {\n      return (-1, 0);\n    }\n\n    if (searchKind.HasFlag(TextSearchKind.Regex)) {\n      try {\n        regex ??= CreateRegex(searchedText, searchKind);\n\n        if (regex == null) {\n          // Regex pattern is invalid if it cannot be created.\n          return (-1, searchedText.Length);\n        }\n\n        var result = regex.Matches(text, startOffset);\n\n        if (result.Count > 0) {\n          return (result[0].Index, result[0].Length);\n        }\n      }\n      catch (Exception ex) {\n        //? TODO: Handle invalid regex, report in UI\n        Debug.WriteLine($\"Failed regex text search: {ex}\");\n      }\n    }\n    else if (searchKind.HasFlag(TextSearchKind.Wildcard)) {\n      if (FileSystemName.MatchesSimpleExpression(searchedText, text,\n                                                 searchKind.HasFlag(TextSearchKind.CaseInsensitive))) {\n        return (startOffset, searchedText.Length);\n      }\n    }\n    else {\n      var comparisonKind = searchKind.HasFlag(TextSearchKind.CaseInsensitive) ?\n        StringComparison.OrdinalIgnoreCase :\n        StringComparison.Ordinal;\n      int index = text.IndexOf(searchedText, startOffset, comparisonKind);\n\n      if (index == -1) {\n        return (-1, searchedText.Length);\n      }\n\n      if (searchKind.HasFlag(TextSearchKind.WholeWord)) {\n        if (!IsWholeWord(searchedText.AsSpan(), text.AsSpan(), index + startOffset)) {\n          return (-1, searchedText.Length);\n        }\n      }\n\n      return (startOffset + index, searchedText.Length);\n    }\n\n    return (-1, searchedText.Length);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/Behaviors.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\n// Based on https://stackoverflow.com/a/29123964\npublic static class ContextMenuLeftClickBehavior {\n  public static readonly DependencyProperty IsLeftClickEnabledProperty = DependencyProperty.RegisterAttached(\n    \"IsLeftClickEnabled\",\n    typeof(bool),\n    typeof(ContextMenuLeftClickBehavior),\n    new UIPropertyMetadata(false, OnIsLeftClickEnabledChanged));\n\n  public static bool GetIsLeftClickEnabled(DependencyObject obj) {\n    return (bool)obj.GetValue(IsLeftClickEnabledProperty);\n  }\n\n  public static void SetIsLeftClickEnabled(DependencyObject obj, bool value) {\n    obj.SetValue(IsLeftClickEnabledProperty, value);\n  }\n\n  private static void OnIsLeftClickEnabledChanged(object sender, DependencyPropertyChangedEventArgs e) {\n    var uiElement = sender as UIElement;\n\n    if (uiElement != null) {\n      bool IsEnabled = e.NewValue is bool && (bool)e.NewValue;\n\n      if (IsEnabled) {\n        if (uiElement is ButtonBase)\n          ((ButtonBase)uiElement).Click += OnMouseLeftButtonUp;\n        else\n          uiElement.MouseLeftButtonUp += OnMouseLeftButtonUp;\n      }\n      else {\n        if (uiElement is ButtonBase)\n          ((ButtonBase)uiElement).Click -= OnMouseLeftButtonUp;\n        else\n          uiElement.MouseLeftButtonUp -= OnMouseLeftButtonUp;\n      }\n    }\n  }\n\n  private static void OnMouseLeftButtonUp(object sender, RoutedEventArgs e) {\n    var fe = sender as FrameworkElement;\n\n    if (fe != null) {\n      // if we use binding in our context menu, then it's DataContext won't be set when we show the menu on left click\n      // (it seems setting DataContext for ContextMenu is hardcoded in WPF when user right clicks on a control, although I'm not sure)\n      // so we have to set up ContextMenu.DataContext manually here\n      if (fe.ContextMenu.DataContext == null) {\n        fe.ContextMenu.SetBinding(FrameworkElement.DataContextProperty, new Binding {Source = fe.DataContext});\n      }\n\n      fe.ContextMenu.IsOpen = true;\n    }\n  }\n}\n\n// Based on https://stackoverflow.com/a/3088387\npublic class GridViewColumnVisibility {\n  public static readonly DependencyProperty IsVisibleProperty =\n    DependencyProperty.RegisterAttached(\"IsVisible\", typeof(bool), typeof(GridViewColumnVisibility),\n                                        new UIPropertyMetadata(true));\n  private static Dictionary<ListView, List<(GridViewColumn Column, int Index)>> removedColumns_ = new();\n  public static readonly DependencyProperty EnabledProperty =\n    DependencyProperty.RegisterAttached(\"Enabled\", typeof(bool), typeof(GridViewColumnVisibility),\n                                        new UIPropertyMetadata(false,\n                                                               OnEnabledChanged));\n\n  public static void RemoveAllColumnsExcept(string columnName, ListView lv) {\n    var gridview = lv.View as GridView;\n    if (gridview == null || gridview.Columns == null)\n      return;\n\n    var toRemove = new List<GridViewColumn>();\n\n    foreach (var gc in gridview.Columns) {\n      if (gc.Header is GridViewColumnHeader header &&\n          !string.Equals(header.Name, columnName)) {\n        toRemove.Add(gc);\n      }\n    }\n\n    foreach (var gc in toRemove) {\n      gridview.Columns.Remove(gc);\n    }\n  }\n\n  public static void UpdateListView(ListView lv) {\n    var gridview = lv.View as GridView;\n    if (gridview == null || gridview.Columns == null)\n      return;\n\n    removedColumns_ ??= new Dictionary<ListView, List<(GridViewColumn, int)>>();\n    var columnList = removedColumns_.GetOrAddValue(lv);\n    var addedColumns = new List<GridViewColumn>();\n\n    // If some of the removed columns got re-enabled, insert them back.\n    foreach (var removedColumn in columnList) {\n      if (GetIsVisible(removedColumn.Column)) {\n        int columnIndex = Math.Min(removedColumn.Index, gridview.Columns.Count);\n        gridview.Columns.Insert(columnIndex, removedColumn.Column);\n        addedColumns.Add(removedColumn.Column);\n      }\n    }\n\n    // Discard columns that got re-enabled.\n    foreach (var column in addedColumns) {\n      int index = columnList.FindIndex(c => c.Column == column);\n\n      if (index != -1) {\n        columnList.RemoveAt(index);\n      }\n    }\n\n    // Remove disabled columns and save them for later\n    // in case they get re-enabled.\n    var toRemove = new List<GridViewColumn>();\n\n    foreach (var gc in gridview.Columns) {\n      if (GetIsVisible(gc) == false) {\n        toRemove.Add(gc);\n        columnList.Add((gc, toRemove.Count));\n      }\n    }\n\n    foreach (var gc in toRemove) {\n      gridview.Columns.Remove(gc);\n    }\n  }\n\n  public static bool GetIsVisible(DependencyObject obj) {\n    return (bool)obj.GetValue(IsVisibleProperty);\n  }\n\n  public static void SetIsVisible(DependencyObject obj, bool value) {\n    obj.SetValue(IsVisibleProperty, value);\n  }\n\n  public static bool GetEnabled(DependencyObject obj) {\n    return (bool)obj.GetValue(EnabledProperty);\n  }\n\n  public static void SetEnabled(DependencyObject obj, bool value) {\n    obj.SetValue(EnabledProperty, value);\n  }\n\n  private static void OnEnabledChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) {\n    var view = obj as ListView;\n\n    if (view != null) {\n      bool enabled = (bool)e.NewValue;\n\n      if (enabled) {\n        view.Loaded += (sender, e2) => {\n          UpdateListView((ListView)sender);\n        };\n        view.TargetUpdated += (sender, e2) => {\n          UpdateListView((ListView)sender);\n        };\n        view.DataContextChanged += (sender, e2) => {\n          UpdateListView((ListView)sender);\n        };\n        view.IsVisibleChanged += (sender, e2) => {\n          UpdateListView((ListView)sender);\n        };\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/ColorBrushes.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI;\n\npublic static class ColorBrushes {\n  private static readonly ThreadLocal<Dictionary<Color, SolidColorBrush>> brushes_ =\n    new(() => new Dictionary<Color, SolidColorBrush>());\n\n  // Cache transparent brush, since using it from Brushes\n  // does a dictionary lookup.\n  public static readonly Brush Transparent = Brushes.Transparent;\n\n  public static SolidColorBrush GetBrush(string colorName) {\n    return GetBrush(Utils.ColorFromString(colorName));\n  }\n\n  public static SolidColorBrush GetBrush(Color color) {\n    if (brushes_.Value.TryGetValue(color, out var brush)) {\n      return brush;\n    }\n\n    brush = new SolidColorBrush(color);\n    brush.Freeze();\n    brushes_.Value.Add(color, brush);\n    return brush;\n  }\n\n  public static SolidColorBrush GetTransparentBrush(Color baseColor, byte alpha) {\n    return GetBrush(Color.FromArgb(alpha, baseColor.R, baseColor.G, baseColor.B));\n  }\n\n  public static SolidColorBrush GetTransparentBrush(Color baseColor, double opacity) {\n    byte alpha = Math.Clamp((byte)(opacity * 255), (byte)0, (byte)255);\n    return GetBrush(Color.FromArgb(alpha, baseColor.R, baseColor.G, baseColor.B));\n  }\n\n  public static SolidColorBrush GetTransparentBrush(string baseColor, byte alpha) {\n    return GetTransparentBrush(Utils.ColorFromString(baseColor), alpha);\n  }\n\n  public static SolidColorBrush GetTransparentBrush(string baseColor, double opacity) {\n    return GetTransparentBrush(Utils.ColorFromString(baseColor), opacity);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/ColorPens.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Threading;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI;\n\npublic static class ColorPens {\n  private static readonly double BoldPenThickness = 1.25;\n  private static ThreadLocal<Dictionary<Tuple<Color, double>, Pen>> pens_ =\n    new(() => new Dictionary<Tuple<Color, double>, Pen>());\n  private static ThreadLocal<Dictionary<Tuple<Color, double, DashStyle>, Pen>> dashedPens_ =\n    new(() => new Dictionary<Tuple<Color, double, DashStyle>, Pen>());\n\n  public static Pen GetPen(Color color, double thickness = 1.0) {\n    var pair = new Tuple<Color, double>(color, thickness);\n\n    if (pens_.Value.TryGetValue(pair, out var pen)) {\n      return pen;\n    }\n\n    pen = CreatePen(color, thickness);\n    pens_.Value.Add(pair, pen);\n    return pen;\n  }\n\n  public static Pen GetPen(Brush brush, double thickness = 1.0) {\n    if (brush is SolidColorBrush colorBrush) {\n      return GetPen(colorBrush.Color, thickness);\n    }\n\n    return null;\n  }\n\n  public static Pen GetPen(string color, double thickness = 1.0) {\n    return GetPen(Utils.ColorFromString(color), thickness);\n  }\n\n  public static Pen GetBoldPen(Color color) {\n    return GetPen(color, BoldPenThickness);\n  }\n\n  public static Pen GetBoldPen(Pen templatePen) {\n    var brush = (SolidColorBrush)templatePen.Brush;\n    return GetPen(brush.Color, BoldPenThickness);\n  }\n\n  public static Pen GetBoldPen(string color) {\n    return GetPen(Utils.ColorFromString(color), BoldPenThickness);\n  }\n\n  public static Pen GetDashedPen(Color color, DashStyle dashStyle, double thickness = 1.0) {\n    var pair = new Tuple<Color, double, DashStyle>(color, thickness, dashStyle);\n\n    if (dashedPens_.Value.TryGetValue(pair, out var pen)) {\n      return pen;\n    }\n\n    pen = CreateDashedPen(color, dashStyle, thickness);\n    dashedPens_.Value.Add(pair, pen);\n    return pen;\n  }\n\n  public static Pen GetTransparentPen(Color baseColor, byte alpha, double thickness = 1.0) {\n    return GetPen(Color.FromArgb(alpha, baseColor.R, baseColor.G, baseColor.B), thickness);\n  }\n\n  private static Pen CreatePen(Color color, double thickness) {\n    Pen pen;\n    var brush = ColorBrushes.GetBrush(color);\n    pen = new Pen(brush, thickness);\n\n    if (brush.CanFreeze) {\n      brush.Freeze();\n    }\n\n    if (pen.CanFreeze) {\n      pen.Freeze();\n    }\n\n    return pen;\n  }\n\n  private static Pen CreateDashedPen(Color color, DashStyle dashStyle, double thickness) {\n    var brush = ColorBrushes.GetBrush(color);\n\n    var pen = new Pen(brush, thickness) {\n      DashStyle = dashStyle\n    };\n\n    if (brush.CanFreeze) {\n      brush.Freeze();\n    }\n\n    if (pen.CanFreeze) {\n      pen.Freeze();\n    }\n\n    return pen;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/ColorUtils.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI;\n\npublic static class ColorUtils {\n  public static readonly string[] PastelColors = {\n    \"#f4a3a3\",\n    \"#dabdce\",\n    \"#ebacd6\",\n    \"#fcb89b\",\n    \"#dbbcbe\",\n    \"#fbd397\",\n    \"#b6c9e1\",\n    \"#cbeea3\",\n    \"#abe6b1\",\n    \"#d3d5c2\",\n    \"#b9d9d7\",\n    \"#b1d0dc\",\n    \"#b1e6c2\",\n    \"#daedaa\",\n    \"#dcdab6\",\n    \"#b5b5ed\",\n    \"#d3b8df\",\n    \"#ceb9de\",\n    \"#eed3af\"\n  };\n  public static readonly string[] LightPastelColors = {\n    \"#fed7d7\",\n    \"#f0e4eb\",\n    \"#f7ddee\",\n    \"#fee2d6\",\n    \"#f1e4e5\",\n    \"#fee2d6\",\n    \"#e1e9f3\",\n    \"#e8f9db\",\n    \"#dff6df\",\n    \"#edeee6\",\n    \"#e4f0f1\",\n    \"#e6eeee\",\n    \"#dff5e6\",\n    \"#f0f8dc\",\n    \"#f1f0e3\",\n    \"#dde6f7\",\n    \"#e4e2f2\",\n    \"#ede2f2\",\n    \"#f8eddc\"\n  };\n  private static Color[] cachedLightPastelColors_;\n  private static Color[] cachedPastelColors_;\n  private static Brush[] cachedPastelBrushes_;\n  private static Brush[] cachedLightPastelBrushes_;\n\n  static ColorUtils() {\n    cachedLightPastelColors_ = new Color[LightPastelColors.Length];\n    cachedPastelColors_ = new Color[PastelColors.Length];\n    cachedLightPastelBrushes_ = new Brush[LightPastelColors.Length];\n    cachedPastelBrushes_ = new Brush[PastelColors.Length];\n\n    for (int i = 0; i < LightPastelColors.Length; i++) {\n      cachedLightPastelColors_[i] = Utils.ColorFromString(LightPastelColors[i]);\n    }\n\n    for (int i = 0; i < PastelColors.Length; i++) {\n      cachedPastelColors_[i] = Utils.ColorFromString(PastelColors[i]);\n    }\n\n    for (int i = 0; i < LightPastelColors.Length; i++) {\n      cachedLightPastelBrushes_[i] = ColorBrushes.GetBrush(cachedLightPastelColors_[i]);\n    }\n\n    for (int i = 0; i < PastelColors.Length; i++) {\n      cachedPastelBrushes_[i] = ColorBrushes.GetBrush(cachedPastelColors_[i]);\n    }\n  }\n\n  public static Color AdjustSaturation(Color color, float saturationAdjustment = 2f) {\n    RGBToHSL(color, out float h, out float s, out float l);\n    s = Math.Clamp(s * saturationAdjustment, 0, 1);\n    l = Math.Clamp(l * 0.5f, 0, 1);\n    return HSLToRGB(h, s, l);\n  }\n\n  public static Color AdjustLight(Color color, float lightAdjustment) {\n    RGBToHSL(color, out float h, out float s, out float l);\n    l = Math.Clamp(l * lightAdjustment, 0, 1);\n    return HSLToRGB(h, s, l);\n  }\n\n  public static List<Color> MakeColorPalette(float hue, float saturation,\n                                             float minLight, float maxLight, int lightSteps) {\n    float rangeStep = (maxLight - minLight) / lightSteps;\n    var colors = new List<Color>();\n\n    for (float light = minLight; light <= maxLight; light += rangeStep) {\n      colors.Add(HSLToRGB(hue, saturation, light));\n    }\n\n    return colors;\n  }\n\n  public static Color GenerateRandomPastelColor() {\n    return cachedPastelColors_[new Random().Next(PastelColors.Length)];\n  }\n\n  public static Color GeneratePastelColor(uint id) {\n    return cachedPastelColors_[id % PastelColors.Length];\n  }\n\n  public static Color GenerateRandomLightPastelColor() {\n    return cachedLightPastelColors_[new Random().Next(LightPastelColors.Length)];\n  }\n\n  public static Color GenerateLightPastelColor(uint id) {\n    return cachedLightPastelColors_[id % LightPastelColors.Length];\n  }\n\n  public static Brush GenerateRandomPastelBrush() {\n    return cachedPastelBrushes_[new Random().Next(PastelColors.Length)];\n  }\n\n  public static Brush GeneratePastelBrush(uint id) {\n    return cachedPastelBrushes_[id % PastelColors.Length];\n  }\n\n  public static Brush GenerateRandomLightPastelBrush() {\n    return cachedLightPastelBrushes_[new Random().Next(LightPastelColors.Length)];\n  }\n\n  public static Brush GenerateLightPastelBrush(uint id) {\n    return cachedLightPastelBrushes_[id % LightPastelColors.Length];\n  }\n\n  public static Color HSLToRGB(float h, float s, float l) {\n    float r, g, b;\n\n    if (Math.Abs(s) < double.Epsilon) {\n      r = g = b = l; // achromatic\n    }\n    else {\n      float q = l < 0.5f ? l * (1 + s) : l + s - l * s;\n      float p = 2 * l - q;\n      r = HueToRGB(p, q, h + 1f / 3f);\n      g = HueToRGB(p, q, h);\n      b = HueToRGB(p, q, h - 1f / 3f);\n    }\n\n    return Color.FromRgb(To255(r), To255(g), To255(b));\n  }\n\n  private static void RGBToHSL(Color color, out float h, out float s, out float l) {\n    float r = color.R / 255f;\n    float g = color.G / 255f;\n    float b = color.B / 255f;\n    float max = r > g && r > b ? r : g > b ? g : b;\n    float min = r < g && r < b ? r : g < b ? g : b;\n    l = (max + min) / 2.0f;\n\n    if (Math.Abs(max - min) < double.Epsilon) {\n      h = s = 0.0f;\n    }\n    else {\n      float d = max - min;\n      s = l > 0.5f ? d / (2.0f - max - min) : d / (max + min);\n\n      if (r > g && r > b) {\n        h = (g - b) / d + (g < b ? 6.0f : 0.0f);\n      }\n      else if (g > b) {\n        h = (b - r) / d + 2.0f;\n      }\n      else {\n        h = (r - g) / d + 4.0f;\n      }\n\n      h /= 6.0f;\n    }\n  }\n\n  private static byte To255(float v) {\n    return (byte)Math.Min(255, 256 * v);\n  }\n\n  private static float HueToRGB(float p, float q, float t) {\n    if (t < 0f) {\n      t += 1f;\n    }\n\n    if (t > 1f) {\n      t -= 1f;\n    }\n\n    if (t < 1f / 6f) {\n      return p + (q - p) * 6f * t;\n    }\n\n    if (t < 1f / 2f) {\n      return q;\n    }\n\n    if (t < 2f / 3f) {\n      return p + (q - p) * (2f / 3f - t) * 6f;\n    }\n\n    return p;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/Converters.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Document;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.CallTree;\n\nnamespace ProfileExplorer.UI;\n\npublic class FontFamilyConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    try {\n      return new FontFamily((string)value);\n    }\n    catch (Exception) {\n      return null;\n    }\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return ((FontFamily)value)?.Source;\n  }\n}\n\npublic class ColorPaletteConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    try {\n      return ColorPalette.GetPalette((string)value);\n    }\n    catch (Exception) {\n      return null;\n    }\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return ((ColorPalette)value)?.Name;\n  }\n}\n\npublic class ListToStringConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    var sb = new StringBuilder();\n    bool first = true;\n\n    if (value is List<string> list) {\n      foreach (string line in list) {\n        if (!first) {\n          sb.AppendLine();\n        }\n        else {\n          first = false;\n        }\n\n        sb.Append(line);\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    var list = new List<string>();\n\n    if (value is string text) {\n      string[] lines = text.SplitLinesRemoveEmpty();\n      list.AddRange(lines);\n    }\n\n    return list;\n  }\n}\n\npublic class ListPairToStringConverter : IValueConverter {\n  private static char[] SPLIT_CHARS = {'=', ':'};\n\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    var sb = new StringBuilder();\n    bool first = true;\n\n    if (value is List<(string Variable, string Value)> dict) {\n      foreach (var pair in dict) {\n        if (!first) {\n          sb.AppendLine();\n        }\n        else {\n          first = false;\n        }\n\n        sb.Append($\"{pair.Variable}={pair.Value}\");\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    var dict = new List<(string Variable, string Value)>();\n\n    if (value is string text) {\n      string[] lines = text.SplitLinesRemoveEmpty();\n\n      foreach (string line in lines) {\n        int splitIndex = line.IndexOfAny(SPLIT_CHARS);\n\n        if (splitIndex > 0) {\n          string namePart = line.Substring(0, splitIndex).Trim();\n          string valuePart = \"\";\n\n          if (splitIndex + 1 < line.Length) {\n            valuePart = line.Substring(splitIndex + 1).Trim();\n          }\n\n          if (!string.IsNullOrEmpty(namePart)) {\n            dict.Add((namePart, valuePart));\n          }\n        }\n      }\n    }\n\n    return dict;\n  }\n}\n\npublic class DictionaryToStringConverter : IValueConverter {\n  private static char[] SPLIT_CHARS = {'=', ':'};\n\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    var sb = new StringBuilder();\n    bool first = true;\n\n    if (value is Dictionary<string, string> dict) {\n      foreach (var pair in dict) {\n        if (!first) {\n          sb.AppendLine();\n        }\n        else {\n          first = false;\n        }\n\n        sb.Append($\"{pair.Key}={pair.Value}\");\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    var dict = new Dictionary<string, string>();\n\n    if (value is string text) {\n      string[] lines = text.SplitLinesRemoveEmpty();\n\n      foreach (string line in lines) {\n        int splitIndex = line.IndexOfAny(SPLIT_CHARS);\n\n        if (splitIndex > 0) {\n          string namePart = line.Substring(0, splitIndex).Trim();\n          string valuePart = \"\";\n\n          if (splitIndex + 1 < line.Length) {\n            valuePart = line.Substring(splitIndex + 1).Trim();\n          }\n\n          if (!string.IsNullOrEmpty(namePart)) {\n            dict[namePart] = valuePart;\n          }\n        }\n      }\n    }\n\n    return dict;\n  }\n}\n\npublic class PerformanceCounterListConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    var sb = new StringBuilder();\n    bool first = true;\n\n    if (value is List<PerformanceCounterConfig> list) {\n      foreach (var line in list) {\n        if (!first) {\n          sb.AppendLine();\n        }\n        else {\n          first = false;\n        }\n\n        sb.Append($\"{line.Name}, Id {line.Id}\");\n      }\n    }\n\n    return sb.ToString();\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\npublic class ProfileCallTreeNodeKindConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value is ProfileCallTreeNodeKind kind) {\n      if (parameter is bool flag and true) {\n        return kind switch {\n          ProfileCallTreeNodeKind.NativeUser   => \"U\",\n          ProfileCallTreeNodeKind.NativeKernel => \"K\",\n          ProfileCallTreeNodeKind.Managed      => \"M\",\n          _                                    => \"\"\n        };\n      }\n\n      return kind switch {\n        ProfileCallTreeNodeKind.NativeUser   => \"User mode execution context\",\n        ProfileCallTreeNodeKind.NativeKernel => \"Kernel mode execution context\",\n        ProfileCallTreeNodeKind.Managed      => \"Managed (.NET) execution context\",\n        _                                    => \"\"\n      };\n    }\n\n    return null;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass BooleanConverter<T> : IValueConverter {\n  public BooleanConverter(T trueValue, T falseValue) {\n    True = trueValue;\n    False = falseValue;\n  }\n\n  public T True { get; set; }\n  public T False { get; set; }\n\n  public virtual object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    return value is bool && (bool)value ? True : False;\n  }\n\n  public virtual object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return value is T && EqualityComparer<T>.Default.Equals((T)value, True);\n  }\n}\n\nclass InvertedBooleanConverter : BooleanConverter<bool> {\n  public InvertedBooleanConverter() :\n    base(false, true) {\n  }\n}\n\nclass BoolToVisibilityConverter : BooleanConverter<Visibility> {\n  public BoolToVisibilityConverter() :\n    base(Visibility.Visible, Visibility.Collapsed) {\n  }\n}\n\nclass EnumBooleanConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    return value != null && value.Equals(parameter);\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return value != null && (bool)value ? parameter : Binding.DoNothing;\n  }\n}\n\nclass BoolToParameterConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value != null && (bool)value) {\n      return new SolidColorBrush(Utils.ColorFromString((string)parameter));\n    }\n\n    return null;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass DoubleScalingConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value == null) {\n      return 0.0;\n    }\n\n    double doubleValue = (double)value;\n\n    if (doubleValue == 0.0 || Math.Abs(doubleValue) < double.Epsilon) {\n      return 0.0;\n    }\n\n    double maxValue = double.Parse((string)parameter, CultureInfo.InvariantCulture);\n    return doubleValue * maxValue;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value == null) {\n      return 0.0;\n    }\n\n    double doubleValue = (double)value;\n    double maxValue = double.Parse((string)parameter, CultureInfo.InvariantCulture);\n\n    if (maxValue == 0) {\n      return 0.0;\n    }\n\n    return doubleValue / maxValue;\n  }\n}\n\n// This version allows the parameter itself to be bound to another value,\n// such as the width of some UI element., which is not possible with ConverterParameter.\n// https://stackoverflow.com/a/15309844\nclass DoubleScalingBoundConverter : IMultiValueConverter {\n  public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {\n    if (values.Length < 2 || !(values[0] is double && values[1] is double)) {\n      return null;\n    }\n\n    double doubleValue = (double)values[0];\n\n    if (doubleValue == 0.0 || Math.Abs(doubleValue) < double.Epsilon) {\n      return 0.0;\n    }\n\n    double maxValue = (double)values[1];\n    return Math.Min(doubleValue * maxValue, maxValue);\n  }\n\n  public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass DoubleDiffScalingBoundConverter : IMultiValueConverter {\n  public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {\n    if (values.Length < 3 ||\n        !(values[0] is double && values[1] is double && values[2] is double)) {\n      return null;\n    }\n\n    double doubleValue1 = (double)values[0];\n    double doubleValue2 = (double)values[1];\n    double diffValue = doubleValue2 - doubleValue1;\n\n    if (diffValue == 0.0 || Math.Abs(diffValue) < double.Epsilon) {\n      return 0.0;\n    }\n\n    double maxValue = (double)values[2];\n    return Math.Min(diffValue * maxValue, maxValue);\n  }\n\n  public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass TreeViewLineConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    var item = (TreeViewItem)value;\n    var ic = ItemsControl.ItemsControlFromItemContainer(item);\n    return ic.ItemContainerGenerator.IndexFromContainer(item) == ic.Items.Count - 1;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    throw new Exception(\"The method or operation is not implemented.\");\n  }\n}\n\nclass ColorBrushOpacityConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    var brush = value as SolidColorBrush;\n    double opacity = double.Parse((string)parameter, CultureInfo.InvariantCulture);\n\n    if (brush == null) {\n      return ColorBrushes.Transparent;\n    }\n\n    return ColorBrushes.GetTransparentBrush(brush.Color, opacity);\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    throw new Exception(\"The method or operation is not implemented.\");\n  }\n}\n\nclass MillisecondTimeConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value is TimeSpan timeValue) {\n      return timeValue.AsMillisecondsString();\n    }\n\n    if (value is long longValue) {\n      return TimeSpan.FromTicks(longValue).AsMillisecondsString();\n    }\n\n    if (value is double doubleValue) {\n      return TimeSpan.FromTicks((long)doubleValue).AsMillisecondsString();\n    }\n\n    return value;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass SecondTimeConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value is TimeSpan timeValue) {\n      return timeValue.AsSecondsString();\n    }\n\n    if (value is long longValue) {\n      return TimeSpan.FromTicks(longValue).AsSecondsString();\n    }\n\n    if (value is double doubleValue) {\n      return TimeSpan.FromTicks((long)doubleValue).AsSecondsString();\n    }\n\n    return value;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass PercentageConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value is double doubleValue) {\n      return doubleValue.AsPercentageString();\n    }\n\n    return value;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass ExclusivePercentageConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value is double doubleValue) {\n      return $\"{doubleValue.AsPercentageString()} self\";\n    }\n\n    return value;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass RoundedPercentageConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (value is double doubleValue) {\n      return doubleValue.AsPercentageString(0);\n    }\n\n    return value;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\nclass AlternateRowConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    return (bool)value ? 2 : 1;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\npublic class FunctionNameConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (string.IsNullOrEmpty(value as string)) {\n      return null;\n    }\n\n    return ((string)value).TrimToLength(80);\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\npublic class LongFunctionNameConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (string.IsNullOrEmpty(value as string)) {\n      return null;\n    }\n\n    return DocumentUtils.FormatLongFunctionName((string)value);\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    return null;\n  }\n}\n\npublic class StringFormatConverter : IValueConverter {\n  public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {\n    if (parameter is string formatString) {\n      return string.Format(formatString, value);\n    }\n\n    return null;\n  }\n\n  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {\n    throw new NotImplementedException();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/DialogCenteringHelper.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Interop;\nusing ProfileExplorer.UI.OptionsPanels;\nusing Point = System.Drawing.Point;\n\nnamespace ProfileExplorer.UI;\n\n[Flags]\npublic enum SetWindowPosFlags : uint {\n  /// <summary>\n  ///   If the calling thread and the thread that owns the window are attached to different input queues,\n  ///   the system posts the request to the thread that owns the window. This prevents the calling thread\n  ///   from blocking its execution while other threads process the request.\n  /// </summary>\n  SWP_ASYNCWINDOWPOS = 0x4000,\n  /// <summary>\n  ///   Prevents generation of the WM_SYNCPAINT message.\n  /// </summary>\n  SWP_DEFERERASE = 0x2000,\n  /// <summary>\n  ///   Draws a frame (defined in the window's class description) around the window.\n  /// </summary>\n  SWP_DRAWFRAME = 0x0020,\n  /// <summary>\n  ///   Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to\n  ///   the window, even if the window's size is not being changed. If this flag is not specified,\n  ///   WM_NCCALCSIZE is sent only when the window's size is being changed.\n  /// </summary>\n  SWP_FRAMECHANGED = 0x0020,\n  /// <summary>\n  ///   Hides the window.\n  /// </summary>\n  SWP_HIDEWINDOW = 0x0080,\n  /// <summary>\n  ///   Does not activate the window. If this flag is not set, the window is activated and moved to the\n  ///   top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter\n  ///   parameter).\n  /// </summary>\n  SWP_NOACTIVATE = 0x0010,\n  /// <summary>\n  ///   Discards the entire contents of the client area. If this flag is not specified, the valid\n  ///   contents of the client area are saved and copied back into the client area after the window is\n  ///   sized or repositioned.\n  /// </summary>\n  SWP_NOCOPYBITS = 0x0100,\n  /// <summary>\n  ///   Retains the current position (ignores X and Y parameters).\n  /// </summary>\n  SWP_NOMOVE = 0x0002,\n  /// <summary>\n  ///   Does not change the owner window's position in the Z order.\n  /// </summary>\n  SWP_NOOWNERZORDER = 0x0200,\n  /// <summary>\n  ///   Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to\n  ///   the client area, the nonclient area (including the title bar and scroll bars), and any part of\n  ///   the parent window uncovered as a result of the window being moved. When this flag is set, the\n  ///   application must explicitly invalidate or redraw any parts of the window and parent window that\n  ///   need redrawing.\n  /// </summary>\n  SWP_NOREDRAW = 0x0008,\n  /// <summary>\n  ///   Same as the SWP_NOOWNERZORDER flag.\n  /// </summary>\n  SWP_NOREPOSITION = 0x0200,\n  /// <summary>\n  ///   Prevents the window from receiving the WM_WINDOWPOSCHANGING message.\n  /// </summary>\n  SWP_NOSENDCHANGING = 0x0400,\n  /// <summary>\n  ///   Retains the current size (ignores the cx and cy parameters).\n  /// </summary>\n  SWP_NOSIZE = 0x0001,\n  /// <summary>\n  ///   Retains the current Z order (ignores the hWndInsertAfter parameter).\n  /// </summary>\n  SWP_NOZORDER = 0x0004,\n  /// <summary>\n  ///   Displays the window.\n  /// </summary>\n  SWP_SHOWWINDOW = 0x0040,\n  TOPMOST_FLAGS = SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING\n}\n\n// Code based on answer from https://stackoverflow.com/a/15369563\npublic class DialogCenteringHelper : IDisposable {\n  public delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);\n\n  /// <summary>\n  ///   Special window handles\n  /// </summary>\n  public enum SpecialWindowHandles {\n    /// <summary>\n    ///   Places the window at the top of the Z order.\n    /// </summary>\n    HWND_TOP = 0,\n    /// <summary>\n    ///   Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost\n    ///   window, the window loses its topmost status and is placed at the bottom of all other windows.\n    /// </summary>\n    HWND_BOTTOM = 1,\n    /// <summary>\n    ///   Places the window above all non-topmost windows. The window maintains its topmost position even\n    ///   when it is deactivated.\n    /// </summary>\n    HWND_TOPMOST = -1,\n    /// <summary>\n    ///   Places the window above all non-topmost windows (that is, behind all topmost windows). This flag\n    ///   has no effect if the window is already a non-topmost window.\n    /// </summary>\n    HWND_NOTOPMOST = -2\n  }\n\n  private const int WH_CALLWNDPROCRET = 12;\n  private IntPtr ownerHandle_;\n  private HookProc hookProc_;\n  private IntPtr hHook_;\n  private bool isPopup_;\n  private Popup popup_;\n\n  public DialogCenteringHelper(FrameworkElement owner) {\n    Initialize(owner);\n  }\n\n  public void Dispose() {\n    if (isPopup_) {\n      popup_.StaysOpen = false;\n    }\n\n    UnhookWindowsHookEx(hHook_);\n  }\n\n  [DllImport(\"kernel32.dll\")]\n  private static extern int GetCurrentThreadId();\n\n  [DllImport(\"user32.dll\")]\n  private static extern bool GetWindowRect(IntPtr hWnd, ref Rectangle lpRect);\n\n  [DllImport(\"user32.dll\")]\n  public static extern IntPtr SetWindowsHookEx(int idHook, HookProc lpfn, IntPtr hInstance, int threadId);\n\n  [DllImport(\"user32.dll\")]\n  public static extern IntPtr CallNextHookEx(IntPtr idHook, int nCode, IntPtr wParam, IntPtr lParam);\n\n  [DllImport(\"user32.dll\")]\n  public static extern int UnhookWindowsHookEx(IntPtr idHook);\n\n  [DllImport(\"user32.dll\")]\n  [return: MarshalAs(UnmanagedType.Bool)]\n  private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy,\n                                          SetWindowPosFlags uFlags);\n\n  private void Initialize(FrameworkElement owner) {\n    if (owner is Window window) {\n      ownerHandle_ = new WindowInteropHelper(window).Handle;\n      InitializeImpl();\n    }\n    else if (owner is Popup popup) {\n      var source = PresentationSource.FromVisual(popup.Child);\n\n      if (source == null) {\n        return; // Most likely popup closed in the meantime.\n      }\n\n      ownerHandle_ = ((HwndSource)source).Handle;\n      isPopup_ = true;\n      popup_ = popup;\n      popup_.StaysOpen = true; // Prevent popup from closing while showing message box.\n      InitializeImpl();\n    }\n    else if (owner is OptionsPanelBase optionsPanel) {\n      Initialize(optionsPanel.Parent);\n    }\n    else if (owner is UserControl panel) {\n      Initialize(Window.GetWindow(owner));\n    }\n    else {\n      throw new InvalidOperationException(\"Unexpected owner control!\");\n    }\n  }\n\n  private void InitializeImpl() {\n    hookProc_ = DialogHookProc;\n    hHook_ = SetWindowsHookEx(WH_CALLWNDPROCRET, hookProc_, IntPtr.Zero, GetCurrentThreadId());\n  }\n\n  private IntPtr DialogHookProc(int nCode, IntPtr wParam, IntPtr lParam) {\n    if (nCode < 0) {\n      return CallNextHookEx(hHook_, nCode, wParam, lParam);\n    }\n\n    var msg = (CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPRETSTRUCT));\n    IntPtr hook = hHook_;\n\n    if (msg.message == (int)CbtHookAction.HCBT_ACTIVATE) {\n      try {\n        CenterWindow(msg.hwnd);\n      }\n      finally {\n        UnhookWindowsHookEx(hHook_);\n      }\n    }\n\n    return CallNextHookEx(hook, nCode, wParam, lParam);\n  }\n\n  private void CenterWindow(IntPtr hChildWnd) {\n    var recChild = new Rectangle(0, 0, 0, 0);\n    bool success = GetWindowRect(hChildWnd, ref recChild);\n\n    if (!success) {\n      return;\n    }\n\n    int width = recChild.Width - recChild.X;\n    int height = recChild.Height - recChild.Y;\n\n    var recParent = new Rectangle(0, 0, 0, 0);\n    success = GetWindowRect(ownerHandle_, ref recParent);\n\n    if (!success) {\n      return;\n    }\n\n    var ptCenter = new Point(0, 0);\n    ptCenter.X = recParent.X + (recParent.Width - recParent.X) / 2;\n    ptCenter.Y = recParent.Y + (recParent.Height - recParent.Y) / 2;\n\n    var ptStart = new Point(0, 0);\n    ptStart.X = ptCenter.X - width / 2;\n    ptStart.Y = ptCenter.Y - height / 2;\n\n    Task.Factory.StartNew(() => {\n      if (isPopup_) {\n        // If the parent is a popup, make sure the dialog appears on top of it,\n        // since the popup is itself in topmost position.\n        SetWindowPos(hChildWnd, (IntPtr)SpecialWindowHandles.HWND_TOPMOST,\n                     ptStart.X, ptStart.Y,\n                     width, height,\n                     SetWindowPosFlags.SWP_ASYNCWINDOWPOS |\n                     SetWindowPosFlags.SWP_NOSIZE |\n                     SetWindowPosFlags.SWP_NOOWNERZORDER);\n      }\n      else {\n        SetWindowPos(hChildWnd, 0,\n                     ptStart.X, ptStart.Y,\n                     width, height,\n                     SetWindowPosFlags.SWP_ASYNCWINDOWPOS |\n                     SetWindowPosFlags.SWP_NOSIZE |\n                     SetWindowPosFlags.SWP_NOZORDER |\n                     SetWindowPosFlags.SWP_NOOWNERZORDER);\n      }\n    });\n  }\n\n  private enum CbtHookAction {\n    HCBT_MOVESIZE = 0,\n    HCBT_MINMAX = 1,\n    HCBT_QS = 2,\n    HCBT_CREATEWND = 3,\n    HCBT_DESTROYWND = 4,\n    HCBT_ACTIVATE = 5,\n    HCBT_CLICKSKIPPED = 6,\n    HCBT_KEYSKIPPED = 7,\n    HCBT_SYSCOMMAND = 8,\n    HCBT_SETFOCUS = 9\n  }\n\n  [StructLayout(LayoutKind.Sequential)]\n  public struct CWPRETSTRUCT {\n    public IntPtr lResult;\n    public IntPtr lParam;\n    public IntPtr wParam;\n    public uint message;\n    public IntPtr hwnd;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/GridViewColumnValueSorter.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\n\nnamespace ProfileExplorer.UI;\n\npublic interface IGridViewColumnValueSorter {\n  void RegisterColumnHeader(GridViewColumnHeader header);\n  void UnregisterColumnHeader(GridViewColumnHeader header);\n}\n\npublic class GridViewColumnValueSorter<T> : IGridViewColumnValueSorter where T : Enum {\n  public delegate T ColumnFieldMappingDelegate(string columnName);\n  public delegate int ValueCompareDelegate(object x, object y, T field, ListSortDirection direction, object tag);\n  private Dictionary<T, GridViewColumnHeader> fieldColumnMap_;\n  private ColumnFieldMappingDelegate fieldMapping_;\n  private ValueCompareDelegate valueComparer_;\n  private SortAdorner sortAdorner_;\n  private GridViewColumnHeader sortColumn_;\n  private ListView listView_;\n\n  public GridViewColumnValueSorter(ListView listView, ColumnFieldMappingDelegate fieldMapping,\n                                   ValueCompareDelegate valueComparer) {\n    listView_ = listView;\n    fieldMapping_ = fieldMapping;\n    valueComparer_ = valueComparer;\n    fieldColumnMap_ = new Dictionary<T, GridViewColumnHeader>();\n\n    var gridView = listView.View as GridView;\n    Debug.Assert(gridView != null);\n\n    foreach (var column in gridView.Columns) {\n      if (column.Header is GridViewColumnHeader header) {\n        RegisterColumnHeader(header);\n      }\n    }\n  }\n\n  public void RegisterColumnHeader(GridViewColumnHeader header) {\n    header.Click += ColumnHeader_Click;\n\n    // If there is no name, the mapping is checked later\n    // since it may be an optional column.\n    if (!string.IsNullOrEmpty(header.Name)) {\n      var field = fieldMapping_(header.Name);\n      fieldColumnMap_[field] = header;\n    }\n  }\n\n  public void UnregisterColumnHeader(GridViewColumnHeader header) {\n    if (header == null) {\n      return;\n    }\n\n    if (!string.IsNullOrEmpty(header.Name)) {\n      var field = fieldMapping_(header.Name);\n      fieldColumnMap_.Remove(field);\n    }\n\n    header.Click -= ColumnHeader_Click;\n  }\n\n  public void SortByField(T field, ListSortDirection direction = ListSortDirection.Descending) {\n    if (!fieldColumnMap_.TryGetValue(field, out var column)) {\n      // Field may be associated with a column added later.\n      var gridView = listView_.View as GridView;\n\n      foreach (var gridColumn in gridView.Columns) {\n        if (gridColumn.Header is GridViewColumnHeader header &&\n            !string.IsNullOrEmpty(header.Name)) {\n          if (fieldMapping_(header.Name).Equals(field)) {\n            column = header;\n            break;\n          }\n        }\n      }\n    }\n\n    SortColumn(column, direction, field);\n  }\n\n  private void ColumnHeader_Click(object sender, RoutedEventArgs e) {\n    if (sortColumn_ != null) {\n      AdornerLayer.GetAdornerLayer(sortColumn_)?.Remove(sortAdorner_);\n    }\n\n    var sortingDirection = ListSortDirection.Descending;\n    var header = sender as GridViewColumnHeader;\n    Debug.Assert(header != null);\n    Debug.Assert(!string.IsNullOrEmpty(header.Name));\n\n    // Invert direction if the same column is clicked.\n    if (sortColumn_ == header && sortAdorner_.Direction == sortingDirection) {\n      sortingDirection = ListSortDirection.Ascending;\n    }\n\n    // Map from the column name to the enum value.\n    var sortField = fieldMapping_(header.Name);\n    SortColumn(header, sortingDirection, sortField);\n  }\n\n  private void SortColumn(GridViewColumnHeader column,\n                          ListSortDirection sortingDirection, T sortField) {\n    sortColumn_ = column;\n    sortAdorner_ = new SortAdorner(sortColumn_, sortingDirection);\n    AdornerLayer.GetAdornerLayer(sortColumn_)?.Add(sortAdorner_);\n\n    if (!(listView_.ItemsSource is ListCollectionView view)) {\n      return;\n    }\n\n    view.CustomSort = new ValueComparer(sortField, sortingDirection, valueComparer_, column.Tag);\n    listView_.Items.Refresh();\n  }\n\n  private class ValueComparer : IComparer {\n    private ValueCompareDelegate compareFunc_;\n    private ListSortDirection direction_;\n    private T sortingField_;\n    private object tag_;\n\n    public ValueComparer(T sortingField, ListSortDirection direction,\n                         ValueCompareDelegate compareFunc, object tag) {\n      sortingField_ = sortingField;\n      direction_ = direction;\n      compareFunc_ = compareFunc;\n      tag_ = tag;\n    }\n\n    public int Compare(object x, object y) {\n      return compareFunc_(x, y, sortingField_, direction_, tag_);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/MouseHoverLogic.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Threading;\n\nnamespace ProfileExplorer.UI;\n\n// Based on MouseHoverLogic from AvalonEdit, but with the option\n// of using a different hover time than the default system one.\npublic class MouseHoverLogic : IDisposable {\n  private UIElement target;\n  private TimeSpan hoverDuration;\n  private DispatcherTimer mouseHoverTimer;\n  private Point mouseHoverStartPoint;\n  private MouseEventArgs mouseHoverLastEventArgs;\n  private bool mouseHovering;\n  private bool disposed;\n\n  /// <summary>\n  ///   Creates a new instance and attaches itself to the <paramref name=\"target\" /> UIElement.\n  /// </summary>\n  public MouseHoverLogic(UIElement target) {\n    if (target == null)\n      throw new ArgumentNullException(\"target\");\n    this.target = target;\n    this.target.MouseLeave += MouseHoverLogicMouseLeave;\n    this.target.MouseMove += MouseHoverLogicMouseMove;\n    this.target.MouseEnter += MouseHoverLogicMouseEnter;\n    hoverDuration = SystemParameters.MouseHoverTime;\n  }\n\n  public MouseHoverLogic(UIElement target, TimeSpan hoverDuration) : this(target) {\n    // Override hover duration.\n    if (hoverDuration != TimeSpan.MaxValue) {\n      this.hoverDuration = hoverDuration;\n    }\n  }\n\n  /// <summary>\n  ///   Removes the MouseHover support from the target UIElement.\n  /// </summary>\n  public void Dispose() {\n    if (!disposed) {\n      target.MouseLeave -= MouseHoverLogicMouseLeave;\n      target.MouseMove -= MouseHoverLogicMouseMove;\n      target.MouseEnter -= MouseHoverLogicMouseEnter;\n    }\n\n    disposed = true;\n  }\n\n  /// <summary>\n  ///   Occurs when the mouse starts hovering over a certain location.\n  /// </summary>\n  public event EventHandler<MouseEventArgs> MouseHover;\n  /// <summary>\n  ///   Occurs when the mouse stops hovering over a certain location.\n  /// </summary>\n  public event EventHandler<MouseEventArgs> MouseHoverStopped;\n\n  /// <summary>\n  ///   Raises the <see cref=\"MouseHover\" /> event.\n  /// </summary>\n  protected virtual void OnMouseHover(MouseEventArgs e) {\n    if (MouseHover != null) {\n      MouseHover(this, e);\n    }\n  }\n\n  /// <summary>\n  ///   Raises the <see cref=\"MouseHoverStopped\" /> event.\n  /// </summary>\n  protected virtual void OnMouseHoverStopped(MouseEventArgs e) {\n    if (MouseHoverStopped != null) {\n      MouseHoverStopped(this, e);\n    }\n  }\n\n  private void MouseHoverLogicMouseMove(object sender, MouseEventArgs e) {\n    var mouseMovement = mouseHoverStartPoint - e.GetPosition(target);\n\n    if (Math.Abs(mouseMovement.X) > SystemParameters.MouseHoverWidth\n        || Math.Abs(mouseMovement.Y) > SystemParameters.MouseHoverHeight) {\n      StartHovering(e);\n    }\n    // do not set e.Handled - allow others to also handle MouseMove\n  }\n\n  private void MouseHoverLogicMouseEnter(object sender, MouseEventArgs e) {\n    StartHovering(e);\n    // do not set e.Handled - allow others to also handle MouseEnter\n  }\n\n  private void StartHovering(MouseEventArgs e) {\n    StopHovering();\n    mouseHoverStartPoint = e.GetPosition(target);\n    mouseHoverLastEventArgs = e;\n    mouseHoverTimer = new DispatcherTimer(hoverDuration, DispatcherPriority.Background, OnMouseHoverTimerElapsed,\n                                          target.Dispatcher);\n    mouseHoverTimer.Start();\n  }\n\n  private void MouseHoverLogicMouseLeave(object sender, MouseEventArgs e) {\n    StopHovering();\n    // do not set e.Handled - allow others to also handle MouseLeave\n  }\n\n  private void StopHovering() {\n    if (mouseHoverTimer != null) {\n      mouseHoverTimer.Stop();\n      mouseHoverTimer = null;\n    }\n\n    if (mouseHovering) {\n      mouseHovering = false;\n      OnMouseHoverStopped(mouseHoverLastEventArgs);\n    }\n  }\n\n  private void OnMouseHoverTimerElapsed(object sender, EventArgs e) {\n    mouseHoverTimer.Stop();\n    mouseHoverTimer = null;\n\n    mouseHovering = true;\n    OnMouseHover(mouseHoverLastEventArgs);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/PasswordHelper.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace ProfileExplorer.UI;\n\npublic static class PasswordHelper {\n  public static readonly DependencyProperty PasswordProperty =\n    DependencyProperty.RegisterAttached(\"Password\",\n                                        typeof(string), typeof(PasswordHelper),\n                                        new FrameworkPropertyMetadata(string.Empty, OnPasswordPropertyChanged));\n  public static readonly DependencyProperty AttachProperty =\n    DependencyProperty.RegisterAttached(\"Attach\",\n                                        typeof(bool), typeof(PasswordHelper), new PropertyMetadata(false, Attach));\n  private static readonly DependencyProperty IsUpdatingProperty =\n    DependencyProperty.RegisterAttached(\"IsUpdating\", typeof(bool),\n                                        typeof(PasswordHelper));\n\n  public static void SetAttach(DependencyObject dp, bool value) {\n    dp.SetValue(AttachProperty, value);\n  }\n\n  public static bool GetAttach(DependencyObject dp) {\n    return (bool)dp.GetValue(AttachProperty);\n  }\n\n  public static string GetPassword(DependencyObject dp) {\n    return (string)dp.GetValue(PasswordProperty);\n  }\n\n  public static void SetPassword(DependencyObject dp, string value) {\n    dp.SetValue(PasswordProperty, value);\n  }\n\n  private static bool GetIsUpdating(DependencyObject dp) {\n    return (bool)dp.GetValue(IsUpdatingProperty);\n  }\n\n  private static void SetIsUpdating(DependencyObject dp, bool value) {\n    dp.SetValue(IsUpdatingProperty, value);\n  }\n\n  private static void OnPasswordPropertyChanged(DependencyObject sender,\n                                                DependencyPropertyChangedEventArgs e) {\n    var passwordBox = sender as PasswordBox;\n    passwordBox.PasswordChanged -= PasswordChanged;\n\n    if (!(bool)GetIsUpdating(passwordBox)) {\n      passwordBox.Password = (string)e.NewValue;\n    }\n\n    passwordBox.PasswordChanged += PasswordChanged;\n  }\n\n  private static void Attach(DependencyObject sender,\n                             DependencyPropertyChangedEventArgs e) {\n    var passwordBox = sender as PasswordBox;\n\n    if (passwordBox == null)\n      return;\n\n    if ((bool)e.OldValue) {\n      passwordBox.PasswordChanged -= PasswordChanged;\n    }\n\n    if ((bool)e.NewValue) {\n      passwordBox.PasswordChanged += PasswordChanged;\n    }\n  }\n\n  private static void PasswordChanged(object sender, RoutedEventArgs e) {\n    var passwordBox = sender as PasswordBox;\n    SetIsUpdating(passwordBox, true);\n    SetPassword(passwordBox, passwordBox.Password);\n    SetIsUpdating(passwordBox, false);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/SortAdorner.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.ComponentModel;\nusing System.Windows;\nusing System.Windows.Documents;\nusing System.Windows.Media;\n\nnamespace ProfileExplorer.UI;\n\nclass SortAdorner : Adorner {\n  private static Geometry ascGeometry = Geometry.Parse(\"M 0 4 L 3.5 0 L 7 4 Z\");\n  private static Geometry descGeometry = Geometry.Parse(\"M 0 0 L 3.5 4 L 7 0 Z\");\n\n  public SortAdorner(UIElement element, ListSortDirection dir) : base(element) {\n    Direction = dir;\n  }\n\n  public ListSortDirection Direction { get; private set; }\n\n  protected override void OnRender(DrawingContext drawingContext) {\n    base.OnRender(drawingContext);\n\n    if (AdornedElement.RenderSize.Width < 20) {\n      return;\n    }\n\n    var transform = new TranslateTransform(AdornedElement.RenderSize.Width - 15,\n                                           (AdornedElement.RenderSize.Height - 5) / 2);\n\n    drawingContext.PushTransform(transform);\n    var geometry = ascGeometry;\n\n    if (Direction == ListSortDirection.Descending) {\n      geometry = descGeometry;\n    }\n\n    drawingContext.DrawGeometry(Brushes.Black, null, geometry);\n    drawingContext.Pop();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UI/WindowPlacement.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Interop;\nusing System.Xml;\nusing System.Xml.Serialization;\n\n// Code based on https://engy.us/blog/2010/03/08/saving-window-size-and-location-in-wpf-and-winforms/\nnamespace ProfileExplorer.UI;\n\n[Serializable]\n[StructLayout(LayoutKind.Sequential)]\npublic struct RECT {\n  public int Left;\n  public int Top;\n  public int Right;\n  public int Bottom;\n\n  public RECT(int left, int top, int right, int bottom) {\n    Left = left;\n    Top = top;\n    Right = right;\n    Bottom = bottom;\n  }\n}\n\n// POINT structure required by WINDOWPLACEMENT structure\n[Serializable]\n[StructLayout(LayoutKind.Sequential)]\npublic struct POINT {\n  public int X;\n  public int Y;\n\n  public POINT(int x, int y) {\n    X = x;\n    Y = y;\n  }\n}\n\n// WINDOWPLACEMENT stores the position, size, and state of a window\n[Serializable]\n[StructLayout(LayoutKind.Sequential)]\npublic struct WINDOWPLACEMENT {\n  public int length;\n  public int flags;\n  public int showCmd;\n  public POINT minPosition;\n  public POINT maxPosition;\n  public RECT normalPosition;\n}\n\npublic static class WindowPlacement {\n  private const int SW_SHOWNORMAL = 1;\n  private const int SW_SHOWMINIMIZED = 2;\n  private static Encoding encoding = new UTF8Encoding();\n  private static XmlSerializer serializer = new(typeof(WINDOWPLACEMENT));\n\n  [DllImport(\"user32.dll\")]\n  private static extern bool SetWindowPlacement(IntPtr hWnd, [In] ref WINDOWPLACEMENT lpwndpl);\n\n  [DllImport(\"user32.dll\")]\n  private static extern bool GetWindowPlacement(IntPtr hWnd, out WINDOWPLACEMENT lpwndpl);\n\n  public static void SetPlacement(IntPtr windowHandle, string placementXml) {\n    if (string.IsNullOrEmpty(placementXml)) {\n      return;\n    }\n\n    WINDOWPLACEMENT placement;\n    byte[] xmlBytes = encoding.GetBytes(placementXml);\n\n    try {\n      using (var memoryStream = new MemoryStream(xmlBytes)) {\n        placement = (WINDOWPLACEMENT)serializer.Deserialize(memoryStream);\n      }\n\n      placement.length = Marshal.SizeOf(typeof(WINDOWPLACEMENT));\n      placement.flags = 0;\n      placement.showCmd = placement.showCmd == SW_SHOWMINIMIZED ? SW_SHOWNORMAL : placement.showCmd;\n      SetWindowPlacement(windowHandle, ref placement);\n    }\n    catch (Exception ex) {\n      Debug.WriteLine($\"Failed to save window state: {ex}\");\n    }\n  }\n\n  public static string GetPlacement(IntPtr windowHandle) {\n    var placement = new WINDOWPLACEMENT();\n    GetWindowPlacement(windowHandle, out placement);\n\n    try {\n      using var memoryStream = new MemoryStream();\n      using var xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8);\n      serializer.Serialize(xmlTextWriter, placement);\n      byte[] xmlBytes = memoryStream.ToArray();\n      return encoding.GetString(xmlBytes);\n    }\n    catch (Exception ex) {\n      Debug.WriteLine($\"Failed to load window state: {ex}\");\n      return \"\";\n    }\n  }\n\n  public static void SetPlacement(Window window, string placementXml) {\n    SetPlacement(new WindowInteropHelper(window).Handle, placementXml);\n  }\n\n  public static string GetPlacement(Window window) {\n    return GetPlacement(new WindowInteropHelper(window).Handle);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UICollectionExtensionMethods.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing System.Windows.Data;\nusing ICSharpCode.AvalonEdit.Document;\nusing ProfileExplorer.Core.Controls;\nusing ProfileExplorer.Core.IR;\n\nnamespace ProfileExplorer.UI;\n\npublic static class UICollectionExtensionMethods {\n  public static List<T> ToList<T>(this TextSegmentCollection<T> segments) where T : TextSegment {\n    var list = new List<T>(segments.Count);\n\n    foreach (var item in segments) {\n      list.Add(item);\n    }\n\n    return list;\n  }\n\n  public static List<T> ToList<T>(this ListCollectionView view) {\n    var list = new List<T>(view.Count);\n\n    foreach (T item in view) {\n      list.Add(item);\n    }\n\n    return list;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/UIJsonUtils.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Text.Json;\nusing System.Text.Json.Serialization;\nusing System.Windows.Media;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class JsonColorConverter : JsonConverter<Color> {\n  public override Color Read(ref Utf8JsonReader reader, Type typeToConvert,\n                             JsonSerializerOptions options) {\n    return Utils.ColorFromString(reader.GetString());\n  }\n\n  public override void Write(Utf8JsonWriter writer, Color value, JsonSerializerOptions options) {\n    writer.WriteStringValue(Utils.ColorToString(value));\n  }\n}\n\npublic static class UIJsonUtils {\n  private static readonly JsonColorConverter colorConverter = new JsonColorConverter();\n  private static bool isInitialized = false;\n\n  /// <summary>\n  /// Initializes the UI-specific JSON converters by registering them with the Core JsonUtils.\n  /// This method is safe to call multiple times.\n  /// </summary>\n  public static void Initialize() {\n    if (!isInitialized) {\n      JsonUtils.RegisterConverter(colorConverter);\n      isInitialized = true;\n    }\n  }\n\n  /// <summary>\n  /// Cleans up UI-specific JSON converters by unregistering them from the Core JsonUtils.\n  /// </summary>\n  public static void Cleanup() {\n    if (isInitialized) {\n      JsonUtils.UnregisterConverter(colorConverter);\n      isInitialized = false;\n    }\n  }\n\n  // All JSON operations now delegate to the Core JsonUtils\n  public static bool SerializeToFile<T>(T data, string path) => JsonUtils.SerializeToFile(data, path);\n  public static string Serialize<T>(T data) => JsonUtils.Serialize(data);\n  public static byte[] SerializeToBytes<T>(T data) => JsonUtils.SerializeToBytes(data);\n  public static bool DeserializeFromFile<T>(string path, out T data) where T : class => JsonUtils.DeserializeFromFile(path, out data);\n  public static bool Deserialize<T>(string text, out T data) where T : class => JsonUtils.Deserialize(text, out data);\n  public static bool DeserializeFromBytes<T>(byte[] textData, out T data) where T : class => JsonUtils.DeserializeFromBytes(textData, out data);\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Utilities/Utils.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Controls.Primitives;\nusing System.Windows.Input;\nusing System.Windows.Interop;\nusing System.Windows.Media;\nusing System.Xml;\nusing ICSharpCode.AvalonEdit.Highlighting;\nusing ICSharpCode.AvalonEdit.Highlighting.Xshd;\nusing Microsoft.Win32;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.IR;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI.Controls;\nusing Xceed.Wpf.Toolkit.Core.Utilities;\nusing ProfileExplorer.Core.IR.Tags;\nusing ProfileExplorer.Core.Providers;\n\nnamespace ProfileExplorer.UI;\n\npublic static class Utils {\n  private static readonly TaskFactory TaskFactoryInstance = new(CancellationToken.None,\n                                                                TaskCreationOptions.None,\n                                                                TaskContinuationOptions.None,\n                                                                TaskScheduler.Default);\n  private static readonly string HTML_COPY_HEADER =\n    \"Version:0.9\\r\\n\" +\n    \"StartHTML:{0:0000000000}\\r\\n\" +\n    \"EndHTML:{1:0000000000}\\r\\n\" +\n    \"StartFragment:{2:0000000000}\\r\\n\" +\n    \"EndFragment:{3:0000000000}\\r\\n\";\n  private static readonly string HTML_COPY_START =\n    \"<html>\\r\\n\" +\n    \"<body>\\r\\n\" +\n    \"<!--StartFragment-->\";\n  private static readonly string HTML_COPY_END =\n    \"<!--EndFragment-->\\r\\n\" +\n    \"</body>\\r\\n\" +\n    \"</html>\";\n\n  public static TResult RunSync<TResult>(Func<Task<TResult>> func) {\n    return TaskFactoryInstance.StartNew<Task<TResult>>(func).\n      Unwrap<TResult>().GetAwaiter().GetResult();\n  }\n\n  public static void RunSync(Func<Task> func) {\n    TaskFactoryInstance.StartNew<Task>(func).Unwrap().GetAwaiter().GetResult();\n  }\n\n  public static bool IsShiftModifierActive() {\n    return (Keyboard.Modifiers & ModifierKeys.Shift) != 0;\n  }\n\n  //? TODO: This should be part of the IR NameProvider\n  public static string MakeBlockDescription(BlockIR block) {\n    if (block == null) {\n      return \"\";\n    }\n\n    if (block.HasLabel && !string.IsNullOrEmpty(block.Label.Name)) {\n      return $\"B{block.Number} ({block.Label.Name})\";\n    }\n\n    return $\"B{block.Number}\";\n  }\n\n  //? TODO: This should be part of the IR NameProvider\n  public static string MakeElementDescription(IRElement element) {\n    switch (element) {\n      case BlockIR block:\n        return MakeBlockDescription(block);\n      case InstructionIR instr: {\n        var builder = new StringBuilder();\n        bool needsComma = false;\n\n        if (instr.Destinations.Count > 0) {\n          foreach (var destOp in instr.Destinations) {\n            if (needsComma) {\n              builder.Append(\", \");\n            }\n            else {\n              needsComma = true;\n            }\n\n            builder.Append(MakeElementDescription(destOp));\n          }\n\n          builder.Append(\" = \");\n        }\n\n        builder.Append($\"{instr.OpcodeText} \");\n        needsComma = false;\n\n        foreach (var sourceOp in instr.Sources) {\n          if (needsComma) {\n            builder.Append(\", \");\n          }\n          else {\n            needsComma = true;\n          }\n\n          builder.Append(MakeElementDescription(sourceOp));\n        }\n\n        return builder.ToString();\n      }\n      case OperandIR op: {\n        string text = GetSymbolName(op);\n\n        switch (op.Kind) {\n          case OperandKind.Address:\n          case OperandKind.LabelAddress: {\n            text = $\"&{text}\";\n            break;\n          }\n          case OperandKind.Indirection: {\n            text = $\"[{MakeElementDescription(op.IndirectionBaseValue)}]\";\n            break;\n          }\n          case OperandKind.IntConstant: {\n            text = op.IntValue.ToString();\n            break;\n          }\n          case OperandKind.FloatConstant: {\n            text = op.FloatValue.ToString();\n            break;\n          }\n        }\n\n        var ssaTag = op.GetTag<ISSAValue>();\n\n        if (ssaTag != null) {\n          text += $\"<{ssaTag.DefinitionId}>\";\n        }\n\n        return text;\n      }\n      default:\n        return element.ToString();\n    }\n  }\n\n  //? TODO: This should be part of the IR NameProvider\n  public static string GetSymbolName(OperandIR op) {\n    if (op.HasName) {\n      return op.NameValue.ToString();\n    }\n\n    return \"\";\n  }\n\n  public static IHighlightingDefinition LoadSyntaxHighlightingFile(string filePath) {\n    if (string.IsNullOrEmpty(filePath)) {\n      return null; // File couldn't be loaded.\n    }\n\n    try {\n      using var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read);\n      using var reader = new XmlTextReader(stream);\n      return HighlightingLoader.Load(reader, HighlightingManager.Instance);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to load syntax file {filePath}: {ex}\");\n    }\n\n    return null;\n  }\n\n  public static void Swap<T>(ref T a, ref T b) {\n    var temp = a;\n    a = b;\n    b = temp;\n  }\n\n  public static string GetAutoSaveFilePath() {\n    string AUTO_SAVE_TEMP_FILE = \"autosave.pex\";\n    return Path.Combine(Path.GetTempPath(), AUTO_SAVE_TEMP_FILE);\n  }\n\n  public static void WaitForDebugger(bool showMessageBox = true) {\n#if DEBUG\n    if (Debugger.IsAttached) {\n      return;\n    }\n\n    if (showMessageBox) {\n      MessageBox.Show($\"Waiting for debugger PID {Environment.ProcessId}\", \"Error\",\n                      MessageBoxButton.OK, MessageBoxImage.Warning);\n    }\n\n    while (!Debugger.IsAttached) {\n      Thread.Sleep(1000);\n      Trace.TraceWarning(\".\");\n      Trace.Flush();\n    }\n\n    Debugger.Break();\n#endif\n  }\n\n  //? TODO: Replace MessageBox.Show all over the app\n  public static MessageBoxResult ShowMessageBox(string text, FrameworkElement owner) {\n    return ShowMessageBox(text, owner, MessageBoxButton.OK, MessageBoxImage.Information);\n  }\n\n  public static MessageBoxResult ShowWarningMessageBox(string text, FrameworkElement owner) {\n    return ShowMessageBox(text, owner, MessageBoxButton.OK, MessageBoxImage.Warning);\n  }\n\n  public static MessageBoxResult ShowErrorMessageBox(string text, FrameworkElement owner) {\n    return ShowMessageBox(text, owner, MessageBoxButton.OK, MessageBoxImage.Error);\n  }\n\n  public static MessageBoxResult ShowYesNoMessageBox(string text, FrameworkElement owner) {\n    return ShowMessageBox(text, owner, MessageBoxButton.YesNo, MessageBoxImage.Question);\n  }\n\n  public static MessageBoxResult ShowYesNoCancelMessageBox(string text, FrameworkElement owner) {\n    return ShowMessageBox(text, owner, MessageBoxButton.YesNoCancel, MessageBoxImage.Question);\n  }\n\n  private static MessageBoxResult ShowMessageBox(string text, FrameworkElement owner, MessageBoxButton buttons,\n                                                 MessageBoxImage image) {\n    if (owner != null) {\n      using var centerForm = new DialogCenteringHelper(owner);\n      return MessageBox.Show(Application.Current.MainWindow, text, \"Profile Explorer\", buttons, image,\n                             MessageBoxResult.OK);\n    }\n    else {\n      // Likely called from a non-UI thread, show through the Dispatcher.\n      return Application.Current.Dispatcher.Invoke(() => MessageBox.Show(Application.Current.MainWindow, text,\n                                                                         \"Profile Explorer\", buttons,\n                                                                         image, MessageBoxResult.OK));\n    }\n  }\n\n  public static bool TryDeleteFile(string path) {\n    if (!File.Exists(path)) {\n      return false;\n    }\n\n    try {\n      File.Delete(path);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to delete {path}: {ex.Message}\");\n      return false;\n    }\n\n    return true;\n  }\n\n  public static string TryGetFileName(string path) {\n    try {\n      if (string.IsNullOrEmpty(path)) {\n        return \"\";\n      }\n\n      return Path.GetFileName(path);\n    }\n    catch (Exception ex) {\n      return \"\";\n    }\n  }\n\n  public static string TryGetFileNameWithoutExtension(string path) {\n    try {\n      if (string.IsNullOrEmpty(path)) {\n        return \"\";\n      }\n\n      return Path.GetFileNameWithoutExtension(path);\n    }\n    catch (Exception ex) {\n      return \"\";\n    }\n  }\n\n  public static string TryGetDirectoryName(string path) {\n    try {\n      if (string.IsNullOrEmpty(path)) {\n        return \"\";\n      }\n\n      if (!Directory.Exists(path)) {\n        path = Path.GetDirectoryName(path);\n      }\n\n      // Remove \\ at the end.\n      if (path.EndsWith(Path.DirectorySeparatorChar) ||\n          path.EndsWith(Path.AltDirectorySeparatorChar)) {\n        path = path.Substring(0, path.Length - 1);\n      }\n\n      return path;\n    }\n    catch (Exception ex) {\n      return \"\";\n    }\n  }\n\n  public static bool ValidateFilePath(string path, AutoCompleteBox box, string fileType, FrameworkElement owner) {\n    if (!File.Exists(path)) {\n      using var centerForm = new DialogCenteringHelper(owner);\n      MessageBox.Show($\"Could not find {fileType} file {path}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n\n      box.Focus();\n      return false;\n    }\n\n    return true;\n  }\n\n  public static bool ValidateOptionalFilePath(string path, AutoCompleteBox box, string fileType,\n                                              FrameworkElement owner) {\n    if (string.IsNullOrEmpty(path)) {\n      return true;\n    }\n\n    return ValidateFilePath(path, box, fileType, owner);\n  }\n\n  public static string ShowOpenFileDialog(string filter, string defaultExt = \"*.*\", string title = \"Open\") {\n    var fileDialog = new OpenFileDialog {\n      Title = title,\n      DefaultExt = defaultExt,\n      Filter = filter\n    };\n\n    bool? result = fileDialog.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      return fileDialog.FileName;\n    }\n\n    return null;\n  }\n\n  public static bool ShowOpenFileDialog(AutoCompleteBox box, string filter, string defaultExt = \"*.*\",\n                                        string title = \"Open\") {\n    string path = ShowOpenFileDialog(filter, defaultExt, title);\n\n    if (path != null) {\n      box.Text = path;\n      return true;\n    }\n\n    return false;\n  }\n\n  public static bool ShowExecutableOpenFileDialog(AutoCompleteBox box) {\n    return ShowOpenFileDialog(box, \"Executables|*.exe|All Files|*.*\");\n  }\n\n  public static bool ShowOpenFileDialog(TextBox box, string filter, string defaultExt = \"*.*\", string title = \"Open\") {\n    string path = ShowOpenFileDialog(filter, defaultExt, title);\n\n    if (path != null) {\n      box.Text = path;\n      return true;\n    }\n\n    return false;\n  }\n\n  public static bool ShowOpenFileDialog(string filter, string defaultExt, string title,\n                                        Action<string> setOutput) {\n    string path = ShowOpenFileDialog(filter, defaultExt, title);\n\n    if (path != null) {\n      setOutput(path);\n      return true;\n    }\n\n    return false;\n  }\n\n  public static async Task<bool> ShowOpenFileDialogAsync(string filter, string defaultExt, string title,\n                                                         Func<string, Task> setOutput) {\n    string path = ShowOpenFileDialog(filter, defaultExt, title);\n\n    if (path != null) {\n      await setOutput(path);\n      return true;\n    }\n\n    return false;\n  }\n\n  public static string ShowSaveFileDialog(string filter, string defaultExt = \"*.*\", string title = \"Save\") {\n    var fileDialog = new SaveFileDialog {\n      Title = title,\n      DefaultExt = defaultExt,\n      Filter = filter\n    };\n\n    bool? result = fileDialog.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      return fileDialog.FileName;\n    }\n\n    return null;\n  }\n\n  public static string CleanupPath(string path) {\n    if (string.IsNullOrEmpty(path)) {\n      return path;\n    }\n\n    path = path.Trim();\n\n    if (path.Length >= 2 &&\n        path[0] == '\"' &&\n        path[^1] == '\"') {\n      path = path.Substring(1, path.Length - 2);\n    }\n\n    return path;\n  }\n\n  public static bool OpenExternalFile(string path, bool checkFileExists = true) {\n    if (checkFileExists && !File.Exists(path)) {\n      return false;\n    }\n\n    try {\n      var psi = new ProcessStartInfo(path) {\n        UseShellExecute = true\n      };\n\n      Process.Start(psi);\n      return true;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to open file: {path}, exception {ex.Message}\");\n      return false;\n    }\n  }\n\n  public static bool OpenURL(string path) {\n    return OpenExternalFile(path, false);\n  }\n\n  public static bool ExecuteTool(string path, string args, CancelableTask cancelableTask = null,\n                                 Dictionary<string, string> envVariables = null) {\n    return ExecuteToolWithOutput(path, args, cancelableTask, envVariables) != null;\n  }\n\n  public static string ExecuteToolWithOutput(string path, string args, CancelableTask cancelableTask = null,\n                                             Dictionary<string, string> envVariables = null) {\n    if (!File.Exists(path)) {\n      return null;\n    }\n\n    Trace.TraceInformation($\"Executing tool {path} with args {args}\");\n\n    var outputText = new StringBuilder();\n    var procInfo = new ProcessStartInfo(path) {\n      Arguments = args,\n      UseShellExecute = false,\n      CreateNoWindow = true,\n      RedirectStandardError = false,\n      RedirectStandardOutput = true\n    };\n\n    if (envVariables != null) {\n      foreach (var pair in envVariables) {\n        procInfo.EnvironmentVariables[pair.Key] = pair.Value;\n      }\n    }\n\n    try {\n      using var process = new Process {StartInfo = procInfo, EnableRaisingEvents = true};\n\n      process.OutputDataReceived += (sender, e) => {\n        outputText.AppendLine(e.Data);\n      };\n\n      process.Start();\n      process.BeginOutputReadLine();\n\n      do {\n        process.WaitForExit(100);\n\n        if (cancelableTask != null && cancelableTask.IsCanceled) {\n          Trace.TraceWarning($\"Task {ObjectTracker.Track(cancelableTask)}: Canceled\");\n          process.Kill();\n          return null;\n        }\n      } while (!process.HasExited);\n\n      process.CancelOutputRead();\n\n      if (process.ExitCode != 0) {\n        Trace.TraceError($\"Task {ObjectTracker.Track(cancelableTask)}: Failed with error code: {process.ExitCode}\");\n        Trace.TraceError($\"  Output:\\n{outputText}\");\n        return null;\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Task {ObjectTracker.Track(cancelableTask)}: Failed with exception: {ex.Message}\");\n      return null;\n    }\n\n    return outputText.ToString();\n  }\n\n  public static string DetectMSVCPath() {\n    // https://devblogs.microsoft.com/cppblog/finding-the-visual-c-compiler-tools-in-visual-studio-2017/\n    string vswherePath = @\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer\\vswhere.exe\";\n    string vswhereArgs =\n      @\"-latest -prerelease -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath\";\n\n    vswherePath = Environment.ExpandEnvironmentVariables(vswherePath);\n\n    try {\n      string vsPath = ExecuteToolWithOutput(vswherePath, vswhereArgs);\n\n      if (string.IsNullOrEmpty(vsPath)) {\n        Trace.TraceError(\"Failed to run vswhere\");\n        return null;\n      }\n\n      vsPath = vsPath.SplitLinesRemoveEmpty().First();\n      string msvcPathInfo = Path.Combine(vsPath, @\"VC\\Auxiliary\\Build\\Microsoft.VCToolsVersion.default.txt\");\n      string msvcVersion = File.ReadLines(msvcPathInfo).First();\n      return Path.Combine(vsPath, @\"VC\\Tools\\MSVC\", msvcVersion, @\"bin\\HostX64\\x64\");\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to find MSVC path: {ex.Message}\");\n    }\n\n    return null;\n  }\n\n  public static DebugFileSearchResult LocateDebugInfoFile(string imagePath, string extension) {\n    try {\n      if (!File.Exists(imagePath)) {\n        return DebugFileSearchResult.None;\n      }\n\n      string path = Path.GetDirectoryName(imagePath);\n      string imageName = Path.GetFileNameWithoutExtension(imagePath);\n      string pdbPath = Path.Combine(path, imageName) + extension;\n\n      if (File.Exists(pdbPath)) {\n        return DebugFileSearchResult.Success(pdbPath);\n      }\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed to find debug file for {imagePath}: {ex.Message}\");\n    }\n\n    return DebugFileSearchResult.None;\n  }\n\n  public static bool IsBinaryFile(string filePath) {\n    return FileHasExtension(filePath, \".exe\") ||\n           FileHasExtension(filePath, \".dll\") ||\n           FileHasExtension(filePath, \".sys\");\n  }\n\n  public static bool IsExecutableFile(string filePath) {\n    return FileHasExtension(filePath, \".exe\");\n  }\n\n  public static bool FileHasExtension(string filePath, string extension) {\n    if (string.IsNullOrEmpty(filePath)) {\n      return false;\n    }\n\n    try {\n      extension = extension.ToLowerInvariant();\n\n      if (!extension.StartsWith(\".\")) {\n        extension = $\".{extension}\";\n      }\n\n      return Path.GetExtension(filePath).ToLowerInvariant() == extension;\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed FileHasExtension for {filePath}: {ex}\");\n      return false;\n    }\n  }\n\n  public static string GetFileExtension(string filePath) {\n    if (string.IsNullOrEmpty(filePath)) {\n      return \"\";\n    }\n\n    try {\n      return Path.GetExtension(filePath);\n    }\n    catch (Exception ex) {\n      Trace.TraceError($\"Failed GetFileExtension for {filePath}: {ex}\");\n      return \"\";\n    }\n  }\n\n  public static long ComputeDirectorySize(string path, bool recursive = false) {\n    try {\n      if (!Directory.Exists(path)) {\n        return 0;\n      }\n\n      long total = 0;\n\n      foreach (string file in Directory.EnumerateFileSystemEntries(path)) {\n        if (!File.GetAttributes(file).HasFlag(FileAttributes.Directory)) {\n          total += new FileInfo(file).Length;\n        }\n        else if (recursive) {\n          total += ComputeDirectorySize(file, true);\n        }\n      }\n\n      return total;\n    }\n    catch {\n      return 0;\n    }\n  }\n\n  public static void OpenExplorerAtFile(string path) {\n    if (!File.Exists(path) && !Directory.Exists(path)) {\n      return;\n    }\n\n    try {\n      Process.Start(\"explorer.exe\", \"/select, \" + path);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to start explorer.exe for {path}: {ex.Message}\");\n    }\n  }\n\n  public static UIElement FindParentHost(UIElement control) {\n    var logicalRoot = LogicalTreeHelper.GetParent(control);\n\n    while (logicalRoot != null) {\n      if (logicalRoot is UserControl || logicalRoot is Window) {\n        break;\n      }\n\n      logicalRoot = LogicalTreeHelper.GetParent(logicalRoot);\n    }\n\n    return logicalRoot as UIElement;\n  }\n\n  public static void CloseParentMenu(UIElement control) {\n    // Close the context menu hosting the control.\n    var logicalRoot = LogicalTreeHelper.GetParent(control);\n\n    while (logicalRoot != null) {\n      if (logicalRoot is ContextMenu cmenu) {\n        cmenu.IsOpen = false;\n        break;\n      }\n\n      if (logicalRoot is Menu menu) {\n        break;\n      }\n      else if (logicalRoot is MenuItem menuItem) {\n        // Close each submenu until reaching the entry menu.\n        menuItem.IsSubmenuOpen = false;\n      }\n\n      if (logicalRoot is Popup popup) {\n        popup.IsOpen = false;\n        break;\n      }\n\n      logicalRoot = LogicalTreeHelper.GetParent(logicalRoot);\n    }\n  }\n\n  public static T FindChild<T>(DependencyObject parent, string childName = null)\n    where T : DependencyObject {\n    // Confirm parent and childName are valid.\n    if (parent == null) {\n      return null;\n    }\n\n    T foundChild = null;\n    int childrenCount = VisualTreeHelper.GetChildrenCount(parent);\n\n    for (int i = 0; i < childrenCount; i++) {\n      var child = VisualTreeHelper.GetChild(parent, i);\n\n      // If the child is not of the request child type child\n      var childType = child as T;\n\n      if (childType == null) {\n        // recursively drill down the tree\n        foundChild = FindChild<T>(child, childName);\n\n        // If the child is found, break so we do not overwrite the found child.\n        if (foundChild != null) {\n          break;\n        }\n      }\n      else if (!string.IsNullOrEmpty(childName)) {\n        // If the child's name is set for search\n        if (child is FrameworkElement frameworkElement && frameworkElement.Name == childName) {\n          // if the child's name is of the request name\n          foundChild = (T)child;\n          break;\n        }\n      }\n      else {\n        // child element found.\n        foundChild = (T)child;\n        break;\n      }\n    }\n\n    return foundChild;\n  }\n\n  public static T FindChildLogical<T>(DependencyObject parent, string childName = null)\n    where T : DependencyObject {\n    // Confirm parent and childName are valid.\n    if (parent == null) {\n      return null;\n    }\n\n    T foundChild = null;\n\n    foreach (object rawChild in LogicalTreeHelper.GetChildren(parent)) {\n      var child = rawChild as DependencyObject;\n\n      if (child == null) {\n        continue;\n      }\n\n      // If the child is not of the request child type child\n      var childType = child as T;\n\n      if (childType == null) {\n        // recursively drill down the tree\n        foundChild = FindChildLogical<T>(child, childName);\n\n        // If the child is found, break so we do not overwrite the found child.\n        if (foundChild != null) {\n          break;\n        }\n      }\n      else if (!string.IsNullOrEmpty(childName)) {\n        // If the child's name is set for search\n        if (child is FrameworkElement frameworkElement && frameworkElement.Name == childName) {\n          // if the child's name is of the request name\n          foundChild = (T)child;\n          break;\n        }\n      }\n      else {\n        // child element found.\n        foundChild = (T)child;\n        break;\n      }\n    }\n\n    return foundChild;\n  }\n\n  public static T FindParent<T>(DependencyObject child, string parentName = null)\n    where T : DependencyObject {\n    if (child == null) {\n      return null;\n    }\n\n    T foundParent = null;\n    var currentParent = VisualTreeHelper.GetParent(child);\n\n    while (currentParent != null) {\n      var element = currentParent as FrameworkElement;\n\n      if (element is T && (parentName == null || element?.Name == parentName)) {\n        foundParent = (T)currentParent;\n        break;\n      }\n\n      currentParent = VisualTreeHelper.GetParent(currentParent);\n    }\n\n    return foundParent;\n  }\n\n  public static FrameworkElement FindContextMenuParent(DependencyObject child) {\n    if (child == null) {\n      return null;\n    }\n\n    var currentParent = child;\n\n    do {\n      var element = currentParent as FrameworkElement;\n\n      if (element?.ContextMenu != null) {\n        return element;\n      }\n\n      currentParent = VisualTreeHelper.GetParent(currentParent);\n    } while (currentParent != null);\n\n    return null;\n  }\n\n  public static bool ShowContextMenu(FrameworkElement element, object dataContext) {\n    var host = FindContextMenuParent(element);\n\n    if (host != null) {\n      host.ContextMenu.DataContext = dataContext;\n      host.ContextMenu.PlacementTarget = element;\n      host.ContextMenu.IsOpen = true;\n      return true;\n    }\n\n    return false;\n  }\n\n  public static Point CoordinatesToScreen(Point point, UIElement control) {\n    var source = PresentationSource.FromVisual(control);\n\n    if (source == null) {\n      return point;\n    }\n\n    if (source.CompositionTarget != null) {\n      var transform = source.CompositionTarget.TransformFromDevice;\n      return transform.Transform(point);\n    }\n\n    return point;\n  }\n\n  public static IntPtr GetHwnd(UIElement target) {\n    var source = PresentationSource.FromVisual(target) as HwndSource;\n    return source?.Handle ?? IntPtr.Zero;\n  }\n\n  public static void BringToFront(UIElement target, double width, double height) {\n    IntPtr handle = GetHwnd(target);\n\n    if (NativeMethods.GetWindowRect(handle, out var rect)) {\n      NativeMethods.SetWindowPos(handle, NativeMethods.HWND_TOP,\n                                 rect.Left, rect.Top, (int)width, (int)height,\n                                 NativeMethods.TOPMOST_FLAGS);\n    }\n  }\n\n  public static void SetAlwaysOnTop(UIElement target, bool value, double width, double height) {\n    IntPtr handle = GetHwnd(target);\n\n    if (NativeMethods.GetWindowRect(handle, out var rect)) {\n      NativeMethods.SetWindowPos(handle,\n                                 value ? NativeMethods.HWND_TOPMOST : NativeMethods.HWND_NOTOPMOST,\n                                 rect.Left, rect.Top, (int)width, (int)height,\n                                 NativeMethods.TOPMOST_FLAGS);\n    }\n  }\n\n  public static void SendToBack(UIElement target, double width, double height) {\n    IntPtr handle = GetHwnd(target);\n\n    if (NativeMethods.GetWindowRect(handle, out var rect)) {\n      NativeMethods.SetWindowPos(handle, NativeMethods.HWND_NOTOPMOST,\n                                 rect.Left, rect.Top, (int)width, (int)height,\n                                 NativeMethods.TOPMOST_FLAGS);\n    }\n  }\n\n  public static Point CoordinatesFromScreen(Point point, UIElement control) {\n    var source = PresentationSource.FromVisual(control);\n\n    if (source == null) {\n      return point;\n    }\n\n    if (source.CompositionTarget != null) {\n      var transform = source.CompositionTarget.TransformToDevice;\n      return transform.Transform(point);\n    }\n\n    return point;\n  }\n\n  public static void PatchComboBoxStyle(ComboBox control) {\n    if (control == null) {\n      return;\n    }\n\n    var chrome = FindChild<Border>(control, \"Chrome\");\n\n    if (chrome != null) {\n      chrome.BorderBrush = null;\n    }\n  }\n\n  public static void PatchToolbarStyle(ToolBar toolbar) {\n    if (toolbar == null) {\n      return;\n    }\n\n    // Change overflow arrow color.\n    if (toolbar.Template.FindName(\"OverflowButton\", toolbar) is ToggleButton overflowButton) {\n      overflowButton.Background = Brushes.Gainsboro;\n    }\n\n    // Hide overflow arrow if not needed.\n    if (toolbar.Template.FindName(\"OverflowGrid\", toolbar) is FrameworkElement overflowGrid) {\n      overflowGrid.Visibility =\n        toolbar.HasOverflowItems ? Visibility.Visible : Visibility.Collapsed;\n    }\n\n    toolbar.SizeChanged += Control_SizeChanged;\n    toolbar.UpdateLayout();\n  }\n\n  public static void RemoveToolbarOverflowButton(ToolBar toolbar) {\n    if (toolbar == null) {\n      return;\n    }\n\n    if (toolbar.Template.FindName(\"OverflowGrid\", toolbar) is FrameworkElement overflowGrid) {\n      overflowGrid.Visibility = Visibility.Collapsed;\n    }\n\n    if (toolbar.Template.FindName(\"MainPanelBorder\", toolbar) is FrameworkElement mainPanelBorder) {\n      mainPanelBorder.Margin = new Thickness(0);\n    }\n  }\n\n  public static HighlightingStyle GetSelectedColorStyle(SelectedColorEventArgs args, Pen pen = null) {\n    return args != null ? new HighlightingStyle(args.SelectedColor, pen) : null;\n  }\n\n  public static bool IsKeyboardModifierActive() {\n    return IsControlModifierActive() || IsAltModifierActive() || IsShiftModifierActive();\n  }\n\n  public static bool IsControlModifierActive() {\n    return (Keyboard.Modifiers & ModifierKeys.Control) != 0;\n  }\n\n  public static bool IsAltModifierActive() {\n    return (Keyboard.Modifiers & ModifierKeys.Alt) != 0;\n  }\n\n  public static Color ChangeColorLuminisity(Color color, double adjustment) {\n    return Color.FromArgb(color.A, (byte)Math.Clamp(color.R * adjustment, 0, 255),\n                          (byte)Math.Clamp(color.G * adjustment, 0, 255),\n                          (byte)Math.Clamp(color.B * adjustment, 0, 255));\n  }\n\n  public static int EstimateBrightness(Color color) {\n    return (int)Math.Sqrt(\n      color.R * color.R * .241 +\n      color.G * color.G * .691 +\n      color.B * color.B * .068);\n  }\n\n  public static Color ColorFromString(string color) {\n    try {\n      return (Color)ColorConverter.ConvertFromString(color);\n    }\n    catch (Exception ex) {\n      return Colors.Transparent;\n    }\n  }\n\n  public static Brush BrushFromString(string color) {\n    return BrushFromColor(ColorFromString(color));\n  }\n\n  public static Brush BrushFromColor(Color color) {\n    return ColorBrushes.GetBrush(color);\n  }\n\n  public static string BrushToString(Brush brush) {\n    if (brush == null || !(brush is SolidColorBrush colorBrush)) {\n      return \"\";\n    }\n\n    var color = colorBrush.Color;\n    return ColorToString(color);\n  }\n\n  public static string ColorToString(Color color) {\n    return $\"#{color.R:x2}{color.G:x2}{color.B:x2}\";\n  }\n\n  public static KeyCharInfo KeyToChar(Key key) {\n    var info = new KeyCharInfo();\n    info.IsAlt = Keyboard.IsKeyDown(Key.LeftAlt) || Keyboard.IsKeyDown(Key.RightAlt);\n    info.IsControl = Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl);\n    info.IsShift = Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift);\n    info.IsLetter = !info.IsAlt && !info.IsControl;\n    bool isUpperCase = Console.CapsLock && !info.IsShift || !Console.CapsLock && info.IsShift;\n\n    switch (key) {\n      case Key.A:\n        info.Letter = isUpperCase ? 'A' : 'a';\n        break;\n      case Key.B:\n        info.Letter = isUpperCase ? 'B' : 'b';\n        break;\n      case Key.C:\n        info.Letter = isUpperCase ? 'C' : 'c';\n        break;\n      case Key.D:\n        info.Letter = isUpperCase ? 'D' : 'd';\n        break;\n      case Key.E:\n        info.Letter = isUpperCase ? 'E' : 'e';\n        break;\n      case Key.F:\n        info.Letter = isUpperCase ? 'F' : 'f';\n        break;\n      case Key.G:\n        info.Letter = isUpperCase ? 'G' : 'g';\n        break;\n      case Key.H:\n        info.Letter = isUpperCase ? 'H' : 'h';\n        break;\n      case Key.I:\n        info.Letter = isUpperCase ? 'I' : 'i';\n        break;\n      case Key.J:\n        info.Letter = isUpperCase ? 'J' : 'j';\n        break;\n      case Key.K:\n        info.Letter = isUpperCase ? 'K' : 'k';\n        break;\n      case Key.L:\n        info.Letter = isUpperCase ? 'L' : 'l';\n        break;\n      case Key.M:\n        info.Letter = isUpperCase ? 'M' : 'm';\n        break;\n      case Key.N:\n        info.Letter = isUpperCase ? 'N' : 'n';\n        break;\n      case Key.O:\n        info.Letter = isUpperCase ? 'O' : 'o';\n        break;\n      case Key.P:\n        info.Letter = isUpperCase ? 'P' : 'p';\n        break;\n      case Key.Q:\n        info.Letter = isUpperCase ? 'Q' : 'q';\n        break;\n      case Key.R:\n        info.Letter = isUpperCase ? 'R' : 'r';\n        break;\n      case Key.S:\n        info.Letter = isUpperCase ? 'S' : 's';\n        break;\n      case Key.T:\n        info.Letter = isUpperCase ? 'T' : 't';\n        break;\n      case Key.U:\n        info.Letter = isUpperCase ? 'U' : 'u';\n        break;\n      case Key.V:\n        info.Letter = isUpperCase ? 'V' : 'v';\n        break;\n      case Key.W:\n        info.Letter = isUpperCase ? 'W' : 'w';\n        break;\n      case Key.X:\n        info.Letter = isUpperCase ? 'X' : 'x';\n        break;\n      case Key.Y:\n        info.Letter = isUpperCase ? 'Y' : 'y';\n        break;\n      case Key.Z:\n        info.Letter = isUpperCase ? 'Z' : 'z';\n        break;\n      case Key.D0:\n        info.Letter = info.IsShift ? ')' : '0';\n        break;\n      case Key.D1:\n        info.Letter = info.IsShift ? '!' : '1';\n        break;\n      case Key.D2:\n        info.Letter = info.IsShift ? '@' : '2';\n        break;\n      case Key.D3:\n        info.Letter = info.IsShift ? '#' : '3';\n        break;\n      case Key.D4:\n        info.Letter = info.IsShift ? '$' : '4';\n        break;\n      case Key.D5:\n        info.Letter = info.IsShift ? '%' : '5';\n        break;\n      case Key.D6:\n        info.Letter = info.IsShift ? '^' : '6';\n        break;\n      case Key.D7:\n        info.Letter = info.IsShift ? '&' : '7';\n        break;\n      case Key.D8:\n        info.Letter = info.IsShift ? '*' : '8';\n        break;\n      case Key.D9:\n        info.Letter = info.IsShift ? '(' : '9';\n        break;\n      case Key.OemPlus:\n        info.Letter = info.IsShift ? '+' : '=';\n        break;\n      case Key.OemMinus:\n        info.Letter = info.IsShift ? '_' : '-';\n        break;\n      case Key.OemQuestion:\n        info.Letter = info.IsShift ? '?' : '/';\n        break;\n      case Key.OemComma:\n        info.Letter = info.IsShift ? '<' : ',';\n        break;\n      case Key.OemPeriod:\n        info.Letter = info.IsShift ? '>' : '.';\n        break;\n      case Key.OemOpenBrackets:\n        info.Letter = info.IsShift ? '{' : '[';\n        break;\n      case Key.OemQuotes:\n        info.Letter = info.IsShift ? '\"' : '\\'';\n        break;\n      case Key.Oem1:\n        info.Letter = info.IsShift ? ':' : ';';\n        break;\n      case Key.Oem3:\n        info.Letter = info.IsShift ? '~' : '`';\n        break;\n      case Key.Oem5:\n        info.Letter = info.IsShift ? '|' : '\\\\';\n        break;\n      case Key.Oem6:\n        info.Letter = info.IsShift ? '}' : ']';\n        break;\n      case Key.Space:\n        info.Letter = ' ';\n        break;\n      case Key.Tab:\n        info.Letter = '\\t';\n        break;\n      case Key.NumPad0:\n        info.Letter = '0';\n        break;\n      case Key.NumPad1:\n        info.Letter = '1';\n        break;\n      case Key.NumPad2:\n        info.Letter = '2';\n        break;\n      case Key.NumPad3:\n        info.Letter = '3';\n        break;\n      case Key.NumPad4:\n        info.Letter = '4';\n        break;\n      case Key.NumPad5:\n        info.Letter = '5';\n        break;\n      case Key.NumPad6:\n        info.Letter = '6';\n        break;\n      case Key.NumPad7:\n        info.Letter = '7';\n        break;\n      case Key.NumPad8:\n        info.Letter = '8';\n        break;\n      case Key.NumPad9:\n        info.Letter = '9';\n        break;\n      case Key.Subtract:\n        info.Letter = '-';\n        break;\n      case Key.Add:\n        info.Letter = '+';\n        break;\n      case Key.Decimal:\n        info.Letter = '.';\n        break;\n      case Key.Divide:\n        info.Letter = '/';\n        break;\n      case Key.Multiply:\n        info.Letter = '*';\n        break;\n      default: {\n        info.IsLetter = false;\n        info.Letter = '\\x00';\n        break;\n      }\n    }\n\n    return info;\n  }\n\n  public static void EnableControl(UIElement control, double opacity = 1.0) {\n    control.IsEnabled = true;\n    control.IsHitTestVisible = true;\n    control.Focusable = true;\n    control.Opacity = opacity;\n  }\n\n  public static void DisableControl(UIElement control, double opacity = 1.0) {\n    control.IsEnabled = false;\n    control.IsHitTestVisible = false;\n    control.Focusable = false;\n    control.Opacity = opacity;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static double SnapToPixels(double value) {\n    return Math.Round(value);\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static Point SnapToPixels(Point point) {\n    return new Point(Math.Round(point.X), Math.Round(point.Y));\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static Rect SnapToPixels(Rect rect) {\n    return new Rect(Math.Round(rect.X), Math.Round(rect.Y), Math.Round(rect.Width), Math.Round(rect.Height));\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static Rect SnapRectToPixels(Rect rect, double adjustX, double adjustY, double adjustWidth,\n                                      double adjustHeight) {\n    return new Rect(Math.Round(rect.X + adjustX), Math.Round(rect.Y + adjustY),\n                    Math.Round(rect.Width + adjustWidth), Math.Round(rect.Height + adjustHeight));\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static Rect SnapRectToPixels(double x, double y, double width, double height) {\n    return new Rect(Math.Round(x), Math.Round(y), Math.Round(width), Math.Round(height));\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static Point SnapPointToPixels(double x, double y) {\n    return new Point(Math.Round(x), Math.Round(y));\n  }\n\n  public static void UpdateMaxMenuItemWidth(string title, ref double maxWidth, MenuItem targetMenu) {\n    double width = MeasureString(title, targetMenu).Width + 20;\n    maxWidth = Math.Max(width, maxWidth);\n  }\n\n  public static Size MeasureString(string text, Control targetControl) {\n    var font = new Typeface(targetControl.FontFamily, targetControl.FontStyle,\n                            targetControl.FontWeight, targetControl.FontStretch);\n    return MeasureString(text, font, targetControl.FontSize);\n  }\n\n  public static Size MeasureString(string text, string fontName, double fontSize,\n                                   FontWeight? fontWeight = null) {\n    var font = new Typeface(new FontFamily(fontName), FontStyles.Normal,\n                            fontWeight ?? FontWeights.Normal, FontStretches.Normal);\n    return MeasureString(text, font, fontSize);\n  }\n\n  public static Size MeasureString(string text, Typeface font, double fontSize) {\n    var formattedText = new FormattedText(text, CultureInfo.CurrentCulture,\n                                          FlowDirection.LeftToRight, font, fontSize, Brushes.Black,\n                                          new NumberSubstitution(), 1);\n    return new Size(formattedText.WidthIncludingTrailingWhitespace, formattedText.Height);\n  }\n\n  public static Size MeasureString(int letterCount, string fontName, double fontSize,\n                                   FontWeight? fontWeight = null) {\n    string dummyString = new('X', letterCount);\n    return MeasureString(dummyString, fontName, fontSize, fontWeight);\n  }\n\n  public static Size MeasureString(int letterCount, Typeface font, double fontSize) {\n    if (letterCount == 1) {\n      return MeasureString(\"X\", font, fontSize);\n    }\n\n    string dummyString = new('X', letterCount);\n    return MeasureString(dummyString, font, fontSize);\n  }\n\n  public static void SelectEditableListViewItem(ListView listView, int index) {\n    listView.SelectedItem = null;\n    listView.SelectedIndex = index;\n    listView.UpdateLayout(); // Force the ListView to generate the containers.\n    var item = listView.ItemContainerGenerator.ContainerFromIndex(index) as ListViewItem;\n\n    if (item != null) {\n      var textBox = FindChild<TextBox>(item);\n\n      if (textBox != null) {\n        textBox.Focus();\n        textBox.SelectAll();\n        Keyboard.Focus(textBox);\n      }\n    }\n  }\n\n  public static ListViewItem FindPointedListViewItem(ListView listView) {\n    var mousePosition = Mouse.GetPosition(listView);\n    var result = listView.GetObjectAtPoint<ListViewItem>(mousePosition);\n    return result;\n  }\n\n  public static void SelectTextBoxListViewItem(TextBox textBox, ListView listView) {\n    if (textBox.IsKeyboardFocused) {\n      return;\n    }\n\n    textBox.Focus();\n    FocusParentListViewItem(textBox, listView);\n  }\n\n  public static void SelectTextBoxListViewItem(FileSystemTextBox textBox, ListView listView) {\n    if (textBox.IsKeyboardFocused) {\n      return;\n    }\n\n    textBox.Focus();\n    FocusParentListViewItem(textBox, listView);\n  }\n\n  public static ListViewItem FocusParentListViewItem(Control control, ListView listView) {\n    // Try to move selection to the item in the list view.\n    var listViewItem = VisualTreeHelperEx.FindAncestorByType<ListViewItem>(control);\n\n    if (listViewItem != null) {\n      listView.SelectedItem = null;\n      listViewItem.IsSelected = true;\n    }\n\n    return listViewItem;\n  }\n\n  private static void Control_SizeChanged(object sender, SizeChangedEventArgs e) {\n    if (!(sender is ToolBar toolbar)) {\n      return;\n    }\n\n    if (toolbar.Template.FindName(\"OverflowGrid\", toolbar) is FrameworkElement overflowGrid) {\n      overflowGrid.Visibility =\n        toolbar.HasOverflowItems ? Visibility.Visible : Visibility.Collapsed;\n    }\n  }\n\n  public static void ScrollToFirstListViewItem(ListView listView, int itemIndex = 0) {\n    // Based on https://stackoverflow.com/a/211984.\n    // This is a hack to scroll to an item in a ListView.\n    if (listView.Items.Count > 0) {\n      var vsp =\n        (VirtualizingStackPanel)typeof(ItemsControl).InvokeMember(\"_itemsHost\",\n                                                                  BindingFlags.Instance | BindingFlags.GetField |\n                                                                  BindingFlags.NonPublic, null,\n                                                                  listView, null);\n\n      if (vsp != null) {\n        double scrollHeight = vsp.ScrollOwner.ScrollableHeight;\n        double offset = scrollHeight * itemIndex / listView.Items.Count;\n        vsp.SetVerticalOffset(offset);\n      }\n    }\n  }\n\n  public static bool EventSourceIsTextBox(MouseButtonEventArgs e) {\n    return e.OriginalSource.GetType().Name == \"TextBoxView\";\n  }\n\n  public static bool IsOptionsUpdateEvent(MouseButtonEventArgs e) {\n    string sourceName = e.OriginalSource.GetType().Name;\n    return IsOptionsUpdateEvent(sourceName);\n  }\n\n  public static bool IsOptionsUpdateEvent(KeyEventArgs e) {\n    string sourceName = e.OriginalSource.GetType().Name;\n    return IsOptionsUpdateEvent(sourceName);\n  }\n\n  private static bool IsOptionsUpdateEvent(string sourceName) {\n    return sourceName != \"Button\" &&\n           sourceName != \"ToggleButton\" &&\n           sourceName != \"TextBox\" &&\n           sourceName != \"TextBoxView\" &&\n           sourceName != \"TextBlock\";\n  }\n\n  public static Typeface GetTextTypeface(Control element) {\n    return new Typeface(element.FontFamily, element.FontStyle,\n                        element.FontWeight, element.FontStretch);\n  }\n\n  public static void CopyHtmlToClipboard(string html, string text = null) {\n    try {\n      var dataObject = new DataObject();\n      dataObject.SetData(DataFormats.Html, ConvertHtmlToClipboardFormat(html));\n\n      if (!string.IsNullOrEmpty(text)) {\n        dataObject.SetData(DataFormats.Text, text);\n      }\n\n      Clipboard.SetDataObject(dataObject);\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to copy HTML to clipboard: {ex.Message}\");\n    }\n  }\n\n  public static string ConvertHtmlToClipboardFormat(string html) {\n    var encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false);\n    byte[] data = Array.Empty<byte>();\n    byte[] header = encoding.GetBytes(string.Format(HTML_COPY_HEADER, 0, 1, 2, 3));\n    data = data.Concat(header).ToArray();\n\n    int startHtml = data.Length;\n    data = data.Concat(encoding.GetBytes(HTML_COPY_START)).ToArray();\n\n    int startFragment = data.Length;\n    data = data.Concat(encoding.GetBytes(html)).ToArray();\n    int endFragment = data.Length;\n    data = data.Concat(encoding.GetBytes(HTML_COPY_END)).ToArray();\n\n    int endHtml = data.Length;\n    byte[] newHeader = encoding.GetBytes(\n      string.Format(HTML_COPY_HEADER, startHtml, endHtml, startFragment, endFragment));\n    Array.Copy(newHeader, data, startHtml);\n    return encoding.GetString(data);\n  }\n\n  public static string RemovePathQuotes(string text) {\n    if (string.IsNullOrEmpty(text)) {\n      return text;\n    }\n\n    return text.Trim('\\\"');\n  }\n\n  public struct KeyCharInfo {\n    public bool IsLetter;\n    public char Letter;\n    public bool IsShift;\n    public bool IsControl;\n    public bool IsAlt;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/AboutWindow.xaml",
    "content": "﻿<Window\n  x:Class=\"ProfileExplorer.UI.AboutWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  Title=\"About\"\n  Width=\"500\"\n  Height=\"200\"\n  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n  ResizeMode=\"NoResize\"\n  SizeToContent=\"Height\"\n  WindowStartupLocation=\"CenterOwner\"\n  WindowStyle=\"ToolWindow\"\n  mc:Ignorable=\"d\">\n  <Grid>\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n\n    <StackPanel Margin=\"10,10,10,0\">\n      <StackPanel\n        VerticalAlignment=\"Top\"\n        DockPanel.Dock=\"Left\"\n        Orientation=\"Horizontal\">\n        <Image\n          Width=\"32\"\n          Height=\"32\"\n          Source=\"{StaticResource LogoImage}\" />\n        <TextBlock\n          Margin=\"8,0,0,0\"\n          VerticalAlignment=\"Center\"\n          FontSize=\"20\"\n          FontWeight=\"Normal\"\n          Text=\"Profile Explorer\" />\n      </StackPanel>\n\n      <TextBlock\n        Margin=\"0,12,0,0\"\n        Text=\"{Binding CopyrightText}\" />\n      <TextBlock\n        Margin=\"0,2,0,0\"\n        Text=\"{Binding VersionText}\" />\n      <TextBlock\n        Margin=\"0,8,0,0\"\n        Cursor=\"Hand\"\n        Foreground=\"DarkBlue\">\n        <Hyperlink\n          NavigateUri=\"https://github.com/microsoft/profile-explorer\"\n          RequestNavigate=\"Hyperlink_RequestNavigate\">\n          Web site\n        </Hyperlink>\n      </TextBlock>\n      <TextBlock\n        Cursor=\"Hand\"\n        Foreground=\"DarkBlue\">\n        <Hyperlink\n          NavigateUri=\"https://privacy.microsoft.com/en-us/privacystatement\"\n          RequestNavigate=\"Hyperlink_RequestNavigate\">\n          Privacy statement\n        </Hyperlink>\n      </TextBlock>\n      <Expander\n        Margin=\"0,16,0,16\"\n        Header=\"Third party notices\">\n        <TextBox\n          Margin=\"0,8,0,0\"\n          MaxLines=\"20\"\n          Text=\"{Binding LicenseText, Mode=OneWay}\"\n          TextWrapping=\"Wrap\"\n          VerticalScrollBarVisibility=\"Auto\" />\n      </Expander>\n    </StackPanel>\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/AboutWindow.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.Reflection;\nusing System.Windows;\nusing System.Windows.Navigation;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class AboutWindow : Window {\n  public AboutWindow() {\n    InitializeComponent();\n    DataContext = this;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public string CopyrightText => $\"Copyright (c) {DateTime.Now.Year} Microsoft Corporation\";\n  public string VersionText => $\"Version {Assembly.GetExecutingAssembly()?.GetName()?.Version}\";\n  public string LicenseText => App.GetLicenseText();\n\n  private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) {\n    Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri) {\n      UseShellExecute = true\n    });\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/DiffOpenWindow.xaml",
    "content": "﻿<Window\n  x:Class=\"ProfileExplorer.UI.DiffOpenWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  Title=\"Select side-by-side diff files\"\n  Width=\"500\"\n  Height=\"180\"\n  MinWidth=\"400\"\n  Loaded=\"Window_Loaded\"\n  ResizeMode=\"CanResizeWithGrip\"\n  ShowInTaskbar=\"False\"\n  WindowStartupLocation=\"CenterOwner\"\n  WindowStyle=\"ToolWindow\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"38\" />\n    </Grid.RowDefinitions>\n    <Grid.ColumnDefinitions>\n      <ColumnDefinition Width=\"115\" />\n      <ColumnDefinition />\n    </Grid.ColumnDefinitions>\n\n    <StackPanel\n      Grid.Row=\"0\"\n      Grid.Column=\"0\"\n      Grid.ColumnSpan=\"2\">\n      <TextBlock\n        Margin=\"16,8,16,0\"\n        Text=\"Base file path (left side)\" />\n      <Grid Margin=\"16,4,16,0\">\n        <controls:FileSystemTextBox\n          x:Name=\"BaseAutocompleteBox\"\n          Height=\"22\"\n          Margin=\"0,0,48,0\"\n          HorizontalAlignment=\"Stretch\"\n          BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n          FilterMode=\"StartsWithOrdinal\"\n          MinimumPrefixLength=\"1\" />\n\n        <Button\n          x:Name=\"BaseBrowseButton\"\n          Height=\"22\"\n          Padding=\"2,2,2,2\"\n          HorizontalAlignment=\"Right\"\n          Click=\"BaseBrowseButton_Click\"\n          Content=\"Browse\" />\n      </Grid>\n\n      <TextBlock\n        Margin=\"16,8,16,0\"\n        Text=\"Diff file path (right side)\" />\n      <Grid Margin=\"16,4,16,0\">\n        <controls:FileSystemTextBox\n          x:Name=\"DiffAutocompleteBox\"\n          Height=\"22\"\n          Margin=\"0,0,48,0\"\n          HorizontalAlignment=\"Stretch\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n          FilterMode=\"StartsWithOrdinal\"\n          IsDropDownOpen=\"True\"\n          IsTextCompletionEnabled=\"False\"\n          MinimumPrefixLength=\"1\" />\n\n        <Button\n          x:Name=\"DiffBrowseButton\"\n          Height=\"22\"\n          Padding=\"2,2,2,2\"\n          HorizontalAlignment=\"Right\"\n          Click=\"DiffBrowseButton_Click\"\n          Content=\"Browse\" />\n      </Grid>\n    </StackPanel>\n\n\n    <StackPanel\n      Grid.Row=\"1\"\n      Grid.Column=\"0\"\n      Width=\"80\"\n      Margin=\"16,4,0,8\"\n      HorizontalAlignment=\"Left\"\n      Orientation=\"Horizontal\">\n      <Button\n        x:Name=\"RecentButton\"\n        Width=\"80\"\n        Height=\"24\"\n        Padding=\"4,0,4,0\"\n        Click=\"RecentButton_Click\"\n        Content=\"Recent Files\">\n        <Button.ContextMenu>\n          <ContextMenu />\n        </Button.ContextMenu>\n      </Button>\n    </StackPanel>\n\n    <StackPanel\n      Grid.Row=\"1\"\n      Grid.Column=\"1\"\n      Width=\"115\"\n      Margin=\"0,4,16,8\"\n      HorizontalAlignment=\"Right\"\n      Orientation=\"Horizontal\">\n      <Button\n        x:Name=\"CancelButton\"\n        Height=\"24\"\n        Margin=\"0,0,4,0\"\n        Padding=\"4,0,4,0\"\n        Click=\"CancelButton_Click\"\n        Content=\"Cancel\"\n        IsCancel=\"True\" />\n      <Button\n        x:Name=\"UpdateButton\"\n        Height=\"24\"\n        Padding=\"4,0,4,0\"\n        Background=\"#FFFCF4CC\"\n        Click=\"UpdateButton_Click\"\n        Content=\"Open Files\" />\n    </StackPanel>\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/DiffOpenWindow.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Windows;\nusing System.Windows.Controls;\nusing Microsoft.Win32;\nusing ProfileExplorer.Core.Session;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class DiffOpenWindow : Window {\n  public DiffOpenWindow(ISession session) {\n    Session = session;\n    InitializeComponent();\n    DataContext = this;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public ISession Session { get; set; }\n  public string BaseFilePath { get; set; }\n  public string DiffFilePath { get; set; }\n\n  private void UpdateButton_Click(object sender, RoutedEventArgs e) {\n    BaseFilePath = BaseAutocompleteBox.Text.Trim();\n    DiffFilePath = DiffAutocompleteBox.Text.Trim();\n    OpenFiles();\n  }\n\n  private void OpenFiles() {\n    if (Utils.ValidateFilePath(BaseFilePath, BaseAutocompleteBox, \"base\", this) &&\n        Utils.ValidateFilePath(DiffFilePath, DiffAutocompleteBox, \"diff\", this)) {\n      App.Settings.AddRecentComparedFiles(BaseFilePath, DiffFilePath);\n      App.SaveApplicationSettings();\n\n      DialogResult = true;\n      Close();\n    }\n  }\n\n  private void CancelButton_Click(object sender, RoutedEventArgs e) {\n    DialogResult = false;\n    Close();\n  }\n\n  private void RecentButton_Click(object sender, RoutedEventArgs e) {\n    var menu = RecentButton.ContextMenu;\n    menu.Items.Clear();\n\n    foreach (var pathPair in App.Settings.RecentComparedFiles) {\n      var item = new MenuItem();\n      item.Header = $\"Base: {pathPair.Item1}\\nDiff: {pathPair.Item2}\";\n      item.Tag = pathPair;\n      item.Click += RecentMenuItem_Click;\n      menu.Items.Add(item);\n      menu.Items.Add(new Separator());\n    }\n\n    var clearMenuItem = new MenuItem {\n      Header = \"Clear\"\n    };\n\n    clearMenuItem.Click += RecentMenuItem_Click;\n    menu.Items.Add(clearMenuItem);\n    menu.IsOpen = true;\n  }\n\n  private void RecentMenuItem_Click(object sender, RoutedEventArgs e) {\n    RecentButton.ContextMenu.IsOpen = false;\n    var menuItem = sender as MenuItem;\n\n    if (menuItem.Tag == null) {\n      App.Settings.ClearRecentComparedFiles();\n    }\n    else {\n      var pathPair = menuItem.Tag as Tuple<string, string>;\n      BaseFilePath = pathPair.Item1;\n      DiffFilePath = pathPair.Item2;\n      OpenFiles();\n    }\n  }\n\n  private void Window_Loaded(object sender, RoutedEventArgs e) {\n    BaseAutocompleteBox.Focus();\n  }\n\n  private void BaseBrowseButton_Click(object sender, RoutedEventArgs e) {\n    string path = ShowOpenFileDialog();\n\n    if (path != null) {\n      BaseAutocompleteBox.Text = path;\n    }\n  }\n\n  private void DiffBrowseButton_Click(object sender, RoutedEventArgs e) {\n    string path = ShowOpenFileDialog();\n\n    if (path != null) {\n      DiffAutocompleteBox.Text = path;\n    }\n  }\n\n  private string ShowOpenFileDialog() {\n    var fileDialog = new OpenFileDialog {\n      DefaultExt = \"*.*\",\n      Filter = Session.CompilerInfo.OpenFileFilter\n    };\n\n    bool? result = fileDialog.ShowDialog();\n\n    if (result.HasValue && result.Value) {\n      return fileDialog.FileName;\n    }\n\n    return null;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/OptionsWindow.xaml",
    "content": "﻿<Window\n  x:Class=\"ProfileExplorer.UI.OptionsWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:options=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  Title=\"Settings\"\n  Width=\"750\"\n  Height=\"600\"\n  MinWidth=\"400\"\n  MinHeight=\"300\"\n  ResizeMode=\"CanResize\"\n  ShowInTaskbar=\"False\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  WindowStartupLocation=\"CenterOwner\"\n  WindowStyle=\"ToolWindow\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"32\" />\n    </Grid.RowDefinitions>\n\n    <TabControl\n      Grid.Row=\"0\"\n      Margin=\"4,0,0,4\"\n      Padding=\"20,0,0,0\"\n      Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n      BorderThickness=\"0\"\n      IsSynchronizedWithCurrentItem=\"True\"\n      SelectedIndex=\"0\"\n      TabStripPlacement=\"Left\">\n      <TabItem\n        Header=\"General\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:GeneralOptionsPanel\n            x:Name=\"GeneralOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Symbols\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:SymbolOptionsPanel\n            x:Name=\"SymbolOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Profile Marking\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:FunctionMarkingOptionsPanel\n            x:Name=\"FunctionMarkingOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Assembly Code\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:DocumentOptionsPanel\n            x:Name=\"DocumentOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Source File\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:SourceFileOptionsPanel\n            x:Name=\"SourceFileOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Summary\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:SectionOptionsPanel\n            x:Name=\"SummaryOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Flame Graph\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:FlameGraphOptionsPanel\n            x:Name=\"FlameGraphOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Timeline\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:TimelineOptionsPanel\n            x:Name=\"TimelineOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Call Tree\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:CallTreeOptionsPanel\n            x:Name=\"CallTreeOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Caller/Callee\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:CallTreeOptionsPanel\n            x:Name=\"CallerCalleeOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n\n      <TabItem\n        Header=\"Flow Graph\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:FlowGraphOptionsPanel\n            x:Name=\"GraphOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Expression Graph\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:ExpressionGraphOptionsPanel\n            x:Name=\"ExpressionGraphOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <TabItem\n        Header=\"Preview Popup\"\n        Style=\"{StaticResource TabControlStyle}\">\n        <ScrollViewer\n          HorizontalScrollBarVisibility=\"Disabled\"\n          VerticalScrollBarVisibility=\"Auto\">\n          <options:PreviewPopupOptionsPanel\n            x:Name=\"PreviewPopupOptionsPanel\"\n            Width=\"Auto\"\n            Height=\"Auto\"\n            HorizontalAlignment=\"Stretch\"\n            VerticalAlignment=\"Stretch\" />\n        </ScrollViewer>\n      </TabItem>\n      <!-- <TabItem -->\n      <!--   Header=\"Diffing\" -->\n      <!--   Style=\"{StaticResource TabControlStyle}\"> -->\n      <!--   <ScrollViewer -->\n      <!--     HorizontalScrollBarVisibility=\"Disabled\" -->\n      <!--     VerticalScrollBarVisibility=\"Auto\"> -->\n      <!--     <options:DiffOptionsPanel -->\n      <!--       x:Name=\"DiffOptionsPanel\" -->\n      <!--       Width=\"Auto\" -->\n      <!--       Height=\"Auto\" -->\n      <!--       HorizontalAlignment=\"Stretch\" -->\n      <!--       VerticalAlignment=\"Stretch\" /> -->\n      <!--   </ScrollViewer> -->\n      <!-- </TabItem> -->\n    </TabControl>\n\n    <Grid\n      Grid.Row=\"1\"\n      Margin=\"8,4,8,4\">\n      <Grid.ColumnDefinitions>\n        <ColumnDefinition Width=\"70\" />\n        <ColumnDefinition Width=\"*\" />\n        <ColumnDefinition Width=\"50\" />\n        <ColumnDefinition Width=\"50\" />\n      </Grid.ColumnDefinitions>\n\n      <StackPanel\n        Grid.ColumnSpan=\"2\"\n        Orientation=\"Horizontal\">\n        <Button\n          x:Name=\"ResetButton\"\n          Height=\"24\"\n          Padding=\"4,2,4,2\"\n          HorizontalContentAlignment=\"Left\"\n          Click=\"ResetButton_OnClick\"\n          ToolTip=\"Reset all settings to their default values\">\n          <StackPanel Orientation=\"Horizontal\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource UndoIcon}\" />\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              Text=\"Reset\" />\n          </StackPanel>\n        </Button>\n        <Button\n          x:Name=\"ImportButton\"\n          Height=\"24\"\n          Margin=\"2,0,0,0\"\n          Padding=\"4,2,4,2\"\n          HorizontalContentAlignment=\"Left\"\n          Click=\"ImportButton_OnClick\"\n          ToolTip=\"Import all settings from an exported ZIP file\">\n          <StackPanel Orientation=\"Horizontal\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource FolderIcon}\" />\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              Text=\"Import\" />\n          </StackPanel>\n        </Button>\n        <Button\n          x:Name=\"ExportButton\"\n          Height=\"24\"\n          Margin=\"2,0,0,0\"\n          Padding=\"4,2,4,2\"\n          HorizontalContentAlignment=\"Left\"\n          Click=\"ExportButton_OnClick\"\n          ToolTip=\"Export all settings to a ZIP file\">\n          <StackPanel Orientation=\"Horizontal\">\n            <Image\n              Width=\"16\"\n              Height=\"16\"\n              Source=\"{StaticResource SaveIcon}\" />\n            <TextBlock\n              Margin=\"4,0,0,0\"\n              Text=\"Export\" />\n          </StackPanel>\n        </Button>\n      </StackPanel>\n      <Button\n        x:Name=\"ApplyButton\"\n        Grid.Column=\"2\"\n        Height=\"24\"\n        Margin=\"0,0,4,0\"\n        VerticalAlignment=\"Top\"\n        BorderThickness=\"1,1,1,1\"\n        Click=\"ApplyButton_OnClick\"\n        Content=\"Apply\" />\n      <Button\n        x:Name=\"CloseButton\"\n        Grid.Column=\"3\"\n        Height=\"24\"\n        VerticalAlignment=\"Top\"\n        BorderThickness=\"1,1,1,1\"\n        Click=\"CloseButton_OnClick\"\n        Content=\"Close\" />\n    </Grid>\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/OptionsWindow.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Threading.Tasks;\nusing System.Windows;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class OptionsWindow : Window {\n  public OptionsWindow(IUISession session) {\n    InitializeComponent();\n    DataContext = this;\n    Session = session;\n    LoadSettings();\n\n    Closing += async (sender, args) => {\n      await SaveAndReloadSettings();\n    };\n  }\n\n  public IUISession Session { get; set; }\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  private void LoadSettings() {\n    GeneralOptionsPanel.Initialize(this, App.Settings.GeneralSettings, Session);\n    SymbolOptionsPanel.Initialize(this, App.Settings.SymbolSettings, Session);\n    SummaryOptionsPanel.Initialize(this, App.Settings.SectionSettings, Session);\n    DocumentOptionsPanel.Initialize(this, App.Settings.DocumentSettings, Session);\n    GraphOptionsPanel.Initialize(this, App.Settings.FlowGraphSettings, Session);\n    ExpressionGraphOptionsPanel.Initialize(this, App.Settings.ExpressionGraphSettings, Session);\n    // DiffOptionsPanel.Initialize(this, App.Settings.DiffSettings, Session);\n    TimelineOptionsPanel.Initialize(this, App.Settings.TimelineSettings, Session);\n    FlameGraphOptionsPanel.Initialize(this, App.Settings.FlameGraphSettings, Session);\n    CallTreeOptionsPanel.Initialize(this, App.Settings.CallTreeSettings, Session);\n    CallerCalleeOptionsPanel.Initialize(this, App.Settings.CallerCalleeSettings, Session);\n    SourceFileOptionsPanel.Initialize(this, App.Settings.SourceFileSettings, Session);\n    PreviewPopupOptionsPanel.Initialize(this, App.Settings.PreviewPopupSettings, Session);\n    FunctionMarkingOptionsPanel.Initialize(this, App.Settings.MarkingSettings, Session);\n  }\n\n  private async Task SaveAndReloadSettings() {\n    App.SaveApplicationSettings();\n    await Session.ReloadSettings();\n  }\n\n  private async void CloseButton_OnClick(object sender, RoutedEventArgs e) {\n    DialogResult = true;\n    Close();\n  }\n\n  private async void ApplyButton_OnClick(object sender, RoutedEventArgs e) {\n    await SaveAndReloadSettings();\n  }\n\n  private async void ResetButton_OnClick(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Do you want to reset all settings to their default values?\", this) ==\n        MessageBoxResult.Yes) {\n      App.Settings.Reset();\n      LoadSettings();\n      await SaveAndReloadSettings();\n    }\n  }\n\n  private void ExportButton_OnClick(object sender, RoutedEventArgs e) {\n    string path = Utils.ShowSaveFileDialog(\"ZIP archive|*.zip\", \"*.zip\", \"Export settings\");\n\n    if (!string.IsNullOrEmpty(path)) {\n      App.CloseLogFile();\n\n      if (!App.Settings.SaveToArchive(path)) {\n        Utils.ShowErrorMessageBox(\"Failed to export settings.\", this);\n      }\n\n      App.OpenLogFile();\n    }\n  }\n\n  private void ImportButton_OnClick(object sender, RoutedEventArgs e) {\n    string path = Utils.ShowOpenFileDialog(\"ZIP archive|*.zip\", \"*.zip\", \"Import settings\");\n\n    if (!string.IsNullOrEmpty(path)) {\n      if (Utils.ShowYesNoMessageBox(\n            \"Do you want to import new settings?\\nAll existing settings will be lost and application will restart.\",\n            this) ==\n          MessageBoxResult.No) {\n        return;\n      }\n\n      App.CloseLogFile();\n\n      if (App.Settings.LoadFromArchive(path)) {\n        App.Restart();\n      }\n      else {\n        Utils.ShowErrorMessageBox(\"Failed to import settings.\", this);\n      }\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/ProfileLoadWindow.xaml",
    "content": "﻿<Window\n  x:Class=\"ProfileExplorer.UI.ProfileLoadWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:controls=\"clr-namespace:ProfileExplorer.UI.Controls\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:local=\"clr-namespace:ProfileExplorer.UI\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:optionsPanels=\"clr-namespace:ProfileExplorer.UI.OptionsPanels\"\n  xmlns:profile=\"clr-namespace:ProfileExplorer.UI.Profile\"\n  xmlns:profileData=\"clr-namespace:ProfileExplorer.Core.Profile.Data;assembly=ProfileExplorerCore\"\n  xmlns:xctk=\"clr-namespace:Xceed.Wpf.Toolkit;assembly=DotNetProjects.Wpf.Extended.Toolkit\"\n  Title=\"Load profile trace\"\n  Width=\"900\"\n  Height=\"600\"\n  MinWidth=\"600\"\n  MinHeight=\"400\"\n  d:DesignHeight=\"1200\"\n  ResizeMode=\"CanResizeWithGrip\"\n  ShowInTaskbar=\"False\"\n  WindowStartupLocation=\"CenterOwner\"\n  WindowStyle=\"ToolWindow\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n\n    <DockPanel>\n      <Grid\n        Width=\"250\"\n        DockPanel.Dock=\"Left\">\n        <ListBox\n          x:Name=\"SessionList\"\n          HorizontalAlignment=\"Stretch\"\n          VerticalAlignment=\"Stretch\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n          IsEnabled=\"{Binding ProcessListEnabled}\"\n          IsTextSearchEnabled=\"True\"\n          ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n          SelectionChanged=\"SessionList_SelectionChanged\"\n          SelectionMode=\"Single\"\n          TextSearch.TextPath=\"Title\">\n\n          <ListBox.ItemTemplate>\n            <DataTemplate>\n              <DockPanel\n                HorizontalAlignment=\"Stretch\"\n                ToolTip=\"{Binding ToolTip}\">\n                <StackPanel\n                  MaxWidth=\"190\"\n                  DockPanel.Dock=\"Left\">\n                  <TextBlock\n                    HorizontalAlignment=\"Stretch\"\n                    FontWeight=\"Medium\"\n                    Text=\"{Binding Title}\"\n                    TextTrimming=\"CharacterEllipsis\" />\n                  <TextBlock\n                    HorizontalAlignment=\"Stretch\"\n                    Text=\"{Binding Description}\"\n                    TextTrimming=\"CharacterEllipsis\"\n                    Visibility=\"{Binding ShowDescription, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                  <TextBlock\n                    Text=\"{Binding Time}\"\n                    Visibility=\"{Binding IsNewSession, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n\n                </StackPanel>\n                <StackPanel\n                  Margin=\"2,0,0,0\"\n                  HorizontalAlignment=\"Right\"\n                  DockPanel.Dock=\"Right\"\n                  Orientation=\"Horizontal\">\n                  <StackPanel.Style>\n                    <Style TargetType=\"{x:Type StackPanel}\">\n                      <Setter Property=\"Visibility\"\n                              Value=\"{Binding IsNewSession, Converter={StaticResource InvertedBoolToVisibilityConverter}}\" />\n                      <Style.Triggers>\n                        <DataTrigger\n                          Binding=\"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsMouseOver}\"\n                          Value=\"False\">\n                          <Setter Property=\"Visibility\" Value=\"Collapsed\" />\n                        </DataTrigger>\n                      </Style.Triggers>\n                    </Style>\n                  </StackPanel.Style>\n\n                  <Button\n                    Name=\"SessionReportButton\"\n                    Width=\"20\"\n                    Height=\"20\"\n                    Padding=\"1\"\n                    Background=\"Transparent\"\n                    BorderThickness=\"0\"\n                    Click=\"SessionReportButton_Click\"\n                    ToolTip=\"Open session report\">\n                    <Image\n                      Height=\"16\"\n                      Source=\"{StaticResource WindowIcon}\" />\n                  </Button>\n                  <Button\n                    Name=\"SessionRemoveButton\"\n                    Width=\"20\"\n                    Height=\"20\"\n                    Padding=\"1\"\n                    Background=\"Transparent\"\n                    BorderThickness=\"0\"\n                    Click=\"SessionRemoveButton_Click\"\n                    ToolTip=\"Remove session from history\">\n                    <Image\n                      Height=\"16\"\n                      Source=\"{StaticResource ClearIcon}\" />\n                  </Button>\n                </StackPanel>\n              </DockPanel>\n            </DataTemplate>\n          </ListBox.ItemTemplate>\n          <ListBox.ItemContainerStyle>\n            <Style TargetType=\"ListBoxItem\">\n              <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n              <EventSetter\n                Event=\"MouseDoubleClick\"\n                Handler=\"SessionList_MouseDoubleClick\" />\n\n              <Style.Triggers>\n                <DataTrigger\n                  Binding=\"{Binding Path=IsNewSession}\"\n                  Value=\"True\">\n                  <Setter Property=\"Foreground\" Value=\"MediumBlue\" />\n                </DataTrigger>\n              </Style.Triggers>\n            </Style>\n          </ListBox.ItemContainerStyle>\n        </ListBox>\n      </Grid>\n        <TabControl\n          VerticalAlignment=\"Stretch\"\n          Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n          BorderThickness=\"0\"\n          DockPanel.Dock=\"Right\">\n          <TabItem\n            Header=\"Session\"\n            Style=\"{StaticResource TabControlStyle}\">\n            <DockPanel>\n              <StackPanel\n                x:Name=\"ProfileCapturePanel\"\n                DockPanel.Dock=\"Top\"\n                Visibility=\"{Binding IsRecordMode, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <TextBlock\n                  Margin=\"8,6,8,0\"\n                  FontWeight=\"Medium\"\n                  Text=\"Profiling target\" />\n\n                <RadioButton\n                  x:Name=\"StartAppRadioButton\"\n                  Margin=\"8,6,8,0\"\n                  Content=\"Start application\"\n                  IsChecked=\"{Binding RecordingOptions.SessionKind, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static profileData:ProfileSessionKind.StartProcess}}\"\n                  IsEnabled=\"{Binding InputControlsEnabled}\"\n                  ToolTip=\"Start a new process and record only its profile\" />\n                <RadioButton\n                  x:Name=\"AttachRadioButton\"\n                  Margin=\"8,6,8,0\"\n                  Click=\"AttachRadioButton_Click\"\n                  Content=\"Attach to process\"\n                  IsChecked=\"{Binding RecordingOptions.SessionKind, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static profileData:ProfileSessionKind.AttachToProcess}}\"\n                  IsEnabled=\"{Binding InputControlsEnabled}\"\n                  ToolTip=\"Attach and profile an already running process\" />\n                <RadioButton\n                  x:Name=\"SystemWideRadioButton\"\n                  Margin=\"8,4,8,0\"\n                  Click=\"SystemWideRadioButton_Click\"\n                  Content=\"System-wide\"\n                  IsChecked=\"{Binding RecordingOptions.SessionKind, Converter={StaticResource EnumToBoolConverter}, ConverterParameter={x:Static profileData:ProfileSessionKind.SystemWide}}\"\n                  IsEnabled=\"{Binding InputControlsEnabled}\"\n                  ToolTip=\"Profiles all applications running on the current machine\" />\n                <Separator\n                  Margin=\"0,8,0,8\"\n                  Background=\"LightGray\" />\n\n                <StackPanel\n                  x:Name=\"AttachToProcessPanel\"\n                  Visibility=\"{Binding ElementName=AttachRadioButton, Path=IsChecked, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <Grid\n                    Height=\"24\"\n                    MinHeight=\"24\"\n                    Margin=\"8,4,8,4\">\n                    <CheckBox\n                      Margin=\"0,0,60,0\"\n                      HorizontalAlignment=\"Right\"\n                      VerticalAlignment=\"Center\"\n                      Content=\"Only .NET\"\n                      IsChecked=\"{Binding ShowOnlyManagedProcesses}\"\n                      ToolTip=\"Show only managed processes using .NET\" />\n                    <Button\n                      x:Name=\"RefreshProcessButton\"\n                      Height=\"22\"\n                      Padding=\"4,2,4,2\"\n                      HorizontalAlignment=\"Right\"\n                      Click=\"RefreshProcessButton_OnClick\"\n                      Content=\"Refresh\"\n                      IsEnabled=\"{Binding InputControlsEnabled}\"\n                      ToolTip=\"Refresh running process list\" />\n                    <StackPanel\n                      HorizontalAlignment=\"Left\"\n                      VerticalAlignment=\"Top\"\n                      DockPanel.Dock=\"Right\"\n                      Orientation=\"Horizontal\">\n                      <Image\n                        Height=\"16\"\n                        Source=\"{StaticResource SearchIcon}\" />\n                      <Grid\n                        x:Name=\"ProcessFilterGrid\"\n                        Height=\"24\">\n                        <TextBox\n                          Name=\"ProcessFilter\"\n                          Width=\"250\"\n                          Height=\"24\"\n                          MaxWidth=\"300\"\n                          Margin=\"4,0,0,0\"\n                          HorizontalAlignment=\"Stretch\"\n                          VerticalAlignment=\"Center\"\n                          VerticalContentAlignment=\"Center\"\n                          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                          TextChanged=\"ProcessFilter_TextChanged\"\n                          ToolTip=\"Filter processes list based on a case-insensitive substring\">\n                          <TextBox.InputBindings>\n                            <KeyBinding\n                              Key=\"Escape\"\n                              Command=\"local:Command.ClearTextbox\"\n                              CommandParameter=\"{Binding ElementName=ProcessFilter}\" />\n                          </TextBox.InputBindings>\n\n                        </TextBox>\n                        <TextBlock\n                          Margin=\"8,4\"\n                          Foreground=\"DimGray\"\n                          IsHitTestVisible=\"False\"\n                          Text=\"Search processes by Name or Id\"\n                          Visibility=\"{Binding ElementName=ProcessFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                      </Grid>\n                    </StackPanel>\n                  </Grid>\n                  <ListView\n                    x:Name=\"RunningProcessList\"\n                    Height=\"200\"\n                    Margin=\"8,4,8,0\"\n                    VerticalAlignment=\"Stretch\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    IsEnabled=\"{Binding ProcessListEnabled}\"\n                    ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n                    SelectionChanged=\"RunningProcessList_SelectionChanged\"\n                    SelectionMode=\"Single\"\n                    TextSearch.TextPath=\"{Binding Process.Name}\"\n                    VirtualizingStackPanel.IsVirtualizing=\"True\"\n                    VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n                    <ListView.View>\n                      <GridView>\n                        <GridViewColumn\n                          Width=\"150\"\n                          DisplayMemberBinding=\"{Binding Process.Name}\">\n                          <GridViewColumnHeader Content=\"Process\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"70\"\n                          DisplayMemberBinding=\"{Binding Process.ProcessId}\">\n                          <GridViewColumnHeader Content=\"Process ID\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"100\"\n                          DisplayMemberBinding=\"{Binding Process.StartTime, StringFormat=hh:mm:ss tt}\">\n                          <GridViewColumnHeader Content=\"Start Time\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"250\"\n                          DisplayMemberBinding=\"{Binding Process.ImageFileName}\">\n                          <GridViewColumnHeader Content=\"Title\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n                      </GridView>\n                    </ListView.View>\n\n                    <ListView.ItemContainerStyle>\n                      <Style\n                        BasedOn=\"{StaticResource FlatListViewItem}\"\n                        TargetType=\"{x:Type ListViewItem}\">\n                        <Setter Property=\"Background\"\n                                Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                        <Setter Property=\"ToolTip\" Value=\"{Binding Process.CommandLine}\" />\n                        <EventSetter\n                          Event=\"MouseDoubleClick\"\n                          Handler=\"RunningProcessList_DoubleClick\" />\n                      </Style>\n                    </ListView.ItemContainerStyle>\n\n                    <ListView.ContextMenu>\n                      <ContextMenu>\n                        <MenuItem\n                          Click=\"ProcessListMenuItem_OnClick\"\n                          Header=\"Copy Process Details\" />\n                        <MenuItem\n                          Click=\"ProcessListMenuItem_OnClick\"\n                          Header=\"Copy Process List\"\n                          IsEnabled=\"False\" />\n                      </ContextMenu>\n                    </ListView.ContextMenu>\n                  </ListView>\n\n                </StackPanel>\n\n                <StackPanel\n                  x:Name=\"StartProcessPanel\"\n                  Visibility=\"{Binding ElementName=StartAppRadioButton, Path=IsChecked, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <TextBlock\n                    Margin=\"8,0,8,0\"\n                    Text=\"Application path\" />\n                  <Grid Margin=\"8,4,8,0\">\n                    <controls:FileSystemTextBox\n                      x:Name=\"ApplicationAutocompleteBox\"\n                      Height=\"22\"\n                      Margin=\"0,0,48,0\"\n                      HorizontalAlignment=\"Stretch\"\n                      BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                      FilterMode=\"StartsWithOrdinal\"\n                      IsDropDownOpen=\"True\"\n                      IsEnabled=\"{Binding InputControlsEnabled}\"\n                      IsTextCompletionEnabled=\"False\"\n                      MinimumPrefixLength=\"1\"\n                      Text=\"{Binding Path=RecordingOptions.ApplicationPath, Mode=TwoWay}\" />\n\n                    <Button\n                      x:Name=\"ApplicationBrowseButton\"\n                      Height=\"22\"\n                      Padding=\"4,2,4,2\"\n                      HorizontalAlignment=\"Right\"\n                      Click=\"ApplicationBrowseButton_Click\"\n                      Content=\"Browse\"\n                      IsEnabled=\"{Binding InputControlsEnabled}\" />\n                  </Grid>\n\n                  <TextBlock\n                    Margin=\"8,4,8,0\"\n                    Text=\"Arguments\" />\n                  <Grid Margin=\"8,4,8,0\">\n                    <TextBox\n                      Height=\"22\"\n                      Margin=\"0,0,48,0\"\n                      HorizontalAlignment=\"Stretch\"\n                      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                      BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                      IsEnabled=\"{Binding InputControlsEnabled}\"\n                      Text=\"{Binding Path=RecordingOptions.ApplicationArguments, Mode=TwoWay}\" />\n                  </Grid>\n                  <TextBlock\n                    Margin=\"8,4,8,0\"\n                    Text=\"Working directory\" />\n                  <Grid Margin=\"8,4,8,0\">\n                    <TextBox\n                      Height=\"22\"\n                      Margin=\"0,0,48,0\"\n                      HorizontalAlignment=\"Stretch\"\n                      Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                      BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                      IsEnabled=\"{Binding InputControlsEnabled}\"\n                      Text=\"{Binding Path=RecordingOptions.WorkingDirectory, Mode=TwoWay}\" />\n                  </Grid>\n\n                  <CheckBox\n                    x:Name=\"EnvironmentVarsCheckbox\"\n                    Margin=\"8,8,0,0\"\n                    Content=\"Optional environment variables (one per line, var=value format)\"\n                    IsChecked=\"{Binding Path=RecordingOptions.EnableEnvironmentVars, Mode=TwoWay}\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\" />\n                  <TextBox\n                    x:Name=\"EnvironmentVarsTextBox\"\n                    MinHeight=\"36\"\n                    Margin=\"28,4,55,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    AcceptsReturn=\"True\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    IsEnabled=\"{Binding ElementName=EnvironmentVarsCheckbox, Path=IsChecked}\"\n                    Text=\"{Binding Path=RecordingOptions.EnvironmentVariables, Mode=TwoWay, Converter={StaticResource StringListPairConverter}}\"\n                    TextWrapping=\"Wrap\" />\n\n                </StackPanel>\n\n                <Expander\n                  Margin=\"8,10,8,0\"\n                  IsEnabled=\"{Binding InputControlsEnabled}\"\n                  IsExpanded=\"True\">\n                  <Expander.Header>\n                    <TextBlock\n                      FontWeight=\"Medium\"\n                      Text=\"Recording options\" />\n                  </Expander.Header>\n                  <StackPanel>\n                    <CheckBox\n                      Margin=\"0,8,0,0\"\n                      Content=\"Profile .NET (managed) applications\"\n                      IsChecked=\"{Binding Path=RecordingOptions.ProfileDotNet, Mode=TwoWay}\"\n                      IsEnabled=\"{Binding ElementName=SystemWideRadioButton, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\"\n                      ToolTip=\"Enable support for profiling .NET applications\" />\n                    <CheckBox\n                      Margin=\"20,4,0,0\"\n                      Content=\"Record JIT output assembly\"\n                      IsChecked=\"{Binding Path=RecordingOptions.RecordDotNetAssembly, Mode=TwoWay}\"\n                      IsEnabled=\"{Binding ElementName=SystemWideRadioButton, Path=IsChecked, Converter={StaticResource InvertedBoolConverter}}\"\n                      ToolTip=\"Save the machine code produced by the JIT compiler for each function\" />\n                    <CheckBox\n                      Margin=\"0,8,0,0\"\n                      Content=\"Profile child processes\"\n                      IsChecked=\"{Binding Path=RecordingOptions.ProfileChildProcesses, Mode=TwoWay}\"\n                      ToolTip=\"Include in the trace any process created by the startup process\" />\n                    <CheckBox\n                      Margin=\"0,4,0,0\"\n                      Content=\"Record CPU performance counter (PMC) events\"\n                      IsChecked=\"{Binding Path=RecordingOptions.RecordPerformanceCounters, Mode=TwoWay}\"\n                      ToolTip=\"Collect the performance counters enabled in the CPU counters tab\" />\n\n                    <StackPanel\n                      Margin=\"0,4,0,0\"\n                      Orientation=\"Horizontal\">\n                      <TextBlock\n                        VerticalAlignment=\"Center\"\n                        Text=\"Sampling frequency\" />\n                      <Slider\n                        x:Name=\"SamplingFrequencySlider\"\n                        Width=\"120\"\n                        Margin=\"8,0,0,0\"\n                        Foreground=\"{DynamicResource DisabledForegroundBrush}\"\n                        Interval=\"1000\"\n                        IsEnabled=\"{Binding RecordingControlsEnabled}\"\n                        IsSnapToTickEnabled=\"True\"\n                        LargeChange=\"2000\"\n                        Maximum=\"8000\"\n                        Minimum=\"1000\"\n                        SmallChange=\"1000\"\n                        TickFrequency=\"1000\"\n                        TickPlacement=\"BottomRight\"\n                        ToolTip=\"Sampling profiling frequency as samples/second\"\n                        ValueChanged=\"SamplingFrequencySlider_ValueChanged\"\n                        Value=\"{Binding Path=RecordingOptions.SamplingFrequency, Mode=TwoWay}\" />\n                      <TextBlock\n                        Margin=\"8,0,0,0\"\n                        VerticalAlignment=\"Center\"\n                        Text=\"{Binding Path=RecordingOptions.SamplingFrequency}\" />\n                      <Button\n                        x:Name=\"DefaultFrequencyButton\"\n                        Height=\"22\"\n                        Margin=\"4,0,0,0\"\n                        Padding=\"4,0,4,0\"\n                        VerticalAlignment=\"Center\"\n                        Click=\"DefaultFrequencyButton_Click\"\n                        Content=\"Default\" />\n                      <Button\n                        x:Name=\"MaxFrequencyButton\"\n                        Height=\"22\"\n                        Margin=\"4,0,0,0\"\n                        Padding=\"4,0,4,0\"\n                        VerticalAlignment=\"Center\"\n                        Click=\"MaxFrequencyButton_Click\"\n                        Content=\"Max\" />\n                    </StackPanel>\n                  </StackPanel>\n                </Expander>\n\n                <Separator\n                  Margin=\"0,8,0,8\"\n                  Background=\"LightGray\" />\n                <StackPanel\n                  Margin=\"8,0,0,0\"\n                  Orientation=\"Horizontal\"\n                  Visibility=\"{Binding RequiresElevation, Converter={StaticResource BoolToVisibilityConverter}}\">\n                  <Button\n                    x:Name=\"RestartAppButton\"\n                    Height=\"22\"\n                    Padding=\"4,0,4,0\"\n                    HorizontalAlignment=\"Left\"\n                    Background=\"#FFFCF4CC\"\n                    Click=\"RestartAppButton_OnClick\"\n                    Content=\"Restart as Admin\" />\n\n                  <TextBlock\n                    Margin=\"8,0,0,0\"\n                    VerticalAlignment=\"Center\"\n                    FontWeight=\"Bold\"\n                    Text=\"Profile Explorer must run with Administrator permissions\" />\n                </StackPanel>\n\n                <Grid\n                  Visibility=\"{Binding RequiresElevation, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n                  <TextBlock\n                    Margin=\"8,0,4,0\"\n                    HorizontalAlignment=\"Left\"\n                    VerticalAlignment=\"Center\"\n                    Text=\"Session name\" />\n                  <TextBox\n                    Width=\"200\"\n                    Height=\"22\"\n                    Margin=\"88,0,0,0\"\n                    HorizontalAlignment=\"Left\"\n                    VerticalAlignment=\"Center\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\"\n                    Text=\"{Binding Path=RecordingOptions.Title, Mode=TwoWay}\"\n                    ToolTip=\"Optional session name to be used in recent session list\" />\n\n                  <StackPanel\n                    Margin=\"8,0,8,0\"\n                    HorizontalAlignment=\"Right\"\n                    Orientation=\"Horizontal\">\n                    <TextBlock\n                      x:Name=\"RecordProgressLabel\"\n                      Margin=\"0,0,8,0\"\n                      VerticalAlignment=\"Center\"\n                      Text=\"Starting recording\"\n                      Visibility=\"{Binding IsRecordingProfile, Converter={StaticResource BoolToVisibilityConverter}}\" />\n\n                    <Button\n                      x:Name=\"StopCaptureButton\"\n                      Height=\"22\"\n                      Margin=\"4,0,4,0\"\n                      Padding=\"4,0,4,0\"\n                      HorizontalAlignment=\"Left\"\n                      Click=\"StopCaptureButton_OnClick\"\n                      Content=\"Stop\"\n                      IsEnabled=\"{Binding RecordingStopControlsEnabled}\" />\n                    <Button\n                      x:Name=\"StartCaptureButton\"\n                      Height=\"22\"\n                      Padding=\"4,0,4,0\"\n                      HorizontalAlignment=\"Left\"\n                      Background=\"#FFFCF4CC\"\n                      Click=\"StartCaptureButton_OnClick\"\n                      Content=\"Start capture\"\n                      IsEnabled=\"{Binding RecordingControlsEnabled}\" />\n                  </StackPanel>\n                </Grid>\n              </StackPanel>\n\n\n              <StackPanel\n                x:Name=\"ProfileLoadPanel\"\n                DockPanel.Dock=\"Top\"\n                Visibility=\"{Binding IsRecordMode, Converter={StaticResource InvertedBoolToVisibilityConverter}}\">\n                <TextBlock\n                  Margin=\"8,8,8,0\"\n                  Text=\"Profile data file\" />\n                <Grid Margin=\"8,2,8,0\">\n                  <controls:FileSystemTextBox\n                    x:Name=\"ProfileAutocompleteBox\"\n                    Height=\"22\"\n                    Margin=\"0,0,48,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    FilterMode=\"StartsWithOrdinal\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\"\n                    MinimumPrefixLength=\"1\"\n                    Text=\"{Binding Path=ProfileFilePath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n                    TextChanged=\"ProfileAutocompleteBox_TextChanged\"\n                    ToolTip=\"Path of the profile data file to load\" />\n\n                  <Button\n                    x:Name=\"BaseBrowseButton\"\n                    Height=\"22\"\n                    Padding=\"4,2,4,2\"\n                    HorizontalAlignment=\"Right\"\n                    Click=\"ProfileBrowseButton_Click\"\n                    Content=\"Browse\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\" />\n                </Grid>\n\n                <Grid Margin=\"8,4,8,0\">\n                  <TextBlock\n                    VerticalAlignment=\"Center\"\n                    Text=\"Process executable binary\" />\n                  <CheckBox\n                    x:Name=\"ExcludeIdleCheckBox\"\n                    HorizontalAlignment=\"Right\"\n                    VerticalAlignment=\"Center\"\n                    Content=\"Exclude Idle\"\n                    IsChecked=\"{Binding ExcludeIdleProcess}\"\n                    ToolTip=\"Hide the Idle process (PID 0) and recalculate weight percentages without it\"\n                    Visibility=\"{Binding ShowProcessList, Converter={StaticResource BoolToVisibilityConverter}}\"\n                    Checked=\"ExcludeIdleCheckBox_Changed\"\n                    Unchecked=\"ExcludeIdleCheckBox_Changed\" />\n                </Grid>\n                <Grid Margin=\"8,2,8,0\">\n                  <TextBox\n                    x:Name=\"BinaryAutocompleteBox\"\n                    Height=\"22\"\n                    HorizontalAlignment=\"Stretch\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\"\n                    IsReadOnly=\"True\"\n                    Text=\"{Binding Path=BinaryFilePath, Mode=TwoWay}\" />\n                </Grid>\n              </StackPanel>\n\n              <Grid Margin=\"8,8,8,4\" DockPanel.Dock=\"Bottom\">\n                <StackPanel\n                  Width=\"400\"\n                  HorizontalAlignment=\"Left\">\n                  <ProgressBar\n                    x:Name=\"LoadProgressBar\"\n                    Height=\"4\"\n                    HorizontalAlignment=\"Stretch\"\n                    Maximum=\"100\"\n                    Visibility=\"{Binding ShowLoadingProgress, Converter={StaticResource BoolToVisibilityConverter}}\"\n                    Value=\"40\" />\n                  <DockPanel\n                    Margin=\"0,2,0,0\"\n                    Visibility=\"{Binding ShowLoadingProgress, Converter={StaticResource BoolToVisibilityConverter}}\">\n                    <TextBlock\n                      x:Name=\"LoadProgressLabel\"\n                      DockPanel.Dock=\"Left\"\n                      Text=\"\" />\n                    <TextBlock\n                      x:Name=\"ProgressPercentLabel\"\n                      HorizontalAlignment=\"Right\"\n                      DockPanel.Dock=\"Right\"\n                      Text=\"0 %\" />\n                  </DockPanel>\n                </StackPanel>\n\n                <StackPanel\n                  HorizontalAlignment=\"Right\"\n                  Orientation=\"Horizontal\">\n                  <Button\n                    x:Name=\"CancelButton\"\n                    Height=\"24\"\n                    Margin=\"0,0,4,0\"\n                    Padding=\"4,0,4,0\"\n                    VerticalAlignment=\"Top\"\n                    Click=\"CancelButton_Click\"\n                    Content=\"Cancel\"\n                    IsEnabled=\"{Binding InputControlsEnabled, Converter={StaticResource InvertedBoolConverter}}\"\n                    Visibility=\"{Binding LoadingControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                  <Button\n                    x:Name=\"LoadButton\"\n                    Height=\"24\"\n                    Padding=\"4,0,4,0\"\n                    VerticalAlignment=\"Top\"\n                    Background=\"#FFFCF4CC\"\n                    Click=\"LoadButton_Click\"\n                    Content=\"Load Profile\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\"\n                    Visibility=\"{Binding LoadingControlsVisible, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                </StackPanel>\n              </Grid>\n\n              <ListView\n                x:Name=\"ProcessList\"\n                MinHeight=\"100\"\n                Margin=\"8,4,8,8\"\n                VerticalAlignment=\"Stretch\"\n                Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                IsEnabled=\"{Binding ProcessListEnabled}\"\n                ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n                SelectionChanged=\"ProcessList_OnSelectionChanged\"\n                SelectionMode=\"Extended\"\n                VirtualizingStackPanel.IsVirtualizing=\"True\"\n                VirtualizingStackPanel.VirtualizationMode=\"Recycling\"\n                Visibility=\"{Binding ShowProcessList, Converter={StaticResource BoolToVisibilityConverter}}\">\n                <ListView.View>\n                  <GridView>\n                    <GridViewColumn\n                      Width=\"150\"\n                      DisplayMemberBinding=\"{Binding Process.Name}\">\n                      <GridViewColumnHeader Name=\"ProcessNameColumn\" Content=\"Process\" />\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n\n                    <GridViewColumn\n                      x:Name=\"WeightColumn\"\n                      Width=\"80\"\n                      DisplayMemberBinding=\"{Binding WeightPercentageExcludingIdle, StringFormat={}{0:#0.00'%'}}\">\n                      <GridViewColumnHeader Name=\"WeightPercentageColumn\" Content=\"Weight\" />\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n\n                    <GridViewColumn\n                      Width=\"80\"\n                      DisplayMemberBinding=\"{Binding Duration, StringFormat={}{0:mm\\\\:ss\\\\.ff}}\">\n                      <GridViewColumnHeader Name=\"DurationColumn\" Content=\"Duration\" />\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n\n                    <GridViewColumn\n                      Width=\"70\"\n                      DisplayMemberBinding=\"{Binding Process.ProcessId}\">\n                      <GridViewColumnHeader Name=\"ProcessIdColumn\" Content=\"Process ID\" />\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n\n                    <GridViewColumn\n                      Width=\"500\"\n                      DisplayMemberBinding=\"{Binding Process.CommandLine}\">\n                      <GridViewColumnHeader Name=\"ProcessCommandLineColumn\" Content=\"Command line\" />\n                      <GridViewColumn.HeaderContainerStyle>\n                        <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                          <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                        </Style>\n                      </GridViewColumn.HeaderContainerStyle>\n                    </GridViewColumn>\n                  </GridView>\n                </ListView.View>\n\n                <ListView.ItemContainerStyle>\n                  <Style\n                    BasedOn=\"{StaticResource FlatListViewItem}\"\n                    TargetType=\"{x:Type ListViewItem}\">\n                    <Setter Property=\"Background\"\n                            Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                    <Setter Property=\"ToolTip\" Value=\"{Binding Process.CommandLine}\" />\n                    <EventSetter\n                      Event=\"MouseDoubleClick\"\n                      Handler=\"LoadButton_Click\" />\n                    <EventSetter\n                      Event=\"PreviewKeyDown\"\n                      Handler=\"ProcessList_PreviewKeyDown\" />\n                  </Style>\n                </ListView.ItemContainerStyle>\n\n                <ListView.ContextMenu>\n                  <ContextMenu>\n                    <MenuItem\n                      Click=\"ProcessListMenuItem_OnClick\"\n                      Header=\"Copy Process Details\" />\n                    <MenuItem\n                      Click=\"ProcessListMenuItem_OnClick\"\n                      Header=\"Copy Process List\"\n                      IsEnabled=\"False\" />\n                  </ContextMenu>\n                </ListView.ContextMenu>\n              </ListView>\n            </DockPanel>\n          </TabItem>\n\n          <TabItem\n            Header=\"Symbols\"\n            IsEnabled=\"{Binding InputControlsEnabled}\"\n            Style=\"{StaticResource TabControlStyle}\">\n            <optionsPanels:SymbolOptionsPanel\n              x:Name=\"SymbolOptionsPanel\"\n              Width=\"Auto\"\n              Height=\"Auto\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Stretch\" />\n          </TabItem>\n\n          <TabItem\n            Header=\"Options\"\n            IsEnabled=\"{Binding InputControlsEnabled}\"\n            Style=\"{StaticResource TabControlStyle}\">\n            <ScrollViewer VerticalScrollBarVisibility=\"Auto\">\n            <StackPanel\n              Margin=\"0,4,0,8\"\n              Orientation=\"Vertical\">\n              <Expander\n                Margin=\"8,0,8,0\"\n                IsEnabled=\"{Binding InputControlsEnabled}\"\n                IsExpanded=\"True\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Text=\"Processing\" />\n                </Expander.Header>\n                <StackPanel>\n                  <CheckBox\n                    Margin=\"0,8,0,0\"\n                    Content=\"Handle Kernel profile samples\"\n                    IsChecked=\"{Binding Path=Options.IncludeKernelEvents, Mode=TwoWay}\"\n                    ToolTip=\"Include kernel events from the trace, connecting user mode and kernel mode stacks\" />\n                  <CheckBox\n                    Margin=\"0,4,0,0\"\n                    Content=\"Handle CPU performance counter events\"\n                    IsChecked=\"{Binding Path=Options.IncludePerformanceCounters, Mode=TwoWay}\"\n                    ToolTip=\"Include CPU performance counter (PMC) events from the trace\" />\n                  <CheckBox\n                    Margin=\"0,4,0,0\"\n                    Content=\"Download source files from Source Server\"\n                    IsChecked=\"{Binding Path=SymbolSettings.SourceServerEnabled, Mode=TwoWay}\"\n                    ToolTip=\"Download source files using the SourceLink info from the symbol files\" />\n                </StackPanel>\n              </Expander>\n\n              <Expander\n                Margin=\"8,8,8,0\"\n                IsEnabled=\"{Binding InputControlsEnabled}\"\n                IsExpanded=\"True\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Text=\"Authentication\" />\n                </Expander.Header>\n\n                <StackPanel>\n\n                  <CheckBox\n                    x:Name=\"AuthorizationTokenCheckbox\"\n                    Margin=\"0,8,0,0\"\n                    Content=\"Use personal authentication token (PAT)\"\n                    IsChecked=\"{Binding Path=SymbolSettings.AuthorizationTokenEnabled, Mode=TwoWay}\"\n                    ToolTip=\"Personal Authentication Token used for symbol and source servers\" />\n\n                  <TextBlock\n                    Margin=\"20,8,0,0\"\n                    Text=\"User/email address\" />\n                  <TextBox\n                    Height=\"22\"\n                    Margin=\"20,2,8,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    IsEnabled=\"{Binding ElementName=AuthorizationTokenCheckbox, Path=IsChecked}\"\n                    Text=\"{Binding Path=SymbolSettings.AuthorizationUser, Mode=TwoWay}\"\n                    TextWrapping=\"Wrap\" />\n\n                  <TextBlock\n                    Margin=\"20,4,0,0\"\n                    Text=\"Authentication token\" />\n                  <PasswordBox\n                    Height=\"22\"\n                    Margin=\"20,2,8,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    local:PasswordHelper.Attach=\"True\"\n                    local:PasswordHelper.Password=\"{Binding Path=SymbolSettings.AuthorizationToken, Mode=TwoWay}\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    IsEnabled=\"{Binding ElementName=AuthorizationTokenCheckbox, Path=IsChecked}\" />\n                </StackPanel>\n              </Expander>\n              <Expander\n                Margin=\"8,8,8,8\"\n                IsEnabled=\"{Binding InputControlsEnabled}\"\n                IsExpanded=\"True\">\n                <Expander.Header>\n                  <TextBlock\n                    FontWeight=\"Medium\"\n                    Text=\"Binary files\" />\n                </Expander.Header>\n\n                <StackPanel>\n                  <CheckBox\n                    x:Name=\"BinarySearchPathsCheckbox\"\n                    Margin=\"0,8,0,0\"\n                    Content=\"Optional binary directories (one per line)\"\n                    IsChecked=\"{Binding Path=Options.BinarySearchPathsEnabled, Mode=TwoWay}\" />\n                  <TextBox\n                    Margin=\"20,4,55,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    AcceptsReturn=\"True\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    IsEnabled=\"{Binding ElementName=BinarySearchPathsCheckbox, Path=IsChecked}\"\n                    Text=\"{Binding Path=Options.BinarySearchPaths, Mode=TwoWay, Converter={StaticResource StringListConverter}}\"\n                    TextWrapping=\"Wrap\" />\n\n                  <CheckBox\n                    x:Name=\"BinaryNameAllowedListCheckbox\"\n                    Margin=\"0,8,0,0\"\n                    Content=\"Processed binary accepted list (one per line)\"\n                    IsChecked=\"{Binding Path=Options.BinaryNameAllowedListEnabled, Mode=TwoWay}\" />\n                  <TextBox\n                    Margin=\"20,4,55,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    AcceptsReturn=\"True\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\"\n                    IsEnabled=\"{Binding ElementName=BinaryNameAllowedListCheckbox, Path=IsChecked}\"\n                    Text=\"{Binding Path=Options.BinaryNameAllowedList, Mode=TwoWay, Converter={StaticResource StringListConverter}}\"\n                    TextWrapping=\"Wrap\" />\n                </StackPanel>\n              </Expander>\n            </StackPanel>\n            </ScrollViewer>\n          </TabItem>\n          <TabItem\n            Header=\"CPU counters\"\n            IsEnabled=\"{Binding InputControlsEnabled}\"\n            Style=\"{StaticResource TabControlStyle}\"\n            Visibility=\"{Binding Path=IsRecordMode, Converter={StaticResource BoolToVisibilityConverter}}\">\n            <Grid\n              Margin=\"0,4,0,8\"\n              IsEnabled=\"{Binding InputControlsEnabled}\">\n              <Grid.RowDefinitions>\n                <RowDefinition Height=\"*\" />\n                <RowDefinition Height=\"2\" />\n                <RowDefinition Height=\"*\" />\n              </Grid.RowDefinitions>\n\n              <Expander\n                Grid.Row=\"0\"\n                Margin=\"8,0,8,0\"\n                IsExpanded=\"True\">\n                <Expander.Header>\n                  <DockPanel>\n                    <TextBlock\n                      DockPanel.Dock=\"Left\"\n                      Text=\"CPU performance counters\" />\n                    <StackPanel\n                      VerticalAlignment=\"Center\"\n                      DockPanel.Dock=\"Right\"\n                      Orientation=\"Horizontal\">\n                      <TextBlock\n                        Margin=\"4,0,0,0\"\n                        Text=\"(\" />\n                      <TextBlock Text=\"{Binding EnabledPerfCounters}\" />\n                      <TextBlock Text=\")\" />\n                    </StackPanel>\n                  </DockPanel>\n                </Expander.Header>\n                <Grid\n                  HorizontalAlignment=\"Stretch\"\n                  VerticalAlignment=\"Stretch\">\n                  <Grid.RowDefinitions>\n                    <RowDefinition Height=\"*\" />\n                    <RowDefinition Height=\"32\" />\n                  </Grid.RowDefinitions>\n                  <ListView\n                    x:Name=\"PerfCounterList\"\n                    Grid.Row=\"0\"\n                    MinHeight=\"100\"\n                    Margin=\"0,8,0,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    VerticalAlignment=\"Stretch\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\"\n                    ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n                    SelectionMode=\"Single\"\n                    VirtualizingStackPanel.IsVirtualizing=\"True\"\n                    VirtualizingStackPanel.VirtualizationMode=\"Recycling\">\n                    <ListView.View>\n                      <GridView>\n                        <GridViewColumn Width=\"180\">\n                          <GridViewColumnHeader Content=\"Counter\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n\n                          <GridViewColumn.CellTemplate>\n                            <DataTemplate>\n                              <StackPanel Orientation=\"Horizontal\">\n                                <CheckBox\n                                  Background=\"Transparent\"\n                                  Checked=\"CheckBox_Checked\"\n                                  IsChecked=\"{Binding IsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}\"\n                                  Unchecked=\"CheckBox_Unchecked\" />\n                                <TextBlock\n                                  Margin=\"4,0,0,0\"\n                                  Text=\"{Binding Name}\" />\n                              </StackPanel>\n                            </DataTemplate>\n                          </GridViewColumn.CellTemplate>\n                        </GridViewColumn>\n\n                        <GridViewColumn Width=\"110\">\n                          <GridViewColumnHeader Content=\"Interval\" />\n                          <GridViewColumn.CellTemplate>\n                            <DataTemplate>\n                              <StackPanel Orientation=\"Horizontal\">\n                                <xctk:IntegerUpDown\n                                  Width=\"70\"\n                                  Increment=\"1000\"\n                                  Maximum=\"{Binding Path=MaxInterval}\"\n                                  Minimum=\"{Binding Path=MinInterval}\"\n                                  ParsingNumberStyle=\"Number\"\n                                  ShowButtonSpinner=\"True\"\n                                  Value=\"{Binding Path=Interval, Mode=TwoWay}\" />\n                                <Button\n                                  Width=\"20\"\n                                  Margin=\"1,0,1,0\"\n                                  Click=\"ResetButton_OnClick\"\n                                  Content=\"R\"\n                                  ToolTip=\"Reset to default value\" />\n                              </StackPanel>\n                            </DataTemplate>\n                          </GridViewColumn.CellTemplate>\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"75\"\n                          DisplayMemberBinding=\"{Binding MinInterval}\">\n                          <GridViewColumnHeader Content=\"Min Interval\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"40\"\n                          DisplayMemberBinding=\"{Binding Id}\">\n                          <GridViewColumnHeader Content=\"Id\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"70\"\n                          DisplayMemberBinding=\"{Binding IsBuiltin}\">\n                          <GridViewColumnHeader Content=\"Is builtin\" />\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                        </GridViewColumn>\n                      </GridView>\n                    </ListView.View>\n\n                    <ListView.ItemContainerStyle>\n                      <Style\n                        BasedOn=\"{StaticResource FlatListViewItem}\"\n                        TargetType=\"{x:Type ListViewItem}\">\n                        <Setter Property=\"Background\"\n                                Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                        <Setter Property=\"ToolTip\" Value=\"{Binding Description}\" />\n\n                        <Style.Triggers>\n                          <DataTrigger\n                            Binding=\"{Binding Path=IsEnabled}\"\n                            Value=\"True\">\n                            <Setter Property=\"FontWeight\" Value=\"Bold\" />\n                          </DataTrigger>\n                        </Style.Triggers>\n                      </Style>\n                    </ListView.ItemContainerStyle>\n                  </ListView>\n                  <Grid\n                    Grid.Row=\"1\"\n                    Height=\"24\"\n                    MinHeight=\"24\"\n                    Margin=\"0,4,0,4\">\n                    <StackPanel\n                      HorizontalAlignment=\"Right\"\n                      VerticalAlignment=\"Top\"\n                      DockPanel.Dock=\"Right\"\n                      Orientation=\"Horizontal\">\n                      <Image\n                        Height=\"16\"\n                        Source=\"{StaticResource SearchIcon}\" />\n                      <Grid\n                        x:Name=\"FunctionFilterGrid\"\n                        Height=\"24\">\n                        <TextBox\n                          Name=\"CounterFilter\"\n                          Width=\"200\"\n                          Height=\"24\"\n                          MaxWidth=\"300\"\n                          Margin=\"4,0,0,0\"\n                          HorizontalAlignment=\"Stretch\"\n                          VerticalAlignment=\"Center\"\n                          VerticalContentAlignment=\"Center\"\n                          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                          TextChanged=\"CounterFilter_TextChanged\"\n                          ToolTip=\"Filter counters list based on a case-insensitive substring\">\n                          <TextBox.InputBindings>\n                            <KeyBinding\n                              Key=\"Escape\"\n                              Command=\"local:Command.ClearTextbox\"\n                              CommandParameter=\"{Binding ElementName=ProcessFilter}\" />\n                          </TextBox.InputBindings>\n\n                        </TextBox>\n                        <TextBlock\n                          Margin=\"8,4\"\n                          Foreground=\"DimGray\"\n                          IsHitTestVisible=\"False\"\n                          Text=\"Filter counters\"\n                          Visibility=\"{Binding ElementName=CounterFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                      </Grid>\n                    </StackPanel>\n                  </Grid>\n                </Grid>\n              </Expander>\n\n              <GridSplitter\n                Grid.Row=\"1\"\n                HorizontalAlignment=\"Stretch\"\n                ResizeBehavior=\"PreviousAndNext\" />\n\n              <Expander\n                Grid.Row=\"2\"\n                Margin=\"8,8,8,0\"\n                Header=\"Metrics\"\n                IsExpanded=\"True\">\n                <Grid\n                  HorizontalAlignment=\"Stretch\"\n                  VerticalAlignment=\"Stretch\">\n                  <Grid.RowDefinitions>\n                    <RowDefinition Height=\"*\" />\n                    <RowDefinition Height=\"32\" />\n                  </Grid.RowDefinitions>\n                  <ListView\n                    x:Name=\"PerfMetricsList\"\n                    MinHeight=\"100\"\n                    MaxHeight=\"300\"\n                    Margin=\"0,8,0,0\"\n                    HorizontalAlignment=\"Stretch\"\n                    VerticalAlignment=\"Stretch\"\n                    Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                    IsEnabled=\"{Binding InputControlsEnabled}\"\n                    ScrollViewer.VerticalScrollBarVisibility=\"Auto\"\n                    SelectionMode=\"Single\"\n                    VirtualizingPanel.IsVirtualizing=\"True\"\n                    VirtualizingPanel.VirtualizationMode=\"Recycling\">\n                    <ListView.View>\n                      <GridView>\n                        <GridViewColumn\n                          Width=\"150\"\n                          DisplayMemberBinding=\"{Binding Name}\">\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                          <GridViewColumnHeader Content=\"Name\" />\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"100\"\n                          DisplayMemberBinding=\"{Binding RelativeCounterName}\">\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                          <GridViewColumnHeader Content=\"Relative counter\" />\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"100\"\n                          DisplayMemberBinding=\"{Binding BaseCounterName}\">\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                          <GridViewColumnHeader Content=\"Base counter\" />\n                        </GridViewColumn>\n\n                        <GridViewColumn\n                          Width=\"150\"\n                          DisplayMemberBinding=\"{Binding Description}\">\n                          <GridViewColumn.HeaderContainerStyle>\n                            <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                              <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n                            </Style>\n                          </GridViewColumn.HeaderContainerStyle>\n                          <GridViewColumnHeader Content=\"Description\" />\n                        </GridViewColumn>\n                      </GridView>\n                    </ListView.View>\n\n                    <ListView.ItemContainerStyle>\n                      <Style\n                        BasedOn=\"{StaticResource FlatListViewItem}\"\n                        TargetType=\"{x:Type ListViewItem}\">\n                        <Setter Property=\"Background\"\n                                Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n                        <Setter Property=\"ToolTip\" Value=\"{Binding Description}\" />\n                      </Style>\n                    </ListView.ItemContainerStyle>\n                  </ListView>\n                  <Grid\n                    Grid.Row=\"1\"\n                    Height=\"24\"\n                    MinHeight=\"24\"\n                    Margin=\"0,4,0,4\">\n                    <StackPanel\n                      HorizontalAlignment=\"Right\"\n                      VerticalAlignment=\"Top\"\n                      DockPanel.Dock=\"Right\"\n                      Orientation=\"Horizontal\">\n                      <Image\n                        Height=\"16\"\n                        Source=\"{StaticResource SearchIcon}\" />\n                      <Grid Height=\"24\">\n                        <TextBox\n                          Name=\"MetricFilter\"\n                          Width=\"200\"\n                          Height=\"24\"\n                          MaxWidth=\"300\"\n                          Margin=\"4,0,0,0\"\n                          HorizontalAlignment=\"Stretch\"\n                          VerticalAlignment=\"Center\"\n                          VerticalContentAlignment=\"Center\"\n                          Background=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\"\n                          TextChanged=\"MetricFilter_TextChanged\"\n                          ToolTip=\"Filter counters list based on a case-insensitive substring\">\n                          <TextBox.InputBindings>\n                            <KeyBinding\n                              Key=\"Escape\"\n                              Command=\"local:Command.ClearTextbox\"\n                              CommandParameter=\"{Binding ElementName=MetricFilter}\" />\n                          </TextBox.InputBindings>\n\n                        </TextBox>\n                        <TextBlock\n                          Margin=\"8,4\"\n                          Foreground=\"DimGray\"\n                          IsHitTestVisible=\"False\"\n                          Text=\"Filter metrics\"\n                          Visibility=\"{Binding ElementName=MetricFilter, Path=Text.IsEmpty, Converter={StaticResource BoolToVisibilityConverter}}\" />\n                      </Grid>\n                    </StackPanel>\n                  </Grid>\n                </Grid>\n              </Expander>\n            </Grid>\n          </TabItem>\n        </TabControl>\n    </DockPanel>\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/ProfileLoadWindow.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Input;\nusing System.Windows.Threading;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.UI.Compilers;\nusing ProfileExplorer.UI.Controls;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.Core.Settings;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Profile.ETW;\n\nnamespace ProfileExplorer.UI;\n\npublic enum ProcessSortField {\n  ProcessName,\n  Weight,\n  Duration,\n  ProcessId,\n  CommandLine\n}\n\npublic partial class ProfileLoadWindow : Window, INotifyPropertyChanged {\n  private CancelableTaskInstance loadTask_;\n  private bool isLoadingProfile_;\n  private ProfileDataProviderOptions options_;\n  private ProfileRecordingSessionOptions recordingOptions_;\n  private SymbolFileSourceSettings symbolSettings_;\n  private RawProfileData recordedProfile_;\n  private bool isLoadingProcessList_;\n  private bool showProcessList_;\n  private bool isRecordingProfile_;\n  private List<ProcessSummary> processList_;\n  private List<ProcessSummary> selectedProcSummary_;\n  private RecordingSession currentSession_;\n  private RecordingSession loadedSession_;\n  private int enabledPerfCounters_;\n  private ICollectionView perfCountersFilter_;\n  private ICollectionView metricsFilter_;\n  private ICollectionView processFilter_;\n  private GridViewColumnValueSorter<ProcessSortField> processListSorter_;\n  private string profileFilePath_;\n  private string binaryFilePath_;\n  private bool showOnlyManagedProcesses_;\n  private bool excludeIdleProcess_ = true;\n  private bool showLoadingProgress_;\n  private bool openLoadedSession_;\n  private double lastProgressPercentage_ = 0;\n\n  public ProfileLoadWindow(IUISession session, bool recordMode,\n                           RecordingSession loadedSession = null,\n                           bool openLoadedSession = false) {\n    InitializeComponent();\n    DataContext = this;\n    Session = session;\n    \n    // Initialize the process list column sorter\n    processListSorter_ = new GridViewColumnValueSorter<ProcessSortField>(\n      ProcessList, \n      MapColumnNameToSortField, \n      CompareProcessSummaryValues);\n    \n    loadTask_ = new CancelableTaskInstance();\n    IsRecordMode = recordMode;\n    loadedSession_ = loadedSession;\n    openLoadedSession_ = openLoadedSession;\n\n    if (IsRecordMode) {\n      Title = \"Record profile trace\";\n    }\n\n    Options = App.Settings.ProfileOptions;\n    SymbolSettings = App.Settings.SymbolSettings;\n    RecordingOptions = new ProfileRecordingSessionOptions();\n\n    UpdatePerfCounterList();\n    SetupSessionList();\n    ContentRendered += ProfileLoadWindow_ContentRendered;\n    Closing += ProfileLoadWindow_Closing;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public IUISession Session { get; set; }\n\n  public string ProfileFilePath {\n    get => profileFilePath_;\n    set {\n      profileFilePath_ = value;\n      OnPropertyChange(nameof(ProfileFilePath));\n    }\n  }\n\n  public string BinaryFilePath {\n    get => binaryFilePath_;\n    set {\n      binaryFilePath_ = value;\n      OnPropertyChange(nameof(BinaryFilePath));\n    }\n  }\n\n  public bool RequiresElevation => ETWRecordingSession.RequiresElevation;\n  public bool LoadingControlsVisible => !IsRecordMode || ShowProcessList;\n  public bool RecentControlsVisible => !IsRecordMode && !IsLoadingProfile;\n\n  public bool IsLoadingProfile {\n    get => isLoadingProfile_;\n    set {\n      if (isLoadingProfile_ != value) {\n        isLoadingProfile_ = value;\n        OnPropertyChange(nameof(IsLoadingProfile));\n        OnPropertyChange(nameof(InputControlsEnabled));\n        OnPropertyChange(nameof(ProcessListEnabled));\n      }\n    }\n  }\n\n  public bool IsRecordingProfile {\n    get => isRecordingProfile_;\n    set {\n      if (isRecordingProfile_ != value) {\n        isRecordingProfile_ = value;\n        OnPropertyChange(nameof(IsRecordingProfile));\n        OnPropertyChange(nameof(InputControlsEnabled));\n        OnPropertyChange(nameof(RecordingControlsEnabled));\n        OnPropertyChange(nameof(RecordingStopControlsEnabled));\n        OnPropertyChange(nameof(LoadingControlsVisible));\n      }\n    }\n  }\n\n  public bool IsLoadingProcessList {\n    get => isLoadingProcessList_;\n    set {\n      if (isLoadingProcessList_ != value) {\n        isLoadingProcessList_ = value;\n        OnPropertyChange(nameof(IsLoadingProcessList));\n        OnPropertyChange(nameof(ProcessListEnabled));\n        OnPropertyChange(nameof(InputControlsEnabled));\n      }\n    }\n  }\n\n  public bool ShowProcessList {\n    get => showProcessList_;\n    set {\n      if (showProcessList_ != value) {\n        showProcessList_ = value;\n        OnPropertyChange(nameof(ShowProcessList));\n        OnPropertyChange(nameof(LoadingControlsVisible));\n        OnPropertyChange(nameof(ProcessListEnabled));\n        OnPropertyChange(nameof(InputControlsEnabled));\n      }\n    }\n  }\n\n  public bool ShowLoadingProgress {\n    get => showLoadingProgress_;\n    set {\n      if (showLoadingProgress_ != value) {\n        showLoadingProgress_ = value;\n        OnPropertyChange(nameof(ShowLoadingProgress));\n      }\n    }\n  }\n\n  public int EnabledPerfCounters {\n    get => enabledPerfCounters_;\n    set {\n      if (enabledPerfCounters_ != value) {\n        enabledPerfCounters_ = value;\n        OnPropertyChange(nameof(EnabledPerfCounters));\n      }\n    }\n  }\n\n  public bool InputControlsEnabled => !IsLoadingProfile && !IsRecordingProfile;\n  public bool ProcessListEnabled => !IsLoadingProfile || IsLoadingProcessList;\n  public bool RecordingControlsEnabled => !IsLoadingProfile && !IsRecordingProfile;\n  public bool RecordingStopControlsEnabled => !IsLoadingProfile && IsRecordingProfile;\n  public bool IsRecordMode { get; }\n\n  public ProfileRecordingSessionOptions RecordingOptions {\n    get => recordingOptions_;\n    set {\n      recordingOptions_ = value;\n      OnPropertyChange(nameof(RecordingOptions));\n      OnPropertyChange(nameof(Options));\n    }\n  }\n\n  public ProfileDataProviderOptions Options {\n    get => options_;\n    set {\n      options_ = value;\n      OnPropertyChange(nameof(Options));\n      OnPropertyChange(nameof(RecordingOptions));\n    }\n  }\n\n  public SymbolFileSourceSettings SymbolSettings {\n    get => symbolSettings_;\n    set {\n      symbolSettings_ = value;\n      SymbolOptionsPanel.Initialize(this, value, Session);\n      OnPropertyChange(nameof(SymbolSettings));\n    }\n  }\n\n  public bool ShowOnlyManagedProcesses {\n    get => showOnlyManagedProcesses_;\n    set {\n      if (showOnlyManagedProcesses_ != value) {\n        showOnlyManagedProcesses_ = value;\n        UpdateRunningProcessList();\n      }\n    }\n  }\n\n  public bool ExcludeIdleProcess {\n    get => excludeIdleProcess_;\n    set {\n      if (excludeIdleProcess_ != value) {\n        excludeIdleProcess_ = value;\n        OnPropertyChange(nameof(ExcludeIdleProcess));\n      }\n    }\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n\n  private void UpdatePerfCounterList() {\n    var counters = ETWRecordingSession.BuiltinPerformanceCounters;\n\n    foreach (var counter in counters) {\n      recordingOptions_.AddPerformanceCounter(counter);\n    }\n\n    var metrics = ETWRecordingSession.BuiltinPerformanceMetrics;\n\n    foreach (var metric in metrics) {\n      options_.AddPerformanceMetric(metric);\n    }\n\n    var counterList = new ObservableCollectionRefresh<PerformanceCounterConfig>(recordingOptions_.PerformanceCounters);\n    perfCountersFilter_ = counterList.GetFilterView();\n    perfCountersFilter_.Filter = FilterCounterList;\n    PerfCounterList.ItemsSource = null;\n    PerfCounterList.ItemsSource = perfCountersFilter_;\n\n    var metricList = new ObservableCollectionRefresh<PerformanceMetricConfig>(options_.PerformanceMetrics);\n    metricsFilter_ = metricList.GetFilterView();\n    metricsFilter_.Filter = FilterMetricsList;\n    PerfMetricsList.ItemsSource = null;\n    PerfMetricsList.ItemsSource = metricsFilter_;\n  }\n\n  public void OnPropertyChange(string propertyname) {\n    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyname));\n  }\n\n  private void SetupSessionList() {\n    var sessionList = new List<RecordingSession>();\n\n    if (IsRecordMode) {\n      sessionList.Add(new RecordingSession(null, false, true,\n                                           \"Record\", \"Start a new session\"));\n\n      foreach (var prevSession in Options.PreviousRecordingSessions) {\n        sessionList.Add(new RecordingSession(prevSession, false));\n      }\n    }\n    else {\n      sessionList.Add(new RecordingSession(null, false, true,\n                                           \"Open\", \"Load a trace\"));\n\n      foreach (var prevSession in Options.PreviousLoadedSessions) {\n        sessionList.Add(new RecordingSession(prevSession, true));\n      }\n    }\n\n    currentSession_ = sessionList[0];\n    SessionList.ItemsSource = null; // Force update.\n    SessionList.ItemsSource = new ListCollectionView(sessionList);\n  }\n\n  private async void ProfileLoadWindow_ContentRendered(object sender, EventArgs e) {\n    if (loadedSession_ != null) {\n      SwitchCurrentSession(loadedSession_);\n\n      if (openLoadedSession_) {\n        var process = new ProfileProcess(loadedSession_.Report.Process.ProcessId,\n                                         loadedSession_.Report.Process.Name);\n        selectedProcSummary_ = new List<ProcessSummary>() {\n          new(process, TimeSpan.Zero)\n        };\n\n        await LoadProfileTraceFileAndCloseWindow(loadedSession_.Report.SymbolSettings);\n      }\n    }\n  }\n\n  private void ProfileLoadWindow_Closing(object sender, CancelEventArgs e) {\n    // Don't close the window while profile is loading.\n    if (IsLoadingProfile) {\n      e.Cancel = true;\n      return;\n    }\n\n    SaveCurrentOptions();\n  }\n\n  private void SaveCurrentOptions() {\n    options_.RecordingSessionOptions = recordingOptions_;\n    App.SaveApplicationSettings();\n  }\n\n  private bool FilterCounterList(object value) {\n    string text = CounterFilter.Text.Trim();\n\n    if (text.Length < 2) {\n      return true;\n    }\n\n    var counter = (PerformanceCounterConfig)value;\n\n    if (counter.Name.Contains(text, StringComparison.OrdinalIgnoreCase)) {\n      return true;\n    }\n\n    return false;\n  }\n\n  private bool FilterMetricsList(object value) {\n    string text = MetricFilter.Text.Trim();\n\n    if (text.Length < 2) {\n      return true;\n    }\n\n    var counter = (PerformanceMetricConfig)value;\n\n    if (counter.Name.Contains(text, StringComparison.OrdinalIgnoreCase)) {\n      return true;\n    }\n\n    return false;\n  }\n\n  private async void LoadButton_Click(object sender, RoutedEventArgs e) {\n    await LoadProfileTraceFileAndCloseWindow(symbolSettings_);\n  }\n\n  private async Task LoadProfileTraceFileAndCloseWindow(SymbolFileSourceSettings symbolSettings) {\n    SaveCurrentOptions();\n\n    if (await LoadProfileTraceFile(symbolSettings)) {\n      DialogResult = true;\n      Close();\n    }\n  }\n\n  private async Task<bool> LoadProfileTraceFile(SymbolFileSourceSettings symbolSettings) {\n    ProfileFilePath = Utils.CleanupPath(ProfileFilePath);\n    BinaryFilePath = Utils.CleanupPath(BinaryFilePath);\n\n    if (!IsRecordMode &&\n        !Utils.ValidateFilePath(ProfileFilePath, ProfileAutocompleteBox, \"profile\", this)) {\n      return false;\n    }\n\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    var report = new ProfileDataReport {\n      RunningProcesses = processList_,\n      SymbolSettings = symbolSettings_.Clone()\n    };\n\n    bool success = false;\n    IsLoadingProfile = true;\n    ShowLoadingProgress = true;\n    LoadProgressBar.Value = 0;\n\n    if (selectedProcSummary_ == null) {\n      IsLoadingProfile = false;\n      return false;\n    }\n\n    var processIds = selectedProcSummary_.ConvertAll(proc => proc.Process.ProcessId);\n\n    if (IsRecordMode) {\n      report.RecordingSessionOptions = recordingOptions_.Clone();\n      symbolSettings = symbolSettings_.WithSymbolPaths(recordingOptions_.ApplicationPath);\n\n      if (recordingOptions_.HasWorkingDirectory) {\n        symbolSettings = symbolSettings.WithSymbolPaths(recordingOptions_.WorkingDirectory);\n      }\n\n      success = await Session.LoadProfileData(recordedProfile_, processIds,\n                                              options_, symbolSettings, report,\n                                              ProfileLoadProgressCallback, task);\n    }\n    else {\n      symbolSettings = symbolSettings_.Clone();\n      success = await Session.LoadProfileData(ProfileFilePath, processIds,\n                                              options_, symbolSettings, report,\n                                              ProfileLoadProgressCallback, task);\n    }\n\n    if (report.TraceInfo == null) {\n      report.TraceInfo = new ProfileTraceInfo(); // Not set on failure.\n      report.TraceInfo.TraceFilePath = ProfileFilePath;\n    }\n\n    IsLoadingProfile = false;\n    ShowLoadingProgress = false;\n    UpdateRejectedFiles(report);\n\n    if (!success && !task.IsCanceled) {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show($\"Failed to load profile file {ProfileFilePath}\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n      ProfileReportPanel.ShowReportWindow(report, Session);\n    }\n\n    if (success) {\n      if (IsRecordMode) {\n        App.Settings.AddRecordedProfileSession(report);\n      }\n      else {\n        App.Settings.AddLoadedProfileSession(report);\n        App.Settings.AddRecentFile(report.TraceInfo.TraceFilePath);\n      }\n\n      App.SaveApplicationSettings();\n    }\n\n    return success;\n  }\n\n  private void UpdateRejectedFiles(ProfileDataReport report) {\n    if (symbolSettings_.RejectPreviouslyFailedFiles) {\n      foreach (var module in report.Modules) {\n        if (!module.HasBinaryLoaded && module.BinaryFileInfo != null) {\n          symbolSettings_.RejectBinaryFile(module.BinaryFileInfo.BinaryFile);\n        }\n\n        if (!module.HasDebugInfoLoaded && module.DebugInfoFile != null) {\n          // Post-load rejection: PDB was downloaded but failed to load (corrupt/invalid format)\n          // This is a permanent failure (the PDB file itself is bad), so it's safe to cache\n          symbolSettings_.RejectSymbolFile(module.DebugInfoFile.SymbolFile,\n                                          SymbolFileRejectionReason.InvalidFormat,\n                                          \"Failed to load debug info from downloaded PDB\");\n        }\n      }\n\n      App.Settings.SymbolSettings = symbolSettings_;\n      App.SaveApplicationSettings();\n    }\n  }\n\n  private void ProfileLoadProgressCallback(ProfileLoadProgress progressInfo) {\n    if (progressInfo == null) {\n      return;\n    }\n\n    // Update progress in UI only if there is any visible change, calling though\n    // the Dispatcher is slow and slows down the trace reading by a lot otherwise.\n    double percentage = 0;\n\n    if (progressInfo.Total != 0) {\n      percentage = Math.Min(1.0, progressInfo.Current / (double)progressInfo.Total);\n      double diff = percentage - lastProgressPercentage_;\n\n      if (diff > 0.01 || diff < 0) {\n        lastProgressPercentage_ = percentage;\n      }\n      else {\n        return;\n      }\n    }\n\n    // Add detailed logging for debugging stuck progress\n    var timestamp = DateTime.Now.ToString(\"HH:mm:ss.fff\");\n    Trace.WriteLine($\"[{timestamp}] Progress: {progressInfo.Stage} - {progressInfo.Current}/{progressInfo.Total} ({percentage:P1}) - {progressInfo.Optional}\");\n\n    Dispatcher.Invoke(() => {\n      // With multi-threaded processing, current value is not always increasing...\n      if (progressInfo.Stage == ProfileLoadStage.TraceProcessing) {\n        progressInfo.Current = Math.Max(progressInfo.Current, (int)LoadProgressBar.Value);\n      }\n\n      LoadProgressBar.Maximum = progressInfo.Total;\n      LoadProgressBar.Value = progressInfo.Current;\n\n      string stageText = progressInfo.Stage switch {\n        ProfileLoadStage.TraceReading    => \"Reading trace\",\n        ProfileLoadStage.TraceProcessing => $\"Processing trace samples ({progressInfo.Current:N0}/{progressInfo.Total:N0})\",\n        ProfileLoadStage.ComputeCallTree => \"Computing Call Tree\",\n        ProfileLoadStage.BinaryLoading => \"Downloading and loading binaries\" +\n                                          (!string.IsNullOrEmpty(progressInfo.Optional) ?\n                                            $\" ({progressInfo.Optional.TrimToLength(30)})\" : \"\"),\n        ProfileLoadStage.SymbolLoading => \"Downloading and loading symbols\" +\n                                          (!string.IsNullOrEmpty(progressInfo.Optional) ?\n                                            $\" ({progressInfo.Optional.TrimToLength(30)})\" : \"\"),\n        ProfileLoadStage.PerfCounterProcessing => \"Processing CPU perf. counters\",\n        _                                      => \"\"\n      };\n\n      // Add more detail to the processing stage\n      if (progressInfo.Stage == ProfileLoadStage.TraceProcessing && !string.IsNullOrEmpty(progressInfo.Optional)) {\n        stageText += $\" - {progressInfo.Optional}\";\n      }\n\n      LoadProgressLabel.Text = stageText;\n\n      if (progressInfo.Total != 0) {\n        ProgressPercentLabel.Text = $\"{Math.Round(percentage * 100)} %\";\n        LoadProgressBar.IsIndeterminate = false;\n      }\n      else {\n        LoadProgressBar.IsIndeterminate = true;\n      }\n    });\n  }\n\n  private void ProcessListProgressCallback(ProcessListProgress progressInfo) {\n    if (progressInfo == null) {\n      return;\n    }\n\n    // Update progress in UI only if there is any visible change, calling though\n    // the Dispatcher is slow and slows down the trace reading by a lot otherwise.\n    double percentage = 0;\n\n    if (progressInfo.Total != 0) {\n      percentage = Math.Min(1.0, progressInfo.Current / (double)progressInfo.Total);\n      double diff = percentage - lastProgressPercentage_;\n\n      if (diff > 0.01 || diff < 0) {\n        lastProgressPercentage_ = percentage;\n      }\n      else if (progressInfo.Processes == null) {\n        return;\n      }\n    }\n\n    Dispatcher.Invoke(() => {\n      LoadProgressBar.Maximum = progressInfo.Total;\n      LoadProgressBar.Value = progressInfo.Current;\n\n      if (progressInfo.Total != 0) {\n        ProgressPercentLabel.Text = $\"{Math.Round(percentage * 100)} %\";\n        LoadProgressBar.IsIndeterminate = false;\n      }\n      else {\n        LoadProgressBar.IsIndeterminate = true;\n      }\n\n      if (progressInfo.Processes != null) {\n        DisplayProcessList(progressInfo.Processes, selectedProcSummary_);\n      }\n    }, DispatcherPriority.Render);\n  }\n\n  private async void CancelButton_Click(object sender, RoutedEventArgs e) {\n    if (isLoadingProfile_) {\n      await CancelLoadingTask();\n    }\n  }\n\n  private async Task CancelLoadingTask() {\n    await loadTask_.CancelTaskAndWaitAsync();\n  }\n\n  private void ProfileBrowseButton_Click(object sender, RoutedEventArgs e) {\n    Utils.ShowOpenFileDialog(ProfileAutocompleteBox, \"ETW Trace Files|*.etl|All Files|*.*\");\n  }\n\n  private async Task<List<ProcessSummary>> LoadProcessList(string filePath) {\n    await CancelLoadingTask();\n\n    if (File.Exists(ProfileFilePath)) {\n      using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n\n      IsLoadingProcessList = true;\n      ShowLoadingProgress = true;\n      BinaryFilePath = \"\";\n      LoadProgressBar.Value = 0;\n      ResetProcessList();\n\n      var list = await ETWProfileDataProvider.FindTraceProcesses(ProfileFilePath, options_,\n                                                                 ProcessListProgressCallback, task);\n      IsLoadingProcessList = false;\n\n      if (!IsLoadingProfile) {\n        // Don't hide progress controls if the process summary\n        // was canceled and replaced by loading a process async.\n        ShowLoadingProgress = false;\n      }\n\n      return list;\n    }\n\n    return null;\n  }\n\n  private void ResetProcessList() {\n    processList_ = null;\n    selectedProcSummary_ = null;\n  }\n\n  private void ApplicationBrowseButton_Click(object sender, RoutedEventArgs e) {\n    Utils.ShowExecutableOpenFileDialog(ApplicationAutocompleteBox);\n  }\n\n  private void ProcessList_OnSelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (ProcessList.SelectedItems.Count > 0) {\n      selectedProcSummary_ = new List<ProcessSummary>(ProcessList.SelectedItems.OfType<ProcessSummary>());\n      BinaryFilePath = selectedProcSummary_[0].Process.Name;\n    }\n  }\n\n  private string SetSessionApplicationPath() {\n    recordingOptions_.WorkingDirectory = Utils.CleanupPath(recordingOptions_.WorkingDirectory);\n    string appPath = Utils.CleanupPath(recordingOptions_.ApplicationPath);\n\n    if (!File.Exists(appPath) && recordingOptions_.HasWorkingDirectory) {\n      appPath = Path.Combine(recordingOptions_.WorkingDirectory, appPath);\n    }\n\n    recordingOptions_.ApplicationPath = appPath;\n    return appPath;\n  }\n\n  private async void StartCaptureButton_OnClick(object sender, RoutedEventArgs e) {\n    await StartRecordingSession();\n  }\n\n  private async Task StartRecordingSession() {\n    if (recordingOptions_.SessionKind == ProfileSessionKind.StartProcess) {\n      string appPath = SetSessionApplicationPath();\n\n      if (!File.Exists(appPath)) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show($\"Could not find profiled application: {appPath}\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Error);\n        return;\n      }\n    }\n    else if (recordingOptions_.SessionKind == ProfileSessionKind.AttachToProcess) {\n      if (selectedProcSummary_ == null) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show(\"Select a running process to attach to\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Error);\n        return;\n      }\n\n      recordingOptions_.TargetProcessId = selectedProcSummary_[0].Process.ProcessId;\n    }\n\n    // Commit the recording options to the profiling ones.\n    SaveCurrentOptions();\n\n    if (recordingOptions_.RecordPerformanceCounters) {\n      options_.IncludePerformanceCounters = true;\n    }\n\n    // Start ETW recording session.\n    IsRecordingProfile = true;\n    ProfileLoadProgress lastProgressInfo = null;\n    using var task = await loadTask_.CancelCurrentAndCreateTaskAsync();\n    using var recordingSession = new ETWRecordingSession(options_);\n\n    // Show elapsed time in UI.\n    var stopWatch = Stopwatch.StartNew();\n    var timer = new DispatcherTimer(TimeSpan.FromMilliseconds(500), DispatcherPriority.Render,\n                                    (o, e) => UpdateRecordingProgress(stopWatch, lastProgressInfo), Dispatcher);\n    timer.Start();\n\n    // Start recording on another thread.\n    recordedProfile_ = null;\n    var recordingTask = recordingSession.StartRecording(progressInfo => { lastProgressInfo = progressInfo; }, task);\n\n    if (recordingTask != null) {\n      recordedProfile_ = await recordingTask;\n    }\n\n    // Show process list if recording successful.\n    timer.Stop();\n    IsRecordingProfile = false;\n\n    if (recordedProfile_ != null) {\n      processList_ = await Task.Run(() => recordedProfile_.BuildProcessSummary());\n      DisplayProcessList(processList_);\n    }\n    else {\n      using var centerForm = new DialogCenteringHelper(this);\n      MessageBox.Show(\"Failed to record ETW sampling profile!\", \"Profile Explorer\",\n                      MessageBoxButton.OK, MessageBoxImage.Exclamation);\n    }\n  }\n\n  private void UpdateRecordingProgress(Stopwatch stopWatch, ProfileLoadProgress progressInfo) {\n    string status = $\"{stopWatch.Elapsed.ToString(@\"mm\\:ss\")}\";\n\n    if (progressInfo != null) {\n      status += progressInfo.Stage switch {\n        ProfileLoadStage.TraceReading => $\", {progressInfo.Total / 1000}K samples\",\n        _                             => \"\"\n      };\n    }\n\n    RecordProgressLabel.Text = status;\n  }\n\n  private void DisplayProcessList(List<ProcessSummary> list, List<ProcessSummary> selectedProcSummary = null) {\n    ProcessList.ItemsSource = null;\n    var view = new ListCollectionView(list);\n    ProcessList.ItemsSource = view;\n    ShowProcessList = true;\n\n    ApplyIdleFilter(view);\n\n    // Set default sort by weight (highest first) to maintain current behavior\n    processListSorter_.SortByField(ProcessSortField.Weight, ListSortDirection.Descending);\n\n    if (selectedProcSummary != null) {\n      // Keep selected process after updating list.\n      foreach (var proc in selectedProcSummary) {\n        ProcessList.SelectedItems.Add(list.Find(item => item.Process == proc.Process));\n      }\n    }\n  }\n\n  private void ApplyIdleFilter(ListCollectionView view) {\n    // Update the weight column binding based on the exclude-idle toggle.\n    string bindingPath = excludeIdleProcess_ ? \"WeightPercentageExcludingIdle\" : \"WeightPercentage\";\n    WeightColumn.DisplayMemberBinding = new System.Windows.Data.Binding(bindingPath) {\n      StringFormat = \"{0:#0.00'%'}\"\n    };\n\n    if (excludeIdleProcess_) {\n      view.Filter = item => ((ProcessSummary)item).Process.ProcessId != ETWEventProcessor.KernelProcessId;\n    }\n    else {\n      view.Filter = null;\n    }\n  }\n\n  private void ExcludeIdleCheckBox_Changed(object sender, RoutedEventArgs e) {\n    if (ProcessList.ItemsSource is ListCollectionView view) {\n      ApplyIdleFilter(view);\n    }\n  }\n\n  private async void StopCaptureButton_OnClick(object sender, RoutedEventArgs e) {\n    await CancelLoadingTask();\n  }\n\n  private void RestartAppButton_OnClick(object sender, RoutedEventArgs e) {\n    App.RestartApplicationAsAdmin();\n  }\n\n  private void DefaultFrequencyButton_Click(object sender, RoutedEventArgs e) {\n    SamplingFrequencySlider.Value = ProfileRecordingSessionOptions.DefaultSamplingFrequency;\n  }\n\n  private void MaxFrequencyButton_Click(object sender, RoutedEventArgs e) {\n    SamplingFrequencySlider.Value = ProfileRecordingSessionOptions.MaximumSamplingFrequency;\n  }\n\n  private async void ProfileAutocompleteBox_TextChanged(object sender, RoutedEventArgs e) {\n    if (IsLoadingProfile) {\n      return; // Ignore during load of previous session.\n    }\n\n    ShowProcessList = false;\n    ProfileFilePath = Utils.CleanupPath(ProfileFilePath);\n\n    if (File.Exists(ProfileFilePath)) {\n      processList_ = await LoadProcessList(ProfileFilePath);\n\n      if (processList_ == null) {\n        using var centerForm = new DialogCenteringHelper(this);\n        MessageBox.Show(\"Failed to load ETL process list!\", \"Profile Explorer\",\n                        MessageBoxButton.OK, MessageBoxImage.Exclamation);\n        return;\n      }\n\n      DisplayProcessList(processList_);\n    }\n  }\n\n  private void ResetButton_OnClick(object sender, RoutedEventArgs e) {\n    var config = (sender as Button).DataContext as PerformanceCounterConfig;\n\n    if (config != null) {\n      config.Interval = config.DefaultInterval;\n      var list = (ObservableCollectionRefresh<PerformanceCounterConfig>)PerfCounterList.ItemsSource;\n      list.Refresh();\n    }\n  }\n\n  private void CheckBox_Checked(object sender, RoutedEventArgs e) {\n    EnabledPerfCounters = recordingOptions_.EnabledPerformanceCounters.Count;\n  }\n\n  private void CheckBox_Unchecked(object sender, RoutedEventArgs e) {\n    EnabledPerfCounters = recordingOptions_.EnabledPerformanceCounters.Count;\n  }\n\n  private void CounterFilter_TextChanged(object sender, TextChangedEventArgs e) {\n    perfCountersFilter_?.Refresh();\n  }\n\n  private void MetricFilter_TextChanged(object sender, TextChangedEventArgs e) {\n    metricsFilter_?.Refresh();\n  }\n\n  private void SessionReportButton_Click(object sender, RoutedEventArgs e) {\n    var sessionEx = ((Button)sender).DataContext as RecordingSession;\n    var report = sessionEx?.Report;\n\n    if (report != null) {\n      ProfileReportPanel.ShowReportWindow(report, Session);\n    }\n  }\n\n  private void SessionRemoveButton_Click(object sender, RoutedEventArgs e) {\n    var sessionEx = ((Button)sender).DataContext as RecordingSession;\n    var report = sessionEx?.Report;\n\n    if (report != null) {\n      using var centerForm = new DialogCenteringHelper(this);\n\n      if (MessageBox.Show(\"Do you want to remove the session?\", \"Profile Explorer\",\n                          MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes) {\n        return;\n      }\n\n      if (IsRecordMode) {\n        App.Settings.RemoveRecordedProfileSession(report);\n      }\n      else {\n        App.Settings.RemoveLoadedProfileSession(report);\n      }\n\n      SetupSessionList();\n      SaveCurrentOptions();\n    }\n  }\n\n  private async void SessionList_MouseDoubleClick(object sender, MouseButtonEventArgs e) {\n    var sessionEx = SessionList.SelectedItem as RecordingSession;\n\n    if (sessionEx?.Report == null) {\n      return;\n    }\n\n    IsLoadingProfile = true; // Prevent process list to be loaded.\n    ActivatePreviousSession(sessionEx.Report);\n\n    if (IsRecordMode) {\n      await StartRecordingSession();\n    }\n    else {\n      await LoadProfileTraceFileAndCloseWindow(symbolSettings_);\n    }\n  }\n\n  private void SessionList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    var sessionEx = SessionList.SelectedItem as RecordingSession;\n\n    if (sessionEx == null) {\n      return;\n    }\n\n    SwitchCurrentSession(sessionEx);\n  }\n\n  private void SwitchCurrentSession(RecordingSession session) {\n    var report = session.Report;\n\n    if (IsRecordMode && currentSession_.IsNewSession) {\n      SaveCurrentOptions();\n    }\n\n    if (report != null) {\n      ActivatePreviousSession(report);\n    }\n    else {\n      // Reload default new options.\n      if (IsRecordMode) {\n        RecordingOptions = options_.RecordingSessionOptions.Clone();\n      }\n      else {\n        ProfileFilePath = \"\";\n        BinaryFilePath = \"\";\n      }\n    }\n\n    UpdatePerfCounterList();\n    currentSession_ = session;\n  }\n\n  private void ActivatePreviousSession(ProfileDataReport report) {\n    if (report.Process != null) {\n      // Set previous selected process.\n      selectedProcSummary_ = new List<ProcessSummary> {\n        new(report.Process, TimeSpan.Zero)\n      };\n    }\n\n    if (IsRecordMode) {\n      RecordingOptions = report.RecordingSessionOptions.Clone();\n    }\n    else {\n      ProfileFilePath = report.TraceInfo.TraceFilePath;\n      BinaryFilePath = report.Process?.ImageFileName;\n    }\n  }\n\n  private void SamplingFrequencySlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) {\n    // Hack to get the label to update, since RecordingOptions doesn't notify.\n    OnPropertyChange(nameof(RecordingOptions));\n  }\n\n  private void ProcessListMenuItem_OnClick(object sender, RoutedEventArgs e) {\n    var proc = ProcessList.SelectedItem as ProcessSummary;\n\n    if (proc != null) {\n      var sb = new StringBuilder();\n      sb.AppendLine($\"Name: {proc.Process.Name}\");\n      sb.AppendLine($\"Id: {proc.Process.ProcessId}\");\n      sb.AppendLine($\"Command line: {proc.Process.CommandLine}\");\n      sb.AppendLine($\"Duration: {proc.Duration}\");\n      sb.AppendLine($\"Weight: {proc.Weight}\");\n      Clipboard.SetText(sb.ToString());\n    }\n  }\n\n  private void RefreshProcessButton_OnClick(object sender, RoutedEventArgs e) {\n    UpdateRunningProcessList();\n  }\n\n  private void UpdateRunningProcessList() {\n    var runningProcs = Process.GetProcesses();\n    var list = new List<ProcessSummary>();\n    int currentProcId = Process.GetCurrentProcess().Id;\n\n    foreach (var proc in runningProcs) {\n      if (proc.Id == currentProcId) {\n        continue; // Ignore self.\n      }\n\n      try {\n        // Filter list down to .NET processes if requested.\n        if (ShowOnlyManagedProcesses &&\n            !IsManagedProcess(proc)) {\n          continue;\n        }\n\n        var procProfile = new ProfileProcess(proc.Id, -1, proc.ProcessName, proc.ProcessName, \"\");\n        list.Add(new ProcessSummary(procProfile, TimeSpan.Zero));\n\n        // Retrieving values below may fail.\n        procProfile.ImageFileName = proc.MainWindowTitle;\n        procProfile.StartTime = proc.StartTime;\n      }\n      catch (Exception ex) {\n        Trace.WriteLine($\"Failed to get proc title {proc.ProcessName}: {ex.Message}\");\n      }\n    }\n\n    list.Sort((a, b) => a.Process.Name.CompareTo(b.Process.Name));\n    var procList = new ObservableCollectionRefresh<ProcessSummary>(list);\n    processFilter_ = procList.GetFilterView();\n    processFilter_.Filter = FilterRunningProcessList;\n    RunningProcessList.ItemsSource = null;\n    RunningProcessList.ItemsSource = processFilter_;\n  }\n\n  private bool IsManagedProcess(Process proc) {\n    //? TODO: Detecting .NET procs is extremely slow done like below\n    foreach (object mod in proc.Modules) {\n      if (mod is ProcessModule module &&\n          module.ModuleName.Contains(\"mscor\", StringComparison.OrdinalIgnoreCase)) {\n        return true;\n      }\n    }\n\n    return false;\n  }\n\n  private bool FilterRunningProcessList(object value) {\n    string text = ProcessFilter.Text.Trim();\n\n    if (text.Length < 2) {\n      return true;\n    }\n\n    var proc = (ProcessSummary)value;\n\n    if (proc.Process.Name.Contains(text, StringComparison.OrdinalIgnoreCase) ||\n        proc.Process.ProcessId.ToString().Contains(text) ||\n        proc.Process.ImageFileName != null &&\n        proc.Process.ImageFileName.Contains(text, StringComparison.OrdinalIgnoreCase)) {\n      return true;\n    }\n\n    return false;\n  }\n\n  private void ProcessFilter_TextChanged(object sender, TextChangedEventArgs e) {\n    processFilter_?.Refresh();\n  }\n\n  private void RunningProcessList_SelectionChanged(object sender, SelectionChangedEventArgs e) {\n    if (RunningProcessList.SelectedItems.Count > 0) {\n      selectedProcSummary_ = new List<ProcessSummary>(RunningProcessList.SelectedItems.OfType<ProcessSummary>());\n    }\n    else {\n      selectedProcSummary_ = null;\n    }\n  }\n\n  private void AttachRadioButton_Click(object sender, RoutedEventArgs e) {\n    UpdateRunningProcessList();\n  }\n\n  private async void RunningProcessList_DoubleClick(object sender, MouseButtonEventArgs e) {\n    await StartRecordingSession();\n  }\n\n  private void SystemWideRadioButton_Click(object sender, RoutedEventArgs e) {\n    RecordingOptions.ProfileDotNet = false;\n    OnPropertyChange(nameof(RecordingOptions));\n  }\n\n  private void SymbolPath_LostFocus(object sender, RoutedEventArgs e) {\n    var textBox = sender as FileSystemTextBox;\n    UpdateSymbolPath(textBox);\n  }\n\n  private void SymbolPath_KeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Enter) {\n      var textBox = sender as FileSystemTextBox;\n      UpdateSymbolPath(textBox);\n    }\n  }\n\n  private void UpdateSymbolPath(FileSystemTextBox textBox) {\n    if (textBox == null) {\n      return;\n    }\n\n    object item = textBox.DataContext;\n    int index = symbolSettings_.SymbolPaths.IndexOf(item as string);\n\n    if (index == -1) {\n      return;\n    }\n\n    // Update list with the new text.\n    string newSymbolPath = Utils.RemovePathQuotes(textBox.Text);\n    textBox.Text = newSymbolPath;\n\n    if (symbolSettings_.SymbolPaths[index] != newSymbolPath) {\n      symbolSettings_.SymbolPaths[index] = newSymbolPath;\n      SymbolOptionsPanel.ReloadSettings();\n    }\n  }\n\n  private async void ProcessList_PreviewKeyDown(object sender, KeyEventArgs e) {\n    if (e.Key == Key.Enter) {\n      await LoadProfileTraceFileAndCloseWindow(symbolSettings_);\n    }\n  }\n\n  // To be wrapped as a ColumnFieldMappingDelegate for use by GridViewColumnValueSorter instantiation\n  private ProcessSortField MapColumnNameToSortField(string columnName) {\n    return columnName switch {\n      \"ProcessNameColumn\" => ProcessSortField.ProcessName,\n      \"WeightPercentageColumn\" => ProcessSortField.Weight,\n      \"DurationColumn\" => ProcessSortField.Duration,\n      \"ProcessIdColumn\" => ProcessSortField.ProcessId,\n      \"ProcessCommandLineColumn\" => ProcessSortField.CommandLine,\n      _ => ProcessSortField.ProcessName\n    };\n  }\n\n  // To be wrapped as a ValueCompareDelegate for use by GridViewColumnValueSorter instantiation\n  private int CompareProcessSummaryValues(object x, object y, ProcessSortField field,\n                                          ListSortDirection direction, object tag) {\n    if (x is not ProcessSummary processX || y is not ProcessSummary processY) {\n      return 0;\n    }\n\n    int result = field switch {\n      ProcessSortField.ProcessName => string.Compare(processX.Process.Name, processY.Process.Name, StringComparison.OrdinalIgnoreCase),\n      ProcessSortField.Weight => processX.Weight.CompareTo(processY.Weight),\n      ProcessSortField.Duration => processX.Duration.CompareTo(processY.Duration),\n      ProcessSortField.ProcessId => processX.Process.ProcessId.CompareTo(processY.Process.ProcessId),\n      ProcessSortField.CommandLine => string.Compare(processX.Process.CommandLine, processY.Process.CommandLine, StringComparison.OrdinalIgnoreCase),\n      _ => 0\n    };\n\n    return direction == ListSortDirection.Ascending ? result : -result;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/RecordingSession.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Windows;\nusing ProfileExplorer.UI.Profile;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.Core.Utilities;\n\nnamespace ProfileExplorer.UI;\n\npublic class RecordingSession : BindableObject {\n  private static readonly SortedList<double, Func<TimeSpan, string>> offsets =\n    new() {\n      {0.75, x => $\"{x.TotalSeconds:F0} seconds\"},\n      {1.5, x => \"a minute\"},\n      {45, x => $\"{x.TotalMinutes:F0} minutes\"},\n      {90, x => \"an hour\"},\n      {1440, x => $\"{x.TotalHours:F0} hours\"},\n      {2880, x => \"a day\"},\n      {43200, x => $\"{x.TotalDays:F0} days\"},\n      {86400, x => \"a month\"},\n      {525600, x => $\"{x.TotalDays / 30:F0} months\"},\n      {1051200, x => \"a year\"},\n      {double.MaxValue, x => $\"{x.TotalDays / 365:F0} years\"}\n    };\n  private ProfileDataReport report_;\n  private bool isLoadedFile_;\n  private bool isNewSession_;\n  private string title_;\n  private string description_;\n\n  public RecordingSession(ProfileDataReport report, bool isLoadedFile,\n                          bool isNewSession = false,\n                          string title = null, string description = null) {\n    report_ = report;\n    isLoadedFile_ = isLoadedFile;\n    isNewSession_ = isNewSession;\n    title_ = title;\n    description_ = description;\n  }\n\n  public ProfileDataReport Report => report_;\n\n  public bool IsNewSession {\n    get => isNewSession_;\n    set => SetAndNotify(ref isNewSession_, value);\n  }\n\n  public string Title {\n    get {\n      if (!string.IsNullOrEmpty(title_)) {\n        return title_;\n      }\n\n      if (isLoadedFile_) {\n        return report_.TraceInfo.TraceFilePath;\n      }\n\n      if (report_.RecordingSessionOptions.HasTitle) {\n        return report_.RecordingSessionOptions.Title;\n      }\n\n      if (report_.IsAttachToProcessSession) {\n        return $\"Attached to {report_.Process.Name}\";\n      }\n\n      if (Report.IsStartProcessSession) {\n        return Utils.TryGetFileName(report_.RecordingSessionOptions.ApplicationPath);\n      }\n\n      return null;\n    }\n    set => SetAndNotify(ref title_, value);\n  }\n\n  public string TraceFile => isLoadedFile_ ? Utils.TryGetFileName(report_.TraceInfo.TraceFilePath) : null;\n  public string TraceProcess => isLoadedFile_ ? report_?.Process.ImageFileName : null;\n  public string TraceTime => report_.TraceInfo.ProfileStartTime.ToShortDateString();\n\n  public string ToolTip {\n    get {\n      if (report_ == null) {\n        return null;\n      }\n\n      if (isLoadedFile_) {\n        return report_?.TraceInfo.TraceFilePath;\n      }\n\n      if (report_.IsStartProcessSession) {\n        return\n          $\"{report_?.RecordingSessionOptions.ApplicationPath} {report_?.RecordingSessionOptions.ApplicationArguments}\";\n      }\n\n      return null;\n    }\n  }\n\n  public string Description {\n    get {\n      if (!string.IsNullOrEmpty(description_)) {\n        return description_;\n      }\n\n      if (!IsNewSession) {\n        if (isLoadedFile_) {\n          return $\"Process: {report_?.Process.ImageFileName}\";\n        }\n\n        if (report_.IsAttachToProcessSession) {\n          return $\"Id: {report_.Process.ProcessId}\";\n        }\n\n        if (report_.IsStartProcessSession) {\n          return $\"Args: {report_.RecordingSessionOptions.ApplicationArguments}\";\n        }\n      }\n\n      return null;\n    }\n    set => SetAndNotify(ref description_, value);\n  }\n\n  public bool ShowDescription {\n    get {\n      if (!string.IsNullOrEmpty(description_)) {\n        return true;\n      }\n\n      if (!IsNewSession) {\n        return !string.IsNullOrEmpty(isLoadedFile_ ? report_?.Process.ImageFileName\n                                       : report_.RecordingSessionOptions.ApplicationArguments);\n      }\n\n      return false;\n    }\n  }\n\n  public string Time => IsNewSession ? \"\"\n    : $\"{report_.TraceInfo.ProfileStartTime.ToShortDateString()}, {ToRelativeDate(report_.TraceInfo.ProfileStartTime)}\";\n\n  public static RecordingSession FromCommandLineArgs() {\n    string[] args = Environment.GetCommandLineArgs();\n\n    if (args.Length >= 5 && args[1] == \"--open-trace\") {\n      var report = new ProfileDataReport();\n      report.TraceInfo = new ProfileTraceInfo(args[2]);\n\n      if (!File.Exists(report.TraceInfo.TraceFilePath) ||\n          Path.GetExtension(report.TraceInfo.TraceFilePath) != \".etl\") {\n        MessageBox.Show(\"Trace file does not exist.\");\n        return null;\n      }\n\n      string processName = args[3];\n\n      if (!int.TryParse(args[4], out int processId)) {\n        MessageBox.Show(\"Process ID is not an integer.\");\n        return null;\n      }\n\n      report.Process = new ProfileProcess(processId, processName);\n\n      if (args.Length >= 6) {\n        report.SymbolSettings = App.Settings.SymbolSettings.WithSymbolPaths(args[5]);\n      }\n\n      return new RecordingSession(report, true);\n    }\n\n    return null;\n  }\n\n  public static RecordingSession FromFile(string filePath) {\n    var report = new ProfileDataReport();\n    report.TraceInfo = new ProfileTraceInfo(filePath);\n    return new RecordingSession(report, true);\n  }\n\n  public static string ToRelativeDate(DateTime input) {\n    var x = DateTime.Now - input;\n    x = new TimeSpan(Math.Abs(x.Ticks));\n    return offsets.First(n => x.TotalMinutes < n.Key).Value(x) + \" ago\";\n  }\n\n  public override string ToString() {\n    return Title;\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/TextInputWindow.xaml",
    "content": "﻿<Window\n  x:Class=\"ProfileExplorer.UI.Windows.TextInputWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  Title=\"{Binding InputTitle}\"\n  Width=\"400\"\n  Height=\"130\"\n  ResizeMode=\"CanResizeWithGrip\"\n  WindowStyle=\"ToolWindow\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"38\" />\n    </Grid.RowDefinitions>\n    <Grid.ColumnDefinitions>\n      <ColumnDefinition Width=\"115\" />\n      <ColumnDefinition />\n    </Grid.ColumnDefinitions>\n\n    <StackPanel\n      Grid.Row=\"0\"\n      Grid.Column=\"0\"\n      Grid.ColumnSpan=\"2\">\n      <TextBlock\n        Margin=\"16,8,16,0\"\n        Text=\"{Binding InputPrompt}\" />\n      <Grid Margin=\"16,4,16,0\">\n        <TextBox\n          x:Name=\"AutocompleteBox\"\n          Height=\"22\"\n          HorizontalAlignment=\"Stretch\"\n          BorderBrush=\"{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}\" />\n      </Grid>\n      <Grid Margin=\"16,4,16,0\" />\n    </StackPanel>\n\n\n    <StackPanel\n      Grid.Row=\"1\"\n      Grid.Column=\"0\"\n      Width=\"80\"\n      Margin=\"16,4,0,8\"\n      HorizontalAlignment=\"Left\"\n      Orientation=\"Horizontal\" />\n\n    <StackPanel\n      Grid.Row=\"1\"\n      Grid.Column=\"1\"\n      Width=\"115\"\n      Margin=\"0,4,16,8\"\n      HorizontalAlignment=\"Right\"\n      FlowDirection=\"RightToLeft\"\n      Orientation=\"Horizontal\">\n\n      <Button\n        x:Name=\"UpdateButton\"\n        Height=\"24\"\n        Padding=\"4,0,4,0\"\n        HorizontalAlignment=\"Right\"\n        Background=\"#FFFCF4CC\"\n        Click=\"AcceptButton_Click\"\n        Content=\"{Binding AcceptButtonLabel}\" />\n      <Button\n        x:Name=\"CancelButton\"\n        Height=\"24\"\n        Margin=\"4,0,4,0\"\n        Padding=\"4,0,4,0\"\n        Click=\"CancelButton_Click\"\n        Content=\"{Binding CancelButtonLabel}\"\n        IsCancel=\"True\" />\n    </StackPanel>\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/TextInputWindow.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Windows;\nusing System.Windows.Input;\n\nnamespace ProfileExplorer.UI.Windows;\n\npublic partial class TextInputWindow : Window {\n  public TextInputWindow() {\n    InitializeComponent();\n    Loaded += (sender, args) => {\n      // Bring on top of popup windows.\n      Utils.SetAlwaysOnTop(this, true, Width, Height);\n      AutocompleteBox.Focus();\n    };\n\n    PreviewKeyDown += (sender, args) => {\n      if (args.Key == Key.Escape) {\n        Cancel();\n      }\n      else if (args.Key == Key.Return) {\n        Accept();\n      }\n    };\n  }\n\n  public TextInputWindow(string title, string prompt,\n                         string acceptButtonLabel, string cancelButtonLabel,\n                         Window owner = null) : this() {\n    Title = title;\n    InputPrompt = prompt;\n    AcceptButtonLabel = acceptButtonLabel;\n    CancelButtonLabel = cancelButtonLabel;\n    Owner = owner;\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public string InputTitle { get; set; }\n  public string InputPrompt { get; set; }\n  public string AcceptButtonLabel { get; set; }\n  public string CancelButtonLabel { get; set; }\n\n  public bool Show(out string inputText, bool showNextToMouseCursor) {\n    DataContext = this;\n\n    if (showNextToMouseCursor) {\n      var position = Mouse.GetPosition(Application.Current.MainWindow);\n      var screenPosition = Application.Current.MainWindow.PointToScreen(position);\n      screenPosition = Utils.CoordinatesToScreen(screenPosition, Application.Current.MainWindow);\n      Left = screenPosition.X + SystemParameters.CursorWidth / 2;\n      Top = screenPosition.Y + SystemParameters.CursorHeight / 2;\n    }\n    else if (Owner != null) {\n      WindowStartupLocation = WindowStartupLocation.CenterOwner;\n    }\n    else {\n      WindowStartupLocation = WindowStartupLocation.CenterScreen;\n    }\n\n    bool? result = ShowDialog();\n\n    if (result == true) {\n      inputText = AutocompleteBox.Text.Trim();\n      return !string.IsNullOrEmpty(inputText);\n    }\n\n    inputText = null;\n    return false;\n  }\n\n  private void AcceptButton_Click(object sender, RoutedEventArgs e) {\n    Accept();\n  }\n\n  private void Accept() {\n    if (!string.IsNullOrEmpty(AutocompleteBox.Text.Trim())) {\n      DialogResult = true;\n      Close();\n    }\n  }\n\n  private void CancelButton_Click(object sender, RoutedEventArgs e) {\n    Cancel();\n  }\n\n  private void Cancel() {\n    DialogResult = false;\n    Close();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/UpdateWindow.xaml",
    "content": "﻿<Window\n  x:Class=\"ProfileExplorer.UI.UpdateWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:wv2=\"clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf\"\n  Title=\"Profile Explorer Update\"\n  Width=\"700\"\n  Height=\"500\"\n  Loaded=\"Window_Loaded\"\n  ResizeMode=\"CanResizeWithGrip\"\n  ShowInTaskbar=\"False\"\n  SnapsToDevicePixels=\"True\"\n  WindowStartupLocation=\"CenterOwner\"\n  WindowStyle=\"ToolWindow\"\n  mc:Ignorable=\"d\">\n  <Grid Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\">\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"80\" />\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"32\" />\n    </Grid.RowDefinitions>\n    <DockPanel Grid.Row=\"0\">\n      <StackPanel\n        Margin=\"0,8,0,0\"\n        Orientation=\"Vertical\">\n        <StackPanel Orientation=\"Horizontal\">\n          <TextBlock\n            Margin=\"8,4,0,0\"\n            FontSize=\"13\"\n            Text=\"Available version: \" />\n          <TextBlock\n            x:Name=\"NewVersionLabel\"\n            Margin=\"8,4,0,0\"\n            FontSize=\"13\"\n            FontWeight=\"SemiBold\"\n            Text=\"0.0.0\" />\n        </StackPanel>\n\n        <StackPanel Orientation=\"Horizontal\">\n          <TextBlock\n            Margin=\"8,2,0,0\"\n            FontSize=\"13\"\n            Text=\"Current version: \" />\n          <TextBlock\n            x:Name=\"CurrentVersionLabel\"\n            Margin=\"16,2,0,0\"\n            FontSize=\"13\"\n            FontWeight=\"SemiBold\"\n            Text=\"0.0.0\" />\n        </StackPanel>\n\n        <TextBlock\n          Margin=\"8,8,0,8\"\n          FontSize=\"14\"\n          FontWeight=\"Medium\"\n          Text=\"Release notes\" />\n      </StackPanel>\n\n    </DockPanel>\n    <wv2:WebView2\n      x:Name=\"Browser\"\n      Grid.Row=\"1\"\n      Margin=\"0,6,0,4\" />\n    <StackPanel\n      Grid.Row=\"2\"\n      Margin=\"0,4,8,4\"\n      HorizontalAlignment=\"Right\"\n      Orientation=\"Horizontal\">\n      <Button\n        x:Name=\"CancelButton\"\n        Margin=\"0,0,4,0\"\n        Padding=\"4,1,4,1\"\n        Click=\"CancelButton_Click\"\n        Content=\"Cancel\" />\n      <Button\n        x:Name=\"UpdateButton\"\n        Padding=\"4,1,4,1\"\n        Background=\"#FFAFEABF\"\n        Click=\"UpdateButton_Click\"\n        Content=\"Install Update\" />\n    </StackPanel>\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/UpdateWindow.xaml.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.Windows;\nusing AutoUpdaterDotNET;\nusing Microsoft.Web.WebView2.Core;\n\nnamespace ProfileExplorer.UI;\n\npublic partial class UpdateWindow : Window {\n  private UpdateInfoEventArgs updateInfo_;\n\n  public UpdateWindow(UpdateInfoEventArgs args) {\n    updateInfo_ = args;\n    InitializeComponent();\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n  public bool InstallUpdate { get; set; }\n\n  private void UpdateButton_Click(object sender, RoutedEventArgs e) {\n    using var centerForm = new DialogCenteringHelper(this);\n\n    if (MessageBox.Show(\n          \"Download and update to the latest version?\\nThis will close the current session and restart the application.\",\n          \"Profile Explorer\", MessageBoxButton.YesNo, MessageBoxImage.Information) !=\n        MessageBoxResult.Yes) {\n      return;\n    }\n\n    try {\n      if (AutoUpdater.DownloadUpdate(updateInfo_)) {\n        InstallUpdate = true;\n        DialogResult = true;\n        Close();\n      }\n    }\n    catch (Exception ex) {\n      MessageBox.Show($\"Failed to download update: {ex}\", \"Profile Explorer\", MessageBoxButton.OK,\n                      MessageBoxImage.Error);\n    }\n  }\n\n  private async void Window_Loaded(object sender, RoutedEventArgs e) {\n    try {\n      if (updateInfo_ != null) {\n        NewVersionLabel.Text = updateInfo_.CurrentVersion;\n        CurrentVersionLabel.Text = updateInfo_.InstalledVersion.ToString();\n\n        if (string.IsNullOrEmpty(updateInfo_.ChangelogURL)) {\n          return;\n        }\n\n        // Force light mode for the WebView2 control for now.\n        var webView2Environment = await CoreWebView2Environment.CreateAsync(null, App.GetSettingsDirectoryPath());\n\n        try {\n          await Browser.EnsureCoreWebView2Async(webView2Environment);\n\n          if (Browser.CoreWebView2 == null) {\n            Trace.WriteLine(\"Failed to initialize WebView2 control in UpdateWindow.\");\n            return;\n          }\n        }\n        catch (Exception ex) {\n          Trace.WriteLine($\"Failed to initialize WebView2 control in UpdateWindow: {ex.Message}\");\n          return;\n        }\n\n        Browser.CoreWebView2.Profile.PreferredColorScheme = CoreWebView2PreferredColorScheme.Light;\n        Browser.Source = new Uri(updateInfo_.ChangelogURL);\n      }\n    }\n    catch (Exception ex) {\n      Trace.WriteLine($\"Failed to release notes: {ex}\");\n    }\n  }\n\n  private void CancelButton_Click(object sender, RoutedEventArgs e) {\n    Close();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/WorkspacesWindow.xaml",
    "content": "﻿<Window\n  x:Class=\"ProfileExplorer.UI.Windows.WorkspacesWindow\"\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:d=\"http://schemas.microsoft.com/expression/blend/2008\"\n  xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\"\n  xmlns:windows=\"clr-namespace:ProfileExplorer.UI.Windows\"\n  Title=\"Manage Workspaces\"\n  Width=\"500\"\n  Height=\"300\"\n  Background=\"{DynamicResource {x:Static SystemColors.ControlBrushKey}}\"\n  ResizeMode=\"CanResizeWithGrip\"\n  ShowInTaskbar=\"False\"\n  SnapsToDevicePixels=\"True\"\n  UseLayoutRounding=\"True\"\n  WindowStartupLocation=\"CenterOwner\"\n  WindowStyle=\"ToolWindow\"\n  mc:Ignorable=\"d\">\n  <Grid Margin=\"4\">\n    <Grid.LayoutTransform>\n      <ScaleTransform ScaleX=\"{Binding WindowScaling}\" ScaleY=\"{Binding WindowScaling}\" />\n    </Grid.LayoutTransform>\n    <Grid.RowDefinitions>\n      <RowDefinition Height=\"*\" />\n      <RowDefinition Height=\"30\" />\n    </Grid.RowDefinitions>\n    <Grid.ColumnDefinitions>\n      <ColumnDefinition Width=\"*\" />\n      <ColumnDefinition Width=\"80\" />\n    </Grid.ColumnDefinitions>\n\n    <ListView\n      x:Name=\"WorkspacesList\"\n      Grid.Row=\"0\"\n      Grid.Column=\"0\"\n      Margin=\"4,4,4,8\"\n      IsTextSearchEnabled=\"True\"\n      SelectionMode=\"Single\"\n      TextSearch.TextPath=\"Name\">\n      <ListView.View>\n        <GridView>\n          <GridViewColumn\n            Width=\"Auto\"\n            Header=\"Name\">\n            <GridViewColumn.HeaderContainerStyle>\n              <Style TargetType=\"{x:Type GridViewColumnHeader}\">\n                <Setter Property=\"HorizontalContentAlignment\" Value=\"Left\" />\n              </Style>\n            </GridViewColumn.HeaderContainerStyle>\n            <GridViewColumn.CellTemplate>\n              <DataTemplate>\n                <TextBox\n                  x:Name=\"NameTextBox\"\n                  AcceptsReturn=\"False\"\n                  Background=\"Transparent\"\n                  BorderThickness=\"0\"\n                  MaxLines=\"1\"\n                  PreviewMouseLeftButtonDown=\"TextBox_PreviewMouseLeftButtonDown\">\n                  <TextBox.Text>\n                    <Binding\n                      Mode=\"TwoWay\"\n                      Path=\"Name\"\n                      UpdateSourceTrigger=\"PropertyChanged\"\n                      ValidatesOnDataErrors=\"True\">\n                      <Binding.ValidationRules>\n                        <windows:WorkspaceNameValidator\n                          ValidatesOnTargetUpdated=\"False\"\n                          ValidationStep=\"RawProposedValue\" />\n                      </Binding.ValidationRules>\n                    </Binding>\n                  </TextBox.Text>\n                  <TextBox.Style>\n                    <Style TargetType=\"TextBox\">\n                      <Style.Triggers>\n                        <Trigger Property=\"IsFocused\" Value=\"True\">\n                          <Setter Property=\"IsReadOnly\" Value=\"False\" />\n                        </Trigger>\n                        <Trigger Property=\"IsFocused\" Value=\"False\">\n                          <Setter Property=\"IsReadOnly\" Value=\"True\" />\n                        </Trigger>\n                      </Style.Triggers>\n                    </Style>\n                  </TextBox.Style>\n                </TextBox>\n              </DataTemplate>\n            </GridViewColumn.CellTemplate>\n          </GridViewColumn>\n        </GridView>\n      </ListView.View>\n\n      <ListView.ItemContainerStyle>\n        <Style\n          BasedOn=\"{StaticResource FlatListViewItem}\"\n          TargetType=\"{x:Type ListViewItem}\">\n          <Setter Property=\"Background\" Value=\"{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}\" />\n          <Setter Property=\"HorizontalContentAlignment\" Value=\"Stretch\" />\n        </Style>\n      </ListView.ItemContainerStyle>\n    </ListView>\n    <StackPanel\n      Grid.Row=\"0\"\n      Grid.Column=\"1\"\n      Margin=\"2,4,4,4\">\n      <Button\n        Height=\"24\"\n        Padding=\"2\"\n        HorizontalContentAlignment=\"Left\"\n        Click=\"SaveButton_OnClick\"\n        ToolTip=\"Save current view configuration as a new workspace\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource PlusIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"New\" />\n        </StackPanel>\n      </Button>\n      <Button\n        Height=\"24\"\n        Margin=\"0,2,0,0\"\n        Padding=\"2\"\n        HorizontalContentAlignment=\"Left\"\n        Click=\"RemoveButton_Click\"\n        ToolTip=\"Remove selected workspace\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource MinusIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"Remove\" />\n        </StackPanel>\n      </Button>\n      <Button\n        Height=\"24\"\n        Margin=\"0,2,0,0\"\n        Padding=\"2\"\n        HorizontalContentAlignment=\"Left\"\n        IsEnabled=\"False\"\n        ToolTip=\"Move workspace up in the main window dropdown list\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource UpArrowIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"Up\" />\n        </StackPanel>\n      </Button>\n      <Button\n        Height=\"24\"\n        Margin=\"0,2,0,0\"\n        Padding=\"2\"\n        HorizontalContentAlignment=\"Left\"\n        IsEnabled=\"False\"\n        ToolTip=\"Move workspace down in the main window dropdown list\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource DownArrowIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"Down\" />\n        </StackPanel>\n      </Button>\n    </StackPanel>\n\n    <StackPanel\n      Grid.Row=\"1\"\n      Grid.Column=\"0\"\n      Grid.ColumnSpan=\"2\"\n      Margin=\"4,0,4,4\"\n      VerticalAlignment=\"Top\"\n      Orientation=\"Horizontal\"\n      ToolTip=\"Restore the predefined workspaces\">\n      <Button\n        Height=\"24\"\n        Padding=\"4,2,4,2\"\n        HorizontalContentAlignment=\"Left\"\n        Click=\"DefaultButton_OnClick\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource UndoIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"Default\" />\n        </StackPanel>\n      </Button>\n      <Button\n        Height=\"24\"\n        Margin=\"2,0,0,0\"\n        Padding=\"4,2,4,2\"\n        HorizontalContentAlignment=\"Left\"\n        Click=\"ImportButton_Click\"\n        ToolTip=\"Import all workspaces from an exported ZIP file\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource FolderIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"Import\" />\n        </StackPanel>\n      </Button>\n      <Button\n        Height=\"24\"\n        Margin=\"2,0,0,0\"\n        Padding=\"4,2,4,2\"\n        HorizontalContentAlignment=\"Left\"\n        Click=\"ExportButton_Click\"\n        ToolTip=\"Export all workspaces to a ZIP file\">\n        <StackPanel Orientation=\"Horizontal\">\n          <Image\n            Width=\"16\"\n            Height=\"16\"\n            Source=\"{StaticResource SaveIcon}\" />\n          <TextBlock\n            Margin=\"4,0,0,0\"\n            Text=\"Export\" />\n        </StackPanel>\n      </Button>\n\n    </StackPanel>\n\n    <Button\n      Grid.Row=\"1\"\n      Grid.Column=\"1\"\n      Height=\"24\"\n      Margin=\"0,0,4,4\"\n      Padding=\"4,2,4,2\"\n      HorizontalContentAlignment=\"Center\"\n      Click=\"CloseButton_Click\"\n      Content=\"Close\" />\n  </Grid>\n</Window>"
  },
  {
    "path": "src/ProfileExplorerUI/Windows/WorkspacesWindow.xaml.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Globalization;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing ProfileExplorer.UI.Settings;\n\nnamespace ProfileExplorer.UI.Windows;\n\npublic class WorkspaceNameValidator : ValidationRule {\n  public override ValidationResult Validate(object value, CultureInfo cultureInfo) {\n    if (value is not string stringValue ||\n        string.IsNullOrWhiteSpace(stringValue)) {\n      return new ValidationResult(false, \"Invalid workspace name\");\n    }\n\n    if (App.Settings.WorkspaceOptions.HasWorkspace(stringValue)) {\n      return new ValidationResult(false, \"Workspace name already exists\");\n    }\n\n    return ValidationResult.ValidResult;\n  }\n}\n\npublic partial class WorkspacesWindow : Window {\n  private WorkspaceSettings settings_;\n\n  public WorkspacesWindow() {\n    InitializeComponent();\n    settings_ = App.Settings.WorkspaceOptions;\n    ReloadWorkspacesList();\n\n    Closing += (sender, args) => {\n      settings_.SaveWorkspaces();\n      App.SaveApplicationSettings();\n    };\n  }\n\n  public double WindowScaling => App.Settings.GeneralSettings.WindowScaling;\n\n  private void ReloadWorkspacesList() {\n    var list = new ObservableCollectionRefresh<Workspace>(settings_.Workspaces);\n    WorkspacesList.ItemsSource = list;\n  }\n\n  private void DefaultButton_OnClick(object sender, RoutedEventArgs e) {\n    if (Utils.ShowYesNoMessageBox(\"Restore builtin, default workspaces?\", this) == MessageBoxResult.No) {\n      return;\n    }\n\n    if (!settings_.RestoreDefaultWorkspaces()) {\n      Utils.ShowErrorMessageBox(\"Failed to restore default workspaces.\", this);\n    }\n\n    ReloadWorkspacesList();\n  }\n\n  private void SaveButton_OnClick(object sender, RoutedEventArgs e) {\n    var ws = settings_.CreateWorkspace(\"Untitled\");\n    var mainWindow = Application.Current.MainWindow as MainWindow;\n\n    if (!mainWindow.SaveDockLayout(ws.FilePath)) {\n      Utils.ShowErrorMessageBox(\"Failed to create workspace.\", this);\n      settings_.RemoveWorkspace(ws);\n      return;\n    }\n\n    ReloadWorkspacesList();\n    Utils.SelectEditableListViewItem(WorkspacesList, ws.Order);\n  }\n\n  private void TextBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {\n    if (sender is TextBox textBox) {\n      Utils.SelectTextBoxListViewItem(textBox, WorkspacesList);\n    }\n  }\n\n  private void RemoveButton_Click(object sender, RoutedEventArgs e) {\n    var selectedWs = WorkspacesList.SelectedItem as Workspace;\n\n    if (selectedWs != null &&\n        Utils.ShowYesNoMessageBox(\"Do you want to remove the selected workspace?\", this) ==\n        MessageBoxResult.Yes) {\n      settings_.RemoveWorkspace(selectedWs);\n      ReloadWorkspacesList();\n    }\n  }\n\n  private void ExportButton_Click(object sender, RoutedEventArgs e) {\n    string path = Utils.ShowSaveFileDialog(\"ZIP archive|*.zip\", \"*.zip\", \"Export workspaces\");\n\n    if (!string.IsNullOrEmpty(path)) {\n      if (!settings_.SaveToArchive(path)) {\n        Utils.ShowErrorMessageBox(\"Failed to export workspaces.\", this);\n      }\n    }\n  }\n\n  private void ImportButton_Click(object sender, RoutedEventArgs e) {\n    string path = Utils.ShowOpenFileDialog(\"ZIP archive|*.zip\", \"*.zip\", \"Import workspaces\");\n\n    if (!string.IsNullOrEmpty(path)) {\n      int loadedCount = 0;\n      var newSettings = WorkspaceSettings.LoadFromArchive(path, out loadedCount);\n\n      if (newSettings == null) {\n        Utils.ShowErrorMessageBox(\"Failed to import workspaces.\", this);\n        return;\n      }\n\n      settings_ = newSettings;\n      App.Settings.WorkspaceOptions = newSettings;\n      ReloadWorkspacesList();\n      Utils.ShowMessageBox($\"Successfully imported {loadedCount} workspaces.\", this);\n    }\n  }\n\n  private void CloseButton_Click(object sender, RoutedEventArgs e) {\n    Close();\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUI/app.manifest",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n    <assemblyIdentity version=\"1.0.0.0\" name=\"ProfilerExplorerUI.app\"/>\n    <trustInfo xmlns=\"urn:schemas-microsoft-com:asm.v2\">\n        <security>\n            <requestedPrivileges xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n                <!-- UAC Manifest Options\n                     If you want to change the Windows User Account Control level replace the\n                     requestedExecutionLevel node with one of the following.\n\n                <requestedExecutionLevel  level=\"asInvoker\" uiAccess=\"false\" />\n                <requestedExecutionLevel  level=\"requireAdministrator\" uiAccess=\"false\" />\n                <requestedExecutionLevel  level=\"highestAvailable\" uiAccess=\"false\" />\n\n                    Specifying requestedExecutionLevel element will disable file and registry virtualization.\n                    Remove this element if your application requires this virtualization for backwards\n                    compatibility.\n                -->\n                <requestedExecutionLevel level=\"asInvoker\" uiAccess=\"false\"/>\n            </requestedPrivileges>\n        </security>\n    </trustInfo>\n\n    <compatibility xmlns=\"urn:schemas-microsoft-com:compatibility.v1\">\n        <application>\n            <!-- A list of the Windows versions that this application has been tested on\n                 and is designed to work with. Uncomment the appropriate elements\n                 and Windows will automatically select the most compatible environment. -->\n\n            <!-- Windows Vista -->\n            <!--<supportedOS Id=\"{e2011457-1546-43c5-a5fe-008deee3d3f0}\" />-->\n\n            <!-- Windows 7 -->\n            <!--<supportedOS Id=\"{35138b9a-5d96-4fbd-8e2d-a2440225f93a}\" />-->\n\n            <!-- Windows 8 -->\n            <!--<supportedOS Id=\"{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}\" />-->\n\n            <!-- Windows 8.1 -->\n            <!--<supportedOS Id=\"{1f676c76-80e1-4239-95bb-83d0f6d0da78}\" />-->\n\n            <!-- Windows 10 -->\n            <supportedOS Id=\"{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}\"/>\n\n        </application>\n    </compatibility>\n\n    <!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->\n    <dependency>\n        <dependentAssembly>\n            <assemblyIdentity\n                    type=\"win32\"\n                    name=\"Microsoft.Windows.Common-Controls\"\n                    version=\"6.0.0.0\"\n                    processorArchitecture=\"*\"\n                    publicKeyToken=\"6595b64144ccf1df\"\n                    language=\"*\"/>\n        </dependentAssembly>\n    </dependency>\n\n    <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher\n         DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need\n         to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should\n         also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->\n\n    <application xmlns=\"urn:schemas-microsoft-com:asm.v3\">\n        <windowsSettings>\n            <dpiAwareness xmlns=\"http://schemas.microsoft.com/SMI/2016/WindowsSettings\">PerMonitor\n            </dpiAwareness>\n            <dpiAware xmlns=\"http://schemas.microsoft.com/SMI/2005/WindowsSettings\">true</dpiAware>\n        </windowsSettings>\n    </application>\n\n\n</assembly>"
  },
  {
    "path": "src/ProfileExplorerUI/runtimeconfig.template.json",
    "content": "{\n  \"configProperties\": {\n    \"Switch.System.Windows.Media.EnableHardwareAccelerationInRdp\": true,\n    \"Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport\": true,\n    \"System.GC.Concurrent\": true,\n    \"System.GC.Server\": true,\n    \"System.GC.HeapCount\": 16,\n    \"System.GC.HighMemoryPercent\": 50,\n    \"System.GC.RetainVM\": false\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUITests/CollectionExtensionMethodsTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core.Utilities;\nusing ProfileExplorer.UI; // Extension methods namespace\n\nnamespace ProfileExplorerUITests;\n\n[TestClass]\npublic class CollectionExtensionMethodsTests {\n  [TestMethod]\n  public void AreEqualAreEqualTest() {\n    var list1 = new List<int> {1, 2, 3};\n    var list2 = new List<int> {1, 2, 3};\n    var list3 = new List<int> {1, 2, 4};\n    var list4 = new List<int> {1, 2};\n\n    Assert.IsTrue(list1.AreEqual(list2));\n    Assert.IsFalse(list1.AreEqual(list3));\n    Assert.IsFalse(list1.AreEqual(list4));\n  }\n\n  [TestMethod]\n  public void CloneDictionaryTest() {\n    var dict1 = new Dictionary<int, string> {\n      {1, \"one\"},\n      {2, \"two\"},\n      {3, \"three\"}\n    };\n    var dict2 = dict1.CloneDictionary();\n    Assert.IsTrue(dict1.AreEqual(dict2));\n    Assert.AreNotSame(dict1, dict2);\n  }\n\n  [TestMethod]\n  public void CloneHashSetTest() {\n    var hashSet1 = new HashSet<int> {1, 2, 3};\n    var hashSet2 = hashSet1.CloneHashSet();\n    Assert.IsTrue(hashSet1.AreEqual(hashSet2));\n    Assert.AreNotSame(hashSet1, hashSet2);\n  }\n\n  [TestMethod]\n  public void DictionaryAreEqualTest() {\n    var dict1 = new Dictionary<int, string> {\n      {1, \"one\"},\n      {2, \"two\"},\n      {3, \"three\"}\n    };\n    var dict2 = new Dictionary<int, string> {\n      {1, \"one\"},\n      {2, \"two\"},\n      {3, \"three\"}\n    };\n    var dict3 = new Dictionary<int, string> {\n      {1, \"one\"},\n      {2, \"two\"},\n      {3, \"four\"}\n    };\n    var dict4 = new Dictionary<int, string> {\n      {1, \"one\"},\n      {2, \"two\"}\n    };\n\n    Assert.IsTrue(dict1.AreEqual(dict2));\n    Assert.IsFalse(dict1.AreEqual(dict3));\n    Assert.IsFalse(dict1.AreEqual(dict4));\n  }\n\n  [TestMethod]\n  public void HashSetAreEqualTest() {\n    var hashSet1 = new HashSet<int> {1, 2, 3};\n    var hashSet2 = new HashSet<int> {1, 2, 3};\n    var hashSet3 = new HashSet<int> {1, 2, 4};\n    var hashSet4 = new HashSet<int> {1, 2};\n\n    Assert.IsTrue(hashSet1.AreEqual(hashSet2));\n    Assert.IsFalse(hashSet1.AreEqual(hashSet3));\n    Assert.IsFalse(hashSet1.AreEqual(hashSet4));\n  }\n\n  [TestMethod]\n  public void AccumulateValueIntTest() {\n    var dict = new Dictionary<int, int>();\n\n    for (int i = 0; i < 1000 * 4; i++) {\n      dict.AccumulateValue(i % 4, 2);\n    }\n\n    Assert.AreEqual(2000, dict[0]);\n    Assert.AreEqual(2000, dict[1]);\n    Assert.AreEqual(2000, dict[2]);\n    Assert.AreEqual(2000, dict[3]);\n  }\n\n  [TestMethod]\n  public void AccumulateValueLongTest() {\n    var dict = new Dictionary<int, long>();\n\n    for (int i = 0; i < 1000 * 4; i++) {\n      dict.AccumulateValue(i % 4, 2);\n    }\n\n    Assert.AreEqual(2000, dict[0]);\n    Assert.AreEqual(2000, dict[1]);\n    Assert.AreEqual(2000, dict[2]);\n    Assert.AreEqual(2000, dict[3]);\n  }\n\n  [TestMethod]\n  public void AccumulateValueTimespanTest() {\n    var dict = new Dictionary<int, TimeSpan>();\n\n    for (int i = 0; i < 1000 * 4; i++) {\n      dict.AccumulateValue(i % 4, TimeSpan.FromTicks(100));\n    }\n\n    Assert.AreEqual(TimeSpan.FromTicks(100 * 1000), dict[0]);\n    Assert.AreEqual(TimeSpan.FromTicks(100 * 1000), dict[1]);\n    Assert.AreEqual(TimeSpan.FromTicks(100 * 1000), dict[2]);\n    Assert.AreEqual(TimeSpan.FromTicks(100 * 1000), dict[3]);\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUITests/GlobalUsings.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nglobal using Microsoft.VisualStudio.TestTools.UnitTesting;"
  },
  {
    "path": "src/ProfileExplorerUITests/PDBDebugInfoProviderTests.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nnamespace ProfileExplorerUITests;\n\n[TestClass]\npublic class PDBDebugInfoProviderTests {\n  [TestMethod]\n  public void TestLoadPDB() {\n  }\n\n  // TODO: Tests for\n  // - enumerate functs\n  // - get func by RVA\n  // - get func by name\n  // - get source lines\n  // - locating/downloading symbol files\n}"
  },
  {
    "path": "src/ProfileExplorerUITests/ProfileExplorerUITests.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n\t<PropertyGroup>\n\t\t<TargetFramework>net8.0-windows</TargetFramework>\n\t\t<ImplicitUsings>enable</ImplicitUsings>\n\t\t<Nullable>enable</Nullable>\n\n\t\t<IsPackable>false</IsPackable>\n\t\t<IsTestProject>true</IsTestProject>\n\t\t<RootNamespace>ProfilerExplorerUITests</RootNamespace>\n\t</PropertyGroup>\n\n\t<ItemGroup>\n\t\t<PackageReference Include=\"JetBrains.Annotations\" Version=\"2024.2.0\" />\n\t\t<PackageReference Include=\"Microsoft.NET.Test.Sdk\" Version=\"17.11.1\" />\n\t\t<PackageReference Include=\"MSTest.TestAdapter\" Version=\"3.6.1\" />\n\t\t<PackageReference Include=\"MSTest.TestFramework\" Version=\"3.6.1\" />\n\t\t<PackageReference Include=\"coverlet.collector\" Version=\"6.0.2\">\n\t\t  <PrivateAssets>all</PrivateAssets>\n\t\t  <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n\t\t</PackageReference>\n\t</ItemGroup>\n\n\t<ItemGroup>\n\t\t<ProjectReference Include=\"..\\ProfileExplorerUI\\ProfileExplorerUI.csproj\" />\n\t</ItemGroup>\n\n</Project>"
  },
  {
    "path": "src/ProfileExplorerUITests/SettingsBaseTests.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Windows.Media;\nusing ProtoBuf;\nusing ProfileExplorer.UI; // For Utils\nusing ProfileExplorer.Core.Settings; // For SettingsBase, OptionValueAttribute\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\n\nnamespace ProfileExplorerUITests.Settings;\n\n[TestClass]\npublic class SettingsBaseTests {\n  [ClassInitialize]\n  public static void ClassInitialize(TestContext context) {\n    // Register UI-specific type converters for the settings system\n    SettingsTypeRegistry.RegisterConverter(new ProfileExplorerUI.Settings.ColorSettingsConverter());\n  }\n\n  [TestMethod]\n  public void TestCollectOptions() {\n    var data = new DerivedObject();\n    var options = SettingsBase.CollectOptionMembers(data);\n    Assert.AreEqual(options.Count, 8);\n\n    int[]? expectedIds = new int[] {\n      1, 2, 3, 4, 101, 102, 103, 104\n    };\n\n    foreach (int id in expectedIds) {\n      var optionId = options.First(item => item.MemberId == id);\n      Assert.IsNotNull(optionId);\n      Assert.AreEqual(optionId.ClassName, \"DerivedObject\");\n    }\n  }\n\n  [TestMethod]\n  public void TestResetOptions() {\n    var data = new TestObject();\n    data.a = false;\n    data.b = true;\n    data.c = 456;\n    data.s = \"bar\";\n\n    data.Reset();\n    Assert.AreEqual(data.a, true);\n    Assert.AreEqual(data.b, false);\n    Assert.AreEqual(data.c, 123);\n    Assert.AreEqual(data.s, \"foo\");\n  }\n\n  [TestMethod]\n  public void TestResetOptionsNested() {\n    var data = new CombinedObject();\n    data.nested = new NestedObject();\n    data.nested.a = 789;\n    data.nested.b = 101112;\n    data.nested2 = new NestedObject();\n    data.nested2.a = 131415;\n    data.nested2.b = 161718;\n    data.a = 192021;\n    data.ns = new NonSettingsObject();\n    data.ns.a = 222324;\n    data.ns.b = 252627;\n\n    data.Reset();\n    Assert.AreEqual(data.nested.a, 123);\n    Assert.AreEqual(data.nested.b, 456);\n    Assert.AreEqual(data.nested2.a, 123);\n    Assert.AreEqual(data.nested2.b, 456);\n    Assert.AreEqual(data.a, 0);\n    Assert.AreEqual(data.ns.a, 123);\n    Assert.AreEqual(data.ns.b, 456);\n  }\n\n  [TestMethod]\n  public void TestResetOptionsNestedDerived() {\n    var data = new DerivedObject();\n    data.a = false;\n    data.b = true;\n    data.c = 456;\n    data.s = \"bar\";\n    data.d = false;\n    data.s2 = \"baz\";\n    data.color = Colors.Black;\n    data.colorArray = new Color[] {Colors.Black, Colors.White};\n\n    data.Reset();\n    Assert.AreEqual(data.a, true);\n    Assert.AreEqual(data.b, false);\n    Assert.AreEqual(data.c, 123);\n    Assert.AreEqual(data.s, \"foo\");\n    Assert.AreEqual(data.d, true);\n    Assert.AreEqual(data.s2, \"bar\");\n    Assert.AreEqual(data.color, Utils.ColorFromString(\"#F0F0F0\"));\n    Assert.AreEqual(data.colorArray[0], Utils.ColorFromString(\"#F0F0F0\"));\n    Assert.AreEqual(data.colorArray[1], Utils.ColorFromString(\"#1F2F3F\"));\n  }\n\n  [TestMethod]\n  public void TestResetOptionsCollection() {\n    var data = new CollectionObject();\n    data.list = new List<int> {1, 2, 3};\n    data.dict = new Dictionary<string, int> {{\"a\", 1}, {\"b\", 2}};\n\n    data.Reset();\n    Assert.AreEqual(data.list.Count, 0);\n    Assert.AreEqual(data.dict.Count, 0);\n  }\n\n  [TestMethod]\n  public void TestConstructOptionsCollection() {\n    var data = new CollectionObject();\n    data.Reset();\n    Assert.AreEqual(data.list.Count, 0);\n    Assert.AreEqual(data.dict.Count, 0);\n    Assert.IsTrue(data.flag);\n  }\n\n  [TestMethod]\n  public void TestAreSettingsOptionsEqual() {\n    var data1 = new TestObject();\n    var data2 = new TestObject();\n    data1.Reset();\n    data2.Reset();\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.a = false;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.a = false;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.b = true;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.b = true;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.c = 456;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.c = 456;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.s = \"bar\";\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.s = \"bar\";\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n  }\n\n  [TestMethod]\n  public void TestAreSettingsOptionsEqualNested() {\n    var data1 = new CombinedObject();\n    var data2 = new CombinedObject();\n    data1.Reset();\n    data2.Reset();\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n    Assert.IsTrue(data1.nested.EqualsCalled);\n    Assert.IsTrue(data1.nested2.EqualsCalled);\n\n    data1.nested.a = 789;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.nested.a = 789;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.nested.b = 101112;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.nested.b = 101112;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.nested2.a = 131415;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.nested2.a = 131415;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.nested2.b = 161718;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.nested2.b = 161718;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.a = 192021;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.a = 192021;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.ns.a = 222324;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.ns.a = 222324;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data1.ns.b = 252627;\n    Assert.IsFalse(SettingsBase.AreOptionsEqual(data1, data2));\n\n    data2.ns.b = 252627;\n    Assert.IsTrue(SettingsBase.AreOptionsEqual(data1, data2));\n  }\n\n  [TestMethod]\n  public void TestInitializeAllNewOptions() {\n    var data = new DerivedObject();\n    data.Reset();\n    var options = SettingsBase.CollectOptionMembers(data);\n    data.a = false;\n    data.b = true;\n    data.c = 456;\n    data.s = \"bar\";\n\n    options.RemoveWhere(item => item.MemberId >= 100);\n    SettingsBase.InitializeAllNewOptions(data, options);\n    Assert.AreEqual(data.a, true);\n    Assert.AreEqual(data.b, false);\n    Assert.AreEqual(data.c, 123);\n    Assert.AreEqual(data.s, \"foo\");\n  }\n\n  [TestMethod]\n  public void TestInitializeNoNewOptions() {\n    var data = new DerivedObject();\n    data.Reset();\n    var options = SettingsBase.CollectOptionMembers(data);\n    data.a = false;\n    data.b = true;\n    data.c = 456;\n    data.s = \"bar\";\n\n    SettingsBase.InitializeAllNewOptions(data, options);\n    Assert.AreEqual(data.a, false);\n    Assert.AreEqual(data.b, true);\n    Assert.AreEqual(data.c, 456);\n    Assert.AreEqual(data.s, \"bar\");\n  }\n\n  [TestMethod]\n  public void TestInitializeAllNewOptionsNested() {\n    var data = new CombinedObject();\n    data.Reset();\n    var options = SettingsBase.CollectOptionMembers(data);\n    data.nested = new NestedObject();\n    data.nested.a = 789;\n    data.nested.b = 101112;\n    data.nested2 = new NestedObject();\n    data.nested2.a = 131415;\n    data.nested2.b = 161718;\n\n    options.RemoveWhere(item => item.ClassName == \"NestedObject\");\n    SettingsBase.InitializeAllNewOptions(data, options);\n    Assert.AreEqual(data.nested.a, 123);\n    Assert.AreEqual(data.nested.b, 456);\n    Assert.AreEqual(data.nested2.a, 123);\n    Assert.AreEqual(data.nested2.b, 456);\n  }\n\n  [TestMethod]\n  public void TestInitializeReferenceOptions() {\n    var data = new CollectionObject();\n    SettingsBase.InitializeReferenceOptions(data);\n    Assert.IsNotNull(data.list);\n    Assert.IsNotNull(data.dict);\n    Assert.IsFalse(data.flag); // Should not be changed.\n  }\n\n  [ProtoContract()]\n  [ProtoInclude(100, typeof(DerivedObject))]\n  private class TestObject : SettingsBase {\n    [ProtoMember(1)][OptionValue(true)]\n    public bool a { get; set; }\n    [ProtoMember(2)][OptionValue(false)]\n    public bool b { get; set; }\n    [ProtoMember(3)][OptionValue(123)]\n    public int c { get; set; }\n    [ProtoMember(4)][OptionValue(\"foo\")]\n    public string s { get; set; }\n\n    public override void Reset() {\n      ResetAllOptions(this, typeof(TestObject));\n    }\n  }\n\n  [ProtoContract()]\n  private class DerivedObject : TestObject {\n    [ProtoMember(1)][OptionValue(true)]\n    public bool d { get; set; }\n    [ProtoMember(2)][OptionValue(\"bar\")]\n    public string s2 { get; set; }\n    [ProtoMember(3)][OptionValue(\"#F0F0F0\")]\n    public Color color { get; set; }\n    [ProtoMember(4)][OptionValue(new string[] {\"#F0F0F0\", \"#1F2F3F\"})]\n    public Color[] colorArray { get; set; }\n\n    public override void Reset() {\n      base.Reset();\n      ResetAllOptions(this);\n    }\n  }\n\n  [ProtoContract()]\n  private class NestedObject : SettingsBase {\n    public bool EqualsCalled = false;\n    [ProtoMember(1)][OptionValue(123)]\n    public int a { get; set; }\n    [ProtoMember(2)][OptionValue(456)]\n    public int b { get; set; }\n\n    public override void Reset() {\n      ResetAllOptions(this);\n    }\n\n    public override bool Equals(object? obj) {\n      EqualsCalled = true;\n      return a == ((NestedObject)obj).a && b == ((NestedObject)obj).b;\n    }\n  }\n\n  private class NonSettingsObject {\n    public int a { get; set; } = 123;\n    public int b { get; set; } = 456;\n\n    public override bool Equals(object? obj) {\n      return a == ((NonSettingsObject)obj).a && b == ((NonSettingsObject)obj).b;\n    }\n  }\n\n  [ProtoContract()]\n  private class CombinedObject : SettingsBase {\n    [ProtoMember(1)]\n    public NestedObject nested { get; set; }\n    [ProtoMember(2)]\n    public NestedObject nested2 { get; set; }\n    [ProtoMember(3)]\n    public int a { get; set; }\n    [ProtoMember(4)]\n    public NonSettingsObject ns { get; set; }\n    [ProtoMember(5)]\n    public TestObject test { get; set; }\n    [ProtoMember(6)]\n    public DerivedObject derived { get; set; }\n\n    public override void Reset() {\n      ResetAllOptions(this);\n    }\n  }\n\n  [ProtoContract()]\n  public class CollectionObject : SettingsBase {\n    [ProtoMember(1)][OptionValue()]\n    public List<int> list { get; set; }\n    [ProtoMember(2)][OptionValue()]\n    public Dictionary<string, int> dict { get; set; }\n    [ProtoMember(3)][OptionValue(true)]\n    public bool flag { get; set; }\n\n    public override void Reset() {\n      ResetAllOptions(this);\n    }\n  }\n}"
  },
  {
    "path": "src/ProfileExplorerUITests/SyntheticProfileTests.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing Microsoft.VisualStudio.TestTools.UnitTesting;\nusing ProfileExplorer.Core;\nusing ProfileExplorer.Core.Binary;\nusing ProfileExplorer.Core.Profile.CallTree;\nusing ProfileExplorer.Core.Profile.Data;\nusing ProfileExplorer.UI.Profile;\n\nnamespace ProfileExplorerUITests.Synthetic;\n\n[TestClass]\npublic class SyntheticProfileTests {\n  private sealed class SyntheticProfileBuilder {\n    public ProfileCallTree CallTree { get; } = new();\n    public ProfileImage Image { get; } = new(\"TestModule.dll\", \"TestModule.dll\", 0x1000, 0x1000, 0x100000, 0, 0xABCDEF);\n    public ProfileContext Context { get; } = new(100, 200, 0);\n  public IRTextSummary Summary { get; } = new(\"TestModule.dll\");\n    public IRTextFunction MainFunc { get; } = new(\"TestApp.Program.Main\");\n    public IRTextFunction FooFunc { get; } = new(\"TestApp.Work.Foo\");\n    public IRTextFunction BarFunc { get; } = new(\"TestApp.Work.Bar\");\n    public IRTextFunction BazFunc { get; } = new(\"TestApp.Work.Baz\");\n    public FunctionDebugInfo MainInfo { get; } = new(\"TestApp.Program.Main\", 0x0100, 64);\n    public FunctionDebugInfo FooInfo { get; } = new(\"TestApp.Work.Foo\", 0x0200, 64);\n    public FunctionDebugInfo BarInfo { get; } = new(\"TestApp.Work.Bar\", 0x0300, 64);\n    public FunctionDebugInfo BazInfo { get; } = new(\"TestApp.Work.Baz\", 0x0400, 64);\n\n    public void Build() {\n      // Two stacks:\n      //   Main -> Foo -> Bar\n      //   Main -> Foo -> Baz\n      // Associate synthetic functions with a summary so ModuleName is non-null.\n      Summary.AddFunction(MainFunc);\n      Summary.AddFunction(FooFunc);\n      Summary.AddFunction(BarFunc);\n      Summary.AddFunction(BazFunc);\n      BuildStack(new[] { MainFunc, FooFunc, BarFunc }, new[] { MainInfo, FooInfo, BarInfo }, TimeSpan.FromMilliseconds(10));\n      BuildStack(new[] { MainFunc, FooFunc, BazFunc }, new[] { MainInfo, FooInfo, BazInfo }, TimeSpan.FromMilliseconds(10));\n    }\n\n    private void BuildStack(IReadOnlyList<IRTextFunction> funcs, IReadOnlyList<FunctionDebugInfo> infos, TimeSpan weight) {\n      int frameCount = funcs.Count;\n      var stack = new ProfileStack(contextId: 1, framePtrs: new long[frameCount]);\n      var resolved = new ResolvedProfileStack(frameCount, Context);\n      // Add frames leaf->root so that UpdateCallTree (which walks list in reverse) sees root first.\n      for (int i = frameCount - 1, frameIndex = 0; i >= 0; i--, frameIndex++) {\n        var f = funcs[i];\n        var info = infos[i];\n        var frameKey = new ResolvedProfileStackFrameKey(info, Image, isManagedCode: false);\n        long ip = info.RVA + Image.BaseAddress; // Synthetic IP\n        resolved.AddFrame(f, ip, info.RVA, frameIndex: frameIndex, frameKey, stack, pointerSize: 8);\n      }\n      var sample = new ProfileSample(ip: 0, time: TimeSpan.Zero, weight: weight, isKernelCode: false, contextId: 0) { StackId = 0 };\n      CallTree.UpdateCallTree(ref sample, resolved);\n    }\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_RootAndChildrenStructure() {\n    var b = new SyntheticProfileBuilder();\n    b.Build();\n    var roots = b.CallTree.RootNodes;\n    Assert.AreEqual(1, roots.Count, \"Expected single root node (Main)\");\n    var main = roots[0];\n    Assert.AreEqual(\"TestApp.Program.Main\", main.FunctionName);\n    Assert.IsTrue(main.HasChildren, \"Main should have children\");\n    Assert.AreEqual(1, main.Children.Count, \"Main should have one direct child (Foo)\");\n    var foo = main.Children[0];\n    Assert.AreEqual(\"TestApp.Work.Foo\", foo.FunctionName);\n    Assert.AreEqual(2, foo.Children.Count, \"Foo should have two leaf children (Bar,Baz)\");\n    var childNames = foo.Children.Select(c => c.FunctionName).OrderBy(n => n).ToArray();\n    CollectionAssert.AreEqual(new[] { \"TestApp.Work.Bar\", \"TestApp.Work.Baz\" }, childNames);\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_WeightsAreAggregated() {\n    var b = new SyntheticProfileBuilder();\n    b.Build();\n    var main = b.CallTree.RootNodes[0];\n    Assert.AreEqual(TimeSpan.FromMilliseconds(20), main.Weight, \"Main inclusive weight mismatch\");\n    Assert.AreEqual(TimeSpan.Zero, main.ExclusiveWeight, \"Main exclusive should be zero\");\n    var foo = main.Children[0];\n    Assert.AreEqual(TimeSpan.FromMilliseconds(20), foo.Weight, \"Foo inclusive should aggregate both stacks\");\n    Assert.AreEqual(TimeSpan.Zero, foo.ExclusiveWeight, \"Foo exclusive should be zero\");\n    foreach (var leaf in foo.Children) {\n      Assert.AreEqual(TimeSpan.FromMilliseconds(10), leaf.Weight, $\"Leaf {leaf.FunctionName} inclusive weight\");\n      Assert.AreEqual(leaf.Weight, leaf.ExclusiveWeight, \"Leaf exclusive equals inclusive\");\n    }\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_GetTopFunctionsAndModules() {\n    var b = new SyntheticProfileBuilder();\n    b.Build();\n    var main = b.CallTree.RootNodes[0];\n    var (funcs, modules) = b.CallTree.GetTopFunctionsAndModules(main);\n    Assert.IsTrue(funcs.Count >= 2, \"Expected at least two functions (Bar & Baz)\");\n    var topNames = funcs.Select(f => f.FunctionName).Take(2).OrderBy(n => n).ToArray();\n    CollectionAssert.AreEquivalent(new[] { \"TestApp.Work.Bar\", \"TestApp.Work.Baz\" }, topNames);\n    Assert.AreEqual(1, modules.Count, \"Only one synthetic module expected\");\n  Assert.AreEqual(b.Image.ModuleName, modules[0].Name);\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_CombinedNodesWeight() {\n    var b = new SyntheticProfileBuilder();\n    b.Build();\n    var foo = b.CallTree.RootNodes[0].Children[0];\n    var combinedWeight = ProfileCallTree.CombinedCallTreeNodesWeight(foo.Children.ToList());\n    Assert.AreEqual(TimeSpan.FromMilliseconds(20), combinedWeight, \"Combined weight of leaf children should sum\");\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_FindMatchingNode() {\n    var b = new SyntheticProfileBuilder();\n    b.Build();\n    var foo = b.CallTree.RootNodes[0].Children[0];\n    var bar = foo.Children.First(c => c.FunctionName.EndsWith(\"Bar\"));\n    var match = b.CallTree.FindMatchingNode(bar);\n    Assert.IsNotNull(match);\n    Assert.AreSame(bar, match, \"Should match same node instance in same call tree\");\n  }\n\n  // --- Additional fast-win tests ---\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_MultiModuleAggregation() {\n    // Create two modules; split leaf functions across them.\n    var tree = new ProfileCallTree();\n    var imgA = new ProfileImage(\"ModuleA.dll\", \"ModuleA.dll\", 0x2000, 0x2000, 0x200000, 0, 0xAAA);\n    var imgB = new ProfileImage(\"ModuleB.dll\", \"ModuleB.dll\", 0x3000, 0x3000, 0x300000, 0, 0xBBB);\n    var ctx = new ProfileContext(10, 11, 0);\n    var summaryA = new IRTextSummary(\"ModuleA.dll\");\n    var summaryB = new IRTextSummary(\"ModuleB.dll\");\n    var mainFunc = new IRTextFunction(\"App.Main\"); summaryA.AddFunction(mainFunc);\n    var workFunc = new IRTextFunction(\"App.Work\"); summaryA.AddFunction(workFunc);\n    var leafA = new IRTextFunction(\"LibA.Task\"); summaryA.AddFunction(leafA);\n    var leafB = new IRTextFunction(\"LibB.Task\"); summaryB.AddFunction(leafB);\n    var mainInfo = new FunctionDebugInfo(\"App.Main\", 0x0100, 32);\n    var workInfo = new FunctionDebugInfo(\"App.Work\", 0x0110, 32);\n    var leafAInfo = new FunctionDebugInfo(\"LibA.Task\", 0x0120, 32);\n    var leafBInfo = new FunctionDebugInfo(\"LibB.Task\", 0x0130, 32);\n\n    // Stack 1: Main -> Work -> LeafA (10ms)\n    BuildStack(tree, ctx, imgA, new[]{ mainFunc, workFunc, leafA }, new[]{ mainInfo, workInfo, leafAInfo }, TimeSpan.FromMilliseconds(10));\n    // Stack 2: Main -> Work -> LeafB (30ms)\n    BuildStack(tree, ctx, imgB, new[]{ mainFunc, workFunc, leafB }, new[]{ mainInfo, workInfo, leafBInfo }, TimeSpan.FromMilliseconds(30));\n\n    var root = tree.RootNodes.Single();\n    var (funcs, modules) = tree.GetTopFunctionsAndModules(root);\n    Assert.AreEqual(2, modules.Count, \"Expect two modules\");\n    // Module exclusive weight is sum of exclusive leaf weights.\n    modules.Sort((a,b)=>b.Weight.CompareTo(a.Weight));\n    Assert.AreEqual(\"ModuleB.dll\", modules[0].Name);\n    Assert.AreEqual(TimeSpan.FromMilliseconds(30), modules[0].Weight);\n    Assert.AreEqual(\"ModuleA.dll\", modules[1].Name);\n    Assert.AreEqual(TimeSpan.FromMilliseconds(10), modules[1].Weight);\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_RecursiveFunctionGrouping_NoDoubleCount() {\n    var tree = new ProfileCallTree();\n    var img = new ProfileImage(\"Rec.dll\", \"Rec.dll\", 0x4000, 0x4000, 0x100000, 0, 0xCCC);\n    var ctx = new ProfileContext(20, 21, 0);\n    var summary = new IRTextSummary(\"Rec.dll\");\n    var rootFunc = new IRTextFunction(\"Rec.Main\"); summary.AddFunction(rootFunc);\n    var recFunc = new IRTextFunction(\"Rec.F\"); summary.AddFunction(recFunc);\n    var leafFunc = new IRTextFunction(\"Rec.Leaf\"); summary.AddFunction(leafFunc);\n    var rootInfo = new FunctionDebugInfo(\"Rec.Main\", 0x100, 16);\n    var recInfo = new FunctionDebugInfo(\"Rec.F\", 0x110, 16);\n    var leafInfo = new FunctionDebugInfo(\"Rec.Leaf\", 0x120, 16);\n\n    // Stack A: Main -> F -> F -> Leaf (15ms)\n    BuildStack(tree, ctx, img,\n      new[]{ rootFunc, recFunc, recFunc, leafFunc },\n      new[]{ rootInfo, recInfo, recInfo, leafInfo }, TimeSpan.FromMilliseconds(15));\n    // Stack B: Main -> F -> Leaf (5ms)\n    BuildStack(tree, ctx, img,\n      new[]{ rootFunc, recFunc, leafFunc },\n      new[]{ rootInfo, recInfo, leafInfo }, TimeSpan.FromMilliseconds(5));\n\n    var root = tree.RootNodes.Single();\n  var (funcs, _) = tree.GetTopFunctionsAndModules(root);\n  var recGroup = funcs.First(f => f.FunctionName == \"Rec.F\");\n  // Current implementation double-counts recursive inclusive weight; ensure both instances were captured.\n  Assert.AreEqual(2, recGroup.Nodes.Count, \"Should capture two recursive instances\");\n  Assert.AreEqual(TimeSpan.FromMilliseconds(20), root.Weight, \"Root inclusive\");\n  // The leaf function exclusive time should be 20ms aggregated under its group entry.\n  var leafGroup = funcs.First(f => f.FunctionName == \"Rec.Leaf\");\n  Assert.AreEqual(TimeSpan.FromMilliseconds(20), leafGroup.ExclusiveWeight, \"Leaf exclusive aggregated correctly\");\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_PerThreadAggregation() {\n    var tree = new ProfileCallTree();\n    var img = new ProfileImage(\"Threads.dll\", \"Threads.dll\", 0x5000, 0x5000, 0x100000, 0, 0xDDD);\n    var summary = new IRTextSummary(\"Threads.dll\");\n    var rootFunc = new IRTextFunction(\"T.Main\"); summary.AddFunction(rootFunc);\n    var workFunc = new IRTextFunction(\"T.Work\"); summary.AddFunction(workFunc);\n    var rootInfo = new FunctionDebugInfo(\"T.Main\", 0x100, 16);\n    var workInfo = new FunctionDebugInfo(\"T.Work\", 0x110, 16);\n\n    // Two threads, different weights.\n    BuildStack(tree, new ProfileContext(30, 301, 0), img,\n      new[]{ rootFunc, workFunc }, new[]{ rootInfo, workInfo }, TimeSpan.FromMilliseconds(7));\n    BuildStack(tree, new ProfileContext(30, 302, 0), img,\n      new[]{ rootFunc, workFunc }, new[]{ rootInfo, workInfo }, TimeSpan.FromMilliseconds(13));\n\n    var root = tree.RootNodes.Single();\n    Assert.AreEqual(TimeSpan.FromMilliseconds(20), root.Weight, \"Inclusive weight across threads\");\n    var work = root.Children.Single();\n    var perThread = work.SortedByWeightPerThreadWeights;\n    Assert.AreEqual(2, perThread.Count);\n    Assert.AreEqual(302, perThread[0].ThreadId); // Heavier first.\n    Assert.AreEqual(TimeSpan.FromMilliseconds(13), perThread[0].Values.Weight);\n    Assert.AreEqual(TimeSpan.FromMilliseconds(7), perThread[1].Values.Weight);\n  }\n\n  [TestMethod, TestCategory(\"Synthetic\")]\n  public void CallTree_CallSiteTargets() {\n    var b = new SyntheticProfileBuilder();\n    b.Build();\n    var main = b.CallTree.RootNodes.Single();\n    var foo = main.Children.Single();\n    // Call sites recorded on parent when adding child.\n    Assert.IsTrue(main.HasCallSites, \"Main should have call sites for Foo\");\n    var callSite = main.CallSites.Values.Single();\n    Assert.IsTrue(callSite.Weight > TimeSpan.Zero);\n    // Foo should have two call sites (Bar & Baz) aggregated via AddCallSite\n    Assert.IsTrue(foo.HasCallSites, \"Foo should have call sites to leaves\");\n    Assert.AreEqual(2, foo.CallSites.Values.Sum(cs => cs.Targets.Count), \"Two distinct leaf targets\");\n  }\n\n  // Helper used by new tests (duplicate of builder logic but with parameterization).\n  private static void BuildStack(ProfileCallTree tree, ProfileContext context, ProfileImage image,\n                                 IReadOnlyList<IRTextFunction> funcs,\n                                 IReadOnlyList<FunctionDebugInfo> infos,\n                                 TimeSpan weight) {\n    int frameCount = funcs.Count;\n    var stack = new ProfileStack(contextId: 1, framePtrs: new long[frameCount]);\n    var resolved = new ResolvedProfileStack(frameCount, context);\n    for (int i = frameCount - 1, frameIndex = 0; i >= 0; i--, frameIndex++) {\n      var f = funcs[i];\n      var info = infos[i];\n      var frameKey = new ResolvedProfileStackFrameKey(info, image, isManagedCode: false);\n      long ip = info.RVA + image.BaseAddress;\n      resolved.AddFrame(f, ip, info.RVA, frameIndex, frameKey, stack, 8);\n    }\n    var sample = new ProfileSample(0, TimeSpan.Zero, weight, false, 0) { StackId = 0 };\n    tree.UpdateCallTree(ref sample, resolved);\n  }\n}\n"
  },
  {
    "path": "src/VSExtension/App.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<configuration>\n\n</configuration>"
  },
  {
    "path": "src/VSExtension/ClientInstance.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Threading.Tasks;\nusing Grpc.Core;\nusing Microsoft.VisualStudio.Shell;\nusing Microsoft.VisualStudio.Shell.Interop;\n\nnamespace ProfileExplorerExtension;\n\nstatic class ClientInstance {\n  public static Channel serverChannel_;\n  public static DebugService.DebugServiceClient debugClient_;\n  public static long debugSessionId_;\n  public static bool debugSesssionInitialized_;\n  public static AsyncPackage Package;\n  public static bool isEnabled_;\n  public static bool hadForcedShutdown_;\n  private static readonly string DefaultProfileExplorerPath =\n    @\"C:\\Program Files (x86)\\Profile Explorer\\ProfileExplorer.exe\";\n\n  static ClientInstance() {\n    isEnabled_ = true;\n  }\n\n  public static bool IsEnabled => isEnabled_;\n  public static bool AutoAttach { get; set; }\n  public static bool IsConnected => debugSesssionInitialized_;\n\n  public static bool ToggleEnabled() {\n    isEnabled_ = !isEnabled_;\n    Logger.Log($\"Profile Explorer extension enabled: {isEnabled_}\");\n    return isEnabled_;\n  }\n\n  public static void Initialize(AsyncPackage package) {\n    Package = package;\n  }\n\n  public static void ResetForcedShutdown() {\n    hadForcedShutdown_ = false;\n  }\n\n  public static bool IsServerStarted() {\n    try {\n      CreateServerChannel();\n      var timeout = DateTime.UtcNow.AddMilliseconds(100);\n\n      return ThreadHelper.JoinableTaskFactory.Run(async () => {\n        await serverChannel_.ConnectAsync(timeout);\n        return true;\n      });\n    }\n    catch (Exception ex) {\n      //Logger.LogException(ex, \"ClientInstance exception\");\n      return false;\n    }\n  }\n\n  public static async Task<bool> WaitForDebugServer(DateTime timeout) {\n    try {\n      if (serverChannel_.State != ChannelState.Ready) {\n        bool result = await serverChannel_.TryWaitForStateChangedAsync(\n          serverChannel_.State, timeout);\n\n        return result && serverChannel_.State == ChannelState.Ready ||\n               serverChannel_.State == ChannelState.Idle;\n      }\n\n      return true;\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"ClientInstance exception\");\n      return false;\n    }\n  }\n\n  public static DebugService.DebugServiceClient GetDebugClient(\n    string processName, int processId) {\n    try {\n      if (serverChannel_ == null) {\n        serverChannel_ =\n          new Channel(\"127.0.0.1:50051\", ChannelCredentials.Insecure);\n      }\n\n      if (debugClient_ == null) {\n        Logger.Log(\"Connecting to Profile Explorer...\");\n        debugClient_ = new DebugService.DebugServiceClient(serverChannel_);\n\n        var result = debugClient_.StartSession(new StartSessionRequest {\n          Kind = ClientKind.Debugger,\n          ProcessId = processId\n        });\n\n        debugSessionId_ = result.SessionId;\n        Logger.Log(\"Connected to Profile Explorer instance\");\n      }\n\n      return debugClient_;\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to connect to Profile Explorer\");\n      return null;\n    }\n  }\n\n  public static async Task Shutdown(bool forced = false) {\n    Logger.Log($\"Shutdown force = {forced}\");\n\n    try {\n      debugClient_?.EndSession(new EndSessionRequest());\n    }\n    catch (Exception ex) {\n      //Logger.LogException(ex, \"ClientInstance exception\");\n    }\n\n    try {\n      await serverChannel_?.ShutdownAsync();\n    }\n    catch (Exception ex) {\n      //Logger.LogException(ex, \"ClientInstance exception\");\n    }\n\n    debugSesssionInitialized_ = false;\n    serverChannel_ = null;\n    debugClient_ = null;\n    debugSessionId_ = 0;\n    hadForcedShutdown_ = forced;\n    AutoAttach = false;\n  }\n\n  public static async Task<bool> RunClientCommand(Action action) {\n    bool retry = true;\n    int retryCount = 0;\n\n    while (retry && retryCount < 2) {\n      if (!await SetupDebugSession()) {\n        return false;\n      }\n\n      retry = false;\n\n      try {\n        action();\n        return true;\n      }\n      catch (RpcException rpcEx) {\n        Logger.LogException(rpcEx, \"ClientInstance RPC exception\");\n\n        switch (rpcEx.StatusCode) {\n          case StatusCode.Unavailable:\n          case StatusCode.DeadlineExceeded:\n          case StatusCode.Aborted: {\n            await Shutdown();\n            retry = true;\n            retryCount++;\n            break;\n          }\n        }\n      }\n      catch (Exception ex) {\n        Logger.LogException(ex, \"ClientInstance exception\");\n        break;\n      }\n    }\n\n    await Shutdown(true);\n    return false;\n  }\n\n  public static async Task UpdateIR() {\n    await RunClientCommand(() => { DebuggerInstance.UpdateIR(); });\n  }\n\n  public static async Task UpdateCurrentStackFrame() {\n    await RunClientCommand(() => {\n      debugClient_.UpdateCurrentStackFrame(new CurrentStackFrameRequest {\n        CurrentFrame = DebuggerInstance.GetCurrentStackFrame()\n      });\n    });\n  }\n\n  public static async Task ClearTemporaryHighlighting() {\n    await RunClientCommand(() => debugClient_.ClearTemporaryHighlighting(\n                             new ClearHighlightingRequest {\n                               Highlighting = HighlightingType.Temporary\n                             }));\n    ;\n  }\n\n  public static async Task<bool> SetupDebugSession() {\n    if (debugSesssionInitialized_) {\n      return true;\n    }\n\n    if (hadForcedShutdown_) {\n      return false;\n    }\n\n    if (DebuggerInstance.InBreakMode) {\n      //var stackFrame = debugger_.CurrentStackFrame as EnvDTE90a.StackFrame2;\n      //var function = stackFrame.FunctionName;\n      //var lineNumber = stackFrame.LineNumber;\n      //var file = stackFrame.FileName;\n      if (!await StartProfileExplorerAsync()) {\n        return false;\n      }\n\n      var client =\n        GetDebugClient(DebuggerInstance.ProcessName, DebuggerInstance.ProcessId);\n\n      if (client == null) {\n        await Shutdown(true);\n        return false;\n      }\n\n      debugSesssionInitialized_ = true;\n      return true;\n    }\n\n    return false;\n  }\n\n  internal static async Task PauseCurrentElementHandling() {\n    await RunClientCommand(() => {\n      debugClient_.SetSessionState(new SessionStateRequest {\n        State = SessionState.Paused\n      });\n    });\n  }\n\n  internal static async Task ResumeCurrentElementHandling() {\n    await RunClientCommand(() => {\n      debugClient_.SetSessionState(new SessionStateRequest {\n        State = SessionState.Listening\n      });\n    });\n  }\n\n  private static void CreateServerChannel() {\n    if (serverChannel_ == null) {\n      serverChannel_ = new Channel(\"127.0.0.1:50051\", ChannelCredentials.Insecure);\n    }\n  }\n\n  private static string GetProfileExplorerPath() {\n#if false\n            return @\"C:\\personal\\projects\\compiler_studio\\Client\\bin\\Debug\\net5.0\\ProfileExplorer.exe\";\n#endif\n    string path = NativeMethods.GetFullPathFromWindows(\"ProfileExplorer.exe\");\n\n    if (File.Exists(path)) {\n      return path;\n    }\n\n    return File.Exists(DefaultProfileExplorerPath) ? DefaultProfileExplorerPath : null;\n  }\n\n  private static async Task<bool> StartProfileExplorerAsync() {\n    if (IsServerStarted()) {\n      return true;\n    }\n\n    try {\n      string args = \"-grpc-server\";\n      string path = GetProfileExplorerPath();\n      ProfileExplorerExtensionPackage.SetStatusBar(\"Starting Profile Explorer...\", true);\n      Logger.Log($\"Starting Profile Explorer: {path}\");\n\n      if (path == null) {\n        VsShellUtilities.ShowMessageBox(\n          Package,\n          \"Could not find Profile Explorer, make sure it is properly installed and found on PATH\",\n          \"Profile Explorer extension\", OLEMSGICON.OLEMSGICON_WARNING,\n          OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);\n\n        Logger.LogError(\"ProfileExplorer.exe not found\");\n        ProfileExplorerExtensionPackage.SetStatusBar(\"Could not find Profile Explorer\");\n        return false;\n      }\n\n      var psi = new ProcessStartInfo(path, args);\n      var process = Process.Start(psi);\n      bool result = process != null &&\n                    await Task.Run(() => process.WaitForInputIdle(30000));\n\n      if (result) {\n        Logger.Log(\"Started Profile Explorer instance\");\n        ProfileExplorerExtensionPackage.SetStatusBar(\"Profile Explorer started\");\n      }\n      else {\n        Logger.LogError(\"Failed to start Profile Explorer instance\");\n        ProfileExplorerExtensionPackage.SetStatusBar(\"Failed to start Profile Explorer\");\n      }\n\n      return result;\n    }\n    catch (Exception ex) {\n      VsShellUtilities.ShowMessageBox(\n        Package, $\"Failed to start Profile Explorer, exception {ex.Message}\",\n        \"Profile Explorer extension\", OLEMSGICON.OLEMSGICON_WARNING,\n        OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);\n\n      Logger.LogException(ex, \"Failed to start Profile Explorer\");\n      return false;\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/AttachCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.Design;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing EnvDTE90;\nusing Microsoft.VisualStudio.Shell;\nusing Microsoft.VisualStudio.Shell.Interop;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class AttachCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0106;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"AttachCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private AttachCommand(AsyncPackage package, OleMenuCommandService commandService) :\n    base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new OleMenuCommand(Execute, menuCommandID);\n    menuItem.BeforeQueryStatus += MenuItem_BeforeQueryStatus;\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static AttachCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new AttachCommand(package, commandService);\n  }\n\n  private void MenuItem_BeforeQueryStatus(object sender, EventArgs e) {\n    if (sender is OleMenuCommand command) {\n      command.Enabled = ClientInstance.IsEnabled;\n\n      if (ClientInstance.IsEnabled) {\n        if (DebuggerInstance.InBreakMode) {\n          command.Text = \"Connect\";\n\n          command.Enabled = DebuggerInstance.IsDebuggingCompiler &&\n                            !ClientInstance.IsConnected;\n        }\n        else {\n          command.Text = \"Attach\";\n          command.Enabled = true;\n        }\n      }\n    }\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private void Attach(Process3 process) {\n    Logger.Log($\"Attaching debugger to {process.Name}...\");\n    ClientInstance.AutoAttach = true;\n    process.Attach();\n  }\n\n  private async void Execute(object sender, EventArgs e) {\n    try {\n      if (ClientInstance.IsConnected) {\n        return;\n      }\n\n      ClientInstance.ResetForcedShutdown();\n\n      if (DebuggerInstance.InBreakMode) {\n        // Debugger already started, try to connect.\n        Logger.Log(\"Debugger already attached, setting up Profile Explorer session...\");\n\n        if (DebuggerInstance.IsDebuggingCompiler &&\n            await ClientInstance.SetupDebugSession()) {\n          ClientInstance.UpdateIR();\n        }\n\n        return;\n      }\n\n      Logger.Log(\"Try to attach debugger to compiler instance...\");\n      var list = DebuggerInstance.GetRunningProcesses();\n\n      if (list == null) {\n        return;\n      }\n\n      var candidates = new List<Process3>();\n      int clInstances = 0;\n      int linkInstances = 0;\n      Process3 linkInstance = null;\n      var linkStartTime = DateTime.MinValue;\n\n      foreach (var process in list) {\n        if (process.IsBeingDebugged) {\n          continue;\n        }\n\n        if (process.Name.Contains(\"cl.exe\")) {\n          candidates.Add(process);\n          clInstances++;\n        }\n        else if (process.Name.Contains(\"link.exe\")) {\n          var processInstance = Process.GetProcessById(process.ProcessID);\n\n          if (linkInstance == null) {\n            linkInstance = process;\n            linkStartTime = processInstance.StartTime;\n            candidates.Add(process);\n          }\n          else if (processInstance.StartTime > linkStartTime) {\n            candidates.Remove(linkInstance);\n            linkInstance = process;\n            linkStartTime = processInstance.StartTime;\n            candidates.Add(process);\n          }\n\n          linkInstances++;\n        }\n      }\n\n      if (candidates.Count == 0) {\n        Logger.Log(\"No running compiler instance found\");\n      }\n      else if (candidates.Count == 1) {\n        Attach(candidates[0]);\n      }\n      else if (linkInstances == 2 && clInstances == 0) {\n        Attach(linkInstance);\n      }\n      else {\n        VsShellUtilities.ShowMessageBox(\n          Package,\n          \"There is more than one instance of CL/LINK running, use the \\\"Debug > Attach to Process\\\" dialog instead\",\n          \"Profile Explorer extension\", OLEMSGICON.OLEMSGICON_WARNING,\n          OLEMSGBUTTON.OLEMSGBUTTON_OK, OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST);\n      }\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to attach to process\");\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/CommandBase.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing System.Threading.Tasks;\nusing EnvDTE;\nusing EnvDTE80;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\nclass CommandBase {\n  //? TODO: Use timeout everywhere\n  private DTE2 dte_;\n  private bool initialized_;\n  private AsyncPackage package_;\n\n  public CommandBase(AsyncPackage package) {\n    package_ = package;\n  }\n\n  public async Task<bool> SetupDebugSession() {\n    await Initialize();\n    return await ClientInstance.SetupDebugSession();\n  }\n\n  public async Task<string> GetCaretDebugExpression() {\n    await Initialize();\n\n    if (dte_.ActiveDocument == null) {\n      return null;\n    }\n\n    try {\n      var textDocument = (TextDocument)dte_.ActiveDocument.Object(\"TextDocument\");\n      var selection = textDocument.Selection;\n\n      if (selection != null) {\n        var activePoint = selection.ActivePoint;\n        int lineOffset = activePoint.LineCharOffset - 1;\n\n        string text = activePoint.CreateEditPoint().GetLines(activePoint.Line, activePoint.Line + 1);\n\n        return DebuggerExpression.Create(\n          new TextLineInfo(text, activePoint.Line, lineOffset, lineOffset));\n      }\n    }\n    catch (Exception ex) {\n      Debug.WriteLine(\"Debugger expression exception: {0}\", ex);\n    }\n\n    return null;\n  }\n\n  private async Task Initialize() {\n    if (!initialized_) {\n      dte_ = await package_.GetServiceAsync(typeof(DTE)).ConfigureAwait(false) as DTE2;\n      initialized_ = true;\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/EnableCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class EnableCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0108;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"EnableCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private EnableCommand(AsyncPackage package, OleMenuCommandService commandService) :\n    base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n\n    //var menuItem = new MenuCommand(this.Execute, menuCommandID);\n    //commandService.AddCommand(menuItem);\n    var oleMenuItem = new OleMenuCommand(Execute, menuCommandID);\n    oleMenuItem.BeforeQueryStatus += OleMenuItem_BeforeQueryStatus;\n    commandService.AddCommand(oleMenuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static EnableCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new EnableCommand(package, commandService);\n  }\n\n  private void OleMenuItem_BeforeQueryStatus(object sender, EventArgs e) {\n    if (sender is OleMenuCommand command) {\n      command.Text = ClientInstance.IsEnabled\n        ? \"Disable extension\"\n        : \"Enable extension\";\n    }\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private void Execute(object sender, EventArgs e) {\n    ClientInstance.ToggleEnabled();\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/MarkElementCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class MarkElementCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0100;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"MarkElementCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private MarkElementCommand(AsyncPackage package, OleMenuCommandService commandService)\n    : base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static MarkElementCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new MarkElementCommand(package, commandService);\n  }\n\n  public async Task<bool> Execute(string expression, bool temporary) {\n    if (expression != null) {\n      if (!await SetupDebugSession()) {\n        return false;\n      }\n\n      long elementAddress = DebuggerInstance.ReadElementAddress(expression);\n      Logger.Log($\"Mark element for {elementAddress:x}: {expression}\");\n\n      return await ClientInstance.RunClientCommand(\n        () => ClientInstance.debugClient_.MarkElement(new MarkElementRequest {\n          ElementAddress = elementAddress,\n          Label = expression,\n          Highlighting = temporary\n            ? HighlightingType.Temporary\n            : HighlightingType.Permanent\n        }));\n    }\n\n    return false;\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    string variable = await GetCaretDebugExpression();\n    await Execute(variable, false);\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/MarkExpressionCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class MarkExpressionCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0103;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"MarkExpressionCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private MarkExpressionCommand(AsyncPackage package,\n                                OleMenuCommandService commandService) : base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static MarkExpressionCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new MarkExpressionCommand(package, commandService);\n  }\n\n  public async Task<bool> Execute(string expression, bool temporary) {\n    if (expression != null) {\n      if (!await SetupDebugSession()) {\n        return false;\n      }\n\n      long elementAddress = DebuggerInstance.ReadElementAddress(expression);\n      Logger.Log($\"Mark expression for {elementAddress:x}: {expression}\");\n\n      return await ClientInstance.RunClientCommand(\n        () => ClientInstance.debugClient_.ExecuteCommand(new ElementCommandRequest {\n          Command = ElementCommand.MarkExpression,\n          ElementAddress = elementAddress,\n          Label = expression,\n          Highlighting = temporary\n            ? HighlightingType.Temporary\n            : HighlightingType.Permanent,\n          StackFrame = DebuggerInstance.GetCurrentStackFrame()\n        }));\n    }\n\n    return false;\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    string variable = await GetCaretDebugExpression();\n    await Execute(variable, false);\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/MarkReferencesCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class MarkReferencesCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0102;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"MarkReferencesCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private MarkReferencesCommand(AsyncPackage package,\n                                OleMenuCommandService commandService) : base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static MarkReferencesCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new MarkReferencesCommand(package, commandService);\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    string variable = await GetCaretDebugExpression();\n\n    if (variable != null && await SetupDebugSession()) {\n      long elementAddress = DebuggerInstance.ReadElementAddress(variable);\n      Logger.Log($\"Mark references for {elementAddress:x}: {variable}\");\n\n      await ClientInstance.RunClientCommand(\n        () => ClientInstance.debugClient_.ExecuteCommand(new ElementCommandRequest {\n          Command = ElementCommand.MarkReferences,\n          ElementAddress = elementAddress,\n          Label = variable\n        }));\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/MarkUsesCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class MarkUsesCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0101;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"MarkUsesCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private MarkUsesCommand(AsyncPackage package, OleMenuCommandService commandService) :\n    base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static MarkUsesCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new MarkUsesCommand(package, commandService);\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    string variable = await GetCaretDebugExpression();\n\n    if (variable != null && await SetupDebugSession()) {\n      long elementAddress = DebuggerInstance.ReadElementAddress(variable);\n      Logger.Log($\"Mark uses for {elementAddress:x}: {variable}\");\n\n      await ClientInstance.RunClientCommand(\n        () => ClientInstance.debugClient_.ExecuteCommand(new ElementCommandRequest {\n          Command = ElementCommand.MarkUses,\n          ElementAddress = elementAddress,\n          Label = variable,\n          StackFrame = DebuggerInstance.GetCurrentStackFrame()\n        }));\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/ShowExpressionGraphCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class ShowExpressionGraphCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0107;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"ShowExpressionGraphCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private ShowExpressionGraphCommand(AsyncPackage package,\n                                     OleMenuCommandService commandService) : base(\n    package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static ShowExpressionGraphCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new ShowExpressionGraphCommand(package, commandService);\n  }\n\n  public async Task<bool> Execute(string expression) {\n    if (expression != null) {\n      if (!await SetupDebugSession()) {\n        return false;\n      }\n\n      long elementAddress = DebuggerInstance.ReadElementAddress(expression);\n      Logger.Log($\"Show expression graph for {elementAddress:x}: {expression}\");\n\n      return await ClientInstance.RunClientCommand(\n        () => ClientInstance.debugClient_.ExecuteCommand(new ElementCommandRequest {\n          Command = ElementCommand.ShowExpression,\n          ElementAddress = elementAddress,\n          Label = expression,\n          StackFrame = DebuggerInstance.GetCurrentStackFrame()\n        }));\n    }\n\n    return false;\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    string variable = await GetCaretDebugExpression();\n    await Execute(variable);\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/ShowReferencesCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class ShowReferencesCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0104;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"ShowReferencesCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private ShowReferencesCommand(AsyncPackage package,\n                                OleMenuCommandService commandService) : base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static ShowReferencesCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new ShowReferencesCommand(package, commandService);\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    string variable = await GetCaretDebugExpression();\n\n    if (variable != null && await SetupDebugSession()) {\n      long elementAddress = DebuggerInstance.ReadElementAddress(variable);\n      Logger.Log($\"Show references for {elementAddress:x}: {variable}\");\n\n      await ClientInstance.RunClientCommand(\n        () => ClientInstance.debugClient_.ExecuteCommand(new ElementCommandRequest {\n          Command = ElementCommand.ShowReferences,\n          ElementAddress = elementAddress,\n          Label = variable\n        }));\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/ShowUsesCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class ShowUsesCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0101;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"ShowUsesCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private ShowUsesCommand(AsyncPackage package, OleMenuCommandService commandService) :\n    base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static ShowUsesCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new ShowUsesCommand(package, commandService);\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    string variable = await GetCaretDebugExpression();\n\n    if (variable != null && await SetupDebugSession()) {\n      long elementAddress = DebuggerInstance.ReadElementAddress(variable);\n      Logger.Log($\"Show uses for {elementAddress:x}: {variable}\");\n\n      await ClientInstance.RunClientCommand(\n        () => ClientInstance.debugClient_.ExecuteCommand(new ElementCommandRequest {\n          Command = ElementCommand.ShowUses,\n          ElementAddress = elementAddress,\n          Label = variable,\n          StackFrame = DebuggerInstance.GetCurrentStackFrame()\n        }));\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Commands/UpdateIRCommand.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Design;\nusing System.Threading.Tasks;\nusing Microsoft.VisualStudio.Shell;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   Command handler\n/// </summary>\nsealed class UpdateIRCommand : CommandBase {\n  /// <summary>\n  ///   Command ID.\n  /// </summary>\n  public const int CommandId = 0x0109;\n  /// <summary>\n  ///   Command menu group (command set GUID).\n  /// </summary>\n  public static readonly Guid CommandSet = new(\"9885ad8d-69e0-4ec4-8324-b9fd109ebdcd\");\n  /// <summary>\n  ///   VS Package that provides this command, not null.\n  /// </summary>\n  private static AsyncPackage Package;\n\n  /// <summary>\n  ///   Initializes a new instance of the <see cref=\"UpdateIRCommand\" /> class.\n  ///   Adds our command handlers for menu (commands must exist in the command table file)\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  /// <param name=\"commandService\">Command service to add command to, not null.</param>\n  private UpdateIRCommand(AsyncPackage package, OleMenuCommandService commandService) :\n    base(package) {\n    Package = package ?? throw new ArgumentNullException(nameof(package));\n\n    commandService = commandService ??\n                     throw new ArgumentNullException(nameof(commandService));\n\n    var menuCommandID = new CommandID(CommandSet, CommandId);\n    var menuItem = new MenuCommand(Execute, menuCommandID);\n    commandService.AddCommand(menuItem);\n  }\n\n  /// <summary>\n  ///   Gets the instance of the command.\n  /// </summary>\n  public static UpdateIRCommand Instance { get; private set; }\n  /// <summary>\n  ///   Gets the service provider from the owner package.\n  /// </summary>\n  private IAsyncServiceProvider ServiceProvider => Package;\n\n  /// <summary>\n  ///   Initializes the singleton instance of the command.\n  /// </summary>\n  /// <param name=\"package\">Owner package, not null.</param>\n  public static async Task InitializeAsync(AsyncPackage package) {\n    // Switch to the main thread - the call to AddCommand in Command1's constructor requires\n    // the UI thread.\n    await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(\n      package.DisposalToken);\n\n    var commandService =\n      await package.GetServiceAsync(typeof(IMenuCommandService)) as\n        OleMenuCommandService;\n\n    Instance = new UpdateIRCommand(package, commandService);\n  }\n\n  /// <summary>\n  ///   This function is the callback used to execute the command when the menu item is clicked.\n  ///   See the constructor to see how the menu item is associated with this function using\n  ///   OleMenuCommandService service and MenuCommand class.\n  /// </summary>\n  /// <param name=\"sender\">Event sender.</param>\n  /// <param name=\"e\">Event args.</param>\n  private async void Execute(object sender, EventArgs e) {\n    if (await SetupDebugSession()) {\n      Logger.Log(\"Manual update function IR\");\n      ClientInstance.UpdateIR();\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/DebuggerExpression.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing ProfileExplorer.Core.Lexer;\n\nnamespace ProfileExplorerExtension;\n\nclass DebuggerExpression {\n  public static string Create(TextLineInfo lineInfo) {\n    var tokens = TokenizeString(lineInfo.LineText);\n    int targetToken = FindTargetToken(lineInfo, tokens);\n\n    if (targetToken != -1 && tokens[targetToken].IsIdentifier()) {\n      (int left, int right) = ExpandTargetExpression(targetToken, tokens);\n      string result = GetExpressionString(left, right, tokens);\n      return result;\n    }\n\n    return null;\n  }\n\n  private static List<Token> TokenizeString(string value) {\n    var lexer = new Lexer(value);\n    var tokens = new List<Token>();\n\n    while (true) {\n      var token = lexer.NextToken();\n\n      if (token.IsLineEnd() || token.IsEOF()) {\n        break;\n      }\n\n      tokens.Add(token);\n    }\n\n    return tokens;\n  }\n\n  private static int FindTargetToken(TextLineInfo lineInfo, List<Token> tokens) {\n    for (int i = 0; i < tokens.Count; i++) {\n      if (lineInfo.LineColumn >= tokens[i].Location.Offset &&\n          lineInfo.LineColumn < tokens[i].Location.Offset + tokens[i].Length) {\n        return i;\n      }\n    }\n\n    return -1;\n  }\n\n  private static (int, int) ExpandTargetExpression(int targetToken, List<Token> tokens) {\n    int left = targetToken;\n    int right = targetToken;\n\n    while (left >= 2) {\n      if (tokens[left - 1].Kind == TokenKind.Dot &&\n          tokens[left - 2].Kind == TokenKind.Identifier) {\n        left -= 2; // abc.xyz\n      }\n      else if (left >= 3 &&\n               tokens[left - 1].Kind == TokenKind.Greater &&\n               tokens[left - 2].Kind == TokenKind.Minus &&\n               tokens[left - 3].Kind == TokenKind.Identifier) {\n        left -= 3; // abc->xyz\n      }\n      else {\n        break;\n      }\n    }\n\n    while (right < tokens.Count - 2) {\n      if (tokens[right + 1].Kind == TokenKind.Dot &&\n          tokens[right + 2].Kind == TokenKind.Identifier) {\n        right += 2; // abc.xyz\n      }\n      else if (right < tokens.Count - 3 &&\n               tokens[right + 1].Kind == TokenKind.Minus &&\n               tokens[right + 2].Kind == TokenKind.Greater &&\n               tokens[right + 3].Kind == TokenKind.Identifier) {\n        right += 3; // abc->xyz\n      }\n      else {\n        break;\n      }\n    }\n\n    return (left, right);\n  }\n\n  private static string GetExpressionString(int start, int end, List<Token> tokens) {\n    var builder = new StringBuilder();\n\n    for (int i = start; i <= end; i++) {\n      switch (tokens[i].Kind) {\n        case TokenKind.Identifier: {\n          builder.Append(tokens[i].Data.ToString());\n          break;\n        }\n        case TokenKind.Dot: {\n          builder.Append(\".\");\n          break;\n        }\n        case TokenKind.Greater: {\n          builder.Append(\">\");\n          break;\n        }\n        case TokenKind.Minus: {\n          builder.Append(\"-\");\n          break;\n        }\n        default: {\n          throw new InvalidOperationException(\"Unexpected token kind\");\n        }\n      }\n    }\n\n    return builder.ToString();\n  }\n}"
  },
  {
    "path": "src/VSExtension/DebuggerInstance.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing EnvDTE;\nusing EnvDTE100;\nusing EnvDTE90;\nusing EnvDTE90a;\nusing Debugger = EnvDTE.Debugger;\nusing StackFrame = EnvDTE.StackFrame;\n\nnamespace ProfileExplorerExtension;\n\npublic class DebuggerInstance {\n  public static Debugger5 debugger_;\n  private static readonly int DefaultWaitTime = 30000;\n  private static readonly Dictionary<string, string> ElementTypeRules =\n    new() {\n      {\"Type\", \"&({0})\"},\n      {\"Type *\", \"{0}\"},\n      {\"Type &\", \"{0}\"},\n      {\"Type * *\", \"*({0})\"},\n      {\"Type * &\", \"{0}\"}\n    };\n  private static readonly HashSet<string> CppKeywords = new() {\n    \"alignas\",\n    \"alignof\",\n    \"and\",\n    \"and_eq\",\n    \"asm\",\n    \"auto\",\n    \"bitand\",\n    \"bitor\",\n    \"bool\",\n    \"break\",\n    \"case\",\n    \"catch\",\n    \"char\",\n    \"char8_t\",\n    \"char16_t\",\n    \"char32_t\",\n    \"class\",\n    \"compl\",\n    \"concept\",\n    \"const\",\n    \"consteval\",\n    \"constexpr\",\n    \"constinit\",\n    \"const_cast\",\n    \"continue\",\n    \"co_await\",\n    \"co_return\",\n    \"co_y\",\n    \"decltype\",\n    \"default\",\n    \"delete\",\n    \"do\",\n    \"double\",\n    \"dynamic_cast\",\n    \"else\",\n    \"enum\",\n    \"explicit\",\n    \"export\",\n    \"extern\",\n    \"false\",\n    \"float\",\n    \"for\",\n    \"friend\",\n    \"goto\",\n    \"if\",\n    \"inline\",\n    \"int\",\n    \"long\",\n    \"mutable\",\n    \"namespace\",\n    \"new\",\n    \"noexcept\",\n    \"not\",\n    \"not_eq\",\n    \"nullptr\",\n    \"operator\",\n    \"or\",\n    \"or_eq\",\n    \"private\",\n    \"protected\",\n    \"public\",\n    \"register\",\n    \"reinterpret_cast\",\n    \"requires\",\n    \"return\",\n    \"short\",\n    \"signed\",\n    \"sizeof\",\n    \"static\",\n    \"static_assert\",\n    \"static_cast\",\n    \"struct\",\n    \"switch\",\n    \"template\",\n    \"this\",\n    \"thread_local\",\n    \"throw\",\n    \"true\",\n    \"try\",\n    \"typedef\",\n    \"typeid\",\n    \"typename\",\n    \"union\",\n    \"unsigned\",\n    \"using\",\n    \"virtual\",\n    \"void\",\n    \"volatile\",\n    \"wchar_t\",\n    \"while\",\n    \"xor\",\n    \"xor_eq\"\n  };\n  private static readonly HashSet<string> CompilerKeywords = new() {\n    \"Set of common types used in the compiler codebase\"\n  };\n  public static bool InBreakMode => debugger_.CurrentMode == dbgDebugMode.dbgBreakMode;\n  public static string ProcessName => debugger_.CurrentProcess.Name;\n  public static int ProcessId => debugger_.CurrentProcess.ProcessID;\n\n  public static bool IsDebuggingCompiler {\n    get {\n      try {\n        if (!InBreakMode) {\n          return false;\n        }\n\n        string processName = Path.GetFileName(debugger_.CurrentProcess.Name);\n        return processName == \"compiler.exe\";\n      }\n      catch (Exception ex) {\n        Logger.LogException(ex, \"Failed to check debugged process name\");\n        return false;\n      }\n    }\n  }\n\n  public static void Initialize(Debugger debugger) {\n    debugger_ = (Debugger5)debugger;\n  }\n\n  public static bool UpdateIR() {\n    try {\n      var result = GetExpression(\"dumptupaddress()\");\n      return result.IsValidValue;\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed calling dumptupaddress()\");\n      return false;\n    }\n  }\n\n  public static bool IsReservedKeyword(string value) {\n    return CppKeywords.Contains(value) ||\n           CompilerKeywords.Contains(value);\n  }\n\n  public static int GetPointerSize() {\n    try {\n      var expr = GetExpression(\"sizeof(void*)\");\n\n      if (expr.IsValidValue && int.TryParse(expr.Value, out int size)) {\n        return size;\n      }\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to execute debugger expression\");\n    }\n\n    return 0;\n  }\n\n  public static long GetVariableAddress(string variable) {\n    try {\n      var expr = GetExpression($\"&({variable})\");\n\n      if (expr.IsValidValue && TryParseInt64(expr.Value, out long value)) {\n        return value;\n      }\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to execute debugger expression\");\n    }\n\n    return 0;\n  }\n\n  public static long ReadInt32(string variable) {\n    try {\n      var expr = GetExpression($\"*((int*)&({variable}))\");\n\n      if (expr.IsValidValue && TryParseInt32(expr.Value, out int value)) {\n        return value;\n      }\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to execute debugger expression\");\n    }\n\n    return 0;\n  }\n\n  public static long ReadInt64(string variable) {\n    try {\n      var expr = GetExpression($\"*((long long*)&({variable}))\");\n\n      if (expr.IsValidValue && TryParseInt64(expr.Value, out long value)) {\n        return value;\n      }\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to execute debugger expression\");\n    }\n\n    return 0;\n  }\n\n  public static long ReadElementAddress(string expression) {\n    string type = GetType(expression);\n\n    if (type == null) {\n      return 0;\n    }\n\n    if (ElementTypeRules.TryGetValue(type, out string typeFormat)) {\n      expression = string.Format(typeFormat, expression);\n    }\n\n    int ptrSize = GetPointerSize();\n    return ptrSize == 4 ? ReadInt32(expression) : ReadInt64(expression);\n  }\n\n  public static bool IsPointer(string variable) {\n    try {\n      var expr = GetExpression(variable);\n      return expr.IsValidValue && expr.Type.EndsWith(\"*\");\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to execute debugger expression\");\n      return false;\n    }\n  }\n\n  public static string GetType(string variable) {\n    try {\n      var expr = GetExpression($\"{variable}\");\n\n      if (!expr.IsValidValue) {\n        return null;\n      }\n\n      // Remove extra annotations.\n      string type = expr.Type;\n      int optionalIndex = type.IndexOf('{');\n\n      if (optionalIndex != -1) {\n        type = type.Substring(0, optionalIndex);\n      }\n\n      return type.Trim();\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to execute debugger expression\");\n      return null;\n    }\n  }\n\n  public static StackFrame GetCurrentStackFrame() {\n    try {\n      var stackFrame = (StackFrame2)debugger_.CurrentStackFrame;\n\n      return new StackFrame {\n        File = stackFrame.FileName,\n        Function = stackFrame.FunctionName,\n        LineNumber = (int)stackFrame.LineNumber\n      };\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to execute debugger expression\");\n      return null;\n    }\n  }\n\n  public static List<string> GetLocalVariables() {\n    try {\n      var stackFrame = (StackFrame2)debugger_.CurrentStackFrame;\n      var localVars = new List<string>();\n\n      foreach (object localVar in stackFrame.Locals) {\n        //? This is not the var name, but the value?\n        var localExpr = (Expression)localVar;\n\n        if (localExpr.IsValidValue) {\n          localVars.Add(localExpr.Value);\n        }\n      }\n\n      return localVars;\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to get local variables\");\n      return new List<string>();\n    }\n  }\n\n  public static List<Process3> GetRunningProcesses() {\n    try {\n      return debugger_.LocalProcesses.OfType<Process3>().ToList();\n    }\n    catch (Exception ex) {\n      Logger.LogException(ex, \"Failed to get running processes\");\n      Debug.WriteLine(\"Failed to get processes: {0}\", ex);\n      return null;\n    }\n  }\n\n  private static Expression GetExpression(string text) {\n    return debugger_.GetExpression2(text, false, false, DefaultWaitTime);\n  }\n\n  private static bool TryParseInt32(string value, out int result) {\n    if (int.TryParse(value, out result)) {\n      return true;\n    }\n\n    // Try to parse as a hex value.\n    try {\n      result = Convert.ToInt32(value, 16);\n      return true;\n    }\n    catch {\n      return false;\n    }\n  }\n\n  private static bool TryParseInt64(string value, out long result) {\n    if (long.TryParse(value, out result)) {\n      return true;\n    }\n\n    // Try to parse as a hex value.\n    try {\n      result = Convert.ToInt64(value, 16);\n      return true;\n    }\n    catch {\n      return false;\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Lexer/CharSource.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Lexer;\n\npublic sealed class CharSource {\n  public static readonly char EOF = '\\0';\n  public static readonly char NewLine = '\\n';\n\n  public CharSource(string text) {\n    Text = text;\n    Position = 0;\n  }\n\n  public string Text {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n  }\n  public int Position {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    set;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char NextChar() {\n    if (Position >= Text.Length) {\n      Position++;\n      return EOF;\n    }\n\n    return Text[Position++];\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char PeekChar() {\n    return Position >= Text.Length ? EOF : Text[Position];\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char Skip(int count = 1) {\n    Position += count;\n    return PeekChar();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public char GoBack(int count = 1) {\n    Position -= count;\n    return PeekChar();\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public ReadOnlyMemory<char> Extract(int position, int length) {\n    return Text.AsMemory(position, length);\n  }\n}"
  },
  {
    "path": "src/VSExtension/Lexer/CharTable.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Lexer;\n\npublic static class CharTable {\n  private static readonly byte[] CHAR_TYPE = {\n    0, 0, 0, 0, 0, 0, 0, 0, // 8\n    0, 1, 1, 1, 1, 1, 0, 0, // 16\n    0, 0, 0, 0, 0, 0, 0, 0, // 24\n    0, 0, 0, 0, 0, 0, 0, 0, // 32\n    1, 0, 0, 0, 26, 0, 0, 0, // 40\n    0, 0, 0, 0, 0, 0, 8, 0, // 48\n    28, 28, 28, 28, 28, 28, 28, 28, // 56\n    28, 28, 0, 0, 0, 0, 0, 16, // 64\n    18, 26, 26, 26, 26, 26, 26, 18, // 72\n    18, 18, 18, 18, 18, 18, 18, 18, // 80\n    18, 18, 18, 18, 18, 18, 18, 18, // 88\n    26, 18, 18, 0, 0, 0, 0, 18, // 96\n    0, 26, 26, 26, 26, 26, 26, 18, // 104\n    18, 18, 18, 18, 18, 18, 18, 18, // 112\n    18, 18, 18, 18, 18, 18, 18, 18, // 120\n    26, 18, 18, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0, 0, 0, 0\n  };\n  private static readonly byte CHAR_WHITESPACE = 1;\n  private static readonly byte CHAR_LETTER = 2;\n  private static readonly byte CHAR_DIGIT = 4;\n  private static readonly byte CHAR_NUMBER = 8;\n  private static readonly byte CHAR_IDENTIFIER = 16;\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsDigit(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_DIGIT) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsWhitespace(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_WHITESPACE) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsLetter(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_LETTER) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsNumberChar(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_NUMBER) != 0;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public static bool IsIdentifierChar(char value) {\n    return (CHAR_TYPE[(byte)value] & CHAR_IDENTIFIER) != 0;\n  }\n}"
  },
  {
    "path": "src/VSExtension/Lexer/Lexer.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\n\nnamespace ProfileExplorer.Core.Lexer;\n\npublic sealed class Lexer {\n  private char current_; // The current character.\n  private bool hasReturnedToken_;\n  private int line_; // The current line.\n  private int lineStart_; // The position of the current line start.\n  private Token returnedToken_; // Token returned back to lexer.\n  private CharSource source_; // The text being analyzed.\n\n  public Lexer(string text) {\n    source_ = new CharSource(text);\n    current_ = source_.NextChar();\n    line_ = 0;\n    lineStart_ = 0;\n  }\n\n  public Token NextToken() {\n    if (hasReturnedToken_) {\n      hasReturnedToken_ = false;\n      return returnedToken_;\n    }\n\n    return ScanToken();\n  }\n\n  public void ReturnToken(Token token) {\n    returnedToken_ = token;\n    hasReturnedToken_ = true;\n  }\n\n  public Token PeekToken() {\n    var token = NextToken();\n    ReturnToken(token);\n    return token;\n  }\n\n  public Token PeekToken2() {\n    var token = NextToken();\n\n    if (!token.IsEOF()) {\n      var token2 = NextToken();\n      ReturnToken(token2);\n      ReturnToken(token);\n      return token2;\n    }\n\n    ReturnToken(token);\n    return token;\n  }\n\n  private char NextChar() {\n    current_ = source_.NextChar();\n    return current_;\n  }\n\n  private Token MakeToken(TokenKind kind, int length = 1) {\n    return new Token {\n      Kind = kind,\n      Location = new TextLocation {\n        Offset = source_.Position - length - 1,\n        Line = line_,\n        Column = source_.Position - lineStart_ - length - 1\n      },\n      Length = length,\n      Data = ReadOnlyMemory<char>.Empty\n    };\n  }\n\n  private Token MakeDataToken(TokenKind kind, int startPosition, int length) {\n    return new Token {\n      Kind = kind,\n      Location = new TextLocation {\n        Offset = startPosition,\n        Line = line_,\n        Column = startPosition - lineStart_\n      },\n      Length = length,\n      Data = source_.Extract(startPosition, length)\n    };\n  }\n\n  private Token ScanNumber() {\n    int startPosition = source_.Position;\n    char previous = current_;\n    NextChar(); // Skip first digit.\n\n    while (CharTable.IsNumberChar(current_)) {\n      previous = current_;\n      NextChar();\n    }\n\n    if ((current_ == '+' || current_ == '-') && (previous == 'E' || previous == 'e')) {\n      NextChar(); // Skip over +/-.\n\n      while (CharTable.IsDigit(current_)) {\n        NextChar();\n      }\n    }\n\n    // A dot that is not followed by digits\n    // should not be handled as part of a float number.\n    if (previous == '.') {\n      source_.GoBack(2);\n      NextChar();\n    }\n\n    int length = source_.Position - startPosition - 1;\n    return MakeDataToken(TokenKind.Number, startPosition, length);\n  }\n\n  private Token ScanString(char delimiter) {\n    int startPosition = source_.Position;\n    NextChar(); // Skip start delimiter.\n\n    while (current_ != delimiter) {\n      if (current_ == CharSource.EOF || current_ == CharSource.NewLine) {\n        return MakeToken(TokenKind.Invalid);\n      }\n\n      NextChar();\n    }\n\n    NextChar(); // Skip end delimiter.\n    int length = source_.Position - startPosition - 2;\n    return MakeDataToken(TokenKind.String, startPosition, length);\n  }\n\n  private Token ScanIdentifier() {\n    int startPosition = source_.Position;\n    NextChar();\n\n    while (CharTable.IsIdentifierChar(current_)) {\n      NextChar();\n    }\n\n    int length = source_.Position - startPosition - 1;\n    return MakeDataToken(TokenKind.Identifier, startPosition, length);\n  }\n\n  private Token ScanToken() {\n    char letter = current_;\n\n    while (true) {\n      NextChar(); // Skip to next letter.\n\n      if (letter == CharSource.EOF) {\n        return MakeToken(TokenKind.EOF);\n      }\n\n      switch (letter) {\n        case '\\t':\n          break; // Tab.\n        case '\\v':\n          break; // Vertical tab.\n        case '\\f':\n          break; // Form feed.\n        case '\\n': {\n          line_++;\n          lineStart_ = source_.Position + 1;\n          return MakeToken(TokenKind.LineEnd);\n        }\n        case '0':\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9': {\n          // Found the start of a number.\n          source_.GoBack(2);\n          return ScanNumber();\n        }\n        case 'a':\n        case 'b':\n        case 'c':\n        case 'd':\n        case 'e':\n        case 'f':\n        case 'g':\n        case 'h':\n        case 'i':\n        case 'j':\n        case 'k':\n        case 'l':\n        case 'm':\n        case 'n':\n        case 'o':\n        case 'p':\n        case 'q':\n        case 'r':\n        case 's':\n        case 't':\n        case 'u':\n        case 'v':\n        case 'w':\n        case 'x':\n        case 'y':\n        case 'z':\n        case 'A':\n        case 'B':\n        case 'C':\n        case 'D':\n        case 'E':\n        case 'F':\n        case 'G':\n        case 'H':\n        case 'I':\n        case 'J':\n        case 'K':\n        case 'L':\n        case 'M':\n        case 'N':\n        case 'O':\n        case 'P':\n        case 'Q':\n        case 'R':\n        case 'S':\n        case 'T':\n        case 'U':\n        case 'V':\n        case 'W':\n        case 'X':\n        case 'Y':\n        case 'Z':\n        case '_':\n        case '@':\n        case '$':\n        case '?': {\n          // Found the start of an identifier or a keyword.\n          source_.GoBack(2);\n          return ScanIdentifier();\n        }\n        case '\\\"': {\n          // Found the start of a string.\n          source_.GoBack();\n          return ScanString('\\\"');\n        }\n        case '\\'': {\n          return MakeToken(TokenKind.Apostrophe);\n        }\n        case '(': {\n          return MakeToken(TokenKind.OpenParen);\n        }\n        case ')': {\n          return MakeToken(TokenKind.CloseParen);\n        }\n        case '[': {\n          return MakeToken(TokenKind.OpenSquare);\n        }\n        case ']': {\n          return MakeToken(TokenKind.CloseSquare);\n        }\n        case '{': {\n          return MakeToken(TokenKind.OpenCurly);\n        }\n        case '}': {\n          return MakeToken(TokenKind.CloseCurly);\n        }\n        case ':': {\n          return MakeToken(TokenKind.Colon);\n        }\n        case ';': {\n          return MakeToken(TokenKind.SemiColon);\n        }\n        case ',': {\n          return MakeToken(TokenKind.Comma);\n        }\n        case '.': {\n          return MakeToken(TokenKind.Dot);\n        }\n        case '&': {\n          return MakeToken(TokenKind.And);\n        }\n        case '|': {\n          return MakeToken(TokenKind.Or);\n        }\n        case '^': {\n          return MakeToken(TokenKind.Xor);\n        }\n        case '<': {\n          return MakeToken(TokenKind.Less);\n        }\n        case '>': {\n          return MakeToken(TokenKind.Greater);\n        }\n        case '=': {\n          return MakeToken(TokenKind.Equal);\n        }\n        case '+': {\n          return MakeToken(TokenKind.Plus);\n        }\n        case '-': {\n          return MakeToken(TokenKind.Minus);\n        }\n        case '*': {\n          return MakeToken(TokenKind.Star);\n        }\n        case '/': {\n          return MakeToken(TokenKind.Div);\n        }\n        case '~': {\n          return MakeToken(TokenKind.Tilde);\n        }\n        case '!': {\n          return MakeToken(TokenKind.Exclamation);\n        }\n        case '%': {\n          return MakeToken(TokenKind.Percent);\n        }\n        case '#': {\n          //? TODO: Add as custom commnent char\n          return MakeToken(TokenKind.Hash);\n        }\n      }\n\n      letter = current_;\n    }\n  }\n}"
  },
  {
    "path": "src/VSExtension/Lexer/TextLocation.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core;\n\npublic struct TextLocation {\n  public int Offset {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public int Line {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public int Column {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public TextLocation(int offset, int line, int column) {\n    Offset = offset;\n    Line = line;\n    Column = column;\n  }\n\n  public override string ToString() {\n    return $\"offset: {Offset}, line {Line}\";\n  }\n\n  public override bool Equals(object obj) {\n    return obj is TextLocation location &&\n           Offset == location.Offset &&\n           Line == location.Line &&\n           Column == location.Column;\n  }\n\n  public override int GetHashCode() {\n    int hashCode = -1429159632;\n    hashCode = hashCode * -1521134295 + Offset.GetHashCode();\n    hashCode = hashCode * -1521134295 + Line.GetHashCode();\n    hashCode = hashCode * -1521134295 + Column.GetHashCode();\n    return hashCode;\n  }\n}"
  },
  {
    "path": "src/VSExtension/Lexer/Token.cs",
    "content": "// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Runtime.CompilerServices;\n\nnamespace ProfileExplorer.Core.Lexer;\n\n// Definitions for token types.\n// Some tokens (identifier, string, number, etc.) have additional associated data.\npublic enum TokenKind {\n  Identifier, // -> Data\n  Number, // -> Data\n  String, // -> Data\n  Char, // -> Data\n  Plus, // +\n  Minus, // -\n  Star, // *\n  Tilde, // ~\n  Equal, // =\n  Exclamation, // !\n  Percent, // %\n  And, // &\n  Or, // |\n  Xor, // ^\n  Less, // <\n  Greater, // >\n  Hash, // #  (used by the preprocessor)\n  Div, // /\n  Colon, // :\n  SemiColon, // ;\n  Comma, // ,\n  Apostrophe, // '\n  Dot, // .\n  Question, // ?\n  OpenSquare, // [\n  CloseSquare, // ]\n  OpenParen, // (\n  CloseParen, // )\n  OpenCurly, // {\n  CloseCurly, // }\n  LineEnd, // Found \\n.\n  EOF, // The end of the file was reached.\n  Invalid, // The token could not be determined.\n  Custom, // Used to mark a custom (optional) token.\n  Keyword // All values after this one denote tokens.\n}\n\npublic struct Token {\n  public TokenKind Kind {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public TextLocation Location {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public int Length {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n  public ReadOnlyMemory<char> Data {\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    get;\n    [MethodImpl(MethodImplOptions.AggressiveInlining)]\n    set;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public Token(TokenKind kind, TextLocation location, int length) : this() {\n    Kind = kind;\n    Location = location;\n    Length = length;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsValid() {\n    return Kind != TokenKind.EOF && Kind != TokenKind.Invalid;\n  }\n\n  // Returns true if the token describes and end-of-file situation.\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsEOF() {\n    return Kind == TokenKind.EOF;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsLineEnd() {\n    return Kind == TokenKind.LineEnd;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsIdentifier() {\n    return Kind == TokenKind.Identifier;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsNumber() {\n    return Kind == TokenKind.Number;\n  }\n\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsString() {\n    return Kind == TokenKind.String;\n  }\n\n  // Returns true if the token represents an operator.\n  [MethodImpl(MethodImplOptions.AggressiveInlining)]\n  public bool IsOperator() {\n    return (int)Kind >= (int)TokenKind.Plus && (int)Kind <= (int)TokenKind.Div;\n  }\n\n  public override string ToString() {\n    string text = $\"kind: {Kind}; location: {Location}; length: {Length}\";\n\n    if (!Data.IsEmpty) {\n      text += $\"; data: {Data.Span.ToString()}\";\n    }\n\n    return text;\n  }\n}"
  },
  {
    "path": "src/VSExtension/Logger.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Diagnostics;\nusing Microsoft.VisualStudio.Shell.Interop;\n\nnamespace ProfileExplorerExtension;\n\npublic static class Logger {\n  private static IVsOutputWindowPane panel_;\n  private static IServiceProvider provider_;\n  private static Guid panelId_;\n  private static string name_;\n  private static object lockObject_ = new();\n\n  public static void Initialize(IServiceProvider provider, string name) {\n    provider_ = provider;\n    name_ = name;\n  }\n\n  public static void Initialize(IServiceProvider provider, string name, string version,\n                                string telemetryKey) {\n    Initialize(provider, name);\n  }\n\n  public static void LogError(string message) {\n    Log(message, true);\n  }\n\n  public static void Log(string message, bool isError = false) {\n    if (string.IsNullOrEmpty(message)) {\n      return;\n    }\n\n    try {\n      if (EnsurePane()) {\n        string text = $\"{DateTime.Now}: {message}\\n\";\n        panel_.OutputStringThreadSafe(text);\n\n#if DEBUG\n        if (Debugger.IsAttached) {\n          Debug.Write(text);\n        }\n#endif\n      }\n    }\n    catch (Exception ex) {\n      Debug.Write(ex);\n    }\n  }\n\n  public static void LogException(Exception ex, string message = \"\") {\n    if (ex != null) {\n      Log(!string.IsNullOrEmpty(message)\n            ? $\"Exception: {message}\\nMessage: {ex.Message}\\nStack:\\n{ex.StackTrace}\"\n            : $\"Exception: {ex.Message}\\nStack:\\n{ex.StackTrace}\");\n    }\n  }\n\n  public static void Clear() {\n    panel_?.Clear();\n  }\n\n  public static void DeletePane() {\n    if (panel_ != null) {\n      try {\n        var output =\n          (IVsOutputWindow)provider_.GetService(typeof(SVsOutputWindow));\n\n        output.DeletePane(ref panelId_);\n        panel_ = null;\n      }\n      catch (Exception ex) {\n        Debug.Write(ex);\n      }\n    }\n  }\n\n  private static bool EnsurePane() {\n    if (panel_ != null) {\n      return true;\n    }\n\n    lock (lockObject_) {\n      if (panel_ == null) {\n        panelId_ = Guid.NewGuid();\n\n        var output =\n          (IVsOutputWindow)provider_.GetService(typeof(SVsOutputWindow));\n\n        output.CreatePane(ref panelId_, name_, 1, 1);\n        output.GetPane(ref panelId_, out panel_);\n      }\n    }\n\n    return panel_ != null;\n  }\n}"
  },
  {
    "path": "src/VSExtension/MouseEventProcessor.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.ComponentModel.Composition;\nusing System.Windows;\nusing System.Windows.Input;\nusing Microsoft.VisualStudio.Editor;\nusing Microsoft.VisualStudio.Text.Editor;\nusing Microsoft.VisualStudio.TextManager.Interop;\nusing Microsoft.VisualStudio.Utilities;\n\nnamespace ProfileExplorerExtension;\n\npublic class TextLineInfo {\n  public int DocumentOffset;\n  public bool Handled;\n  public int LineColumn;\n  public int LineNumber;\n  public string LineText;\n  public ModifierKeys PressedModifierKeys;\n  public MouseButton PressedMouseButton;\n\n  public TextLineInfo(string lineText, int lineNumber, int lineColumn,\n                      int documentOffset) {\n    LineText = lineText;\n    LineNumber = lineNumber;\n    LineColumn = lineColumn;\n    DocumentOffset = documentOffset;\n  }\n\n  public bool HasTextInfo => LineText != null;\n\n  public override string ToString() {\n    return $\"{LineNumber}:{LineColumn} ({DocumentOffset}) {LineText}\";\n  }\n}\n\n[Export(typeof(IMouseProcessorProvider))]\n[Name(\"PEXMouseProcessor\")]\n[ContentType(\"code\")]\n[TextViewRole(PredefinedTextViewRoles.Document)]\n[Order(Before = \"VisualStudioMouseProcessor\")]\nclass MouseProcessorProvider : IMouseProcessorProvider {\n  private IVsEditorAdaptersFactoryService editorAdapters_;\n\n  [ImportingConstructor]\n  public MouseProcessorProvider(IVsEditorAdaptersFactoryService editorAdapters) {\n    editorAdapters_ = editorAdapters;\n  }\n\n  public IMouseProcessor GetAssociatedProcessor(IWpfTextView wpfTextView) {\n    var instance = new MouseEventProcessor(wpfTextView, editorAdapters_);\n    ProfileExplorerExtensionPackage.RegisterMouseProcessor(instance);\n    return instance;\n  }\n}\n\nclass MouseEventProcessor : MouseProcessorBase {\n  public enum ScrollBarConstants {\n    SB_HORZ,\n    SB_VERT,\n    SB_CTL,\n    SB_BOTH\n  }\n\n  private IWpfTextView view_;\n  private IVsTextView viewAdapter_;\n\n  public MouseEventProcessor(IWpfTextView wpfTextView,\n                             IVsEditorAdaptersFactoryService editorAdapters) {\n    view_ = wpfTextView;\n    viewAdapter_ = editorAdapters.GetViewAdapter(wpfTextView);\n  }\n\n  public event EventHandler<TextLineInfo> OnMouseUp;\n\n  public static int GetPhysicalLeftColumn(IVsTextView view) {\n    GetScrollInfo(view, ScrollBarConstants.SB_HORZ, out int num, out int num2,\n                  out int num3, out int num4);\n\n    return num4;\n  }\n\n  private static void GetScrollInfo(IVsTextView view, ScrollBarConstants bar,\n                                    out int minUnit, out int maxUnit,\n                                    out int visibleLineCount, out int firstVisibleUnit) {\n    view.GetScrollInfo((int)bar, out minUnit, out maxUnit, out visibleLineCount,\n                       out firstVisibleUnit);\n  }\n\n  public override void PostprocessMouseUp(MouseButtonEventArgs e) {\n    if (OnMouseUp != null && ClientInstance.IsConnected) {\n      var position = e.GetPosition(view_.VisualElement);\n      var lineInfo = GetLineAndPositionInfo(viewAdapter_, view_, position);\n\n      if (lineInfo != null) {\n        lineInfo.PressedMouseButton = e.ChangedButton;\n        lineInfo.PressedModifierKeys = Keyboard.Modifiers;\n        OnMouseUp(this, lineInfo);\n        e.Handled = lineInfo.Handled;\n      }\n    }\n\n    base.PostprocessMouseUp(e);\n  }\n\n  private TextLineInfo GetLineAndPositionInfo(IVsTextView view, IWpfTextView wpfTextView,\n                                              Point wpfClientPoint) {\n    var textViewLine =\n      wpfTextView.TextViewLines.GetTextViewLineContainingYCoordinate(\n        wpfClientPoint.Y + wpfTextView.ViewportTop);\n\n    if (textViewLine == null) {\n      return null;\n    }\n\n    double xCoordinate = wpfClientPoint.X + GetPhysicalLeftColumn(view);\n\n    var bufferPositionFromXCoordinate =\n      textViewLine.GetBufferPositionFromXCoordinate(xCoordinate);\n\n    if (!bufferPositionFromXCoordinate.HasValue) {\n      return new TextLineInfo(null, -1, -1, -1);\n    }\n\n    view.GetLineAndColumn(bufferPositionFromXCoordinate.Value.Position,\n                          out int lineNumber, out int lineColumn);\n\n    var textLine =\n      bufferPositionFromXCoordinate.Value.Snapshot.GetLineFromLineNumber(lineNumber);\n\n    return new TextLineInfo(textLine.GetText(), lineNumber, lineColumn,\n                            bufferPositionFromXCoordinate.Value.Position);\n  }\n}"
  },
  {
    "path": "src/VSExtension/NativeMethods.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Runtime.InteropServices;\nusing System.Text;\n\nnamespace ProfileExplorerExtension;\n\nstatic class NativeMethods {\n  private const int MAX_PATH = 260;\n\n  [DllImport(\"shlwapi.dll\", CharSet = CharSet.Unicode, SetLastError = false)]\n  private static extern bool PathFindOnPath([In][Out] StringBuilder pszFile,\n                                            [In] string[] ppszOtherDirs);\n\n  public static string GetFullPathFromWindows(string exeName) {\n    var sb = new StringBuilder(exeName, MAX_PATH);\n    return PathFindOnPath(sb, null) ? sb.ToString() : null;\n  }\n}"
  },
  {
    "path": "src/VSExtension/Properties/AssemblyInfo.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"ProfileExplorerExtension\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"ProfileExplorerExtension\")]\n[assembly: AssemblyCopyright(\"\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components.  If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version\n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]"
  },
  {
    "path": "src/VSExtension/VSExtension.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>\n    <VSToolsPath Condition=\"'$(VSToolsPath)' == ''\">$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)</VSToolsPath>\n    <Ngen>true</Ngen>\n    <NgenArchitecture>X86</NgenArchitecture>\n    <NgenPriority>1</NgenPriority>\n    <NgenApplication>\n    </NgenApplication>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <ProjectGuid>{DF5E31FD-A162-4053-B7C6-50C196CF60E3}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>VSExtension</RootNamespace>\n    <AssemblyName>VSExtension</AssemblyName>\n    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>\n    <GeneratePkgDefFile>true</GeneratePkgDefFile>\n    <UseCodebase>true</UseCodebase>\n    <IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>\n    <IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>\n    <IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>\n    <CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>\n    <CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>\n    <StartAction>Program</StartAction>\n    <StartProgram Condition=\"'$(DevEnvDir)' != ''\">$(DevEnvDir)devenv.exe</StartProgram>\n    <StartArguments>/rootsuffix Exp</StartArguments>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <LangVersion>latest</LangVersion>\n    <PlatformTarget>x64</PlatformTarget>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>\n    </DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <LangVersion>latest</LangVersion>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"ClientInstance.cs\" />\n    <Compile Include=\"Commands\\EnableCommand.cs\" />\n    <Compile Include=\"Commands\\ShowExpressionGraphCommand.cs\" />\n    <Compile Include=\"Commands\\UpdateIRCommand.cs\" />\n    <Compile Include=\"DebuggerExpression.cs\" />\n    <Compile Include=\"DebuggerInstance.cs\" />\n    <Compile Include=\"Lexer\\CharSource.cs\" />\n    <Compile Include=\"Lexer\\CharTable.cs\" />\n    <Compile Include=\"Lexer\\Lexer.cs\" />\n    <Compile Include=\"Lexer\\TextLocation.cs\" />\n    <Compile Include=\"Lexer\\Token.cs\" />\n    <Compile Include=\"Commands\\MarkExpressionCommand.cs\" />\n    <Compile Include=\"Commands\\ShowReferencesCommand.cs\" />\n    <Compile Include=\"Commands\\MarkReferencesCommand.cs\" />\n    <Compile Include=\"Commands\\MarkUsesCommand.cs\" />\n    <Compile Include=\"Commands\\MarkElementCommand.cs\" />\n    <Compile Include=\"Commands\\CommandBase.cs\" />\n    <Compile Include=\"MouseEventProcessor.cs\" />\n    <Compile Include=\"Commands\\ShowUsesCommand.cs\" />\n    <Compile Include=\"Commands\\AttachCommand.cs\" />\n    <Compile Include=\"Logger.cs\" />\n    <Compile Include=\"NativeMethods.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"VSExtensionPackage.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <AdditionalFiles Include=\".editorconfig\" />\n    <None Include=\"App.config\" />\n    <None Include=\"source.extension.vsixmanifest\">\n      <SubType>Designer</SubType>\n    </None>\n    <None Include=\"VSExtension.licenseheader\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"PresentationCore\" />\n    <Reference Include=\"PresentationFramework\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.ComponentModel.Composition\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.Design\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n    <Reference Include=\"System.Xaml\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"WindowsBase\" />\n  </ItemGroup>\n  <ItemGroup>\n    <PackageReference Include=\"Google.Protobuf\">\n      <Version>3.28.3</Version>\n    </PackageReference>\n    <PackageReference Include=\"Grpc\">\n      <Version>2.46.6</Version>\n    </PackageReference>\n    <PackageReference Include=\"Grpc.Core\">\n      <Version>2.46.6</Version>\n    </PackageReference>\n    <PackageReference Include=\"Grpc.Core.Api\">\n      <Version>2.66.0</Version>\n    </PackageReference>\n    <PackageReference Include=\"Grpc.Tools\">\n      <Version>2.67.0</Version>\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.VisualStudio.SDK\" Version=\"17.11.40262\" ExcludeAssets=\"runtime\">\n      <IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n    </PackageReference>\n    <PackageReference Include=\"Microsoft.VSSDK.BuildTools\" Version=\"17.12.2069\">\n      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>\n      <PrivateAssets>all</PrivateAssets>\n    </PackageReference>\n  </ItemGroup>\n  <ItemGroup>\n    <VSCTCompile Include=\"VSExtensionPackage.vsct\">\n      <ResourceName>Menus.ctmenu</ResourceName>\n    </VSCTCompile>\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"main.ico\">\n      <CopyToOutputDirectory>Always</CopyToOutputDirectory>\n      <IncludeInVSIX>true</IncludeInVSIX>\n    </Content>\n    <Content Include=\"Resources\\Command1.png\" />\n    <Content Include=\"Resources\\irxIcon.png\" />\n    <Content Include=\"Resources\\list-ordered.png\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"$(VSToolsPath)\\VSSDK\\Microsoft.VsSDK.targets\" Condition=\"'$(VSToolsPath)' != ''\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.\n\t\t   Other similar extension points exist, see Microsoft.Common.targets.\n\t  <Target Name=\"BeforeBuild\">\n\t  </Target>\n\t  <Target Name=\"AfterBuild\">\n\t  </Target>\n\t  -->\n  <ItemGroup>\n    <Protobuf Include=\"../GrpcLib/DebugService.proto\" />\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "src/VSExtension/VSExtensionPackage.cs",
    "content": "﻿// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nusing System;\nusing System.Collections.Generic;\nusing System.Runtime.InteropServices;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Input;\nusing EnvDTE;\nusing EnvDTE80;\nusing Microsoft.VisualStudio.Shell;\nusing Microsoft.VisualStudio.Shell.Interop;\nusing ProfileExplorer.Core.Lexer;\nusing Constants = Microsoft.VisualStudio.Shell.Interop.Constants;\nusing Thread = EnvDTE.Thread;\n\nnamespace ProfileExplorerExtension;\n\n/// <summary>\n///   This is the class that implements the package exposed by this assembly.\n/// </summary>express\n/// <remarks>\n///   <para>\n///     The minimum requirement for a class to be considered a valid package for Visual Studio\n///     is to implement the IVsPackage interface and register itself with the shell.\n///     This package uses the helper classes defined inside the Managed Package Framework (MPF)\n///     to do it: it derives from the Package class that provides the implementation of the\n///     IVsPackage interface and uses the registration attributes defined in the framework to\n///     register itself and its components with the shell. These attributes tell the pkgdef\n///     creation\n///     utility what data to put into .pkgdef file.\n///   </para>\n///   <para>\n///     To get loaded into VS, the package must be referred by &lt;Asset\n///     Type=\"Microsoft.VisualStudio.VsPackage\" ...&gt; in .vsixmanifest file.\n///   </para>\n/// </remarks>\n[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]\n[Guid(PackageGuidString)]\n[ProvideMenuResource(\"Menus.ctmenu\", 1)]\n\n//[ProvideAutoLoad(UIContextGuids80.SolutionExists)]\npublic sealed class ProfileExplorerExtensionPackage : AsyncPackage {\n  /// <summary>\n  ///   ProfileExplorerExtensionPackage GUID string.\n  /// </summary>\n  public const string PackageGuidString = \"c29cc20e-a6f8-412f-a266-3adc6f822594\";\n  public static ProfileExplorerExtensionPackage Instance;\n  private static IVsStatusbar statusBar_;\n  private Debugger debugger_;\n  private DebuggerEvents debuggerEvents_;\n  private DTE2 dte_;\n\n  public static void SetStatusBar(string text, bool animated = false) {\n    object icon = (short)Constants.SBAI_General;\n    statusBar_.Animation(animated ? 1 : 0, ref icon);\n    statusBar_.SetText(text);\n  }\n\n        #region Package Members\n\n  /// <summary>\n  ///   Initialization of the package; this method is called right after the package is sited, so this\n  ///   is the place\n  ///   where you can put all the initialization code that rely on services provided by VisualStudio.\n  /// </summary>\n  /// <param name=\"cancellationToken\">\n  ///   A cancellation token to monitor for initialization cancellation,\n  ///   which can occur when VS is shutting down.\n  /// </param>\n  /// <param name=\"progress\">A provider for progress updates.</param>\n  /// <returns>\n  ///   A task representing the async work of package initialization, or an already completed task\n  ///   if there is none. Do not return null from this method.\n  /// </returns>\n  protected override async Task InitializeAsync(CancellationToken cancellationToken,\n                                                IProgress<ServiceProgressData>\n                                                  progress) {\n    // When initialized asynchronously, the current thread may be a background thread at this point.\n    // Do any initialization that requires the UI thread after switching to the UI thread.\n    await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);\n    await AttachCommand.InitializeAsync(this);\n    await MarkElementCommand.InitializeAsync(this);\n    await MarkUsesCommand.InitializeAsync(this);\n    await MarkExpressionCommand.InitializeAsync(this);\n    await MarkReferencesCommand.InitializeAsync(this);\n    await ShowReferencesCommand.InitializeAsync(this);\n    await ShowExpressionGraphCommand.InitializeAsync(this);\n    await EnableCommand.InitializeAsync(this);\n    await UpdateIRCommand.InitializeAsync(this);\n\n    // https://stackoverflow.com/questions/22570121/debuggerevents-onenterbreakmode-is-not-triggered-in-the-visual-studio-extension\n    dte_ = await GetServiceAsync(typeof(DTE)) as DTE2;\n    statusBar_ = await GetServiceAsync(typeof(SVsStatusbar)) as IVsStatusbar;\n    debugger_ = dte_.Debugger;\n    debuggerEvents_ = dte_.Events.DebuggerEvents;\n\n    // dte_.Events.BuildEvents.OnBuildDone += BuildEvents_OnBuildDone;\n    debuggerEvents_.OnEnterBreakMode += DebuggerEvents_OnEnterBreakMode;\n    debuggerEvents_.OnEnterRunMode += DebuggerEvents__OnEnterRunMode;\n    debuggerEvents_.OnEnterDesignMode += DebuggerEvents_OnEnterDesignMode;\n    debuggerEvents_.OnExceptionNotHandled += DebuggerEvents_OnExceptionNotHandled;\n    debuggerEvents_.OnContextChanged += DebuggerEvents__OnContextChanged;\n    Logger.Initialize(this, \"Profile Explorer\");\n    ClientInstance.Initialize(this);\n    DebuggerInstance.Initialize(debugger_);\n  }\n\n  private void BuildEvents_OnBuildDone(vsBuildScope Scope, vsBuildAction Action) {\n    throw new NotImplementedException();\n  }\n\n  private void DebuggerEvents__OnContextChanged(Process NewProcess, Program NewProgram,\n                                                Thread NewThread,\n                                                StackFrame NewStackFrame) {\n  }\n\n  internal static void RegisterMouseProcessor(MouseEventProcessor instance) {\n    instance.OnMouseUp += MouseProcessor_OnMouseUp;\n  }\n\n  private static async void MouseProcessor_OnMouseUp(object sender, TextLineInfo e) {\n    if (!ClientInstance.IsConnected) {\n      return;\n    }\n\n    //Logger.Log($\"> OnMouseUp, {e.PressedMouseButton}, {e.PressedModifierKeys}\");\n    //Logger.Log($\"    text {e.LineNumber}:{e.LineColumn}: {e.LineText}\");\n    bool handled = false;\n\n    if (e.HasTextInfo) {\n      //Logger.Log(\">> Create debugger expression\");\n      string expression = DebuggerExpression.Create(e);\n\n      //Logger.Log($\">> Debugger expression: {expression}\");\n\n      if (e.PressedMouseButton == MouseButton.Left) {\n        if (e.PressedModifierKeys.HasFlag(ModifierKeys.Alt)) {\n          bool result = await MarkElementCommand.Instance.Execute(expression, true);\n\n          handled = result;\n        }\n      }\n      else if (e.PressedMouseButton == MouseButton.Middle) {\n        if (e.PressedModifierKeys.HasFlag(ModifierKeys.Alt)) {\n          bool result =\n            await MarkElementCommand.Instance.Execute(expression, true);\n\n          handled = result;\n        }\n        else if (e.PressedModifierKeys.HasFlag(ModifierKeys.Shift)) {\n          bool result = await ShowExpressionGraphCommand.Instance.Execute(expression);\n\n          handled = result;\n        }\n      }\n    }\n\n    if (!handled) {\n      // Deselect temporary highlighting.\n      //Logger.Log(\"> OnMouseUp: not handled\");\n      await ClientInstance.ClearTemporaryHighlighting();\n    }\n\n    //Logger.Log(\"> OnMouseUp: handled\");\n    e.Handled = handled;\n  }\n\n  private static List<Token> TokenizeString(string value) {\n    var lexer = new Lexer(value);\n    var tokens = new List<Token>();\n\n    while (true) {\n      var token = lexer.NextToken();\n\n      if (token.IsLineEnd() || token.IsEOF()) {\n        break;\n      }\n\n      tokens.Add(token);\n    }\n\n    return tokens;\n  }\n\n  private int FindEqualsOnRight(List<Token> tokens, int i) {\n    for (i = i + 1; i < tokens.Count; i++) {\n      switch (tokens[i].Kind) {\n        case TokenKind.Equal: {\n          if (i < tokens.Count - 1 &&\n              tokens[i + 1].Kind == TokenKind.Equal) {\n            return -1; // instr == otherInstr\n          }\n\n          return i;\n        }\n        case TokenKind.CloseParen:\n        case TokenKind.CloseCurly:\n        case TokenKind.CloseSquare:\n        case TokenKind.Exclamation: {\n          return -1; // TU_OPCODE(instr) = ..., instr not a dest here\n        }\n      }\n    }\n\n    return -1;\n  }\n\n  //? keep stack, restore vars\n  //?   also show local vars, maybe with arrows\n  //?   as a sidebar on the right, pointing to the tuples?\n  private Dictionary<long, Tuple<long, int>> funcVariables_;\n  private string prevTextLine_;\n  private string olderTextLine_;\n  private int version_;\n\n  private enum LineType {\n    Current,\n    Previous,\n    Older\n  }\n\n  private void DebuggerEvents_OnEnterBreakMode(dbgEventReason Reason,\n                                               ref dbgExecutionAction ExecutionAction) {\n    if (!ClientInstance.IsEnabled) {\n      Logger.Log(\"Profile Explorer not enabled\");\n      return;\n    }\n\n    if (!DebuggerInstance.IsDebuggingCompiler) {\n      Logger.Log(\"Not debugging compiler\");\n      return;\n    }\n\n    if (!ClientInstance.IsConnected && !ClientInstance.AutoAttach) {\n      Logger.Log(\"Profile Explorer no auto-attach\");\n      return;\n    }\n\n    switch (Reason) {\n      case dbgEventReason.dbgEventReasonStep: {\n        funcVariables_ ??= new Dictionary<long, Tuple<long, int>>();\n\n        string textLine = GetCurrentTextLine();\n        Logger.Log(\"Current line: \" + textLine);\n\n        if (!string.IsNullOrEmpty(prevTextLine_)) {\n          AutoMarkVariables(prevTextLine_, LineType.Previous);\n        }\n\n        AutoMarkVariables(textLine, LineType.Current);\n\n        if (!string.IsNullOrEmpty(olderTextLine_)) {\n          AutoMarkVariables(olderTextLine_, LineType.Older);\n        }\n\n        olderTextLine_ = prevTextLine_;\n        prevTextLine_ = textLine;\n        version_++;\n\n        //var locals = DebuggerInstance.GetLocalVariables();\n\n        //foreach (var localVar in locals) {\n        //    Logger.Log($\"Local var: {localVar}\");\n        //}\n\n        JoinableTaskFactory.Run(() => ClientInstance.UpdateCurrentStackFrame());\n        JoinableTaskFactory.Run(() => ClientInstance.UpdateIR());\n\n        // Tokenize and try to extract vars\n        // abc.xyz = def\n        break;\n      }\n      case dbgEventReason.dbgEventReasonBreakpoint:\n      case dbgEventReason.dbgEventReasonUserBreak: {\n        //? This should check it's running cl/link and it's on a proper stack frame\n        JoinableTaskFactory.Run(() => ClientInstance.UpdateCurrentStackFrame());\n        JoinableTaskFactory.Run(() => ClientInstance.UpdateIR());\n\n        //ExecutionAction = dbgExecutionAction.dbgExecutionActionStepOut;\n        break;\n      }\n      case dbgEventReason.dbgEventReasonExceptionThrown: {\n        JoinableTaskFactory.Run(() => ClientInstance.UpdateCurrentStackFrame());\n        JoinableTaskFactory.Run(() => ClientInstance.UpdateIR());\n\n        //if (exceptionCount >= 2)\n        //{\n        //    ExecutionAction = dbgExecutionAction.dbgExecutionActionStepOut;\n        //}\n        break;\n      }\n    }\n  }\n\n  private void AutoMarkVariables(string textLine, LineType lineType) {\n    //? Make configurable\n    var defaultColor = new RGBColor {R = 153, G = 204, B = 255};\n    var destColor = new RGBColor {R = 255, G = 153, B = 153};\n    var sourceColor = new RGBColor {R = 153, G = 255, B = 153};\n\n    var tokens = TokenizeString(textLine);\n\n    for (int i = 0; i < tokens.Count; i++) {\n      if (tokens[i].IsIdentifier()) {\n        string name = tokens[i].Data.ToString();\n        bool isSource = false;\n\n        if (DebuggerInstance.IsReservedKeyword(name)) {\n          Logger.Log($\"< reserved: {name}\");\n          continue;\n        }\n\n        if (FindEqualsOnRight(tokens, i) != -1) {\n          Logger.Log($\"Dest: {name}\");\n        }\n        else {\n          Logger.Log($\"Source: {name}\");\n          isSource = true;\n        }\n\n        if (isSource && lineType == LineType.Older ||\n            !isSource && lineType == LineType.Current) {\n          continue;\n        }\n\n        string variable = DebuggerExpression.Create(\n          new TextLineInfo(textLine, 0, tokens[i].Location.Offset,\n                           tokens[i].Location.Offset));\n\n        if (variable != null) {\n          long elementAddress = DebuggerInstance.ReadElementAddress(variable);\n          Logger.Log($\"Mark references for {elementAddress:x}: {variable}\");\n\n          if (elementAddress == 0) {\n            continue;\n          }\n\n          long varAddress = DebuggerInstance.GetVariableAddress(variable);\n\n          // Unmark previous pointed element.\n          //? If another var points to it, shouldn't be removed\n          if (varAddress != 0 &&\n              funcVariables_.TryGetValue(varAddress, out var markedVarInfo)) {\n            if (markedVarInfo.Item1 == elementAddress &&\n                markedVarInfo.Item2 < version_) {\n              bool usedByOthers = false;\n\n              foreach (var varInfo in funcVariables_.Values) {\n                if (varInfo != markedVarInfo && varInfo.Item1 == elementAddress) {\n                  usedByOthers = true;\n                  break;\n                }\n              }\n\n              if (!usedByOthers) {\n                ClientInstance.RunClientCommand(\n                  () => ClientInstance.debugClient_.ExecuteCommand(new ElementCommandRequest {\n                    Command = ElementCommand.ClearMarker, ElementAddress = markedVarInfo.Item1\n                  })).Wait();\n              }\n            }\n          }\n\n          funcVariables_[varAddress] = new Tuple<long, int>(elementAddress, version_);\n\n          //? use  a list of common types to exclude\n          //? - when entering a calee, make caller vars translucent, then back to 100% on return\n          //? - if new IR version created, copy over the markers\n          RGBColor markerColor;\n\n          if (lineType == LineType.Previous) {\n            if (isSource) {\n              markerColor = defaultColor;\n            }\n            else markerColor = destColor;\n          }\n          else if (lineType == LineType.Older) {\n            markerColor = defaultColor;\n          }\n          else {\n            markerColor = sourceColor;\n          }\n\n          ClientInstance.RunClientCommand(\n            () => ClientInstance.debugClient_.MarkElement(new MarkElementRequest {\n              ElementAddress = elementAddress,\n              Label = variable,\n              Color = markerColor,\n              Highlighting = HighlightingType.Permanent\n            })).Wait();\n        }\n      }\n    }\n  }\n\n  private void DebuggerEvents_OnExceptionNotHandled(\n    string ExceptionType, string Name, int Code, string Description,\n    ref dbgExceptionAction ExceptionAction) {\n    if (!ClientInstance.IsConnected) {\n      return;\n    }\n\n    JoinableTaskFactory.Run(async () => await ClientInstance.Shutdown());\n  }\n\n  private async void DebuggerEvents_OnEnterDesignMode(dbgEventReason Reason) {\n    if (!ClientInstance.IsConnected) {\n      return;\n    }\n\n    await ClientInstance.Shutdown();\n  }\n\n  private void DebuggerEvents__OnEnterRunMode(dbgEventReason reason) {\n    if (!ClientInstance.IsConnected) {\n      return;\n    }\n\n    if (reason == dbgEventReason.dbgEventReasonGo) {\n      // Pause client from handling events.\n      JoinableTaskFactory.Run(() => ClientInstance.ClearTemporaryHighlighting());\n      JoinableTaskFactory.Run(() => ClientInstance.PauseCurrentElementHandling());\n    }\n    else if (reason == dbgEventReason.dbgEventReasonStep) {\n      // Resume client handling events.\n      JoinableTaskFactory.Run(() => ClientInstance.ResumeCurrentElementHandling());\n    }\n  }\n\n  private string GetCurrentTextLine() {\n    if (dte_.ActiveDocument == null) {\n      return \"\";\n    }\n\n    var textDocument = (TextDocument)dte_.ActiveDocument.Object(\"TextDocument\");\n    var selection = textDocument.Selection;\n    var activePoint = selection.ActivePoint;\n\n    return activePoint.CreateEditPoint().GetLines(activePoint.Line, activePoint.Line + 1);\n  }\n\n  private string GetPreviousTextLine() {\n    if (dte_.ActiveDocument == null) {\n      return \"\";\n    }\n\n    var textDocument = (TextDocument)dte_.ActiveDocument.Object(\"TextDocument\");\n    var selection = textDocument.Selection;\n    var activePoint = selection.ActivePoint;\n\n    if (activePoint.Line == 0) {\n      return null;\n    }\n\n    return activePoint.CreateEditPoint().GetLines(activePoint.Line - 1, activePoint.Line);\n  }\n\n        #endregion\n}"
  },
  {
    "path": "src/VSExtension/VSExtensionPackage.vsct",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<CommandTable xmlns=\"http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\n\n  <!--  This is the file that defines the actual layout and type of the commands.\n        It is divided in different sections (e.g. command definition, command\n        placement, ...), with each defining a specific set of properties.\n        See the comment before each section for more details about how to\n        use it. -->\n\n  <!--  The VSCT compiler (the tool that translates this file into the binary\n        format that VisualStudio will consume) has the ability to run a preprocessor\n        on the vsct file; this preprocessor is (usually) the C++ preprocessor, so\n        it is possible to define includes and macros with the same syntax used\n        in C++ files. Using this ability of the compiler here, we include some files\n        defining some of the constants that we will use inside the file. -->\n\n  <!--This is the file that defines the IDs for all the commands exposed by VisualStudio. -->\n  <Extern href=\"stdidcmd.h\" />\n\n  <!--This header contains the command ids for the menus provided by the shell. -->\n  <Extern href=\"vsshlids.h\" />\n\n  <!--The Commands section is where commands, menus, and menu groups are defined.\n      This section uses a Guid to identify the package that provides the command defined inside it. -->\n  <Commands package=\"guidVSExtensionPackage\">\n    <!-- Inside this section we have different sub-sections: one for the menus, another\n    for the menu groups, one for the buttons (the actual commands), one for the combos\n    and the last one for the bitmaps used. Each element is identified by a command id that\n    is a unique pair of guid and numeric identifier; the guid part of the identifier is usually\n    called \"command set\" and is used to group different command inside a logically related\n    group; your package should define its own command set in order to avoid collisions\n    with command ids defined by other packages. -->\n\n    <!-- In this section you can define new menu groups. A menu group is a container for\n         other menus or buttons (commands); from a visual point of view you can see the\n         group as the part of a menu contained between two lines. The parent of a group\n         must be a menu. -->\n\n    <Menus>\n      <Menu guid=\"guidVSExtensionPackageCmdSet\" id=\"SubMenu1\" priority=\"0x0600\" type=\"Menu\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"MyMenuGroup\" />\n\n        <Strings>\n          <ButtonText>Profile Explorer</ButtonText>\n          <CommandName>Profile Explorer</CommandName>\n        </Strings>\n      </Menu>\n\n      <Menu guid=\"guidVSExtensionPackageCmdSet\" id=\"Toolbar\" type=\"Toolbar\">\n        <CommandFlag>DefaultDocked</CommandFlag>\n        <Strings>\n          <ButtonText>Profile Explorer</ButtonText>\n          <CommandName>Profile Explorer</CommandName>\n        </Strings>\n      </Menu>\n    </Menus>\n\n    <Groups>\n      <Group guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup\" priority=\"0x0600\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"SubMenu1\" />\n      </Group>\n\n      <Group guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup2\" priority=\"0x0600\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"SubMenu1\" />\n      </Group>\n\n      <Group guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup3\" priority=\"0x0600\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"SubMenu1\" />\n      </Group>\n\n      <Group guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup4\" priority=\"0x0600\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"SubMenu1\" />\n      </Group>\n\n      <Group guid=\"guidVSExtensionPackageCmdSet\" id=\"MyMenuGroup\" priority=\"0x0600\">\n        <Parent guid=\"guidSHLMainMenu\" id=\"IDM_VS_MENU_TOOLS\" />\n      </Group>\n\n      <Group guid=\"guidVSExtensionPackageCmdSet\" id=\"ToolbarGroup\" priority=\"0x0000\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"Toolbar\" />\n      </Group>\n    </Groups>\n\n\n    <!--Buttons section. -->\n    <!--This section defines the elements the user can interact with, like a menu command or a button\n        or combo box in a toolbar. -->\n    <Buttons>\n      <!--To define a menu group you have to specify its ID, the parent menu and its display priority.\n          The command is visible and enabled by default. If you need to change the visibility, status, etc, you can use\n          the CommandFlag node.\n          You can add more than one CommandFlag node e.g.:\n              <CommandFlag>DefaultInvisible</CommandFlag>\n              <CommandFlag>DynamicVisibility</CommandFlag>\n          If you do not want an image next to your command, remove the Icon node /> -->\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"MarkElementId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup\" />\n        <!--<Icon guid=\"guidImages\" id=\"bmpPicArrows\" />-->\n        <Strings>\n          <ButtonText>Mark Element</ButtonText>\n        </Strings>\n      </Button>\n\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"MarkExpressionId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup\" />\n        <Strings>\n          <ButtonText>Mark Expression</ButtonText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"ShowExpressionId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup\" />\n        <Strings>\n          <ButtonText>Show Expression Graph</ButtonText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"MarkUsesId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup2\" />\n        <CommandFlag>IconAndText</CommandFlag>\n        <Icon guid=\"menuImage\" id=\"menuPic1\" />\n        <Strings>\n          <ButtonText>Mark Uses</ButtonText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"ShowUsesId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup2\" />\n        <Strings>\n          <ButtonText>Show Uses</ButtonText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"MarkReferencesId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup3\" />\n        <Strings>\n          <ButtonText>Mark All References</ButtonText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"ShowReferencesId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup3\" />\n        <Strings>\n          <ButtonText>Show All References</ButtonText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"UpdateIRId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup3\" />\n        <Strings>\n          <ButtonText>Update function IR</ButtonText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"AttachId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ToolbarGroup\" />\n        <Icon guid=\"mainImage\" id=\"pexPic\" />\n        <CommandFlag>IconAndText</CommandFlag>\n        <CommandFlag>TextChanges</CommandFlag>\n\n        <Strings>\n          <ButtonText>Attach</ButtonText>\n          <ToolTipText>Attach debugger to compiler instance and start Profile Explorer</ToolTipText>\n        </Strings>\n      </Button>\n\n      <Button guid=\"guidVSExtensionPackageCmdSet\" id=\"EnableId\" priority=\"0x0100\" type=\"Button\">\n        <Parent guid=\"guidVSExtensionPackageCmdSet\" id=\"ButtonsGroup4\" />\n        <CommandFlag>TextOnly</CommandFlag>\n        <CommandFlag>TextChanges</CommandFlag>\n\n        <Strings>\n          <ButtonText>Disable extension</ButtonText>\n          <ToolTipText>Enable/disable the Profile Explorer debugger integration</ToolTipText>\n        </Strings>\n      </Button>\n    </Buttons>\n\n\n    <!--The bitmaps section is used to define the bitmaps that are used for the commands.-->\n    <Bitmaps>\n      <!--  The bitmap id is defined in a way that is a little bit different from the others:\n            the declaration starts with a guid for the bitmap strip, then there is the resource id of the\n            bitmap strip containing the bitmaps and then there are the numeric ids of the elements used\n            inside a button definition. An important aspect of this declaration is that the element id\n            must be the actual index (1-based) of the bitmap inside the bitmap strip. -->\n      <Bitmap guid=\"guidImages\" href=\"Resources\\Command1.png\" usedList=\"bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows, bmpPicStrikethrough\" />\n      <Bitmap guid=\"mainImage\" href=\"Resources\\icon.png\" usedList=\"pexPic\" />\n      <Bitmap guid=\"menuImage\" href=\"Resources\\list-ordered.png\" usedList=\"menuPic1\" />\n      </Bitmaps>\n  </Commands>\n\n\n  <CommandPlacements>\n\n    <!-- Placement for group. The parent of a group is a menu, context menu or toolbar.\n           The priority sets the position of the group compared to the priority of other existing groups in the menu.\n      -->\n    <CommandPlacement guid=\"guidVSExtensionPackageCmdSet\" id=\"MyMenuGroup\" priority=\"1\">\n      <!-- The parent of the group will be the code window context menu -->\n      <Parent guid=\"guidSHLMainMenu\" id=\"IDM_VS_CTXT_CODEWIN\" />\n    </CommandPlacement>\n\n  </CommandPlacements>\n\n  <VisibilityConstraints>\n    <VisibilityItem guid=\"guidVSExtensionPackageCmdSet\" id=\"Toolbar\" context=\"GUID_TextEditorFactory\" />\n  </VisibilityConstraints>\n\n  <Symbols>\n    <!-- This is the package guid. -->\n    <GuidSymbol name=\"guidVSExtensionPackage\" value=\"{c29cc20e-a6f8-412f-a266-3adc6f822594}\" />\n\n    <!-- This is the guid used to group the menu commands together -->\n    <GuidSymbol name=\"guidVSExtensionPackageCmdSet\" value=\"{9885ad8d-69e0-4ec4-8324-b9fd109ebdcd}\">\n      <IDSymbol name=\"SubMenu1\" value=\"0x1022\" />\n      <IDSymbol name=\"ButtonsGroup\" value=\"0x1021\" />\n      <IDSymbol name=\"ButtonsGroup2\" value=\"0x1031\" />\n      <IDSymbol name=\"ButtonsGroup3\" value=\"0x1041\" />\n      <IDSymbol name=\"ButtonsGroup4\" value=\"0x1042\" />\n\n      <IDSymbol name=\"MyMenuGroup\" value=\"0x1020\" />\n      <IDSymbol name=\"MarkElementId\" value=\"0x0100\" />\n      <IDSymbol name=\"MarkUsesId\" value=\"0x0101\" />\n      <IDSymbol name=\"MarkReferencesId\" value=\"0x0102\" />\n      <IDSymbol name=\"MarkExpressionId\" value=\"0x0103\" />\n      <IDSymbol name=\"ShowReferencesId\" value=\"0x0104\" />\n      <IDSymbol name=\"ShowUsesId\" value=\"0x0105\" />\n      <IDSymbol name=\"AttachId\" value=\"0x0106\" />\n      <IDSymbol name=\"ShowExpressionId\" value=\"0x0107\" />\n      <IDSymbol name=\"EnableId\" value=\"0x0108\" />\n      <IDSymbol name=\"UpdateIRId\" value=\"0x0109\" />\n\n      <IDSymbol name=\"Toolbar\" value=\"0x1000\" />\n      <IDSymbol name=\"ToolbarGroup\" value=\"0x1050\" />\n    </GuidSymbol>\n\n    <GuidSymbol name=\"mainImage\" value=\"{8a2b4264-3397-430f-8664-c8e1428d9122}\">\n      <IDSymbol name=\"pexPic\" value=\"1\" />\n    </GuidSymbol>\n    <GuidSymbol name=\"menuImage\" value=\"{8a2b4264-3397-430f-8664-c8e1428d9123}\">\n      <IDSymbol name=\"menuPic1\" value=\"1\" />\n    </GuidSymbol>\n    <GuidSymbol name=\"guidImages\" value=\"{8a2b4264-3397-430f-8664-c8e1428d9121}\">\n      <IDSymbol name=\"bmpPic1\" value=\"1\" />\n      <IDSymbol name=\"bmpPic2\" value=\"2\" />\n      <IDSymbol name=\"bmpPicSearch\" value=\"3\" />\n      <IDSymbol name=\"bmpPicX\" value=\"4\" />\n      <IDSymbol name=\"bmpPicArrows\" value=\"5\" />\n      <IDSymbol name=\"bmpPicStrikethrough\" value=\"6\" />\n    </GuidSymbol>\n\n    <GuidSymbol value=\"{06028dba-911d-4b76-8696-dc51e9b9cd93}\" name=\"guidImages1\">\n      <IDSymbol name=\"bmpPic1\" value=\"1\" />\n      <IDSymbol name=\"bmpPic2\" value=\"2\" />\n      <IDSymbol name=\"bmpPicSearch\" value=\"3\" />\n      <IDSymbol name=\"bmpPicX\" value=\"4\" />\n      <IDSymbol name=\"bmpPicArrows\" value=\"5\" />\n      <IDSymbol name=\"bmpPicStrikethrough\" value=\"6\" />\n    </GuidSymbol>\n  </Symbols>\n</CommandTable>"
  },
  {
    "path": "src/VSExtension/source.extension.vsixmanifest",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<PackageManifest Version=\"2.0.0\" xmlns=\"http://schemas.microsoft.com/developer/vsx-schema/2011\" xmlns:d=\"http://schemas.microsoft.com/developer/vsx-schema-design/2011\">\n    <Metadata>\n        <Identity Id=\"VSExtension.968b8230-b177-465a-83a0-761e7054dbe3\" Version=\"0.6\" Language=\"en-US\" Publisher=\"Gratian Lup\" />\n        <DisplayName>Profile Explorer</DisplayName>\n        <Description xml:space=\"preserve\">Profile Explorer debugger integration</Description>\n        <Icon>main.ico</Icon>\n    </Metadata>\n    <Installation AllUsers=\"true\">\n        <InstallationTarget Id=\"Microsoft.VisualStudio.Community\" Version=\"[17.0)\">\n            <ProductArchitecture>amd64</ProductArchitecture>\n        </InstallationTarget>\n    </Installation>\n    <Dependencies>\n        <Dependency Id=\"Microsoft.Framework.NDP\" DisplayName=\"Microsoft .NET Framework\" d:Source=\"Manual\" Version=\"[4.5,)\" />\n    </Dependencies>\n    <Prerequisites>\n        <Prerequisite Id=\"Microsoft.VisualStudio.Component.CoreEditor\" Version=\"[16.0,17.0)\" DisplayName=\"Visual Studio core editor\" />\n    </Prerequisites>\n    <Assets>\n        <Asset Type=\"Microsoft.VisualStudio.VsPackage\" d:Source=\"Project\" d:ProjectName=\"%CurrentProject%\" Path=\"|%CurrentProject%;PkgdefProjectOutputGroup|\" />\n        <Asset Type=\"Microsoft.VisualStudio.MefComponent\" d:Source=\"Project\" d:ProjectName=\"%CurrentProject%\" Path=\"|%CurrentProject%|\" />\n    </Assets>\n</PackageManifest>"
  },
  {
    "path": "src/external/TreeListView/AssemblyInfo.cs",
    "content": "using System.Windows;\n\n[assembly: ThemeInfo(\n    ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located\n                                     //(used if a resource is not found in the page,\n                                     // or application resource dictionaries)\n    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located\n                                              //(used if a resource is not found in the page,\n                                              // app, or any theme specific resource dictionaries)\n)]\n"
  },
  {
    "path": "src/external/TreeListView/Collection.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Collections.Specialized;\n\nnamespace Aga.Controls\n{\n\tpublic class ObservableCollectionAdv<T> : ObservableCollection<T>\n\t{\n\t\tpublic void RemoveRange(int index, int count)\n\t\t{\n\t\t\tthis.CheckReentrancy();\n\t\t\tvar items = this.Items as List<T>;\n\t\t\titems.RemoveRange(index, count);\n\t\t\tOnReset();\n\t\t}\n\n\t\tpublic void InsertRange(int index, IEnumerable<T> collection)\n\t\t{\n\t\t\tthis.CheckReentrancy();\n\t\t\tvar items = this.Items as List<T>;\n\t\t\titems.InsertRange(index, collection);\n\t\t\tOnReset();\n\t\t}\n\n\t\tprivate void OnReset()\n\t\t{\n\t\t\tOnPropertyChanged(\"Count\");\n\t\t\tOnPropertyChanged(\"Item[]\");\n\t\t\tOnCollectionChanged(new NotifyCollectionChangedEventArgs(\n\t\t\t\tNotifyCollectionChangedAction.Reset));\n\t\t}\n\n\t\tprivate void OnPropertyChanged(string propertyName)\n\t\t{\n\t\t\tOnPropertyChanged(new PropertyChangedEventArgs(propertyName));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/external/TreeListView/LICENSE",
    "content": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "src/external/TreeListView/README.md",
    "content": "TreeListView\n============\n\nhttp://www.codeproject.com/Articles/30721/WPF-TreeListView-Control\n"
  },
  {
    "path": "src/external/TreeListView/Themes/Generic.xaml",
    "content": "<ResourceDictionary\n  xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n  xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\"\n  xmlns:local=\"clr-namespace:Aga.Controls\"\n  xmlns:tree=\"clr-namespace:Aga.Controls.Tree\">\n\n  <Style x:Key=\"ExpandCollapseToggleStyle\" TargetType=\"{x:Type ToggleButton}\">\n    <Style.Resources>\n      <Style x:Key=\"TreeViewItemFocusVisual\">\n        <Setter Property=\"Control.Template\">\n          <Setter.Value>\n            <ControlTemplate>\n              <Rectangle\n                Margin=\"0,0,0,0\"\n                Opacity=\"0\"\n                Stroke=\"Black\"\n                StrokeDashArray=\"1 2\"\n                StrokeThickness=\"5\" />\n            </ControlTemplate>\n          </Setter.Value>\n        </Setter>\n      </Style>\n    </Style.Resources>\n\n    <Setter Property=\"Focusable\" Value=\"False\" />\n    <Setter Property=\"Width\" Value=\"19\" />\n    <Setter Property=\"Height\" Value=\"13\" />\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"ToggleButton\">\n          <Border\n            Width=\"9\"\n            Height=\"9\"\n            Margin=\"0,4,0,0\"\n            HorizontalAlignment=\"Center\"\n            VerticalAlignment=\"Center\"\n            Background=\"#00FFFFFF\"\n            BorderBrush=\"#444\"\n            BorderThickness=\"1,1,1,1\"\n            SnapsToDevicePixels=\"True\">\n            <Path\n              Name=\"ExpandPath\"\n              Margin=\"1,1,1,1\"\n              Data=\"M0,2L0,3 2,3 2,5 3,5 3,3 5,3 5,2 3,2 3,0 2,0 2,2z\"\n              Fill=\"#444\" />\n          </Border>\n          <ControlTemplate.Triggers>\n            <Trigger Property=\"ToggleButton.IsChecked\" Value=\"True\">\n              <Setter TargetName=\"ExpandPath\" Property=\"Path.Data\">\n                <Setter.Value>\n                  <StreamGeometry>M0,2L0,3 5,3 5,2z</StreamGeometry>\n                </Setter.Value>\n              </Setter>\n            </Trigger>\n          </ControlTemplate.Triggers>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n\n  <tree:LevelToIndentConverter x:Key=\"LevelToIndentConverter\" />\n  <tree:CanExpandConverter x:Key=\"CanExpandConverter\" />\n\n  <VisualBrush\n    x:Key=\"HatchBrush\"\n    TileMode=\"Tile\"\n    Viewbox=\"0,0,15,20\"\n    ViewboxUnits=\"Absolute\"\n    Viewport=\"0,0,15,20\"\n    ViewportUnits=\"Absolute\">\n    <VisualBrush.Visual>\n      <Canvas>\n        <Rectangle\n          Width=\"0.7\"\n          Height=\"20\"\n          Fill=\"Gray\" />\n      </Canvas>\n    </VisualBrush.Visual>\n  </VisualBrush>\n\n  <Style TargetType=\"{x:Type tree:RowExpander}\">\n    <Setter Property=\"Focusable\" Value=\"False\" />\n    <Setter Property=\"Template\">\n      <Setter.Value>\n        <ControlTemplate TargetType=\"{x:Type tree:RowExpander}\">\n          <Grid SnapsToDevicePixels=\"true\">\n            <Border\n              x:Name=\"VerLn\"\n              Width=\"Auto\"\n              Margin=\"10,0,15,0\"\n              Padding=\"0,0,0,0\"\n              HorizontalAlignment=\"Stretch\"\n              Background=\"{StaticResource HatchBrush}\"\n              ClipToBounds=\"True\" />\n            <ToggleButton\n              x:Name=\"Expander\"\n              Margin=\"{Binding Node.Level, Converter={StaticResource LevelToIndentConverter}, RelativeSource={RelativeSource AncestorType={x:Type tree:TreeListItem}}}\"\n              HorizontalAlignment=\"Stretch\"\n              VerticalAlignment=\"Center\"\n              ClickMode=\"Press\"\n              IsChecked=\"{Binding Node.IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type tree:TreeListItem}}}\"\n              Style=\"{StaticResource ExpandCollapseToggleStyle}\"\n              Visibility=\"{Binding Node.IsExpandable, Converter={StaticResource CanExpandConverter}, RelativeSource={RelativeSource AncestorType={x:Type tree:TreeListItem}}}\" />\n          </Grid>\n        </ControlTemplate>\n      </Setter.Value>\n    </Setter>\n  </Style>\n</ResourceDictionary>"
  },
  {
    "path": "src/external/TreeListView/Tree/Converters.cs",
    "content": "using System;\nusing System.Windows.Controls;\nusing System.Windows;\nusing System.Windows.Data;\nusing System.Globalization;\n\n\nnamespace Aga.Controls.Tree\n{\n    /// <summary>\n    /// Convert Level to left margin\n    /// </summary>\n\tinternal class LevelToIndentConverter : IValueConverter\n    {\n\t\tprivate const double IndentSize = 15.0;\n\n\t\tpublic object Convert(object o, Type type, object parameter, CultureInfo culture)\n        {\n            return new Thickness((int)o * IndentSize, 0, 0, 0);\n        }\n\n        public object ConvertBack(object o, Type type, object parameter, CultureInfo culture)\n        {\n            throw new NotSupportedException();\n        }\n    }\n\n\tinternal class CanExpandConverter : IValueConverter\n\t{\n\t\tpublic object Convert(object o, Type type, object parameter, CultureInfo culture)\n\t\t{\n\t\t\tif ((bool)o)\n\t\t\t\treturn Visibility.Visible;\n\t\t\telse\n\t\t\t\treturn Visibility.Hidden;\n\t\t}\n\n\t\tpublic object ConvertBack(object o, Type type, object parameter, CultureInfo culture)\n\t\t{\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\t}\n}"
  },
  {
    "path": "src/external/TreeListView/Tree/ITreeModel.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace Aga.Controls.Tree\n{\n\tpublic interface ITreeModel\n\t{\n\t\t/// <summary>\n\t\t/// Get list of children of the specified parent\n\t\t/// </summary>\n\t\tIEnumerable GetChildren(object parent);\n\n\t\t/// <summary>\n\t\t/// returns wheather specified parent has any children or not.\n\t\t/// </summary>\n\t\tbool HasChildren(object parent);\n        TreeNode TreeNode { get; set; }\n\t}\n}\n"
  },
  {
    "path": "src/external/TreeListView/Tree/RowExpander.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Navigation;\nusing System.Windows.Shapes;\n\nnamespace Aga.Controls.Tree\n{\n\tpublic class RowExpander : Control\n\t{\n\t\tstatic RowExpander()\n\t\t{\n\t\t\tDefaultStyleKeyProperty.OverrideMetadata(typeof(RowExpander), new FrameworkPropertyMetadata(typeof(RowExpander)));\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/external/TreeListView/Tree/TreeList.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Controls;\nusing System.Windows;\nusing System.Windows.Data;\nusing System.Collections.ObjectModel;\nusing System.Collections;\nusing System.ComponentModel;\nusing System.Collections.Specialized;\nusing System.Windows.Input;\nusing System.Windows.Controls.Primitives;\n\nnamespace Aga.Controls.Tree\n{\n\tpublic class TreeList: ListView\n\t{\n\t\t#region Properties\n\n\t\t/// <summary>\n\t\t/// Internal collection of rows representing visible nodes, actually displayed in the ListView\n\t\t/// </summary>\n\t\tinternal ObservableCollectionAdv<TreeNode> Rows\n\t\t{\n\t\t\tget;\n\t\t\tprivate set;\n\t\t} \n\n\n\t\tprivate ITreeModel _model;\n\t\tpublic ITreeModel Model\n\t\t{\n\t\t  get { return _model; }\n\t\t  set \n\t\t  {\n\t\t\t  if (_model != value)\n\t\t\t  {\n\t\t\t\t  _model = value;\n\t\t\t\t  _root.Children.Clear();\n\t\t\t\t  Rows.Clear();\n\t\t\t\t  CreateChildrenNodes(_root);\n\t\t\t  }\n\t\t  }\n\t\t}\n\n\t\tprivate TreeNode _root;\n\t\tinternal TreeNode Root\n\t\t{\n\t\t\tget { return _root; }\n\t\t}\n\n\t\tpublic ReadOnlyCollection<TreeNode> Nodes\n\t\t{\n\t\t\tget { return Root.Nodes; }\n\t\t}\n\n\t\tinternal TreeNode PendingFocusNode\n\t\t{\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t\tpublic ICollection<TreeNode> SelectedNodes\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn SelectedItems.Cast<TreeNode>().ToArray();\n\t\t\t}\n\t\t}\n\n\t\tpublic TreeNode SelectedNode\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (SelectedItems.Count > 0)\n\t\t\t\t\treturn SelectedItems[0] as TreeNode;\n\t\t\t\telse\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\tpublic TreeList()\n\t\t{\n\t\t\tRows = new ObservableCollectionAdv<TreeNode>();\n\t\t\t_root = new TreeNode(this, null);\n\t\t\t_root.IsExpanded = true;\n\t\t\tItemsSource = Rows;\n\t\t\tItemContainerGenerator.StatusChanged += ItemContainerGeneratorStatusChanged;\n\t\t}\n\n\t\tvoid ItemContainerGeneratorStatusChanged(object sender, EventArgs e)\n\t\t{\n\t\t\tif (ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated && PendingFocusNode != null)\n\t\t\t{\n\t\t\t\tvar item = ItemContainerGenerator.ContainerFromItem(PendingFocusNode) as TreeListItem;\n\t\t\t\tif (item != null)\n\t\t\t\t\titem.Focus();\n\t\t\t\tPendingFocusNode = null;\n\t\t\t}\n\t\t}\n\n\t\tprotected override DependencyObject GetContainerForItemOverride()\n\t\t{\n\t\t\treturn new TreeListItem();\n\t\t}\n\n\t\tprotected override bool IsItemItsOwnContainerOverride(object item)\n\t\t{\n\t\t\treturn item is TreeListItem;\n\t\t}\n\n\t\tprotected override void PrepareContainerForItemOverride(DependencyObject element, object item)\n\t\t{\n\t\t\tvar ti = element as TreeListItem;\n\t\t\tvar node = item as TreeNode;\n\t\t\tif (ti != null && node != null)\n\t\t\t{\n\t\t\t\tti.Node = item as TreeNode;\n\t\t\t\tbase.PrepareContainerForItemOverride(element, node.Tag);\n\t\t\t}\n\t\t}\n\n        public event EventHandler<TreeNode> NodeExpanded;\n        public event EventHandler<TreeNode> NodeCollapsed;\n\n        internal void SetIsExpanded(TreeNode node, bool value)\n\t\t{\n\t\t\tif (value) {\n                NodeExpanded?.Invoke(this, node);\n\n\t\t\t\tif (!node.IsExpandedOnce)\n\t\t\t\t{\n\t\t\t\t\tnode.IsExpandedOnce = true;\n\t\t\t\t\tnode.AssignIsExpanded(value);\n\t\t\t\t\tCreateChildrenNodes(node);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnode.AssignIsExpanded(value);\n\t\t\t\t\tCreateChildrenRows(node);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tDropChildrenRows(node, false);\n\t\t\t\tnode.AssignIsExpanded(value);\n                NodeCollapsed?.Invoke(this, node);\n            }\n\t\t}\n\n\t\tinternal void CreateChildrenNodes(TreeNode node)\n\t\t{\n\t\t\tvar children = GetChildren(node);\n\t\t\tif (children != null)\n\t\t\t{\n\t\t\t\tint rowIndex = Rows.IndexOf(node);\n\t\t\t\tnode.ChildrenSource = children as INotifyCollectionChanged;\n\t\t\t\tforeach (object obj in children)\n\t\t\t\t{\n\t\t\t\t\tTreeNode child = new TreeNode(this, obj);\n\t\t\t\t\tchild.HasChildren = HasChildren(child);\n\t\t\t\t\tnode.Children.Add(child);\n\t\t\t\t}\n\t\t\t\tRows.InsertRange(rowIndex + 1, node.Children.ToArray());\n\t\t\t}\n\t\t}\n\n\t\tprivate void CreateChildrenRows(TreeNode node)\n\t\t{\n\t\t\tint index = Rows.IndexOf(node);\n\t\t\tif (index >= 0 || node == _root) // ignore invisible nodes\n\t\t\t{\n\t\t\t\tvar nodes = node.AllVisibleChildren.ToArray();\n\t\t\t\tRows.InsertRange(index + 1, nodes);\n\t\t\t}\n\t\t}\n\n\t\tinternal void DropChildrenRows(TreeNode node, bool removeParent)\n\t\t{\n\t\t\tint start = Rows.IndexOf(node);\n\t\t\tif (start >= 0 || node == _root) // ignore invisible nodes\n\t\t\t{\n\t\t\t\tint count = node.VisibleChildrenCount;\n\t\t\t\tif (removeParent)\n\t\t\t\t\tcount++;\n\t\t\t\telse\n\t\t\t\t\tstart++;\n\t\t\t\tRows.RemoveRange(start, count);\n\t\t\t}\n\t\t}\n\n\t\tprivate IEnumerable GetChildren(TreeNode parent)\n\t\t{\n\t\t\tif (Model != null)\n\t\t\t\treturn Model.GetChildren(parent.Tag);\n\t\t\telse\n\t\t\t\treturn null;\n\t\t}\n\n\t\tprivate bool HasChildren(TreeNode parent)\n\t\t{\n\t\t\tif (parent == Root)\n\t\t\t\treturn true;\n\t\t\telse if (Model != null)\n\t\t\t\treturn Model.HasChildren(parent.Tag);\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\n        internal void InsertNewNode(TreeNode parent, object tag, int rowIndex, int index)\n\t\t{\n\t\t\tTreeNode node = new TreeNode(this, tag);\n\t\t\tif (index >= 0 && index < parent.Children.Count)\n\t\t\t\tparent.Children.Insert(index, node);\n\t\t\telse\n\t\t\t{\n\t\t\t\tindex = parent.Children.Count;\n\t\t\t\tparent.Children.Add(node);\n\t\t\t}\n\t\t\tRows.Insert(rowIndex + index + 1, node);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/external/TreeListView/Tree/TreeListItem.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.ComponentModel;\nusing System.Windows;\n\nnamespace Aga.Controls.Tree\n{\n\tpublic class TreeListItem : ListViewItem, INotifyPropertyChanged\n\t{\n\t\t#region Properties\n\n\t\tprivate TreeNode _node;\n\t\tpublic TreeNode Node\n\t\t{\n\t\t\tget { return _node; }\n\t\t\tinternal set\n\t\t\t{\n\t\t\t\t_node = value;\n\t\t\t\tOnPropertyChanged(\"Node\");\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic TreeListItem()\n\t\t{\n\t\t}\n\n\t\tprotected override void OnKeyDown(KeyEventArgs e)\n\t\t{\n\t\t\tif (Node != null)\n\t\t\t{\n\t\t\t\tswitch (e.Key)\n\t\t\t\t{\n\t\t\t\t\tcase Key.Right:\n\t\t\t\t\t\te.Handled = true;\n\t\t\t\t\t\tif (!Node.IsExpanded)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tNode.IsExpanded = true;\n\t\t\t\t\t\t\tChangeFocus(Node);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (Node.Children.Count > 0)\n\t\t\t\t\t\t\tChangeFocus(Node.Children[0]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Key.Left:\n\n\t\t\t\t\t\te.Handled = true;\n\t\t\t\t\t\tif (Node.IsExpanded && Node.IsExpandable)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tNode.IsExpanded = false;\n\t\t\t\t\t\t\tChangeFocus(Node);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tChangeFocus(Node.Parent);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Key.Subtract:\n\t\t\t\t\t\te.Handled = true;\n\t\t\t\t\t\tNode.IsExpanded = false;\n\t\t\t\t\t\tChangeFocus(Node);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase Key.Add:\n\t\t\t\t\t\te.Handled = true;\n\t\t\t\t\t\tNode.IsExpanded = true;\n\t\t\t\t\t\tChangeFocus(Node);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!e.Handled)\n\t\t\t\tbase.OnKeyDown(e);\n\t\t}\n\n\t\tprivate void ChangeFocus(TreeNode node)\n\t\t{\n\t\t\tvar tree = node.Tree;\n\t\t\tif (tree != null)\n\t\t\t{\n\t\t\t\tvar item = tree.ItemContainerGenerator.ContainerFromItem(node) as TreeListItem;\n\t\t\t\tif (item != null)\n\t\t\t\t\titem.Focus();\n\t\t\t\telse\n\t\t\t\t\ttree.PendingFocusNode = node;\n\t\t\t}\n\t\t}\n\n\t\t#region INotifyPropertyChanged Members\n\n\t\tpublic event PropertyChangedEventHandler PropertyChanged;\n\n\t\tprivate void OnPropertyChanged(string name)\n\t\t{\n\t\t\tif (PropertyChanged != null)\n\t\t\t\tPropertyChanged(this, new PropertyChangedEventArgs(name));\n\t\t}\n\n\t\t#endregion\n\t}\n}"
  },
  {
    "path": "src/external/TreeListView/Tree/TreeNode.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Collections.ObjectModel;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Collections.Specialized;\nusing System.Diagnostics;\n\nnamespace Aga.Controls.Tree\n{\n\tpublic sealed class TreeNode : INotifyPropertyChanged\n\t{\n\t\t#region NodeCollection\n\t\tprivate class NodeCollection : Collection<TreeNode>\n\t\t{\n\t\t\tprivate TreeNode _owner;\n\n\t\t\tpublic NodeCollection(TreeNode owner)\n\t\t\t{\n\t\t\t\t_owner = owner;\n\t\t\t}\n\n\t\t\tprotected override void ClearItems()\n\t\t\t{\n\t\t\t\twhile (this.Count != 0)\n\t\t\t\t\tthis.RemoveAt(this.Count - 1);\n\t\t\t}\n\n\t\t\tprotected override void InsertItem(int index, TreeNode item)\n\t\t\t{\n\t\t\t\tif (item == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"item\");\n\n\t\t\t\tif (item.Parent != _owner)\n\t\t\t\t{\n\t\t\t\t\tif (item.Parent != null)\n\t\t\t\t\t\titem.Parent.Children.Remove(item);\n\t\t\t\t\titem._parent = _owner;\n\t\t\t\t\titem._index = index;\n\t\t\t\t\tfor (int i = index; i < Count; i++)\n\t\t\t\t\t\tthis[i]._index++;\n\t\t\t\t\tbase.InsertItem(index, item);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprotected override void RemoveItem(int index)\n\t\t\t{\n\t\t\t\tTreeNode item = this[index];\n\t\t\t\titem._parent = null;\n\t\t\t\titem._index = -1;\n\t\t\t\tfor (int i = index + 1; i < Count; i++)\n\t\t\t\t\tthis[i]._index--;\n\t\t\t\tbase.RemoveItem(index);\n\t\t\t}\n\n\t\t\tprotected override void SetItem(int index, TreeNode item)\n\t\t\t{\n\t\t\t\tif (item == null)\n\t\t\t\t\tthrow new ArgumentNullException(\"item\");\n\t\t\t\tRemoveAt(index);\n\t\t\t\tInsertItem(index, item);\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region INotifyPropertyChanged Members\n\n\t\tpublic event PropertyChangedEventHandler PropertyChanged;\n\t\tprivate void OnPropertyChanged(string name)\n\t\t{\n\t\t\tif (PropertyChanged != null)\n\t\t\t\tPropertyChanged(this, new PropertyChangedEventArgs(name));\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Properties\n\n\t\tprivate TreeList _tree;\n\t\tinternal TreeList Tree\n\t\t{\n\t\t\tget { return _tree; }\n\t\t}\n\n\t\tprivate INotifyCollectionChanged _childrenSource;\n\t\tinternal INotifyCollectionChanged ChildrenSource\n\t\t{\n\t\t\tget { return _childrenSource; }\n\t\t\tset \n\t\t\t{\n\t\t\t\tif (_childrenSource != null)\n\t\t\t\t\t_childrenSource.CollectionChanged -= ChildrenChanged;\n\n\t\t\t\t_childrenSource = value;\n\n\t\t\t\tif (_childrenSource != null)\n\t\t\t\t\t_childrenSource.CollectionChanged += ChildrenChanged;\n\t\t\t}\n\t\t}\n\n\t\tprivate int _index = -1;\n\t\tpublic int Index\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn _index;\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Returns true if all parent nodes of this node are expanded.\n\t\t/// </summary>\n\t\tinternal bool IsVisible\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tTreeNode node = _parent;\n\t\t\t\twhile (node != null)\n\t\t\t\t{\n\t\t\t\t\tif (!node.IsExpanded)\n\t\t\t\t\t\treturn false;\n\t\t\t\t\tnode = node.Parent;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsExpandedOnce\n\t\t{\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\n\t\tpublic bool HasChildren\n\t\t{\n\t\t\tget;\n\t\t\tinternal set;\n\t\t}\n\n\t\tprivate bool _isExpanded;\n\t\tpublic bool IsExpanded\n\t\t{\n\t\t\tget { return _isExpanded; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (value != IsExpanded)\n\t\t\t\t{\n\t\t\t\t\tTree.SetIsExpanded(this, value);\n\t\t\t\t\tOnPropertyChanged(\"IsExpanded\");\n\t\t\t\t\tOnPropertyChanged(\"IsExpandable\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tinternal void AssignIsExpanded(bool value)\n\t\t{\n\t\t\t_isExpanded = value;\n\t\t}\n\n\t\tpublic bool IsExpandable\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn (HasChildren && !IsExpandedOnce) || Nodes.Count > 0;\n\t\t\t}\n\t\t}\n\n\t\tprivate bool _isSelected;\n\t\tpublic bool IsSelected\n\t\t{\n\t\t\tget { return _isSelected; }\n\t\t\tset\n\t\t\t{\n\t\t\t\tif (value != _isSelected)\n\t\t\t\t{\n\t\t\t\t\t_isSelected = value;\n\t\t\t\t\tOnPropertyChanged(\"IsSelected\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tprivate TreeNode _parent;\n\t\tpublic TreeNode Parent\n\t\t{\n\t\t\tget { return _parent; }\n\t\t}\n\n\t\tpublic int Level\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_parent == null)\n\t\t\t\t\treturn -1;\n\t\t\t\telse\n\t\t\t\t\treturn _parent.Level + 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic TreeNode PreviousNode\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_parent != null)\n\t\t\t\t{\n\t\t\t\t\tint index = Index;\n\t\t\t\t\tif (index > 0)\n\t\t\t\t\t\treturn _parent.Nodes[index - 1];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tpublic TreeNode NextNode\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (_parent != null)\n\t\t\t\t{\n\t\t\t\t\tint index = Index;\n\t\t\t\t\tif (index < _parent.Nodes.Count - 1)\n\t\t\t\t\t\treturn _parent.Nodes[index + 1];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tinternal TreeNode BottomNode\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tTreeNode parent = this.Parent;\n\t\t\t\tif (parent != null)\n\t\t\t\t{\n\t\t\t\t\tif (parent.NextNode != null)\n\t\t\t\t\t\treturn parent.NextNode;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn parent.BottomNode;\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\tinternal TreeNode NextVisibleNode\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tif (IsExpanded && Nodes.Count > 0)\n\t\t\t\t\treturn Nodes[0];\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tTreeNode nn = NextNode;\n\t\t\t\t\tif (nn != null)\n\t\t\t\t\t\treturn nn;\n\t\t\t\t\telse\n\t\t\t\t\t\treturn BottomNode;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic int VisibleChildrenCount\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn AllVisibleChildren.Count();\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<TreeNode> AllVisibleChildren\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\tint level = this.Level;\n\t\t\t\tTreeNode node = this;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tnode = node.NextVisibleNode;\n\t\t\t\t\tif (node != null && node.Level > level)\n\t\t\t\t\t\tyield return node;\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate object _tag;\n\t\tpublic object Tag\n\t\t{\n\t\t\tget { return _tag; }\n\t\t}\n\n\t\tprivate Collection<TreeNode> _children;\n\t\tinternal Collection<TreeNode> Children\n\t\t{\n\t\t\tget { return _children; }\n\t\t}\n\n\t\tprivate ReadOnlyCollection<TreeNode> _nodes;\n\t\tpublic ReadOnlyCollection<TreeNode> Nodes\n\t\t{\n\t\t\tget { return _nodes; }\n\t\t}\n\n\t\t#endregion\n\n\t\tinternal TreeNode(TreeList tree, object tag)\n\t\t{\n\t\t\tif (tree == null)\n\t\t\t\tthrow new ArgumentNullException(\"tree\");\n\n            if (tag is ITreeModel treeModel) {\n                treeModel.TreeNode = this;\n            }\n            \n            _tree = tree;\n\t\t\t_children = new NodeCollection(this);\n\t\t\t_nodes = new ReadOnlyCollection<TreeNode>(_children);\n\t\t\t_tag = tag;\n        }\n\n\t\tpublic override string ToString()\n\t\t{\n\t\t\tif (Tag != null)\n\t\t\t\treturn Tag.ToString();\n\t\t\telse\n\t\t\t\treturn base.ToString();\n\t\t}\n\n\t\tvoid ChildrenChanged(object sender, NotifyCollectionChangedEventArgs e)\n\t\t{\n\t\t\tswitch (e.Action)\n\t\t\t{\n\t\t\t\tcase NotifyCollectionChangedAction.Add:\n\t\t\t\t\tif (e.NewItems != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tint index = e.NewStartingIndex;\n\t\t\t\t\t\tint rowIndex = Tree.Rows.IndexOf(this);\n\t\t\t\t\t\tforeach (object obj in e.NewItems)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tTree.InsertNewNode(this, obj, rowIndex, index);\n\t\t\t\t\t\t\tindex++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NotifyCollectionChangedAction.Remove:\n\t\t\t\t\tif (Children.Count > e.OldStartingIndex)\n\t\t\t\t\t\tRemoveChildAt(e.OldStartingIndex);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase NotifyCollectionChangedAction.Move:\n\t\t\t\tcase NotifyCollectionChangedAction.Replace:\n\t\t\t\tcase NotifyCollectionChangedAction.Reset:\n\t\t\t\t\twhile (Children.Count > 0)\n\t\t\t\t\t\tRemoveChildAt(0);\n\t\t\t\t\tTree.CreateChildrenNodes(this);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tHasChildren = Children.Count > 0;\n\t\t\tOnPropertyChanged(\"IsExpandable\");\n\t\t}\n\n\t\tprivate void RemoveChildAt(int index)\n\t\t{\n\t\t\tvar child = Children[index];\n\t\t\tTree.DropChildrenRows(child, true);\n\t\t\tClearChildrenSource(child);\n\t\t\tChildren.RemoveAt(index);\n\t\t}\n\n\t\tprivate void ClearChildrenSource(TreeNode node)\n\t\t{\n\t\t\tnode.ChildrenSource = null;\n\t\t\tforeach (var n in node.Children)\n\t\t\t\tClearChildrenSource(n);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/external/TreeListView/TreeListView.csproj",
    "content": "﻿<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <TargetFramework>net8.0-windows</TargetFramework>\n    <UseWPF>true</UseWPF>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "src/external/TreeListView/TreeListView.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 16\nVisualStudioVersion = 16.0.31025.218\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"TreeListView\", \"TreeListView.csproj\", \"{8B6E1160-E068-4D24-9D23-7ED67430F55D}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{8B6E1160-E068-4D24-9D23-7ED67430F55D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{8B6E1160-E068-4D24-9D23-7ED67430F55D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{8B6E1160-E068-4D24-9D23-7ED67430F55D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{8B6E1160-E068-4D24-9D23-7ED67430F55D}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {EC177709-C492-4EDF-A961-89058FD0B3A6}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "src/external/arm64/config6",
    "content": "# This file was generated by \"dot -c\" at time of install.\n\n# You may temporarily disable a plugin by removing or commenting out\n# a line in this file, or you can modify its \"quality\" value to affect\n# default plugin selection.\n\n# Manual edits to this file **will be lost** on upgrade.\n\ngvplugin_core.dll core {\n\tdevice {\n\t\tdot:dot 1\n\t\tgv:dot 1\n\t\tcanon:dot 1\n\t\tplain:dot 1\n\t\tplain-ext:dot 1\n\t\txdot:xdot 1\n\t\txdot1.2:xdot 1\n\t\txdot1.4:xdot 1\n\t}\n\tdevice {\n\t\tfig:fig 1\n\t}\n\tdevice {\n\t\tismap:map 1\n\t\tcmap:map 1\n\t\timap:map 1\n\t\tcmapx:map 1\n\t\timap_np:map 1\n\t\tcmapx_np:map 1\n\t}\n\tdevice {\n\t\tps:ps 1\n\t\tps2:ps 1\n\t\teps:ps 1\n\t}\n\tdevice {\n\t\tsvg:svg 1\n\t\tsvgz:svg 1\n\t\tsvg_inline:svg 1\n\t}\n\tdevice {\n\t\tjson:json 1\n\t\tjson0:json 1\n\t\tdot_json:json 1\n\t\txdot_json:json 1\n\t}\n\tdevice {\n\t\ttk:tk 1\n\t}\n\tdevice {\n\t\tpic:pic -1\n\t}\n\tdevice {\n\t\tpov:pov 1\n\t}\n\trender {\n\t\tdot 1\n\t\txdot 1\n\t}\n\trender {\n\t\tfig 1\n\t}\n\trender {\n\t\tmap 1\n\t}\n\trender {\n\t\tps 1\n\t}\n\trender {\n\t\tsvg 1\n\t\tsvg_inline 1\n\t}\n\trender {\n\t\tjson 1\n\t\tjson0 1\n\t\tdot_json 1\n\t\txdot_json 1\n\t}\n\trender {\n\t\ttk 1\n\t}\n\trender {\n\t\tpic -1\n\t}\n\trender {\n\t\tpov 1\n\t}\n\tloadimage {\n\t\tpng:svg 1\n\t\tgif:svg 1\n\t\tjpeg:svg 1\n\t\tjpe:svg 1\n\t\tjpg:svg 1\n\t\tpng:fig 1\n\t\tgif:fig 1\n\t\tjpeg:fig 1\n\t\tjpe:fig 1\n\t\tjpg:fig 1\n#FAILS\t\tpng:vrml 1\n#FAILS\t\tgif:vrml 1\n#FAILS\t\tjpeg:vrml 1\n#FAILS\t\tjpe:vrml 1\n#FAILS\t\tjpg:vrml 1\n\t\teps:ps 1\n\t\tps:ps 1\n\t\t(lib):ps 1\n\t\tpng:map 1\n\t\tgif:map 1\n\t\tjpeg:map 1\n\t\tjpe:map 1\n\t\tjpg:map 1\n\t\tps:map 1\n\t\teps:map 1\n\t\tsvg:map 1\n\t\tpng:dot 1\n\t\tgif:dot 1\n\t\tjpeg:dot 1\n\t\tjpe:dot 1\n\t\tjpg:dot 1\n\t\tps:dot 1\n\t\teps:dot 1\n\t\tsvg:dot 1\n\t\tpng:xdot 1\n\t\tgif:xdot 1\n\t\tjpeg:xdot 1\n\t\tjpe:xdot 1\n\t\tjpg:xdot 1\n\t\tps:xdot 1\n\t\teps:xdot 1\n\t\tsvg:xdot 1\n\t\tsvg:svg 1\n\t\tgif:tk 1\n\t}\n}\ngvplugin_dot_layout.dll dot_layout {\n\tlayout {\n\t\tdot 0\n\t}\n}\n"
  },
  {
    "path": "src/external/build-capstone-arm64.cmd",
    "content": "cd capstone\nrmdir /s /q build_arm64\nmkdir build_arm64\ncd build_arm64\ncmake -G \"Visual Studio 17 2022\" -A ARM64 -DBUILD_SHARED_LIBS=1 -DCAPSTONE_BUILD_STATIC_RUNTIME=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/LTCG\" ../.\ncmake --build .  --config Release -j 16\ncd ..\n\nrmdir /s /q build_arm64_static\nmkdir build_arm64_static\ncd build_arm64_static\ncmake -G \"Visual Studio 17 2022\" -A ARM64 -DBUILD_SHARED_LIBS=0 -DCAPSTONE_BUILD_STATIC_RUNTIME=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/LTCG\" ../.\ncmake --build .  --config Release -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-capstone-debug.cmd",
    "content": "cd capstone\nrmdir /s /q build\nmkdir build\ncd build\ncmake -G \"Visual Studio 17 2022\" -A x64 -DBUILD_SHARED_LIBS=1 -DCAPSTONE_BUILD_STATIC_RUNTIME=1 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=\"/MP\" ../.\ncmake --build .  --config Debug -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-capstone.cmd",
    "content": "cd capstone\nrmdir /s /q build\nmkdir build\ncd build\ncmake -G \"Visual Studio 17 2022\" -A x64 -DBUILD_SHARED_LIBS=1 -DCAPSTONE_BUILD_STATIC_RUNTIME=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/LTCG\" ../.\ncmake --build .  --config Release -j 16\ncd ..\n\nrmdir /s /q build_static\nmkdir build_static\ncd build_static\ncmake -G \"Visual Studio 17 2022\" -A x64 -DBUILD_SHARED_LIBS=0 -DCAPSTONE_BUILD_STATIC_RUNTIME=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/LTCG\" ../.\ncmake --build .  --config Release -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-external-arm64.cmd",
    "content": "call build-capstone-arm64.cmd\ncall build-graphviz-arm64.cmd\ncall build-tree-sitter-arm64.cmd"
  },
  {
    "path": "src/external/build-external.cmd",
    "content": "call build-capstone.cmd\ncall build-graphviz.cmd\ncall build-tree-sitter.cmd"
  },
  {
    "path": "src/external/build-graphviz-arm64.cmd",
    "content": "cd graphviz\nset PATH=%PATH%;%cd%\\windows\\dependencies\\graphviz-build-utilities;%cd%\\windows\\dependencies\\graphviz-build-utilities\\winflexbison\nrmdir /s /q build_arm64\nmkdir build_arm64\n\ncd build_arm64\ncmake -G \"Visual Studio 17 2022\" -A ARM64 -DCMAKE_BUILD_TYPE=Release  -Denable_sharp=OFF -Dwith_zlib=OFF -Dwith_smyrna=OFF -Dwith_expat=OFF -Dwith_gvedit=OFF -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/LTCG\" ../.\ncmake --build .  --config Release -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-graphviz-pgo-instrument-arm64.cmd",
    "content": "cd graphviz\nset PATH=%PATH%;%cd%\\windows\\dependencies\\graphviz-build-utilities;%cd%\\windows\\dependencies\\graphviz-build-utilities\\winflexbison\nrmdir /s /q build_arm64\nmkdir build_arm64\n\ncd build_arm64\ncmake -G \"Visual Studio 17 2022\" -A ARM64 -DCMAKE_BUILD_TYPE=Release  -Denable_sharp=OFF -Dwith_zlib=OFF -Dwith_smyrna=OFF -Dwith_expat=OFF -Dwith_gvedit=OFF -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/INCREMENTAL:NO /LTCG /GENPROFILE\" ../.\ncmake --build .  --config Release -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-graphviz-pgo-instrument.cmd",
    "content": "cd graphviz\nset PATH=%PATH%;%cd%\\windows\\dependencies\\graphviz-build-utilities;%cd%\\windows\\dependencies\\graphviz-build-utilities\\winflexbison\nrmdir /s /q build\nmkdir build\n\ncd build\ncmake -G \"Visual Studio 17 2022\" -A x64 -DCMAKE_BUILD_TYPE=Release  -Denable_sharp=OFF -Dwith_zlib=OFF -Dwith_smyrna=OFF -Dwith_expat=OFF -Dwith_gvedit=OFF -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/INCREMENTAL:NO /LTCG /GENPROFILE\" ../.\ncmake --build .  --config Release -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-graphviz-pgo.cmd",
    "content": "set _PGO_WEIGHTS=%~dp0\\pgo\\weights\n\ncd graphviz\nset PATH=%PATH%;%cd%\\windows\\dependencies\\graphviz-build-utilities;%cd%\\windows\\dependencies\\graphviz-build-utilities\\winflexbison\nrmdir /s /q build\nmkdir build\n\ncd build\ncmake -G \"Visual Studio 17 2022\" -A x64 -DCMAKE_BUILD_TYPE=Release  -Denable_sharp=OFF -Dwith_zlib=OFF -Dwith_smyrna=OFF -Dwith_expat=OFF -Dwith_gvedit=OFF -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/INCREMENTAL:NO /LTCG /USEPROFILE\" ../.\n\nmkdir %~dp0\\graphviz\\build\\cmd\\dot\\Release\nmkdir %~dp0\\graphviz\\build\\lib\\cdt\\Release\nmkdir %~dp0\\graphviz\\build\\lib\\cgraph\\Release\nmkdir %~dp0\\graphviz\\build\\lib\\gvc\\Release\nmkdir %~dp0\\graphviz\\build\\lib\\pathplan\\Release\nmkdir %~dp0\\graphviz\\build\\lib\\xdot\\Release\nmkdir %~dp0\\graphviz\\build\\plugin\\core\\Release\nmkdir %~dp0\\graphviz\\build\\plugin\\dot_layout\\Release\n\nrem copy %_PGO_WEIGHTS%\\dot.pgd %~dp0\\graphviz\\build\\cmd\\dot\\Release\ncopy %_PGO_WEIGHTS%\\cdt.pgd %~dp0\\graphviz\\build\\lib\\cdt\\Release\ncopy %_PGO_WEIGHTS%\\cgraph.pgd %~dp0\\graphviz\\build\\lib\\cgraph\\Release\ncopy %_PGO_WEIGHTS%\\gvc.pgd %~dp0\\graphviz\\build\\lib\\gvc\\Release\ncopy %_PGO_WEIGHTS%\\pathplan.pgd %~dp0\\graphviz\\build\\lib\\pathplan\\Release\ncopy %_PGO_WEIGHTS%\\xdot.pgd %~dp0\\graphviz\\build\\lib\\xdot\\Release\ncopy %_PGO_WEIGHTS%\\gvplugin_core.pgd %~dp0\\graphviz\\build\\plugin\\core\\Release\ncopy %_PGO_WEIGHTS%\\gvplugin_dot_layout.pgd %~dp0\\graphviz\\build\\plugin\\dot_layout\\Release\n\ncmake --build .  --config Release -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-graphviz.cmd",
    "content": "cd graphviz\nset PATH=%PATH%;%cd%\\windows\\dependencies\\graphviz-build-utilities;%cd%\\windows\\dependencies\\graphviz-build-utilities\\winflexbison\nrmdir /s /q build\nmkdir build\n\ncd build\ncmake -G \"Visual Studio 17 2022\" -A x64 -DCMAKE_BUILD_TYPE=Release -Denable_sharp=OFF -Dwith_zlib=OFF -Dwith_smyrna=OFF -Dwith_expat=OFF -Dwith_gvedit=OFF -DCMAKE_CXX_FLAGS=\"/MP /GL\" -DCMAKE_SHARED_LINKER_FLAGS=\"/LTCG\" ../.\ncmake --build .  --config Release -j 16\ncd ..\ncd .."
  },
  {
    "path": "src/external/build-tree-sitter-arm64.cmd",
    "content": "cd tree-sitter\nrmdir /s /q build\nrmdir /s /q out\nmkdir build_arm64\nnmake\ncopy out\\*.dll build_arm64\\*\ncd ..\n"
  },
  {
    "path": "src/external/build-tree-sitter.cmd",
    "content": "cd tree-sitter\nrmdir /s /q build\nrmdir /s /q out\nmkdir build\nnmake\ncopy out\\*.dll build\\*\ncd ..\n"
  },
  {
    "path": "src/external/config6",
    "content": "# This file was generated by \"dot -c\" at time of install.\n\n# You may temporarily disable a plugin by removing or commenting out\n# a line in this file, or you can modify its \"quality\" value to affect\n# default plugin selection.\n\n# Manual edits to this file **will be lost** on upgrade.\n\ngvplugin_core.dll core {\n\tdevice {\n\t\tdot:dot 1\n\t\tgv:dot 1\n\t\tcanon:dot 1\n\t\tplain:dot 1\n\t\tplain-ext:dot 1\n\t\txdot:xdot 1\n\t\txdot1.2:xdot 1\n\t\txdot1.4:xdot 1\n\t}\n\tdevice {\n\t\tfig:fig 1\n\t}\n\tdevice {\n\t\tismap:map 1\n\t\tcmap:map 1\n\t\timap:map 1\n\t\tcmapx:map 1\n\t\timap_np:map 1\n\t\tcmapx_np:map 1\n\t}\n\tdevice {\n\t\tps:ps 1\n\t\tps2:ps 1\n\t\teps:ps 1\n\t}\n\tdevice {\n\t\tsvg:svg 1\n\t\tsvgz:svg 1\n\t\tsvg_inline:svg 1\n\t}\n\tdevice {\n\t\tjson:json 1\n\t\tjson0:json 1\n\t\tdot_json:json 1\n\t\txdot_json:json 1\n\t}\n\tdevice {\n\t\ttk:tk 1\n\t}\n\tdevice {\n\t\tpic:pic -1\n\t}\n\tdevice {\n\t\tpov:pov 1\n\t}\n\trender {\n\t\tdot 1\n\t\txdot 1\n\t}\n\trender {\n\t\tfig 1\n\t}\n\trender {\n\t\tmap 1\n\t}\n\trender {\n\t\tps 1\n\t}\n\trender {\n\t\tsvg 1\n\t\tsvg_inline 1\n\t}\n\trender {\n\t\tjson 1\n\t\tjson0 1\n\t\tdot_json 1\n\t\txdot_json 1\n\t}\n\trender {\n\t\ttk 1\n\t}\n\trender {\n\t\tpic -1\n\t}\n\trender {\n\t\tpov 1\n\t}\n\tloadimage {\n\t\tpng:svg 1\n\t\tgif:svg 1\n\t\tjpeg:svg 1\n\t\tjpe:svg 1\n\t\tjpg:svg 1\n\t\tpng:fig 1\n\t\tgif:fig 1\n\t\tjpeg:fig 1\n\t\tjpe:fig 1\n\t\tjpg:fig 1\n#FAILS\t\tpng:vrml 1\n#FAILS\t\tgif:vrml 1\n#FAILS\t\tjpeg:vrml 1\n#FAILS\t\tjpe:vrml 1\n#FAILS\t\tjpg:vrml 1\n\t\teps:ps 1\n\t\tps:ps 1\n\t\t(lib):ps 1\n\t\tpng:map 1\n\t\tgif:map 1\n\t\tjpeg:map 1\n\t\tjpe:map 1\n\t\tjpg:map 1\n\t\tps:map 1\n\t\teps:map 1\n\t\tsvg:map 1\n\t\tpng:dot 1\n\t\tgif:dot 1\n\t\tjpeg:dot 1\n\t\tjpe:dot 1\n\t\tjpg:dot 1\n\t\tps:dot 1\n\t\teps:dot 1\n\t\tsvg:dot 1\n\t\tpng:xdot 1\n\t\tgif:xdot 1\n\t\tjpeg:xdot 1\n\t\tjpe:xdot 1\n\t\tjpg:xdot 1\n\t\tps:xdot 1\n\t\teps:xdot 1\n\t\tsvg:xdot 1\n\t\tsvg:svg 1\n\t\tgif:tk 1\n\t}\n}\ngvplugin_dot_layout.dll dot_layout {\n\tlayout {\n\t\tdot 0\n\t}\n}\n"
  },
  {
    "path": "src/external/pgo/copy-graphviz-arm64.cmd",
    "content": "set _EXTERNALS_PATH=\"%~dp0\\..\"\nset _OUT_PATH=\"%~dp0\\out_arm64\"\n\nrd %_OUT_PATH% /s /q\nmkdir %_OUT_PATH%\n\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\cmd\\dot\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\cdt\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\cgraph\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\gvc\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\pathplan\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\lib\\xdot\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\plugin\\core\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build_arm64\\plugin\\dot_layout\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\zlib1.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\libexpat.dll %_OUT_PATH%\n\ncd %_OUT_PATH%\ndot.exe -c\ncd .."
  },
  {
    "path": "src/external/pgo/copy-graphviz.cmd",
    "content": "set _EXTERNALS_PATH=\"%~dp0\\..\"\nset _OUT_PATH=\"%~dp0\\out\"\n\nrd %_OUT_PATH% /s /q\nmkdir %_OUT_PATH%\n\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\cmd\\dot\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\cdt\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\cgraph\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\gvc\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\pathplan\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\lib\\xdot\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\plugin\\core\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\build\\plugin\\dot_layout\\Release\\* %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\zlib1.dll %_OUT_PATH%\ncopy %_EXTERNALS_PATH%\\graphviz\\windows\\dependencies\\libraries\\vcpkg\\installed\\x64-windows\\bin\\libexpat.dll %_OUT_PATH%\n\ncd %_OUT_PATH%\ndot.exe -c\ncd .."
  },
  {
    "path": "src/external/pgo/train-graphviz-arm64.cmd",
    "content": "set _EXTERNALS_PATH=\"%~dp0\\..\"\nset _OUT_PATH=\"%~dp0\\out_arm64\"\nset _RESULT_PATH=\"%~dp0\\weights_arm64\"\n\nrd %_RESULT_PATH% /s /q\nmkdir %_RESULT_PATH%\n\ncall copy-graphviz-arm64.cmd\ncd %_OUT_PATH%\n\nfor /r %%f in (..\\training\\*) do (\n\tdot.exe -Tplain %%f > null\n)\n\nfor /r %%f in (*.pgd) do (\n\tpgomgr /merge %%f\n\tcopy %%f %_RESULT_PATH%\n)\n\ncd .."
  },
  {
    "path": "src/external/pgo/train-graphviz.cmd",
    "content": "set _EXTERNALS_PATH=\"%~dp0\\..\"\nset _OUT_PATH=\"%~dp0\\out\"\nset _RESULT_PATH=\"%~dp0\\weights\"\n\nrd %_RESULT_PATH% /s /q\nmkdir %_RESULT_PATH%\n\ncall copy-graphviz.cmd\ncd %_OUT_PATH%\n\nfor /r %%f in (..\\training\\*) do (\n\tdot.exe -Tplain %%f > null\n)\n\nfor /r %%f in (*.pgd) do (\n\tpgomgr /merge %%f\n\tcopy %%f %_RESULT_PATH%\n)\n\ncd .."
  },
  {
    "path": "src/external/pgo/training/input-1032.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B2\"];\nn1407374883553280[shape=rectangle, label=\"B3\"];\nn1125899906842624[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn2814749767106560[shape=rectangle, label=\"B7\"];\nn27584547717644288[shape=rectangle, label=\"B8\"];\nn3377699720527872[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn3659174697238528[shape=rectangle, label=\"B11\"];\nn4222124650659840[shape=rectangle, label=\"B12\"];\nn4503599627370496[shape=rectangle, label=\"B13\"];\nn5066549580791808[shape=rectangle, label=\"B14\"];\nn4785074604081152[shape=rectangle, label=\"B15\"];\nn5348024557502464[shape=rectangle, label=\"B16\"];\nn5910974510923776[shape=rectangle, label=\"B17\"];\nn6473924464345088[shape=rectangle, label=\"B18\"];\nn6192449487634432[shape=rectangle, label=\"B19\"];\nn5629499534213120[shape=rectangle, label=\"B20\"];\nn7318349394477056[shape=rectangle, label=\"B21\"];\nn7036874417766400[shape=rectangle, label=\"B22\"];\nn7881299347898368[shape=rectangle, label=\"B23\"];\nn8162774324609024[shape=rectangle, label=\"B24\"];\nn8444249301319680[shape=rectangle, label=\"B25\"];\nn7599824371187712[shape=rectangle, label=\"B26\"];\nn8725724278030336[shape=rectangle, label=\"B27\"];\nn6755399441055744[shape=rectangle, label=\"B28\"];\nn9288674231451648[shape=rectangle, label=\"B29\"];\nn9007199254740992[shape=rectangle, label=\"B30\"];\nn9570149208162304[shape=rectangle, label=\"B31\"];\nn3940649673949184[shape=rectangle, label=\"B32\"];\nn10133099161583616[shape=rectangle, label=\"B33\"];\nn9851624184872960[shape=rectangle, label=\"B34\"];\nn10414574138294272[shape=rectangle, label=\"B35\"];\nn10977524091715584[shape=rectangle, label=\"B36\"];\nn11540474045136896[shape=rectangle, label=\"B37\"];\nn18295873486192640[shape=rectangle, label=\"B38\"];\nn12103423998558208[shape=rectangle, label=\"B39\"];\nn11821949021847552[shape=rectangle, label=\"B40\"];\nn12384898975268864[shape=rectangle, label=\"B41\"];\nn12947848928690176[shape=rectangle, label=\"B42\"];\nn13510798882111488[shape=rectangle, label=\"B43\"];\nn13229323905400832[shape=rectangle, label=\"B44\"];\nn12666373951979520[shape=rectangle, label=\"B45\"];\nn14355223812243456[shape=rectangle, label=\"B46\"];\nn14073748835532800[shape=rectangle, label=\"B47\"];\nn14918173765664768[shape=rectangle, label=\"B48\"];\nn15199648742375424[shape=rectangle, label=\"B49\"];\nn15481123719086080[shape=rectangle, label=\"B50\"];\nn13792273858822144[shape=rectangle, label=\"B51\"];\nn16044073672507392[shape=rectangle, label=\"B52\"];\nn15762598695796736[shape=rectangle, label=\"B53\"];\nn16325548649218048[shape=rectangle, label=\"B54\"];\nn14636698788954112[shape=rectangle, label=\"B55\"];\nn16888498602639360[shape=rectangle, label=\"B56\"];\nn17169973579350016[shape=rectangle, label=\"B57\"];\nn16607023625928704[shape=rectangle, label=\"B58\"];\nn17732923532771328[shape=rectangle, label=\"B59\"];\nn17451448556060672[shape=rectangle, label=\"B60\"];\nn18014398509481984[shape=rectangle, label=\"B61\"];\nn11258999068426240[shape=rectangle, label=\"B62\"];\nn18858823439613952[shape=rectangle, label=\"B63\"];\nn18577348462903296[shape=rectangle, label=\"B64\"];\nn19421773393035264[shape=rectangle, label=\"B65\"];\nn25051272927248384[shape=rectangle, label=\"B66\"];\nn19984723346456576[shape=rectangle, label=\"B67\"];\nn19703248369745920[shape=rectangle, label=\"B68\"];\nn20266198323167232[shape=rectangle, label=\"B69\"];\nn20829148276588544[shape=rectangle, label=\"B70\"];\nn21392098230009856[shape=rectangle, label=\"B71\"];\nn21110623253299200[shape=rectangle, label=\"B72\"];\nn20547673299877888[shape=rectangle, label=\"B73\"];\nn22236523160141824[shape=rectangle, label=\"B74\"];\nn21955048183431168[shape=rectangle, label=\"B75\"];\nn22799473113563136[shape=rectangle, label=\"B76\"];\nn23080948090273792[shape=rectangle, label=\"B77\"];\nn23362423066984448[shape=rectangle, label=\"B78\"];\nn22517998136852480[shape=rectangle, label=\"B79\"];\nn23643898043695104[shape=rectangle, label=\"B80\"];\nn23925373020405760[shape=rectangle, label=\"B81\"];\nn21673573206720512[shape=rectangle, label=\"B82\"];\nn24488322973827072[shape=rectangle, label=\"B83\"];\nn24206847997116416[shape=rectangle, label=\"B84\"];\nn24769797950537728[shape=rectangle, label=\"B85\"];\nn19140298416324608[shape=rectangle, label=\"B86\"];\nn25614222880669696[shape=rectangle, label=\"B87\"];\nn25332747903959040[shape=rectangle, label=\"B88\"];\nn25895697857380352[shape=rectangle, label=\"B89\"];\nn26177172834091008[shape=rectangle, label=\"B90\"];\nn26458647810801664[shape=rectangle, label=\"B91\"];\nn10696049115004928[shape=rectangle, label=\"B92\"];\nn27021597764222976[shape=rectangle, label=\"B93\"];\nn26740122787512320[shape=rectangle, label=\"B94\"];\nn27303072740933632[shape=rectangle, label=\"B95\"];\nn2533274790395904[shape=rectangle, label=\"B96\"];\nn27866022694354944[shape=rectangle, label=\"B97\"];\nn1970324836974592[shape=rectangle, label=\"B98\"];\nn28147497671065600[shape=rectangle, label=\"B99\"];\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn65583669573582848[shape=rectangle, label=\"B101\"];\nn29273397577908224[shape=rectangle, label=\"B102\"];\nn29836347531329536[shape=rectangle, label=\"B103\"];\nn29554872554618880[shape=rectangle, label=\"B104\"];\nn30117822508040192[shape=rectangle, label=\"B105\"];\nn30680772461461504[shape=rectangle, label=\"B106\"];\nn56857945295552512[shape=rectangle, label=\"B107\"];\nn31243722414882816[shape=rectangle, label=\"B108\"];\nn30962247438172160[shape=rectangle, label=\"B109\"];\nn31525197391593472[shape=rectangle, label=\"B110\"];\nn32088147345014784[shape=rectangle, label=\"B111\"];\nn31806672368304128[shape=rectangle, label=\"B112\"];\nn32651097298436096[shape=rectangle, label=\"B113\"];\nn32369622321725440[shape=rectangle, label=\"B114\"];\nn33214047251857408[shape=rectangle, label=\"B115\"];\nn33776997205278720[shape=rectangle, label=\"B116\"];\nn34058472181989376[shape=rectangle, label=\"B117\"];\nn34621422135410688[shape=rectangle, label=\"B118\"];\nn34339947158700032[shape=rectangle, label=\"B119\"];\nn33495522228568064[shape=rectangle, label=\"B120\"];\nn32932572275146752[shape=rectangle, label=\"B121\"];\nn35184372088832000[shape=rectangle, label=\"B122\"];\nn34902897112121344[shape=rectangle, label=\"B123\"];\nn35465847065542656[shape=rectangle, label=\"B124\"];\nn36028797018963968[shape=rectangle, label=\"B125\"];\nn36591746972385280[shape=rectangle, label=\"B126\"];\nn36310271995674624[shape=rectangle, label=\"B127\"];\nn36873221949095936[shape=rectangle, label=\"B128\"];\nn37436171902517248[shape=rectangle, label=\"B129\"];\nn37717646879227904[shape=rectangle, label=\"B130\"];\nn37154696925806592[shape=rectangle, label=\"B131\"];\nn37999121855938560[shape=rectangle, label=\"B132\"];\nn38280596832649216[shape=rectangle, label=\"B133\"];\nn38562071809359872[shape=rectangle, label=\"B134\"];\nn38843546786070528[shape=rectangle, label=\"B135\"];\nn39406496739491840[shape=rectangle, label=\"B136\"];\nn39125021762781184[shape=rectangle, label=\"B137\"];\nn39687971716202496[shape=rectangle, label=\"B138\"];\nn39969446692913152[shape=rectangle, label=\"B139\"];\nn40250921669623808[shape=rectangle, label=\"B140\"];\nn40532396646334464[shape=rectangle, label=\"B141\"];\nn41095346599755776[shape=rectangle, label=\"B142\"];\nn41376821576466432[shape=rectangle, label=\"B143\"];\nn41658296553177088[shape=rectangle, label=\"B144\"];\nn41939771529887744[shape=rectangle, label=\"B145\"];\nn42221246506598400[shape=rectangle, label=\"B146\"];\nn42502721483309056[shape=rectangle, label=\"B147\"];\nn42784196460019712[shape=rectangle, label=\"B148\"];\nn43065671436730368[shape=rectangle, label=\"B149\"];\nn40813871623045120[shape=rectangle, label=\"B150\"];\nn43628621390151680[shape=rectangle, label=\"B151\"];\nn43347146413441024[shape=rectangle, label=\"B152\"];\nn44191571343572992[shape=rectangle, label=\"B153\"];\nn44473046320283648[shape=rectangle, label=\"B154\"];\nn45035996273704960[shape=rectangle, label=\"B155\"];\nn44754521296994304[shape=rectangle, label=\"B156\"];\nn45598946227126272[shape=rectangle, label=\"B157\"];\nn45317471250415616[shape=rectangle, label=\"B158\"];\nn45880421203836928[shape=rectangle, label=\"B159\"];\nn43910096366862336[shape=rectangle, label=\"B160\"];\nn46161896180547584[shape=rectangle, label=\"B161\"];\nn46724846133968896[shape=rectangle, label=\"B162\"];\nn47287796087390208[shape=rectangle, label=\"B163\"];\nn47850746040811520[shape=rectangle, label=\"B164\"];\nn47569271064100864[shape=rectangle, label=\"B165\"];\nn47006321110679552[shape=rectangle, label=\"B166\"];\nn48132221017522176[shape=rectangle, label=\"B167\"];\nn46443371157258240[shape=rectangle, label=\"B168\"];\nn48695170970943488[shape=rectangle, label=\"B169\"];\nn50946970784628736[shape=rectangle, label=\"B170\"];\nn49258120924364800[shape=rectangle, label=\"B171\"];\nn48976645947654144[shape=rectangle, label=\"B172\"];\nn50102545854496768[shape=rectangle, label=\"B173\"];\nn50384020831207424[shape=rectangle, label=\"B174\"];\nn50665495807918080[shape=rectangle, label=\"B175\"];\nn49821070877786112[shape=rectangle, label=\"B176\"];\nn49539595901075456[shape=rectangle, label=\"B177\"];\nn51228445761339392[shape=rectangle, label=\"B178\"];\nn48413695994232832[shape=rectangle, label=\"B179\"];\nn51791395714760704[shape=rectangle, label=\"B180\"];\nn54324670505156608[shape=rectangle, label=\"B181\"];\nn52354345668182016[shape=rectangle, label=\"B182\"];\nn52072870691471360[shape=rectangle, label=\"B183\"];\nn53198770598313984[shape=rectangle, label=\"B184\"];\nn53480245575024640[shape=rectangle, label=\"B185\"];\nn53761720551735296[shape=rectangle, label=\"B186\"];\nn52917295621603328[shape=rectangle, label=\"B187\"];\nn54043195528445952[shape=rectangle, label=\"B188\"];\nn52635820644892672[shape=rectangle, label=\"B189\"];\nn54606145481867264[shape=rectangle, label=\"B190\"];\nn51509920738050048[shape=rectangle, label=\"B191\"];\nn55169095435288576[shape=rectangle, label=\"B192\"];\nn54887620458577920[shape=rectangle, label=\"B193\"];\nn55450570411999232[shape=rectangle, label=\"B194\"];\nn55732045388709888[shape=rectangle, label=\"B195\"];\nn35747322042253312[shape=rectangle, label=\"B196\"];\nn56294995342131200[shape=rectangle, label=\"B197\"];\nn56013520365420544[shape=rectangle, label=\"B198\"];\nn56576470318841856[shape=rectangle, label=\"B199\"];\nn30399297484750848[shape=rectangle, label=\"B200\"];\nn57420895248973824[shape=rectangle, label=\"B201\"];\nn57139420272263168[shape=rectangle, label=\"B202\"];\nn57702370225684480[shape=rectangle, label=\"B203\"];\nn58265320179105792[shape=rectangle, label=\"B204\"];\nn59954170039369728[shape=rectangle, label=\"B205\"];\nn58828270132527104[shape=rectangle, label=\"B206\"];\nn58546795155816448[shape=rectangle, label=\"B207\"];\nn59109745109237760[shape=rectangle, label=\"B208\"];\nn59672695062659072[shape=rectangle, label=\"B209\"];\nn59391220085948416[shape=rectangle, label=\"B210\"];\nn60235645016080384[shape=rectangle, label=\"B211\"];\nn60798594969501696[shape=rectangle, label=\"B212\"];\nn60517119992791040[shape=rectangle, label=\"B213\"];\nn61080069946212352[shape=rectangle, label=\"B214\"];\nn61643019899633664[shape=rectangle, label=\"B215\"];\nn62205969853054976[shape=rectangle, label=\"B216\"];\nn61924494876344320[shape=rectangle, label=\"B217\"];\nn62487444829765632[shape=rectangle, label=\"B218\"];\nn61361544922923008[shape=rectangle, label=\"B219\"];\nn62768919806476288[shape=rectangle, label=\"B220\"];\nn65302194596872192[shape=rectangle, label=\"B221\"];\nn63331869759897600[shape=rectangle, label=\"B222\"];\nn63050394783186944[shape=rectangle, label=\"B223\"];\nn63613344736608256[shape=rectangle, label=\"B224\"];\nn64176294690029568[shape=rectangle, label=\"B225\"];\nn63894819713318912[shape=rectangle, label=\"B226\"];\nn64739244643450880[shape=rectangle, label=\"B227\"];\nn64457769666740224[shape=rectangle, label=\"B228\"];\nn65020719620161536[shape=rectangle, label=\"B229\"];\nn57983845202395136[shape=rectangle, label=\"B230\"];\nn28991922601197568[shape=rectangle, label=\"B231\"];\nn65865144550293504[shape=rectangle, label=\"B232\"];\nn28428972647776256[shape=rectangle, label=\"B233\"];\nn66428094503714816[shape=rectangle, label=\"B234\"];\nn66709569480425472[shape=rectangle, label=\"B235\"];\nn92042317384384512[shape=rectangle, label=\"B236\"];\nn67272519433846784[shape=rectangle, label=\"B237\"];\nn91479367430963200[shape=rectangle, label=\"B238\"];\nn67835469387268096[shape=rectangle, label=\"B239\"];\nn68398419340689408[shape=rectangle, label=\"B240\"];\nn68116944363978752[shape=rectangle, label=\"B241\"];\nn68679894317400064[shape=rectangle, label=\"B242\"];\nn68961369294110720[shape=rectangle, label=\"B243\"];\nn69242844270821376[shape=rectangle, label=\"B244\"];\nn67553994410557440[shape=rectangle, label=\"B245\"];\nn69524319247532032[shape=rectangle, label=\"B246\"];\nn70087269200953344[shape=rectangle, label=\"B247\"];\nn69805794224242688[shape=rectangle, label=\"B248\"];\nn70368744177664000[shape=rectangle, label=\"B249\"];\nn70931694131085312[shape=rectangle, label=\"B250\"];\nn71494644084506624[shape=rectangle, label=\"B251\"];\nn71213169107795968[shape=rectangle, label=\"B252\"];\nn71776119061217280[shape=rectangle, label=\"B253\"];\nn72339069014638592[shape=rectangle, label=\"B254\"];\nn72620543991349248[shape=rectangle, label=\"B255\"];\nn72057594037927936[shape=rectangle, label=\"B256\"];\nn72902018968059904[shape=rectangle, label=\"B257\"];\nn73183493944770560[shape=rectangle, label=\"B258\"];\nn73464968921481216[shape=rectangle, label=\"B259\"];\nn73746443898191872[shape=rectangle, label=\"B260\"];\nn74309393851613184[shape=rectangle, label=\"B261\"];\nn74027918874902528[shape=rectangle, label=\"B262\"];\nn74590868828323840[shape=rectangle, label=\"B263\"];\nn74872343805034496[shape=rectangle, label=\"B264\"];\nn75435293758455808[shape=rectangle, label=\"B265\"];\nn75153818781745152[shape=rectangle, label=\"B266\"];\nn75716768735166464[shape=rectangle, label=\"B267\"];\nn75998243711877120[shape=rectangle, label=\"B268\"];\nn76561193665298432[shape=rectangle, label=\"B269\"];\nn76279718688587776[shape=rectangle, label=\"B270\"];\nn76842668642009088[shape=rectangle, label=\"B271\"];\nn77124143618719744[shape=rectangle, label=\"B272\"];\nn77687093572141056[shape=rectangle, label=\"B273\"];\nn77968568548851712[shape=rectangle, label=\"B274\"];\nn78250043525562368[shape=rectangle, label=\"B275\"];\nn78531518502273024[shape=rectangle, label=\"B276\"];\nn78812993478983680[shape=rectangle, label=\"B277\"];\nn79094468455694336[shape=rectangle, label=\"B278\"];\nn79375943432404992[shape=rectangle, label=\"B279\"];\nn79657418409115648[shape=rectangle, label=\"B280\"];\nn77405618595430400[shape=rectangle, label=\"B281\"];\nn80220368362536960[shape=rectangle, label=\"B282\"];\nn70650219154374656[shape=rectangle, label=\"B283\"];\nn79938893385826304[shape=rectangle, label=\"B284\"];\nn80783318315958272[shape=rectangle, label=\"B285\"];\nn81346268269379584[shape=rectangle, label=\"B286\"];\nn81064793292668928[shape=rectangle, label=\"B287\"];\nn81627743246090240[shape=rectangle, label=\"B288\"];\nn81909218222800896[shape=rectangle, label=\"B289\"];\nn80501843339247616[shape=rectangle, label=\"B290\"];\nn82190693199511552[shape=rectangle, label=\"B291\"];\nn82753643152932864[shape=rectangle, label=\"B292\"];\nn82472168176222208[shape=rectangle, label=\"B293\"];\nn83035118129643520[shape=rectangle, label=\"B294\"];\nn83598068083064832[shape=rectangle, label=\"B295\"];\nn84161018036486144[shape=rectangle, label=\"B296\"];\nn83879543059775488[shape=rectangle, label=\"B297\"];\nn83316593106354176[shape=rectangle, label=\"B298\"];\nn85005442966618112[shape=rectangle, label=\"B299\"];\nn84723967989907456[shape=rectangle, label=\"B300\"];\nn85568392920039424[shape=rectangle, label=\"B301\"];\nn85849867896750080[shape=rectangle, label=\"B302\"];\nn86131342873460736[shape=rectangle, label=\"B303\"];\nn84442493013196800[shape=rectangle, label=\"B304\"];\nn86694292826882048[shape=rectangle, label=\"B305\"];\nn86412817850171392[shape=rectangle, label=\"B306\"];\nn86975767803592704[shape=rectangle, label=\"B307\"];\nn87538717757014016[shape=rectangle, label=\"B308\"];\nn88101667710435328[shape=rectangle, label=\"B309\"];\nn87820192733724672[shape=rectangle, label=\"B310\"];\nn88383142687145984[shape=rectangle, label=\"B311\"];\nn87257242780303360[shape=rectangle, label=\"B312\"];\nn85286917943328768[shape=rectangle, label=\"B313\"];\nn88946092640567296[shape=rectangle, label=\"B314\"];\nn88664617663856640[shape=rectangle, label=\"B315\"];\nn89509042593988608[shape=rectangle, label=\"B316\"];\nn89227567617277952[shape=rectangle, label=\"B317\"];\nn90071992547409920[shape=rectangle, label=\"B318\"];\nn89790517570699264[shape=rectangle, label=\"B319\"];\nn90353467524120576[shape=rectangle, label=\"B320\"];\nn90916417477541888[shape=rectangle, label=\"B321\"];\nn91197892454252544[shape=rectangle, label=\"B322\"];\nn90634942500831232[shape=rectangle, label=\"B323\"];\nn91760842407673856[shape=rectangle, label=\"B324\"];\nn66991044457136128[shape=rectangle, label=\"B325\"];\nn92323792361095168[shape=rectangle, label=\"B326\"];\nn66146619527004160[shape=rectangle, label=\"B327\"];\nn92886742314516480[shape=rectangle, label=\"B328\"];\nn93168217291227136[shape=rectangle, label=\"B329\"];\nn92605267337805824[shape=rectangle, label=\"B330\"];\nn94012642221359104[shape=rectangle, label=\"B331\"];\nn94294117198069760[shape=rectangle, label=\"B332\"];\nn94857067151491072[shape=rectangle, label=\"B333\"];\nn93731167244648448[shape=rectangle, label=\"B334\"];\nn95138542128201728[shape=rectangle, label=\"B335\"];\nn95420017104912384[shape=rectangle, label=\"B336\"];\nn93449692267937792[shape=rectangle, label=\"B337\"];\nn95701492081623040[shape=rectangle, label=\"B338\"];\nn94575592174780416[shape=rectangle, label=\"B339\"];\nn96264442035044352[shape=rectangle, label=\"B340\"];\nn95982967058333696[shape=rectangle, label=\"B341\"];\nn96827391988465664[shape=rectangle, label=\"B342\"];\nn96545917011755008[shape=rectangle, label=\"B343\"];\nn97108866965176320[shape=rectangle, label=\"B344\"];\nn97671816918597632[shape=rectangle, label=\"B345\"];\nn97390341941886976[shape=rectangle, label=\"B346\"];\nn97953291895308288[shape=rectangle, label=\"B347\"];\nn98516241848729600[shape=rectangle, label=\"B348\"];\nn98234766872018944[shape=rectangle, label=\"B349\"];\nn98797716825440256[shape=rectangle, label=\"B350\"];\nn99360666778861568[shape=rectangle, label=\"B351\"];\nn99079191802150912[shape=rectangle, label=\"B352\"];\nn281474976710656[shape=rectangle, label=\"B353\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn562949953421312 -> n844424930131968;\nn844424930131968 -> n1125899906842624;\nn844424930131968 -> n1407374883553280;\nn1407374883553280 -> n1688849860263936;\nn1125899906842624 -> n1688849860263936;\nn1688849860263936 -> n1970324836974592;\nn1688849860263936 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n2814749767106560;\nn2814749767106560 -> n27584547717644288;\nn27584547717644288 -> n3096224743817216;\nn27584547717644288 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn3377699720527872 -> n3096224743817216;\nn3096224743817216 -> n3659174697238528;\nn3659174697238528 -> n3940649673949184;\nn3659174697238528 -> n4222124650659840;\nn4222124650659840 -> n3940649673949184;\nn4222124650659840 -> n4503599627370496;\nn4503599627370496 -> n4785074604081152;\nn4503599627370496 -> n5066549580791808;\nn5066549580791808 -> n5348024557502464;\nn5066549580791808 -> n4785074604081152;\nn4785074604081152 -> n5348024557502464;\nn5348024557502464 -> n5629499534213120;\nn5348024557502464 -> n5910974510923776;\nn5910974510923776 -> n6192449487634432;\nn5910974510923776 -> n6473924464345088;\nn6473924464345088 -> n6192449487634432;\nn6192449487634432 -> n6755399441055744;\nn6192449487634432 -> n5629499534213120;\nn5629499534213120 -> n7036874417766400;\nn5629499534213120 -> n7318349394477056;\nn7318349394477056 -> n7036874417766400;\nn7036874417766400 -> n7599824371187712;\nn7036874417766400 -> n7881299347898368;\nn7881299347898368 -> n7599824371187712;\nn7881299347898368 -> n8162774324609024;\nn8162774324609024 -> n7599824371187712;\nn8162774324609024 -> n8444249301319680;\nn8444249301319680 -> n6755399441055744;\nn8444249301319680 -> n7599824371187712;\nn7599824371187712 -> n6755399441055744;\nn7599824371187712 -> n8725724278030336;\nn8725724278030336 -> n6755399441055744;\nn6755399441055744 -> n9007199254740992;\nn6755399441055744 -> n9288674231451648;\nn9288674231451648 -> n9570149208162304;\nn9288674231451648 -> n9007199254740992;\nn9007199254740992 -> n9570149208162304;\nn9570149208162304 -> n4503599627370496;\nn9570149208162304 -> n3940649673949184;\nn3940649673949184 -> n9851624184872960;\nn3940649673949184 -> n10133099161583616;\nn10133099161583616 -> n10414574138294272;\nn10133099161583616 -> n9851624184872960;\nn9851624184872960 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10977524091715584;\nn10977524091715584 -> n11258999068426240;\nn10977524091715584 -> n11540474045136896;\nn11540474045136896 -> n18295873486192640;\nn18295873486192640 -> n11821949021847552;\nn18295873486192640 -> n12103423998558208;\nn12103423998558208 -> n12384898975268864;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn12384898975268864 -> n12666373951979520;\nn12384898975268864 -> n12947848928690176;\nn12947848928690176 -> n13229323905400832;\nn12947848928690176 -> n13510798882111488;\nn13510798882111488 -> n13229323905400832;\nn13229323905400832 -> n13792273858822144;\nn13229323905400832 -> n12666373951979520;\nn12666373951979520 -> n14073748835532800;\nn12666373951979520 -> n14355223812243456;\nn14355223812243456 -> n14073748835532800;\nn14073748835532800 -> n14636698788954112;\nn14073748835532800 -> n14918173765664768;\nn14918173765664768 -> n14636698788954112;\nn14918173765664768 -> n15199648742375424;\nn15199648742375424 -> n14636698788954112;\nn15199648742375424 -> n15481123719086080;\nn15481123719086080 -> n14636698788954112;\nn15481123719086080 -> n13792273858822144;\nn13792273858822144 -> n15762598695796736;\nn13792273858822144 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn16044073672507392 -> n15762598695796736;\nn15762598695796736 -> n16325548649218048;\nn16325548649218048 -> n16607023625928704;\nn16325548649218048 -> n14636698788954112;\nn14636698788954112 -> n16607023625928704;\nn14636698788954112 -> n16888498602639360;\nn16888498602639360 -> n16607023625928704;\nn16888498602639360 -> n17169973579350016;\nn17169973579350016 -> n16607023625928704;\nn16607023625928704 -> n17451448556060672;\nn16607023625928704 -> n17732923532771328;\nn17732923532771328 -> n18014398509481984;\nn17732923532771328 -> n17451448556060672;\nn17451448556060672 -> n18014398509481984;\nn18014398509481984 -> n18295873486192640;\nn18014398509481984 -> n11258999068426240;\nn11258999068426240 -> n18577348462903296;\nn11258999068426240 -> n18858823439613952;\nn18858823439613952 -> n18577348462903296;\nn18577348462903296 -> n19140298416324608;\nn18577348462903296 -> n19421773393035264;\nn19421773393035264 -> n25051272927248384;\nn25051272927248384 -> n19703248369745920;\nn25051272927248384 -> n19984723346456576;\nn19984723346456576 -> n20266198323167232;\nn19984723346456576 -> n19703248369745920;\nn19703248369745920 -> n20266198323167232;\nn20266198323167232 -> n20547673299877888;\nn20266198323167232 -> n20829148276588544;\nn20829148276588544 -> n21110623253299200;\nn20829148276588544 -> n21392098230009856;\nn21392098230009856 -> n21110623253299200;\nn21110623253299200 -> n21673573206720512;\nn21110623253299200 -> n20547673299877888;\nn20547673299877888 -> n21955048183431168;\nn20547673299877888 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn21955048183431168 -> n22517998136852480;\nn21955048183431168 -> n22799473113563136;\nn22799473113563136 -> n22517998136852480;\nn22799473113563136 -> n23080948090273792;\nn23080948090273792 -> n22517998136852480;\nn23080948090273792 -> n23362423066984448;\nn23362423066984448 -> n21673573206720512;\nn23362423066984448 -> n22517998136852480;\nn22517998136852480 -> n21673573206720512;\nn22517998136852480 -> n23643898043695104;\nn23643898043695104 -> n21673573206720512;\nn23643898043695104 -> n23925373020405760;\nn23925373020405760 -> n21673573206720512;\nn21673573206720512 -> n24206847997116416;\nn21673573206720512 -> n24488322973827072;\nn24488322973827072 -> n24769797950537728;\nn24488322973827072 -> n24206847997116416;\nn24206847997116416 -> n24769797950537728;\nn24769797950537728 -> n25051272927248384;\nn24769797950537728 -> n19140298416324608;\nn19140298416324608 -> n25332747903959040;\nn19140298416324608 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n25332747903959040;\nn25332747903959040 -> n25895697857380352;\nn25895697857380352 -> n10696049115004928;\nn25895697857380352 -> n26177172834091008;\nn26177172834091008 -> n10696049115004928;\nn26177172834091008 -> n26458647810801664;\nn26458647810801664 -> n10696049115004928;\nn10696049115004928 -> n26740122787512320;\nn10696049115004928 -> n27021597764222976;\nn27021597764222976 -> n27303072740933632;\nn27021597764222976 -> n26740122787512320;\nn26740122787512320 -> n27303072740933632;\nn27303072740933632 -> n27584547717644288;\nn27303072740933632 -> n2533274790395904;\nn2533274790395904 -> n2251799813685248;\nn2533274790395904 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn1970324836974592 -> n28147497671065600;\nn28147497671065600 -> n28428972647776256;\nn28147497671065600 -> n28710447624486912;\nn28710447624486912 -> n65583669573582848;\nn65583669573582848 -> n28991922601197568;\nn65583669573582848 -> n29273397577908224;\nn29273397577908224 -> n29554872554618880;\nn29273397577908224 -> n29836347531329536;\nn29836347531329536 -> n30117822508040192;\nn29836347531329536 -> n29554872554618880;\nn29554872554618880 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n56857945295552512;\nn56857945295552512 -> n30962247438172160;\nn56857945295552512 -> n31243722414882816;\nn31243722414882816 -> n31525197391593472;\nn30962247438172160 -> n31525197391593472;\nn31525197391593472 -> n31806672368304128;\nn31525197391593472 -> n32088147345014784;\nn32088147345014784 -> n31806672368304128;\nn31806672368304128 -> n32369622321725440;\nn31806672368304128 -> n32651097298436096;\nn32651097298436096 -> n32369622321725440;\nn32369622321725440 -> n32932572275146752;\nn32369622321725440 -> n33214047251857408;\nn33214047251857408 -> n33495522228568064;\nn33214047251857408 -> n33776997205278720;\nn33776997205278720 -> n33495522228568064;\nn33776997205278720 -> n34058472181989376;\nn34058472181989376 -> n34339947158700032;\nn34058472181989376 -> n34621422135410688;\nn34621422135410688 -> n32932572275146752;\nn34339947158700032 -> n32932572275146752;\nn33495522228568064 -> n32932572275146752;\nn32932572275146752 -> n34902897112121344;\nn32932572275146752 -> n35184372088832000;\nn35184372088832000 -> n35465847065542656;\nn35184372088832000 -> n34902897112121344;\nn34902897112121344 -> n35465847065542656;\nn35465847065542656 -> n35747322042253312;\nn35465847065542656 -> n36028797018963968;\nn36028797018963968 -> n36310271995674624;\nn36028797018963968 -> n36591746972385280;\nn36591746972385280 -> n36873221949095936;\nn36591746972385280 -> n36310271995674624;\nn36310271995674624 -> n36873221949095936;\nn36873221949095936 -> n37154696925806592;\nn36873221949095936 -> n37436171902517248;\nn37436171902517248 -> n35747322042253312;\nn37436171902517248 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37154696925806592 -> n38280596832649216;\nn37154696925806592 -> n37999121855938560;\nn37999121855938560 -> n38562071809359872;\nn37999121855938560 -> n38280596832649216;\nn38280596832649216 -> n38562071809359872;\nn38562071809359872 -> n35747322042253312;\nn38562071809359872 -> n38843546786070528;\nn38843546786070528 -> n39125021762781184;\nn38843546786070528 -> n39406496739491840;\nn39406496739491840 -> n39687971716202496;\nn39406496739491840 -> n39125021762781184;\nn39125021762781184 -> n39687971716202496;\nn39687971716202496 -> n35747322042253312;\nn39687971716202496 -> n39969446692913152;\nn39969446692913152 -> n35747322042253312;\nn39969446692913152 -> n40250921669623808;\nn40250921669623808 -> n35747322042253312;\nn40250921669623808 -> n40532396646334464;\nn40532396646334464 -> n40813871623045120;\nn40532396646334464 -> n41095346599755776;\nn41095346599755776 -> n40813871623045120;\nn41095346599755776 -> n41376821576466432;\nn41376821576466432 -> n40813871623045120;\nn41376821576466432 -> n41658296553177088;\nn41658296553177088 -> n40813871623045120;\nn41658296553177088 -> n41939771529887744;\nn41939771529887744 -> n40813871623045120;\nn41939771529887744 -> n42221246506598400;\nn42221246506598400 -> n40813871623045120;\nn42221246506598400 -> n42502721483309056;\nn42502721483309056 -> n40813871623045120;\nn42502721483309056 -> n42784196460019712;\nn42784196460019712 -> n40813871623045120;\nn42784196460019712 -> n43065671436730368;\nn43065671436730368 -> n35747322042253312;\nn43065671436730368 -> n40813871623045120;\nn40813871623045120 -> n43347146413441024;\nn40813871623045120 -> n43628621390151680;\nn43628621390151680 -> n35747322042253312;\nn43628621390151680 -> n43347146413441024;\nn43347146413441024 -> n43910096366862336;\nn43347146413441024 -> n44191571343572992;\nn44191571343572992 -> n35747322042253312;\nn44191571343572992 -> n44473046320283648;\nn44473046320283648 -> n44754521296994304;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n44754521296994304;\nn44754521296994304 -> n45317471250415616;\nn44754521296994304 -> n45598946227126272;\nn45598946227126272 -> n45317471250415616;\nn45317471250415616 -> n44473046320283648;\nn45317471250415616 -> n45880421203836928;\nn45880421203836928 -> n35747322042253312;\nn43910096366862336 -> n35747322042253312;\nn43910096366862336 -> n46161896180547584;\nn46161896180547584 -> n46443371157258240;\nn46161896180547584 -> n46724846133968896;\nn46724846133968896 -> n47006321110679552;\nn46724846133968896 -> n47287796087390208;\nn47287796087390208 -> n47569271064100864;\nn47287796087390208 -> n47850746040811520;\nn47850746040811520 -> n47569271064100864;\nn47569271064100864 -> n46443371157258240;\nn47006321110679552 -> n46443371157258240;\nn47006321110679552 -> n48132221017522176;\nn48132221017522176 -> n46443371157258240;\nn46443371157258240 -> n48413695994232832;\nn46443371157258240 -> n48695170970943488;\nn48695170970943488 -> n50946970784628736;\nn50946970784628736 -> n48976645947654144;\nn50946970784628736 -> n49258120924364800;\nn49258120924364800 -> n49539595901075456;\nn49258120924364800 -> n48976645947654144;\nn48976645947654144 -> n49821070877786112;\nn48976645947654144 -> n50102545854496768;\nn50102545854496768 -> n49821070877786112;\nn50102545854496768 -> n50384020831207424;\nn50384020831207424 -> n49821070877786112;\nn50384020831207424 -> n50665495807918080;\nn50665495807918080 -> n49539595901075456;\nn50665495807918080 -> n49821070877786112;\nn49821070877786112 -> n49539595901075456;\nn49539595901075456 -> n50946970784628736;\nn49539595901075456 -> n51228445761339392;\nn51228445761339392 -> n48413695994232832;\nn48413695994232832 -> n51509920738050048;\nn48413695994232832 -> n51791395714760704;\nn51791395714760704 -> n54324670505156608;\nn54324670505156608 -> n52072870691471360;\nn54324670505156608 -> n52354345668182016;\nn52354345668182016 -> n52635820644892672;\nn52354345668182016 -> n52072870691471360;\nn52072870691471360 -> n52917295621603328;\nn52072870691471360 -> n53198770598313984;\nn53198770598313984 -> n52917295621603328;\nn53198770598313984 -> n53480245575024640;\nn53480245575024640 -> n52917295621603328;\nn53480245575024640 -> n53761720551735296;\nn53761720551735296 -> n52635820644892672;\nn53761720551735296 -> n52917295621603328;\nn52917295621603328 -> n52635820644892672;\nn52917295621603328 -> n54043195528445952;\nn54043195528445952 -> n52635820644892672;\nn52635820644892672 -> n54324670505156608;\nn52635820644892672 -> n54606145481867264;\nn54606145481867264 -> n51509920738050048;\nn51509920738050048 -> n54887620458577920;\nn51509920738050048 -> n55169095435288576;\nn55169095435288576 -> n35747322042253312;\nn54887620458577920 -> n35747322042253312;\nn54887620458577920 -> n55450570411999232;\nn55450570411999232 -> n35747322042253312;\nn55450570411999232 -> n55732045388709888;\nn55732045388709888 -> n35747322042253312;\nn35747322042253312 -> n56013520365420544;\nn35747322042253312 -> n56294995342131200;\nn56294995342131200 -> n56576470318841856;\nn56294995342131200 -> n56013520365420544;\nn56013520365420544 -> n56576470318841856;\nn56576470318841856 -> n56857945295552512;\nn56576470318841856 -> n30399297484750848;\nn30399297484750848 -> n57139420272263168;\nn30399297484750848 -> n57420895248973824;\nn57420895248973824 -> n57702370225684480;\nn57420895248973824 -> n57139420272263168;\nn57139420272263168 -> n57702370225684480;\nn57702370225684480 -> n57983845202395136;\nn57702370225684480 -> n58265320179105792;\nn58265320179105792 -> n59954170039369728;\nn59954170039369728 -> n58546795155816448;\nn59954170039369728 -> n58828270132527104;\nn58828270132527104 -> n59109745109237760;\nn58828270132527104 -> n58546795155816448;\nn58546795155816448 -> n59109745109237760;\nn59109745109237760 -> n59391220085948416;\nn59109745109237760 -> n59672695062659072;\nn59672695062659072 -> n59954170039369728;\nn59672695062659072 -> n59391220085948416;\nn59391220085948416 -> n57983845202395136;\nn59391220085948416 -> n60235645016080384;\nn60235645016080384 -> n60517119992791040;\nn60235645016080384 -> n60798594969501696;\nn60798594969501696 -> n61080069946212352;\nn60798594969501696 -> n60517119992791040;\nn60517119992791040 -> n61080069946212352;\nn61080069946212352 -> n61361544922923008;\nn61080069946212352 -> n61643019899633664;\nn61643019899633664 -> n61924494876344320;\nn61643019899633664 -> n62205969853054976;\nn62205969853054976 -> n62487444829765632;\nn62205969853054976 -> n61924494876344320;\nn61924494876344320 -> n62487444829765632;\nn62487444829765632 -> n60235645016080384;\nn62487444829765632 -> n61361544922923008;\nn61361544922923008 -> n57983845202395136;\nn61361544922923008 -> n62768919806476288;\nn62768919806476288 -> n65302194596872192;\nn65302194596872192 -> n63050394783186944;\nn65302194596872192 -> n63331869759897600;\nn63331869759897600 -> n63613344736608256;\nn63331869759897600 -> n63050394783186944;\nn63050394783186944 -> n63613344736608256;\nn63613344736608256 -> n63894819713318912;\nn63613344736608256 -> n64176294690029568;\nn64176294690029568 -> n63894819713318912;\nn63894819713318912 -> n64457769666740224;\nn63894819713318912 -> n64739244643450880;\nn64739244643450880 -> n65020719620161536;\nn64739244643450880 -> n64457769666740224;\nn64457769666740224 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn65020719620161536 -> n57983845202395136;\nn57983845202395136 -> n28991922601197568;\nn28991922601197568 -> n65583669573582848;\nn28991922601197568 -> n65865144550293504;\nn65865144550293504 -> n28428972647776256;\nn28428972647776256 -> n66146619527004160;\nn28428972647776256 -> n66428094503714816;\nn66428094503714816 -> n66146619527004160;\nn66428094503714816 -> n66709569480425472;\nn66709569480425472 -> n92042317384384512;\nn92042317384384512 -> n66991044457136128;\nn92042317384384512 -> n67272519433846784;\nn67272519433846784 -> n91479367430963200;\nn91479367430963200 -> n67553994410557440;\nn91479367430963200 -> n67835469387268096;\nn67835469387268096 -> n68116944363978752;\nn67835469387268096 -> n68398419340689408;\nn68398419340689408 -> n68679894317400064;\nn68398419340689408 -> n68116944363978752;\nn68116944363978752 -> n68679894317400064;\nn68679894317400064 -> n67553994410557440;\nn68679894317400064 -> n68961369294110720;\nn68961369294110720 -> n67553994410557440;\nn68961369294110720 -> n69242844270821376;\nn69242844270821376 -> n69524319247532032;\nn69242844270821376 -> n67553994410557440;\nn67553994410557440 -> n69524319247532032;\nn69524319247532032 -> n69805794224242688;\nn69524319247532032 -> n70087269200953344;\nn70087269200953344 -> n70368744177664000;\nn70087269200953344 -> n69805794224242688;\nn69805794224242688 -> n70368744177664000;\nn70368744177664000 -> n70650219154374656;\nn70368744177664000 -> n70931694131085312;\nn70931694131085312 -> n71213169107795968;\nn70931694131085312 -> n71494644084506624;\nn71494644084506624 -> n71776119061217280;\nn71494644084506624 -> n71213169107795968;\nn71213169107795968 -> n71776119061217280;\nn71776119061217280 -> n72057594037927936;\nn71776119061217280 -> n72339069014638592;\nn72339069014638592 -> n70650219154374656;\nn72339069014638592 -> n72620543991349248;\nn72620543991349248 -> n72902018968059904;\nn72057594037927936 -> n73183493944770560;\nn72057594037927936 -> n72902018968059904;\nn72902018968059904 -> n73464968921481216;\nn72902018968059904 -> n73183493944770560;\nn73183493944770560 -> n73464968921481216;\nn73464968921481216 -> n70650219154374656;\nn73464968921481216 -> n73746443898191872;\nn73746443898191872 -> n74027918874902528;\nn73746443898191872 -> n74309393851613184;\nn74309393851613184 -> n74590868828323840;\nn74309393851613184 -> n74027918874902528;\nn74027918874902528 -> n74590868828323840;\nn74590868828323840 -> n70650219154374656;\nn74590868828323840 -> n74872343805034496;\nn74872343805034496 -> n75153818781745152;\nn74872343805034496 -> n75435293758455808;\nn75435293758455808 -> n75716768735166464;\nn75435293758455808 -> n75153818781745152;\nn75153818781745152 -> n75716768735166464;\nn75716768735166464 -> n70650219154374656;\nn75716768735166464 -> n75998243711877120;\nn75998243711877120 -> n76279718688587776;\nn75998243711877120 -> n76561193665298432;\nn76561193665298432 -> n76842668642009088;\nn76561193665298432 -> n76279718688587776;\nn76279718688587776 -> n76842668642009088;\nn76842668642009088 -> n70650219154374656;\nn76842668642009088 -> n77124143618719744;\nn77124143618719744 -> n77405618595430400;\nn77124143618719744 -> n77687093572141056;\nn77687093572141056 -> n77405618595430400;\nn77687093572141056 -> n77968568548851712;\nn77968568548851712 -> n77405618595430400;\nn77968568548851712 -> n78250043525562368;\nn78250043525562368 -> n77405618595430400;\nn78250043525562368 -> n78531518502273024;\nn78531518502273024 -> n77405618595430400;\nn78531518502273024 -> n78812993478983680;\nn78812993478983680 -> n77405618595430400;\nn78812993478983680 -> n79094468455694336;\nn79094468455694336 -> n77405618595430400;\nn79094468455694336 -> n79375943432404992;\nn79375943432404992 -> n77405618595430400;\nn79375943432404992 -> n79657418409115648;\nn79657418409115648 -> n70650219154374656;\nn79657418409115648 -> n77405618595430400;\nn77405618595430400 -> n79938893385826304;\nn77405618595430400 -> n80220368362536960;\nn80220368362536960 -> n79938893385826304;\nn80220368362536960 -> n70650219154374656;\nn70650219154374656 -> n79938893385826304;\nn79938893385826304 -> n80501843339247616;\nn79938893385826304 -> n80783318315958272;\nn80783318315958272 -> n81064793292668928;\nn80783318315958272 -> n81346268269379584;\nn81346268269379584 -> n81627743246090240;\nn81346268269379584 -> n81064793292668928;\nn81064793292668928 -> n81627743246090240;\nn81627743246090240 -> n80501843339247616;\nn81627743246090240 -> n81909218222800896;\nn81909218222800896 -> n82190693199511552;\nn81909218222800896 -> n80501843339247616;\nn80501843339247616 -> n82190693199511552;\nn82190693199511552 -> n82472168176222208;\nn82190693199511552 -> n82753643152932864;\nn82753643152932864 -> n83035118129643520;\nn82753643152932864 -> n82472168176222208;\nn82472168176222208 -> n83035118129643520;\nn83035118129643520 -> n83316593106354176;\nn83035118129643520 -> n83598068083064832;\nn83598068083064832 -> n83879543059775488;\nn83598068083064832 -> n84161018036486144;\nn84161018036486144 -> n83879543059775488;\nn83879543059775488 -> n84442493013196800;\nn83879543059775488 -> n83316593106354176;\nn83316593106354176 -> n84723967989907456;\nn83316593106354176 -> n85005442966618112;\nn85005442966618112 -> n84723967989907456;\nn84723967989907456 -> n85286917943328768;\nn84723967989907456 -> n85568392920039424;\nn85568392920039424 -> n85286917943328768;\nn85568392920039424 -> n85849867896750080;\nn85849867896750080 -> n85286917943328768;\nn85849867896750080 -> n86131342873460736;\nn86131342873460736 -> n85286917943328768;\nn86131342873460736 -> n84442493013196800;\nn84442493013196800 -> n86412817850171392;\nn84442493013196800 -> n86694292826882048;\nn86694292826882048 -> n86975767803592704;\nn86694292826882048 -> n86412817850171392;\nn86412817850171392 -> n86975767803592704;\nn86975767803592704 -> n87257242780303360;\nn86975767803592704 -> n87538717757014016;\nn87538717757014016 -> n87820192733724672;\nn87538717757014016 -> n88101667710435328;\nn88101667710435328 -> n88383142687145984;\nn88101667710435328 -> n87820192733724672;\nn87820192733724672 -> n88383142687145984;\nn88383142687145984 -> n85286917943328768;\nn88383142687145984 -> n87257242780303360;\nn87257242780303360 -> n85286917943328768;\nn85286917943328768 -> n88664617663856640;\nn85286917943328768 -> n88946092640567296;\nn88946092640567296 -> n88664617663856640;\nn88664617663856640 -> n89227567617277952;\nn88664617663856640 -> n89509042593988608;\nn89509042593988608 -> n89227567617277952;\nn89227567617277952 -> n89790517570699264;\nn89227567617277952 -> n90071992547409920;\nn90071992547409920 -> n90353467524120576;\nn90071992547409920 -> n89790517570699264;\nn89790517570699264 -> n90353467524120576;\nn90353467524120576 -> n90634942500831232;\nn90353467524120576 -> n90916417477541888;\nn90916417477541888 -> n90634942500831232;\nn90916417477541888 -> n91197892454252544;\nn91197892454252544 -> n90634942500831232;\nn90634942500831232 -> n91479367430963200;\nn90634942500831232 -> n91760842407673856;\nn91760842407673856 -> n66991044457136128;\nn66991044457136128 -> n92042317384384512;\nn66991044457136128 -> n92323792361095168;\nn92323792361095168 -> n66146619527004160;\nn66146619527004160 -> n92605267337805824;\nn66146619527004160 -> n92886742314516480;\nn92886742314516480 -> n92605267337805824;\nn92886742314516480 -> n93168217291227136;\nn93168217291227136 -> n93449692267937792;\nn93168217291227136 -> n92605267337805824;\nn92605267337805824 -> n93731167244648448;\nn92605267337805824 -> n94012642221359104;\nn94012642221359104 -> n93731167244648448;\nn94012642221359104 -> n94294117198069760;\nn94294117198069760 -> n94575592174780416;\nn94294117198069760 -> n94857067151491072;\nn94857067151491072 -> n93449692267937792;\nn93731167244648448 -> n94575592174780416;\nn93731167244648448 -> n95138542128201728;\nn95138542128201728 -> n94575592174780416;\nn95138542128201728 -> n95420017104912384;\nn95420017104912384 -> n93449692267937792;\nn93449692267937792 -> n94575592174780416;\nn93449692267937792 -> n95701492081623040;\nn95701492081623040 -> n94575592174780416;\nn94575592174780416 -> n95982967058333696;\nn94575592174780416 -> n96264442035044352;\nn96264442035044352 -> n95982967058333696;\nn95982967058333696 -> n96545917011755008;\nn95982967058333696 -> n96827391988465664;\nn96827391988465664 -> n97108866965176320;\nn96545917011755008 -> n97108866965176320;\nn97108866965176320 -> n97390341941886976;\nn97108866965176320 -> n97671816918597632;\nn97671816918597632 -> n97953291895308288;\nn97390341941886976 -> n97953291895308288;\nn97953291895308288 -> n98234766872018944;\nn97953291895308288 -> n98516241848729600;\nn98516241848729600 -> n98797716825440256;\nn98234766872018944 -> n98797716825440256;\nn98797716825440256 -> n99079191802150912;\nn98797716825440256 -> n99360666778861568;\nn99360666778861568 -> n99079191802150912;\nn99079191802150912 -> n281474976710656;\nn1688849860263936 -> n844424930131968[style=dotted];\nn2251799813685248 -> n1688849860263936[style=dotted];\nn27584547717644288 -> n2814749767106560[style=dotted];\nn3096224743817216 -> n27584547717644288[style=dotted];\nn3659174697238528 -> n27584547717644288[style=dotted];\nn4503599627370496 -> n4222124650659840[style=dotted];\nn4785074604081152 -> n4503599627370496[style=dotted];\nn5348024557502464 -> n4503599627370496[style=dotted];\nn6192449487634432 -> n5910974510923776[style=dotted];\nn5629499534213120 -> n5348024557502464[style=dotted];\nn7036874417766400 -> n5629499534213120[style=dotted];\nn7599824371187712 -> n7036874417766400[style=dotted];\nn6755399441055744 -> n5348024557502464[style=dotted];\nn9007199254740992 -> n6755399441055744[style=dotted];\nn9570149208162304 -> n6755399441055744[style=dotted];\nn3940649673949184 -> n3659174697238528[style=dotted];\nn9851624184872960 -> n3940649673949184[style=dotted];\nn10414574138294272 -> n3940649673949184[style=dotted];\nn18295873486192640 -> n11540474045136896[style=dotted];\nn11821949021847552 -> n18295873486192640[style=dotted];\nn12384898975268864 -> n18295873486192640[style=dotted];\nn13229323905400832 -> n12947848928690176[style=dotted];\nn12666373951979520 -> n12384898975268864[style=dotted];\nn14073748835532800 -> n12666373951979520[style=dotted];\nn13792273858822144 -> n12384898975268864[style=dotted];\nn15762598695796736 -> n13792273858822144[style=dotted];\nn16325548649218048 -> n13792273858822144[style=dotted];\nn14636698788954112 -> n12384898975268864[style=dotted];\nn16607023625928704 -> n12384898975268864[style=dotted];\nn17451448556060672 -> n16607023625928704[style=dotted];\nn18014398509481984 -> n16607023625928704[style=dotted];\nn11258999068426240 -> n10977524091715584[style=dotted];\nn18577348462903296 -> n11258999068426240[style=dotted];\nn25051272927248384 -> n19421773393035264[style=dotted];\nn19703248369745920 -> n25051272927248384[style=dotted];\nn20266198323167232 -> n25051272927248384[style=dotted];\nn21110623253299200 -> n20829148276588544[style=dotted];\nn20547673299877888 -> n20266198323167232[style=dotted];\nn21955048183431168 -> n20547673299877888[style=dotted];\nn22517998136852480 -> n21955048183431168[style=dotted];\nn21673573206720512 -> n20266198323167232[style=dotted];\nn24206847997116416 -> n21673573206720512[style=dotted];\nn24769797950537728 -> n21673573206720512[style=dotted];\nn19140298416324608 -> n18577348462903296[style=dotted];\nn25332747903959040 -> n19140298416324608[style=dotted];\nn25895697857380352 -> n19140298416324608[style=dotted];\nn10696049115004928 -> n10414574138294272[style=dotted];\nn26740122787512320 -> n10696049115004928[style=dotted];\nn27303072740933632 -> n10696049115004928[style=dotted];\nn2533274790395904 -> n2251799813685248[style=dotted];\nn28147497671065600 -> n1688849860263936[style=dotted];\nn65583669573582848 -> n28710447624486912[style=dotted];\nn29554872554618880 -> n29273397577908224[style=dotted];\nn30117822508040192 -> n29273397577908224[style=dotted];\nn56857945295552512 -> n30680772461461504[style=dotted];\nn31525197391593472 -> n56857945295552512[style=dotted];\nn31806672368304128 -> n31525197391593472[style=dotted];\nn32369622321725440 -> n31806672368304128[style=dotted];\nn33495522228568064 -> n33214047251857408[style=dotted];\nn32932572275146752 -> n32369622321725440[style=dotted];\nn34902897112121344 -> n32932572275146752[style=dotted];\nn35465847065542656 -> n32932572275146752[style=dotted];\nn36310271995674624 -> n36028797018963968[style=dotted];\nn36873221949095936 -> n36028797018963968[style=dotted];\nn37999121855938560 -> n36873221949095936[style=dotted];\nn38280596832649216 -> n36873221949095936[style=dotted];\nn38562071809359872 -> n36873221949095936[style=dotted];\nn39125021762781184 -> n38843546786070528[style=dotted];\nn39687971716202496 -> n38843546786070528[style=dotted];\nn40813871623045120 -> n40532396646334464[style=dotted];\nn43347146413441024 -> n40813871623045120[style=dotted];\nn44473046320283648 -> n44191571343572992[style=dotted];\nn44754521296994304 -> n44473046320283648[style=dotted];\nn45317471250415616 -> n44754521296994304[style=dotted];\nn47569271064100864 -> n47287796087390208[style=dotted];\nn46443371157258240 -> n46161896180547584[style=dotted];\nn50946970784628736 -> n48695170970943488[style=dotted];\nn48976645947654144 -> n50946970784628736[style=dotted];\nn49821070877786112 -> n48976645947654144[style=dotted];\nn49539595901075456 -> n50946970784628736[style=dotted];\nn48413695994232832 -> n46443371157258240[style=dotted];\nn54324670505156608 -> n51791395714760704[style=dotted];\nn52072870691471360 -> n54324670505156608[style=dotted];\nn52917295621603328 -> n52072870691471360[style=dotted];\nn52635820644892672 -> n54324670505156608[style=dotted];\nn51509920738050048 -> n48413695994232832[style=dotted];\nn35747322042253312 -> n35465847065542656[style=dotted];\nn56013520365420544 -> n35747322042253312[style=dotted];\nn56576470318841856 -> n35747322042253312[style=dotted];\nn30399297484750848 -> n30117822508040192[style=dotted];\nn57139420272263168 -> n30399297484750848[style=dotted];\nn57702370225684480 -> n30399297484750848[style=dotted];\nn59954170039369728 -> n58265320179105792[style=dotted];\nn58546795155816448 -> n59954170039369728[style=dotted];\nn59109745109237760 -> n59954170039369728[style=dotted];\nn59391220085948416 -> n59109745109237760[style=dotted];\nn60235645016080384 -> n59391220085948416[style=dotted];\nn60517119992791040 -> n60235645016080384[style=dotted];\nn61080069946212352 -> n60235645016080384[style=dotted];\nn61924494876344320 -> n61643019899633664[style=dotted];\nn62487444829765632 -> n61643019899633664[style=dotted];\nn61361544922923008 -> n61080069946212352[style=dotted];\nn65302194596872192 -> n62768919806476288[style=dotted];\nn63050394783186944 -> n65302194596872192[style=dotted];\nn63613344736608256 -> n65302194596872192[style=dotted];\nn63894819713318912 -> n63613344736608256[style=dotted];\nn64457769666740224 -> n63894819713318912[style=dotted];\nn65020719620161536 -> n63894819713318912[style=dotted];\nn57983845202395136 -> n57702370225684480[style=dotted];\nn28991922601197568 -> n65583669573582848[style=dotted];\nn28428972647776256 -> n28147497671065600[style=dotted];\nn92042317384384512 -> n66709569480425472[style=dotted];\nn91479367430963200 -> n67272519433846784[style=dotted];\nn68116944363978752 -> n67835469387268096[style=dotted];\nn68679894317400064 -> n67835469387268096[style=dotted];\nn67553994410557440 -> n91479367430963200[style=dotted];\nn69524319247532032 -> n91479367430963200[style=dotted];\nn69805794224242688 -> n69524319247532032[style=dotted];\nn70368744177664000 -> n69524319247532032[style=dotted];\nn71213169107795968 -> n70931694131085312[style=dotted];\nn71776119061217280 -> n70931694131085312[style=dotted];\nn72902018968059904 -> n71776119061217280[style=dotted];\nn73183493944770560 -> n71776119061217280[style=dotted];\nn73464968921481216 -> n71776119061217280[style=dotted];\nn74027918874902528 -> n73746443898191872[style=dotted];\nn74590868828323840 -> n73746443898191872[style=dotted];\nn75153818781745152 -> n74872343805034496[style=dotted];\nn75716768735166464 -> n74872343805034496[style=dotted];\nn76279718688587776 -> n75998243711877120[style=dotted];\nn76842668642009088 -> n75998243711877120[style=dotted];\nn77405618595430400 -> n77124143618719744[style=dotted];\nn70650219154374656 -> n70368744177664000[style=dotted];\nn79938893385826304 -> n70368744177664000[style=dotted];\nn81064793292668928 -> n80783318315958272[style=dotted];\nn81627743246090240 -> n80783318315958272[style=dotted];\nn80501843339247616 -> n79938893385826304[style=dotted];\nn82190693199511552 -> n79938893385826304[style=dotted];\nn82472168176222208 -> n82190693199511552[style=dotted];\nn83035118129643520 -> n82190693199511552[style=dotted];\nn83879543059775488 -> n83598068083064832[style=dotted];\nn83316593106354176 -> n83035118129643520[style=dotted];\nn84723967989907456 -> n83316593106354176[style=dotted];\nn84442493013196800 -> n83035118129643520[style=dotted];\nn86412817850171392 -> n84442493013196800[style=dotted];\nn86975767803592704 -> n84442493013196800[style=dotted];\nn87820192733724672 -> n87538717757014016[style=dotted];\nn88383142687145984 -> n87538717757014016[style=dotted];\nn87257242780303360 -> n86975767803592704[style=dotted];\nn85286917943328768 -> n83035118129643520[style=dotted];\nn88664617663856640 -> n85286917943328768[style=dotted];\nn89227567617277952 -> n88664617663856640[style=dotted];\nn89790517570699264 -> n89227567617277952[style=dotted];\nn90353467524120576 -> n89227567617277952[style=dotted];\nn90634942500831232 -> n90353467524120576[style=dotted];\nn66991044457136128 -> n92042317384384512[style=dotted];\nn66146619527004160 -> n28428972647776256[style=dotted];\nn92605267337805824 -> n66146619527004160[style=dotted];\nn93731167244648448 -> n92605267337805824[style=dotted];\nn93449692267937792 -> n66146619527004160[style=dotted];\nn94575592174780416 -> n66146619527004160[style=dotted];\nn95982967058333696 -> n94575592174780416[style=dotted];\nn97108866965176320 -> n95982967058333696[style=dotted];\nn97953291895308288 -> n97108866965176320[style=dotted];\nn98797716825440256 -> n97953291895308288[style=dotted];\nn99079191802150912 -> n98797716825440256[style=dotted];\nn281474976710656 -> n0[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-1691.txt",
    "content": "digraph {\n\nmaxiter=8;\n        \nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn1970324836974592[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn2533274790395904[shape=rectangle, label=\"B8\"];\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn3377699720527872[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn3940649673949184[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn4503599627370496[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn5066549580791808[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn5629499534213120[shape=rectangle, label=\"B19\"];\nn5910974510923776[shape=rectangle, label=\"B20\"];\nn6192449487634432[shape=rectangle, label=\"B21\"];\nn6473924464345088[shape=rectangle, label=\"B22\"];\nn6755399441055744[shape=rectangle, label=\"B23\"];\nn7036874417766400[shape=rectangle, label=\"B24\"];\nn7318349394477056[shape=rectangle, label=\"B25\"];\nn7599824371187712[shape=rectangle, label=\"B26\"];\nn7881299347898368[shape=rectangle, label=\"B27\"];\nn8162774324609024[shape=rectangle, label=\"B28\"];\nn8444249301319680[shape=rectangle, label=\"B29\"];\nn8725724278030336[shape=rectangle, label=\"B30\"];\nn9007199254740992[shape=rectangle, label=\"B31\"];\nn9288674231451648[shape=rectangle, label=\"B32\"];\nn9570149208162304[shape=rectangle, label=\"B33\"];\nn9851624184872960[shape=rectangle, label=\"B34\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn10414574138294272[shape=rectangle, label=\"B36\"];\nn10696049115004928[shape=rectangle, label=\"B37\"];\nn10977524091715584[shape=rectangle, label=\"B38\"];\nn11258999068426240[shape=rectangle, label=\"B39\"];\nn11540474045136896[shape=rectangle, label=\"B40\"];\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn12103423998558208[shape=rectangle, label=\"B42\"];\nn12384898975268864[shape=rectangle, label=\"B43\"];\nn12666373951979520[shape=rectangle, label=\"B44\"];\nn12947848928690176[shape=rectangle, label=\"B45\"];\nn281474976710656[shape=rectangle, label=\"B46\"];\nn13229323905400832[shape=rectangle, label=\"B47\"];\nn13510798882111488[shape=rectangle, label=\"B48\"];\nn14073748835532800[shape=rectangle, label=\"B49\"];\nn14636698788954112[shape=rectangle, label=\"B50\"];\nn13792273858822144[shape=rectangle, label=\"B51\"];\nn15199648742375424[shape=rectangle, label=\"B52\"];\nn14918173765664768[shape=rectangle, label=\"B53\"];\nn16044073672507392[shape=rectangle, label=\"B54\"];\nn16607023625928704[shape=rectangle, label=\"B55\"];\nn16325548649218048[shape=rectangle, label=\"B56\"];\nn17169973579350016[shape=rectangle, label=\"B57\"];\nn16888498602639360[shape=rectangle, label=\"B58\"];\nn17732923532771328[shape=rectangle, label=\"B59\"];\nn15762598695796736[shape=rectangle, label=\"B60\"];\nn17451448556060672[shape=rectangle, label=\"B61\"];\nn18295873486192640[shape=rectangle, label=\"B62\"];\nn18577348462903296[shape=rectangle, label=\"B63\"];\nn18858823439613952[shape=rectangle, label=\"B64\"];\nn19140298416324608[shape=rectangle, label=\"B65\"];\nn19421773393035264[shape=rectangle, label=\"B66\"];\nn25332747903959040[shape=rectangle, label=\"B67\"];\nn18014398509481984[shape=rectangle, label=\"B68\"];\nn20266198323167232[shape=rectangle, label=\"B69\"];\nn20829148276588544[shape=rectangle, label=\"B70\"];\nn20547673299877888[shape=rectangle, label=\"B71\"];\nn21673573206720512[shape=rectangle, label=\"B72\"];\nn22236523160141824[shape=rectangle, label=\"B73\"];\nn21955048183431168[shape=rectangle, label=\"B74\"];\nn22799473113563136[shape=rectangle, label=\"B75\"];\nn22517998136852480[shape=rectangle, label=\"B76\"];\nn23362423066984448[shape=rectangle, label=\"B77\"];\nn21392098230009856[shape=rectangle, label=\"B78\"];\nn23080948090273792[shape=rectangle, label=\"B79\"];\nn23925373020405760[shape=rectangle, label=\"B80\"];\nn24206847997116416[shape=rectangle, label=\"B81\"];\nn24488322973827072[shape=rectangle, label=\"B82\"];\nn24769797950537728[shape=rectangle, label=\"B83\"];\nn25051272927248384[shape=rectangle, label=\"B84\"];\nn23643898043695104[shape=rectangle, label=\"B85\"];\nn25614222880669696[shape=rectangle, label=\"B86\"];\nn19984723346456576[shape=rectangle, label=\"B87\"];\nn21110623253299200[shape=rectangle, label=\"B88\"];\nn19703248369745920[shape=rectangle, label=\"B89\"];\nn25895697857380352[shape=rectangle, label=\"B90\"];\nn14355223812243456[shape=rectangle, label=\"B91\"];\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn27021597764222976[shape=rectangle, label=\"B93\"];\nn26740122787512320[shape=rectangle, label=\"B94\"];\nn27584547717644288[shape=rectangle, label=\"B95\"];\nn27303072740933632[shape=rectangle, label=\"B96\"];\nn26177172834091008[shape=rectangle, label=\"B97\"];\nn27866022694354944[shape=rectangle, label=\"B98\"];\nn28428972647776256[shape=rectangle, label=\"B99\"];\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn28991922601197568[shape=rectangle, label=\"B101\"];\nn29273397577908224[shape=rectangle, label=\"B102\"];\nn29554872554618880[shape=rectangle, label=\"B103\"];\nn29836347531329536[shape=rectangle, label=\"B104\"];\nn30399297484750848[shape=rectangle, label=\"B105\"];\nn28147497671065600[shape=rectangle, label=\"B106\"];\nn31243722414882816[shape=rectangle, label=\"B107\"];\nn15481123719086080[shape=rectangle, label=\"B108\"];\nn30117822508040192[shape=rectangle, label=\"B109\"];\nn31525197391593472[shape=rectangle, label=\"B110\"];\nn60798594969501696[shape=rectangle, label=\"B111\"];\nn32088147345014784[shape=rectangle, label=\"B112\"];\nn31806672368304128[shape=rectangle, label=\"B113\"];\nn32932572275146752[shape=rectangle, label=\"B114\"];\nn32651097298436096[shape=rectangle, label=\"B115\"];\nn33495522228568064[shape=rectangle, label=\"B116\"];\nn33214047251857408[shape=rectangle, label=\"B117\"];\nn34058472181989376[shape=rectangle, label=\"B118\"];\nn33776997205278720[shape=rectangle, label=\"B119\"];\nn32369622321725440[shape=rectangle, label=\"B120\"];\nn34621422135410688[shape=rectangle, label=\"B121\"];\nn34339947158700032[shape=rectangle, label=\"B122\"];\nn35184372088832000[shape=rectangle, label=\"B123\"];\nn34902897112121344[shape=rectangle, label=\"B124\"];\nn35747322042253312[shape=rectangle, label=\"B125\"];\nn36028797018963968[shape=rectangle, label=\"B126\"];\nn35465847065542656[shape=rectangle, label=\"B127\"];\nn36591746972385280[shape=rectangle, label=\"B128\"];\nn36310271995674624[shape=rectangle, label=\"B129\"];\nn37154696925806592[shape=rectangle, label=\"B130\"];\nn37436171902517248[shape=rectangle, label=\"B131\"];\nn36873221949095936[shape=rectangle, label=\"B132\"];\nn37999121855938560[shape=rectangle, label=\"B133\"];\nn37717646879227904[shape=rectangle, label=\"B134\"];\nn38562071809359872[shape=rectangle, label=\"B135\"];\nn38843546786070528[shape=rectangle, label=\"B136\"];\nn38280596832649216[shape=rectangle, label=\"B137\"];\nn39406496739491840[shape=rectangle, label=\"B138\"];\nn39125021762781184[shape=rectangle, label=\"B139\"];\nn39969446692913152[shape=rectangle, label=\"B140\"];\nn40250921669623808[shape=rectangle, label=\"B141\"];\nn39687971716202496[shape=rectangle, label=\"B142\"];\nn40813871623045120[shape=rectangle, label=\"B143\"];\nn40532396646334464[shape=rectangle, label=\"B144\"];\nn41376821576466432[shape=rectangle, label=\"B145\"];\nn41658296553177088[shape=rectangle, label=\"B146\"];\nn41095346599755776[shape=rectangle, label=\"B147\"];\nn42221246506598400[shape=rectangle, label=\"B148\"];\nn41939771529887744[shape=rectangle, label=\"B149\"];\nn42784196460019712[shape=rectangle, label=\"B150\"];\nn43065671436730368[shape=rectangle, label=\"B151\"];\nn42502721483309056[shape=rectangle, label=\"B152\"];\nn43628621390151680[shape=rectangle, label=\"B153\"];\nn43347146413441024[shape=rectangle, label=\"B154\"];\nn44191571343572992[shape=rectangle, label=\"B155\"];\nn44473046320283648[shape=rectangle, label=\"B156\"];\nn43910096366862336[shape=rectangle, label=\"B157\"];\nn45035996273704960[shape=rectangle, label=\"B158\"];\nn44754521296994304[shape=rectangle, label=\"B159\"];\nn45598946227126272[shape=rectangle, label=\"B160\"];\nn45880421203836928[shape=rectangle, label=\"B161\"];\nn45317471250415616[shape=rectangle, label=\"B162\"];\nn46443371157258240[shape=rectangle, label=\"B163\"];\nn46161896180547584[shape=rectangle, label=\"B164\"];\nn47006321110679552[shape=rectangle, label=\"B165\"];\nn47287796087390208[shape=rectangle, label=\"B166\"];\nn46724846133968896[shape=rectangle, label=\"B167\"];\nn47850746040811520[shape=rectangle, label=\"B168\"];\nn47569271064100864[shape=rectangle, label=\"B169\"];\nn48413695994232832[shape=rectangle, label=\"B170\"];\nn48695170970943488[shape=rectangle, label=\"B171\"];\nn48132221017522176[shape=rectangle, label=\"B172\"];\nn49258120924364800[shape=rectangle, label=\"B173\"];\nn48976645947654144[shape=rectangle, label=\"B174\"];\nn49821070877786112[shape=rectangle, label=\"B175\"];\nn50102545854496768[shape=rectangle, label=\"B176\"];\nn49539595901075456[shape=rectangle, label=\"B177\"];\nn50665495807918080[shape=rectangle, label=\"B178\"];\nn50384020831207424[shape=rectangle, label=\"B179\"];\nn51228445761339392[shape=rectangle, label=\"B180\"];\nn51509920738050048[shape=rectangle, label=\"B181\"];\nn50946970784628736[shape=rectangle, label=\"B182\"];\nn52072870691471360[shape=rectangle, label=\"B183\"];\nn51791395714760704[shape=rectangle, label=\"B184\"];\nn52635820644892672[shape=rectangle, label=\"B185\"];\nn52917295621603328[shape=rectangle, label=\"B186\"];\nn52354345668182016[shape=rectangle, label=\"B187\"];\nn53480245575024640[shape=rectangle, label=\"B188\"];\nn53198770598313984[shape=rectangle, label=\"B189\"];\nn54043195528445952[shape=rectangle, label=\"B190\"];\nn54324670505156608[shape=rectangle, label=\"B191\"];\nn53761720551735296[shape=rectangle, label=\"B192\"];\nn54887620458577920[shape=rectangle, label=\"B193\"];\nn54606145481867264[shape=rectangle, label=\"B194\"];\nn55732045388709888[shape=rectangle, label=\"B195\"];\nn56294995342131200[shape=rectangle, label=\"B196\"];\nn56857945295552512[shape=rectangle, label=\"B197\"];\nn57139420272263168[shape=rectangle, label=\"B198\"];\nn55450570411999232[shape=rectangle, label=\"B199\"];\nn56013520365420544[shape=rectangle, label=\"B200\"];\nn57702370225684480[shape=rectangle, label=\"B201\"];\nn56576470318841856[shape=rectangle, label=\"B202\"];\nn59391220085948416[shape=rectangle, label=\"B203\"];\nn57983845202395136[shape=rectangle, label=\"B204\"];\nn57420895248973824[shape=rectangle, label=\"B205\"];\nn58546795155816448[shape=rectangle, label=\"B206\"];\nn58265320179105792[shape=rectangle, label=\"B207\"];\nn59109745109237760[shape=rectangle, label=\"B208\"];\nn58828270132527104[shape=rectangle, label=\"B209\"];\nn55169095435288576[shape=rectangle, label=\"B210\"];\nn59954170039369728[shape=rectangle, label=\"B211\"];\nn60517119992791040[shape=rectangle, label=\"B212\"];\nn61080069946212352[shape=rectangle, label=\"B213\"];\nn59672695062659072[shape=rectangle, label=\"B214\"];\nn30962247438172160[shape=rectangle, label=\"B215\"];\nn61643019899633664[shape=rectangle, label=\"B216\"];\nn62205969853054976[shape=rectangle, label=\"B217\"];\nn61924494876344320[shape=rectangle, label=\"B218\"];\nn62768919806476288[shape=rectangle, label=\"B219\"];\nn62487444829765632[shape=rectangle, label=\"B220\"];\nn61361544922923008[shape=rectangle, label=\"B221\"];\nn63050394783186944[shape=rectangle, label=\"B222\"];\nn63613344736608256[shape=rectangle, label=\"B223\"];\nn63894819713318912[shape=rectangle, label=\"B224\"];\nn64176294690029568[shape=rectangle, label=\"B225\"];\nn64457769666740224[shape=rectangle, label=\"B226\"];\nn64739244643450880[shape=rectangle, label=\"B227\"];\nn63331869759897600[shape=rectangle, label=\"B228\"];\nn30680772461461504[shape=rectangle, label=\"B229\"];\nn60235645016080384[shape=rectangle, label=\"B230\"];\nn65302194596872192[shape=rectangle, label=\"B231\"];\nn65865144550293504[shape=rectangle, label=\"B232\"];\nn66428094503714816[shape=rectangle, label=\"B233\"];\nn66991044457136128[shape=rectangle, label=\"B234\"];\nn72902018968059904[shape=rectangle, label=\"B235\"];\nn67553994410557440[shape=rectangle, label=\"B236\"];\nn67272519433846784[shape=rectangle, label=\"B237\"];\nn68116944363978752[shape=rectangle, label=\"B238\"];\nn67835469387268096[shape=rectangle, label=\"B239\"];\nn68679894317400064[shape=rectangle, label=\"B240\"];\nn69242844270821376[shape=rectangle, label=\"B241\"];\nn68961369294110720[shape=rectangle, label=\"B242\"];\nn69805794224242688[shape=rectangle, label=\"B243\"];\nn69524319247532032[shape=rectangle, label=\"B244\"];\nn70368744177664000[shape=rectangle, label=\"B245\"];\nn68398419340689408[shape=rectangle, label=\"B246\"];\nn70087269200953344[shape=rectangle, label=\"B247\"];\nn70931694131085312[shape=rectangle, label=\"B248\"];\nn71213169107795968[shape=rectangle, label=\"B249\"];\nn71494644084506624[shape=rectangle, label=\"B250\"];\nn71776119061217280[shape=rectangle, label=\"B251\"];\nn70650219154374656[shape=rectangle, label=\"B252\"];\nn72620543991349248[shape=rectangle, label=\"B253\"];\nn73183493944770560[shape=rectangle, label=\"B254\"];\nn73746443898191872[shape=rectangle, label=\"B255\"];\nn74309393851613184[shape=rectangle, label=\"B256\"];\nn74590868828323840[shape=rectangle, label=\"B257\"];\nn75153818781745152[shape=rectangle, label=\"B258\"];\nn66709569480425472[shape=rectangle, label=\"B259\"];\nn72057594037927936[shape=rectangle, label=\"B260\"];\nn73464968921481216[shape=rectangle, label=\"B261\"];\nn72339069014638592[shape=rectangle, label=\"B262\"];\nn76279718688587776[shape=rectangle, label=\"B263\"];\nn74027918874902528[shape=rectangle, label=\"B264\"];\nn74872343805034496[shape=rectangle, label=\"B265\"];\nn76842668642009088[shape=rectangle, label=\"B266\"];\nn76561193665298432[shape=rectangle, label=\"B267\"];\nn77405618595430400[shape=rectangle, label=\"B268\"];\nn77124143618719744[shape=rectangle, label=\"B269\"];\nn75435293758455808[shape=rectangle, label=\"B270\"];\nn77968568548851712[shape=rectangle, label=\"B271\"];\nn77687093572141056[shape=rectangle, label=\"B272\"];\nn78531518502273024[shape=rectangle, label=\"B273\"];\nn78250043525562368[shape=rectangle, label=\"B274\"];\nn79094468455694336[shape=rectangle, label=\"B275\"];\nn78812993478983680[shape=rectangle, label=\"B276\"];\nn79657418409115648[shape=rectangle, label=\"B277\"];\nn79375943432404992[shape=rectangle, label=\"B278\"];\nn80220368362536960[shape=rectangle, label=\"B279\"];\nn79938893385826304[shape=rectangle, label=\"B280\"];\nn80783318315958272[shape=rectangle, label=\"B281\"];\nn80501843339247616[shape=rectangle, label=\"B282\"];\nn81346268269379584[shape=rectangle, label=\"B283\"];\nn81064793292668928[shape=rectangle, label=\"B284\"];\nn81909218222800896[shape=rectangle, label=\"B285\"];\nn81627743246090240[shape=rectangle, label=\"B286\"];\nn82472168176222208[shape=rectangle, label=\"B287\"];\nn82190693199511552[shape=rectangle, label=\"B288\"];\nn83035118129643520[shape=rectangle, label=\"B289\"];\nn82753643152932864[shape=rectangle, label=\"B290\"];\nn83598068083064832[shape=rectangle, label=\"B291\"];\nn83316593106354176[shape=rectangle, label=\"B292\"];\nn84161018036486144[shape=rectangle, label=\"B293\"];\nn83879543059775488[shape=rectangle, label=\"B294\"];\nn84723967989907456[shape=rectangle, label=\"B295\"];\nn84442493013196800[shape=rectangle, label=\"B296\"];\nn85286917943328768[shape=rectangle, label=\"B297\"];\nn85005442966618112[shape=rectangle, label=\"B298\"];\nn85849867896750080[shape=rectangle, label=\"B299\"];\nn85568392920039424[shape=rectangle, label=\"B300\"];\nn86412817850171392[shape=rectangle, label=\"B301\"];\nn86131342873460736[shape=rectangle, label=\"B302\"];\nn86975767803592704[shape=rectangle, label=\"B303\"];\nn86694292826882048[shape=rectangle, label=\"B304\"];\nn87538717757014016[shape=rectangle, label=\"B305\"];\nn87257242780303360[shape=rectangle, label=\"B306\"];\nn88101667710435328[shape=rectangle, label=\"B307\"];\nn87820192733724672[shape=rectangle, label=\"B308\"];\nn88664617663856640[shape=rectangle, label=\"B309\"];\nn88383142687145984[shape=rectangle, label=\"B310\"];\nn89227567617277952[shape=rectangle, label=\"B311\"];\nn88946092640567296[shape=rectangle, label=\"B312\"];\nn89790517570699264[shape=rectangle, label=\"B313\"];\nn89509042593988608[shape=rectangle, label=\"B314\"];\nn90353467524120576[shape=rectangle, label=\"B315\"];\nn90071992547409920[shape=rectangle, label=\"B316\"];\nn90916417477541888[shape=rectangle, label=\"B317\"];\nn90634942500831232[shape=rectangle, label=\"B318\"];\nn91479367430963200[shape=rectangle, label=\"B319\"];\nn91197892454252544[shape=rectangle, label=\"B320\"];\nn92042317384384512[shape=rectangle, label=\"B321\"];\nn91760842407673856[shape=rectangle, label=\"B322\"];\nn92605267337805824[shape=rectangle, label=\"B323\"];\nn92323792361095168[shape=rectangle, label=\"B324\"];\nn93168217291227136[shape=rectangle, label=\"B325\"];\nn92886742314516480[shape=rectangle, label=\"B326\"];\nn93731167244648448[shape=rectangle, label=\"B327\"];\nn94012642221359104[shape=rectangle, label=\"B328\"];\nn94294117198069760[shape=rectangle, label=\"B329\"];\nn93449692267937792[shape=rectangle, label=\"B330\"];\nn94575592174780416[shape=rectangle, label=\"B331\"];\nn95138542128201728[shape=rectangle, label=\"B332\"];\nn95701492081623040[shape=rectangle, label=\"B333\"];\nn95420017104912384[shape=rectangle, label=\"B334\"];\nn96545917011755008[shape=rectangle, label=\"B335\"];\nn97108866965176320[shape=rectangle, label=\"B336\"];\nn96264442035044352[shape=rectangle, label=\"B337\"];\nn96827391988465664[shape=rectangle, label=\"B338\"];\nn97671816918597632[shape=rectangle, label=\"B339\"];\nn97390341941886976[shape=rectangle, label=\"B340\"];\nn97953291895308288[shape=rectangle, label=\"B341\"];\nn98797716825440256[shape=rectangle, label=\"B342\"];\nn98516241848729600[shape=rectangle, label=\"B343\"];\nn99360666778861568[shape=rectangle, label=\"B344\"];\nn99079191802150912[shape=rectangle, label=\"B345\"];\nn98234766872018944[shape=rectangle, label=\"B346\"];\nn99642141755572224[shape=rectangle, label=\"B347\"];\nn94857067151491072[shape=rectangle, label=\"B348\"];\nn95982967058333696[shape=rectangle, label=\"B349\"];\nn75998243711877120[shape=rectangle, label=\"B350\"];\nn75716768735166464[shape=rectangle, label=\"B351\"];\nn99923616732282880[shape=rectangle, label=\"B352\"];\nn66146619527004160[shape=rectangle, label=\"B353\"];\nn100205091708993536[shape=rectangle, label=\"B354\"];\nn100486566685704192[shape=rectangle, label=\"B355\"];\nn101049516639125504[shape=rectangle, label=\"B356\"];\nn100768041662414848[shape=rectangle, label=\"B357\"];\nn101612466592546816[shape=rectangle, label=\"B358\"];\nn101330991615836160[shape=rectangle, label=\"B359\"];\nn101893941569257472[shape=rectangle, label=\"B360\"];\nn102456891522678784[shape=rectangle, label=\"B361\"];\nn102175416545968128[shape=rectangle, label=\"B362\"];\nn103019841476100096[shape=rectangle, label=\"B363\"];\nn102738366499389440[shape=rectangle, label=\"B364\"];\nn103582791429521408[shape=rectangle, label=\"B365\"];\nn103301316452810752[shape=rectangle, label=\"B366\"];\nn104145741382942720[shape=rectangle, label=\"B367\"];\nn103864266406232064[shape=rectangle, label=\"B368\"];\nn104708691336364032[shape=rectangle, label=\"B369\"];\nn104427216359653376[shape=rectangle, label=\"B370\"];\nn105271641289785344[shape=rectangle, label=\"B371\"];\nn104990166313074688[shape=rectangle, label=\"B372\"];\nn105834591243206656[shape=rectangle, label=\"B373\"];\nn105553116266496000[shape=rectangle, label=\"B374\"];\nn106397541196627968[shape=rectangle, label=\"B375\"];\nn106116066219917312[shape=rectangle, label=\"B376\"];\nn106960491150049280[shape=rectangle, label=\"B377\"];\nn106679016173338624[shape=rectangle, label=\"B378\"];\nn107241966126759936[shape=rectangle, label=\"B379\"];\nn107804916080181248[shape=rectangle, label=\"B380\"];\nn107523441103470592[shape=rectangle, label=\"B381\"];\nn108367866033602560[shape=rectangle, label=\"B382\"];\nn108086391056891904[shape=rectangle, label=\"B383\"];\nn108930815987023872[shape=rectangle, label=\"B384\"];\nn115123265474658304[shape=rectangle, label=\"B385\"];\nn109493765940445184[shape=rectangle, label=\"B386\"];\nn109212290963734528[shape=rectangle, label=\"B387\"];\nn110056715893866496[shape=rectangle, label=\"B388\"];\nn110338190870577152[shape=rectangle, label=\"B389\"];\nn109775240917155840[shape=rectangle, label=\"B390\"];\nn110901140823998464[shape=rectangle, label=\"B391\"];\nn111464090777419776[shape=rectangle, label=\"B392\"];\nn111182615800709120[shape=rectangle, label=\"B393\"];\nn112027040730841088[shape=rectangle, label=\"B394\"];\nn111745565754130432[shape=rectangle, label=\"B395\"];\nn112589990684262400[shape=rectangle, label=\"B396\"];\nn110619665847287808[shape=rectangle, label=\"B397\"];\nn112308515707551744[shape=rectangle, label=\"B398\"];\nn113152940637683712[shape=rectangle, label=\"B399\"];\nn113434415614394368[shape=rectangle, label=\"B400\"];\nn113715890591105024[shape=rectangle, label=\"B401\"];\nn113997365567815680[shape=rectangle, label=\"B402\"];\nn112871465660973056[shape=rectangle, label=\"B403\"];\nn114841790497947648[shape=rectangle, label=\"B404\"];\nn115404740451368960[shape=rectangle, label=\"B405\"];\nn108649341010313216[shape=rectangle, label=\"B406\"];\nn115686215428079616[shape=rectangle, label=\"B407\"];\nn115967690404790272[shape=rectangle, label=\"B408\"];\nn65020719620161536[shape=rectangle, label=\"B409\"];\nn65583669573582848[shape=rectangle, label=\"B410\"];\nn116530640358211584[shape=rectangle, label=\"B411\"];\nn116812115334922240[shape=rectangle, label=\"B412\"];\nn117375065288343552[shape=rectangle, label=\"B413\"];\nn119908340078739456[shape=rectangle, label=\"B414\"];\nn117938015241764864[shape=rectangle, label=\"B415\"];\nn117093590311632896[shape=rectangle, label=\"B416\"];\nn118219490218475520[shape=rectangle, label=\"B417\"];\nn118782440171896832[shape=rectangle, label=\"B418\"];\nn118500965195186176[shape=rectangle, label=\"B419\"];\nn119063915148607488[shape=rectangle, label=\"B420\"];\nn119626865102028800[shape=rectangle, label=\"B421\"];\nn120189815055450112[shape=rectangle, label=\"B422\"];\nn119345390125318144[shape=rectangle, label=\"B423\"];\nn120471290032160768[shape=rectangle, label=\"B424\"];\nn116249165381500928[shape=rectangle, label=\"B425\"];\nn117656540265054208[shape=rectangle, label=\"B426\"];\nn121034239985582080[shape=rectangle, label=\"B427\"];\nn121597189939003392[shape=rectangle, label=\"B428\"];\nn120752765008871424[shape=rectangle, label=\"B429\"];\nn122441614869135360[shape=rectangle, label=\"B430\"];\nn121315714962292736[shape=rectangle, label=\"B431\"];\nn121878664915714048[shape=rectangle, label=\"B432\"];\nn122160139892424704[shape=rectangle, label=\"B433\"];\nn122723089845846016[shape=rectangle, label=\"B434\"];\nn114278840544526336[shape=rectangle, label=\"B435\"];\nn123004564822556672[shape=rectangle, label=\"B436\"];\nn114560315521236992[shape=rectangle, label=\"B437\"];\nn123286039799267328[shape=rectangle, label=\"B438\"];\nn123567514775977984[shape=rectangle, label=\"B439\"];\nn124130464729399296[shape=rectangle, label=\"B440\"];\nn124693414682820608[shape=rectangle, label=\"B441\"];\nn123848989752688640[shape=rectangle, label=\"B442\"];\nn125537839612952576[shape=rectangle, label=\"B443\"];\nn126100789566373888[shape=rectangle, label=\"B444\"];\nn126663739519795200[shape=rectangle, label=\"B445\"];\nn127226689473216512[shape=rectangle, label=\"B446\"];\nn126945214496505856[shape=rectangle, label=\"B447\"];\nn127789639426637824[shape=rectangle, label=\"B448\"];\nn124411939706109952[shape=rectangle, label=\"B449\"];\nn125256364636241920[shape=rectangle, label=\"B450\"];\nn128634064356769792[shape=rectangle, label=\"B451\"];\nn129197014310191104[shape=rectangle, label=\"B452\"];\nn129759964263612416[shape=rectangle, label=\"B453\"];\nn129478489286901760[shape=rectangle, label=\"B454\"];\nn125819314589663232[shape=rectangle, label=\"B455\"];\nn130604389193744384[shape=rectangle, label=\"B456\"];\nn130885864170455040[shape=rectangle, label=\"B457\"];\nn130322914217033728[shape=rectangle, label=\"B458\"];\nn131448814123876352[shape=rectangle, label=\"B459\"];\nn131730289100587008[shape=rectangle, label=\"B460\"];\nn131167339147165696[shape=rectangle, label=\"B461\"];\nn132293239054008320[shape=rectangle, label=\"B462\"];\nn132574714030718976[shape=rectangle, label=\"B463\"];\nn132011764077297664[shape=rectangle, label=\"B464\"];\nn133137663984140288[shape=rectangle, label=\"B465\"];\nn133419138960850944[shape=rectangle, label=\"B466\"];\nn132856189007429632[shape=rectangle, label=\"B467\"];\nn133982088914272256[shape=rectangle, label=\"B468\"];\nn134263563890982912[shape=rectangle, label=\"B469\"];\nn133700613937561600[shape=rectangle, label=\"B470\"];\nn134826513844404224[shape=rectangle, label=\"B471\"];\nn135107988821114880[shape=rectangle, label=\"B472\"];\nn134545038867693568[shape=rectangle, label=\"B473\"];\nn135670938774536192[shape=rectangle, label=\"B474\"];\nn135389463797825536[shape=rectangle, label=\"B475\"];\nn136233888727957504[shape=rectangle, label=\"B476\"];\nn135952413751246848[shape=rectangle, label=\"B477\"];\nn128352589380059136[shape=rectangle, label=\"B478\"];\nn137078313658089472[shape=rectangle, label=\"B479\"];\nn136796838681378816[shape=rectangle, label=\"B480\"];\nn128915539333480448[shape=rectangle, label=\"B481\"];\nn137641263611510784[shape=rectangle, label=\"B482\"];\nn137359788634800128[shape=rectangle, label=\"B483\"];\nn130041439240323072[shape=rectangle, label=\"B484\"];\nn136515363704668160[shape=rectangle, label=\"B485\"];\nn126382264543084544[shape=rectangle, label=\"B486\"];\nn138204213564932096[shape=rectangle, label=\"B487\"];\nn137922738588221440[shape=rectangle, label=\"B488\"];\nn138767163518353408[shape=rectangle, label=\"B489\"];\nn138485688541642752[shape=rectangle, label=\"B490\"];\nn127508164449927168[shape=rectangle, label=\"B491\"];\nn128071114403348480[shape=rectangle, label=\"B492\"];\nn139048638495064064[shape=rectangle, label=\"B493\"];\nn124974889659531264[shape=rectangle, label=\"B494\"];\nn139330113471774720[shape=rectangle, label=\"B495\"];\nn139611588448485376[shape=rectangle, label=\"B496\"];\nn140174538401906688[shape=rectangle, label=\"B497\"];\nn139893063425196032[shape=rectangle, label=\"B498\"];\nn140456013378617344[shape=rectangle, label=\"B499\"];\nn141018963332038656[shape=rectangle, label=\"B500\"];\nn140737488355328000[shape=rectangle, label=\"B501\"];\nn141581913285459968[shape=rectangle, label=\"B502\"];\nn141300438308749312[shape=rectangle, label=\"B503\"];\nn141863388262170624[shape=rectangle, label=\"B504\"];\nn142426338215591936[shape=rectangle, label=\"B505\"];\nn142989288169013248[shape=rectangle, label=\"B506\"];\nn143833713099145216[shape=rectangle, label=\"B507\"];\nn143552238122434560[shape=rectangle, label=\"B508\"];\nn144115188075855872[shape=rectangle, label=\"B509\"];\nn142144863238881280[shape=rectangle, label=\"B510\"];\nn144678138029277184[shape=rectangle, label=\"B511\"];\nn144396663052566528[shape=rectangle, label=\"B512\"];\nn144959613005987840[shape=rectangle, label=\"B513\"];\nn142707813192302592[shape=rectangle, label=\"B514\"];\nn146929937842962432[shape=rectangle, label=\"B515\"];\nn145522562959409152[shape=rectangle, label=\"B516\"];\nn146085512912830464[shape=rectangle, label=\"B517\"];\nn146366987889541120[shape=rectangle, label=\"B518\"];\nn145241087982698496[shape=rectangle, label=\"B519\"];\nn145804037936119808[shape=rectangle, label=\"B520\"];\nn146648462866251776[shape=rectangle, label=\"B521\"];\nn143270763145723904[shape=rectangle, label=\"B522\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn562949953421312 -> n844424930131968;\nn844424930131968 -> n281474976710656;\nn844424930131968 -> n1125899906842624;\nn1125899906842624 -> n281474976710656;\nn1125899906842624 -> n1407374883553280;\nn1407374883553280 -> n281474976710656;\nn1407374883553280 -> n1688849860263936;\nn1688849860263936 -> n281474976710656;\nn1688849860263936 -> n1970324836974592;\nn1970324836974592 -> n281474976710656;\nn1970324836974592 -> n2251799813685248;\nn2251799813685248 -> n281474976710656;\nn2251799813685248 -> n2533274790395904;\nn2533274790395904 -> n281474976710656;\nn2533274790395904 -> n2814749767106560;\nn2814749767106560 -> n281474976710656;\nn2814749767106560 -> n3096224743817216;\nn3096224743817216 -> n281474976710656;\nn3096224743817216 -> n3377699720527872;\nn3377699720527872 -> n281474976710656;\nn3377699720527872 -> n3659174697238528;\nn3659174697238528 -> n281474976710656;\nn3659174697238528 -> n3940649673949184;\nn3940649673949184 -> n281474976710656;\nn3940649673949184 -> n4222124650659840;\nn4222124650659840 -> n281474976710656;\nn4222124650659840 -> n4503599627370496;\nn4503599627370496 -> n281474976710656;\nn4503599627370496 -> n4785074604081152;\nn4785074604081152 -> n281474976710656;\nn4785074604081152 -> n5066549580791808;\nn5066549580791808 -> n281474976710656;\nn5066549580791808 -> n5348024557502464;\nn5348024557502464 -> n281474976710656;\nn5348024557502464 -> n5629499534213120;\nn5629499534213120 -> n281474976710656;\nn5629499534213120 -> n5910974510923776;\nn5910974510923776 -> n281474976710656;\nn5910974510923776 -> n6192449487634432;\nn6192449487634432 -> n281474976710656;\nn6192449487634432 -> n6473924464345088;\nn6473924464345088 -> n281474976710656;\nn6473924464345088 -> n6755399441055744;\nn6755399441055744 -> n281474976710656;\nn6755399441055744 -> n7036874417766400;\nn7036874417766400 -> n281474976710656;\nn7036874417766400 -> n7318349394477056;\nn7318349394477056 -> n281474976710656;\nn7318349394477056 -> n7599824371187712;\nn7599824371187712 -> n281474976710656;\nn7599824371187712 -> n7881299347898368;\nn7881299347898368 -> n281474976710656;\nn7881299347898368 -> n8162774324609024;\nn8162774324609024 -> n281474976710656;\nn8162774324609024 -> n8444249301319680;\nn8444249301319680 -> n281474976710656;\nn8444249301319680 -> n8725724278030336;\nn8725724278030336 -> n281474976710656;\nn8725724278030336 -> n9007199254740992;\nn9007199254740992 -> n281474976710656;\nn9007199254740992 -> n9288674231451648;\nn9288674231451648 -> n281474976710656;\nn9288674231451648 -> n9570149208162304;\nn9570149208162304 -> n281474976710656;\nn9570149208162304 -> n9851624184872960;\nn9851624184872960 -> n281474976710656;\nn9851624184872960 -> n10133099161583616;\nn10133099161583616 -> n281474976710656;\nn10133099161583616 -> n10414574138294272;\nn10414574138294272 -> n281474976710656;\nn10414574138294272 -> n10696049115004928;\nn10696049115004928 -> n281474976710656;\nn10696049115004928 -> n10977524091715584;\nn10977524091715584 -> n281474976710656;\nn10977524091715584 -> n11258999068426240;\nn11258999068426240 -> n281474976710656;\nn11258999068426240 -> n11540474045136896;\nn11540474045136896 -> n281474976710656;\nn11540474045136896 -> n11821949021847552;\nn11821949021847552 -> n281474976710656;\nn11821949021847552 -> n12103423998558208;\nn12103423998558208 -> n281474976710656;\nn12103423998558208 -> n12384898975268864;\nn12384898975268864 -> n281474976710656;\nn12384898975268864 -> n12666373951979520;\nn12666373951979520 -> n281474976710656;\nn12666373951979520 -> n12947848928690176;\nn281474976710656 -> n13229323905400832;\nn13229323905400832 -> n13229323905400832[style=dashed];\nn13229323905400832 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n14355223812243456;\nn14636698788954112 -> n13792273858822144;\nn13792273858822144 -> n14918173765664768;\nn15199648742375424 -> n15481123719086080;\nn15199648742375424 -> n14918173765664768;\nn14918173765664768 -> n15762598695796736;\nn14918173765664768 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn16044073672507392 -> n16607023625928704;\nn16607023625928704 -> n16325548649218048;\nn16325548649218048 -> n16888498602639360;\nn16325548649218048 -> n17169973579350016;\nn17169973579350016 -> n16888498602639360;\nn16888498602639360 -> n17451448556060672;\nn16888498602639360 -> n17732923532771328;\nn17732923532771328 -> n18014398509481984;\nn15762598695796736 -> n18014398509481984;\nn15762598695796736 -> n17451448556060672;\nn17451448556060672 -> n18014398509481984;\nn17451448556060672 -> n18295873486192640;\nn18295873486192640 -> n18014398509481984;\nn18295873486192640 -> n18577348462903296;\nn18577348462903296 -> n18014398509481984;\nn18577348462903296 -> n18858823439613952;\nn18858823439613952 -> n18014398509481984;\nn18858823439613952 -> n19140298416324608;\nn19140298416324608 -> n18014398509481984;\nn19140298416324608 -> n19421773393035264;\nn19421773393035264 -> n25332747903959040;\nn25332747903959040 -> n19703248369745920;\nn18014398509481984 -> n19984723346456576;\nn18014398509481984 -> n20266198323167232;\nn20266198323167232 -> n20547673299877888;\nn20266198323167232 -> n20829148276588544;\nn20829148276588544 -> n21110623253299200;\nn20547673299877888 -> n21392098230009856;\nn20547673299877888 -> n21673573206720512;\nn21673573206720512 -> n21955048183431168;\nn21673573206720512 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn21955048183431168 -> n22517998136852480;\nn21955048183431168 -> n22799473113563136;\nn22799473113563136 -> n22517998136852480;\nn22517998136852480 -> n23080948090273792;\nn22517998136852480 -> n23362423066984448;\nn23362423066984448 -> n23643898043695104;\nn21392098230009856 -> n23643898043695104;\nn21392098230009856 -> n23080948090273792;\nn23080948090273792 -> n23643898043695104;\nn23080948090273792 -> n23925373020405760;\nn23925373020405760 -> n23643898043695104;\nn23925373020405760 -> n24206847997116416;\nn24206847997116416 -> n23643898043695104;\nn24206847997116416 -> n24488322973827072;\nn24488322973827072 -> n23643898043695104;\nn24488322973827072 -> n24769797950537728;\nn24769797950537728 -> n23643898043695104;\nn24769797950537728 -> n25051272927248384;\nn25051272927248384 -> n25332747903959040;\nn23643898043695104 -> n19984723346456576;\nn23643898043695104 -> n25614222880669696;\nn25614222880669696 -> n19703248369745920;\nn19984723346456576 -> n21110623253299200;\nn21110623253299200 -> n19703248369745920;\nn19703248369745920 -> n15199648742375424[style=dashed];\nn19703248369745920 -> n25895697857380352;\nn25895697857380352 -> n15199648742375424;\nn14355223812243456 -> n26177172834091008;\nn14355223812243456 -> n26458647810801664;\nn26458647810801664 -> n26740122787512320;\nn26458647810801664 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn26740122787512320 -> n27303072740933632;\nn26740122787512320 -> n27584547717644288;\nn27584547717644288 -> n27303072740933632;\nn27303072740933632 -> n27866022694354944;\nn26177172834091008 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn27866022694354944 -> n28428972647776256;\nn28428972647776256 -> n28147497671065600;\nn28428972647776256 -> n28710447624486912;\nn28710447624486912 -> n28147497671065600;\nn28710447624486912 -> n28991922601197568;\nn28991922601197568 -> n28147497671065600;\nn28991922601197568 -> n29273397577908224;\nn29273397577908224 -> n28147497671065600;\nn29273397577908224 -> n29554872554618880;\nn29554872554618880 -> n28147497671065600;\nn29554872554618880 -> n29836347531329536;\nn29836347531329536 -> n30117822508040192;\nn29836347531329536 -> n30399297484750848;\nn30399297484750848 -> n30680772461461504;\nn28147497671065600 -> n30962247438172160;\nn28147497671065600 -> n31243722414882816;\nn31243722414882816 -> n15481123719086080;\nn15481123719086080 -> n30680772461461504;\nn15481123719086080 -> n30117822508040192;\nn30117822508040192 -> n30680772461461504;\nn30117822508040192 -> n31525197391593472;\nn31525197391593472 -> n60798594969501696;\nn60798594969501696 -> n31806672368304128;\nn60798594969501696 -> n32088147345014784;\nn32088147345014784 -> n32369622321725440;\nn31806672368304128 -> n32651097298436096;\nn31806672368304128 -> n32932572275146752;\nn32932572275146752 -> n32369622321725440;\nn32651097298436096 -> n33214047251857408;\nn32651097298436096 -> n33495522228568064;\nn33495522228568064 -> n32369622321725440;\nn33214047251857408 -> n33776997205278720;\nn33214047251857408 -> n34058472181989376;\nn34058472181989376 -> n32369622321725440;\nn33776997205278720 -> n32369622321725440;\nn32369622321725440 -> n34339947158700032;\nn32369622321725440 -> n34621422135410688;\nn34621422135410688 -> n34339947158700032;\nn34339947158700032 -> n34902897112121344;\nn34339947158700032 -> n35184372088832000;\nn35184372088832000 -> n35465847065542656;\nn34902897112121344 -> n35465847065542656;\nn34902897112121344 -> n35747322042253312;\nn35747322042253312 -> n36028797018963968;\nn36028797018963968 -> n36028797018963968[style=dashed];\nn36028797018963968 -> n35465847065542656;\nn35465847065542656 -> n36310271995674624;\nn35465847065542656 -> n36591746972385280;\nn36591746972385280 -> n36873221949095936;\nn36310271995674624 -> n36873221949095936;\nn36310271995674624 -> n37154696925806592;\nn37154696925806592 -> n37436171902517248;\nn37436171902517248 -> n37436171902517248[style=dashed];\nn37436171902517248 -> n36873221949095936;\nn36873221949095936 -> n37717646879227904;\nn36873221949095936 -> n37999121855938560;\nn37999121855938560 -> n38280596832649216;\nn37717646879227904 -> n38280596832649216;\nn37717646879227904 -> n38562071809359872;\nn38562071809359872 -> n38843546786070528;\nn38843546786070528 -> n38843546786070528[style=dashed];\nn38843546786070528 -> n38280596832649216;\nn38280596832649216 -> n39125021762781184;\nn38280596832649216 -> n39406496739491840;\nn39406496739491840 -> n39687971716202496;\nn39125021762781184 -> n39687971716202496;\nn39125021762781184 -> n39969446692913152;\nn39969446692913152 -> n40250921669623808;\nn40250921669623808 -> n40250921669623808[style=dashed];\nn40250921669623808 -> n39687971716202496;\nn39687971716202496 -> n40532396646334464;\nn39687971716202496 -> n40813871623045120;\nn40813871623045120 -> n41095346599755776;\nn40532396646334464 -> n41095346599755776;\nn40532396646334464 -> n41376821576466432;\nn41376821576466432 -> n41658296553177088;\nn41658296553177088 -> n41658296553177088[style=dashed];\nn41658296553177088 -> n41095346599755776;\nn41095346599755776 -> n41939771529887744;\nn41095346599755776 -> n42221246506598400;\nn42221246506598400 -> n42502721483309056;\nn41939771529887744 -> n42502721483309056;\nn41939771529887744 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn43065671436730368 -> n43065671436730368[style=dashed];\nn43065671436730368 -> n42502721483309056;\nn42502721483309056 -> n43347146413441024;\nn42502721483309056 -> n43628621390151680;\nn43628621390151680 -> n43910096366862336;\nn43347146413441024 -> n43910096366862336;\nn43347146413441024 -> n44191571343572992;\nn44191571343572992 -> n44473046320283648;\nn44473046320283648 -> n44473046320283648[style=dashed];\nn44473046320283648 -> n43910096366862336;\nn43910096366862336 -> n44754521296994304;\nn43910096366862336 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn44754521296994304 -> n45317471250415616;\nn44754521296994304 -> n45598946227126272;\nn45598946227126272 -> n45880421203836928;\nn45880421203836928 -> n45880421203836928[style=dashed];\nn45880421203836928 -> n45317471250415616;\nn45317471250415616 -> n46161896180547584;\nn45317471250415616 -> n46443371157258240;\nn46443371157258240 -> n46724846133968896;\nn46161896180547584 -> n46724846133968896;\nn46161896180547584 -> n47006321110679552;\nn47006321110679552 -> n47287796087390208;\nn47287796087390208 -> n47287796087390208[style=dashed];\nn47287796087390208 -> n46724846133968896;\nn46724846133968896 -> n47569271064100864;\nn46724846133968896 -> n47850746040811520;\nn47850746040811520 -> n48132221017522176;\nn47569271064100864 -> n48132221017522176;\nn47569271064100864 -> n48413695994232832;\nn48413695994232832 -> n48695170970943488;\nn48695170970943488 -> n48695170970943488[style=dashed];\nn48695170970943488 -> n48132221017522176;\nn48132221017522176 -> n48976645947654144;\nn48132221017522176 -> n49258120924364800;\nn49258120924364800 -> n49539595901075456;\nn48976645947654144 -> n49539595901075456;\nn48976645947654144 -> n49821070877786112;\nn49821070877786112 -> n50102545854496768;\nn50102545854496768 -> n50102545854496768[style=dashed];\nn50102545854496768 -> n49539595901075456;\nn49539595901075456 -> n50384020831207424;\nn49539595901075456 -> n50665495807918080;\nn50665495807918080 -> n50946970784628736;\nn50384020831207424 -> n50946970784628736;\nn50384020831207424 -> n51228445761339392;\nn51228445761339392 -> n51509920738050048;\nn51509920738050048 -> n51509920738050048[style=dashed];\nn51509920738050048 -> n50946970784628736;\nn50946970784628736 -> n51791395714760704;\nn50946970784628736 -> n52072870691471360;\nn52072870691471360 -> n52354345668182016;\nn51791395714760704 -> n52354345668182016;\nn51791395714760704 -> n52635820644892672;\nn52635820644892672 -> n52917295621603328;\nn52917295621603328 -> n52917295621603328[style=dashed];\nn52917295621603328 -> n52354345668182016;\nn52354345668182016 -> n53198770598313984;\nn52354345668182016 -> n53480245575024640;\nn53480245575024640 -> n53761720551735296;\nn53198770598313984 -> n53761720551735296;\nn53198770598313984 -> n54043195528445952;\nn54043195528445952 -> n54324670505156608;\nn54324670505156608 -> n54324670505156608[style=dashed];\nn54324670505156608 -> n53761720551735296;\nn53761720551735296 -> n54606145481867264;\nn54887620458577920 -> n55169095435288576;\nn54887620458577920 -> n54606145481867264;\nn54606145481867264 -> n55450570411999232;\nn54606145481867264 -> n55732045388709888;\nn55732045388709888 -> n56013520365420544;\nn55732045388709888 -> n56294995342131200;\nn56294995342131200 -> n56576470318841856;\nn56294995342131200 -> n56857945295552512;\nn56857945295552512 -> n56576470318841856;\nn56857945295552512 -> n57139420272263168;\nn57139420272263168 -> n57420895248973824;\nn55450570411999232 -> n56294995342131200;\nn55450570411999232 -> n56013520365420544;\nn56013520365420544 -> n56576470318841856;\nn56013520365420544 -> n57702370225684480;\nn57702370225684480 -> n57420895248973824;\nn57702370225684480 -> n56576470318841856;\nn56576470318841856 -> n59391220085948416;\nn59391220085948416 -> n54887620458577920[style=dashed];\nn59391220085948416 -> n57983845202395136;\nn57983845202395136 -> n54887620458577920;\nn57420895248973824 -> n58265320179105792;\nn57420895248973824 -> n58546795155816448;\nn58546795155816448 -> n58265320179105792;\nn58265320179105792 -> n58828270132527104;\nn58265320179105792 -> n59109745109237760;\nn59109745109237760 -> n58828270132527104;\nn58828270132527104 -> n59391220085948416;\nn55169095435288576 -> n59672695062659072;\nn55169095435288576 -> n59954170039369728;\nn59954170039369728 -> n60235645016080384;\nn59954170039369728 -> n60517119992791040;\nn60517119992791040 -> n60798594969501696;\nn60517119992791040 -> n61080069946212352;\nn61080069946212352 -> n60235645016080384;\nn59672695062659072 -> n60235645016080384;\nn30962247438172160 -> n61361544922923008;\nn30962247438172160 -> n61643019899633664;\nn61643019899633664 -> n61924494876344320;\nn61643019899633664 -> n62205969853054976;\nn62205969853054976 -> n61924494876344320;\nn61924494876344320 -> n62487444829765632;\nn61924494876344320 -> n62768919806476288;\nn62768919806476288 -> n62487444829765632;\nn62487444829765632 -> n63050394783186944;\nn61361544922923008 -> n63050394783186944;\nn63050394783186944 -> n63331869759897600;\nn63050394783186944 -> n63613344736608256;\nn63613344736608256 -> n63331869759897600;\nn63613344736608256 -> n63894819713318912;\nn63894819713318912 -> n63331869759897600;\nn63894819713318912 -> n64176294690029568;\nn64176294690029568 -> n63331869759897600;\nn64176294690029568 -> n64457769666740224;\nn64457769666740224 -> n63331869759897600;\nn64457769666740224 -> n64739244643450880;\nn64739244643450880 -> n29836347531329536;\nn64739244643450880 -> n63331869759897600;\nn63331869759897600 -> n30117822508040192;\nn63331869759897600 -> n30680772461461504;\nn30680772461461504 -> n60235645016080384;\nn60235645016080384 -> n65020719620161536;\nn60235645016080384 -> n65302194596872192;\nn65302194596872192 -> n65583669573582848;\nn65302194596872192 -> n65865144550293504;\nn65865144550293504 -> n66146619527004160;\nn65865144550293504 -> n66428094503714816;\nn66428094503714816 -> n66709569480425472;\nn66428094503714816 -> n66991044457136128;\nn66991044457136128 -> n72902018968059904;\nn72902018968059904 -> n67272519433846784;\nn67553994410557440 -> n67835469387268096;\nn67553994410557440 -> n67272519433846784;\nn67272519433846784 -> n67553994410557440[style=dashed];\nn67272519433846784 -> n68116944363978752;\nn68116944363978752 -> n67553994410557440;\nn67835469387268096 -> n68398419340689408;\nn67835469387268096 -> n68679894317400064;\nn68679894317400064 -> n68961369294110720;\nn68679894317400064 -> n69242844270821376;\nn69242844270821376 -> n68961369294110720;\nn68961369294110720 -> n69524319247532032;\nn68961369294110720 -> n69805794224242688;\nn69805794224242688 -> n69524319247532032;\nn69524319247532032 -> n70087269200953344;\nn69524319247532032 -> n70368744177664000;\nn70368744177664000 -> n70650219154374656;\nn68398419340689408 -> n70650219154374656;\nn68398419340689408 -> n70087269200953344;\nn70087269200953344 -> n70650219154374656;\nn70087269200953344 -> n70931694131085312;\nn70931694131085312 -> n70650219154374656;\nn70931694131085312 -> n71213169107795968;\nn71213169107795968 -> n70650219154374656;\nn71213169107795968 -> n71494644084506624;\nn71494644084506624 -> n70650219154374656;\nn71494644084506624 -> n71776119061217280;\nn71776119061217280 -> n72057594037927936;\nn71776119061217280 -> n70650219154374656;\nn70650219154374656 -> n72339069014638592;\nn70650219154374656 -> n72620543991349248;\nn72620543991349248 -> n72902018968059904;\nn72620543991349248 -> n73183493944770560;\nn73183493944770560 -> n73464968921481216;\nn73183493944770560 -> n73746443898191872;\nn73746443898191872 -> n74027918874902528;\nn73746443898191872 -> n74309393851613184;\nn74309393851613184 -> n74027918874902528;\nn74309393851613184 -> n74590868828323840;\nn74590868828323840 -> n74872343805034496;\nn74590868828323840 -> n75153818781745152;\nn75153818781745152 -> n75435293758455808;\nn66709569480425472 -> n75716768735166464;\nn72057594037927936 -> n73746443898191872;\nn72057594037927936 -> n73464968921481216;\nn73464968921481216 -> n75998243711877120;\nn72339069014638592 -> n73746443898191872;\nn72339069014638592 -> n76279718688587776;\nn76279718688587776 -> n73464968921481216;\nn74027918874902528 -> n75716768735166464;\nn74872343805034496 -> n76561193665298432;\nn74872343805034496 -> n76842668642009088;\nn76842668642009088 -> n75435293758455808;\nn76561193665298432 -> n77124143618719744;\nn76561193665298432 -> n77405618595430400;\nn77405618595430400 -> n75435293758455808;\nn77124143618719744 -> n75435293758455808;\nn75435293758455808 -> n77687093572141056;\nn75435293758455808 -> n77968568548851712;\nn77968568548851712 -> n77687093572141056;\nn77687093572141056 -> n78250043525562368;\nn77687093572141056 -> n78531518502273024;\nn78531518502273024 -> n78812993478983680;\nn78250043525562368 -> n78812993478983680;\nn78250043525562368 -> n79094468455694336;\nn79094468455694336 -> n79094468455694336[style=dashed];\nn79094468455694336 -> n78812993478983680;\nn78812993478983680 -> n79375943432404992;\nn78812993478983680 -> n79657418409115648;\nn79657418409115648 -> n79938893385826304;\nn79375943432404992 -> n79938893385826304;\nn79375943432404992 -> n80220368362536960;\nn80220368362536960 -> n80220368362536960[style=dashed];\nn80220368362536960 -> n79938893385826304;\nn79938893385826304 -> n80501843339247616;\nn79938893385826304 -> n80783318315958272;\nn80783318315958272 -> n81064793292668928;\nn80501843339247616 -> n81064793292668928;\nn80501843339247616 -> n81346268269379584;\nn81346268269379584 -> n81346268269379584[style=dashed];\nn81346268269379584 -> n81064793292668928;\nn81064793292668928 -> n81627743246090240;\nn81064793292668928 -> n81909218222800896;\nn81909218222800896 -> n82190693199511552;\nn81627743246090240 -> n82190693199511552;\nn81627743246090240 -> n82472168176222208;\nn82472168176222208 -> n82472168176222208[style=dashed];\nn82472168176222208 -> n82190693199511552;\nn82190693199511552 -> n82753643152932864;\nn82190693199511552 -> n83035118129643520;\nn83035118129643520 -> n83316593106354176;\nn82753643152932864 -> n83316593106354176;\nn82753643152932864 -> n83598068083064832;\nn83598068083064832 -> n83598068083064832[style=dashed];\nn83598068083064832 -> n83316593106354176;\nn83316593106354176 -> n83879543059775488;\nn83316593106354176 -> n84161018036486144;\nn84161018036486144 -> n84442493013196800;\nn83879543059775488 -> n84442493013196800;\nn83879543059775488 -> n84723967989907456;\nn84723967989907456 -> n84723967989907456[style=dashed];\nn84723967989907456 -> n84442493013196800;\nn84442493013196800 -> n85005442966618112;\nn84442493013196800 -> n85286917943328768;\nn85286917943328768 -> n85568392920039424;\nn85005442966618112 -> n85568392920039424;\nn85005442966618112 -> n85849867896750080;\nn85849867896750080 -> n85849867896750080[style=dashed];\nn85849867896750080 -> n85568392920039424;\nn85568392920039424 -> n86131342873460736;\nn85568392920039424 -> n86412817850171392;\nn86412817850171392 -> n86694292826882048;\nn86131342873460736 -> n86694292826882048;\nn86131342873460736 -> n86975767803592704;\nn86975767803592704 -> n86975767803592704[style=dashed];\nn86975767803592704 -> n86694292826882048;\nn86694292826882048 -> n87257242780303360;\nn86694292826882048 -> n87538717757014016;\nn87538717757014016 -> n87820192733724672;\nn87257242780303360 -> n87820192733724672;\nn87257242780303360 -> n88101667710435328;\nn88101667710435328 -> n88101667710435328[style=dashed];\nn88101667710435328 -> n87820192733724672;\nn87820192733724672 -> n88383142687145984;\nn87820192733724672 -> n88664617663856640;\nn88664617663856640 -> n88946092640567296;\nn88383142687145984 -> n88946092640567296;\nn88383142687145984 -> n89227567617277952;\nn89227567617277952 -> n89227567617277952[style=dashed];\nn89227567617277952 -> n88946092640567296;\nn88946092640567296 -> n89509042593988608;\nn88946092640567296 -> n89790517570699264;\nn89790517570699264 -> n90071992547409920;\nn89509042593988608 -> n90071992547409920;\nn89509042593988608 -> n90353467524120576;\nn90353467524120576 -> n90353467524120576[style=dashed];\nn90353467524120576 -> n90071992547409920;\nn90071992547409920 -> n90634942500831232;\nn90071992547409920 -> n90916417477541888;\nn90916417477541888 -> n91197892454252544;\nn90634942500831232 -> n91197892454252544;\nn90634942500831232 -> n91479367430963200;\nn91479367430963200 -> n91479367430963200[style=dashed];\nn91479367430963200 -> n91197892454252544;\nn91197892454252544 -> n91760842407673856;\nn91197892454252544 -> n92042317384384512;\nn92042317384384512 -> n92323792361095168;\nn91760842407673856 -> n92323792361095168;\nn91760842407673856 -> n92605267337805824;\nn92605267337805824 -> n92605267337805824[style=dashed];\nn92605267337805824 -> n92323792361095168;\nn92323792361095168 -> n92886742314516480;\nn92323792361095168 -> n93168217291227136;\nn93168217291227136 -> n93449692267937792;\nn92886742314516480 -> n93449692267937792;\nn92886742314516480 -> n93731167244648448;\nn93731167244648448 -> n94012642221359104;\nn94012642221359104 -> n94012642221359104[style=dashed];\nn94012642221359104 -> n94294117198069760;\nn94294117198069760 -> n94575592174780416;\nn93449692267937792 -> n94575592174780416;\nn94575592174780416 -> n94857067151491072;\nn94575592174780416 -> n95138542128201728;\nn95138542128201728 -> n95420017104912384;\nn95701492081623040 -> n95982967058333696;\nn95701492081623040 -> n95420017104912384;\nn95420017104912384 -> n96264442035044352;\nn95420017104912384 -> n96545917011755008;\nn96545917011755008 -> n96827391988465664;\nn96545917011755008 -> n97108866965176320;\nn97108866965176320 -> n97390341941886976;\nn96264442035044352 -> n97390341941886976;\nn96264442035044352 -> n96827391988465664;\nn96827391988465664 -> n97390341941886976;\nn96827391988465664 -> n97671816918597632;\nn97671816918597632 -> n97953291895308288;\nn97671816918597632 -> n97390341941886976;\nn97390341941886976 -> n98234766872018944;\nn97953291895308288 -> n98516241848729600;\nn97953291895308288 -> n98797716825440256;\nn98797716825440256 -> n98516241848729600;\nn98516241848729600 -> n99079191802150912;\nn98516241848729600 -> n99360666778861568;\nn99360666778861568 -> n99079191802150912;\nn99079191802150912 -> n98234766872018944;\nn98234766872018944 -> n95701492081623040[style=dashed];\nn98234766872018944 -> n99642141755572224;\nn99642141755572224 -> n95701492081623040;\nn94857067151491072 -> n95982967058333696;\nn95982967058333696 -> n75998243711877120;\nn75998243711877120 -> n75716768735166464;\nn75716768735166464 -> n66146619527004160;\nn75716768735166464 -> n99923616732282880;\nn99923616732282880 -> n66146619527004160;\nn66146619527004160 -> n65583669573582848;\nn66146619527004160 -> n100205091708993536;\nn100205091708993536 -> n65583669573582848;\nn100205091708993536 -> n100486566685704192;\nn100486566685704192 -> n100768041662414848;\nn101049516639125504 -> n101330991615836160;\nn101049516639125504 -> n100768041662414848;\nn100768041662414848 -> n101049516639125504[style=dashed];\nn100768041662414848 -> n101612466592546816;\nn101612466592546816 -> n101049516639125504;\nn101330991615836160 -> n65583669573582848;\nn101330991615836160 -> n101893941569257472;\nn101893941569257472 -> n102175416545968128;\nn101893941569257472 -> n102456891522678784;\nn102456891522678784 -> n102175416545968128;\nn102175416545968128 -> n102738366499389440;\nn102175416545968128 -> n103019841476100096;\nn103019841476100096 -> n102738366499389440;\nn102738366499389440 -> n103301316452810752;\nn102738366499389440 -> n103582791429521408;\nn103582791429521408 -> n103301316452810752;\nn103301316452810752 -> n103864266406232064;\nn103301316452810752 -> n104145741382942720;\nn104145741382942720 -> n103864266406232064;\nn103864266406232064 -> n104427216359653376;\nn103864266406232064 -> n104708691336364032;\nn104708691336364032 -> n104427216359653376;\nn104427216359653376 -> n104990166313074688;\nn104427216359653376 -> n105271641289785344;\nn105271641289785344 -> n104990166313074688;\nn104990166313074688 -> n105553116266496000;\nn104990166313074688 -> n105834591243206656;\nn105834591243206656 -> n105553116266496000;\nn105553116266496000 -> n106116066219917312;\nn105553116266496000 -> n106397541196627968;\nn106397541196627968 -> n106116066219917312;\nn106116066219917312 -> n106679016173338624;\nn106116066219917312 -> n106960491150049280;\nn106960491150049280 -> n107241966126759936;\nn106679016173338624 -> n107241966126759936;\nn107241966126759936 -> n107523441103470592;\nn107804916080181248 -> n108086391056891904;\nn107804916080181248 -> n107523441103470592;\nn107523441103470592 -> n107804916080181248[style=dashed];\nn107523441103470592 -> n108367866033602560;\nn108367866033602560 -> n107804916080181248;\nn108086391056891904 -> n108649341010313216;\nn108086391056891904 -> n108930815987023872;\nn108930815987023872 -> n115123265474658304;\nn115123265474658304 -> n109212290963734528;\nn109493765940445184 -> n109775240917155840;\nn109493765940445184 -> n109212290963734528;\nn109212290963734528 -> n109493765940445184[style=dashed];\nn109212290963734528 -> n110056715893866496;\nn110056715893866496 -> n109493765940445184;\nn110056715893866496 -> n110338190870577152;\nn110338190870577152 -> n109493765940445184;\nn109775240917155840 -> n110619665847287808;\nn109775240917155840 -> n110901140823998464;\nn110901140823998464 -> n111182615800709120;\nn110901140823998464 -> n111464090777419776;\nn111464090777419776 -> n111182615800709120;\nn111182615800709120 -> n111745565754130432;\nn111182615800709120 -> n112027040730841088;\nn112027040730841088 -> n111745565754130432;\nn111745565754130432 -> n112308515707551744;\nn111745565754130432 -> n112589990684262400;\nn112589990684262400 -> n112871465660973056;\nn110619665847287808 -> n112871465660973056;\nn110619665847287808 -> n112308515707551744;\nn112308515707551744 -> n112871465660973056;\nn112308515707551744 -> n113152940637683712;\nn113152940637683712 -> n112871465660973056;\nn113152940637683712 -> n113434415614394368;\nn113434415614394368 -> n112871465660973056;\nn113434415614394368 -> n113715890591105024;\nn113715890591105024 -> n112871465660973056;\nn113715890591105024 -> n113997365567815680;\nn113997365567815680 -> n114278840544526336;\nn113997365567815680 -> n112871465660973056;\nn112871465660973056 -> n114560315521236992;\nn112871465660973056 -> n114841790497947648;\nn114841790497947648 -> n115123265474658304;\nn114841790497947648 -> n115404740451368960;\nn115404740451368960 -> n115686215428079616;\nn108649341010313216 -> n115686215428079616;\nn115686215428079616 -> n65020719620161536;\nn115686215428079616 -> n115967690404790272;\nn115967690404790272 -> n65020719620161536;\nn65020719620161536 -> n65583669573582848;\nn65583669573582848 -> n116249165381500928;\nn65583669573582848 -> n116530640358211584;\nn116530640358211584 -> n116249165381500928;\nn116530640358211584 -> n116812115334922240;\nn116812115334922240 -> n117093590311632896;\nn117375065288343552 -> n119908340078739456;\nn119908340078739456 -> n117656540265054208;\nn119908340078739456 -> n117938015241764864;\nn117938015241764864 -> n117656540265054208;\nn117938015241764864 -> n117093590311632896;\nn117093590311632896 -> n117938015241764864[style=dashed];\nn117093590311632896 -> n118219490218475520;\nn118219490218475520 -> n118500965195186176;\nn118219490218475520 -> n118782440171896832;\nn118782440171896832 -> n119063915148607488;\nn118500965195186176 -> n119063915148607488;\nn119063915148607488 -> n119345390125318144;\nn119063915148607488 -> n119626865102028800;\nn119626865102028800 -> n119908340078739456;\nn119626865102028800 -> n120189815055450112;\nn120189815055450112 -> n117375065288343552;\nn119345390125318144 -> n119908340078739456;\nn119345390125318144 -> n120471290032160768;\nn120471290032160768 -> n117375065288343552;\nn116249165381500928 -> n117656540265054208;\nn117656540265054208 -> n120752765008871424;\nn117656540265054208 -> n121034239985582080;\nn121034239985582080 -> n121315714962292736;\nn121034239985582080 -> n121597189939003392;\nn121597189939003392 -> n121878664915714048;\nn120752765008871424 -> n122160139892424704;\nn120752765008871424 -> n122441614869135360;\nn122441614869135360 -> n122723089845846016;\nn121315714962292736 -> n121878664915714048;\nn121878664915714048 -> n122723089845846016;\nn122160139892424704 -> n122723089845846016;\nn114278840544526336 -> n115967690404790272;\nn114278840544526336 -> n123004564822556672;\nn123004564822556672 -> n65020719620161536;\nn114560315521236992 -> n115967690404790272;\nn114560315521236992 -> n123286039799267328;\nn123286039799267328 -> n65020719620161536;\nn123567514775977984 -> n123848989752688640;\nn123567514775977984 -> n124130464729399296;\nn124130464729399296 -> n124411939706109952;\nn124130464729399296 -> n124693414682820608;\nn124693414682820608 -> n124974889659531264;\nn123848989752688640 -> n125256364636241920;\nn123848989752688640 -> n125537839612952576;\nn125537839612952576 -> n125819314589663232;\nn125537839612952576 -> n126100789566373888;\nn126100789566373888 -> n126382264543084544;\nn126100789566373888 -> n126663739519795200;\nn126663739519795200 -> n126945214496505856;\nn126663739519795200 -> n127226689473216512;\nn127226689473216512 -> n126945214496505856;\nn126945214496505856 -> n127508164449927168;\nn126945214496505856 -> n127789639426637824;\nn127789639426637824 -> n128071114403348480;\nn124411939706109952 -> n124974889659531264;\nn125256364636241920 -> n128352589380059136;\nn125256364636241920 -> n128634064356769792;\nn128634064356769792 -> n128915539333480448;\nn128634064356769792 -> n129197014310191104;\nn129197014310191104 -> n129478489286901760;\nn129197014310191104 -> n129759964263612416;\nn129759964263612416 -> n129478489286901760;\nn129478489286901760 -> n130041439240323072;\nn125819314589663232 -> n130322914217033728;\nn125819314589663232 -> n130604389193744384;\nn130604389193744384 -> n130322914217033728;\nn130604389193744384 -> n130885864170455040;\nn130885864170455040 -> n130322914217033728;\nn130322914217033728 -> n131167339147165696;\nn130322914217033728 -> n131448814123876352;\nn131448814123876352 -> n131167339147165696;\nn131448814123876352 -> n131730289100587008;\nn131730289100587008 -> n131167339147165696;\nn131167339147165696 -> n132011764077297664;\nn131167339147165696 -> n132293239054008320;\nn132293239054008320 -> n132011764077297664;\nn132293239054008320 -> n132574714030718976;\nn132574714030718976 -> n132011764077297664;\nn132011764077297664 -> n132856189007429632;\nn132011764077297664 -> n133137663984140288;\nn133137663984140288 -> n132856189007429632;\nn133137663984140288 -> n133419138960850944;\nn133419138960850944 -> n132856189007429632;\nn132856189007429632 -> n133700613937561600;\nn132856189007429632 -> n133982088914272256;\nn133982088914272256 -> n133700613937561600;\nn133982088914272256 -> n134263563890982912;\nn134263563890982912 -> n133700613937561600;\nn133700613937561600 -> n134545038867693568;\nn133700613937561600 -> n134826513844404224;\nn134826513844404224 -> n134545038867693568;\nn134826513844404224 -> n135107988821114880;\nn135107988821114880 -> n134545038867693568;\nn134545038867693568 -> n135389463797825536;\nn134545038867693568 -> n135670938774536192;\nn135670938774536192 -> n135389463797825536;\nn135389463797825536 -> n135952413751246848;\nn135389463797825536 -> n136233888727957504;\nn136233888727957504 -> n135952413751246848;\nn135952413751246848 -> n136515363704668160;\nn128352589380059136 -> n136796838681378816;\nn128352589380059136 -> n137078313658089472;\nn137078313658089472 -> n136796838681378816;\nn136796838681378816 -> n130041439240323072;\nn128915539333480448 -> n137359788634800128;\nn128915539333480448 -> n137641263611510784;\nn137641263611510784 -> n137359788634800128;\nn137359788634800128 -> n130041439240323072;\nn130041439240323072 -> n136515363704668160;\nn136515363704668160 -> n124974889659531264;\nn126382264543084544 -> n137922738588221440;\nn126382264543084544 -> n138204213564932096;\nn138204213564932096 -> n137922738588221440;\nn137922738588221440 -> n138485688541642752;\nn137922738588221440 -> n138767163518353408;\nn138767163518353408 -> n138485688541642752;\nn138485688541642752 -> n139048638495064064;\nn127508164449927168 -> n128071114403348480;\nn128071114403348480 -> n139048638495064064;\nn139048638495064064 -> n124974889659531264;\nn139611588448485376 -> n139893063425196032;\nn139611588448485376 -> n140174538401906688;\nn140174538401906688 -> n139893063425196032;\nn140456013378617344 -> n140737488355328000;\nn140456013378617344 -> n141018963332038656;\nn141018963332038656 -> n140737488355328000;\nn140737488355328000 -> n141300438308749312;\nn140737488355328000 -> n141581913285459968;\nn141581913285459968 -> n141300438308749312;\nn141863388262170624 -> n142144863238881280;\nn141863388262170624 -> n142426338215591936;\nn142426338215591936 -> n142707813192302592;\nn142426338215591936 -> n142989288169013248;\nn142989288169013248 -> n143833713099145216;\nn143833713099145216 -> n143270763145723904;\nn143833713099145216 -> n143552238122434560;\nn143552238122434560 -> n143833713099145216;\nn143552238122434560 -> n144115188075855872;\nn144115188075855872 -> n143270763145723904;\nn142144863238881280 -> n144678138029277184;\nn144678138029277184 -> n143270763145723904;\nn144678138029277184 -> n144396663052566528;\nn144396663052566528 -> n144678138029277184;\nn144396663052566528 -> n144959613005987840;\nn144959613005987840 -> n143270763145723904;\nn142707813192302592 -> n146929937842962432;\nn146929937842962432 -> n145241087982698496;\nn146929937842962432 -> n145522562959409152;\nn145522562959409152 -> n145804037936119808;\nn145522562959409152 -> n146085512912830464;\nn146085512912830464 -> n145804037936119808;\nn146085512912830464 -> n146366987889541120;\nn146366987889541120 -> n145804037936119808;\nn145241087982698496 -> n145804037936119808;\nn145804037936119808 -> n143270763145723904;\nn145804037936119808 -> n146648462866251776;\nn146648462866251776 -> n146929937842962432;\nn146648462866251776 -> n143270763145723904;\nn281474976710656 -> n0[style=dotted];\nn13229323905400832 -> n281474976710656[style=dotted];\nn13792273858822144 -> n13510798882111488[style=dotted];\nn15199648742375424 -> n19703248369745920[style=dotted];\nn14918173765664768 -> n13792273858822144[style=dotted];\nn16325548649218048 -> n16044073672507392[style=dotted];\nn16888498602639360 -> n16325548649218048[style=dotted];\nn17451448556060672 -> n14918173765664768[style=dotted];\nn25332747903959040 -> n14918173765664768[style=dotted];\nn18014398509481984 -> n14918173765664768[style=dotted];\nn21955048183431168 -> n21673573206720512[style=dotted];\nn22517998136852480 -> n21955048183431168[style=dotted];\nn23080948090273792 -> n20547673299877888[style=dotted];\nn23643898043695104 -> n20547673299877888[style=dotted];\nn19984723346456576 -> n18014398509481984[style=dotted];\nn21110623253299200 -> n18014398509481984[style=dotted];\nn19703248369745920 -> n14918173765664768[style=dotted];\nn14355223812243456 -> n14073748835532800[style=dotted];\nn26740122787512320 -> n26458647810801664[style=dotted];\nn27303072740933632 -> n26740122787512320[style=dotted];\nn27866022694354944 -> n14355223812243456[style=dotted];\nn29836347531329536 -> n27866022694354944[style=dotted];\nn28147497671065600 -> n27866022694354944[style=dotted];\nn15481123719086080 -> n13510798882111488[style=dotted];\nn30117822508040192 -> n13510798882111488[style=dotted];\nn60798594969501696 -> n31525197391593472[style=dotted];\nn32369622321725440 -> n60798594969501696[style=dotted];\nn34339947158700032 -> n32369622321725440[style=dotted];\nn36028797018963968 -> n35747322042253312[style=dotted];\nn35465847065542656 -> n34339947158700032[style=dotted];\nn37436171902517248 -> n37154696925806592[style=dotted];\nn36873221949095936 -> n35465847065542656[style=dotted];\nn38843546786070528 -> n38562071809359872[style=dotted];\nn38280596832649216 -> n36873221949095936[style=dotted];\nn40250921669623808 -> n39969446692913152[style=dotted];\nn39687971716202496 -> n38280596832649216[style=dotted];\nn41658296553177088 -> n41376821576466432[style=dotted];\nn41095346599755776 -> n39687971716202496[style=dotted];\nn43065671436730368 -> n42784196460019712[style=dotted];\nn42502721483309056 -> n41095346599755776[style=dotted];\nn44473046320283648 -> n44191571343572992[style=dotted];\nn43910096366862336 -> n42502721483309056[style=dotted];\nn45880421203836928 -> n45598946227126272[style=dotted];\nn45317471250415616 -> n43910096366862336[style=dotted];\nn47287796087390208 -> n47006321110679552[style=dotted];\nn46724846133968896 -> n45317471250415616[style=dotted];\nn48695170970943488 -> n48413695994232832[style=dotted];\nn48132221017522176 -> n46724846133968896[style=dotted];\nn50102545854496768 -> n49821070877786112[style=dotted];\nn49539595901075456 -> n48132221017522176[style=dotted];\nn51509920738050048 -> n51228445761339392[style=dotted];\nn50946970784628736 -> n49539595901075456[style=dotted];\nn52917295621603328 -> n52635820644892672[style=dotted];\nn52354345668182016 -> n50946970784628736[style=dotted];\nn54324670505156608 -> n54043195528445952[style=dotted];\nn53761720551735296 -> n52354345668182016[style=dotted];\nn54887620458577920 -> n59391220085948416[style=dotted];\nn54606145481867264 -> n53761720551735296[style=dotted];\nn56294995342131200 -> n54606145481867264[style=dotted];\nn56013520365420544 -> n54606145481867264[style=dotted];\nn56576470318841856 -> n54606145481867264[style=dotted];\nn59391220085948416 -> n54606145481867264[style=dotted];\nn57420895248973824 -> n54606145481867264[style=dotted];\nn58265320179105792 -> n57420895248973824[style=dotted];\nn58828270132527104 -> n58265320179105792[style=dotted];\nn61924494876344320 -> n61643019899633664[style=dotted];\nn62487444829765632 -> n61924494876344320[style=dotted];\nn63050394783186944 -> n30962247438172160[style=dotted];\nn63331869759897600 -> n63050394783186944[style=dotted];\nn30680772461461504 -> n13510798882111488[style=dotted];\nn60235645016080384 -> n13510798882111488[style=dotted];\nn72902018968059904 -> n66991044457136128[style=dotted];\nn67553994410557440 -> n67272519433846784[style=dotted];\nn67272519433846784 -> n72902018968059904[style=dotted];\nn68961369294110720 -> n68679894317400064[style=dotted];\nn69524319247532032 -> n68961369294110720[style=dotted];\nn70087269200953344 -> n67835469387268096[style=dotted];\nn70650219154374656 -> n67835469387268096[style=dotted];\nn73746443898191872 -> n67835469387268096[style=dotted];\nn73464968921481216 -> n67835469387268096[style=dotted];\nn74027918874902528 -> n73746443898191872[style=dotted];\nn75435293758455808 -> n74590868828323840[style=dotted];\nn77687093572141056 -> n75435293758455808[style=dotted];\nn79094468455694336 -> n78250043525562368[style=dotted];\nn78812993478983680 -> n77687093572141056[style=dotted];\nn80220368362536960 -> n79375943432404992[style=dotted];\nn79938893385826304 -> n78812993478983680[style=dotted];\nn81346268269379584 -> n80501843339247616[style=dotted];\nn81064793292668928 -> n79938893385826304[style=dotted];\nn82472168176222208 -> n81627743246090240[style=dotted];\nn82190693199511552 -> n81064793292668928[style=dotted];\nn83598068083064832 -> n82753643152932864[style=dotted];\nn83316593106354176 -> n82190693199511552[style=dotted];\nn84723967989907456 -> n83879543059775488[style=dotted];\nn84442493013196800 -> n83316593106354176[style=dotted];\nn85849867896750080 -> n85005442966618112[style=dotted];\nn85568392920039424 -> n84442493013196800[style=dotted];\nn86975767803592704 -> n86131342873460736[style=dotted];\nn86694292826882048 -> n85568392920039424[style=dotted];\nn88101667710435328 -> n87257242780303360[style=dotted];\nn87820192733724672 -> n86694292826882048[style=dotted];\nn89227567617277952 -> n88383142687145984[style=dotted];\nn88946092640567296 -> n87820192733724672[style=dotted];\nn90353467524120576 -> n89509042593988608[style=dotted];\nn90071992547409920 -> n88946092640567296[style=dotted];\nn91479367430963200 -> n90634942500831232[style=dotted];\nn91197892454252544 -> n90071992547409920[style=dotted];\nn92605267337805824 -> n91760842407673856[style=dotted];\nn92323792361095168 -> n91197892454252544[style=dotted];\nn94012642221359104 -> n93731167244648448[style=dotted];\nn93449692267937792 -> n92323792361095168[style=dotted];\nn94575592174780416 -> n92323792361095168[style=dotted];\nn95701492081623040 -> n98234766872018944[style=dotted];\nn95420017104912384 -> n95138542128201728[style=dotted];\nn96827391988465664 -> n95420017104912384[style=dotted];\nn97390341941886976 -> n95420017104912384[style=dotted];\nn98516241848729600 -> n97953291895308288[style=dotted];\nn99079191802150912 -> n98516241848729600[style=dotted];\nn98234766872018944 -> n95420017104912384[style=dotted];\nn95982967058333696 -> n94575592174780416[style=dotted];\nn75998243711877120 -> n67835469387268096[style=dotted];\nn75716768735166464 -> n66428094503714816[style=dotted];\nn66146619527004160 -> n65865144550293504[style=dotted];\nn101049516639125504 -> n100768041662414848[style=dotted];\nn100768041662414848 -> n100486566685704192[style=dotted];\nn102175416545968128 -> n101893941569257472[style=dotted];\nn102738366499389440 -> n102175416545968128[style=dotted];\nn103301316452810752 -> n102738366499389440[style=dotted];\nn103864266406232064 -> n103301316452810752[style=dotted];\nn104427216359653376 -> n103864266406232064[style=dotted];\nn104990166313074688 -> n104427216359653376[style=dotted];\nn105553116266496000 -> n104990166313074688[style=dotted];\nn106116066219917312 -> n105553116266496000[style=dotted];\nn107241966126759936 -> n106116066219917312[style=dotted];\nn107804916080181248 -> n107523441103470592[style=dotted];\nn107523441103470592 -> n107241966126759936[style=dotted];\nn115123265474658304 -> n108930815987023872[style=dotted];\nn109493765940445184 -> n109212290963734528[style=dotted];\nn109212290963734528 -> n115123265474658304[style=dotted];\nn111182615800709120 -> n110901140823998464[style=dotted];\nn111745565754130432 -> n111182615800709120[style=dotted];\nn112308515707551744 -> n109775240917155840[style=dotted];\nn112871465660973056 -> n109775240917155840[style=dotted];\nn115686215428079616 -> n108086391056891904[style=dotted];\nn115967690404790272 -> n108086391056891904[style=dotted];\nn65020719620161536 -> n60235645016080384[style=dotted];\nn65583669573582848 -> n60235645016080384[style=dotted];\nn117375065288343552 -> n119063915148607488[style=dotted];\nn119908340078739456 -> n119063915148607488[style=dotted];\nn117938015241764864 -> n117093590311632896[style=dotted];\nn117093590311632896 -> n116812115334922240[style=dotted];\nn119063915148607488 -> n118219490218475520[style=dotted];\nn116249165381500928 -> n65583669573582848[style=dotted];\nn117656540265054208 -> n65583669573582848[style=dotted];\nn121878664915714048 -> n121034239985582080[style=dotted];\nn122723089845846016 -> n117656540265054208[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-1864.txt",
    "content": "digraph {\n\nmaxiter=8;\n        \nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn281474976710656[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn1970324836974592[shape=rectangle, label=\"B7\"];\nn1407374883553280[shape=rectangle, label=\"B8\"];\nn3096224743817216[shape=rectangle, label=\"B9\"];\nn3659174697238528[shape=rectangle, label=\"B10\"];\nn3377699720527872[shape=rectangle, label=\"B11\"];\nn3940649673949184[shape=rectangle, label=\"B12\"];\nn2533274790395904[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn95420017104912384[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn4503599627370496[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn5066549580791808[shape=rectangle, label=\"B19\"];\nn5910974510923776[shape=rectangle, label=\"B20\"];\nn6473924464345088[shape=rectangle, label=\"B21\"];\nn6755399441055744[shape=rectangle, label=\"B22\"];\nn6192449487634432[shape=rectangle, label=\"B23\"];\nn7318349394477056[shape=rectangle, label=\"B24\"];\nn7036874417766400[shape=rectangle, label=\"B25\"];\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn8162774324609024[shape=rectangle, label=\"B27\"];\nn8444249301319680[shape=rectangle, label=\"B28\"];\nn9007199254740992[shape=rectangle, label=\"B29\"];\nn8725724278030336[shape=rectangle, label=\"B30\"];\nn7599824371187712[shape=rectangle, label=\"B31\"];\nn9570149208162304[shape=rectangle, label=\"B32\"];\nn10133099161583616[shape=rectangle, label=\"B33\"];\nn9288674231451648[shape=rectangle, label=\"B34\"];\nn9851624184872960[shape=rectangle, label=\"B35\"];\nn10414574138294272[shape=rectangle, label=\"B36\"];\nn10977524091715584[shape=rectangle, label=\"B37\"];\nn11258999068426240[shape=rectangle, label=\"B38\"];\nn11540474045136896[shape=rectangle, label=\"B39\"];\nn11821949021847552[shape=rectangle, label=\"B40\"];\nn12103423998558208[shape=rectangle, label=\"B41\"];\nn12666373951979520[shape=rectangle, label=\"B42\"];\nn13229323905400832[shape=rectangle, label=\"B43\"];\nn12947848928690176[shape=rectangle, label=\"B44\"];\nn13510798882111488[shape=rectangle, label=\"B45\"];\nn14073748835532800[shape=rectangle, label=\"B46\"];\nn14636698788954112[shape=rectangle, label=\"B47\"];\nn15199648742375424[shape=rectangle, label=\"B48\"];\nn13792273858822144[shape=rectangle, label=\"B49\"];\nn14355223812243456[shape=rectangle, label=\"B50\"];\nn14918173765664768[shape=rectangle, label=\"B51\"];\nn15762598695796736[shape=rectangle, label=\"B52\"];\nn16044073672507392[shape=rectangle, label=\"B53\"];\nn16607023625928704[shape=rectangle, label=\"B54\"];\nn16325548649218048[shape=rectangle, label=\"B55\"];\nn19140298416324608[shape=rectangle, label=\"B56\"];\nn17732923532771328[shape=rectangle, label=\"B57\"];\nn15481123719086080[shape=rectangle, label=\"B58\"];\nn16888498602639360[shape=rectangle, label=\"B59\"];\nn17169973579350016[shape=rectangle, label=\"B60\"];\nn17451448556060672[shape=rectangle, label=\"B61\"];\nn18014398509481984[shape=rectangle, label=\"B62\"];\nn18295873486192640[shape=rectangle, label=\"B63\"];\nn18858823439613952[shape=rectangle, label=\"B64\"];\nn18577348462903296[shape=rectangle, label=\"B65\"];\nn19421773393035264[shape=rectangle, label=\"B66\"];\nn19703248369745920[shape=rectangle, label=\"B67\"];\nn10696049115004928[shape=rectangle, label=\"B68\"];\nn12384898975268864[shape=rectangle, label=\"B69\"];\nn20266198323167232[shape=rectangle, label=\"B70\"];\nn19984723346456576[shape=rectangle, label=\"B71\"];\nn20829148276588544[shape=rectangle, label=\"B72\"];\nn21110623253299200[shape=rectangle, label=\"B73\"];\nn21673573206720512[shape=rectangle, label=\"B74\"];\nn21955048183431168[shape=rectangle, label=\"B75\"];\nn20547673299877888[shape=rectangle, label=\"B76\"];\nn21392098230009856[shape=rectangle, label=\"B77\"];\nn54887620458577920[shape=rectangle, label=\"B78\"];\nn22517998136852480[shape=rectangle, label=\"B79\"];\nn23080948090273792[shape=rectangle, label=\"B80\"];\nn23643898043695104[shape=rectangle, label=\"B81\"];\nn23362423066984448[shape=rectangle, label=\"B82\"];\nn22236523160141824[shape=rectangle, label=\"B83\"];\nn24206847997116416[shape=rectangle, label=\"B84\"];\nn23925373020405760[shape=rectangle, label=\"B85\"];\nn24769797950537728[shape=rectangle, label=\"B86\"];\nn25051272927248384[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn26177172834091008[shape=rectangle, label=\"B89\"];\nn26740122787512320[shape=rectangle, label=\"B90\"];\nn26458647810801664[shape=rectangle, label=\"B91\"];\nn25332747903959040[shape=rectangle, label=\"B92\"];\nn24488322973827072[shape=rectangle, label=\"B93\"];\nn27303072740933632[shape=rectangle, label=\"B94\"];\nn27584547717644288[shape=rectangle, label=\"B95\"];\nn27021597764222976[shape=rectangle, label=\"B96\"];\nn28428972647776256[shape=rectangle, label=\"B97\"];\nn28147497671065600[shape=rectangle, label=\"B98\"];\nn28710447624486912[shape=rectangle, label=\"B99\"];\nn27866022694354944[shape=rectangle, label=\"B100\"];\nn28991922601197568[shape=rectangle, label=\"B101\"];\nn29554872554618880[shape=rectangle, label=\"B102\"];\nn30117822508040192[shape=rectangle, label=\"B103\"];\nn29836347531329536[shape=rectangle, label=\"B104\"];\nn30680772461461504[shape=rectangle, label=\"B105\"];\nn31243722414882816[shape=rectangle, label=\"B106\"];\nn30962247438172160[shape=rectangle, label=\"B107\"];\nn30399297484750848[shape=rectangle, label=\"B108\"];\nn31525197391593472[shape=rectangle, label=\"B109\"];\nn31806672368304128[shape=rectangle, label=\"B110\"];\nn32369622321725440[shape=rectangle, label=\"B111\"];\nn32932572275146752[shape=rectangle, label=\"B112\"];\nn32651097298436096[shape=rectangle, label=\"B113\"];\nn32088147345014784[shape=rectangle, label=\"B114\"];\nn33214047251857408[shape=rectangle, label=\"B115\"];\nn33776997205278720[shape=rectangle, label=\"B116\"];\nn33495522228568064[shape=rectangle, label=\"B117\"];\nn34339947158700032[shape=rectangle, label=\"B118\"];\nn34058472181989376[shape=rectangle, label=\"B119\"];\nn34902897112121344[shape=rectangle, label=\"B120\"];\nn34621422135410688[shape=rectangle, label=\"B121\"];\nn35747322042253312[shape=rectangle, label=\"B122\"];\nn36310271995674624[shape=rectangle, label=\"B123\"];\nn36028797018963968[shape=rectangle, label=\"B124\"];\nn35465847065542656[shape=rectangle, label=\"B125\"];\nn35184372088832000[shape=rectangle, label=\"B126\"];\nn36873221949095936[shape=rectangle, label=\"B127\"];\nn36591746972385280[shape=rectangle, label=\"B128\"];\nn29273397577908224[shape=rectangle, label=\"B129\"];\nn37436171902517248[shape=rectangle, label=\"B130\"];\nn37999121855938560[shape=rectangle, label=\"B131\"];\nn38562071809359872[shape=rectangle, label=\"B132\"];\nn39125021762781184[shape=rectangle, label=\"B133\"];\nn38843546786070528[shape=rectangle, label=\"B134\"];\nn38280596832649216[shape=rectangle, label=\"B135\"];\nn39406496739491840[shape=rectangle, label=\"B136\"];\nn37717646879227904[shape=rectangle, label=\"B137\"];\nn40250921669623808[shape=rectangle, label=\"B138\"];\nn40813871623045120[shape=rectangle, label=\"B139\"];\nn40532396646334464[shape=rectangle, label=\"B140\"];\nn39969446692913152[shape=rectangle, label=\"B141\"];\nn41095346599755776[shape=rectangle, label=\"B142\"];\nn39687971716202496[shape=rectangle, label=\"B143\"];\nn37154696925806592[shape=rectangle, label=\"B144\"];\nn41939771529887744[shape=rectangle, label=\"B145\"];\nn42502721483309056[shape=rectangle, label=\"B146\"];\nn42221246506598400[shape=rectangle, label=\"B147\"];\nn42784196460019712[shape=rectangle, label=\"B148\"];\nn41658296553177088[shape=rectangle, label=\"B149\"];\nn43065671436730368[shape=rectangle, label=\"B150\"];\nn41376821576466432[shape=rectangle, label=\"B151\"];\nn43628621390151680[shape=rectangle, label=\"B152\"];\nn44191571343572992[shape=rectangle, label=\"B153\"];\nn44754521296994304[shape=rectangle, label=\"B154\"];\nn44473046320283648[shape=rectangle, label=\"B155\"];\nn43910096366862336[shape=rectangle, label=\"B156\"];\nn43347146413441024[shape=rectangle, label=\"B157\"];\nn25895697857380352[shape=rectangle, label=\"B158\"];\nn45317471250415616[shape=rectangle, label=\"B159\"];\nn45598946227126272[shape=rectangle, label=\"B160\"];\nn45035996273704960[shape=rectangle, label=\"B161\"];\nn46161896180547584[shape=rectangle, label=\"B162\"];\nn45880421203836928[shape=rectangle, label=\"B163\"];\nn47006321110679552[shape=rectangle, label=\"B164\"];\nn46724846133968896[shape=rectangle, label=\"B165\"];\nn47569271064100864[shape=rectangle, label=\"B166\"];\nn47850746040811520[shape=rectangle, label=\"B167\"];\nn48413695994232832[shape=rectangle, label=\"B168\"];\nn48132221017522176[shape=rectangle, label=\"B169\"];\nn48976645947654144[shape=rectangle, label=\"B170\"];\nn49539595901075456[shape=rectangle, label=\"B171\"];\nn49258120924364800[shape=rectangle, label=\"B172\"];\nn50102545854496768[shape=rectangle, label=\"B173\"];\nn49821070877786112[shape=rectangle, label=\"B174\"];\nn48695170970943488[shape=rectangle, label=\"B175\"];\nn50384020831207424[shape=rectangle, label=\"B176\"];\nn50665495807918080[shape=rectangle, label=\"B177\"];\nn51228445761339392[shape=rectangle, label=\"B178\"];\nn50946970784628736[shape=rectangle, label=\"B179\"];\nn51509920738050048[shape=rectangle, label=\"B180\"];\nn47287796087390208[shape=rectangle, label=\"B181\"];\nn52072870691471360[shape=rectangle, label=\"B182\"];\nn52354345668182016[shape=rectangle, label=\"B183\"];\nn52635820644892672[shape=rectangle, label=\"B184\"];\nn53198770598313984[shape=rectangle, label=\"B185\"];\nn52917295621603328[shape=rectangle, label=\"B186\"];\nn51791395714760704[shape=rectangle, label=\"B187\"];\nn46443371157258240[shape=rectangle, label=\"B188\"];\nn53761720551735296[shape=rectangle, label=\"B189\"];\nn54043195528445952[shape=rectangle, label=\"B190\"];\nn54606145481867264[shape=rectangle, label=\"B191\"];\nn53480245575024640[shape=rectangle, label=\"B192\"];\nn54324670505156608[shape=rectangle, label=\"B193\"];\nn22799473113563136[shape=rectangle, label=\"B194\"];\nn55450570411999232[shape=rectangle, label=\"B195\"];\nn55169095435288576[shape=rectangle, label=\"B196\"];\nn56013520365420544[shape=rectangle, label=\"B197\"];\nn56576470318841856[shape=rectangle, label=\"B198\"];\nn57139420272263168[shape=rectangle, label=\"B199\"];\nn57702370225684480[shape=rectangle, label=\"B200\"];\nn58265320179105792[shape=rectangle, label=\"B201\"];\nn57983845202395136[shape=rectangle, label=\"B202\"];\nn57420895248973824[shape=rectangle, label=\"B203\"];\nn59109745109237760[shape=rectangle, label=\"B204\"];\nn62205969853054976[shape=rectangle, label=\"B205\"];\nn59672695062659072[shape=rectangle, label=\"B206\"];\nn59954170039369728[shape=rectangle, label=\"B207\"];\nn60517119992791040[shape=rectangle, label=\"B208\"];\nn60235645016080384[shape=rectangle, label=\"B209\"];\nn59391220085948416[shape=rectangle, label=\"B210\"];\nn61080069946212352[shape=rectangle, label=\"B211\"];\nn60798594969501696[shape=rectangle, label=\"B212\"];\nn61643019899633664[shape=rectangle, label=\"B213\"];\nn61361544922923008[shape=rectangle, label=\"B214\"];\nn61924494876344320[shape=rectangle, label=\"B215\"];\nn62487444829765632[shape=rectangle, label=\"B216\"];\nn58828270132527104[shape=rectangle, label=\"B217\"];\nn63050394783186944[shape=rectangle, label=\"B218\"];\nn62768919806476288[shape=rectangle, label=\"B219\"];\nn63331869759897600[shape=rectangle, label=\"B220\"];\nn66146619527004160[shape=rectangle, label=\"B221\"];\nn63894819713318912[shape=rectangle, label=\"B222\"];\nn63613344736608256[shape=rectangle, label=\"B223\"];\nn64457769666740224[shape=rectangle, label=\"B224\"];\nn65020719620161536[shape=rectangle, label=\"B225\"];\nn64739244643450880[shape=rectangle, label=\"B226\"];\nn64176294690029568[shape=rectangle, label=\"B227\"];\nn65865144550293504[shape=rectangle, label=\"B228\"];\nn65583669573582848[shape=rectangle, label=\"B229\"];\nn65302194596872192[shape=rectangle, label=\"B230\"];\nn56857945295552512[shape=rectangle, label=\"B231\"];\nn66709569480425472[shape=rectangle, label=\"B232\"];\nn66428094503714816[shape=rectangle, label=\"B233\"];\nn66991044457136128[shape=rectangle, label=\"B234\"];\nn67553994410557440[shape=rectangle, label=\"B235\"];\nn67272519433846784[shape=rectangle, label=\"B236\"];\nn68116944363978752[shape=rectangle, label=\"B237\"];\nn68398419340689408[shape=rectangle, label=\"B238\"];\nn68679894317400064[shape=rectangle, label=\"B239\"];\nn68961369294110720[shape=rectangle, label=\"B240\"];\nn67835469387268096[shape=rectangle, label=\"B241\"];\nn69242844270821376[shape=rectangle, label=\"B242\"];\nn69805794224242688[shape=rectangle, label=\"B243\"];\nn69524319247532032[shape=rectangle, label=\"B244\"];\nn70368744177664000[shape=rectangle, label=\"B245\"];\nn70931694131085312[shape=rectangle, label=\"B246\"];\nn70650219154374656[shape=rectangle, label=\"B247\"];\nn70087269200953344[shape=rectangle, label=\"B248\"];\nn56294995342131200[shape=rectangle, label=\"B249\"];\nn71494644084506624[shape=rectangle, label=\"B250\"];\nn71776119061217280[shape=rectangle, label=\"B251\"];\nn71213169107795968[shape=rectangle, label=\"B252\"];\nn72339069014638592[shape=rectangle, label=\"B253\"];\nn72057594037927936[shape=rectangle, label=\"B254\"];\nn72902018968059904[shape=rectangle, label=\"B255\"];\nn72620543991349248[shape=rectangle, label=\"B256\"];\nn73464968921481216[shape=rectangle, label=\"B257\"];\nn73183493944770560[shape=rectangle, label=\"B258\"];\nn74027918874902528[shape=rectangle, label=\"B259\"];\nn73746443898191872[shape=rectangle, label=\"B260\"];\nn74309393851613184[shape=rectangle, label=\"B261\"];\nn74872343805034496[shape=rectangle, label=\"B262\"];\nn74590868828323840[shape=rectangle, label=\"B263\"];\nn75153818781745152[shape=rectangle, label=\"B264\"];\nn75716768735166464[shape=rectangle, label=\"B265\"];\nn75435293758455808[shape=rectangle, label=\"B266\"];\nn76279718688587776[shape=rectangle, label=\"B267\"];\nn75998243711877120[shape=rectangle, label=\"B268\"];\nn76842668642009088[shape=rectangle, label=\"B269\"];\nn76561193665298432[shape=rectangle, label=\"B270\"];\nn77405618595430400[shape=rectangle, label=\"B271\"];\nn77687093572141056[shape=rectangle, label=\"B272\"];\nn77124143618719744[shape=rectangle, label=\"B273\"];\nn78531518502273024[shape=rectangle, label=\"B274\"];\nn81627743246090240[shape=rectangle, label=\"B275\"];\nn78812993478983680[shape=rectangle, label=\"B276\"];\nn79375943432404992[shape=rectangle, label=\"B277\"];\nn79657418409115648[shape=rectangle, label=\"B278\"];\nn79938893385826304[shape=rectangle, label=\"B279\"];\nn79094468455694336[shape=rectangle, label=\"B280\"];\nn80783318315958272[shape=rectangle, label=\"B281\"];\nn81064793292668928[shape=rectangle, label=\"B282\"];\nn80501843339247616[shape=rectangle, label=\"B283\"];\nn81909218222800896[shape=rectangle, label=\"B284\"];\nn80220368362536960[shape=rectangle, label=\"B285\"];\nn81346268269379584[shape=rectangle, label=\"B286\"];\nn82472168176222208[shape=rectangle, label=\"B287\"];\nn82753643152932864[shape=rectangle, label=\"B288\"];\nn82190693199511552[shape=rectangle, label=\"B289\"];\nn83316593106354176[shape=rectangle, label=\"B290\"];\nn83598068083064832[shape=rectangle, label=\"B291\"];\nn84161018036486144[shape=rectangle, label=\"B292\"];\nn84442493013196800[shape=rectangle, label=\"B293\"];\nn83879543059775488[shape=rectangle, label=\"B294\"];\nn85005442966618112[shape=rectangle, label=\"B295\"];\nn84723967989907456[shape=rectangle, label=\"B296\"];\nn83035118129643520[shape=rectangle, label=\"B297\"];\nn77968568548851712[shape=rectangle, label=\"B298\"];\nn78250043525562368[shape=rectangle, label=\"B299\"];\nn85286917943328768[shape=rectangle, label=\"B300\"];\nn85849867896750080[shape=rectangle, label=\"B301\"];\nn85568392920039424[shape=rectangle, label=\"B302\"];\nn86412817850171392[shape=rectangle, label=\"B303\"];\nn86131342873460736[shape=rectangle, label=\"B304\"];\nn86975767803592704[shape=rectangle, label=\"B305\"];\nn86694292826882048[shape=rectangle, label=\"B306\"];\nn87538717757014016[shape=rectangle, label=\"B307\"];\nn87257242780303360[shape=rectangle, label=\"B308\"];\nn88101667710435328[shape=rectangle, label=\"B309\"];\nn87820192733724672[shape=rectangle, label=\"B310\"];\nn88664617663856640[shape=rectangle, label=\"B311\"];\nn89227567617277952[shape=rectangle, label=\"B312\"];\nn88946092640567296[shape=rectangle, label=\"B313\"];\nn88383142687145984[shape=rectangle, label=\"B314\"];\nn90071992547409920[shape=rectangle, label=\"B315\"];\nn89790517570699264[shape=rectangle, label=\"B316\"];\nn90634942500831232[shape=rectangle, label=\"B317\"];\nn90353467524120576[shape=rectangle, label=\"B318\"];\nn91197892454252544[shape=rectangle, label=\"B319\"];\nn91479367430963200[shape=rectangle, label=\"B320\"];\nn92042317384384512[shape=rectangle, label=\"B321\"];\nn91760842407673856[shape=rectangle, label=\"B322\"];\nn92605267337805824[shape=rectangle, label=\"B323\"];\nn92323792361095168[shape=rectangle, label=\"B324\"];\nn90916417477541888[shape=rectangle, label=\"B325\"];\nn93168217291227136[shape=rectangle, label=\"B326\"];\nn92886742314516480[shape=rectangle, label=\"B327\"];\nn93731167244648448[shape=rectangle, label=\"B328\"];\nn93449692267937792[shape=rectangle, label=\"B329\"];\nn94294117198069760[shape=rectangle, label=\"B330\"];\nn94575592174780416[shape=rectangle, label=\"B331\"];\nn94012642221359104[shape=rectangle, label=\"B332\"];\nn95138542128201728[shape=rectangle, label=\"B333\"];\nn94857067151491072[shape=rectangle, label=\"B334\"];\nn89509042593988608[shape=rectangle, label=\"B335\"];\nn121034239985582080[shape=rectangle, label=\"B336\"];\nn58546795155816448[shape=rectangle, label=\"B337\"];\nn95701492081623040[shape=rectangle, label=\"B338\"];\nn55732045388709888[shape=rectangle, label=\"B339\"];\nn96545917011755008[shape=rectangle, label=\"B340\"];\nn96827391988465664[shape=rectangle, label=\"B341\"];\nn97108866965176320[shape=rectangle, label=\"B342\"];\nn97390341941886976[shape=rectangle, label=\"B343\"];\nn97671816918597632[shape=rectangle, label=\"B344\"];\nn98234766872018944[shape=rectangle, label=\"B345\"];\nn98797716825440256[shape=rectangle, label=\"B346\"];\nn99079191802150912[shape=rectangle, label=\"B347\"];\nn98516241848729600[shape=rectangle, label=\"B348\"];\nn97953291895308288[shape=rectangle, label=\"B349\"];\nn99360666778861568[shape=rectangle, label=\"B350\"];\nn99642141755572224[shape=rectangle, label=\"B351\"];\nn96264442035044352[shape=rectangle, label=\"B352\"];\nn100205091708993536[shape=rectangle, label=\"B353\"];\nn100768041662414848[shape=rectangle, label=\"B354\"];\nn101049516639125504[shape=rectangle, label=\"B355\"];\nn100486566685704192[shape=rectangle, label=\"B356\"];\nn101612466592546816[shape=rectangle, label=\"B357\"];\nn101893941569257472[shape=rectangle, label=\"B358\"];\nn101330991615836160[shape=rectangle, label=\"B359\"];\nn102175416545968128[shape=rectangle, label=\"B360\"];\nn102456891522678784[shape=rectangle, label=\"B361\"];\nn102738366499389440[shape=rectangle, label=\"B362\"];\nn103019841476100096[shape=rectangle, label=\"B363\"];\nn99923616732282880[shape=rectangle, label=\"B364\"];\nn103582791429521408[shape=rectangle, label=\"B365\"];\nn104145741382942720[shape=rectangle, label=\"B366\"];\nn103864266406232064[shape=rectangle, label=\"B367\"];\nn104427216359653376[shape=rectangle, label=\"B368\"];\nn106397541196627968[shape=rectangle, label=\"B369\"];\nn104990166313074688[shape=rectangle, label=\"B370\"];\nn104708691336364032[shape=rectangle, label=\"B371\"];\nn105553116266496000[shape=rectangle, label=\"B372\"];\nn105271641289785344[shape=rectangle, label=\"B373\"];\nn106116066219917312[shape=rectangle, label=\"B374\"];\nn105834591243206656[shape=rectangle, label=\"B375\"];\nn103301316452810752[shape=rectangle, label=\"B376\"];\nn106960491150049280[shape=rectangle, label=\"B377\"];\nn106679016173338624[shape=rectangle, label=\"B378\"];\nn107523441103470592[shape=rectangle, label=\"B379\"];\nn115686215428079616[shape=rectangle, label=\"B380\"];\nn108086391056891904[shape=rectangle, label=\"B381\"];\nn108649341010313216[shape=rectangle, label=\"B382\"];\nn108367866033602560[shape=rectangle, label=\"B383\"];\nn108930815987023872[shape=rectangle, label=\"B384\"];\nn109493765940445184[shape=rectangle, label=\"B385\"];\nn109212290963734528[shape=rectangle, label=\"B386\"];\nn109775240917155840[shape=rectangle, label=\"B387\"];\nn110338190870577152[shape=rectangle, label=\"B388\"];\nn110056715893866496[shape=rectangle, label=\"B389\"];\nn110901140823998464[shape=rectangle, label=\"B390\"];\nn110619665847287808[shape=rectangle, label=\"B391\"];\nn111464090777419776[shape=rectangle, label=\"B392\"];\nn111182615800709120[shape=rectangle, label=\"B393\"];\nn111745565754130432[shape=rectangle, label=\"B394\"];\nn112027040730841088[shape=rectangle, label=\"B395\"];\nn112308515707551744[shape=rectangle, label=\"B396\"];\nn107804916080181248[shape=rectangle, label=\"B397\"];\nn113152940637683712[shape=rectangle, label=\"B398\"];\nn112871465660973056[shape=rectangle, label=\"B399\"];\nn113715890591105024[shape=rectangle, label=\"B400\"];\nn114278840544526336[shape=rectangle, label=\"B401\"];\nn113997365567815680[shape=rectangle, label=\"B402\"];\nn113434415614394368[shape=rectangle, label=\"B403\"];\nn114841790497947648[shape=rectangle, label=\"B404\"];\nn114560315521236992[shape=rectangle, label=\"B405\"];\nn115404740451368960[shape=rectangle, label=\"B406\"];\nn115123265474658304[shape=rectangle, label=\"B407\"];\nn107241966126759936[shape=rectangle, label=\"B408\"];\nn116249165381500928[shape=rectangle, label=\"B409\"];\nn115967690404790272[shape=rectangle, label=\"B410\"];\nn116812115334922240[shape=rectangle, label=\"B411\"];\nn117375065288343552[shape=rectangle, label=\"B412\"];\nn117093590311632896[shape=rectangle, label=\"B413\"];\nn117938015241764864[shape=rectangle, label=\"B414\"];\nn112589990684262400[shape=rectangle, label=\"B415\"];\nn118782440171896832[shape=rectangle, label=\"B416\"];\nn119063915148607488[shape=rectangle, label=\"B417\"];\nn118500965195186176[shape=rectangle, label=\"B418\"];\nn119626865102028800[shape=rectangle, label=\"B419\"];\nn119908340078739456[shape=rectangle, label=\"B420\"];\nn119345390125318144[shape=rectangle, label=\"B421\"];\nn120752765008871424[shape=rectangle, label=\"B422\"];\nn120471290032160768[shape=rectangle, label=\"B423\"];\nn120189815055450112[shape=rectangle, label=\"B424\"];\nn116530640358211584[shape=rectangle, label=\"B425\"];\nn118219490218475520[shape=rectangle, label=\"B426\"];\nn121597189939003392[shape=rectangle, label=\"B427\"];\nn121315714962292736[shape=rectangle, label=\"B428\"];\nn122160139892424704[shape=rectangle, label=\"B429\"];\nn122723089845846016[shape=rectangle, label=\"B430\"];\nn122441614869135360[shape=rectangle, label=\"B431\"];\nn123286039799267328[shape=rectangle, label=\"B432\"];\nn123004564822556672[shape=rectangle, label=\"B433\"];\nn123567514775977984[shape=rectangle, label=\"B434\"];\nn124130464729399296[shape=rectangle, label=\"B435\"];\nn123848989752688640[shape=rectangle, label=\"B436\"];\nn121878664915714048[shape=rectangle, label=\"B437\"];\nn124411939706109952[shape=rectangle, label=\"B438\"];\nn124693414682820608[shape=rectangle, label=\"B439\"];\nn125256364636241920[shape=rectangle, label=\"B440\"];\nn124974889659531264[shape=rectangle, label=\"B441\"];\nn125537839612952576[shape=rectangle, label=\"B442\"];\nn126100789566373888[shape=rectangle, label=\"B443\"];\nn125819314589663232[shape=rectangle, label=\"B444\"];\nn117656540265054208[shape=rectangle, label=\"B445\"];\nn126663739519795200[shape=rectangle, label=\"B446\"];\nn126382264543084544[shape=rectangle, label=\"B447\"];\nn127226689473216512[shape=rectangle, label=\"B448\"];\nn127789639426637824[shape=rectangle, label=\"B449\"];\nn128071114403348480[shape=rectangle, label=\"B450\"];\nn128634064356769792[shape=rectangle, label=\"B451\"];\nn128352589380059136[shape=rectangle, label=\"B452\"];\nn129197014310191104[shape=rectangle, label=\"B453\"];\nn129759964263612416[shape=rectangle, label=\"B454\"];\nn129478489286901760[shape=rectangle, label=\"B455\"];\nn128915539333480448[shape=rectangle, label=\"B456\"];\nn130604389193744384[shape=rectangle, label=\"B457\"];\nn130322914217033728[shape=rectangle, label=\"B458\"];\nn130041439240323072[shape=rectangle, label=\"B459\"];\nn131167339147165696[shape=rectangle, label=\"B460\"];\nn130885864170455040[shape=rectangle, label=\"B461\"];\nn131730289100587008[shape=rectangle, label=\"B462\"];\nn131448814123876352[shape=rectangle, label=\"B463\"];\nn132293239054008320[shape=rectangle, label=\"B464\"];\nn132011764077297664[shape=rectangle, label=\"B465\"];\nn132856189007429632[shape=rectangle, label=\"B466\"];\nn133419138960850944[shape=rectangle, label=\"B467\"];\nn133137663984140288[shape=rectangle, label=\"B468\"];\nn133982088914272256[shape=rectangle, label=\"B469\"];\nn133700613937561600[shape=rectangle, label=\"B470\"];\nn134263563890982912[shape=rectangle, label=\"B471\"];\nn134545038867693568[shape=rectangle, label=\"B472\"];\nn134826513844404224[shape=rectangle, label=\"B473\"];\nn135389463797825536[shape=rectangle, label=\"B474\"];\nn135670938774536192[shape=rectangle, label=\"B475\"];\nn135107988821114880[shape=rectangle, label=\"B476\"];\nn136515363704668160[shape=rectangle, label=\"B477\"];\nn136233888727957504[shape=rectangle, label=\"B478\"];\nn135952413751246848[shape=rectangle, label=\"B479\"];\nn132574714030718976[shape=rectangle, label=\"B480\"];\nn127508164449927168[shape=rectangle, label=\"B481\"];\nn137078313658089472[shape=rectangle, label=\"B482\"];\nn136796838681378816[shape=rectangle, label=\"B483\"];\nn137641263611510784[shape=rectangle, label=\"B484\"];\nn138204213564932096[shape=rectangle, label=\"B485\"];\nn137922738588221440[shape=rectangle, label=\"B486\"];\nn137359788634800128[shape=rectangle, label=\"B487\"];\nn138767163518353408[shape=rectangle, label=\"B488\"];\nn138485688541642752[shape=rectangle, label=\"B489\"];\nn139330113471774720[shape=rectangle, label=\"B490\"];\nn139048638495064064[shape=rectangle, label=\"B491\"];\nn126945214496505856[shape=rectangle, label=\"B492\"];\nn139611588448485376[shape=rectangle, label=\"B493\"];\nn140174538401906688[shape=rectangle, label=\"B494\"];\nn139893063425196032[shape=rectangle, label=\"B495\"];\nn140456013378617344[shape=rectangle, label=\"B496\"];\nn141018963332038656[shape=rectangle, label=\"B497\"];\nn140737488355328000[shape=rectangle, label=\"B498\"];\nn141581913285459968[shape=rectangle, label=\"B499\"];\nn141300438308749312[shape=rectangle, label=\"B500\"];\nn141863388262170624[shape=rectangle, label=\"B501\"];\nn142144863238881280[shape=rectangle, label=\"B502\"];\nn142707813192302592[shape=rectangle, label=\"B503\"];\nn142426338215591936[shape=rectangle, label=\"B504\"];\nn143270763145723904[shape=rectangle, label=\"B505\"];\nn143552238122434560[shape=rectangle, label=\"B506\"];\nn142989288169013248[shape=rectangle, label=\"B507\"];\nn143833713099145216[shape=rectangle, label=\"B508\"];\nn144115188075855872[shape=rectangle, label=\"B509\"];\nn144678138029277184[shape=rectangle, label=\"B510\"];\nn144396663052566528[shape=rectangle, label=\"B511\"];\nn145241087982698496[shape=rectangle, label=\"B512\"];\nn144959613005987840[shape=rectangle, label=\"B513\"];\nn145804037936119808[shape=rectangle, label=\"B514\"];\nn145522562959409152[shape=rectangle, label=\"B515\"];\nn146366987889541120[shape=rectangle, label=\"B516\"];\nn146085512912830464[shape=rectangle, label=\"B517\"];\nn146929937842962432[shape=rectangle, label=\"B518\"];\nn147492887796383744[shape=rectangle, label=\"B519\"];\nn147211412819673088[shape=rectangle, label=\"B520\"];\nn146648462866251776[shape=rectangle, label=\"B521\"];\nn147774362773094400[shape=rectangle, label=\"B522\"];\nn148337312726515712[shape=rectangle, label=\"B523\"];\nn148055837749805056[shape=rectangle, label=\"B524\"];\nn148900262679937024[shape=rectangle, label=\"B525\"];\nn149463212633358336[shape=rectangle, label=\"B526\"];\nn149181737656647680[shape=rectangle, label=\"B527\"];\nn149744687610068992[shape=rectangle, label=\"B528\"];\nn148618787703226368[shape=rectangle, label=\"B529\"];\nn150307637563490304[shape=rectangle, label=\"B530\"];\nn150026162586779648[shape=rectangle, label=\"B531\"];\nn150870587516911616[shape=rectangle, label=\"B532\"];\nn150589112540200960[shape=rectangle, label=\"B533\"];\nn151433537470332928[shape=rectangle, label=\"B534\"];\nn151996487423754240[shape=rectangle, label=\"B535\"];\nn151715012447043584[shape=rectangle, label=\"B536\"];\nn151152062493622272[shape=rectangle, label=\"B537\"];\nn152277962400464896[shape=rectangle, label=\"B538\"];\nn152840912353886208[shape=rectangle, label=\"B539\"];\nn152559437377175552[shape=rectangle, label=\"B540\"];\nn153403862307307520[shape=rectangle, label=\"B541\"];\nn153966812260728832[shape=rectangle, label=\"B542\"];\nn153685337284018176[shape=rectangle, label=\"B543\"];\nn153122387330596864[shape=rectangle, label=\"B544\"];\nn154248287237439488[shape=rectangle, label=\"B545\"];\nn154811237190860800[shape=rectangle, label=\"B546\"];\nn155092712167571456[shape=rectangle, label=\"B547\"];\nn154529762214150144[shape=rectangle, label=\"B548\"];\nn155374187144282112[shape=rectangle, label=\"B549\"];\nn5629499534213120[shape=rectangle, label=\"B550\"];\nn155655662120992768[shape=rectangle, label=\"B551\"];\nn155937137097703424[shape=rectangle, label=\"B552\"];\nn169447935979814912[shape=rectangle, label=\"B553\"];\nn156500087051124736[shape=rectangle, label=\"B554\"];\nn156781562027835392[shape=rectangle, label=\"B555\"];\nn156218612074414080[shape=rectangle, label=\"B556\"];\nn157625986957967360[shape=rectangle, label=\"B557\"];\nn157344511981256704[shape=rectangle, label=\"B558\"];\nn158188936911388672[shape=rectangle, label=\"B559\"];\nn158751886864809984[shape=rectangle, label=\"B560\"];\nn158470411888099328[shape=rectangle, label=\"B561\"];\nn159314836818231296[shape=rectangle, label=\"B562\"];\nn159033361841520640[shape=rectangle, label=\"B563\"];\nn157907461934678016[shape=rectangle, label=\"B564\"];\nn160159261748363264[shape=rectangle, label=\"B565\"];\nn159877786771652608[shape=rectangle, label=\"B566\"];\nn159596311794941952[shape=rectangle, label=\"B567\"];\nn160722211701784576[shape=rectangle, label=\"B568\"];\nn161285161655205888[shape=rectangle, label=\"B569\"];\nn161848111608627200[shape=rectangle, label=\"B570\"];\nn161566636631916544[shape=rectangle, label=\"B571\"];\nn161003686678495232[shape=rectangle, label=\"B572\"];\nn162129586585337856[shape=rectangle, label=\"B573\"];\nn160440736725073920[shape=rectangle, label=\"B574\"];\nn162974011515469824[shape=rectangle, label=\"B575\"];\nn163536961468891136[shape=rectangle, label=\"B576\"];\nn163255486492180480[shape=rectangle, label=\"B577\"];\nn162692536538759168[shape=rectangle, label=\"B578\"];\nn163818436445601792[shape=rectangle, label=\"B579\"];\nn162411061562048512[shape=rectangle, label=\"B580\"];\nn157063037004546048[shape=rectangle, label=\"B581\"];\nn164381386399023104[shape=rectangle, label=\"B582\"];\nn164099911422312448[shape=rectangle, label=\"B583\"];\nn164944336352444416[shape=rectangle, label=\"B584\"];\nn164662861375733760[shape=rectangle, label=\"B585\"];\nn165507286305865728[shape=rectangle, label=\"B586\"];\nn165225811329155072[shape=rectangle, label=\"B587\"];\nn166070236259287040[shape=rectangle, label=\"B588\"];\nn166351711235997696[shape=rectangle, label=\"B589\"];\nn166914661189419008[shape=rectangle, label=\"B590\"];\nn166633186212708352[shape=rectangle, label=\"B591\"];\nn167477611142840320[shape=rectangle, label=\"B592\"];\nn168040561096261632[shape=rectangle, label=\"B593\"];\nn167759086119550976[shape=rectangle, label=\"B594\"];\nn168603511049682944[shape=rectangle, label=\"B595\"];\nn168322036072972288[shape=rectangle, label=\"B596\"];\nn167196136166129664[shape=rectangle, label=\"B597\"];\nn165788761282576384[shape=rectangle, label=\"B598\"];\nn169166461003104256[shape=rectangle, label=\"B599\"];\nn168884986026393600[shape=rectangle, label=\"B600\"];\nn169729410956525568[shape=rectangle, label=\"B601\"];\nn2814749767106560[shape=rectangle, label=\"B602\"];\nn95982967058333696[shape=rectangle, label=\"B603\"];\nn170292360909946880[shape=rectangle, label=\"B604\"];\nn170573835886657536[shape=rectangle, label=\"B605\"];\nn170855310863368192[shape=rectangle, label=\"B606\"];\nn171136785840078848[shape=rectangle, label=\"B607\"];\nn170010885933236224[shape=rectangle, label=\"B608\"];\nn171699735793500160[shape=rectangle, label=\"B609\"];\nn171981210770210816[shape=rectangle, label=\"B610\"];\nn178736610211266560[shape=rectangle, label=\"B611\"];\nn172544160723632128[shape=rectangle, label=\"B612\"];\nn172262685746921472[shape=rectangle, label=\"B613\"];\nn173107110677053440[shape=rectangle, label=\"B614\"];\nn172825635700342784[shape=rectangle, label=\"B615\"];\nn173951535607185408[shape=rectangle, label=\"B616\"];\nn173670060630474752[shape=rectangle, label=\"B617\"];\nn174514485560606720[shape=rectangle, label=\"B618\"];\nn174233010583896064[shape=rectangle, label=\"B619\"];\nn175077435514028032[shape=rectangle, label=\"B620\"];\nn175640385467449344[shape=rectangle, label=\"B621\"];\nn175358910490738688[shape=rectangle, label=\"B622\"];\nn176203335420870656[shape=rectangle, label=\"B623\"];\nn176766285374291968[shape=rectangle, label=\"B624\"];\nn176484810397581312[shape=rectangle, label=\"B625\"];\nn175921860444160000[shape=rectangle, label=\"B626\"];\nn177329235327713280[shape=rectangle, label=\"B627\"];\nn177047760351002624[shape=rectangle, label=\"B628\"];\nn174795960537317376[shape=rectangle, label=\"B629\"];\nn177892185281134592[shape=rectangle, label=\"B630\"];\nn177610710304423936[shape=rectangle, label=\"B631\"];\nn173388585653764096[shape=rectangle, label=\"B632\"];\nn178455135234555904[shape=rectangle, label=\"B633\"];\nn178173660257845248[shape=rectangle, label=\"B634\"];\nn171418260816789504[shape=rectangle, label=\"B635\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn562949953421312 -> n844424930131968;\nn844424930131968 -> n281474976710656;\nn844424930131968 -> n1125899906842624;\nn1125899906842624 -> n281474976710656;\nn281474976710656 -> n1407374883553280;\nn281474976710656 -> n1688849860263936;\nn1688849860263936 -> n1970324836974592;\nn1688849860263936 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n1970324836974592;\nn1970324836974592 -> n2533274790395904;\nn1970324836974592 -> n1407374883553280;\nn1407374883553280 -> n2814749767106560;\nn1407374883553280 -> n3096224743817216;\nn3096224743817216 -> n3377699720527872;\nn3096224743817216 -> n3659174697238528;\nn3659174697238528 -> n3377699720527872;\nn3377699720527872 -> n3096224743817216;\nn3377699720527872 -> n3940649673949184;\nn3940649673949184 -> n4222124650659840;\nn2533274790395904 -> n2814749767106560;\nn2533274790395904 -> n4222124650659840;\nn4222124650659840 -> n95420017104912384;\nn95420017104912384 -> n4503599627370496;\nn95420017104912384 -> n4785074604081152;\nn4785074604081152 -> n4503599627370496;\nn4503599627370496 -> n5066549580791808;\nn4503599627370496 -> n5348024557502464;\nn5348024557502464 -> n5066549580791808;\nn5066549580791808 -> n5629499534213120;\nn5066549580791808 -> n5910974510923776;\nn5910974510923776 -> n6192449487634432;\nn5910974510923776 -> n6473924464345088;\nn6473924464345088 -> n6192449487634432;\nn6473924464345088 -> n6755399441055744;\nn6755399441055744 -> n6192449487634432;\nn6192449487634432 -> n7036874417766400;\nn6192449487634432 -> n7318349394477056;\nn7318349394477056 -> n7036874417766400;\nn7036874417766400 -> n7599824371187712;\nn7036874417766400 -> n7881299347898368;\nn7881299347898368 -> n7599824371187712;\nn7881299347898368 -> n8162774324609024;\nn8162774324609024 -> n7599824371187712;\nn8162774324609024 -> n8444249301319680;\nn8444249301319680 -> n8725724278030336;\nn8444249301319680 -> n9007199254740992;\nn9007199254740992 -> n8725724278030336;\nn8725724278030336 -> n7599824371187712;\nn7599824371187712 -> n9288674231451648;\nn7599824371187712 -> n9570149208162304;\nn9570149208162304 -> n9851624184872960;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n9851624184872960;\nn10133099161583616 -> n9288674231451648;\nn9288674231451648 -> n10414574138294272;\nn9851624184872960 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10977524091715584;\nn11258999068426240 -> n10696049115004928;\nn11258999068426240 -> n11540474045136896;\nn11540474045136896 -> n10696049115004928;\nn11821949021847552 -> n10696049115004928;\nn12103423998558208 -> n12384898975268864;\nn12666373951979520 -> n13229323905400832;\nn13229323905400832 -> n12384898975268864;\nn12947848928690176 -> n13229323905400832;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n15199648742375424;\nn15199648742375424 -> n12384898975268864;\nn13792273858822144 -> n14918173765664768;\nn13792273858822144 -> n14355223812243456;\nn14355223812243456 -> n15199648742375424;\nn14355223812243456 -> n14918173765664768;\nn14918173765664768 -> n15481123719086080;\nn14918173765664768 -> n15762598695796736;\nn15762598695796736 -> n15481123719086080;\nn15762598695796736 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn16044073672507392 -> n16607023625928704;\nn16607023625928704 -> n16325548649218048;\nn16325548649218048 -> n19140298416324608;\nn19140298416324608 -> n17732923532771328;\nn17732923532771328 -> n10696049115004928;\nn15481123719086080 -> n15199648742375424;\nn15481123719086080 -> n16888498602639360;\nn16888498602639360 -> n15199648742375424;\nn16888498602639360 -> n17169973579350016;\nn17169973579350016 -> n15199648742375424;\nn17169973579350016 -> n17451448556060672;\nn17451448556060672 -> n17732923532771328;\nn17451448556060672 -> n18014398509481984;\nn18014398509481984 -> n17732923532771328;\nn18014398509481984 -> n18295873486192640;\nn18295873486192640 -> n18577348462903296;\nn18295873486192640 -> n18858823439613952;\nn18858823439613952 -> n18577348462903296;\nn18577348462903296 -> n19140298416324608;\nn19421773393035264 -> n10696049115004928;\nn19421773393035264 -> n19703248369745920;\nn19703248369745920 -> n10696049115004928;\nn10696049115004928 -> n12384898975268864;\nn12384898975268864 -> n19984723346456576;\nn12384898975268864 -> n20266198323167232;\nn20266198323167232 -> n19984723346456576;\nn19984723346456576 -> n20547673299877888;\nn19984723346456576 -> n20829148276588544;\nn20829148276588544 -> n20547673299877888;\nn20829148276588544 -> n21110623253299200;\nn21110623253299200 -> n21392098230009856;\nn21110623253299200 -> n21673573206720512;\nn21673573206720512 -> n21392098230009856;\nn21673573206720512 -> n21955048183431168;\nn21955048183431168 -> n21392098230009856;\nn20547673299877888 -> n21392098230009856;\nn21392098230009856 -> n54887620458577920;\nn54887620458577920 -> n22236523160141824;\nn54887620458577920 -> n22517998136852480;\nn22517998136852480 -> n22799473113563136;\nn22517998136852480 -> n23080948090273792;\nn23080948090273792 -> n23362423066984448;\nn23080948090273792 -> n23643898043695104;\nn23643898043695104 -> n23362423066984448;\nn23362423066984448 -> n22799473113563136;\nn23362423066984448 -> n22236523160141824;\nn22236523160141824 -> n23925373020405760;\nn22236523160141824 -> n24206847997116416;\nn24206847997116416 -> n23925373020405760;\nn23925373020405760 -> n24488322973827072;\nn23925373020405760 -> n24769797950537728;\nn24769797950537728 -> n24488322973827072;\nn24769797950537728 -> n25051272927248384;\nn25051272927248384 -> n25332747903959040;\nn25051272927248384 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n26177172834091008;\nn26177172834091008 -> n26458647810801664;\nn26177172834091008 -> n26740122787512320;\nn26740122787512320 -> n25895697857380352;\nn26740122787512320 -> n26458647810801664;\nn26458647810801664 -> n25895697857380352;\nn25332747903959040 -> n25895697857380352;\nn24488322973827072 -> n27021597764222976;\nn24488322973827072 -> n27303072740933632;\nn27303072740933632 -> n27021597764222976;\nn27303072740933632 -> n27584547717644288;\nn27584547717644288 -> n27866022694354944;\nn27584547717644288 -> n27021597764222976;\nn27021597764222976 -> n28147497671065600;\nn27021597764222976 -> n28428972647776256;\nn28428972647776256 -> n28147497671065600;\nn28147497671065600 -> n27866022694354944;\nn28147497671065600 -> n28710447624486912;\nn28710447624486912 -> n28991922601197568;\nn27866022694354944 -> n28991922601197568;\nn28991922601197568 -> n29273397577908224;\nn28991922601197568 -> n29554872554618880;\nn29554872554618880 -> n29836347531329536;\nn29554872554618880 -> n30117822508040192;\nn30117822508040192 -> n29836347531329536;\nn29836347531329536 -> n30399297484750848;\nn29836347531329536 -> n30680772461461504;\nn30680772461461504 -> n30962247438172160;\nn30680772461461504 -> n31243722414882816;\nn31243722414882816 -> n31525197391593472;\nn30962247438172160 -> n31525197391593472;\nn30399297484750848 -> n31525197391593472;\nn31525197391593472 -> n29273397577908224;\nn31525197391593472 -> n31806672368304128;\nn31806672368304128 -> n32088147345014784;\nn31806672368304128 -> n32369622321725440;\nn32369622321725440 -> n32651097298436096;\nn32369622321725440 -> n32932572275146752;\nn32932572275146752 -> n33214047251857408;\nn32651097298436096 -> n33214047251857408;\nn32088147345014784 -> n33214047251857408;\nn33214047251857408 -> n33495522228568064;\nn33214047251857408 -> n33776997205278720;\nn33776997205278720 -> n33495522228568064;\nn33495522228568064 -> n34058472181989376;\nn33495522228568064 -> n34339947158700032;\nn34339947158700032 -> n34058472181989376;\nn34058472181989376 -> n34621422135410688;\nn34058472181989376 -> n34902897112121344;\nn34902897112121344 -> n35184372088832000;\nn34621422135410688 -> n35465847065542656;\nn34621422135410688 -> n35747322042253312;\nn35747322042253312 -> n36028797018963968;\nn35747322042253312 -> n36310271995674624;\nn36310271995674624 -> n36591746972385280;\nn36310271995674624 -> n36028797018963968;\nn36028797018963968 -> n36591746972385280;\nn35465847065542656 -> n36873221949095936;\nn35465847065542656 -> n35184372088832000;\nn35184372088832000 -> n36591746972385280;\nn36873221949095936 -> n36591746972385280;\nn36591746972385280 -> n29273397577908224;\nn29273397577908224 -> n37154696925806592;\nn29273397577908224 -> n37436171902517248;\nn37436171902517248 -> n37717646879227904;\nn37436171902517248 -> n37999121855938560;\nn37999121855938560 -> n38280596832649216;\nn37999121855938560 -> n38562071809359872;\nn38562071809359872 -> n38843546786070528;\nn38562071809359872 -> n39125021762781184;\nn39125021762781184 -> n39406496739491840;\nn38843546786070528 -> n39406496739491840;\nn38280596832649216 -> n39406496739491840;\nn39406496739491840 -> n39687971716202496;\nn37717646879227904 -> n39969446692913152;\nn37717646879227904 -> n40250921669623808;\nn40250921669623808 -> n40532396646334464;\nn40250921669623808 -> n40813871623045120;\nn40813871623045120 -> n41095346599755776;\nn40532396646334464 -> n41095346599755776;\nn39969446692913152 -> n41095346599755776;\nn41095346599755776 -> n39687971716202496;\nn39687971716202496 -> n41376821576466432;\nn37154696925806592 -> n41658296553177088;\nn37154696925806592 -> n41939771529887744;\nn41939771529887744 -> n42221246506598400;\nn41939771529887744 -> n42502721483309056;\nn42502721483309056 -> n41658296553177088;\nn42502721483309056 -> n42221246506598400;\nn42221246506598400 -> n41658296553177088;\nn42221246506598400 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn41658296553177088 -> n43065671436730368;\nn43065671436730368 -> n41376821576466432;\nn41376821576466432 -> n43347146413441024;\nn41376821576466432 -> n43628621390151680;\nn43628621390151680 -> n43910096366862336;\nn43628621390151680 -> n44191571343572992;\nn44191571343572992 -> n44473046320283648;\nn44191571343572992 -> n44754521296994304;\nn44754521296994304 -> n43347146413441024;\nn44754521296994304 -> n44473046320283648;\nn44473046320283648 -> n43910096366862336;\nn43910096366862336 -> n43347146413441024;\nn43347146413441024 -> n25895697857380352;\nn25895697857380352 -> n45035996273704960;\nn25895697857380352 -> n45317471250415616;\nn45317471250415616 -> n45035996273704960;\nn45317471250415616 -> n45598946227126272;\nn45598946227126272 -> n45035996273704960;\nn45035996273704960 -> n45880421203836928;\nn45035996273704960 -> n46161896180547584;\nn46161896180547584 -> n46443371157258240;\nn46161896180547584 -> n45880421203836928;\nn45880421203836928 -> n46724846133968896;\nn45880421203836928 -> n47006321110679552;\nn47006321110679552 -> n46724846133968896;\nn46724846133968896 -> n47287796087390208;\nn46724846133968896 -> n47569271064100864;\nn47569271064100864 -> n47287796087390208;\nn47569271064100864 -> n47850746040811520;\nn47850746040811520 -> n48132221017522176;\nn47850746040811520 -> n48413695994232832;\nn48413695994232832 -> n48132221017522176;\nn48132221017522176 -> n48695170970943488;\nn48132221017522176 -> n48976645947654144;\nn48976645947654144 -> n49258120924364800;\nn48976645947654144 -> n49539595901075456;\nn49539595901075456 -> n49258120924364800;\nn49258120924364800 -> n49821070877786112;\nn49258120924364800 -> n50102545854496768;\nn50102545854496768 -> n49821070877786112;\nn49821070877786112 -> n48695170970943488;\nn48695170970943488 -> n47287796087390208;\nn48695170970943488 -> n50384020831207424;\nn50384020831207424 -> n47287796087390208;\nn50384020831207424 -> n50665495807918080;\nn50665495807918080 -> n50946970784628736;\nn50665495807918080 -> n51228445761339392;\nn51228445761339392 -> n50946970784628736;\nn50946970784628736 -> n47287796087390208;\nn50946970784628736 -> n51509920738050048;\nn51509920738050048 -> n47287796087390208;\nn47287796087390208 -> n51791395714760704;\nn47287796087390208 -> n52072870691471360;\nn52072870691471360 -> n51791395714760704;\nn52072870691471360 -> n52354345668182016;\nn52354345668182016 -> n51791395714760704;\nn52354345668182016 -> n52635820644892672;\nn52635820644892672 -> n52917295621603328;\nn52635820644892672 -> n53198770598313984;\nn53198770598313984 -> n52917295621603328;\nn52917295621603328 -> n51791395714760704;\nn51791395714760704 -> n46443371157258240;\nn46443371157258240 -> n53480245575024640;\nn46443371157258240 -> n53761720551735296;\nn53761720551735296 -> n53480245575024640;\nn53761720551735296 -> n54043195528445952;\nn54043195528445952 -> n54324670505156608;\nn54043195528445952 -> n54606145481867264;\nn54606145481867264 -> n54887620458577920;\nn53480245575024640 -> n54324670505156608;\nn54324670505156608 -> n54887620458577920;\nn22799473113563136 -> n55169095435288576;\nn22799473113563136 -> n55450570411999232;\nn55450570411999232 -> n55169095435288576;\nn55169095435288576 -> n55732045388709888;\nn55169095435288576 -> n56013520365420544;\nn56013520365420544 -> n56294995342131200;\nn56013520365420544 -> n56576470318841856;\nn56576470318841856 -> n56857945295552512;\nn56576470318841856 -> n57139420272263168;\nn57139420272263168 -> n57420895248973824;\nn57139420272263168 -> n57702370225684480;\nn57702370225684480 -> n57983845202395136;\nn57702370225684480 -> n58265320179105792;\nn58265320179105792 -> n55732045388709888;\nn58265320179105792 -> n57983845202395136;\nn57983845202395136 -> n58546795155816448;\nn57420895248973824 -> n58828270132527104;\nn57420895248973824 -> n59109745109237760;\nn59109745109237760 -> n62205969853054976;\nn62205969853054976 -> n59391220085948416;\nn62205969853054976 -> n59672695062659072;\nn59672695062659072 -> n59391220085948416;\nn59672695062659072 -> n59954170039369728;\nn59954170039369728 -> n60235645016080384;\nn59954170039369728 -> n60517119992791040;\nn60517119992791040 -> n60235645016080384;\nn60235645016080384 -> n59391220085948416;\nn59391220085948416 -> n60798594969501696;\nn59391220085948416 -> n61080069946212352;\nn61080069946212352 -> n60798594969501696;\nn60798594969501696 -> n61361544922923008;\nn60798594969501696 -> n61643019899633664;\nn61643019899633664 -> n61924494876344320;\nn61361544922923008 -> n61924494876344320;\nn61924494876344320 -> n62205969853054976;\nn61924494876344320 -> n62487444829765632;\nn62487444829765632 -> n58828270132527104;\nn58828270132527104 -> n62768919806476288;\nn58828270132527104 -> n63050394783186944;\nn63050394783186944 -> n63331869759897600;\nn62768919806476288 -> n63331869759897600;\nn63331869759897600 -> n66146619527004160;\nn66146619527004160 -> n63613344736608256;\nn66146619527004160 -> n63894819713318912;\nn63894819713318912 -> n63613344736608256;\nn63613344736608256 -> n64176294690029568;\nn63613344736608256 -> n64457769666740224;\nn64457769666740224 -> n64739244643450880;\nn64457769666740224 -> n65020719620161536;\nn65020719620161536 -> n64739244643450880;\nn64739244643450880 -> n65302194596872192;\nn64739244643450880 -> n64176294690029568;\nn64176294690029568 -> n65583669573582848;\nn64176294690029568 -> n65865144550293504;\nn65865144550293504 -> n65583669573582848;\nn65583669573582848 -> n66146619527004160;\nn65302194596872192 -> n58546795155816448;\nn56857945295552512 -> n66428094503714816;\nn56857945295552512 -> n66709569480425472;\nn66709569480425472 -> n66991044457136128;\nn66709569480425472 -> n66428094503714816;\nn66428094503714816 -> n66991044457136128;\nn66991044457136128 -> n67272519433846784;\nn66991044457136128 -> n67553994410557440;\nn67553994410557440 -> n67272519433846784;\nn67272519433846784 -> n67835469387268096;\nn67272519433846784 -> n68116944363978752;\nn68116944363978752 -> n67835469387268096;\nn68116944363978752 -> n68398419340689408;\nn68398419340689408 -> n67835469387268096;\nn68398419340689408 -> n68679894317400064;\nn68679894317400064 -> n67835469387268096;\nn68679894317400064 -> n68961369294110720;\nn68961369294110720 -> n69242844270821376;\nn67835469387268096 -> n69242844270821376;\nn69242844270821376 -> n69524319247532032;\nn69242844270821376 -> n69805794224242688;\nn69805794224242688 -> n70087269200953344;\nn69805794224242688 -> n69524319247532032;\nn69524319247532032 -> n70087269200953344;\nn69524319247532032 -> n70368744177664000;\nn70368744177664000 -> n70650219154374656;\nn70368744177664000 -> n70931694131085312;\nn70931694131085312 -> n58546795155816448;\nn70650219154374656 -> n70087269200953344;\nn70087269200953344 -> n58546795155816448;\nn56294995342131200 -> n71213169107795968;\nn56294995342131200 -> n71494644084506624;\nn71494644084506624 -> n55732045388709888;\nn71494644084506624 -> n71776119061217280;\nn71776119061217280 -> n58546795155816448;\nn71213169107795968 -> n72057594037927936;\nn71213169107795968 -> n72339069014638592;\nn72339069014638592 -> n72057594037927936;\nn72057594037927936 -> n72620543991349248;\nn72057594037927936 -> n72902018968059904;\nn72902018968059904 -> n72620543991349248;\nn72620543991349248 -> n73183493944770560;\nn72620543991349248 -> n73464968921481216;\nn73464968921481216 -> n73183493944770560;\nn73183493944770560 -> n73746443898191872;\nn73183493944770560 -> n74027918874902528;\nn74027918874902528 -> n74309393851613184;\nn74027918874902528 -> n73746443898191872;\nn73746443898191872 -> n74309393851613184;\nn74309393851613184 -> n74590868828323840;\nn74309393851613184 -> n74872343805034496;\nn74872343805034496 -> n75153818781745152;\nn74872343805034496 -> n74590868828323840;\nn74590868828323840 -> n75153818781745152;\nn75153818781745152 -> n75435293758455808;\nn75153818781745152 -> n75716768735166464;\nn75716768735166464 -> n75435293758455808;\nn75435293758455808 -> n75998243711877120;\nn75435293758455808 -> n76279718688587776;\nn76279718688587776 -> n75998243711877120;\nn75998243711877120 -> n76561193665298432;\nn75998243711877120 -> n76842668642009088;\nn76842668642009088 -> n76561193665298432;\nn76561193665298432 -> n77124143618719744;\nn76561193665298432 -> n77405618595430400;\nn77405618595430400 -> n77124143618719744;\nn77405618595430400 -> n77687093572141056;\nn77687093572141056 -> n77968568548851712;\nn77124143618719744 -> n78250043525562368;\nn77124143618719744 -> n78531518502273024;\nn78531518502273024 -> n81627743246090240;\nn81627743246090240 -> n78250043525562368;\nn81627743246090240 -> n78812993478983680;\nn78812993478983680 -> n79094468455694336;\nn78812993478983680 -> n79375943432404992;\nn79375943432404992 -> n79094468455694336;\nn79375943432404992 -> n79657418409115648;\nn79657418409115648 -> n79094468455694336;\nn79657418409115648 -> n79938893385826304;\nn79938893385826304 -> n80220368362536960;\nn79938893385826304 -> n79094468455694336;\nn79094468455694336 -> n80501843339247616;\nn79094468455694336 -> n80783318315958272;\nn80783318315958272 -> n80501843339247616;\nn80783318315958272 -> n81064793292668928;\nn81064793292668928 -> n81346268269379584;\nn81064793292668928 -> n80501843339247616;\nn80501843339247616 -> n81627743246090240;\nn80501843339247616 -> n81909218222800896;\nn81909218222800896 -> n78250043525562368;\nn80220368362536960 -> n77968568548851712;\nn81346268269379584 -> n82190693199511552;\nn81346268269379584 -> n82472168176222208;\nn82472168176222208 -> n82190693199511552;\nn82472168176222208 -> n82753643152932864;\nn82753643152932864 -> n83035118129643520;\nn82190693199511552 -> n83035118129643520;\nn82190693199511552 -> n83316593106354176;\nn83316593106354176 -> n83035118129643520;\nn83316593106354176 -> n83598068083064832;\nn83598068083064832 -> n83879543059775488;\nn83598068083064832 -> n84161018036486144;\nn84161018036486144 -> n83879543059775488;\nn84161018036486144 -> n84442493013196800;\nn84442493013196800 -> n84723967989907456;\nn84442493013196800 -> n83879543059775488;\nn83879543059775488 -> n83316593106354176;\nn83879543059775488 -> n85005442966618112;\nn85005442966618112 -> n83035118129643520;\nn84723967989907456 -> n83035118129643520;\nn83035118129643520 -> n77968568548851712;\nn77968568548851712 -> n85286917943328768;\nn77968568548851712 -> n78250043525562368;\nn78250043525562368 -> n85286917943328768;\nn85286917943328768 -> n85568392920039424;\nn85286917943328768 -> n85849867896750080;\nn85849867896750080 -> n85568392920039424;\nn85568392920039424 -> n86131342873460736;\nn85568392920039424 -> n86412817850171392;\nn86412817850171392 -> n86131342873460736;\nn86131342873460736 -> n86694292826882048;\nn86131342873460736 -> n86975767803592704;\nn86975767803592704 -> n86694292826882048;\nn86694292826882048 -> n87257242780303360;\nn86694292826882048 -> n87538717757014016;\nn87538717757014016 -> n87257242780303360;\nn87257242780303360 -> n87820192733724672;\nn87257242780303360 -> n88101667710435328;\nn88101667710435328 -> n87820192733724672;\nn87820192733724672 -> n88383142687145984;\nn87820192733724672 -> n88664617663856640;\nn88664617663856640 -> n88946092640567296;\nn88664617663856640 -> n89227567617277952;\nn89227567617277952 -> n88946092640567296;\nn88946092640567296 -> n89509042593988608;\nn88383142687145984 -> n89790517570699264;\nn88383142687145984 -> n90071992547409920;\nn90071992547409920 -> n89790517570699264;\nn89790517570699264 -> n90353467524120576;\nn89790517570699264 -> n90634942500831232;\nn90634942500831232 -> n90916417477541888;\nn90634942500831232 -> n90353467524120576;\nn90353467524120576 -> n90916417477541888;\nn90353467524120576 -> n91197892454252544;\nn91197892454252544 -> n90916417477541888;\nn91197892454252544 -> n91479367430963200;\nn91479367430963200 -> n91760842407673856;\nn91479367430963200 -> n92042317384384512;\nn92042317384384512 -> n91760842407673856;\nn91760842407673856 -> n92323792361095168;\nn91760842407673856 -> n92605267337805824;\nn92605267337805824 -> n92323792361095168;\nn92323792361095168 -> n89509042593988608;\nn90916417477541888 -> n92886742314516480;\nn90916417477541888 -> n93168217291227136;\nn93168217291227136 -> n92886742314516480;\nn92886742314516480 -> n93449692267937792;\nn92886742314516480 -> n93731167244648448;\nn93731167244648448 -> n93449692267937792;\nn93449692267937792 -> n94012642221359104;\nn93449692267937792 -> n94294117198069760;\nn94294117198069760 -> n94012642221359104;\nn94294117198069760 -> n94575592174780416;\nn94575592174780416 -> n94012642221359104;\nn94012642221359104 -> n94857067151491072;\nn94012642221359104 -> n95138542128201728;\nn95138542128201728 -> n94857067151491072;\nn94857067151491072 -> n89509042593988608;\nn89509042593988608 -> n121034239985582080;\nn121034239985582080 -> n58546795155816448;\nn58546795155816448 -> n95420017104912384;\nn58546795155816448 -> n95701492081623040;\nn95701492081623040 -> n95982967058333696;\nn55732045388709888 -> n96264442035044352;\nn55732045388709888 -> n96545917011755008;\nn96545917011755008 -> n96264442035044352;\nn96545917011755008 -> n96827391988465664;\nn96827391988465664 -> n96264442035044352;\nn96827391988465664 -> n97108866965176320;\nn97108866965176320 -> n96264442035044352;\nn97108866965176320 -> n97390341941886976;\nn97390341941886976 -> n96264442035044352;\nn97390341941886976 -> n97671816918597632;\nn97671816918597632 -> n97953291895308288;\nn97671816918597632 -> n98234766872018944;\nn98234766872018944 -> n98516241848729600;\nn98234766872018944 -> n98797716825440256;\nn98797716825440256 -> n96264442035044352;\nn98797716825440256 -> n99079191802150912;\nn99079191802150912 -> n99360666778861568;\nn98516241848729600 -> n99642141755572224;\nn97953291895308288 -> n99360666778861568;\nn99360666778861568 -> n99642141755572224;\nn99642141755572224 -> n96264442035044352;\nn96264442035044352 -> n99923616732282880;\nn96264442035044352 -> n100205091708993536;\nn100205091708993536 -> n100486566685704192;\nn100205091708993536 -> n100768041662414848;\nn100768041662414848 -> n100486566685704192;\nn100768041662414848 -> n101049516639125504;\nn101049516639125504 -> n100486566685704192;\nn100486566685704192 -> n101330991615836160;\nn100486566685704192 -> n101612466592546816;\nn101612466592546816 -> n99923616732282880;\nn101612466592546816 -> n101893941569257472;\nn101893941569257472 -> n99923616732282880;\nn101330991615836160 -> n99923616732282880;\nn101330991615836160 -> n102175416545968128;\nn102175416545968128 -> n99923616732282880;\nn102175416545968128 -> n102456891522678784;\nn102456891522678784 -> n99923616732282880;\nn102456891522678784 -> n102738366499389440;\nn102738366499389440 -> n99923616732282880;\nn102738366499389440 -> n103019841476100096;\nn103019841476100096 -> n99923616732282880;\nn99923616732282880 -> n103301316452810752;\nn99923616732282880 -> n103582791429521408;\nn103582791429521408 -> n103864266406232064;\nn103582791429521408 -> n104145741382942720;\nn104145741382942720 -> n103864266406232064;\nn103864266406232064 -> n103301316452810752;\nn103864266406232064 -> n104427216359653376;\nn104427216359653376 -> n106397541196627968;\nn106397541196627968 -> n104708691336364032;\nn106397541196627968 -> n104990166313074688;\nn104990166313074688 -> n104708691336364032;\nn104708691336364032 -> n105271641289785344;\nn104708691336364032 -> n105553116266496000;\nn105553116266496000 -> n105271641289785344;\nn105271641289785344 -> n105834591243206656;\nn105271641289785344 -> n106116066219917312;\nn106116066219917312 -> n105834591243206656;\nn105834591243206656 -> n106397541196627968;\nn105834591243206656 -> n103301316452810752;\nn103301316452810752 -> n106679016173338624;\nn103301316452810752 -> n106960491150049280;\nn106960491150049280 -> n106679016173338624;\nn106679016173338624 -> n107241966126759936;\nn106679016173338624 -> n107523441103470592;\nn107523441103470592 -> n115686215428079616;\nn115686215428079616 -> n107804916080181248;\nn115686215428079616 -> n108086391056891904;\nn108086391056891904 -> n108367866033602560;\nn108086391056891904 -> n108649341010313216;\nn108649341010313216 -> n108367866033602560;\nn108367866033602560 -> n107804916080181248;\nn108367866033602560 -> n108930815987023872;\nn108930815987023872 -> n109212290963734528;\nn108930815987023872 -> n109493765940445184;\nn109493765940445184 -> n109212290963734528;\nn109212290963734528 -> n107804916080181248;\nn109212290963734528 -> n109775240917155840;\nn109775240917155840 -> n110056715893866496;\nn109775240917155840 -> n110338190870577152;\nn110338190870577152 -> n110056715893866496;\nn110056715893866496 -> n110619665847287808;\nn110056715893866496 -> n110901140823998464;\nn110901140823998464 -> n110619665847287808;\nn110619665847287808 -> n111182615800709120;\nn110619665847287808 -> n111464090777419776;\nn111464090777419776 -> n111182615800709120;\nn111182615800709120 -> n107804916080181248;\nn111182615800709120 -> n111745565754130432;\nn111745565754130432 -> n107804916080181248;\nn111745565754130432 -> n112027040730841088;\nn112027040730841088 -> n107804916080181248;\nn112027040730841088 -> n112308515707551744;\nn112308515707551744 -> n112589990684262400;\nn112308515707551744 -> n107804916080181248;\nn107804916080181248 -> n112871465660973056;\nn107804916080181248 -> n113152940637683712;\nn113152940637683712 -> n112871465660973056;\nn112871465660973056 -> n113434415614394368;\nn112871465660973056 -> n113715890591105024;\nn113715890591105024 -> n113997365567815680;\nn113715890591105024 -> n114278840544526336;\nn114278840544526336 -> n113997365567815680;\nn113997365567815680 -> n114560315521236992;\nn113997365567815680 -> n113434415614394368;\nn113434415614394368 -> n114560315521236992;\nn113434415614394368 -> n114841790497947648;\nn114841790497947648 -> n114560315521236992;\nn114560315521236992 -> n115123265474658304;\nn114560315521236992 -> n115404740451368960;\nn115404740451368960 -> n115123265474658304;\nn115123265474658304 -> n115686215428079616;\nn115123265474658304 -> n107241966126759936;\nn107241966126759936 -> n115967690404790272;\nn107241966126759936 -> n116249165381500928;\nn116249165381500928 -> n115967690404790272;\nn115967690404790272 -> n116530640358211584;\nn115967690404790272 -> n116812115334922240;\nn116812115334922240 -> n117093590311632896;\nn116812115334922240 -> n117375065288343552;\nn117375065288343552 -> n117093590311632896;\nn117093590311632896 -> n117656540265054208;\nn117093590311632896 -> n117938015241764864;\nn117938015241764864 -> n118219490218475520;\nn112589990684262400 -> n118500965195186176;\nn112589990684262400 -> n118782440171896832;\nn118782440171896832 -> n118500965195186176;\nn118782440171896832 -> n119063915148607488;\nn119063915148607488 -> n118500965195186176;\nn118500965195186176 -> n119345390125318144;\nn118500965195186176 -> n119626865102028800;\nn119626865102028800 -> n119345390125318144;\nn119626865102028800 -> n119908340078739456;\nn119908340078739456 -> n120189815055450112;\nn119345390125318144 -> n120471290032160768;\nn119345390125318144 -> n120752765008871424;\nn120752765008871424 -> n120471290032160768;\nn120471290032160768 -> n120189815055450112;\nn120189815055450112 -> n121034239985582080;\nn116530640358211584 -> n118219490218475520;\nn118219490218475520 -> n121315714962292736;\nn118219490218475520 -> n121597189939003392;\nn121597189939003392 -> n121315714962292736;\nn121315714962292736 -> n121878664915714048;\nn121315714962292736 -> n122160139892424704;\nn122160139892424704 -> n122441614869135360;\nn122160139892424704 -> n122723089845846016;\nn122723089845846016 -> n122441614869135360;\nn122441614869135360 -> n123004564822556672;\nn122441614869135360 -> n123286039799267328;\nn123286039799267328 -> n123004564822556672;\nn123004564822556672 -> n121878664915714048;\nn123004564822556672 -> n123567514775977984;\nn123567514775977984 -> n123848989752688640;\nn123567514775977984 -> n124130464729399296;\nn124130464729399296 -> n123848989752688640;\nn123848989752688640 -> n124411939706109952;\nn123848989752688640 -> n121878664915714048;\nn121878664915714048 -> n124411939706109952;\nn124411939706109952 -> n117656540265054208;\nn124411939706109952 -> n124693414682820608;\nn124693414682820608 -> n124974889659531264;\nn124693414682820608 -> n125256364636241920;\nn125256364636241920 -> n124974889659531264;\nn124974889659531264 -> n117656540265054208;\nn124974889659531264 -> n125537839612952576;\nn125537839612952576 -> n125819314589663232;\nn125537839612952576 -> n126100789566373888;\nn126100789566373888 -> n117656540265054208;\nn126100789566373888 -> n125819314589663232;\nn125819314589663232 -> n117656540265054208;\nn117656540265054208 -> n126382264543084544;\nn117656540265054208 -> n126663739519795200;\nn126663739519795200 -> n126382264543084544;\nn126382264543084544 -> n126945214496505856;\nn126382264543084544 -> n127226689473216512;\nn127226689473216512 -> n127508164449927168;\nn127226689473216512 -> n127789639426637824;\nn127789639426637824 -> n127508164449927168;\nn127789639426637824 -> n128071114403348480;\nn128071114403348480 -> n128352589380059136;\nn128071114403348480 -> n128634064356769792;\nn128634064356769792 -> n128352589380059136;\nn128352589380059136 -> n128915539333480448;\nn128352589380059136 -> n129197014310191104;\nn129197014310191104 -> n129478489286901760;\nn129197014310191104 -> n129759964263612416;\nn129759964263612416 -> n129478489286901760;\nn129478489286901760 -> n130041439240323072;\nn129478489286901760 -> n128915539333480448;\nn128915539333480448 -> n130322914217033728;\nn128915539333480448 -> n130604389193744384;\nn130604389193744384 -> n130322914217033728;\nn130322914217033728 -> n127508164449927168;\nn130322914217033728 -> n130041439240323072;\nn130041439240323072 -> n130885864170455040;\nn130041439240323072 -> n131167339147165696;\nn131167339147165696 -> n130885864170455040;\nn130885864170455040 -> n131448814123876352;\nn130885864170455040 -> n131730289100587008;\nn131730289100587008 -> n131448814123876352;\nn131448814123876352 -> n132011764077297664;\nn131448814123876352 -> n132293239054008320;\nn132293239054008320 -> n132011764077297664;\nn132011764077297664 -> n132574714030718976;\nn132011764077297664 -> n132856189007429632;\nn132856189007429632 -> n133137663984140288;\nn132856189007429632 -> n133419138960850944;\nn133419138960850944 -> n133137663984140288;\nn133137663984140288 -> n133700613937561600;\nn133137663984140288 -> n133982088914272256;\nn133982088914272256 -> n133700613937561600;\nn133700613937561600 -> n132574714030718976;\nn133700613937561600 -> n134263563890982912;\nn134263563890982912 -> n132574714030718976;\nn134263563890982912 -> n134545038867693568;\nn134545038867693568 -> n132574714030718976;\nn134545038867693568 -> n134826513844404224;\nn134826513844404224 -> n135107988821114880;\nn134826513844404224 -> n135389463797825536;\nn135389463797825536 -> n135107988821114880;\nn135389463797825536 -> n135670938774536192;\nn135670938774536192 -> n135952413751246848;\nn135107988821114880 -> n136233888727957504;\nn135107988821114880 -> n136515363704668160;\nn136515363704668160 -> n136233888727957504;\nn136233888727957504 -> n135952413751246848;\nn135952413751246848 -> n132574714030718976;\nn132574714030718976 -> n127508164449927168;\nn127508164449927168 -> n136796838681378816;\nn127508164449927168 -> n137078313658089472;\nn137078313658089472 -> n136796838681378816;\nn136796838681378816 -> n137359788634800128;\nn136796838681378816 -> n137641263611510784;\nn137641263611510784 -> n137922738588221440;\nn137641263611510784 -> n138204213564932096;\nn138204213564932096 -> n137922738588221440;\nn137922738588221440 -> n138485688541642752;\nn137922738588221440 -> n137359788634800128;\nn137359788634800128 -> n138485688541642752;\nn137359788634800128 -> n138767163518353408;\nn138767163518353408 -> n138485688541642752;\nn138485688541642752 -> n139048638495064064;\nn138485688541642752 -> n139330113471774720;\nn139330113471774720 -> n139048638495064064;\nn139048638495064064 -> n127226689473216512;\nn139048638495064064 -> n126945214496505856;\nn126945214496505856 -> n121034239985582080;\nn126945214496505856 -> n139611588448485376;\nn139611588448485376 -> n139893063425196032;\nn139611588448485376 -> n140174538401906688;\nn140174538401906688 -> n139893063425196032;\nn139893063425196032 -> n121034239985582080;\nn139893063425196032 -> n140456013378617344;\nn140456013378617344 -> n140737488355328000;\nn140456013378617344 -> n141018963332038656;\nn141018963332038656 -> n140737488355328000;\nn140737488355328000 -> n141300438308749312;\nn140737488355328000 -> n141581913285459968;\nn141581913285459968 -> n141300438308749312;\nn141300438308749312 -> n121034239985582080;\nn141300438308749312 -> n141863388262170624;\nn141863388262170624 -> n121034239985582080;\nn141863388262170624 -> n142144863238881280;\nn142144863238881280 -> n142426338215591936;\nn142144863238881280 -> n142707813192302592;\nn142707813192302592 -> n142426338215591936;\nn142426338215591936 -> n142989288169013248;\nn142426338215591936 -> n143270763145723904;\nn143270763145723904 -> n142989288169013248;\nn143270763145723904 -> n143552238122434560;\nn143552238122434560 -> n143833713099145216;\nn142989288169013248 -> n143833713099145216;\nn143833713099145216 -> n121034239985582080;\nn143833713099145216 -> n144115188075855872;\nn144115188075855872 -> n144396663052566528;\nn144115188075855872 -> n144678138029277184;\nn144678138029277184 -> n144396663052566528;\nn144396663052566528 -> n144959613005987840;\nn144396663052566528 -> n145241087982698496;\nn145241087982698496 -> n144959613005987840;\nn144959613005987840 -> n145522562959409152;\nn144959613005987840 -> n145804037936119808;\nn145804037936119808 -> n145522562959409152;\nn145522562959409152 -> n146085512912830464;\nn145522562959409152 -> n146366987889541120;\nn146366987889541120 -> n146085512912830464;\nn146085512912830464 -> n146648462866251776;\nn146085512912830464 -> n146929937842962432;\nn146929937842962432 -> n147211412819673088;\nn146929937842962432 -> n147492887796383744;\nn147492887796383744 -> n147211412819673088;\nn147211412819673088 -> n147774362773094400;\nn147211412819673088 -> n146648462866251776;\nn146648462866251776 -> n147774362773094400;\nn147774362773094400 -> n148055837749805056;\nn147774362773094400 -> n148337312726515712;\nn148337312726515712 -> n148055837749805056;\nn148055837749805056 -> n148618787703226368;\nn148055837749805056 -> n148900262679937024;\nn148900262679937024 -> n149181737656647680;\nn148900262679937024 -> n149463212633358336;\nn149463212633358336 -> n149181737656647680;\nn149181737656647680 -> n148618787703226368;\nn149181737656647680 -> n149744687610068992;\nn149744687610068992 -> n148618787703226368;\nn148618787703226368 -> n150026162586779648;\nn148618787703226368 -> n150307637563490304;\nn150307637563490304 -> n150026162586779648;\nn150026162586779648 -> n150589112540200960;\nn150026162586779648 -> n150870587516911616;\nn150870587516911616 -> n150589112540200960;\nn150589112540200960 -> n151152062493622272;\nn150589112540200960 -> n151433537470332928;\nn151433537470332928 -> n151715012447043584;\nn151433537470332928 -> n151996487423754240;\nn151996487423754240 -> n151715012447043584;\nn151715012447043584 -> n152277962400464896;\nn151715012447043584 -> n151152062493622272;\nn151152062493622272 -> n152277962400464896;\nn152277962400464896 -> n152559437377175552;\nn152277962400464896 -> n152840912353886208;\nn152840912353886208 -> n152559437377175552;\nn152559437377175552 -> n153122387330596864;\nn152559437377175552 -> n153403862307307520;\nn153403862307307520 -> n153685337284018176;\nn153403862307307520 -> n153966812260728832;\nn153966812260728832 -> n153685337284018176;\nn153685337284018176 -> n154248287237439488;\nn153685337284018176 -> n153122387330596864;\nn153122387330596864 -> n154248287237439488;\nn154248287237439488 -> n154529762214150144;\nn154248287237439488 -> n154811237190860800;\nn154811237190860800 -> n154529762214150144;\nn154811237190860800 -> n155092712167571456;\nn155092712167571456 -> n155374187144282112;\nn155092712167571456 -> n154529762214150144;\nn154529762214150144 -> n155374187144282112;\nn155374187144282112 -> n121034239985582080;\nn5629499534213120 -> n58546795155816448;\nn5629499534213120 -> n155655662120992768;\nn155655662120992768 -> n58546795155816448;\nn155655662120992768 -> n155937137097703424;\nn155937137097703424 -> n169447935979814912;\nn169447935979814912 -> n156218612074414080;\nn169447935979814912 -> n156500087051124736;\nn156500087051124736 -> n156218612074414080;\nn156500087051124736 -> n156781562027835392;\nn156781562027835392 -> n157063037004546048;\nn156218612074414080 -> n157344511981256704;\nn156218612074414080 -> n157625986957967360;\nn157625986957967360 -> n157344511981256704;\nn157344511981256704 -> n157907461934678016;\nn157344511981256704 -> n158188936911388672;\nn158188936911388672 -> n158470411888099328;\nn158188936911388672 -> n158751886864809984;\nn158751886864809984 -> n158470411888099328;\nn158470411888099328 -> n159033361841520640;\nn158470411888099328 -> n159314836818231296;\nn159314836818231296 -> n159033361841520640;\nn159033361841520640 -> n159596311794941952;\nn157907461934678016 -> n159877786771652608;\nn157907461934678016 -> n160159261748363264;\nn160159261748363264 -> n159877786771652608;\nn159877786771652608 -> n159596311794941952;\nn159596311794941952 -> n160440736725073920;\nn159596311794941952 -> n160722211701784576;\nn160722211701784576 -> n161003686678495232;\nn160722211701784576 -> n161285161655205888;\nn161285161655205888 -> n161566636631916544;\nn161285161655205888 -> n161848111608627200;\nn161848111608627200 -> n162129586585337856;\nn161566636631916544 -> n162129586585337856;\nn161003686678495232 -> n162129586585337856;\nn162129586585337856 -> n162411061562048512;\nn160440736725073920 -> n162692536538759168;\nn160440736725073920 -> n162974011515469824;\nn162974011515469824 -> n163255486492180480;\nn162974011515469824 -> n163536961468891136;\nn163536961468891136 -> n163818436445601792;\nn163255486492180480 -> n163818436445601792;\nn162692536538759168 -> n163818436445601792;\nn163818436445601792 -> n162411061562048512;\nn162411061562048512 -> n157063037004546048;\nn157063037004546048 -> n164099911422312448;\nn157063037004546048 -> n164381386399023104;\nn164381386399023104 -> n164099911422312448;\nn164099911422312448 -> n164662861375733760;\nn164099911422312448 -> n164944336352444416;\nn164944336352444416 -> n164662861375733760;\nn164662861375733760 -> n165225811329155072;\nn164662861375733760 -> n165507286305865728;\nn165507286305865728 -> n165225811329155072;\nn165225811329155072 -> n165788761282576384;\nn165225811329155072 -> n166070236259287040;\nn166070236259287040 -> n165788761282576384;\nn166070236259287040 -> n166351711235997696;\nn166351711235997696 -> n166633186212708352;\nn166351711235997696 -> n166914661189419008;\nn166914661189419008 -> n166633186212708352;\nn166633186212708352 -> n167196136166129664;\nn166633186212708352 -> n167477611142840320;\nn167477611142840320 -> n167759086119550976;\nn167477611142840320 -> n168040561096261632;\nn168040561096261632 -> n167759086119550976;\nn167759086119550976 -> n168322036072972288;\nn167759086119550976 -> n168603511049682944;\nn168603511049682944 -> n168322036072972288;\nn168322036072972288 -> n167196136166129664;\nn167196136166129664 -> n165788761282576384;\nn165788761282576384 -> n168884986026393600;\nn165788761282576384 -> n169166461003104256;\nn169166461003104256 -> n168884986026393600;\nn168884986026393600 -> n169447935979814912;\nn168884986026393600 -> n169729410956525568;\nn169729410956525568 -> n58546795155816448;\nn2814749767106560 -> n95982967058333696;\nn95982967058333696 -> n170010885933236224;\nn95982967058333696 -> n170292360909946880;\nn170292360909946880 -> n170010885933236224;\nn170292360909946880 -> n170573835886657536;\nn170573835886657536 -> n170010885933236224;\nn170573835886657536 -> n170855310863368192;\nn170855310863368192 -> n170010885933236224;\nn170855310863368192 -> n171136785840078848;\nn171136785840078848 -> n170010885933236224;\nn170010885933236224 -> n171418260816789504;\nn170010885933236224 -> n171699735793500160;\nn171699735793500160 -> n171418260816789504;\nn171699735793500160 -> n171981210770210816;\nn171981210770210816 -> n178736610211266560;\nn178736610211266560 -> n172262685746921472;\nn178736610211266560 -> n172544160723632128;\nn172544160723632128 -> n172262685746921472;\nn172262685746921472 -> n172825635700342784;\nn172262685746921472 -> n173107110677053440;\nn173107110677053440 -> n173388585653764096;\nn173107110677053440 -> n172825635700342784;\nn172825635700342784 -> n173670060630474752;\nn172825635700342784 -> n173951535607185408;\nn173951535607185408 -> n173670060630474752;\nn173670060630474752 -> n174233010583896064;\nn173670060630474752 -> n174514485560606720;\nn174514485560606720 -> n174233010583896064;\nn174233010583896064 -> n174795960537317376;\nn174233010583896064 -> n175077435514028032;\nn175077435514028032 -> n175358910490738688;\nn175077435514028032 -> n175640385467449344;\nn175640385467449344 -> n175358910490738688;\nn175358910490738688 -> n175921860444160000;\nn175358910490738688 -> n176203335420870656;\nn176203335420870656 -> n176484810397581312;\nn176203335420870656 -> n176766285374291968;\nn176766285374291968 -> n176484810397581312;\nn176484810397581312 -> n175921860444160000;\nn175921860444160000 -> n177047760351002624;\nn175921860444160000 -> n177329235327713280;\nn177329235327713280 -> n177047760351002624;\nn177047760351002624 -> n173388585653764096;\nn174795960537317376 -> n177610710304423936;\nn174795960537317376 -> n177892185281134592;\nn177892185281134592 -> n177610710304423936;\nn177610710304423936 -> n173388585653764096;\nn173388585653764096 -> n178173660257845248;\nn173388585653764096 -> n178455135234555904;\nn178455135234555904 -> n178173660257845248;\nn178173660257845248 -> n178736610211266560;\nn178173660257845248 -> n171418260816789504;\nn281474976710656 -> n0[style=dotted];\nn1970324836974592 -> n1688849860263936[style=dotted];\nn1407374883553280 -> n281474976710656[style=dotted];\nn3096224743817216 -> n1407374883553280[style=dotted];\nn3377699720527872 -> n3096224743817216[style=dotted];\nn2533274790395904 -> n1688849860263936[style=dotted];\nn4222124650659840 -> n281474976710656[style=dotted];\nn95420017104912384 -> n4222124650659840[style=dotted];\nn4503599627370496 -> n95420017104912384[style=dotted];\nn5066549580791808 -> n4503599627370496[style=dotted];\nn6192449487634432 -> n5910974510923776[style=dotted];\nn7036874417766400 -> n6192449487634432[style=dotted];\nn8725724278030336 -> n8444249301319680[style=dotted];\nn7599824371187712 -> n7036874417766400[style=dotted];\nn9288674231451648 -> n7599824371187712[style=dotted];\nn9851624184872960 -> n9570149208162304[style=dotted];\nn10414574138294272 -> n7599824371187712[style=dotted];\nn10696049115004928 -> n10414574138294272[style=dotted];\nn12384898975268864 -> n10696049115004928[style=dotted];\nn19984723346456576 -> n12384898975268864[style=dotted];\nn20547673299877888 -> n19984723346456576[style=dotted];\nn21392098230009856 -> n19984723346456576[style=dotted];\nn54887620458577920 -> n21392098230009856[style=dotted];\nn23362423066984448 -> n23080948090273792[style=dotted];\nn22236523160141824 -> n54887620458577920[style=dotted];\nn23925373020405760 -> n22236523160141824[style=dotted];\nn26458647810801664 -> n26177172834091008[style=dotted];\nn24488322973827072 -> n23925373020405760[style=dotted];\nn27021597764222976 -> n24488322973827072[style=dotted];\nn28147497671065600 -> n27021597764222976[style=dotted];\nn27866022694354944 -> n24488322973827072[style=dotted];\nn28991922601197568 -> n24488322973827072[style=dotted];\nn29836347531329536 -> n29554872554618880[style=dotted];\nn31525197391593472 -> n29836347531329536[style=dotted];\nn33214047251857408 -> n31806672368304128[style=dotted];\nn33495522228568064 -> n33214047251857408[style=dotted];\nn34058472181989376 -> n33495522228568064[style=dotted];\nn36028797018963968 -> n35747322042253312[style=dotted];\nn35184372088832000 -> n34058472181989376[style=dotted];\nn36591746972385280 -> n34058472181989376[style=dotted];\nn29273397577908224 -> n28991922601197568[style=dotted];\nn39406496739491840 -> n37999121855938560[style=dotted];\nn41095346599755776 -> n37717646879227904[style=dotted];\nn39687971716202496 -> n37436171902517248[style=dotted];\nn42221246506598400 -> n41939771529887744[style=dotted];\nn41658296553177088 -> n37154696925806592[style=dotted];\nn43065671436730368 -> n37154696925806592[style=dotted];\nn41376821576466432 -> n29273397577908224[style=dotted];\nn44473046320283648 -> n44191571343572992[style=dotted];\nn43910096366862336 -> n43628621390151680[style=dotted];\nn43347146413441024 -> n41376821576466432[style=dotted];\nn25895697857380352 -> n23925373020405760[style=dotted];\nn45035996273704960 -> n25895697857380352[style=dotted];\nn45880421203836928 -> n45035996273704960[style=dotted];\nn46724846133968896 -> n45880421203836928[style=dotted];\nn48132221017522176 -> n47850746040811520[style=dotted];\nn49258120924364800 -> n48976645947654144[style=dotted];\nn49821070877786112 -> n49258120924364800[style=dotted];\nn48695170970943488 -> n48132221017522176[style=dotted];\nn50946970784628736 -> n50665495807918080[style=dotted];\nn47287796087390208 -> n46724846133968896[style=dotted];\nn52917295621603328 -> n52635820644892672[style=dotted];\nn51791395714760704 -> n47287796087390208[style=dotted];\nn46443371157258240 -> n45035996273704960[style=dotted];\nn53480245575024640 -> n46443371157258240[style=dotted];\nn54324670505156608 -> n46443371157258240[style=dotted];\nn22799473113563136 -> n22517998136852480[style=dotted];\nn55169095435288576 -> n22799473113563136[style=dotted];\nn57983845202395136 -> n57702370225684480[style=dotted];\nn62205969853054976 -> n59109745109237760[style=dotted];\nn60235645016080384 -> n59954170039369728[style=dotted];\nn59391220085948416 -> n62205969853054976[style=dotted];\nn60798594969501696 -> n59391220085948416[style=dotted];\nn61924494876344320 -> n60798594969501696[style=dotted];\nn58828270132527104 -> n57420895248973824[style=dotted];\nn63331869759897600 -> n58828270132527104[style=dotted];\nn66146619527004160 -> n63331869759897600[style=dotted];\nn63613344736608256 -> n66146619527004160[style=dotted];\nn64739244643450880 -> n64457769666740224[style=dotted];\nn64176294690029568 -> n63613344736608256[style=dotted];\nn65583669573582848 -> n64176294690029568[style=dotted];\nn66428094503714816 -> n56857945295552512[style=dotted];\nn66991044457136128 -> n56857945295552512[style=dotted];\nn67272519433846784 -> n66991044457136128[style=dotted];\nn67835469387268096 -> n67272519433846784[style=dotted];\nn69242844270821376 -> n67272519433846784[style=dotted];\nn69524319247532032 -> n69242844270821376[style=dotted];\nn70087269200953344 -> n69242844270821376[style=dotted];\nn72057594037927936 -> n71213169107795968[style=dotted];\nn72620543991349248 -> n72057594037927936[style=dotted];\nn73183493944770560 -> n72620543991349248[style=dotted];\nn73746443898191872 -> n73183493944770560[style=dotted];\nn74309393851613184 -> n73183493944770560[style=dotted];\nn74590868828323840 -> n74309393851613184[style=dotted];\nn75153818781745152 -> n74309393851613184[style=dotted];\nn75435293758455808 -> n75153818781745152[style=dotted];\nn75998243711877120 -> n75435293758455808[style=dotted];\nn76561193665298432 -> n75998243711877120[style=dotted];\nn77124143618719744 -> n76561193665298432[style=dotted];\nn81627743246090240 -> n78531518502273024[style=dotted];\nn79094468455694336 -> n78812993478983680[style=dotted];\nn80501843339247616 -> n79094468455694336[style=dotted];\nn82190693199511552 -> n81346268269379584[style=dotted];\nn83316593106354176 -> n82190693199511552[style=dotted];\nn83879543059775488 -> n83598068083064832[style=dotted];\nn83035118129643520 -> n81346268269379584[style=dotted];\nn77968568548851712 -> n76561193665298432[style=dotted];\nn78250043525562368 -> n76561193665298432[style=dotted];\nn85286917943328768 -> n76561193665298432[style=dotted];\nn85568392920039424 -> n85286917943328768[style=dotted];\nn86131342873460736 -> n85568392920039424[style=dotted];\nn86694292826882048 -> n86131342873460736[style=dotted];\nn87257242780303360 -> n86694292826882048[style=dotted];\nn87820192733724672 -> n87257242780303360[style=dotted];\nn88946092640567296 -> n88664617663856640[style=dotted];\nn89790517570699264 -> n88383142687145984[style=dotted];\nn90353467524120576 -> n89790517570699264[style=dotted];\nn91760842407673856 -> n91479367430963200[style=dotted];\nn92323792361095168 -> n91760842407673856[style=dotted];\nn90916417477541888 -> n89790517570699264[style=dotted];\nn92886742314516480 -> n90916417477541888[style=dotted];\nn93449692267937792 -> n92886742314516480[style=dotted];\nn94012642221359104 -> n93449692267937792[style=dotted];\nn94857067151491072 -> n94012642221359104[style=dotted];\nn89509042593988608 -> n87820192733724672[style=dotted];\nn121034239985582080 -> n55169095435288576[style=dotted];\nn58546795155816448 -> n5066549580791808[style=dotted];\nn55732045388709888 -> n55169095435288576[style=dotted];\nn99360666778861568 -> n97671816918597632[style=dotted];\nn99642141755572224 -> n97671816918597632[style=dotted];\nn96264442035044352 -> n55732045388709888[style=dotted];\nn100486566685704192 -> n100205091708993536[style=dotted];\nn99923616732282880 -> n96264442035044352[style=dotted];\nn103864266406232064 -> n103582791429521408[style=dotted];\nn106397541196627968 -> n104427216359653376[style=dotted];\nn104708691336364032 -> n106397541196627968[style=dotted];\nn105271641289785344 -> n104708691336364032[style=dotted];\nn105834591243206656 -> n105271641289785344[style=dotted];\nn103301316452810752 -> n99923616732282880[style=dotted];\nn106679016173338624 -> n103301316452810752[style=dotted];\nn115686215428079616 -> n107523441103470592[style=dotted];\nn108367866033602560 -> n108086391056891904[style=dotted];\nn109212290963734528 -> n108930815987023872[style=dotted];\nn110056715893866496 -> n109775240917155840[style=dotted];\nn110619665847287808 -> n110056715893866496[style=dotted];\nn111182615800709120 -> n110619665847287808[style=dotted];\nn107804916080181248 -> n115686215428079616[style=dotted];\nn112871465660973056 -> n107804916080181248[style=dotted];\nn113997365567815680 -> n113715890591105024[style=dotted];\nn113434415614394368 -> n112871465660973056[style=dotted];\nn114560315521236992 -> n112871465660973056[style=dotted];\nn115123265474658304 -> n114560315521236992[style=dotted];\nn107241966126759936 -> n106679016173338624[style=dotted];\nn115967690404790272 -> n107241966126759936[style=dotted];\nn117093590311632896 -> n116812115334922240[style=dotted];\nn118500965195186176 -> n112589990684262400[style=dotted];\nn119345390125318144 -> n118500965195186176[style=dotted];\nn120471290032160768 -> n119345390125318144[style=dotted];\nn120189815055450112 -> n118500965195186176[style=dotted];\nn118219490218475520 -> n115967690404790272[style=dotted];\nn121315714962292736 -> n118219490218475520[style=dotted];\nn122441614869135360 -> n122160139892424704[style=dotted];\nn123004564822556672 -> n122441614869135360[style=dotted];\nn123848989752688640 -> n123567514775977984[style=dotted];\nn121878664915714048 -> n121315714962292736[style=dotted];\nn124411939706109952 -> n121315714962292736[style=dotted];\nn124974889659531264 -> n124693414682820608[style=dotted];\nn125819314589663232 -> n125537839612952576[style=dotted];\nn117656540265054208 -> n115967690404790272[style=dotted];\nn126382264543084544 -> n117656540265054208[style=dotted];\nn127226689473216512 -> n126382264543084544[style=dotted];\nn128352589380059136 -> n128071114403348480[style=dotted];\nn129478489286901760 -> n129197014310191104[style=dotted];\nn128915539333480448 -> n128352589380059136[style=dotted];\nn130322914217033728 -> n128915539333480448[style=dotted];\nn130041439240323072 -> n128352589380059136[style=dotted];\nn130885864170455040 -> n130041439240323072[style=dotted];\nn131448814123876352 -> n130885864170455040[style=dotted];\nn132011764077297664 -> n131448814123876352[style=dotted];\nn133137663984140288 -> n132856189007429632[style=dotted];\nn133700613937561600 -> n133137663984140288[style=dotted];\nn135107988821114880 -> n134826513844404224[style=dotted];\nn136233888727957504 -> n135107988821114880[style=dotted];\nn135952413751246848 -> n134826513844404224[style=dotted];\nn132574714030718976 -> n132011764077297664[style=dotted];\nn127508164449927168 -> n127226689473216512[style=dotted];\nn136796838681378816 -> n127508164449927168[style=dotted];\nn137922738588221440 -> n137641263611510784[style=dotted];\nn137359788634800128 -> n136796838681378816[style=dotted];\nn138485688541642752 -> n136796838681378816[style=dotted];\nn139048638495064064 -> n138485688541642752[style=dotted];\nn126945214496505856 -> n126382264543084544[style=dotted];\nn139893063425196032 -> n139611588448485376[style=dotted];\nn140737488355328000 -> n140456013378617344[style=dotted];\nn141300438308749312 -> n140737488355328000[style=dotted];\nn142426338215591936 -> n142144863238881280[style=dotted];\nn142989288169013248 -> n142426338215591936[style=dotted];\nn143833713099145216 -> n142426338215591936[style=dotted];\nn144396663052566528 -> n144115188075855872[style=dotted];\nn144959613005987840 -> n144396663052566528[style=dotted];\nn145522562959409152 -> n144959613005987840[style=dotted];\nn146085512912830464 -> n145522562959409152[style=dotted];\nn147211412819673088 -> n146929937842962432[style=dotted];\nn146648462866251776 -> n146085512912830464[style=dotted];\nn147774362773094400 -> n146085512912830464[style=dotted];\nn148055837749805056 -> n147774362773094400[style=dotted];\nn149181737656647680 -> n148900262679937024[style=dotted];\nn148618787703226368 -> n148055837749805056[style=dotted];\nn150026162586779648 -> n148618787703226368[style=dotted];\nn150589112540200960 -> n150026162586779648[style=dotted];\nn151715012447043584 -> n151433537470332928[style=dotted];\nn151152062493622272 -> n150589112540200960[style=dotted];\nn152277962400464896 -> n150589112540200960[style=dotted];\nn152559437377175552 -> n152277962400464896[style=dotted];\nn153685337284018176 -> n153403862307307520[style=dotted];\nn153122387330596864 -> n152559437377175552[style=dotted];\nn154248287237439488 -> n152559437377175552[style=dotted];\nn154529762214150144 -> n154248287237439488[style=dotted];\nn155374187144282112 -> n154248287237439488[style=dotted];\nn169447935979814912 -> n155937137097703424[style=dotted];\nn156218612074414080 -> n169447935979814912[style=dotted];\nn157344511981256704 -> n156218612074414080[style=dotted];\nn158470411888099328 -> n158188936911388672[style=dotted];\nn159033361841520640 -> n158470411888099328[style=dotted];\nn159877786771652608 -> n157907461934678016[style=dotted];\nn159596311794941952 -> n157344511981256704[style=dotted];\nn162129586585337856 -> n160722211701784576[style=dotted];\nn163818436445601792 -> n160440736725073920[style=dotted];\nn162411061562048512 -> n159596311794941952[style=dotted];\nn157063037004546048 -> n169447935979814912[style=dotted];\nn164099911422312448 -> n157063037004546048[style=dotted];\nn164662861375733760 -> n164099911422312448[style=dotted];\nn165225811329155072 -> n164662861375733760[style=dotted];\nn166633186212708352 -> n166351711235997696[style=dotted];\nn167759086119550976 -> n167477611142840320[style=dotted];\nn168322036072972288 -> n167759086119550976[style=dotted];\nn167196136166129664 -> n166633186212708352[style=dotted];\nn165788761282576384 -> n165225811329155072[style=dotted];\nn168884986026393600 -> n165788761282576384[style=dotted];\nn2814749767106560 -> n281474976710656[style=dotted];\nn95982967058333696 -> n281474976710656[style=dotted];\nn170010885933236224 -> n95982967058333696[style=dotted];\nn178736610211266560 -> n171981210770210816[style=dotted];\nn172262685746921472 -> n178736610211266560[style=dotted];\nn172825635700342784 -> n172262685746921472[style=dotted];\nn173670060630474752 -> n172825635700342784[style=dotted];\nn174233010583896064 -> n173670060630474752[style=dotted];\nn175358910490738688 -> n175077435514028032[style=dotted];\nn176484810397581312 -> n176203335420870656[style=dotted];\nn175921860444160000 -> n175358910490738688[style=dotted];\nn177047760351002624 -> n175921860444160000[style=dotted];\nn177610710304423936 -> n174795960537317376[style=dotted];\nn173388585653764096 -> n172262685746921472[style=dotted];\nn178173660257845248 -> n173388585653764096[style=dotted];\nn171418260816789504 -> n170010885933236224[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-202.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn1407374883553280[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn2814749767106560[shape=rectangle, label=\"B8\"];\nn2533274790395904[shape=rectangle, label=\"B9\"];\nn3377699720527872[shape=rectangle, label=\"B10\"];\nn3940649673949184[shape=rectangle, label=\"B11\"];\nn3096224743817216[shape=rectangle, label=\"B12\"];\nn3659174697238528[shape=rectangle, label=\"B13\"];\nn4503599627370496[shape=rectangle, label=\"B14\"];\nn4222124650659840[shape=rectangle, label=\"B15\"];\nn1970324836974592[shape=rectangle, label=\"B16\"];\nn5348024557502464[shape=rectangle, label=\"B17\"];\nn5066549580791808[shape=rectangle, label=\"B18\"];\nn5910974510923776[shape=rectangle, label=\"B19\"];\nn7318349394477056[shape=rectangle, label=\"B20\"];\nn6473924464345088[shape=rectangle, label=\"B21\"];\nn6192449487634432[shape=rectangle, label=\"B22\"];\nn7036874417766400[shape=rectangle, label=\"B23\"];\nn6755399441055744[shape=rectangle, label=\"B24\"];\nn5629499534213120[shape=rectangle, label=\"B25\"];\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn7599824371187712[shape=rectangle, label=\"B27\"];\nn8444249301319680[shape=rectangle, label=\"B28\"];\nn9007199254740992[shape=rectangle, label=\"B29\"];\nn9288674231451648[shape=rectangle, label=\"B30\"];\nn8725724278030336[shape=rectangle, label=\"B31\"];\nn8162774324609024[shape=rectangle, label=\"B32\"];\nn9570149208162304[shape=rectangle, label=\"B33\"];\nn10133099161583616[shape=rectangle, label=\"B34\"];\nn9851624184872960[shape=rectangle, label=\"B35\"];\nn10696049115004928[shape=rectangle, label=\"B36\"];\nn11258999068426240[shape=rectangle, label=\"B37\"];\nn11540474045136896[shape=rectangle, label=\"B38\"];\nn10977524091715584[shape=rectangle, label=\"B39\"];\nn10414574138294272[shape=rectangle, label=\"B40\"];\nn12103423998558208[shape=rectangle, label=\"B41\"];\nn11821949021847552[shape=rectangle, label=\"B42\"];\nn12666373951979520[shape=rectangle, label=\"B43\"];\nn12384898975268864[shape=rectangle, label=\"B44\"];\nn4785074604081152[shape=rectangle, label=\"B45\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n844424930131968;\nn844424930131968 -> n1407374883553280;\nn844424930131968 -> n1688849860263936;\nn1688849860263936 -> n1407374883553280;\nn1407374883553280 -> n1970324836974592;\nn1407374883553280 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n2814749767106560;\nn2814749767106560 -> n2533274790395904;\nn2533274790395904 -> n3096224743817216;\nn2533274790395904 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn3377699720527872 -> n3940649673949184;\nn3940649673949184 -> n3377699720527872;\nn3940649673949184 -> n3096224743817216;\nn3096224743817216 -> n3659174697238528;\nn3659174697238528 -> n4222124650659840;\nn3659174697238528 -> n4503599627370496;\nn4503599627370496 -> n4222124650659840;\nn4222124650659840 -> n4785074604081152;\nn1970324836974592 -> n5066549580791808;\nn1970324836974592 -> n5348024557502464;\nn5348024557502464 -> n5066549580791808;\nn5066549580791808 -> n5629499534213120;\nn5066549580791808 -> n5910974510923776;\nn5910974510923776 -> n7318349394477056;\nn7318349394477056 -> n6192449487634432;\nn7318349394477056 -> n6473924464345088;\nn6473924464345088 -> n6192449487634432;\nn6192449487634432 -> n6755399441055744;\nn6192449487634432 -> n7036874417766400;\nn7036874417766400 -> n6755399441055744;\nn6755399441055744 -> n7318349394477056;\nn6755399441055744 -> n5629499534213120;\nn5629499534213120 -> n7599824371187712;\nn5629499534213120 -> n7881299347898368;\nn7881299347898368 -> n7599824371187712;\nn7599824371187712 -> n8162774324609024;\nn7599824371187712 -> n8444249301319680;\nn8444249301319680 -> n8725724278030336;\nn8444249301319680 -> n9007199254740992;\nn9007199254740992 -> n9288674231451648;\nn9288674231451648 -> n9288674231451648[style=dashed];\nn9288674231451648 -> n8725724278030336;\nn8725724278030336 -> n9570149208162304;\nn8162774324609024 -> n9570149208162304;\nn9570149208162304 -> n9851624184872960;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n9851624184872960;\nn9851624184872960 -> n10414574138294272;\nn9851624184872960 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n11540474045136896;\nn11540474045136896 -> n11540474045136896[style=dashed];\nn11540474045136896 -> n10977524091715584;\nn10977524091715584 -> n10414574138294272;\nn10414574138294272 -> n11821949021847552;\nn10414574138294272 -> n12103423998558208;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn11821949021847552 -> n12666373951979520;\nn12666373951979520 -> n12384898975268864;\nn12384898975268864 -> n4785074604081152;\nn281474976710656 -> n0[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\nn1407374883553280 -> n844424930131968[style=dotted];\nn2533274790395904 -> n2251799813685248[style=dotted];\nn3377699720527872 -> n2533274790395904[style=dotted];\nn3096224743817216 -> n2533274790395904[style=dotted];\nn3659174697238528 -> n2533274790395904[style=dotted];\nn4222124650659840 -> n3659174697238528[style=dotted];\nn5066549580791808 -> n1970324836974592[style=dotted];\nn7318349394477056 -> n5910974510923776[style=dotted];\nn6192449487634432 -> n7318349394477056[style=dotted];\nn6755399441055744 -> n6192449487634432[style=dotted];\nn5629499534213120 -> n5066549580791808[style=dotted];\nn7599824371187712 -> n5629499534213120[style=dotted];\nn9288674231451648 -> n9007199254740992[style=dotted];\nn8725724278030336 -> n8444249301319680[style=dotted];\nn9570149208162304 -> n7599824371187712[style=dotted];\nn9851624184872960 -> n9570149208162304[style=dotted];\nn11540474045136896 -> n11258999068426240[style=dotted];\nn10977524091715584 -> n10696049115004928[style=dotted];\nn10414574138294272 -> n9851624184872960[style=dotted];\nn11821949021847552 -> n10414574138294272[style=dotted];\nn12384898975268864 -> n11821949021847552[style=dotted];\nn4785074604081152 -> n1407374883553280[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-204.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1970324836974592[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn2814749767106560[shape=rectangle, label=\"B7\"];\nn3377699720527872[shape=rectangle, label=\"B8\"];\nn2814749767106560 -> n3377699720527872;\nn3096224743817216[shape=rectangle, label=\"B12\"];\nn5348024557502464[shape=rectangle, label=\"B13\"];\nn5066549580791808[shape=rectangle, label=\"B14\"];\nn5629499534213120[shape=rectangle, label=\"B15\"];\nn5066549580791808 -> n5629499534213120;\nn5348024557502464 -> n5066549580791808;\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn5348024557502464 -> n4785074604081152;\nn3096224743817216 -> n5348024557502464;\nn2814749767106560 -> n3096224743817216;\nn2251799813685248 -> n2814749767106560;\nn2533274790395904[shape=rectangle, label=\"B9\"];\nn2251799813685248 -> n2533274790395904;\nn4222124650659840[shape=rectangle, label=\"B10\"];\nn4503599627370496[shape=rectangle, label=\"B11\"];\nn4222124650659840 -> n4503599627370496;\nn2251799813685248 -> n4222124650659840;\nn3940649673949184[shape=rectangle, label=\"B17\"];\nn6192449487634432[shape=rectangle, label=\"B18\"];\nn6473924464345088[shape=rectangle, label=\"B19\"];\nn6192449487634432 -> n6473924464345088;\nn3940649673949184 -> n6192449487634432;\nn5910974510923776[shape=rectangle, label=\"B20\"];\nn7036874417766400[shape=rectangle, label=\"B21\"];\nn5910974510923776 -> n7036874417766400;\nn6755399441055744[shape=rectangle, label=\"B22\"];\nn5910974510923776 -> n6755399441055744;\nn3940649673949184 -> n5910974510923776;\nn2251799813685248 -> n3940649673949184;\nn3659174697238528[shape=rectangle, label=\"B23\"];\nn2251799813685248 -> n3659174697238528;\nn1970324836974592 -> n2251799813685248;\nn844424930131968 -> n1970324836974592;\nn1688849860263936[shape=rectangle, label=\"B24\"];\nn7599824371187712[shape=rectangle, label=\"B25\"];\nn8162774324609024[shape=rectangle, label=\"B26\"];\nn8725724278030336[shape=rectangle, label=\"B27\"];\nn9007199254740992[shape=rectangle, label=\"B28\"];\nn9288674231451648[shape=rectangle, label=\"B29\"];\nn9007199254740992 -> n9288674231451648;\nn8725724278030336 -> n9007199254740992;\nn8162774324609024 -> n8725724278030336;\nn8444249301319680[shape=rectangle, label=\"B45\"];\nn8162774324609024 -> n8444249301319680;\nn9570149208162304[shape=rectangle, label=\"B46\"];\nn16044073672507392[shape=rectangle, label=\"B47\"];\nn17451448556060672[shape=rectangle, label=\"B48\"];\nn16607023625928704[shape=rectangle, label=\"B49\"];\nn17169973579350016[shape=rectangle, label=\"B50\"];\nn17732923532771328[shape=rectangle, label=\"B51\"];\nn17169973579350016 -> n17732923532771328;\nn16607023625928704 -> n17169973579350016;\nn17451448556060672 -> n16607023625928704;\nn16325548649218048[shape=rectangle, label=\"B69\"];\nn17451448556060672 -> n16325548649218048;\nn16888498602639360[shape=rectangle, label=\"B70\"];\nn17451448556060672 -> n16888498602639360;\nn16044073672507392 -> n17451448556060672;\nn9570149208162304 -> n16044073672507392;\nn15762598695796736[shape=rectangle, label=\"B67\"];\nn9570149208162304 -> n15762598695796736;\nn23080948090273792[shape=rectangle, label=\"B71\"];\nn23925373020405760[shape=rectangle, label=\"B72\"];\nn24206847997116416[shape=rectangle, label=\"B74\"];\nn25051272927248384[shape=rectangle, label=\"B75\"];\nn25614222880669696[shape=rectangle, label=\"B76\"];\nn26177172834091008[shape=rectangle, label=\"B77\"];\nn25614222880669696 -> n26177172834091008;\nn25895697857380352[shape=rectangle, label=\"B81\"];\nn28147497671065600[shape=rectangle, label=\"B82\"];\nn27866022694354944[shape=rectangle, label=\"B83\"];\nn28428972647776256[shape=rectangle, label=\"B84\"];\nn27866022694354944 -> n28428972647776256;\nn28147497671065600 -> n27866022694354944;\nn27584547717644288[shape=rectangle, label=\"B85\"];\nn28147497671065600 -> n27584547717644288;\nn25895697857380352 -> n28147497671065600;\nn25614222880669696 -> n25895697857380352;\nn25051272927248384 -> n25614222880669696;\nn25332747903959040[shape=rectangle, label=\"B78\"];\nn25051272927248384 -> n25332747903959040;\nn27021597764222976[shape=rectangle, label=\"B79\"];\nn27303072740933632[shape=rectangle, label=\"B80\"];\nn27021597764222976 -> n27303072740933632;\nn25051272927248384 -> n27021597764222976;\nn26740122787512320[shape=rectangle, label=\"B86\"];\nn28991922601197568[shape=rectangle, label=\"B87\"];\nn29273397577908224[shape=rectangle, label=\"B88\"];\nn28991922601197568 -> n29273397577908224;\nn26740122787512320 -> n28991922601197568;\nn28710447624486912[shape=rectangle, label=\"B89\"];\nn29836347531329536[shape=rectangle, label=\"B90\"];\nn28710447624486912 -> n29836347531329536;\nn29554872554618880[shape=rectangle, label=\"B91\"];\nn28710447624486912 -> n29554872554618880;\nn26740122787512320 -> n28710447624486912;\nn25051272927248384 -> n26740122787512320;\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn30117822508040192[shape=rectangle, label=\"B93\"];\nn30399297484750848[shape=rectangle, label=\"B94\"];\nn30117822508040192 -> n30399297484750848;\nn26458647810801664 -> n30117822508040192;\nn25051272927248384 -> n26458647810801664;\nn24206847997116416 -> n25051272927248384;\nn24488322973827072[shape=rectangle, label=\"B73\"];\nn24206847997116416 -> n24488322973827072;\nn23925373020405760 -> n24206847997116416;\nn23080948090273792 -> n23925373020405760;\nn9570149208162304 -> n23080948090273792;\nn8162774324609024 -> n9570149208162304;\nn7599824371187712 -> n8162774324609024;\nn7881299347898368[shape=rectangle, label=\"B35\"];\nn12103423998558208[shape=rectangle, label=\"B36\"];\nn12666373951979520[shape=rectangle, label=\"B37\"];\nn12947848928690176[shape=rectangle, label=\"B38\"];\nn13229323905400832[shape=rectangle, label=\"B39\"];\nn12947848928690176 -> n13229323905400832;\nn12666373951979520 -> n12947848928690176;\nn12103423998558208 -> n12666373951979520;\nn12384898975268864[shape=rectangle, label=\"B121\"];\nn12103423998558208 -> n12384898975268864;\nn13510798882111488[shape=rectangle, label=\"B122\"];\nn37436171902517248[shape=rectangle, label=\"B123\"];\nn38843546786070528[shape=rectangle, label=\"B124\"];\nn37999121855938560[shape=rectangle, label=\"B125\"];\nn38562071809359872[shape=rectangle, label=\"B126\"];\nn39125021762781184[shape=rectangle, label=\"B127\"];\nn38562071809359872 -> n39125021762781184;\nn37999121855938560 -> n38562071809359872;\nn38843546786070528 -> n37999121855938560;\nn37717646879227904[shape=rectangle, label=\"B153\"];\nn38843546786070528 -> n37717646879227904;\nn38280596832649216[shape=rectangle, label=\"B154\"];\nn38843546786070528 -> n38280596832649216;\nn37436171902517248 -> n38843546786070528;\nn13510798882111488 -> n37436171902517248;\nn37154696925806592[shape=rectangle, label=\"B149\"];\nn13510798882111488 -> n37154696925806592;\nn46161896180547584[shape=rectangle, label=\"B155\"];\nn47287796087390208[shape=rectangle, label=\"B156\"];\nn47569271064100864[shape=rectangle, label=\"B158\"];\nn48132221017522176[shape=rectangle, label=\"B159\"];\nn48695170970943488[shape=rectangle, label=\"B160\"];\nn49258120924364800[shape=rectangle, label=\"B161\"];\nn48695170970943488 -> n49258120924364800;\nn48976645947654144[shape=rectangle, label=\"B165\"];\nn51228445761339392[shape=rectangle, label=\"B166\"];\nn50946970784628736[shape=rectangle, label=\"B167\"];\nn51509920738050048[shape=rectangle, label=\"B168\"];\nn50946970784628736 -> n51509920738050048;\nn51228445761339392 -> n50946970784628736;\nn50665495807918080[shape=rectangle, label=\"B169\"];\nn51228445761339392 -> n50665495807918080;\nn48976645947654144 -> n51228445761339392;\nn48695170970943488 -> n48976645947654144;\nn48132221017522176 -> n48695170970943488;\nn48413695994232832[shape=rectangle, label=\"B162\"];\nn48132221017522176 -> n48413695994232832;\nn50102545854496768[shape=rectangle, label=\"B163\"];\nn50384020831207424[shape=rectangle, label=\"B164\"];\nn50102545854496768 -> n50384020831207424;\nn48132221017522176 -> n50102545854496768;\nn49821070877786112[shape=rectangle, label=\"B170\"];\nn52072870691471360[shape=rectangle, label=\"B171\"];\nn52354345668182016[shape=rectangle, label=\"B172\"];\nn52072870691471360 -> n52354345668182016;\nn49821070877786112 -> n52072870691471360;\nn51791395714760704[shape=rectangle, label=\"B173\"];\nn52917295621603328[shape=rectangle, label=\"B174\"];\nn51791395714760704 -> n52917295621603328;\nn52635820644892672[shape=rectangle, label=\"B175\"];\nn51791395714760704 -> n52635820644892672;\nn49821070877786112 -> n51791395714760704;\nn48132221017522176 -> n49821070877786112;\nn49539595901075456[shape=rectangle, label=\"B176\"];\nn53198770598313984[shape=rectangle, label=\"B177\"];\nn53480245575024640[shape=rectangle, label=\"B178\"];\nn53198770598313984 -> n53480245575024640;\nn49539595901075456 -> n53198770598313984;\nn48132221017522176 -> n49539595901075456;\nn47569271064100864 -> n48132221017522176;\nn47850746040811520[shape=rectangle, label=\"B157\"];\nn47569271064100864 -> n47850746040811520;\nn47287796087390208 -> n47569271064100864;\nn46161896180547584 -> n47287796087390208;\nn13510798882111488 -> n46161896180547584;\nn12103423998558208 -> n13510798882111488;\nn7881299347898368 -> n12103423998558208;\nn11821949021847552[shape=rectangle, label=\"B59\"];\nn20547673299877888[shape=rectangle, label=\"B60\"];\nn20829148276588544[shape=rectangle, label=\"B61\"];\nn21110623253299200[shape=rectangle, label=\"B62\"];\nn20829148276588544 -> n21110623253299200;\nn20547673299877888 -> n20829148276588544;\nn11821949021847552 -> n20547673299877888;\nn20266198323167232[shape=rectangle, label=\"B135\"];\nn11821949021847552 -> n20266198323167232;\nn21392098230009856[shape=rectangle, label=\"B136\"];\nn41939771529887744[shape=rectangle, label=\"B137\"];\nn43347146413441024[shape=rectangle, label=\"B138\"];\nn42502721483309056[shape=rectangle, label=\"B139\"];\nn43065671436730368[shape=rectangle, label=\"B140\"];\nn43628621390151680[shape=rectangle, label=\"B141\"];\nn43065671436730368 -> n43628621390151680;\nn42502721483309056 -> n43065671436730368;\nn43347146413441024 -> n42502721483309056;\nn42221246506598400[shape=rectangle, label=\"B205\"];\nn43347146413441024 -> n42221246506598400;\nn42784196460019712[shape=rectangle, label=\"B206\"];\nn43347146413441024 -> n42784196460019712;\nn41939771529887744 -> n43347146413441024;\nn21392098230009856 -> n41939771529887744;\nn41658296553177088[shape=rectangle, label=\"B151\"];\nn21392098230009856 -> n41658296553177088;\nn46724846133968896[shape=rectangle, label=\"B207\"];\nn60235645016080384[shape=rectangle, label=\"B208\"];\nn60517119992791040[shape=rectangle, label=\"B210\"];\nn61080069946212352[shape=rectangle, label=\"B211\"];\nn61643019899633664[shape=rectangle, label=\"B212\"];\nn62205969853054976[shape=rectangle, label=\"B213\"];\nn61643019899633664 -> n62205969853054976;\nn61924494876344320[shape=rectangle, label=\"B217\"];\nn64176294690029568[shape=rectangle, label=\"B218\"];\nn63894819713318912[shape=rectangle, label=\"B219\"];\nn64457769666740224[shape=rectangle, label=\"B220\"];\nn63894819713318912 -> n64457769666740224;\nn64176294690029568 -> n63894819713318912;\nn63613344736608256[shape=rectangle, label=\"B221\"];\nn64176294690029568 -> n63613344736608256;\nn61924494876344320 -> n64176294690029568;\nn61643019899633664 -> n61924494876344320;\nn61080069946212352 -> n61643019899633664;\nn61361544922923008[shape=rectangle, label=\"B214\"];\nn61080069946212352 -> n61361544922923008;\nn63050394783186944[shape=rectangle, label=\"B215\"];\nn63331869759897600[shape=rectangle, label=\"B216\"];\nn63050394783186944 -> n63331869759897600;\nn61080069946212352 -> n63050394783186944;\nn62768919806476288[shape=rectangle, label=\"B222\"];\nn65020719620161536[shape=rectangle, label=\"B223\"];\nn65302194596872192[shape=rectangle, label=\"B224\"];\nn65020719620161536 -> n65302194596872192;\nn62768919806476288 -> n65020719620161536;\nn64739244643450880[shape=rectangle, label=\"B225\"];\nn65865144550293504[shape=rectangle, label=\"B226\"];\nn64739244643450880 -> n65865144550293504;\nn65583669573582848[shape=rectangle, label=\"B227\"];\nn64739244643450880 -> n65583669573582848;\nn62768919806476288 -> n64739244643450880;\nn61080069946212352 -> n62768919806476288;\nn62487444829765632[shape=rectangle, label=\"B228\"];\nn66146619527004160[shape=rectangle, label=\"B229\"];\nn66428094503714816[shape=rectangle, label=\"B230\"];\nn66146619527004160 -> n66428094503714816;\nn62487444829765632 -> n66146619527004160;\nn61080069946212352 -> n62487444829765632;\nn60517119992791040 -> n61080069946212352;\nn60798594969501696[shape=rectangle, label=\"B209\"];\nn60517119992791040 -> n60798594969501696;\nn60235645016080384 -> n60517119992791040;\nn46724846133968896 -> n60235645016080384;\nn21392098230009856 -> n46724846133968896;\nn11821949021847552 -> n21392098230009856;\nn7881299347898368 -> n11821949021847552;\nn7599824371187712 -> n7881299347898368;\nn1688849860263936 -> n7599824371187712;\nn7318349394477056[shape=rectangle, label=\"B30\"];\nn10133099161583616[shape=rectangle, label=\"B31\"];\nn10696049115004928[shape=rectangle, label=\"B32\"];\nn10977524091715584[shape=rectangle, label=\"B33\"];\nn11258999068426240[shape=rectangle, label=\"B34\"];\nn10977524091715584 -> n11258999068426240;\nn10696049115004928 -> n10977524091715584;\nn10133099161583616 -> n10696049115004928;\nn10414574138294272[shape=rectangle, label=\"B52\"];\nn10133099161583616 -> n10414574138294272;\nn11540474045136896[shape=rectangle, label=\"B53\"];\nn18295873486192640[shape=rectangle, label=\"B54\"];\nn19703248369745920[shape=rectangle, label=\"B55\"];\nn18858823439613952[shape=rectangle, label=\"B56\"];\nn19421773393035264[shape=rectangle, label=\"B57\"];\nn19984723346456576[shape=rectangle, label=\"B58\"];\nn19421773393035264 -> n19984723346456576;\nn18858823439613952 -> n19421773393035264;\nn19703248369745920 -> n18858823439613952;\nn18577348462903296[shape=rectangle, label=\"B95\"];\nn19703248369745920 -> n18577348462903296;\nn19140298416324608[shape=rectangle, label=\"B96\"];\nn19703248369745920 -> n19140298416324608;\nn18295873486192640 -> n19703248369745920;\nn11540474045136896 -> n18295873486192640;\nn18014398509481984[shape=rectangle, label=\"B68\"];\nn11540474045136896 -> n18014398509481984;\nn23362423066984448[shape=rectangle, label=\"B97\"];\nn30680772461461504[shape=rectangle, label=\"B98\"];\nn30962247438172160[shape=rectangle, label=\"B100\"];\nn31525197391593472[shape=rectangle, label=\"B101\"];\nn32088147345014784[shape=rectangle, label=\"B102\"];\nn32651097298436096[shape=rectangle, label=\"B103\"];\nn32088147345014784 -> n32651097298436096;\nn32369622321725440[shape=rectangle, label=\"B107\"];\nn34621422135410688[shape=rectangle, label=\"B108\"];\nn34339947158700032[shape=rectangle, label=\"B109\"];\nn34902897112121344[shape=rectangle, label=\"B110\"];\nn34339947158700032 -> n34902897112121344;\nn34621422135410688 -> n34339947158700032;\nn34058472181989376[shape=rectangle, label=\"B111\"];\nn34621422135410688 -> n34058472181989376;\nn32369622321725440 -> n34621422135410688;\nn32088147345014784 -> n32369622321725440;\nn31525197391593472 -> n32088147345014784;\nn31806672368304128[shape=rectangle, label=\"B104\"];\nn31525197391593472 -> n31806672368304128;\nn33495522228568064[shape=rectangle, label=\"B105\"];\nn33776997205278720[shape=rectangle, label=\"B106\"];\nn33495522228568064 -> n33776997205278720;\nn31525197391593472 -> n33495522228568064;\nn33214047251857408[shape=rectangle, label=\"B112\"];\nn35465847065542656[shape=rectangle, label=\"B113\"];\nn35747322042253312[shape=rectangle, label=\"B114\"];\nn35465847065542656 -> n35747322042253312;\nn33214047251857408 -> n35465847065542656;\nn35184372088832000[shape=rectangle, label=\"B115\"];\nn36310271995674624[shape=rectangle, label=\"B116\"];\nn35184372088832000 -> n36310271995674624;\nn36028797018963968[shape=rectangle, label=\"B117\"];\nn35184372088832000 -> n36028797018963968;\nn33214047251857408 -> n35184372088832000;\nn31525197391593472 -> n33214047251857408;\nn32932572275146752[shape=rectangle, label=\"B118\"];\nn36591746972385280[shape=rectangle, label=\"B119\"];\nn36873221949095936[shape=rectangle, label=\"B120\"];\nn36591746972385280 -> n36873221949095936;\nn32932572275146752 -> n36591746972385280;\nn31525197391593472 -> n32932572275146752;\nn30962247438172160 -> n31525197391593472;\nn31243722414882816[shape=rectangle, label=\"B99\"];\nn30962247438172160 -> n31243722414882816;\nn30680772461461504 -> n30962247438172160;\nn23362423066984448 -> n30680772461461504;\nn11540474045136896 -> n23362423066984448;\nn10133099161583616 -> n11540474045136896;\nn7318349394477056 -> n10133099161583616;\nn9851624184872960[shape=rectangle, label=\"B40\"];\nn14073748835532800[shape=rectangle, label=\"B41\"];\nn14636698788954112[shape=rectangle, label=\"B42\"];\nn14918173765664768[shape=rectangle, label=\"B43\"];\nn15199648742375424[shape=rectangle, label=\"B44\"];\nn14918173765664768 -> n15199648742375424;\nn14636698788954112 -> n14918173765664768;\nn14073748835532800 -> n14636698788954112;\nn14355223812243456[shape=rectangle, label=\"B128\"];\nn14073748835532800 -> n14355223812243456;\nn15481123719086080[shape=rectangle, label=\"B129\"];\nn39687971716202496[shape=rectangle, label=\"B130\"];\nn41095346599755776[shape=rectangle, label=\"B131\"];\nn40250921669623808[shape=rectangle, label=\"B132\"];\nn40813871623045120[shape=rectangle, label=\"B133\"];\nn41376821576466432[shape=rectangle, label=\"B134\"];\nn40813871623045120 -> n41376821576466432;\nn40250921669623808 -> n40813871623045120;\nn41095346599755776 -> n40250921669623808;\nn39969446692913152[shape=rectangle, label=\"B179\"];\nn41095346599755776 -> n39969446692913152;\nn40532396646334464[shape=rectangle, label=\"B180\"];\nn41095346599755776 -> n40532396646334464;\nn39687971716202496 -> n41095346599755776;\nn15481123719086080 -> n39687971716202496;\nn39406496739491840[shape=rectangle, label=\"B150\"];\nn15481123719086080 -> n39406496739491840;\nn46443371157258240[shape=rectangle, label=\"B181\"];\nn53761720551735296[shape=rectangle, label=\"B182\"];\nn54043195528445952[shape=rectangle, label=\"B184\"];\nn54606145481867264[shape=rectangle, label=\"B185\"];\nn55169095435288576[shape=rectangle, label=\"B186\"];\nn55732045388709888[shape=rectangle, label=\"B187\"];\nn55169095435288576 -> n55732045388709888;\nn55450570411999232[shape=rectangle, label=\"B191\"];\nn57702370225684480[shape=rectangle, label=\"B192\"];\nn57420895248973824[shape=rectangle, label=\"B193\"];\nn57983845202395136[shape=rectangle, label=\"B194\"];\nn57420895248973824 -> n57983845202395136;\nn57702370225684480 -> n57420895248973824;\nn57139420272263168[shape=rectangle, label=\"B195\"];\nn57702370225684480 -> n57139420272263168;\nn55450570411999232 -> n57702370225684480;\nn55169095435288576 -> n55450570411999232;\nn54606145481867264 -> n55169095435288576;\nn54887620458577920[shape=rectangle, label=\"B188\"];\nn54606145481867264 -> n54887620458577920;\nn56576470318841856[shape=rectangle, label=\"B189\"];\nn56857945295552512[shape=rectangle, label=\"B190\"];\nn56576470318841856 -> n56857945295552512;\nn54606145481867264 -> n56576470318841856;\nn56294995342131200[shape=rectangle, label=\"B196\"];\nn58546795155816448[shape=rectangle, label=\"B197\"];\nn58828270132527104[shape=rectangle, label=\"B198\"];\nn58546795155816448 -> n58828270132527104;\nn56294995342131200 -> n58546795155816448;\nn58265320179105792[shape=rectangle, label=\"B199\"];\nn59391220085948416[shape=rectangle, label=\"B200\"];\nn58265320179105792 -> n59391220085948416;\nn59109745109237760[shape=rectangle, label=\"B201\"];\nn58265320179105792 -> n59109745109237760;\nn56294995342131200 -> n58265320179105792;\nn54606145481867264 -> n56294995342131200;\nn56013520365420544[shape=rectangle, label=\"B202\"];\nn59672695062659072[shape=rectangle, label=\"B203\"];\nn59954170039369728[shape=rectangle, label=\"B204\"];\nn59672695062659072 -> n59954170039369728;\nn56013520365420544 -> n59672695062659072;\nn54606145481867264 -> n56013520365420544;\nn54043195528445952 -> n54606145481867264;\nn54324670505156608[shape=rectangle, label=\"B183\"];\nn54043195528445952 -> n54324670505156608;\nn53761720551735296 -> n54043195528445952;\nn46443371157258240 -> n53761720551735296;\nn15481123719086080 -> n46443371157258240;\nn14073748835532800 -> n15481123719086080;\nn9851624184872960 -> n14073748835532800;\nn13792273858822144[shape=rectangle, label=\"B63\"];\nn21955048183431168[shape=rectangle, label=\"B64\"];\nn22236523160141824[shape=rectangle, label=\"B65\"];\nn22517998136852480[shape=rectangle, label=\"B66\"];\nn22236523160141824 -> n22517998136852480;\nn21955048183431168 -> n22236523160141824;\nn13792273858822144 -> n21955048183431168;\nn21673573206720512[shape=rectangle, label=\"B142\"];\nn13792273858822144 -> n21673573206720512;\nn22799473113563136[shape=rectangle, label=\"B143\"];\nn44191571343572992[shape=rectangle, label=\"B144\"];\nn45598946227126272[shape=rectangle, label=\"B145\"];\nn44754521296994304[shape=rectangle, label=\"B146\"];\nn45317471250415616[shape=rectangle, label=\"B147\"];\nn45880421203836928[shape=rectangle, label=\"B148\"];\nn45317471250415616 -> n45880421203836928;\nn44754521296994304 -> n45317471250415616;\nn45598946227126272 -> n44754521296994304;\nn44473046320283648[shape=rectangle, label=\"B231\"];\nn45598946227126272 -> n44473046320283648;\nn45035996273704960[shape=rectangle, label=\"B232\"];\nn45598946227126272 -> n45035996273704960;\nn44191571343572992 -> n45598946227126272;\nn22799473113563136 -> n44191571343572992;\nn43910096366862336[shape=rectangle, label=\"B152\"];\nn22799473113563136 -> n43910096366862336;\nn47006321110679552[shape=rectangle, label=\"B233\"];\nn66709569480425472[shape=rectangle, label=\"B234\"];\nn66991044457136128[shape=rectangle, label=\"B236\"];\nn67553994410557440[shape=rectangle, label=\"B237\"];\nn68116944363978752[shape=rectangle, label=\"B238\"];\nn68679894317400064[shape=rectangle, label=\"B239\"];\nn68116944363978752 -> n68679894317400064;\nn68398419340689408[shape=rectangle, label=\"B243\"];\nn70650219154374656[shape=rectangle, label=\"B244\"];\nn70368744177664000[shape=rectangle, label=\"B245\"];\nn70931694131085312[shape=rectangle, label=\"B246\"];\nn70368744177664000 -> n70931694131085312;\nn70650219154374656 -> n70368744177664000;\nn70087269200953344[shape=rectangle, label=\"B247\"];\nn70650219154374656 -> n70087269200953344;\nn68398419340689408 -> n70650219154374656;\nn68116944363978752 -> n68398419340689408;\nn67553994410557440 -> n68116944363978752;\nn67835469387268096[shape=rectangle, label=\"B240\"];\nn67553994410557440 -> n67835469387268096;\nn69524319247532032[shape=rectangle, label=\"B241\"];\nn69805794224242688[shape=rectangle, label=\"B242\"];\nn69524319247532032 -> n69805794224242688;\nn67553994410557440 -> n69524319247532032;\nn69242844270821376[shape=rectangle, label=\"B248\"];\nn71494644084506624[shape=rectangle, label=\"B249\"];\nn71776119061217280[shape=rectangle, label=\"B250\"];\nn71494644084506624 -> n71776119061217280;\nn69242844270821376 -> n71494644084506624;\nn71213169107795968[shape=rectangle, label=\"B251\"];\nn72339069014638592[shape=rectangle, label=\"B252\"];\nn71213169107795968 -> n72339069014638592;\nn72057594037927936[shape=rectangle, label=\"B253\"];\nn71213169107795968 -> n72057594037927936;\nn69242844270821376 -> n71213169107795968;\nn67553994410557440 -> n69242844270821376;\nn68961369294110720[shape=rectangle, label=\"B254\"];\nn72620543991349248[shape=rectangle, label=\"B255\"];\nn72902018968059904[shape=rectangle, label=\"B256\"];\nn72620543991349248 -> n72902018968059904;\nn68961369294110720 -> n72620543991349248;\nn67553994410557440 -> n68961369294110720;\nn66991044457136128 -> n67553994410557440;\nn67272519433846784[shape=rectangle, label=\"B235\"];\nn66991044457136128 -> n67272519433846784;\nn66709569480425472 -> n66991044457136128;\nn47006321110679552 -> n66709569480425472;\nn22799473113563136 -> n47006321110679552;\nn13792273858822144 -> n22799473113563136;\nn9851624184872960 -> n13792273858822144;\nn7318349394477056 -> n9851624184872960;\nn1688849860263936 -> n7318349394477056;\nn23643898043695104[shape=rectangle, label=\"B257\"];\nn1688849860263936 -> n23643898043695104;\nn24769797950537728[shape=rectangle, label=\"B258\"];\nn73183493944770560[shape=rectangle, label=\"B259\"];\nn73746443898191872[shape=rectangle, label=\"B260\"];\nn74027918874902528[shape=rectangle, label=\"B262\"];\nn74872343805034496[shape=rectangle, label=\"B263\"];\nn75153818781745152[shape=rectangle, label=\"B264\"];\nn75435293758455808[shape=rectangle, label=\"B265\"];\nn75998243711877120[shape=rectangle, label=\"B266\"];\nn76561193665298432[shape=rectangle, label=\"B267\"];\nn75998243711877120 -> n76561193665298432;\nn76279718688587776[shape=rectangle, label=\"B271\"];\nn78531518502273024[shape=rectangle, label=\"B272\"];\nn78250043525562368[shape=rectangle, label=\"B273\"];\nn78812993478983680[shape=rectangle, label=\"B274\"];\nn78250043525562368 -> n78812993478983680;\nn78531518502273024 -> n78250043525562368;\nn77968568548851712[shape=rectangle, label=\"B275\"];\nn78531518502273024 -> n77968568548851712;\nn76279718688587776 -> n78531518502273024;\nn75998243711877120 -> n76279718688587776;\nn75435293758455808 -> n75998243711877120;\nn75716768735166464[shape=rectangle, label=\"B268\"];\nn75435293758455808 -> n75716768735166464;\nn77405618595430400[shape=rectangle, label=\"B269\"];\nn77687093572141056[shape=rectangle, label=\"B270\"];\nn77405618595430400 -> n77687093572141056;\nn75435293758455808 -> n77405618595430400;\nn77124143618719744[shape=rectangle, label=\"B276\"];\nn79657418409115648[shape=rectangle, label=\"B277\"];\nn79938893385826304[shape=rectangle, label=\"B278\"];\nn79657418409115648 -> n79938893385826304;\nn77124143618719744 -> n79657418409115648;\nn79375943432404992[shape=rectangle, label=\"B279\"];\nn80220368362536960[shape=rectangle, label=\"B280\"];\nn79375943432404992 -> n80220368362536960;\nn77124143618719744 -> n79375943432404992;\nn75435293758455808 -> n77124143618719744;\nn79094468455694336[shape=rectangle, label=\"B281\"];\nn75435293758455808 -> n79094468455694336;\nn76842668642009088[shape=rectangle, label=\"B282\"];\nn80501843339247616[shape=rectangle, label=\"B283\"];\nn76842668642009088 -> n80501843339247616;\nn75435293758455808 -> n76842668642009088;\nn75153818781745152 -> n75435293758455808;\nn74872343805034496 -> n75153818781745152;\nn74027918874902528 -> n74872343805034496;\nn74590868828323840[shape=rectangle, label=\"B284\"];\nn81064793292668928[shape=rectangle, label=\"B285\"];\nn81627743246090240[shape=rectangle, label=\"B286\"];\nn82190693199511552[shape=rectangle, label=\"B287\"];\nn82472168176222208[shape=rectangle, label=\"B288\"];\nn82753643152932864[shape=rectangle, label=\"B289\"];\nn82472168176222208 -> n82753643152932864;\nn82190693199511552 -> n82472168176222208;\nn81627743246090240 -> n82190693199511552;\nn81909218222800896[shape=rectangle, label=\"B305\"];\nn81627743246090240 -> n81909218222800896;\nn83035118129643520[shape=rectangle, label=\"B306\"];\nn89509042593988608[shape=rectangle, label=\"B307\"];\nn90916417477541888[shape=rectangle, label=\"B308\"];\nn90071992547409920[shape=rectangle, label=\"B309\"];\nn90634942500831232[shape=rectangle, label=\"B310\"];\nn91197892454252544[shape=rectangle, label=\"B311\"];\nn90634942500831232 -> n91197892454252544;\nn90071992547409920 -> n90634942500831232;\nn90916417477541888 -> n90071992547409920;\nn89790517570699264[shape=rectangle, label=\"B329\"];\nn90916417477541888 -> n89790517570699264;\nn90353467524120576[shape=rectangle, label=\"B330\"];\nn90916417477541888 -> n90353467524120576;\nn89509042593988608 -> n90916417477541888;\nn83035118129643520 -> n89509042593988608;\nn89227567617277952[shape=rectangle, label=\"B327\"];\nn83035118129643520 -> n89227567617277952;\nn96545917011755008[shape=rectangle, label=\"B331\"];\nn97390341941886976[shape=rectangle, label=\"B332\"];\nn97671816918597632[shape=rectangle, label=\"B334\"];\nn98516241848729600[shape=rectangle, label=\"B335\"];\nn99079191802150912[shape=rectangle, label=\"B336\"];\nn99642141755572224[shape=rectangle, label=\"B337\"];\nn99079191802150912 -> n99642141755572224;\nn99360666778861568[shape=rectangle, label=\"B341\"];\nn101612466592546816[shape=rectangle, label=\"B342\"];\nn101330991615836160[shape=rectangle, label=\"B343\"];\nn101893941569257472[shape=rectangle, label=\"B344\"];\nn101330991615836160 -> n101893941569257472;\nn101612466592546816 -> n101330991615836160;\nn101049516639125504[shape=rectangle, label=\"B345\"];\nn101612466592546816 -> n101049516639125504;\nn99360666778861568 -> n101612466592546816;\nn99079191802150912 -> n99360666778861568;\nn98516241848729600 -> n99079191802150912;\nn98797716825440256[shape=rectangle, label=\"B338\"];\nn98516241848729600 -> n98797716825440256;\nn100486566685704192[shape=rectangle, label=\"B339\"];\nn100768041662414848[shape=rectangle, label=\"B340\"];\nn100486566685704192 -> n100768041662414848;\nn98516241848729600 -> n100486566685704192;\nn100205091708993536[shape=rectangle, label=\"B346\"];\nn102456891522678784[shape=rectangle, label=\"B347\"];\nn102738366499389440[shape=rectangle, label=\"B348\"];\nn102456891522678784 -> n102738366499389440;\nn100205091708993536 -> n102456891522678784;\nn102175416545968128[shape=rectangle, label=\"B349\"];\nn103301316452810752[shape=rectangle, label=\"B350\"];\nn102175416545968128 -> n103301316452810752;\nn103019841476100096[shape=rectangle, label=\"B351\"];\nn102175416545968128 -> n103019841476100096;\nn100205091708993536 -> n102175416545968128;\nn98516241848729600 -> n100205091708993536;\nn99923616732282880[shape=rectangle, label=\"B352\"];\nn103582791429521408[shape=rectangle, label=\"B353\"];\nn103864266406232064[shape=rectangle, label=\"B354\"];\nn103582791429521408 -> n103864266406232064;\nn99923616732282880 -> n103582791429521408;\nn98516241848729600 -> n99923616732282880;\nn97671816918597632 -> n98516241848729600;\nn97953291895308288[shape=rectangle, label=\"B333\"];\nn97671816918597632 -> n97953291895308288;\nn97390341941886976 -> n97671816918597632;\nn96545917011755008 -> n97390341941886976;\nn83035118129643520 -> n96545917011755008;\nn81627743246090240 -> n83035118129643520;\nn81064793292668928 -> n81627743246090240;\nn81346268269379584[shape=rectangle, label=\"B295\"];\nn85568392920039424[shape=rectangle, label=\"B296\"];\nn86131342873460736[shape=rectangle, label=\"B297\"];\nn86412817850171392[shape=rectangle, label=\"B298\"];\nn86694292826882048[shape=rectangle, label=\"B299\"];\nn86412817850171392 -> n86694292826882048;\nn86131342873460736 -> n86412817850171392;\nn85568392920039424 -> n86131342873460736;\nn85849867896750080[shape=rectangle, label=\"B381\"];\nn85568392920039424 -> n85849867896750080;\nn86975767803592704[shape=rectangle, label=\"B382\"];\nn110901140823998464[shape=rectangle, label=\"B383\"];\nn112308515707551744[shape=rectangle, label=\"B384\"];\nn111464090777419776[shape=rectangle, label=\"B385\"];\nn112027040730841088[shape=rectangle, label=\"B386\"];\nn112589990684262400[shape=rectangle, label=\"B387\"];\nn112027040730841088 -> n112589990684262400;\nn111464090777419776 -> n112027040730841088;\nn112308515707551744 -> n111464090777419776;\nn111182615800709120[shape=rectangle, label=\"B413\"];\nn112308515707551744 -> n111182615800709120;\nn111745565754130432[shape=rectangle, label=\"B414\"];\nn112308515707551744 -> n111745565754130432;\nn110901140823998464 -> n112308515707551744;\nn86975767803592704 -> n110901140823998464;\nn110619665847287808[shape=rectangle, label=\"B409\"];\nn86975767803592704 -> n110619665847287808;\nn119626865102028800[shape=rectangle, label=\"B415\"];\nn120752765008871424[shape=rectangle, label=\"B416\"];\nn121034239985582080[shape=rectangle, label=\"B418\"];\nn121597189939003392[shape=rectangle, label=\"B419\"];\nn122160139892424704[shape=rectangle, label=\"B420\"];\nn122723089845846016[shape=rectangle, label=\"B421\"];\nn122160139892424704 -> n122723089845846016;\nn122441614869135360[shape=rectangle, label=\"B425\"];\nn124693414682820608[shape=rectangle, label=\"B426\"];\nn124411939706109952[shape=rectangle, label=\"B427\"];\nn124974889659531264[shape=rectangle, label=\"B428\"];\nn124411939706109952 -> n124974889659531264;\nn124693414682820608 -> n124411939706109952;\nn124130464729399296[shape=rectangle, label=\"B429\"];\nn124693414682820608 -> n124130464729399296;\nn122441614869135360 -> n124693414682820608;\nn122160139892424704 -> n122441614869135360;\nn121597189939003392 -> n122160139892424704;\nn121878664915714048[shape=rectangle, label=\"B422\"];\nn121597189939003392 -> n121878664915714048;\nn123567514775977984[shape=rectangle, label=\"B423\"];\nn123848989752688640[shape=rectangle, label=\"B424\"];\nn123567514775977984 -> n123848989752688640;\nn121597189939003392 -> n123567514775977984;\nn123286039799267328[shape=rectangle, label=\"B430\"];\nn125537839612952576[shape=rectangle, label=\"B431\"];\nn125819314589663232[shape=rectangle, label=\"B432\"];\nn125537839612952576 -> n125819314589663232;\nn123286039799267328 -> n125537839612952576;\nn125256364636241920[shape=rectangle, label=\"B433\"];\nn126382264543084544[shape=rectangle, label=\"B434\"];\nn125256364636241920 -> n126382264543084544;\nn126100789566373888[shape=rectangle, label=\"B435\"];\nn125256364636241920 -> n126100789566373888;\nn123286039799267328 -> n125256364636241920;\nn121597189939003392 -> n123286039799267328;\nn123004564822556672[shape=rectangle, label=\"B436\"];\nn126663739519795200[shape=rectangle, label=\"B437\"];\nn126945214496505856[shape=rectangle, label=\"B438\"];\nn126663739519795200 -> n126945214496505856;\nn123004564822556672 -> n126663739519795200;\nn121597189939003392 -> n123004564822556672;\nn121034239985582080 -> n121597189939003392;\nn121315714962292736[shape=rectangle, label=\"B417\"];\nn121034239985582080 -> n121315714962292736;\nn120752765008871424 -> n121034239985582080;\nn119626865102028800 -> n120752765008871424;\nn86975767803592704 -> n119626865102028800;\nn85568392920039424 -> n86975767803592704;\nn81346268269379584 -> n85568392920039424;\nn85286917943328768[shape=rectangle, label=\"B319\"];\nn94012642221359104[shape=rectangle, label=\"B320\"];\nn94294117198069760[shape=rectangle, label=\"B321\"];\nn94575592174780416[shape=rectangle, label=\"B322\"];\nn94294117198069760 -> n94575592174780416;\nn94012642221359104 -> n94294117198069760;\nn85286917943328768 -> n94012642221359104;\nn93731167244648448[shape=rectangle, label=\"B395\"];\nn85286917943328768 -> n93731167244648448;\nn94857067151491072[shape=rectangle, label=\"B396\"];\nn115404740451368960[shape=rectangle, label=\"B397\"];\nn116812115334922240[shape=rectangle, label=\"B398\"];\nn115967690404790272[shape=rectangle, label=\"B399\"];\nn116530640358211584[shape=rectangle, label=\"B400\"];\nn117093590311632896[shape=rectangle, label=\"B401\"];\nn116530640358211584 -> n117093590311632896;\nn115967690404790272 -> n116530640358211584;\nn116812115334922240 -> n115967690404790272;\nn115686215428079616[shape=rectangle, label=\"B465\"];\nn116812115334922240 -> n115686215428079616;\nn116249165381500928[shape=rectangle, label=\"B466\"];\nn116812115334922240 -> n116249165381500928;\nn115404740451368960 -> n116812115334922240;\nn94857067151491072 -> n115404740451368960;\nn115123265474658304[shape=rectangle, label=\"B411\"];\nn94857067151491072 -> n115123265474658304;\nn120189815055450112[shape=rectangle, label=\"B467\"];\nn133700613937561600[shape=rectangle, label=\"B468\"];\nn133982088914272256[shape=rectangle, label=\"B470\"];\nn134545038867693568[shape=rectangle, label=\"B471\"];\nn135107988821114880[shape=rectangle, label=\"B472\"];\nn135670938774536192[shape=rectangle, label=\"B473\"];\nn135107988821114880 -> n135670938774536192;\nn135389463797825536[shape=rectangle, label=\"B477\"];\nn137641263611510784[shape=rectangle, label=\"B478\"];\nn137359788634800128[shape=rectangle, label=\"B479\"];\nn137922738588221440[shape=rectangle, label=\"B480\"];\nn137359788634800128 -> n137922738588221440;\nn137641263611510784 -> n137359788634800128;\nn137078313658089472[shape=rectangle, label=\"B481\"];\nn137641263611510784 -> n137078313658089472;\nn135389463797825536 -> n137641263611510784;\nn135107988821114880 -> n135389463797825536;\nn134545038867693568 -> n135107988821114880;\nn134826513844404224[shape=rectangle, label=\"B474\"];\nn134545038867693568 -> n134826513844404224;\nn136515363704668160[shape=rectangle, label=\"B475\"];\nn136796838681378816[shape=rectangle, label=\"B476\"];\nn136515363704668160 -> n136796838681378816;\nn134545038867693568 -> n136515363704668160;\nn136233888727957504[shape=rectangle, label=\"B482\"];\nn138485688541642752[shape=rectangle, label=\"B483\"];\nn138767163518353408[shape=rectangle, label=\"B484\"];\nn138485688541642752 -> n138767163518353408;\nn136233888727957504 -> n138485688541642752;\nn138204213564932096[shape=rectangle, label=\"B485\"];\nn139330113471774720[shape=rectangle, label=\"B486\"];\nn138204213564932096 -> n139330113471774720;\nn139048638495064064[shape=rectangle, label=\"B487\"];\nn138204213564932096 -> n139048638495064064;\nn136233888727957504 -> n138204213564932096;\nn134545038867693568 -> n136233888727957504;\nn135952413751246848[shape=rectangle, label=\"B488\"];\nn139611588448485376[shape=rectangle, label=\"B489\"];\nn139893063425196032[shape=rectangle, label=\"B490\"];\nn139611588448485376 -> n139893063425196032;\nn135952413751246848 -> n139611588448485376;\nn134545038867693568 -> n135952413751246848;\nn133982088914272256 -> n134545038867693568;\nn134263563890982912[shape=rectangle, label=\"B469\"];\nn133982088914272256 -> n134263563890982912;\nn133700613937561600 -> n133982088914272256;\nn120189815055450112 -> n133700613937561600;\nn94857067151491072 -> n120189815055450112;\nn85286917943328768 -> n94857067151491072;\nn81346268269379584 -> n85286917943328768;\nn81064793292668928 -> n81346268269379584;\nn74590868828323840 -> n81064793292668928;\nn80783318315958272[shape=rectangle, label=\"B290\"];\nn83598068083064832[shape=rectangle, label=\"B291\"];\nn84161018036486144[shape=rectangle, label=\"B292\"];\nn84442493013196800[shape=rectangle, label=\"B293\"];\nn84723967989907456[shape=rectangle, label=\"B294\"];\nn84442493013196800 -> n84723967989907456;\nn84161018036486144 -> n84442493013196800;\nn83598068083064832 -> n84161018036486144;\nn83879543059775488[shape=rectangle, label=\"B312\"];\nn83598068083064832 -> n83879543059775488;\nn85005442966618112[shape=rectangle, label=\"B313\"];\nn91760842407673856[shape=rectangle, label=\"B314\"];\nn93168217291227136[shape=rectangle, label=\"B315\"];\nn92323792361095168[shape=rectangle, label=\"B316\"];\nn92886742314516480[shape=rectangle, label=\"B317\"];\nn93449692267937792[shape=rectangle, label=\"B318\"];\nn92886742314516480 -> n93449692267937792;\nn92323792361095168 -> n92886742314516480;\nn93168217291227136 -> n92323792361095168;\nn92042317384384512[shape=rectangle, label=\"B355\"];\nn93168217291227136 -> n92042317384384512;\nn92605267337805824[shape=rectangle, label=\"B356\"];\nn93168217291227136 -> n92605267337805824;\nn91760842407673856 -> n93168217291227136;\nn85005442966618112 -> n91760842407673856;\nn91479367430963200[shape=rectangle, label=\"B328\"];\nn85005442966618112 -> n91479367430963200;\nn96827391988465664[shape=rectangle, label=\"B357\"];\nn104145741382942720[shape=rectangle, label=\"B358\"];\nn104427216359653376[shape=rectangle, label=\"B360\"];\nn104990166313074688[shape=rectangle, label=\"B361\"];\nn105553116266496000[shape=rectangle, label=\"B362\"];\nn106116066219917312[shape=rectangle, label=\"B363\"];\nn105553116266496000 -> n106116066219917312;\nn105834591243206656[shape=rectangle, label=\"B367\"];\nn108086391056891904[shape=rectangle, label=\"B368\"];\nn107804916080181248[shape=rectangle, label=\"B369\"];\nn108367866033602560[shape=rectangle, label=\"B370\"];\nn107804916080181248 -> n108367866033602560;\nn108086391056891904 -> n107804916080181248;\nn107523441103470592[shape=rectangle, label=\"B371\"];\nn108086391056891904 -> n107523441103470592;\nn105834591243206656 -> n108086391056891904;\nn105553116266496000 -> n105834591243206656;\nn104990166313074688 -> n105553116266496000;\nn105271641289785344[shape=rectangle, label=\"B364\"];\nn104990166313074688 -> n105271641289785344;\nn106960491150049280[shape=rectangle, label=\"B365\"];\nn107241966126759936[shape=rectangle, label=\"B366\"];\nn106960491150049280 -> n107241966126759936;\nn104990166313074688 -> n106960491150049280;\nn106679016173338624[shape=rectangle, label=\"B372\"];\nn108930815987023872[shape=rectangle, label=\"B373\"];\nn109212290963734528[shape=rectangle, label=\"B374\"];\nn108930815987023872 -> n109212290963734528;\nn106679016173338624 -> n108930815987023872;\nn108649341010313216[shape=rectangle, label=\"B375\"];\nn109775240917155840[shape=rectangle, label=\"B376\"];\nn108649341010313216 -> n109775240917155840;\nn109493765940445184[shape=rectangle, label=\"B377\"];\nn108649341010313216 -> n109493765940445184;\nn106679016173338624 -> n108649341010313216;\nn104990166313074688 -> n106679016173338624;\nn106397541196627968[shape=rectangle, label=\"B378\"];\nn110056715893866496[shape=rectangle, label=\"B379\"];\nn110338190870577152[shape=rectangle, label=\"B380\"];\nn110056715893866496 -> n110338190870577152;\nn106397541196627968 -> n110056715893866496;\nn104990166313074688 -> n106397541196627968;\nn104427216359653376 -> n104990166313074688;\nn104708691336364032[shape=rectangle, label=\"B359\"];\nn104427216359653376 -> n104708691336364032;\nn104145741382942720 -> n104427216359653376;\nn96827391988465664 -> n104145741382942720;\nn85005442966618112 -> n96827391988465664;\nn83598068083064832 -> n85005442966618112;\nn80783318315958272 -> n83598068083064832;\nn83316593106354176[shape=rectangle, label=\"B300\"];\nn87538717757014016[shape=rectangle, label=\"B301\"];\nn88101667710435328[shape=rectangle, label=\"B302\"];\nn88383142687145984[shape=rectangle, label=\"B303\"];\nn88664617663856640[shape=rectangle, label=\"B304\"];\nn88383142687145984 -> n88664617663856640;\nn88101667710435328 -> n88383142687145984;\nn87538717757014016 -> n88101667710435328;\nn87820192733724672[shape=rectangle, label=\"B388\"];\nn87538717757014016 -> n87820192733724672;\nn88946092640567296[shape=rectangle, label=\"B389\"];\nn113152940637683712[shape=rectangle, label=\"B390\"];\nn114560315521236992[shape=rectangle, label=\"B391\"];\nn113715890591105024[shape=rectangle, label=\"B392\"];\nn114278840544526336[shape=rectangle, label=\"B393\"];\nn114841790497947648[shape=rectangle, label=\"B394\"];\nn114278840544526336 -> n114841790497947648;\nn113715890591105024 -> n114278840544526336;\nn114560315521236992 -> n113715890591105024;\nn113434415614394368[shape=rectangle, label=\"B439\"];\nn114560315521236992 -> n113434415614394368;\nn113997365567815680[shape=rectangle, label=\"B440\"];\nn114560315521236992 -> n113997365567815680;\nn113152940637683712 -> n114560315521236992;\nn88946092640567296 -> n113152940637683712;\nn112871465660973056[shape=rectangle, label=\"B410\"];\nn88946092640567296 -> n112871465660973056;\nn119908340078739456[shape=rectangle, label=\"B441\"];\nn127226689473216512[shape=rectangle, label=\"B442\"];\nn127508164449927168[shape=rectangle, label=\"B444\"];\nn128071114403348480[shape=rectangle, label=\"B445\"];\nn128634064356769792[shape=rectangle, label=\"B446\"];\nn129197014310191104[shape=rectangle, label=\"B447\"];\nn128634064356769792 -> n129197014310191104;\nn128915539333480448[shape=rectangle, label=\"B451\"];\nn131167339147165696[shape=rectangle, label=\"B452\"];\nn130885864170455040[shape=rectangle, label=\"B453\"];\nn131448814123876352[shape=rectangle, label=\"B454\"];\nn130885864170455040 -> n131448814123876352;\nn131167339147165696 -> n130885864170455040;\nn130604389193744384[shape=rectangle, label=\"B455\"];\nn131167339147165696 -> n130604389193744384;\nn128915539333480448 -> n131167339147165696;\nn128634064356769792 -> n128915539333480448;\nn128071114403348480 -> n128634064356769792;\nn128352589380059136[shape=rectangle, label=\"B448\"];\nn128071114403348480 -> n128352589380059136;\nn130041439240323072[shape=rectangle, label=\"B449\"];\nn130322914217033728[shape=rectangle, label=\"B450\"];\nn130041439240323072 -> n130322914217033728;\nn128071114403348480 -> n130041439240323072;\nn129759964263612416[shape=rectangle, label=\"B456\"];\nn132011764077297664[shape=rectangle, label=\"B457\"];\nn132293239054008320[shape=rectangle, label=\"B458\"];\nn132011764077297664 -> n132293239054008320;\nn129759964263612416 -> n132011764077297664;\nn131730289100587008[shape=rectangle, label=\"B459\"];\nn132856189007429632[shape=rectangle, label=\"B460\"];\nn131730289100587008 -> n132856189007429632;\nn132574714030718976[shape=rectangle, label=\"B461\"];\nn131730289100587008 -> n132574714030718976;\nn129759964263612416 -> n131730289100587008;\nn128071114403348480 -> n129759964263612416;\nn129478489286901760[shape=rectangle, label=\"B462\"];\nn133137663984140288[shape=rectangle, label=\"B463\"];\nn133419138960850944[shape=rectangle, label=\"B464\"];\nn133137663984140288 -> n133419138960850944;\nn129478489286901760 -> n133137663984140288;\nn128071114403348480 -> n129478489286901760;\nn127508164449927168 -> n128071114403348480;\nn127789639426637824[shape=rectangle, label=\"B443\"];\nn127508164449927168 -> n127789639426637824;\nn127226689473216512 -> n127508164449927168;\nn119908340078739456 -> n127226689473216512;\nn88946092640567296 -> n119908340078739456;\nn87538717757014016 -> n88946092640567296;\nn83316593106354176 -> n87538717757014016;\nn87257242780303360[shape=rectangle, label=\"B323\"];\nn95420017104912384[shape=rectangle, label=\"B324\"];\nn95701492081623040[shape=rectangle, label=\"B325\"];\nn95982967058333696[shape=rectangle, label=\"B326\"];\nn95701492081623040 -> n95982967058333696;\nn95420017104912384 -> n95701492081623040;\nn87257242780303360 -> n95420017104912384;\nn95138542128201728[shape=rectangle, label=\"B402\"];\nn87257242780303360 -> n95138542128201728;\nn96264442035044352[shape=rectangle, label=\"B403\"];\nn117656540265054208[shape=rectangle, label=\"B404\"];\nn119063915148607488[shape=rectangle, label=\"B405\"];\nn118219490218475520[shape=rectangle, label=\"B406\"];\nn118782440171896832[shape=rectangle, label=\"B407\"];\nn119345390125318144[shape=rectangle, label=\"B408\"];\nn118782440171896832 -> n119345390125318144;\nn118219490218475520 -> n118782440171896832;\nn119063915148607488 -> n118219490218475520;\nn117938015241764864[shape=rectangle, label=\"B491\"];\nn119063915148607488 -> n117938015241764864;\nn118500965195186176[shape=rectangle, label=\"B492\"];\nn119063915148607488 -> n118500965195186176;\nn117656540265054208 -> n119063915148607488;\nn96264442035044352 -> n117656540265054208;\nn117375065288343552[shape=rectangle, label=\"B412\"];\nn96264442035044352 -> n117375065288343552;\nn120471290032160768[shape=rectangle, label=\"B493\"];\nn140174538401906688[shape=rectangle, label=\"B494\"];\nn140456013378617344[shape=rectangle, label=\"B496\"];\nn141018963332038656[shape=rectangle, label=\"B497\"];\nn141581913285459968[shape=rectangle, label=\"B498\"];\nn142144863238881280[shape=rectangle, label=\"B499\"];\nn141581913285459968 -> n142144863238881280;\nn141863388262170624[shape=rectangle, label=\"B503\"];\nn144115188075855872[shape=rectangle, label=\"B504\"];\nn143833713099145216[shape=rectangle, label=\"B505\"];\nn144396663052566528[shape=rectangle, label=\"B506\"];\nn143833713099145216 -> n144396663052566528;\nn144115188075855872 -> n143833713099145216;\nn143552238122434560[shape=rectangle, label=\"B507\"];\nn144115188075855872 -> n143552238122434560;\nn141863388262170624 -> n144115188075855872;\nn141581913285459968 -> n141863388262170624;\nn141018963332038656 -> n141581913285459968;\nn141300438308749312[shape=rectangle, label=\"B500\"];\nn141018963332038656 -> n141300438308749312;\nn142989288169013248[shape=rectangle, label=\"B501\"];\nn143270763145723904[shape=rectangle, label=\"B502\"];\nn142989288169013248 -> n143270763145723904;\nn141018963332038656 -> n142989288169013248;\nn142707813192302592[shape=rectangle, label=\"B508\"];\nn144959613005987840[shape=rectangle, label=\"B509\"];\nn145241087982698496[shape=rectangle, label=\"B510\"];\nn144959613005987840 -> n145241087982698496;\nn142707813192302592 -> n144959613005987840;\nn144678138029277184[shape=rectangle, label=\"B511\"];\nn145804037936119808[shape=rectangle, label=\"B512\"];\nn144678138029277184 -> n145804037936119808;\nn145522562959409152[shape=rectangle, label=\"B513\"];\nn144678138029277184 -> n145522562959409152;\nn142707813192302592 -> n144678138029277184;\nn141018963332038656 -> n142707813192302592;\nn142426338215591936[shape=rectangle, label=\"B514\"];\nn146085512912830464[shape=rectangle, label=\"B515\"];\nn142426338215591936 -> n146085512912830464;\nn141018963332038656 -> n142426338215591936;\nn140456013378617344 -> n141018963332038656;\nn140737488355328000[shape=rectangle, label=\"B495\"];\nn140456013378617344 -> n140737488355328000;\nn140174538401906688 -> n140456013378617344;\nn120471290032160768 -> n140174538401906688;\nn96264442035044352 -> n120471290032160768;\nn87257242780303360 -> n96264442035044352;\nn83316593106354176 -> n87257242780303360;\nn80783318315958272 -> n83316593106354176;\nn74590868828323840 -> n80783318315958272;\nn98234766872018944[shape=rectangle, label=\"B516\"];\nn146648462866251776[shape=rectangle, label=\"B517\"];\nn98234766872018944 -> n146648462866251776;\nn74590868828323840 -> n98234766872018944;\nn97108866965176320[shape=rectangle, label=\"B518\"];\nn74590868828323840 -> n97108866965176320;\nn146366987889541120[shape=rectangle, label=\"B519\"];\nn74590868828323840 -> n146366987889541120;\nn146929937842962432[shape=rectangle, label=\"B520\"];\nn147211412819673088[shape=rectangle, label=\"B521\"];\nn147774362773094400[shape=rectangle, label=\"B522\"];\nn148055837749805056[shape=rectangle, label=\"B523\"];\nn148337312726515712[shape=rectangle, label=\"B524\"];\nn148900262679937024[shape=rectangle, label=\"B525\"];\nn149463212633358336[shape=rectangle, label=\"B526\"];\nn148900262679937024 -> n149463212633358336;\nn149181737656647680[shape=rectangle, label=\"B530\"];\nn151433537470332928[shape=rectangle, label=\"B531\"];\nn151152062493622272[shape=rectangle, label=\"B532\"];\nn151715012447043584[shape=rectangle, label=\"B533\"];\nn151152062493622272 -> n151715012447043584;\nn151433537470332928 -> n151152062493622272;\nn150870587516911616[shape=rectangle, label=\"B534\"];\nn151433537470332928 -> n150870587516911616;\nn149181737656647680 -> n151433537470332928;\nn148900262679937024 -> n149181737656647680;\nn148337312726515712 -> n148900262679937024;\nn148618787703226368[shape=rectangle, label=\"B527\"];\nn148337312726515712 -> n148618787703226368;\nn150307637563490304[shape=rectangle, label=\"B528\"];\nn150589112540200960[shape=rectangle, label=\"B529\"];\nn150307637563490304 -> n150589112540200960;\nn148337312726515712 -> n150307637563490304;\nn150026162586779648[shape=rectangle, label=\"B535\"];\nn152559437377175552[shape=rectangle, label=\"B536\"];\nn152840912353886208[shape=rectangle, label=\"B537\"];\nn152559437377175552 -> n152840912353886208;\nn150026162586779648 -> n152559437377175552;\nn152277962400464896[shape=rectangle, label=\"B538\"];\nn153122387330596864[shape=rectangle, label=\"B539\"];\nn152277962400464896 -> n153122387330596864;\nn150026162586779648 -> n152277962400464896;\nn148337312726515712 -> n150026162586779648;\nn151996487423754240[shape=rectangle, label=\"B540\"];\nn148337312726515712 -> n151996487423754240;\nn149744687610068992[shape=rectangle, label=\"B541\"];\nn153403862307307520[shape=rectangle, label=\"B542\"];\nn149744687610068992 -> n153403862307307520;\nn148337312726515712 -> n149744687610068992;\nn148055837749805056 -> n148337312726515712;\nn147774362773094400 -> n148055837749805056;\nn147211412819673088 -> n147774362773094400;\nn147492887796383744[shape=rectangle, label=\"B543\"];\nn153966812260728832[shape=rectangle, label=\"B544\"];\nn154529762214150144[shape=rectangle, label=\"B545\"];\nn155092712167571456[shape=rectangle, label=\"B546\"];\nn155374187144282112[shape=rectangle, label=\"B547\"];\nn155655662120992768[shape=rectangle, label=\"B548\"];\nn155374187144282112 -> n155655662120992768;\nn155092712167571456 -> n155374187144282112;\nn154529762214150144 -> n155092712167571456;\nn154811237190860800[shape=rectangle, label=\"B564\"];\nn154529762214150144 -> n154811237190860800;\nn155937137097703424[shape=rectangle, label=\"B565\"];\nn162411061562048512[shape=rectangle, label=\"B566\"];\nn163818436445601792[shape=rectangle, label=\"B567\"];\nn162974011515469824[shape=rectangle, label=\"B568\"];\nn163536961468891136[shape=rectangle, label=\"B569\"];\nn164099911422312448[shape=rectangle, label=\"B570\"];\nn163536961468891136 -> n164099911422312448;\nn162974011515469824 -> n163536961468891136;\nn163818436445601792 -> n162974011515469824;\nn162692536538759168[shape=rectangle, label=\"B588\"];\nn163818436445601792 -> n162692536538759168;\nn163255486492180480[shape=rectangle, label=\"B589\"];\nn163818436445601792 -> n163255486492180480;\nn162411061562048512 -> n163818436445601792;\nn155937137097703424 -> n162411061562048512;\nn162129586585337856[shape=rectangle, label=\"B586\"];\nn155937137097703424 -> n162129586585337856;\nn169447935979814912[shape=rectangle, label=\"B590\"];\nn170292360909946880[shape=rectangle, label=\"B591\"];\nn170573835886657536[shape=rectangle, label=\"B593\"];\nn171418260816789504[shape=rectangle, label=\"B594\"];\nn171981210770210816[shape=rectangle, label=\"B595\"];\nn172544160723632128[shape=rectangle, label=\"B596\"];\nn171981210770210816 -> n172544160723632128;\nn172262685746921472[shape=rectangle, label=\"B600\"];\nn174514485560606720[shape=rectangle, label=\"B601\"];\nn174233010583896064[shape=rectangle, label=\"B602\"];\nn174795960537317376[shape=rectangle, label=\"B603\"];\nn174233010583896064 -> n174795960537317376;\nn174514485560606720 -> n174233010583896064;\nn173951535607185408[shape=rectangle, label=\"B604\"];\nn174514485560606720 -> n173951535607185408;\nn172262685746921472 -> n174514485560606720;\nn171981210770210816 -> n172262685746921472;\nn171418260816789504 -> n171981210770210816;\nn171699735793500160[shape=rectangle, label=\"B597\"];\nn171418260816789504 -> n171699735793500160;\nn173388585653764096[shape=rectangle, label=\"B598\"];\nn173670060630474752[shape=rectangle, label=\"B599\"];\nn173388585653764096 -> n173670060630474752;\nn171418260816789504 -> n173388585653764096;\nn173107110677053440[shape=rectangle, label=\"B605\"];\nn175358910490738688[shape=rectangle, label=\"B606\"];\nn175640385467449344[shape=rectangle, label=\"B607\"];\nn175358910490738688 -> n175640385467449344;\nn173107110677053440 -> n175358910490738688;\nn175077435514028032[shape=rectangle, label=\"B608\"];\nn176203335420870656[shape=rectangle, label=\"B609\"];\nn175077435514028032 -> n176203335420870656;\nn175921860444160000[shape=rectangle, label=\"B610\"];\nn175077435514028032 -> n175921860444160000;\nn173107110677053440 -> n175077435514028032;\nn171418260816789504 -> n173107110677053440;\nn172825635700342784[shape=rectangle, label=\"B611\"];\nn176484810397581312[shape=rectangle, label=\"B612\"];\nn176766285374291968[shape=rectangle, label=\"B613\"];\nn176484810397581312 -> n176766285374291968;\nn172825635700342784 -> n176484810397581312;\nn171418260816789504 -> n172825635700342784;\nn170573835886657536 -> n171418260816789504;\nn170855310863368192[shape=rectangle, label=\"B592\"];\nn170573835886657536 -> n170855310863368192;\nn170292360909946880 -> n170573835886657536;\nn169447935979814912 -> n170292360909946880;\nn155937137097703424 -> n169447935979814912;\nn154529762214150144 -> n155937137097703424;\nn153966812260728832 -> n154529762214150144;\nn154248287237439488[shape=rectangle, label=\"B554\"];\nn158470411888099328[shape=rectangle, label=\"B555\"];\nn159033361841520640[shape=rectangle, label=\"B556\"];\nn159314836818231296[shape=rectangle, label=\"B557\"];\nn159596311794941952[shape=rectangle, label=\"B558\"];\nn159314836818231296 -> n159596311794941952;\nn159033361841520640 -> n159314836818231296;\nn158470411888099328 -> n159033361841520640;\nn158751886864809984[shape=rectangle, label=\"B640\"];\nn158470411888099328 -> n158751886864809984;\nn159877786771652608[shape=rectangle, label=\"B641\"];\nn183803159792058368[shape=rectangle, label=\"B642\"];\nn185210534675611648[shape=rectangle, label=\"B643\"];\nn184366109745479680[shape=rectangle, label=\"B644\"];\nn184929059698900992[shape=rectangle, label=\"B645\"];\nn185492009652322304[shape=rectangle, label=\"B646\"];\nn184929059698900992 -> n185492009652322304;\nn184366109745479680 -> n184929059698900992;\nn185210534675611648 -> n184366109745479680;\nn184084634768769024[shape=rectangle, label=\"B672\"];\nn185210534675611648 -> n184084634768769024;\nn184647584722190336[shape=rectangle, label=\"B673\"];\nn185210534675611648 -> n184647584722190336;\nn183803159792058368 -> n185210534675611648;\nn159877786771652608 -> n183803159792058368;\nn183521684815347712[shape=rectangle, label=\"B668\"];\nn159877786771652608 -> n183521684815347712;\nn192528884070088704[shape=rectangle, label=\"B674\"];\nn193654783976931328[shape=rectangle, label=\"B675\"];\nn193936258953641984[shape=rectangle, label=\"B677\"];\nn194499208907063296[shape=rectangle, label=\"B678\"];\nn195062158860484608[shape=rectangle, label=\"B679\"];\nn195625108813905920[shape=rectangle, label=\"B680\"];\nn195062158860484608 -> n195625108813905920;\nn195343633837195264[shape=rectangle, label=\"B684\"];\nn197595433650880512[shape=rectangle, label=\"B685\"];\nn197313958674169856[shape=rectangle, label=\"B686\"];\nn197876908627591168[shape=rectangle, label=\"B687\"];\nn197313958674169856 -> n197876908627591168;\nn197595433650880512 -> n197313958674169856;\nn197032483697459200[shape=rectangle, label=\"B688\"];\nn197595433650880512 -> n197032483697459200;\nn195343633837195264 -> n197595433650880512;\nn195062158860484608 -> n195343633837195264;\nn194499208907063296 -> n195062158860484608;\nn194780683883773952[shape=rectangle, label=\"B681\"];\nn194499208907063296 -> n194780683883773952;\nn196469533744037888[shape=rectangle, label=\"B682\"];\nn196751008720748544[shape=rectangle, label=\"B683\"];\nn196469533744037888 -> n196751008720748544;\nn194499208907063296 -> n196469533744037888;\nn196188058767327232[shape=rectangle, label=\"B689\"];\nn198439858581012480[shape=rectangle, label=\"B690\"];\nn198721333557723136[shape=rectangle, label=\"B691\"];\nn198439858581012480 -> n198721333557723136;\nn196188058767327232 -> n198439858581012480;\nn198158383604301824[shape=rectangle, label=\"B692\"];\nn199284283511144448[shape=rectangle, label=\"B693\"];\nn198158383604301824 -> n199284283511144448;\nn199002808534433792[shape=rectangle, label=\"B694\"];\nn198158383604301824 -> n199002808534433792;\nn196188058767327232 -> n198158383604301824;\nn194499208907063296 -> n196188058767327232;\nn195906583790616576[shape=rectangle, label=\"B695\"];\nn199565758487855104[shape=rectangle, label=\"B696\"];\nn199847233464565760[shape=rectangle, label=\"B697\"];\nn199565758487855104 -> n199847233464565760;\nn195906583790616576 -> n199565758487855104;\nn194499208907063296 -> n195906583790616576;\nn193936258953641984 -> n194499208907063296;\nn194217733930352640[shape=rectangle, label=\"B676\"];\nn193936258953641984 -> n194217733930352640;\nn193654783976931328 -> n193936258953641984;\nn192528884070088704 -> n193654783976931328;\nn159877786771652608 -> n192528884070088704;\nn158470411888099328 -> n159877786771652608;\nn154248287237439488 -> n158470411888099328;\nn158188936911388672[shape=rectangle, label=\"B578\"];\nn166914661189419008[shape=rectangle, label=\"B579\"];\nn167196136166129664[shape=rectangle, label=\"B580\"];\nn167477611142840320[shape=rectangle, label=\"B581\"];\nn167196136166129664 -> n167477611142840320;\nn166914661189419008 -> n167196136166129664;\nn158188936911388672 -> n166914661189419008;\nn166633186212708352[shape=rectangle, label=\"B654\"];\nn158188936911388672 -> n166633186212708352;\nn167759086119550976[shape=rectangle, label=\"B655\"];\nn188306759419428864[shape=rectangle, label=\"B656\"];\nn189714134302982144[shape=rectangle, label=\"B657\"];\nn188869709372850176[shape=rectangle, label=\"B658\"];\nn189432659326271488[shape=rectangle, label=\"B659\"];\nn189995609279692800[shape=rectangle, label=\"B660\"];\nn189432659326271488 -> n189995609279692800;\nn188869709372850176 -> n189432659326271488;\nn189714134302982144 -> n188869709372850176;\nn188588234396139520[shape=rectangle, label=\"B724\"];\nn189714134302982144 -> n188588234396139520;\nn189151184349560832[shape=rectangle, label=\"B725\"];\nn189714134302982144 -> n189151184349560832;\nn188306759419428864 -> n189714134302982144;\nn167759086119550976 -> n188306759419428864;\nn188025284442718208[shape=rectangle, label=\"B670\"];\nn167759086119550976 -> n188025284442718208;\nn193091834023510016[shape=rectangle, label=\"B726\"];\nn206602632905621504[shape=rectangle, label=\"B727\"];\nn206884107882332160[shape=rectangle, label=\"B729\"];\nn207447057835753472[shape=rectangle, label=\"B730\"];\nn208010007789174784[shape=rectangle, label=\"B731\"];\nn208572957742596096[shape=rectangle, label=\"B732\"];\nn208010007789174784 -> n208572957742596096;\nn208291482765885440[shape=rectangle, label=\"B736\"];\nn210543282579570688[shape=rectangle, label=\"B737\"];\nn210261807602860032[shape=rectangle, label=\"B738\"];\nn210824757556281344[shape=rectangle, label=\"B739\"];\nn210261807602860032 -> n210824757556281344;\nn210543282579570688 -> n210261807602860032;\nn209980332626149376[shape=rectangle, label=\"B740\"];\nn210543282579570688 -> n209980332626149376;\nn208291482765885440 -> n210543282579570688;\nn208010007789174784 -> n208291482765885440;\nn207447057835753472 -> n208010007789174784;\nn207728532812464128[shape=rectangle, label=\"B733\"];\nn207447057835753472 -> n207728532812464128;\nn209417382672728064[shape=rectangle, label=\"B734\"];\nn209698857649438720[shape=rectangle, label=\"B735\"];\nn209417382672728064 -> n209698857649438720;\nn207447057835753472 -> n209417382672728064;\nn209135907696017408[shape=rectangle, label=\"B741\"];\nn211387707509702656[shape=rectangle, label=\"B742\"];\nn211669182486413312[shape=rectangle, label=\"B743\"];\nn211387707509702656 -> n211669182486413312;\nn209135907696017408 -> n211387707509702656;\nn211106232532992000[shape=rectangle, label=\"B744\"];\nn212232132439834624[shape=rectangle, label=\"B745\"];\nn211106232532992000 -> n212232132439834624;\nn211950657463123968[shape=rectangle, label=\"B746\"];\nn211106232532992000 -> n211950657463123968;\nn209135907696017408 -> n211106232532992000;\nn207447057835753472 -> n209135907696017408;\nn208854432719306752[shape=rectangle, label=\"B747\"];\nn212513607416545280[shape=rectangle, label=\"B748\"];\nn212795082393255936[shape=rectangle, label=\"B749\"];\nn212513607416545280 -> n212795082393255936;\nn208854432719306752 -> n212513607416545280;\nn207447057835753472 -> n208854432719306752;\nn206884107882332160 -> n207447057835753472;\nn207165582859042816[shape=rectangle, label=\"B728\"];\nn206884107882332160 -> n207165582859042816;\nn206602632905621504 -> n206884107882332160;\nn193091834023510016 -> n206602632905621504;\nn167759086119550976 -> n193091834023510016;\nn158188936911388672 -> n167759086119550976;\nn154248287237439488 -> n158188936911388672;\nn153966812260728832 -> n154248287237439488;\nn147492887796383744 -> n153966812260728832;\nn153685337284018176[shape=rectangle, label=\"B549\"];\nn156500087051124736[shape=rectangle, label=\"B550\"];\nn157063037004546048[shape=rectangle, label=\"B551\"];\nn157344511981256704[shape=rectangle, label=\"B552\"];\nn157625986957967360[shape=rectangle, label=\"B553\"];\nn157344511981256704 -> n157625986957967360;\nn157063037004546048 -> n157344511981256704;\nn156500087051124736 -> n157063037004546048;\nn156781562027835392[shape=rectangle, label=\"B571\"];\nn156500087051124736 -> n156781562027835392;\nn157907461934678016[shape=rectangle, label=\"B572\"];\nn164662861375733760[shape=rectangle, label=\"B573\"];\nn166070236259287040[shape=rectangle, label=\"B574\"];\nn165225811329155072[shape=rectangle, label=\"B575\"];\nn165788761282576384[shape=rectangle, label=\"B576\"];\nn166351711235997696[shape=rectangle, label=\"B577\"];\nn165788761282576384 -> n166351711235997696;\nn165225811329155072 -> n165788761282576384;\nn166070236259287040 -> n165225811329155072;\nn164944336352444416[shape=rectangle, label=\"B614\"];\nn166070236259287040 -> n164944336352444416;\nn165507286305865728[shape=rectangle, label=\"B615\"];\nn166070236259287040 -> n165507286305865728;\nn164662861375733760 -> n166070236259287040;\nn157907461934678016 -> n164662861375733760;\nn164381386399023104[shape=rectangle, label=\"B587\"];\nn157907461934678016 -> n164381386399023104;\nn169729410956525568[shape=rectangle, label=\"B616\"];\nn177047760351002624[shape=rectangle, label=\"B617\"];\nn177329235327713280[shape=rectangle, label=\"B619\"];\nn177892185281134592[shape=rectangle, label=\"B620\"];\nn178455135234555904[shape=rectangle, label=\"B621\"];\nn179018085187977216[shape=rectangle, label=\"B622\"];\nn178455135234555904 -> n179018085187977216;\nn178736610211266560[shape=rectangle, label=\"B626\"];\nn180988410024951808[shape=rectangle, label=\"B627\"];\nn180706935048241152[shape=rectangle, label=\"B628\"];\nn181269885001662464[shape=rectangle, label=\"B629\"];\nn180706935048241152 -> n181269885001662464;\nn180988410024951808 -> n180706935048241152;\nn180425460071530496[shape=rectangle, label=\"B630\"];\nn180988410024951808 -> n180425460071530496;\nn178736610211266560 -> n180988410024951808;\nn178455135234555904 -> n178736610211266560;\nn177892185281134592 -> n178455135234555904;\nn178173660257845248[shape=rectangle, label=\"B623\"];\nn177892185281134592 -> n178173660257845248;\nn179862510118109184[shape=rectangle, label=\"B624\"];\nn180143985094819840[shape=rectangle, label=\"B625\"];\nn179862510118109184 -> n180143985094819840;\nn177892185281134592 -> n179862510118109184;\nn179581035141398528[shape=rectangle, label=\"B631\"];\nn181832834955083776[shape=rectangle, label=\"B632\"];\nn182114309931794432[shape=rectangle, label=\"B633\"];\nn181832834955083776 -> n182114309931794432;\nn179581035141398528 -> n181832834955083776;\nn181551359978373120[shape=rectangle, label=\"B634\"];\nn182677259885215744[shape=rectangle, label=\"B635\"];\nn181551359978373120 -> n182677259885215744;\nn182395784908505088[shape=rectangle, label=\"B636\"];\nn181551359978373120 -> n182395784908505088;\nn179581035141398528 -> n181551359978373120;\nn177892185281134592 -> n179581035141398528;\nn179299560164687872[shape=rectangle, label=\"B637\"];\nn182958734861926400[shape=rectangle, label=\"B638\"];\nn183240209838637056[shape=rectangle, label=\"B639\"];\nn182958734861926400 -> n183240209838637056;\nn179299560164687872 -> n182958734861926400;\nn177892185281134592 -> n179299560164687872;\nn177329235327713280 -> n177892185281134592;\nn177610710304423936[shape=rectangle, label=\"B618\"];\nn177329235327713280 -> n177610710304423936;\nn177047760351002624 -> n177329235327713280;\nn169729410956525568 -> n177047760351002624;\nn157907461934678016 -> n169729410956525568;\nn156500087051124736 -> n157907461934678016;\nn153685337284018176 -> n156500087051124736;\nn156218612074414080[shape=rectangle, label=\"B559\"];\nn160440736725073920[shape=rectangle, label=\"B560\"];\nn161003686678495232[shape=rectangle, label=\"B561\"];\nn161285161655205888[shape=rectangle, label=\"B562\"];\nn161566636631916544[shape=rectangle, label=\"B563\"];\nn161285161655205888 -> n161566636631916544;\nn161003686678495232 -> n161285161655205888;\nn160440736725073920 -> n161003686678495232;\nn160722211701784576[shape=rectangle, label=\"B647\"];\nn160440736725073920 -> n160722211701784576;\nn161848111608627200[shape=rectangle, label=\"B648\"];\nn186054959605743616[shape=rectangle, label=\"B649\"];\nn187462334489296896[shape=rectangle, label=\"B650\"];\nn186617909559164928[shape=rectangle, label=\"B651\"];\nn187180859512586240[shape=rectangle, label=\"B652\"];\nn187743809466007552[shape=rectangle, label=\"B653\"];\nn187180859512586240 -> n187743809466007552;\nn186617909559164928 -> n187180859512586240;\nn187462334489296896 -> n186617909559164928;\nn186336434582454272[shape=rectangle, label=\"B698\"];\nn187462334489296896 -> n186336434582454272;\nn186899384535875584[shape=rectangle, label=\"B699\"];\nn187462334489296896 -> n186899384535875584;\nn186054959605743616 -> n187462334489296896;\nn161848111608627200 -> n186054959605743616;\nn185773484629032960[shape=rectangle, label=\"B669\"];\nn161848111608627200 -> n185773484629032960;\nn192810359046799360[shape=rectangle, label=\"B700\"];\nn200128708441276416[shape=rectangle, label=\"B701\"];\nn200410183417987072[shape=rectangle, label=\"B703\"];\nn200973133371408384[shape=rectangle, label=\"B704\"];\nn201536083324829696[shape=rectangle, label=\"B705\"];\nn202099033278251008[shape=rectangle, label=\"B706\"];\nn201536083324829696 -> n202099033278251008;\nn201817558301540352[shape=rectangle, label=\"B710\"];\nn204069358115225600[shape=rectangle, label=\"B711\"];\nn203787883138514944[shape=rectangle, label=\"B712\"];\nn204350833091936256[shape=rectangle, label=\"B713\"];\nn203787883138514944 -> n204350833091936256;\nn204069358115225600 -> n203787883138514944;\nn203506408161804288[shape=rectangle, label=\"B714\"];\nn204069358115225600 -> n203506408161804288;\nn201817558301540352 -> n204069358115225600;\nn201536083324829696 -> n201817558301540352;\nn200973133371408384 -> n201536083324829696;\nn201254608348119040[shape=rectangle, label=\"B707\"];\nn200973133371408384 -> n201254608348119040;\nn202943458208382976[shape=rectangle, label=\"B708\"];\nn203224933185093632[shape=rectangle, label=\"B709\"];\nn202943458208382976 -> n203224933185093632;\nn200973133371408384 -> n202943458208382976;\nn202661983231672320[shape=rectangle, label=\"B715\"];\nn204913783045357568[shape=rectangle, label=\"B716\"];\nn205195258022068224[shape=rectangle, label=\"B717\"];\nn204913783045357568 -> n205195258022068224;\nn202661983231672320 -> n204913783045357568;\nn204632308068646912[shape=rectangle, label=\"B718\"];\nn205758207975489536[shape=rectangle, label=\"B719\"];\nn204632308068646912 -> n205758207975489536;\nn205476732998778880[shape=rectangle, label=\"B720\"];\nn204632308068646912 -> n205476732998778880;\nn202661983231672320 -> n204632308068646912;\nn200973133371408384 -> n202661983231672320;\nn202380508254961664[shape=rectangle, label=\"B721\"];\nn206039682952200192[shape=rectangle, label=\"B722\"];\nn206321157928910848[shape=rectangle, label=\"B723\"];\nn206039682952200192 -> n206321157928910848;\nn202380508254961664 -> n206039682952200192;\nn200973133371408384 -> n202380508254961664;\nn200410183417987072 -> n200973133371408384;\nn200691658394697728[shape=rectangle, label=\"B702\"];\nn200410183417987072 -> n200691658394697728;\nn200128708441276416 -> n200410183417987072;\nn192810359046799360 -> n200128708441276416;\nn161848111608627200 -> n192810359046799360;\nn160440736725073920 -> n161848111608627200;\nn156218612074414080 -> n160440736725073920;\nn160159261748363264[shape=rectangle, label=\"B582\"];\nn168322036072972288[shape=rectangle, label=\"B583\"];\nn168603511049682944[shape=rectangle, label=\"B584\"];\nn168884986026393600[shape=rectangle, label=\"B585\"];\nn168603511049682944 -> n168884986026393600;\nn168322036072972288 -> n168603511049682944;\nn160159261748363264 -> n168322036072972288;\nn168040561096261632[shape=rectangle, label=\"B661\"];\nn160159261748363264 -> n168040561096261632;\nn169166461003104256[shape=rectangle, label=\"B662\"];\nn190558559233114112[shape=rectangle, label=\"B663\"];\nn191965934116667392[shape=rectangle, label=\"B664\"];\nn191121509186535424[shape=rectangle, label=\"B665\"];\nn191684459139956736[shape=rectangle, label=\"B666\"];\nn192247409093378048[shape=rectangle, label=\"B667\"];\nn191684459139956736 -> n192247409093378048;\nn191121509186535424 -> n191684459139956736;\nn191965934116667392 -> n191121509186535424;\nn190840034209824768[shape=rectangle, label=\"B750\"];\nn191965934116667392 -> n190840034209824768;\nn191402984163246080[shape=rectangle, label=\"B751\"];\nn191965934116667392 -> n191402984163246080;\nn190558559233114112 -> n191965934116667392;\nn169166461003104256 -> n190558559233114112;\nn190277084256403456[shape=rectangle, label=\"B671\"];\nn169166461003104256 -> n190277084256403456;\nn193373309000220672[shape=rectangle, label=\"B752\"];\nn213076557369966592[shape=rectangle, label=\"B753\"];\nn213358032346677248[shape=rectangle, label=\"B755\"];\nn213920982300098560[shape=rectangle, label=\"B756\"];\nn214483932253519872[shape=rectangle, label=\"B757\"];\nn215046882206941184[shape=rectangle, label=\"B758\"];\nn214483932253519872 -> n215046882206941184;\nn214765407230230528[shape=rectangle, label=\"B762\"];\nn217017207043915776[shape=rectangle, label=\"B763\"];\nn216735732067205120[shape=rectangle, label=\"B764\"];\nn217298682020626432[shape=rectangle, label=\"B765\"];\nn216735732067205120 -> n217298682020626432;\nn217017207043915776 -> n216735732067205120;\nn216454257090494464[shape=rectangle, label=\"B766\"];\nn217017207043915776 -> n216454257090494464;\nn214765407230230528 -> n217017207043915776;\nn214483932253519872 -> n214765407230230528;\nn213920982300098560 -> n214483932253519872;\nn214202457276809216[shape=rectangle, label=\"B759\"];\nn213920982300098560 -> n214202457276809216;\nn215891307137073152[shape=rectangle, label=\"B760\"];\nn216172782113783808[shape=rectangle, label=\"B761\"];\nn215891307137073152 -> n216172782113783808;\nn213920982300098560 -> n215891307137073152;\nn215609832160362496[shape=rectangle, label=\"B767\"];\nn217861631974047744[shape=rectangle, label=\"B768\"];\nn218143106950758400[shape=rectangle, label=\"B769\"];\nn217861631974047744 -> n218143106950758400;\nn215609832160362496 -> n217861631974047744;\nn217580156997337088[shape=rectangle, label=\"B770\"];\nn218706056904179712[shape=rectangle, label=\"B771\"];\nn217580156997337088 -> n218706056904179712;\nn218424581927469056[shape=rectangle, label=\"B772\"];\nn217580156997337088 -> n218424581927469056;\nn215609832160362496 -> n217580156997337088;\nn213920982300098560 -> n215609832160362496;\nn215328357183651840[shape=rectangle, label=\"B773\"];\nn218987531880890368[shape=rectangle, label=\"B774\"];\nn219269006857601024[shape=rectangle, label=\"B775\"];\nn218987531880890368 -> n219269006857601024;\nn215328357183651840 -> n218987531880890368;\nn213920982300098560 -> n215328357183651840;\nn213358032346677248 -> n213920982300098560;\nn213639507323387904[shape=rectangle, label=\"B754\"];\nn213358032346677248 -> n213639507323387904;\nn213076557369966592 -> n213358032346677248;\nn193373309000220672 -> n213076557369966592;\nn169166461003104256 -> n193373309000220672;\nn160159261748363264 -> n169166461003104256;\nn156218612074414080 -> n160159261748363264;\nn153685337284018176 -> n156218612074414080;\nn147492887796383744 -> n153685337284018176;\nn170010885933236224[shape=rectangle, label=\"B776\"];\nn147492887796383744 -> n170010885933236224;\nn171136785840078848[shape=rectangle, label=\"B777\"];\nn219550481834311680[shape=rectangle, label=\"B778\"];\nn171136785840078848 -> n219550481834311680;\nn147492887796383744 -> n171136785840078848;\nn147211412819673088 -> n147492887796383744;\nn146929937842962432 -> n147211412819673088;\nn74590868828323840 -> n146929937842962432;\nn74309393851613184[shape=rectangle, label=\"B261\"];\nn74590868828323840 -> n74309393851613184;\nn74027918874902528 -> n74590868828323840;\nn73746443898191872 -> n74027918874902528;\nn73183493944770560 -> n73746443898191872;\nn73464968921481216[shape=rectangle, label=\"B779\"];\nn220113431787732992[shape=rectangle, label=\"B780\"];\nn220676381741154304[shape=rectangle, label=\"B781\"];\nn220957856717864960[shape=rectangle, label=\"B782\"];\nn222365231601418240[shape=rectangle, label=\"B783\"];\nn221520806671286272[shape=rectangle, label=\"B784\"];\nn222083756624707584[shape=rectangle, label=\"B785\"];\nn222646706578128896[shape=rectangle, label=\"B786\"];\nn222083756624707584 -> n222646706578128896;\nn221520806671286272 -> n222083756624707584;\nn222365231601418240 -> n221520806671286272;\nn221239331694575616[shape=rectangle, label=\"B794\"];\nn222365231601418240 -> n221239331694575616;\nn220957856717864960 -> n222365231601418240;\nn220676381741154304 -> n220957856717864960;\nn220113431787732992 -> n220676381741154304;\nn220394906764443648[shape=rectangle, label=\"B792\"];\nn220113431787732992 -> n220394906764443648;\nn221802281647996928[shape=rectangle, label=\"B795\"];\nn220113431787732992 -> n221802281647996928;\nn73464968921481216 -> n220113431787732992;\nn219831956811022336[shape=rectangle, label=\"B787\"];\nn73464968921481216 -> n219831956811022336;\nn223209656531550208[shape=rectangle, label=\"B788\"];\nn223772606484971520[shape=rectangle, label=\"B789\"];\nn224054081461682176[shape=rectangle, label=\"B790\"];\nn224335556438392832[shape=rectangle, label=\"B791\"];\nn224054081461682176 -> n224335556438392832;\nn223772606484971520 -> n224054081461682176;\nn223209656531550208 -> n223772606484971520;\nn223491131508260864[shape=rectangle, label=\"B793\"];\nn223209656531550208 -> n223491131508260864;\nn73464968921481216 -> n223209656531550208;\nn222928181554839552[shape=rectangle, label=\"B796\"];\nn225461456345235456[shape=rectangle, label=\"B797\"];\nn226024406298656768[shape=rectangle, label=\"B798\"];\nn225461456345235456 -> n226024406298656768;\nn222928181554839552 -> n225461456345235456;\nn225179981368524800[shape=rectangle, label=\"B799\"];\nn226305881275367424[shape=rectangle, label=\"B800\"];\nn226587356252078080[shape=rectangle, label=\"B801\"];\nn226305881275367424 -> n226587356252078080;\nn225179981368524800 -> n226305881275367424;\nn222928181554839552 -> n225179981368524800;\nn225742931321946112[shape=rectangle, label=\"B802\"];\nn227150306205499392[shape=rectangle, label=\"B803\"];\nn225742931321946112 -> n227150306205499392;\nn226868831228788736[shape=rectangle, label=\"B804\"];\nn227994731135631360[shape=rectangle, label=\"B805\"];\nn226868831228788736 -> n227994731135631360;\nn227713256158920704[shape=rectangle, label=\"B806\"];\nn228557681089052672[shape=rectangle, label=\"B807\"];\nn227713256158920704 -> n228557681089052672;\nn228276206112342016[shape=rectangle, label=\"B808\"];\nn229120631042473984[shape=rectangle, label=\"B809\"];\nn229402106019184640[shape=rectangle, label=\"B810\"];\nn229683580995895296[shape=rectangle, label=\"B811\"];\nn229965055972605952[shape=rectangle, label=\"B816\"];\nn229683580995895296 -> n229965055972605952;\nn229402106019184640 -> n229683580995895296;\nn229120631042473984 -> n229402106019184640;\nn228276206112342016 -> n229120631042473984;\nn227713256158920704 -> n228276206112342016;\nn228839156065763328[shape=rectangle, label=\"B812\"];\nn230246530949316608[shape=rectangle, label=\"B813\"];\nn230528005926027264[shape=rectangle, label=\"B814\"];\nn230809480902737920[shape=rectangle, label=\"B815\"];\nn230528005926027264 -> n230809480902737920;\nn230246530949316608 -> n230528005926027264;\nn228839156065763328 -> n230246530949316608;\nn227713256158920704 -> n228839156065763328;\nn226868831228788736 -> n227713256158920704;\nn225742931321946112 -> n226868831228788736;\nn227431781182210048[shape=rectangle, label=\"B817\"];\nn225742931321946112 -> n227431781182210048;\nn222928181554839552 -> n225742931321946112;\nn73464968921481216 -> n222928181554839552;\nn224617031415103488[shape=rectangle, label=\"B818\"];\nn231090955879448576[shape=rectangle, label=\"B819\"];\nn224617031415103488 -> n231090955879448576;\nn73464968921481216 -> n224617031415103488;\nn224898506391814144[shape=rectangle, label=\"B820\"];\nn231653905832869888[shape=rectangle, label=\"B821\"];\nn224898506391814144 -> n231653905832869888;\nn231372430856159232[shape=rectangle, label=\"B822\"];\nn232216855786291200[shape=rectangle, label=\"B823\"];\nn232498330763001856[shape=rectangle, label=\"B824\"];\nn240098155134189568[shape=rectangle, label=\"B825\"];\nn233061280716423168[shape=rectangle, label=\"B826\"];\nn233624230669844480[shape=rectangle, label=\"B827\"];\nn234187180623265792[shape=rectangle, label=\"B828\"];\nn234750130576687104[shape=rectangle, label=\"B829\"];\nn234187180623265792 -> n234750130576687104;\nn233624230669844480 -> n234187180623265792;\nn233905705646555136[shape=rectangle, label=\"B833\"];\nn236720455413661696[shape=rectangle, label=\"B834\"];\nn236438980436951040[shape=rectangle, label=\"B835\"];\nn237001930390372352[shape=rectangle, label=\"B836\"];\nn236438980436951040 -> n237001930390372352;\nn236720455413661696 -> n236438980436951040;\nn236157505460240384[shape=rectangle, label=\"B840\"];\nn236720455413661696 -> n236157505460240384;\nn233905705646555136 -> n236720455413661696;\nn233624230669844480 -> n233905705646555136;\nn233061280716423168 -> n233624230669844480;\nn233342755693133824[shape=rectangle, label=\"B830\"];\nn233061280716423168 -> n233342755693133824;\nn235594555506819072[shape=rectangle, label=\"B831\"];\nn235876030483529728[shape=rectangle, label=\"B832\"];\nn235594555506819072 -> n235876030483529728;\nn233061280716423168 -> n235594555506819072;\nn235313080530108416[shape=rectangle, label=\"B841\"];\nn238972255227346944[shape=rectangle, label=\"B842\"];\nn239253730204057600[shape=rectangle, label=\"B843\"];\nn238972255227346944 -> n239253730204057600;\nn235313080530108416 -> n238972255227346944;\nn238690780250636288[shape=rectangle, label=\"B844\"];\nn239816680157478912[shape=rectangle, label=\"B845\"];\nn238690780250636288 -> n239816680157478912;\nn239535205180768256[shape=rectangle, label=\"B846\"];\nn238690780250636288 -> n239535205180768256;\nn235313080530108416 -> n238690780250636288;\nn233061280716423168 -> n235313080530108416;\nn235031605553397760[shape=rectangle, label=\"B847\"];\nn233061280716423168 -> n235031605553397760;\nn234468655599976448[shape=rectangle, label=\"B837\"];\nn233061280716423168 -> n234468655599976448;\nn237564880343793664[shape=rectangle, label=\"B838\"];\nn238127830297214976[shape=rectangle, label=\"B839\"];\nn237564880343793664 -> n238127830297214976;\nn233061280716423168 -> n237564880343793664;\nn237283405367083008[shape=rectangle, label=\"B848\"];\nn233061280716423168 -> n237283405367083008;\nn237846355320504320[shape=rectangle, label=\"B849\"];\nn240379630110900224[shape=rectangle, label=\"B850\"];\nn237846355320504320 -> n240379630110900224;\nn233061280716423168 -> n237846355320504320;\nn238409305273925632[shape=rectangle, label=\"B853\"];\nn233061280716423168 -> n238409305273925632;\nn240098155134189568 -> n233061280716423168;\nn232779805739712512[shape=rectangle, label=\"B851\"];\nn240098155134189568 -> n232779805739712512;\nn232498330763001856 -> n240098155134189568;\nn232216855786291200 -> n232498330763001856;\nn231372430856159232 -> n232216855786291200;\nn231935380809580544[shape=rectangle, label=\"B852\"];\nn231372430856159232 -> n231935380809580544;\nn224898506391814144 -> n231372430856159232;\nn73464968921481216 -> n224898506391814144;\nn73183493944770560 -> n73464968921481216;\nn24769797950537728 -> n73183493944770560;\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn24769797950537728 -> n1125899906842624;\nn240661105087610880[shape=rectangle, label=\"B3\"];\nn24769797950537728 -> n240661105087610880;\nn1688849860263936 -> n24769797950537728;\nn844424930131968 -> n1688849860263936;\nn562949953421312 -> n844424930131968;\nn0 -> n562949953421312;\nn281474976710656[shape=rectangle, label=\"B854\"];\nn0 -> n281474976710656;\nn1407374883553280[shape=rectangle, label=\"B855\"];\nn0 -> n1407374883553280;\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-208.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-213.txt",
    "content": "digraph {\n\nn9288674231451648[shape=rectangle, label=\"B36\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn9288674231451648 -> n10133099161583616;\nn9570149208162304[shape=rectangle, label=\"B34\"];\nn9851624184872960[shape=rectangle, label=\"B33\"];\nn9570149208162304 -> n9851624184872960;\nn8725724278030336[shape=rectangle, label=\"B32\"];\nn9570149208162304 -> n8725724278030336;\nn9288674231451648 -> n9570149208162304;\nn9007199254740992[shape=rectangle, label=\"B31\"];\nn9288674231451648 -> n9007199254740992;\nn8162774324609024[shape=rectangle, label=\"B30\"];\nn8444249301319680[shape=rectangle, label=\"B29\"];\nn8162774324609024 -> n8444249301319680;\nn5348024557502464[shape=rectangle, label=\"B28\"];\nn2533274790395904[shape=rectangle, label=\"B27\"];\nn5348024557502464 -> n2533274790395904;\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn7318349394477056[shape=rectangle, label=\"B25\"];\nn7036874417766400[shape=rectangle, label=\"B24\"];\nn6755399441055744[shape=rectangle, label=\"B22\"];\nn7036874417766400 -> n6755399441055744;\nn7318349394477056 -> n7036874417766400;\nn6473924464345088[shape=rectangle, label=\"B23\"];\nn7318349394477056 -> n6473924464345088;\nn5910974510923776[shape=rectangle, label=\"B21\"];\nn6192449487634432[shape=rectangle, label=\"B20\"];\nn5910974510923776 -> n6192449487634432;\nn7599824371187712[shape=rectangle, label=\"B19\"];\nn5629499534213120[shape=rectangle, label=\"B18\"];\nn7599824371187712 -> n5629499534213120;\nn5910974510923776 -> n7599824371187712;\nn7318349394477056 -> n5910974510923776;\nn7881299347898368 -> n7318349394477056;\nn5348024557502464 -> n7881299347898368;\nn4785074604081152[shape=rectangle, label=\"B17\"];\nn5066549580791808[shape=rectangle, label=\"B16\"];\nn4785074604081152 -> n5066549580791808;\nn4222124650659840[shape=rectangle, label=\"B15\"];\nn4503599627370496[shape=rectangle, label=\"B14\"];\nn4222124650659840 -> n4503599627370496;\nn3659174697238528[shape=rectangle, label=\"B13\"];\nn3940649673949184[shape=rectangle, label=\"B12\"];\nn3659174697238528 -> n3940649673949184;\nn3096224743817216[shape=rectangle, label=\"B11\"];\nn3377699720527872[shape=rectangle, label=\"B10\"];\nn3096224743817216 -> n3377699720527872;\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn3096224743817216 -> n2814749767106560;\nn3659174697238528 -> n3096224743817216;\nn4222124650659840 -> n3659174697238528;\nn4785074604081152 -> n4222124650659840;\nn5348024557502464 -> n4785074604081152;\nn1970324836974592[shape=rectangle, label=\"B8\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn1970324836974592 -> n2251799813685248;\nn844424930131968[shape=rectangle, label=\"B6\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656 -> n562949953421312;\nn0[shape=rectangle, label=\"B0\"];\nn281474976710656 -> n0;\nn844424930131968 -> n281474976710656;\nn1970324836974592 -> n844424930131968;\nn5348024557502464 -> n1970324836974592;\nn8162774324609024 -> n5348024557502464;\nn9288674231451648 -> n8162774324609024;\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-2131.txt",
    "content": "digraph {\n\nmaxiter=8;\n        \nn0[shape=rectangle, label=\"B0\"];\nn70368744177664000[shape=rectangle, label=\"B2\"];\nn29273397577908224[shape=rectangle, label=\"B3\"];\nn562949953421312[shape=rectangle, label=\"B4\"];\nn281474976710656[shape=rectangle, label=\"B5\"];\nn1125899906842624[shape=rectangle, label=\"B6\"];\nn1688849860263936[shape=rectangle, label=\"B7\"];\nn1407374883553280[shape=rectangle, label=\"B8\"];\nn2251799813685248[shape=rectangle, label=\"B9\"];\nn26458647810801664[shape=rectangle, label=\"B10\"];\nn2814749767106560[shape=rectangle, label=\"B11\"];\nn2533274790395904[shape=rectangle, label=\"B12\"];\nn3377699720527872[shape=rectangle, label=\"B13\"];\nn3096224743817216[shape=rectangle, label=\"B14\"];\nn3940649673949184[shape=rectangle, label=\"B15\"];\nn4503599627370496[shape=rectangle, label=\"B16\"];\nn4222124650659840[shape=rectangle, label=\"B17\"];\nn5066549580791808[shape=rectangle, label=\"B18\"];\nn4785074604081152[shape=rectangle, label=\"B19\"];\nn5629499534213120[shape=rectangle, label=\"B20\"];\nn5348024557502464[shape=rectangle, label=\"B21\"];\nn6473924464345088[shape=rectangle, label=\"B22\"];\nn7036874417766400[shape=rectangle, label=\"B23\"];\nn6755399441055744[shape=rectangle, label=\"B24\"];\nn6192449487634432[shape=rectangle, label=\"B25\"];\nn5910974510923776[shape=rectangle, label=\"B26\"];\nn7599824371187712[shape=rectangle, label=\"B27\"];\nn7318349394477056[shape=rectangle, label=\"B28\"];\nn8162774324609024[shape=rectangle, label=\"B29\"];\nn7881299347898368[shape=rectangle, label=\"B30\"];\nn3659174697238528[shape=rectangle, label=\"B31\"];\nn8725724278030336[shape=rectangle, label=\"B32\"];\nn8444249301319680[shape=rectangle, label=\"B33\"];\nn9288674231451648[shape=rectangle, label=\"B34\"];\nn9007199254740992[shape=rectangle, label=\"B35\"];\nn10133099161583616[shape=rectangle, label=\"B36\"];\nn9851624184872960[shape=rectangle, label=\"B37\"];\nn10696049115004928[shape=rectangle, label=\"B38\"];\nn11258999068426240[shape=rectangle, label=\"B39\"];\nn10977524091715584[shape=rectangle, label=\"B40\"];\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn12384898975268864[shape=rectangle, label=\"B42\"];\nn12103423998558208[shape=rectangle, label=\"B43\"];\nn11540474045136896[shape=rectangle, label=\"B44\"];\nn12947848928690176[shape=rectangle, label=\"B45\"];\nn12666373951979520[shape=rectangle, label=\"B46\"];\nn13510798882111488[shape=rectangle, label=\"B47\"];\nn14073748835532800[shape=rectangle, label=\"B48\"];\nn14636698788954112[shape=rectangle, label=\"B49\"];\nn14355223812243456[shape=rectangle, label=\"B50\"];\nn13792273858822144[shape=rectangle, label=\"B51\"];\nn15199648742375424[shape=rectangle, label=\"B52\"];\nn14918173765664768[shape=rectangle, label=\"B53\"];\nn15762598695796736[shape=rectangle, label=\"B54\"];\nn16044073672507392[shape=rectangle, label=\"B55\"];\nn13229323905400832[shape=rectangle, label=\"B56\"];\nn16607023625928704[shape=rectangle, label=\"B57\"];\nn16888498602639360[shape=rectangle, label=\"B58\"];\nn15481123719086080[shape=rectangle, label=\"B59\"];\nn16325548649218048[shape=rectangle, label=\"B60\"];\nn17169973579350016[shape=rectangle, label=\"B61\"];\nn17732923532771328[shape=rectangle, label=\"B62\"];\nn17451448556060672[shape=rectangle, label=\"B63\"];\nn18295873486192640[shape=rectangle, label=\"B64\"];\nn18858823439613952[shape=rectangle, label=\"B65\"];\nn19421773393035264[shape=rectangle, label=\"B66\"];\nn19984723346456576[shape=rectangle, label=\"B67\"];\nn19703248369745920[shape=rectangle, label=\"B68\"];\nn18577348462903296[shape=rectangle, label=\"B69\"];\nn20547673299877888[shape=rectangle, label=\"B70\"];\nn19140298416324608[shape=rectangle, label=\"B71\"];\nn20266198323167232[shape=rectangle, label=\"B72\"];\nn21110623253299200[shape=rectangle, label=\"B73\"];\nn21673573206720512[shape=rectangle, label=\"B74\"];\nn21955048183431168[shape=rectangle, label=\"B75\"];\nn18014398509481984[shape=rectangle, label=\"B76\"];\nn22517998136852480[shape=rectangle, label=\"B77\"];\nn20829148276588544[shape=rectangle, label=\"B78\"];\nn22799473113563136[shape=rectangle, label=\"B79\"];\nn23080948090273792[shape=rectangle, label=\"B80\"];\nn21392098230009856[shape=rectangle, label=\"B81\"];\nn22236523160141824[shape=rectangle, label=\"B82\"];\nn23362423066984448[shape=rectangle, label=\"B83\"];\nn23925373020405760[shape=rectangle, label=\"B84\"];\nn23643898043695104[shape=rectangle, label=\"B85\"];\nn24488322973827072[shape=rectangle, label=\"B86\"];\nn25051272927248384[shape=rectangle, label=\"B87\"];\nn24769797950537728[shape=rectangle, label=\"B88\"];\nn83879543059775488[shape=rectangle, label=\"B89\"];\nn78531518502273024[shape=rectangle, label=\"B90\"];\nn99360666778861568[shape=rectangle, label=\"B91\"];\nn10414574138294272[shape=rectangle, label=\"B92\"];\nn25614222880669696[shape=rectangle, label=\"B93\"];\nn26177172834091008[shape=rectangle, label=\"B94\"];\nn25895697857380352[shape=rectangle, label=\"B95\"];\nn24206847997116416[shape=rectangle, label=\"B96\"];\nn9570149208162304[shape=rectangle, label=\"B97\"];\nn1970324836974592[shape=rectangle, label=\"B98\"];\nn27021597764222976[shape=rectangle, label=\"B99\"];\nn26740122787512320[shape=rectangle, label=\"B100\"];\nn27584547717644288[shape=rectangle, label=\"B101\"];\nn27303072740933632[shape=rectangle, label=\"B102\"];\nn28147497671065600[shape=rectangle, label=\"B103\"];\nn28710447624486912[shape=rectangle, label=\"B104\"];\nn28428972647776256[shape=rectangle, label=\"B105\"];\nn28991922601197568[shape=rectangle, label=\"B106\"];\nn27866022694354944[shape=rectangle, label=\"B107\"];\nn29836347531329536[shape=rectangle, label=\"B108\"];\nn29554872554618880[shape=rectangle, label=\"B109\"];\nn30399297484750848[shape=rectangle, label=\"B110\"];\nn30117822508040192[shape=rectangle, label=\"B111\"];\nn30962247438172160[shape=rectangle, label=\"B112\"];\nn30680772461461504[shape=rectangle, label=\"B113\"];\nn31525197391593472[shape=rectangle, label=\"B114\"];\nn31243722414882816[shape=rectangle, label=\"B115\"];\nn32088147345014784[shape=rectangle, label=\"B116\"];\nn31806672368304128[shape=rectangle, label=\"B117\"];\nn32651097298436096[shape=rectangle, label=\"B118\"];\nn32369622321725440[shape=rectangle, label=\"B119\"];\nn32932572275146752[shape=rectangle, label=\"B120\"];\nn33214047251857408[shape=rectangle, label=\"B121\"];\nn41658296553177088[shape=rectangle, label=\"B122\"];\nn33495522228568064[shape=rectangle, label=\"B123\"];\nn34058472181989376[shape=rectangle, label=\"B124\"];\nn33776997205278720[shape=rectangle, label=\"B125\"];\nn34621422135410688[shape=rectangle, label=\"B126\"];\nn34339947158700032[shape=rectangle, label=\"B127\"];\nn35184372088832000[shape=rectangle, label=\"B128\"];\nn35465847065542656[shape=rectangle, label=\"B129\"];\nn40813871623045120[shape=rectangle, label=\"B130\"];\nn36028797018963968[shape=rectangle, label=\"B131\"];\nn35747322042253312[shape=rectangle, label=\"B132\"];\nn36591746972385280[shape=rectangle, label=\"B133\"];\nn37154696925806592[shape=rectangle, label=\"B134\"];\nn36873221949095936[shape=rectangle, label=\"B135\"];\nn37717646879227904[shape=rectangle, label=\"B136\"];\nn37999121855938560[shape=rectangle, label=\"B137\"];\nn38280596832649216[shape=rectangle, label=\"B138\"];\nn38843546786070528[shape=rectangle, label=\"B139\"];\nn39125021762781184[shape=rectangle, label=\"B140\"];\nn37436171902517248[shape=rectangle, label=\"B141\"];\nn39406496739491840[shape=rectangle, label=\"B142\"];\nn39687971716202496[shape=rectangle, label=\"B143\"];\nn39969446692913152[shape=rectangle, label=\"B144\"];\nn36310271995674624[shape=rectangle, label=\"B145\"];\nn40532396646334464[shape=rectangle, label=\"B146\"];\nn40250921669623808[shape=rectangle, label=\"B147\"];\nn41376821576466432[shape=rectangle, label=\"B148\"];\nn41095346599755776[shape=rectangle, label=\"B149\"];\nn34902897112121344[shape=rectangle, label=\"B150\"];\nn38562071809359872[shape=rectangle, label=\"B151\"];\nn42221246506598400[shape=rectangle, label=\"B152\"];\nn41939771529887744[shape=rectangle, label=\"B153\"];\nn42502721483309056[shape=rectangle, label=\"B154\"];\nn42784196460019712[shape=rectangle, label=\"B155\"];\nn43347146413441024[shape=rectangle, label=\"B156\"];\nn43628621390151680[shape=rectangle, label=\"B157\"];\nn43910096366862336[shape=rectangle, label=\"B158\"];\nn44191571343572992[shape=rectangle, label=\"B159\"];\nn44473046320283648[shape=rectangle, label=\"B160\"];\nn45035996273704960[shape=rectangle, label=\"B161\"];\nn44754521296994304[shape=rectangle, label=\"B162\"];\nn43065671436730368[shape=rectangle, label=\"B163\"];\nn68679894317400064[shape=rectangle, label=\"B164\"];\nn45598946227126272[shape=rectangle, label=\"B165\"];\nn46161896180547584[shape=rectangle, label=\"B166\"];\nn45880421203836928[shape=rectangle, label=\"B167\"];\nn46724846133968896[shape=rectangle, label=\"B168\"];\nn47287796087390208[shape=rectangle, label=\"B169\"];\nn47006321110679552[shape=rectangle, label=\"B170\"];\nn47850746040811520[shape=rectangle, label=\"B171\"];\nn47569271064100864[shape=rectangle, label=\"B172\"];\nn48413695994232832[shape=rectangle, label=\"B173\"];\nn48976645947654144[shape=rectangle, label=\"B174\"];\nn49258120924364800[shape=rectangle, label=\"B175\"];\nn49821070877786112[shape=rectangle, label=\"B176\"];\nn49539595901075456[shape=rectangle, label=\"B177\"];\nn48132221017522176[shape=rectangle, label=\"B178\"];\nn50384020831207424[shape=rectangle, label=\"B179\"];\nn50665495807918080[shape=rectangle, label=\"B180\"];\nn50946970784628736[shape=rectangle, label=\"B181\"];\nn51228445761339392[shape=rectangle, label=\"B182\"];\nn51509920738050048[shape=rectangle, label=\"B183\"];\nn51791395714760704[shape=rectangle, label=\"B184\"];\nn52354345668182016[shape=rectangle, label=\"B185\"];\nn52635820644892672[shape=rectangle, label=\"B186\"];\nn52072870691471360[shape=rectangle, label=\"B187\"];\nn52917295621603328[shape=rectangle, label=\"B188\"];\nn53480245575024640[shape=rectangle, label=\"B189\"];\nn53761720551735296[shape=rectangle, label=\"B190\"];\nn53198770598313984[shape=rectangle, label=\"B191\"];\nn54043195528445952[shape=rectangle, label=\"B192\"];\nn54324670505156608[shape=rectangle, label=\"B193\"];\nn54606145481867264[shape=rectangle, label=\"B194\"];\nn55169095435288576[shape=rectangle, label=\"B195\"];\nn54887620458577920[shape=rectangle, label=\"B196\"];\nn55732045388709888[shape=rectangle, label=\"B197\"];\nn46443371157258240[shape=rectangle, label=\"B198\"];\nn56294995342131200[shape=rectangle, label=\"B199\"];\nn56013520365420544[shape=rectangle, label=\"B200\"];\nn56857945295552512[shape=rectangle, label=\"B201\"];\nn56576470318841856[shape=rectangle, label=\"B202\"];\nn57420895248973824[shape=rectangle, label=\"B203\"];\nn57139420272263168[shape=rectangle, label=\"B204\"];\nn57983845202395136[shape=rectangle, label=\"B205\"];\nn57702370225684480[shape=rectangle, label=\"B206\"];\nn58546795155816448[shape=rectangle, label=\"B207\"];\nn58828270132527104[shape=rectangle, label=\"B208\"];\nn59109745109237760[shape=rectangle, label=\"B209\"];\nn59391220085948416[shape=rectangle, label=\"B210\"];\nn59954170039369728[shape=rectangle, label=\"B211\"];\nn59672695062659072[shape=rectangle, label=\"B212\"];\nn60235645016080384[shape=rectangle, label=\"B213\"];\nn60798594969501696[shape=rectangle, label=\"B214\"];\nn58265320179105792[shape=rectangle, label=\"B215\"];\nn48695170970943488[shape=rectangle, label=\"B216\"];\nn50102545854496768[shape=rectangle, label=\"B217\"];\nn61643019899633664[shape=rectangle, label=\"B218\"];\nn61361544922923008[shape=rectangle, label=\"B219\"];\nn62205969853054976[shape=rectangle, label=\"B220\"];\nn62768919806476288[shape=rectangle, label=\"B221\"];\nn61924494876344320[shape=rectangle, label=\"B222\"];\nn63331869759897600[shape=rectangle, label=\"B223\"];\nn63050394783186944[shape=rectangle, label=\"B224\"];\nn63894819713318912[shape=rectangle, label=\"B225\"];\nn64457769666740224[shape=rectangle, label=\"B226\"];\nn64739244643450880[shape=rectangle, label=\"B227\"];\nn64176294690029568[shape=rectangle, label=\"B228\"];\nn65020719620161536[shape=rectangle, label=\"B229\"];\nn65583669573582848[shape=rectangle, label=\"B230\"];\nn66146619527004160[shape=rectangle, label=\"B231\"];\nn65302194596872192[shape=rectangle, label=\"B232\"];\nn66709569480425472[shape=rectangle, label=\"B233\"];\nn66428094503714816[shape=rectangle, label=\"B234\"];\nn67272519433846784[shape=rectangle, label=\"B235\"];\nn67553994410557440[shape=rectangle, label=\"B236\"];\nn63613344736608256[shape=rectangle, label=\"B237\"];\nn61080069946212352[shape=rectangle, label=\"B238\"];\nn68398419340689408[shape=rectangle, label=\"B239\"];\nn68116944363978752[shape=rectangle, label=\"B240\"];\nn60517119992791040[shape=rectangle, label=\"B241\"];\nn69242844270821376[shape=rectangle, label=\"B242\"];\nn69805794224242688[shape=rectangle, label=\"B243\"];\nn69524319247532032[shape=rectangle, label=\"B244\"];\nn68961369294110720[shape=rectangle, label=\"B245\"];\nn70087269200953344[shape=rectangle, label=\"B246\"];\nn62487444829765632[shape=rectangle, label=\"B247\"];\nn70650219154374656[shape=rectangle, label=\"B248\"];\nn65865144550293504[shape=rectangle, label=\"B249\"];\nn70931694131085312[shape=rectangle, label=\"B250\"];\nn74027918874902528[shape=rectangle, label=\"B251\"];\nn71494644084506624[shape=rectangle, label=\"B252\"];\nn72057594037927936[shape=rectangle, label=\"B253\"];\nn71776119061217280[shape=rectangle, label=\"B254\"];\nn72620543991349248[shape=rectangle, label=\"B255\"];\nn72902018968059904[shape=rectangle, label=\"B256\"];\nn72339069014638592[shape=rectangle, label=\"B257\"];\nn73746443898191872[shape=rectangle, label=\"B258\"];\nn73464968921481216[shape=rectangle, label=\"B259\"];\nn73183493944770560[shape=rectangle, label=\"B260\"];\nn74590868828323840[shape=rectangle, label=\"B261\"];\nn74309393851613184[shape=rectangle, label=\"B262\"];\nn75153818781745152[shape=rectangle, label=\"B263\"];\nn74872343805034496[shape=rectangle, label=\"B264\"];\nn77124143618719744[shape=rectangle, label=\"B265\"];\nn75435293758455808[shape=rectangle, label=\"B266\"];\nn75998243711877120[shape=rectangle, label=\"B267\"];\nn75716768735166464[shape=rectangle, label=\"B268\"];\nn76561193665298432[shape=rectangle, label=\"B269\"];\nn76842668642009088[shape=rectangle, label=\"B270\"];\nn45317471250415616[shape=rectangle, label=\"B271\"];\nn97953291895308288[shape=rectangle, label=\"B272\"];\nn55450570411999232[shape=rectangle, label=\"B273\"];\nn66991044457136128[shape=rectangle, label=\"B274\"];\nn77687093572141056[shape=rectangle, label=\"B275\"];\nn77405618595430400[shape=rectangle, label=\"B276\"];\nn78250043525562368[shape=rectangle, label=\"B277\"];\nn67835469387268096[shape=rectangle, label=\"B278\"];\nn77968568548851712[shape=rectangle, label=\"B279\"];\nn76279718688587776[shape=rectangle, label=\"B280\"];\nn78812993478983680[shape=rectangle, label=\"B281\"];\nn79375943432404992[shape=rectangle, label=\"B282\"];\nn79938893385826304[shape=rectangle, label=\"B283\"];\nn79657418409115648[shape=rectangle, label=\"B284\"];\nn80501843339247616[shape=rectangle, label=\"B285\"];\nn81064793292668928[shape=rectangle, label=\"B286\"];\nn80783318315958272[shape=rectangle, label=\"B287\"];\nn80220368362536960[shape=rectangle, label=\"B288\"];\nn81909218222800896[shape=rectangle, label=\"B289\"];\nn81627743246090240[shape=rectangle, label=\"B290\"];\nn95701492081623040[shape=rectangle, label=\"B291\"];\nn81346268269379584[shape=rectangle, label=\"B292\"];\nn85005442966618112[shape=rectangle, label=\"B293\"];\nn79094468455694336[shape=rectangle, label=\"B294\"];\nn82472168176222208[shape=rectangle, label=\"B295\"];\nn82190693199511552[shape=rectangle, label=\"B296\"];\nn83316593106354176[shape=rectangle, label=\"B297\"];\nn83598068083064832[shape=rectangle, label=\"B298\"];\nn82753643152932864[shape=rectangle, label=\"B299\"];\nn83035118129643520[shape=rectangle, label=\"B300\"];\nn84161018036486144[shape=rectangle, label=\"B301\"];\nn84442493013196800[shape=rectangle, label=\"B302\"];\nn84723967989907456[shape=rectangle, label=\"B303\"];\nn85286917943328768[shape=rectangle, label=\"B304\"];\nn85568392920039424[shape=rectangle, label=\"B305\"];\nn86131342873460736[shape=rectangle, label=\"B306\"];\nn86412817850171392[shape=rectangle, label=\"B307\"];\nn86694292826882048[shape=rectangle, label=\"B308\"];\nn87257242780303360[shape=rectangle, label=\"B309\"];\nn86975767803592704[shape=rectangle, label=\"B310\"];\nn85849867896750080[shape=rectangle, label=\"B311\"];\nn89509042593988608[shape=rectangle, label=\"B312\"];\nn87820192733724672[shape=rectangle, label=\"B313\"];\nn88101667710435328[shape=rectangle, label=\"B314\"];\nn88383142687145984[shape=rectangle, label=\"B315\"];\nn88946092640567296[shape=rectangle, label=\"B316\"];\nn88664617663856640[shape=rectangle, label=\"B317\"];\nn89227567617277952[shape=rectangle, label=\"B318\"];\nn89790517570699264[shape=rectangle, label=\"B319\"];\nn90071992547409920[shape=rectangle, label=\"B320\"];\nn87538717757014016[shape=rectangle, label=\"B321\"];\nn90353467524120576[shape=rectangle, label=\"B322\"];\nn90916417477541888[shape=rectangle, label=\"B323\"];\nn91479367430963200[shape=rectangle, label=\"B324\"];\nn91760842407673856[shape=rectangle, label=\"B325\"];\nn91197892454252544[shape=rectangle, label=\"B326\"];\nn92605267337805824[shape=rectangle, label=\"B327\"];\nn92323792361095168[shape=rectangle, label=\"B328\"];\nn90634942500831232[shape=rectangle, label=\"B329\"];\nn93168217291227136[shape=rectangle, label=\"B330\"];\nn92886742314516480[shape=rectangle, label=\"B331\"];\nn93449692267937792[shape=rectangle, label=\"B332\"];\nn94012642221359104[shape=rectangle, label=\"B333\"];\nn94294117198069760[shape=rectangle, label=\"B334\"];\nn94575592174780416[shape=rectangle, label=\"B335\"];\nn95138542128201728[shape=rectangle, label=\"B336\"];\nn95420017104912384[shape=rectangle, label=\"B337\"];\nn94857067151491072[shape=rectangle, label=\"B338\"];\nn95982967058333696[shape=rectangle, label=\"B339\"];\nn93731167244648448[shape=rectangle, label=\"B340\"];\nn96545917011755008[shape=rectangle, label=\"B341\"];\nn96264442035044352[shape=rectangle, label=\"B342\"];\nn96827391988465664[shape=rectangle, label=\"B343\"];\nn97108866965176320[shape=rectangle, label=\"B344\"];\nn97390341941886976[shape=rectangle, label=\"B345\"];\nn97671816918597632[shape=rectangle, label=\"B346\"];\nn98234766872018944[shape=rectangle, label=\"B347\"];\nn98797716825440256[shape=rectangle, label=\"B348\"];\nn99079191802150912[shape=rectangle, label=\"B349\"];\nn98516241848729600[shape=rectangle, label=\"B350\"];\nn99642141755572224[shape=rectangle, label=\"B351\"];\nn105553116266496000[shape=rectangle, label=\"B352\"];\nn100205091708993536[shape=rectangle, label=\"B353\"];\nn99923616732282880[shape=rectangle, label=\"B354\"];\nn100768041662414848[shape=rectangle, label=\"B355\"];\nn101330991615836160[shape=rectangle, label=\"B356\"];\nn101049516639125504[shape=rectangle, label=\"B357\"];\nn101612466592546816[shape=rectangle, label=\"B358\"];\nn102175416545968128[shape=rectangle, label=\"B359\"];\nn101893941569257472[shape=rectangle, label=\"B360\"];\nn102738366499389440[shape=rectangle, label=\"B361\"];\nn103301316452810752[shape=rectangle, label=\"B362\"];\nn103019841476100096[shape=rectangle, label=\"B363\"];\nn103864266406232064[shape=rectangle, label=\"B364\"];\nn103582791429521408[shape=rectangle, label=\"B365\"];\nn104145741382942720[shape=rectangle, label=\"B366\"];\nn102456891522678784[shape=rectangle, label=\"B367\"];\nn104708691336364032[shape=rectangle, label=\"B368\"];\nn104427216359653376[shape=rectangle, label=\"B369\"];\nn100486566685704192[shape=rectangle, label=\"B370\"];\nn105271641289785344[shape=rectangle, label=\"B371\"];\nn104990166313074688[shape=rectangle, label=\"B372\"];\nn71213169107795968[shape=rectangle, label=\"B373\"];\nn105834591243206656[shape=rectangle, label=\"B374\"];\nn106116066219917312[shape=rectangle, label=\"B375\"];\nn106397541196627968[shape=rectangle, label=\"B376\"];\nn106960491150049280[shape=rectangle, label=\"B377\"];\nn106679016173338624[shape=rectangle, label=\"B378\"];\nn107241966126759936[shape=rectangle, label=\"B379\"];\nn107523441103470592[shape=rectangle, label=\"B380\"];\nn108086391056891904[shape=rectangle, label=\"B381\"];\nn107804916080181248[shape=rectangle, label=\"B382\"];\nn108367866033602560[shape=rectangle, label=\"B383\"];\nn108930815987023872[shape=rectangle, label=\"B384\"];\nn109212290963734528[shape=rectangle, label=\"B385\"];\nn109775240917155840[shape=rectangle, label=\"B386\"];\nn109493765940445184[shape=rectangle, label=\"B387\"];\nn110338190870577152[shape=rectangle, label=\"B388\"];\nn110901140823998464[shape=rectangle, label=\"B389\"];\nn111182615800709120[shape=rectangle, label=\"B390\"];\nn111464090777419776[shape=rectangle, label=\"B391\"];\nn111745565754130432[shape=rectangle, label=\"B392\"];\nn112027040730841088[shape=rectangle, label=\"B393\"];\nn112308515707551744[shape=rectangle, label=\"B394\"];\nn112589990684262400[shape=rectangle, label=\"B395\"];\nn110056715893866496[shape=rectangle, label=\"B396\"];\nn110619665847287808[shape=rectangle, label=\"B397\"];\nn108649341010313216[shape=rectangle, label=\"B398\"];\nn112871465660973056[shape=rectangle, label=\"B399\"];\nn113434415614394368[shape=rectangle, label=\"B400\"];\nn113997365567815680[shape=rectangle, label=\"B401\"];\nn113715890591105024[shape=rectangle, label=\"B402\"];\nn114560315521236992[shape=rectangle, label=\"B403\"];\nn114278840544526336[shape=rectangle, label=\"B404\"];\nn114841790497947648[shape=rectangle, label=\"B405\"];\nn115123265474658304[shape=rectangle, label=\"B406\"];\nn115404740451368960[shape=rectangle, label=\"B407\"];\nn115686215428079616[shape=rectangle, label=\"B408\"];\nn116812115334922240[shape=rectangle, label=\"B409\"];\nn116249165381500928[shape=rectangle, label=\"B410\"];\nn115967690404790272[shape=rectangle, label=\"B411\"];\nn113152940637683712[shape=rectangle, label=\"B412\"];\nn120752765008871424[shape=rectangle, label=\"B413\"];\nn117375065288343552[shape=rectangle, label=\"B414\"];\nn117093590311632896[shape=rectangle, label=\"B415\"];\nn117938015241764864[shape=rectangle, label=\"B416\"];\nn118219490218475520[shape=rectangle, label=\"B417\"];\nn118500965195186176[shape=rectangle, label=\"B418\"];\nn119063915148607488[shape=rectangle, label=\"B419\"];\nn116530640358211584[shape=rectangle, label=\"B420\"];\nn119908340078739456[shape=rectangle, label=\"B421\"];\nn119626865102028800[shape=rectangle, label=\"B422\"];\nn120471290032160768[shape=rectangle, label=\"B423\"];\nn120189815055450112[shape=rectangle, label=\"B424\"];\nn118782440171896832[shape=rectangle, label=\"B425\"];\nn121315714962292736[shape=rectangle, label=\"B426\"];\nn121878664915714048[shape=rectangle, label=\"B427\"];\nn122160139892424704[shape=rectangle, label=\"B428\"];\nn122441614869135360[shape=rectangle, label=\"B429\"];\nn122723089845846016[shape=rectangle, label=\"B430\"];\nn123004564822556672[shape=rectangle, label=\"B431\"];\nn123286039799267328[shape=rectangle, label=\"B432\"];\nn123567514775977984[shape=rectangle, label=\"B433\"];\nn121034239985582080[shape=rectangle, label=\"B434\"];\nn121597189939003392[shape=rectangle, label=\"B435\"];\nn119345390125318144[shape=rectangle, label=\"B436\"];\nn124130464729399296[shape=rectangle, label=\"B437\"];\nn123848989752688640[shape=rectangle, label=\"B438\"];\nn124411939706109952[shape=rectangle, label=\"B439\"];\nn124974889659531264[shape=rectangle, label=\"B440\"];\nn125256364636241920[shape=rectangle, label=\"B441\"];\nn124693414682820608[shape=rectangle, label=\"B442\"];\nn126100789566373888[shape=rectangle, label=\"B443\"];\nn126382264543084544[shape=rectangle, label=\"B444\"];\nn125819314589663232[shape=rectangle, label=\"B445\"];\nn126663739519795200[shape=rectangle, label=\"B446\"];\nn126945214496505856[shape=rectangle, label=\"B447\"];\nn125537839612952576[shape=rectangle, label=\"B448\"];\nn127508164449927168[shape=rectangle, label=\"B449\"];\nn127789639426637824[shape=rectangle, label=\"B450\"];\nn127226689473216512[shape=rectangle, label=\"B451\"];\nn128352589380059136[shape=rectangle, label=\"B452\"];\nn128634064356769792[shape=rectangle, label=\"B453\"];\nn128071114403348480[shape=rectangle, label=\"B454\"];\nn129197014310191104[shape=rectangle, label=\"B455\"];\nn128915539333480448[shape=rectangle, label=\"B456\"];\nn129759964263612416[shape=rectangle, label=\"B457\"];\nn130322914217033728[shape=rectangle, label=\"B458\"];\nn130041439240323072[shape=rectangle, label=\"B459\"];\nn130604389193744384[shape=rectangle, label=\"B460\"];\nn130885864170455040[shape=rectangle, label=\"B461\"];\nn131448814123876352[shape=rectangle, label=\"B462\"];\nn131167339147165696[shape=rectangle, label=\"B463\"];\nn132011764077297664[shape=rectangle, label=\"B464\"];\nn131730289100587008[shape=rectangle, label=\"B465\"];\nn132293239054008320[shape=rectangle, label=\"B466\"];\nn132574714030718976[shape=rectangle, label=\"B467\"];\nn132856189007429632[shape=rectangle, label=\"B468\"];\nn133137663984140288[shape=rectangle, label=\"B469\"];\nn129478489286901760[shape=rectangle, label=\"B470\"];\nn133700613937561600[shape=rectangle, label=\"B471\"];\nn133419138960850944[shape=rectangle, label=\"B472\"];\nn134263563890982912[shape=rectangle, label=\"B473\"];\nn134545038867693568[shape=rectangle, label=\"B474\"];\nn133982088914272256[shape=rectangle, label=\"B475\"];\nn134826513844404224[shape=rectangle, label=\"B476\"];\nn135107988821114880[shape=rectangle, label=\"B477\"];\nn135952413751246848[shape=rectangle, label=\"B478\"];\nn135670938774536192[shape=rectangle, label=\"B479\"];\nn135389463797825536[shape=rectangle, label=\"B480\"];\nn117656540265054208[shape=rectangle, label=\"B481\"];\nn136233888727957504[shape=rectangle, label=\"B482\"];\nn136515363704668160[shape=rectangle, label=\"B483\"];\nn136796838681378816[shape=rectangle, label=\"B484\"];\nn137078313658089472[shape=rectangle, label=\"B485\"];\nn137641263611510784[shape=rectangle, label=\"B486\"];\nn137922738588221440[shape=rectangle, label=\"B487\"];\nn137359788634800128[shape=rectangle, label=\"B488\"];\nn138485688541642752[shape=rectangle, label=\"B489\"];\nn138767163518353408[shape=rectangle, label=\"B490\"];\nn138204213564932096[shape=rectangle, label=\"B491\"];\nn139048638495064064[shape=rectangle, label=\"B492\"];\nn139330113471774720[shape=rectangle, label=\"B493\"];\nn139611588448485376[shape=rectangle, label=\"B494\"];\nn140174538401906688[shape=rectangle, label=\"B495\"];\nn140456013378617344[shape=rectangle, label=\"B496\"];\nn139893063425196032[shape=rectangle, label=\"B497\"];\nn141018963332038656[shape=rectangle, label=\"B498\"];\nn141581913285459968[shape=rectangle, label=\"B499\"];\nn141863388262170624[shape=rectangle, label=\"B500\"];\nn142144863238881280[shape=rectangle, label=\"B501\"];\nn142707813192302592[shape=rectangle, label=\"B502\"];\nn142426338215591936[shape=rectangle, label=\"B503\"];\nn142989288169013248[shape=rectangle, label=\"B504\"];\nn143552238122434560[shape=rectangle, label=\"B505\"];\nn143833713099145216[shape=rectangle, label=\"B506\"];\nn143270763145723904[shape=rectangle, label=\"B507\"];\nn144115188075855872[shape=rectangle, label=\"B508\"];\nn144678138029277184[shape=rectangle, label=\"B509\"];\nn144959613005987840[shape=rectangle, label=\"B510\"];\nn144396663052566528[shape=rectangle, label=\"B511\"];\nn145522562959409152[shape=rectangle, label=\"B512\"];\nn145804037936119808[shape=rectangle, label=\"B513\"];\nn146085512912830464[shape=rectangle, label=\"B514\"];\nn145241087982698496[shape=rectangle, label=\"B515\"];\nn146366987889541120[shape=rectangle, label=\"B516\"];\nn146648462866251776[shape=rectangle, label=\"B517\"];\nn146929937842962432[shape=rectangle, label=\"B518\"];\nn147211412819673088[shape=rectangle, label=\"B519\"];\nn147492887796383744[shape=rectangle, label=\"B520\"];\nn147774362773094400[shape=rectangle, label=\"B521\"];\nn148337312726515712[shape=rectangle, label=\"B522\"];\nn148618787703226368[shape=rectangle, label=\"B523\"];\nn148055837749805056[shape=rectangle, label=\"B524\"];\nn141300438308749312[shape=rectangle, label=\"B525\"];\nn158751886864809984[shape=rectangle, label=\"B526\"];\nn149181737656647680[shape=rectangle, label=\"B527\"];\nn148900262679937024[shape=rectangle, label=\"B528\"];\nn149744687610068992[shape=rectangle, label=\"B529\"];\nn150307637563490304[shape=rectangle, label=\"B530\"];\nn150870587516911616[shape=rectangle, label=\"B531\"];\nn150589112540200960[shape=rectangle, label=\"B532\"];\nn150026162586779648[shape=rectangle, label=\"B533\"];\nn151433537470332928[shape=rectangle, label=\"B534\"];\nn151996487423754240[shape=rectangle, label=\"B535\"];\nn151715012447043584[shape=rectangle, label=\"B536\"];\nn152277962400464896[shape=rectangle, label=\"B537\"];\nn151152062493622272[shape=rectangle, label=\"B538\"];\nn152840912353886208[shape=rectangle, label=\"B539\"];\nn153403862307307520[shape=rectangle, label=\"B540\"];\nn153122387330596864[shape=rectangle, label=\"B541\"];\nn153685337284018176[shape=rectangle, label=\"B542\"];\nn154248287237439488[shape=rectangle, label=\"B543\"];\nn153966812260728832[shape=rectangle, label=\"B544\"];\nn154529762214150144[shape=rectangle, label=\"B545\"];\nn154811237190860800[shape=rectangle, label=\"B546\"];\nn152559437377175552[shape=rectangle, label=\"B547\"];\nn155374187144282112[shape=rectangle, label=\"B548\"];\nn155937137097703424[shape=rectangle, label=\"B549\"];\nn155655662120992768[shape=rectangle, label=\"B550\"];\nn156218612074414080[shape=rectangle, label=\"B551\"];\nn156500087051124736[shape=rectangle, label=\"B552\"];\nn155092712167571456[shape=rectangle, label=\"B553\"];\nn157063037004546048[shape=rectangle, label=\"B554\"];\nn156781562027835392[shape=rectangle, label=\"B555\"];\nn157625986957967360[shape=rectangle, label=\"B556\"];\nn157907461934678016[shape=rectangle, label=\"B557\"];\nn158188936911388672[shape=rectangle, label=\"B558\"];\nn158470411888099328[shape=rectangle, label=\"B559\"];\nn157344511981256704[shape=rectangle, label=\"B560\"];\nn149463212633358336[shape=rectangle, label=\"B561\"];\nn159033361841520640[shape=rectangle, label=\"B562\"];\nn140737488355328000[shape=rectangle, label=\"B563\"];\nn92042317384384512[shape=rectangle, label=\"B564\"];\nn844424930131968[shape=rectangle, label=\"B565\"];\nn25332747903959040[shape=rectangle, label=\"B566\"];\nn159314836818231296[shape=rectangle, label=\"B567\"];\nn159596311794941952[shape=rectangle, label=\"B568\"];\nn159877786771652608[shape=rectangle, label=\"B1\"];\nn0 -> n70368744177664000;\nn70368744177664000 -> n29273397577908224;\nn29273397577908224 -> n281474976710656;\nn29273397577908224 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn1125899906842624 -> n1688849860263936;\nn1688849860263936 -> n1407374883553280;\nn1407374883553280 -> n1970324836974592;\nn1407374883553280 -> n2251799813685248;\nn2251799813685248 -> n26458647810801664;\nn26458647810801664 -> n2533274790395904;\nn26458647810801664 -> n2814749767106560;\nn2814749767106560 -> n2533274790395904;\nn2533274790395904 -> n3096224743817216;\nn2533274790395904 -> n3377699720527872;\nn3377699720527872 -> n3096224743817216;\nn3096224743817216 -> n3659174697238528;\nn3096224743817216 -> n3940649673949184;\nn3940649673949184 -> n4222124650659840;\nn3940649673949184 -> n4503599627370496;\nn4503599627370496 -> n4222124650659840;\nn4222124650659840 -> n4785074604081152;\nn4222124650659840 -> n5066549580791808;\nn5066549580791808 -> n4785074604081152;\nn4785074604081152 -> n5348024557502464;\nn4785074604081152 -> n5629499534213120;\nn5629499534213120 -> n5910974510923776;\nn5348024557502464 -> n6192449487634432;\nn5348024557502464 -> n6473924464345088;\nn6473924464345088 -> n6755399441055744;\nn6473924464345088 -> n7036874417766400;\nn7036874417766400 -> n7318349394477056;\nn7036874417766400 -> n6755399441055744;\nn6755399441055744 -> n7318349394477056;\nn6192449487634432 -> n7599824371187712;\nn6192449487634432 -> n5910974510923776;\nn5910974510923776 -> n7318349394477056;\nn7599824371187712 -> n7318349394477056;\nn7318349394477056 -> n7881299347898368;\nn7318349394477056 -> n8162774324609024;\nn8162774324609024 -> n7881299347898368;\nn7881299347898368 -> n3659174697238528;\nn3659174697238528 -> n8444249301319680;\nn3659174697238528 -> n8725724278030336;\nn8725724278030336 -> n8444249301319680;\nn8444249301319680 -> n9007199254740992;\nn8444249301319680 -> n9288674231451648;\nn9288674231451648 -> n9570149208162304;\nn9288674231451648 -> n9007199254740992;\nn9007199254740992 -> n9851624184872960;\nn9007199254740992 -> n10133099161583616;\nn10133099161583616 -> n9851624184872960;\nn9851624184872960 -> n10414574138294272;\nn9851624184872960 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n10977524091715584;\nn10977524091715584 -> n11540474045136896;\nn10977524091715584 -> n11821949021847552;\nn11821949021847552 -> n12103423998558208;\nn11821949021847552 -> n12384898975268864;\nn12384898975268864 -> n12103423998558208;\nn12103423998558208 -> n10414574138294272;\nn12103423998558208 -> n11540474045136896;\nn11540474045136896 -> n12666373951979520;\nn11540474045136896 -> n12947848928690176;\nn12947848928690176 -> n12666373951979520;\nn12666373951979520 -> n13229323905400832;\nn12666373951979520 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n14355223812243456;\nn14355223812243456 -> n13229323905400832;\nn14355223812243456 -> n13792273858822144;\nn13792273858822144 -> n14918173765664768;\nn13792273858822144 -> n15199648742375424;\nn15199648742375424 -> n13229323905400832;\nn15199648742375424 -> n14918173765664768;\nn14918173765664768 -> n15481123719086080;\nn14918173765664768 -> n15762598695796736;\nn15762598695796736 -> n15481123719086080;\nn15762598695796736 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn13229323905400832 -> n15481123719086080;\nn13229323905400832 -> n16607023625928704;\nn16607023625928704 -> n15481123719086080;\nn16607023625928704 -> n16888498602639360;\nn16888498602639360 -> n16325548649218048;\nn15481123719086080 -> n17169973579350016;\nn15481123719086080 -> n16325548649218048;\nn16325548649218048 -> n17169973579350016;\nn17169973579350016 -> n17451448556060672;\nn17169973579350016 -> n17732923532771328;\nn17732923532771328 -> n17451448556060672;\nn17451448556060672 -> n18014398509481984;\nn17451448556060672 -> n18295873486192640;\nn18295873486192640 -> n18577348462903296;\nn18295873486192640 -> n18858823439613952;\nn18858823439613952 -> n19140298416324608;\nn18858823439613952 -> n19421773393035264;\nn19421773393035264 -> n19703248369745920;\nn19421773393035264 -> n19984723346456576;\nn19984723346456576 -> n19703248369745920;\nn19703248369745920 -> n20266198323167232;\nn18577348462903296 -> n18014398509481984;\nn18577348462903296 -> n20547673299877888;\nn20547673299877888 -> n19140298416324608;\nn19140298416324608 -> n20266198323167232;\nn20266198323167232 -> n20829148276588544;\nn20266198323167232 -> n21110623253299200;\nn21110623253299200 -> n21392098230009856;\nn21110623253299200 -> n21673573206720512;\nn21673573206720512 -> n21392098230009856;\nn21673573206720512 -> n21955048183431168;\nn21955048183431168 -> n22236523160141824;\nn18014398509481984 -> n19140298416324608;\nn18014398509481984 -> n22517998136852480;\nn22517998136852480 -> n20266198323167232;\nn20829148276588544 -> n21392098230009856;\nn20829148276588544 -> n22799473113563136;\nn22799473113563136 -> n21392098230009856;\nn22799473113563136 -> n23080948090273792;\nn23080948090273792 -> n22236523160141824;\nn21392098230009856 -> n23362423066984448;\nn21392098230009856 -> n22236523160141824;\nn22236523160141824 -> n23362423066984448;\nn23362423066984448 -> n23643898043695104;\nn23362423066984448 -> n23925373020405760;\nn23925373020405760 -> n24206847997116416;\nn23643898043695104 -> n24206847997116416;\nn23643898043695104 -> n24488322973827072;\nn24488322973827072 -> n24769797950537728;\nn24488322973827072 -> n25051272927248384;\nn25051272927248384 -> n24769797950537728;\nn24769797950537728 -> n83879543059775488;\nn83879543059775488 -> n78531518502273024;\nn78531518502273024 -> n99360666778861568;\nn99360666778861568 -> n25332747903959040;\nn10414574138294272 -> n24206847997116416;\nn10414574138294272 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n26177172834091008;\nn26177172834091008 -> n25895697857380352;\nn25895697857380352 -> n24206847997116416;\nn24206847997116416 -> n26458647810801664;\nn24206847997116416 -> n9570149208162304;\nn9570149208162304 -> n1970324836974592;\nn1970324836974592 -> n26740122787512320;\nn1970324836974592 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn26740122787512320 -> n27303072740933632;\nn26740122787512320 -> n27584547717644288;\nn27584547717644288 -> n27303072740933632;\nn27303072740933632 -> n27866022694354944;\nn27303072740933632 -> n28147497671065600;\nn28147497671065600 -> n28428972647776256;\nn28147497671065600 -> n28710447624486912;\nn28710447624486912 -> n28428972647776256;\nn28428972647776256 -> n27866022694354944;\nn28428972647776256 -> n28991922601197568;\nn28991922601197568 -> n29273397577908224;\nn27866022694354944 -> n29554872554618880;\nn27866022694354944 -> n29836347531329536;\nn29836347531329536 -> n29554872554618880;\nn29554872554618880 -> n30117822508040192;\nn29554872554618880 -> n30399297484750848;\nn30399297484750848 -> n30117822508040192;\nn30117822508040192 -> n30680772461461504;\nn30117822508040192 -> n30962247438172160;\nn30962247438172160 -> n30680772461461504;\nn30680772461461504 -> n31243722414882816;\nn30680772461461504 -> n31525197391593472;\nn31525197391593472 -> n31243722414882816;\nn31243722414882816 -> n31806672368304128;\nn31243722414882816 -> n32088147345014784;\nn32088147345014784 -> n31806672368304128;\nn31806672368304128 -> n32369622321725440;\nn31806672368304128 -> n32651097298436096;\nn32651097298436096 -> n32369622321725440;\nn32369622321725440 -> n844424930131968;\nn32369622321725440 -> n32932572275146752;\nn33214047251857408 -> n41658296553177088;\nn41658296553177088 -> n844424930131968;\nn41658296553177088 -> n33495522228568064;\nn33495522228568064 -> n33776997205278720;\nn33495522228568064 -> n34058472181989376;\nn34058472181989376 -> n33776997205278720;\nn33776997205278720 -> n34339947158700032;\nn33776997205278720 -> n34621422135410688;\nn34621422135410688 -> n34339947158700032;\nn34339947158700032 -> n34902897112121344;\nn34339947158700032 -> n35184372088832000;\nn35184372088832000 -> n34902897112121344;\nn35184372088832000 -> n35465847065542656;\nn35465847065542656 -> n40813871623045120;\nn40813871623045120 -> n35747322042253312;\nn40813871623045120 -> n36028797018963968;\nn36028797018963968 -> n35747322042253312;\nn35747322042253312 -> n36310271995674624;\nn35747322042253312 -> n36591746972385280;\nn36591746972385280 -> n36873221949095936;\nn36591746972385280 -> n37154696925806592;\nn37154696925806592 -> n36873221949095936;\nn36873221949095936 -> n37436171902517248;\nn36873221949095936 -> n37717646879227904;\nn37717646879227904 -> n37436171902517248;\nn37717646879227904 -> n37999121855938560;\nn37999121855938560 -> n37436171902517248;\nn37999121855938560 -> n38280596832649216;\nn38280596832649216 -> n38562071809359872;\nn38280596832649216 -> n38843546786070528;\nn38843546786070528 -> n38562071809359872;\nn38843546786070528 -> n39125021762781184;\nn39125021762781184 -> n39406496739491840;\nn37436171902517248 -> n39406496739491840;\nn39406496739491840 -> n36310271995674624;\nn39406496739491840 -> n39687971716202496;\nn39687971716202496 -> n36310271995674624;\nn39687971716202496 -> n39969446692913152;\nn39969446692913152 -> n40250921669623808;\nn39969446692913152 -> n36310271995674624;\nn36310271995674624 -> n34902897112121344;\nn36310271995674624 -> n40532396646334464;\nn40532396646334464 -> n40813871623045120;\nn40250921669623808 -> n41095346599755776;\nn40250921669623808 -> n41376821576466432;\nn41376821576466432 -> n41095346599755776;\nn41095346599755776 -> n34902897112121344;\nn34902897112121344 -> n41658296553177088;\nn38562071809359872 -> n41939771529887744;\nn38562071809359872 -> n42221246506598400;\nn42221246506598400 -> n42502721483309056;\nn41939771529887744 -> n42502721483309056;\nn42502721483309056 -> n29273397577908224;\nn42784196460019712 -> n43065671436730368;\nn42784196460019712 -> n43347146413441024;\nn43347146413441024 -> n43065671436730368;\nn43347146413441024 -> n43628621390151680;\nn43628621390151680 -> n43065671436730368;\nn43628621390151680 -> n43910096366862336;\nn43910096366862336 -> n43065671436730368;\nn43910096366862336 -> n44191571343572992;\nn44191571343572992 -> n43065671436730368;\nn44191571343572992 -> n44473046320283648;\nn44473046320283648 -> n44754521296994304;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn45035996273704960 -> n44754521296994304;\nn44754521296994304 -> n45317471250415616;\nn44754521296994304 -> n43065671436730368;\nn43065671436730368 -> n68679894317400064;\nn68679894317400064 -> n844424930131968;\nn68679894317400064 -> n45598946227126272;\nn45598946227126272 -> n45880421203836928;\nn45598946227126272 -> n46161896180547584;\nn46161896180547584 -> n45880421203836928;\nn45880421203836928 -> n46443371157258240;\nn45880421203836928 -> n46724846133968896;\nn46724846133968896 -> n47006321110679552;\nn46724846133968896 -> n47287796087390208;\nn47287796087390208 -> n47006321110679552;\nn47006321110679552 -> n47569271064100864;\nn47006321110679552 -> n47850746040811520;\nn47850746040811520 -> n48132221017522176;\nn47850746040811520 -> n47569271064100864;\nn47569271064100864 -> n48132221017522176;\nn47569271064100864 -> n48413695994232832;\nn48413695994232832 -> n48695170970943488;\nn48413695994232832 -> n48976645947654144;\nn48976645947654144 -> n48695170970943488;\nn48976645947654144 -> n49258120924364800;\nn49258120924364800 -> n49539595901075456;\nn49258120924364800 -> n49821070877786112;\nn49821070877786112 -> n49539595901075456;\nn49539595901075456 -> n25332747903959040;\nn48132221017522176 -> n50102545854496768;\nn48132221017522176 -> n50384020831207424;\nn50384020831207424 -> n50102545854496768;\nn50384020831207424 -> n50665495807918080;\nn50665495807918080 -> n50102545854496768;\nn50665495807918080 -> n50946970784628736;\nn50946970784628736 -> n50102545854496768;\nn50946970784628736 -> n51228445761339392;\nn51228445761339392 -> n50102545854496768;\nn51228445761339392 -> n51509920738050048;\nn51509920738050048 -> n50102545854496768;\nn51509920738050048 -> n51791395714760704;\nn51791395714760704 -> n52072870691471360;\nn51791395714760704 -> n52354345668182016;\nn52354345668182016 -> n52072870691471360;\nn52354345668182016 -> n52635820644892672;\nn52635820644892672 -> n52917295621603328;\nn52635820644892672 -> n52072870691471360;\nn52072870691471360 -> n50102545854496768;\nn52072870691471360 -> n52917295621603328;\nn52917295621603328 -> n53198770598313984;\nn52917295621603328 -> n53480245575024640;\nn53480245575024640 -> n53198770598313984;\nn53480245575024640 -> n53761720551735296;\nn53761720551735296 -> n54043195528445952;\nn53198770598313984 -> n54043195528445952;\nn54043195528445952 -> n50102545854496768;\nn54043195528445952 -> n54324670505156608;\nn54324670505156608 -> n844424930131968;\nn54324670505156608 -> n54606145481867264;\nn54606145481867264 -> n54887620458577920;\nn54606145481867264 -> n55169095435288576;\nn55169095435288576 -> n54887620458577920;\nn54887620458577920 -> n55450570411999232;\nn54887620458577920 -> n55732045388709888;\nn55732045388709888 -> n25332747903959040;\nn46443371157258240 -> n56013520365420544;\nn46443371157258240 -> n56294995342131200;\nn56294995342131200 -> n56013520365420544;\nn56013520365420544 -> n56576470318841856;\nn56013520365420544 -> n56857945295552512;\nn56857945295552512 -> n56576470318841856;\nn56576470318841856 -> n57139420272263168;\nn56576470318841856 -> n57420895248973824;\nn57420895248973824 -> n57139420272263168;\nn57139420272263168 -> n57702370225684480;\nn57139420272263168 -> n57983845202395136;\nn57983845202395136 -> n57702370225684480;\nn57702370225684480 -> n58265320179105792;\nn57702370225684480 -> n58546795155816448;\nn58546795155816448 -> n58265320179105792;\nn58546795155816448 -> n58828270132527104;\nn58828270132527104 -> n58265320179105792;\nn58828270132527104 -> n59109745109237760;\nn59109745109237760 -> n58265320179105792;\nn59109745109237760 -> n59391220085948416;\nn59391220085948416 -> n59672695062659072;\nn59391220085948416 -> n59954170039369728;\nn59954170039369728 -> n59672695062659072;\nn59672695062659072 -> n844424930131968;\nn59672695062659072 -> n60235645016080384;\nn60235645016080384 -> n60517119992791040;\nn60235645016080384 -> n60798594969501696;\nn60798594969501696 -> n60517119992791040;\nn60798594969501696 -> n58265320179105792;\nn58265320179105792 -> n61080069946212352;\nn58265320179105792 -> n48695170970943488;\nn48695170970943488 -> n50102545854496768;\nn50102545854496768 -> n61361544922923008;\nn50102545854496768 -> n61643019899633664;\nn61643019899633664 -> n61361544922923008;\nn61361544922923008 -> n61924494876344320;\nn61361544922923008 -> n62205969853054976;\nn62205969853054976 -> n62487444829765632;\nn62205969853054976 -> n62768919806476288;\nn62768919806476288 -> n62487444829765632;\nn62768919806476288 -> n61924494876344320;\nn61924494876344320 -> n63050394783186944;\nn61924494876344320 -> n63331869759897600;\nn63331869759897600 -> n63050394783186944;\nn63050394783186944 -> n63613344736608256;\nn63050394783186944 -> n63894819713318912;\nn63894819713318912 -> n64176294690029568;\nn63894819713318912 -> n64457769666740224;\nn64457769666740224 -> n64176294690029568;\nn64457769666740224 -> n64739244643450880;\nn64739244643450880 -> n65020719620161536;\nn64176294690029568 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn65020719620161536 -> n65583669573582848;\nn65583669573582848 -> n65865144550293504;\nn65583669573582848 -> n66146619527004160;\nn66146619527004160 -> n65865144550293504;\nn66146619527004160 -> n65302194596872192;\nn65302194596872192 -> n66428094503714816;\nn65302194596872192 -> n66709569480425472;\nn66709569480425472 -> n66991044457136128;\nn66709569480425472 -> n66428094503714816;\nn66428094503714816 -> n63613344736608256;\nn66428094503714816 -> n67272519433846784;\nn67272519433846784 -> n63613344736608256;\nn67272519433846784 -> n67553994410557440;\nn67553994410557440 -> n67835469387268096;\nn67553994410557440 -> n63613344736608256;\nn63613344736608256 -> n61080069946212352;\nn61080069946212352 -> n68116944363978752;\nn61080069946212352 -> n68398419340689408;\nn68398419340689408 -> n68116944363978752;\nn68116944363978752 -> n68679894317400064;\nn60517119992791040 -> n68961369294110720;\nn60517119992791040 -> n69242844270821376;\nn69242844270821376 -> n69524319247532032;\nn69242844270821376 -> n69805794224242688;\nn69805794224242688 -> n70087269200953344;\nn69524319247532032 -> n70087269200953344;\nn68961369294110720 -> n70087269200953344;\nn70087269200953344 -> n70368744177664000;\nn62487444829765632 -> n70650219154374656;\nn70650219154374656 -> n70368744177664000;\nn65865144550293504 -> n70650219154374656;\nn70931694131085312 -> n74027918874902528;\nn74027918874902528 -> n71213169107795968;\nn74027918874902528 -> n71494644084506624;\nn71494644084506624 -> n71776119061217280;\nn71494644084506624 -> n72057594037927936;\nn72057594037927936 -> n71776119061217280;\nn71776119061217280 -> n72339069014638592;\nn71776119061217280 -> n72620543991349248;\nn72620543991349248 -> n72339069014638592;\nn72620543991349248 -> n72902018968059904;\nn72902018968059904 -> n73183493944770560;\nn72902018968059904 -> n72339069014638592;\nn72339069014638592 -> n73464968921481216;\nn72339069014638592 -> n73746443898191872;\nn73746443898191872 -> n73464968921481216;\nn73464968921481216 -> n74027918874902528;\nn73183493944770560 -> n74309393851613184;\nn73183493944770560 -> n74590868828323840;\nn74590868828323840 -> n74309393851613184;\nn74309393851613184 -> n74872343805034496;\nn74309393851613184 -> n75153818781745152;\nn75153818781745152 -> n74872343805034496;\nn74872343805034496 -> n77124143618719744;\nn77124143618719744 -> n29273397577908224;\nn75435293758455808 -> n75716768735166464;\nn75435293758455808 -> n75998243711877120;\nn75998243711877120 -> n75716768735166464;\nn75716768735166464 -> n76279718688587776;\nn75716768735166464 -> n76561193665298432;\nn76561193665298432 -> n844424930131968;\nn76561193665298432 -> n76842668642009088;\nn76842668642009088 -> n77124143618719744;\nn45317471250415616 -> n97953291895308288;\nn97953291895308288 -> n844424930131968;\nn55450570411999232 -> n25332747903959040;\nn66991044457136128 -> n77405618595430400;\nn66991044457136128 -> n77687093572141056;\nn77687093572141056 -> n77405618595430400;\nn77405618595430400 -> n77968568548851712;\nn77405618595430400 -> n78250043525562368;\nn78250043525562368 -> n67835469387268096;\nn67835469387268096 -> n844424930131968;\nn77968568548851712 -> n844424930131968;\nn76279718688587776 -> n78531518502273024;\nn78812993478983680 -> n79094468455694336;\nn78812993478983680 -> n79375943432404992;\nn79375943432404992 -> n79657418409115648;\nn79375943432404992 -> n79938893385826304;\nn79938893385826304 -> n79094468455694336;\nn79938893385826304 -> n79657418409115648;\nn79657418409115648 -> n80220368362536960;\nn79657418409115648 -> n80501843339247616;\nn80501843339247616 -> n80783318315958272;\nn80501843339247616 -> n81064793292668928;\nn81064793292668928 -> n81346268269379584;\nn80783318315958272 -> n81346268269379584;\nn80220368362536960 -> n81627743246090240;\nn80220368362536960 -> n81909218222800896;\nn81909218222800896 -> n81346268269379584;\nn81627743246090240 -> n95701492081623040;\nn95701492081623040 -> n81346268269379584;\nn81346268269379584 -> n85005442966618112;\nn85005442966618112 -> n25332747903959040;\nn79094468455694336 -> n82190693199511552;\nn79094468455694336 -> n82472168176222208;\nn82472168176222208 -> n82753643152932864;\nn82472168176222208 -> n82190693199511552;\nn82190693199511552 -> n83035118129643520;\nn82190693199511552 -> n83316593106354176;\nn83316593106354176 -> n83035118129643520;\nn83316593106354176 -> n83598068083064832;\nn83598068083064832 -> n83035118129643520;\nn83598068083064832 -> n82753643152932864;\nn82753643152932864 -> n83879543059775488;\nn83035118129643520 -> n844424930131968;\nn83035118129643520 -> n84161018036486144;\nn84161018036486144 -> n844424930131968;\nn84161018036486144 -> n84442493013196800;\nn84442493013196800 -> n844424930131968;\nn84442493013196800 -> n84723967989907456;\nn84723967989907456 -> n85005442966618112;\nn84723967989907456 -> n85286917943328768;\nn85286917943328768 -> n81346268269379584;\nn85568392920039424 -> n85849867896750080;\nn85568392920039424 -> n86131342873460736;\nn86131342873460736 -> n85849867896750080;\nn86131342873460736 -> n86412817850171392;\nn86412817850171392 -> n85849867896750080;\nn86412817850171392 -> n86694292826882048;\nn86694292826882048 -> n86975767803592704;\nn86694292826882048 -> n87257242780303360;\nn87257242780303360 -> n86975767803592704;\nn86975767803592704 -> n25332747903959040;\nn85849867896750080 -> n89509042593988608;\nn89509042593988608 -> n87538717757014016;\nn89509042593988608 -> n87820192733724672;\nn87820192733724672 -> n87538717757014016;\nn87820192733724672 -> n88101667710435328;\nn88101667710435328 -> n87538717757014016;\nn88101667710435328 -> n88383142687145984;\nn88383142687145984 -> n88664617663856640;\nn88383142687145984 -> n88946092640567296;\nn88946092640567296 -> n88664617663856640;\nn88664617663856640 -> n844424930131968;\nn89227567617277952 -> n89509042593988608;\nn89227567617277952 -> n89790517570699264;\nn89790517570699264 -> n89509042593988608;\nn89790517570699264 -> n90071992547409920;\nn90071992547409920 -> n25332747903959040;\nn87538717757014016 -> n844424930131968;\nn87538717757014016 -> n90353467524120576;\nn90353467524120576 -> n90634942500831232;\nn90353467524120576 -> n90916417477541888;\nn90916417477541888 -> n91197892454252544;\nn90916417477541888 -> n91479367430963200;\nn91479367430963200 -> n91197892454252544;\nn91479367430963200 -> n91760842407673856;\nn91760842407673856 -> n92042317384384512;\nn91197892454252544 -> n92323792361095168;\nn91197892454252544 -> n92605267337805824;\nn92605267337805824 -> n92042317384384512;\nn92323792361095168 -> n92042317384384512;\nn90634942500831232 -> n92886742314516480;\nn90634942500831232 -> n93168217291227136;\nn93168217291227136 -> n844424930131968;\nn92886742314516480 -> n844424930131968;\nn93449692267937792 -> n93731167244648448;\nn93449692267937792 -> n94012642221359104;\nn94012642221359104 -> n844424930131968;\nn94012642221359104 -> n94294117198069760;\nn94294117198069760 -> n93731167244648448;\nn94294117198069760 -> n94575592174780416;\nn94575592174780416 -> n94857067151491072;\nn94575592174780416 -> n95138542128201728;\nn95138542128201728 -> n80783318315958272;\nn95138542128201728 -> n95420017104912384;\nn95420017104912384 -> n81346268269379584;\nn94857067151491072 -> n95701492081623040;\nn94857067151491072 -> n95982967058333696;\nn95982967058333696 -> n81346268269379584;\nn93731167244648448 -> n96264442035044352;\nn93731167244648448 -> n96545917011755008;\nn96545917011755008 -> n844424930131968;\nn96545917011755008 -> n96264442035044352;\nn96264442035044352 -> n844424930131968;\nn96264442035044352 -> n96827391988465664;\nn96827391988465664 -> n844424930131968;\nn96827391988465664 -> n97108866965176320;\nn97108866965176320 -> n844424930131968;\nn97108866965176320 -> n97390341941886976;\nn97390341941886976 -> n844424930131968;\nn97390341941886976 -> n97671816918597632;\nn97671816918597632 -> n97953291895308288;\nn98234766872018944 -> n98516241848729600;\nn98234766872018944 -> n98797716825440256;\nn98797716825440256 -> n98516241848729600;\nn98797716825440256 -> n99079191802150912;\nn99079191802150912 -> n99360666778861568;\nn99079191802150912 -> n98516241848729600;\nn98516241848729600 -> n71213169107795968;\nn98516241848729600 -> n99642141755572224;\nn99642141755572224 -> n105553116266496000;\nn105553116266496000 -> n99923616732282880;\nn105553116266496000 -> n100205091708993536;\nn100205091708993536 -> n99923616732282880;\nn99923616732282880 -> n100486566685704192;\nn99923616732282880 -> n100768041662414848;\nn100768041662414848 -> n101049516639125504;\nn100768041662414848 -> n101330991615836160;\nn101330991615836160 -> n101049516639125504;\nn101049516639125504 -> n100486566685704192;\nn101049516639125504 -> n101612466592546816;\nn101612466592546816 -> n101893941569257472;\nn101612466592546816 -> n102175416545968128;\nn102175416545968128 -> n101893941569257472;\nn101893941569257472 -> n102456891522678784;\nn101893941569257472 -> n102738366499389440;\nn102738366499389440 -> n103019841476100096;\nn102738366499389440 -> n103301316452810752;\nn103301316452810752 -> n103019841476100096;\nn103019841476100096 -> n103582791429521408;\nn103019841476100096 -> n103864266406232064;\nn103864266406232064 -> n104145741382942720;\nn103582791429521408 -> n104145741382942720;\nn104145741382942720 -> n102456891522678784;\nn102456891522678784 -> n104427216359653376;\nn102456891522678784 -> n104708691336364032;\nn104708691336364032 -> n104427216359653376;\nn104427216359653376 -> n101612466592546816;\nn104427216359653376 -> n100486566685704192;\nn100486566685704192 -> n104990166313074688;\nn100486566685704192 -> n105271641289785344;\nn105271641289785344 -> n104990166313074688;\nn104990166313074688 -> n105553116266496000;\nn104990166313074688 -> n71213169107795968;\nn71213169107795968 -> n844424930131968;\nn105834591243206656 -> n844424930131968;\nn105834591243206656 -> n106116066219917312;\nn106116066219917312 -> n25332747903959040;\nn106397541196627968 -> n106679016173338624;\nn106397541196627968 -> n106960491150049280;\nn106960491150049280 -> n107241966126759936;\nn106960491150049280 -> n106679016173338624;\nn106679016173338624 -> n844424930131968;\nn106679016173338624 -> n107241966126759936;\nn107241966126759936 -> n83879543059775488;\nn107523441103470592 -> n107804916080181248;\nn107523441103470592 -> n108086391056891904;\nn108086391056891904 -> n844424930131968;\nn108086391056891904 -> n107804916080181248;\nn107804916080181248 -> n844424930131968;\nn108367866033602560 -> n108649341010313216;\nn108367866033602560 -> n108930815987023872;\nn108930815987023872 -> n844424930131968;\nn108930815987023872 -> n109212290963734528;\nn109212290963734528 -> n109493765940445184;\nn109212290963734528 -> n109775240917155840;\nn109775240917155840 -> n109493765940445184;\nn109493765940445184 -> n110056715893866496;\nn109493765940445184 -> n110338190870577152;\nn110338190870577152 -> n110619665847287808;\nn110338190870577152 -> n110901140823998464;\nn110901140823998464 -> n110619665847287808;\nn110901140823998464 -> n111182615800709120;\nn111182615800709120 -> n110056715893866496;\nn111182615800709120 -> n111464090777419776;\nn111464090777419776 -> n110056715893866496;\nn111464090777419776 -> n111745565754130432;\nn111745565754130432 -> n110056715893866496;\nn111745565754130432 -> n112027040730841088;\nn112027040730841088 -> n110056715893866496;\nn112027040730841088 -> n112308515707551744;\nn112308515707551744 -> n110056715893866496;\nn112308515707551744 -> n112589990684262400;\nn112589990684262400 -> n110619665847287808;\nn112589990684262400 -> n110056715893866496;\nn110056715893866496 -> n110619665847287808;\nn110619665847287808 -> n112871465660973056;\nn108649341010313216 -> n112871465660973056;\nn112871465660973056 -> n113152940637683712;\nn112871465660973056 -> n113434415614394368;\nn113434415614394368 -> n113715890591105024;\nn113434415614394368 -> n113997365567815680;\nn113997365567815680 -> n113152940637683712;\nn113997365567815680 -> n113715890591105024;\nn113715890591105024 -> n114278840544526336;\nn113715890591105024 -> n114560315521236992;\nn114560315521236992 -> n114278840544526336;\nn114278840544526336 -> n113152940637683712;\nn114278840544526336 -> n114841790497947648;\nn114841790497947648 -> n113152940637683712;\nn114841790497947648 -> n115123265474658304;\nn115123265474658304 -> n113152940637683712;\nn115123265474658304 -> n115404740451368960;\nn115404740451368960 -> n113152940637683712;\nn115404740451368960 -> n115686215428079616;\nn115686215428079616 -> n116812115334922240;\nn116812115334922240 -> n115967690404790272;\nn116812115334922240 -> n116249165381500928;\nn116249165381500928 -> n116530640358211584;\nn116249165381500928 -> n115967690404790272;\nn115967690404790272 -> n116812115334922240;\nn115967690404790272 -> n113152940637683712;\nn113152940637683712 -> n120752765008871424;\nn120752765008871424 -> n117093590311632896;\nn120752765008871424 -> n117375065288343552;\nn117375065288343552 -> n117093590311632896;\nn117093590311632896 -> n117656540265054208;\nn117093590311632896 -> n117938015241764864;\nn117938015241764864 -> n117656540265054208;\nn117938015241764864 -> n118219490218475520;\nn118219490218475520 -> n117656540265054208;\nn118219490218475520 -> n118500965195186176;\nn118500965195186176 -> n118782440171896832;\nn118500965195186176 -> n119063915148607488;\nn119063915148607488 -> n119345390125318144;\nn116530640358211584 -> n119626865102028800;\nn116530640358211584 -> n119908340078739456;\nn119908340078739456 -> n113152940637683712;\nn119626865102028800 -> n120189815055450112;\nn119626865102028800 -> n120471290032160768;\nn120471290032160768 -> n120189815055450112;\nn120189815055450112 -> n120752765008871424;\nn118782440171896832 -> n121034239985582080;\nn118782440171896832 -> n121315714962292736;\nn121315714962292736 -> n121597189939003392;\nn121315714962292736 -> n121878664915714048;\nn121878664915714048 -> n121597189939003392;\nn121878664915714048 -> n122160139892424704;\nn122160139892424704 -> n121034239985582080;\nn122160139892424704 -> n122441614869135360;\nn122441614869135360 -> n121034239985582080;\nn122441614869135360 -> n122723089845846016;\nn122723089845846016 -> n121034239985582080;\nn122723089845846016 -> n123004564822556672;\nn123004564822556672 -> n121034239985582080;\nn123004564822556672 -> n123286039799267328;\nn123286039799267328 -> n121034239985582080;\nn123286039799267328 -> n123567514775977984;\nn123567514775977984 -> n121597189939003392;\nn123567514775977984 -> n121034239985582080;\nn121034239985582080 -> n121597189939003392;\nn121597189939003392 -> n119345390125318144;\nn119345390125318144 -> n123848989752688640;\nn119345390125318144 -> n124130464729399296;\nn124130464729399296 -> n123848989752688640;\nn123848989752688640 -> n117656540265054208;\nn123848989752688640 -> n124411939706109952;\nn124411939706109952 -> n124693414682820608;\nn124411939706109952 -> n124974889659531264;\nn124974889659531264 -> n124693414682820608;\nn124974889659531264 -> n125256364636241920;\nn125256364636241920 -> n125537839612952576;\nn125256364636241920 -> n124693414682820608;\nn124693414682820608 -> n125819314589663232;\nn124693414682820608 -> n126100789566373888;\nn126100789566373888 -> n125819314589663232;\nn126100789566373888 -> n126382264543084544;\nn126382264543084544 -> n125537839612952576;\nn126382264543084544 -> n125819314589663232;\nn125819314589663232 -> n117656540265054208;\nn125819314589663232 -> n126663739519795200;\nn126663739519795200 -> n117656540265054208;\nn126663739519795200 -> n126945214496505856;\nn126945214496505856 -> n117656540265054208;\nn126945214496505856 -> n125537839612952576;\nn125537839612952576 -> n127226689473216512;\nn125537839612952576 -> n127508164449927168;\nn127508164449927168 -> n127226689473216512;\nn127508164449927168 -> n127789639426637824;\nn127789639426637824 -> n128071114403348480;\nn127226689473216512 -> n117656540265054208;\nn127226689473216512 -> n128352589380059136;\nn128352589380059136 -> n117656540265054208;\nn128352589380059136 -> n128634064356769792;\nn128634064356769792 -> n128071114403348480;\nn128071114403348480 -> n128915539333480448;\nn128071114403348480 -> n129197014310191104;\nn129197014310191104 -> n128915539333480448;\nn128915539333480448 -> n129478489286901760;\nn128915539333480448 -> n129759964263612416;\nn129759964263612416 -> n130041439240323072;\nn129759964263612416 -> n130322914217033728;\nn130322914217033728 -> n130604389193744384;\nn130322914217033728 -> n130041439240323072;\nn130041439240323072 -> n130885864170455040;\nn130604389193744384 -> n130885864170455040;\nn130885864170455040 -> n131167339147165696;\nn130885864170455040 -> n131448814123876352;\nn131448814123876352 -> n131167339147165696;\nn131167339147165696 -> n131730289100587008;\nn131167339147165696 -> n132011764077297664;\nn132011764077297664 -> n132293239054008320;\nn131730289100587008 -> n132293239054008320;\nn132293239054008320 -> n844424930131968;\nn132293239054008320 -> n132574714030718976;\nn132574714030718976 -> n844424930131968;\nn132574714030718976 -> n132856189007429632;\nn132856189007429632 -> n844424930131968;\nn132856189007429632 -> n133137663984140288;\nn133137663984140288 -> n129478489286901760;\nn129478489286901760 -> n133419138960850944;\nn129478489286901760 -> n133700613937561600;\nn133700613937561600 -> n844424930131968;\nn133700613937561600 -> n133419138960850944;\nn133419138960850944 -> n133982088914272256;\nn133419138960850944 -> n134263563890982912;\nn134263563890982912 -> n133982088914272256;\nn134263563890982912 -> n134545038867693568;\nn134545038867693568 -> n134826513844404224;\nn133982088914272256 -> n135107988821114880;\nn133982088914272256 -> n134826513844404224;\nn134826513844404224 -> n135389463797825536;\nn135107988821114880 -> n135670938774536192;\nn135107988821114880 -> n135952413751246848;\nn135952413751246848 -> n135670938774536192;\nn135670938774536192 -> n135389463797825536;\nn135389463797825536 -> n117656540265054208;\nn117656540265054208 -> n844424930131968;\nn117656540265054208 -> n136233888727957504;\nn136233888727957504 -> n844424930131968;\nn136233888727957504 -> n136515363704668160;\nn136515363704668160 -> n844424930131968;\nn136515363704668160 -> n136796838681378816;\nn136796838681378816 -> n844424930131968;\nn136796838681378816 -> n137078313658089472;\nn137078313658089472 -> n137359788634800128;\nn137078313658089472 -> n137641263611510784;\nn137641263611510784 -> n137359788634800128;\nn137641263611510784 -> n137922738588221440;\nn137922738588221440 -> n137359788634800128;\nn137359788634800128 -> n138204213564932096;\nn137359788634800128 -> n138485688541642752;\nn138485688541642752 -> n138767163518353408;\nn138767163518353408 -> n138767163518353408[style=dashed];\nn138767163518353408 -> n138204213564932096;\nn138204213564932096 -> n844424930131968;\nn138204213564932096 -> n139048638495064064;\nn139048638495064064 -> n844424930131968;\nn139048638495064064 -> n139330113471774720;\nn139330113471774720 -> n844424930131968;\nn139330113471774720 -> n139611588448485376;\nn139611588448485376 -> n139893063425196032;\nn139611588448485376 -> n140174538401906688;\nn140174538401906688 -> n140456013378617344;\nn140456013378617344 -> n140456013378617344[style=dashed];\nn140456013378617344 -> n139893063425196032;\nn139893063425196032 -> n140737488355328000;\nn141018963332038656 -> n141300438308749312;\nn141018963332038656 -> n141581913285459968;\nn141581913285459968 -> n141300438308749312;\nn141581913285459968 -> n141863388262170624;\nn141863388262170624 -> n141300438308749312;\nn141863388262170624 -> n142144863238881280;\nn142144863238881280 -> n142426338215591936;\nn142144863238881280 -> n142707813192302592;\nn142707813192302592 -> n141300438308749312;\nn142707813192302592 -> n142426338215591936;\nn142426338215591936 -> n141300438308749312;\nn142426338215591936 -> n142989288169013248;\nn142989288169013248 -> n143270763145723904;\nn142989288169013248 -> n143552238122434560;\nn143552238122434560 -> n143270763145723904;\nn143552238122434560 -> n143833713099145216;\nn143833713099145216 -> n144115188075855872;\nn143270763145723904 -> n144115188075855872;\nn144115188075855872 -> n144396663052566528;\nn144115188075855872 -> n144678138029277184;\nn144678138029277184 -> n144959613005987840;\nn144959613005987840 -> n144959613005987840[style=dashed];\nn144959613005987840 -> n144396663052566528;\nn144396663052566528 -> n145241087982698496;\nn144396663052566528 -> n145522562959409152;\nn145522562959409152 -> n145241087982698496;\nn145522562959409152 -> n145804037936119808;\nn145804037936119808 -> n145241087982698496;\nn145804037936119808 -> n146085512912830464;\nn146085512912830464 -> n141300438308749312;\nn146085512912830464 -> n145241087982698496;\nn145241087982698496 -> n141300438308749312;\nn145241087982698496 -> n146366987889541120;\nn146366987889541120 -> n141300438308749312;\nn146366987889541120 -> n146648462866251776;\nn146648462866251776 -> n141300438308749312;\nn146648462866251776 -> n146929937842962432;\nn146929937842962432 -> n141300438308749312;\nn146929937842962432 -> n147211412819673088;\nn147211412819673088 -> n141300438308749312;\nn147211412819673088 -> n147492887796383744;\nn147492887796383744 -> n141300438308749312;\nn147492887796383744 -> n147774362773094400;\nn147774362773094400 -> n148055837749805056;\nn147774362773094400 -> n148337312726515712;\nn148337312726515712 -> n148618787703226368;\nn148618787703226368 -> n148618787703226368[style=dashed];\nn148618787703226368 -> n148055837749805056;\nn148055837749805056 -> n25332747903959040;\nn141300438308749312 -> n158751886864809984;\nn158751886864809984 -> n148900262679937024;\nn158751886864809984 -> n149181737656647680;\nn149181737656647680 -> n148900262679937024;\nn148900262679937024 -> n149463212633358336;\nn148900262679937024 -> n149744687610068992;\nn149744687610068992 -> n150026162586779648;\nn149744687610068992 -> n150307637563490304;\nn150307637563490304 -> n150589112540200960;\nn150307637563490304 -> n150870587516911616;\nn150870587516911616 -> n150589112540200960;\nn150589112540200960 -> n149463212633358336;\nn150589112540200960 -> n150026162586779648;\nn150026162586779648 -> n151152062493622272;\nn150026162586779648 -> n151433537470332928;\nn151433537470332928 -> n151715012447043584;\nn151433537470332928 -> n151996487423754240;\nn151996487423754240 -> n151715012447043584;\nn151715012447043584 -> n151152062493622272;\nn151715012447043584 -> n152277962400464896;\nn152277962400464896 -> n149463212633358336;\nn152277962400464896 -> n151152062493622272;\nn151152062493622272 -> n152559437377175552;\nn151152062493622272 -> n152840912353886208;\nn152840912353886208 -> n153122387330596864;\nn152840912353886208 -> n153403862307307520;\nn153403862307307520 -> n153122387330596864;\nn153122387330596864 -> n152559437377175552;\nn153122387330596864 -> n153685337284018176;\nn153685337284018176 -> n153966812260728832;\nn153685337284018176 -> n154248287237439488;\nn154248287237439488 -> n149463212633358336;\nn154248287237439488 -> n153966812260728832;\nn153966812260728832 -> n152559437377175552;\nn153966812260728832 -> n154529762214150144;\nn154529762214150144 -> n152559437377175552;\nn154529762214150144 -> n154811237190860800;\nn154811237190860800 -> n149463212633358336;\nn154811237190860800 -> n152559437377175552;\nn152559437377175552 -> n155092712167571456;\nn152559437377175552 -> n155374187144282112;\nn155374187144282112 -> n155655662120992768;\nn155374187144282112 -> n155937137097703424;\nn155937137097703424 -> n155655662120992768;\nn155655662120992768 -> n155092712167571456;\nn155655662120992768 -> n156218612074414080;\nn156218612074414080 -> n155092712167571456;\nn156218612074414080 -> n156500087051124736;\nn156500087051124736 -> n149463212633358336;\nn156500087051124736 -> n155092712167571456;\nn155092712167571456 -> n156781562027835392;\nn155092712167571456 -> n157063037004546048;\nn157063037004546048 -> n156781562027835392;\nn156781562027835392 -> n157344511981256704;\nn156781562027835392 -> n157625986957967360;\nn157625986957967360 -> n157344511981256704;\nn157625986957967360 -> n157907461934678016;\nn157907461934678016 -> n157344511981256704;\nn157907461934678016 -> n158188936911388672;\nn158188936911388672 -> n149463212633358336;\nn158188936911388672 -> n158470411888099328;\nn158470411888099328 -> n149463212633358336;\nn158470411888099328 -> n157344511981256704;\nn157344511981256704 -> n158751886864809984;\nn149463212633358336 -> n844424930131968;\nn149463212633358336 -> n159033361841520640;\nn159033361841520640 -> n140737488355328000;\nn140737488355328000 -> n92042317384384512;\nn92042317384384512 -> n844424930131968;\nn844424930131968 -> n25332747903959040;\nn159314836818231296 -> n159596311794941952;\nn159596311794941952 -> n159877786771652608;\nn70368744177664000 -> n0[style=dotted];\nn29273397577908224 -> n70368744177664000[style=dotted];\nn281474976710656 -> n29273397577908224[style=dotted];\nn1407374883553280 -> n1125899906842624[style=dotted];\nn26458647810801664 -> n2251799813685248[style=dotted];\nn2533274790395904 -> n26458647810801664[style=dotted];\nn3096224743817216 -> n2533274790395904[style=dotted];\nn4222124650659840 -> n3940649673949184[style=dotted];\nn4785074604081152 -> n4222124650659840[style=dotted];\nn6755399441055744 -> n6473924464345088[style=dotted];\nn5910974510923776 -> n4785074604081152[style=dotted];\nn7318349394477056 -> n4785074604081152[style=dotted];\nn7881299347898368 -> n7318349394477056[style=dotted];\nn3659174697238528 -> n3096224743817216[style=dotted];\nn8444249301319680 -> n3659174697238528[style=dotted];\nn9007199254740992 -> n8444249301319680[style=dotted];\nn9851624184872960 -> n9007199254740992[style=dotted];\nn10977524091715584 -> n10696049115004928[style=dotted];\nn12103423998558208 -> n11821949021847552[style=dotted];\nn11540474045136896 -> n10977524091715584[style=dotted];\nn12666373951979520 -> n11540474045136896[style=dotted];\nn14355223812243456 -> n14073748835532800[style=dotted];\nn13792273858822144 -> n13510798882111488[style=dotted];\nn14918173765664768 -> n13792273858822144[style=dotted];\nn13229323905400832 -> n12666373951979520[style=dotted];\nn15481123719086080 -> n12666373951979520[style=dotted];\nn16325548649218048 -> n12666373951979520[style=dotted];\nn17169973579350016 -> n12666373951979520[style=dotted];\nn17451448556060672 -> n17169973579350016[style=dotted];\nn19703248369745920 -> n19421773393035264[style=dotted];\nn19140298416324608 -> n17451448556060672[style=dotted];\nn20266198323167232 -> n17451448556060672[style=dotted];\nn18014398509481984 -> n17451448556060672[style=dotted];\nn21392098230009856 -> n20266198323167232[style=dotted];\nn22236523160141824 -> n20266198323167232[style=dotted];\nn23362423066984448 -> n20266198323167232[style=dotted];\nn24769797950537728 -> n24488322973827072[style=dotted];\nn83879543059775488 -> n24769797950537728[style=dotted];\nn78531518502273024 -> n83879543059775488[style=dotted];\nn99360666778861568 -> n78531518502273024[style=dotted];\nn10414574138294272 -> n9851624184872960[style=dotted];\nn25895697857380352 -> n25614222880669696[style=dotted];\nn24206847997116416 -> n9851624184872960[style=dotted];\nn9570149208162304 -> n8444249301319680[style=dotted];\nn1970324836974592 -> n1407374883553280[style=dotted];\nn26740122787512320 -> n1970324836974592[style=dotted];\nn27303072740933632 -> n26740122787512320[style=dotted];\nn28428972647776256 -> n28147497671065600[style=dotted];\nn27866022694354944 -> n27303072740933632[style=dotted];\nn29554872554618880 -> n27866022694354944[style=dotted];\nn30117822508040192 -> n29554872554618880[style=dotted];\nn30680772461461504 -> n30117822508040192[style=dotted];\nn31243722414882816 -> n30680772461461504[style=dotted];\nn31806672368304128 -> n31243722414882816[style=dotted];\nn32369622321725440 -> n31806672368304128[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\nn25332747903959040 -> n281474976710656[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-2148.txt",
    "content": "digraph {\n\nmaxiter=8;\n        \nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn844424930131968[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn1970324836974592[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn2533274790395904[shape=rectangle, label=\"B8\"];\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn3377699720527872[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn3940649673949184[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn4503599627370496[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn5066549580791808[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn1125899906842624[shape=rectangle, label=\"B19\"];\nn6192449487634432[shape=rectangle, label=\"B20\"];\nn6755399441055744[shape=rectangle, label=\"B21\"];\nn7318349394477056[shape=rectangle, label=\"B22\"];\nn7881299347898368[shape=rectangle, label=\"B23\"];\nn6473924464345088[shape=rectangle, label=\"B24\"];\nn7036874417766400[shape=rectangle, label=\"B25\"];\nn8725724278030336[shape=rectangle, label=\"B26\"];\nn11540474045136896[shape=rectangle, label=\"B27\"];\nn8444249301319680[shape=rectangle, label=\"B28\"];\nn9570149208162304[shape=rectangle, label=\"B29\"];\nn9288674231451648[shape=rectangle, label=\"B30\"];\nn9851624184872960[shape=rectangle, label=\"B31\"];\nn10414574138294272[shape=rectangle, label=\"B32\"];\nn10133099161583616[shape=rectangle, label=\"B33\"];\nn10696049115004928[shape=rectangle, label=\"B34\"];\nn11258999068426240[shape=rectangle, label=\"B35\"];\nn11821949021847552[shape=rectangle, label=\"B36\"];\nn10977524091715584[shape=rectangle, label=\"B37\"];\nn9007199254740992[shape=rectangle, label=\"B38\"];\nn7599824371187712[shape=rectangle, label=\"B39\"];\nn12103423998558208[shape=rectangle, label=\"B40\"];\nn12666373951979520[shape=rectangle, label=\"B41\"];\nn12384898975268864[shape=rectangle, label=\"B42\"];\nn12947848928690176[shape=rectangle, label=\"B43\"];\nn13510798882111488[shape=rectangle, label=\"B44\"];\nn14073748835532800[shape=rectangle, label=\"B45\"];\nn13792273858822144[shape=rectangle, label=\"B46\"];\nn14636698788954112[shape=rectangle, label=\"B47\"];\nn14918173765664768[shape=rectangle, label=\"B48\"];\nn14355223812243456[shape=rectangle, label=\"B49\"];\nn15199648742375424[shape=rectangle, label=\"B50\"];\nn13229323905400832[shape=rectangle, label=\"B51\"];\nn15762598695796736[shape=rectangle, label=\"B52\"];\nn16325548649218048[shape=rectangle, label=\"B53\"];\nn16044073672507392[shape=rectangle, label=\"B54\"];\nn16888498602639360[shape=rectangle, label=\"B55\"];\nn17169973579350016[shape=rectangle, label=\"B56\"];\nn16607023625928704[shape=rectangle, label=\"B57\"];\nn17451448556060672[shape=rectangle, label=\"B58\"];\nn15481123719086080[shape=rectangle, label=\"B59\"];\nn8162774324609024[shape=rectangle, label=\"B60\"];\nn18014398509481984[shape=rectangle, label=\"B61\"];\nn18295873486192640[shape=rectangle, label=\"B62\"];\nn18858823439613952[shape=rectangle, label=\"B63\"];\nn5910974510923776[shape=rectangle, label=\"B64\"];\nn19140298416324608[shape=rectangle, label=\"B65\"];\nn19421773393035264[shape=rectangle, label=\"B66\"];\nn18577348462903296[shape=rectangle, label=\"B67\"];\nn25895697857380352[shape=rectangle, label=\"B68\"];\nn17732923532771328[shape=rectangle, label=\"B69\"];\nn5629499534213120[shape=rectangle, label=\"B70\"];\nn19984723346456576[shape=rectangle, label=\"B71\"];\nn20266198323167232[shape=rectangle, label=\"B72\"];\nn20829148276588544[shape=rectangle, label=\"B73\"];\nn20547673299877888[shape=rectangle, label=\"B74\"];\nn21110623253299200[shape=rectangle, label=\"B75\"];\nn21673573206720512[shape=rectangle, label=\"B76\"];\nn22236523160141824[shape=rectangle, label=\"B77\"];\nn21955048183431168[shape=rectangle, label=\"B78\"];\nn22799473113563136[shape=rectangle, label=\"B79\"];\nn23080948090273792[shape=rectangle, label=\"B80\"];\nn22517998136852480[shape=rectangle, label=\"B81\"];\nn23362423066984448[shape=rectangle, label=\"B82\"];\nn21392098230009856[shape=rectangle, label=\"B83\"];\nn23925373020405760[shape=rectangle, label=\"B84\"];\nn24488322973827072[shape=rectangle, label=\"B85\"];\nn24206847997116416[shape=rectangle, label=\"B86\"];\nn25051272927248384[shape=rectangle, label=\"B87\"];\nn25332747903959040[shape=rectangle, label=\"B88\"];\nn24769797950537728[shape=rectangle, label=\"B89\"];\nn25614222880669696[shape=rectangle, label=\"B90\"];\nn23643898043695104[shape=rectangle, label=\"B91\"];\nn19703248369745920[shape=rectangle, label=\"B92\"];\nn26177172834091008[shape=rectangle, label=\"B93\"];\nn26740122787512320[shape=rectangle, label=\"B94\"];\nn27303072740933632[shape=rectangle, label=\"B95\"];\nn28991922601197568[shape=rectangle, label=\"B96\"];\nn27866022694354944[shape=rectangle, label=\"B97\"];\nn28428972647776256[shape=rectangle, label=\"B98\"];\nn28710447624486912[shape=rectangle, label=\"B99\"];\nn27021597764222976[shape=rectangle, label=\"B100\"];\nn26458647810801664[shape=rectangle, label=\"B101\"];\nn29836347531329536[shape=rectangle, label=\"B102\"];\nn30399297484750848[shape=rectangle, label=\"B103\"];\nn31806672368304128[shape=rectangle, label=\"B104\"];\nn30680772461461504[shape=rectangle, label=\"B105\"];\nn30962247438172160[shape=rectangle, label=\"B106\"];\nn31243722414882816[shape=rectangle, label=\"B107\"];\nn31525197391593472[shape=rectangle, label=\"B108\"];\nn30117822508040192[shape=rectangle, label=\"B109\"];\nn29554872554618880[shape=rectangle, label=\"B110\"];\nn32651097298436096[shape=rectangle, label=\"B111\"];\nn27584547717644288[shape=rectangle, label=\"B112\"];\nn33214047251857408[shape=rectangle, label=\"B113\"];\nn28147497671065600[shape=rectangle, label=\"B114\"];\nn32369622321725440[shape=rectangle, label=\"B115\"];\nn33776997205278720[shape=rectangle, label=\"B116\"];\nn33495522228568064[shape=rectangle, label=\"B117\"];\nn34621422135410688[shape=rectangle, label=\"B118\"];\nn34339947158700032[shape=rectangle, label=\"B119\"];\nn35184372088832000[shape=rectangle, label=\"B120\"];\nn35465847065542656[shape=rectangle, label=\"B121\"];\nn35747322042253312[shape=rectangle, label=\"B122\"];\nn34902897112121344[shape=rectangle, label=\"B123\"];\nn36028797018963968[shape=rectangle, label=\"B124\"];\nn36310271995674624[shape=rectangle, label=\"B125\"];\nn34058472181989376[shape=rectangle, label=\"B126\"];\nn36591746972385280[shape=rectangle, label=\"B127\"];\nn32932572275146752[shape=rectangle, label=\"B128\"];\nn37154696925806592[shape=rectangle, label=\"B129\"];\nn37436171902517248[shape=rectangle, label=\"B130\"];\nn36873221949095936[shape=rectangle, label=\"B131\"];\nn37999121855938560[shape=rectangle, label=\"B132\"];\nn38280596832649216[shape=rectangle, label=\"B133\"];\nn37717646879227904[shape=rectangle, label=\"B134\"];\nn38843546786070528[shape=rectangle, label=\"B135\"];\nn39125021762781184[shape=rectangle, label=\"B136\"];\nn38562071809359872[shape=rectangle, label=\"B137\"];\nn39687971716202496[shape=rectangle, label=\"B138\"];\nn39969446692913152[shape=rectangle, label=\"B139\"];\nn39406496739491840[shape=rectangle, label=\"B140\"];\nn40532396646334464[shape=rectangle, label=\"B141\"];\nn41095346599755776[shape=rectangle, label=\"B142\"];\nn41658296553177088[shape=rectangle, label=\"B143\"];\nn41376821576466432[shape=rectangle, label=\"B144\"];\nn42221246506598400[shape=rectangle, label=\"B145\"];\nn42784196460019712[shape=rectangle, label=\"B146\"];\nn42502721483309056[shape=rectangle, label=\"B147\"];\nn43065671436730368[shape=rectangle, label=\"B148\"];\nn40250921669623808[shape=rectangle, label=\"B149\"];\nn43628621390151680[shape=rectangle, label=\"B150\"];\nn44191571343572992[shape=rectangle, label=\"B151\"];\nn40813871623045120[shape=rectangle, label=\"B152\"];\nn41939771529887744[shape=rectangle, label=\"B153\"];\nn45035996273704960[shape=rectangle, label=\"B154\"];\nn43347146413441024[shape=rectangle, label=\"B155\"];\nn43910096366862336[shape=rectangle, label=\"B156\"];\nn45598946227126272[shape=rectangle, label=\"B157\"];\nn45880421203836928[shape=rectangle, label=\"B158\"];\nn44473046320283648[shape=rectangle, label=\"B159\"];\nn46161896180547584[shape=rectangle, label=\"B160\"];\nn45317471250415616[shape=rectangle, label=\"B161\"];\nn46724846133968896[shape=rectangle, label=\"B162\"];\nn46443371157258240[shape=rectangle, label=\"B163\"];\nn47287796087390208[shape=rectangle, label=\"B164\"];\nn47006321110679552[shape=rectangle, label=\"B165\"];\nn47850746040811520[shape=rectangle, label=\"B166\"];\nn47569271064100864[shape=rectangle, label=\"B167\"];\nn48413695994232832[shape=rectangle, label=\"B168\"];\nn48132221017522176[shape=rectangle, label=\"B169\"];\nn44754521296994304[shape=rectangle, label=\"B170\"];\nn48976645947654144[shape=rectangle, label=\"B171\"];\nn49258120924364800[shape=rectangle, label=\"B172\"];\nn48695170970943488[shape=rectangle, label=\"B173\"];\nn49821070877786112[shape=rectangle, label=\"B174\"];\nn50384020831207424[shape=rectangle, label=\"B175\"];\nn49539595901075456[shape=rectangle, label=\"B176\"];\nn50102545854496768[shape=rectangle, label=\"B177\"];\nn51509920738050048[shape=rectangle, label=\"B178\"];\nn51228445761339392[shape=rectangle, label=\"B179\"];\nn52072870691471360[shape=rectangle, label=\"B180\"];\nn52354345668182016[shape=rectangle, label=\"B181\"];\nn52917295621603328[shape=rectangle, label=\"B182\"];\nn52635820644892672[shape=rectangle, label=\"B183\"];\nn51791395714760704[shape=rectangle, label=\"B184\"];\nn53198770598313984[shape=rectangle, label=\"B185\"];\nn53480245575024640[shape=rectangle, label=\"B186\"];\nn50665495807918080[shape=rectangle, label=\"B187\"];\nn53761720551735296[shape=rectangle, label=\"B188\"];\nn50946970784628736[shape=rectangle, label=\"B189\"];\nn54324670505156608[shape=rectangle, label=\"B190\"];\nn54606145481867264[shape=rectangle, label=\"B191\"];\nn54043195528445952[shape=rectangle, label=\"B192\"];\nn55169095435288576[shape=rectangle, label=\"B193\"];\nn55450570411999232[shape=rectangle, label=\"B194\"];\nn54887620458577920[shape=rectangle, label=\"B195\"];\nn56013520365420544[shape=rectangle, label=\"B196\"];\nn56294995342131200[shape=rectangle, label=\"B197\"];\nn55732045388709888[shape=rectangle, label=\"B198\"];\nn56857945295552512[shape=rectangle, label=\"B199\"];\nn57139420272263168[shape=rectangle, label=\"B200\"];\nn56576470318841856[shape=rectangle, label=\"B201\"];\nn57702370225684480[shape=rectangle, label=\"B202\"];\nn57983845202395136[shape=rectangle, label=\"B203\"];\nn57420895248973824[shape=rectangle, label=\"B204\"];\nn58546795155816448[shape=rectangle, label=\"B205\"];\nn58828270132527104[shape=rectangle, label=\"B206\"];\nn58265320179105792[shape=rectangle, label=\"B207\"];\nn59391220085948416[shape=rectangle, label=\"B208\"];\nn59672695062659072[shape=rectangle, label=\"B209\"];\nn59109745109237760[shape=rectangle, label=\"B210\"];\nn60235645016080384[shape=rectangle, label=\"B211\"];\nn60517119992791040[shape=rectangle, label=\"B212\"];\nn59954170039369728[shape=rectangle, label=\"B213\"];\nn61080069946212352[shape=rectangle, label=\"B214\"];\nn61643019899633664[shape=rectangle, label=\"B215\"];\nn60798594969501696[shape=rectangle, label=\"B216\"];\nn61361544922923008[shape=rectangle, label=\"B217\"];\nn62487444829765632[shape=rectangle, label=\"B218\"];\nn63050394783186944[shape=rectangle, label=\"B219\"];\nn62768919806476288[shape=rectangle, label=\"B220\"];\nn63331869759897600[shape=rectangle, label=\"B221\"];\nn62205969853054976[shape=rectangle, label=\"B222\"];\nn63894819713318912[shape=rectangle, label=\"B223\"];\nn64457769666740224[shape=rectangle, label=\"B224\"];\nn65020719620161536[shape=rectangle, label=\"B225\"];\nn64176294690029568[shape=rectangle, label=\"B226\"];\nn64739244643450880[shape=rectangle, label=\"B227\"];\nn66146619527004160[shape=rectangle, label=\"B228\"];\nn65865144550293504[shape=rectangle, label=\"B229\"];\nn66709569480425472[shape=rectangle, label=\"B230\"];\nn66991044457136128[shape=rectangle, label=\"B231\"];\nn67553994410557440[shape=rectangle, label=\"B232\"];\nn67272519433846784[shape=rectangle, label=\"B233\"];\nn66428094503714816[shape=rectangle, label=\"B234\"];\nn68116944363978752[shape=rectangle, label=\"B235\"];\nn68398419340689408[shape=rectangle, label=\"B236\"];\nn65302194596872192[shape=rectangle, label=\"B237\"];\nn68679894317400064[shape=rectangle, label=\"B238\"];\nn67835469387268096[shape=rectangle, label=\"B239\"];\nn68961369294110720[shape=rectangle, label=\"B240\"];\nn69524319247532032[shape=rectangle, label=\"B241\"];\nn69242844270821376[shape=rectangle, label=\"B242\"];\nn70368744177664000[shape=rectangle, label=\"B243\"];\nn72339069014638592[shape=rectangle, label=\"B244\"];\nn70650219154374656[shape=rectangle, label=\"B245\"];\nn70931694131085312[shape=rectangle, label=\"B246\"];\nn71213169107795968[shape=rectangle, label=\"B247\"];\nn70087269200953344[shape=rectangle, label=\"B248\"];\nn71494644084506624[shape=rectangle, label=\"B249\"];\nn71776119061217280[shape=rectangle, label=\"B250\"];\nn72057594037927936[shape=rectangle, label=\"B251\"];\nn69805794224242688[shape=rectangle, label=\"B252\"];\nn72620543991349248[shape=rectangle, label=\"B253\"];\nn65583669573582848[shape=rectangle, label=\"B254\"];\nn73183493944770560[shape=rectangle, label=\"B255\"];\nn72902018968059904[shape=rectangle, label=\"B256\"];\nn73464968921481216[shape=rectangle, label=\"B257\"];\nn73746443898191872[shape=rectangle, label=\"B258\"];\nn74309393851613184[shape=rectangle, label=\"B259\"];\nn74872343805034496[shape=rectangle, label=\"B260\"];\nn74590868828323840[shape=rectangle, label=\"B261\"];\nn75716768735166464[shape=rectangle, label=\"B262\"];\nn75435293758455808[shape=rectangle, label=\"B263\"];\nn76279718688587776[shape=rectangle, label=\"B264\"];\nn76561193665298432[shape=rectangle, label=\"B265\"];\nn76842668642009088[shape=rectangle, label=\"B266\"];\nn75998243711877120[shape=rectangle, label=\"B267\"];\nn77124143618719744[shape=rectangle, label=\"B268\"];\nn77405618595430400[shape=rectangle, label=\"B269\"];\nn75153818781745152[shape=rectangle, label=\"B270\"];\nn77687093572141056[shape=rectangle, label=\"B271\"];\nn74027918874902528[shape=rectangle, label=\"B272\"];\nn78250043525562368[shape=rectangle, label=\"B273\"];\nn77968568548851712[shape=rectangle, label=\"B274\"];\nn78531518502273024[shape=rectangle, label=\"B275\"];\nn78812993478983680[shape=rectangle, label=\"B276\"];\nn79375943432404992[shape=rectangle, label=\"B277\"];\nn79938893385826304[shape=rectangle, label=\"B278\"];\nn79657418409115648[shape=rectangle, label=\"B279\"];\nn80220368362536960[shape=rectangle, label=\"B280\"];\nn80501843339247616[shape=rectangle, label=\"B281\"];\nn79094468455694336[shape=rectangle, label=\"B282\"];\nn81064793292668928[shape=rectangle, label=\"B283\"];\nn80783318315958272[shape=rectangle, label=\"B284\"];\nn81346268269379584[shape=rectangle, label=\"B285\"];\nn81627743246090240[shape=rectangle, label=\"B286\"];\nn81909218222800896[shape=rectangle, label=\"B287\"];\nn82190693199511552[shape=rectangle, label=\"B288\"];\nn82472168176222208[shape=rectangle, label=\"B289\"];\nn63613344736608256[shape=rectangle, label=\"B290\"];\nn83316593106354176[shape=rectangle, label=\"B291\"];\nn83879543059775488[shape=rectangle, label=\"B292\"];\nn83035118129643520[shape=rectangle, label=\"B293\"];\nn84723967989907456[shape=rectangle, label=\"B294\"];\nn84161018036486144[shape=rectangle, label=\"B295\"];\nn84442493013196800[shape=rectangle, label=\"B296\"];\nn82753643152932864[shape=rectangle, label=\"B297\"];\nn85286917943328768[shape=rectangle, label=\"B298\"];\nn85568392920039424[shape=rectangle, label=\"B299\"];\nn85005442966618112[shape=rectangle, label=\"B300\"];\nn86131342873460736[shape=rectangle, label=\"B301\"];\nn91197892454252544[shape=rectangle, label=\"B302\"];\nn86412817850171392[shape=rectangle, label=\"B303\"];\nn85849867896750080[shape=rectangle, label=\"B304\"];\nn86975767803592704[shape=rectangle, label=\"B305\"];\nn86694292826882048[shape=rectangle, label=\"B306\"];\nn87538717757014016[shape=rectangle, label=\"B307\"];\nn88101667710435328[shape=rectangle, label=\"B308\"];\nn87820192733724672[shape=rectangle, label=\"B309\"];\nn88946092640567296[shape=rectangle, label=\"B310\"];\nn91479367430963200[shape=rectangle, label=\"B311\"];\nn89227567617277952[shape=rectangle, label=\"B312\"];\nn89509042593988608[shape=rectangle, label=\"B313\"];\nn89790517570699264[shape=rectangle, label=\"B314\"];\nn88664617663856640[shape=rectangle, label=\"B315\"];\nn90071992547409920[shape=rectangle, label=\"B316\"];\nn90353467524120576[shape=rectangle, label=\"B317\"];\nn87257242780303360[shape=rectangle, label=\"B318\"];\nn90916417477541888[shape=rectangle, label=\"B319\"];\nn90634942500831232[shape=rectangle, label=\"B320\"];\nn88383142687145984[shape=rectangle, label=\"B321\"];\nn92042317384384512[shape=rectangle, label=\"B322\"];\nn91760842407673856[shape=rectangle, label=\"B323\"];\nn92323792361095168[shape=rectangle, label=\"B324\"];\nn92605267337805824[shape=rectangle, label=\"B325\"];\nn61924494876344320[shape=rectangle, label=\"B326\"];\nn83598068083064832[shape=rectangle, label=\"B327\"];\nn32088147345014784[shape=rectangle, label=\"B328\"];\nn92886742314516480[shape=rectangle, label=\"B329\"];\nn93449692267937792[shape=rectangle, label=\"B330\"];\nn94012642221359104[shape=rectangle, label=\"B331\"];\nn105834591243206656[shape=rectangle, label=\"B332\"];\nn94575592174780416[shape=rectangle, label=\"B333\"];\nn94857067151491072[shape=rectangle, label=\"B334\"];\nn94294117198069760[shape=rectangle, label=\"B335\"];\nn95701492081623040[shape=rectangle, label=\"B336\"];\nn103019841476100096[shape=rectangle, label=\"B337\"];\nn95420017104912384[shape=rectangle, label=\"B338\"];\nn96545917011755008[shape=rectangle, label=\"B339\"];\nn97108866965176320[shape=rectangle, label=\"B340\"];\nn96264442035044352[shape=rectangle, label=\"B341\"];\nn96827391988465664[shape=rectangle, label=\"B342\"];\nn97953291895308288[shape=rectangle, label=\"B343\"];\nn98234766872018944[shape=rectangle, label=\"B344\"];\nn97390341941886976[shape=rectangle, label=\"B345\"];\nn98797716825440256[shape=rectangle, label=\"B346\"];\nn98516241848729600[shape=rectangle, label=\"B347\"];\nn97671816918597632[shape=rectangle, label=\"B348\"];\nn99360666778861568[shape=rectangle, label=\"B349\"];\nn99642141755572224[shape=rectangle, label=\"B350\"];\nn101612466592546816[shape=rectangle, label=\"B351\"];\nn100205091708993536[shape=rectangle, label=\"B352\"];\nn100768041662414848[shape=rectangle, label=\"B353\"];\nn99923616732282880[shape=rectangle, label=\"B354\"];\nn100486566685704192[shape=rectangle, label=\"B355\"];\nn101049516639125504[shape=rectangle, label=\"B356\"];\nn101330991615836160[shape=rectangle, label=\"B357\"];\nn101893941569257472[shape=rectangle, label=\"B358\"];\nn99079191802150912[shape=rectangle, label=\"B359\"];\nn102175416545968128[shape=rectangle, label=\"B360\"];\nn102738366499389440[shape=rectangle, label=\"B361\"];\nn104145741382942720[shape=rectangle, label=\"B362\"];\nn102456891522678784[shape=rectangle, label=\"B363\"];\nn103301316452810752[shape=rectangle, label=\"B364\"];\nn103864266406232064[shape=rectangle, label=\"B365\"];\nn103582791429521408[shape=rectangle, label=\"B366\"];\nn95982967058333696[shape=rectangle, label=\"B367\"];\nn104708691336364032[shape=rectangle, label=\"B368\"];\nn104990166313074688[shape=rectangle, label=\"B369\"];\nn95138542128201728[shape=rectangle, label=\"B370\"];\nn104427216359653376[shape=rectangle, label=\"B371\"];\nn105553116266496000[shape=rectangle, label=\"B372\"];\nn106116066219917312[shape=rectangle, label=\"B373\"];\nn93168217291227136[shape=rectangle, label=\"B374\"];\nn105271641289785344[shape=rectangle, label=\"B375\"];\nn93731167244648448[shape=rectangle, label=\"B376\"];\nn121878664915714048[shape=rectangle, label=\"B377\"];\nn106679016173338624[shape=rectangle, label=\"B378\"];\nn106960491150049280[shape=rectangle, label=\"B379\"];\nn106397541196627968[shape=rectangle, label=\"B380\"];\nn107804916080181248[shape=rectangle, label=\"B381\"];\nn107523441103470592[shape=rectangle, label=\"B382\"];\nn108649341010313216[shape=rectangle, label=\"B383\"];\nn109212290963734528[shape=rectangle, label=\"B384\"];\nn108367866033602560[shape=rectangle, label=\"B385\"];\nn108930815987023872[shape=rectangle, label=\"B386\"];\nn110056715893866496[shape=rectangle, label=\"B387\"];\nn110338190870577152[shape=rectangle, label=\"B388\"];\nn109493765940445184[shape=rectangle, label=\"B389\"];\nn110619665847287808[shape=rectangle, label=\"B390\"];\nn110901140823998464[shape=rectangle, label=\"B391\"];\nn109775240917155840[shape=rectangle, label=\"B392\"];\nn111464090777419776[shape=rectangle, label=\"B393\"];\nn111745565754130432[shape=rectangle, label=\"B394\"];\nn115967690404790272[shape=rectangle, label=\"B395\"];\nn112308515707551744[shape=rectangle, label=\"B396\"];\nn112871465660973056[shape=rectangle, label=\"B397\"];\nn113434415614394368[shape=rectangle, label=\"B398\"];\nn113997365567815680[shape=rectangle, label=\"B399\"];\nn114560315521236992[shape=rectangle, label=\"B400\"];\nn115123265474658304[shape=rectangle, label=\"B401\"];\nn112027040730841088[shape=rectangle, label=\"B402\"];\nn112589990684262400[shape=rectangle, label=\"B403\"];\nn113152940637683712[shape=rectangle, label=\"B404\"];\nn113715890591105024[shape=rectangle, label=\"B405\"];\nn114278840544526336[shape=rectangle, label=\"B406\"];\nn114841790497947648[shape=rectangle, label=\"B407\"];\nn115404740451368960[shape=rectangle, label=\"B408\"];\nn115686215428079616[shape=rectangle, label=\"B409\"];\nn116249165381500928[shape=rectangle, label=\"B410\"];\nn111182615800709120[shape=rectangle, label=\"B411\"];\nn116530640358211584[shape=rectangle, label=\"B412\"];\nn117093590311632896[shape=rectangle, label=\"B413\"];\nn120471290032160768[shape=rectangle, label=\"B414\"];\nn116812115334922240[shape=rectangle, label=\"B415\"];\nn117375065288343552[shape=rectangle, label=\"B416\"];\nn117938015241764864[shape=rectangle, label=\"B417\"];\nn118500965195186176[shape=rectangle, label=\"B418\"];\nn119063915148607488[shape=rectangle, label=\"B419\"];\nn119626865102028800[shape=rectangle, label=\"B420\"];\nn120189815055450112[shape=rectangle, label=\"B421\"];\nn117656540265054208[shape=rectangle, label=\"B422\"];\nn118219490218475520[shape=rectangle, label=\"B423\"];\nn118782440171896832[shape=rectangle, label=\"B424\"];\nn119345390125318144[shape=rectangle, label=\"B425\"];\nn119908340078739456[shape=rectangle, label=\"B426\"];\nn108086391056891904[shape=rectangle, label=\"B427\"];\nn121034239985582080[shape=rectangle, label=\"B428\"];\nn121315714962292736[shape=rectangle, label=\"B429\"];\nn107241966126759936[shape=rectangle, label=\"B430\"];\nn120752765008871424[shape=rectangle, label=\"B431\"];\nn121597189939003392[shape=rectangle, label=\"B432\"];\nn122160139892424704[shape=rectangle, label=\"B433\"];\nn122441614869135360[shape=rectangle, label=\"B434\"];\nn123004564822556672[shape=rectangle, label=\"B435\"];\nn122723089845846016[shape=rectangle, label=\"B436\"];\nn123848989752688640[shape=rectangle, label=\"B437\"];\nn123567514775977984[shape=rectangle, label=\"B438\"];\nn124130464729399296[shape=rectangle, label=\"B439\"];\nn123286039799267328[shape=rectangle, label=\"B440\"];\nn124693414682820608[shape=rectangle, label=\"B441\"];\nn138485688541642752[shape=rectangle, label=\"B442\"];\nn124411939706109952[shape=rectangle, label=\"B443\"];\nn125537839612952576[shape=rectangle, label=\"B444\"];\nn126100789566373888[shape=rectangle, label=\"B445\"];\nn126382264543084544[shape=rectangle, label=\"B446\"];\nn125256364636241920[shape=rectangle, label=\"B447\"];\nn125819314589663232[shape=rectangle, label=\"B448\"];\nn127508164449927168[shape=rectangle, label=\"B449\"];\nn127789639426637824[shape=rectangle, label=\"B450\"];\nn127226689473216512[shape=rectangle, label=\"B451\"];\nn126663739519795200[shape=rectangle, label=\"B452\"];\nn126945214496505856[shape=rectangle, label=\"B453\"];\nn128352589380059136[shape=rectangle, label=\"B454\"];\nn128915539333480448[shape=rectangle, label=\"B455\"];\nn129478489286901760[shape=rectangle, label=\"B456\"];\nn130041439240323072[shape=rectangle, label=\"B457\"];\nn130604389193744384[shape=rectangle, label=\"B458\"];\nn131167339147165696[shape=rectangle, label=\"B459\"];\nn131730289100587008[shape=rectangle, label=\"B460\"];\nn132293239054008320[shape=rectangle, label=\"B461\"];\nn132856189007429632[shape=rectangle, label=\"B462\"];\nn133419138960850944[shape=rectangle, label=\"B463\"];\nn133982088914272256[shape=rectangle, label=\"B464\"];\nn134545038867693568[shape=rectangle, label=\"B465\"];\nn135107988821114880[shape=rectangle, label=\"B466\"];\nn135670938774536192[shape=rectangle, label=\"B467\"];\nn136233888727957504[shape=rectangle, label=\"B468\"];\nn136796838681378816[shape=rectangle, label=\"B469\"];\nn137359788634800128[shape=rectangle, label=\"B470\"];\nn137922738588221440[shape=rectangle, label=\"B471\"];\nn128634064356769792[shape=rectangle, label=\"B472\"];\nn129197014310191104[shape=rectangle, label=\"B473\"];\nn129759964263612416[shape=rectangle, label=\"B474\"];\nn130322914217033728[shape=rectangle, label=\"B475\"];\nn130885864170455040[shape=rectangle, label=\"B476\"];\nn131448814123876352[shape=rectangle, label=\"B477\"];\nn132011764077297664[shape=rectangle, label=\"B478\"];\nn132574714030718976[shape=rectangle, label=\"B479\"];\nn133137663984140288[shape=rectangle, label=\"B480\"];\nn133700613937561600[shape=rectangle, label=\"B481\"];\nn134263563890982912[shape=rectangle, label=\"B482\"];\nn134826513844404224[shape=rectangle, label=\"B483\"];\nn135389463797825536[shape=rectangle, label=\"B484\"];\nn135952413751246848[shape=rectangle, label=\"B485\"];\nn136515363704668160[shape=rectangle, label=\"B486\"];\nn137078313658089472[shape=rectangle, label=\"B487\"];\nn137641263611510784[shape=rectangle, label=\"B488\"];\nn138204213564932096[shape=rectangle, label=\"B489\"];\nn128071114403348480[shape=rectangle, label=\"B490\"];\nn138767163518353408[shape=rectangle, label=\"B491\"];\nn139048638495064064[shape=rectangle, label=\"B492\"];\nn139611588448485376[shape=rectangle, label=\"B493\"];\nn140174538401906688[shape=rectangle, label=\"B494\"];\nn140737488355328000[shape=rectangle, label=\"B495\"];\nn141300438308749312[shape=rectangle, label=\"B496\"];\nn141863388262170624[shape=rectangle, label=\"B497\"];\nn142426338215591936[shape=rectangle, label=\"B498\"];\nn142989288169013248[shape=rectangle, label=\"B499\"];\nn143552238122434560[shape=rectangle, label=\"B500\"];\nn144115188075855872[shape=rectangle, label=\"B501\"];\nn144678138029277184[shape=rectangle, label=\"B502\"];\nn145241087982698496[shape=rectangle, label=\"B503\"];\nn145804037936119808[shape=rectangle, label=\"B504\"];\nn146366987889541120[shape=rectangle, label=\"B505\"];\nn146929937842962432[shape=rectangle, label=\"B506\"];\nn147492887796383744[shape=rectangle, label=\"B507\"];\nn147774362773094400[shape=rectangle, label=\"B508\"];\nn139330113471774720[shape=rectangle, label=\"B509\"];\nn139893063425196032[shape=rectangle, label=\"B510\"];\nn140456013378617344[shape=rectangle, label=\"B511\"];\nn141018963332038656[shape=rectangle, label=\"B512\"];\nn141581913285459968[shape=rectangle, label=\"B513\"];\nn142144863238881280[shape=rectangle, label=\"B514\"];\nn142707813192302592[shape=rectangle, label=\"B515\"];\nn143270763145723904[shape=rectangle, label=\"B516\"];\nn143833713099145216[shape=rectangle, label=\"B517\"];\nn144396663052566528[shape=rectangle, label=\"B518\"];\nn144959613005987840[shape=rectangle, label=\"B519\"];\nn145522562959409152[shape=rectangle, label=\"B520\"];\nn146085512912830464[shape=rectangle, label=\"B521\"];\nn146648462866251776[shape=rectangle, label=\"B522\"];\nn147211412819673088[shape=rectangle, label=\"B523\"];\nn148055837749805056[shape=rectangle, label=\"B524\"];\nn124974889659531264[shape=rectangle, label=\"B525\"];\nn148618787703226368[shape=rectangle, label=\"B526\"];\nn148337312726515712[shape=rectangle, label=\"B527\"];\nn149181737656647680[shape=rectangle, label=\"B528\"];\nn149463212633358336[shape=rectangle, label=\"B529\"];\nn150026162586779648[shape=rectangle, label=\"B530\"];\nn150307637563490304[shape=rectangle, label=\"B531\"];\nn149744687610068992[shape=rectangle, label=\"B532\"];\nn150589112540200960[shape=rectangle, label=\"B533\"];\nn148900262679937024[shape=rectangle, label=\"B534\"];\nn151152062493622272[shape=rectangle, label=\"B535\"];\nn151433537470332928[shape=rectangle, label=\"B536\"];\nn150870587516911616[shape=rectangle, label=\"B537\"];\nn151996487423754240[shape=rectangle, label=\"B538\"];\nn151715012447043584[shape=rectangle, label=\"B539\"];\nn152840912353886208[shape=rectangle, label=\"B540\"];\nn153403862307307520[shape=rectangle, label=\"B541\"];\nn153122387330596864[shape=rectangle, label=\"B542\"];\nn153685337284018176[shape=rectangle, label=\"B543\"];\nn153966812260728832[shape=rectangle, label=\"B544\"];\nn154248287237439488[shape=rectangle, label=\"B545\"];\nn154529762214150144[shape=rectangle, label=\"B546\"];\nn154811237190860800[shape=rectangle, label=\"B547\"];\nn155092712167571456[shape=rectangle, label=\"B548\"];\nn152559437377175552[shape=rectangle, label=\"B549\"];\nn156500087051124736[shape=rectangle, label=\"B550\"];\nn155374187144282112[shape=rectangle, label=\"B551\"];\nn155655662120992768[shape=rectangle, label=\"B552\"];\nn155937137097703424[shape=rectangle, label=\"B553\"];\nn156218612074414080[shape=rectangle, label=\"B554\"];\nn156781562027835392[shape=rectangle, label=\"B555\"];\nn152277962400464896[shape=rectangle, label=\"B556\"];\nn157344511981256704[shape=rectangle, label=\"B557\"];\nn157907461934678016[shape=rectangle, label=\"B558\"];\nn157625986957967360[shape=rectangle, label=\"B559\"];\nn158470411888099328[shape=rectangle, label=\"B560\"];\nn157063037004546048[shape=rectangle, label=\"B561\"];\nn158188936911388672[shape=rectangle, label=\"B562\"];\nn159033361841520640[shape=rectangle, label=\"B563\"];\nn158751886864809984[shape=rectangle, label=\"B564\"];\nn159877786771652608[shape=rectangle, label=\"B565\"];\nn159596311794941952[shape=rectangle, label=\"B566\"];\nn160159261748363264[shape=rectangle, label=\"B567\"];\nn160722211701784576[shape=rectangle, label=\"B568\"];\nn161003686678495232[shape=rectangle, label=\"B569\"];\nn161285161655205888[shape=rectangle, label=\"B570\"];\nn160440736725073920[shape=rectangle, label=\"B571\"];\nn161848111608627200[shape=rectangle, label=\"B572\"];\nn161566636631916544[shape=rectangle, label=\"B573\"];\nn162129586585337856[shape=rectangle, label=\"B574\"];\nn162692536538759168[shape=rectangle, label=\"B575\"];\nn162974011515469824[shape=rectangle, label=\"B576\"];\nn163255486492180480[shape=rectangle, label=\"B577\"];\nn162411061562048512[shape=rectangle, label=\"B578\"];\nn163818436445601792[shape=rectangle, label=\"B579\"];\nn163536961468891136[shape=rectangle, label=\"B580\"];\nn164099911422312448[shape=rectangle, label=\"B581\"];\nn164662861375733760[shape=rectangle, label=\"B582\"];\nn164944336352444416[shape=rectangle, label=\"B583\"];\nn165225811329155072[shape=rectangle, label=\"B584\"];\nn164381386399023104[shape=rectangle, label=\"B585\"];\nn165788761282576384[shape=rectangle, label=\"B586\"];\nn165507286305865728[shape=rectangle, label=\"B587\"];\nn166070236259287040[shape=rectangle, label=\"B588\"];\nn166351711235997696[shape=rectangle, label=\"B589\"];\nn166633186212708352[shape=rectangle, label=\"B590\"];\nn166914661189419008[shape=rectangle, label=\"B591\"];\nn159314836818231296[shape=rectangle, label=\"B592\"];\nn167477611142840320[shape=rectangle, label=\"B593\"];\nn168040561096261632[shape=rectangle, label=\"B594\"];\nn167759086119550976[shape=rectangle, label=\"B595\"];\nn168603511049682944[shape=rectangle, label=\"B596\"];\nn168322036072972288[shape=rectangle, label=\"B597\"];\nn168884986026393600[shape=rectangle, label=\"B598\"];\nn169447935979814912[shape=rectangle, label=\"B599\"];\nn169729410956525568[shape=rectangle, label=\"B600\"];\nn170010885933236224[shape=rectangle, label=\"B601\"];\nn169166461003104256[shape=rectangle, label=\"B602\"];\nn170573835886657536[shape=rectangle, label=\"B603\"];\nn170292360909946880[shape=rectangle, label=\"B604\"];\nn170855310863368192[shape=rectangle, label=\"B605\"];\nn171418260816789504[shape=rectangle, label=\"B606\"];\nn171699735793500160[shape=rectangle, label=\"B607\"];\nn171981210770210816[shape=rectangle, label=\"B608\"];\nn171136785840078848[shape=rectangle, label=\"B609\"];\nn172544160723632128[shape=rectangle, label=\"B610\"];\nn172262685746921472[shape=rectangle, label=\"B611\"];\nn172825635700342784[shape=rectangle, label=\"B612\"];\nn173388585653764096[shape=rectangle, label=\"B613\"];\nn173670060630474752[shape=rectangle, label=\"B614\"];\nn173951535607185408[shape=rectangle, label=\"B615\"];\nn173107110677053440[shape=rectangle, label=\"B616\"];\nn174514485560606720[shape=rectangle, label=\"B617\"];\nn174233010583896064[shape=rectangle, label=\"B618\"];\nn174795960537317376[shape=rectangle, label=\"B619\"];\nn175077435514028032[shape=rectangle, label=\"B620\"];\nn175358910490738688[shape=rectangle, label=\"B621\"];\nn175640385467449344[shape=rectangle, label=\"B622\"];\nn167196136166129664[shape=rectangle, label=\"B623\"];\nn29273397577908224[shape=rectangle, label=\"B624\"];\nn176203335420870656[shape=rectangle, label=\"B625\"];\nn175921860444160000[shape=rectangle, label=\"B626\"];\nn176766285374291968[shape=rectangle, label=\"B627\"];\nn177329235327713280[shape=rectangle, label=\"B628\"];\nn177892185281134592[shape=rectangle, label=\"B629\"];\nn176484810397581312[shape=rectangle, label=\"B630\"];\nn177047760351002624[shape=rectangle, label=\"B631\"];\nn179018085187977216[shape=rectangle, label=\"B632\"];\nn177610710304423936[shape=rectangle, label=\"B633\"];\nn179862510118109184[shape=rectangle, label=\"B634\"];\nn178736610211266560[shape=rectangle, label=\"B635\"];\nn180706935048241152[shape=rectangle, label=\"B636\"];\nn179581035141398528[shape=rectangle, label=\"B637\"];\nn181269885001662464[shape=rectangle, label=\"B638\"];\nn181551359978373120[shape=rectangle, label=\"B639\"];\nn180143985094819840[shape=rectangle, label=\"B640\"];\nn181832834955083776[shape=rectangle, label=\"B641\"];\nn182114309931794432[shape=rectangle, label=\"B642\"];\nn178173660257845248[shape=rectangle, label=\"B643\"];\nn182395784908505088[shape=rectangle, label=\"B644\"];\nn182677259885215744[shape=rectangle, label=\"B645\"];\nn180425460071530496[shape=rectangle, label=\"B646\"];\nn182958734861926400[shape=rectangle, label=\"B647\"];\nn183240209838637056[shape=rectangle, label=\"B648\"];\nn180988410024951808[shape=rectangle, label=\"B649\"];\nn183521684815347712[shape=rectangle, label=\"B650\"];\nn183803159792058368[shape=rectangle, label=\"B651\"];\nn179299560164687872[shape=rectangle, label=\"B652\"];\nn184084634768769024[shape=rectangle, label=\"B653\"];\nn178455135234555904[shape=rectangle, label=\"B654\"];\nn184366109745479680[shape=rectangle, label=\"B655\"];\nn184929059698900992[shape=rectangle, label=\"B656\"];\nn185492009652322304[shape=rectangle, label=\"B657\"];\nn186054959605743616[shape=rectangle, label=\"B658\"];\nn184647584722190336[shape=rectangle, label=\"B659\"];\nn185210534675611648[shape=rectangle, label=\"B660\"];\nn185773484629032960[shape=rectangle, label=\"B661\"];\nn186899384535875584[shape=rectangle, label=\"B662\"];\nn186617909559164928[shape=rectangle, label=\"B663\"];\nn186336434582454272[shape=rectangle, label=\"B664\"];\nn187462334489296896[shape=rectangle, label=\"B665\"];\nn188025284442718208[shape=rectangle, label=\"B666\"];\nn188588234396139520[shape=rectangle, label=\"B667\"];\nn187180859512586240[shape=rectangle, label=\"B668\"];\nn187743809466007552[shape=rectangle, label=\"B669\"];\nn189714134302982144[shape=rectangle, label=\"B670\"];\nn188306759419428864[shape=rectangle, label=\"B671\"];\nn190558559233114112[shape=rectangle, label=\"B672\"];\nn189432659326271488[shape=rectangle, label=\"B673\"];\nn191402984163246080[shape=rectangle, label=\"B674\"];\nn190277084256403456[shape=rectangle, label=\"B675\"];\nn191965934116667392[shape=rectangle, label=\"B676\"];\nn192247409093378048[shape=rectangle, label=\"B677\"];\nn192528884070088704[shape=rectangle, label=\"B678\"];\nn190840034209824768[shape=rectangle, label=\"B679\"];\nn192810359046799360[shape=rectangle, label=\"B680\"];\nn193091834023510016[shape=rectangle, label=\"B681\"];\nn188869709372850176[shape=rectangle, label=\"B682\"];\nn193373309000220672[shape=rectangle, label=\"B683\"];\nn193654783976931328[shape=rectangle, label=\"B684\"];\nn191121509186535424[shape=rectangle, label=\"B685\"];\nn193936258953641984[shape=rectangle, label=\"B686\"];\nn194217733930352640[shape=rectangle, label=\"B687\"];\nn194499208907063296[shape=rectangle, label=\"B688\"];\nn191684459139956736[shape=rectangle, label=\"B689\"];\nn194780683883773952[shape=rectangle, label=\"B690\"];\nn195062158860484608[shape=rectangle, label=\"B691\"];\nn189995609279692800[shape=rectangle, label=\"B692\"];\nn195343633837195264[shape=rectangle, label=\"B693\"];\nn189151184349560832[shape=rectangle, label=\"B694\"];\nn195625108813905920[shape=rectangle, label=\"B695\"];\nn196188058767327232[shape=rectangle, label=\"B696\"];\nn196469533744037888[shape=rectangle, label=\"B697\"];\nn195906583790616576[shape=rectangle, label=\"B698\"];\nn197032483697459200[shape=rectangle, label=\"B699\"];\nn197313958674169856[shape=rectangle, label=\"B700\"];\nn196751008720748544[shape=rectangle, label=\"B701\"];\nn197876908627591168[shape=rectangle, label=\"B702\"];\nn198158383604301824[shape=rectangle, label=\"B703\"];\nn197595433650880512[shape=rectangle, label=\"B704\"];\nn198721333557723136[shape=rectangle, label=\"B705\"];\nn199002808534433792[shape=rectangle, label=\"B706\"];\nn198439858581012480[shape=rectangle, label=\"B707\"];\nn199565758487855104[shape=rectangle, label=\"B708\"];\nn199847233464565760[shape=rectangle, label=\"B709\"];\nn199284283511144448[shape=rectangle, label=\"B710\"];\nn200410183417987072[shape=rectangle, label=\"B711\"];\nn200691658394697728[shape=rectangle, label=\"B712\"];\nn200128708441276416[shape=rectangle, label=\"B713\"];\nn201254608348119040[shape=rectangle, label=\"B714\"];\nn201536083324829696[shape=rectangle, label=\"B715\"];\nn200973133371408384[shape=rectangle, label=\"B716\"];\nn202099033278251008[shape=rectangle, label=\"B717\"];\nn202380508254961664[shape=rectangle, label=\"B718\"];\nn201817558301540352[shape=rectangle, label=\"B719\"];\nn202943458208382976[shape=rectangle, label=\"B720\"];\nn203506408161804288[shape=rectangle, label=\"B721\"];\nn204069358115225600[shape=rectangle, label=\"B722\"];\nn204350833091936256[shape=rectangle, label=\"B723\"];\nn204632308068646912[shape=rectangle, label=\"B724\"];\nn205195258022068224[shape=rectangle, label=\"B725\"];\nn202661983231672320[shape=rectangle, label=\"B726\"];\nn206039682952200192[shape=rectangle, label=\"B727\"];\nn206602632905621504[shape=rectangle, label=\"B728\"];\nn206884107882332160[shape=rectangle, label=\"B729\"];\nn207447057835753472[shape=rectangle, label=\"B730\"];\nn208010007789174784[shape=rectangle, label=\"B731\"];\nn203224933185093632[shape=rectangle, label=\"B732\"];\nn208854432719306752[shape=rectangle, label=\"B733\"];\nn208572957742596096[shape=rectangle, label=\"B734\"];\nn209698857649438720[shape=rectangle, label=\"B735\"];\nn209980332626149376[shape=rectangle, label=\"B736\"];\nn210261807602860032[shape=rectangle, label=\"B737\"];\nn210824757556281344[shape=rectangle, label=\"B738\"];\nn209417382672728064[shape=rectangle, label=\"B739\"];\nn210543282579570688[shape=rectangle, label=\"B740\"];\nn211387707509702656[shape=rectangle, label=\"B741\"];\nn211106232532992000[shape=rectangle, label=\"B742\"];\nn211950657463123968[shape=rectangle, label=\"B743\"];\nn212232132439834624[shape=rectangle, label=\"B744\"];\nn211669182486413312[shape=rectangle, label=\"B745\"];\nn212513607416545280[shape=rectangle, label=\"B746\"];\nn209135907696017408[shape=rectangle, label=\"B747\"];\nn213076557369966592[shape=rectangle, label=\"B748\"];\nn203787883138514944[shape=rectangle, label=\"B749\"];\nn204913783045357568[shape=rectangle, label=\"B750\"];\nn213639507323387904[shape=rectangle, label=\"B751\"];\nn205476732998778880[shape=rectangle, label=\"B752\"];\nn214202457276809216[shape=rectangle, label=\"B753\"];\nn214483932253519872[shape=rectangle, label=\"B754\"];\nn214765407230230528[shape=rectangle, label=\"B755\"];\nn215328357183651840[shape=rectangle, label=\"B756\"];\nn213920982300098560[shape=rectangle, label=\"B757\"];\nn215046882206941184[shape=rectangle, label=\"B758\"];\nn215891307137073152[shape=rectangle, label=\"B759\"];\nn215609832160362496[shape=rectangle, label=\"B760\"];\nn212795082393255936[shape=rectangle, label=\"B761\"];\nn216454257090494464[shape=rectangle, label=\"B762\"];\nn216735732067205120[shape=rectangle, label=\"B763\"];\nn217298682020626432[shape=rectangle, label=\"B764\"];\nn217861631974047744[shape=rectangle, label=\"B765\"];\nn217580156997337088[shape=rectangle, label=\"B766\"];\nn217017207043915776[shape=rectangle, label=\"B767\"];\nn218143106950758400[shape=rectangle, label=\"B768\"];\nn216172782113783808[shape=rectangle, label=\"B769\"];\nn218706056904179712[shape=rectangle, label=\"B770\"];\nn218987531880890368[shape=rectangle, label=\"B771\"];\nn219550481834311680[shape=rectangle, label=\"B772\"];\nn220113431787732992[shape=rectangle, label=\"B773\"];\nn219831956811022336[shape=rectangle, label=\"B774\"];\nn219269006857601024[shape=rectangle, label=\"B775\"];\nn220394906764443648[shape=rectangle, label=\"B776\"];\nn218424581927469056[shape=rectangle, label=\"B777\"];\nn220676381741154304[shape=rectangle, label=\"B778\"];\nn220957856717864960[shape=rectangle, label=\"B779\"];\nn221520806671286272[shape=rectangle, label=\"B780\"];\nn222083756624707584[shape=rectangle, label=\"B781\"];\nn221802281647996928[shape=rectangle, label=\"B782\"];\nn221239331694575616[shape=rectangle, label=\"B783\"];\nn222365231601418240[shape=rectangle, label=\"B784\"];\nn213358032346677248[shape=rectangle, label=\"B785\"];\nn222928181554839552[shape=rectangle, label=\"B786\"];\nn223209656531550208[shape=rectangle, label=\"B787\"];\nn223491131508260864[shape=rectangle, label=\"B788\"];\nn223772606484971520[shape=rectangle, label=\"B789\"];\nn224054081461682176[shape=rectangle, label=\"B790\"];\nn224335556438392832[shape=rectangle, label=\"B791\"];\nn224617031415103488[shape=rectangle, label=\"B792\"];\nn224898506391814144[shape=rectangle, label=\"B793\"];\nn225179981368524800[shape=rectangle, label=\"B794\"];\nn225461456345235456[shape=rectangle, label=\"B795\"];\nn222646706578128896[shape=rectangle, label=\"B796\"];\nn207728532812464128[shape=rectangle, label=\"B797\"];\nn207165582859042816[shape=rectangle, label=\"B798\"];\nn208291482765885440[shape=rectangle, label=\"B799\"];\nn206321157928910848[shape=rectangle, label=\"B800\"];\nn226587356252078080[shape=rectangle, label=\"B801\"];\nn226868831228788736[shape=rectangle, label=\"B802\"];\nn227431781182210048[shape=rectangle, label=\"B803\"];\nn227994731135631360[shape=rectangle, label=\"B804\"];\nn227713256158920704[shape=rectangle, label=\"B805\"];\nn227150306205499392[shape=rectangle, label=\"B806\"];\nn228276206112342016[shape=rectangle, label=\"B807\"];\nn226305881275367424[shape=rectangle, label=\"B808\"];\nn228557681089052672[shape=rectangle, label=\"B809\"];\nn228839156065763328[shape=rectangle, label=\"B810\"];\nn229402106019184640[shape=rectangle, label=\"B811\"];\nn229965055972605952[shape=rectangle, label=\"B812\"];\nn229683580995895296[shape=rectangle, label=\"B813\"];\nn229120631042473984[shape=rectangle, label=\"B814\"];\nn230246530949316608[shape=rectangle, label=\"B815\"];\nn205758207975489536[shape=rectangle, label=\"B816\"];\nn230809480902737920[shape=rectangle, label=\"B817\"];\nn231090955879448576[shape=rectangle, label=\"B818\"];\nn231372430856159232[shape=rectangle, label=\"B819\"];\nn231653905832869888[shape=rectangle, label=\"B820\"];\nn231935380809580544[shape=rectangle, label=\"B821\"];\nn232216855786291200[shape=rectangle, label=\"B822\"];\nn232498330763001856[shape=rectangle, label=\"B823\"];\nn232779805739712512[shape=rectangle, label=\"B824\"];\nn230528005926027264[shape=rectangle, label=\"B825\"];\nn226024406298656768[shape=rectangle, label=\"B826\"];\nn225742931321946112[shape=rectangle, label=\"B827\"];\nn233061280716423168[shape=rectangle, label=\"B828\"];\nn233624230669844480[shape=rectangle, label=\"B829\"];\nn233905705646555136[shape=rectangle, label=\"B830\"];\nn234187180623265792[shape=rectangle, label=\"B831\"];\nn233342755693133824[shape=rectangle, label=\"B832\"];\nn234468655599976448[shape=rectangle, label=\"B833\"];\nn235031605553397760[shape=rectangle, label=\"B834\"];\nn235594555506819072[shape=rectangle, label=\"B835\"];\nn235313080530108416[shape=rectangle, label=\"B836\"];\nn236438980436951040[shape=rectangle, label=\"B837\"];\nn236157505460240384[shape=rectangle, label=\"B838\"];\nn237283405367083008[shape=rectangle, label=\"B839\"];\nn237001930390372352[shape=rectangle, label=\"B840\"];\nn237846355320504320[shape=rectangle, label=\"B841\"];\nn238127830297214976[shape=rectangle, label=\"B842\"];\nn237564880343793664[shape=rectangle, label=\"B843\"];\nn238409305273925632[shape=rectangle, label=\"B844\"];\nn238690780250636288[shape=rectangle, label=\"B845\"];\nn236720455413661696[shape=rectangle, label=\"B846\"];\nn238972255227346944[shape=rectangle, label=\"B847\"];\nn239253730204057600[shape=rectangle, label=\"B848\"];\nn239535205180768256[shape=rectangle, label=\"B849\"];\nn235876030483529728[shape=rectangle, label=\"B850\"];\nn240098155134189568[shape=rectangle, label=\"B851\"];\nn239816680157478912[shape=rectangle, label=\"B852\"];\nn240942580064321536[shape=rectangle, label=\"B853\"];\nn240661105087610880[shape=rectangle, label=\"B854\"];\nn241787004994453504[shape=rectangle, label=\"B855\"];\nn241505530017742848[shape=rectangle, label=\"B856\"];\nn242349954947874816[shape=rectangle, label=\"B857\"];\nn242631429924585472[shape=rectangle, label=\"B858\"];\nn242068479971164160[shape=rectangle, label=\"B859\"];\nn242912904901296128[shape=rectangle, label=\"B860\"];\nn243194379878006784[shape=rectangle, label=\"B861\"];\nn241224055041032192[shape=rectangle, label=\"B862\"];\nn243475854854717440[shape=rectangle, label=\"B863\"];\nn243757329831428096[shape=rectangle, label=\"B864\"];\nn244038804808138752[shape=rectangle, label=\"B865\"];\nn240379630110900224[shape=rectangle, label=\"B866\"];\nn244601754761560064[shape=rectangle, label=\"B867\"];\nn244320279784849408[shape=rectangle, label=\"B868\"];\nn245446179691692032[shape=rectangle, label=\"B869\"];\nn245164704714981376[shape=rectangle, label=\"B870\"];\nn246290604621824000[shape=rectangle, label=\"B871\"];\nn246009129645113344[shape=rectangle, label=\"B872\"];\nn246853554575245312[shape=rectangle, label=\"B873\"];\nn247135029551955968[shape=rectangle, label=\"B874\"];\nn246572079598534656[shape=rectangle, label=\"B875\"];\nn247416504528666624[shape=rectangle, label=\"B876\"];\nn247697979505377280[shape=rectangle, label=\"B877\"];\nn245727654668402688[shape=rectangle, label=\"B878\"];\nn247979454482087936[shape=rectangle, label=\"B879\"];\nn248260929458798592[shape=rectangle, label=\"B880\"];\nn248542404435509248[shape=rectangle, label=\"B881\"];\nn244883229738270720[shape=rectangle, label=\"B882\"];\nn249105354388930560[shape=rectangle, label=\"B883\"];\nn248823879412219904[shape=rectangle, label=\"B884\"];\nn249668304342351872[shape=rectangle, label=\"B885\"];\nn249386829365641216[shape=rectangle, label=\"B886\"];\nn250512729272483840[shape=rectangle, label=\"B887\"];\nn250231254295773184[shape=rectangle, label=\"B888\"];\nn251075679225905152[shape=rectangle, label=\"B889\"];\nn251357154202615808[shape=rectangle, label=\"B890\"];\nn250794204249194496[shape=rectangle, label=\"B891\"];\nn251638629179326464[shape=rectangle, label=\"B892\"];\nn251920104156037120[shape=rectangle, label=\"B893\"];\nn249949779319062528[shape=rectangle, label=\"B894\"];\nn252201579132747776[shape=rectangle, label=\"B895\"];\nn252483054109458432[shape=rectangle, label=\"B896\"];\nn252764529086169088[shape=rectangle, label=\"B897\"];\nn234750130576687104[shape=rectangle, label=\"B898\"];\nn253046004062879744[shape=rectangle, label=\"B899\"];\nn253608954016301056[shape=rectangle, label=\"B900\"];\nn253890428993011712[shape=rectangle, label=\"B901\"];\nn254171903969722368[shape=rectangle, label=\"B902\"];\nn253327479039590400[shape=rectangle, label=\"B903\"];\nn254453378946433024[shape=rectangle, label=\"B904\"];\nn255016328899854336[shape=rectangle, label=\"B905\"];\nn255579278853275648[shape=rectangle, label=\"B906\"];\nn255297803876564992[shape=rectangle, label=\"B907\"];\nn256423703783407616[shape=rectangle, label=\"B908\"];\nn256142228806696960[shape=rectangle, label=\"B909\"];\nn257268128713539584[shape=rectangle, label=\"B910\"];\nn256986653736828928[shape=rectangle, label=\"B911\"];\nn257831078666960896[shape=rectangle, label=\"B912\"];\nn258112553643671552[shape=rectangle, label=\"B913\"];\nn257549603690250240[shape=rectangle, label=\"B914\"];\nn258394028620382208[shape=rectangle, label=\"B915\"];\nn258675503597092864[shape=rectangle, label=\"B916\"];\nn256705178760118272[shape=rectangle, label=\"B917\"];\nn258956978573803520[shape=rectangle, label=\"B918\"];\nn259238453550514176[shape=rectangle, label=\"B919\"];\nn259519928527224832[shape=rectangle, label=\"B920\"];\nn255860753829986304[shape=rectangle, label=\"B921\"];\nn260082878480646144[shape=rectangle, label=\"B922\"];\nn259801403503935488[shape=rectangle, label=\"B923\"];\nn260927303410778112[shape=rectangle, label=\"B924\"];\nn260645828434067456[shape=rectangle, label=\"B925\"];\nn261771728340910080[shape=rectangle, label=\"B926\"];\nn261490253364199424[shape=rectangle, label=\"B927\"];\nn262334678294331392[shape=rectangle, label=\"B928\"];\nn262616153271042048[shape=rectangle, label=\"B929\"];\nn262053203317620736[shape=rectangle, label=\"B930\"];\nn262897628247752704[shape=rectangle, label=\"B931\"];\nn263179103224463360[shape=rectangle, label=\"B932\"];\nn261208778387488768[shape=rectangle, label=\"B933\"];\nn263460578201174016[shape=rectangle, label=\"B934\"];\nn263742053177884672[shape=rectangle, label=\"B935\"];\nn264023528154595328[shape=rectangle, label=\"B936\"];\nn260364353457356800[shape=rectangle, label=\"B937\"];\nn264586478108016640[shape=rectangle, label=\"B938\"];\nn264305003131305984[shape=rectangle, label=\"B939\"];\nn265149428061437952[shape=rectangle, label=\"B940\"];\nn264867953084727296[shape=rectangle, label=\"B941\"];\nn265993852991569920[shape=rectangle, label=\"B942\"];\nn265712378014859264[shape=rectangle, label=\"B943\"];\nn266556802944991232[shape=rectangle, label=\"B944\"];\nn266838277921701888[shape=rectangle, label=\"B945\"];\nn266275327968280576[shape=rectangle, label=\"B946\"];\nn267119752898412544[shape=rectangle, label=\"B947\"];\nn267401227875123200[shape=rectangle, label=\"B948\"];\nn265430903038148608[shape=rectangle, label=\"B949\"];\nn267682702851833856[shape=rectangle, label=\"B950\"];\nn267964177828544512[shape=rectangle, label=\"B951\"];\nn268245652805255168[shape=rectangle, label=\"B952\"];\nn254734853923143680[shape=rectangle, label=\"B953\"];\nn268527127781965824[shape=rectangle, label=\"B954\"];\nn269090077735387136[shape=rectangle, label=\"B955\"];\nn269653027688808448[shape=rectangle, label=\"B956\"];\nn269371552712097792[shape=rectangle, label=\"B957\"];\nn268808602758676480[shape=rectangle, label=\"B958\"];\nn270215977642229760[shape=rectangle, label=\"B959\"];\nn271060402572361728[shape=rectangle, label=\"B960\"];\nn270497452618940416[shape=rectangle, label=\"B961\"];\nn270778927595651072[shape=rectangle, label=\"B962\"];\nn271341877549072384[shape=rectangle, label=\"B963\"];\nn269934502665519104[shape=rectangle, label=\"B964\"];\nn271904827502493696[shape=rectangle, label=\"B965\"];\nn272467777455915008[shape=rectangle, label=\"B966\"];\nn273030727409336320[shape=rectangle, label=\"B967\"];\nn275001052246310912[shape=rectangle, label=\"B968\"];\nn272749252432625664[shape=rectangle, label=\"B969\"];\nn273875152339468288[shape=rectangle, label=\"B970\"];\nn274156627316178944[shape=rectangle, label=\"B971\"];\nn274438102292889600[shape=rectangle, label=\"B972\"];\nn274719577269600256[shape=rectangle, label=\"B973\"];\nn273593677362757632[shape=rectangle, label=\"B974\"];\nn275282527223021568[shape=rectangle, label=\"B975\"];\nn275564002199732224[shape=rectangle, label=\"B976\"];\nn275845477176442880[shape=rectangle, label=\"B977\"];\nn271623352525783040[shape=rectangle, label=\"B978\"];\nn276408427129864192[shape=rectangle, label=\"B979\"];\nn276971377083285504[shape=rectangle, label=\"B980\"];\nn277252852059996160[shape=rectangle, label=\"B981\"];\nn277534327036706816[shape=rectangle, label=\"B982\"];\nn276126952153153536[shape=rectangle, label=\"B983\"];\nn277815802013417472[shape=rectangle, label=\"B984\"];\nn278097276990128128[shape=rectangle, label=\"B985\"];\nn273312202386046976[shape=rectangle, label=\"B986\"];\nn278660226943549440[shape=rectangle, label=\"B987\"];\nn272186302479204352[shape=rectangle, label=\"B988\"];\nn278378751966838784[shape=rectangle, label=\"B989\"];\nn276689902106574848[shape=rectangle, label=\"B990\"];\nn278941701920260096[shape=rectangle, label=\"B991\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n844424930131968;\nn281474976710656 -> n844424930131968;\nn844424930131968 -> n1125899906842624;\nn844424930131968 -> n1407374883553280;\nn1407374883553280 -> n1125899906842624;\nn1407374883553280 -> n1688849860263936;\nn1688849860263936 -> n1125899906842624;\nn1688849860263936 -> n1970324836974592;\nn1970324836974592 -> n1125899906842624;\nn1970324836974592 -> n2251799813685248;\nn2251799813685248 -> n1125899906842624;\nn2251799813685248 -> n2533274790395904;\nn2533274790395904 -> n1125899906842624;\nn2533274790395904 -> n2814749767106560;\nn2814749767106560 -> n1125899906842624;\nn2814749767106560 -> n3096224743817216;\nn3096224743817216 -> n1125899906842624;\nn3096224743817216 -> n3377699720527872;\nn3377699720527872 -> n1125899906842624;\nn3377699720527872 -> n3659174697238528;\nn3659174697238528 -> n1125899906842624;\nn3659174697238528 -> n3940649673949184;\nn3940649673949184 -> n1125899906842624;\nn3940649673949184 -> n4222124650659840;\nn4222124650659840 -> n1125899906842624;\nn4222124650659840 -> n4503599627370496;\nn4503599627370496 -> n1125899906842624;\nn4503599627370496 -> n4785074604081152;\nn4785074604081152 -> n1125899906842624;\nn4785074604081152 -> n5066549580791808;\nn5066549580791808 -> n1125899906842624;\nn5066549580791808 -> n5348024557502464;\nn5348024557502464 -> n5629499534213120;\nn5348024557502464 -> n1125899906842624;\nn1125899906842624 -> n5910974510923776;\nn1125899906842624 -> n6192449487634432;\nn6192449487634432 -> n6473924464345088;\nn6192449487634432 -> n6755399441055744;\nn6755399441055744 -> n7036874417766400;\nn6755399441055744 -> n7318349394477056;\nn7318349394477056 -> n7599824371187712;\nn7318349394477056 -> n7881299347898368;\nn7881299347898368 -> n8162774324609024;\nn6473924464345088 -> n7599824371187712;\nn7036874417766400 -> n8444249301319680;\nn8725724278030336 -> n11540474045136896;\nn11540474045136896 -> n9007199254740992;\nn11540474045136896 -> n8444249301319680;\nn8444249301319680 -> n9288674231451648;\nn8444249301319680 -> n9570149208162304;\nn9570149208162304 -> n9288674231451648;\nn9288674231451648 -> n8725724278030336[style=dashed];\nn9288674231451648 -> n9851624184872960;\nn9851624184872960 -> n10133099161583616;\nn9851624184872960 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10133099161583616;\nn10133099161583616 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n11540474045136896;\nn11258999068426240 -> n11821949021847552;\nn11821949021847552 -> n9007199254740992;\nn10977524091715584 -> n11540474045136896;\nn9007199254740992 -> n8162774324609024;\nn9007199254740992 -> n7599824371187712;\nn7599824371187712 -> n8162774324609024;\nn7599824371187712 -> n12103423998558208;\nn12103423998558208 -> n12384898975268864;\nn12103423998558208 -> n12666373951979520;\nn12666373951979520 -> n12384898975268864;\nn12384898975268864 -> n8162774324609024;\nn12384898975268864 -> n12947848928690176;\nn12947848928690176 -> n13229323905400832;\nn12947848928690176 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn13792273858822144 -> n14636698788954112;\nn14636698788954112 -> n14636698788954112[style=dashed];\nn14636698788954112 -> n14918173765664768;\nn14918173765664768 -> n13229323905400832;\nn14918173765664768 -> n14355223812243456;\nn14355223812243456 -> n15199648742375424;\nn15199648742375424 -> n15199648742375424[style=dashed];\nn15199648742375424 -> n13229323905400832;\nn13229323905400832 -> n15481123719086080;\nn13229323905400832 -> n15762598695796736;\nn15762598695796736 -> n16044073672507392;\nn15762598695796736 -> n16325548649218048;\nn16325548649218048 -> n16607023625928704;\nn16044073672507392 -> n16888498602639360;\nn16888498602639360 -> n16888498602639360[style=dashed];\nn16888498602639360 -> n17169973579350016;\nn17169973579350016 -> n15481123719086080;\nn17169973579350016 -> n16607023625928704;\nn16607023625928704 -> n17451448556060672;\nn17451448556060672 -> n17451448556060672[style=dashed];\nn17451448556060672 -> n15481123719086080;\nn15481123719086080 -> n8162774324609024;\nn8162774324609024 -> n17732923532771328;\nn8162774324609024 -> n18014398509481984;\nn18014398509481984 -> n5910974510923776;\nn18014398509481984 -> n18295873486192640;\nn18295873486192640 -> n18577348462903296;\nn18295873486192640 -> n18858823439613952;\nn18858823439613952 -> n19140298416324608;\nn5910974510923776 -> n19140298416324608;\nn19140298416324608 -> n19421773393035264;\nn19421773393035264 -> n18577348462903296;\nn18577348462903296 -> n25895697857380352;\nn17732923532771328 -> n19421773393035264;\nn5629499534213120 -> n19703248369745920;\nn5629499534213120 -> n19984723346456576;\nn19984723346456576 -> n19703248369745920;\nn19984723346456576 -> n20266198323167232;\nn20266198323167232 -> n20547673299877888;\nn20266198323167232 -> n20829148276588544;\nn20829148276588544 -> n20547673299877888;\nn20547673299877888 -> n19703248369745920;\nn20547673299877888 -> n21110623253299200;\nn21110623253299200 -> n21392098230009856;\nn21110623253299200 -> n21673573206720512;\nn21673573206720512 -> n21955048183431168;\nn21673573206720512 -> n22236523160141824;\nn22236523160141824 -> n22517998136852480;\nn21955048183431168 -> n22799473113563136;\nn22799473113563136 -> n22799473113563136[style=dashed];\nn22799473113563136 -> n23080948090273792;\nn23080948090273792 -> n21392098230009856;\nn23080948090273792 -> n22517998136852480;\nn22517998136852480 -> n23362423066984448;\nn23362423066984448 -> n23362423066984448[style=dashed];\nn23362423066984448 -> n21392098230009856;\nn21392098230009856 -> n23643898043695104;\nn21392098230009856 -> n23925373020405760;\nn23925373020405760 -> n24206847997116416;\nn23925373020405760 -> n24488322973827072;\nn24488322973827072 -> n24769797950537728;\nn24206847997116416 -> n25051272927248384;\nn25051272927248384 -> n25051272927248384[style=dashed];\nn25051272927248384 -> n25332747903959040;\nn25332747903959040 -> n23643898043695104;\nn25332747903959040 -> n24769797950537728;\nn24769797950537728 -> n25614222880669696;\nn25614222880669696 -> n25614222880669696[style=dashed];\nn25614222880669696 -> n23643898043695104;\nn23643898043695104 -> n19703248369745920;\nn19703248369745920 -> n25895697857380352;\nn26177172834091008 -> n26458647810801664;\nn26177172834091008 -> n26740122787512320;\nn26740122787512320 -> n27021597764222976;\nn26740122787512320 -> n27303072740933632;\nn27303072740933632 -> n28991922601197568;\nn28991922601197568 -> n27584547717644288;\nn28991922601197568 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn27866022694354944 -> n28428972647776256;\nn28428972647776256 -> n27584547717644288;\nn28428972647776256 -> n28710447624486912;\nn28710447624486912 -> n28991922601197568;\nn28710447624486912 -> n27021597764222976;\nn27021597764222976 -> n29273397577908224;\nn26458647810801664 -> n29554872554618880;\nn26458647810801664 -> n29836347531329536;\nn29836347531329536 -> n30117822508040192;\nn29836347531329536 -> n30399297484750848;\nn30399297484750848 -> n31806672368304128;\nn31806672368304128 -> n28147497671065600;\nn31806672368304128 -> n30680772461461504;\nn30680772461461504 -> n28147497671065600;\nn30680772461461504 -> n30962247438172160;\nn30962247438172160 -> n28147497671065600;\nn30962247438172160 -> n31243722414882816;\nn31243722414882816 -> n28147497671065600;\nn31243722414882816 -> n31525197391593472;\nn31525197391593472 -> n31806672368304128;\nn31525197391593472 -> n30117822508040192;\nn30117822508040192 -> n32088147345014784;\nn29554872554618880 -> n32369622321725440;\nn29554872554618880 -> n32651097298436096;\nn32651097298436096 -> n32932572275146752;\nn27584547717644288 -> n32369622321725440;\nn27584547717644288 -> n33214047251857408;\nn33214047251857408 -> n32932572275146752;\nn28147497671065600 -> n32932572275146752;\nn28147497671065600 -> n32369622321725440;\nn32369622321725440 -> n33495522228568064;\nn32369622321725440 -> n33776997205278720;\nn33776997205278720 -> n34058472181989376;\nn33495522228568064 -> n34339947158700032;\nn33495522228568064 -> n34621422135410688;\nn34621422135410688 -> n34902897112121344;\nn34339947158700032 -> n35184372088832000;\nn35184372088832000 -> n35184372088832000[style=dashed];\nn35184372088832000 -> n35465847065542656;\nn35465847065542656 -> n32932572275146752;\nn35465847065542656 -> n35747322042253312;\nn35747322042253312 -> n34058472181989376;\nn35747322042253312 -> n34902897112121344;\nn34902897112121344 -> n36028797018963968;\nn36028797018963968 -> n36028797018963968[style=dashed];\nn36028797018963968 -> n36310271995674624;\nn36310271995674624 -> n32932572275146752;\nn36310271995674624 -> n34058472181989376;\nn34058472181989376 -> n36591746972385280;\nn36591746972385280 -> n36591746972385280[style=dashed];\nn36591746972385280 -> n32932572275146752;\nn32932572275146752 -> n36873221949095936;\nn32932572275146752 -> n37154696925806592;\nn37154696925806592 -> n36873221949095936;\nn37154696925806592 -> n37436171902517248;\nn37436171902517248 -> n36873221949095936;\nn36873221949095936 -> n37717646879227904;\nn36873221949095936 -> n37999121855938560;\nn37999121855938560 -> n37717646879227904;\nn37999121855938560 -> n38280596832649216;\nn38280596832649216 -> n37717646879227904;\nn37717646879227904 -> n38562071809359872;\nn37717646879227904 -> n38843546786070528;\nn38843546786070528 -> n38562071809359872;\nn38843546786070528 -> n39125021762781184;\nn39125021762781184 -> n38562071809359872;\nn38562071809359872 -> n39406496739491840;\nn38562071809359872 -> n39687971716202496;\nn39687971716202496 -> n39406496739491840;\nn39687971716202496 -> n39969446692913152;\nn39969446692913152 -> n39406496739491840;\nn39406496739491840 -> n40250921669623808;\nn39406496739491840 -> n40532396646334464;\nn40532396646334464 -> n40813871623045120;\nn40532396646334464 -> n41095346599755776;\nn41095346599755776 -> n41376821576466432;\nn41095346599755776 -> n41658296553177088;\nn41658296553177088 -> n41376821576466432;\nn41376821576466432 -> n41939771529887744;\nn41376821576466432 -> n42221246506598400;\nn42221246506598400 -> n42502721483309056;\nn42784196460019712 -> n41939771529887744;\nn42784196460019712 -> n42502721483309056;\nn42502721483309056 -> n42784196460019712;\nn42502721483309056 -> n43065671436730368;\nn43065671436730368 -> n42784196460019712;\nn40250921669623808 -> n43347146413441024;\nn40250921669623808 -> n43628621390151680;\nn43628621390151680 -> n43910096366862336;\nn43628621390151680 -> n44191571343572992;\nn44191571343572992 -> n44473046320283648;\nn40813871623045120 -> n41939771529887744;\nn41939771529887744 -> n44754521296994304;\nn41939771529887744 -> n45035996273704960;\nn45035996273704960 -> n44754521296994304;\nn43347146413441024 -> n45317471250415616;\nn43910096366862336 -> n45598946227126272;\nn45598946227126272 -> n45598946227126272[style=dashed];\nn45598946227126272 -> n45880421203836928;\nn45880421203836928 -> n44473046320283648;\nn44473046320283648 -> n46161896180547584;\nn46161896180547584 -> n46161896180547584[style=dashed];\nn46161896180547584 -> n45317471250415616;\nn45317471250415616 -> n46443371157258240;\nn45317471250415616 -> n46724846133968896;\nn46724846133968896 -> n46443371157258240;\nn46443371157258240 -> n47006321110679552;\nn46443371157258240 -> n47287796087390208;\nn47287796087390208 -> n47006321110679552;\nn47006321110679552 -> n47569271064100864;\nn47006321110679552 -> n47850746040811520;\nn47850746040811520 -> n47569271064100864;\nn47569271064100864 -> n48132221017522176;\nn47569271064100864 -> n48413695994232832;\nn48413695994232832 -> n44754521296994304;\nn48132221017522176 -> n44754521296994304;\nn44754521296994304 -> n48695170970943488;\nn44754521296994304 -> n48976645947654144;\nn48976645947654144 -> n48695170970943488;\nn48976645947654144 -> n49258120924364800;\nn49258120924364800 -> n48695170970943488;\nn48695170970943488 -> n49539595901075456;\nn48695170970943488 -> n49821070877786112;\nn49821070877786112 -> n50102545854496768;\nn49821070877786112 -> n50384020831207424;\nn50384020831207424 -> n50665495807918080;\nn49539595901075456 -> n50946970784628736;\nn50102545854496768 -> n51228445761339392;\nn50102545854496768 -> n51509920738050048;\nn51509920738050048 -> n51791395714760704;\nn51228445761339392 -> n52072870691471360;\nn52072870691471360 -> n52072870691471360[style=dashed];\nn52072870691471360 -> n52354345668182016;\nn52354345668182016 -> n52635820644892672;\nn52354345668182016 -> n52917295621603328;\nn52917295621603328 -> n50946970784628736;\nn52635820644892672 -> n50665495807918080;\nn52635820644892672 -> n51791395714760704;\nn51791395714760704 -> n53198770598313984;\nn53198770598313984 -> n53198770598313984[style=dashed];\nn53198770598313984 -> n53480245575024640;\nn53480245575024640 -> n50946970784628736;\nn53480245575024640 -> n50665495807918080;\nn50665495807918080 -> n53761720551735296;\nn53761720551735296 -> n53761720551735296[style=dashed];\nn53761720551735296 -> n50946970784628736;\nn50946970784628736 -> n54043195528445952;\nn50946970784628736 -> n54324670505156608;\nn54324670505156608 -> n54043195528445952;\nn54324670505156608 -> n54606145481867264;\nn54606145481867264 -> n54043195528445952;\nn54043195528445952 -> n54887620458577920;\nn54043195528445952 -> n55169095435288576;\nn55169095435288576 -> n54887620458577920;\nn55169095435288576 -> n55450570411999232;\nn55450570411999232 -> n54887620458577920;\nn54887620458577920 -> n55732045388709888;\nn54887620458577920 -> n56013520365420544;\nn56013520365420544 -> n55732045388709888;\nn56013520365420544 -> n56294995342131200;\nn56294995342131200 -> n55732045388709888;\nn55732045388709888 -> n56576470318841856;\nn55732045388709888 -> n56857945295552512;\nn56857945295552512 -> n56576470318841856;\nn56857945295552512 -> n57139420272263168;\nn57139420272263168 -> n56576470318841856;\nn56576470318841856 -> n57420895248973824;\nn56576470318841856 -> n57702370225684480;\nn57702370225684480 -> n57420895248973824;\nn57702370225684480 -> n57983845202395136;\nn57983845202395136 -> n57420895248973824;\nn57420895248973824 -> n58265320179105792;\nn57420895248973824 -> n58546795155816448;\nn58546795155816448 -> n58265320179105792;\nn58546795155816448 -> n58828270132527104;\nn58828270132527104 -> n58265320179105792;\nn58265320179105792 -> n59109745109237760;\nn58265320179105792 -> n59391220085948416;\nn59391220085948416 -> n59109745109237760;\nn59391220085948416 -> n59672695062659072;\nn59672695062659072 -> n59109745109237760;\nn59109745109237760 -> n59954170039369728;\nn59109745109237760 -> n60235645016080384;\nn60235645016080384 -> n59954170039369728;\nn60235645016080384 -> n60517119992791040;\nn60517119992791040 -> n59954170039369728;\nn59954170039369728 -> n60798594969501696;\nn59954170039369728 -> n61080069946212352;\nn61080069946212352 -> n61361544922923008;\nn61080069946212352 -> n61643019899633664;\nn61643019899633664 -> n61924494876344320;\nn60798594969501696 -> n61924494876344320;\nn60798594969501696 -> n61361544922923008;\nn61361544922923008 -> n62205969853054976;\nn61361544922923008 -> n62487444829765632;\nn62487444829765632 -> n62768919806476288;\nn62487444829765632 -> n63050394783186944;\nn63050394783186944 -> n63331869759897600;\nn62768919806476288 -> n63331869759897600;\nn63331869759897600 -> n61924494876344320;\nn63331869759897600 -> n62205969853054976;\nn62205969853054976 -> n63613344736608256;\nn62205969853054976 -> n63894819713318912;\nn63894819713318912 -> n64176294690029568;\nn63894819713318912 -> n64457769666740224;\nn64457769666740224 -> n64739244643450880;\nn64457769666740224 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn64176294690029568 -> n65583669573582848;\nn64739244643450880 -> n65865144550293504;\nn64739244643450880 -> n66146619527004160;\nn66146619527004160 -> n66428094503714816;\nn65865144550293504 -> n66709569480425472;\nn66709569480425472 -> n66709569480425472[style=dashed];\nn66709569480425472 -> n66991044457136128;\nn66991044457136128 -> n67272519433846784;\nn66991044457136128 -> n67553994410557440;\nn67553994410557440 -> n67835469387268096;\nn67272519433846784 -> n65302194596872192;\nn67272519433846784 -> n66428094503714816;\nn66428094503714816 -> n68116944363978752;\nn68116944363978752 -> n68116944363978752[style=dashed];\nn68116944363978752 -> n68398419340689408;\nn68398419340689408 -> n67835469387268096;\nn68398419340689408 -> n65302194596872192;\nn65302194596872192 -> n68679894317400064;\nn68679894317400064 -> n68679894317400064[style=dashed];\nn68679894317400064 -> n67835469387268096;\nn67835469387268096 -> n65583669573582848;\nn67835469387268096 -> n68961369294110720;\nn68961369294110720 -> n69242844270821376;\nn68961369294110720 -> n69524319247532032;\nn69524319247532032 -> n69805794224242688;\nn69242844270821376 -> n70087269200953344;\nn69242844270821376 -> n70368744177664000;\nn70368744177664000 -> n72339069014638592;\nn72339069014638592 -> n70650219154374656;\nn70650219154374656 -> n70650219154374656[style=dashed];\nn70650219154374656 -> n70931694131085312;\nn70931694131085312 -> n69805794224242688;\nn70931694131085312 -> n71213169107795968;\nn71213169107795968 -> n65583669573582848;\nn70087269200953344 -> n71494644084506624;\nn71494644084506624 -> n71494644084506624[style=dashed];\nn71494644084506624 -> n71776119061217280;\nn71776119061217280 -> n65583669573582848;\nn71776119061217280 -> n72057594037927936;\nn72057594037927936 -> n72339069014638592;\nn72057594037927936 -> n69805794224242688;\nn69805794224242688 -> n72620543991349248;\nn72620543991349248 -> n72620543991349248[style=dashed];\nn72620543991349248 -> n65583669573582848;\nn65583669573582848 -> n72902018968059904;\nn65583669573582848 -> n73183493944770560;\nn73183493944770560 -> n73464968921481216;\nn72902018968059904 -> n73464968921481216;\nn73464968921481216 -> n61924494876344320;\nn73464968921481216 -> n73746443898191872;\nn73746443898191872 -> n74027918874902528;\nn73746443898191872 -> n74309393851613184;\nn74309393851613184 -> n74590868828323840;\nn74309393851613184 -> n74872343805034496;\nn74872343805034496 -> n75153818781745152;\nn74590868828323840 -> n75435293758455808;\nn74590868828323840 -> n75716768735166464;\nn75716768735166464 -> n75998243711877120;\nn75435293758455808 -> n76279718688587776;\nn76279718688587776 -> n76279718688587776[style=dashed];\nn76279718688587776 -> n76561193665298432;\nn76561193665298432 -> n74027918874902528;\nn76561193665298432 -> n76842668642009088;\nn76842668642009088 -> n75153818781745152;\nn76842668642009088 -> n75998243711877120;\nn75998243711877120 -> n77124143618719744;\nn77124143618719744 -> n77124143618719744[style=dashed];\nn77124143618719744 -> n77405618595430400;\nn77405618595430400 -> n74027918874902528;\nn77405618595430400 -> n75153818781745152;\nn75153818781745152 -> n77687093572141056;\nn77687093572141056 -> n77687093572141056[style=dashed];\nn77687093572141056 -> n74027918874902528;\nn74027918874902528 -> n77968568548851712;\nn74027918874902528 -> n78250043525562368;\nn78250043525562368 -> n78531518502273024;\nn77968568548851712 -> n78531518502273024;\nn78531518502273024 -> n61924494876344320;\nn78531518502273024 -> n78812993478983680;\nn78812993478983680 -> n79094468455694336;\nn78812993478983680 -> n79375943432404992;\nn79375943432404992 -> n79657418409115648;\nn79938893385826304 -> n79094468455694336;\nn79938893385826304 -> n79657418409115648;\nn79657418409115648 -> n79938893385826304;\nn79657418409115648 -> n80220368362536960;\nn80220368362536960 -> n79938893385826304;\nn80220368362536960 -> n80501843339247616;\nn80501843339247616 -> n79657418409115648;\nn80501843339247616 -> n79094468455694336;\nn79094468455694336 -> n80783318315958272;\nn79094468455694336 -> n81064793292668928;\nn81064793292668928 -> n81346268269379584;\nn80783318315958272 -> n81346268269379584;\nn81346268269379584 -> n61924494876344320;\nn81346268269379584 -> n81627743246090240;\nn81627743246090240 -> n63613344736608256;\nn81627743246090240 -> n81909218222800896;\nn81909218222800896 -> n63613344736608256;\nn81909218222800896 -> n82190693199511552;\nn82190693199511552 -> n63613344736608256;\nn82190693199511552 -> n82472168176222208;\nn82472168176222208 -> n82753643152932864;\nn82472168176222208 -> n63613344736608256;\nn63613344736608256 -> n83035118129643520;\nn63613344736608256 -> n83316593106354176;\nn83316593106354176 -> n83598068083064832;\nn83316593106354176 -> n83879543059775488;\nn83879543059775488 -> n84161018036486144;\nn83035118129643520 -> n84442493013196800;\nn83035118129643520 -> n84723967989907456;\nn84723967989907456 -> n83598068083064832;\nn84723967989907456 -> n84161018036486144;\nn84161018036486144 -> n83598068083064832;\nn84442493013196800 -> n83598068083064832;\nn82753643152932864 -> n85005442966618112;\nn85286917943328768 -> n61924494876344320;\nn85286917943328768 -> n85568392920039424;\nn85568392920039424 -> n63613344736608256;\nn85568392920039424 -> n85005442966618112;\nn85005442966618112 -> n85849867896750080;\nn86131342873460736 -> n91197892454252544;\nn91197892454252544 -> n85286917943328768;\nn91197892454252544 -> n86412817850171392;\nn86412817850171392 -> n85568392920039424;\nn86412817850171392 -> n85849867896750080;\nn85849867896750080 -> n86694292826882048;\nn85849867896750080 -> n86975767803592704;\nn86975767803592704 -> n86412817850171392;\nn86975767803592704 -> n86694292826882048;\nn86694292826882048 -> n87257242780303360;\nn86694292826882048 -> n87538717757014016;\nn87538717757014016 -> n87820192733724672;\nn87538717757014016 -> n88101667710435328;\nn88101667710435328 -> n88383142687145984;\nn87820192733724672 -> n88664617663856640;\nn87820192733724672 -> n88946092640567296;\nn88946092640567296 -> n91479367430963200;\nn91479367430963200 -> n89227567617277952;\nn89227567617277952 -> n89227567617277952[style=dashed];\nn89227567617277952 -> n89509042593988608;\nn89509042593988608 -> n87257242780303360;\nn89509042593988608 -> n89790517570699264;\nn89790517570699264 -> n88383142687145984;\nn88664617663856640 -> n90071992547409920;\nn90071992547409920 -> n90071992547409920[style=dashed];\nn90071992547409920 -> n90353467524120576;\nn90353467524120576 -> n90634942500831232;\nn90353467524120576 -> n87257242780303360;\nn87257242780303360 -> n86131342873460736;\nn87257242780303360 -> n90916417477541888;\nn90916417477541888 -> n91197892454252544;\nn90634942500831232 -> n91479367430963200;\nn90634942500831232 -> n88383142687145984;\nn88383142687145984 -> n91760842407673856;\nn92042317384384512 -> n87257242780303360;\nn92042317384384512 -> n91760842407673856;\nn91760842407673856 -> n92042317384384512;\nn91760842407673856 -> n92323792361095168;\nn92323792361095168 -> n92042317384384512;\nn92323792361095168 -> n92605267337805824;\nn92605267337805824 -> n92042317384384512;\nn61924494876344320 -> n83598068083064832;\nn83598068083064832 -> n32088147345014784;\nn92886742314516480 -> n93168217291227136;\nn92886742314516480 -> n93449692267937792;\nn93449692267937792 -> n93731167244648448;\nn93449692267937792 -> n94012642221359104;\nn94012642221359104 -> n105834591243206656;\nn105834591243206656 -> n94294117198069760;\nn105834591243206656 -> n94575592174780416;\nn94575592174780416 -> n94294117198069760;\nn94575592174780416 -> n94857067151491072;\nn94857067151491072 -> n95138542128201728;\nn94857067151491072 -> n94294117198069760;\nn94294117198069760 -> n95420017104912384;\nn95701492081623040 -> n103019841476100096;\nn103019841476100096 -> n95982967058333696;\nn103019841476100096 -> n95420017104912384;\nn95420017104912384 -> n96264442035044352;\nn95420017104912384 -> n96545917011755008;\nn96545917011755008 -> n96827391988465664;\nn96545917011755008 -> n97108866965176320;\nn97108866965176320 -> n97390341941886976;\nn96264442035044352 -> n97671816918597632;\nn96827391988465664 -> n97953291895308288;\nn97953291895308288 -> n97953291895308288[style=dashed];\nn97953291895308288 -> n98234766872018944;\nn98234766872018944 -> n98516241848729600;\nn98234766872018944 -> n97390341941886976;\nn97390341941886976 -> n98797716825440256;\nn98797716825440256 -> n98797716825440256[style=dashed];\nn98797716825440256 -> n98516241848729600;\nn98516241848729600 -> n97671816918597632;\nn97671816918597632 -> n99079191802150912;\nn97671816918597632 -> n99360666778861568;\nn99360666778861568 -> n95701492081623040;\nn99360666778861568 -> n99642141755572224;\nn99642141755572224 -> n101612466592546816;\nn101612466592546816 -> n99923616732282880;\nn101612466592546816 -> n100205091708993536;\nn100205091708993536 -> n100486566685704192;\nn100205091708993536 -> n100768041662414848;\nn100768041662414848 -> n101049516639125504;\nn99923616732282880 -> n101049516639125504;\nn100486566685704192 -> n101049516639125504;\nn101049516639125504 -> n95701492081623040;\nn101049516639125504 -> n101330991615836160;\nn101330991615836160 -> n101612466592546816;\nn101330991615836160 -> n101893941569257472;\nn101893941569257472 -> n95701492081623040;\nn99079191802150912 -> n95701492081623040;\nn99079191802150912 -> n102175416545968128;\nn102175416545968128 -> n102456891522678784;\nn102738366499389440 -> n104145741382942720;\nn104145741382942720 -> n103019841476100096;\nn104145741382942720 -> n102456891522678784;\nn102456891522678784 -> n102738366499389440;\nn102456891522678784 -> n103301316452810752;\nn103301316452810752 -> n103582791429521408;\nn103301316452810752 -> n103864266406232064;\nn103864266406232064 -> n104145741382942720;\nn103582791429521408 -> n104145741382942720;\nn95982967058333696 -> n104427216359653376;\nn95982967058333696 -> n104708691336364032;\nn104708691336364032 -> n104427216359653376;\nn104708691336364032 -> n104990166313074688;\nn104990166313074688 -> n105271641289785344;\nn95138542128201728 -> n105271641289785344;\nn95138542128201728 -> n104427216359653376;\nn104427216359653376 -> n105271641289785344;\nn104427216359653376 -> n105553116266496000;\nn105553116266496000 -> n105834591243206656;\nn105553116266496000 -> n106116066219917312;\nn106116066219917312 -> n105271641289785344;\nn93168217291227136 -> n105271641289785344;\nn93731167244648448 -> n121878664915714048;\nn121878664915714048 -> n106397541196627968;\nn121878664915714048 -> n106679016173338624;\nn106679016173338624 -> n106397541196627968;\nn106679016173338624 -> n106960491150049280;\nn106960491150049280 -> n107241966126759936;\nn106960491150049280 -> n106397541196627968;\nn106397541196627968 -> n107523441103470592;\nn107804916080181248 -> n108086391056891904;\nn107804916080181248 -> n107523441103470592;\nn107523441103470592 -> n108367866033602560;\nn107523441103470592 -> n108649341010313216;\nn108649341010313216 -> n108930815987023872;\nn108649341010313216 -> n109212290963734528;\nn109212290963734528 -> n109493765940445184;\nn108367866033602560 -> n109775240917155840;\nn108930815987023872 -> n110056715893866496;\nn110056715893866496 -> n110056715893866496[style=dashed];\nn110056715893866496 -> n110338190870577152;\nn110338190870577152 -> n109493765940445184;\nn109493765940445184 -> n110619665847287808;\nn110619665847287808 -> n110619665847287808[style=dashed];\nn110619665847287808 -> n110901140823998464;\nn110901140823998464 -> n109775240917155840;\nn109775240917155840 -> n111182615800709120;\nn109775240917155840 -> n111464090777419776;\nn111464090777419776 -> n107804916080181248;\nn111464090777419776 -> n111745565754130432;\nn111745565754130432 -> n115967690404790272;\nn115967690404790272 -> n112027040730841088;\nn115967690404790272 -> n112308515707551744;\nn112308515707551744 -> n112589990684262400;\nn112308515707551744 -> n112871465660973056;\nn112871465660973056 -> n113152940637683712;\nn112871465660973056 -> n113434415614394368;\nn113434415614394368 -> n113715890591105024;\nn113434415614394368 -> n113997365567815680;\nn113997365567815680 -> n114278840544526336;\nn113997365567815680 -> n114560315521236992;\nn114560315521236992 -> n114841790497947648;\nn114560315521236992 -> n115123265474658304;\nn115123265474658304 -> n115404740451368960;\nn112027040730841088 -> n115404740451368960;\nn112589990684262400 -> n115404740451368960;\nn113152940637683712 -> n115404740451368960;\nn113715890591105024 -> n115404740451368960;\nn114278840544526336 -> n115404740451368960;\nn114841790497947648 -> n115404740451368960;\nn115404740451368960 -> n107804916080181248;\nn115404740451368960 -> n115686215428079616;\nn115686215428079616 -> n115967690404790272;\nn115686215428079616 -> n116249165381500928;\nn116249165381500928 -> n107804916080181248;\nn111182615800709120 -> n107804916080181248;\nn111182615800709120 -> n116530640358211584;\nn116530640358211584 -> n116812115334922240;\nn117093590311632896 -> n120471290032160768;\nn120471290032160768 -> n107804916080181248;\nn120471290032160768 -> n116812115334922240;\nn116812115334922240 -> n117093590311632896;\nn116812115334922240 -> n117375065288343552;\nn117375065288343552 -> n117656540265054208;\nn117375065288343552 -> n117938015241764864;\nn117938015241764864 -> n118219490218475520;\nn117938015241764864 -> n118500965195186176;\nn118500965195186176 -> n118782440171896832;\nn118500965195186176 -> n119063915148607488;\nn119063915148607488 -> n119345390125318144;\nn119063915148607488 -> n119626865102028800;\nn119626865102028800 -> n119908340078739456;\nn119626865102028800 -> n120189815055450112;\nn120189815055450112 -> n120471290032160768;\nn117656540265054208 -> n120471290032160768;\nn118219490218475520 -> n120471290032160768;\nn118782440171896832 -> n120471290032160768;\nn119345390125318144 -> n120471290032160768;\nn119908340078739456 -> n120471290032160768;\nn108086391056891904 -> n120752765008871424;\nn108086391056891904 -> n121034239985582080;\nn121034239985582080 -> n120752765008871424;\nn121034239985582080 -> n121315714962292736;\nn121315714962292736 -> n105271641289785344;\nn107241966126759936 -> n105271641289785344;\nn107241966126759936 -> n120752765008871424;\nn120752765008871424 -> n105271641289785344;\nn120752765008871424 -> n121597189939003392;\nn121597189939003392 -> n121878664915714048;\nn121597189939003392 -> n122160139892424704;\nn122160139892424704 -> n105271641289785344;\nn122441614869135360 -> n122723089845846016;\nn122441614869135360 -> n123004564822556672;\nn123004564822556672 -> n123286039799267328;\nn122723089845846016 -> n123567514775977984;\nn122723089845846016 -> n123848989752688640;\nn123848989752688640 -> n124130464729399296;\nn123567514775977984 -> n124130464729399296;\nn124130464729399296 -> n123286039799267328;\nn123286039799267328 -> n124411939706109952;\nn124693414682820608 -> n138485688541642752;\nn138485688541642752 -> n124974889659531264;\nn138485688541642752 -> n124411939706109952;\nn124411939706109952 -> n125256364636241920;\nn124411939706109952 -> n125537839612952576;\nn125537839612952576 -> n125819314589663232;\nn125537839612952576 -> n126100789566373888;\nn126100789566373888 -> n125819314589663232;\nn126100789566373888 -> n126382264543084544;\nn126382264543084544 -> n126663739519795200;\nn125256364636241920 -> n126945214496505856;\nn125819314589663232 -> n127226689473216512;\nn125819314589663232 -> n127508164449927168;\nn127508164449927168 -> n127226689473216512;\nn127508164449927168 -> n127789639426637824;\nn127789639426637824 -> n126663739519795200;\nn127226689473216512 -> n126663739519795200;\nn126663739519795200 -> n126945214496505856;\nn126945214496505856 -> n128071114403348480;\nn126945214496505856 -> n128352589380059136;\nn128352589380059136 -> n128634064356769792;\nn128352589380059136 -> n128915539333480448;\nn128915539333480448 -> n129197014310191104;\nn128915539333480448 -> n129478489286901760;\nn129478489286901760 -> n129759964263612416;\nn129478489286901760 -> n130041439240323072;\nn130041439240323072 -> n130322914217033728;\nn130041439240323072 -> n130604389193744384;\nn130604389193744384 -> n130885864170455040;\nn130604389193744384 -> n131167339147165696;\nn131167339147165696 -> n131448814123876352;\nn131167339147165696 -> n131730289100587008;\nn131730289100587008 -> n132011764077297664;\nn131730289100587008 -> n132293239054008320;\nn132293239054008320 -> n132574714030718976;\nn132293239054008320 -> n132856189007429632;\nn132856189007429632 -> n133137663984140288;\nn132856189007429632 -> n133419138960850944;\nn133419138960850944 -> n133700613937561600;\nn133419138960850944 -> n133982088914272256;\nn133982088914272256 -> n134263563890982912;\nn133982088914272256 -> n134545038867693568;\nn134545038867693568 -> n134826513844404224;\nn134545038867693568 -> n135107988821114880;\nn135107988821114880 -> n135389463797825536;\nn135107988821114880 -> n135670938774536192;\nn135670938774536192 -> n135952413751246848;\nn135670938774536192 -> n136233888727957504;\nn136233888727957504 -> n136515363704668160;\nn136233888727957504 -> n136796838681378816;\nn136796838681378816 -> n137078313658089472;\nn136796838681378816 -> n137359788634800128;\nn137359788634800128 -> n137641263611510784;\nn137359788634800128 -> n137922738588221440;\nn137922738588221440 -> n138204213564932096;\nn128634064356769792 -> n129478489286901760;\nn128634064356769792 -> n129197014310191104;\nn129197014310191104 -> n130041439240323072;\nn129197014310191104 -> n129759964263612416;\nn129759964263612416 -> n130604389193744384;\nn129759964263612416 -> n130322914217033728;\nn130322914217033728 -> n131167339147165696;\nn130322914217033728 -> n130885864170455040;\nn130885864170455040 -> n131730289100587008;\nn130885864170455040 -> n131448814123876352;\nn131448814123876352 -> n132293239054008320;\nn131448814123876352 -> n132011764077297664;\nn132011764077297664 -> n132856189007429632;\nn132011764077297664 -> n132574714030718976;\nn132574714030718976 -> n133419138960850944;\nn132574714030718976 -> n133137663984140288;\nn133137663984140288 -> n133982088914272256;\nn133137663984140288 -> n133700613937561600;\nn133700613937561600 -> n134545038867693568;\nn133700613937561600 -> n134263563890982912;\nn134263563890982912 -> n135107988821114880;\nn134263563890982912 -> n134826513844404224;\nn134826513844404224 -> n135670938774536192;\nn134826513844404224 -> n135389463797825536;\nn135389463797825536 -> n136233888727957504;\nn135389463797825536 -> n135952413751246848;\nn135952413751246848 -> n136796838681378816;\nn135952413751246848 -> n136515363704668160;\nn136515363704668160 -> n137359788634800128;\nn136515363704668160 -> n137078313658089472;\nn137078313658089472 -> n137922738588221440;\nn137078313658089472 -> n137641263611510784;\nn137641263611510784 -> n138485688541642752;\nn137641263611510784 -> n138204213564932096;\nn138204213564932096 -> n128071114403348480;\nn128071114403348480 -> n138485688541642752;\nn128071114403348480 -> n138767163518353408;\nn138767163518353408 -> n138485688541642752;\nn138767163518353408 -> n139048638495064064;\nn139048638495064064 -> n139330113471774720;\nn139048638495064064 -> n139611588448485376;\nn139611588448485376 -> n139893063425196032;\nn139611588448485376 -> n140174538401906688;\nn140174538401906688 -> n140456013378617344;\nn140174538401906688 -> n140737488355328000;\nn140737488355328000 -> n141018963332038656;\nn140737488355328000 -> n141300438308749312;\nn141300438308749312 -> n141581913285459968;\nn141300438308749312 -> n141863388262170624;\nn141863388262170624 -> n142144863238881280;\nn141863388262170624 -> n142426338215591936;\nn142426338215591936 -> n142707813192302592;\nn142426338215591936 -> n142989288169013248;\nn142989288169013248 -> n143270763145723904;\nn142989288169013248 -> n143552238122434560;\nn143552238122434560 -> n143833713099145216;\nn143552238122434560 -> n144115188075855872;\nn144115188075855872 -> n144396663052566528;\nn144115188075855872 -> n144678138029277184;\nn144678138029277184 -> n144959613005987840;\nn144678138029277184 -> n145241087982698496;\nn145241087982698496 -> n145522562959409152;\nn145241087982698496 -> n145804037936119808;\nn145804037936119808 -> n146085512912830464;\nn145804037936119808 -> n146366987889541120;\nn146366987889541120 -> n146648462866251776;\nn146366987889541120 -> n146929937842962432;\nn146929937842962432 -> n147211412819673088;\nn146929937842962432 -> n147492887796383744;\nn147492887796383744 -> n124693414682820608;\nn147492887796383744 -> n147774362773094400;\nn147774362773094400 -> n148055837749805056;\nn139330113471774720 -> n140174538401906688;\nn139330113471774720 -> n139893063425196032;\nn139893063425196032 -> n140737488355328000;\nn139893063425196032 -> n140456013378617344;\nn140456013378617344 -> n141300438308749312;\nn140456013378617344 -> n141018963332038656;\nn141018963332038656 -> n141863388262170624;\nn141018963332038656 -> n141581913285459968;\nn141581913285459968 -> n142426338215591936;\nn141581913285459968 -> n142144863238881280;\nn142144863238881280 -> n142989288169013248;\nn142144863238881280 -> n142707813192302592;\nn142707813192302592 -> n143552238122434560;\nn142707813192302592 -> n143270763145723904;\nn143270763145723904 -> n144115188075855872;\nn143270763145723904 -> n143833713099145216;\nn143833713099145216 -> n144678138029277184;\nn143833713099145216 -> n144396663052566528;\nn144396663052566528 -> n145241087982698496;\nn144396663052566528 -> n144959613005987840;\nn144959613005987840 -> n145804037936119808;\nn144959613005987840 -> n145522562959409152;\nn145522562959409152 -> n146366987889541120;\nn145522562959409152 -> n146085512912830464;\nn146085512912830464 -> n146929937842962432;\nn146085512912830464 -> n146648462866251776;\nn146648462866251776 -> n147492887796383744;\nn146648462866251776 -> n147211412819673088;\nn147211412819673088 -> n124693414682820608;\nn147211412819673088 -> n148055837749805056;\nn148055837749805056 -> n124693414682820608;\nn124974889659531264 -> n148337312726515712;\nn124974889659531264 -> n148618787703226368;\nn148618787703226368 -> n148900262679937024;\nn148337312726515712 -> n149181737656647680;\nn149181737656647680 -> n149181737656647680[style=dashed];\nn149181737656647680 -> n149463212633358336;\nn149463212633358336 -> n149744687610068992;\nn149463212633358336 -> n150026162586779648;\nn150026162586779648 -> n150307637563490304;\nn150307637563490304 -> n150307637563490304[style=dashed];\nn150307637563490304 -> n149744687610068992;\nn149744687610068992 -> n148900262679937024;\nn149744687610068992 -> n150589112540200960;\nn150589112540200960 -> n148900262679937024;\nn148900262679937024 -> n150870587516911616;\nn148900262679937024 -> n151152062493622272;\nn151152062493622272 -> n151433537470332928;\nn151433537470332928 -> n151433537470332928[style=dashed];\nn151433537470332928 -> n150870587516911616;\nn150870587516911616 -> n151715012447043584;\nn151996487423754240 -> n152277962400464896;\nn151996487423754240 -> n151715012447043584;\nn151715012447043584 -> n152559437377175552;\nn151715012447043584 -> n152840912353886208;\nn152840912353886208 -> n153122387330596864;\nn153403862307307520 -> n151996487423754240;\nn153403862307307520 -> n153122387330596864;\nn153122387330596864 -> n153403862307307520;\nn153122387330596864 -> n153685337284018176;\nn153685337284018176 -> n153966812260728832;\nn153966812260728832 -> n153966812260728832[style=dashed];\nn153966812260728832 -> n154248287237439488;\nn154248287237439488 -> n153403862307307520;\nn154248287237439488 -> n154529762214150144;\nn154529762214150144 -> n154811237190860800;\nn154811237190860800 -> n154811237190860800[style=dashed];\nn154811237190860800 -> n155092712167571456;\nn155092712167571456 -> n153403862307307520;\nn152559437377175552 -> n156500087051124736;\nn156500087051124736 -> n155374187144282112;\nn155374187144282112 -> n155374187144282112[style=dashed];\nn155374187144282112 -> n155655662120992768;\nn155655662120992768 -> n155937137097703424;\nn155937137097703424 -> n155937137097703424[style=dashed];\nn155937137097703424 -> n156218612074414080;\nn156218612074414080 -> n156500087051124736;\nn156218612074414080 -> n156781562027835392;\nn156781562027835392 -> n151996487423754240;\nn152277962400464896 -> n157063037004546048;\nn152277962400464896 -> n157344511981256704;\nn157344511981256704 -> n157625986957967360;\nn157907461934678016 -> n158188936911388672;\nn157907461934678016 -> n157625986957967360;\nn157625986957967360 -> n157907461934678016;\nn157625986957967360 -> n158470411888099328;\nn158470411888099328 -> n157907461934678016;\nn157063037004546048 -> n158188936911388672;\nn158188936911388672 -> n158751886864809984;\nn159033361841520640 -> n159314836818231296;\nn159033361841520640 -> n158751886864809984;\nn158751886864809984 -> n159596311794941952;\nn158751886864809984 -> n159877786771652608;\nn159877786771652608 -> n160159261748363264;\nn159596311794941952 -> n160159261748363264;\nn160159261748363264 -> n160440736725073920;\nn160159261748363264 -> n160722211701784576;\nn160722211701784576 -> n161003686678495232;\nn161003686678495232 -> n161003686678495232[style=dashed];\nn161003686678495232 -> n161285161655205888;\nn161285161655205888 -> n160440736725073920;\nn160440736725073920 -> n161566636631916544;\nn160440736725073920 -> n161848111608627200;\nn161848111608627200 -> n162129586585337856;\nn161566636631916544 -> n162129586585337856;\nn162129586585337856 -> n162411061562048512;\nn162129586585337856 -> n162692536538759168;\nn162692536538759168 -> n162974011515469824;\nn162974011515469824 -> n162974011515469824[style=dashed];\nn162974011515469824 -> n163255486492180480;\nn163255486492180480 -> n162411061562048512;\nn162411061562048512 -> n163536961468891136;\nn162411061562048512 -> n163818436445601792;\nn163818436445601792 -> n164099911422312448;\nn163536961468891136 -> n164099911422312448;\nn164099911422312448 -> n164381386399023104;\nn164099911422312448 -> n164662861375733760;\nn164662861375733760 -> n164944336352444416;\nn164944336352444416 -> n164944336352444416[style=dashed];\nn164944336352444416 -> n165225811329155072;\nn165225811329155072 -> n164381386399023104;\nn164381386399023104 -> n165507286305865728;\nn164381386399023104 -> n165788761282576384;\nn165788761282576384 -> n166070236259287040;\nn165507286305865728 -> n166070236259287040;\nn166070236259287040 -> n159033361841520640;\nn166070236259287040 -> n166351711235997696;\nn166351711235997696 -> n166633186212708352;\nn166633186212708352 -> n166633186212708352[style=dashed];\nn166633186212708352 -> n166914661189419008;\nn166914661189419008 -> n159033361841520640;\nn159314836818231296 -> n167196136166129664;\nn159314836818231296 -> n167477611142840320;\nn167477611142840320 -> n167759086119550976;\nn168040561096261632 -> n167196136166129664;\nn168040561096261632 -> n167759086119550976;\nn167759086119550976 -> n168322036072972288;\nn167759086119550976 -> n168603511049682944;\nn168603511049682944 -> n168884986026393600;\nn168322036072972288 -> n168884986026393600;\nn168884986026393600 -> n169166461003104256;\nn168884986026393600 -> n169447935979814912;\nn169447935979814912 -> n169729410956525568;\nn169729410956525568 -> n169729410956525568[style=dashed];\nn169729410956525568 -> n170010885933236224;\nn170010885933236224 -> n169166461003104256;\nn169166461003104256 -> n170292360909946880;\nn169166461003104256 -> n170573835886657536;\nn170573835886657536 -> n170855310863368192;\nn170292360909946880 -> n170855310863368192;\nn170855310863368192 -> n171136785840078848;\nn170855310863368192 -> n171418260816789504;\nn171418260816789504 -> n171699735793500160;\nn171699735793500160 -> n171699735793500160[style=dashed];\nn171699735793500160 -> n171981210770210816;\nn171981210770210816 -> n171136785840078848;\nn171136785840078848 -> n172262685746921472;\nn171136785840078848 -> n172544160723632128;\nn172544160723632128 -> n172825635700342784;\nn172262685746921472 -> n172825635700342784;\nn172825635700342784 -> n173107110677053440;\nn172825635700342784 -> n173388585653764096;\nn173388585653764096 -> n173670060630474752;\nn173670060630474752 -> n173670060630474752[style=dashed];\nn173670060630474752 -> n173951535607185408;\nn173951535607185408 -> n173107110677053440;\nn173107110677053440 -> n174233010583896064;\nn173107110677053440 -> n174514485560606720;\nn174514485560606720 -> n174795960537317376;\nn174233010583896064 -> n174795960537317376;\nn174795960537317376 -> n168040561096261632;\nn174795960537317376 -> n175077435514028032;\nn175077435514028032 -> n175358910490738688;\nn175358910490738688 -> n175358910490738688[style=dashed];\nn175358910490738688 -> n175640385467449344;\nn175640385467449344 -> n168040561096261632;\nn29273397577908224 -> n175921860444160000;\nn29273397577908224 -> n176203335420870656;\nn176203335420870656 -> n175921860444160000;\nn175921860444160000 -> n176484810397581312;\nn175921860444160000 -> n176766285374291968;\nn176766285374291968 -> n177047760351002624;\nn176766285374291968 -> n177329235327713280;\nn177329235327713280 -> n177610710304423936;\nn177329235327713280 -> n177892185281134592;\nn177892185281134592 -> n178173660257845248;\nn176484810397581312 -> n178455135234555904;\nn177047760351002624 -> n178736610211266560;\nn177047760351002624 -> n179018085187977216;\nn179018085187977216 -> n179299560164687872;\nn177610710304423936 -> n179581035141398528;\nn177610710304423936 -> n179862510118109184;\nn179862510118109184 -> n180143985094819840;\nn178736610211266560 -> n180425460071530496;\nn178736610211266560 -> n180706935048241152;\nn180706935048241152 -> n180988410024951808;\nn179581035141398528 -> n181269885001662464;\nn181269885001662464 -> n181269885001662464[style=dashed];\nn181269885001662464 -> n181551359978373120;\nn181551359978373120 -> n178173660257845248;\nn181551359978373120 -> n180143985094819840;\nn180143985094819840 -> n181832834955083776;\nn181832834955083776 -> n181832834955083776[style=dashed];\nn181832834955083776 -> n182114309931794432;\nn182114309931794432 -> n178173660257845248;\nn178173660257845248 -> n182395784908505088;\nn182395784908505088 -> n182395784908505088[style=dashed];\nn182395784908505088 -> n182677259885215744;\nn182677259885215744 -> n178455135234555904;\nn180425460071530496 -> n182958734861926400;\nn182958734861926400 -> n182958734861926400[style=dashed];\nn182958734861926400 -> n183240209838637056;\nn183240209838637056 -> n179299560164687872;\nn183240209838637056 -> n180988410024951808;\nn180988410024951808 -> n183521684815347712;\nn183521684815347712 -> n183521684815347712[style=dashed];\nn183521684815347712 -> n183803159792058368;\nn183803159792058368 -> n179299560164687872;\nn179299560164687872 -> n184084634768769024;\nn184084634768769024 -> n184084634768769024[style=dashed];\nn184084634768769024 -> n178455135234555904;\nn184366109745479680 -> n184647584722190336;\nn184366109745479680 -> n184929059698900992;\nn184929059698900992 -> n185210534675611648;\nn184929059698900992 -> n185492009652322304;\nn185492009652322304 -> n185773484629032960;\nn185492009652322304 -> n186054959605743616;\nn186054959605743616 -> n186336434582454272;\nn184647584722190336 -> n186336434582454272;\nn185210534675611648 -> n185773484629032960;\nn185773484629032960 -> n186617909559164928;\nn185773484629032960 -> n186899384535875584;\nn186899384535875584 -> n186336434582454272;\nn186899384535875584 -> n186617909559164928;\nn186617909559164928 -> n186336434582454272;\nn186336434582454272 -> n187180859512586240;\nn186336434582454272 -> n187462334489296896;\nn187462334489296896 -> n187743809466007552;\nn187462334489296896 -> n188025284442718208;\nn188025284442718208 -> n188306759419428864;\nn188025284442718208 -> n188588234396139520;\nn188588234396139520 -> n188869709372850176;\nn187180859512586240 -> n189151184349560832;\nn187743809466007552 -> n189432659326271488;\nn187743809466007552 -> n189714134302982144;\nn189714134302982144 -> n189995609279692800;\nn188306759419428864 -> n190277084256403456;\nn188306759419428864 -> n190558559233114112;\nn190558559233114112 -> n190840034209824768;\nn189432659326271488 -> n191121509186535424;\nn189432659326271488 -> n191402984163246080;\nn191402984163246080 -> n191684459139956736;\nn190277084256403456 -> n191965934116667392;\nn191965934116667392 -> n191965934116667392[style=dashed];\nn191965934116667392 -> n192247409093378048;\nn192247409093378048 -> n189151184349560832;\nn192247409093378048 -> n192528884070088704;\nn192528884070088704 -> n188869709372850176;\nn192528884070088704 -> n190840034209824768;\nn190840034209824768 -> n192810359046799360;\nn192810359046799360 -> n192810359046799360[style=dashed];\nn192810359046799360 -> n193091834023510016;\nn193091834023510016 -> n189151184349560832;\nn193091834023510016 -> n188869709372850176;\nn188869709372850176 -> n193373309000220672;\nn193373309000220672 -> n193373309000220672[style=dashed];\nn193373309000220672 -> n193654783976931328;\nn193654783976931328 -> n189151184349560832;\nn191121509186535424 -> n193936258953641984;\nn193936258953641984 -> n193936258953641984[style=dashed];\nn193936258953641984 -> n194217733930352640;\nn194217733930352640 -> n189151184349560832;\nn194217733930352640 -> n194499208907063296;\nn194499208907063296 -> n189995609279692800;\nn194499208907063296 -> n191684459139956736;\nn191684459139956736 -> n194780683883773952;\nn194780683883773952 -> n194780683883773952[style=dashed];\nn194780683883773952 -> n195062158860484608;\nn195062158860484608 -> n189151184349560832;\nn195062158860484608 -> n189995609279692800;\nn189995609279692800 -> n195343633837195264;\nn195343633837195264 -> n195343633837195264[style=dashed];\nn195343633837195264 -> n189151184349560832;\nn195625108813905920 -> n195906583790616576;\nn195625108813905920 -> n196188058767327232;\nn196188058767327232 -> n195906583790616576;\nn196188058767327232 -> n196469533744037888;\nn196469533744037888 -> n195906583790616576;\nn195906583790616576 -> n196751008720748544;\nn195906583790616576 -> n197032483697459200;\nn197032483697459200 -> n196751008720748544;\nn197032483697459200 -> n197313958674169856;\nn197313958674169856 -> n196751008720748544;\nn196751008720748544 -> n197595433650880512;\nn196751008720748544 -> n197876908627591168;\nn197876908627591168 -> n197595433650880512;\nn197876908627591168 -> n198158383604301824;\nn198158383604301824 -> n197595433650880512;\nn197595433650880512 -> n198439858581012480;\nn197595433650880512 -> n198721333557723136;\nn198721333557723136 -> n198439858581012480;\nn198721333557723136 -> n199002808534433792;\nn199002808534433792 -> n198439858581012480;\nn198439858581012480 -> n199284283511144448;\nn198439858581012480 -> n199565758487855104;\nn199565758487855104 -> n199284283511144448;\nn199565758487855104 -> n199847233464565760;\nn199847233464565760 -> n199284283511144448;\nn199284283511144448 -> n200128708441276416;\nn199284283511144448 -> n200410183417987072;\nn200410183417987072 -> n200128708441276416;\nn200410183417987072 -> n200691658394697728;\nn200691658394697728 -> n200128708441276416;\nn200128708441276416 -> n200973133371408384;\nn200128708441276416 -> n201254608348119040;\nn201254608348119040 -> n200973133371408384;\nn201254608348119040 -> n201536083324829696;\nn201536083324829696 -> n200973133371408384;\nn200973133371408384 -> n201817558301540352;\nn200973133371408384 -> n202099033278251008;\nn202099033278251008 -> n201817558301540352;\nn202099033278251008 -> n202380508254961664;\nn202380508254961664 -> n201817558301540352;\nn201817558301540352 -> n202661983231672320;\nn201817558301540352 -> n202943458208382976;\nn202943458208382976 -> n203224933185093632;\nn202943458208382976 -> n203506408161804288;\nn203506408161804288 -> n203787883138514944;\nn203506408161804288 -> n204069358115225600;\nn204069358115225600 -> n204350833091936256;\nn204350833091936256 -> n204350833091936256[style=dashed];\nn204350833091936256 -> n204632308068646912;\nn204632308068646912 -> n204913783045357568;\nn204632308068646912 -> n205195258022068224;\nn205195258022068224 -> n205476732998778880;\nn202661983231672320 -> n205758207975489536;\nn202661983231672320 -> n206039682952200192;\nn206039682952200192 -> n206321157928910848;\nn206039682952200192 -> n206602632905621504;\nn206602632905621504 -> n206321157928910848;\nn206602632905621504 -> n206884107882332160;\nn206884107882332160 -> n207165582859042816;\nn206884107882332160 -> n207447057835753472;\nn207447057835753472 -> n207728532812464128;\nn207447057835753472 -> n208010007789174784;\nn208010007789174784 -> n208291482765885440;\nn203224933185093632 -> n208572957742596096;\nn208854432719306752 -> n209135907696017408;\nn208854432719306752 -> n208572957742596096;\nn208572957742596096 -> n209417382672728064;\nn208572957742596096 -> n209698857649438720;\nn209698857649438720 -> n209980332626149376;\nn209980332626149376 -> n209980332626149376[style=dashed];\nn209980332626149376 -> n210261807602860032;\nn210261807602860032 -> n210543282579570688;\nn210261807602860032 -> n210824757556281344;\nn210824757556281344 -> n211106232532992000;\nn209417382672728064 -> n210543282579570688;\nn210543282579570688 -> n211387707509702656;\nn211387707509702656 -> n211387707509702656[style=dashed];\nn211387707509702656 -> n211106232532992000;\nn211106232532992000 -> n211669182486413312;\nn211106232532992000 -> n211950657463123968;\nn211950657463123968 -> n208854432719306752;\nn211950657463123968 -> n212232132439834624;\nn212232132439834624 -> n212513607416545280;\nn211669182486413312 -> n208854432719306752;\nn211669182486413312 -> n212513607416545280;\nn212513607416545280 -> n208854432719306752;\nn209135907696017408 -> n212795082393255936;\nn209135907696017408 -> n213076557369966592;\nn213076557369966592 -> n213358032346677248;\nn203787883138514944 -> n204913783045357568;\nn204913783045357568 -> n213639507323387904;\nn213639507323387904 -> n213639507323387904[style=dashed];\nn213639507323387904 -> n205476732998778880;\nn205476732998778880 -> n213920982300098560;\nn205476732998778880 -> n214202457276809216;\nn214202457276809216 -> n214483932253519872;\nn214483932253519872 -> n214483932253519872[style=dashed];\nn214483932253519872 -> n214765407230230528;\nn214765407230230528 -> n215046882206941184;\nn214765407230230528 -> n215328357183651840;\nn215328357183651840 -> n215609832160362496;\nn213920982300098560 -> n215046882206941184;\nn215046882206941184 -> n215891307137073152;\nn215891307137073152 -> n215891307137073152[style=dashed];\nn215891307137073152 -> n215609832160362496;\nn215609832160362496 -> n213358032346677248;\nn215609832160362496 -> n212795082393255936;\nn212795082393255936 -> n216172782113783808;\nn212795082393255936 -> n216454257090494464;\nn216454257090494464 -> n216172782113783808;\nn216454257090494464 -> n216735732067205120;\nn216735732067205120 -> n217017207043915776;\nn216735732067205120 -> n217298682020626432;\nn217298682020626432 -> n217580156997337088;\nn217298682020626432 -> n217861631974047744;\nn217861631974047744 -> n218143106950758400;\nn217580156997337088 -> n216172782113783808;\nn217580156997337088 -> n217017207043915776;\nn217017207043915776 -> n218143106950758400;\nn218143106950758400 -> n216172782113783808;\nn216172782113783808 -> n218424581927469056;\nn216172782113783808 -> n218706056904179712;\nn218706056904179712 -> n218424581927469056;\nn218706056904179712 -> n218987531880890368;\nn218987531880890368 -> n219269006857601024;\nn218987531880890368 -> n219550481834311680;\nn219550481834311680 -> n219831956811022336;\nn219550481834311680 -> n220113431787732992;\nn220113431787732992 -> n220394906764443648;\nn219831956811022336 -> n218424581927469056;\nn219831956811022336 -> n219269006857601024;\nn219269006857601024 -> n220394906764443648;\nn220394906764443648 -> n218424581927469056;\nn218424581927469056 -> n213358032346677248;\nn218424581927469056 -> n220676381741154304;\nn220676381741154304 -> n213358032346677248;\nn220676381741154304 -> n220957856717864960;\nn220957856717864960 -> n221239331694575616;\nn220957856717864960 -> n221520806671286272;\nn221520806671286272 -> n221802281647996928;\nn221520806671286272 -> n222083756624707584;\nn222083756624707584 -> n222365231601418240;\nn221802281647996928 -> n213358032346677248;\nn221802281647996928 -> n221239331694575616;\nn221239331694575616 -> n222365231601418240;\nn222365231601418240 -> n213358032346677248;\nn213358032346677248 -> n222646706578128896;\nn213358032346677248 -> n222928181554839552;\nn222928181554839552 -> n222646706578128896;\nn222928181554839552 -> n223209656531550208;\nn223209656531550208 -> n222646706578128896;\nn223209656531550208 -> n223491131508260864;\nn223491131508260864 -> n222646706578128896;\nn223491131508260864 -> n223772606484971520;\nn223772606484971520 -> n222646706578128896;\nn223772606484971520 -> n224054081461682176;\nn224054081461682176 -> n222646706578128896;\nn224054081461682176 -> n224335556438392832;\nn224335556438392832 -> n222646706578128896;\nn224335556438392832 -> n224617031415103488;\nn224617031415103488 -> n222646706578128896;\nn224617031415103488 -> n224898506391814144;\nn224898506391814144 -> n222646706578128896;\nn224898506391814144 -> n225179981368524800;\nn225179981368524800 -> n222646706578128896;\nn225179981368524800 -> n225461456345235456;\nn225461456345235456 -> n225742931321946112;\nn225461456345235456 -> n222646706578128896;\nn222646706578128896 -> n226024406298656768;\nn207728532812464128 -> n206321157928910848;\nn207728532812464128 -> n207165582859042816;\nn207165582859042816 -> n208291482765885440;\nn208291482765885440 -> n206321157928910848;\nn206321157928910848 -> n226305881275367424;\nn206321157928910848 -> n226587356252078080;\nn226587356252078080 -> n226305881275367424;\nn226587356252078080 -> n226868831228788736;\nn226868831228788736 -> n227150306205499392;\nn226868831228788736 -> n227431781182210048;\nn227431781182210048 -> n227713256158920704;\nn227431781182210048 -> n227994731135631360;\nn227994731135631360 -> n228276206112342016;\nn227713256158920704 -> n226305881275367424;\nn227713256158920704 -> n227150306205499392;\nn227150306205499392 -> n228276206112342016;\nn228276206112342016 -> n226305881275367424;\nn226305881275367424 -> n205758207975489536;\nn226305881275367424 -> n228557681089052672;\nn228557681089052672 -> n205758207975489536;\nn228557681089052672 -> n228839156065763328;\nn228839156065763328 -> n229120631042473984;\nn228839156065763328 -> n229402106019184640;\nn229402106019184640 -> n229683580995895296;\nn229402106019184640 -> n229965055972605952;\nn229965055972605952 -> n230246530949316608;\nn229683580995895296 -> n205758207975489536;\nn229683580995895296 -> n229120631042473984;\nn229120631042473984 -> n230246530949316608;\nn230246530949316608 -> n205758207975489536;\nn205758207975489536 -> n230528005926027264;\nn205758207975489536 -> n230809480902737920;\nn230809480902737920 -> n230528005926027264;\nn230809480902737920 -> n231090955879448576;\nn231090955879448576 -> n230528005926027264;\nn231090955879448576 -> n231372430856159232;\nn231372430856159232 -> n230528005926027264;\nn231372430856159232 -> n231653905832869888;\nn231653905832869888 -> n230528005926027264;\nn231653905832869888 -> n231935380809580544;\nn231935380809580544 -> n230528005926027264;\nn231935380809580544 -> n232216855786291200;\nn232216855786291200 -> n230528005926027264;\nn232216855786291200 -> n232498330763001856;\nn232498330763001856 -> n230528005926027264;\nn232498330763001856 -> n232779805739712512;\nn232779805739712512 -> n225742931321946112;\nn232779805739712512 -> n230528005926027264;\nn230528005926027264 -> n226024406298656768;\nn226024406298656768 -> n225742931321946112;\nn233061280716423168 -> n233342755693133824;\nn233061280716423168 -> n233624230669844480;\nn233624230669844480 -> n233905705646555136;\nn233905705646555136 -> n233905705646555136[style=dashed];\nn233905705646555136 -> n234187180623265792;\nn234187180623265792 -> n234468655599976448;\nn233342755693133824 -> n234468655599976448;\nn234468655599976448 -> n234750130576687104;\nn234468655599976448 -> n235031605553397760;\nn235031605553397760 -> n235313080530108416;\nn235031605553397760 -> n235594555506819072;\nn235594555506819072 -> n235876030483529728;\nn235594555506819072 -> n235313080530108416;\nn235313080530108416 -> n236157505460240384;\nn235313080530108416 -> n236438980436951040;\nn236438980436951040 -> n236720455413661696;\nn236157505460240384 -> n237001930390372352;\nn236157505460240384 -> n237283405367083008;\nn237283405367083008 -> n237564880343793664;\nn237001930390372352 -> n237846355320504320;\nn237846355320504320 -> n237846355320504320[style=dashed];\nn237846355320504320 -> n238127830297214976;\nn238127830297214976 -> n236720455413661696;\nn238127830297214976 -> n237564880343793664;\nn237564880343793664 -> n238409305273925632;\nn238409305273925632 -> n238409305273925632[style=dashed];\nn238409305273925632 -> n238690780250636288;\nn238690780250636288 -> n236720455413661696;\nn236720455413661696 -> n238972255227346944;\nn238972255227346944 -> n238972255227346944[style=dashed];\nn238972255227346944 -> n239253730204057600;\nn239253730204057600 -> n235876030483529728;\nn239253730204057600 -> n239535205180768256;\nn239535205180768256 -> n235876030483529728;\nn235876030483529728 -> n239816680157478912;\nn235876030483529728 -> n240098155134189568;\nn240098155134189568 -> n240379630110900224;\nn240098155134189568 -> n239816680157478912;\nn239816680157478912 -> n240661105087610880;\nn239816680157478912 -> n240942580064321536;\nn240942580064321536 -> n241224055041032192;\nn240661105087610880 -> n241505530017742848;\nn240661105087610880 -> n241787004994453504;\nn241787004994453504 -> n242068479971164160;\nn241505530017742848 -> n242349954947874816;\nn242349954947874816 -> n242349954947874816[style=dashed];\nn242349954947874816 -> n242631429924585472;\nn242631429924585472 -> n241224055041032192;\nn242631429924585472 -> n242068479971164160;\nn242068479971164160 -> n242912904901296128;\nn242912904901296128 -> n242912904901296128[style=dashed];\nn242912904901296128 -> n243194379878006784;\nn243194379878006784 -> n241224055041032192;\nn241224055041032192 -> n243475854854717440;\nn243475854854717440 -> n243475854854717440[style=dashed];\nn243475854854717440 -> n243757329831428096;\nn243757329831428096 -> n240379630110900224;\nn243757329831428096 -> n244038804808138752;\nn244038804808138752 -> n240379630110900224;\nn240379630110900224 -> n244320279784849408;\nn240379630110900224 -> n244601754761560064;\nn244601754761560064 -> n244883229738270720;\nn244601754761560064 -> n244320279784849408;\nn244320279784849408 -> n245164704714981376;\nn244320279784849408 -> n245446179691692032;\nn245446179691692032 -> n245727654668402688;\nn245164704714981376 -> n246009129645113344;\nn245164704714981376 -> n246290604621824000;\nn246290604621824000 -> n246572079598534656;\nn246009129645113344 -> n246853554575245312;\nn246853554575245312 -> n246853554575245312[style=dashed];\nn246853554575245312 -> n247135029551955968;\nn247135029551955968 -> n245727654668402688;\nn247135029551955968 -> n246572079598534656;\nn246572079598534656 -> n247416504528666624;\nn247416504528666624 -> n247416504528666624[style=dashed];\nn247416504528666624 -> n247697979505377280;\nn247697979505377280 -> n245727654668402688;\nn245727654668402688 -> n247979454482087936;\nn247979454482087936 -> n247979454482087936[style=dashed];\nn247979454482087936 -> n248260929458798592;\nn248260929458798592 -> n244883229738270720;\nn248260929458798592 -> n248542404435509248;\nn248542404435509248 -> n244883229738270720;\nn244883229738270720 -> n248823879412219904;\nn244883229738270720 -> n249105354388930560;\nn249105354388930560 -> n234750130576687104;\nn249105354388930560 -> n248823879412219904;\nn248823879412219904 -> n249386829365641216;\nn248823879412219904 -> n249668304342351872;\nn249668304342351872 -> n249949779319062528;\nn249386829365641216 -> n250231254295773184;\nn249386829365641216 -> n250512729272483840;\nn250512729272483840 -> n250794204249194496;\nn250231254295773184 -> n251075679225905152;\nn251075679225905152 -> n251075679225905152[style=dashed];\nn251075679225905152 -> n251357154202615808;\nn251357154202615808 -> n249949779319062528;\nn251357154202615808 -> n250794204249194496;\nn250794204249194496 -> n251638629179326464;\nn251638629179326464 -> n251638629179326464[style=dashed];\nn251638629179326464 -> n251920104156037120;\nn251920104156037120 -> n249949779319062528;\nn249949779319062528 -> n252201579132747776;\nn252201579132747776 -> n252201579132747776[style=dashed];\nn252201579132747776 -> n252483054109458432;\nn252483054109458432 -> n234750130576687104;\nn252483054109458432 -> n252764529086169088;\nn252764529086169088 -> n234750130576687104;\nn253046004062879744 -> n253327479039590400;\nn253046004062879744 -> n253608954016301056;\nn253608954016301056 -> n253890428993011712;\nn253890428993011712 -> n253890428993011712[style=dashed];\nn253890428993011712 -> n254171903969722368;\nn254171903969722368 -> n254453378946433024;\nn253327479039590400 -> n254453378946433024;\nn254453378946433024 -> n254734853923143680;\nn254453378946433024 -> n255016328899854336;\nn255016328899854336 -> n255297803876564992;\nn255016328899854336 -> n255579278853275648;\nn255579278853275648 -> n255860753829986304;\nn255579278853275648 -> n255297803876564992;\nn255297803876564992 -> n256142228806696960;\nn255297803876564992 -> n256423703783407616;\nn256423703783407616 -> n256705178760118272;\nn256142228806696960 -> n256986653736828928;\nn256142228806696960 -> n257268128713539584;\nn257268128713539584 -> n257549603690250240;\nn256986653736828928 -> n257831078666960896;\nn257831078666960896 -> n257831078666960896[style=dashed];\nn257831078666960896 -> n258112553643671552;\nn258112553643671552 -> n256705178760118272;\nn258112553643671552 -> n257549603690250240;\nn257549603690250240 -> n258394028620382208;\nn258394028620382208 -> n258394028620382208[style=dashed];\nn258394028620382208 -> n258675503597092864;\nn258675503597092864 -> n256705178760118272;\nn256705178760118272 -> n258956978573803520;\nn258956978573803520 -> n258956978573803520[style=dashed];\nn258956978573803520 -> n259238453550514176;\nn259238453550514176 -> n255860753829986304;\nn259238453550514176 -> n259519928527224832;\nn259519928527224832 -> n255860753829986304;\nn255860753829986304 -> n259801403503935488;\nn255860753829986304 -> n260082878480646144;\nn260082878480646144 -> n260364353457356800;\nn260082878480646144 -> n259801403503935488;\nn259801403503935488 -> n260645828434067456;\nn259801403503935488 -> n260927303410778112;\nn260927303410778112 -> n261208778387488768;\nn260645828434067456 -> n261490253364199424;\nn260645828434067456 -> n261771728340910080;\nn261771728340910080 -> n262053203317620736;\nn261490253364199424 -> n262334678294331392;\nn262334678294331392 -> n262334678294331392[style=dashed];\nn262334678294331392 -> n262616153271042048;\nn262616153271042048 -> n261208778387488768;\nn262616153271042048 -> n262053203317620736;\nn262053203317620736 -> n262897628247752704;\nn262897628247752704 -> n262897628247752704[style=dashed];\nn262897628247752704 -> n263179103224463360;\nn263179103224463360 -> n261208778387488768;\nn261208778387488768 -> n263460578201174016;\nn263460578201174016 -> n263460578201174016[style=dashed];\nn263460578201174016 -> n263742053177884672;\nn263742053177884672 -> n260364353457356800;\nn263742053177884672 -> n264023528154595328;\nn264023528154595328 -> n260364353457356800;\nn260364353457356800 -> n264305003131305984;\nn260364353457356800 -> n264586478108016640;\nn264586478108016640 -> n254734853923143680;\nn264586478108016640 -> n264305003131305984;\nn264305003131305984 -> n264867953084727296;\nn264305003131305984 -> n265149428061437952;\nn265149428061437952 -> n265430903038148608;\nn264867953084727296 -> n265712378014859264;\nn264867953084727296 -> n265993852991569920;\nn265993852991569920 -> n266275327968280576;\nn265712378014859264 -> n266556802944991232;\nn266556802944991232 -> n266556802944991232[style=dashed];\nn266556802944991232 -> n266838277921701888;\nn266838277921701888 -> n265430903038148608;\nn266838277921701888 -> n266275327968280576;\nn266275327968280576 -> n267119752898412544;\nn267119752898412544 -> n267119752898412544[style=dashed];\nn267119752898412544 -> n267401227875123200;\nn267401227875123200 -> n265430903038148608;\nn265430903038148608 -> n267682702851833856;\nn267682702851833856 -> n267682702851833856[style=dashed];\nn267682702851833856 -> n267964177828544512;\nn267964177828544512 -> n254734853923143680;\nn267964177828544512 -> n268245652805255168;\nn268245652805255168 -> n254734853923143680;\nn268527127781965824 -> n268808602758676480;\nn268527127781965824 -> n269090077735387136;\nn269090077735387136 -> n269371552712097792;\nn269090077735387136 -> n269653027688808448;\nn269653027688808448 -> n269371552712097792;\nn269371552712097792 -> n268808602758676480;\nn268808602758676480 -> n269934502665519104;\nn268808602758676480 -> n270215977642229760;\nn270215977642229760 -> n271060402572361728;\nn271060402572361728 -> n270497452618940416;\nn270497452618940416 -> n270497452618940416[style=dashed];\nn270497452618940416 -> n270778927595651072;\nn270778927595651072 -> n271060402572361728;\nn270778927595651072 -> n271341877549072384;\nn271341877549072384 -> n269934502665519104;\nn269934502665519104 -> n271623352525783040;\nn269934502665519104 -> n271904827502493696;\nn271904827502493696 -> n272186302479204352;\nn271904827502493696 -> n272467777455915008;\nn272467777455915008 -> n272749252432625664;\nn273030727409336320 -> n275001052246310912;\nn275001052246310912 -> n273312202386046976;\nn275001052246310912 -> n272749252432625664;\nn272749252432625664 -> n273593677362757632;\nn272749252432625664 -> n273875152339468288;\nn273875152339468288 -> n273030727409336320;\nn273875152339468288 -> n274156627316178944;\nn274156627316178944 -> n274438102292889600;\nn274438102292889600 -> n274438102292889600[style=dashed];\nn274438102292889600 -> n274719577269600256;\nn274719577269600256 -> n275001052246310912;\nn273593677362757632 -> n273030727409336320;\nn273593677362757632 -> n275282527223021568;\nn275282527223021568 -> n275564002199732224;\nn275564002199732224 -> n275564002199732224[style=dashed];\nn275564002199732224 -> n275845477176442880;\nn275845477176442880 -> n275001052246310912;\nn271623352525783040 -> n276126952153153536;\nn271623352525783040 -> n276408427129864192;\nn276408427129864192 -> n276689902106574848;\nn276408427129864192 -> n276971377083285504;\nn276971377083285504 -> n277252852059996160;\nn277252852059996160 -> n277252852059996160[style=dashed];\nn277252852059996160 -> n277534327036706816;\nn277534327036706816 -> n273312202386046976;\nn276126952153153536 -> n272186302479204352;\nn276126952153153536 -> n277815802013417472;\nn277815802013417472 -> n278097276990128128;\nn278097276990128128 -> n278097276990128128[style=dashed];\nn278097276990128128 -> n273312202386046976;\nn273312202386046976 -> n278378751966838784;\nn273312202386046976 -> n278660226943549440;\nn272186302479204352 -> n278660226943549440;\nn272186302479204352 -> n278378751966838784;\nn276689902106574848 -> n278378751966838784;\nn276689902106574848 -> n278941701920260096;\nn278941701920260096 -> n278660226943549440;\nn844424930131968 -> n0[style=dotted];\nn1125899906842624 -> n844424930131968[style=dotted];\nn11540474045136896 -> n9288674231451648[style=dotted];\nn8444249301319680 -> n7036874417766400[style=dotted];\nn9288674231451648 -> n8444249301319680[style=dotted];\nn10133099161583616 -> n9851624184872960[style=dotted];\nn10696049115004928 -> n9851624184872960[style=dotted];\nn9007199254740992 -> n9288674231451648[style=dotted];\nn7599824371187712 -> n6192449487634432[style=dotted];\nn12384898975268864 -> n12103423998558208[style=dotted];\nn14636698788954112 -> n13792273858822144[style=dotted];\nn14355223812243456 -> n13510798882111488[style=dotted];\nn15199648742375424 -> n14355223812243456[style=dotted];\nn13229323905400832 -> n12947848928690176[style=dotted];\nn16888498602639360 -> n16044073672507392[style=dotted];\nn16607023625928704 -> n15762598695796736[style=dotted];\nn17451448556060672 -> n16607023625928704[style=dotted];\nn15481123719086080 -> n13229323905400832[style=dotted];\nn8162774324609024 -> n6192449487634432[style=dotted];\nn5910974510923776 -> n1125899906842624[style=dotted];\nn19140298416324608 -> n1125899906842624[style=dotted];\nn19421773393035264 -> n1125899906842624[style=dotted];\nn18577348462903296 -> n1125899906842624[style=dotted];\nn25895697857380352 -> n844424930131968[style=dotted];\nn20547673299877888 -> n20266198323167232[style=dotted];\nn22799473113563136 -> n21955048183431168[style=dotted];\nn22517998136852480 -> n21673573206720512[style=dotted];\nn23362423066984448 -> n22517998136852480[style=dotted];\nn21392098230009856 -> n21110623253299200[style=dotted];\nn25051272927248384 -> n24206847997116416[style=dotted];\nn24769797950537728 -> n23925373020405760[style=dotted];\nn25614222880669696 -> n24769797950537728[style=dotted];\nn23643898043695104 -> n21392098230009856[style=dotted];\nn19703248369745920 -> n5629499534213120[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-215.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn1688849860263936[shape=rectangle, label=\"B4\"];\nn1407374883553280[shape=rectangle, label=\"B5\"];\nn844424930131968[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn1970324836974592[shape=rectangle, label=\"B8\"];\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn3377699720527872[shape=rectangle, label=\"B10\"];\nn3096224743817216[shape=rectangle, label=\"B11\"];\nn3940649673949184[shape=rectangle, label=\"B12\"];\nn3659174697238528[shape=rectangle, label=\"B13\"];\nn4503599627370496[shape=rectangle, label=\"B14\"];\nn4222124650659840[shape=rectangle, label=\"B15\"];\nn5066549580791808[shape=rectangle, label=\"B16\"];\nn4785074604081152[shape=rectangle, label=\"B17\"];\nn5629499534213120[shape=rectangle, label=\"B18\"];\nn7599824371187712[shape=rectangle, label=\"B19\"];\nn6192449487634432[shape=rectangle, label=\"B20\"];\nn5910974510923776[shape=rectangle, label=\"B21\"];\nn6755399441055744[shape=rectangle, label=\"B22\"];\nn6473924464345088[shape=rectangle, label=\"B23\"];\nn7036874417766400[shape=rectangle, label=\"B24\"];\nn7318349394477056[shape=rectangle, label=\"B25\"];\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn2533274790395904[shape=rectangle, label=\"B27\"];\nn5348024557502464[shape=rectangle, label=\"B28\"];\nn8444249301319680[shape=rectangle, label=\"B29\"];\nn8162774324609024[shape=rectangle, label=\"B30\"];\nn9007199254740992[shape=rectangle, label=\"B31\"];\nn8725724278030336[shape=rectangle, label=\"B32\"];\nn9851624184872960[shape=rectangle, label=\"B33\"];\nn9570149208162304[shape=rectangle, label=\"B34\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn9288674231451648[shape=rectangle, label=\"B36\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn1125899906842624 -> n1688849860263936;\nn1688849860263936 -> n1407374883553280;\nn844424930131968 -> n1970324836974592;\nn844424930131968 -> n2251799813685248;\nn2251799813685248 -> n1970324836974592;\nn1970324836974592 -> n2533274790395904;\nn1970324836974592 -> n2814749767106560;\nn2814749767106560 -> n3096224743817216;\nn2814749767106560 -> n3377699720527872;\nn3377699720527872 -> n3096224743817216;\nn3096224743817216 -> n3659174697238528;\nn3096224743817216 -> n3940649673949184;\nn3940649673949184 -> n3659174697238528;\nn3659174697238528 -> n4222124650659840;\nn3659174697238528 -> n4503599627370496;\nn4503599627370496 -> n4222124650659840;\nn4222124650659840 -> n4785074604081152;\nn4222124650659840 -> n5066549580791808;\nn5066549580791808 -> n4785074604081152;\nn4785074604081152 -> n5348024557502464;\nn4785074604081152 -> n5629499534213120;\nn5629499534213120 -> n7599824371187712;\nn7599824371187712 -> n5910974510923776;\nn7599824371187712 -> n6192449487634432;\nn6192449487634432 -> n5910974510923776;\nn5910974510923776 -> n6473924464345088;\nn5910974510923776 -> n6755399441055744;\nn6755399441055744 -> n7036874417766400;\nn6473924464345088 -> n7318349394477056;\nn6473924464345088 -> n7036874417766400;\nn7036874417766400 -> n7318349394477056;\nn7318349394477056 -> n7599824371187712;\nn7318349394477056 -> n7881299347898368;\nn7881299347898368 -> n5348024557502464;\nn2533274790395904 -> n5348024557502464;\nn5348024557502464 -> n8162774324609024;\nn5348024557502464 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n8725724278030336;\nn8162774324609024 -> n9007199254740992;\nn9007199254740992 -> n9288674231451648;\nn8725724278030336 -> n9570149208162304;\nn8725724278030336 -> n9851624184872960;\nn9851624184872960 -> n9570149208162304;\nn9570149208162304 -> n9288674231451648;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n9288674231451648;\nn281474976710656 -> n0[style=dotted];\nn1407374883553280 -> n1125899906842624[style=dotted];\nn1970324836974592 -> n844424930131968[style=dotted];\nn3096224743817216 -> n2814749767106560[style=dotted];\nn3659174697238528 -> n3096224743817216[style=dotted];\nn4222124650659840 -> n3659174697238528[style=dotted];\nn4785074604081152 -> n4222124650659840[style=dotted];\nn7599824371187712 -> n5629499534213120[style=dotted];\nn5910974510923776 -> n7599824371187712[style=dotted];\nn7036874417766400 -> n5910974510923776[style=dotted];\nn7318349394477056 -> n5910974510923776[style=dotted];\nn5348024557502464 -> n1970324836974592[style=dotted];\nn8162774324609024 -> n5348024557502464[style=dotted];\nn9570149208162304 -> n8725724278030336[style=dotted];\nn9288674231451648 -> n8162774324609024[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-216.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn0 -> n562949953421312;\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1125899906842624 -> n1407374883553280;\nn281474976710656 -> n1125899906842624;\nn844424930131968[shape=rectangle, label=\"B5\"];\nn1970324836974592[shape=rectangle, label=\"B6\"];\nn844424930131968 -> n1970324836974592;\nn1688849860263936[shape=rectangle, label=\"B7\"];\nn2533274790395904[shape=rectangle, label=\"B8\"];\nn72620543991349248[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn72620543991349248 -> n3096224743817216;\nn2814749767106560[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn2814749767106560 -> n3659174697238528;\nn3377699720527872[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn3377699720527872 -> n4222124650659840;\nn3940649673949184[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn3940649673949184 -> n4785074604081152;\nn4503599627370496[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn5629499534213120[shape=rectangle, label=\"B19\"];\nn5348024557502464 -> n5629499534213120;\nn4503599627370496 -> n5348024557502464;\nn5066549580791808[shape=rectangle, label=\"B20\"];\nn6192449487634432[shape=rectangle, label=\"B21\"];\nn6473924464345088[shape=rectangle, label=\"B22\"];\nn6192449487634432 -> n6473924464345088;\nn5066549580791808 -> n6192449487634432;\nn5910974510923776[shape=rectangle, label=\"B23\"];\nn7036874417766400[shape=rectangle, label=\"B24\"];\nn42784196460019712[shape=rectangle, label=\"B25\"];\nn7599824371187712[shape=rectangle, label=\"B26\"];\nn42784196460019712 -> n7599824371187712;\nn7318349394477056[shape=rectangle, label=\"B27\"];\nn8162774324609024[shape=rectangle, label=\"B28\"];\nn8725724278030336[shape=rectangle, label=\"B29\"];\nn9288674231451648[shape=rectangle, label=\"B30\"];\nn9851624184872960[shape=rectangle, label=\"B31\"];\nn9288674231451648 -> n9851624184872960;\nn9570149208162304[shape=rectangle, label=\"B32\"];\nn10133099161583616[shape=rectangle, label=\"B33\"];\nn9570149208162304 -> n10133099161583616;\nn9288674231451648 -> n9570149208162304;\nn8725724278030336 -> n9288674231451648;\nn8162774324609024 -> n8725724278030336;\nn8444249301319680[shape=rectangle, label=\"B34\"];\nn10414574138294272[shape=rectangle, label=\"B35\"];\nn8444249301319680 -> n10414574138294272;\nn8162774324609024 -> n8444249301319680;\nn7318349394477056 -> n8162774324609024;\nn7881299347898368[shape=rectangle, label=\"B36\"];\nn10977524091715584[shape=rectangle, label=\"B37\"];\nn7881299347898368 -> n10977524091715584;\nn10696049115004928[shape=rectangle, label=\"B38\"];\nn11540474045136896[shape=rectangle, label=\"B39\"];\nn10696049115004928 -> n11540474045136896;\nn11258999068426240[shape=rectangle, label=\"B40\"];\nn12103423998558208[shape=rectangle, label=\"B41\"];\nn11258999068426240 -> n12103423998558208;\nn11821949021847552[shape=rectangle, label=\"B42\"];\nn12666373951979520[shape=rectangle, label=\"B43\"];\nn11821949021847552 -> n12666373951979520;\nn12384898975268864[shape=rectangle, label=\"B44\"];\nn13229323905400832[shape=rectangle, label=\"B45\"];\nn13792273858822144[shape=rectangle, label=\"B46\"];\nn13229323905400832 -> n13792273858822144;\nn13510798882111488[shape=rectangle, label=\"B47\"];\nn14355223812243456[shape=rectangle, label=\"B48\"];\nn13510798882111488 -> n14355223812243456;\nn14073748835532800[shape=rectangle, label=\"B49\"];\nn13510798882111488 -> n14073748835532800;\nn13229323905400832 -> n13510798882111488;\nn12384898975268864 -> n13229323905400832;\nn12947848928690176[shape=rectangle, label=\"B50\"];\nn12384898975268864 -> n12947848928690176;\nn14636698788954112[shape=rectangle, label=\"B51\"];\nn15199648742375424[shape=rectangle, label=\"B52\"];\nn14636698788954112 -> n15199648742375424;\nn14918173765664768[shape=rectangle, label=\"B53\"];\nn15762598695796736[shape=rectangle, label=\"B54\"];\nn14918173765664768 -> n15762598695796736;\nn15481123719086080[shape=rectangle, label=\"B55\"];\nn16325548649218048[shape=rectangle, label=\"B56\"];\nn15481123719086080 -> n16325548649218048;\nn16044073672507392[shape=rectangle, label=\"B57\"];\nn16888498602639360[shape=rectangle, label=\"B58\"];\nn16044073672507392 -> n16888498602639360;\nn16607023625928704[shape=rectangle, label=\"B59\"];\nn17451448556060672[shape=rectangle, label=\"B60\"];\nn16607023625928704 -> n17451448556060672;\nn17169973579350016[shape=rectangle, label=\"B61\"];\nn18014398509481984[shape=rectangle, label=\"B62\"];\nn18577348462903296[shape=rectangle, label=\"B63\"];\nn18014398509481984 -> n18577348462903296;\nn18295873486192640[shape=rectangle, label=\"B64\"];\nn19140298416324608[shape=rectangle, label=\"B65\"];\nn18295873486192640 -> n19140298416324608;\nn18858823439613952[shape=rectangle, label=\"B66\"];\nn18295873486192640 -> n18858823439613952;\nn18014398509481984 -> n18295873486192640;\nn17169973579350016 -> n18014398509481984;\nn17732923532771328[shape=rectangle, label=\"B67\"];\nn17169973579350016 -> n17732923532771328;\nn19421773393035264[shape=rectangle, label=\"B68\"];\nn19984723346456576[shape=rectangle, label=\"B69\"];\nn19421773393035264 -> n19984723346456576;\nn19703248369745920[shape=rectangle, label=\"B70\"];\nn20547673299877888[shape=rectangle, label=\"B71\"];\nn19703248369745920 -> n20547673299877888;\nn20266198323167232[shape=rectangle, label=\"B72\"];\nn21110623253299200[shape=rectangle, label=\"B73\"];\nn20266198323167232 -> n21110623253299200;\nn20829148276588544[shape=rectangle, label=\"B74\"];\nn21673573206720512[shape=rectangle, label=\"B75\"];\nn20829148276588544 -> n21673573206720512;\nn21392098230009856[shape=rectangle, label=\"B76\"];\nn22236523160141824[shape=rectangle, label=\"B77\"];\nn21392098230009856 -> n22236523160141824;\nn21955048183431168[shape=rectangle, label=\"B78\"];\nn22799473113563136[shape=rectangle, label=\"B79\"];\nn21955048183431168 -> n22799473113563136;\nn22517998136852480[shape=rectangle, label=\"B80\"];\nn23362423066984448[shape=rectangle, label=\"B81\"];\nn22517998136852480 -> n23362423066984448;\nn23080948090273792[shape=rectangle, label=\"B82\"];\nn23925373020405760[shape=rectangle, label=\"B83\"];\nn24488322973827072[shape=rectangle, label=\"B84\"];\nn23925373020405760 -> n24488322973827072;\nn24206847997116416[shape=rectangle, label=\"B85\"];\nn25051272927248384[shape=rectangle, label=\"B86\"];\nn24206847997116416 -> n25051272927248384;\nn24769797950537728[shape=rectangle, label=\"B87\"];\nn24206847997116416 -> n24769797950537728;\nn23925373020405760 -> n24206847997116416;\nn23080948090273792 -> n23925373020405760;\nn23643898043695104[shape=rectangle, label=\"B88\"];\nn23080948090273792 -> n23643898043695104;\nn25332747903959040[shape=rectangle, label=\"B89\"];\nn25895697857380352[shape=rectangle, label=\"B90\"];\nn25332747903959040 -> n25895697857380352;\nn25614222880669696[shape=rectangle, label=\"B91\"];\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn25614222880669696 -> n26458647810801664;\nn26177172834091008[shape=rectangle, label=\"B93\"];\nn27021597764222976[shape=rectangle, label=\"B94\"];\nn26177172834091008 -> n27021597764222976;\nn26740122787512320[shape=rectangle, label=\"B95\"];\nn27584547717644288[shape=rectangle, label=\"B96\"];\nn26740122787512320 -> n27584547717644288;\nn27303072740933632[shape=rectangle, label=\"B97\"];\nn28147497671065600[shape=rectangle, label=\"B98\"];\nn27303072740933632 -> n28147497671065600;\nn27866022694354944[shape=rectangle, label=\"B99\"];\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn29273397577908224[shape=rectangle, label=\"B101\"];\nn28710447624486912 -> n29273397577908224;\nn28991922601197568[shape=rectangle, label=\"B102\"];\nn29836347531329536[shape=rectangle, label=\"B103\"];\nn28991922601197568 -> n29836347531329536;\nn29554872554618880[shape=rectangle, label=\"B104\"];\nn28991922601197568 -> n29554872554618880;\nn28710447624486912 -> n28991922601197568;\nn27866022694354944 -> n28710447624486912;\nn28428972647776256[shape=rectangle, label=\"B105\"];\nn27866022694354944 -> n28428972647776256;\nn30117822508040192[shape=rectangle, label=\"B106\"];\nn30680772461461504[shape=rectangle, label=\"B107\"];\nn30117822508040192 -> n30680772461461504;\nn30399297484750848[shape=rectangle, label=\"B108\"];\nn31243722414882816[shape=rectangle, label=\"B109\"];\nn30399297484750848 -> n31243722414882816;\nn30962247438172160[shape=rectangle, label=\"B110\"];\nn31806672368304128[shape=rectangle, label=\"B111\"];\nn30962247438172160 -> n31806672368304128;\nn31525197391593472[shape=rectangle, label=\"B112\"];\nn32369622321725440[shape=rectangle, label=\"B113\"];\nn31525197391593472 -> n32369622321725440;\nn32088147345014784[shape=rectangle, label=\"B114\"];\nn32932572275146752[shape=rectangle, label=\"B115\"];\nn32088147345014784 -> n32932572275146752;\nn32651097298436096[shape=rectangle, label=\"B116\"];\nn33495522228568064[shape=rectangle, label=\"B117\"];\nn34058472181989376[shape=rectangle, label=\"B118\"];\nn33495522228568064 -> n34058472181989376;\nn33776997205278720[shape=rectangle, label=\"B119\"];\nn34621422135410688[shape=rectangle, label=\"B120\"];\nn33776997205278720 -> n34621422135410688;\nn34339947158700032[shape=rectangle, label=\"B121\"];\nn33776997205278720 -> n34339947158700032;\nn33495522228568064 -> n33776997205278720;\nn32651097298436096 -> n33495522228568064;\nn33214047251857408[shape=rectangle, label=\"B122\"];\nn32651097298436096 -> n33214047251857408;\nn34902897112121344[shape=rectangle, label=\"B123\"];\nn35465847065542656[shape=rectangle, label=\"B124\"];\nn34902897112121344 -> n35465847065542656;\nn35184372088832000[shape=rectangle, label=\"B125\"];\nn36028797018963968[shape=rectangle, label=\"B126\"];\nn35184372088832000 -> n36028797018963968;\nn35747322042253312[shape=rectangle, label=\"B127\"];\nn36591746972385280[shape=rectangle, label=\"B128\"];\nn35747322042253312 -> n36591746972385280;\nn36310271995674624[shape=rectangle, label=\"B129\"];\nn37154696925806592[shape=rectangle, label=\"B130\"];\nn36310271995674624 -> n37154696925806592;\nn36873221949095936[shape=rectangle, label=\"B131\"];\nn37717646879227904[shape=rectangle, label=\"B132\"];\nn36873221949095936 -> n37717646879227904;\nn37436171902517248[shape=rectangle, label=\"B133\"];\nn38280596832649216[shape=rectangle, label=\"B134\"];\nn37436171902517248 -> n38280596832649216;\nn37999121855938560[shape=rectangle, label=\"B135\"];\nn38843546786070528[shape=rectangle, label=\"B136\"];\nn37999121855938560 -> n38843546786070528;\nn38562071809359872[shape=rectangle, label=\"B137\"];\nn39406496739491840[shape=rectangle, label=\"B138\"];\nn39969446692913152[shape=rectangle, label=\"B139\"];\nn39406496739491840 -> n39969446692913152;\nn39687971716202496[shape=rectangle, label=\"B140\"];\nn40532396646334464[shape=rectangle, label=\"B141\"];\nn39687971716202496 -> n40532396646334464;\nn40250921669623808[shape=rectangle, label=\"B142\"];\nn39687971716202496 -> n40250921669623808;\nn39406496739491840 -> n39687971716202496;\nn38562071809359872 -> n39406496739491840;\nn39125021762781184[shape=rectangle, label=\"B143\"];\nn38562071809359872 -> n39125021762781184;\nn40813871623045120[shape=rectangle, label=\"B144\"];\nn41376821576466432[shape=rectangle, label=\"B145\"];\nn41939771529887744[shape=rectangle, label=\"B146\"];\nn41376821576466432 -> n41939771529887744;\nn40813871623045120 -> n41376821576466432;\nn41095346599755776[shape=rectangle, label=\"B147\"];\nn40813871623045120 -> n41095346599755776;\nn41658296553177088[shape=rectangle, label=\"B148\"];\nn40813871623045120 -> n41658296553177088;\nn38562071809359872 -> n40813871623045120;\nn37999121855938560 -> n38562071809359872;\nn37436171902517248 -> n37999121855938560;\nn36873221949095936 -> n37436171902517248;\nn36310271995674624 -> n36873221949095936;\nn35747322042253312 -> n36310271995674624;\nn35184372088832000 -> n35747322042253312;\nn34902897112121344 -> n35184372088832000;\nn32651097298436096 -> n34902897112121344;\nn32088147345014784 -> n32651097298436096;\nn31525197391593472 -> n32088147345014784;\nn30962247438172160 -> n31525197391593472;\nn30399297484750848 -> n30962247438172160;\nn30117822508040192 -> n30399297484750848;\nn27866022694354944 -> n30117822508040192;\nn27303072740933632 -> n27866022694354944;\nn26740122787512320 -> n27303072740933632;\nn26177172834091008 -> n26740122787512320;\nn25614222880669696 -> n26177172834091008;\nn25332747903959040 -> n25614222880669696;\nn23080948090273792 -> n25332747903959040;\nn22517998136852480 -> n23080948090273792;\nn21955048183431168 -> n22517998136852480;\nn21392098230009856 -> n21955048183431168;\nn20829148276588544 -> n21392098230009856;\nn20266198323167232 -> n20829148276588544;\nn19703248369745920 -> n20266198323167232;\nn19421773393035264 -> n19703248369745920;\nn17169973579350016 -> n19421773393035264;\nn16607023625928704 -> n17169973579350016;\nn16044073672507392 -> n16607023625928704;\nn15481123719086080 -> n16044073672507392;\nn14918173765664768 -> n15481123719086080;\nn14636698788954112 -> n14918173765664768;\nn12384898975268864 -> n14636698788954112;\nn11821949021847552 -> n12384898975268864;\nn11258999068426240 -> n11821949021847552;\nn10696049115004928 -> n11258999068426240;\nn7881299347898368 -> n10696049115004928;\nn7318349394477056 -> n7881299347898368;\nn9007199254740992[shape=rectangle, label=\"B149\"];\nn42502721483309056[shape=rectangle, label=\"B150\"];\nn9007199254740992 -> n42502721483309056;\nn42221246506598400[shape=rectangle, label=\"B151\"];\nn9007199254740992 -> n42221246506598400;\nn7318349394477056 -> n9007199254740992;\nn42784196460019712 -> n7318349394477056;\nn7036874417766400 -> n42784196460019712;\nn5910974510923776 -> n7036874417766400;\nn6755399441055744[shape=rectangle, label=\"B152\"];\nn43347146413441024[shape=rectangle, label=\"B153\"];\nn72339069014638592[shape=rectangle, label=\"B154\"];\nn43910096366862336[shape=rectangle, label=\"B155\"];\nn72339069014638592 -> n43910096366862336;\nn43628621390151680[shape=rectangle, label=\"B156\"];\nn44473046320283648[shape=rectangle, label=\"B157\"];\nn45035996273704960[shape=rectangle, label=\"B158\"];\nn44473046320283648 -> n45035996273704960;\nn44754521296994304[shape=rectangle, label=\"B159\"];\nn45598946227126272[shape=rectangle, label=\"B160\"];\nn45880421203836928[shape=rectangle, label=\"B161\"];\nn45598946227126272 -> n45880421203836928;\nn44754521296994304 -> n45598946227126272;\nn45317471250415616[shape=rectangle, label=\"B162\"];\nn46724846133968896[shape=rectangle, label=\"B163\"];\nn45317471250415616 -> n46724846133968896;\nn46443371157258240[shape=rectangle, label=\"B164\"];\nn47287796087390208[shape=rectangle, label=\"B165\"];\nn47850746040811520[shape=rectangle, label=\"B166\"];\nn48413695994232832[shape=rectangle, label=\"B167\"];\nn47850746040811520 -> n48413695994232832;\nn48132221017522176[shape=rectangle, label=\"B168\"];\nn48695170970943488[shape=rectangle, label=\"B169\"];\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn48695170970943488 -> n49258120924364800;\nn48976645947654144[shape=rectangle, label=\"B171\"];\nn49821070877786112[shape=rectangle, label=\"B172\"];\nn50102545854496768[shape=rectangle, label=\"B173\"];\nn50384020831207424[shape=rectangle, label=\"B174\"];\nn50665495807918080[shape=rectangle, label=\"B175\"];\nn50946970784628736[shape=rectangle, label=\"B176\"];\nn50665495807918080 -> n50946970784628736;\nn50384020831207424 -> n50665495807918080;\nn50102545854496768 -> n50384020831207424;\nn49821070877786112 -> n50102545854496768;\nn48976645947654144 -> n49821070877786112;\nn49539595901075456[shape=rectangle, label=\"B177\"];\nn51228445761339392[shape=rectangle, label=\"B178\"];\nn51791395714760704[shape=rectangle, label=\"B179\"];\nn51228445761339392 -> n51791395714760704;\nn51509920738050048[shape=rectangle, label=\"B180\"];\nn52354345668182016[shape=rectangle, label=\"B181\"];\nn51509920738050048 -> n52354345668182016;\nn52072870691471360[shape=rectangle, label=\"B182\"];\nn52917295621603328[shape=rectangle, label=\"B183\"];\nn52072870691471360 -> n52917295621603328;\nn52635820644892672[shape=rectangle, label=\"B184\"];\nn52072870691471360 -> n52635820644892672;\nn53198770598313984[shape=rectangle, label=\"B185\"];\nn53761720551735296[shape=rectangle, label=\"B186\"];\nn53198770598313984 -> n53761720551735296;\nn53480245575024640[shape=rectangle, label=\"B187\"];\nn54324670505156608[shape=rectangle, label=\"B188\"];\nn53480245575024640 -> n54324670505156608;\nn54043195528445952[shape=rectangle, label=\"B189\"];\nn54887620458577920[shape=rectangle, label=\"B190\"];\nn54043195528445952 -> n54887620458577920;\nn54606145481867264[shape=rectangle, label=\"B191\"];\nn54043195528445952 -> n54606145481867264;\nn55169095435288576[shape=rectangle, label=\"B192\"];\nn55732045388709888[shape=rectangle, label=\"B193\"];\nn55169095435288576 -> n55732045388709888;\nn55450570411999232[shape=rectangle, label=\"B194\"];\nn56294995342131200[shape=rectangle, label=\"B195\"];\nn55450570411999232 -> n56294995342131200;\nn56013520365420544[shape=rectangle, label=\"B196\"];\nn56857945295552512[shape=rectangle, label=\"B197\"];\nn56013520365420544 -> n56857945295552512;\nn56576470318841856[shape=rectangle, label=\"B198\"];\nn57420895248973824[shape=rectangle, label=\"B199\"];\nn56576470318841856 -> n57420895248973824;\nn57139420272263168[shape=rectangle, label=\"B200\"];\nn56576470318841856 -> n57139420272263168;\nn57702370225684480[shape=rectangle, label=\"B201\"];\nn58265320179105792[shape=rectangle, label=\"B202\"];\nn58828270132527104[shape=rectangle, label=\"B203\"];\nn58265320179105792 -> n58828270132527104;\nn58546795155816448[shape=rectangle, label=\"B204\"];\nn59109745109237760[shape=rectangle, label=\"B205\"];\nn59672695062659072[shape=rectangle, label=\"B206\"];\nn59109745109237760 -> n59672695062659072;\nn59391220085948416[shape=rectangle, label=\"B207\"];\nn60235645016080384[shape=rectangle, label=\"B208\"];\nn60517119992791040[shape=rectangle, label=\"B209\"];\nn61080069946212352[shape=rectangle, label=\"B210\"];\nn60517119992791040 -> n61080069946212352;\nn60798594969501696[shape=rectangle, label=\"B211\"];\nn61361544922923008[shape=rectangle, label=\"B212\"];\nn61924494876344320[shape=rectangle, label=\"B213\"];\nn61361544922923008 -> n61924494876344320;\nn61643019899633664[shape=rectangle, label=\"B214\"];\nn62205969853054976[shape=rectangle, label=\"B215\"];\nn62487444829765632[shape=rectangle, label=\"B216\"];\nn62768919806476288[shape=rectangle, label=\"B217\"];\nn63050394783186944[shape=rectangle, label=\"B218\"];\nn63331869759897600[shape=rectangle, label=\"B219\"];\nn63050394783186944 -> n63331869759897600;\nn62768919806476288 -> n63050394783186944;\nn62487444829765632 -> n62768919806476288;\nn62205969853054976 -> n62487444829765632;\nn61643019899633664 -> n62205969853054976;\nn61361544922923008 -> n61643019899633664;\nn60798594969501696 -> n61361544922923008;\nn60517119992791040 -> n60798594969501696;\nn60235645016080384 -> n60517119992791040;\nn59391220085948416 -> n60235645016080384;\nn59954170039369728[shape=rectangle, label=\"B220\"];\nn63894819713318912[shape=rectangle, label=\"B221\"];\nn59954170039369728 -> n63894819713318912;\nn63613344736608256[shape=rectangle, label=\"B222\"];\nn64176294690029568[shape=rectangle, label=\"B223\"];\nn63613344736608256 -> n64176294690029568;\nn59954170039369728 -> n63613344736608256;\nn59391220085948416 -> n59954170039369728;\nn59109745109237760 -> n59391220085948416;\nn58546795155816448 -> n59109745109237760;\nn58265320179105792 -> n58546795155816448;\nn57702370225684480 -> n58265320179105792;\nn57983845202395136[shape=rectangle, label=\"B224\"];\nn64739244643450880[shape=rectangle, label=\"B225\"];\nn57983845202395136 -> n64739244643450880;\nn64457769666740224[shape=rectangle, label=\"B226\"];\nn65020719620161536[shape=rectangle, label=\"B227\"];\nn64457769666740224 -> n65020719620161536;\nn57983845202395136 -> n64457769666740224;\nn57702370225684480 -> n57983845202395136;\nn56576470318841856 -> n57702370225684480;\nn56013520365420544 -> n56576470318841856;\nn55450570411999232 -> n56013520365420544;\nn55169095435288576 -> n55450570411999232;\nn54043195528445952 -> n55169095435288576;\nn53480245575024640 -> n54043195528445952;\nn53198770598313984 -> n53480245575024640;\nn52072870691471360 -> n53198770598313984;\nn51509920738050048 -> n52072870691471360;\nn51228445761339392 -> n51509920738050048;\nn49539595901075456 -> n51228445761339392;\nn48976645947654144 -> n49539595901075456;\nn48695170970943488 -> n48976645947654144;\nn48132221017522176 -> n48695170970943488;\nn47850746040811520 -> n48132221017522176;\nn47287796087390208 -> n47850746040811520;\nn47569271064100864[shape=rectangle, label=\"B228\"];\nn65583669573582848[shape=rectangle, label=\"B229\"];\nn66146619527004160[shape=rectangle, label=\"B230\"];\nn65583669573582848 -> n66146619527004160;\nn65865144550293504[shape=rectangle, label=\"B231\"];\nn66428094503714816[shape=rectangle, label=\"B232\"];\nn66991044457136128[shape=rectangle, label=\"B233\"];\nn66428094503714816 -> n66991044457136128;\nn66709569480425472[shape=rectangle, label=\"B234\"];\nn67272519433846784[shape=rectangle, label=\"B235\"];\nn67553994410557440[shape=rectangle, label=\"B236\"];\nn67835469387268096[shape=rectangle, label=\"B237\"];\nn68116944363978752[shape=rectangle, label=\"B238\"];\nn68398419340689408[shape=rectangle, label=\"B239\"];\nn68116944363978752 -> n68398419340689408;\nn67835469387268096 -> n68116944363978752;\nn67553994410557440 -> n67835469387268096;\nn67272519433846784 -> n67553994410557440;\nn66709569480425472 -> n67272519433846784;\nn66428094503714816 -> n66709569480425472;\nn65865144550293504 -> n66428094503714816;\nn65583669573582848 -> n65865144550293504;\nn47569271064100864 -> n65583669573582848;\nn65302194596872192[shape=rectangle, label=\"B240\"];\nn68961369294110720[shape=rectangle, label=\"B241\"];\nn69524319247532032[shape=rectangle, label=\"B242\"];\nn68961369294110720 -> n69524319247532032;\nn69242844270821376[shape=rectangle, label=\"B243\"];\nn68961369294110720 -> n69242844270821376;\nn65302194596872192 -> n68961369294110720;\nn68679894317400064[shape=rectangle, label=\"B244\"];\nn69805794224242688[shape=rectangle, label=\"B245\"];\nn68679894317400064 -> n69805794224242688;\nn65302194596872192 -> n68679894317400064;\nn47569271064100864 -> n65302194596872192;\nn47287796087390208 -> n47569271064100864;\nn46443371157258240 -> n47287796087390208;\nn47006321110679552[shape=rectangle, label=\"B246\"];\nn70368744177664000[shape=rectangle, label=\"B247\"];\nn47006321110679552 -> n70368744177664000;\nn70087269200953344[shape=rectangle, label=\"B248\"];\nn70650219154374656[shape=rectangle, label=\"B249\"];\nn71213169107795968[shape=rectangle, label=\"B250\"];\nn70650219154374656 -> n71213169107795968;\nn70931694131085312[shape=rectangle, label=\"B251\"];\nn71776119061217280[shape=rectangle, label=\"B252\"];\nn70931694131085312 -> n71776119061217280;\nn71494644084506624[shape=rectangle, label=\"B253\"];\nn72057594037927936[shape=rectangle, label=\"B254\"];\nn71494644084506624 -> n72057594037927936;\nn70931694131085312 -> n71494644084506624;\nn70650219154374656 -> n70931694131085312;\nn70087269200953344 -> n70650219154374656;\nn47006321110679552 -> n70087269200953344;\nn46443371157258240 -> n47006321110679552;\nn45317471250415616 -> n46443371157258240;\nn44754521296994304 -> n45317471250415616;\nn46161896180547584[shape=rectangle, label=\"B255\"];\nn44754521296994304 -> n46161896180547584;\nn44473046320283648 -> n44754521296994304;\nn43628621390151680 -> n44473046320283648;\nn44191571343572992[shape=rectangle, label=\"B256\"];\nn43628621390151680 -> n44191571343572992;\nn72339069014638592 -> n43628621390151680;\nn43347146413441024 -> n72339069014638592;\nn6755399441055744 -> n43347146413441024;\nn43065671436730368[shape=rectangle, label=\"B257\"];\nn72902018968059904[shape=rectangle, label=\"B258\"];\nn43065671436730368 -> n72902018968059904;\nn6755399441055744 -> n43065671436730368;\nn5910974510923776 -> n6755399441055744;\nn5066549580791808 -> n5910974510923776;\nn4503599627370496 -> n5066549580791808;\nn3940649673949184 -> n4503599627370496;\nn3377699720527872 -> n3940649673949184;\nn2814749767106560 -> n3377699720527872;\nn72620543991349248 -> n2814749767106560;\nn2533274790395904 -> n72620543991349248;\nn1688849860263936 -> n2533274790395904;\nn2251799813685248[shape=rectangle, label=\"B259\"];\nn1688849860263936 -> n2251799813685248;\nn844424930131968 -> n1688849860263936;\nn281474976710656 -> n844424930131968;\nn0 -> n281474976710656;\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-217.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1407374883553280[shape=rectangle, label=\"B5\"];\nn34339947158700032[shape=rectangle, label=\"B6\"];\nn1970324836974592[shape=rectangle, label=\"B7\"];\nn2533274790395904[shape=rectangle, label=\"B8\"];\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn2251799813685248[shape=rectangle, label=\"B11\"];\nn3377699720527872[shape=rectangle, label=\"B12\"];\nn3659174697238528[shape=rectangle, label=\"B13\"];\nn3940649673949184[shape=rectangle, label=\"B14\"];\nn4222124650659840[shape=rectangle, label=\"B15\"];\nn1688849860263936[shape=rectangle, label=\"B16\"];\nn4785074604081152[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn5066549580791808[shape=rectangle, label=\"B19\"];\nn5629499534213120[shape=rectangle, label=\"B20\"];\nn28428972647776256[shape=rectangle, label=\"B21\"];\nn6192449487634432[shape=rectangle, label=\"B22\"];\nn5910974510923776[shape=rectangle, label=\"B23\"];\nn6755399441055744[shape=rectangle, label=\"B24\"];\nn7318349394477056[shape=rectangle, label=\"B25\"];\nn7036874417766400[shape=rectangle, label=\"B26\"];\nn7881299347898368[shape=rectangle, label=\"B27\"];\nn7599824371187712[shape=rectangle, label=\"B28\"];\nn8444249301319680[shape=rectangle, label=\"B29\"];\nn8162774324609024[shape=rectangle, label=\"B30\"];\nn8725724278030336[shape=rectangle, label=\"B31\"];\nn9288674231451648[shape=rectangle, label=\"B32\"];\nn9007199254740992[shape=rectangle, label=\"B33\"];\nn9570149208162304[shape=rectangle, label=\"B34\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn9851624184872960[shape=rectangle, label=\"B36\"];\nn10414574138294272[shape=rectangle, label=\"B37\"];\nn10977524091715584[shape=rectangle, label=\"B38\"];\nn10696049115004928[shape=rectangle, label=\"B39\"];\nn11258999068426240[shape=rectangle, label=\"B40\"];\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn11540474045136896[shape=rectangle, label=\"B42\"];\nn12384898975268864[shape=rectangle, label=\"B43\"];\nn12947848928690176[shape=rectangle, label=\"B44\"];\nn12666373951979520[shape=rectangle, label=\"B45\"];\nn13229323905400832[shape=rectangle, label=\"B46\"];\nn13792273858822144[shape=rectangle, label=\"B47\"];\nn13510798882111488[shape=rectangle, label=\"B48\"];\nn14073748835532800[shape=rectangle, label=\"B49\"];\nn14636698788954112[shape=rectangle, label=\"B50\"];\nn14355223812243456[shape=rectangle, label=\"B51\"];\nn14918173765664768[shape=rectangle, label=\"B52\"];\nn15481123719086080[shape=rectangle, label=\"B53\"];\nn15199648742375424[shape=rectangle, label=\"B54\"];\nn15762598695796736[shape=rectangle, label=\"B55\"];\nn16044073672507392[shape=rectangle, label=\"B56\"];\nn16607023625928704[shape=rectangle, label=\"B57\"];\nn16325548649218048[shape=rectangle, label=\"B58\"];\nn16888498602639360[shape=rectangle, label=\"B59\"];\nn17451448556060672[shape=rectangle, label=\"B60\"];\nn17169973579350016[shape=rectangle, label=\"B61\"];\nn17732923532771328[shape=rectangle, label=\"B62\"];\nn18295873486192640[shape=rectangle, label=\"B63\"];\nn18014398509481984[shape=rectangle, label=\"B64\"];\nn12103423998558208[shape=rectangle, label=\"B65\"];\nn18858823439613952[shape=rectangle, label=\"B66\"];\nn6473924464345088[shape=rectangle, label=\"B67\"];\nn19421773393035264[shape=rectangle, label=\"B68\"];\nn19140298416324608[shape=rectangle, label=\"B69\"];\nn19984723346456576[shape=rectangle, label=\"B70\"];\nn18577348462903296[shape=rectangle, label=\"B71\"];\nn20547673299877888[shape=rectangle, label=\"B72\"];\nn21110623253299200[shape=rectangle, label=\"B73\"];\nn20829148276588544[shape=rectangle, label=\"B74\"];\nn21673573206720512[shape=rectangle, label=\"B75\"];\nn21392098230009856[shape=rectangle, label=\"B76\"];\nn22236523160141824[shape=rectangle, label=\"B77\"];\nn21955048183431168[shape=rectangle, label=\"B78\"];\nn22799473113563136[shape=rectangle, label=\"B79\"];\nn20266198323167232[shape=rectangle, label=\"B80\"];\nn23643898043695104[shape=rectangle, label=\"B81\"];\nn23362423066984448[shape=rectangle, label=\"B82\"];\nn24206847997116416[shape=rectangle, label=\"B83\"];\nn24769797950537728[shape=rectangle, label=\"B84\"];\nn25332747903959040[shape=rectangle, label=\"B85\"];\nn25051272927248384[shape=rectangle, label=\"B86\"];\nn25614222880669696[shape=rectangle, label=\"B87\"];\nn24488322973827072[shape=rectangle, label=\"B88\"];\nn26177172834091008[shape=rectangle, label=\"B89\"];\nn25895697857380352[shape=rectangle, label=\"B90\"];\nn23925373020405760[shape=rectangle, label=\"B91\"];\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn27021597764222976[shape=rectangle, label=\"B93\"];\nn26740122787512320[shape=rectangle, label=\"B94\"];\nn27303072740933632[shape=rectangle, label=\"B95\"];\nn27584547717644288[shape=rectangle, label=\"B96\"];\nn23080948090273792[shape=rectangle, label=\"B97\"];\nn22517998136852480[shape=rectangle, label=\"B98\"];\nn19703248369745920[shape=rectangle, label=\"B99\"];\nn28147497671065600[shape=rectangle, label=\"B100\"];\nn27866022694354944[shape=rectangle, label=\"B101\"];\nn28710447624486912[shape=rectangle, label=\"B102\"];\nn4503599627370496[shape=rectangle, label=\"B103\"];\nn29273397577908224[shape=rectangle, label=\"B104\"];\nn29836347531329536[shape=rectangle, label=\"B105\"];\nn30117822508040192[shape=rectangle, label=\"B106\"];\nn30399297484750848[shape=rectangle, label=\"B107\"];\nn28991922601197568[shape=rectangle, label=\"B108\"];\nn29554872554618880[shape=rectangle, label=\"B109\"];\nn30962247438172160[shape=rectangle, label=\"B110\"];\nn31243722414882816[shape=rectangle, label=\"B111\"];\nn31525197391593472[shape=rectangle, label=\"B112\"];\nn31806672368304128[shape=rectangle, label=\"B113\"];\nn30680772461461504[shape=rectangle, label=\"B114\"];\nn32369622321725440[shape=rectangle, label=\"B115\"];\nn32932572275146752[shape=rectangle, label=\"B116\"];\nn32651097298436096[shape=rectangle, label=\"B117\"];\nn33495522228568064[shape=rectangle, label=\"B118\"];\nn33214047251857408[shape=rectangle, label=\"B119\"];\nn34058472181989376[shape=rectangle, label=\"B120\"];\nn33776997205278720[shape=rectangle, label=\"B121\"];\nn32088147345014784[shape=rectangle, label=\"B122\"];\nn34902897112121344[shape=rectangle, label=\"B123\"];\nn35465847065542656[shape=rectangle, label=\"B124\"];\nn35747322042253312[shape=rectangle, label=\"B125\"];\nn36028797018963968[shape=rectangle, label=\"B126\"];\nn35184372088832000[shape=rectangle, label=\"B127\"];\nn36310271995674624[shape=rectangle, label=\"B128\"];\nn36591746972385280[shape=rectangle, label=\"B129\"];\nn36873221949095936[shape=rectangle, label=\"B130\"];\nn37154696925806592[shape=rectangle, label=\"B131\"];\nn34621422135410688[shape=rectangle, label=\"B132\"];\nn37717646879227904[shape=rectangle, label=\"B133\"];\nn38280596832649216[shape=rectangle, label=\"B134\"];\nn38562071809359872[shape=rectangle, label=\"B135\"];\nn38843546786070528[shape=rectangle, label=\"B136\"];\nn37999121855938560[shape=rectangle, label=\"B137\"];\nn39125021762781184[shape=rectangle, label=\"B138\"];\nn39406496739491840[shape=rectangle, label=\"B139\"];\nn39687971716202496[shape=rectangle, label=\"B140\"];\nn39969446692913152[shape=rectangle, label=\"B141\"];\nn37436171902517248[shape=rectangle, label=\"B142\"];\nn40532396646334464[shape=rectangle, label=\"B143\"];\nn40250921669623808[shape=rectangle, label=\"B144\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn844424930131968 -> n1407374883553280;\nn1407374883553280 -> n34339947158700032;\nn34339947158700032 -> n1688849860263936;\nn34339947158700032 -> n1970324836974592;\nn1970324836974592 -> n2251799813685248;\nn1970324836974592 -> n2533274790395904;\nn2533274790395904 -> n2251799813685248;\nn2533274790395904 -> n2814749767106560;\nn2814749767106560 -> n2251799813685248;\nn2814749767106560 -> n3096224743817216;\nn3096224743817216 -> n2251799813685248;\nn2251799813685248 -> n1688849860263936;\nn2251799813685248 -> n3377699720527872;\nn3377699720527872 -> n1688849860263936;\nn3377699720527872 -> n3659174697238528;\nn3659174697238528 -> n1688849860263936;\nn3659174697238528 -> n3940649673949184;\nn3940649673949184 -> n1688849860263936;\nn3940649673949184 -> n4222124650659840;\nn4222124650659840 -> n1688849860263936;\nn1688849860263936 -> n4503599627370496;\nn1688849860263936 -> n4785074604081152;\nn4785074604081152 -> n5066549580791808;\nn4785074604081152 -> n5348024557502464;\nn5348024557502464 -> n5066549580791808;\nn5066549580791808 -> n4503599627370496;\nn5066549580791808 -> n5629499534213120;\nn5629499534213120 -> n28428972647776256;\nn28428972647776256 -> n5910974510923776;\nn28428972647776256 -> n6192449487634432;\nn6192449487634432 -> n5910974510923776;\nn5910974510923776 -> n6473924464345088;\nn5910974510923776 -> n6755399441055744;\nn6755399441055744 -> n7036874417766400;\nn6755399441055744 -> n7318349394477056;\nn7318349394477056 -> n7036874417766400;\nn7036874417766400 -> n7599824371187712;\nn7036874417766400 -> n7881299347898368;\nn7881299347898368 -> n6473924464345088;\nn7881299347898368 -> n7599824371187712;\nn7599824371187712 -> n8162774324609024;\nn7599824371187712 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n6473924464345088;\nn8162774324609024 -> n8725724278030336;\nn8725724278030336 -> n9007199254740992;\nn8725724278030336 -> n9288674231451648;\nn9288674231451648 -> n9007199254740992;\nn9007199254740992 -> n6473924464345088;\nn9007199254740992 -> n9570149208162304;\nn9570149208162304 -> n9851624184872960;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n9851624184872960;\nn9851624184872960 -> n6473924464345088;\nn9851624184872960 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10977524091715584;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n6473924464345088;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n11540474045136896;\nn11258999068426240 -> n11821949021847552;\nn11821949021847552 -> n11540474045136896;\nn11540474045136896 -> n12103423998558208;\nn11540474045136896 -> n12384898975268864;\nn12384898975268864 -> n12666373951979520;\nn12384898975268864 -> n12947848928690176;\nn12947848928690176 -> n12666373951979520;\nn12666373951979520 -> n12103423998558208;\nn12666373951979520 -> n13229323905400832;\nn13229323905400832 -> n13510798882111488;\nn13229323905400832 -> n13792273858822144;\nn13792273858822144 -> n13510798882111488;\nn13510798882111488 -> n12103423998558208;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n14355223812243456;\nn14355223812243456 -> n12103423998558208;\nn14355223812243456 -> n14918173765664768;\nn14918173765664768 -> n15199648742375424;\nn14918173765664768 -> n15481123719086080;\nn15481123719086080 -> n15199648742375424;\nn15199648742375424 -> n12103423998558208;\nn15199648742375424 -> n15762598695796736;\nn15762598695796736 -> n12103423998558208;\nn15762598695796736 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn16044073672507392 -> n16607023625928704;\nn16607023625928704 -> n16325548649218048;\nn16325548649218048 -> n12103423998558208;\nn16325548649218048 -> n16888498602639360;\nn16888498602639360 -> n17169973579350016;\nn16888498602639360 -> n17451448556060672;\nn17451448556060672 -> n17169973579350016;\nn17169973579350016 -> n12103423998558208;\nn17169973579350016 -> n17732923532771328;\nn17732923532771328 -> n18014398509481984;\nn17732923532771328 -> n18295873486192640;\nn18295873486192640 -> n18014398509481984;\nn18014398509481984 -> n6473924464345088;\nn18014398509481984 -> n12103423998558208;\nn12103423998558208 -> n18577348462903296;\nn12103423998558208 -> n18858823439613952;\nn18858823439613952 -> n18577348462903296;\nn18858823439613952 -> n6473924464345088;\nn6473924464345088 -> n19140298416324608;\nn6473924464345088 -> n19421773393035264;\nn19421773393035264 -> n19140298416324608;\nn19140298416324608 -> n19703248369745920;\nn19140298416324608 -> n19984723346456576;\nn19984723346456576 -> n19703248369745920;\nn19984723346456576 -> n18577348462903296;\nn18577348462903296 -> n20266198323167232;\nn18577348462903296 -> n20547673299877888;\nn20547673299877888 -> n20829148276588544;\nn20547673299877888 -> n21110623253299200;\nn21110623253299200 -> n20829148276588544;\nn20829148276588544 -> n21392098230009856;\nn20829148276588544 -> n21673573206720512;\nn21673573206720512 -> n19703248369745920;\nn21392098230009856 -> n21955048183431168;\nn21392098230009856 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn21955048183431168 -> n22517998136852480;\nn21955048183431168 -> n22799473113563136;\nn22799473113563136 -> n23080948090273792;\nn20266198323167232 -> n23362423066984448;\nn20266198323167232 -> n23643898043695104;\nn23643898043695104 -> n23362423066984448;\nn23362423066984448 -> n23925373020405760;\nn23362423066984448 -> n24206847997116416;\nn24206847997116416 -> n24488322973827072;\nn24206847997116416 -> n24769797950537728;\nn24769797950537728 -> n25051272927248384;\nn24769797950537728 -> n25332747903959040;\nn25332747903959040 -> n25051272927248384;\nn25051272927248384 -> n24488322973827072;\nn25051272927248384 -> n25614222880669696;\nn25614222880669696 -> n19703248369745920;\nn24488322973827072 -> n25895697857380352;\nn24488322973827072 -> n26177172834091008;\nn26177172834091008 -> n25895697857380352;\nn25895697857380352 -> n19703248369745920;\nn23925373020405760 -> n22517998136852480;\nn23925373020405760 -> n26458647810801664;\nn26458647810801664 -> n26740122787512320;\nn26458647810801664 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn26740122787512320 -> n19703248369745920;\nn26740122787512320 -> n27303072740933632;\nn27303072740933632 -> n22517998136852480;\nn27303072740933632 -> n27584547717644288;\nn27584547717644288 -> n23080948090273792;\nn23080948090273792 -> n22517998136852480;\nn22517998136852480 -> n19703248369745920;\nn19703248369745920 -> n27866022694354944;\nn19703248369745920 -> n28147497671065600;\nn28147497671065600 -> n27866022694354944;\nn27866022694354944 -> n28428972647776256;\nn27866022694354944 -> n28710447624486912;\nn28710447624486912 -> n4503599627370496;\nn4503599627370496 -> n28991922601197568;\nn4503599627370496 -> n29273397577908224;\nn29273397577908224 -> n29554872554618880;\nn29273397577908224 -> n29836347531329536;\nn29836347531329536 -> n29554872554618880;\nn29836347531329536 -> n30117822508040192;\nn30117822508040192 -> n29554872554618880;\nn30117822508040192 -> n30399297484750848;\nn30399297484750848 -> n29554872554618880;\nn28991922601197568 -> n29554872554618880;\nn29554872554618880 -> n30680772461461504;\nn29554872554618880 -> n30962247438172160;\nn30962247438172160 -> n30680772461461504;\nn30962247438172160 -> n31243722414882816;\nn31243722414882816 -> n30680772461461504;\nn31243722414882816 -> n31525197391593472;\nn31525197391593472 -> n30680772461461504;\nn31525197391593472 -> n31806672368304128;\nn31806672368304128 -> n30680772461461504;\nn30680772461461504 -> n32088147345014784;\nn30680772461461504 -> n32369622321725440;\nn32369622321725440 -> n32651097298436096;\nn32369622321725440 -> n32932572275146752;\nn32932572275146752 -> n32651097298436096;\nn32651097298436096 -> n33214047251857408;\nn32651097298436096 -> n33495522228568064;\nn33495522228568064 -> n33214047251857408;\nn33214047251857408 -> n33776997205278720;\nn33214047251857408 -> n34058472181989376;\nn34058472181989376 -> n34339947158700032;\nn33776997205278720 -> n34339947158700032;\nn32088147345014784 -> n34621422135410688;\nn32088147345014784 -> n34902897112121344;\nn34902897112121344 -> n35184372088832000;\nn34902897112121344 -> n35465847065542656;\nn35465847065542656 -> n35184372088832000;\nn35465847065542656 -> n35747322042253312;\nn35747322042253312 -> n35184372088832000;\nn35747322042253312 -> n36028797018963968;\nn36028797018963968 -> n35184372088832000;\nn35184372088832000 -> n34621422135410688;\nn35184372088832000 -> n36310271995674624;\nn36310271995674624 -> n34621422135410688;\nn36310271995674624 -> n36591746972385280;\nn36591746972385280 -> n34621422135410688;\nn36591746972385280 -> n36873221949095936;\nn36873221949095936 -> n34621422135410688;\nn36873221949095936 -> n37154696925806592;\nn37154696925806592 -> n34621422135410688;\nn34621422135410688 -> n37436171902517248;\nn34621422135410688 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37717646879227904 -> n38280596832649216;\nn38280596832649216 -> n37999121855938560;\nn38280596832649216 -> n38562071809359872;\nn38562071809359872 -> n37999121855938560;\nn38562071809359872 -> n38843546786070528;\nn38843546786070528 -> n37999121855938560;\nn37999121855938560 -> n37436171902517248;\nn37999121855938560 -> n39125021762781184;\nn39125021762781184 -> n37436171902517248;\nn39125021762781184 -> n39406496739491840;\nn39406496739491840 -> n37436171902517248;\nn39406496739491840 -> n39687971716202496;\nn39687971716202496 -> n37436171902517248;\nn39687971716202496 -> n39969446692913152;\nn39969446692913152 -> n37436171902517248;\nn37436171902517248 -> n40250921669623808;\nn37436171902517248 -> n40532396646334464;\nn40532396646334464 -> n34339947158700032;\nn281474976710656 -> n0[style=dotted];\nn1407374883553280 -> n281474976710656[style=dotted];\nn34339947158700032 -> n1407374883553280[style=dotted];\nn2251799813685248 -> n1970324836974592[style=dotted];\nn1688849860263936 -> n34339947158700032[style=dotted];\nn5066549580791808 -> n4785074604081152[style=dotted];\nn28428972647776256 -> n5629499534213120[style=dotted];\nn5910974510923776 -> n28428972647776256[style=dotted];\nn7036874417766400 -> n6755399441055744[style=dotted];\nn7599824371187712 -> n7036874417766400[style=dotted];\nn8162774324609024 -> n7599824371187712[style=dotted];\nn9007199254740992 -> n8725724278030336[style=dotted];\nn9851624184872960 -> n9570149208162304[style=dotted];\nn10696049115004928 -> n10414574138294272[style=dotted];\nn11540474045136896 -> n11258999068426240[style=dotted];\nn12666373951979520 -> n12384898975268864[style=dotted];\nn13510798882111488 -> n13229323905400832[style=dotted];\nn14355223812243456 -> n14073748835532800[style=dotted];\nn15199648742375424 -> n14918173765664768[style=dotted];\nn16325548649218048 -> n16044073672507392[style=dotted];\nn17169973579350016 -> n16888498602639360[style=dotted];\nn18014398509481984 -> n17732923532771328[style=dotted];\nn12103423998558208 -> n11540474045136896[style=dotted];\nn6473924464345088 -> n5910974510923776[style=dotted];\nn19140298416324608 -> n6473924464345088[style=dotted];\nn18577348462903296 -> n5910974510923776[style=dotted];\nn20829148276588544 -> n20547673299877888[style=dotted];\nn21955048183431168 -> n21392098230009856[style=dotted];\nn23362423066984448 -> n20266198323167232[style=dotted];\nn25051272927248384 -> n24769797950537728[style=dotted];\nn24488322973827072 -> n24206847997116416[style=dotted];\nn25895697857380352 -> n24488322973827072[style=dotted];\nn26740122787512320 -> n26458647810801664[style=dotted];\nn23080948090273792 -> n18577348462903296[style=dotted];\nn22517998136852480 -> n18577348462903296[style=dotted];\nn19703248369745920 -> n5910974510923776[style=dotted];\nn27866022694354944 -> n19703248369745920[style=dotted];\nn4503599627370496 -> n1688849860263936[style=dotted];\nn29554872554618880 -> n4503599627370496[style=dotted];\nn30680772461461504 -> n29554872554618880[style=dotted];\nn32651097298436096 -> n32369622321725440[style=dotted];\nn33214047251857408 -> n32651097298436096[style=dotted];\nn35184372088832000 -> n34902897112121344[style=dotted];\nn34621422135410688 -> n32088147345014784[style=dotted];\nn37999121855938560 -> n37717646879227904[style=dotted];\nn37436171902517248 -> n34621422135410688[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-218.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn1407374883553280[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn1970324836974592[shape=rectangle, label=\"B8\"];\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn2533274790395904[shape=rectangle, label=\"B10\"];\nn3377699720527872[shape=rectangle, label=\"B11\"];\nn3096224743817216[shape=rectangle, label=\"B12\"];\nn3940649673949184[shape=rectangle, label=\"B13\"];\nn4503599627370496[shape=rectangle, label=\"B14\"];\nn4222124650659840[shape=rectangle, label=\"B15\"];\nn3659174697238528[shape=rectangle, label=\"B16\"];\nn5348024557502464[shape=rectangle, label=\"B17\"];\nn5910974510923776[shape=rectangle, label=\"B18\"];\nn5629499534213120[shape=rectangle, label=\"B19\"];\nn6473924464345088[shape=rectangle, label=\"B20\"];\nn6192449487634432[shape=rectangle, label=\"B21\"];\nn7036874417766400[shape=rectangle, label=\"B22\"];\nn6755399441055744[shape=rectangle, label=\"B23\"];\nn7599824371187712[shape=rectangle, label=\"B24\"];\nn8162774324609024[shape=rectangle, label=\"B25\"];\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn8444249301319680[shape=rectangle, label=\"B27\"];\nn7318349394477056[shape=rectangle, label=\"B28\"];\nn8725724278030336[shape=rectangle, label=\"B29\"];\nn5066549580791808[shape=rectangle, label=\"B30\"];\nn9288674231451648[shape=rectangle, label=\"B31\"];\nn9851624184872960[shape=rectangle, label=\"B32\"];\nn9570149208162304[shape=rectangle, label=\"B33\"];\nn10414574138294272[shape=rectangle, label=\"B34\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn10977524091715584[shape=rectangle, label=\"B36\"];\nn10696049115004928[shape=rectangle, label=\"B37\"];\nn11540474045136896[shape=rectangle, label=\"B38\"];\nn11258999068426240[shape=rectangle, label=\"B39\"];\nn12103423998558208[shape=rectangle, label=\"B40\"];\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn12384898975268864[shape=rectangle, label=\"B42\"];\nn12947848928690176[shape=rectangle, label=\"B43\"];\nn13510798882111488[shape=rectangle, label=\"B44\"];\nn13229323905400832[shape=rectangle, label=\"B45\"];\nn13792273858822144[shape=rectangle, label=\"B46\"];\nn12666373951979520[shape=rectangle, label=\"B47\"];\nn14355223812243456[shape=rectangle, label=\"B48\"];\nn14073748835532800[shape=rectangle, label=\"B49\"];\nn14918173765664768[shape=rectangle, label=\"B50\"];\nn14636698788954112[shape=rectangle, label=\"B51\"];\nn15481123719086080[shape=rectangle, label=\"B52\"];\nn15199648742375424[shape=rectangle, label=\"B53\"];\nn16044073672507392[shape=rectangle, label=\"B54\"];\nn16607023625928704[shape=rectangle, label=\"B55\"];\nn16325548649218048[shape=rectangle, label=\"B56\"];\nn16888498602639360[shape=rectangle, label=\"B57\"];\nn15762598695796736[shape=rectangle, label=\"B58\"];\nn17451448556060672[shape=rectangle, label=\"B59\"];\nn18014398509481984[shape=rectangle, label=\"B60\"];\nn17732923532771328[shape=rectangle, label=\"B61\"];\nn18577348462903296[shape=rectangle, label=\"B62\"];\nn18295873486192640[shape=rectangle, label=\"B63\"];\nn19140298416324608[shape=rectangle, label=\"B64\"];\nn18858823439613952[shape=rectangle, label=\"B65\"];\nn19703248369745920[shape=rectangle, label=\"B66\"];\nn19421773393035264[shape=rectangle, label=\"B67\"];\nn20266198323167232[shape=rectangle, label=\"B68\"];\nn19984723346456576[shape=rectangle, label=\"B69\"];\nn20547673299877888[shape=rectangle, label=\"B70\"];\nn21110623253299200[shape=rectangle, label=\"B71\"];\nn20829148276588544[shape=rectangle, label=\"B72\"];\nn21392098230009856[shape=rectangle, label=\"B73\"];\nn21673573206720512[shape=rectangle, label=\"B74\"];\nn17169973579350016[shape=rectangle, label=\"B75\"];\nn22236523160141824[shape=rectangle, label=\"B76\"];\nn21955048183431168[shape=rectangle, label=\"B77\"];\nn22799473113563136[shape=rectangle, label=\"B78\"];\nn22517998136852480[shape=rectangle, label=\"B79\"];\nn23643898043695104[shape=rectangle, label=\"B80\"];\nn23362423066984448[shape=rectangle, label=\"B81\"];\nn24206847997116416[shape=rectangle, label=\"B82\"];\nn23925373020405760[shape=rectangle, label=\"B83\"];\nn24769797950537728[shape=rectangle, label=\"B84\"];\nn24488322973827072[shape=rectangle, label=\"B85\"];\nn25332747903959040[shape=rectangle, label=\"B86\"];\nn25051272927248384[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn25895697857380352[shape=rectangle, label=\"B89\"];\nn26177172834091008[shape=rectangle, label=\"B90\"];\nn23080948090273792[shape=rectangle, label=\"B91\"];\nn26740122787512320[shape=rectangle, label=\"B92\"];\nn27303072740933632[shape=rectangle, label=\"B93\"];\nn27866022694354944[shape=rectangle, label=\"B94\"];\nn27584547717644288[shape=rectangle, label=\"B95\"];\nn26458647810801664[shape=rectangle, label=\"B96\"];\nn28710447624486912[shape=rectangle, label=\"B97\"];\nn28428972647776256[shape=rectangle, label=\"B98\"];\nn29273397577908224[shape=rectangle, label=\"B99\"];\nn28991922601197568[shape=rectangle, label=\"B100\"];\nn29836347531329536[shape=rectangle, label=\"B101\"];\nn30399297484750848[shape=rectangle, label=\"B102\"];\nn30117822508040192[shape=rectangle, label=\"B103\"];\nn30680772461461504[shape=rectangle, label=\"B104\"];\nn29554872554618880[shape=rectangle, label=\"B105\"];\nn31243722414882816[shape=rectangle, label=\"B106\"];\nn30962247438172160[shape=rectangle, label=\"B107\"];\nn31806672368304128[shape=rectangle, label=\"B108\"];\nn31525197391593472[shape=rectangle, label=\"B109\"];\nn32651097298436096[shape=rectangle, label=\"B110\"];\nn32369622321725440[shape=rectangle, label=\"B111\"];\nn32088147345014784[shape=rectangle, label=\"B112\"];\nn33214047251857408[shape=rectangle, label=\"B113\"];\nn34339947158700032[shape=rectangle, label=\"B114\"];\nn33495522228568064[shape=rectangle, label=\"B115\"];\nn34058472181989376[shape=rectangle, label=\"B116\"];\nn33776997205278720[shape=rectangle, label=\"B117\"];\nn32932572275146752[shape=rectangle, label=\"B118\"];\nn28147497671065600[shape=rectangle, label=\"B119\"];\nn27021597764222976[shape=rectangle, label=\"B120\"];\nn34902897112121344[shape=rectangle, label=\"B121\"];\nn9007199254740992[shape=rectangle, label=\"B122\"];\nn35747322042253312[shape=rectangle, label=\"B123\"];\nn36310271995674624[shape=rectangle, label=\"B124\"];\nn36873221949095936[shape=rectangle, label=\"B125\"];\nn37436171902517248[shape=rectangle, label=\"B126\"];\nn37717646879227904[shape=rectangle, label=\"B127\"];\nn36028797018963968[shape=rectangle, label=\"B128\"];\nn38562071809359872[shape=rectangle, label=\"B129\"];\nn38280596832649216[shape=rectangle, label=\"B130\"];\nn39125021762781184[shape=rectangle, label=\"B131\"];\nn38843546786070528[shape=rectangle, label=\"B132\"];\nn39406496739491840[shape=rectangle, label=\"B133\"];\nn37999121855938560[shape=rectangle, label=\"B134\"];\nn39687971716202496[shape=rectangle, label=\"B135\"];\nn35184372088832000[shape=rectangle, label=\"B136\"];\nn34621422135410688[shape=rectangle, label=\"B137\"];\nn4785074604081152[shape=rectangle, label=\"B138\"];\nn37154696925806592[shape=rectangle, label=\"B139\"];\nn40250921669623808[shape=rectangle, label=\"B140\"];\nn39969446692913152[shape=rectangle, label=\"B141\"];\nn40813871623045120[shape=rectangle, label=\"B142\"];\nn40532396646334464[shape=rectangle, label=\"B143\"];\nn41376821576466432[shape=rectangle, label=\"B144\"];\nn41095346599755776[shape=rectangle, label=\"B145\"];\nn41939771529887744[shape=rectangle, label=\"B146\"];\nn41658296553177088[shape=rectangle, label=\"B147\"];\nn42502721483309056[shape=rectangle, label=\"B148\"];\nn42221246506598400[shape=rectangle, label=\"B149\"];\nn42784196460019712[shape=rectangle, label=\"B150\"];\nn43347146413441024[shape=rectangle, label=\"B151\"];\nn43065671436730368[shape=rectangle, label=\"B152\"];\nn43910096366862336[shape=rectangle, label=\"B153\"];\nn43628621390151680[shape=rectangle, label=\"B154\"];\nn44191571343572992[shape=rectangle, label=\"B155\"];\nn36591746972385280[shape=rectangle, label=\"B156\"];\nn44754521296994304[shape=rectangle, label=\"B157\"];\nn44473046320283648[shape=rectangle, label=\"B158\"];\nn45317471250415616[shape=rectangle, label=\"B159\"];\nn45035996273704960[shape=rectangle, label=\"B160\"];\nn45880421203836928[shape=rectangle, label=\"B161\"];\nn45598946227126272[shape=rectangle, label=\"B162\"];\nn46443371157258240[shape=rectangle, label=\"B163\"];\nn46161896180547584[shape=rectangle, label=\"B164\"];\nn47006321110679552[shape=rectangle, label=\"B165\"];\nn46724846133968896[shape=rectangle, label=\"B166\"];\nn47287796087390208[shape=rectangle, label=\"B167\"];\nn47850746040811520[shape=rectangle, label=\"B168\"];\nn47569271064100864[shape=rectangle, label=\"B169\"];\nn48413695994232832[shape=rectangle, label=\"B170\"];\nn48132221017522176[shape=rectangle, label=\"B171\"];\nn48695170970943488[shape=rectangle, label=\"B172\"];\nn35465847065542656[shape=rectangle, label=\"B173\"];\nn48976645947654144[shape=rectangle, label=\"B174\"];\nn49258120924364800[shape=rectangle, label=\"B175\"];\nn49539595901075456[shape=rectangle, label=\"B176\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n844424930131968;\nn844424930131968 -> n1407374883553280;\nn844424930131968 -> n1688849860263936;\nn1688849860263936 -> n1407374883553280;\nn1407374883553280 -> n1970324836974592;\nn1407374883553280 -> n2251799813685248;\nn2251799813685248 -> n1970324836974592;\nn1970324836974592 -> n2533274790395904;\nn1970324836974592 -> n2814749767106560;\nn2814749767106560 -> n2533274790395904;\nn2533274790395904 -> n3096224743817216;\nn2533274790395904 -> n3377699720527872;\nn3377699720527872 -> n3096224743817216;\nn3096224743817216 -> n3659174697238528;\nn3096224743817216 -> n3940649673949184;\nn3940649673949184 -> n4222124650659840;\nn3940649673949184 -> n4503599627370496;\nn4503599627370496 -> n4222124650659840;\nn4222124650659840 -> n4785074604081152;\nn4222124650659840 -> n3659174697238528;\nn3659174697238528 -> n5066549580791808;\nn3659174697238528 -> n5348024557502464;\nn5348024557502464 -> n5629499534213120;\nn5348024557502464 -> n5910974510923776;\nn5910974510923776 -> n5629499534213120;\nn5629499534213120 -> n6192449487634432;\nn5629499534213120 -> n6473924464345088;\nn6473924464345088 -> n6192449487634432;\nn6192449487634432 -> n6755399441055744;\nn6192449487634432 -> n7036874417766400;\nn7036874417766400 -> n6755399441055744;\nn6755399441055744 -> n7318349394477056;\nn6755399441055744 -> n7599824371187712;\nn7599824371187712 -> n7881299347898368;\nn7599824371187712 -> n8162774324609024;\nn8162774324609024 -> n7881299347898368;\nn7881299347898368 -> n7318349394477056;\nn7881299347898368 -> n8444249301319680;\nn8444249301319680 -> n7318349394477056;\nn7318349394477056 -> n4785074604081152;\nn7318349394477056 -> n8725724278030336;\nn5066549580791808 -> n9007199254740992;\nn5066549580791808 -> n9288674231451648;\nn9288674231451648 -> n9570149208162304;\nn9288674231451648 -> n9851624184872960;\nn9851624184872960 -> n9570149208162304;\nn9570149208162304 -> n10133099161583616;\nn9570149208162304 -> n10414574138294272;\nn10414574138294272 -> n10133099161583616;\nn10133099161583616 -> n10696049115004928;\nn10133099161583616 -> n10977524091715584;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n11258999068426240;\nn10696049115004928 -> n11540474045136896;\nn11540474045136896 -> n11258999068426240;\nn11258999068426240 -> n11821949021847552;\nn11258999068426240 -> n12103423998558208;\nn12103423998558208 -> n12384898975268864;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn12384898975268864 -> n12666373951979520;\nn12384898975268864 -> n12947848928690176;\nn12947848928690176 -> n13229323905400832;\nn12947848928690176 -> n13510798882111488;\nn13510798882111488 -> n13229323905400832;\nn13229323905400832 -> n12666373951979520;\nn13229323905400832 -> n13792273858822144;\nn13792273858822144 -> n12666373951979520;\nn12666373951979520 -> n14073748835532800;\nn12666373951979520 -> n14355223812243456;\nn14355223812243456 -> n14073748835532800;\nn14073748835532800 -> n14636698788954112;\nn14073748835532800 -> n14918173765664768;\nn14918173765664768 -> n14636698788954112;\nn14636698788954112 -> n15199648742375424;\nn14636698788954112 -> n15481123719086080;\nn15481123719086080 -> n15199648742375424;\nn15199648742375424 -> n15762598695796736;\nn15199648742375424 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn16044073672507392 -> n16607023625928704;\nn16607023625928704 -> n16325548649218048;\nn16325548649218048 -> n15762598695796736;\nn16325548649218048 -> n16888498602639360;\nn16888498602639360 -> n15762598695796736;\nn15762598695796736 -> n17169973579350016;\nn15762598695796736 -> n17451448556060672;\nn17451448556060672 -> n17732923532771328;\nn17451448556060672 -> n18014398509481984;\nn18014398509481984 -> n17732923532771328;\nn17732923532771328 -> n18295873486192640;\nn17732923532771328 -> n18577348462903296;\nn18577348462903296 -> n18295873486192640;\nn18295873486192640 -> n18858823439613952;\nn18295873486192640 -> n19140298416324608;\nn19140298416324608 -> n18858823439613952;\nn18858823439613952 -> n19421773393035264;\nn18858823439613952 -> n19703248369745920;\nn19703248369745920 -> n19421773393035264;\nn19421773393035264 -> n19984723346456576;\nn19421773393035264 -> n20266198323167232;\nn20266198323167232 -> n19984723346456576;\nn19984723346456576 -> n17169973579350016;\nn19984723346456576 -> n20547673299877888;\nn20547673299877888 -> n20829148276588544;\nn20547673299877888 -> n21110623253299200;\nn21110623253299200 -> n21392098230009856;\nn21110623253299200 -> n20829148276588544;\nn20829148276588544 -> n21392098230009856;\nn21392098230009856 -> n17169973579350016;\nn21392098230009856 -> n21673573206720512;\nn21673573206720512 -> n17169973579350016;\nn17169973579350016 -> n21955048183431168;\nn17169973579350016 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn21955048183431168 -> n22517998136852480;\nn21955048183431168 -> n22799473113563136;\nn22799473113563136 -> n23080948090273792;\nn22799473113563136 -> n22517998136852480;\nn22517998136852480 -> n23362423066984448;\nn22517998136852480 -> n23643898043695104;\nn23643898043695104 -> n23362423066984448;\nn23362423066984448 -> n23925373020405760;\nn23362423066984448 -> n24206847997116416;\nn24206847997116416 -> n23080948090273792;\nn24206847997116416 -> n23925373020405760;\nn23925373020405760 -> n24488322973827072;\nn23925373020405760 -> n24769797950537728;\nn24769797950537728 -> n24488322973827072;\nn24488322973827072 -> n25051272927248384;\nn24488322973827072 -> n25332747903959040;\nn25332747903959040 -> n23080948090273792;\nn25332747903959040 -> n25051272927248384;\nn25051272927248384 -> n23080948090273792;\nn25051272927248384 -> n25614222880669696;\nn25614222880669696 -> n23080948090273792;\nn25614222880669696 -> n25895697857380352;\nn25895697857380352 -> n23080948090273792;\nn25895697857380352 -> n26177172834091008;\nn26177172834091008 -> n23080948090273792;\nn23080948090273792 -> n26458647810801664;\nn23080948090273792 -> n26740122787512320;\nn26740122787512320 -> n27021597764222976;\nn26740122787512320 -> n27303072740933632;\nn27303072740933632 -> n27584547717644288;\nn27303072740933632 -> n27866022694354944;\nn27866022694354944 -> n27021597764222976;\nn27866022694354944 -> n27584547717644288;\nn27584547717644288 -> n28147497671065600;\nn26458647810801664 -> n28428972647776256;\nn26458647810801664 -> n28710447624486912;\nn28710447624486912 -> n28428972647776256;\nn28428972647776256 -> n28991922601197568;\nn28428972647776256 -> n29273397577908224;\nn29273397577908224 -> n28991922601197568;\nn28991922601197568 -> n29554872554618880;\nn28991922601197568 -> n29836347531329536;\nn29836347531329536 -> n30117822508040192;\nn29836347531329536 -> n30399297484750848;\nn30399297484750848 -> n30117822508040192;\nn30117822508040192 -> n29554872554618880;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n29554872554618880;\nn29554872554618880 -> n30962247438172160;\nn29554872554618880 -> n31243722414882816;\nn31243722414882816 -> n30962247438172160;\nn30962247438172160 -> n31525197391593472;\nn30962247438172160 -> n31806672368304128;\nn31806672368304128 -> n32088147345014784;\nn31525197391593472 -> n32369622321725440;\nn31525197391593472 -> n32651097298436096;\nn32651097298436096 -> n32369622321725440;\nn32369622321725440 -> n32088147345014784;\nn32088147345014784 -> n32932572275146752;\nn32088147345014784 -> n33214047251857408;\nn33214047251857408 -> n34339947158700032;\nn34339947158700032 -> n27021597764222976;\nn34339947158700032 -> n33495522228568064;\nn33495522228568064 -> n33776997205278720;\nn33495522228568064 -> n34058472181989376;\nn34058472181989376 -> n33776997205278720;\nn33776997205278720 -> n34339947158700032;\nn33776997205278720 -> n32932572275146752;\nn32932572275146752 -> n28147497671065600;\nn28147497671065600 -> n27021597764222976;\nn27021597764222976 -> n34621422135410688;\nn27021597764222976 -> n34902897112121344;\nn34902897112121344 -> n35184372088832000;\nn9007199254740992 -> n35465847065542656;\nn9007199254740992 -> n35747322042253312;\nn35747322042253312 -> n36028797018963968;\nn35747322042253312 -> n36310271995674624;\nn36310271995674624 -> n36591746972385280;\nn36310271995674624 -> n36873221949095936;\nn36873221949095936 -> n37154696925806592;\nn36873221949095936 -> n37436171902517248;\nn37436171902517248 -> n36028797018963968;\nn37436171902517248 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37717646879227904 -> n36028797018963968;\nn36028797018963968 -> n38280596832649216;\nn36028797018963968 -> n38562071809359872;\nn38562071809359872 -> n38280596832649216;\nn38280596832649216 -> n38843546786070528;\nn38280596832649216 -> n39125021762781184;\nn39125021762781184 -> n38843546786070528;\nn38843546786070528 -> n37999121855938560;\nn38843546786070528 -> n39406496739491840;\nn39406496739491840 -> n34621422135410688;\nn39406496739491840 -> n37999121855938560;\nn37999121855938560 -> n34621422135410688;\nn37999121855938560 -> n39687971716202496;\nn39687971716202496 -> n35184372088832000;\nn35184372088832000 -> n34621422135410688;\nn34621422135410688 -> n4785074604081152;\nn37154696925806592 -> n39969446692913152;\nn37154696925806592 -> n40250921669623808;\nn40250921669623808 -> n39969446692913152;\nn39969446692913152 -> n40532396646334464;\nn39969446692913152 -> n40813871623045120;\nn40813871623045120 -> n34621422135410688;\nn40813871623045120 -> n40532396646334464;\nn40532396646334464 -> n41095346599755776;\nn40532396646334464 -> n41376821576466432;\nn41376821576466432 -> n41095346599755776;\nn41095346599755776 -> n41658296553177088;\nn41095346599755776 -> n41939771529887744;\nn41939771529887744 -> n41658296553177088;\nn41658296553177088 -> n42221246506598400;\nn41658296553177088 -> n42502721483309056;\nn42502721483309056 -> n42221246506598400;\nn42221246506598400 -> n37999121855938560;\nn42221246506598400 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn42784196460019712 -> n43347146413441024;\nn43347146413441024 -> n43065671436730368;\nn43065671436730368 -> n43628621390151680;\nn43065671436730368 -> n43910096366862336;\nn43910096366862336 -> n43628621390151680;\nn43628621390151680 -> n37999121855938560;\nn43628621390151680 -> n44191571343572992;\nn36591746972385280 -> n44473046320283648;\nn36591746972385280 -> n44754521296994304;\nn44754521296994304 -> n44473046320283648;\nn44473046320283648 -> n45035996273704960;\nn44473046320283648 -> n45317471250415616;\nn45317471250415616 -> n34621422135410688;\nn45317471250415616 -> n45035996273704960;\nn45035996273704960 -> n45598946227126272;\nn45035996273704960 -> n45880421203836928;\nn45880421203836928 -> n45598946227126272;\nn45598946227126272 -> n46161896180547584;\nn45598946227126272 -> n46443371157258240;\nn46443371157258240 -> n46161896180547584;\nn46161896180547584 -> n46724846133968896;\nn46161896180547584 -> n47006321110679552;\nn47006321110679552 -> n46724846133968896;\nn46724846133968896 -> n37999121855938560;\nn46724846133968896 -> n47287796087390208;\nn47287796087390208 -> n47569271064100864;\nn47287796087390208 -> n47850746040811520;\nn47850746040811520 -> n47569271064100864;\nn47569271064100864 -> n48132221017522176;\nn47569271064100864 -> n48413695994232832;\nn48413695994232832 -> n48132221017522176;\nn48132221017522176 -> n37999121855938560;\nn48132221017522176 -> n48695170970943488;\nn35465847065542656 -> n36028797018963968;\nn35465847065542656 -> n48976645947654144;\nn48976645947654144 -> n36028797018963968;\nn48976645947654144 -> n49258120924364800;\nn49258120924364800 -> n37999121855938560;\nn49258120924364800 -> n49539595901075456;\nn281474976710656 -> n0[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\nn1407374883553280 -> n844424930131968[style=dotted];\nn1970324836974592 -> n1407374883553280[style=dotted];\nn2533274790395904 -> n1970324836974592[style=dotted];\nn3096224743817216 -> n2533274790395904[style=dotted];\nn4222124650659840 -> n3940649673949184[style=dotted];\nn3659174697238528 -> n3096224743817216[style=dotted];\nn5629499534213120 -> n5348024557502464[style=dotted];\nn6192449487634432 -> n5629499534213120[style=dotted];\nn6755399441055744 -> n6192449487634432[style=dotted];\nn7881299347898368 -> n7599824371187712[style=dotted];\nn7318349394477056 -> n6755399441055744[style=dotted];\nn9570149208162304 -> n9288674231451648[style=dotted];\nn10133099161583616 -> n9570149208162304[style=dotted];\nn10696049115004928 -> n10133099161583616[style=dotted];\nn11258999068426240 -> n10696049115004928[style=dotted];\nn11821949021847552 -> n11258999068426240[style=dotted];\nn12384898975268864 -> n11258999068426240[style=dotted];\nn13229323905400832 -> n12947848928690176[style=dotted];\nn12666373951979520 -> n12384898975268864[style=dotted];\nn14073748835532800 -> n12666373951979520[style=dotted];\nn14636698788954112 -> n14073748835532800[style=dotted];\nn15199648742375424 -> n14636698788954112[style=dotted];\nn16325548649218048 -> n16044073672507392[style=dotted];\nn15762598695796736 -> n15199648742375424[style=dotted];\nn17732923532771328 -> n17451448556060672[style=dotted];\nn18295873486192640 -> n17732923532771328[style=dotted];\nn18858823439613952 -> n18295873486192640[style=dotted];\nn19421773393035264 -> n18858823439613952[style=dotted];\nn19984723346456576 -> n19421773393035264[style=dotted];\nn20829148276588544 -> n20547673299877888[style=dotted];\nn21392098230009856 -> n20547673299877888[style=dotted];\nn17169973579350016 -> n15762598695796736[style=dotted];\nn21955048183431168 -> n17169973579350016[style=dotted];\nn22517998136852480 -> n21955048183431168[style=dotted];\nn23362423066984448 -> n22517998136852480[style=dotted];\nn23925373020405760 -> n23362423066984448[style=dotted];\nn24488322973827072 -> n23925373020405760[style=dotted];\nn25051272927248384 -> n24488322973827072[style=dotted];\nn23080948090273792 -> n21955048183431168[style=dotted];\nn27584547717644288 -> n27303072740933632[style=dotted];\nn28428972647776256 -> n26458647810801664[style=dotted];\nn28991922601197568 -> n28428972647776256[style=dotted];\nn30117822508040192 -> n29836347531329536[style=dotted];\nn29554872554618880 -> n28991922601197568[style=dotted];\nn30962247438172160 -> n29554872554618880[style=dotted];\nn32369622321725440 -> n31525197391593472[style=dotted];\nn32088147345014784 -> n30962247438172160[style=dotted];\nn34339947158700032 -> n33214047251857408[style=dotted];\nn33776997205278720 -> n33495522228568064[style=dotted];\nn32932572275146752 -> n32088147345014784[style=dotted];\nn28147497671065600 -> n23080948090273792[style=dotted];\nn27021597764222976 -> n23080948090273792[style=dotted];\nn36028797018963968 -> n9007199254740992[style=dotted];\nn38280596832649216 -> n36028797018963968[style=dotted];\nn38843546786070528 -> n38280596832649216[style=dotted];\nn37999121855938560 -> n9007199254740992[style=dotted];\nn35184372088832000 -> n5066549580791808[style=dotted];\nn34621422135410688 -> n5066549580791808[style=dotted];\nn4785074604081152 -> n3096224743817216[style=dotted];\nn39969446692913152 -> n37154696925806592[style=dotted];\nn40532396646334464 -> n39969446692913152[style=dotted];\nn41095346599755776 -> n40532396646334464[style=dotted];\nn41658296553177088 -> n41095346599755776[style=dotted];\nn42221246506598400 -> n41658296553177088[style=dotted];\nn43065671436730368 -> n42784196460019712[style=dotted];\nn43628621390151680 -> n43065671436730368[style=dotted];\nn44473046320283648 -> n36591746972385280[style=dotted];\nn45035996273704960 -> n44473046320283648[style=dotted];\nn45598946227126272 -> n45035996273704960[style=dotted];\nn46161896180547584 -> n45598946227126272[style=dotted];\nn46724846133968896 -> n46161896180547584[style=dotted];\nn47569271064100864 -> n47287796087390208[style=dotted];\nn48132221017522176 -> n47569271064100864[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-242.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn562949953421312 -> n1125899906842624;\nn844424930131968[shape=rectangle, label=\"B364\"];\nn562949953421312 -> n844424930131968;\nn0 -> n562949953421312;\nn281474976710656[shape=rectangle, label=\"B3\"];\nn0 -> n281474976710656;\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1970324836974592[shape=rectangle, label=\"B5\"];\nn1407374883553280 -> n1970324836974592;\nn1688849860263936[shape=rectangle, label=\"B6\"];\nn2533274790395904[shape=rectangle, label=\"B7\"];\nn2814749767106560[shape=rectangle, label=\"B10\"];\nn3659174697238528[shape=rectangle, label=\"B11\"];\nn4222124650659840[shape=rectangle, label=\"B12\"];\nn4785074604081152[shape=rectangle, label=\"B13\"];\nn4222124650659840 -> n4785074604081152;\nn4503599627370496[shape=rectangle, label=\"B29\"];\nn10133099161583616[shape=rectangle, label=\"B30\"];\nn10414574138294272[shape=rectangle, label=\"B31\"];\nn10696049115004928[shape=rectangle, label=\"B33\"];\nn11540474045136896[shape=rectangle, label=\"B34\"];\nn11821949021847552[shape=rectangle, label=\"B35\"];\nn12103423998558208[shape=rectangle, label=\"B36\"];\nn12384898975268864[shape=rectangle, label=\"B37\"];\nn12666373951979520[shape=rectangle, label=\"B38\"];\nn12384898975268864 -> n12666373951979520;\nn12103423998558208 -> n12384898975268864;\nn11821949021847552 -> n12103423998558208;\nn11540474045136896 -> n11821949021847552;\nn10696049115004928 -> n11540474045136896;\nn11258999068426240[shape=rectangle, label=\"B39\"];\nn10696049115004928 -> n11258999068426240;\nn12947848928690176[shape=rectangle, label=\"B40\"];\nn13229323905400832[shape=rectangle, label=\"B41\"];\nn13510798882111488[shape=rectangle, label=\"B42\"];\nn13229323905400832 -> n13510798882111488;\nn12947848928690176 -> n13229323905400832;\nn10696049115004928 -> n12947848928690176;\nn10977524091715584[shape=rectangle, label=\"B32\"];\nn10696049115004928 -> n10977524091715584;\nn10414574138294272 -> n10696049115004928;\nn10133099161583616 -> n10414574138294272;\nn4503599627370496 -> n10133099161583616;\nn4222124650659840 -> n4503599627370496;\nn3659174697238528 -> n4222124650659840;\nn3940649673949184[shape=rectangle, label=\"B16\"];\nn6473924464345088[shape=rectangle, label=\"B17\"];\nn7036874417766400[shape=rectangle, label=\"B18\"];\nn7599824371187712[shape=rectangle, label=\"B19\"];\nn7036874417766400 -> n7599824371187712;\nn7318349394477056[shape=rectangle, label=\"B295\"];\nn85286917943328768[shape=rectangle, label=\"B296\"];\nn85568392920039424[shape=rectangle, label=\"B297\"];\nn85849867896750080[shape=rectangle, label=\"B298\"];\nn85568392920039424 -> n85849867896750080;\nn85286917943328768 -> n85568392920039424;\nn7318349394477056 -> n85286917943328768;\nn7036874417766400 -> n7318349394477056;\nn6473924464345088 -> n7036874417766400;\nn6755399441055744[shape=rectangle, label=\"B20\"];\nn6473924464345088 -> n6755399441055744;\nn7881299347898368[shape=rectangle, label=\"B21\"];\nn6473924464345088 -> n7881299347898368;\nn3940649673949184 -> n6473924464345088;\nn6192449487634432[shape=rectangle, label=\"B22\"];\nn3940649673949184 -> n6192449487634432;\nn86131342873460736[shape=rectangle, label=\"B23\"];\nn8444249301319680[shape=rectangle, label=\"B24\"];\nn8725724278030336[shape=rectangle, label=\"B52\"];\nn16044073672507392[shape=rectangle, label=\"B53\"];\nn16325548649218048[shape=rectangle, label=\"B54\"];\nn16607023625928704[shape=rectangle, label=\"B55\"];\nn17169973579350016[shape=rectangle, label=\"B56\"];\nn16607023625928704 -> n17169973579350016;\nn16888498602639360[shape=rectangle, label=\"B57\"];\nn17451448556060672[shape=rectangle, label=\"B58\"];\nn17732923532771328[shape=rectangle, label=\"B59\"];\nn18295873486192640[shape=rectangle, label=\"B60\"];\nn17732923532771328 -> n18295873486192640;\nn17451448556060672 -> n17732923532771328;\nn16888498602639360 -> n17451448556060672;\nn16607023625928704 -> n16888498602639360;\nn16325548649218048 -> n16607023625928704;\nn16044073672507392 -> n16325548649218048;\nn8725724278030336 -> n16044073672507392;\nn8444249301319680 -> n8725724278030336;\nn9007199254740992[shape=rectangle, label=\"B25\"];\nn8444249301319680 -> n9007199254740992;\nn18014398509481984[shape=rectangle, label=\"B26\"];\nn9288674231451648[shape=rectangle, label=\"B27\"];\nn9570149208162304[shape=rectangle, label=\"B28\"];\nn9288674231451648 -> n9570149208162304;\nn18014398509481984 -> n9288674231451648;\nn8444249301319680 -> n18014398509481984;\nn86131342873460736 -> n8444249301319680;\nn8162774324609024[shape=rectangle, label=\"B43\"];\nn86131342873460736 -> n8162774324609024;\nn9851624184872960[shape=rectangle, label=\"B44\"];\nn13792273858822144[shape=rectangle, label=\"B45\"];\nn14073748835532800[shape=rectangle, label=\"B61\"];\nn18577348462903296[shape=rectangle, label=\"B62\"];\nn18858823439613952[shape=rectangle, label=\"B63\"];\nn19140298416324608[shape=rectangle, label=\"B64\"];\nn19703248369745920[shape=rectangle, label=\"B65\"];\nn19140298416324608 -> n19703248369745920;\nn19421773393035264[shape=rectangle, label=\"B311\"];\nn89790517570699264[shape=rectangle, label=\"B312\"];\nn90071992547409920[shape=rectangle, label=\"B313\"];\nn90353467524120576[shape=rectangle, label=\"B314\"];\nn90634942500831232[shape=rectangle, label=\"B315\"];\nn90353467524120576 -> n90634942500831232;\nn90071992547409920 -> n90353467524120576;\nn89790517570699264 -> n90071992547409920;\nn19421773393035264 -> n89790517570699264;\nn19140298416324608 -> n19421773393035264;\nn19984723346456576[shape=rectangle, label=\"B316\"];\nn91197892454252544[shape=rectangle, label=\"B317\"];\nn91479367430963200[shape=rectangle, label=\"B318\"];\nn91760842407673856[shape=rectangle, label=\"B319\"];\nn91479367430963200 -> n91760842407673856;\nn91197892454252544 -> n91479367430963200;\nn19984723346456576 -> n91197892454252544;\nn19140298416324608 -> n19984723346456576;\nn18858823439613952 -> n19140298416324608;\nn18577348462903296 -> n18858823439613952;\nn14073748835532800 -> n18577348462903296;\nn13792273858822144 -> n14073748835532800;\nn14355223812243456[shape=rectangle, label=\"B46\"];\nn13792273858822144 -> n14355223812243456;\nn90916417477541888[shape=rectangle, label=\"B47\"];\nn14636698788954112[shape=rectangle, label=\"B48\"];\nn14918173765664768[shape=rectangle, label=\"B49\"];\nn14636698788954112 -> n14918173765664768;\nn90916417477541888 -> n14636698788954112;\nn13792273858822144 -> n90916417477541888;\nn9851624184872960 -> n13792273858822144;\nn86131342873460736 -> n9851624184872960;\nn3940649673949184 -> n86131342873460736;\nn3659174697238528 -> n3940649673949184;\nn2814749767106560 -> n3659174697238528;\nn3377699720527872[shape=rectangle, label=\"B14\"];\nn5629499534213120[shape=rectangle, label=\"B15\"];\nn3377699720527872 -> n5629499534213120;\nn5348024557502464[shape=rectangle, label=\"B50\"];\nn15481123719086080[shape=rectangle, label=\"B51\"];\nn5348024557502464 -> n15481123719086080;\nn15199648742375424[shape=rectangle, label=\"B66\"];\nn20547673299877888[shape=rectangle, label=\"B67\"];\nn15199648742375424 -> n20547673299877888;\nn20266198323167232[shape=rectangle, label=\"B68\"];\nn20829148276588544[shape=rectangle, label=\"B69\"];\nn21110623253299200[shape=rectangle, label=\"B70\"];\nn20829148276588544 -> n21110623253299200;\nn20266198323167232 -> n20829148276588544;\nn15199648742375424 -> n20266198323167232;\nn5348024557502464 -> n15199648742375424;\nn15762598695796736[shape=rectangle, label=\"B71\"];\nn21392098230009856[shape=rectangle, label=\"B72\"];\nn15762598695796736 -> n21392098230009856;\nn5348024557502464 -> n15762598695796736;\nn3377699720527872 -> n5348024557502464;\nn5910974510923776[shape=rectangle, label=\"B73\"];\nn21955048183431168[shape=rectangle, label=\"B74\"];\nn22517998136852480[shape=rectangle, label=\"B75\"];\nn23080948090273792[shape=rectangle, label=\"B76\"];\nn22517998136852480 -> n23080948090273792;\nn22799473113563136[shape=rectangle, label=\"B289\"];\nn83316593106354176[shape=rectangle, label=\"B290\"];\nn83598068083064832[shape=rectangle, label=\"B291\"];\nn83879543059775488[shape=rectangle, label=\"B292\"];\nn83598068083064832 -> n83879543059775488;\nn83316593106354176 -> n83598068083064832;\nn22799473113563136 -> n83316593106354176;\nn22517998136852480 -> n22799473113563136;\nn21955048183431168 -> n22517998136852480;\nn22236523160141824[shape=rectangle, label=\"B77\"];\nn21955048183431168 -> n22236523160141824;\nn84161018036486144[shape=rectangle, label=\"B78\"];\nn23362423066984448[shape=rectangle, label=\"B79\"];\nn23643898043695104[shape=rectangle, label=\"B80\"];\nn23362423066984448 -> n23643898043695104;\nn84161018036486144 -> n23362423066984448;\nn21955048183431168 -> n84161018036486144;\nn5910974510923776 -> n21955048183431168;\nn21673573206720512[shape=rectangle, label=\"B81\"];\nn5910974510923776 -> n21673573206720512;\nn23925373020405760[shape=rectangle, label=\"B82\"];\nn24206847997116416[shape=rectangle, label=\"B83\"];\nn24769797950537728[shape=rectangle, label=\"B84\"];\nn25332747903959040[shape=rectangle, label=\"B85\"];\nn24769797950537728 -> n25332747903959040;\nn25051272927248384[shape=rectangle, label=\"B293\"];\nn84723967989907456[shape=rectangle, label=\"B294\"];\nn25051272927248384 -> n84723967989907456;\nn84442493013196800[shape=rectangle, label=\"B320\"];\nn92042317384384512[shape=rectangle, label=\"B321\"];\nn92323792361095168[shape=rectangle, label=\"B322\"];\nn92605267337805824[shape=rectangle, label=\"B323\"];\nn92886742314516480[shape=rectangle, label=\"B346\"];\nn92605267337805824 -> n92886742314516480;\nn92323792361095168 -> n92605267337805824;\nn92042317384384512 -> n92323792361095168;\nn84442493013196800 -> n92042317384384512;\nn25051272927248384 -> n84442493013196800;\nn85005442966618112[shape=rectangle, label=\"B324\"];\nn93168217291227136[shape=rectangle, label=\"B325\"];\nn93449692267937792[shape=rectangle, label=\"B326\"];\nn94012642221359104[shape=rectangle, label=\"B327\"];\nn93449692267937792 -> n94012642221359104;\nn93168217291227136 -> n93449692267937792;\nn85005442966618112 -> n93168217291227136;\nn25051272927248384 -> n85005442966618112;\nn24769797950537728 -> n25051272927248384;\nn24206847997116416 -> n24769797950537728;\nn24488322973827072[shape=rectangle, label=\"B86\"];\nn24206847997116416 -> n24488322973827072;\nn93731167244648448[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn93731167244648448 -> n25614222880669696;\nn24206847997116416 -> n93731167244648448;\nn23925373020405760 -> n24206847997116416;\nn5910974510923776 -> n23925373020405760;\nn3377699720527872 -> n5910974510923776;\nn2814749767106560 -> n3377699720527872;\nn5066549580791808[shape=rectangle, label=\"B89\"];\nn26177172834091008[shape=rectangle, label=\"B90\"];\nn26740122787512320[shape=rectangle, label=\"B91\"];\nn27021597764222976[shape=rectangle, label=\"B93\"];\nn28147497671065600[shape=rectangle, label=\"B94\"];\nn28428972647776256[shape=rectangle, label=\"B95\"];\nn28991922601197568[shape=rectangle, label=\"B96\"];\nn28428972647776256 -> n28991922601197568;\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn30680772461461504[shape=rectangle, label=\"B101\"];\nn28710447624486912 -> n30680772461461504;\nn28428972647776256 -> n28710447624486912;\nn29273397577908224[shape=rectangle, label=\"B102\"];\nn30962247438172160[shape=rectangle, label=\"B103\"];\nn31243722414882816[shape=rectangle, label=\"B104\"];\nn31525197391593472[shape=rectangle, label=\"B105\"];\nn31243722414882816 -> n31525197391593472;\nn30962247438172160 -> n31243722414882816;\nn29273397577908224 -> n30962247438172160;\nn28428972647776256 -> n29273397577908224;\nn28147497671065600 -> n28428972647776256;\nn27021597764222976 -> n28147497671065600;\nn27866022694354944[shape=rectangle, label=\"B97\"];\nn29554872554618880[shape=rectangle, label=\"B98\"];\nn30117822508040192[shape=rectangle, label=\"B99\"];\nn29554872554618880 -> n30117822508040192;\nn29836347531329536[shape=rectangle, label=\"B106\"];\nn31806672368304128[shape=rectangle, label=\"B107\"];\nn29836347531329536 -> n31806672368304128;\nn29554872554618880 -> n29836347531329536;\nn30399297484750848[shape=rectangle, label=\"B108\"];\nn32088147345014784[shape=rectangle, label=\"B109\"];\nn32369622321725440[shape=rectangle, label=\"B110\"];\nn32651097298436096[shape=rectangle, label=\"B111\"];\nn32369622321725440 -> n32651097298436096;\nn32088147345014784 -> n32369622321725440;\nn30399297484750848 -> n32088147345014784;\nn29554872554618880 -> n30399297484750848;\nn27866022694354944 -> n29554872554618880;\nn27021597764222976 -> n27866022694354944;\nn27303072740933632[shape=rectangle, label=\"B92\"];\nn27584547717644288[shape=rectangle, label=\"B136\"];\nn27303072740933632 -> n27584547717644288;\nn27021597764222976 -> n27303072740933632;\nn26740122787512320 -> n27021597764222976;\nn26177172834091008 -> n26740122787512320;\nn26458647810801664[shape=rectangle, label=\"B134\"];\nn39687971716202496[shape=rectangle, label=\"B135\"];\nn26458647810801664 -> n39687971716202496;\nn26177172834091008 -> n26458647810801664;\nn39406496739491840[shape=rectangle, label=\"B137\"];\nn40250921669623808[shape=rectangle, label=\"B139\"];\nn41095346599755776[shape=rectangle, label=\"B140\"];\nn41376821576466432[shape=rectangle, label=\"B141\"];\nn41095346599755776 -> n41376821576466432;\nn40250921669623808 -> n41095346599755776;\nn40813871623045120[shape=rectangle, label=\"B142\"];\nn41939771529887744[shape=rectangle, label=\"B143\"];\nn42221246506598400[shape=rectangle, label=\"B144\"];\nn42784196460019712[shape=rectangle, label=\"B145\"];\nn42221246506598400 -> n42784196460019712;\nn42502721483309056[shape=rectangle, label=\"B149\"];\nn44473046320283648[shape=rectangle, label=\"B150\"];\nn42502721483309056 -> n44473046320283648;\nn42221246506598400 -> n42502721483309056;\nn43065671436730368[shape=rectangle, label=\"B151\"];\nn44754521296994304[shape=rectangle, label=\"B152\"];\nn45035996273704960[shape=rectangle, label=\"B153\"];\nn45317471250415616[shape=rectangle, label=\"B154\"];\nn45035996273704960 -> n45317471250415616;\nn44754521296994304 -> n45035996273704960;\nn43065671436730368 -> n44754521296994304;\nn42221246506598400 -> n43065671436730368;\nn41939771529887744 -> n42221246506598400;\nn40813871623045120 -> n41939771529887744;\nn41658296553177088[shape=rectangle, label=\"B146\"];\nn43347146413441024[shape=rectangle, label=\"B147\"];\nn43910096366862336[shape=rectangle, label=\"B148\"];\nn43347146413441024 -> n43910096366862336;\nn43628621390151680[shape=rectangle, label=\"B155\"];\nn45598946227126272[shape=rectangle, label=\"B156\"];\nn43628621390151680 -> n45598946227126272;\nn43347146413441024 -> n43628621390151680;\nn44191571343572992[shape=rectangle, label=\"B157\"];\nn45880421203836928[shape=rectangle, label=\"B158\"];\nn46161896180547584[shape=rectangle, label=\"B159\"];\nn46443371157258240[shape=rectangle, label=\"B160\"];\nn46161896180547584 -> n46443371157258240;\nn45880421203836928 -> n46161896180547584;\nn44191571343572992 -> n45880421203836928;\nn43347146413441024 -> n44191571343572992;\nn41658296553177088 -> n43347146413441024;\nn40813871623045120 -> n41658296553177088;\nn40250921669623808 -> n40813871623045120;\nn40532396646334464[shape=rectangle, label=\"B138\"];\nn40250921669623808 -> n40532396646334464;\nn39406496739491840 -> n40250921669623808;\nn26177172834091008 -> n39406496739491840;\nn39969446692913152[shape=rectangle, label=\"B161\"];\nn47006321110679552[shape=rectangle, label=\"B162\"];\nn47287796087390208[shape=rectangle, label=\"B163\"];\nn47569271064100864[shape=rectangle, label=\"B164\"];\nn47850746040811520[shape=rectangle, label=\"B165\"];\nn47569271064100864 -> n47850746040811520;\nn47287796087390208 -> n47569271064100864;\nn47006321110679552 -> n47287796087390208;\nn39969446692913152 -> n47006321110679552;\nn26177172834091008 -> n39969446692913152;\nn5066549580791808 -> n26177172834091008;\nn25895697857380352[shape=rectangle, label=\"B112\"];\nn33214047251857408[shape=rectangle, label=\"B113\"];\nn33495522228568064[shape=rectangle, label=\"B115\"];\nn34621422135410688[shape=rectangle, label=\"B116\"];\nn34902897112121344[shape=rectangle, label=\"B117\"];\nn35465847065542656[shape=rectangle, label=\"B118\"];\nn34902897112121344 -> n35465847065542656;\nn35184372088832000[shape=rectangle, label=\"B122\"];\nn37154696925806592[shape=rectangle, label=\"B123\"];\nn35184372088832000 -> n37154696925806592;\nn34902897112121344 -> n35184372088832000;\nn35747322042253312[shape=rectangle, label=\"B124\"];\nn37436171902517248[shape=rectangle, label=\"B125\"];\nn37717646879227904[shape=rectangle, label=\"B126\"];\nn37999121855938560[shape=rectangle, label=\"B127\"];\nn37717646879227904 -> n37999121855938560;\nn37436171902517248 -> n37717646879227904;\nn35747322042253312 -> n37436171902517248;\nn34902897112121344 -> n35747322042253312;\nn34621422135410688 -> n34902897112121344;\nn33495522228568064 -> n34621422135410688;\nn34339947158700032[shape=rectangle, label=\"B119\"];\nn36028797018963968[shape=rectangle, label=\"B120\"];\nn36591746972385280[shape=rectangle, label=\"B121\"];\nn36028797018963968 -> n36591746972385280;\nn36310271995674624[shape=rectangle, label=\"B128\"];\nn38280596832649216[shape=rectangle, label=\"B129\"];\nn36310271995674624 -> n38280596832649216;\nn36028797018963968 -> n36310271995674624;\nn36873221949095936[shape=rectangle, label=\"B130\"];\nn38562071809359872[shape=rectangle, label=\"B131\"];\nn38843546786070528[shape=rectangle, label=\"B132\"];\nn39125021762781184[shape=rectangle, label=\"B133\"];\nn38843546786070528 -> n39125021762781184;\nn38562071809359872 -> n38843546786070528;\nn36873221949095936 -> n38562071809359872;\nn36028797018963968 -> n36873221949095936;\nn34339947158700032 -> n36028797018963968;\nn33495522228568064 -> n34339947158700032;\nn33776997205278720[shape=rectangle, label=\"B114\"];\nn34058472181989376[shape=rectangle, label=\"B168\"];\nn33776997205278720 -> n34058472181989376;\nn33495522228568064 -> n33776997205278720;\nn33214047251857408 -> n33495522228568064;\nn25895697857380352 -> n33214047251857408;\nn32932572275146752[shape=rectangle, label=\"B166\"];\nn48413695994232832[shape=rectangle, label=\"B167\"];\nn32932572275146752 -> n48413695994232832;\nn25895697857380352 -> n32932572275146752;\nn48132221017522176[shape=rectangle, label=\"B169\"];\nn48976645947654144[shape=rectangle, label=\"B171\"];\nn49821070877786112[shape=rectangle, label=\"B172\"];\nn50102545854496768[shape=rectangle, label=\"B173\"];\nn49821070877786112 -> n50102545854496768;\nn48976645947654144 -> n49821070877786112;\nn49539595901075456[shape=rectangle, label=\"B174\"];\nn50665495807918080[shape=rectangle, label=\"B175\"];\nn50946970784628736[shape=rectangle, label=\"B176\"];\nn51509920738050048[shape=rectangle, label=\"B177\"];\nn50946970784628736 -> n51509920738050048;\nn51228445761339392[shape=rectangle, label=\"B181\"];\nn53198770598313984[shape=rectangle, label=\"B182\"];\nn51228445761339392 -> n53198770598313984;\nn50946970784628736 -> n51228445761339392;\nn51791395714760704[shape=rectangle, label=\"B183\"];\nn53480245575024640[shape=rectangle, label=\"B184\"];\nn53761720551735296[shape=rectangle, label=\"B185\"];\nn54043195528445952[shape=rectangle, label=\"B186\"];\nn53761720551735296 -> n54043195528445952;\nn53480245575024640 -> n53761720551735296;\nn51791395714760704 -> n53480245575024640;\nn50946970784628736 -> n51791395714760704;\nn50665495807918080 -> n50946970784628736;\nn49539595901075456 -> n50665495807918080;\nn50384020831207424[shape=rectangle, label=\"B178\"];\nn52072870691471360[shape=rectangle, label=\"B179\"];\nn52635820644892672[shape=rectangle, label=\"B180\"];\nn52072870691471360 -> n52635820644892672;\nn52354345668182016[shape=rectangle, label=\"B187\"];\nn54324670505156608[shape=rectangle, label=\"B188\"];\nn52354345668182016 -> n54324670505156608;\nn52072870691471360 -> n52354345668182016;\nn52917295621603328[shape=rectangle, label=\"B189\"];\nn54606145481867264[shape=rectangle, label=\"B190\"];\nn54887620458577920[shape=rectangle, label=\"B191\"];\nn55169095435288576[shape=rectangle, label=\"B192\"];\nn54887620458577920 -> n55169095435288576;\nn54606145481867264 -> n54887620458577920;\nn52917295621603328 -> n54606145481867264;\nn52072870691471360 -> n52917295621603328;\nn50384020831207424 -> n52072870691471360;\nn49539595901075456 -> n50384020831207424;\nn48976645947654144 -> n49539595901075456;\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn48976645947654144 -> n49258120924364800;\nn48132221017522176 -> n48976645947654144;\nn25895697857380352 -> n48132221017522176;\nn48695170970943488[shape=rectangle, label=\"B193\"];\nn55732045388709888[shape=rectangle, label=\"B194\"];\nn56013520365420544[shape=rectangle, label=\"B195\"];\nn56294995342131200[shape=rectangle, label=\"B196\"];\nn56013520365420544 -> n56294995342131200;\nn55732045388709888 -> n56013520365420544;\nn48695170970943488 -> n55732045388709888;\nn55450570411999232[shape=rectangle, label=\"B197\"];\nn56857945295552512[shape=rectangle, label=\"B198\"];\nn57139420272263168[shape=rectangle, label=\"B200\"];\nn58265320179105792[shape=rectangle, label=\"B201\"];\nn58546795155816448[shape=rectangle, label=\"B202\"];\nn59109745109237760[shape=rectangle, label=\"B203\"];\nn58546795155816448 -> n59109745109237760;\nn58828270132527104[shape=rectangle, label=\"B207\"];\nn60798594969501696[shape=rectangle, label=\"B208\"];\nn58828270132527104 -> n60798594969501696;\nn58546795155816448 -> n58828270132527104;\nn59391220085948416[shape=rectangle, label=\"B209\"];\nn61080069946212352[shape=rectangle, label=\"B210\"];\nn61361544922923008[shape=rectangle, label=\"B211\"];\nn61643019899633664[shape=rectangle, label=\"B212\"];\nn61361544922923008 -> n61643019899633664;\nn61080069946212352 -> n61361544922923008;\nn59391220085948416 -> n61080069946212352;\nn58546795155816448 -> n59391220085948416;\nn58265320179105792 -> n58546795155816448;\nn57139420272263168 -> n58265320179105792;\nn57983845202395136[shape=rectangle, label=\"B204\"];\nn59672695062659072[shape=rectangle, label=\"B205\"];\nn60235645016080384[shape=rectangle, label=\"B206\"];\nn59672695062659072 -> n60235645016080384;\nn59954170039369728[shape=rectangle, label=\"B213\"];\nn61924494876344320[shape=rectangle, label=\"B214\"];\nn59954170039369728 -> n61924494876344320;\nn59672695062659072 -> n59954170039369728;\nn60517119992791040[shape=rectangle, label=\"B215\"];\nn62205969853054976[shape=rectangle, label=\"B216\"];\nn62487444829765632[shape=rectangle, label=\"B217\"];\nn62768919806476288[shape=rectangle, label=\"B218\"];\nn62487444829765632 -> n62768919806476288;\nn62205969853054976 -> n62487444829765632;\nn60517119992791040 -> n62205969853054976;\nn59672695062659072 -> n60517119992791040;\nn57983845202395136 -> n59672695062659072;\nn57139420272263168 -> n57983845202395136;\nn57420895248973824[shape=rectangle, label=\"B199\"];\nn57702370225684480[shape=rectangle, label=\"B221\"];\nn57420895248973824 -> n57702370225684480;\nn57139420272263168 -> n57420895248973824;\nn56857945295552512 -> n57139420272263168;\nn55450570411999232 -> n56857945295552512;\nn56576470318841856[shape=rectangle, label=\"B219\"];\nn63331869759897600[shape=rectangle, label=\"B220\"];\nn56576470318841856 -> n63331869759897600;\nn55450570411999232 -> n56576470318841856;\nn63050394783186944[shape=rectangle, label=\"B237\"];\nn69242844270821376[shape=rectangle, label=\"B238\"];\nn69524319247532032[shape=rectangle, label=\"B239\"];\nn69242844270821376 -> n69524319247532032;\nn63050394783186944 -> n69242844270821376;\nn68961369294110720[shape=rectangle, label=\"B240\"];\nn70087269200953344[shape=rectangle, label=\"B241\"];\nn70368744177664000[shape=rectangle, label=\"B242\"];\nn70931694131085312[shape=rectangle, label=\"B243\"];\nn70368744177664000 -> n70931694131085312;\nn70650219154374656[shape=rectangle, label=\"B247\"];\nn72620543991349248[shape=rectangle, label=\"B248\"];\nn70650219154374656 -> n72620543991349248;\nn70368744177664000 -> n70650219154374656;\nn71213169107795968[shape=rectangle, label=\"B249\"];\nn72902018968059904[shape=rectangle, label=\"B250\"];\nn73183493944770560[shape=rectangle, label=\"B251\"];\nn73464968921481216[shape=rectangle, label=\"B252\"];\nn73183493944770560 -> n73464968921481216;\nn72902018968059904 -> n73183493944770560;\nn71213169107795968 -> n72902018968059904;\nn70368744177664000 -> n71213169107795968;\nn70087269200953344 -> n70368744177664000;\nn68961369294110720 -> n70087269200953344;\nn69805794224242688[shape=rectangle, label=\"B244\"];\nn71494644084506624[shape=rectangle, label=\"B245\"];\nn72057594037927936[shape=rectangle, label=\"B246\"];\nn71494644084506624 -> n72057594037927936;\nn71776119061217280[shape=rectangle, label=\"B253\"];\nn73746443898191872[shape=rectangle, label=\"B254\"];\nn71776119061217280 -> n73746443898191872;\nn71494644084506624 -> n71776119061217280;\nn72339069014638592[shape=rectangle, label=\"B255\"];\nn74027918874902528[shape=rectangle, label=\"B256\"];\nn74309393851613184[shape=rectangle, label=\"B257\"];\nn74590868828323840[shape=rectangle, label=\"B258\"];\nn74309393851613184 -> n74590868828323840;\nn74027918874902528 -> n74309393851613184;\nn72339069014638592 -> n74027918874902528;\nn71494644084506624 -> n72339069014638592;\nn69805794224242688 -> n71494644084506624;\nn68961369294110720 -> n69805794224242688;\nn63050394783186944 -> n68961369294110720;\nn68679894317400064[shape=rectangle, label=\"B236\"];\nn63050394783186944 -> n68679894317400064;\nn55450570411999232 -> n63050394783186944;\nn63613344736608256[shape=rectangle, label=\"B222\"];\nn64176294690029568[shape=rectangle, label=\"B223\"];\nn64457769666740224[shape=rectangle, label=\"B224\"];\nn64176294690029568 -> n64457769666740224;\nn63613344736608256 -> n64176294690029568;\nn63894819713318912[shape=rectangle, label=\"B225\"];\nn65020719620161536[shape=rectangle, label=\"B226\"];\nn65583669573582848[shape=rectangle, label=\"B227\"];\nn66146619527004160[shape=rectangle, label=\"B228\"];\nn66709569480425472[shape=rectangle, label=\"B229\"];\nn67272519433846784[shape=rectangle, label=\"B230\"];\nn67835469387268096[shape=rectangle, label=\"B231\"];\nn67272519433846784 -> n67835469387268096;\nn67553994410557440[shape=rectangle, label=\"B299\"];\nn86694292826882048[shape=rectangle, label=\"B300\"];\nn67553994410557440 -> n86694292826882048;\nn86412817850171392[shape=rectangle, label=\"B336\"];\nn96264442035044352[shape=rectangle, label=\"B337\"];\nn96545917011755008[shape=rectangle, label=\"B338\"];\nn96827391988465664[shape=rectangle, label=\"B339\"];\nn97390341941886976[shape=rectangle, label=\"B340\"];\nn96827391988465664 -> n97390341941886976;\nn96545917011755008 -> n96827391988465664;\nn96264442035044352 -> n96545917011755008;\nn86412817850171392 -> n96264442035044352;\nn67553994410557440 -> n86412817850171392;\nn97108866965176320[shape=rectangle, label=\"B301\"];\nn86975767803592704[shape=rectangle, label=\"B302\"];\nn87257242780303360[shape=rectangle, label=\"B303\"];\nn87820192733724672[shape=rectangle, label=\"B304\"];\nn87257242780303360 -> n87820192733724672;\nn86975767803592704 -> n87257242780303360;\nn97108866965176320 -> n86975767803592704;\nn67553994410557440 -> n97108866965176320;\nn67272519433846784 -> n67553994410557440;\nn66709569480425472 -> n67272519433846784;\nn66991044457136128[shape=rectangle, label=\"B232\"];\nn66709569480425472 -> n66991044457136128;\nn87538717757014016[shape=rectangle, label=\"B233\"];\nn68116944363978752[shape=rectangle, label=\"B234\"];\nn68398419340689408[shape=rectangle, label=\"B235\"];\nn68116944363978752 -> n68398419340689408;\nn87538717757014016 -> n68116944363978752;\nn66709569480425472 -> n87538717757014016;\nn66146619527004160 -> n66709569480425472;\nn65583669573582848 -> n66146619527004160;\nn65865144550293504[shape=rectangle, label=\"B270\"];\nn77968568548851712[shape=rectangle, label=\"B271\"];\nn78250043525562368[shape=rectangle, label=\"B272\"];\nn78531518502273024[shape=rectangle, label=\"B274\"];\nn79375943432404992[shape=rectangle, label=\"B275\"];\nn79938893385826304[shape=rectangle, label=\"B276\"];\nn79375943432404992 -> n79938893385826304;\nn79657418409115648[shape=rectangle, label=\"B281\"];\nn80783318315958272[shape=rectangle, label=\"B282\"];\nn81064793292668928[shape=rectangle, label=\"B283\"];\nn81346268269379584[shape=rectangle, label=\"B284\"];\nn81064793292668928 -> n81346268269379584;\nn80783318315958272 -> n81064793292668928;\nn79657418409115648 -> n80783318315958272;\nn79375943432404992 -> n79657418409115648;\nn78531518502273024 -> n79375943432404992;\nn79094468455694336[shape=rectangle, label=\"B277\"];\nn78531518502273024 -> n79094468455694336;\nn81627743246090240[shape=rectangle, label=\"B278\"];\nn80220368362536960[shape=rectangle, label=\"B279\"];\nn80501843339247616[shape=rectangle, label=\"B280\"];\nn80220368362536960 -> n80501843339247616;\nn81627743246090240 -> n80220368362536960;\nn78531518502273024 -> n81627743246090240;\nn78812993478983680[shape=rectangle, label=\"B273\"];\nn78531518502273024 -> n78812993478983680;\nn78250043525562368 -> n78531518502273024;\nn77968568548851712 -> n78250043525562368;\nn65865144550293504 -> n77968568548851712;\nn65583669573582848 -> n65865144550293504;\nn65020719620161536 -> n65583669573582848;\nn65302194596872192[shape=rectangle, label=\"B262\"];\nn75998243711877120[shape=rectangle, label=\"B263\"];\nn76561193665298432[shape=rectangle, label=\"B264\"];\nn77124143618719744[shape=rectangle, label=\"B265\"];\nn76561193665298432 -> n77124143618719744;\nn76842668642009088[shape=rectangle, label=\"B305\"];\nn88383142687145984[shape=rectangle, label=\"B306\"];\nn76842668642009088 -> n88383142687145984;\nn88101667710435328[shape=rectangle, label=\"B341\"];\nn97671816918597632[shape=rectangle, label=\"B342\"];\nn97953291895308288[shape=rectangle, label=\"B343\"];\nn98234766872018944[shape=rectangle, label=\"B344\"];\nn98797716825440256[shape=rectangle, label=\"B345\"];\nn98234766872018944 -> n98797716825440256;\nn97953291895308288 -> n98234766872018944;\nn97671816918597632 -> n97953291895308288;\nn88101667710435328 -> n97671816918597632;\nn76842668642009088 -> n88101667710435328;\nn98516241848729600[shape=rectangle, label=\"B307\"];\nn88664617663856640[shape=rectangle, label=\"B308\"];\nn88946092640567296[shape=rectangle, label=\"B309\"];\nn89509042593988608[shape=rectangle, label=\"B310\"];\nn88946092640567296 -> n89509042593988608;\nn88664617663856640 -> n88946092640567296;\nn98516241848729600 -> n88664617663856640;\nn76842668642009088 -> n98516241848729600;\nn76561193665298432 -> n76842668642009088;\nn75998243711877120 -> n76561193665298432;\nn76279718688587776[shape=rectangle, label=\"B266\"];\nn75998243711877120 -> n76279718688587776;\nn89227567617277952[shape=rectangle, label=\"B267\"];\nn77405618595430400[shape=rectangle, label=\"B268\"];\nn77687093572141056[shape=rectangle, label=\"B269\"];\nn77405618595430400 -> n77687093572141056;\nn89227567617277952 -> n77405618595430400;\nn75998243711877120 -> n89227567617277952;\nn65302194596872192 -> n75998243711877120;\nn65020719620161536 -> n65302194596872192;\nn63894819713318912 -> n65020719620161536;\nn64739244643450880[shape=rectangle, label=\"B259\"];\nn74872343805034496[shape=rectangle, label=\"B260\"];\nn75435293758455808[shape=rectangle, label=\"B261\"];\nn74872343805034496 -> n75435293758455808;\nn75153818781745152[shape=rectangle, label=\"B285\"];\nn82190693199511552[shape=rectangle, label=\"B286\"];\nn75153818781745152 -> n82190693199511552;\nn81909218222800896[shape=rectangle, label=\"B287\"];\nn82753643152932864[shape=rectangle, label=\"B288\"];\nn81909218222800896 -> n82753643152932864;\nn82472168176222208[shape=rectangle, label=\"B328\"];\nn94294117198069760[shape=rectangle, label=\"B329\"];\nn94575592174780416[shape=rectangle, label=\"B330\"];\nn94857067151491072[shape=rectangle, label=\"B331\"];\nn95138542128201728[shape=rectangle, label=\"B347\"];\nn94857067151491072 -> n95138542128201728;\nn94575592174780416 -> n94857067151491072;\nn94294117198069760 -> n94575592174780416;\nn82472168176222208 -> n94294117198069760;\nn81909218222800896 -> n82472168176222208;\nn83035118129643520[shape=rectangle, label=\"B332\"];\nn95420017104912384[shape=rectangle, label=\"B333\"];\nn95701492081623040[shape=rectangle, label=\"B334\"];\nn95982967058333696[shape=rectangle, label=\"B335\"];\nn95701492081623040 -> n95982967058333696;\nn95420017104912384 -> n95701492081623040;\nn83035118129643520 -> n95420017104912384;\nn81909218222800896 -> n83035118129643520;\nn75153818781745152 -> n81909218222800896;\nn74872343805034496 -> n75153818781745152;\nn75716768735166464[shape=rectangle, label=\"B348\"];\nn99079191802150912[shape=rectangle, label=\"B349\"];\nn75716768735166464 -> n99079191802150912;\nn74872343805034496 -> n75716768735166464;\nn64739244643450880 -> n74872343805034496;\nn63894819713318912 -> n64739244643450880;\nn66428094503714816[shape=rectangle, label=\"B350\"];\nn99360666778861568[shape=rectangle, label=\"B351\"];\nn66428094503714816 -> n99360666778861568;\nn3096224743817216[shape=rectangle, label=\"B8\"];\nn66428094503714816 -> n3096224743817216;\nn63894819713318912 -> n66428094503714816;\nn63613344736608256 -> n63894819713318912;\nn55450570411999232 -> n63613344736608256;\nn48695170970943488 -> n55450570411999232;\nn25895697857380352 -> n48695170970943488;\nn5066549580791808 -> n25895697857380352;\nn46724846133968896[shape=rectangle, label=\"B9\"];\nn5066549580791808 -> n46724846133968896;\nn2814749767106560 -> n5066549580791808;\nn2533274790395904 -> n2814749767106560;\nn1688849860263936 -> n2533274790395904;\nn2251799813685248[shape=rectangle, label=\"B352\"];\nn99923616732282880[shape=rectangle, label=\"B353\"];\nn100205091708993536[shape=rectangle, label=\"B356\"];\nn101049516639125504[shape=rectangle, label=\"B357\"];\nn101330991615836160[shape=rectangle, label=\"B358\"];\nn101049516639125504 -> n101330991615836160;\nn100486566685704192[shape=rectangle, label=\"B354\"];\nn101049516639125504 -> n100486566685704192;\nn100205091708993536 -> n101049516639125504;\nn100768041662414848[shape=rectangle, label=\"B355\"];\nn100205091708993536 -> n100768041662414848;\nn99923616732282880 -> n100205091708993536;\nn2251799813685248 -> n99923616732282880;\nn99642141755572224[shape=rectangle, label=\"B359\"];\nn101893941569257472[shape=rectangle, label=\"B360\"];\nn99642141755572224 -> n101893941569257472;\nn101612466592546816[shape=rectangle, label=\"B361\"];\nn102456891522678784[shape=rectangle, label=\"B362\"];\nn101612466592546816 -> n102456891522678784;\nn102175416545968128[shape=rectangle, label=\"B363\"];\nn101612466592546816 -> n102175416545968128;\nn99642141755572224 -> n101612466592546816;\nn2251799813685248 -> n99642141755572224;\nn1688849860263936 -> n2251799813685248;\nn1407374883553280 -> n1688849860263936;\nn0 -> n1407374883553280;\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-244.txt",
    "content": "digraph {\n\nn108367866033602560[shape=rectangle, label=\"B393\"];\nn104708691336364032[shape=rectangle, label=\"B380\"];\nn97953291895308288[shape=rectangle, label=\"B367\"];\nn83879543059775488[shape=rectangle, label=\"B343\"];\nn56294995342131200[shape=rectangle, label=\"B293\"];\nn281474976710656[shape=rectangle, label=\"B195\"];\nn0[shape=rectangle, label=\"B0\"];\nn281474976710656 -> n0;\nn56294995342131200 -> n281474976710656;\nn83879543059775488 -> n56294995342131200;\nn97953291895308288 -> n83879543059775488;\nn104708691336364032 -> n97953291895308288;\nn108367866033602560 -> n104708691336364032;\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-248.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn70931694131085312[shape=rectangle, label=\"B3\"];\nn1688849860263936[shape=rectangle, label=\"B4\"];\nn1407374883553280[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn1970324836974592[shape=rectangle, label=\"B7\"];\nn2814749767106560[shape=rectangle, label=\"B8\"];\nn3096224743817216[shape=rectangle, label=\"B9\"];\nn3377699720527872[shape=rectangle, label=\"B10\"];\nn3940649673949184[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn4222124650659840[shape=rectangle, label=\"B13\"];\nn2533274790395904[shape=rectangle, label=\"B14\"];\nn4785074604081152[shape=rectangle, label=\"B15\"];\nn4503599627370496[shape=rectangle, label=\"B16\"];\nn5348024557502464[shape=rectangle, label=\"B17\"];\nn5629499534213120[shape=rectangle, label=\"B18\"];\nn6192449487634432[shape=rectangle, label=\"B19\"];\nn5910974510923776[shape=rectangle, label=\"B20\"];\nn6755399441055744[shape=rectangle, label=\"B21\"];\nn7318349394477056[shape=rectangle, label=\"B22\"];\nn7036874417766400[shape=rectangle, label=\"B23\"];\nn7881299347898368[shape=rectangle, label=\"B24\"];\nn39969446692913152[shape=rectangle, label=\"B25\"];\nn8444249301319680[shape=rectangle, label=\"B26\"];\nn8162774324609024[shape=rectangle, label=\"B27\"];\nn9007199254740992[shape=rectangle, label=\"B28\"];\nn8725724278030336[shape=rectangle, label=\"B29\"];\nn9570149208162304[shape=rectangle, label=\"B30\"];\nn9288674231451648[shape=rectangle, label=\"B31\"];\nn10133099161583616[shape=rectangle, label=\"B32\"];\nn9851624184872960[shape=rectangle, label=\"B33\"];\nn10696049115004928[shape=rectangle, label=\"B34\"];\nn11258999068426240[shape=rectangle, label=\"B35\"];\nn10977524091715584[shape=rectangle, label=\"B36\"];\nn11540474045136896[shape=rectangle, label=\"B37\"];\nn12103423998558208[shape=rectangle, label=\"B38\"];\nn11821949021847552[shape=rectangle, label=\"B39\"];\nn12666373951979520[shape=rectangle, label=\"B40\"];\nn13229323905400832[shape=rectangle, label=\"B41\"];\nn12947848928690176[shape=rectangle, label=\"B42\"];\nn13510798882111488[shape=rectangle, label=\"B43\"];\nn12384898975268864[shape=rectangle, label=\"B44\"];\nn14073748835532800[shape=rectangle, label=\"B45\"];\nn13792273858822144[shape=rectangle, label=\"B46\"];\nn14636698788954112[shape=rectangle, label=\"B47\"];\nn14918173765664768[shape=rectangle, label=\"B48\"];\nn15481123719086080[shape=rectangle, label=\"B49\"];\nn15199648742375424[shape=rectangle, label=\"B50\"];\nn16044073672507392[shape=rectangle, label=\"B51\"];\nn16325548649218048[shape=rectangle, label=\"B52\"];\nn16607023625928704[shape=rectangle, label=\"B53\"];\nn17169973579350016[shape=rectangle, label=\"B54\"];\nn16888498602639360[shape=rectangle, label=\"B55\"];\nn17451448556060672[shape=rectangle, label=\"B56\"];\nn18014398509481984[shape=rectangle, label=\"B57\"];\nn18577348462903296[shape=rectangle, label=\"B58\"];\nn18295873486192640[shape=rectangle, label=\"B59\"];\nn17732923532771328[shape=rectangle, label=\"B60\"];\nn15762598695796736[shape=rectangle, label=\"B61\"];\nn14355223812243456[shape=rectangle, label=\"B62\"];\nn19140298416324608[shape=rectangle, label=\"B63\"];\nn18858823439613952[shape=rectangle, label=\"B64\"];\nn19984723346456576[shape=rectangle, label=\"B65\"];\nn19703248369745920[shape=rectangle, label=\"B66\"];\nn20547673299877888[shape=rectangle, label=\"B67\"];\nn20266198323167232[shape=rectangle, label=\"B68\"];\nn21110623253299200[shape=rectangle, label=\"B69\"];\nn20829148276588544[shape=rectangle, label=\"B70\"];\nn21673573206720512[shape=rectangle, label=\"B71\"];\nn23080948090273792[shape=rectangle, label=\"B72\"];\nn22236523160141824[shape=rectangle, label=\"B73\"];\nn22799473113563136[shape=rectangle, label=\"B74\"];\nn22517998136852480[shape=rectangle, label=\"B75\"];\nn21392098230009856[shape=rectangle, label=\"B76\"];\nn23362423066984448[shape=rectangle, label=\"B77\"];\nn21955048183431168[shape=rectangle, label=\"B78\"];\nn23925373020405760[shape=rectangle, label=\"B79\"];\nn23643898043695104[shape=rectangle, label=\"B80\"];\nn24488322973827072[shape=rectangle, label=\"B81\"];\nn24206847997116416[shape=rectangle, label=\"B82\"];\nn25051272927248384[shape=rectangle, label=\"B83\"];\nn25332747903959040[shape=rectangle, label=\"B84\"];\nn25895697857380352[shape=rectangle, label=\"B85\"];\nn25614222880669696[shape=rectangle, label=\"B86\"];\nn26458647810801664[shape=rectangle, label=\"B87\"];\nn26740122787512320[shape=rectangle, label=\"B88\"];\nn27021597764222976[shape=rectangle, label=\"B89\"];\nn27584547717644288[shape=rectangle, label=\"B90\"];\nn27303072740933632[shape=rectangle, label=\"B91\"];\nn26177172834091008[shape=rectangle, label=\"B92\"];\nn27866022694354944[shape=rectangle, label=\"B93\"];\nn28428972647776256[shape=rectangle, label=\"B94\"];\nn28147497671065600[shape=rectangle, label=\"B95\"];\nn28991922601197568[shape=rectangle, label=\"B96\"];\nn29273397577908224[shape=rectangle, label=\"B97\"];\nn29554872554618880[shape=rectangle, label=\"B98\"];\nn30117822508040192[shape=rectangle, label=\"B99\"];\nn29836347531329536[shape=rectangle, label=\"B100\"];\nn28710447624486912[shape=rectangle, label=\"B101\"];\nn30399297484750848[shape=rectangle, label=\"B102\"];\nn30962247438172160[shape=rectangle, label=\"B103\"];\nn31525197391593472[shape=rectangle, label=\"B104\"];\nn31243722414882816[shape=rectangle, label=\"B105\"];\nn31806672368304128[shape=rectangle, label=\"B106\"];\nn32369622321725440[shape=rectangle, label=\"B107\"];\nn32932572275146752[shape=rectangle, label=\"B108\"];\nn33214047251857408[shape=rectangle, label=\"B109\"];\nn32651097298436096[shape=rectangle, label=\"B110\"];\nn30680772461461504[shape=rectangle, label=\"B111\"];\nn33776997205278720[shape=rectangle, label=\"B112\"];\nn33495522228568064[shape=rectangle, label=\"B113\"];\nn32088147345014784[shape=rectangle, label=\"B114\"];\nn34339947158700032[shape=rectangle, label=\"B115\"];\nn34621422135410688[shape=rectangle, label=\"B116\"];\nn24769797950537728[shape=rectangle, label=\"B117\"];\nn35184372088832000[shape=rectangle, label=\"B118\"];\nn34902897112121344[shape=rectangle, label=\"B119\"];\nn35465847065542656[shape=rectangle, label=\"B120\"];\nn35747322042253312[shape=rectangle, label=\"B121\"];\nn10414574138294272[shape=rectangle, label=\"B122\"];\nn36310271995674624[shape=rectangle, label=\"B123\"];\nn36028797018963968[shape=rectangle, label=\"B124\"];\nn36591746972385280[shape=rectangle, label=\"B125\"];\nn36873221949095936[shape=rectangle, label=\"B126\"];\nn37436171902517248[shape=rectangle, label=\"B127\"];\nn37154696925806592[shape=rectangle, label=\"B128\"];\nn37717646879227904[shape=rectangle, label=\"B129\"];\nn38280596832649216[shape=rectangle, label=\"B130\"];\nn37999121855938560[shape=rectangle, label=\"B131\"];\nn38562071809359872[shape=rectangle, label=\"B132\"];\nn38843546786070528[shape=rectangle, label=\"B133\"];\nn39125021762781184[shape=rectangle, label=\"B134\"];\nn19421773393035264[shape=rectangle, label=\"B135\"];\nn34058472181989376[shape=rectangle, label=\"B136\"];\nn39687971716202496[shape=rectangle, label=\"B137\"];\nn39406496739491840[shape=rectangle, label=\"B138\"];\nn40250921669623808[shape=rectangle, label=\"B139\"];\nn7599824371187712[shape=rectangle, label=\"B140\"];\nn40813871623045120[shape=rectangle, label=\"B141\"];\nn40532396646334464[shape=rectangle, label=\"B142\"];\nn41376821576466432[shape=rectangle, label=\"B143\"];\nn67553994410557440[shape=rectangle, label=\"B144\"];\nn41939771529887744[shape=rectangle, label=\"B145\"];\nn41658296553177088[shape=rectangle, label=\"B146\"];\nn42502721483309056[shape=rectangle, label=\"B147\"];\nn42221246506598400[shape=rectangle, label=\"B148\"];\nn43065671436730368[shape=rectangle, label=\"B149\"];\nn42784196460019712[shape=rectangle, label=\"B150\"];\nn43628621390151680[shape=rectangle, label=\"B151\"];\nn43347146413441024[shape=rectangle, label=\"B152\"];\nn44191571343572992[shape=rectangle, label=\"B153\"];\nn44754521296994304[shape=rectangle, label=\"B154\"];\nn44473046320283648[shape=rectangle, label=\"B155\"];\nn45035996273704960[shape=rectangle, label=\"B156\"];\nn45598946227126272[shape=rectangle, label=\"B157\"];\nn45317471250415616[shape=rectangle, label=\"B158\"];\nn46161896180547584[shape=rectangle, label=\"B159\"];\nn45880421203836928[shape=rectangle, label=\"B160\"];\nn46724846133968896[shape=rectangle, label=\"B161\"];\nn46443371157258240[shape=rectangle, label=\"B162\"];\nn47287796087390208[shape=rectangle, label=\"B163\"];\nn47850746040811520[shape=rectangle, label=\"B164\"];\nn47569271064100864[shape=rectangle, label=\"B165\"];\nn48413695994232832[shape=rectangle, label=\"B166\"];\nn48132221017522176[shape=rectangle, label=\"B167\"];\nn48976645947654144[shape=rectangle, label=\"B168\"];\nn48695170970943488[shape=rectangle, label=\"B169\"];\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn47006321110679552[shape=rectangle, label=\"B171\"];\nn49821070877786112[shape=rectangle, label=\"B172\"];\nn49539595901075456[shape=rectangle, label=\"B173\"];\nn50384020831207424[shape=rectangle, label=\"B174\"];\nn50665495807918080[shape=rectangle, label=\"B175\"];\nn51228445761339392[shape=rectangle, label=\"B176\"];\nn50946970784628736[shape=rectangle, label=\"B177\"];\nn51791395714760704[shape=rectangle, label=\"B178\"];\nn52072870691471360[shape=rectangle, label=\"B179\"];\nn52354345668182016[shape=rectangle, label=\"B180\"];\nn52917295621603328[shape=rectangle, label=\"B181\"];\nn52635820644892672[shape=rectangle, label=\"B182\"];\nn53198770598313984[shape=rectangle, label=\"B183\"];\nn53761720551735296[shape=rectangle, label=\"B184\"];\nn54324670505156608[shape=rectangle, label=\"B185\"];\nn54043195528445952[shape=rectangle, label=\"B186\"];\nn53480245575024640[shape=rectangle, label=\"B187\"];\nn51509920738050048[shape=rectangle, label=\"B188\"];\nn50102545854496768[shape=rectangle, label=\"B189\"];\nn54887620458577920[shape=rectangle, label=\"B190\"];\nn54606145481867264[shape=rectangle, label=\"B191\"];\nn55450570411999232[shape=rectangle, label=\"B192\"];\nn55169095435288576[shape=rectangle, label=\"B193\"];\nn56013520365420544[shape=rectangle, label=\"B194\"];\nn55732045388709888[shape=rectangle, label=\"B195\"];\nn56576470318841856[shape=rectangle, label=\"B196\"];\nn57139420272263168[shape=rectangle, label=\"B197\"];\nn56857945295552512[shape=rectangle, label=\"B198\"];\nn57702370225684480[shape=rectangle, label=\"B199\"];\nn57420895248973824[shape=rectangle, label=\"B200\"];\nn58265320179105792[shape=rectangle, label=\"B201\"];\nn57983845202395136[shape=rectangle, label=\"B202\"];\nn56294995342131200[shape=rectangle, label=\"B203\"];\nn58828270132527104[shape=rectangle, label=\"B204\"];\nn58546795155816448[shape=rectangle, label=\"B205\"];\nn59391220085948416[shape=rectangle, label=\"B206\"];\nn59109745109237760[shape=rectangle, label=\"B207\"];\nn59954170039369728[shape=rectangle, label=\"B208\"];\nn59672695062659072[shape=rectangle, label=\"B209\"];\nn60517119992791040[shape=rectangle, label=\"B210\"];\nn60235645016080384[shape=rectangle, label=\"B211\"];\nn61080069946212352[shape=rectangle, label=\"B212\"];\nn60798594969501696[shape=rectangle, label=\"B213\"];\nn61643019899633664[shape=rectangle, label=\"B214\"];\nn61361544922923008[shape=rectangle, label=\"B215\"];\nn62205969853054976[shape=rectangle, label=\"B216\"];\nn61924494876344320[shape=rectangle, label=\"B217\"];\nn62768919806476288[shape=rectangle, label=\"B218\"];\nn63050394783186944[shape=rectangle, label=\"B219\"];\nn63331869759897600[shape=rectangle, label=\"B220\"];\nn63613344736608256[shape=rectangle, label=\"B221\"];\nn64176294690029568[shape=rectangle, label=\"B222\"];\nn63894819713318912[shape=rectangle, label=\"B223\"];\nn43910096366862336[shape=rectangle, label=\"B224\"];\nn64739244643450880[shape=rectangle, label=\"B225\"];\nn64457769666740224[shape=rectangle, label=\"B226\"];\nn65020719620161536[shape=rectangle, label=\"B227\"];\nn65302194596872192[shape=rectangle, label=\"B228\"];\nn65865144550293504[shape=rectangle, label=\"B229\"];\nn65583669573582848[shape=rectangle, label=\"B230\"];\nn66146619527004160[shape=rectangle, label=\"B231\"];\nn66428094503714816[shape=rectangle, label=\"B232\"];\nn66709569480425472[shape=rectangle, label=\"B233\"];\nn62487444829765632[shape=rectangle, label=\"B234\"];\nn67272519433846784[shape=rectangle, label=\"B235\"];\nn66991044457136128[shape=rectangle, label=\"B236\"];\nn41095346599755776[shape=rectangle, label=\"B237\"];\nn68116944363978752[shape=rectangle, label=\"B238\"];\nn67835469387268096[shape=rectangle, label=\"B239\"];\nn68679894317400064[shape=rectangle, label=\"B240\"];\nn69242844270821376[shape=rectangle, label=\"B241\"];\nn68961369294110720[shape=rectangle, label=\"B242\"];\nn69524319247532032[shape=rectangle, label=\"B243\"];\nn70087269200953344[shape=rectangle, label=\"B244\"];\nn69805794224242688[shape=rectangle, label=\"B245\"];\nn68398419340689408[shape=rectangle, label=\"B246\"];\nn6473924464345088[shape=rectangle, label=\"B247\"];\nn70650219154374656[shape=rectangle, label=\"B248\"];\nn70368744177664000[shape=rectangle, label=\"B249\"];\nn71213169107795968[shape=rectangle, label=\"B250\"];\nn844424930131968[shape=rectangle, label=\"B251\"];\nn71776119061217280[shape=rectangle, label=\"B252\"];\nn71494644084506624[shape=rectangle, label=\"B253\"];\nn72339069014638592[shape=rectangle, label=\"B254\"];\nn72057594037927936[shape=rectangle, label=\"B255\"];\nn281474976710656[shape=rectangle, label=\"B256\"];\nn72620543991349248[shape=rectangle, label=\"B257\"];\nn73183493944770560[shape=rectangle, label=\"B258\"];\nn72902018968059904[shape=rectangle, label=\"B259\"];\nn73464968921481216[shape=rectangle, label=\"B260\"];\nn73746443898191872[shape=rectangle, label=\"B261\"];\nn74027918874902528[shape=rectangle, label=\"B262\"];\nn75716768735166464[shape=rectangle, label=\"B263\"];\nn74590868828323840[shape=rectangle, label=\"B264\"];\nn75153818781745152[shape=rectangle, label=\"B265\"];\nn75435293758455808[shape=rectangle, label=\"B266\"];\nn74872343805034496[shape=rectangle, label=\"B267\"];\nn74309393851613184[shape=rectangle, label=\"B268\"];\nn76279718688587776[shape=rectangle, label=\"B269\"];\nn75998243711877120[shape=rectangle, label=\"B270\"];\nn76842668642009088[shape=rectangle, label=\"B271\"];\nn76561193665298432[shape=rectangle, label=\"B272\"];\nn77405618595430400[shape=rectangle, label=\"B273\"];\nn77124143618719744[shape=rectangle, label=\"B274\"];\nn77687093572141056[shape=rectangle, label=\"B275\"];\nn5066549580791808[shape=rectangle, label=\"B276\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n844424930131968;\nn562949953421312 -> n1125899906842624;\nn1125899906842624 -> n70931694131085312;\nn70931694131085312 -> n1407374883553280;\nn70931694131085312 -> n1688849860263936;\nn1688849860263936 -> n1407374883553280;\nn1407374883553280 -> n1970324836974592;\nn1407374883553280 -> n2251799813685248;\nn2251799813685248 -> n1970324836974592;\nn1970324836974592 -> n2533274790395904;\nn1970324836974592 -> n2814749767106560;\nn2814749767106560 -> n2533274790395904;\nn2814749767106560 -> n3096224743817216;\nn3096224743817216 -> n2533274790395904;\nn3096224743817216 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn3377699720527872 -> n3940649673949184;\nn3940649673949184 -> n4222124650659840;\nn3659174697238528 -> n4222124650659840;\nn4222124650659840 -> n2533274790395904;\nn2533274790395904 -> n4503599627370496;\nn2533274790395904 -> n4785074604081152;\nn4785074604081152 -> n4503599627370496;\nn4503599627370496 -> n5066549580791808;\nn4503599627370496 -> n5348024557502464;\nn5629499534213120 -> n5910974510923776;\nn5629499534213120 -> n6192449487634432;\nn6192449487634432 -> n5910974510923776;\nn5910974510923776 -> n6473924464345088;\nn5910974510923776 -> n6755399441055744;\nn6755399441055744 -> n7036874417766400;\nn6755399441055744 -> n7318349394477056;\nn7318349394477056 -> n7036874417766400;\nn7036874417766400 -> n7599824371187712;\nn7036874417766400 -> n7881299347898368;\nn7881299347898368 -> n39969446692913152;\nn39969446692913152 -> n8162774324609024;\nn39969446692913152 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n8725724278030336;\nn8162774324609024 -> n9007199254740992;\nn9007199254740992 -> n8725724278030336;\nn8725724278030336 -> n9288674231451648;\nn8725724278030336 -> n9570149208162304;\nn9570149208162304 -> n9288674231451648;\nn9288674231451648 -> n9851624184872960;\nn9288674231451648 -> n10133099161583616;\nn10133099161583616 -> n9851624184872960;\nn9851624184872960 -> n10414574138294272;\nn9851624184872960 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n10977524091715584;\nn10977524091715584 -> n10414574138294272;\nn10977524091715584 -> n11540474045136896;\nn11540474045136896 -> n11821949021847552;\nn11540474045136896 -> n12103423998558208;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn11821949021847552 -> n12666373951979520;\nn12666373951979520 -> n12947848928690176;\nn12666373951979520 -> n13229323905400832;\nn13229323905400832 -> n12947848928690176;\nn12947848928690176 -> n12384898975268864;\nn12947848928690176 -> n13510798882111488;\nn13510798882111488 -> n12384898975268864;\nn12384898975268864 -> n13792273858822144;\nn12384898975268864 -> n14073748835532800;\nn14073748835532800 -> n13792273858822144;\nn13792273858822144 -> n14355223812243456;\nn13792273858822144 -> n14636698788954112;\nn14636698788954112 -> n14355223812243456;\nn14636698788954112 -> n14918173765664768;\nn14918173765664768 -> n15199648742375424;\nn14918173765664768 -> n15481123719086080;\nn15481123719086080 -> n15199648742375424;\nn15199648742375424 -> n15762598695796736;\nn15199648742375424 -> n16044073672507392;\nn16044073672507392 -> n15762598695796736;\nn16044073672507392 -> n16325548649218048;\nn16325548649218048 -> n15762598695796736;\nn16325548649218048 -> n16607023625928704;\nn16607023625928704 -> n16888498602639360;\nn16607023625928704 -> n17169973579350016;\nn17169973579350016 -> n16888498602639360;\nn16888498602639360 -> n15762598695796736;\nn16888498602639360 -> n17451448556060672;\nn17451448556060672 -> n17732923532771328;\nn17451448556060672 -> n18014398509481984;\nn18014398509481984 -> n18295873486192640;\nn18014398509481984 -> n18577348462903296;\nn18577348462903296 -> n18295873486192640;\nn18295873486192640 -> n14355223812243456;\nn18295873486192640 -> n17732923532771328;\nn17732923532771328 -> n14355223812243456;\nn17732923532771328 -> n15762598695796736;\nn15762598695796736 -> n14355223812243456;\nn14355223812243456 -> n18858823439613952;\nn14355223812243456 -> n19140298416324608;\nn19140298416324608 -> n19421773393035264;\nn18858823439613952 -> n19703248369745920;\nn18858823439613952 -> n19984723346456576;\nn19984723346456576 -> n19703248369745920;\nn19703248369745920 -> n20266198323167232;\nn19703248369745920 -> n20547673299877888;\nn20547673299877888 -> n20266198323167232;\nn20266198323167232 -> n20829148276588544;\nn20266198323167232 -> n21110623253299200;\nn21110623253299200 -> n20829148276588544;\nn20829148276588544 -> n21392098230009856;\nn20829148276588544 -> n21673573206720512;\nn21673573206720512 -> n23080948090273792;\nn23080948090273792 -> n21955048183431168;\nn23080948090273792 -> n22236523160141824;\nn22236523160141824 -> n22517998136852480;\nn22236523160141824 -> n22799473113563136;\nn22799473113563136 -> n22517998136852480;\nn22517998136852480 -> n23080948090273792;\nn22517998136852480 -> n21392098230009856;\nn21392098230009856 -> n21955048183431168;\nn21392098230009856 -> n23362423066984448;\nn23362423066984448 -> n19421773393035264;\nn21955048183431168 -> n23643898043695104;\nn21955048183431168 -> n23925373020405760;\nn23925373020405760 -> n23643898043695104;\nn23643898043695104 -> n24206847997116416;\nn23643898043695104 -> n24488322973827072;\nn24488322973827072 -> n24206847997116416;\nn24206847997116416 -> n24769797950537728;\nn24206847997116416 -> n25051272927248384;\nn25051272927248384 -> n24769797950537728;\nn25051272927248384 -> n25332747903959040;\nn25332747903959040 -> n25614222880669696;\nn25332747903959040 -> n25895697857380352;\nn25895697857380352 -> n25614222880669696;\nn25614222880669696 -> n26177172834091008;\nn25614222880669696 -> n26458647810801664;\nn26458647810801664 -> n26177172834091008;\nn26458647810801664 -> n26740122787512320;\nn26740122787512320 -> n26177172834091008;\nn26740122787512320 -> n27021597764222976;\nn27021597764222976 -> n27303072740933632;\nn27021597764222976 -> n27584547717644288;\nn27584547717644288 -> n27303072740933632;\nn27303072740933632 -> n27866022694354944;\nn27303072740933632 -> n26177172834091008;\nn26177172834091008 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn27866022694354944 -> n28428972647776256;\nn28428972647776256 -> n28147497671065600;\nn28147497671065600 -> n28710447624486912;\nn28147497671065600 -> n28991922601197568;\nn28991922601197568 -> n28710447624486912;\nn28991922601197568 -> n29273397577908224;\nn29273397577908224 -> n28710447624486912;\nn29273397577908224 -> n29554872554618880;\nn29554872554618880 -> n29836347531329536;\nn29554872554618880 -> n30117822508040192;\nn30117822508040192 -> n29836347531329536;\nn29836347531329536 -> n30399297484750848;\nn29836347531329536 -> n28710447624486912;\nn28710447624486912 -> n30399297484750848;\nn30399297484750848 -> n30680772461461504;\nn30399297484750848 -> n30962247438172160;\nn30962247438172160 -> n31243722414882816;\nn30962247438172160 -> n31525197391593472;\nn31525197391593472 -> n31243722414882816;\nn31243722414882816 -> n30680772461461504;\nn31243722414882816 -> n31806672368304128;\nn31806672368304128 -> n32088147345014784;\nn31806672368304128 -> n32369622321725440;\nn32369622321725440 -> n32651097298436096;\nn32369622321725440 -> n32932572275146752;\nn32932572275146752 -> n32651097298436096;\nn32932572275146752 -> n33214047251857408;\nn33214047251857408 -> n32088147345014784;\nn33214047251857408 -> n32651097298436096;\nn32651097298436096 -> n33495522228568064;\nn30680772461461504 -> n32088147345014784;\nn30680772461461504 -> n33776997205278720;\nn33776997205278720 -> n33495522228568064;\nn33495522228568064 -> n32088147345014784;\nn32088147345014784 -> n34058472181989376;\nn32088147345014784 -> n34339947158700032;\nn34339947158700032 -> n34058472181989376;\nn34339947158700032 -> n34621422135410688;\nn34621422135410688 -> n34058472181989376;\nn24769797950537728 -> n34902897112121344;\nn24769797950537728 -> n35184372088832000;\nn35184372088832000 -> n34902897112121344;\nn34902897112121344 -> n34058472181989376;\nn34902897112121344 -> n35465847065542656;\nn35465847065542656 -> n34058472181989376;\nn35465847065542656 -> n35747322042253312;\nn35747322042253312 -> n19421773393035264;\nn10414574138294272 -> n36028797018963968;\nn10414574138294272 -> n36310271995674624;\nn36310271995674624 -> n36028797018963968;\nn36028797018963968 -> n34058472181989376;\nn36028797018963968 -> n36591746972385280;\nn36591746972385280 -> n34058472181989376;\nn36591746972385280 -> n36873221949095936;\nn36873221949095936 -> n37154696925806592;\nn36873221949095936 -> n37436171902517248;\nn37436171902517248 -> n37154696925806592;\nn37154696925806592 -> n34058472181989376;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37717646879227904 -> n38280596832649216;\nn38280596832649216 -> n37999121855938560;\nn37999121855938560 -> n34058472181989376;\nn37999121855938560 -> n38562071809359872;\nn38562071809359872 -> n34058472181989376;\nn38562071809359872 -> n38843546786070528;\nn38843546786070528 -> n34058472181989376;\nn38843546786070528 -> n39125021762781184;\nn39125021762781184 -> n19421773393035264;\nn19421773393035264 -> n34058472181989376;\nn34058472181989376 -> n39406496739491840;\nn34058472181989376 -> n39687971716202496;\nn39687971716202496 -> n39406496739491840;\nn39406496739491840 -> n39969446692913152;\nn39406496739491840 -> n40250921669623808;\nn40250921669623808 -> n7599824371187712;\nn7599824371187712 -> n40532396646334464;\nn7599824371187712 -> n40813871623045120;\nn40813871623045120 -> n40532396646334464;\nn40532396646334464 -> n41095346599755776;\nn40532396646334464 -> n41376821576466432;\nn41376821576466432 -> n67553994410557440;\nn67553994410557440 -> n41658296553177088;\nn67553994410557440 -> n41939771529887744;\nn41939771529887744 -> n41658296553177088;\nn41658296553177088 -> n42221246506598400;\nn41658296553177088 -> n42502721483309056;\nn42502721483309056 -> n42221246506598400;\nn42221246506598400 -> n42784196460019712;\nn42221246506598400 -> n43065671436730368;\nn43065671436730368 -> n42784196460019712;\nn42784196460019712 -> n43347146413441024;\nn42784196460019712 -> n43628621390151680;\nn43628621390151680 -> n43347146413441024;\nn43347146413441024 -> n43910096366862336;\nn43347146413441024 -> n44191571343572992;\nn44191571343572992 -> n44473046320283648;\nn44191571343572992 -> n44754521296994304;\nn44754521296994304 -> n44473046320283648;\nn44473046320283648 -> n43910096366862336;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn45035996273704960 -> n45598946227126272;\nn45598946227126272 -> n45317471250415616;\nn45317471250415616 -> n45880421203836928;\nn45317471250415616 -> n46161896180547584;\nn46161896180547584 -> n45880421203836928;\nn45880421203836928 -> n46443371157258240;\nn45880421203836928 -> n46724846133968896;\nn46724846133968896 -> n46443371157258240;\nn46443371157258240 -> n47006321110679552;\nn46443371157258240 -> n47287796087390208;\nn47287796087390208 -> n47569271064100864;\nn47287796087390208 -> n47850746040811520;\nn47850746040811520 -> n47569271064100864;\nn47569271064100864 -> n48132221017522176;\nn47569271064100864 -> n48413695994232832;\nn48413695994232832 -> n48132221017522176;\nn48132221017522176 -> n48695170970943488;\nn48132221017522176 -> n48976645947654144;\nn48976645947654144 -> n48695170970943488;\nn48695170970943488 -> n47006321110679552;\nn48695170970943488 -> n49258120924364800;\nn49258120924364800 -> n47006321110679552;\nn47006321110679552 -> n49539595901075456;\nn47006321110679552 -> n49821070877786112;\nn49821070877786112 -> n49539595901075456;\nn49539595901075456 -> n50102545854496768;\nn49539595901075456 -> n50384020831207424;\nn50384020831207424 -> n50102545854496768;\nn50384020831207424 -> n50665495807918080;\nn50665495807918080 -> n50946970784628736;\nn50665495807918080 -> n51228445761339392;\nn51228445761339392 -> n50946970784628736;\nn50946970784628736 -> n51509920738050048;\nn50946970784628736 -> n51791395714760704;\nn51791395714760704 -> n51509920738050048;\nn51791395714760704 -> n52072870691471360;\nn52072870691471360 -> n51509920738050048;\nn52072870691471360 -> n52354345668182016;\nn52354345668182016 -> n52635820644892672;\nn52354345668182016 -> n52917295621603328;\nn52917295621603328 -> n52635820644892672;\nn52635820644892672 -> n51509920738050048;\nn52635820644892672 -> n53198770598313984;\nn53198770598313984 -> n53480245575024640;\nn53198770598313984 -> n53761720551735296;\nn53761720551735296 -> n54043195528445952;\nn53761720551735296 -> n54324670505156608;\nn54324670505156608 -> n54043195528445952;\nn54043195528445952 -> n50102545854496768;\nn54043195528445952 -> n53480245575024640;\nn53480245575024640 -> n50102545854496768;\nn53480245575024640 -> n51509920738050048;\nn51509920738050048 -> n50102545854496768;\nn50102545854496768 -> n54606145481867264;\nn50102545854496768 -> n54887620458577920;\nn54887620458577920 -> n54606145481867264;\nn54606145481867264 -> n55169095435288576;\nn54606145481867264 -> n55450570411999232;\nn55450570411999232 -> n55169095435288576;\nn55169095435288576 -> n55732045388709888;\nn55169095435288576 -> n56013520365420544;\nn56013520365420544 -> n55732045388709888;\nn55732045388709888 -> n56294995342131200;\nn55732045388709888 -> n56576470318841856;\nn56576470318841856 -> n56857945295552512;\nn56576470318841856 -> n57139420272263168;\nn57139420272263168 -> n56857945295552512;\nn56857945295552512 -> n57420895248973824;\nn56857945295552512 -> n57702370225684480;\nn57702370225684480 -> n57420895248973824;\nn57420895248973824 -> n57983845202395136;\nn57420895248973824 -> n58265320179105792;\nn58265320179105792 -> n57983845202395136;\nn57983845202395136 -> n56294995342131200;\nn56294995342131200 -> n58546795155816448;\nn56294995342131200 -> n58828270132527104;\nn58828270132527104 -> n58546795155816448;\nn58546795155816448 -> n59109745109237760;\nn58546795155816448 -> n59391220085948416;\nn59391220085948416 -> n59109745109237760;\nn59109745109237760 -> n59672695062659072;\nn59109745109237760 -> n59954170039369728;\nn59954170039369728 -> n59672695062659072;\nn59672695062659072 -> n60235645016080384;\nn59672695062659072 -> n60517119992791040;\nn60517119992791040 -> n60235645016080384;\nn60235645016080384 -> n60798594969501696;\nn60235645016080384 -> n61080069946212352;\nn61080069946212352 -> n60798594969501696;\nn60798594969501696 -> n61361544922923008;\nn60798594969501696 -> n61643019899633664;\nn61643019899633664 -> n61361544922923008;\nn61361544922923008 -> n61924494876344320;\nn61361544922923008 -> n62205969853054976;\nn62205969853054976 -> n61924494876344320;\nn61924494876344320 -> n62487444829765632;\nn61924494876344320 -> n62768919806476288;\nn62768919806476288 -> n62487444829765632;\nn62768919806476288 -> n63050394783186944;\nn63050394783186944 -> n62487444829765632;\nn63050394783186944 -> n63331869759897600;\nn63331869759897600 -> n62487444829765632;\nn63331869759897600 -> n63613344736608256;\nn63613344736608256 -> n63894819713318912;\nn63613344736608256 -> n64176294690029568;\nn64176294690029568 -> n63894819713318912;\nn63894819713318912 -> n62487444829765632;\nn43910096366862336 -> n64457769666740224;\nn43910096366862336 -> n64739244643450880;\nn64739244643450880 -> n64457769666740224;\nn64457769666740224 -> n62487444829765632;\nn64457769666740224 -> n65020719620161536;\nn65020719620161536 -> n62487444829765632;\nn65020719620161536 -> n65302194596872192;\nn65302194596872192 -> n65583669573582848;\nn65302194596872192 -> n65865144550293504;\nn65865144550293504 -> n65583669573582848;\nn65583669573582848 -> n62487444829765632;\nn65583669573582848 -> n66146619527004160;\nn66146619527004160 -> n62487444829765632;\nn66146619527004160 -> n66428094503714816;\nn66428094503714816 -> n62487444829765632;\nn66428094503714816 -> n66709569480425472;\nn66709569480425472 -> n62487444829765632;\nn62487444829765632 -> n66991044457136128;\nn62487444829765632 -> n67272519433846784;\nn67272519433846784 -> n66991044457136128;\nn66991044457136128 -> n67553994410557440;\nn66991044457136128 -> n41095346599755776;\nn41095346599755776 -> n67835469387268096;\nn41095346599755776 -> n68116944363978752;\nn68116944363978752 -> n67835469387268096;\nn67835469387268096 -> n68398419340689408;\nn67835469387268096 -> n68679894317400064;\nn68679894317400064 -> n68961369294110720;\nn68679894317400064 -> n69242844270821376;\nn69242844270821376 -> n68961369294110720;\nn68961369294110720 -> n68398419340689408;\nn68961369294110720 -> n69524319247532032;\nn69524319247532032 -> n69805794224242688;\nn69524319247532032 -> n70087269200953344;\nn70087269200953344 -> n69805794224242688;\nn69805794224242688 -> n68398419340689408;\nn68398419340689408 -> n6473924464345088;\nn6473924464345088 -> n70368744177664000;\nn6473924464345088 -> n70650219154374656;\nn70650219154374656 -> n70368744177664000;\nn70368744177664000 -> n70931694131085312;\nn70368744177664000 -> n71213169107795968;\nn71213169107795968 -> n844424930131968;\nn844424930131968 -> n71494644084506624;\nn844424930131968 -> n71776119061217280;\nn71776119061217280 -> n71494644084506624;\nn71494644084506624 -> n72057594037927936;\nn71494644084506624 -> n72339069014638592;\nn72339069014638592 -> n72057594037927936;\nn72057594037927936 -> n281474976710656;\nn72620543991349248 -> n72902018968059904;\nn72620543991349248 -> n73183493944770560;\nn73183493944770560 -> n72902018968059904;\nn72902018968059904 -> n6473924464345088;\nn72902018968059904 -> n73464968921481216;\nn73464968921481216 -> n6473924464345088;\nn73464968921481216 -> n73746443898191872;\nn73746443898191872 -> n6473924464345088;\nn74027918874902528 -> n75716768735166464;\nn75716768735166464 -> n74309393851613184;\nn75716768735166464 -> n74590868828323840;\nn74590868828323840 -> n74872343805034496;\nn74590868828323840 -> n75153818781745152;\nn75153818781745152 -> n75435293758455808;\nn75435293758455808 -> n75435293758455808[style=dashed];\nn75435293758455808 -> n74872343805034496;\nn74872343805034496 -> n75716768735166464;\nn74872343805034496 -> n74309393851613184;\nn74309393851613184 -> n75998243711877120;\nn74309393851613184 -> n76279718688587776;\nn76279718688587776 -> n75998243711877120;\nn75998243711877120 -> n76561193665298432;\nn75998243711877120 -> n76842668642009088;\nn76842668642009088 -> n76561193665298432;\nn76561193665298432 -> n77124143618719744;\nn76561193665298432 -> n77405618595430400;\nn77405618595430400 -> n77124143618719744;\nn77124143618719744 -> n6473924464345088;\nn77124143618719744 -> n77687093572141056;\nn77687093572141056 -> n6473924464345088;\nn5066549580791808 -> n6473924464345088[style=dashed];\nn70931694131085312 -> n1125899906842624[style=dotted];\nn1407374883553280 -> n70931694131085312[style=dotted];\nn1970324836974592 -> n1407374883553280[style=dotted];\nn4222124650659840 -> n3377699720527872[style=dotted];\nn2533274790395904 -> n1970324836974592[style=dotted];\nn4503599627370496 -> n2533274790395904[style=dotted];\nn6473924464345088 -> n5066549580791808[style=dotted];\nn70368744177664000 -> n6473924464345088[style=dotted];\nn844424930131968 -> n562949953421312[style=dotted];\nn71494644084506624 -> n844424930131968[style=dotted];\nn72057594037927936 -> n71494644084506624[style=dotted];\nn281474976710656 -> n0[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-250.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn1688849860263936[shape=rectangle, label=\"B4\"];\nn63050394783186944[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn1970324836974592[shape=rectangle, label=\"B7\"];\nn2814749767106560[shape=rectangle, label=\"B8\"];\nn3377699720527872[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn3940649673949184[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn4503599627370496[shape=rectangle, label=\"B13\"];\nn4785074604081152[shape=rectangle, label=\"B14\"];\nn5066549580791808[shape=rectangle, label=\"B15\"];\nn5629499534213120[shape=rectangle, label=\"B16\"];\nn5348024557502464[shape=rectangle, label=\"B17\"];\nn5910974510923776[shape=rectangle, label=\"B18\"];\nn4222124650659840[shape=rectangle, label=\"B19\"];\nn6473924464345088[shape=rectangle, label=\"B20\"];\nn6192449487634432[shape=rectangle, label=\"B21\"];\nn7036874417766400[shape=rectangle, label=\"B22\"];\nn7599824371187712[shape=rectangle, label=\"B23\"];\nn7318349394477056[shape=rectangle, label=\"B24\"];\nn6755399441055744[shape=rectangle, label=\"B25\"];\nn8444249301319680[shape=rectangle, label=\"B26\"];\nn8162774324609024[shape=rectangle, label=\"B27\"];\nn9007199254740992[shape=rectangle, label=\"B28\"];\nn9288674231451648[shape=rectangle, label=\"B29\"];\nn9851624184872960[shape=rectangle, label=\"B30\"];\nn9570149208162304[shape=rectangle, label=\"B31\"];\nn10414574138294272[shape=rectangle, label=\"B32\"];\nn10133099161583616[shape=rectangle, label=\"B33\"];\nn10977524091715584[shape=rectangle, label=\"B34\"];\nn10696049115004928[shape=rectangle, label=\"B35\"];\nn11540474045136896[shape=rectangle, label=\"B36\"];\nn11258999068426240[shape=rectangle, label=\"B37\"];\nn11821949021847552[shape=rectangle, label=\"B38\"];\nn12384898975268864[shape=rectangle, label=\"B39\"];\nn12666373951979520[shape=rectangle, label=\"B40\"];\nn12103423998558208[shape=rectangle, label=\"B41\"];\nn13229323905400832[shape=rectangle, label=\"B42\"];\nn12947848928690176[shape=rectangle, label=\"B43\"];\nn13792273858822144[shape=rectangle, label=\"B44\"];\nn13510798882111488[shape=rectangle, label=\"B45\"];\nn14073748835532800[shape=rectangle, label=\"B46\"];\nn14355223812243456[shape=rectangle, label=\"B47\"];\nn14918173765664768[shape=rectangle, label=\"B48\"];\nn14636698788954112[shape=rectangle, label=\"B49\"];\nn8725724278030336[shape=rectangle, label=\"B50\"];\nn15481123719086080[shape=rectangle, label=\"B51\"];\nn15199648742375424[shape=rectangle, label=\"B52\"];\nn15762598695796736[shape=rectangle, label=\"B53\"];\nn16325548649218048[shape=rectangle, label=\"B54\"];\nn16044073672507392[shape=rectangle, label=\"B55\"];\nn16888498602639360[shape=rectangle, label=\"B56\"];\nn17451448556060672[shape=rectangle, label=\"B57\"];\nn17169973579350016[shape=rectangle, label=\"B58\"];\nn16607023625928704[shape=rectangle, label=\"B59\"];\nn18014398509481984[shape=rectangle, label=\"B60\"];\nn17732923532771328[shape=rectangle, label=\"B61\"];\nn18577348462903296[shape=rectangle, label=\"B62\"];\nn18858823439613952[shape=rectangle, label=\"B63\"];\nn19140298416324608[shape=rectangle, label=\"B64\"];\nn18295873486192640[shape=rectangle, label=\"B65\"];\nn19703248369745920[shape=rectangle, label=\"B66\"];\nn19984723346456576[shape=rectangle, label=\"B67\"];\nn19421773393035264[shape=rectangle, label=\"B68\"];\nn20547673299877888[shape=rectangle, label=\"B69\"];\nn20266198323167232[shape=rectangle, label=\"B70\"];\nn21110623253299200[shape=rectangle, label=\"B71\"];\nn20829148276588544[shape=rectangle, label=\"B72\"];\nn7881299347898368[shape=rectangle, label=\"B73\"];\nn21673573206720512[shape=rectangle, label=\"B74\"];\nn21392098230009856[shape=rectangle, label=\"B75\"];\nn22236523160141824[shape=rectangle, label=\"B76\"];\nn22799473113563136[shape=rectangle, label=\"B77\"];\nn22517998136852480[shape=rectangle, label=\"B78\"];\nn23080948090273792[shape=rectangle, label=\"B79\"];\nn23643898043695104[shape=rectangle, label=\"B80\"];\nn23362423066984448[shape=rectangle, label=\"B81\"];\nn24206847997116416[shape=rectangle, label=\"B82\"];\nn24769797950537728[shape=rectangle, label=\"B83\"];\nn25332747903959040[shape=rectangle, label=\"B84\"];\nn25051272927248384[shape=rectangle, label=\"B85\"];\nn24488322973827072[shape=rectangle, label=\"B86\"];\nn25895697857380352[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn26458647810801664[shape=rectangle, label=\"B89\"];\nn26740122787512320[shape=rectangle, label=\"B90\"];\nn27303072740933632[shape=rectangle, label=\"B91\"];\nn27866022694354944[shape=rectangle, label=\"B92\"];\nn27021597764222976[shape=rectangle, label=\"B93\"];\nn27584547717644288[shape=rectangle, label=\"B94\"];\nn28428972647776256[shape=rectangle, label=\"B95\"];\nn28147497671065600[shape=rectangle, label=\"B96\"];\nn28710447624486912[shape=rectangle, label=\"B97\"];\nn29273397577908224[shape=rectangle, label=\"B98\"];\nn29554872554618880[shape=rectangle, label=\"B99\"];\nn29836347531329536[shape=rectangle, label=\"B100\"];\nn30399297484750848[shape=rectangle, label=\"B101\"];\nn26177172834091008[shape=rectangle, label=\"B102\"];\nn30962247438172160[shape=rectangle, label=\"B103\"];\nn30680772461461504[shape=rectangle, label=\"B104\"];\nn31525197391593472[shape=rectangle, label=\"B105\"];\nn32088147345014784[shape=rectangle, label=\"B106\"];\nn31806672368304128[shape=rectangle, label=\"B107\"];\nn31243722414882816[shape=rectangle, label=\"B108\"];\nn32369622321725440[shape=rectangle, label=\"B109\"];\nn32932572275146752[shape=rectangle, label=\"B110\"];\nn33214047251857408[shape=rectangle, label=\"B111\"];\nn33776997205278720[shape=rectangle, label=\"B112\"];\nn33495522228568064[shape=rectangle, label=\"B113\"];\nn34339947158700032[shape=rectangle, label=\"B114\"];\nn34058472181989376[shape=rectangle, label=\"B115\"];\nn32651097298436096[shape=rectangle, label=\"B116\"];\nn34902897112121344[shape=rectangle, label=\"B117\"];\nn35184372088832000[shape=rectangle, label=\"B118\"];\nn34621422135410688[shape=rectangle, label=\"B119\"];\nn30117822508040192[shape=rectangle, label=\"B120\"];\nn28991922601197568[shape=rectangle, label=\"B121\"];\nn23925373020405760[shape=rectangle, label=\"B122\"];\nn35747322042253312[shape=rectangle, label=\"B123\"];\nn35465847065542656[shape=rectangle, label=\"B124\"];\nn36310271995674624[shape=rectangle, label=\"B125\"];\nn36873221949095936[shape=rectangle, label=\"B126\"];\nn36591746972385280[shape=rectangle, label=\"B127\"];\nn37154696925806592[shape=rectangle, label=\"B128\"];\nn37717646879227904[shape=rectangle, label=\"B129\"];\nn37436171902517248[shape=rectangle, label=\"B130\"];\nn38562071809359872[shape=rectangle, label=\"B131\"];\nn37999121855938560[shape=rectangle, label=\"B132\"];\nn38843546786070528[shape=rectangle, label=\"B133\"];\nn39406496739491840[shape=rectangle, label=\"B134\"];\nn39125021762781184[shape=rectangle, label=\"B135\"];\nn39969446692913152[shape=rectangle, label=\"B136\"];\nn39687971716202496[shape=rectangle, label=\"B137\"];\nn40250921669623808[shape=rectangle, label=\"B138\"];\nn36028797018963968[shape=rectangle, label=\"B139\"];\nn38280596832649216[shape=rectangle, label=\"B140\"];\nn40813871623045120[shape=rectangle, label=\"B141\"];\nn40532396646334464[shape=rectangle, label=\"B142\"];\nn41376821576466432[shape=rectangle, label=\"B143\"];\nn41939771529887744[shape=rectangle, label=\"B144\"];\nn41658296553177088[shape=rectangle, label=\"B145\"];\nn42502721483309056[shape=rectangle, label=\"B146\"];\nn42221246506598400[shape=rectangle, label=\"B147\"];\nn42784196460019712[shape=rectangle, label=\"B148\"];\nn43065671436730368[shape=rectangle, label=\"B149\"];\nn43347146413441024[shape=rectangle, label=\"B150\"];\nn41095346599755776[shape=rectangle, label=\"B151\"];\nn43910096366862336[shape=rectangle, label=\"B152\"];\nn43628621390151680[shape=rectangle, label=\"B153\"];\nn21955048183431168[shape=rectangle, label=\"B154\"];\nn44473046320283648[shape=rectangle, label=\"B155\"];\nn44191571343572992[shape=rectangle, label=\"B156\"];\nn45035996273704960[shape=rectangle, label=\"B157\"];\nn45598946227126272[shape=rectangle, label=\"B158\"];\nn46161896180547584[shape=rectangle, label=\"B159\"];\nn46443371157258240[shape=rectangle, label=\"B160\"];\nn45317471250415616[shape=rectangle, label=\"B161\"];\nn47006321110679552[shape=rectangle, label=\"B162\"];\nn47287796087390208[shape=rectangle, label=\"B163\"];\nn47569271064100864[shape=rectangle, label=\"B164\"];\nn47850746040811520[shape=rectangle, label=\"B165\"];\nn46724846133968896[shape=rectangle, label=\"B166\"];\nn48413695994232832[shape=rectangle, label=\"B167\"];\nn48695170970943488[shape=rectangle, label=\"B168\"];\nn48976645947654144[shape=rectangle, label=\"B169\"];\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn49539595901075456[shape=rectangle, label=\"B171\"];\nn48132221017522176[shape=rectangle, label=\"B172\"];\nn49821070877786112[shape=rectangle, label=\"B173\"];\nn50102545854496768[shape=rectangle, label=\"B174\"];\nn45880421203836928[shape=rectangle, label=\"B175\"];\nn50665495807918080[shape=rectangle, label=\"B176\"];\nn50946970784628736[shape=rectangle, label=\"B177\"];\nn50384020831207424[shape=rectangle, label=\"B178\"];\nn44754521296994304[shape=rectangle, label=\"B179\"];\nn51509920738050048[shape=rectangle, label=\"B180\"];\nn51228445761339392[shape=rectangle, label=\"B181\"];\nn52072870691471360[shape=rectangle, label=\"B182\"];\nn51791395714760704[shape=rectangle, label=\"B183\"];\nn52917295621603328[shape=rectangle, label=\"B184\"];\nn52635820644892672[shape=rectangle, label=\"B185\"];\nn53198770598313984[shape=rectangle, label=\"B186\"];\nn53761720551735296[shape=rectangle, label=\"B187\"];\nn53480245575024640[shape=rectangle, label=\"B188\"];\nn54324670505156608[shape=rectangle, label=\"B189\"];\nn54043195528445952[shape=rectangle, label=\"B190\"];\nn54887620458577920[shape=rectangle, label=\"B191\"];\nn54606145481867264[shape=rectangle, label=\"B192\"];\nn55450570411999232[shape=rectangle, label=\"B193\"];\nn56013520365420544[shape=rectangle, label=\"B194\"];\nn55732045388709888[shape=rectangle, label=\"B195\"];\nn56294995342131200[shape=rectangle, label=\"B196\"];\nn56857945295552512[shape=rectangle, label=\"B197\"];\nn56576470318841856[shape=rectangle, label=\"B198\"];\nn57139420272263168[shape=rectangle, label=\"B199\"];\nn57702370225684480[shape=rectangle, label=\"B200\"];\nn57420895248973824[shape=rectangle, label=\"B201\"];\nn58265320179105792[shape=rectangle, label=\"B202\"];\nn57983845202395136[shape=rectangle, label=\"B203\"];\nn58546795155816448[shape=rectangle, label=\"B204\"];\nn55169095435288576[shape=rectangle, label=\"B205\"];\nn59109745109237760[shape=rectangle, label=\"B206\"];\nn59672695062659072[shape=rectangle, label=\"B207\"];\nn59391220085948416[shape=rectangle, label=\"B208\"];\nn59954170039369728[shape=rectangle, label=\"B209\"];\nn60517119992791040[shape=rectangle, label=\"B210\"];\nn60235645016080384[shape=rectangle, label=\"B211\"];\nn61080069946212352[shape=rectangle, label=\"B212\"];\nn60798594969501696[shape=rectangle, label=\"B213\"];\nn61361544922923008[shape=rectangle, label=\"B214\"];\nn61643019899633664[shape=rectangle, label=\"B215\"];\nn58828270132527104[shape=rectangle, label=\"B216\"];\nn62205969853054976[shape=rectangle, label=\"B217\"];\nn61924494876344320[shape=rectangle, label=\"B218\"];\nn52354345668182016[shape=rectangle, label=\"B219\"];\nn2533274790395904[shape=rectangle, label=\"B220\"];\nn62768919806476288[shape=rectangle, label=\"B221\"];\nn62487444829765632[shape=rectangle, label=\"B222\"];\nn63331869759897600[shape=rectangle, label=\"B223\"];\nn1407374883553280[shape=rectangle, label=\"B224\"];\nn844424930131968[shape=rectangle, label=\"B225\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn1125899906842624 -> n1688849860263936;\nn1688849860263936 -> n63050394783186944;\nn63050394783186944 -> n1970324836974592;\nn63050394783186944 -> n2251799813685248;\nn2251799813685248 -> n1970324836974592;\nn1970324836974592 -> n2533274790395904;\nn1970324836974592 -> n2814749767106560;\nn2814749767106560 -> n3096224743817216;\nn2814749767106560 -> n3377699720527872;\nn3377699720527872 -> n3096224743817216;\nn3096224743817216 -> n3659174697238528;\nn3096224743817216 -> n3940649673949184;\nn3940649673949184 -> n3659174697238528;\nn3659174697238528 -> n4222124650659840;\nn3659174697238528 -> n4503599627370496;\nn4503599627370496 -> n4222124650659840;\nn4503599627370496 -> n4785074604081152;\nn4785074604081152 -> n4222124650659840;\nn4785074604081152 -> n5066549580791808;\nn5066549580791808 -> n5348024557502464;\nn5066549580791808 -> n5629499534213120;\nn5629499534213120 -> n5910974510923776;\nn5348024557502464 -> n5910974510923776;\nn5910974510923776 -> n4222124650659840;\nn4222124650659840 -> n6192449487634432;\nn4222124650659840 -> n6473924464345088;\nn6473924464345088 -> n6192449487634432;\nn6192449487634432 -> n6755399441055744;\nn6192449487634432 -> n7036874417766400;\nn7036874417766400 -> n7318349394477056;\nn7036874417766400 -> n7599824371187712;\nn7599824371187712 -> n7318349394477056;\nn7318349394477056 -> n7881299347898368;\nn7318349394477056 -> n6755399441055744;\nn6755399441055744 -> n8162774324609024;\nn6755399441055744 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n8725724278030336;\nn8162774324609024 -> n9007199254740992;\nn9288674231451648 -> n9570149208162304;\nn9288674231451648 -> n9851624184872960;\nn9851624184872960 -> n9570149208162304;\nn9570149208162304 -> n10133099161583616;\nn9570149208162304 -> n10414574138294272;\nn10414574138294272 -> n10133099161583616;\nn10133099161583616 -> n10696049115004928;\nn10133099161583616 -> n10977524091715584;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n11258999068426240;\nn10696049115004928 -> n11540474045136896;\nn11540474045136896 -> n11258999068426240;\nn11258999068426240 -> n8725724278030336;\nn11258999068426240 -> n11821949021847552;\nn11821949021847552 -> n12103423998558208;\nn11821949021847552 -> n12384898975268864;\nn12384898975268864 -> n8725724278030336;\nn12384898975268864 -> n12666373951979520;\nn12103423998558208 -> n12947848928690176;\nn12103423998558208 -> n13229323905400832;\nn13229323905400832 -> n12947848928690176;\nn12947848928690176 -> n13510798882111488;\nn12947848928690176 -> n13792273858822144;\nn13792273858822144 -> n13510798882111488;\nn13510798882111488 -> n8725724278030336;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n8725724278030336;\nn14073748835532800 -> n14355223812243456;\nn14355223812243456 -> n14636698788954112;\nn14355223812243456 -> n14918173765664768;\nn14918173765664768 -> n14636698788954112;\nn14636698788954112 -> n7881299347898368;\nn14636698788954112 -> n8725724278030336;\nn8725724278030336 -> n15199648742375424;\nn8725724278030336 -> n15481123719086080;\nn15481123719086080 -> n15199648742375424;\nn15199648742375424 -> n7881299347898368;\nn15199648742375424 -> n15762598695796736;\nn15762598695796736 -> n16044073672507392;\nn15762598695796736 -> n16325548649218048;\nn16325548649218048 -> n16044073672507392;\nn16044073672507392 -> n16607023625928704;\nn16044073672507392 -> n16888498602639360;\nn16888498602639360 -> n17169973579350016;\nn16888498602639360 -> n17451448556060672;\nn17451448556060672 -> n17169973579350016;\nn17169973579350016 -> n7881299347898368;\nn17169973579350016 -> n16607023625928704;\nn16607023625928704 -> n17732923532771328;\nn16607023625928704 -> n18014398509481984;\nn18014398509481984 -> n17732923532771328;\nn17732923532771328 -> n18295873486192640;\nn17732923532771328 -> n18577348462903296;\nn18577348462903296 -> n18295873486192640;\nn18577348462903296 -> n18858823439613952;\nn18858823439613952 -> n7881299347898368;\nn18858823439613952 -> n19140298416324608;\nn19140298416324608 -> n7881299347898368;\nn19140298416324608 -> n18295873486192640;\nn18295873486192640 -> n19421773393035264;\nn18295873486192640 -> n19703248369745920;\nn19703248369745920 -> n7881299347898368;\nn19703248369745920 -> n19984723346456576;\nn19984723346456576 -> n7881299347898368;\nn19984723346456576 -> n19421773393035264;\nn19421773393035264 -> n20266198323167232;\nn19421773393035264 -> n20547673299877888;\nn20547673299877888 -> n20266198323167232;\nn20266198323167232 -> n20829148276588544;\nn20266198323167232 -> n21110623253299200;\nn21110623253299200 -> n7881299347898368;\nn21110623253299200 -> n20829148276588544;\nn20829148276588544 -> n7881299347898368;\nn7881299347898368 -> n21392098230009856;\nn7881299347898368 -> n21673573206720512;\nn21673573206720512 -> n21392098230009856;\nn21392098230009856 -> n21955048183431168;\nn21392098230009856 -> n22236523160141824;\nn22236523160141824 -> n22517998136852480;\nn22236523160141824 -> n22799473113563136;\nn22799473113563136 -> n23080948090273792;\nn22799473113563136 -> n22517998136852480;\nn22517998136852480 -> n23080948090273792;\nn23080948090273792 -> n23362423066984448;\nn23080948090273792 -> n23643898043695104;\nn23643898043695104 -> n23362423066984448;\nn23362423066984448 -> n23925373020405760;\nn23362423066984448 -> n24206847997116416;\nn24206847997116416 -> n24488322973827072;\nn24206847997116416 -> n24769797950537728;\nn24769797950537728 -> n25051272927248384;\nn24769797950537728 -> n25332747903959040;\nn25332747903959040 -> n25051272927248384;\nn25051272927248384 -> n23925373020405760;\nn25051272927248384 -> n24488322973827072;\nn24488322973827072 -> n25614222880669696;\nn24488322973827072 -> n25895697857380352;\nn25895697857380352 -> n25614222880669696;\nn25614222880669696 -> n26177172834091008;\nn25614222880669696 -> n26458647810801664;\nn26740122787512320 -> n27021597764222976;\nn26740122787512320 -> n27303072740933632;\nn27303072740933632 -> n27584547717644288;\nn27303072740933632 -> n27866022694354944;\nn27866022694354944 -> n27584547717644288;\nn27866022694354944 -> n27021597764222976;\nn27021597764222976 -> n27584547717644288;\nn27584547717644288 -> n28147497671065600;\nn27584547717644288 -> n28428972647776256;\nn28428972647776256 -> n28147497671065600;\nn28147497671065600 -> n23925373020405760;\nn28147497671065600 -> n28710447624486912;\nn28710447624486912 -> n28991922601197568;\nn29273397577908224 -> n23925373020405760;\nn29273397577908224 -> n29554872554618880;\nn29554872554618880 -> n23925373020405760;\nn29554872554618880 -> n29836347531329536;\nn29836347531329536 -> n30117822508040192;\nn30399297484750848 -> n23925373020405760;\nn30399297484750848 -> n26177172834091008;\nn26177172834091008 -> n30680772461461504;\nn26177172834091008 -> n30962247438172160;\nn30962247438172160 -> n30680772461461504;\nn30680772461461504 -> n31243722414882816;\nn30680772461461504 -> n31525197391593472;\nn31525197391593472 -> n31806672368304128;\nn31525197391593472 -> n32088147345014784;\nn32088147345014784 -> n31806672368304128;\nn31806672368304128 -> n23925373020405760;\nn31806672368304128 -> n31243722414882816;\nn31243722414882816 -> n23925373020405760;\nn31243722414882816 -> n32369622321725440;\nn32369622321725440 -> n32651097298436096;\nn32369622321725440 -> n32932572275146752;\nn33214047251857408 -> n33495522228568064;\nn33214047251857408 -> n33776997205278720;\nn33776997205278720 -> n33495522228568064;\nn33495522228568064 -> n34058472181989376;\nn33495522228568064 -> n34339947158700032;\nn34339947158700032 -> n34058472181989376;\nn34058472181989376 -> n23925373020405760;\nn34058472181989376 -> n32651097298436096;\nn32651097298436096 -> n34621422135410688;\nn32651097298436096 -> n34902897112121344;\nn34902897112121344 -> n23925373020405760;\nn34902897112121344 -> n35184372088832000;\nn35184372088832000 -> n23925373020405760;\nn35184372088832000 -> n34621422135410688;\nn34621422135410688 -> n30117822508040192;\nn30117822508040192 -> n28991922601197568;\nn28991922601197568 -> n23925373020405760;\nn23925373020405760 -> n35465847065542656;\nn23925373020405760 -> n35747322042253312;\nn35747322042253312 -> n35465847065542656;\nn35465847065542656 -> n36028797018963968;\nn35465847065542656 -> n36310271995674624;\nn36310271995674624 -> n36591746972385280;\nn36310271995674624 -> n36873221949095936;\nn36873221949095936 -> n36591746972385280;\nn36591746972385280 -> n36028797018963968;\nn36591746972385280 -> n37154696925806592;\nn37154696925806592 -> n37436171902517248;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37717646879227904 -> n37436171902517248;\nn37436171902517248 -> n38280596832649216;\nn37436171902517248 -> n38562071809359872;\nn38562071809359872 -> n38843546786070528;\nn37999121855938560 -> n38843546786070528;\nn38843546786070528 -> n39125021762781184;\nn38843546786070528 -> n39406496739491840;\nn39406496739491840 -> n39125021762781184;\nn39125021762781184 -> n39687971716202496;\nn39125021762781184 -> n39969446692913152;\nn39969446692913152 -> n39687971716202496;\nn39687971716202496 -> n38280596832649216;\nn39687971716202496 -> n40250921669623808;\nn40250921669623808 -> n38280596832649216;\nn36028797018963968 -> n38280596832649216;\nn38280596832649216 -> n40532396646334464;\nn38280596832649216 -> n40813871623045120;\nn40813871623045120 -> n40532396646334464;\nn40532396646334464 -> n41095346599755776;\nn40532396646334464 -> n41376821576466432;\nn41376821576466432 -> n41658296553177088;\nn41376821576466432 -> n41939771529887744;\nn41939771529887744 -> n41658296553177088;\nn41658296553177088 -> n42221246506598400;\nn41658296553177088 -> n42502721483309056;\nn42502721483309056 -> n42221246506598400;\nn42221246506598400 -> n41095346599755776;\nn42221246506598400 -> n42784196460019712;\nn42784196460019712 -> n41095346599755776;\nn42784196460019712 -> n43065671436730368;\nn43065671436730368 -> n41095346599755776;\nn43065671436730368 -> n43347146413441024;\nn43347146413441024 -> n41095346599755776;\nn41095346599755776 -> n43628621390151680;\nn41095346599755776 -> n43910096366862336;\nn43910096366862336 -> n43628621390151680;\nn43628621390151680 -> n22236523160141824;\nn43628621390151680 -> n21955048183431168;\nn21955048183431168 -> n44191571343572992;\nn21955048183431168 -> n44473046320283648;\nn44473046320283648 -> n44191571343572992;\nn44191571343572992 -> n44754521296994304;\nn44191571343572992 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn45035996273704960 -> n45598946227126272;\nn45598946227126272 -> n45880421203836928;\nn45598946227126272 -> n46161896180547584;\nn46161896180547584 -> n44754521296994304;\nn46161896180547584 -> n46443371157258240;\nn45317471250415616 -> n46724846133968896;\nn45317471250415616 -> n47006321110679552;\nn47006321110679552 -> n45880421203836928;\nn47006321110679552 -> n47287796087390208;\nn47287796087390208 -> n45880421203836928;\nn47287796087390208 -> n47569271064100864;\nn47569271064100864 -> n45880421203836928;\nn47569271064100864 -> n47850746040811520;\nn47850746040811520 -> n44754521296994304;\nn46724846133968896 -> n48132221017522176;\nn46724846133968896 -> n48413695994232832;\nn48413695994232832 -> n45880421203836928;\nn48413695994232832 -> n48695170970943488;\nn48695170970943488 -> n45880421203836928;\nn48695170970943488 -> n48976645947654144;\nn48976645947654144 -> n45880421203836928;\nn48976645947654144 -> n49258120924364800;\nn49258120924364800 -> n45880421203836928;\nn49258120924364800 -> n49539595901075456;\nn49539595901075456 -> n44754521296994304;\nn48132221017522176 -> n45880421203836928;\nn48132221017522176 -> n49821070877786112;\nn49821070877786112 -> n45880421203836928;\nn49821070877786112 -> n50102545854496768;\nn50102545854496768 -> n44754521296994304;\nn50102545854496768 -> n45880421203836928;\nn45880421203836928 -> n50384020831207424;\nn45880421203836928 -> n50665495807918080;\nn50665495807918080 -> n44754521296994304;\nn50665495807918080 -> n50946970784628736;\nn50946970784628736 -> n44754521296994304;\nn50946970784628736 -> n50384020831207424;\nn50384020831207424 -> n44754521296994304;\nn44754521296994304 -> n51228445761339392;\nn44754521296994304 -> n51509920738050048;\nn51509920738050048 -> n51228445761339392;\nn51228445761339392 -> n51791395714760704;\nn51228445761339392 -> n52072870691471360;\nn52072870691471360 -> n52354345668182016;\nn52072870691471360 -> n51791395714760704;\nn51791395714760704 -> n52635820644892672;\nn51791395714760704 -> n52917295621603328;\nn52917295621603328 -> n52635820644892672;\nn52635820644892672 -> n52354345668182016;\nn52635820644892672 -> n53198770598313984;\nn53198770598313984 -> n53480245575024640;\nn53198770598313984 -> n53761720551735296;\nn53761720551735296 -> n54043195528445952;\nn53761720551735296 -> n53480245575024640;\nn53480245575024640 -> n54043195528445952;\nn53480245575024640 -> n54324670505156608;\nn54324670505156608 -> n54043195528445952;\nn54043195528445952 -> n54606145481867264;\nn54043195528445952 -> n54887620458577920;\nn54887620458577920 -> n54606145481867264;\nn54606145481867264 -> n55169095435288576;\nn54606145481867264 -> n55450570411999232;\nn55450570411999232 -> n55732045388709888;\nn55450570411999232 -> n56013520365420544;\nn56013520365420544 -> n55732045388709888;\nn55732045388709888 -> n55169095435288576;\nn55732045388709888 -> n56294995342131200;\nn56294995342131200 -> n56576470318841856;\nn56294995342131200 -> n56857945295552512;\nn56857945295552512 -> n57139420272263168;\nn56857945295552512 -> n56576470318841856;\nn56576470318841856 -> n55169095435288576;\nn56576470318841856 -> n57139420272263168;\nn57139420272263168 -> n57420895248973824;\nn57139420272263168 -> n57702370225684480;\nn57702370225684480 -> n57420895248973824;\nn57420895248973824 -> n57983845202395136;\nn57420895248973824 -> n58265320179105792;\nn58265320179105792 -> n57983845202395136;\nn57983845202395136 -> n55169095435288576;\nn57983845202395136 -> n58546795155816448;\nn58546795155816448 -> n55169095435288576;\nn55169095435288576 -> n58828270132527104;\nn55169095435288576 -> n59109745109237760;\nn59109745109237760 -> n59391220085948416;\nn59109745109237760 -> n59672695062659072;\nn59672695062659072 -> n59391220085948416;\nn59391220085948416 -> n58828270132527104;\nn59391220085948416 -> n59954170039369728;\nn59954170039369728 -> n60235645016080384;\nn59954170039369728 -> n60517119992791040;\nn60517119992791040 -> n60235645016080384;\nn60235645016080384 -> n60798594969501696;\nn60235645016080384 -> n61080069946212352;\nn61080069946212352 -> n60798594969501696;\nn60798594969501696 -> n58828270132527104;\nn60798594969501696 -> n61361544922923008;\nn61361544922923008 -> n58828270132527104;\nn61361544922923008 -> n61643019899633664;\nn61643019899633664 -> n58828270132527104;\nn58828270132527104 -> n61924494876344320;\nn58828270132527104 -> n62205969853054976;\nn62205969853054976 -> n61924494876344320;\nn61924494876344320 -> n53198770598313984;\nn61924494876344320 -> n52354345668182016;\nn52354345668182016 -> n2533274790395904;\nn2533274790395904 -> n62487444829765632;\nn2533274790395904 -> n62768919806476288;\nn62768919806476288 -> n62487444829765632;\nn62487444829765632 -> n63050394783186944;\nn62487444829765632 -> n63331869759897600;\nn63331869759897600 -> n1407374883553280;\nn1407374883553280 -> n844424930131968;\nn281474976710656 -> n0[style=dotted];\nn63050394783186944 -> n1688849860263936[style=dotted];\nn1970324836974592 -> n63050394783186944[style=dotted];\nn3096224743817216 -> n2814749767106560[style=dotted];\nn3659174697238528 -> n3096224743817216[style=dotted];\nn5910974510923776 -> n5066549580791808[style=dotted];\nn4222124650659840 -> n3659174697238528[style=dotted];\nn6192449487634432 -> n4222124650659840[style=dotted];\nn7318349394477056 -> n7036874417766400[style=dotted];\nn6755399441055744 -> n6192449487634432[style=dotted];\nn8162774324609024 -> n6755399441055744[style=dotted];\nn8725724278030336 -> n8162774324609024[style=dotted];\nn15199648742375424 -> n8725724278030336[style=dotted];\nn16044073672507392 -> n15762598695796736[style=dotted];\nn17169973579350016 -> n16888498602639360[style=dotted];\nn16607023625928704 -> n16044073672507392[style=dotted];\nn17732923532771328 -> n16607023625928704[style=dotted];\nn18295873486192640 -> n17732923532771328[style=dotted];\nn19421773393035264 -> n18295873486192640[style=dotted];\nn20266198323167232 -> n19421773393035264[style=dotted];\nn20829148276588544 -> n20266198323167232[style=dotted];\nn7881299347898368 -> n6192449487634432[style=dotted];\nn21392098230009856 -> n7881299347898368[style=dotted];\nn22236523160141824 -> n21392098230009856[style=dotted];\nn22517998136852480 -> n22236523160141824[style=dotted];\nn23080948090273792 -> n22236523160141824[style=dotted];\nn23362423066984448 -> n23080948090273792[style=dotted];\nn25051272927248384 -> n24769797950537728[style=dotted];\nn24488322973827072 -> n24206847997116416[style=dotted];\nn25614222880669696 -> n24488322973827072[style=dotted];\nn26177172834091008 -> n25614222880669696[style=dotted];\nn30680772461461504 -> n26177172834091008[style=dotted];\nn31806672368304128 -> n31525197391593472[style=dotted];\nn31243722414882816 -> n30680772461461504[style=dotted];\nn32651097298436096 -> n32369622321725440[style=dotted];\nn34621422135410688 -> n32651097298436096[style=dotted];\nn30117822508040192 -> n34621422135410688[style=dotted];\nn28991922601197568 -> n30117822508040192[style=dotted];\nn23925373020405760 -> n23362423066984448[style=dotted];\nn35465847065542656 -> n23925373020405760[style=dotted];\nn36591746972385280 -> n36310271995674624[style=dotted];\nn37436171902517248 -> n37154696925806592[style=dotted];\nn38843546786070528 -> n37154696925806592[style=dotted];\nn39125021762781184 -> n38843546786070528[style=dotted];\nn39687971716202496 -> n39125021762781184[style=dotted];\nn36028797018963968 -> n35465847065542656[style=dotted];\nn38280596832649216 -> n35465847065542656[style=dotted];\nn40532396646334464 -> n38280596832649216[style=dotted];\nn41658296553177088 -> n41376821576466432[style=dotted];\nn42221246506598400 -> n41658296553177088[style=dotted];\nn41095346599755776 -> n40532396646334464[style=dotted];\nn43628621390151680 -> n41095346599755776[style=dotted];\nn21955048183431168 -> n21392098230009856[style=dotted];\nn44191571343572992 -> n21955048183431168[style=dotted];\nn45880421203836928 -> n45035996273704960[style=dotted];\nn50384020831207424 -> n45880421203836928[style=dotted];\nn44754521296994304 -> n44191571343572992[style=dotted];\nn51228445761339392 -> n44754521296994304[style=dotted];\nn51791395714760704 -> n51228445761339392[style=dotted];\nn52635820644892672 -> n51791395714760704[style=dotted];\nn53198770598313984 -> n52635820644892672[style=dotted];\nn53480245575024640 -> n53198770598313984[style=dotted];\nn54043195528445952 -> n53198770598313984[style=dotted];\nn54606145481867264 -> n54043195528445952[style=dotted];\nn55732045388709888 -> n55450570411999232[style=dotted];\nn56576470318841856 -> n56294995342131200[style=dotted];\nn57139420272263168 -> n56294995342131200[style=dotted];\nn57420895248973824 -> n57139420272263168[style=dotted];\nn57983845202395136 -> n57420895248973824[style=dotted];\nn55169095435288576 -> n54606145481867264[style=dotted];\nn59391220085948416 -> n59109745109237760[style=dotted];\nn60235645016080384 -> n59954170039369728[style=dotted];\nn60798594969501696 -> n60235645016080384[style=dotted];\nn58828270132527104 -> n55169095435288576[style=dotted];\nn61924494876344320 -> n58828270132527104[style=dotted];\nn52354345668182016 -> n51228445761339392[style=dotted];\nn2533274790395904 -> n1970324836974592[style=dotted];\nn62487444829765632 -> n2533274790395904[style=dotted];\nn1407374883553280 -> n1125899906842624[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-259.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn1407374883553280[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn2814749767106560[shape=rectangle, label=\"B8\"];\nn2533274790395904[shape=rectangle, label=\"B9\"];\nn1970324836974592[shape=rectangle, label=\"B10\"];\nn3096224743817216[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn3377699720527872[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn31806672368304128[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn4503599627370496[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn31525197391593472[shape=rectangle, label=\"B19\"];\nn5910974510923776[shape=rectangle, label=\"B20\"];\nn5629499534213120[shape=rectangle, label=\"B21\"];\nn6473924464345088[shape=rectangle, label=\"B22\"];\nn7036874417766400[shape=rectangle, label=\"B23\"];\nn6755399441055744[shape=rectangle, label=\"B24\"];\nn7599824371187712[shape=rectangle, label=\"B25\"];\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn8444249301319680[shape=rectangle, label=\"B27\"];\nn8162774324609024[shape=rectangle, label=\"B28\"];\nn9007199254740992[shape=rectangle, label=\"B29\"];\nn8725724278030336[shape=rectangle, label=\"B30\"];\nn9570149208162304[shape=rectangle, label=\"B31\"];\nn10133099161583616[shape=rectangle, label=\"B32\"];\nn9851624184872960[shape=rectangle, label=\"B33\"];\nn9288674231451648[shape=rectangle, label=\"B34\"];\nn10414574138294272[shape=rectangle, label=\"B35\"];\nn10696049115004928[shape=rectangle, label=\"B36\"];\nn11258999068426240[shape=rectangle, label=\"B37\"];\nn10977524091715584[shape=rectangle, label=\"B38\"];\nn11540474045136896[shape=rectangle, label=\"B39\"];\nn11821949021847552[shape=rectangle, label=\"B40\"];\nn12103423998558208[shape=rectangle, label=\"B41\"];\nn12384898975268864[shape=rectangle, label=\"B42\"];\nn12666373951979520[shape=rectangle, label=\"B43\"];\nn12947848928690176[shape=rectangle, label=\"B44\"];\nn7318349394477056[shape=rectangle, label=\"B45\"];\nn13510798882111488[shape=rectangle, label=\"B46\"];\nn13229323905400832[shape=rectangle, label=\"B47\"];\nn14073748835532800[shape=rectangle, label=\"B48\"];\nn14636698788954112[shape=rectangle, label=\"B49\"];\nn14355223812243456[shape=rectangle, label=\"B50\"];\nn15199648742375424[shape=rectangle, label=\"B51\"];\nn15762598695796736[shape=rectangle, label=\"B52\"];\nn15481123719086080[shape=rectangle, label=\"B53\"];\nn16325548649218048[shape=rectangle, label=\"B54\"];\nn16044073672507392[shape=rectangle, label=\"B55\"];\nn16888498602639360[shape=rectangle, label=\"B56\"];\nn16607023625928704[shape=rectangle, label=\"B57\"];\nn17451448556060672[shape=rectangle, label=\"B58\"];\nn17169973579350016[shape=rectangle, label=\"B59\"];\nn18014398509481984[shape=rectangle, label=\"B60\"];\nn17732923532771328[shape=rectangle, label=\"B61\"];\nn18577348462903296[shape=rectangle, label=\"B62\"];\nn18295873486192640[shape=rectangle, label=\"B63\"];\nn14918173765664768[shape=rectangle, label=\"B64\"];\nn19421773393035264[shape=rectangle, label=\"B65\"];\nn19140298416324608[shape=rectangle, label=\"B66\"];\nn19703248369745920[shape=rectangle, label=\"B67\"];\nn19984723346456576[shape=rectangle, label=\"B68\"];\nn20547673299877888[shape=rectangle, label=\"B69\"];\nn20266198323167232[shape=rectangle, label=\"B70\"];\nn21110623253299200[shape=rectangle, label=\"B71\"];\nn20829148276588544[shape=rectangle, label=\"B72\"];\nn18858823439613952[shape=rectangle, label=\"B73\"];\nn21673573206720512[shape=rectangle, label=\"B74\"];\nn21392098230009856[shape=rectangle, label=\"B75\"];\nn13792273858822144[shape=rectangle, label=\"B76\"];\nn22236523160141824[shape=rectangle, label=\"B77\"];\nn21955048183431168[shape=rectangle, label=\"B78\"];\nn22799473113563136[shape=rectangle, label=\"B79\"];\nn30680772461461504[shape=rectangle, label=\"B80\"];\nn23362423066984448[shape=rectangle, label=\"B81\"];\nn23080948090273792[shape=rectangle, label=\"B82\"];\nn23925373020405760[shape=rectangle, label=\"B83\"];\nn24488322973827072[shape=rectangle, label=\"B84\"];\nn24206847997116416[shape=rectangle, label=\"B85\"];\nn25051272927248384[shape=rectangle, label=\"B86\"];\nn24769797950537728[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn25332747903959040[shape=rectangle, label=\"B89\"];\nn26177172834091008[shape=rectangle, label=\"B90\"];\nn25895697857380352[shape=rectangle, label=\"B91\"];\nn26740122787512320[shape=rectangle, label=\"B92\"];\nn26458647810801664[shape=rectangle, label=\"B93\"];\nn27303072740933632[shape=rectangle, label=\"B94\"];\nn27021597764222976[shape=rectangle, label=\"B95\"];\nn23643898043695104[shape=rectangle, label=\"B96\"];\nn28147497671065600[shape=rectangle, label=\"B97\"];\nn27866022694354944[shape=rectangle, label=\"B98\"];\nn28428972647776256[shape=rectangle, label=\"B99\"];\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn29273397577908224[shape=rectangle, label=\"B101\"];\nn28991922601197568[shape=rectangle, label=\"B102\"];\nn29836347531329536[shape=rectangle, label=\"B103\"];\nn29554872554618880[shape=rectangle, label=\"B104\"];\nn27584547717644288[shape=rectangle, label=\"B105\"];\nn30399297484750848[shape=rectangle, label=\"B106\"];\nn30117822508040192[shape=rectangle, label=\"B107\"];\nn22517998136852480[shape=rectangle, label=\"B108\"];\nn6192449487634432[shape=rectangle, label=\"B109\"];\nn31243722414882816[shape=rectangle, label=\"B110\"];\nn30962247438172160[shape=rectangle, label=\"B111\"];\nn5066549580791808[shape=rectangle, label=\"B112\"];\nn32088147345014784[shape=rectangle, label=\"B113\"];\nn3940649673949184[shape=rectangle, label=\"B114\"];\nn32651097298436096[shape=rectangle, label=\"B115\"];\nn32369622321725440[shape=rectangle, label=\"B116\"];\nn33214047251857408[shape=rectangle, label=\"B117\"];\nn32932572275146752[shape=rectangle, label=\"B118\"];\nn33776997205278720[shape=rectangle, label=\"B119\"];\nn33495522228568064[shape=rectangle, label=\"B120\"];\nn34339947158700032[shape=rectangle, label=\"B121\"];\nn34058472181989376[shape=rectangle, label=\"B122\"];\nn34902897112121344[shape=rectangle, label=\"B123\"];\nn76279718688587776[shape=rectangle, label=\"B124\"];\nn35465847065542656[shape=rectangle, label=\"B125\"];\nn36310271995674624[shape=rectangle, label=\"B126\"];\nn36028797018963968[shape=rectangle, label=\"B127\"];\nn35184372088832000[shape=rectangle, label=\"B128\"];\nn70368744177664000[shape=rectangle, label=\"B129\"];\nn36873221949095936[shape=rectangle, label=\"B130\"];\nn37154696925806592[shape=rectangle, label=\"B131\"];\nn37717646879227904[shape=rectangle, label=\"B132\"];\nn37436171902517248[shape=rectangle, label=\"B133\"];\nn37999121855938560[shape=rectangle, label=\"B134\"];\nn38562071809359872[shape=rectangle, label=\"B135\"];\nn38280596832649216[shape=rectangle, label=\"B136\"];\nn39125021762781184[shape=rectangle, label=\"B137\"];\nn38843546786070528[shape=rectangle, label=\"B138\"];\nn39406496739491840[shape=rectangle, label=\"B139\"];\nn39969446692913152[shape=rectangle, label=\"B140\"];\nn39687971716202496[shape=rectangle, label=\"B141\"];\nn40250921669623808[shape=rectangle, label=\"B142\"];\nn40813871623045120[shape=rectangle, label=\"B143\"];\nn40532396646334464[shape=rectangle, label=\"B144\"];\nn41376821576466432[shape=rectangle, label=\"B145\"];\nn41095346599755776[shape=rectangle, label=\"B146\"];\nn41658296553177088[shape=rectangle, label=\"B147\"];\nn42221246506598400[shape=rectangle, label=\"B148\"];\nn47006321110679552[shape=rectangle, label=\"B149\"];\nn42784196460019712[shape=rectangle, label=\"B150\"];\nn42502721483309056[shape=rectangle, label=\"B151\"];\nn43065671436730368[shape=rectangle, label=\"B152\"];\nn43628621390151680[shape=rectangle, label=\"B153\"];\nn43347146413441024[shape=rectangle, label=\"B154\"];\nn44191571343572992[shape=rectangle, label=\"B155\"];\nn43910096366862336[shape=rectangle, label=\"B156\"];\nn44473046320283648[shape=rectangle, label=\"B157\"];\nn45035996273704960[shape=rectangle, label=\"B158\"];\nn44754521296994304[shape=rectangle, label=\"B159\"];\nn45317471250415616[shape=rectangle, label=\"B160\"];\nn45880421203836928[shape=rectangle, label=\"B161\"];\nn45598946227126272[shape=rectangle, label=\"B162\"];\nn46443371157258240[shape=rectangle, label=\"B163\"];\nn46161896180547584[shape=rectangle, label=\"B164\"];\nn46724846133968896[shape=rectangle, label=\"B165\"];\nn41939771529887744[shape=rectangle, label=\"B166\"];\nn47287796087390208[shape=rectangle, label=\"B167\"];\nn47569271064100864[shape=rectangle, label=\"B168\"];\nn36591746972385280[shape=rectangle, label=\"B169\"];\nn48132221017522176[shape=rectangle, label=\"B170\"];\nn48413695994232832[shape=rectangle, label=\"B171\"];\nn48695170970943488[shape=rectangle, label=\"B172\"];\nn48976645947654144[shape=rectangle, label=\"B173\"];\nn47850746040811520[shape=rectangle, label=\"B174\"];\nn49539595901075456[shape=rectangle, label=\"B175\"];\nn49258120924364800[shape=rectangle, label=\"B176\"];\nn49821070877786112[shape=rectangle, label=\"B177\"];\nn50384020831207424[shape=rectangle, label=\"B178\"];\nn50102545854496768[shape=rectangle, label=\"B179\"];\nn50946970784628736[shape=rectangle, label=\"B180\"];\nn50665495807918080[shape=rectangle, label=\"B181\"];\nn51228445761339392[shape=rectangle, label=\"B182\"];\nn51791395714760704[shape=rectangle, label=\"B183\"];\nn51509920738050048[shape=rectangle, label=\"B184\"];\nn52072870691471360[shape=rectangle, label=\"B185\"];\nn52635820644892672[shape=rectangle, label=\"B186\"];\nn52354345668182016[shape=rectangle, label=\"B187\"];\nn53198770598313984[shape=rectangle, label=\"B188\"];\nn52917295621603328[shape=rectangle, label=\"B189\"];\nn53480245575024640[shape=rectangle, label=\"B190\"];\nn54043195528445952[shape=rectangle, label=\"B191\"];\nn55450570411999232[shape=rectangle, label=\"B192\"];\nn54606145481867264[shape=rectangle, label=\"B193\"];\nn54324670505156608[shape=rectangle, label=\"B194\"];\nn55169095435288576[shape=rectangle, label=\"B195\"];\nn54887620458577920[shape=rectangle, label=\"B196\"];\nn53761720551735296[shape=rectangle, label=\"B197\"];\nn56013520365420544[shape=rectangle, label=\"B198\"];\nn72620543991349248[shape=rectangle, label=\"B199\"];\nn56576470318841856[shape=rectangle, label=\"B200\"];\nn56294995342131200[shape=rectangle, label=\"B201\"];\nn57139420272263168[shape=rectangle, label=\"B202\"];\nn56857945295552512[shape=rectangle, label=\"B203\"];\nn57702370225684480[shape=rectangle, label=\"B204\"];\nn58265320179105792[shape=rectangle, label=\"B205\"];\nn57983845202395136[shape=rectangle, label=\"B206\"];\nn58546795155816448[shape=rectangle, label=\"B207\"];\nn58828270132527104[shape=rectangle, label=\"B208\"];\nn59391220085948416[shape=rectangle, label=\"B209\"];\nn59109745109237760[shape=rectangle, label=\"B210\"];\nn59954170039369728[shape=rectangle, label=\"B211\"];\nn59672695062659072[shape=rectangle, label=\"B212\"];\nn60517119992791040[shape=rectangle, label=\"B213\"];\nn60798594969501696[shape=rectangle, label=\"B214\"];\nn61080069946212352[shape=rectangle, label=\"B215\"];\nn61361544922923008[shape=rectangle, label=\"B216\"];\nn60235645016080384[shape=rectangle, label=\"B217\"];\nn61924494876344320[shape=rectangle, label=\"B218\"];\nn35747322042253312[shape=rectangle, label=\"B219\"];\nn63613344736608256[shape=rectangle, label=\"B220\"];\nn62768919806476288[shape=rectangle, label=\"B221\"];\nn63331869759897600[shape=rectangle, label=\"B222\"];\nn63050394783186944[shape=rectangle, label=\"B223\"];\nn62487444829765632[shape=rectangle, label=\"B224\"];\nn63894819713318912[shape=rectangle, label=\"B225\"];\nn64457769666740224[shape=rectangle, label=\"B226\"];\nn64176294690029568[shape=rectangle, label=\"B227\"];\nn65020719620161536[shape=rectangle, label=\"B228\"];\nn65583669573582848[shape=rectangle, label=\"B229\"];\nn65302194596872192[shape=rectangle, label=\"B230\"];\nn66146619527004160[shape=rectangle, label=\"B231\"];\nn66991044457136128[shape=rectangle, label=\"B232\"];\nn66709569480425472[shape=rectangle, label=\"B233\"];\nn67272519433846784[shape=rectangle, label=\"B234\"];\nn66428094503714816[shape=rectangle, label=\"B235\"];\nn68679894317400064[shape=rectangle, label=\"B236\"];\nn67835469387268096[shape=rectangle, label=\"B237\"];\nn68398419340689408[shape=rectangle, label=\"B238\"];\nn68116944363978752[shape=rectangle, label=\"B239\"];\nn67553994410557440[shape=rectangle, label=\"B240\"];\nn68961369294110720[shape=rectangle, label=\"B241\"];\nn69242844270821376[shape=rectangle, label=\"B242\"];\nn65865144550293504[shape=rectangle, label=\"B243\"];\nn64739244643450880[shape=rectangle, label=\"B244\"];\nn69805794224242688[shape=rectangle, label=\"B245\"];\nn70087269200953344[shape=rectangle, label=\"B246\"];\nn69524319247532032[shape=rectangle, label=\"B247\"];\nn61643019899633664[shape=rectangle, label=\"B248\"];\nn70931694131085312[shape=rectangle, label=\"B249\"];\nn70650219154374656[shape=rectangle, label=\"B250\"];\nn71494644084506624[shape=rectangle, label=\"B251\"];\nn71213169107795968[shape=rectangle, label=\"B252\"];\nn72057594037927936[shape=rectangle, label=\"B253\"];\nn71776119061217280[shape=rectangle, label=\"B254\"];\nn62205969853054976[shape=rectangle, label=\"B255\"];\nn72339069014638592[shape=rectangle, label=\"B256\"];\nn57420895248973824[shape=rectangle, label=\"B257\"];\nn72902018968059904[shape=rectangle, label=\"B258\"];\nn55732045388709888[shape=rectangle, label=\"B259\"];\nn73464968921481216[shape=rectangle, label=\"B260\"];\nn73183493944770560[shape=rectangle, label=\"B261\"];\nn74027918874902528[shape=rectangle, label=\"B262\"];\nn73746443898191872[shape=rectangle, label=\"B263\"];\nn74590868828323840[shape=rectangle, label=\"B264\"];\nn74309393851613184[shape=rectangle, label=\"B265\"];\nn74872343805034496[shape=rectangle, label=\"B266\"];\nn75435293758455808[shape=rectangle, label=\"B267\"];\nn75998243711877120[shape=rectangle, label=\"B268\"];\nn75153818781745152[shape=rectangle, label=\"B269\"];\nn75716768735166464[shape=rectangle, label=\"B270\"];\nn76561193665298432[shape=rectangle, label=\"B271\"];\nn34621422135410688[shape=rectangle, label=\"B272\"];\nn76842668642009088[shape=rectangle, label=\"B273\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n844424930131968;\nn844424930131968 -> n1407374883553280;\nn844424930131968 -> n1688849860263936;\nn1688849860263936 -> n1407374883553280;\nn1407374883553280 -> n1970324836974592;\nn1407374883553280 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n2814749767106560;\nn2814749767106560 -> n2533274790395904;\nn2533274790395904 -> n3096224743817216;\nn1970324836974592 -> n3096224743817216;\nn3096224743817216 -> n3377699720527872;\nn3096224743817216 -> n3659174697238528;\nn3659174697238528 -> n3377699720527872;\nn3377699720527872 -> n3940649673949184;\nn3377699720527872 -> n4222124650659840;\nn4222124650659840 -> n31806672368304128;\nn31806672368304128 -> n4503599627370496;\nn31806672368304128 -> n4785074604081152;\nn4785074604081152 -> n4503599627370496;\nn4503599627370496 -> n5066549580791808;\nn4503599627370496 -> n5348024557502464;\nn5348024557502464 -> n31525197391593472;\nn31525197391593472 -> n5629499534213120;\nn31525197391593472 -> n5910974510923776;\nn5910974510923776 -> n5629499534213120;\nn5629499534213120 -> n6192449487634432;\nn5629499534213120 -> n6473924464345088;\nn6473924464345088 -> n6755399441055744;\nn6473924464345088 -> n7036874417766400;\nn7036874417766400 -> n6755399441055744;\nn6755399441055744 -> n7318349394477056;\nn6755399441055744 -> n7599824371187712;\nn7599824371187712 -> n7318349394477056;\nn7599824371187712 -> n7881299347898368;\nn7881299347898368 -> n8162774324609024;\nn7881299347898368 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n8725724278030336;\nn8162774324609024 -> n9007199254740992;\nn9007199254740992 -> n8725724278030336;\nn8725724278030336 -> n9288674231451648;\nn8725724278030336 -> n9570149208162304;\nn9570149208162304 -> n9851624184872960;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n9851624184872960;\nn9851624184872960 -> n10414574138294272;\nn9851624184872960 -> n9288674231451648;\nn9288674231451648 -> n10414574138294272;\nn10414574138294272 -> n7318349394477056;\nn10414574138294272 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n10977524091715584;\nn10977524091715584 -> n7318349394477056;\nn10977524091715584 -> n11540474045136896;\nn11540474045136896 -> n7318349394477056;\nn11540474045136896 -> n11821949021847552;\nn11821949021847552 -> n7318349394477056;\nn11821949021847552 -> n12103423998558208;\nn12103423998558208 -> n7318349394477056;\nn12103423998558208 -> n12384898975268864;\nn12384898975268864 -> n7318349394477056;\nn12384898975268864 -> n12666373951979520;\nn12666373951979520 -> n7318349394477056;\nn12666373951979520 -> n12947848928690176;\nn12947848928690176 -> n7318349394477056;\nn7318349394477056 -> n13229323905400832;\nn7318349394477056 -> n13510798882111488;\nn13510798882111488 -> n13229323905400832;\nn13229323905400832 -> n13792273858822144;\nn13229323905400832 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n14355223812243456;\nn14355223812243456 -> n14918173765664768;\nn14355223812243456 -> n15199648742375424;\nn15199648742375424 -> n15481123719086080;\nn15199648742375424 -> n15762598695796736;\nn15762598695796736 -> n15481123719086080;\nn15481123719086080 -> n16044073672507392;\nn15481123719086080 -> n16325548649218048;\nn16325548649218048 -> n16044073672507392;\nn16044073672507392 -> n16607023625928704;\nn16044073672507392 -> n16888498602639360;\nn16888498602639360 -> n16607023625928704;\nn16607023625928704 -> n17169973579350016;\nn16607023625928704 -> n17451448556060672;\nn17451448556060672 -> n17169973579350016;\nn17169973579350016 -> n17732923532771328;\nn17169973579350016 -> n18014398509481984;\nn18014398509481984 -> n17732923532771328;\nn17732923532771328 -> n18295873486192640;\nn17732923532771328 -> n18577348462903296;\nn18577348462903296 -> n18295873486192640;\nn18295873486192640 -> n18858823439613952;\nn14918173765664768 -> n19140298416324608;\nn14918173765664768 -> n19421773393035264;\nn19421773393035264 -> n19140298416324608;\nn19140298416324608 -> n18858823439613952;\nn19140298416324608 -> n19703248369745920;\nn19703248369745920 -> n18858823439613952;\nn19703248369745920 -> n19984723346456576;\nn19984723346456576 -> n20266198323167232;\nn19984723346456576 -> n20547673299877888;\nn20547673299877888 -> n20266198323167232;\nn20266198323167232 -> n20829148276588544;\nn20266198323167232 -> n21110623253299200;\nn21110623253299200 -> n20829148276588544;\nn20829148276588544 -> n18858823439613952;\nn18858823439613952 -> n21392098230009856;\nn18858823439613952 -> n21673573206720512;\nn21673573206720512 -> n21392098230009856;\nn21392098230009856 -> n14073748835532800;\nn21392098230009856 -> n13792273858822144;\nn13792273858822144 -> n21955048183431168;\nn13792273858822144 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn21955048183431168 -> n22517998136852480;\nn21955048183431168 -> n22799473113563136;\nn22799473113563136 -> n30680772461461504;\nn30680772461461504 -> n23080948090273792;\nn30680772461461504 -> n23362423066984448;\nn23362423066984448 -> n23080948090273792;\nn23080948090273792 -> n23643898043695104;\nn23080948090273792 -> n23925373020405760;\nn23925373020405760 -> n24206847997116416;\nn23925373020405760 -> n24488322973827072;\nn24488322973827072 -> n24206847997116416;\nn24206847997116416 -> n24769797950537728;\nn24206847997116416 -> n25051272927248384;\nn25051272927248384 -> n24769797950537728;\nn24769797950537728 -> n25332747903959040;\nn24769797950537728 -> n25614222880669696;\nn25614222880669696 -> n25332747903959040;\nn25332747903959040 -> n25895697857380352;\nn25332747903959040 -> n26177172834091008;\nn26177172834091008 -> n25895697857380352;\nn25895697857380352 -> n26458647810801664;\nn25895697857380352 -> n26740122787512320;\nn26740122787512320 -> n26458647810801664;\nn26458647810801664 -> n27021597764222976;\nn26458647810801664 -> n27303072740933632;\nn27303072740933632 -> n27021597764222976;\nn27021597764222976 -> n27584547717644288;\nn23643898043695104 -> n27866022694354944;\nn23643898043695104 -> n28147497671065600;\nn28147497671065600 -> n27866022694354944;\nn27866022694354944 -> n27584547717644288;\nn27866022694354944 -> n28428972647776256;\nn28428972647776256 -> n27584547717644288;\nn28428972647776256 -> n28710447624486912;\nn28710447624486912 -> n28991922601197568;\nn28710447624486912 -> n29273397577908224;\nn29273397577908224 -> n28991922601197568;\nn28991922601197568 -> n29554872554618880;\nn28991922601197568 -> n29836347531329536;\nn29836347531329536 -> n29554872554618880;\nn29554872554618880 -> n27584547717644288;\nn27584547717644288 -> n30117822508040192;\nn27584547717644288 -> n30399297484750848;\nn30399297484750848 -> n30117822508040192;\nn30117822508040192 -> n30680772461461504;\nn30117822508040192 -> n22517998136852480;\nn22517998136852480 -> n6192449487634432;\nn6192449487634432 -> n30962247438172160;\nn6192449487634432 -> n31243722414882816;\nn31243722414882816 -> n30962247438172160;\nn30962247438172160 -> n31525197391593472;\nn30962247438172160 -> n5066549580791808;\nn5066549580791808 -> n31806672368304128;\nn5066549580791808 -> n32088147345014784;\nn32088147345014784 -> n3940649673949184;\nn3940649673949184 -> n32369622321725440;\nn3940649673949184 -> n32651097298436096;\nn32651097298436096 -> n32369622321725440;\nn32369622321725440 -> n32932572275146752;\nn32369622321725440 -> n33214047251857408;\nn33214047251857408 -> n32932572275146752;\nn32932572275146752 -> n33495522228568064;\nn32932572275146752 -> n33776997205278720;\nn33776997205278720 -> n33495522228568064;\nn33495522228568064 -> n34058472181989376;\nn33495522228568064 -> n34339947158700032;\nn34339947158700032 -> n34058472181989376;\nn34058472181989376 -> n34621422135410688;\nn34058472181989376 -> n34902897112121344;\nn34902897112121344 -> n76279718688587776;\nn76279718688587776 -> n35184372088832000;\nn76279718688587776 -> n35465847065542656;\nn35465847065542656 -> n36310271995674624;\nn36310271995674624 -> n35747322042253312;\nn36310271995674624 -> n36028797018963968;\nn36028797018963968 -> n36310271995674624;\nn36028797018963968 -> n35184372088832000;\nn35184372088832000 -> n70368744177664000;\nn70368744177664000 -> n36591746972385280;\nn70368744177664000 -> n36873221949095936;\nn36873221949095936 -> n36591746972385280;\nn36873221949095936 -> n37154696925806592;\nn37154696925806592 -> n37436171902517248;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37717646879227904 -> n37436171902517248;\nn37436171902517248 -> n37999121855938560;\nn37999121855938560 -> n38280596832649216;\nn37999121855938560 -> n38562071809359872;\nn38562071809359872 -> n38280596832649216;\nn38280596832649216 -> n38843546786070528;\nn38280596832649216 -> n39125021762781184;\nn39125021762781184 -> n39406496739491840;\nn39125021762781184 -> n38843546786070528;\nn38843546786070528 -> n39406496739491840;\nn39406496739491840 -> n39687971716202496;\nn39406496739491840 -> n39969446692913152;\nn39969446692913152 -> n40250921669623808;\nn39969446692913152 -> n39687971716202496;\nn39687971716202496 -> n40250921669623808;\nn40250921669623808 -> n40532396646334464;\nn40250921669623808 -> n40813871623045120;\nn40813871623045120 -> n40532396646334464;\nn40532396646334464 -> n41095346599755776;\nn40532396646334464 -> n41376821576466432;\nn41376821576466432 -> n41658296553177088;\nn41376821576466432 -> n41095346599755776;\nn41095346599755776 -> n41658296553177088;\nn41658296553177088 -> n41939771529887744;\nn41658296553177088 -> n42221246506598400;\nn42221246506598400 -> n47006321110679552;\nn47006321110679552 -> n42502721483309056;\nn47006321110679552 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn42784196460019712 -> n42502721483309056;\nn42502721483309056 -> n43065671436730368;\nn43065671436730368 -> n43347146413441024;\nn43065671436730368 -> n43628621390151680;\nn43628621390151680 -> n43347146413441024;\nn43347146413441024 -> n43910096366862336;\nn43347146413441024 -> n44191571343572992;\nn44191571343572992 -> n44473046320283648;\nn44191571343572992 -> n43910096366862336;\nn43910096366862336 -> n44473046320283648;\nn44473046320283648 -> n44754521296994304;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn45035996273704960 -> n44754521296994304;\nn44754521296994304 -> n45317471250415616;\nn45317471250415616 -> n45598946227126272;\nn45317471250415616 -> n45880421203836928;\nn45880421203836928 -> n45598946227126272;\nn45598946227126272 -> n46161896180547584;\nn45598946227126272 -> n46443371157258240;\nn46443371157258240 -> n46724846133968896;\nn46443371157258240 -> n46161896180547584;\nn46161896180547584 -> n46724846133968896;\nn46724846133968896 -> n47006321110679552;\nn46724846133968896 -> n41939771529887744;\nn41939771529887744 -> n36591746972385280;\nn41939771529887744 -> n47287796087390208;\nn47287796087390208 -> n36591746972385280;\nn47287796087390208 -> n47569271064100864;\nn47569271064100864 -> n36591746972385280;\nn36591746972385280 -> n47850746040811520;\nn36591746972385280 -> n48132221017522176;\nn48132221017522176 -> n47850746040811520;\nn48132221017522176 -> n48413695994232832;\nn48413695994232832 -> n47850746040811520;\nn48413695994232832 -> n48695170970943488;\nn48695170970943488 -> n47850746040811520;\nn48695170970943488 -> n48976645947654144;\nn48976645947654144 -> n47850746040811520;\nn47850746040811520 -> n49258120924364800;\nn47850746040811520 -> n49539595901075456;\nn49539595901075456 -> n49821070877786112;\nn49539595901075456 -> n49258120924364800;\nn49258120924364800 -> n49821070877786112;\nn49821070877786112 -> n50102545854496768;\nn49821070877786112 -> n50384020831207424;\nn50384020831207424 -> n50102545854496768;\nn50102545854496768 -> n50665495807918080;\nn50102545854496768 -> n50946970784628736;\nn50946970784628736 -> n51228445761339392;\nn50946970784628736 -> n50665495807918080;\nn50665495807918080 -> n51228445761339392;\nn51228445761339392 -> n51509920738050048;\nn51228445761339392 -> n51791395714760704;\nn51791395714760704 -> n52072870691471360;\nn51791395714760704 -> n51509920738050048;\nn51509920738050048 -> n52072870691471360;\nn52072870691471360 -> n52354345668182016;\nn52072870691471360 -> n52635820644892672;\nn52635820644892672 -> n52354345668182016;\nn52354345668182016 -> n52917295621603328;\nn52354345668182016 -> n53198770598313984;\nn53198770598313984 -> n53480245575024640;\nn53198770598313984 -> n52917295621603328;\nn52917295621603328 -> n53480245575024640;\nn53480245575024640 -> n53761720551735296;\nn53480245575024640 -> n54043195528445952;\nn54043195528445952 -> n55450570411999232;\nn55450570411999232 -> n54324670505156608;\nn55450570411999232 -> n54606145481867264;\nn54606145481867264 -> n54324670505156608;\nn54324670505156608 -> n54887620458577920;\nn54324670505156608 -> n55169095435288576;\nn55169095435288576 -> n54887620458577920;\nn54887620458577920 -> n55450570411999232;\nn54887620458577920 -> n53761720551735296;\nn53761720551735296 -> n55732045388709888;\nn53761720551735296 -> n56013520365420544;\nn56013520365420544 -> n72620543991349248;\nn72620543991349248 -> n56294995342131200;\nn72620543991349248 -> n56576470318841856;\nn56576470318841856 -> n56294995342131200;\nn56294995342131200 -> n56857945295552512;\nn56294995342131200 -> n57139420272263168;\nn57139420272263168 -> n56857945295552512;\nn56857945295552512 -> n57420895248973824;\nn56857945295552512 -> n57702370225684480;\nn57702370225684480 -> n57983845202395136;\nn57702370225684480 -> n58265320179105792;\nn58265320179105792 -> n57983845202395136;\nn57983845202395136 -> n57420895248973824;\nn57983845202395136 -> n58546795155816448;\nn58546795155816448 -> n57420895248973824;\nn58546795155816448 -> n58828270132527104;\nn58828270132527104 -> n59109745109237760;\nn58828270132527104 -> n59391220085948416;\nn59391220085948416 -> n59109745109237760;\nn59109745109237760 -> n59672695062659072;\nn59109745109237760 -> n59954170039369728;\nn59954170039369728 -> n59672695062659072;\nn59672695062659072 -> n60235645016080384;\nn59672695062659072 -> n60517119992791040;\nn60517119992791040 -> n60235645016080384;\nn60517119992791040 -> n60798594969501696;\nn60798594969501696 -> n60235645016080384;\nn60798594969501696 -> n61080069946212352;\nn61080069946212352 -> n60235645016080384;\nn61080069946212352 -> n61361544922923008;\nn61361544922923008 -> n60235645016080384;\nn60235645016080384 -> n61643019899633664;\nn60235645016080384 -> n61924494876344320;\nn61924494876344320 -> n62205969853054976;\nn35747322042253312 -> n63613344736608256;\nn63613344736608256 -> n62487444829765632;\nn63613344736608256 -> n62768919806476288;\nn62768919806476288 -> n63050394783186944;\nn62768919806476288 -> n63331869759897600;\nn63331869759897600 -> n62487444829765632;\nn63331869759897600 -> n63050394783186944;\nn63050394783186944 -> n62487444829765632;\nn62487444829765632 -> n63613344736608256;\nn62487444829765632 -> n63894819713318912;\nn63894819713318912 -> n64176294690029568;\nn63894819713318912 -> n64457769666740224;\nn64457769666740224 -> n64176294690029568;\nn64176294690029568 -> n64739244643450880;\nn64176294690029568 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn65020719620161536 -> n65583669573582848;\nn65583669573582848 -> n65302194596872192;\nn65302194596872192 -> n65865144550293504;\nn65302194596872192 -> n66146619527004160;\nn66146619527004160 -> n66991044457136128;\nn66991044457136128 -> n66428094503714816;\nn66991044457136128 -> n66709569480425472;\nn66709569480425472 -> n66991044457136128;\nn66709569480425472 -> n67272519433846784;\nn67272519433846784 -> n65865144550293504;\nn66428094503714816 -> n68679894317400064;\nn68679894317400064 -> n67553994410557440;\nn68679894317400064 -> n67835469387268096;\nn67835469387268096 -> n68116944363978752;\nn67835469387268096 -> n68398419340689408;\nn68398419340689408 -> n67553994410557440;\nn68398419340689408 -> n68116944363978752;\nn68116944363978752 -> n67553994410557440;\nn67553994410557440 -> n68679894317400064;\nn67553994410557440 -> n68961369294110720;\nn68961369294110720 -> n65865144550293504;\nn68961369294110720 -> n69242844270821376;\nn69242844270821376 -> n65865144550293504;\nn65865144550293504 -> n65020719620161536;\nn65865144550293504 -> n64739244643450880;\nn64739244643450880 -> n69524319247532032;\nn64739244643450880 -> n69805794224242688;\nn69805794224242688 -> n69524319247532032;\nn69805794224242688 -> n70087269200953344;\nn70087269200953344 -> n69524319247532032;\nn69524319247532032 -> n70368744177664000;\nn61643019899633664 -> n70650219154374656;\nn61643019899633664 -> n70931694131085312;\nn70931694131085312 -> n61924494876344320;\nn70931694131085312 -> n70650219154374656;\nn70650219154374656 -> n71213169107795968;\nn70650219154374656 -> n71494644084506624;\nn71494644084506624 -> n71213169107795968;\nn71213169107795968 -> n71776119061217280;\nn71213169107795968 -> n72057594037927936;\nn72057594037927936 -> n61924494876344320;\nn72057594037927936 -> n71776119061217280;\nn71776119061217280 -> n62205969853054976;\nn62205969853054976 -> n57420895248973824;\nn62205969853054976 -> n72339069014638592;\nn72339069014638592 -> n57420895248973824;\nn57420895248973824 -> n72620543991349248;\nn57420895248973824 -> n72902018968059904;\nn72902018968059904 -> n55732045388709888;\nn55732045388709888 -> n73183493944770560;\nn55732045388709888 -> n73464968921481216;\nn73464968921481216 -> n73183493944770560;\nn73183493944770560 -> n73746443898191872;\nn73183493944770560 -> n74027918874902528;\nn74027918874902528 -> n73746443898191872;\nn73746443898191872 -> n74309393851613184;\nn73746443898191872 -> n74590868828323840;\nn74590868828323840 -> n74872343805034496;\nn74590868828323840 -> n74309393851613184;\nn74309393851613184 -> n74872343805034496;\nn74872343805034496 -> n75153818781745152;\nn74872343805034496 -> n75435293758455808;\nn75435293758455808 -> n75716768735166464;\nn75435293758455808 -> n75998243711877120;\nn75998243711877120 -> n75716768735166464;\nn75153818781745152 -> n75716768735166464;\nn75716768735166464 -> n76279718688587776;\nn75716768735166464 -> n76561193665298432;\nn76561193665298432 -> n76842668642009088;\nn34621422135410688 -> n76842668642009088;\nn281474976710656 -> n0[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\nn1407374883553280 -> n844424930131968[style=dotted];\nn2533274790395904 -> n2251799813685248[style=dotted];\nn3096224743817216 -> n1407374883553280[style=dotted];\nn3377699720527872 -> n3096224743817216[style=dotted];\nn31806672368304128 -> n4222124650659840[style=dotted];\nn4503599627370496 -> n31806672368304128[style=dotted];\nn31525197391593472 -> n5348024557502464[style=dotted];\nn5629499534213120 -> n31525197391593472[style=dotted];\nn6755399441055744 -> n6473924464345088[style=dotted];\nn8162774324609024 -> n7881299347898368[style=dotted];\nn8725724278030336 -> n8162774324609024[style=dotted];\nn9851624184872960 -> n9570149208162304[style=dotted];\nn9288674231451648 -> n8725724278030336[style=dotted];\nn10414574138294272 -> n8725724278030336[style=dotted];\nn10977524091715584 -> n10696049115004928[style=dotted];\nn7318349394477056 -> n6755399441055744[style=dotted];\nn13229323905400832 -> n7318349394477056[style=dotted];\nn14073748835532800 -> n13229323905400832[style=dotted];\nn14355223812243456 -> n14073748835532800[style=dotted];\nn15481123719086080 -> n15199648742375424[style=dotted];\nn16044073672507392 -> n15481123719086080[style=dotted];\nn16607023625928704 -> n16044073672507392[style=dotted];\nn17169973579350016 -> n16607023625928704[style=dotted];\nn17732923532771328 -> n17169973579350016[style=dotted];\nn18295873486192640 -> n17732923532771328[style=dotted];\nn19140298416324608 -> n14918173765664768[style=dotted];\nn20266198323167232 -> n19984723346456576[style=dotted];\nn20829148276588544 -> n20266198323167232[style=dotted];\nn18858823439613952 -> n14355223812243456[style=dotted];\nn21392098230009856 -> n18858823439613952[style=dotted];\nn13792273858822144 -> n13229323905400832[style=dotted];\nn21955048183431168 -> n13792273858822144[style=dotted];\nn30680772461461504 -> n22799473113563136[style=dotted];\nn23080948090273792 -> n30680772461461504[style=dotted];\nn24206847997116416 -> n23925373020405760[style=dotted];\nn24769797950537728 -> n24206847997116416[style=dotted];\nn25332747903959040 -> n24769797950537728[style=dotted];\nn25895697857380352 -> n25332747903959040[style=dotted];\nn26458647810801664 -> n25895697857380352[style=dotted];\nn27021597764222976 -> n26458647810801664[style=dotted];\nn27866022694354944 -> n23643898043695104[style=dotted];\nn28991922601197568 -> n28710447624486912[style=dotted];\nn29554872554618880 -> n28991922601197568[style=dotted];\nn27584547717644288 -> n23080948090273792[style=dotted];\nn30117822508040192 -> n27584547717644288[style=dotted];\nn22517998136852480 -> n21955048183431168[style=dotted];\nn6192449487634432 -> n5629499534213120[style=dotted];\nn30962247438172160 -> n6192449487634432[style=dotted];\nn5066549580791808 -> n4503599627370496[style=dotted];\nn3940649673949184 -> n3377699720527872[style=dotted];\nn32369622321725440 -> n3940649673949184[style=dotted];\nn32932572275146752 -> n32369622321725440[style=dotted];\nn33495522228568064 -> n32932572275146752[style=dotted];\nn34058472181989376 -> n33495522228568064[style=dotted];\nn76279718688587776 -> n34902897112121344[style=dotted];\nn36310271995674624 -> n35465847065542656[style=dotted];\nn35184372088832000 -> n76279718688587776[style=dotted];\nn70368744177664000 -> n76279718688587776[style=dotted];\nn37436171902517248 -> n37154696925806592[style=dotted];\nn37999121855938560 -> n37154696925806592[style=dotted];\nn38280596832649216 -> n37999121855938560[style=dotted];\nn38843546786070528 -> n38280596832649216[style=dotted];\nn39406496739491840 -> n38280596832649216[style=dotted];\nn39687971716202496 -> n39406496739491840[style=dotted];\nn40250921669623808 -> n39406496739491840[style=dotted];\nn40532396646334464 -> n40250921669623808[style=dotted];\nn41095346599755776 -> n40532396646334464[style=dotted];\nn41658296553177088 -> n40532396646334464[style=dotted];\nn47006321110679552 -> n42221246506598400[style=dotted];\nn42502721483309056 -> n47006321110679552[style=dotted];\nn43065671436730368 -> n47006321110679552[style=dotted];\nn43347146413441024 -> n43065671436730368[style=dotted];\nn43910096366862336 -> n43347146413441024[style=dotted];\nn44473046320283648 -> n43347146413441024[style=dotted];\nn44754521296994304 -> n44473046320283648[style=dotted];\nn45317471250415616 -> n44473046320283648[style=dotted];\nn45598946227126272 -> n45317471250415616[style=dotted];\nn46161896180547584 -> n45598946227126272[style=dotted];\nn46724846133968896 -> n45598946227126272[style=dotted];\nn41939771529887744 -> n41658296553177088[style=dotted];\nn36591746972385280 -> n70368744177664000[style=dotted];\nn47850746040811520 -> n36591746972385280[style=dotted];\nn49258120924364800 -> n47850746040811520[style=dotted];\nn49821070877786112 -> n47850746040811520[style=dotted];\nn50102545854496768 -> n49821070877786112[style=dotted];\nn50665495807918080 -> n50102545854496768[style=dotted];\nn51228445761339392 -> n50102545854496768[style=dotted];\nn51509920738050048 -> n51228445761339392[style=dotted];\nn52072870691471360 -> n51228445761339392[style=dotted];\nn52354345668182016 -> n52072870691471360[style=dotted];\nn52917295621603328 -> n52354345668182016[style=dotted];\nn53480245575024640 -> n52354345668182016[style=dotted];\nn55450570411999232 -> n54043195528445952[style=dotted];\nn54324670505156608 -> n55450570411999232[style=dotted];\nn54887620458577920 -> n54324670505156608[style=dotted];\nn53761720551735296 -> n53480245575024640[style=dotted];\nn72620543991349248 -> n56013520365420544[style=dotted];\nn56294995342131200 -> n72620543991349248[style=dotted];\nn56857945295552512 -> n56294995342131200[style=dotted];\nn57983845202395136 -> n57702370225684480[style=dotted];\nn59109745109237760 -> n58828270132527104[style=dotted];\nn59672695062659072 -> n59109745109237760[style=dotted];\nn60235645016080384 -> n59672695062659072[style=dotted];\nn61924494876344320 -> n60235645016080384[style=dotted];\nn63613344736608256 -> n35747322042253312[style=dotted];\nn63050394783186944 -> n62768919806476288[style=dotted];\nn62487444829765632 -> n63613344736608256[style=dotted];\nn64176294690029568 -> n63894819713318912[style=dotted];\nn65020719620161536 -> n64176294690029568[style=dotted];\nn65302194596872192 -> n65020719620161536[style=dotted];\nn66991044457136128 -> n66146619527004160[style=dotted];\nn68679894317400064 -> n66428094503714816[style=dotted];\nn68116944363978752 -> n67835469387268096[style=dotted];\nn67553994410557440 -> n68679894317400064[style=dotted];\nn65865144550293504 -> n65302194596872192[style=dotted];\nn64739244643450880 -> n64176294690029568[style=dotted];\nn69524319247532032 -> n64739244643450880[style=dotted];\nn70650219154374656 -> n61643019899633664[style=dotted];\nn71213169107795968 -> n70650219154374656[style=dotted];\nn71776119061217280 -> n71213169107795968[style=dotted];\nn62205969853054976 -> n60235645016080384[style=dotted];\nn57420895248973824 -> n56857945295552512[style=dotted];\nn55732045388709888 -> n53761720551735296[style=dotted];\nn73183493944770560 -> n55732045388709888[style=dotted];\nn73746443898191872 -> n73183493944770560[style=dotted];\nn74309393851613184 -> n73746443898191872[style=dotted];\nn74872343805034496 -> n73746443898191872[style=dotted];\nn75716768735166464 -> n74872343805034496[style=dotted];\nn76842668642009088 -> n34058472181989376[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-262.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn1688849860263936[shape=rectangle, label=\"B3\"];\nn2251799813685248[shape=rectangle, label=\"B4\"];\nn2814749767106560[shape=rectangle, label=\"B5\"];\nn3377699720527872[shape=rectangle, label=\"B6\"];\nn3940649673949184[shape=rectangle, label=\"B7\"];\nn4503599627370496[shape=rectangle, label=\"B8\"];\nn5066549580791808[shape=rectangle, label=\"B9\"];\nn5629499534213120[shape=rectangle, label=\"B10\"];\nn6192449487634432[shape=rectangle, label=\"B11\"];\nn6755399441055744[shape=rectangle, label=\"B12\"];\nn7318349394477056[shape=rectangle, label=\"B13\"];\nn7881299347898368[shape=rectangle, label=\"B14\"];\nn8444249301319680[shape=rectangle, label=\"B15\"];\nn7881299347898368 -> n8444249301319680;\nn7318349394477056 -> n7881299347898368;\nn7599824371187712[shape=rectangle, label=\"B16\"];\nn7318349394477056 -> n7599824371187712;\nn6755399441055744 -> n7318349394477056;\nn7036874417766400[shape=rectangle, label=\"B17\"];\nn6755399441055744 -> n7036874417766400;\nn6192449487634432 -> n6755399441055744;\nn6473924464345088[shape=rectangle, label=\"B18\"];\nn6192449487634432 -> n6473924464345088;\nn5629499534213120 -> n6192449487634432;\nn5066549580791808 -> n5629499534213120;\nn5348024557502464[shape=rectangle, label=\"B19\"];\nn5066549580791808 -> n5348024557502464;\nn4503599627370496 -> n5066549580791808;\nn4785074604081152[shape=rectangle, label=\"B20\"];\nn9007199254740992[shape=rectangle, label=\"B21\"];\nn9570149208162304[shape=rectangle, label=\"B22\"];\nn10133099161583616[shape=rectangle, label=\"B23\"];\nn10696049115004928[shape=rectangle, label=\"B24\"];\nn10977524091715584[shape=rectangle, label=\"B25\"];\nn10696049115004928 -> n10977524091715584;\nn10133099161583616 -> n10696049115004928;\nn9570149208162304 -> n10133099161583616;\nn9851624184872960[shape=rectangle, label=\"B26\"];\nn9570149208162304 -> n9851624184872960;\nn9007199254740992 -> n9570149208162304;\nn9288674231451648[shape=rectangle, label=\"B27\"];\nn9007199254740992 -> n9288674231451648;\nn4785074604081152 -> n9007199254740992;\nn8725724278030336[shape=rectangle, label=\"B28\"];\nn4785074604081152 -> n8725724278030336;\nn4503599627370496 -> n4785074604081152;\nn3940649673949184 -> n4503599627370496;\nn4222124650659840[shape=rectangle, label=\"B29\"];\nn3940649673949184 -> n4222124650659840;\nn3377699720527872 -> n3940649673949184;\nn3659174697238528[shape=rectangle, label=\"B30\"];\nn11540474045136896[shape=rectangle, label=\"B31\"];\nn12103423998558208[shape=rectangle, label=\"B32\"];\nn12666373951979520[shape=rectangle, label=\"B33\"];\nn13229323905400832[shape=rectangle, label=\"B34\"];\nn13792273858822144[shape=rectangle, label=\"B35\"];\nn14355223812243456[shape=rectangle, label=\"B36\"];\nn14636698788954112[shape=rectangle, label=\"B37\"];\nn14355223812243456 -> n14636698788954112;\nn13792273858822144 -> n14355223812243456;\nn14073748835532800[shape=rectangle, label=\"B38\"];\nn13792273858822144 -> n14073748835532800;\nn13229323905400832 -> n13792273858822144;\nn12666373951979520 -> n13229323905400832;\nn12947848928690176[shape=rectangle, label=\"B39\"];\nn12666373951979520 -> n12947848928690176;\nn12103423998558208 -> n12666373951979520;\nn12384898975268864[shape=rectangle, label=\"B40\"];\nn12103423998558208 -> n12384898975268864;\nn11540474045136896 -> n12103423998558208;\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn11540474045136896 -> n11821949021847552;\nn3659174697238528 -> n11540474045136896;\nn11258999068426240[shape=rectangle, label=\"B42\"];\nn15199648742375424[shape=rectangle, label=\"B43\"];\nn15762598695796736[shape=rectangle, label=\"B44\"];\nn16325548649218048[shape=rectangle, label=\"B45\"];\nn16607023625928704[shape=rectangle, label=\"B46\"];\nn16325548649218048 -> n16607023625928704;\nn15762598695796736 -> n16325548649218048;\nn16044073672507392[shape=rectangle, label=\"B47\"];\nn15762598695796736 -> n16044073672507392;\nn15199648742375424 -> n15762598695796736;\nn15481123719086080[shape=rectangle, label=\"B48\"];\nn15199648742375424 -> n15481123719086080;\nn11258999068426240 -> n15199648742375424;\nn14918173765664768[shape=rectangle, label=\"B49\"];\nn11258999068426240 -> n14918173765664768;\nn3659174697238528 -> n11258999068426240;\nn3377699720527872 -> n3659174697238528;\nn2814749767106560 -> n3377699720527872;\nn3096224743817216[shape=rectangle, label=\"B50\"];\nn2814749767106560 -> n3096224743817216;\nn2251799813685248 -> n2814749767106560;\nn2533274790395904[shape=rectangle, label=\"B51\"];\nn17169973579350016[shape=rectangle, label=\"B52\"];\nn17732923532771328[shape=rectangle, label=\"B53\"];\nn18295873486192640[shape=rectangle, label=\"B54\"];\nn18858823439613952[shape=rectangle, label=\"B55\"];\nn19421773393035264[shape=rectangle, label=\"B56\"];\nn19984723346456576[shape=rectangle, label=\"B57\"];\nn20547673299877888[shape=rectangle, label=\"B58\"];\nn21110623253299200[shape=rectangle, label=\"B59\"];\nn21392098230009856[shape=rectangle, label=\"B60\"];\nn21110623253299200 -> n21392098230009856;\nn20547673299877888 -> n21110623253299200;\nn20829148276588544[shape=rectangle, label=\"B61\"];\nn20547673299877888 -> n20829148276588544;\nn19984723346456576 -> n20547673299877888;\nn20266198323167232[shape=rectangle, label=\"B62\"];\nn19984723346456576 -> n20266198323167232;\nn19421773393035264 -> n19984723346456576;\nn19703248369745920[shape=rectangle, label=\"B63\"];\nn19421773393035264 -> n19703248369745920;\nn18858823439613952 -> n19421773393035264;\nn19140298416324608[shape=rectangle, label=\"B64\"];\nn18858823439613952 -> n19140298416324608;\nn18295873486192640 -> n18858823439613952;\nn18577348462903296[shape=rectangle, label=\"B65\"];\nn18295873486192640 -> n18577348462903296;\nn17732923532771328 -> n18295873486192640;\nn18014398509481984[shape=rectangle, label=\"B66\"];\nn21955048183431168[shape=rectangle, label=\"B67\"];\nn22517998136852480[shape=rectangle, label=\"B68\"];\nn23080948090273792[shape=rectangle, label=\"B69\"];\nn23643898043695104[shape=rectangle, label=\"B70\"];\nn23925373020405760[shape=rectangle, label=\"B71\"];\nn23643898043695104 -> n23925373020405760;\nn23080948090273792 -> n23643898043695104;\nn23362423066984448[shape=rectangle, label=\"B72\"];\nn23080948090273792 -> n23362423066984448;\nn22517998136852480 -> n23080948090273792;\nn22799473113563136[shape=rectangle, label=\"B73\"];\nn22517998136852480 -> n22799473113563136;\nn21955048183431168 -> n22517998136852480;\nn22236523160141824[shape=rectangle, label=\"B74\"];\nn21955048183431168 -> n22236523160141824;\nn18014398509481984 -> n21955048183431168;\nn21673573206720512[shape=rectangle, label=\"B75\"];\nn18014398509481984 -> n21673573206720512;\nn17732923532771328 -> n18014398509481984;\nn17169973579350016 -> n17732923532771328;\nn17451448556060672[shape=rectangle, label=\"B76\"];\nn17169973579350016 -> n17451448556060672;\nn2533274790395904 -> n17169973579350016;\nn16888498602639360[shape=rectangle, label=\"B77\"];\nn24488322973827072[shape=rectangle, label=\"B78\"];\nn25051272927248384[shape=rectangle, label=\"B79\"];\nn25614222880669696[shape=rectangle, label=\"B80\"];\nn26177172834091008[shape=rectangle, label=\"B81\"];\nn26740122787512320[shape=rectangle, label=\"B82\"];\nn27303072740933632[shape=rectangle, label=\"B83\"];\nn27584547717644288[shape=rectangle, label=\"B84\"];\nn27303072740933632 -> n27584547717644288;\nn26740122787512320 -> n27303072740933632;\nn27021597764222976[shape=rectangle, label=\"B85\"];\nn26740122787512320 -> n27021597764222976;\nn26177172834091008 -> n26740122787512320;\nn26458647810801664[shape=rectangle, label=\"B86\"];\nn26177172834091008 -> n26458647810801664;\nn25614222880669696 -> n26177172834091008;\nn25895697857380352[shape=rectangle, label=\"B87\"];\nn25614222880669696 -> n25895697857380352;\nn25051272927248384 -> n25614222880669696;\nn25332747903959040[shape=rectangle, label=\"B88\"];\nn25051272927248384 -> n25332747903959040;\nn24488322973827072 -> n25051272927248384;\nn24769797950537728[shape=rectangle, label=\"B89\"];\nn24488322973827072 -> n24769797950537728;\nn16888498602639360 -> n24488322973827072;\nn24206847997116416[shape=rectangle, label=\"B90\"];\nn28147497671065600[shape=rectangle, label=\"B91\"];\nn28710447624486912[shape=rectangle, label=\"B92\"];\nn29273397577908224[shape=rectangle, label=\"B93\"];\nn29554872554618880[shape=rectangle, label=\"B94\"];\nn29273397577908224 -> n29554872554618880;\nn28710447624486912 -> n29273397577908224;\nn28991922601197568[shape=rectangle, label=\"B95\"];\nn28710447624486912 -> n28991922601197568;\nn28147497671065600 -> n28710447624486912;\nn28428972647776256[shape=rectangle, label=\"B96\"];\nn28147497671065600 -> n28428972647776256;\nn24206847997116416 -> n28147497671065600;\nn27866022694354944[shape=rectangle, label=\"B97\"];\nn24206847997116416 -> n27866022694354944;\nn16888498602639360 -> n24206847997116416;\nn2533274790395904 -> n16888498602639360;\nn2251799813685248 -> n2533274790395904;\nn1688849860263936 -> n2251799813685248;\nn1970324836974592[shape=rectangle, label=\"B98\"];\nn1688849860263936 -> n1970324836974592;\nn1125899906842624 -> n1688849860263936;\nn1407374883553280[shape=rectangle, label=\"B99\"];\nn30117822508040192[shape=rectangle, label=\"B100\"];\nn30680772461461504[shape=rectangle, label=\"B101\"];\nn31243722414882816[shape=rectangle, label=\"B102\"];\nn31806672368304128[shape=rectangle, label=\"B103\"];\nn32369622321725440[shape=rectangle, label=\"B104\"];\nn32932572275146752[shape=rectangle, label=\"B105\"];\nn33495522228568064[shape=rectangle, label=\"B106\"];\nn34058472181989376[shape=rectangle, label=\"B107\"];\nn34621422135410688[shape=rectangle, label=\"B108\"];\nn35184372088832000[shape=rectangle, label=\"B109\"];\nn35465847065542656[shape=rectangle, label=\"B110\"];\nn35184372088832000 -> n35465847065542656;\nn34621422135410688 -> n35184372088832000;\nn34902897112121344[shape=rectangle, label=\"B111\"];\nn34621422135410688 -> n34902897112121344;\nn34058472181989376 -> n34621422135410688;\nn34339947158700032[shape=rectangle, label=\"B112\"];\nn34058472181989376 -> n34339947158700032;\nn33495522228568064 -> n34058472181989376;\nn33776997205278720[shape=rectangle, label=\"B113\"];\nn33495522228568064 -> n33776997205278720;\nn32932572275146752 -> n33495522228568064;\nn33214047251857408[shape=rectangle, label=\"B114\"];\nn32932572275146752 -> n33214047251857408;\nn32369622321725440 -> n32932572275146752;\nn32651097298436096[shape=rectangle, label=\"B115\"];\nn32369622321725440 -> n32651097298436096;\nn31806672368304128 -> n32369622321725440;\nn32088147345014784[shape=rectangle, label=\"B116\"];\nn36028797018963968[shape=rectangle, label=\"B117\"];\nn36591746972385280[shape=rectangle, label=\"B118\"];\nn37154696925806592[shape=rectangle, label=\"B119\"];\nn37717646879227904[shape=rectangle, label=\"B120\"];\nn37999121855938560[shape=rectangle, label=\"B121\"];\nn37717646879227904 -> n37999121855938560;\nn37154696925806592 -> n37717646879227904;\nn37436171902517248[shape=rectangle, label=\"B122\"];\nn37154696925806592 -> n37436171902517248;\nn36591746972385280 -> n37154696925806592;\nn36873221949095936[shape=rectangle, label=\"B123\"];\nn36591746972385280 -> n36873221949095936;\nn36028797018963968 -> n36591746972385280;\nn36310271995674624[shape=rectangle, label=\"B124\"];\nn36028797018963968 -> n36310271995674624;\nn32088147345014784 -> n36028797018963968;\nn35747322042253312[shape=rectangle, label=\"B125\"];\nn32088147345014784 -> n35747322042253312;\nn31806672368304128 -> n32088147345014784;\nn31243722414882816 -> n31806672368304128;\nn31525197391593472[shape=rectangle, label=\"B126\"];\nn31243722414882816 -> n31525197391593472;\nn30680772461461504 -> n31243722414882816;\nn30962247438172160[shape=rectangle, label=\"B127\"];\nn38562071809359872[shape=rectangle, label=\"B128\"];\nn39125021762781184[shape=rectangle, label=\"B129\"];\nn39687971716202496[shape=rectangle, label=\"B130\"];\nn40250921669623808[shape=rectangle, label=\"B131\"];\nn40813871623045120[shape=rectangle, label=\"B132\"];\nn41376821576466432[shape=rectangle, label=\"B133\"];\nn41658296553177088[shape=rectangle, label=\"B134\"];\nn41376821576466432 -> n41658296553177088;\nn40813871623045120 -> n41376821576466432;\nn41095346599755776[shape=rectangle, label=\"B135\"];\nn40813871623045120 -> n41095346599755776;\nn40250921669623808 -> n40813871623045120;\nn40532396646334464[shape=rectangle, label=\"B136\"];\nn40250921669623808 -> n40532396646334464;\nn39687971716202496 -> n40250921669623808;\nn39969446692913152[shape=rectangle, label=\"B137\"];\nn39687971716202496 -> n39969446692913152;\nn39125021762781184 -> n39687971716202496;\nn39406496739491840[shape=rectangle, label=\"B138\"];\nn39125021762781184 -> n39406496739491840;\nn38562071809359872 -> n39125021762781184;\nn38843546786070528[shape=rectangle, label=\"B139\"];\nn38562071809359872 -> n38843546786070528;\nn30962247438172160 -> n38562071809359872;\nn38280596832649216[shape=rectangle, label=\"B140\"];\nn42221246506598400[shape=rectangle, label=\"B141\"];\nn42784196460019712[shape=rectangle, label=\"B142\"];\nn43347146413441024[shape=rectangle, label=\"B143\"];\nn43628621390151680[shape=rectangle, label=\"B144\"];\nn43347146413441024 -> n43628621390151680;\nn42784196460019712 -> n43347146413441024;\nn43065671436730368[shape=rectangle, label=\"B145\"];\nn42784196460019712 -> n43065671436730368;\nn42221246506598400 -> n42784196460019712;\nn42502721483309056[shape=rectangle, label=\"B146\"];\nn42221246506598400 -> n42502721483309056;\nn38280596832649216 -> n42221246506598400;\nn41939771529887744[shape=rectangle, label=\"B147\"];\nn38280596832649216 -> n41939771529887744;\nn30962247438172160 -> n38280596832649216;\nn30680772461461504 -> n30962247438172160;\nn30117822508040192 -> n30680772461461504;\nn30399297484750848[shape=rectangle, label=\"B148\"];\nn30117822508040192 -> n30399297484750848;\nn1407374883553280 -> n30117822508040192;\nn29836347531329536[shape=rectangle, label=\"B149\"];\nn44191571343572992[shape=rectangle, label=\"B150\"];\nn44754521296994304[shape=rectangle, label=\"B151\"];\nn45317471250415616[shape=rectangle, label=\"B152\"];\nn45880421203836928[shape=rectangle, label=\"B153\"];\nn46443371157258240[shape=rectangle, label=\"B154\"];\nn47006321110679552[shape=rectangle, label=\"B155\"];\nn47569271064100864[shape=rectangle, label=\"B156\"];\nn48132221017522176[shape=rectangle, label=\"B157\"];\nn48413695994232832[shape=rectangle, label=\"B158\"];\nn48132221017522176 -> n48413695994232832;\nn47569271064100864 -> n48132221017522176;\nn47850746040811520[shape=rectangle, label=\"B159\"];\nn47569271064100864 -> n47850746040811520;\nn47006321110679552 -> n47569271064100864;\nn47287796087390208[shape=rectangle, label=\"B160\"];\nn47006321110679552 -> n47287796087390208;\nn46443371157258240 -> n47006321110679552;\nn46724846133968896[shape=rectangle, label=\"B161\"];\nn46443371157258240 -> n46724846133968896;\nn45880421203836928 -> n46443371157258240;\nn46161896180547584[shape=rectangle, label=\"B162\"];\nn45880421203836928 -> n46161896180547584;\nn45317471250415616 -> n45880421203836928;\nn45598946227126272[shape=rectangle, label=\"B163\"];\nn45317471250415616 -> n45598946227126272;\nn44754521296994304 -> n45317471250415616;\nn45035996273704960[shape=rectangle, label=\"B164\"];\nn48976645947654144[shape=rectangle, label=\"B165\"];\nn49539595901075456[shape=rectangle, label=\"B166\"];\nn50102545854496768[shape=rectangle, label=\"B167\"];\nn50384020831207424[shape=rectangle, label=\"B168\"];\nn50102545854496768 -> n50384020831207424;\nn49539595901075456 -> n50102545854496768;\nn49821070877786112[shape=rectangle, label=\"B169\"];\nn49539595901075456 -> n49821070877786112;\nn48976645947654144 -> n49539595901075456;\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn48976645947654144 -> n49258120924364800;\nn45035996273704960 -> n48976645947654144;\nn48695170970943488[shape=rectangle, label=\"B171\"];\nn45035996273704960 -> n48695170970943488;\nn44754521296994304 -> n45035996273704960;\nn44191571343572992 -> n44754521296994304;\nn44473046320283648[shape=rectangle, label=\"B172\"];\nn44191571343572992 -> n44473046320283648;\nn29836347531329536 -> n44191571343572992;\nn43910096366862336[shape=rectangle, label=\"B173\"];\nn50946970784628736[shape=rectangle, label=\"B174\"];\nn51509920738050048[shape=rectangle, label=\"B175\"];\nn52072870691471360[shape=rectangle, label=\"B176\"];\nn52635820644892672[shape=rectangle, label=\"B177\"];\nn53198770598313984[shape=rectangle, label=\"B178\"];\nn53761720551735296[shape=rectangle, label=\"B179\"];\nn54043195528445952[shape=rectangle, label=\"B180\"];\nn53761720551735296 -> n54043195528445952;\nn53198770598313984 -> n53761720551735296;\nn53480245575024640[shape=rectangle, label=\"B181\"];\nn53198770598313984 -> n53480245575024640;\nn52635820644892672 -> n53198770598313984;\nn52917295621603328[shape=rectangle, label=\"B182\"];\nn52635820644892672 -> n52917295621603328;\nn52072870691471360 -> n52635820644892672;\nn52354345668182016[shape=rectangle, label=\"B183\"];\nn52072870691471360 -> n52354345668182016;\nn51509920738050048 -> n52072870691471360;\nn51791395714760704[shape=rectangle, label=\"B184\"];\nn51509920738050048 -> n51791395714760704;\nn50946970784628736 -> n51509920738050048;\nn51228445761339392[shape=rectangle, label=\"B185\"];\nn50946970784628736 -> n51228445761339392;\nn43910096366862336 -> n50946970784628736;\nn50665495807918080[shape=rectangle, label=\"B186\"];\nn54606145481867264[shape=rectangle, label=\"B187\"];\nn55169095435288576[shape=rectangle, label=\"B188\"];\nn55732045388709888[shape=rectangle, label=\"B189\"];\nn56013520365420544[shape=rectangle, label=\"B190\"];\nn55732045388709888 -> n56013520365420544;\nn55169095435288576 -> n55732045388709888;\nn55450570411999232[shape=rectangle, label=\"B191\"];\nn55169095435288576 -> n55450570411999232;\nn54606145481867264 -> n55169095435288576;\nn54887620458577920[shape=rectangle, label=\"B192\"];\nn54606145481867264 -> n54887620458577920;\nn50665495807918080 -> n54606145481867264;\nn54324670505156608[shape=rectangle, label=\"B193\"];\nn50665495807918080 -> n54324670505156608;\nn43910096366862336 -> n50665495807918080;\nn29836347531329536 -> n43910096366862336;\nn1407374883553280 -> n29836347531329536;\nn1125899906842624 -> n1407374883553280;\nn562949953421312 -> n1125899906842624;\nn844424930131968[shape=rectangle, label=\"B194\"];\nn562949953421312 -> n844424930131968;\nn0 -> n562949953421312;\nn281474976710656[shape=rectangle, label=\"B195\"];\nn56576470318841856[shape=rectangle, label=\"B196\"];\nn57139420272263168[shape=rectangle, label=\"B197\"];\nn57702370225684480[shape=rectangle, label=\"B198\"];\nn58265320179105792[shape=rectangle, label=\"B199\"];\nn58828270132527104[shape=rectangle, label=\"B200\"];\nn59391220085948416[shape=rectangle, label=\"B201\"];\nn59954170039369728[shape=rectangle, label=\"B202\"];\nn60517119992791040[shape=rectangle, label=\"B203\"];\nn61080069946212352[shape=rectangle, label=\"B204\"];\nn61643019899633664[shape=rectangle, label=\"B205\"];\nn62205969853054976[shape=rectangle, label=\"B206\"];\nn62768919806476288[shape=rectangle, label=\"B207\"];\nn63050394783186944[shape=rectangle, label=\"B208\"];\nn62768919806476288 -> n63050394783186944;\nn62205969853054976 -> n62768919806476288;\nn62487444829765632[shape=rectangle, label=\"B209\"];\nn62205969853054976 -> n62487444829765632;\nn61643019899633664 -> n62205969853054976;\nn61924494876344320[shape=rectangle, label=\"B210\"];\nn61643019899633664 -> n61924494876344320;\nn61080069946212352 -> n61643019899633664;\nn61361544922923008[shape=rectangle, label=\"B211\"];\nn61080069946212352 -> n61361544922923008;\nn60517119992791040 -> n61080069946212352;\nn60798594969501696[shape=rectangle, label=\"B212\"];\nn60517119992791040 -> n60798594969501696;\nn59954170039369728 -> n60517119992791040;\nn60235645016080384[shape=rectangle, label=\"B213\"];\nn59954170039369728 -> n60235645016080384;\nn59391220085948416 -> n59954170039369728;\nn59672695062659072[shape=rectangle, label=\"B214\"];\nn63613344736608256[shape=rectangle, label=\"B215\"];\nn64176294690029568[shape=rectangle, label=\"B216\"];\nn64739244643450880[shape=rectangle, label=\"B217\"];\nn65302194596872192[shape=rectangle, label=\"B218\"];\nn65583669573582848[shape=rectangle, label=\"B219\"];\nn65302194596872192 -> n65583669573582848;\nn64739244643450880 -> n65302194596872192;\nn65020719620161536[shape=rectangle, label=\"B220\"];\nn64739244643450880 -> n65020719620161536;\nn64176294690029568 -> n64739244643450880;\nn64457769666740224[shape=rectangle, label=\"B221\"];\nn64176294690029568 -> n64457769666740224;\nn63613344736608256 -> n64176294690029568;\nn63894819713318912[shape=rectangle, label=\"B222\"];\nn63613344736608256 -> n63894819713318912;\nn59672695062659072 -> n63613344736608256;\nn63331869759897600[shape=rectangle, label=\"B223\"];\nn59672695062659072 -> n63331869759897600;\nn59391220085948416 -> n59672695062659072;\nn58828270132527104 -> n59391220085948416;\nn59109745109237760[shape=rectangle, label=\"B224\"];\nn58828270132527104 -> n59109745109237760;\nn58265320179105792 -> n58828270132527104;\nn58546795155816448[shape=rectangle, label=\"B225\"];\nn66146619527004160[shape=rectangle, label=\"B226\"];\nn66709569480425472[shape=rectangle, label=\"B227\"];\nn67272519433846784[shape=rectangle, label=\"B228\"];\nn67835469387268096[shape=rectangle, label=\"B229\"];\nn68398419340689408[shape=rectangle, label=\"B230\"];\nn68961369294110720[shape=rectangle, label=\"B231\"];\nn69242844270821376[shape=rectangle, label=\"B232\"];\nn68961369294110720 -> n69242844270821376;\nn68398419340689408 -> n68961369294110720;\nn68679894317400064[shape=rectangle, label=\"B233\"];\nn68398419340689408 -> n68679894317400064;\nn67835469387268096 -> n68398419340689408;\nn68116944363978752[shape=rectangle, label=\"B234\"];\nn67835469387268096 -> n68116944363978752;\nn67272519433846784 -> n67835469387268096;\nn67553994410557440[shape=rectangle, label=\"B235\"];\nn67272519433846784 -> n67553994410557440;\nn66709569480425472 -> n67272519433846784;\nn66991044457136128[shape=rectangle, label=\"B236\"];\nn66709569480425472 -> n66991044457136128;\nn66146619527004160 -> n66709569480425472;\nn66428094503714816[shape=rectangle, label=\"B237\"];\nn66146619527004160 -> n66428094503714816;\nn58546795155816448 -> n66146619527004160;\nn65865144550293504[shape=rectangle, label=\"B238\"];\nn69805794224242688[shape=rectangle, label=\"B239\"];\nn70368744177664000[shape=rectangle, label=\"B240\"];\nn70931694131085312[shape=rectangle, label=\"B241\"];\nn71213169107795968[shape=rectangle, label=\"B242\"];\nn70931694131085312 -> n71213169107795968;\nn70368744177664000 -> n70931694131085312;\nn70650219154374656[shape=rectangle, label=\"B243\"];\nn70368744177664000 -> n70650219154374656;\nn69805794224242688 -> n70368744177664000;\nn70087269200953344[shape=rectangle, label=\"B244\"];\nn69805794224242688 -> n70087269200953344;\nn65865144550293504 -> n69805794224242688;\nn69524319247532032[shape=rectangle, label=\"B245\"];\nn65865144550293504 -> n69524319247532032;\nn58546795155816448 -> n65865144550293504;\nn58265320179105792 -> n58546795155816448;\nn57702370225684480 -> n58265320179105792;\nn57983845202395136[shape=rectangle, label=\"B246\"];\nn57702370225684480 -> n57983845202395136;\nn57139420272263168 -> n57702370225684480;\nn57420895248973824[shape=rectangle, label=\"B247\"];\nn71776119061217280[shape=rectangle, label=\"B248\"];\nn72339069014638592[shape=rectangle, label=\"B249\"];\nn72902018968059904[shape=rectangle, label=\"B250\"];\nn73464968921481216[shape=rectangle, label=\"B251\"];\nn74027918874902528[shape=rectangle, label=\"B252\"];\nn74590868828323840[shape=rectangle, label=\"B253\"];\nn75153818781745152[shape=rectangle, label=\"B254\"];\nn75716768735166464[shape=rectangle, label=\"B255\"];\nn75998243711877120[shape=rectangle, label=\"B256\"];\nn75716768735166464 -> n75998243711877120;\nn75153818781745152 -> n75716768735166464;\nn75435293758455808[shape=rectangle, label=\"B257\"];\nn75153818781745152 -> n75435293758455808;\nn74590868828323840 -> n75153818781745152;\nn74872343805034496[shape=rectangle, label=\"B258\"];\nn74590868828323840 -> n74872343805034496;\nn74027918874902528 -> n74590868828323840;\nn74309393851613184[shape=rectangle, label=\"B259\"];\nn74027918874902528 -> n74309393851613184;\nn73464968921481216 -> n74027918874902528;\nn73746443898191872[shape=rectangle, label=\"B260\"];\nn73464968921481216 -> n73746443898191872;\nn72902018968059904 -> n73464968921481216;\nn73183493944770560[shape=rectangle, label=\"B261\"];\nn72902018968059904 -> n73183493944770560;\nn72339069014638592 -> n72902018968059904;\nn72620543991349248[shape=rectangle, label=\"B262\"];\nn76561193665298432[shape=rectangle, label=\"B263\"];\nn77124143618719744[shape=rectangle, label=\"B264\"];\nn77687093572141056[shape=rectangle, label=\"B265\"];\nn77968568548851712[shape=rectangle, label=\"B266\"];\nn77687093572141056 -> n77968568548851712;\nn77124143618719744 -> n77687093572141056;\nn77405618595430400[shape=rectangle, label=\"B267\"];\nn77124143618719744 -> n77405618595430400;\nn76561193665298432 -> n77124143618719744;\nn76842668642009088[shape=rectangle, label=\"B268\"];\nn76561193665298432 -> n76842668642009088;\nn72620543991349248 -> n76561193665298432;\nn76279718688587776[shape=rectangle, label=\"B269\"];\nn72620543991349248 -> n76279718688587776;\nn72339069014638592 -> n72620543991349248;\nn71776119061217280 -> n72339069014638592;\nn72057594037927936[shape=rectangle, label=\"B270\"];\nn71776119061217280 -> n72057594037927936;\nn57420895248973824 -> n71776119061217280;\nn71494644084506624[shape=rectangle, label=\"B271\"];\nn78531518502273024[shape=rectangle, label=\"B272\"];\nn79094468455694336[shape=rectangle, label=\"B273\"];\nn79657418409115648[shape=rectangle, label=\"B274\"];\nn80220368362536960[shape=rectangle, label=\"B275\"];\nn80783318315958272[shape=rectangle, label=\"B276\"];\nn81346268269379584[shape=rectangle, label=\"B277\"];\nn81627743246090240[shape=rectangle, label=\"B278\"];\nn81346268269379584 -> n81627743246090240;\nn80783318315958272 -> n81346268269379584;\nn81064793292668928[shape=rectangle, label=\"B279\"];\nn80783318315958272 -> n81064793292668928;\nn80220368362536960 -> n80783318315958272;\nn80501843339247616[shape=rectangle, label=\"B280\"];\nn80220368362536960 -> n80501843339247616;\nn79657418409115648 -> n80220368362536960;\nn79938893385826304[shape=rectangle, label=\"B281\"];\nn79657418409115648 -> n79938893385826304;\nn79094468455694336 -> n79657418409115648;\nn79375943432404992[shape=rectangle, label=\"B282\"];\nn79094468455694336 -> n79375943432404992;\nn78531518502273024 -> n79094468455694336;\nn78812993478983680[shape=rectangle, label=\"B283\"];\nn78531518502273024 -> n78812993478983680;\nn71494644084506624 -> n78531518502273024;\nn78250043525562368[shape=rectangle, label=\"B284\"];\nn82190693199511552[shape=rectangle, label=\"B285\"];\nn82753643152932864[shape=rectangle, label=\"B286\"];\nn83316593106354176[shape=rectangle, label=\"B287\"];\nn83598068083064832[shape=rectangle, label=\"B288\"];\nn83316593106354176 -> n83598068083064832;\nn82753643152932864 -> n83316593106354176;\nn83035118129643520[shape=rectangle, label=\"B289\"];\nn82753643152932864 -> n83035118129643520;\nn82190693199511552 -> n82753643152932864;\nn82472168176222208[shape=rectangle, label=\"B290\"];\nn82190693199511552 -> n82472168176222208;\nn78250043525562368 -> n82190693199511552;\nn81909218222800896[shape=rectangle, label=\"B291\"];\nn78250043525562368 -> n81909218222800896;\nn71494644084506624 -> n78250043525562368;\nn57420895248973824 -> n71494644084506624;\nn57139420272263168 -> n57420895248973824;\nn56576470318841856 -> n57139420272263168;\nn56857945295552512[shape=rectangle, label=\"B292\"];\nn56576470318841856 -> n56857945295552512;\nn281474976710656 -> n56576470318841856;\nn56294995342131200[shape=rectangle, label=\"B293\"];\nn84161018036486144[shape=rectangle, label=\"B294\"];\nn84723967989907456[shape=rectangle, label=\"B295\"];\nn85286917943328768[shape=rectangle, label=\"B296\"];\nn85849867896750080[shape=rectangle, label=\"B297\"];\nn86412817850171392[shape=rectangle, label=\"B298\"];\nn86975767803592704[shape=rectangle, label=\"B299\"];\nn87538717757014016[shape=rectangle, label=\"B300\"];\nn88101667710435328[shape=rectangle, label=\"B301\"];\nn88664617663856640[shape=rectangle, label=\"B302\"];\nn89227567617277952[shape=rectangle, label=\"B303\"];\nn89509042593988608[shape=rectangle, label=\"B304\"];\nn89227567617277952 -> n89509042593988608;\nn88664617663856640 -> n89227567617277952;\nn88946092640567296[shape=rectangle, label=\"B305\"];\nn88664617663856640 -> n88946092640567296;\nn88101667710435328 -> n88664617663856640;\nn88383142687145984[shape=rectangle, label=\"B306\"];\nn88101667710435328 -> n88383142687145984;\nn87538717757014016 -> n88101667710435328;\nn87820192733724672[shape=rectangle, label=\"B307\"];\nn87538717757014016 -> n87820192733724672;\nn86975767803592704 -> n87538717757014016;\nn87257242780303360[shape=rectangle, label=\"B308\"];\nn86975767803592704 -> n87257242780303360;\nn86412817850171392 -> n86975767803592704;\nn86694292826882048[shape=rectangle, label=\"B309\"];\nn86412817850171392 -> n86694292826882048;\nn85849867896750080 -> n86412817850171392;\nn86131342873460736[shape=rectangle, label=\"B310\"];\nn90071992547409920[shape=rectangle, label=\"B311\"];\nn90634942500831232[shape=rectangle, label=\"B312\"];\nn91197892454252544[shape=rectangle, label=\"B313\"];\nn91760842407673856[shape=rectangle, label=\"B314\"];\nn92042317384384512[shape=rectangle, label=\"B315\"];\nn91760842407673856 -> n92042317384384512;\nn91197892454252544 -> n91760842407673856;\nn91479367430963200[shape=rectangle, label=\"B316\"];\nn91197892454252544 -> n91479367430963200;\nn90634942500831232 -> n91197892454252544;\nn90916417477541888[shape=rectangle, label=\"B317\"];\nn90634942500831232 -> n90916417477541888;\nn90071992547409920 -> n90634942500831232;\nn90353467524120576[shape=rectangle, label=\"B318\"];\nn90071992547409920 -> n90353467524120576;\nn86131342873460736 -> n90071992547409920;\nn89790517570699264[shape=rectangle, label=\"B319\"];\nn86131342873460736 -> n89790517570699264;\nn85849867896750080 -> n86131342873460736;\nn85286917943328768 -> n85849867896750080;\nn85568392920039424[shape=rectangle, label=\"B320\"];\nn85286917943328768 -> n85568392920039424;\nn84723967989907456 -> n85286917943328768;\nn85005442966618112[shape=rectangle, label=\"B321\"];\nn92605267337805824[shape=rectangle, label=\"B322\"];\nn93168217291227136[shape=rectangle, label=\"B323\"];\nn93731167244648448[shape=rectangle, label=\"B324\"];\nn94294117198069760[shape=rectangle, label=\"B325\"];\nn94857067151491072[shape=rectangle, label=\"B326\"];\nn95420017104912384[shape=rectangle, label=\"B327\"];\nn95701492081623040[shape=rectangle, label=\"B328\"];\nn95420017104912384 -> n95701492081623040;\nn94857067151491072 -> n95420017104912384;\nn95138542128201728[shape=rectangle, label=\"B329\"];\nn94857067151491072 -> n95138542128201728;\nn94294117198069760 -> n94857067151491072;\nn94575592174780416[shape=rectangle, label=\"B330\"];\nn94294117198069760 -> n94575592174780416;\nn93731167244648448 -> n94294117198069760;\nn94012642221359104[shape=rectangle, label=\"B331\"];\nn93731167244648448 -> n94012642221359104;\nn93168217291227136 -> n93731167244648448;\nn93449692267937792[shape=rectangle, label=\"B332\"];\nn93168217291227136 -> n93449692267937792;\nn92605267337805824 -> n93168217291227136;\nn92886742314516480[shape=rectangle, label=\"B333\"];\nn92605267337805824 -> n92886742314516480;\nn85005442966618112 -> n92605267337805824;\nn92323792361095168[shape=rectangle, label=\"B334\"];\nn96264442035044352[shape=rectangle, label=\"B335\"];\nn96827391988465664[shape=rectangle, label=\"B336\"];\nn97390341941886976[shape=rectangle, label=\"B337\"];\nn97671816918597632[shape=rectangle, label=\"B338\"];\nn97390341941886976 -> n97671816918597632;\nn96827391988465664 -> n97390341941886976;\nn97108866965176320[shape=rectangle, label=\"B339\"];\nn96827391988465664 -> n97108866965176320;\nn96264442035044352 -> n96827391988465664;\nn96545917011755008[shape=rectangle, label=\"B340\"];\nn96264442035044352 -> n96545917011755008;\nn92323792361095168 -> n96264442035044352;\nn95982967058333696[shape=rectangle, label=\"B341\"];\nn92323792361095168 -> n95982967058333696;\nn85005442966618112 -> n92323792361095168;\nn84723967989907456 -> n85005442966618112;\nn84161018036486144 -> n84723967989907456;\nn84442493013196800[shape=rectangle, label=\"B342\"];\nn84161018036486144 -> n84442493013196800;\nn56294995342131200 -> n84161018036486144;\nn83879543059775488[shape=rectangle, label=\"B343\"];\nn98234766872018944[shape=rectangle, label=\"B344\"];\nn98797716825440256[shape=rectangle, label=\"B345\"];\nn99360666778861568[shape=rectangle, label=\"B346\"];\nn99923616732282880[shape=rectangle, label=\"B347\"];\nn100486566685704192[shape=rectangle, label=\"B348\"];\nn101049516639125504[shape=rectangle, label=\"B349\"];\nn101612466592546816[shape=rectangle, label=\"B350\"];\nn102175416545968128[shape=rectangle, label=\"B351\"];\nn102456891522678784[shape=rectangle, label=\"B352\"];\nn102175416545968128 -> n102456891522678784;\nn101612466592546816 -> n102175416545968128;\nn101893941569257472[shape=rectangle, label=\"B353\"];\nn101612466592546816 -> n101893941569257472;\nn101049516639125504 -> n101612466592546816;\nn101330991615836160[shape=rectangle, label=\"B354\"];\nn101049516639125504 -> n101330991615836160;\nn100486566685704192 -> n101049516639125504;\nn100768041662414848[shape=rectangle, label=\"B355\"];\nn100486566685704192 -> n100768041662414848;\nn99923616732282880 -> n100486566685704192;\nn100205091708993536[shape=rectangle, label=\"B356\"];\nn99923616732282880 -> n100205091708993536;\nn99360666778861568 -> n99923616732282880;\nn99642141755572224[shape=rectangle, label=\"B357\"];\nn99360666778861568 -> n99642141755572224;\nn98797716825440256 -> n99360666778861568;\nn99079191802150912[shape=rectangle, label=\"B358\"];\nn103019841476100096[shape=rectangle, label=\"B359\"];\nn103582791429521408[shape=rectangle, label=\"B360\"];\nn104145741382942720[shape=rectangle, label=\"B361\"];\nn104427216359653376[shape=rectangle, label=\"B362\"];\nn104145741382942720 -> n104427216359653376;\nn103582791429521408 -> n104145741382942720;\nn103864266406232064[shape=rectangle, label=\"B363\"];\nn103582791429521408 -> n103864266406232064;\nn103019841476100096 -> n103582791429521408;\nn103301316452810752[shape=rectangle, label=\"B364\"];\nn103019841476100096 -> n103301316452810752;\nn99079191802150912 -> n103019841476100096;\nn102738366499389440[shape=rectangle, label=\"B365\"];\nn99079191802150912 -> n102738366499389440;\nn98797716825440256 -> n99079191802150912;\nn98234766872018944 -> n98797716825440256;\nn98516241848729600[shape=rectangle, label=\"B366\"];\nn98234766872018944 -> n98516241848729600;\nn83879543059775488 -> n98234766872018944;\nn97953291895308288[shape=rectangle, label=\"B367\"];\nn104990166313074688[shape=rectangle, label=\"B368\"];\nn105553116266496000[shape=rectangle, label=\"B369\"];\nn106116066219917312[shape=rectangle, label=\"B370\"];\nn106679016173338624[shape=rectangle, label=\"B371\"];\nn107241966126759936[shape=rectangle, label=\"B372\"];\nn107804916080181248[shape=rectangle, label=\"B373\"];\nn108086391056891904[shape=rectangle, label=\"B374\"];\nn107804916080181248 -> n108086391056891904;\nn107241966126759936 -> n107804916080181248;\nn107523441103470592[shape=rectangle, label=\"B375\"];\nn107241966126759936 -> n107523441103470592;\nn106679016173338624 -> n107241966126759936;\nn106960491150049280[shape=rectangle, label=\"B376\"];\nn106679016173338624 -> n106960491150049280;\nn106116066219917312 -> n106679016173338624;\nn106397541196627968[shape=rectangle, label=\"B377\"];\nn106116066219917312 -> n106397541196627968;\nn105553116266496000 -> n106116066219917312;\nn105834591243206656[shape=rectangle, label=\"B378\"];\nn105553116266496000 -> n105834591243206656;\nn104990166313074688 -> n105553116266496000;\nn105271641289785344[shape=rectangle, label=\"B379\"];\nn104990166313074688 -> n105271641289785344;\nn97953291895308288 -> n104990166313074688;\nn104708691336364032[shape=rectangle, label=\"B380\"];\nn108649341010313216[shape=rectangle, label=\"B381\"];\nn109212290963734528[shape=rectangle, label=\"B382\"];\nn109775240917155840[shape=rectangle, label=\"B383\"];\nn110056715893866496[shape=rectangle, label=\"B390\"];\nn109775240917155840 -> n110056715893866496;\nn109212290963734528 -> n109775240917155840;\nn109493765940445184[shape=rectangle, label=\"B391\"];\nn109212290963734528 -> n109493765940445184;\nn108649341010313216 -> n109212290963734528;\nn108930815987023872[shape=rectangle, label=\"B392\"];\nn108649341010313216 -> n108930815987023872;\nn104708691336364032 -> n108649341010313216;\nn108367866033602560[shape=rectangle, label=\"B393\"];\nn104708691336364032 -> n108367866033602560;\nn97953291895308288 -> n104708691336364032;\nn83879543059775488 -> n97953291895308288;\nn56294995342131200 -> n83879543059775488;\nn281474976710656 -> n56294995342131200;\nn0 -> n281474976710656;\nn8162774324609024[shape=rectangle, label=\"B384\"];\nn110338190870577152[shape=rectangle, label=\"B385\"];\nn110619665847287808[shape=rectangle, label=\"B386\"];\nn110338190870577152 -> n110619665847287808;\nn8162774324609024 -> n110338190870577152;\nn0 -> n8162774324609024;\nn5910974510923776[shape=rectangle, label=\"B387\"];\nn0 -> n5910974510923776;\nn13510798882111488[shape=rectangle, label=\"B388\"];\nn0 -> n13510798882111488;\nn10414574138294272[shape=rectangle, label=\"B389\"];\nn0 -> n10414574138294272;\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-276.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn1688849860263936[shape=rectangle, label=\"B3\"];\nn2251799813685248[shape=rectangle, label=\"B4\"];\nn2814749767106560[shape=rectangle, label=\"B5\"];\nn3377699720527872[shape=rectangle, label=\"B6\"];\nn3940649673949184[shape=rectangle, label=\"B7\"];\nn4503599627370496[shape=rectangle, label=\"B8\"];\nn5066549580791808[shape=rectangle, label=\"B9\"];\nn5629499534213120[shape=rectangle, label=\"B10\"];\nn6192449487634432[shape=rectangle, label=\"B11\"];\nn6755399441055744[shape=rectangle, label=\"B12\"];\nn7318349394477056[shape=rectangle, label=\"B13\"];\nn7881299347898368[shape=rectangle, label=\"B14\"];\nn8444249301319680[shape=rectangle, label=\"B15\"];\nn7599824371187712[shape=rectangle, label=\"B16\"];\nn7036874417766400[shape=rectangle, label=\"B17\"];\nn6473924464345088[shape=rectangle, label=\"B18\"];\nn5348024557502464[shape=rectangle, label=\"B19\"];\nn4785074604081152[shape=rectangle, label=\"B20\"];\nn9007199254740992[shape=rectangle, label=\"B21\"];\nn9570149208162304[shape=rectangle, label=\"B22\"];\nn10133099161583616[shape=rectangle, label=\"B23\"];\nn10696049115004928[shape=rectangle, label=\"B24\"];\nn10977524091715584[shape=rectangle, label=\"B25\"];\nn9851624184872960[shape=rectangle, label=\"B26\"];\nn9288674231451648[shape=rectangle, label=\"B27\"];\nn8725724278030336[shape=rectangle, label=\"B28\"];\nn4222124650659840[shape=rectangle, label=\"B29\"];\nn3659174697238528[shape=rectangle, label=\"B30\"];\nn11540474045136896[shape=rectangle, label=\"B31\"];\nn12103423998558208[shape=rectangle, label=\"B32\"];\nn12666373951979520[shape=rectangle, label=\"B33\"];\nn13229323905400832[shape=rectangle, label=\"B34\"];\nn13792273858822144[shape=rectangle, label=\"B35\"];\nn14355223812243456[shape=rectangle, label=\"B36\"];\nn14636698788954112[shape=rectangle, label=\"B37\"];\nn14073748835532800[shape=rectangle, label=\"B38\"];\nn12947848928690176[shape=rectangle, label=\"B39\"];\nn12384898975268864[shape=rectangle, label=\"B40\"];\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn11258999068426240[shape=rectangle, label=\"B42\"];\nn15199648742375424[shape=rectangle, label=\"B43\"];\nn15762598695796736[shape=rectangle, label=\"B44\"];\nn16325548649218048[shape=rectangle, label=\"B45\"];\nn16607023625928704[shape=rectangle, label=\"B46\"];\nn16044073672507392[shape=rectangle, label=\"B47\"];\nn15481123719086080[shape=rectangle, label=\"B48\"];\nn14918173765664768[shape=rectangle, label=\"B49\"];\nn3096224743817216[shape=rectangle, label=\"B50\"];\nn2533274790395904[shape=rectangle, label=\"B51\"];\nn17169973579350016[shape=rectangle, label=\"B52\"];\nn17732923532771328[shape=rectangle, label=\"B53\"];\nn18295873486192640[shape=rectangle, label=\"B54\"];\nn18858823439613952[shape=rectangle, label=\"B55\"];\nn19421773393035264[shape=rectangle, label=\"B56\"];\nn19984723346456576[shape=rectangle, label=\"B57\"];\nn20547673299877888[shape=rectangle, label=\"B58\"];\nn21110623253299200[shape=rectangle, label=\"B59\"];\nn21392098230009856[shape=rectangle, label=\"B60\"];\nn20829148276588544[shape=rectangle, label=\"B61\"];\nn20266198323167232[shape=rectangle, label=\"B62\"];\nn19703248369745920[shape=rectangle, label=\"B63\"];\nn19140298416324608[shape=rectangle, label=\"B64\"];\nn18577348462903296[shape=rectangle, label=\"B65\"];\nn18014398509481984[shape=rectangle, label=\"B66\"];\nn21955048183431168[shape=rectangle, label=\"B67\"];\nn22517998136852480[shape=rectangle, label=\"B68\"];\nn23080948090273792[shape=rectangle, label=\"B69\"];\nn23643898043695104[shape=rectangle, label=\"B70\"];\nn23925373020405760[shape=rectangle, label=\"B71\"];\nn23362423066984448[shape=rectangle, label=\"B72\"];\nn22799473113563136[shape=rectangle, label=\"B73\"];\nn22236523160141824[shape=rectangle, label=\"B74\"];\nn21673573206720512[shape=rectangle, label=\"B75\"];\nn17451448556060672[shape=rectangle, label=\"B76\"];\nn16888498602639360[shape=rectangle, label=\"B77\"];\nn24488322973827072[shape=rectangle, label=\"B78\"];\nn25051272927248384[shape=rectangle, label=\"B79\"];\nn25614222880669696[shape=rectangle, label=\"B80\"];\nn26177172834091008[shape=rectangle, label=\"B81\"];\nn26740122787512320[shape=rectangle, label=\"B82\"];\nn27303072740933632[shape=rectangle, label=\"B83\"];\nn27584547717644288[shape=rectangle, label=\"B84\"];\nn27021597764222976[shape=rectangle, label=\"B85\"];\nn26458647810801664[shape=rectangle, label=\"B86\"];\nn25895697857380352[shape=rectangle, label=\"B87\"];\nn25332747903959040[shape=rectangle, label=\"B88\"];\nn24769797950537728[shape=rectangle, label=\"B89\"];\nn24206847997116416[shape=rectangle, label=\"B90\"];\nn28147497671065600[shape=rectangle, label=\"B91\"];\nn28710447624486912[shape=rectangle, label=\"B92\"];\nn29273397577908224[shape=rectangle, label=\"B93\"];\nn29554872554618880[shape=rectangle, label=\"B94\"];\nn28991922601197568[shape=rectangle, label=\"B95\"];\nn28428972647776256[shape=rectangle, label=\"B96\"];\nn27866022694354944[shape=rectangle, label=\"B97\"];\nn1970324836974592[shape=rectangle, label=\"B98\"];\nn1407374883553280[shape=rectangle, label=\"B99\"];\nn30117822508040192[shape=rectangle, label=\"B100\"];\nn30680772461461504[shape=rectangle, label=\"B101\"];\nn31243722414882816[shape=rectangle, label=\"B102\"];\nn31806672368304128[shape=rectangle, label=\"B103\"];\nn32369622321725440[shape=rectangle, label=\"B104\"];\nn32932572275146752[shape=rectangle, label=\"B105\"];\nn33495522228568064[shape=rectangle, label=\"B106\"];\nn34058472181989376[shape=rectangle, label=\"B107\"];\nn34621422135410688[shape=rectangle, label=\"B108\"];\nn35184372088832000[shape=rectangle, label=\"B109\"];\nn35465847065542656[shape=rectangle, label=\"B110\"];\nn34902897112121344[shape=rectangle, label=\"B111\"];\nn34339947158700032[shape=rectangle, label=\"B112\"];\nn33776997205278720[shape=rectangle, label=\"B113\"];\nn33214047251857408[shape=rectangle, label=\"B114\"];\nn32651097298436096[shape=rectangle, label=\"B115\"];\nn32088147345014784[shape=rectangle, label=\"B116\"];\nn36028797018963968[shape=rectangle, label=\"B117\"];\nn36591746972385280[shape=rectangle, label=\"B118\"];\nn37154696925806592[shape=rectangle, label=\"B119\"];\nn37717646879227904[shape=rectangle, label=\"B120\"];\nn37999121855938560[shape=rectangle, label=\"B121\"];\nn37436171902517248[shape=rectangle, label=\"B122\"];\nn36873221949095936[shape=rectangle, label=\"B123\"];\nn36310271995674624[shape=rectangle, label=\"B124\"];\nn35747322042253312[shape=rectangle, label=\"B125\"];\nn31525197391593472[shape=rectangle, label=\"B126\"];\nn30962247438172160[shape=rectangle, label=\"B127\"];\nn38562071809359872[shape=rectangle, label=\"B128\"];\nn39125021762781184[shape=rectangle, label=\"B129\"];\nn39687971716202496[shape=rectangle, label=\"B130\"];\nn40250921669623808[shape=rectangle, label=\"B131\"];\nn40813871623045120[shape=rectangle, label=\"B132\"];\nn41376821576466432[shape=rectangle, label=\"B133\"];\nn41658296553177088[shape=rectangle, label=\"B134\"];\nn41095346599755776[shape=rectangle, label=\"B135\"];\nn40532396646334464[shape=rectangle, label=\"B136\"];\nn39969446692913152[shape=rectangle, label=\"B137\"];\nn39406496739491840[shape=rectangle, label=\"B138\"];\nn38843546786070528[shape=rectangle, label=\"B139\"];\nn38280596832649216[shape=rectangle, label=\"B140\"];\nn42221246506598400[shape=rectangle, label=\"B141\"];\nn42784196460019712[shape=rectangle, label=\"B142\"];\nn43347146413441024[shape=rectangle, label=\"B143\"];\nn43628621390151680[shape=rectangle, label=\"B144\"];\nn43065671436730368[shape=rectangle, label=\"B145\"];\nn42502721483309056[shape=rectangle, label=\"B146\"];\nn41939771529887744[shape=rectangle, label=\"B147\"];\nn30399297484750848[shape=rectangle, label=\"B148\"];\nn29836347531329536[shape=rectangle, label=\"B149\"];\nn44191571343572992[shape=rectangle, label=\"B150\"];\nn44754521296994304[shape=rectangle, label=\"B151\"];\nn45317471250415616[shape=rectangle, label=\"B152\"];\nn45880421203836928[shape=rectangle, label=\"B153\"];\nn46443371157258240[shape=rectangle, label=\"B154\"];\nn47006321110679552[shape=rectangle, label=\"B155\"];\nn47569271064100864[shape=rectangle, label=\"B156\"];\nn48132221017522176[shape=rectangle, label=\"B157\"];\nn48413695994232832[shape=rectangle, label=\"B158\"];\nn47850746040811520[shape=rectangle, label=\"B159\"];\nn47287796087390208[shape=rectangle, label=\"B160\"];\nn46724846133968896[shape=rectangle, label=\"B161\"];\nn46161896180547584[shape=rectangle, label=\"B162\"];\nn45598946227126272[shape=rectangle, label=\"B163\"];\nn45035996273704960[shape=rectangle, label=\"B164\"];\nn48976645947654144[shape=rectangle, label=\"B165\"];\nn49539595901075456[shape=rectangle, label=\"B166\"];\nn50102545854496768[shape=rectangle, label=\"B167\"];\nn50384020831207424[shape=rectangle, label=\"B168\"];\nn49821070877786112[shape=rectangle, label=\"B169\"];\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn48695170970943488[shape=rectangle, label=\"B171\"];\nn44473046320283648[shape=rectangle, label=\"B172\"];\nn43910096366862336[shape=rectangle, label=\"B173\"];\nn50946970784628736[shape=rectangle, label=\"B174\"];\nn51509920738050048[shape=rectangle, label=\"B175\"];\nn52072870691471360[shape=rectangle, label=\"B176\"];\nn52635820644892672[shape=rectangle, label=\"B177\"];\nn53198770598313984[shape=rectangle, label=\"B178\"];\nn53761720551735296[shape=rectangle, label=\"B179\"];\nn54043195528445952[shape=rectangle, label=\"B180\"];\nn53480245575024640[shape=rectangle, label=\"B181\"];\nn52917295621603328[shape=rectangle, label=\"B182\"];\nn52354345668182016[shape=rectangle, label=\"B183\"];\nn51791395714760704[shape=rectangle, label=\"B184\"];\nn51228445761339392[shape=rectangle, label=\"B185\"];\nn50665495807918080[shape=rectangle, label=\"B186\"];\nn54606145481867264[shape=rectangle, label=\"B187\"];\nn55169095435288576[shape=rectangle, label=\"B188\"];\nn55732045388709888[shape=rectangle, label=\"B189\"];\nn56013520365420544[shape=rectangle, label=\"B190\"];\nn55450570411999232[shape=rectangle, label=\"B191\"];\nn54887620458577920[shape=rectangle, label=\"B192\"];\nn54324670505156608[shape=rectangle, label=\"B193\"];\nn844424930131968[shape=rectangle, label=\"B194\"];\nn281474976710656[shape=rectangle, label=\"B195\"];\nn56576470318841856[shape=rectangle, label=\"B196\"];\nn57139420272263168[shape=rectangle, label=\"B197\"];\nn57702370225684480[shape=rectangle, label=\"B198\"];\nn58265320179105792[shape=rectangle, label=\"B199\"];\nn58828270132527104[shape=rectangle, label=\"B200\"];\nn59391220085948416[shape=rectangle, label=\"B201\"];\nn59954170039369728[shape=rectangle, label=\"B202\"];\nn60517119992791040[shape=rectangle, label=\"B203\"];\nn61080069946212352[shape=rectangle, label=\"B204\"];\nn61643019899633664[shape=rectangle, label=\"B205\"];\nn62205969853054976[shape=rectangle, label=\"B206\"];\nn62768919806476288[shape=rectangle, label=\"B207\"];\nn63050394783186944[shape=rectangle, label=\"B208\"];\nn62487444829765632[shape=rectangle, label=\"B209\"];\nn61924494876344320[shape=rectangle, label=\"B210\"];\nn61361544922923008[shape=rectangle, label=\"B211\"];\nn60798594969501696[shape=rectangle, label=\"B212\"];\nn60235645016080384[shape=rectangle, label=\"B213\"];\nn59672695062659072[shape=rectangle, label=\"B214\"];\nn63613344736608256[shape=rectangle, label=\"B215\"];\nn64176294690029568[shape=rectangle, label=\"B216\"];\nn64739244643450880[shape=rectangle, label=\"B217\"];\nn65302194596872192[shape=rectangle, label=\"B218\"];\nn65583669573582848[shape=rectangle, label=\"B219\"];\nn65020719620161536[shape=rectangle, label=\"B220\"];\nn64457769666740224[shape=rectangle, label=\"B221\"];\nn63894819713318912[shape=rectangle, label=\"B222\"];\nn63331869759897600[shape=rectangle, label=\"B223\"];\nn59109745109237760[shape=rectangle, label=\"B224\"];\nn58546795155816448[shape=rectangle, label=\"B225\"];\nn66146619527004160[shape=rectangle, label=\"B226\"];\nn66709569480425472[shape=rectangle, label=\"B227\"];\nn67272519433846784[shape=rectangle, label=\"B228\"];\nn67835469387268096[shape=rectangle, label=\"B229\"];\nn68398419340689408[shape=rectangle, label=\"B230\"];\nn68961369294110720[shape=rectangle, label=\"B231\"];\nn69242844270821376[shape=rectangle, label=\"B232\"];\nn68679894317400064[shape=rectangle, label=\"B233\"];\nn68116944363978752[shape=rectangle, label=\"B234\"];\nn67553994410557440[shape=rectangle, label=\"B235\"];\nn66991044457136128[shape=rectangle, label=\"B236\"];\nn66428094503714816[shape=rectangle, label=\"B237\"];\nn65865144550293504[shape=rectangle, label=\"B238\"];\nn69805794224242688[shape=rectangle, label=\"B239\"];\nn70368744177664000[shape=rectangle, label=\"B240\"];\nn70931694131085312[shape=rectangle, label=\"B241\"];\nn71213169107795968[shape=rectangle, label=\"B242\"];\nn70650219154374656[shape=rectangle, label=\"B243\"];\nn70087269200953344[shape=rectangle, label=\"B244\"];\nn69524319247532032[shape=rectangle, label=\"B245\"];\nn57983845202395136[shape=rectangle, label=\"B246\"];\nn57420895248973824[shape=rectangle, label=\"B247\"];\nn71776119061217280[shape=rectangle, label=\"B248\"];\nn72339069014638592[shape=rectangle, label=\"B249\"];\nn72902018968059904[shape=rectangle, label=\"B250\"];\nn73464968921481216[shape=rectangle, label=\"B251\"];\nn74027918874902528[shape=rectangle, label=\"B252\"];\nn74590868828323840[shape=rectangle, label=\"B253\"];\nn75153818781745152[shape=rectangle, label=\"B254\"];\nn75716768735166464[shape=rectangle, label=\"B255\"];\nn75998243711877120[shape=rectangle, label=\"B256\"];\nn75435293758455808[shape=rectangle, label=\"B257\"];\nn74872343805034496[shape=rectangle, label=\"B258\"];\nn74309393851613184[shape=rectangle, label=\"B259\"];\nn73746443898191872[shape=rectangle, label=\"B260\"];\nn73183493944770560[shape=rectangle, label=\"B261\"];\nn72620543991349248[shape=rectangle, label=\"B262\"];\nn76561193665298432[shape=rectangle, label=\"B263\"];\nn77124143618719744[shape=rectangle, label=\"B264\"];\nn77687093572141056[shape=rectangle, label=\"B265\"];\nn77968568548851712[shape=rectangle, label=\"B266\"];\nn77405618595430400[shape=rectangle, label=\"B267\"];\nn76842668642009088[shape=rectangle, label=\"B268\"];\nn76279718688587776[shape=rectangle, label=\"B269\"];\nn72057594037927936[shape=rectangle, label=\"B270\"];\nn71494644084506624[shape=rectangle, label=\"B271\"];\nn78531518502273024[shape=rectangle, label=\"B272\"];\nn79094468455694336[shape=rectangle, label=\"B273\"];\nn79657418409115648[shape=rectangle, label=\"B274\"];\nn80220368362536960[shape=rectangle, label=\"B275\"];\nn80783318315958272[shape=rectangle, label=\"B276\"];\nn81346268269379584[shape=rectangle, label=\"B277\"];\nn81627743246090240[shape=rectangle, label=\"B278\"];\nn81064793292668928[shape=rectangle, label=\"B279\"];\nn80501843339247616[shape=rectangle, label=\"B280\"];\nn79938893385826304[shape=rectangle, label=\"B281\"];\nn79375943432404992[shape=rectangle, label=\"B282\"];\nn78812993478983680[shape=rectangle, label=\"B283\"];\nn78250043525562368[shape=rectangle, label=\"B284\"];\nn82190693199511552[shape=rectangle, label=\"B285\"];\nn82753643152932864[shape=rectangle, label=\"B286\"];\nn83316593106354176[shape=rectangle, label=\"B287\"];\nn83598068083064832[shape=rectangle, label=\"B288\"];\nn83035118129643520[shape=rectangle, label=\"B289\"];\nn82472168176222208[shape=rectangle, label=\"B290\"];\nn81909218222800896[shape=rectangle, label=\"B291\"];\nn56857945295552512[shape=rectangle, label=\"B292\"];\nn56294995342131200[shape=rectangle, label=\"B293\"];\nn84161018036486144[shape=rectangle, label=\"B294\"];\nn84723967989907456[shape=rectangle, label=\"B295\"];\nn85286917943328768[shape=rectangle, label=\"B296\"];\nn85849867896750080[shape=rectangle, label=\"B297\"];\nn86412817850171392[shape=rectangle, label=\"B298\"];\nn86975767803592704[shape=rectangle, label=\"B299\"];\nn87538717757014016[shape=rectangle, label=\"B300\"];\nn88101667710435328[shape=rectangle, label=\"B301\"];\nn88664617663856640[shape=rectangle, label=\"B302\"];\nn89227567617277952[shape=rectangle, label=\"B303\"];\nn89509042593988608[shape=rectangle, label=\"B304\"];\nn88946092640567296[shape=rectangle, label=\"B305\"];\nn88383142687145984[shape=rectangle, label=\"B306\"];\nn87820192733724672[shape=rectangle, label=\"B307\"];\nn87257242780303360[shape=rectangle, label=\"B308\"];\nn86694292826882048[shape=rectangle, label=\"B309\"];\nn86131342873460736[shape=rectangle, label=\"B310\"];\nn90071992547409920[shape=rectangle, label=\"B311\"];\nn90634942500831232[shape=rectangle, label=\"B312\"];\nn91197892454252544[shape=rectangle, label=\"B313\"];\nn91760842407673856[shape=rectangle, label=\"B314\"];\nn92042317384384512[shape=rectangle, label=\"B315\"];\nn91479367430963200[shape=rectangle, label=\"B316\"];\nn90916417477541888[shape=rectangle, label=\"B317\"];\nn90353467524120576[shape=rectangle, label=\"B318\"];\nn89790517570699264[shape=rectangle, label=\"B319\"];\nn85568392920039424[shape=rectangle, label=\"B320\"];\nn85005442966618112[shape=rectangle, label=\"B321\"];\nn92605267337805824[shape=rectangle, label=\"B322\"];\nn93168217291227136[shape=rectangle, label=\"B323\"];\nn93731167244648448[shape=rectangle, label=\"B324\"];\nn94294117198069760[shape=rectangle, label=\"B325\"];\nn94857067151491072[shape=rectangle, label=\"B326\"];\nn95420017104912384[shape=rectangle, label=\"B327\"];\nn95701492081623040[shape=rectangle, label=\"B328\"];\nn95138542128201728[shape=rectangle, label=\"B329\"];\nn94575592174780416[shape=rectangle, label=\"B330\"];\nn94012642221359104[shape=rectangle, label=\"B331\"];\nn93449692267937792[shape=rectangle, label=\"B332\"];\nn92886742314516480[shape=rectangle, label=\"B333\"];\nn92323792361095168[shape=rectangle, label=\"B334\"];\nn96264442035044352[shape=rectangle, label=\"B335\"];\nn96827391988465664[shape=rectangle, label=\"B336\"];\nn97390341941886976[shape=rectangle, label=\"B337\"];\nn97671816918597632[shape=rectangle, label=\"B338\"];\nn97108866965176320[shape=rectangle, label=\"B339\"];\nn96545917011755008[shape=rectangle, label=\"B340\"];\nn95982967058333696[shape=rectangle, label=\"B341\"];\nn84442493013196800[shape=rectangle, label=\"B342\"];\nn83879543059775488[shape=rectangle, label=\"B343\"];\nn98234766872018944[shape=rectangle, label=\"B344\"];\nn98797716825440256[shape=rectangle, label=\"B345\"];\nn99360666778861568[shape=rectangle, label=\"B346\"];\nn99923616732282880[shape=rectangle, label=\"B347\"];\nn100486566685704192[shape=rectangle, label=\"B348\"];\nn101049516639125504[shape=rectangle, label=\"B349\"];\nn101612466592546816[shape=rectangle, label=\"B350\"];\nn102175416545968128[shape=rectangle, label=\"B351\"];\nn102456891522678784[shape=rectangle, label=\"B352\"];\nn101893941569257472[shape=rectangle, label=\"B353\"];\nn101330991615836160[shape=rectangle, label=\"B354\"];\nn100768041662414848[shape=rectangle, label=\"B355\"];\nn100205091708993536[shape=rectangle, label=\"B356\"];\nn99642141755572224[shape=rectangle, label=\"B357\"];\nn99079191802150912[shape=rectangle, label=\"B358\"];\nn103019841476100096[shape=rectangle, label=\"B359\"];\nn103582791429521408[shape=rectangle, label=\"B360\"];\nn104145741382942720[shape=rectangle, label=\"B361\"];\nn104427216359653376[shape=rectangle, label=\"B362\"];\nn103864266406232064[shape=rectangle, label=\"B363\"];\nn103301316452810752[shape=rectangle, label=\"B364\"];\nn102738366499389440[shape=rectangle, label=\"B365\"];\nn98516241848729600[shape=rectangle, label=\"B366\"];\nn97953291895308288[shape=rectangle, label=\"B367\"];\nn104990166313074688[shape=rectangle, label=\"B368\"];\nn105553116266496000[shape=rectangle, label=\"B369\"];\nn106116066219917312[shape=rectangle, label=\"B370\"];\nn106679016173338624[shape=rectangle, label=\"B371\"];\nn107241966126759936[shape=rectangle, label=\"B372\"];\nn107804916080181248[shape=rectangle, label=\"B373\"];\nn108086391056891904[shape=rectangle, label=\"B374\"];\nn107523441103470592[shape=rectangle, label=\"B375\"];\nn106960491150049280[shape=rectangle, label=\"B376\"];\nn106397541196627968[shape=rectangle, label=\"B377\"];\nn105834591243206656[shape=rectangle, label=\"B378\"];\nn105271641289785344[shape=rectangle, label=\"B379\"];\nn104708691336364032[shape=rectangle, label=\"B380\"];\nn108649341010313216[shape=rectangle, label=\"B381\"];\nn109212290963734528[shape=rectangle, label=\"B382\"];\nn109775240917155840[shape=rectangle, label=\"B383\"];\nn8162774324609024[shape=rectangle, label=\"B384\"];\nn110338190870577152[shape=rectangle, label=\"B385\"];\nn110619665847287808[shape=rectangle, label=\"B386\"];\nn5910974510923776[shape=rectangle, label=\"B387\"];\nn13510798882111488[shape=rectangle, label=\"B388\"];\nn10414574138294272[shape=rectangle, label=\"B389\"];\nn110056715893866496[shape=rectangle, label=\"B390\"];\nn109493765940445184[shape=rectangle, label=\"B391\"];\nn108930815987023872[shape=rectangle, label=\"B392\"];\nn108367866033602560[shape=rectangle, label=\"B393\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n844424930131968;\nn562949953421312 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn1125899906842624 -> n1688849860263936;\nn1688849860263936 -> n1970324836974592;\nn1688849860263936 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n2814749767106560;\nn2814749767106560 -> n3096224743817216;\nn2814749767106560 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn3377699720527872 -> n3940649673949184;\nn3940649673949184 -> n4222124650659840;\nn3940649673949184 -> n4503599627370496;\nn4503599627370496 -> n4785074604081152;\nn4503599627370496 -> n5066549580791808;\nn5066549580791808 -> n5348024557502464;\nn5066549580791808 -> n5629499534213120;\nn5629499534213120 -> n5910974510923776;\nn5629499534213120 -> n6192449487634432;\nn6192449487634432 -> n6473924464345088;\nn6192449487634432 -> n6755399441055744;\nn6755399441055744 -> n7036874417766400;\nn6755399441055744 -> n7318349394477056;\nn7318349394477056 -> n7599824371187712;\nn7318349394477056 -> n7881299347898368;\nn7881299347898368 -> n8162774324609024;\nn7881299347898368 -> n8444249301319680;\nn4785074604081152 -> n8725724278030336;\nn4785074604081152 -> n9007199254740992;\nn9007199254740992 -> n9288674231451648;\nn9007199254740992 -> n9570149208162304;\nn9570149208162304 -> n9851624184872960;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n10414574138294272;\nn10133099161583616 -> n10696049115004928;\nn10696049115004928 -> n8162774324609024;\nn10696049115004928 -> n10977524091715584;\nn3659174697238528 -> n11258999068426240;\nn3659174697238528 -> n11540474045136896;\nn11540474045136896 -> n11821949021847552;\nn11540474045136896 -> n12103423998558208;\nn12103423998558208 -> n12384898975268864;\nn12103423998558208 -> n12666373951979520;\nn12666373951979520 -> n12947848928690176;\nn12666373951979520 -> n13229323905400832;\nn13229323905400832 -> n13510798882111488;\nn13229323905400832 -> n13792273858822144;\nn13792273858822144 -> n14073748835532800;\nn13792273858822144 -> n14355223812243456;\nn14355223812243456 -> n8162774324609024;\nn14355223812243456 -> n14636698788954112;\nn11258999068426240 -> n14918173765664768;\nn11258999068426240 -> n15199648742375424;\nn15199648742375424 -> n15481123719086080;\nn15199648742375424 -> n15762598695796736;\nn15762598695796736 -> n16044073672507392;\nn15762598695796736 -> n16325548649218048;\nn16325548649218048 -> n8162774324609024;\nn16325548649218048 -> n16607023625928704;\nn2533274790395904 -> n16888498602639360;\nn2533274790395904 -> n17169973579350016;\nn17169973579350016 -> n17451448556060672;\nn17169973579350016 -> n17732923532771328;\nn17732923532771328 -> n18014398509481984;\nn17732923532771328 -> n18295873486192640;\nn18295873486192640 -> n18577348462903296;\nn18295873486192640 -> n18858823439613952;\nn18858823439613952 -> n19140298416324608;\nn18858823439613952 -> n19421773393035264;\nn19421773393035264 -> n19703248369745920;\nn19421773393035264 -> n19984723346456576;\nn19984723346456576 -> n20266198323167232;\nn19984723346456576 -> n20547673299877888;\nn20547673299877888 -> n20829148276588544;\nn20547673299877888 -> n21110623253299200;\nn21110623253299200 -> n8162774324609024;\nn21110623253299200 -> n21392098230009856;\nn18014398509481984 -> n21673573206720512;\nn18014398509481984 -> n21955048183431168;\nn21955048183431168 -> n22236523160141824;\nn21955048183431168 -> n22517998136852480;\nn22517998136852480 -> n22799473113563136;\nn22517998136852480 -> n23080948090273792;\nn23080948090273792 -> n23362423066984448;\nn23080948090273792 -> n23643898043695104;\nn23643898043695104 -> n8162774324609024;\nn23643898043695104 -> n23925373020405760;\nn16888498602639360 -> n24206847997116416;\nn16888498602639360 -> n24488322973827072;\nn24488322973827072 -> n24769797950537728;\nn24488322973827072 -> n25051272927248384;\nn25051272927248384 -> n25332747903959040;\nn25051272927248384 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n26177172834091008;\nn26177172834091008 -> n26458647810801664;\nn26177172834091008 -> n26740122787512320;\nn26740122787512320 -> n27021597764222976;\nn26740122787512320 -> n27303072740933632;\nn27303072740933632 -> n8162774324609024;\nn27303072740933632 -> n27584547717644288;\nn24206847997116416 -> n27866022694354944;\nn24206847997116416 -> n28147497671065600;\nn28147497671065600 -> n28428972647776256;\nn28147497671065600 -> n28710447624486912;\nn28710447624486912 -> n28991922601197568;\nn28710447624486912 -> n29273397577908224;\nn29273397577908224 -> n8162774324609024;\nn29273397577908224 -> n29554872554618880;\nn1407374883553280 -> n29836347531329536;\nn1407374883553280 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n30962247438172160;\nn30680772461461504 -> n31243722414882816;\nn31243722414882816 -> n31525197391593472;\nn31243722414882816 -> n31806672368304128;\nn31806672368304128 -> n32088147345014784;\nn31806672368304128 -> n32369622321725440;\nn32369622321725440 -> n32651097298436096;\nn32369622321725440 -> n32932572275146752;\nn32932572275146752 -> n33214047251857408;\nn32932572275146752 -> n33495522228568064;\nn33495522228568064 -> n33776997205278720;\nn33495522228568064 -> n34058472181989376;\nn34058472181989376 -> n34339947158700032;\nn34058472181989376 -> n34621422135410688;\nn34621422135410688 -> n34902897112121344;\nn34621422135410688 -> n35184372088832000;\nn35184372088832000 -> n8162774324609024;\nn35184372088832000 -> n35465847065542656;\nn32088147345014784 -> n35747322042253312;\nn32088147345014784 -> n36028797018963968;\nn36028797018963968 -> n36310271995674624;\nn36028797018963968 -> n36591746972385280;\nn36591746972385280 -> n36873221949095936;\nn36591746972385280 -> n37154696925806592;\nn37154696925806592 -> n37436171902517248;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n8162774324609024;\nn37717646879227904 -> n37999121855938560;\nn30962247438172160 -> n38280596832649216;\nn30962247438172160 -> n38562071809359872;\nn38562071809359872 -> n38843546786070528;\nn38562071809359872 -> n39125021762781184;\nn39125021762781184 -> n39406496739491840;\nn39125021762781184 -> n39687971716202496;\nn39687971716202496 -> n39969446692913152;\nn39687971716202496 -> n40250921669623808;\nn40250921669623808 -> n40532396646334464;\nn40250921669623808 -> n40813871623045120;\nn40813871623045120 -> n41095346599755776;\nn40813871623045120 -> n41376821576466432;\nn41376821576466432 -> n8162774324609024;\nn41376821576466432 -> n41658296553177088;\nn38280596832649216 -> n41939771529887744;\nn38280596832649216 -> n42221246506598400;\nn42221246506598400 -> n42502721483309056;\nn42221246506598400 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn42784196460019712 -> n43347146413441024;\nn43347146413441024 -> n8162774324609024;\nn43347146413441024 -> n43628621390151680;\nn29836347531329536 -> n43910096366862336;\nn29836347531329536 -> n44191571343572992;\nn44191571343572992 -> n44473046320283648;\nn44191571343572992 -> n44754521296994304;\nn44754521296994304 -> n45035996273704960;\nn44754521296994304 -> n45317471250415616;\nn45317471250415616 -> n45598946227126272;\nn45317471250415616 -> n45880421203836928;\nn45880421203836928 -> n46161896180547584;\nn45880421203836928 -> n46443371157258240;\nn46443371157258240 -> n46724846133968896;\nn46443371157258240 -> n47006321110679552;\nn47006321110679552 -> n47287796087390208;\nn47006321110679552 -> n47569271064100864;\nn47569271064100864 -> n47850746040811520;\nn47569271064100864 -> n48132221017522176;\nn48132221017522176 -> n8162774324609024;\nn48132221017522176 -> n48413695994232832;\nn45035996273704960 -> n48695170970943488;\nn45035996273704960 -> n48976645947654144;\nn48976645947654144 -> n49258120924364800;\nn48976645947654144 -> n49539595901075456;\nn49539595901075456 -> n49821070877786112;\nn49539595901075456 -> n50102545854496768;\nn50102545854496768 -> n8162774324609024;\nn50102545854496768 -> n50384020831207424;\nn43910096366862336 -> n50665495807918080;\nn43910096366862336 -> n50946970784628736;\nn50946970784628736 -> n51228445761339392;\nn50946970784628736 -> n51509920738050048;\nn51509920738050048 -> n51791395714760704;\nn51509920738050048 -> n52072870691471360;\nn52072870691471360 -> n52354345668182016;\nn52072870691471360 -> n52635820644892672;\nn52635820644892672 -> n52917295621603328;\nn52635820644892672 -> n53198770598313984;\nn53198770598313984 -> n53480245575024640;\nn53198770598313984 -> n53761720551735296;\nn53761720551735296 -> n8162774324609024;\nn53761720551735296 -> n54043195528445952;\nn50665495807918080 -> n54324670505156608;\nn50665495807918080 -> n54606145481867264;\nn54606145481867264 -> n54887620458577920;\nn54606145481867264 -> n55169095435288576;\nn55169095435288576 -> n55450570411999232;\nn55169095435288576 -> n55732045388709888;\nn55732045388709888 -> n8162774324609024;\nn55732045388709888 -> n56013520365420544;\nn281474976710656 -> n56294995342131200;\nn281474976710656 -> n56576470318841856;\nn56576470318841856 -> n56857945295552512;\nn56576470318841856 -> n57139420272263168;\nn57139420272263168 -> n57420895248973824;\nn57139420272263168 -> n57702370225684480;\nn57702370225684480 -> n57983845202395136;\nn57702370225684480 -> n58265320179105792;\nn58265320179105792 -> n58546795155816448;\nn58265320179105792 -> n58828270132527104;\nn58828270132527104 -> n59109745109237760;\nn58828270132527104 -> n59391220085948416;\nn59391220085948416 -> n59672695062659072;\nn59391220085948416 -> n59954170039369728;\nn59954170039369728 -> n60235645016080384;\nn59954170039369728 -> n60517119992791040;\nn60517119992791040 -> n60798594969501696;\nn60517119992791040 -> n61080069946212352;\nn61080069946212352 -> n61361544922923008;\nn61080069946212352 -> n61643019899633664;\nn61643019899633664 -> n61924494876344320;\nn61643019899633664 -> n62205969853054976;\nn62205969853054976 -> n62487444829765632;\nn62205969853054976 -> n62768919806476288;\nn62768919806476288 -> n8162774324609024;\nn62768919806476288 -> n63050394783186944;\nn59672695062659072 -> n63331869759897600;\nn59672695062659072 -> n63613344736608256;\nn63613344736608256 -> n63894819713318912;\nn63613344736608256 -> n64176294690029568;\nn64176294690029568 -> n64457769666740224;\nn64176294690029568 -> n64739244643450880;\nn64739244643450880 -> n65020719620161536;\nn64739244643450880 -> n65302194596872192;\nn65302194596872192 -> n8162774324609024;\nn65302194596872192 -> n65583669573582848;\nn58546795155816448 -> n65865144550293504;\nn58546795155816448 -> n66146619527004160;\nn66146619527004160 -> n66428094503714816;\nn66146619527004160 -> n66709569480425472;\nn66709569480425472 -> n66991044457136128;\nn66709569480425472 -> n67272519433846784;\nn67272519433846784 -> n67553994410557440;\nn67272519433846784 -> n67835469387268096;\nn67835469387268096 -> n68116944363978752;\nn67835469387268096 -> n68398419340689408;\nn68398419340689408 -> n68679894317400064;\nn68398419340689408 -> n68961369294110720;\nn68961369294110720 -> n8162774324609024;\nn68961369294110720 -> n69242844270821376;\nn65865144550293504 -> n69524319247532032;\nn65865144550293504 -> n69805794224242688;\nn69805794224242688 -> n70087269200953344;\nn69805794224242688 -> n70368744177664000;\nn70368744177664000 -> n70650219154374656;\nn70368744177664000 -> n70931694131085312;\nn70931694131085312 -> n8162774324609024;\nn70931694131085312 -> n71213169107795968;\nn57420895248973824 -> n71494644084506624;\nn57420895248973824 -> n71776119061217280;\nn71776119061217280 -> n72057594037927936;\nn71776119061217280 -> n72339069014638592;\nn72339069014638592 -> n72620543991349248;\nn72339069014638592 -> n72902018968059904;\nn72902018968059904 -> n73183493944770560;\nn72902018968059904 -> n73464968921481216;\nn73464968921481216 -> n73746443898191872;\nn73464968921481216 -> n74027918874902528;\nn74027918874902528 -> n74309393851613184;\nn74027918874902528 -> n74590868828323840;\nn74590868828323840 -> n74872343805034496;\nn74590868828323840 -> n75153818781745152;\nn75153818781745152 -> n75435293758455808;\nn75153818781745152 -> n75716768735166464;\nn75716768735166464 -> n8162774324609024;\nn75716768735166464 -> n75998243711877120;\nn72620543991349248 -> n76279718688587776;\nn72620543991349248 -> n76561193665298432;\nn76561193665298432 -> n76842668642009088;\nn76561193665298432 -> n77124143618719744;\nn77124143618719744 -> n77405618595430400;\nn77124143618719744 -> n77687093572141056;\nn77687093572141056 -> n8162774324609024;\nn77687093572141056 -> n77968568548851712;\nn71494644084506624 -> n78250043525562368;\nn71494644084506624 -> n78531518502273024;\nn78531518502273024 -> n78812993478983680;\nn78531518502273024 -> n79094468455694336;\nn79094468455694336 -> n79375943432404992;\nn79094468455694336 -> n79657418409115648;\nn79657418409115648 -> n79938893385826304;\nn79657418409115648 -> n80220368362536960;\nn80220368362536960 -> n80501843339247616;\nn80220368362536960 -> n80783318315958272;\nn80783318315958272 -> n81064793292668928;\nn80783318315958272 -> n81346268269379584;\nn81346268269379584 -> n8162774324609024;\nn81346268269379584 -> n81627743246090240;\nn78250043525562368 -> n81909218222800896;\nn78250043525562368 -> n82190693199511552;\nn82190693199511552 -> n82472168176222208;\nn82190693199511552 -> n82753643152932864;\nn82753643152932864 -> n83035118129643520;\nn82753643152932864 -> n83316593106354176;\nn83316593106354176 -> n8162774324609024;\nn83316593106354176 -> n83598068083064832;\nn56294995342131200 -> n83879543059775488;\nn56294995342131200 -> n84161018036486144;\nn84161018036486144 -> n84442493013196800;\nn84161018036486144 -> n84723967989907456;\nn84723967989907456 -> n85005442966618112;\nn84723967989907456 -> n85286917943328768;\nn85286917943328768 -> n85568392920039424;\nn85286917943328768 -> n85849867896750080;\nn85849867896750080 -> n86131342873460736;\nn85849867896750080 -> n86412817850171392;\nn86412817850171392 -> n86694292826882048;\nn86412817850171392 -> n86975767803592704;\nn86975767803592704 -> n87257242780303360;\nn86975767803592704 -> n87538717757014016;\nn87538717757014016 -> n87820192733724672;\nn87538717757014016 -> n88101667710435328;\nn88101667710435328 -> n88383142687145984;\nn88101667710435328 -> n88664617663856640;\nn88664617663856640 -> n88946092640567296;\nn88664617663856640 -> n89227567617277952;\nn89227567617277952 -> n8162774324609024;\nn89227567617277952 -> n89509042593988608;\nn86131342873460736 -> n89790517570699264;\nn86131342873460736 -> n90071992547409920;\nn90071992547409920 -> n90353467524120576;\nn90071992547409920 -> n90634942500831232;\nn90634942500831232 -> n90916417477541888;\nn90634942500831232 -> n91197892454252544;\nn91197892454252544 -> n91479367430963200;\nn91197892454252544 -> n91760842407673856;\nn91760842407673856 -> n8162774324609024;\nn91760842407673856 -> n92042317384384512;\nn85005442966618112 -> n92323792361095168;\nn85005442966618112 -> n92605267337805824;\nn92605267337805824 -> n92886742314516480;\nn92605267337805824 -> n93168217291227136;\nn93168217291227136 -> n93449692267937792;\nn93168217291227136 -> n93731167244648448;\nn93731167244648448 -> n94012642221359104;\nn93731167244648448 -> n94294117198069760;\nn94294117198069760 -> n94575592174780416;\nn94294117198069760 -> n94857067151491072;\nn94857067151491072 -> n95138542128201728;\nn94857067151491072 -> n95420017104912384;\nn95420017104912384 -> n8162774324609024;\nn95420017104912384 -> n95701492081623040;\nn92323792361095168 -> n95982967058333696;\nn92323792361095168 -> n96264442035044352;\nn96264442035044352 -> n96545917011755008;\nn96264442035044352 -> n96827391988465664;\nn96827391988465664 -> n97108866965176320;\nn96827391988465664 -> n97390341941886976;\nn97390341941886976 -> n8162774324609024;\nn97390341941886976 -> n97671816918597632;\nn83879543059775488 -> n97953291895308288;\nn83879543059775488 -> n98234766872018944;\nn98234766872018944 -> n98516241848729600;\nn98234766872018944 -> n98797716825440256;\nn98797716825440256 -> n99079191802150912;\nn98797716825440256 -> n99360666778861568;\nn99360666778861568 -> n99642141755572224;\nn99360666778861568 -> n99923616732282880;\nn99923616732282880 -> n100205091708993536;\nn99923616732282880 -> n100486566685704192;\nn100486566685704192 -> n100768041662414848;\nn100486566685704192 -> n101049516639125504;\nn101049516639125504 -> n101330991615836160;\nn101049516639125504 -> n101612466592546816;\nn101612466592546816 -> n101893941569257472;\nn101612466592546816 -> n102175416545968128;\nn102175416545968128 -> n8162774324609024;\nn102175416545968128 -> n102456891522678784;\nn99079191802150912 -> n102738366499389440;\nn99079191802150912 -> n103019841476100096;\nn103019841476100096 -> n103301316452810752;\nn103019841476100096 -> n103582791429521408;\nn103582791429521408 -> n103864266406232064;\nn103582791429521408 -> n104145741382942720;\nn104145741382942720 -> n8162774324609024;\nn104145741382942720 -> n104427216359653376;\nn97953291895308288 -> n104708691336364032;\nn97953291895308288 -> n104990166313074688;\nn104990166313074688 -> n105271641289785344;\nn104990166313074688 -> n105553116266496000;\nn105553116266496000 -> n105834591243206656;\nn105553116266496000 -> n106116066219917312;\nn106116066219917312 -> n106397541196627968;\nn106116066219917312 -> n106679016173338624;\nn106679016173338624 -> n106960491150049280;\nn106679016173338624 -> n107241966126759936;\nn107241966126759936 -> n107523441103470592;\nn107241966126759936 -> n107804916080181248;\nn107804916080181248 -> n8162774324609024;\nn107804916080181248 -> n108086391056891904;\nn104708691336364032 -> n108367866033602560;\nn104708691336364032 -> n108649341010313216;\nn108649341010313216 -> n108930815987023872;\nn108649341010313216 -> n109212290963734528;\nn109212290963734528 -> n109493765940445184;\nn109212290963734528 -> n109775240917155840;\nn109775240917155840 -> n110056715893866496;\nn109775240917155840 -> n8162774324609024;\nn8162774324609024 -> n10414574138294272;\nn8162774324609024 -> n110338190870577152;\nn110338190870577152 -> n13510798882111488;\nn110338190870577152 -> n110619665847287808;\nn110619665847287808 -> n5910974510923776;\nn8162774324609024 -> n0[style=dotted];\nn5910974510923776 -> n0[style=dotted];\nn13510798882111488 -> n0[style=dotted];\nn10414574138294272 -> n0[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-303.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn2814749767106560[shape=rectangle, label=\"B7\"];\nn3096224743817216[shape=rectangle, label=\"B8\"];\nn3659174697238528[shape=rectangle, label=\"B9\"];\nn3940649673949184[shape=rectangle, label=\"B10\"];\nn4503599627370496[shape=rectangle, label=\"B11\"];\nn4785074604081152[shape=rectangle, label=\"B12\"];\nn5348024557502464[shape=rectangle, label=\"B13\"];\nn5629499534213120[shape=rectangle, label=\"B14\"];\nn5910974510923776[shape=rectangle, label=\"B15\"];\nn6192449487634432[shape=rectangle, label=\"B16\"];\nn6473924464345088[shape=rectangle, label=\"B17\"];\nn6755399441055744[shape=rectangle, label=\"B18\"];\nn5066549580791808[shape=rectangle, label=\"B19\"];\nn7318349394477056[shape=rectangle, label=\"B20\"];\nn7599824371187712[shape=rectangle, label=\"B21\"];\nn7881299347898368[shape=rectangle, label=\"B22\"];\nn8162774324609024[shape=rectangle, label=\"B23\"];\nn4222124650659840[shape=rectangle, label=\"B24\"];\nn8444249301319680[shape=rectangle, label=\"B25\"];\nn8725724278030336[shape=rectangle, label=\"B26\"];\nn9007199254740992[shape=rectangle, label=\"B27\"];\nn9288674231451648[shape=rectangle, label=\"B28\"];\nn9570149208162304[shape=rectangle, label=\"B29\"];\nn9851624184872960[shape=rectangle, label=\"B30\"];\nn10133099161583616[shape=rectangle, label=\"B31\"];\nn10414574138294272[shape=rectangle, label=\"B32\"];\nn10977524091715584[shape=rectangle, label=\"B33\"];\nn3377699720527872[shape=rectangle, label=\"B34\"];\nn11540474045136896[shape=rectangle, label=\"B35\"];\nn11821949021847552[shape=rectangle, label=\"B36\"];\nn12103423998558208[shape=rectangle, label=\"B37\"];\nn12384898975268864[shape=rectangle, label=\"B38\"];\nn12666373951979520[shape=rectangle, label=\"B39\"];\nn12947848928690176[shape=rectangle, label=\"B40\"];\nn13229323905400832[shape=rectangle, label=\"B41\"];\nn13510798882111488[shape=rectangle, label=\"B42\"];\nn13792273858822144[shape=rectangle, label=\"B43\"];\nn14073748835532800[shape=rectangle, label=\"B44\"];\nn14355223812243456[shape=rectangle, label=\"B45\"];\nn14636698788954112[shape=rectangle, label=\"B46\"];\nn14918173765664768[shape=rectangle, label=\"B47\"];\nn11258999068426240[shape=rectangle, label=\"B48\"];\nn15481123719086080[shape=rectangle, label=\"B49\"];\nn15199648742375424[shape=rectangle, label=\"B50\"];\nn16044073672507392[shape=rectangle, label=\"B51\"];\nn16325548649218048[shape=rectangle, label=\"B52\"];\nn16607023625928704[shape=rectangle, label=\"B53\"];\nn2533274790395904[shape=rectangle, label=\"B54\"];\nn17169973579350016[shape=rectangle, label=\"B55\"];\nn17451448556060672[shape=rectangle, label=\"B56\"];\nn18014398509481984[shape=rectangle, label=\"B57\"];\nn18295873486192640[shape=rectangle, label=\"B58\"];\nn18858823439613952[shape=rectangle, label=\"B59\"];\nn19140298416324608[shape=rectangle, label=\"B60\"];\nn26177172834091008[shape=rectangle, label=\"B61\"];\nn19421773393035264[shape=rectangle, label=\"B62\"];\nn19703248369745920[shape=rectangle, label=\"B63\"];\nn39406496739491840[shape=rectangle, label=\"B64\"];\nn19984723346456576[shape=rectangle, label=\"B65\"];\nn47569271064100864[shape=rectangle, label=\"B66\"];\nn20266198323167232[shape=rectangle, label=\"B67\"];\nn18577348462903296[shape=rectangle, label=\"B68\"];\nn20547673299877888[shape=rectangle, label=\"B69\"];\nn20829148276588544[shape=rectangle, label=\"B70\"];\nn21110623253299200[shape=rectangle, label=\"B71\"];\nn21392098230009856[shape=rectangle, label=\"B72\"];\nn17732923532771328[shape=rectangle, label=\"B73\"];\nn21955048183431168[shape=rectangle, label=\"B74\"];\nn22236523160141824[shape=rectangle, label=\"B75\"];\nn22517998136852480[shape=rectangle, label=\"B76\"];\nn41939771529887744[shape=rectangle, label=\"B77\"];\nn22799473113563136[shape=rectangle, label=\"B78\"];\nn23080948090273792[shape=rectangle, label=\"B79\"];\nn23362423066984448[shape=rectangle, label=\"B80\"];\nn21673573206720512[shape=rectangle, label=\"B81\"];\nn23643898043695104[shape=rectangle, label=\"B82\"];\nn23925373020405760[shape=rectangle, label=\"B83\"];\nn24206847997116416[shape=rectangle, label=\"B84\"];\nn16888498602639360[shape=rectangle, label=\"B85\"];\nn24769797950537728[shape=rectangle, label=\"B86\"];\nn25051272927248384[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn25895697857380352[shape=rectangle, label=\"B89\"];\nn25332747903959040[shape=rectangle, label=\"B90\"];\nn39687971716202496[shape=rectangle, label=\"B91\"];\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn45317471250415616[shape=rectangle, label=\"B93\"];\nn26740122787512320[shape=rectangle, label=\"B94\"];\nn27021597764222976[shape=rectangle, label=\"B95\"];\nn24488322973827072[shape=rectangle, label=\"B96\"];\nn27584547717644288[shape=rectangle, label=\"B97\"];\nn27866022694354944[shape=rectangle, label=\"B98\"];\nn28147497671065600[shape=rectangle, label=\"B99\"];\nn28428972647776256[shape=rectangle, label=\"B100\"];\nn28710447624486912[shape=rectangle, label=\"B101\"];\nn28991922601197568[shape=rectangle, label=\"B102\"];\nn27303072740933632[shape=rectangle, label=\"B103\"];\nn29273397577908224[shape=rectangle, label=\"B104\"];\nn1407374883553280[shape=rectangle, label=\"B105\"];\nn29836347531329536[shape=rectangle, label=\"B106\"];\nn30117822508040192[shape=rectangle, label=\"B107\"];\nn30680772461461504[shape=rectangle, label=\"B108\"];\nn30962247438172160[shape=rectangle, label=\"B109\"];\nn31525197391593472[shape=rectangle, label=\"B110\"];\nn31806672368304128[shape=rectangle, label=\"B111\"];\nn32088147345014784[shape=rectangle, label=\"B112\"];\nn32369622321725440[shape=rectangle, label=\"B113\"];\nn32651097298436096[shape=rectangle, label=\"B114\"];\nn32932572275146752[shape=rectangle, label=\"B115\"];\nn33214047251857408[shape=rectangle, label=\"B116\"];\nn33495522228568064[shape=rectangle, label=\"B117\"];\nn33776997205278720[shape=rectangle, label=\"B118\"];\nn34058472181989376[shape=rectangle, label=\"B119\"];\nn34339947158700032[shape=rectangle, label=\"B120\"];\nn34621422135410688[shape=rectangle, label=\"B121\"];\nn34902897112121344[shape=rectangle, label=\"B122\"];\nn31243722414882816[shape=rectangle, label=\"B123\"];\nn35465847065542656[shape=rectangle, label=\"B124\"];\nn15762598695796736[shape=rectangle, label=\"B125\"];\nn35747322042253312[shape=rectangle, label=\"B126\"];\nn36028797018963968[shape=rectangle, label=\"B127\"];\nn35184372088832000[shape=rectangle, label=\"B128\"];\nn36310271995674624[shape=rectangle, label=\"B129\"];\nn36591746972385280[shape=rectangle, label=\"B130\"];\nn36873221949095936[shape=rectangle, label=\"B131\"];\nn30399297484750848[shape=rectangle, label=\"B132\"];\nn37436171902517248[shape=rectangle, label=\"B133\"];\nn37717646879227904[shape=rectangle, label=\"B134\"];\nn38280596832649216[shape=rectangle, label=\"B135\"];\nn38562071809359872[shape=rectangle, label=\"B136\"];\nn38843546786070528[shape=rectangle, label=\"B137\"];\nn39125021762781184[shape=rectangle, label=\"B138\"];\nn37999121855938560[shape=rectangle, label=\"B139\"];\nn37154696925806592[shape=rectangle, label=\"B140\"];\nn40250921669623808[shape=rectangle, label=\"B141\"];\nn40532396646334464[shape=rectangle, label=\"B142\"];\nn40813871623045120[shape=rectangle, label=\"B143\"];\nn41095346599755776[shape=rectangle, label=\"B144\"];\nn41376821576466432[shape=rectangle, label=\"B145\"];\nn41658296553177088[shape=rectangle, label=\"B146\"];\nn39969446692913152[shape=rectangle, label=\"B147\"];\nn29554872554618880[shape=rectangle, label=\"B148\"];\nn42502721483309056[shape=rectangle, label=\"B149\"];\nn42784196460019712[shape=rectangle, label=\"B150\"];\nn43347146413441024[shape=rectangle, label=\"B151\"];\nn43628621390151680[shape=rectangle, label=\"B152\"];\nn44191571343572992[shape=rectangle, label=\"B153\"];\nn44473046320283648[shape=rectangle, label=\"B154\"];\nn44754521296994304[shape=rectangle, label=\"B155\"];\nn45035996273704960[shape=rectangle, label=\"B156\"];\nn43910096366862336[shape=rectangle, label=\"B157\"];\nn45598946227126272[shape=rectangle, label=\"B158\"];\nn43065671436730368[shape=rectangle, label=\"B159\"];\nn46161896180547584[shape=rectangle, label=\"B160\"];\nn46443371157258240[shape=rectangle, label=\"B161\"];\nn46724846133968896[shape=rectangle, label=\"B162\"];\nn47006321110679552[shape=rectangle, label=\"B163\"];\nn47287796087390208[shape=rectangle, label=\"B164\"];\nn45880421203836928[shape=rectangle, label=\"B165\"];\nn47850746040811520[shape=rectangle, label=\"B166\"];\nn48132221017522176[shape=rectangle, label=\"B167\"];\nn48413695994232832[shape=rectangle, label=\"B168\"];\nn42221246506598400[shape=rectangle, label=\"B169\"];\nn48695170970943488[shape=rectangle, label=\"B170\"];\nn48976645947654144[shape=rectangle, label=\"B171\"];\nn49258120924364800[shape=rectangle, label=\"B172\"];\nn49539595901075456[shape=rectangle, label=\"B173\"];\nn49821070877786112[shape=rectangle, label=\"B174\"];\nn50102545854496768[shape=rectangle, label=\"B175\"];\nn50384020831207424[shape=rectangle, label=\"B176\"];\nn50665495807918080[shape=rectangle, label=\"B177\"];\nn50946970784628736[shape=rectangle, label=\"B178\"];\nn51228445761339392[shape=rectangle, label=\"B179\"];\nn51509920738050048[shape=rectangle, label=\"B180\"];\nn51791395714760704[shape=rectangle, label=\"B181\"];\nn52072870691471360[shape=rectangle, label=\"B182\"];\nn52354345668182016[shape=rectangle, label=\"B183\"];\nn52635820644892672[shape=rectangle, label=\"B184\"];\nn52917295621603328[shape=rectangle, label=\"B185\"];\nn53198770598313984[shape=rectangle, label=\"B186\"];\nn53480245575024640[shape=rectangle, label=\"B187\"];\nn53761720551735296[shape=rectangle, label=\"B188\"];\nn54043195528445952[shape=rectangle, label=\"B189\"];\nn7036874417766400[shape=rectangle, label=\"B190\"];\nn10696049115004928[shape=rectangle, label=\"B191\"];\nn54324670505156608[shape=rectangle, label=\"B192\"];\nn1970324836974592[shape=rectangle, label=\"B193\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n844424930131968;\nn844424930131968 -> n1407374883553280;\nn844424930131968 -> n1688849860263936;\nn1688849860263936 -> n1970324836974592;\nn1688849860263936 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n2814749767106560;\nn2814749767106560 -> n1970324836974592;\nn2814749767106560 -> n3096224743817216;\nn3096224743817216 -> n3377699720527872;\nn3096224743817216 -> n3659174697238528;\nn3659174697238528 -> n1970324836974592;\nn3659174697238528 -> n3940649673949184;\nn3940649673949184 -> n4222124650659840;\nn3940649673949184 -> n4503599627370496;\nn4503599627370496 -> n1970324836974592;\nn4503599627370496 -> n4785074604081152;\nn4785074604081152 -> n5066549580791808;\nn4785074604081152 -> n5348024557502464;\nn5348024557502464 -> n1970324836974592;\nn5348024557502464 -> n5629499534213120;\nn5629499534213120 -> n1970324836974592;\nn5629499534213120 -> n5910974510923776;\nn5910974510923776 -> n1970324836974592;\nn5910974510923776 -> n6192449487634432;\nn6192449487634432 -> n1970324836974592;\nn6192449487634432 -> n6473924464345088;\nn6473924464345088 -> n1970324836974592;\nn6473924464345088 -> n6755399441055744;\nn6755399441055744 -> n7036874417766400;\nn5066549580791808 -> n1970324836974592;\nn5066549580791808 -> n7318349394477056;\nn7318349394477056 -> n1970324836974592;\nn7318349394477056 -> n7599824371187712;\nn7599824371187712 -> n1970324836974592;\nn7599824371187712 -> n7881299347898368;\nn7881299347898368 -> n1970324836974592;\nn7881299347898368 -> n8162774324609024;\nn8162774324609024 -> n7036874417766400;\nn4222124650659840 -> n1970324836974592;\nn4222124650659840 -> n8444249301319680;\nn8444249301319680 -> n1970324836974592;\nn8444249301319680 -> n8725724278030336;\nn8725724278030336 -> n1970324836974592;\nn8725724278030336 -> n9007199254740992;\nn9007199254740992 -> n1970324836974592;\nn9007199254740992 -> n9288674231451648;\nn9288674231451648 -> n1970324836974592;\nn9288674231451648 -> n9570149208162304;\nn9570149208162304 -> n1970324836974592;\nn9570149208162304 -> n9851624184872960;\nn9851624184872960 -> n1970324836974592;\nn9851624184872960 -> n10133099161583616;\nn10133099161583616 -> n1970324836974592;\nn10133099161583616 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10977524091715584;\nn3377699720527872 -> n11258999068426240;\nn3377699720527872 -> n11540474045136896;\nn11540474045136896 -> n1970324836974592;\nn11540474045136896 -> n11821949021847552;\nn11821949021847552 -> n1970324836974592;\nn11821949021847552 -> n12103423998558208;\nn12103423998558208 -> n1970324836974592;\nn12103423998558208 -> n12384898975268864;\nn12384898975268864 -> n1970324836974592;\nn12384898975268864 -> n12666373951979520;\nn12666373951979520 -> n1970324836974592;\nn12666373951979520 -> n12947848928690176;\nn12947848928690176 -> n1970324836974592;\nn12947848928690176 -> n13229323905400832;\nn13229323905400832 -> n1970324836974592;\nn13229323905400832 -> n13510798882111488;\nn13510798882111488 -> n1970324836974592;\nn13510798882111488 -> n13792273858822144;\nn13792273858822144 -> n1970324836974592;\nn13792273858822144 -> n14073748835532800;\nn14073748835532800 -> n1970324836974592;\nn14073748835532800 -> n14355223812243456;\nn14355223812243456 -> n1970324836974592;\nn14355223812243456 -> n14636698788954112;\nn14636698788954112 -> n10696049115004928;\nn14636698788954112 -> n14918173765664768;\nn11258999068426240 -> n15199648742375424;\nn11258999068426240 -> n15481123719086080;\nn15481123719086080 -> n15762598695796736;\nn15199648742375424 -> n1970324836974592;\nn15199648742375424 -> n16044073672507392;\nn16044073672507392 -> n1970324836974592;\nn16044073672507392 -> n16325548649218048;\nn16325548649218048 -> n1970324836974592;\nn16325548649218048 -> n16607023625928704;\nn16607023625928704 -> n7036874417766400;\nn2533274790395904 -> n16888498602639360;\nn2533274790395904 -> n17169973579350016;\nn17169973579350016 -> n1970324836974592;\nn17169973579350016 -> n17451448556060672;\nn17451448556060672 -> n17732923532771328;\nn17451448556060672 -> n18014398509481984;\nn18014398509481984 -> n1970324836974592;\nn18014398509481984 -> n18295873486192640;\nn18295873486192640 -> n18577348462903296;\nn18295873486192640 -> n18858823439613952;\nn18858823439613952 -> n1970324836974592;\nn18858823439613952 -> n19140298416324608;\nn19140298416324608 -> n26177172834091008;\nn26177172834091008 -> n1970324836974592;\nn26177172834091008 -> n19421773393035264;\nn19421773393035264 -> n1970324836974592;\nn19421773393035264 -> n19703248369745920;\nn19703248369745920 -> n39406496739491840;\nn39406496739491840 -> n1970324836974592;\nn39406496739491840 -> n19984723346456576;\nn19984723346456576 -> n47569271064100864;\nn47569271064100864 -> n1970324836974592;\nn47569271064100864 -> n20266198323167232;\nn20266198323167232 -> n7036874417766400;\nn18577348462903296 -> n1970324836974592;\nn18577348462903296 -> n20547673299877888;\nn20547673299877888 -> n1970324836974592;\nn20547673299877888 -> n20829148276588544;\nn20829148276588544 -> n1970324836974592;\nn20829148276588544 -> n21110623253299200;\nn21110623253299200 -> n1970324836974592;\nn21110623253299200 -> n21392098230009856;\nn21392098230009856 -> n7036874417766400;\nn17732923532771328 -> n21673573206720512;\nn17732923532771328 -> n21955048183431168;\nn21955048183431168 -> n1970324836974592;\nn21955048183431168 -> n22236523160141824;\nn22236523160141824 -> n1970324836974592;\nn22236523160141824 -> n22517998136852480;\nn22517998136852480 -> n41939771529887744;\nn41939771529887744 -> n1970324836974592;\nn41939771529887744 -> n22799473113563136;\nn22799473113563136 -> n1970324836974592;\nn22799473113563136 -> n23080948090273792;\nn23080948090273792 -> n1970324836974592;\nn23080948090273792 -> n23362423066984448;\nn23362423066984448 -> n7036874417766400;\nn21673573206720512 -> n1970324836974592;\nn21673573206720512 -> n23643898043695104;\nn23643898043695104 -> n1970324836974592;\nn23643898043695104 -> n23925373020405760;\nn23925373020405760 -> n1970324836974592;\nn23925373020405760 -> n24206847997116416;\nn24206847997116416 -> n7036874417766400;\nn16888498602639360 -> n24488322973827072;\nn16888498602639360 -> n24769797950537728;\nn24769797950537728 -> n1970324836974592;\nn24769797950537728 -> n25051272927248384;\nn25051272927248384 -> n25332747903959040;\nn25051272927248384 -> n25614222880669696;\nn25614222880669696 -> n1970324836974592;\nn25614222880669696 -> n25895697857380352;\nn25895697857380352 -> n26177172834091008;\nn25332747903959040 -> n39687971716202496;\nn39687971716202496 -> n1970324836974592;\nn39687971716202496 -> n26458647810801664;\nn26458647810801664 -> n45317471250415616;\nn45317471250415616 -> n1970324836974592;\nn45317471250415616 -> n26740122787512320;\nn26740122787512320 -> n1970324836974592;\nn26740122787512320 -> n27021597764222976;\nn27021597764222976 -> n7036874417766400;\nn24488322973827072 -> n27303072740933632;\nn24488322973827072 -> n27584547717644288;\nn27584547717644288 -> n1970324836974592;\nn27584547717644288 -> n27866022694354944;\nn27866022694354944 -> n1970324836974592;\nn27866022694354944 -> n28147497671065600;\nn28147497671065600 -> n1970324836974592;\nn28147497671065600 -> n28428972647776256;\nn28428972647776256 -> n1970324836974592;\nn28428972647776256 -> n28710447624486912;\nn28710447624486912 -> n1970324836974592;\nn28710447624486912 -> n28991922601197568;\nn28991922601197568 -> n7036874417766400;\nn27303072740933632 -> n10696049115004928;\nn27303072740933632 -> n29273397577908224;\nn1407374883553280 -> n29554872554618880;\nn1407374883553280 -> n29836347531329536;\nn29836347531329536 -> n1970324836974592;\nn29836347531329536 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n1970324836974592;\nn30680772461461504 -> n30962247438172160;\nn30962247438172160 -> n31243722414882816;\nn30962247438172160 -> n31525197391593472;\nn31525197391593472 -> n1970324836974592;\nn31525197391593472 -> n31806672368304128;\nn31806672368304128 -> n1970324836974592;\nn31806672368304128 -> n32088147345014784;\nn32088147345014784 -> n1970324836974592;\nn32088147345014784 -> n32369622321725440;\nn32369622321725440 -> n1970324836974592;\nn32369622321725440 -> n32651097298436096;\nn32651097298436096 -> n1970324836974592;\nn32651097298436096 -> n32932572275146752;\nn32932572275146752 -> n1970324836974592;\nn32932572275146752 -> n33214047251857408;\nn33214047251857408 -> n1970324836974592;\nn33214047251857408 -> n33495522228568064;\nn33495522228568064 -> n1970324836974592;\nn33495522228568064 -> n33776997205278720;\nn33776997205278720 -> n1970324836974592;\nn33776997205278720 -> n34058472181989376;\nn34058472181989376 -> n1970324836974592;\nn34058472181989376 -> n34339947158700032;\nn34339947158700032 -> n1970324836974592;\nn34339947158700032 -> n34621422135410688;\nn34621422135410688 -> n10696049115004928;\nn34621422135410688 -> n34902897112121344;\nn31243722414882816 -> n35184372088832000;\nn31243722414882816 -> n35465847065542656;\nn35465847065542656 -> n15762598695796736;\nn15762598695796736 -> n10696049115004928;\nn15762598695796736 -> n35747322042253312;\nn35747322042253312 -> n10696049115004928;\nn35747322042253312 -> n36028797018963968;\nn35184372088832000 -> n1970324836974592;\nn35184372088832000 -> n36310271995674624;\nn36310271995674624 -> n1970324836974592;\nn36310271995674624 -> n36591746972385280;\nn36591746972385280 -> n1970324836974592;\nn36591746972385280 -> n36873221949095936;\nn36873221949095936 -> n7036874417766400;\nn30399297484750848 -> n37154696925806592;\nn30399297484750848 -> n37436171902517248;\nn37436171902517248 -> n1970324836974592;\nn37436171902517248 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37717646879227904 -> n38280596832649216;\nn38280596832649216 -> n1970324836974592;\nn38280596832649216 -> n38562071809359872;\nn38562071809359872 -> n1970324836974592;\nn38562071809359872 -> n38843546786070528;\nn38843546786070528 -> n1970324836974592;\nn38843546786070528 -> n39125021762781184;\nn39125021762781184 -> n39406496739491840;\nn37999121855938560 -> n39687971716202496;\nn37154696925806592 -> n39969446692913152;\nn37154696925806592 -> n40250921669623808;\nn40250921669623808 -> n1970324836974592;\nn40250921669623808 -> n40532396646334464;\nn40532396646334464 -> n1970324836974592;\nn40532396646334464 -> n40813871623045120;\nn40813871623045120 -> n1970324836974592;\nn40813871623045120 -> n41095346599755776;\nn41095346599755776 -> n1970324836974592;\nn41095346599755776 -> n41376821576466432;\nn41376821576466432 -> n1970324836974592;\nn41376821576466432 -> n41658296553177088;\nn41658296553177088 -> n7036874417766400;\nn39969446692913152 -> n41939771529887744;\nn29554872554618880 -> n42221246506598400;\nn29554872554618880 -> n42502721483309056;\nn42502721483309056 -> n1970324836974592;\nn42502721483309056 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn42784196460019712 -> n43347146413441024;\nn43347146413441024 -> n1970324836974592;\nn43347146413441024 -> n43628621390151680;\nn43628621390151680 -> n43910096366862336;\nn43628621390151680 -> n44191571343572992;\nn44191571343572992 -> n1970324836974592;\nn44191571343572992 -> n44473046320283648;\nn44473046320283648 -> n1970324836974592;\nn44473046320283648 -> n44754521296994304;\nn44754521296994304 -> n1970324836974592;\nn44754521296994304 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn43910096366862336 -> n1970324836974592;\nn43910096366862336 -> n45598946227126272;\nn45598946227126272 -> n39687971716202496;\nn43065671436730368 -> n45880421203836928;\nn43065671436730368 -> n46161896180547584;\nn46161896180547584 -> n1970324836974592;\nn46161896180547584 -> n46443371157258240;\nn46443371157258240 -> n1970324836974592;\nn46443371157258240 -> n46724846133968896;\nn46724846133968896 -> n1970324836974592;\nn46724846133968896 -> n47006321110679552;\nn47006321110679552 -> n1970324836974592;\nn47006321110679552 -> n47287796087390208;\nn47287796087390208 -> n47569271064100864;\nn45880421203836928 -> n1970324836974592;\nn45880421203836928 -> n47850746040811520;\nn47850746040811520 -> n1970324836974592;\nn47850746040811520 -> n48132221017522176;\nn48132221017522176 -> n1970324836974592;\nn48132221017522176 -> n48413695994232832;\nn48413695994232832 -> n7036874417766400;\nn42221246506598400 -> n1970324836974592;\nn42221246506598400 -> n48695170970943488;\nn48695170970943488 -> n1970324836974592;\nn48695170970943488 -> n48976645947654144;\nn48976645947654144 -> n1970324836974592;\nn48976645947654144 -> n49258120924364800;\nn49258120924364800 -> n1970324836974592;\nn49258120924364800 -> n49539595901075456;\nn49539595901075456 -> n1970324836974592;\nn49539595901075456 -> n49821070877786112;\nn49821070877786112 -> n1970324836974592;\nn49821070877786112 -> n50102545854496768;\nn50102545854496768 -> n1970324836974592;\nn50102545854496768 -> n50384020831207424;\nn50384020831207424 -> n1970324836974592;\nn50384020831207424 -> n50665495807918080;\nn50665495807918080 -> n1970324836974592;\nn50665495807918080 -> n50946970784628736;\nn50946970784628736 -> n1970324836974592;\nn50946970784628736 -> n51228445761339392;\nn51228445761339392 -> n1970324836974592;\nn51228445761339392 -> n51509920738050048;\nn51509920738050048 -> n1970324836974592;\nn51509920738050048 -> n51791395714760704;\nn51791395714760704 -> n1970324836974592;\nn51791395714760704 -> n52072870691471360;\nn52072870691471360 -> n1970324836974592;\nn52072870691471360 -> n52354345668182016;\nn52354345668182016 -> n1970324836974592;\nn52354345668182016 -> n52635820644892672;\nn52635820644892672 -> n1970324836974592;\nn52635820644892672 -> n52917295621603328;\nn52917295621603328 -> n1970324836974592;\nn52917295621603328 -> n53198770598313984;\nn53198770598313984 -> n1970324836974592;\nn53198770598313984 -> n53480245575024640;\nn53480245575024640 -> n1970324836974592;\nn53480245575024640 -> n53761720551735296;\nn53761720551735296 -> n1970324836974592;\nn53761720551735296 -> n54043195528445952;\nn54043195528445952 -> n7036874417766400;\nn7036874417766400 -> n1970324836974592;\nn7036874417766400 -> n10696049115004928;\nn10696049115004928 -> n1970324836974592;\nn10696049115004928 -> n54324670505156608;\nn54324670505156608 -> n1970324836974592;\nn281474976710656 -> n0[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\nn26177172834091008 -> n2533274790395904[style=dotted];\nn39406496739491840 -> n844424930131968[style=dotted];\nn47569271064100864 -> n844424930131968[style=dotted];\nn41939771529887744 -> n844424930131968[style=dotted];\nn39687971716202496 -> n844424930131968[style=dotted];\nn45317471250415616 -> n844424930131968[style=dotted];\nn15762598695796736 -> n844424930131968[style=dotted];\nn7036874417766400 -> n844424930131968[style=dotted];\nn10696049115004928 -> n844424930131968[style=dotted];\nn1970324836974592 -> n844424930131968[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-3219.txt",
    "content": "digraph {\n\nmaxiter=8;\n        \nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn240661105087610880[shape=rectangle, label=\"B3\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1970324836974592[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn2814749767106560[shape=rectangle, label=\"B7\"];\nn3377699720527872[shape=rectangle, label=\"B8\"];\nn2533274790395904[shape=rectangle, label=\"B9\"];\nn4222124650659840[shape=rectangle, label=\"B10\"];\nn4503599627370496[shape=rectangle, label=\"B11\"];\nn3096224743817216[shape=rectangle, label=\"B12\"];\nn5348024557502464[shape=rectangle, label=\"B13\"];\nn5066549580791808[shape=rectangle, label=\"B14\"];\nn5629499534213120[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn3940649673949184[shape=rectangle, label=\"B17\"];\nn6192449487634432[shape=rectangle, label=\"B18\"];\nn6473924464345088[shape=rectangle, label=\"B19\"];\nn5910974510923776[shape=rectangle, label=\"B20\"];\nn7036874417766400[shape=rectangle, label=\"B21\"];\nn6755399441055744[shape=rectangle, label=\"B22\"];\nn3659174697238528[shape=rectangle, label=\"B23\"];\nn1688849860263936[shape=rectangle, label=\"B24\"];\nn7599824371187712[shape=rectangle, label=\"B25\"];\nn8162774324609024[shape=rectangle, label=\"B26\"];\nn8725724278030336[shape=rectangle, label=\"B27\"];\nn9007199254740992[shape=rectangle, label=\"B28\"];\nn9288674231451648[shape=rectangle, label=\"B29\"];\nn7318349394477056[shape=rectangle, label=\"B30\"];\nn10133099161583616[shape=rectangle, label=\"B31\"];\nn10696049115004928[shape=rectangle, label=\"B32\"];\nn10977524091715584[shape=rectangle, label=\"B33\"];\nn11258999068426240[shape=rectangle, label=\"B34\"];\nn7881299347898368[shape=rectangle, label=\"B35\"];\nn12103423998558208[shape=rectangle, label=\"B36\"];\nn12666373951979520[shape=rectangle, label=\"B37\"];\nn12947848928690176[shape=rectangle, label=\"B38\"];\nn13229323905400832[shape=rectangle, label=\"B39\"];\nn9851624184872960[shape=rectangle, label=\"B40\"];\nn14073748835532800[shape=rectangle, label=\"B41\"];\nn14636698788954112[shape=rectangle, label=\"B42\"];\nn14918173765664768[shape=rectangle, label=\"B43\"];\nn15199648742375424[shape=rectangle, label=\"B44\"];\nn8444249301319680[shape=rectangle, label=\"B45\"];\nn9570149208162304[shape=rectangle, label=\"B46\"];\nn16044073672507392[shape=rectangle, label=\"B47\"];\nn17451448556060672[shape=rectangle, label=\"B48\"];\nn16607023625928704[shape=rectangle, label=\"B49\"];\nn17169973579350016[shape=rectangle, label=\"B50\"];\nn17732923532771328[shape=rectangle, label=\"B51\"];\nn10414574138294272[shape=rectangle, label=\"B52\"];\nn11540474045136896[shape=rectangle, label=\"B53\"];\nn18295873486192640[shape=rectangle, label=\"B54\"];\nn19703248369745920[shape=rectangle, label=\"B55\"];\nn18858823439613952[shape=rectangle, label=\"B56\"];\nn19421773393035264[shape=rectangle, label=\"B57\"];\nn19984723346456576[shape=rectangle, label=\"B58\"];\nn11821949021847552[shape=rectangle, label=\"B59\"];\nn20547673299877888[shape=rectangle, label=\"B60\"];\nn20829148276588544[shape=rectangle, label=\"B61\"];\nn21110623253299200[shape=rectangle, label=\"B62\"];\nn13792273858822144[shape=rectangle, label=\"B63\"];\nn21955048183431168[shape=rectangle, label=\"B64\"];\nn22236523160141824[shape=rectangle, label=\"B65\"];\nn22517998136852480[shape=rectangle, label=\"B66\"];\nn15762598695796736[shape=rectangle, label=\"B67\"];\nn18014398509481984[shape=rectangle, label=\"B68\"];\nn16325548649218048[shape=rectangle, label=\"B69\"];\nn16888498602639360[shape=rectangle, label=\"B70\"];\nn23080948090273792[shape=rectangle, label=\"B71\"];\nn23925373020405760[shape=rectangle, label=\"B72\"];\nn24488322973827072[shape=rectangle, label=\"B73\"];\nn24206847997116416[shape=rectangle, label=\"B74\"];\nn25051272927248384[shape=rectangle, label=\"B75\"];\nn25614222880669696[shape=rectangle, label=\"B76\"];\nn26177172834091008[shape=rectangle, label=\"B77\"];\nn25332747903959040[shape=rectangle, label=\"B78\"];\nn27021597764222976[shape=rectangle, label=\"B79\"];\nn27303072740933632[shape=rectangle, label=\"B80\"];\nn25895697857380352[shape=rectangle, label=\"B81\"];\nn28147497671065600[shape=rectangle, label=\"B82\"];\nn27866022694354944[shape=rectangle, label=\"B83\"];\nn28428972647776256[shape=rectangle, label=\"B84\"];\nn27584547717644288[shape=rectangle, label=\"B85\"];\nn26740122787512320[shape=rectangle, label=\"B86\"];\nn28991922601197568[shape=rectangle, label=\"B87\"];\nn29273397577908224[shape=rectangle, label=\"B88\"];\nn28710447624486912[shape=rectangle, label=\"B89\"];\nn29836347531329536[shape=rectangle, label=\"B90\"];\nn29554872554618880[shape=rectangle, label=\"B91\"];\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn30117822508040192[shape=rectangle, label=\"B93\"];\nn30399297484750848[shape=rectangle, label=\"B94\"];\nn18577348462903296[shape=rectangle, label=\"B95\"];\nn19140298416324608[shape=rectangle, label=\"B96\"];\nn23362423066984448[shape=rectangle, label=\"B97\"];\nn30680772461461504[shape=rectangle, label=\"B98\"];\nn31243722414882816[shape=rectangle, label=\"B99\"];\nn30962247438172160[shape=rectangle, label=\"B100\"];\nn31525197391593472[shape=rectangle, label=\"B101\"];\nn32088147345014784[shape=rectangle, label=\"B102\"];\nn32651097298436096[shape=rectangle, label=\"B103\"];\nn31806672368304128[shape=rectangle, label=\"B104\"];\nn33495522228568064[shape=rectangle, label=\"B105\"];\nn33776997205278720[shape=rectangle, label=\"B106\"];\nn32369622321725440[shape=rectangle, label=\"B107\"];\nn34621422135410688[shape=rectangle, label=\"B108\"];\nn34339947158700032[shape=rectangle, label=\"B109\"];\nn34902897112121344[shape=rectangle, label=\"B110\"];\nn34058472181989376[shape=rectangle, label=\"B111\"];\nn33214047251857408[shape=rectangle, label=\"B112\"];\nn35465847065542656[shape=rectangle, label=\"B113\"];\nn35747322042253312[shape=rectangle, label=\"B114\"];\nn35184372088832000[shape=rectangle, label=\"B115\"];\nn36310271995674624[shape=rectangle, label=\"B116\"];\nn36028797018963968[shape=rectangle, label=\"B117\"];\nn32932572275146752[shape=rectangle, label=\"B118\"];\nn36591746972385280[shape=rectangle, label=\"B119\"];\nn36873221949095936[shape=rectangle, label=\"B120\"];\nn12384898975268864[shape=rectangle, label=\"B121\"];\nn13510798882111488[shape=rectangle, label=\"B122\"];\nn37436171902517248[shape=rectangle, label=\"B123\"];\nn38843546786070528[shape=rectangle, label=\"B124\"];\nn37999121855938560[shape=rectangle, label=\"B125\"];\nn38562071809359872[shape=rectangle, label=\"B126\"];\nn39125021762781184[shape=rectangle, label=\"B127\"];\nn14355223812243456[shape=rectangle, label=\"B128\"];\nn15481123719086080[shape=rectangle, label=\"B129\"];\nn39687971716202496[shape=rectangle, label=\"B130\"];\nn41095346599755776[shape=rectangle, label=\"B131\"];\nn40250921669623808[shape=rectangle, label=\"B132\"];\nn40813871623045120[shape=rectangle, label=\"B133\"];\nn41376821576466432[shape=rectangle, label=\"B134\"];\nn20266198323167232[shape=rectangle, label=\"B135\"];\nn21392098230009856[shape=rectangle, label=\"B136\"];\nn41939771529887744[shape=rectangle, label=\"B137\"];\nn43347146413441024[shape=rectangle, label=\"B138\"];\nn42502721483309056[shape=rectangle, label=\"B139\"];\nn43065671436730368[shape=rectangle, label=\"B140\"];\nn43628621390151680[shape=rectangle, label=\"B141\"];\nn21673573206720512[shape=rectangle, label=\"B142\"];\nn22799473113563136[shape=rectangle, label=\"B143\"];\nn44191571343572992[shape=rectangle, label=\"B144\"];\nn45598946227126272[shape=rectangle, label=\"B145\"];\nn44754521296994304[shape=rectangle, label=\"B146\"];\nn45317471250415616[shape=rectangle, label=\"B147\"];\nn45880421203836928[shape=rectangle, label=\"B148\"];\nn37154696925806592[shape=rectangle, label=\"B149\"];\nn39406496739491840[shape=rectangle, label=\"B150\"];\nn41658296553177088[shape=rectangle, label=\"B151\"];\nn43910096366862336[shape=rectangle, label=\"B152\"];\nn37717646879227904[shape=rectangle, label=\"B153\"];\nn38280596832649216[shape=rectangle, label=\"B154\"];\nn46161896180547584[shape=rectangle, label=\"B155\"];\nn47287796087390208[shape=rectangle, label=\"B156\"];\nn47850746040811520[shape=rectangle, label=\"B157\"];\nn47569271064100864[shape=rectangle, label=\"B158\"];\nn48132221017522176[shape=rectangle, label=\"B159\"];\nn48695170970943488[shape=rectangle, label=\"B160\"];\nn49258120924364800[shape=rectangle, label=\"B161\"];\nn48413695994232832[shape=rectangle, label=\"B162\"];\nn50102545854496768[shape=rectangle, label=\"B163\"];\nn50384020831207424[shape=rectangle, label=\"B164\"];\nn48976645947654144[shape=rectangle, label=\"B165\"];\nn51228445761339392[shape=rectangle, label=\"B166\"];\nn50946970784628736[shape=rectangle, label=\"B167\"];\nn51509920738050048[shape=rectangle, label=\"B168\"];\nn50665495807918080[shape=rectangle, label=\"B169\"];\nn49821070877786112[shape=rectangle, label=\"B170\"];\nn52072870691471360[shape=rectangle, label=\"B171\"];\nn52354345668182016[shape=rectangle, label=\"B172\"];\nn51791395714760704[shape=rectangle, label=\"B173\"];\nn52917295621603328[shape=rectangle, label=\"B174\"];\nn52635820644892672[shape=rectangle, label=\"B175\"];\nn49539595901075456[shape=rectangle, label=\"B176\"];\nn53198770598313984[shape=rectangle, label=\"B177\"];\nn53480245575024640[shape=rectangle, label=\"B178\"];\nn39969446692913152[shape=rectangle, label=\"B179\"];\nn40532396646334464[shape=rectangle, label=\"B180\"];\nn46443371157258240[shape=rectangle, label=\"B181\"];\nn53761720551735296[shape=rectangle, label=\"B182\"];\nn54324670505156608[shape=rectangle, label=\"B183\"];\nn54043195528445952[shape=rectangle, label=\"B184\"];\nn54606145481867264[shape=rectangle, label=\"B185\"];\nn55169095435288576[shape=rectangle, label=\"B186\"];\nn55732045388709888[shape=rectangle, label=\"B187\"];\nn54887620458577920[shape=rectangle, label=\"B188\"];\nn56576470318841856[shape=rectangle, label=\"B189\"];\nn56857945295552512[shape=rectangle, label=\"B190\"];\nn55450570411999232[shape=rectangle, label=\"B191\"];\nn57702370225684480[shape=rectangle, label=\"B192\"];\nn57420895248973824[shape=rectangle, label=\"B193\"];\nn57983845202395136[shape=rectangle, label=\"B194\"];\nn57139420272263168[shape=rectangle, label=\"B195\"];\nn56294995342131200[shape=rectangle, label=\"B196\"];\nn58546795155816448[shape=rectangle, label=\"B197\"];\nn58828270132527104[shape=rectangle, label=\"B198\"];\nn58265320179105792[shape=rectangle, label=\"B199\"];\nn59391220085948416[shape=rectangle, label=\"B200\"];\nn59109745109237760[shape=rectangle, label=\"B201\"];\nn56013520365420544[shape=rectangle, label=\"B202\"];\nn59672695062659072[shape=rectangle, label=\"B203\"];\nn59954170039369728[shape=rectangle, label=\"B204\"];\nn42221246506598400[shape=rectangle, label=\"B205\"];\nn42784196460019712[shape=rectangle, label=\"B206\"];\nn46724846133968896[shape=rectangle, label=\"B207\"];\nn60235645016080384[shape=rectangle, label=\"B208\"];\nn60798594969501696[shape=rectangle, label=\"B209\"];\nn60517119992791040[shape=rectangle, label=\"B210\"];\nn61080069946212352[shape=rectangle, label=\"B211\"];\nn61643019899633664[shape=rectangle, label=\"B212\"];\nn62205969853054976[shape=rectangle, label=\"B213\"];\nn61361544922923008[shape=rectangle, label=\"B214\"];\nn63050394783186944[shape=rectangle, label=\"B215\"];\nn63331869759897600[shape=rectangle, label=\"B216\"];\nn61924494876344320[shape=rectangle, label=\"B217\"];\nn64176294690029568[shape=rectangle, label=\"B218\"];\nn63894819713318912[shape=rectangle, label=\"B219\"];\nn64457769666740224[shape=rectangle, label=\"B220\"];\nn63613344736608256[shape=rectangle, label=\"B221\"];\nn62768919806476288[shape=rectangle, label=\"B222\"];\nn65020719620161536[shape=rectangle, label=\"B223\"];\nn65302194596872192[shape=rectangle, label=\"B224\"];\nn64739244643450880[shape=rectangle, label=\"B225\"];\nn65865144550293504[shape=rectangle, label=\"B226\"];\nn65583669573582848[shape=rectangle, label=\"B227\"];\nn62487444829765632[shape=rectangle, label=\"B228\"];\nn66146619527004160[shape=rectangle, label=\"B229\"];\nn66428094503714816[shape=rectangle, label=\"B230\"];\nn44473046320283648[shape=rectangle, label=\"B231\"];\nn45035996273704960[shape=rectangle, label=\"B232\"];\nn47006321110679552[shape=rectangle, label=\"B233\"];\nn66709569480425472[shape=rectangle, label=\"B234\"];\nn67272519433846784[shape=rectangle, label=\"B235\"];\nn66991044457136128[shape=rectangle, label=\"B236\"];\nn67553994410557440[shape=rectangle, label=\"B237\"];\nn68116944363978752[shape=rectangle, label=\"B238\"];\nn68679894317400064[shape=rectangle, label=\"B239\"];\nn67835469387268096[shape=rectangle, label=\"B240\"];\nn69524319247532032[shape=rectangle, label=\"B241\"];\nn69805794224242688[shape=rectangle, label=\"B242\"];\nn68398419340689408[shape=rectangle, label=\"B243\"];\nn70650219154374656[shape=rectangle, label=\"B244\"];\nn70368744177664000[shape=rectangle, label=\"B245\"];\nn70931694131085312[shape=rectangle, label=\"B246\"];\nn70087269200953344[shape=rectangle, label=\"B247\"];\nn69242844270821376[shape=rectangle, label=\"B248\"];\nn71494644084506624[shape=rectangle, label=\"B249\"];\nn71776119061217280[shape=rectangle, label=\"B250\"];\nn71213169107795968[shape=rectangle, label=\"B251\"];\nn72339069014638592[shape=rectangle, label=\"B252\"];\nn72057594037927936[shape=rectangle, label=\"B253\"];\nn68961369294110720[shape=rectangle, label=\"B254\"];\nn72620543991349248[shape=rectangle, label=\"B255\"];\nn72902018968059904[shape=rectangle, label=\"B256\"];\nn23643898043695104[shape=rectangle, label=\"B257\"];\nn24769797950537728[shape=rectangle, label=\"B258\"];\nn73183493944770560[shape=rectangle, label=\"B259\"];\nn73746443898191872[shape=rectangle, label=\"B260\"];\nn74309393851613184[shape=rectangle, label=\"B261\"];\nn74027918874902528[shape=rectangle, label=\"B262\"];\nn74872343805034496[shape=rectangle, label=\"B263\"];\nn75153818781745152[shape=rectangle, label=\"B264\"];\nn75435293758455808[shape=rectangle, label=\"B265\"];\nn75998243711877120[shape=rectangle, label=\"B266\"];\nn76561193665298432[shape=rectangle, label=\"B267\"];\nn75716768735166464[shape=rectangle, label=\"B268\"];\nn77405618595430400[shape=rectangle, label=\"B269\"];\nn77687093572141056[shape=rectangle, label=\"B270\"];\nn76279718688587776[shape=rectangle, label=\"B271\"];\nn78531518502273024[shape=rectangle, label=\"B272\"];\nn78250043525562368[shape=rectangle, label=\"B273\"];\nn78812993478983680[shape=rectangle, label=\"B274\"];\nn77968568548851712[shape=rectangle, label=\"B275\"];\nn77124143618719744[shape=rectangle, label=\"B276\"];\nn79657418409115648[shape=rectangle, label=\"B277\"];\nn79938893385826304[shape=rectangle, label=\"B278\"];\nn79375943432404992[shape=rectangle, label=\"B279\"];\nn80220368362536960[shape=rectangle, label=\"B280\"];\nn79094468455694336[shape=rectangle, label=\"B281\"];\nn76842668642009088[shape=rectangle, label=\"B282\"];\nn80501843339247616[shape=rectangle, label=\"B283\"];\nn74590868828323840[shape=rectangle, label=\"B284\"];\nn81064793292668928[shape=rectangle, label=\"B285\"];\nn81627743246090240[shape=rectangle, label=\"B286\"];\nn82190693199511552[shape=rectangle, label=\"B287\"];\nn82472168176222208[shape=rectangle, label=\"B288\"];\nn82753643152932864[shape=rectangle, label=\"B289\"];\nn80783318315958272[shape=rectangle, label=\"B290\"];\nn83598068083064832[shape=rectangle, label=\"B291\"];\nn84161018036486144[shape=rectangle, label=\"B292\"];\nn84442493013196800[shape=rectangle, label=\"B293\"];\nn84723967989907456[shape=rectangle, label=\"B294\"];\nn81346268269379584[shape=rectangle, label=\"B295\"];\nn85568392920039424[shape=rectangle, label=\"B296\"];\nn86131342873460736[shape=rectangle, label=\"B297\"];\nn86412817850171392[shape=rectangle, label=\"B298\"];\nn86694292826882048[shape=rectangle, label=\"B299\"];\nn83316593106354176[shape=rectangle, label=\"B300\"];\nn87538717757014016[shape=rectangle, label=\"B301\"];\nn88101667710435328[shape=rectangle, label=\"B302\"];\nn88383142687145984[shape=rectangle, label=\"B303\"];\nn88664617663856640[shape=rectangle, label=\"B304\"];\nn81909218222800896[shape=rectangle, label=\"B305\"];\nn83035118129643520[shape=rectangle, label=\"B306\"];\nn89509042593988608[shape=rectangle, label=\"B307\"];\nn90916417477541888[shape=rectangle, label=\"B308\"];\nn90071992547409920[shape=rectangle, label=\"B309\"];\nn90634942500831232[shape=rectangle, label=\"B310\"];\nn91197892454252544[shape=rectangle, label=\"B311\"];\nn83879543059775488[shape=rectangle, label=\"B312\"];\nn85005442966618112[shape=rectangle, label=\"B313\"];\nn91760842407673856[shape=rectangle, label=\"B314\"];\nn93168217291227136[shape=rectangle, label=\"B315\"];\nn92323792361095168[shape=rectangle, label=\"B316\"];\nn92886742314516480[shape=rectangle, label=\"B317\"];\nn93449692267937792[shape=rectangle, label=\"B318\"];\nn85286917943328768[shape=rectangle, label=\"B319\"];\nn94012642221359104[shape=rectangle, label=\"B320\"];\nn94294117198069760[shape=rectangle, label=\"B321\"];\nn94575592174780416[shape=rectangle, label=\"B322\"];\nn87257242780303360[shape=rectangle, label=\"B323\"];\nn95420017104912384[shape=rectangle, label=\"B324\"];\nn95701492081623040[shape=rectangle, label=\"B325\"];\nn95982967058333696[shape=rectangle, label=\"B326\"];\nn89227567617277952[shape=rectangle, label=\"B327\"];\nn91479367430963200[shape=rectangle, label=\"B328\"];\nn89790517570699264[shape=rectangle, label=\"B329\"];\nn90353467524120576[shape=rectangle, label=\"B330\"];\nn96545917011755008[shape=rectangle, label=\"B331\"];\nn97390341941886976[shape=rectangle, label=\"B332\"];\nn97953291895308288[shape=rectangle, label=\"B333\"];\nn97671816918597632[shape=rectangle, label=\"B334\"];\nn98516241848729600[shape=rectangle, label=\"B335\"];\nn99079191802150912[shape=rectangle, label=\"B336\"];\nn99642141755572224[shape=rectangle, label=\"B337\"];\nn98797716825440256[shape=rectangle, label=\"B338\"];\nn100486566685704192[shape=rectangle, label=\"B339\"];\nn100768041662414848[shape=rectangle, label=\"B340\"];\nn99360666778861568[shape=rectangle, label=\"B341\"];\nn101612466592546816[shape=rectangle, label=\"B342\"];\nn101330991615836160[shape=rectangle, label=\"B343\"];\nn101893941569257472[shape=rectangle, label=\"B344\"];\nn101049516639125504[shape=rectangle, label=\"B345\"];\nn100205091708993536[shape=rectangle, label=\"B346\"];\nn102456891522678784[shape=rectangle, label=\"B347\"];\nn102738366499389440[shape=rectangle, label=\"B348\"];\nn102175416545968128[shape=rectangle, label=\"B349\"];\nn103301316452810752[shape=rectangle, label=\"B350\"];\nn103019841476100096[shape=rectangle, label=\"B351\"];\nn99923616732282880[shape=rectangle, label=\"B352\"];\nn103582791429521408[shape=rectangle, label=\"B353\"];\nn103864266406232064[shape=rectangle, label=\"B354\"];\nn92042317384384512[shape=rectangle, label=\"B355\"];\nn92605267337805824[shape=rectangle, label=\"B356\"];\nn96827391988465664[shape=rectangle, label=\"B357\"];\nn104145741382942720[shape=rectangle, label=\"B358\"];\nn104708691336364032[shape=rectangle, label=\"B359\"];\nn104427216359653376[shape=rectangle, label=\"B360\"];\nn104990166313074688[shape=rectangle, label=\"B361\"];\nn105553116266496000[shape=rectangle, label=\"B362\"];\nn106116066219917312[shape=rectangle, label=\"B363\"];\nn105271641289785344[shape=rectangle, label=\"B364\"];\nn106960491150049280[shape=rectangle, label=\"B365\"];\nn107241966126759936[shape=rectangle, label=\"B366\"];\nn105834591243206656[shape=rectangle, label=\"B367\"];\nn108086391056891904[shape=rectangle, label=\"B368\"];\nn107804916080181248[shape=rectangle, label=\"B369\"];\nn108367866033602560[shape=rectangle, label=\"B370\"];\nn107523441103470592[shape=rectangle, label=\"B371\"];\nn106679016173338624[shape=rectangle, label=\"B372\"];\nn108930815987023872[shape=rectangle, label=\"B373\"];\nn109212290963734528[shape=rectangle, label=\"B374\"];\nn108649341010313216[shape=rectangle, label=\"B375\"];\nn109775240917155840[shape=rectangle, label=\"B376\"];\nn109493765940445184[shape=rectangle, label=\"B377\"];\nn106397541196627968[shape=rectangle, label=\"B378\"];\nn110056715893866496[shape=rectangle, label=\"B379\"];\nn110338190870577152[shape=rectangle, label=\"B380\"];\nn85849867896750080[shape=rectangle, label=\"B381\"];\nn86975767803592704[shape=rectangle, label=\"B382\"];\nn110901140823998464[shape=rectangle, label=\"B383\"];\nn112308515707551744[shape=rectangle, label=\"B384\"];\nn111464090777419776[shape=rectangle, label=\"B385\"];\nn112027040730841088[shape=rectangle, label=\"B386\"];\nn112589990684262400[shape=rectangle, label=\"B387\"];\nn87820192733724672[shape=rectangle, label=\"B388\"];\nn88946092640567296[shape=rectangle, label=\"B389\"];\nn113152940637683712[shape=rectangle, label=\"B390\"];\nn114560315521236992[shape=rectangle, label=\"B391\"];\nn113715890591105024[shape=rectangle, label=\"B392\"];\nn114278840544526336[shape=rectangle, label=\"B393\"];\nn114841790497947648[shape=rectangle, label=\"B394\"];\nn93731167244648448[shape=rectangle, label=\"B395\"];\nn94857067151491072[shape=rectangle, label=\"B396\"];\nn115404740451368960[shape=rectangle, label=\"B397\"];\nn116812115334922240[shape=rectangle, label=\"B398\"];\nn115967690404790272[shape=rectangle, label=\"B399\"];\nn116530640358211584[shape=rectangle, label=\"B400\"];\nn117093590311632896[shape=rectangle, label=\"B401\"];\nn95138542128201728[shape=rectangle, label=\"B402\"];\nn96264442035044352[shape=rectangle, label=\"B403\"];\nn117656540265054208[shape=rectangle, label=\"B404\"];\nn119063915148607488[shape=rectangle, label=\"B405\"];\nn118219490218475520[shape=rectangle, label=\"B406\"];\nn118782440171896832[shape=rectangle, label=\"B407\"];\nn119345390125318144[shape=rectangle, label=\"B408\"];\nn110619665847287808[shape=rectangle, label=\"B409\"];\nn112871465660973056[shape=rectangle, label=\"B410\"];\nn115123265474658304[shape=rectangle, label=\"B411\"];\nn117375065288343552[shape=rectangle, label=\"B412\"];\nn111182615800709120[shape=rectangle, label=\"B413\"];\nn111745565754130432[shape=rectangle, label=\"B414\"];\nn119626865102028800[shape=rectangle, label=\"B415\"];\nn120752765008871424[shape=rectangle, label=\"B416\"];\nn121315714962292736[shape=rectangle, label=\"B417\"];\nn121034239985582080[shape=rectangle, label=\"B418\"];\nn121597189939003392[shape=rectangle, label=\"B419\"];\nn122160139892424704[shape=rectangle, label=\"B420\"];\nn122723089845846016[shape=rectangle, label=\"B421\"];\nn121878664915714048[shape=rectangle, label=\"B422\"];\nn123567514775977984[shape=rectangle, label=\"B423\"];\nn123848989752688640[shape=rectangle, label=\"B424\"];\nn122441614869135360[shape=rectangle, label=\"B425\"];\nn124693414682820608[shape=rectangle, label=\"B426\"];\nn124411939706109952[shape=rectangle, label=\"B427\"];\nn124974889659531264[shape=rectangle, label=\"B428\"];\nn124130464729399296[shape=rectangle, label=\"B429\"];\nn123286039799267328[shape=rectangle, label=\"B430\"];\nn125537839612952576[shape=rectangle, label=\"B431\"];\nn125819314589663232[shape=rectangle, label=\"B432\"];\nn125256364636241920[shape=rectangle, label=\"B433\"];\nn126382264543084544[shape=rectangle, label=\"B434\"];\nn126100789566373888[shape=rectangle, label=\"B435\"];\nn123004564822556672[shape=rectangle, label=\"B436\"];\nn126663739519795200[shape=rectangle, label=\"B437\"];\nn126945214496505856[shape=rectangle, label=\"B438\"];\nn113434415614394368[shape=rectangle, label=\"B439\"];\nn113997365567815680[shape=rectangle, label=\"B440\"];\nn119908340078739456[shape=rectangle, label=\"B441\"];\nn127226689473216512[shape=rectangle, label=\"B442\"];\nn127789639426637824[shape=rectangle, label=\"B443\"];\nn127508164449927168[shape=rectangle, label=\"B444\"];\nn128071114403348480[shape=rectangle, label=\"B445\"];\nn128634064356769792[shape=rectangle, label=\"B446\"];\nn129197014310191104[shape=rectangle, label=\"B447\"];\nn128352589380059136[shape=rectangle, label=\"B448\"];\nn130041439240323072[shape=rectangle, label=\"B449\"];\nn130322914217033728[shape=rectangle, label=\"B450\"];\nn128915539333480448[shape=rectangle, label=\"B451\"];\nn131167339147165696[shape=rectangle, label=\"B452\"];\nn130885864170455040[shape=rectangle, label=\"B453\"];\nn131448814123876352[shape=rectangle, label=\"B454\"];\nn130604389193744384[shape=rectangle, label=\"B455\"];\nn129759964263612416[shape=rectangle, label=\"B456\"];\nn132011764077297664[shape=rectangle, label=\"B457\"];\nn132293239054008320[shape=rectangle, label=\"B458\"];\nn131730289100587008[shape=rectangle, label=\"B459\"];\nn132856189007429632[shape=rectangle, label=\"B460\"];\nn132574714030718976[shape=rectangle, label=\"B461\"];\nn129478489286901760[shape=rectangle, label=\"B462\"];\nn133137663984140288[shape=rectangle, label=\"B463\"];\nn133419138960850944[shape=rectangle, label=\"B464\"];\nn115686215428079616[shape=rectangle, label=\"B465\"];\nn116249165381500928[shape=rectangle, label=\"B466\"];\nn120189815055450112[shape=rectangle, label=\"B467\"];\nn133700613937561600[shape=rectangle, label=\"B468\"];\nn134263563890982912[shape=rectangle, label=\"B469\"];\nn133982088914272256[shape=rectangle, label=\"B470\"];\nn134545038867693568[shape=rectangle, label=\"B471\"];\nn135107988821114880[shape=rectangle, label=\"B472\"];\nn135670938774536192[shape=rectangle, label=\"B473\"];\nn134826513844404224[shape=rectangle, label=\"B474\"];\nn136515363704668160[shape=rectangle, label=\"B475\"];\nn136796838681378816[shape=rectangle, label=\"B476\"];\nn135389463797825536[shape=rectangle, label=\"B477\"];\nn137641263611510784[shape=rectangle, label=\"B478\"];\nn137359788634800128[shape=rectangle, label=\"B479\"];\nn137922738588221440[shape=rectangle, label=\"B480\"];\nn137078313658089472[shape=rectangle, label=\"B481\"];\nn136233888727957504[shape=rectangle, label=\"B482\"];\nn138485688541642752[shape=rectangle, label=\"B483\"];\nn138767163518353408[shape=rectangle, label=\"B484\"];\nn138204213564932096[shape=rectangle, label=\"B485\"];\nn139330113471774720[shape=rectangle, label=\"B486\"];\nn139048638495064064[shape=rectangle, label=\"B487\"];\nn135952413751246848[shape=rectangle, label=\"B488\"];\nn139611588448485376[shape=rectangle, label=\"B489\"];\nn139893063425196032[shape=rectangle, label=\"B490\"];\nn117938015241764864[shape=rectangle, label=\"B491\"];\nn118500965195186176[shape=rectangle, label=\"B492\"];\nn120471290032160768[shape=rectangle, label=\"B493\"];\nn140174538401906688[shape=rectangle, label=\"B494\"];\nn140737488355328000[shape=rectangle, label=\"B495\"];\nn140456013378617344[shape=rectangle, label=\"B496\"];\nn141018963332038656[shape=rectangle, label=\"B497\"];\nn141581913285459968[shape=rectangle, label=\"B498\"];\nn142144863238881280[shape=rectangle, label=\"B499\"];\nn141300438308749312[shape=rectangle, label=\"B500\"];\nn142989288169013248[shape=rectangle, label=\"B501\"];\nn143270763145723904[shape=rectangle, label=\"B502\"];\nn141863388262170624[shape=rectangle, label=\"B503\"];\nn144115188075855872[shape=rectangle, label=\"B504\"];\nn143833713099145216[shape=rectangle, label=\"B505\"];\nn144396663052566528[shape=rectangle, label=\"B506\"];\nn143552238122434560[shape=rectangle, label=\"B507\"];\nn142707813192302592[shape=rectangle, label=\"B508\"];\nn144959613005987840[shape=rectangle, label=\"B509\"];\nn145241087982698496[shape=rectangle, label=\"B510\"];\nn144678138029277184[shape=rectangle, label=\"B511\"];\nn145804037936119808[shape=rectangle, label=\"B512\"];\nn145522562959409152[shape=rectangle, label=\"B513\"];\nn142426338215591936[shape=rectangle, label=\"B514\"];\nn146085512912830464[shape=rectangle, label=\"B515\"];\nn98234766872018944[shape=rectangle, label=\"B516\"];\nn146648462866251776[shape=rectangle, label=\"B517\"];\nn97108866965176320[shape=rectangle, label=\"B518\"];\nn146366987889541120[shape=rectangle, label=\"B519\"];\nn146929937842962432[shape=rectangle, label=\"B520\"];\nn147211412819673088[shape=rectangle, label=\"B521\"];\nn147774362773094400[shape=rectangle, label=\"B522\"];\nn148055837749805056[shape=rectangle, label=\"B523\"];\nn148337312726515712[shape=rectangle, label=\"B524\"];\nn148900262679937024[shape=rectangle, label=\"B525\"];\nn149463212633358336[shape=rectangle, label=\"B526\"];\nn148618787703226368[shape=rectangle, label=\"B527\"];\nn150307637563490304[shape=rectangle, label=\"B528\"];\nn150589112540200960[shape=rectangle, label=\"B529\"];\nn149181737656647680[shape=rectangle, label=\"B530\"];\nn151433537470332928[shape=rectangle, label=\"B531\"];\nn151152062493622272[shape=rectangle, label=\"B532\"];\nn151715012447043584[shape=rectangle, label=\"B533\"];\nn150870587516911616[shape=rectangle, label=\"B534\"];\nn150026162586779648[shape=rectangle, label=\"B535\"];\nn152559437377175552[shape=rectangle, label=\"B536\"];\nn152840912353886208[shape=rectangle, label=\"B537\"];\nn152277962400464896[shape=rectangle, label=\"B538\"];\nn153122387330596864[shape=rectangle, label=\"B539\"];\nn151996487423754240[shape=rectangle, label=\"B540\"];\nn149744687610068992[shape=rectangle, label=\"B541\"];\nn153403862307307520[shape=rectangle, label=\"B542\"];\nn147492887796383744[shape=rectangle, label=\"B543\"];\nn153966812260728832[shape=rectangle, label=\"B544\"];\nn154529762214150144[shape=rectangle, label=\"B545\"];\nn155092712167571456[shape=rectangle, label=\"B546\"];\nn155374187144282112[shape=rectangle, label=\"B547\"];\nn155655662120992768[shape=rectangle, label=\"B548\"];\nn153685337284018176[shape=rectangle, label=\"B549\"];\nn156500087051124736[shape=rectangle, label=\"B550\"];\nn157063037004546048[shape=rectangle, label=\"B551\"];\nn157344511981256704[shape=rectangle, label=\"B552\"];\nn157625986957967360[shape=rectangle, label=\"B553\"];\nn154248287237439488[shape=rectangle, label=\"B554\"];\nn158470411888099328[shape=rectangle, label=\"B555\"];\nn159033361841520640[shape=rectangle, label=\"B556\"];\nn159314836818231296[shape=rectangle, label=\"B557\"];\nn159596311794941952[shape=rectangle, label=\"B558\"];\nn156218612074414080[shape=rectangle, label=\"B559\"];\nn160440736725073920[shape=rectangle, label=\"B560\"];\nn161003686678495232[shape=rectangle, label=\"B561\"];\nn161285161655205888[shape=rectangle, label=\"B562\"];\nn161566636631916544[shape=rectangle, label=\"B563\"];\nn154811237190860800[shape=rectangle, label=\"B564\"];\nn155937137097703424[shape=rectangle, label=\"B565\"];\nn162411061562048512[shape=rectangle, label=\"B566\"];\nn163818436445601792[shape=rectangle, label=\"B567\"];\nn162974011515469824[shape=rectangle, label=\"B568\"];\nn163536961468891136[shape=rectangle, label=\"B569\"];\nn164099911422312448[shape=rectangle, label=\"B570\"];\nn156781562027835392[shape=rectangle, label=\"B571\"];\nn157907461934678016[shape=rectangle, label=\"B572\"];\nn164662861375733760[shape=rectangle, label=\"B573\"];\nn166070236259287040[shape=rectangle, label=\"B574\"];\nn165225811329155072[shape=rectangle, label=\"B575\"];\nn165788761282576384[shape=rectangle, label=\"B576\"];\nn166351711235997696[shape=rectangle, label=\"B577\"];\nn158188936911388672[shape=rectangle, label=\"B578\"];\nn166914661189419008[shape=rectangle, label=\"B579\"];\nn167196136166129664[shape=rectangle, label=\"B580\"];\nn167477611142840320[shape=rectangle, label=\"B581\"];\nn160159261748363264[shape=rectangle, label=\"B582\"];\nn168322036072972288[shape=rectangle, label=\"B583\"];\nn168603511049682944[shape=rectangle, label=\"B584\"];\nn168884986026393600[shape=rectangle, label=\"B585\"];\nn162129586585337856[shape=rectangle, label=\"B586\"];\nn164381386399023104[shape=rectangle, label=\"B587\"];\nn162692536538759168[shape=rectangle, label=\"B588\"];\nn163255486492180480[shape=rectangle, label=\"B589\"];\nn169447935979814912[shape=rectangle, label=\"B590\"];\nn170292360909946880[shape=rectangle, label=\"B591\"];\nn170855310863368192[shape=rectangle, label=\"B592\"];\nn170573835886657536[shape=rectangle, label=\"B593\"];\nn171418260816789504[shape=rectangle, label=\"B594\"];\nn171981210770210816[shape=rectangle, label=\"B595\"];\nn172544160723632128[shape=rectangle, label=\"B596\"];\nn171699735793500160[shape=rectangle, label=\"B597\"];\nn173388585653764096[shape=rectangle, label=\"B598\"];\nn173670060630474752[shape=rectangle, label=\"B599\"];\nn172262685746921472[shape=rectangle, label=\"B600\"];\nn174514485560606720[shape=rectangle, label=\"B601\"];\nn174233010583896064[shape=rectangle, label=\"B602\"];\nn174795960537317376[shape=rectangle, label=\"B603\"];\nn173951535607185408[shape=rectangle, label=\"B604\"];\nn173107110677053440[shape=rectangle, label=\"B605\"];\nn175358910490738688[shape=rectangle, label=\"B606\"];\nn175640385467449344[shape=rectangle, label=\"B607\"];\nn175077435514028032[shape=rectangle, label=\"B608\"];\nn176203335420870656[shape=rectangle, label=\"B609\"];\nn175921860444160000[shape=rectangle, label=\"B610\"];\nn172825635700342784[shape=rectangle, label=\"B611\"];\nn176484810397581312[shape=rectangle, label=\"B612\"];\nn176766285374291968[shape=rectangle, label=\"B613\"];\nn164944336352444416[shape=rectangle, label=\"B614\"];\nn165507286305865728[shape=rectangle, label=\"B615\"];\nn169729410956525568[shape=rectangle, label=\"B616\"];\nn177047760351002624[shape=rectangle, label=\"B617\"];\nn177610710304423936[shape=rectangle, label=\"B618\"];\nn177329235327713280[shape=rectangle, label=\"B619\"];\nn177892185281134592[shape=rectangle, label=\"B620\"];\nn178455135234555904[shape=rectangle, label=\"B621\"];\nn179018085187977216[shape=rectangle, label=\"B622\"];\nn178173660257845248[shape=rectangle, label=\"B623\"];\nn179862510118109184[shape=rectangle, label=\"B624\"];\nn180143985094819840[shape=rectangle, label=\"B625\"];\nn178736610211266560[shape=rectangle, label=\"B626\"];\nn180988410024951808[shape=rectangle, label=\"B627\"];\nn180706935048241152[shape=rectangle, label=\"B628\"];\nn181269885001662464[shape=rectangle, label=\"B629\"];\nn180425460071530496[shape=rectangle, label=\"B630\"];\nn179581035141398528[shape=rectangle, label=\"B631\"];\nn181832834955083776[shape=rectangle, label=\"B632\"];\nn182114309931794432[shape=rectangle, label=\"B633\"];\nn181551359978373120[shape=rectangle, label=\"B634\"];\nn182677259885215744[shape=rectangle, label=\"B635\"];\nn182395784908505088[shape=rectangle, label=\"B636\"];\nn179299560164687872[shape=rectangle, label=\"B637\"];\nn182958734861926400[shape=rectangle, label=\"B638\"];\nn183240209838637056[shape=rectangle, label=\"B639\"];\nn158751886864809984[shape=rectangle, label=\"B640\"];\nn159877786771652608[shape=rectangle, label=\"B641\"];\nn183803159792058368[shape=rectangle, label=\"B642\"];\nn185210534675611648[shape=rectangle, label=\"B643\"];\nn184366109745479680[shape=rectangle, label=\"B644\"];\nn184929059698900992[shape=rectangle, label=\"B645\"];\nn185492009652322304[shape=rectangle, label=\"B646\"];\nn160722211701784576[shape=rectangle, label=\"B647\"];\nn161848111608627200[shape=rectangle, label=\"B648\"];\nn186054959605743616[shape=rectangle, label=\"B649\"];\nn187462334489296896[shape=rectangle, label=\"B650\"];\nn186617909559164928[shape=rectangle, label=\"B651\"];\nn187180859512586240[shape=rectangle, label=\"B652\"];\nn187743809466007552[shape=rectangle, label=\"B653\"];\nn166633186212708352[shape=rectangle, label=\"B654\"];\nn167759086119550976[shape=rectangle, label=\"B655\"];\nn188306759419428864[shape=rectangle, label=\"B656\"];\nn189714134302982144[shape=rectangle, label=\"B657\"];\nn188869709372850176[shape=rectangle, label=\"B658\"];\nn189432659326271488[shape=rectangle, label=\"B659\"];\nn189995609279692800[shape=rectangle, label=\"B660\"];\nn168040561096261632[shape=rectangle, label=\"B661\"];\nn169166461003104256[shape=rectangle, label=\"B662\"];\nn190558559233114112[shape=rectangle, label=\"B663\"];\nn191965934116667392[shape=rectangle, label=\"B664\"];\nn191121509186535424[shape=rectangle, label=\"B665\"];\nn191684459139956736[shape=rectangle, label=\"B666\"];\nn192247409093378048[shape=rectangle, label=\"B667\"];\nn183521684815347712[shape=rectangle, label=\"B668\"];\nn185773484629032960[shape=rectangle, label=\"B669\"];\nn188025284442718208[shape=rectangle, label=\"B670\"];\nn190277084256403456[shape=rectangle, label=\"B671\"];\nn184084634768769024[shape=rectangle, label=\"B672\"];\nn184647584722190336[shape=rectangle, label=\"B673\"];\nn192528884070088704[shape=rectangle, label=\"B674\"];\nn193654783976931328[shape=rectangle, label=\"B675\"];\nn194217733930352640[shape=rectangle, label=\"B676\"];\nn193936258953641984[shape=rectangle, label=\"B677\"];\nn194499208907063296[shape=rectangle, label=\"B678\"];\nn195062158860484608[shape=rectangle, label=\"B679\"];\nn195625108813905920[shape=rectangle, label=\"B680\"];\nn194780683883773952[shape=rectangle, label=\"B681\"];\nn196469533744037888[shape=rectangle, label=\"B682\"];\nn196751008720748544[shape=rectangle, label=\"B683\"];\nn195343633837195264[shape=rectangle, label=\"B684\"];\nn197595433650880512[shape=rectangle, label=\"B685\"];\nn197313958674169856[shape=rectangle, label=\"B686\"];\nn197876908627591168[shape=rectangle, label=\"B687\"];\nn197032483697459200[shape=rectangle, label=\"B688\"];\nn196188058767327232[shape=rectangle, label=\"B689\"];\nn198439858581012480[shape=rectangle, label=\"B690\"];\nn198721333557723136[shape=rectangle, label=\"B691\"];\nn198158383604301824[shape=rectangle, label=\"B692\"];\nn199284283511144448[shape=rectangle, label=\"B693\"];\nn199002808534433792[shape=rectangle, label=\"B694\"];\nn195906583790616576[shape=rectangle, label=\"B695\"];\nn199565758487855104[shape=rectangle, label=\"B696\"];\nn199847233464565760[shape=rectangle, label=\"B697\"];\nn186336434582454272[shape=rectangle, label=\"B698\"];\nn186899384535875584[shape=rectangle, label=\"B699\"];\nn192810359046799360[shape=rectangle, label=\"B700\"];\nn200128708441276416[shape=rectangle, label=\"B701\"];\nn200691658394697728[shape=rectangle, label=\"B702\"];\nn200410183417987072[shape=rectangle, label=\"B703\"];\nn200973133371408384[shape=rectangle, label=\"B704\"];\nn201536083324829696[shape=rectangle, label=\"B705\"];\nn202099033278251008[shape=rectangle, label=\"B706\"];\nn201254608348119040[shape=rectangle, label=\"B707\"];\nn202943458208382976[shape=rectangle, label=\"B708\"];\nn203224933185093632[shape=rectangle, label=\"B709\"];\nn201817558301540352[shape=rectangle, label=\"B710\"];\nn204069358115225600[shape=rectangle, label=\"B711\"];\nn203787883138514944[shape=rectangle, label=\"B712\"];\nn204350833091936256[shape=rectangle, label=\"B713\"];\nn203506408161804288[shape=rectangle, label=\"B714\"];\nn202661983231672320[shape=rectangle, label=\"B715\"];\nn204913783045357568[shape=rectangle, label=\"B716\"];\nn205195258022068224[shape=rectangle, label=\"B717\"];\nn204632308068646912[shape=rectangle, label=\"B718\"];\nn205758207975489536[shape=rectangle, label=\"B719\"];\nn205476732998778880[shape=rectangle, label=\"B720\"];\nn202380508254961664[shape=rectangle, label=\"B721\"];\nn206039682952200192[shape=rectangle, label=\"B722\"];\nn206321157928910848[shape=rectangle, label=\"B723\"];\nn188588234396139520[shape=rectangle, label=\"B724\"];\nn189151184349560832[shape=rectangle, label=\"B725\"];\nn193091834023510016[shape=rectangle, label=\"B726\"];\nn206602632905621504[shape=rectangle, label=\"B727\"];\nn207165582859042816[shape=rectangle, label=\"B728\"];\nn206884107882332160[shape=rectangle, label=\"B729\"];\nn207447057835753472[shape=rectangle, label=\"B730\"];\nn208010007789174784[shape=rectangle, label=\"B731\"];\nn208572957742596096[shape=rectangle, label=\"B732\"];\nn207728532812464128[shape=rectangle, label=\"B733\"];\nn209417382672728064[shape=rectangle, label=\"B734\"];\nn209698857649438720[shape=rectangle, label=\"B735\"];\nn208291482765885440[shape=rectangle, label=\"B736\"];\nn210543282579570688[shape=rectangle, label=\"B737\"];\nn210261807602860032[shape=rectangle, label=\"B738\"];\nn210824757556281344[shape=rectangle, label=\"B739\"];\nn209980332626149376[shape=rectangle, label=\"B740\"];\nn209135907696017408[shape=rectangle, label=\"B741\"];\nn211387707509702656[shape=rectangle, label=\"B742\"];\nn211669182486413312[shape=rectangle, label=\"B743\"];\nn211106232532992000[shape=rectangle, label=\"B744\"];\nn212232132439834624[shape=rectangle, label=\"B745\"];\nn211950657463123968[shape=rectangle, label=\"B746\"];\nn208854432719306752[shape=rectangle, label=\"B747\"];\nn212513607416545280[shape=rectangle, label=\"B748\"];\nn212795082393255936[shape=rectangle, label=\"B749\"];\nn190840034209824768[shape=rectangle, label=\"B750\"];\nn191402984163246080[shape=rectangle, label=\"B751\"];\nn193373309000220672[shape=rectangle, label=\"B752\"];\nn213076557369966592[shape=rectangle, label=\"B753\"];\nn213639507323387904[shape=rectangle, label=\"B754\"];\nn213358032346677248[shape=rectangle, label=\"B755\"];\nn213920982300098560[shape=rectangle, label=\"B756\"];\nn214483932253519872[shape=rectangle, label=\"B757\"];\nn215046882206941184[shape=rectangle, label=\"B758\"];\nn214202457276809216[shape=rectangle, label=\"B759\"];\nn215891307137073152[shape=rectangle, label=\"B760\"];\nn216172782113783808[shape=rectangle, label=\"B761\"];\nn214765407230230528[shape=rectangle, label=\"B762\"];\nn217017207043915776[shape=rectangle, label=\"B763\"];\nn216735732067205120[shape=rectangle, label=\"B764\"];\nn217298682020626432[shape=rectangle, label=\"B765\"];\nn216454257090494464[shape=rectangle, label=\"B766\"];\nn215609832160362496[shape=rectangle, label=\"B767\"];\nn217861631974047744[shape=rectangle, label=\"B768\"];\nn218143106950758400[shape=rectangle, label=\"B769\"];\nn217580156997337088[shape=rectangle, label=\"B770\"];\nn218706056904179712[shape=rectangle, label=\"B771\"];\nn218424581927469056[shape=rectangle, label=\"B772\"];\nn215328357183651840[shape=rectangle, label=\"B773\"];\nn218987531880890368[shape=rectangle, label=\"B774\"];\nn219269006857601024[shape=rectangle, label=\"B775\"];\nn170010885933236224[shape=rectangle, label=\"B776\"];\nn171136785840078848[shape=rectangle, label=\"B777\"];\nn219550481834311680[shape=rectangle, label=\"B778\"];\nn73464968921481216[shape=rectangle, label=\"B779\"];\nn220113431787732992[shape=rectangle, label=\"B780\"];\nn220676381741154304[shape=rectangle, label=\"B781\"];\nn220957856717864960[shape=rectangle, label=\"B782\"];\nn222365231601418240[shape=rectangle, label=\"B783\"];\nn221520806671286272[shape=rectangle, label=\"B784\"];\nn222083756624707584[shape=rectangle, label=\"B785\"];\nn222646706578128896[shape=rectangle, label=\"B786\"];\nn219831956811022336[shape=rectangle, label=\"B787\"];\nn223209656531550208[shape=rectangle, label=\"B788\"];\nn223772606484971520[shape=rectangle, label=\"B789\"];\nn224054081461682176[shape=rectangle, label=\"B790\"];\nn224335556438392832[shape=rectangle, label=\"B791\"];\nn220394906764443648[shape=rectangle, label=\"B792\"];\nn223491131508260864[shape=rectangle, label=\"B793\"];\nn221239331694575616[shape=rectangle, label=\"B794\"];\nn221802281647996928[shape=rectangle, label=\"B795\"];\nn222928181554839552[shape=rectangle, label=\"B796\"];\nn225461456345235456[shape=rectangle, label=\"B797\"];\nn226024406298656768[shape=rectangle, label=\"B798\"];\nn225179981368524800[shape=rectangle, label=\"B799\"];\nn226305881275367424[shape=rectangle, label=\"B800\"];\nn226587356252078080[shape=rectangle, label=\"B801\"];\nn225742931321946112[shape=rectangle, label=\"B802\"];\nn227150306205499392[shape=rectangle, label=\"B803\"];\nn226868831228788736[shape=rectangle, label=\"B804\"];\nn227994731135631360[shape=rectangle, label=\"B805\"];\nn227713256158920704[shape=rectangle, label=\"B806\"];\nn228557681089052672[shape=rectangle, label=\"B807\"];\nn228276206112342016[shape=rectangle, label=\"B808\"];\nn229120631042473984[shape=rectangle, label=\"B809\"];\nn229402106019184640[shape=rectangle, label=\"B810\"];\nn229683580995895296[shape=rectangle, label=\"B811\"];\nn228839156065763328[shape=rectangle, label=\"B812\"];\nn230246530949316608[shape=rectangle, label=\"B813\"];\nn230528005926027264[shape=rectangle, label=\"B814\"];\nn230809480902737920[shape=rectangle, label=\"B815\"];\nn229965055972605952[shape=rectangle, label=\"B816\"];\nn227431781182210048[shape=rectangle, label=\"B817\"];\nn224617031415103488[shape=rectangle, label=\"B818\"];\nn231090955879448576[shape=rectangle, label=\"B819\"];\nn224898506391814144[shape=rectangle, label=\"B820\"];\nn231653905832869888[shape=rectangle, label=\"B821\"];\nn231372430856159232[shape=rectangle, label=\"B822\"];\nn232216855786291200[shape=rectangle, label=\"B823\"];\nn232498330763001856[shape=rectangle, label=\"B824\"];\nn240098155134189568[shape=rectangle, label=\"B825\"];\nn233061280716423168[shape=rectangle, label=\"B826\"];\nn233624230669844480[shape=rectangle, label=\"B827\"];\nn234187180623265792[shape=rectangle, label=\"B828\"];\nn234750130576687104[shape=rectangle, label=\"B829\"];\nn233342755693133824[shape=rectangle, label=\"B830\"];\nn235594555506819072[shape=rectangle, label=\"B831\"];\nn235876030483529728[shape=rectangle, label=\"B832\"];\nn233905705646555136[shape=rectangle, label=\"B833\"];\nn236720455413661696[shape=rectangle, label=\"B834\"];\nn236438980436951040[shape=rectangle, label=\"B835\"];\nn237001930390372352[shape=rectangle, label=\"B836\"];\nn234468655599976448[shape=rectangle, label=\"B837\"];\nn237564880343793664[shape=rectangle, label=\"B838\"];\nn238127830297214976[shape=rectangle, label=\"B839\"];\nn236157505460240384[shape=rectangle, label=\"B840\"];\nn235313080530108416[shape=rectangle, label=\"B841\"];\nn238972255227346944[shape=rectangle, label=\"B842\"];\nn239253730204057600[shape=rectangle, label=\"B843\"];\nn238690780250636288[shape=rectangle, label=\"B844\"];\nn239816680157478912[shape=rectangle, label=\"B845\"];\nn239535205180768256[shape=rectangle, label=\"B846\"];\nn235031605553397760[shape=rectangle, label=\"B847\"];\nn237283405367083008[shape=rectangle, label=\"B848\"];\nn237846355320504320[shape=rectangle, label=\"B849\"];\nn240379630110900224[shape=rectangle, label=\"B850\"];\nn232779805739712512[shape=rectangle, label=\"B851\"];\nn231935380809580544[shape=rectangle, label=\"B852\"];\nn238409305273925632[shape=rectangle, label=\"B853\"];\nn281474976710656[shape=rectangle, label=\"B854\"];\nn1407374883553280[shape=rectangle, label=\"B855\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n844424930131968;\nn1125899906842624 -> n240661105087610880;\nn240661105087610880 -> n1407374883553280;\nn240661105087610880 -> n844424930131968;\nn844424930131968 -> n1688849860263936;\nn844424930131968 -> n1970324836974592;\nn1970324836974592 -> n1688849860263936;\nn1970324836974592 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n2814749767106560;\nn2814749767106560 -> n3096224743817216;\nn2814749767106560 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn2533274790395904 -> n3940649673949184;\nn2533274790395904 -> n4222124650659840;\nn4222124650659840 -> n3940649673949184;\nn4222124650659840 -> n4503599627370496;\nn4503599627370496 -> n3940649673949184;\nn3096224743817216 -> n5348024557502464;\nn5348024557502464 -> n4785074604081152;\nn5348024557502464 -> n5066549580791808;\nn5066549580791808 -> n5348024557502464;\nn5066549580791808 -> n5629499534213120;\nn5629499534213120 -> n3659174697238528;\nn4785074604081152 -> n4222124650659840;\nn4785074604081152 -> n3940649673949184;\nn3940649673949184 -> n5910974510923776;\nn3940649673949184 -> n6192449487634432;\nn6192449487634432 -> n5910974510923776;\nn6192449487634432 -> n6473924464345088;\nn6473924464345088 -> n5910974510923776;\nn5910974510923776 -> n6755399441055744;\nn5910974510923776 -> n7036874417766400;\nn7036874417766400 -> n6755399441055744;\nn6755399441055744 -> n3659174697238528;\nn3659174697238528 -> n1688849860263936;\nn1688849860263936 -> n7318349394477056;\nn1688849860263936 -> n7599824371187712;\nn7599824371187712 -> n7881299347898368;\nn7599824371187712 -> n8162774324609024;\nn8162774324609024 -> n8444249301319680;\nn8162774324609024 -> n8725724278030336;\nn8725724278030336 -> n9007199254740992;\nn9007199254740992 -> n9007199254740992[style=dashed];\nn9007199254740992 -> n9288674231451648;\nn9288674231451648 -> n9570149208162304;\nn7318349394477056 -> n9851624184872960;\nn7318349394477056 -> n10133099161583616;\nn10133099161583616 -> n10414574138294272;\nn10133099161583616 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10977524091715584 -> n10977524091715584[style=dashed];\nn10977524091715584 -> n11258999068426240;\nn11258999068426240 -> n11540474045136896;\nn7881299347898368 -> n11821949021847552;\nn7881299347898368 -> n12103423998558208;\nn12103423998558208 -> n12384898975268864;\nn12103423998558208 -> n12666373951979520;\nn12666373951979520 -> n12947848928690176;\nn12947848928690176 -> n12947848928690176[style=dashed];\nn12947848928690176 -> n13229323905400832;\nn13229323905400832 -> n13510798882111488;\nn9851624184872960 -> n13792273858822144;\nn9851624184872960 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n14918173765664768;\nn14918173765664768 -> n14918173765664768[style=dashed];\nn14918173765664768 -> n15199648742375424;\nn15199648742375424 -> n15481123719086080;\nn8444249301319680 -> n9570149208162304;\nn9570149208162304 -> n15762598695796736;\nn9570149208162304 -> n16044073672507392;\nn16044073672507392 -> n17451448556060672;\nn17451448556060672 -> n16325548649218048;\nn17451448556060672 -> n16607023625928704;\nn16607023625928704 -> n16888498602639360;\nn16607023625928704 -> n17169973579350016;\nn17169973579350016 -> n17451448556060672;\nn17169973579350016 -> n17732923532771328;\nn17732923532771328 -> n16888498602639360;\nn10414574138294272 -> n11540474045136896;\nn11540474045136896 -> n18014398509481984;\nn11540474045136896 -> n18295873486192640;\nn18295873486192640 -> n19703248369745920;\nn19703248369745920 -> n18577348462903296;\nn19703248369745920 -> n18858823439613952;\nn18858823439613952 -> n19140298416324608;\nn18858823439613952 -> n19421773393035264;\nn19421773393035264 -> n19703248369745920;\nn19421773393035264 -> n19984723346456576;\nn19984723346456576 -> n19140298416324608;\nn11821949021847552 -> n20266198323167232;\nn11821949021847552 -> n20547673299877888;\nn20547673299877888 -> n20829148276588544;\nn20829148276588544 -> n20829148276588544[style=dashed];\nn20829148276588544 -> n21110623253299200;\nn21110623253299200 -> n21392098230009856;\nn13792273858822144 -> n21673573206720512;\nn13792273858822144 -> n21955048183431168;\nn21955048183431168 -> n22236523160141824;\nn22236523160141824 -> n22236523160141824[style=dashed];\nn22236523160141824 -> n22517998136852480;\nn22517998136852480 -> n22799473113563136;\nn15762598695796736 -> n23080948090273792;\nn18014398509481984 -> n23362423066984448;\nn16325548649218048 -> n16888498602639360;\nn16888498602639360 -> n23080948090273792;\nn23080948090273792 -> n23643898043695104;\nn23080948090273792 -> n23925373020405760;\nn23925373020405760 -> n24206847997116416;\nn24488322973827072 -> n24769797950537728;\nn24488322973827072 -> n24206847997116416;\nn24206847997116416 -> n24488322973827072[style=dashed];\nn24206847997116416 -> n25051272927248384;\nn25051272927248384 -> n25332747903959040;\nn25051272927248384 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n26177172834091008;\nn26177172834091008 -> n26458647810801664;\nn25332747903959040 -> n26740122787512320;\nn25332747903959040 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn27021597764222976 -> n27303072740933632;\nn27303072740933632 -> n26740122787512320;\nn25895697857380352 -> n28147497671065600;\nn28147497671065600 -> n27584547717644288;\nn28147497671065600 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn27866022694354944 -> n28428972647776256;\nn28428972647776256 -> n26458647810801664;\nn27584547717644288 -> n27021597764222976;\nn27584547717644288 -> n26740122787512320;\nn26740122787512320 -> n28710447624486912;\nn26740122787512320 -> n28991922601197568;\nn28991922601197568 -> n28710447624486912;\nn28991922601197568 -> n29273397577908224;\nn29273397577908224 -> n28710447624486912;\nn28710447624486912 -> n29554872554618880;\nn28710447624486912 -> n29836347531329536;\nn29836347531329536 -> n29554872554618880;\nn29554872554618880 -> n26458647810801664;\nn26458647810801664 -> n24488322973827072;\nn26458647810801664 -> n30117822508040192;\nn30117822508040192 -> n24488322973827072;\nn30117822508040192 -> n30399297484750848;\nn30399297484750848 -> n24769797950537728;\nn18577348462903296 -> n19140298416324608;\nn19140298416324608 -> n23362423066984448;\nn23362423066984448 -> n23643898043695104;\nn23362423066984448 -> n30680772461461504;\nn30680772461461504 -> n30962247438172160;\nn31243722414882816 -> n24769797950537728;\nn31243722414882816 -> n30962247438172160;\nn30962247438172160 -> n31243722414882816[style=dashed];\nn30962247438172160 -> n31525197391593472;\nn31525197391593472 -> n31806672368304128;\nn31525197391593472 -> n32088147345014784;\nn32088147345014784 -> n32369622321725440;\nn32088147345014784 -> n32651097298436096;\nn32651097298436096 -> n32932572275146752;\nn31806672368304128 -> n33214047251857408;\nn31806672368304128 -> n33495522228568064;\nn33495522228568064 -> n33214047251857408;\nn33495522228568064 -> n33776997205278720;\nn33776997205278720 -> n33214047251857408;\nn32369622321725440 -> n34621422135410688;\nn34621422135410688 -> n34058472181989376;\nn34621422135410688 -> n34339947158700032;\nn34339947158700032 -> n34621422135410688;\nn34339947158700032 -> n34902897112121344;\nn34902897112121344 -> n32932572275146752;\nn34058472181989376 -> n33495522228568064;\nn34058472181989376 -> n33214047251857408;\nn33214047251857408 -> n35184372088832000;\nn33214047251857408 -> n35465847065542656;\nn35465847065542656 -> n35184372088832000;\nn35465847065542656 -> n35747322042253312;\nn35747322042253312 -> n35184372088832000;\nn35184372088832000 -> n36028797018963968;\nn35184372088832000 -> n36310271995674624;\nn36310271995674624 -> n36028797018963968;\nn36028797018963968 -> n32932572275146752;\nn32932572275146752 -> n31243722414882816;\nn32932572275146752 -> n36591746972385280;\nn36591746972385280 -> n31243722414882816;\nn36591746972385280 -> n36873221949095936;\nn36873221949095936 -> n24769797950537728;\nn12384898975268864 -> n13510798882111488;\nn13510798882111488 -> n37154696925806592;\nn13510798882111488 -> n37436171902517248;\nn37436171902517248 -> n38843546786070528;\nn38843546786070528 -> n37717646879227904;\nn38843546786070528 -> n37999121855938560;\nn37999121855938560 -> n38280596832649216;\nn37999121855938560 -> n38562071809359872;\nn38562071809359872 -> n38843546786070528;\nn38562071809359872 -> n39125021762781184;\nn39125021762781184 -> n38280596832649216;\nn14355223812243456 -> n15481123719086080;\nn15481123719086080 -> n39406496739491840;\nn15481123719086080 -> n39687971716202496;\nn39687971716202496 -> n41095346599755776;\nn41095346599755776 -> n39969446692913152;\nn41095346599755776 -> n40250921669623808;\nn40250921669623808 -> n40532396646334464;\nn40250921669623808 -> n40813871623045120;\nn40813871623045120 -> n41095346599755776;\nn40813871623045120 -> n41376821576466432;\nn41376821576466432 -> n40532396646334464;\nn20266198323167232 -> n21392098230009856;\nn21392098230009856 -> n41658296553177088;\nn21392098230009856 -> n41939771529887744;\nn41939771529887744 -> n43347146413441024;\nn43347146413441024 -> n42221246506598400;\nn43347146413441024 -> n42502721483309056;\nn42502721483309056 -> n42784196460019712;\nn42502721483309056 -> n43065671436730368;\nn43065671436730368 -> n43347146413441024;\nn43065671436730368 -> n43628621390151680;\nn43628621390151680 -> n42784196460019712;\nn21673573206720512 -> n22799473113563136;\nn22799473113563136 -> n43910096366862336;\nn22799473113563136 -> n44191571343572992;\nn44191571343572992 -> n45598946227126272;\nn45598946227126272 -> n44473046320283648;\nn45598946227126272 -> n44754521296994304;\nn44754521296994304 -> n45035996273704960;\nn44754521296994304 -> n45317471250415616;\nn45317471250415616 -> n45598946227126272;\nn45317471250415616 -> n45880421203836928;\nn45880421203836928 -> n45035996273704960;\nn37154696925806592 -> n46161896180547584;\nn39406496739491840 -> n46443371157258240;\nn41658296553177088 -> n46724846133968896;\nn43910096366862336 -> n47006321110679552;\nn37717646879227904 -> n38280596832649216;\nn38280596832649216 -> n46161896180547584;\nn46161896180547584 -> n23643898043695104;\nn46161896180547584 -> n47287796087390208;\nn47287796087390208 -> n47569271064100864;\nn47850746040811520 -> n24769797950537728;\nn47850746040811520 -> n47569271064100864;\nn47569271064100864 -> n47850746040811520[style=dashed];\nn47569271064100864 -> n48132221017522176;\nn48132221017522176 -> n48413695994232832;\nn48132221017522176 -> n48695170970943488;\nn48695170970943488 -> n48976645947654144;\nn48695170970943488 -> n49258120924364800;\nn49258120924364800 -> n49539595901075456;\nn48413695994232832 -> n49821070877786112;\nn48413695994232832 -> n50102545854496768;\nn50102545854496768 -> n49821070877786112;\nn50102545854496768 -> n50384020831207424;\nn50384020831207424 -> n49821070877786112;\nn48976645947654144 -> n51228445761339392;\nn51228445761339392 -> n50665495807918080;\nn51228445761339392 -> n50946970784628736;\nn50946970784628736 -> n51228445761339392;\nn50946970784628736 -> n51509920738050048;\nn51509920738050048 -> n49539595901075456;\nn50665495807918080 -> n50102545854496768;\nn50665495807918080 -> n49821070877786112;\nn49821070877786112 -> n51791395714760704;\nn49821070877786112 -> n52072870691471360;\nn52072870691471360 -> n51791395714760704;\nn52072870691471360 -> n52354345668182016;\nn52354345668182016 -> n51791395714760704;\nn51791395714760704 -> n52635820644892672;\nn51791395714760704 -> n52917295621603328;\nn52917295621603328 -> n52635820644892672;\nn52635820644892672 -> n49539595901075456;\nn49539595901075456 -> n47850746040811520;\nn49539595901075456 -> n53198770598313984;\nn53198770598313984 -> n47850746040811520;\nn53198770598313984 -> n53480245575024640;\nn53480245575024640 -> n24769797950537728;\nn39969446692913152 -> n40532396646334464;\nn40532396646334464 -> n46443371157258240;\nn46443371157258240 -> n23643898043695104;\nn46443371157258240 -> n53761720551735296;\nn53761720551735296 -> n54043195528445952;\nn54324670505156608 -> n24769797950537728;\nn54324670505156608 -> n54043195528445952;\nn54043195528445952 -> n54324670505156608[style=dashed];\nn54043195528445952 -> n54606145481867264;\nn54606145481867264 -> n54887620458577920;\nn54606145481867264 -> n55169095435288576;\nn55169095435288576 -> n55450570411999232;\nn55169095435288576 -> n55732045388709888;\nn55732045388709888 -> n56013520365420544;\nn54887620458577920 -> n56294995342131200;\nn54887620458577920 -> n56576470318841856;\nn56576470318841856 -> n56294995342131200;\nn56576470318841856 -> n56857945295552512;\nn56857945295552512 -> n56294995342131200;\nn55450570411999232 -> n57702370225684480;\nn57702370225684480 -> n57139420272263168;\nn57702370225684480 -> n57420895248973824;\nn57420895248973824 -> n57702370225684480;\nn57420895248973824 -> n57983845202395136;\nn57983845202395136 -> n56013520365420544;\nn57139420272263168 -> n56576470318841856;\nn57139420272263168 -> n56294995342131200;\nn56294995342131200 -> n58265320179105792;\nn56294995342131200 -> n58546795155816448;\nn58546795155816448 -> n58265320179105792;\nn58546795155816448 -> n58828270132527104;\nn58828270132527104 -> n58265320179105792;\nn58265320179105792 -> n59109745109237760;\nn58265320179105792 -> n59391220085948416;\nn59391220085948416 -> n59109745109237760;\nn59109745109237760 -> n56013520365420544;\nn56013520365420544 -> n54324670505156608;\nn56013520365420544 -> n59672695062659072;\nn59672695062659072 -> n54324670505156608;\nn59672695062659072 -> n59954170039369728;\nn59954170039369728 -> n24769797950537728;\nn42221246506598400 -> n42784196460019712;\nn42784196460019712 -> n46724846133968896;\nn46724846133968896 -> n23643898043695104;\nn46724846133968896 -> n60235645016080384;\nn60235645016080384 -> n60517119992791040;\nn60798594969501696 -> n24769797950537728;\nn60798594969501696 -> n60517119992791040;\nn60517119992791040 -> n60798594969501696[style=dashed];\nn60517119992791040 -> n61080069946212352;\nn61080069946212352 -> n61361544922923008;\nn61080069946212352 -> n61643019899633664;\nn61643019899633664 -> n61924494876344320;\nn61643019899633664 -> n62205969853054976;\nn62205969853054976 -> n62487444829765632;\nn61361544922923008 -> n62768919806476288;\nn61361544922923008 -> n63050394783186944;\nn63050394783186944 -> n62768919806476288;\nn63050394783186944 -> n63331869759897600;\nn63331869759897600 -> n62768919806476288;\nn61924494876344320 -> n64176294690029568;\nn64176294690029568 -> n63613344736608256;\nn64176294690029568 -> n63894819713318912;\nn63894819713318912 -> n64176294690029568;\nn63894819713318912 -> n64457769666740224;\nn64457769666740224 -> n62487444829765632;\nn63613344736608256 -> n63050394783186944;\nn63613344736608256 -> n62768919806476288;\nn62768919806476288 -> n64739244643450880;\nn62768919806476288 -> n65020719620161536;\nn65020719620161536 -> n64739244643450880;\nn65020719620161536 -> n65302194596872192;\nn65302194596872192 -> n64739244643450880;\nn64739244643450880 -> n65583669573582848;\nn64739244643450880 -> n65865144550293504;\nn65865144550293504 -> n65583669573582848;\nn65583669573582848 -> n62487444829765632;\nn62487444829765632 -> n60798594969501696;\nn62487444829765632 -> n66146619527004160;\nn66146619527004160 -> n60798594969501696;\nn66146619527004160 -> n66428094503714816;\nn66428094503714816 -> n24769797950537728;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n47006321110679552;\nn47006321110679552 -> n23643898043695104;\nn47006321110679552 -> n66709569480425472;\nn66709569480425472 -> n66991044457136128;\nn67272519433846784 -> n24769797950537728;\nn67272519433846784 -> n66991044457136128;\nn66991044457136128 -> n67272519433846784[style=dashed];\nn66991044457136128 -> n67553994410557440;\nn67553994410557440 -> n67835469387268096;\nn67553994410557440 -> n68116944363978752;\nn68116944363978752 -> n68398419340689408;\nn68116944363978752 -> n68679894317400064;\nn68679894317400064 -> n68961369294110720;\nn67835469387268096 -> n69242844270821376;\nn67835469387268096 -> n69524319247532032;\nn69524319247532032 -> n69242844270821376;\nn69524319247532032 -> n69805794224242688;\nn69805794224242688 -> n69242844270821376;\nn68398419340689408 -> n70650219154374656;\nn70650219154374656 -> n70087269200953344;\nn70650219154374656 -> n70368744177664000;\nn70368744177664000 -> n70650219154374656;\nn70368744177664000 -> n70931694131085312;\nn70931694131085312 -> n68961369294110720;\nn70087269200953344 -> n69524319247532032;\nn70087269200953344 -> n69242844270821376;\nn69242844270821376 -> n71213169107795968;\nn69242844270821376 -> n71494644084506624;\nn71494644084506624 -> n71213169107795968;\nn71494644084506624 -> n71776119061217280;\nn71776119061217280 -> n71213169107795968;\nn71213169107795968 -> n72057594037927936;\nn71213169107795968 -> n72339069014638592;\nn72339069014638592 -> n72057594037927936;\nn72057594037927936 -> n68961369294110720;\nn68961369294110720 -> n67272519433846784;\nn68961369294110720 -> n72620543991349248;\nn72620543991349248 -> n67272519433846784;\nn72620543991349248 -> n72902018968059904;\nn72902018968059904 -> n24769797950537728;\nn23643898043695104 -> n24769797950537728;\nn24769797950537728 -> n1125899906842624[style=dashed];\nn24769797950537728 -> n73183493944770560;\nn73183493944770560 -> n73464968921481216;\nn73183493944770560 -> n73746443898191872;\nn73746443898191872 -> n74027918874902528;\nn74309393851613184 -> n73464968921481216;\nn74309393851613184 -> n74027918874902528;\nn74027918874902528 -> n74590868828323840;\nn74027918874902528 -> n74872343805034496;\nn74872343805034496 -> n74590868828323840;\nn74872343805034496 -> n75153818781745152;\nn75153818781745152 -> n74590868828323840;\nn75153818781745152 -> n75435293758455808;\nn75435293758455808 -> n75716768735166464;\nn75435293758455808 -> n75998243711877120;\nn75998243711877120 -> n76279718688587776;\nn75998243711877120 -> n76561193665298432;\nn76561193665298432 -> n76842668642009088;\nn75716768735166464 -> n77124143618719744;\nn75716768735166464 -> n77405618595430400;\nn77405618595430400 -> n77124143618719744;\nn77405618595430400 -> n77687093572141056;\nn77687093572141056 -> n77124143618719744;\nn76279718688587776 -> n78531518502273024;\nn78531518502273024 -> n77968568548851712;\nn78531518502273024 -> n78250043525562368;\nn78250043525562368 -> n78531518502273024;\nn78250043525562368 -> n78812993478983680;\nn78812993478983680 -> n79094468455694336;\nn77968568548851712 -> n77405618595430400;\nn77968568548851712 -> n77124143618719744;\nn77124143618719744 -> n79375943432404992;\nn77124143618719744 -> n79657418409115648;\nn79657418409115648 -> n79375943432404992;\nn79657418409115648 -> n79938893385826304;\nn79938893385826304 -> n79375943432404992;\nn79375943432404992 -> n79094468455694336;\nn79375943432404992 -> n80220368362536960;\nn80220368362536960 -> n79094468455694336;\nn79094468455694336 -> n74590868828323840;\nn79094468455694336 -> n76842668642009088;\nn76842668642009088 -> n74590868828323840;\nn76842668642009088 -> n80501843339247616;\nn80501843339247616 -> n74590868828323840;\nn74590868828323840 -> n80783318315958272;\nn74590868828323840 -> n81064793292668928;\nn81064793292668928 -> n81346268269379584;\nn81064793292668928 -> n81627743246090240;\nn81627743246090240 -> n81909218222800896;\nn81627743246090240 -> n82190693199511552;\nn82190693199511552 -> n82472168176222208;\nn82472168176222208 -> n82472168176222208[style=dashed];\nn82472168176222208 -> n82753643152932864;\nn82753643152932864 -> n83035118129643520;\nn80783318315958272 -> n83316593106354176;\nn80783318315958272 -> n83598068083064832;\nn83598068083064832 -> n83879543059775488;\nn83598068083064832 -> n84161018036486144;\nn84161018036486144 -> n84442493013196800;\nn84442493013196800 -> n84442493013196800[style=dashed];\nn84442493013196800 -> n84723967989907456;\nn84723967989907456 -> n85005442966618112;\nn81346268269379584 -> n85286917943328768;\nn81346268269379584 -> n85568392920039424;\nn85568392920039424 -> n85849867896750080;\nn85568392920039424 -> n86131342873460736;\nn86131342873460736 -> n86412817850171392;\nn86412817850171392 -> n86412817850171392[style=dashed];\nn86412817850171392 -> n86694292826882048;\nn86694292826882048 -> n86975767803592704;\nn83316593106354176 -> n87257242780303360;\nn83316593106354176 -> n87538717757014016;\nn87538717757014016 -> n87820192733724672;\nn87538717757014016 -> n88101667710435328;\nn88101667710435328 -> n88383142687145984;\nn88383142687145984 -> n88383142687145984[style=dashed];\nn88383142687145984 -> n88664617663856640;\nn88664617663856640 -> n88946092640567296;\nn81909218222800896 -> n83035118129643520;\nn83035118129643520 -> n89227567617277952;\nn83035118129643520 -> n89509042593988608;\nn89509042593988608 -> n90916417477541888;\nn90916417477541888 -> n89790517570699264;\nn90916417477541888 -> n90071992547409920;\nn90071992547409920 -> n90353467524120576;\nn90071992547409920 -> n90634942500831232;\nn90634942500831232 -> n90916417477541888;\nn90634942500831232 -> n91197892454252544;\nn91197892454252544 -> n90353467524120576;\nn83879543059775488 -> n85005442966618112;\nn85005442966618112 -> n91479367430963200;\nn85005442966618112 -> n91760842407673856;\nn91760842407673856 -> n93168217291227136;\nn93168217291227136 -> n92042317384384512;\nn93168217291227136 -> n92323792361095168;\nn92323792361095168 -> n92605267337805824;\nn92323792361095168 -> n92886742314516480;\nn92886742314516480 -> n93168217291227136;\nn92886742314516480 -> n93449692267937792;\nn93449692267937792 -> n92605267337805824;\nn85286917943328768 -> n93731167244648448;\nn85286917943328768 -> n94012642221359104;\nn94012642221359104 -> n94294117198069760;\nn94294117198069760 -> n94294117198069760[style=dashed];\nn94294117198069760 -> n94575592174780416;\nn94575592174780416 -> n94857067151491072;\nn87257242780303360 -> n95138542128201728;\nn87257242780303360 -> n95420017104912384;\nn95420017104912384 -> n95701492081623040;\nn95701492081623040 -> n95701492081623040[style=dashed];\nn95701492081623040 -> n95982967058333696;\nn95982967058333696 -> n96264442035044352;\nn89227567617277952 -> n96545917011755008;\nn91479367430963200 -> n96827391988465664;\nn89790517570699264 -> n90353467524120576;\nn90353467524120576 -> n96545917011755008;\nn96545917011755008 -> n97108866965176320;\nn96545917011755008 -> n97390341941886976;\nn97390341941886976 -> n97671816918597632;\nn97953291895308288 -> n98234766872018944;\nn97953291895308288 -> n97671816918597632;\nn97671816918597632 -> n97953291895308288[style=dashed];\nn97671816918597632 -> n98516241848729600;\nn98516241848729600 -> n98797716825440256;\nn98516241848729600 -> n99079191802150912;\nn99079191802150912 -> n99360666778861568;\nn99079191802150912 -> n99642141755572224;\nn99642141755572224 -> n99923616732282880;\nn98797716825440256 -> n100205091708993536;\nn98797716825440256 -> n100486566685704192;\nn100486566685704192 -> n100205091708993536;\nn100486566685704192 -> n100768041662414848;\nn100768041662414848 -> n100205091708993536;\nn99360666778861568 -> n101612466592546816;\nn101612466592546816 -> n101049516639125504;\nn101612466592546816 -> n101330991615836160;\nn101330991615836160 -> n101612466592546816;\nn101330991615836160 -> n101893941569257472;\nn101893941569257472 -> n99923616732282880;\nn101049516639125504 -> n100486566685704192;\nn101049516639125504 -> n100205091708993536;\nn100205091708993536 -> n102175416545968128;\nn100205091708993536 -> n102456891522678784;\nn102456891522678784 -> n102175416545968128;\nn102456891522678784 -> n102738366499389440;\nn102738366499389440 -> n102175416545968128;\nn102175416545968128 -> n103019841476100096;\nn102175416545968128 -> n103301316452810752;\nn103301316452810752 -> n103019841476100096;\nn103019841476100096 -> n99923616732282880;\nn99923616732282880 -> n97953291895308288;\nn99923616732282880 -> n103582791429521408;\nn103582791429521408 -> n97953291895308288;\nn103582791429521408 -> n103864266406232064;\nn103864266406232064 -> n98234766872018944;\nn92042317384384512 -> n92605267337805824;\nn92605267337805824 -> n96827391988465664;\nn96827391988465664 -> n97108866965176320;\nn96827391988465664 -> n104145741382942720;\nn104145741382942720 -> n104427216359653376;\nn104708691336364032 -> n98234766872018944;\nn104708691336364032 -> n104427216359653376;\nn104427216359653376 -> n104708691336364032[style=dashed];\nn104427216359653376 -> n104990166313074688;\nn104990166313074688 -> n105271641289785344;\nn104990166313074688 -> n105553116266496000;\nn105553116266496000 -> n105834591243206656;\nn105553116266496000 -> n106116066219917312;\nn106116066219917312 -> n106397541196627968;\nn105271641289785344 -> n106679016173338624;\nn105271641289785344 -> n106960491150049280;\nn106960491150049280 -> n106679016173338624;\nn106960491150049280 -> n107241966126759936;\nn107241966126759936 -> n106679016173338624;\nn105834591243206656 -> n108086391056891904;\nn108086391056891904 -> n107523441103470592;\nn108086391056891904 -> n107804916080181248;\nn107804916080181248 -> n108086391056891904;\nn107804916080181248 -> n108367866033602560;\nn108367866033602560 -> n106397541196627968;\nn107523441103470592 -> n106960491150049280;\nn107523441103470592 -> n106679016173338624;\nn106679016173338624 -> n108649341010313216;\nn106679016173338624 -> n108930815987023872;\nn108930815987023872 -> n108649341010313216;\nn108930815987023872 -> n109212290963734528;\nn109212290963734528 -> n108649341010313216;\nn108649341010313216 -> n109493765940445184;\nn108649341010313216 -> n109775240917155840;\nn109775240917155840 -> n109493765940445184;\nn109493765940445184 -> n106397541196627968;\nn106397541196627968 -> n104708691336364032;\nn106397541196627968 -> n110056715893866496;\nn110056715893866496 -> n104708691336364032;\nn110056715893866496 -> n110338190870577152;\nn110338190870577152 -> n98234766872018944;\nn85849867896750080 -> n86975767803592704;\nn86975767803592704 -> n110619665847287808;\nn86975767803592704 -> n110901140823998464;\nn110901140823998464 -> n112308515707551744;\nn112308515707551744 -> n111182615800709120;\nn112308515707551744 -> n111464090777419776;\nn111464090777419776 -> n111745565754130432;\nn111464090777419776 -> n112027040730841088;\nn112027040730841088 -> n112308515707551744;\nn112027040730841088 -> n112589990684262400;\nn112589990684262400 -> n111745565754130432;\nn87820192733724672 -> n88946092640567296;\nn88946092640567296 -> n112871465660973056;\nn88946092640567296 -> n113152940637683712;\nn113152940637683712 -> n114560315521236992;\nn114560315521236992 -> n113434415614394368;\nn114560315521236992 -> n113715890591105024;\nn113715890591105024 -> n113997365567815680;\nn113715890591105024 -> n114278840544526336;\nn114278840544526336 -> n114560315521236992;\nn114278840544526336 -> n114841790497947648;\nn114841790497947648 -> n113997365567815680;\nn93731167244648448 -> n94857067151491072;\nn94857067151491072 -> n115123265474658304;\nn94857067151491072 -> n115404740451368960;\nn115404740451368960 -> n116812115334922240;\nn116812115334922240 -> n115686215428079616;\nn116812115334922240 -> n115967690404790272;\nn115967690404790272 -> n116249165381500928;\nn115967690404790272 -> n116530640358211584;\nn116530640358211584 -> n116812115334922240;\nn116530640358211584 -> n117093590311632896;\nn117093590311632896 -> n116249165381500928;\nn95138542128201728 -> n96264442035044352;\nn96264442035044352 -> n117375065288343552;\nn96264442035044352 -> n117656540265054208;\nn117656540265054208 -> n119063915148607488;\nn119063915148607488 -> n117938015241764864;\nn119063915148607488 -> n118219490218475520;\nn118219490218475520 -> n118500965195186176;\nn118219490218475520 -> n118782440171896832;\nn118782440171896832 -> n119063915148607488;\nn118782440171896832 -> n119345390125318144;\nn119345390125318144 -> n118500965195186176;\nn110619665847287808 -> n119626865102028800;\nn112871465660973056 -> n119908340078739456;\nn115123265474658304 -> n120189815055450112;\nn117375065288343552 -> n120471290032160768;\nn111182615800709120 -> n111745565754130432;\nn111745565754130432 -> n119626865102028800;\nn119626865102028800 -> n97108866965176320;\nn119626865102028800 -> n120752765008871424;\nn120752765008871424 -> n121034239985582080;\nn121315714962292736 -> n98234766872018944;\nn121315714962292736 -> n121034239985582080;\nn121034239985582080 -> n121315714962292736[style=dashed];\nn121034239985582080 -> n121597189939003392;\nn121597189939003392 -> n121878664915714048;\nn121597189939003392 -> n122160139892424704;\nn122160139892424704 -> n122441614869135360;\nn122160139892424704 -> n122723089845846016;\nn122723089845846016 -> n123004564822556672;\nn121878664915714048 -> n123286039799267328;\nn121878664915714048 -> n123567514775977984;\nn123567514775977984 -> n123286039799267328;\nn123567514775977984 -> n123848989752688640;\nn123848989752688640 -> n123286039799267328;\nn122441614869135360 -> n124693414682820608;\nn124693414682820608 -> n124130464729399296;\nn124693414682820608 -> n124411939706109952;\nn124411939706109952 -> n124693414682820608;\nn124411939706109952 -> n124974889659531264;\nn124974889659531264 -> n123004564822556672;\nn124130464729399296 -> n123567514775977984;\nn124130464729399296 -> n123286039799267328;\nn123286039799267328 -> n125256364636241920;\nn123286039799267328 -> n125537839612952576;\nn125537839612952576 -> n125256364636241920;\nn125537839612952576 -> n125819314589663232;\nn125819314589663232 -> n125256364636241920;\nn125256364636241920 -> n126100789566373888;\nn125256364636241920 -> n126382264543084544;\nn126382264543084544 -> n126100789566373888;\nn126100789566373888 -> n123004564822556672;\nn123004564822556672 -> n121315714962292736;\nn123004564822556672 -> n126663739519795200;\nn126663739519795200 -> n121315714962292736;\nn126663739519795200 -> n126945214496505856;\nn126945214496505856 -> n98234766872018944;\nn113434415614394368 -> n113997365567815680;\nn113997365567815680 -> n119908340078739456;\nn119908340078739456 -> n97108866965176320;\nn119908340078739456 -> n127226689473216512;\nn127226689473216512 -> n127508164449927168;\nn127789639426637824 -> n98234766872018944;\nn127789639426637824 -> n127508164449927168;\nn127508164449927168 -> n127789639426637824[style=dashed];\nn127508164449927168 -> n128071114403348480;\nn128071114403348480 -> n128352589380059136;\nn128071114403348480 -> n128634064356769792;\nn128634064356769792 -> n128915539333480448;\nn128634064356769792 -> n129197014310191104;\nn129197014310191104 -> n129478489286901760;\nn128352589380059136 -> n129759964263612416;\nn128352589380059136 -> n130041439240323072;\nn130041439240323072 -> n129759964263612416;\nn130041439240323072 -> n130322914217033728;\nn130322914217033728 -> n129759964263612416;\nn128915539333480448 -> n131167339147165696;\nn131167339147165696 -> n130604389193744384;\nn131167339147165696 -> n130885864170455040;\nn130885864170455040 -> n131167339147165696;\nn130885864170455040 -> n131448814123876352;\nn131448814123876352 -> n129478489286901760;\nn130604389193744384 -> n130041439240323072;\nn130604389193744384 -> n129759964263612416;\nn129759964263612416 -> n131730289100587008;\nn129759964263612416 -> n132011764077297664;\nn132011764077297664 -> n131730289100587008;\nn132011764077297664 -> n132293239054008320;\nn132293239054008320 -> n131730289100587008;\nn131730289100587008 -> n132574714030718976;\nn131730289100587008 -> n132856189007429632;\nn132856189007429632 -> n132574714030718976;\nn132574714030718976 -> n129478489286901760;\nn129478489286901760 -> n127789639426637824;\nn129478489286901760 -> n133137663984140288;\nn133137663984140288 -> n127789639426637824;\nn133137663984140288 -> n133419138960850944;\nn133419138960850944 -> n98234766872018944;\nn115686215428079616 -> n116249165381500928;\nn116249165381500928 -> n120189815055450112;\nn120189815055450112 -> n97108866965176320;\nn120189815055450112 -> n133700613937561600;\nn133700613937561600 -> n133982088914272256;\nn134263563890982912 -> n98234766872018944;\nn134263563890982912 -> n133982088914272256;\nn133982088914272256 -> n134263563890982912[style=dashed];\nn133982088914272256 -> n134545038867693568;\nn134545038867693568 -> n134826513844404224;\nn134545038867693568 -> n135107988821114880;\nn135107988821114880 -> n135389463797825536;\nn135107988821114880 -> n135670938774536192;\nn135670938774536192 -> n135952413751246848;\nn134826513844404224 -> n136233888727957504;\nn134826513844404224 -> n136515363704668160;\nn136515363704668160 -> n136233888727957504;\nn136515363704668160 -> n136796838681378816;\nn136796838681378816 -> n136233888727957504;\nn135389463797825536 -> n137641263611510784;\nn137641263611510784 -> n137078313658089472;\nn137641263611510784 -> n137359788634800128;\nn137359788634800128 -> n137641263611510784;\nn137359788634800128 -> n137922738588221440;\nn137922738588221440 -> n135952413751246848;\nn137078313658089472 -> n136515363704668160;\nn137078313658089472 -> n136233888727957504;\nn136233888727957504 -> n138204213564932096;\nn136233888727957504 -> n138485688541642752;\nn138485688541642752 -> n138204213564932096;\nn138485688541642752 -> n138767163518353408;\nn138767163518353408 -> n138204213564932096;\nn138204213564932096 -> n139048638495064064;\nn138204213564932096 -> n139330113471774720;\nn139330113471774720 -> n139048638495064064;\nn139048638495064064 -> n135952413751246848;\nn135952413751246848 -> n134263563890982912;\nn135952413751246848 -> n139611588448485376;\nn139611588448485376 -> n134263563890982912;\nn139611588448485376 -> n139893063425196032;\nn139893063425196032 -> n98234766872018944;\nn117938015241764864 -> n118500965195186176;\nn118500965195186176 -> n120471290032160768;\nn120471290032160768 -> n97108866965176320;\nn120471290032160768 -> n140174538401906688;\nn140174538401906688 -> n140456013378617344;\nn140737488355328000 -> n98234766872018944;\nn140737488355328000 -> n140456013378617344;\nn140456013378617344 -> n140737488355328000[style=dashed];\nn140456013378617344 -> n141018963332038656;\nn141018963332038656 -> n141300438308749312;\nn141018963332038656 -> n141581913285459968;\nn141581913285459968 -> n141863388262170624;\nn141581913285459968 -> n142144863238881280;\nn142144863238881280 -> n142426338215591936;\nn141300438308749312 -> n142707813192302592;\nn141300438308749312 -> n142989288169013248;\nn142989288169013248 -> n142707813192302592;\nn142989288169013248 -> n143270763145723904;\nn143270763145723904 -> n142707813192302592;\nn141863388262170624 -> n144115188075855872;\nn144115188075855872 -> n143552238122434560;\nn144115188075855872 -> n143833713099145216;\nn143833713099145216 -> n144115188075855872;\nn143833713099145216 -> n144396663052566528;\nn144396663052566528 -> n142426338215591936;\nn143552238122434560 -> n142989288169013248;\nn143552238122434560 -> n142707813192302592;\nn142707813192302592 -> n144678138029277184;\nn142707813192302592 -> n144959613005987840;\nn144959613005987840 -> n144678138029277184;\nn144959613005987840 -> n145241087982698496;\nn145241087982698496 -> n144678138029277184;\nn144678138029277184 -> n145522562959409152;\nn144678138029277184 -> n145804037936119808;\nn145804037936119808 -> n145522562959409152;\nn145522562959409152 -> n142426338215591936;\nn142426338215591936 -> n140737488355328000;\nn142426338215591936 -> n146085512912830464;\nn146085512912830464 -> n140737488355328000;\nn146085512912830464 -> n98234766872018944;\nn98234766872018944 -> n146366987889541120;\nn98234766872018944 -> n146648462866251776;\nn146648462866251776 -> n146929937842962432;\nn97108866965176320 -> n146929937842962432;\nn97108866965176320 -> n146366987889541120;\nn146366987889541120 -> n74309393851613184;\nn146366987889541120 -> n146929937842962432;\nn146929937842962432 -> n73464968921481216;\nn146929937842962432 -> n147211412819673088;\nn147211412819673088 -> n147492887796383744;\nn147211412819673088 -> n147774362773094400;\nn147774362773094400 -> n147492887796383744;\nn147774362773094400 -> n148055837749805056;\nn148055837749805056 -> n147492887796383744;\nn148055837749805056 -> n148337312726515712;\nn148337312726515712 -> n148618787703226368;\nn148337312726515712 -> n148900262679937024;\nn148900262679937024 -> n149181737656647680;\nn148900262679937024 -> n149463212633358336;\nn149463212633358336 -> n149744687610068992;\nn148618787703226368 -> n150026162586779648;\nn148618787703226368 -> n150307637563490304;\nn150307637563490304 -> n150026162586779648;\nn150307637563490304 -> n150589112540200960;\nn150589112540200960 -> n150026162586779648;\nn149181737656647680 -> n151433537470332928;\nn151433537470332928 -> n150870587516911616;\nn151433537470332928 -> n151152062493622272;\nn151152062493622272 -> n151433537470332928;\nn151152062493622272 -> n151715012447043584;\nn151715012447043584 -> n151996487423754240;\nn150870587516911616 -> n150307637563490304;\nn150870587516911616 -> n150026162586779648;\nn150026162586779648 -> n152277962400464896;\nn150026162586779648 -> n152559437377175552;\nn152559437377175552 -> n152277962400464896;\nn152559437377175552 -> n152840912353886208;\nn152840912353886208 -> n152277962400464896;\nn152277962400464896 -> n151996487423754240;\nn152277962400464896 -> n153122387330596864;\nn153122387330596864 -> n151996487423754240;\nn151996487423754240 -> n147492887796383744;\nn151996487423754240 -> n149744687610068992;\nn149744687610068992 -> n147492887796383744;\nn149744687610068992 -> n153403862307307520;\nn153403862307307520 -> n147492887796383744;\nn147492887796383744 -> n153685337284018176;\nn147492887796383744 -> n153966812260728832;\nn153966812260728832 -> n154248287237439488;\nn153966812260728832 -> n154529762214150144;\nn154529762214150144 -> n154811237190860800;\nn154529762214150144 -> n155092712167571456;\nn155092712167571456 -> n155374187144282112;\nn155374187144282112 -> n155374187144282112[style=dashed];\nn155374187144282112 -> n155655662120992768;\nn155655662120992768 -> n155937137097703424;\nn153685337284018176 -> n156218612074414080;\nn153685337284018176 -> n156500087051124736;\nn156500087051124736 -> n156781562027835392;\nn156500087051124736 -> n157063037004546048;\nn157063037004546048 -> n157344511981256704;\nn157344511981256704 -> n157344511981256704[style=dashed];\nn157344511981256704 -> n157625986957967360;\nn157625986957967360 -> n157907461934678016;\nn154248287237439488 -> n158188936911388672;\nn154248287237439488 -> n158470411888099328;\nn158470411888099328 -> n158751886864809984;\nn158470411888099328 -> n159033361841520640;\nn159033361841520640 -> n159314836818231296;\nn159314836818231296 -> n159314836818231296[style=dashed];\nn159314836818231296 -> n159596311794941952;\nn159596311794941952 -> n159877786771652608;\nn156218612074414080 -> n160159261748363264;\nn156218612074414080 -> n160440736725073920;\nn160440736725073920 -> n160722211701784576;\nn160440736725073920 -> n161003686678495232;\nn161003686678495232 -> n161285161655205888;\nn161285161655205888 -> n161285161655205888[style=dashed];\nn161285161655205888 -> n161566636631916544;\nn161566636631916544 -> n161848111608627200;\nn154811237190860800 -> n155937137097703424;\nn155937137097703424 -> n162129586585337856;\nn155937137097703424 -> n162411061562048512;\nn162411061562048512 -> n163818436445601792;\nn163818436445601792 -> n162692536538759168;\nn163818436445601792 -> n162974011515469824;\nn162974011515469824 -> n163255486492180480;\nn162974011515469824 -> n163536961468891136;\nn163536961468891136 -> n163818436445601792;\nn163536961468891136 -> n164099911422312448;\nn164099911422312448 -> n163255486492180480;\nn156781562027835392 -> n157907461934678016;\nn157907461934678016 -> n164381386399023104;\nn157907461934678016 -> n164662861375733760;\nn164662861375733760 -> n166070236259287040;\nn166070236259287040 -> n164944336352444416;\nn166070236259287040 -> n165225811329155072;\nn165225811329155072 -> n165507286305865728;\nn165225811329155072 -> n165788761282576384;\nn165788761282576384 -> n166070236259287040;\nn165788761282576384 -> n166351711235997696;\nn166351711235997696 -> n165507286305865728;\nn158188936911388672 -> n166633186212708352;\nn158188936911388672 -> n166914661189419008;\nn166914661189419008 -> n167196136166129664;\nn167196136166129664 -> n167196136166129664[style=dashed];\nn167196136166129664 -> n167477611142840320;\nn167477611142840320 -> n167759086119550976;\nn160159261748363264 -> n168040561096261632;\nn160159261748363264 -> n168322036072972288;\nn168322036072972288 -> n168603511049682944;\nn168603511049682944 -> n168603511049682944[style=dashed];\nn168603511049682944 -> n168884986026393600;\nn168884986026393600 -> n169166461003104256;\nn162129586585337856 -> n169447935979814912;\nn164381386399023104 -> n169729410956525568;\nn162692536538759168 -> n163255486492180480;\nn163255486492180480 -> n169447935979814912;\nn169447935979814912 -> n170010885933236224;\nn169447935979814912 -> n170292360909946880;\nn170292360909946880 -> n170573835886657536;\nn170855310863368192 -> n171136785840078848;\nn170855310863368192 -> n170573835886657536;\nn170573835886657536 -> n170855310863368192[style=dashed];\nn170573835886657536 -> n171418260816789504;\nn171418260816789504 -> n171699735793500160;\nn171418260816789504 -> n171981210770210816;\nn171981210770210816 -> n172262685746921472;\nn171981210770210816 -> n172544160723632128;\nn172544160723632128 -> n172825635700342784;\nn171699735793500160 -> n173107110677053440;\nn171699735793500160 -> n173388585653764096;\nn173388585653764096 -> n173107110677053440;\nn173388585653764096 -> n173670060630474752;\nn173670060630474752 -> n173107110677053440;\nn172262685746921472 -> n174514485560606720;\nn174514485560606720 -> n173951535607185408;\nn174514485560606720 -> n174233010583896064;\nn174233010583896064 -> n174514485560606720;\nn174233010583896064 -> n174795960537317376;\nn174795960537317376 -> n172825635700342784;\nn173951535607185408 -> n173388585653764096;\nn173951535607185408 -> n173107110677053440;\nn173107110677053440 -> n175077435514028032;\nn173107110677053440 -> n175358910490738688;\nn175358910490738688 -> n175077435514028032;\nn175358910490738688 -> n175640385467449344;\nn175640385467449344 -> n175077435514028032;\nn175077435514028032 -> n175921860444160000;\nn175077435514028032 -> n176203335420870656;\nn176203335420870656 -> n175921860444160000;\nn175921860444160000 -> n172825635700342784;\nn172825635700342784 -> n170855310863368192;\nn172825635700342784 -> n176484810397581312;\nn176484810397581312 -> n170855310863368192;\nn176484810397581312 -> n176766285374291968;\nn176766285374291968 -> n171136785840078848;\nn164944336352444416 -> n165507286305865728;\nn165507286305865728 -> n169729410956525568;\nn169729410956525568 -> n170010885933236224;\nn169729410956525568 -> n177047760351002624;\nn177047760351002624 -> n177329235327713280;\nn177610710304423936 -> n171136785840078848;\nn177610710304423936 -> n177329235327713280;\nn177329235327713280 -> n177610710304423936[style=dashed];\nn177329235327713280 -> n177892185281134592;\nn177892185281134592 -> n178173660257845248;\nn177892185281134592 -> n178455135234555904;\nn178455135234555904 -> n178736610211266560;\nn178455135234555904 -> n179018085187977216;\nn179018085187977216 -> n179299560164687872;\nn178173660257845248 -> n179581035141398528;\nn178173660257845248 -> n179862510118109184;\nn179862510118109184 -> n179581035141398528;\nn179862510118109184 -> n180143985094819840;\nn180143985094819840 -> n179581035141398528;\nn178736610211266560 -> n180988410024951808;\nn180988410024951808 -> n180425460071530496;\nn180988410024951808 -> n180706935048241152;\nn180706935048241152 -> n180988410024951808;\nn180706935048241152 -> n181269885001662464;\nn181269885001662464 -> n179299560164687872;\nn180425460071530496 -> n179862510118109184;\nn180425460071530496 -> n179581035141398528;\nn179581035141398528 -> n181551359978373120;\nn179581035141398528 -> n181832834955083776;\nn181832834955083776 -> n181551359978373120;\nn181832834955083776 -> n182114309931794432;\nn182114309931794432 -> n181551359978373120;\nn181551359978373120 -> n182395784908505088;\nn181551359978373120 -> n182677259885215744;\nn182677259885215744 -> n182395784908505088;\nn182395784908505088 -> n179299560164687872;\nn179299560164687872 -> n177610710304423936;\nn179299560164687872 -> n182958734861926400;\nn182958734861926400 -> n177610710304423936;\nn182958734861926400 -> n183240209838637056;\nn183240209838637056 -> n171136785840078848;\nn158751886864809984 -> n159877786771652608;\nn159877786771652608 -> n183521684815347712;\nn159877786771652608 -> n183803159792058368;\nn183803159792058368 -> n185210534675611648;\nn185210534675611648 -> n184084634768769024;\nn185210534675611648 -> n184366109745479680;\nn184366109745479680 -> n184647584722190336;\nn184366109745479680 -> n184929059698900992;\nn184929059698900992 -> n185210534675611648;\nn184929059698900992 -> n185492009652322304;\nn185492009652322304 -> n184647584722190336;\nn160722211701784576 -> n161848111608627200;\nn161848111608627200 -> n185773484629032960;\nn161848111608627200 -> n186054959605743616;\nn186054959605743616 -> n187462334489296896;\nn187462334489296896 -> n186336434582454272;\nn187462334489296896 -> n186617909559164928;\nn186617909559164928 -> n186899384535875584;\nn186617909559164928 -> n187180859512586240;\nn187180859512586240 -> n187462334489296896;\nn187180859512586240 -> n187743809466007552;\nn187743809466007552 -> n186899384535875584;\nn166633186212708352 -> n167759086119550976;\nn167759086119550976 -> n188025284442718208;\nn167759086119550976 -> n188306759419428864;\nn188306759419428864 -> n189714134302982144;\nn189714134302982144 -> n188588234396139520;\nn189714134302982144 -> n188869709372850176;\nn188869709372850176 -> n189151184349560832;\nn188869709372850176 -> n189432659326271488;\nn189432659326271488 -> n189714134302982144;\nn189432659326271488 -> n189995609279692800;\nn189995609279692800 -> n189151184349560832;\nn168040561096261632 -> n169166461003104256;\nn169166461003104256 -> n190277084256403456;\nn169166461003104256 -> n190558559233114112;\nn190558559233114112 -> n191965934116667392;\nn191965934116667392 -> n190840034209824768;\nn191965934116667392 -> n191121509186535424;\nn191121509186535424 -> n191402984163246080;\nn191121509186535424 -> n191684459139956736;\nn191684459139956736 -> n191965934116667392;\nn191684459139956736 -> n192247409093378048;\nn192247409093378048 -> n191402984163246080;\nn183521684815347712 -> n192528884070088704;\nn185773484629032960 -> n192810359046799360;\nn188025284442718208 -> n193091834023510016;\nn190277084256403456 -> n193373309000220672;\nn184084634768769024 -> n184647584722190336;\nn184647584722190336 -> n192528884070088704;\nn192528884070088704 -> n170010885933236224;\nn192528884070088704 -> n193654783976931328;\nn193654783976931328 -> n193936258953641984;\nn194217733930352640 -> n171136785840078848;\nn194217733930352640 -> n193936258953641984;\nn193936258953641984 -> n194217733930352640[style=dashed];\nn193936258953641984 -> n194499208907063296;\nn194499208907063296 -> n194780683883773952;\nn194499208907063296 -> n195062158860484608;\nn195062158860484608 -> n195343633837195264;\nn195062158860484608 -> n195625108813905920;\nn195625108813905920 -> n195906583790616576;\nn194780683883773952 -> n196188058767327232;\nn194780683883773952 -> n196469533744037888;\nn196469533744037888 -> n196188058767327232;\nn196469533744037888 -> n196751008720748544;\nn196751008720748544 -> n196188058767327232;\nn195343633837195264 -> n197595433650880512;\nn197595433650880512 -> n197032483697459200;\nn197595433650880512 -> n197313958674169856;\nn197313958674169856 -> n197595433650880512;\nn197313958674169856 -> n197876908627591168;\nn197876908627591168 -> n195906583790616576;\nn197032483697459200 -> n196469533744037888;\nn197032483697459200 -> n196188058767327232;\nn196188058767327232 -> n198158383604301824;\nn196188058767327232 -> n198439858581012480;\nn198439858581012480 -> n198158383604301824;\nn198439858581012480 -> n198721333557723136;\nn198721333557723136 -> n198158383604301824;\nn198158383604301824 -> n199002808534433792;\nn198158383604301824 -> n199284283511144448;\nn199284283511144448 -> n199002808534433792;\nn199002808534433792 -> n195906583790616576;\nn195906583790616576 -> n194217733930352640;\nn195906583790616576 -> n199565758487855104;\nn199565758487855104 -> n194217733930352640;\nn199565758487855104 -> n199847233464565760;\nn199847233464565760 -> n171136785840078848;\nn186336434582454272 -> n186899384535875584;\nn186899384535875584 -> n192810359046799360;\nn192810359046799360 -> n170010885933236224;\nn192810359046799360 -> n200128708441276416;\nn200128708441276416 -> n200410183417987072;\nn200691658394697728 -> n171136785840078848;\nn200691658394697728 -> n200410183417987072;\nn200410183417987072 -> n200691658394697728[style=dashed];\nn200410183417987072 -> n200973133371408384;\nn200973133371408384 -> n201254608348119040;\nn200973133371408384 -> n201536083324829696;\nn201536083324829696 -> n201817558301540352;\nn201536083324829696 -> n202099033278251008;\nn202099033278251008 -> n202380508254961664;\nn201254608348119040 -> n202661983231672320;\nn201254608348119040 -> n202943458208382976;\nn202943458208382976 -> n202661983231672320;\nn202943458208382976 -> n203224933185093632;\nn203224933185093632 -> n202661983231672320;\nn201817558301540352 -> n204069358115225600;\nn204069358115225600 -> n203506408161804288;\nn204069358115225600 -> n203787883138514944;\nn203787883138514944 -> n204069358115225600;\nn203787883138514944 -> n204350833091936256;\nn204350833091936256 -> n202380508254961664;\nn203506408161804288 -> n202943458208382976;\nn203506408161804288 -> n202661983231672320;\nn202661983231672320 -> n204632308068646912;\nn202661983231672320 -> n204913783045357568;\nn204913783045357568 -> n204632308068646912;\nn204913783045357568 -> n205195258022068224;\nn205195258022068224 -> n204632308068646912;\nn204632308068646912 -> n205476732998778880;\nn204632308068646912 -> n205758207975489536;\nn205758207975489536 -> n205476732998778880;\nn205476732998778880 -> n202380508254961664;\nn202380508254961664 -> n200691658394697728;\nn202380508254961664 -> n206039682952200192;\nn206039682952200192 -> n200691658394697728;\nn206039682952200192 -> n206321157928910848;\nn206321157928910848 -> n171136785840078848;\nn188588234396139520 -> n189151184349560832;\nn189151184349560832 -> n193091834023510016;\nn193091834023510016 -> n170010885933236224;\nn193091834023510016 -> n206602632905621504;\nn206602632905621504 -> n206884107882332160;\nn207165582859042816 -> n171136785840078848;\nn207165582859042816 -> n206884107882332160;\nn206884107882332160 -> n207165582859042816[style=dashed];\nn206884107882332160 -> n207447057835753472;\nn207447057835753472 -> n207728532812464128;\nn207447057835753472 -> n208010007789174784;\nn208010007789174784 -> n208291482765885440;\nn208010007789174784 -> n208572957742596096;\nn208572957742596096 -> n208854432719306752;\nn207728532812464128 -> n209135907696017408;\nn207728532812464128 -> n209417382672728064;\nn209417382672728064 -> n209135907696017408;\nn209417382672728064 -> n209698857649438720;\nn209698857649438720 -> n209135907696017408;\nn208291482765885440 -> n210543282579570688;\nn210543282579570688 -> n209980332626149376;\nn210543282579570688 -> n210261807602860032;\nn210261807602860032 -> n210543282579570688;\nn210261807602860032 -> n210824757556281344;\nn210824757556281344 -> n208854432719306752;\nn209980332626149376 -> n209417382672728064;\nn209980332626149376 -> n209135907696017408;\nn209135907696017408 -> n211106232532992000;\nn209135907696017408 -> n211387707509702656;\nn211387707509702656 -> n211106232532992000;\nn211387707509702656 -> n211669182486413312;\nn211669182486413312 -> n211106232532992000;\nn211106232532992000 -> n211950657463123968;\nn211106232532992000 -> n212232132439834624;\nn212232132439834624 -> n211950657463123968;\nn211950657463123968 -> n208854432719306752;\nn208854432719306752 -> n207165582859042816;\nn208854432719306752 -> n212513607416545280;\nn212513607416545280 -> n207165582859042816;\nn212513607416545280 -> n212795082393255936;\nn212795082393255936 -> n171136785840078848;\nn190840034209824768 -> n191402984163246080;\nn191402984163246080 -> n193373309000220672;\nn193373309000220672 -> n170010885933236224;\nn193373309000220672 -> n213076557369966592;\nn213076557369966592 -> n213358032346677248;\nn213639507323387904 -> n171136785840078848;\nn213639507323387904 -> n213358032346677248;\nn213358032346677248 -> n213639507323387904[style=dashed];\nn213358032346677248 -> n213920982300098560;\nn213920982300098560 -> n214202457276809216;\nn213920982300098560 -> n214483932253519872;\nn214483932253519872 -> n214765407230230528;\nn214483932253519872 -> n215046882206941184;\nn215046882206941184 -> n215328357183651840;\nn214202457276809216 -> n215609832160362496;\nn214202457276809216 -> n215891307137073152;\nn215891307137073152 -> n215609832160362496;\nn215891307137073152 -> n216172782113783808;\nn216172782113783808 -> n215609832160362496;\nn214765407230230528 -> n217017207043915776;\nn217017207043915776 -> n216454257090494464;\nn217017207043915776 -> n216735732067205120;\nn216735732067205120 -> n217017207043915776;\nn216735732067205120 -> n217298682020626432;\nn217298682020626432 -> n215328357183651840;\nn216454257090494464 -> n215891307137073152;\nn216454257090494464 -> n215609832160362496;\nn215609832160362496 -> n217580156997337088;\nn215609832160362496 -> n217861631974047744;\nn217861631974047744 -> n217580156997337088;\nn217861631974047744 -> n218143106950758400;\nn218143106950758400 -> n217580156997337088;\nn217580156997337088 -> n218424581927469056;\nn217580156997337088 -> n218706056904179712;\nn218706056904179712 -> n218424581927469056;\nn218424581927469056 -> n215328357183651840;\nn215328357183651840 -> n213639507323387904;\nn215328357183651840 -> n218987531880890368;\nn218987531880890368 -> n213639507323387904;\nn218987531880890368 -> n219269006857601024;\nn219269006857601024 -> n171136785840078848;\nn170010885933236224 -> n171136785840078848;\nn171136785840078848 -> n73464968921481216;\nn171136785840078848 -> n219550481834311680;\nn219550481834311680 -> n74309393851613184;\nn219550481834311680 -> n73464968921481216;\nn73464968921481216 -> n219831956811022336;\nn73464968921481216 -> n220113431787732992;\nn220113431787732992 -> n220394906764443648;\nn220113431787732992 -> n220676381741154304;\nn220676381741154304 -> n220394906764443648;\nn220676381741154304 -> n220957856717864960;\nn220957856717864960 -> n222365231601418240;\nn222365231601418240 -> n221239331694575616;\nn222365231601418240 -> n221520806671286272;\nn221520806671286272 -> n221802281647996928;\nn221520806671286272 -> n222083756624707584;\nn222083756624707584 -> n222365231601418240;\nn222083756624707584 -> n222646706578128896;\nn222646706578128896 -> n221802281647996928;\nn219831956811022336 -> n222928181554839552;\nn219831956811022336 -> n223209656531550208;\nn223209656531550208 -> n223491131508260864;\nn223209656531550208 -> n223772606484971520;\nn223772606484971520 -> n224054081461682176;\nn224054081461682176 -> n224054081461682176[style=dashed];\nn224054081461682176 -> n224335556438392832;\nn224335556438392832 -> n224617031415103488;\nn220394906764443648 -> n221802281647996928;\nn223491131508260864 -> n224898506391814144;\nn221239331694575616 -> n221802281647996928;\nn221802281647996928 -> n223209656531550208;\nn221802281647996928 -> n222928181554839552;\nn222928181554839552 -> n225179981368524800;\nn222928181554839552 -> n225461456345235456;\nn225461456345235456 -> n225742931321946112;\nn225461456345235456 -> n226024406298656768;\nn226024406298656768 -> n224617031415103488;\nn225179981368524800 -> n226305881275367424;\nn226305881275367424 -> n226305881275367424[style=dashed];\nn226305881275367424 -> n226587356252078080;\nn226587356252078080 -> n224617031415103488;\nn226587356252078080 -> n225742931321946112;\nn225742931321946112 -> n226868831228788736;\nn225742931321946112 -> n227150306205499392;\nn227150306205499392 -> n227431781182210048;\nn226868831228788736 -> n227713256158920704;\nn226868831228788736 -> n227994731135631360;\nn227994731135631360 -> n227431781182210048;\nn227713256158920704 -> n228276206112342016;\nn227713256158920704 -> n228557681089052672;\nn228557681089052672 -> n228839156065763328;\nn228276206112342016 -> n229120631042473984;\nn229120631042473984 -> n229120631042473984[style=dashed];\nn229120631042473984 -> n229402106019184640;\nn229402106019184640 -> n224617031415103488;\nn229402106019184640 -> n229683580995895296;\nn229683580995895296 -> n229965055972605952;\nn229683580995895296 -> n228839156065763328;\nn228839156065763328 -> n230246530949316608;\nn230246530949316608 -> n230246530949316608[style=dashed];\nn230246530949316608 -> n230528005926027264;\nn230528005926027264 -> n227431781182210048;\nn230528005926027264 -> n230809480902737920;\nn230809480902737920 -> n224617031415103488;\nn229965055972605952 -> n227431781182210048;\nn227431781182210048 -> n227431781182210048[style=dashed];\nn227431781182210048 -> n224617031415103488;\nn224617031415103488 -> n224898506391814144;\nn224617031415103488 -> n231090955879448576;\nn231090955879448576 -> n224898506391814144;\nn224898506391814144 -> n231372430856159232;\nn224898506391814144 -> n231653905832869888;\nn231653905832869888 -> n231372430856159232;\nn231372430856159232 -> n231935380809580544;\nn231372430856159232 -> n232216855786291200;\nn232216855786291200 -> n231935380809580544;\nn232216855786291200 -> n232498330763001856;\nn232498330763001856 -> n240098155134189568;\nn240098155134189568 -> n232779805739712512;\nn240098155134189568 -> n233061280716423168;\nn233061280716423168 -> n233342755693133824;\nn233061280716423168 -> n233624230669844480;\nn233624230669844480 -> n233905705646555136;\nn233624230669844480 -> n234187180623265792;\nn234187180623265792 -> n234468655599976448;\nn234187180623265792 -> n234750130576687104;\nn234750130576687104 -> n235031605553397760;\nn233342755693133824 -> n235313080530108416;\nn233342755693133824 -> n235594555506819072;\nn235594555506819072 -> n235313080530108416;\nn235594555506819072 -> n235876030483529728;\nn235876030483529728 -> n235313080530108416;\nn233905705646555136 -> n236720455413661696;\nn236720455413661696 -> n236157505460240384;\nn236720455413661696 -> n236438980436951040;\nn236438980436951040 -> n236720455413661696;\nn236438980436951040 -> n237001930390372352;\nn237001930390372352 -> n235031605553397760;\nn237001930390372352 -> n234468655599976448;\nn234468655599976448 -> n237283405367083008;\nn234468655599976448 -> n237564880343793664;\nn237564880343793664 -> n237846355320504320;\nn237564880343793664 -> n238127830297214976;\nn238127830297214976 -> n238409305273925632;\nn236157505460240384 -> n235594555506819072;\nn236157505460240384 -> n235313080530108416;\nn235313080530108416 -> n238690780250636288;\nn235313080530108416 -> n238972255227346944;\nn238972255227346944 -> n238690780250636288;\nn238972255227346944 -> n239253730204057600;\nn239253730204057600 -> n238690780250636288;\nn238690780250636288 -> n239535205180768256;\nn238690780250636288 -> n239816680157478912;\nn239816680157478912 -> n239535205180768256;\nn239535205180768256 -> n234468655599976448;\nn239535205180768256 -> n235031605553397760;\nn235031605553397760 -> n237564880343793664;\nn235031605553397760 -> n237283405367083008;\nn237283405367083008 -> n238409305273925632;\nn237283405367083008 -> n237846355320504320;\nn237846355320504320 -> n240098155134189568;\nn237846355320504320 -> n240379630110900224;\nn240379630110900224 -> n240661105087610880;\nn232779805739712512 -> n231935380809580544;\nn231935380809580544 -> n240661105087610880;\nn238409305273925632 -> n240661105087610880;\nn281474976710656 -> n1407374883553280;\nn240661105087610880 -> n24769797950537728[style=dotted];\nn844424930131968 -> n562949953421312[style=dotted];\nn4222124650659840 -> n2251799813685248[style=dotted];\nn5348024557502464 -> n3096224743817216[style=dotted];\nn3940649673949184 -> n2251799813685248[style=dotted];\nn5910974510923776 -> n3940649673949184[style=dotted];\nn6755399441055744 -> n5910974510923776[style=dotted];\nn3659174697238528 -> n2251799813685248[style=dotted];\nn1688849860263936 -> n844424930131968[style=dotted];\nn9007199254740992 -> n8725724278030336[style=dotted];\nn10977524091715584 -> n10696049115004928[style=dotted];\nn12947848928690176 -> n12666373951979520[style=dotted];\nn14918173765664768 -> n14636698788954112[style=dotted];\nn9570149208162304 -> n8162774324609024[style=dotted];\nn17451448556060672 -> n16044073672507392[style=dotted];\nn11540474045136896 -> n10133099161583616[style=dotted];\nn19703248369745920 -> n18295873486192640[style=dotted];\nn20829148276588544 -> n20547673299877888[style=dotted];\nn22236523160141824 -> n21955048183431168[style=dotted];\nn16888498602639360 -> n17451448556060672[style=dotted];\nn23080948090273792 -> n9570149208162304[style=dotted];\nn24488322973827072 -> n24206847997116416[style=dotted];\nn24206847997116416 -> n23925373020405760[style=dotted];\nn27021597764222976 -> n25051272927248384[style=dotted];\nn28147497671065600 -> n25895697857380352[style=dotted];\nn26740122787512320 -> n25051272927248384[style=dotted];\nn28710447624486912 -> n26740122787512320[style=dotted];\nn29554872554618880 -> n28710447624486912[style=dotted];\nn26458647810801664 -> n25051272927248384[style=dotted];\nn19140298416324608 -> n19703248369745920[style=dotted];\nn23362423066984448 -> n11540474045136896[style=dotted];\nn31243722414882816 -> n30962247438172160[style=dotted];\nn30962247438172160 -> n30680772461461504[style=dotted];\nn33495522228568064 -> n31525197391593472[style=dotted];\nn34621422135410688 -> n32369622321725440[style=dotted];\nn33214047251857408 -> n31525197391593472[style=dotted];\nn35184372088832000 -> n33214047251857408[style=dotted];\nn36028797018963968 -> n35184372088832000[style=dotted];\nn32932572275146752 -> n31525197391593472[style=dotted];\nn13510798882111488 -> n12103423998558208[style=dotted];\nn38843546786070528 -> n37436171902517248[style=dotted];\nn15481123719086080 -> n14073748835532800[style=dotted];\nn41095346599755776 -> n39687971716202496[style=dotted];\nn21392098230009856 -> n11821949021847552[style=dotted];\nn43347146413441024 -> n41939771529887744[style=dotted];\nn22799473113563136 -> n13792273858822144[style=dotted];\nn45598946227126272 -> n44191571343572992[style=dotted];\nn38280596832649216 -> n38843546786070528[style=dotted];\nn46161896180547584 -> n13510798882111488[style=dotted];\nn47850746040811520 -> n47569271064100864[style=dotted];\nn47569271064100864 -> n47287796087390208[style=dotted];\nn50102545854496768 -> n48132221017522176[style=dotted];\nn51228445761339392 -> n48976645947654144[style=dotted];\nn49821070877786112 -> n48132221017522176[style=dotted];\nn51791395714760704 -> n49821070877786112[style=dotted];\nn52635820644892672 -> n51791395714760704[style=dotted];\nn49539595901075456 -> n48132221017522176[style=dotted];\nn40532396646334464 -> n41095346599755776[style=dotted];\nn46443371157258240 -> n15481123719086080[style=dotted];\nn54324670505156608 -> n54043195528445952[style=dotted];\nn54043195528445952 -> n53761720551735296[style=dotted];\nn56576470318841856 -> n54606145481867264[style=dotted];\nn57702370225684480 -> n55450570411999232[style=dotted];\nn56294995342131200 -> n54606145481867264[style=dotted];\nn58265320179105792 -> n56294995342131200[style=dotted];\nn59109745109237760 -> n58265320179105792[style=dotted];\nn56013520365420544 -> n54606145481867264[style=dotted];\nn42784196460019712 -> n43347146413441024[style=dotted];\nn46724846133968896 -> n21392098230009856[style=dotted];\nn60798594969501696 -> n60517119992791040[style=dotted];\nn60517119992791040 -> n60235645016080384[style=dotted];\nn63050394783186944 -> n61080069946212352[style=dotted];\nn64176294690029568 -> n61924494876344320[style=dotted];\nn62768919806476288 -> n61080069946212352[style=dotted];\nn64739244643450880 -> n62768919806476288[style=dotted];\nn65583669573582848 -> n64739244643450880[style=dotted];\nn62487444829765632 -> n61080069946212352[style=dotted];\nn45035996273704960 -> n45598946227126272[style=dotted];\nn47006321110679552 -> n22799473113563136[style=dotted];\nn67272519433846784 -> n66991044457136128[style=dotted];\nn66991044457136128 -> n66709569480425472[style=dotted];\nn69524319247532032 -> n67553994410557440[style=dotted];\nn70650219154374656 -> n68398419340689408[style=dotted];\nn69242844270821376 -> n67553994410557440[style=dotted];\nn71213169107795968 -> n69242844270821376[style=dotted];\nn72057594037927936 -> n71213169107795968[style=dotted];\nn68961369294110720 -> n67553994410557440[style=dotted];\nn23643898043695104 -> n1688849860263936[style=dotted];\nn24769797950537728 -> n1688849860263936[style=dotted];\nn74309393851613184 -> n74590868828323840[style=dotted];\nn74027918874902528 -> n73746443898191872[style=dotted];\nn77405618595430400 -> n75435293758455808[style=dotted];\nn78531518502273024 -> n76279718688587776[style=dotted];\nn77124143618719744 -> n75435293758455808[style=dotted];\nn79375943432404992 -> n77124143618719744[style=dotted];\nn79094468455694336 -> n75435293758455808[style=dotted];\nn76842668642009088 -> n75435293758455808[style=dotted];\nn74590868828323840 -> n74027918874902528[style=dotted];\nn82472168176222208 -> n82190693199511552[style=dotted];\nn84442493013196800 -> n84161018036486144[style=dotted];\nn86412817850171392 -> n86131342873460736[style=dotted];\nn88383142687145984 -> n88101667710435328[style=dotted];\nn83035118129643520 -> n81627743246090240[style=dotted];\nn90916417477541888 -> n89509042593988608[style=dotted];\nn85005442966618112 -> n83598068083064832[style=dotted];\nn93168217291227136 -> n91760842407673856[style=dotted];\nn94294117198069760 -> n94012642221359104[style=dotted];\nn95701492081623040 -> n95420017104912384[style=dotted];\nn90353467524120576 -> n90916417477541888[style=dotted];\nn96545917011755008 -> n83035118129643520[style=dotted];\nn97953291895308288 -> n97671816918597632[style=dotted];\nn97671816918597632 -> n97390341941886976[style=dotted];\nn100486566685704192 -> n98516241848729600[style=dotted];\nn101612466592546816 -> n99360666778861568[style=dotted];\nn100205091708993536 -> n98516241848729600[style=dotted];\nn102175416545968128 -> n100205091708993536[style=dotted];\nn103019841476100096 -> n102175416545968128[style=dotted];\nn99923616732282880 -> n98516241848729600[style=dotted];\nn92605267337805824 -> n93168217291227136[style=dotted];\nn96827391988465664 -> n85005442966618112[style=dotted];\nn104708691336364032 -> n104427216359653376[style=dotted];\nn104427216359653376 -> n104145741382942720[style=dotted];\nn106960491150049280 -> n104990166313074688[style=dotted];\nn108086391056891904 -> n105834591243206656[style=dotted];\nn106679016173338624 -> n104990166313074688[style=dotted];\nn108649341010313216 -> n106679016173338624[style=dotted];\nn109493765940445184 -> n108649341010313216[style=dotted];\nn106397541196627968 -> n104990166313074688[style=dotted];\nn86975767803592704 -> n85568392920039424[style=dotted];\nn112308515707551744 -> n110901140823998464[style=dotted];\nn88946092640567296 -> n87538717757014016[style=dotted];\nn114560315521236992 -> n113152940637683712[style=dotted];\nn94857067151491072 -> n85286917943328768[style=dotted];\nn116812115334922240 -> n115404740451368960[style=dotted];\nn96264442035044352 -> n87257242780303360[style=dotted];\nn119063915148607488 -> n117656540265054208[style=dotted];\nn111745565754130432 -> n112308515707551744[style=dotted];\nn119626865102028800 -> n86975767803592704[style=dotted];\nn121315714962292736 -> n121034239985582080[style=dotted];\nn121034239985582080 -> n120752765008871424[style=dotted];\nn123567514775977984 -> n121597189939003392[style=dotted];\nn124693414682820608 -> n122441614869135360[style=dotted];\nn123286039799267328 -> n121597189939003392[style=dotted];\nn125256364636241920 -> n123286039799267328[style=dotted];\nn126100789566373888 -> n125256364636241920[style=dotted];\nn123004564822556672 -> n121597189939003392[style=dotted];\nn113997365567815680 -> n114560315521236992[style=dotted];\nn119908340078739456 -> n88946092640567296[style=dotted];\nn127789639426637824 -> n127508164449927168[style=dotted];\nn127508164449927168 -> n127226689473216512[style=dotted];\nn130041439240323072 -> n128071114403348480[style=dotted];\nn131167339147165696 -> n128915539333480448[style=dotted];\nn129759964263612416 -> n128071114403348480[style=dotted];\nn131730289100587008 -> n129759964263612416[style=dotted];\nn132574714030718976 -> n131730289100587008[style=dotted];\nn129478489286901760 -> n128071114403348480[style=dotted];\nn116249165381500928 -> n116812115334922240[style=dotted];\nn120189815055450112 -> n94857067151491072[style=dotted];\nn134263563890982912 -> n133982088914272256[style=dotted];\nn133982088914272256 -> n133700613937561600[style=dotted];\nn136515363704668160 -> n134545038867693568[style=dotted];\nn137641263611510784 -> n135389463797825536[style=dotted];\nn136233888727957504 -> n134545038867693568[style=dotted];\nn138204213564932096 -> n136233888727957504[style=dotted];\nn139048638495064064 -> n138204213564932096[style=dotted];\nn135952413751246848 -> n134545038867693568[style=dotted];\nn118500965195186176 -> n119063915148607488[style=dotted];\nn120471290032160768 -> n96264442035044352[style=dotted];\nn140737488355328000 -> n140456013378617344[style=dotted];\nn140456013378617344 -> n140174538401906688[style=dotted];\nn142989288169013248 -> n141018963332038656[style=dotted];\nn144115188075855872 -> n141863388262170624[style=dotted];\nn142707813192302592 -> n141018963332038656[style=dotted];\nn144678138029277184 -> n142707813192302592[style=dotted];\nn145522562959409152 -> n144678138029277184[style=dotted];\nn142426338215591936 -> n141018963332038656[style=dotted];\nn98234766872018944 -> n74590868828323840[style=dotted];\nn97108866965176320 -> n74590868828323840[style=dotted];\nn146366987889541120 -> n74590868828323840[style=dotted];\nn146929937842962432 -> n74590868828323840[style=dotted];\nn150307637563490304 -> n148337312726515712[style=dotted];\nn151433537470332928 -> n149181737656647680[style=dotted];\nn150026162586779648 -> n148337312726515712[style=dotted];\nn152277962400464896 -> n150026162586779648[style=dotted];\nn151996487423754240 -> n148337312726515712[style=dotted];\nn149744687610068992 -> n148337312726515712[style=dotted];\nn147492887796383744 -> n147211412819673088[style=dotted];\nn155374187144282112 -> n155092712167571456[style=dotted];\nn157344511981256704 -> n157063037004546048[style=dotted];\nn159314836818231296 -> n159033361841520640[style=dotted];\nn161285161655205888 -> n161003686678495232[style=dotted];\nn155937137097703424 -> n154529762214150144[style=dotted];\nn163818436445601792 -> n162411061562048512[style=dotted];\nn157907461934678016 -> n156500087051124736[style=dotted];\nn166070236259287040 -> n164662861375733760[style=dotted];\nn167196136166129664 -> n166914661189419008[style=dotted];\nn168603511049682944 -> n168322036072972288[style=dotted];\nn163255486492180480 -> n163818436445601792[style=dotted];\nn169447935979814912 -> n155937137097703424[style=dotted];\nn170855310863368192 -> n170573835886657536[style=dotted];\nn170573835886657536 -> n170292360909946880[style=dotted];\nn173388585653764096 -> n171418260816789504[style=dotted];\nn174514485560606720 -> n172262685746921472[style=dotted];\nn173107110677053440 -> n171418260816789504[style=dotted];\nn175077435514028032 -> n173107110677053440[style=dotted];\nn175921860444160000 -> n175077435514028032[style=dotted];\nn172825635700342784 -> n171418260816789504[style=dotted];\nn165507286305865728 -> n166070236259287040[style=dotted];\nn169729410956525568 -> n157907461934678016[style=dotted];\nn177610710304423936 -> n177329235327713280[style=dotted];\nn177329235327713280 -> n177047760351002624[style=dotted];\nn179862510118109184 -> n177892185281134592[style=dotted];\nn180988410024951808 -> n178736610211266560[style=dotted];\nn179581035141398528 -> n177892185281134592[style=dotted];\nn181551359978373120 -> n179581035141398528[style=dotted];\nn182395784908505088 -> n181551359978373120[style=dotted];\nn179299560164687872 -> n177892185281134592[style=dotted];\nn159877786771652608 -> n158470411888099328[style=dotted];\nn185210534675611648 -> n183803159792058368[style=dotted];\nn161848111608627200 -> n160440736725073920[style=dotted];\nn187462334489296896 -> n186054959605743616[style=dotted];\nn167759086119550976 -> n158188936911388672[style=dotted];\nn189714134302982144 -> n188306759419428864[style=dotted];\nn169166461003104256 -> n160159261748363264[style=dotted];\nn191965934116667392 -> n190558559233114112[style=dotted];\nn184647584722190336 -> n185210534675611648[style=dotted];\nn192528884070088704 -> n159877786771652608[style=dotted];\nn194217733930352640 -> n193936258953641984[style=dotted];\nn193936258953641984 -> n193654783976931328[style=dotted];\nn196469533744037888 -> n194499208907063296[style=dotted];\nn197595433650880512 -> n195343633837195264[style=dotted];\nn196188058767327232 -> n194499208907063296[style=dotted];\nn198158383604301824 -> n196188058767327232[style=dotted];\nn199002808534433792 -> n198158383604301824[style=dotted];\nn195906583790616576 -> n194499208907063296[style=dotted];\nn186899384535875584 -> n187462334489296896[style=dotted];\nn192810359046799360 -> n161848111608627200[style=dotted];\nn200691658394697728 -> n200410183417987072[style=dotted];\nn200410183417987072 -> n200128708441276416[style=dotted];\nn202943458208382976 -> n200973133371408384[style=dotted];\nn204069358115225600 -> n201817558301540352[style=dotted];\nn202661983231672320 -> n200973133371408384[style=dotted];\nn204632308068646912 -> n202661983231672320[style=dotted];\nn205476732998778880 -> n204632308068646912[style=dotted];\nn202380508254961664 -> n200973133371408384[style=dotted];\nn189151184349560832 -> n189714134302982144[style=dotted];\nn193091834023510016 -> n167759086119550976[style=dotted];\nn207165582859042816 -> n206884107882332160[style=dotted];\nn206884107882332160 -> n206602632905621504[style=dotted];\nn209417382672728064 -> n207447057835753472[style=dotted];\nn210543282579570688 -> n208291482765885440[style=dotted];\nn209135907696017408 -> n207447057835753472[style=dotted];\nn211106232532992000 -> n209135907696017408[style=dotted];\nn211950657463123968 -> n211106232532992000[style=dotted];\nn208854432719306752 -> n207447057835753472[style=dotted];\nn191402984163246080 -> n191965934116667392[style=dotted];\nn193373309000220672 -> n169166461003104256[style=dotted];\nn213639507323387904 -> n213358032346677248[style=dotted];\nn213358032346677248 -> n213076557369966592[style=dotted];\nn215891307137073152 -> n213920982300098560[style=dotted];\nn217017207043915776 -> n214765407230230528[style=dotted];\nn215609832160362496 -> n213920982300098560[style=dotted];\nn217580156997337088 -> n215609832160362496[style=dotted];\nn218424581927469056 -> n217580156997337088[style=dotted];\nn215328357183651840 -> n213920982300098560[style=dotted];\nn170010885933236224 -> n147492887796383744[style=dotted];\nn171136785840078848 -> n147492887796383744[style=dotted];\nn73464968921481216 -> n73183493944770560[style=dotted];\nn222365231601418240 -> n220957856717864960[style=dotted];\nn223209656531550208 -> n73464968921481216[style=dotted];\nn224054081461682176 -> n223772606484971520[style=dotted];\nn220394906764443648 -> n220113431787732992[style=dotted];\nn221802281647996928 -> n220113431787732992[style=dotted];\nn222928181554839552 -> n73464968921481216[style=dotted];\nn226305881275367424 -> n225179981368524800[style=dotted];\nn225742931321946112 -> n222928181554839552[style=dotted];\nn229120631042473984 -> n228276206112342016[style=dotted];\nn228839156065763328 -> n227713256158920704[style=dotted];\nn230246530949316608 -> n228839156065763328[style=dotted];\nn227431781182210048 -> n225742931321946112[style=dotted];\nn224617031415103488 -> n73464968921481216[style=dotted];\nn224898506391814144 -> n73464968921481216[style=dotted];\nn231372430856159232 -> n224898506391814144[style=dotted];\nn240098155134189568 -> n232498330763001856[style=dotted];\nn235594555506819072 -> n233061280716423168[style=dotted];\nn236720455413661696 -> n233905705646555136[style=dotted];\nn234468655599976448 -> n233061280716423168[style=dotted];\nn237564880343793664 -> n233061280716423168[style=dotted];\nn235313080530108416 -> n233061280716423168[style=dotted];\nn238690780250636288 -> n235313080530108416[style=dotted];\nn239535205180768256 -> n238690780250636288[style=dotted];\nn235031605553397760 -> n233061280716423168[style=dotted];\nn237283405367083008 -> n233061280716423168[style=dotted];\nn237846355320504320 -> n233061280716423168[style=dotted];\nn231935380809580544 -> n231372430856159232[style=dotted];\nn238409305273925632 -> n233061280716423168[style=dotted];\nn1407374883553280 -> n0[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-322.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn281474976710656[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn562949953421312[shape=rectangle, label=\"B5\"];\nn1688849860263936[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn2533274790395904[shape=rectangle, label=\"B8\"];\nn1970324836974592[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn3659174697238528[shape=rectangle, label=\"B11\"];\nn3377699720527872[shape=rectangle, label=\"B12\"];\nn3940649673949184[shape=rectangle, label=\"B13\"];\nn2814749767106560[shape=rectangle, label=\"B14\"];\nn4222124650659840[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn4503599627370496[shape=rectangle, label=\"B17\"];\nn5629499534213120[shape=rectangle, label=\"B18\"];\nn5348024557502464[shape=rectangle, label=\"B19\"];\nn6473924464345088[shape=rectangle, label=\"B20\"];\nn7036874417766400[shape=rectangle, label=\"B21\"];\nn22517998136852480[shape=rectangle, label=\"B22\"];\nn7599824371187712[shape=rectangle, label=\"B23\"];\nn8162774324609024[shape=rectangle, label=\"B24\"];\nn7318349394477056[shape=rectangle, label=\"B25\"];\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn9007199254740992[shape=rectangle, label=\"B27\"];\nn9288674231451648[shape=rectangle, label=\"B28\"];\nn8444249301319680[shape=rectangle, label=\"B29\"];\nn9851624184872960[shape=rectangle, label=\"B30\"];\nn10414574138294272[shape=rectangle, label=\"B31\"];\nn10977524091715584[shape=rectangle, label=\"B32\"];\nn9570149208162304[shape=rectangle, label=\"B33\"];\nn11540474045136896[shape=rectangle, label=\"B34\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn12103423998558208[shape=rectangle, label=\"B36\"];\nn12384898975268864[shape=rectangle, label=\"B37\"];\nn11821949021847552[shape=rectangle, label=\"B38\"];\nn10696049115004928[shape=rectangle, label=\"B39\"];\nn12947848928690176[shape=rectangle, label=\"B40\"];\nn11258999068426240[shape=rectangle, label=\"B41\"];\nn13229323905400832[shape=rectangle, label=\"B42\"];\nn13510798882111488[shape=rectangle, label=\"B43\"];\nn14073748835532800[shape=rectangle, label=\"B44\"];\nn13792273858822144[shape=rectangle, label=\"B45\"];\nn14918173765664768[shape=rectangle, label=\"B46\"];\nn15199648742375424[shape=rectangle, label=\"B47\"];\nn15481123719086080[shape=rectangle, label=\"B48\"];\nn14636698788954112[shape=rectangle, label=\"B49\"];\nn16044073672507392[shape=rectangle, label=\"B50\"];\nn16607023625928704[shape=rectangle, label=\"B51\"];\nn16888498602639360[shape=rectangle, label=\"B52\"];\nn17169973579350016[shape=rectangle, label=\"B53\"];\nn15762598695796736[shape=rectangle, label=\"B54\"];\nn17451448556060672[shape=rectangle, label=\"B55\"];\nn16325548649218048[shape=rectangle, label=\"B56\"];\nn17732923532771328[shape=rectangle, label=\"B57\"];\nn18014398509481984[shape=rectangle, label=\"B58\"];\nn12666373951979520[shape=rectangle, label=\"B59\"];\nn18577348462903296[shape=rectangle, label=\"B60\"];\nn21110623253299200[shape=rectangle, label=\"B61\"];\nn18295873486192640[shape=rectangle, label=\"B62\"];\nn19140298416324608[shape=rectangle, label=\"B63\"];\nn19421773393035264[shape=rectangle, label=\"B64\"];\nn19703248369745920[shape=rectangle, label=\"B65\"];\nn18858823439613952[shape=rectangle, label=\"B66\"];\nn20266198323167232[shape=rectangle, label=\"B67\"];\nn20829148276588544[shape=rectangle, label=\"B68\"];\nn21392098230009856[shape=rectangle, label=\"B69\"];\nn19984723346456576[shape=rectangle, label=\"B70\"];\nn21673573206720512[shape=rectangle, label=\"B71\"];\nn20547673299877888[shape=rectangle, label=\"B72\"];\nn21955048183431168[shape=rectangle, label=\"B73\"];\nn22236523160141824[shape=rectangle, label=\"B74\"];\nn14355223812243456[shape=rectangle, label=\"B75\"];\nn22799473113563136[shape=rectangle, label=\"B76\"];\nn6755399441055744[shape=rectangle, label=\"B77\"];\nn92886742314516480[shape=rectangle, label=\"B78\"];\nn5066549580791808[shape=rectangle, label=\"B79\"];\nn23080948090273792[shape=rectangle, label=\"B80\"];\nn23643898043695104[shape=rectangle, label=\"B81\"];\nn23925373020405760[shape=rectangle, label=\"B82\"];\nn23362423066984448[shape=rectangle, label=\"B83\"];\nn24206847997116416[shape=rectangle, label=\"B84\"];\nn8725724278030336[shape=rectangle, label=\"B85\"];\nn5910974510923776[shape=rectangle, label=\"B86\"];\nn6192449487634432[shape=rectangle, label=\"B87\"];\nn25332747903959040[shape=rectangle, label=\"B88\"];\nn25051272927248384[shape=rectangle, label=\"B89\"];\nn24488322973827072[shape=rectangle, label=\"B90\"];\nn24769797950537728[shape=rectangle, label=\"B91\"];\nn25614222880669696[shape=rectangle, label=\"B92\"];\nn26177172834091008[shape=rectangle, label=\"B93\"];\nn26740122787512320[shape=rectangle, label=\"B94\"];\nn26458647810801664[shape=rectangle, label=\"B95\"];\nn27584547717644288[shape=rectangle, label=\"B96\"];\nn28147497671065600[shape=rectangle, label=\"B97\"];\nn27303072740933632[shape=rectangle, label=\"B98\"];\nn27866022694354944[shape=rectangle, label=\"B99\"];\nn28991922601197568[shape=rectangle, label=\"B100\"];\nn29554872554618880[shape=rectangle, label=\"B101\"];\nn30117822508040192[shape=rectangle, label=\"B102\"];\nn30680772461461504[shape=rectangle, label=\"B103\"];\nn31243722414882816[shape=rectangle, label=\"B104\"];\nn28710447624486912[shape=rectangle, label=\"B105\"];\nn32088147345014784[shape=rectangle, label=\"B106\"];\nn29273397577908224[shape=rectangle, label=\"B107\"];\nn32651097298436096[shape=rectangle, label=\"B108\"];\nn29836347531329536[shape=rectangle, label=\"B109\"];\nn33214047251857408[shape=rectangle, label=\"B110\"];\nn30399297484750848[shape=rectangle, label=\"B111\"];\nn33776997205278720[shape=rectangle, label=\"B112\"];\nn30962247438172160[shape=rectangle, label=\"B113\"];\nn34339947158700032[shape=rectangle, label=\"B114\"];\nn31806672368304128[shape=rectangle, label=\"B115\"];\nn34621422135410688[shape=rectangle, label=\"B116\"];\nn32369622321725440[shape=rectangle, label=\"B117\"];\nn34902897112121344[shape=rectangle, label=\"B118\"];\nn32932572275146752[shape=rectangle, label=\"B119\"];\nn35184372088832000[shape=rectangle, label=\"B120\"];\nn33495522228568064[shape=rectangle, label=\"B121\"];\nn35465847065542656[shape=rectangle, label=\"B122\"];\nn34058472181989376[shape=rectangle, label=\"B123\"];\nn31525197391593472[shape=rectangle, label=\"B124\"];\nn36028797018963968[shape=rectangle, label=\"B125\"];\nn35747322042253312[shape=rectangle, label=\"B126\"];\nn36591746972385280[shape=rectangle, label=\"B127\"];\nn36310271995674624[shape=rectangle, label=\"B128\"];\nn28428972647776256[shape=rectangle, label=\"B129\"];\nn37154696925806592[shape=rectangle, label=\"B130\"];\nn37717646879227904[shape=rectangle, label=\"B131\"];\nn37999121855938560[shape=rectangle, label=\"B132\"];\nn38280596832649216[shape=rectangle, label=\"B133\"];\nn37436171902517248[shape=rectangle, label=\"B134\"];\nn38843546786070528[shape=rectangle, label=\"B135\"];\nn39406496739491840[shape=rectangle, label=\"B136\"];\nn36873221949095936[shape=rectangle, label=\"B137\"];\nn40250921669623808[shape=rectangle, label=\"B138\"];\nn40813871623045120[shape=rectangle, label=\"B139\"];\nn41376821576466432[shape=rectangle, label=\"B140\"];\nn41939771529887744[shape=rectangle, label=\"B141\"];\nn42502721483309056[shape=rectangle, label=\"B142\"];\nn43065671436730368[shape=rectangle, label=\"B143\"];\nn43628621390151680[shape=rectangle, label=\"B144\"];\nn38562071809359872[shape=rectangle, label=\"B145\"];\nn39969446692913152[shape=rectangle, label=\"B146\"];\nn39125021762781184[shape=rectangle, label=\"B147\"];\nn44473046320283648[shape=rectangle, label=\"B148\"];\nn45035996273704960[shape=rectangle, label=\"B149\"];\nn41095346599755776[shape=rectangle, label=\"B150\"];\nn45598946227126272[shape=rectangle, label=\"B151\"];\nn41658296553177088[shape=rectangle, label=\"B152\"];\nn46161896180547584[shape=rectangle, label=\"B153\"];\nn42221246506598400[shape=rectangle, label=\"B154\"];\nn46724846133968896[shape=rectangle, label=\"B155\"];\nn42784196460019712[shape=rectangle, label=\"B156\"];\nn47287796087390208[shape=rectangle, label=\"B157\"];\nn43347146413441024[shape=rectangle, label=\"B158\"];\nn47850746040811520[shape=rectangle, label=\"B159\"];\nn45317471250415616[shape=rectangle, label=\"B160\"];\nn48132221017522176[shape=rectangle, label=\"B161\"];\nn45880421203836928[shape=rectangle, label=\"B162\"];\nn48413695994232832[shape=rectangle, label=\"B163\"];\nn46443371157258240[shape=rectangle, label=\"B164\"];\nn48695170970943488[shape=rectangle, label=\"B165\"];\nn47006321110679552[shape=rectangle, label=\"B166\"];\nn48976645947654144[shape=rectangle, label=\"B167\"];\nn47569271064100864[shape=rectangle, label=\"B168\"];\nn43910096366862336[shape=rectangle, label=\"B169\"];\nn49539595901075456[shape=rectangle, label=\"B170\"];\nn49258120924364800[shape=rectangle, label=\"B171\"];\nn50102545854496768[shape=rectangle, label=\"B172\"];\nn49821070877786112[shape=rectangle, label=\"B173\"];\nn40532396646334464[shape=rectangle, label=\"B174\"];\nn39687971716202496[shape=rectangle, label=\"B175\"];\nn44754521296994304[shape=rectangle, label=\"B176\"];\nn50384020831207424[shape=rectangle, label=\"B177\"];\nn50946970784628736[shape=rectangle, label=\"B178\"];\nn63050394783186944[shape=rectangle, label=\"B179\"];\nn50665495807918080[shape=rectangle, label=\"B180\"];\nn51509920738050048[shape=rectangle, label=\"B181\"];\nn52072870691471360[shape=rectangle, label=\"B182\"];\nn52635820644892672[shape=rectangle, label=\"B183\"];\nn53198770598313984[shape=rectangle, label=\"B184\"];\nn53761720551735296[shape=rectangle, label=\"B185\"];\nn54324670505156608[shape=rectangle, label=\"B186\"];\nn51791395714760704[shape=rectangle, label=\"B187\"];\nn55169095435288576[shape=rectangle, label=\"B188\"];\nn52354345668182016[shape=rectangle, label=\"B189\"];\nn55732045388709888[shape=rectangle, label=\"B190\"];\nn52917295621603328[shape=rectangle, label=\"B191\"];\nn56294995342131200[shape=rectangle, label=\"B192\"];\nn53480245575024640[shape=rectangle, label=\"B193\"];\nn56857945295552512[shape=rectangle, label=\"B194\"];\nn54043195528445952[shape=rectangle, label=\"B195\"];\nn57420895248973824[shape=rectangle, label=\"B196\"];\nn54887620458577920[shape=rectangle, label=\"B197\"];\nn57702370225684480[shape=rectangle, label=\"B198\"];\nn55450570411999232[shape=rectangle, label=\"B199\"];\nn57983845202395136[shape=rectangle, label=\"B200\"];\nn56013520365420544[shape=rectangle, label=\"B201\"];\nn58265320179105792[shape=rectangle, label=\"B202\"];\nn56576470318841856[shape=rectangle, label=\"B203\"];\nn58546795155816448[shape=rectangle, label=\"B204\"];\nn57139420272263168[shape=rectangle, label=\"B205\"];\nn54606145481867264[shape=rectangle, label=\"B206\"];\nn59109745109237760[shape=rectangle, label=\"B207\"];\nn58828270132527104[shape=rectangle, label=\"B208\"];\nn59672695062659072[shape=rectangle, label=\"B209\"];\nn59391220085948416[shape=rectangle, label=\"B210\"];\nn51228445761339392[shape=rectangle, label=\"B211\"];\nn60235645016080384[shape=rectangle, label=\"B212\"];\nn60798594969501696[shape=rectangle, label=\"B213\"];\nn61080069946212352[shape=rectangle, label=\"B214\"];\nn61361544922923008[shape=rectangle, label=\"B215\"];\nn60517119992791040[shape=rectangle, label=\"B216\"];\nn61643019899633664[shape=rectangle, label=\"B217\"];\nn62205969853054976[shape=rectangle, label=\"B218\"];\nn62487444829765632[shape=rectangle, label=\"B219\"];\nn62768919806476288[shape=rectangle, label=\"B220\"];\nn59954170039369728[shape=rectangle, label=\"B221\"];\nn61924494876344320[shape=rectangle, label=\"B222\"];\nn63331869759897600[shape=rectangle, label=\"B223\"];\nn63894819713318912[shape=rectangle, label=\"B224\"];\nn64457769666740224[shape=rectangle, label=\"B225\"];\nn65020719620161536[shape=rectangle, label=\"B226\"];\nn65583669573582848[shape=rectangle, label=\"B227\"];\nn66146619527004160[shape=rectangle, label=\"B228\"];\nn63613344736608256[shape=rectangle, label=\"B229\"];\nn66991044457136128[shape=rectangle, label=\"B230\"];\nn64176294690029568[shape=rectangle, label=\"B231\"];\nn67553994410557440[shape=rectangle, label=\"B232\"];\nn64739244643450880[shape=rectangle, label=\"B233\"];\nn68116944363978752[shape=rectangle, label=\"B234\"];\nn65302194596872192[shape=rectangle, label=\"B235\"];\nn68679894317400064[shape=rectangle, label=\"B236\"];\nn65865144550293504[shape=rectangle, label=\"B237\"];\nn69242844270821376[shape=rectangle, label=\"B238\"];\nn66709569480425472[shape=rectangle, label=\"B239\"];\nn69524319247532032[shape=rectangle, label=\"B240\"];\nn67272519433846784[shape=rectangle, label=\"B241\"];\nn69805794224242688[shape=rectangle, label=\"B242\"];\nn67835469387268096[shape=rectangle, label=\"B243\"];\nn70087269200953344[shape=rectangle, label=\"B244\"];\nn68398419340689408[shape=rectangle, label=\"B245\"];\nn70368744177664000[shape=rectangle, label=\"B246\"];\nn68961369294110720[shape=rectangle, label=\"B247\"];\nn66428094503714816[shape=rectangle, label=\"B248\"];\nn70650219154374656[shape=rectangle, label=\"B249\"];\nn71213169107795968[shape=rectangle, label=\"B250\"];\nn70931694131085312[shape=rectangle, label=\"B251\"];\nn44191571343572992[shape=rectangle, label=\"B252\"];\nn71776119061217280[shape=rectangle, label=\"B253\"];\nn83879543059775488[shape=rectangle, label=\"B254\"];\nn83316593106354176[shape=rectangle, label=\"B255\"];\nn71494644084506624[shape=rectangle, label=\"B256\"];\nn72339069014638592[shape=rectangle, label=\"B257\"];\nn72902018968059904[shape=rectangle, label=\"B258\"];\nn73464968921481216[shape=rectangle, label=\"B259\"];\nn74027918874902528[shape=rectangle, label=\"B260\"];\nn74590868828323840[shape=rectangle, label=\"B261\"];\nn75153818781745152[shape=rectangle, label=\"B262\"];\nn72620543991349248[shape=rectangle, label=\"B263\"];\nn75998243711877120[shape=rectangle, label=\"B264\"];\nn73183493944770560[shape=rectangle, label=\"B265\"];\nn76561193665298432[shape=rectangle, label=\"B266\"];\nn73746443898191872[shape=rectangle, label=\"B267\"];\nn77124143618719744[shape=rectangle, label=\"B268\"];\nn74309393851613184[shape=rectangle, label=\"B269\"];\nn77687093572141056[shape=rectangle, label=\"B270\"];\nn74872343805034496[shape=rectangle, label=\"B271\"];\nn78250043525562368[shape=rectangle, label=\"B272\"];\nn75716768735166464[shape=rectangle, label=\"B273\"];\nn78531518502273024[shape=rectangle, label=\"B274\"];\nn76279718688587776[shape=rectangle, label=\"B275\"];\nn78812993478983680[shape=rectangle, label=\"B276\"];\nn76842668642009088[shape=rectangle, label=\"B277\"];\nn79094468455694336[shape=rectangle, label=\"B278\"];\nn77405618595430400[shape=rectangle, label=\"B279\"];\nn79375943432404992[shape=rectangle, label=\"B280\"];\nn77968568548851712[shape=rectangle, label=\"B281\"];\nn75435293758455808[shape=rectangle, label=\"B282\"];\nn79938893385826304[shape=rectangle, label=\"B283\"];\nn79657418409115648[shape=rectangle, label=\"B284\"];\nn80501843339247616[shape=rectangle, label=\"B285\"];\nn80220368362536960[shape=rectangle, label=\"B286\"];\nn72057594037927936[shape=rectangle, label=\"B287\"];\nn81064793292668928[shape=rectangle, label=\"B288\"];\nn81627743246090240[shape=rectangle, label=\"B289\"];\nn81909218222800896[shape=rectangle, label=\"B290\"];\nn82190693199511552[shape=rectangle, label=\"B291\"];\nn81346268269379584[shape=rectangle, label=\"B292\"];\nn82472168176222208[shape=rectangle, label=\"B293\"];\nn83035118129643520[shape=rectangle, label=\"B294\"];\nn83598068083064832[shape=rectangle, label=\"B295\"];\nn80783318315958272[shape=rectangle, label=\"B296\"];\nn82753643152932864[shape=rectangle, label=\"B297\"];\nn84161018036486144[shape=rectangle, label=\"B298\"];\nn84723967989907456[shape=rectangle, label=\"B299\"];\nn85286917943328768[shape=rectangle, label=\"B300\"];\nn85849867896750080[shape=rectangle, label=\"B301\"];\nn86412817850171392[shape=rectangle, label=\"B302\"];\nn86975767803592704[shape=rectangle, label=\"B303\"];\nn84442493013196800[shape=rectangle, label=\"B304\"];\nn87820192733724672[shape=rectangle, label=\"B305\"];\nn85005442966618112[shape=rectangle, label=\"B306\"];\nn88383142687145984[shape=rectangle, label=\"B307\"];\nn85568392920039424[shape=rectangle, label=\"B308\"];\nn88946092640567296[shape=rectangle, label=\"B309\"];\nn86131342873460736[shape=rectangle, label=\"B310\"];\nn89509042593988608[shape=rectangle, label=\"B311\"];\nn86694292826882048[shape=rectangle, label=\"B312\"];\nn90071992547409920[shape=rectangle, label=\"B313\"];\nn87538717757014016[shape=rectangle, label=\"B314\"];\nn90353467524120576[shape=rectangle, label=\"B315\"];\nn88101667710435328[shape=rectangle, label=\"B316\"];\nn90634942500831232[shape=rectangle, label=\"B317\"];\nn88664617663856640[shape=rectangle, label=\"B318\"];\nn90916417477541888[shape=rectangle, label=\"B319\"];\nn89227567617277952[shape=rectangle, label=\"B320\"];\nn91197892454252544[shape=rectangle, label=\"B321\"];\nn89790517570699264[shape=rectangle, label=\"B322\"];\nn87257242780303360[shape=rectangle, label=\"B323\"];\nn91479367430963200[shape=rectangle, label=\"B324\"];\nn92042317384384512[shape=rectangle, label=\"B325\"];\nn91760842407673856[shape=rectangle, label=\"B326\"];\nn27021597764222976[shape=rectangle, label=\"B327\"];\nn92605267337805824[shape=rectangle, label=\"B328\"];\nn25895697857380352[shape=rectangle, label=\"B329\"];\nn92323792361095168[shape=rectangle, label=\"B330\"];\nn93168217291227136[shape=rectangle, label=\"B331\"];\nn93731167244648448[shape=rectangle, label=\"B332\"];\nn94294117198069760[shape=rectangle, label=\"B333\"];\nn94012642221359104[shape=rectangle, label=\"B334\"];\nn93449692267937792[shape=rectangle, label=\"B335\"];\nn281474976710656 -> n562949953421312;\nn281474976710656 -> n844424930131968;\nn844424930131968 -> n562949953421312;\nn844424930131968 -> n1125899906842624;\nn1125899906842624 -> n562949953421312;\nn1125899906842624 -> n1407374883553280;\nn1407374883553280 -> n1688849860263936;\nn1407374883553280 -> n562949953421312;\nn562949953421312 -> n1688849860263936;\nn1688849860263936 -> n1970324836974592;\nn1688849860263936 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2533274790395904 -> n2533274790395904[style=dashed];\nn2533274790395904 -> n1970324836974592;\nn1970324836974592 -> n2814749767106560;\nn1970324836974592 -> n3096224743817216;\nn3096224743817216 -> n3377699720527872;\nn3659174697238528 -> n2814749767106560;\nn3659174697238528 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn3377699720527872 -> n3940649673949184;\nn3940649673949184 -> n3377699720527872;\nn3940649673949184 -> n2814749767106560;\nn4222124650659840 -> n4503599627370496;\nn4222124650659840 -> n4785074604081152;\nn4785074604081152 -> n5066549580791808;\nn4785074604081152 -> n4503599627370496;\nn4503599627370496 -> n5348024557502464;\nn4503599627370496 -> n5629499534213120;\nn5629499534213120 -> n5910974510923776;\nn5629499534213120 -> n5348024557502464;\nn5348024557502464 -> n6192449487634432;\nn5348024557502464 -> n6473924464345088;\nn6473924464345088 -> n6755399441055744;\nn6473924464345088 -> n7036874417766400;\nn7036874417766400 -> n22517998136852480;\nn22517998136852480 -> n7318349394477056;\nn22517998136852480 -> n7599824371187712;\nn7599824371187712 -> n7881299347898368;\nn7599824371187712 -> n8162774324609024;\nn8162774324609024 -> n8444249301319680;\nn7318349394477056 -> n8444249301319680;\nn7318349394477056 -> n7881299347898368;\nn7881299347898368 -> n8725724278030336;\nn7881299347898368 -> n9007199254740992;\nn9007199254740992 -> n8444249301319680;\nn9007199254740992 -> n9288674231451648;\nn9288674231451648 -> n9570149208162304;\nn8444249301319680 -> n9570149208162304;\nn8444249301319680 -> n9851624184872960;\nn9851624184872960 -> n10133099161583616;\nn9851624184872960 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10977524091715584;\nn10977524091715584 -> n11258999068426240;\nn9570149208162304 -> n8725724278030336;\nn9570149208162304 -> n11540474045136896;\nn11540474045136896 -> n10414574138294272;\nn11540474045136896 -> n10133099161583616;\nn10133099161583616 -> n11821949021847552;\nn10133099161583616 -> n12103423998558208;\nn12103423998558208 -> n8725724278030336;\nn12103423998558208 -> n12384898975268864;\nn12384898975268864 -> n11821949021847552;\nn11821949021847552 -> n11258999068426240;\nn11821949021847552 -> n10696049115004928;\nn10696049115004928 -> n12666373951979520;\nn10696049115004928 -> n12947848928690176;\nn12947848928690176 -> n11258999068426240;\nn11258999068426240 -> n12666373951979520;\nn11258999068426240 -> n13229323905400832;\nn13229323905400832 -> n12666373951979520;\nn13229323905400832 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n13792273858822144;\nn13792273858822144 -> n14636698788954112;\nn13792273858822144 -> n14918173765664768;\nn14918173765664768 -> n8725724278030336;\nn14918173765664768 -> n15199648742375424;\nn15199648742375424 -> n14636698788954112;\nn15199648742375424 -> n15481123719086080;\nn15481123719086080 -> n15762598695796736;\nn14636698788954112 -> n15762598695796736;\nn14636698788954112 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn16044073672507392 -> n16607023625928704;\nn16607023625928704 -> n14355223812243456;\nn16607023625928704 -> n16888498602639360;\nn16888498602639360 -> n13792273858822144;\nn16888498602639360 -> n17169973579350016;\nn17169973579350016 -> n14355223812243456;\nn15762598695796736 -> n8725724278030336;\nn15762598695796736 -> n17451448556060672;\nn17451448556060672 -> n16607023625928704;\nn17451448556060672 -> n16325548649218048;\nn16325548649218048 -> n14073748835532800;\nn16325548649218048 -> n17732923532771328;\nn17732923532771328 -> n8725724278030336;\nn17732923532771328 -> n18014398509481984;\nn18014398509481984 -> n14073748835532800;\nn12666373951979520 -> n18295873486192640;\nn18577348462903296 -> n21110623253299200;\nn21110623253299200 -> n14355223812243456;\nn21110623253299200 -> n18295873486192640;\nn18295873486192640 -> n18858823439613952;\nn18295873486192640 -> n19140298416324608;\nn19140298416324608 -> n8725724278030336;\nn19140298416324608 -> n19421773393035264;\nn19421773393035264 -> n18858823439613952;\nn19421773393035264 -> n19703248369745920;\nn19703248369745920 -> n19984723346456576;\nn18858823439613952 -> n19984723346456576;\nn18858823439613952 -> n20266198323167232;\nn20266198323167232 -> n20547673299877888;\nn20266198323167232 -> n20829148276588544;\nn20829148276588544 -> n21110623253299200;\nn20829148276588544 -> n21392098230009856;\nn21392098230009856 -> n14355223812243456;\nn19984723346456576 -> n8725724278030336;\nn19984723346456576 -> n21673573206720512;\nn21673573206720512 -> n20829148276588544;\nn21673573206720512 -> n20547673299877888;\nn20547673299877888 -> n18577348462903296;\nn20547673299877888 -> n21955048183431168;\nn21955048183431168 -> n8725724278030336;\nn21955048183431168 -> n22236523160141824;\nn22236523160141824 -> n18577348462903296;\nn14355223812243456 -> n22517998136852480;\nn14355223812243456 -> n22799473113563136;\nn22799473113563136 -> n6755399441055744;\nn6755399441055744 -> n92886742314516480;\nn92886742314516480 -> n6192449487634432;\nn5066549580791808 -> n8725724278030336;\nn5066549580791808 -> n23080948090273792;\nn23080948090273792 -> n23362423066984448;\nn23080948090273792 -> n23643898043695104;\nn23643898043695104 -> n23925373020405760;\nn23925373020405760 -> n23925373020405760[style=dashed];\nn23925373020405760 -> n23362423066984448;\nn23362423066984448 -> n4503599627370496;\nn23362423066984448 -> n24206847997116416;\nn24206847997116416 -> n4503599627370496;\nn8725724278030336 -> n24488322973827072;\nn5910974510923776 -> n24769797950537728;\nn5910974510923776 -> n6192449487634432;\nn6192449487634432 -> n25051272927248384;\nn6192449487634432 -> n25332747903959040;\nn25332747903959040 -> n24488322973827072;\nn25051272927248384 -> n24488322973827072;\nn24769797950537728 -> n6473924464345088;\nn24769797950537728 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n26177172834091008;\nn26177172834091008 -> n26458647810801664;\nn26740122787512320 -> n27021597764222976;\nn26740122787512320 -> n26458647810801664;\nn26458647810801664 -> n27303072740933632;\nn26458647810801664 -> n27584547717644288;\nn27584547717644288 -> n27866022694354944;\nn27584547717644288 -> n28147497671065600;\nn28147497671065600 -> n28428972647776256;\nn27303072740933632 -> n28428972647776256;\nn27303072740933632 -> n27866022694354944;\nn27866022694354944 -> n28710447624486912;\nn27866022694354944 -> n28991922601197568;\nn28991922601197568 -> n29273397577908224;\nn28991922601197568 -> n29554872554618880;\nn29554872554618880 -> n29836347531329536;\nn29554872554618880 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n30962247438172160;\nn30680772461461504 -> n31243722414882816;\nn31243722414882816 -> n31525197391593472;\nn28710447624486912 -> n31806672368304128;\nn28710447624486912 -> n32088147345014784;\nn32088147345014784 -> n29554872554618880;\nn32088147345014784 -> n29273397577908224;\nn29273397577908224 -> n32369622321725440;\nn29273397577908224 -> n32651097298436096;\nn32651097298436096 -> n30117822508040192;\nn32651097298436096 -> n29836347531329536;\nn29836347531329536 -> n32932572275146752;\nn29836347531329536 -> n33214047251857408;\nn33214047251857408 -> n30680772461461504;\nn33214047251857408 -> n30399297484750848;\nn30399297484750848 -> n33495522228568064;\nn30399297484750848 -> n33776997205278720;\nn33776997205278720 -> n31243722414882816;\nn33776997205278720 -> n30962247438172160;\nn30962247438172160 -> n34058472181989376;\nn30962247438172160 -> n34339947158700032;\nn34339947158700032 -> n31525197391593472;\nn31806672368304128 -> n29554872554618880;\nn31806672368304128 -> n34621422135410688;\nn34621422135410688 -> n29273397577908224;\nn32369622321725440 -> n30117822508040192;\nn32369622321725440 -> n34902897112121344;\nn34902897112121344 -> n29836347531329536;\nn32932572275146752 -> n30680772461461504;\nn32932572275146752 -> n35184372088832000;\nn35184372088832000 -> n30399297484750848;\nn33495522228568064 -> n31243722414882816;\nn33495522228568064 -> n35465847065542656;\nn35465847065542656 -> n30962247438172160;\nn34058472181989376 -> n31525197391593472;\nn31525197391593472 -> n35747322042253312;\nn31525197391593472 -> n36028797018963968;\nn36028797018963968 -> n28428972647776256;\nn35747322042253312 -> n36310271995674624;\nn35747322042253312 -> n36591746972385280;\nn36591746972385280 -> n28428972647776256;\nn36310271995674624 -> n28428972647776256;\nn28428972647776256 -> n36873221949095936;\nn28428972647776256 -> n37154696925806592;\nn37154696925806592 -> n37436171902517248;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37999121855938560 -> n37999121855938560[style=dashed];\nn37999121855938560 -> n38280596832649216;\nn38280596832649216 -> n37436171902517248;\nn37436171902517248 -> n38562071809359872;\nn37436171902517248 -> n38843546786070528;\nn38843546786070528 -> n39125021762781184;\nn38843546786070528 -> n39406496739491840;\nn39406496739491840 -> n39687971716202496;\nn36873221949095936 -> n39969446692913152;\nn36873221949095936 -> n40250921669623808;\nn40250921669623808 -> n40532396646334464;\nn40250921669623808 -> n40813871623045120;\nn40813871623045120 -> n41095346599755776;\nn40813871623045120 -> n41376821576466432;\nn41376821576466432 -> n41658296553177088;\nn41376821576466432 -> n41939771529887744;\nn41939771529887744 -> n42221246506598400;\nn41939771529887744 -> n42502721483309056;\nn42502721483309056 -> n42784196460019712;\nn42502721483309056 -> n43065671436730368;\nn43065671436730368 -> n43347146413441024;\nn43065671436730368 -> n43628621390151680;\nn43628621390151680 -> n43910096366862336;\nn38562071809359872 -> n40250921669623808;\nn38562071809359872 -> n39969446692913152;\nn39969446692913152 -> n39687971716202496;\nn39969446692913152 -> n39125021762781184;\nn39125021762781184 -> n44191571343572992;\nn39125021762781184 -> n44473046320283648;\nn44473046320283648 -> n44754521296994304;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n44191571343572992;\nn41095346599755776 -> n45317471250415616;\nn41095346599755776 -> n45598946227126272;\nn45598946227126272 -> n41939771529887744;\nn45598946227126272 -> n41658296553177088;\nn41658296553177088 -> n45880421203836928;\nn41658296553177088 -> n46161896180547584;\nn46161896180547584 -> n42502721483309056;\nn46161896180547584 -> n42221246506598400;\nn42221246506598400 -> n46443371157258240;\nn42221246506598400 -> n46724846133968896;\nn46724846133968896 -> n43065671436730368;\nn46724846133968896 -> n42784196460019712;\nn42784196460019712 -> n47006321110679552;\nn42784196460019712 -> n47287796087390208;\nn47287796087390208 -> n43628621390151680;\nn47287796087390208 -> n43347146413441024;\nn43347146413441024 -> n47569271064100864;\nn43347146413441024 -> n47850746040811520;\nn47850746040811520 -> n43910096366862336;\nn45317471250415616 -> n41939771529887744;\nn45317471250415616 -> n48132221017522176;\nn48132221017522176 -> n41658296553177088;\nn45880421203836928 -> n42502721483309056;\nn45880421203836928 -> n48413695994232832;\nn48413695994232832 -> n42221246506598400;\nn46443371157258240 -> n43065671436730368;\nn46443371157258240 -> n48695170970943488;\nn48695170970943488 -> n42784196460019712;\nn47006321110679552 -> n43628621390151680;\nn47006321110679552 -> n48976645947654144;\nn48976645947654144 -> n43347146413441024;\nn47569271064100864 -> n43910096366862336;\nn43910096366862336 -> n49258120924364800;\nn43910096366862336 -> n49539595901075456;\nn49539595901075456 -> n40532396646334464;\nn49258120924364800 -> n49821070877786112;\nn49258120924364800 -> n50102545854496768;\nn50102545854496768 -> n40532396646334464;\nn49821070877786112 -> n40532396646334464;\nn40532396646334464 -> n39125021762781184;\nn40532396646334464 -> n39687971716202496;\nn39687971716202496 -> n44191571343572992;\nn39687971716202496 -> n44754521296994304;\nn44754521296994304 -> n44191571343572992;\nn44754521296994304 -> n50384020831207424;\nn50384020831207424 -> n50665495807918080;\nn50946970784628736 -> n63050394783186944;\nn63050394783186944 -> n26740122787512320;\nn63050394783186944 -> n50665495807918080;\nn50665495807918080 -> n51228445761339392;\nn50665495807918080 -> n51509920738050048;\nn51509920738050048 -> n51791395714760704;\nn51509920738050048 -> n52072870691471360;\nn52072870691471360 -> n52354345668182016;\nn52072870691471360 -> n52635820644892672;\nn52635820644892672 -> n52917295621603328;\nn52635820644892672 -> n53198770598313984;\nn53198770598313984 -> n53480245575024640;\nn53198770598313984 -> n53761720551735296;\nn53761720551735296 -> n54043195528445952;\nn53761720551735296 -> n54324670505156608;\nn54324670505156608 -> n54606145481867264;\nn51791395714760704 -> n54887620458577920;\nn51791395714760704 -> n55169095435288576;\nn55169095435288576 -> n52635820644892672;\nn55169095435288576 -> n52354345668182016;\nn52354345668182016 -> n55450570411999232;\nn52354345668182016 -> n55732045388709888;\nn55732045388709888 -> n53198770598313984;\nn55732045388709888 -> n52917295621603328;\nn52917295621603328 -> n56013520365420544;\nn52917295621603328 -> n56294995342131200;\nn56294995342131200 -> n53761720551735296;\nn56294995342131200 -> n53480245575024640;\nn53480245575024640 -> n56576470318841856;\nn53480245575024640 -> n56857945295552512;\nn56857945295552512 -> n54324670505156608;\nn56857945295552512 -> n54043195528445952;\nn54043195528445952 -> n57139420272263168;\nn54043195528445952 -> n57420895248973824;\nn57420895248973824 -> n54606145481867264;\nn54887620458577920 -> n52635820644892672;\nn54887620458577920 -> n57702370225684480;\nn57702370225684480 -> n52354345668182016;\nn55450570411999232 -> n53198770598313984;\nn55450570411999232 -> n57983845202395136;\nn57983845202395136 -> n52917295621603328;\nn56013520365420544 -> n53761720551735296;\nn56013520365420544 -> n58265320179105792;\nn58265320179105792 -> n53480245575024640;\nn56576470318841856 -> n54324670505156608;\nn56576470318841856 -> n58546795155816448;\nn58546795155816448 -> n54043195528445952;\nn57139420272263168 -> n54606145481867264;\nn54606145481867264 -> n58828270132527104;\nn54606145481867264 -> n59109745109237760;\nn59109745109237760 -> n51228445761339392;\nn58828270132527104 -> n59391220085948416;\nn58828270132527104 -> n59672695062659072;\nn59672695062659072 -> n51228445761339392;\nn59391220085948416 -> n51228445761339392;\nn51228445761339392 -> n59954170039369728;\nn51228445761339392 -> n60235645016080384;\nn60235645016080384 -> n60517119992791040;\nn60235645016080384 -> n60798594969501696;\nn60798594969501696 -> n61080069946212352;\nn61080069946212352 -> n61080069946212352[style=dashed];\nn61080069946212352 -> n61361544922923008;\nn61361544922923008 -> n60517119992791040;\nn60517119992791040 -> n26740122787512320;\nn60517119992791040 -> n61643019899633664;\nn61643019899633664 -> n61924494876344320;\nn61643019899633664 -> n62205969853054976;\nn62205969853054976 -> n26740122787512320;\nn62205969853054976 -> n62487444829765632;\nn62487444829765632 -> n50665495807918080;\nn62487444829765632 -> n62768919806476288;\nn62768919806476288 -> n26740122787512320;\nn59954170039369728 -> n62205969853054976;\nn59954170039369728 -> n61924494876344320;\nn61924494876344320 -> n63050394783186944;\nn61924494876344320 -> n63331869759897600;\nn63331869759897600 -> n63613344736608256;\nn63331869759897600 -> n63894819713318912;\nn63894819713318912 -> n64176294690029568;\nn63894819713318912 -> n64457769666740224;\nn64457769666740224 -> n64739244643450880;\nn64457769666740224 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn65020719620161536 -> n65583669573582848;\nn65583669573582848 -> n65865144550293504;\nn65583669573582848 -> n66146619527004160;\nn66146619527004160 -> n66428094503714816;\nn63613344736608256 -> n66709569480425472;\nn63613344736608256 -> n66991044457136128;\nn66991044457136128 -> n64457769666740224;\nn66991044457136128 -> n64176294690029568;\nn64176294690029568 -> n67272519433846784;\nn64176294690029568 -> n67553994410557440;\nn67553994410557440 -> n65020719620161536;\nn67553994410557440 -> n64739244643450880;\nn64739244643450880 -> n67835469387268096;\nn64739244643450880 -> n68116944363978752;\nn68116944363978752 -> n65583669573582848;\nn68116944363978752 -> n65302194596872192;\nn65302194596872192 -> n68398419340689408;\nn65302194596872192 -> n68679894317400064;\nn68679894317400064 -> n66146619527004160;\nn68679894317400064 -> n65865144550293504;\nn65865144550293504 -> n68961369294110720;\nn65865144550293504 -> n69242844270821376;\nn69242844270821376 -> n66428094503714816;\nn66709569480425472 -> n64457769666740224;\nn66709569480425472 -> n69524319247532032;\nn69524319247532032 -> n64176294690029568;\nn67272519433846784 -> n65020719620161536;\nn67272519433846784 -> n69805794224242688;\nn69805794224242688 -> n64739244643450880;\nn67835469387268096 -> n65583669573582848;\nn67835469387268096 -> n70087269200953344;\nn70087269200953344 -> n65302194596872192;\nn68398419340689408 -> n66146619527004160;\nn68398419340689408 -> n70368744177664000;\nn70368744177664000 -> n65865144550293504;\nn68961369294110720 -> n66428094503714816;\nn66428094503714816 -> n50946970784628736;\nn66428094503714816 -> n70650219154374656;\nn70650219154374656 -> n70931694131085312;\nn70650219154374656 -> n71213169107795968;\nn71213169107795968 -> n63050394783186944;\nn70931694131085312 -> n63050394783186944;\nn44191571343572992 -> n71494644084506624;\nn71776119061217280 -> n83879543059775488;\nn83879543059775488 -> n83316593106354176;\nn83316593106354176 -> n26740122787512320;\nn83316593106354176 -> n71494644084506624;\nn71494644084506624 -> n72057594037927936;\nn71494644084506624 -> n72339069014638592;\nn72339069014638592 -> n72620543991349248;\nn72339069014638592 -> n72902018968059904;\nn72902018968059904 -> n73183493944770560;\nn72902018968059904 -> n73464968921481216;\nn73464968921481216 -> n73746443898191872;\nn73464968921481216 -> n74027918874902528;\nn74027918874902528 -> n74309393851613184;\nn74027918874902528 -> n74590868828323840;\nn74590868828323840 -> n74872343805034496;\nn74590868828323840 -> n75153818781745152;\nn75153818781745152 -> n75435293758455808;\nn72620543991349248 -> n75716768735166464;\nn72620543991349248 -> n75998243711877120;\nn75998243711877120 -> n73464968921481216;\nn75998243711877120 -> n73183493944770560;\nn73183493944770560 -> n76279718688587776;\nn73183493944770560 -> n76561193665298432;\nn76561193665298432 -> n74027918874902528;\nn76561193665298432 -> n73746443898191872;\nn73746443898191872 -> n76842668642009088;\nn73746443898191872 -> n77124143618719744;\nn77124143618719744 -> n74590868828323840;\nn77124143618719744 -> n74309393851613184;\nn74309393851613184 -> n77405618595430400;\nn74309393851613184 -> n77687093572141056;\nn77687093572141056 -> n75153818781745152;\nn77687093572141056 -> n74872343805034496;\nn74872343805034496 -> n77968568548851712;\nn74872343805034496 -> n78250043525562368;\nn78250043525562368 -> n75435293758455808;\nn75716768735166464 -> n73464968921481216;\nn75716768735166464 -> n78531518502273024;\nn78531518502273024 -> n73183493944770560;\nn76279718688587776 -> n74027918874902528;\nn76279718688587776 -> n78812993478983680;\nn78812993478983680 -> n73746443898191872;\nn76842668642009088 -> n74590868828323840;\nn76842668642009088 -> n79094468455694336;\nn79094468455694336 -> n74309393851613184;\nn77405618595430400 -> n75153818781745152;\nn77405618595430400 -> n79375943432404992;\nn79375943432404992 -> n74872343805034496;\nn77968568548851712 -> n75435293758455808;\nn75435293758455808 -> n79657418409115648;\nn75435293758455808 -> n79938893385826304;\nn79938893385826304 -> n72057594037927936;\nn79657418409115648 -> n80220368362536960;\nn79657418409115648 -> n80501843339247616;\nn80501843339247616 -> n72057594037927936;\nn80220368362536960 -> n72057594037927936;\nn72057594037927936 -> n80783318315958272;\nn72057594037927936 -> n81064793292668928;\nn81064793292668928 -> n81346268269379584;\nn81064793292668928 -> n81627743246090240;\nn81627743246090240 -> n81909218222800896;\nn81909218222800896 -> n81909218222800896[style=dashed];\nn81909218222800896 -> n82190693199511552;\nn82190693199511552 -> n81346268269379584;\nn81346268269379584 -> n26740122787512320;\nn81346268269379584 -> n82472168176222208;\nn82472168176222208 -> n82753643152932864;\nn82472168176222208 -> n83035118129643520;\nn83035118129643520 -> n83316593106354176;\nn83035118129643520 -> n83598068083064832;\nn83598068083064832 -> n26740122787512320;\nn80783318315958272 -> n83035118129643520;\nn80783318315958272 -> n82753643152932864;\nn82753643152932864 -> n83879543059775488;\nn82753643152932864 -> n84161018036486144;\nn84161018036486144 -> n84442493013196800;\nn84161018036486144 -> n84723967989907456;\nn84723967989907456 -> n85005442966618112;\nn84723967989907456 -> n85286917943328768;\nn85286917943328768 -> n85568392920039424;\nn85286917943328768 -> n85849867896750080;\nn85849867896750080 -> n86131342873460736;\nn85849867896750080 -> n86412817850171392;\nn86412817850171392 -> n86694292826882048;\nn86412817850171392 -> n86975767803592704;\nn86975767803592704 -> n87257242780303360;\nn84442493013196800 -> n87538717757014016;\nn84442493013196800 -> n87820192733724672;\nn87820192733724672 -> n85286917943328768;\nn87820192733724672 -> n85005442966618112;\nn85005442966618112 -> n88101667710435328;\nn85005442966618112 -> n88383142687145984;\nn88383142687145984 -> n85849867896750080;\nn88383142687145984 -> n85568392920039424;\nn85568392920039424 -> n88664617663856640;\nn85568392920039424 -> n88946092640567296;\nn88946092640567296 -> n86412817850171392;\nn88946092640567296 -> n86131342873460736;\nn86131342873460736 -> n89227567617277952;\nn86131342873460736 -> n89509042593988608;\nn89509042593988608 -> n86975767803592704;\nn89509042593988608 -> n86694292826882048;\nn86694292826882048 -> n89790517570699264;\nn86694292826882048 -> n90071992547409920;\nn90071992547409920 -> n87257242780303360;\nn87538717757014016 -> n85286917943328768;\nn87538717757014016 -> n90353467524120576;\nn90353467524120576 -> n85005442966618112;\nn88101667710435328 -> n85849867896750080;\nn88101667710435328 -> n90634942500831232;\nn90634942500831232 -> n85568392920039424;\nn88664617663856640 -> n86412817850171392;\nn88664617663856640 -> n90916417477541888;\nn90916417477541888 -> n86131342873460736;\nn89227567617277952 -> n86975767803592704;\nn89227567617277952 -> n91197892454252544;\nn91197892454252544 -> n86694292826882048;\nn89790517570699264 -> n87257242780303360;\nn87257242780303360 -> n71776119061217280;\nn87257242780303360 -> n91479367430963200;\nn91479367430963200 -> n91760842407673856;\nn91479367430963200 -> n92042317384384512;\nn92042317384384512 -> n83879543059775488;\nn91760842407673856 -> n83879543059775488;\nn27021597764222976 -> n92323792361095168;\nn27021597764222976 -> n92605267337805824;\nn92605267337805824 -> n6473924464345088;\nn25895697857380352 -> n92323792361095168;\nn92323792361095168 -> n92886742314516480;\nn93168217291227136 -> n93449692267937792;\nn93168217291227136 -> n93731167244648448;\nn93731167244648448 -> n94012642221359104;\nn93731167244648448 -> n94294117198069760;\nn94294117198069760 -> n94012642221359104;\nn94012642221359104 -> n93449692267937792;\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-375.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B2\"];\nn281474976710656[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn53198770598313984[shape=rectangle, label=\"B5\"];\nn1970324836974592[shape=rectangle, label=\"B6\"];\nn1688849860263936[shape=rectangle, label=\"B7\"];\nn2251799813685248[shape=rectangle, label=\"B8\"];\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn44473046320283648[shape=rectangle, label=\"B10\"];\nn3377699720527872[shape=rectangle, label=\"B11\"];\nn3096224743817216[shape=rectangle, label=\"B12\"];\nn3659174697238528[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn3940649673949184[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn4503599627370496[shape=rectangle, label=\"B17\"];\nn5066549580791808[shape=rectangle, label=\"B18\"];\nn5629499534213120[shape=rectangle, label=\"B19\"];\nn6192449487634432[shape=rectangle, label=\"B20\"];\nn5910974510923776[shape=rectangle, label=\"B21\"];\nn6473924464345088[shape=rectangle, label=\"B22\"];\nn7036874417766400[shape=rectangle, label=\"B23\"];\nn7318349394477056[shape=rectangle, label=\"B24\"];\nn6755399441055744[shape=rectangle, label=\"B25\"];\nn7881299347898368[shape=rectangle, label=\"B26\"];\nn7599824371187712[shape=rectangle, label=\"B27\"];\nn8162774324609024[shape=rectangle, label=\"B28\"];\nn8725724278030336[shape=rectangle, label=\"B29\"];\nn8444249301319680[shape=rectangle, label=\"B30\"];\nn9007199254740992[shape=rectangle, label=\"B31\"];\nn9288674231451648[shape=rectangle, label=\"B32\"];\nn9851624184872960[shape=rectangle, label=\"B33\"];\nn9570149208162304[shape=rectangle, label=\"B34\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn10414574138294272[shape=rectangle, label=\"B36\"];\nn10977524091715584[shape=rectangle, label=\"B37\"];\nn10696049115004928[shape=rectangle, label=\"B38\"];\nn11258999068426240[shape=rectangle, label=\"B39\"];\nn11540474045136896[shape=rectangle, label=\"B40\"];\nn12103423998558208[shape=rectangle, label=\"B41\"];\nn11821949021847552[shape=rectangle, label=\"B42\"];\nn12384898975268864[shape=rectangle, label=\"B43\"];\nn12947848928690176[shape=rectangle, label=\"B44\"];\nn13510798882111488[shape=rectangle, label=\"B45\"];\nn13229323905400832[shape=rectangle, label=\"B46\"];\nn13792273858822144[shape=rectangle, label=\"B47\"];\nn14073748835532800[shape=rectangle, label=\"B48\"];\nn14636698788954112[shape=rectangle, label=\"B49\"];\nn14355223812243456[shape=rectangle, label=\"B50\"];\nn14918173765664768[shape=rectangle, label=\"B51\"];\nn15199648742375424[shape=rectangle, label=\"B52\"];\nn15762598695796736[shape=rectangle, label=\"B53\"];\nn15481123719086080[shape=rectangle, label=\"B54\"];\nn16044073672507392[shape=rectangle, label=\"B55\"];\nn16325548649218048[shape=rectangle, label=\"B56\"];\nn16888498602639360[shape=rectangle, label=\"B57\"];\nn16607023625928704[shape=rectangle, label=\"B58\"];\nn17169973579350016[shape=rectangle, label=\"B59\"];\nn17451448556060672[shape=rectangle, label=\"B60\"];\nn17732923532771328[shape=rectangle, label=\"B61\"];\nn18295873486192640[shape=rectangle, label=\"B62\"];\nn18014398509481984[shape=rectangle, label=\"B63\"];\nn18577348462903296[shape=rectangle, label=\"B64\"];\nn19140298416324608[shape=rectangle, label=\"B65\"];\nn18858823439613952[shape=rectangle, label=\"B66\"];\nn19421773393035264[shape=rectangle, label=\"B67\"];\nn19703248369745920[shape=rectangle, label=\"B68\"];\nn20266198323167232[shape=rectangle, label=\"B69\"];\nn19984723346456576[shape=rectangle, label=\"B70\"];\nn20547673299877888[shape=rectangle, label=\"B71\"];\nn12666373951979520[shape=rectangle, label=\"B72\"];\nn21110623253299200[shape=rectangle, label=\"B73\"];\nn5348024557502464[shape=rectangle, label=\"B74\"];\nn21673573206720512[shape=rectangle, label=\"B75\"];\nn21392098230009856[shape=rectangle, label=\"B76\"];\nn21955048183431168[shape=rectangle, label=\"B77\"];\nn22517998136852480[shape=rectangle, label=\"B78\"];\nn20829148276588544[shape=rectangle, label=\"B79\"];\nn23080948090273792[shape=rectangle, label=\"B80\"];\nn22799473113563136[shape=rectangle, label=\"B81\"];\nn23362423066984448[shape=rectangle, label=\"B82\"];\nn23925373020405760[shape=rectangle, label=\"B83\"];\nn24488322973827072[shape=rectangle, label=\"B84\"];\nn24206847997116416[shape=rectangle, label=\"B85\"];\nn24769797950537728[shape=rectangle, label=\"B86\"];\nn25332747903959040[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn25051272927248384[shape=rectangle, label=\"B89\"];\nn25895697857380352[shape=rectangle, label=\"B90\"];\nn26177172834091008[shape=rectangle, label=\"B91\"];\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn26740122787512320[shape=rectangle, label=\"B93\"];\nn27303072740933632[shape=rectangle, label=\"B94\"];\nn27021597764222976[shape=rectangle, label=\"B95\"];\nn27584547717644288[shape=rectangle, label=\"B96\"];\nn27866022694354944[shape=rectangle, label=\"B97\"];\nn28428972647776256[shape=rectangle, label=\"B98\"];\nn28147497671065600[shape=rectangle, label=\"B99\"];\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn28991922601197568[shape=rectangle, label=\"B101\"];\nn29554872554618880[shape=rectangle, label=\"B102\"];\nn29273397577908224[shape=rectangle, label=\"B103\"];\nn29836347531329536[shape=rectangle, label=\"B104\"];\nn30117822508040192[shape=rectangle, label=\"B105\"];\nn30680772461461504[shape=rectangle, label=\"B106\"];\nn30399297484750848[shape=rectangle, label=\"B107\"];\nn30962247438172160[shape=rectangle, label=\"B108\"];\nn31525197391593472[shape=rectangle, label=\"B109\"];\nn32088147345014784[shape=rectangle, label=\"B110\"];\nn31806672368304128[shape=rectangle, label=\"B111\"];\nn32369622321725440[shape=rectangle, label=\"B112\"];\nn32651097298436096[shape=rectangle, label=\"B113\"];\nn33214047251857408[shape=rectangle, label=\"B114\"];\nn32932572275146752[shape=rectangle, label=\"B115\"];\nn33495522228568064[shape=rectangle, label=\"B116\"];\nn33776997205278720[shape=rectangle, label=\"B117\"];\nn34339947158700032[shape=rectangle, label=\"B118\"];\nn34058472181989376[shape=rectangle, label=\"B119\"];\nn34621422135410688[shape=rectangle, label=\"B120\"];\nn34902897112121344[shape=rectangle, label=\"B121\"];\nn35465847065542656[shape=rectangle, label=\"B122\"];\nn35184372088832000[shape=rectangle, label=\"B123\"];\nn35747322042253312[shape=rectangle, label=\"B124\"];\nn36028797018963968[shape=rectangle, label=\"B125\"];\nn36310271995674624[shape=rectangle, label=\"B126\"];\nn36873221949095936[shape=rectangle, label=\"B127\"];\nn36591746972385280[shape=rectangle, label=\"B128\"];\nn37154696925806592[shape=rectangle, label=\"B129\"];\nn37717646879227904[shape=rectangle, label=\"B130\"];\nn37436171902517248[shape=rectangle, label=\"B131\"];\nn37999121855938560[shape=rectangle, label=\"B132\"];\nn38280596832649216[shape=rectangle, label=\"B133\"];\nn38843546786070528[shape=rectangle, label=\"B134\"];\nn38562071809359872[shape=rectangle, label=\"B135\"];\nn39125021762781184[shape=rectangle, label=\"B136\"];\nn31243722414882816[shape=rectangle, label=\"B137\"];\nn39687971716202496[shape=rectangle, label=\"B138\"];\nn39406496739491840[shape=rectangle, label=\"B139\"];\nn23643898043695104[shape=rectangle, label=\"B140\"];\nn39969446692913152[shape=rectangle, label=\"B141\"];\nn40532396646334464[shape=rectangle, label=\"B142\"];\nn40250921669623808[shape=rectangle, label=\"B143\"];\nn41376821576466432[shape=rectangle, label=\"B144\"];\nn41095346599755776[shape=rectangle, label=\"B145\"];\nn41939771529887744[shape=rectangle, label=\"B146\"];\nn41658296553177088[shape=rectangle, label=\"B147\"];\nn22236523160141824[shape=rectangle, label=\"B148\"];\nn42221246506598400[shape=rectangle, label=\"B149\"];\nn42784196460019712[shape=rectangle, label=\"B150\"];\nn42502721483309056[shape=rectangle, label=\"B151\"];\nn43065671436730368[shape=rectangle, label=\"B152\"];\nn43347146413441024[shape=rectangle, label=\"B153\"];\nn40813871623045120[shape=rectangle, label=\"B154\"];\nn43910096366862336[shape=rectangle, label=\"B155\"];\nn43628621390151680[shape=rectangle, label=\"B156\"];\nn44191571343572992[shape=rectangle, label=\"B157\"];\nn2533274790395904[shape=rectangle, label=\"B158\"];\nn45035996273704960[shape=rectangle, label=\"B159\"];\nn45317471250415616[shape=rectangle, label=\"B160\"];\nn44754521296994304[shape=rectangle, label=\"B161\"];\nn45880421203836928[shape=rectangle, label=\"B162\"];\nn46161896180547584[shape=rectangle, label=\"B163\"];\nn45598946227126272[shape=rectangle, label=\"B164\"];\nn46724846133968896[shape=rectangle, label=\"B165\"];\nn47006321110679552[shape=rectangle, label=\"B166\"];\nn47569271064100864[shape=rectangle, label=\"B167\"];\nn47287796087390208[shape=rectangle, label=\"B168\"];\nn47850746040811520[shape=rectangle, label=\"B169\"];\nn48695170970943488[shape=rectangle, label=\"B170\"];\nn48413695994232832[shape=rectangle, label=\"B171\"];\nn49258120924364800[shape=rectangle, label=\"B172\"];\nn49821070877786112[shape=rectangle, label=\"B173\"];\nn49539595901075456[shape=rectangle, label=\"B174\"];\nn50102545854496768[shape=rectangle, label=\"B175\"];\nn48976645947654144[shape=rectangle, label=\"B176\"];\nn48132221017522176[shape=rectangle, label=\"B177\"];\nn46443371157258240[shape=rectangle, label=\"B178\"];\nn50665495807918080[shape=rectangle, label=\"B179\"];\nn50946970784628736[shape=rectangle, label=\"B180\"];\nn50384020831207424[shape=rectangle, label=\"B181\"];\nn51791395714760704[shape=rectangle, label=\"B182\"];\nn51509920738050048[shape=rectangle, label=\"B183\"];\nn52354345668182016[shape=rectangle, label=\"B184\"];\nn52072870691471360[shape=rectangle, label=\"B185\"];\nn52917295621603328[shape=rectangle, label=\"B186\"];\nn52635820644892672[shape=rectangle, label=\"B187\"];\nn51228445761339392[shape=rectangle, label=\"B188\"];\nn53480245575024640[shape=rectangle, label=\"B189\"];\nn1125899906842624[shape=rectangle, label=\"B190\"];\nn54043195528445952[shape=rectangle, label=\"B191\"];\nn54324670505156608[shape=rectangle, label=\"B192\"];\nn54606145481867264[shape=rectangle, label=\"B193\"];\nn61643019899633664[shape=rectangle, label=\"B194\"];\nn55169095435288576[shape=rectangle, label=\"B195\"];\nn54887620458577920[shape=rectangle, label=\"B196\"];\nn55450570411999232[shape=rectangle, label=\"B197\"];\nn56013520365420544[shape=rectangle, label=\"B198\"];\nn55732045388709888[shape=rectangle, label=\"B199\"];\nn56576470318841856[shape=rectangle, label=\"B200\"];\nn56857945295552512[shape=rectangle, label=\"B201\"];\nn56294995342131200[shape=rectangle, label=\"B202\"];\nn57420895248973824[shape=rectangle, label=\"B203\"];\nn57139420272263168[shape=rectangle, label=\"B204\"];\nn57983845202395136[shape=rectangle, label=\"B205\"];\nn58546795155816448[shape=rectangle, label=\"B206\"];\nn58265320179105792[shape=rectangle, label=\"B207\"];\nn59109745109237760[shape=rectangle, label=\"B208\"];\nn57702370225684480[shape=rectangle, label=\"B209\"];\nn58828270132527104[shape=rectangle, label=\"B210\"];\nn59672695062659072[shape=rectangle, label=\"B211\"];\nn59391220085948416[shape=rectangle, label=\"B212\"];\nn60235645016080384[shape=rectangle, label=\"B213\"];\nn59954170039369728[shape=rectangle, label=\"B214\"];\nn60798594969501696[shape=rectangle, label=\"B215\"];\nn60517119992791040[shape=rectangle, label=\"B216\"];\nn61080069946212352[shape=rectangle, label=\"B217\"];\nn61361544922923008[shape=rectangle, label=\"B218\"];\nn53761720551735296[shape=rectangle, label=\"B219\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn562949953421312 -> n844424930131968;\nn844424930131968 -> n281474976710656;\nn281474976710656 -> n1125899906842624;\nn281474976710656 -> n1407374883553280;\nn1407374883553280 -> n53198770598313984;\nn53198770598313984 -> n1688849860263936;\nn53198770598313984 -> n1970324836974592;\nn1970324836974592 -> n2251799813685248;\nn1970324836974592 -> n1688849860263936;\nn1688849860263936 -> n2251799813685248;\nn2251799813685248 -> n2533274790395904;\nn2251799813685248 -> n2814749767106560;\nn2814749767106560 -> n44473046320283648;\nn44473046320283648 -> n3096224743817216;\nn44473046320283648 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn3377699720527872 -> n3096224743817216;\nn3096224743817216 -> n3659174697238528;\nn3659174697238528 -> n3940649673949184;\nn3659174697238528 -> n4222124650659840;\nn4222124650659840 -> n3940649673949184;\nn3940649673949184 -> n4503599627370496;\nn3940649673949184 -> n4785074604081152;\nn4785074604081152 -> n5066549580791808;\nn4785074604081152 -> n4503599627370496;\nn4503599627370496 -> n5066549580791808;\nn5066549580791808 -> n5348024557502464;\nn5066549580791808 -> n5629499534213120;\nn5629499534213120 -> n5910974510923776;\nn5629499534213120 -> n6192449487634432;\nn6192449487634432 -> n6473924464345088;\nn6192449487634432 -> n5910974510923776;\nn5910974510923776 -> n6473924464345088;\nn6473924464345088 -> n6755399441055744;\nn6473924464345088 -> n7036874417766400;\nn7036874417766400 -> n5348024557502464;\nn7036874417766400 -> n7318349394477056;\nn7318349394477056 -> n7599824371187712;\nn6755399441055744 -> n7599824371187712;\nn6755399441055744 -> n7881299347898368;\nn7881299347898368 -> n7599824371187712;\nn7599824371187712 -> n5348024557502464;\nn7599824371187712 -> n8162774324609024;\nn8162774324609024 -> n8444249301319680;\nn8162774324609024 -> n8725724278030336;\nn8725724278030336 -> n9007199254740992;\nn8725724278030336 -> n8444249301319680;\nn8444249301319680 -> n9007199254740992;\nn9007199254740992 -> n5348024557502464;\nn9007199254740992 -> n9288674231451648;\nn9288674231451648 -> n9570149208162304;\nn9288674231451648 -> n9851624184872960;\nn9851624184872960 -> n10133099161583616;\nn9851624184872960 -> n9570149208162304;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n5348024557502464;\nn10133099161583616 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10977524091715584;\nn10977524091715584 -> n11258999068426240;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n5348024557502464;\nn11258999068426240 -> n11540474045136896;\nn11540474045136896 -> n11821949021847552;\nn11540474045136896 -> n12103423998558208;\nn12103423998558208 -> n12384898975268864;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn12384898975268864 -> n12666373951979520;\nn12384898975268864 -> n12947848928690176;\nn12947848928690176 -> n13229323905400832;\nn12947848928690176 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n13229323905400832;\nn13229323905400832 -> n13792273858822144;\nn13792273858822144 -> n12666373951979520;\nn13792273858822144 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n14918173765664768;\nn14636698788954112 -> n14355223812243456;\nn14355223812243456 -> n14918173765664768;\nn14918173765664768 -> n12666373951979520;\nn14918173765664768 -> n15199648742375424;\nn15199648742375424 -> n15481123719086080;\nn15199648742375424 -> n15762598695796736;\nn15762598695796736 -> n16044073672507392;\nn15762598695796736 -> n15481123719086080;\nn15481123719086080 -> n16044073672507392;\nn16044073672507392 -> n12666373951979520;\nn16044073672507392 -> n16325548649218048;\nn16325548649218048 -> n16607023625928704;\nn16325548649218048 -> n16888498602639360;\nn16888498602639360 -> n17169973579350016;\nn16888498602639360 -> n16607023625928704;\nn16607023625928704 -> n17169973579350016;\nn17169973579350016 -> n12666373951979520;\nn17169973579350016 -> n17451448556060672;\nn17451448556060672 -> n12666373951979520;\nn17451448556060672 -> n17732923532771328;\nn17732923532771328 -> n18014398509481984;\nn17732923532771328 -> n18295873486192640;\nn18295873486192640 -> n18014398509481984;\nn18014398509481984 -> n12666373951979520;\nn18014398509481984 -> n18577348462903296;\nn18577348462903296 -> n18858823439613952;\nn18577348462903296 -> n19140298416324608;\nn19140298416324608 -> n19421773393035264;\nn19140298416324608 -> n18858823439613952;\nn18858823439613952 -> n19421773393035264;\nn19421773393035264 -> n12666373951979520;\nn19421773393035264 -> n19703248369745920;\nn19703248369745920 -> n19984723346456576;\nn19703248369745920 -> n20266198323167232;\nn20266198323167232 -> n20547673299877888;\nn20266198323167232 -> n19984723346456576;\nn19984723346456576 -> n20547673299877888;\nn20547673299877888 -> n5348024557502464;\nn20547673299877888 -> n12666373951979520;\nn12666373951979520 -> n20829148276588544;\nn12666373951979520 -> n21110623253299200;\nn21110623253299200 -> n20829148276588544;\nn21110623253299200 -> n5348024557502464;\nn5348024557502464 -> n21392098230009856;\nn5348024557502464 -> n21673573206720512;\nn21673573206720512 -> n21955048183431168;\nn21673573206720512 -> n21392098230009856;\nn21392098230009856 -> n21955048183431168;\nn21955048183431168 -> n22236523160141824;\nn21955048183431168 -> n22517998136852480;\nn22517998136852480 -> n22236523160141824;\nn22517998136852480 -> n20829148276588544;\nn20829148276588544 -> n22799473113563136;\nn20829148276588544 -> n23080948090273792;\nn23080948090273792 -> n23362423066984448;\nn23080948090273792 -> n22799473113563136;\nn22799473113563136 -> n23362423066984448;\nn23362423066984448 -> n23643898043695104;\nn23362423066984448 -> n23925373020405760;\nn23925373020405760 -> n24206847997116416;\nn23925373020405760 -> n24488322973827072;\nn24488322973827072 -> n24769797950537728;\nn24488322973827072 -> n24206847997116416;\nn24206847997116416 -> n24769797950537728;\nn24769797950537728 -> n25051272927248384;\nn24769797950537728 -> n25332747903959040;\nn25332747903959040 -> n23643898043695104;\nn25332747903959040 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25051272927248384 -> n26177172834091008;\nn25051272927248384 -> n25895697857380352;\nn25895697857380352 -> n26458647810801664;\nn25895697857380352 -> n26177172834091008;\nn26177172834091008 -> n26458647810801664;\nn26458647810801664 -> n23643898043695104;\nn26458647810801664 -> n26740122787512320;\nn26740122787512320 -> n27021597764222976;\nn26740122787512320 -> n27303072740933632;\nn27303072740933632 -> n27584547717644288;\nn27303072740933632 -> n27021597764222976;\nn27021597764222976 -> n27584547717644288;\nn27584547717644288 -> n23643898043695104;\nn27584547717644288 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn27866022694354944 -> n28428972647776256;\nn28428972647776256 -> n28710447624486912;\nn28428972647776256 -> n28147497671065600;\nn28147497671065600 -> n28710447624486912;\nn28710447624486912 -> n23643898043695104;\nn28710447624486912 -> n28991922601197568;\nn28991922601197568 -> n29273397577908224;\nn28991922601197568 -> n29554872554618880;\nn29554872554618880 -> n29836347531329536;\nn29554872554618880 -> n29273397577908224;\nn29273397577908224 -> n29836347531329536;\nn29836347531329536 -> n23643898043695104;\nn29836347531329536 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n30962247438172160;\nn30680772461461504 -> n30399297484750848;\nn30399297484750848 -> n30962247438172160;\nn30962247438172160 -> n31243722414882816;\nn30962247438172160 -> n31525197391593472;\nn31525197391593472 -> n31806672368304128;\nn31525197391593472 -> n32088147345014784;\nn32088147345014784 -> n32369622321725440;\nn32088147345014784 -> n31806672368304128;\nn31806672368304128 -> n32369622321725440;\nn32369622321725440 -> n31243722414882816;\nn32369622321725440 -> n32651097298436096;\nn32651097298436096 -> n32932572275146752;\nn32651097298436096 -> n33214047251857408;\nn33214047251857408 -> n33495522228568064;\nn33214047251857408 -> n32932572275146752;\nn32932572275146752 -> n33495522228568064;\nn33495522228568064 -> n31243722414882816;\nn33495522228568064 -> n33776997205278720;\nn33776997205278720 -> n34058472181989376;\nn33776997205278720 -> n34339947158700032;\nn34339947158700032 -> n34621422135410688;\nn34339947158700032 -> n34058472181989376;\nn34058472181989376 -> n34621422135410688;\nn34621422135410688 -> n31243722414882816;\nn34621422135410688 -> n34902897112121344;\nn34902897112121344 -> n35184372088832000;\nn34902897112121344 -> n35465847065542656;\nn35465847065542656 -> n35747322042253312;\nn35465847065542656 -> n35184372088832000;\nn35184372088832000 -> n35747322042253312;\nn35747322042253312 -> n31243722414882816;\nn35747322042253312 -> n36028797018963968;\nn36028797018963968 -> n31243722414882816;\nn36028797018963968 -> n36310271995674624;\nn36310271995674624 -> n36591746972385280;\nn36310271995674624 -> n36873221949095936;\nn36873221949095936 -> n36591746972385280;\nn36591746972385280 -> n31243722414882816;\nn36591746972385280 -> n37154696925806592;\nn37154696925806592 -> n37436171902517248;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n37999121855938560;\nn37717646879227904 -> n37436171902517248;\nn37436171902517248 -> n37999121855938560;\nn37999121855938560 -> n31243722414882816;\nn37999121855938560 -> n38280596832649216;\nn38280596832649216 -> n38562071809359872;\nn38280596832649216 -> n38843546786070528;\nn38843546786070528 -> n39125021762781184;\nn38843546786070528 -> n38562071809359872;\nn38562071809359872 -> n39125021762781184;\nn39125021762781184 -> n23643898043695104;\nn39125021762781184 -> n31243722414882816;\nn31243722414882816 -> n39406496739491840;\nn31243722414882816 -> n39687971716202496;\nn39687971716202496 -> n23643898043695104;\nn39687971716202496 -> n39406496739491840;\nn39406496739491840 -> n39969446692913152;\nn23643898043695104 -> n39969446692913152;\nn39969446692913152 -> n40250921669623808;\nn39969446692913152 -> n40532396646334464;\nn40532396646334464 -> n40813871623045120;\nn40250921669623808 -> n41095346599755776;\nn40250921669623808 -> n41376821576466432;\nn41376821576466432 -> n40813871623045120;\nn41095346599755776 -> n41658296553177088;\nn41095346599755776 -> n41939771529887744;\nn41939771529887744 -> n42221246506598400;\nn41658296553177088 -> n40813871623045120;\nn22236523160141824 -> n40813871623045120;\nn22236523160141824 -> n42221246506598400;\nn42221246506598400 -> n42502721483309056;\nn42221246506598400 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn42784196460019712 -> n42502721483309056;\nn42502721483309056 -> n43065671436730368;\nn43065671436730368 -> n40813871623045120;\nn43065671436730368 -> n43347146413441024;\nn43347146413441024 -> n40813871623045120;\nn40813871623045120 -> n43628621390151680;\nn40813871623045120 -> n43910096366862336;\nn43910096366862336 -> n44191571343572992;\nn43910096366862336 -> n43628621390151680;\nn43628621390151680 -> n44191571343572992;\nn44191571343572992 -> n44473046320283648;\nn44191571343572992 -> n2533274790395904;\nn2533274790395904 -> n44754521296994304;\nn2533274790395904 -> n45035996273704960;\nn45035996273704960 -> n44754521296994304;\nn45035996273704960 -> n45317471250415616;\nn45317471250415616 -> n44754521296994304;\nn44754521296994304 -> n45598946227126272;\nn44754521296994304 -> n45880421203836928;\nn45880421203836928 -> n45598946227126272;\nn45880421203836928 -> n46161896180547584;\nn46161896180547584 -> n45598946227126272;\nn45598946227126272 -> n46443371157258240;\nn45598946227126272 -> n46724846133968896;\nn46724846133968896 -> n46443371157258240;\nn46724846133968896 -> n47006321110679552;\nn47006321110679552 -> n47287796087390208;\nn47006321110679552 -> n47569271064100864;\nn47569271064100864 -> n47850746040811520;\nn47569271064100864 -> n47287796087390208;\nn47287796087390208 -> n48132221017522176;\nn47287796087390208 -> n47850746040811520;\nn47850746040811520 -> n48413695994232832;\nn47850746040811520 -> n48695170970943488;\nn48695170970943488 -> n48976645947654144;\nn48695170970943488 -> n48413695994232832;\nn48413695994232832 -> n48976645947654144;\nn48413695994232832 -> n49258120924364800;\nn49258120924364800 -> n49539595901075456;\nn49258120924364800 -> n49821070877786112;\nn49821070877786112 -> n49539595901075456;\nn49539595901075456 -> n48976645947654144;\nn49539595901075456 -> n50102545854496768;\nn50102545854496768 -> n48976645947654144;\nn48976645947654144 -> n48132221017522176;\nn48132221017522176 -> n46443371157258240;\nn46443371157258240 -> n50384020831207424;\nn46443371157258240 -> n50665495807918080;\nn50665495807918080 -> n50384020831207424;\nn50665495807918080 -> n50946970784628736;\nn50946970784628736 -> n51228445761339392;\nn50946970784628736 -> n50384020831207424;\nn50384020831207424 -> n51509920738050048;\nn50384020831207424 -> n51791395714760704;\nn51791395714760704 -> n51228445761339392;\nn51509920738050048 -> n52072870691471360;\nn51509920738050048 -> n52354345668182016;\nn52354345668182016 -> n51228445761339392;\nn52072870691471360 -> n52635820644892672;\nn52072870691471360 -> n52917295621603328;\nn52917295621603328 -> n51228445761339392;\nn52635820644892672 -> n51228445761339392;\nn51228445761339392 -> n53198770598313984;\nn51228445761339392 -> n53480245575024640;\nn53480245575024640 -> n1125899906842624;\nn1125899906842624 -> n53761720551735296;\nn1125899906842624 -> n54043195528445952;\nn54043195528445952 -> n53761720551735296;\nn54043195528445952 -> n54324670505156608;\nn54324670505156608 -> n53761720551735296;\nn54324670505156608 -> n54606145481867264;\nn54606145481867264 -> n61643019899633664;\nn61643019899633664 -> n54887620458577920;\nn61643019899633664 -> n55169095435288576;\nn55169095435288576 -> n55450570411999232;\nn55169095435288576 -> n54887620458577920;\nn54887620458577920 -> n55450570411999232;\nn55450570411999232 -> n55732045388709888;\nn55450570411999232 -> n56013520365420544;\nn56013520365420544 -> n55732045388709888;\nn55732045388709888 -> n56294995342131200;\nn55732045388709888 -> n56576470318841856;\nn56576470318841856 -> n56294995342131200;\nn56576470318841856 -> n56857945295552512;\nn56857945295552512 -> n56294995342131200;\nn56294995342131200 -> n57139420272263168;\nn56294995342131200 -> n57420895248973824;\nn57420895248973824 -> n57139420272263168;\nn57139420272263168 -> n57702370225684480;\nn57139420272263168 -> n57983845202395136;\nn57983845202395136 -> n58265320179105792;\nn57983845202395136 -> n58546795155816448;\nn58546795155816448 -> n58265320179105792;\nn58265320179105792 -> n58828270132527104;\nn58265320179105792 -> n59109745109237760;\nn59109745109237760 -> n58828270132527104;\nn59109745109237760 -> n57702370225684480;\nn57702370225684480 -> n58828270132527104;\nn58828270132527104 -> n59391220085948416;\nn58828270132527104 -> n59672695062659072;\nn59672695062659072 -> n59391220085948416;\nn59391220085948416 -> n59954170039369728;\nn59391220085948416 -> n60235645016080384;\nn60235645016080384 -> n59954170039369728;\nn59954170039369728 -> n60517119992791040;\nn59954170039369728 -> n60798594969501696;\nn60798594969501696 -> n60517119992791040;\nn60517119992791040 -> n56294995342131200;\nn60517119992791040 -> n61080069946212352;\nn61080069946212352 -> n53761720551735296;\nn61080069946212352 -> n61361544922923008;\nn61361544922923008 -> n61643019899633664;\nn281474976710656 -> n0[style=dotted];\nn53198770598313984 -> n1407374883553280[style=dotted];\nn1688849860263936 -> n53198770598313984[style=dotted];\nn2251799813685248 -> n53198770598313984[style=dotted];\nn44473046320283648 -> n2814749767106560[style=dotted];\nn3096224743817216 -> n44473046320283648[style=dotted];\nn3659174697238528 -> n44473046320283648[style=dotted];\nn3940649673949184 -> n3659174697238528[style=dotted];\nn4503599627370496 -> n3940649673949184[style=dotted];\nn5066549580791808 -> n3940649673949184[style=dotted];\nn5910974510923776 -> n5629499534213120[style=dotted];\nn6473924464345088 -> n5629499534213120[style=dotted];\nn7599824371187712 -> n6473924464345088[style=dotted];\nn8444249301319680 -> n8162774324609024[style=dotted];\nn9007199254740992 -> n8162774324609024[style=dotted];\nn9570149208162304 -> n9288674231451648[style=dotted];\nn10133099161583616 -> n9288674231451648[style=dotted];\nn10696049115004928 -> n10414574138294272[style=dotted];\nn11258999068426240 -> n10414574138294272[style=dotted];\nn11821949021847552 -> n11540474045136896[style=dotted];\nn12384898975268864 -> n11540474045136896[style=dotted];\nn13229323905400832 -> n12947848928690176[style=dotted];\nn13792273858822144 -> n12947848928690176[style=dotted];\nn14355223812243456 -> n14073748835532800[style=dotted];\nn14918173765664768 -> n14073748835532800[style=dotted];\nn15481123719086080 -> n15199648742375424[style=dotted];\nn16044073672507392 -> n15199648742375424[style=dotted];\nn16607023625928704 -> n16325548649218048[style=dotted];\nn17169973579350016 -> n16325548649218048[style=dotted];\nn18014398509481984 -> n17732923532771328[style=dotted];\nn18858823439613952 -> n18577348462903296[style=dotted];\nn19421773393035264 -> n18577348462903296[style=dotted];\nn19984723346456576 -> n19703248369745920[style=dotted];\nn20547673299877888 -> n19703248369745920[style=dotted];\nn12666373951979520 -> n12384898975268864[style=dotted];\nn5348024557502464 -> n5066549580791808[style=dotted];\nn21392098230009856 -> n5348024557502464[style=dotted];\nn21955048183431168 -> n5348024557502464[style=dotted];\nn20829148276588544 -> n5066549580791808[style=dotted];\nn22799473113563136 -> n20829148276588544[style=dotted];\nn23362423066984448 -> n20829148276588544[style=dotted];\nn24206847997116416 -> n23925373020405760[style=dotted];\nn24769797950537728 -> n23925373020405760[style=dotted];\nn25895697857380352 -> n24769797950537728[style=dotted];\nn26177172834091008 -> n24769797950537728[style=dotted];\nn26458647810801664 -> n24769797950537728[style=dotted];\nn27021597764222976 -> n26740122787512320[style=dotted];\nn27584547717644288 -> n26740122787512320[style=dotted];\nn28147497671065600 -> n27866022694354944[style=dotted];\nn28710447624486912 -> n27866022694354944[style=dotted];\nn29273397577908224 -> n28991922601197568[style=dotted];\nn29836347531329536 -> n28991922601197568[style=dotted];\nn30399297484750848 -> n30117822508040192[style=dotted];\nn30962247438172160 -> n30117822508040192[style=dotted];\nn31806672368304128 -> n31525197391593472[style=dotted];\nn32369622321725440 -> n31525197391593472[style=dotted];\nn32932572275146752 -> n32651097298436096[style=dotted];\nn33495522228568064 -> n32651097298436096[style=dotted];\nn34058472181989376 -> n33776997205278720[style=dotted];\nn34621422135410688 -> n33776997205278720[style=dotted];\nn35184372088832000 -> n34902897112121344[style=dotted];\nn35747322042253312 -> n34902897112121344[style=dotted];\nn36591746972385280 -> n36310271995674624[style=dotted];\nn37436171902517248 -> n37154696925806592[style=dotted];\nn37999121855938560 -> n37154696925806592[style=dotted];\nn38562071809359872 -> n38280596832649216[style=dotted];\nn39125021762781184 -> n38280596832649216[style=dotted];\nn31243722414882816 -> n30962247438172160[style=dotted];\nn39406496739491840 -> n31243722414882816[style=dotted];\nn23643898043695104 -> n23362423066984448[style=dotted];\nn39969446692913152 -> n23362423066984448[style=dotted];\nn22236523160141824 -> n21955048183431168[style=dotted];\nn42221246506598400 -> n5066549580791808[style=dotted];\nn42502721483309056 -> n42221246506598400[style=dotted];\nn43065671436730368 -> n42221246506598400[style=dotted];\nn40813871623045120 -> n5066549580791808[style=dotted];\nn43628621390151680 -> n40813871623045120[style=dotted];\nn44191571343572992 -> n40813871623045120[style=dotted];\nn2533274790395904 -> n2251799813685248[style=dotted];\nn44754521296994304 -> n2533274790395904[style=dotted];\nn45598946227126272 -> n44754521296994304[style=dotted];\nn47287796087390208 -> n47006321110679552[style=dotted];\nn47850746040811520 -> n47006321110679552[style=dotted];\nn48413695994232832 -> n47850746040811520[style=dotted];\nn49539595901075456 -> n49258120924364800[style=dotted];\nn48976645947654144 -> n47850746040811520[style=dotted];\nn48132221017522176 -> n47006321110679552[style=dotted];\nn46443371157258240 -> n45598946227126272[style=dotted];\nn50384020831207424 -> n46443371157258240[style=dotted];\nn51228445761339392 -> n46443371157258240[style=dotted];\nn1125899906842624 -> n281474976710656[style=dotted];\nn61643019899633664 -> n54606145481867264[style=dotted];\nn54887620458577920 -> n61643019899633664[style=dotted];\nn55450570411999232 -> n61643019899633664[style=dotted];\nn55732045388709888 -> n55450570411999232[style=dotted];\nn56294995342131200 -> n55732045388709888[style=dotted];\nn57139420272263168 -> n56294995342131200[style=dotted];\nn58265320179105792 -> n57983845202395136[style=dotted];\nn57702370225684480 -> n57139420272263168[style=dotted];\nn58828270132527104 -> n57139420272263168[style=dotted];\nn59391220085948416 -> n58828270132527104[style=dotted];\nn59954170039369728 -> n59391220085948416[style=dotted];\nn60517119992791040 -> n59954170039369728[style=dotted];\nn53761720551735296 -> n1125899906842624[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-3807.txt",
    "content": "digraph {\n\nmaxiter=8;\n        \nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn844424930131968[shape=rectangle, label=\"B3\"];\nn1970324836974592[shape=rectangle, label=\"B4\"];\nn2533274790395904[shape=rectangle, label=\"B5\"];\nn2251799813685248[shape=rectangle, label=\"B6\"];\nn3096224743817216[shape=rectangle, label=\"B7\"];\nn9851624184872960[shape=rectangle, label=\"B8\"];\nn3659174697238528[shape=rectangle, label=\"B9\"];\nn4222124650659840[shape=rectangle, label=\"B10\"];\nn3940649673949184[shape=rectangle, label=\"B11\"];\nn4785074604081152[shape=rectangle, label=\"B12\"];\nn3377699720527872[shape=rectangle, label=\"B13\"];\nn5348024557502464[shape=rectangle, label=\"B14\"];\nn5910974510923776[shape=rectangle, label=\"B15\"];\nn5629499534213120[shape=rectangle, label=\"B16\"];\nn6473924464345088[shape=rectangle, label=\"B17\"];\nn6755399441055744[shape=rectangle, label=\"B18\"];\nn6192449487634432[shape=rectangle, label=\"B19\"];\nn7318349394477056[shape=rectangle, label=\"B20\"];\nn7599824371187712[shape=rectangle, label=\"B21\"];\nn7036874417766400[shape=rectangle, label=\"B22\"];\nn7881299347898368[shape=rectangle, label=\"B23\"];\nn5066549580791808[shape=rectangle, label=\"B24\"];\nn8444249301319680[shape=rectangle, label=\"B25\"];\nn8162774324609024[shape=rectangle, label=\"B26\"];\nn9007199254740992[shape=rectangle, label=\"B27\"];\nn9570149208162304[shape=rectangle, label=\"B28\"];\nn9288674231451648[shape=rectangle, label=\"B29\"];\nn8725724278030336[shape=rectangle, label=\"B30\"];\nn4503599627370496[shape=rectangle, label=\"B31\"];\nn10133099161583616[shape=rectangle, label=\"B32\"];\nn2814749767106560[shape=rectangle, label=\"B33\"];\nn10696049115004928[shape=rectangle, label=\"B34\"];\nn10414574138294272[shape=rectangle, label=\"B35\"];\nn11540474045136896[shape=rectangle, label=\"B36\"];\nn12103423998558208[shape=rectangle, label=\"B37\"];\nn11821949021847552[shape=rectangle, label=\"B38\"];\nn12666373951979520[shape=rectangle, label=\"B39\"];\nn13229323905400832[shape=rectangle, label=\"B40\"];\nn12947848928690176[shape=rectangle, label=\"B41\"];\nn13510798882111488[shape=rectangle, label=\"B42\"];\nn14073748835532800[shape=rectangle, label=\"B43\"];\nn13792273858822144[shape=rectangle, label=\"B44\"];\nn14355223812243456[shape=rectangle, label=\"B45\"];\nn14918173765664768[shape=rectangle, label=\"B46\"];\nn14636698788954112[shape=rectangle, label=\"B47\"];\nn12384898975268864[shape=rectangle, label=\"B48\"];\nn15762598695796736[shape=rectangle, label=\"B49\"];\nn15481123719086080[shape=rectangle, label=\"B50\"];\nn16044073672507392[shape=rectangle, label=\"B51\"];\nn16888498602639360[shape=rectangle, label=\"B52\"];\nn16607023625928704[shape=rectangle, label=\"B53\"];\nn16325548649218048[shape=rectangle, label=\"B54\"];\nn15199648742375424[shape=rectangle, label=\"B55\"];\nn11258999068426240[shape=rectangle, label=\"B56\"];\nn23643898043695104[shape=rectangle, label=\"B57\"];\nn17451448556060672[shape=rectangle, label=\"B58\"];\nn18014398509481984[shape=rectangle, label=\"B59\"];\nn18295873486192640[shape=rectangle, label=\"B60\"];\nn18577348462903296[shape=rectangle, label=\"B61\"];\nn17732923532771328[shape=rectangle, label=\"B62\"];\nn18858823439613952[shape=rectangle, label=\"B63\"];\nn19140298416324608[shape=rectangle, label=\"B64\"];\nn19421773393035264[shape=rectangle, label=\"B65\"];\nn19703248369745920[shape=rectangle, label=\"B66\"];\nn20266198323167232[shape=rectangle, label=\"B67\"];\nn20547673299877888[shape=rectangle, label=\"B68\"];\nn21110623253299200[shape=rectangle, label=\"B69\"];\nn21392098230009856[shape=rectangle, label=\"B70\"];\nn20829148276588544[shape=rectangle, label=\"B71\"];\nn21955048183431168[shape=rectangle, label=\"B72\"];\nn21673573206720512[shape=rectangle, label=\"B73\"];\nn19984723346456576[shape=rectangle, label=\"B74\"];\nn17169973579350016[shape=rectangle, label=\"B75\"];\nn22517998136852480[shape=rectangle, label=\"B76\"];\nn69242844270821376[shape=rectangle, label=\"B77\"];\nn23080948090273792[shape=rectangle, label=\"B78\"];\nn10977524091715584[shape=rectangle, label=\"B79\"];\nn22799473113563136[shape=rectangle, label=\"B80\"];\nn23362423066984448[shape=rectangle, label=\"B81\"];\nn24206847997116416[shape=rectangle, label=\"B82\"];\nn23925373020405760[shape=rectangle, label=\"B83\"];\nn24769797950537728[shape=rectangle, label=\"B84\"];\nn24488322973827072[shape=rectangle, label=\"B85\"];\nn25332747903959040[shape=rectangle, label=\"B86\"];\nn25614222880669696[shape=rectangle, label=\"B87\"];\nn25895697857380352[shape=rectangle, label=\"B88\"];\nn26458647810801664[shape=rectangle, label=\"B89\"];\nn26177172834091008[shape=rectangle, label=\"B90\"];\nn25051272927248384[shape=rectangle, label=\"B91\"];\nn27021597764222976[shape=rectangle, label=\"B92\"];\nn26740122787512320[shape=rectangle, label=\"B93\"];\nn27584547717644288[shape=rectangle, label=\"B94\"];\nn28147497671065600[shape=rectangle, label=\"B95\"];\nn27866022694354944[shape=rectangle, label=\"B96\"];\nn28710447624486912[shape=rectangle, label=\"B97\"];\nn28991922601197568[shape=rectangle, label=\"B98\"];\nn29554872554618880[shape=rectangle, label=\"B99\"];\nn29836347531329536[shape=rectangle, label=\"B100\"];\nn29273397577908224[shape=rectangle, label=\"B101\"];\nn30117822508040192[shape=rectangle, label=\"B102\"];\nn30680772461461504[shape=rectangle, label=\"B103\"];\nn31525197391593472[shape=rectangle, label=\"B104\"];\nn31243722414882816[shape=rectangle, label=\"B105\"];\nn31806672368304128[shape=rectangle, label=\"B106\"];\nn30962247438172160[shape=rectangle, label=\"B107\"];\nn30399297484750848[shape=rectangle, label=\"B108\"];\nn32369622321725440[shape=rectangle, label=\"B109\"];\nn28428972647776256[shape=rectangle, label=\"B110\"];\nn32088147345014784[shape=rectangle, label=\"B111\"];\nn32932572275146752[shape=rectangle, label=\"B112\"];\nn32651097298436096[shape=rectangle, label=\"B113\"];\nn33495522228568064[shape=rectangle, label=\"B114\"];\nn33214047251857408[shape=rectangle, label=\"B115\"];\nn34058472181989376[shape=rectangle, label=\"B116\"];\nn34621422135410688[shape=rectangle, label=\"B117\"];\nn34339947158700032[shape=rectangle, label=\"B118\"];\nn35184372088832000[shape=rectangle, label=\"B119\"];\nn35747322042253312[shape=rectangle, label=\"B120\"];\nn36310271995674624[shape=rectangle, label=\"B121\"];\nn36873221949095936[shape=rectangle, label=\"B122\"];\nn36028797018963968[shape=rectangle, label=\"B123\"];\nn35465847065542656[shape=rectangle, label=\"B124\"];\nn37436171902517248[shape=rectangle, label=\"B125\"];\nn37154696925806592[shape=rectangle, label=\"B126\"];\nn37717646879227904[shape=rectangle, label=\"B127\"];\nn37999121855938560[shape=rectangle, label=\"B128\"];\nn38562071809359872[shape=rectangle, label=\"B129\"];\nn38280596832649216[shape=rectangle, label=\"B130\"];\nn34902897112121344[shape=rectangle, label=\"B131\"];\nn39125021762781184[shape=rectangle, label=\"B132\"];\nn38843546786070528[shape=rectangle, label=\"B133\"];\nn39406496739491840[shape=rectangle, label=\"B134\"];\nn36591746972385280[shape=rectangle, label=\"B135\"];\nn39969446692913152[shape=rectangle, label=\"B136\"];\nn39687971716202496[shape=rectangle, label=\"B137\"];\nn40250921669623808[shape=rectangle, label=\"B138\"];\nn33776997205278720[shape=rectangle, label=\"B139\"];\nn40813871623045120[shape=rectangle, label=\"B140\"];\nn40532396646334464[shape=rectangle, label=\"B141\"];\nn41376821576466432[shape=rectangle, label=\"B142\"];\nn49539595901075456[shape=rectangle, label=\"B143\"];\nn41939771529887744[shape=rectangle, label=\"B144\"];\nn41658296553177088[shape=rectangle, label=\"B145\"];\nn42502721483309056[shape=rectangle, label=\"B146\"];\nn43065671436730368[shape=rectangle, label=\"B147\"];\nn43628621390151680[shape=rectangle, label=\"B148\"];\nn44191571343572992[shape=rectangle, label=\"B149\"];\nn43347146413441024[shape=rectangle, label=\"B150\"];\nn42784196460019712[shape=rectangle, label=\"B151\"];\nn44754521296994304[shape=rectangle, label=\"B152\"];\nn44473046320283648[shape=rectangle, label=\"B153\"];\nn45317471250415616[shape=rectangle, label=\"B154\"];\nn45035996273704960[shape=rectangle, label=\"B155\"];\nn45880421203836928[shape=rectangle, label=\"B156\"];\nn45598946227126272[shape=rectangle, label=\"B157\"];\nn46161896180547584[shape=rectangle, label=\"B158\"];\nn46724846133968896[shape=rectangle, label=\"B159\"];\nn46443371157258240[shape=rectangle, label=\"B160\"];\nn42221246506598400[shape=rectangle, label=\"B161\"];\nn47287796087390208[shape=rectangle, label=\"B162\"];\nn47006321110679552[shape=rectangle, label=\"B163\"];\nn47850746040811520[shape=rectangle, label=\"B164\"];\nn47569271064100864[shape=rectangle, label=\"B165\"];\nn48413695994232832[shape=rectangle, label=\"B166\"];\nn48132221017522176[shape=rectangle, label=\"B167\"];\nn48695170970943488[shape=rectangle, label=\"B168\"];\nn43910096366862336[shape=rectangle, label=\"B169\"];\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn48976645947654144[shape=rectangle, label=\"B171\"];\nn49821070877786112[shape=rectangle, label=\"B172\"];\nn41095346599755776[shape=rectangle, label=\"B173\"];\nn50384020831207424[shape=rectangle, label=\"B174\"];\nn50102545854496768[shape=rectangle, label=\"B175\"];\nn50946970784628736[shape=rectangle, label=\"B176\"];\nn51228445761339392[shape=rectangle, label=\"B177\"];\nn51791395714760704[shape=rectangle, label=\"B178\"];\nn51509920738050048[shape=rectangle, label=\"B179\"];\nn52354345668182016[shape=rectangle, label=\"B180\"];\nn50665495807918080[shape=rectangle, label=\"B181\"];\nn52917295621603328[shape=rectangle, label=\"B182\"];\nn52635820644892672[shape=rectangle, label=\"B183\"];\nn53480245575024640[shape=rectangle, label=\"B184\"];\nn54043195528445952[shape=rectangle, label=\"B185\"];\nn54606145481867264[shape=rectangle, label=\"B186\"];\nn54324670505156608[shape=rectangle, label=\"B187\"];\nn54887620458577920[shape=rectangle, label=\"B188\"];\nn55450570411999232[shape=rectangle, label=\"B189\"];\nn55169095435288576[shape=rectangle, label=\"B190\"];\nn55732045388709888[shape=rectangle, label=\"B191\"];\nn56294995342131200[shape=rectangle, label=\"B192\"];\nn56013520365420544[shape=rectangle, label=\"B193\"];\nn56576470318841856[shape=rectangle, label=\"B194\"];\nn52072870691471360[shape=rectangle, label=\"B195\"];\nn53198770598313984[shape=rectangle, label=\"B196\"];\nn56857945295552512[shape=rectangle, label=\"B197\"];\nn62205969853054976[shape=rectangle, label=\"B198\"];\nn57420895248973824[shape=rectangle, label=\"B199\"];\nn57139420272263168[shape=rectangle, label=\"B200\"];\nn57983845202395136[shape=rectangle, label=\"B201\"];\nn58546795155816448[shape=rectangle, label=\"B202\"];\nn59109745109237760[shape=rectangle, label=\"B203\"];\nn58828270132527104[shape=rectangle, label=\"B204\"];\nn59672695062659072[shape=rectangle, label=\"B205\"];\nn59391220085948416[shape=rectangle, label=\"B206\"];\nn60235645016080384[shape=rectangle, label=\"B207\"];\nn60798594969501696[shape=rectangle, label=\"B208\"];\nn60517119992791040[shape=rectangle, label=\"B209\"];\nn61080069946212352[shape=rectangle, label=\"B210\"];\nn61361544922923008[shape=rectangle, label=\"B211\"];\nn61924494876344320[shape=rectangle, label=\"B212\"];\nn61643019899633664[shape=rectangle, label=\"B213\"];\nn58265320179105792[shape=rectangle, label=\"B214\"];\nn59954170039369728[shape=rectangle, label=\"B215\"];\nn57702370225684480[shape=rectangle, label=\"B216\"];\nn62487444829765632[shape=rectangle, label=\"B217\"];\nn27303072740933632[shape=rectangle, label=\"B218\"];\nn63331869759897600[shape=rectangle, label=\"B219\"];\nn68116944363978752[shape=rectangle, label=\"B220\"];\nn63894819713318912[shape=rectangle, label=\"B221\"];\nn64457769666740224[shape=rectangle, label=\"B222\"];\nn64176294690029568[shape=rectangle, label=\"B223\"];\nn65020719620161536[shape=rectangle, label=\"B224\"];\nn65302194596872192[shape=rectangle, label=\"B225\"];\nn64739244643450880[shape=rectangle, label=\"B226\"];\nn66146619527004160[shape=rectangle, label=\"B227\"];\nn65865144550293504[shape=rectangle, label=\"B228\"];\nn65583669573582848[shape=rectangle, label=\"B229\"];\nn66709569480425472[shape=rectangle, label=\"B230\"];\nn66428094503714816[shape=rectangle, label=\"B231\"];\nn67272519433846784[shape=rectangle, label=\"B232\"];\nn66991044457136128[shape=rectangle, label=\"B233\"];\nn63613344736608256[shape=rectangle, label=\"B234\"];\nn67835469387268096[shape=rectangle, label=\"B235\"];\nn67553994410557440[shape=rectangle, label=\"B236\"];\nn68398419340689408[shape=rectangle, label=\"B237\"];\nn62768919806476288[shape=rectangle, label=\"B238\"];\nn53761720551735296[shape=rectangle, label=\"B239\"];\nn63050394783186944[shape=rectangle, label=\"B240\"];\nn68961369294110720[shape=rectangle, label=\"B241\"];\nn68679894317400064[shape=rectangle, label=\"B242\"];\nn22236523160141824[shape=rectangle, label=\"B243\"];\nn69805794224242688[shape=rectangle, label=\"B244\"];\nn70931694131085312[shape=rectangle, label=\"B245\"];\nn70368744177664000[shape=rectangle, label=\"B246\"];\nn70650219154374656[shape=rectangle, label=\"B247\"];\nn70087269200953344[shape=rectangle, label=\"B248\"];\nn71213169107795968[shape=rectangle, label=\"B249\"];\nn69524319247532032[shape=rectangle, label=\"B250\"];\nn71776119061217280[shape=rectangle, label=\"B251\"];\nn87538717757014016[shape=rectangle, label=\"B252\"];\nn72339069014638592[shape=rectangle, label=\"B253\"];\nn72057594037927936[shape=rectangle, label=\"B254\"];\nn72620543991349248[shape=rectangle, label=\"B255\"];\nn73183493944770560[shape=rectangle, label=\"B256\"];\nn73746443898191872[shape=rectangle, label=\"B257\"];\nn73464968921481216[shape=rectangle, label=\"B258\"];\nn74027918874902528[shape=rectangle, label=\"B259\"];\nn74872343805034496[shape=rectangle, label=\"B260\"];\nn74590868828323840[shape=rectangle, label=\"B261\"];\nn74309393851613184[shape=rectangle, label=\"B262\"];\nn72902018968059904[shape=rectangle, label=\"B263\"];\nn75435293758455808[shape=rectangle, label=\"B264\"];\nn75153818781745152[shape=rectangle, label=\"B265\"];\nn75998243711877120[shape=rectangle, label=\"B266\"];\nn76561193665298432[shape=rectangle, label=\"B267\"];\nn76279718688587776[shape=rectangle, label=\"B268\"];\nn77124143618719744[shape=rectangle, label=\"B269\"];\nn77687093572141056[shape=rectangle, label=\"B270\"];\nn77968568548851712[shape=rectangle, label=\"B271\"];\nn77405618595430400[shape=rectangle, label=\"B272\"];\nn76842668642009088[shape=rectangle, label=\"B273\"];\nn78250043525562368[shape=rectangle, label=\"B274\"];\nn78812993478983680[shape=rectangle, label=\"B275\"];\nn78531518502273024[shape=rectangle, label=\"B276\"];\nn79375943432404992[shape=rectangle, label=\"B277\"];\nn79938893385826304[shape=rectangle, label=\"B278\"];\nn80220368362536960[shape=rectangle, label=\"B279\"];\nn79657418409115648[shape=rectangle, label=\"B280\"];\nn75716768735166464[shape=rectangle, label=\"B281\"];\nn80501843339247616[shape=rectangle, label=\"B282\"];\nn81064793292668928[shape=rectangle, label=\"B283\"];\nn81346268269379584[shape=rectangle, label=\"B284\"];\nn80783318315958272[shape=rectangle, label=\"B285\"];\nn81627743246090240[shape=rectangle, label=\"B286\"];\nn82190693199511552[shape=rectangle, label=\"B287\"];\nn81909218222800896[shape=rectangle, label=\"B288\"];\nn82753643152932864[shape=rectangle, label=\"B289\"];\nn83035118129643520[shape=rectangle, label=\"B290\"];\nn83316593106354176[shape=rectangle, label=\"B291\"];\nn83879543059775488[shape=rectangle, label=\"B292\"];\nn83598068083064832[shape=rectangle, label=\"B293\"];\nn84442493013196800[shape=rectangle, label=\"B294\"];\nn85005442966618112[shape=rectangle, label=\"B295\"];\nn84723967989907456[shape=rectangle, label=\"B296\"];\nn85568392920039424[shape=rectangle, label=\"B297\"];\nn85286917943328768[shape=rectangle, label=\"B298\"];\nn82472168176222208[shape=rectangle, label=\"B299\"];\nn86131342873460736[shape=rectangle, label=\"B300\"];\nn85849867896750080[shape=rectangle, label=\"B301\"];\nn84161018036486144[shape=rectangle, label=\"B302\"];\nn86975767803592704[shape=rectangle, label=\"B303\"];\nn86694292826882048[shape=rectangle, label=\"B304\"];\nn87257242780303360[shape=rectangle, label=\"B305\"];\nn86412817850171392[shape=rectangle, label=\"B306\"];\nn79094468455694336[shape=rectangle, label=\"B307\"];\nn87820192733724672[shape=rectangle, label=\"B308\"];\nn71494644084506624[shape=rectangle, label=\"B309\"];\nn88383142687145984[shape=rectangle, label=\"B310\"];\nn88664617663856640[shape=rectangle, label=\"B311\"];\nn88101667710435328[shape=rectangle, label=\"B312\"];\nn89227567617277952[shape=rectangle, label=\"B313\"];\nn88946092640567296[shape=rectangle, label=\"B314\"];\nn89790517570699264[shape=rectangle, label=\"B315\"];\nn90353467524120576[shape=rectangle, label=\"B316\"];\nn94857067151491072[shape=rectangle, label=\"B317\"];\nn90916417477541888[shape=rectangle, label=\"B318\"];\nn90634942500831232[shape=rectangle, label=\"B319\"];\nn91479367430963200[shape=rectangle, label=\"B320\"];\nn92042317384384512[shape=rectangle, label=\"B321\"];\nn91760842407673856[shape=rectangle, label=\"B322\"];\nn91197892454252544[shape=rectangle, label=\"B323\"];\nn92886742314516480[shape=rectangle, label=\"B324\"];\nn92605267337805824[shape=rectangle, label=\"B325\"];\nn93449692267937792[shape=rectangle, label=\"B326\"];\nn93168217291227136[shape=rectangle, label=\"B327\"];\nn94012642221359104[shape=rectangle, label=\"B328\"];\nn93731167244648448[shape=rectangle, label=\"B329\"];\nn94575592174780416[shape=rectangle, label=\"B330\"];\nn94294117198069760[shape=rectangle, label=\"B331\"];\nn92323792361095168[shape=rectangle, label=\"B332\"];\nn95138542128201728[shape=rectangle, label=\"B333\"];\nn89509042593988608[shape=rectangle, label=\"B334\"];\nn95420017104912384[shape=rectangle, label=\"B335\"];\nn99642141755572224[shape=rectangle, label=\"B336\"];\nn95982967058333696[shape=rectangle, label=\"B337\"];\nn95701492081623040[shape=rectangle, label=\"B338\"];\nn96545917011755008[shape=rectangle, label=\"B339\"];\nn97108866965176320[shape=rectangle, label=\"B340\"];\nn97390341941886976[shape=rectangle, label=\"B341\"];\nn96827391988465664[shape=rectangle, label=\"B342\"];\nn96264442035044352[shape=rectangle, label=\"B343\"];\nn97953291895308288[shape=rectangle, label=\"B344\"];\nn97671816918597632[shape=rectangle, label=\"B345\"];\nn98516241848729600[shape=rectangle, label=\"B346\"];\nn99079191802150912[shape=rectangle, label=\"B347\"];\nn99360666778861568[shape=rectangle, label=\"B348\"];\nn98797716825440256[shape=rectangle, label=\"B349\"];\nn98234766872018944[shape=rectangle, label=\"B350\"];\nn90071992547409920[shape=rectangle, label=\"B351\"];\nn99923616732282880[shape=rectangle, label=\"B352\"];\nn1688849860263936[shape=rectangle, label=\"B353\"];\nn107804916080181248[shape=rectangle, label=\"B354\"];\nn100486566685704192[shape=rectangle, label=\"B355\"];\nn100205091708993536[shape=rectangle, label=\"B356\"];\nn102456891522678784[shape=rectangle, label=\"B357\"];\nn101049516639125504[shape=rectangle, label=\"B358\"];\nn100768041662414848[shape=rectangle, label=\"B359\"];\nn101612466592546816[shape=rectangle, label=\"B360\"];\nn102175416545968128[shape=rectangle, label=\"B361\"];\nn101893941569257472[shape=rectangle, label=\"B362\"];\nn102738366499389440[shape=rectangle, label=\"B363\"];\nn103019841476100096[shape=rectangle, label=\"B364\"];\nn103582791429521408[shape=rectangle, label=\"B365\"];\nn103301316452810752[shape=rectangle, label=\"B366\"];\nn101330991615836160[shape=rectangle, label=\"B367\"];\nn104145741382942720[shape=rectangle, label=\"B368\"];\nn103864266406232064[shape=rectangle, label=\"B369\"];\nn104708691336364032[shape=rectangle, label=\"B370\"];\nn104427216359653376[shape=rectangle, label=\"B371\"];\nn105271641289785344[shape=rectangle, label=\"B372\"];\nn104990166313074688[shape=rectangle, label=\"B373\"];\nn105834591243206656[shape=rectangle, label=\"B374\"];\nn105553116266496000[shape=rectangle, label=\"B375\"];\nn106397541196627968[shape=rectangle, label=\"B376\"];\nn106116066219917312[shape=rectangle, label=\"B377\"];\nn106960491150049280[shape=rectangle, label=\"B378\"];\nn106679016173338624[shape=rectangle, label=\"B379\"];\nn107523441103470592[shape=rectangle, label=\"B380\"];\nn107241966126759936[shape=rectangle, label=\"B381\"];\nn108086391056891904[shape=rectangle, label=\"B382\"];\nn108649341010313216[shape=rectangle, label=\"B383\"];\nn117375065288343552[shape=rectangle, label=\"B384\"];\nn116812115334922240[shape=rectangle, label=\"B385\"];\nn109212290963734528[shape=rectangle, label=\"B386\"];\nn109775240917155840[shape=rectangle, label=\"B387\"];\nn109493765940445184[shape=rectangle, label=\"B388\"];\nn110338190870577152[shape=rectangle, label=\"B389\"];\nn110056715893866496[shape=rectangle, label=\"B390\"];\nn110901140823998464[shape=rectangle, label=\"B391\"];\nn110619665847287808[shape=rectangle, label=\"B392\"];\nn111464090777419776[shape=rectangle, label=\"B393\"];\nn111182615800709120[shape=rectangle, label=\"B394\"];\nn111745565754130432[shape=rectangle, label=\"B395\"];\nn112308515707551744[shape=rectangle, label=\"B396\"];\nn112027040730841088[shape=rectangle, label=\"B397\"];\nn112871465660973056[shape=rectangle, label=\"B398\"];\nn112589990684262400[shape=rectangle, label=\"B399\"];\nn113434415614394368[shape=rectangle, label=\"B400\"];\nn113715890591105024[shape=rectangle, label=\"B401\"];\nn113997365567815680[shape=rectangle, label=\"B402\"];\nn114560315521236992[shape=rectangle, label=\"B403\"];\nn114278840544526336[shape=rectangle, label=\"B404\"];\nn113152940637683712[shape=rectangle, label=\"B405\"];\nn115123265474658304[shape=rectangle, label=\"B406\"];\nn114841790497947648[shape=rectangle, label=\"B407\"];\nn115686215428079616[shape=rectangle, label=\"B408\"];\nn116249165381500928[shape=rectangle, label=\"B409\"];\nn115404740451368960[shape=rectangle, label=\"B410\"];\nn161003686678495232[shape=rectangle, label=\"B411\"];\nn161566636631916544[shape=rectangle, label=\"B412\"];\nn117093590311632896[shape=rectangle, label=\"B413\"];\nn108367866033602560[shape=rectangle, label=\"B414\"];\nn117938015241764864[shape=rectangle, label=\"B415\"];\nn118500965195186176[shape=rectangle, label=\"B416\"];\nn117656540265054208[shape=rectangle, label=\"B417\"];\nn119063915148607488[shape=rectangle, label=\"B418\"];\nn163818436445601792[shape=rectangle, label=\"B419\"];\nn119626865102028800[shape=rectangle, label=\"B420\"];\nn115967690404790272[shape=rectangle, label=\"B421\"];\nn116530640358211584[shape=rectangle, label=\"B422\"];\nn120471290032160768[shape=rectangle, label=\"B423\"];\nn120752765008871424[shape=rectangle, label=\"B424\"];\nn121034239985582080[shape=rectangle, label=\"B425\"];\nn120189815055450112[shape=rectangle, label=\"B426\"];\nn121878664915714048[shape=rectangle, label=\"B427\"];\nn121315714962292736[shape=rectangle, label=\"B428\"];\nn121597189939003392[shape=rectangle, label=\"B429\"];\nn122441614869135360[shape=rectangle, label=\"B430\"];\nn122723089845846016[shape=rectangle, label=\"B431\"];\nn123004564822556672[shape=rectangle, label=\"B432\"];\nn122160139892424704[shape=rectangle, label=\"B433\"];\nn123848989752688640[shape=rectangle, label=\"B434\"];\nn123286039799267328[shape=rectangle, label=\"B435\"];\nn123567514775977984[shape=rectangle, label=\"B436\"];\nn124411939706109952[shape=rectangle, label=\"B437\"];\nn124130464729399296[shape=rectangle, label=\"B438\"];\nn124974889659531264[shape=rectangle, label=\"B439\"];\nn124693414682820608[shape=rectangle, label=\"B440\"];\nn125537839612952576[shape=rectangle, label=\"B441\"];\nn126100789566373888[shape=rectangle, label=\"B442\"];\nn125819314589663232[shape=rectangle, label=\"B443\"];\nn125256364636241920[shape=rectangle, label=\"B444\"];\nn126663739519795200[shape=rectangle, label=\"B445\"];\nn126382264543084544[shape=rectangle, label=\"B446\"];\nn127226689473216512[shape=rectangle, label=\"B447\"];\nn126945214496505856[shape=rectangle, label=\"B448\"];\nn127789639426637824[shape=rectangle, label=\"B449\"];\nn128352589380059136[shape=rectangle, label=\"B450\"];\nn127508164449927168[shape=rectangle, label=\"B451\"];\nn128915539333480448[shape=rectangle, label=\"B452\"];\nn128634064356769792[shape=rectangle, label=\"B453\"];\nn128071114403348480[shape=rectangle, label=\"B454\"];\nn129478489286901760[shape=rectangle, label=\"B455\"];\nn129759964263612416[shape=rectangle, label=\"B456\"];\nn129197014310191104[shape=rectangle, label=\"B457\"];\nn130322914217033728[shape=rectangle, label=\"B458\"];\nn130885864170455040[shape=rectangle, label=\"B459\"];\nn131167339147165696[shape=rectangle, label=\"B460\"];\nn130604389193744384[shape=rectangle, label=\"B461\"];\nn131448814123876352[shape=rectangle, label=\"B462\"];\nn130041439240323072[shape=rectangle, label=\"B463\"];\nn132011764077297664[shape=rectangle, label=\"B464\"];\nn131730289100587008[shape=rectangle, label=\"B465\"];\nn132574714030718976[shape=rectangle, label=\"B466\"];\nn132856189007429632[shape=rectangle, label=\"B467\"];\nn133419138960850944[shape=rectangle, label=\"B468\"];\nn133137663984140288[shape=rectangle, label=\"B469\"];\nn133700613937561600[shape=rectangle, label=\"B470\"];\nn134263563890982912[shape=rectangle, label=\"B471\"];\nn134545038867693568[shape=rectangle, label=\"B472\"];\nn133982088914272256[shape=rectangle, label=\"B473\"];\nn132293239054008320[shape=rectangle, label=\"B474\"];\nn134826513844404224[shape=rectangle, label=\"B475\"];\nn135389463797825536[shape=rectangle, label=\"B476\"];\nn135107988821114880[shape=rectangle, label=\"B477\"];\nn135952413751246848[shape=rectangle, label=\"B478\"];\nn136233888727957504[shape=rectangle, label=\"B479\"];\nn136796838681378816[shape=rectangle, label=\"B480\"];\nn136515363704668160[shape=rectangle, label=\"B481\"];\nn137078313658089472[shape=rectangle, label=\"B482\"];\nn137641263611510784[shape=rectangle, label=\"B483\"];\nn137922738588221440[shape=rectangle, label=\"B484\"];\nn137359788634800128[shape=rectangle, label=\"B485\"];\nn135670938774536192[shape=rectangle, label=\"B486\"];\nn138204213564932096[shape=rectangle, label=\"B487\"];\nn138767163518353408[shape=rectangle, label=\"B488\"];\nn139048638495064064[shape=rectangle, label=\"B489\"];\nn138485688541642752[shape=rectangle, label=\"B490\"];\nn139330113471774720[shape=rectangle, label=\"B491\"];\nn139893063425196032[shape=rectangle, label=\"B492\"];\nn140456013378617344[shape=rectangle, label=\"B493\"];\nn141018963332038656[shape=rectangle, label=\"B494\"];\nn140737488355328000[shape=rectangle, label=\"B495\"];\nn141300438308749312[shape=rectangle, label=\"B496\"];\nn139611588448485376[shape=rectangle, label=\"B497\"];\nn140174538401906688[shape=rectangle, label=\"B498\"];\nn141863388262170624[shape=rectangle, label=\"B499\"];\nn142426338215591936[shape=rectangle, label=\"B500\"];\nn142989288169013248[shape=rectangle, label=\"B501\"];\nn142707813192302592[shape=rectangle, label=\"B502\"];\nn142144863238881280[shape=rectangle, label=\"B503\"];\nn143552238122434560[shape=rectangle, label=\"B504\"];\nn143270763145723904[shape=rectangle, label=\"B505\"];\nn141581913285459968[shape=rectangle, label=\"B506\"];\nn144115188075855872[shape=rectangle, label=\"B507\"];\nn144396663052566528[shape=rectangle, label=\"B508\"];\nn144678138029277184[shape=rectangle, label=\"B509\"];\nn144959613005987840[shape=rectangle, label=\"B510\"];\nn145241087982698496[shape=rectangle, label=\"B511\"];\nn145522562959409152[shape=rectangle, label=\"B512\"];\nn146085512912830464[shape=rectangle, label=\"B513\"];\nn146366987889541120[shape=rectangle, label=\"B514\"];\nn146648462866251776[shape=rectangle, label=\"B515\"];\nn147211412819673088[shape=rectangle, label=\"B516\"];\nn146929937842962432[shape=rectangle, label=\"B517\"];\nn147774362773094400[shape=rectangle, label=\"B518\"];\nn147492887796383744[shape=rectangle, label=\"B519\"];\nn148337312726515712[shape=rectangle, label=\"B520\"];\nn148900262679937024[shape=rectangle, label=\"B521\"];\nn148618787703226368[shape=rectangle, label=\"B522\"];\nn148055837749805056[shape=rectangle, label=\"B523\"];\nn145804037936119808[shape=rectangle, label=\"B524\"];\nn149463212633358336[shape=rectangle, label=\"B525\"];\nn150026162586779648[shape=rectangle, label=\"B526\"];\nn150589112540200960[shape=rectangle, label=\"B527\"];\nn150307637563490304[shape=rectangle, label=\"B528\"];\nn150870587516911616[shape=rectangle, label=\"B529\"];\nn149181737656647680[shape=rectangle, label=\"B530\"];\nn149744687610068992[shape=rectangle, label=\"B531\"];\nn151433537470332928[shape=rectangle, label=\"B532\"];\nn151996487423754240[shape=rectangle, label=\"B533\"];\nn152559437377175552[shape=rectangle, label=\"B534\"];\nn152277962400464896[shape=rectangle, label=\"B535\"];\nn151715012447043584[shape=rectangle, label=\"B536\"];\nn153122387330596864[shape=rectangle, label=\"B537\"];\nn152840912353886208[shape=rectangle, label=\"B538\"];\nn151152062493622272[shape=rectangle, label=\"B539\"];\nn153403862307307520[shape=rectangle, label=\"B540\"];\nn153966812260728832[shape=rectangle, label=\"B541\"];\nn153685337284018176[shape=rectangle, label=\"B542\"];\nn154529762214150144[shape=rectangle, label=\"B543\"];\nn154248287237439488[shape=rectangle, label=\"B544\"];\nn155092712167571456[shape=rectangle, label=\"B545\"];\nn154811237190860800[shape=rectangle, label=\"B546\"];\nn155655662120992768[shape=rectangle, label=\"B547\"];\nn155374187144282112[shape=rectangle, label=\"B548\"];\nn156218612074414080[shape=rectangle, label=\"B549\"];\nn156781562027835392[shape=rectangle, label=\"B550\"];\nn156500087051124736[shape=rectangle, label=\"B551\"];\nn155937137097703424[shape=rectangle, label=\"B552\"];\nn143833713099145216[shape=rectangle, label=\"B553\"];\nn157344511981256704[shape=rectangle, label=\"B554\"];\nn157625986957967360[shape=rectangle, label=\"B555\"];\nn157907461934678016[shape=rectangle, label=\"B556\"];\nn158470411888099328[shape=rectangle, label=\"B557\"];\nn158751886864809984[shape=rectangle, label=\"B558\"];\nn159033361841520640[shape=rectangle, label=\"B559\"];\nn159314836818231296[shape=rectangle, label=\"B560\"];\nn159596311794941952[shape=rectangle, label=\"B561\"];\nn159877786771652608[shape=rectangle, label=\"B562\"];\nn158188936911388672[shape=rectangle, label=\"B563\"];\nn160440736725073920[shape=rectangle, label=\"B564\"];\nn160722211701784576[shape=rectangle, label=\"B565\"];\nn160159261748363264[shape=rectangle, label=\"B566\"];\nn157063037004546048[shape=rectangle, label=\"B567\"];\nn161285161655205888[shape=rectangle, label=\"B568\"];\nn108930815987023872[shape=rectangle, label=\"B569\"];\nn119345390125318144[shape=rectangle, label=\"B570\"];\nn161848111608627200[shape=rectangle, label=\"B571\"];\nn162411061562048512[shape=rectangle, label=\"B572\"];\nn162129586585337856[shape=rectangle, label=\"B573\"];\nn162692536538759168[shape=rectangle, label=\"B574\"];\nn163536961468891136[shape=rectangle, label=\"B575\"];\nn163255486492180480[shape=rectangle, label=\"B576\"];\nn119908340078739456[shape=rectangle, label=\"B577\"];\nn118782440171896832[shape=rectangle, label=\"B578\"];\nn164381386399023104[shape=rectangle, label=\"B579\"];\nn169447935979814912[shape=rectangle, label=\"B580\"];\nn164944336352444416[shape=rectangle, label=\"B581\"];\nn165507286305865728[shape=rectangle, label=\"B582\"];\nn165788761282576384[shape=rectangle, label=\"B583\"];\nn166070236259287040[shape=rectangle, label=\"B584\"];\nn164662861375733760[shape=rectangle, label=\"B585\"];\nn165225811329155072[shape=rectangle, label=\"B586\"];\nn166633186212708352[shape=rectangle, label=\"B587\"];\nn167196136166129664[shape=rectangle, label=\"B588\"];\nn166914661189419008[shape=rectangle, label=\"B589\"];\nn167759086119550976[shape=rectangle, label=\"B590\"];\nn167477611142840320[shape=rectangle, label=\"B591\"];\nn168040561096261632[shape=rectangle, label=\"B592\"];\nn168603511049682944[shape=rectangle, label=\"B593\"];\nn169166461003104256[shape=rectangle, label=\"B594\"];\nn168884986026393600[shape=rectangle, label=\"B595\"];\nn168322036072972288[shape=rectangle, label=\"B596\"];\nn166351711235997696[shape=rectangle, label=\"B597\"];\nn169729410956525568[shape=rectangle, label=\"B598\"];\nn164099911422312448[shape=rectangle, label=\"B599\"];\nn173951535607185408[shape=rectangle, label=\"B600\"];\nn170292360909946880[shape=rectangle, label=\"B601\"];\nn170573835886657536[shape=rectangle, label=\"B602\"];\nn171136785840078848[shape=rectangle, label=\"B603\"];\nn170855310863368192[shape=rectangle, label=\"B604\"];\nn171699735793500160[shape=rectangle, label=\"B605\"];\nn171418260816789504[shape=rectangle, label=\"B606\"];\nn172262685746921472[shape=rectangle, label=\"B607\"];\nn171981210770210816[shape=rectangle, label=\"B608\"];\nn172825635700342784[shape=rectangle, label=\"B609\"];\nn172544160723632128[shape=rectangle, label=\"B610\"];\nn173388585653764096[shape=rectangle, label=\"B611\"];\nn173107110677053440[shape=rectangle, label=\"B612\"];\nn173670060630474752[shape=rectangle, label=\"B613\"];\nn170010885933236224[shape=rectangle, label=\"B614\"];\nn174514485560606720[shape=rectangle, label=\"B615\"];\nn178173660257845248[shape=rectangle, label=\"B616\"];\nn175077435514028032[shape=rectangle, label=\"B617\"];\nn174795960537317376[shape=rectangle, label=\"B618\"];\nn175640385467449344[shape=rectangle, label=\"B619\"];\nn175358910490738688[shape=rectangle, label=\"B620\"];\nn176203335420870656[shape=rectangle, label=\"B621\"];\nn176484810397581312[shape=rectangle, label=\"B622\"];\nn177047760351002624[shape=rectangle, label=\"B623\"];\nn176766285374291968[shape=rectangle, label=\"B624\"];\nn175921860444160000[shape=rectangle, label=\"B625\"];\nn177329235327713280[shape=rectangle, label=\"B626\"];\nn177892185281134592[shape=rectangle, label=\"B627\"];\nn177610710304423936[shape=rectangle, label=\"B628\"];\nn178455135234555904[shape=rectangle, label=\"B629\"];\nn174233010583896064[shape=rectangle, label=\"B630\"];\nn178736610211266560[shape=rectangle, label=\"B631\"];\nn179299560164687872[shape=rectangle, label=\"B632\"];\nn179862510118109184[shape=rectangle, label=\"B633\"];\nn179581035141398528[shape=rectangle, label=\"B634\"];\nn179018085187977216[shape=rectangle, label=\"B635\"];\nn1407374883553280[shape=rectangle, label=\"B636\"];\nn281474976710656[shape=rectangle, label=\"B637\"];\nn118219490218475520[shape=rectangle, label=\"B638\"];\nn162974011515469824[shape=rectangle, label=\"B639\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n844424930131968;\nn562949953421312 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn844424930131968 -> n1688849860263936;\nn844424930131968 -> n1970324836974592;\nn1970324836974592 -> n2251799813685248;\nn2533274790395904 -> n2251799813685248;\nn2251799813685248 -> n2814749767106560;\nn2251799813685248 -> n3096224743817216;\nn3096224743817216 -> n9851624184872960;\nn9851624184872960 -> n3377699720527872;\nn9851624184872960 -> n3659174697238528;\nn3659174697238528 -> n3940649673949184;\nn3659174697238528 -> n4222124650659840;\nn4222124650659840 -> n3940649673949184;\nn3940649673949184 -> n4503599627370496;\nn3940649673949184 -> n4785074604081152;\nn4785074604081152 -> n4503599627370496;\nn3377699720527872 -> n5066549580791808;\nn3377699720527872 -> n5348024557502464;\nn5348024557502464 -> n5629499534213120;\nn5348024557502464 -> n5910974510923776;\nn5910974510923776 -> n5629499534213120;\nn5629499534213120 -> n6192449487634432;\nn5629499534213120 -> n6473924464345088;\nn6473924464345088 -> n6755399441055744;\nn6755399441055744 -> n6755399441055744[style=dashed];\nn6755399441055744 -> n6192449487634432;\nn6192449487634432 -> n7036874417766400;\nn6192449487634432 -> n7318349394477056;\nn7318349394477056 -> n7599824371187712;\nn7599824371187712 -> n7599824371187712[style=dashed];\nn7599824371187712 -> n7036874417766400;\nn7036874417766400 -> n5348024557502464;\nn7036874417766400 -> n7881299347898368;\nn7881299347898368 -> n5066549580791808;\nn5066549580791808 -> n8162774324609024;\nn5066549580791808 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n8725724278030336;\nn8162774324609024 -> n9007199254740992;\nn9007199254740992 -> n9288674231451648;\nn9007199254740992 -> n9570149208162304;\nn9570149208162304 -> n9570149208162304[style=dashed];\nn9570149208162304 -> n9288674231451648;\nn9288674231451648 -> n8725724278030336;\nn8725724278030336 -> n4503599627370496;\nn4503599627370496 -> n9851624184872960;\nn4503599627370496 -> n10133099161583616;\nn10133099161583616 -> n2814749767106560;\nn2814749767106560 -> n10414574138294272;\nn2814749767106560 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10696049115004928 -> n10414574138294272;\nn10414574138294272 -> n11258999068426240;\nn10414574138294272 -> n11540474045136896;\nn11540474045136896 -> n11821949021847552;\nn11540474045136896 -> n12103423998558208;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn11821949021847552 -> n12666373951979520;\nn12666373951979520 -> n12947848928690176;\nn12666373951979520 -> n13229323905400832;\nn13229323905400832 -> n12947848928690176;\nn12947848928690176 -> n12384898975268864;\nn12947848928690176 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n13792273858822144;\nn13792273858822144 -> n12384898975268864;\nn13792273858822144 -> n14355223812243456;\nn14355223812243456 -> n14636698788954112;\nn14355223812243456 -> n14918173765664768;\nn14918173765664768 -> n14636698788954112;\nn14636698788954112 -> n15199648742375424;\nn14636698788954112 -> n12384898975268864;\nn12384898975268864 -> n15481123719086080;\nn12384898975268864 -> n15762598695796736;\nn15762598695796736 -> n15481123719086080;\nn15481123719086080 -> n15199648742375424;\nn15481123719086080 -> n16044073672507392;\nn16044073672507392 -> n16888498602639360;\nn16888498602639360 -> n16325548649218048;\nn16888498602639360 -> n16607023625928704;\nn16607023625928704 -> n16325548649218048;\nn16325548649218048 -> n16888498602639360;\nn16325548649218048 -> n15199648742375424;\nn15199648742375424 -> n11540474045136896;\nn15199648742375424 -> n11258999068426240;\nn11258999068426240 -> n23643898043695104;\nn23643898043695104 -> n17169973579350016;\nn23643898043695104 -> n17451448556060672;\nn17451448556060672 -> n17732923532771328;\nn17451448556060672 -> n18014398509481984;\nn18014398509481984 -> n17732923532771328;\nn18014398509481984 -> n18295873486192640;\nn18295873486192640 -> n17732923532771328;\nn18295873486192640 -> n18577348462903296;\nn18577348462903296 -> n17732923532771328;\nn17732923532771328 -> n17169973579350016;\nn17732923532771328 -> n18858823439613952;\nn18858823439613952 -> n17169973579350016;\nn18858823439613952 -> n19140298416324608;\nn19140298416324608 -> n17169973579350016;\nn19140298416324608 -> n19421773393035264;\nn19421773393035264 -> n17169973579350016;\nn19421773393035264 -> n19703248369745920;\nn19703248369745920 -> n19984723346456576;\nn19703248369745920 -> n20266198323167232;\nn20266198323167232 -> n19984723346456576;\nn20266198323167232 -> n20547673299877888;\nn20547673299877888 -> n20829148276588544;\nn20547673299877888 -> n21110623253299200;\nn21110623253299200 -> n21392098230009856;\nn21392098230009856 -> n21392098230009856[style=dashed];\nn21392098230009856 -> n20829148276588544;\nn20829148276588544 -> n21673573206720512;\nn20829148276588544 -> n21955048183431168;\nn21955048183431168 -> n21955048183431168[style=dashed];\nn21955048183431168 -> n21673573206720512;\nn21673573206720512 -> n20266198323167232;\nn21673573206720512 -> n19984723346456576;\nn19984723346456576 -> n17169973579350016;\nn17169973579350016 -> n22236523160141824;\nn17169973579350016 -> n22517998136852480;\nn22517998136852480 -> n69242844270821376;\nn69242844270821376 -> n22799473113563136;\nn69242844270821376 -> n23080948090273792;\nn23080948090273792 -> n23362423066984448;\nn10977524091715584 -> n23643898043695104;\nn22799473113563136 -> n23362423066984448;\nn23362423066984448 -> n23925373020405760;\nn23362423066984448 -> n24206847997116416;\nn24206847997116416 -> n23925373020405760;\nn23925373020405760 -> n24488322973827072;\nn23925373020405760 -> n24769797950537728;\nn24769797950537728 -> n24488322973827072;\nn24488322973827072 -> n25051272927248384;\nn24488322973827072 -> n25332747903959040;\nn25332747903959040 -> n25051272927248384;\nn25332747903959040 -> n25614222880669696;\nn25614222880669696 -> n25051272927248384;\nn25614222880669696 -> n25895697857380352;\nn25895697857380352 -> n26177172834091008;\nn25895697857380352 -> n26458647810801664;\nn26458647810801664 -> n26177172834091008;\nn26177172834091008 -> n25051272927248384;\nn25051272927248384 -> n26740122787512320;\nn25051272927248384 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn26740122787512320 -> n27303072740933632;\nn26740122787512320 -> n27584547717644288;\nn27584547717644288 -> n27866022694354944;\nn27584547717644288 -> n28147497671065600;\nn28147497671065600 -> n27866022694354944;\nn27866022694354944 -> n28428972647776256;\nn27866022694354944 -> n28710447624486912;\nn28710447624486912 -> n28428972647776256;\nn28710447624486912 -> n28991922601197568;\nn28991922601197568 -> n29273397577908224;\nn28991922601197568 -> n29554872554618880;\nn29554872554618880 -> n29273397577908224;\nn29554872554618880 -> n29836347531329536;\nn29836347531329536 -> n28428972647776256;\nn29836347531329536 -> n29273397577908224;\nn29273397577908224 -> n28428972647776256;\nn29273397577908224 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n31525197391593472;\nn31525197391593472 -> n30962247438172160;\nn31525197391593472 -> n31243722414882816;\nn31243722414882816 -> n31525197391593472;\nn31243722414882816 -> n31806672368304128;\nn31806672368304128 -> n30399297484750848;\nn30962247438172160 -> n28428972647776256;\nn30962247438172160 -> n30399297484750848;\nn30399297484750848 -> n32088147345014784;\nn30399297484750848 -> n32369622321725440;\nn32369622321725440 -> n32088147345014784;\nn28428972647776256 -> n32088147345014784;\nn32088147345014784 -> n32651097298436096;\nn32088147345014784 -> n32932572275146752;\nn32932572275146752 -> n32651097298436096;\nn32651097298436096 -> n33214047251857408;\nn32651097298436096 -> n33495522228568064;\nn33495522228568064 -> n33214047251857408;\nn33214047251857408 -> n33776997205278720;\nn33214047251857408 -> n34058472181989376;\nn34058472181989376 -> n34339947158700032;\nn34058472181989376 -> n34621422135410688;\nn34621422135410688 -> n34339947158700032;\nn34339947158700032 -> n34902897112121344;\nn34339947158700032 -> n35184372088832000;\nn35184372088832000 -> n35465847065542656;\nn35184372088832000 -> n35747322042253312;\nn35747322042253312 -> n36028797018963968;\nn35747322042253312 -> n36310271995674624;\nn36310271995674624 -> n36591746972385280;\nn36310271995674624 -> n36873221949095936;\nn36873221949095936 -> n36591746972385280;\nn36028797018963968 -> n36591746972385280;\nn35465847065542656 -> n37154696925806592;\nn35465847065542656 -> n37436171902517248;\nn37436171902517248 -> n37154696925806592;\nn37154696925806592 -> n36591746972385280;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n36591746972385280;\nn37717646879227904 -> n37999121855938560;\nn37999121855938560 -> n38280596832649216;\nn37999121855938560 -> n38562071809359872;\nn38562071809359872 -> n38280596832649216;\nn38280596832649216 -> n36591746972385280;\nn34902897112121344 -> n38843546786070528;\nn34902897112121344 -> n39125021762781184;\nn39125021762781184 -> n38843546786070528;\nn38843546786070528 -> n36591746972385280;\nn38843546786070528 -> n39406496739491840;\nn39406496739491840 -> n36591746972385280;\nn36591746972385280 -> n39687971716202496;\nn36591746972385280 -> n39969446692913152;\nn39969446692913152 -> n39687971716202496;\nn39687971716202496 -> n34058472181989376;\nn39687971716202496 -> n40250921669623808;\nn40250921669623808 -> n33776997205278720;\nn33776997205278720 -> n40532396646334464;\nn33776997205278720 -> n40813871623045120;\nn40813871623045120 -> n40532396646334464;\nn40532396646334464 -> n41095346599755776;\nn40532396646334464 -> n41376821576466432;\nn41376821576466432 -> n49539595901075456;\nn49539595901075456 -> n41658296553177088;\nn49539595901075456 -> n41939771529887744;\nn41939771529887744 -> n41658296553177088;\nn41658296553177088 -> n42221246506598400;\nn41658296553177088 -> n42502721483309056;\nn42502721483309056 -> n42784196460019712;\nn42502721483309056 -> n43065671436730368;\nn43065671436730368 -> n43347146413441024;\nn43065671436730368 -> n43628621390151680;\nn43628621390151680 -> n43910096366862336;\nn43628621390151680 -> n44191571343572992;\nn44191571343572992 -> n43910096366862336;\nn43347146413441024 -> n43910096366862336;\nn42784196460019712 -> n44473046320283648;\nn42784196460019712 -> n44754521296994304;\nn44754521296994304 -> n44473046320283648;\nn44473046320283648 -> n45035996273704960;\nn44473046320283648 -> n45317471250415616;\nn45317471250415616 -> n45035996273704960;\nn45035996273704960 -> n45598946227126272;\nn45035996273704960 -> n45880421203836928;\nn45880421203836928 -> n45598946227126272;\nn45598946227126272 -> n43910096366862336;\nn45598946227126272 -> n46161896180547584;\nn46161896180547584 -> n46443371157258240;\nn46161896180547584 -> n46724846133968896;\nn46724846133968896 -> n46443371157258240;\nn46443371157258240 -> n43910096366862336;\nn42221246506598400 -> n47006321110679552;\nn42221246506598400 -> n47287796087390208;\nn47287796087390208 -> n47006321110679552;\nn47006321110679552 -> n47569271064100864;\nn47006321110679552 -> n47850746040811520;\nn47850746040811520 -> n47569271064100864;\nn47569271064100864 -> n48132221017522176;\nn47569271064100864 -> n48413695994232832;\nn48413695994232832 -> n48132221017522176;\nn48132221017522176 -> n43910096366862336;\nn48132221017522176 -> n48695170970943488;\nn48695170970943488 -> n43910096366862336;\nn43910096366862336 -> n48976645947654144;\nn43910096366862336 -> n49258120924364800;\nn49258120924364800 -> n48976645947654144;\nn48976645947654144 -> n49539595901075456;\nn48976645947654144 -> n49821070877786112;\nn49821070877786112 -> n41095346599755776;\nn41095346599755776 -> n50102545854496768;\nn41095346599755776 -> n50384020831207424;\nn50384020831207424 -> n50102545854496768;\nn50102545854496768 -> n50665495807918080;\nn50102545854496768 -> n50946970784628736;\nn50946970784628736 -> n50665495807918080;\nn50946970784628736 -> n51228445761339392;\nn51228445761339392 -> n51509920738050048;\nn51228445761339392 -> n51791395714760704;\nn51791395714760704 -> n51509920738050048;\nn51509920738050048 -> n52072870691471360;\nn51509920738050048 -> n52354345668182016;\nn52354345668182016 -> n52072870691471360;\nn52354345668182016 -> n50665495807918080;\nn50665495807918080 -> n52635820644892672;\nn50665495807918080 -> n52917295621603328;\nn52917295621603328 -> n52635820644892672;\nn52635820644892672 -> n53198770598313984;\nn52635820644892672 -> n53480245575024640;\nn53480245575024640 -> n53761720551735296;\nn53480245575024640 -> n54043195528445952;\nn54043195528445952 -> n54324670505156608;\nn54043195528445952 -> n54606145481867264;\nn54606145481867264 -> n54324670505156608;\nn54324670505156608 -> n53761720551735296;\nn54324670505156608 -> n54887620458577920;\nn54887620458577920 -> n55169095435288576;\nn54887620458577920 -> n55450570411999232;\nn55450570411999232 -> n55169095435288576;\nn55169095435288576 -> n53761720551735296;\nn55169095435288576 -> n55732045388709888;\nn55732045388709888 -> n56013520365420544;\nn55732045388709888 -> n56294995342131200;\nn56294995342131200 -> n56013520365420544;\nn56013520365420544 -> n53761720551735296;\nn56013520365420544 -> n56576470318841856;\nn56576470318841856 -> n53198770598313984;\nn52072870691471360 -> n53198770598313984;\nn53198770598313984 -> n53761720551735296;\nn53198770598313984 -> n56857945295552512;\nn56857945295552512 -> n62205969853054976;\nn62205969853054976 -> n57139420272263168;\nn62205969853054976 -> n57420895248973824;\nn57420895248973824 -> n57139420272263168;\nn57139420272263168 -> n57702370225684480;\nn57139420272263168 -> n57983845202395136;\nn57983845202395136 -> n58265320179105792;\nn57983845202395136 -> n58546795155816448;\nn58546795155816448 -> n58828270132527104;\nn58546795155816448 -> n59109745109237760;\nn59109745109237760 -> n58828270132527104;\nn58828270132527104 -> n59391220085948416;\nn58828270132527104 -> n59672695062659072;\nn59672695062659072 -> n59391220085948416;\nn59391220085948416 -> n59954170039369728;\nn59391220085948416 -> n60235645016080384;\nn60235645016080384 -> n60517119992791040;\nn60235645016080384 -> n60798594969501696;\nn60798594969501696 -> n60517119992791040;\nn60517119992791040 -> n59954170039369728;\nn60517119992791040 -> n61080069946212352;\nn61080069946212352 -> n58265320179105792;\nn61080069946212352 -> n61361544922923008;\nn61361544922923008 -> n61643019899633664;\nn61361544922923008 -> n61924494876344320;\nn61924494876344320 -> n61643019899633664;\nn61643019899633664 -> n59954170039369728;\nn61643019899633664 -> n58265320179105792;\nn58265320179105792 -> n59954170039369728;\nn59954170039369728 -> n57983845202395136;\nn59954170039369728 -> n57702370225684480;\nn57702370225684480 -> n62205969853054976;\nn57702370225684480 -> n62487444829765632;\nn62487444829765632 -> n62768919806476288;\nn27303072740933632 -> n63050394783186944;\nn27303072740933632 -> n63331869759897600;\nn63331869759897600 -> n68116944363978752;\nn68116944363978752 -> n63613344736608256;\nn68116944363978752 -> n63894819713318912;\nn63894819713318912 -> n64176294690029568;\nn63894819713318912 -> n64457769666740224;\nn64457769666740224 -> n64176294690029568;\nn64176294690029568 -> n64739244643450880;\nn64176294690029568 -> n65020719620161536;\nn65020719620161536 -> n64739244643450880;\nn65020719620161536 -> n65302194596872192;\nn65302194596872192 -> n65583669573582848;\nn64739244643450880 -> n65865144550293504;\nn64739244643450880 -> n66146619527004160;\nn66146619527004160 -> n65865144550293504;\nn65865144550293504 -> n65583669573582848;\nn65583669573582848 -> n66428094503714816;\nn65583669573582848 -> n66709569480425472;\nn66709569480425472 -> n66428094503714816;\nn66428094503714816 -> n66991044457136128;\nn66428094503714816 -> n67272519433846784;\nn67272519433846784 -> n66991044457136128;\nn66991044457136128 -> n63613344736608256;\nn63613344736608256 -> n67553994410557440;\nn63613344736608256 -> n67835469387268096;\nn67835469387268096 -> n67553994410557440;\nn67553994410557440 -> n68116944363978752;\nn67553994410557440 -> n68398419340689408;\nn68398419340689408 -> n62768919806476288;\nn62768919806476288 -> n53761720551735296;\nn53761720551735296 -> n63050394783186944;\nn63050394783186944 -> n68679894317400064;\nn63050394783186944 -> n68961369294110720;\nn68961369294110720 -> n68679894317400064;\nn68679894317400064 -> n69242844270821376;\nn68679894317400064 -> n22236523160141824;\nn22236523160141824 -> n69524319247532032;\nn22236523160141824 -> n69805794224242688;\nn69805794224242688 -> n70931694131085312;\nn70931694131085312 -> n70087269200953344;\nn70931694131085312 -> n70368744177664000;\nn70368744177664000 -> n70087269200953344;\nn70368744177664000 -> n70650219154374656;\nn70650219154374656 -> n70087269200953344;\nn70087269200953344 -> n70931694131085312;\nn70087269200953344 -> n71213169107795968;\nn71213169107795968 -> n69524319247532032;\nn69524319247532032 -> n71494644084506624;\nn69524319247532032 -> n71776119061217280;\nn71776119061217280 -> n87538717757014016;\nn87538717757014016 -> n72057594037927936;\nn87538717757014016 -> n72339069014638592;\nn72339069014638592 -> n72620543991349248;\nn72339069014638592 -> n72057594037927936;\nn72057594037927936 -> n72620543991349248;\nn72620543991349248 -> n72902018968059904;\nn72620543991349248 -> n73183493944770560;\nn73183493944770560 -> n73464968921481216;\nn73183493944770560 -> n73746443898191872;\nn73746443898191872 -> n73464968921481216;\nn73464968921481216 -> n72902018968059904;\nn73464968921481216 -> n74027918874902528;\nn74027918874902528 -> n74872343805034496;\nn74872343805034496 -> n74309393851613184;\nn74872343805034496 -> n74590868828323840;\nn74590868828323840 -> n74309393851613184;\nn74309393851613184 -> n74872343805034496;\nn74309393851613184 -> n72902018968059904;\nn72902018968059904 -> n75153818781745152;\nn72902018968059904 -> n75435293758455808;\nn75435293758455808 -> n75153818781745152;\nn75153818781745152 -> n75716768735166464;\nn75153818781745152 -> n75998243711877120;\nn75998243711877120 -> n76279718688587776;\nn75998243711877120 -> n76561193665298432;\nn76561193665298432 -> n76279718688587776;\nn76279718688587776 -> n76842668642009088;\nn76279718688587776 -> n77124143618719744;\nn77124143618719744 -> n77405618595430400;\nn77124143618719744 -> n77687093572141056;\nn77687093572141056 -> n77968568548851712;\nn77968568548851712 -> n77968568548851712[style=dashed];\nn77968568548851712 -> n77405618595430400;\nn77405618595430400 -> n78250043525562368;\nn76842668642009088 -> n78250043525562368;\nn78250043525562368 -> n78531518502273024;\nn78250043525562368 -> n78812993478983680;\nn78812993478983680 -> n78531518502273024;\nn78531518502273024 -> n79094468455694336;\nn78531518502273024 -> n79375943432404992;\nn79375943432404992 -> n79657418409115648;\nn79375943432404992 -> n79938893385826304;\nn79938893385826304 -> n80220368362536960;\nn80220368362536960 -> n80220368362536960[style=dashed];\nn80220368362536960 -> n79657418409115648;\nn79657418409115648 -> n79094468455694336;\nn75716768735166464 -> n79094468455694336;\nn75716768735166464 -> n80501843339247616;\nn80501843339247616 -> n80783318315958272;\nn80501843339247616 -> n81064793292668928;\nn81064793292668928 -> n80783318315958272;\nn81064793292668928 -> n81346268269379584;\nn81346268269379584 -> n80783318315958272;\nn80783318315958272 -> n79094468455694336;\nn80783318315958272 -> n81627743246090240;\nn81627743246090240 -> n81909218222800896;\nn81627743246090240 -> n82190693199511552;\nn82190693199511552 -> n81909218222800896;\nn81909218222800896 -> n82472168176222208;\nn81909218222800896 -> n82753643152932864;\nn82753643152932864 -> n82472168176222208;\nn82753643152932864 -> n83035118129643520;\nn83035118129643520 -> n82472168176222208;\nn83035118129643520 -> n83316593106354176;\nn83316593106354176 -> n83598068083064832;\nn83316593106354176 -> n83879543059775488;\nn83879543059775488 -> n83598068083064832;\nn83598068083064832 -> n84161018036486144;\nn83598068083064832 -> n84442493013196800;\nn84442493013196800 -> n84723967989907456;\nn84442493013196800 -> n85005442966618112;\nn85005442966618112 -> n84723967989907456;\nn84723967989907456 -> n85286917943328768;\nn84723967989907456 -> n85568392920039424;\nn85568392920039424 -> n85286917943328768;\nn85286917943328768 -> n84161018036486144;\nn85286917943328768 -> n82472168176222208;\nn82472168176222208 -> n85849867896750080;\nn82472168176222208 -> n86131342873460736;\nn86131342873460736 -> n85849867896750080;\nn85849867896750080 -> n86412817850171392;\nn85849867896750080 -> n84161018036486144;\nn84161018036486144 -> n86694292826882048;\nn84161018036486144 -> n86975767803592704;\nn86975767803592704 -> n86694292826882048;\nn86694292826882048 -> n81627743246090240;\nn86694292826882048 -> n87257242780303360;\nn87257242780303360 -> n79094468455694336;\nn86412817850171392 -> n79094468455694336;\nn79094468455694336 -> n87538717757014016;\nn79094468455694336 -> n87820192733724672;\nn87820192733724672 -> n71494644084506624;\nn71494644084506624 -> n88101667710435328;\nn71494644084506624 -> n88383142687145984;\nn88383142687145984 -> n88664617663856640;\nn88664617663856640 -> n88664617663856640[style=dashed];\nn88664617663856640 -> n88101667710435328;\nn88101667710435328 -> n88946092640567296;\nn88101667710435328 -> n89227567617277952;\nn89227567617277952 -> n88946092640567296;\nn88946092640567296 -> n89509042593988608;\nn88946092640567296 -> n89790517570699264;\nn89790517570699264 -> n90071992547409920;\nn89790517570699264 -> n90353467524120576;\nn90353467524120576 -> n94857067151491072;\nn94857067151491072 -> n90634942500831232;\nn94857067151491072 -> n90916417477541888;\nn90916417477541888 -> n90634942500831232;\nn90634942500831232 -> n91197892454252544;\nn90634942500831232 -> n91479367430963200;\nn91479367430963200 -> n91760842407673856;\nn91479367430963200 -> n92042317384384512;\nn92042317384384512 -> n91760842407673856;\nn91760842407673856 -> n92323792361095168;\nn91760842407673856 -> n91197892454252544;\nn91197892454252544 -> n92605267337805824;\nn91197892454252544 -> n92886742314516480;\nn92886742314516480 -> n92605267337805824;\nn92605267337805824 -> n93168217291227136;\nn92605267337805824 -> n93449692267937792;\nn93449692267937792 -> n93168217291227136;\nn93168217291227136 -> n93731167244648448;\nn93168217291227136 -> n94012642221359104;\nn94012642221359104 -> n93731167244648448;\nn93731167244648448 -> n94294117198069760;\nn93731167244648448 -> n94575592174780416;\nn94575592174780416 -> n94294117198069760;\nn94294117198069760 -> n92323792361095168;\nn92323792361095168 -> n94857067151491072;\nn92323792361095168 -> n95138542128201728;\nn95138542128201728 -> n90071992547409920;\nn89509042593988608 -> n90071992547409920;\nn89509042593988608 -> n95420017104912384;\nn95420017104912384 -> n99642141755572224;\nn99642141755572224 -> n95701492081623040;\nn99642141755572224 -> n95982967058333696;\nn95982967058333696 -> n95701492081623040;\nn95701492081623040 -> n96264442035044352;\nn95701492081623040 -> n96545917011755008;\nn96545917011755008 -> n96827391988465664;\nn96545917011755008 -> n97108866965176320;\nn97108866965176320 -> n97390341941886976;\nn97390341941886976 -> n97390341941886976[style=dashed];\nn97390341941886976 -> n96827391988465664;\nn96827391988465664 -> n96264442035044352;\nn96264442035044352 -> n97671816918597632;\nn96264442035044352 -> n97953291895308288;\nn97953291895308288 -> n97671816918597632;\nn97671816918597632 -> n98234766872018944;\nn97671816918597632 -> n98516241848729600;\nn98516241848729600 -> n98797716825440256;\nn98516241848729600 -> n99079191802150912;\nn99079191802150912 -> n99360666778861568;\nn99360666778861568 -> n99360666778861568[style=dashed];\nn99360666778861568 -> n98797716825440256;\nn98797716825440256 -> n98234766872018944;\nn98234766872018944 -> n99642141755572224;\nn98234766872018944 -> n90071992547409920;\nn90071992547409920 -> n2533274790395904[style=dashed];\nn90071992547409920 -> n99923616732282880;\nn99923616732282880 -> n1688849860263936;\nn1688849860263936 -> n107804916080181248;\nn107804916080181248 -> n100205091708993536;\nn107804916080181248 -> n100486566685704192;\nn100486566685704192 -> n100205091708993536;\nn100205091708993536 -> n102456891522678784;\nn102456891522678784 -> n100768041662414848;\nn102456891522678784 -> n101049516639125504;\nn101049516639125504 -> n100768041662414848;\nn100768041662414848 -> n101330991615836160;\nn100768041662414848 -> n101612466592546816;\nn101612466592546816 -> n101893941569257472;\nn101612466592546816 -> n102175416545968128;\nn102175416545968128 -> n101893941569257472;\nn101893941569257472 -> n102456891522678784;\nn101893941569257472 -> n102738366499389440;\nn102738366499389440 -> n102456891522678784;\nn102738366499389440 -> n103019841476100096;\nn103019841476100096 -> n103301316452810752;\nn103019841476100096 -> n103582791429521408;\nn103582791429521408 -> n103301316452810752;\nn103301316452810752 -> n102456891522678784;\nn101330991615836160 -> n103864266406232064;\nn101330991615836160 -> n104145741382942720;\nn104145741382942720 -> n103864266406232064;\nn103864266406232064 -> n104427216359653376;\nn103864266406232064 -> n104708691336364032;\nn104708691336364032 -> n104427216359653376;\nn104427216359653376 -> n104990166313074688;\nn104427216359653376 -> n105271641289785344;\nn105271641289785344 -> n104990166313074688;\nn104990166313074688 -> n105553116266496000;\nn104990166313074688 -> n105834591243206656;\nn105834591243206656 -> n105553116266496000;\nn105553116266496000 -> n106116066219917312;\nn105553116266496000 -> n106397541196627968;\nn106397541196627968 -> n106116066219917312;\nn106116066219917312 -> n106679016173338624;\nn106116066219917312 -> n106960491150049280;\nn106960491150049280 -> n106679016173338624;\nn106679016173338624 -> n107241966126759936;\nn106679016173338624 -> n107523441103470592;\nn107523441103470592 -> n107241966126759936;\nn107241966126759936 -> n107804916080181248;\nn107241966126759936 -> n108086391056891904;\nn108086391056891904 -> n108367866033602560;\nn108086391056891904 -> n108649341010313216;\nn108649341010313216 -> n117375065288343552;\nn117375065288343552 -> n116812115334922240;\nn116812115334922240 -> n108930815987023872;\nn116812115334922240 -> n109212290963734528;\nn109212290963734528 -> n109493765940445184;\nn109212290963734528 -> n109775240917155840;\nn109775240917155840 -> n109493765940445184;\nn109493765940445184 -> n110056715893866496;\nn109493765940445184 -> n110338190870577152;\nn110338190870577152 -> n110056715893866496;\nn110056715893866496 -> n110619665847287808;\nn110056715893866496 -> n110901140823998464;\nn110901140823998464 -> n110619665847287808;\nn110619665847287808 -> n111182615800709120;\nn110619665847287808 -> n111464090777419776;\nn111464090777419776 -> n111745565754130432;\nn111182615800709120 -> n111745565754130432;\nn111745565754130432 -> n112027040730841088;\nn111745565754130432 -> n112308515707551744;\nn112308515707551744 -> n112027040730841088;\nn112027040730841088 -> n112589990684262400;\nn112027040730841088 -> n112871465660973056;\nn112871465660973056 -> n112589990684262400;\nn112589990684262400 -> n113152940637683712;\nn112589990684262400 -> n113434415614394368;\nn113434415614394368 -> n113152940637683712;\nn113434415614394368 -> n113715890591105024;\nn113715890591105024 -> n113152940637683712;\nn113715890591105024 -> n113997365567815680;\nn113997365567815680 -> n114278840544526336;\nn113997365567815680 -> n114560315521236992;\nn114560315521236992 -> n114278840544526336;\nn114278840544526336 -> n113152940637683712;\nn113152940637683712 -> n114841790497947648;\nn113152940637683712 -> n115123265474658304;\nn115123265474658304 -> n114841790497947648;\nn114841790497947648 -> n115404740451368960;\nn114841790497947648 -> n115686215428079616;\nn115686215428079616 -> n115967690404790272;\nn115686215428079616 -> n116249165381500928;\nn116249165381500928 -> n116530640358211584;\nn116249165381500928 -> n115404740451368960;\nn115404740451368960 -> n161003686678495232;\nn161003686678495232 -> n161566636631916544;\nn161566636631916544 -> n116812115334922240;\nn161566636631916544 -> n117093590311632896;\nn117093590311632896 -> n117375065288343552;\nn117093590311632896 -> n108367866033602560;\nn108367866033602560 -> n117656540265054208;\nn108367866033602560 -> n117938015241764864;\nn117938015241764864 -> n118219490218475520;\nn117938015241764864 -> n118500965195186176;\nn118500965195186176 -> n117656540265054208;\nn117656540265054208 -> n118782440171896832;\nn117656540265054208 -> n119063915148607488;\nn119063915148607488 -> n163818436445601792;\nn163818436445601792 -> n119345390125318144;\nn163818436445601792 -> n119626865102028800;\nn119626865102028800 -> n119908340078739456;\nn115967690404790272 -> n116530640358211584;\nn116530640358211584 -> n120189815055450112;\nn116530640358211584 -> n120471290032160768;\nn120471290032160768 -> n120189815055450112;\nn120471290032160768 -> n120752765008871424;\nn120752765008871424 -> n120189815055450112;\nn120752765008871424 -> n121034239985582080;\nn121034239985582080 -> n121315714962292736;\nn121034239985582080 -> n120189815055450112;\nn120189815055450112 -> n121597189939003392;\nn120189815055450112 -> n121878664915714048;\nn121878664915714048 -> n121597189939003392;\nn121878664915714048 -> n121315714962292736;\nn121315714962292736 -> n121597189939003392;\nn121597189939003392 -> n122160139892424704;\nn121597189939003392 -> n122441614869135360;\nn122441614869135360 -> n122160139892424704;\nn122441614869135360 -> n122723089845846016;\nn122723089845846016 -> n122160139892424704;\nn122723089845846016 -> n123004564822556672;\nn123004564822556672 -> n123286039799267328;\nn123004564822556672 -> n122160139892424704;\nn122160139892424704 -> n123567514775977984;\nn122160139892424704 -> n123848989752688640;\nn123848989752688640 -> n123567514775977984;\nn123848989752688640 -> n123286039799267328;\nn123286039799267328 -> n123567514775977984;\nn123567514775977984 -> n124130464729399296;\nn123567514775977984 -> n124411939706109952;\nn124411939706109952 -> n124130464729399296;\nn124130464729399296 -> n124693414682820608;\nn124130464729399296 -> n124974889659531264;\nn124974889659531264 -> n124693414682820608;\nn124693414682820608 -> n125256364636241920;\nn124693414682820608 -> n125537839612952576;\nn125537839612952576 -> n125819314589663232;\nn125537839612952576 -> n126100789566373888;\nn126100789566373888 -> n125819314589663232;\nn125819314589663232 -> n125256364636241920;\nn125256364636241920 -> n126382264543084544;\nn125256364636241920 -> n126663739519795200;\nn126663739519795200 -> n126382264543084544;\nn126382264543084544 -> n126945214496505856;\nn126382264543084544 -> n127226689473216512;\nn127226689473216512 -> n126945214496505856;\nn126945214496505856 -> n127508164449927168;\nn126945214496505856 -> n127789639426637824;\nn127789639426637824 -> n128071114403348480;\nn127789639426637824 -> n128352589380059136;\nn128352589380059136 -> n128071114403348480;\nn128352589380059136 -> n127508164449927168;\nn127508164449927168 -> n128634064356769792;\nn127508164449927168 -> n128915539333480448;\nn128915539333480448 -> n128634064356769792;\nn128634064356769792 -> n128071114403348480;\nn128071114403348480 -> n129197014310191104;\nn128071114403348480 -> n129478489286901760;\nn129478489286901760 -> n129197014310191104;\nn129478489286901760 -> n129759964263612416;\nn129759964263612416 -> n129197014310191104;\nn129197014310191104 -> n130041439240323072;\nn129197014310191104 -> n130322914217033728;\nn130322914217033728 -> n130604389193744384;\nn130322914217033728 -> n130885864170455040;\nn130885864170455040 -> n130041439240323072;\nn130885864170455040 -> n131167339147165696;\nn131167339147165696 -> n130041439240323072;\nn131167339147165696 -> n130604389193744384;\nn130604389193744384 -> n130041439240323072;\nn130604389193744384 -> n131448814123876352;\nn131448814123876352 -> n130041439240323072;\nn130041439240323072 -> n131730289100587008;\nn130041439240323072 -> n132011764077297664;\nn132011764077297664 -> n131730289100587008;\nn131730289100587008 -> n132293239054008320;\nn131730289100587008 -> n132574714030718976;\nn132574714030718976 -> n132293239054008320;\nn132574714030718976 -> n132856189007429632;\nn132856189007429632 -> n133137663984140288;\nn132856189007429632 -> n133419138960850944;\nn133419138960850944 -> n133700613937561600;\nn133419138960850944 -> n133137663984140288;\nn133137663984140288 -> n133982088914272256;\nn133137663984140288 -> n133700613937561600;\nn133700613937561600 -> n132293239054008320;\nn133700613937561600 -> n134263563890982912;\nn134263563890982912 -> n132293239054008320;\nn134263563890982912 -> n134545038867693568;\nn134545038867693568 -> n132293239054008320;\nn134545038867693568 -> n133982088914272256;\nn133982088914272256 -> n134826513844404224;\nn132293239054008320 -> n134826513844404224;\nn134826513844404224 -> n135107988821114880;\nn134826513844404224 -> n135389463797825536;\nn135389463797825536 -> n135107988821114880;\nn135107988821114880 -> n135670938774536192;\nn135107988821114880 -> n135952413751246848;\nn135952413751246848 -> n135670938774536192;\nn135952413751246848 -> n136233888727957504;\nn136233888727957504 -> n136515363704668160;\nn136233888727957504 -> n136796838681378816;\nn136796838681378816 -> n137078313658089472;\nn136796838681378816 -> n136515363704668160;\nn136515363704668160 -> n137359788634800128;\nn136515363704668160 -> n137078313658089472;\nn137078313658089472 -> n135670938774536192;\nn137078313658089472 -> n137641263611510784;\nn137641263611510784 -> n135670938774536192;\nn137641263611510784 -> n137922738588221440;\nn137922738588221440 -> n135670938774536192;\nn137922738588221440 -> n137359788634800128;\nn137359788634800128 -> n138204213564932096;\nn135670938774536192 -> n138204213564932096;\nn138204213564932096 -> n138485688541642752;\nn138204213564932096 -> n138767163518353408;\nn138767163518353408 -> n138485688541642752;\nn138767163518353408 -> n139048638495064064;\nn139048638495064064 -> n139330113471774720;\nn138485688541642752 -> n139330113471774720;\nn139330113471774720 -> n139611588448485376;\nn139330113471774720 -> n139893063425196032;\nn139893063425196032 -> n140174538401906688;\nn139893063425196032 -> n140456013378617344;\nn140456013378617344 -> n141018963332038656;\nn141018963332038656 -> n139611588448485376;\nn141018963332038656 -> n140737488355328000;\nn140737488355328000 -> n141018963332038656;\nn140737488355328000 -> n141300438308749312;\nn141300438308749312 -> n140174538401906688;\nn139611588448485376 -> n140174538401906688;\nn140174538401906688 -> n141581913285459968;\nn140174538401906688 -> n141863388262170624;\nn141863388262170624 -> n142144863238881280;\nn141863388262170624 -> n142426338215591936;\nn142426338215591936 -> n142707813192302592;\nn142426338215591936 -> n142989288169013248;\nn142989288169013248 -> n143270763145723904;\nn142707813192302592 -> n143270763145723904;\nn142144863238881280 -> n143270763145723904;\nn142144863238881280 -> n143552238122434560;\nn143552238122434560 -> n143270763145723904;\nn143270763145723904 -> n141581913285459968;\nn141581913285459968 -> n143833713099145216;\nn141581913285459968 -> n144115188075855872;\nn144115188075855872 -> n143833713099145216;\nn144115188075855872 -> n144396663052566528;\nn144396663052566528 -> n143833713099145216;\nn144396663052566528 -> n144678138029277184;\nn144678138029277184 -> n143833713099145216;\nn144678138029277184 -> n144959613005987840;\nn144959613005987840 -> n143833713099145216;\nn144959613005987840 -> n145241087982698496;\nn145241087982698496 -> n143833713099145216;\nn145241087982698496 -> n145522562959409152;\nn145522562959409152 -> n145804037936119808;\nn145522562959409152 -> n146085512912830464;\nn146085512912830464 -> n145804037936119808;\nn146085512912830464 -> n146366987889541120;\nn146366987889541120 -> n145804037936119808;\nn146366987889541120 -> n146648462866251776;\nn146648462866251776 -> n146929937842962432;\nn146648462866251776 -> n147211412819673088;\nn147211412819673088 -> n146929937842962432;\nn146929937842962432 -> n147492887796383744;\nn146929937842962432 -> n147774362773094400;\nn147774362773094400 -> n147492887796383744;\nn147492887796383744 -> n148055837749805056;\nn147492887796383744 -> n148337312726515712;\nn148337312726515712 -> n148618787703226368;\nn148337312726515712 -> n148900262679937024;\nn148900262679937024 -> n148618787703226368;\nn148618787703226368 -> n145804037936119808;\nn148055837749805056 -> n145804037936119808;\nn145804037936119808 -> n149181737656647680;\nn145804037936119808 -> n149463212633358336;\nn149463212633358336 -> n149744687610068992;\nn149463212633358336 -> n150026162586779648;\nn150026162586779648 -> n150589112540200960;\nn150589112540200960 -> n149181737656647680;\nn150589112540200960 -> n150307637563490304;\nn150307637563490304 -> n150589112540200960;\nn150307637563490304 -> n150870587516911616;\nn150870587516911616 -> n149744687610068992;\nn149181737656647680 -> n149744687610068992;\nn149744687610068992 -> n151152062493622272;\nn149744687610068992 -> n151433537470332928;\nn151433537470332928 -> n151715012447043584;\nn151433537470332928 -> n151996487423754240;\nn151996487423754240 -> n152277962400464896;\nn151996487423754240 -> n152559437377175552;\nn152559437377175552 -> n152840912353886208;\nn152277962400464896 -> n152840912353886208;\nn151715012447043584 -> n152840912353886208;\nn151715012447043584 -> n153122387330596864;\nn153122387330596864 -> n152840912353886208;\nn152840912353886208 -> n151152062493622272;\nn151152062493622272 -> n143833713099145216;\nn151152062493622272 -> n153403862307307520;\nn153403862307307520 -> n153685337284018176;\nn153403862307307520 -> n153966812260728832;\nn153966812260728832 -> n153685337284018176;\nn153685337284018176 -> n154248287237439488;\nn153685337284018176 -> n154529762214150144;\nn154529762214150144 -> n154248287237439488;\nn154248287237439488 -> n154811237190860800;\nn154248287237439488 -> n155092712167571456;\nn155092712167571456 -> n154811237190860800;\nn154811237190860800 -> n155374187144282112;\nn154811237190860800 -> n155655662120992768;\nn155655662120992768 -> n155374187144282112;\nn155374187144282112 -> n155937137097703424;\nn155374187144282112 -> n156218612074414080;\nn156218612074414080 -> n156500087051124736;\nn156218612074414080 -> n156781562027835392;\nn156781562027835392 -> n156500087051124736;\nn156500087051124736 -> n143833713099145216;\nn155937137097703424 -> n143833713099145216;\nn143833713099145216 -> n157063037004546048;\nn143833713099145216 -> n157344511981256704;\nn157344511981256704 -> n157063037004546048;\nn157344511981256704 -> n157625986957967360;\nn157625986957967360 -> n157063037004546048;\nn157625986957967360 -> n157907461934678016;\nn157907461934678016 -> n158188936911388672;\nn157907461934678016 -> n158470411888099328;\nn158470411888099328 -> n157063037004546048;\nn158470411888099328 -> n158751886864809984;\nn158751886864809984 -> n157063037004546048;\nn158751886864809984 -> n159033361841520640;\nn159033361841520640 -> n157063037004546048;\nn159033361841520640 -> n159314836818231296;\nn159314836818231296 -> n157063037004546048;\nn159314836818231296 -> n159596311794941952;\nn159596311794941952 -> n157063037004546048;\nn159596311794941952 -> n159877786771652608;\nn159877786771652608 -> n160159261748363264;\nn158188936911388672 -> n115404740451368960;\nn158188936911388672 -> n160440736725073920;\nn160440736725073920 -> n115404740451368960;\nn160440736725073920 -> n160722211701784576;\nn160722211701784576 -> n160159261748363264;\nn160159261748363264 -> n157063037004546048;\nn157063037004546048 -> n161003686678495232;\nn157063037004546048 -> n161285161655205888;\nn161285161655205888 -> n161003686678495232;\nn108930815987023872 -> n161566636631916544;\nn119345390125318144 -> n118219490218475520;\nn119345390125318144 -> n161848111608627200;\nn161848111608627200 -> n162129586585337856;\nn161848111608627200 -> n162411061562048512;\nn162411061562048512 -> n162692536538759168;\nn162129586585337856 -> n162974011515469824;\nn162129586585337856 -> n162692536538759168;\nn162692536538759168 -> n163255486492180480;\nn162692536538759168 -> n163536961468891136;\nn163536961468891136 -> n163255486492180480;\nn163255486492180480 -> n119908340078739456;\nn119908340078739456 -> n163818436445601792;\nn119908340078739456 -> n118782440171896832;\nn118782440171896832 -> n164099911422312448;\nn118782440171896832 -> n164381386399023104;\nn164381386399023104 -> n169447935979814912;\nn169447935979814912 -> n164662861375733760;\nn169447935979814912 -> n164944336352444416;\nn164944336352444416 -> n165225811329155072;\nn164944336352444416 -> n165507286305865728;\nn165507286305865728 -> n164662861375733760;\nn165507286305865728 -> n165788761282576384;\nn165788761282576384 -> n165507286305865728;\nn165788761282576384 -> n166070236259287040;\nn166070236259287040 -> n165225811329155072;\nn164662861375733760 -> n165225811329155072;\nn165225811329155072 -> n166351711235997696;\nn165225811329155072 -> n166633186212708352;\nn166633186212708352 -> n166914661189419008;\nn166633186212708352 -> n167196136166129664;\nn167196136166129664 -> n166914661189419008;\nn166914661189419008 -> n167477611142840320;\nn166914661189419008 -> n167759086119550976;\nn167759086119550976 -> n168040561096261632;\nn167759086119550976 -> n167477611142840320;\nn167477611142840320 -> n168040561096261632;\nn168040561096261632 -> n168322036072972288;\nn168040561096261632 -> n168603511049682944;\nn168603511049682944 -> n168884986026393600;\nn168603511049682944 -> n169166461003104256;\nn169166461003104256 -> n168884986026393600;\nn168884986026393600 -> n168322036072972288;\nn168322036072972288 -> n166351711235997696;\nn166351711235997696 -> n169447935979814912;\nn166351711235997696 -> n169729410956525568;\nn169729410956525568 -> n164099911422312448;\nn164099911422312448 -> n173951535607185408;\nn173951535607185408 -> n170010885933236224;\nn173951535607185408 -> n170292360909946880;\nn170292360909946880 -> n170010885933236224;\nn170292360909946880 -> n170573835886657536;\nn170573835886657536 -> n170855310863368192;\nn170573835886657536 -> n171136785840078848;\nn171136785840078848 -> n170855310863368192;\nn170855310863368192 -> n171418260816789504;\nn170855310863368192 -> n171699735793500160;\nn171699735793500160 -> n171418260816789504;\nn171418260816789504 -> n171981210770210816;\nn171418260816789504 -> n172262685746921472;\nn172262685746921472 -> n171981210770210816;\nn171981210770210816 -> n172544160723632128;\nn171981210770210816 -> n172825635700342784;\nn172825635700342784 -> n172544160723632128;\nn172544160723632128 -> n173107110677053440;\nn172544160723632128 -> n173388585653764096;\nn173388585653764096 -> n173670060630474752;\nn173388585653764096 -> n173107110677053440;\nn173107110677053440 -> n173670060630474752;\nn173670060630474752 -> n173951535607185408;\nn170010885933236224 -> n174233010583896064;\nn170010885933236224 -> n174514485560606720;\nn174514485560606720 -> n178173660257845248;\nn178173660257845248 -> n174795960537317376;\nn178173660257845248 -> n175077435514028032;\nn175077435514028032 -> n174795960537317376;\nn174795960537317376 -> n175358910490738688;\nn174795960537317376 -> n175640385467449344;\nn175640385467449344 -> n175358910490738688;\nn175358910490738688 -> n175921860444160000;\nn175358910490738688 -> n176203335420870656;\nn176203335420870656 -> n175921860444160000;\nn176203335420870656 -> n176484810397581312;\nn176484810397581312 -> n176766285374291968;\nn176484810397581312 -> n177047760351002624;\nn177047760351002624 -> n177329235327713280;\nn177047760351002624 -> n176766285374291968;\nn176766285374291968 -> n175921860444160000;\nn175921860444160000 -> n177329235327713280;\nn177329235327713280 -> n177610710304423936;\nn177329235327713280 -> n177892185281134592;\nn177892185281134592 -> n177610710304423936;\nn177610710304423936 -> n178173660257845248;\nn177610710304423936 -> n178455135234555904;\nn178455135234555904 -> n178736610211266560;\nn174233010583896064 -> n178736610211266560;\nn178736610211266560 -> n179018085187977216;\nn178736610211266560 -> n179299560164687872;\nn179299560164687872 -> n179581035141398528;\nn179299560164687872 -> n179862510118109184;\nn179862510118109184 -> n179581035141398528;\nn179581035141398528 -> n179018085187977216;\nn179018085187977216 -> n1407374883553280;\nn1407374883553280 -> n281474976710656;\nn118219490218475520 -> n162974011515469824;\nn2251799813685248 -> n1970324836974592[style=dotted];\nn9851624184872960 -> n3096224743817216[style=dotted];\nn3940649673949184 -> n3659174697238528[style=dotted];\nn5348024557502464 -> n3377699720527872[style=dotted];\nn5629499534213120 -> n5348024557502464[style=dotted];\nn6755399441055744 -> n6473924464345088[style=dotted];\nn6192449487634432 -> n5629499534213120[style=dotted];\nn7599824371187712 -> n7318349394477056[style=dotted];\nn7036874417766400 -> n6192449487634432[style=dotted];\nn5066549580791808 -> n3377699720527872[style=dotted];\nn8162774324609024 -> n5066549580791808[style=dotted];\nn9570149208162304 -> n9007199254740992[style=dotted];\nn9288674231451648 -> n9007199254740992[style=dotted];\nn8725724278030336 -> n8162774324609024[style=dotted];\nn4503599627370496 -> n9851624184872960[style=dotted];\nn2814749767106560 -> n2251799813685248[style=dotted];\nn10414574138294272 -> n2814749767106560[style=dotted];\nn11540474045136896 -> n10414574138294272[style=dotted];\nn11821949021847552 -> n11540474045136896[style=dotted];\nn12947848928690176 -> n12666373951979520[style=dotted];\nn13792273858822144 -> n13510798882111488[style=dotted];\nn14636698788954112 -> n14355223812243456[style=dotted];\nn12384898975268864 -> n11821949021847552[style=dotted];\nn15481123719086080 -> n12384898975268864[style=dotted];\nn16888498602639360 -> n16044073672507392[style=dotted];\nn16325548649218048 -> n16888498602639360[style=dotted];\nn15199648742375424 -> n11821949021847552[style=dotted];\nn11258999068426240 -> n10414574138294272[style=dotted];\nn23643898043695104 -> n2814749767106560[style=dotted];\nn17732923532771328 -> n17451448556060672[style=dotted];\nn20266198323167232 -> n19703248369745920[style=dotted];\nn21392098230009856 -> n21110623253299200[style=dotted];\nn20829148276588544 -> n20547673299877888[style=dotted];\nn21955048183431168 -> n20829148276588544[style=dotted];\nn21673573206720512 -> n20829148276588544[style=dotted];\nn19984723346456576 -> n19703248369745920[style=dotted];\nn17169973579350016 -> n23643898043695104[style=dotted];\nn69242844270821376 -> n22517998136852480[style=dotted];\nn23362423066984448 -> n69242844270821376[style=dotted];\nn23925373020405760 -> n23362423066984448[style=dotted];\nn24488322973827072 -> n23925373020405760[style=dotted];\nn26177172834091008 -> n25895697857380352[style=dotted];\nn25051272927248384 -> n24488322973827072[style=dotted];\nn26740122787512320 -> n25051272927248384[style=dotted];\nn27866022694354944 -> n27584547717644288[style=dotted];\nn29273397577908224 -> n28991922601197568[style=dotted];\nn31525197391593472 -> n30680772461461504[style=dotted];\nn30399297484750848 -> n30117822508040192[style=dotted];\nn28428972647776256 -> n27866022694354944[style=dotted];\nn32088147345014784 -> n27866022694354944[style=dotted];\nn32651097298436096 -> n32088147345014784[style=dotted];\nn33214047251857408 -> n32651097298436096[style=dotted];\nn34058472181989376 -> n33214047251857408[style=dotted];\nn34339947158700032 -> n34058472181989376[style=dotted];\nn37154696925806592 -> n35465847065542656[style=dotted];\nn38280596832649216 -> n37999121855938560[style=dotted];\nn38843546786070528 -> n34902897112121344[style=dotted];\nn36591746972385280 -> n34339947158700032[style=dotted];\nn39687971716202496 -> n36591746972385280[style=dotted];\nn33776997205278720 -> n33214047251857408[style=dotted];\nn40532396646334464 -> n33776997205278720[style=dotted];\nn49539595901075456 -> n41376821576466432[style=dotted];\nn41658296553177088 -> n49539595901075456[style=dotted];\nn44473046320283648 -> n42784196460019712[style=dotted];\nn45035996273704960 -> n44473046320283648[style=dotted];\nn45598946227126272 -> n45035996273704960[style=dotted];\nn46443371157258240 -> n46161896180547584[style=dotted];\nn47006321110679552 -> n42221246506598400[style=dotted];\nn47569271064100864 -> n47006321110679552[style=dotted];\nn48132221017522176 -> n47569271064100864[style=dotted];\nn43910096366862336 -> n41658296553177088[style=dotted];\nn48976645947654144 -> n43910096366862336[style=dotted];\nn41095346599755776 -> n40532396646334464[style=dotted];\nn50102545854496768 -> n41095346599755776[style=dotted];\nn51509920738050048 -> n51228445761339392[style=dotted];\nn50665495807918080 -> n50102545854496768[style=dotted];\nn52635820644892672 -> n50665495807918080[style=dotted];\nn54324670505156608 -> n54043195528445952[style=dotted];\nn55169095435288576 -> n54887620458577920[style=dotted];\nn56013520365420544 -> n55732045388709888[style=dotted];\nn52072870691471360 -> n51509920738050048[style=dotted];\nn53198770598313984 -> n50102545854496768[style=dotted];\nn62205969853054976 -> n56857945295552512[style=dotted];\nn57139420272263168 -> n62205969853054976[style=dotted];\nn57983845202395136 -> n57139420272263168[style=dotted];\nn58828270132527104 -> n58546795155816448[style=dotted];\nn59391220085948416 -> n58828270132527104[style=dotted];\nn60517119992791040 -> n60235645016080384[style=dotted];\nn61643019899633664 -> n61361544922923008[style=dotted];\nn58265320179105792 -> n57983845202395136[style=dotted];\nn59954170039369728 -> n57983845202395136[style=dotted];\nn57702370225684480 -> n57139420272263168[style=dotted];\nn68116944363978752 -> n63331869759897600[style=dotted];\nn64176294690029568 -> n63894819713318912[style=dotted];\nn64739244643450880 -> n64176294690029568[style=dotted];\nn65865144550293504 -> n64739244643450880[style=dotted];\nn65583669573582848 -> n64176294690029568[style=dotted];\nn66428094503714816 -> n65583669573582848[style=dotted];\nn66991044457136128 -> n66428094503714816[style=dotted];\nn63613344736608256 -> n68116944363978752[style=dotted];\nn67553994410557440 -> n63613344736608256[style=dotted];\nn62768919806476288 -> n26740122787512320[style=dotted];\nn53761720551735296 -> n26740122787512320[style=dotted];\nn63050394783186944 -> n26740122787512320[style=dotted];\nn68679894317400064 -> n63050394783186944[style=dotted];\nn22236523160141824 -> n17169973579350016[style=dotted];\nn70931694131085312 -> n69805794224242688[style=dotted];\nn70087269200953344 -> n70931694131085312[style=dotted];\nn69524319247532032 -> n22236523160141824[style=dotted];\nn87538717757014016 -> n71776119061217280[style=dotted];\nn72057594037927936 -> n87538717757014016[style=dotted];\nn72620543991349248 -> n87538717757014016[style=dotted];\nn73464968921481216 -> n73183493944770560[style=dotted];\nn74872343805034496 -> n74027918874902528[style=dotted];\nn74309393851613184 -> n74872343805034496[style=dotted];\nn72902018968059904 -> n72620543991349248[style=dotted];\nn75153818781745152 -> n72902018968059904[style=dotted];\nn76279718688587776 -> n75998243711877120[style=dotted];\nn77968568548851712 -> n77687093572141056[style=dotted];\nn77405618595430400 -> n77124143618719744[style=dotted];\nn78250043525562368 -> n76279718688587776[style=dotted];\nn78531518502273024 -> n78250043525562368[style=dotted];\nn80220368362536960 -> n79938893385826304[style=dotted];\nn79657418409115648 -> n79375943432404992[style=dotted];\nn80783318315958272 -> n80501843339247616[style=dotted];\nn81627743246090240 -> n80783318315958272[style=dotted];\nn81909218222800896 -> n81627743246090240[style=dotted];\nn83598068083064832 -> n83316593106354176[style=dotted];\nn84723967989907456 -> n84442493013196800[style=dotted];\nn85286917943328768 -> n84723967989907456[style=dotted];\nn82472168176222208 -> n81909218222800896[style=dotted];\nn85849867896750080 -> n82472168176222208[style=dotted];\nn84161018036486144 -> n81909218222800896[style=dotted];\nn86694292826882048 -> n84161018036486144[style=dotted];\nn79094468455694336 -> n75153818781745152[style=dotted];\nn71494644084506624 -> n69524319247532032[style=dotted];\nn88664617663856640 -> n88383142687145984[style=dotted];\nn88101667710435328 -> n71494644084506624[style=dotted];\nn88946092640567296 -> n88101667710435328[style=dotted];\nn94857067151491072 -> n90353467524120576[style=dotted];\nn90634942500831232 -> n94857067151491072[style=dotted];\nn91760842407673856 -> n91479367430963200[style=dotted];\nn91197892454252544 -> n90634942500831232[style=dotted];\nn92605267337805824 -> n91197892454252544[style=dotted];\nn93168217291227136 -> n92605267337805824[style=dotted];\nn93731167244648448 -> n93168217291227136[style=dotted];\nn94294117198069760 -> n93731167244648448[style=dotted];\nn92323792361095168 -> n90634942500831232[style=dotted];\nn99642141755572224 -> n95420017104912384[style=dotted];\nn95701492081623040 -> n99642141755572224[style=dotted];\nn97390341941886976 -> n97108866965176320[style=dotted];\nn96827391988465664 -> n96545917011755008[style=dotted];\nn96264442035044352 -> n95701492081623040[style=dotted];\nn97671816918597632 -> n96264442035044352[style=dotted];\nn99360666778861568 -> n99079191802150912[style=dotted];\nn98797716825440256 -> n98516241848729600[style=dotted];\nn98234766872018944 -> n97671816918597632[style=dotted];\nn90071992547409920 -> n88946092640567296[style=dotted];\nn1688849860263936 -> n844424930131968[style=dotted];\nn107804916080181248 -> n1688849860263936[style=dotted];\nn100205091708993536 -> n107804916080181248[style=dotted];\nn102456891522678784 -> n100205091708993536[style=dotted];\nn100768041662414848 -> n102456891522678784[style=dotted];\nn101893941569257472 -> n101612466592546816[style=dotted];\nn103301316452810752 -> n103019841476100096[style=dotted];\nn103864266406232064 -> n101330991615836160[style=dotted];\nn104427216359653376 -> n103864266406232064[style=dotted];\nn104990166313074688 -> n104427216359653376[style=dotted];\nn105553116266496000 -> n104990166313074688[style=dotted];\nn106116066219917312 -> n105553116266496000[style=dotted];\nn106679016173338624 -> n106116066219917312[style=dotted];\nn107241966126759936 -> n106679016173338624[style=dotted];\nn117375065288343552 -> n108649341010313216[style=dotted];\nn116812115334922240 -> n117375065288343552[style=dotted];\nn109493765940445184 -> n109212290963734528[style=dotted];\nn110056715893866496 -> n109493765940445184[style=dotted];\nn110619665847287808 -> n110056715893866496[style=dotted];\nn111745565754130432 -> n110619665847287808[style=dotted];\nn112027040730841088 -> n111745565754130432[style=dotted];\nn112589990684262400 -> n112027040730841088[style=dotted];\nn114278840544526336 -> n113997365567815680[style=dotted];\nn113152940637683712 -> n112589990684262400[style=dotted];\nn114841790497947648 -> n113152940637683712[style=dotted];\nn115404740451368960 -> n114841790497947648[style=dotted];\nn161003686678495232 -> n114841790497947648[style=dotted];\nn161566636631916544 -> n116812115334922240[style=dotted];\nn108367866033602560 -> n108086391056891904[style=dotted];\nn117656540265054208 -> n108367866033602560[style=dotted];\nn163818436445601792 -> n119063915148607488[style=dotted];\nn116530640358211584 -> n115686215428079616[style=dotted];\nn120189815055450112 -> n116530640358211584[style=dotted];\nn121315714962292736 -> n116530640358211584[style=dotted];\nn121597189939003392 -> n116530640358211584[style=dotted];\nn122160139892424704 -> n121597189939003392[style=dotted];\nn123286039799267328 -> n121597189939003392[style=dotted];\nn123567514775977984 -> n121597189939003392[style=dotted];\nn124130464729399296 -> n123567514775977984[style=dotted];\nn124693414682820608 -> n124130464729399296[style=dotted];\nn125819314589663232 -> n125537839612952576[style=dotted];\nn125256364636241920 -> n124693414682820608[style=dotted];\nn126382264543084544 -> n125256364636241920[style=dotted];\nn126945214496505856 -> n126382264543084544[style=dotted];\nn127508164449927168 -> n126945214496505856[style=dotted];\nn128634064356769792 -> n127508164449927168[style=dotted];\nn128071114403348480 -> n126945214496505856[style=dotted];\nn129197014310191104 -> n128071114403348480[style=dotted];\nn130604389193744384 -> n130322914217033728[style=dotted];\nn130041439240323072 -> n129197014310191104[style=dotted];\nn131730289100587008 -> n130041439240323072[style=dotted];\nn133137663984140288 -> n132856189007429632[style=dotted];\nn133700613937561600 -> n132856189007429632[style=dotted];\nn133982088914272256 -> n132856189007429632[style=dotted];\nn132293239054008320 -> n131730289100587008[style=dotted];\nn134826513844404224 -> n131730289100587008[style=dotted];\nn135107988821114880 -> n134826513844404224[style=dotted];\nn136515363704668160 -> n136233888727957504[style=dotted];\nn137078313658089472 -> n136233888727957504[style=dotted];\nn137359788634800128 -> n136233888727957504[style=dotted];\nn135670938774536192 -> n135107988821114880[style=dotted];\nn138204213564932096 -> n135107988821114880[style=dotted];\nn138485688541642752 -> n138204213564932096[style=dotted];\nn139330113471774720 -> n138204213564932096[style=dotted];\nn141018963332038656 -> n140456013378617344[style=dotted];\nn139611588448485376 -> n139330113471774720[style=dotted];\nn140174538401906688 -> n139330113471774720[style=dotted];\nn143270763145723904 -> n141863388262170624[style=dotted];\nn141581913285459968 -> n140174538401906688[style=dotted];\nn146929937842962432 -> n146648462866251776[style=dotted];\nn147492887796383744 -> n146929937842962432[style=dotted];\nn148618787703226368 -> n148337312726515712[style=dotted];\nn145804037936119808 -> n145522562959409152[style=dotted];\nn150589112540200960 -> n150026162586779648[style=dotted];\nn149181737656647680 -> n145804037936119808[style=dotted];\nn149744687610068992 -> n145804037936119808[style=dotted];\nn152840912353886208 -> n151433537470332928[style=dotted];\nn151152062493622272 -> n149744687610068992[style=dotted];\nn153685337284018176 -> n153403862307307520[style=dotted];\nn154248287237439488 -> n153685337284018176[style=dotted];\nn154811237190860800 -> n154248287237439488[style=dotted];\nn155374187144282112 -> n154811237190860800[style=dotted];\nn156500087051124736 -> n156218612074414080[style=dotted];\nn143833713099145216 -> n141581913285459968[style=dotted];\nn160159261748363264 -> n157907461934678016[style=dotted];\nn157063037004546048 -> n143833713099145216[style=dotted];\nn162692536538759168 -> n161848111608627200[style=dotted];\nn163255486492180480 -> n162692536538759168[style=dotted];\nn119908340078739456 -> n163818436445601792[style=dotted];\nn118782440171896832 -> n117656540265054208[style=dotted];\nn169447935979814912 -> n164381386399023104[style=dotted];\nn165507286305865728 -> n164944336352444416[style=dotted];\nn164662861375733760 -> n169447935979814912[style=dotted];\nn165225811329155072 -> n169447935979814912[style=dotted];\nn166914661189419008 -> n166633186212708352[style=dotted];\nn167477611142840320 -> n166914661189419008[style=dotted];\nn168040561096261632 -> n166914661189419008[style=dotted];\nn168884986026393600 -> n168603511049682944[style=dotted];\nn168322036072972288 -> n168040561096261632[style=dotted];\nn166351711235997696 -> n165225811329155072[style=dotted];\nn164099911422312448 -> n118782440171896832[style=dotted];\nn173951535607185408 -> n164099911422312448[style=dotted];\nn170855310863368192 -> n170573835886657536[style=dotted];\nn171418260816789504 -> n170855310863368192[style=dotted];\nn171981210770210816 -> n171418260816789504[style=dotted];\nn172544160723632128 -> n171981210770210816[style=dotted];\nn173107110677053440 -> n172544160723632128[style=dotted];\nn173670060630474752 -> n172544160723632128[style=dotted];\nn170010885933236224 -> n173951535607185408[style=dotted];\nn178173660257845248 -> n174514485560606720[style=dotted];\nn174795960537317376 -> n178173660257845248[style=dotted];\nn175358910490738688 -> n174795960537317376[style=dotted];\nn176766285374291968 -> n176484810397581312[style=dotted];\nn175921860444160000 -> n175358910490738688[style=dotted];\nn177329235327713280 -> n175358910490738688[style=dotted];\nn177610710304423936 -> n177329235327713280[style=dotted];\nn178736610211266560 -> n170010885933236224[style=dotted];\nn179581035141398528 -> n179299560164687872[style=dotted];\nn179018085187977216 -> n178736610211266560[style=dotted];\nn1407374883553280 -> n562949953421312[style=dotted];\nn281474976710656 -> n0[style=dotted];\nn118219490218475520 -> n108367866033602560[style=dotted];\nn162974011515469824 -> n108367866033602560[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-383.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn844424930131968[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn3377699720527872[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn1970324836974592[shape=rectangle, label=\"B8\"];\nn2533274790395904[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn2814749767106560[shape=rectangle, label=\"B11\"];\nn1407374883553280[shape=rectangle, label=\"B12\"];\nn3940649673949184[shape=rectangle, label=\"B13\"];\nn3659174697238528[shape=rectangle, label=\"B14\"];\nn4503599627370496[shape=rectangle, label=\"B15\"];\nn4222124650659840[shape=rectangle, label=\"B16\"];\nn5066549580791808[shape=rectangle, label=\"B17\"];\nn43910096366862336[shape=rectangle, label=\"B18\"];\nn5629499534213120[shape=rectangle, label=\"B19\"];\nn5348024557502464[shape=rectangle, label=\"B20\"];\nn6192449487634432[shape=rectangle, label=\"B21\"];\nn5910974510923776[shape=rectangle, label=\"B22\"];\nn6755399441055744[shape=rectangle, label=\"B23\"];\nn6473924464345088[shape=rectangle, label=\"B24\"];\nn7318349394477056[shape=rectangle, label=\"B25\"];\nn7036874417766400[shape=rectangle, label=\"B26\"];\nn7881299347898368[shape=rectangle, label=\"B27\"];\nn7599824371187712[shape=rectangle, label=\"B28\"];\nn8444249301319680[shape=rectangle, label=\"B29\"];\nn8162774324609024[shape=rectangle, label=\"B30\"];\nn9007199254740992[shape=rectangle, label=\"B31\"];\nn9570149208162304[shape=rectangle, label=\"B32\"];\nn9288674231451648[shape=rectangle, label=\"B33\"];\nn9851624184872960[shape=rectangle, label=\"B34\"];\nn8725724278030336[shape=rectangle, label=\"B35\"];\nn10414574138294272[shape=rectangle, label=\"B36\"];\nn10977524091715584[shape=rectangle, label=\"B37\"];\nn10696049115004928[shape=rectangle, label=\"B38\"];\nn11258999068426240[shape=rectangle, label=\"B39\"];\nn10133099161583616[shape=rectangle, label=\"B40\"];\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn11540474045136896[shape=rectangle, label=\"B42\"];\nn12384898975268864[shape=rectangle, label=\"B43\"];\nn23080948090273792[shape=rectangle, label=\"B44\"];\nn12947848928690176[shape=rectangle, label=\"B45\"];\nn12666373951979520[shape=rectangle, label=\"B46\"];\nn13510798882111488[shape=rectangle, label=\"B47\"];\nn14073748835532800[shape=rectangle, label=\"B48\"];\nn14636698788954112[shape=rectangle, label=\"B49\"];\nn15199648742375424[shape=rectangle, label=\"B50\"];\nn14918173765664768[shape=rectangle, label=\"B51\"];\nn15762598695796736[shape=rectangle, label=\"B52\"];\nn15481123719086080[shape=rectangle, label=\"B53\"];\nn16325548649218048[shape=rectangle, label=\"B54\"];\nn16044073672507392[shape=rectangle, label=\"B55\"];\nn16888498602639360[shape=rectangle, label=\"B56\"];\nn21673573206720512[shape=rectangle, label=\"B57\"];\nn17451448556060672[shape=rectangle, label=\"B58\"];\nn17169973579350016[shape=rectangle, label=\"B59\"];\nn18014398509481984[shape=rectangle, label=\"B60\"];\nn17732923532771328[shape=rectangle, label=\"B61\"];\nn18295873486192640[shape=rectangle, label=\"B62\"];\nn18858823439613952[shape=rectangle, label=\"B63\"];\nn18577348462903296[shape=rectangle, label=\"B64\"];\nn19421773393035264[shape=rectangle, label=\"B65\"];\nn19984723346456576[shape=rectangle, label=\"B66\"];\nn20266198323167232[shape=rectangle, label=\"B67\"];\nn19703248369745920[shape=rectangle, label=\"B68\"];\nn20829148276588544[shape=rectangle, label=\"B69\"];\nn20547673299877888[shape=rectangle, label=\"B70\"];\nn19140298416324608[shape=rectangle, label=\"B71\"];\nn21392098230009856[shape=rectangle, label=\"B72\"];\nn21110623253299200[shape=rectangle, label=\"B73\"];\nn16607023625928704[shape=rectangle, label=\"B74\"];\nn22236523160141824[shape=rectangle, label=\"B75\"];\nn21955048183431168[shape=rectangle, label=\"B76\"];\nn14355223812243456[shape=rectangle, label=\"B77\"];\nn22799473113563136[shape=rectangle, label=\"B78\"];\nn22517998136852480[shape=rectangle, label=\"B79\"];\nn12103423998558208[shape=rectangle, label=\"B80\"];\nn23643898043695104[shape=rectangle, label=\"B81\"];\nn43628621390151680[shape=rectangle, label=\"B82\"];\nn24206847997116416[shape=rectangle, label=\"B83\"];\nn23925373020405760[shape=rectangle, label=\"B84\"];\nn24769797950537728[shape=rectangle, label=\"B85\"];\nn25332747903959040[shape=rectangle, label=\"B86\"];\nn25614222880669696[shape=rectangle, label=\"B87\"];\nn26177172834091008[shape=rectangle, label=\"B88\"];\nn26458647810801664[shape=rectangle, label=\"B89\"];\nn27021597764222976[shape=rectangle, label=\"B90\"];\nn26740122787512320[shape=rectangle, label=\"B91\"];\nn27584547717644288[shape=rectangle, label=\"B92\"];\nn28147497671065600[shape=rectangle, label=\"B93\"];\nn28710447624486912[shape=rectangle, label=\"B94\"];\nn28428972647776256[shape=rectangle, label=\"B95\"];\nn28991922601197568[shape=rectangle, label=\"B96\"];\nn29554872554618880[shape=rectangle, label=\"B97\"];\nn29273397577908224[shape=rectangle, label=\"B98\"];\nn30117822508040192[shape=rectangle, label=\"B99\"];\nn30399297484750848[shape=rectangle, label=\"B100\"];\nn30680772461461504[shape=rectangle, label=\"B101\"];\nn30962247438172160[shape=rectangle, label=\"B102\"];\nn31243722414882816[shape=rectangle, label=\"B103\"];\nn29836347531329536[shape=rectangle, label=\"B104\"];\nn31525197391593472[shape=rectangle, label=\"B105\"];\nn32088147345014784[shape=rectangle, label=\"B106\"];\nn31806672368304128[shape=rectangle, label=\"B107\"];\nn32651097298436096[shape=rectangle, label=\"B108\"];\nn32369622321725440[shape=rectangle, label=\"B109\"];\nn33214047251857408[shape=rectangle, label=\"B110\"];\nn32932572275146752[shape=rectangle, label=\"B111\"];\nn33776997205278720[shape=rectangle, label=\"B112\"];\nn33495522228568064[shape=rectangle, label=\"B113\"];\nn34339947158700032[shape=rectangle, label=\"B114\"];\nn34058472181989376[shape=rectangle, label=\"B115\"];\nn34621422135410688[shape=rectangle, label=\"B116\"];\nn27866022694354944[shape=rectangle, label=\"B117\"];\nn35184372088832000[shape=rectangle, label=\"B118\"];\nn35747322042253312[shape=rectangle, label=\"B119\"];\nn35465847065542656[shape=rectangle, label=\"B120\"];\nn36028797018963968[shape=rectangle, label=\"B121\"];\nn36591746972385280[shape=rectangle, label=\"B122\"];\nn36310271995674624[shape=rectangle, label=\"B123\"];\nn36873221949095936[shape=rectangle, label=\"B124\"];\nn37154696925806592[shape=rectangle, label=\"B125\"];\nn37436171902517248[shape=rectangle, label=\"B126\"];\nn37717646879227904[shape=rectangle, label=\"B127\"];\nn37999121855938560[shape=rectangle, label=\"B128\"];\nn34902897112121344[shape=rectangle, label=\"B129\"];\nn38562071809359872[shape=rectangle, label=\"B130\"];\nn38280596832649216[shape=rectangle, label=\"B131\"];\nn39125021762781184[shape=rectangle, label=\"B132\"];\nn39687971716202496[shape=rectangle, label=\"B133\"];\nn39406496739491840[shape=rectangle, label=\"B134\"];\nn40250921669623808[shape=rectangle, label=\"B135\"];\nn39969446692913152[shape=rectangle, label=\"B136\"];\nn40813871623045120[shape=rectangle, label=\"B137\"];\nn40532396646334464[shape=rectangle, label=\"B138\"];\nn38843546786070528[shape=rectangle, label=\"B139\"];\nn41095346599755776[shape=rectangle, label=\"B140\"];\nn27303072740933632[shape=rectangle, label=\"B141\"];\nn41658296553177088[shape=rectangle, label=\"B142\"];\nn41376821576466432[shape=rectangle, label=\"B143\"];\nn41939771529887744[shape=rectangle, label=\"B144\"];\nn42502721483309056[shape=rectangle, label=\"B145\"];\nn42221246506598400[shape=rectangle, label=\"B146\"];\nn43065671436730368[shape=rectangle, label=\"B147\"];\nn42784196460019712[shape=rectangle, label=\"B148\"];\nn43347146413441024[shape=rectangle, label=\"B149\"];\nn68398419340689408[shape=rectangle, label=\"B150\"];\nn24488322973827072[shape=rectangle, label=\"B151\"];\nn23362423066984448[shape=rectangle, label=\"B152\"];\nn44191571343572992[shape=rectangle, label=\"B153\"];\nn4785074604081152[shape=rectangle, label=\"B154\"];\nn13229323905400832[shape=rectangle, label=\"B155\"];\nn44473046320283648[shape=rectangle, label=\"B156\"];\nn45035996273704960[shape=rectangle, label=\"B157\"];\nn45598946227126272[shape=rectangle, label=\"B158\"];\nn45317471250415616[shape=rectangle, label=\"B159\"];\nn45880421203836928[shape=rectangle, label=\"B160\"];\nn46443371157258240[shape=rectangle, label=\"B161\"];\nn46161896180547584[shape=rectangle, label=\"B162\"];\nn47006321110679552[shape=rectangle, label=\"B163\"];\nn46724846133968896[shape=rectangle, label=\"B164\"];\nn44754521296994304[shape=rectangle, label=\"B165\"];\nn47569271064100864[shape=rectangle, label=\"B166\"];\nn47287796087390208[shape=rectangle, label=\"B167\"];\nn48132221017522176[shape=rectangle, label=\"B168\"];\nn47850746040811520[shape=rectangle, label=\"B169\"];\nn48695170970943488[shape=rectangle, label=\"B170\"];\nn48413695994232832[shape=rectangle, label=\"B171\"];\nn49258120924364800[shape=rectangle, label=\"B172\"];\nn49821070877786112[shape=rectangle, label=\"B173\"];\nn49539595901075456[shape=rectangle, label=\"B174\"];\nn50384020831207424[shape=rectangle, label=\"B175\"];\nn50102545854496768[shape=rectangle, label=\"B176\"];\nn48976645947654144[shape=rectangle, label=\"B177\"];\nn50665495807918080[shape=rectangle, label=\"B178\"];\nn51228445761339392[shape=rectangle, label=\"B179\"];\nn50946970784628736[shape=rectangle, label=\"B180\"];\nn51791395714760704[shape=rectangle, label=\"B181\"];\nn51509920738050048[shape=rectangle, label=\"B182\"];\nn52354345668182016[shape=rectangle, label=\"B183\"];\nn52072870691471360[shape=rectangle, label=\"B184\"];\nn52917295621603328[shape=rectangle, label=\"B185\"];\nn52635820644892672[shape=rectangle, label=\"B186\"];\nn53480245575024640[shape=rectangle, label=\"B187\"];\nn53198770598313984[shape=rectangle, label=\"B188\"];\nn54043195528445952[shape=rectangle, label=\"B189\"];\nn54606145481867264[shape=rectangle, label=\"B190\"];\nn54324670505156608[shape=rectangle, label=\"B191\"];\nn55169095435288576[shape=rectangle, label=\"B192\"];\nn54887620458577920[shape=rectangle, label=\"B193\"];\nn53761720551735296[shape=rectangle, label=\"B194\"];\nn55450570411999232[shape=rectangle, label=\"B195\"];\nn56013520365420544[shape=rectangle, label=\"B196\"];\nn55732045388709888[shape=rectangle, label=\"B197\"];\nn56576470318841856[shape=rectangle, label=\"B198\"];\nn56294995342131200[shape=rectangle, label=\"B199\"];\nn57139420272263168[shape=rectangle, label=\"B200\"];\nn56857945295552512[shape=rectangle, label=\"B201\"];\nn57702370225684480[shape=rectangle, label=\"B202\"];\nn57420895248973824[shape=rectangle, label=\"B203\"];\nn58265320179105792[shape=rectangle, label=\"B204\"];\nn57983845202395136[shape=rectangle, label=\"B205\"];\nn58828270132527104[shape=rectangle, label=\"B206\"];\nn58546795155816448[shape=rectangle, label=\"B207\"];\nn59391220085948416[shape=rectangle, label=\"B208\"];\nn59109745109237760[shape=rectangle, label=\"B209\"];\nn59954170039369728[shape=rectangle, label=\"B210\"];\nn60517119992791040[shape=rectangle, label=\"B211\"];\nn60235645016080384[shape=rectangle, label=\"B212\"];\nn61080069946212352[shape=rectangle, label=\"B213\"];\nn60798594969501696[shape=rectangle, label=\"B214\"];\nn59672695062659072[shape=rectangle, label=\"B215\"];\nn61361544922923008[shape=rectangle, label=\"B216\"];\nn61924494876344320[shape=rectangle, label=\"B217\"];\nn61643019899633664[shape=rectangle, label=\"B218\"];\nn62487444829765632[shape=rectangle, label=\"B219\"];\nn62205969853054976[shape=rectangle, label=\"B220\"];\nn63050394783186944[shape=rectangle, label=\"B221\"];\nn63613344736608256[shape=rectangle, label=\"B222\"];\nn63331869759897600[shape=rectangle, label=\"B223\"];\nn62768919806476288[shape=rectangle, label=\"B224\"];\nn64176294690029568[shape=rectangle, label=\"B225\"];\nn63894819713318912[shape=rectangle, label=\"B226\"];\nn13792273858822144[shape=rectangle, label=\"B227\"];\nn64457769666740224[shape=rectangle, label=\"B228\"];\nn25051272927248384[shape=rectangle, label=\"B229\"];\nn25895697857380352[shape=rectangle, label=\"B230\"];\nn65020719620161536[shape=rectangle, label=\"B231\"];\nn64739244643450880[shape=rectangle, label=\"B232\"];\nn65302194596872192[shape=rectangle, label=\"B233\"];\nn65583669573582848[shape=rectangle, label=\"B234\"];\nn66146619527004160[shape=rectangle, label=\"B235\"];\nn65865144550293504[shape=rectangle, label=\"B236\"];\nn66428094503714816[shape=rectangle, label=\"B237\"];\nn66991044457136128[shape=rectangle, label=\"B238\"];\nn66709569480425472[shape=rectangle, label=\"B239\"];\nn67272519433846784[shape=rectangle, label=\"B240\"];\nn67835469387268096[shape=rectangle, label=\"B241\"];\nn67553994410557440[shape=rectangle, label=\"B242\"];\nn68116944363978752[shape=rectangle, label=\"B243\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n844424930131968;\nn844424930131968 -> n1407374883553280;\nn844424930131968 -> n1688849860263936;\nn1688849860263936 -> n3377699720527872;\nn3377699720527872 -> n1970324836974592;\nn3377699720527872 -> n2251799813685248;\nn2251799813685248 -> n1970324836974592;\nn1970324836974592 -> n1407374883553280;\nn1970324836974592 -> n2533274790395904;\nn2533274790395904 -> n2814749767106560;\nn2533274790395904 -> n3096224743817216;\nn3096224743817216 -> n2814749767106560;\nn2814749767106560 -> n3377699720527872;\nn2814749767106560 -> n1407374883553280;\nn1407374883553280 -> n3659174697238528;\nn1407374883553280 -> n3940649673949184;\nn3940649673949184 -> n3659174697238528;\nn3659174697238528 -> n4222124650659840;\nn3659174697238528 -> n4503599627370496;\nn4503599627370496 -> n4222124650659840;\nn4222124650659840 -> n4785074604081152;\nn4222124650659840 -> n5066549580791808;\nn5066549580791808 -> n43910096366862336;\nn43910096366862336 -> n5348024557502464;\nn43910096366862336 -> n5629499534213120;\nn5629499534213120 -> n5348024557502464;\nn5348024557502464 -> n5910974510923776;\nn5348024557502464 -> n6192449487634432;\nn6192449487634432 -> n5910974510923776;\nn5910974510923776 -> n6473924464345088;\nn5910974510923776 -> n6755399441055744;\nn6755399441055744 -> n6473924464345088;\nn6473924464345088 -> n7036874417766400;\nn6473924464345088 -> n7318349394477056;\nn7318349394477056 -> n7036874417766400;\nn7036874417766400 -> n7599824371187712;\nn7036874417766400 -> n7881299347898368;\nn7881299347898368 -> n7599824371187712;\nn7599824371187712 -> n8162774324609024;\nn7599824371187712 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n8725724278030336;\nn8162774324609024 -> n9007199254740992;\nn9007199254740992 -> n9288674231451648;\nn9007199254740992 -> n9570149208162304;\nn9570149208162304 -> n9288674231451648;\nn9288674231451648 -> n8725724278030336;\nn9288674231451648 -> n9851624184872960;\nn9851624184872960 -> n8725724278030336;\nn8725724278030336 -> n10133099161583616;\nn8725724278030336 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10414574138294272 -> n10977524091715584;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n10133099161583616;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n10133099161583616;\nn10133099161583616 -> n11540474045136896;\nn10133099161583616 -> n11821949021847552;\nn11821949021847552 -> n11540474045136896;\nn11540474045136896 -> n12103423998558208;\nn11540474045136896 -> n12384898975268864;\nn12384898975268864 -> n23080948090273792;\nn23080948090273792 -> n12666373951979520;\nn23080948090273792 -> n12947848928690176;\nn12947848928690176 -> n12666373951979520;\nn12666373951979520 -> n13229323905400832;\nn12666373951979520 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n14636698788954112;\nn14636698788954112 -> n14918173765664768;\nn14636698788954112 -> n15199648742375424;\nn15199648742375424 -> n14918173765664768;\nn14918173765664768 -> n15481123719086080;\nn14918173765664768 -> n15762598695796736;\nn15762598695796736 -> n15481123719086080;\nn15481123719086080 -> n16044073672507392;\nn15481123719086080 -> n16325548649218048;\nn16325548649218048 -> n16044073672507392;\nn16044073672507392 -> n16607023625928704;\nn16044073672507392 -> n16888498602639360;\nn16888498602639360 -> n21673573206720512;\nn21673573206720512 -> n17169973579350016;\nn21673573206720512 -> n17451448556060672;\nn17451448556060672 -> n17169973579350016;\nn17169973579350016 -> n17732923532771328;\nn17169973579350016 -> n18014398509481984;\nn18014398509481984 -> n18295873486192640;\nn17732923532771328 -> n18295873486192640;\nn18295873486192640 -> n18577348462903296;\nn18295873486192640 -> n18858823439613952;\nn18858823439613952 -> n18577348462903296;\nn18577348462903296 -> n19140298416324608;\nn18577348462903296 -> n19421773393035264;\nn19421773393035264 -> n19703248369745920;\nn19421773393035264 -> n19984723346456576;\nn19984723346456576 -> n19140298416324608;\nn19984723346456576 -> n20266198323167232;\nn20266198323167232 -> n19984723346456576;\nn20266198323167232 -> n19703248369745920;\nn19703248369745920 -> n20547673299877888;\nn19703248369745920 -> n20829148276588544;\nn20829148276588544 -> n19140298416324608;\nn20829148276588544 -> n20547673299877888;\nn20547673299877888 -> n19140298416324608;\nn19140298416324608 -> n21110623253299200;\nn19140298416324608 -> n21392098230009856;\nn21392098230009856 -> n21110623253299200;\nn21110623253299200 -> n21673573206720512;\nn21110623253299200 -> n16607023625928704;\nn16607023625928704 -> n21955048183431168;\nn16607023625928704 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn21955048183431168 -> n14355223812243456;\nn14355223812243456 -> n22517998136852480;\nn14355223812243456 -> n22799473113563136;\nn22799473113563136 -> n22517998136852480;\nn22517998136852480 -> n23080948090273792;\nn22517998136852480 -> n12103423998558208;\nn12103423998558208 -> n23362423066984448;\nn12103423998558208 -> n23643898043695104;\nn23643898043695104 -> n43628621390151680;\nn43628621390151680 -> n23925373020405760;\nn43628621390151680 -> n24206847997116416;\nn24206847997116416 -> n23925373020405760;\nn23925373020405760 -> n24488322973827072;\nn23925373020405760 -> n24769797950537728;\nn24769797950537728 -> n25051272927248384;\nn24769797950537728 -> n25332747903959040;\nn25332747903959040 -> n25051272927248384;\nn25332747903959040 -> n25614222880669696;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n26177172834091008;\nn26177172834091008 -> n25895697857380352;\nn26177172834091008 -> n26458647810801664;\nn26458647810801664 -> n26740122787512320;\nn26458647810801664 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn26740122787512320 -> n27303072740933632;\nn26740122787512320 -> n27584547717644288;\nn27584547717644288 -> n27866022694354944;\nn27584547717644288 -> n28147497671065600;\nn28147497671065600 -> n28428972647776256;\nn28147497671065600 -> n28710447624486912;\nn28710447624486912 -> n28428972647776256;\nn28428972647776256 -> n27866022694354944;\nn28428972647776256 -> n28991922601197568;\nn28991922601197568 -> n29273397577908224;\nn28991922601197568 -> n29554872554618880;\nn29554872554618880 -> n29273397577908224;\nn29273397577908224 -> n29836347531329536;\nn29273397577908224 -> n30117822508040192;\nn30117822508040192 -> n29836347531329536;\nn30117822508040192 -> n30399297484750848;\nn30399297484750848 -> n29836347531329536;\nn30399297484750848 -> n30680772461461504;\nn30680772461461504 -> n29836347531329536;\nn30680772461461504 -> n30962247438172160;\nn30962247438172160 -> n29836347531329536;\nn30962247438172160 -> n31243722414882816;\nn31243722414882816 -> n27866022694354944;\nn31243722414882816 -> n29836347531329536;\nn29836347531329536 -> n27866022694354944;\nn29836347531329536 -> n31525197391593472;\nn31525197391593472 -> n31806672368304128;\nn31525197391593472 -> n32088147345014784;\nn32088147345014784 -> n31806672368304128;\nn31806672368304128 -> n32369622321725440;\nn31806672368304128 -> n32651097298436096;\nn32651097298436096 -> n32369622321725440;\nn32369622321725440 -> n32932572275146752;\nn32369622321725440 -> n33214047251857408;\nn33214047251857408 -> n32932572275146752;\nn32932572275146752 -> n33495522228568064;\nn32932572275146752 -> n33776997205278720;\nn33776997205278720 -> n33495522228568064;\nn33495522228568064 -> n34058472181989376;\nn33495522228568064 -> n34339947158700032;\nn34339947158700032 -> n34058472181989376;\nn34058472181989376 -> n27866022694354944;\nn34058472181989376 -> n34621422135410688;\nn34621422135410688 -> n27866022694354944;\nn27866022694354944 -> n34902897112121344;\nn27866022694354944 -> n35184372088832000;\nn35184372088832000 -> n35465847065542656;\nn35184372088832000 -> n35747322042253312;\nn35747322042253312 -> n35465847065542656;\nn35465847065542656 -> n34902897112121344;\nn35465847065542656 -> n36028797018963968;\nn36028797018963968 -> n36310271995674624;\nn36028797018963968 -> n36591746972385280;\nn36591746972385280 -> n36310271995674624;\nn36310271995674624 -> n27303072740933632;\nn36310271995674624 -> n36873221949095936;\nn36873221949095936 -> n27303072740933632;\nn36873221949095936 -> n37154696925806592;\nn37154696925806592 -> n27303072740933632;\nn37154696925806592 -> n37436171902517248;\nn37436171902517248 -> n27303072740933632;\nn37436171902517248 -> n37717646879227904;\nn37717646879227904 -> n27303072740933632;\nn37717646879227904 -> n37999121855938560;\nn37999121855938560 -> n27303072740933632;\nn37999121855938560 -> n34902897112121344;\nn34902897112121344 -> n38280596832649216;\nn34902897112121344 -> n38562071809359872;\nn38562071809359872 -> n38280596832649216;\nn38280596832649216 -> n38843546786070528;\nn38280596832649216 -> n39125021762781184;\nn39125021762781184 -> n39406496739491840;\nn39125021762781184 -> n39687971716202496;\nn39687971716202496 -> n39406496739491840;\nn39406496739491840 -> n39969446692913152;\nn39406496739491840 -> n40250921669623808;\nn40250921669623808 -> n39969446692913152;\nn39969446692913152 -> n40532396646334464;\nn39969446692913152 -> n40813871623045120;\nn40813871623045120 -> n40532396646334464;\nn40532396646334464 -> n27303072740933632;\nn40532396646334464 -> n38843546786070528;\nn38843546786070528 -> n27303072740933632;\nn38843546786070528 -> n41095346599755776;\nn41095346599755776 -> n27303072740933632;\nn27303072740933632 -> n41376821576466432;\nn27303072740933632 -> n41658296553177088;\nn41658296553177088 -> n41376821576466432;\nn41376821576466432 -> n24488322973827072;\nn41376821576466432 -> n41939771529887744;\nn41939771529887744 -> n42221246506598400;\nn41939771529887744 -> n42502721483309056;\nn42502721483309056 -> n42221246506598400;\nn42221246506598400 -> n42784196460019712;\nn42221246506598400 -> n43065671436730368;\nn43065671436730368 -> n42784196460019712;\nn42784196460019712 -> n24488322973827072;\nn42784196460019712 -> n43347146413441024;\nn43347146413441024 -> n68398419340689408;\nn68398419340689408 -> n24488322973827072;\nn24488322973827072 -> n43628621390151680;\nn24488322973827072 -> n23362423066984448;\nn23362423066984448 -> n43910096366862336;\nn23362423066984448 -> n44191571343572992;\nn44191571343572992 -> n4785074604081152;\nn13229323905400832 -> n14355223812243456;\nn13229323905400832 -> n44473046320283648;\nn44473046320283648 -> n44754521296994304;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn45035996273704960 -> n45598946227126272;\nn45598946227126272 -> n45317471250415616;\nn45317471250415616 -> n44754521296994304;\nn45317471250415616 -> n45880421203836928;\nn45880421203836928 -> n46161896180547584;\nn45880421203836928 -> n46443371157258240;\nn46443371157258240 -> n46161896180547584;\nn46161896180547584 -> n46724846133968896;\nn46161896180547584 -> n47006321110679552;\nn47006321110679552 -> n46724846133968896;\nn46724846133968896 -> n14355223812243456;\nn46724846133968896 -> n44754521296994304;\nn44754521296994304 -> n47287796087390208;\nn44754521296994304 -> n47569271064100864;\nn47569271064100864 -> n47287796087390208;\nn47287796087390208 -> n47850746040811520;\nn47287796087390208 -> n48132221017522176;\nn48132221017522176 -> n47850746040811520;\nn47850746040811520 -> n48413695994232832;\nn47850746040811520 -> n48695170970943488;\nn48695170970943488 -> n48413695994232832;\nn48413695994232832 -> n48976645947654144;\nn48413695994232832 -> n49258120924364800;\nn49258120924364800 -> n49539595901075456;\nn49258120924364800 -> n49821070877786112;\nn49821070877786112 -> n49539595901075456;\nn49539595901075456 -> n50102545854496768;\nn49539595901075456 -> n50384020831207424;\nn50384020831207424 -> n50102545854496768;\nn50102545854496768 -> n50665495807918080;\nn50102545854496768 -> n48976645947654144;\nn48976645947654144 -> n50665495807918080;\nn50665495807918080 -> n50946970784628736;\nn50665495807918080 -> n51228445761339392;\nn51228445761339392 -> n50946970784628736;\nn50946970784628736 -> n51509920738050048;\nn50946970784628736 -> n51791395714760704;\nn51791395714760704 -> n51509920738050048;\nn51509920738050048 -> n52072870691471360;\nn51509920738050048 -> n52354345668182016;\nn52354345668182016 -> n52072870691471360;\nn52072870691471360 -> n52635820644892672;\nn52072870691471360 -> n52917295621603328;\nn52917295621603328 -> n52635820644892672;\nn52635820644892672 -> n53198770598313984;\nn52635820644892672 -> n53480245575024640;\nn53480245575024640 -> n53198770598313984;\nn53198770598313984 -> n53761720551735296;\nn53198770598313984 -> n54043195528445952;\nn54043195528445952 -> n54324670505156608;\nn54043195528445952 -> n54606145481867264;\nn54606145481867264 -> n54324670505156608;\nn54324670505156608 -> n54887620458577920;\nn54324670505156608 -> n55169095435288576;\nn55169095435288576 -> n54887620458577920;\nn54887620458577920 -> n55450570411999232;\nn54887620458577920 -> n53761720551735296;\nn53761720551735296 -> n55450570411999232;\nn55450570411999232 -> n55732045388709888;\nn55450570411999232 -> n56013520365420544;\nn56013520365420544 -> n55732045388709888;\nn55732045388709888 -> n56294995342131200;\nn55732045388709888 -> n56576470318841856;\nn56576470318841856 -> n56294995342131200;\nn56294995342131200 -> n56857945295552512;\nn56294995342131200 -> n57139420272263168;\nn57139420272263168 -> n56857945295552512;\nn56857945295552512 -> n57420895248973824;\nn56857945295552512 -> n57702370225684480;\nn57702370225684480 -> n57420895248973824;\nn57420895248973824 -> n57983845202395136;\nn57420895248973824 -> n58265320179105792;\nn58265320179105792 -> n57983845202395136;\nn57983845202395136 -> n58546795155816448;\nn57983845202395136 -> n58828270132527104;\nn58828270132527104 -> n58546795155816448;\nn58546795155816448 -> n59109745109237760;\nn58546795155816448 -> n59391220085948416;\nn59391220085948416 -> n59109745109237760;\nn59109745109237760 -> n59672695062659072;\nn59109745109237760 -> n59954170039369728;\nn59954170039369728 -> n60235645016080384;\nn59954170039369728 -> n60517119992791040;\nn60517119992791040 -> n60235645016080384;\nn60235645016080384 -> n60798594969501696;\nn60235645016080384 -> n61080069946212352;\nn61080069946212352 -> n60798594969501696;\nn60798594969501696 -> n61361544922923008;\nn60798594969501696 -> n59672695062659072;\nn59672695062659072 -> n61361544922923008;\nn61361544922923008 -> n61643019899633664;\nn61361544922923008 -> n61924494876344320;\nn61924494876344320 -> n61643019899633664;\nn61643019899633664 -> n62205969853054976;\nn61643019899633664 -> n62487444829765632;\nn62487444829765632 -> n62205969853054976;\nn62205969853054976 -> n62768919806476288;\nn62205969853054976 -> n63050394783186944;\nn63050394783186944 -> n63613344736608256;\nn63613344736608256 -> n13792273858822144;\nn63613344736608256 -> n63331869759897600;\nn63331869759897600 -> n63613344736608256;\nn63331869759897600 -> n62768919806476288;\nn62768919806476288 -> n63894819713318912;\nn62768919806476288 -> n64176294690029568;\nn64176294690029568 -> n14355223812243456;\nn64176294690029568 -> n63894819713318912;\nn63894819713318912 -> n13792273858822144;\nn13792273858822144 -> n14355223812243456;\nn13792273858822144 -> n64457769666740224;\nn64457769666740224 -> n14355223812243456;\nn25051272927248384 -> n25895697857380352;\nn25895697857380352 -> n64739244643450880;\nn25895697857380352 -> n65020719620161536;\nn65020719620161536 -> n64739244643450880;\nn64739244643450880 -> n26458647810801664;\nn64739244643450880 -> n65302194596872192;\nn65302194596872192 -> n24488322973827072;\nn65302194596872192 -> n65583669573582848;\nn65583669573582848 -> n65865144550293504;\nn65583669573582848 -> n66146619527004160;\nn66146619527004160 -> n65865144550293504;\nn65865144550293504 -> n24488322973827072;\nn65865144550293504 -> n66428094503714816;\nn66428094503714816 -> n66709569480425472;\nn66428094503714816 -> n66991044457136128;\nn66991044457136128 -> n66709569480425472;\nn66709569480425472 -> n24488322973827072;\nn66709569480425472 -> n67272519433846784;\nn67272519433846784 -> n67553994410557440;\nn67272519433846784 -> n67835469387268096;\nn67835469387268096 -> n67553994410557440;\nn67553994410557440 -> n24488322973827072;\nn67553994410557440 -> n68116944363978752;\nn68116944363978752 -> n68398419340689408;\nn281474976710656 -> n0[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\nn3377699720527872 -> n1688849860263936[style=dotted];\nn1970324836974592 -> n3377699720527872[style=dotted];\nn2814749767106560 -> n2533274790395904[style=dotted];\nn1407374883553280 -> n844424930131968[style=dotted];\nn3659174697238528 -> n1407374883553280[style=dotted];\nn4222124650659840 -> n3659174697238528[style=dotted];\nn43910096366862336 -> n5066549580791808[style=dotted];\nn5348024557502464 -> n43910096366862336[style=dotted];\nn5910974510923776 -> n5348024557502464[style=dotted];\nn6473924464345088 -> n5910974510923776[style=dotted];\nn7036874417766400 -> n6473924464345088[style=dotted];\nn7599824371187712 -> n7036874417766400[style=dotted];\nn8162774324609024 -> n7599824371187712[style=dotted];\nn9288674231451648 -> n9007199254740992[style=dotted];\nn8725724278030336 -> n8162774324609024[style=dotted];\nn10696049115004928 -> n10414574138294272[style=dotted];\nn10133099161583616 -> n8725724278030336[style=dotted];\nn11540474045136896 -> n10133099161583616[style=dotted];\nn23080948090273792 -> n12384898975268864[style=dotted];\nn12666373951979520 -> n23080948090273792[style=dotted];\nn14918173765664768 -> n14636698788954112[style=dotted];\nn15481123719086080 -> n14918173765664768[style=dotted];\nn16044073672507392 -> n15481123719086080[style=dotted];\nn21673573206720512 -> n16888498602639360[style=dotted];\nn17169973579350016 -> n21673573206720512[style=dotted];\nn18295873486192640 -> n17169973579350016[style=dotted];\nn18577348462903296 -> n18295873486192640[style=dotted];\nn19984723346456576 -> n19421773393035264[style=dotted];\nn19703248369745920 -> n19421773393035264[style=dotted];\nn20547673299877888 -> n19703248369745920[style=dotted];\nn19140298416324608 -> n18577348462903296[style=dotted];\nn21110623253299200 -> n19140298416324608[style=dotted];\nn16607023625928704 -> n16044073672507392[style=dotted];\nn21955048183431168 -> n16607023625928704[style=dotted];\nn14355223812243456 -> n12666373951979520[style=dotted];\nn22517998136852480 -> n14355223812243456[style=dotted];\nn12103423998558208 -> n11540474045136896[style=dotted];\nn43628621390151680 -> n23643898043695104[style=dotted];\nn23925373020405760 -> n43628621390151680[style=dotted];\nn26458647810801664 -> n24769797950537728[style=dotted];\nn26740122787512320 -> n26458647810801664[style=dotted];\nn28428972647776256 -> n28147497671065600[style=dotted];\nn29273397577908224 -> n28991922601197568[style=dotted];\nn29836347531329536 -> n29273397577908224[style=dotted];\nn31806672368304128 -> n31525197391593472[style=dotted];\nn32369622321725440 -> n31806672368304128[style=dotted];\nn32932572275146752 -> n32369622321725440[style=dotted];\nn33495522228568064 -> n32932572275146752[style=dotted];\nn34058472181989376 -> n33495522228568064[style=dotted];\nn27866022694354944 -> n27584547717644288[style=dotted];\nn35465847065542656 -> n35184372088832000[style=dotted];\nn36310271995674624 -> n36028797018963968[style=dotted];\nn34902897112121344 -> n27866022694354944[style=dotted];\nn38280596832649216 -> n34902897112121344[style=dotted];\nn39406496739491840 -> n39125021762781184[style=dotted];\nn39969446692913152 -> n39406496739491840[style=dotted];\nn40532396646334464 -> n39969446692913152[style=dotted];\nn38843546786070528 -> n38280596832649216[style=dotted];\nn27303072740933632 -> n26740122787512320[style=dotted];\nn41376821576466432 -> n27303072740933632[style=dotted];\nn42221246506598400 -> n41939771529887744[style=dotted];\nn42784196460019712 -> n42221246506598400[style=dotted];\nn68398419340689408 -> n24769797950537728[style=dotted];\nn24488322973827072 -> n23925373020405760[style=dotted];\nn23362423066984448 -> n12103423998558208[style=dotted];\nn4785074604081152 -> n4222124650659840[style=dotted];\nn45317471250415616 -> n45035996273704960[style=dotted];\nn46161896180547584 -> n45880421203836928[style=dotted];\nn46724846133968896 -> n46161896180547584[style=dotted];\nn44754521296994304 -> n44473046320283648[style=dotted];\nn47287796087390208 -> n44754521296994304[style=dotted];\nn47850746040811520 -> n47287796087390208[style=dotted];\nn48413695994232832 -> n47850746040811520[style=dotted];\nn49539595901075456 -> n49258120924364800[style=dotted];\nn50102545854496768 -> n49539595901075456[style=dotted];\nn48976645947654144 -> n48413695994232832[style=dotted];\nn50665495807918080 -> n48413695994232832[style=dotted];\nn50946970784628736 -> n50665495807918080[style=dotted];\nn51509920738050048 -> n50946970784628736[style=dotted];\nn52072870691471360 -> n51509920738050048[style=dotted];\nn52635820644892672 -> n52072870691471360[style=dotted];\nn53198770598313984 -> n52635820644892672[style=dotted];\nn54324670505156608 -> n54043195528445952[style=dotted];\nn54887620458577920 -> n54324670505156608[style=dotted];\nn53761720551735296 -> n53198770598313984[style=dotted];\nn55450570411999232 -> n53198770598313984[style=dotted];\nn55732045388709888 -> n55450570411999232[style=dotted];\nn56294995342131200 -> n55732045388709888[style=dotted];\nn56857945295552512 -> n56294995342131200[style=dotted];\nn57420895248973824 -> n56857945295552512[style=dotted];\nn57983845202395136 -> n57420895248973824[style=dotted];\nn58546795155816448 -> n57983845202395136[style=dotted];\nn59109745109237760 -> n58546795155816448[style=dotted];\nn60235645016080384 -> n59954170039369728[style=dotted];\nn60798594969501696 -> n60235645016080384[style=dotted];\nn59672695062659072 -> n59109745109237760[style=dotted];\nn61361544922923008 -> n59109745109237760[style=dotted];\nn61643019899633664 -> n61361544922923008[style=dotted];\nn62205969853054976 -> n61643019899633664[style=dotted];\nn63613344736608256 -> n63050394783186944[style=dotted];\nn62768919806476288 -> n62205969853054976[style=dotted];\nn63894819713318912 -> n62768919806476288[style=dotted];\nn13792273858822144 -> n12666373951979520[style=dotted];\nn25051272927248384 -> n24769797950537728[style=dotted];\nn25895697857380352 -> n24769797950537728[style=dotted];\nn64739244643450880 -> n25895697857380352[style=dotted];\nn65865144550293504 -> n65583669573582848[style=dotted];\nn66709569480425472 -> n66428094503714816[style=dotted];\nn67553994410557440 -> n67272519433846784[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-436.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn281474976710656[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1970324836974592[shape=rectangle, label=\"B5\"];\nn1688849860263936[shape=rectangle, label=\"B6\"];\nn2533274790395904[shape=rectangle, label=\"B7\"];\nn3096224743817216[shape=rectangle, label=\"B8\"];\nn46724846133968896[shape=rectangle, label=\"B9\"];\nn2814749767106560[shape=rectangle, label=\"B10\"];\nn3659174697238528[shape=rectangle, label=\"B11\"];\nn4222124650659840[shape=rectangle, label=\"B12\"];\nn4785074604081152[shape=rectangle, label=\"B13\"];\nn3377699720527872[shape=rectangle, label=\"B14\"];\nn5629499534213120[shape=rectangle, label=\"B15\"];\nn3940649673949184[shape=rectangle, label=\"B16\"];\nn6473924464345088[shape=rectangle, label=\"B17\"];\nn7036874417766400[shape=rectangle, label=\"B18\"];\nn7599824371187712[shape=rectangle, label=\"B19\"];\nn6755399441055744[shape=rectangle, label=\"B20\"];\nn7881299347898368[shape=rectangle, label=\"B21\"];\nn6192449487634432[shape=rectangle, label=\"B22\"];\nn86131342873460736[shape=rectangle, label=\"B23\"];\nn8444249301319680[shape=rectangle, label=\"B24\"];\nn9007199254740992[shape=rectangle, label=\"B25\"];\nn18014398509481984[shape=rectangle, label=\"B26\"];\nn9288674231451648[shape=rectangle, label=\"B27\"];\nn9570149208162304[shape=rectangle, label=\"B28\"];\nn4503599627370496[shape=rectangle, label=\"B29\"];\nn10133099161583616[shape=rectangle, label=\"B30\"];\nn10414574138294272[shape=rectangle, label=\"B31\"];\nn10977524091715584[shape=rectangle, label=\"B32\"];\nn10696049115004928[shape=rectangle, label=\"B33\"];\nn11540474045136896[shape=rectangle, label=\"B34\"];\nn11821949021847552[shape=rectangle, label=\"B35\"];\nn12103423998558208[shape=rectangle, label=\"B36\"];\nn12384898975268864[shape=rectangle, label=\"B37\"];\nn12666373951979520[shape=rectangle, label=\"B38\"];\nn11258999068426240[shape=rectangle, label=\"B39\"];\nn12947848928690176[shape=rectangle, label=\"B40\"];\nn13229323905400832[shape=rectangle, label=\"B41\"];\nn13510798882111488[shape=rectangle, label=\"B42\"];\nn8162774324609024[shape=rectangle, label=\"B43\"];\nn9851624184872960[shape=rectangle, label=\"B44\"];\nn13792273858822144[shape=rectangle, label=\"B45\"];\nn14355223812243456[shape=rectangle, label=\"B46\"];\nn90916417477541888[shape=rectangle, label=\"B47\"];\nn14636698788954112[shape=rectangle, label=\"B48\"];\nn14918173765664768[shape=rectangle, label=\"B49\"];\nn5348024557502464[shape=rectangle, label=\"B50\"];\nn15481123719086080[shape=rectangle, label=\"B51\"];\nn8725724278030336[shape=rectangle, label=\"B52\"];\nn16044073672507392[shape=rectangle, label=\"B53\"];\nn16325548649218048[shape=rectangle, label=\"B54\"];\nn16607023625928704[shape=rectangle, label=\"B55\"];\nn17169973579350016[shape=rectangle, label=\"B56\"];\nn16888498602639360[shape=rectangle, label=\"B57\"];\nn17451448556060672[shape=rectangle, label=\"B58\"];\nn17732923532771328[shape=rectangle, label=\"B59\"];\nn18295873486192640[shape=rectangle, label=\"B60\"];\nn14073748835532800[shape=rectangle, label=\"B61\"];\nn18577348462903296[shape=rectangle, label=\"B62\"];\nn18858823439613952[shape=rectangle, label=\"B63\"];\nn19140298416324608[shape=rectangle, label=\"B64\"];\nn19703248369745920[shape=rectangle, label=\"B65\"];\nn15199648742375424[shape=rectangle, label=\"B66\"];\nn20547673299877888[shape=rectangle, label=\"B67\"];\nn20266198323167232[shape=rectangle, label=\"B68\"];\nn20829148276588544[shape=rectangle, label=\"B69\"];\nn21110623253299200[shape=rectangle, label=\"B70\"];\nn15762598695796736[shape=rectangle, label=\"B71\"];\nn21392098230009856[shape=rectangle, label=\"B72\"];\nn5910974510923776[shape=rectangle, label=\"B73\"];\nn21955048183431168[shape=rectangle, label=\"B74\"];\nn22517998136852480[shape=rectangle, label=\"B75\"];\nn23080948090273792[shape=rectangle, label=\"B76\"];\nn22236523160141824[shape=rectangle, label=\"B77\"];\nn84161018036486144[shape=rectangle, label=\"B78\"];\nn23362423066984448[shape=rectangle, label=\"B79\"];\nn23643898043695104[shape=rectangle, label=\"B80\"];\nn21673573206720512[shape=rectangle, label=\"B81\"];\nn23925373020405760[shape=rectangle, label=\"B82\"];\nn24206847997116416[shape=rectangle, label=\"B83\"];\nn24769797950537728[shape=rectangle, label=\"B84\"];\nn25332747903959040[shape=rectangle, label=\"B85\"];\nn24488322973827072[shape=rectangle, label=\"B86\"];\nn93731167244648448[shape=rectangle, label=\"B87\"];\nn25614222880669696[shape=rectangle, label=\"B88\"];\nn5066549580791808[shape=rectangle, label=\"B89\"];\nn26177172834091008[shape=rectangle, label=\"B90\"];\nn26740122787512320[shape=rectangle, label=\"B91\"];\nn27303072740933632[shape=rectangle, label=\"B92\"];\nn27021597764222976[shape=rectangle, label=\"B93\"];\nn28147497671065600[shape=rectangle, label=\"B94\"];\nn28428972647776256[shape=rectangle, label=\"B95\"];\nn28991922601197568[shape=rectangle, label=\"B96\"];\nn27866022694354944[shape=rectangle, label=\"B97\"];\nn29554872554618880[shape=rectangle, label=\"B98\"];\nn30117822508040192[shape=rectangle, label=\"B99\"];\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn30680772461461504[shape=rectangle, label=\"B101\"];\nn29273397577908224[shape=rectangle, label=\"B102\"];\nn30962247438172160[shape=rectangle, label=\"B103\"];\nn31243722414882816[shape=rectangle, label=\"B104\"];\nn31525197391593472[shape=rectangle, label=\"B105\"];\nn29836347531329536[shape=rectangle, label=\"B106\"];\nn31806672368304128[shape=rectangle, label=\"B107\"];\nn30399297484750848[shape=rectangle, label=\"B108\"];\nn32088147345014784[shape=rectangle, label=\"B109\"];\nn32369622321725440[shape=rectangle, label=\"B110\"];\nn32651097298436096[shape=rectangle, label=\"B111\"];\nn25895697857380352[shape=rectangle, label=\"B112\"];\nn33214047251857408[shape=rectangle, label=\"B113\"];\nn33776997205278720[shape=rectangle, label=\"B114\"];\nn33495522228568064[shape=rectangle, label=\"B115\"];\nn34621422135410688[shape=rectangle, label=\"B116\"];\nn34902897112121344[shape=rectangle, label=\"B117\"];\nn35465847065542656[shape=rectangle, label=\"B118\"];\nn34339947158700032[shape=rectangle, label=\"B119\"];\nn36028797018963968[shape=rectangle, label=\"B120\"];\nn36591746972385280[shape=rectangle, label=\"B121\"];\nn35184372088832000[shape=rectangle, label=\"B122\"];\nn37154696925806592[shape=rectangle, label=\"B123\"];\nn35747322042253312[shape=rectangle, label=\"B124\"];\nn37436171902517248[shape=rectangle, label=\"B125\"];\nn37717646879227904[shape=rectangle, label=\"B126\"];\nn37999121855938560[shape=rectangle, label=\"B127\"];\nn36310271995674624[shape=rectangle, label=\"B128\"];\nn38280596832649216[shape=rectangle, label=\"B129\"];\nn36873221949095936[shape=rectangle, label=\"B130\"];\nn38562071809359872[shape=rectangle, label=\"B131\"];\nn38843546786070528[shape=rectangle, label=\"B132\"];\nn39125021762781184[shape=rectangle, label=\"B133\"];\nn26458647810801664[shape=rectangle, label=\"B134\"];\nn39687971716202496[shape=rectangle, label=\"B135\"];\nn27584547717644288[shape=rectangle, label=\"B136\"];\nn39406496739491840[shape=rectangle, label=\"B137\"];\nn40532396646334464[shape=rectangle, label=\"B138\"];\nn40250921669623808[shape=rectangle, label=\"B139\"];\nn41095346599755776[shape=rectangle, label=\"B140\"];\nn41376821576466432[shape=rectangle, label=\"B141\"];\nn40813871623045120[shape=rectangle, label=\"B142\"];\nn41939771529887744[shape=rectangle, label=\"B143\"];\nn42221246506598400[shape=rectangle, label=\"B144\"];\nn42784196460019712[shape=rectangle, label=\"B145\"];\nn41658296553177088[shape=rectangle, label=\"B146\"];\nn43347146413441024[shape=rectangle, label=\"B147\"];\nn43910096366862336[shape=rectangle, label=\"B148\"];\nn42502721483309056[shape=rectangle, label=\"B149\"];\nn44473046320283648[shape=rectangle, label=\"B150\"];\nn43065671436730368[shape=rectangle, label=\"B151\"];\nn44754521296994304[shape=rectangle, label=\"B152\"];\nn45035996273704960[shape=rectangle, label=\"B153\"];\nn45317471250415616[shape=rectangle, label=\"B154\"];\nn43628621390151680[shape=rectangle, label=\"B155\"];\nn45598946227126272[shape=rectangle, label=\"B156\"];\nn44191571343572992[shape=rectangle, label=\"B157\"];\nn45880421203836928[shape=rectangle, label=\"B158\"];\nn46161896180547584[shape=rectangle, label=\"B159\"];\nn46443371157258240[shape=rectangle, label=\"B160\"];\nn39969446692913152[shape=rectangle, label=\"B161\"];\nn47006321110679552[shape=rectangle, label=\"B162\"];\nn47287796087390208[shape=rectangle, label=\"B163\"];\nn47569271064100864[shape=rectangle, label=\"B164\"];\nn47850746040811520[shape=rectangle, label=\"B165\"];\nn32932572275146752[shape=rectangle, label=\"B166\"];\nn48413695994232832[shape=rectangle, label=\"B167\"];\nn34058472181989376[shape=rectangle, label=\"B168\"];\nn48132221017522176[shape=rectangle, label=\"B169\"];\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn48976645947654144[shape=rectangle, label=\"B171\"];\nn49821070877786112[shape=rectangle, label=\"B172\"];\nn50102545854496768[shape=rectangle, label=\"B173\"];\nn49539595901075456[shape=rectangle, label=\"B174\"];\nn50665495807918080[shape=rectangle, label=\"B175\"];\nn50946970784628736[shape=rectangle, label=\"B176\"];\nn51509920738050048[shape=rectangle, label=\"B177\"];\nn50384020831207424[shape=rectangle, label=\"B178\"];\nn52072870691471360[shape=rectangle, label=\"B179\"];\nn52635820644892672[shape=rectangle, label=\"B180\"];\nn51228445761339392[shape=rectangle, label=\"B181\"];\nn53198770598313984[shape=rectangle, label=\"B182\"];\nn51791395714760704[shape=rectangle, label=\"B183\"];\nn53480245575024640[shape=rectangle, label=\"B184\"];\nn53761720551735296[shape=rectangle, label=\"B185\"];\nn54043195528445952[shape=rectangle, label=\"B186\"];\nn52354345668182016[shape=rectangle, label=\"B187\"];\nn54324670505156608[shape=rectangle, label=\"B188\"];\nn52917295621603328[shape=rectangle, label=\"B189\"];\nn54606145481867264[shape=rectangle, label=\"B190\"];\nn54887620458577920[shape=rectangle, label=\"B191\"];\nn55169095435288576[shape=rectangle, label=\"B192\"];\nn48695170970943488[shape=rectangle, label=\"B193\"];\nn55732045388709888[shape=rectangle, label=\"B194\"];\nn56013520365420544[shape=rectangle, label=\"B195\"];\nn56294995342131200[shape=rectangle, label=\"B196\"];\nn55450570411999232[shape=rectangle, label=\"B197\"];\nn56857945295552512[shape=rectangle, label=\"B198\"];\nn57420895248973824[shape=rectangle, label=\"B199\"];\nn57139420272263168[shape=rectangle, label=\"B200\"];\nn58265320179105792[shape=rectangle, label=\"B201\"];\nn58546795155816448[shape=rectangle, label=\"B202\"];\nn59109745109237760[shape=rectangle, label=\"B203\"];\nn57983845202395136[shape=rectangle, label=\"B204\"];\nn59672695062659072[shape=rectangle, label=\"B205\"];\nn60235645016080384[shape=rectangle, label=\"B206\"];\nn58828270132527104[shape=rectangle, label=\"B207\"];\nn60798594969501696[shape=rectangle, label=\"B208\"];\nn59391220085948416[shape=rectangle, label=\"B209\"];\nn61080069946212352[shape=rectangle, label=\"B210\"];\nn61361544922923008[shape=rectangle, label=\"B211\"];\nn61643019899633664[shape=rectangle, label=\"B212\"];\nn59954170039369728[shape=rectangle, label=\"B213\"];\nn61924494876344320[shape=rectangle, label=\"B214\"];\nn60517119992791040[shape=rectangle, label=\"B215\"];\nn62205969853054976[shape=rectangle, label=\"B216\"];\nn62487444829765632[shape=rectangle, label=\"B217\"];\nn62768919806476288[shape=rectangle, label=\"B218\"];\nn56576470318841856[shape=rectangle, label=\"B219\"];\nn63331869759897600[shape=rectangle, label=\"B220\"];\nn57702370225684480[shape=rectangle, label=\"B221\"];\nn63613344736608256[shape=rectangle, label=\"B222\"];\nn64176294690029568[shape=rectangle, label=\"B223\"];\nn64457769666740224[shape=rectangle, label=\"B224\"];\nn63894819713318912[shape=rectangle, label=\"B225\"];\nn65020719620161536[shape=rectangle, label=\"B226\"];\nn65583669573582848[shape=rectangle, label=\"B227\"];\nn66146619527004160[shape=rectangle, label=\"B228\"];\nn66709569480425472[shape=rectangle, label=\"B229\"];\nn67272519433846784[shape=rectangle, label=\"B230\"];\nn67835469387268096[shape=rectangle, label=\"B231\"];\nn66991044457136128[shape=rectangle, label=\"B232\"];\nn87538717757014016[shape=rectangle, label=\"B233\"];\nn68116944363978752[shape=rectangle, label=\"B234\"];\nn68398419340689408[shape=rectangle, label=\"B235\"];\nn68679894317400064[shape=rectangle, label=\"B236\"];\nn63050394783186944[shape=rectangle, label=\"B237\"];\nn69242844270821376[shape=rectangle, label=\"B238\"];\nn69524319247532032[shape=rectangle, label=\"B239\"];\nn68961369294110720[shape=rectangle, label=\"B240\"];\nn70087269200953344[shape=rectangle, label=\"B241\"];\nn70368744177664000[shape=rectangle, label=\"B242\"];\nn70931694131085312[shape=rectangle, label=\"B243\"];\nn69805794224242688[shape=rectangle, label=\"B244\"];\nn71494644084506624[shape=rectangle, label=\"B245\"];\nn72057594037927936[shape=rectangle, label=\"B246\"];\nn70650219154374656[shape=rectangle, label=\"B247\"];\nn72620543991349248[shape=rectangle, label=\"B248\"];\nn71213169107795968[shape=rectangle, label=\"B249\"];\nn72902018968059904[shape=rectangle, label=\"B250\"];\nn73183493944770560[shape=rectangle, label=\"B251\"];\nn73464968921481216[shape=rectangle, label=\"B252\"];\nn71776119061217280[shape=rectangle, label=\"B253\"];\nn73746443898191872[shape=rectangle, label=\"B254\"];\nn72339069014638592[shape=rectangle, label=\"B255\"];\nn74027918874902528[shape=rectangle, label=\"B256\"];\nn74309393851613184[shape=rectangle, label=\"B257\"];\nn74590868828323840[shape=rectangle, label=\"B258\"];\nn64739244643450880[shape=rectangle, label=\"B259\"];\nn74872343805034496[shape=rectangle, label=\"B260\"];\nn75435293758455808[shape=rectangle, label=\"B261\"];\nn65302194596872192[shape=rectangle, label=\"B262\"];\nn75998243711877120[shape=rectangle, label=\"B263\"];\nn76561193665298432[shape=rectangle, label=\"B264\"];\nn77124143618719744[shape=rectangle, label=\"B265\"];\nn76279718688587776[shape=rectangle, label=\"B266\"];\nn89227567617277952[shape=rectangle, label=\"B267\"];\nn77405618595430400[shape=rectangle, label=\"B268\"];\nn77687093572141056[shape=rectangle, label=\"B269\"];\nn65865144550293504[shape=rectangle, label=\"B270\"];\nn77968568548851712[shape=rectangle, label=\"B271\"];\nn78250043525562368[shape=rectangle, label=\"B272\"];\nn78812993478983680[shape=rectangle, label=\"B273\"];\nn78531518502273024[shape=rectangle, label=\"B274\"];\nn79375943432404992[shape=rectangle, label=\"B275\"];\nn79938893385826304[shape=rectangle, label=\"B276\"];\nn79094468455694336[shape=rectangle, label=\"B277\"];\nn81627743246090240[shape=rectangle, label=\"B278\"];\nn80220368362536960[shape=rectangle, label=\"B279\"];\nn80501843339247616[shape=rectangle, label=\"B280\"];\nn79657418409115648[shape=rectangle, label=\"B281\"];\nn80783318315958272[shape=rectangle, label=\"B282\"];\nn81064793292668928[shape=rectangle, label=\"B283\"];\nn81346268269379584[shape=rectangle, label=\"B284\"];\nn75153818781745152[shape=rectangle, label=\"B285\"];\nn82190693199511552[shape=rectangle, label=\"B286\"];\nn81909218222800896[shape=rectangle, label=\"B287\"];\nn82753643152932864[shape=rectangle, label=\"B288\"];\nn22799473113563136[shape=rectangle, label=\"B289\"];\nn83316593106354176[shape=rectangle, label=\"B290\"];\nn83598068083064832[shape=rectangle, label=\"B291\"];\nn83879543059775488[shape=rectangle, label=\"B292\"];\nn25051272927248384[shape=rectangle, label=\"B293\"];\nn84723967989907456[shape=rectangle, label=\"B294\"];\nn7318349394477056[shape=rectangle, label=\"B295\"];\nn85286917943328768[shape=rectangle, label=\"B296\"];\nn85568392920039424[shape=rectangle, label=\"B297\"];\nn85849867896750080[shape=rectangle, label=\"B298\"];\nn67553994410557440[shape=rectangle, label=\"B299\"];\nn86694292826882048[shape=rectangle, label=\"B300\"];\nn97108866965176320[shape=rectangle, label=\"B301\"];\nn86975767803592704[shape=rectangle, label=\"B302\"];\nn87257242780303360[shape=rectangle, label=\"B303\"];\nn87820192733724672[shape=rectangle, label=\"B304\"];\nn76842668642009088[shape=rectangle, label=\"B305\"];\nn88383142687145984[shape=rectangle, label=\"B306\"];\nn98516241848729600[shape=rectangle, label=\"B307\"];\nn88664617663856640[shape=rectangle, label=\"B308\"];\nn88946092640567296[shape=rectangle, label=\"B309\"];\nn89509042593988608[shape=rectangle, label=\"B310\"];\nn19421773393035264[shape=rectangle, label=\"B311\"];\nn89790517570699264[shape=rectangle, label=\"B312\"];\nn90071992547409920[shape=rectangle, label=\"B313\"];\nn90353467524120576[shape=rectangle, label=\"B314\"];\nn90634942500831232[shape=rectangle, label=\"B315\"];\nn19984723346456576[shape=rectangle, label=\"B316\"];\nn91197892454252544[shape=rectangle, label=\"B317\"];\nn91479367430963200[shape=rectangle, label=\"B318\"];\nn91760842407673856[shape=rectangle, label=\"B319\"];\nn84442493013196800[shape=rectangle, label=\"B320\"];\nn92042317384384512[shape=rectangle, label=\"B321\"];\nn92323792361095168[shape=rectangle, label=\"B322\"];\nn92605267337805824[shape=rectangle, label=\"B323\"];\nn85005442966618112[shape=rectangle, label=\"B324\"];\nn93168217291227136[shape=rectangle, label=\"B325\"];\nn93449692267937792[shape=rectangle, label=\"B326\"];\nn94012642221359104[shape=rectangle, label=\"B327\"];\nn82472168176222208[shape=rectangle, label=\"B328\"];\nn94294117198069760[shape=rectangle, label=\"B329\"];\nn94575592174780416[shape=rectangle, label=\"B330\"];\nn94857067151491072[shape=rectangle, label=\"B331\"];\nn83035118129643520[shape=rectangle, label=\"B332\"];\nn95420017104912384[shape=rectangle, label=\"B333\"];\nn95701492081623040[shape=rectangle, label=\"B334\"];\nn95982967058333696[shape=rectangle, label=\"B335\"];\nn86412817850171392[shape=rectangle, label=\"B336\"];\nn96264442035044352[shape=rectangle, label=\"B337\"];\nn96545917011755008[shape=rectangle, label=\"B338\"];\nn96827391988465664[shape=rectangle, label=\"B339\"];\nn97390341941886976[shape=rectangle, label=\"B340\"];\nn88101667710435328[shape=rectangle, label=\"B341\"];\nn97671816918597632[shape=rectangle, label=\"B342\"];\nn97953291895308288[shape=rectangle, label=\"B343\"];\nn98234766872018944[shape=rectangle, label=\"B344\"];\nn98797716825440256[shape=rectangle, label=\"B345\"];\nn92886742314516480[shape=rectangle, label=\"B346\"];\nn95138542128201728[shape=rectangle, label=\"B347\"];\nn75716768735166464[shape=rectangle, label=\"B348\"];\nn99079191802150912[shape=rectangle, label=\"B349\"];\nn66428094503714816[shape=rectangle, label=\"B350\"];\nn99360666778861568[shape=rectangle, label=\"B351\"];\nn2251799813685248[shape=rectangle, label=\"B352\"];\nn99923616732282880[shape=rectangle, label=\"B353\"];\nn100486566685704192[shape=rectangle, label=\"B354\"];\nn100768041662414848[shape=rectangle, label=\"B355\"];\nn100205091708993536[shape=rectangle, label=\"B356\"];\nn101049516639125504[shape=rectangle, label=\"B357\"];\nn101330991615836160[shape=rectangle, label=\"B358\"];\nn99642141755572224[shape=rectangle, label=\"B359\"];\nn101893941569257472[shape=rectangle, label=\"B360\"];\nn101612466592546816[shape=rectangle, label=\"B361\"];\nn102456891522678784[shape=rectangle, label=\"B362\"];\nn102175416545968128[shape=rectangle, label=\"B363\"];\nn844424930131968[shape=rectangle, label=\"B364\"];\nn102738366499389440[shape=rectangle, label=\"B365\"];\nn103019841476100096[shape=rectangle, label=\"B366\"];\nn103582791429521408[shape=rectangle, label=\"B367\"];\nn103301316452810752[shape=rectangle, label=\"B368\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n844424930131968;\nn562949953421312 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn281474976710656 -> n1407374883553280;\nn1407374883553280 -> n1688849860263936;\nn1407374883553280 -> n1970324836974592;\nn1970324836974592 -> n1970324836974592[style=dashed];\nn1970324836974592 -> n1688849860263936;\nn1688849860263936 -> n2251799813685248;\nn1688849860263936 -> n2533274790395904;\nn2533274790395904 -> n2814749767106560;\nn3096224743817216 -> n46724846133968896;\nn46724846133968896 -> n2251799813685248;\nn46724846133968896 -> n2814749767106560;\nn2814749767106560 -> n3377699720527872;\nn2814749767106560 -> n3659174697238528;\nn3659174697238528 -> n3940649673949184;\nn3659174697238528 -> n4222124650659840;\nn4222124650659840 -> n4503599627370496;\nn4222124650659840 -> n4785074604081152;\nn4785074604081152 -> n5066549580791808;\nn3377699720527872 -> n5348024557502464;\nn3377699720527872 -> n5629499534213120;\nn5629499534213120 -> n5910974510923776;\nn3940649673949184 -> n6192449487634432;\nn3940649673949184 -> n6473924464345088;\nn6473924464345088 -> n6755399441055744;\nn6473924464345088 -> n7036874417766400;\nn7036874417766400 -> n7318349394477056;\nn7036874417766400 -> n7599824371187712;\nn7599824371187712 -> n7318349394477056;\nn7599824371187712 -> n6755399441055744;\nn6755399441055744 -> n7881299347898368;\nn7881299347898368 -> n7881299347898368[style=dashed];\nn7881299347898368 -> n6192449487634432;\nn6192449487634432 -> n86131342873460736;\nn86131342873460736 -> n8162774324609024;\nn86131342873460736 -> n8444249301319680;\nn8444249301319680 -> n8725724278030336;\nn8444249301319680 -> n9007199254740992;\nn9007199254740992 -> n18014398509481984;\nn18014398509481984 -> n9288674231451648;\nn9288674231451648 -> n9288674231451648[style=dashed];\nn9288674231451648 -> n9570149208162304;\nn9570149208162304 -> n9851624184872960;\nn4503599627370496 -> n5066549580791808;\nn4503599627370496 -> n10133099161583616;\nn10133099161583616 -> n5066549580791808;\nn10133099161583616 -> n10414574138294272;\nn10414574138294272 -> n10696049115004928;\nn10977524091715584 -> n5066549580791808;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n11258999068426240;\nn10696049115004928 -> n11540474045136896;\nn11540474045136896 -> n11258999068426240;\nn11540474045136896 -> n11821949021847552;\nn11821949021847552 -> n12103423998558208;\nn12103423998558208 -> n12103423998558208[style=dashed];\nn12103423998558208 -> n12384898975268864;\nn12384898975268864 -> n10977524091715584;\nn12384898975268864 -> n12666373951979520;\nn12666373951979520 -> n12947848928690176;\nn11258999068426240 -> n12947848928690176;\nn12947848928690176 -> n13229323905400832;\nn13229323905400832 -> n13229323905400832[style=dashed];\nn13229323905400832 -> n13510798882111488;\nn13510798882111488 -> n10977524091715584;\nn8162774324609024 -> n9851624184872960;\nn9851624184872960 -> n5066549580791808;\nn9851624184872960 -> n13792273858822144;\nn13792273858822144 -> n14073748835532800;\nn13792273858822144 -> n14355223812243456;\nn14355223812243456 -> n90916417477541888;\nn90916417477541888 -> n14636698788954112;\nn14636698788954112 -> n14636698788954112[style=dashed];\nn14636698788954112 -> n14918173765664768;\nn14918173765664768 -> n5066549580791808;\nn5348024557502464 -> n15199648742375424;\nn5348024557502464 -> n15481123719086080;\nn15481123719086080 -> n15762598695796736;\nn8725724278030336 -> n9007199254740992;\nn8725724278030336 -> n16044073672507392;\nn16044073672507392 -> n9007199254740992;\nn16044073672507392 -> n16325548649218048;\nn16325548649218048 -> n9007199254740992;\nn16325548649218048 -> n16607023625928704;\nn16607023625928704 -> n16888498602639360;\nn16607023625928704 -> n17169973579350016;\nn17169973579350016 -> n9007199254740992;\nn17169973579350016 -> n16888498602639360;\nn16888498602639360 -> n17451448556060672;\nn17451448556060672 -> n17451448556060672[style=dashed];\nn17451448556060672 -> n17732923532771328;\nn17732923532771328 -> n18014398509481984;\nn17732923532771328 -> n18295873486192640;\nn18295873486192640 -> n9851624184872960;\nn14073748835532800 -> n14355223812243456;\nn14073748835532800 -> n18577348462903296;\nn18577348462903296 -> n14355223812243456;\nn18577348462903296 -> n18858823439613952;\nn18858823439613952 -> n14355223812243456;\nn18858823439613952 -> n19140298416324608;\nn19140298416324608 -> n19421773393035264;\nn19140298416324608 -> n19703248369745920;\nn19703248369745920 -> n19984723346456576;\nn15199648742375424 -> n20266198323167232;\nn15199648742375424 -> n20547673299877888;\nn20547673299877888 -> n15762598695796736;\nn20547673299877888 -> n20266198323167232;\nn20266198323167232 -> n20829148276588544;\nn20829148276588544 -> n20829148276588544[style=dashed];\nn20829148276588544 -> n21110623253299200;\nn21110623253299200 -> n5910974510923776;\nn21110623253299200 -> n15762598695796736;\nn15762598695796736 -> n21392098230009856;\nn21392098230009856 -> n21392098230009856[style=dashed];\nn21392098230009856 -> n5910974510923776;\nn5910974510923776 -> n21673573206720512;\nn5910974510923776 -> n21955048183431168;\nn21955048183431168 -> n22236523160141824;\nn21955048183431168 -> n22517998136852480;\nn22517998136852480 -> n22799473113563136;\nn22517998136852480 -> n23080948090273792;\nn23080948090273792 -> n22799473113563136;\nn23080948090273792 -> n22236523160141824;\nn22236523160141824 -> n84161018036486144;\nn84161018036486144 -> n23362423066984448;\nn23362423066984448 -> n23362423066984448[style=dashed];\nn23362423066984448 -> n23643898043695104;\nn23643898043695104 -> n23925373020405760;\nn21673573206720512 -> n23925373020405760;\nn23925373020405760 -> n5066549580791808;\nn23925373020405760 -> n24206847997116416;\nn24206847997116416 -> n24488322973827072;\nn24206847997116416 -> n24769797950537728;\nn24769797950537728 -> n25051272927248384;\nn24769797950537728 -> n25332747903959040;\nn25332747903959040 -> n25051272927248384;\nn25332747903959040 -> n24488322973827072;\nn24488322973827072 -> n93731167244648448;\nn93731167244648448 -> n25614222880669696;\nn25614222880669696 -> n25614222880669696[style=dashed];\nn25614222880669696 -> n5066549580791808;\nn5066549580791808 -> n25895697857380352;\nn5066549580791808 -> n26177172834091008;\nn26177172834091008 -> n26458647810801664;\nn26177172834091008 -> n26740122787512320;\nn26740122787512320 -> n27021597764222976;\nn27303072740933632 -> n27584547717644288;\nn27303072740933632 -> n27021597764222976;\nn27021597764222976 -> n27866022694354944;\nn27021597764222976 -> n28147497671065600;\nn28147497671065600 -> n27303072740933632;\nn28147497671065600 -> n28428972647776256;\nn28428972647776256 -> n28710447624486912;\nn28428972647776256 -> n28991922601197568;\nn28991922601197568 -> n29273397577908224;\nn27866022694354944 -> n27303072740933632;\nn27866022694354944 -> n29554872554618880;\nn29554872554618880 -> n29836347531329536;\nn29554872554618880 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn28710447624486912 -> n30680772461461504;\nn30680772461461504 -> n30680772461461504[style=dashed];\nn30680772461461504 -> n29273397577908224;\nn29273397577908224 -> n27303072740933632;\nn29273397577908224 -> n30962247438172160;\nn30962247438172160 -> n31243722414882816;\nn31243722414882816 -> n31243722414882816[style=dashed];\nn31243722414882816 -> n31525197391593472;\nn31525197391593472 -> n27303072740933632;\nn29836347531329536 -> n31806672368304128;\nn31806672368304128 -> n31806672368304128[style=dashed];\nn31806672368304128 -> n30399297484750848;\nn30399297484750848 -> n27303072740933632;\nn30399297484750848 -> n32088147345014784;\nn32088147345014784 -> n32369622321725440;\nn32369622321725440 -> n32369622321725440[style=dashed];\nn32369622321725440 -> n32651097298436096;\nn32651097298436096 -> n27303072740933632;\nn25895697857380352 -> n32932572275146752;\nn25895697857380352 -> n33214047251857408;\nn33214047251857408 -> n33495522228568064;\nn33776997205278720 -> n34058472181989376;\nn33776997205278720 -> n33495522228568064;\nn33495522228568064 -> n34339947158700032;\nn33495522228568064 -> n34621422135410688;\nn34621422135410688 -> n33776997205278720;\nn34621422135410688 -> n34902897112121344;\nn34902897112121344 -> n35184372088832000;\nn34902897112121344 -> n35465847065542656;\nn35465847065542656 -> n35747322042253312;\nn34339947158700032 -> n33776997205278720;\nn34339947158700032 -> n36028797018963968;\nn36028797018963968 -> n36310271995674624;\nn36028797018963968 -> n36591746972385280;\nn36591746972385280 -> n36873221949095936;\nn35184372088832000 -> n37154696925806592;\nn37154696925806592 -> n37154696925806592[style=dashed];\nn37154696925806592 -> n35747322042253312;\nn35747322042253312 -> n33776997205278720;\nn35747322042253312 -> n37436171902517248;\nn37436171902517248 -> n37717646879227904;\nn37717646879227904 -> n37717646879227904[style=dashed];\nn37717646879227904 -> n37999121855938560;\nn37999121855938560 -> n33776997205278720;\nn36310271995674624 -> n38280596832649216;\nn38280596832649216 -> n38280596832649216[style=dashed];\nn38280596832649216 -> n36873221949095936;\nn36873221949095936 -> n33776997205278720;\nn36873221949095936 -> n38562071809359872;\nn38562071809359872 -> n38843546786070528;\nn38843546786070528 -> n38843546786070528[style=dashed];\nn38843546786070528 -> n39125021762781184;\nn39125021762781184 -> n33776997205278720;\nn26458647810801664 -> n39406496739491840;\nn26458647810801664 -> n39687971716202496;\nn39687971716202496 -> n39969446692913152;\nn27584547717644288 -> n39969446692913152;\nn27584547717644288 -> n39406496739491840;\nn39406496739491840 -> n40250921669623808;\nn40532396646334464 -> n39969446692913152;\nn40532396646334464 -> n40250921669623808;\nn40250921669623808 -> n40813871623045120;\nn40250921669623808 -> n41095346599755776;\nn41095346599755776 -> n40532396646334464;\nn41095346599755776 -> n41376821576466432;\nn41376821576466432 -> n40532396646334464;\nn40813871623045120 -> n41658296553177088;\nn40813871623045120 -> n41939771529887744;\nn41939771529887744 -> n40532396646334464;\nn41939771529887744 -> n42221246506598400;\nn42221246506598400 -> n42502721483309056;\nn42221246506598400 -> n42784196460019712;\nn42784196460019712 -> n43065671436730368;\nn41658296553177088 -> n40532396646334464;\nn41658296553177088 -> n43347146413441024;\nn43347146413441024 -> n43628621390151680;\nn43347146413441024 -> n43910096366862336;\nn43910096366862336 -> n44191571343572992;\nn42502721483309056 -> n44473046320283648;\nn44473046320283648 -> n44473046320283648[style=dashed];\nn44473046320283648 -> n43065671436730368;\nn43065671436730368 -> n40532396646334464;\nn43065671436730368 -> n44754521296994304;\nn44754521296994304 -> n45035996273704960;\nn45035996273704960 -> n45035996273704960[style=dashed];\nn45035996273704960 -> n45317471250415616;\nn45317471250415616 -> n40532396646334464;\nn43628621390151680 -> n45598946227126272;\nn45598946227126272 -> n45598946227126272[style=dashed];\nn45598946227126272 -> n44191571343572992;\nn44191571343572992 -> n40532396646334464;\nn44191571343572992 -> n45880421203836928;\nn45880421203836928 -> n46161896180547584;\nn46161896180547584 -> n46161896180547584[style=dashed];\nn46161896180547584 -> n46443371157258240;\nn46443371157258240 -> n40532396646334464;\nn39969446692913152 -> n46724846133968896;\nn39969446692913152 -> n47006321110679552;\nn47006321110679552 -> n46724846133968896;\nn47006321110679552 -> n47287796087390208;\nn47287796087390208 -> n47569271064100864;\nn47569271064100864 -> n47569271064100864[style=dashed];\nn47569271064100864 -> n47850746040811520;\nn47850746040811520 -> n46724846133968896;\nn32932572275146752 -> n48132221017522176;\nn32932572275146752 -> n48413695994232832;\nn48413695994232832 -> n48695170970943488;\nn34058472181989376 -> n48695170970943488;\nn34058472181989376 -> n48132221017522176;\nn48132221017522176 -> n48976645947654144;\nn49258120924364800 -> n48695170970943488;\nn49258120924364800 -> n48976645947654144;\nn48976645947654144 -> n49539595901075456;\nn48976645947654144 -> n49821070877786112;\nn49821070877786112 -> n49258120924364800;\nn49821070877786112 -> n50102545854496768;\nn50102545854496768 -> n49258120924364800;\nn49539595901075456 -> n50384020831207424;\nn49539595901075456 -> n50665495807918080;\nn50665495807918080 -> n49258120924364800;\nn50665495807918080 -> n50946970784628736;\nn50946970784628736 -> n51228445761339392;\nn50946970784628736 -> n51509920738050048;\nn51509920738050048 -> n51791395714760704;\nn50384020831207424 -> n49258120924364800;\nn50384020831207424 -> n52072870691471360;\nn52072870691471360 -> n52354345668182016;\nn52072870691471360 -> n52635820644892672;\nn52635820644892672 -> n52917295621603328;\nn51228445761339392 -> n53198770598313984;\nn53198770598313984 -> n53198770598313984[style=dashed];\nn53198770598313984 -> n51791395714760704;\nn51791395714760704 -> n49258120924364800;\nn51791395714760704 -> n53480245575024640;\nn53480245575024640 -> n53761720551735296;\nn53761720551735296 -> n53761720551735296[style=dashed];\nn53761720551735296 -> n54043195528445952;\nn54043195528445952 -> n49258120924364800;\nn52354345668182016 -> n54324670505156608;\nn54324670505156608 -> n54324670505156608[style=dashed];\nn54324670505156608 -> n52917295621603328;\nn52917295621603328 -> n49258120924364800;\nn52917295621603328 -> n54606145481867264;\nn54606145481867264 -> n54887620458577920;\nn54887620458577920 -> n54887620458577920[style=dashed];\nn54887620458577920 -> n55169095435288576;\nn55169095435288576 -> n49258120924364800;\nn48695170970943488 -> n55450570411999232;\nn48695170970943488 -> n55732045388709888;\nn55732045388709888 -> n55450570411999232;\nn55732045388709888 -> n56013520365420544;\nn56013520365420544 -> n56294995342131200;\nn56294995342131200 -> n56294995342131200[style=dashed];\nn56294995342131200 -> n55450570411999232;\nn55450570411999232 -> n56576470318841856;\nn55450570411999232 -> n56857945295552512;\nn56857945295552512 -> n57139420272263168;\nn57420895248973824 -> n57702370225684480;\nn57420895248973824 -> n57139420272263168;\nn57139420272263168 -> n57983845202395136;\nn57139420272263168 -> n58265320179105792;\nn58265320179105792 -> n57420895248973824;\nn58265320179105792 -> n58546795155816448;\nn58546795155816448 -> n58828270132527104;\nn58546795155816448 -> n59109745109237760;\nn59109745109237760 -> n59391220085948416;\nn57983845202395136 -> n57420895248973824;\nn57983845202395136 -> n59672695062659072;\nn59672695062659072 -> n59954170039369728;\nn59672695062659072 -> n60235645016080384;\nn60235645016080384 -> n60517119992791040;\nn58828270132527104 -> n60798594969501696;\nn60798594969501696 -> n60798594969501696[style=dashed];\nn60798594969501696 -> n59391220085948416;\nn59391220085948416 -> n57420895248973824;\nn59391220085948416 -> n61080069946212352;\nn61080069946212352 -> n61361544922923008;\nn61361544922923008 -> n61361544922923008[style=dashed];\nn61361544922923008 -> n61643019899633664;\nn61643019899633664 -> n57420895248973824;\nn59954170039369728 -> n61924494876344320;\nn61924494876344320 -> n61924494876344320[style=dashed];\nn61924494876344320 -> n60517119992791040;\nn60517119992791040 -> n57420895248973824;\nn60517119992791040 -> n62205969853054976;\nn62205969853054976 -> n62487444829765632;\nn62487444829765632 -> n62487444829765632[style=dashed];\nn62487444829765632 -> n62768919806476288;\nn62768919806476288 -> n57420895248973824;\nn56576470318841856 -> n63050394783186944;\nn56576470318841856 -> n63331869759897600;\nn63331869759897600 -> n63613344736608256;\nn57702370225684480 -> n63050394783186944;\nn57702370225684480 -> n63613344736608256;\nn63613344736608256 -> n63894819713318912;\nn63613344736608256 -> n64176294690029568;\nn64176294690029568 -> n64457769666740224;\nn64457769666740224 -> n64457769666740224[style=dashed];\nn64457769666740224 -> n63894819713318912;\nn63894819713318912 -> n64739244643450880;\nn63894819713318912 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn65020719620161536 -> n65583669573582848;\nn65583669573582848 -> n65865144550293504;\nn65583669573582848 -> n66146619527004160;\nn66146619527004160 -> n66428094503714816;\nn66146619527004160 -> n66709569480425472;\nn66709569480425472 -> n66991044457136128;\nn66709569480425472 -> n67272519433846784;\nn67272519433846784 -> n67553994410557440;\nn67272519433846784 -> n67835469387268096;\nn67835469387268096 -> n67553994410557440;\nn67835469387268096 -> n66991044457136128;\nn66991044457136128 -> n87538717757014016;\nn87538717757014016 -> n68116944363978752;\nn68116944363978752 -> n68116944363978752[style=dashed];\nn68116944363978752 -> n68398419340689408;\nn68398419340689408 -> n66428094503714816;\nn68679894317400064 -> n63613344736608256;\nn68679894317400064 -> n63050394783186944;\nn63050394783186944 -> n68961369294110720;\nn63050394783186944 -> n69242844270821376;\nn69242844270821376 -> n68679894317400064;\nn69242844270821376 -> n69524319247532032;\nn69524319247532032 -> n68679894317400064;\nn68961369294110720 -> n69805794224242688;\nn68961369294110720 -> n70087269200953344;\nn70087269200953344 -> n68679894317400064;\nn70087269200953344 -> n70368744177664000;\nn70368744177664000 -> n70650219154374656;\nn70368744177664000 -> n70931694131085312;\nn70931694131085312 -> n71213169107795968;\nn69805794224242688 -> n68679894317400064;\nn69805794224242688 -> n71494644084506624;\nn71494644084506624 -> n71776119061217280;\nn71494644084506624 -> n72057594037927936;\nn72057594037927936 -> n72339069014638592;\nn70650219154374656 -> n72620543991349248;\nn72620543991349248 -> n72620543991349248[style=dashed];\nn72620543991349248 -> n71213169107795968;\nn71213169107795968 -> n68679894317400064;\nn71213169107795968 -> n72902018968059904;\nn72902018968059904 -> n73183493944770560;\nn73183493944770560 -> n73183493944770560[style=dashed];\nn73183493944770560 -> n73464968921481216;\nn73464968921481216 -> n68679894317400064;\nn71776119061217280 -> n73746443898191872;\nn73746443898191872 -> n73746443898191872[style=dashed];\nn73746443898191872 -> n72339069014638592;\nn72339069014638592 -> n68679894317400064;\nn72339069014638592 -> n74027918874902528;\nn74027918874902528 -> n74309393851613184;\nn74309393851613184 -> n74309393851613184[style=dashed];\nn74309393851613184 -> n74590868828323840;\nn74590868828323840 -> n68679894317400064;\nn64739244643450880 -> n66428094503714816;\nn64739244643450880 -> n74872343805034496;\nn74872343805034496 -> n75153818781745152;\nn74872343805034496 -> n75435293758455808;\nn75435293758455808 -> n75716768735166464;\nn65302194596872192 -> n66428094503714816;\nn65302194596872192 -> n75998243711877120;\nn75998243711877120 -> n76279718688587776;\nn75998243711877120 -> n76561193665298432;\nn76561193665298432 -> n76842668642009088;\nn76561193665298432 -> n77124143618719744;\nn77124143618719744 -> n76842668642009088;\nn77124143618719744 -> n76279718688587776;\nn76279718688587776 -> n89227567617277952;\nn89227567617277952 -> n77405618595430400;\nn77405618595430400 -> n77405618595430400[style=dashed];\nn77405618595430400 -> n77687093572141056;\nn77687093572141056 -> n66428094503714816;\nn65865144550293504 -> n66428094503714816;\nn65865144550293504 -> n77968568548851712;\nn77968568548851712 -> n66428094503714816;\nn77968568548851712 -> n78250043525562368;\nn78250043525562368 -> n78531518502273024;\nn78812993478983680 -> n66428094503714816;\nn78812993478983680 -> n78531518502273024;\nn78531518502273024 -> n79094468455694336;\nn78531518502273024 -> n79375943432404992;\nn79375943432404992 -> n79657418409115648;\nn79375943432404992 -> n79938893385826304;\nn79938893385826304 -> n79657418409115648;\nn79938893385826304 -> n79094468455694336;\nn79094468455694336 -> n81627743246090240;\nn81627743246090240 -> n80220368362536960;\nn80220368362536960 -> n80220368362536960[style=dashed];\nn80220368362536960 -> n80501843339247616;\nn80501843339247616 -> n78812993478983680;\nn79657418409115648 -> n80783318315958272;\nn80783318315958272 -> n80783318315958272[style=dashed];\nn80783318315958272 -> n81064793292668928;\nn81064793292668928 -> n78812993478983680;\nn81064793292668928 -> n81346268269379584;\nn81346268269379584 -> n81627743246090240;\nn75153818781745152 -> n81909218222800896;\nn75153818781745152 -> n82190693199511552;\nn82190693199511552 -> n75716768735166464;\nn82190693199511552 -> n81909218222800896;\nn81909218222800896 -> n82472168176222208;\nn81909218222800896 -> n82753643152932864;\nn82753643152932864 -> n83035118129643520;\nn22799473113563136 -> n83316593106354176;\nn83316593106354176 -> n83316593106354176[style=dashed];\nn83316593106354176 -> n83598068083064832;\nn83598068083064832 -> n23925373020405760;\nn83598068083064832 -> n83879543059775488;\nn83879543059775488 -> n84161018036486144;\nn25051272927248384 -> n84442493013196800;\nn25051272927248384 -> n84723967989907456;\nn84723967989907456 -> n85005442966618112;\nn7318349394477056 -> n85286917943328768;\nn85286917943328768 -> n85286917943328768[style=dashed];\nn85286917943328768 -> n85568392920039424;\nn85568392920039424 -> n7881299347898368;\nn85568392920039424 -> n85849867896750080;\nn85849867896750080 -> n86131342873460736;\nn67553994410557440 -> n86412817850171392;\nn67553994410557440 -> n86694292826882048;\nn86694292826882048 -> n97108866965176320;\nn97108866965176320 -> n86975767803592704;\nn86975767803592704 -> n86975767803592704[style=dashed];\nn86975767803592704 -> n87257242780303360;\nn87257242780303360 -> n87538717757014016;\nn87257242780303360 -> n87820192733724672;\nn87820192733724672 -> n66428094503714816;\nn76842668642009088 -> n88101667710435328;\nn76842668642009088 -> n88383142687145984;\nn88383142687145984 -> n98516241848729600;\nn98516241848729600 -> n88664617663856640;\nn88664617663856640 -> n88664617663856640[style=dashed];\nn88664617663856640 -> n88946092640567296;\nn88946092640567296 -> n89227567617277952;\nn88946092640567296 -> n89509042593988608;\nn89509042593988608 -> n66428094503714816;\nn19421773393035264 -> n89790517570699264;\nn89790517570699264 -> n89790517570699264[style=dashed];\nn89790517570699264 -> n90071992547409920;\nn90071992547409920 -> n5066549580791808;\nn90071992547409920 -> n90353467524120576;\nn90353467524120576 -> n19984723346456576;\nn90353467524120576 -> n90634942500831232;\nn90634942500831232 -> n90916417477541888;\nn19984723346456576 -> n91197892454252544;\nn91197892454252544 -> n91197892454252544[style=dashed];\nn91197892454252544 -> n91479367430963200;\nn91479367430963200 -> n90916417477541888;\nn91479367430963200 -> n91760842407673856;\nn91760842407673856 -> n5066549580791808;\nn84442493013196800 -> n92042317384384512;\nn92042317384384512 -> n92042317384384512[style=dashed];\nn92042317384384512 -> n92323792361095168;\nn92323792361095168 -> n5066549580791808;\nn92323792361095168 -> n92605267337805824;\nn92605267337805824 -> n92886742314516480;\nn92605267337805824 -> n85005442966618112;\nn85005442966618112 -> n93168217291227136;\nn93168217291227136 -> n93168217291227136[style=dashed];\nn93168217291227136 -> n93449692267937792;\nn93449692267937792 -> n93731167244648448;\nn93449692267937792 -> n94012642221359104;\nn94012642221359104 -> n5066549580791808;\nn82472168176222208 -> n94294117198069760;\nn94294117198069760 -> n94294117198069760[style=dashed];\nn94294117198069760 -> n94575592174780416;\nn94575592174780416 -> n66428094503714816;\nn94575592174780416 -> n94857067151491072;\nn94857067151491072 -> n95138542128201728;\nn94857067151491072 -> n83035118129643520;\nn83035118129643520 -> n95420017104912384;\nn95420017104912384 -> n95420017104912384[style=dashed];\nn95420017104912384 -> n95701492081623040;\nn95701492081623040 -> n75716768735166464;\nn95701492081623040 -> n95982967058333696;\nn95982967058333696 -> n66428094503714816;\nn86412817850171392 -> n96264442035044352;\nn96264442035044352 -> n96264442035044352[style=dashed];\nn96264442035044352 -> n96545917011755008;\nn96545917011755008 -> n66428094503714816;\nn96545917011755008 -> n96827391988465664;\nn96827391988465664 -> n97108866965176320;\nn96827391988465664 -> n97390341941886976;\nn97390341941886976 -> n87538717757014016;\nn88101667710435328 -> n97671816918597632;\nn97671816918597632 -> n97671816918597632[style=dashed];\nn97671816918597632 -> n97953291895308288;\nn97953291895308288 -> n66428094503714816;\nn97953291895308288 -> n98234766872018944;\nn98234766872018944 -> n98516241848729600;\nn98234766872018944 -> n98797716825440256;\nn98797716825440256 -> n89227567617277952;\nn92886742314516480 -> n93731167244648448;\nn95138542128201728 -> n75716768735166464;\nn75716768735166464 -> n99079191802150912;\nn99079191802150912 -> n99079191802150912[style=dashed];\nn99079191802150912 -> n66428094503714816;\nn66428094503714816 -> n3096224743817216[style=dashed];\nn66428094503714816 -> n99360666778861568;\nn99360666778861568 -> n3096224743817216;\nn2251799813685248 -> n99642141755572224;\nn2251799813685248 -> n99923616732282880;\nn99923616732282880 -> n100205091708993536;\nn100486566685704192 -> n100768041662414848;\nn100768041662414848 -> n99642141755572224;\nn100768041662414848 -> n100205091708993536;\nn100205091708993536 -> n100768041662414848[style=dashed];\nn100205091708993536 -> n101049516639125504;\nn101049516639125504 -> n100486566685704192[style=dashed];\nn101049516639125504 -> n101330991615836160;\nn101330991615836160 -> n100486566685704192;\nn99642141755572224 -> n101612466592546816;\nn99642141755572224 -> n101893941569257472;\nn101893941569257472 -> n101612466592546816;\nn101612466592546816 -> n102175416545968128;\nn101612466592546816 -> n102456891522678784;\nn102456891522678784 -> n102175416545968128;\nn103019841476100096 -> n103301316452810752;\nn103019841476100096 -> n103582791429521408;\nn103582791429521408 -> n103301316452810752;\nn1407374883553280 -> n0[style=dotted];\nn1970324836974592 -> n1407374883553280[style=dotted];\nn1688849860263936 -> n1407374883553280[style=dotted];\nn3096224743817216 -> n66428094503714816[style=dotted];\nn46724846133968896 -> n5066549580791808[style=dotted];\nn2814749767106560 -> n2533274790395904[style=dotted];\nn6755399441055744 -> n6473924464345088[style=dotted];\nn7881299347898368 -> n6473924464345088[style=dotted];\nn6192449487634432 -> n3940649673949184[style=dotted];\nn86131342873460736 -> n3940649673949184[style=dotted];\nn9007199254740992 -> n8444249301319680[style=dotted];\nn18014398509481984 -> n8444249301319680[style=dotted];\nn9288674231451648 -> n18014398509481984[style=dotted];\nn10977524091715584 -> n10696049115004928[style=dotted];\nn10696049115004928 -> n10414574138294272[style=dotted];\nn12103423998558208 -> n11821949021847552[style=dotted];\nn11258999068426240 -> n10696049115004928[style=dotted];\nn12947848928690176 -> n10696049115004928[style=dotted];\nn13229323905400832 -> n12947848928690176[style=dotted];\nn9851624184872960 -> n86131342873460736[style=dotted];\nn14355223812243456 -> n13792273858822144[style=dotted];\nn90916417477541888 -> n13792273858822144[style=dotted];\nn14636698788954112 -> n90916417477541888[style=dotted];\nn16888498602639360 -> n16607023625928704[style=dotted];\nn17451448556060672 -> n16888498602639360[style=dotted];\nn20266198323167232 -> n15199648742375424[style=dotted];\nn20829148276588544 -> n20266198323167232[style=dotted];\nn15762598695796736 -> n5348024557502464[style=dotted];\nn21392098230009856 -> n15762598695796736[style=dotted];\nn5910974510923776 -> n3377699720527872[style=dotted];\nn22236523160141824 -> n21955048183431168[style=dotted];\nn84161018036486144 -> n21955048183431168[style=dotted];\nn23362423066984448 -> n84161018036486144[style=dotted];\nn23925373020405760 -> n5910974510923776[style=dotted];\nn24488322973827072 -> n24206847997116416[style=dotted];\nn93731167244648448 -> n24206847997116416[style=dotted];\nn25614222880669696 -> n93731167244648448[style=dotted];\nn5066549580791808 -> n2814749767106560[style=dotted];\nn27303072740933632 -> n27021597764222976[style=dotted];\nn27021597764222976 -> n26740122787512320[style=dotted];\nn30680772461461504 -> n28710447624486912[style=dotted];\nn29273397577908224 -> n28428972647776256[style=dotted];\nn31243722414882816 -> n30962247438172160[style=dotted];\nn31806672368304128 -> n29836347531329536[style=dotted];\nn30399297484750848 -> n29554872554618880[style=dotted];\nn32369622321725440 -> n32088147345014784[style=dotted];\nn33776997205278720 -> n33495522228568064[style=dotted];\nn33495522228568064 -> n33214047251857408[style=dotted];\nn37154696925806592 -> n35184372088832000[style=dotted];\nn35747322042253312 -> n34902897112121344[style=dotted];\nn37717646879227904 -> n37436171902517248[style=dotted];\nn38280596832649216 -> n36310271995674624[style=dotted];\nn36873221949095936 -> n36028797018963968[style=dotted];\nn38843546786070528 -> n38562071809359872[style=dotted];\nn39406496739491840 -> n26177172834091008[style=dotted];\nn40532396646334464 -> n40250921669623808[style=dotted];\nn40250921669623808 -> n39406496739491840[style=dotted];\nn44473046320283648 -> n42502721483309056[style=dotted];\nn43065671436730368 -> n42221246506598400[style=dotted];\nn45035996273704960 -> n44754521296994304[style=dotted];\nn45598946227126272 -> n43628621390151680[style=dotted];\nn44191571343572992 -> n43347146413441024[style=dotted];\nn46161896180547584 -> n45880421203836928[style=dotted];\nn39969446692913152 -> n26177172834091008[style=dotted];\nn47569271064100864 -> n47287796087390208[style=dotted];\nn48132221017522176 -> n25895697857380352[style=dotted];\nn49258120924364800 -> n48976645947654144[style=dotted];\nn48976645947654144 -> n48132221017522176[style=dotted];\nn53198770598313984 -> n51228445761339392[style=dotted];\nn51791395714760704 -> n50946970784628736[style=dotted];\nn53761720551735296 -> n53480245575024640[style=dotted];\nn54324670505156608 -> n52354345668182016[style=dotted];\nn52917295621603328 -> n52072870691471360[style=dotted];\nn54887620458577920 -> n54606145481867264[style=dotted];\nn48695170970943488 -> n25895697857380352[style=dotted];\nn56294995342131200 -> n56013520365420544[style=dotted];\nn55450570411999232 -> n48695170970943488[style=dotted];\nn57420895248973824 -> n57139420272263168[style=dotted];\nn57139420272263168 -> n56857945295552512[style=dotted];\nn60798594969501696 -> n58828270132527104[style=dotted];\nn59391220085948416 -> n58546795155816448[style=dotted];\nn61361544922923008 -> n61080069946212352[style=dotted];\nn61924494876344320 -> n59954170039369728[style=dotted];\nn60517119992791040 -> n59672695062659072[style=dotted];\nn62487444829765632 -> n62205969853054976[style=dotted];\nn63613344736608256 -> n55450570411999232[style=dotted];\nn64457769666740224 -> n64176294690029568[style=dotted];\nn63894819713318912 -> n63613344736608256[style=dotted];\nn66991044457136128 -> n66709569480425472[style=dotted];\nn87538717757014016 -> n66709569480425472[style=dotted];\nn68116944363978752 -> n87538717757014016[style=dotted];\nn68679894317400064 -> n63050394783186944[style=dotted];\nn63050394783186944 -> n55450570411999232[style=dotted];\nn72620543991349248 -> n70650219154374656[style=dotted];\nn71213169107795968 -> n70368744177664000[style=dotted];\nn73183493944770560 -> n72902018968059904[style=dotted];\nn73746443898191872 -> n71776119061217280[style=dotted];\nn72339069014638592 -> n71494644084506624[style=dotted];\nn74309393851613184 -> n74027918874902528[style=dotted];\nn76279718688587776 -> n75998243711877120[style=dotted];\nn89227567617277952 -> n75998243711877120[style=dotted];\nn77405618595430400 -> n89227567617277952[style=dotted];\nn78812993478983680 -> n78531518502273024[style=dotted];\nn78531518502273024 -> n78250043525562368[style=dotted];\nn79094468455694336 -> n78531518502273024[style=dotted];\nn81627743246090240 -> n78531518502273024[style=dotted];\nn80220368362536960 -> n81627743246090240[style=dotted];\nn79657418409115648 -> n79375943432404992[style=dotted];\nn80783318315958272 -> n79657418409115648[style=dotted];\nn81909218222800896 -> n75153818781745152[style=dotted];\nn22799473113563136 -> n22517998136852480[style=dotted];\nn83316593106354176 -> n22799473113563136[style=dotted];\nn25051272927248384 -> n24769797950537728[style=dotted];\nn7318349394477056 -> n7036874417766400[style=dotted];\nn85286917943328768 -> n7318349394477056[style=dotted];\nn67553994410557440 -> n67272519433846784[style=dotted];\nn97108866965176320 -> n67553994410557440[style=dotted];\nn86975767803592704 -> n97108866965176320[style=dotted];\nn76842668642009088 -> n76561193665298432[style=dotted];\nn98516241848729600 -> n76842668642009088[style=dotted];\nn88664617663856640 -> n98516241848729600[style=dotted];\nn89790517570699264 -> n19421773393035264[style=dotted];\nn19984723346456576 -> n19140298416324608[style=dotted];\nn91197892454252544 -> n19984723346456576[style=dotted];\nn92042317384384512 -> n84442493013196800[style=dotted];\nn85005442966618112 -> n25051272927248384[style=dotted];\nn93168217291227136 -> n85005442966618112[style=dotted];\nn94294117198069760 -> n82472168176222208[style=dotted];\nn83035118129643520 -> n81909218222800896[style=dotted];\nn95420017104912384 -> n83035118129643520[style=dotted];\nn96264442035044352 -> n86412817850171392[style=dotted];\nn97671816918597632 -> n88101667710435328[style=dotted];\nn75716768735166464 -> n74872343805034496[style=dotted];\nn99079191802150912 -> n75716768735166464[style=dotted];\nn66428094503714816 -> n63894819713318912[style=dotted];\nn2251799813685248 -> n1688849860263936[style=dotted];\nn100486566685704192 -> n101049516639125504[style=dotted];\nn100768041662414848 -> n100205091708993536[style=dotted];\nn100205091708993536 -> n99923616732282880[style=dotted];\nn99642141755572224 -> n2251799813685248[style=dotted];\nn101612466592546816 -> n99642141755572224[style=dotted];\nn102175416545968128 -> n101612466592546816[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-478.txt",
    "content": "digraph {\n\nn3940649673949184[shape=rectangle, label=\"B20\"];\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-485.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B2\"];\nn1688849860263936[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1970324836974592[shape=rectangle, label=\"B5\"];\nn2533274790395904[shape=rectangle, label=\"B6\"];\nn2814749767106560[shape=rectangle, label=\"B7\"];\nn2251799813685248[shape=rectangle, label=\"B8\"];\nn1125899906842624[shape=rectangle, label=\"B9\"];\nn281474976710656[shape=rectangle, label=\"B10\"];\nn3377699720527872[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn4503599627370496[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn3096224743817216[shape=rectangle, label=\"B15\"];\nn5066549580791808[shape=rectangle, label=\"B16\"];\nn5629499534213120[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn4785074604081152[shape=rectangle, label=\"B19\"];\nn3940649673949184[shape=rectangle, label=\"B20\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn562949953421312 -> n844424930131968;\nn844424930131968 -> n1688849860263936;\nn1688849860263936 -> n1125899906842624;\nn1688849860263936 -> n1407374883553280;\nn1407374883553280 -> n1688849860263936;\nn1407374883553280 -> n1970324836974592;\nn1970324836974592 -> n2251799813685248;\nn1970324836974592 -> n2533274790395904;\nn2533274790395904 -> n1125899906842624;\nn2533274790395904 -> n2814749767106560;\nn2814749767106560 -> n2251799813685248;\nn281474976710656 -> n3096224743817216;\nn281474976710656 -> n3377699720527872;\nn3377699720527872 -> n3096224743817216;\nn3377699720527872 -> n3659174697238528;\nn3659174697238528 -> n4503599627370496;\nn4503599627370496 -> n3940649673949184;\nn4503599627370496 -> n4222124650659840;\nn4222124650659840 -> n4503599627370496;\nn4222124650659840 -> n3096224743817216;\nn3096224743817216 -> n4785074604081152;\nn3096224743817216 -> n5066549580791808;\nn5066549580791808 -> n5629499534213120;\nn5629499534213120 -> n4785074604081152;\nn5629499534213120 -> n5348024557502464;\nn5348024557502464 -> n5629499534213120;\nn5348024557502464 -> n4785074604081152;\nn1688849860263936 -> n844424930131968[style=dotted];\nn2251799813685248 -> n1970324836974592[style=dotted];\nn1125899906842624 -> n1688849860263936[style=dotted];\nn281474976710656 -> n0[style=dotted];\nn4503599627370496 -> n3659174697238528[style=dotted];\nn3096224743817216 -> n281474976710656[style=dotted];\nn5629499534213120 -> n5066549580791808[style=dotted];\nn4785074604081152 -> n3096224743817216[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-568.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn844424930131968[shape=rectangle, label=\"B2\"];\nn281474976710656[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1688849860263936[shape=rectangle, label=\"B5\"];\nn1125899906842624[shape=rectangle, label=\"B6\"];\nn2251799813685248[shape=rectangle, label=\"B7\"];\nn31525197391593472[shape=rectangle, label=\"B8\"];\nn2814749767106560[shape=rectangle, label=\"B9\"];\nn2533274790395904[shape=rectangle, label=\"B10\"];\nn3377699720527872[shape=rectangle, label=\"B11\"];\nn3940649673949184[shape=rectangle, label=\"B12\"];\nn3659174697238528[shape=rectangle, label=\"B13\"];\nn4503599627370496[shape=rectangle, label=\"B14\"];\nn4222124650659840[shape=rectangle, label=\"B15\"];\nn5066549580791808[shape=rectangle, label=\"B16\"];\nn4785074604081152[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn5910974510923776[shape=rectangle, label=\"B19\"];\nn5629499534213120[shape=rectangle, label=\"B20\"];\nn6192449487634432[shape=rectangle, label=\"B21\"];\nn6755399441055744[shape=rectangle, label=\"B22\"];\nn6473924464345088[shape=rectangle, label=\"B23\"];\nn7036874417766400[shape=rectangle, label=\"B24\"];\nn7599824371187712[shape=rectangle, label=\"B25\"];\nn7318349394477056[shape=rectangle, label=\"B26\"];\nn7881299347898368[shape=rectangle, label=\"B27\"];\nn8444249301319680[shape=rectangle, label=\"B28\"];\nn8162774324609024[shape=rectangle, label=\"B29\"];\nn9007199254740992[shape=rectangle, label=\"B30\"];\nn9570149208162304[shape=rectangle, label=\"B31\"];\nn9288674231451648[shape=rectangle, label=\"B32\"];\nn9851624184872960[shape=rectangle, label=\"B33\"];\nn10414574138294272[shape=rectangle, label=\"B34\"];\nn10133099161583616[shape=rectangle, label=\"B35\"];\nn10696049115004928[shape=rectangle, label=\"B36\"];\nn11258999068426240[shape=rectangle, label=\"B37\"];\nn10977524091715584[shape=rectangle, label=\"B38\"];\nn11540474045136896[shape=rectangle, label=\"B39\"];\nn12103423998558208[shape=rectangle, label=\"B40\"];\nn11821949021847552[shape=rectangle, label=\"B41\"];\nn12384898975268864[shape=rectangle, label=\"B42\"];\nn12666373951979520[shape=rectangle, label=\"B43\"];\nn13229323905400832[shape=rectangle, label=\"B44\"];\nn12947848928690176[shape=rectangle, label=\"B45\"];\nn13510798882111488[shape=rectangle, label=\"B46\"];\nn14073748835532800[shape=rectangle, label=\"B47\"];\nn13792273858822144[shape=rectangle, label=\"B48\"];\nn14355223812243456[shape=rectangle, label=\"B49\"];\nn8725724278030336[shape=rectangle, label=\"B50\"];\nn14918173765664768[shape=rectangle, label=\"B51\"];\nn14636698788954112[shape=rectangle, label=\"B52\"];\nn15481123719086080[shape=rectangle, label=\"B53\"];\nn15199648742375424[shape=rectangle, label=\"B54\"];\nn15762598695796736[shape=rectangle, label=\"B55\"];\nn16325548649218048[shape=rectangle, label=\"B56\"];\nn16044073672507392[shape=rectangle, label=\"B57\"];\nn16607023625928704[shape=rectangle, label=\"B58\"];\nn17169973579350016[shape=rectangle, label=\"B59\"];\nn16888498602639360[shape=rectangle, label=\"B60\"];\nn17732923532771328[shape=rectangle, label=\"B61\"];\nn18295873486192640[shape=rectangle, label=\"B62\"];\nn18014398509481984[shape=rectangle, label=\"B63\"];\nn18858823439613952[shape=rectangle, label=\"B64\"];\nn19421773393035264[shape=rectangle, label=\"B65\"];\nn19140298416324608[shape=rectangle, label=\"B66\"];\nn18577348462903296[shape=rectangle, label=\"B67\"];\nn20266198323167232[shape=rectangle, label=\"B68\"];\nn19984723346456576[shape=rectangle, label=\"B69\"];\nn20829148276588544[shape=rectangle, label=\"B70\"];\nn21110623253299200[shape=rectangle, label=\"B71\"];\nn21392098230009856[shape=rectangle, label=\"B72\"];\nn20547673299877888[shape=rectangle, label=\"B73\"];\nn21673573206720512[shape=rectangle, label=\"B74\"];\nn21955048183431168[shape=rectangle, label=\"B75\"];\nn22236523160141824[shape=rectangle, label=\"B76\"];\nn22517998136852480[shape=rectangle, label=\"B77\"];\nn23080948090273792[shape=rectangle, label=\"B78\"];\nn22799473113563136[shape=rectangle, label=\"B79\"];\nn23643898043695104[shape=rectangle, label=\"B80\"];\nn24206847997116416[shape=rectangle, label=\"B81\"];\nn23925373020405760[shape=rectangle, label=\"B82\"];\nn23362423066984448[shape=rectangle, label=\"B83\"];\nn24769797950537728[shape=rectangle, label=\"B84\"];\nn25332747903959040[shape=rectangle, label=\"B85\"];\nn25051272927248384[shape=rectangle, label=\"B86\"];\nn26177172834091008[shape=rectangle, label=\"B87\"];\nn25895697857380352[shape=rectangle, label=\"B88\"];\nn25614222880669696[shape=rectangle, label=\"B89\"];\nn24488322973827072[shape=rectangle, label=\"B90\"];\nn19703248369745920[shape=rectangle, label=\"B91\"];\nn26740122787512320[shape=rectangle, label=\"B92\"];\nn26458647810801664[shape=rectangle, label=\"B93\"];\nn27021597764222976[shape=rectangle, label=\"B94\"];\nn17451448556060672[shape=rectangle, label=\"B95\"];\nn27303072740933632[shape=rectangle, label=\"B96\"];\nn27584547717644288[shape=rectangle, label=\"B97\"];\nn27866022694354944[shape=rectangle, label=\"B98\"];\nn28428972647776256[shape=rectangle, label=\"B99\"];\nn28147497671065600[shape=rectangle, label=\"B100\"];\nn28991922601197568[shape=rectangle, label=\"B101\"];\nn28710447624486912[shape=rectangle, label=\"B102\"];\nn29273397577908224[shape=rectangle, label=\"B103\"];\nn29836347531329536[shape=rectangle, label=\"B104\"];\nn29554872554618880[shape=rectangle, label=\"B105\"];\nn30680772461461504[shape=rectangle, label=\"B106\"];\nn30399297484750848[shape=rectangle, label=\"B107\"];\nn30117822508040192[shape=rectangle, label=\"B108\"];\nn3096224743817216[shape=rectangle, label=\"B109\"];\nn31243722414882816[shape=rectangle, label=\"B110\"];\nn30962247438172160[shape=rectangle, label=\"B111\"];\nn31806672368304128[shape=rectangle, label=\"B112\"];\nn32369622321725440[shape=rectangle, label=\"B113\"];\nn41939771529887744[shape=rectangle, label=\"B114\"];\nn32932572275146752[shape=rectangle, label=\"B115\"];\nn32651097298436096[shape=rectangle, label=\"B116\"];\nn33495522228568064[shape=rectangle, label=\"B117\"];\nn34058472181989376[shape=rectangle, label=\"B118\"];\nn33776997205278720[shape=rectangle, label=\"B119\"];\nn34621422135410688[shape=rectangle, label=\"B120\"];\nn33214047251857408[shape=rectangle, label=\"B121\"];\nn34339947158700032[shape=rectangle, label=\"B122\"];\nn35184372088832000[shape=rectangle, label=\"B123\"];\nn34902897112121344[shape=rectangle, label=\"B124\"];\nn35747322042253312[shape=rectangle, label=\"B125\"];\nn35465847065542656[shape=rectangle, label=\"B126\"];\nn36310271995674624[shape=rectangle, label=\"B127\"];\nn41376821576466432[shape=rectangle, label=\"B128\"];\nn36873221949095936[shape=rectangle, label=\"B129\"];\nn37154696925806592[shape=rectangle, label=\"B130\"];\nn37717646879227904[shape=rectangle, label=\"B131\"];\nn37436171902517248[shape=rectangle, label=\"B132\"];\nn38280596832649216[shape=rectangle, label=\"B133\"];\nn38843546786070528[shape=rectangle, label=\"B134\"];\nn38562071809359872[shape=rectangle, label=\"B135\"];\nn37999121855938560[shape=rectangle, label=\"B136\"];\nn39125021762781184[shape=rectangle, label=\"B137\"];\nn39687971716202496[shape=rectangle, label=\"B138\"];\nn39406496739491840[shape=rectangle, label=\"B139\"];\nn40532396646334464[shape=rectangle, label=\"B140\"];\nn40250921669623808[shape=rectangle, label=\"B141\"];\nn39969446692913152[shape=rectangle, label=\"B142\"];\nn36591746972385280[shape=rectangle, label=\"B143\"];\nn41095346599755776[shape=rectangle, label=\"B144\"];\nn40813871623045120[shape=rectangle, label=\"B145\"];\nn41658296553177088[shape=rectangle, label=\"B146\"];\nn36028797018963968[shape=rectangle, label=\"B147\"];\nn42221246506598400[shape=rectangle, label=\"B148\"];\nn32088147345014784[shape=rectangle, label=\"B149\"];\nn42502721483309056[shape=rectangle, label=\"B150\"];\nn1970324836974592[shape=rectangle, label=\"B151\"];\nn43065671436730368[shape=rectangle, label=\"B152\"];\nn43347146413441024[shape=rectangle, label=\"B153\"];\nn43628621390151680[shape=rectangle, label=\"B154\"];\nn43910096366862336[shape=rectangle, label=\"B155\"];\nn44191571343572992[shape=rectangle, label=\"B156\"];\nn50384020831207424[shape=rectangle, label=\"B157\"];\nn44754521296994304[shape=rectangle, label=\"B158\"];\nn44473046320283648[shape=rectangle, label=\"B159\"];\nn45317471250415616[shape=rectangle, label=\"B160\"];\nn50102545854496768[shape=rectangle, label=\"B161\"];\nn45880421203836928[shape=rectangle, label=\"B162\"];\nn45598946227126272[shape=rectangle, label=\"B163\"];\nn46443371157258240[shape=rectangle, label=\"B164\"];\nn46161896180547584[shape=rectangle, label=\"B165\"];\nn47006321110679552[shape=rectangle, label=\"B166\"];\nn46724846133968896[shape=rectangle, label=\"B167\"];\nn47569271064100864[shape=rectangle, label=\"B168\"];\nn48132221017522176[shape=rectangle, label=\"B169\"];\nn47850746040811520[shape=rectangle, label=\"B170\"];\nn48413695994232832[shape=rectangle, label=\"B171\"];\nn48976645947654144[shape=rectangle, label=\"B172\"];\nn48695170970943488[shape=rectangle, label=\"B173\"];\nn49258120924364800[shape=rectangle, label=\"B174\"];\nn47287796087390208[shape=rectangle, label=\"B175\"];\nn49821070877786112[shape=rectangle, label=\"B176\"];\nn49539595901075456[shape=rectangle, label=\"B177\"];\nn45035996273704960[shape=rectangle, label=\"B178\"];\nn42784196460019712[shape=rectangle, label=\"B179\"];\nn50946970784628736[shape=rectangle, label=\"B180\"];\nn58828270132527104[shape=rectangle, label=\"B181\"];\nn51509920738050048[shape=rectangle, label=\"B182\"];\nn51228445761339392[shape=rectangle, label=\"B183\"];\nn52072870691471360[shape=rectangle, label=\"B184\"];\nn55732045388709888[shape=rectangle, label=\"B185\"];\nn52635820644892672[shape=rectangle, label=\"B186\"];\nn52354345668182016[shape=rectangle, label=\"B187\"];\nn53198770598313984[shape=rectangle, label=\"B188\"];\nn52917295621603328[shape=rectangle, label=\"B189\"];\nn53761720551735296[shape=rectangle, label=\"B190\"];\nn53480245575024640[shape=rectangle, label=\"B191\"];\nn54324670505156608[shape=rectangle, label=\"B192\"];\nn54887620458577920[shape=rectangle, label=\"B193\"];\nn54043195528445952[shape=rectangle, label=\"B194\"];\nn55450570411999232[shape=rectangle, label=\"B195\"];\nn55169095435288576[shape=rectangle, label=\"B196\"];\nn54606145481867264[shape=rectangle, label=\"B197\"];\nn51791395714760704[shape=rectangle, label=\"B198\"];\nn56294995342131200[shape=rectangle, label=\"B199\"];\nn58546795155816448[shape=rectangle, label=\"B200\"];\nn56857945295552512[shape=rectangle, label=\"B201\"];\nn56576470318841856[shape=rectangle, label=\"B202\"];\nn57420895248973824[shape=rectangle, label=\"B203\"];\nn57139420272263168[shape=rectangle, label=\"B204\"];\nn57983845202395136[shape=rectangle, label=\"B205\"];\nn58265320179105792[shape=rectangle, label=\"B206\"];\nn57702370225684480[shape=rectangle, label=\"B207\"];\nn56013520365420544[shape=rectangle, label=\"B208\"];\nn59109745109237760[shape=rectangle, label=\"B209\"];\nn59391220085948416[shape=rectangle, label=\"B210\"];\nn59672695062659072[shape=rectangle, label=\"B211\"];\nn67272519433846784[shape=rectangle, label=\"B212\"];\nn60235645016080384[shape=rectangle, label=\"B213\"];\nn59954170039369728[shape=rectangle, label=\"B214\"];\nn60798594969501696[shape=rectangle, label=\"B215\"];\nn64457769666740224[shape=rectangle, label=\"B216\"];\nn61361544922923008[shape=rectangle, label=\"B217\"];\nn61080069946212352[shape=rectangle, label=\"B218\"];\nn61924494876344320[shape=rectangle, label=\"B219\"];\nn61643019899633664[shape=rectangle, label=\"B220\"];\nn62487444829765632[shape=rectangle, label=\"B221\"];\nn62205969853054976[shape=rectangle, label=\"B222\"];\nn63050394783186944[shape=rectangle, label=\"B223\"];\nn63613344736608256[shape=rectangle, label=\"B224\"];\nn62768919806476288[shape=rectangle, label=\"B225\"];\nn64176294690029568[shape=rectangle, label=\"B226\"];\nn63894819713318912[shape=rectangle, label=\"B227\"];\nn63331869759897600[shape=rectangle, label=\"B228\"];\nn60517119992791040[shape=rectangle, label=\"B229\"];\nn65020719620161536[shape=rectangle, label=\"B230\"];\nn65583669573582848[shape=rectangle, label=\"B231\"];\nn65302194596872192[shape=rectangle, label=\"B232\"];\nn66146619527004160[shape=rectangle, label=\"B233\"];\nn65865144550293504[shape=rectangle, label=\"B234\"];\nn66709569480425472[shape=rectangle, label=\"B235\"];\nn66991044457136128[shape=rectangle, label=\"B236\"];\nn66428094503714816[shape=rectangle, label=\"B237\"];\nn64739244643450880[shape=rectangle, label=\"B238\"];\nn50665495807918080[shape=rectangle, label=\"B239\"];\nn67835469387268096[shape=rectangle, label=\"B240\"];\nn68116944363978752[shape=rectangle, label=\"B241\"];\nn68679894317400064[shape=rectangle, label=\"B242\"];\nn68398419340689408[shape=rectangle, label=\"B243\"];\nn68961369294110720[shape=rectangle, label=\"B244\"];\nn69242844270821376[shape=rectangle, label=\"B245\"];\nn67553994410557440[shape=rectangle, label=\"B246\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn562949953421312 -> n844424930131968;\nn844424930131968 -> n281474976710656;\nn281474976710656 -> n1125899906842624;\nn281474976710656 -> n1407374883553280;\nn1407374883553280 -> n1125899906842624;\nn1407374883553280 -> n1688849860263936;\nn1688849860263936 -> n1125899906842624;\nn1125899906842624 -> n1970324836974592;\nn1125899906842624 -> n2251799813685248;\nn2251799813685248 -> n31525197391593472;\nn31525197391593472 -> n2533274790395904;\nn31525197391593472 -> n2814749767106560;\nn2814749767106560 -> n2533274790395904;\nn2533274790395904 -> n3096224743817216;\nn2533274790395904 -> n3377699720527872;\nn3377699720527872 -> n3659174697238528;\nn3377699720527872 -> n3940649673949184;\nn3940649673949184 -> n3659174697238528;\nn3659174697238528 -> n4222124650659840;\nn3659174697238528 -> n4503599627370496;\nn4503599627370496 -> n3096224743817216;\nn4503599627370496 -> n4222124650659840;\nn4222124650659840 -> n4785074604081152;\nn4222124650659840 -> n5066549580791808;\nn5066549580791808 -> n4785074604081152;\nn4785074604081152 -> n3096224743817216;\nn4785074604081152 -> n5348024557502464;\nn5348024557502464 -> n5629499534213120;\nn5348024557502464 -> n5910974510923776;\nn5910974510923776 -> n5629499534213120;\nn5629499534213120 -> n3096224743817216;\nn5629499534213120 -> n6192449487634432;\nn6192449487634432 -> n6473924464345088;\nn6192449487634432 -> n6755399441055744;\nn6755399441055744 -> n6473924464345088;\nn6473924464345088 -> n3096224743817216;\nn6473924464345088 -> n7036874417766400;\nn7036874417766400 -> n7318349394477056;\nn7036874417766400 -> n7599824371187712;\nn7599824371187712 -> n7318349394477056;\nn7318349394477056 -> n3096224743817216;\nn7318349394477056 -> n7881299347898368;\nn7881299347898368 -> n8162774324609024;\nn7881299347898368 -> n8444249301319680;\nn8444249301319680 -> n8162774324609024;\nn8162774324609024 -> n8725724278030336;\nn8162774324609024 -> n9007199254740992;\nn9007199254740992 -> n9288674231451648;\nn9007199254740992 -> n9570149208162304;\nn9570149208162304 -> n9288674231451648;\nn9288674231451648 -> n8725724278030336;\nn9288674231451648 -> n9851624184872960;\nn9851624184872960 -> n10133099161583616;\nn9851624184872960 -> n10414574138294272;\nn10414574138294272 -> n10133099161583616;\nn10133099161583616 -> n8725724278030336;\nn10133099161583616 -> n10696049115004928;\nn10696049115004928 -> n10977524091715584;\nn10696049115004928 -> n11258999068426240;\nn11258999068426240 -> n10977524091715584;\nn10977524091715584 -> n8725724278030336;\nn10977524091715584 -> n11540474045136896;\nn11540474045136896 -> n11821949021847552;\nn11540474045136896 -> n12103423998558208;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n8725724278030336;\nn11821949021847552 -> n12384898975268864;\nn12384898975268864 -> n8725724278030336;\nn12384898975268864 -> n12666373951979520;\nn12666373951979520 -> n12947848928690176;\nn12666373951979520 -> n13229323905400832;\nn13229323905400832 -> n12947848928690176;\nn12947848928690176 -> n8725724278030336;\nn12947848928690176 -> n13510798882111488;\nn13510798882111488 -> n13792273858822144;\nn13510798882111488 -> n14073748835532800;\nn14073748835532800 -> n13792273858822144;\nn13792273858822144 -> n8725724278030336;\nn13792273858822144 -> n14355223812243456;\nn14355223812243456 -> n3096224743817216;\nn14355223812243456 -> n8725724278030336;\nn8725724278030336 -> n14636698788954112;\nn8725724278030336 -> n14918173765664768;\nn14918173765664768 -> n3096224743817216;\nn14918173765664768 -> n14636698788954112;\nn14636698788954112 -> n15199648742375424;\nn14636698788954112 -> n15481123719086080;\nn15481123719086080 -> n15199648742375424;\nn15199648742375424 -> n3096224743817216;\nn15199648742375424 -> n15762598695796736;\nn15762598695796736 -> n16044073672507392;\nn15762598695796736 -> n16325548649218048;\nn16325548649218048 -> n16044073672507392;\nn16044073672507392 -> n3096224743817216;\nn16044073672507392 -> n16607023625928704;\nn16607023625928704 -> n16888498602639360;\nn16607023625928704 -> n17169973579350016;\nn17169973579350016 -> n16888498602639360;\nn16888498602639360 -> n17451448556060672;\nn16888498602639360 -> n17732923532771328;\nn17732923532771328 -> n18014398509481984;\nn17732923532771328 -> n18295873486192640;\nn18295873486192640 -> n18014398509481984;\nn18014398509481984 -> n18577348462903296;\nn18014398509481984 -> n18858823439613952;\nn18858823439613952 -> n19140298416324608;\nn18858823439613952 -> n19421773393035264;\nn19421773393035264 -> n19140298416324608;\nn19140298416324608 -> n19703248369745920;\nn19140298416324608 -> n18577348462903296;\nn18577348462903296 -> n19984723346456576;\nn18577348462903296 -> n20266198323167232;\nn20266198323167232 -> n19984723346456576;\nn19984723346456576 -> n20547673299877888;\nn19984723346456576 -> n20829148276588544;\nn20829148276588544 -> n20547673299877888;\nn20829148276588544 -> n21110623253299200;\nn21110623253299200 -> n20547673299877888;\nn21110623253299200 -> n21392098230009856;\nn21392098230009856 -> n19703248369745920;\nn21392098230009856 -> n20547673299877888;\nn20547673299877888 -> n19703248369745920;\nn20547673299877888 -> n21673573206720512;\nn21673573206720512 -> n19703248369745920;\nn21673573206720512 -> n21955048183431168;\nn21955048183431168 -> n19703248369745920;\nn21955048183431168 -> n22236523160141824;\nn22236523160141824 -> n19703248369745920;\nn22236523160141824 -> n22517998136852480;\nn22517998136852480 -> n22799473113563136;\nn22517998136852480 -> n23080948090273792;\nn23080948090273792 -> n22799473113563136;\nn22799473113563136 -> n23362423066984448;\nn22799473113563136 -> n23643898043695104;\nn23643898043695104 -> n23925373020405760;\nn23643898043695104 -> n24206847997116416;\nn24206847997116416 -> n23925373020405760;\nn23925373020405760 -> n24488322973827072;\nn23925373020405760 -> n23362423066984448;\nn23362423066984448 -> n24488322973827072;\nn23362423066984448 -> n24769797950537728;\nn24769797950537728 -> n25051272927248384;\nn24769797950537728 -> n25332747903959040;\nn25332747903959040 -> n25614222880669696;\nn25051272927248384 -> n25895697857380352;\nn25051272927248384 -> n26177172834091008;\nn26177172834091008 -> n25614222880669696;\nn25895697857380352 -> n25614222880669696;\nn25614222880669696 -> n24488322973827072;\nn24488322973827072 -> n19703248369745920;\nn19703248369745920 -> n26458647810801664;\nn19703248369745920 -> n26740122787512320;\nn26740122787512320 -> n26458647810801664;\nn26458647810801664 -> n17732923532771328;\nn26458647810801664 -> n27021597764222976;\nn27021597764222976 -> n17451448556060672;\nn17451448556060672 -> n3096224743817216;\nn17451448556060672 -> n27303072740933632;\nn27303072740933632 -> n3096224743817216;\nn27303072740933632 -> n27584547717644288;\nn27584547717644288 -> n3096224743817216;\nn27584547717644288 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn27866022694354944 -> n28428972647776256;\nn28428972647776256 -> n28147497671065600;\nn28147497671065600 -> n28710447624486912;\nn28147497671065600 -> n28991922601197568;\nn28991922601197568 -> n28710447624486912;\nn28710447624486912 -> n3096224743817216;\nn28710447624486912 -> n29273397577908224;\nn29273397577908224 -> n29554872554618880;\nn29273397577908224 -> n29836347531329536;\nn29836347531329536 -> n30117822508040192;\nn29554872554618880 -> n30399297484750848;\nn29554872554618880 -> n30680772461461504;\nn30680772461461504 -> n30117822508040192;\nn30399297484750848 -> n30117822508040192;\nn30117822508040192 -> n3096224743817216;\nn3096224743817216 -> n30962247438172160;\nn3096224743817216 -> n31243722414882816;\nn31243722414882816 -> n30962247438172160;\nn30962247438172160 -> n31525197391593472;\nn30962247438172160 -> n31806672368304128;\nn31806672368304128 -> n32088147345014784;\nn31806672368304128 -> n32369622321725440;\nn32369622321725440 -> n41939771529887744;\nn41939771529887744 -> n32651097298436096;\nn41939771529887744 -> n32932572275146752;\nn32932572275146752 -> n32651097298436096;\nn32651097298436096 -> n33214047251857408;\nn32651097298436096 -> n33495522228568064;\nn33495522228568064 -> n33776997205278720;\nn33495522228568064 -> n34058472181989376;\nn34058472181989376 -> n33776997205278720;\nn33776997205278720 -> n34339947158700032;\nn33776997205278720 -> n34621422135410688;\nn34621422135410688 -> n34339947158700032;\nn33214047251857408 -> n34339947158700032;\nn34339947158700032 -> n34902897112121344;\nn34339947158700032 -> n35184372088832000;\nn35184372088832000 -> n34902897112121344;\nn34902897112121344 -> n35465847065542656;\nn34902897112121344 -> n35747322042253312;\nn35747322042253312 -> n35465847065542656;\nn35465847065542656 -> n36028797018963968;\nn35465847065542656 -> n36310271995674624;\nn36310271995674624 -> n41376821576466432;\nn41376821576466432 -> n36591746972385280;\nn41376821576466432 -> n36873221949095936;\nn36873221949095936 -> n36591746972385280;\nn36873221949095936 -> n37154696925806592;\nn37154696925806592 -> n37436171902517248;\nn37154696925806592 -> n37717646879227904;\nn37717646879227904 -> n37436171902517248;\nn37436171902517248 -> n37999121855938560;\nn37436171902517248 -> n38280596832649216;\nn38280596832649216 -> n38562071809359872;\nn38280596832649216 -> n38843546786070528;\nn38843546786070528 -> n38562071809359872;\nn38562071809359872 -> n36591746972385280;\nn38562071809359872 -> n37999121855938560;\nn37999121855938560 -> n36591746972385280;\nn37999121855938560 -> n39125021762781184;\nn39125021762781184 -> n39406496739491840;\nn39125021762781184 -> n39687971716202496;\nn39687971716202496 -> n39969446692913152;\nn39406496739491840 -> n40250921669623808;\nn39406496739491840 -> n40532396646334464;\nn40532396646334464 -> n39969446692913152;\nn40250921669623808 -> n39969446692913152;\nn39969446692913152 -> n36591746972385280;\nn36591746972385280 -> n40813871623045120;\nn36591746972385280 -> n41095346599755776;\nn41095346599755776 -> n40813871623045120;\nn40813871623045120 -> n41376821576466432;\nn40813871623045120 -> n41658296553177088;\nn41658296553177088 -> n36028797018963968;\nn36028797018963968 -> n41939771529887744;\nn36028797018963968 -> n42221246506598400;\nn42221246506598400 -> n42502721483309056;\nn32088147345014784 -> n42502721483309056;\nn42502721483309056 -> n1970324836974592;\nn1970324836974592 -> n42784196460019712;\nn1970324836974592 -> n43065671436730368;\nn43065671436730368 -> n42784196460019712;\nn43065671436730368 -> n43347146413441024;\nn43347146413441024 -> n42784196460019712;\nn43347146413441024 -> n43628621390151680;\nn43628621390151680 -> n42784196460019712;\nn43628621390151680 -> n43910096366862336;\nn43910096366862336 -> n42784196460019712;\nn43910096366862336 -> n44191571343572992;\nn44191571343572992 -> n50384020831207424;\nn50384020831207424 -> n44473046320283648;\nn50384020831207424 -> n44754521296994304;\nn44754521296994304 -> n44473046320283648;\nn44473046320283648 -> n45035996273704960;\nn44473046320283648 -> n45317471250415616;\nn45317471250415616 -> n50102545854496768;\nn50102545854496768 -> n45598946227126272;\nn50102545854496768 -> n45880421203836928;\nn45880421203836928 -> n45598946227126272;\nn45598946227126272 -> n46161896180547584;\nn45598946227126272 -> n46443371157258240;\nn46443371157258240 -> n46161896180547584;\nn46161896180547584 -> n46724846133968896;\nn46161896180547584 -> n47006321110679552;\nn47006321110679552 -> n46724846133968896;\nn46724846133968896 -> n47287796087390208;\nn46724846133968896 -> n47569271064100864;\nn47569271064100864 -> n47850746040811520;\nn47569271064100864 -> n48132221017522176;\nn48132221017522176 -> n47850746040811520;\nn47850746040811520 -> n47287796087390208;\nn47850746040811520 -> n48413695994232832;\nn48413695994232832 -> n48695170970943488;\nn48413695994232832 -> n48976645947654144;\nn48976645947654144 -> n48695170970943488;\nn48695170970943488 -> n45035996273704960;\nn48695170970943488 -> n49258120924364800;\nn49258120924364800 -> n49539595901075456;\nn47287796087390208 -> n49539595901075456;\nn47287796087390208 -> n49821070877786112;\nn49821070877786112 -> n49539595901075456;\nn49539595901075456 -> n50102545854496768;\nn49539595901075456 -> n45035996273704960;\nn45035996273704960 -> n50384020831207424;\nn45035996273704960 -> n42784196460019712;\nn42784196460019712 -> n50665495807918080;\nn42784196460019712 -> n50946970784628736;\nn50946970784628736 -> n58828270132527104;\nn58828270132527104 -> n51228445761339392;\nn58828270132527104 -> n51509920738050048;\nn51509920738050048 -> n51228445761339392;\nn51228445761339392 -> n51791395714760704;\nn51228445761339392 -> n52072870691471360;\nn52072870691471360 -> n55732045388709888;\nn55732045388709888 -> n52354345668182016;\nn55732045388709888 -> n52635820644892672;\nn52635820644892672 -> n52354345668182016;\nn52354345668182016 -> n52917295621603328;\nn52354345668182016 -> n53198770598313984;\nn53198770598313984 -> n52917295621603328;\nn52917295621603328 -> n53480245575024640;\nn52917295621603328 -> n53761720551735296;\nn53761720551735296 -> n53480245575024640;\nn53480245575024640 -> n54043195528445952;\nn53480245575024640 -> n54324670505156608;\nn54324670505156608 -> n54606145481867264;\nn54324670505156608 -> n54887620458577920;\nn54887620458577920 -> n54606145481867264;\nn54043195528445952 -> n55169095435288576;\nn54043195528445952 -> n55450570411999232;\nn55450570411999232 -> n55169095435288576;\nn55169095435288576 -> n51791395714760704;\nn55169095435288576 -> n54606145481867264;\nn54606145481867264 -> n55732045388709888;\nn54606145481867264 -> n51791395714760704;\nn51791395714760704 -> n56013520365420544;\nn51791395714760704 -> n56294995342131200;\nn56294995342131200 -> n58546795155816448;\nn58546795155816448 -> n56576470318841856;\nn58546795155816448 -> n56857945295552512;\nn56857945295552512 -> n56576470318841856;\nn56576470318841856 -> n57139420272263168;\nn56576470318841856 -> n57420895248973824;\nn57420895248973824 -> n57139420272263168;\nn57139420272263168 -> n57702370225684480;\nn57139420272263168 -> n57983845202395136;\nn57983845202395136 -> n57702370225684480;\nn57983845202395136 -> n58265320179105792;\nn58265320179105792 -> n57702370225684480;\nn57702370225684480 -> n58546795155816448;\nn57702370225684480 -> n56013520365420544;\nn56013520365420544 -> n58828270132527104;\nn56013520365420544 -> n59109745109237760;\nn59109745109237760 -> n50665495807918080;\nn59109745109237760 -> n59391220085948416;\nn59391220085948416 -> n50665495807918080;\nn59391220085948416 -> n59672695062659072;\nn59672695062659072 -> n67272519433846784;\nn67272519433846784 -> n59954170039369728;\nn67272519433846784 -> n60235645016080384;\nn60235645016080384 -> n59954170039369728;\nn59954170039369728 -> n60517119992791040;\nn59954170039369728 -> n60798594969501696;\nn60798594969501696 -> n64457769666740224;\nn64457769666740224 -> n61080069946212352;\nn64457769666740224 -> n61361544922923008;\nn61361544922923008 -> n61080069946212352;\nn61080069946212352 -> n61643019899633664;\nn61080069946212352 -> n61924494876344320;\nn61924494876344320 -> n61643019899633664;\nn61643019899633664 -> n62205969853054976;\nn61643019899633664 -> n62487444829765632;\nn62487444829765632 -> n62205969853054976;\nn62205969853054976 -> n62768919806476288;\nn62205969853054976 -> n63050394783186944;\nn63050394783186944 -> n63331869759897600;\nn63050394783186944 -> n63613344736608256;\nn63613344736608256 -> n63331869759897600;\nn62768919806476288 -> n63894819713318912;\nn62768919806476288 -> n64176294690029568;\nn64176294690029568 -> n63894819713318912;\nn63894819713318912 -> n60517119992791040;\nn63894819713318912 -> n63331869759897600;\nn63331869759897600 -> n64457769666740224;\nn63331869759897600 -> n60517119992791040;\nn60517119992791040 -> n64739244643450880;\nn60517119992791040 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn65020719620161536 -> n65583669573582848;\nn65583669573582848 -> n65302194596872192;\nn65302194596872192 -> n65865144550293504;\nn65302194596872192 -> n66146619527004160;\nn66146619527004160 -> n65865144550293504;\nn65865144550293504 -> n66428094503714816;\nn65865144550293504 -> n66709569480425472;\nn66709569480425472 -> n66428094503714816;\nn66709569480425472 -> n66991044457136128;\nn66991044457136128 -> n66428094503714816;\nn66428094503714816 -> n65020719620161536;\nn66428094503714816 -> n64739244643450880;\nn64739244643450880 -> n67272519433846784;\nn64739244643450880 -> n50665495807918080;\nn50665495807918080 -> n67553994410557440;\nn50665495807918080 -> n67835469387268096;\nn67835469387268096 -> n67553994410557440;\nn67835469387268096 -> n68116944363978752;\nn68116944363978752 -> n68398419340689408;\nn68116944363978752 -> n68679894317400064;\nn68679894317400064 -> n68961369294110720;\nn68679894317400064 -> n68398419340689408;\nn68398419340689408 -> n69242844270821376;\nn68398419340689408 -> n68961369294110720;\nn68961369294110720 -> n69242844270821376;\nn69242844270821376 -> n67553994410557440;\nn281474976710656 -> n0[style=dotted];\nn1125899906842624 -> n281474976710656[style=dotted];\nn31525197391593472 -> n2251799813685248[style=dotted];\nn2533274790395904 -> n31525197391593472[style=dotted];\nn3659174697238528 -> n3377699720527872[style=dotted];\nn4222124650659840 -> n3659174697238528[style=dotted];\nn4785074604081152 -> n4222124650659840[style=dotted];\nn5629499534213120 -> n5348024557502464[style=dotted];\nn6473924464345088 -> n6192449487634432[style=dotted];\nn7318349394477056 -> n7036874417766400[style=dotted];\nn8162774324609024 -> n7881299347898368[style=dotted];\nn9288674231451648 -> n9007199254740992[style=dotted];\nn10133099161583616 -> n9851624184872960[style=dotted];\nn10977524091715584 -> n10696049115004928[style=dotted];\nn11821949021847552 -> n11540474045136896[style=dotted];\nn12947848928690176 -> n12666373951979520[style=dotted];\nn13792273858822144 -> n13510798882111488[style=dotted];\nn8725724278030336 -> n8162774324609024[style=dotted];\nn14636698788954112 -> n8725724278030336[style=dotted];\nn15199648742375424 -> n14636698788954112[style=dotted];\nn16044073672507392 -> n15762598695796736[style=dotted];\nn16888498602639360 -> n16607023625928704[style=dotted];\nn17732923532771328 -> n16888498602639360[style=dotted];\nn18014398509481984 -> n17732923532771328[style=dotted];\nn19140298416324608 -> n18858823439613952[style=dotted];\nn18577348462903296 -> n18014398509481984[style=dotted];\nn19984723346456576 -> n18577348462903296[style=dotted];\nn20547673299877888 -> n19984723346456576[style=dotted];\nn22799473113563136 -> n22517998136852480[style=dotted];\nn23925373020405760 -> n23643898043695104[style=dotted];\nn23362423066984448 -> n22799473113563136[style=dotted];\nn25614222880669696 -> n24769797950537728[style=dotted];\nn24488322973827072 -> n22799473113563136[style=dotted];\nn19703248369745920 -> n18014398509481984[style=dotted];\nn26458647810801664 -> n19703248369745920[style=dotted];\nn17451448556060672 -> n16888498602639360[style=dotted];\nn28147497671065600 -> n27866022694354944[style=dotted];\nn28710447624486912 -> n28147497671065600[style=dotted];\nn30117822508040192 -> n29273397577908224[style=dotted];\nn3096224743817216 -> n2533274790395904[style=dotted];\nn30962247438172160 -> n3096224743817216[style=dotted];\nn41939771529887744 -> n32369622321725440[style=dotted];\nn32651097298436096 -> n41939771529887744[style=dotted];\nn33776997205278720 -> n33495522228568064[style=dotted];\nn34339947158700032 -> n32651097298436096[style=dotted];\nn34902897112121344 -> n34339947158700032[style=dotted];\nn35465847065542656 -> n34902897112121344[style=dotted];\nn41376821576466432 -> n36310271995674624[style=dotted];\nn37436171902517248 -> n37154696925806592[style=dotted];\nn38562071809359872 -> n38280596832649216[style=dotted];\nn37999121855938560 -> n37436171902517248[style=dotted];\nn39969446692913152 -> n39125021762781184[style=dotted];\nn36591746972385280 -> n41376821576466432[style=dotted];\nn40813871623045120 -> n36591746972385280[style=dotted];\nn36028797018963968 -> n35465847065542656[style=dotted];\nn42502721483309056 -> n31806672368304128[style=dotted];\nn1970324836974592 -> n1125899906842624[style=dotted];\nn50384020831207424 -> n44191571343572992[style=dotted];\nn44473046320283648 -> n50384020831207424[style=dotted];\nn50102545854496768 -> n45317471250415616[style=dotted];\nn45598946227126272 -> n50102545854496768[style=dotted];\nn46161896180547584 -> n45598946227126272[style=dotted];\nn46724846133968896 -> n46161896180547584[style=dotted];\nn47850746040811520 -> n47569271064100864[style=dotted];\nn48695170970943488 -> n48413695994232832[style=dotted];\nn47287796087390208 -> n46724846133968896[style=dotted];\nn49539595901075456 -> n46724846133968896[style=dotted];\nn45035996273704960 -> n44473046320283648[style=dotted];\nn42784196460019712 -> n1970324836974592[style=dotted];\nn58828270132527104 -> n50946970784628736[style=dotted];\nn51228445761339392 -> n58828270132527104[style=dotted];\nn55732045388709888 -> n52072870691471360[style=dotted];\nn52354345668182016 -> n55732045388709888[style=dotted];\nn52917295621603328 -> n52354345668182016[style=dotted];\nn53480245575024640 -> n52917295621603328[style=dotted];\nn55169095435288576 -> n54043195528445952[style=dotted];\nn54606145481867264 -> n53480245575024640[style=dotted];\nn51791395714760704 -> n51228445761339392[style=dotted];\nn58546795155816448 -> n56294995342131200[style=dotted];\nn56576470318841856 -> n58546795155816448[style=dotted];\nn57139420272263168 -> n56576470318841856[style=dotted];\nn57702370225684480 -> n57139420272263168[style=dotted];\nn56013520365420544 -> n51791395714760704[style=dotted];\nn67272519433846784 -> n59672695062659072[style=dotted];\nn59954170039369728 -> n67272519433846784[style=dotted];\nn64457769666740224 -> n60798594969501696[style=dotted];\nn61080069946212352 -> n64457769666740224[style=dotted];\nn61643019899633664 -> n61080069946212352[style=dotted];\nn62205969853054976 -> n61643019899633664[style=dotted];\nn63894819713318912 -> n62768919806476288[style=dotted];\nn63331869759897600 -> n62205969853054976[style=dotted];\nn60517119992791040 -> n59954170039369728[style=dotted];\nn65020719620161536 -> n60517119992791040[style=dotted];\nn65302194596872192 -> n65020719620161536[style=dotted];\nn65865144550293504 -> n65302194596872192[style=dotted];\nn66428094503714816 -> n65865144550293504[style=dotted];\nn64739244643450880 -> n60517119992791040[style=dotted];\nn50665495807918080 -> n42784196460019712[style=dotted];\nn68398419340689408 -> n68116944363978752[style=dotted];\nn68961369294110720 -> n68116944363978752[style=dotted];\nn69242844270821376 -> n68116944363978752[style=dotted];\nn67553994410557440 -> n50665495807918080[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-583.txt",
    "content": "digraph {\n\nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn281474976710656[shape=rectangle, label=\"B2\"];\nn1125899906842624[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn844424930131968[shape=rectangle, label=\"B5\"];\nn1970324836974592[shape=rectangle, label=\"B6\"];\nn1688849860263936[shape=rectangle, label=\"B7\"];\nn2533274790395904[shape=rectangle, label=\"B8\"];\nn72620543991349248[shape=rectangle, label=\"B9\"];\nn3096224743817216[shape=rectangle, label=\"B10\"];\nn2814749767106560[shape=rectangle, label=\"B11\"];\nn3659174697238528[shape=rectangle, label=\"B12\"];\nn3377699720527872[shape=rectangle, label=\"B13\"];\nn4222124650659840[shape=rectangle, label=\"B14\"];\nn3940649673949184[shape=rectangle, label=\"B15\"];\nn4785074604081152[shape=rectangle, label=\"B16\"];\nn4503599627370496[shape=rectangle, label=\"B17\"];\nn5348024557502464[shape=rectangle, label=\"B18\"];\nn5629499534213120[shape=rectangle, label=\"B19\"];\nn5066549580791808[shape=rectangle, label=\"B20\"];\nn6192449487634432[shape=rectangle, label=\"B21\"];\nn6473924464345088[shape=rectangle, label=\"B22\"];\nn5910974510923776[shape=rectangle, label=\"B23\"];\nn7036874417766400[shape=rectangle, label=\"B24\"];\nn42784196460019712[shape=rectangle, label=\"B25\"];\nn7599824371187712[shape=rectangle, label=\"B26\"];\nn7318349394477056[shape=rectangle, label=\"B27\"];\nn8162774324609024[shape=rectangle, label=\"B28\"];\nn8725724278030336[shape=rectangle, label=\"B29\"];\nn9288674231451648[shape=rectangle, label=\"B30\"];\nn9851624184872960[shape=rectangle, label=\"B31\"];\nn9570149208162304[shape=rectangle, label=\"B32\"];\nn10133099161583616[shape=rectangle, label=\"B33\"];\nn8444249301319680[shape=rectangle, label=\"B34\"];\nn10414574138294272[shape=rectangle, label=\"B35\"];\nn7881299347898368[shape=rectangle, label=\"B36\"];\nn10977524091715584[shape=rectangle, label=\"B37\"];\nn10696049115004928[shape=rectangle, label=\"B38\"];\nn11540474045136896[shape=rectangle, label=\"B39\"];\nn11258999068426240[shape=rectangle, label=\"B40\"];\nn12103423998558208[shape=rectangle, label=\"B41\"];\nn11821949021847552[shape=rectangle, label=\"B42\"];\nn12666373951979520[shape=rectangle, label=\"B43\"];\nn12384898975268864[shape=rectangle, label=\"B44\"];\nn13229323905400832[shape=rectangle, label=\"B45\"];\nn13792273858822144[shape=rectangle, label=\"B46\"];\nn13510798882111488[shape=rectangle, label=\"B47\"];\nn14355223812243456[shape=rectangle, label=\"B48\"];\nn14073748835532800[shape=rectangle, label=\"B49\"];\nn12947848928690176[shape=rectangle, label=\"B50\"];\nn14636698788954112[shape=rectangle, label=\"B51\"];\nn15199648742375424[shape=rectangle, label=\"B52\"];\nn14918173765664768[shape=rectangle, label=\"B53\"];\nn15762598695796736[shape=rectangle, label=\"B54\"];\nn15481123719086080[shape=rectangle, label=\"B55\"];\nn16325548649218048[shape=rectangle, label=\"B56\"];\nn16044073672507392[shape=rectangle, label=\"B57\"];\nn16888498602639360[shape=rectangle, label=\"B58\"];\nn16607023625928704[shape=rectangle, label=\"B59\"];\nn17451448556060672[shape=rectangle, label=\"B60\"];\nn17169973579350016[shape=rectangle, label=\"B61\"];\nn18014398509481984[shape=rectangle, label=\"B62\"];\nn18577348462903296[shape=rectangle, label=\"B63\"];\nn18295873486192640[shape=rectangle, label=\"B64\"];\nn19140298416324608[shape=rectangle, label=\"B65\"];\nn18858823439613952[shape=rectangle, label=\"B66\"];\nn17732923532771328[shape=rectangle, label=\"B67\"];\nn19421773393035264[shape=rectangle, label=\"B68\"];\nn19984723346456576[shape=rectangle, label=\"B69\"];\nn19703248369745920[shape=rectangle, label=\"B70\"];\nn20547673299877888[shape=rectangle, label=\"B71\"];\nn20266198323167232[shape=rectangle, label=\"B72\"];\nn21110623253299200[shape=rectangle, label=\"B73\"];\nn20829148276588544[shape=rectangle, label=\"B74\"];\nn21673573206720512[shape=rectangle, label=\"B75\"];\nn21392098230009856[shape=rectangle, label=\"B76\"];\nn22236523160141824[shape=rectangle, label=\"B77\"];\nn21955048183431168[shape=rectangle, label=\"B78\"];\nn22799473113563136[shape=rectangle, label=\"B79\"];\nn22517998136852480[shape=rectangle, label=\"B80\"];\nn23362423066984448[shape=rectangle, label=\"B81\"];\nn23080948090273792[shape=rectangle, label=\"B82\"];\nn23925373020405760[shape=rectangle, label=\"B83\"];\nn24488322973827072[shape=rectangle, label=\"B84\"];\nn24206847997116416[shape=rectangle, label=\"B85\"];\nn25051272927248384[shape=rectangle, label=\"B86\"];\nn24769797950537728[shape=rectangle, label=\"B87\"];\nn23643898043695104[shape=rectangle, label=\"B88\"];\nn25332747903959040[shape=rectangle, label=\"B89\"];\nn25895697857380352[shape=rectangle, label=\"B90\"];\nn25614222880669696[shape=rectangle, label=\"B91\"];\nn26458647810801664[shape=rectangle, label=\"B92\"];\nn26177172834091008[shape=rectangle, label=\"B93\"];\nn27021597764222976[shape=rectangle, label=\"B94\"];\nn26740122787512320[shape=rectangle, label=\"B95\"];\nn27584547717644288[shape=rectangle, label=\"B96\"];\nn27303072740933632[shape=rectangle, label=\"B97\"];\nn28147497671065600[shape=rectangle, label=\"B98\"];\nn27866022694354944[shape=rectangle, label=\"B99\"];\nn28710447624486912[shape=rectangle, label=\"B100\"];\nn29273397577908224[shape=rectangle, label=\"B101\"];\nn28991922601197568[shape=rectangle, label=\"B102\"];\nn29836347531329536[shape=rectangle, label=\"B103\"];\nn29554872554618880[shape=rectangle, label=\"B104\"];\nn28428972647776256[shape=rectangle, label=\"B105\"];\nn30117822508040192[shape=rectangle, label=\"B106\"];\nn30680772461461504[shape=rectangle, label=\"B107\"];\nn30399297484750848[shape=rectangle, label=\"B108\"];\nn31243722414882816[shape=rectangle, label=\"B109\"];\nn30962247438172160[shape=rectangle, label=\"B110\"];\nn31806672368304128[shape=rectangle, label=\"B111\"];\nn31525197391593472[shape=rectangle, label=\"B112\"];\nn32369622321725440[shape=rectangle, label=\"B113\"];\nn32088147345014784[shape=rectangle, label=\"B114\"];\nn32932572275146752[shape=rectangle, label=\"B115\"];\nn32651097298436096[shape=rectangle, label=\"B116\"];\nn33495522228568064[shape=rectangle, label=\"B117\"];\nn34058472181989376[shape=rectangle, label=\"B118\"];\nn33776997205278720[shape=rectangle, label=\"B119\"];\nn34621422135410688[shape=rectangle, label=\"B120\"];\nn34339947158700032[shape=rectangle, label=\"B121\"];\nn33214047251857408[shape=rectangle, label=\"B122\"];\nn34902897112121344[shape=rectangle, label=\"B123\"];\nn35465847065542656[shape=rectangle, label=\"B124\"];\nn35184372088832000[shape=rectangle, label=\"B125\"];\nn36028797018963968[shape=rectangle, label=\"B126\"];\nn35747322042253312[shape=rectangle, label=\"B127\"];\nn36591746972385280[shape=rectangle, label=\"B128\"];\nn36310271995674624[shape=rectangle, label=\"B129\"];\nn37154696925806592[shape=rectangle, label=\"B130\"];\nn36873221949095936[shape=rectangle, label=\"B131\"];\nn37717646879227904[shape=rectangle, label=\"B132\"];\nn37436171902517248[shape=rectangle, label=\"B133\"];\nn38280596832649216[shape=rectangle, label=\"B134\"];\nn37999121855938560[shape=rectangle, label=\"B135\"];\nn38843546786070528[shape=rectangle, label=\"B136\"];\nn38562071809359872[shape=rectangle, label=\"B137\"];\nn39406496739491840[shape=rectangle, label=\"B138\"];\nn39969446692913152[shape=rectangle, label=\"B139\"];\nn39687971716202496[shape=rectangle, label=\"B140\"];\nn40532396646334464[shape=rectangle, label=\"B141\"];\nn40250921669623808[shape=rectangle, label=\"B142\"];\nn39125021762781184[shape=rectangle, label=\"B143\"];\nn40813871623045120[shape=rectangle, label=\"B144\"];\nn41376821576466432[shape=rectangle, label=\"B145\"];\nn41939771529887744[shape=rectangle, label=\"B146\"];\nn41095346599755776[shape=rectangle, label=\"B147\"];\nn41658296553177088[shape=rectangle, label=\"B148\"];\nn9007199254740992[shape=rectangle, label=\"B149\"];\nn42502721483309056[shape=rectangle, label=\"B150\"];\nn42221246506598400[shape=rectangle, label=\"B151\"];\nn6755399441055744[shape=rectangle, label=\"B152\"];\nn43347146413441024[shape=rectangle, label=\"B153\"];\nn72339069014638592[shape=rectangle, label=\"B154\"];\nn43910096366862336[shape=rectangle, label=\"B155\"];\nn43628621390151680[shape=rectangle, label=\"B156\"];\nn44473046320283648[shape=rectangle, label=\"B157\"];\nn45035996273704960[shape=rectangle, label=\"B158\"];\nn44754521296994304[shape=rectangle, label=\"B159\"];\nn45598946227126272[shape=rectangle, label=\"B160\"];\nn45880421203836928[shape=rectangle, label=\"B161\"];\nn45317471250415616[shape=rectangle, label=\"B162\"];\nn46724846133968896[shape=rectangle, label=\"B163\"];\nn46443371157258240[shape=rectangle, label=\"B164\"];\nn47287796087390208[shape=rectangle, label=\"B165\"];\nn47850746040811520[shape=rectangle, label=\"B166\"];\nn48413695994232832[shape=rectangle, label=\"B167\"];\nn48132221017522176[shape=rectangle, label=\"B168\"];\nn48695170970943488[shape=rectangle, label=\"B169\"];\nn49258120924364800[shape=rectangle, label=\"B170\"];\nn48976645947654144[shape=rectangle, label=\"B171\"];\nn49821070877786112[shape=rectangle, label=\"B172\"];\nn50102545854496768[shape=rectangle, label=\"B173\"];\nn50384020831207424[shape=rectangle, label=\"B174\"];\nn50665495807918080[shape=rectangle, label=\"B175\"];\nn50946970784628736[shape=rectangle, label=\"B176\"];\nn49539595901075456[shape=rectangle, label=\"B177\"];\nn51228445761339392[shape=rectangle, label=\"B178\"];\nn51791395714760704[shape=rectangle, label=\"B179\"];\nn51509920738050048[shape=rectangle, label=\"B180\"];\nn52354345668182016[shape=rectangle, label=\"B181\"];\nn52072870691471360[shape=rectangle, label=\"B182\"];\nn52917295621603328[shape=rectangle, label=\"B183\"];\nn52635820644892672[shape=rectangle, label=\"B184\"];\nn53198770598313984[shape=rectangle, label=\"B185\"];\nn53761720551735296[shape=rectangle, label=\"B186\"];\nn53480245575024640[shape=rectangle, label=\"B187\"];\nn54324670505156608[shape=rectangle, label=\"B188\"];\nn54043195528445952[shape=rectangle, label=\"B189\"];\nn54887620458577920[shape=rectangle, label=\"B190\"];\nn54606145481867264[shape=rectangle, label=\"B191\"];\nn55169095435288576[shape=rectangle, label=\"B192\"];\nn55732045388709888[shape=rectangle, label=\"B193\"];\nn55450570411999232[shape=rectangle, label=\"B194\"];\nn56294995342131200[shape=rectangle, label=\"B195\"];\nn56013520365420544[shape=rectangle, label=\"B196\"];\nn56857945295552512[shape=rectangle, label=\"B197\"];\nn56576470318841856[shape=rectangle, label=\"B198\"];\nn57420895248973824[shape=rectangle, label=\"B199\"];\nn57139420272263168[shape=rectangle, label=\"B200\"];\nn57702370225684480[shape=rectangle, label=\"B201\"];\nn58265320179105792[shape=rectangle, label=\"B202\"];\nn58828270132527104[shape=rectangle, label=\"B203\"];\nn58546795155816448[shape=rectangle, label=\"B204\"];\nn59109745109237760[shape=rectangle, label=\"B205\"];\nn59672695062659072[shape=rectangle, label=\"B206\"];\nn59391220085948416[shape=rectangle, label=\"B207\"];\nn60235645016080384[shape=rectangle, label=\"B208\"];\nn60517119992791040[shape=rectangle, label=\"B209\"];\nn61080069946212352[shape=rectangle, label=\"B210\"];\nn60798594969501696[shape=rectangle, label=\"B211\"];\nn61361544922923008[shape=rectangle, label=\"B212\"];\nn61924494876344320[shape=rectangle, label=\"B213\"];\nn61643019899633664[shape=rectangle, label=\"B214\"];\nn62205969853054976[shape=rectangle, label=\"B215\"];\nn62487444829765632[shape=rectangle, label=\"B216\"];\nn62768919806476288[shape=rectangle, label=\"B217\"];\nn63050394783186944[shape=rectangle, label=\"B218\"];\nn63331869759897600[shape=rectangle, label=\"B219\"];\nn59954170039369728[shape=rectangle, label=\"B220\"];\nn63894819713318912[shape=rectangle, label=\"B221\"];\nn63613344736608256[shape=rectangle, label=\"B222\"];\nn64176294690029568[shape=rectangle, label=\"B223\"];\nn57983845202395136[shape=rectangle, label=\"B224\"];\nn64739244643450880[shape=rectangle, label=\"B225\"];\nn64457769666740224[shape=rectangle, label=\"B226\"];\nn65020719620161536[shape=rectangle, label=\"B227\"];\nn47569271064100864[shape=rectangle, label=\"B228\"];\nn65583669573582848[shape=rectangle, label=\"B229\"];\nn66146619527004160[shape=rectangle, label=\"B230\"];\nn65865144550293504[shape=rectangle, label=\"B231\"];\nn66428094503714816[shape=rectangle, label=\"B232\"];\nn66991044457136128[shape=rectangle, label=\"B233\"];\nn66709569480425472[shape=rectangle, label=\"B234\"];\nn67272519433846784[shape=rectangle, label=\"B235\"];\nn67553994410557440[shape=rectangle, label=\"B236\"];\nn67835469387268096[shape=rectangle, label=\"B237\"];\nn68116944363978752[shape=rectangle, label=\"B238\"];\nn68398419340689408[shape=rectangle, label=\"B239\"];\nn65302194596872192[shape=rectangle, label=\"B240\"];\nn68961369294110720[shape=rectangle, label=\"B241\"];\nn69524319247532032[shape=rectangle, label=\"B242\"];\nn69242844270821376[shape=rectangle, label=\"B243\"];\nn68679894317400064[shape=rectangle, label=\"B244\"];\nn69805794224242688[shape=rectangle, label=\"B245\"];\nn47006321110679552[shape=rectangle, label=\"B246\"];\nn70368744177664000[shape=rectangle, label=\"B247\"];\nn70087269200953344[shape=rectangle, label=\"B248\"];\nn70650219154374656[shape=rectangle, label=\"B249\"];\nn71213169107795968[shape=rectangle, label=\"B250\"];\nn70931694131085312[shape=rectangle, label=\"B251\"];\nn71776119061217280[shape=rectangle, label=\"B252\"];\nn71494644084506624[shape=rectangle, label=\"B253\"];\nn72057594037927936[shape=rectangle, label=\"B254\"];\nn46161896180547584[shape=rectangle, label=\"B255\"];\nn44191571343572992[shape=rectangle, label=\"B256\"];\nn43065671436730368[shape=rectangle, label=\"B257\"];\nn72902018968059904[shape=rectangle, label=\"B258\"];\nn2251799813685248[shape=rectangle, label=\"B259\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n281474976710656;\nn281474976710656 -> n844424930131968;\nn281474976710656 -> n1125899906842624;\nn1125899906842624 -> n844424930131968;\nn1125899906842624 -> n1407374883553280;\nn1407374883553280 -> n1125899906842624;\nn1407374883553280 -> n844424930131968;\nn844424930131968 -> n1688849860263936;\nn844424930131968 -> n1970324836974592;\nn1970324836974592 -> n1688849860263936;\nn1688849860263936 -> n2251799813685248;\nn1688849860263936 -> n2533274790395904;\nn2533274790395904 -> n72620543991349248;\nn72620543991349248 -> n2814749767106560;\nn72620543991349248 -> n3096224743817216;\nn3096224743817216 -> n2814749767106560;\nn2814749767106560 -> n3377699720527872;\nn2814749767106560 -> n3659174697238528;\nn3659174697238528 -> n3377699720527872;\nn3377699720527872 -> n3940649673949184;\nn3377699720527872 -> n4222124650659840;\nn4222124650659840 -> n3940649673949184;\nn3940649673949184 -> n4503599627370496;\nn3940649673949184 -> n4785074604081152;\nn4785074604081152 -> n4503599627370496;\nn4503599627370496 -> n5066549580791808;\nn4503599627370496 -> n5348024557502464;\nn5348024557502464 -> n5066549580791808;\nn5348024557502464 -> n5629499534213120;\nn5629499534213120 -> n5066549580791808;\nn5066549580791808 -> n5910974510923776;\nn5066549580791808 -> n6192449487634432;\nn6192449487634432 -> n5910974510923776;\nn6192449487634432 -> n6473924464345088;\nn6473924464345088 -> n5910974510923776;\nn5910974510923776 -> n6755399441055744;\nn5910974510923776 -> n7036874417766400;\nn7036874417766400 -> n42784196460019712;\nn42784196460019712 -> n7318349394477056;\nn42784196460019712 -> n7599824371187712;\nn7599824371187712 -> n7318349394477056;\nn7318349394477056 -> n7881299347898368;\nn7318349394477056 -> n8162774324609024;\nn8162774324609024 -> n8444249301319680;\nn8162774324609024 -> n8725724278030336;\nn8725724278030336 -> n9007199254740992;\nn8725724278030336 -> n9288674231451648;\nn9288674231451648 -> n9570149208162304;\nn9288674231451648 -> n9851624184872960;\nn9851624184872960 -> n9570149208162304;\nn9570149208162304 -> n9007199254740992;\nn9570149208162304 -> n10133099161583616;\nn10133099161583616 -> n9007199254740992;\nn8444249301319680 -> n9007199254740992;\nn8444249301319680 -> n10414574138294272;\nn10414574138294272 -> n9007199254740992;\nn7881299347898368 -> n10696049115004928;\nn7881299347898368 -> n10977524091715584;\nn10977524091715584 -> n9007199254740992;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n11258999068426240;\nn10696049115004928 -> n11540474045136896;\nn11540474045136896 -> n11258999068426240;\nn11258999068426240 -> n11821949021847552;\nn11258999068426240 -> n12103423998558208;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn11821949021847552 -> n12666373951979520;\nn12666373951979520 -> n12384898975268864;\nn12384898975268864 -> n12947848928690176;\nn12384898975268864 -> n13229323905400832;\nn13229323905400832 -> n13510798882111488;\nn13229323905400832 -> n13792273858822144;\nn13792273858822144 -> n13510798882111488;\nn13510798882111488 -> n14073748835532800;\nn13510798882111488 -> n14355223812243456;\nn14355223812243456 -> n14073748835532800;\nn14073748835532800 -> n14636698788954112;\nn14073748835532800 -> n12947848928690176;\nn12947848928690176 -> n14636698788954112;\nn14636698788954112 -> n14918173765664768;\nn14636698788954112 -> n15199648742375424;\nn15199648742375424 -> n14918173765664768;\nn14918173765664768 -> n15481123719086080;\nn14918173765664768 -> n15762598695796736;\nn15762598695796736 -> n15481123719086080;\nn15481123719086080 -> n16044073672507392;\nn15481123719086080 -> n16325548649218048;\nn16325548649218048 -> n16044073672507392;\nn16044073672507392 -> n16607023625928704;\nn16044073672507392 -> n16888498602639360;\nn16888498602639360 -> n16607023625928704;\nn16607023625928704 -> n17169973579350016;\nn16607023625928704 -> n17451448556060672;\nn17451448556060672 -> n17169973579350016;\nn17169973579350016 -> n17732923532771328;\nn17169973579350016 -> n18014398509481984;\nn18014398509481984 -> n18295873486192640;\nn18014398509481984 -> n18577348462903296;\nn18577348462903296 -> n18295873486192640;\nn18295873486192640 -> n18858823439613952;\nn18295873486192640 -> n19140298416324608;\nn19140298416324608 -> n18858823439613952;\nn18858823439613952 -> n19421773393035264;\nn18858823439613952 -> n17732923532771328;\nn17732923532771328 -> n19421773393035264;\nn19421773393035264 -> n19703248369745920;\nn19421773393035264 -> n19984723346456576;\nn19984723346456576 -> n19703248369745920;\nn19703248369745920 -> n20266198323167232;\nn19703248369745920 -> n20547673299877888;\nn20547673299877888 -> n20266198323167232;\nn20266198323167232 -> n20829148276588544;\nn20266198323167232 -> n21110623253299200;\nn21110623253299200 -> n20829148276588544;\nn20829148276588544 -> n21392098230009856;\nn20829148276588544 -> n21673573206720512;\nn21673573206720512 -> n21392098230009856;\nn21392098230009856 -> n21955048183431168;\nn21392098230009856 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn21955048183431168 -> n22517998136852480;\nn21955048183431168 -> n22799473113563136;\nn22799473113563136 -> n22517998136852480;\nn22517998136852480 -> n23080948090273792;\nn22517998136852480 -> n23362423066984448;\nn23362423066984448 -> n23080948090273792;\nn23080948090273792 -> n23643898043695104;\nn23080948090273792 -> n23925373020405760;\nn23925373020405760 -> n24206847997116416;\nn23925373020405760 -> n24488322973827072;\nn24488322973827072 -> n24206847997116416;\nn24206847997116416 -> n24769797950537728;\nn24206847997116416 -> n25051272927248384;\nn25051272927248384 -> n24769797950537728;\nn24769797950537728 -> n25332747903959040;\nn24769797950537728 -> n23643898043695104;\nn23643898043695104 -> n25332747903959040;\nn25332747903959040 -> n25614222880669696;\nn25332747903959040 -> n25895697857380352;\nn25895697857380352 -> n25614222880669696;\nn25614222880669696 -> n26177172834091008;\nn25614222880669696 -> n26458647810801664;\nn26458647810801664 -> n26177172834091008;\nn26177172834091008 -> n26740122787512320;\nn26177172834091008 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn26740122787512320 -> n27303072740933632;\nn26740122787512320 -> n27584547717644288;\nn27584547717644288 -> n27303072740933632;\nn27303072740933632 -> n27866022694354944;\nn27303072740933632 -> n28147497671065600;\nn28147497671065600 -> n27866022694354944;\nn27866022694354944 -> n28428972647776256;\nn27866022694354944 -> n28710447624486912;\nn28710447624486912 -> n28991922601197568;\nn28710447624486912 -> n29273397577908224;\nn29273397577908224 -> n28991922601197568;\nn28991922601197568 -> n29554872554618880;\nn28991922601197568 -> n29836347531329536;\nn29836347531329536 -> n29554872554618880;\nn29554872554618880 -> n30117822508040192;\nn29554872554618880 -> n28428972647776256;\nn28428972647776256 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30680772461461504;\nn30680772461461504 -> n30399297484750848;\nn30399297484750848 -> n30962247438172160;\nn30399297484750848 -> n31243722414882816;\nn31243722414882816 -> n30962247438172160;\nn30962247438172160 -> n31525197391593472;\nn30962247438172160 -> n31806672368304128;\nn31806672368304128 -> n31525197391593472;\nn31525197391593472 -> n32088147345014784;\nn31525197391593472 -> n32369622321725440;\nn32369622321725440 -> n32088147345014784;\nn32088147345014784 -> n32651097298436096;\nn32088147345014784 -> n32932572275146752;\nn32932572275146752 -> n32651097298436096;\nn32651097298436096 -> n33214047251857408;\nn32651097298436096 -> n33495522228568064;\nn33495522228568064 -> n33776997205278720;\nn33495522228568064 -> n34058472181989376;\nn34058472181989376 -> n33776997205278720;\nn33776997205278720 -> n34339947158700032;\nn33776997205278720 -> n34621422135410688;\nn34621422135410688 -> n34339947158700032;\nn34339947158700032 -> n34902897112121344;\nn34339947158700032 -> n33214047251857408;\nn33214047251857408 -> n34902897112121344;\nn34902897112121344 -> n35184372088832000;\nn34902897112121344 -> n35465847065542656;\nn35465847065542656 -> n35184372088832000;\nn35184372088832000 -> n35747322042253312;\nn35184372088832000 -> n36028797018963968;\nn36028797018963968 -> n35747322042253312;\nn35747322042253312 -> n36310271995674624;\nn35747322042253312 -> n36591746972385280;\nn36591746972385280 -> n36310271995674624;\nn36310271995674624 -> n36873221949095936;\nn36310271995674624 -> n37154696925806592;\nn37154696925806592 -> n36873221949095936;\nn36873221949095936 -> n37436171902517248;\nn36873221949095936 -> n37717646879227904;\nn37717646879227904 -> n37436171902517248;\nn37436171902517248 -> n37999121855938560;\nn37436171902517248 -> n38280596832649216;\nn38280596832649216 -> n37999121855938560;\nn37999121855938560 -> n38562071809359872;\nn37999121855938560 -> n38843546786070528;\nn38843546786070528 -> n38562071809359872;\nn38562071809359872 -> n39125021762781184;\nn38562071809359872 -> n39406496739491840;\nn39406496739491840 -> n39687971716202496;\nn39406496739491840 -> n39969446692913152;\nn39969446692913152 -> n39687971716202496;\nn39687971716202496 -> n40250921669623808;\nn39687971716202496 -> n40532396646334464;\nn40532396646334464 -> n40250921669623808;\nn40250921669623808 -> n40813871623045120;\nn40250921669623808 -> n39125021762781184;\nn39125021762781184 -> n40813871623045120;\nn40813871623045120 -> n41095346599755776;\nn40813871623045120 -> n41376821576466432;\nn41376821576466432 -> n41658296553177088;\nn41376821576466432 -> n41939771529887744;\nn41939771529887744 -> n41376821576466432;\nn41939771529887744 -> n41095346599755776;\nn41095346599755776 -> n41658296553177088;\nn41658296553177088 -> n9007199254740992;\nn9007199254740992 -> n42221246506598400;\nn9007199254740992 -> n42502721483309056;\nn42502721483309056 -> n42221246506598400;\nn42221246506598400 -> n42784196460019712;\nn42221246506598400 -> n6755399441055744;\nn6755399441055744 -> n43065671436730368;\nn6755399441055744 -> n43347146413441024;\nn43347146413441024 -> n72339069014638592;\nn72339069014638592 -> n43628621390151680;\nn72339069014638592 -> n43910096366862336;\nn43910096366862336 -> n43628621390151680;\nn43628621390151680 -> n44191571343572992;\nn43628621390151680 -> n44473046320283648;\nn44473046320283648 -> n44754521296994304;\nn44473046320283648 -> n45035996273704960;\nn45035996273704960 -> n44754521296994304;\nn44754521296994304 -> n45317471250415616;\nn44754521296994304 -> n45598946227126272;\nn45598946227126272 -> n44191571343572992;\nn45598946227126272 -> n45880421203836928;\nn45880421203836928 -> n46161896180547584;\nn45317471250415616 -> n46443371157258240;\nn45317471250415616 -> n46724846133968896;\nn46724846133968896 -> n46443371157258240;\nn46443371157258240 -> n47006321110679552;\nn46443371157258240 -> n47287796087390208;\nn47287796087390208 -> n47569271064100864;\nn47287796087390208 -> n47850746040811520;\nn47850746040811520 -> n48132221017522176;\nn47850746040811520 -> n48413695994232832;\nn48413695994232832 -> n48132221017522176;\nn48132221017522176 -> n47569271064100864;\nn48132221017522176 -> n48695170970943488;\nn48695170970943488 -> n48976645947654144;\nn48695170970943488 -> n49258120924364800;\nn49258120924364800 -> n48976645947654144;\nn48976645947654144 -> n49539595901075456;\nn48976645947654144 -> n49821070877786112;\nn49821070877786112 -> n49539595901075456;\nn49821070877786112 -> n50102545854496768;\nn50102545854496768 -> n49539595901075456;\nn50102545854496768 -> n50384020831207424;\nn50384020831207424 -> n49539595901075456;\nn50384020831207424 -> n50665495807918080;\nn50665495807918080 -> n49539595901075456;\nn50665495807918080 -> n50946970784628736;\nn50946970784628736 -> n47569271064100864;\nn50946970784628736 -> n49539595901075456;\nn49539595901075456 -> n47569271064100864;\nn49539595901075456 -> n51228445761339392;\nn51228445761339392 -> n51509920738050048;\nn51228445761339392 -> n51791395714760704;\nn51791395714760704 -> n51509920738050048;\nn51509920738050048 -> n52072870691471360;\nn51509920738050048 -> n52354345668182016;\nn52354345668182016 -> n52072870691471360;\nn52072870691471360 -> n52635820644892672;\nn52072870691471360 -> n52917295621603328;\nn52917295621603328 -> n53198770598313984;\nn52917295621603328 -> n52635820644892672;\nn52635820644892672 -> n53198770598313984;\nn53198770598313984 -> n53480245575024640;\nn53198770598313984 -> n53761720551735296;\nn53761720551735296 -> n53480245575024640;\nn53480245575024640 -> n54043195528445952;\nn53480245575024640 -> n54324670505156608;\nn54324670505156608 -> n54043195528445952;\nn54043195528445952 -> n54606145481867264;\nn54043195528445952 -> n54887620458577920;\nn54887620458577920 -> n55169095435288576;\nn54887620458577920 -> n54606145481867264;\nn54606145481867264 -> n55169095435288576;\nn55169095435288576 -> n55450570411999232;\nn55169095435288576 -> n55732045388709888;\nn55732045388709888 -> n55450570411999232;\nn55450570411999232 -> n56013520365420544;\nn55450570411999232 -> n56294995342131200;\nn56294995342131200 -> n56013520365420544;\nn56013520365420544 -> n56576470318841856;\nn56013520365420544 -> n56857945295552512;\nn56857945295552512 -> n56576470318841856;\nn56576470318841856 -> n57139420272263168;\nn56576470318841856 -> n57420895248973824;\nn57420895248973824 -> n57702370225684480;\nn57420895248973824 -> n57139420272263168;\nn57139420272263168 -> n57702370225684480;\nn57702370225684480 -> n57983845202395136;\nn57702370225684480 -> n58265320179105792;\nn58265320179105792 -> n58546795155816448;\nn58265320179105792 -> n58828270132527104;\nn58828270132527104 -> n58546795155816448;\nn58546795155816448 -> n47569271064100864;\nn58546795155816448 -> n59109745109237760;\nn59109745109237760 -> n59391220085948416;\nn59109745109237760 -> n59672695062659072;\nn59672695062659072 -> n59391220085948416;\nn59391220085948416 -> n59954170039369728;\nn59391220085948416 -> n60235645016080384;\nn60235645016080384 -> n47569271064100864;\nn60235645016080384 -> n60517119992791040;\nn60517119992791040 -> n60798594969501696;\nn60517119992791040 -> n61080069946212352;\nn61080069946212352 -> n60798594969501696;\nn60798594969501696 -> n47569271064100864;\nn60798594969501696 -> n61361544922923008;\nn61361544922923008 -> n61643019899633664;\nn61361544922923008 -> n61924494876344320;\nn61924494876344320 -> n61643019899633664;\nn61643019899633664 -> n59954170039369728;\nn61643019899633664 -> n62205969853054976;\nn62205969853054976 -> n59954170039369728;\nn62205969853054976 -> n62487444829765632;\nn62487444829765632 -> n59954170039369728;\nn62487444829765632 -> n62768919806476288;\nn62768919806476288 -> n59954170039369728;\nn62768919806476288 -> n63050394783186944;\nn63050394783186944 -> n59954170039369728;\nn63050394783186944 -> n63331869759897600;\nn63331869759897600 -> n47569271064100864;\nn63331869759897600 -> n59954170039369728;\nn59954170039369728 -> n63613344736608256;\nn59954170039369728 -> n63894819713318912;\nn63894819713318912 -> n63613344736608256;\nn63613344736608256 -> n58265320179105792;\nn63613344736608256 -> n64176294690029568;\nn64176294690029568 -> n58265320179105792;\nn57983845202395136 -> n64457769666740224;\nn57983845202395136 -> n64739244643450880;\nn64739244643450880 -> n64457769666740224;\nn64457769666740224 -> n47569271064100864;\nn64457769666740224 -> n65020719620161536;\nn65020719620161536 -> n47569271064100864;\nn47569271064100864 -> n65302194596872192;\nn47569271064100864 -> n65583669573582848;\nn65583669573582848 -> n65865144550293504;\nn65583669573582848 -> n66146619527004160;\nn66146619527004160 -> n65865144550293504;\nn65865144550293504 -> n65302194596872192;\nn65865144550293504 -> n66428094503714816;\nn66428094503714816 -> n66709569480425472;\nn66428094503714816 -> n66991044457136128;\nn66991044457136128 -> n66709569480425472;\nn66709569480425472 -> n47006321110679552;\nn66709569480425472 -> n67272519433846784;\nn67272519433846784 -> n47006321110679552;\nn67272519433846784 -> n67553994410557440;\nn67553994410557440 -> n47006321110679552;\nn67553994410557440 -> n67835469387268096;\nn67835469387268096 -> n47006321110679552;\nn67835469387268096 -> n68116944363978752;\nn68116944363978752 -> n47006321110679552;\nn68116944363978752 -> n68398419340689408;\nn68398419340689408 -> n47006321110679552;\nn68398419340689408 -> n65302194596872192;\nn65302194596872192 -> n68679894317400064;\nn65302194596872192 -> n68961369294110720;\nn68961369294110720 -> n69242844270821376;\nn68961369294110720 -> n69524319247532032;\nn69524319247532032 -> n69242844270821376;\nn69242844270821376 -> n47006321110679552;\nn69242844270821376 -> n68679894317400064;\nn68679894317400064 -> n47006321110679552;\nn68679894317400064 -> n69805794224242688;\nn69805794224242688 -> n47006321110679552;\nn47006321110679552 -> n70087269200953344;\nn47006321110679552 -> n70368744177664000;\nn70368744177664000 -> n70087269200953344;\nn70087269200953344 -> n44191571343572992;\nn70087269200953344 -> n70650219154374656;\nn70650219154374656 -> n70931694131085312;\nn70650219154374656 -> n71213169107795968;\nn71213169107795968 -> n70931694131085312;\nn70931694131085312 -> n71494644084506624;\nn70931694131085312 -> n71776119061217280;\nn71776119061217280 -> n71494644084506624;\nn71494644084506624 -> n44191571343572992;\nn71494644084506624 -> n72057594037927936;\nn72057594037927936 -> n46161896180547584;\nn46161896180547584 -> n44191571343572992;\nn44191571343572992 -> n72339069014638592;\nn44191571343572992 -> n43065671436730368;\nn43065671436730368 -> n72620543991349248;\nn43065671436730368 -> n72902018968059904;\nn72902018968059904 -> n2251799813685248;\nn281474976710656 -> n0[style=dotted];\nn1125899906842624 -> n281474976710656[style=dotted];\nn844424930131968 -> n281474976710656[style=dotted];\nn1688849860263936 -> n844424930131968[style=dotted];\nn72620543991349248 -> n2533274790395904[style=dotted];\nn2814749767106560 -> n72620543991349248[style=dotted];\nn3377699720527872 -> n2814749767106560[style=dotted];\nn3940649673949184 -> n3377699720527872[style=dotted];\nn4503599627370496 -> n3940649673949184[style=dotted];\nn5066549580791808 -> n4503599627370496[style=dotted];\nn5910974510923776 -> n5066549580791808[style=dotted];\nn42784196460019712 -> n7036874417766400[style=dotted];\nn7318349394477056 -> n42784196460019712[style=dotted];\nn9570149208162304 -> n9288674231451648[style=dotted];\nn10696049115004928 -> n7881299347898368[style=dotted];\nn11258999068426240 -> n10696049115004928[style=dotted];\nn11821949021847552 -> n11258999068426240[style=dotted];\nn12384898975268864 -> n11821949021847552[style=dotted];\nn13510798882111488 -> n13229323905400832[style=dotted];\nn14073748835532800 -> n13510798882111488[style=dotted];\nn12947848928690176 -> n12384898975268864[style=dotted];\nn14636698788954112 -> n12384898975268864[style=dotted];\nn14918173765664768 -> n14636698788954112[style=dotted];\nn15481123719086080 -> n14918173765664768[style=dotted];\nn16044073672507392 -> n15481123719086080[style=dotted];\nn16607023625928704 -> n16044073672507392[style=dotted];\nn17169973579350016 -> n16607023625928704[style=dotted];\nn18295873486192640 -> n18014398509481984[style=dotted];\nn18858823439613952 -> n18295873486192640[style=dotted];\nn17732923532771328 -> n17169973579350016[style=dotted];\nn19421773393035264 -> n17169973579350016[style=dotted];\nn19703248369745920 -> n19421773393035264[style=dotted];\nn20266198323167232 -> n19703248369745920[style=dotted];\nn20829148276588544 -> n20266198323167232[style=dotted];\nn21392098230009856 -> n20829148276588544[style=dotted];\nn21955048183431168 -> n21392098230009856[style=dotted];\nn22517998136852480 -> n21955048183431168[style=dotted];\nn23080948090273792 -> n22517998136852480[style=dotted];\nn24206847997116416 -> n23925373020405760[style=dotted];\nn24769797950537728 -> n24206847997116416[style=dotted];\nn23643898043695104 -> n23080948090273792[style=dotted];\nn25332747903959040 -> n23080948090273792[style=dotted];\nn25614222880669696 -> n25332747903959040[style=dotted];\nn26177172834091008 -> n25614222880669696[style=dotted];\nn26740122787512320 -> n26177172834091008[style=dotted];\nn27303072740933632 -> n26740122787512320[style=dotted];\nn27866022694354944 -> n27303072740933632[style=dotted];\nn28991922601197568 -> n28710447624486912[style=dotted];\nn29554872554618880 -> n28991922601197568[style=dotted];\nn28428972647776256 -> n27866022694354944[style=dotted];\nn30117822508040192 -> n27866022694354944[style=dotted];\nn30399297484750848 -> n30117822508040192[style=dotted];\nn30962247438172160 -> n30399297484750848[style=dotted];\nn31525197391593472 -> n30962247438172160[style=dotted];\nn32088147345014784 -> n31525197391593472[style=dotted];\nn32651097298436096 -> n32088147345014784[style=dotted];\nn33776997205278720 -> n33495522228568064[style=dotted];\nn34339947158700032 -> n33776997205278720[style=dotted];\nn33214047251857408 -> n32651097298436096[style=dotted];\nn34902897112121344 -> n32651097298436096[style=dotted];\nn35184372088832000 -> n34902897112121344[style=dotted];\nn35747322042253312 -> n35184372088832000[style=dotted];\nn36310271995674624 -> n35747322042253312[style=dotted];\nn36873221949095936 -> n36310271995674624[style=dotted];\nn37436171902517248 -> n36873221949095936[style=dotted];\nn37999121855938560 -> n37436171902517248[style=dotted];\nn38562071809359872 -> n37999121855938560[style=dotted];\nn39687971716202496 -> n39406496739491840[style=dotted];\nn40250921669623808 -> n39687971716202496[style=dotted];\nn39125021762781184 -> n38562071809359872[style=dotted];\nn40813871623045120 -> n38562071809359872[style=dotted];\nn41376821576466432 -> n40813871623045120[style=dotted];\nn41095346599755776 -> n40813871623045120[style=dotted];\nn41658296553177088 -> n40813871623045120[style=dotted];\nn9007199254740992 -> n7318349394477056[style=dotted];\nn42221246506598400 -> n9007199254740992[style=dotted];\nn6755399441055744 -> n5910974510923776[style=dotted];\nn72339069014638592 -> n43347146413441024[style=dotted];\nn43628621390151680 -> n72339069014638592[style=dotted];\nn44754521296994304 -> n44473046320283648[style=dotted];\nn46443371157258240 -> n45317471250415616[style=dotted];\nn48132221017522176 -> n47850746040811520[style=dotted];\nn48976645947654144 -> n48695170970943488[style=dotted];\nn49539595901075456 -> n48976645947654144[style=dotted];\nn51509920738050048 -> n51228445761339392[style=dotted];\nn52072870691471360 -> n51509920738050048[style=dotted];\nn52635820644892672 -> n52072870691471360[style=dotted];\nn53198770598313984 -> n52072870691471360[style=dotted];\nn53480245575024640 -> n53198770598313984[style=dotted];\nn54043195528445952 -> n53480245575024640[style=dotted];\nn54606145481867264 -> n54043195528445952[style=dotted];\nn55169095435288576 -> n54043195528445952[style=dotted];\nn55450570411999232 -> n55169095435288576[style=dotted];\nn56013520365420544 -> n55450570411999232[style=dotted];\nn56576470318841856 -> n56013520365420544[style=dotted];\nn57139420272263168 -> n56576470318841856[style=dotted];\nn57702370225684480 -> n56576470318841856[style=dotted];\nn58265320179105792 -> n57702370225684480[style=dotted];\nn58546795155816448 -> n58265320179105792[style=dotted];\nn59391220085948416 -> n59109745109237760[style=dotted];\nn60798594969501696 -> n60517119992791040[style=dotted];\nn61643019899633664 -> n61361544922923008[style=dotted];\nn59954170039369728 -> n59391220085948416[style=dotted];\nn63613344736608256 -> n59954170039369728[style=dotted];\nn64457769666740224 -> n57983845202395136[style=dotted];\nn47569271064100864 -> n47287796087390208[style=dotted];\nn65865144550293504 -> n65583669573582848[style=dotted];\nn66709569480425472 -> n66428094503714816[style=dotted];\nn65302194596872192 -> n47569271064100864[style=dotted];\nn69242844270821376 -> n68961369294110720[style=dotted];\nn68679894317400064 -> n65302194596872192[style=dotted];\nn47006321110679552 -> n46443371157258240[style=dotted];\nn70087269200953344 -> n47006321110679552[style=dotted];\nn70931694131085312 -> n70650219154374656[style=dotted];\nn71494644084506624 -> n70931694131085312[style=dotted];\nn46161896180547584 -> n44754521296994304[style=dotted];\nn44191571343572992 -> n43628621390151680[style=dotted];\nn43065671436730368 -> n6755399441055744[style=dotted];\nn2251799813685248 -> n1688849860263936[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/pgo/training/input-741.txt",
    "content": "digraph {\n\nmaxiter=8;\n        \nn0[shape=rectangle, label=\"B0\"];\nn562949953421312[shape=rectangle, label=\"B1\"];\nn1125899906842624[shape=rectangle, label=\"B2\"];\nn281474976710656[shape=rectangle, label=\"B3\"];\nn1407374883553280[shape=rectangle, label=\"B4\"];\nn1970324836974592[shape=rectangle, label=\"B5\"];\nn1688849860263936[shape=rectangle, label=\"B6\"];\nn2533274790395904[shape=rectangle, label=\"B7\"];\nn2251799813685248[shape=rectangle, label=\"B8\"];\nn3096224743817216[shape=rectangle, label=\"B9\"];\nn3659174697238528[shape=rectangle, label=\"B10\"];\nn4222124650659840[shape=rectangle, label=\"B11\"];\nn4785074604081152[shape=rectangle, label=\"B12\"];\nn2814749767106560[shape=rectangle, label=\"B13\"];\nn3940649673949184[shape=rectangle, label=\"B14\"];\nn5066549580791808[shape=rectangle, label=\"B15\"];\nn5629499534213120[shape=rectangle, label=\"B16\"];\nn5348024557502464[shape=rectangle, label=\"B17\"];\nn6192449487634432[shape=rectangle, label=\"B18\"];\nn5910974510923776[shape=rectangle, label=\"B19\"];\nn6755399441055744[shape=rectangle, label=\"B20\"];\nn7318349394477056[shape=rectangle, label=\"B21\"];\nn7599824371187712[shape=rectangle, label=\"B22\"];\nn7881299347898368[shape=rectangle, label=\"B23\"];\nn8162774324609024[shape=rectangle, label=\"B24\"];\nn7036874417766400[shape=rectangle, label=\"B25\"];\nn8444249301319680[shape=rectangle, label=\"B26\"];\nn6473924464345088[shape=rectangle, label=\"B27\"];\nn9007199254740992[shape=rectangle, label=\"B28\"];\nn9570149208162304[shape=rectangle, label=\"B29\"];\nn8725724278030336[shape=rectangle, label=\"B30\"];\nn9851624184872960[shape=rectangle, label=\"B31\"];\nn10414574138294272[shape=rectangle, label=\"B32\"];\nn10133099161583616[shape=rectangle, label=\"B33\"];\nn10977524091715584[shape=rectangle, label=\"B34\"];\nn10696049115004928[shape=rectangle, label=\"B35\"];\nn11540474045136896[shape=rectangle, label=\"B36\"];\nn11258999068426240[shape=rectangle, label=\"B37\"];\nn12103423998558208[shape=rectangle, label=\"B38\"];\nn11821949021847552[shape=rectangle, label=\"B39\"];\nn12666373951979520[shape=rectangle, label=\"B40\"];\nn12384898975268864[shape=rectangle, label=\"B41\"];\nn13229323905400832[shape=rectangle, label=\"B42\"];\nn12947848928690176[shape=rectangle, label=\"B43\"];\nn13792273858822144[shape=rectangle, label=\"B44\"];\nn13510798882111488[shape=rectangle, label=\"B45\"];\nn14355223812243456[shape=rectangle, label=\"B46\"];\nn14073748835532800[shape=rectangle, label=\"B47\"];\nn14918173765664768[shape=rectangle, label=\"B48\"];\nn14636698788954112[shape=rectangle, label=\"B49\"];\nn15481123719086080[shape=rectangle, label=\"B50\"];\nn16044073672507392[shape=rectangle, label=\"B51\"];\nn16607023625928704[shape=rectangle, label=\"B52\"];\nn18295873486192640[shape=rectangle, label=\"B53\"];\nn17169973579350016[shape=rectangle, label=\"B54\"];\nn15762598695796736[shape=rectangle, label=\"B55\"];\nn17451448556060672[shape=rectangle, label=\"B56\"];\nn18014398509481984[shape=rectangle, label=\"B57\"];\nn18577348462903296[shape=rectangle, label=\"B58\"];\nn17732923532771328[shape=rectangle, label=\"B59\"];\nn18858823439613952[shape=rectangle, label=\"B60\"];\nn16888498602639360[shape=rectangle, label=\"B61\"];\nn16325548649218048[shape=rectangle, label=\"B62\"];\nn15199648742375424[shape=rectangle, label=\"B63\"];\nn844424930131968[shape=rectangle, label=\"B64\"];\nn3377699720527872[shape=rectangle, label=\"B65\"];\nn9288674231451648[shape=rectangle, label=\"B66\"];\nn4503599627370496[shape=rectangle, label=\"B67\"];\nn19140298416324608[shape=rectangle, label=\"B68\"];\nn19703248369745920[shape=rectangle, label=\"B69\"];\nn19421773393035264[shape=rectangle, label=\"B70\"];\nn19984723346456576[shape=rectangle, label=\"B71\"];\nn20547673299877888[shape=rectangle, label=\"B72\"];\nn20266198323167232[shape=rectangle, label=\"B73\"];\nn20829148276588544[shape=rectangle, label=\"B74\"];\nn21392098230009856[shape=rectangle, label=\"B75\"];\nn21110623253299200[shape=rectangle, label=\"B76\"];\nn21673573206720512[shape=rectangle, label=\"B77\"];\nn22236523160141824[shape=rectangle, label=\"B78\"];\nn21955048183431168[shape=rectangle, label=\"B79\"];\nn22517998136852480[shape=rectangle, label=\"B80\"];\nn22799473113563136[shape=rectangle, label=\"B81\"];\nn23362423066984448[shape=rectangle, label=\"B82\"];\nn23080948090273792[shape=rectangle, label=\"B83\"];\nn23643898043695104[shape=rectangle, label=\"B84\"];\nn24206847997116416[shape=rectangle, label=\"B85\"];\nn23925373020405760[shape=rectangle, label=\"B86\"];\nn24488322973827072[shape=rectangle, label=\"B87\"];\nn25051272927248384[shape=rectangle, label=\"B88\"];\nn24769797950537728[shape=rectangle, label=\"B89\"];\nn25332747903959040[shape=rectangle, label=\"B90\"];\nn25614222880669696[shape=rectangle, label=\"B91\"];\nn26177172834091008[shape=rectangle, label=\"B92\"];\nn25895697857380352[shape=rectangle, label=\"B93\"];\nn26458647810801664[shape=rectangle, label=\"B94\"];\nn27021597764222976[shape=rectangle, label=\"B95\"];\nn27303072740933632[shape=rectangle, label=\"B96\"];\nn26740122787512320[shape=rectangle, label=\"B97\"];\nn27866022694354944[shape=rectangle, label=\"B98\"];\nn28147497671065600[shape=rectangle, label=\"B99\"];\nn27584547717644288[shape=rectangle, label=\"B100\"];\nn28710447624486912[shape=rectangle, label=\"B101\"];\nn29273397577908224[shape=rectangle, label=\"B102\"];\nn29836347531329536[shape=rectangle, label=\"B103\"];\nn29554872554618880[shape=rectangle, label=\"B104\"];\nn30399297484750848[shape=rectangle, label=\"B105\"];\nn30117822508040192[shape=rectangle, label=\"B106\"];\nn30962247438172160[shape=rectangle, label=\"B107\"];\nn31243722414882816[shape=rectangle, label=\"B108\"];\nn31525197391593472[shape=rectangle, label=\"B109\"];\nn31806672368304128[shape=rectangle, label=\"B110\"];\nn30680772461461504[shape=rectangle, label=\"B111\"];\nn32088147345014784[shape=rectangle, label=\"B112\"];\nn32651097298436096[shape=rectangle, label=\"B113\"];\nn32369622321725440[shape=rectangle, label=\"B114\"];\nn32932572275146752[shape=rectangle, label=\"B115\"];\nn28991922601197568[shape=rectangle, label=\"B116\"];\nn33214047251857408[shape=rectangle, label=\"B117\"];\nn33776997205278720[shape=rectangle, label=\"B118\"];\nn33495522228568064[shape=rectangle, label=\"B119\"];\nn34339947158700032[shape=rectangle, label=\"B120\"];\nn34058472181989376[shape=rectangle, label=\"B121\"];\nn34621422135410688[shape=rectangle, label=\"B122\"];\nn28428972647776256[shape=rectangle, label=\"B123\"];\nn34902897112121344[shape=rectangle, label=\"B124\"];\nn35184372088832000[shape=rectangle, label=\"B125\"];\nn35747322042253312[shape=rectangle, label=\"B126\"];\nn36028797018963968[shape=rectangle, label=\"B127\"];\nn36310271995674624[shape=rectangle, label=\"B128\"];\nn36591746972385280[shape=rectangle, label=\"B129\"];\nn35465847065542656[shape=rectangle, label=\"B130\"];\nn36873221949095936[shape=rectangle, label=\"B131\"];\nn37154696925806592[shape=rectangle, label=\"B132\"];\nn37436171902517248[shape=rectangle, label=\"B133\"];\nn37717646879227904[shape=rectangle, label=\"B134\"];\nn37999121855938560[shape=rectangle, label=\"B135\"];\nn38280596832649216[shape=rectangle, label=\"B136\"];\nn38562071809359872[shape=rectangle, label=\"B137\"];\nn39125021762781184[shape=rectangle, label=\"B138\"];\nn39687971716202496[shape=rectangle, label=\"B139\"];\nn39969446692913152[shape=rectangle, label=\"B140\"];\nn40250921669623808[shape=rectangle, label=\"B141\"];\nn38843546786070528[shape=rectangle, label=\"B142\"];\nn40532396646334464[shape=rectangle, label=\"B143\"];\nn39406496739491840[shape=rectangle, label=\"B144\"];\nn40813871623045120[shape=rectangle, label=\"B145\"];\nn41095346599755776[shape=rectangle, label=\"B146\"];\nn41376821576466432[shape=rectangle, label=\"B147\"];\nn41658296553177088[shape=rectangle, label=\"B148\"];\nn42221246506598400[shape=rectangle, label=\"B149\"];\nn41939771529887744[shape=rectangle, label=\"B150\"];\nn42502721483309056[shape=rectangle, label=\"B151\"];\nn43065671436730368[shape=rectangle, label=\"B152\"];\nn43347146413441024[shape=rectangle, label=\"B153\"];\nn42784196460019712[shape=rectangle, label=\"B154\"];\nn43910096366862336[shape=rectangle, label=\"B155\"];\nn44191571343572992[shape=rectangle, label=\"B156\"];\nn44473046320283648[shape=rectangle, label=\"B157\"];\nn43628621390151680[shape=rectangle, label=\"B158\"];\nn45035996273704960[shape=rectangle, label=\"B159\"];\nn45598946227126272[shape=rectangle, label=\"B160\"];\nn45880421203836928[shape=rectangle, label=\"B161\"];\nn46161896180547584[shape=rectangle, label=\"B162\"];\nn45317471250415616[shape=rectangle, label=\"B163\"];\nn46724846133968896[shape=rectangle, label=\"B164\"];\nn46443371157258240[shape=rectangle, label=\"B165\"];\nn47006321110679552[shape=rectangle, label=\"B166\"];\nn47287796087390208[shape=rectangle, label=\"B167\"];\nn47569271064100864[shape=rectangle, label=\"B168\"];\nn44754521296994304[shape=rectangle, label=\"B169\"];\nn48132221017522176[shape=rectangle, label=\"B170\"];\nn48413695994232832[shape=rectangle, label=\"B171\"];\nn48976645947654144[shape=rectangle, label=\"B172\"];\nn59391220085948416[shape=rectangle, label=\"B173\"];\nn48695170970943488[shape=rectangle, label=\"B174\"];\nn49821070877786112[shape=rectangle, label=\"B175\"];\nn50384020831207424[shape=rectangle, label=\"B176\"];\nn50665495807918080[shape=rectangle, label=\"B177\"];\nn51228445761339392[shape=rectangle, label=\"B178\"];\nn51509920738050048[shape=rectangle, label=\"B179\"];\nn51791395714760704[shape=rectangle, label=\"B180\"];\nn52354345668182016[shape=rectangle, label=\"B181\"];\nn52635820644892672[shape=rectangle, label=\"B182\"];\nn52917295621603328[shape=rectangle, label=\"B183\"];\nn53480245575024640[shape=rectangle, label=\"B184\"];\nn53761720551735296[shape=rectangle, label=\"B185\"];\nn54043195528445952[shape=rectangle, label=\"B186\"];\nn54324670505156608[shape=rectangle, label=\"B187\"];\nn54606145481867264[shape=rectangle, label=\"B188\"];\nn54887620458577920[shape=rectangle, label=\"B189\"];\nn55169095435288576[shape=rectangle, label=\"B190\"];\nn55450570411999232[shape=rectangle, label=\"B191\"];\nn55732045388709888[shape=rectangle, label=\"B192\"];\nn56013520365420544[shape=rectangle, label=\"B193\"];\nn56294995342131200[shape=rectangle, label=\"B194\"];\nn56576470318841856[shape=rectangle, label=\"B195\"];\nn56857945295552512[shape=rectangle, label=\"B196\"];\nn57139420272263168[shape=rectangle, label=\"B197\"];\nn57420895248973824[shape=rectangle, label=\"B198\"];\nn50102545854496768[shape=rectangle, label=\"B199\"];\nn50946970784628736[shape=rectangle, label=\"B200\"];\nn49539595901075456[shape=rectangle, label=\"B201\"];\nn57983845202395136[shape=rectangle, label=\"B202\"];\nn57702370225684480[shape=rectangle, label=\"B203\"];\nn58546795155816448[shape=rectangle, label=\"B204\"];\nn58828270132527104[shape=rectangle, label=\"B205\"];\nn58265320179105792[shape=rectangle, label=\"B206\"];\nn59109745109237760[shape=rectangle, label=\"B207\"];\nn59672695062659072[shape=rectangle, label=\"B208\"];\nn52072870691471360[shape=rectangle, label=\"B209\"];\nn53198770598313984[shape=rectangle, label=\"B210\"];\nn47850746040811520[shape=rectangle, label=\"B211\"];\nn49258120924364800[shape=rectangle, label=\"B212\"];\nn59954170039369728[shape=rectangle, label=\"B213\"];\nn60235645016080384[shape=rectangle, label=\"B214\"];\nn60798594969501696[shape=rectangle, label=\"B215\"];\nn61361544922923008[shape=rectangle, label=\"B216\"];\nn61643019899633664[shape=rectangle, label=\"B217\"];\nn61924494876344320[shape=rectangle, label=\"B218\"];\nn60517119992791040[shape=rectangle, label=\"B219\"];\nn62205969853054976[shape=rectangle, label=\"B220\"];\nn61080069946212352[shape=rectangle, label=\"B221\"];\nn62487444829765632[shape=rectangle, label=\"B222\"];\nn62768919806476288[shape=rectangle, label=\"B223\"];\nn63050394783186944[shape=rectangle, label=\"B224\"];\nn63331869759897600[shape=rectangle, label=\"B225\"];\nn63613344736608256[shape=rectangle, label=\"B226\"];\nn63894819713318912[shape=rectangle, label=\"B227\"];\nn64457769666740224[shape=rectangle, label=\"B228\"];\nn65020719620161536[shape=rectangle, label=\"B229\"];\nn65302194596872192[shape=rectangle, label=\"B230\"];\nn65583669573582848[shape=rectangle, label=\"B231\"];\nn64176294690029568[shape=rectangle, label=\"B232\"];\nn65865144550293504[shape=rectangle, label=\"B233\"];\nn64739244643450880[shape=rectangle, label=\"B234\"];\nn66146619527004160[shape=rectangle, label=\"B235\"];\nn66428094503714816[shape=rectangle, label=\"B236\"];\nn66709569480425472[shape=rectangle, label=\"B237\"];\nn66991044457136128[shape=rectangle, label=\"B238\"];\nn67553994410557440[shape=rectangle, label=\"B239\"];\nn67272519433846784[shape=rectangle, label=\"B240\"];\nn68116944363978752[shape=rectangle, label=\"B241\"];\nn68679894317400064[shape=rectangle, label=\"B242\"];\nn69242844270821376[shape=rectangle, label=\"B243\"];\nn69805794224242688[shape=rectangle, label=\"B244\"];\nn69524319247532032[shape=rectangle, label=\"B245\"];\nn70368744177664000[shape=rectangle, label=\"B246\"];\nn68398419340689408[shape=rectangle, label=\"B247\"];\nn70931694131085312[shape=rectangle, label=\"B248\"];\nn71494644084506624[shape=rectangle, label=\"B249\"];\nn70087269200953344[shape=rectangle, label=\"B250\"];\nn71213169107795968[shape=rectangle, label=\"B251\"];\nn71776119061217280[shape=rectangle, label=\"B252\"];\nn68961369294110720[shape=rectangle, label=\"B253\"];\nn70650219154374656[shape=rectangle, label=\"B254\"];\nn72339069014638592[shape=rectangle, label=\"B255\"];\nn72057594037927936[shape=rectangle, label=\"B256\"];\nn72902018968059904[shape=rectangle, label=\"B257\"];\nn72620543991349248[shape=rectangle, label=\"B258\"];\nn73464968921481216[shape=rectangle, label=\"B259\"];\nn73183493944770560[shape=rectangle, label=\"B260\"];\nn74027918874902528[shape=rectangle, label=\"B261\"];\nn73746443898191872[shape=rectangle, label=\"B262\"];\nn74590868828323840[shape=rectangle, label=\"B263\"];\nn74309393851613184[shape=rectangle, label=\"B264\"];\nn74872343805034496[shape=rectangle, label=\"B265\"];\nn67835469387268096[shape=rectangle, label=\"B266\"];\nn75153818781745152[shape=rectangle, label=\"B267\"];\nn75716768735166464[shape=rectangle, label=\"B268\"];\nn75435293758455808[shape=rectangle, label=\"B269\"];\nn75998243711877120[shape=rectangle, label=\"B270\"];\nn76561193665298432[shape=rectangle, label=\"B271\"];\nn76279718688587776[shape=rectangle, label=\"B272\"];\nn77124143618719744[shape=rectangle, label=\"B273\"];\nn76842668642009088[shape=rectangle, label=\"B274\"];\nn77687093572141056[shape=rectangle, label=\"B275\"];\nn77405618595430400[shape=rectangle, label=\"B276\"];\nn78250043525562368[shape=rectangle, label=\"B277\"];\nn77968568548851712[shape=rectangle, label=\"B278\"];\nn78531518502273024[shape=rectangle, label=\"B279\"];\nn79094468455694336[shape=rectangle, label=\"B280\"];\nn78812993478983680[shape=rectangle, label=\"B281\"];\nn79375943432404992[shape=rectangle, label=\"B282\"];\nn79938893385826304[shape=rectangle, label=\"B283\"];\nn80220368362536960[shape=rectangle, label=\"B284\"];\nn79657418409115648[shape=rectangle, label=\"B285\"];\nn80783318315958272[shape=rectangle, label=\"B286\"];\nn81064793292668928[shape=rectangle, label=\"B287\"];\nn81346268269379584[shape=rectangle, label=\"B288\"];\nn80501843339247616[shape=rectangle, label=\"B289\"];\nn81909218222800896[shape=rectangle, label=\"B290\"];\nn82472168176222208[shape=rectangle, label=\"B291\"];\nn82753643152932864[shape=rectangle, label=\"B292\"];\nn83035118129643520[shape=rectangle, label=\"B293\"];\nn82190693199511552[shape=rectangle, label=\"B294\"];\nn83598068083064832[shape=rectangle, label=\"B295\"];\nn83316593106354176[shape=rectangle, label=\"B296\"];\nn83879543059775488[shape=rectangle, label=\"B297\"];\nn84161018036486144[shape=rectangle, label=\"B298\"];\nn84442493013196800[shape=rectangle, label=\"B299\"];\nn81627743246090240[shape=rectangle, label=\"B300\"];\nn85005442966618112[shape=rectangle, label=\"B301\"];\nn85286917943328768[shape=rectangle, label=\"B302\"];\nn85849867896750080[shape=rectangle, label=\"B303\"];\nn96827391988465664[shape=rectangle, label=\"B304\"];\nn85568392920039424[shape=rectangle, label=\"B305\"];\nn86694292826882048[shape=rectangle, label=\"B306\"];\nn86975767803592704[shape=rectangle, label=\"B307\"];\nn87257242780303360[shape=rectangle, label=\"B308\"];\nn87820192733724672[shape=rectangle, label=\"B309\"];\nn88101667710435328[shape=rectangle, label=\"B310\"];\nn88383142687145984[shape=rectangle, label=\"B311\"];\nn88946092640567296[shape=rectangle, label=\"B312\"];\nn89227567617277952[shape=rectangle, label=\"B313\"];\nn89509042593988608[shape=rectangle, label=\"B314\"];\nn90071992547409920[shape=rectangle, label=\"B315\"];\nn90353467524120576[shape=rectangle, label=\"B316\"];\nn90634942500831232[shape=rectangle, label=\"B317\"];\nn90916417477541888[shape=rectangle, label=\"B318\"];\nn91197892454252544[shape=rectangle, label=\"B319\"];\nn91479367430963200[shape=rectangle, label=\"B320\"];\nn91760842407673856[shape=rectangle, label=\"B321\"];\nn92042317384384512[shape=rectangle, label=\"B322\"];\nn92323792361095168[shape=rectangle, label=\"B323\"];\nn92605267337805824[shape=rectangle, label=\"B324\"];\nn92886742314516480[shape=rectangle, label=\"B325\"];\nn93168217291227136[shape=rectangle, label=\"B326\"];\nn93449692267937792[shape=rectangle, label=\"B327\"];\nn93731167244648448[shape=rectangle, label=\"B328\"];\nn94012642221359104[shape=rectangle, label=\"B329\"];\nn86412817850171392[shape=rectangle, label=\"B330\"];\nn87538717757014016[shape=rectangle, label=\"B331\"];\nn94575592174780416[shape=rectangle, label=\"B332\"];\nn94294117198069760[shape=rectangle, label=\"B333\"];\nn95138542128201728[shape=rectangle, label=\"B334\"];\nn95420017104912384[shape=rectangle, label=\"B335\"];\nn94857067151491072[shape=rectangle, label=\"B336\"];\nn96264442035044352[shape=rectangle, label=\"B337\"];\nn96545917011755008[shape=rectangle, label=\"B338\"];\nn95982967058333696[shape=rectangle, label=\"B339\"];\nn95701492081623040[shape=rectangle, label=\"B340\"];\nn97108866965176320[shape=rectangle, label=\"B341\"];\nn88664617663856640[shape=rectangle, label=\"B342\"];\nn89790517570699264[shape=rectangle, label=\"B343\"];\nn84723967989907456[shape=rectangle, label=\"B344\"];\nn97390341941886976[shape=rectangle, label=\"B345\"];\nn97671816918597632[shape=rectangle, label=\"B346\"];\nn86131342873460736[shape=rectangle, label=\"B347\"];\nn97953291895308288[shape=rectangle, label=\"B348\"];\nn98234766872018944[shape=rectangle, label=\"B349\"];\nn98797716825440256[shape=rectangle, label=\"B350\"];\nn99360666778861568[shape=rectangle, label=\"B351\"];\nn99642141755572224[shape=rectangle, label=\"B352\"];\nn99923616732282880[shape=rectangle, label=\"B353\"];\nn98516241848729600[shape=rectangle, label=\"B354\"];\nn100205091708993536[shape=rectangle, label=\"B355\"];\nn99079191802150912[shape=rectangle, label=\"B356\"];\nn100486566685704192[shape=rectangle, label=\"B357\"];\nn100768041662414848[shape=rectangle, label=\"B358\"];\nn101049516639125504[shape=rectangle, label=\"B359\"];\nn101330991615836160[shape=rectangle, label=\"B360\"];\nn101612466592546816[shape=rectangle, label=\"B361\"];\nn101893941569257472[shape=rectangle, label=\"B362\"];\nn102456891522678784[shape=rectangle, label=\"B363\"];\nn103019841476100096[shape=rectangle, label=\"B364\"];\nn103301316452810752[shape=rectangle, label=\"B365\"];\nn103582791429521408[shape=rectangle, label=\"B366\"];\nn102175416545968128[shape=rectangle, label=\"B367\"];\nn103864266406232064[shape=rectangle, label=\"B368\"];\nn102738366499389440[shape=rectangle, label=\"B369\"];\nn104145741382942720[shape=rectangle, label=\"B370\"];\nn104427216359653376[shape=rectangle, label=\"B371\"];\nn104708691336364032[shape=rectangle, label=\"B372\"];\nn104990166313074688[shape=rectangle, label=\"B373\"];\nn105553116266496000[shape=rectangle, label=\"B374\"];\nn105271641289785344[shape=rectangle, label=\"B375\"];\nn105834591243206656[shape=rectangle, label=\"B376\"];\nn106397541196627968[shape=rectangle, label=\"B377\"];\nn106679016173338624[shape=rectangle, label=\"B378\"];\nn106116066219917312[shape=rectangle, label=\"B379\"];\nn107241966126759936[shape=rectangle, label=\"B380\"];\nn107523441103470592[shape=rectangle, label=\"B381\"];\nn107804916080181248[shape=rectangle, label=\"B382\"];\nn106960491150049280[shape=rectangle, label=\"B383\"];\nn108367866033602560[shape=rectangle, label=\"B384\"];\nn108649341010313216[shape=rectangle, label=\"B385\"];\nn108086391056891904[shape=rectangle, label=\"B386\"];\nn109212290963734528[shape=rectangle, label=\"B387\"];\nn109775240917155840[shape=rectangle, label=\"B388\"];\nn110056715893866496[shape=rectangle, label=\"B389\"];\nn110338190870577152[shape=rectangle, label=\"B390\"];\nn109493765940445184[shape=rectangle, label=\"B391\"];\nn110901140823998464[shape=rectangle, label=\"B392\"];\nn110619665847287808[shape=rectangle, label=\"B393\"];\nn111182615800709120[shape=rectangle, label=\"B394\"];\nn111464090777419776[shape=rectangle, label=\"B395\"];\nn111745565754130432[shape=rectangle, label=\"B396\"];\nn108930815987023872[shape=rectangle, label=\"B397\"];\nn112308515707551744[shape=rectangle, label=\"B398\"];\nn112589990684262400[shape=rectangle, label=\"B399\"];\nn113152940637683712[shape=rectangle, label=\"B400\"];\nn126663739519795200[shape=rectangle, label=\"B401\"];\nn112871465660973056[shape=rectangle, label=\"B402\"];\nn113997365567815680[shape=rectangle, label=\"B403\"];\nn114278840544526336[shape=rectangle, label=\"B404\"];\nn114560315521236992[shape=rectangle, label=\"B405\"];\nn115123265474658304[shape=rectangle, label=\"B406\"];\nn115404740451368960[shape=rectangle, label=\"B407\"];\nn115686215428079616[shape=rectangle, label=\"B408\"];\nn116249165381500928[shape=rectangle, label=\"B409\"];\nn116530640358211584[shape=rectangle, label=\"B410\"];\nn116812115334922240[shape=rectangle, label=\"B411\"];\nn117375065288343552[shape=rectangle, label=\"B412\"];\nn117656540265054208[shape=rectangle, label=\"B413\"];\nn117938015241764864[shape=rectangle, label=\"B414\"];\nn118219490218475520[shape=rectangle, label=\"B415\"];\nn118500965195186176[shape=rectangle, label=\"B416\"];\nn118782440171896832[shape=rectangle, label=\"B417\"];\nn119063915148607488[shape=rectangle, label=\"B418\"];\nn119345390125318144[shape=rectangle, label=\"B419\"];\nn119626865102028800[shape=rectangle, label=\"B420\"];\nn119908340078739456[shape=rectangle, label=\"B421\"];\nn120189815055450112[shape=rectangle, label=\"B422\"];\nn120471290032160768[shape=rectangle, label=\"B423\"];\nn120752765008871424[shape=rectangle, label=\"B424\"];\nn121034239985582080[shape=rectangle, label=\"B425\"];\nn121315714962292736[shape=rectangle, label=\"B426\"];\nn113715890591105024[shape=rectangle, label=\"B427\"];\nn114841790497947648[shape=rectangle, label=\"B428\"];\nn121878664915714048[shape=rectangle, label=\"B429\"];\nn121597189939003392[shape=rectangle, label=\"B430\"];\nn122441614869135360[shape=rectangle, label=\"B431\"];\nn122723089845846016[shape=rectangle, label=\"B432\"];\nn122160139892424704[shape=rectangle, label=\"B433\"];\nn123567514775977984[shape=rectangle, label=\"B434\"];\nn123848989752688640[shape=rectangle, label=\"B435\"];\nn124411939706109952[shape=rectangle, label=\"B436\"];\nn124130464729399296[shape=rectangle, label=\"B437\"];\nn124974889659531264[shape=rectangle, label=\"B438\"];\nn124693414682820608[shape=rectangle, label=\"B439\"];\nn125537839612952576[shape=rectangle, label=\"B440\"];\nn125819314589663232[shape=rectangle, label=\"B441\"];\nn125256364636241920[shape=rectangle, label=\"B442\"];\nn126100789566373888[shape=rectangle, label=\"B443\"];\nn126382264543084544[shape=rectangle, label=\"B444\"];\nn123286039799267328[shape=rectangle, label=\"B445\"];\nn123004564822556672[shape=rectangle, label=\"B446\"];\nn126945214496505856[shape=rectangle, label=\"B447\"];\nn115967690404790272[shape=rectangle, label=\"B448\"];\nn117093590311632896[shape=rectangle, label=\"B449\"];\nn112027040730841088[shape=rectangle, label=\"B450\"];\nn127508164449927168[shape=rectangle, label=\"B451\"];\nn127789639426637824[shape=rectangle, label=\"B452\"];\nn128352589380059136[shape=rectangle, label=\"B453\"];\nn128071114403348480[shape=rectangle, label=\"B454\"];\nn128915539333480448[shape=rectangle, label=\"B455\"];\nn128634064356769792[shape=rectangle, label=\"B456\"];\nn129478489286901760[shape=rectangle, label=\"B457\"];\nn129759964263612416[shape=rectangle, label=\"B458\"];\nn129197014310191104[shape=rectangle, label=\"B459\"];\nn130041439240323072[shape=rectangle, label=\"B460\"];\nn130322914217033728[shape=rectangle, label=\"B461\"];\nn127226689473216512[shape=rectangle, label=\"B462\"];\nn113434415614394368[shape=rectangle, label=\"B463\"];\nn130604389193744384[shape=rectangle, label=\"B464\"];\nn130885864170455040[shape=rectangle, label=\"B465\"];\nn131167339147165696[shape=rectangle, label=\"B466\"];\nn131448814123876352[shape=rectangle, label=\"B467\"];\nn132011764077297664[shape=rectangle, label=\"B468\"];\nn132574714030718976[shape=rectangle, label=\"B469\"];\nn133137663984140288[shape=rectangle, label=\"B470\"];\nn133419138960850944[shape=rectangle, label=\"B471\"];\nn132856189007429632[shape=rectangle, label=\"B472\"];\nn133700613937561600[shape=rectangle, label=\"B473\"];\nn133982088914272256[shape=rectangle, label=\"B474\"];\nn131730289100587008[shape=rectangle, label=\"B475\"];\nn134263563890982912[shape=rectangle, label=\"B476\"];\nn132293239054008320[shape=rectangle, label=\"B477\"];\nn134545038867693568[shape=rectangle, label=\"B478\"];\nn134826513844404224[shape=rectangle, label=\"B479\"];\nn135107988821114880[shape=rectangle, label=\"B480\"];\nn135389463797825536[shape=rectangle, label=\"B481\"];\nn135952413751246848[shape=rectangle, label=\"B482\"];\nn135670938774536192[shape=rectangle, label=\"B483\"];\nn136233888727957504[shape=rectangle, label=\"B484\"];\nn136796838681378816[shape=rectangle, label=\"B485\"];\nn137078313658089472[shape=rectangle, label=\"B486\"];\nn136515363704668160[shape=rectangle, label=\"B487\"];\nn137641263611510784[shape=rectangle, label=\"B488\"];\nn137922738588221440[shape=rectangle, label=\"B489\"];\nn138204213564932096[shape=rectangle, label=\"B490\"];\nn137359788634800128[shape=rectangle, label=\"B491\"];\nn138767163518353408[shape=rectangle, label=\"B492\"];\nn139330113471774720[shape=rectangle, label=\"B493\"];\nn139611588448485376[shape=rectangle, label=\"B494\"];\nn139893063425196032[shape=rectangle, label=\"B495\"];\nn139048638495064064[shape=rectangle, label=\"B496\"];\nn140456013378617344[shape=rectangle, label=\"B497\"];\nn140174538401906688[shape=rectangle, label=\"B498\"];\nn140737488355328000[shape=rectangle, label=\"B499\"];\nn141018963332038656[shape=rectangle, label=\"B500\"];\nn141300438308749312[shape=rectangle, label=\"B501\"];\nn138485688541642752[shape=rectangle, label=\"B502\"];\nn141863388262170624[shape=rectangle, label=\"B503\"];\nn142144863238881280[shape=rectangle, label=\"B504\"];\nn142707813192302592[shape=rectangle, label=\"B505\"];\nn156218612074414080[shape=rectangle, label=\"B506\"];\nn142426338215591936[shape=rectangle, label=\"B507\"];\nn143552238122434560[shape=rectangle, label=\"B508\"];\nn143833713099145216[shape=rectangle, label=\"B509\"];\nn144115188075855872[shape=rectangle, label=\"B510\"];\nn144678138029277184[shape=rectangle, label=\"B511\"];\nn144959613005987840[shape=rectangle, label=\"B512\"];\nn145241087982698496[shape=rectangle, label=\"B513\"];\nn145804037936119808[shape=rectangle, label=\"B514\"];\nn146085512912830464[shape=rectangle, label=\"B515\"];\nn146366987889541120[shape=rectangle, label=\"B516\"];\nn146929937842962432[shape=rectangle, label=\"B517\"];\nn147211412819673088[shape=rectangle, label=\"B518\"];\nn147492887796383744[shape=rectangle, label=\"B519\"];\nn147774362773094400[shape=rectangle, label=\"B520\"];\nn148055837749805056[shape=rectangle, label=\"B521\"];\nn148337312726515712[shape=rectangle, label=\"B522\"];\nn148618787703226368[shape=rectangle, label=\"B523\"];\nn148900262679937024[shape=rectangle, label=\"B524\"];\nn149181737656647680[shape=rectangle, label=\"B525\"];\nn149463212633358336[shape=rectangle, label=\"B526\"];\nn149744687610068992[shape=rectangle, label=\"B527\"];\nn150026162586779648[shape=rectangle, label=\"B528\"];\nn150307637563490304[shape=rectangle, label=\"B529\"];\nn150589112540200960[shape=rectangle, label=\"B530\"];\nn150870587516911616[shape=rectangle, label=\"B531\"];\nn143270763145723904[shape=rectangle, label=\"B532\"];\nn144396663052566528[shape=rectangle, label=\"B533\"];\nn151433537470332928[shape=rectangle, label=\"B534\"];\nn151152062493622272[shape=rectangle, label=\"B535\"];\nn151996487423754240[shape=rectangle, label=\"B536\"];\nn152277962400464896[shape=rectangle, label=\"B537\"];\nn151715012447043584[shape=rectangle, label=\"B538\"];\nn153122387330596864[shape=rectangle, label=\"B539\"];\nn153403862307307520[shape=rectangle, label=\"B540\"];\nn153966812260728832[shape=rectangle, label=\"B541\"];\nn153685337284018176[shape=rectangle, label=\"B542\"];\nn154529762214150144[shape=rectangle, label=\"B543\"];\nn154248287237439488[shape=rectangle, label=\"B544\"];\nn155092712167571456[shape=rectangle, label=\"B545\"];\nn155374187144282112[shape=rectangle, label=\"B546\"];\nn154811237190860800[shape=rectangle, label=\"B547\"];\nn155655662120992768[shape=rectangle, label=\"B548\"];\nn155937137097703424[shape=rectangle, label=\"B549\"];\nn152840912353886208[shape=rectangle, label=\"B550\"];\nn152559437377175552[shape=rectangle, label=\"B551\"];\nn156500087051124736[shape=rectangle, label=\"B552\"];\nn145522562959409152[shape=rectangle, label=\"B553\"];\nn146648462866251776[shape=rectangle, label=\"B554\"];\nn141581913285459968[shape=rectangle, label=\"B555\"];\nn156781562027835392[shape=rectangle, label=\"B556\"];\nn157063037004546048[shape=rectangle, label=\"B557\"];\nn157625986957967360[shape=rectangle, label=\"B558\"];\nn157344511981256704[shape=rectangle, label=\"B559\"];\nn158188936911388672[shape=rectangle, label=\"B560\"];\nn157907461934678016[shape=rectangle, label=\"B561\"];\nn158751886864809984[shape=rectangle, label=\"B562\"];\nn159033361841520640[shape=rectangle, label=\"B563\"];\nn158470411888099328[shape=rectangle, label=\"B564\"];\nn159314836818231296[shape=rectangle, label=\"B565\"];\nn159596311794941952[shape=rectangle, label=\"B566\"];\nn142989288169013248[shape=rectangle, label=\"B567\"];\nn159877786771652608[shape=rectangle, label=\"B568\"];\nn160159261748363264[shape=rectangle, label=\"B569\"];\nn160722211701784576[shape=rectangle, label=\"B570\"];\nn161285161655205888[shape=rectangle, label=\"B571\"];\nn161566636631916544[shape=rectangle, label=\"B572\"];\nn161848111608627200[shape=rectangle, label=\"B573\"];\nn160440736725073920[shape=rectangle, label=\"B574\"];\nn162129586585337856[shape=rectangle, label=\"B575\"];\nn161003686678495232[shape=rectangle, label=\"B576\"];\nn162411061562048512[shape=rectangle, label=\"B577\"];\nn162692536538759168[shape=rectangle, label=\"B578\"];\nn162974011515469824[shape=rectangle, label=\"B579\"];\nn163255486492180480[shape=rectangle, label=\"B580\"];\nn163536961468891136[shape=rectangle, label=\"B581\"];\nn163818436445601792[shape=rectangle, label=\"B582\"];\nn164381386399023104[shape=rectangle, label=\"B583\"];\nn164944336352444416[shape=rectangle, label=\"B584\"];\nn165225811329155072[shape=rectangle, label=\"B585\"];\nn165507286305865728[shape=rectangle, label=\"B586\"];\nn164099911422312448[shape=rectangle, label=\"B587\"];\nn165788761282576384[shape=rectangle, label=\"B588\"];\nn164662861375733760[shape=rectangle, label=\"B589\"];\nn166070236259287040[shape=rectangle, label=\"B590\"];\nn166351711235997696[shape=rectangle, label=\"B591\"];\nn166633186212708352[shape=rectangle, label=\"B592\"];\nn0 -> n281474976710656;\nn0 -> n562949953421312;\nn562949953421312 -> n844424930131968;\nn562949953421312 -> n1125899906842624;\nn1125899906842624 -> n1407374883553280;\nn281474976710656 -> n1407374883553280;\nn1407374883553280 -> n1688849860263936;\nn1407374883553280 -> n1970324836974592;\nn1970324836974592 -> n1688849860263936;\nn1688849860263936 -> n2251799813685248;\nn1688849860263936 -> n2533274790395904;\nn2533274790395904 -> n2251799813685248;\nn2251799813685248 -> n2814749767106560;\nn2251799813685248 -> n3096224743817216;\nn3096224743817216 -> n3377699720527872;\nn3096224743817216 -> n3659174697238528;\nn3659174697238528 -> n3940649673949184;\nn3659174697238528 -> n4222124650659840;\nn4222124650659840 -> n4503599627370496;\nn4222124650659840 -> n4785074604081152;\nn4785074604081152 -> n5066549580791808;\nn2814749767106560 -> n5066549580791808;\nn3940649673949184 -> n5066549580791808;\nn5066549580791808 -> n5348024557502464;\nn5066549580791808 -> n5629499534213120;\nn5629499534213120 -> n5348024557502464;\nn5348024557502464 -> n5910974510923776;\nn5348024557502464 -> n6192449487634432;\nn6192449487634432 -> n5910974510923776;\nn5910974510923776 -> n6473924464345088;\nn5910974510923776 -> n6755399441055744;\nn6755399441055744 -> n7036874417766400;\nn6755399441055744 -> n7318349394477056;\nn7318349394477056 -> n7036874417766400;\nn7318349394477056 -> n7599824371187712;\nn7599824371187712 -> n7881299347898368;\nn7881299347898368 -> n7881299347898368[style=dashed];\nn7881299347898368 -> n8162774324609024;\nn8162774324609024 -> n6473924464345088;\nn7036874417766400 -> n8444249301319680;\nn8444249301319680 -> n8444249301319680[style=dashed];\nn8444249301319680 -> n6473924464345088;\nn6473924464345088 -> n8725724278030336;\nn6473924464345088 -> n9007199254740992;\nn9007199254740992 -> n9288674231451648;\nn9007199254740992 -> n9570149208162304;\nn9570149208162304 -> n9851624184872960;\nn8725724278030336 -> n9851624184872960;\nn9851624184872960 -> n10133099161583616;\nn9851624184872960 -> n10414574138294272;\nn10414574138294272 -> n10133099161583616;\nn10133099161583616 -> n10696049115004928;\nn10133099161583616 -> n10977524091715584;\nn10977524091715584 -> n10696049115004928;\nn10696049115004928 -> n11258999068426240;\nn10696049115004928 -> n11540474045136896;\nn11540474045136896 -> n11258999068426240;\nn11258999068426240 -> n11821949021847552;\nn11258999068426240 -> n12103423998558208;\nn12103423998558208 -> n11821949021847552;\nn11821949021847552 -> n12384898975268864;\nn11821949021847552 -> n12666373951979520;\nn12666373951979520 -> n12384898975268864;\nn12384898975268864 -> n12947848928690176;\nn12384898975268864 -> n13229323905400832;\nn13229323905400832 -> n12947848928690176;\nn12947848928690176 -> n13510798882111488;\nn12947848928690176 -> n13792273858822144;\nn13792273858822144 -> n13510798882111488;\nn13510798882111488 -> n14073748835532800;\nn13510798882111488 -> n14355223812243456;\nn14355223812243456 -> n14073748835532800;\nn14073748835532800 -> n14636698788954112;\nn14073748835532800 -> n14918173765664768;\nn14918173765664768 -> n14636698788954112;\nn14636698788954112 -> n15199648742375424;\nn14636698788954112 -> n15481123719086080;\nn15481123719086080 -> n15762598695796736;\nn15481123719086080 -> n16044073672507392;\nn16044073672507392 -> n16325548649218048;\nn16607023625928704 -> n18295873486192640;\nn18295873486192640 -> n17169973579350016;\nn17169973579350016 -> n16888498602639360;\nn17169973579350016 -> n15762598695796736;\nn15762598695796736 -> n17169973579350016[style=dashed];\nn15762598695796736 -> n17451448556060672;\nn17451448556060672 -> n17732923532771328;\nn17451448556060672 -> n18014398509481984;\nn18014398509481984 -> n18295873486192640;\nn18577348462903296 -> n16607023625928704[style=dashed];\nn18577348462903296 -> n17732923532771328;\nn17732923532771328 -> n18577348462903296[style=dashed];\nn17732923532771328 -> n18858823439613952;\nn18858823439613952 -> n18577348462903296;\nn16888498602639360 -> n16325548649218048;\nn16325548649218048 -> n15199648742375424;\nn844424930131968 -> n3377699720527872;\nn3377699720527872 -> n19140298416324608;\nn9288674231451648 -> n19140298416324608;\nn4503599627370496 -> n19140298416324608;\nn19140298416324608 -> n19421773393035264;\nn19140298416324608 -> n19703248369745920;\nn19703248369745920 -> n19421773393035264;\nn19984723346456576 -> n20266198323167232;\nn19984723346456576 -> n20547673299877888;\nn20547673299877888 -> n20266198323167232;\nn20829148276588544 -> n21110623253299200;\nn20829148276588544 -> n21392098230009856;\nn21392098230009856 -> n21110623253299200;\nn21673573206720512 -> n21955048183431168;\nn21673573206720512 -> n22236523160141824;\nn22236523160141824 -> n21955048183431168;\nn22799473113563136 -> n23080948090273792;\nn22799473113563136 -> n23362423066984448;\nn23362423066984448 -> n23080948090273792;\nn23643898043695104 -> n23925373020405760;\nn23643898043695104 -> n24206847997116416;\nn24206847997116416 -> n23925373020405760;\nn24488322973827072 -> n24769797950537728;\nn24488322973827072 -> n25051272927248384;\nn25051272927248384 -> n24769797950537728;\nn25614222880669696 -> n25895697857380352;\nn25614222880669696 -> n26177172834091008;\nn26177172834091008 -> n25895697857380352;\nn26458647810801664 -> n26740122787512320;\nn26458647810801664 -> n27021597764222976;\nn27021597764222976 -> n26740122787512320;\nn27021597764222976 -> n27303072740933632;\nn27303072740933632 -> n26740122787512320;\nn26740122787512320 -> n27584547717644288;\nn26740122787512320 -> n27866022694354944;\nn27866022694354944 -> n28147497671065600;\nn28147497671065600 -> n28147497671065600[style=dashed];\nn28147497671065600 -> n27584547717644288;\nn27584547717644288 -> n28428972647776256;\nn27584547717644288 -> n28710447624486912;\nn28710447624486912 -> n28991922601197568;\nn28710447624486912 -> n29273397577908224;\nn29273397577908224 -> n29554872554618880;\nn29836347531329536 -> n28428972647776256;\nn29836347531329536 -> n29554872554618880;\nn29554872554618880 -> n30117822508040192;\nn30399297484750848 -> n30680772461461504;\nn30399297484750848 -> n30117822508040192;\nn30117822508040192 -> n30399297484750848;\nn30117822508040192 -> n30962247438172160;\nn30962247438172160 -> n30399297484750848;\nn30962247438172160 -> n31243722414882816;\nn31243722414882816 -> n31525197391593472;\nn31525197391593472 -> n31525197391593472[style=dashed];\nn31525197391593472 -> n31806672368304128;\nn31806672368304128 -> n30399297484750848;\nn30680772461461504 -> n29836347531329536;\nn30680772461461504 -> n32088147345014784;\nn32088147345014784 -> n32369622321725440;\nn32651097298436096 -> n29836347531329536;\nn32651097298436096 -> n32369622321725440;\nn32369622321725440 -> n32651097298436096;\nn32369622321725440 -> n32932572275146752;\nn32932572275146752 -> n32651097298436096;\nn28991922601197568 -> n28428972647776256;\nn28991922601197568 -> n33214047251857408;\nn33214047251857408 -> n33495522228568064;\nn33776997205278720 -> n28428972647776256;\nn33776997205278720 -> n33495522228568064;\nn33495522228568064 -> n34058472181989376;\nn34339947158700032 -> n33776997205278720;\nn34339947158700032 -> n34058472181989376;\nn34058472181989376 -> n34339947158700032;\nn34058472181989376 -> n34621422135410688;\nn34621422135410688 -> n34339947158700032;\nn28428972647776256 -> n34902897112121344;\nn34902897112121344 -> n34902897112121344[style=dashed];\nn34902897112121344 -> n35184372088832000;\nn35184372088832000 -> n35465847065542656;\nn35184372088832000 -> n35747322042253312;\nn36028797018963968 -> n36310271995674624;\nn36310271995674624 -> n36310271995674624[style=dashed];\nn36310271995674624 -> n36591746972385280;\nn36591746972385280 -> n35747322042253312;\nn36591746972385280 -> n35465847065542656;\nn35465847065542656 -> n36028797018963968;\nn35465847065542656 -> n36873221949095936;\nn36873221949095936 -> n37154696925806592;\nn37154696925806592 -> n37154696925806592[style=dashed];\nn37154696925806592 -> n37436171902517248;\nn37436171902517248 -> n35747322042253312;\nn37436171902517248 -> n37717646879227904;\nn37717646879227904 -> n35747322042253312;\nn37999121855938560 -> n38280596832649216;\nn38280596832649216 -> n38280596832649216[style=dashed];\nn38280596832649216 -> n38562071809359872;\nn38562071809359872 -> n38843546786070528;\nn39125021762781184 -> n39406496739491840;\nn39125021762781184 -> n39687971716202496;\nn39687971716202496 -> n39969446692913152;\nn39969446692913152 -> n39969446692913152[style=dashed];\nn39969446692913152 -> n40250921669623808;\nn40250921669623808 -> n38843546786070528;\nn38843546786070528 -> n39125021762781184;\nn38843546786070528 -> n40532396646334464;\nn39406496739491840 -> n40813871623045120;\nn40813871623045120 -> n40813871623045120[style=dashed];\nn40813871623045120 -> n41095346599755776;\nn41095346599755776 -> n40532396646334464;\nn41095346599755776 -> n41376821576466432;\nn41376821576466432 -> n40532396646334464;\nn41658296553177088 -> n41939771529887744;\nn41658296553177088 -> n42221246506598400;\nn42221246506598400 -> n41939771529887744;\nn42502721483309056 -> n42784196460019712;\nn42502721483309056 -> n43065671436730368;\nn43065671436730368 -> n42784196460019712;\nn43065671436730368 -> n43347146413441024;\nn43347146413441024 -> n42784196460019712;\nn42784196460019712 -> n43628621390151680;\nn42784196460019712 -> n43910096366862336;\nn43910096366862336 -> n43628621390151680;\nn43910096366862336 -> n44191571343572992;\nn44191571343572992 -> n43628621390151680;\nn44191571343572992 -> n44473046320283648;\nn44473046320283648 -> n43628621390151680;\nn43628621390151680 -> n44754521296994304;\nn43628621390151680 -> n45035996273704960;\nn45035996273704960 -> n45317471250415616;\nn45035996273704960 -> n45598946227126272;\nn45598946227126272 -> n44754521296994304;\nn45598946227126272 -> n45880421203836928;\nn45880421203836928 -> n44754521296994304;\nn45880421203836928 -> n46161896180547584;\nn46161896180547584 -> n45317471250415616;\nn45317471250415616 -> n46724846133968896;\nn46724846133968896 -> n44754521296994304;\nn46724846133968896 -> n46443371157258240;\nn46443371157258240 -> n46724846133968896;\nn46443371157258240 -> n47006321110679552;\nn47006321110679552 -> n44754521296994304;\nn47006321110679552 -> n47287796087390208;\nn47287796087390208 -> n44754521296994304;\nn47287796087390208 -> n47569271064100864;\nn47569271064100864 -> n46724846133968896;\nn44754521296994304 -> n47850746040811520;\nn44754521296994304 -> n48132221017522176;\nn48132221017522176 -> n47850746040811520;\nn48132221017522176 -> n48413695994232832;\nn48413695994232832 -> n48695170970943488;\nn48976645947654144 -> n59391220085948416;\nn59391220085948416 -> n49258120924364800;\nn59391220085948416 -> n48695170970943488;\nn48695170970943488 -> n49539595901075456;\nn48695170970943488 -> n49821070877786112;\nn49821070877786112 -> n50102545854496768;\nn49821070877786112 -> n50384020831207424;\nn50384020831207424 -> n50102545854496768;\nn50384020831207424 -> n50665495807918080;\nn50665495807918080 -> n50946970784628736;\nn50665495807918080 -> n51228445761339392;\nn51228445761339392 -> n50946970784628736;\nn51228445761339392 -> n51509920738050048;\nn51509920738050048 -> n50946970784628736;\nn51509920738050048 -> n51791395714760704;\nn51791395714760704 -> n52072870691471360;\nn51791395714760704 -> n52354345668182016;\nn52354345668182016 -> n52072870691471360;\nn52354345668182016 -> n52635820644892672;\nn52635820644892672 -> n50946970784628736;\nn52635820644892672 -> n52917295621603328;\nn52917295621603328 -> n53198770598313984;\nn52917295621603328 -> n53480245575024640;\nn53480245575024640 -> n53198770598313984;\nn53480245575024640 -> n53761720551735296;\nn53761720551735296 -> n50946970784628736;\nn53761720551735296 -> n54043195528445952;\nn54043195528445952 -> n52072870691471360;\nn54043195528445952 -> n54324670505156608;\nn54324670505156608 -> n52072870691471360;\nn54324670505156608 -> n54606145481867264;\nn54606145481867264 -> n50946970784628736;\nn54606145481867264 -> n54887620458577920;\nn54887620458577920 -> n53198770598313984;\nn54887620458577920 -> n55169095435288576;\nn55169095435288576 -> n53198770598313984;\nn55169095435288576 -> n55450570411999232;\nn55450570411999232 -> n50946970784628736;\nn55450570411999232 -> n55732045388709888;\nn55732045388709888 -> n52072870691471360;\nn55732045388709888 -> n56013520365420544;\nn56013520365420544 -> n52072870691471360;\nn56013520365420544 -> n56294995342131200;\nn56294995342131200 -> n50946970784628736;\nn56294995342131200 -> n56576470318841856;\nn56576470318841856 -> n53198770598313984;\nn56576470318841856 -> n56857945295552512;\nn56857945295552512 -> n53198770598313984;\nn56857945295552512 -> n57139420272263168;\nn57139420272263168 -> n50946970784628736;\nn57139420272263168 -> n57420895248973824;\nn57420895248973824 -> n50946970784628736;\nn50102545854496768 -> n50946970784628736;\nn50946970784628736 -> n49539595901075456;\nn49539595901075456 -> n57702370225684480;\nn49539595901075456 -> n57983845202395136;\nn57983845202395136 -> n58265320179105792;\nn57702370225684480 -> n48976645947654144;\nn57702370225684480 -> n58546795155816448;\nn58546795155816448 -> n58265320179105792;\nn58546795155816448 -> n58828270132527104;\nn58828270132527104 -> n59109745109237760;\nn58828270132527104 -> n58265320179105792;\nn58265320179105792 -> n59109745109237760;\nn59109745109237760 -> n59391220085948416;\nn59109745109237760 -> n59672695062659072;\nn59672695062659072 -> n49258120924364800;\nn52072870691471360 -> n50946970784628736;\nn53198770598313984 -> n50946970784628736;\nn47850746040811520 -> n49258120924364800;\nn49258120924364800 -> n59954170039369728;\nn59954170039369728 -> n59954170039369728[style=dashed];\nn59954170039369728 -> n60235645016080384;\nn60235645016080384 -> n60517119992791040;\nn60798594969501696 -> n61080069946212352;\nn60798594969501696 -> n61361544922923008;\nn61361544922923008 -> n61643019899633664;\nn61643019899633664 -> n61643019899633664[style=dashed];\nn61643019899633664 -> n61924494876344320;\nn61924494876344320 -> n60517119992791040;\nn60517119992791040 -> n60798594969501696;\nn60517119992791040 -> n62205969853054976;\nn61080069946212352 -> n62487444829765632;\nn62487444829765632 -> n62487444829765632[style=dashed];\nn62487444829765632 -> n62768919806476288;\nn62768919806476288 -> n62205969853054976;\nn62768919806476288 -> n63050394783186944;\nn63050394783186944 -> n62205969853054976;\nn63331869759897600 -> n63613344736608256;\nn63613344736608256 -> n63613344736608256[style=dashed];\nn63613344736608256 -> n63894819713318912;\nn63894819713318912 -> n64176294690029568;\nn64457769666740224 -> n64739244643450880;\nn64457769666740224 -> n65020719620161536;\nn65020719620161536 -> n65302194596872192;\nn65302194596872192 -> n65302194596872192[style=dashed];\nn65302194596872192 -> n65583669573582848;\nn65583669573582848 -> n64176294690029568;\nn64176294690029568 -> n64457769666740224;\nn64176294690029568 -> n65865144550293504;\nn64739244643450880 -> n66146619527004160;\nn66146619527004160 -> n66146619527004160[style=dashed];\nn66146619527004160 -> n66428094503714816;\nn66428094503714816 -> n65865144550293504;\nn66428094503714816 -> n66709569480425472;\nn66709569480425472 -> n65865144550293504;\nn66991044457136128 -> n67272519433846784;\nn67553994410557440 -> n67272519433846784;\nn67272519433846784 -> n67835469387268096;\nn67272519433846784 -> n68116944363978752;\nn68116944363978752 -> n68398419340689408;\nn68116944363978752 -> n68679894317400064;\nn68679894317400064 -> n68961369294110720;\nn68679894317400064 -> n69242844270821376;\nn69242844270821376 -> n69524319247532032;\nn69805794224242688 -> n70087269200953344;\nn69805794224242688 -> n69524319247532032;\nn69524319247532032 -> n69805794224242688;\nn69524319247532032 -> n70368744177664000;\nn70368744177664000 -> n69805794224242688;\nn68398419340689408 -> n70650219154374656;\nn68398419340689408 -> n70931694131085312;\nn70931694131085312 -> n71213169107795968;\nn70931694131085312 -> n71494644084506624;\nn71494644084506624 -> n70650219154374656;\nn70087269200953344 -> n68961369294110720;\nn71213169107795968 -> n71776119061217280;\nn71776119061217280 -> n71776119061217280[style=dashed];\nn71776119061217280 -> n68961369294110720;\nn68961369294110720 -> n70650219154374656;\nn70650219154374656 -> n72057594037927936;\nn70650219154374656 -> n72339069014638592;\nn72339069014638592 -> n72057594037927936;\nn72057594037927936 -> n72620543991349248;\nn72057594037927936 -> n72902018968059904;\nn72902018968059904 -> n72902018968059904[style=dashed];\nn72902018968059904 -> n72620543991349248;\nn72620543991349248 -> n73183493944770560;\nn72620543991349248 -> n73464968921481216;\nn73464968921481216 -> n73183493944770560;\nn73183493944770560 -> n73746443898191872;\nn73183493944770560 -> n74027918874902528;\nn74027918874902528 -> n73746443898191872;\nn73746443898191872 -> n74309393851613184;\nn73746443898191872 -> n74590868828323840;\nn74590868828323840 -> n74309393851613184;\nn74309393851613184 -> n67553994410557440;\nn74309393851613184 -> n74872343805034496;\nn74872343805034496 -> n67553994410557440;\nn75153818781745152 -> n75435293758455808;\nn75153818781745152 -> n75716768735166464;\nn75716768735166464 -> n75435293758455808;\nn75998243711877120 -> n76279718688587776;\nn75998243711877120 -> n76561193665298432;\nn76561193665298432 -> n76279718688587776;\nn76279718688587776 -> n76842668642009088;\nn76279718688587776 -> n77124143618719744;\nn77124143618719744 -> n76842668642009088;\nn76842668642009088 -> n77405618595430400;\nn76842668642009088 -> n77687093572141056;\nn77687093572141056 -> n77405618595430400;\nn77405618595430400 -> n77968568548851712;\nn77405618595430400 -> n78250043525562368;\nn78250043525562368 -> n77968568548851712;\nn78531518502273024 -> n78812993478983680;\nn78531518502273024 -> n79094468455694336;\nn79094468455694336 -> n78812993478983680;\nn79375943432404992 -> n79657418409115648;\nn79375943432404992 -> n79938893385826304;\nn79938893385826304 -> n79657418409115648;\nn79938893385826304 -> n80220368362536960;\nn80220368362536960 -> n79657418409115648;\nn79657418409115648 -> n80501843339247616;\nn79657418409115648 -> n80783318315958272;\nn80783318315958272 -> n80501843339247616;\nn80783318315958272 -> n81064793292668928;\nn81064793292668928 -> n80501843339247616;\nn81064793292668928 -> n81346268269379584;\nn81346268269379584 -> n80501843339247616;\nn80501843339247616 -> n81627743246090240;\nn80501843339247616 -> n81909218222800896;\nn81909218222800896 -> n82190693199511552;\nn81909218222800896 -> n82472168176222208;\nn82472168176222208 -> n81627743246090240;\nn82472168176222208 -> n82753643152932864;\nn82753643152932864 -> n81627743246090240;\nn82753643152932864 -> n83035118129643520;\nn83035118129643520 -> n82190693199511552;\nn82190693199511552 -> n83598068083064832;\nn83598068083064832 -> n81627743246090240;\nn83598068083064832 -> n83316593106354176;\nn83316593106354176 -> n83598068083064832;\nn83316593106354176 -> n83879543059775488;\nn83879543059775488 -> n81627743246090240;\nn83879543059775488 -> n84161018036486144;\nn84161018036486144 -> n81627743246090240;\nn84161018036486144 -> n84442493013196800;\nn84442493013196800 -> n83598068083064832;\nn81627743246090240 -> n84723967989907456;\nn81627743246090240 -> n85005442966618112;\nn85005442966618112 -> n84723967989907456;\nn85005442966618112 -> n85286917943328768;\nn85286917943328768 -> n85568392920039424;\nn85849867896750080 -> n96827391988465664;\nn96827391988465664 -> n86131342873460736;\nn96827391988465664 -> n85568392920039424;\nn85568392920039424 -> n86412817850171392;\nn85568392920039424 -> n86694292826882048;\nn86694292826882048 -> n86412817850171392;\nn86694292826882048 -> n86975767803592704;\nn86975767803592704 -> n86412817850171392;\nn86975767803592704 -> n87257242780303360;\nn87257242780303360 -> n87538717757014016;\nn87257242780303360 -> n87820192733724672;\nn87820192733724672 -> n87538717757014016;\nn87820192733724672 -> n88101667710435328;\nn88101667710435328 -> n87538717757014016;\nn88101667710435328 -> n88383142687145984;\nn88383142687145984 -> n88664617663856640;\nn88383142687145984 -> n88946092640567296;\nn88946092640567296 -> n88664617663856640;\nn88946092640567296 -> n89227567617277952;\nn89227567617277952 -> n87538717757014016;\nn89227567617277952 -> n89509042593988608;\nn89509042593988608 -> n89790517570699264;\nn89509042593988608 -> n90071992547409920;\nn90071992547409920 -> n89790517570699264;\nn90071992547409920 -> n90353467524120576;\nn90353467524120576 -> n87538717757014016;\nn90353467524120576 -> n90634942500831232;\nn90634942500831232 -> n88664617663856640;\nn90634942500831232 -> n90916417477541888;\nn90916417477541888 -> n88664617663856640;\nn90916417477541888 -> n91197892454252544;\nn91197892454252544 -> n87538717757014016;\nn91197892454252544 -> n91479367430963200;\nn91479367430963200 -> n89790517570699264;\nn91479367430963200 -> n91760842407673856;\nn91760842407673856 -> n89790517570699264;\nn91760842407673856 -> n92042317384384512;\nn92042317384384512 -> n87538717757014016;\nn92042317384384512 -> n92323792361095168;\nn92323792361095168 -> n88664617663856640;\nn92323792361095168 -> n92605267337805824;\nn92605267337805824 -> n88664617663856640;\nn92605267337805824 -> n92886742314516480;\nn92886742314516480 -> n87538717757014016;\nn92886742314516480 -> n93168217291227136;\nn93168217291227136 -> n89790517570699264;\nn93168217291227136 -> n93449692267937792;\nn93449692267937792 -> n89790517570699264;\nn93449692267937792 -> n93731167244648448;\nn93731167244648448 -> n87538717757014016;\nn93731167244648448 -> n94012642221359104;\nn94012642221359104 -> n87538717757014016;\nn86412817850171392 -> n87538717757014016;\nn87538717757014016 -> n94294117198069760;\nn87538717757014016 -> n94575592174780416;\nn94575592174780416 -> n94857067151491072;\nn94294117198069760 -> n85849867896750080;\nn94294117198069760 -> n95138542128201728;\nn95138542128201728 -> n94857067151491072;\nn95138542128201728 -> n95420017104912384;\nn95420017104912384 -> n95701492081623040;\nn95420017104912384 -> n94857067151491072;\nn94857067151491072 -> n95982967058333696;\nn94857067151491072 -> n96264442035044352;\nn96264442035044352 -> n96545917011755008;\nn96545917011755008 -> n96545917011755008[style=dashed];\nn96545917011755008 -> n95982967058333696;\nn95982967058333696 -> n95701492081623040;\nn95701492081623040 -> n96827391988465664;\nn95701492081623040 -> n97108866965176320;\nn97108866965176320 -> n86131342873460736;\nn88664617663856640 -> n87538717757014016;\nn89790517570699264 -> n87538717757014016;\nn84723967989907456 -> n86131342873460736;\nn84723967989907456 -> n97390341941886976;\nn97390341941886976 -> n97671816918597632;\nn97671816918597632 -> n97671816918597632[style=dashed];\nn97671816918597632 -> n86131342873460736;\nn86131342873460736 -> n97953291895308288;\nn97953291895308288 -> n97953291895308288[style=dashed];\nn97953291895308288 -> n98234766872018944;\nn98234766872018944 -> n98516241848729600;\nn98797716825440256 -> n99079191802150912;\nn98797716825440256 -> n99360666778861568;\nn99360666778861568 -> n99642141755572224;\nn99642141755572224 -> n99642141755572224[style=dashed];\nn99642141755572224 -> n99923616732282880;\nn99923616732282880 -> n98516241848729600;\nn98516241848729600 -> n98797716825440256;\nn98516241848729600 -> n100205091708993536;\nn99079191802150912 -> n100486566685704192;\nn100486566685704192 -> n100486566685704192[style=dashed];\nn100486566685704192 -> n100768041662414848;\nn100768041662414848 -> n100205091708993536;\nn100768041662414848 -> n101049516639125504;\nn101049516639125504 -> n100205091708993536;\nn101330991615836160 -> n101612466592546816;\nn101612466592546816 -> n101612466592546816[style=dashed];\nn101612466592546816 -> n101893941569257472;\nn101893941569257472 -> n102175416545968128;\nn102456891522678784 -> n102738366499389440;\nn102456891522678784 -> n103019841476100096;\nn103019841476100096 -> n103301316452810752;\nn103301316452810752 -> n103301316452810752[style=dashed];\nn103301316452810752 -> n103582791429521408;\nn103582791429521408 -> n102175416545968128;\nn102175416545968128 -> n102456891522678784;\nn102175416545968128 -> n103864266406232064;\nn102738366499389440 -> n104145741382942720;\nn104145741382942720 -> n104145741382942720[style=dashed];\nn104145741382942720 -> n104427216359653376;\nn104427216359653376 -> n103864266406232064;\nn104427216359653376 -> n104708691336364032;\nn104708691336364032 -> n103864266406232064;\nn104990166313074688 -> n105271641289785344;\nn104990166313074688 -> n105553116266496000;\nn105553116266496000 -> n105271641289785344;\nn105834591243206656 -> n106116066219917312;\nn105834591243206656 -> n106397541196627968;\nn106397541196627968 -> n106116066219917312;\nn106397541196627968 -> n106679016173338624;\nn106679016173338624 -> n106116066219917312;\nn106116066219917312 -> n106960491150049280;\nn106116066219917312 -> n107241966126759936;\nn107241966126759936 -> n106960491150049280;\nn107241966126759936 -> n107523441103470592;\nn107523441103470592 -> n106960491150049280;\nn107523441103470592 -> n107804916080181248;\nn107804916080181248 -> n106960491150049280;\nn106960491150049280 -> n108086391056891904;\nn106960491150049280 -> n108367866033602560;\nn108367866033602560 -> n108086391056891904;\nn108367866033602560 -> n108649341010313216;\nn108649341010313216 -> n108086391056891904;\nn108086391056891904 -> n108930815987023872;\nn108086391056891904 -> n109212290963734528;\nn109212290963734528 -> n109493765940445184;\nn109212290963734528 -> n109775240917155840;\nn109775240917155840 -> n108930815987023872;\nn109775240917155840 -> n110056715893866496;\nn110056715893866496 -> n108930815987023872;\nn110056715893866496 -> n110338190870577152;\nn110338190870577152 -> n109493765940445184;\nn109493765940445184 -> n110901140823998464;\nn110901140823998464 -> n108930815987023872;\nn110901140823998464 -> n110619665847287808;\nn110619665847287808 -> n110901140823998464;\nn110619665847287808 -> n111182615800709120;\nn111182615800709120 -> n108930815987023872;\nn111182615800709120 -> n111464090777419776;\nn111464090777419776 -> n108930815987023872;\nn111464090777419776 -> n111745565754130432;\nn111745565754130432 -> n110901140823998464;\nn108930815987023872 -> n112027040730841088;\nn108930815987023872 -> n112308515707551744;\nn112308515707551744 -> n112027040730841088;\nn112308515707551744 -> n112589990684262400;\nn112589990684262400 -> n112871465660973056;\nn113152940637683712 -> n126663739519795200;\nn126663739519795200 -> n113434415614394368;\nn126663739519795200 -> n112871465660973056;\nn112871465660973056 -> n113715890591105024;\nn112871465660973056 -> n113997365567815680;\nn113997365567815680 -> n113715890591105024;\nn113997365567815680 -> n114278840544526336;\nn114278840544526336 -> n113715890591105024;\nn114278840544526336 -> n114560315521236992;\nn114560315521236992 -> n114841790497947648;\nn114560315521236992 -> n115123265474658304;\nn115123265474658304 -> n114841790497947648;\nn115123265474658304 -> n115404740451368960;\nn115404740451368960 -> n114841790497947648;\nn115404740451368960 -> n115686215428079616;\nn115686215428079616 -> n115967690404790272;\nn115686215428079616 -> n116249165381500928;\nn116249165381500928 -> n115967690404790272;\nn116249165381500928 -> n116530640358211584;\nn116530640358211584 -> n114841790497947648;\nn116530640358211584 -> n116812115334922240;\nn116812115334922240 -> n117093590311632896;\nn116812115334922240 -> n117375065288343552;\nn117375065288343552 -> n117093590311632896;\nn117375065288343552 -> n117656540265054208;\nn117656540265054208 -> n114841790497947648;\nn117656540265054208 -> n117938015241764864;\nn117938015241764864 -> n115967690404790272;\nn117938015241764864 -> n118219490218475520;\nn118219490218475520 -> n115967690404790272;\nn118219490218475520 -> n118500965195186176;\nn118500965195186176 -> n114841790497947648;\nn118500965195186176 -> n118782440171896832;\nn118782440171896832 -> n117093590311632896;\nn118782440171896832 -> n119063915148607488;\nn119063915148607488 -> n117093590311632896;\nn119063915148607488 -> n119345390125318144;\nn119345390125318144 -> n114841790497947648;\nn119345390125318144 -> n119626865102028800;\nn119626865102028800 -> n115967690404790272;\nn119626865102028800 -> n119908340078739456;\nn119908340078739456 -> n115967690404790272;\nn119908340078739456 -> n120189815055450112;\nn120189815055450112 -> n114841790497947648;\nn120189815055450112 -> n120471290032160768;\nn120471290032160768 -> n117093590311632896;\nn120471290032160768 -> n120752765008871424;\nn120752765008871424 -> n117093590311632896;\nn120752765008871424 -> n121034239985582080;\nn121034239985582080 -> n114841790497947648;\nn121034239985582080 -> n121315714962292736;\nn121315714962292736 -> n114841790497947648;\nn113715890591105024 -> n114841790497947648;\nn114841790497947648 -> n121597189939003392;\nn114841790497947648 -> n121878664915714048;\nn121878664915714048 -> n122160139892424704;\nn121597189939003392 -> n113152940637683712;\nn121597189939003392 -> n122441614869135360;\nn122441614869135360 -> n122160139892424704;\nn122441614869135360 -> n122723089845846016;\nn122723089845846016 -> n123004564822556672;\nn122723089845846016 -> n122160139892424704;\nn122160139892424704 -> n123286039799267328;\nn122160139892424704 -> n123567514775977984;\nn123567514775977984 -> n123286039799267328;\nn123567514775977984 -> n123848989752688640;\nn123848989752688640 -> n124130464729399296;\nn124411939706109952 -> n123286039799267328;\nn124411939706109952 -> n124130464729399296;\nn124130464729399296 -> n124693414682820608;\nn124130464729399296 -> n124974889659531264;\nn124974889659531264 -> n125256364636241920;\nn124693414682820608 -> n125537839612952576;\nn125537839612952576 -> n125537839612952576[style=dashed];\nn125537839612952576 -> n125819314589663232;\nn125819314589663232 -> n124411939706109952;\nn125819314589663232 -> n125256364636241920;\nn125256364636241920 -> n126100789566373888;\nn126100789566373888 -> n126100789566373888[style=dashed];\nn126100789566373888 -> n126382264543084544;\nn126382264543084544 -> n124411939706109952;\nn123286039799267328 -> n123004564822556672;\nn123004564822556672 -> n126663739519795200;\nn123004564822556672 -> n126945214496505856;\nn126945214496505856 -> n113434415614394368;\nn115967690404790272 -> n114841790497947648;\nn117093590311632896 -> n114841790497947648;\nn112027040730841088 -> n127226689473216512;\nn112027040730841088 -> n127508164449927168;\nn127508164449927168 -> n127226689473216512;\nn127508164449927168 -> n127789639426637824;\nn127789639426637824 -> n128071114403348480;\nn128352589380059136 -> n127226689473216512;\nn128352589380059136 -> n128071114403348480;\nn128071114403348480 -> n128634064356769792;\nn128071114403348480 -> n128915539333480448;\nn128915539333480448 -> n129197014310191104;\nn128634064356769792 -> n129478489286901760;\nn129478489286901760 -> n129478489286901760[style=dashed];\nn129478489286901760 -> n129759964263612416;\nn129759964263612416 -> n128352589380059136;\nn129759964263612416 -> n129197014310191104;\nn129197014310191104 -> n130041439240323072;\nn130041439240323072 -> n130041439240323072[style=dashed];\nn130041439240323072 -> n130322914217033728;\nn130322914217033728 -> n128352589380059136;\nn127226689473216512 -> n113434415614394368;\nn130885864170455040 -> n131167339147165696;\nn131167339147165696 -> n131167339147165696[style=dashed];\nn131167339147165696 -> n131448814123876352;\nn131448814123876352 -> n131730289100587008;\nn132011764077297664 -> n132293239054008320;\nn132011764077297664 -> n132574714030718976;\nn132574714030718976 -> n132856189007429632;\nn132574714030718976 -> n133137663984140288;\nn133137663984140288 -> n132856189007429632;\nn133137663984140288 -> n133419138960850944;\nn133419138960850944 -> n132856189007429632;\nn132856189007429632 -> n133700613937561600;\nn133700613937561600 -> n133700613937561600[style=dashed];\nn133700613937561600 -> n133982088914272256;\nn133982088914272256 -> n131730289100587008;\nn131730289100587008 -> n132011764077297664;\nn131730289100587008 -> n134263563890982912;\nn132293239054008320 -> n134545038867693568;\nn134545038867693568 -> n134545038867693568[style=dashed];\nn134545038867693568 -> n134826513844404224;\nn134826513844404224 -> n134263563890982912;\nn134826513844404224 -> n135107988821114880;\nn135107988821114880 -> n134263563890982912;\nn135389463797825536 -> n135670938774536192;\nn135389463797825536 -> n135952413751246848;\nn135952413751246848 -> n135670938774536192;\nn136233888727957504 -> n136515363704668160;\nn136233888727957504 -> n136796838681378816;\nn136796838681378816 -> n136515363704668160;\nn136796838681378816 -> n137078313658089472;\nn137078313658089472 -> n136515363704668160;\nn136515363704668160 -> n137359788634800128;\nn136515363704668160 -> n137641263611510784;\nn137641263611510784 -> n137359788634800128;\nn137641263611510784 -> n137922738588221440;\nn137922738588221440 -> n137359788634800128;\nn137922738588221440 -> n138204213564932096;\nn138204213564932096 -> n137359788634800128;\nn137359788634800128 -> n138485688541642752;\nn137359788634800128 -> n138767163518353408;\nn138767163518353408 -> n139048638495064064;\nn138767163518353408 -> n139330113471774720;\nn139330113471774720 -> n138485688541642752;\nn139330113471774720 -> n139611588448485376;\nn139611588448485376 -> n138485688541642752;\nn139611588448485376 -> n139893063425196032;\nn139893063425196032 -> n139048638495064064;\nn139048638495064064 -> n140456013378617344;\nn140456013378617344 -> n138485688541642752;\nn140456013378617344 -> n140174538401906688;\nn140174538401906688 -> n140456013378617344;\nn140174538401906688 -> n140737488355328000;\nn140737488355328000 -> n138485688541642752;\nn140737488355328000 -> n141018963332038656;\nn141018963332038656 -> n138485688541642752;\nn141018963332038656 -> n141300438308749312;\nn141300438308749312 -> n140456013378617344;\nn138485688541642752 -> n141581913285459968;\nn138485688541642752 -> n141863388262170624;\nn141863388262170624 -> n141581913285459968;\nn141863388262170624 -> n142144863238881280;\nn142144863238881280 -> n142426338215591936;\nn142707813192302592 -> n156218612074414080;\nn156218612074414080 -> n142989288169013248;\nn156218612074414080 -> n142426338215591936;\nn142426338215591936 -> n143270763145723904;\nn142426338215591936 -> n143552238122434560;\nn143552238122434560 -> n143270763145723904;\nn143552238122434560 -> n143833713099145216;\nn143833713099145216 -> n143270763145723904;\nn143833713099145216 -> n144115188075855872;\nn144115188075855872 -> n144396663052566528;\nn144115188075855872 -> n144678138029277184;\nn144678138029277184 -> n144396663052566528;\nn144678138029277184 -> n144959613005987840;\nn144959613005987840 -> n144396663052566528;\nn144959613005987840 -> n145241087982698496;\nn145241087982698496 -> n145522562959409152;\nn145241087982698496 -> n145804037936119808;\nn145804037936119808 -> n145522562959409152;\nn145804037936119808 -> n146085512912830464;\nn146085512912830464 -> n144396663052566528;\nn146085512912830464 -> n146366987889541120;\nn146366987889541120 -> n146648462866251776;\nn146366987889541120 -> n146929937842962432;\nn146929937842962432 -> n146648462866251776;\nn146929937842962432 -> n147211412819673088;\nn147211412819673088 -> n144396663052566528;\nn147211412819673088 -> n147492887796383744;\nn147492887796383744 -> n145522562959409152;\nn147492887796383744 -> n147774362773094400;\nn147774362773094400 -> n145522562959409152;\nn147774362773094400 -> n148055837749805056;\nn148055837749805056 -> n144396663052566528;\nn148055837749805056 -> n148337312726515712;\nn148337312726515712 -> n146648462866251776;\nn148337312726515712 -> n148618787703226368;\nn148618787703226368 -> n146648462866251776;\nn148618787703226368 -> n148900262679937024;\nn148900262679937024 -> n144396663052566528;\nn148900262679937024 -> n149181737656647680;\nn149181737656647680 -> n145522562959409152;\nn149181737656647680 -> n149463212633358336;\nn149463212633358336 -> n145522562959409152;\nn149463212633358336 -> n149744687610068992;\nn149744687610068992 -> n144396663052566528;\nn149744687610068992 -> n150026162586779648;\nn150026162586779648 -> n146648462866251776;\nn150026162586779648 -> n150307637563490304;\nn150307637563490304 -> n146648462866251776;\nn150307637563490304 -> n150589112540200960;\nn150589112540200960 -> n144396663052566528;\nn150589112540200960 -> n150870587516911616;\nn150870587516911616 -> n144396663052566528;\nn143270763145723904 -> n144396663052566528;\nn144396663052566528 -> n151152062493622272;\nn144396663052566528 -> n151433537470332928;\nn151433537470332928 -> n151715012447043584;\nn151152062493622272 -> n142707813192302592;\nn151152062493622272 -> n151996487423754240;\nn151996487423754240 -> n151715012447043584;\nn151996487423754240 -> n152277962400464896;\nn152277962400464896 -> n152559437377175552;\nn152277962400464896 -> n151715012447043584;\nn151715012447043584 -> n152840912353886208;\nn151715012447043584 -> n153122387330596864;\nn153122387330596864 -> n152840912353886208;\nn153122387330596864 -> n153403862307307520;\nn153403862307307520 -> n153685337284018176;\nn153966812260728832 -> n152840912353886208;\nn153966812260728832 -> n153685337284018176;\nn153685337284018176 -> n154248287237439488;\nn153685337284018176 -> n154529762214150144;\nn154529762214150144 -> n154811237190860800;\nn154248287237439488 -> n155092712167571456;\nn155092712167571456 -> n155092712167571456[style=dashed];\nn155092712167571456 -> n155374187144282112;\nn155374187144282112 -> n153966812260728832;\nn155374187144282112 -> n154811237190860800;\nn154811237190860800 -> n155655662120992768;\nn155655662120992768 -> n155655662120992768[style=dashed];\nn155655662120992768 -> n155937137097703424;\nn155937137097703424 -> n153966812260728832;\nn152840912353886208 -> n152559437377175552;\nn152559437377175552 -> n156218612074414080;\nn152559437377175552 -> n156500087051124736;\nn156500087051124736 -> n142989288169013248;\nn145522562959409152 -> n144396663052566528;\nn146648462866251776 -> n144396663052566528;\nn141581913285459968 -> n142989288169013248;\nn141581913285459968 -> n156781562027835392;\nn156781562027835392 -> n142989288169013248;\nn156781562027835392 -> n157063037004546048;\nn157063037004546048 -> n157344511981256704;\nn157625986957967360 -> n142989288169013248;\nn157625986957967360 -> n157344511981256704;\nn157344511981256704 -> n157907461934678016;\nn157344511981256704 -> n158188936911388672;\nn158188936911388672 -> n158470411888099328;\nn157907461934678016 -> n158751886864809984;\nn158751886864809984 -> n158751886864809984[style=dashed];\nn158751886864809984 -> n159033361841520640;\nn159033361841520640 -> n157625986957967360;\nn159033361841520640 -> n158470411888099328;\nn158470411888099328 -> n159314836818231296;\nn159314836818231296 -> n159314836818231296[style=dashed];\nn159314836818231296 -> n159596311794941952;\nn159596311794941952 -> n157625986957967360;\nn142989288169013248 -> n159877786771652608;\nn159877786771652608 -> n159877786771652608[style=dashed];\nn159877786771652608 -> n160159261748363264;\nn160159261748363264 -> n160440736725073920;\nn160722211701784576 -> n161003686678495232;\nn160722211701784576 -> n161285161655205888;\nn161285161655205888 -> n161566636631916544;\nn161566636631916544 -> n161566636631916544[style=dashed];\nn161566636631916544 -> n161848111608627200;\nn161848111608627200 -> n160440736725073920;\nn160440736725073920 -> n160722211701784576;\nn160440736725073920 -> n162129586585337856;\nn161003686678495232 -> n162411061562048512;\nn162411061562048512 -> n162411061562048512[style=dashed];\nn162411061562048512 -> n162692536538759168;\nn162692536538759168 -> n162129586585337856;\nn162692536538759168 -> n162974011515469824;\nn162974011515469824 -> n162129586585337856;\nn163255486492180480 -> n163536961468891136;\nn163536961468891136 -> n163536961468891136[style=dashed];\nn163536961468891136 -> n163818436445601792;\nn163818436445601792 -> n164099911422312448;\nn164381386399023104 -> n164662861375733760;\nn164381386399023104 -> n164944336352444416;\nn164944336352444416 -> n165225811329155072;\nn165225811329155072 -> n165225811329155072[style=dashed];\nn165225811329155072 -> n165507286305865728;\nn165507286305865728 -> n164099911422312448;\nn164099911422312448 -> n164381386399023104;\nn164099911422312448 -> n165788761282576384;\nn164662861375733760 -> n166070236259287040;\nn166070236259287040 -> n166070236259287040[style=dashed];\nn166070236259287040 -> n166351711235997696;\nn166351711235997696 -> n165788761282576384;\nn166351711235997696 -> n166633186212708352;\nn166633186212708352 -> n165788761282576384;\nn1407374883553280 -> n0[style=dotted];\nn1688849860263936 -> n1407374883553280[style=dotted];\nn2251799813685248 -> n1688849860263936[style=dotted];\nn5066549580791808 -> n2251799813685248[style=dotted];\nn5348024557502464 -> n5066549580791808[style=dotted];\nn5910974510923776 -> n5348024557502464[style=dotted];\nn7881299347898368 -> n7599824371187712[style=dotted];\nn7036874417766400 -> n6755399441055744[style=dotted];\nn8444249301319680 -> n7036874417766400[style=dotted];\nn6473924464345088 -> n5910974510923776[style=dotted];\nn9851624184872960 -> n6473924464345088[style=dotted];\nn10133099161583616 -> n9851624184872960[style=dotted];\nn10696049115004928 -> n10133099161583616[style=dotted];\nn11258999068426240 -> n10696049115004928[style=dotted];\nn11821949021847552 -> n11258999068426240[style=dotted];\nn12384898975268864 -> n11821949021847552[style=dotted];\nn12947848928690176 -> n12384898975268864[style=dotted];\nn13510798882111488 -> n12947848928690176[style=dotted];\nn14073748835532800 -> n13510798882111488[style=dotted];\nn14636698788954112 -> n14073748835532800[style=dotted];\nn18295873486192640 -> n17451448556060672[style=dotted];\nn17169973579350016 -> n15762598695796736[style=dotted];\nn15762598695796736 -> n15481123719086080[style=dotted];\nn18577348462903296 -> n17732923532771328[style=dotted];\nn17732923532771328 -> n17451448556060672[style=dotted];\nn16325548649218048 -> n15481123719086080[style=dotted];\nn15199648742375424 -> n14636698788954112[style=dotted];\nn3377699720527872 -> n0[style=dotted];\nn19140298416324608 -> n0[style=dotted];\nn19421773393035264 -> n19140298416324608[style=dotted];\n\n}\n"
  },
  {
    "path": "src/external/tree-sitter/Makefile",
    "content": "########\n#\n#\tTree-Sitter Base and Common Language Parsers\n#\n\nCFLAGS=/nologo /FC /O2 /GL /Ob3 /Zc:inline /Gm- /Oi /Z7 /Gy /diagnostics:column /Icsharp-tree-sitter/tree-sitter/tree-sitter/lib/include\nLFLAGS=/def:csharp-tree-sitter/tree-sitter/$(@B).def /incremental:no /debug  /OPT:REF /OPT:ICF /LTCG\nLFLAGS2=/def:$(@B).def /incremental:no /debug  /OPT:REF /OPT:ICF /LTCG\n\nBIN=out\n\nDLLS=\\\n\t$(BIN)/tree-sitter.dll \\\n\t$(BIN)/tree-sitter-cpp.dll \\\n\t$(BIN)/tree-sitter-c-sharp.dll \\\n\t$(BIN)/tree-sitter-rust.dll \\\n\t\nall: dirs $(DLLS)\n\ndirs:\n\t@if not exist $(BIN)\\nul mkdir $(BIN)\n\n########\n#\n# \tTree-Sitter Base Library\n#\n$(BIN)/tree-sitter.obj: \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/alloc.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/get_changed_ranges.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/language.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/lexer.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/lib.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/node.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/parser.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/query.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/stack.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/subtree.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/tree.c \\\n\t\tcsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/tree_cursor.c\n\tcl $(CFLAGS) /Fo:$@ \\\n\t\t/Icsharp-tree-sitter/tree-sitter/tree-sitter/lib/src /Icsharp-tree-sitter/tree-sitter/tree-sitter/lib/src/unicode \\\n\t\t/c csharp-tree-sitter/tree-sitter/tree-sitter/lib/src/lib.c\n\n$(BIN)/tree-sitter.dll: $(BIN)/tree-sitter.obj\n\tcl /LD $(CFLAGS) /Fe:$@ $** /link $(LFLAGS)\n\n\n########\n#\n#   C++\n#\n$(BIN)/tree-sitter-cpp-parser.obj: csharp-tree-sitter/tree-sitter/tree-sitter-cpp/src/parser.c\n\tcl $(CFLAGS) /Fo:$@ /Icsharp-tree-sitter/tree-sitter/tree-sitter-cpp/src/include /c $**\n\n$(BIN)/tree-sitter-cpp-scanner.obj: csharp-tree-sitter/tree-sitter/tree-sitter-cpp/src/scanner.c\n\tcl $(CFLAGS) /Fo:$@ /Icsharp-tree-sitter/tree-sitter/tree-sitter-cpp/src/include /c $**\n\n$(BIN)/tree-sitter-cpp.dll: $(BIN)/tree-sitter-cpp-parser.obj $(BIN)/tree-sitter-cpp-scanner.obj\n\tcl /LD $(CFLAGS) /Fe:$@ $** /link $(LFLAGS)\n\n########\n#\n#   C#\n#\n$(BIN)/tree-sitter-c-sharp-parser.obj: tree-sitter-c-sharp/src/parser.c\n\tcl $(CFLAGS) /Fo:$@ /Itree-sitter-c-sharp/src/include /c $**\n\n$(BIN)/tree-sitter-c-sharp-scanner.obj: tree-sitter-c-sharp/src/scanner.c\n\tcl $(CFLAGS) /Fo:$@ /Itree-sitter-c-sharp/src/include /c $**\n\n$(BIN)/tree-sitter-c-sharp.dll: $(BIN)/tree-sitter-c-sharp-parser.obj $(BIN)/tree-sitter-c-sharp-scanner.obj\n\tcl /LD $(CFLAGS) /Fe:$@ $** /link $(LFLAGS2)\n\n########\n#\n#   Rust\n#\n$(BIN)/tree-sitter-rust-parser.obj: tree-sitter-rust/src/parser.c\n\tcl $(CFLAGS) /Fo:$@ /Itree-sitter-rust/src/include /c $**\n\n$(BIN)/tree-sitter-rust-scanner.obj: tree-sitter-rust/src/scanner.c\n\tcl $(CFLAGS) /Fo:$@ /Itree-sitter-rust/src/include /c $**\n\n$(BIN)/tree-sitter-rust.dll: $(BIN)/tree-sitter-rust-parser.obj $(BIN)/tree-sitter-rust-scanner.obj\n\tcl /LD $(CFLAGS) /Fe:$@ $** /link $(LFLAGS2)\n\n########\n#\n#\tClean\n#\nclean:\n\t-del *.obj $(BIN)\\*.obj 2>nul\n\t-del $(BIN)\\tree-sitter*.dll $(BIN)\\tree-sitter*.exp $(BIN)\\tree-sitter*.lib $(BIN)\\tree-sitter*.pdb 2>nul\n\t-del tree-sitter*.dll tree-sitter*.exp tree-sitter*.lib tree-sitter*.pdb 2>nul\n\t-del $(BIN)\\xred.* $(BIN)\\test.exe $(BIN)\\test.exp $(BIN)\\test.pdb $(BIN)\\test.lib 2>nul\n\t-del *~ 2>nul\n\t@-echo.\n\t@-echo."
  },
  {
    "path": "src/external/tree-sitter/tree-sitter-c-sharp.def",
    "content": "LIBRARY TREE-SITTER-C-SHARP\nEXPORTS\n        tree_sitter_c_sharp\n"
  },
  {
    "path": "src/external/tree-sitter/tree-sitter-rust.def",
    "content": "LIBRARY TREE-SITTER-RUST\nEXPORTS\n        tree_sitter_rust"
  }
]